-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.930d059806b764b00a14.js
1 lines (1 loc) · 911 KB
/
main.930d059806b764b00a14.js
1
(window.webpackJsonp=window.webpackJsonp||[]).push([[1],{"+7AZ":function(t,e,n){"use strict";n.r(e),n.d(e,"__extends",function(){return i}),n.d(e,"__assign",function(){return o}),n.d(e,"__rest",function(){return a}),n.d(e,"__decorate",function(){return s}),n.d(e,"__param",function(){return u}),n.d(e,"__metadata",function(){return c}),n.d(e,"__awaiter",function(){return l}),n.d(e,"__generator",function(){return h}),n.d(e,"__exportStar",function(){return f}),n.d(e,"__values",function(){return p}),n.d(e,"__read",function(){return d}),n.d(e,"__spread",function(){return y}),n.d(e,"__await",function(){return g}),n.d(e,"__asyncGenerator",function(){return m}),n.d(e,"__asyncDelegator",function(){return v}),n.d(e,"__asyncValues",function(){return b}),n.d(e,"__makeTemplateObject",function(){return w}),n.d(e,"__importStar",function(){return _}),n.d(e,"__importDefault",function(){return S});var r=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 i(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var o=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 a(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 s(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a}function u(t,e){return function(n,r){e(n,r,t)}}function c(t,e){if("object"==typeof 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 h(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 f(t,e){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}function p(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 d(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 y(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(d(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):l(o[0][2],n)}catch(r){l(o[0][3],r)}var n}function u(t){s("next",t)}function c(t){s("throw",t)}function l(t,e){t(e),o.shift(),o.length&&s(o[0][0],o[0][1])}}function v(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):p(t)}function w(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function _(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}}},"+tJ4":function(t,e,n){"use strict";n.d(e,"a",function(){return r});var r=function(t){return function(e){for(var n=0,r=t.length;n<r&&!e.closed;n++)e.next(t[n]);e.closed||e.complete()}}},"+umK":function(t,e,n){"use strict";function r(){}n.d(e,"a",function(){return r})},"/WYv":function(t,e,n){"use strict";function r(t){return t&&"function"!=typeof t.subscribe&&"function"==typeof t.then}n.d(e,"a",function(){return r})},0:function(t,e,n){t.exports=n("zUnb")},"0/uQ":function(t,e,n){"use strict";var r=n("6blF"),i=n("/WYv"),o=n("2ePl"),a=n("xTla"),s=n("En8+"),u=n("IUTb"),c=n("pugT"),l=n("S5XQ"),h=n("u67D"),f=n("JcRv"),p=n("Fxb1");function d(t,e){if(!e)return t instanceof r.a?t:new r.a(Object(p.a)(t));if(null!=t){if(function(t){return t&&"function"==typeof t[a.a]}(t))return function(t,e){return new r.a(e?function(n){var r=new c.a;return r.add(e.schedule(function(){var i=t[a.a]();r.add(i.subscribe({next:function(t){r.add(e.schedule(function(){return n.next(t)}))},error:function(t){r.add(e.schedule(function(){return n.error(t)}))},complete:function(){r.add(e.schedule(function(){return n.complete()}))}}))})),r}:Object(f.a)(t))}(t,e);if(Object(i.a)(t))return function(t,e){return new r.a(e?function(n){var r=new c.a;return r.add(e.schedule(function(){return t.then(function(t){r.add(e.schedule(function(){n.next(t),r.add(e.schedule(function(){return n.complete()}))}))},function(t){r.add(e.schedule(function(){return n.error(t)}))})})),r}:Object(l.a)(t))}(t,e);if(Object(o.a)(t))return Object(u.a)(t,e);if(function(t){return t&&"function"==typeof t[s.a]}(t)||"string"==typeof t)return function(t,e){if(!t)throw new Error("Iterable cannot be null");return new r.a(e?function(n){var r,i=new c.a;return i.add(function(){r&&"function"==typeof r.return&&r.return()}),i.add(e.schedule(function(){r=t[s.a](),i.add(e.schedule(function(){if(!n.closed){var t,e;try{var i=r.next();t=i.value,e=i.done}catch(o){return void n.error(o)}e?n.complete():(n.next(t),this.schedule())}}))})),i}:Object(h.a)(t))}(t,e)}throw new TypeError((null!==t&&typeof t||t)+" is not observable")}n.d(e,"a",function(){return d})},"15JJ":function(t,e,n){"use strict";n.d(e,"a",function(){return c});var r=n("mrSG"),i=n("MGBS"),o=n("rPjj"),a=n("zotm"),s=n("67Y/"),u=n("0/uQ");function c(t,e){return"function"==typeof e?function(n){return n.pipe(c(function(n,r){return Object(u.a)(t(n,r)).pipe(Object(s.a)(function(t,i){return e(n,t,r,i)}))}))}:function(e){return e.lift(new l(t))}}var l=function(){function t(t){this.project=t}return t.prototype.call=function(t,e){return e.subscribe(new h(t,this.project))},t}(),h=function(t){function e(e,n){var r=t.call(this,e)||this;return r.project=n,r.index=0,r}return r.c(e,t),e.prototype._next=function(t){var e,n=this.index++;try{e=this.project(t,n)}catch(r){return void this.destination.error(r)}this._innerSub(e,t,n)},e.prototype._innerSub=function(t,e,n){var r=this.innerSubscription;r&&r.unsubscribe();var i=new o.a(this,void 0,void 0);this.destination.add(i),this.innerSubscription=Object(a.a)(this,t,e,n,i)},e.prototype._complete=function(){var e=this.innerSubscription;e&&!e.closed||t.prototype._complete.call(this),this.unsubscribe()},e.prototype._unsubscribe=function(){this.innerSubscription=null},e.prototype.notifyComplete=function(e){this.destination.remove(e),this.innerSubscription=null,this.isStopped&&t.prototype._complete.call(this)},e.prototype.notifyNext=function(t,e,n,r,i){this.destination.next(e)},e}(i.a)},"2Bdj":function(t,e,n){"use strict";function r(t){return"function"==typeof t}n.d(e,"a",function(){return r})},"2ePl":function(t,e,n){"use strict";n.d(e,"a",function(){return r});var r=function(t){return t&&"number"==typeof t.length&&"function"!=typeof t}},"67Y/":function(t,e,n){"use strict";n.d(e,"a",function(){return o});var r=n("mrSG"),i=n("FFOo");function o(t,e){return function(n){if("function"!=typeof t)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return n.lift(new a(t,e))}}var a=function(){function t(t,e){this.project=t,this.thisArg=e}return t.prototype.call=function(t,e){return e.subscribe(new s(t,this.project,this.thisArg))},t}(),s=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.project=n,i.count=0,i.thisArg=r||i,i}return r.c(e,t),e.prototype._next=function(t){var e;try{e=this.project.call(this.thisArg,t,this.count++)}catch(n){return void this.destination.error(n)}this.destination.next(e)},e}(i.a)},"6Joi":function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,i=(r=n("wj3C"))&&"object"==typeof r&&"default"in r?r.default:r,o=n("q/0M"),a=n("os0x"),s=n("x7I3"),u=i.SDK_VERSION,c=new o.Logger("@firebase/firestore"),l=function(t){return t[t.DEBUG=0]="DEBUG",t[t.ERROR=1]="ERROR",t[t.SILENT=2]="SILENT",t}({});function h(){return c.logLevel===o.LogLevel.DEBUG?l.DEBUG:c.logLevel===o.LogLevel.SILENT?l.SILENT:l.ERROR}function f(t){switch(t){case l.DEBUG:c.logLevel=o.LogLevel.DEBUG;break;case l.ERROR:c.logLevel=o.LogLevel.ERROR;break;case l.SILENT:c.logLevel=o.LogLevel.SILENT;break;default:c.error("Firestore ("+u+"): Invalid value passed to `setLogLevel`")}}function p(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];if(c.logLevel<=o.LogLevel.DEBUG){var i=n.map(y);c.debug.apply(c,["Firestore ("+u+") ["+t+"]: "+e].concat(i))}}function d(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(c.logLevel<=o.LogLevel.ERROR){var r=e.map(y);c.error.apply(c,["Firestore ("+u+"): "+t].concat(r))}}function y(t){if("string"==typeof t)return t;var e=v.getPlatform();try{return e.formatJSON(t)}catch(n){return t}}function g(t){var e="FIRESTORE ("+u+") INTERNAL ASSERTION FAILED: "+t;throw d(e),new Error(e)}function m(t,e){t||g(e)}var v=function(){function t(){}return t.setPlatform=function(e){t.platform&&g("Platform already defined"),t.platform=e},t.getPlatform=function(){return t.platform||g("Platform not set"),t.platform},t}();function b(){return v.getPlatform().emptyByteString}var w={OK:"ok",CANCELLED:"cancelled",UNKNOWN:"unknown",INVALID_ARGUMENT:"invalid-argument",DEADLINE_EXCEEDED:"deadline-exceeded",NOT_FOUND:"not-found",ALREADY_EXISTS:"already-exists",PERMISSION_DENIED:"permission-denied",UNAUTHENTICATED:"unauthenticated",RESOURCE_EXHAUSTED:"resource-exhausted",FAILED_PRECONDITION:"failed-precondition",ABORTED:"aborted",OUT_OF_RANGE:"out-of-range",UNIMPLEMENTED:"unimplemented",INTERNAL:"internal",UNAVAILABLE:"unavailable",DATA_LOSS:"data-loss"},_=function(t){function e(e,n){var r=t.call(this,n)||this;return r.code=e,r.message=n,r.name="FirebaseError",r.toString=function(){return r.name+": [code="+r.code+"]: "+r.message},r}return a.__extends(e,t),e}(Error);function S(t,e){function n(){var t="This constructor is private.";throw e&&(t+=" ",t+=e),new _(w.INVALID_ARGUMENT,t)}for(var r in n.prototype=t.prototype,t)t.hasOwnProperty(r)&&(n[r]=t[r]);return n}function E(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function T(t,e){return void 0!==t?t:e}function C(t,e){for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){var r=Number(n);isNaN(r)||e(r,t[n])}}function I(t,e){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e(n,t[n])}function A(t){for(var e in m(null!=t&&"object"==typeof t,"isEmpty() expects object parameter."),t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}function O(t,e,n){if(e.length!==n)throw new _(w.INVALID_ARGUMENT,"Function "+t+"() requires "+H(n,"argument")+", but was called with "+H(e.length,"argument")+".")}function D(t,e,n){if(e.length<n)throw new _(w.INVALID_ARGUMENT,"Function "+t+"() requires at least "+H(n,"argument")+", but was called with "+H(e.length,"argument")+".")}function k(t,e,n,r){if(e.length<n||e.length>r)throw new _(w.INVALID_ARGUMENT,"Function "+t+"() requires between "+n+" and "+r+" arguments, but was called with "+H(e.length,"argument")+".")}function N(t,e,n,r){j(t,e,B(n)+" argument",r)}function P(t,e,n,r){void 0!==r&&N(t,e,n,r)}function R(t,e,n,r){j(t,e,n+" option",r)}function x(t,e,n,r){void 0!==r&&R(t,e,n,r)}function M(t,e,n,r,i){void 0!==r&&function(t,e,n,r,i){for(var o=[],a=0,s=i;a<s.length;a++){var u=s[a];if(u===r)return;o.push(U(u))}var c=U(r);throw new _(w.INVALID_ARGUMENT,"Invalid value "+c+" provided to function "+t+'() for option "'+n+'". Acceptable values: '+o.join(", "))}(t,0,n,r,i)}function j(t,e,n,r){if(!("object"===e?L(r):"non-empty string"===e?"string"==typeof r&&""!==r:typeof r===e)){var i=U(r);throw new _(w.INVALID_ARGUMENT,"Function "+t+"() requires its "+n+" to be of type "+e+", but it was: "+i)}}function L(t){return"object"==typeof t&&null!==t&&(Object.getPrototypeOf(t)===Object.prototype||null===Object.getPrototypeOf(t))}function U(t){if(void 0===t)return"undefined";if(null===t)return"null";if("string"==typeof t)return t.length>20&&(t=t.substring(0,20)+"..."),JSON.stringify(t);if("number"==typeof t||"boolean"==typeof t)return""+t;if("object"==typeof t){if(t instanceof Array)return"an array";var e=function(t){if(t.constructor){var e=/function\s+([^\s(]+)\s*\(/.exec(t.constructor.toString());if(e&&e.length>1)return e[1]}return null}(t);return e?"a custom "+e+" object":"an object"}return"function"==typeof t?"a function":g("Unknown wrong type: "+typeof t)}function V(t,e,n){if(void 0===n)throw new _(w.INVALID_ARGUMENT,"Function "+t+"() requires a valid "+B(e)+" argument, but it was undefined.")}function F(t,e,n){I(e,function(e,r){if(n.indexOf(e)<0)throw new _(w.INVALID_ARGUMENT,"Unknown option '"+e+"' passed to function "+t+"(). Available options: "+n.join(", "))})}function q(t,e,n,r){var i=U(r);return new _(w.INVALID_ARGUMENT,"Function "+t+"() requires its "+B(n)+" argument to be a "+e+", but it was: "+i)}function B(t){switch(t){case 1:return"first";case 2:return"second";case 3:return"third";default:return t+"th"}}function H(t,e){return t+" "+e+(1===t?"":"s")}var z=function(){function t(){}return t.newId=function(){for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",e="",n=0;n<20;n++)e+=t.charAt(Math.floor(Math.random()*t.length));return m(20===e.length,"Invalid auto ID: "+e),e},t}();function W(t,e){return t<e?-1:t>e?1:0}function K(t,e){if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(!t[n].isEqual(e[n]))return!1;return!0}function G(){if("undefined"==typeof Uint8Array)throw new _(w.UNIMPLEMENTED,"Uint8Arrays are not available in this environment.")}function Q(){if(!v.getPlatform().base64Available)throw new _(w.UNIMPLEMENTED,"Blobs are unavailable in Firestore in this environment.")}var X=function(){function t(t){Q(),this._binaryString=t}return t.fromBase64String=function(e){O("Blob.fromBase64String",arguments,1),N("Blob.fromBase64String","string",1,e),Q();try{return new t(v.getPlatform().atob(e))}catch(n){throw new _(w.INVALID_ARGUMENT,"Failed to construct Blob from Base64 string: "+n)}},t.fromUint8Array=function(e){if(O("Blob.fromUint8Array",arguments,1),G(),!(e instanceof Uint8Array))throw q("Blob.fromUint8Array","Uint8Array",1,e);return new t(Array.prototype.map.call(e,function(t){return String.fromCharCode(t)}).join(""))},t.prototype.toBase64=function(){return O("Blob.toBase64",arguments,0),Q(),v.getPlatform().btoa(this._binaryString)},t.prototype.toUint8Array=function(){O("Blob.toUint8Array",arguments,0),G();for(var t=new Uint8Array(this._binaryString.length),e=0;e<this._binaryString.length;e++)t[e]=this._binaryString.charCodeAt(e);return t},t.prototype.toString=function(){return"Blob(base64: "+this.toBase64()+")"},t.prototype.isEqual=function(t){return this._binaryString===t._binaryString},t.prototype._compareTo=function(t){return W(this._binaryString,t._binaryString)},t}(),Y=S(X,"Use Blob.fromUint8Array() or Blob.fromBase64String() instead."),J=function(){function t(t,e){if(O("GeoPoint",arguments,2),N("GeoPoint","number",1,t),N("GeoPoint","number",2,e),!isFinite(t)||t<-90||t>90)throw new _(w.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+t);if(!isFinite(e)||e<-180||e>180)throw new _(w.INVALID_ARGUMENT,"Longitude must be a number between -180 and 180, but was: "+e);this._lat=t,this._long=e}return Object.defineProperty(t.prototype,"latitude",{get:function(){return this._lat},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"longitude",{get:function(){return this._long},enumerable:!0,configurable:!0}),t.prototype.isEqual=function(t){return this._lat===t._lat&&this._long===t._long},t.prototype._compareTo=function(t){return W(this._lat,t._lat)||W(this._long,t._long)},t}(),Z=function(){function t(t,e){if(this.seconds=t,this.nanoseconds=e,e<0)throw new _(w.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+e);if(e>=1e9)throw new _(w.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+e);if(t<-62135596800)throw new _(w.INVALID_ARGUMENT,"Timestamp seconds out of range: "+t);if(t>=253402300800)throw new _(w.INVALID_ARGUMENT,"Timestamp seconds out of range: "+t)}return t.now=function(){return t.fromMillis(Date.now())},t.fromDate=function(e){return t.fromMillis(e.getTime())},t.fromMillis=function(e){var n=Math.floor(e/1e3);return new t(n,1e6*(e-1e3*n))},t.prototype.toDate=function(){return new Date(this.toMillis())},t.prototype.toMillis=function(){return 1e3*this.seconds+this.nanoseconds/1e6},t.prototype._compareTo=function(t){return this.seconds===t.seconds?W(this.nanoseconds,t.nanoseconds):W(this.seconds,t.seconds)},t.prototype.isEqual=function(t){return t.seconds===this.seconds&&t.nanoseconds===this.nanoseconds},t.prototype.toString=function(){return"Timestamp(seconds="+this.seconds+", nanoseconds="+this.nanoseconds+")"},t}(),$=function(){return function(t,e,n,r){this.databaseId=t,this.persistenceKey=e,this.host=n,this.ssl=r}}(),tt="(default)",et=function(){function t(t,e){this.projectId=t,this.database=e||tt}return Object.defineProperty(t.prototype,"isDefaultDatabase",{get:function(){return this.database===tt},enumerable:!0,configurable:!0}),t.prototype.isEqual=function(e){return e instanceof t&&e.projectId===this.projectId&&e.database===this.database},t.prototype.compareTo=function(t){return W(this.projectId,t.projectId)||W(this.database,t.database)},t}(),nt=function(){function t(t,e,n){this.init(t,e,n)}return t.prototype.init=function(t,e,n){void 0===e?e=0:e>t.length&&g("offset "+e+" out of range "+t.length),void 0===n?n=t.length-e:n>t.length-e&&g("length "+n+" out of range "+(t.length-e)),this.segments=t,this.offset=e,this.len=n},t.prototype.construct=function(t,e,n){var r=Object.create(Object.getPrototypeOf(this));return r.init(t,e,n),r},Object.defineProperty(t.prototype,"length",{get:function(){return this.len},enumerable:!0,configurable:!0}),t.prototype.isEqual=function(e){return 0===t.comparator(this,e)},t.prototype.child=function(e){var n=this.segments.slice(this.offset,this.limit());return e instanceof t?e.forEach(function(t){n.push(t)}):"string"==typeof e?n.push(e):g("Unknown parameter type for Path.child(): "+e),this.construct(n)},t.prototype.limit=function(){return this.offset+this.length},t.prototype.popFirst=function(t){return m(this.length>=(t=void 0===t?1:t),"Can't call popFirst() with less segments"),this.construct(this.segments,this.offset+t,this.length-t)},t.prototype.popLast=function(){return m(!this.isEmpty(),"Can't call popLast() on empty path"),this.construct(this.segments,this.offset,this.length-1)},t.prototype.firstSegment=function(){return m(!this.isEmpty(),"Can't call firstSegment() on empty path"),this.segments[this.offset]},t.prototype.lastSegment=function(){return m(!this.isEmpty(),"Can't call lastSegment() on empty path"),this.segments[this.limit()-1]},t.prototype.get=function(t){return m(t<this.length,"Index out of range"),this.segments[this.offset+t]},t.prototype.isEmpty=function(){return 0===this.length},t.prototype.isPrefixOf=function(t){if(t.length<this.length)return!1;for(var e=0;e<this.length;e++)if(this.get(e)!==t.get(e))return!1;return!0},t.prototype.isImmediateParentOf=function(t){if(this.length+1!==t.length)return!1;for(var e=0;e<this.length;e++)if(this.get(e)!==t.get(e))return!1;return!0},t.prototype.forEach=function(t){for(var e=this.offset,n=this.limit();e<n;e++)t(this.segments[e])},t.prototype.toArray=function(){return this.segments.slice(this.offset,this.limit())},t.comparator=function(t,e){for(var n=Math.min(t.length,e.length),r=0;r<n;r++){var i=t.get(r),o=e.get(r);if(i<o)return-1;if(i>o)return 1}return t.length<e.length?-1:t.length>e.length?1:0},t}(),rt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e.prototype.canonicalString=function(){return this.toArray().join("/")},e.prototype.toString=function(){return this.canonicalString()},e.fromString=function(t){if(t.indexOf("//")>=0)throw new _(w.INVALID_ARGUMENT,"Invalid path ("+t+"). Paths must not contain // in them.");return new e(t.split("/").filter(function(t){return t.length>0}))},e.EMPTY_PATH=new e([]),e}(nt),it=/^[_a-zA-Z][_a-zA-Z0-9]*$/,ot=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e.isValidIdentifier=function(t){return it.test(t)},e.prototype.canonicalString=function(){return this.toArray().map(function(t){return t=t.replace("\\","\\\\").replace("`","\\`"),e.isValidIdentifier(t)||(t="`"+t+"`"),t}).join(".")},e.prototype.toString=function(){return this.canonicalString()},e.prototype.isKeyField=function(){return 1===this.length&&"__name__"===this.get(0)},e.keyField=function(){return new e(["__name__"])},e.fromServerFormat=function(t){for(var n=[],r="",i=0,o=function(){if(0===r.length)throw new _(w.INVALID_ARGUMENT,"Invalid field path ("+t+"). Paths must not be empty, begin with '.', end with '.', or contain '..'");n.push(r),r=""},a=!1;i<t.length;){var s=t[i];if("\\"===s){if(i+1===t.length)throw new _(w.INVALID_ARGUMENT,"Path has trailing escape character: "+t);var u=t[i+1];if("\\"!==u&&"."!==u&&"`"!==u)throw new _(w.INVALID_ARGUMENT,"Path has invalid escape sequence: "+t);r+=u,i+=2}else"`"===s?(a=!a,i++):"."!==s||a?(r+=s,i++):(o(),i++)}if(o(),a)throw new _(w.INVALID_ARGUMENT,"Unterminated ` in path: "+t);return new e(n)},e.EMPTY_PATH=new e([]),e}(nt),at=function(){function t(e){this.path=e,m(t.isDocumentKey(e),"Invalid DocumentKey with an odd number of segments: "+e.toArray().join("/"))}return t.prototype.isEqual=function(t){return null!==t&&0===rt.comparator(this.path,t.path)},t.prototype.toString=function(){return this.path.toString()},t.comparator=function(t,e){return rt.comparator(t.path,e.path)},t.isDocumentKey=function(t){return t.length%2==0},t.fromSegments=function(e){return new t(new rt(e.slice()))},t.fromPathString=function(e){return new t(rt.fromString(e))},t.EMPTY=new t(new rt([])),t}(),st=function(){function t(t,e){this.key=t,this.version=e}return t.compareByKey=function(t,e){return at.comparator(t.key,e.key)},t}(),ut=function(t){function e(e,n,r,i){var o=t.call(this,e,n)||this;return o.data=r,o.hasLocalMutations=!!i.hasLocalMutations,o.hasCommittedMutations=!!i.hasCommittedMutations,o}return a.__extends(e,t),e.prototype.field=function(t){return this.data.field(t)},e.prototype.fieldValue=function(t){var e=this.field(t);return e?e.value():void 0},e.prototype.value=function(){return this.data.value()},e.prototype.isEqual=function(t){return t instanceof e&&this.key.isEqual(t.key)&&this.version.isEqual(t.version)&&this.data.isEqual(t.data)&&this.hasLocalMutations===t.hasLocalMutations&&this.hasCommittedMutations===t.hasCommittedMutations},e.prototype.toString=function(){return"Document("+this.key+", "+this.version+", "+this.data.toString()+", {hasLocalMutations: "+this.hasLocalMutations+"}), {hasCommittedMutations: "+this.hasCommittedMutations+"})"},Object.defineProperty(e.prototype,"hasPendingWrites",{get:function(){return this.hasLocalMutations||this.hasCommittedMutations},enumerable:!0,configurable:!0}),e.compareByField=function(t,e,n){var r=e.field(t),i=n.field(t);return void 0!==r&&void 0!==i?r.compareTo(i):g("Trying to compare documents on fields that don't exist")},e}(st),ct=function(t){function e(e,n,r){var i=t.call(this,e,n)||this;return i.hasCommittedMutations=!(!r||!r.hasCommittedMutations),i}return a.__extends(e,t),e.prototype.toString=function(){return"NoDocument("+this.key+", "+this.version+")"},Object.defineProperty(e.prototype,"hasPendingWrites",{get:function(){return this.hasCommittedMutations},enumerable:!0,configurable:!0}),e.prototype.isEqual=function(t){return t instanceof e&&t.hasCommittedMutations===this.hasCommittedMutations&&t.version.isEqual(this.version)&&t.key.isEqual(this.key)},e}(st),lt=function(t){function e(e,n){return t.call(this,e,n)||this}return a.__extends(e,t),e.prototype.toString=function(){return"UnknownDocument("+this.key+", "+this.version+")"},Object.defineProperty(e.prototype,"hasPendingWrites",{get:function(){return!0},enumerable:!0,configurable:!0}),e.prototype.isEqual=function(t){return t instanceof e&&t.version.isEqual(this.version)&&t.key.isEqual(this.key)},e}(st),ht=function(){function t(t,e){this.comparator=t,this.root=e||pt.EMPTY}return t.prototype.insert=function(e,n){return new t(this.comparator,this.root.insert(e,n,this.comparator).copy(null,null,pt.BLACK,null,null))},t.prototype.remove=function(e){return new t(this.comparator,this.root.remove(e,this.comparator).copy(null,null,pt.BLACK,null,null))},t.prototype.get=function(t){for(var e=this.root;!e.isEmpty();){var n=this.comparator(t,e.key);if(0===n)return e.value;n<0?e=e.left:n>0&&(e=e.right)}return null},t.prototype.indexOf=function(t){for(var e=0,n=this.root;!n.isEmpty();){var r=this.comparator(t,n.key);if(0===r)return e+n.left.size;r<0?n=n.left:(e+=n.left.size+1,n=n.right)}return-1},t.prototype.isEmpty=function(){return this.root.isEmpty()},Object.defineProperty(t.prototype,"size",{get:function(){return this.root.size},enumerable:!0,configurable:!0}),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.forEach=function(t){this.inorderTraversal(function(e,n){return t(e,n),!1})},t.prototype.reverseTraversal=function(t){return this.root.reverseTraversal(t)},t.prototype.getIterator=function(){return new ft(this.root,null,this.comparator,!1)},t.prototype.getIteratorFrom=function(t){return new ft(this.root,t,this.comparator,!1)},t.prototype.getReverseIterator=function(){return new ft(this.root,null,this.comparator,!0)},t.prototype.getReverseIteratorFrom=function(t){return new ft(this.root,t,this.comparator,!0)},t}(),ft=function(){function t(t,e,n,r){this.isReverse=r,this.nodeStack=[];for(var i=1;!t.isEmpty();)if(i=e?n(t.key,e):1,r&&(i*=-1),i<0)t=this.isReverse?t.left:t.right;else{if(0===i){this.nodeStack.push(t);break}this.nodeStack.push(t),t=this.isReverse?t.right:t.left}}return t.prototype.getNext=function(){m(this.nodeStack.length>0,"getNext() called on iterator when hasNext() is false.");var t=this.nodeStack.pop(),e={key:t.key,value:t.value};if(this.isReverse)for(t=t.left;!t.isEmpty();)this.nodeStack.push(t),t=t.right;else for(t=t.right;!t.isEmpty();)this.nodeStack.push(t),t=t.left;return e},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{key:t.key,value:t.value}},t}(),pt=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:t.EMPTY,this.right=null!=o?o:t.EMPTY,this.size=this.left.size+1+this.right.size}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.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=this,i=n(t,r.key);return(r=i<0?r.copy(null,null,null,r.left.insert(t,e,n),null):0===i?r.copy(null,e,null,null,null):r.copy(null,null,null,null,r.right.insert(t,e,n))).fixUp()},t.prototype.removeMin=function(){if(this.left.isEmpty())return t.EMPTY;var e=this;return e.left.isRed()||e.left.left.isRed()||(e=e.moveRedLeft()),(e=e.copy(null,null,null,e.left.removeMin(),null)).fixUp()},t.prototype.remove=function(e,n){var r,i=this;if(n(e,i.key)<0)i.left.isEmpty()||i.left.isRed()||i.left.left.isRed()||(i=i.moveRedLeft()),i=i.copy(null,null,null,i.left.remove(e,n),null);else{if(i.left.isRed()&&(i=i.rotateRight()),i.right.isEmpty()||i.right.isRed()||i.right.left.isRed()||(i=i.moveRedRight()),0===n(e,i.key)){if(i.right.isEmpty())return t.EMPTY;r=i.right.min(),i=i.copy(r.key,r.value,null,null,i.right.removeMin())}i=i.copy(null,null,null,null,i.right.remove(e,n))}return i.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.size+1},t.prototype.check=function(){if(this.isRed()&&this.left.isRed())throw g("Red node has red child("+this.key+","+this.value+")");if(this.right.isRed())throw g("Right child of ("+this.key+","+this.value+") is red");var t=this.left.check();if(t!==this.right.check())throw g("Black depths differ");return t+(this.isRed()?0:1)},t.EMPTY=null,t.RED=!0,t.BLACK=!1,t}(),dt=function(){function t(){this.size=0}return t.prototype.copy=function(t,e,n,r,i){return this},t.prototype.insert=function(t,e,n){return new pt(t,e)},t.prototype.remove=function(t,e){return this},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.isRed=function(){return!1},t.prototype.checkMaxDepth=function(){return!0},t.prototype.check=function(){return 0},t}();pt.EMPTY=new dt;var yt=function(t){return t[t.NullValue=0]="NullValue",t[t.BooleanValue=1]="BooleanValue",t[t.NumberValue=2]="NumberValue",t[t.TimestampValue=3]="TimestampValue",t[t.StringValue=4]="StringValue",t[t.BlobValue=5]="BlobValue",t[t.RefValue=6]="RefValue",t[t.GeoPointValue=7]="GeoPointValue",t[t.ArrayValue=8]="ArrayValue",t[t.ObjectValue=9]="ObjectValue",t}({}),gt=function(t){return t[t.Default=0]="Default",t[t.Estimate=1]="Estimate",t[t.Previous=2]="Previous",t}({}),mt=function(){function t(t,e){this.serverTimestampBehavior=t,this.timestampsInSnapshots=e}return t.fromSnapshotOptions=function(e,n){switch(e.serverTimestamps){case"estimate":return new t(gt.Estimate,n);case"previous":return new t(gt.Previous,n);case"none":case void 0:return new t(gt.Default,n);default:return g("fromSnapshotOptions() called with invalid options.")}},t}(),vt=function(){function t(){}return t.prototype.toString=function(){var t=this.value();return null===t?"null":t.toString()},t.prototype.defaultCompareTo=function(t){return m(this.typeOrder!==t.typeOrder,"Default compareTo should not be used for values of same type."),W(this.typeOrder,t.typeOrder)},t}(),bt=function(t){function e(){var e=t.call(this)||this;return e.typeOrder=yt.NullValue,e.internalValue=null,e}return a.__extends(e,t),e.prototype.value=function(t){return null},e.prototype.isEqual=function(t){return t instanceof e},e.prototype.compareTo=function(t){return t instanceof e?0:this.defaultCompareTo(t)},e.INSTANCE=new e,e}(vt),wt=function(t){function e(e){var n=t.call(this)||this;return n.internalValue=e,n.typeOrder=yt.BooleanValue,n}return a.__extends(e,t),e.prototype.value=function(t){return this.internalValue},e.prototype.isEqual=function(t){return t instanceof e&&this.internalValue===t.internalValue},e.prototype.compareTo=function(t){return t instanceof e?W(this,t):this.defaultCompareTo(t)},e.of=function(t){return t?e.TRUE:e.FALSE},e.TRUE=new e(!0),e.FALSE=new e(!1),e}(vt),_t=function(t){function e(e){var n=t.call(this)||this;return n.internalValue=e,n.typeOrder=yt.NumberValue,n}return a.__extends(e,t),e.prototype.value=function(t){return this.internalValue},e.prototype.compareTo=function(t){return t instanceof e?(n=this.internalValue)<(r=t.internalValue)?-1:n>r?1:n===r?0:isNaN(n)?isNaN(r)?0:-1:1:this.defaultCompareTo(t);var n,r},e}(vt);function St(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e}var Et=function(t){function e(e){return t.call(this,e)||this}return a.__extends(e,t),e.prototype.isEqual=function(t){return t instanceof e&&St(this.internalValue,t.internalValue)},e}(_t),Tt=function(t){function e(e){var n=t.call(this,e)||this;return n.internalValue=e,n}return a.__extends(e,t),e.prototype.isEqual=function(t){return t instanceof e&&St(this.internalValue,t.internalValue)},e.NAN=new e(NaN),e.POSITIVE_INFINITY=new e(1/0),e.NEGATIVE_INFINITY=new e(-1/0),e}(_t),Ct=function(t){function e(e){var n=t.call(this)||this;return n.internalValue=e,n.typeOrder=yt.StringValue,n}return a.__extends(e,t),e.prototype.value=function(t){return this.internalValue},e.prototype.isEqual=function(t){return t instanceof e&&this.internalValue===t.internalValue},e.prototype.compareTo=function(t){return t instanceof e?W(this.internalValue,t.internalValue):this.defaultCompareTo(t)},e}(vt),It=function(t){function e(e){var n=t.call(this)||this;return n.internalValue=e,n.typeOrder=yt.TimestampValue,n}return a.__extends(e,t),e.prototype.value=function(t){return t&&t.timestampsInSnapshots?this.internalValue:this.internalValue.toDate()},e.prototype.isEqual=function(t){return t instanceof e&&this.internalValue.isEqual(t.internalValue)},e.prototype.compareTo=function(t){return t instanceof e?this.internalValue._compareTo(t.internalValue):t instanceof At?-1:this.defaultCompareTo(t)},e}(vt),At=function(t){function e(e,n){var r=t.call(this)||this;return r.localWriteTime=e,r.previousValue=n,r.typeOrder=yt.TimestampValue,r}return a.__extends(e,t),e.prototype.value=function(t){return t&&t.serverTimestampBehavior===gt.Estimate?new It(this.localWriteTime).value(t):t&&t.serverTimestampBehavior===gt.Previous&&this.previousValue?this.previousValue.value(t):null},e.prototype.isEqual=function(t){return t instanceof e&&this.localWriteTime.isEqual(t.localWriteTime)},e.prototype.compareTo=function(t){return t instanceof e?this.localWriteTime._compareTo(t.localWriteTime):t instanceof It?1:this.defaultCompareTo(t)},e.prototype.toString=function(){return"<ServerTimestamp localTime="+this.localWriteTime.toString()+">"},e}(vt),Ot=function(t){function e(e){var n=t.call(this)||this;return n.internalValue=e,n.typeOrder=yt.BlobValue,n}return a.__extends(e,t),e.prototype.value=function(t){return this.internalValue},e.prototype.isEqual=function(t){return t instanceof e&&this.internalValue.isEqual(t.internalValue)},e.prototype.compareTo=function(t){return t instanceof e?this.internalValue._compareTo(t.internalValue):this.defaultCompareTo(t)},e}(vt),Dt=function(t){function e(e,n){var r=t.call(this)||this;return r.databaseId=e,r.key=n,r.typeOrder=yt.RefValue,r}return a.__extends(e,t),e.prototype.value=function(t){return this.key},e.prototype.isEqual=function(t){return t instanceof e&&this.key.isEqual(t.key)&&this.databaseId.isEqual(t.databaseId)},e.prototype.compareTo=function(t){if(t instanceof e){var n=this.databaseId.compareTo(t.databaseId);return 0!==n?n:at.comparator(this.key,t.key)}return this.defaultCompareTo(t)},e}(vt),kt=function(t){function e(e){var n=t.call(this)||this;return n.internalValue=e,n.typeOrder=yt.GeoPointValue,n}return a.__extends(e,t),e.prototype.value=function(t){return this.internalValue},e.prototype.isEqual=function(t){return t instanceof e&&this.internalValue.isEqual(t.internalValue)},e.prototype.compareTo=function(t){return t instanceof e?this.internalValue._compareTo(t.internalValue):this.defaultCompareTo(t)},e}(vt),Nt=function(t){function e(e){var n=t.call(this)||this;return n.internalValue=e,n.typeOrder=yt.ObjectValue,n}return a.__extends(e,t),e.prototype.value=function(t){var e={};return this.internalValue.inorderTraversal(function(n,r){e[n]=r.value(t)}),e},e.prototype.forEach=function(t){this.internalValue.inorderTraversal(t)},e.prototype.isEqual=function(t){if(t instanceof e){for(var n=this.internalValue.getIterator(),r=t.internalValue.getIterator();n.hasNext()&&r.hasNext();){var i=n.getNext(),o=r.getNext();if(i.key!==o.key||!i.value.isEqual(o.value))return!1}return!n.hasNext()&&!r.hasNext()}return!1},e.prototype.compareTo=function(t){if(t instanceof e){for(var n=this.internalValue.getIterator(),r=t.internalValue.getIterator();n.hasNext()&&r.hasNext();){var i=n.getNext(),o=r.getNext(),a=W(i.key,o.key)||i.value.compareTo(o.value);if(a)return a}return W(n.hasNext(),r.hasNext())}return this.defaultCompareTo(t)},e.prototype.set=function(t,n){if(m(!t.isEmpty(),"Cannot set field for empty path on ObjectValue"),1===t.length)return this.setChild(t.firstSegment(),n);var r=this.child(t.firstSegment());r instanceof e||(r=e.EMPTY);var i=r.set(t.popFirst(),n);return this.setChild(t.firstSegment(),i)},e.prototype.delete=function(t){if(m(!t.isEmpty(),"Cannot delete field for empty path on ObjectValue"),1===t.length)return new e(this.internalValue.remove(t.firstSegment()));var n=this.child(t.firstSegment());if(n instanceof e){var r=n.delete(t.popFirst());return new e(this.internalValue.insert(t.firstSegment(),r))}return this},e.prototype.contains=function(t){return void 0!==this.field(t)},e.prototype.field=function(t){m(!t.isEmpty(),"Can't get field of empty path");var n=this;return t.forEach(function(t){n=n instanceof e&&n.internalValue.get(t)||void 0}),n},e.prototype.toString=function(){return JSON.stringify(this.value())},e.prototype.child=function(t){return this.internalValue.get(t)||void 0},e.prototype.setChild=function(t,n){return new e(this.internalValue.insert(t,n))},e.EMPTY=new e(new ht(W)),e}(vt),Pt=function(t){function e(e){var n=t.call(this)||this;return n.internalValue=e,n.typeOrder=yt.ArrayValue,n}return a.__extends(e,t),e.prototype.value=function(t){return this.internalValue.map(function(e){return e.value(t)})},e.prototype.forEach=function(t){this.internalValue.forEach(t)},e.prototype.isEqual=function(t){if(t instanceof e){if(this.internalValue.length!==t.internalValue.length)return!1;for(var n=0;n<this.internalValue.length;n++)if(!this.internalValue[n].isEqual(t.internalValue[n]))return!1;return!0}return!1},e.prototype.compareTo=function(t){if(t instanceof e){for(var n=Math.min(this.internalValue.length,t.internalValue.length),r=0;r<n;r++){var i=this.internalValue[r].compareTo(t.internalValue[r]);if(i)return i}return W(this.internalValue.length,t.internalValue.length)}return this.defaultCompareTo(t)},e.prototype.toString=function(){return JSON.stringify(this.value())},e}(vt),Rt=Number,xt=Rt.MIN_SAFE_INTEGER||-(Math.pow(2,53)-1),Mt=Rt.MAX_SAFE_INTEGER||Math.pow(2,53)-1,jt=Rt.isInteger||function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t};function Lt(t){return null==t}function Ut(t){return jt(t)&&t<=Mt&&t>=xt}var Vt=function(){function t(t,e,n,r,i,o){void 0===e&&(e=[]),void 0===n&&(n=[]),void 0===r&&(r=null),void 0===i&&(i=null),void 0===o&&(o=null),this.path=t,this.explicitOrderBy=e,this.filters=n,this.limit=r,this.startAt=i,this.endAt=o,this.memoizedCanonicalId=null,this.memoizedOrderBy=null,this.startAt&&this.assertValidBound(this.startAt),this.endAt&&this.assertValidBound(this.endAt)}return t.atPath=function(e){return new t(e)},Object.defineProperty(t.prototype,"orderBy",{get:function(){if(null===this.memoizedOrderBy){var t=this.getInequalityFilterField(),e=this.getFirstOrderByField();if(null!==t&&null===e)this.memoizedOrderBy=t.isKeyField()?[Qt]:[new Gt(t),Qt];else{m(null===t||null!==e&&t.isEqual(e),"First orderBy should match inequality field."),this.memoizedOrderBy=[];for(var n=!1,r=0,i=this.explicitOrderBy;r<i.length;r++){var o=i[r];this.memoizedOrderBy.push(o),o.field.isKeyField()&&(n=!0)}n||this.memoizedOrderBy.push((this.explicitOrderBy.length>0?this.explicitOrderBy[this.explicitOrderBy.length-1].dir:Wt.ASCENDING)===Wt.ASCENDING?Qt:Xt)}}return this.memoizedOrderBy},enumerable:!0,configurable:!0}),t.prototype.addFilter=function(e){m(null==this.getInequalityFilterField()||!(e instanceof Bt)||!e.isInequality()||e.field.isEqual(this.getInequalityFilterField()),"Query must only have one inequality field."),m(!at.isDocumentKey(this.path),"No filtering allowed for document query");var n=this.filters.concat([e]);return new t(this.path,this.explicitOrderBy.slice(),n,this.limit,this.startAt,this.endAt)},t.prototype.addOrderBy=function(e){m(!at.isDocumentKey(this.path),"No ordering allowed for document query"),m(!this.startAt&&!this.endAt,"Bounds must be set after orderBy");var n=this.explicitOrderBy.concat([e]);return new t(this.path,n,this.filters.slice(),this.limit,this.startAt,this.endAt)},t.prototype.withLimit=function(e){return new t(this.path,this.explicitOrderBy.slice(),this.filters.slice(),e,this.startAt,this.endAt)},t.prototype.withStartAt=function(e){return new t(this.path,this.explicitOrderBy.slice(),this.filters.slice(),this.limit,e,this.endAt)},t.prototype.withEndAt=function(e){return new t(this.path,this.explicitOrderBy.slice(),this.filters.slice(),this.limit,this.startAt,e)},t.prototype.canonicalId=function(){if(null===this.memoizedCanonicalId){var t=this.path.canonicalString();t+="|f:";for(var e=0,n=this.filters;e<n.length;e++)t+=n[e].canonicalId(),t+=",";t+="|ob:";for(var r=0,i=this.orderBy;r<i.length;r++)t+=i[r].canonicalId(),t+=",";Lt(this.limit)||(t+="|l:",t+=this.limit),this.startAt&&(t+="|lb:",t+=this.startAt.canonicalId()),this.endAt&&(t+="|ub:",t+=this.endAt.canonicalId()),this.memoizedCanonicalId=t}return this.memoizedCanonicalId},t.prototype.toString=function(){var t="Query("+this.path.canonicalString();return this.filters.length>0&&(t+=", filters: ["+this.filters.join(", ")+"]"),Lt(this.limit)||(t+=", limit: "+this.limit),this.explicitOrderBy.length>0&&(t+=", orderBy: ["+this.explicitOrderBy.join(", ")+"]"),this.startAt&&(t+=", startAt: "+this.startAt.canonicalId()),this.endAt&&(t+=", endAt: "+this.endAt.canonicalId()),t+")"},t.prototype.isEqual=function(t){if(this.limit!==t.limit)return!1;if(this.orderBy.length!==t.orderBy.length)return!1;for(var e=0;e<this.orderBy.length;e++)if(!this.orderBy[e].isEqual(t.orderBy[e]))return!1;if(this.filters.length!==t.filters.length)return!1;for(e=0;e<this.filters.length;e++)if(!this.filters[e].isEqual(t.filters[e]))return!1;return!!this.path.isEqual(t.path)&&!(null!==this.startAt?!this.startAt.isEqual(t.startAt):null!==t.startAt)&&(null!==this.endAt?this.endAt.isEqual(t.endAt):null===t.endAt)},t.prototype.docComparator=function(t,e){for(var n=!1,r=0,i=this.orderBy;r<i.length;r++){var o=i[r],a=o.compare(t,e);if(0!==a)return a;n=n||o.field.isKeyField()}return m(n,"orderBy used that doesn't compare on key field"),0},t.prototype.matches=function(t){return this.matchesAncestor(t)&&this.matchesOrderBy(t)&&this.matchesFilters(t)&&this.matchesBounds(t)},t.prototype.hasLimit=function(){return!Lt(this.limit)},t.prototype.getFirstOrderByField=function(){return this.explicitOrderBy.length>0?this.explicitOrderBy[0].field:null},t.prototype.getInequalityFilterField=function(){for(var t=0,e=this.filters;t<e.length;t++){var n=e[t];if(n instanceof Bt&&n.isInequality())return n.field}return null},t.prototype.hasArrayContainsFilter=function(){return void 0!==this.filters.find(function(t){return t instanceof Bt&&t.op===qt.ARRAY_CONTAINS})},t.prototype.isDocumentQuery=function(){return at.isDocumentKey(this.path)&&0===this.filters.length},t.prototype.matchesAncestor=function(t){var e=t.key.path;return at.isDocumentKey(this.path)?this.path.isEqual(e):this.path.isPrefixOf(e)&&this.path.length===e.length-1},t.prototype.matchesOrderBy=function(t){for(var e=0,n=this.explicitOrderBy;e<n.length;e++){var r=n[e];if(!r.field.isKeyField()&&void 0===t.field(r.field))return!1}return!0},t.prototype.matchesFilters=function(t){for(var e=0,n=this.filters;e<n.length;e++)if(!n[e].matches(t))return!1;return!0},t.prototype.matchesBounds=function(t){return!(this.startAt&&!this.startAt.sortsBeforeDocument(this.orderBy,t)||this.endAt&&this.endAt.sortsBeforeDocument(this.orderBy,t))},t.prototype.assertValidBound=function(t){m(t.position.length<=this.orderBy.length,"Bound is longer than orderBy")},t}(),Ft=function(){function t(){}return t.create=function(t,e,n){if(n.isEqual(bt.INSTANCE)){if(e!==qt.EQUAL)throw new _(w.INVALID_ARGUMENT,"Invalid query. You can only perform equals comparisons on null.");return new Ht(t)}if(n.isEqual(Tt.NAN)){if(e!==qt.EQUAL)throw new _(w.INVALID_ARGUMENT,"Invalid query. You can only perform equals comparisons on NaN.");return new zt(t)}return new Bt(t,e,n)},t}(),qt=function(){function t(t){this.name=t}return t.fromString=function(e){switch(e){case"<":return t.LESS_THAN;case"<=":return t.LESS_THAN_OR_EQUAL;case"==":return t.EQUAL;case">=":return t.GREATER_THAN_OR_EQUAL;case">":return t.GREATER_THAN;case"array-contains":return t.ARRAY_CONTAINS;default:return g("Unknown relation: "+e)}},t.prototype.toString=function(){return this.name},t.prototype.isEqual=function(t){return this.name===t.name},t.LESS_THAN=new t("<"),t.LESS_THAN_OR_EQUAL=new t("<="),t.EQUAL=new t("=="),t.GREATER_THAN=new t(">"),t.GREATER_THAN_OR_EQUAL=new t(">="),t.ARRAY_CONTAINS=new t("array-contains"),t}(),Bt=function(t){function e(e,n,r){var i=t.call(this)||this;return i.field=e,i.op=n,i.value=r,i}return a.__extends(e,t),e.prototype.matches=function(t){if(this.field.isKeyField()){m(this.value instanceof Dt,"Comparing on key, but filter value not a RefValue"),m(this.op!==qt.ARRAY_CONTAINS,"array-contains queries don't make sense on document keys.");var e=at.comparator(t.key,this.value.key);return this.matchesComparison(e)}var n=t.field(this.field);return void 0!==n&&this.matchesValue(n)},e.prototype.matchesValue=function(t){var e=this;return this.op===qt.ARRAY_CONTAINS?t instanceof Pt&&void 0!==t.internalValue.find(function(t){return t.isEqual(e.value)}):this.value.typeOrder===t.typeOrder&&this.matchesComparison(t.compareTo(this.value))},e.prototype.matchesComparison=function(t){switch(this.op){case qt.LESS_THAN:return t<0;case qt.LESS_THAN_OR_EQUAL:return t<=0;case qt.EQUAL:return 0===t;case qt.GREATER_THAN:return t>0;case qt.GREATER_THAN_OR_EQUAL:return t>=0;default:return g("Unknown relation op"+this.op)}},e.prototype.isInequality=function(){return this.op!==qt.EQUAL&&this.op!==qt.ARRAY_CONTAINS},e.prototype.canonicalId=function(){return this.field.canonicalString()+this.op.toString()+this.value.toString()},e.prototype.isEqual=function(t){return t instanceof e&&this.op.isEqual(t.op)&&this.field.isEqual(t.field)&&this.value.isEqual(t.value)},e.prototype.toString=function(){return this.field.canonicalString()+" "+this.op+" "+this.value.value()},e}(Ft),Ht=function(t){function e(e){var n=t.call(this)||this;return n.field=e,n}return a.__extends(e,t),e.prototype.matches=function(t){var e=t.field(this.field);return void 0!==e&&null===e.value()},e.prototype.canonicalId=function(){return this.field.canonicalString()+" IS null"},e.prototype.toString=function(){return this.field.canonicalString()+" IS null"},e.prototype.isEqual=function(t){return t instanceof e&&this.field.isEqual(t.field)},e}(Ft),zt=function(t){function e(e){var n=t.call(this)||this;return n.field=e,n}return a.__extends(e,t),e.prototype.matches=function(t){var e=t.field(this.field),n=e&&e.value();return"number"==typeof n&&isNaN(n)},e.prototype.canonicalId=function(){return this.field.canonicalString()+" IS NaN"},e.prototype.toString=function(){return this.field.canonicalString()+" IS NaN"},e.prototype.isEqual=function(t){return t instanceof e&&this.field.isEqual(t.field)},e}(Ft),Wt=function(){function t(t){this.name=t}return t.prototype.toString=function(){return this.name},t.ASCENDING=new t("asc"),t.DESCENDING=new t("desc"),t}(),Kt=function(){function t(t,e){this.position=t,this.before=e}return t.prototype.canonicalId=function(){for(var t=this.before?"b:":"a:",e=0,n=this.position;e<n.length;e++)t+=n[e].toString();return t},t.prototype.sortsBeforeDocument=function(t,e){m(this.position.length<=t.length,"Bound has more components than query's orderBy");for(var n=0,r=0;r<this.position.length;r++){var i=t[r],o=this.position[r];if(i.field.isKeyField())m(o instanceof Dt,"Bound has a non-key value where the key path is being used."),n=at.comparator(o.key,e.key);else{var a=e.field(i.field);m(void 0!==a,"Field should exist since document matched the orderBy already."),n=o.compareTo(a)}if(i.dir===Wt.DESCENDING&&(n*=-1),0!==n)break}return this.before?n<=0:n<0},t.prototype.isEqual=function(t){if(null===t)return!1;if(this.before!==t.before||this.position.length!==t.position.length)return!1;for(var e=0;e<this.position.length;e++)return this.position[e].isEqual(t.position[e]);return!0},t}(),Gt=function(){function t(t,e){this.field=t,void 0===e&&(e=Wt.ASCENDING),this.dir=e,this.isKeyOrderBy=t.isKeyField()}return t.prototype.compare=function(t,e){var n=this.isKeyOrderBy?ut.compareByKey(t,e):ut.compareByField(this.field,t,e);switch(this.dir){case Wt.ASCENDING:return n;case Wt.DESCENDING:return-1*n;default:return g("Unknown direction: "+this.dir)}},t.prototype.canonicalId=function(){return this.field.canonicalString()+this.dir.toString()},t.prototype.toString=function(){return this.field.canonicalString()+" ("+this.dir+")"},t.prototype.isEqual=function(t){return this.dir===t.dir&&this.field.isEqual(t.field)},t}(),Qt=new Gt(ot.keyField(),Wt.ASCENDING),Xt=new Gt(ot.keyField(),Wt.DESCENDING),Yt=function(){function t(t){this.timestamp=t}return t.fromMicroseconds=function(e){var n=Math.floor(e/1e6);return new t(new Z(n,e%1e6*1e3))},t.fromTimestamp=function(e){return new t(e)},t.forDeletedDoc=function(){return t.MIN},t.prototype.compareTo=function(t){return this.timestamp._compareTo(t.timestamp)},t.prototype.isEqual=function(t){return this.timestamp.isEqual(t.timestamp)},t.prototype.toMicroseconds=function(){return 1e6*this.timestamp.seconds+this.timestamp.nanoseconds/1e3},t.prototype.toString=function(){return"SnapshotVersion("+this.timestamp.toString()+")"},t.prototype.toTimestamp=function(){return this.timestamp},t.MIN=new t(new Z(0,0)),t}(),Jt=function(t){return t[t.Listen=0]="Listen",t[t.ExistenceFilterMismatch=1]="ExistenceFilterMismatch",t[t.LimboResolution=2]="LimboResolution",t}({}),Zt=function(){function t(t,e,n,r,i,o){void 0===i&&(i=Yt.MIN),void 0===o&&(o=b()),this.query=t,this.targetId=e,this.purpose=n,this.sequenceNumber=r,this.snapshotVersion=i,this.resumeToken=o}return t.prototype.copy=function(e){return new t(this.query,this.targetId,this.purpose,void 0===e.sequenceNumber?this.sequenceNumber:e.sequenceNumber,void 0===e.snapshotVersion?this.snapshotVersion:e.snapshotVersion,void 0===e.resumeToken?this.resumeToken:e.resumeToken)},t.prototype.isEqual=function(t){return this.targetId===t.targetId&&this.purpose===t.purpose&&this.sequenceNumber===t.sequenceNumber&&this.snapshotVersion.isEqual(t.snapshotVersion)&&this.resumeToken===t.resumeToken&&this.query.isEqual(t.query)},t}(),$t=function(){function t(t){this.comparator=t,this.data=new ht(this.comparator)}return t.fromMapKeys=function(e){var n=new t(e.comparator);return e.forEach(function(t){n=n.add(t)}),n},t.prototype.has=function(t){return null!==this.data.get(t)},t.prototype.first=function(){return this.data.minKey()},t.prototype.last=function(){return this.data.maxKey()},Object.defineProperty(t.prototype,"size",{get:function(){return this.data.size},enumerable:!0,configurable:!0}),t.prototype.indexOf=function(t){return this.data.indexOf(t)},t.prototype.forEach=function(t){this.data.inorderTraversal(function(e,n){return t(e),!1})},t.prototype.forEachInRange=function(t,e){for(var n=this.data.getIteratorFrom(t[0]);n.hasNext();){var r=n.getNext();if(this.comparator(r.key,t[1])>=0)return;e(r.key)}},t.prototype.forEachWhile=function(t,e){var n;for(n=void 0!==e?this.data.getIteratorFrom(e):this.data.getIterator();n.hasNext();)if(!t(n.getNext().key))return},t.prototype.firstAfterOrEqual=function(t){var e=this.data.getIteratorFrom(t);return e.hasNext()?e.getNext().key:null},t.prototype.add=function(t){return this.copy(this.data.remove(t).insert(t,!0))},t.prototype.delete=function(t){return this.has(t)?this.copy(this.data.remove(t)):this},t.prototype.isEmpty=function(){return this.data.isEmpty()},t.prototype.unionWith=function(t){var e=this;return t.forEach(function(t){e=e.add(t)}),e},t.prototype.isEqual=function(e){if(!(e instanceof t))return!1;if(this.size!==e.size)return!1;for(var n=this.data.getIterator(),r=e.data.getIterator();n.hasNext();){var i=n.getNext().key,o=r.getNext().key;if(0!==this.comparator(i,o))return!1}return!0},t.prototype.toArray=function(){var t=[];return this.forEach(function(e){t.push(e)}),t},t.prototype.toString=function(){var t=[];return this.forEach(function(e){return t.push(e)}),"SortedSet("+t.toString()+")"},t.prototype.copy=function(e){var n=new t(this.comparator);return n.data=e,n},t}(),te=function(){function t(t){this.fields=t}return t.fromArray=function(e){var n=new $t(ot.comparator);return e.forEach(function(t){return n=n.add(t)}),new t(n)},t.prototype.covers=function(t){var e=!1;return this.fields.forEach(function(n){n.isPrefixOf(t)&&(e=!0)}),e},t.prototype.isEqual=function(t){return this.fields.isEqual(t.fields)},t}(),ee=function(){function t(t,e){this.field=t,this.transform=e}return t.prototype.isEqual=function(t){return this.field.isEqual(t.field)&&this.transform.isEqual(t.transform)},t}(),ne=function(){return function(t,e){this.version=t,this.transformResults=e}}(),re=function(t){return t[t.Set=0]="Set",t[t.Patch=1]="Patch",t[t.Transform=2]="Transform",t[t.Delete=3]="Delete",t}({}),ie=function(){function t(t,e){this.updateTime=t,this.exists=e,m(void 0===t||void 0===e,'Precondition can specify "exists" or "updateTime" but not both')}return t.exists=function(e){return new t(void 0,e)},t.updateTime=function(e){return new t(e)},Object.defineProperty(t.prototype,"isNone",{get:function(){return void 0===this.updateTime&&void 0===this.exists},enumerable:!0,configurable:!0}),t.prototype.isValidFor=function(t){return void 0!==this.updateTime?t instanceof ut&&t.version.isEqual(this.updateTime):void 0!==this.exists?this.exists===t instanceof ut:(m(this.isNone,"Precondition should be empty"),!0)},t.prototype.isEqual=function(t){return n=t.updateTime,(null!=(e=this.updateTime)?!(!n||!e.isEqual(n)):e===n)&&this.exists===t.exists;var e,n},t.NONE=new t,t}(),oe=function(){function t(){}return t.prototype.verifyKeyMatches=function(t){null!=t&&m(t.key.isEqual(this.key),"Can only apply a mutation to a document with the same key")},t.getPostMutationVersion=function(t){return t instanceof ut?t.version:Yt.MIN},t}(),ae=function(t){function e(e,n,r){var i=t.call(this)||this;return i.key=e,i.value=n,i.precondition=r,i.type=re.Set,i}return a.__extends(e,t),e.prototype.applyToRemoteDocument=function(t,e){return this.verifyKeyMatches(t),m(null==e.transformResults,"Transform results received by SetMutation."),new ut(this.key,e.version,this.value,{hasCommittedMutations:!0})},e.prototype.applyToLocalView=function(t,e,n){if(this.verifyKeyMatches(t),!this.precondition.isValidFor(t))return t;var r=oe.getPostMutationVersion(t);return new ut(this.key,r,this.value,{hasLocalMutations:!0})},e.prototype.isEqual=function(t){return t instanceof e&&this.key.isEqual(t.key)&&this.value.isEqual(t.value)&&this.precondition.isEqual(t.precondition)},e}(oe),se=function(t){function e(e,n,r,i){var o=t.call(this)||this;return o.key=e,o.data=n,o.fieldMask=r,o.precondition=i,o.type=re.Patch,o}return a.__extends(e,t),e.prototype.applyToRemoteDocument=function(t,e){if(this.verifyKeyMatches(t),m(null==e.transformResults,"Transform results received by PatchMutation."),!this.precondition.isValidFor(t))return new lt(this.key,e.version);var n=this.patchDocument(t);return new ut(this.key,e.version,n,{hasCommittedMutations:!0})},e.prototype.applyToLocalView=function(t,e,n){if(this.verifyKeyMatches(t),!this.precondition.isValidFor(t))return t;var r=oe.getPostMutationVersion(t),i=this.patchDocument(t);return new ut(this.key,r,i,{hasLocalMutations:!0})},e.prototype.isEqual=function(t){return t instanceof e&&this.key.isEqual(t.key)&&this.fieldMask.isEqual(t.fieldMask)&&this.precondition.isEqual(t.precondition)},e.prototype.patchDocument=function(t){return this.patchObject(t instanceof ut?t.data:Nt.EMPTY)},e.prototype.patchObject=function(t){var e=this;return this.fieldMask.fields.forEach(function(n){if(!n.isEmpty()){var r=e.data.field(n);t=void 0!==r?t.set(n,r):t.delete(n)}}),t},e}(oe),ue=function(t){function e(e,n){var r=t.call(this)||this;return r.key=e,r.fieldTransforms=n,r.type=re.Transform,r.precondition=ie.exists(!0),r}return a.__extends(e,t),e.prototype.applyToRemoteDocument=function(t,e){if(this.verifyKeyMatches(t),m(null!=e.transformResults,"Transform results missing for TransformMutation."),!this.precondition.isValidFor(t))return new lt(this.key,e.version);var n=this.requireDocument(t),r=this.serverTransformResults(t,e.transformResults),i=e.version,o=this.transformObject(n.data,r);return new ut(this.key,i,o,{hasCommittedMutations:!0})},e.prototype.applyToLocalView=function(t,e,n){if(this.verifyKeyMatches(t),!this.precondition.isValidFor(t))return t;var r=this.requireDocument(t),i=this.localTransformResults(n,e),o=this.transformObject(r.data,i);return new ut(this.key,r.version,o,{hasLocalMutations:!0})},e.prototype.isEqual=function(t){return t instanceof e&&this.key.isEqual(t.key)&&K(this.fieldTransforms,t.fieldTransforms)&&this.precondition.isEqual(t.precondition)},e.prototype.requireDocument=function(t){m(t instanceof ut,"Unknown MaybeDocument type "+t);var e=t;return m(e.key.isEqual(this.key),"Can only transform a document with the same key"),e},e.prototype.serverTransformResults=function(t,e){var n=[];m(this.fieldTransforms.length===e.length,"server transform result count ("+e.length+") should match field transform count ("+this.fieldTransforms.length+")");for(var r=0;r<e.length;r++){var i=this.fieldTransforms[r],o=i.transform,a=null;t instanceof ut&&(a=t.field(i.field)||null),n.push(o.applyToRemoteDocument(a,e[r]))}return n},e.prototype.localTransformResults=function(t,e){for(var n=[],r=0,i=this.fieldTransforms;r<i.length;r++){var o=i[r],a=o.transform,s=null;e instanceof ut&&(s=e.field(o.field)||null),n.push(a.applyToLocalView(s,t))}return n},e.prototype.transformObject=function(t,e){m(e.length===this.fieldTransforms.length,"TransformResults length mismatch.");for(var n=0;n<this.fieldTransforms.length;n++)t=t.set(this.fieldTransforms[n].field,e[n]);return t},e}(oe),ce=function(t){function e(e,n){var r=t.call(this)||this;return r.key=e,r.precondition=n,r.type=re.Delete,r}return a.__extends(e,t),e.prototype.applyToRemoteDocument=function(t,e){return this.verifyKeyMatches(t),m(null==e.transformResults,"Transform results received by DeleteMutation."),new ct(this.key,e.version,{hasCommittedMutations:!0})},e.prototype.applyToLocalView=function(t,e,n){return this.verifyKeyMatches(t),this.precondition.isValidFor(t)?(t&&m(t.key.isEqual(this.key),"Can only apply mutation to document with same key"),new ct(this.key,Yt.forDeletedDoc())):t},e.prototype.isEqual=function(t){return t instanceof e&&this.key.isEqual(t.key)&&this.precondition.isEqual(t.precondition)},e}(oe),le=function(){function t(){}return t.prototype.applyToLocalView=function(t,e){return new At(e,t)},t.prototype.applyToRemoteDocument=function(t,e){return e},t.prototype.isEqual=function(e){return e instanceof t},t.instance=new t,t}(),he=function(){function t(t){this.elements=t}return t.prototype.applyToLocalView=function(t,e){return this.apply(t)},t.prototype.applyToRemoteDocument=function(t,e){return this.apply(t)},t.prototype.apply=function(t){for(var e=pe(t),n=function(t){e.find(function(e){return e.isEqual(t)})||e.push(t)},r=0,i=this.elements;r<i.length;r++)n(i[r]);return new Pt(e)},t.prototype.isEqual=function(e){return e instanceof t&&K(e.elements,this.elements)},t}(),fe=function(){function t(t){this.elements=t}return t.prototype.applyToLocalView=function(t,e){return this.apply(t)},t.prototype.applyToRemoteDocument=function(t,e){return this.apply(t)},t.prototype.apply=function(t){for(var e=pe(t),n=function(t){e=e.filter(function(e){return!e.isEqual(t)})},r=0,i=this.elements;r<i.length;r++)n(i[r]);return new Pt(e)},t.prototype.isEqual=function(e){return e instanceof t&&K(e.elements,this.elements)},t}();function pe(t){return t instanceof Pt?t.internalValue.slice():[]}var de=function(){function t(t){this.count=t}return t.prototype.isEqual=function(t){return t&&t.count===this.count},t}(),ye=function(t){return t[t.OK=0]="OK",t[t.CANCELLED=1]="CANCELLED",t[t.UNKNOWN=2]="UNKNOWN",t[t.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",t[t.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",t[t.NOT_FOUND=5]="NOT_FOUND",t[t.ALREADY_EXISTS=6]="ALREADY_EXISTS",t[t.PERMISSION_DENIED=7]="PERMISSION_DENIED",t[t.UNAUTHENTICATED=16]="UNAUTHENTICATED",t[t.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",t[t.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",t[t.ABORTED=10]="ABORTED",t[t.OUT_OF_RANGE=11]="OUT_OF_RANGE",t[t.UNIMPLEMENTED=12]="UNIMPLEMENTED",t[t.INTERNAL=13]="INTERNAL",t[t.UNAVAILABLE=14]="UNAVAILABLE",t[t.DATA_LOSS=15]="DATA_LOSS",t}({});function ge(t){switch(t){case w.OK:return g("Treated status OK as error");case w.CANCELLED:case w.UNKNOWN:case w.DEADLINE_EXCEEDED:case w.RESOURCE_EXHAUSTED:case w.INTERNAL:case w.UNAVAILABLE:case w.UNAUTHENTICATED:return!1;case w.INVALID_ARGUMENT:case w.NOT_FOUND:case w.ALREADY_EXISTS:case w.PERMISSION_DENIED:case w.FAILED_PRECONDITION:case w.ABORTED:case w.OUT_OF_RANGE:case w.UNIMPLEMENTED:case w.DATA_LOSS:return!0;default:return g("Unknown status code: "+t)}}function me(t){if(void 0===t)return d("GRPC error has no .code"),w.UNKNOWN;switch(t){case ye.OK:return w.OK;case ye.CANCELLED:return w.CANCELLED;case ye.UNKNOWN:return w.UNKNOWN;case ye.DEADLINE_EXCEEDED:return w.DEADLINE_EXCEEDED;case ye.RESOURCE_EXHAUSTED:return w.RESOURCE_EXHAUSTED;case ye.INTERNAL:return w.INTERNAL;case ye.UNAVAILABLE:return w.UNAVAILABLE;case ye.UNAUTHENTICATED:return w.UNAUTHENTICATED;case ye.INVALID_ARGUMENT:return w.INVALID_ARGUMENT;case ye.NOT_FOUND:return w.NOT_FOUND;case ye.ALREADY_EXISTS:return w.ALREADY_EXISTS;case ye.PERMISSION_DENIED:return w.PERMISSION_DENIED;case ye.FAILED_PRECONDITION:return w.FAILED_PRECONDITION;case ye.ABORTED:return w.ABORTED;case ye.OUT_OF_RANGE:return w.OUT_OF_RANGE;case ye.UNIMPLEMENTED:return w.UNIMPLEMENTED;case ye.DATA_LOSS:return w.DATA_LOSS;default:return g("Unknown status code: "+t)}}function ve(t){if(void 0===t)return ye.OK;switch(t){case w.OK:return ye.OK;case w.CANCELLED:return ye.CANCELLED;case w.UNKNOWN:return ye.UNKNOWN;case w.DEADLINE_EXCEEDED:return ye.DEADLINE_EXCEEDED;case w.RESOURCE_EXHAUSTED:return ye.RESOURCE_EXHAUSTED;case w.INTERNAL:return ye.INTERNAL;case w.UNAVAILABLE:return ye.UNAVAILABLE;case w.UNAUTHENTICATED:return ye.UNAUTHENTICATED;case w.INVALID_ARGUMENT:return ye.INVALID_ARGUMENT;case w.NOT_FOUND:return ye.NOT_FOUND;case w.ALREADY_EXISTS:return ye.ALREADY_EXISTS;case w.PERMISSION_DENIED:return ye.PERMISSION_DENIED;case w.FAILED_PRECONDITION:return ye.FAILED_PRECONDITION;case w.ABORTED:return ye.ABORTED;case w.OUT_OF_RANGE:return ye.OUT_OF_RANGE;case w.UNIMPLEMENTED:return ye.UNIMPLEMENTED;case w.DATA_LOSS:return ye.DATA_LOSS;default:return g("Unknown status code: "+t)}}var be=new ht(at.comparator);function we(){return be}var _e=new ht(at.comparator);function Se(){return _e}var Ee=new ht(at.comparator);function Te(){return Ee}var Ce=new $t(at.comparator);function Ie(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var n=Ce,r=0,i=t;r<i.length;r++)n=n.add(i[r]);return n}var Ae=new $t(W);function Oe(){return Ae}var De=function(){function t(t){this.comparator=t?function(e,n){return t(e,n)||at.comparator(e.key,n.key)}:function(t,e){return at.comparator(t.key,e.key)},this.keyedMap=Se(),this.sortedSet=new ht(this.comparator)}return t.emptySet=function(e){return new t(e.comparator)},t.prototype.has=function(t){return null!=this.keyedMap.get(t)},t.prototype.get=function(t){return this.keyedMap.get(t)},t.prototype.first=function(){return this.sortedSet.minKey()},t.prototype.last=function(){return this.sortedSet.maxKey()},t.prototype.isEmpty=function(){return this.sortedSet.isEmpty()},t.prototype.indexOf=function(t){var e=this.keyedMap.get(t);return e?this.sortedSet.indexOf(e):-1},Object.defineProperty(t.prototype,"size",{get:function(){return this.sortedSet.size},enumerable:!0,configurable:!0}),t.prototype.forEach=function(t){this.sortedSet.inorderTraversal(function(e,n){return t(e),!1})},t.prototype.add=function(t){var e=this.delete(t.key);return e.copy(e.keyedMap.insert(t.key,t),e.sortedSet.insert(t,null))},t.prototype.delete=function(t){var e=this.get(t);return e?this.copy(this.keyedMap.remove(t),this.sortedSet.remove(e)):this},t.prototype.isEqual=function(e){if(!(e instanceof t))return!1;if(this.size!==e.size)return!1;for(var n=this.sortedSet.getIterator(),r=e.sortedSet.getIterator();n.hasNext();){var i=n.getNext().key,o=r.getNext().key;if(!i.isEqual(o))return!1}return!0},t.prototype.toString=function(){var t=[];return this.forEach(function(e){t.push(e.toString())}),0===t.length?"DocumentSet ()":"DocumentSet (\n "+t.join(" \n")+"\n)"},t.prototype.copy=function(e,n){var r=new t;return r.comparator=this.comparator,r.keyedMap=e,r.sortedSet=n,r},t}(),ke=function(t){return t[t.Added=0]="Added",t[t.Removed=1]="Removed",t[t.Modified=2]="Modified",t[t.Metadata=3]="Metadata",t}({}),Ne=function(t){return t[t.Local=0]="Local",t[t.Synced=1]="Synced",t}({}),Pe=function(){function t(){this.changeMap=new ht(at.comparator)}return t.prototype.track=function(t){var e=t.doc.key,n=this.changeMap.get(e);n?t.type!==ke.Added&&n.type===ke.Metadata?this.changeMap=this.changeMap.insert(e,t):t.type===ke.Metadata&&n.type!==ke.Removed?this.changeMap=this.changeMap.insert(e,{type:n.type,doc:t.doc}):t.type===ke.Modified&&n.type===ke.Modified?this.changeMap=this.changeMap.insert(e,{type:ke.Modified,doc:t.doc}):t.type===ke.Modified&&n.type===ke.Added?this.changeMap=this.changeMap.insert(e,{type:ke.Added,doc:t.doc}):t.type===ke.Removed&&n.type===ke.Added?this.changeMap=this.changeMap.remove(e):t.type===ke.Removed&&n.type===ke.Modified?this.changeMap=this.changeMap.insert(e,{type:ke.Removed,doc:n.doc}):t.type===ke.Added&&n.type===ke.Removed?this.changeMap=this.changeMap.insert(e,{type:ke.Modified,doc:t.doc}):g("unsupported combination of changes: "+JSON.stringify(t)+" after "+JSON.stringify(n)):this.changeMap=this.changeMap.insert(e,t)},t.prototype.getChanges=function(){var t=[];return this.changeMap.inorderTraversal(function(e,n){t.push(n)}),t},t}(),Re=function(){function t(t,e,n,r,i,o,a,s){this.query=t,this.docs=e,this.oldDocs=n,this.docChanges=r,this.mutatedKeys=i,this.fromCache=o,this.syncStateChanged=a,this.excludesMetadataChanges=s}return t.fromInitialDocuments=function(e,n,r,i){var o=[];return n.forEach(function(t){o.push({type:ke.Added,doc:t})}),new t(e,n,De.emptySet(n),o,r,i,!0,!1)},Object.defineProperty(t.prototype,"hasPendingWrites",{get:function(){return!this.mutatedKeys.isEmpty()},enumerable:!0,configurable:!0}),t.prototype.isEqual=function(t){if(!(this.fromCache===t.fromCache&&this.syncStateChanged===t.syncStateChanged&&this.mutatedKeys.isEqual(t.mutatedKeys)&&this.query.isEqual(t.query)&&this.docs.isEqual(t.docs)&&this.oldDocs.isEqual(t.oldDocs)))return!1;var e=this.docChanges,n=t.docChanges;if(e.length!==n.length)return!1;for(var r=0;r<e.length;r++)if(e[r].type!==n[r].type||!e[r].doc.isEqual(n[r].doc))return!1;return!0},t}(),xe=function(){function t(t,e,n,r,i){this.snapshotVersion=t,this.targetChanges=e,this.targetMismatches=n,this.documentUpdates=r,this.resolvedLimboDocuments=i}return t.createSynthesizedRemoteEventForCurrentChange=function(e,n){var r,i=((r={})[e]=Me.createSynthesizedTargetChangeForCurrentChange(e,n),r);return new t(Yt.MIN,i,Oe(),we(),Ie())},t}(),Me=function(){function t(t,e,n,r,i){this.resumeToken=t,this.current=e,this.addedDocuments=n,this.modifiedDocuments=r,this.removedDocuments=i}return t.createSynthesizedTargetChangeForCurrentChange=function(e,n){return new t(b(),n,Ie(),Ie(),Ie())},t}(),je=function(){return function(t,e,n,r){this.updatedTargetIds=t,this.removedTargetIds=e,this.key=n,this.newDoc=r}}(),Le=function(){return function(t,e){this.targetId=t,this.existenceFilter=e}}(),Ue=function(t){return t[t.NoChange=0]="NoChange",t[t.Added=1]="Added",t[t.Removed=2]="Removed",t[t.Current=3]="Current",t[t.Reset=4]="Reset",t}({}),Ve=function(){return function(t,e,n,r){void 0===n&&(n=b()),void 0===r&&(r=null),this.state=t,this.targetIds=e,this.resumeToken=n,this.cause=r}}(),Fe=function(){function t(){this.pendingResponses=0,this.documentChanges=He(),this._resumeToken=b(),this._current=!1,this._hasPendingChanges=!0}return Object.defineProperty(t.prototype,"current",{get:function(){return this._current},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"resumeToken",{get:function(){return this._resumeToken},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isPending",{get:function(){return 0!==this.pendingResponses},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"hasPendingChanges",{get:function(){return this._hasPendingChanges},enumerable:!0,configurable:!0}),t.prototype.updateResumeToken=function(t){t.length>0&&(this._hasPendingChanges=!0,this._resumeToken=t)},t.prototype.toTargetChange=function(){var t=Ie(),e=Ie(),n=Ie();return this.documentChanges.forEach(function(r,i){switch(i){case ke.Added:t=t.add(r);break;case ke.Modified:e=e.add(r);break;case ke.Removed:n=n.add(r);break;default:g("Encountered invalid change type: "+i)}}),new Me(this._resumeToken,this._current,t,e,n)},t.prototype.clearPendingChanges=function(){this._hasPendingChanges=!1,this.documentChanges=He()},t.prototype.addDocumentChange=function(t,e){this._hasPendingChanges=!0,this.documentChanges=this.documentChanges.insert(t,e)},t.prototype.removeDocumentChange=function(t){this._hasPendingChanges=!0,this.documentChanges=this.documentChanges.remove(t)},t.prototype.recordPendingTargetRequest=function(){this.pendingResponses+=1},t.prototype.recordTargetResponse=function(){this.pendingResponses-=1},t.prototype.markCurrent=function(){this._hasPendingChanges=!0,this._current=!0},t}(),qe=function(){function t(t){this.metadataProvider=t,this.targetStates={},this.pendingDocumentUpdates=we(),this.pendingDocumentTargetMapping=Be(),this.pendingTargetResets=new $t(W)}return t.prototype.handleDocumentChange=function(t){for(var e=0,n=t.updatedTargetIds;e<n.length;e++){var r=n[e];t.newDoc instanceof ut?this.addDocumentToTarget(r,t.newDoc):t.newDoc instanceof ct&&this.removeDocumentFromTarget(r,t.key,t.newDoc)}for(var i=0,o=t.removedTargetIds;i<o.length;i++)this.removeDocumentFromTarget(r=o[i],t.key,t.newDoc)},t.prototype.handleTargetChange=function(t){var e=this;this.forEachTarget(t,function(n){var r=e.ensureTargetState(n);switch(t.state){case Ue.NoChange:e.isActiveTarget(n)&&r.updateResumeToken(t.resumeToken);break;case Ue.Added:r.recordTargetResponse(),r.isPending||r.clearPendingChanges(),r.updateResumeToken(t.resumeToken);break;case Ue.Removed:r.recordTargetResponse(),r.isPending||e.removeTarget(n),m(!t.cause,"WatchChangeAggregator does not handle errored targets");break;case Ue.Current:e.isActiveTarget(n)&&(r.markCurrent(),r.updateResumeToken(t.resumeToken));break;case Ue.Reset:e.isActiveTarget(n)&&(e.resetTarget(n),r.updateResumeToken(t.resumeToken));break;default:g("Unknown target watch change state: "+t.state)}})},t.prototype.forEachTarget=function(t,e){t.targetIds.length>0?t.targetIds.forEach(e):C(this.targetStates,e)},t.prototype.handleExistenceFilter=function(t){var e=t.targetId,n=t.existenceFilter.count,r=this.queryDataForActiveTarget(e);if(r){var i=r.query;if(i.isDocumentQuery())if(0===n){var o=new at(i.path);this.removeDocumentFromTarget(e,o,new ct(o,Yt.forDeletedDoc()))}else m(1===n,"Single document existence filter with count: "+n);else this.getCurrentDocumentCountForTarget(e)!==n&&(this.resetTarget(e),this.pendingTargetResets=this.pendingTargetResets.add(e))}},t.prototype.createRemoteEvent=function(t){var e=this,n={};C(this.targetStates,function(r,i){var o=e.queryDataForActiveTarget(r);if(o){if(i.current&&o.query.isDocumentQuery()){var a=new at(o.query.path);null!==e.pendingDocumentUpdates.get(a)||e.targetContainsDocument(r,a)||e.removeDocumentFromTarget(r,a,new ct(a,t))}i.hasPendingChanges&&(n[r]=i.toTargetChange(),i.clearPendingChanges())}});var r=Ie();this.pendingDocumentTargetMapping.forEach(function(t,n){var i=!0;n.forEachWhile(function(t){var n=e.queryDataForActiveTarget(t);return!n||n.purpose===Jt.LimboResolution||(i=!1,!1)}),i&&(r=r.add(t))});var i=new xe(t,n,this.pendingTargetResets,this.pendingDocumentUpdates,r);return this.pendingDocumentUpdates=we(),this.pendingDocumentTargetMapping=Be(),this.pendingTargetResets=new $t(W),i},t.prototype.addDocumentToTarget=function(t,e){if(this.isActiveTarget(t)){var n=this.targetContainsDocument(t,e.key)?ke.Modified:ke.Added;this.ensureTargetState(t).addDocumentChange(e.key,n),this.pendingDocumentUpdates=this.pendingDocumentUpdates.insert(e.key,e),this.pendingDocumentTargetMapping=this.pendingDocumentTargetMapping.insert(e.key,this.ensureDocumentTargetMapping(e.key).add(t))}},t.prototype.removeDocumentFromTarget=function(t,e,n){if(this.isActiveTarget(t)){var r=this.ensureTargetState(t);this.targetContainsDocument(t,e)?r.addDocumentChange(e,ke.Removed):r.removeDocumentChange(e),this.pendingDocumentTargetMapping=this.pendingDocumentTargetMapping.insert(e,this.ensureDocumentTargetMapping(e).delete(t)),n&&(this.pendingDocumentUpdates=this.pendingDocumentUpdates.insert(e,n))}},t.prototype.removeTarget=function(t){delete this.targetStates[t]},t.prototype.getCurrentDocumentCountForTarget=function(t){var e=this.ensureTargetState(t).toTargetChange();return this.metadataProvider.getRemoteKeysForTarget(t).size+e.addedDocuments.size-e.removedDocuments.size},t.prototype.recordPendingTargetRequest=function(t){this.ensureTargetState(t).recordPendingTargetRequest()},t.prototype.ensureTargetState=function(t){return this.targetStates[t]||(this.targetStates[t]=new Fe),this.targetStates[t]},t.prototype.ensureDocumentTargetMapping=function(t){var e=this.pendingDocumentTargetMapping.get(t);return e||(e=new $t(W),this.pendingDocumentTargetMapping=this.pendingDocumentTargetMapping.insert(t,e)),e},t.prototype.isActiveTarget=function(t){return null!==this.queryDataForActiveTarget(t)},t.prototype.queryDataForActiveTarget=function(t){var e=this.targetStates[t];return e&&e.isPending?null:this.metadataProvider.getQueryDataForTarget(t)},t.prototype.resetTarget=function(t){var e=this;m(!this.targetStates[t].isPending,"Should only reset active targets"),this.targetStates[t]=new Fe,this.metadataProvider.getRemoteKeysForTarget(t).forEach(function(n){e.removeDocumentFromTarget(t,n,null)})},t.prototype.targetContainsDocument=function(t,e){return this.metadataProvider.getRemoteKeysForTarget(t).has(e)},t}();function Be(){return new ht(at.comparator)}function He(){return new ht(at.comparator)}var ze,We,Ke=((ze={})[Wt.ASCENDING.name]="ASCENDING",ze[Wt.DESCENDING.name]="DESCENDING",ze),Ge=((We={})[qt.LESS_THAN.name]="LESS_THAN",We[qt.LESS_THAN_OR_EQUAL.name]="LESS_THAN_OR_EQUAL",We[qt.GREATER_THAN.name]="GREATER_THAN",We[qt.GREATER_THAN_OR_EQUAL.name]="GREATER_THAN_OR_EQUAL",We[qt.EQUAL.name]="EQUAL",We[qt.ARRAY_CONTAINS.name]="ARRAY_CONTAINS",We),Qe=new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);function Xe(t,e){m(!Lt(t),e+" is missing")}function Ye(t){return"number"==typeof t?t:"string"==typeof t?Number(t):g("can't parse "+t)}var Je=function(){function t(t,e){this.databaseId=t,this.options=e}return t.prototype.emptyByteString=function(){return this.options.useProto3Json?"":new Uint8Array(0)},t.prototype.unsafeCastProtoByteString=function(t){return t},t.prototype.fromRpcStatus=function(t){var e=void 0===t.code?w.UNKNOWN:me(t.code);return new _(e,t.message||"")},t.prototype.toInt32Value=function(t){return Lt(t)?void 0:{value:t}},t.prototype.fromInt32Value=function(t){var e;return Lt(e="object"==typeof t?t.value:t)?null:e},t.prototype.toTimestamp=function(t){return{seconds:t.seconds,nanos:t.nanoseconds}},t.prototype.fromTimestamp=function(t){if("string"==typeof t)return this.fromIso8601String(t);m(!!t,"Cannot deserialize null or undefined timestamp.");var e=Ye(t.seconds||"0");return new Z(e,t.nanos||0)},t.prototype.fromIso8601String=function(t){var e=0,n=Qe.exec(t);if(m(!!n,"invalid timestamp: "+t),n[1]){var r=n[1];r=(r+"000000000").substr(0,9),e=Number(r)}var i=new Date(t),o=Math.floor(i.getTime()/1e3);return new Z(o,e)},t.prototype.toBytes=function(t){return this.options.useProto3Json?t.toBase64():this.unsafeCastProtoByteString(t.toUint8Array())},t.prototype.fromBlob=function(t){return"string"==typeof t?(m(this.options.useProto3Json,"Expected bytes to be passed in as Uint8Array, but got a string instead."),X.fromBase64String(t)):(m(!this.options.useProto3Json,"Expected bytes to be passed in as string, but got something else instead."),X.fromUint8Array(t))},t.prototype.toVersion=function(t){return this.toTimestamp(t.toTimestamp())},t.prototype.fromVersion=function(t){return m(!!t,"Trying to deserialize version that isn't set"),Yt.fromTimestamp(this.fromTimestamp(t))},t.prototype.toResourceName=function(t,e){return this.fullyQualifiedPrefixPath(t).child("documents").child(e).canonicalString()},t.prototype.fromResourceName=function(t){var e=rt.fromString(t);return m(this.isValidResourceName(e),"Tried to deserialize invalid key "+e.toString()),e},t.prototype.toName=function(t){return this.toResourceName(this.databaseId,t.path)},t.prototype.fromName=function(t){var e=this.fromResourceName(t);return m(e.get(1)===this.databaseId.projectId,"Tried to deserialize key from different project: "+e.get(1)+" vs "+this.databaseId.projectId),m(!e.get(3)&&!this.databaseId.database||e.get(3)===this.databaseId.database,"Tried to deserialize key from different database: "+e.get(3)+" vs "+this.databaseId.database),new at(this.extractLocalPathFromResourceName(e))},t.prototype.toQueryPath=function(t){return 0===t.length?this.encodedDatabaseId:this.toResourceName(this.databaseId,t)},t.prototype.fromQueryPath=function(t){var e=this.fromResourceName(t);return 4===e.length?rt.EMPTY_PATH:this.extractLocalPathFromResourceName(e)},Object.defineProperty(t.prototype,"encodedDatabaseId",{get:function(){return new rt(["projects",this.databaseId.projectId,"databases",this.databaseId.database]).canonicalString()},enumerable:!0,configurable:!0}),t.prototype.fullyQualifiedPrefixPath=function(t){return new rt(["projects",t.projectId,"databases",t.database])},t.prototype.extractLocalPathFromResourceName=function(t){return m(t.length>4&&"documents"===t.get(4),"tried to deserialize invalid key "+t.toString()),t.popFirst(5)},t.prototype.isValidResourceName=function(t){return t.length>=4&&"projects"===t.get(0)&&"databases"===t.get(2)},t.prototype.toValue=function(t){if(t instanceof bt)return{nullValue:"NULL_VALUE"};if(t instanceof wt)return{booleanValue:t.value()};if(t instanceof Et)return{integerValue:""+t.value()};if(t instanceof Tt){var e=t.value();if(this.options.useProto3Json){if(isNaN(e))return{doubleValue:"NaN"};if(e===1/0)return{doubleValue:"Infinity"};if(e===-1/0)return{doubleValue:"-Infinity"}}return{doubleValue:t.value()}}return t instanceof Ct?{stringValue:t.value()}:t instanceof Nt?{mapValue:this.toMapValue(t)}:t instanceof Pt?{arrayValue:this.toArrayValue(t)}:t instanceof It?{timestampValue:this.toTimestamp(t.internalValue)}:t instanceof kt?{geoPointValue:{latitude:t.value().latitude,longitude:t.value().longitude}}:t instanceof Ot?{bytesValue:this.toBytes(t.value())}:t instanceof Dt?{referenceValue:this.toResourceName(t.databaseId,t.key.path)}:g("Unknown FieldValue "+JSON.stringify(t))},t.prototype.fromValue=function(t){var e=this,n=t.value_type;if(Ze(t,n,"nullValue"))return bt.INSTANCE;if(Ze(t,n,"booleanValue"))return wt.of(t.booleanValue);if(Ze(t,n,"integerValue"))return new Et(Ye(t.integerValue));if(Ze(t,n,"doubleValue")){if(this.options.useProto3Json){if("NaN"===t.doubleValue)return Tt.NAN;if("Infinity"===t.doubleValue)return Tt.POSITIVE_INFINITY;if("-Infinity"===t.doubleValue)return Tt.NEGATIVE_INFINITY}return new Tt(t.doubleValue)}if(Ze(t,n,"stringValue"))return new Ct(t.stringValue);if(Ze(t,n,"mapValue"))return this.fromFields(t.mapValue.fields||{});if(Ze(t,n,"arrayValue"))return Xe(t.arrayValue,"arrayValue"),new Pt((t.arrayValue.values||[]).map(function(t){return e.fromValue(t)}));if(Ze(t,n,"timestampValue"))return Xe(t.timestampValue,"timestampValue"),new It(this.fromTimestamp(t.timestampValue));if(Ze(t,n,"geoPointValue"))return Xe(t.geoPointValue,"geoPointValue"),new kt(new J(t.geoPointValue.latitude||0,t.geoPointValue.longitude||0));if(Ze(t,n,"bytesValue")){Xe(t.bytesValue,"bytesValue");var r=this.fromBlob(t.bytesValue);return new Ot(r)}if(Ze(t,n,"referenceValue")){Xe(t.referenceValue,"referenceValue");var i=this.fromResourceName(t.referenceValue),o=new et(i.get(1),i.get(3)),a=new at(this.extractLocalPathFromResourceName(i));return new Dt(o,a)}return g("Unknown Value proto "+JSON.stringify(t))},t.prototype.toMutationDocument=function(t,e){return{name:this.toName(t),fields:this.toFields(e)}},t.prototype.toDocument=function(t){return m(!t.hasLocalMutations,"Can't serialize documents with mutations."),{name:this.toName(t.key),fields:this.toFields(t.data),updateTime:this.toTimestamp(t.version.toTimestamp())}},t.prototype.fromDocument=function(t,e){return new ut(this.fromName(t.name),this.fromVersion(t.updateTime),this.fromFields(t.fields||{}),{hasCommittedMutations:!!e})},t.prototype.toFields=function(t){var e=this,n={};return t.forEach(function(t,r){n[t]=e.toValue(r)}),n},t.prototype.fromFields=function(t){var e=this,n=Nt.EMPTY;return I(t,function(t,r){n=n.set(new ot([t]),e.fromValue(r))}),n},t.prototype.toMapValue=function(t){return{fields:this.toFields(t)}},t.prototype.toArrayValue=function(t){var e=this,n=[];return t.forEach(function(t){n.push(e.toValue(t))}),{values:n}},t.prototype.fromFound=function(t){m(!!t.found,"Tried to deserialize a found document from a missing document."),Xe(t.found.name,"doc.found.name"),Xe(t.found.updateTime,"doc.found.updateTime");var e=this.fromName(t.found.name),n=this.fromVersion(t.found.updateTime),r=this.fromFields(t.found.fields||{});return new ut(e,n,r,{})},t.prototype.fromMissing=function(t){m(!!t.missing,"Tried to deserialize a missing document from a found document."),m(!!t.readTime,"Tried to deserialize a missing document without a read time.");var e=this.fromName(t.missing),n=this.fromVersion(t.readTime);return new ct(e,n)},t.prototype.fromMaybeDocument=function(t){var e=t.result;return Ze(t,e,"found")?this.fromFound(t):Ze(t,e,"missing")?this.fromMissing(t):g("invalid batch get response: "+JSON.stringify(t))},t.prototype.toWatchTargetChangeState=function(t){switch(t){case Ue.Added:return"ADD";case Ue.Current:return"CURRENT";case Ue.NoChange:return"NO_CHANGE";case Ue.Removed:return"REMOVE";case Ue.Reset:return"RESET";default:return g("Unknown WatchTargetChangeState: "+t)}},t.prototype.toTestWatchChange=function(t){if(t instanceof Le)return{filter:{count:t.existenceFilter.count,targetId:t.targetId}};if(t instanceof je){var e;if(t.newDoc instanceof ut)return{documentChange:{document:{name:this.toName((e=t.newDoc).key),fields:this.toFields(e.data),updateTime:this.toVersion(e.version)},targetIds:t.updatedTargetIds,removedTargetIds:t.removedTargetIds}};if(t.newDoc instanceof ct)return{documentDelete:{document:this.toName((e=t.newDoc).key),readTime:this.toVersion(e.version),removedTargetIds:t.removedTargetIds}};if(null===t.newDoc)return{documentRemove:{document:this.toName(t.key),removedTargetIds:t.removedTargetIds}}}if(t instanceof Ve){var n=void 0;return t.cause&&(n={code:ve(t.cause.code),message:t.cause.message}),{targetChange:{targetChangeType:this.toWatchTargetChangeState(t.state),targetIds:t.targetIds,resumeToken:this.unsafeCastProtoByteString(t.resumeToken),cause:n}}}return g("Unrecognized watch change: "+JSON.stringify(t))},t.prototype.fromWatchChange=function(t){var e,n=t.response_type;if(Ze(t,n,"targetChange")){Xe(t.targetChange,"targetChange");var r=this.fromWatchTargetChangeState(t.targetChange.targetChangeType||"NO_CHANGE"),i=t.targetChange.targetIds||[],o=t.targetChange.resumeToken||this.emptyByteString(),a=t.targetChange.cause,s=a&&this.fromRpcStatus(a);e=new Ve(r,i,o,s||null)}else if(Ze(t,n,"documentChange")){Xe(t.documentChange,"documentChange"),Xe(t.documentChange.document,"documentChange.name"),Xe(t.documentChange.document.name,"documentChange.document.name"),Xe(t.documentChange.document.updateTime,"documentChange.document.updateTime");var u=t.documentChange,c=this.fromName(u.document.name),l=this.fromVersion(u.document.updateTime),h=this.fromFields(u.document.fields||{}),f=new ut(c,l,h,{});e=new je(u.targetIds||[],u.removedTargetIds||[],f.key,f)}else if(Ze(t,n,"documentDelete")){Xe(t.documentDelete,"documentDelete"),Xe(t.documentDelete.document,"documentDelete.document");var p=t.documentDelete;c=this.fromName(p.document),l=p.readTime?this.fromVersion(p.readTime):Yt.forDeletedDoc(),f=new ct(c,l),e=new je([],p.removedTargetIds||[],f.key,f)}else if(Ze(t,n,"documentRemove")){Xe(t.documentRemove,"documentRemove"),Xe(t.documentRemove.document,"documentRemove");var d=t.documentRemove;c=this.fromName(d.document),e=new je([],d.removedTargetIds||[],c,null)}else{if(!Ze(t,n,"filter"))return g("Unknown change type "+JSON.stringify(t));Xe(t.filter,"filter"),Xe(t.filter.targetId,"filter.targetId");var y=t.filter,m=new de(y.count||0);e=new Le(y.targetId,m)}return e},t.prototype.fromWatchTargetChangeState=function(t){return"NO_CHANGE"===t?Ue.NoChange:"ADD"===t?Ue.Added:"REMOVE"===t?Ue.Removed:"CURRENT"===t?Ue.Current:"RESET"===t?Ue.Reset:g("Got unexpected TargetChange.state: "+t)},t.prototype.versionFromListenResponse=function(t){if(!Ze(t,t.response_type,"targetChange"))return Yt.MIN;var e=t.targetChange;return e.targetIds&&e.targetIds.length?Yt.MIN:e.readTime?this.fromVersion(e.readTime):Yt.MIN},t.prototype.toMutation=function(t){var e,n=this;if(t instanceof ae)e={update:this.toMutationDocument(t.key,t.value)};else if(t instanceof ce)e={delete:this.toName(t.key)};else if(t instanceof se)e={update:this.toMutationDocument(t.key,t.data),updateMask:this.toDocumentMask(t.fieldMask)};else{if(!(t instanceof ue))return g("Unknown mutation type "+t.type);e={transform:{document:this.toName(t.key),fieldTransforms:t.fieldTransforms.map(function(t){return n.toFieldTransform(t)})}}}return t.precondition.isNone||(e.currentDocument=this.toPrecondition(t.precondition)),e},t.prototype.fromMutation=function(t){var e=this,n=t.currentDocument?this.fromPrecondition(t.currentDocument):ie.NONE;if(t.update){Xe(t.update.name,"name");var r=this.fromName(t.update.name),i=this.fromFields(t.update.fields||{});if(t.updateMask){var o=this.fromDocumentMask(t.updateMask);return new se(r,i,o,n)}return new ae(r,i,n)}if(t.delete)return r=this.fromName(t.delete),new ce(r,n);if(t.transform){r=this.fromName(t.transform.document);var a=t.transform.fieldTransforms.map(function(t){return e.fromFieldTransform(t)});return m(!0===n.exists,'Transforms only support precondition "exists == true"'),new ue(r,a)}return g("unknown mutation proto: "+JSON.stringify(t))},t.prototype.toPrecondition=function(t){return m(!t.isNone,"Can't serialize an empty precondition"),void 0!==t.updateTime?{updateTime:this.toVersion(t.updateTime)}:void 0!==t.exists?{exists:t.exists}:g("Unknown precondition")},t.prototype.fromPrecondition=function(t){return void 0!==t.updateTime?ie.updateTime(this.fromVersion(t.updateTime)):void 0!==t.exists?ie.exists(t.exists):ie.NONE},t.prototype.fromWriteResult=function(t,e){var n=this,r=this.fromVersion(t.updateTime?t.updateTime:e),i=null;return t.transformResults&&t.transformResults.length>0&&(i=t.transformResults.map(function(t){return n.fromValue(t)})),new ne(r,i)},t.prototype.fromWriteResults=function(t,e){var n=this;return t&&t.length>0?(m(void 0!==e,"Received a write result without a commit time"),t.map(function(t){return n.fromWriteResult(t,e)})):[]},t.prototype.toFieldTransform=function(t){var e=this,n=t.transform;if(n instanceof le)return{fieldPath:t.field.canonicalString(),setToServerValue:"REQUEST_TIME"};if(n instanceof he)return{fieldPath:t.field.canonicalString(),appendMissingElements:{values:n.elements.map(function(t){return e.toValue(t)})}};if(n instanceof fe)return{fieldPath:t.field.canonicalString(),removeAllFromArray:{values:n.elements.map(function(t){return e.toValue(t)})}};throw g("Unknown transform: "+t.transform)},t.prototype.fromFieldTransform=function(t){var e=this,n=t.transform_type,r=null;Ze(t,n,"setToServerValue")?(m("REQUEST_TIME"===t.setToServerValue,"Unknown server value transform proto: "+JSON.stringify(t)),r=le.instance):Ze(t,n,"appendMissingElements")?r=new he((t.appendMissingElements.values||[]).map(function(t){return e.fromValue(t)})):Ze(t,n,"removeAllFromArray")?r=new fe((t.removeAllFromArray.values||[]).map(function(t){return e.fromValue(t)})):g("Unknown transform proto: "+JSON.stringify(t));var i=ot.fromServerFormat(t.fieldPath);return new ee(i,r)},t.prototype.toDocumentsTarget=function(t){return{documents:[this.toQueryPath(t.path)]}},t.prototype.fromDocumentsTarget=function(t){var e=t.documents.length;return m(1===e,"DocumentsTarget contained other than 1 document: "+e),Vt.atPath(this.fromQueryPath(t.documents[0]))},t.prototype.toQueryTarget=function(t){var e={structuredQuery:{}};if(t.path.isEmpty())e.parent=this.toQueryPath(rt.EMPTY_PATH);else{var n=t.path;m(n.length%2!=0,"Document queries with filters are not supported."),e.parent=this.toQueryPath(n.popLast()),e.structuredQuery.from=[{collectionId:n.lastSegment()}]}var r=this.toFilter(t.filters);r&&(e.structuredQuery.where=r);var i=this.toOrder(t.orderBy);i&&(e.structuredQuery.orderBy=i);var o=this.toInt32Value(t.limit);return void 0!==o&&(e.structuredQuery.limit=o),t.startAt&&(e.structuredQuery.startAt=this.toCursor(t.startAt)),t.endAt&&(e.structuredQuery.endAt=this.toCursor(t.endAt)),e},t.prototype.fromQueryTarget=function(t){var e=this.fromQueryPath(t.parent),n=t.structuredQuery,r=n.from?n.from.length:0;r>0&&(m(1===r,"StructuredQuery.from with more than one collection is not supported."),e=e.child(n.from[0].collectionId));var i=[];n.where&&(i=this.fromFilter(n.where));var o=[];n.orderBy&&(o=this.fromOrder(n.orderBy));var a=null;n.limit&&(a=this.fromInt32Value(n.limit));var s=null;n.startAt&&(s=this.fromCursor(n.startAt));var u=null;return n.endAt&&(u=this.fromCursor(n.endAt)),new Vt(e,o,i,a,s,u)},t.prototype.toListenRequestLabels=function(t){var e=this.toLabel(t.purpose);return null==e?null:{"goog-listen-tags":e}},t.prototype.toLabel=function(t){switch(t){case Jt.Listen:return null;case Jt.ExistenceFilterMismatch:return"existence-filter-mismatch";case Jt.LimboResolution:return"limbo-document";default:return g("Unrecognized query purpose: "+t)}},t.prototype.toTarget=function(t){var e,n=t.query;return(e=n.isDocumentQuery()?{documents:this.toDocumentsTarget(n)}:{query:this.toQueryTarget(n)}).targetId=t.targetId,t.resumeToken.length>0&&(e.resumeToken=this.unsafeCastProtoByteString(t.resumeToken)),e},t.prototype.toFilter=function(t){var e=this;if(0!==t.length){var n=t.map(function(t){return t instanceof Bt?e.toRelationFilter(t):e.toUnaryFilter(t)});return 1===n.length?n[0]:{compositeFilter:{op:"AND",filters:n}}}},t.prototype.fromFilter=function(t){var e=this;return t?void 0!==t.unaryFilter?[this.fromUnaryFilter(t)]:void 0!==t.fieldFilter?[this.fromRelationFilter(t)]:void 0!==t.compositeFilter?t.compositeFilter.filters.map(function(t){return e.fromFilter(t)}).reduce(function(t,e){return t.concat(e)}):g("Unknown filter: "+JSON.stringify(t)):[]},t.prototype.toOrder=function(t){var e=this;if(0!==t.length)return t.map(function(t){return e.toPropertyOrder(t)})},t.prototype.fromOrder=function(t){var e=this;return t.map(function(t){return e.fromPropertyOrder(t)})},t.prototype.toCursor=function(t){var e=this;return{before:t.before,values:t.position.map(function(t){return e.toValue(t)})}},t.prototype.fromCursor=function(t){var e=this,n=!!t.before,r=t.values.map(function(t){return e.fromValue(t)});return new Kt(r,n)},t.prototype.toDirection=function(t){return Ke[t.name]},t.prototype.fromDirection=function(t){switch(t){case"ASCENDING":return Wt.ASCENDING;case"DESCENDING":return Wt.DESCENDING;default:return}},t.prototype.toOperatorName=function(t){return Ge[t.name]},t.prototype.fromOperatorName=function(t){switch(t){case"EQUAL":return qt.EQUAL;case"GREATER_THAN":return qt.GREATER_THAN;case"GREATER_THAN_OR_EQUAL":return qt.GREATER_THAN_OR_EQUAL;case"LESS_THAN":return qt.LESS_THAN;case"LESS_THAN_OR_EQUAL":return qt.LESS_THAN_OR_EQUAL;case"ARRAY_CONTAINS":return qt.ARRAY_CONTAINS;case"OPERATOR_UNSPECIFIED":return g("Unspecified relation");default:return g("Unknown relation")}},t.prototype.toFieldPathReference=function(t){return{fieldPath:t.canonicalString()}},t.prototype.fromFieldPathReference=function(t){return ot.fromServerFormat(t.fieldPath)},t.prototype.toPropertyOrder=function(t){return{field:this.toFieldPathReference(t.field),direction:this.toDirection(t.dir)}},t.prototype.fromPropertyOrder=function(t){return new Gt(this.fromFieldPathReference(t.field),this.fromDirection(t.direction))},t.prototype.toRelationFilter=function(t){return t instanceof Bt?{fieldFilter:{field:this.toFieldPathReference(t.field),op:this.toOperatorName(t.op),value:this.toValue(t.value)}}:g("Unrecognized filter: "+JSON.stringify(t))},t.prototype.fromRelationFilter=function(t){return new Bt(this.fromFieldPathReference(t.fieldFilter.field),this.fromOperatorName(t.fieldFilter.op),this.fromValue(t.fieldFilter.value))},t.prototype.toUnaryFilter=function(t){return t instanceof zt?{unaryFilter:{field:this.toFieldPathReference(t.field),op:"IS_NAN"}}:t instanceof Ht?{unaryFilter:{field:this.toFieldPathReference(t.field),op:"IS_NULL"}}:g("Unrecognized filter: "+JSON.stringify(t))},t.prototype.fromUnaryFilter=function(t){switch(t.unaryFilter.op){case"IS_NAN":var e=this.fromFieldPathReference(t.unaryFilter.field);return new zt(e);case"IS_NULL":var n=this.fromFieldPathReference(t.unaryFilter.field);return new Ht(n);case"OPERATOR_UNSPECIFIED":return g("Unspecified filter");default:return g("Unknown filter")}},t.prototype.toDocumentMask=function(t){var e=[];return t.fields.forEach(function(t){return e.push(t.canonicalString())}),{fieldPaths:e}},t.prototype.fromDocumentMask=function(t){var e=(t.fieldPaths||[]).map(function(t){return ot.fromServerFormat(t)});return te.fromArray(e)},t}();function Ze(t,e,n){return e===n||!e&&n in t}var $e=Error.captureStackTrace,tn=function(){return function(t,e){if(this.code=t,this.message=e,$e)$e(this,en.prototype.create);else try{throw Error.apply(this,arguments)}catch(n){this.name="FirebaseError",Object.defineProperty(this,"stack",{get:function(){return n.stack}})}}}();tn.prototype=Object.create(Error.prototype),tn.prototype.constructor=tn,tn.prototype.name="FirebaseError";var en=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+"?>"});var o=new tn(i,n=this.serviceName+": "+n+" ("+i+").");for(var a in e)e.hasOwnProperty(a)&&"_"!==a.slice(-1)&&(o[a]=e[a]);return o},t}(),nn=function(){function t(t){this.sendFn=t.sendFn,this.closeFn=t.closeFn}return t.prototype.onOpen=function(t){m(!this.wrappedOnOpen,"Called onOpen on stream twice!"),this.wrappedOnOpen=t},t.prototype.onClose=function(t){m(!this.wrappedOnClose,"Called onClose on stream twice!"),this.wrappedOnClose=t},t.prototype.onMessage=function(t){m(!this.wrappedOnMessage,"Called onMessage on stream twice!"),this.wrappedOnMessage=t},t.prototype.close=function(){this.closeFn()},t.prototype.send=function(t){this.sendFn(t)},t.prototype.callOnOpen=function(){m(void 0!==this.wrappedOnOpen,"Cannot call onOpen because no callback was set"),this.wrappedOnOpen()},t.prototype.callOnClose=function(t){m(void 0!==this.wrappedOnClose,"Cannot call onClose because no callback was set"),this.wrappedOnClose(t)},t.prototype.callOnMessage=function(t){m(void 0!==this.wrappedOnMessage,"Cannot call onMessage because no callback was set"),this.wrappedOnMessage(t)},t}(),rn="Connection",on={BatchGetDocuments:"batchGet",Commit:"commit"},an="gl-js/ fire/"+u,sn=function(){function t(t){this.databaseId=t.databaseId,this.pool=new s.XhrIoPool,this.baseUrl=(t.ssl?"https":"http")+"://"+t.host}return t.prototype.modifyHeadersForRequest=function(t,e){if(e)for(var n in e.authHeaders)e.authHeaders.hasOwnProperty(n)&&(t[n]=e.authHeaders[n]);t["X-Goog-Api-Client"]=an},t.prototype.invokeRPC=function(t,e,n){var r=this,i=this.makeUrl(t);return new Promise(function(o,a){r.pool.getObject(function(u){u.listenOnce(s.EventType.COMPLETE,function(){try{switch(u.getLastErrorCode()){case s.ErrorCode.NO_ERROR:var e=u.getResponseJson();p(rn,"XHR received:",JSON.stringify(e)),o(e);break;case s.ErrorCode.TIMEOUT:p(rn,'RPC "'+t+'" timed out'),a(new _(w.DEADLINE_EXCEEDED,"Request time out"));break;case s.ErrorCode.HTTP_ERROR:var n=u.getStatus();p(rn,'RPC "'+t+'" failed with status:',n,"response text:",u.getResponseText()),n>0?a(new _(function(t){switch(t){case 200:return w.OK;case 400:return w.INVALID_ARGUMENT;case 401:return w.UNAUTHENTICATED;case 403:return w.PERMISSION_DENIED;case 404:return w.NOT_FOUND;case 409:return w.ABORTED;case 416:return w.OUT_OF_RANGE;case 429:return w.RESOURCE_EXHAUSTED;case 499:return w.CANCELLED;case 500:return w.UNKNOWN;case 501:return w.UNIMPLEMENTED;case 503:return w.UNAVAILABLE;case 504:return w.DEADLINE_EXCEEDED;default:return t>=200&&t<300?w.OK:t>=400&&t<500?w.FAILED_PRECONDITION:t>=500&&t<600?w.INTERNAL:w.UNKNOWN}}(n),"Server responded with status "+u.getStatusText())):(p(rn,'RPC "'+t+'" failed'),a(new _(w.UNAVAILABLE,"Connection failed.")));break;default:g('RPC "'+t+'" failed with unanticipated webchannel error '+u.getLastErrorCode()+": "+u.getLastError()+", giving up.")}}finally{p(rn,'RPC "'+t+'" completed.'),r.pool.releaseObject(u)}});var c=JSON.stringify(e);p(rn,"XHR sending: ",i+" "+c);var l={"Content-Type":"text/plain"};r.modifyHeadersForRequest(l,n),u.send(i,"POST",c,l,15)})})},t.prototype.invokeStreamingRPC=function(t,e,n){return this.invokeRPC(t,e,n)},t.prototype.openStream=function(t,e){var n=[this.baseUrl,"/","google.firestore.v1beta1.Firestore","/",t,"/channel"],r=s.createWebChannelTransport(),i={backgroundChannelTest:!0,httpSessionIdParam:"gsessionid",initMessageHeaders:{},messageUrlParams:{database:"projects/"+this.databaseId.projectId+"/databases/"+this.databaseId.database},sendRawJson:!0,supportsCrossDomainXhr:!0};this.modifyHeadersForRequest(i.initMessageHeaders,e),"object"==typeof navigator&&"ReactNative"===navigator.product||(i.httpHeadersOverwriteParam="$httpHeaders");var o=n.join("");p(rn,"Creating WebChannel: "+o+" "+i);var a=r.createWebChannel(o,i),u=!1,c=!1,l=new nn({sendFn:function(t){c?p(rn,"Not sending because WebChannel is closed:",t):(u||(p(rn,"Opening WebChannel transport."),a.open(),u=!0),p(rn,"WebChannel sending:",t),a.send(t))},closeFn:function(){return a.close()}}),h=function(t,e){a.listen(t,function(t){try{e(t)}catch(n){setTimeout(function(){throw n},0)}})};return h(s.WebChannel.EventType.OPEN,function(){c||p(rn,"WebChannel transport opened.")}),h(s.WebChannel.EventType.CLOSE,function(){c||(c=!0,p(rn,"WebChannel transport closed"),l.callOnClose())}),h(s.WebChannel.EventType.ERROR,function(t){c||(c=!0,p(rn,"WebChannel transport errored:",t),l.callOnClose(new _(w.UNAVAILABLE,"The operation could not be completed")))}),h(s.WebChannel.EventType.MESSAGE,function(t){if(!c){var e=t.data[0];m(!!e,"Got a webchannel message without data.");var n=e.error||e[0]&&e[0].error;if(n){p(rn,"WebChannel received error:",n);var r=n.status,i=function(t){var e=ye[r];if(void 0!==e)return me(e)}(),o=n.message;void 0===i&&(i=w.INTERNAL,o="Unknown error status: "+r+" with message "+n.message),c=!0,l.callOnClose(new _(i,o)),a.close()}else p(rn,"WebChannel received:",e),l.callOnMessage(e)}}),setTimeout(function(){l.callOnOpen()},0),l},t.prototype.makeUrl=function(t){var e=on[t];m(void 0!==e,"Unknown REST mapping for: "+t);var n=[this.baseUrl,"/","v1beta1"];return n.push("/projects/"),n.push(this.databaseId.projectId),n.push("/databases/"),n.push(this.databaseId.database),n.push("/documents"),n.push(":"),n.push(e),n.join("")},t}();v.setPlatform(new(function(){function t(){this.emptyByteString="",this.base64Available="undefined"!=typeof atob}return Object.defineProperty(t.prototype,"document",{get:function(){return"undefined"!=typeof document?document:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"window",{get:function(){return"undefined"!=typeof window?window:null},enumerable:!0,configurable:!0}),t.prototype.loadConnection=function(t){return Promise.resolve(new sn(t))},t.prototype.newSerializer=function(t){return new Je(t,{useProto3Json:!0})},t.prototype.formatJSON=function(t){return JSON.stringify(t)},t.prototype.atob=function(t){return atob(t)},t.prototype.btoa=function(t){return btoa(t)},t}()));var un,cn=function(){function t(t,e){var n=this;this.previousValue=t,e&&(e.sequenceNumberHandler=function(t){return n.setPreviousValue(t)},this.writeNewSequenceNumber=function(t){return e.writeSequenceNumber(t)})}return t.prototype.setPreviousValue=function(t){return this.previousValue=Math.max(t,this.previousValue),this.previousValue},t.prototype.next=function(){var t=++this.previousValue;return this.writeNewSequenceNumber&&this.writeNewSequenceNumber(t),t},t.INVALID=-1,t}(),ln=function(){var t=this;this.promise=new Promise(function(e,n){t.resolve=e,t.reject=n})};!function(t){t.All="all",t.ListenStreamIdle="listen_stream_idle",t.ListenStreamConnectionBackoff="listen_stream_connection_backoff",t.WriteStreamIdle="write_stream_idle",t.WriteStreamConnectionBackoff="write_stream_connection_backoff",t.OnlineStateTimeout="online_state_timeout",t.ClientMetadataRefresh="client_metadata_refresh",t.LruGarbageCollection="lru_garbage_collection"}(un||(un={}));var hn=function(){function t(t,e,n,r,i){this.asyncQueue=t,this.timerId=e,this.targetTimeMs=n,this.op=r,this.removalCallback=i,this.deferred=new ln,this.then=this.deferred.promise.then.bind(this.deferred.promise),this.catch=this.deferred.promise.catch.bind(this.deferred.promise),this.deferred.promise.catch(function(t){})}return t.createAndSchedule=function(e,n,r,i,o){var a=new t(e,n,Date.now()+r,i,o);return a.start(r),a},t.prototype.start=function(t){var e=this;this.timerHandle=setTimeout(function(){return e.handleDelayElapsed()},t)},t.prototype.skipDelay=function(){return this.handleDelayElapsed()},t.prototype.cancel=function(t){null!==this.timerHandle&&(this.clearTimeout(),this.deferred.reject(new _(w.CANCELLED,"Operation cancelled"+(t?": "+t:""))))},t.prototype.handleDelayElapsed=function(){var t=this;this.asyncQueue.enqueueAndForget(function(){return null!==t.timerHandle?(t.clearTimeout(),t.op().then(function(e){return t.deferred.resolve(e)})):Promise.resolve()})},t.prototype.clearTimeout=function(){null!==this.timerHandle&&(this.removalCallback(this),clearTimeout(this.timerHandle),this.timerHandle=null)},t}(),fn=function(){function t(){this.tail=Promise.resolve(),this.delayedOperations=[],this.operationInProgress=!1}return t.prototype.enqueueAndForget=function(t){this.enqueue(t)},t.prototype.enqueue=function(t){var e=this;this.verifyNotFailed();var n=this.tail.then(function(){return e.operationInProgress=!0,t().catch(function(t){e.failure=t,e.operationInProgress=!1;var n=t.stack||t.message||"";throw d("INTERNAL UNHANDLED ERROR: ",n),n.indexOf("Firestore Test Simulated Error")<0&&setTimeout(function(){throw t},0),t}).then(function(t){return e.operationInProgress=!1,t})});return this.tail=n,n},t.prototype.enqueueAfterDelay=function(t,e,n){var r=this;this.verifyNotFailed(),m(e>=0,"Attempted to schedule an operation with a negative delay of "+e),m(!this.containsDelayedOperation(t),"Attempted to schedule multiple operations with timer id "+t+".");var i=hn.createAndSchedule(this,t,e,n,function(t){return r.removeDelayedOperation(t)});return this.delayedOperations.push(i),i},t.prototype.verifyNotFailed=function(){this.failure&&g("AsyncQueue is already failed: "+(this.failure.stack||this.failure.message))},t.prototype.verifyOperationInProgress=function(){m(this.operationInProgress,"verifyOpInProgress() called when no op in progress on this queue.")},t.prototype.drain=function(){return this.enqueue(function(){return Promise.resolve()})},t.prototype.containsDelayedOperation=function(t){for(var e=0,n=this.delayedOperations;e<n.length;e++)if(n[e].timerId===t)return!0;return!1},t.prototype.runDelayedOperationsEarly=function(t){var e=this;return this.drain().then(function(){m(t===un.All||e.containsDelayedOperation(t),"Attempted to drain to missing operation "+t),e.delayedOperations.sort(function(t,e){return t.targetTimeMs-e.targetTimeMs});for(var n=0,r=e.delayedOperations;n<r.length;n++){var i=r[n];if(i.skipDelay(),t!==un.All&&i.timerId===t)break}return e.drain()})},t.prototype.removeDelayedOperation=function(t){var e=this.delayedOperations.indexOf(t);m(e>=0,"Delayed operation not found."),this.delayedOperations.splice(e,1)},t}(),pn="\x01",dn="\x01",yn="\x10",gn="\x11";function mn(t){for(var e="",n=0;n<t.length;n++)e.length>0&&(e=bn(e)),e=vn(t.get(n),e);return bn(e)}function vn(t,e){for(var n=e,r=t.length,i=0;i<r;i++){var o=t.charAt(i);switch(o){case"\0":n+=pn+yn;break;case pn:n+=pn+gn;break;default:n+=o}}return n}function bn(t){return t+pn+dn}function wn(t){var e=t.length;if(m(e>=2,"Invalid path "+t),2===e)return m(t.charAt(0)===pn&&t.charAt(1)===dn,"Non-empty path "+t+" had length 2"),rt.EMPTY_PATH;for(var n=e-2,r=[],i="",o=0;o<e;){var a=t.indexOf(pn,o);switch((a<0||a>n)&&g('Invalid encoded resource path: "'+t+'"'),t.charAt(a+1)){case dn:var s=t.substring(o,a),u=void 0;0===i.length?u=s:(u=i+=s,i=""),r.push(u);break;case yn:i+=t.substring(o,a),i+="\0";break;case gn:i+=t.substring(o,a+1);break;default:g('Invalid encoded resource path: "'+t+'"')}o=a+2}return new rt(r)}var _n=-1,Sn=function(){function t(t,e,n){this.batchId=t,this.localWriteTime=e,this.mutations=n,m(n.length>0,"Cannot create an empty mutation batch")}return t.prototype.applyToRemoteDocument=function(t,e,n){e&&m(e.key.isEqual(t),"applyToRemoteDocument: key "+t+" should match maybeDoc key\n "+e.key);var r=n.mutationResults;m(r.length===this.mutations.length,"Mismatch between mutations length\n ("+this.mutations.length+") and mutation results length\n ("+r.length+").");for(var i=0;i<this.mutations.length;i++){var o=this.mutations[i];o.key.isEqual(t)&&(e=o.applyToRemoteDocument(e,r[i]))}return e},t.prototype.applyToLocalView=function(t,e){e&&m(e.key.isEqual(t),"applyToLocalDocument: key "+t+" should match maybeDoc key\n "+e.key);for(var n=e,r=0;r<this.mutations.length;r++){var i=this.mutations[r];i.key.isEqual(t)&&(e=i.applyToLocalView(e,n,this.localWriteTime))}return e},t.prototype.keys=function(){for(var t=Ie(),e=0,n=this.mutations;e<n.length;e++)t=t.add(n[e].key);return t},t.prototype.isEqual=function(t){return this.batchId===t.batchId&&K(this.mutations,t.mutations)},t}(),En=function(){function t(t,e,n,r,i){this.batch=t,this.commitVersion=e,this.mutationResults=n,this.streamToken=r,this.docVersions=i}return t.from=function(e,n,r,i){m(e.mutations.length===r.length,"Mutations sent "+e.mutations.length+" must equal results received "+r.length);for(var o=Te(),a=e.mutations,s=0;s<a.length;s++)o=o.insert(a[s].key,r[s].version);return new t(e,n,r,i,o)},t}(),Tn=1,Cn=function(t){return t[t.QueryCache=0]="QueryCache",t[t.SyncEngine=1]="SyncEngine",t}({}),In=function(){function t(t,e){this.generatorId=t,m((t&Tn)===t,"Generator ID "+t+" contains more than "+Tn+" reserved bits"),this.seek(void 0!==e?e:this.generatorId)}return t.prototype.next=function(){var t=this.nextId;return this.nextId+=1<<Tn,t},t.prototype.after=function(t){return this.seek(t+(1<<Tn)),this.next()},t.prototype.seek=function(t){m((t&Tn)===this.generatorId,"Cannot supply target ID from different generator ID"),this.nextId=t},t.forQueryCache=function(){return new t(Cn.QueryCache,2)},t.forSyncEngine=function(){return new t(Cn.SyncEngine)},t}(),An=function(){function t(t){var e=this;this.nextCallback=null,this.catchCallback=null,this.result=void 0,this.error=void 0,this.isDone=!1,this.callbackAttached=!1,t(function(t){e.isDone=!0,e.result=t,e.nextCallback&&e.nextCallback(t)},function(t){e.isDone=!0,e.error=t,e.catchCallback&&e.catchCallback(t)})}return t.prototype.catch=function(t){return this.next(void 0,t)},t.prototype.next=function(e,n){var r=this;return this.callbackAttached&&g("Called next() or catch() twice for PersistencePromise"),this.callbackAttached=!0,this.isDone?this.error?this.wrapFailure(n,this.error):this.wrapSuccess(e,this.result):new t(function(t,i){r.nextCallback=function(n){r.wrapSuccess(e,n).next(t,i)},r.catchCallback=function(e){r.wrapFailure(n,e).next(t,i)}})},t.prototype.toPromise=function(){var t=this;return new Promise(function(e,n){t.next(e,n)})},t.prototype.wrapUserFunction=function(e){try{var n=e();return n instanceof t?n:t.resolve(n)}catch(r){return t.reject(r)}},t.prototype.wrapSuccess=function(e,n){return e?this.wrapUserFunction(function(){return e(n)}):t.resolve(n)},t.prototype.wrapFailure=function(e,n){return e?this.wrapUserFunction(function(){return e(n)}):t.reject(n)},t.resolve=function(e){return new t(function(t,n){t(e)})},t.reject=function(e){return new t(function(t,n){n(e)})},t.waitFor=function(e){return new t(function(t,n){var r=0,i=0,o=!1;e.forEach(function(e){++r,e.next(function(){++i,o&&i===r&&t()},function(t){return n(t)})}),o=!0,i===r&&t()})},t.or=function(e){for(var n=t.resolve(!1),r=function(e){n=n.next(function(n){return n?t.resolve(n):e()})},i=0,o=e;i<o.length;i++)r(o[i]);return n},t.forEach=function(t,e){var n=this,r=[];return t.forEach(function(t,i){r.push(e.call(n,t,i))}),this.waitFor(r)},t}(),On=function(){function t(t){this.db=t}return t.openOrCreate=function(e,n,r){return m(t.isAvailable(),"IndexedDB not supported in current environment."),p("SimpleDb","Opening database:",e),new An(function(i,o){var a=window.indexedDB.open(e,n);a.onsuccess=function(e){i(new t(e.target.result))},a.onblocked=function(){o(new _(w.FAILED_PRECONDITION,"Cannot upgrade IndexedDB schema while another tab is open. Close all tabs that access Firestore and reload this page to proceed."))},a.onerror=function(t){var e=t.target.error;o("VersionError"===e.name?new _(w.FAILED_PRECONDITION,"A newer version of the Firestore SDK was previously used and so the persisted data is not compatible with the version of the SDK you are now using. The SDK will operate with persistence disabled. If you need persistence, please re-upgrade to a newer version of the SDK or else clear the persisted IndexedDB data for your app to start fresh."):e)},a.onupgradeneeded=function(t){p("SimpleDb",'Database "'+e+'" requires upgrade from version:',t.oldVersion);var n=t.target.result,i=new kn(a.transaction);r.createOrUpgrade(n,i,t.oldVersion,Qn).next(function(){p("SimpleDb","Database upgrade to version "+Qn+" complete")})}}).toPromise()},t.delete=function(t){return p("SimpleDb","Removing database:",t),Pn(window.indexedDB.deleteDatabase(t)).toPromise()},t.isAvailable=function(){if("undefined"==typeof window||null==window.indexedDB)return!1;if(void 0===window.navigator)return"YES"===process.env.USE_MOCK_PERSISTENCE;var t=window.navigator.userAgent;return!(t.indexOf("MSIE ")>0||t.indexOf("Trident/")>0||t.indexOf("Edge/")>0)},t.getStore=function(t,e){return t.store(e)},t.prototype.runTransaction=function(t,e,n){var r=kn.open(this.db,t,e),i=n(r).catch(function(t){return r.abort(t),An.reject(t)}).toPromise();return r.completionPromise.then(function(){return i})},t.prototype.close=function(){this.db.close()},t}(),Dn=function(){function t(t){this.dbCursor=t,this.shouldStop=!1,this.nextKey=null}return Object.defineProperty(t.prototype,"isDone",{get:function(){return this.shouldStop},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"skipToKey",{get:function(){return this.nextKey},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"cursor",{set:function(t){this.dbCursor=t},enumerable:!0,configurable:!0}),t.prototype.done=function(){this.shouldStop=!0},t.prototype.skip=function(t){this.nextKey=t},t.prototype.delete=function(){return Pn(this.dbCursor.delete())},t}(),kn=function(){function t(t){var e=this;this.transaction=t,this.aborted=!1,this.completionDeferred=new ln,this.transaction.oncomplete=function(){e.completionDeferred.resolve()},this.transaction.onabort=function(){t.error?e.completionDeferred.reject(t.error):e.completionDeferred.resolve()},this.transaction.onerror=function(t){e.completionDeferred.reject(t.target.error)}}return t.open=function(e,n,r){return new t(e.transaction(r,n))},Object.defineProperty(t.prototype,"completionPromise",{get:function(){return this.completionDeferred.promise},enumerable:!0,configurable:!0}),t.prototype.abort=function(t){t&&this.completionDeferred.reject(t),this.aborted||(p("SimpleDb","Aborting transaction:",t?t.message:"Client-initiated abort"),this.aborted=!0,this.transaction.abort())},t.prototype.store=function(t){var e=this.transaction.objectStore(t);return m(!!e,"Object store not part of transaction: "+t),new Nn(e)},t}(),Nn=function(){function t(t){this.store=t}return t.prototype.put=function(t,e){var n;return void 0!==e?(p("SimpleDb","PUT",this.store.name,t,e),n=this.store.put(e,t)):(p("SimpleDb","PUT",this.store.name,"<auto-key>",t),n=this.store.put(t)),Pn(n)},t.prototype.add=function(t){return p("SimpleDb","ADD",this.store.name,t,t),Pn(this.store.add(t))},t.prototype.get=function(t){var e=this;return Pn(this.store.get(t)).next(function(n){return void 0===n&&(n=null),p("SimpleDb","GET",e.store.name,t,n),n})},t.prototype.delete=function(t){return p("SimpleDb","DELETE",this.store.name,t),Pn(this.store.delete(t))},t.prototype.count=function(){return p("SimpleDb","COUNT",this.store.name),Pn(this.store.count())},t.prototype.loadAll=function(t,e){var n=this.cursor(this.options(t,e)),r=[];return this.iterateCursor(n,function(t,e){r.push(e)}).next(function(){return r})},t.prototype.deleteAll=function(t,e){p("SimpleDb","DELETE ALL",this.store.name);var n=this.options(t,e);n.keysOnly=!1;var r=this.cursor(n);return this.iterateCursor(r,function(t,e,n){return n.delete()})},t.prototype.iterate=function(t,e){var n;e?n=t:(n={},e=t);var r=this.cursor(n);return this.iterateCursor(r,e)},t.prototype.iterateSerial=function(t){var e=this.cursor({});return new An(function(n,r){e.onerror=function(t){r(t.target.error)},e.onsuccess=function(e){var r=e.target.result;r?t(r.primaryKey,r.value).next(function(t){t?r.continue():n()}):n()}})},t.prototype.iterateCursor=function(t,e){var n=[];return new An(function(r,i){t.onerror=function(t){i(t.target.error)},t.onsuccess=function(t){var i=t.target.result;if(i){var o=new Dn(i),a=e(i.primaryKey,i.value,o);if(a instanceof An){var s=a.catch(function(t){return o.done(),An.reject(t)});n.push(s)}o.isDone?r():null===o.skipToKey?i.continue():i.continue(o.skipToKey)}else r()}}).next(function(){return An.waitFor(n)})},t.prototype.options=function(t,e){var n=void 0;return void 0!==t&&("string"==typeof t?n=t:(m(void 0===e,"3rd argument must not be defined if 2nd is a range."),e=t)),{index:n,range:e}},t.prototype.cursor=function(t){var e="next";if(t.reverse&&(e="prev"),t.index){var n=this.store.index(t.index);return t.keysOnly?n.openKeyCursor(t.range,e):n.openCursor(t.range,e)}return this.store.openCursor(t.range,e)},t}();function Pn(t){return new An(function(e,n){t.onsuccess=function(t){e(t.target.result)},t.onerror=function(t){n(t.target.error)}})}var Rn=function(){function t(t,e){this.referenceDelegate=t,this.serializer=e,this.targetIdGenerator=In.forQueryCache()}return t.prototype.allocateTargetId=function(t){var e=this;return this.retrieveMetadata(t).next(function(n){return n.highestTargetId=e.targetIdGenerator.after(n.highestTargetId),e.saveMetadata(t,n).next(function(){return n.highestTargetId})})},t.prototype.getLastRemoteSnapshotVersion=function(t){return this.retrieveMetadata(t).next(function(t){return Yt.fromTimestamp(new Z(t.lastRemoteSnapshotVersion.seconds,t.lastRemoteSnapshotVersion.nanoseconds))})},t.prototype.getHighestSequenceNumber=function(t){return jn(t.simpleDbTransaction)},t.prototype.setTargetsMetadata=function(t,e,n){var r=this;return this.retrieveMetadata(t).next(function(i){return i.highestListenSequenceNumber=e,n&&(i.lastRemoteSnapshotVersion=n.toTimestamp()),e>i.highestListenSequenceNumber&&(i.highestListenSequenceNumber=e),r.saveMetadata(t,i)})},t.prototype.addQueryData=function(t,e){var n=this;return this.saveQueryData(t,e).next(function(){return n.retrieveMetadata(t).next(function(r){return r.targetCount+=1,n.updateMetadataFromQueryData(e,r),n.saveMetadata(t,r)})})},t.prototype.updateQueryData=function(t,e){return this.saveQueryData(t,e)},t.prototype.removeQueryData=function(t,e){var n=this;return this.removeMatchingKeysForTargetId(t,e.targetId).next(function(){return xn(t).delete(e.targetId)}).next(function(){return n.retrieveMetadata(t)}).next(function(e){return m(e.targetCount>0,"Removing from an empty query cache"),e.targetCount-=1,n.saveMetadata(t,e)})},t.prototype.removeTargets=function(t,e,n){var r=this,i=0,o=[];return xn(t).iterate(function(a,s){var u=r.serializer.fromDbTarget(s);u.sequenceNumber<=e&&void 0===n[u.targetId]&&(i++,o.push(r.removeQueryData(t,u)))}).next(function(){return An.waitFor(o)}).next(function(){return i})},t.prototype.forEachTarget=function(t,e){var n=this;return xn(t).iterate(function(t,r){var i=n.serializer.fromDbTarget(r);e(i)})},t.prototype.retrieveMetadata=function(t){return Mn(t.simpleDbTransaction)},t.prototype.saveMetadata=function(t,e){return(n=t,Nr.getStore(n,sr.store)).put(sr.key,e);var n},t.prototype.saveQueryData=function(t,e){return xn(t).put(this.serializer.toDbTarget(e))},t.prototype.updateMetadataFromQueryData=function(t,e){var n=!1;return t.targetId>e.highestTargetId&&(e.highestTargetId=t.targetId,n=!0),t.sequenceNumber>e.highestListenSequenceNumber&&(e.highestListenSequenceNumber=t.sequenceNumber,n=!0),n},t.prototype.getQueryCount=function(t){return this.retrieveMetadata(t).next(function(t){return t.targetCount})},t.prototype.getQueryData=function(t,e){var n=this,r=e.canonicalId(),i=IDBKeyRange.bound([r,Number.NEGATIVE_INFINITY],[r,Number.POSITIVE_INFINITY]),o=null;return xn(t).iterate({range:i,index:or.queryTargetsIndexName},function(t,r,i){var a=n.serializer.fromDbTarget(r);e.isEqual(a.query)&&(o=a,i.done())}).next(function(){return o})},t.prototype.addMatchingKeys=function(t,e,n){var r=this,i=[],o=Ln(t);return e.forEach(function(e){var a=mn(e.path);i.push(o.put(new ar(n,a))),i.push(r.referenceDelegate.addReference(t,e))}),An.waitFor(i)},t.prototype.removeMatchingKeys=function(t,e,n){var r=this,i=Ln(t);return An.forEach(e,function(e){var o=mn(e.path);return An.waitFor([i.delete([n,o]),r.referenceDelegate.removeReference(t,e)])})},t.prototype.removeMatchingKeysForTargetId=function(t,e){var n=Ln(t),r=IDBKeyRange.bound([e],[e+1],!1,!0);return n.delete(r)},t.prototype.getMatchingKeysForTargetId=function(t,e){var n=IDBKeyRange.bound([e],[e+1],!1,!0),r=Ln(t),i=Ie();return r.iterate({range:n,keysOnly:!0},function(t,e,n){var r=wn(t[1]),o=new at(r);i=i.add(o)}).next(function(){return i})},t.prototype.containsKey=function(t,e){var n,r=mn(e.path),i=IDBKeyRange.bound([r],[(n=r,n+"\0")],!1,!0),o=0;return Ln(t).iterate({index:ar.documentTargetsIndex,keysOnly:!0,range:i},function(t,e,n){0!==t[0]&&(o++,n.done())}).next(function(){return o>0})},t.prototype.getQueryDataForTarget=function(t,e){var n=this;return xn(t).get(e).next(function(t){return t?n.serializer.fromDbTarget(t):null})},t}();function xn(t){return Nr.getStore(t,or.store)}function Mn(t){return On.getStore(t,sr.store).get(sr.key).next(function(t){return m(null!==t,"Missing metadata row."),t})}function jn(t){return Mn(t).next(function(t){return t.highestListenSequenceNumber})}function Ln(t){return Nr.getStore(t,ar.store)}var Un=function(){function t(t){this.mapKeyFn=t,this.inner={}}return t.prototype.get=function(t){var e=this.mapKeyFn(t),n=this.inner[e];if(void 0!==n)for(var r=0,i=n;r<i.length;r++){var o=i[r],a=o[1];if(o[0].isEqual(t))return a}},t.prototype.has=function(t){return void 0!==this.get(t)},t.prototype.set=function(t,e){var n=this.mapKeyFn(t),r=this.inner[n];if(void 0!==r){for(var i=0;i<r.length;i++)if(r[i][0].isEqual(t))return void(r[i]=[t,e]);r.push([t,e])}else this.inner[n]=[[t,e]]},t.prototype.delete=function(t){var e=this.mapKeyFn(t),n=this.inner[e];if(void 0===n)return!1;for(var r=0;r<n.length;r++)if(n[r][0].isEqual(t))return 1===n.length?delete this.inner[e]:n.splice(r,1),!0;return!1},t.prototype.forEach=function(t){I(this.inner,function(e,n){for(var r=0,i=n;r<i.length;r++){var o=i[r];t(o[0],o[1])}})},t.prototype.isEmpty=function(){return A(this.inner)},t}(),Vn=function(){function t(){this.changes=we(),this.documentSizes=new Un(function(t){return t.toString()})}return t.prototype.addEntry=function(t){var e=this.assertChanges();this.changes=e.insert(t.key,t)},t.prototype.getEntry=function(t,e){var n=this,r=this.assertChanges().get(e);return r?An.resolve(r):this.getFromCache(t,e).next(function(t){return null===t?(n.documentSizes.set(e,0),null):(n.documentSizes.set(e,t.size),t.maybeDocument)})},t.prototype.apply=function(t){var e=this.applyChanges(t);return this.changes=null,e},t.prototype.assertChanges=function(){return m(null!==this.changes,"Changes have already been applied."),this.changes},t}(),Fn="The remote document changelog no longer contains all changes for all local query views. It may be necessary to rebuild these views.",qn=function(){function t(t,e){this.serializer=t,this.keepDocumentChangeLog=e,this._lastProcessedDocumentChangeId=0}return Object.defineProperty(t.prototype,"lastProcessedDocumentChangeId",{get:function(){return this._lastProcessedDocumentChangeId},enumerable:!0,configurable:!0}),t.prototype.start=function(t){var e=On.getStore(t,cr.store);return this.synchronizeLastDocumentChangeId(e)},t.prototype.addEntries=function(t,e,n){var r=[];if(e.length>0){for(var i=zn(t),o=Ie(),a=0,s=e;a<s.length;a++){var u=s[a],c=u.key,l=u.doc;r.push(i.put(Kn(c),l)),o=o.add(c)}this.keepDocumentChangeLog&&r.push(Wn(t).put({changes:this.serializer.toDbResourcePaths(o)})),r.push(this.updateSize(t,n))}return An.waitFor(r)},t.prototype.removeEntry=function(t,e){var n=zn(t),r=Kn(e);return n.get(r).next(function(t){return t?n.delete(r).next(function(){return Gn(t)}):An.resolve(0)})},t.prototype.getEntry=function(t,e){var n=this;return zn(t).get(Kn(e)).next(function(t){return t?n.serializer.fromDbRemoteDocument(t):null})},t.prototype.getSizedEntry=function(t,e){var n=this;return zn(t).get(Kn(e)).next(function(t){return t?{maybeDocument:n.serializer.fromDbRemoteDocument(t),size:Gn(t)}:null})},t.prototype.getDocumentsMatchingQuery=function(t,e){var n=this,r=Se(),i=e.path.toArray(),o=IDBKeyRange.lowerBound(i);return zn(t).iterate({range:o},function(t,i,o){var a=n.serializer.fromDbRemoteDocument(i);e.path.isPrefixOf(a.key.path)?a instanceof ut&&e.matches(a)&&(r=r.insert(a.key,a)):o.done()}).next(function(){return r})},t.prototype.getNewDocumentChanges=function(t){var e=this;m(this.keepDocumentChangeLog,"Can only call getNewDocumentChanges() when document change log is enabled");var n=Ie(),r=we(),i=IDBKeyRange.lowerBound(this._lastProcessedDocumentChangeId+1),o=!0,a=Wn(t);return a.iterate({range:i},function(t,r){if(o&&(o=!1,e._lastProcessedDocumentChangeId+1!==r.id))return e.synchronizeLastDocumentChangeId(a).next(function(){return An.reject(new _(w.DATA_LOSS,Fn))});n=n.unionWith(e.serializer.fromDbResourcePaths(r.changes)),e._lastProcessedDocumentChangeId=r.id}).next(function(){var i=[];return n.forEach(function(n){i.push(e.getEntry(t,n).next(function(t){var e=t||new ct(n,Yt.forDeletedDoc());r=r.insert(n,e)}))}),An.waitFor(i)}).next(function(){return r})},t.prototype.removeDocumentChangesThroughChangeId=function(t,e){var n=IDBKeyRange.upperBound(e);return Wn(t).delete(n)},t.prototype.synchronizeLastDocumentChangeId=function(t){var e=this;return this._lastProcessedDocumentChangeId=0,t.iterate({keysOnly:!0,reverse:!0},function(t,n,r){e._lastProcessedDocumentChangeId=t,r.done()})},t.prototype.newChangeBuffer=function(){return new Hn(this)},t.prototype.getSize=function(t){return this.getMetadata(t).next(function(t){return t.byteSize})},t.prototype.getMetadata=function(t){return Bn(t).get(ir.key).next(function(t){return m(!!t,"Missing document cache metadata"),t})},t.prototype.setMetadata=function(t,e){return Bn(t).put(ir.key,e)},t.prototype.updateSize=function(t,e){var n=this;return this.getMetadata(t).next(function(r){return r.byteSize+=e,n.setMetadata(t,r)})},t}();function Bn(t){return Nr.getStore(t,ir.store)}var Hn=function(t){function e(e){var n=t.call(this)||this;return n.documentCache=e,n}return a.__extends(e,t),e.prototype.applyChanges=function(t){var e=this,n=this.assertChanges(),r=0,i=[];return n.forEach(function(t,n){var o=e.documentCache.serializer.toDbRemoteDocument(n),a=e.documentSizes.get(t);m(void 0!==a,"Attempting to change document "+t.toString()+" without having read it first");var s=Gn(o);r+=s-a,i.push({key:t,doc:o})}),this.documentCache.addEntries(t,i,r)},e.prototype.getFromCache=function(t,e){return this.documentCache.getSizedEntry(t,e)},e}(Vn);function zn(t){return Nr.getStore(t,rr.store)}function Wn(t){return Nr.getStore(t,cr.store)}function Kn(t){return t.path.toArray()}function Gn(t){var e;if(t.document)e=t.document;else if(t.unknownDocument)e=t.unknownDocument;else{if(!t.noDocument)throw g("Unknown remote document type");e=t.noDocument}return JSON.stringify(e).length}var Qn=7,Xn=function(){function t(t){this.serializer=t}return t.prototype.createOrUpgrade=function(t,e,n,r){var i=this;m(n<r&&n>=0&&r<=Qn,"Unexpected schema upgrade from v"+n+" to v{toVersion}."),n<1&&r>=1&&(function(t){t.createObjectStore(Jn.store)}(t),function(t){t.createObjectStore(Zn.store,{keyPath:Zn.keyPath}),t.createObjectStore($n.store,{keyPath:$n.keyPath,autoIncrement:!0}).createIndex($n.userMutationsIndex,$n.userMutationsKeyPath,{unique:!0}),t.createObjectStore(tr.store)}(t),ur(t),function(t){t.createObjectStore(rr.store)}(t));var o=An.resolve();return n<3&&r>=3&&(0!==n&&(function(t){t.deleteObjectStore(ar.store),t.deleteObjectStore(or.store),t.deleteObjectStore(sr.store)}(t),ur(t)),o=o.next(function(){return function(t){var e=t.store(sr.store),n=new sr(0,0,Yt.MIN.toTimestamp(),0);return e.put(sr.key,n)}(e)})),n<4&&r>=4&&(0!==n&&(o=o.next(function(){return function(t,e){return e.store($n.store).loadAll().next(function(n){t.deleteObjectStore($n.store),t.createObjectStore($n.store,{keyPath:$n.keyPath,autoIncrement:!0}).createIndex($n.userMutationsIndex,$n.userMutationsKeyPath,{unique:!0});var r=e.store($n.store),i=n.map(function(t){return r.put(t)});return An.waitFor(i)})}(t,e)})),o=o.next(function(){!function(t){t.createObjectStore(lr.store,{keyPath:lr.keyPath})}(t),function(t){t.createObjectStore(cr.store,{keyPath:"id",autoIncrement:!0})}(t)})),n<5&&r>=5&&(o=o.next(function(){return i.removeAcknowledgedMutations(e)})),n<6&&r>=6&&(o=o.next(function(){return function(t){t.createObjectStore(ir.store)}(t),i.addDocumentGlobal(e)})),n<7&&r>=7&&(o=o.next(function(){return i.ensureSequenceNumbers(e)})),o},t.prototype.addDocumentGlobal=function(t){var e=0;return t.store(rr.store).iterate(function(t,n){e+=Gn(n)}).next(function(){var n=new ir(e);return t.store(ir.store).put(ir.key,n)})},t.prototype.removeAcknowledgedMutations=function(t){var e=this,n=t.store(Zn.store),r=t.store($n.store);return n.loadAll().next(function(n){return An.forEach(n,function(n){var i=IDBKeyRange.bound([n.userId,_n],[n.userId,n.lastAcknowledgedBatchId]);return r.loadAll($n.userMutationsIndex,i).next(function(r){return An.forEach(r,function(r){m(r.userId===n.userId,"Cannot process batch "+r.batchId+" from unexpected user");var i=e.serializer.fromDbMutationBatch(r);return dr(t,n.userId,i).next(function(){})})})})})},t.prototype.ensureSequenceNumbers=function(t){var e=t.store(ar.store),n=t.store(rr.store);return jn(t).next(function(t){var r=[];return n.iterate(function(n,i){var o=new rt(n),a=function(t){return[0,mn(t)]}(o);r.push(e.get(a).next(function(n){return n?An.resolve():function(n){return e.put(new ar(0,mn(n),t))}(o)}))}).next(function(){return An.waitFor(r)})})},t}(),Yn=function(){return function(t,e){this.seconds=t,this.nanoseconds=e}}(),Jn=function(){function t(t,e,n){this.ownerId=t,this.allowTabSynchronization=e,this.leaseTimestampMs=n}return t.store="owner",t.key="owner",t}(),Zn=function(){function t(t,e,n){this.userId=t,this.lastAcknowledgedBatchId=e,this.lastStreamToken=n}return t.store="mutationQueues",t.keyPath="userId",t}(),$n=function(){function t(t,e,n,r){this.userId=t,this.batchId=e,this.localWriteTimeMs=n,this.mutations=r}return t.store="mutations",t.keyPath="batchId",t.userMutationsIndex="userMutationsIndex",t.userMutationsKeyPath=["userId","batchId"],t}(),tr=function(){function t(){}return t.prefixForUser=function(t){return[t]},t.prefixForPath=function(t,e){return[t,mn(e)]},t.key=function(t,e,n){return[t,mn(e),n]},t.store="documentMutations",t.PLACEHOLDER=new t,t}(),er=function(){return function(t,e){this.path=t,this.readTime=e}}(),nr=function(){return function(t,e){this.path=t,this.version=e}}(),rr=function(){function t(t,e,n,r){this.unknownDocument=t,this.noDocument=e,this.document=n,this.hasCommittedMutations=r}return t.store="remoteDocuments",t}(),ir=function(){function t(t){this.byteSize=t}return t.store="remoteDocumentGlobal",t.key="remoteDocumentGlobalKey",t}(),or=function(){function t(t,e,n,r,i,o){this.targetId=t,this.canonicalId=e,this.readTime=n,this.resumeToken=r,this.lastListenSequenceNumber=i,this.query=o}return t.store="targets",t.keyPath="targetId",t.queryTargetsIndexName="queryTargetsIndex",t.queryTargetsKeyPath=["canonicalId","targetId"],t}(),ar=function(){function t(t,e,n){this.targetId=t,this.path=e,this.sequenceNumber=n,m(0===t==(void 0!==n),"A target-document row must either have targetId == 0 and a defined sequence number, or a non-zero targetId and no sequence number")}return t.store="targetDocuments",t.keyPath=["targetId","path"],t.documentTargetsIndex="documentTargetsIndex",t.documentTargetsKeyPath=["path","targetId"],t}(),sr=function(){function t(t,e,n,r){this.highestTargetId=t,this.highestListenSequenceNumber=e,this.lastRemoteSnapshotVersion=n,this.targetCount=r}return t.key="targetGlobalKey",t.store="targetGlobal",t}();function ur(t){t.createObjectStore(ar.store,{keyPath:ar.keyPath}).createIndex(ar.documentTargetsIndex,ar.documentTargetsKeyPath,{unique:!0}),t.createObjectStore(or.store,{keyPath:or.keyPath}).createIndex(or.queryTargetsIndexName,or.queryTargetsKeyPath,{unique:!0}),t.createObjectStore(sr.store)}var cr=function(){function t(t){this.changes=t}return t.store="remoteDocumentChanges",t.keyPath="id",t}(),lr=function(){function t(t,e,n,r,i){this.clientId=t,this.updateTimeMs=e,this.networkEnabled=n,this.inForeground=r,this.lastProcessedDocumentChangeId=i}return t.store="clientMetadata",t.keyPath="clientId",t}(),hr=[Zn.store,$n.store,tr.store,rr.store,or.store,Jn.store,sr.store,ar.store].concat([lr.store,cr.store]).concat([ir.store]),fr=function(){function t(t,e,n){this.userId=t,this.serializer=e,this.referenceDelegate=n,this.documentKeysByBatchId={}}return t.forUser=function(e,n,r){return m(""!==e.uid,"UserID must not be an empty string."),new t(e.isAuthenticated()?e.uid:"",n,r)},t.prototype.checkEmpty=function(t){var e=!0,n=IDBKeyRange.bound([this.userId,Number.NEGATIVE_INFINITY],[this.userId,Number.POSITIVE_INFINITY]);return gr(t).iterate({index:$n.userMutationsIndex,range:n},function(t,n,r){e=!1,r.done()}).next(function(){return e})},t.prototype.acknowledgeBatch=function(t,e,n){return this.getMutationQueueMetadata(t).next(function(r){var i=e.batchId;return m(i>r.lastAcknowledgedBatchId,"Mutation batchIDs must be acknowledged in order"),r.lastAcknowledgedBatchId=i,r.lastStreamToken=yr(n),vr(t).put(r)})},t.prototype.getLastStreamToken=function(t){return this.getMutationQueueMetadata(t).next(function(t){return t.lastStreamToken})},t.prototype.setLastStreamToken=function(t,e){return this.getMutationQueueMetadata(t).next(function(n){return n.lastStreamToken=yr(e),vr(t).put(n)})},t.prototype.addMutationBatch=function(t,e,n){var r=this,i=mr(t),o=gr(t);return o.add({}).next(function(t){m("number"==typeof t,"Auto-generated key is not a number");var a=new Sn(t,e,n),s=r.serializer.toDbMutationBatch(r.userId,a);r.documentKeysByBatchId[t]=a.keys();for(var u=[],c=0,l=n;c<l.length;c++){var h=tr.key(r.userId,l[c].key.path,t);u.push(o.put(s)),u.push(i.put(h,tr.PLACEHOLDER))}return An.waitFor(u).next(function(){return a})})},t.prototype.lookupMutationBatch=function(t,e){var n=this;return gr(t).get(e).next(function(t){return t?(m(t.userId===n.userId,"Unexpected user '"+t.userId+"' for mutation batch "+e),n.serializer.fromDbMutationBatch(t)):null})},t.prototype.lookupMutationKeys=function(t,e){var n=this;return this.documentKeysByBatchId[e]?An.resolve(this.documentKeysByBatchId[e]):this.lookupMutationBatch(t,e).next(function(t){if(t){var r=t.keys();return n.documentKeysByBatchId[e]=r,r}return null})},t.prototype.getNextMutationBatchAfterBatchId=function(t,e){var n=this;return this.getMutationQueueMetadata(t).next(function(r){var i=Math.max(e,r.lastAcknowledgedBatchId)+1,o=IDBKeyRange.lowerBound([n.userId,i]),a=null;return gr(t).iterate({index:$n.userMutationsIndex,range:o},function(t,e,r){e.userId===n.userId&&(m(e.batchId>=i,"Should have found mutation after "+i),a=n.serializer.fromDbMutationBatch(e)),r.done()}).next(function(){return a})})},t.prototype.getAllMutationBatches=function(t){var e=this,n=IDBKeyRange.bound([this.userId,_n],[this.userId,Number.POSITIVE_INFINITY]);return gr(t).loadAll($n.userMutationsIndex,n).next(function(t){return t.map(function(t){return e.serializer.fromDbMutationBatch(t)})})},t.prototype.getAllMutationBatchesAffectingDocumentKey=function(t,e){var n=this,r=tr.prefixForPath(this.userId,e.path),i=IDBKeyRange.lowerBound(r),o=[];return mr(t).iterate({range:i},function(r,i,a){var s=r[0],u=r[2],c=wn(r[1]);if(s===n.userId&&e.path.isEqual(c))return gr(t).get(u).next(function(t){if(!t)throw g("Dangling document-mutation reference found: "+r+" which points to "+u);m(t.userId===n.userId,"Unexpected user '"+t.userId+"' for mutation batch "+u),o.push(n.serializer.fromDbMutationBatch(t))});a.done()}).next(function(){return o})},t.prototype.getAllMutationBatchesAffectingDocumentKeys=function(t,e){var n=this,r=new $t(W),i=[];return e.forEach(function(e){var o=tr.prefixForPath(n.userId,e.path),a=IDBKeyRange.lowerBound(o),s=mr(t).iterate({range:a},function(t,i,o){var a=t[0],s=t[2],u=wn(t[1]);a===n.userId&&e.path.isEqual(u)?r=r.add(s):o.done()});i.push(s)}),An.waitFor(i).next(function(){return n.lookupMutationBatches(t,r)})},t.prototype.getAllMutationBatchesAffectingQuery=function(t,e){var n=this;m(!e.isDocumentQuery(),"Document queries shouldn't go down this path");var r=e.path,i=r.length+1,o=tr.prefixForPath(this.userId,r),a=IDBKeyRange.lowerBound(o),s=new $t(W);return mr(t).iterate({range:a},function(t,e,o){var a=t[0],u=t[2],c=wn(t[1]);a===n.userId&&r.isPrefixOf(c)?c.length===i&&(s=s.add(u)):o.done()}).next(function(){return n.lookupMutationBatches(t,s)})},t.prototype.lookupMutationBatches=function(t,e){var n=this,r=[],i=[];return e.forEach(function(e){i.push(gr(t).get(e).next(function(t){if(null===t)throw g("Dangling document-mutation reference found, which points to "+e);m(t.userId===n.userId,"Unexpected user '"+t.userId+"' for mutation batch "+e),r.push(n.serializer.fromDbMutationBatch(t))}))}),An.waitFor(i).next(function(){return r})},t.prototype.removeMutationBatch=function(t,e){var n=this;return dr(t.simpleDbTransaction,this.userId,e).next(function(r){return n.removeCachedMutationKeys(e.batchId),An.forEach(r,function(e){return n.referenceDelegate.removeMutationReference(t,e)})})},t.prototype.removeCachedMutationKeys=function(t){delete this.documentKeysByBatchId[t]},t.prototype.performConsistencyCheck=function(t){var e=this;return this.checkEmpty(t).next(function(n){if(!n)return An.resolve();var r=IDBKeyRange.lowerBound(tr.prefixForUser(e.userId)),i=[];return mr(t).iterate({range:r},function(t,n,r){if(t[0]===e.userId){var o=wn(t[1]);i.push(o)}else r.done()}).next(function(){m(0===i.length,"Document leak -- detected dangling mutation references when queue is empty. Dangling keys: "+i.map(function(t){return t.canonicalString()}))})})},t.prototype.containsKey=function(t,e){return pr(t,this.userId,e)},t.prototype.getMutationQueueMetadata=function(t){var e=this;return vr(t).get(this.userId).next(function(t){return t||new Zn(e.userId,_n,"")})},t}();function pr(t,e,n){var r=tr.prefixForPath(e,n.path),i=r[1],o=IDBKeyRange.lowerBound(r),a=!1;return mr(t).iterate({range:o,keysOnly:!0},function(t,n,r){t[0]===e&&t[1]===i&&(a=!0),r.done()}).next(function(){return a})}function dr(t,e,n){var r=t.store($n.store),i=t.store(tr.store),o=[],a=IDBKeyRange.only(n.batchId),s=0,u=r.iterate({range:a},function(t,e,n){return s++,n.delete()});o.push(u.next(function(){m(1===s,"Dangling document-mutation reference found: Missing batch "+n.batchId)}));for(var c=[],l=0,h=n.mutations;l<h.length;l++){var f=h[l],p=tr.key(e,f.key.path,n.batchId);o.push(i.delete(p)),c.push(f.key)}return An.waitFor(o).next(function(){return c})}function yr(t){return t instanceof Uint8Array?(m("YES"===process.env.USE_MOCK_PERSISTENCE,"Persisting non-string stream tokens is only supported with mock persistence."),t.toString()):t}function gr(t){return Nr.getStore(t,$n.store)}function mr(t){return Nr.getStore(t,tr.store)}function vr(t){return Nr.getStore(t,Zn.store)}var br=function(){function t(t){this.remoteSerializer=t}return t.prototype.fromDbRemoteDocument=function(t){if(t.document)return this.remoteSerializer.fromDocument(t.document,!!t.hasCommittedMutations);if(t.noDocument){var e=at.fromSegments(t.noDocument.path),n=this.fromDbTimestamp(t.noDocument.readTime);return new ct(e,n,{hasCommittedMutations:!!t.hasCommittedMutations})}return t.unknownDocument?(e=at.fromSegments(t.unknownDocument.path),n=this.fromDbTimestamp(t.unknownDocument.version),new lt(e,n)):g("Unexpected DbRemoteDocument")},t.prototype.toDbRemoteDocument=function(t){if(t instanceof ut){var e=this.remoteSerializer.toDocument(t);return new rr(null,null,e,i=t.hasCommittedMutations)}if(t instanceof ct){var n=t.key.path.toArray(),r=this.toDbTimestamp(t.version),i=t.hasCommittedMutations;return new rr(null,new er(n,r),null,i)}return t instanceof lt?(n=t.key.path.toArray(),r=this.toDbTimestamp(t.version),new rr(new nr(n,r),null,null,!0)):g("Unexpected MaybeDocumment")},t.prototype.toDbTimestamp=function(t){var e=t.toTimestamp();return new Yn(e.seconds,e.nanoseconds)},t.prototype.fromDbTimestamp=function(t){var e=new Z(t.seconds,t.nanoseconds);return Yt.fromTimestamp(e)},t.prototype.toDbMutationBatch=function(t,e){var n=this,r=e.mutations.map(function(t){return n.remoteSerializer.toMutation(t)});return new $n(t,e.batchId,e.localWriteTime.toMillis(),r)},t.prototype.fromDbMutationBatch=function(t){var e=this,n=t.mutations.map(function(t){return e.remoteSerializer.fromMutation(t)}),r=Z.fromMillis(t.localWriteTimeMs);return new Sn(t.batchId,r,n)},t.prototype.toDbResourcePaths=function(t){var e=[];return t.forEach(function(t){e.push(mn(t.path))}),e},t.prototype.fromDbResourcePaths=function(t){for(var e=Ie(),n=0,r=t;n<r.length;n++)e=e.add(new at(wn(r[n])));return e},t.prototype.fromDbTarget=function(t){var e,n=this.fromDbTimestamp(t.readTime);return e=void 0!==t.query.documents?this.remoteSerializer.fromDocumentsTarget(t.query):this.remoteSerializer.fromQueryTarget(t.query),new Zt(e,t.targetId,Jt.Listen,t.lastListenSequenceNumber,n,t.resumeToken)},t.prototype.toDbTarget=function(t){m(Jt.Listen===t.purpose,"Only queries with purpose "+Jt.Listen+" may be stored, got "+t.purpose);var e,n,r=this.toDbTimestamp(t.snapshotVersion);return e=t.query.isDocumentQuery()?this.remoteSerializer.toDocumentsTarget(t.query):this.remoteSerializer.toQueryTarget(t.query),t.resumeToken instanceof Uint8Array?(m("YES"===process.env.USE_MOCK_PERSISTENCE,"Persisting non-string stream tokens is only supported with mock persistence ."),n=t.resumeToken.toString()):n=t.resumeToken,new or(t.targetId,t.query.canonicalId(),r,n,t.sequenceNumber,e)},t}();function wr(t,e){var n=t[1],r=e[1],i=W(t[0],e[0]);return 0===i?W(n,r):i}var _r=function(){function t(t){this.maxElements=t,this.buffer=new $t(wr),this.previousIndex=0}return t.prototype.nextIndex=function(){return++this.previousIndex},t.prototype.addElement=function(t){var e=[t,this.nextIndex()];if(this.buffer.size<this.maxElements)this.buffer=this.buffer.add(e);else{var n=this.buffer.last();wr(e,n)<0&&(this.buffer=this.buffer.delete(n).add(e))}},Object.defineProperty(t.prototype,"maxValue",{get:function(){return this.buffer.last()[0]},enumerable:!0,configurable:!0}),t}(),Sr={didRun:!1,sequenceNumbersCollected:0,targetsRemoved:0,documentsRemoved:0},Er=function(){function t(t,e,n){this.cacheSizeCollectionThreshold=t,this.percentileToCollect=e,this.maximumSequenceNumbersToCollect=n}return t.withCacheSize=function(e){return new t(e,t.DEFAULT_COLLECTION_PERCENTILE,t.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT)},t.COLLECTION_DISABLED=-1,t.MINIMUM_CACHE_SIZE_BYTES=1048576,t.DEFAULT=new t(t.DEFAULT_CACHE_SIZE_BYTES=41943040,t.DEFAULT_COLLECTION_PERCENTILE=10,t.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT=1e3),t.DISABLED=new t(t.COLLECTION_DISABLED,0,0),t}(),Tr=function(){function t(t,e,n){this.garbageCollector=t,this.asyncQueue=e,this.localStore=n,this.gcTask=null}return t.prototype.start=function(){m(null===this.gcTask,"Cannot start an already started LruScheduler"),this.garbageCollector.params.cacheSizeCollectionThreshold!==po&&this.scheduleGC()},t.prototype.stop=function(){this.gcTask&&(this.gcTask.cancel(),this.gcTask=null)},t.prototype.scheduleGC=function(){var t=this;m(null===this.gcTask,"Cannot schedule GC while a task is pending");var e=this.hasRun?3e5:6e4;p("LruGarbageCollector","Garbage collection scheduled in "+e+"ms"),this.gcTask=this.asyncQueue.enqueueAfterDelay(un.LruGarbageCollection,e,function(){return t.gcTask=null,t.hasRun=!0,t.localStore.collectGarbage(t.garbageCollector).then(function(){return t.scheduleGC()})})},t}(),Cr=function(){function t(t,e){this.delegate=t,this.params=e}return t.prototype.calculateTargetCount=function(t,e){return this.delegate.getSequenceNumberCount(t).next(function(t){return Math.floor(e/100*t)})},t.prototype.nthSequenceNumber=function(t,e){var n=this;if(0===e)return An.resolve(cn.INVALID);var r=new _r(e);return this.delegate.forEachTarget(t,function(t){return r.addElement(t.sequenceNumber)}).next(function(){return n.delegate.forEachOrphanedDocumentSequenceNumber(t,function(t){return r.addElement(t)})}).next(function(){return r.maxValue})},t.prototype.removeTargets=function(t,e,n){return this.delegate.removeTargets(t,e,n)},t.prototype.removeOrphanedDocuments=function(t,e){return this.delegate.removeOrphanedDocuments(t,e)},t.prototype.collect=function(t,e){var n=this;return this.params.cacheSizeCollectionThreshold===Er.COLLECTION_DISABLED?(p("LruGarbageCollector","Garbage collection skipped; disabled"),An.resolve(Sr)):this.getCacheSize(t).next(function(r){return r<n.params.cacheSizeCollectionThreshold?(p("LruGarbageCollector","Garbage collection skipped; Cache size "+r+" is lower than threshold "+n.params.cacheSizeCollectionThreshold),Sr):n.runGarbageCollection(t,e)})},t.prototype.getCacheSize=function(t){return this.delegate.getCacheSize(t)},t.prototype.runGarbageCollection=function(t,e){var n,r,i,o,a,s,u,c,f=this;return o=Date.now(),this.calculateTargetCount(t,this.params.percentileToCollect).next(function(e){return e>f.params.maximumSequenceNumbersToCollect?(p("LruGarbageCollector","Capping sequence numbers to collect down to the maximum of "+f.params.maximumSequenceNumbersToCollect+" from "+e),r=f.params.maximumSequenceNumbersToCollect):r=e,a=Date.now(),f.nthSequenceNumber(t,r)}).next(function(r){return n=r,s=Date.now(),f.removeTargets(t,n,e)}).next(function(e){return i=e,u=Date.now(),f.removeOrphanedDocuments(t,n)}).next(function(t){return c=Date.now(),h()<=l.DEBUG&&p("LruGarbageCollector","LRU Garbage Collection\n\tCounted targets in "+(a-o)+"ms\n\tDetermined least recently used "+r+" in "+(s-a)+"ms\n\tRemoved "+i+" targets in "+(u-s)+"ms\n\tRemoved "+t+" documents in "+(c-u)+"ms\nTotal Duration: "+(c-o)+"ms"),An.resolve({didRun:!0,sequenceNumbersCollected:r,targetsRemoved:i,documentsRemoved:t})})},t}(),Ir="IndexedDbPersistence",Ar="The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.",Or="Another tab has exclusive access to the persistence layer. To allow shared access, make sure to invoke `enablePersistence()` with `experimentalTabSynchronization:true` in all tabs.",Dr="This platform is either missing IndexedDB or is known to have an incomplete implementation. Offline persistence has been disabled.",kr=function(t){function e(e,n){var r=t.call(this)||this;return r.simpleDbTransaction=e,r.currentSequenceNumber=n,r}return a.__extends(e,t),e}(function(){return function(){}}()),Nr=function(){function t(e,n,r,i,o,a,s){if(this.persistenceKey=e,this.clientId=n,this.queue=i,this.multiClientParams=s,this._started=!1,this.isPrimary=!1,this.networkEnabled=!0,this.inForeground=!1,this.lastGarbageCollectionTime=Number.NEGATIVE_INFINITY,this.primaryStateListener=function(t){return Promise.resolve()},!t.isAvailable())throw new _(w.UNIMPLEMENTED,Dr);if(this.referenceDelegate=new Mr(this,a),this.dbName=e+t.MAIN_DATABASE,this.serializer=new br(o),this.document=r.document,this.allowTabSynchronization=void 0!==s,this.queryCache=new Rn(this.referenceDelegate,this.serializer),this.remoteDocumentCache=new qn(this.serializer,this.allowTabSynchronization),!r.window||!r.window.localStorage)throw new _(w.UNIMPLEMENTED,"IndexedDB persistence is only available on platforms that support LocalStorage.");this.window=r.window,this.webStorage=this.window.localStorage}return t.getStore=function(t,e){if(t instanceof kr)return On.getStore(t.simpleDbTransaction,e);throw g("IndexedDbPersistence must use instances of IndexedDbTransaction")},t.createIndexedDbPersistence=function(e,n,r,i,o,s){return a.__awaiter(this,void 0,void 0,function(){var u;return a.__generator(this,function(a){switch(a.label){case 0:return[4,(u=new t(e,n,r,i,o,s)).start()];case 1:return a.sent(),[2,u]}})})},t.createMultiClientIndexedDbPersistence=function(e,n,r,i,o,s,u){return a.__awaiter(this,void 0,void 0,function(){var c;return a.__generator(this,function(a){switch(a.label){case 0:return[4,(c=new t(e,n,r,i,o,s,u)).start()];case 1:return a.sent(),[2,c]}})})},t.prototype.start=function(){var t=this;return m(!this.started,"IndexedDbPersistence double-started!"),m(null!==this.window,"Expected 'window' to be defined"),On.openOrCreate(this.dbName,Qn,new Xn(this.serializer)).then(function(e){t.simpleDb=e}).then(function(){return t.startRemoteDocumentCache()}).then(function(){return t.attachVisibilityHandler(),t.attachWindowUnloadHook(),t.updateClientMetadataAndTryBecomePrimary().then(function(){return t.scheduleClientMetadataAndPrimaryLeaseRefreshes()})}).then(function(){return t.simpleDb.runTransaction("readonly",[sr.store],function(e){return jn(e).next(function(e){t.listenSequence=new cn(e,t.multiClientParams?t.multiClientParams.sequenceNumberSyncer:void 0)})})}).then(function(){t._started=!0}).catch(function(e){return t.simpleDb&&t.simpleDb.close(),Promise.reject(e)})},t.prototype.startRemoteDocumentCache=function(){var t=this;return this.simpleDb.runTransaction("readonly",hr,function(e){return t.remoteDocumentCache.start(e)})},t.prototype.setPrimaryStateListener=function(t){var e=this;return this.primaryStateListener=function(n){return a.__awaiter(e,void 0,void 0,function(){return a.__generator(this,function(e){return this.started?[2,t(n)]:[2]})})},t(this.isPrimary)},t.prototype.setNetworkEnabled=function(t){var e=this;this.networkEnabled!==t&&(this.networkEnabled=t,this.queue.enqueueAndForget(function(){return a.__awaiter(e,void 0,void 0,function(){return a.__generator(this,function(t){switch(t.label){case 0:return this.started?[4,this.updateClientMetadataAndTryBecomePrimary()]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}})})}))},t.prototype.updateClientMetadataAndTryBecomePrimary=function(){var t=this;return this.simpleDb.runTransaction("readwrite",hr,function(e){return xr(e).put(new lr(t.clientId,Date.now(),t.networkEnabled,t.inForeground,t.remoteDocumentCache.lastProcessedDocumentChangeId)).next(function(){if(t.isPrimary)return t.verifyPrimaryLease(e).next(function(e){e||(t.isPrimary=!1,t.queue.enqueueAndForget(function(){return t.primaryStateListener(!1)}))})}).next(function(){return t.canActAsPrimary(e)}).next(function(n){var r=t.isPrimary;return t.isPrimary=n,r!==t.isPrimary&&t.queue.enqueueAndForget(function(){return t.primaryStateListener(t.isPrimary)}),r&&!t.isPrimary?t.releasePrimaryLeaseIfHeld(e):t.isPrimary?t.acquireOrExtendPrimaryLease(e):void 0})})},t.prototype.verifyPrimaryLease=function(t){var e=this;return Rr(t).get(Jn.key).next(function(t){return An.resolve(e.isLocalClient(t))})},t.prototype.removeClientMetadata=function(t){return xr(t).delete(this.clientId)},t.prototype.maybeGarbageCollectMultiClientState=function(){return a.__awaiter(this,void 0,void 0,function(){var e,n,r=this;return a.__generator(this,function(i){switch(i.label){case 0:return!this.isPrimary||this.isWithinAge(this.lastGarbageCollectionTime,18e5)?[3,2]:(this.lastGarbageCollectionTime=Date.now(),n=[],[4,this.runTransaction("maybeGarbageCollectMultiClientState","readwrite-primary",function(i){var o=t.getStore(i,lr.store);return o.loadAll().next(function(t){e=r.filterActiveClients(t,18e5),n=t.filter(function(t){return-1===e.indexOf(t)})}).next(function(){return An.forEach(n,function(t){return o.delete(t.clientId)})}).next(function(){if((e=e.filter(function(t){return t.clientId!==r.clientId})).length>0){var t=e.map(function(t){return t.lastProcessedDocumentChangeId||0}),n=Math.min.apply(Math,t);return r.remoteDocumentCache.removeDocumentChangesThroughChangeId(i,n)}})})]);case 1:i.sent(),n.forEach(function(t){r.window.localStorage.removeItem(r.zombiedClientLocalStorageKey(t.clientId))}),i.label=2;case 2:return[2]}})})},t.prototype.scheduleClientMetadataAndPrimaryLeaseRefreshes=function(){var t=this;this.clientMetadataRefresher=this.queue.enqueueAfterDelay(un.ClientMetadataRefresh,4e3,function(){return t.updateClientMetadataAndTryBecomePrimary().then(function(){return t.maybeGarbageCollectMultiClientState()}).then(function(){return t.scheduleClientMetadataAndPrimaryLeaseRefreshes()})})},t.prototype.isLocalClient=function(t){return!!t&&t.ownerId===this.clientId},t.prototype.canActAsPrimary=function(t){var e=this;return Rr(t).get(Jn.key).next(function(n){if(null!==n&&e.isWithinAge(n.leaseTimestampMs,5e3)&&!e.isClientZombied(n.ownerId)){if(e.isLocalClient(n)&&e.networkEnabled)return!0;if(!e.isLocalClient(n)){if(!n.allowTabSynchronization)throw new _(w.FAILED_PRECONDITION,Or);return!1}}return!(!e.networkEnabled||!e.inForeground)||xr(t).loadAll().next(function(t){return void 0===e.filterActiveClients(t,5e3).find(function(t){return!(e.clientId===t.clientId||!(!e.networkEnabled&&t.networkEnabled||!e.inForeground&&t.inForeground&&e.networkEnabled===t.networkEnabled))})})}).next(function(t){return e.isPrimary!==t&&p(Ir,"Client "+(t?"is":"is not")+" eligible for a primary lease."),t})},t.prototype.shutdown=function(t){return a.__awaiter(this,void 0,void 0,function(){var e=this;return a.__generator(this,function(n){switch(n.label){case 0:return this._started=!1,this.markClientZombied(),this.clientMetadataRefresher&&this.clientMetadataRefresher.cancel(),this.detachVisibilityHandler(),this.detachWindowUnloadHook(),[4,this.simpleDb.runTransaction("readwrite",[Jn.store,lr.store],function(t){return e.releasePrimaryLeaseIfHeld(t).next(function(){return e.removeClientMetadata(t)})})];case 1:return n.sent(),this.simpleDb.close(),this.removeClientZombiedEntry(),t?[4,On.delete(this.dbName)]:[3,3];case 2:n.sent(),n.label=3;case 3:return[2]}})})},t.prototype.filterActiveClients=function(t,e){var n=this;return t.filter(function(t){return n.isWithinAge(t.updateTimeMs,e)&&!n.isClientZombied(t.clientId)})},t.prototype.getActiveClients=function(){var t=this;return this.simpleDb.runTransaction("readonly",[lr.store],function(e){return xr(e).loadAll().next(function(e){return t.filterActiveClients(e,18e5).map(function(t){return t.clientId})})})},Object.defineProperty(t.prototype,"started",{get:function(){return this._started},enumerable:!0,configurable:!0}),t.prototype.getMutationQueue=function(t){return m(this.started,"Cannot initialize MutationQueue before persistence is started."),fr.forUser(t,this.serializer,this.referenceDelegate)},t.prototype.getQueryCache=function(){return m(this.started,"Cannot initialize QueryCache before persistence is started."),this.queryCache},t.prototype.getRemoteDocumentCache=function(){return m(this.started,"Cannot initialize RemoteDocumentCache before persistence is started."),this.remoteDocumentCache},t.prototype.runTransaction=function(t,e,n){var r=this;return p(Ir,"Starting transaction:",t),this.simpleDb.runTransaction("readonly"===e?"readonly":"readwrite",hr,function(i){return"readwrite-primary"===e?r.verifyPrimaryLease(i).next(function(e){if(!e)throw d("Failed to obtain primary lease for action '"+t+"'."),r.isPrimary=!1,r.queue.enqueueAndForget(function(){return r.primaryStateListener(!1)}),new _(w.FAILED_PRECONDITION,Ar);return n(new kr(i,r.listenSequence.next()))}).next(function(t){return r.acquireOrExtendPrimaryLease(i).next(function(){return t})}):r.verifyAllowTabSynchronization(i).next(function(){return n(new kr(i,r.listenSequence.next()))})})},t.prototype.verifyAllowTabSynchronization=function(t){var e=this;return Rr(t).get(Jn.key).next(function(t){if(null!==t&&e.isWithinAge(t.leaseTimestampMs,5e3)&&!e.isClientZombied(t.ownerId)&&!e.isLocalClient(t)&&!t.allowTabSynchronization)throw new _(w.FAILED_PRECONDITION,Or)})},t.prototype.acquireOrExtendPrimaryLease=function(t){var e=new Jn(this.clientId,this.allowTabSynchronization,Date.now());return Rr(t).put(Jn.key,e)},t.isAvailable=function(){return On.isAvailable()},t.buildStoragePrefix=function(t){var e=t.databaseId.projectId;return t.databaseId.isDefaultDatabase||(e+="."+t.databaseId.database),"firestore/"+t.persistenceKey+"/"+e+"/"},t.prototype.releasePrimaryLeaseIfHeld=function(t){var e=this,n=Rr(t);return n.get(Jn.key).next(function(t){return e.isLocalClient(t)?(p(Ir,"Releasing primary lease."),n.delete(Jn.key)):An.resolve()})},t.prototype.isWithinAge=function(t,e){var n=Date.now();return!(t<n-e||t>n&&(d("Detected an update time that is in the future: "+t+" > "+n),1))},t.prototype.attachVisibilityHandler=function(){var t=this;null!==this.document&&"function"==typeof this.document.addEventListener&&(this.documentVisibilityHandler=function(){t.queue.enqueueAndForget(function(){return t.inForeground="visible"===t.document.visibilityState,t.updateClientMetadataAndTryBecomePrimary()})},this.document.addEventListener("visibilitychange",this.documentVisibilityHandler),this.inForeground="visible"===this.document.visibilityState)},t.prototype.detachVisibilityHandler=function(){this.documentVisibilityHandler&&(m(null!==this.document&&"function"==typeof this.document.addEventListener,"Expected 'document.addEventListener' to be a function"),this.document.removeEventListener("visibilitychange",this.documentVisibilityHandler),this.documentVisibilityHandler=null)},t.prototype.attachWindowUnloadHook=function(){var t=this;"function"==typeof this.window.addEventListener&&(this.windowUnloadHandler=function(){t.markClientZombied(),t.queue.enqueueAndForget(function(){return t.shutdown()})},this.window.addEventListener("unload",this.windowUnloadHandler))},t.prototype.detachWindowUnloadHook=function(){this.windowUnloadHandler&&(m("function"==typeof this.window.removeEventListener,"Expected 'window.removeEventListener' to be a function"),this.window.removeEventListener("unload",this.windowUnloadHandler),this.windowUnloadHandler=null)},t.prototype.isClientZombied=function(t){try{var e=null!==this.webStorage.getItem(this.zombiedClientLocalStorageKey(t));return p(Ir,"Client '"+t+"' "+(e?"is":"is not")+" zombied in LocalStorage"),e}catch(n){return d(Ir,"Failed to get zombied client id.",n),!1}},t.prototype.markClientZombied=function(){try{this.webStorage.setItem(this.zombiedClientLocalStorageKey(this.clientId),String(Date.now()))}catch(t){d("Failed to set zombie client id.",t)}},t.prototype.removeClientZombiedEntry=function(){try{this.webStorage.removeItem(this.zombiedClientLocalStorageKey(this.clientId))}catch(t){}},t.prototype.zombiedClientLocalStorageKey=function(t){return"firestore_zombie_"+this.persistenceKey+"_"+t},t.MAIN_DATABASE="main",t}();function Pr(t){return t.code===w.FAILED_PRECONDITION&&t.message===Ar}function Rr(t){return t.store(Jn.store)}function xr(t){return t.store(lr.store)}var Mr=function(){function t(t,e){this.db=t,this.garbageCollector=new Cr(this,e)}return t.prototype.getSequenceNumberCount=function(t){var e=this.orphanedDocmentCount(t);return this.db.getQueryCache().getQueryCount(t).next(function(t){return e.next(function(e){return t+e})})},t.prototype.orphanedDocmentCount=function(t){var e=0;return this.forEachOrphanedDocumentSequenceNumber(t,function(t){e++}).next(function(){return e})},t.prototype.forEachTarget=function(t,e){return this.db.getQueryCache().forEachTarget(t,e)},t.prototype.forEachOrphanedDocumentSequenceNumber=function(t,e){return this.forEachOrphanedDocument(t,function(t,n){return e(n)})},t.prototype.setInMemoryPins=function(t){this.inMemoryPins=t},t.prototype.addReference=function(t,e){return jr(t,e)},t.prototype.removeReference=function(t,e){return jr(t,e)},t.prototype.removeTargets=function(t,e,n){return this.db.getQueryCache().removeTargets(t,e,n)},t.prototype.removeMutationReference=function(t,e){return jr(t,e)},t.prototype.isPinned=function(t,e){return this.inMemoryPins.containsKey(e)?An.resolve(!0):function(t,e){var n=!1;return vr(t).iterateSerial(function(r){return pr(t,r,e).next(function(t){return t&&(n=!0),An.resolve(!t)})}).next(function(){return n})}(t,e)},t.prototype.removeOrphanedDocuments=function(t,e){var n=this,r=0,i=0,o=[];return this.forEachOrphanedDocument(t,function(a,s){if(s<=e){var u=n.isPinned(t,a).next(function(e){if(!e)return r++,n.removeOrphanedDocument(t,a).next(function(t){i+=t})});o.push(u)}}).next(function(){return An.waitFor(o)}).next(function(){return n.db.getRemoteDocumentCache().updateSize(t,-i)}).next(function(){return r})},t.prototype.removeOrphanedDocument=function(t,e){var n,r=0,i=this.db.getRemoteDocumentCache();return An.waitFor([Ln(t).delete((n=e,[0,mn(n.path)])),i.removeEntry(t,e).next(function(t){r+=t})]).next(function(){return r})},t.prototype.removeTarget=function(t,e){var n=e.copy({sequenceNumber:t.currentSequenceNumber});return this.db.getQueryCache().updateQueryData(t,n)},t.prototype.updateLimboDocument=function(t,e){return jr(t,e)},t.prototype.forEachOrphanedDocument=function(t,e){var n,r=Ln(t),i=cn.INVALID;return r.iterate({index:ar.documentTargetsIndex},function(t,r){var o=r.path,a=r.sequenceNumber;0===t[0]?(i!==cn.INVALID&&e(new at(wn(n)),i),i=a,n=o):i=cn.INVALID}).next(function(){i!==cn.INVALID&&e(new at(wn(n)),i)})},t.prototype.getCacheSize=function(t){return this.db.getRemoteDocumentCache().getSize(t)},t}();function jr(t,e){return Ln(t).put(function(t,e){return new ar(0,mn(t.path),e)}(e,t.currentSequenceNumber))}var Lr=function(){function t(t,e){this.remoteDocumentCache=t,this.mutationQueue=e}return t.prototype.getDocument=function(t,e){var n=this;return this.mutationQueue.getAllMutationBatchesAffectingDocumentKey(t,e).next(function(r){return n.getDocumentInternal(t,e,r)})},t.prototype.getDocumentInternal=function(t,e,n){return this.remoteDocumentCache.getEntry(t,e).next(function(t){for(var r=0,i=n;r<i.length;r++)t=i[r].applyToLocalView(e,t);return t})},t.prototype.getDocuments=function(t,e){var n=this;return this.mutationQueue.getAllMutationBatchesAffectingDocumentKeys(t,e).next(function(r){var i=[],o=we();return e.forEach(function(e){i.push(n.getDocumentInternal(t,e,r).next(function(t){t||(t=new ct(e,Yt.forDeletedDoc())),o=o.insert(e,t)}))}),An.waitFor(i).next(function(){return o})})},t.prototype.getDocumentsMatchingQuery=function(t,e){return at.isDocumentKey(e.path)?this.getDocumentsMatchingDocumentQuery(t,e.path):this.getDocumentsMatchingCollectionQuery(t,e)},t.prototype.getDocumentsMatchingDocumentQuery=function(t,e){return this.getDocument(t,new at(e)).next(function(t){var e=Se();return t instanceof ut&&(e=e.insert(t.key,t)),e})},t.prototype.getDocumentsMatchingCollectionQuery=function(t,e){var n,r=this;return this.remoteDocumentCache.getDocumentsMatchingQuery(t,e).next(function(i){return n=i,r.mutationQueue.getAllMutationBatchesAffectingQuery(t,e)}).next(function(t){for(var r=0,i=t;r<i.length;r++)for(var o=i[r],a=0,s=o.mutations;a<s.length;a++){var u=s[a],c=u.key;if(e.path.isImmediateParentOf(c.path)){var l=n.get(c),h=u.applyToLocalView(l,l,o.localWriteTime);n=h instanceof ut?n.insert(c,h):n.remove(c)}}}).next(function(){return n.forEach(function(t,r){e.matches(r)||(n=n.remove(t))}),n})},t}(),Ur=function(){function t(){this.refsByKey=new $t(Vr.compareByKey),this.refsByTarget=new $t(Vr.compareByTargetId)}return t.prototype.isEmpty=function(){return this.refsByKey.isEmpty()},t.prototype.addReference=function(t,e){var n=new Vr(t,e);this.refsByKey=this.refsByKey.add(n),this.refsByTarget=this.refsByTarget.add(n)},t.prototype.addReferences=function(t,e){var n=this;t.forEach(function(t){return n.addReference(t,e)})},t.prototype.removeReference=function(t,e){this.removeRef(new Vr(t,e))},t.prototype.removeReferences=function(t,e){var n=this;t.forEach(function(t){return n.removeReference(t,e)})},t.prototype.removeReferencesForId=function(t){var e=this,n=at.EMPTY,r=new Vr(n,t),i=new Vr(n,t+1),o=[];return this.refsByTarget.forEachInRange([r,i],function(t){e.removeRef(t),o.push(t.key)}),o},t.prototype.removeAllReferences=function(){var t=this;this.refsByKey.forEach(function(e){return t.removeRef(e)})},t.prototype.removeRef=function(t){this.refsByKey=this.refsByKey.delete(t),this.refsByTarget=this.refsByTarget.delete(t)},t.prototype.referencesForId=function(t){var e=at.EMPTY,n=new Vr(e,t),r=new Vr(e,t+1),i=Ie();return this.refsByTarget.forEachInRange([n,r],function(t){i=i.add(t.key)}),i},t.prototype.containsKey=function(t){var e=new Vr(t,0),n=this.refsByKey.firstAfterOrEqual(e);return null!==n&&t.isEqual(n.key)},t}(),Vr=function(){function t(t,e){this.key=t,this.targetOrBatchId=e}return t.compareByKey=function(t,e){return at.comparator(t.key,e.key)||W(t.targetOrBatchId,e.targetOrBatchId)},t.compareByTargetId=function(t,e){return W(t.targetOrBatchId,e.targetOrBatchId)||at.comparator(t.key,e.key)},t}(),Fr=function(){function t(t,e){this.persistence=t,this.localViewReferences=new Ur,this.queryDataByTarget={},m(t.started,"LocalStore was passed an unstarted persistence implementation"),this.persistence.referenceDelegate.setInMemoryPins(this.localViewReferences),this.mutationQueue=t.getMutationQueue(e),this.remoteDocuments=t.getRemoteDocumentCache(),this.queryCache=t.getQueryCache(),this.localDocuments=new Lr(this.remoteDocuments,this.mutationQueue)}return t.prototype.handleUserChange=function(t){var e=this;return this.persistence.runTransaction("Handle user change","readonly",function(n){var r;return e.mutationQueue.getAllMutationBatches(n).next(function(i){return r=i,e.mutationQueue=e.persistence.getMutationQueue(t),e.localDocuments=new Lr(e.remoteDocuments,e.mutationQueue),e.mutationQueue.getAllMutationBatches(n)}).next(function(t){for(var i=[],o=[],a=Ie(),s=0,u=r;s<u.length;s++){i.push((p=u[s]).batchId);for(var c=0,l=p.mutations;c<l.length;c++)a=a.add(l[c].key)}for(var h=0,f=t;h<f.length;h++){var p;o.push((p=f[h]).batchId);for(var d=0,y=p.mutations;d<y.length;d++)a=a.add(y[d].key)}return e.localDocuments.getDocuments(n,a).next(function(t){return{affectedDocuments:t,removedBatchIds:i,addedBatchIds:o}})})})},t.prototype.localWrite=function(t){var e=this;return this.persistence.runTransaction("Locally write mutations","readwrite",function(n){var r,i=Z.now();return e.mutationQueue.addMutationBatch(n,i,t).next(function(t){var i=(r=t).keys();return e.localDocuments.getDocuments(n,i)}).next(function(t){return{batchId:r.batchId,changes:t}})})},t.prototype.lookupMutationDocuments=function(t){var e=this;return this.persistence.runTransaction("Lookup mutation documents","readonly",function(n){return e.mutationQueue.lookupMutationKeys(n,t).next(function(t){return t?e.localDocuments.getDocuments(n,t):An.resolve(null)})})},t.prototype.acknowledgeBatch=function(t){var e=this;return this.persistence.runTransaction("Acknowledge batch","readwrite-primary",function(n){var r=t.batch.keys(),i=e.remoteDocuments.newChangeBuffer();return e.mutationQueue.acknowledgeBatch(n,t.batch,t.streamToken).next(function(){return e.applyWriteToRemoteDocuments(n,t,i)}).next(function(){return i.apply(n)}).next(function(){return e.mutationQueue.performConsistencyCheck(n)}).next(function(){return e.localDocuments.getDocuments(n,r)})})},t.prototype.rejectBatch=function(t){var e=this;return this.persistence.runTransaction("Reject batch","readwrite-primary",function(n){var r;return e.mutationQueue.lookupMutationBatch(n,t).next(function(t){return m(null!==t,"Attempt to reject nonexistent batch!"),r=t.keys(),e.mutationQueue.removeMutationBatch(n,t)}).next(function(){return e.mutationQueue.performConsistencyCheck(n)}).next(function(){return e.localDocuments.getDocuments(n,r)})})},t.prototype.getLastStreamToken=function(){var t=this;return this.persistence.runTransaction("Get last stream token","readonly",function(e){return t.mutationQueue.getLastStreamToken(e)})},t.prototype.setLastStreamToken=function(t){var e=this;return this.persistence.runTransaction("Set last stream token","readwrite-primary",function(n){return e.mutationQueue.setLastStreamToken(n,t)})},t.prototype.getLastRemoteSnapshotVersion=function(){var t=this;return this.persistence.runTransaction("Get last remote snapshot version","readonly",function(e){return t.queryCache.getLastRemoteSnapshotVersion(e)})},t.prototype.applyRemoteEvent=function(e){var n=this,r=this.remoteDocuments.newChangeBuffer();return this.persistence.runTransaction("Apply remote event","readwrite-primary",function(i){var o=[],a=Ie();C(e.targetChanges,function(r,s){var u=n.queryDataByTarget[r];if(u){s.addedDocuments.forEach(function(t){a=a.add(t)}),s.modifiedDocuments.forEach(function(t){a=a.add(t)}),o.push(n.queryCache.removeMatchingKeys(i,s.removedDocuments,r).next(function(){return n.queryCache.addMatchingKeys(i,s.addedDocuments,r)}));var c=s.resumeToken;if(c.length>0){var l=u;u=u.copy({resumeToken:c,snapshotVersion:e.snapshotVersion}),n.queryDataByTarget[r]=u,t.shouldPersistQueryData(l,u,s)&&o.push(n.queryCache.updateQueryData(i,u))}}});var s=Ie();e.documentUpdates.forEach(function(t,u){s=s.add(t),o.push(r.getEntry(i,t).next(function(e){null==e||u.version.isEqual(Yt.MIN)||a.has(u.key)&&!e.hasPendingWrites||u.version.compareTo(e.version)>=0?r.addEntry(u):p("LocalStore","Ignoring outdated watch update for ",t,". Current version:",e.version," Watch version:",u.version)})),e.resolvedLimboDocuments.has(t)&&o.push(n.persistence.referenceDelegate.updateLimboDocument(i,t))});var u=e.snapshotVersion;if(!u.isEqual(Yt.MIN)){var c=n.queryCache.getLastRemoteSnapshotVersion(i).next(function(t){return m(u.compareTo(t)>=0,"Watch stream reverted to previous snapshot?? "+u+" < "+t),n.queryCache.setTargetsMetadata(i,i.currentSequenceNumber,u)});o.push(c)}return An.waitFor(o).next(function(){return r.apply(i)}).next(function(){return n.localDocuments.getDocuments(i,s)})})},t.shouldPersistQueryData=function(t,e,n){return 0!==e.resumeToken.length&&(0===t.resumeToken.length||e.snapshotVersion.toMicroseconds()-t.snapshotVersion.toMicroseconds()>=this.RESUME_TOKEN_MAX_AGE_MICROS||n.addedDocuments.size+n.modifiedDocuments.size+n.removedDocuments.size>0)},t.prototype.notifyLocalViewChanges=function(t){var e=this;return this.persistence.runTransaction("notifyLocalViewChanges","readwrite",function(n){return An.forEach(t,function(t){return e.localViewReferences.addReferences(t.addedKeys,t.targetId),e.localViewReferences.removeReferences(t.removedKeys,t.targetId),An.forEach(t.removedKeys,function(t){return e.persistence.referenceDelegate.removeReference(n,t)})})})},t.prototype.nextMutationBatch=function(t){var e=this;return this.persistence.runTransaction("Get next mutation batch","readonly",function(n){return void 0===t&&(t=_n),e.mutationQueue.getNextMutationBatchAfterBatchId(n,t)})},t.prototype.readDocument=function(t){var e=this;return this.persistence.runTransaction("read document","readonly",function(n){return e.localDocuments.getDocument(n,t)})},t.prototype.allocateQuery=function(t){var e=this;return this.persistence.runTransaction("Allocate query","readwrite",function(n){var r;return e.queryCache.getQueryData(n,t).next(function(i){return i?(r=i,An.resolve()):e.queryCache.allocateTargetId(n).next(function(i){return r=new Zt(t,i,Jt.Listen,n.currentSequenceNumber),e.queryCache.addQueryData(n,r)})}).next(function(){return m(!e.queryDataByTarget[r.targetId],"Tried to allocate an already allocated query: "+t),e.queryDataByTarget[r.targetId]=r,r})})},t.prototype.releaseQuery=function(t,e){var n=this;return this.persistence.runTransaction("Release query",e?"readwrite":"readwrite-primary",function(r){return n.queryCache.getQueryData(r,t).next(function(i){m(null!=i,"Tried to release nonexistent query: "+t);var o=i.targetId,a=n.queryDataByTarget[o],s=n.localViewReferences.removeReferencesForId(o);return delete n.queryDataByTarget[o],e?An.resolve():An.forEach(s,function(t){return n.persistence.referenceDelegate.removeReference(r,t)}).next(function(){return n.persistence.referenceDelegate.removeTarget(r,a)})})})},t.prototype.executeQuery=function(t){var e=this;return this.persistence.runTransaction("Execute query","readonly",function(n){return e.localDocuments.getDocumentsMatchingQuery(n,t)})},t.prototype.remoteDocumentKeys=function(t){var e=this;return this.persistence.runTransaction("Remote document keys","readonly",function(n){return e.queryCache.getMatchingKeysForTargetId(n,t)})},t.prototype.getActiveClients=function(){return this.persistence.getActiveClients()},t.prototype.removeCachedMutationBatchMetadata=function(t){this.mutationQueue.removeCachedMutationKeys(t)},t.prototype.setNetworkEnabled=function(t){this.persistence.setNetworkEnabled(t)},t.prototype.applyWriteToRemoteDocuments=function(t,e,n){var r=this,i=e.batch,o=i.keys(),a=An.resolve();return o.forEach(function(r){a=a.next(function(){return n.getEntry(t,r)}).next(function(t){var o=t,a=e.docVersions.get(r);m(null!==a,"ackVersions should contain every doc in the write."),(!o||o.version.compareTo(a)<0)&&((o=i.applyToRemoteDocument(r,o,e))?n.addEntry(o):m(!t,"Mutation batch "+i+" applied to document "+t+" resulted in null"))})}),a.next(function(){return r.mutationQueue.removeMutationBatch(t,i)})},t.prototype.collectGarbage=function(t){var e=this;return this.persistence.runTransaction("Collect garbage","readwrite-primary",function(n){return t.collect(n,e.queryDataByTarget)})},t.prototype.getQueryForTarget=function(t){var e=this;return this.queryDataByTarget[t]?Promise.resolve(this.queryDataByTarget[t].query):this.persistence.runTransaction("Get query data","readonly",function(n){return e.queryCache.getQueryDataForTarget(n,t).next(function(t){return t?t.query:null})})},t.prototype.getNewDocumentChanges=function(){var t=this;return this.persistence.runTransaction("Get new document changes","readonly",function(e){return t.remoteDocuments.getNewDocumentChanges(e)})},t.RESUME_TOKEN_MAX_AGE_MICROS=3e8,t}(),qr=function(){function t(t){this.referenceDelegate=t,this.mutationQueue=[],this.nextBatchId=1,this.highestAcknowledgedBatchId=_n,this.lastStreamToken=b(),this.batchesByDocumentKey=new $t(Vr.compareByKey)}return t.prototype.checkEmpty=function(t){return An.resolve(0===this.mutationQueue.length)},t.prototype.acknowledgeBatch=function(t,e,n){var r=e.batchId;m(r>this.highestAcknowledgedBatchId,"Mutation batchIDs must be acknowledged in order");var i=this.indexOfExistingBatchId(r,"acknowledged");m(0===i,"Can only acknowledge the first batch in the mutation queue");var o=this.mutationQueue[i];return m(r===o.batchId,"Queue ordering failure: expected batch "+r+", got batch "+o.batchId),this.highestAcknowledgedBatchId=r,this.lastStreamToken=n,An.resolve()},t.prototype.getLastStreamToken=function(t){return An.resolve(this.lastStreamToken)},t.prototype.setLastStreamToken=function(t,e){return this.lastStreamToken=e,An.resolve()},t.prototype.addMutationBatch=function(t,e,n){m(0!==n.length,"Mutation batches should not be empty");var r=this.nextBatchId;this.nextBatchId++,this.mutationQueue.length>0&&m(this.mutationQueue[this.mutationQueue.length-1].batchId<r,"Mutation batchIDs must be monotonically increasing order");var i=new Sn(r,e,n);this.mutationQueue.push(i);for(var o=0,a=n;o<a.length;o++)this.batchesByDocumentKey=this.batchesByDocumentKey.add(new Vr(a[o].key,r));return An.resolve(i)},t.prototype.lookupMutationBatch=function(t,e){return An.resolve(this.findMutationBatch(e))},t.prototype.lookupMutationKeys=function(t,e){var n=this.findMutationBatch(e);return m(null!=n,"Failed to find local mutation batch."),An.resolve(n.keys())},t.prototype.getNextMutationBatchAfterBatchId=function(t,e){var n=Math.max(e,this.highestAcknowledgedBatchId)+1,r=this.indexOfBatchId(n),i=r<0?0:r;return An.resolve(this.mutationQueue.length>i?this.mutationQueue[i]:null)},t.prototype.getAllMutationBatches=function(t){return An.resolve(this.mutationQueue.slice())},t.prototype.getAllMutationBatchesAffectingDocumentKey=function(t,e){var n=this,r=new Vr(e,0),i=new Vr(e,Number.POSITIVE_INFINITY),o=[];return this.batchesByDocumentKey.forEachInRange([r,i],function(t){m(e.isEqual(t.key),"Should only iterate over a single key's batches");var r=n.findMutationBatch(t.targetOrBatchId);m(null!==r,"Batches in the index must exist in the main table"),o.push(r)}),An.resolve(o)},t.prototype.getAllMutationBatchesAffectingDocumentKeys=function(t,e){var n=this,r=new $t(W);return e.forEach(function(t){var e=new Vr(t,0),i=new Vr(t,Number.POSITIVE_INFINITY);n.batchesByDocumentKey.forEachInRange([e,i],function(e){m(t.isEqual(e.key),"For each key, should only iterate over a single key's batches"),r=r.add(e.targetOrBatchId)})}),An.resolve(this.findMutationBatches(r))},t.prototype.getAllMutationBatchesAffectingQuery=function(t,e){var n=e.path,r=n.length+1,i=n;at.isDocumentKey(i)||(i=i.child(""));var o=new Vr(new at(i),0),a=new $t(W);return this.batchesByDocumentKey.forEachWhile(function(t){var e=t.key.path;return!!n.isPrefixOf(e)&&(e.length===r&&(a=a.add(t.targetOrBatchId)),!0)},o),An.resolve(this.findMutationBatches(a))},t.prototype.findMutationBatches=function(t){var e=this,n=[];return t.forEach(function(t){var r=e.findMutationBatch(t);null!==r&&n.push(r)}),n},t.prototype.removeMutationBatch=function(t,e){var n=this;m(0===this.indexOfExistingBatchId(e.batchId,"removed"),"Can only remove the first entry of the mutation queue"),this.mutationQueue.shift();var r=this.batchesByDocumentKey;return An.forEach(e.mutations,function(i){var o=new Vr(i.key,e.batchId);return r=r.delete(o),n.referenceDelegate.removeMutationReference(t,i.key)}).next(function(){n.batchesByDocumentKey=r})},t.prototype.removeCachedMutationKeys=function(t){},t.prototype.containsKey=function(t,e){var n=new Vr(e,0),r=this.batchesByDocumentKey.firstAfterOrEqual(n);return An.resolve(e.isEqual(r&&r.key))},t.prototype.performConsistencyCheck=function(t){return 0===this.mutationQueue.length&&m(this.batchesByDocumentKey.isEmpty(),"Document leak -- detected dangling mutation references when queue is empty."),An.resolve()},t.prototype.indexOfExistingBatchId=function(t,e){var n=this.indexOfBatchId(t);return m(n>=0&&n<this.mutationQueue.length,"Batches must exist to be "+e),n},t.prototype.indexOfBatchId=function(t){return 0===this.mutationQueue.length?0:t-this.mutationQueue[0].batchId},t.prototype.findMutationBatch=function(t){var e=this.indexOfBatchId(t);if(e<0||e>=this.mutationQueue.length)return null;var n=this.mutationQueue[e];return m(n.batchId===t,"If found batch must match"),n},t}(),Br=function(){function t(t){this.persistence=t,this.queries=new Un(function(t){return t.canonicalId()}),this.lastRemoteSnapshotVersion=Yt.MIN,this.highestTargetId=0,this.highestSequenceNumber=0,this.references=new Ur,this.targetCount=0,this.targetIdGenerator=In.forQueryCache()}return t.prototype.getTargetCount=function(t){return An.resolve(this.targetCount)},t.prototype.forEachTarget=function(t,e){return this.queries.forEach(function(t,n){return e(n)}),An.resolve()},t.prototype.getLastRemoteSnapshotVersion=function(t){return An.resolve(this.lastRemoteSnapshotVersion)},t.prototype.getHighestSequenceNumber=function(t){return An.resolve(this.highestSequenceNumber)},t.prototype.allocateTargetId=function(t){var e=this.targetIdGenerator.after(this.highestTargetId);return this.highestTargetId=e,An.resolve(e)},t.prototype.setTargetsMetadata=function(t,e,n){return n&&(this.lastRemoteSnapshotVersion=n),e>this.highestSequenceNumber&&(this.highestSequenceNumber=e),An.resolve()},t.prototype.saveQueryData=function(t){this.queries.set(t.query,t);var e=t.targetId;e>this.highestTargetId&&(this.highestTargetId=e),t.sequenceNumber>this.highestSequenceNumber&&(this.highestSequenceNumber=t.sequenceNumber)},t.prototype.addQueryData=function(t,e){return m(!this.queries.has(e.query),"Adding a query that already exists"),this.saveQueryData(e),this.targetCount+=1,An.resolve()},t.prototype.updateQueryData=function(t,e){return m(this.queries.has(e.query),"Updating a non-existent query"),this.saveQueryData(e),An.resolve()},t.prototype.removeQueryData=function(t,e){return m(this.targetCount>0,"Removing a target from an empty cache"),m(this.queries.has(e.query),"Removing a non-existent target from the cache"),this.queries.delete(e.query),this.references.removeReferencesForId(e.targetId),this.targetCount-=1,An.resolve()},t.prototype.removeTargets=function(t,e,n){var r=this,i=0,o=[];return this.queries.forEach(function(a,s){s.sequenceNumber<=e&&!n[s.targetId]&&(r.queries.delete(a),o.push(r.removeMatchingKeysForTargetId(t,s.targetId)),i++)}),An.waitFor(o).next(function(){return i})},t.prototype.getQueryCount=function(t){return An.resolve(this.targetCount)},t.prototype.getQueryData=function(t,e){var n=this.queries.get(e)||null;return An.resolve(n)},t.prototype.getQueryDataForTarget=function(t,e){return g("Not yet implemented.")},t.prototype.addMatchingKeys=function(t,e,n){this.references.addReferences(e,n);var r=this.persistence.referenceDelegate,i=[];return r&&e.forEach(function(e){i.push(r.addReference(t,e))}),An.waitFor(i)},t.prototype.removeMatchingKeys=function(t,e,n){this.references.removeReferences(e,n);var r=this.persistence.referenceDelegate,i=[];return r&&e.forEach(function(e){i.push(r.removeReference(t,e))}),An.waitFor(i)},t.prototype.removeMatchingKeysForTargetId=function(t,e){return this.references.removeReferencesForId(e),An.resolve()},t.prototype.getMatchingKeysForTargetId=function(t,e){var n=this.references.referencesForId(e);return An.resolve(n)},t.prototype.containsKey=function(t,e){return An.resolve(this.references.containsKey(e))},t}(),Hr=function(){function t(t){this.sizer=t,this.docs=new ht(at.comparator),this.newDocumentChanges=Ie(),this.size=0}return t.prototype.addEntries=function(t,e,n){for(var r=0,i=e;r<i.length;r++){var o=i[r],a=o.maybeDocument.key;this.docs=this.docs.insert(a,o),this.newDocumentChanges=this.newDocumentChanges.add(a)}return this.size+=n,An.resolve()},t.prototype.removeEntry=function(t,e){var n=this.docs.get(e);return n?(this.docs=this.docs.remove(e),this.size-=n.size,An.resolve(n.size)):An.resolve(0)},t.prototype.getEntry=function(t,e){var n=this.docs.get(e);return An.resolve(n?n.maybeDocument:null)},t.prototype.getSizedEntry=function(t,e){return An.resolve(this.docs.get(e))},t.prototype.getDocumentsMatchingQuery=function(t,e){for(var n=Se(),r=new at(e.path.child("")),i=this.docs.getIteratorFrom(r);i.hasNext();){var o=i.getNext(),a=o.value.maybeDocument;if(!e.path.isPrefixOf(o.key.path))break;a instanceof ut&&e.matches(a)&&(n=n.insert(a.key,a))}return An.resolve(n)},t.prototype.forEachDocumentKey=function(t,e){return An.forEach(this.docs,function(t){return e(t)})},t.prototype.getNewDocumentChanges=function(t){var e=this,n=we();return this.newDocumentChanges.forEach(function(t){var r=e.docs.get(t),i=r?r.maybeDocument:new ct(t,Yt.forDeletedDoc());n=n.insert(t,i)}),this.newDocumentChanges=Ie(),An.resolve(n)},t.prototype.newChangeBuffer=function(){return new zr(this.sizer,this)},t.prototype.getSize=function(t){return An.resolve(this.size)},t}(),zr=function(t){function e(e,n){var r=t.call(this)||this;return r.sizer=e,r.documentCache=n,r}return a.__extends(e,t),e.prototype.applyChanges=function(t){var e=this,n=this.assertChanges(),r=0,i=[];return n.forEach(function(t,n){var o=e.documentSizes.get(t);m(void 0!==o,"Attempting to change document "+t.toString()+" without having read it first");var a=e.sizer(n);r+=a-o,i.push({maybeDocument:n,size:a})}),this.documentCache.addEntries(t,i,r)},e.prototype.getFromCache=function(t,e){return this.documentCache.getSizedEntry(t,e)},e}(Vn),Wr=function(){function t(t,e){var n=this;this.clientId=t,this.mutationQueues={},this.listenSequence=new cn(0),this._started=!1,this._started=!0,this.referenceDelegate=e(this),this.queryCache=new Br(this),this.remoteDocumentCache=new Hr(function(t){return n.referenceDelegate.documentSize(t)})}return t.createLruPersistence=function(e,n,r){return new t(e,function(t){return new Qr(t,new br(n),r)})},t.createEagerPersistence=function(e){return new t(e,function(t){return new Gr(t)})},t.prototype.shutdown=function(t){return this._started=!1,Promise.resolve()},Object.defineProperty(t.prototype,"started",{get:function(){return this._started},enumerable:!0,configurable:!0}),t.prototype.getActiveClients=function(){return a.__awaiter(this,void 0,void 0,function(){return a.__generator(this,function(t){return[2,[this.clientId]]})})},t.prototype.setPrimaryStateListener=function(t){return t(!0)},t.prototype.setNetworkEnabled=function(t){},t.prototype.getMutationQueue=function(t){var e=this.mutationQueues[t.toKey()];return e||(e=new qr(this.referenceDelegate),this.mutationQueues[t.toKey()]=e),e},t.prototype.getQueryCache=function(){return this.queryCache},t.prototype.getRemoteDocumentCache=function(){return this.remoteDocumentCache},t.prototype.runTransaction=function(t,e,n){var r=this;p("MemoryPersistence","Starting transaction:",t);var i=new Kr(this.listenSequence.next());return this.referenceDelegate.onTransactionStarted(),n(i).next(function(t){return r.referenceDelegate.onTransactionCommitted(i).next(function(){return t})}).toPromise()},t.prototype.mutationQueuesContainKey=function(t,e){return An.or((n=this.mutationQueues,r=[],I(n,function(t,e){return r.push(e)}),r).map(function(n){return function(){return n.containsKey(t,e)}}));var n,r},t}(),Kr=function(){return function(t){this.currentSequenceNumber=t}}(),Gr=function(){function t(t){this.persistence=t}return t.prototype.setInMemoryPins=function(t){this.inMemoryPins=t},t.prototype.addReference=function(t,e){return this.orphanedDocuments.delete(e),An.resolve()},t.prototype.removeReference=function(t,e){return this.orphanedDocuments.add(e),An.resolve()},t.prototype.removeMutationReference=function(t,e){return this.orphanedDocuments.add(e),An.resolve()},t.prototype.removeTarget=function(t,e){var n=this,r=this.persistence.getQueryCache();return r.getMatchingKeysForTargetId(t,e.targetId).next(function(t){t.forEach(function(t){return n.orphanedDocuments.add(t)})}).next(function(){return r.removeQueryData(t,e)})},t.prototype.onTransactionStarted=function(){this.orphanedDocuments=new Set},t.prototype.onTransactionCommitted=function(t){var e=this,n=this.persistence.getRemoteDocumentCache();return An.forEach(this.orphanedDocuments,function(r){return e.isReferenced(t,r).next(function(e){return e?An.resolve():n.removeEntry(t,r).next(function(){})})})},t.prototype.updateLimboDocument=function(t,e){var n=this;return this.isReferenced(t,e).next(function(t){t?n.orphanedDocuments.delete(e):n.orphanedDocuments.add(e)})},t.prototype.documentSize=function(t){return 0},t.prototype.isReferenced=function(t,e){var n=this;return An.or([function(){return n.persistence.getQueryCache().containsKey(t,e)},function(){return n.persistence.mutationQueuesContainKey(t,e)},function(){return An.resolve(n.inMemoryPins.containsKey(e))}])},t}(),Qr=function(){function t(t,e,n){this.persistence=t,this.serializer=e,this.orphanedSequenceNumbers=new Un(function(t){return mn(t.path)}),this.garbageCollector=new Cr(this,n)}return t.prototype.onTransactionStarted=function(){},t.prototype.onTransactionCommitted=function(t){return An.resolve()},t.prototype.forEachTarget=function(t,e){return this.persistence.getQueryCache().forEachTarget(t,e)},t.prototype.getSequenceNumberCount=function(t){var e=this.orphanedDocumentCount(t);return this.persistence.getQueryCache().getTargetCount(t).next(function(t){return e.next(function(e){return t+e})})},t.prototype.orphanedDocumentCount=function(t){var e=0;return this.forEachOrphanedDocumentSequenceNumber(t,function(t){e++}).next(function(){return e})},t.prototype.forEachOrphanedDocumentSequenceNumber=function(t,e){var n=this;return An.forEach(this.orphanedSequenceNumbers,function(r,i){return n.isPinned(t,r,i).next(function(t){return t?An.resolve():e(i)})})},t.prototype.setInMemoryPins=function(t){this.inMemoryPins=t},t.prototype.removeTargets=function(t,e,n){return this.persistence.getQueryCache().removeTargets(t,e,n)},t.prototype.removeOrphanedDocuments=function(t,e){var n=this,r=0,i=this.persistence.getRemoteDocumentCache();return i.forEachDocumentKey(t,function(o){return n.isPinned(t,o,e).next(function(e){return e?An.resolve():(r++,i.removeEntry(t,o).next())})}).next(function(){return r})},t.prototype.removeMutationReference=function(t,e){return this.orphanedSequenceNumbers.set(e,t.currentSequenceNumber),An.resolve()},t.prototype.removeTarget=function(t,e){var n=e.copy({sequenceNumber:t.currentSequenceNumber});return this.persistence.getQueryCache().updateQueryData(t,n)},t.prototype.addReference=function(t,e){return this.orphanedSequenceNumbers.set(e,t.currentSequenceNumber),An.resolve()},t.prototype.removeReference=function(t,e){return this.orphanedSequenceNumbers.set(e,t.currentSequenceNumber),An.resolve()},t.prototype.updateLimboDocument=function(t,e){return this.orphanedSequenceNumbers.set(e,t.currentSequenceNumber),An.resolve()},t.prototype.documentSize=function(t){var e,n=this.serializer.toDbRemoteDocument(t);if(n.document)e=n.document;else if(n.unknownDocument)e=n.unknownDocument;else{if(!n.noDocument)throw g("Unknown remote document type");e=n.noDocument}return JSON.stringify(e).length},t.prototype.isPinned=function(t,e,n){var r=this;return An.or([function(){return r.persistence.mutationQueuesContainKey(t,e)},function(){return An.resolve(r.inMemoryPins.containsKey(e))},function(){return r.persistence.getQueryCache().containsKey(t,e)},function(){var t=r.orphanedSequenceNumbers.get(e);return An.resolve(void 0!==t&&t>n)}])},t.prototype.getCacheSize=function(t){return this.persistence.getRemoteDocumentCache().getSize(t)},t}(),Xr=function(){function t(t,e,n,r,i){this.queue=t,this.timerId=e,this.initialDelayMs=n,this.backoffFactor=r,this.maxDelayMs=i,this.timerPromise=null,this.lastAttemptTime=Date.now(),this.reset()}return t.prototype.reset=function(){this.currentBaseMs=0},t.prototype.resetToMax=function(){this.currentBaseMs=this.maxDelayMs},t.prototype.backoffAndRun=function(t){var e=this;this.cancel();var n=Math.floor(this.currentBaseMs+this.jitterDelayMs()),r=Math.max(0,Date.now()-this.lastAttemptTime),i=Math.max(0,n-r);this.currentBaseMs>0&&p("ExponentialBackoff","Backing off for "+i+" ms (base delay: "+this.currentBaseMs+" ms, delay with jitter: "+n+" ms, last attempt: "+r+" ms ago)"),this.timerPromise=this.queue.enqueueAfterDelay(this.timerId,i,function(){return e.lastAttemptTime=Date.now(),t()}),this.currentBaseMs*=this.backoffFactor,this.currentBaseMs<this.initialDelayMs&&(this.currentBaseMs=this.initialDelayMs),this.currentBaseMs>this.maxDelayMs&&(this.currentBaseMs=this.maxDelayMs)},t.prototype.cancel=function(){null!==this.timerPromise&&(this.timerPromise.cancel(),this.timerPromise=null)},t.prototype.jitterDelayMs=function(){return(Math.random()-.5)*this.currentBaseMs},t}(),Yr=function(t){return t[t.Initial=0]="Initial",t[t.Starting=1]="Starting",t[t.Open=2]="Open",t[t.Error=3]="Error",t[t.Backoff=4]="Backoff",t}({}),Jr=1e3,Zr=6e4,$r=1.5,ti=function(){function t(t,e,n,r,i,o){this.queue=t,this.idleTimerId=n,this.connection=r,this.credentialsProvider=i,this.listener=o,this.state=Yr.Initial,this.closeCount=0,this.idleTimer=null,this.stream=null,this.backoff=new Xr(t,e,Jr,$r,Zr)}return t.prototype.isStarted=function(){return this.state===Yr.Starting||this.state===Yr.Open||this.state===Yr.Backoff},t.prototype.isOpen=function(){return this.state===Yr.Open},t.prototype.start=function(){this.state!==Yr.Error?(m(this.state===Yr.Initial,"Already started"),this.auth()):this.performBackoff()},t.prototype.stop=function(){return a.__awaiter(this,void 0,void 0,function(){return a.__generator(this,function(t){switch(t.label){case 0:return this.isStarted()?[4,this.close(Yr.Initial)]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}})})},t.prototype.inhibitBackoff=function(){m(!this.isStarted(),"Can only inhibit backoff in a stopped state"),this.state=Yr.Initial,this.backoff.reset()},t.prototype.markIdle=function(){var t=this;this.isOpen()&&null===this.idleTimer&&(this.idleTimer=this.queue.enqueueAfterDelay(this.idleTimerId,6e4,function(){return t.handleIdleCloseTimer()}))},t.prototype.sendRequest=function(t){this.cancelIdleCheck(),this.stream.send(t)},t.prototype.handleIdleCloseTimer=function(){return a.__awaiter(this,void 0,void 0,function(){return a.__generator(this,function(t){return this.isOpen()?[2,this.close(Yr.Initial)]:[2]})})},t.prototype.cancelIdleCheck=function(){this.idleTimer&&(this.idleTimer.cancel(),this.idleTimer=null)},t.prototype.close=function(t,e){return a.__awaiter(this,void 0,void 0,function(){return a.__generator(this,function(n){switch(n.label){case 0:return m(this.isStarted(),"Only started streams should be closed."),m(t===Yr.Error||Lt(e),"Can't provide an error when not in an error state."),this.cancelIdleCheck(),this.backoff.cancel(),this.closeCount++,t!==Yr.Error?this.backoff.reset():e&&e.code===w.RESOURCE_EXHAUSTED?(d(e.toString()),d("Using maximum backoff delay to prevent overloading the backend."),this.backoff.resetToMax()):e&&e.code===w.UNAUTHENTICATED&&this.credentialsProvider.invalidateToken(),null!==this.stream&&(this.tearDown(),this.stream.close(),this.stream=null),this.state=t,[4,this.listener.onClose(e)];case 1:return n.sent(),[2]}})})},t.prototype.tearDown=function(){},t.prototype.auth=function(){var t=this;m(this.state===Yr.Initial,"Must be in initial state to auth"),this.state=Yr.Starting;var e=this.getCloseGuardedDispatcher(this.closeCount),n=this.closeCount;this.credentialsProvider.getToken().then(function(e){t.closeCount===n&&t.startStream(e)},function(n){e(function(){var e=new _(w.UNKNOWN,"Fetching auth token failed: "+n.message);return t.handleStreamClose(e)})})},t.prototype.startStream=function(t){var e=this;m(this.state===Yr.Starting,"Trying to start stream in a non-starting state");var n=this.getCloseGuardedDispatcher(this.closeCount);this.stream=this.startRpc(t),this.stream.onOpen(function(){n(function(){return m(e.state===Yr.Starting,"Expected stream to be in state Starting, but was "+e.state),e.state=Yr.Open,e.listener.onOpen()})}),this.stream.onClose(function(t){n(function(){return e.handleStreamClose(t)})}),this.stream.onMessage(function(t){n(function(){return e.onMessage(t)})})},t.prototype.performBackoff=function(){var t=this;m(this.state===Yr.Error,"Should only perform backoff when in Error state"),this.state=Yr.Backoff,this.backoff.backoffAndRun(function(){return a.__awaiter(t,void 0,void 0,function(){return a.__generator(this,function(t){return m(this.state===Yr.Backoff,"Backoff elapsed but state is now: "+this.state),this.state=Yr.Initial,this.start(),m(this.isStarted(),"PersistentStream should have started"),[2]})})})},t.prototype.handleStreamClose=function(t){return m(this.isStarted(),"Can't handle server close on non-started stream"),p("PersistentStream","close with error: "+t),this.stream=null,this.close(Yr.Error,t)},t.prototype.getCloseGuardedDispatcher=function(t){var e=this;return function(n){e.queue.enqueueAndForget(function(){return e.closeCount===t?n():(p("PersistentStream","stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve())})}},t}(),ei=function(t){function e(e,n,r,i,o){var a=t.call(this,e,un.ListenStreamConnectionBackoff,un.ListenStreamIdle,n,r,o)||this;return a.serializer=i,a}return a.__extends(e,t),e.prototype.startRpc=function(t){return this.connection.openStream("Listen",t)},e.prototype.onMessage=function(t){this.backoff.reset();var e=this.serializer.fromWatchChange(t),n=this.serializer.versionFromListenResponse(t);return this.listener.onWatchChange(e,n)},e.prototype.watch=function(t){var e={};e.database=this.serializer.encodedDatabaseId,e.addTarget=this.serializer.toTarget(t);var n=this.serializer.toListenRequestLabels(t);n&&(e.labels=n),this.sendRequest(e)},e.prototype.unwatch=function(t){var e={};e.database=this.serializer.encodedDatabaseId,e.removeTarget=t,this.sendRequest(e)},e}(ti),ni=function(t){function e(e,n,r,i,o){var a=t.call(this,e,un.WriteStreamConnectionBackoff,un.WriteStreamIdle,n,r,o)||this;return a.serializer=i,a.handshakeComplete_=!1,a}return a.__extends(e,t),Object.defineProperty(e.prototype,"handshakeComplete",{get:function(){return this.handshakeComplete_},enumerable:!0,configurable:!0}),e.prototype.start=function(){this.handshakeComplete_=!1,t.prototype.start.call(this)},e.prototype.tearDown=function(){this.handshakeComplete_&&this.writeMutations([])},e.prototype.startRpc=function(t){return this.connection.openStream("Write",t)},e.prototype.onMessage=function(t){if(m(!!t.streamToken,"Got a write response without a stream token"),this.lastStreamToken=t.streamToken,this.handshakeComplete_){this.backoff.reset();var e=this.serializer.fromWriteResults(t.writeResults,t.commitTime),n=this.serializer.fromVersion(t.commitTime);return this.listener.onMutationResult(n,e)}return m(!t.writeResults||0===t.writeResults.length,"Got mutation results for handshake"),this.handshakeComplete_=!0,this.listener.onHandshakeComplete()},e.prototype.writeHandshake=function(){m(this.isOpen(),"Writing handshake requires an opened stream"),m(!this.handshakeComplete_,"Handshake already completed");var t={};t.database=this.serializer.encodedDatabaseId,this.sendRequest(t)},e.prototype.writeMutations=function(t){var e=this;m(this.isOpen(),"Writing mutations requires an opened stream"),m(this.handshakeComplete_,"Handshake must be complete before writing mutations"),m(this.lastStreamToken.length>0,"Trying to write mutation without a token");var n={streamToken:this.lastStreamToken,writes:t.map(function(t){return e.serializer.toMutation(t)})};this.sendRequest(n)},e}(ti),ri=function(){function t(t,e,n,r){this.queue=t,this.connection=e,this.credentials=n,this.serializer=r}return t.prototype.newPersistentWriteStream=function(t){return new ni(this.queue,this.connection,this.credentials,this.serializer,t)},t.prototype.newPersistentWatchStream=function(t){return new ei(this.queue,this.connection,this.credentials,this.serializer,t)},t.prototype.commit=function(t){var e=this,n={database:this.serializer.encodedDatabaseId,writes:t.map(function(t){return e.serializer.toMutation(t)})};return this.invokeRPC("Commit",n).then(function(t){return e.serializer.fromWriteResults(t.writeResults,t.commitTime)})},t.prototype.lookup=function(t){var e=this,n={database:this.serializer.encodedDatabaseId,documents:t.map(function(t){return e.serializer.toName(t)})};return this.invokeStreamingRPC("BatchGetDocuments",n).then(function(n){var r=we();n.forEach(function(t){var n=e.serializer.fromMaybeDocument(t);r=r.insert(n.key,n)});var i=[];return t.forEach(function(t){var e=r.get(t);m(!!e,"Missing entity in write response for "+t),i.push(e)}),i})},t.prototype.invokeRPC=function(t,e){var n=this;return this.credentials.getToken().then(function(r){return n.connection.invokeRPC(t,e,r)}).catch(function(t){throw t.code===w.UNAUTHENTICATED&&n.credentials.invalidateToken(),t})},t.prototype.invokeStreamingRPC=function(t,e){var n=this;return this.credentials.getToken().then(function(r){return n.connection.invokeStreamingRPC(t,e,r)}).catch(function(t){throw t.code===w.UNAUTHENTICATED&&n.credentials.invalidateToken(),t})},t}(),ii=function(){function t(t){this.datastore=t,this.readVersions=Te(),this.mutations=[],this.committed=!1}return t.prototype.recordVersion=function(t){var e;if(t instanceof ut)e=t.version;else{if(!(t instanceof ct))throw g("Document in a transaction was a "+t.constructor.name);e=Yt.forDeletedDoc()}var n=this.readVersions.get(t.key);if(null!==n){if(!e.isEqual(n))throw new _(w.ABORTED,"Document version changed between two reads.")}else this.readVersions=this.readVersions.insert(t.key,e)},t.prototype.lookup=function(t){var e=this;return this.committed?Promise.reject("Transaction has already completed."):this.mutations.length>0?Promise.reject("Transactions lookups are invalid after writes."):this.datastore.lookup(t).then(function(t){return t.forEach(function(t){t instanceof ct||t instanceof ut?e.recordVersion(t):g("Document in a transaction was a "+t.constructor.name)}),t})},t.prototype.write=function(t){if(this.committed)throw new _(w.FAILED_PRECONDITION,"Transaction has already completed.");this.mutations=this.mutations.concat(t)},t.prototype.precondition=function(t){var e=this.readVersions.get(t);return e?ie.updateTime(e):ie.NONE},t.prototype.preconditionForUpdate=function(t){var e=this.readVersions.get(t);if(e&&e.isEqual(Yt.forDeletedDoc()))throw new _(w.FAILED_PRECONDITION,"Can't update a document that doesn't exist.");return e?ie.updateTime(e):ie.exists(!0)},t.prototype.set=function(t,e){this.write(e.toMutations(t,this.precondition(t)))},t.prototype.update=function(t,e){this.write(e.toMutations(t,this.preconditionForUpdate(t)))},t.prototype.delete=function(t){this.write([new ce(t,this.precondition(t))]),this.readVersions=this.readVersions.insert(t,Yt.forDeletedDoc())},t.prototype.commit=function(){var t=this,e=this.readVersions;return this.mutations.forEach(function(t){e=e.remove(t.key)}),e.isEmpty()?this.datastore.commit(this.mutations).then(function(){t.committed=!0}):Promise.reject(Error("Every document read in a transaction must also be written."))},t}(),oi=function(t){return t[t.Unknown=0]="Unknown",t[t.Online=1]="Online",t[t.Offline=2]="Offline",t}({}),ai=function(t){return t[t.RemoteStore=0]="RemoteStore",t[t.SharedClientState=1]="SharedClientState",t}({}),si=function(){function t(t,e){this.asyncQueue=t,this.onlineStateHandler=e,this.state=oi.Unknown,this.watchStreamFailures=0,this.onlineStateTimer=null,this.shouldWarnClientIsOffline=!0}return t.prototype.handleWatchStreamStart=function(){var t=this;0===this.watchStreamFailures&&(this.setAndBroadcast(oi.Unknown),m(null===this.onlineStateTimer,"onlineStateTimer shouldn't be started yet"),this.onlineStateTimer=this.asyncQueue.enqueueAfterDelay(un.OnlineStateTimeout,1e4,function(){return t.onlineStateTimer=null,m(t.state===oi.Unknown,"Timer should be canceled if we transitioned to a different state."),t.logClientOfflineWarningIfNecessary("Backend didn't respond within 10 seconds."),t.setAndBroadcast(oi.Offline),Promise.resolve()}))},t.prototype.handleWatchStreamFailure=function(t){this.state===oi.Online?(this.setAndBroadcast(oi.Unknown),m(0===this.watchStreamFailures,"watchStreamFailures must be 0"),m(null===this.onlineStateTimer,"onlineStateTimer must be null")):(this.watchStreamFailures++,this.watchStreamFailures>=1&&(this.clearOnlineStateTimer(),this.logClientOfflineWarningIfNecessary("Connection failed 1 times. Most recent error: "+t.toString()),this.setAndBroadcast(oi.Offline)))},t.prototype.set=function(t){this.clearOnlineStateTimer(),this.watchStreamFailures=0,t===oi.Online&&(this.shouldWarnClientIsOffline=!1),this.setAndBroadcast(t)},t.prototype.setAndBroadcast=function(t){t!==this.state&&(this.state=t,this.onlineStateHandler(t))},t.prototype.logClientOfflineWarningIfNecessary=function(t){var e="Could not reach Cloud Firestore backend. "+t+"\nThis typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.";this.shouldWarnClientIsOffline?(d(e),this.shouldWarnClientIsOffline=!1):p("OnlineStateTracker",e)},t.prototype.clearOnlineStateTimer=function(){null!==this.onlineStateTimer&&(this.onlineStateTimer.cancel(),this.onlineStateTimer=null)},t}(),ui=function(){function t(t,e,n,r){this.localStore=t,this.datastore=e,this.writePipeline=[],this.listenTargets={},this.watchChangeAggregator=null,this.networkEnabled=!1,this.isPrimary=!1,this.onlineStateTracker=new si(n,r),this.watchStream=this.datastore.newPersistentWatchStream({onOpen:this.onWatchStreamOpen.bind(this),onClose:this.onWatchStreamClose.bind(this),onWatchChange:this.onWatchStreamChange.bind(this)}),this.writeStream=this.datastore.newPersistentWriteStream({onOpen:this.onWriteStreamOpen.bind(this),onClose:this.onWriteStreamClose.bind(this),onHandshakeComplete:this.onWriteHandshakeComplete.bind(this),onMutationResult:this.onMutationResult.bind(this)})}return t.prototype.start=function(){return this.enableNetwork()},t.prototype.enableNetwork=function(){return a.__awaiter(this,void 0,void 0,function(){var t;return a.__generator(this,function(e){switch(e.label){case 0:return this.networkEnabled=!0,this.canUseNetwork()?(t=this.writeStream,[4,this.localStore.getLastStreamToken()]):[3,3];case 1:return t.lastStreamToken=e.sent(),this.shouldStartWatchStream()?this.startWatchStream():this.onlineStateTracker.set(oi.Unknown),[4,this.fillWritePipeline()];case 2:e.sent(),e.label=3;case 3:return[2]}})})},t.prototype.disableNetwork=function(){return a.__awaiter(this,void 0,void 0,function(){return a.__generator(this,function(t){switch(t.label){case 0:return this.networkEnabled=!1,[4,this.disableNetworkInternal()];case 1:return t.sent(),this.onlineStateTracker.set(oi.Offline),[2]}})})},t.prototype.disableNetworkInternal=function(){return a.__awaiter(this,void 0,void 0,function(){return a.__generator(this,function(t){switch(t.label){case 0:return[4,this.writeStream.stop()];case 1:return t.sent(),[4,this.watchStream.stop()];case 2:return t.sent(),this.writePipeline.length>0&&(p("RemoteStore","Stopping write stream with "+this.writePipeline.length+" pending writes"),this.writePipeline=[]),this.cleanUpWatchStreamState(),[2]}})})},t.prototype.shutdown=function(){return a.__awaiter(this,void 0,void 0,function(){return a.__generator(this,function(t){switch(t.label){case 0:return p("RemoteStore","RemoteStore shutting down."),this.networkEnabled=!1,[4,this.disableNetworkInternal()];case 1:return t.sent(),this.onlineStateTracker.set(oi.Unknown),[2]}})})},t.prototype.listen=function(t){m(!E(this.listenTargets,t.targetId),"listen called with duplicate targetId!"),this.listenTargets[t.targetId]=t,this.shouldStartWatchStream()?this.startWatchStream():this.watchStream.isOpen()&&this.sendWatchRequest(t)},t.prototype.unlisten=function(t){m(E(this.listenTargets,t),"unlisten called without assigned target ID!"),delete this.listenTargets[t],this.watchStream.isOpen()&&this.sendUnwatchRequest(t),A(this.listenTargets)&&(this.watchStream.isOpen()?this.watchStream.markIdle():this.canUseNetwork()&&this.onlineStateTracker.set(oi.Unknown))},t.prototype.getQueryDataForTarget=function(t){return this.listenTargets[t]||null},t.prototype.getRemoteKeysForTarget=function(t){return this.syncEngine.getRemoteKeysForTarget(t)},t.prototype.sendWatchRequest=function(t){this.watchChangeAggregator.recordPendingTargetRequest(t.targetId),this.watchStream.watch(t)},t.prototype.sendUnwatchRequest=function(t){this.watchChangeAggregator.recordPendingTargetRequest(t),this.watchStream.unwatch(t)},t.prototype.startWatchStream=function(){m(this.shouldStartWatchStream(),"startWatchStream() called when shouldStartWatchStream() is false."),this.watchChangeAggregator=new qe(this),this.watchStream.start(),this.onlineStateTracker.handleWatchStreamStart()},t.prototype.shouldStartWatchStream=function(){return this.canUseNetwork()&&!this.watchStream.isStarted()&&!A(this.listenTargets)},t.prototype.canUseNetwork=function(){return this.isPrimary&&this.networkEnabled},t.prototype.cleanUpWatchStreamState=function(){this.watchChangeAggregator=null},t.prototype.onWatchStreamOpen=function(){return a.__awaiter(this,void 0,void 0,function(){var t=this;return a.__generator(this,function(e){return C(this.listenTargets,function(e,n){t.sendWatchRequest(n)}),[2]})})},t.prototype.onWatchStreamClose=function(t){return a.__awaiter(this,void 0,void 0,function(){return a.__generator(this,function(e){return void 0===t&&m(!this.shouldStartWatchStream(),"Watch stream was stopped gracefully while still needed."),this.cleanUpWatchStreamState(),this.shouldStartWatchStream()?(this.onlineStateTracker.handleWatchStreamFailure(t),this.startWatchStream()):this.onlineStateTracker.set(oi.Unknown),[2]})})},t.prototype.onWatchStreamChange=function(t,e){return a.__awaiter(this,void 0,void 0,function(){var n;return a.__generator(this,function(r){switch(r.label){case 0:return this.onlineStateTracker.set(oi.Online),t instanceof Ve&&t.state===Ue.Removed&&t.cause?[2,this.handleTargetError(t)]:(t instanceof je?this.watchChangeAggregator.handleDocumentChange(t):t instanceof Le?this.watchChangeAggregator.handleExistenceFilter(t):(m(t instanceof Ve,"Expected watchChange to be an instance of WatchTargetChange"),this.watchChangeAggregator.handleTargetChange(t)),e.isEqual(Yt.MIN)?[3,3]:[4,this.localStore.getLastRemoteSnapshotVersion()]);case 1:return n=r.sent(),e.compareTo(n)>=0?[4,this.raiseWatchSnapshot(e)]:[3,3];case 2:r.sent(),r.label=3;case 3:return[2]}})})},t.prototype.raiseWatchSnapshot=function(t){var e=this;m(!t.isEqual(Yt.MIN),"Can't raise event for unknown SnapshotVersion");var n=this.watchChangeAggregator.createRemoteEvent(t);return C(n.targetChanges,function(n,r){if(r.resumeToken.length>0){var i=e.listenTargets[n];i&&(e.listenTargets[n]=i.copy({resumeToken:r.resumeToken,snapshotVersion:t}))}}),n.targetMismatches.forEach(function(t){var n=e.listenTargets[t];if(n){e.listenTargets[t]=n.copy({resumeToken:b()}),e.sendUnwatchRequest(t);var r=new Zt(n.query,t,Jt.ExistenceFilterMismatch,n.sequenceNumber);e.sendWatchRequest(r)}}),this.syncEngine.applyRemoteEvent(n)},t.prototype.handleTargetError=function(t){var e=this;m(!!t.cause,"Handling target error without a cause");var n=t.cause,r=Promise.resolve();return t.targetIds.forEach(function(t){r=r.then(function(){return a.__awaiter(e,void 0,void 0,function(){return a.__generator(this,function(e){return E(this.listenTargets,t)?(delete this.listenTargets[t],this.watchChangeAggregator.removeTarget(t),[2,this.syncEngine.rejectListen(t,n)]):[2]})})})}),r},t.prototype.fillWritePipeline=function(){return a.__awaiter(this,void 0,void 0,function(){var t;return a.__generator(this,function(e){switch(e.label){case 0:return this.canAddToWritePipeline()?[4,this.localStore.nextMutationBatch(this.writePipeline.length>0?this.writePipeline[this.writePipeline.length-1].batchId:_n)]:[3,4];case 1:return null!==(t=e.sent())?[3,2]:(0===this.writePipeline.length&&this.writeStream.markIdle(),[3,4]);case 2:return this.addToWritePipeline(t),[4,this.fillWritePipeline()];case 3:e.sent(),e.label=4;case 4:return this.shouldStartWriteStream()&&this.startWriteStream(),[2]}})})},t.prototype.canAddToWritePipeline=function(){return this.canUseNetwork()&&this.writePipeline.length<10},t.prototype.outstandingWrites=function(){return this.writePipeline.length},t.prototype.addToWritePipeline=function(t){m(this.canAddToWritePipeline(),"addToWritePipeline called when pipeline is full"),this.writePipeline.push(t),this.writeStream.isOpen()&&this.writeStream.handshakeComplete&&this.writeStream.writeMutations(t.mutations)},t.prototype.shouldStartWriteStream=function(){return this.canUseNetwork()&&!this.writeStream.isStarted()&&this.writePipeline.length>0},t.prototype.startWriteStream=function(){m(this.shouldStartWriteStream(),"startWriteStream() called when shouldStartWriteStream() is false."),this.writeStream.start()},t.prototype.onWriteStreamOpen=function(){return a.__awaiter(this,void 0,void 0,function(){return a.__generator(this,function(t){return this.writeStream.writeHandshake(),[2]})})},t.prototype.onWriteHandshakeComplete=function(){var t=this;return this.localStore.setLastStreamToken(this.writeStream.lastStreamToken).then(function(){for(var e=0,n=t.writePipeline;e<n.length;e++)t.writeStream.writeMutations(n[e].mutations)}).catch(function(e){return t.ignoreIfPrimaryLeaseLoss(e)})},t.prototype.ignoreIfPrimaryLeaseLoss=function(t){if(!Pr(t))throw t;p("RemoteStore","Unexpectedly lost primary lease")},t.prototype.onMutationResult=function(t,e){var n=this;m(this.writePipeline.length>0,"Got result for empty write pipeline");var r=this.writePipeline.shift(),i=En.from(r,t,e,this.writeStream.lastStreamToken);return this.syncEngine.applySuccessfulWrite(i).then(function(){return n.fillWritePipeline()})},t.prototype.onWriteStreamClose=function(t){return a.__awaiter(this,void 0,void 0,function(){var e=this;return a.__generator(this,function(n){return void 0===t&&m(!this.shouldStartWriteStream(),"Write stream was stopped gracefully while still needed."),t&&this.writePipeline.length>0?[2,(this.writeStream.handshakeComplete?this.handleWriteError(t):this.handleHandshakeError(t)).then(function(){e.shouldStartWriteStream()&&e.startWriteStream()})]:[2]})})},t.prototype.handleHandshakeError=function(t){return a.__awaiter(this,void 0,void 0,function(){var e=this;return a.__generator(this,function(n){return ge(t.code)||t.code===w.ABORTED?(p("RemoteStore","RemoteStore error before completed handshake; resetting stream token: ",this.writeStream.lastStreamToken),this.writeStream.lastStreamToken=b(),[2,this.localStore.setLastStreamToken(b()).catch(function(t){return e.ignoreIfPrimaryLeaseLoss(t)})]):[2]})})},t.prototype.handleWriteError=function(t){return a.__awaiter(this,void 0,void 0,function(){var e,n=this;return a.__generator(this,function(r){return ge(t.code)?(e=this.writePipeline.shift(),this.writeStream.inhibitBackoff(),[2,this.syncEngine.rejectFailedWrite(e.batchId,t).then(function(){return n.fillWritePipeline()})]):[2]})})},t.prototype.createTransaction=function(){return new ii(this.datastore)},t.prototype.handleCredentialChange=function(){return a.__awaiter(this,void 0,void 0,function(){return a.__generator(this,function(t){switch(t.label){case 0:return this.canUseNetwork()?(p("RemoteStore","RemoteStore restarting streams for new credential"),this.networkEnabled=!1,[4,this.disableNetworkInternal()]):[3,3];case 1:return t.sent(),this.onlineStateTracker.set(oi.Unknown),[4,this.enableNetwork()];case 2:t.sent(),t.label=3;case 3:return[2]}})})},t.prototype.applyPrimaryState=function(t){return a.__awaiter(this,void 0,void 0,function(){return a.__generator(this,function(e){switch(e.label){case 0:return this.isPrimary=t,t&&this.networkEnabled?[4,this.enableNetwork()]:[3,2];case 1:return e.sent(),[3,4];case 2:return t?[3,4]:[4,this.disableNetworkInternal()];case 3:e.sent(),this.onlineStateTracker.set(oi.Unknown),e.label=4;case 4:return[2]}})})},t}(),ci=function(){return function(){this.listeners=[]}}(),li=function(){function t(t){this.syncEngine=t,this.queries=new Un(function(t){return t.canonicalId()}),this.onlineState=oi.Unknown,this.syncEngine.subscribe(this)}return t.prototype.listen=function(t){var e=t.query,n=!1,r=this.queries.get(e);return r||(n=!0,r=new ci,this.queries.set(e,r)),r.listeners.push(t),t.applyOnlineStateChange(this.onlineState),r.viewSnap&&t.onViewSnapshot(r.viewSnap),n?this.syncEngine.listen(e).then(function(t){return r.targetId=t,t}):Promise.resolve(r.targetId)},t.prototype.unlisten=function(t){return a.__awaiter(this,void 0,void 0,function(){var e,n,r,i;return a.__generator(this,function(o){return n=!1,(r=this.queries.get(e=t.query))&&(i=r.listeners.indexOf(t))>=0&&(r.listeners.splice(i,1),n=0===r.listeners.length),n?(this.queries.delete(e),[2,this.syncEngine.unlisten(e)]):[2]})})},t.prototype.onWatchChange=function(t){for(var e=0,n=t;e<n.length;e++){var r=n[e],i=this.queries.get(r.query);if(i){for(var o=0,a=i.listeners;o<a.length;o++)a[o].onViewSnapshot(r);i.viewSnap=r}}},t.prototype.onWatchError=function(t,e){var n=this.queries.get(t);if(n)for(var r=0,i=n.listeners;r<i.length;r++)i[r].onError(e);this.queries.delete(t)},t.prototype.onOnlineStateChange=function(t){this.onlineState=t,this.queries.forEach(function(e,n){for(var r=0,i=n.listeners;r<i.length;r++)i[r].applyOnlineStateChange(t)})},t}(),hi=function(){function t(t,e,n){this.query=t,this.queryObserver=e,this.raisedInitialEvent=!1,this.onlineState=oi.Unknown,this.options=n||{}}return t.prototype.onViewSnapshot=function(t){if(m(t.docChanges.length>0||t.syncStateChanged,"We got a new snapshot with no changes?"),!this.options.includeMetadataChanges){for(var e=[],n=0,r=t.docChanges;n<r.length;n++){var i=r[n];i.type!==ke.Metadata&&e.push(i)}t=new Re(t.query,t.docs,t.oldDocs,e,t.mutatedKeys,t.fromCache,t.syncStateChanged,!0)}this.raisedInitialEvent?this.shouldRaiseEvent(t)&&this.queryObserver.next(t):this.shouldRaiseInitialEvent(t,this.onlineState)&&this.raiseInitialEvent(t),this.snap=t},t.prototype.onError=function(t){this.queryObserver.error(t)},t.prototype.applyOnlineStateChange=function(t){this.onlineState=t,this.snap&&!this.raisedInitialEvent&&this.shouldRaiseInitialEvent(this.snap,t)&&this.raiseInitialEvent(this.snap)},t.prototype.shouldRaiseInitialEvent=function(t,e){return m(!this.raisedInitialEvent,"Determining whether to raise first event but already had first event"),!t.fromCache||(this.options.waitForSyncWhenOnline&&e!==oi.Offline?(m(t.fromCache,"Waiting for sync, but snapshot is not from cache"),!1):!t.docs.isEmpty()||e===oi.Offline)},t.prototype.shouldRaiseEvent=function(t){return t.docChanges.length>0||!!(t.syncStateChanged||this.snap&&this.snap.hasPendingWrites!==t.hasPendingWrites)&&!0===this.options.includeMetadataChanges},t.prototype.raiseInitialEvent=function(t){m(!this.raisedInitialEvent,"Trying to raise initial events for second time"),t=Re.fromInitialDocuments(t.query,t.docs,t.mutatedKeys,t.fromCache),this.raisedInitialEvent=!0,this.queryObserver.next(t)},t}(),fi=function(){function t(t,e,n){this.targetId=t,this.addedKeys=e,this.removedKeys=n}return t.fromSnapshot=function(e,n){for(var r=Ie(),i=Ie(),o=0,a=n.docChanges;o<a.length;o++){var s=a[o];switch(s.type){case ke.Added:r=r.add(s.doc.key);break;case ke.Removed:i=i.add(s.doc.key)}}return new t(e,r,i)},t}(),pi=function(){return function(t){this.key=t}}(),di=function(){return function(t){this.key=t}}(),yi=function(){function t(t,e){this.query=t,this._syncedDocuments=e,this.syncState=null,this.current=!1,this.limboDocuments=Ie(),this.mutatedKeys=Ie(),this.documentSet=new De(t.docComparator.bind(t))}return Object.defineProperty(t.prototype,"syncedDocuments",{get:function(){return this._syncedDocuments},enumerable:!0,configurable:!0}),t.prototype.computeDocChanges=function(t,e){var n=this,r=e?e.changeSet:new Pe,i=e?e.documentSet:this.documentSet,o=e?e.mutatedKeys:this.mutatedKeys,a=i,s=!1,u=this.query.hasLimit()&&i.size===this.query.limit?i.last():null;if(t.inorderTraversal(function(t,e){var c=i.get(t),l=e instanceof ut?e:null;l&&(m(t.isEqual(l.key),"Mismatching keys found in document changes: "+t+" != "+l.key),l=n.query.matches(l)?l:null);var h=!!c&&n.mutatedKeys.has(c.key),f=!!l&&(l.hasLocalMutations||n.mutatedKeys.has(l.key)&&l.hasCommittedMutations),p=!1;c&&l?c.data.isEqual(l.data)?h!==f&&(r.track({type:ke.Metadata,doc:l}),p=!0):n.shouldWaitForSyncedDocument(c,l)||(r.track({type:ke.Modified,doc:l}),p=!0,u&&n.query.docComparator(l,u)>0&&(s=!0)):!c&&l?(r.track({type:ke.Added,doc:l}),p=!0):c&&!l&&(r.track({type:ke.Removed,doc:c}),p=!0,u&&(s=!0)),p&&(l?(a=a.add(l),o=f?o.add(t):o.delete(t)):(a=a.delete(t),o=o.delete(t)))}),this.query.hasLimit())for(;a.size>this.query.limit;){var c=a.last();a=a.delete(c.key),o=o.delete(c.key),r.track({type:ke.Removed,doc:c})}return m(!s||!e,"View was refilled using docs that themselves needed refilling."),{documentSet:a,changeSet:r,needsRefill:s,mutatedKeys:o}},t.prototype.shouldWaitForSyncedDocument=function(t,e){return t.hasLocalMutations&&e.hasCommittedMutations&&!e.hasLocalMutations},t.prototype.applyChanges=function(t,e,n){var r=this;m(!t.needsRefill,"Cannot apply changes that need a refill");var i=this.documentSet;this.documentSet=t.documentSet,this.mutatedKeys=t.mutatedKeys;var o=t.changeSet.getChanges();o.sort(function(t,e){return function(t,e){var n=function(t){switch(t){case ke.Added:return 1;case ke.Modified:case ke.Metadata:return 2;case ke.Removed:return 0;default:return g("Unknown ChangeType: "+t)}};return n(t)-n(e)}(t.type,e.type)||r.query.docComparator(t.doc,e.doc)}),this.applyTargetChange(n);var a=e?this.updateLimboDocuments():[],s=0===this.limboDocuments.size&&this.current?Ne.Synced:Ne.Local,u=s!==this.syncState;return this.syncState=s,0!==o.length||u?{snapshot:new Re(this.query,t.documentSet,i,o,t.mutatedKeys,s===Ne.Local,u,!1),limboChanges:a}:{limboChanges:a}},t.prototype.applyOnlineStateChange=function(t){return this.current&&t===oi.Offline?(this.current=!1,this.applyChanges({documentSet:this.documentSet,changeSet:new Pe,mutatedKeys:this.mutatedKeys,needsRefill:!1},!1)):{limboChanges:[]}},t.prototype.shouldBeInLimbo=function(t){return!this._syncedDocuments.has(t)&&!!this.documentSet.has(t)&&!this.documentSet.get(t).hasLocalMutations},t.prototype.applyTargetChange=function(t){var e=this;t&&(t.addedDocuments.forEach(function(t){return e._syncedDocuments=e._syncedDocuments.add(t)}),t.modifiedDocuments.forEach(function(t){return m(e._syncedDocuments.has(t),"Modified document "+t+" not found in view.")}),t.removedDocuments.forEach(function(t){return e._syncedDocuments=e._syncedDocuments.delete(t)}),this.current=t.current)},t.prototype.updateLimboDocuments=function(){var t=this;if(!this.current)return[];var e=this.limboDocuments;this.limboDocuments=Ie(),this.documentSet.forEach(function(e){t.shouldBeInLimbo(e.key)&&(t.limboDocuments=t.limboDocuments.add(e.key))});var n=[];return e.forEach(function(e){t.limboDocuments.has(e)||n.push(new di(e))}),this.limboDocuments.forEach(function(t){e.has(t)||n.push(new pi(t))}),n},t.prototype.synchronizeWithPersistedState=function(t,e){this._syncedDocuments=e,this.limboDocuments=Ie();var n=this.computeDocChanges(t);return this.applyChanges(n,!0)},t.prototype.computeInitialSnapshot=function(){return Re.fromInitialDocuments(this.query,this.documentSet,this.mutatedKeys,this.syncState===Ne.Local)},t}(),gi=function(){return function(t,e,n){this.query=t,this.targetId=e,this.view=n}}(),mi=function(){return function(t){this.key=t}}(),vi=function(){function t(t,e,n,r){this.localStore=t,this.remoteStore=e,this.sharedClientState=n,this.currentUser=r,this.syncEngineListener=null,this.queryViewsByQuery=new Un(function(t){return t.canonicalId()}),this.queryViewsByTarget={},this.limboTargetsByKey=new ht(at.comparator),this.limboResolutionsByTarget={},this.limboDocumentRefs=new Ur,this.mutationUserCallbacks={},this.limboTargetIdGenerator=In.forSyncEngine(),this.isPrimary=void 0,this.onlineState=oi.Unknown}return Object.defineProperty(t.prototype,"isPrimaryClient",{get:function(){return!0===this.isPrimary},enumerable:!0,configurable:!0}),t.prototype.subscribe=function(t){m(null!==t,"SyncEngine listener cannot be null"),m(null===this.syncEngineListener,"SyncEngine already has a subscriber."),this.syncEngineListener=t},t.prototype.listen=function(t){return a.__awaiter(this,void 0,void 0,function(){var e,n,r,i,o;return a.__generator(this,function(a){switch(a.label){case 0:return this.assertSubscribed("listen()"),(r=this.queryViewsByQuery.get(t))?(this.sharedClientState.addLocalQueryTarget(e=r.targetId),n=r.view.computeInitialSnapshot(),[3,4]):[3,1];case 1:return[4,this.localStore.allocateQuery(t)];case 2:return i=a.sent(),o=this.sharedClientState.addLocalQueryTarget(i.targetId),e=i.targetId,[4,this.initializeViewAndComputeSnapshot(i,"current"===o)];case 3:n=a.sent(),this.isPrimary&&this.remoteStore.listen(i),a.label=4;case 4:return this.syncEngineListener.onWatchChange([n]),[2,e]}})})},t.prototype.initializeViewAndComputeSnapshot=function(t,e){var n=this,r=t.query;return this.localStore.executeQuery(r).then(function(i){return n.localStore.remoteDocumentKeys(t.targetId).then(function(o){var a=new yi(r,o),s=a.computeDocChanges(i),u=Me.createSynthesizedTargetChangeForCurrentChange(t.targetId,e&&n.onlineState!==oi.Offline),c=a.applyChanges(s,!0===n.isPrimary,u);m(0===c.limboChanges.length,"View returned limbo docs before target ack from the server."),m(!!c.snapshot,"applyChanges for new view should always return a snapshot");var l=new gi(r,t.targetId,a);return n.queryViewsByQuery.set(r,l),n.queryViewsByTarget[t.targetId]=l,c.snapshot})})},t.prototype.synchronizeViewAndComputeSnapshot=function(t){var e=this;return this.localStore.executeQuery(t.query).then(function(n){return e.localStore.remoteDocumentKeys(t.targetId).then(function(r){return a.__awaiter(e,void 0,void 0,function(){var e;return a.__generator(this,function(i){return e=t.view.synchronizeWithPersistedState(n,r),this.isPrimary&&this.updateTrackedLimbos(t.targetId,e.limboChanges),[2,e]})})})})},t.prototype.unlisten=function(t){return a.__awaiter(this,void 0,void 0,function(){var e,n=this;return a.__generator(this,function(r){switch(r.label){case 0:return this.assertSubscribed("unlisten()"),m(!!(e=this.queryViewsByQuery.get(t)),"Trying to unlisten on query not found:"+t),this.isPrimary?(this.sharedClientState.removeLocalQueryTarget(e.targetId),this.sharedClientState.isActiveQueryTarget(e.targetId)?[3,2]:[4,this.localStore.releaseQuery(t,!1).then(function(){n.sharedClientState.clearQueryState(e.targetId),n.remoteStore.unlisten(e.targetId),n.removeAndCleanupQuery(e)}).catch(function(t){return n.ignoreIfPrimaryLeaseLoss(t)})]):[3,3];case 1:r.sent(),r.label=2;case 2:return[3,5];case 3:return this.removeAndCleanupQuery(e),[4,this.localStore.releaseQuery(t,!0)];case 4:r.sent(),r.label=5;case 5:return[2]}})})},t.prototype.write=function(t,e){var n=this;return this.assertSubscribed("write()"),this.localStore.localWrite(t).then(function(t){return n.sharedClientState.addPendingMutation(t.batchId),n.addMutationCallback(t.batchId,e),n.emitNewSnapsAndNotifyLocalStore(t.changes)}).then(function(){return n.remoteStore.fillWritePipeline()})},t.prototype.wrapUpdateFunctionError=function(t){return t},t.prototype.runTransaction=function(t,e){var n=this;void 0===e&&(e=5),m(e>=0,"Got negative number of retries for transaction.");var r=this.remoteStore.createTransaction();return function(){try{var e=t(r);return!Lt(e)&&e.catch&&e.then?e.catch(function(t){return Promise.reject(n.wrapUpdateFunctionError(t))}):Promise.reject(Error("Transaction callback must return a Promise"))}catch(i){return Promise.reject(n.wrapUpdateFunctionError(i))}}().then(function(i){return r.commit().then(function(){return i}).catch(function(r){return 0===e?Promise.reject(r):n.runTransaction(t,e-1)})})},t.prototype.applyRemoteEvent=function(t){var e=this;return this.assertSubscribed("applyRemoteEvent()"),this.localStore.applyRemoteEvent(t).then(function(n){return I(t.targetChanges,function(t,n){var r=e.limboResolutionsByTarget[t];r&&(m(n.addedDocuments.size+n.modifiedDocuments.size+n.removedDocuments.size<=1,"Limbo resolution for single document contains multiple changes."),n.addedDocuments.size>0?r.receivedDocument=!0:n.modifiedDocuments.size>0?m(r.receivedDocument,"Received change for limbo target document without add."):n.removedDocuments.size>0&&(m(r.receivedDocument,"Received remove for limbo target document without add."),r.receivedDocument=!1))}),e.emitNewSnapsAndNotifyLocalStore(n,t)}).catch(function(t){return e.ignoreIfPrimaryLeaseLoss(t)})},t.prototype.applyOnlineStateChange=function(t,e){if(this.isPrimary&&e===ai.RemoteStore||!this.isPrimary&&e===ai.SharedClientState){var n=[];this.queryViewsByQuery.forEach(function(e,r){var i=r.view.applyOnlineStateChange(t);m(0===i.limboChanges.length,"OnlineState should not affect limbo documents."),i.snapshot&&n.push(i.snapshot)}),this.syncEngineListener.onOnlineStateChange(t),this.syncEngineListener.onWatchChange(n),this.onlineState=t,this.isPrimary&&this.sharedClientState.setOnlineState(t)}},t.prototype.rejectListen=function(t,e){return a.__awaiter(this,void 0,void 0,function(){var n,r,i,o,s,u,c=this;return a.__generator(this,function(a){switch(a.label){case 0:return this.assertSubscribed("rejectListens()"),this.sharedClientState.updateQueryState(t,"rejected",e),(r=(n=this.limboResolutionsByTarget[t])&&n.key)?(this.limboTargetsByKey=this.limboTargetsByKey.remove(r),delete this.limboResolutionsByTarget[t],i=(i=new ht(at.comparator)).insert(r,new ct(r,Yt.forDeletedDoc())),o=Ie().add(r),s=new xe(Yt.MIN,{},new $t(W),i,o),[2,this.applyRemoteEvent(s)]):[3,1];case 1:return m(!!(u=this.queryViewsByTarget[t]),"Unknown targetId: "+t),[4,this.localStore.releaseQuery(u.query,!1).then(function(){return c.removeAndCleanupQuery(u)}).catch(function(t){return c.ignoreIfPrimaryLeaseLoss(t)})];case 2:a.sent(),this.syncEngineListener.onWatchError(u.query,e),a.label=3;case 3:return[2]}})})},t.prototype.applyBatchState=function(t,e,n){return a.__awaiter(this,void 0,void 0,function(){var r;return a.__generator(this,function(i){switch(i.label){case 0:return this.assertSubscribed("applyBatchState()"),[4,this.localStore.lookupMutationDocuments(t)];case 1:return null===(r=i.sent())?(p("SyncEngine","Cannot apply mutation batch with id: "+t),[2]):"pending"!==e?[3,3]:[4,this.remoteStore.fillWritePipeline()];case 2:return i.sent(),[3,4];case 3:"acknowledged"===e||"rejected"===e?(this.processUserCallback(t,n||null),this.localStore.removeCachedMutationBatchMetadata(t)):g("Unknown batchState: "+e),i.label=4;case 4:return[4,this.emitNewSnapsAndNotifyLocalStore(r)];case 5:return i.sent(),[2]}})})},t.prototype.applySuccessfulWrite=function(t){var e=this;this.assertSubscribed("applySuccessfulWrite()");var n=t.batch.batchId;return this.processUserCallback(n,null),this.localStore.acknowledgeBatch(t).then(function(t){return e.sharedClientState.updateMutationState(n,"acknowledged"),e.emitNewSnapsAndNotifyLocalStore(t)}).catch(function(t){return e.ignoreIfPrimaryLeaseLoss(t)})},t.prototype.rejectFailedWrite=function(t,e){var n=this;return this.assertSubscribed("rejectFailedWrite()"),this.processUserCallback(t,e),this.localStore.rejectBatch(t).then(function(r){return n.sharedClientState.updateMutationState(t,"rejected",e),n.emitNewSnapsAndNotifyLocalStore(r)}).catch(function(t){return n.ignoreIfPrimaryLeaseLoss(t)})},t.prototype.addMutationCallback=function(t,e){var n=this.mutationUserCallbacks[this.currentUser.toKey()];n||(n=new ht(W)),n=n.insert(t,e),this.mutationUserCallbacks[this.currentUser.toKey()]=n},t.prototype.processUserCallback=function(t,e){var n=this.mutationUserCallbacks[this.currentUser.toKey()];if(n){var r=n.get(t);r&&(m(t===n.minKey(),"Mutation callbacks processed out-of-order?"),e?r.reject(e):r.resolve(),n=n.remove(t)),this.mutationUserCallbacks[this.currentUser.toKey()]=n}},t.prototype.removeAndCleanupQuery=function(t){var e=this;if(this.sharedClientState.removeLocalQueryTarget(t.targetId),this.queryViewsByQuery.delete(t.query),delete this.queryViewsByTarget[t.targetId],this.isPrimary){var n=this.limboDocumentRefs.referencesForId(t.targetId);this.limboDocumentRefs.removeReferencesForId(t.targetId),n.forEach(function(t){e.limboDocumentRefs.containsKey(t)||e.removeLimboTarget(t)})}},t.prototype.removeLimboTarget=function(t){var e=this.limboTargetsByKey.get(t);null!==e&&(this.remoteStore.unlisten(e),this.limboTargetsByKey=this.limboTargetsByKey.remove(t),delete this.limboResolutionsByTarget[e])},t.prototype.updateTrackedLimbos=function(t,e){for(var n=0,r=e;n<r.length;n++){var i=r[n];i instanceof pi?(this.limboDocumentRefs.addReference(i.key,t),this.trackLimboChange(i)):i instanceof di?(p("SyncEngine","Document no longer in limbo: "+i.key),this.limboDocumentRefs.removeReference(i.key,t),this.limboDocumentRefs.containsKey(i.key)||this.removeLimboTarget(i.key)):g("Unknown limbo change: "+JSON.stringify(i))}},t.prototype.trackLimboChange=function(t){var e=t.key;if(!this.limboTargetsByKey.get(e)){p("SyncEngine","New document in limbo: "+e);var n=this.limboTargetIdGenerator.next(),r=Vt.atPath(e.path);this.limboResolutionsByTarget[n]=new mi(e),this.remoteStore.listen(new Zt(r,n,Jt.LimboResolution,cn.INVALID)),this.limboTargetsByKey=this.limboTargetsByKey.insert(e,n)}},t.prototype.currentLimboDocs=function(){return this.limboTargetsByKey},t.prototype.emitNewSnapsAndNotifyLocalStore=function(t,e){return a.__awaiter(this,void 0,void 0,function(){var n,r,i,o=this;return a.__generator(this,function(a){switch(a.label){case 0:return n=[],r=[],i=[],this.queryViewsByQuery.forEach(function(a,s){i.push(Promise.resolve().then(function(){var e=s.view.computeDocChanges(t);return e.needsRefill?o.localStore.executeQuery(s.query).then(function(t){return s.view.computeDocChanges(t,e)}):e}).then(function(t){var i=s.view.applyChanges(t,!0===o.isPrimary,e&&e.targetChanges[s.targetId]);if(o.updateTrackedLimbos(s.targetId,i.limboChanges),i.snapshot){o.isPrimary&&o.sharedClientState.updateQueryState(s.targetId,i.snapshot.fromCache?"not-current":"current"),n.push(i.snapshot);var a=fi.fromSnapshot(s.targetId,i.snapshot);r.push(a)}}))}),[4,Promise.all(i)];case 1:return a.sent(),this.syncEngineListener.onWatchChange(n),[4,this.localStore.notifyLocalViewChanges(r)];case 2:return a.sent(),[2]}})})},t.prototype.ignoreIfPrimaryLeaseLoss=function(t){return a.__awaiter(this,void 0,void 0,function(){return a.__generator(this,function(e){if(!Pr(t))throw t;return p("SyncEngine","Unexpectedly lost primary lease"),[2]})})},t.prototype.assertSubscribed=function(t){m(null!==this.syncEngineListener,"Trying to call "+t+" before calling subscribe().")},t.prototype.handleCredentialChange=function(t){return a.__awaiter(this,void 0,void 0,function(){var e,n;return a.__generator(this,function(r){switch(r.label){case 0:return e=!this.currentUser.isEqual(t),this.currentUser=t,e?[4,this.localStore.handleUserChange(t)]:[3,3];case 1:return n=r.sent(),this.sharedClientState.handleUserChange(t,n.removedBatchIds,n.addedBatchIds),[4,this.emitNewSnapsAndNotifyLocalStore(n.affectedDocuments)];case 2:r.sent(),r.label=3;case 3:return[4,this.remoteStore.handleCredentialChange()];case 4:return r.sent(),[2]}})})},t.prototype.applyPrimaryState=function(t){return a.__awaiter(this,void 0,void 0,function(){var e,n,r,i,o,s,u=this;return a.__generator(this,function(a){switch(a.label){case 0:return!0!==t||!0===this.isPrimary?[3,3]:(this.isPrimary=!0,[4,this.remoteStore.applyPrimaryState(!0)]);case 1:return a.sent(),e=this.sharedClientState.getAllActiveQueryTargets(),[4,this.synchronizeQueryViewsAndRaiseSnapshots(e.toArray())];case 2:for(n=a.sent(),r=0,i=n;r<i.length;r++)this.remoteStore.listen(i[r]);return[3,7];case 3:return!1!==t||!1===this.isPrimary?[3,7]:(this.isPrimary=!1,o=[],s=Promise.resolve(),C(this.queryViewsByTarget,function(t,e){u.sharedClientState.isLocalQueryTarget(t)?o.push(t):s=s.then(function(){return u.unlisten(e.query)}),u.remoteStore.unlisten(e.targetId)}),[4,s]);case 4:return a.sent(),[4,this.synchronizeQueryViewsAndRaiseSnapshots(o)];case 5:return a.sent(),this.resetLimboDocuments(),[4,this.remoteStore.applyPrimaryState(!1)];case 6:a.sent(),a.label=7;case 7:return[2]}})})},t.prototype.resetLimboDocuments=function(){var t=this;C(this.limboResolutionsByTarget,function(e){t.remoteStore.unlisten(e)}),this.limboDocumentRefs.removeAllReferences(),this.limboResolutionsByTarget=[],this.limboTargetsByKey=new ht(at.comparator)},t.prototype.synchronizeQueryViewsAndRaiseSnapshots=function(t){for(var e=this,n=Promise.resolve(),r=[],i=[],o=function(t){n=n.then(function(){return a.__awaiter(e,void 0,void 0,function(){var e,n,o,s;return a.__generator(this,function(a){switch(a.label){case 0:return(n=this.queryViewsByTarget[t])?[4,this.localStore.releaseQuery(n.query,!0)]:[3,4];case 1:return a.sent(),[4,this.localStore.allocateQuery(n.query)];case 2:return e=a.sent(),[4,this.synchronizeViewAndComputeSnapshot(n)];case 3:return(o=a.sent()).snapshot&&i.push(o.snapshot),[3,8];case 4:return m(!0===this.isPrimary,"A secondary tab should never have an active query without an active view."),[4,this.localStore.getQueryForTarget(t)];case 5:return m(!!(s=a.sent()),"Query data for target "+t+" not found"),[4,this.localStore.allocateQuery(s)];case 6:return e=a.sent(),[4,this.initializeViewAndComputeSnapshot(e,!1)];case 7:a.sent(),a.label=8;case 8:return r.push(e),[2]}})})})},s=0,u=t;s<u.length;s++)o(u[s]);return n.then(function(){return e.syncEngineListener.onWatchChange(i),r})},t.prototype.getActiveClients=function(){return this.localStore.getActiveClients()},t.prototype.applyTargetState=function(t,e,n){return a.__awaiter(this,void 0,void 0,function(){var r,i=this;return a.__generator(this,function(o){switch(o.label){case 0:if(this.isPrimary)return p("SyncEngine","Ignoring unexpected query state notification."),[2];if(!this.queryViewsByTarget[t])return[3,5];switch(e){case"current":case"not-current":return[3,1];case"rejected":return[3,2]}return[3,4];case 1:return[2,this.localStore.getNewDocumentChanges().then(function(n){return a.__awaiter(i,void 0,void 0,function(){var r;return a.__generator(this,function(i){switch(i.label){case 0:return r=xe.createSynthesizedRemoteEventForCurrentChange(t,"current"===e),[4,this.emitNewSnapsAndNotifyLocalStore(n,r)];case 1:return i.sent(),[2]}})})},function(t){return a.__awaiter(i,void 0,void 0,function(){var e;return a.__generator(this,function(n){switch(n.label){case 0:return function(t){return t.code===w.DATA_LOSS&&t.message===Fn}(t)?(e=[],C(this.queryViewsByTarget,function(t){return e.push(t)}),[4,this.synchronizeQueryViewsAndRaiseSnapshots(e)]):[3,2];case 1:return n.sent(),[3,3];case 2:throw t;case 3:return[2]}})})})];case 2:return this.removeAndCleanupQuery(r=this.queryViewsByTarget[t]),[4,this.localStore.releaseQuery(r.query,!0)];case 3:return o.sent(),this.syncEngineListener.onWatchError(r.query,n),[3,5];case 4:g("Unexpected target state: "+e),o.label=5;case 5:return[2]}})})},t.prototype.applyActiveTargetsChange=function(t,e){return a.__awaiter(this,void 0,void 0,function(){var n,r,i,o,s,u,c,l,h,f=this;return a.__generator(this,function(p){switch(p.label){case 0:if(!this.isPrimary)return[2];n=0,r=t,p.label=1;case 1:return n<r.length?(m(!this.queryViewsByTarget[h=r[n]],"Trying to add an already active target"),[4,this.localStore.getQueryForTarget(h)]):[3,6];case 2:return m(!!(i=p.sent()),"Query data for active target "+h+" not found"),[4,this.localStore.allocateQuery(i)];case 3:return o=p.sent(),[4,this.initializeViewAndComputeSnapshot(o,!1)];case 4:p.sent(),this.remoteStore.listen(o),p.label=5;case 5:return n++,[3,1];case 6:s=function(t){var e;return a.__generator(this,function(n){switch(n.label){case 0:return(e=u.queryViewsByTarget[t])?[4,u.localStore.releaseQuery(e.query,!1).then(function(){f.remoteStore.unlisten(t),f.removeAndCleanupQuery(e)}).catch(function(t){return f.ignoreIfPrimaryLeaseLoss(t)})]:[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}})},u=this,c=0,l=e,p.label=7;case 7:return c<l.length?[5,s(h=l[c])]:[3,10];case 8:p.sent(),p.label=9;case 9:return c++,[3,7];case 10:return[2]}})})},t.prototype.enableNetwork=function(){return this.localStore.setNetworkEnabled(!0),this.remoteStore.enableNetwork()},t.prototype.disableNetwork=function(){return this.localStore.setNetworkEnabled(!1),this.remoteStore.disableNetwork()},t.prototype.getRemoteKeysForTarget=function(t){var e=this.limboResolutionsByTarget[t];return e&&e.receivedDocument?Ie().add(e.key):this.queryViewsByTarget[t]?this.queryViewsByTarget[t].view.syncedDocuments:Ie()},t}(),bi=function(){function t(t){this.uid=t}return t.prototype.isAuthenticated=function(){return null!=this.uid},t.prototype.toKey=function(){return this.isAuthenticated()?"uid:"+this.uid:"anonymous-user"},t.prototype.isEqual=function(t){return t.uid===this.uid},t.UNAUTHENTICATED=new t(null),t.GOOGLE_CREDENTIALS=new t("google-credentials-uid"),t.FIRST_PARTY=new t("first-party-uid"),t}(),wi="SharedClientState",_i="firestore_clients",Si="firestore_mutations",Ei="firestore_targets",Ti="firestore_online_state",Ci="firestore_sequence_number",Ii=function(){function t(t,e,n,r){this.user=t,this.batchId=e,this.state=n,this.error=r,m(void 0!==r==("rejected"===n),"MutationMetadata must contain an error iff state is 'rejected'")}return t.fromWebStorageEntry=function(e,n,r){var i=JSON.parse(r),o="object"==typeof i&&-1!==["pending","acknowledged","rejected"].indexOf(i.state)&&(void 0===i.error||"object"==typeof i.error),a=void 0;return o&&i.error&&(o="string"==typeof i.error.message&&"string"==typeof i.error.code)&&(a=new _(i.error.code,i.error.message)),o?new t(e,n,i.state,a):(d(wi,"Failed to parse mutation state for ID '"+n+"': "+r),null)},t.prototype.toWebStorageJSON=function(){var t={state:this.state,updateTimeMs:Date.now()};return this.error&&(t.error={code:this.error.code,message:this.error.message}),JSON.stringify(t)},t}(),Ai=function(){function t(t,e,n){this.targetId=t,this.state=e,this.error=n,m(void 0!==n==("rejected"===e),"QueryTargetMetadata must contain an error iff state is 'rejected'")}return t.fromWebStorageEntry=function(e,n){var r=JSON.parse(n),i="object"==typeof r&&-1!==["not-current","current","rejected"].indexOf(r.state)&&(void 0===r.error||"object"==typeof r.error),o=void 0;return i&&r.error&&(i="string"==typeof r.error.message&&"string"==typeof r.error.code)&&(o=new _(r.error.code,r.error.message)),i?new t(e,r.state,o):(d(wi,"Failed to parse target state for ID '"+e+"': "+n),null)},t.prototype.toWebStorageJSON=function(){var t={state:this.state,updateTimeMs:Date.now()};return this.error&&(t.error={code:this.error.code,message:this.error.message}),JSON.stringify(t)},t}(),Oi=function(){function t(t,e){this.clientId=t,this.activeTargetIds=e}return t.fromWebStorageEntry=function(e,n){for(var r=JSON.parse(n),i="object"==typeof r&&r.activeTargetIds instanceof Array,o=Oe(),a=0;i&&a<r.activeTargetIds.length;++a)i=Ut(r.activeTargetIds[a]),o=o.add(r.activeTargetIds[a]);return i?new t(e,o):(d(wi,"Failed to parse client data for instance '"+e+"': "+n),null)},t}(),Di=function(){function t(t,e){this.clientId=t,this.onlineState=e}return t.fromWebStorageEntry=function(e){var n=JSON.parse(e);return"object"==typeof n&&void 0!==oi[n.onlineState]&&"string"==typeof n.clientId?new t(n.clientId,oi[n.onlineState]):(d(wi,"Failed to parse online state: "+e),null)},t}(),ki=function(){function t(){this.activeTargetIds=Oe()}return t.prototype.addQueryTarget=function(t){m(!this.activeTargetIds.has(t),"Target with ID '"+t+"' already active."),this.activeTargetIds=this.activeTargetIds.add(t)},t.prototype.removeQueryTarget=function(t){this.activeTargetIds=this.activeTargetIds.delete(t)},t.prototype.toWebStorageJSON=function(){var t={activeTargetIds:this.activeTargetIds.toArray(),updateTimeMs:Date.now()};return JSON.stringify(t)},t}(),Ni=function(){function t(e,n,r,i,o){if(this.queue=e,this.platform=n,this.persistenceKey=r,this.localClientId=i,this.syncEngine=null,this.onlineStateHandler=null,this.sequenceNumberHandler=null,this.activeClients={},this.storageListener=this.handleWebStorageEvent.bind(this),this.started=!1,this.earlyEvents=[],!t.isAvailable(this.platform))throw new _(w.UNIMPLEMENTED,"LocalStorage is not available on this platform.");var a=r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");this.storage=this.platform.window.localStorage,this.currentUser=o,this.localClientStorageKey=this.toWebStorageClientStateKey(this.localClientId),this.sequenceNumberKey=Ci+"_"+r,this.activeClients[this.localClientId]=new ki,this.clientStateKeyRe=new RegExp("^"+_i+"_"+a+"_([^_]*)$"),this.mutationBatchKeyRe=new RegExp("^"+Si+"_"+a+"_(\\d+)(?:_(.*))?$"),this.queryTargetKeyRe=new RegExp("^"+Ei+"_"+a+"_(\\d+)$"),this.onlineStateKey=Ti+"_"+r,this.platform.window.addEventListener("storage",this.storageListener)}return t.isAvailable=function(t){return!(!t.window||null==t.window.localStorage)},t.prototype.start=function(){return a.__awaiter(this,void 0,void 0,function(){var t,e,n,r,i,o,s,u,c,l,h=this;return a.__generator(this,function(a){switch(a.label){case 0:return m(!this.started,"WebStorageSharedClientState already started"),m(null!==this.syncEngine,"syncEngine property must be set before calling start()"),m(null!==this.onlineStateHandler,"onlineStateHandler property must be set before calling start()"),[4,this.syncEngine.getActiveClients()];case 1:for(t=a.sent(),e=0,n=t;e<n.length;e++)(r=n[e])!==this.localClientId&&(i=this.getItem(this.toWebStorageClientStateKey(r)))&&(o=Oi.fromWebStorageEntry(r,i))&&(this.activeClients[o.clientId]=o);for(this.persistClientState(),(s=this.storage.getItem(this.onlineStateKey))&&(u=this.fromWebStorageOnlineState(s))&&this.handleOnlineStateEvent(u),c=0,l=this.earlyEvents;c<l.length;c++)this.handleWebStorageEvent(l[c]);return this.earlyEvents=[],this.platform.window.addEventListener("unload",function(){return h.shutdown()}),this.started=!0,[2]}})})},t.prototype.writeSequenceNumber=function(t){this.setItem(this.sequenceNumberKey,JSON.stringify(t))},t.prototype.getAllActiveQueryTargets=function(){var t=Oe();return I(this.activeClients,function(e,n){t=t.unionWith(n.activeTargetIds)}),t},t.prototype.isActiveQueryTarget=function(t){for(var e in this.activeClients)if(this.activeClients.hasOwnProperty(e)&&this.activeClients[e].activeTargetIds.has(t))return!0;return!1},t.prototype.addPendingMutation=function(t){this.persistMutationState(t,"pending")},t.prototype.updateMutationState=function(t,e,n){this.persistMutationState(t,e,n),this.removeMutationState(t)},t.prototype.addLocalQueryTarget=function(t){var e="not-current";if(this.isActiveQueryTarget(t)){var n=this.storage.getItem(this.toWebStorageQueryTargetMetadataKey(t));if(n){var r=Ai.fromWebStorageEntry(t,n);r&&(e=r.state)}}return this.localClientState.addQueryTarget(t),this.persistClientState(),e},t.prototype.removeLocalQueryTarget=function(t){this.localClientState.removeQueryTarget(t),this.persistClientState()},t.prototype.isLocalQueryTarget=function(t){return this.localClientState.activeTargetIds.has(t)},t.prototype.clearQueryState=function(t){this.removeItem(this.toWebStorageQueryTargetMetadataKey(t))},t.prototype.updateQueryState=function(t,e,n){this.persistQueryTargetState(t,e,n)},t.prototype.handleUserChange=function(t,e,n){var r=this;e.forEach(function(t){r.removeMutationState(t)}),this.currentUser=t,n.forEach(function(t){r.addPendingMutation(t)})},t.prototype.setOnlineState=function(t){this.persistOnlineState(t)},t.prototype.shutdown=function(){this.started&&(this.platform.window.removeEventListener("storage",this.storageListener),this.removeItem(this.localClientStorageKey),this.started=!1)},t.prototype.getItem=function(t){var e=this.storage.getItem(t);return p(wi,"READ",t,e),e},t.prototype.setItem=function(t,e){p(wi,"SET",t,e),this.storage.setItem(t,e)},t.prototype.removeItem=function(t){p(wi,"REMOVE",t),this.storage.removeItem(t)},t.prototype.handleWebStorageEvent=function(t){var e=this;if(t.storageArea===this.storage){if(p(wi,"EVENT",t.key,t.newValue),t.key===this.localClientStorageKey)return void d("Received WebStorage notification for local change. Another client might have garbage-collected our state");this.queue.enqueueAndForget(function(){return a.__awaiter(e,void 0,void 0,function(){var e,n,r,i,o,s;return a.__generator(this,function(a){if(!this.started)return this.earlyEvents.push(t),[2];if(null===t.key)return[2];if(this.clientStateKeyRe.test(t.key)){if(null==t.newValue)return n=this.fromWebStorageClientStateKey(t.key),[2,this.handleClientStateEvent(n,null)];if(e=this.fromWebStorageClientState(t.key,t.newValue))return[2,this.handleClientStateEvent(e.clientId,e)]}else if(this.mutationBatchKeyRe.test(t.key)){if(null!==t.newValue&&(r=this.fromWebStorageMutationMetadata(t.key,t.newValue)))return[2,this.handleMutationBatchEvent(r)]}else if(this.queryTargetKeyRe.test(t.key)){if(null!==t.newValue&&(i=this.fromWebStorageQueryTargetMetadata(t.key,t.newValue)))return[2,this.handleQueryTargetEvent(i)]}else if(t.key===this.onlineStateKey){if(null!==t.newValue&&(o=this.fromWebStorageOnlineState(t.newValue)))return[2,this.handleOnlineStateEvent(o)]}else t.key===this.sequenceNumberKey&&(m(!!this.sequenceNumberHandler,"Missing sequenceNumberHandler"),(s=function(t){var e=cn.INVALID;if(null!=t)try{var n=JSON.parse(t);m("number"==typeof n,"Found non-numeric sequence number"),e=n}catch(r){d(wi,"Failed to read sequence number from WebStorage",r)}return e}(t.newValue))!==cn.INVALID&&this.sequenceNumberHandler(s));return[2]})})})}},Object.defineProperty(t.prototype,"localClientState",{get:function(){return this.activeClients[this.localClientId]},enumerable:!0,configurable:!0}),t.prototype.persistClientState=function(){this.setItem(this.localClientStorageKey,this.localClientState.toWebStorageJSON())},t.prototype.persistMutationState=function(t,e,n){var r=new Ii(this.currentUser,t,e,n),i=this.toWebStorageMutationBatchKey(t);this.setItem(i,r.toWebStorageJSON())},t.prototype.removeMutationState=function(t){var e=this.toWebStorageMutationBatchKey(t);this.removeItem(e)},t.prototype.persistOnlineState=function(t){this.storage.setItem(this.onlineStateKey,JSON.stringify({clientId:this.localClientId,onlineState:oi[t]}))},t.prototype.persistQueryTargetState=function(t,e,n){var r=this.toWebStorageQueryTargetMetadataKey(t),i=new Ai(t,e,n);this.setItem(r,i.toWebStorageJSON())},t.prototype.toWebStorageClientStateKey=function(t){return m(-1===t.indexOf("_"),"Client key cannot contain '_', but was '"+t+"'"),_i+"_"+this.persistenceKey+"_"+t},t.prototype.toWebStorageQueryTargetMetadataKey=function(t){return Ei+"_"+this.persistenceKey+"_"+t},t.prototype.toWebStorageMutationBatchKey=function(t){var e=Si+"_"+this.persistenceKey+"_"+t;return this.currentUser.isAuthenticated()&&(e+="_"+this.currentUser.uid),e},t.prototype.fromWebStorageClientStateKey=function(t){var e=this.clientStateKeyRe.exec(t);return e?e[1]:null},t.prototype.fromWebStorageClientState=function(t,e){var n=this.fromWebStorageClientStateKey(t);return m(null!==n,"Cannot parse client state key '"+t+"'"),Oi.fromWebStorageEntry(n,e)},t.prototype.fromWebStorageMutationMetadata=function(t,e){var n=this.mutationBatchKeyRe.exec(t);m(null!==n,"Cannot parse mutation batch key '"+t+"'");var r=Number(n[1]);return Ii.fromWebStorageEntry(new bi(void 0!==n[2]?n[2]:null),r,e)},t.prototype.fromWebStorageQueryTargetMetadata=function(t,e){var n=this.queryTargetKeyRe.exec(t);m(null!==n,"Cannot parse query target key '"+t+"'");var r=Number(n[1]);return Ai.fromWebStorageEntry(r,e)},t.prototype.fromWebStorageOnlineState=function(t){return Di.fromWebStorageEntry(t)},t.prototype.handleMutationBatchEvent=function(t){return a.__awaiter(this,void 0,void 0,function(){return a.__generator(this,function(e){return t.user.uid!==this.currentUser.uid?(p(wi,"Ignoring mutation for non-active user "+t.user.uid),[2]):[2,this.syncEngine.applyBatchState(t.batchId,t.state,t.error)]})})},t.prototype.handleQueryTargetEvent=function(t){return this.syncEngine.applyTargetState(t.targetId,t.state,t.error)},t.prototype.handleClientStateEvent=function(t,e){var n=this,r=this.getAllActiveQueryTargets();e?this.activeClients[t]=e:delete this.activeClients[t];var i=this.getAllActiveQueryTargets(),o=[],s=[];return i.forEach(function(t){return a.__awaiter(n,void 0,void 0,function(){return a.__generator(this,function(e){return r.has(t)||o.push(t),[2]})})}),r.forEach(function(t){return a.__awaiter(n,void 0,void 0,function(){return a.__generator(this,function(e){return i.has(t)||s.push(t),[2]})})}),this.syncEngine.applyActiveTargetsChange(o,s)},t.prototype.handleOnlineStateEvent=function(t){this.activeClients[t.clientId]&&this.onlineStateHandler(t.onlineState)},t}(),Pi=function(){function t(){this.localState=new ki,this.queryState={},this.syncEngine=null,this.onlineStateHandler=null,this.sequenceNumberHandler=null}return t.prototype.addPendingMutation=function(t){},t.prototype.updateMutationState=function(t,e,n){},t.prototype.addLocalQueryTarget=function(t){return this.localState.addQueryTarget(t),this.queryState[t]||"not-current"},t.prototype.updateQueryState=function(t,e,n){this.queryState[t]=e},t.prototype.removeLocalQueryTarget=function(t){this.localState.removeQueryTarget(t)},t.prototype.isLocalQueryTarget=function(t){return this.localState.activeTargetIds.has(t)},t.prototype.clearQueryState=function(t){delete this.queryState[t]},t.prototype.getAllActiveQueryTargets=function(){return this.localState.activeTargetIds},t.prototype.isActiveQueryTarget=function(t){return this.localState.activeTargetIds.has(t)},t.prototype.start=function(){return this.localState=new ki,Promise.resolve()},t.prototype.handleUserChange=function(t,e,n){},t.prototype.setOnlineState=function(t){},t.prototype.shutdown=function(){},t.prototype.writeSequenceNumber=function(t){},t}(),Ri=function(){function t(t,e){this.cacheSizeBytes=t,this.experimentalTabSynchronization=e}return t.prototype.lruParams=function(){return Er.withCacheSize(this.cacheSizeBytes)},t}(),xi=function(){return function(){}}(),Mi=function(){function t(t,e,n,r){this.platform=t,this.databaseInfo=e,this.credentials=n,this.asyncQueue=r,this.clientId=z.newId()}return t.prototype.start=function(t){var e=this,n=new ln,r=new ln,i=!1;return this.credentials.setChangeListener(function(o){i?e.asyncQueue.enqueueAndForget(function(){return e.handleCredentialChange(o)}):(i=!0,e.initializePersistence(t,r,o).then(function(t){return e.initializeRest(o,t)}).then(n.resolve,n.reject))}),this.asyncQueue.enqueueAndForget(function(){return n.promise}),r.promise},t.prototype.enableNetwork=function(){var t=this;return this.asyncQueue.enqueue(function(){return t.syncEngine.enableNetwork()})},t.prototype.initializePersistence=function(t,e,n){var r=this;return t instanceof Ri?this.startIndexedDbPersistence(n,t).then(function(t){return e.resolve(),t}).catch(function(t){if(e.reject(t),!r.canFallback(t))throw t;return console.warn("Error enabling offline storage. Falling back to storage disabled: "+t),r.startMemoryPersistence()}):(e.resolve(),this.startMemoryPersistence())},t.prototype.canFallback=function(t){return t instanceof _?t.code===w.FAILED_PRECONDITION||t.code===w.UNIMPLEMENTED:!("undefined"!=typeof DOMException&&t instanceof DOMException)||22===t.code||20===t.code},t.prototype.startIndexedDbPersistence=function(t,e){var n=this,r=Nr.buildStoragePrefix(this.databaseInfo),i=new Je(this.databaseInfo.databaseId,{useProto3Json:!0});return Promise.resolve().then(function(){return a.__awaiter(n,void 0,void 0,function(){var n,o;return a.__generator(this,function(a){switch(a.label){case 0:if(e.experimentalTabSynchronization&&!Ni.isAvailable(this.platform))throw new _(w.UNIMPLEMENTED,"IndexedDB persistence is only available on platforms that support LocalStorage.");return o=e.lruParams(),e.experimentalTabSynchronization?(this.sharedClientState=new Ni(this.asyncQueue,this.platform,r,this.clientId,t),[4,Nr.createMultiClientIndexedDbPersistence(r,this.clientId,this.platform,this.asyncQueue,i,o,{sequenceNumberSyncer:this.sharedClientState})]):[3,2];case 1:return n=a.sent(),[3,4];case 2:return this.sharedClientState=new Pi,[4,Nr.createIndexedDbPersistence(r,this.clientId,this.platform,this.asyncQueue,i,o)];case 3:n=a.sent(),a.label=4;case 4:return this.persistence=n,[2,n.referenceDelegate.garbageCollector]}})})})},t.prototype.startMemoryPersistence=function(){return this.persistence=Wr.createEagerPersistence(this.clientId),this.sharedClientState=new Pi,Promise.resolve(null)},t.prototype.initializeRest=function(t,e){var n=this;return p("FirestoreClient","Initializing. user=",t.uid),this.platform.loadConnection(this.databaseInfo).then(function(r){return a.__awaiter(n,void 0,void 0,function(){var n,i,o,s=this;return a.__generator(this,function(a){switch(a.label){case 0:return this.localStore=new Fr(this.persistence,t),e&&(this.lruScheduler=new Tr(e,this.asyncQueue,this.localStore),this.lruScheduler.start()),n=this.platform.newSerializer(this.databaseInfo.databaseId),i=new ri(this.asyncQueue,r,this.credentials,n),o=function(t){return s.syncEngine.applyOnlineStateChange(t,ai.SharedClientState)},this.remoteStore=new ui(this.localStore,i,this.asyncQueue,function(t){return s.syncEngine.applyOnlineStateChange(t,ai.RemoteStore)}),this.syncEngine=new vi(this.localStore,this.remoteStore,this.sharedClientState,t),this.sharedClientState.onlineStateHandler=o,this.remoteStore.syncEngine=this.syncEngine,this.sharedClientState.syncEngine=this.syncEngine,this.eventMgr=new li(this.syncEngine),[4,this.sharedClientState.start()];case 1:return a.sent(),[4,this.remoteStore.start()];case 2:return a.sent(),[4,this.persistence.setPrimaryStateListener(function(t){return s.syncEngine.applyPrimaryState(t)})];case 3:return a.sent(),[2]}})})})},t.prototype.handleCredentialChange=function(t){return this.asyncQueue.verifyOperationInProgress(),p("FirestoreClient","Credential Changed. Current user: "+t.uid),this.syncEngine.handleCredentialChange(t)},t.prototype.disableNetwork=function(){var t=this;return this.asyncQueue.enqueue(function(){return t.syncEngine.disableNetwork()})},t.prototype.shutdown=function(t){var e=this;return this.asyncQueue.enqueue(function(){return a.__awaiter(e,void 0,void 0,function(){return a.__generator(this,function(e){switch(e.label){case 0:return this.lruScheduler&&this.lruScheduler.stop(),[4,this.remoteStore.shutdown()];case 1:return e.sent(),[4,this.sharedClientState.shutdown()];case 2:return e.sent(),[4,this.persistence.shutdown(t&&t.purgePersistenceWithDataLoss)];case 3:return e.sent(),this.credentials.removeChangeListener(),[2]}})})})},t.prototype.listen=function(t,e,n){var r=this,i=new hi(t,e,n);return this.asyncQueue.enqueueAndForget(function(){return r.eventMgr.listen(i)}),i},t.prototype.unlisten=function(t){var e=this;this.asyncQueue.enqueueAndForget(function(){return e.eventMgr.unlisten(t)})},t.prototype.getDocumentFromLocalCache=function(t){var e=this;return this.asyncQueue.enqueue(function(){return e.localStore.readDocument(t)}).then(function(t){if(t instanceof ut)return t;if(t instanceof ct)return null;throw new _(w.UNAVAILABLE,"Failed to get document from cache. (However, this document may exist on the server. Run again without setting 'source' in the GetOptions to attempt to retrieve the document from the server.)")})},t.prototype.getDocumentsFromLocalCache=function(t){var e=this;return this.asyncQueue.enqueue(function(){return e.localStore.executeQuery(t)}).then(function(e){var n=Ie(),r=new yi(t,n),i=r.computeDocChanges(e);return r.applyChanges(i,!1).snapshot})},t.prototype.write=function(t){var e=this,n=new ln;return this.asyncQueue.enqueueAndForget(function(){return e.syncEngine.write(t,n)}),n.promise},t.prototype.databaseId=function(){return this.databaseInfo.databaseId},t.prototype.transaction=function(t){var e=this;return this.asyncQueue.enqueue(function(){return a.__awaiter(e,void 0,void 0,function(){return a.__generator(this,function(t){return[2]})})}).then(function(){return e.syncEngine.runTransaction(t)})},t}(),ji=function(){function t(t){this.observer=t,this.muted=!1}return t.prototype.next=function(t){this.scheduleEvent(this.observer.next,t)},t.prototype.error=function(t){this.scheduleEvent(this.observer.error,t)},t.prototype.mute=function(){this.muted=!0},t.prototype.scheduleEvent=function(t,e){var n=this;this.muted||setTimeout(function(){n.muted||t(e)},0)},t}(),Li=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];!function(e,n,r,i){if(!(t instanceof Array)||t.length<1)throw new _(w.INVALID_ARGUMENT,"Function FieldPath() requires its fieldNames argument to be an array with at least "+H(1,"element")+".")}();for(var n=0;n<t.length;++n)if(N("FieldPath","string",n,t[n]),0===t[n].length)throw new _(w.INVALID_ARGUMENT,"Invalid field name at argument $(i + 1). Field names must not be empty.");this._internalPath=new ot(t)}return t.documentId=function(){return t._DOCUMENT_ID},t.prototype.isEqual=function(e){if(!(e instanceof t))throw q("isEqual","FieldPath",1,e);return this._internalPath.isEqual(e._internalPath)},t._DOCUMENT_ID=new t(ot.keyField().canonicalString()),t}(),Ui=new RegExp("[~\\*/\\[\\]]"),Vi=function(){return function(t,e){this.user=e,this.type="OAuth",this.authHeaders={Authorization:"Bearer "+t}}}(),Fi=function(){function t(){this.changeListener=null}return t.prototype.getToken=function(){return Promise.resolve(null)},t.prototype.invalidateToken=function(){},t.prototype.setChangeListener=function(t){m(!this.changeListener,"Can only call setChangeListener() once."),this.changeListener=t,t(bi.UNAUTHENTICATED)},t.prototype.removeChangeListener=function(){m(null!==this.changeListener,"removeChangeListener() when no listener registered"),this.changeListener=null},t}(),qi=function(){function t(t){var e=this;this.app=t,this.tokenListener=null,this.tokenCounter=0,this.changeListener=null,this.forceRefresh=!1,this.tokenListener=function(){e.tokenCounter++,e.currentUser=e.getUser(),e.changeListener&&e.changeListener(e.currentUser)},this.tokenCounter=0,this.app.INTERNAL.addAuthTokenListener(this.tokenListener)}return t.prototype.getToken=function(){var t=this;m(null!=this.tokenListener,"getToken cannot be called after listener removed.");var e=this.tokenCounter,n=this.forceRefresh;return this.forceRefresh=!1,this.app.INTERNAL.getToken(n).then(function(n){if(t.tokenCounter!==e)throw new _(w.ABORTED,"getToken aborted due to token change.");return n?(m("string"==typeof n.accessToken,"Invalid tokenData returned from getToken():"+n),new Vi(n.accessToken,t.currentUser)):null})},t.prototype.invalidateToken=function(){this.forceRefresh=!0},t.prototype.setChangeListener=function(t){m(!this.changeListener,"Can only call setChangeListener() once."),this.changeListener=t,this.currentUser&&t(this.currentUser)},t.prototype.removeChangeListener=function(){m(null!=this.tokenListener,"removeChangeListener() called twice"),m(null!==this.changeListener,"removeChangeListener() called when no listener registered"),this.app.INTERNAL.removeAuthTokenListener(this.tokenListener),this.tokenListener=null,this.changeListener=null},t.prototype.getUser=function(){var t=this.app.INTERNAL.getUid();return m(null===t||"string"==typeof t,"Received invalid UID: "+t),new bi(t)},t}(),Bi=function(){function t(t,e){this.gapi=t,this.sessionIndex=e,this.type="FirstParty",this.user=bi.FIRST_PARTY,m(this.gapi&&this.gapi.auth&&this.gapi.auth.getAuthHeaderValueForFirstParty,"unexpected gapi interface")}return Object.defineProperty(t.prototype,"authHeaders",{get:function(){return{Authorization:this.gapi.auth.getAuthHeaderValueForFirstParty([]),"X-Goog-AuthUser":this.sessionIndex}},enumerable:!0,configurable:!0}),t}(),Hi=function(){function t(t,e){this.gapi=t,this.sessionIndex=e,m(this.gapi&&this.gapi.auth&&this.gapi.auth.getAuthHeaderValueForFirstParty,"unexpected gapi interface")}return t.prototype.getToken=function(){return Promise.resolve(new Bi(this.gapi,this.sessionIndex))},t.prototype.setChangeListener=function(t){t(bi.FIRST_PARTY)},t.prototype.removeChangeListener=function(){},t.prototype.invalidateToken=function(){},t}();function zi(t){return function(t,e){if("object"!=typeof t||null===t)return!1;for(var n=t,r=0,i=["next","error","complete"];r<i.length;r++){var o=i[r];if(o in n&&"function"==typeof n[o])return!0}return!1}(t)}var Wi=function(){function t(t){this._methodName=t}return t.delete=function(){return Ki.instance},t.serverTimestamp=function(){return Gi.instance},t.arrayUnion=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return D("FieldValue.arrayUnion",arguments,1),new Qi(t)},t.arrayRemove=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return D("FieldValue.arrayRemove",arguments,1),new Xi(t)},t.prototype.isEqual=function(t){return this===t},t}(),Ki=function(t){function e(){return t.call(this,"FieldValue.delete")||this}return a.__extends(e,t),e.instance=new e,e}(Wi),Gi=function(t){function e(){return t.call(this,"FieldValue.serverTimestamp")||this}return a.__extends(e,t),e.instance=new e,e}(Wi),Qi=function(t){function e(e){var n=t.call(this,"FieldValue.arrayUnion")||this;return n._elements=e,n}return a.__extends(e,t),e}(Wi),Xi=function(t){function e(e){var n=t.call(this,"FieldValue.arrayRemove")||this;return n._elements=e,n}return a.__extends(e,t),e}(Wi),Yi=S(Wi,"Use FieldValue.<field>() instead."),Ji=/^__.*__$/,Zi=function(){function t(t,e,n){this.data=t,this.fieldMask=e,this.fieldTransforms=n}return t.prototype.toMutations=function(t,e){var n=[];return n.push(null!==this.fieldMask?new se(t,this.data,this.fieldMask,e):new ae(t,this.data,e)),this.fieldTransforms.length>0&&n.push(new ue(t,this.fieldTransforms)),n},t}(),$i=function(){function t(t,e,n){this.data=t,this.fieldMask=e,this.fieldTransforms=n}return t.prototype.toMutations=function(t,e){var n=[new se(t,this.data,this.fieldMask,e)];return this.fieldTransforms.length>0&&n.push(new ue(t,this.fieldTransforms)),n},t}(),to=function(t){return t[t.Set=0]="Set",t[t.Update=1]="Update",t[t.MergeSet=2]="MergeSet",t[t.Argument=3]="Argument",t}({});function eo(t){switch(t){case to.Set:case to.MergeSet:case to.Update:return!0;case to.Argument:return!1;default:throw g("Unexpected case for UserDataSource: "+t)}}var no=function(){function t(t,e,n,r,i,o){this.dataSource=t,this.methodName=e,this.path=n,this.arrayElement=r,void 0===i&&this.validatePath(),this.arrayElement=void 0!==r&&r,this.fieldTransforms=i||[],this.fieldMask=o||[]}return t.prototype.childContextForField=function(e){var n=null==this.path?null:this.path.child(e),r=new t(this.dataSource,this.methodName,n,!1,this.fieldTransforms,this.fieldMask);return r.validatePathSegment(e),r},t.prototype.childContextForFieldPath=function(e){var n=null==this.path?null:this.path.child(e),r=new t(this.dataSource,this.methodName,n,!1,this.fieldTransforms,this.fieldMask);return r.validatePath(),r},t.prototype.childContextForArray=function(e){return new t(this.dataSource,this.methodName,null,!0,this.fieldTransforms,this.fieldMask)},t.prototype.createError=function(t){var e=null===this.path||this.path.isEmpty()?"":" (found in field "+this.path.toString()+")";return new _(w.INVALID_ARGUMENT,"Function "+this.methodName+"() called with invalid data. "+t+e)},t.prototype.contains=function(t){return void 0!==this.fieldMask.find(function(e){return t.isPrefixOf(e)})||void 0!==this.fieldTransforms.find(function(e){return t.isPrefixOf(e.field)})},t.prototype.validatePath=function(){if(null!==this.path)for(var t=0;t<this.path.length;t++)this.validatePathSegment(this.path.get(t))},t.prototype.validatePathSegment=function(t){if(eo(this.dataSource)&&Ji.test(t))throw this.createError("Document fields cannot begin and end with __")},t}(),ro=function(){return function(t,e){this.databaseId=t,this.key=e}}(),io=function(){function t(t){this.preConverter=t}return t.prototype.parseSetData=function(t,e){var n=new no(to.Set,t,ot.EMPTY_PATH);ao("Data must be an object, but it was:",n,e);var r=this.parseData(e,n);return new Zi(r,null,n.fieldTransforms)},t.prototype.parseMergeData=function(t,e,n){var r=new no(to.MergeSet,t,ot.EMPTY_PATH);ao("Data must be an object, but it was:",r,e);var i,o,a=this.parseData(e,r);if(n){for(var s=[],u=0,c=n;u<c.length;u++){var l=c[u],h=void 0;if(l instanceof Li)h=l._internalPath;else{if("string"!=typeof l)throw g("Expected stringOrFieldPath to be a string or a FieldPath");h=uo(t,l)}if(!r.contains(h))throw new _(w.INVALID_ARGUMENT,"Field '"+h+"' is specified in your field mask but missing from your input data.");s.push(h)}i=te.fromArray(s),o=r.fieldTransforms.filter(function(t){return i.covers(t.field)})}else i=te.fromArray(r.fieldMask),o=r.fieldTransforms;return new Zi(a,i,o)},t.prototype.parseUpdateData=function(t,e){var n=this,r=new no(to.Update,t,ot.EMPTY_PATH);ao("Data must be an object, but it was:",r,e);var i=[],o=Nt.EMPTY;I(e,function(e,a){var s=uo(t,e),u=r.childContextForFieldPath(s);if((a=n.runPreConverter(a,u))instanceof Ki)i.push(s);else{var c=n.parseData(a,u);null!=c&&(i.push(s),o=o.set(s,c))}});var a=te.fromArray(i);return new $i(o,a,r.fieldTransforms)},t.prototype.parseUpdateVarargs=function(t,e,n,r){var i=new no(to.Update,t,ot.EMPTY_PATH),o=[so(t,e)],a=[n];if(r.length%2!=0)throw new _(w.INVALID_ARGUMENT,"Function "+t+"() needs to be called with an even number of arguments that alternate between field names and values.");for(var s=0;s<r.length;s+=2)o.push(so(t,r[s])),a.push(r[s+1]);var u=[],c=Nt.EMPTY;for(s=0;s<o.length;++s){var l=o[s],h=i.childContextForFieldPath(l),f=this.runPreConverter(a[s],h);if(f instanceof Ki)u.push(l);else{var p=this.parseData(f,h);null!=p&&(u.push(l),c=c.set(l,p))}}var d=te.fromArray(u);return new $i(c,d,i.fieldTransforms)},t.prototype.parseQueryValue=function(t,e){var n=new no(to.Argument,t,ot.EMPTY_PATH),r=this.parseData(e,n);return m(null!=r,"Parsed data should not be null."),m(0===n.fieldTransforms.length,"Field transforms should have been disallowed."),r},t.prototype.runPreConverter=function(t,e){try{return this.preConverter(t)}catch(r){var n=co(r);throw e.createError(n)}},t.prototype.parseData=function(t,e){if(oo(t=this.runPreConverter(t,e)))return ao("Unsupported field value:",e,t),this.parseObject(t,e);if(t instanceof Wi)return this.parseSentinelFieldValue(t,e),null;if(e.path&&e.fieldMask.push(e.path),t instanceof Array){if(e.arrayElement)throw e.createError("Nested arrays are not supported");return this.parseArray(t,e)}return this.parseScalarValue(t,e)},t.prototype.parseObject=function(t,e){var n=this,r=new ht(W);return A(t)?e.path&&e.path.length>0&&e.fieldMask.push(e.path):I(t,function(t,i){var o=n.parseData(i,e.childContextForField(t));null!=o&&(r=r.insert(t,o))}),new Nt(r)},t.prototype.parseArray=function(t,e){for(var n=[],r=0,i=0,o=t;i<o.length;i++){var a=this.parseData(o[i],e.childContextForArray(r));null==a&&(a=bt.INSTANCE),n.push(a),r++}return new Pt(n)},t.prototype.parseSentinelFieldValue=function(t,e){if(!eo(e.dataSource))throw e.createError(t._methodName+"() can only be used with update() and set()");if(null===e.path)throw e.createError(t._methodName+"() is not currently supported inside arrays");if(t instanceof Ki){if(e.dataSource!==to.MergeSet)throw e.dataSource===to.Update?(m(e.path.length>0,"FieldValue.delete() at the top level should have already been handled."),e.createError("FieldValue.delete() can only appear at the top level of your update data")):e.createError("FieldValue.delete() cannot be used with set() unless you pass {merge:true}");e.fieldMask.push(e.path)}else if(t instanceof Gi)e.fieldTransforms.push(new ee(e.path,le.instance));else if(t instanceof Qi){var n=this.parseArrayTransformElements(t._methodName,t._elements),r=new he(n);e.fieldTransforms.push(new ee(e.path,r))}else if(t instanceof Xi){n=this.parseArrayTransformElements(t._methodName,t._elements);var i=new fe(n);e.fieldTransforms.push(new ee(e.path,i))}else g("Unknown FieldValue type: "+t)},t.prototype.parseScalarValue=function(t,e){if(null===t)return bt.INSTANCE;if("number"==typeof t)return Ut(t)?new Et(t):new Tt(t);if("boolean"==typeof t)return wt.of(t);if("string"==typeof t)return new Ct(t);if(t instanceof Date)return new It(Z.fromDate(t));if(t instanceof Z)return new It(new Z(t.seconds,1e3*Math.floor(t.nanoseconds/1e3)));if(t instanceof J)return new kt(t);if(t instanceof X)return new Ot(t);if(t instanceof ro)return new Dt(t.databaseId,t.key);throw e.createError("Unsupported field value: "+U(t))},t.prototype.parseArrayTransformElements=function(t,e){var n=this;return e.map(function(e,r){var i=new no(to.Argument,t,ot.EMPTY_PATH);return n.parseData(e,i.childContextForArray(r))})},t}();function oo(t){return!("object"!=typeof t||null===t||t instanceof Array||t instanceof Date||t instanceof Z||t instanceof J||t instanceof X||t instanceof ro||t instanceof Wi)}function ao(t,e,n){if(!oo(n)||!L(n)){var r=U(n);throw e.createError("an object"===r?t+" a custom object":t+" "+r)}}function so(t,e){if(e instanceof Li)return e._internalPath;if("string"==typeof e)return uo(t,e);throw new _(w.INVALID_ARGUMENT,"Function "+t+"() called with invalid data. Field path arguments must be of type string or FieldPath.")}function uo(t,e){try{return function(t){if(t.search(Ui)>=0)throw new _(w.INVALID_ARGUMENT,"Invalid field path ("+t+"). Paths must not contain '~', '*', '/', '[', or ']'");try{return new(Li.bind.apply(Li,[void 0].concat(t.split("."))))}catch(e){throw new _(w.INVALID_ARGUMENT,"Invalid field path ("+t+"). Paths must not be empty, begin with '.', end with '.', or contain '..'")}}(e)._internalPath}catch(r){var n=co(r);throw new _(w.INVALID_ARGUMENT,"Function "+t+"() called with invalid data. "+n)}}function co(t){return t instanceof Error?t.message:t.toString()}var lo="firestore.googleapis.com",ho=!0,fo=!1,po=Er.COLLECTION_DISABLED,yo=function(){function t(t){if(void 0===t.host){if(void 0!==t.ssl)throw new _(w.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host=lo,this.ssl=ho}else R("settings","non-empty string","host",t.host),this.host=t.host,x("settings","boolean","ssl",t.ssl),this.ssl=T(t.ssl,ho);if(F("settings",t,["host","ssl","credentials","timestampsInSnapshots","cacheSizeBytes"]),x("settings","object","credentials",t.credentials),this.credentials=t.credentials,x("settings","boolean","timestampsInSnapshots",t.timestampsInSnapshots),this.timestampsInSnapshots=T(t.timestampsInSnapshots,fo),x("settings","number","cacheSizeBytes",t.cacheSizeBytes),void 0===t.cacheSizeBytes)this.cacheSizeBytes=Er.DEFAULT_CACHE_SIZE_BYTES;else{if(t.cacheSizeBytes!==po&&t.cacheSizeBytes<Er.MINIMUM_CACHE_SIZE_BYTES)throw new _(w.INVALID_ARGUMENT,"cacheSizeBytes must be at least "+Er.MINIMUM_CACHE_SIZE_BYTES);this.cacheSizeBytes=t.cacheSizeBytes}}return t.prototype.isEqual=function(t){return this.host===t.host&&this.ssl===t.ssl&&this.timestampsInSnapshots===t.timestampsInSnapshots&&this.credentials===t.credentials&&this.cacheSizeBytes===t.cacheSizeBytes},t}(),go=function(){return function(){}}(),mo=function(){function t(e){var n=this;this._queue=new fn,this.INTERNAL={delete:function(t){return a.__awaiter(n,void 0,void 0,function(){return a.__generator(this,function(e){return this._firestoreClient?[2,this._firestoreClient.shutdown(t)]:[2]})})}};var r=new go;if("object"==typeof e.options){var i=e;r.firebaseApp=i,r.databaseId=t.databaseIdFromApp(i),r.persistenceKey=r.firebaseApp.name,r.credentials=new qi(i)}else{var o=e;if(!o.projectId)throw new _(w.INVALID_ARGUMENT,"Must provide projectId");r.databaseId=new et(o.projectId,o.database),r.persistenceKey="[DEFAULT]",r.credentials=new Fi}r.settings=new yo({}),this._config=r,this._databaseId=r.databaseId}return t.prototype.settings=function(t){if(O("Firestore.settings",arguments,1),N("Firestore.settings","object",1,t),E(t,"persistence"))throw new _(w.INVALID_ARGUMENT,'"persistence" is now specified with a separate call to firestore.enablePersistence().');var e=new yo(t);if(this._firestoreClient&&!this._config.settings.isEqual(e))throw new _(w.FAILED_PRECONDITION,"Firestore has already been started and its settings can no longer be changed. You can only call settings() before calling any other methods on a Firestore object.");this._config.settings=e,void 0!==e.credentials&&(this._config.credentials=function(t){if(!t)return new Fi;switch(t.type){case"gapi":return new Hi(t.client,t.sessionIndex||"0");case"provider":return t.client;default:throw new _(w.INVALID_ARGUMENT,"makeCredentialsProvider failed due to invalid credential type")}}(e.credentials))},t.prototype.enableNetwork=function(){return this.ensureClientConfigured(),this._firestoreClient.enableNetwork()},t.prototype.disableNetwork=function(){return this.ensureClientConfigured(),this._firestoreClient.disableNetwork()},t.prototype.enablePersistence=function(t){if(this._firestoreClient)throw new _(w.FAILED_PRECONDITION,"Firestore has already been started and persistence can no longer be enabled. You can only call enablePersistence() before calling any other methods on a Firestore object.");return this.configureClient(new Ri(this._config.settings.cacheSizeBytes,void 0!==t&&T(t.experimentalTabSynchronization,!1)))},t.prototype.ensureClientConfigured=function(){return this._firestoreClient||this.configureClient(new xi),this._firestoreClient},t.prototype.configureClient=function(t){var e=this;m(!!this._config.settings.host,"FirestoreSettings.host cannot be falsey"),this._config.settings.timestampsInSnapshots||d("\nThe behavior for Date objects stored in Firestore is going to change\nAND YOUR APP MAY BREAK.\nTo hide this warning and ensure your app does not break, you need to add the\nfollowing code to your app before calling any other Cloud Firestore methods:\n\n const firestore = firebase.firestore();\n const settings = {/* your settings... */ timestampsInSnapshots: true};\n firestore.settings(settings);\n\nWith this change, timestamps stored in Cloud Firestore will be read back as\nFirebase Timestamp objects instead of as system Date objects. So you will also\nneed to update code expecting a Date to instead expect a Timestamp. For example:\n\n // Old:\n const date = snapshot.get('created_at');\n // New:\n const timestamp = snapshot.get('created_at');\n const date = timestamp.toDate();\n\nPlease audit all existing usages of Date when you enable the new behavior. In a\nfuture release, the behavior will change to the new behavior, so if you do not\nfollow these steps, YOUR APP MAY BREAK."),m(!this._firestoreClient,"configureClient() called multiple times");var n=new $(this._config.databaseId,this._config.persistenceKey,this._config.settings.host,this._config.settings.ssl);return this._dataConverter=new io(function(t){if(t instanceof wo){var n=e._config.databaseId,r=t.firestore._config.databaseId;if(!r.isEqual(n))throw new _(w.INVALID_ARGUMENT,"Document reference is for database "+r.projectId+"/"+r.database+" but should be for database "+n.projectId+"/"+n.database);return new ro(e._config.databaseId,t._key)}return t}),this._firestoreClient=new Mi(v.getPlatform(),n,this._config.credentials,this._queue),this._firestoreClient.start(t)},t.databaseIdFromApp=function(t){var e=t.options;if(!E(e,"projectId"))throw new _(w.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');var n=e.projectId;if(!n||"string"!=typeof n)throw new _(w.INVALID_ARGUMENT,"projectId must be a string in FirebaseApp.options");return new et(n)},Object.defineProperty(t.prototype,"app",{get:function(){if(!this._config.firebaseApp)throw new _(w.FAILED_PRECONDITION,"Firestore was not initialized using the Firebase SDK. 'app' is not available");return this._config.firebaseApp},enumerable:!0,configurable:!0}),t.prototype.collection=function(t){if(O("Firestore.collection",arguments,1),N("Firestore.collection","non-empty string",1,t),!t)throw new _(w.INVALID_ARGUMENT,"Must provide a non-empty collection path to collection()");return this.ensureClientConfigured(),new Io(rt.fromString(t),this)},t.prototype.doc=function(t){if(O("Firestore.doc",arguments,1),N("Firestore.doc","non-empty string",1,t),!t)throw new _(w.INVALID_ARGUMENT,"Must provide a non-empty document path to doc()");return this.ensureClientConfigured(),wo.forPath(rt.fromString(t),this)},t.prototype.runTransaction=function(t){var e=this;return O("Firestore.runTransaction",arguments,1),N("Firestore.runTransaction","function",1,t),this.ensureClientConfigured().transaction(function(n){return t(new vo(e,n))})},t.prototype.batch=function(){return this.ensureClientConfigured(),new bo(this)},Object.defineProperty(t,"logLevel",{get:function(){switch(h()){case l.DEBUG:return"debug";case l.ERROR:return"error";case l.SILENT:return"silent";default:return g("Unknown log level: "+h())}},enumerable:!0,configurable:!0}),t.setLogLevel=function(t){switch(O("Firestore.setLogLevel",arguments,1),N("Firestore.setLogLevel","non-empty string",1,t),t){case"debug":f(l.DEBUG);break;case"error":f(l.ERROR);break;case"silent":f(l.SILENT);break;default:throw new _(w.INVALID_ARGUMENT,"Invalid log level: "+t)}},t.prototype._areTimestampsInSnapshotsEnabled=function(){return this._config.settings.timestampsInSnapshots},t}(),vo=function(){function t(t,e){this._firestore=t,this._transaction=e}return t.prototype.get=function(t){var e=this;O("Transaction.get",arguments,1);var n=ko("Transaction.get",t,this._firestore);return this._transaction.lookup([n._key]).then(function(t){if(!t||1!==t.length)return g("Mismatch in docs returned from document lookup.");var r=t[0];if(r instanceof ct)return new So(e._firestore,n._key,null,!1,!1);if(r instanceof ut)return new So(e._firestore,n._key,r,!1,!1);throw g("BatchGetDocumentsRequest returned unexpected document type: "+r.constructor.name)})},t.prototype.set=function(t,e,n){k("Transaction.set",arguments,2,3);var r=ko("Transaction.set",t,this._firestore),i=(n=Ao("Transaction.set",n)).merge||n.mergeFields?this._firestore._dataConverter.parseMergeData("Transaction.set",e,n.mergeFields):this._firestore._dataConverter.parseSetData("Transaction.set",e);return this._transaction.set(r._key,i),this},t.prototype.update=function(t,e,n){for(var r,i,o=[],a=3;a<arguments.length;a++)o[a-3]=arguments[a];return"string"==typeof e||e instanceof Li?(D("Transaction.update",arguments,3),r=ko("Transaction.update",t,this._firestore),i=this._firestore._dataConverter.parseUpdateVarargs("Transaction.update",e,n,o)):(O("Transaction.update",arguments,2),r=ko("Transaction.update",t,this._firestore),i=this._firestore._dataConverter.parseUpdateData("Transaction.update",e)),this._transaction.update(r._key,i),this},t.prototype.delete=function(t){O("Transaction.delete",arguments,1);var e=ko("Transaction.delete",t,this._firestore);return this._transaction.delete(e._key),this},t}(),bo=function(){function t(t){this._firestore=t,this._mutations=[],this._committed=!1}return t.prototype.set=function(t,e,n){k("WriteBatch.set",arguments,2,3),this.verifyNotCommitted();var r=ko("WriteBatch.set",t,this._firestore),i=(n=Ao("WriteBatch.set",n)).merge||n.mergeFields?this._firestore._dataConverter.parseMergeData("WriteBatch.set",e,n.mergeFields):this._firestore._dataConverter.parseSetData("WriteBatch.set",e);return this._mutations=this._mutations.concat(i.toMutations(r._key,ie.NONE)),this},t.prototype.update=function(t,e,n){for(var r,i,o=[],a=3;a<arguments.length;a++)o[a-3]=arguments[a];return this.verifyNotCommitted(),"string"==typeof e||e instanceof Li?(D("WriteBatch.update",arguments,3),r=ko("WriteBatch.update",t,this._firestore),i=this._firestore._dataConverter.parseUpdateVarargs("WriteBatch.update",e,n,o)):(O("WriteBatch.update",arguments,2),r=ko("WriteBatch.update",t,this._firestore),i=this._firestore._dataConverter.parseUpdateData("WriteBatch.update",e)),this._mutations=this._mutations.concat(i.toMutations(r._key,ie.exists(!0))),this},t.prototype.delete=function(t){O("WriteBatch.delete",arguments,1),this.verifyNotCommitted();var e=ko("WriteBatch.delete",t,this._firestore);return this._mutations=this._mutations.concat(new ce(e._key,ie.NONE)),this},t.prototype.commit=function(){return a.__awaiter(this,void 0,void 0,function(){return a.__generator(this,function(t){return this.verifyNotCommitted(),this._committed=!0,this._mutations.length>0?[2,this._firestore.ensureClientConfigured().write(this._mutations)]:[2]})})},t.prototype.verifyNotCommitted=function(){if(this._committed)throw new _(w.FAILED_PRECONDITION,"A write batch can no longer be used after commit() has been called.")},t}(),wo=function(){function t(t,e){this._key=t,this.firestore=e,this._firestoreClient=this.firestore.ensureClientConfigured()}return t.forPath=function(e,n){if(e.length%2!=0)throw new _(w.INVALID_ARGUMENT,"Invalid document reference. Document references must have an even number of segments, but "+e.canonicalString()+" has "+e.length);return new t(new at(e),n)},Object.defineProperty(t.prototype,"id",{get:function(){return this._key.path.lastSegment()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){return new Io(this._key.path.popLast(),this.firestore)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"path",{get:function(){return this._key.path.canonicalString()},enumerable:!0,configurable:!0}),t.prototype.collection=function(t){if(O("DocumentReference.collection",arguments,1),N("DocumentReference.collection","non-empty string",1,t),!t)throw new _(w.INVALID_ARGUMENT,"Must provide a non-empty collection name to collection()");var e=rt.fromString(t);return new Io(this._key.path.child(e),this.firestore)},t.prototype.isEqual=function(e){if(!(e instanceof t))throw q("isEqual","DocumentReference",1,e);return this.firestore===e.firestore&&this._key.isEqual(e._key)},t.prototype.set=function(t,e){k("DocumentReference.set",arguments,1,2);var n=(e=Ao("DocumentReference.set",e)).merge||e.mergeFields?this.firestore._dataConverter.parseMergeData("DocumentReference.set",t,e.mergeFields):this.firestore._dataConverter.parseSetData("DocumentReference.set",t);return this._firestoreClient.write(n.toMutations(this._key,ie.NONE))},t.prototype.update=function(t,e){for(var n,r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];return"string"==typeof t||t instanceof Li?(D("DocumentReference.update",arguments,2),n=this.firestore._dataConverter.parseUpdateVarargs("DocumentReference.update",t,e,r)):(O("DocumentReference.update",arguments,1),n=this.firestore._dataConverter.parseUpdateData("DocumentReference.update",t)),this._firestoreClient.write(n.toMutations(this._key,ie.exists(!0)))},t.prototype.delete=function(){return O("DocumentReference.delete",arguments,0),this._firestoreClient.write([new ce(this._key,ie.NONE)])},t.prototype.onSnapshot=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];k("DocumentReference.onSnapshot",arguments,1,4);var n,r={includeMetadataChanges:!1},i=0;"object"!=typeof t[i]||zi(t[i])||(F("DocumentReference.onSnapshot",r=t[i],["includeMetadataChanges"]),x("DocumentReference.onSnapshot","boolean","includeMetadataChanges",r.includeMetadataChanges),i++);var o={includeMetadataChanges:r.includeMetadataChanges};return zi(t[i])?n=t[i]:(N("DocumentReference.onSnapshot","function",i,t[i]),P("DocumentReference.onSnapshot","function",i+1,t[i+1]),P("DocumentReference.onSnapshot","function",i+2,t[i+2]),n={next:t[i],error:t[i+1],complete:t[i+2]}),this.onSnapshotInternal(o,n)},t.prototype.onSnapshotInternal=function(t,e){var n=this,r=function(t){console.error("Uncaught Error in onSnapshot:",t)};e.error&&(r=e.error.bind(e));var i=new ji({next:function(t){if(e.next){m(t.docs.size<=1,"Too many documents returned on a document query");var r=t.docs.get(n._key);e.next(new So(n.firestore,n._key,r,t.fromCache,t.hasPendingWrites))}},error:r}),o=this._firestoreClient.listen(Vt.atPath(this._key.path),i,t);return function(){i.mute(),n._firestoreClient.unlisten(o)}},t.prototype.get=function(t){var e=this;return k("DocumentReference.get",arguments,0,1),Do("DocumentReference.get",t),new Promise(function(n,r){t&&"cache"===t.source?e.firestore.ensureClientConfigured().getDocumentFromLocalCache(e._key).then(function(t){n(new So(e.firestore,e._key,t,!0,t instanceof ut&&t.hasLocalMutations))},r):e.getViaSnapshotListener(n,r,t)})},t.prototype.getViaSnapshotListener=function(t,e,n){var r=this.onSnapshotInternal({includeMetadataChanges:!0,waitForSyncWhenOnline:!0},{next:function(i){r(),!i.exists&&i.metadata.fromCache?e(new _(w.UNAVAILABLE,"Failed to get document because the client is offline.")):i.exists&&i.metadata.fromCache&&n&&"server"===n.source?e(new _(w.UNAVAILABLE,'Failed to get document from server. (However, this document does exist in the local cache. Run again without setting source to "server" to retrieve the cached document.)')):t(i)},error:e})},t}(),_o=function(){function t(t,e){this.hasPendingWrites=t,this.fromCache=e}return t.prototype.isEqual=function(t){return this.hasPendingWrites===t.hasPendingWrites&&this.fromCache===t.fromCache},t}(),So=function(){function t(t,e,n,r,i){this._firestore=t,this._key=e,this._document=n,this._fromCache=r,this._hasPendingWrites=i}return t.prototype.data=function(t){return k("DocumentSnapshot.data",arguments,0,1),t=Oo("DocumentSnapshot.data",t),this._document?this.convertObject(this._document.data,mt.fromSnapshotOptions(t,this._firestore._areTimestampsInSnapshotsEnabled())):void 0},t.prototype.get=function(t,e){if(k("DocumentSnapshot.get",arguments,1,2),e=Oo("DocumentSnapshot.get",e),this._document){var n=this._document.data.field(so("DocumentSnapshot.get",t));if(void 0!==n)return this.convertValue(n,mt.fromSnapshotOptions(e,this._firestore._areTimestampsInSnapshotsEnabled()))}},Object.defineProperty(t.prototype,"id",{get:function(){return this._key.path.lastSegment()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ref",{get:function(){return new wo(this._key,this._firestore)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"exists",{get:function(){return null!==this._document},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"metadata",{get:function(){return new _o(this._hasPendingWrites,this._fromCache)},enumerable:!0,configurable:!0}),t.prototype.isEqual=function(e){if(!(e instanceof t))throw q("isEqual","DocumentSnapshot",1,e);return this._firestore===e._firestore&&this._fromCache===e._fromCache&&this._key.isEqual(e._key)&&(null===this._document?null===e._document:this._document.isEqual(e._document))},t.prototype.convertObject=function(t,e){var n=this,r={};return t.forEach(function(t,i){r[t]=n.convertValue(i,e)}),r},t.prototype.convertValue=function(t,e){if(t instanceof Nt)return this.convertObject(t,e);if(t instanceof Pt)return this.convertArray(t,e);if(t instanceof Dt){var n=t.value(e),r=this._firestore.ensureClientConfigured().databaseId();return t.databaseId.isEqual(r)||d("Document "+this._key.path+" contains a document reference within a different database ("+t.databaseId.projectId+"/"+t.databaseId.database+") which is not supported. It will be treated as a reference in the current database ("+r.projectId+"/"+r.database+") instead."),new wo(n,this._firestore)}return t.value(e)},t.prototype.convertArray=function(t,e){var n=this;return t.internalValue.map(function(t){return n.convertValue(t,e)})},t}(),Eo=function(t){function e(e,n,r,i,o){return t.call(this,e,n,r,i,o)||this}return a.__extends(e,t),e.prototype.data=function(e){var n=t.prototype.data.call(this,e);return m("object"==typeof n,"Document in a QueryDocumentSnapshot should exist"),n},e}(So),To=function(){function t(t,e){this._query=t,this.firestore=e}return t.prototype.where=function(e,n,r){var i;O("Query.where",arguments,3),N("Query.where","non-empty string",2,n),V("Query.where",3,r);var o=so("Query.where",e),a=qt.fromString(n);if(o.isKeyField()){if(a===qt.ARRAY_CONTAINS)throw new _(w.INVALID_ARGUMENT,"Invalid Query. You can't perform array-contains queries on FieldPath.documentId() since document IDs are not arrays.");if("string"==typeof r){if(-1!==r.indexOf("/"))throw new _(w.INVALID_ARGUMENT,"Function Query.where() requires its third parameter to be a valid document ID if the first parameter is FieldPath.documentId(), but it contains a slash.");if(""===r)throw new _(w.INVALID_ARGUMENT,"Function Query.where() requires its third parameter to be a valid document ID if the first parameter is FieldPath.documentId(), but it was an empty string.");var s=this._query.path.child(new rt([r]));m(s.length%2==0,"Path should be a document key"),i=new Dt(this.firestore._databaseId,new at(s))}else{if(!(r instanceof wo))throw new _(w.INVALID_ARGUMENT,"Function Query.where() requires its third parameter to be a string or a DocumentReference if the first parameter is FieldPath.documentId(), but it was: "+U(r)+".");i=new Dt(this.firestore._databaseId,r._key)}}else i=this.firestore._dataConverter.parseQueryValue("Query.where",r);var u=Ft.create(o,a,i);return this.validateNewFilter(u),new t(this._query.addFilter(u),this.firestore)},t.prototype.orderBy=function(e,n){var r;if(k("Query.orderBy",arguments,1,2),P("Query.orderBy","non-empty string",2,n),void 0===n||"asc"===n)r=Wt.ASCENDING;else{if("desc"!==n)throw new _(w.INVALID_ARGUMENT,"Function Query.orderBy() has unknown direction '"+n+"', expected 'asc' or 'desc'.");r=Wt.DESCENDING}if(null!==this._query.startAt)throw new _(w.INVALID_ARGUMENT,"Invalid query. You must not call Query.startAt() or Query.startAfter() before calling Query.orderBy().");if(null!==this._query.endAt)throw new _(w.INVALID_ARGUMENT,"Invalid query. You must not call Query.endAt() or Query.endBefore() before calling Query.orderBy().");var i=so("Query.orderBy",e),o=new Gt(i,r);return this.validateNewOrderBy(o),new t(this._query.addOrderBy(o),this.firestore)},t.prototype.limit=function(e){if(O("Query.limit",arguments,1),N("Query.limit","number",1,e),e<=0)throw new _(w.INVALID_ARGUMENT,"Invalid Query. Query limit ("+e+") is invalid. Limit must be positive.");return new t(this._query.withLimit(e),this.firestore)},t.prototype.startAt=function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];D("Query.startAt",arguments,1);var i=this.boundFromDocOrFields("Query.startAt",e,n,!0);return new t(this._query.withStartAt(i),this.firestore)},t.prototype.startAfter=function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];D("Query.startAfter",arguments,1);var i=this.boundFromDocOrFields("Query.startAfter",e,n,!1);return new t(this._query.withStartAt(i),this.firestore)},t.prototype.endBefore=function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];D("Query.endBefore",arguments,1);var i=this.boundFromDocOrFields("Query.endBefore",e,n,!0);return new t(this._query.withEndAt(i),this.firestore)},t.prototype.endAt=function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];D("Query.endAt",arguments,1);var i=this.boundFromDocOrFields("Query.endAt",e,n,!1);return new t(this._query.withEndAt(i),this.firestore)},t.prototype.isEqual=function(e){if(!(e instanceof t))throw q("isEqual","Query",1,e);return this.firestore===e.firestore&&this._query.isEqual(e._query)},t.prototype.boundFromDocOrFields=function(t,e,n,r){if(V(t,1,e),e instanceof So){if(n.length>0)throw new _(w.INVALID_ARGUMENT,"Too many arguments provided to "+t+"().");var i=e;if(!i.exists)throw new _(w.NOT_FOUND,"Can't use a DocumentSnapshot that doesn't exist for "+t+"().");return this.boundFromDocument(t,i._document,r)}var o=[e].concat(n);return this.boundFromFields(t,o,r)},t.prototype.boundFromDocument=function(t,e,n){for(var r=[],i=0,o=this._query.orderBy;i<o.length;i++){var a=o[i];if(a.field.isKeyField())r.push(new Dt(this.firestore._databaseId,e.key));else{var s=e.field(a.field);if(void 0===s){var u=a.field.canonicalString();throw new _(w.INVALID_ARGUMENT,"Invalid query. You are trying to start or end a query using a document for which the field '"+u+"' (used as the orderBy) does not exist.")}r.push(s)}}return new Kt(r,n)},t.prototype.boundFromFields=function(t,e,n){var r=this._query.explicitOrderBy;if(e.length>r.length)throw new _(w.INVALID_ARGUMENT,"Too many arguments provided to "+t+"(). The number of arguments must be less than or equal to the number of Query.orderBy() clauses");for(var i=[],o=0;o<e.length;o++){var a=e[o];if(r[o].field.isKeyField()){if("string"!=typeof a)throw new _(w.INVALID_ARGUMENT,"Invalid query. Expected a string for document ID in "+t+"(), but got a "+typeof a);if(-1!==a.indexOf("/"))throw new _(w.INVALID_ARGUMENT,"Invalid query. Document ID '"+a+"' contains a slash in "+t+"()");var s=new at(this._query.path.child(a));i.push(new Dt(this.firestore._databaseId,s))}else{var u=this.firestore._dataConverter.parseQueryValue(t,a);i.push(u)}}return new Kt(i,n)},t.prototype.onSnapshot=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];k("Query.onSnapshot",arguments,1,4);var n,r={},i=0;return"object"!=typeof t[i]||zi(t[i])||(F("Query.onSnapshot",r=t[i],["includeMetadataChanges"]),x("Query.onSnapshot","boolean","includeMetadataChanges",r.includeMetadataChanges),i++),zi(t[i])?n=t[i]:(N("Query.onSnapshot","function",i,t[i]),P("Query.onSnapshot","function",i+1,t[i+1]),P("Query.onSnapshot","function",i+2,t[i+2]),n={next:t[i],error:t[i+1],complete:t[i+2]}),this.onSnapshotInternal(r,n)},t.prototype.onSnapshotInternal=function(t,e){var n=this,r=function(t){console.error("Uncaught Error in onSnapshot:",t)};e.error&&(r=e.error.bind(e));var i=new ji({next:function(t){e.next&&e.next(new Co(n.firestore,n._query,t))},error:r}),o=this.firestore.ensureClientConfigured(),a=o.listen(this._query,i,t);return function(){i.mute(),o.unlisten(a)}},t.prototype.get=function(t){var e=this;return k("Query.get",arguments,0,1),Do("Query.get",t),new Promise(function(n,r){t&&"cache"===t.source?e.firestore.ensureClientConfigured().getDocumentsFromLocalCache(e._query).then(function(t){n(new Co(e.firestore,e._query,t))},r):e.getViaSnapshotListener(n,r,t)})},t.prototype.getViaSnapshotListener=function(t,e,n){var r=this.onSnapshotInternal({includeMetadataChanges:!0,waitForSyncWhenOnline:!0},{next:function(i){r(),i.metadata.fromCache&&n&&"server"===n.source?e(new _(w.UNAVAILABLE,'Failed to get documents from server. (However, these documents may exist in the local cache. Run again without setting source to "server" to retrieve the cached documents.)')):t(i)},error:e})},t.prototype.validateNewFilter=function(t){if(t instanceof Bt)if(t.isInequality()){var e=this._query.getInequalityFilterField();if(null!==e&&!e.isEqual(t.field))throw new _(w.INVALID_ARGUMENT,"Invalid query. All where filters with an inequality (<, <=, >, or >=) must be on the same field. But you have inequality filters on '"+e.toString()+"' and '"+t.field.toString()+"'");var n=this._query.getFirstOrderByField();null!==n&&this.validateOrderByAndInequalityMatch(t.field,n)}else if(t.op===qt.ARRAY_CONTAINS&&this._query.hasArrayContainsFilter())throw new _(w.INVALID_ARGUMENT,"Invalid query. Queries only support a single array-contains filter.")},t.prototype.validateNewOrderBy=function(t){if(null===this._query.getFirstOrderByField()){var e=this._query.getInequalityFilterField();null!==e&&this.validateOrderByAndInequalityMatch(e,t.field)}},t.prototype.validateOrderByAndInequalityMatch=function(t,e){if(!e.isEqual(t))throw new _(w.INVALID_ARGUMENT,"Invalid query. You have a where filter with an inequality (<, <=, >, or >=) on field '"+t.toString()+"' and so you must also use '"+t.toString()+"' as your first Query.orderBy(), but your first Query.orderBy() is on field '"+e.toString()+"' instead.")},t}(),Co=function(){function t(t,e,n){this._firestore=t,this._originalQuery=e,this._snapshot=n,this._cachedChanges=null,this._cachedChangesIncludeMetadataChanges=null,this.metadata=new _o(n.hasPendingWrites,n.fromCache)}return Object.defineProperty(t.prototype,"docs",{get:function(){var t=[];return this.forEach(function(e){return t.push(e)}),t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"empty",{get:function(){return this._snapshot.docs.isEmpty()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return this._snapshot.docs.size},enumerable:!0,configurable:!0}),t.prototype.forEach=function(t,e){var n=this;k("QuerySnapshot.forEach",arguments,1,2),N("QuerySnapshot.forEach","function",1,t),this._snapshot.docs.forEach(function(r){t.call(e,n.convertToDocumentImpl(r))})},Object.defineProperty(t.prototype,"query",{get:function(){return new To(this._originalQuery,this._firestore)},enumerable:!0,configurable:!0}),t.prototype.docChanges=function(t){t&&(F("QuerySnapshot.docChanges",t,["includeMetadataChanges"]),x("QuerySnapshot.docChanges","boolean","includeMetadataChanges",t.includeMetadataChanges));var e=!(!t||!t.includeMetadataChanges);if(e&&this._snapshot.excludesMetadataChanges)throw new _(w.INVALID_ARGUMENT,"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");return this._cachedChanges&&this._cachedChangesIncludeMetadataChanges===e||(this._cachedChanges=function(t,e,n){if(n.oldDocs.isEmpty()){var r,i=0;return n.docChanges.map(function(e){var o=new Eo(t,e.doc.key,e.doc,n.fromCache,n.mutatedKeys.has(e.doc.key));return m(e.type===ke.Added,"Invalid event type for first snapshot"),m(!r||n.query.docComparator(r,e.doc)<0,"Got added events in wrong order"),r=e.doc,{type:"added",doc:o,oldIndex:-1,newIndex:i++}})}var o=n.oldDocs;return n.docChanges.filter(function(t){return e||t.type!==ke.Metadata}).map(function(e){var r=new Eo(t,e.doc.key,e.doc,n.fromCache,n.mutatedKeys.has(e.doc.key)),i=-1,a=-1;return e.type!==ke.Added&&(m((i=o.indexOf(e.doc.key))>=0,"Index for document not found"),o=o.delete(e.doc.key)),e.type!==ke.Removed&&(a=(o=o.add(e.doc)).indexOf(e.doc.key)),{type:No(e.type),doc:r,oldIndex:i,newIndex:a}})}(this._firestore,e,this._snapshot),this._cachedChangesIncludeMetadataChanges=e),this._cachedChanges},t.prototype.isEqual=function(e){if(!(e instanceof t))throw q("isEqual","QuerySnapshot",1,e);return this._firestore===e._firestore&&this._originalQuery.isEqual(e._originalQuery)&&this._snapshot.isEqual(e._snapshot)},t.prototype.convertToDocumentImpl=function(t){return new Eo(this._firestore,t.key,t,this.metadata.fromCache,this._snapshot.mutatedKeys.has(t.key))},t}();["length","forEach","map"].concat("undefined"!=typeof Symbol?[Symbol.iterator]:[]).forEach(function(t){try{Object.defineProperty(Co.prototype.docChanges,t,{get:function(){return function(){throw new _(w.INVALID_ARGUMENT,'QuerySnapshot.docChanges has been changed from a property into a method, so usages like "querySnapshot.docChanges" should become "querySnapshot.docChanges()"')}()}})}catch(e){}});var Io=function(t){function e(e,n){var r=t.call(this,Vt.atPath(e),n)||this;if(e.length%2!=1)throw new _(w.INVALID_ARGUMENT,"Invalid collection reference. Collection references must have an odd number of segments, but "+e.canonicalString()+" has "+e.length);return r}return a.__extends(e,t),Object.defineProperty(e.prototype,"id",{get:function(){return this._query.path.lastSegment()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){var t=this._query.path.popLast();return t.isEmpty()?null:new wo(new at(t),this.firestore)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"path",{get:function(){return this._query.path.canonicalString()},enumerable:!0,configurable:!0}),e.prototype.doc=function(t){if(k("CollectionReference.doc",arguments,0,1),0===arguments.length&&(t=z.newId()),N("CollectionReference.doc","non-empty string",1,t),""===t)throw new _(w.INVALID_ARGUMENT,"Document path must be a non-empty string");var e=rt.fromString(t);return wo.forPath(this._query.path.child(e),this.firestore)},e.prototype.add=function(t){O("CollectionReference.add",arguments,1),N("CollectionReference.add","object",1,t);var e=this.doc();return e.set(t).then(function(){return e})},e}(To);function Ao(t,e){if(void 0===e)return{merge:!1};if(F(t,e,["merge","mergeFields"]),x(t,"boolean","merge",e.merge),"mergeFields","a string or a FieldPath",void 0!==(n=e.mergeFields)&&function(t,e,n,r,i){if(!(r instanceof Array))throw new _(w.INVALID_ARGUMENT,"Function "+t+"() requires its mergeFields option to be an array, but it was: "+U(r));for(var o=0;o<r.length;++o)if(!i(r[o]))throw new _(w.INVALID_ARGUMENT,"Function "+t+"() requires all mergeFields elements to be a string or a FieldPath, but the value at index "+o+" was: "+U(r[o]))}(t,0,0,n,function(t){return"string"==typeof t||t instanceof Li}),void 0!==e.mergeFields&&void 0!==e.merge)throw new _(w.INVALID_ARGUMENT,"Invalid options passed to function "+t+'(): You cannot specify both "merge" and "mergeFields".');var n;return e}function Oo(t,e){return void 0===e?{}:(F(t,e,["serverTimestamps"]),M(t,0,"serverTimestamps",e.serverTimestamps,["estimate","previous","none"]),e)}function Do(t,e){P(t,"object",1,e),e&&(F(t,e,["source"]),M(t,0,"source",e.source,["default","server","cache"]))}function ko(t,e,n){if(e instanceof wo){if(e.firestore!==n)throw new _(w.INVALID_ARGUMENT,"Provided document reference is from a different Firestore instance.");return e}throw q(t,"DocumentReference",1,e)}function No(t){switch(t){case ke.Added:return"added";case ke.Modified:case ke.Metadata:return"modified";case ke.Removed:return"removed";default:return g("Unknown change type: "+t)}}var Po=S(mo,"Use firebase.firestore() instead."),Ro=S(vo,"Use firebase.firestore().runTransaction() instead."),xo=S(bo,"Use firebase.firestore().batch() instead."),Mo=S(wo,"Use firebase.firestore().doc() instead."),jo=S(So),Lo=S(Eo),Uo=S(To),Vo=S(Co),Fo=S(Io,"Use firebase.firestore().collection() instead."),qo={Firestore:Po,GeoPoint:J,Timestamp:Z,Blob:Y,Transaction:Ro,WriteBatch:xo,DocumentReference:Mo,DocumentSnapshot:jo,Query:Uo,QueryDocumentSnapshot:Lo,QuerySnapshot:Vo,CollectionReference:Fo,FieldPath:Li,FieldValue:Yi,setLogLevel:mo.setLogLevel,CACHE_SIZE_UNLIMITED:po};function Bo(t){t.INTERNAL.registerService("firestore",function(t){return new mo(t)},function(t){m(t&&"object"==typeof t,"shallowCopy() expects object parameter.");var e={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}(qo))}Bo(i),e.registerFirestore=Bo},"6ahw":function(t,e,n){"use strict";n.d(e,"a",function(){return o});var r=n("iLxQ"),i=n("DKTb"),o={closed:!0,next:function(t){},error:function(t){if(r.a.useDeprecatedSynchronousErrorHandling)throw t;Object(i.a)(t)},complete:function(){}}},"6blF":function(t,e,n){"use strict";var r=n("FFOo"),i=n("L/V9"),o=n("6ahw"),a=n("xTla"),s=n("y3By"),u=n("iLxQ");n.d(e,"a",function(){return c});var c=function(){function t(t){this._isScalar=!1,t&&(this._subscribe=t)}return t.prototype.lift=function(e){var n=new t;return n.source=this,n.operator=e,n},t.prototype.subscribe=function(t,e,n){var a=this.operator,s=function(t,e,n){if(t){if(t instanceof r.a)return t;if(t[i.a])return t[i.a]()}return t||e||n?new r.a(t,e,n):new r.a(o.a)}(t,e,n);if(a?a.call(s,this.source):s.add(this.source||u.a.useDeprecatedSynchronousErrorHandling&&!s.syncErrorThrowable?this._subscribe(s):this._trySubscribe(s)),u.a.useDeprecatedSynchronousErrorHandling&&s.syncErrorThrowable&&(s.syncErrorThrowable=!1,s.syncErrorThrown))throw s.syncErrorValue;return s},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){u.a.useDeprecatedSynchronousErrorHandling&&(t.syncErrorThrown=!0,t.syncErrorValue=e),function(t){for(;t;){var e=t.destination;if(t.closed||t.isStopped)return!1;t=e&&e instanceof r.a?e:null}return!0}(t)?t.error(e):console.warn(e)}},t.prototype.forEach=function(t,e){var n=this;return new(e=l(e))(function(e,r){var i;i=n.subscribe(function(e){try{t(e)}catch(n){r(n),i&&i.unsubscribe()}},r,e)})},t.prototype._subscribe=function(t){var e=this.source;return e&&e.subscribe(t)},t.prototype[a.a]=function(){return this},t.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return 0===t.length?this:Object(s.b)(t)(this)},t.prototype.toPromise=function(t){var e=this;return new(t=l(t))(function(t,n){var r;e.subscribe(function(t){return r=t},function(t){return n(t)},function(){return t(r)})})},t.create=function(e){return new t(e)},t}();function l(t){if(t||(t=u.a.Promise||Promise),!t)throw new Error("no Promise impl found");return t}},"8g8A":function(t,e,n){"use strict";function r(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}n.d(e,"a",function(){return i}),r.prototype=Object.create(Error.prototype);var i=r},CB3U:function(t,e,n){"use strict";n.r(e),n("mrSG");var r=n("6blF"),i=n("0/uQ"),o=n("F/XL"),a=n("15JJ"),s=n("ORnb"),u=function(){return function(t,e,n,u){var c=this;this.zone=u;var l=new s.e(u,n);this.auth=u.runOutsideAngular(function(){return Object(s.f)(t,e).auth()}),this.authState=l.keepUnstableUntilFirst(l.runOutsideAngular(new r.a(function(t){return{unsubscribe:c.auth.onAuthStateChanged(t)}}))),this.user=l.keepUnstableUntilFirst(l.runOutsideAngular(new r.a(function(t){return{unsubscribe:c.auth.onIdTokenChanged(t)}}))),this.idToken=this.user.pipe(Object(a.a)(function(t){return t?Object(i.a)(t.getIdToken()):Object(o.a)(null)})),this.idTokenResult=this.user.pipe(Object(a.a)(function(t){return t?Object(i.a)(t.getIdTokenResult()):Object(o.a)(null)}))}}(),c=n("wj3C"),l=n.n(c);(function(){var t,e=e||{},n=this;function r(t){return"string"==typeof t}function i(t){return"boolean"==typeof t}function o(){}function a(t){var e=typeof 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&&void 0!==t.splice&&void 0!==t.propertyIsEnumerable&&!t.propertyIsEnumerable("splice"))return"array";if("[object Function]"==n||void 0!==t.call&&void 0!==t.propertyIsEnumerable&&!t.propertyIsEnumerable("call"))return"function"}else if("function"==e&&void 0===t.call)return"object";return e}function s(t){return null===t}function u(t){return"array"==a(t)}function c(t){var e=a(t);return"array"==e||"object"==e&&"number"==typeof t.length}function h(t){return"function"==a(t)}function f(t){var e=typeof t;return"object"==e&&null!=t||"function"==e}var p="closure_uid_"+(1e9*Math.random()>>>0),d=0;function y(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")?y:g).apply(null,arguments)}function v(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 _(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 E(t){if(Error.captureStackTrace)Error.captureStackTrace(this,E);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");E.call(this,n+t[r])}function C(t,e){throw new T("Failure"+(t?": "+t:""),Array.prototype.slice.call(arguments,1))}function I(t,e){this.c=t,this.f=e,this.b=0,this.a=null}function A(t,e){t.f(e),100>t.b&&(t.b++,e.next=t.a,t.a=e)}function O(){this.b=this.a=null}w(E,Error),E.prototype.name="CustomError",w(T,E),T.prototype.name="AssertionError",I.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 D=new I(function(){return new N},function(t){t.reset()});function k(){var t=pt,e=null;return t.a&&(e=t.a,t.a=t.a.next,t.a||(t.b=null),e.next=null),e}function N(){this.next=this.b=this.a=null}O.prototype.add=function(t,e){var n=D.get();n.set(t,e),this.b?this.b.next=n:this.a=n,this.b=n},N.prototype.set=function(t,e){this.a=t,this.b=e,this.next=null},N.prototype.reset=function(){this.next=this.b=this.a=null};var P=Array.prototype.indexOf?function(t,e){return Array.prototype.indexOf.call(t,e,void 0)}:function(t,e){if(r(t))return r(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},R=Array.prototype.forEach?function(t,e,n){Array.prototype.forEach.call(t,e,n)}:function(t,e,n){for(var i=t.length,o=r(t)?t.split(""):t,a=0;a<i;a++)a in o&&e.call(n,o[a],a,t)},x=Array.prototype.map?function(t,e){return Array.prototype.map.call(t,e,void 0)}:function(t,e){for(var n=t.length,i=Array(n),o=r(t)?t.split(""):t,a=0;a<n;a++)a in o&&(i[a]=e.call(void 0,o[a],a,t));return i},M=Array.prototype.some?function(t,e){return Array.prototype.some.call(t,e,void 0)}:function(t,e){for(var n=t.length,i=r(t)?t.split(""):t,o=0;o<n;o++)if(o in i&&e.call(void 0,i[o],o,t))return!0;return!1};function j(t,e){return 0<=P(t,e)}function L(t,e){var n;return(n=0<=(e=P(t,e)))&&Array.prototype.splice.call(t,e,1),n}function U(t,e){!function(t,e){var n=t.length,i=r(t)?t.split(""):t;for(--n;0<=n;--n)n in i&&e.call(void 0,i[n],n,t)}(t,function(n,r){e.call(void 0,n,r,t)&&Array.prototype.splice.call(t,r,1)})}function V(t){return Array.prototype.concat.apply([],arguments)}function F(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(W,"&")),-1!=t.indexOf("<")&&(t=t.replace(K,"<")),-1!=t.indexOf(">")&&(t=t.replace(G,">")),-1!=t.indexOf('"')&&(t=t.replace(Q,""")),-1!=t.indexOf("'")&&(t=t.replace(X,"'")),-1!=t.indexOf("\0")&&(t=t.replace(Y,"�")),t):t}var z,W=/&/g,K=/</g,G=/>/g,Q=/"/g,X=/'/g,Y=/\x00/g,J=/[\x00&<>"']/;function Z(t,e){return-1!=t.indexOf(e)}function $(t,e){return t<e?-1:t>e?1:0}t:{var tt=n.navigator;if(tt){var et=tt.userAgent;if(et){z=et;break t}}z=""}function nt(t){return Z(z,t)}function rt(t,e){for(var n in t)e.call(void 0,t[n],n,t)}function it(t){for(var e in t)return!1;return!0}function ot(t){var e,n={};for(e in t)n[e]=t[e];return n}var at,st,ut="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function ct(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<ut.length;o++)n=ut[o],Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}}function lt(t){n.setTimeout(function(){throw t},0)}function ht(t,e){st||function(){if(n.Promise&&n.Promise.resolve){var t=n.Promise.resolve(void 0);st=function(){t.then(dt)}}else st=function(){var t=dt;!h(n.setImmediate)||n.Window&&n.Window.prototype&&!nt("Edge")&&n.Window.prototype.setImmediate==n.setImmediate?(at||(at=function(){var t=n.MessageChannel;if(void 0===t&&"undefined"!=typeof window&&window.postMessage&&window.addEventListener&&!nt("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).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)}}}),void 0!==t&&!nt("Trident")&&!nt("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)}}()),at(t)):n.setImmediate(t)}}(),ft||(st(),ft=!0),pt.add(t,e)}var ft=!1,pt=new O;function dt(){for(var t;t=k();){try{t.a.call(t.b)}catch(e){lt(e)}A(D,t)}ft=!1}function yt(t,e){if(this.a=gt,this.i=void 0,this.f=this.b=this.c=null,this.g=this.h=!1,t!=o)try{var n=this;t.call(e,function(t){Ot(n,mt,t)},function(t){if(!(t instanceof Mt))try{if(t instanceof Error)throw t;throw Error("Promise rejected.")}catch(e){}Ot(n,vt,t)})}catch(r){Ot(this,vt,r)}}var gt=0,mt=2,vt=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 I(function(){return new bt},function(t){t.reset()});function _t(t,e,n){var r=wt.get();return r.g=t,r.b=e,r.f=n,r}function St(t){if(t instanceof yt)return t;var e=new yt(o);return Ot(e,mt,t),e}function Et(t){return new yt(function(e,n){n(t)})}function Tt(t,e,n){Dt(t,e,n,null)||ht(v(e,t))}function Ct(t){return new yt(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],v(i,o,!0),v(i,o,!1));else e(r)})}function It(t,e){t.b||t.a!=mt&&t.a!=vt||kt(t),t.f?t.f.next=e:t.b=e,t.f=e}function At(t,e,n,r){var i=_t(null,null,null);return i.a=new yt(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,It(t,i),i.a}function Ot(t,e,n){t.a==gt&&(t===n&&(e=vt,n=new TypeError("Promise cannot resolve to itself")),t.a=1,Dt(n,t.Nc,t.Oc,t)||(t.i=n,t.a=e,t.c=null,kt(t),e!=vt||n instanceof Mt||function(t,e){t.g=!0,ht(function(){t.g&&xt.call(null,e)})}(t,n)))}function Dt(t,e,n,r){if(t instanceof yt)return It(t,_t(e||o,n||null,r)),!0;if(S(t))return t.then(e,n,r),!0;if(f(t))try{var i=t.then;if(h(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(a){return n.call(r,a),!0}return!1}function kt(t){t.h||(t.h=!0,ht(t.Yb,t))}function Nt(t){var e=null;return t.b&&(t.b=(e=t.b).next,e.next=null),t.b||(t.f=null),e}function Pt(t,e,n,r){if(n==vt&&e.b&&!e.c)for(;t&&t.g;t=t.c)t.g=!1;if(e.a)e.a.c=null,Rt(e,n,r);else try{e.c?e.g.call(e.f):Rt(e,n,r)}catch(i){xt.call(null,i)}A(wt,e)}function Rt(t,e,n){e==mt?t.g.call(t.f,n):t.b&&t.b.call(t.f,n)}yt.prototype.then=function(t,e,n){return At(this,h(t)?t:null,h(e)?e:null,n)},_(yt),(t=yt.prototype).ia=function(t,e){return(t=_t(t,t,e)).c=!0,It(this,t),this},t.s=function(t,e){return At(this,null,t,e)},t.cancel=function(t){this.a==gt&&ht(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):Nt(r),Pt(r,o,vt,n)))}e.c=null}else Ot(e,vt,n)}(this,new Mt(t))},this)},t.Nc=function(t){this.a=gt,Ot(this,mt,t)},t.Oc=function(t){this.a=gt,Ot(this,vt,t)},t.Yb=function(){for(var t;t=Nt(this);)Pt(this,t,this.a,this.i);this.h=!1};var xt=lt;function Mt(t){E.call(this,t)}function jt(){0!=Lt&&(Ut[this[p]||(this[p]=++d)]=this),this.qa=this.qa,this.ja=this.ja}w(Mt,E),Mt.prototype.name="cancel";var Lt=0,Ut={};function Vt(t){if(!t.qa&&(t.qa=!0,t.va(),0!=Lt)){var e=t[p]||(t[p]=++d);if(0!=Lt&&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 Ft(t){return Ft[" "](t),t}jt.prototype.qa=!1,jt.prototype.va=function(){if(this.ja)for(;this.ja.length;)this.ja.shift()()},Ft[" "]=o;var qt,Bt,Ht=nt("Opera"),zt=nt("Trident")||nt("MSIE"),Wt=nt("Edge"),Kt=Wt||zt,Gt=nt("Gecko")&&!(Z(z.toLowerCase(),"webkit")&&!nt("Edge"))&&!(nt("Trident")||nt("MSIE"))&&!nt("Edge"),Qt=Z(z.toLowerCase(),"webkit")&&!nt("Edge");function Xt(){var t=n.document;return t?t.documentMode:void 0}t:{var Yt="",Jt=(Bt=z,Gt?/rv:([^\);]+)(\)|;)/.exec(Bt):Wt?/Edge\/([\d\.]+)/.exec(Bt):zt?/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(Bt):Qt?/WebKit\/(\S+)/.exec(Bt):Ht?/(?:Version)[ \/]?(\S+)/.exec(Bt):void 0);if(Jt&&(Yt=Jt?Jt[1]:""),zt){var Zt=Xt();if(null!=Zt&&Zt>parseFloat(Yt)){qt=String(Zt);break t}}qt=Yt}var $t,te={};function ee(t){return function(t,e){var n=te;return Object.prototype.hasOwnProperty.call(n,t)?n[t]:n[t]=e()}(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=$(0==a[1].length?0:parseInt(a[1],10),0==s[1].length?0:parseInt(s[1],10))||$(0==a[2].length,0==s[2].length)||$(a[2],s[2]),a=a[3],s=s[3]}while(0==e)}return 0<=e})}var ne=n.document;$t=ne&&zt?Xt()||("CSS1Compat"==ne.compatMode?parseInt(qt,10):5):void 0;var re=Object.freeze||function(t){return t},ie=!zt||9<=Number($t),oe=zt&&!ee("9"),ae=function(){if(!n.addEventListener||!Object.defineProperty)return!1;var t=!1,e=Object.defineProperty({},"passive",{get:function(){t=!0}});return n.addEventListener("test",o,e),n.removeEventListener("test",o,e),t}();function se(t,e){this.type=t,this.b=this.target=e,this.Kb=!0}function ue(t,e){if(se.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,i=t.changedTouches?t.changedTouches[0]:null;if(this.target=t.target||t.srcElement,this.b=e,e=t.relatedTarget){if(Gt){t:{try{Ft(e.nodeName);var o=!0;break t}catch(a){}o=!1}o||(e=null)}}else"mouseover"==n?e=t.fromElement:"mouseout"==n&&(e=t.toElement);this.relatedTarget=e,null===i?(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!==i.clientX?i.clientX:i.pageX,this.clientY=void 0!==i.clientY?i.clientY:i.pageY,this.screenX=i.screenX||0,this.screenY=i.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=r(t.pointerType)?t.pointerType:ce[t.pointerType]||"",this.a=t,t.defaultPrevented&&this.preventDefault()}}se.prototype.preventDefault=function(){this.Kb=!1},w(ue,se);var ce=re({2:"touch",3:"pen",4:"mouse"});ue.prototype.preventDefault=function(){ue.ob.preventDefault.call(this);var t=this.a;if(t.preventDefault)t.preventDefault();else if(t.returnValue=!1,oe)try{(t.ctrlKey||112<=t.keyCode&&123>=t.keyCode)&&(t.keyCode=-1)}catch(e){}},ue.prototype.f=function(){return this.a};var le="closure_listenable_"+(1e6*Math.random()|0),he=0;function fe(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=++he,this.oa=this.Ia=!1}function pe(t){t.oa=!0,t.listener=null,t.proxy=null,t.src=null,t.La=null}function de(t){this.src=t,this.a={},this.b=0}function ye(t,e){var n=e.type;n in t.a&&L(t.a[n],e)&&(pe(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}de.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 fe(e,this.src,o,!!r,i)).Ia=n,t.push(e)),e};var me="closure_lm_"+(1e6*Math.random()|0),ve={};function be(t,e,n,r,i){if(r&&r.once)_e(t,e,n,r,i);else if(u(e))for(var o=0;o<e.length;o++)be(t,e[o],n,r,i);else n=ke(n),t&&t[le]?Pe(t,e,n,f(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=f(i)?!!i.capture:!!i,s=Oe(t);if(s||(t[me]=s=new de(t)),!(n=s.add(e,n,r,a,o)).proxy)if(r=function(){var t=Ae,e=ie?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)ae||(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)}}function _e(t,e,n,r,i){if(u(e))for(var o=0;o<e.length;o++)_e(t,e[o],n,r,i);else n=ke(n),t&&t[le]?Re(t,e,n,f(r)?!!r.capture:!!r,i):we(t,e,n,!0,r,i)}function Se(t,e,n,r,i){if(u(e))for(var o=0;o<e.length;o++)Se(t,e[o],n,r,i);else r=f(r)?!!r.capture:!!r,n=ke(n),t&&t[le]?(t=t.l,(e=String(e).toString())in t.a&&-1<(n=ge(o=t.a[e],n,r,i))&&(pe(o[n]),Array.prototype.splice.call(o,n,1),0==o.length&&(delete t.a[e],t.b--))):t&&(t=Oe(t))&&(e=t.a[e.toString()],t=-1,e&&(t=ge(e,n,r,i)),(n=-1<t?e[t]:null)&&Ee(n))}function Ee(t){if("number"!=typeof t&&t&&!t.oa){var e=t.src;if(e&&e[le])ye(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),(n=Oe(e))?(ye(n,t),0==n.b&&(n.src=null,e[me]=null)):pe(t)}}}function Te(t){return t in ve?ve[t]:ve[t]="on"+t}function Ce(t,e,n,r){var i=!0;if((t=Oe(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=Ie(o,r),i=i&&!1!==o)}return i}function Ie(t,e){var n=t.listener,r=t.La||t.src;return t.Ia&&Ee(t),n.call(r,e)}function Ae(t,e){if(t.oa)return!0;if(!ie){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 ue(i=e,this),r=!0,!(0>i.keyCode||null!=i.returnValue)){t:{var o=!1;if(0==i.keyCode)try{i.keyCode=-1;break t}catch(s){o=!0}(o||null==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=Ce(i[o],t,!0,e);r=r&&a}for(o=0;o<i.length;o++)e.b=i[o],a=Ce(i[o],t,!1,e),r=r&&a}return r}return Ie(t,new ue(e,this))}function Oe(t){return(t=t[me])instanceof de?t:null}var De="__closure_events_fn_"+(1e9*Math.random()>>>0);function ke(t){return h(t)?t:(t[De]||(t[De]=function(e){return t.handleEvent(e)}),t[De])}function Ne(){jt.call(this),this.l=new de(this),this.Rb=this,this.Va=null}function Pe(t,e,n,r,i){t.l.add(String(e),n,!1,r,i)}function Re(t,e,n,r,i){t.l.add(String(e),n,!0,r,i)}function xe(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&&ye(t.l,a),i=!1!==s.call(u,r)&&i}}return i&&0!=r.Kb}function Me(t,e,r){if(h(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 je(t){var e=null;return new yt(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 Le(t){if(t.S&&"function"==typeof t.S)return t.S();if(r(t))return t.split("");if(c(t)){for(var e=[],n=t.length,i=0;i<n;i++)e.push(t[i]);return e}for(i in e=[],n=0,t)e[n++]=t[i];return e}function Ue(t){if(t.U&&"function"==typeof t.U)return t.U();if(!t.S||"function"!=typeof t.S){if(c(t)||r(t)){var e=[];t=t.length;for(var n=0;n<t;n++)e.push(n);return e}for(var i in e=[],n=0,t)e[n++]=i;return e}}function Ve(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 Ve)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 Fe(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(Ne,jt),Ne.prototype[le]=!0,Ne.prototype.addEventListener=function(t,e,n,r){be(this,t,e,n,r)},Ne.prototype.removeEventListener=function(t,e,n,r){Se(this,t,e,n,r)},Ne.prototype.dispatchEvent=function(t){var e,n=this.Va;if(n)for(e=[];n;n=n.Va)e.push(n);n=this.Rb;var i=t.type||t;if(r(t))t=new se(t,n);else if(t instanceof se)t.target=t.target||n;else{var o=t;ct(t=new se(i,n),o)}if(o=!0,e)for(var a=e.length-1;0<=a;a--){var s=t.b=e[a];o=xe(s,i,!0,t)&&o}if(o=xe(s=t.b=n,i,!0,t)&&o,o=xe(s,i,!1,t)&&o,e)for(a=0;a<e.length;a++)o=xe(s=t.b=e[a],i,!1,t)&&o;return o},Ne.prototype.va=function(){if(Ne.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++)pe(n[r]);delete e.a[t],e.b--}}this.Va=null},(t=Ve.prototype).S=function(){Fe(this);for(var t=[],e=0;e<this.a.length;e++)t.push(this.b[this.a[e]]);return t},t.U=function(){return Fe(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,ze(this,t.c),this.l=t.l,this.b=t.b,We(this,t.i),this.g=t.g,e=t.a;var n=new an;n.c=e.c,e.a&&(n.a=new Ve(e.a),n.b=e.b),Ke(this,n),this.h=t.h}else t&&(n=String(t).match(Be))?(this.f=!!e,ze(this,n[1]||"",!0),this.l=Je(n[2]||""),this.b=Je(n[3]||"",!0),We(this,n[4]),this.g=Je(n[5]||"",!0),Ke(this,n[6]||"",!0),this.h=Je(n[7]||"")):(this.f=!!e,this.a=new an(null,this.f))}function ze(t,e,n){t.c=n?Je(e,!0):e,t.c&&(t.c=t.c.replace(/:$/,""))}function We(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 Ke(t,e,n){e instanceof an?(t.a=e,function(t,e){e&&!t.f&&(sn(t),t.c=null,t.a.forEach(function(t,e){var n=e.toLowerCase();e!=n&&(cn(this,e),hn(this,n,t))},t)),t.f=e}(t.a,t.f)):(n||(e=Ze(e,rn)),t.a=new an(e,t.f))}function Ge(t,e,n){t.a.set(e,n)}function Qe(t,e){return t.a.get(e)}function Xe(t){return t instanceof He?new He(t):new He(t,void 0)}function Ye(t,e){var n=new He(null,void 0);return ze(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 r(t)?(t=encodeURI(t).replace(e,$e),n&&(t=t.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),t):null}function $e(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,tn,!0),":");var n=this.b;return(n||"file"==e)&&(t.push("//"),(e=this.l)&&t.push(Ze(e,tn,!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)?nn:en,!0))),(n=this.a.toString())&&t.push("?",n),(n=this.h)&&t.push("#",Ze(n,on)),t.join("")};var tn=/[#\/\?@]/g,en=/[#\?:]/g,nn=/[#\?]/g,rn=/[#\?@]/g,on=/#/g;function an(t,e){this.b=this.a=null,this.c=t||null,this.f=!!e}function sn(t){t.a||(t.a=new Ve,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 un(t){var e=Ue(t);if(void 0===e)throw Error("Keys are undefined");var n=new an(null,void 0);t=Le(t);for(var r=0;r<e.length;r++){var i=e[r],o=t[r];u(o)?hn(n,i,o):n.add(i,o)}return n}function cn(t,e){sn(t),e=fn(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&&Fe(t)))}function ln(t,e){return sn(t),e=fn(t,e),qe(t.a.b,e)}function hn(t,e,n){cn(t,e),0<n.length&&(t.c=null,t.a.set(fn(t,e),F(n)),t.b+=n.length)}function fn(t,e){return e=String(e),t.f&&(e=e.toLowerCase()),e}(t=an.prototype).add=function(t,e){sn(this),this.c=null,t=fn(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){sn(this),this.a.forEach(function(n,r){R(n,function(n){t.call(e,n,r,this)},this)},this)},t.U=function(){sn(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){sn(this);var e=[];if(r(t))ln(this,t)&&(e=V(e,this.a.get(fn(this,t))));else{t=this.a.S();for(var n=0;n<t.length;n++)e=V(e,t[n])}return e},t.set=function(t,e){return sn(this),this.c=null,ln(this,t=fn(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 pn=!zt||9<=Number($t);function dn(){this.a="",this.b=gn}function yn(t){return t instanceof dn&&t.constructor===dn&&t.b===gn?t.a:(C("expected object of type Const, got '"+t+"'"),"type_error:Const")}dn.prototype.na=!0,dn.prototype.ma=function(){return this.a},dn.prototype.toString=function(){return"Const{"+this.a+"}"};var gn={};function mn(t){var e=new dn;return e.a=t,e}function vn(){this.a="",this.b=En}function bn(t){return t instanceof vn&&t.constructor===vn&&t.b===En?t.a:(C("expected object of type TrustedResourceUrl, got '"+t+"' of type "+a(t)),"type_error:TrustedResourceUrl")}function wn(t,e){var n=yn(t);if(!Sn.test(n))throw Error("Invalid TrustedResourceUrl format: "+n);return function(t){var e=new vn;return e.a=t,e}(t=n.replace(_n,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 dn?yn(t):encodeURIComponent(String(t))}))}mn(""),vn.prototype.na=!0,vn.prototype.ma=function(){return this.a},vn.prototype.toString=function(){return"TrustedResourceUrl{"+this.a+"}"};var _n=/%{(\w+)}/g,Sn=/^(?:https:)?\/\/[0-9a-z.:[\]-]+\/|^\/[^\/\\]|^about:blank#/i,En={};function Tn(){this.a="",this.b=On}function Cn(t){return t instanceof Tn&&t.constructor===Tn&&t.b===On?t.a:(C("expected object of type SafeUrl, got '"+t+"' of type "+a(t)),"type_error:SafeUrl")}Tn.prototype.na=!0,Tn.prototype.ma=function(){return this.a},Tn.prototype.toString=function(){return"SafeUrl{"+this.a+"}"};var In=/^(?:(?:https?|mailto|ftp):|[^:\/?#]*(?:[\/?#]|$))/i;function An(t){return t instanceof Tn?t:(t=t.na?t.ma():String(t),In.test(t)||(t="about:invalid#zClosurez"),Dn(t))}var On={};function Dn(t){var e=new Tn;return e.a=t,e}function kn(){this.a="",this.b=Nn}Dn("about:blank"),kn.prototype.na=!0,kn.prototype.ma=function(){return this.a},kn.prototype.toString=function(){return"SafeHtml{"+this.a+"}"};var Nn={};function Pn(t){var e=new kn;return e.a=t,e}function Rn(t){var e=document;return r(t)?e.getElementById(t):t}function xn(t,e){rt(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})}Pn("<!DOCTYPE html>"),Pn(""),Pn("<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 jn(t){if(t&&"number"==typeof t.length){if(f(t))return"function"==typeof t.item||"string"==typeof t.item;if(h(t))return"function"==typeof t.item}return!1}function Ln(t){var e=[];return function t(e,n,r){if(null==n)r.push("null");else{if("object"==typeof n){if(u(n)){var i=n;n=i.length,r.push("[");for(var o="",a=0;a<n;a++)r.push(o),t(e,i[a],r),o=",";return void r.push("]")}if(!(n instanceof String||n instanceof Number||n instanceof Boolean)){for(i in r.push("{"),o="",n)Object.prototype.hasOwnProperty.call(n,i)&&"function"!=typeof(a=n[i])&&(r.push(o),qn(i,r),r.push(":"),t(e,a,r),o=",");return void r.push("}")}n=n.valueOf()}switch(typeof n){case"string":qn(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: "+typeof n)}}}(new Un,t,e),e.join("")}function Un(){}var Vn={'"':'\\"',"\\":"\\\\","/":"\\/","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\u000b"},Fn=/\uffff/.test("\uffff")?/[\\"\x00-\x1f\x7f-\uffff]/g:/[\\"\x00-\x1f\x7f-\xff]/g;function qn(t,e){e.push('"',t.replace(Fn,function(t){var e=Vn[t];return e||(e="\\u"+(65536|t.charCodeAt(0)).toString(16).substr(1),Vn[t]=e),e}),'"')}function Bn(){var t=sr();return zt&&!!$t&&11==$t||/Edge\/\d+/.test(t)}function Hn(){return n.window&&n.window.location.href||self&&self.location&&self.location.href||""}function zn(t,e){e=e||n.window;var r="about:blank";t&&(r=Cn(An(t))),e.location.href=r}function Wn(t){return!!((t=(t||sr()).toLowerCase()).match(/android/)||t.match(/webos/)||t.match(/iphone|ipad|ipod/)||t.match(/blackberry/)||t.match(/windows phone/)||t.match(/iemobile/))}function Kn(t){t=t||n.window;try{t.close()}catch(e){}}function Gn(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(s 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=sr().toLowerCase(),r&&(e.target=r,Z(n,"crios/")&&(e.target="_blank")),ir(sr())==nr&&(t=t||"http://localhost",e.scrollbars=!0),n=t||"",(t=e)||(t={}),r=window,e=n instanceof Tn?n:An(void 0!==n.href?n.href:String(n)),n=t.target||n.target,i=[],t)switch(s){case"width":case"height":case"top":case"left":i.push(s+"="+t[s]);break;case"target":case"noopener":case"noreferrer":break;default:i.push(s+"="+(t[s]?1:0))}var s=i.join(",");if((nt("iPhone")&&!nt("iPod")&&!nt("iPad")||nt("iPad")||nt("iPod"))&&r.navigator&&r.navigator.standalone&&n&&"_self"!=n?(s=r.document.createElement("A"),e instanceof Tn||e instanceof Tn||(e=e.na?e.ma():String(e),In.test(e)||(e="about:invalid#zClosurez"),e=Dn(e)),s.href=Cn(e),s.setAttribute("target",n),t.noreferrer&&s.setAttribute("rel","noreferrer"),(t=document.createEvent("MouseEvent")).initMouseEvent("click",!0,!0,r,1),s.dispatchEvent(t),s={}):t.noreferrer?(s=r.open("",n,s),t=Cn(e),s&&(Kt&&Z(t,";")&&(t="'"+t.replace(/'/g,"%27")+"'"),s.opener=null,mn("b/12014412, meta tag with sanitized URL"),t=Pn(t='<meta name="referrer" content="no-referrer"><meta http-equiv="refresh" content="0; url='+H(t)+'">'),s.document.write(function(t){return t instanceof kn&&t.constructor===kn&&t.b===Nn?t.a:(C("expected object of type SafeHtml, got '"+t+"' of type "+a(t)),"type_error:SafeHtml")}(t)),s.document.close())):(s=r.open(Cn(e),n,s))&&t.noopener&&(s.opener=null),s)try{s.focus()}catch(u){}return s}var Qn=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,Xn=/^[^@]+@[^@]+$/;function Yn(){var t=null;return new yt(function(e){"complete"==n.document.readyState?e():(t=function(){e()},_e(window,"load",t))}).s(function(e){throw Se(window,"load",t),e})}function Jn(t){return t=t||sr(),!("file:"!==fr()||!t.toLowerCase().match(/iphone|ipad|ipod|android/))}function Zn(){var t=n.window;try{return!(!t||t==t.top)}catch(e){return!1}}function $n(){return"object"!=typeof n.window&&"function"==typeof n.importScripts}function tr(){return l.a.INTERNAL.hasOwnProperty("reactNative")?"ReactNative":l.a.INTERNAL.hasOwnProperty("node")?"Node":$n()?"Worker":"Browser"}function er(){var t=tr();return"ReactNative"===t||"Node"===t}var nr="Firefox",rr="Chrome";function ir(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/")?nr: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":rr:"Safari"}var or={Uc:"FirebaseCore-web",Wc:"FirebaseUI-web"};function ar(t,e){e=e||[];var n,r=[],i={};for(n in or)i[or[n]]=!0;for(n=0;n<e.length;n++)void 0!==i[e[n]]&&(delete i[e[n]],r.push(e[n]));return r.sort(),(e=r).length||(e=["FirebaseCore-web"]),"Browser"===(r=tr())?r=ir(i=sr()):"Worker"===r&&(r=ir(i=sr())+"-"+r),r+"/JsCore/"+t+"/"+e.join(",")}function sr(){return n.navigator&&n.navigator.userAgent||""}function ur(t,e){t=t.split("."),e=e||n;for(var r=0;r<t.length&&"object"==typeof e&&null!=e;r++)e=e[t[r]];return r!=t.length&&(e=void 0),e}function cr(){try{var t=n.localStorage,e=mr();if(t)return t.setItem(e,"1"),t.removeItem(e),!Bn()||!!n.indexedDB}catch(r){return $n()&&!!n.indexedDB}return!1}function lr(){return(hr()||"chrome-extension:"===fr()||Jn())&&!er()&&cr()&&!$n()}function hr(){return"http:"===fr()||"https:"===fr()}function fr(){return n.location&&n.location.protocol||null}function pr(t){return!Wn(t=t||sr())&&ir(t)!=nr}function dr(t){return void 0===t?null:Ln(t)}function yr(t){var e,n={};for(e in t)t.hasOwnProperty(e)&&null!=t[e]&&(n[e]=t[e]);return n}function gr(t){if(null!==t)return JSON.parse(t)}function mr(t){return t||Math.floor(1e9*Math.random()).toString()}function vr(t){return"Safari"!=ir(t=t||sr())&&!t.toLowerCase().match(/iphone|ipad|ipod/)}function br(){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 wr(t,e){if(t>e)throw Error("Short delay should be less than long delay!");this.a=t,this.c=e,t=sr(),e=tr(),this.b=Wn(t)||"ReactNative"===e}function _r(){var t=n.document;return!t||void 0===t.visibilityState||"visible"==t.visibilityState}function Sr(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 Er(){return!(!ur("fireauth.oauthhelper",n)&&!ur("fireauth.iframe",n))}wr.prototype.get=function(){var t=n.navigator;return!t||"boolean"!=typeof t.onLine||!hr()&&"chrome-extension:"!==fr()&&void 0===t.connection||t.onLine?this.b?this.c:this.a:Math.min(5e3,this.a)};var Tr,Cr={};function Ir(t){Cr[t]||(Cr[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}),Tr=2==Ar.abcd}catch(Bt){Tr=!1}function Or(t,e,n){Tr?Object.defineProperty(t,e,{configurable:!0,enumerable:!0,value:n}):t[e]=n}function Dr(t,e){if(e)for(var n in e)e.hasOwnProperty(n)&&Or(t,n,e[n])}function kr(t){var e={};return Dr(e,t),e}function Nr(t){var e=t;if("object"==typeof t&&null!=t)for(var n in e="length"in t?[]:{},t)Or(e,n,Nr(t[n]));return e}function Pr(t){var e={},n=t[xr],r=t[Mr];if(!(t=t[jr])||t!=Rr&&!n)throw Error("Invalid provider user info!");e[Ur]=r||null,e[Lr]=n||null,Or(this,Fr,t),Or(this,Vr,Nr(e))}var Rr="EMAIL_SIGNIN",xr="email",Mr="newEmail",jr="requestType",Lr="email",Ur="fromEmail",Vr="data",Fr="operation";function qr(t,e){this.code=Hr+t,this.message=e||zr[t]||""}function Br(t){var e=t&&t.code;return e?new qr(e.substring(Hr.length),t.message):null}w(qr,Error),qr.prototype.C=function(){return{code:this.code,message:this.message}},qr.prototype.toJSON=function(){return this.C()};var Hr="auth/",zr={"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 Wr(t){var e=t[Yr];if(void 0===e)throw new qr("missing-continue-uri");if("string"!=typeof e||"string"==typeof e&&!e.length)throw new qr("invalid-continue-uri");this.h=e,this.b=this.a=null,this.g=!1;var n=t[Kr];if(n&&"object"==typeof n){e=n[$r];var r=n[Jr];if(n=n[Zr],"string"==typeof e&&e.length){if(this.a=e,void 0!==r&&"boolean"!=typeof r)throw new qr("argument-error",Jr+" property must be a boolean when specified.");if(this.g=!!r,void 0!==n&&("string"!=typeof n||"string"==typeof n&&!n.length))throw new qr("argument-error",Zr+" property must be a non empty string when specified.");this.b=n||null}else{if(void 0!==e)throw new qr("argument-error",$r+" property must be a non empty string when specified.");if(void 0!==r||void 0!==n)throw new qr("missing-android-pkg-name")}}else if(void 0!==n)throw new qr("argument-error",Kr+" property must be a non null object when specified.");if(this.f=null,(e=t[Xr])&&"object"==typeof e){if("string"==typeof(e=e[ti])&&e.length)this.f=e;else if(void 0!==e)throw new qr("argument-error",ti+" property must be a non empty string when specified.")}else if(void 0!==e)throw new qr("argument-error",Xr+" property must be a non null object when specified.");if(void 0!==(e=t[Qr])&&"boolean"!=typeof e)throw new qr("argument-error",Qr+" property must be a boolean when specified.");if(this.c=!!e,void 0!==(t=t[Gr])&&("string"!=typeof t||"string"==typeof t&&!t.length))throw new qr("argument-error",Gr+" property must be a non empty string when specified.");this.i=t||null}var Kr="android",Gr="dynamicLinkDomain",Qr="handleCodeInApp",Xr="iOS",Yr="url",Jr="installApp",Zr="minimumVersion",$r="packageName",ti="bundleId";function ei(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 ni=null,ri=null;function ii(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 oi(t){return(t=ai(t))&&t.sub&&t.iss&&t.aud&&t.exp?new ii(t):null}function ai(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(function(t){var e="";return function(t,e){function n(e){for(;r<t.length;){var n=t.charAt(r++),i=ri[n];if(null!=i)return i;if(!/^[\s\xa0]*$/.test(n))throw Error("Unknown base64 encoding at char: "+n)}return e}!function(){if(!ni){ni={},ri={};for(var t=0;65>t;t++)ni[t]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(t),ri[ni[t]]=t,62<=t&&(ri["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}(t))}catch(r){}return null}ii.prototype.f=function(){return this.b};var si,ui={$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 ci(t){for(var e in ui)if(ui[e].id===t)return{firebaseEndpoint:(t=ui[e]).ab,secureTokenEndpoint:t.ib};return null}si=ci("__EID__")?"__EID__":void 0;var li="oauth_consumer_key oauth_nonce oauth_signature oauth_signature_method oauth_timestamp oauth_token oauth_version".split(" "),hi=["client_id","response_type","scope","redirect_uri","state"],fi={Vc:{Ma:"locale",Ba:500,Aa:600,Na:"facebook.com",hb:hi},Xc:{Ma:null,Ba:500,Aa:620,Na:"github.com",hb:hi},Yc:{Ma:"hl",Ba:515,Aa:680,Na:"google.com",hb:hi},dd:{Ma:"lang",Ba:485,Aa:705,Na:"twitter.com",hb:li}};function pi(t){for(var e in fi)if(fi[e].Na==t)return fi[e];return null}function di(t){var e={};e["facebook.com"]=bi,e["google.com"]=_i,e["github.com"]=wi,e["twitter.com"]=Si;var n=t&&t[gi];try{if(n)return e[n]?new e[n](t):new vi(t);if(void 0!==t[yi])return new mi(t)}catch(r){}return null}var yi="idToken",gi="providerId";function mi(t){var e=t[gi];if(!e&&t[yi]){var n=oi(t[yi]);n&&n.a&&(e=n.a)}if(!e)throw Error("Invalid additional user info!");"anonymous"!=e&&"custom"!=e||(e=null),n=!1,void 0!==t.isNewUser?n=!!t.isNewUser:"identitytoolkit#SignupNewUserResponse"===t.kind&&(n=!0),Or(this,"providerId",e),Or(this,"isNewUser",n)}function vi(t){mi.call(this,t),Or(this,"profile",Nr((t=gr(t.rawUserInfo||"{}"))||{}))}function bi(t){if(vi.call(this,t),"facebook.com"!=this.providerId)throw Error("Invalid provider ID!")}function wi(t){if(vi.call(this,t),"github.com"!=this.providerId)throw Error("Invalid provider ID!");Or(this,"username",this.profile&&this.profile.login||null)}function _i(t){if(vi.call(this,t),"google.com"!=this.providerId)throw Error("Invalid provider ID!")}function Si(t){if(vi.call(this,t),"twitter.com"!=this.providerId)throw Error("Invalid provider ID!");Or(this,"username",t.screenName||null)}function Ei(t){this.a=Xe(t)}function Ti(t){var e=Xe(t),n=Qe(e,"link"),r=Qe(Xe(n),"link");return e=Qe(e,"deep_link_id"),Qe(Xe(e),"link")||e||r||n||t}function Ci(t,e){return t.then(function(t){if(t[oa]){var n=oi(t[oa]);if(!n||e!=n.c)throw new qr("user-mismatch");return t}throw new qr("user-mismatch")}).s(function(t){throw t&&t.code&&t.code==Hr+"user-not-found"?new qr("user-mismatch"):t})}function Ii(t,e){if(!e)throw new qr("internal-error","failed to construct a credential");this.a=e,Or(this,"providerId",t),Or(this,"signInMethod",t)}function Ai(t){return{pendingToken:t.a,requestUri:"http://localhost"}}function Oi(t,e,n){if(this.a=null,e.idToken||e.accessToken)e.idToken&&Or(this,"idToken",e.idToken),e.accessToken&&Or(this,"accessToken",e.accessToken),e.nonce&&!e.pendingToken&&Or(this,"nonce",e.nonce),e.pendingToken&&(this.a=e.pendingToken);else{if(!e.oauthToken||!e.oauthTokenSecret)throw new qr("internal-error","failed to construct a credential");Or(this,"accessToken",e.oauthToken),Or(this,"secret",e.oauthTokenSecret)}Or(this,"providerId",t),Or(this,"signInMethod",n)}function Di(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:un(e).toString(),requestUri:"http://localhost"},t.a&&(delete e.postBody,e.pendingToken=t.a),e}function ki(t,e){this.Dc=e||[],Dr(this,{providerId:t,isOAuthProvider:!0}),this.yb={},this.cb=(pi(t)||{}).Ma||null,this.$a=null}function Ni(t){if("string"!=typeof t||0!=t.indexOf("saml."))throw new qr("argument-error",'SAML provider IDs must be prefixed with "saml."');ki.call(this,t,[])}function Pi(t){ki.call(this,t,hi),this.a=[]}function Ri(){Pi.call(this,"facebook.com")}function xi(t){if(!t)throw new qr("argument-error","credential failed: expected 1 argument (the OAuth access token).");var e=t;return f(t)&&(e=t.accessToken),(new Ri).credential(null,e)}function Mi(){Pi.call(this,"github.com")}function ji(t){if(!t)throw new qr("argument-error","credential failed: expected 1 argument (the OAuth access token).");var e=t;return f(t)&&(e=t.accessToken),(new Mi).credential(null,e)}function Li(){Pi.call(this,"google.com"),this.ua("profile")}function Ui(t,e){var n=t;return f(t)&&(n=t.idToken,e=t.accessToken),(new Li).credential(n,e)}function Vi(){ki.call(this,"twitter.com",li)}function Fi(t,e){var n=t;if(f(n)||(n={oauthToken:t,oauthTokenSecret:e}),!n.oauthToken||!n.oauthTokenSecret)throw new qr("argument-error","credential failed: expected 2 arguments (the OAuth access token and secret).");return new Oi("twitter.com",n,"twitter.com")}function qi(t,e,n){this.a=t,this.c=e,Or(this,"providerId","password"),Or(this,"signInMethod",n===Bi.EMAIL_LINK_SIGN_IN_METHOD?Bi.EMAIL_LINK_SIGN_IN_METHOD:Bi.EMAIL_PASSWORD_SIGN_IN_METHOD)}function Bi(){Dr(this,{providerId:"password",isOAuthProvider:!1})}function Hi(t,e){if(!(e=zi(e)))throw new qr("argument-error","Invalid email link!");return new qi(t,e,Bi.EMAIL_LINK_SIGN_IN_METHOD)}function zi(t){var e=Qe((t=new Ei(t=Ti(t))).a,"oobCode")||null;return"signIn"===(Qe(t.a,"mode")||null)&&e?e:null}function Wi(t){if(!(t.Ta&&t.Sa||t.Fa&&t.$))throw new qr("internal-error");this.a=t,Or(this,"providerId","phone"),Or(this,"signInMethod","phone")}function Ki(t){return t.a.Fa&&t.a.$?{temporaryProof:t.a.Fa,phoneNumber:t.a.$}:{sessionInfo:t.a.Ta,code:t.a.Sa}}function Gi(t){try{this.a=t||l.a.auth()}catch(e){throw new qr("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().")}Dr(this,{providerId:"phone",isOAuthProvider:!1})}function Qi(t,e){if(!t)throw new qr("missing-verification-id");if(!e)throw new qr("missing-verification-code");return new Wi({Ta:t,Sa:e})}function Xi(t){if(t.temporaryProof&&t.phoneNumber)return new Wi({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 Ui(o,n);case"facebook.com":return xi(n);case"github.com":return ji(n);case"twitter.com":return Fi(n,r);default:return n||r||o||a?a?0==e.indexOf("saml.")?new Ii(e,a):new Oi(e,{pendingToken:a,idToken:t.oauthIdToken,accessToken:t.oauthAccessToken},e):new Pi(e).credential(o,n,i):null}}catch(s){return null}}function Yi(t){if(!t.isOAuthProvider)throw new qr("invalid-oauth-provider")}function Ji(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 qr("invalid-auth-event");if(this.f&&this.a)throw new qr("invalid-auth-event");if(this.f&&!this.g)throw new qr("invalid-auth-event")}function Zi(t){return(t=t||{}).type?new Ji(t.type,t.eventId,t.urlResponse,t.sessionId,t.error&&Br(t.error),t.postBody):null}function $i(){this.b=null,this.a=[]}w(vi,mi),w(bi,vi),w(wi,vi),w(_i,vi),w(Si,vi),Ii.prototype.la=function(t){return Ea(t,Ai(this))},Ii.prototype.b=function(t,e){var n=Ai(this);return n.idToken=e,Ta(t,n)},Ii.prototype.f=function(t,e){return Ci(Ca(t,Ai(this)),e)},Ii.prototype.C=function(){return{providerId:this.providerId,signInMethod:this.signInMethod,pendingToken:this.a}},Oi.prototype.la=function(t){return Ea(t,Di(this))},Oi.prototype.b=function(t,e){var n=Di(this);return n.idToken=e,Ta(t,n)},Oi.prototype.f=function(t,e){return Ci(Ca(t,Di(this)),e)},Oi.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},ki.prototype.Da=function(t){return this.yb=ot(t),this},w(Ni,ki),w(Pi,ki),Pi.prototype.ua=function(t){return j(this.a,t)||this.a.push(t),this},Pi.prototype.Eb=function(){return F(this.a)},Pi.prototype.credential=function(t,e,n){if(!t&&!e)throw new qr("argument-error","credential failed: must provide the ID token and/or the access token.");return new Oi(this.providerId,{idToken:t||null,accessToken:e||null,nonce:n||null},this.providerId)},w(Ri,Pi),Or(Ri,"PROVIDER_ID","facebook.com"),Or(Ri,"FACEBOOK_SIGN_IN_METHOD","facebook.com"),w(Mi,Pi),Or(Mi,"PROVIDER_ID","github.com"),Or(Mi,"GITHUB_SIGN_IN_METHOD","github.com"),w(Li,Pi),Or(Li,"PROVIDER_ID","google.com"),Or(Li,"GOOGLE_SIGN_IN_METHOD","google.com"),w(Vi,ki),Or(Vi,"PROVIDER_ID","twitter.com"),Or(Vi,"TWITTER_SIGN_IN_METHOD","twitter.com"),qi.prototype.la=function(t){return this.signInMethod==Bi.EMAIL_LINK_SIGN_IN_METHOD?ts(t,Ra,{email:this.a,oobCode:this.c}):ts(t,Ya,{email:this.a,password:this.c})},qi.prototype.b=function(t,e){return this.signInMethod==Bi.EMAIL_LINK_SIGN_IN_METHOD?ts(t,xa,{idToken:e,email:this.a,oobCode:this.c}):ts(t,za,{idToken:e,email:this.a,password:this.c})},qi.prototype.f=function(t,e){return Ci(this.la(t),e)},qi.prototype.C=function(){return{email:this.a,password:this.c,signInMethod:this.signInMethod}},Dr(Bi,{PROVIDER_ID:"password"}),Dr(Bi,{EMAIL_LINK_SIGN_IN_METHOD:"emailLink"}),Dr(Bi,{EMAIL_PASSWORD_SIGN_IN_METHOD:"password"}),Wi.prototype.la=function(t){return t.Ua(Ki(this))},Wi.prototype.b=function(t,e){var n=Ki(this);return n.idToken=e,ts(t,Za,n)},Wi.prototype.f=function(t,e){var n=Ki(this);return n.operation="REAUTH",Ci(t=ts(t,$a,n),e)},Wi.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},Gi.prototype.Ua=function(t,e){var n=this.a.b;return St(e.verify()).then(function(i){if(!r(i))throw new qr("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 ts(n,Ba,e)}(0,{phoneNumber:t,recaptchaToken:i}).then(function(t){return"function"==typeof e.reset&&e.reset(),t},function(t){throw"function"==typeof e.reset&&e.reset(),t});default:throw new qr("argument-error",'Only firebase.auth.ApplicationVerifiers with type="recaptcha" are currently supported.')}})},Dr(Gi,{PROVIDER_ID:"phone"}),Dr(Gi,{PHONE_SIGN_IN_METHOD:"phone"}),Ji.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 to,eo=null;function no(t){var e="unauthorized-domain",n=void 0,r=Xe(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",qr.call(this,e,n)}function ro(t,e,n){qr.call(this,t,n),(t=e||{}).zb&&Or(this,"email",t.zb),t.$&&Or(this,"phoneNumber",t.$),t.credential&&Or(this,"credential",t.credential)}function io(t){if(t.code){var e=t.code||"";0==e.indexOf(Hr)&&(e=e.substring(Hr.length));var n={credential:Xi(t)};if(t.email)n.zb=t.email;else if(t.phoneNumber)n.$=t.phoneNumber;else if(!n.credential)return new qr(e,t.message||void 0);return new ro(e,n,t.message)}return null}function oo(){}function ao(){}function so(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 uo(){}function co(){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 lo(t,e){t.readyState=e,t.onreadystatechange&&t.onreadystatechange()}function ho(t,e,n){this.reset(t,e,n,void 0,void 0)}function fo(t){this.f=t,this.b=this.c=this.a=null}function po(t,e){this.name=t,this.value=e}$i.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=ur("universalLinks.subscribe",n))&&t(null,this.b))},$i.prototype.unsubscribe=function(t){U(this.a,function(e){return e==t})},w(no,qr),w(ro,qr),ro.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&&ct(t,e),t},ro.prototype.toJSON=function(){return this.C()},oo.prototype.c=null,w(ao,oo),ao.prototype.a=function(){var t=so(this);return t?new ActiveXObject(t):new XMLHttpRequest},ao.prototype.b=function(){var t={};return so(this)&&(t[0]=!0,t[1]=!0),t},to=new ao,w(uo,oo),uo.prototype.a=function(){var t=new XMLHttpRequest;if("withCredentials"in t)return t;if("undefined"!=typeof XDomainRequest)return new co;throw Error("Unsupported browser")},uo.prototype.b=function(){return{}},(t=co.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,lo(this,4)},t.Fb=function(){this.status=500,this.responseText="",lo(this,4)},t.ic=function(){this.Fb()},t.fc=function(){this.status=200,lo(this,1)},t.getAllResponseHeaders=function(){return"content-type: "+this.a.contentType},ho.prototype.a=null,ho.prototype.reset=function(t,e,n,r,i){r||b(),delete this.a},po.prototype.toString=function(){return this.name};var yo=new po("SEVERE",1e3),go=new po("WARNING",900),mo=new po("CONFIG",700),vo=new po("FINE",500);fo.prototype.log=function(t,e,n){if(t.value>=function t(e){return e.c?e.c:e.a?t(e.a):(C("Root logger has no level set."),null)}(this).value)for(h(e)&&(e=e()),t=new ho(t,String(e),this.f),n&&(t.a=n),n=this;n;)n=n.a};var bo={},wo=null;function _o(t){var e;if(wo||(wo=new fo(""),bo[""]=wo,wo.c=mo),!(e=bo[t])){e=new fo(t);var n=t.lastIndexOf("."),r=t.substr(n+1);(n=_o(t.substr(0,n))).b||(n.b={}),n.b[r]=e,e.a=n,bo[t]=e}return e}function So(t,e){t&&t.log(vo,e,void 0)}function Eo(t){this.f=t}function To(t){Ne.call(this),this.i=t,this.readyState=Co,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=_o("goog.net.FetchXmlHttp")}w(Eo,oo),Eo.prototype.a=function(){return new To(this.f)},Eo.prototype.b=function(t){return function(){return t}}({}),w(To,Ne);var Co=0;function Io(t){t.onreadystatechange&&t.onreadystatechange.call(t)}function Ao(t){Ne.call(this),this.headers=new Ve,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=Oo,this.v=this.O=!1}(t=To.prototype).open=function(t,e){if(this.readyState!=Co)throw this.abort(),Error("Error reopening a connection");this.h=t,this.c=e,this.readyState=1,Io(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,Io(this)),this.readyState=Co},t.hc=function(t){this.a&&(this.b||(this.b=t.headers,this.readyState=2,Io(this)),this.a&&(this.readyState=3,Io(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,Io(this))},t.Gb=function(t){var e=this.f;e&&e.log(go,"Failed to fetch url "+this.c,t instanceof Error?t:Error(t)),this.a&&(this.readyState=4,Io(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(go,"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(go,"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;)t.push((n=n.value)[0]+": "+n[1]),n=e.next();return t.join("\r\n")},w(Ao,Ne);var Oo="";Ao.prototype.b=_o("goog.net.XhrIo");var Do=/^https?$/i,ko=["POST","PUT"];function No(t){return"content-type"==t.toLowerCase()}function Po(t,e){t.c=!1,t.a&&(t.f=!0,t.a.abort(),t.f=!1),t.h=e,Ro(t),Mo(t)}function Ro(t){t.G||(t.G=!0,t.dispatchEvent("complete"),t.dispatchEvent("error"))}function xo(t){if(t.c&&void 0!==e)if(t.w[1]&&4==Lo(t)&&2==Uo(t))So(t.b,Vo(t,"Local request error detected and ignored"));else if(t.i&&4==Lo(t))Me(t.Jb,0,t);else if(t.dispatchEvent("readystatechange"),4==Lo(t)){So(t.b,Vo(t,"Request complete")),t.c=!1;try{var r,i=Uo(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=!Do.test(s?s.toLowerCase():"")}r=a}if(r)t.dispatchEvent("complete"),t.dispatchEvent("success");else{try{var c=2<Lo(t)?t.a.statusText:""}catch(l){So(t.b,"Can not get status: "+l.message),c=""}t.h=c+" ["+Uo(t)+"]",Ro(t)}}finally{Mo(t)}}}function Mo(t,e){if(t.a){jo(t);var n=t.a,r=t.w[0]?o:null;t.a=null,t.w=null,e||t.dispatchEvent("ready");try{n.onreadystatechange=r}catch(i){(t=t.b)&&t.log(yo,"Problem encountered resetting onreadystatechange: "+i.message,void 0)}}}function jo(t){t.a&&t.v&&(t.a.ontimeout=null),t.u&&(n.clearTimeout(t.u),t.u=null)}function Lo(t){return t.a?t.a.readyState:0}function Uo(t){try{return 2<Lo(t)?t.a.status:-1}catch(e){return-1}}function Vo(t,e){return e+" ["+t.N+" "+t.m+" "+Uo(t)+"]"}function Fo(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,Wo(t)}function Bo(t){if(t.a){if(!t.m)throw new Ko(t);t.m=!1}}function Ho(t,e,n,r){t.g.push([e,n,r]),t.a&&Wo(t)}function zo(t){return M(t.g,function(t){return h(t[1])})}function Wo(t){if(t.h&&t.a&&zo(t)){var e=t.h,r=Xo[e];r&&(n.clearTimeout(r.a),delete Xo[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,zo(t)||(r=!0)}}t.c=e,i&&(u=m(t.o,t,!0),i=m(t.o,t,!1),e instanceof Fo?(Ho(e,u,i),e.w=!0):e.then(u,i)),r&&(e=new Qo(e),Xo[e.a]=e,t.h=e.a)}function Ko(){E.call(this)}function Go(){E.call(this)}function Qo(t){this.a=n.setTimeout(m(this.c,this),0),this.b=t}(t=Ao.prototype).Ga=function(){void 0!==e&&this.a&&(this.h="Timed out after "+this.g+"ms, aborting",So(this.b,Vo(this,this.h)),this.dispatchEvent("timeout"),this.abort(8))},t.abort=function(){this.a&&this.c&&(So(this.b,Vo(this,"Aborting")),this.c=!1,this.f=!0,this.a.abort(),this.f=!1,this.dispatchEvent("complete"),this.dispatchEvent("abort"),Mo(this))},t.va=function(){this.a&&(this.c&&(this.c=!1,this.f=!0,this.a.abort(),this.f=!1),Mo(this,!0)),Ao.ob.va.call(this)},t.Jb=function(){this.qa||(this.I||this.i||this.f?xo(this):this.wc())},t.wc=function(){xo(this)},t.getResponse=function(){try{if(!this.a)return null;if("response"in this.a)return this.a.response;switch(this.o){case Oo: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(yo,"Response type "+this.o+" is not supported on this browser",void 0),null}catch(e){return So(this.b,"Can not get response: "+e.message),null}},Fo.prototype.cancel=function(t){if(this.a)this.c instanceof Fo&&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 Go(this),Bo(this),qo(this,!1,t))}},Fo.prototype.o=function(t,e){this.i=!1,qo(this,t,e)},Fo.prototype.D=function(){Bo(this),qo(this,!0,null)},Fo.prototype.then=function(t,e,n){var r,i,o=new yt(function(t,e){r=t,i=e});return Ho(this,r,function(t){t instanceof Go?o.cancel():i(t)}),o.then(t,e,n)},_(Fo),w(Ko,E),Ko.prototype.message="Deferred has already fired",Ko.prototype.name="AlreadyCalledError",w(Go,E),Go.prototype.message="Deferred was canceled",Go.prototype.name="CanceledError",Qo.prototype.c=function(){throw delete Xo[this.a],this.b};var Xo={};function Yo(t){var e={},n=e.document||document,r=bn(t),i=document.createElement("SCRIPT"),o={Lb:i,Ga:void 0},a=new Fo(Jo,o),s=null,u=null!=e.timeout?e.timeout:5e3;return 0<u&&(s=window.setTimeout(function(){Zo(i,!0);var t=new ea(ta,"Timeout reached for loading script "+r);Bo(a),qo(a,!1,t)},u),o.Ga=s),i.onload=i.onreadystatechange=function(){i.readyState&&"loaded"!=i.readyState&&"complete"!=i.readyState||(Zo(i,e.fd||!1,s),a.D())},i.onerror=function(){Zo(i,!0,s);var t=new ea($o,"Error while loading script "+r);Bo(a),qo(a,!1,t)},ct(o=e.attributes||{},{type:"text/javascript",charset:"UTF-8"}),xn(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 Jo(){if(this&&this.Lb){var t=this.Lb;t&&"SCRIPT"==t.tagName&&Zo(t,!0,this.Ga)}}function Zo(t,e,r){null!=r&&n.clearTimeout(r),t.onload=o,t.onerror=o,t.onreadystatechange=o,e&&window.setTimeout(function(){t&&t.parentNode&&t.parentNode.removeChild(t)},0)}var $o=0,ta=1;function ea(t,e){var n="Jsloader error (code #"+t+")";e&&(n+=": "+e),E.call(this,n),this.code=t}function na(t){this.f=t}function ra(t,e,r){if(this.b=t,this.i=(t=e||{}).secureTokenEndpoint||"https://securetoken.googleapis.com/v1/token",this.l=t.secureTokenTimeout||aa,this.f=ot(t.secureTokenHeaders||sa),this.g=t.firebaseEndpoint||"https://www.googleapis.com/identitytoolkit/v3/relyingparty/",this.h=t.firebaseTimeout||ua,this.a=ot(t.firebaseHeaders||ca),r&&(this.a["X-Client-Version"]=r,this.f["X-Client-Version"]=r),r="Node"==tr(),!(r=n.XMLHttpRequest||r&&l.a.INTERNAL.node&&l.a.INTERNAL.node.XMLHttpRequest)&&!$n())throw new qr("internal-error","The XMLHttpRequest compatibility library was not found.");this.c=void 0,this.c=$n()?new Eo(self):er()?new na(r):new uo}w(ea,E),w(na,oo),na.prototype.a=function(){return new this.f},na.prototype.b=function(){return{}};var ia,oa="idToken",aa=new wr(3e4,6e4),sa={"Content-Type":"application/x-www-form-urlencoded"},ua=new wr(3e4,6e4),ca={"Content-Type":"application/json"};function la(t,e){e?t.a["X-Firebase-Locale"]=e:delete t.a["X-Firebase-Locale"]}function ha(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 fa(t,e,r,i,o,a,s){(function(){var t=sr();return!((t=ir(t)!=rr?null:(t=t.match(/\sChrome\/(\d+)/i))&&2==t.length?parseInt(t[1],10):null)&&30>t||zt&&$t&&!(9<$t))})()||$n()?t=m(t.o,t):(ia||(ia=new yt(function(t,e){!function(t,e){if(((window.gapi||{}).client||{}).request)t();else{n[da]=function(){((window.gapi||{}).client||{}).request?t():e(Error("CORS_UNSUPPORTED"))};var r=wn(pa,{onload:da});!function(t,e){Ho(Yo(r),null,e,void 0)}(0,function(){e(Error("CORS_UNSUPPORTED"))})}}(t,e)})),t=m(t.m,t)),t(e,r,i,o,a,s)}ra.prototype.o=function(t,e,i,o,a,s){if($n()&&(void 0===n.fetch||void 0===n.Headers||void 0===n.Request))throw new qr("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 u=new Ao(this.c);if(s){u.g=Math.max(0,s);var l=setTimeout(function(){u.dispatchEvent("timeout")},s)}Pe(u,"complete",function(){l&&clearTimeout(l);var t=null;try{t=JSON.parse(function(t){try{return t.a?t.a.responseText:""}catch(e){return So(t.b,"Can not get responseText: "+e.message),""}}(this))||null}catch(n){t=null}e&&e(t)}),Re(u,"ready",function(){l&&clearTimeout(l),Vt(this)}),Re(u,"timeout",function(){l&&clearTimeout(l),Vt(this),e&&e(null)}),function(t,e,i,o,a){if(t.a)throw Error("[goog.net.XhrIo] Object is active with another request="+t.m+"; newUri="+e);i=i?i.toUpperCase():"GET",t.m=e,t.h="",t.N=i,t.G=!1,t.c=!0,t.a=t.D?t.D.a():to.a(),t.w=function(t){return t.c||(t.c=t.b())}(t.D?t.D:to),t.a.onreadystatechange=m(t.Jb,t);try{So(t.b,Vo(t,"Opening Xhr")),t.I=!0,t.a.open(i,String(e),!0),t.I=!1}catch(u){return So(t.b,Vo(t,"Error opening Xhr: "+u.message)),void Po(t,u)}e=o||"";var s=new Ve(t.headers);a&&function(t,e){if(t.forEach&&"function"==typeof t.forEach)t.forEach(e,void 0);else if(c(t)||r(t))R(t,e,void 0);else for(var n=Ue(t),i=Le(t),o=i.length,a=0;a<o;a++)e.call(void 0,i[a],n&&n[a],t)}(a,function(t,e){s.set(e,t)}),a=function(t){t:{for(var e=No,n=t.length,i=r(t)?t.split(""):t,o=0;o<n;o++)if(o in i&&e.call(void 0,i[o],o,t)){e=o;break t}e=-1}return 0>e?null:r(t)?t.charAt(e):t[e]}(s.U()),o=n.FormData&&e instanceof n.FormData,!j(ko,i)||a||o||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{jo(t),0<t.g&&(t.v=function(t){return zt&&ee(9)&&"number"==typeof t.timeout&&void 0!==t.ontimeout}(t.a),So(t.b,Vo(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)),So(t.b,Vo(t,"Sending request")),t.i=!0,t.a.send(e),t.i=!1}catch(u){So(t.b,Vo(t,"Send error: "+u.message)),Po(t,u)}}(u,t,i,o,a)};var pa=mn("https://apis.google.com/js/client.js?onload=%{onload}"),da="__fcb"+Math.floor(1e6*Math.random()).toString();function ya(t){if(!r(t=t.email)||!Xn.test(t))throw new qr("invalid-email")}function ga(t){"email"in t&&ya(t)}function ma(t){if(!t[oa])throw new qr("internal-error")}function va(t){if(t.phoneNumber||t.temporaryProof){if(!t.phoneNumber||!t.temporaryProof)throw new qr("internal-error")}else{if(!t.sessionInfo)throw new qr("missing-verification-id");if(!t.code)throw new qr("missing-verification-code")}}ra.prototype.m=function(t,e,n,r,i){var o=this;ia.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"}})})},ra.prototype.Qa=function(){return ts(this,Wa,{})},ra.prototype.pb=function(t,e){return ts(this,Ha,{idToken:t,email:e})},ra.prototype.qb=function(t,e){return ts(this,za,{idToken:t,password:e})};var ba={displayName:"DISPLAY_NAME",photoUrl:"PHOTO_URL"};function wa(t){if(!t.requestUri||!t.sessionId&&!t.postBody&&!t.pendingToken)throw new qr("internal-error")}function _a(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 an(t.postBody),"nonce")&&(e.nonce=t.get("nonce"))),e}function Sa(t){var e=null;if(t.needConfirmation?(t.code="account-exists-with-different-credential",e=io(t)):"FEDERATED_USER_ID_ALREADY_LINKED"==t.errorMessage?(t.code="credential-already-in-use",e=io(t)):"EMAIL_EXISTS"==t.errorMessage?(t.code="email-already-in-use",e=io(t)):t.errorMessage&&(e=es(t.errorMessage)),e)throw e;if(!t[oa])throw new qr("internal-error")}function Ea(t,e){return e.returnIdpCredential=!0,ts(t,Ka,e)}function Ta(t,e){return e.returnIdpCredential=!0,ts(t,Qa,e)}function Ca(t,e){return e.returnIdpCredential=!0,e.autoCreate=!1,ts(t,Ga,e)}function Ia(t){if(!t.oobCode)throw new qr("invalid-action-code")}(t=ra.prototype).rb=function(t,e){var n={idToken:t},r=[];return rt(ba,function(t,i){var o=e[i];null===o?r.push(t):i in e&&(n[i]=o)}),r.length&&(n.deleteAttribute=r),ts(this,Ha,n)},t.kb=function(t,e){return ct(t={requestType:"PASSWORD_RESET",email:t},e),ts(this,Ua,t)},t.lb=function(t,e){return ct(t={requestType:"EMAIL_SIGNIN",email:t},e),ts(this,ja,t)},t.jb=function(t,e){return ct(t={requestType:"VERIFY_EMAIL",idToken:t},e),ts(this,La,t)},t.Ua=function(t){return ts(this,Ja,t)},t.Za=function(t,e){return ts(this,qa,{oobCode:t,newPassword:e})},t.Ja=function(t){return ts(this,Oa,{oobCode:t})},t.Wa=function(t){return ts(this,Aa,{oobCode:t})};var Aa={endpoint:"setAccountInfo",B:Ia,da:"email"},Oa={endpoint:"resetPassword",B:Ia,J:function(t){var e=t.requestType;if(!e||!t.email&&"EMAIL_SIGNIN"!=e)throw new qr("internal-error")}},Da={endpoint:"signupNewUser",B:function(t){if(ya(t),!t.password)throw new qr("weak-password")},J:ma,R:!0},ka={endpoint:"createAuthUri"},Na={endpoint:"deleteAccount",T:["idToken"]},Pa={endpoint:"setAccountInfo",T:["idToken","deleteProvider"],B:function(t){if(!u(t.deleteProvider))throw new qr("internal-error")}},Ra={endpoint:"emailLinkSignin",T:["email","oobCode"],B:ya,J:ma,R:!0},xa={endpoint:"emailLinkSignin",T:["idToken","email","oobCode"],B:ya,J:ma,R:!0},Ma={endpoint:"getAccountInfo"},ja={endpoint:"getOobConfirmationCode",T:["requestType"],B:function(t){if("EMAIL_SIGNIN"!=t.requestType)throw new qr("internal-error");ya(t)},da:"email"},La={endpoint:"getOobConfirmationCode",T:["idToken","requestType"],B:function(t){if("VERIFY_EMAIL"!=t.requestType)throw new qr("internal-error")},da:"email"},Ua={endpoint:"getOobConfirmationCode",T:["requestType"],B:function(t){if("PASSWORD_RESET"!=t.requestType)throw new qr("internal-error");ya(t)},da:"email"},Va={ub:!0,endpoint:"getProjectConfig",Ib:"GET"},Fa={ub:!0,endpoint:"getRecaptchaParam",Ib:"GET",J:function(t){if(!t.recaptchaSiteKey)throw new qr("internal-error")}},qa={endpoint:"resetPassword",B:Ia,da:"email"},Ba={endpoint:"sendVerificationCode",T:["phoneNumber","recaptchaToken"],da:"sessionInfo"},Ha={endpoint:"setAccountInfo",T:["idToken"],B:ga,R:!0},za={endpoint:"setAccountInfo",T:["idToken"],B:function(t){if(ga(t),!t.password)throw new qr("weak-password")},J:ma,R:!0},Wa={endpoint:"signupNewUser",J:ma,R:!0},Ka={endpoint:"verifyAssertion",B:wa,Oa:_a,J:Sa,R:!0},Ga={endpoint:"verifyAssertion",B:wa,Oa:_a,J:function(t){if(t.errorMessage&&"USER_NOT_FOUND"==t.errorMessage)throw new qr("user-not-found");if(t.errorMessage)throw es(t.errorMessage);if(!t[oa])throw new qr("internal-error")},R:!0},Qa={endpoint:"verifyAssertion",B:function(t){if(wa(t),!t.idToken)throw new qr("internal-error")},Oa:_a,J:Sa,R:!0},Xa={endpoint:"verifyCustomToken",B:function(t){if(!t.token)throw new qr("invalid-custom-token")},J:ma,R:!0},Ya={endpoint:"verifyPassword",B:function(t){if(ya(t),!t.password)throw new qr("wrong-password")},J:ma,R:!0},Ja={endpoint:"verifyPhoneNumber",B:va,J:ma},Za={endpoint:"verifyPhoneNumber",B:function(t){if(!t.idToken)throw new qr("internal-error");va(t)},J:function(t){if(t.temporaryProof)throw t.code="credential-already-in-use",io(t);ma(t)}},$a={Xb:{USER_NOT_FOUND:"user-not-found"},endpoint:"verifyPhoneNumber",B:va,J:ma};function ts(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(null==r||""===r)return!1}return!0}(n,e.T))return Et(new qr("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=Xe(t.g+e);Ge(a,"key",t.b),o&&Ge(a,"cb",b().toString());var s="GET"==n;if(s)for(var u in r)r.hasOwnProperty(u)&&Ge(a,u,r[u]);return new yt(function(e,o){fa(t,a.toString(),function(t){t?t.error?o(ns(t,i||{})):e(t):o(new qr("network-request-failed"))},n,s?void 0:Ln(yr(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 qr("internal-error");return r[e.da]})}function es(t){return ns({error:{errors:[{message:t}],code:400,message:t}})}function ns(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 qr(r[n]):null)return n;for(var i in n=t.error&&t.error.message||"",ct(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 qr(r[i],e);return!e&&t&&(e=dr(t)),new qr("internal-error",e)}function rs(t){this.b=t,this.a=null,this.fb=function(t){return(ss||(ss=new yt(function(t,e){function r(){br(),ur("gapi.load")("gapi.iframes",{callback:t,ontimeout:function(){br(),e(Error("Network Error"))},timeout:os.get()})}if(ur("gapi.iframes.Iframe"))t();else if(ur("gapi.load"))r();else{var i="__iframefcb"+Math.floor(1e6*Math.random()).toString();n[i]=function(){ur("gapi.load")?r():e(Error("Network Error"))},St(Yo(i=wn(is,{onload:i}))).s(function(){e(Error("Network Error"))})}}).s(function(t){throw ss=null,t}))).then(function(){return new yt(function(e,n){ur("gapi.iframes.getContext")().open({where:document.body,url:t.b,messageHandlersFilter:ur("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"))},as.get());r.ping(i).then(i,function(){n(Error("Network Error"))})})})})}(this)}var is=mn("https://apis.google.com/js/api.js?onload=%{onload}"),os=new wr(3e4,6e4),as=new wr(5e3,15e3),ss=null;function us(t,e,n){this.i=t,this.g=e,this.h=n,this.f=null,this.a=Ye(this.i,"/__/auth/iframe"),Ge(this.a,"apiKey",this.g),Ge(this.a,"appName",this.h),this.b=null,this.c=[]}function cs(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 ls(t){try{return l.a.app(t).auth().ya()}catch(e){return[]}}function hs(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 fs(t){var e=Hn();return function(t){return ts(t,Va,{}).then(function(t){return t.authorizedDomains||[]})}(t).then(function(t){t:{var n=Xe(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=Xe(o).b==a&&"chrome-extension"==s:"http"!=s&&"https"!=s?a=!1:Qn.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 no(Hn())})}function ps(t){return t.l?t.l:(t.l=Yn().then(function(){if(!t.u){var e=t.c,n=t.h,r=ls(t.b),i=new us(t.m,t.f,t.b);i.f=e,i.b=n,i.c=F(r||[]),t.u=i.toString()}t.i=new rs(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,ur("gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER"))})}(t.i,function(e){var n={};if(e&&e.authEvent){var r=!1;for(e=Zi(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 ds(t){return t.o||(t.v=t.c?ar(t.c,ls(t.b)):null,t.o=new ra(t.f,ci(t.h),t.v)),t.o}function ys(t,e,n,r,i,o,a,s,u,c){return(t=new cs(t,e,n,r,i)).i=o,t.g=a,t.h=s,t.b=ot(u||null),t.f=c,t.toString()}function gs(t){if(this.a=t||l.a.INTERNAL.reactNative&&l.a.INTERNAL.reactNative.AsyncStorage,!this.a)throw new qr("internal-error","The React Native compatibility library was not found.");this.type="asyncStorage"}function ms(t){this.b=t,this.a={},this.c=m(this.f,this)}us.prototype.toString=function(){return this.f?Ge(this.a,"v",this.f):cn(this.a.a,"v"),this.b?Ge(this.a,"eid",this.b):cn(this.a.a,"eid"),this.c.length?Ge(this.a,"fw",this.c.join(",")):cn(this.a.a,"fw"),this.a.toString()},cs.prototype.toString=function(){var t=Ye(this.o,"/__/auth/handler");if(Ge(t,"apiKey",this.m),Ge(t,"appName",this.c),Ge(t,"authType",this.l),this.a.isOAuthProvider){var e=this.a;try{var n=l.a.app(this.c).auth().ea()}catch(s){n=null}for(var r in e.$a=n,Ge(t,"providerId",this.a.providerId),n=yr((e=this.a).yb))n[r]=n[r].toString();r=e.Dc,n=ot(n);for(var i=0;i<r.length;i++){var o=r[i];o in n&&delete n[o]}e.cb&&e.$a&&!n[e.cb]&&(n[e.cb]=e.$a),it(n)||Ge(t,"customParameters",dr(n))}if("function"==typeof this.a.Eb&&(e=this.a.Eb()).length&&Ge(t,"scopes",e.join(",")),this.i?Ge(t,"redirectUrl",this.i):cn(t.a,"redirectUrl"),this.g?Ge(t,"eventId",this.g):cn(t.a,"eventId"),this.h?Ge(t,"v",this.h):cn(t.a,"v"),this.b)for(var a in this.b)this.b.hasOwnProperty(a)&&!Qe(t,a)&&Ge(t,a,this.b[a]);return this.f?Ge(t,"eid",this.f):cn(t.a,"eid"),(a=ls(this.c)).length&&Ge(t,"fw",a.join(",")),t.toString()},(t=hs.prototype).Ea=function(t,e,n){var r=new qr("popup-closed-by-user"),i=new qr("web-storage-unsupported"),o=this,a=!1;return this.ga().then(function(){(function(t){var e={type:"webStorageSupport"};return ps(t).then(function(){return function(t,e){return t.fb.then(function(){return new yt(function(n){t.a.send(e.type,e,n,ur("gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER"))})})}(t.i,e)}).then(function(t){if(t&&t.length&&void 0!==t[0].webStorageSupport)return t[0].webStorageSupport;throw Error()})})(o).then(function(n){n||(t&&Kn(t),e(i),a=!0)})}).s(function(){}).then(function(){if(!a)return function(t){return new yt(function(e){return function n(){je(2e3).then(function(){if(t&&!t.closed)return n();e()})}()})}(t)}).then(function(){if(!a)return je(n).then(function(){e(r)})})},t.Mb=function(){var t=sr();return!pr(t)&&!vr(t)},t.Hb=function(){return!1},t.Cb=function(t,e,n,r,i,o,a){if(!t)return Et(new qr("popup-blocked"));if(a&&!pr())return this.ga().s(function(e){Kn(t),i(e)}),r(),St();this.a||(this.a=fs(ds(this)));var s=this;return this.a.then(function(){var e=s.ga().s(function(e){throw Kn(t),i(e),e});return r(),e}).then(function(){Yi(n),a||zn(ys(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=fs(ds(this)));var r=this;return this.a.then(function(){Yi(e),zn(ys(r.m,r.f,r.b,t,e,Hn(),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 ps(this).then(function(){return t.i.fb}).s(function(){throw t.a=null,new qr("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=gs.prototype).get=function(t){return St(this.a.getItem(t)).then(function(t){return t&&gr(t)})},t.set=function(t,e){return St(this.a.setItem(t,dr(e)))},t.P=function(t){return St(this.a.removeItem(t))},t.Y=function(){},t.ca=function(){};var vs,bs=[];function ws(t){this.a=t}function _s(t){this.c=t,this.b=!1,this.a=[]}function Ss(t,e,n,r){var i,o,a,s,u=n||{},c=null;if(t.b)return Et(Error("connection_unavailable"));var l=r?800:50,h="undefined"!=typeof MessageChannel?new MessageChannel:null;return new yt(function(n,r){h?(i=Math.floor(Math.random()*Math.pow(10,20)).toString(),h.port1.start(),a=setTimeout(function(){r(Error("unsupported_event"))},l),t.a.push(c={messageChannel:h,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),void 0!==t.data.response?n(t.data.response):r(Error("unknown_error"))):(clearTimeout(a),clearTimeout(s),r(Error("invalid_response"))))}}),h.port1.addEventListener("message",o),t.c.postMessage({eventType:e,eventId:i,data:u},[h.port2])):r(Error("connection_unavailable"))}).then(function(e){return Es(t,c),e}).s(function(e){throw Es(t,c),e})}function Es(t,e){if(e){var n=e.messageChannel;n&&(n.port1.removeEventListener("message",e.onMessage),n.port1.close()),U(t.a,function(t){return t==e})}}function Ts(){if(!Is())throw new qr("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;$n()&&self?(this.l=function(){var t=$n()?self:null;if(R(bs,function(n){n.b==t&&(e=n)}),!e){var e=new ms(t);bs.push(e)}return e}(),this.l.subscribe("keyChanged",function(e,n){return Ns(t).then(function(e){return 0<e.length&&R(t.a,function(t){t(e)}),{keyProcessed:j(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 _s(new ws(e)),Ss(t.g,"ping",null,!0).then(function(e){e[0].fulfilled&&j(e[0].value,"keyChanged")&&(t.u=!0)}).s(function(){}))})}function Cs(t){return t.o||(t.o=function t(e){return new yt(function(n,r){var i=e.m.open("firebaseLocalStorageDb",1);i.onerror=function(t){try{t.preventDefault()}catch(e){}r(Error(t.target.error))},i.onupgradeneeded=function(t){t=t.target.result;try{t.createObjectStore("firebaseLocalStorage",{keyPath:"fbase_key"})}catch(e){r(e)}},i.onsuccess=function(i){(i=i.target.result).objectStoreNames.contains("firebaseLocalStorage")?n(i):function(t){return new yt(function(e,n){var r=t.m.deleteDatabase("firebaseLocalStorageDb");r.onsuccess=function(){e()},r.onerror=function(t){n(Error(t.target.error))}})}(e).then(function(){return t(e)}).then(function(t){n(t)}).s(function(t){r(t)})}})}(t)),t.o}function Is(){try{return!!n.indexedDB}catch(Bt){return!1}}function As(t){return t.objectStore("firebaseLocalStorage")}function Os(t,e){return t.transaction(["firebaseLocalStorage"],e?"readwrite":"readonly")}function Ds(t){return new yt(function(e,n){t.onsuccess=function(t){t&&t.target?e(t.target.result):e()},t.onerror=function(t){n(t.target.error)}})}function ks(t,e){return t.g&&t.h&&function(){var t=n.navigator;return t&&t.serviceWorker&&t.serviceWorker.controller||null}()===t.h?Ss(t.g,"keyChanged",{key:e},t.u).then(function(){}).s(function(){}):St()}function Ns(t){return Cs(t).then(function(t){var e=As(Os(t,!1));return e.getAll?Ds(e.getAll()):new yt(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,i=[];for(r in e)r in n?typeof e[r]!=typeof n[r]?i.push(r):"object"==typeof e[r]&&null!=e[r]&&null!=n[r]?0<t(e[r],n[r]).length&&i.push(r):e[r]!==n[r]&&i.push(r):i.push(r);for(r in n)r in e||i.push(r);return i}(t.c,n),t.c=n}return r})}function Ps(t){t.i&&t.i.cancel("STOP_EVENT"),t.f&&(clearTimeout(t.f),t.f=null)}function Rs(t){var e=this,n=null;this.a=[],this.type="indexedDB",this.c=t,this.b=St().then(function(){if(Is()){var t=mr(),r="__sak"+t;return vs||(vs=new Ts),(n=vs).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){R(e.a,function(e){e(t)})}),t})}function xs(){this.a={},this.type="inMemory"}function Ms(){if(!function(){var t="Node"==tr();if(!(t=js()||t&&l.a.INTERNAL.node&&l.a.INTERNAL.node.localStorage))return!1;try{return t.setItem("__sak","1"),t.removeItem("__sak"),!0}catch(e){return!1}}()){if("Node"==tr())throw new qr("internal-error","The LocalStorage compatibility library was not found.");throw new qr("web-storage-unsupported")}this.a=js()||l.a.INTERNAL.node.localStorage,this.type="localStorage"}function js(){try{var t=n.localStorage,e=mr();return t&&(t.setItem(e,"1"),t.removeItem(e)),t}catch(r){return null}}function Ls(){this.type="nullStorage"}function Us(){if(!function(){var t="Node"==tr();if(!(t=Vs()||t&&l.a.INTERNAL.node&&l.a.INTERNAL.node.sessionStorage))return!1;try{return t.setItem("__sak","1"),t.removeItem("__sak"),!0}catch(e){return!1}}()){if("Node"==tr())throw new qr("internal-error","The SessionStorage compatibility library was not found.");throw new qr("web-storage-unsupported")}this.a=Vs()||l.a.INTERNAL.node.sessionStorage,this.type="sessionStorage"}function Vs(){try{var t=n.sessionStorage,e=mr();return t&&(t.setItem(e,"1"),t.removeItem(e)),t}catch(r){return null}}function Fs(){var t={};t.Browser=Hs,t.Node=zs,t.ReactNative=Ws,t.Worker=Ks,this.a=t[tr()]}ms.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=[];R(r,function(e){i.push(St().then(function(){return e(t.origin,t.data.data)}))}),Ct(i).then(function(r){var i=[];R(r,function(t){i.push({fulfilled:t.Db,value:t.value,reason:t.reason?t.reason.message:void 0})}),R(i,function(t){for(var e in t)void 0===t[e]&&delete t[e]}),t.ports[0].postMessage({status:"done",eventId:n,eventType:e,response:i})})}},ms.prototype.subscribe=function(t,e){it(this.a)&&this.b.addEventListener("message",this.c),void 0===this.a[t]&&(this.a[t]=[]),this.a[t].push(e)},ms.prototype.unsubscribe=function(t,e){void 0!==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],it(this.a)&&this.b.removeEventListener("message",this.c)},ws.prototype.postMessage=function(t,e){this.a.postMessage(t,e)},_s.prototype.close=function(){for(;0<this.a.length;)Es(this,this.a[0]);this.b=!0},(t=Ts.prototype).set=function(t,e){var n,r=!1,i=this;return Cs(this).then(function(e){return Ds((e=As(Os(n=e,!0))).get(t))}).then(function(o){var a=As(Os(n,!0));return o?(o.value=e,Ds(a.put(o))):(i.b++,r=!0,(o={}).fbase_key=t,o.value=e,Ds(a.add(o)))}).then(function(){return i.c[t]=e,ks(i,t)}).ia(function(){r&&i.b--})},t.get=function(t){return Cs(this).then(function(e){return Ds(As(Os(e,!1)).get(t))}).then(function(t){return t&&t.value})},t.P=function(t){var e=!1,n=this;return Cs(this).then(function(r){return e=!0,n.b++,Ds(As(Os(r,!0)).delete(t))}).then(function(){return delete n.c[t],ks(n,t)}).ia(function(){e&&n.b--})},t.Y=function(t){0==this.a.length&&function(t){Ps(t),function e(){t.f=setTimeout(function(){t.i=Ns(t).then(function(e){0<e.length&&R(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&&Ps(this)},(t=Rs.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=xs.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=Ms.prototype).get=function(t){var e=this;return St().then(function(){return gr(e.a.getItem(t))})},t.set=function(t,e){var n=this;return St().then(function(){var r=dr(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=Ls.prototype).get=function(){return St(null)},t.set=function(){return St()},t.P=function(){return St()},t.Y=function(){},t.ca=function(){},(t=Us.prototype).get=function(t){var e=this;return St().then(function(){return gr(e.a.getItem(t))})},t.set=function(t,e){var n=this;return St().then(function(){var r=dr(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 qs,Bs,Hs={A:Ms,Ra:Us},zs={A:Ms,Ra:Us},Ws={A:gs,Ra:Ls},Ks={A:Ms,Ra:Ls},Gs={Zc:"local",NONE:"none",ad:"session"};function Qs(){var t=!(vr(sr())||!Zn()),e=pr(),r=cr();this.o=t,this.h=e,this.l=r,this.a={},qs||(qs=new Fs),t=qs;try{this.g=!Bn()&&Er()||!n.indexedDB?new t.a.A:new Rs($n()?new xs:new t.a.A)}catch(i){this.g=new xs,this.h=!0}try{this.i=new t.a.Ra}catch(i){this.i=new xs}this.m=new xs,this.f=m(this.Pb,this),this.b={}}function Xs(){return Bs||(Bs=new Qs),Bs}function Ys(t,e){switch(e){case"session":return t.i;case"none":return t.m;default:return t.g}}function Js(t,e){return"firebase:"+t.name+(e?":"+e:"")}function Zs(t,e,n){return n=Js(e,n),"local"==e.A&&(t.b[n]=null),Ys(t,e.A).P(n)}function $s(t){t.c&&(clearInterval(t.c),t.c=null)}function tu(t){this.a=t,this.b=Xs()}(t=Qs.prototype).get=function(t,e){return Ys(this,t.A).get(Js(t,e))},t.set=function(t,e,n){var r=Js(t,n),i=this,o=Ys(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=Js(t,e),this.l&&(this.b[t]=n.localStorage.getItem(t)),it(this.a)&&(Ys(this,"local").Y(this.f),this.h||(Bn()||!Er())&&n.indexedDB||!this.l||function(t){$s(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 ue({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=Js(t,e),this.a[t]&&(U(this.a[t],function(t){return t==n}),0==this.a[t].length&&delete this.a[t]),it(this.a)&&(Ys(this,"local").ca(this.f),$s(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];void 0===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(void 0!==t.a.a?Ys(this,"local").ca(this.f):$s(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&&void 0===t.a.a)return;var a=this;r=function(){void 0===t.a.a&&a.b[e]===n.localStorage.getItem(e)||(a.b[e]=n.localStorage.getItem(e),a.Xa(e))},zt&&$t&&10==$t&&n.localStorage.getItem(e)!==t.a.newValue&&t.a.newValue!==t.a.oldValue?setTimeout(r,10):r()}}else R(t,m(this.Xa,this))},t.Xa=function(t){this.a[t]&&R(this.a[t],function(t){t()})};var eu,nu={name:"authEvent",A:"local"};function ru(){this.a=Xs()}function iu(t,e){this.b=ou,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!==eu||(eu=n.Int32Array?new Int32Array(fu):fu),this.reset()}w(iu,function(){this.b=-1});for(var ou=64,au=ou-1,su=[],uu=0;uu<au;uu++)su[uu]=0;var cu=V(128,su);function lu(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++){var o=(0|n[e-16])+(((i=0|n[e-15])>>>7|i<<25)^(i>>>18|i<<14)^i>>>3)|0,a=(0|n[e-7])+(((r=0|n[e-2])>>>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],l=0|t.a[5],h=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&l^~c&h)+(0|eu[e])|0)+(0|n[e])|0)|0,o=h,h=l,l=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]+l|0,t.a[6]=t.a[6]+h|0,t.a[7]=t.a[7]+o|0}function hu(t,e,n){void 0===n&&(n=e.length);var i=0,o=t.c;if(r(e))for(;i<n;)t.f[o++]=e.charCodeAt(i++),o==t.b&&(lu(t),o=0);else{if(!c(e))throw Error("message must be string or array");for(;i<n;){var a=e[i++];if(!("number"==typeof a&&0<=a&&255>=a&&a==(0|a)))throw Error("message must be a byte array");t.f[o++]=a,o==t.b&&(lu(t),o=0)}}t.c=o,t.g+=n}iu.prototype.reset=function(){this.g=this.c=0,this.a=n.Int32Array?new Int32Array(this.h):F(this.h)};var fu=[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 pu(){iu.call(this,8,du)}w(pu,iu);var du=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225];function yu(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 ru,this.g=new tu(this.h),this.f=null,this.b=[],this.a=this.c=null}function gu(t){return new qr("invalid-cordova-configuration",t)}function mu(t,e){for(var n=0;n<t.b.length;n++)try{t.b[n](e)}catch(r){}}function vu(t){return t.f||(t.f=t.ga().then(function(){return new yt(function(e){t.wa(function n(r){return e(r),t.Ka(n),!1}),function(t){function e(e){i=!0,o&&o.cancel(),bu(t).then(function(n){var i=r;if(n&&e&&e.url){var o=null;-1!=(i=Ti(e.url)).indexOf("/__/auth/callback")&&(o=(o="object"==typeof(o=gr(Qe(o=Xe(i),"firebaseError")||null))?Br(o):null)?new Ji(n.b,n.c,null,null,o):new Ji(n.b,n.c,i,n.g)),i=o||r}mu(t,i)})}var r=new Ji("unknown",null,null,null,new qr("no-auth-event")),i=!1,o=je(500).then(function(){return bu(t).then(function(){i||mu(t,r)})}),a=n.handleOpenURL;n.handleOpenURL=function(t){if(0==t.toLowerCase().indexOf(ur("BuildInfo.packageName",n).toLowerCase()+"://")&&e({url:t}),"function"==typeof a)try{a(t)}catch(r){console.error(r)}},eo||(eo=new $i),eo.subscribe(e)}(t)})})),t.f}function bu(t){var e=null;return function(t){return t.b.get(nu,t.a).then(function(t){return Zi(t)})}(t.g).then(function(n){return e=n,Zs((n=t.g).b,nu,n.a)}).then(function(){return e})}function wu(t){this.a=t,this.b=Xs()}(t=yu.prototype).ga=function(){return this.za?this.za:this.za=(Jn(void 0)?Yn().then(function(){return new yt(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)})}):Et(Error("Cordova must run in an Android or iOS file scheme."))).then(function(){if("function"!=typeof ur("universalLinks.subscribe",n))throw gu("cordova-universal-links-plugin-fix is not installed");if(void 0===ur("BuildInfo.packageName",n))throw gu("cordova-plugin-buildinfo is not installed");if("function"!=typeof ur("cordova.plugins.browsertab.openUrl",n))throw gu("cordova-plugin-browsertab is not installed");if("function"!=typeof ur("cordova.InAppBrowser.open",n))throw gu("cordova-plugin-inappbrowser is not installed")},function(){throw new qr("cordova-not-ready")})},t.Ea=function(t,e){return e(new qr("operation-not-supported-in-this-environment")),St()},t.Cb=function(){return Et(new qr("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 Et(new qr("redirect-operation-pending"));var i=this,o=n.document,a=null,s=null,u=null,c=null;return this.c=St().then(function(){return Yi(e),vu(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 Ji(e,i,null,o,new qr("no-auth-event")),s=ur("BuildInfo.packageName",n);if("string"!=typeof s)throw new qr("invalid-cordova-configuration");var u=ur("BuildInfo.displayName",n),c={};if(sr().toLowerCase().match(/iphone|ipad|ipod/))c.ibi=s;else{if(!sr().toLowerCase().match(/android/))return Et(new qr("operation-not-supported-in-this-environment"));c.apn=s}u&&(c.appDisplayName=u),o=function(t){var e=new pu;hu(e,t),t=[];var n=8*e.g;hu(e,cu,56>e.c?56-e.c:e.b-(e.c-56));for(var r=63;56<=r;r--)e.f[r]=255&n,n/=256;for(lu(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 x(t,function(t){return 1<(t=t.toString(16)).length?t:"0"+t}).join("")}(t)}(o),c.sessionId=o;var l=ys(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(nu,a.C(),e)}).then(function(){var e=ur("cordova.plugins.browsertab.isAvailable",n);if("function"!=typeof e)throw new qr("invalid-cordova-configuration");var r=null;e(function(e){if(e){if("function"!=typeof(r=ur("cordova.plugins.browsertab.openUrl",n)))throw new qr("invalid-cordova-configuration");r(l)}else{if("function"!=typeof(r=ur("cordova.InAppBrowser.open",n)))throw new qr("invalid-cordova-configuration");e=!(!(e=sr()).match(/(iPad|iPhone|iPod).*OS 7_\d/i)&&!e.match(/(iPad|iPhone|iPod).*OS 8_\d/i)),t.a=r(l,e?"_blank":"_system","location=yes")}})})}(i,t,e,r)}).then(function(){return new yt(function(t,e){s=function(){var e=ur("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),c=function(){_r()&&u()},o.addEventListener("resume",u=function(){a||(a=je(2e3).then(function(){e(new qr("redirect-cancelled-by-user"))}))},!1),sr().toLowerCase().match(/android/)||o.addEventListener("visibilitychange",c,!1)}).s(function(t){return bu(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),vu(this).s(function(e){"auth/invalid-cordova-configuration"===e.code&&(e=new Ji("unknown",null,null,null,new qr("no-auth-event")),t(e))})},t.Ka=function(t){U(this.b,function(e){return e==t})};var _u={name:"pendingRedirect",A:"session"};function Su(t){return Zs(t.b,_u,t.a)}function Eu(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 Ru,this.o=new Lu,this.g=new wu(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=Tu(this.u,this.l,this.m,si)}function Tu(t,e,n,r){var i=l.a.SDK_VERSION||null;return Jn()?new yu(t,e,n,i,r):new hs(t,e,n,i,r)}function Cu(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 Iu(t){t.a.Mb()&&Cu(t).s(function(e){var n=new Ji("unknown",null,null,null,new qr("operation-not-supported-in-this-environment"));ku(e)&&t.bb(n)}),t.a.Hb()||xu(t.b)}(t=Eu.prototype).reset=function(){this.f=!1,this.a.Ka(this.i),this.a=Tu(this.u,this.l,this.m)},t.Ya=function(){this.b.Ya()},t.subscribe=function(t){if(j(this.h,t)||this.h.push(t),!this.f){var e=this;(function(t){return t.b.get(_u,t.a).then(function(t){return"pending"==t})})(this.g).then(function(t){t?Su(e.g).then(function(){Cu(e).s(function(t){var n=new Ji("unknown",null,null,null,new qr("operation-not-supported-in-this-environment"));ku(t)&&e.bb(n)})}):Iu(e)}).s(function(){Iu(e)})}},t.unsubscribe=function(t){U(this.h,function(e){return e==t})},t.bb=function(t){if(!t)throw new qr("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 xu(this.b),e};var Au=new wr(2e3,1e4),Ou=new wr(3e4,6e4);function Du(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 ku(t){return!(!t||"auth/cordova-not-ready"!=t.code)}Eu.prototype.fa=function(){return this.b.fa()},Eu.prototype.Ca=function(t,e,n){var r,i=this;return function(t){return t.b.set(_u,"pending",t.a)}(this.g).then(function(){return i.a.Ca(t,e,n).s(function(t){if(ku(t))throw new qr("operation-not-supported-in-this-environment");return r=t,Su(i.g).then(function(){throw r})}).then(function(){return i.a.Qb()?new yt(function(){}):Su(i.g).then(function(){return i.fa()}).then(function(){}).s(function(){})})})},Eu.prototype.Ea=function(t,e,n,r){return this.a.Ea(n,function(n){t.ha(e,null,n,r)},Au.get())};var Nu={};function Pu(t,e,n){var r=e+":"+n;return Nu[r]||(Nu[r]=new Eu(t,e,n)),Nu[r]}function Ru(){this.b=null,this.f=[],this.c=[],this.a=null,this.i=this.g=!1}function xu(t){t.g||(t.g=!0,ju(t,!1,null,null))}function Mu(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 ju(t,e,n,r){e?r?function(t,e){if(t.b=function(){return Et(e)},t.c.length)for(var n=0;n<t.c.length;n++)t.c[n](e)}(t,r):Mu(t,n):Mu(t,{user:null}),t.f=[],t.c=[]}function Lu(){}function Uu(){this.sb=!1,Object.defineProperty(this,"appVerificationDisabled",{get:function(){return this.sb},set:function(t){this.sb=t},enumerable:!1})}function Vu(t,e){this.a=e,Or(this,"verificationId",t)}function Fu(t,e,n,r){return new Gi(t).Ua(e,n).then(function(t){return new Vu(t,r)})}function qu(t){var e=ai(t);if(!(e&&e.exp&&e.auth_time&&e.iat))throw new qr("internal-error","An internal error occurred. The token obtained by Firebase appears to be malformed. Please retry the operation.");Dr(this,{token:t,expirationTime:Sr(1e3*e.exp),authTime:Sr(1e3*e.auth_time),issuedAtTime:Sr(1e3*e.iat),signInProvider:e.firebase&&e.firebase.sign_in_provider?e.firebase.sign_in_provider:null,claims:e})}function Bu(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 Hu(t){this.f=t,this.b=this.a=null,this.c=0}function zu(t,e){var n=e[oa],r=e.refreshToken;e=Wu(e.expiresIn),t.b=n,t.c=e,t.a=r}function Wu(t){return b()+1e3*parseInt(t,10)}function Ku(t,e){this.a=t||null,this.b=e||null,Dr(this,{lastSignInTime:Sr(e||null),creationTime:Sr(t||null)})}function Gu(t,e,n,r,i,o){Dr(this,{uid:t,displayName:r||null,photoURL:i||null,email:n||null,phoneNumber:o||null,providerId:e})}function Qu(t,e){for(var n in se.call(this,t),e)this[n]=e[n]}function Xu(t,e,n){this.G=[],this.m=t.apiKey,this.o=t.appName,this.u=t.authDomain||null,t=l.a.SDK_VERSION?ar(l.a.SDK_VERSION):null,this.b=new ra(this.m,ci(si),t),this.h=new Hu(this.b),nc(this,e[oa]),zu(this.h,e),Or(this,"refreshToken",this.h.a),oc(this,n||{}),Ne.call(this),this.I=!1,this.u&&lr()&&(this.a=Pu(this.u,this.m,this.o)),this.N=[],this.i=null,this.w=function(t){return new Bu(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 r=this;this.ka=null,this.ta=function(t){r.pa(t.g)},this.X=null,this.O=[],this.sa=function(t){Ju(r,t.c)},this.W=null}function Yu(t,e){t.X&&Se(t.X,"languageCodeChanged",t.ta),(t.X=e)&&be(e,"languageCodeChanged",t.ta)}function Ju(t,e){t.O=e,ha(t.b,l.a.SDK_VERSION?ar(l.a.SDK_VERSION,t.O):null)}function Zu(t,e){t.W&&Se(t.W,"frameworkChanged",t.sa),(t.W=e)&&be(e,"frameworkChanged",t.sa)}function $u(t){try{return l.a.app(t.o).auth()}catch(e){throw new qr("internal-error","No firebase.auth.Auth instance is available for the Firebase App '"+t.o+"'!")}}function tc(t){t.D||t.w.b||(t.w.start(),Se(t,"tokenChanged",t.V),be(t,"tokenChanged",t.V))}function ec(t){Se(t,"tokenChanged",t.V),t.w.stop()}function nc(t,e){t.ra=e,Or(t,"_lat",e)}function rc(t){for(var e=[],n=0;n<t.N.length;n++)e.push(t.N[n](t));return Ct(e).then(function(){return t})}function ic(t){t.a&&!t.I&&(t.I=!0,t.a.subscribe(t))}function oc(t,e){Dr(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 Ku(e.createdAt,e.lastLoginAt),providerData:[]})}function ac(){}function sc(t){return St().then(function(){if(t.D)throw new qr("app-deleted")})}function uc(t){return x(t.providerData,function(t){return t.providerId})}function cc(t,e){e&&(lc(t,e.providerId),t.providerData.push(e))}function lc(t,e){U(t.providerData,function(t){return t.providerId==e})}function hc(t,e,n){("uid"!=e||n)&&t.hasOwnProperty(e)&&Or(t,e,n)}function fc(t,e){t!=e&&(Dr(t,{uid:e.uid,displayName:e.displayName,photoURL:e.photoURL,email:e.email,emailVerified:e.emailVerified,phoneNumber:e.phoneNumber,isAnonymous:e.isAnonymous,providerData:[]}),Or(t,"metadata",e.metadata?function(t){return new Ku(t.a,t.b)}(e.metadata):new Ku),R(e.providerData,function(e){cc(t,e)}),function(t,e){t.b=e.b,t.a=e.a,t.c=e.c}(t.h,e.h),Or(t,"refreshToken",t.h.a))}function pc(t){return t.F().then(function(e){var n=t.isAnonymous;return function(t,e){return ts(t.b,Ma,{idToken:e}).then(m(t.xc,t))}(t,e).then(function(){return n||hc(t,"isAnonymous",!1),e})})}function dc(t,e){e[oa]&&t.ra!=e[oa]&&(zu(t.h,e),t.dispatchEvent(new Qu("tokenChanged")),nc(t,e[oa]),hc(t,"refreshToken",t.h.a))}function yc(t,e){return pc(t).then(function(){if(j(uc(t),e))return rc(t).then(function(){throw new qr("provider-already-linked")})})}function gc(t,e,n){return kr({user:t,credential:Xi(e),additionalUserInfo:e=di(e),operationType:n})}function mc(t,e){return dc(t,e),t.reload().then(function(){return t})}function vc(t,e,n,r,i){if(!lr())return Et(new qr("operation-not-supported-in-this-environment"));if(t.i&&!i)return Et(t.i);var o=pi(n.providerId),a=mr(t.uid+":::"),s=null;(!pr()||Zn())&&t.u&&n.isOAuthProvider&&(s=ys(t.u,t.m,t.o,e,n,null,a,l.a.SDK_VERSION||null));var u=Gn(s,o&&o.Ba,o&&o.Aa);return r=r().then(function(){if(wc(t),!i)return t.F().then(function(){})}).then(function(){return Du(t.a,u,e,n,a,!!s)}).then(function(){return new yt(function(n,r){t.ha(e,null,new qr("cancelled-popup-request"),t.g||null),t.f=n,t.v=r,t.g=a,t.c=t.a.Ea(t,e,u,a)})}).then(function(t){return u&&Kn(u),t?kr(t):null}).s(function(t){throw u&&Kn(u),t}),_c(t,r,i)}function bc(t,e,n,r,i){if(!lr())return Et(new qr("operation-not-supported-in-this-environment"));if(t.i&&!i)return Et(t.i);var o=null,a=mr(t.uid+":::");return r=r().then(function(){if(wc(t),!i)return t.F().then(function(){})}).then(function(){return t.aa=a,rc(t)}).then(function(e){return t.ba&&(e=(e=t.ba).b.set(Tc,t.C(),e.a)),e}).then(function(){return t.a.Ca(e,n,a)}).s(function(e){if(o=e,t.ba)return Cc(t.ba);throw o}).then(function(){if(o)throw o}),_c(t,r,i)}function wc(t){if(!t.a||!t.I){if(t.a&&!t.I)throw new qr("internal-error");throw new qr("auth-domain-config-required")}}function _c(t,e,n){var r=function(t,e,n){return t.i&&!n?(e.cancel(),Et(t.i)):e.s(function(e){throw!e||"auth/user-disabled"!=e.code&&"auth/user-token-expired"!=e.code||(t.i||t.dispatchEvent(new Qu("userInvalidated")),t.i=e),e})}(t,e,n);return t.G.push(r),r.ia(function(){L(t.G,r)}),r}function Sc(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[oa]=t.stsTokenManager.accessToken,n.refreshToken=t.stsTokenManager.refreshToken||null,n.expiresIn=(t.stsTokenManager.expirationTime-b())/1e3;var r=new Xu(e,n,t);return t.providerData&&R(t.providerData,function(t){t&&cc(r,kr(t))}),t.redirectEventId&&(r.aa=t.redirectEventId),r}function Ec(t){this.a=t,this.b=Xs()}Ru.prototype.reset=function(){this.b=null,this.a&&(this.a.cancel(),this.a=null)},Ru.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?(ju(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){ju(t,a,e,null)}).s(function(e){ju(t,a,null,e)})}(this,t,e):Et(new qr("invalid-auth-event")):(ju(this,!1,null,null),St())}else Et(new qr("invalid-auth-event"))},Ru.prototype.Ya=function(){this.g&&!this.i&&ju(this,!1,null,null)},Ru.prototype.fa=function(){var t=this;return new yt(function(e,n){t.b?t.b().then(e,n):(t.f.push(e),t.c.push(n),function(t){var e=new qr("timeout");t.a&&t.a.cancel(),t.a=je(Ou.get()).then(function(){t.b||(t.g=!0,ju(t,!0,null,e))})}(t))})},Lu.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):Et(new qr("invalid-auth-event"))}else Et(new qr("invalid-auth-event"))},Vu.prototype.confirm=function(t){return t=Qi(this.verificationId,t),this.a(t)},Bu.prototype.start=function(){this.a=this.c,function t(e,r){e.stop(),e.b=je(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 t=n.document,e=null,_r()||!t?St():new yt(function(n){e=function(){_r()&&(t.removeEventListener("visibilitychange",e,!1),n())},t.addEventListener("visibilitychange",e,!1)}).s(function(n){throw t.removeEventListener("visibilitychange",e,!1),n});var t,e}).then(function(){return e.h()}).then(function(){t(e,!0)}).s(function(n){e.i(n)&&t(e,!1)})}(this,!0)},Bu.prototype.stop=function(){this.b&&(this.b.cancel(),this.b=null)},Hu.prototype.C=function(){return{apiKey:this.f.b,refreshToken:this.a,accessToken:this.b,expirationTime:this.c}},Hu.prototype.getToken=function(t){return t=!!t,this.b&&!this.a?Et(new qr("user-token-expired")):t||!this.b||b()>this.c-3e4?this.a?function(t,e){return function(t,e){return new yt(function(n,r){"refresh_token"==e.grant_type&&e.refresh_token||"authorization_code"==e.grant_type&&e.code?fa(t,t.i+"?key="+encodeURIComponent(t.b),function(t){t?t.error?r(ns(t)):t.access_token&&t.refresh_token?n(t):r(new qr("internal-error")):r(new qr("network-request-failed"))},"POST",un(e).toString(),t.f,t.l.get()):r(new qr("internal-error"))})}(t.f,e).then(function(e){return t.b=e.access_token,t.c=Wu(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})}(this,{grant_type:"refresh_token",refresh_token:this.a}):St(null):St({accessToken:this.b,expirationTime:this.c,refreshToken:this.a})},Ku.prototype.C=function(){return{lastLoginAt:this.b,createdAt:this.a}},w(Qu,se),w(Xu,Ne),Xu.prototype.pa=function(t){this.ka=t,la(this.b,t)},Xu.prototype.ea=function(){return this.ka},Xu.prototype.ya=function(){return F(this.O)},Xu.prototype.Ha=function(){this.w.b&&(this.w.stop(),this.w.start())},Or(Xu.prototype,"providerId","firebase"),(t=Xu.prototype).reload=function(){var t=this;return _c(this,sc(this).then(function(){return pc(t).then(function(){return rc(t)}).then(ac)}))},t.dc=function(t){return this.F(t).then(function(t){return new qu(t)})},t.F=function(t){var e=this;return _c(this,sc(this).then(function(){return e.h.getToken(t)}).then(function(t){if(!t)throw new qr("internal-error");return t.accessToken!=e.ra&&(nc(e,t.accessToken),e.dispatchEvent(new Qu("tokenChanged"))),hc(e,"refreshToken",t.refreshToken),t.accessToken}))},t.xc=function(t){if(!(t=t.users)||!t.length)throw new qr("internal-error");oc(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?x(t,function(t){return new Gu(t.rawId,t.providerId,t.email,t.displayName,t.photoUrl,t.phoneNumber)}):[]}(t),n=0;n<e.length;n++)cc(this,e[n]);hc(this,"isAnonymous",!(this.email&&t.passwordHash||this.providerData&&this.providerData.length))},t.gb=function(t){var e=this,n=null;return _c(this,t.f(this.b,this.uid).then(function(t){return dc(e,t),n=gc(e,t,"reauthenticate"),e.i=null,e.reload()}).then(function(){return n}),!0)},t.yc=function(t){return Ir("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 _c(this,yc(this,t.providerId).then(function(){return e.F()}).then(function(n){return t.b(e.b,n)}).then(function(t){return n=gc(e,t,"link"),mc(e,t)}).then(function(){return n}))},t.pc=function(t){return Ir("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 _c(this,yc(this,"phone").then(function(){return Fu($u(n),t,e,m(n.eb,n))}))},t.zc=function(t,e){var n=this;return _c(this,St().then(function(){return Fu($u(n),t,e,m(n.gb,n))}),!0)},t.pb=function(t){var e=this;return _c(this,this.F().then(function(n){return e.b.pb(n,t)}).then(function(t){return dc(e,t),e.reload()}))},t.Rc=function(t){var e=this;return _c(this,this.F().then(function(n){return t.b(e.b,n)}).then(function(t){return dc(e,t),e.reload()}))},t.qb=function(t){var e=this;return _c(this,this.F().then(function(n){return e.b.qb(n,t)}).then(function(t){return dc(e,t),e.reload()}))},t.rb=function(t){if(void 0===t.displayName&&void 0===t.photoURL)return sc(this);var e=this;return _c(this,this.F().then(function(n){return e.b.rb(n,{displayName:t.displayName,photoUrl:t.photoURL})}).then(function(t){return dc(e,t),hc(e,"displayName",t.displayName||null),hc(e,"photoURL",t.photoUrl||null),R(e.providerData,function(t){"password"===t.providerId&&(Or(t,"displayName",e.displayName),Or(t,"photoURL",e.photoURL))}),rc(e)}).then(ac))},t.Pc=function(t){var e=this;return _c(this,pc(this).then(function(n){return j(uc(e),t)?function(t,e,n){return ts(t,Pa,{idToken:e,deleteProvider:n})}(e.b,n,[t]).then(function(t){var n={};return R(t.providerUserInfo||[],function(t){n[t.providerId]=!0}),R(uc(e),function(t){n[t]||lc(e,t)}),n[Gi.PROVIDER_ID]||Or(e,"phoneNumber",null),rc(e)}):rc(e).then(function(){throw new qr("no-such-provider")})}))},t.delete=function(){var t=this;return _c(this,this.F().then(function(e){return ts(t.b,Na,{idToken:e})}).then(function(){t.dispatchEvent(new Qu("userDeleted"))})).then(function(){for(var e=0;e<t.G.length;e++)t.G[e].cancel("app-deleted");Yu(t,null),Zu(t,null),t.G=[],t.D=!0,ec(t),Or(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 vc(this,"linkViaPopup",t,function(){return yc(e,t.providerId).then(function(){return rc(e)})},!1)},t.Ac=function(t){return vc(this,"reauthViaPopup",t,function(){return St()},!0)},t.sc=function(t){var e=this;return bc(this,"linkViaRedirect",t,function(){return yc(e,t.providerId)},!1)},t.Bc=function(t){return bc(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 _c(this,this.F().then(function(i){return Ta(r.b,{requestUri:t,postBody:n,sessionId:e,idToken:i})}).then(function(t){return i=gc(r,t,"link"),mc(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 _c(this,St().then(function(){return Ci(Ca(r.b,{requestUri:t,sessionId:e,postBody:n}),r.uid)}).then(function(t){return i=gc(r,t,"reauthenticate"),dc(r,t),r.i=null,r.reload()}).then(function(){return i}),!0)},t.jb=function(t){var e=this,n=null;return _c(this,this.F().then(function(e){return n=e,void 0===t||it(t)?{}:ei(new Wr(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&&ct(t,this.metadata.C()),R(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 Tc={name:"redirectUser",A:"session"};function Cc(t){return Zs(t.b,Tc,t.a)}function Ic(t){this.a=t,this.b=Xs(),this.c=null,this.f=function(t){var e=Dc("local"),r=Dc("session"),i=Dc("none");return function(t,e,r){var i=Js(e,r),o=Ys(t,e.A);return t.get(e,r).then(function(a){var s=null;try{s=gr(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(Oc,t.a).then(function(t){return t?Dc(t):e})})})}).then(function(e){return t.c=e,Ac(t,e.A)}).s(function(){t.c||(t.c=e)})}(this),this.b.addListener(Dc("local"),this.a,m(this.g,this))}function Ac(t,e){var n,r=[];for(n in Gs)Gs[n]!==e&&r.push(Zs(t.b,Dc(Gs[n]),t.a));return r.push(Zs(t.b,Oc,t.a)),function(t){return new yt(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],v(o,s),a);else e(i)})}(r)}Ic.prototype.g=function(){var t=this,e=Dc("local");Rc(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 Ac(t,"local").then(function(){t.c=e})})})};var Oc={name:"persistence",A:"session"};function Dc(t){return{name:"authUser",A:t}}function kc(t,e){return Rc(t,function(){return t.b.set(t.c,e.C(),t.a)})}function Nc(t){return Rc(t,function(){return Zs(t.b,t.c,t.a)})}function Pc(t,e){return Rc(t,function(){return t.b.get(t.c,t.a).then(function(t){return t&&e&&(t.authDomain=e),Sc(t||{})})})}function Rc(t,e){return t.f=t.f.then(e,e),t.f}function xc(t){if(this.m=!1,Or(this,"settings",new Uu),Or(this,"app",t),!qc(this).options||!qc(this).options.apiKey)throw new qr("invalid-api-key");t=l.a.SDK_VERSION?ar(l.a.SDK_VERSION):null,this.b=new ra(qc(this).options&&qc(this).options.apiKey,ci(si),t),this.N=[],this.o=[],this.I=[],this.Tb=l.a.INTERNAL.createSubscribe(m(this.mc,this)),this.O=void 0,this.Ub=l.a.INTERNAL.createSubscribe(m(this.nc,this)),Vc(this,null),this.h=new Ic(qc(this).options.apiKey+":"+qc(this).name),this.w=new Ec(qc(this).options.apiKey+":"+qc(this).name),this.V=Wc(this,function(t){var e=qc(t).options.authDomain,n=function(t){var e=function(t,e){return t.b.get(Tc,t.a).then(function(t){return t&&e&&(t.authDomain=e),Sc(t||{})})}(t.w,qc(t).options.authDomain).then(function(e){return(t.D=e)&&(e.ba=t.w),Cc(t.w)});return Wc(t,e)}(t).then(function(){return Pc(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 kc(t.h,e).then(function(){return e})}).s(function(n){return"auth/network-request-failed"==n.code?e:Nc(t.h)})):null}).then(function(e){Vc(t,e||null)});return Wc(t,n)}(this)),this.i=Wc(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(Dc("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=qc(t).options.authDomain,n=qc(t).options.apiKey;e&&lr()&&(t.Sb=t.V.then(function(){if(!t.m){if(t.a=Pu(e,n,qc(t).name),t.a.subscribe(t),Bc(t)&&ic(Bc(t)),t.D){ic(t.D);var r=t.D;r.pa(t.ea()),Yu(r,t),Ju(r=t.D,t.G),Zu(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,Ne.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 Mc(t){se.call(this,"languageCodeChanged"),this.g=t}function jc(t){se.call(this,"frameworkChanged"),this.c=t}function Lc(t){return t.Sb||Et(new qr("auth-domain-config-required"))}function Uc(t,e){var n={};return n.apiKey=qc(t).options.apiKey,n.authDomain=qc(t).options.authDomain,n.appName=qc(t).name,t.V.then(function(){return function(t,e,n,r){var i=new Xu(t,e);return n&&(i.ba=n),r&&Ju(i,r),i.reload().then(function(){return i})}(n,e,t.w,t.ya())}).then(function(e){return Bc(t)&&e.uid==Bc(t).uid?(fc(Bc(t),e),t.Z(e)):(Vc(t,e),ic(e),t.Z(e))}).then(function(){zc(t)})}function Vc(t,e){Bc(t)&&(function(t,e){U(t.N,function(t){return t==e})}(Bc(t),t.Ha),Se(Bc(t),"tokenChanged",t.ra),Se(Bc(t),"userDeleted",t.sa),Se(Bc(t),"userInvalidated",t.ta),ec(Bc(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&&tc(e)),Or(t,"currentUser",e),e&&(e.pa(t.ea()),Yu(e,t),Ju(e,t.G),Zu(e,t))}function Fc(t,e){var n=null,r=null;return Wc(t,e.then(function(e){return n=Xi(e),r=di(e),Uc(t,e)}).then(function(){return kr({user:Bc(t),credential:n,additionalUserInfo:r,operationType:"signIn"})}))}function qc(t){return t.app}function Bc(t){return t.currentUser}function Hc(t){return Bc(t)&&Bc(t)._lat||null}function zc(t){if(t.X){for(var e=0;e<t.o.length;e++)t.o[e]&&t.o[e](Hc(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](Hc(t))}}function Wc(t,e){return t.N.push(e),e.ia(function(){L(t.N,e)}),e}function Kc(){}function Gc(){this.a={},this.b=1e12}Ic.prototype.mb=function(t){var e=null,n=this;return function(t){var e=new qr("invalid-persistence-type"),n=new qr("unsupported-persistence-type");t:{for(r in Gs)if(Gs[r]==t){var r=!0;break t}r=!1}if(!r||"string"!=typeof t)throw e;switch(tr()){case"ReactNative":if("session"===t)throw n;break;case"Node":if("none"!==t)throw n;break;default:if(!cr()&&"none"!==t)throw n}}(t),Rc(this,function(){return t!=n.c.A?n.b.get(n.c,n.a).then(function(r){return e=r,Ac(n,t)}).then(function(){if(n.c=Dc(t),e)return n.b.set(n.c,e,n.a)}):St()})},w(xc,Ne),w(Mc,se),w(jc,se),(t=xc.prototype).mb=function(t){return Wc(this,t=this.h.mb(t))},t.pa=function(t){this.W===t||this.m||(this.W=t,la(this.b,this.W),this.dispatchEvent(new Mc(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),ha(this.b,l.a.SDK_VERSION?ar(l.a.SDK_VERSION,this.G):null),this.dispatchEvent(new jc(this.G))},t.ya=function(){return F(this.G)},t.toJSON=function(){return{apiKey:qc(this).options.apiKey,authDomain:qc(this).options.authDomain,appName:qc(this).name,currentUser:Bc(this)&&Bc(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=Ea(r.b,t).then(function(t){return i=Xi(t),o=di(t),t});return Wc(this,t=r.V.then(function(){return a}).then(function(t){return Uc(r,t)}).then(function(){return kr({user:Bc(r),credential:i,additionalUserInfo:o,operationType:"signIn"})}))},t.Kc=function(t){if(!lr())return Et(new qr("operation-not-supported-in-this-environment"));var e=this,n=pi(t.providerId),r=mr(),i=null;(!pr()||Zn())&&qc(this).options.authDomain&&t.isOAuthProvider&&(i=ys(qc(this).options.authDomain,qc(this).options.apiKey,qc(this).name,"signInViaPopup",t,null,r,l.a.SDK_VERSION||null));var o=Gn(i,n&&n.Ba,n&&n.Aa);return Wc(this,n=Lc(this).then(function(e){return Du(e,o,"signInViaPopup",t,r,!!i)}).then(function(){return new yt(function(t,n){e.ha("signInViaPopup",null,new qr("cancelled-popup-request"),e.g),e.f=t,e.v=n,e.g=r,e.c=e.a.Ea(e,"signInViaPopup",o,r)})}).then(function(t){return o&&Kn(o),t?kr(t):null}).s(function(t){throw o&&Kn(o),t}))},t.Lc=function(t){if(!lr())return Et(new qr("operation-not-supported-in-this-environment"));var e=this;return Wc(this,Lc(this).then(function(){return Rc(t=e.h,function(){return t.b.set(Oc,t.c.A,t.a)});var t}).then(function(){return e.a.Ca("signInViaRedirect",t)}))},t.fa=function(){if(!lr())return Et(new qr("operation-not-supported-in-this-environment"));var t=this;return Wc(this,Lc(this).then(function(){return t.a.fa()}).then(function(t){return t?kr(t):null}))},t.Qc=function(t){if(!t)return Et(new qr("null-user"));var e=this,n={};n.apiKey=qc(this).options.apiKey,n.authDomain=qc(this).options.authDomain,n.appName=qc(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[oa]=i.b,o.refreshToken=i.a,o.expiresIn=(i.c-b())/1e3,e=new Xu(e,o),n&&(e.ba=n),r&&Ju(e,r),fc(e,t),e}(t,n,e.w,e.ya());return Wc(this,this.i.then(function(){if(qc(e).options.apiKey!=t.m)return r.reload()}).then(function(){return Bc(e)&&t.uid==Bc(e).uid?(fc(Bc(e),t),e.Z(t)):(Vc(e,r),ic(r),e.Z(r))}).then(function(){zc(e)}))},t.nb=function(){var t=this;return Wc(this,this.i.then(function(){return Bc(t)?(Vc(t,null),Nc(t.h).then(function(){zc(t)})):St()}))},t.Mc=function(){var t=this;return Pc(this.h,qc(this).options.authDomain).then(function(e){if(!t.m){var n;if(n=Bc(t)&&e){n=Bc(t).uid;var r=e.uid;n=null!=n&&""!==n&&null!=r&&""!==r&&n==r}if(n)return fc(Bc(t),e),Bc(t).F();(Bc(t)||e)&&(Vc(t,e),e&&(ic(e),e.ba=t.w),t.a&&t.a.subscribe(t),zc(t))}})},t.Z=function(t){return kc(this.h,t)},t.bc=function(){zc(this),this.Z(Bc(this))},t.jc=function(){this.nb()},t.kc=function(){this.nb()},t.mc=function(t){var e=this;this.addAuthTokenListener(function(){t.next(Bc(e))})},t.nc=function(t){var e=this;!function(t,e){t.I.push(e),Wc(t,t.i.then(function(){!t.m&&j(t.I,e)&&t.O!==t.getUid()&&(t.O=t.getUid(),e(Hc(t)))}))}(this,function(){t.next(Bc(e))})},t.vc=function(t,e,n){var r=this;return this.X&&l.a.Promise.resolve().then(function(){h(t)?t(Bc(r)):h(t.next)&&t.next(Bc(r))}),this.Tb(t,e,n)},t.uc=function(t,e,n){var r=this;return this.X&&l.a.Promise.resolve().then(function(){r.O=r.getUid(),h(t)?t(Bc(r)):h(t.next)&&t.next(Bc(r))}),this.Ub(t,e,n)},t.cc=function(t){var e=this;return Wc(this,this.i.then(function(){return Bc(e)?Bc(e).F(t).then(function(t){return{accessToken:t}}):null}))},t.Nb=function(t){var e=this;return this.i.then(function(){return Fc(e,ts(e.b,Xa,{token:t}))}).then(function(t){var n=t.user;return hc(n,"isAnonymous",!1),e.Z(n),t})},t.Ec=function(t){return Ir("firebase.auth.Auth.prototype.signInAndRetrieveDataWithCustomToken is deprecated. Please use firebase.auth.Auth.prototype.signInWithCustomToken instead."),this.Nb(t)},t.Fc=function(t,e){return Ir("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 Fc(n,ts(n.b,Ya,{email:t,password:e}))})},t.xb=function(t,e){var n=this;return this.i.then(function(){return Fc(n,ts(n.b,Da,{email:t,password:e}))})},t.Wb=function(t,e){return Ir("firebase.auth.Auth.prototype.createUserAndRetrieveDataWithEmailAndPassword is deprecated. Please use firebase.auth.Auth.prototype.createUserWithEmailAndPassword instead."),this.xb(t,e)},t.Hc=function(t){return Ir("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 Fc(e,t.la(e.b))})},t.Qa=function(){var t=this;return this.i.then(function(){var e=Bc(t);if(e&&e.isAnonymous){var n=kr({providerId:null,isNewUser:!1});return kr({user:e,credential:null,additionalUserInfo:n,operationType:"signIn"})}return Fc(t,t.b.Qa()).then(function(e){var n=e.user;return hc(n,"isAnonymous",!0),t.Z(n),e})})},t.Gc=function(){return Ir("firebase.auth.Auth.prototype.signInAnonymouslyAndRetrieveData is deprecated. Please use firebase.auth.Auth.prototype.signInAnonymously instead."),this.Qa()},t.getUid=function(){return Bc(this)&&Bc(this).uid||null},t.Vb=function(t){this.addAuthTokenListener(t),this.u++,0<this.u&&Bc(this)&&tc(Bc(this))},t.Cc=function(t){var e=this;R(this.o,function(n){n==t&&e.u--}),0>this.u&&(this.u=0),0==this.u&&Bc(this)&&ec(Bc(this)),this.removeAuthTokenListener(t)},t.addAuthTokenListener=function(t){var e=this;this.o.push(t),Wc(this,this.i.then(function(){e.m||j(e.o,t)&&t(Hc(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(Dc("local"),t.a,this.ka),this.a&&(this.a.unsubscribe(this),this.a.Ya()),l.a.Promise.resolve()},t.Zb=function(t){return Ir("firebase.auth.Auth.prototype.fetchProvidersForEmail is deprecated. Please use firebase.auth.Auth.prototype.fetchSignInMethodsForEmail instead."),Wc(this,function(t,e){return ts(t,ka,{identifier:e,continueUri:hr()?Hn():"http://localhost"}).then(function(t){return t.allProviders||[]})}(this.b,t))},t.$b=function(t){return Wc(this,function(t,e){return ts(t,ka,{identifier:e,continueUri:hr()?Hn():"http://localhost"}).then(function(t){return t.signinMethods||[]})}(this.b,t))},t.oc=function(t){return!!zi(t)},t.lb=function(t,e){var n=this;return Wc(this,St().then(function(){var t=new Wr(e);if(!t.c)throw new qr("argument-error",Qr+" must be true when sending sign in link to email");return ei(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 Wc(this,this.b.Za(t,e).then(function(){}))},t.Ja=function(t){return Wc(this,this.b.Ja(t).then(function(t){return new Pr(t)}))},t.Wa=function(t){return Wc(this,this.b.Wa(t).then(function(){}))},t.kb=function(t,e){var n=this;return Wc(this,St().then(function(){return void 0===e||it(e)?{}:ei(new Wr(e))}).then(function(e){return n.b.kb(t,e)}).then(function(){}))},t.Jc=function(t,e){return Wc(this,Fu(this,t,e,m(this.Pa,this)))},t.Ic=function(t,e){var n=this;return Wc(this,St().then(function(){var r=Hi(t,e||Hn());return n.Pa(r)}))},Kc.prototype.render=function(){},Kc.prototype.reset=function(){},Kc.prototype.getResponse=function(){},Kc.prototype.execute=function(){};var Qc=null;function Xc(t,e){return(e=Yc(e))&&t.a[e]||null}function Yc(t){return(t=void 0===t?1e12:t)?t.toString():null}function Jc(t,e){this.g=!1,this.c=e,this.a=this.b=null,this.h="invisible"!==this.c.size,this.f=Rn(t);var n=this;this.i=function(){n.execute()},this.h?this.execute():be(this.f,"click",this.i)}function Zc(t){if(t.g)throw Error("reCAPTCHA mock was already deleted!")}function $c(){}Gc.prototype.render=function(t,e){return this.a[this.b.toString()]=new Jc(t,e),this.b++},Gc.prototype.reset=function(t){var e=Xc(this,t);t=Yc(t),e&&t&&(e.delete(),delete this.a[t])},Gc.prototype.getResponse=function(t){return(t=Xc(this,t))?t.getResponse():null},Gc.prototype.execute=function(t){(t=Xc(this,t))&&t.execute()},Jc.prototype.getResponse=function(){return Zc(this),this.b},Jc.prototype.execute=function(){Zc(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))},Jc.prototype.delete=function(){Zc(this),this.g=!0,clearTimeout(this.a),this.a=null,Se(this.f,"click",this.i)},$c.prototype.g=function(){return Qc||(Qc=new Gc),St(Qc)},$c.prototype.c=function(){};var tl=null;function el(){this.b=n.grecaptcha?1/0:0,this.f=null,this.a="__rcb"+Math.floor(1e6*Math.random()).toString()}var nl=mn("https://www.google.com/recaptcha/api.js?onload=%{onload}&render=explicit&hl=%{hl}"),rl=new wr(3e4,6e4);el.prototype.g=function(t){var e=this;return new yt(function(r,i){var o=setTimeout(function(){i(new qr("network-request-failed"))},rl.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 qr("internal-error"));delete n[e.a]},St(Yo(wn(nl,{onload:e.a,hl:t||""}))).s(function(){clearTimeout(o),i(new qr("internal-error","Unable to load external reCAPTCHA dependencies!"))})):(clearTimeout(o),r(n.grecaptcha))})},el.prototype.c=function(){this.b--};var il=null;function ol(t,e,r,i,o,a,s){if(Or(this,"type","recaptcha"),this.c=this.f=null,this.D=!1,this.m=e,this.g=null,s?(tl||(tl=new $c),s=tl):(il||(il=new el),s=il),this.o=s,this.a=r||{theme:"light",type:"image"},this.h=[],this.a[ul])throw new qr("argument-error","sitekey should not be provided for reCAPTCHA as one is automatically provisioned for the current project.");if(this.i="invisible"===this.a[cl],!n.document)throw new qr("operation-not-supported-in-this-environment","RecaptchaVerifier is only supported in a browser HTTP/HTTPS environment with DOM support.");if(!Rn(e)||!this.i&&Rn(e).hasChildNodes())throw new qr("argument-error","reCAPTCHA container is either not found or already contains inner elements!");this.u=new ra(t,a||null,o||null),this.v=i||function(){return null};var u=this;this.l=[];var c=this.a[al];this.a[al]=function(t){if(ll(u,t),"function"==typeof c)c(t);else if("string"==typeof c){var e=ur(c,n);"function"==typeof e&&e(t)}};var l=this.a[sl];this.a[sl]=function(){if(ll(u,null),"function"==typeof l)l();else if("string"==typeof l){var t=ur(l,n);"function"==typeof t&&t()}}}var al="callback",sl="expired-callback",ul="sitekey",cl="size";function ll(t,e){for(var n=0;n<t.l.length;n++)try{t.l[n](e)}catch(r){}}function hl(t,e){return t.h.push(e),e.ia(function(){L(t.h,e)}),e}function fl(t){if(t.D)throw new qr("internal-error","RecaptchaVerifier instance has been destroyed.")}function pl(t,e,n){var r=!1;try{this.b=n||l.a.app()}catch(a){throw new qr("argument-error","No firebase.app.App instance is currently initialized.")}if(!this.b.options||!this.b.options.apiKey)throw new qr("invalid-api-key");n=this.b.options.apiKey;var i=this,o=null;try{o=this.b.auth().ya()}catch(a){}try{r=this.b.auth().settings.appVerificationDisabledForTesting}catch(a){}o=l.a.SDK_VERSION?ar(l.a.SDK_VERSION,o):null,ol.call(this,n,t,e,function(){try{var t=i.b.auth().ea()}catch(e){t=null}return t},o,ci(si),r)}function dl(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 qr("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>=yl.length)throw new qr("internal-error","Argument validator received an unsupported number of arguments.");n=yl[i],r=(r?"":n+" argument ")+(e.name?'"'+e.name+'" ':"")+"must be "+e.K+".";break t}r=null}}if(r)throw new qr("argument-error",t+" failed: "+r)}(t=ol.prototype).za=function(){var t=this;return this.f?this.f:this.f=hl(this,St().then(function(){if(hr()&&!$n())return Yn();throw new qr("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,ts(t.u,Fa,{})}).then(function(e){t.a[ul]=e.recaptchaSiteKey}).s(function(e){throw t.f=null,e}))},t.render=function(){fl(this);var t=this;return hl(this,this.za().then(function(){if(null===t.c){var e=t.m;if(!t.i){var n=Rn(e);e=function(t,e,n){var i=arguments,o=document,a=String(i[0]),s=i[1];if(!pn&&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 l={};ct(l,s),delete l.type,s=l}a.push(">"),a=a.join("")}return a=o.createElement(a),s&&(r(s)?a.className=s:u(s)?a.className=s.join(" "):xn(a,s)),2<i.length&&function(t,e,n){function i(n){n&&e.appendChild(r(n)?t.createTextNode(n):n)}for(var o=2;o<n.length;o++){var a=n[o];!c(a)||f(a)&&0<a.nodeType?i(a):R(jn(a)?F(a):a,i)}}(o,a,i),a}("DIV"),n.appendChild(e)}t.c=t.g.render(e,t.a)}return t.c}))},t.verify=function(){fl(this);var t=this;return hl(this,this.render().then(function(e){return new yt(function(n){var r=t.g.getResponse(e);if(r)n(r);else{var i=function(e){e&&(function(t,e){U(t.l,function(t){return t==e})}(t,i),n(e))};t.l.push(i),t.i&&t.g.execute(t.c)}})}))},t.reset=function(){fl(this),null!==this.c&&this.g.reset(this.c)},t.clear=function(){fl(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=Rn(this.m);for(var e;e=t.firstChild;)t.removeChild(e)}},w(pl,ol);var yl="First Second Third Fourth Fifth Sixth Seventh Eighth Ninth".split(" ");function gl(t,e){return{name:t||"",K:"a valid string",optional:!!e,M:r}}function ml(t,e){return{name:t||"",K:"a boolean",optional:!!e,M:i}}function vl(t,e){return{name:t||"",K:"a valid object",optional:!!e,M:f}}function bl(t,e){return{name:t||"",K:"a function",optional:!!e,M:h}}function wl(t,e){return{name:t||"",K:"null",optional:!!e,M:s}}function _l(t){return{name:t?t+"Credential":"credential",K:t?"a valid "+t+" credential":"a valid credential",optional:!1,M:function(e){return!!e&&!(!e.la||t&&e.providerId!==t)}}}function Sl(){return{name:"applicationVerifier",K:"an implementation of firebase.auth.ApplicationVerifier",optional:!1,M:function(t){return!!(t&&r(t.type)&&h(t.verify))}}}function El(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 Tl(t,e){for(var n in e){var r=e[n].name;t[r]=Al(r,t[n],e[n].j)}}function Cl(t,e){for(var n in e){var r=e[n].name;r!==n&&Object.defineProperty(t,r,{get:v(function(t){return this[t]},n),set:v(function(t,e,n,r){dl(t,[n],[r],!0),this[e]=r},r,n,e[n].tb),enumerable:!0})}}function Il(t,e,n,r){t[e]=Al(e,n,r)}function Al(t,e,n){function r(){var t=Array.prototype.slice.call(arguments);return dl(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}Tl(xc.prototype,{Wa:{name:"applyActionCode",j:[gl("code")]},Ja:{name:"checkActionCode",j:[gl("code")]},Za:{name:"confirmPasswordReset",j:[gl("code"),gl("newPassword")]},xb:{name:"createUserWithEmailAndPassword",j:[gl("email"),gl("password")]},Wb:{name:"createUserAndRetrieveDataWithEmailAndPassword",j:[gl("email"),gl("password")]},Zb:{name:"fetchProvidersForEmail",j:[gl("email")]},$b:{name:"fetchSignInMethodsForEmail",j:[gl("email")]},fa:{name:"getRedirectResult",j:[]},oc:{name:"isSignInWithEmailLink",j:[gl("emailLink")]},uc:{name:"onAuthStateChanged",j:[El(vl(),bl(),"nextOrObserver"),bl("opt_error",!0),bl("opt_completed",!0)]},vc:{name:"onIdTokenChanged",j:[El(vl(),bl(),"nextOrObserver"),bl("opt_error",!0),bl("opt_completed",!0)]},kb:{name:"sendPasswordResetEmail",j:[gl("email"),El(vl("opt_actionCodeSettings",!0),wl(null,!0),"opt_actionCodeSettings",!0)]},lb:{name:"sendSignInLinkToEmail",j:[gl("email"),vl("actionCodeSettings")]},mb:{name:"setPersistence",j:[gl("persistence")]},Pa:{name:"signInAndRetrieveDataWithCredential",j:[_l()]},Qa:{name:"signInAnonymously",j:[]},Gc:{name:"signInAnonymouslyAndRetrieveData",j:[]},Hc:{name:"signInWithCredential",j:[_l()]},Nb:{name:"signInWithCustomToken",j:[gl("token")]},Ec:{name:"signInAndRetrieveDataWithCustomToken",j:[gl("token")]},Ob:{name:"signInWithEmailAndPassword",j:[gl("email"),gl("password")]},Ic:{name:"signInWithEmailLink",j:[gl("email"),gl("emailLink",!0)]},Fc:{name:"signInAndRetrieveDataWithEmailAndPassword",j:[gl("email"),gl("password")]},Jc:{name:"signInWithPhoneNumber",j:[gl("phoneNumber"),Sl()]},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:[El({name:"user",K:"an instance of Firebase User",optional:!1,M:function(t){return!!(t&&t instanceof Xu)}},wl(),"user")]},nb:{name:"signOut",j:[]},toJSON:{name:"toJSON",j:[gl(null,!0)]},Sc:{name:"useDeviceLanguage",j:[]},Tc:{name:"verifyPasswordResetCode",j:[gl("code")]}}),Cl(xc.prototype,{lc:{name:"languageCode",tb:El(gl(),wl(),"languageCode")}}),(xc.Persistence=Gs).LOCAL="local",xc.Persistence.SESSION="session",xc.Persistence.NONE="none",Tl(Xu.prototype,{delete:{name:"delete",j:[]},dc:{name:"getIdTokenResult",j:[ml("opt_forceRefresh",!0)]},F:{name:"getIdToken",j:[ml("opt_forceRefresh",!0)]},eb:{name:"linkAndRetrieveDataWithCredential",j:[_l()]},pc:{name:"linkWithCredential",j:[_l()]},qc:{name:"linkWithPhoneNumber",j:[gl("phoneNumber"),Sl()]},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:[_l()]},yc:{name:"reauthenticateWithCredential",j:[_l()]},zc:{name:"reauthenticateWithPhoneNumber",j:[gl("phoneNumber"),Sl()]},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:[El(vl("opt_actionCodeSettings",!0),wl(null,!0),"opt_actionCodeSettings",!0)]},toJSON:{name:"toJSON",j:[gl(null,!0)]},Pc:{name:"unlink",j:[gl("provider")]},pb:{name:"updateEmail",j:[gl("email")]},qb:{name:"updatePassword",j:[gl("password")]},Rc:{name:"updatePhoneNumber",j:[_l("phone")]},rb:{name:"updateProfile",j:[vl("profile")]}}),Tl(Gc.prototype,{execute:{name:"execute"},render:{name:"render"},reset:{name:"reset"},getResponse:{name:"getResponse"}}),Tl(Kc.prototype,{execute:{name:"execute"},render:{name:"render"},reset:{name:"reset"},getResponse:{name:"getResponse"}}),Tl(yt.prototype,{ia:{name:"finally"},s:{name:"catch"},then:{name:"then"}}),Cl(Uu.prototype,{appVerificationDisabled:{name:"appVerificationDisabledForTesting",tb:ml("appVerificationDisabledForTesting")}}),Tl(Vu.prototype,{confirm:{name:"confirm",j:[gl("verificationCode")]}}),Il(Bi,"credential",function(t,e){return new qi(t,e)},[gl("email"),gl("password")]),Tl(Ri.prototype,{ua:{name:"addScope",j:[gl("scope")]},Da:{name:"setCustomParameters",j:[vl("customOAuthParameters")]}}),Il(Ri,"credential",xi,[El(gl(),vl(),"token")]),Il(Bi,"credentialWithLink",Hi,[gl("email"),gl("emailLink")]),Tl(Mi.prototype,{ua:{name:"addScope",j:[gl("scope")]},Da:{name:"setCustomParameters",j:[vl("customOAuthParameters")]}}),Il(Mi,"credential",ji,[El(gl(),vl(),"token")]),Tl(Li.prototype,{ua:{name:"addScope",j:[gl("scope")]},Da:{name:"setCustomParameters",j:[vl("customOAuthParameters")]}}),Il(Li,"credential",Ui,[El(gl(),El(vl(),wl()),"idToken"),El(gl(),wl(),"accessToken",!0)]),Tl(Vi.prototype,{Da:{name:"setCustomParameters",j:[vl("customOAuthParameters")]}}),Il(Vi,"credential",Fi,[El(gl(),vl(),"token"),gl("secret",!0)]),Tl(Pi.prototype,{ua:{name:"addScope",j:[gl("scope")]},credential:{name:"credential",j:[El(gl(),wl(),"idToken",!0),El(gl(),wl(),"accessToken",!0),El(gl(),wl(),"nonce",!0)]},Da:{name:"setCustomParameters",j:[vl("customOAuthParameters")]}}),Il(Gi,"credential",Qi,[gl("verificationId"),gl("verificationCode")]),Tl(Gi.prototype,{Ua:{name:"verifyPhoneNumber",j:[gl("phoneNumber"),Sl()]}}),Tl(qr.prototype,{toJSON:{name:"toJSON",j:[gl(null,!0)]}}),Tl(ro.prototype,{toJSON:{name:"toJSON",j:[gl(null,!0)]}}),Tl(no.prototype,{toJSON:{name:"toJSON",j:[gl(null,!0)]}}),Tl(pl.prototype,{clear:{name:"clear",j:[]},render:{name:"render",j:[]},verify:{name:"verify",j:[]}}),function(){if(void 0===l.a||!l.a.INTERNAL||!l.a.INTERNAL.registerService)throw Error("Cannot find the firebase namespace; be sure to include firebase-app.js before this library.");var t={Auth:xc,Error:qr};Il(t,"EmailAuthProvider",Bi,[]),Il(t,"FacebookAuthProvider",Ri,[]),Il(t,"GithubAuthProvider",Mi,[]),Il(t,"GoogleAuthProvider",Li,[]),Il(t,"TwitterAuthProvider",Vi,[]),Il(t,"OAuthProvider",Pi,[gl("providerId")]),Il(t,"SAMLAuthProvider",Ni,[gl("providerId")]),Il(t,"PhoneAuthProvider",Gi,[{name:"auth",K:"an instance of Firebase Auth",optional:!0,M:function(t){return!!(t&&t instanceof xc)}}]),Il(t,"RecaptchaVerifier",pl,[El(gl(),{name:"",K:"an HTML element",optional:!1,M:function(t){return!!(t&&t instanceof Element)}},"recaptchaContainer"),vl("recaptchaParameters",!0),{name:"app",K:"an instance of Firebase App",optional:!0,M:function(t){return!!(t&&t instanceof l.a.app.App)}}]),l.a.INTERNAL.registerService("auth",function(t,e){return e({INTERNAL:{getUid:m((t=new xc(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){}}),l.a.INTERNAL.extendNamespace({User:Xu})}()}).apply("undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});var h=function(){return function(){}}();n.d(e,"AngularFireAuth",function(){return u}),n.d(e,"AngularFireAuthModule",function(){return h})},CcnG:function(t,e,n){"use strict";var r=n("mrSG"),i=n("pugT"),o=n("K9Ia"),a=n("6blF"),s=n("nkY7"),u=n("Zn8D"),c=n("IUTb"),l=n("S1nX");function h(t){for(var e in t)if(t[e]===h)return e;throw Error("Could not find renamed property on target object.")}function f(t,e){for(var n in e)e.hasOwnProperty(n)&&!t.hasOwnProperty(n)&&(t[n]=e[n])}n.d(e,"ib",function(){return Do}),n.d(e,"jb",function(){return ko}),n.d(e,"kb",function(){return No}),n.d(e,"hb",function(){return fi}),n.d(e,"g",function(){return Ki}),n.d(e,"R",function(){return Bi}),n.d(e,"y",function(){return qi}),n.d(e,"T",function(){return wr}),n.d(e,"X",function(){return br}),n.d(e,"c",function(){return hi}),n.d(e,"C",function(){return di}),n.d(e,"B",function(){return yi}),n.d(e,"b",function(){return gi}),n.d(e,"d",function(){return ci}),n.d(e,"e",function(){return li}),n.d(e,"V",function(){return co}),n.d(e,"M",function(){return Mi}),n.d(e,"Z",function(){return Li}),n.d(e,"u",function(){return Oo}),n.d(e,"f",function(){return Po}),n.d(e,"m",function(){return zr}),n.d(e,"l",function(){return ai}),n.d(e,"G",function(){return Qr}),n.d(e,"H",function(){return Gr}),n.d(e,"a",function(){return O}),n.d(e,"n",function(){return $r}),n.d(e,"r",function(){return Zr}),n.d(e,"P",function(){return D}),n.d(e,"N",function(){return sr}),n.d(e,"S",function(){return b}),n.d(e,"U",function(){return ke}),n.d(e,"q",function(){return Le}),n.d(e,"W",function(){return Q}),n.d(e,"p",function(){return S}),n.d(e,"o",function(){return F}),n.d(e,"A",function(){return q}),n.d(e,"I",function(){return H}),n.d(e,"z",function(){return Oi}),n.d(e,"D",function(){return or}),n.d(e,"E",function(){return rr}),n.d(e,"F",function(){return ir}),n.d(e,"i",function(){return _i}),n.d(e,"j",function(){return Jn}),n.d(e,"k",function(){return tr}),n.d(e,"v",function(){return Ze}),n.d(e,"x",function(){return Je}),n.d(e,"w",function(){return Qi}),n.d(e,"J",function(){return Zi}),n.d(e,"K",function(){return Yi}),n.d(e,"L",function(){return Wr}),n.d(e,"O",function(){return eo}),n.d(e,"h",function(){return ro}),n.d(e,"s",function(){return So}),n.d(e,"t",function(){return Eo}),n.d(e,"Q",function(){return Ct}),n.d(e,"Y",function(){return Ao}),n.d(e,"rb",function(){return At}),n.d(e,"cb",function(){return mi}),n.d(e,"ab",function(){return xn}),n.d(e,"bb",function(){return Zn}),n.d(e,"db",function(){return Fr}),n.d(e,"eb",function(){return Jr}),n.d(e,"fb",function(){return Tr}),n.d(e,"qb",function(){return P}),n.d(e,"ub",function(){return L}),n.d(e,"Ab",function(){return U}),n.d(e,"sb",function(){return ui}),n.d(e,"tb",function(){return si}),n.d(e,"gb",function(){return Sa}),n.d(e,"lb",function(){return Ba}),n.d(e,"mb",function(){return zu}),n.d(e,"nb",function(){return Yo}),n.d(e,"ob",function(){return fs}),n.d(e,"pb",function(){return Ea}),n.d(e,"vb",function(){return Ra}),n.d(e,"wb",function(){return Pa}),n.d(e,"xb",function(){return $a}),n.d(e,"yb",function(){return ps}),n.d(e,"zb",function(){return ds}),n.d(e,"Bb",function(){return xs}),n.d(e,"Cb",function(){return Go}),n.d(e,"Db",function(){return Ls});var p=h({ngComponentDef:h}),d=h({ngInjectableDef:h}),y=h({ngInjectorDef:h}),g=h({ngModuleDef:h}),m=h({ngBaseDef:h}),v=h({__NG_ELEMENT_ID__:h});function b(t){return{providedIn:t.providedIn||null,factory:t.factory,value:void 0}}function w(t){return t.hasOwnProperty(d)?t[d]:null}function _(t){return t.hasOwnProperty(y)?t[y]:null}var S=function(){function t(t,e){this._desc=t,this.ngMetadataName="InjectionToken",this.ngInjectableDef=void 0!==e?b({providedIn:e.providedIn||"root",factory:e.factory}):void 0}return t.prototype.toString=function(){return"InjectionToken "+this._desc},t}(),E="__parameters__",T="__prop__metadata__";function C(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(t){var i=t.apply(void 0,Object(r.g)(e));for(var o in i)this[o]=i[o]}}}function I(t,e,n){var i=C(e);function o(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(this instanceof o)return i.apply(this,e),this;var a=new((t=o).bind.apply(t,Object(r.g)([void 0],e)));return s.annotation=a,s;function s(t,e,n){for(var r=t.hasOwnProperty(E)?t[E]:Object.defineProperty(t,E,{value:[]})[E];r.length<=n;)r.push(null);return(r[n]=r[n]||[]).push(a),t}}return n&&(o.prototype=Object.create(n.prototype)),o.prototype.ngMetadataName=t,o.annotationCls=o,o}function A(t,e,n,i){var o=C(e);function a(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(this instanceof a)return o.apply(this,e),this;var s=new((t=a).bind.apply(t,Object(r.g)([void 0],e)));return function(t,n){var o=t.constructor,a=o.hasOwnProperty(T)?o[T]:Object.defineProperty(o,T,{value:{}})[T];a[n]=a.hasOwnProperty(n)&&a[n]||[],a[n].unshift(s),i&&i.apply(void 0,Object(r.g)([t,n],e))}}return n&&(a.prototype=Object.create(n.prototype)),a.prototype.ngMetadataName=t,a.annotationCls=a,a}var O=new S("AnalyzeForEntryComponents"),D=function(t){return t[t.Emulated=0]="Emulated",t[t.Native=1]="Native",t[t.None=2]="None",t[t.ShadowDom=3]="ShadowDom",t}({}),k="undefined"!=typeof window&&window,N="undefined"!=typeof self&&"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self,P="undefined"!=typeof global&&global||k||N,R=Promise.resolve(0),x=null;function M(){if(!x){var t=P.Symbol;if(t&&t.iterator)x=t.iterator;else for(var e=Object.getOwnPropertyNames(Map.prototype),n=0;n<e.length;++n){var r=e[n];"entries"!==r&&"size"!==r&&Map.prototype[r]===Map.prototype.entries&&(x=r)}}return x}function j(t){"undefined"==typeof Zone?R.then(function(){t&&t.apply(null,null)}):Zone.current.scheduleMicroTask("scheduleMicrotask",t)}function L(t,e){return t===e||"number"==typeof t&&"number"==typeof e&&isNaN(t)&&isNaN(e)}function U(t){if("string"==typeof t)return t;if(t instanceof Array)return"["+t.map(U).join(", ")+"]";if(null==t)return""+t;if(t.overriddenName)return""+t.overriddenName;if(t.name)return""+t.name;var e=t.toString();if(null==e)return""+e;var n=e.indexOf("\n");return-1===n?e:e.substring(0,n)}var V,F=I("Inject",function(t){return{token:t}}),q=I("Optional"),B=I("Self"),H=I("SkipSelf"),z=function(t){return t[t.Default=0]="Default",t[t.Host=1]="Host",t[t.Self=2]="Self",t[t.SkipSelf=4]="SkipSelf",t[t.Optional=8]="Optional",t}({}),W=void 0;function K(t){var e=W;return W=t,e}function G(t){var e=V;return V=t,e}function Q(t,e){return void 0===e&&(e=z.Default),(V||function(t,e){if(void 0===e&&(e=z.Default),void 0===W)throw new Error("inject() must be called from an injection context");return null===W?X(t,void 0,e):W.get(t,e&z.Optional?null:void 0,e)})(t,e)}function X(t,e,n){var r=w(t);if(r&&"root"==r.providedIn)return void 0===r.value?r.value=r.factory():r.value;if(n&z.Optional)return null;if(void 0!==e)return e;throw new Error("Injector: NOT_FOUND ["+U(t)+"]")}function Y(t){for(var e=[],n=0;n<t.length;n++){var r=t[n];if(Array.isArray(r)){if(0===r.length)throw new Error("Arguments array must have arguments.");for(var i=void 0,o=z.Default,a=0;a<r.length;a++){var s=r[a];s instanceof q||"Optional"===s.ngMetadataName?o|=z.Optional:s instanceof H||"SkipSelf"===s.ngMetadataName?o|=z.SkipSelf:s instanceof B||"Self"===s.ngMetadataName?o|=z.Self:i=s instanceof F?s.token:s}e.push(Q(i,o))}else e.push(Q(r))}return e}var J=8,Z=8,$=9,tt=-1,et=function(){return function(t,e,n){this.factory=t,this.resolving=!1,this.canSeeViewProviders=e,this.injectImpl=n}}(),nt=et.prototype,rt=17,it=0,ot=1,at=2,st=3,ut=4,ct=5,lt=6,ht=7,ft=8,pt=9,dt=10,yt=11,gt=12,mt=14,vt=16;function bt(t,e,n){t.afterContentInit&&(e.contentHooks||(e.contentHooks=[])).push(n,t.afterContentInit),t.afterContentChecked&&((e.contentHooks||(e.contentHooks=[])).push(n,t.afterContentChecked),(e.contentCheckHooks||(e.contentCheckHooks=[])).push(n,t.afterContentChecked))}function wt(t,e,n){t.afterViewInit&&(e.viewHooks||(e.viewHooks=[])).push(n,t.afterViewInit),t.afterViewChecked&&((e.viewHooks||(e.viewHooks=[])).push(n,t.afterViewChecked),(e.viewCheckHooks||(e.viewCheckHooks=[])).push(n,t.afterViewChecked))}function _t(t,e,n){null!=t.onDestroy&&(e.destroyHooks||(e.destroyHooks=[])).push(n,t.onDestroy)}function St(t,e,n,r){var i=r?e:n;i&&Et(t,i)}function Et(t,e){for(var n=0;n<e.length;n+=2)e[n+1].call(t[e[n]])}function Tt(t,e){var n=At(t),r=At(e);return n&&r?function(t,e,n){for(var r=t[M()](),i=e[M()]();;){var o=r.next(),a=i.next();if(o.done&&a.done)return!0;if(o.done||a.done)return!1;if(!n(o.value,a.value))return!1}}(t,e,Tt):!(n||!t||"object"!=typeof t&&"function"!=typeof t||r||!e||"object"!=typeof e&&"function"!=typeof e)||L(t,e)}var Ct=function(){function t(t){this.wrapped=t}return t.wrap=function(e){return new t(e)},t.unwrap=function(e){return t.isWrapped(e)?e.wrapped:e},t.isWrapped=function(e){return e instanceof t},t}(),It=function(){function t(t,e,n){this.previousValue=t,this.currentValue=e,this.firstChange=n}return t.prototype.isFirstChange=function(){return this.firstChange},t}();function At(t){return!!Ot(t)&&(Array.isArray(t)||!(t instanceof Map)&&M()in t)}function Ot(t){return null!==t&&("function"==typeof t||"object"==typeof t)}var Dt=0,kt=1,Nt=6,Pt="__ngContext__";function Rt(t){return"function"==typeof t?t.name||t:"string"==typeof t?t:null==t?"":""+t}function xt(t){for(;Array.isArray(t);)t=t[ct];return t}function Mt(t,e){return xt(e[t.index])}function jt(t,e){var n=e[t];return n.length>=rt?n:n[ct]}function Lt(t){return t[Pt]}function Ut(t){var e=Lt(t);return e?Array.isArray(e)?e:e.lViewData:null}function Vt(t){return 32767&t}function Ft(t,e){for(var n=t>>16,r=e;n>0;)r=r[vt],n--;return r}var qt,Bt,Ht,zt,Wt,Kt,Gt,Qt,Xt=("undefined"!=typeof requestAnimationFrame&&requestAnimationFrame||setTimeout).bind(P);function Yt(){return qt}function Jt(){return Bt}function Zt(){return Ht}function $t(t){Ht=t}function te(t,e){Ht=t,Qt=e}function ee(){return zt}function ne(t){zt=t}function re(){return Wt}function ie(){return Gt}function oe(){return Qt}var ae=!1;function se(){return ae}function ue(t){ae=t}var ce=!0;function le(t){ce=t}function he(t,e){var n=Qt;return Wt=t&&t[it],Gt=t&&1==(1&t[ot]),ce=t&&Wt.firstTemplatePass,qt=t&&t[yt],Ht=e,zt=!0,Qt=t,n&&(n[ut]=Kt),Kt=t&&t[ut],n}function fe(t,e){e||(ae||St(Qt,Wt.viewHooks,Wt.viewCheckHooks,Gt),Qt[ot]&=-6),Qt[ot]|=16,Qt[ht]=Wt.bindingStartIndex,he(t,null)}var pe=!1;function de(t){var e=pe;return pe=t,e}var ye=255,ge=0;function me(t,e){var n=be(t,e);if(-1!==n)return n;var r=e[it];r.firstTemplatePass&&(t.injectorIndex=e.length,ve(r.data,t),ve(e,null),ve(r.blueprint,null));var i=we(t,e),o=Vt(i),a=Ft(i,e),s=t.injectorIndex;if(i!==tt)for(var u=a[it].data,c=0;c<8;c++)e[s+c]=a[o+c]|u[o+c];return e[s+Z]=i,s}function ve(t,e){t.push(0,0,0,0,0,0,0,0,e)}function be(t,e){return-1===t.injectorIndex||t.parent&&t.parent.injectorIndex===t.injectorIndex||null==e[t.injectorIndex+Z]?-1:t.injectorIndex}function we(t,e){if(t.parent&&-1!==t.parent.injectorIndex)return t.parent.injectorIndex;for(var n=e[lt],r=1;n&&-1===n.injectorIndex;)n=(e=e[vt])[lt],r++;return n?n.injectorIndex|r<<16|(n&&3===n.type?32768:0):-1}var _e={};function Se(t,e,n,r){var i=e[it],o=i.data[t+J],a=o.flags,s=o.providerIndexes,u=i.data,c=!1;(null==r&&function(t){return 4096==(4096&t.flags)}(o)&&pe||null!=r&&r!=i&&(null==i.node||3===i.node.type))&&(c=!0);for(var l=65535&s,h=a>>16,f=4095&a,p=c?l:l+(s>>16);p<h+f;p++){var d=u[p];if(p<h&&n===d||p>=h&&d.type===n)return Ee(u,e,p,o)}return _e}function Ee(t,e,n,r){var i,o=e[n];if(null!=(i=o)&&"object"==typeof i&&Object.getPrototypeOf(i)==nt){var a=o;if(a.resolving)throw new Error("Circular dep for "+Rt(t[n]));var s=de(a.canSeeViewProviders);a.resolving=!0;var u=void 0;a.injectImpl&&(u=G(a.injectImpl));var c=Zt(),l=oe();te(r,e);try{o=e[n]=a.factory(null,t,e,r)}finally{a.injectImpl&&G(u),de(s),a.resolving=!1,te(c,l)}}return o}function Te(t,e,n){var r=64&t,i=32&t;return!!((128&t?r?i?n[e+7]:n[e+6]:i?n[e+5]:n[e+4]:r?i?n[e+3]:n[e+2]:i?n[e+1]:n[e])&1<<t)}function Ce(t,e){return!(t&z.Self||t&z.Host&&32768&e)}var Ie=function(){function t(t,e){this._tNode=t,this._hostView=e,this._injectorIndex=me(t,e)}return t.prototype.get=function(t){return te(this._tNode,this._hostView),function(t,e,n,r,i){void 0===r&&(r=z.Default);var o=function(t){var e=t[v];return"number"==typeof e?e&ye:e}(n);if("function"==typeof o){var a=Zt(),s=oe();te(t,e);try{var u=o();if(null!=u||r&z.Optional)return u;throw new Error("No provider for "+Rt(n))}finally{te(a,s)}}else if("number"==typeof o){var c=null,l=be(t,e),h=tt;for((-1===l||r&z.SkipSelf)&&(Ce(r,h=-1===l?we(t,e):e[l+Z])?(c=e[it],l=Vt(h),e=Ft(h,e)):l=-1);-1!==l;){h=e[l+Z];var f=e[it];if(Te(o,l,f.data)){var p=Se(l,e,n,c);if(p!==_e)return p}Ce(r,h)&&Te(o,l,e)?(c=f,l=Vt(h),e=Ft(h,e)):l=-1}}if(r&z.Optional&&void 0===i&&(i=null),0==(r&(z.Self|z.Host))){var d=e[dt];return d?d.get(n,i,r&z.Optional):X(n,i,r&z.Optional)}if(r&z.Optional)return i;throw new Error("NodeInjector: NOT_FOUND ["+Rt(n)+"]")}(this._tNode,this._hostView,t)},t}();function Ae(t,e){t[Pt]=e}function Oe(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]}var De=h({__forward_ref__:h});function ke(t){return t.__forward_ref__=ke,t.toString=function(){return U(this())},t}function Ne(t){var e=t;return"function"==typeof e&&e.hasOwnProperty(De)&&e.__forward_ref__===ke?e():t}var Pe="__source",Re=new Object,xe=Re,Me=new S("INJECTOR"),je=function(){function t(){}return t.prototype.get=function(t,e){if(void 0===e&&(e=Re),e===Re)throw new Error("NullInjectorError: No provider for "+U(t)+"!");return e},t}(),Le=function(){function t(){}return t.create=function(t,e){return Array.isArray(t)?new Ge(t,e):new Ge(t.providers,t.parent,t.name||null)},t.THROW_IF_NOT_FOUND=Re,t.NULL=new je,t.ngInjectableDef=b({providedIn:"any",factory:function(){return Q(Me)}}),t.__NG_ELEMENT_ID__=function(){return Ue()},t}(),Ue=Oe,Ve=function(t){return t},Fe=[],qe=Ve,Be=function(){return Array.prototype.slice.call(arguments)},He=h({provide:String,useValue:h}),ze=Le.NULL,We=/\n/gm,Ke="\u0275",Ge=function(){function t(t,e,n){void 0===e&&(e=ze),void 0===n&&(n=null),this.parent=e,this.source=n;var r=this._records=new Map;r.set(Le,{token:Le,fn:Ve,deps:Fe,value:this,useNew:!1}),r.set(Me,{token:Me,fn:Ve,deps:Fe,value:this,useNew:!1}),function t(e,n){if(n)if((n=Ne(n))instanceof Array)for(var r=0;r<n.length;r++)t(e,n[r]);else{if("function"==typeof n)throw Ye("Function/Class not supported",n);if(!n||"object"!=typeof n||!n.provide)throw Ye("Unexpected provider",n);var i=Ne(n.provide),o=function(t){var e=function(t){var e=Fe,n=t.deps;if(n&&n.length){e=[];for(var r=0;r<n.length;r++){var i=6;if((u=Ne(n[r]))instanceof Array)for(var o=0,a=u;o<a.length;o++){var s=a[o];s instanceof q||s==q?i|=1:s instanceof H||s==H?i&=-3:s instanceof B||s==B?i&=-5:u=s instanceof F?s.token:Ne(s)}e.push({token:u,options:i})}}else if(t.useExisting){var u;e=[{token:u=Ne(t.useExisting),options:6}]}else if(!(n||He in t))throw Ye("'deps' required",t);return e}(t),n=Ve,r=Fe,i=!1,o=Ne(t.provide);if(He in t)r=t.useValue;else if(t.useFactory)n=t.useFactory;else if(t.useExisting) ;else if(t.useClass)i=!0,n=Ne(t.useClass);else{if("function"!=typeof o)throw Ye("StaticProvider does not have [useValue|useFactory|useExisting|useClass] or [provide] is not newable",t);i=!0,n=o}return{deps:e,fn:n,useNew:i,value:r}}(n);if(!0===n.multi){var a=e.get(i);if(a){if(a.fn!==Be)throw Qe(i)}else e.set(i,a={token:n.provide,deps:[],useNew:!1,fn:Be,value:Fe});a.deps.push({token:i=n,options:6})}var s=e.get(i);if(s&&s.fn==Be)throw Qe(i);e.set(i,o)}}(r,t)}return t.prototype.get=function(t,e,n){void 0===n&&(n=z.Default);var i=this._records.get(t);try{return function t(e,n,i,o,a,s){try{return function(e,n,i,o,a,s){var u,c;if(!n||s&z.SkipSelf)s&z.Self||(c=o.get(e,a,z.Default));else{if((c=n.value)==qe)throw Error(Ke+"Circular dependency");if(c===Fe){n.value=qe;var l=n.useNew,h=n.fn,f=n.deps,p=Fe;if(f.length){p=[];for(var d=0;d<f.length;d++){var y=f[d],g=y.options,m=2&g?i.get(y.token):void 0;p.push(t(y.token,m,i,m||4&g?o:ze,1&g?null:Le.THROW_IF_NOT_FOUND,z.Default))}}n.value=c=l?new((u=h).bind.apply(u,Object(r.g)([void 0],p))):h.apply(void 0,p)}}return c}(e,n,i,o,a,s)}catch(u){throw u instanceof Error||(u=new Error(u)),(u.ngTempTokenPath=u.ngTempTokenPath||[]).unshift(e),n&&n.value==qe&&(n.value=Fe),u}}(t,i,this._records,this.parent,e,n)}catch(a){var o=a.ngTempTokenPath;throw t[Pe]&&o.unshift(t[Pe]),a.message=Xe("\n"+a.message,o,this.source),a.ngTokenPath=o,a.ngTempTokenPath=null,a}},t.prototype.toString=function(){var t=[];return this._records.forEach(function(e,n){return t.push(U(n))}),"StaticInjector["+t.join(", ")+"]"},t}();function Qe(t){return Ye("Cannot mix multi providers and regular providers",t)}function Xe(t,e,n){void 0===n&&(n=null),t=t&&"\n"===t.charAt(0)&&t.charAt(1)==Ke?t.substr(2):t;var r=U(e);if(e instanceof Array)r=e.map(U).join(" -> ");else if("object"==typeof e){var i=[];for(var o in e)if(e.hasOwnProperty(o)){var a=e[o];i.push(o+":"+("string"==typeof a?JSON.stringify(a):U(a)))}r="{"+i.join(", ")+"}"}return"StaticInjectorError"+(n?"("+n+")":"")+"["+r+"]: "+t.replace(We,"\n ")}function Ye(t,e){return new Error(Xe(t,e))}var Je=function(){return function(){}}(),Ze=function(){return function(){}}(),$e="ngProjectAs";function tn(t){return!!t.listen}var en={createRenderer:function(t,e){return document}},nn=[];function rn(t){for(var e=t[lt];e&&2===e.type;)e=(t=t[at])[lt];return t}function on(t,e,n,r,i){0===t?tn(e)?e.insertBefore(n,r,i):n.insertBefore(r,i,!0):1===t?tn(e)?e.removeChild(n,r):n.removeChild(r):2===t&&e.destroyNode(r)}function an(t){var e=t[it].childIndex;return-1===e?null:t[e]}function sn(t,e){var n;return t.length>=rt&&(n=t[lt])&&2===n.type?function(e,n){if(-1===e.index){var r=t[mt];return r>-1?t[at][r]:null}return t[at][e.parent.index]}(n):t[at]===e?null:t[at]}function un(t){if(t.length>=rt){var e=t;!function(t){var e=t[it].cleanup;if(null!=e){for(var n=0;n<e.length-1;n+=2)"string"==typeof e[n]?(xt(t[e[n+1]]).removeEventListener(e[n],t[ft][e[n+2]],e[n+3]),n+=2):"number"==typeof e[n]?(0,t[ft][e[n]])():e[n].call(t[ft][e[n+1]]);t[ft]=null}}(e),function(t){var e,n=t[it];null!=n&&null!=(e=n.destroyHooks)&&Et(t,e)}(e),(r=(n=e)[it]&&n[it].pipeDestroyHooks)&&Et(n,r),-1===e[it].id&&tn(e[yt])&&e[yt].destroy()}var n,r}var cn={},ln=Promise.resolve(null);function hn(t,e){var n=re(),r=ce;if(n.firstTemplatePass=!1,le(!1),1!==e){var i=ie(),o=se();o||function(t,e,n){16&t[ot]&&(St(t,e.initHooks,e.checkHooks,n),t[ot]&=-17)}(t,n,i),function(e){for(var n=an(t);null!==n;n=n[st])if(n.length<rt&&-1===n[Dt])for(var r=n,i=0;i<r[kt].length;i++){var o=r[kt][i];dn(o,o[it],o[pt],2)}}(),function(t){if(null!=t.contentQueries)for(var e=0;e<t.contentQueries.length;e+=2){var n=t.contentQueries[e];t.data[n].contentQueriesRefresh(n-rt,t.contentQueries[e+1])}}(n),o||St(t,n.contentHooks,n.contentCheckHooks,i),function(t,e){if(t.expandoInstructions)for(var n=e[ht]=t.expandoStartIndex,r=-1,i=-1,o=0;o<t.expandoInstructions.length;o++){var a=t.expandoInstructions[o];if("number"==typeof a)if(a<=0){i=-a;var s=t.expandoInstructions[++o];r=n+=$+s}else n+=a;else e[ht]=n,$t(re().data[i+rt]),a(r-rt,i),r++}}(n,t)}!function(t,e,n){if(null!=t)for(var r=0;r<t.length;r++)Sn(t[r],e,n)}(n.components,r,e)}function fn(t,e,n,r,i,o,a){var s=n.blueprint.slice();return s[ot]=25|i,s[at]=s[vt]=t,s[pt]=r,s[dt]=void 0===a?t?t[dt]:null:a,s[yt]=e,s[gt]=o||null,s}function pn(t,e,n,r,i){var o=oe(),a=re(),s=t+rt;o[s]=n;var u=a.data[s];if(null==u){var c=Zt(),l=ee();u=a.data[s]=_n(o,e,s,r,i,null),c&&(!l||null!=c.child||null===u.parent&&2!==c.type?l||(c.next=u):c.child=u)}return null==a.firstChild&&3===e&&(a.firstChild=u),$t(u),ne(!0),u}function dn(t,e,n,r){var i,o=ee(),a=Zt();if(ne(!0),$t(null),64&t[ot])Tn(function(t){for(var e=Array.isArray(t)?t:Ut(t);e&&!(64&e[ot]);)e=e[at];return e}(t)[pt]);else try{ne(!0),$t(null),i=he(t,t[lt]),vn(),e.template(r,n),2&r?hn(t,null):(t[it].firstTemplatePass=!1,le(!1))}finally{fe(i,1==(1&r)),ne(o),$t(a)}}function yn(t,e,n,r){var i=Jt(),o=he(t,t[lt]);try{i.begin&&i.begin(),r&&(vn(),r(n||gn(t),e)),hn(t,n)}finally{i.end&&i.end(),fe(o)}}function gn(t){return 1&t[ot]?3:2}var mn=null;function vn(){mn=null}function bn(t,e,n,r,i,o,a){var s=rt+n,u=s+r,c=function(t,e){var n=new Array(e).fill(null,0,t).fill(cn,t);return n[mt]=-1,n[ht]=t,n}(s,u);return c[it]={id:t,blueprint:c,template:e,viewQuery:a,node:null,data:c.slice(),childIndex:-1,bindingStartIndex:s,expandoStartIndex:u,expandoInstructions:null,firstTemplatePass:!0,initHooks:null,checkHooks:null,contentHooks:null,contentCheckHooks:null,viewHooks:null,viewCheckHooks:null,destroyHooks:null,pipeDestroyHooks:null,cleanup:null,contentQueries:null,components:null,directiveRegistry:"function"==typeof i?i():i,pipeRegistry:"function"==typeof o?o():o,firstChild:null}}function wn(t,e){!function(t){Bt=t}(t);var n=t.createRenderer(null,null);return"string"==typeof e?tn(n)?n.selectRootElement(e):n.querySelector(e):e}function _n(t,e,n,r,i,o){var a=Zt(),s=ee()?a:a&&a.parent,u=s&&t&&s!==t[lt]?s:null;return{type:e,index:n,injectorIndex:u?u.injectorIndex:-1,flags:0,providerIndexes:0,tagName:r,attrs:i,localNames:null,initialInputs:void 0,inputs:void 0,outputs:void 0,tViews:o,next:null,child:null,parent:u,detached:null,stylingTemplate:null,projection:null}}function Sn(t,e,n){var r=jt(t,oe());En(r)&&6&r[ot]&&(e&&function(t){for(var e=t[it],n=t.length;n<e.blueprint.length;n++)t[n]=e.blueprint[n]}(r),An(r,r[pt],n))}function En(t){return 8==(8&t[ot])}function Tn(t){for(var e=0;e<t.components.length;e++){var n=t.components[e];yn(Ut(n),n,2)}}function Cn(t){An(function(t){var e,n=Lt(t);if(Array.isArray(n)){var r=function(t,e){var n=t[it].components;if(n)for(var r=0;r<n.length;r++){var i=n[r];if(jt(i,t)[pt]===e)return i}else if(jt(rt,t)[pt]===e)return rt;return-1}(n,t);(i=function(t,e,n){return{lViewData:t,nodeIndex:e,native:n,component:void 0,directives:void 0,localRefs:void 0}}(n,r,(e=jt(r,n))[ct])).component=t,Ae(t,i),Ae(i.native,i)}else{var i;e=jt((i=n).nodeIndex,i.lViewData)}return e}(t),t,null)}function In(t){Tn(t[pt])}function An(t,e,n){var r=t[it],i=he(t,t[lt]),o=r.template,a=r.viewQuery;try{vn(),function(e,r,i,o){e&&(1===n||null===n&&1&t[ot])&&e(1,o)}(a,0,0,e),o(n||gn(t),e),hn(t,n),function(e,n,r){e&&2&t[ot]&&e(2,r)}(a,0,e)}finally{fe(i,1===n)}}var On,Dn=ln,kn=function(t){function e(e){var n=t.call(this,e,null,-1)||this;return n._view=e,n}return Object(r.c)(e,t),e.prototype.detectChanges=function(){In(this._view)},e.prototype.checkNoChanges=function(){!function(t){ue(!0);try{In(t)}finally{ue(!1)}}(this._view)},Object.defineProperty(e.prototype,"context",{get:function(){return null},enumerable:!0,configurable:!0}),e}(function(){function t(t,e,n){this._context=e,this._componentIndex=n,this._appRef=null,this._viewContainerRef=null,this._tViewNode=null,this._view=t}return Object.defineProperty(t.prototype,"rootNodes",{get:function(){return null==this._view[ct]?function t(e,n,r){for(var i=n.child;i;)r.push(Mt(i,e)),4===i.type&&t(e,i,r),i=i.next;return r}(this._view,this._view[lt],[]):[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"context",{get:function(){return this._context?this._context:this._lookUpContext()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"destroyed",{get:function(){return 32==(32&this._view[ot])},enumerable:!0,configurable:!0}),t.prototype.destroy=function(){var t,e;this._viewContainerRef&&En(this._view)&&(this._viewContainerRef.detach(this._viewContainerRef.indexOf(this)),this._viewContainerRef=null),tn(e=(t=this._view)[yt])&&e.destroyNode&&function(e,n,r,i,o){for(var a=t[it].node,s=-1,u=t,c=a.child;c;){var l=null;if(3===c.type){on(2,r,null,Mt(c,u),o);var h=u[c.index];y=h,Array.isArray(y)&&"number"==typeof y[Dt]&&on(2,r,null,h[Nt],o)}else if(0===c.type){var f=u[c.index];on(2,r,null,f[Nt],o),f[kt].length&&(l=(u=f[kt][0])[it].node,o=f[Nt])}else if(1===c.type){var p=rn(u),d=p[lt].projection[c.projection];nn[++s]=c,nn[++s]=u,d&&(l=(u=p[at])[it].data[d.index])}else l=c.child;if(null===l)for(null===c.next&&8192&c.flags&&(u=nn[s--],c=nn[s--]),l=c.next;!l;){if(null===(c=c.parent||u[it].node)||c===a)return null;0===c.type&&(o=(u=u[at])[c.index][Nt]),l=2===c.type&&u[st]?(u=u[st])[it].node:c.next}c=l}var y}(0,0,e),function(t){if(-1===t[it].childIndex)return un(t);for(var e=an(t);e;){var n=null;if(e.length>=rt?e[it].childIndex>-1&&(n=an(e)):e[kt].length&&(n=e[kt][0]),null==n){for(;e&&!e[st]&&e!==t;)un(e),e=sn(e,t);un(e||t),n=e&&e[st]}e=n}}(t),t[ot]|=32},t.prototype.onDestroy=function(t){var e,n;n=t,function(t){return t[ft]||(t[ft]=[])}(e=this._view).push(n),e[it].firstTemplatePass&&function(t){return t[it].cleanup||(t[it].cleanup=[])}(e).push(e[ft].length-1,null)},t.prototype.markForCheck=function(){!function(t){for(var e=t;e&&!(64&e[ot]);)e[ot]|=4,e=e[at];var n,r,i;e[ot]|=4,i=0===(n=e[pt]).flags,n.flags|=1,i&&n.clean==ln&&(n.clean=new Promise(function(t){return r=t}),n.scheduler(function(){if(1&n.flags&&(n.flags&=-2,Tn(n)),2&n.flags){n.flags&=-3;var t=n.playerHandler;t&&t.flushPlayers()}n.clean=ln,r(null)}))}(this._view)},t.prototype.detach=function(){this._view[ot]&=-9},t.prototype.reattach=function(){this._view[ot]|=8},t.prototype.detectChanges=function(){var t=Jt();t.begin&&t.begin(),Cn(this.context),t.end&&t.end()},t.prototype.checkNoChanges=function(){!function(t){ue(!0);try{Cn(t)}finally{ue(!1)}}(this.context)},t.prototype.attachToViewContainerRef=function(t){this._viewContainerRef=t},t.prototype.detachFromAppRef=function(){this._appRef=null},t.prototype.attachToAppRef=function(t){this._appRef=t},t.prototype._lookUpContext=function(){return this._context=this._view[at][this._componentIndex]},t}());function Nn(t,e,n,r,i){var o=n[it],a=function(t,e,n){var r=Zt();t.firstTemplatePass&&(n.providersResolver&&n.providersResolver(n),function(t,e,n){var i=-(r.index-rt),o=t.data.length-(65535&r.providerIndexes);(t.expandoInstructions||(t.expandoInstructions=[])).push(i,o,1)}(t),function(t,e,n,r){t.data.push(n);var i=new et(r,function(t){return null!==t.template}(n),null);t.blueprint.push(i),e.push(i),function(t,e){t.expandoInstructions.push(e.hostBindings||Oe),e.hostVars&&t.expandoInstructions.push(e.hostVars)}(t,n)}(t,e,n,n.factory));var i=Ee(t.data,e,e.length-1,r);return function(t,e,n,r){var i=Mt(e,t);Ae(n,t),i&&Ae(i,t),null!=r.attributes&&3==e.type&&function(t,e){for(var n=Yt(),r=tn(n),i=0;i<e.length;){var o=e[i];if(1===o)break;if(o===$e)i+=2;else if(0===o){var a=e[i+1],s=e[i+2],u=e[i+3];r?n.setAttribute(t,s,u,a):t.setAttributeNS(a,s,u),i+=4}else u=e[i+1],r?n.setAttribute(t,o,u):t.setAttribute(o,u),i+=2}}(i,r.attributes)}(e,r,i,n),i}(o,n,e);return r.components.push(a),t[pt]=a,i&&i.forEach(function(t){return t(a,e)}),o.firstTemplatePass&&function(t,e,n){for(var r=0;r<n;r++)e.push(cn),t.blueprint.push(cn),t.data.push(null)}(o,n,e.hostVars),a}function Pn(t,e){return{components:[],scheduler:t||Xt,clean:Dn,playerHandler:e||null,flags:0}}function Rn(t,e){var n,r,i,o,a=Ut(t)[it],s=a.data.length-1;n=s,i=e.doCheck,o=a,(r=e.onInit)&&(o.initHooks||(o.initHooks=[])).push(n,r),i&&((o.initHooks||(o.initHooks=[])).push(n,i),(o.checkHooks||(o.checkHooks=[])).push(n,i)),function(t,e){if(e.firstTemplatePass)for(var n=t>>16,r=n+(4095&t),i=n;i<r;i++){var o=e.data[i];bt(o,e,i),wt(o,e,i),_t(o,e,i)}}(s<<16|1,a)}var xn=new S("The presence of this token marks an injector as being the root injector."),Mn={},jn={},Ln=[],Un=void 0;function Vn(){return void 0===Un&&(Un=new je),Un}var Fn=function(){function t(t,e,n){var r=this;this.parent=n,this.records=new Map,this.injectorDefTypes=new Set,this.onDestroy=new Set,this.destroyed=!1;var i=[];Hn([t],function(t){return r.processInjectorType(t,[],i)}),e&&Hn(e,function(t){return r.processProvider(t)}),this.records.set(Me,Bn(void 0,this)),this.isRootInjector=this.records.has(xn),this.injectorDefTypes.forEach(function(t){return r.get(t)})}return t.prototype.destroy=function(){this.assertNotDestroyed(),this.destroyed=!0;try{this.onDestroy.forEach(function(t){return t.ngOnDestroy()})}finally{this.records.clear(),this.onDestroy.clear(),this.injectorDefTypes.clear()}},t.prototype.get=function(t,e,n){void 0===e&&(e=xe),void 0===n&&(n=z.Default),this.assertNotDestroyed();var r,i=K(this);try{if(!(n&z.SkipSelf)){var o=this.records.get(t);if(void 0===o){var a=("function"==typeof(r=t)||"object"==typeof r&&r instanceof S)&&w(t);a&&this.injectableDefInScope(a)&&(o=Bn(qn(t),Mn),this.records.set(t,o))}if(void 0!==o)return this.hydrate(t,o)}return(n&z.Self?Vn():this.parent).get(t,e)}finally{K(i)}},t.prototype.assertNotDestroyed=function(){if(this.destroyed)throw new Error("Injector has already been destroyed.")},t.prototype.processInjectorType=function(t,e,n){var r=this;if(t=Ne(t)){var i=_(t),o=null==i&&t.ngModule||void 0,a=void 0===o?t:o;if(-1===n.indexOf(a)){var s=void 0!==o&&t.providers||Ln;if(void 0!==o&&(i=_(o)),null!=i){if(this.injectorDefTypes.add(a),this.records.set(a,Bn(i.factory)),null!=i.imports){n.push(a);try{Hn(i.imports,function(t){return r.processInjectorType(t,e,n)})}finally{}}null!=i.providers&&Hn(i.providers,function(t){return r.processProvider(t)}),Hn(s,function(t){return r.processProvider(t)})}}}},t.prototype.processProvider=function(t){var e=Wn(t=Ne(t))?t:Ne(t.provide),n=function(t){var e=function(t){var e=void 0;if(Wn(t))return qn(Ne(t));if(zn(t))e=function(){return Ne(t.useValue)};else if(t.useExisting)e=function(){return Q(Ne(t.useExisting))};else if(t.useFactory)e=function(){return t.useFactory.apply(t,Object(r.g)(Y(t.deps||[])))};else{var n=Ne(t.useClass||t.provide);if(!t.deps)return qn(n);e=function(){return new(n.bind.apply(n,Object(r.g)([void 0],Y(t.deps))))}}return e}(t);return zn(t)?Bn(void 0,t.useValue):Bn(e,Mn)}(t);if(Wn(t)||!0!==t.multi){var i=this.records.get(e);if(i&&void 0!==i.multi)throw new Error("Mixed multi-provider for "+U(e))}else{var o=this.records.get(e);if(o){if(void 0===o.multi)throw new Error("Mixed multi-provider for "+e+".")}else(o=Bn(void 0,Mn,!0)).factory=function(){return Y(o.multi)},this.records.set(e,o);e=t,o.multi.push(t)}this.records.set(e,n)},t.prototype.hydrate=function(t,e){if(e.value===jn)throw new Error("Circular dep for "+U(t));var n;return e.value===Mn&&(e.value=jn,e.value=e.factory()),"object"==typeof e.value&&e.value&&"object"==typeof(n=e.value)&&null!=n&&n.ngOnDestroy&&"function"==typeof n.ngOnDestroy&&this.onDestroy.add(e.value),e.value},t.prototype.injectableDefInScope=function(t){return!!t.providedIn&&("string"==typeof t.providedIn?"any"===t.providedIn||"root"===t.providedIn&&this.isRootInjector:this.injectorDefTypes.has(t.providedIn))},t}();function qn(t){var e=w(t);if(null===e){if(t instanceof S)throw new Error("Token "+U(t)+" is missing an ngInjectableDef definition.");return function(){return new t}}return e.factory}function Bn(t,e,n){return void 0===e&&(e=Mn),void 0===n&&(n=!1),{factory:t,value:e,multi:n?[]:void 0}}function Hn(t,e){t.forEach(function(t){return Array.isArray(t)?Hn(t,e):e(t)})}function zn(t){return He in t}function Wn(t){return"function"==typeof t}var Kn=function(){return function(){}}(),Gn=function(){return function(){}}();function Qn(t){var e=Error("No component factory found for "+U(t)+". Did you add it to @NgModule.entryComponents?");return e[Xn]=t,e}var Xn="ngComponent",Yn=function(){function t(){}return t.prototype.resolveComponentFactory=function(t){throw Qn(t)},t}(),Jn=function(){function t(){}return t.NULL=new Yn,t}(),Zn=function(){function t(t,e,n){this._parent=e,this._ngModule=n,this._factories=new Map;for(var r=0;r<t.length;r++){var i=t[r];this._factories.set(i.componentType,i)}}return t.prototype.resolveComponentFactory=function(t){var e=this._factories.get(t);if(!e&&this._parent&&(e=this._parent.resolveComponentFactory(t)),!e)throw Qn(t);return new $n(e,this._ngModule)},t}(),$n=function(t){function e(e,n){var r=t.call(this)||this;return r.factory=e,r.ngModule=n,r.selector=e.selector,r.componentType=e.componentType,r.ngContentSelectors=e.ngContentSelectors,r.inputs=e.inputs,r.outputs=e.outputs,r}return Object(r.c)(e,t),e.prototype.create=function(t,e,n,r){return this.factory.create(t,e,n,r||this.ngModule)},e}(Gn),tr=function(){function t(t){this.nativeElement=t}return t.__NG_ELEMENT_ID__=function(){return er(t)},t}(),er=Oe,nr=function(){return function(){}}(),rr=function(){return function(){}}(),ir=function(t){return t[t.Important=1]="Important",t[t.DashCase=2]="DashCase",t}({}),or=function(){function t(){}return t.__NG_ELEMENT_ID__=function(){return ar()},t}(),ar=Oe,sr=function(){return function(t){this.full=t,this.major=t.split(".")[0],this.minor=t.split(".")[1],this.patch=t.split(".").slice(2).join(".")}}(),ur=new sr("7.1.4"),cr=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(r.c)(e,t),e.prototype.resolveComponentFactory=function(t){return new yr(t[p]||null)},e}(Jn);function lr(t){var e=[];for(var n in t)t.hasOwnProperty(n)&&e.push({propName:t[n],templateName:n});return e}var hr=new S("ROOT_CONTEXT_TOKEN",{providedIn:"root",factory:function(){return Pn(Q(fr))}}),fr=new S("SCHEDULER_TOKEN",{providedIn:"root",factory:function(){return Xt}}),pr=new S("WRAP_RENDERER_FACTORY2"),dr={},yr=function(t){function e(e){var n=t.call(this)||this;return n.componentDef=e,n.componentType=e.type,n.selector=e.selectors[0][0],n.ngContentSelectors=[],n}return Object(r.c)(e,t),Object.defineProperty(e.prototype,"inputs",{get:function(){return lr(this.componentDef.inputs)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"outputs",{get:function(){return lr(this.componentDef.outputs)},enumerable:!0,configurable:!0}),e.prototype.create=function(t,e,n,i){var o,a=void 0===n;o=i?i.injector.get(pr,function(t){return t})(i.injector.get(rr)):en;var s,u,c=a?(s=this.selector,tn(u=o.createRenderer(null,this.componentDef)||Yt())?u.createElement(s,mn):null===mn?u.createElement(s):u.createElementNS(mn,s)):wn(o,n),l=this.componentDef.onPush?68:66,h=i&&!a?i.injector.get(hr):Pn(),f=o.createRenderer(c,this.componentDef),p=i?function(t,e){return{get:function(n,r){var i=t.get(n,dr);return i!==dr?i:e.get(n,r)}}}(t,i.injector):t;n&&c&&(tn(f)?f.setAttribute(c,"ng-version",ur.full):c.setAttribute("ng-version",ur.full));var d,y,g=fn(null,f,bn(-1,null,1,0,null,null,null),h,l,void 0,p),m=he(g,null);try{o.begin&&o.begin();var b=function(t,e,n,r,i){zt=!1,Ht=null;var o,a,s,u=n[it],c=fn(n,r,(o=e.template).ngPrivateData||(o.ngPrivateData=bn(-1,o,e.consts,e.vars,e.directiveDefs,e.pipeDefs,e.viewQuery)),null,e.onPush?4:2,i),l=pn(0,3,t,null,null);return u.firstTemplatePass&&(a=me(l,n),s=e.type,function(t,e,n){var r=s[v];null==r&&(r=s[v]=ge++);var i=r&ye,o=1<<i,a=64&i,u=32&i,c=e.data;128&i?a?u?c[t+7]|=o:c[t+6]|=o:u?c[t+5]|=o:c[t+4]|=o:a?u?c[t+3]|=o:c[t+2]|=o:u?c[t+1]|=o:c[t]|=o}(a,n[it]),l.flags=4096,function(t,e,n){t.flags=e<<16|4096&t.flags|1,t.providerIndexes=e}(l,n.length),function(t){var e=re();(e.components||(e.components=[])).push(t.index)}(l)),c[ct]=n[rt],c[lt]=l,n[rt]=c}(c,this.componentDef,g,f);if(y=g[it].data[0+rt],e)for(var w=0,_=g[it],S=y.projection=[],E=0;E<e.length;E++){for(var T=e[E],C=null,I=null,A=0;A<T.length;A++){_.firstTemplatePass&&(_.expandoStartIndex++,_.blueprint.splice(++w+rt,0,null),_.data.splice(w+rt,0,null),g.splice(w+rt,0,null));var O=pn(w,3,T[A],null,null);I?I.next=O:C=O,I=O}S.push(C)}d=Nn(b,this.componentDef,g,h,[Rn]),hn(g,1)}finally{fe(m,!0),o.end&&o.end()}var D=new gr(this.componentType,d,function(t,e,n){return On||(On=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(r.c)(e,t),e}(tr)),new On(Mt(e,n))}(0,y,g),g,y);return a&&(D.hostView._tViewNode.child=y),D},e}(Gn),gr=function(t){function e(e,n,r,i,o){var a=t.call(this)||this;return a.location=r,a._rootView=i,a._tNode=o,a.destroyCbs=[],a.instance=n,a.hostView=a.changeDetectorRef=new kn(i),a.hostView._tViewNode=function(t,e){null==e[it].node&&(e[it].node=_n(e,2,-1,null,null,null)),ne(!0);var n=e[it].node;return $t(n),e[lt]=n}(0,i),a.componentType=e,a}return Object(r.c)(e,t),Object.defineProperty(e.prototype,"injector",{get:function(){return new Ie(this._tNode,this._rootView)},enumerable:!0,configurable:!0}),e.prototype.destroy=function(){this.destroyCbs.forEach(function(t){return t()}),this.destroyCbs=null},e.prototype.onDestroy=function(t){this.destroyCbs.push(t)},e}(Kn),mr=!0,vr=!1;function br(){return vr=!0,mr}function wr(){if(vr)throw new Error("Cannot enable prod mode after platform setup.");mr=!1}var _r=function(){function t(t){if(this.defaultDoc=t,this.inertDocument=this.defaultDoc.implementation.createHTMLDocument("sanitization-inert"),this.inertBodyElement=this.inertDocument.body,null==this.inertBodyElement){var e=this.inertDocument.createElement("html");this.inertDocument.appendChild(e),this.inertBodyElement=this.inertDocument.createElement("body"),e.appendChild(this.inertBodyElement)}this.inertBodyElement.innerHTML='<svg><g onload="this.parentNode.remove()"></g></svg>',!this.inertBodyElement.querySelector||this.inertBodyElement.querySelector("svg")?(this.inertBodyElement.innerHTML='<svg><p><style><img src="</style><img src=x onerror=alert(1)//">',this.getInertBodyElement=this.inertBodyElement.querySelector&&this.inertBodyElement.querySelector("svg img")&&function(){try{return!!window.DOMParser}catch(t){return!1}}()?this.getInertBodyElement_DOMParser:this.getInertBodyElement_InertDocument):this.getInertBodyElement=this.getInertBodyElement_XHR}return t.prototype.getInertBodyElement_XHR=function(t){t="<body><remove></remove>"+t+"</body>";try{t=encodeURI(t)}catch(r){return null}var e=new XMLHttpRequest;e.responseType="document",e.open("GET","data:text/html;charset=utf-8,"+t,!1),e.send(void 0);var n=e.response.body;return n.removeChild(n.firstChild),n},t.prototype.getInertBodyElement_DOMParser=function(t){t="<body><remove></remove>"+t+"</body>";try{var e=(new window.DOMParser).parseFromString(t,"text/html").body;return e.removeChild(e.firstChild),e}catch(n){return null}},t.prototype.getInertBodyElement_InertDocument=function(t){var e=this.inertDocument.createElement("template");return"content"in e?(e.innerHTML=t,e):(this.inertBodyElement.innerHTML=t,this.defaultDoc.documentMode&&this.stripCustomNsAttrs(this.inertBodyElement),this.inertBodyElement)},t.prototype.stripCustomNsAttrs=function(t){for(var e=t.attributes,n=e.length-1;0<n;n--){var r=e.item(n).name;"xmlns:ns1"!==r&&0!==r.indexOf("ns1:")||t.removeAttribute(r)}for(var i=t.firstChild;i;)i.nodeType===Node.ELEMENT_NODE&&this.stripCustomNsAttrs(i),i=i.nextSibling},t}(),Sr=/^(?:(?:https?|mailto|ftp|tel|file):|[^&:\/?#]*(?:[\/?#]|$))/gi,Er=/^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+\/]+=*$/i;function Tr(t){return(t=String(t)).match(Sr)||t.match(Er)?t:(br()&&console.warn("WARNING: sanitizing unsafe URL value "+t+" (see http://g.co/ng/security#xss)"),"unsafe:"+t)}function Cr(t){var e,n,i={};try{for(var o=Object(r.h)(t.split(",")),a=o.next();!a.done;a=o.next())i[a.value]=!0}catch(s){e={error:s}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}return i}function Ir(){for(var t,e,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var o={};try{for(var a=Object(r.h)(n),s=a.next();!s.done;s=a.next()){var u=s.value;for(var c in u)u.hasOwnProperty(c)&&(o[c]=!0)}}catch(l){t={error:l}}finally{try{s&&!s.done&&(e=a.return)&&e.call(a)}finally{if(t)throw t.error}}return o}var Ar,Or=Cr("area,br,col,hr,img,wbr"),Dr=Cr("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),kr=Cr("rp,rt"),Nr=Ir(kr,Dr),Pr=Ir(Or,Ir(Dr,Cr("address,article,aside,blockquote,caption,center,del,details,dialog,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6,header,hgroup,hr,ins,main,map,menu,nav,ol,pre,section,summary,table,ul")),Ir(kr,Cr("a,abbr,acronym,audio,b,bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,picture,q,ruby,rp,rt,s,samp,small,source,span,strike,strong,sub,sup,time,track,tt,u,var,video")),Nr),Rr=Cr("background,cite,href,itemtype,longdesc,poster,src,xlink:href"),xr=Cr("srcset"),Mr=Ir(Rr,xr,Cr("abbr,accesskey,align,alt,autoplay,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,compact,controls,coords,datetime,default,dir,download,face,headers,height,hidden,hreflang,hspace,ismap,itemscope,itemprop,kind,label,lang,language,loop,media,muted,nohref,nowrap,open,preload,rel,rev,role,rows,rowspan,rules,scope,scrolling,shape,size,sizes,span,srclang,start,summary,tabindex,target,title,translate,type,usemap,valign,value,vspace,width")),jr=function(){function t(){this.sanitizedSomething=!1,this.buf=[]}return t.prototype.sanitizeChildren=function(t){for(var e=t.firstChild,n=!0;e;)if(e.nodeType===Node.ELEMENT_NODE?n=this.startElement(e):e.nodeType===Node.TEXT_NODE?this.chars(e.nodeValue):this.sanitizedSomething=!0,n&&e.firstChild)e=e.firstChild;else for(;e;){e.nodeType===Node.ELEMENT_NODE&&this.endElement(e);var r=this.checkClobberedElement(e,e.nextSibling);if(r){e=r;break}e=this.checkClobberedElement(e,e.parentNode)}return this.buf.join("")},t.prototype.startElement=function(t){var e,n=t.nodeName.toLowerCase();if(!Pr.hasOwnProperty(n))return this.sanitizedSomething=!0,!1;this.buf.push("<"),this.buf.push(n);for(var r=t.attributes,i=0;i<r.length;i++){var o=r.item(i),a=o.name,s=a.toLowerCase();if(Mr.hasOwnProperty(s)){var u=o.value;Rr[s]&&(u=Tr(u)),xr[s]&&(e=u,u=(e=String(e)).split(",").map(function(t){return Tr(t.trim())}).join(", ")),this.buf.push(" ",a,'="',Vr(u),'"')}else this.sanitizedSomething=!0}return this.buf.push(">"),!0},t.prototype.endElement=function(t){var e=t.nodeName.toLowerCase();Pr.hasOwnProperty(e)&&!Or.hasOwnProperty(e)&&(this.buf.push("</"),this.buf.push(e),this.buf.push(">"))},t.prototype.chars=function(t){this.buf.push(Vr(t))},t.prototype.checkClobberedElement=function(t,e){if(e&&(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_CONTAINED_BY)===Node.DOCUMENT_POSITION_CONTAINED_BY)throw new Error("Failed to sanitize html because the element is clobbered: "+t.outerHTML);return e},t}(),Lr=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Ur=/([^\#-~ |!])/g;function Vr(t){return t.replace(/&/g,"&").replace(Lr,function(t){return"&#"+(1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320)+65536)+";"}).replace(Ur,function(t){return"&#"+t.charCodeAt(0)+";"}).replace(/</g,"<").replace(/>/g,">")}function Fr(t,e){var n=null;try{Ar=Ar||new _r(t);var r=e?String(e):"";n=Ar.getInertBodyElement(r);var i=5,o=r;do{if(0===i)throw new Error("Failed to sanitize html because the input is unstable");i--,r=o,o=n.innerHTML,n=Ar.getInertBodyElement(r)}while(r!==o);var a=new jr,s=a.sanitizeChildren(qr(n)||n);return br()&&a.sanitizedSomething&&console.warn("WARNING: sanitizing HTML stripped some content (see http://g.co/ng/security#xss)."),s}finally{if(n)for(var u=qr(n)||n;u.firstChild;)u.removeChild(u.firstChild)}}function qr(t){return"content"in t&&function(t){return t.nodeType===Node.ELEMENT_NODE&&"TEMPLATE"===t.nodeName}(t)?t.content:null}var Br={provide:Jn,useFactory:function(){return new cr},deps:[]},Hr=function(t){function e(e,n){var r=t.call(this)||this;return r._bootstrapComponents=[],r.destroyCbs=[],r._bootstrapComponents=(e[g]||null).bootstrap,r.injector=function(t,e,n){return void 0===e&&(e=null),void 0===n&&(n=null),e=e||Vn(),new Fn(t,n,e)}(e,n,[Br,{provide:Je,useValue:r}]),r.instance=r.injector.get(e),r.componentFactoryResolver=new cr,r}return Object(r.c)(e,t),e.prototype.destroy=function(){this.destroyCbs.forEach(function(t){return t()}),this.destroyCbs=null},e.prototype.onDestroy=function(t){this.destroyCbs.push(t)},e}(Je);!function(t){function e(e){var n=t.call(this)||this;return n.moduleType=e,n}Object(r.c)(e,t),e.prototype.create=function(t){return new Hr(this.moduleType,t)}}(Ze);var zr=function(t){function e(e){void 0===e&&(e=!1);var n=t.call(this)||this;return n.__isAsync=e,n}return Object(r.c)(e,t),e.prototype.emit=function(e){t.prototype.next.call(this,e)},e.prototype.subscribe=function(e,n,r){var o,a=function(t){return null},s=function(){return null};e&&"object"==typeof e?(o=this.__isAsync?function(t){setTimeout(function(){return e.next(t)})}:function(t){e.next(t)},e.error&&(a=this.__isAsync?function(t){setTimeout(function(){return e.error(t)})}:function(t){e.error(t)}),e.complete&&(s=this.__isAsync?function(){setTimeout(function(){return e.complete()})}:function(){e.complete()})):(o=this.__isAsync?function(t){setTimeout(function(){return e(t)})}:function(t){e(t)},n&&(a=this.__isAsync?function(t){setTimeout(function(){return n(t)})}:function(t){n(t)}),r&&(s=this.__isAsync?function(){setTimeout(function(){return r()})}:function(){r()}));var u=t.prototype.subscribe.call(this,o,a,s);return e instanceof i.a&&e.add(u),u},e}(o.a),Wr=function(){function t(){}return t.__NG_ELEMENT_ID__=function(){return Kr(t,tr)},t}(),Kr=Oe,Gr=function(t){return t[t.NONE=0]="NONE",t[t.HTML=1]="HTML",t[t.STYLE=2]="STYLE",t[t.SCRIPT=3]="SCRIPT",t[t.URL=4]="URL",t[t.RESOURCE_URL=5]="RESOURCE_URL",t}({}),Qr=function(){return function(){}}(),Xr=new RegExp("^([-,.\"'%_!# a-zA-Z0-9]+|(?:(?:matrix|translate|scale|rotate|skew|perspective)(?:X|Y|3d)?|(?:rgb|hsl)a?|(?:repeating-)?(?:linear|radial)-gradient|(?:calc|attr))\\([-0-9.%, #a-zA-Z]+\\))$","g"),Yr=/^url\(([^)]+)\)$/;function Jr(t){if(!(t=String(t).trim()))return"";var e=t.match(Yr);return e&&Tr(e[1])===e[1]||t.match(Xr)&&function(t){for(var e=!0,n=!0,r=0;r<t.length;r++){var i=t.charAt(r);"'"===i&&n?e=!e:'"'===i&&e&&(n=!n)}return e&&n}(t)?t:(br()&&console.warn("WARNING: sanitizing unsafe style value "+t+" (see http://g.co/ng/security#xss)."),"unsafe")}Function;var Zr=A("Input",function(t){return{bindingPropertyName:t}},void 0,function(t){return function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i=t.constructor;i.hasOwnProperty(m)||function(t){var e=t.constructor,n=e.ngBaseDef,r=e.ngBaseDef={inputs:{},outputs:{},declaredInputs:{}};n&&(f(r.inputs,n.inputs),f(r.outputs,n.outputs),f(r.declaredInputs,n.declaredInputs))}(t),(function(t){return t.inputs||{}}(i.ngBaseDef))[e]=n[0]}}()),$r=A("HostBinding",function(t){return{hostPropertyName:t}});String,String;var ti="ngDebugContext",ei="ngOriginalError",ni="ngErrorLogger";function ri(t){return t[ti]}function ii(t){return t[ei]}function oi(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];t.error.apply(t,Object(r.g)(e))}var ai=function(){function t(){this._console=console}return t.prototype.handleError=function(t){var e=this._findOriginalError(t),n=this._findContext(t),r=function(t){return t[ni]||oi}(t);r(this._console,"ERROR",t),e&&r(this._console,"ORIGINAL ERROR",e),n&&r(this._console,"ERROR CONTEXT",n)},t.prototype._findContext=function(t){return t?ri(t)?ri(t):this._findContext(ii(t)):null},t.prototype._findOriginalError=function(t){for(var e=ii(t);e&&ii(e);)e=ii(e);return e},t}();function si(t){return!!t&&"function"==typeof t.then}function ui(t){return!!t&&"function"==typeof t.subscribe}var ci=new S("Application Initializer"),li=function(){function t(t){var e=this;this.appInits=t,this.initialized=!1,this.done=!1,this.donePromise=new Promise(function(t,n){e.resolve=t,e.reject=n})}return t.prototype.runInitializers=function(){var t=this;if(!this.initialized){var e=[],n=function(){t.done=!0,t.resolve()};if(this.appInits)for(var r=0;r<this.appInits.length;r++){var i=this.appInits[r]();si(i)&&e.push(i)}Promise.all(e).then(function(){n()}).catch(function(e){t.reject(e)}),0===e.length&&n(),this.initialized=!0}},t}(),hi=new S("AppId");function fi(){return""+pi()+pi()+pi()}function pi(){return String.fromCharCode(97+Math.floor(25*Math.random()))}var di=new S("Platform Initializer"),yi=new S("Platform ID"),gi=new S("appBootstrapListener"),mi=function(){function t(){}return t.prototype.log=function(t){console.log(t)},t.prototype.warn=function(t){console.warn(t)},t}();function vi(){throw new Error("Runtime compiler is not loaded")}var bi,wi,_i=function(){function t(){}return t.prototype.compileModuleSync=function(t){throw vi()},t.prototype.compileModuleAsync=function(t){throw vi()},t.prototype.compileModuleAndAllComponentsSync=function(t){throw vi()},t.prototype.compileModuleAndAllComponentsAsync=function(t){throw vi()},t.prototype.clearCache=function(){},t.prototype.clearCacheFor=function(t){},t.prototype.getModuleId=function(t){},t}(),Si=function(){return function(){}}();function Ei(){var t=P.wtf;return!(!t||!(bi=t.trace)||(wi=bi.events,0))}var Ti=Ei();function Ci(t,e){return null}var Ii=Ti?function(t,e){return void 0===e&&(e=null),wi.createScope(t,e)}:function(t,e){return Ci},Ai=Ti?function(t,e){return bi.leaveScope(t,e),e}:function(t,e){return e},Oi=function(){function t(t){var e,n=t.enableLongStackTrace,r=void 0!==n&&n;if(this.hasPendingMicrotasks=!1,this.hasPendingMacrotasks=!1,this.isStable=!0,this.onUnstable=new zr(!1),this.onMicrotaskEmpty=new zr(!1),this.onStable=new zr(!1),this.onError=new zr(!1),"undefined"==typeof Zone)throw new Error("In this configuration Angular requires Zone.js");Zone.assertZonePatched(),this._nesting=0,this._outer=this._inner=Zone.current,Zone.wtfZoneSpec&&(this._inner=this._inner.fork(Zone.wtfZoneSpec)),Zone.TaskTrackingZoneSpec&&(this._inner=this._inner.fork(new Zone.TaskTrackingZoneSpec)),r&&Zone.longStackTraceZoneSpec&&(this._inner=this._inner.fork(Zone.longStackTraceZoneSpec)),(e=this)._inner=e._inner.fork({name:"angular",properties:{isAngularZone:!0},onInvokeTask:function(t,n,r,i,o,a){try{return Pi(e),t.invokeTask(r,i,o,a)}finally{Ri(e)}},onInvoke:function(t,n,r,i,o,a,s){try{return Pi(e),t.invoke(r,i,o,a,s)}finally{Ri(e)}},onHasTask:function(t,n,r,i){t.hasTask(r,i),n===r&&("microTask"==i.change?(e.hasPendingMicrotasks=i.microTask,Ni(e)):"macroTask"==i.change&&(e.hasPendingMacrotasks=i.macroTask))},onHandleError:function(t,n,r,i){return t.handleError(r,i),e.runOutsideAngular(function(){return e.onError.emit(i)}),!1}})}return t.isInAngularZone=function(){return!0===Zone.current.get("isAngularZone")},t.assertInAngularZone=function(){if(!t.isInAngularZone())throw new Error("Expected to be in Angular Zone, but it is not!")},t.assertNotInAngularZone=function(){if(t.isInAngularZone())throw new Error("Expected to not be in Angular Zone, but it is!")},t.prototype.run=function(t,e,n){return this._inner.run(t,e,n)},t.prototype.runTask=function(t,e,n,r){var i=this._inner,o=i.scheduleEventTask("NgZoneEvent: "+r,t,ki,Di,Di);try{return i.runTask(o,e,n)}finally{i.cancelTask(o)}},t.prototype.runGuarded=function(t,e,n){return this._inner.runGuarded(t,e,n)},t.prototype.runOutsideAngular=function(t){return this._outer.run(t)},t}();function Di(){}var ki={};function Ni(t){if(0==t._nesting&&!t.hasPendingMicrotasks&&!t.isStable)try{t._nesting++,t.onMicrotaskEmpty.emit(null)}finally{if(t._nesting--,!t.hasPendingMicrotasks)try{t.runOutsideAngular(function(){return t.onStable.emit(null)})}finally{t.isStable=!0}}}function Pi(t){t._nesting++,t.isStable&&(t.isStable=!1,t.onUnstable.emit(null))}function Ri(t){t._nesting--,Ni(t)}var xi=function(){function t(){this.hasPendingMicrotasks=!1,this.hasPendingMacrotasks=!1,this.isStable=!0,this.onUnstable=new zr,this.onMicrotaskEmpty=new zr,this.onStable=new zr,this.onError=new zr}return t.prototype.run=function(t){return t()},t.prototype.runGuarded=function(t){return t()},t.prototype.runOutsideAngular=function(t){return t()},t.prototype.runTask=function(t){return t()},t}(),Mi=function(){function t(t){var e=this;this._ngZone=t,this._pendingCount=0,this._isZoneStable=!0,this._didWork=!1,this._callbacks=[],this.taskTrackingZone=null,this._watchAngularEvents(),t.run(function(){e.taskTrackingZone="undefined"==typeof Zone?null:Zone.current.get("TaskTrackingZone")})}return t.prototype._watchAngularEvents=function(){var t=this;this._ngZone.onUnstable.subscribe({next:function(){t._didWork=!0,t._isZoneStable=!1}}),this._ngZone.runOutsideAngular(function(){t._ngZone.onStable.subscribe({next:function(){Oi.assertNotInAngularZone(),j(function(){t._isZoneStable=!0,t._runCallbacksIfReady()})}})})},t.prototype.increasePendingRequestCount=function(){return this._pendingCount+=1,this._didWork=!0,this._pendingCount},t.prototype.decreasePendingRequestCount=function(){if(this._pendingCount-=1,this._pendingCount<0)throw new Error("pending async requests below zero");return this._runCallbacksIfReady(),this._pendingCount},t.prototype.isStable=function(){return this._isZoneStable&&0===this._pendingCount&&!this._ngZone.hasPendingMacrotasks},t.prototype._runCallbacksIfReady=function(){var t=this;if(this.isStable())j(function(){for(;0!==t._callbacks.length;){var e=t._callbacks.pop();clearTimeout(e.timeoutId),e.doneCb(t._didWork)}t._didWork=!1});else{var e=this.getPendingTasks();this._callbacks=this._callbacks.filter(function(t){return!t.updateCb||!t.updateCb(e)||(clearTimeout(t.timeoutId),!1)}),this._didWork=!0}},t.prototype.getPendingTasks=function(){return this.taskTrackingZone?this.taskTrackingZone.macroTasks.map(function(t){return{source:t.source,creationLocation:t.creationLocation,data:t.data}}):[]},t.prototype.addCallback=function(t,e,n){var r=this,i=-1;e&&e>0&&(i=setTimeout(function(){r._callbacks=r._callbacks.filter(function(t){return t.timeoutId!==i}),t(r._didWork,r.getPendingTasks())},e)),this._callbacks.push({doneCb:t,timeoutId:i,updateCb:n})},t.prototype.whenStable=function(t,e,n){if(n&&!this.taskTrackingZone)throw new Error('Task tracking zone is required when passing an update callback to whenStable(). Is "zone.js/dist/task-tracking.js" loaded?');this.addCallback(t,e,n),this._runCallbacksIfReady()},t.prototype.getPendingRequestCount=function(){return this._pendingCount},t.prototype.findProviders=function(t,e,n){return[]},t}(),ji=function(){function t(){this._applications=new Map,Vi.addToWindow(this)}return t.prototype.registerApplication=function(t,e){this._applications.set(t,e)},t.prototype.unregisterApplication=function(t){this._applications.delete(t)},t.prototype.unregisterAllApplications=function(){this._applications.clear()},t.prototype.getTestability=function(t){return this._applications.get(t)||null},t.prototype.getAllTestabilities=function(){return Array.from(this._applications.values())},t.prototype.getAllRootElements=function(){return Array.from(this._applications.keys())},t.prototype.findTestabilityInTree=function(t,e){return void 0===e&&(e=!0),Vi.findTestabilityInTree(this,t,e)},Object(r.b)([Object(r.d)("design:paramtypes",[])],t)}();function Li(t){Vi=t}var Ui,Vi=new(function(){function t(){}return t.prototype.addToWindow=function(t){},t.prototype.findTestabilityInTree=function(t,e,n){return null},t}()),Fi=new S("AllowMultipleToken"),qi=function(){return function(t,e){this.name=t,this.token=e}}();function Bi(t,e,n){void 0===n&&(n=[]);var r="Platform: "+e,i=new S(r);return function(e){void 0===e&&(e=[]);var o=Hi();if(!o||o.injector.get(Fi,!1))if(t)t(n.concat(e).concat({provide:i,useValue:!0}));else{var a=n.concat(e).concat({provide:i,useValue:!0});!function(t){if(Ui&&!Ui.destroyed&&!Ui.injector.get(Fi,!1))throw new Error("There can be only one platform. Destroy the previous one to create a new one.");Ui=t.get(zi);var e=t.get(di,null);e&&e.forEach(function(t){return t()})}(Le.create({providers:a,name:r}))}return function(t){var e=Hi();if(!e)throw new Error("No platform exists!");if(!e.injector.get(t,null))throw new Error("A platform with a different configuration has been created. Please destroy it first.");return e}(i)}}function Hi(){return Ui&&!Ui.destroyed?Ui:null}var zi=function(){function t(t){this._injector=t,this._modules=[],this._destroyListeners=[],this._destroyed=!1}return t.prototype.bootstrapModuleFactory=function(t,e){var n,r=this,i="noop"===(n=e?e.ngZone:void 0)?new xi:("zone.js"===n?void 0:n)||new Oi({enableLongStackTrace:br()}),o=[{provide:Oi,useValue:i}];return i.run(function(){var e=Le.create({providers:o,parent:r.injector,name:t.moduleType.name}),n=t.create(e),a=n.injector.get(ai,null);if(!a)throw new Error("No ErrorHandler. Is platform module (BrowserModule) included?");return n.onDestroy(function(){return Gi(r._modules,n)}),i.runOutsideAngular(function(){return i.onError.subscribe({next:function(t){a.handleError(t)}})}),function(t,e,i){try{var o=((a=n.injector.get(li)).runInitializers(),a.donePromise.then(function(){return r._moduleDoBootstrap(n),n}));return si(o)?o.catch(function(n){throw e.runOutsideAngular(function(){return t.handleError(n)}),n}):o}catch(s){throw e.runOutsideAngular(function(){return t.handleError(s)}),s}var a}(a,i)})},t.prototype.bootstrapModule=function(t,e){var n=this;void 0===e&&(e=[]);var r=Wi({},e);return function(t,e,n){return t.get(Si).createCompiler([e]).compileModuleAsync(n)}(this.injector,r,t).then(function(t){return n.bootstrapModuleFactory(t,r)})},t.prototype._moduleDoBootstrap=function(t){var e=t.injector.get(Ki);if(t._bootstrapComponents.length>0)t._bootstrapComponents.forEach(function(t){return e.bootstrap(t)});else{if(!t.instance.ngDoBootstrap)throw new Error("The module "+U(t.instance.constructor)+' was bootstrapped, but it does not declare "@NgModule.bootstrap" components nor a "ngDoBootstrap" method. Please define one of these.');t.instance.ngDoBootstrap(e)}this._modules.push(t)},t.prototype.onDestroy=function(t){this._destroyListeners.push(t)},Object.defineProperty(t.prototype,"injector",{get:function(){return this._injector},enumerable:!0,configurable:!0}),t.prototype.destroy=function(){if(this._destroyed)throw new Error("The platform has already been destroyed!");this._modules.slice().forEach(function(t){return t.destroy()}),this._destroyListeners.forEach(function(t){return t()}),this._destroyed=!0},Object.defineProperty(t.prototype,"destroyed",{get:function(){return this._destroyed},enumerable:!0,configurable:!0}),t}();function Wi(t,e){return Array.isArray(e)?e.reduce(Wi,t):Object(r.a)({},t,e)}var Ki=function(){function t(t,e,n,r,i,o){var h=this;this._zone=t,this._console=e,this._injector=n,this._exceptionHandler=r,this._componentFactoryResolver=i,this._initStatus=o,this._bootstrapListeners=[],this._views=[],this._runningTick=!1,this._enforceNoNewChanges=!1,this._stable=!0,this.componentTypes=[],this.components=[],this._enforceNoNewChanges=br(),this._zone.onMicrotaskEmpty.subscribe({next:function(){h._zone.run(function(){h.tick()})}});var f=new a.a(function(t){h._stable=h._zone.isStable&&!h._zone.hasPendingMacrotasks&&!h._zone.hasPendingMicrotasks,h._zone.runOutsideAngular(function(){t.next(h._stable),t.complete()})}),p=new a.a(function(t){var e;h._zone.runOutsideAngular(function(){e=h._zone.onStable.subscribe(function(){Oi.assertNotInAngularZone(),j(function(){h._stable||h._zone.hasPendingMacrotasks||h._zone.hasPendingMicrotasks||(h._stable=!0,t.next(!0))})})});var n=h._zone.onUnstable.subscribe(function(){Oi.assertInAngularZone(),h._stable&&(h._stable=!1,h._zone.runOutsideAngular(function(){t.next(!1)}))});return function(){e.unsubscribe(),n.unsubscribe()}});this.isStable=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Number.POSITIVE_INFINITY,r=null,i=t[t.length-1];return Object(s.a)(i)?(r=t.pop(),t.length>1&&"number"==typeof t[t.length-1]&&(n=t.pop())):"number"==typeof i&&(n=t.pop()),null===r&&1===t.length&&t[0]instanceof a.a?t[0]:Object(u.a)(n)(Object(c.a)(t,r))}(f,p.pipe(Object(l.a)()))}var e;return e=t,t.prototype.bootstrap=function(t,e){var n,r=this;if(!this._initStatus.done)throw new Error("Cannot bootstrap as there are still asynchronous initializers running. Bootstrap components in the `ngDoBootstrap` method of the root module.");n=t instanceof Gn?t:this._componentFactoryResolver.resolveComponentFactory(t),this.componentTypes.push(n.componentType);var i=n instanceof $n?null:this._injector.get(Je),o=n.create(Le.NULL,[],e||n.selector,i);o.onDestroy(function(){r._unloadComponent(o)});var a=o.injector.get(Mi,null);return a&&o.injector.get(ji).registerApplication(o.location.nativeElement,a),this._loadComponent(o),br()&&this._console.log("Angular is running in the development mode. Call enableProdMode() to enable the production mode."),o},t.prototype.tick=function(){var t=this;if(this._runningTick)throw new Error("ApplicationRef.tick is called recursively");var n=e._tickScope();try{this._runningTick=!0,this._views.forEach(function(t){return t.detectChanges()}),this._enforceNoNewChanges&&this._views.forEach(function(t){return t.checkNoChanges()})}catch(r){this._zone.runOutsideAngular(function(){return t._exceptionHandler.handleError(r)})}finally{this._runningTick=!1,Ai(n)}},t.prototype.attachView=function(t){var e=t;this._views.push(e),e.attachToAppRef(this)},t.prototype.detachView=function(t){var e=t;Gi(this._views,e),e.detachFromAppRef()},t.prototype._loadComponent=function(t){this.attachView(t.hostView),this.tick(),this.components.push(t),this._injector.get(gi,[]).concat(this._bootstrapListeners).forEach(function(e){return e(t)})},t.prototype._unloadComponent=function(t){this.detachView(t.hostView),Gi(this.components,t)},t.prototype.ngOnDestroy=function(){this._views.slice().forEach(function(t){return t.destroy()})},Object.defineProperty(t.prototype,"viewCount",{get:function(){return this._views.length},enumerable:!0,configurable:!0}),t._tickScope=Ii("ApplicationRef#tick()"),t}();function Gi(t,e){var n=t.indexOf(e);n>-1&&t.splice(n,1)}var Qi=function(){return function(){}}(),Xi=function(){function t(){this.dirty=!0,this._results=[],this.changes=new zr,this.length=0}return t.prototype.map=function(t){return this._results.map(t)},t.prototype.filter=function(t){return this._results.filter(t)},t.prototype.find=function(t){return this._results.find(t)},t.prototype.reduce=function(t,e){return this._results.reduce(t,e)},t.prototype.forEach=function(t){this._results.forEach(t)},t.prototype.some=function(t){return this._results.some(t)},t.prototype.toArray=function(){return this._results.slice()},t.prototype[M()]=function(){return this._results[M()]()},t.prototype.toString=function(){return this._results.toString()},t.prototype.reset=function(t){this._results=function t(e){return e.reduce(function(e,n){var r=Array.isArray(n)?t(n):n;return e.concat(r)},[])}(t),this.dirty=!1,this.length=this._results.length,this.last=this._results[this.length-1],this.first=this._results[0]},t.prototype.notifyOnChanges=function(){this.changes.emit(this)},t.prototype.setDirty=function(){this.dirty=!0},t.prototype.destroy=function(){this.changes.complete(),this.changes.unsubscribe()},t}(),Yi=function(){return function(){}}(),Ji={factoryPathPrefix:"",factoryPathSuffix:".ngfactory"},Zi=function(){function t(t,e){this._compiler=t,this._config=e||Ji}return t.prototype.load=function(t){return this._compiler instanceof _i?this.loadFactory(t):this.loadAndCompile(t)},t.prototype.loadAndCompile=function(t){var e=this,i=Object(r.f)(t.split("#"),2),o=i[0],a=i[1];return void 0===a&&(a="default"),n("crnd")(o).then(function(t){return t[a]}).then(function(t){return $i(t,o,a)}).then(function(t){return e._compiler.compileModuleAsync(t)})},t.prototype.loadFactory=function(t){var e=Object(r.f)(t.split("#"),2),i=e[0],o=e[1],a="NgFactory";return void 0===o&&(o="default",a=""),n("crnd")(this._config.factoryPathPrefix+i+this._config.factoryPathSuffix).then(function(t){return t[o+a]}).then(function(t){return $i(t,i,o)})},t}();function $i(t,e,n){if(!t)throw new Error("Cannot find '"+n+"' in '"+e+"'");return t}var to,eo=function(){function t(){}return t.__NG_ELEMENT_ID__=function(){return no(t,tr)},t}(),no=Oe,ro=function(){function t(){}return t.__NG_ELEMENT_ID__=function(){return io()},t}(),io=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]},oo=(to=ro,Object(r.c)(function(){return null!==to&&to.apply(this,arguments)||this},to),function(){return function(t,e){this.name=t,this.callback=e}}()),ao=function(){function t(t,e,n){this.nativeNode=t,this._debugContext=n,this.listeners=[],this.parent=null,e&&e instanceof so&&e.addChild(this)}return Object.defineProperty(t.prototype,"injector",{get:function(){return this._debugContext.injector},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"componentInstance",{get:function(){return this._debugContext.component},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"context",{get:function(){return this._debugContext.context},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"references",{get:function(){return this._debugContext.references},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"providerTokens",{get:function(){return this._debugContext.providerTokens},enumerable:!0,configurable:!0}),t}(),so=function(t){function e(e,n,r){var i=t.call(this,e,n,r)||this;return i.properties={},i.attributes={},i.classes={},i.styles={},i.childNodes=[],i.nativeElement=e,i}return Object(r.c)(e,t),e.prototype.addChild=function(t){t&&(this.childNodes.push(t),t.parent=this)},e.prototype.removeChild=function(t){var e=this.childNodes.indexOf(t);-1!==e&&(t.parent=null,this.childNodes.splice(e,1))},e.prototype.insertChildrenAfter=function(t,e){var n,i=this,o=this.childNodes.indexOf(t);-1!==o&&((n=this.childNodes).splice.apply(n,Object(r.g)([o+1,0],e)),e.forEach(function(t){t.parent&&t.parent.removeChild(t),t.parent=i}))},e.prototype.insertBefore=function(t,e){var n=this.childNodes.indexOf(t);-1===n?this.addChild(e):(e.parent&&e.parent.removeChild(e),e.parent=this,this.childNodes.splice(n,0,e))},e.prototype.query=function(t){return this.queryAll(t)[0]||null},e.prototype.queryAll=function(t){var e=[];return function t(e,n,r){e.childNodes.forEach(function(e){e instanceof so&&(n(e)&&r.push(e),t(e,n,r))})}(this,t,e),e},e.prototype.queryAllNodes=function(t){var e=[];return function t(e,n,r){e instanceof so&&e.childNodes.forEach(function(e){n(e)&&r.push(e),e instanceof so&&t(e,n,r)})}(this,t,e),e},Object.defineProperty(e.prototype,"children",{get:function(){return this.childNodes.filter(function(t){return t instanceof e})},enumerable:!0,configurable:!0}),e.prototype.triggerEventHandler=function(t,e){this.listeners.forEach(function(n){n.name==t&&n.callback(e)})},e}(ao),uo=new Map;function co(t){return uo.get(t)||null}function lo(t){uo.set(t.nativeNode,t)}var ho=function(){function t(){}return t.prototype.supports=function(t){return At(t)},t.prototype.create=function(t){return new po(t)},t}(),fo=function(t,e){return e},po=function(){function t(t){this.length=0,this._linkedRecords=null,this._unlinkedRecords=null,this._previousItHead=null,this._itHead=null,this._itTail=null,this._additionsHead=null,this._additionsTail=null,this._movesHead=null,this._movesTail=null,this._removalsHead=null,this._removalsTail=null,this._identityChangesHead=null,this._identityChangesTail=null,this._trackByFn=t||fo}return t.prototype.forEachItem=function(t){var e;for(e=this._itHead;null!==e;e=e._next)t(e)},t.prototype.forEachOperation=function(t){for(var e=this._itHead,n=this._removalsHead,r=0,i=null;e||n;){var o=!n||e&&e.currentIndex<vo(n,r,i)?e:n,a=vo(o,r,i),s=o.currentIndex;if(o===n)r--,n=n._nextRemoved;else if(e=e._next,null==o.previousIndex)r++;else{i||(i=[]);var u=a-r,c=s-r;if(u!=c){for(var l=0;l<u;l++){var h=l<i.length?i[l]:i[l]=0,f=h+l;c<=f&&f<u&&(i[l]=h+1)}i[o.previousIndex]=c-u}}a!==s&&t(o,a,s)}},t.prototype.forEachPreviousItem=function(t){var e;for(e=this._previousItHead;null!==e;e=e._nextPrevious)t(e)},t.prototype.forEachAddedItem=function(t){var e;for(e=this._additionsHead;null!==e;e=e._nextAdded)t(e)},t.prototype.forEachMovedItem=function(t){var e;for(e=this._movesHead;null!==e;e=e._nextMoved)t(e)},t.prototype.forEachRemovedItem=function(t){var e;for(e=this._removalsHead;null!==e;e=e._nextRemoved)t(e)},t.prototype.forEachIdentityChange=function(t){var e;for(e=this._identityChangesHead;null!==e;e=e._nextIdentityChange)t(e)},t.prototype.diff=function(t){if(null==t&&(t=[]),!At(t))throw new Error("Error trying to diff '"+U(t)+"'. Only arrays and iterables are allowed");return this.check(t)?this:null},t.prototype.onDestroy=function(){},t.prototype.check=function(t){var e=this;this._reset();var n,r,i,o=this._itHead,a=!1;if(Array.isArray(t)){this.length=t.length;for(var s=0;s<this.length;s++)i=this._trackByFn(s,r=t[s]),null!==o&&L(o.trackById,i)?(a&&(o=this._verifyReinsertion(o,r,i,s)),L(o.item,r)||this._addIdentityChange(o,r)):(o=this._mismatch(o,r,i,s),a=!0),o=o._next}else n=0,function(t,e){if(Array.isArray(t))for(var n=0;n<t.length;n++)e(t[n]);else for(var r=t[M()](),i=void 0;!(i=r.next()).done;)e(i.value)}(t,function(t){i=e._trackByFn(n,t),null!==o&&L(o.trackById,i)?(a&&(o=e._verifyReinsertion(o,t,i,n)),L(o.item,t)||e._addIdentityChange(o,t)):(o=e._mismatch(o,t,i,n),a=!0),o=o._next,n++}),this.length=n;return this._truncate(o),this.collection=t,this.isDirty},Object.defineProperty(t.prototype,"isDirty",{get:function(){return null!==this._additionsHead||null!==this._movesHead||null!==this._removalsHead||null!==this._identityChangesHead},enumerable:!0,configurable:!0}),t.prototype._reset=function(){if(this.isDirty){var t=void 0,e=void 0;for(t=this._previousItHead=this._itHead;null!==t;t=t._next)t._nextPrevious=t._next;for(t=this._additionsHead;null!==t;t=t._nextAdded)t.previousIndex=t.currentIndex;for(this._additionsHead=this._additionsTail=null,t=this._movesHead;null!==t;t=e)t.previousIndex=t.currentIndex,e=t._nextMoved;this._movesHead=this._movesTail=null,this._removalsHead=this._removalsTail=null,this._identityChangesHead=this._identityChangesTail=null}},t.prototype._mismatch=function(t,e,n,r){var i;return null===t?i=this._itTail:(i=t._prev,this._remove(t)),null!==(t=null===this._linkedRecords?null:this._linkedRecords.get(n,r))?(L(t.item,e)||this._addIdentityChange(t,e),this._moveAfter(t,i,r)):null!==(t=null===this._unlinkedRecords?null:this._unlinkedRecords.get(n,null))?(L(t.item,e)||this._addIdentityChange(t,e),this._reinsertAfter(t,i,r)):t=this._addAfter(new yo(e,n),i,r),t},t.prototype._verifyReinsertion=function(t,e,n,r){var i=null===this._unlinkedRecords?null:this._unlinkedRecords.get(n,null);return null!==i?t=this._reinsertAfter(i,t._prev,r):t.currentIndex!=r&&(t.currentIndex=r,this._addToMoves(t,r)),t},t.prototype._truncate=function(t){for(;null!==t;){var e=t._next;this._addToRemovals(this._unlink(t)),t=e}null!==this._unlinkedRecords&&this._unlinkedRecords.clear(),null!==this._additionsTail&&(this._additionsTail._nextAdded=null),null!==this._movesTail&&(this._movesTail._nextMoved=null),null!==this._itTail&&(this._itTail._next=null),null!==this._removalsTail&&(this._removalsTail._nextRemoved=null),null!==this._identityChangesTail&&(this._identityChangesTail._nextIdentityChange=null)},t.prototype._reinsertAfter=function(t,e,n){null!==this._unlinkedRecords&&this._unlinkedRecords.remove(t);var r=t._prevRemoved,i=t._nextRemoved;return null===r?this._removalsHead=i:r._nextRemoved=i,null===i?this._removalsTail=r:i._prevRemoved=r,this._insertAfter(t,e,n),this._addToMoves(t,n),t},t.prototype._moveAfter=function(t,e,n){return this._unlink(t),this._insertAfter(t,e,n),this._addToMoves(t,n),t},t.prototype._addAfter=function(t,e,n){return this._insertAfter(t,e,n),this._additionsTail=null===this._additionsTail?this._additionsHead=t:this._additionsTail._nextAdded=t,t},t.prototype._insertAfter=function(t,e,n){var r=null===e?this._itHead:e._next;return t._next=r,t._prev=e,null===r?this._itTail=t:r._prev=t,null===e?this._itHead=t:e._next=t,null===this._linkedRecords&&(this._linkedRecords=new mo),this._linkedRecords.put(t),t.currentIndex=n,t},t.prototype._remove=function(t){return this._addToRemovals(this._unlink(t))},t.prototype._unlink=function(t){null!==this._linkedRecords&&this._linkedRecords.remove(t);var e=t._prev,n=t._next;return null===e?this._itHead=n:e._next=n,null===n?this._itTail=e:n._prev=e,t},t.prototype._addToMoves=function(t,e){return t.previousIndex===e?t:(this._movesTail=null===this._movesTail?this._movesHead=t:this._movesTail._nextMoved=t,t)},t.prototype._addToRemovals=function(t){return null===this._unlinkedRecords&&(this._unlinkedRecords=new mo),this._unlinkedRecords.put(t),t.currentIndex=null,t._nextRemoved=null,null===this._removalsTail?(this._removalsTail=this._removalsHead=t,t._prevRemoved=null):(t._prevRemoved=this._removalsTail,this._removalsTail=this._removalsTail._nextRemoved=t),t},t.prototype._addIdentityChange=function(t,e){return t.item=e,this._identityChangesTail=null===this._identityChangesTail?this._identityChangesHead=t:this._identityChangesTail._nextIdentityChange=t,t},t}(),yo=function(){return function(t,e){this.item=t,this.trackById=e,this.currentIndex=null,this.previousIndex=null,this._nextPrevious=null,this._prev=null,this._next=null,this._prevDup=null,this._nextDup=null,this._prevRemoved=null,this._nextRemoved=null,this._nextAdded=null,this._nextMoved=null,this._nextIdentityChange=null}}(),go=function(){function t(){this._head=null,this._tail=null}return t.prototype.add=function(t){null===this._head?(this._head=this._tail=t,t._nextDup=null,t._prevDup=null):(this._tail._nextDup=t,t._prevDup=this._tail,t._nextDup=null,this._tail=t)},t.prototype.get=function(t,e){var n;for(n=this._head;null!==n;n=n._nextDup)if((null===e||e<=n.currentIndex)&&L(n.trackById,t))return n;return null},t.prototype.remove=function(t){var e=t._prevDup,n=t._nextDup;return null===e?this._head=n:e._nextDup=n,null===n?this._tail=e:n._prevDup=e,null===this._head},t}(),mo=function(){function t(){this.map=new Map}return t.prototype.put=function(t){var e=t.trackById,n=this.map.get(e);n||(n=new go,this.map.set(e,n)),n.add(t)},t.prototype.get=function(t,e){var n=this.map.get(t);return n?n.get(t,e):null},t.prototype.remove=function(t){var e=t.trackById;return this.map.get(e).remove(t)&&this.map.delete(e),t},Object.defineProperty(t.prototype,"isEmpty",{get:function(){return 0===this.map.size},enumerable:!0,configurable:!0}),t.prototype.clear=function(){this.map.clear()},t}();function vo(t,e,n){var r=t.previousIndex;if(null===r)return r;var i=0;return n&&r<n.length&&(i=n[r]),r+e+i}var bo=function(){function t(){}return t.prototype.supports=function(t){return t instanceof Map||Ot(t)},t.prototype.create=function(){return new wo},t}(),wo=function(){function t(){this._records=new Map,this._mapHead=null,this._appendAfter=null,this._previousMapHead=null,this._changesHead=null,this._changesTail=null,this._additionsHead=null,this._additionsTail=null,this._removalsHead=null,this._removalsTail=null}return Object.defineProperty(t.prototype,"isDirty",{get:function(){return null!==this._additionsHead||null!==this._changesHead||null!==this._removalsHead},enumerable:!0,configurable:!0}),t.prototype.forEachItem=function(t){var e;for(e=this._mapHead;null!==e;e=e._next)t(e)},t.prototype.forEachPreviousItem=function(t){var e;for(e=this._previousMapHead;null!==e;e=e._nextPrevious)t(e)},t.prototype.forEachChangedItem=function(t){var e;for(e=this._changesHead;null!==e;e=e._nextChanged)t(e)},t.prototype.forEachAddedItem=function(t){var e;for(e=this._additionsHead;null!==e;e=e._nextAdded)t(e)},t.prototype.forEachRemovedItem=function(t){var e;for(e=this._removalsHead;null!==e;e=e._nextRemoved)t(e)},t.prototype.diff=function(t){if(t){if(!(t instanceof Map||Ot(t)))throw new Error("Error trying to diff '"+U(t)+"'. Only maps and objects are allowed")}else t=new Map;return this.check(t)?this:null},t.prototype.onDestroy=function(){},t.prototype.check=function(t){var e=this;this._reset();var n=this._mapHead;if(this._appendAfter=null,this._forEach(t,function(t,r){if(n&&n.key===r)e._maybeAddToChanges(n,t),e._appendAfter=n,n=n._next;else{var i=e._getOrCreateRecordForKey(r,t);n=e._insertBeforeOrAppend(n,i)}}),n){n._prev&&(n._prev._next=null),this._removalsHead=n;for(var r=n;null!==r;r=r._nextRemoved)r===this._mapHead&&(this._mapHead=null),this._records.delete(r.key),r._nextRemoved=r._next,r.previousValue=r.currentValue,r.currentValue=null,r._prev=null,r._next=null}return this._changesTail&&(this._changesTail._nextChanged=null),this._additionsTail&&(this._additionsTail._nextAdded=null),this.isDirty},t.prototype._insertBeforeOrAppend=function(t,e){if(t){var n=t._prev;return e._next=t,e._prev=n,t._prev=e,n&&(n._next=e),t===this._mapHead&&(this._mapHead=e),this._appendAfter=t,t}return this._appendAfter?(this._appendAfter._next=e,e._prev=this._appendAfter):this._mapHead=e,this._appendAfter=e,null},t.prototype._getOrCreateRecordForKey=function(t,e){if(this._records.has(t)){var n=this._records.get(t);this._maybeAddToChanges(n,e);var r=n._prev,i=n._next;return r&&(r._next=i),i&&(i._prev=r),n._next=null,n._prev=null,n}var o=new _o(t);return this._records.set(t,o),o.currentValue=e,this._addToAdditions(o),o},t.prototype._reset=function(){if(this.isDirty){var t=void 0;for(this._previousMapHead=this._mapHead,t=this._previousMapHead;null!==t;t=t._next)t._nextPrevious=t._next;for(t=this._changesHead;null!==t;t=t._nextChanged)t.previousValue=t.currentValue;for(t=this._additionsHead;null!=t;t=t._nextAdded)t.previousValue=t.currentValue;this._changesHead=this._changesTail=null,this._additionsHead=this._additionsTail=null,this._removalsHead=null}},t.prototype._maybeAddToChanges=function(t,e){L(e,t.currentValue)||(t.previousValue=t.currentValue,t.currentValue=e,this._addToChanges(t))},t.prototype._addToAdditions=function(t){null===this._additionsHead?this._additionsHead=this._additionsTail=t:(this._additionsTail._nextAdded=t,this._additionsTail=t)},t.prototype._addToChanges=function(t){null===this._changesHead?this._changesHead=this._changesTail=t:(this._changesTail._nextChanged=t,this._changesTail=t)},t.prototype._forEach=function(t,e){t instanceof Map?t.forEach(e):Object.keys(t).forEach(function(n){return e(t[n],n)})},t}(),_o=function(){return function(t){this.key=t,this.previousValue=null,this.currentValue=null,this._nextPrevious=null,this._next=null,this._prev=null,this._nextAdded=null,this._nextRemoved=null,this._nextChanged=null}}(),So=function(){function t(t){this.factories=t}return t.create=function(e,n){if(null!=n){var r=n.factories.slice();e=e.concat(r)}return new t(e)},t.extend=function(e){return{provide:t,useFactory:function(n){if(!n)throw new Error("Cannot extend IterableDiffers without a parent injector");return t.create(e,n)},deps:[[t,new H,new q]]}},t.prototype.find=function(t){var e,n=this.factories.find(function(e){return e.supports(t)});if(null!=n)return n;throw new Error("Cannot find a differ supporting object '"+t+"' of type '"+((e=t).name||typeof e)+"'")},t.ngInjectableDef=b({providedIn:"root",factory:function(){return new t([new ho])}}),t}(),Eo=function(){function t(t){this.factories=t}return t.create=function(e,n){if(n){var r=n.factories.slice();e=e.concat(r)}return new t(e)},t.extend=function(e){return{provide:t,useFactory:function(n){if(!n)throw new Error("Cannot extend KeyValueDiffers without a parent injector");return t.create(e,n)},deps:[[t,new H,new q]]}},t.prototype.find=function(t){var e=this.factories.find(function(e){return e.supports(t)});if(e)return e;throw new Error("Cannot find a differ supporting object '"+t+"'")},t.ngInjectableDef=b({providedIn:"root",factory:function(){return new t([new bo])}}),t}(),To=[new bo],Co=new So([new ho]),Io=new Eo(To),Ao=Bi(null,"core",[{provide:yi,useValue:"unknown"},{provide:zi,deps:[Le]},{provide:ji,deps:[]},{provide:mi,deps:[]}]),Oo=new S("LocaleId");function Do(){return Co}function ko(){return Io}function No(t){return t||"en-US"}var Po=function(){return function(t){}}();function Ro(t,e,n){var r=t.state,i=1792&r;return i===e?(t.state=-1793&r|n,t.initIndex=-1,!0):i===n}function xo(t,e,n){return(1792&t.state)===e&&t.initIndex<=n&&(t.initIndex=n+1,!0)}function Mo(t,e){return t.nodes[e]}function jo(t,e){return t.nodes[e]}function Lo(t,e){return t.nodes[e]}function Uo(t,e){return t.nodes[e]}function Vo(t,e){return t.nodes[e]}var Fo={setCurrentNode:void 0,createRootView:void 0,createEmbeddedView:void 0,createComponentView:void 0,createNgModuleRef:void 0,overrideProvider:void 0,overrideComponentView:void 0,clearOverrides:void 0,checkAndUpdateView:void 0,checkNoChangesView:void 0,destroyView:void 0,resolveDep:void 0,createDebugContext:void 0,handleEvent:void 0,updateDirectives:void 0,updateRenderer:void 0,dirtyParentQueries:void 0};function qo(t,e,n,r){var i="ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: '"+e+"'. Current value: '"+n+"'.";return r&&(i+=" It seems like the view has been created after its parent and its children have been dirty checked. Has it been created in a change detection hook ?"),function(t,e){var n=new Error(t);return Bo(n,e),n}(i,t)}function Bo(t,e){t[ti]=e,t[ni]=e.logError.bind(e)}function Ho(t){return new Error("ViewDestroyedError: Attempt to use a destroyed view: "+t)}var zo=function(){},Wo=new Map;function Ko(t){var e=Wo.get(t);return e||(e=U(t)+"_"+Wo.size,Wo.set(t,e)),e}function Go(t,e,n,r){if(Ct.isWrapped(r)){r=Ct.unwrap(r);var i=t.def.nodes[e].bindingIndex+n,o=Ct.unwrap(t.oldValues[i]);t.oldValues[i]=new Ct(o)}return r}var Qo="$$undefined",Xo="$$empty";function Yo(t){return{id:Qo,styles:t.styles,encapsulation:t.encapsulation,data:t.data}}var Jo=0;function Zo(t,e,n,r){return!(!(2&t.state)&&L(t.oldValues[e.bindingIndex+n],r))}function $o(t,e,n,r){return!!Zo(t,e,n,r)&&(t.oldValues[e.bindingIndex+n]=r,!0)}function ta(t,e,n,r){var i=t.oldValues[e.bindingIndex+n];if(1&t.state||!Tt(i,r)){var o=e.bindings[n].name;throw qo(Fo.createDebugContext(t,e.nodeIndex),o+": "+i,o+": "+r,0!=(1&t.state))}}function ea(t){for(var e=t;e;)2&e.def.flags&&(e.state|=8),e=e.viewContainerParent||e.parent}function na(t,e){for(var n=t;n&&n!==e;)n.state|=64,n=n.viewContainerParent||n.parent}function ra(t,e,n,r){try{return ea(33554432&t.def.nodes[e].flags?jo(t,e).componentView:t),Fo.handleEvent(t,e,n,r)}catch(i){t.root.errorHandler.handleError(i)}}function ia(t){return t.parent?jo(t.parent,t.parentNodeDef.nodeIndex):null}function oa(t){return t.parent?t.parentNodeDef.parent:null}function aa(t,e){switch(201347067&e.flags){case 1:return jo(t,e.nodeIndex).renderElement;case 2:return Mo(t,e.nodeIndex).renderText}}function sa(t){return!!t.parent&&!!(32768&t.parentNodeDef.flags)}function ua(t){return!(!t.parent||32768&t.parentNodeDef.flags)}function ca(t){var e={},n=0,i={};return t&&t.forEach(function(t){var o=Object(r.f)(t,2),a=o[0],s=o[1];"number"==typeof a?(e[a]=s,n|=function(t){return 1<<t%32}(a)):i[a]=s}),{matchedQueries:e,references:i,matchedQueryIds:n}}function la(t,e){return t.map(function(t){var n,i,o;return Array.isArray(t)?(o=(n=Object(r.f)(t,2))[0],i=n[1]):(o=0,i=t),i&&("function"==typeof i||"object"==typeof i)&&e&&Object.defineProperty(i,Pe,{value:e,configurable:!0}),{flags:o,token:i,tokenKey:Ko(i)}})}function ha(t,e,n){var r=n.renderParent;return r?0==(1&r.flags)||0==(33554432&r.flags)||r.element.componentRendererType&&r.element.componentRendererType.encapsulation===D.Native?jo(t,n.renderParent.nodeIndex).renderElement:void 0:e}var fa=new WeakMap;function pa(t){var e=fa.get(t);return e||((e=t(function(){return zo})).factory=t,fa.set(t,e)),e}function da(t,e,n,r,i){3===e&&(n=t.renderer.parentNode(aa(t,t.def.lastRenderRootNode))),ya(t,e,0,t.def.nodes.length-1,n,r,i)}function ya(t,e,n,r,i,o,a){for(var s=n;s<=r;s++){var u=t.def.nodes[s];11&u.flags&&ma(t,u,e,i,o,a),s+=u.childCount}}function ga(t,e,n,r,i,o){for(var a=t;a&&!sa(a);)a=a.parent;for(var s=a.parent,u=oa(a),c=u.nodeIndex+u.childCount,l=u.nodeIndex+1;l<=c;l++){var h=s.def.nodes[l];h.ngContentIndex===e&&ma(s,h,n,r,i,o),l+=h.childCount}if(!s.parent){var f=t.root.projectableNodes[e];if(f)for(l=0;l<f.length;l++)va(t,f[l],n,r,i,o)}}function ma(t,e,n,r,i,o){if(8&e.flags)ga(t,e.ngContent.index,n,r,i,o);else{var a=aa(t,e);if(3===n&&33554432&e.flags&&48&e.bindingFlags?(16&e.bindingFlags&&va(t,a,n,r,i,o),32&e.bindingFlags&&va(jo(t,e.nodeIndex).componentView,a,n,r,i,o)):va(t,a,n,r,i,o),16777216&e.flags)for(var s=jo(t,e.nodeIndex).viewContainer._embeddedViews,u=0;u<s.length;u++)da(s[u],n,r,i,o);1&e.flags&&!e.element.name&&ya(t,n,e.nodeIndex+1,e.nodeIndex+e.childCount,r,i,o)}}function va(t,e,n,r,i,o){var a=t.renderer;switch(n){case 1:a.appendChild(r,e);break;case 2:a.insertBefore(r,e,i);break;case 3:a.removeChild(r,e);break;case 0:o.push(e)}}var ba=/^:([^:]+):(.+)$/;function wa(t){if(":"===t[0]){var e=t.match(ba);return[e[1],e[2]]}return["",t]}function _a(t){for(var e=0,n=0;n<t.length;n++)e|=t[n].flags;return e}function Sa(t,e,n,r,i,o){t|=1;var a=ca(e);return{nodeIndex:-1,parent:null,renderParent:null,bindingIndex:-1,outputIndex:-1,flags:t,checkIndex:-1,childFlags:0,directChildFlags:0,childMatchedQueries:0,matchedQueries:a.matchedQueries,matchedQueryIds:a.matchedQueryIds,references:a.references,ngContentIndex:n,childCount:r,bindings:[],bindingFlags:0,outputs:[],element:{ns:null,name:null,attrs:null,template:o?pa(o):null,componentProvider:null,componentView:null,componentRendererType:null,publicProviders:null,allProviders:null,handleEvent:i||zo},provider:null,text:null,query:null,ngContent:null}}function Ea(t,e,n,i,o,a,s,u,c,l,h,f){var p;void 0===s&&(s=[]),l||(l=zo);var d=ca(n),y=d.matchedQueries,g=d.references,m=d.matchedQueryIds,v=null,b=null;a&&(v=(p=Object(r.f)(wa(a),2))[0],b=p[1]),u=u||[];for(var w=new Array(u.length),_=0;_<u.length;_++){var S=Object(r.f)(u[_],3),E=S[0],T=S[1],C=S[2],I=Object(r.f)(wa(T),2),A=I[0],O=I[1],k=void 0,N=void 0;switch(15&E){case 4:N=C;break;case 1:case 8:k=C}w[_]={flags:E,ns:A,name:O,nonMinifiedName:O,securityContext:k,suffix:N}}c=c||[];var P=new Array(c.length);for(_=0;_<c.length;_++){var R=Object(r.f)(c[_],2);P[_]={type:0,target:R[0],eventName:R[1],propName:null}}var x=(s=s||[]).map(function(t){var e=Object(r.f)(t,2),n=e[0],i=e[1],o=Object(r.f)(wa(n),2);return[o[0],o[1],i]});return f=function(t){if(t&&t.id===Qo){var e=null!=t.encapsulation&&t.encapsulation!==D.None||t.styles.length||Object.keys(t.data).length;t.id=e?"c"+Jo++:Xo}return t&&t.id===Xo&&(t=null),t||null}(f),h&&(e|=33554432),{nodeIndex:-1,parent:null,renderParent:null,bindingIndex:-1,outputIndex:-1,checkIndex:t,flags:e|=1,childFlags:0,directChildFlags:0,childMatchedQueries:0,matchedQueries:y,matchedQueryIds:m,references:g,ngContentIndex:i,childCount:o,bindings:w,bindingFlags:_a(w),outputs:P,element:{ns:v,name:b,attrs:x,template:null,componentProvider:null,componentView:h||null,componentRendererType:f,publicProviders:null,allProviders:null,handleEvent:l||zo},provider:null,text:null,query:null,ngContent:null}}function Ta(t,e,n){var i,o=n.element,a=t.root.selectorOrNode,s=t.renderer;if(t.parent||!a){i=o.name?s.createElement(o.name,o.ns):s.createComment("");var u=ha(t,e,n);u&&s.appendChild(u,i)}else i=s.selectRootElement(a,!!o.componentRendererType&&o.componentRendererType.encapsulation===D.ShadowDom);if(o.attrs)for(var c=0;c<o.attrs.length;c++){var l=Object(r.f)(o.attrs[c],3);s.setAttribute(i,l[1],l[2],l[0])}return i}function Ca(t,e,n,r){for(var i=0;i<n.outputs.length;i++){var o=n.outputs[i],a=Ia(t,n.nodeIndex,(h=o.eventName,(l=o.target)?l+":"+h:h)),s=o.target,u=t;"component"===o.target&&(s=null,u=e);var c=u.renderer.listen(s||r,o.eventName,a);t.disposables[n.outputIndex+i]=c}var l,h}function Ia(t,e,n){return function(r){return ra(t,e,n,r)}}function Aa(t,e,n,r){if(!$o(t,e,n,r))return!1;var i=e.bindings[n],o=jo(t,e.nodeIndex),a=o.renderElement,s=i.name;switch(15&i.flags){case 1:!function(t,e,n,r,i,o){var a=e.securityContext,s=a?t.root.sanitizer.sanitize(a,o):o;s=null!=s?s.toString():null;var u=t.renderer;null!=o?u.setAttribute(n,i,s,r):u.removeAttribute(n,i,r)}(t,i,a,i.ns,s,r);break;case 2:!function(t,e,n,r){var i=t.renderer;r?i.addClass(e,n):i.removeClass(e,n)}(t,a,s,r);break;case 4:!function(t,e,n,r,i){var o=t.root.sanitizer.sanitize(Gr.STYLE,i);if(null!=o){o=o.toString();var a=e.suffix;null!=a&&(o+=a)}else o=null;var s=t.renderer;null!=o?s.setStyle(n,r,o):s.removeStyle(n,r)}(t,i,a,s,r);break;case 8:!function(t,e,n,r,i){var o=e.securityContext,a=o?t.root.sanitizer.sanitize(o,i):i;t.renderer.setProperty(n,r,a)}(33554432&e.flags&&32&i.flags?o.componentView:t,i,a,s,r)}return!0}var Oa=new Object,Da=Ko(Le),ka=Ko(Me),Na=Ko(Je);function Pa(t,e,n,r){return n=Ne(n),{index:-1,deps:la(r,U(e)),flags:t,token:e,value:n}}function Ra(t){for(var e={},n=[],r=!1,i=0;i<t.length;i++){var o=t[i];o.token===xn&&!0===o.value&&(r=!0),1073741824&o.flags&&n.push(o.token),o.index=i,e[Ko(o.token)]=o}return{factory:null,providersByKey:e,providers:t,modules:n,isRoot:r}}function xa(t,e,n){void 0===n&&(n=Le.THROW_IF_NOT_FOUND);var r,i,o=K(t);try{if(8&e.flags)return e.token;if(2&e.flags&&(n=null),1&e.flags)return t._parent.get(e.token,n);var a=e.tokenKey;switch(a){case Da:case ka:case Na:return t}var s,u=t._def.providersByKey[a];if(u){var c=t._providers[u.index];return void 0===c&&(c=t._providers[u.index]=Ma(t,u)),c===Oa?void 0:c}if((s=w(e.token))&&(r=t,null!=(i=s).providedIn&&(function(t,e){return t._def.modules.indexOf(i.providedIn)>-1}(r)||"root"===i.providedIn&&r._def.isRoot))){var l=t._providers.length;return t._def.providersByKey[e.tokenKey]={flags:5120,value:s.factory,deps:[],index:l,token:e.token},t._providers[l]=Oa,t._providers[l]=Ma(t,t._def.providersByKey[e.tokenKey])}return 4&e.flags?n:t._parent.get(e.token,n)}finally{K(o)}}function Ma(t,e){var n;switch(201347067&e.flags){case 512:n=function(t,e,n){var i=n.length;switch(i){case 0:return new e;case 1:return new e(xa(t,n[0]));case 2:return new e(xa(t,n[0]),xa(t,n[1]));case 3:return new e(xa(t,n[0]),xa(t,n[1]),xa(t,n[2]));default:for(var o=new Array(i),a=0;a<i;a++)o[a]=xa(t,n[a]);return new(e.bind.apply(e,Object(r.g)([void 0],o)))}}(t,e.value,e.deps);break;case 1024:n=function(t,e,n){var i=n.length;switch(i){case 0:return e();case 1:return e(xa(t,n[0]));case 2:return e(xa(t,n[0]),xa(t,n[1]));case 3:return e(xa(t,n[0]),xa(t,n[1]),xa(t,n[2]));default:for(var o=Array(i),a=0;a<i;a++)o[a]=xa(t,n[a]);return e.apply(void 0,Object(r.g)(o))}}(t,e.value,e.deps);break;case 2048:n=xa(t,e.deps[0]);break;case 256:n=e.value}return n===Oa||null==n||"object"!=typeof n||131072&e.flags||"function"!=typeof n.ngOnDestroy||(e.flags|=131072),void 0===n?Oa:n}function ja(t,e){var n=t.viewContainer._embeddedViews;if((null==e||e>=n.length)&&(e=n.length-1),e<0)return null;var r=n[e];return r.viewContainerParent=null,Fa(n,e),Fo.dirtyParentQueries(r),Ua(r),r}function La(t,e,n){var r=e?aa(e,e.def.lastRenderRootNode):t.renderElement,i=n.renderer.parentNode(r),o=n.renderer.nextSibling(r);da(n,2,i,o,void 0)}function Ua(t){da(t,3,null,null,void 0)}function Va(t,e,n){e>=t.length?t.push(n):t.splice(e,0,n)}function Fa(t,e){e>=t.length-1?t.pop():t.splice(e,1)}var qa=new Object;function Ba(t,e,n,r,i,o){return new Ha(t,e,n,r,i,o)}var Ha=function(t){function e(e,n,r,i,o,a){var s=t.call(this)||this;return s.selector=e,s.componentType=n,s._inputs=i,s._outputs=o,s.ngContentSelectors=a,s.viewDefFactory=r,s}return Object(r.c)(e,t),Object.defineProperty(e.prototype,"inputs",{get:function(){var t=[],e=this._inputs;for(var n in e)t.push({propName:n,templateName:e[n]});return t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"outputs",{get:function(){var t=[];for(var e in this._outputs)t.push({propName:e,templateName:this._outputs[e]});return t},enumerable:!0,configurable:!0}),e.prototype.create=function(t,e,n,r){if(!r)throw new Error("ngModule should be provided");var i=pa(this.viewDefFactory),o=i.nodes[0].element.componentProvider.nodeIndex,a=Fo.createRootView(t,e||[],n,i,r,qa),s=Lo(a,o).instance;return n&&a.renderer.setAttribute(jo(a,0).renderElement,"ng-version",ur.full),new za(a,new Qa(a),s)},e}(Gn),za=function(t){function e(e,n,r){var i=t.call(this)||this;return i._view=e,i._viewRef=n,i._component=r,i._elDef=i._view.def.nodes[0],i.hostView=n,i.changeDetectorRef=n,i.instance=r,i}return Object(r.c)(e,t),Object.defineProperty(e.prototype,"location",{get:function(){return new tr(jo(this._view,this._elDef.nodeIndex).renderElement)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"injector",{get:function(){return new Za(this._view,this._elDef)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"componentType",{get:function(){return this._component.constructor},enumerable:!0,configurable:!0}),e.prototype.destroy=function(){this._viewRef.destroy()},e.prototype.onDestroy=function(t){this._viewRef.onDestroy(t)},e}(Kn);function Wa(t,e,n){return new Ka(t,e,n)}var Ka=function(){function t(t,e,n){this._view=t,this._elDef=e,this._data=n,this._embeddedViews=[]}return Object.defineProperty(t.prototype,"element",{get:function(){return new tr(this._data.renderElement)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"injector",{get:function(){return new Za(this._view,this._elDef)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"parentInjector",{get:function(){for(var t=this._view,e=this._elDef.parent;!e&&t;)e=oa(t),t=t.parent;return t?new Za(t,e):new Za(this._view,null)},enumerable:!0,configurable:!0}),t.prototype.clear=function(){for(var t=this._embeddedViews.length-1;t>=0;t--){var e=ja(this._data,t);Fo.destroyView(e)}},t.prototype.get=function(t){var e=this._embeddedViews[t];if(e){var n=new Qa(e);return n.attachToViewContainerRef(this),n}return null},Object.defineProperty(t.prototype,"length",{get:function(){return this._embeddedViews.length},enumerable:!0,configurable:!0}),t.prototype.createEmbeddedView=function(t,e,n){var r=t.createEmbeddedView(e||{});return this.insert(r,n),r},t.prototype.createComponent=function(t,e,n,r,i){var o=n||this.parentInjector;i||t instanceof $n||(i=o.get(Je));var a=t.create(o,r,void 0,i);return this.insert(a.hostView,e),a},t.prototype.insert=function(t,e){if(t.destroyed)throw new Error("Cannot insert a destroyed View in a ViewContainer!");var n,r,i,o,a=t;return o=(n=this._data).viewContainer._embeddedViews,null==(r=e)&&(r=o.length),(i=a._view).viewContainerParent=this._view,Va(o,r,i),function(t,e){var n=ia(e);if(n&&n!==t&&!(16&e.state)){e.state|=16;var r=n.template._projectedViews;r||(r=n.template._projectedViews=[]),r.push(e),function(t,n){if(!(4&n.flags)){e.parent.def.nodeFlags|=4,n.flags|=4;for(var r=n.parent;r;)r.childFlags|=4,r=r.parent}}(0,e.parentNodeDef)}}(n,i),Fo.dirtyParentQueries(i),La(n,r>0?o[r-1]:null,i),a.attachToViewContainerRef(this),t},t.prototype.move=function(t,e){if(t.destroyed)throw new Error("Cannot move a destroyed View in a ViewContainer!");var n,r,i,o,a,s=this._embeddedViews.indexOf(t._view);return i=e,a=(o=(n=this._data).viewContainer._embeddedViews)[r=s],Fa(o,r),null==i&&(i=o.length),Va(o,i,a),Fo.dirtyParentQueries(a),Ua(a),La(n,i>0?o[i-1]:null,a),t},t.prototype.indexOf=function(t){return this._embeddedViews.indexOf(t._view)},t.prototype.remove=function(t){var e=ja(this._data,t);e&&Fo.destroyView(e)},t.prototype.detach=function(t){var e=ja(this._data,t);return e?new Qa(e):null},t}();function Ga(t){return new Qa(t)}var Qa=function(){function t(t){this._view=t,this._viewContainerRef=null,this._appRef=null}return Object.defineProperty(t.prototype,"rootNodes",{get:function(){return da(this._view,0,void 0,void 0,t=[]),t;var t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"context",{get:function(){return this._view.context},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"destroyed",{get:function(){return 0!=(128&this._view.state)},enumerable:!0,configurable:!0}),t.prototype.markForCheck=function(){ea(this._view)},t.prototype.detach=function(){this._view.state&=-5},t.prototype.detectChanges=function(){var t=this._view.root.rendererFactory;t.begin&&t.begin();try{Fo.checkAndUpdateView(this._view)}finally{t.end&&t.end()}},t.prototype.checkNoChanges=function(){Fo.checkNoChangesView(this._view)},t.prototype.reattach=function(){this._view.state|=4},t.prototype.onDestroy=function(t){this._view.disposables||(this._view.disposables=[]),this._view.disposables.push(t)},t.prototype.destroy=function(){this._appRef?this._appRef.detachView(this):this._viewContainerRef&&this._viewContainerRef.detach(this._viewContainerRef.indexOf(this)),Fo.destroyView(this._view)},t.prototype.detachFromAppRef=function(){this._appRef=null,Ua(this._view),Fo.dirtyParentQueries(this._view)},t.prototype.attachToAppRef=function(t){if(this._viewContainerRef)throw new Error("This view is already attached to a ViewContainer!");this._appRef=t},t.prototype.attachToViewContainerRef=function(t){if(this._appRef)throw new Error("This view is already attached directly to the ApplicationRef!");this._viewContainerRef=t},t}();function Xa(t,e){return new Ya(t,e)}var Ya=function(t){function e(e,n){var r=t.call(this)||this;return r._parentView=e,r._def=n,r}return Object(r.c)(e,t),e.prototype.createEmbeddedView=function(t){return new Qa(Fo.createEmbeddedView(this._parentView,this._def,this._def.element.template,t))},Object.defineProperty(e.prototype,"elementRef",{get:function(){return new tr(jo(this._parentView,this._def.nodeIndex).renderElement)},enumerable:!0,configurable:!0}),e}(Wr);function Ja(t,e){return new Za(t,e)}var Za=function(){function t(t,e){this.view=t,this.elDef=e}return t.prototype.get=function(t,e){return void 0===e&&(e=Le.THROW_IF_NOT_FOUND),Fo.resolveDep(this.view,this.elDef,!!this.elDef&&0!=(33554432&this.elDef.flags),{flags:0,token:t,tokenKey:Ko(t)},e)},t}();function $a(t,e){var n=t.def.nodes[e];if(1&n.flags){var r=jo(t,n.nodeIndex);return n.element.template?r.template:r.renderElement}if(2&n.flags)return Mo(t,n.nodeIndex).renderText;if(20240&n.flags)return Lo(t,n.nodeIndex).instance;throw new Error("Illegal state: read nodeValue for node index "+e)}function ts(t){return new es(t.renderer)}var es=function(){function t(t){this.delegate=t}return t.prototype.selectRootElement=function(t){return this.delegate.selectRootElement(t)},t.prototype.createElement=function(t,e){var n=Object(r.f)(wa(e),2),i=this.delegate.createElement(n[1],n[0]);return t&&this.delegate.appendChild(t,i),i},t.prototype.createViewRoot=function(t){return t},t.prototype.createTemplateAnchor=function(t){var e=this.delegate.createComment("");return t&&this.delegate.appendChild(t,e),e},t.prototype.createText=function(t,e){var n=this.delegate.createText(e);return t&&this.delegate.appendChild(t,n),n},t.prototype.projectNodes=function(t,e){for(var n=0;n<e.length;n++)this.delegate.appendChild(t,e[n])},t.prototype.attachViewAfter=function(t,e){for(var n=this.delegate.parentNode(t),r=this.delegate.nextSibling(t),i=0;i<e.length;i++)this.delegate.insertBefore(n,e[i],r)},t.prototype.detachView=function(t){for(var e=0;e<t.length;e++){var n=t[e],r=this.delegate.parentNode(n);this.delegate.removeChild(r,n)}},t.prototype.destroyView=function(t,e){for(var n=0;n<e.length;n++)this.delegate.destroyNode(e[n])},t.prototype.listen=function(t,e,n){return this.delegate.listen(t,e,n)},t.prototype.listenGlobal=function(t,e,n){return this.delegate.listen(t,e,n)},t.prototype.setElementProperty=function(t,e,n){this.delegate.setProperty(t,e,n)},t.prototype.setElementAttribute=function(t,e,n){var i=Object(r.f)(wa(e),2),o=i[0],a=i[1];null!=n?this.delegate.setAttribute(t,a,n,o):this.delegate.removeAttribute(t,a,o)},t.prototype.setBindingDebugInfo=function(t,e,n){},t.prototype.setElementClass=function(t,e,n){n?this.delegate.addClass(t,e):this.delegate.removeClass(t,e)},t.prototype.setElementStyle=function(t,e,n){null!=n?this.delegate.setStyle(t,e,n):this.delegate.removeStyle(t,e)},t.prototype.invokeElementMethod=function(t,e,n){t[e].apply(t,n)},t.prototype.setText=function(t,e){this.delegate.setValue(t,e)},t.prototype.animate=function(){throw new Error("Renderer.animate is no longer supported!")},t}();function ns(t,e,n,r){return new rs(t,e,n,r)}var rs=function(){function t(t,e,n,r){this._moduleType=t,this._parent=e,this._bootstrapComponents=n,this._def=r,this._destroyListeners=[],this._destroyed=!1,this.injector=this,function(t){for(var e=t._def,n=t._providers=new Array(e.providers.length),r=0;r<e.providers.length;r++){var i=e.providers[r];4096&i.flags||void 0===n[r]&&(n[r]=Ma(t,i))}}(this)}return t.prototype.get=function(t,e,n){void 0===e&&(e=Le.THROW_IF_NOT_FOUND),void 0===n&&(n=z.Default);var r=0;return n&z.SkipSelf?r|=1:n&z.Self&&(r|=4),xa(this,{token:t,tokenKey:Ko(t),flags:r},e)},Object.defineProperty(t.prototype,"instance",{get:function(){return this.get(this._moduleType)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"componentFactoryResolver",{get:function(){return this.get(Jn)},enumerable:!0,configurable:!0}),t.prototype.destroy=function(){if(this._destroyed)throw new Error("The ng module "+U(this.instance.constructor)+" has already been destroyed.");this._destroyed=!0,function(t,e){for(var n=t._def,r=new Set,i=0;i<n.providers.length;i++)if(131072&n.providers[i].flags){var o=t._providers[i];if(o&&o!==Oa){var a=o.ngOnDestroy;"function"!=typeof a||r.has(o)||(a.apply(o),r.add(o))}}}(this),this._destroyListeners.forEach(function(t){return t()})},t.prototype.onDestroy=function(t){this._destroyListeners.push(t)},t}(),is=Ko(nr),os=Ko(or),as=Ko(tr),ss=Ko(eo),us=Ko(Wr),cs=Ko(ro),ls=Ko(Le),hs=Ko(Me);function fs(t,e,n,i,o,a,s,u){var c=[];if(s)for(var l in s){var h=Object(r.f)(s[l],2);c[h[0]]={flags:8,name:l,nonMinifiedName:h[1],ns:null,securityContext:null,suffix:null}}var f=[];if(u)for(var p in u)f.push({type:1,propName:p,target:null,eventName:u[p]});return ys(t,e|=16384,n,i,o,o,a,c,f)}function ps(t,e,n){return ys(-1,t|=16,null,0,e,e,n)}function ds(t,e,n,r,i){return ys(-1,t,e,0,n,r,i)}function ys(t,e,n,r,i,o,a,s,u){var c=ca(n),l=c.matchedQueries,h=c.references,f=c.matchedQueryIds;u||(u=[]),s||(s=[]),o=Ne(o);var p=la(a,U(i));return{nodeIndex:-1,parent:null,renderParent:null,bindingIndex:-1,outputIndex:-1,checkIndex:t,flags:e,childFlags:0,directChildFlags:0,childMatchedQueries:0,matchedQueries:l,matchedQueryIds:f,references:h,ngContentIndex:-1,childCount:r,bindings:s,bindingFlags:_a(s),outputs:u,element:null,provider:{token:i,value:o,deps:p},text:null,query:null,ngContent:null}}function gs(t,e){return ws(t,e)}function ms(t,e){for(var n=t;n.parent&&!sa(n);)n=n.parent;return _s(n.parent,oa(n),!0,e.provider.value,e.provider.deps)}function vs(t,e){var n=_s(t,e.parent,(32768&e.flags)>0,e.provider.value,e.provider.deps);if(e.outputs.length)for(var r=0;r<e.outputs.length;r++){var i=e.outputs[r],o=n[i.propName];if(!ui(o))throw new Error("@Output "+i.propName+" not initialized in '"+n.constructor.name+"'.");var a=o.subscribe(bs(t,e.parent.nodeIndex,i.eventName));t.disposables[e.outputIndex+r]=a.unsubscribe.bind(a)}return n}function bs(t,e,n){return function(r){return ra(t,e,n,r)}}function ws(t,e){var n=(8192&e.flags)>0,i=e.provider;switch(201347067&e.flags){case 512:return _s(t,e.parent,n,i.value,i.deps);case 1024:return function(t,e,n,i,o){var a=o.length;switch(a){case 0:return i();case 1:return i(Es(t,e,n,o[0]));case 2:return i(Es(t,e,n,o[0]),Es(t,e,n,o[1]));case 3:return i(Es(t,e,n,o[0]),Es(t,e,n,o[1]),Es(t,e,n,o[2]));default:for(var s=Array(a),u=0;u<a;u++)s[u]=Es(t,e,n,o[u]);return i.apply(void 0,Object(r.g)(s))}}(t,e.parent,n,i.value,i.deps);case 2048:return Es(t,e.parent,n,i.deps[0]);case 256:return i.value}}function _s(t,e,n,i,o){var a=o.length;switch(a){case 0:return new i;case 1:return new i(Es(t,e,n,o[0]));case 2:return new i(Es(t,e,n,o[0]),Es(t,e,n,o[1]));case 3:return new i(Es(t,e,n,o[0]),Es(t,e,n,o[1]),Es(t,e,n,o[2]));default:for(var s=new Array(a),u=0;u<a;u++)s[u]=Es(t,e,n,o[u]);return new(i.bind.apply(i,Object(r.g)([void 0],s)))}}var Ss={};function Es(t,e,n,r,i){if(void 0===i&&(i=Le.THROW_IF_NOT_FOUND),8&r.flags)return r.token;var o=t;2&r.flags&&(i=null);var a=r.tokenKey;a===cs&&(n=!(!e||!e.element.componentView)),e&&1&r.flags&&(n=!1,e=e.parent);for(var s=t;s;){if(e)switch(a){case is:return ts(Ts(s,e,n));case os:return Ts(s,e,n).renderer;case as:return new tr(jo(s,e.nodeIndex).renderElement);case ss:return jo(s,e.nodeIndex).viewContainer;case us:if(e.element.template)return jo(s,e.nodeIndex).template;break;case cs:return Ga(Ts(s,e,n));case ls:case hs:return Ja(s,e);default:var u=(n?e.element.allProviders:e.element.publicProviders)[a];if(u){var c=Lo(s,u.nodeIndex);return c||(c={instance:ws(s,u)},s.nodes[u.nodeIndex]=c),c.instance}}n=sa(s),e=oa(s),s=s.parent,4&r.flags&&(s=null)}var l=o.root.injector.get(r.token,Ss);return l!==Ss||i===Ss?l:o.root.ngModule.injector.get(r.token,i)}function Ts(t,e,n){var r;if(n)r=jo(t,e.nodeIndex).componentView;else for(r=t;r.parent&&!sa(r);)r=r.parent;return r}function Cs(t,e,n,r,i,o){if(32768&n.flags){var a=jo(t,n.parent.nodeIndex).componentView;2&a.def.flags&&(a.state|=8)}if(e.instance[n.bindings[r].name]=i,524288&n.flags){o=o||{};var s=Ct.unwrap(t.oldValues[n.bindingIndex+r]);o[n.bindings[r].nonMinifiedName]=new It(s,i,0!=(2&t.state))}return t.oldValues[n.bindingIndex+r]=i,o}function Is(t,e){if(t.def.nodeFlags&e)for(var n=t.def.nodes,r=0,i=0;i<n.length;i++){var o=n[i],a=o.parent;for(!a&&o.flags&e&&Os(t,i,o.flags&e,r++),0==(o.childFlags&e)&&(i+=o.childCount);a&&1&a.flags&&i===a.nodeIndex+a.childCount;)a.directChildFlags&e&&(r=As(t,a,e,r)),a=a.parent}}function As(t,e,n,r){for(var i=e.nodeIndex+1;i<=e.nodeIndex+e.childCount;i++){var o=t.def.nodes[i];o.flags&n&&Os(t,i,o.flags&n,r++),i+=o.childCount}return r}function Os(t,e,n,r){var i=Lo(t,e);if(i){var o=i.instance;o&&(Fo.setCurrentNode(t,e),1048576&n&&xo(t,512,r)&&o.ngAfterContentInit(),2097152&n&&o.ngAfterContentChecked(),4194304&n&&xo(t,768,r)&&o.ngAfterViewInit(),8388608&n&&o.ngAfterViewChecked(),131072&n&&o.ngOnDestroy())}}function Ds(t){for(var e=t.def.nodeMatchedQueries;t.parent&&ua(t);){var n=t.parentNodeDef;t=t.parent;for(var r=n.nodeIndex+n.childCount,i=0;i<=r;i++)67108864&(o=t.def.nodes[i]).flags&&536870912&o.flags&&(o.query.filterId&e)===o.query.filterId&&Vo(t,i).setDirty(),!(1&o.flags&&i+o.childCount<n.nodeIndex)&&67108864&o.childFlags&&536870912&o.childFlags||(i+=o.childCount)}if(134217728&t.def.nodeFlags)for(i=0;i<t.def.nodes.length;i++){var o;134217728&(o=t.def.nodes[i]).flags&&536870912&o.flags&&Vo(t,i).setDirty(),i+=o.childCount}}function ks(t,e){var n=Vo(t,e.nodeIndex);if(n.dirty){var r,i=void 0;if(67108864&e.flags){var o=e.parent.parent;i=Ns(t,o.nodeIndex,o.nodeIndex+o.childCount,e.query,[]),r=Lo(t,e.parent.nodeIndex).instance}else 134217728&e.flags&&(i=Ns(t,0,t.def.nodes.length-1,e.query,[]),r=t.component);n.reset(i);for(var a=e.query.bindings,s=!1,u=0;u<a.length;u++){var c=a[u],l=void 0;switch(c.bindingType){case 0:l=n.first;break;case 1:l=n,s=!0}r[c.propName]=l}s&&n.notifyOnChanges()}}function Ns(t,e,n,r,i){for(var o=e;o<=n;o++){var a=t.def.nodes[o],s=a.matchedQueries[r.id];if(null!=s&&i.push(Ps(t,a,s)),1&a.flags&&a.element.template&&(a.element.template.nodeMatchedQueries&r.filterId)===r.filterId){var u=jo(t,o);if((a.childMatchedQueries&r.filterId)===r.filterId&&(Ns(t,o+1,o+a.childCount,r,i),o+=a.childCount),16777216&a.flags)for(var c=u.viewContainer._embeddedViews,l=0;l<c.length;l++){var h=c[l],f=ia(h);f&&f===u&&Ns(h,0,h.def.nodes.length-1,r,i)}var p=u.template._projectedViews;if(p)for(l=0;l<p.length;l++){var d=p[l];Ns(d,0,d.def.nodes.length-1,r,i)}}(a.childMatchedQueries&r.filterId)!==r.filterId&&(o+=a.childCount)}return i}function Ps(t,e,n){if(null!=n)switch(n){case 1:return jo(t,e.nodeIndex).renderElement;case 0:return new tr(jo(t,e.nodeIndex).renderElement);case 2:return jo(t,e.nodeIndex).template;case 3:return jo(t,e.nodeIndex).viewContainer;case 4:return Lo(t,e.nodeIndex).instance}}function Rs(t,e,n){var r=ha(t,e,n);r&&ga(t,n.ngContent.index,1,r,null,void 0)}function xs(t,e,n){for(var r=new Array(n.length-1),i=1;i<n.length;i++)r[i-1]={flags:8,name:null,ns:null,nonMinifiedName:null,securityContext:null,suffix:n[i]};return{nodeIndex:-1,parent:null,renderParent:null,bindingIndex:-1,outputIndex:-1,checkIndex:t,flags:2,childFlags:0,directChildFlags:0,childMatchedQueries:0,matchedQueries:{},matchedQueryIds:0,references:{},ngContentIndex:e,childCount:0,bindings:r,bindingFlags:8,outputs:[],element:null,provider:null,text:{prefix:n[0]},query:null,ngContent:null}}function Ms(t,e,n){var r,i=t.renderer;r=i.createText(n.text.prefix);var o=ha(t,e,n);return o&&i.appendChild(o,r),{renderText:r}}function js(t,e){return(null!=t?t.toString():"")+e.suffix}function Ls(t,e,n,r){for(var i=0,o=0,a=0,s=0,u=0,c=null,l=null,h=!1,f=!1,p=null,d=0;d<e.length;d++){var y=e[d];if(y.nodeIndex=d,y.parent=c,y.bindingIndex=i,y.outputIndex=o,y.renderParent=l,a|=y.flags,u|=y.matchedQueryIds,y.element){var g=y.element;g.publicProviders=c?c.element.publicProviders:Object.create(null),g.allProviders=g.publicProviders,h=!1,f=!1,y.element.template&&(u|=y.element.template.nodeMatchedQueries)}if(Vs(c,y,e.length),i+=y.bindings.length,o+=y.outputs.length,!l&&3&y.flags&&(p=y),20224&y.flags){h||(h=!0,c.element.publicProviders=Object.create(c.element.publicProviders),c.element.allProviders=c.element.publicProviders);var m=0!=(32768&y.flags);0==(8192&y.flags)||m?c.element.publicProviders[Ko(y.provider.token)]=y:(f||(f=!0,c.element.allProviders=Object.create(c.element.publicProviders)),c.element.allProviders[Ko(y.provider.token)]=y),m&&(c.element.componentProvider=y)}if(c?(c.childFlags|=y.flags,c.directChildFlags|=y.flags,c.childMatchedQueries|=y.matchedQueryIds,y.element&&y.element.template&&(c.childMatchedQueries|=y.element.template.nodeMatchedQueries)):s|=y.flags,y.childCount>0)c=y,Us(y)||(l=y);else for(;c&&d===c.nodeIndex+c.childCount;){var v=c.parent;v&&(v.childFlags|=c.childFlags,v.childMatchedQueries|=c.childMatchedQueries),l=(c=v)&&Us(c)?c.renderParent:c}}return{factory:null,nodeFlags:a,rootNodeFlags:s,nodeMatchedQueries:u,flags:t,nodes:e,updateDirectives:n||zo,updateRenderer:r||zo,handleEvent:function(t,n,r,i){return e[n].element.handleEvent(t,r,i)},bindingCount:i,outputCount:o,lastRenderRootNode:p}}function Us(t){return 0!=(1&t.flags)&&null===t.element.name}function Vs(t,e,n){var r=e.element&&e.element.template;if(r){if(!r.lastRenderRootNode)throw new Error("Illegal State: Embedded templates without nodes are not allowed!");if(r.lastRenderRootNode&&16777216&r.lastRenderRootNode.flags)throw new Error("Illegal State: Last root node of a template can't have embedded views, at index "+e.nodeIndex+"!")}if(20224&e.flags&&0==(1&(t?t.flags:0)))throw new Error("Illegal State: StaticProvider/Directive nodes need to be children of elements or anchors, at index "+e.nodeIndex+"!");if(e.query){if(67108864&e.flags&&(!t||0==(16384&t.flags)))throw new Error("Illegal State: Content Query nodes need to be children of directives, at index "+e.nodeIndex+"!");if(134217728&e.flags&&t)throw new Error("Illegal State: View Query nodes have to be top level nodes, at index "+e.nodeIndex+"!")}if(e.childCount){var i=t?t.nodeIndex+t.childCount:n-1;if(e.nodeIndex<=i&&e.nodeIndex+e.childCount>i)throw new Error("Illegal State: childCount of node leads outside of parent, at index "+e.nodeIndex+"!")}}function Fs(t,e,n,r){var i=Hs(t.root,t.renderer,t,e,n);return zs(i,t.component,r),Ws(i),i}function qs(t,e,n){var r=Hs(t,t.renderer,null,null,e);return zs(r,n,n),Ws(r),r}function Bs(t,e,n,r){var i,o=e.element.componentRendererType;return i=o?t.root.rendererFactory.createRenderer(r,o):t.root.renderer,Hs(t.root,i,t,e.element.componentProvider,n)}function Hs(t,e,n,r,i){var o=new Array(i.nodes.length),a=i.outputCount?new Array(i.outputCount):null;return{def:i,parent:n,viewContainerParent:null,parentNodeDef:r,context:null,component:null,nodes:o,state:13,root:t,renderer:e,oldValues:new Array(i.bindingCount),disposables:a,initIndex:-1}}function zs(t,e,n){t.component=e,t.context=n}function Ws(t){var e;sa(t)&&(e=jo(t.parent,t.parentNodeDef.parent.nodeIndex).renderElement);for(var n=t.def,r=t.nodes,i=0;i<n.nodes.length;i++){var o=n.nodes[i];Fo.setCurrentNode(t,i);var a=void 0;switch(201347067&o.flags){case 1:var s=Ta(t,e,o),u=void 0;if(33554432&o.flags){var c=pa(o.element.componentView);u=Fo.createComponentView(t,o,c,s)}Ca(t,u,o,s),a={renderElement:s,componentView:u,viewContainer:null,template:o.element.template?Xa(t,o):void 0},16777216&o.flags&&(a.viewContainer=Wa(t,o,a));break;case 2:a=Ms(t,e,o);break;case 512:case 1024:case 2048:case 256:(a=r[i])||4096&o.flags||(a={instance:gs(t,o)});break;case 16:a={instance:ms(t,o)};break;case 16384:(a=r[i])||(a={instance:vs(t,o)}),32768&o.flags&&zs(jo(t,o.parent.nodeIndex).componentView,a.instance,a.instance);break;case 32:case 64:case 128:a={value:void 0};break;case 67108864:case 134217728:a=new Xi;break;case 8:Rs(t,e,o),a=void 0}r[i]=a}tu(t,$s.CreateViewNodes),iu(t,201326592,268435456,0)}function Ks(t){Xs(t),Fo.updateDirectives(t,1),eu(t,$s.CheckNoChanges),Fo.updateRenderer(t,1),tu(t,$s.CheckNoChanges),t.state&=-97}function Gs(t){1&t.state?(t.state&=-2,t.state|=2):t.state&=-3,Ro(t,0,256),Xs(t),Fo.updateDirectives(t,0),eu(t,$s.CheckAndUpdate),iu(t,67108864,536870912,0);var e=Ro(t,256,512);Is(t,2097152|(e?1048576:0)),Fo.updateRenderer(t,0),tu(t,$s.CheckAndUpdate),iu(t,134217728,536870912,0),Is(t,8388608|((e=Ro(t,512,768))?4194304:0)),2&t.def.flags&&(t.state&=-9),t.state&=-97,Ro(t,768,1024)}function Qs(t,e,n,i,o,a,s,u,c,l,h,f,p){return 0===n?function(t,e,n,r,i,o,a,s,u,c,l,h){switch(201347067&e.flags){case 1:return function(t,e,n,r,i,o,a,s,u,c,l,h){var f=e.bindings.length,p=!1;return f>0&&Aa(t,e,0,n)&&(p=!0),f>1&&Aa(t,e,1,r)&&(p=!0),f>2&&Aa(t,e,2,i)&&(p=!0),f>3&&Aa(t,e,3,o)&&(p=!0),f>4&&Aa(t,e,4,a)&&(p=!0),f>5&&Aa(t,e,5,s)&&(p=!0),f>6&&Aa(t,e,6,u)&&(p=!0),f>7&&Aa(t,e,7,c)&&(p=!0),f>8&&Aa(t,e,8,l)&&(p=!0),f>9&&Aa(t,e,9,h)&&(p=!0),p}(t,e,n,r,i,o,a,s,u,c,l,h);case 2:return function(t,e,n,r,i,o,a,s,u,c,l,h){var f=!1,p=e.bindings,d=p.length;if(d>0&&$o(t,e,0,n)&&(f=!0),d>1&&$o(t,e,1,r)&&(f=!0),d>2&&$o(t,e,2,i)&&(f=!0),d>3&&$o(t,e,3,o)&&(f=!0),d>4&&$o(t,e,4,a)&&(f=!0),d>5&&$o(t,e,5,s)&&(f=!0),d>6&&$o(t,e,6,u)&&(f=!0),d>7&&$o(t,e,7,c)&&(f=!0),d>8&&$o(t,e,8,l)&&(f=!0),d>9&&$o(t,e,9,h)&&(f=!0),f){var y=e.text.prefix;d>0&&(y+=js(n,p[0])),d>1&&(y+=js(r,p[1])),d>2&&(y+=js(i,p[2])),d>3&&(y+=js(o,p[3])),d>4&&(y+=js(a,p[4])),d>5&&(y+=js(s,p[5])),d>6&&(y+=js(u,p[6])),d>7&&(y+=js(c,p[7])),d>8&&(y+=js(l,p[8])),d>9&&(y+=js(h,p[9]));var g=Mo(t,e.nodeIndex).renderText;t.renderer.setValue(g,y)}return f}(t,e,n,r,i,o,a,s,u,c,l,h);case 16384:return function(t,e,n,r,i,o,a,s,u,c,l,h){var f=Lo(t,e.nodeIndex),p=f.instance,d=!1,y=void 0,g=e.bindings.length;return g>0&&Zo(t,e,0,n)&&(d=!0,y=Cs(t,f,e,0,n,y)),g>1&&Zo(t,e,1,r)&&(d=!0,y=Cs(t,f,e,1,r,y)),g>2&&Zo(t,e,2,i)&&(d=!0,y=Cs(t,f,e,2,i,y)),g>3&&Zo(t,e,3,o)&&(d=!0,y=Cs(t,f,e,3,o,y)),g>4&&Zo(t,e,4,a)&&(d=!0,y=Cs(t,f,e,4,a,y)),g>5&&Zo(t,e,5,s)&&(d=!0,y=Cs(t,f,e,5,s,y)),g>6&&Zo(t,e,6,u)&&(d=!0,y=Cs(t,f,e,6,u,y)),g>7&&Zo(t,e,7,c)&&(d=!0,y=Cs(t,f,e,7,c,y)),g>8&&Zo(t,e,8,l)&&(d=!0,y=Cs(t,f,e,8,l,y)),g>9&&Zo(t,e,9,h)&&(d=!0,y=Cs(t,f,e,9,h,y)),y&&p.ngOnChanges(y),65536&e.flags&&xo(t,256,e.nodeIndex)&&p.ngOnInit(),262144&e.flags&&p.ngDoCheck(),d}(t,e,n,r,i,o,a,s,u,c,l,h);case 32:case 64:case 128:return function(t,e,n,r,i,o,a,s,u,c,l,h){var f=e.bindings,p=!1,d=f.length;if(d>0&&$o(t,e,0,n)&&(p=!0),d>1&&$o(t,e,1,r)&&(p=!0),d>2&&$o(t,e,2,i)&&(p=!0),d>3&&$o(t,e,3,o)&&(p=!0),d>4&&$o(t,e,4,a)&&(p=!0),d>5&&$o(t,e,5,s)&&(p=!0),d>6&&$o(t,e,6,u)&&(p=!0),d>7&&$o(t,e,7,c)&&(p=!0),d>8&&$o(t,e,8,l)&&(p=!0),d>9&&$o(t,e,9,h)&&(p=!0),p){var y=Uo(t,e.nodeIndex),g=void 0;switch(201347067&e.flags){case 32:g=new Array(f.length),d>0&&(g[0]=n),d>1&&(g[1]=r),d>2&&(g[2]=i),d>3&&(g[3]=o),d>4&&(g[4]=a),d>5&&(g[5]=s),d>6&&(g[6]=u),d>7&&(g[7]=c),d>8&&(g[8]=l),d>9&&(g[9]=h);break;case 64:g={},d>0&&(g[f[0].name]=n),d>1&&(g[f[1].name]=r),d>2&&(g[f[2].name]=i),d>3&&(g[f[3].name]=o),d>4&&(g[f[4].name]=a),d>5&&(g[f[5].name]=s),d>6&&(g[f[6].name]=u),d>7&&(g[f[7].name]=c),d>8&&(g[f[8].name]=l),d>9&&(g[f[9].name]=h);break;case 128:var m=n;switch(d){case 1:g=m.transform(n);break;case 2:g=m.transform(r);break;case 3:g=m.transform(r,i);break;case 4:g=m.transform(r,i,o);break;case 5:g=m.transform(r,i,o,a);break;case 6:g=m.transform(r,i,o,a,s);break;case 7:g=m.transform(r,i,o,a,s,u);break;case 8:g=m.transform(r,i,o,a,s,u,c);break;case 9:g=m.transform(r,i,o,a,s,u,c,l);break;case 10:g=m.transform(r,i,o,a,s,u,c,l,h)}}y.value=g}return p}(t,e,n,r,i,o,a,s,u,c,l,h);default:throw"unreachable"}}(t,e,i,o,a,s,u,c,l,h,f,p):function(t,e,n){switch(201347067&e.flags){case 1:return function(t,e,n){for(var r=!1,i=0;i<n.length;i++)Aa(t,e,i,n[i])&&(r=!0);return r}(t,e,n);case 2:return function(t,e,n){for(var r=e.bindings,i=!1,o=0;o<n.length;o++)$o(t,e,o,n[o])&&(i=!0);if(i){var a="";for(o=0;o<n.length;o++)a+=js(n[o],r[o]);a=e.text.prefix+a;var s=Mo(t,e.nodeIndex).renderText;t.renderer.setValue(s,a)}return i}(t,e,n);case 16384:return function(t,e,n){for(var r=Lo(t,e.nodeIndex),i=r.instance,o=!1,a=void 0,s=0;s<n.length;s++)Zo(t,e,s,n[s])&&(o=!0,a=Cs(t,r,e,s,n[s],a));return a&&i.ngOnChanges(a),65536&e.flags&&xo(t,256,e.nodeIndex)&&i.ngOnInit(),262144&e.flags&&i.ngDoCheck(),o}(t,e,n);case 32:case 64:case 128:return function(t,e,n){for(var i=e.bindings,o=!1,a=0;a<n.length;a++)$o(t,e,a,n[a])&&(o=!0);if(o){var s=Uo(t,e.nodeIndex),u=void 0;switch(201347067&e.flags){case 32:u=n;break;case 64:for(u={},a=0;a<n.length;a++)u[i[a].name]=n[a];break;case 128:var c=n[0],l=n.slice(1);u=c.transform.apply(c,Object(r.g)(l))}s.value=u}return o}(t,e,n);default:throw"unreachable"}}(t,e,i)}function Xs(t){var e=t.def;if(4&e.nodeFlags)for(var n=0;n<e.nodes.length;n++){var r=e.nodes[n];if(4&r.flags){var i=jo(t,n).template._projectedViews;if(i)for(var o=0;o<i.length;o++){var a=i[o];a.state|=32,na(a,t)}}else 0==(4&r.childFlags)&&(n+=r.childCount)}}function Ys(t,e,n,r,i,o,a,s,u,c,l,h,f){return 0===n?function(t,e,n,r,i,o,a,s,u,c,l,h){var f=e.bindings.length;f>0&&ta(t,e,0,n),f>1&&ta(t,e,1,r),f>2&&ta(t,e,2,i),f>3&&ta(t,e,3,o),f>4&&ta(t,e,4,a),f>5&&ta(t,e,5,s),f>6&&ta(t,e,6,u),f>7&&ta(t,e,7,c),f>8&&ta(t,e,8,l),f>9&&ta(t,e,9,h)}(t,e,r,i,o,a,s,u,c,l,h,f):function(t,e,n){for(var r=0;r<n.length;r++)ta(t,e,r,n[r])}(t,e,r),!1}function Js(t,e){if(Vo(t,e.nodeIndex).dirty)throw qo(Fo.createDebugContext(t,e.nodeIndex),"Query "+e.query.id+" not dirty","Query "+e.query.id+" dirty",0!=(1&t.state))}function Zs(t){if(!(128&t.state)){if(eu(t,$s.Destroy),tu(t,$s.Destroy),Is(t,131072),t.disposables)for(var e=0;e<t.disposables.length;e++)t.disposables[e]();!function(t){if(16&t.state){var e=ia(t);if(e){var n=e.template._projectedViews;n&&(Fa(n,n.indexOf(t)),Fo.dirtyParentQueries(t))}}}(t),t.renderer.destroyNode&&function(t){for(var e=t.def.nodes.length,n=0;n<e;n++){var r=t.def.nodes[n];1&r.flags?t.renderer.destroyNode(jo(t,n).renderElement):2&r.flags?t.renderer.destroyNode(Mo(t,n).renderText):(67108864&r.flags||134217728&r.flags)&&Vo(t,n).destroy()}}(t),sa(t)&&t.renderer.destroy(),t.state|=128}}var $s=function(t){return t[t.CreateViewNodes=0]="CreateViewNodes",t[t.CheckNoChanges=1]="CheckNoChanges",t[t.CheckNoChangesProjectedViews=2]="CheckNoChangesProjectedViews",t[t.CheckAndUpdate=3]="CheckAndUpdate",t[t.CheckAndUpdateProjectedViews=4]="CheckAndUpdateProjectedViews",t[t.Destroy=5]="Destroy",t}({});function tu(t,e){var n=t.def;if(33554432&n.nodeFlags)for(var r=0;r<n.nodes.length;r++){var i=n.nodes[r];33554432&i.flags?nu(jo(t,r).componentView,e):0==(33554432&i.childFlags)&&(r+=i.childCount)}}function eu(t,e){var n=t.def;if(16777216&n.nodeFlags)for(var r=0;r<n.nodes.length;r++){var i=n.nodes[r];if(16777216&i.flags)for(var o=jo(t,r).viewContainer._embeddedViews,a=0;a<o.length;a++)nu(o[a],e);else 0==(16777216&i.childFlags)&&(r+=i.childCount)}}function nu(t,e){var n=t.state;switch(e){case $s.CheckNoChanges:0==(128&n)&&(12==(12&n)?Ks(t):64&n&&ru(t,$s.CheckNoChangesProjectedViews));break;case $s.CheckNoChangesProjectedViews:0==(128&n)&&(32&n?Ks(t):64&n&&ru(t,e));break;case $s.CheckAndUpdate:0==(128&n)&&(12==(12&n)?Gs(t):64&n&&ru(t,$s.CheckAndUpdateProjectedViews));break;case $s.CheckAndUpdateProjectedViews:0==(128&n)&&(32&n?Gs(t):64&n&&ru(t,e));break;case $s.Destroy:Zs(t);break;case $s.CreateViewNodes:Ws(t)}}function ru(t,e){eu(t,e),tu(t,e)}function iu(t,e,n,r){if(t.def.nodeFlags&e&&t.def.nodeFlags&n)for(var i=t.def.nodes.length,o=0;o<i;o++){var a=t.def.nodes[o];if(a.flags&e&&a.flags&n)switch(Fo.setCurrentNode(t,a.nodeIndex),r){case 0:ks(t,a);break;case 1:Js(t,a)}a.childFlags&e&&a.childFlags&n||(o+=a.childCount)}}var ou=!1;function au(t,e,n,r,i,o){var a=i.injector.get(rr);return qs(uu(t,i,a,e,n),r,o)}function su(t,e,n,r,i,o){var a=i.injector.get(rr),s=uu(t,i,new Bu(a),e,n),u=vu(r);return Fu(Au.create,qs,null,[s,u,o])}function uu(t,e,n,r,i){var o=e.injector.get(Qr),a=e.injector.get(ai),s=n.createRenderer(null,null);return{ngModule:e,injector:t,projectableNodes:r,selectorOrNode:i,sanitizer:o,rendererFactory:n,renderer:s,errorHandler:a}}function cu(t,e,n,r){var i=vu(n);return Fu(Au.create,Fs,null,[t,e,i,r])}function lu(t,e,n,r){return n=du.get(e.element.componentProvider.provider.token)||vu(n),Fu(Au.create,Bs,null,[t,e,n,r])}function hu(t,e,n,r){return ns(t,e,n,function(t){var e=function(t){var e=!1,n=!1;return 0===fu.size?{hasOverrides:e,hasDeprecatedOverrides:n}:(t.providers.forEach(function(t){var r=fu.get(t.token);3840&t.flags&&r&&(e=!0,n=n||r.deprecatedBehavior)}),t.modules.forEach(function(t){pu.forEach(function(r,i){w(i).providedIn===t&&(e=!0,n=n||r.deprecatedBehavior)})}),{hasOverrides:e,hasDeprecatedOverrides:n})}(t),n=e.hasDeprecatedOverrides;return e.hasOverrides?(function(t){for(var e=0;e<t.providers.length;e++){var r=t.providers[e];n&&(r.flags|=4096);var i=fu.get(r.token);i&&(r.flags=-3841&r.flags|i.flags,r.deps=la(i.deps),r.value=i.value)}if(pu.size>0){var o=new Set(t.modules);pu.forEach(function(e,r){if(o.has(w(r).providedIn)){var i={token:r,flags:e.flags|(n?4096:0),deps:la(e.deps),value:e.value,index:t.providers.length};t.providers.push(i),t.providersByKey[Ko(r)]=i}})}}(t=t.factory(function(){return zo})),t):t}(r))}var fu=new Map,pu=new Map,du=new Map;function yu(t){var e;fu.set(t.token,t),"function"==typeof t.token&&(e=w(t.token))&&"function"==typeof e.providedIn&&pu.set(t.token,t)}function gu(t,e){var n=pa(e.viewDefFactory),r=pa(n.nodes[0].element.componentView);du.set(t,r)}function mu(){fu.clear(),pu.clear(),du.clear()}function vu(t){if(0===fu.size)return t;var e=function(t){for(var e=[],n=null,r=0;r<t.nodes.length;r++){var i=t.nodes[r];1&i.flags&&(n=i),n&&3840&i.flags&&fu.has(i.provider.token)&&(e.push(n.nodeIndex),n=null)}return e}(t);if(0===e.length)return t;t=t.factory(function(){return zo});for(var n=0;n<e.length;n++)r(t,e[n]);return t;function r(t,e){for(var n=e+1;n<t.nodes.length;n++){var r=t.nodes[n];if(1&r.flags)return;if(3840&r.flags){var i=r.provider,o=fu.get(i.token);o&&(r.flags=-3841&r.flags|o.flags,i.deps=la(o.deps),i.value=o.value)}}}}function bu(t,e,n,r,i,o,a,s,u,c,l,h,f){var p=t.def.nodes[e];return Qs(t,p,n,r,i,o,a,s,u,c,l,h,f),224&p.flags?Uo(t,e).value:void 0}function wu(t,e,n,r,i,o,a,s,u,c,l,h,f){var p=t.def.nodes[e];return Ys(t,p,n,r,i,o,a,s,u,c,l,h,f),224&p.flags?Uo(t,e).value:void 0}function _u(t){return Fu(Au.detectChanges,Gs,null,[t])}function Su(t){return Fu(Au.checkNoChanges,Ks,null,[t])}function Eu(t){return Fu(Au.destroy,Zs,null,[t])}var Tu,Cu,Iu,Au=function(t){return t[t.create=0]="create",t[t.detectChanges=1]="detectChanges",t[t.checkNoChanges=2]="checkNoChanges",t[t.destroy=3]="destroy",t[t.handleEvent=4]="handleEvent",t}({});function Ou(t,e){Cu=t,Iu=e}function Du(t,e,n,r){return Ou(t,e),Fu(Au.handleEvent,t.def.handleEvent,null,[t,e,n,r])}function ku(t,e){if(128&t.state)throw Ho(Au[Tu]);return Ou(t,ju(t,0)),t.def.updateDirectives(function(t,n,r){for(var i=[],o=3;o<arguments.length;o++)i[o-3]=arguments[o];var a=t.def.nodes[n];return 0===e?Pu(t,a,r,i):Ru(t,a,r,i),16384&a.flags&&Ou(t,ju(t,n)),224&a.flags?Uo(t,a.nodeIndex).value:void 0},t)}function Nu(t,e){if(128&t.state)throw Ho(Au[Tu]);return Ou(t,Lu(t,0)),t.def.updateRenderer(function(t,n,r){for(var i=[],o=3;o<arguments.length;o++)i[o-3]=arguments[o];var a=t.def.nodes[n];return 0===e?Pu(t,a,r,i):Ru(t,a,r,i),3&a.flags&&Ou(t,Lu(t,n)),224&a.flags?Uo(t,a.nodeIndex).value:void 0},t)}function Pu(t,e,n,i){if(Qs.apply(void 0,Object(r.g)([t,e,n],i))){var o=1===n?i[0]:i;if(16384&e.flags){for(var a={},s=0;s<e.bindings.length;s++){var u=e.bindings[s],c=o[s];8&u.flags&&(a[(p=u.nonMinifiedName,d=void 0,d=p.replace(/[$@]/g,"_"),"ng-reflect-"+(p=d.replace(xu,function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return"-"+t[1].toLowerCase()})))]=Mu(c))}var l=e.parent,h=jo(t,l.nodeIndex).renderElement;if(l.element.name)for(var f in a)null!=(c=a[f])?t.renderer.setAttribute(h,f,c):t.renderer.removeAttribute(h,f);else t.renderer.setValue(h,"bindings="+JSON.stringify(a,null,2))}}var p,d}function Ru(t,e,n,i){Ys.apply(void 0,Object(r.g)([t,e,n],i))}var xu=/([A-Z])/g;function Mu(t){try{return null!=t?t.toString().slice(0,30):t}catch(e){return"[ERROR] Exception while trying to serialize the value"}}function ju(t,e){for(var n=e;n<t.def.nodes.length;n++){var r=t.def.nodes[n];if(16384&r.flags&&r.bindings&&r.bindings.length)return n}return null}function Lu(t,e){for(var n=e;n<t.def.nodes.length;n++){var r=t.def.nodes[n];if(3&r.flags&&r.bindings&&r.bindings.length)return n}return null}var Uu=function(){function t(t,e){this.view=t,this.nodeIndex=e,null==e&&(this.nodeIndex=e=0),this.nodeDef=t.def.nodes[e];for(var n=this.nodeDef,r=t;n&&0==(1&n.flags);)n=n.parent;if(!n)for(;!n&&r;)n=oa(r),r=r.parent;this.elDef=n,this.elView=r}return Object.defineProperty(t.prototype,"elOrCompView",{get:function(){return jo(this.elView,this.elDef.nodeIndex).componentView||this.view},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"injector",{get:function(){return Ja(this.elView,this.elDef)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"component",{get:function(){return this.elOrCompView.component},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"context",{get:function(){return this.elOrCompView.context},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"providerTokens",{get:function(){var t=[];if(this.elDef)for(var e=this.elDef.nodeIndex+1;e<=this.elDef.nodeIndex+this.elDef.childCount;e++){var n=this.elView.def.nodes[e];20224&n.flags&&t.push(n.provider.token),e+=n.childCount}return t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"references",{get:function(){var t={};if(this.elDef){Vu(this.elView,this.elDef,t);for(var e=this.elDef.nodeIndex+1;e<=this.elDef.nodeIndex+this.elDef.childCount;e++){var n=this.elView.def.nodes[e];20224&n.flags&&Vu(this.elView,n,t),e+=n.childCount}}return t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"componentRenderElement",{get:function(){var t=function(t){for(;t&&!sa(t);)t=t.parent;return t.parent?jo(t.parent,oa(t).nodeIndex):null}(this.elOrCompView);return t?t.renderElement:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"renderNode",{get:function(){return 2&this.nodeDef.flags?aa(this.view,this.nodeDef):aa(this.elView,this.elDef)},enumerable:!0,configurable:!0}),t.prototype.logError=function(t){for(var e,n,i=[],o=1;o<arguments.length;o++)i[o-1]=arguments[o];2&this.nodeDef.flags?(e=this.view.def,n=this.nodeDef.nodeIndex):(e=this.elView.def,n=this.elDef.nodeIndex);var a=function(t,e){for(var n=-1,r=0;r<=e;r++)3&t.nodes[r].flags&&n++;return n}(e,n),s=-1;e.factory(function(){var e;return++s===a?(e=t.error).bind.apply(e,Object(r.g)([t],i)):zo}),s<a&&(t.error("Illegal state: the ViewDefinitionFactory did not call the logger!"),t.error.apply(t,Object(r.g)(i)))},t}();function Vu(t,e,n){for(var r in e.references)n[r]=Ps(t,e,e.references[r])}function Fu(t,e,n,r){var i=Tu,o=Cu,a=Iu;try{Tu=t;var s=e.apply(n,r);return Cu=o,Iu=a,Tu=i,s}catch(u){if(ri(u)||!Cu)throw u;throw function(t,e){return t instanceof Error||(t=new Error(t.toString())),Bo(t,e),t}(u,qu())}}function qu(){return Cu?new Uu(Cu,Iu):null}var Bu=function(){function t(t){this.delegate=t}return t.prototype.createRenderer=function(t,e){return new Hu(this.delegate.createRenderer(t,e))},t.prototype.begin=function(){this.delegate.begin&&this.delegate.begin()},t.prototype.end=function(){this.delegate.end&&this.delegate.end()},t.prototype.whenRenderingDone=function(){return this.delegate.whenRenderingDone?this.delegate.whenRenderingDone():Promise.resolve(null)},t}(),Hu=function(){function t(t){this.delegate=t,this.debugContextFactory=qu,this.data=this.delegate.data}return t.prototype.createDebugContext=function(t){return this.debugContextFactory(t)},t.prototype.destroyNode=function(t){!function(t){uo.delete(t.nativeNode)}(co(t)),this.delegate.destroyNode&&this.delegate.destroyNode(t)},t.prototype.destroy=function(){this.delegate.destroy()},t.prototype.createElement=function(t,e){var n=this.delegate.createElement(t,e),r=this.createDebugContext(n);if(r){var i=new so(n,null,r);i.name=t,lo(i)}return n},t.prototype.createComment=function(t){var e=this.delegate.createComment(t),n=this.createDebugContext(e);return n&&lo(new ao(e,null,n)),e},t.prototype.createText=function(t){var e=this.delegate.createText(t),n=this.createDebugContext(e);return n&&lo(new ao(e,null,n)),e},t.prototype.appendChild=function(t,e){var n=co(t),r=co(e);n&&r&&n instanceof so&&n.addChild(r),this.delegate.appendChild(t,e)},t.prototype.insertBefore=function(t,e,n){var r=co(t),i=co(e),o=co(n);r&&i&&r instanceof so&&r.insertBefore(o,i),this.delegate.insertBefore(t,e,n)},t.prototype.removeChild=function(t,e){var n=co(t),r=co(e);n&&r&&n instanceof so&&n.removeChild(r),this.delegate.removeChild(t,e)},t.prototype.selectRootElement=function(t,e){var n=this.delegate.selectRootElement(t,e),r=qu()||null;return r&&lo(new so(n,null,r)),n},t.prototype.setAttribute=function(t,e,n,r){var i=co(t);i&&i instanceof so&&(i.attributes[r?r+":"+e:e]=n),this.delegate.setAttribute(t,e,n,r)},t.prototype.removeAttribute=function(t,e,n){var r=co(t);r&&r instanceof so&&(r.attributes[n?n+":"+e:e]=null),this.delegate.removeAttribute(t,e,n)},t.prototype.addClass=function(t,e){var n=co(t);n&&n instanceof so&&(n.classes[e]=!0),this.delegate.addClass(t,e)},t.prototype.removeClass=function(t,e){var n=co(t);n&&n instanceof so&&(n.classes[e]=!1),this.delegate.removeClass(t,e)},t.prototype.setStyle=function(t,e,n,r){var i=co(t);i&&i instanceof so&&(i.styles[e]=n),this.delegate.setStyle(t,e,n,r)},t.prototype.removeStyle=function(t,e,n){var r=co(t);r&&r instanceof so&&(r.styles[e]=null),this.delegate.removeStyle(t,e,n)},t.prototype.setProperty=function(t,e,n){var r=co(t);r&&r instanceof so&&(r.properties[e]=n),this.delegate.setProperty(t,e,n)},t.prototype.listen=function(t,e,n){if("string"!=typeof t){var r=co(t);r&&r.listeners.push(new oo(e,n))}return this.delegate.listen(t,e,n)},t.prototype.parentNode=function(t){return this.delegate.parentNode(t)},t.prototype.nextSibling=function(t){return this.delegate.nextSibling(t)},t.prototype.setValue=function(t,e){return this.delegate.setValue(t,e)},t}();function zu(t,e,n){return new Wu(t,e,n)}var Wu=function(t){function e(e,n,r){var i=t.call(this)||this;return i.moduleType=e,i._bootstrapComponents=n,i._ngModuleDefFactory=r,i}return Object(r.c)(e,t),e.prototype.create=function(t){!function(){if(!ou){ou=!0;var t=br()?{setCurrentNode:Ou,createRootView:su,createEmbeddedView:cu,createComponentView:lu,createNgModuleRef:hu,overrideProvider:yu,overrideComponentView:gu,clearOverrides:mu,checkAndUpdateView:_u,checkNoChangesView:Su,destroyView:Eu,createDebugContext:function(t,e){return new Uu(t,e)},handleEvent:Du,updateDirectives:ku,updateRenderer:Nu}:{setCurrentNode:function(){},createRootView:au,createEmbeddedView:Fs,createComponentView:Bs,createNgModuleRef:ns,overrideProvider:zo,overrideComponentView:zo,clearOverrides:zo,checkAndUpdateView:Gs,checkNoChangesView:Ks,destroyView:Zs,createDebugContext:function(t,e){return new Uu(t,e)},handleEvent:function(t,e,n,r){return t.def.handleEvent(t,e,n,r)},updateDirectives:function(t,e){return t.def.updateDirectives(0===e?bu:wu,t)},updateRenderer:function(t,e){return t.def.updateRenderer(0===e?bu:wu,t)}};Fo.setCurrentNode=t.setCurrentNode,Fo.createRootView=t.createRootView,Fo.createEmbeddedView=t.createEmbeddedView,Fo.createComponentView=t.createComponentView,Fo.createNgModuleRef=t.createNgModuleRef,Fo.overrideProvider=t.overrideProvider,Fo.overrideComponentView=t.overrideComponentView,Fo.clearOverrides=t.clearOverrides,Fo.checkAndUpdateView=t.checkAndUpdateView,Fo.checkNoChangesView=t.checkNoChangesView,Fo.destroyView=t.destroyView,Fo.resolveDep=Es,Fo.createDebugContext=t.createDebugContext,Fo.handleEvent=t.handleEvent,Fo.updateDirectives=t.updateDirectives,Fo.updateRenderer=t.updateRenderer,Fo.dirtyParentQueries=Ds}}();var e=function(t){var e=Array.from(t.providers),n=Array.from(t.modules),r={};for(var i in t.providersByKey)r[i]=t.providersByKey[i];return{factory:t.factory,isRoot:t.isRoot,providers:e,modules:n,providersByKey:r}}(pa(this._ngModuleDefFactory));return Fo.createNgModuleRef(this.moduleType,t||Le.NULL,this._bootstrapComponents,e)},e}(Ze)},CqG3:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}(n("tct4"))},DKTb:function(t,e,n){"use strict";function r(t){setTimeout(function(){throw t})}n.d(e,"a",function(){return r})},"En8+":function(t,e,n){"use strict";function r(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}n.d(e,"a",function(){return i});var i=r()},"F/XL":function(t,e,n){"use strict";n.d(e,"a",function(){return s});var r=n("nkY7"),i=n("IUTb"),o=n("G5J1"),a=n("PU8L");function s(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t[t.length-1];switch(Object(r.a)(n)?t.pop():n=void 0,t.length){case 0:return Object(o.b)(n);case 1:return n?Object(i.a)(t,n):Object(a.a)(t[0]);default:return Object(i.a)(t,n)}}},FFOo:function(t,e,n){"use strict";n.d(e,"a",function(){return l});var r=n("mrSG"),i=n("2Bdj"),o=n("6ahw"),a=n("pugT"),s=n("L/V9"),u=n("iLxQ"),c=n("DKTb"),l=function(t){function e(n,r,i){var a=t.call(this)||this;switch(a.syncErrorValue=null,a.syncErrorThrown=!1,a.syncErrorThrowable=!1,a.isStopped=!1,a._parentSubscription=null,arguments.length){case 0:a.destination=o.a;break;case 1:if(!n){a.destination=o.a;break}if("object"==typeof n){n instanceof e?(a.syncErrorThrowable=n.syncErrorThrowable,a.destination=n,n.add(a)):(a.syncErrorThrowable=!0,a.destination=new h(a,n));break}default:a.syncErrorThrowable=!0,a.destination=new h(a,n,r,i)}return a}return r.c(e,t),e.prototype[s.a]=function(){return this},e.create=function(t,n,r){var i=new e(t,n,r);return i.syncErrorThrowable=!1,i},e.prototype.next=function(t){this.isStopped||this._next(t)},e.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this))},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){this.destination.error(t),this.unsubscribe()},e.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},e.prototype._unsubscribeAndRecycle=function(){var t=this._parent,e=this._parents;return this._parent=null,this._parents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parent=t,this._parents=e,this._parentSubscription=null,this},e}(a.a),h=function(t){function e(e,n,r,a){var s,u=t.call(this)||this;u._parentSubscriber=e;var c=u;return Object(i.a)(n)?s=n:n&&(s=n.next,r=n.error,a=n.complete,n!==o.a&&(c=Object.create(n),Object(i.a)(c.unsubscribe)&&u.add(c.unsubscribe.bind(c)),c.unsubscribe=u.unsubscribe.bind(u))),u._context=c,u._next=s,u._error=r,u._complete=a,u}return r.c(e,t),e.prototype.next=function(t){if(!this.isStopped&&this._next){var e=this._parentSubscriber;u.a.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?this.__tryOrSetError(e,this._next,t)&&this.unsubscribe():this.__tryOrUnsub(this._next,t)}},e.prototype.error=function(t){if(!this.isStopped){var e=this._parentSubscriber,n=u.a.useDeprecatedSynchronousErrorHandling;if(this._error)n&&e.syncErrorThrowable?(this.__tryOrSetError(e,this._error,t),this.unsubscribe()):(this.__tryOrUnsub(this._error,t),this.unsubscribe());else if(e.syncErrorThrowable)n?(e.syncErrorValue=t,e.syncErrorThrown=!0):Object(c.a)(t),this.unsubscribe();else{if(this.unsubscribe(),n)throw t;Object(c.a)(t)}}},e.prototype.complete=function(){var t=this;if(!this.isStopped){var e=this._parentSubscriber;if(this._complete){var n=function(){return t._complete.call(t._context)};u.a.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?(this.__tryOrSetError(e,n),this.unsubscribe()):(this.__tryOrUnsub(n),this.unsubscribe())}else this.unsubscribe()}},e.prototype.__tryOrUnsub=function(t,e){try{t.call(this._context,e)}catch(n){if(this.unsubscribe(),u.a.useDeprecatedSynchronousErrorHandling)throw n;Object(c.a)(n)}},e.prototype.__tryOrSetError=function(t,e,n){if(!u.a.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{e.call(this._context,n)}catch(r){return u.a.useDeprecatedSynchronousErrorHandling?(t.syncErrorValue=r,t.syncErrorThrown=!0,!0):(Object(c.a)(r),!0)}return!1},e.prototype._unsubscribe=function(){var t=this._parentSubscriber;this._context=null,this._parentSubscriber=null,t.unsubscribe()},e}(l)},Fxb1:function(t,e,n){"use strict";n.d(e,"a",function(){return p});var r=n("6blF"),i=n("+tJ4"),o=n("S5XQ"),a=n("u67D"),s=n("JcRv"),u=n("2ePl"),c=n("/WYv"),l=n("McSo"),h=n("En8+"),f=n("xTla"),p=function(t){if(t instanceof r.a)return function(e){return t._isScalar?(e.next(t.value),void e.complete()):t.subscribe(e)};if(t&&"function"==typeof t[f.a])return Object(s.a)(t);if(Object(u.a)(t))return Object(i.a)(t);if(Object(c.a)(t))return Object(o.a)(t);if(t&&"function"==typeof t[h.a])return Object(a.a)(t);var e=Object(l.a)(t)?"an invalid object":"'"+t+"'";throw new TypeError("You provided "+e+" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.")}},G5J1:function(t,e,n){"use strict";n.d(e,"a",function(){return i}),n.d(e,"b",function(){return o});var r=n("6blF"),i=new r.a(function(t){return t.complete()});function o(t){return t?function(t){return new r.a(function(e){return t.schedule(function(){return e.complete()})})}(t):i}},IUTb:function(t,e,n){"use strict";n.d(e,"a",function(){return a});var r=n("6blF"),i=n("pugT"),o=n("+tJ4");function a(t,e){return new r.a(e?function(n){var r=new i.a,o=0;return r.add(e.schedule(function(){o!==t.length?(n.next(t[o++]),n.closed||r.add(this.schedule())):n.complete()})),r}:Object(o.a)(t))}},Ip0R:function(t,e,n){"use strict";n.d(e,"s",function(){return m}),n.d(e,"k",function(){return b}),n.d(e,"l",function(){return v}),n.d(e,"t",function(){return w}),n.d(e,"c",function(){return N}),n.d(e,"i",function(){return S}),n.d(e,"j",function(){return T}),n.d(e,"d",function(){return P}),n.d(e,"b",function(){return k}),n.d(e,"r",function(){return R}),n.d(e,"p",function(){return M}),n.d(e,"q",function(){return j}),n.d(e,"o",function(){return L}),n.d(e,"n",function(){return o}),n.d(e,"f",function(){return a}),n.d(e,"h",function(){return s}),n.d(e,"a",function(){return u}),n.d(e,"e",function(){return h}),n.d(e,"m",function(){return f}),n.d(e,"g",function(){return c});var r=n("CcnG"),i=n("mrSG"),o=function(){return function(){}}(),a=new r.p("Location Initialized"),s=function(){return function(){}}(),u=new r.p("appBaseHref"),c=function(){function t(t){var n=this;this._subject=new r.m,this._platformStrategy=t;var i=this._platformStrategy.getBaseHref();this._baseHref=e.stripTrailingSlash(l(i)),this._platformStrategy.onPopState(function(t){n._subject.emit({url:n.path(!0),pop:!0,state:t.state,type:t.type})})}var e;return e=t,t.prototype.path=function(t){return void 0===t&&(t=!1),this.normalize(this._platformStrategy.path(t))},t.prototype.isCurrentPathEqualTo=function(t,n){return void 0===n&&(n=""),this.path()==this.normalize(t+e.normalizeQueryParams(n))},t.prototype.normalize=function(t){return e.stripTrailingSlash(function(t,e){return t&&e.startsWith(t)?e.substring(t.length):e}(this._baseHref,l(t)))},t.prototype.prepareExternalUrl=function(t){return t&&"/"!==t[0]&&(t="/"+t),this._platformStrategy.prepareExternalUrl(t)},t.prototype.go=function(t,e,n){void 0===e&&(e=""),void 0===n&&(n=null),this._platformStrategy.pushState(n,"",t,e)},t.prototype.replaceState=function(t,e,n){void 0===e&&(e=""),void 0===n&&(n=null),this._platformStrategy.replaceState(n,"",t,e)},t.prototype.forward=function(){this._platformStrategy.forward()},t.prototype.back=function(){this._platformStrategy.back()},t.prototype.subscribe=function(t,e,n){return this._subject.subscribe({next:t,error:e,complete:n})},t.normalizeQueryParams=function(t){return t&&"?"!==t[0]?"?"+t:t},t.joinWithSlash=function(t,e){if(0==t.length)return e;if(0==e.length)return t;var n=0;return t.endsWith("/")&&n++,e.startsWith("/")&&n++,2==n?t+e.substring(1):1==n?t+e:t+"/"+e},t.stripTrailingSlash=function(t){var e=t.match(/#|\?|$/),n=e&&e.index||t.length;return t.slice(0,n-("/"===t[n-1]?1:0))+t.slice(n)},t}();function l(t){return t.replace(/\/index.html$/,"")}var h=function(t){function e(e,n){var r=t.call(this)||this;return r._platformLocation=e,r._baseHref="",null!=n&&(r._baseHref=n),r}return Object(i.c)(e,t),e.prototype.onPopState=function(t){this._platformLocation.onPopState(t),this._platformLocation.onHashChange(t)},e.prototype.getBaseHref=function(){return this._baseHref},e.prototype.path=function(t){void 0===t&&(t=!1);var e=this._platformLocation.hash;return null==e&&(e="#"),e.length>0?e.substring(1):e},e.prototype.prepareExternalUrl=function(t){var e=c.joinWithSlash(this._baseHref,t);return e.length>0?"#"+e:e},e.prototype.pushState=function(t,e,n,r){var i=this.prepareExternalUrl(n+c.normalizeQueryParams(r));0==i.length&&(i=this._platformLocation.pathname),this._platformLocation.pushState(t,e,i)},e.prototype.replaceState=function(t,e,n,r){var i=this.prepareExternalUrl(n+c.normalizeQueryParams(r));0==i.length&&(i=this._platformLocation.pathname),this._platformLocation.replaceState(t,e,i)},e.prototype.forward=function(){this._platformLocation.forward()},e.prototype.back=function(){this._platformLocation.back()},e}(s),f=function(t){function e(e,n){var r=t.call(this)||this;if(r._platformLocation=e,null==n&&(n=r._platformLocation.getBaseHrefFromDOM()),null==n)throw new Error("No base href set. Please provide a value for the APP_BASE_HREF token or add a base element to the document.");return r._baseHref=n,r}return Object(i.c)(e,t),e.prototype.onPopState=function(t){this._platformLocation.onPopState(t),this._platformLocation.onHashChange(t)},e.prototype.getBaseHref=function(){return this._baseHref},e.prototype.prepareExternalUrl=function(t){return c.joinWithSlash(this._baseHref,t)},e.prototype.path=function(t){void 0===t&&(t=!1);var e=this._platformLocation.pathname+c.normalizeQueryParams(this._platformLocation.search),n=this._platformLocation.hash;return n&&t?""+e+n:e},e.prototype.pushState=function(t,e,n,r){var i=this.prepareExternalUrl(n+c.normalizeQueryParams(r));this._platformLocation.pushState(t,e,i)},e.prototype.replaceState=function(t,e,n,r){var i=this.prepareExternalUrl(n+c.normalizeQueryParams(r));this._platformLocation.replaceState(t,e,i)},e.prototype.forward=function(){this._platformLocation.forward()},e.prototype.back=function(){this._platformLocation.back()},e}(s),p=void 0,d=["en",[["a","p"],["AM","PM"],p],[["AM","PM"],p,p],[["S","M","T","W","T","F","S"],["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],["Su","Mo","Tu","We","Th","Fr","Sa"]],p,[["J","F","M","A","M","J","J","A","S","O","N","D"],["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],["January","February","March","April","May","June","July","August","September","October","November","December"]],p,[["B","A"],["BC","AD"],["Before Christ","Anno Domini"]],0,[6,0],["M/d/yy","MMM d, y","MMMM d, y","EEEE, MMMM d, y"],["h:mm a","h:mm:ss a","h:mm:ss a z","h:mm:ss a zzzz"],["{1}, {0}",p,"{1} 'at' {0}",p],[".",",",";","%","+","-","E","\xd7","\u2030","\u221e","NaN",":"],["#,##0.###","#,##0%","\xa4#,##0.00","#E0"],"$","US Dollar",{},function(t){var e=Math.floor(Math.abs(t)),n=t.toString().replace(/^[^.]*\.?/,"").length;return 1===e&&0===n?1:5}],y={},g=function(t){return t[t.Zero=0]="Zero",t[t.One=1]="One",t[t.Two=2]="Two",t[t.Few=3]="Few",t[t.Many=4]="Many",t[t.Other=5]="Other",t}({}),m=new r.p("UseV4Plurals"),v=function(){return function(){}}(),b=function(t){function e(e,n){var r=t.call(this)||this;return r.locale=e,r.deprecatedPluralFn=n,r}return Object(i.c)(e,t),e.prototype.getPluralCategory=function(t,e){switch(this.deprecatedPluralFn?this.deprecatedPluralFn(e||this.locale,t):function(t){return function(t){var e=t.toLowerCase().replace(/_/g,"-"),n=y[e];if(n)return n;var r=e.split("-")[0];if(n=y[r])return n;if("en"===r)return d;throw new Error('Missing locale data for the locale "'+t+'".')}(t)[18]}(e||this.locale)(t)){case g.Zero:return"zero";case g.One:return"one";case g.Two:return"two";case g.Few:return"few";case g.Many:return"many";default:return"other"}},e}(v);function w(t,e){var n,r;e=encodeURIComponent(e);try{for(var o=Object(i.h)(t.split(";")),a=o.next();!a.done;a=o.next()){var s=a.value,u=s.indexOf("="),c=Object(i.f)(-1==u?[s,""]:[s.slice(0,u),s.slice(u+1)],2),l=c[1];if(c[0].trim()===e)return decodeURIComponent(l)}}catch(h){n={error:h}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return null}var _=function(){function t(t,e,n,r){this.$implicit=t,this.ngForOf=e,this.index=n,this.count=r}return Object.defineProperty(t.prototype,"first",{get:function(){return 0===this.index},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"last",{get:function(){return this.index===this.count-1},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"even",{get:function(){return this.index%2==0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"odd",{get:function(){return!this.even},enumerable:!0,configurable:!0}),t}(),S=function(){function t(t,e,n){this._viewContainer=t,this._template=e,this._differs=n,this._ngForOfDirty=!0,this._differ=null}return Object.defineProperty(t.prototype,"ngForOf",{set:function(t){this._ngForOf=t,this._ngForOfDirty=!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ngForTrackBy",{get:function(){return this._trackByFn},set:function(t){Object(r.X)()&&null!=t&&"function"!=typeof t&&console&&console.warn&&console.warn("trackBy must be a function, but received "+JSON.stringify(t)+". See https://angular.io/docs/ts/latest/api/common/index/NgFor-directive.html#!#change-propagation for more information."),this._trackByFn=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ngForTemplate",{set:function(t){t&&(this._template=t)},enumerable:!0,configurable:!0}),t.prototype.ngDoCheck=function(){if(this._ngForOfDirty){this._ngForOfDirty=!1;var t=this._ngForOf;if(!this._differ&&t)try{this._differ=this._differs.find(t).create(this.ngForTrackBy)}catch(r){throw new Error("Cannot find a differ supporting object '"+t+"' of type '"+((e=t).name||typeof e)+"'. NgFor only supports binding to Iterables such as Arrays.")}}var e;if(this._differ){var n=this._differ.diff(this._ngForOf);n&&this._applyChanges(n)}},t.prototype._applyChanges=function(t){var e=this,n=[];t.forEachOperation(function(t,r,i){if(null==t.previousIndex){var o=e._viewContainer.createEmbeddedView(e._template,new _(null,e._ngForOf,-1,-1),i),a=new E(t,o);n.push(a)}else null==i?e._viewContainer.remove(r):(o=e._viewContainer.get(r),e._viewContainer.move(o,i),a=new E(t,o),n.push(a))});for(var r=0;r<n.length;r++)this._perViewChange(n[r].view,n[r].record);r=0;for(var i=this._viewContainer.length;r<i;r++){var o=this._viewContainer.get(r);o.context.index=r,o.context.count=i,o.context.ngForOf=this._ngForOf}t.forEachIdentityChange(function(t){e._viewContainer.get(t.currentIndex).context.$implicit=t.item})},t.prototype._perViewChange=function(t,e){t.context.$implicit=e.item},t.ngTemplateContextGuard=function(t,e){return!0},t}(),E=function(){return function(t,e){this.record=t,this.view=e}}(),T=function(){function t(t,e){this._viewContainer=t,this._context=new C,this._thenTemplateRef=null,this._elseTemplateRef=null,this._thenViewRef=null,this._elseViewRef=null,this._thenTemplateRef=e}return Object.defineProperty(t.prototype,"ngIf",{set:function(t){this._context.$implicit=this._context.ngIf=t,this._updateView()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ngIfThen",{set:function(t){I("ngIfThen",t),this._thenTemplateRef=t,this._thenViewRef=null,this._updateView()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ngIfElse",{set:function(t){I("ngIfElse",t),this._elseTemplateRef=t,this._elseViewRef=null,this._updateView()},enumerable:!0,configurable:!0}),t.prototype._updateView=function(){this._context.$implicit?this._thenViewRef||(this._viewContainer.clear(),this._elseViewRef=null,this._thenTemplateRef&&(this._thenViewRef=this._viewContainer.createEmbeddedView(this._thenTemplateRef,this._context))):this._elseViewRef||(this._viewContainer.clear(),this._thenViewRef=null,this._elseTemplateRef&&(this._elseViewRef=this._viewContainer.createEmbeddedView(this._elseTemplateRef,this._context)))},t.ngTemplateGuard_ngIf=function(t,e){return!0},t}(),C=function(){return function(){this.$implicit=null,this.ngIf=null}}();function I(t,e){if(e&&!e.createEmbeddedView)throw new Error(t+" must be a TemplateRef, but received '"+Object(r.Ab)(e)+"'.")}var A=function(){function t(){}return t.prototype.createSubscription=function(t,e){return t.subscribe({next:e,error:function(t){throw t}})},t.prototype.dispose=function(t){t.unsubscribe()},t.prototype.onDestroy=function(t){t.unsubscribe()},t}(),O=new(function(){function t(){}return t.prototype.createSubscription=function(t,e){return t.then(e,function(t){throw t})},t.prototype.dispose=function(t){},t.prototype.onDestroy=function(t){},t}()),D=new A,k=function(){function t(t){this._ref=t,this._latestValue=null,this._latestReturnedValue=null,this._subscription=null,this._obj=null,this._strategy=null}var e;return e=t,t.prototype.ngOnDestroy=function(){this._subscription&&this._dispose()},t.prototype.transform=function(t){return this._obj?t!==this._obj?(this._dispose(),this.transform(t)):this._latestValue===this._latestReturnedValue?this._latestReturnedValue:(this._latestReturnedValue=this._latestValue,r.Q.wrap(this._latestValue)):(t&&this._subscribe(t),this._latestReturnedValue=this._latestValue,this._latestValue)},t.prototype._subscribe=function(t){var e=this;this._obj=t,this._strategy=this._selectStrategy(t),this._subscription=this._strategy.createSubscription(t,function(n){return e._updateLatestValue(t,n)})},t.prototype._selectStrategy=function(t){if(Object(r.tb)(t))return O;if(Object(r.sb)(t))return D;throw n=e,Error("InvalidPipeArgument: '"+t+"' for pipe '"+Object(r.Ab)(n)+"'");var n},t.prototype._dispose=function(){this._strategy.dispose(this._subscription),this._latestValue=null,this._latestReturnedValue=null,this._subscription=null,this._obj=null},t.prototype._updateLatestValue=function(t,e){t===this._obj&&(this._latestValue=e,this._ref.markForCheck())},t}(),N=function(){return function(){}}(),P=new r.p("DocumentToken"),R="browser",x="server";function M(t){return t===R}function j(t){return t===x}var L=function(){function t(){}return t.ngInjectableDef=Object(r.S)({providedIn:"root",factory:function(){return new U(Object(r.W)(P),window)}}),t}(),U=function(){function t(t,e){this.document=t,this.window=e,this.offset=function(){return[0,0]}}return t.prototype.setOffset=function(t){this.offset=Array.isArray(t)?function(){return t}:t},t.prototype.getScrollPosition=function(){return this.supportScrollRestoration()?[this.window.scrollX,this.window.scrollY]:[0,0]},t.prototype.scrollToPosition=function(t){this.supportScrollRestoration()&&this.window.scrollTo(t[0],t[1])},t.prototype.scrollToAnchor=function(t){if(this.supportScrollRestoration()){var e=this.document.querySelector("#"+t);if(e)return void this.scrollToElement(e);var n=this.document.querySelector("[name='"+t+"']");if(n)return void this.scrollToElement(n)}},t.prototype.setHistoryScrollRestoration=function(t){if(this.supportScrollRestoration()){var e=this.window.history;e&&e.scrollRestoration&&(e.scrollRestoration=t)}},t.prototype.scrollToElement=function(t){var e=t.getBoundingClientRect(),n=e.left+this.window.pageXOffset,r=e.top+this.window.pageYOffset,i=this.offset();this.window.scrollTo(n-i[0],r-i[1])},t.prototype.supportScrollRestoration=function(){try{return!!this.window&&!!this.window.scrollTo}catch(t){return!1}},t}()},JcRv:function(t,e,n){"use strict";n.d(e,"a",function(){return i});var r=n("xTla"),i=function(t){return function(e){var n=t[r.a]();if("function"!=typeof n.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return n.subscribe(e)}}},K9Ia:function(t,e,n){"use strict";var r=n("mrSG"),i=n("6blF"),o=n("FFOo"),a=n("pugT"),s=n("8g8A"),u=function(t){function e(e,n){var r=t.call(this)||this;return r.subject=e,r.subscriber=n,r.closed=!1,r}return r.c(e,t),e.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var t=this.subject,e=t.observers;if(this.subject=null,e&&0!==e.length&&!t.isStopped&&!t.closed){var n=e.indexOf(this.subscriber);-1!==n&&e.splice(n,1)}}},e}(a.a),c=n("L/V9");n.d(e,"b",function(){return l}),n.d(e,"a",function(){return h});var l=function(t){function e(e){var n=t.call(this,e)||this;return n.destination=e,n}return r.c(e,t),e}(o.a),h=function(t){function e(){var e=t.call(this)||this;return e.observers=[],e.closed=!1,e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return r.c(e,t),e.prototype[c.a]=function(){return new l(this)},e.prototype.lift=function(t){var e=new f(this,this);return e.operator=t,e},e.prototype.next=function(t){if(this.closed)throw new s.a;if(!this.isStopped)for(var e=this.observers,n=e.length,r=e.slice(),i=0;i<n;i++)r[i].next(t)},e.prototype.error=function(t){if(this.closed)throw new s.a;this.hasError=!0,this.thrownError=t,this.isStopped=!0;for(var e=this.observers,n=e.length,r=e.slice(),i=0;i<n;i++)r[i].error(t);this.observers.length=0},e.prototype.complete=function(){if(this.closed)throw new s.a;this.isStopped=!0;for(var t=this.observers,e=t.length,n=t.slice(),r=0;r<e;r++)n[r].complete();this.observers.length=0},e.prototype.unsubscribe=function(){this.isStopped=!0,this.closed=!0,this.observers=null},e.prototype._trySubscribe=function(e){if(this.closed)throw new s.a;return t.prototype._trySubscribe.call(this,e)},e.prototype._subscribe=function(t){if(this.closed)throw new s.a;return this.hasError?(t.error(this.thrownError),a.a.EMPTY):this.isStopped?(t.complete(),a.a.EMPTY):(this.observers.push(t),new u(this,t))},e.prototype.asObservable=function(){var t=new i.a;return t.source=this,t},e.create=function(t,e){return new f(t,e)},e}(i.a),f=function(t){function e(e,n){var r=t.call(this)||this;return r.destination=e,r.source=n,r}return r.c(e,t),e.prototype.next=function(t){var e=this.destination;e&&e.next&&e.next(t)},e.prototype.error=function(t){var e=this.destination;e&&e.error&&this.destination.error(t)},e.prototype.complete=function(){var t=this.destination;t&&t.complete&&this.destination.complete()},e.prototype._subscribe=function(t){return this.source?this.source.subscribe(t):a.a.EMPTY},e}(h)},"L/V9":function(t,e,n){"use strict";n.d(e,"a",function(){return r});var r="function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random()},MGBS:function(t,e,n){"use strict";n.d(e,"a",function(){return i});var r=n("mrSG"),i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.c(e,t),e.prototype.notifyNext=function(t,e,n,r,i){this.destination.next(e)},e.prototype.notifyError=function(t,e){this.destination.error(t)},e.prototype.notifyComplete=function(t){this.destination.complete()},e}(n("FFOo").a)},McSo:function(t,e,n){"use strict";function r(t){return null!=t&&"object"==typeof t}n.d(e,"a",function(){return r})},ORnb:function(t,e,n){"use strict";var r=n("CcnG"),i=n("Ip0R"),o=n("mrSG"),a=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r}return o.c(e,t),e.prototype.schedule=function(e,n){return void 0===n&&(n=0),n>0?t.prototype.schedule.call(this,e,n):(this.delay=n,this.state=e,this.scheduler.flush(this),this)},e.prototype.execute=function(e,n){return n>0||this.closed?t.prototype.execute.call(this,e,n):this._execute(e,n)},e.prototype.requestAsyncId=function(e,n,r){return void 0===r&&(r=0),null!==r&&r>0||null===r&&this.delay>0?t.prototype.requestAsyncId.call(this,e,n,r):e.flush(this)},e}(function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r.pending=!1,r}return o.c(e,t),e.prototype.schedule=function(t,e){if(void 0===e&&(e=0),this.closed)return this;this.state=t;var n=this.id,r=this.scheduler;return null!=n&&(this.id=this.recycleAsyncId(r,n,e)),this.pending=!0,this.delay=e,this.id=this.id||this.requestAsyncId(r,this.id,e),this},e.prototype.requestAsyncId=function(t,e,n){return void 0===n&&(n=0),setInterval(t.flush.bind(t,this),n)},e.prototype.recycleAsyncId=function(t,e,n){if(void 0===n&&(n=0),null!==n&&this.delay===n&&!1===this.pending)return e;clearInterval(e)},e.prototype.execute=function(t,e){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var n=this._execute(t,e);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(t,e){var n=!1,r=void 0;try{this.work(t)}catch(i){n=!0,r=!!i&&i||new Error(i)}if(n)return this.unsubscribe(),r},e.prototype._unsubscribe=function(){var t=this.id,e=this.scheduler,n=e.actions,r=n.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==r&&n.splice(r,1),null!=t&&(this.id=this.recycleAsyncId(e,t,null)),this.delay=null},e}(function(t){function e(e,n){return t.call(this)||this}return o.c(e,t),e.prototype.schedule=function(t,e){return void 0===e&&(e=0),this},e}(n("pugT").a))),s=function(){function t(e,n){void 0===n&&(n=t.now),this.SchedulerAction=e,this.now=n}return t.prototype.schedule=function(t,e,n){return void 0===e&&(e=0),new this.SchedulerAction(this,t).schedule(n,e)},t.now=function(){return Date.now()},t}(),u=new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.c(e,t),e}(function(t){function e(n,r){void 0===r&&(r=s.now);var i=t.call(this,n,function(){return e.delegate&&e.delegate!==i?e.delegate.now():r()})||this;return i.actions=[],i.active=!1,i.scheduled=void 0,i}return o.c(e,t),e.prototype.schedule=function(n,r,i){return void 0===r&&(r=0),e.delegate&&e.delegate!==this?e.delegate.schedule(n,r,i):t.prototype.schedule.call(this,n,r,i)},e.prototype.flush=function(t){var e=this.actions;if(this.active)e.push(t);else{var n;this.active=!0;do{if(n=t.execute(t.state,t.delay))break}while(t=e.shift());if(this.active=!1,n){for(;t=e.shift();)t.unsubscribe();throw n}}},e}(s)))(a),c=n("6blF"),l=(new r.p("angularfire2.realtimeDatabaseURL"),function(){function t(t,e){this.zone=t,this.platformId=e}return t.prototype.schedule=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return this.zone.runGuarded(function(){return u.schedule.apply(u,t)})},t.prototype.keepUnstableUntilFirst=function(t){return Object(i.q)(this.platformId)?new c.a(function(e){var n=function(){},r=Zone.current.scheduleMacroTask("firebaseZoneBlock",n,{},n,n);t.subscribe(function(t){"scheduled"===r.state&&r.invoke(),e.next(t)},function(t){"scheduled"===r.state&&r.invoke(),e.error(t)},function(){"scheduled"===r.state&&r.invoke(),e.complete()})}):t},t.prototype.runOutsideAngular=function(t){var e=this;return new c.a(function(n){return e.zone.runOutsideAngular(function(){return t.subscribe(function(t){return e.zone.run(function(){return n.next(t)})},function(t){return e.zone.run(function(){return n.error(t)})},function(){return e.zone.run(function(){return n.complete()})})})})},t}()),h=function(t){return function(e){return new c.a(function(n){return e.subscribe(function(e){return t.run(function(){return n.next(e)})},function(e){return t.run(function(){return n.error(e)})},function(){return t.run(function(){return n.complete()})})})}},f=n("Wcq6"),p=n.n(f),d=new r.p("angularfire2.app.options"),y=new r.p("angularfire2.app.nameOrConfig"),g=function(){return function(){}}();function m(t,e){var n="object"==typeof e&&e||{};return n.name=n.name||"string"==typeof e&&e||"[DEFAULT]",p.a.apps.filter(function(t){return t&&t.name===n.name})[0]||p.a.initializeApp(t,n)}new r.A;var v=function(){function t(){}var e;return e=t,t.initializeApp=function(t,n){return{ngModule:e,providers:[{provide:d,useValue:t},{provide:y,useValue:n}]}},t}();n.d(e,"e",function(){return l}),n.d(e,"g",function(){return h}),n.d(e,"d",function(){return d}),n.d(e,"c",function(){return y}),n.d(e,"b",function(){return g}),n.d(e,"f",function(){return m}),n.d(e,"a",function(){return v})},Oipj:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}(n("CB3U"))},PU8L:function(t,e,n){"use strict";n.d(e,"a",function(){return i});var r=n("6blF");function i(t){var e=new r.a(function(e){e.next(t),e.complete()});return e._isScalar=!0,e.value=t,e}},S1nX:function(t,e,n){"use strict";var r=n("mrSG"),i=n("K9Ia"),o=n("6blF"),a=n("FFOo"),s=n("pugT");function u(){return function(t){return t.lift(new c(t))}}var c=function(){function t(t){this.connectable=t}return t.prototype.call=function(t,e){var n=this.connectable;n._refCount++;var r=new l(t,n),i=e.subscribe(r);return r.closed||(r.connection=n.connect()),i},t}(),l=function(t){function e(e,n){var r=t.call(this,e)||this;return r.connectable=n,r}return r.c(e,t),e.prototype._unsubscribe=function(){var t=this.connectable;if(t){this.connectable=null;var e=t._refCount;if(e<=0)this.connection=null;else if(t._refCount=e-1,e>1)this.connection=null;else{var n=this.connection,r=t._connection;this.connection=null,!r||n&&r!==n||r.unsubscribe()}}else this.connection=null},e}(a.a),h=function(t){function e(e,n){var r=t.call(this)||this;return r.source=e,r.subjectFactory=n,r._refCount=0,r._isComplete=!1,r}return r.c(e,t),e.prototype._subscribe=function(t){return this.getSubject().subscribe(t)},e.prototype.getSubject=function(){var t=this._subject;return t&&!t.isStopped||(this._subject=this.subjectFactory()),this._subject},e.prototype.connect=function(){var t=this._connection;return t||(this._isComplete=!1,(t=this._connection=new s.a).add(this.source.subscribe(new p(this.getSubject(),this))),t.closed?(this._connection=null,t=s.a.EMPTY):this._connection=t),t},e.prototype.refCount=function(){return u()(this)},e}(o.a).prototype,f={operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:h._subscribe},_isComplete:{value:h._isComplete,writable:!0},getSubject:{value:h.getSubject},connect:{value:h.connect},refCount:{value:h.refCount}},p=function(t){function e(e,n){var r=t.call(this,e)||this;return r.connectable=n,r}return r.c(e,t),e.prototype._error=function(e){this._unsubscribe(),t.prototype._error.call(this,e)},e.prototype._complete=function(){this.connectable._isComplete=!0,this._unsubscribe(),t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){var t=this.connectable;if(t){this.connectable=null;var e=t._connection;t._refCount=0,t._subject=null,t._connection=null,e&&e.unsubscribe()}},e}(i.b);function d(){return new i.a}function y(){return function(t){return u()((e=d,function(t){var n;n="function"==typeof e?e:function(){return e};var r=Object.create(t,f);return r.source=t,r.subjectFactory=n,r})(t));var e}}n.d(e,"a",function(){return y})},S5XQ:function(t,e,n){"use strict";n.d(e,"a",function(){return i});var r=n("DKTb"),i=function(t){return function(e){return t.then(function(t){e.closed||(e.next(t),e.complete())},function(t){return e.error(t)}).then(null,r.a),e}}},Uv6z: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};l.prototype.append=function(t,e){t=s(t),e=u(e);var n=this.map[t];this.map[t]=n?n+","+e:e},l.prototype.delete=function(t){delete this.map[s(t)]},l.prototype.get=function(t){return t=s(t),this.has(t)?this.map[t]:null},l.prototype.has=function(t){return this.map.hasOwnProperty(s(t))},l.prototype.set=function(t,e){this.map[s(t)]=u(e)},l.prototype.forEach=function(t,e){for(var n in this.map)this.map.hasOwnProperty(n)&&t.call(e,this.map[n],n,this)},l.prototype.keys=function(){var t=[];return this.forEach(function(e,n){t.push(n)}),c(t)},l.prototype.values=function(){var t=[];return this.forEach(function(e){t.push(e)}),c(t)},l.prototype.entries=function(){var t=[];return this.forEach(function(e,n){t.push([n,e])}),c(t)},e.iterable&&(l.prototype[Symbol.iterator]=l.prototype.entries);var o=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];g.prototype.clone=function(){return new g(this,{body:this._bodyInit})},y.call(g.prototype),y.call(v.prototype),v.prototype.clone=function(){return new v(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new l(this.headers),url:this.url})},v.error=function(){var t=new v(null,{status:0,statusText:""});return t.type="error",t};var a=[301,302,303,307,308];v.redirect=function(t,e){if(-1===a.indexOf(e))throw new RangeError("Invalid status code");return new v(null,{status:e,headers:{location:t}})},t.Headers=l,t.Request=g,t.Response=v,t.fetch=function(t,n){return new Promise(function(r,i){var o=new g(t,n),a=new XMLHttpRequest;a.onload=function(){var t,e,n={status:a.status,statusText:a.statusText,headers:(t=a.getAllResponseHeaders()||"",e=new l,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"),r(new v("response"in a?a.response:a.responseText,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(void 0===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 l(t){this.map={},t instanceof l?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 h(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=h(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?h(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(p)}),this.text=function(){var t,e,n,r=h(this);if(r)return r;if(this._bodyBlob)return t=this._bodyBlob,n=f(e=new FileReader),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(m)}),this.json=function(){return this.text().then(JSON.parse)},this}function g(t,e){var n,r,i=(e=e||{}).body;if(t instanceof g){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new l(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 l(e.headers)),this.method=(r=(n=e.method||this.method||"GET").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 m(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 v(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 l(e.headers),this.url=e.url||"",this._initBody(t)}}("undefined"!=typeof self?self:this)},"VnD/":function(t,e,n){"use strict";n.d(e,"a",function(){return o});var r=n("mrSG"),i=n("FFOo");function o(t,e){return function(n){return n.lift(new a(t,e))}}var a=function(){function t(t,e){this.predicate=t,this.thisArg=e}return t.prototype.call=function(t,e){return e.subscribe(new s(t,this.predicate,this.thisArg))},t}(),s=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.predicate=n,i.thisArg=r,i.count=0,i}return r.c(e,t),e.prototype._next=function(t){var e;try{e=this.predicate.call(this.thisArg,t,this.count++)}catch(n){return void this.destination.error(n)}e&&this.destination.next(t)},e}(i.a)},Wcq6:function(t,e,n){"use strict";n("lcbw");var r,i=(r=n("wj3C"))&&"object"==typeof r&&"default"in r?r.default:r;t.exports=i},Zn8D:function(t,e,n){"use strict";n.d(e,"a",function(){return o});var r=n("psW0"),i=n("mChF");function o(t){return void 0===t&&(t=Number.POSITIVE_INFINITY),Object(r.a)(i.a,t)}},crnd:function(t,e){function n(t){return Promise.resolve().then(function(){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e})}n.keys=function(){return[]},n.resolve=n,t.exports=n,n.id="crnd"},dC0D:function(t,e,n){"use strict";n.d(e,"a",function(){return o});var r=n("mrSG"),i=n("FFOo");function o(t,e){var n=!1;return arguments.length>=2&&(n=!0),function(r){return r.lift(new a(t,e,n))}}var a=function(){function t(t,e,n){void 0===n&&(n=!1),this.accumulator=t,this.seed=e,this.hasSeed=n}return t.prototype.call=function(t,e){return e.subscribe(new s(t,this.accumulator,this.seed,this.hasSeed))},t}(),s=function(t){function e(e,n,r,i){var o=t.call(this,e)||this;return o.accumulator=n,o._seed=r,o.hasSeed=i,o.index=0,o}return r.c(e,t),Object.defineProperty(e.prototype,"seed",{get:function(){return this._seed},set:function(t){this.hasSeed=!0,this._seed=t},enumerable:!0,configurable:!0}),e.prototype._next=function(t){if(this.hasSeed)return this._tryNext(t);this.seed=t,this.destination.next(t)},e.prototype._tryNext=function(t){var e,n=this.index++;try{e=this.accumulator(this.seed,t,n)}catch(r){this.destination.error(r)}this.seed=e,this.destination.next(e)},e}(i.a)},iLxQ:function(t,e,n){"use strict";n.d(e,"a",function(){return i});var r=!1,i={Promise:void 0,set useDeprecatedSynchronousErrorHandling(t){r=t},get useDeprecatedSynchronousErrorHandling(){return r}}},isby:function(t,e,n){"use strict";n.d(e,"a",function(){return r});var r=Array.isArray||function(t){return t&&"number"==typeof t.length}},lcbw:function(t,e,n){"use strict";n.r(e),n("Uv6z");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=[],h(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"==typeof e||"function"==typeof e)){var n=e.then;if(e instanceof o)return t._state=3,t._value=e,void c(t);if("function"==typeof n)return void h((r=n,i=e,function(){r.apply(i,arguments)}),t)}t._state=1,t._value=e,c(t)}catch(a){u(t,a)}var r,i}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 l(t,e,n){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=n}function h(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 l(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,n){if(!t||void 0===t.length)throw new TypeError("Promise.all accepts an array");var r=Array.prototype.slice.call(t);if(0===r.length)return e([]);var i=r.length;function o(t,a){try{if(a&&("object"==typeof a||"function"==typeof a)){var s=a.then;if("function"==typeof s)return void s.call(a,function(e){o(t,e)},n)}r[t]=a,0==--i&&e(r)}catch(u){n(u)}}for(var a=0;a<r.length;a++)o(a,r[a])})},o.resolve=function(t){return t&&"object"==typeof 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 setImmediate&&function(t){setImmediate(t)}||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 global)return global;throw new Error("unable to locate global object")}();function p(t,e){return t(e={exports:{}},e.exports),e.exports}f.Promise||(f.Promise=o);var d=p(function(t){var e=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=e)}),y=p(function(t){var e=t.exports={version:"2.5.5"};"number"==typeof __e&&(__e=e)}),g=function(t){return"object"==typeof t?null!==t:"function"==typeof t},m=function(t){if(!g(t))throw TypeError(t+" is not an object!");return t},v=function(t){try{return!!t()}catch(e){return!0}},b=!v(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),w=d.document,_=g(w)&&g(w.createElement),S=function(t){return _?w.createElement(t):{}},E=!b&&!v(function(){return 7!=Object.defineProperty(S("div"),"a",{get:function(){return 7}}).a}),T=function(t,e){if(!g(t))return t;var n,r;if(e&&"function"==typeof(n=t.toString)&&!g(r=n.call(t)))return r;if("function"==typeof(n=t.valueOf)&&!g(r=n.call(t)))return r;if(!e&&"function"==typeof(n=t.toString)&&!g(r=n.call(t)))return r;throw TypeError("Can't convert object to primitive value")},C=Object.defineProperty,I={f:b?Object.defineProperty:function(t,e,n){if(m(t),e=T(e,!0),m(n),E)try{return C(t,e,n)}catch(r){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},A=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},O=b?function(t,e,n){return I.f(t,e,A(1,n))}:function(t,e,n){return t[e]=n,t},D={}.hasOwnProperty,k=function(t,e){return D.call(t,e)},N=0,P=Math.random(),R=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++N+P).toString(36))},x=p(function(t){var e=R("src"),n=Function.toString,r=(""+n).split("toString");y.inspectSource=function(t){return n.call(t)},(t.exports=function(t,n,i,o){var a="function"==typeof i;a&&(k(i,"name")||O(i,"name",n)),t[n]!==i&&(a&&(k(i,e)||O(i,e,t[n]?""+t[n]:r.join(String(n)))),t===d?t[n]=i:o?t[n]?t[n]=i:O(t,n,i):(delete t[n],O(t,n,i)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[e]||n.call(this)})}),M=function(t,e,n){if(function(e){if("function"!=typeof t)throw TypeError(t+" is not a function!")}(),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)}},j=function(t,e,n){var r,i,o,a,s=t&j.F,u=t&j.G,c=t&j.P,l=t&j.B,h=u?d:t&j.S?d[e]||(d[e]={}):(d[e]||{}).prototype,f=u?y:y[e]||(y[e]={}),p=f.prototype||(f.prototype={});for(r in u&&(n=e),n)o=((i=!s&&h&&void 0!==h[r])?h:n)[r],a=l&&i?M(o,d):c&&"function"==typeof o?M(Function.call,o):o,h&&x(h,r,o,t&j.U),f[r]!=o&&O(f,r,a),c&&p[r]!=o&&(p[r]=o)};d.core=y,j.F=1,j.G=2,j.S=4,j.P=8,j.B=16,j.W=32,j.U=64,j.R=128;var L=j,U={}.toString,V=function(t){return U.call(t).slice(8,-1)},F=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==V(t)?t.split(""):Object(t)},q=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},B=function(t){return Object(q(t))},H=Math.ceil,z=Math.floor,W=function(t){return isNaN(t=+t)?0:(t>0?z:H)(t)},K=Math.min,G=function(t){return t>0?K(W(t),9007199254740991):0},Q=Array.isArray||function(t){return"Array"==V(t)},X=d["__core-js_shared__"]||(d["__core-js_shared__"]={}),Y=function(t){return X[t]||(X[t]={})},J=p(function(t){var e=Y("wks"),n=d.Symbol,r="function"==typeof n;(t.exports=function(t){return e[t]||(e[t]=r&&n[t]||(r?n:R)("Symbol."+t))}).store=e}),Z=J("species"),$=function(t,e){return new(function(t){var e;return Q(t)&&("function"!=typeof(e=t.constructor)||e!==Array&&!Q(e.prototype)||(e=void 0),g(e)&&null===(e=e[Z])&&(e=void 0)),void 0===e?Array:e}(t))(e)},tt=function(t,e){var n=1==t,r=2==t,i=3==t,o=4==t,a=6==t,s=5==t||a,u=e||$;return function(e,c,l){for(var h,f,p=B(e),d=F(p),y=M(c,l,3),g=G(d.length),m=0,v=n?u(e,g):r?u(e,0):void 0;g>m;m++)if((s||m in d)&&(f=y(h=d[m],m,p),t))if(n)v[m]=f;else if(f)switch(t){case 3:return!0;case 5:return h;case 6:return m;case 2:v.push(h)}else if(o)return!1;return a?-1:i||o?o:v}},et=J("unscopables"),nt=Array.prototype;null==nt[et]&&O(nt,et,{});var rt=function(t){nt[et][t]=!0},it=tt(5),ot=!0;"find"in[]&&Array(1).find(function(){ot=!1}),L(L.P+L.F*ot,"Array",{find:function(t){return it(this,t,arguments.length>1?arguments[1]:void 0)}}),rt("find");var at=tt(6),st=!0;"findIndex"in[]&&Array(1).findIndex(function(){st=!1}),L(L.P+L.F*st,"Array",{findIndex:function(t){return at(this,t,arguments.length>1?arguments[1]:void 0)}}),rt("findIndex");var ut=function(t){return F(q(t))},ct=Math.max,lt=Math.min,ht=Y("keys"),ft=function(t){return ht[t]||(ht[t]=R(t))},pt=function(t,e,n){for(var r=ut(t),i=G(r.length),o=function(t,e){return(t=W(t))<0?ct(t+e,0):lt(t,e)}(n,i);i>o;o++)if(o in r&&r[o]===e)return o||0;return-1},dt=ft("IE_PROTO"),yt=function(t,e){var n,r=ut(t),i=0,o=[];for(n in r)n!=dt&&k(r,n)&&o.push(n);for(;e.length>i;)k(r,n=e[i++])&&(~pt(o,n)||o.push(n));return o},gt="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","),mt=Object.keys||function(t){return yt(t,gt)},vt={f:Object.getOwnPropertySymbols},bt={f:{}.propertyIsEnumerable},wt=Object.assign,_t=!wt||v(function(){var t={},e={},n=Symbol(),r="abcdefghijklmnopqrst";return t[n]=7,r.split("").forEach(function(t){e[t]=t}),7!=wt({},t)[n]||Object.keys(wt({},e)).join("")!=r})?function(t,e){for(var n=B(t),r=arguments.length,i=1,o=vt.f,a=bt.f;r>i;)for(var s,u=F(arguments[i++]),c=o?mt(u).concat(o(u)):mt(u),l=c.length,h=0;l>h;)a.call(u,s=c[h++])&&(n[s]=u[s]);return n}:wt;L(L.S+L.F,"Object",{assign:_t});var St=J("match"),Et=J("match"),Tt="".startsWith;L(L.P+L.F*function(t){var e=/./;try{"/./"[t](e)}catch(n){try{return e[Et]=!1,!"/./"[t](e)}catch(r){}}return!0}("startsWith"),"String",{startsWith:function(t){var e=function(t,e,n){if(g(r=e)&&(void 0!==(i=r[St])?i:"RegExp"==V(r)))throw TypeError("String#startsWith doesn't accept regex!");var r,i;return String(q(t))}(this,t),n=G(Math.min(arguments.length>1?arguments[1]:void 0,e.length)),r=String(t);return Tt?Tt.call(e,r,n):e.slice(n,n+r.length)===r}}),L(L.P,"String",{repeat:function(t){var e=String(q(this)),n="",r=W(t);if(r<0||r==1/0)throw RangeError("Count can't be negative");for(;r>0;(r>>>=1)&&(e+=e))1&r&&(n+=e);return n}});var Ct=p(function(t){var e=R("meta"),n=I.f,r=0,i=Object.isExtensible||function(){return!0},o=!v(function(){return i(Object.preventExtensions({}))}),a=function(t){n(t,e,{value:{i:"O"+ ++r,w:{}}})},s=t.exports={KEY:e,NEED:!1,fastKey:function(t,n){if(!g(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!k(t,e)){if(!i(t))return"F";if(!n)return"E";a(t)}return t[e].i},getWeak:function(t,n){if(!k(t,e)){if(!i(t))return!0;if(!n)return!1;a(t)}return t[e].w},onFreeze:function(t){return o&&s.NEED&&i(t)&&!k(t,e)&&a(t),t}}}),It=I.f,At=J("toStringTag"),Ot=function(t,e,n){t&&!k(t=n?t:t.prototype,At)&&It(t,At,{configurable:!0,value:e})},Dt={f:J},kt=I.f,Nt=function(t){var e=y.Symbol||(y.Symbol=d.Symbol||{});"_"==t.charAt(0)||t in e||kt(e,t,{value:Dt.f(t)})},Pt=b?Object.defineProperties:function(t,e){m(t);for(var n,r=mt(e),i=r.length,o=0;i>o;)I.f(t,n=r[o++],e[n]);return t},Rt=d.document,xt=Rt&&Rt.documentElement,Mt=ft("IE_PROTO"),jt=function(){},Lt=function(){var t,e=S("iframe"),n=gt.length;for(e.style.display="none",xt.appendChild(e),e.src="javascript:",(t=e.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),Lt=t.F;n--;)delete Lt.prototype[gt[n]];return Lt()},Ut=Object.create||function(t,e){var n;return null!==t?(jt.prototype=m(t),n=new jt,jt.prototype=null,n[Mt]=t):n=Lt(),void 0===e?n:Pt(n,e)},Vt=gt.concat("length","prototype"),Ft={f:Object.getOwnPropertyNames||function(t){return yt(t,Vt)}},qt=Ft.f,Bt={}.toString,Ht="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],zt={f:function(t){return Ht&&"[object Window]"==Bt.call(t)?function(t){try{return qt(t)}catch(e){return Ht.slice()}}(t):qt(ut(t))}},Wt=Object.getOwnPropertyDescriptor,Kt={f:b?Wt:function(t,e){if(t=ut(t),e=T(e,!0),E)try{return Wt(t,e)}catch(n){}if(k(t,e))return A(!bt.f.call(t,e),t[e])}},Gt=Ct.KEY,Qt=Kt.f,Xt=I.f,Yt=zt.f,Jt=d.Symbol,Zt=d.JSON,$t=Zt&&Zt.stringify,te=J("_hidden"),ee=J("toPrimitive"),ne={}.propertyIsEnumerable,re=Y("symbol-registry"),ie=Y("symbols"),oe=Y("op-symbols"),ae=Object.prototype,se="function"==typeof Jt,ue=d.QObject,ce=!ue||!ue.prototype||!ue.prototype.findChild,le=b&&v(function(){return 7!=Ut(Xt({},"a",{get:function(){return Xt(this,"a",{value:7}).a}})).a})?function(t,e,n){var r=Qt(ae,e);r&&delete ae[e],Xt(t,e,n),r&&t!==ae&&Xt(ae,e,r)}:Xt,he=function(t){var e=ie[t]=Ut(Jt.prototype);return e._k=t,e},fe=se&&"symbol"==typeof Jt.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof Jt},pe=function(t,e,n){return t===ae&&pe(oe,e,n),m(t),e=T(e,!0),m(n),k(ie,e)?(n.enumerable?(k(t,te)&&t[te][e]&&(t[te][e]=!1),n=Ut(n,{enumerable:A(0,!1)})):(k(t,te)||Xt(t,te,A(1,{})),t[te][e]=!0),le(t,e,n)):Xt(t,e,n)},de=function(t,e){m(t);for(var n,r=function(t){var e=mt(t),n=vt.f;if(n)for(var r,i=n(t),o=bt.f,a=0;i.length>a;)o.call(t,r=i[a++])&&e.push(r);return e}(e=ut(e)),i=0,o=r.length;o>i;)pe(t,n=r[i++],e[n]);return t},ye=function(t){var e=ne.call(this,t=T(t,!0));return!(this===ae&&k(ie,t)&&!k(oe,t))&&(!(e||!k(this,t)||!k(ie,t)||k(this,te)&&this[te][t])||e)},ge=function(t,e){if(t=ut(t),e=T(e,!0),t!==ae||!k(ie,e)||k(oe,e)){var n=Qt(t,e);return!n||!k(ie,e)||k(t,te)&&t[te][e]||(n.enumerable=!0),n}},me=function(t){for(var e,n=Yt(ut(t)),r=[],i=0;n.length>i;)k(ie,e=n[i++])||e==te||e==Gt||r.push(e);return r},ve=function(t){for(var e,n=t===ae,r=Yt(n?oe:ut(t)),i=[],o=0;r.length>o;)!k(ie,e=r[o++])||n&&!k(ae,e)||i.push(ie[e]);return i};se||(x((Jt=function(){if(this instanceof Jt)throw TypeError("Symbol is not a constructor!");var t=R(arguments.length>0?arguments[0]:void 0),e=function(n){this===ae&&e.call(oe,n),k(this,te)&&k(this[te],t)&&(this[te][t]=!1),le(this,t,A(1,n))};return b&&ce&&le(ae,t,{configurable:!0,set:e}),he(t)}).prototype,"toString",function(){return this._k}),Kt.f=ge,I.f=pe,Ft.f=zt.f=me,bt.f=ye,vt.f=ve,b&&x(ae,"propertyIsEnumerable",ye,!0),Dt.f=function(t){return he(J(t))}),L(L.G+L.W+L.F*!se,{Symbol:Jt});for(var be="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),we=0;be.length>we;)J(be[we++]);for(var _e=mt(J.store),Se=0;_e.length>Se;)Nt(_e[Se++]);L(L.S+L.F*!se,"Symbol",{for:function(t){return k(re,t+="")?re[t]:re[t]=Jt(t)},keyFor:function(t){if(!fe(t))throw TypeError(t+" is not a symbol!");for(var e in re)if(re[e]===t)return e},useSetter:function(){ce=!0},useSimple:function(){ce=!1}}),L(L.S+L.F*!se,"Object",{create:function(t,e){return void 0===e?Ut(t):de(Ut(t),e)},defineProperty:pe,defineProperties:de,getOwnPropertyDescriptor:ge,getOwnPropertyNames:me,getOwnPropertySymbols:ve}),Zt&&L(L.S+L.F*(!se||v(function(){var t=Jt();return"[null]"!=$t([t])||"{}"!=$t({a:t})||"{}"!=$t(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],(g(e)||void 0!==t)&&!fe(t))return Q(e)||(e=function(t,e){if("function"==typeof n&&(e=n.call(this,t,e)),!fe(e))return e}),r[1]=e,$t.apply(Zt,r)}}),Jt.prototype[ee]||O(Jt.prototype,ee,Jt.prototype.valueOf),Ot(Jt,"Symbol"),Ot(Math,"Math",!0),Ot(d.JSON,"JSON",!0);var Ee=J("toStringTag"),Te="Arguments"==V(function(){return arguments}()),Ce={};Ce[J("toStringTag")]="z",Ce+""!="[object z]"&&x(Object.prototype,"toString",function(){return"[object "+(void 0===this?"Undefined":null===this?"Null":"string"==typeof(e=function(t,e){try{return t[e]}catch(n){}}(t=Object(this),Ee))?e:Te?V(t):"Object"==(n=V(t))&&"function"==typeof t.callee?"Arguments":n)+"]";var t,e,n},!0),Nt("asyncIterator"),Nt("observable");var Ie={},Ae={};O(Ae,J("iterator"),function(){return this});var Oe=function(t,e,n){t.prototype=Ut(Ae,{next:A(1,n)}),Ot(t,e+" Iterator")},De=ft("IE_PROTO"),ke=Object.prototype,Ne=Object.getPrototypeOf||function(t){return t=B(t),k(t,De)?t[De]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?ke:null},Pe=J("iterator"),Re=!([].keys&&"next"in[].keys()),xe=function(){return this},Me=function(t,e,n,r,i,o,a){Oe(n,e,r);var s,u,c,l=function(t){if(!Re&&t in d)return d[t];switch(t){case"keys":case"values":return function(){return new n(this,t)}}return function(){return new n(this,t)}},h=e+" Iterator",f="values"==i,p=!1,d=t.prototype,y=d[Pe]||d["@@iterator"]||i&&d[i],g=y||l(i),m=i?f?l("entries"):g:void 0,v="Array"==e&&d.entries||y;if(v&&(c=Ne(v.call(new t)))!==Object.prototype&&c.next&&(Ot(c,h,!0),"function"!=typeof c[Pe]&&O(c,Pe,xe)),f&&y&&"values"!==y.name&&(p=!0,g=function(){return y.call(this)}),(Re||p||!d[Pe])&&O(d,Pe,g),Ie[e]=g,Ie[h]=xe,i)if(s={values:f?g:l("values"),keys:o?g:l("keys"),entries:m},a)for(u in s)u in d||x(d,u,s[u]);else L(L.P+L.F*(Re||p),e,s);return s},je=function(t,e){var n,r,i=String(q(t)),o=W(e),a=i.length;return o<0||o>=a?"":(n=i.charCodeAt(o))<55296||n>56319||o+1===a||(r=i.charCodeAt(o+1))<56320||r>57343?i.charAt(o):i.slice(o,o+2)};Me(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=je(e,n),this._i+=t.length,{value:t,done:!1})});var Le=function(t,e){return{value:e,done:!!t}},Ue=Me(Array,"Array",function(t,e){this._t=ut(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,Le(1)):Le(0,"keys"==e?n:"values"==e?t[n]:[n,t[n]])},"values");Ie.Arguments=Ie.Array,rt("keys"),rt("values"),rt("entries");for(var Ve=J("iterator"),Fe=J("toStringTag"),qe=Ie.Array,Be={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},He=mt(Be),ze=0;ze<He.length;ze++){var We,Ke=He[ze],Ge=Be[Ke],Qe=d[Ke],Xe=Qe&&Qe.prototype;if(Xe&&(Xe[Ve]||O(Xe,Ve,qe),Xe[Fe]||O(Xe,Fe,Ke),Ie[Ke]=qe,Ge))for(We in Ue)Xe[We]||x(Xe,We,Ue[We],!0)}Dt.f("iterator")},mChF:function(t,e,n){"use strict";function r(t){return t}n.d(e,"a",function(){return r})},mrSG:function(t,e,n){"use strict";n.d(e,"c",function(){return i}),n.d(e,"a",function(){return o}),n.d(e,"b",function(){return a}),n.d(e,"e",function(){return s}),n.d(e,"d",function(){return u}),n.d(e,"h",function(){return c}),n.d(e,"f",function(){return l}),n.d(e,"g",function(){return h});var r=function(t,e){return(r=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])})(t,e)};function i(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var o=function(){return(o=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}).apply(this,arguments)};function a(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a}function s(t,e){return function(n,r){e(n,r,t)}}function u(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function c(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 l(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 h(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(l(arguments[e]));return t}},nkY7:function(t,e,n){"use strict";function r(t){return t&&"function"==typeof t.schedule}n.d(e,"a",function(){return r})},os0x:function(t,e,n){"use strict";n.r(e),n.d(e,"__extends",function(){return i}),n.d(e,"__assign",function(){return o}),n.d(e,"__rest",function(){return a}),n.d(e,"__decorate",function(){return s}),n.d(e,"__param",function(){return u}),n.d(e,"__metadata",function(){return c}),n.d(e,"__awaiter",function(){return l}),n.d(e,"__generator",function(){return h}),n.d(e,"__exportStar",function(){return f}),n.d(e,"__values",function(){return p}),n.d(e,"__read",function(){return d}),n.d(e,"__spread",function(){return y}),n.d(e,"__await",function(){return g}),n.d(e,"__asyncGenerator",function(){return m}),n.d(e,"__asyncDelegator",function(){return v}),n.d(e,"__asyncValues",function(){return b}),n.d(e,"__makeTemplateObject",function(){return w}),n.d(e,"__importStar",function(){return _}),n.d(e,"__importDefault",function(){return S});var r=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 i(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var o=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 a(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 s(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a}function u(t,e){return function(n,r){e(n,r,t)}}function c(t,e){if("object"==typeof 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 h(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 f(t,e){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}function p(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 d(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 y(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(d(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):l(o[0][2],n)}catch(r){l(o[0][3],r)}var n}function u(t){s("next",t)}function c(t){s("throw",t)}function l(t,e){t(e),o.shift(),o.length&&s(o[0][0],o[0][1])}}function v(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):p(t)}function w(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function _(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}}},psW0:function(t,e,n){"use strict";n.d(e,"a",function(){return c});var r=n("mrSG"),i=n("zotm"),o=n("MGBS"),a=n("rPjj"),s=n("67Y/"),u=n("0/uQ");function c(t,e,n){return void 0===n&&(n=Number.POSITIVE_INFINITY),"function"==typeof e?function(r){return r.pipe(c(function(n,r){return Object(u.a)(t(n,r)).pipe(Object(s.a)(function(t,i){return e(n,t,r,i)}))},n))}:("number"==typeof e&&(n=e),function(e){return e.lift(new l(t,n))})}var l=function(){function t(t,e){void 0===e&&(e=Number.POSITIVE_INFINITY),this.project=t,this.concurrent=e}return t.prototype.call=function(t,e){return e.subscribe(new h(t,this.project,this.concurrent))},t}(),h=function(t){function e(e,n,r){void 0===r&&(r=Number.POSITIVE_INFINITY);var i=t.call(this,e)||this;return i.project=n,i.concurrent=r,i.hasCompleted=!1,i.buffer=[],i.active=0,i.index=0,i}return r.c(e,t),e.prototype._next=function(t){this.active<this.concurrent?this._tryNext(t):this.buffer.push(t)},e.prototype._tryNext=function(t){var e,n=this.index++;try{e=this.project(t,n)}catch(r){return void this.destination.error(r)}this.active++,this._innerSub(e,t,n)},e.prototype._innerSub=function(t,e,n){var r=new a.a(this,void 0,void 0);this.destination.add(r),Object(i.a)(this,t,e,n,r)},e.prototype._complete=function(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&this.destination.complete(),this.unsubscribe()},e.prototype.notifyNext=function(t,e,n,r,i){this.destination.next(e)},e.prototype.notifyComplete=function(t){var e=this.buffer;this.remove(t),this.active--,e.length>0?this._next(e.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},e}(o.a)},pugT:function(t,e,n){"use strict";var r,i=n("isby"),o=n("McSo"),a=n("2Bdj"),s={e:{}};function u(){try{return r.apply(this,arguments)}catch(t){return s.e=t,s}}function c(t){return r=t,u}function l(t){return Error.call(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map(function(t,e){return e+1+") "+t.toString()}).join("\n "):"",this.name="UnsubscriptionError",this.errors=t,this}l.prototype=Object.create(Error.prototype);var h=l;n.d(e,"a",function(){return f});var f=function(){function t(t){this.closed=!1,this._parent=null,this._parents=null,this._subscriptions=null,t&&(this._unsubscribe=t)}var e;return t.prototype.unsubscribe=function(){var t,e=!1;if(!this.closed){var n=this._parent,r=this._parents,u=this._unsubscribe,l=this._subscriptions;this.closed=!0,this._parent=null,this._parents=null,this._subscriptions=null;for(var f=-1,d=r?r.length:0;n;)n.remove(this),n=++f<d&&r[f]||null;if(Object(a.a)(u)&&c(u).call(this)===s&&(e=!0,t=t||(s.e instanceof h?p(s.e.errors):[s.e])),Object(i.a)(l))for(f=-1,d=l.length;++f<d;){var y=l[f];if(Object(o.a)(y)&&c(y.unsubscribe).call(y)===s){e=!0,t=t||[];var g=s.e;g instanceof h?t=t.concat(p(g.errors)):t.push(g)}}if(e)throw new h(t)}},t.prototype.add=function(e){if(!e||e===t.EMPTY)return t.EMPTY;if(e===this)return this;var n=e;switch(typeof e){case"function":n=new t(e);case"object":if(n.closed||"function"!=typeof n.unsubscribe)return n;if(this.closed)return n.unsubscribe(),n;if("function"!=typeof n._addParent){var r=n;(n=new t)._subscriptions=[r]}break;default:throw new Error("unrecognized teardown "+e+" added to Subscription.")}return(this._subscriptions||(this._subscriptions=[])).push(n),n._addParent(this),n},t.prototype.remove=function(t){var e=this._subscriptions;if(e){var n=e.indexOf(t);-1!==n&&e.splice(n,1)}},t.prototype._addParent=function(t){var e=this._parent,n=this._parents;e&&e!==t?n?-1===n.indexOf(t)&&n.push(t):this._parents=[t]:this._parent=t},t.EMPTY=((e=new t).closed=!0,e),t}();function p(t){return t.reduce(function(t,e){return t.concat(e instanceof h?e.errors:e)},[])}},"q/0M":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 i});var r=[],i=function(t){return 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",t}({}),o=i.INFO,a=function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];if(!(e<t.logLevel)){var o=(new Date).toISOString();switch(e){case i.DEBUG:case i.VERBOSE:console.log.apply(console,["["+o+"] "+t.name+":"].concat(n));break;case i.INFO:console.info.apply(console,["["+o+"] "+t.name+":"].concat(n));break;case i.WARN:console.warn.apply(console,["["+o+"] "+t.name+":"].concat(n));break;case i.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,r.push(this)}return Object.defineProperty(t.prototype,"logLevel",{get:function(){return this._logLevel},set:function(t){if(!(t in i))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,i.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,i.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,i.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,i.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,i.ERROR].concat(t))},t}();function u(t){r.forEach(function(e){e.logLevel=t})}},rPjj:function(t,e,n){"use strict";n.d(e,"a",function(){return i});var r=n("mrSG"),i=function(t){function e(e,n,r){var i=t.call(this)||this;return i.parent=e,i.outerValue=n,i.outerIndex=r,i.index=0,i}return r.c(e,t),e.prototype._next=function(t){this.parent.notifyNext(this.outerValue,t,this.outerIndex,this.index++,this)},e.prototype._error=function(t){this.parent.notifyError(t,this),this.unsubscribe()},e.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},e}(n("FFOo").a)},tct4:function(t,e,n){"use strict";n.r(e),n("mrSG");var r=n("CcnG"),i=n("0/uQ"),o=n("F/XL"),a=n("6blF"),s=n("S1nX"),u=n("67Y/");function c(t){return function(t){return new a.a(function(e){return{unsubscribe:t.onSnapshot(e)}})}(t).pipe(Object(s.a)())}function l(t){return c(t).pipe(Object(u.a)(function(t){return{payload:t,type:"value"}}))}function h(t){return c(t).pipe(Object(u.a)(function(t){return{payload:t,type:"query"}}))}var f=n("VnD/"),p=n("dC0D");function d(t){return h(t).pipe(Object(u.a)(function(t){return t.payload.docChanges().map(function(t){return{type:t.type,payload:t}})}))}function y(t,e){return h(t).pipe(Object(u.a)(function(t){return t.payload.docChanges()}),Object(p.a)(function(t,n){return g(t,n,e)},[]),Object(u.a)(function(t){return t.map(function(t){return{type:t.type,payload:t}})}))}function g(t,e,n){return e.forEach(function(e){n.indexOf(e.type)>-1&&(t=m(t,e))}),t}function m(t,e){switch(e.type){case"added":t[e.newIndex]&&t[e.newIndex].doc.id==e.doc.id||t.splice(e.newIndex,0,e);break;case"modified":null!=t[e.oldIndex]&&t[e.oldIndex].doc.id!=e.doc.id||(e.oldIndex!==e.newIndex?(t.splice(e.oldIndex,1),t.splice(e.newIndex,0,e)):t.splice(e.newIndex,1,e));break;case"removed":t[e.oldIndex]&&t[e.oldIndex].doc.id==e.doc.id&&t.splice(e.oldIndex,1)}return t}var v=n("ORnb");function b(t){return t&&0!==t.length||(t=["added","removed","modified"]),t}var w=function(){function t(t,e,n){this.ref=t,this.query=e,this.afs=n}return t.prototype.stateChanges=function(t){return t&&0!==t.length?this.afs.scheduler.keepUnstableUntilFirst(this.afs.scheduler.runOutsideAngular(d(this.query))).pipe(Object(u.a)(function(e){return e.filter(function(e){return t.indexOf(e.type)>-1})}),Object(f.a)(function(t){return t.length>0})):this.afs.scheduler.keepUnstableUntilFirst(this.afs.scheduler.runOutsideAngular(d(this.query)))},t.prototype.auditTrail=function(t){return this.stateChanges(t).pipe(Object(p.a)(function(t,e){return t.concat(e)},[]))},t.prototype.snapshotChanges=function(t){var e=b(t),n=y(this.query,e),r=this.afs.scheduler.runOutsideAngular(n);return this.afs.scheduler.keepUnstableUntilFirst(r)},t.prototype.valueChanges=function(){var t=h(this.query),e=this.afs.scheduler.runOutsideAngular(t);return this.afs.scheduler.keepUnstableUntilFirst(e).pipe(Object(u.a)(function(t){return t.payload.docs.map(function(t){return t.data()})}))},t.prototype.get=function(t){return Object(i.a)(this.query.get(t)).pipe(Object(v.g)(this.afs.scheduler.zone))},t.prototype.add=function(t){return this.ref.add(t)},t.prototype.doc=function(t){return new _(this.ref.doc(t),this.afs)},t}(),_=function(){function t(t,e){this.ref=t,this.afs=e}return t.prototype.set=function(t,e){return this.ref.set(t,e)},t.prototype.update=function(t){return this.ref.update(t)},t.prototype.delete=function(){return this.ref.delete()},t.prototype.collection=function(t,e){var n=A(this.ref.collection(t),e);return new w(n.ref,n.query,this.afs)},t.prototype.snapshotChanges=function(){var t=l(this.ref),e=this.afs.scheduler.runOutsideAngular(t);return this.afs.scheduler.keepUnstableUntilFirst(e)},t.prototype.valueChanges=function(){return this.snapshotChanges().pipe(Object(u.a)(function(t){return t.payload.data()}))},t.prototype.get=function(t){return Object(i.a)(this.ref.get(t)).pipe(Object(v.g)(this.afs.scheduler.zone))},t}(),S=n("Ip0R"),E=new r.p("angularfire2.enableFirestorePersistence"),T=new r.p("angularfire2.firestore.persistenceSettings"),C=new r.p("angularfire2.firestore.settings"),I={timestampsInSnapshots:!0};function A(t,e){return void 0===e&&(e=function(t){return t}),{query:e(t),ref:t}}var O=function(){function t(t,e,n,r,a,s,u){var c=this;this.scheduler=new v.e(s,a),this.firestore=s.runOutsideAngular(function(){var n=Object(v.f)(t,e).firestore();return n.settings(r||I),n}),this.persistenceEnabled$=n&&Object(S.p)(a)?s.runOutsideAngular(function(){try{return Object(i.a)(c.firestore.enablePersistence(u||void 0).then(function(){return!0},function(){return!1}))}catch(t){return Object(o.a)(!1)}}):Object(o.a)(!1)}return t.prototype.collection=function(t,e){var n=A("string"==typeof t?this.firestore.collection(t):t,e);return new w(n.ref,n.query,this)},t.prototype.doc=function(t){var e;return e="string"==typeof t?this.firestore.doc(t):t,new _(e,this)},t.prototype.createId=function(){return this.firestore.collection("_").doc().id},t}(),D=(n("6Joi"),function(){function t(){}var e;return e=t,t.enablePersistence=function(t){return{ngModule:e,providers:[{provide:E,useValue:!0},{provide:T,useValue:t}]}},t}());n.d(e,"EnablePersistenceToken",function(){return E}),n.d(e,"PersistenceSettingsToken",function(){return T}),n.d(e,"FirestoreSettingsToken",function(){return C}),n.d(e,"DefaultFirestoreSettings",function(){return I}),n.d(e,"associateQuery",function(){return A}),n.d(e,"AngularFirestore",function(){return O}),n.d(e,"AngularFirestoreModule",function(){return D}),n.d(e,"validateEventsArray",function(){return b}),n.d(e,"AngularFirestoreCollection",function(){return w}),n.d(e,"AngularFirestoreDocument",function(){return _}),n.d(e,"docChanges",function(){return d}),n.d(e,"sortedChanges",function(){return y}),n.d(e,"combineChanges",function(){return g}),n.d(e,"combineChange",function(){return m}),n.d(e,"fromRef",function(){return c}),n.d(e,"fromDocRef",function(){return l}),n.d(e,"fromCollectionRef",function(){return h})},u67D:function(t,e,n){"use strict";n.d(e,"a",function(){return i});var r=n("En8+"),i=function(t){return function(e){for(var n=t[r.a]();;){var i=n.next();if(i.done){e.complete();break}if(e.next(i.value),e.closed)break}return"function"==typeof n.return&&e.add(function(){n.return&&n.return()}),e}}},wj3C:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n("zVF4"),i=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o="[DEFAULT]",a=[],s=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_=r.deepCopy(t),this.INTERNAL={getUid:function(){return null},getToken:function(){return Promise.resolve(null)},addAuthTokenListener:function(t){a.push(t),setTimeout(function(){return t(null)},0)},removeAuthTokenListener:function(t){a=a.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=o),this.checkDestroyed_(),this.services_[t]||(this.services_[t]={}),!this.services_[t][e]){var n=e!==o?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;r.deepExtend(this,t),t.INTERNAL&&t.INTERNAL.addAuthTokenListener&&(a.forEach(function(t){e.INTERNAL.addAuthTokenListener(t)}),a=[])},t.prototype.checkDestroyed_=function(){this.isDeleted_&&u("app-deleted",{name:this.name_})},t}();function u(t,e){throw c.create(t,e)}s.prototype.name&&s.prototype.options||s.prototype.delete||console.log("dc");var c=new r.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={},a={},c={__esModule:!0,initializeApp:function(t,n){void 0===n&&(n={}),("object"!=typeof n||null===n)&&(n={name:n});var r=n;void 0===r.name&&(r.name=o);var a=r.name;"string"==typeof a&&a||u("bad-app-name",{name:a+""}),i(e,a)&&u("duplicate-app",{name:a});var l=new s(t,r,c);return e[a]=l,f(l,"create"),l},app:l,apps:null,Promise:Promise,SDK_VERSION:"5.5.9",INTERNAL:{registerService:function(t,e,i,o,f){n[t]&&u("duplicate-service",{name:t}),n[t]=e,o&&(a[t]=o,h().forEach(function(t){o("create",t)}));var p=function(e){return void 0===e&&(e=l()),"function"!=typeof e[t]&&u("invalid-app-argument",{name:t}),e[t]()};return void 0!==i&&r.deepExtend(p,i),c[t]=p,s.prototype[t]=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return this._getService.bind(this,t).apply(this,f?e:[])},p},createFirebaseNamespace:t,extendNamespace:function(t){r.deepExtend(c,t)},createSubscribe:r.createSubscribe,ErrorFactory:r.ErrorFactory,removeApp:function(t){f(e[t],"delete"),delete e[t]},factories:n,useAsService:p,Promise:Promise,deepExtend:r.deepExtend}};function l(t){return i(e,t=t||o)||u("no-app",{name:t}),e[t]}function h(){return Object.keys(e).map(function(t){return e[t]})}function f(t,e){Object.keys(n).forEach(function(n){var r=p(0,n);null!==r&&a[r]&&a[r](e,t)})}function p(t,e){return"serverAuth"===e?null:e}return r.patchProperty(c,"default",c),Object.defineProperty(c,"apps",{get:h}),r.patchProperty(l,"App",s),c}();e.firebase=l,e.default=l},x7I3:function(t,e,n){"use strict";n.r(e),n.d(e,"createWebChannelTransport",function(){return Pn}),n.d(e,"ErrorCode",function(){return Rn}),n.d(e,"EventType",function(){return xn}),n.d(e,"WebChannel",function(){return Mn}),n.d(e,"XhrIoPool",function(){return jn});var r,i="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},o=o||{},a=i;function s(t){return"string"==typeof t}function u(t,e){t=t.split("."),e=e||a;for(var n=0;n<t.length;n++)if(null==(e=e[t[n]]))return null;return e}function c(){}function l(t){var e=typeof 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&&void 0!==t.splice&&void 0!==t.propertyIsEnumerable&&!t.propertyIsEnumerable("splice"))return"array";if("[object Function]"==n||void 0!==t.call&&void 0!==t.propertyIsEnumerable&&!t.propertyIsEnumerable("call"))return"function"}else if("function"==e&&void 0===t.call)return"object";return e}function h(t){return"array"==l(t)}function f(t){var e=l(t);return"array"==e||"object"==e&&"number"==typeof t.length}function p(t){return"function"==l(t)}function d(t){var e=typeof t;return"object"==e&&null!=t||"function"==e}var y="closure_uid_"+(1e9*Math.random()>>>0),g=0;function m(t,e,n){return t.call.apply(t.bind,arguments)}function v(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 b(t,e,n){return(b=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?m:v).apply(null,arguments)}function w(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 _=Date.now||function(){return+new Date};function S(t,e){function n(){}n.prototype=e.prototype,t.L=e.prototype,t.prototype=new n,t.prototype.constructor=t,t.mh=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){if(Error.captureStackTrace)Error.captureStackTrace(this,E);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");E.call(this,n+t[r])}function C(){0!=I&&(A[this[y]||(this[y]=++g)]=this),this.Ka=this.Ka,this.Qa=this.Qa}S(E,Error),E.prototype.name="CustomError",S(T,E),T.prototype.name="AssertionError";var I=0,A={};C.prototype.Ka=!1,C.prototype.bb=function(){if(!this.Ka&&(this.Ka=!0,this.F(),0!=I)){var t=this[y]||(this[y]=++g);if(0!=I&&this.Qa&&0<this.Qa.length)throw Error(this+" did not empty its onDisposeCallbacks queue. This probably means it overrode dispose() or disposeInternal() without calling the superclass' method.");delete A[t]}},C.prototype.F=function(){if(this.Qa)for(;this.Qa.length;)this.Qa.shift()()};var O=Array.prototype.indexOf?function(t,e){return Array.prototype.indexOf.call(t,e,void 0)}:function(t,e){if(s(t))return s(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.lastIndexOf?function(t,e){return Array.prototype.lastIndexOf.call(t,e,t.length-1)}:function(t,e){var n=t.length-1;if(0>n&&(n=Math.max(0,t.length+n)),s(t))return s(e)&&1==e.length?t.lastIndexOf(e,n):-1;for(;0<=n;n--)if(n in t&&t[n]===e)return n;return-1},k=Array.prototype.forEach?function(t,e,n){Array.prototype.forEach.call(t,e,n)}:function(t,e,n){for(var r=t.length,i=s(t)?t.split(""):t,o=0;o<r;o++)o in i&&e.call(n,i[o],o,t)},N=Array.prototype.some?function(t,e){return Array.prototype.some.call(t,e,void 0)}:function(t,e){for(var n=t.length,r=s(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 P(t){if(!h(t))for(var e=t.length-1;0<=e;e--)delete t[e];t.length=0}function R(t,e){var n;return(n=0<=(e=O(t,e)))&&Array.prototype.splice.call(t,e,1),n}function x(t){return Array.prototype.concat.apply([],arguments)}function M(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 j(t){return/^[\s\xa0]*$/.test(t)}var L,U=String.prototype.trim?function(t){return t.trim()}:function(t){return/^[\s\xa0]*([\s\S]*?)[\s\xa0]*$/.exec(t)[1]};function V(t,e){return t<e?-1:t>e?1:0}t:{var F=a.navigator;if(F){var q=F.userAgent;if(q){L=q;break t}}L=""}function B(t){return-1!=L.indexOf(t)}function H(t,e,n){for(var r in t)e.call(n,t[r],r,t)}function z(t){var e,n=[],r=0;for(e in t)n[r++]=t[e];return n}function W(t){var e,n=[],r=0;for(e in t)n[r++]=e;return n}function K(t){var e,n={};for(e in t)n[e]=t[e];return n}var G="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function Q(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<G.length;o++)n=G[o],Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}}function X(t){return X[" "](t),t}X[" "]=c;var Y,J,Z=B("Opera"),$=B("Trident")||B("MSIE"),tt=B("Edge"),et=tt||$,nt=B("Gecko")&&!(-1!=L.toLowerCase().indexOf("webkit")&&!B("Edge"))&&!(B("Trident")||B("MSIE"))&&!B("Edge"),rt=-1!=L.toLowerCase().indexOf("webkit")&&!B("Edge");function it(){var t=a.document;return t?t.documentMode:void 0}t:{var ot="",at=(J=L,nt?/rv:([^\);]+)(\)|;)/.exec(J):tt?/Edge\/([\d\.]+)/.exec(J):$?/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(J):rt?/WebKit\/(\S+)/.exec(J):Z?/(?:Version)[ \/]?(\S+)/.exec(J):void 0);if(at&&(ot=at?at[1]:""),$){var st=it();if(null!=st&&st>parseFloat(ot)){Y=String(st);break t}}Y=ot}var ut,ct={};function lt(t){return function(t,e){var n=ct;return Object.prototype.hasOwnProperty.call(n,t)?n[t]:n[t]=e()}(t,function(){for(var e=0,n=U(String(Y)).split("."),r=U(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=V(0==a[1].length?0:parseInt(a[1],10),0==s[1].length?0:parseInt(s[1],10))||V(0==a[2].length,0==s[2].length)||V(a[2],s[2]),a=a[3],s=s[3]}while(0==e)}return 0<=e})}var ht=a.document;ut=ht&&$?it()||("CSS1Compat"==ht.compatMode?parseInt(Y,10):5):void 0;var ft=Object.freeze||function(t){return t},pt=!$||9<=Number(ut),dt=$&&!lt("9"),yt=function(){if(!a.addEventListener||!Object.defineProperty)return!1;var t=!1,e=Object.defineProperty({},"passive",{get:function(){t=!0}});try{a.addEventListener("test",c,e),a.removeEventListener("test",c,e)}catch(n){}return t}();function gt(t,e){this.type=t,this.currentTarget=this.target=e,this.defaultPrevented=this.Ea=!1,this.Be=!0}function mt(t,e){gt.call(this,t?t.type:""),this.relatedTarget=this.currentTarget=this.target=null,this.button=this.screenY=this.screenX=this.clientY=this.clientX=this.offsetY=this.offsetX=0,this.key="",this.charCode=this.keyCode=0,this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1,this.state=null,this.pointerId=0,this.pointerType="",this.fb=null,t&&this.Kf(t,e)}gt.prototype.stopPropagation=function(){this.Ea=!0},gt.prototype.preventDefault=function(){this.defaultPrevented=!0,this.Be=!1},S(mt,gt);var vt=ft({2:"touch",3:"pen",4:"mouse"});mt.prototype.Kf=function(t,e){var n=this.type=t.type,r=t.changedTouches?t.changedTouches[0]:null;if(this.target=t.target||t.srcElement,this.currentTarget=e,e=t.relatedTarget){if(nt){t:{try{X(e.nodeName);var i=!0;break t}catch(o){}i=!1}i||(e=null)}}else"mouseover"==n?e=t.fromElement:"mouseout"==n&&(e=t.toElement);this.relatedTarget=e,null===r?(this.offsetX=rt||void 0!==t.offsetX?t.offsetX:t.layerX,this.offsetY=rt||void 0!==t.offsetY?t.offsetY:t.layerY,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.keyCode=t.keyCode||0,this.key=t.key||"",this.charCode=t.charCode||("keypress"==n?t.keyCode:0),this.ctrlKey=t.ctrlKey,this.altKey=t.altKey,this.shiftKey=t.shiftKey,this.metaKey=t.metaKey,this.pointerId=t.pointerId||0,this.pointerType=s(t.pointerType)?t.pointerType:vt[t.pointerType]||"",this.state=t.state,this.fb=t,t.defaultPrevented&&this.preventDefault()},mt.prototype.stopPropagation=function(){mt.L.stopPropagation.call(this),this.fb.stopPropagation?this.fb.stopPropagation():this.fb.cancelBubble=!0},mt.prototype.preventDefault=function(){mt.L.preventDefault.call(this);var t=this.fb;if(t.preventDefault)t.preventDefault();else if(t.returnValue=!1,dt)try{(t.ctrlKey||112<=t.keyCode&&123>=t.keyCode)&&(t.keyCode=-1)}catch(e){}};var bt="closure_listenable_"+(1e6*Math.random()|0);function wt(t){return!(!t||!t[bt])}var _t=0;function St(t,e,n,r,i){this.listener=t,this.proxy=null,this.src=e,this.type=n,this.capture=!!r,this.Ob=i,this.key=++_t,this.Sa=this.Eb=!1}function Et(t){this.src=t,this.J={},this.xb=0}function Tt(t,e,n,r){for(var i=0;i<t.length;++i){var o=t[i];if(!o.Sa&&o.listener==e&&o.capture==!!n&&o.Ob==r)return i}return-1}St.prototype.Vb=function(){this.Sa=!0,this.Ob=this.src=this.proxy=this.listener=null},(r=Et.prototype).add=function(t,e,n,r,i){var o=t.toString();(t=this.J[o])||(t=this.J[o]=[],this.xb++);var a=Tt(t,e,r,i);return-1<a?(e=t[a],n||(e.Eb=!1)):((e=new St(e,this.src,o,!!r,i)).Eb=n,t.push(e)),e},r.remove=function(t,e,n,r){if(!((t=t.toString())in this.J))return!1;var i=this.J[t];return-1<(e=Tt(i,e,n,r))&&(i[e].Vb(),Array.prototype.splice.call(i,e,1),0==i.length&&(delete this.J[t],this.xb--),!0)},r.ye=function(t){var e=t.type;e in this.J&&R(this.J[e],t)&&(t.Vb(),0==this.J[e].length&&(delete this.J[e],this.xb--))},r.pb=function(t){var e;for(e in t=t&&t.toString(),this.J)if(!t||e==t){for(var n=this.J[e],r=0;r<n.length;r++)n[r].Vb();delete this.J[e],this.xb--}},r.jb=function(t,e,n,r){var i=-1;return(t=this.J[t.toString()])&&(i=Tt(t,e,n,r)),-1<i?t[i]:null};var Ct="closure_lm_"+(1e6*Math.random()|0),It={};function At(t,e,n,r,i){if(r&&r.once)return Dt(t,e,n,r,i);if(h(e)){for(var o=0;o<e.length;o++)At(t,e[o],n,r,i);return null}return n=Lt(n),wt(t)?t.nb(e,n,d(r)?!!r.capture:!!r,i):Ot(t,e,n,!1,r,i)}function Ot(t,e,n,r,i,o){if(!e)throw Error("Invalid event type");var a=d(i)?!!i.capture:!!i,s=Mt(t);if(s||(t[Ct]=s=new Et(t)),(n=s.add(e,n,r,a,o)).proxy)return n;if(r=function(){var t=xt,e=pt?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)yt||(i=a),void 0===i&&(i=!1),t.addEventListener(e.toString(),r,i);else if(t.attachEvent)t.attachEvent(Nt(e.toString()),r);else{if(!t.addListener||!t.removeListener)throw Error("addEventListener and attachEvent are unavailable.");t.addListener(r)}return n}function Dt(t,e,n,r,i){if(h(e)){for(var o=0;o<e.length;o++)Dt(t,e[o],n,r,i);return null}return n=Lt(n),wt(t)?t.Oc(e,n,d(r)?!!r.capture:!!r,i):Ot(t,e,n,!0,r,i)}function kt(t){if("number"!=typeof t&&t&&!t.Sa){var e=t.src;if(wt(e))e.Le(t);else{var n=t.type,r=t.proxy;e.removeEventListener?e.removeEventListener(n,r,t.capture):e.detachEvent?e.detachEvent(Nt(n),r):e.addListener&&e.removeListener&&e.removeListener(r),(n=Mt(e))?(n.ye(t),0==n.xb&&(n.src=null,e[Ct]=null)):t.Vb()}}}function Nt(t){return t in It?It[t]:It[t]="on"+t}function Pt(t,e,n,r){var i=!0;if((t=Mt(t))&&(e=t.J[e.toString()]))for(e=e.concat(),t=0;t<e.length;t++){var o=e[t];o&&o.capture==n&&!o.Sa&&(o=Rt(o,r),i=i&&!1!==o)}return i}function Rt(t,e){var n=t.listener,r=t.Ob||t.src;return t.Eb&&kt(t),n.call(r,e)}function xt(t,e){if(t.Sa)return!0;if(!pt){var n=e||u("window.event");e=new mt(n,this);var r=!0;if(!(0>n.keyCode||null!=n.returnValue)){t:{var i=!1;if(0==n.keyCode)try{n.keyCode=-1;break t}catch(a){i=!0}(i||null==n.returnValue)&&(n.returnValue=!0)}for(n=[],i=e.currentTarget;i;i=i.parentNode)n.push(i);for(t=t.type,i=n.length-1;!e.Ea&&0<=i;i--){e.currentTarget=n[i];var o=Pt(n[i],t,!0,e);r=r&&o}for(i=0;!e.Ea&&i<n.length;i++)e.currentTarget=n[i],o=Pt(n[i],t,!1,e),r=r&&o}return r}return Rt(t,new mt(e,this))}function Mt(t){return(t=t[Ct])instanceof Et?t:null}var jt="__closure_events_fn_"+(1e9*Math.random()>>>0);function Lt(t){return p(t)?t:(t[jt]||(t[jt]=function(e){return t.handleEvent(e)}),t[jt])}function Ut(){C.call(this),this.ka=new Et(this),this.Pe=this,this.Uc=null}S(Ut,C),Ut.prototype[bt]=!0,(r=Ut.prototype).addEventListener=function(t,e,n,r){At(this,t,e,n,r)},r.removeEventListener=function(t,e,n,r){!function t(e,n,r,i,o){if(h(n))for(var a=0;a<n.length;a++)t(e,n[a],r,i,o);else i=d(i)?!!i.capture:!!i,r=Lt(r),wt(e)?e.ed(n,r,i,o):e&&(e=Mt(e))&&(n=e.jb(n,r,i,o))&&kt(n)}(this,t,e,n,r)},r.dispatchEvent=function(t){var e,n=this.Uc;if(n)for(e=[];n;n=n.Uc)e.push(n);n=this.Pe;var r=t.type||t;if(s(t))t=new gt(t,n);else if(t instanceof gt)t.target=t.target||n;else{var i=t;Q(t=new gt(r,n),i)}if(i=!0,e)for(var o=e.length-1;!t.Ea&&0<=o;o--){var a=t.currentTarget=e[o];i=a.Lb(r,!0,t)&&i}if(t.Ea||(i=(a=t.currentTarget=n).Lb(r,!0,t)&&i,t.Ea||(i=a.Lb(r,!1,t)&&i)),e)for(o=0;!t.Ea&&o<e.length;o++)i=(a=t.currentTarget=e[o]).Lb(r,!1,t)&&i;return i},r.F=function(){Ut.L.F.call(this),this.pg(),this.Uc=null},r.nb=function(t,e,n,r){return this.ka.add(String(t),e,!1,n,r)},r.Oc=function(t,e,n,r){return this.ka.add(String(t),e,!0,n,r)},r.ed=function(t,e,n,r){this.ka.remove(String(t),e,n,r)},r.Le=function(t){this.ka.ye(t)},r.pg=function(){this.ka&&this.ka.pb(void 0)},r.Lb=function(t,e,n){if(!(t=this.ka.J[String(t)]))return!0;t=t.concat();for(var r=!0,i=0;i<t.length;++i){var o=t[i];if(o&&!o.Sa&&o.capture==e){var a=o.listener,s=o.Ob||o.src;o.Eb&&this.Le(o),r=!1!==a.call(s,n)&&r}}return r&&0!=n.Be},r.jb=function(t,e,n,r){return this.ka.jb(String(t),e,n,r)};var Vt=a.JSON.stringify;function Ft(t,e){this.Sf=100,this.ef=t,this.ug=e,this.Zb=0,this.Pb=null}function qt(){this.lc=this.Va=null}Ft.prototype.get=function(){if(0<this.Zb){this.Zb--;var t=this.Pb;this.Pb=t.next,t.next=null}else t=this.ef();return t},Ft.prototype.put=function(t){this.ug(t),this.Zb<this.Sf&&(this.Zb++,t.next=this.Pb,this.Pb=t)};var Bt,Ht,zt=new Ft(function(){return new Wt},function(t){t.reset()});function Wt(){this.next=this.scope=this.Gc=null}function Kt(t){a.setTimeout(function(){throw t},0)}qt.prototype.add=function(t,e){var n=this.Af();n.set(t,e),this.lc?this.lc.next=n:this.Va=n,this.lc=n},qt.prototype.remove=function(){var t=null;return this.Va&&(t=this.Va,this.Va=this.Va.next,this.Va||(this.lc=null),t.next=null),t},qt.prototype.wg=function(t){zt.put(t)},qt.prototype.Af=function(){return zt.get()},Wt.prototype.set=function(t,e){this.Gc=t,this.scope=e,this.next=null},Wt.prototype.reset=function(){this.next=this.scope=this.Gc=null};var Gt=!1,Qt=new qt;function Xt(){for(var t;t=Qt.remove();){try{t.Gc.call(t.scope)}catch(e){Kt(e)}Qt.wg(t)}Gt=!1}function Yt(t,e){Ut.call(this),this.Na=t||1,this.wb=e||a,this.nd=b(this.Rg,this),this.ie=_()}function Jt(t,e,n){if(p(t))n&&(t=b(t,n));else{if(!t||"function"!=typeof t.handleEvent)throw Error("Invalid listener argument");t=b(t.handleEvent,t)}return 2147483647<Number(e)?-1:a.setTimeout(t,e||0)}function Zt(t,e,n){C.call(this),this.Uf=null!=n?b(t,n):t,this.Na=e,this.Xe=b(this.fg,this),this.qc=[]}function $t(t){C.call(this),this.i=t,this.o={}}S(Yt,Ut),(r=Yt.prototype).enabled=!1,r.B=null,r.setInterval=function(t){this.Na=t,this.B&&this.enabled?(this.stop(),this.start()):this.B&&this.stop()},r.Rg=function(){if(this.enabled){var t=_()-this.ie;0<t&&t<.8*this.Na?this.B=this.wb.setTimeout(this.nd,this.Na-t):(this.B&&(this.wb.clearTimeout(this.B),this.B=null),this.ff(),this.enabled&&(this.stop(),this.start()))}},r.ff=function(){this.dispatchEvent("tick")},r.start=function(){this.enabled=!0,this.B||(this.B=this.wb.setTimeout(this.nd,this.Na),this.ie=_())},r.stop=function(){this.enabled=!1,this.B&&(this.wb.clearTimeout(this.B),this.B=null)},r.F=function(){Yt.L.F.call(this),this.stop(),delete this.wb},S(Zt,C),(r=Zt.prototype).Ta=!1,r.ob=0,r.B=null,r.mf=function(t){this.qc=arguments,this.B||this.ob?this.Ta=!0:this.Cc()},r.stop=function(){this.B&&(a.clearTimeout(this.B),this.B=null,this.Ta=!1,this.qc=[])},r.pause=function(){this.ob++},r.resume=function(){this.ob--,this.ob||!this.Ta||this.B||(this.Ta=!1,this.Cc())},r.F=function(){Zt.L.F.call(this),this.stop()},r.fg=function(){this.B=null,this.Ta&&!this.ob&&(this.Ta=!1,this.Cc())},r.Cc=function(){this.B=Jt(this.Xe,this.Na),this.Uf.apply(null,this.qc)},S($t,C);var te=[];function ee(t,e,n){this.reset(t,e,n,void 0,void 0)}function ne(t){this.pe=t,this.Zd=this.uc=this.mb=this.$b=null}function re(t,e){this.name=t,this.value=e}(r=$t.prototype).nb=function(t,e,n,r){return this.Tf(t,e,n,r)},r.Tf=function(t,e,n,r){h(e)||(e&&(te[0]=e.toString()),e=te);for(var i=0;i<e.length;i++){var o=At(t,e[i],n||this.handleEvent,r||!1,this.i||this);if(!o)break;this.o[o.key]=o}return this},r.Oc=function(t,e,n,r){return this.je(t,e,n,r)},r.je=function(t,e,n,r,i){if(h(e))for(var o=0;o<e.length;o++)this.je(t,e[o],n,r,i);else{if(!(t=Dt(t,e,n||this.handleEvent,r,i||this.i||this)))return this;this.o[t.key]=t}return this},r.ed=function(t,e,n,r,i){if(h(e))for(var o=0;o<e.length;o++)this.ed(t,e[o],n,r,i);else n=n||this.handleEvent,r=d(r)?!!r.capture:!!r,i=i||this.i||this,n=Lt(n),r=!!r,(e=wt(t)?t.jb(e,n,r,i):t&&(t=Mt(t))?t.jb(e,n,r,i):null)&&(kt(e),delete this.o[e.key])},r.pb=function(){H(this.o,function(t,e){this.o.hasOwnProperty(e)&&kt(t)},this),this.o={}},r.F=function(){$t.L.F.call(this),this.pb()},r.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented")},ee.prototype.Md=null,ee.prototype.reset=function(t,e,n,r,i){this.mb=t,delete this.Md},ee.prototype.Bg=function(t){this.Md=t},ee.prototype.Ge=function(t){this.mb=t},re.prototype.toString=function(){return this.name};var ie=new re("SEVERE",1e3),oe=new re("WARNING",900),ae=new re("INFO",800),se=new re("CONFIG",700),ue=new re("FINE",500);(r=ne.prototype).getName=function(){return this.pe},r.getParent=function(){return this.$b},r.pf=function(){return this.uc||(this.uc={}),this.uc},r.Ge=function(t){this.mb=t},r.Qd=function(){return this.mb?this.mb:this.$b?this.$b.Qd():(function(t,e){throw new T("Failure: Root logger has no level set.",Array.prototype.slice.call(arguments,1))}("Root logger has no level set."),null)},r.Pf=function(t){return t.value>=this.Qd().value},r.log=function(t,e,n){this.Pf(t)&&(p(e)&&(e=e()),this.gf(this.uf(t,e,n)))},r.uf=function(t,e,n){return t=new ee(t,String(e),this.pe),n&&t.Bg(n),t},r.ca=function(t,e){this.log(ie,t,e)},r.T=function(t,e){this.log(oe,t,e)},r.info=function(t,e){this.log(ae,t,e)},r.lf=function(t){this.log(ue,t,void 0)},r.gf=function(t){for(var e=this;e;)e.We(t),e=e.getParent()},r.We=function(t){if(this.Zd)for(var e,n=0;e=this.Zd[n];n++)e(t)},r.Fg=function(t){this.$b=t},r.Qe=function(t,e){this.pf()[t]=e};var ce={},le=null;function he(t){var e;if(le||(le=new ne(""),ce[""]=le,le.Ge(se)),!(e=ce[t])){e=new ne(t);var n=t.lastIndexOf("."),r=t.substr(n+1);(n=he(t.substr(0,n))).Qe(r,e),e.Fg(n),ce[t]=e}return e}function fe(t,e){t&&t.info(e,void 0)}function pe(t,e){t&&t.lf(e)}function de(){this.s=he("goog.labs.net.webChannel.WebChannelDebug"),this.Wc=!0}(r=de.prototype).Id=function(){this.Wc=!1},r.Tg=function(t,e,n,r,i){var o=this;this.info(function(){return"XMLHTTP REQ ("+n+") [attempt "+r+"]: "+t+"\n"+e+"\n"+o.Xf(i)})},r.Ug=function(t,e,n,r,i,o){this.info(function(){return"XMLHTTP RESP ("+n+") [ attempt "+r+"]: "+t+"\n"+e+"\n"+i+" "+o})},r.Wa=function(t,e,n){var r=this;this.info(function(){return"XMLHTTP TEXT ("+t+"): "+r.ng(e)+(n?" "+n:"")})},r.Sg=function(t){this.info(function(){return"TIMEOUT: "+t})},r.debug=function(t){pe(this.s,t)},r.cb=function(t,e){var n=this.s;n&&n.ca(e||"Exception",t)},r.info=function(t){fe(this.s,t)},r.T=function(t){var e=this.s;e&&e.T(t,void 0)},r.ca=function(t){var e=this.s;e&&e.ca(t,void 0)},r.ng=function(t){if(!this.Wc)return t;if(!t)return null;try{var e=JSON.parse(t);if(e)for(var n=0;n<e.length;n++)h(e[n])&&this.Wf(e[n]);return Vt(e)}catch(r){return this.debug("Exception parsing expected JS array - probably was not JS"),t}},r.Wf=function(t){if(!(2>t.length||(t=t[1],!h(t)||1>t.length))){var e=t[0];if("noop"!=e&&"stop"!=e&&"close"!=e)for(e=1;e<t.length;e++)t[e]=""}},r.Xf=function(t){if(!this.Wc)return t;if(!t)return null;var e="";t=t.split("&");for(var n=0;n<t.length;n++){var r=t[n].split("=");if(1<r.length){var i=r[0];r=r[1];var o=i.split("_");e=2<=o.length&&"type"==o[1]?e+(i+"=")+r+"&":e+(i+"=redacted&")}}return e};var ye=new Ut;function ge(t){gt.call(this,"serverreachability",t)}function me(t){ye.dispatchEvent(new ge(ye,t))}function ve(t,e){gt.call(this,"statevent",t),this.stat=e}function be(t){ye.dispatchEvent(new ve(ye,t))}function we(t,e,n){gt.call(this,"timingevent",t),this.size=e,this.rtt=n}function _e(t,e){if(!p(t))throw Error("Fn must not be null and must be a function");return a.setTimeout(function(){t()},e)}S(ge,gt),S(ve,gt),S(we,gt);var Se={NO_ERROR:0,Vg:1,bh:2,ah:3,Yg:4,$g:5,dh:6,Ne:7,TIMEOUT:8,gh:9},Ee={Xg:"complete",kh:"success",Oe:"error",Ne:"abort",ih:"ready",jh:"readystatechange",TIMEOUT:"timeout",eh:"incrementaldata",hh:"progress",Zg:"downloadprogress",lh:"uploadprogress"};function Te(){}function Ce(){}Te.prototype.pd=null,Te.prototype.Vd=function(){return this.pd||(this.pd=this.Mf())};var Ie,Ae={OPEN:"a",Wg:"b",Oe:"c",fh:"d"};function Oe(){gt.call(this,"d")}function De(){gt.call(this,"c")}function ke(){}function Ne(t,e,n,r,i){this.b=t,this.a=e,this.ra=n,this.R=r,this.Xc=i||1,this.Fc=new $t(this),this.Ua=Pe,this.Vc=new Yt(t=et?125:void 0),this.A=null,this.S=!1,this.Da=this.pa=this.ua=this.ic=this.qb=this.hd=this.Ga=null,this.ba=[],this.h=null,this.Bb=0,this.I=this.Fa=null,this.w=-1,this.Za=!1,this.Ra=0,this.ac=null,this.lb=this.Ed=this.yc=!1}S(Oe,gt),S(De,gt),S(ke,Te),ke.prototype.Dd=function(){var t=this.Wd();return t?new ActiveXObject(t):new XMLHttpRequest},ke.prototype.Mf=function(){var t={};return this.Wd()&&(t[0]=!0,t[1]=!0),t},ke.prototype.Wd=function(){if(!this.be&&"undefined"==typeof XMLHttpRequest&&"undefined"!=typeof ActiveXObject){for(var t=["MSXML2.XMLHTTP.6.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"],e=0;e<t.length;e++){var n=t[e];try{return new ActiveXObject(n),this.be=n}catch(r){}}throw Error("Could not create ActiveXObject. ActiveX might be disabled, or MSXML might not be installed")}return this.be},Ie=new ke;var Pe=45e3,Re={},xe={};function Me(t){if(t.H&&"function"==typeof t.H)return t.H();if(s(t))return t.split("");if(f(t)){for(var e=[],n=t.length,r=0;r<n;r++)e.push(t[r]);return e}return z(t)}function je(t,e,n){if(t.forEach&&"function"==typeof t.forEach)t.forEach(e,n);else if(f(t)||s(t))k(t,e,n);else{if(t.W&&"function"==typeof t.W)var r=t.W();else if(t.H&&"function"==typeof t.H)r=void 0;else if(f(t)||s(t)){r=[];for(var i=t.length,o=0;o<i;o++)r.push(o)}else r=W(t);o=(i=Me(t)).length;for(var a=0;a<o;a++)e.call(n,i[a],r&&r[a],t)}}function Le(t,e){this.D={},this.o=[],this.j=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 t&&this.addAll(t)}function Ue(t,e){return Object.prototype.hasOwnProperty.call(t,e)}(r=Ne.prototype).ga=function(t){this.A=t},r.setTimeout=function(t){this.Ua=t},r.He=function(t){this.Ra=t},r.Gg=function(t){this.ba=t},r.la=function(){return this.ba},r.kd=function(t,e){this.ic=1,this.ua=t.clone().Ub(),this.Da=e,this.yc=!0,this.Ce(null)},r.jd=function(t,e,n){this.ic=1,this.ua=t.clone().Ub(),this.Da=null,this.yc=e,this.Ce(n)},r.Ce=function(t){this.qb=_(),this.eb(),this.pa=this.ua.clone(),this.pa.dc("t",this.Xc),this.Bb=0,this.h=this.b.Jb(this.b.fc()?t:null),0<this.Ra&&(this.ac=new Zt(b(this.Me,this,this.h),this.Ra)),this.Fc.nb(this.h,"readystatechange",this.mg),t=this.A?K(this.A):{},this.Da?(this.Fa||(this.Fa="POST"),t["Content-Type"]="application/x-www-form-urlencoded",this.h.send(this.pa,this.Fa,this.Da,t)):(this.Fa="GET",this.h.send(this.pa,this.Fa,null,t)),me(1),this.a.Tg(this.Fa,this.pa,this.R,this.Xc,this.Da)},r.mg=function(t){t=t.target;var e=this.ac;e&&3==t.ma()?(this.a.debug("Throttling readystatechange."),e.mf()):this.Me(t)},r.Me=function(t){try{t==this.h?this.hg():this.a.T("Called back with an unexpected xmlhttp")}catch(n){if(this.a.debug("Failed call to OnXmlHttpReadyStateChanged_"),this.h&&this.h.ya()){var e=this;this.a.cb(n,function(){return"ResponseText: "+e.h.ya()})}else this.a.cb(n,"No response text")}},r.hg=function(){var t=this.h.ma(),e=this.h.Ud(),n=this.h.za();if(!(3>t||3==t&&!et&&!this.h.ya())){this.Za||4!=t||7==e||me(8==e||0>=n?3:2),this.Fb();var r=this.h.za();if(this.w=r,!(e=this.h.ya())){var i=this;this.a.debug(function(){return"No response text for uri "+i.pa+" status "+r})}if(this.S=200==r,this.a.Ug(this.Fa,this.pa,this.R,this.Xc,t,r),this.S){if(this.Ig()){if(!(n=this.sf()))return this.S=!1,this.I=3,be(12),this.a.T("XMLHTTP Missing X_HTTP_INITIAL_RESPONSE ("+this.R+")"),this.Ia(),void this.Kb();this.a.Wa(this.R,n,"Initial handshake response via X-HTTP-Initial-Response"),this.lb=!0,this.Yc(n)}this.yc?(this.Fd(t,e),et&&this.S&&3==t&&this.Ng()):(this.a.Wa(this.R,e,null),this.Yc(e)),4==t&&this.Ia(),this.S&&!this.Za&&(4==t?this.b.Tc(this):(this.S=!1,this.eb()))}else 400==r&&0<e.indexOf("Unknown SID")?(this.I=3,be(12),this.a.T("XMLHTTP Unknown SID ("+this.R+")")):(this.I=0,be(13),this.a.T("XMLHTTP Bad status "+r+" ("+this.R+")")),this.Ia(),this.Kb()}},r.Ig=function(){return this.Ed&&!this.lb},r.sf=function(){if(this.h){var t=this.h.kb("X-HTTP-Initial-Response");if(t&&!j(t))return t}return null},r.Ag=function(){this.Ed=!0},r.Fd=function(t,e){for(var n=!0;!this.Za&&this.Bb<e.length;){var r=this.vf(e);if(r==xe){4==t&&(this.I=4,be(14),n=!1),this.a.Wa(this.R,null,"[Incomplete Response]");break}if(r==Re){this.I=4,be(15),this.a.Wa(this.R,e,"[Invalid Chunk]"),n=!1;break}this.a.Wa(this.R,r,null),this.Yc(r)}4==t&&0==e.length&&(this.I=1,be(16),n=!1),this.S=this.S&&n,n||(this.a.Wa(this.R,e,"[Invalid Chunked Response]"),this.Ia(),this.Kb())},r.kg=function(){if(this.h){var t=this.h.ma(),e=this.h.ya();this.Bb<e.length&&(this.Fb(),this.Fd(t,e),this.S&&4!=t&&this.eb())}},r.Ng=function(){this.Fc.nb(this.Vc,"tick",this.kg),this.Vc.start()},r.vf=function(t){var e=this.Bb,n=t.indexOf("\n",e);return-1==n?xe:(e=Number(t.substring(e,n)),isNaN(e)?Re:(n+=1)+e>t.length?xe:(t=t.substr(n,e),this.Bb=n+e,t))},r.yg=function(t){this.ic=2,this.ua=t.clone().Ub(),t=!1,a.navigator&&a.navigator.sendBeacon&&(t=a.navigator.sendBeacon(this.ua.toString(),"")),!t&&a.Image&&((new Image).src=this.ua,t=!0),t||(this.h=this.b.Jb(null),this.h.send(this.ua)),this.qb=_(),this.eb()},r.cancel=function(){this.Za=!0,this.Ia()},r.tg=function(t){t&&this.setTimeout(t),this.Ga&&(this.Fb(),this.eb())},r.eb=function(){this.hd=_()+this.Ua,this.Ke(this.Ua)},r.Ke=function(t){if(null!=this.Ga)throw Error("WatchDog timer not null");this.Ga=_e(b(this.gg,this),t)},r.Fb=function(){this.Ga&&(a.clearTimeout(this.Ga),this.Ga=null)},r.gg=function(){this.Ga=null;var t=_();0<=t-this.hd?this.Df():(this.a.T("WatchDog timer called too early"),this.Ke(this.hd-t))},r.Df=function(){this.S&&this.a.ca("Received watchdog timeout even though request loaded successfully"),this.a.Sg(this.pa),2!=this.ic&&(me(3),be(17)),this.Ia(),this.I=2,this.Kb()},r.Kb=function(){this.b.de()||this.Za||this.b.Tc(this)},r.Ia=function(){this.Fb();var t=this.ac;t&&"function"==typeof t.bb&&t.bb(),this.ac=null,this.Vc.stop(),this.Fc.pb(),this.h&&(t=this.h,this.h=null,t.abort(),t.bb())},r.Hc=function(){return this.I},r.Yc=function(t){try{this.b.ue(this,t),me(4)}catch(e){this.a.cb(e,"Error in httprequest callback")}},(r=Le.prototype).C=function(){return this.j},r.H=function(){this.wc();for(var t=[],e=0;e<this.o.length;e++)t.push(this.D[this.o[e]]);return t},r.W=function(){return this.wc(),this.o.concat()},r.va=function(t){return Ue(this.D,t)},r.X=function(){return 0==this.j},r.clear=function(){this.D={},this.j=this.o.length=0},r.remove=function(t){return!!Ue(this.D,t)&&(delete this.D[t],this.j--,this.o.length>2*this.j&&this.wc(),!0)},r.wc=function(){if(this.j!=this.o.length){for(var t=0,e=0;t<this.o.length;){var n=this.o[t];Ue(this.D,n)&&(this.o[e++]=n),t++}this.o.length=e}if(this.j!=this.o.length){var r={};for(e=t=0;t<this.o.length;)Ue(r,n=this.o[t])||(this.o[e++]=n,r[n]=1),t++;this.o.length=e}},r.get=function(t,e){return Ue(this.D,t)?this.D[t]:e},r.set=function(t,e){Ue(this.D,t)||(this.j++,this.o.push(t)),this.D[t]=e},r.addAll=function(t){if(t instanceof Le)for(var e=t.W(),n=0;n<e.length;n++)this.set(e[n],t.get(e[n]));else for(e in t)this.set(e,t[e])},r.forEach=function(t,e){for(var n=this.W(),r=0;r<n.length;r++){var i=n[r],o=this.get(i);t.call(e,o,i,this)}},r.clone=function(){return new Le(this)};var Ve=/^(?:([^:\/?#.]+):)?(?:\/\/(?:([^\/?#]*)@)?([^\/#?]*?)(?::([0-9]+))?(?=[\/#?]|$))?([^?#]+)?(?:\?([^#]*))?(?:#([\s\S]*))?$/;function Fe(t,e){var n;this.xa=this.zb=this.qa="",this.Ca=null,this.ib=this.K="",this.O=this.Qf=!1,t instanceof Fe?(this.O=void 0!==e?e:t.O,this.tb(t.qa),this.cd(t.zb),this.rb(t.xa),this.sb(t.Ca),this.ec(t.K),this.bd(t.P.clone()),this.$c(t.ib)):t&&(n=String(t).match(Ve))?(this.O=!!e,this.tb(n[1]||"",!0),this.cd(n[2]||"",!0),this.rb(n[3]||"",!0),this.sb(n[4]),this.ec(n[5]||"",!0),this.bd(n[6]||"",!0),this.$c(n[7]||"",!0)):(this.O=!!e,this.P=new Xe(null,this.O))}function qe(t,e){return t?e?decodeURI(t.replace(/%25/g,"%2525")):decodeURIComponent(t):""}function Be(t,e,n){return s(t)?(t=encodeURI(t).replace(e,He),n&&(t=t.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),t):null}function He(t){return"%"+((t=t.charCodeAt(0))>>4&15).toString(16)+(15&t).toString(16)}(r=Fe.prototype).toString=function(){var t=[],e=this.qa;e&&t.push(Be(e,ze,!0),":");var n=this.xa;return(n||"file"==e)&&(t.push("//"),(e=this.zb)&&t.push(Be(e,ze,!0),"@"),t.push(encodeURIComponent(String(n)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),null!=(n=this.Ca)&&t.push(":",String(n))),(n=this.K)&&(this.Ic()&&"/"!=n.charAt(0)&&t.push("/"),t.push(Be(n,"/"==n.charAt(0)?Ke:We,!0))),(n=this.Rd())&&t.push("?",n),(n=this.ib)&&t.push("#",Be(n,Qe)),t.join("")},r.resolve=function(t){var e=this.clone(),n=t.Hf();n?e.tb(t.qa):n=t.If(),n?e.cd(t.zb):n=t.Ic(),n?e.rb(t.xa):n=t.Ff();var r=t.K;if(n)e.sb(t.Ca);else if(n=t.ae()){if("/"!=r.charAt(0))if(this.Ic()&&!this.ae())r="/"+r;else{var i=e.K.lastIndexOf("/");-1!=i&&(r=e.K.substr(0,i+1)+r)}if(".."==(i=r)||"."==i)r="";else if(-1!=i.indexOf("./")||-1!=i.indexOf("/.")){r=0==i.lastIndexOf("/",0),i=i.split("/");for(var o=[],a=0;a<i.length;){var s=i[a++];"."==s?r&&a==i.length&&o.push(""):".."==s?((1<o.length||1==o.length&&""!=o[0])&&o.pop(),r&&a==i.length&&o.push("")):(o.push(s),r=!0)}r=o.join("/")}else r=i}return n?e.ec(r):n=t.Gf(),n?e.bd(t.P.clone()):n=t.Ef(),n&&e.$c(t.ib),e},r.clone=function(){return new Fe(this)},r.tb=function(t,e){this.U(),(this.qa=e?qe(t,!0):t)&&(this.qa=this.qa.replace(/:$/,""))},r.Hf=function(){return!!this.qa},r.cd=function(t,e){this.U(),this.zb=e?qe(t):t},r.If=function(){return!!this.zb},r.rb=function(t,e){this.U(),this.xa=e?qe(t,!0):t},r.Ic=function(){return!!this.xa},r.sb=function(t){if(this.U(),t){if(t=Number(t),isNaN(t)||0>t)throw Error("Bad port number "+t);this.Ca=t}else this.Ca=null},r.Ff=function(){return null!=this.Ca},r.ec=function(t,e){this.U(),this.K=e?qe(t,!0):t},r.ae=function(){return!!this.K},r.Gf=function(){return""!==this.P.toString()},r.bd=function(t,e){this.U(),t instanceof Xe?(this.P=t,this.P.ad(this.O)):(e||(t=Be(t,Ge)),this.P=new Xe(t,this.O))},r.Rd=function(){return this.P.toString()},r.getQuery=function(){return this.Rd()},r.l=function(t,e){this.U(),this.P.set(t,e)},r.dc=function(t,e){this.U(),h(e)||(e=[String(e)]),this.P.Ie(t,e)},r.$c=function(t,e){this.U(),this.ib=e?qe(t):t},r.Ef=function(){return!!this.ib},r.Ub=function(){return this.U(),this.l("zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^_()).toString(36)),this},r.removeParameter=function(t){return this.U(),this.P.remove(t),this},r.U=function(){if(this.Qf)throw Error("Tried to modify a read-only Uri")},r.ad=function(t){this.O=t,this.P&&this.P.ad(t)};var ze=/[#\/\?@]/g,We=/[#\?:]/g,Ke=/[#\?]/g,Ge=/[#\?@]/g,Qe=/#/g;function Xe(t,e){this.j=this.m=null,this.ja=t||null,this.O=!!e}function Ye(t,e){this.b=t,this.a=e,this.f=this.A=null,this.bc=!1,this.K=null,this.w=-1,this.Ad=this.na=null}function Je(){this.od=this.$d=null}function Ze(t){this.D=new Le,t&&this.addAll(t)}function $e(t){var e=typeof t;return"object"==e&&t||"function"==e?"o"+(t[y]||(t[y]=++g)):e.substr(0,1)+t}function tn(t,e){this.Pc=t,this.map=e,this.context=null}function en(t){this.me=t||nn,t=a.PerformanceNavigationTiming?0<(t=a.performance.getEntriesByType("navigation")).length&&("hq"==t[0].nextHopProtocol||"h2"==t[0].nextHopProtocol):!!(a.vc&&a.vc.ke&&a.vc.ke()&&a.vc.ke().nh),this.Xb=t?this.me:1,this.v=null,1<this.Xb&&(this.v=new Ze),this.f=null,this.ba=[]}(r=Xe.prototype).$=function(){if(!this.m&&(this.m=new Le,this.j=0,this.ja)){var t=this;!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," ")):"")}}}(this.ja,function(e,n){t.add(decodeURIComponent(e.replace(/\+/g," ")),n)})}},r.C=function(){return this.$(),this.j},r.add=function(t,e){this.$(),this.Oa(),t=this.Ma(t);var n=this.m.get(t);return n||this.m.set(t,n=[]),n.push(e),this.j+=1,this},r.remove=function(t){return this.$(),t=this.Ma(t),!!this.m.va(t)&&(this.Oa(),this.j-=this.m.get(t).length,this.m.remove(t))},r.clear=function(){this.Oa(),this.m=null,this.j=0},r.X=function(){return this.$(),0==this.j},r.va=function(t){return this.$(),t=this.Ma(t),this.m.va(t)},r.forEach=function(t,e){this.$(),this.m.forEach(function(n,r){k(n,function(n){t.call(e,n,r,this)},this)},this)},r.W=function(){this.$();for(var t=this.m.H(),e=this.m.W(),n=[],r=0;r<e.length;r++)for(var i=t[r],o=0;o<i.length;o++)n.push(e[r]);return n},r.H=function(t){this.$();var e=[];if(s(t))this.va(t)&&(e=x(e,this.m.get(this.Ma(t))));else{t=this.m.H();for(var n=0;n<t.length;n++)e=x(e,t[n])}return e},r.set=function(t,e){return this.$(),this.Oa(),t=this.Ma(t),this.va(t)&&(this.j-=this.m.get(t).length),this.m.set(t,[e]),this.j+=1,this},r.get=function(t,e){return t&&0<(t=this.H(t)).length?String(t[0]):e},r.Ie=function(t,e){this.remove(t),0<e.length&&(this.Oa(),this.m.set(this.Ma(t),M(e)),this.j+=e.length)},r.toString=function(){if(this.ja)return this.ja;if(!this.m)return"";for(var t=[],e=this.m.W(),n=0;n<e.length;n++){var r=e[n],i=encodeURIComponent(String(r));r=this.H(r);for(var o=0;o<r.length;o++){var a=i;""!==r[o]&&(a+="="+encodeURIComponent(String(r[o]))),t.push(a)}}return this.ja=t.join("&")},r.Oa=function(){this.ja=null},r.clone=function(){var t=new Xe;return t.ja=this.ja,this.m&&(t.m=this.m.clone(),t.j=this.j),t},r.Ma=function(t){return t=String(t),this.O&&(t=t.toLowerCase()),t},r.ad=function(t){t&&!this.O&&(this.$(),this.Oa(),this.m.forEach(function(t,e){var n=e.toLowerCase();e!=n&&(this.remove(e),this.Ie(n,t))},this)),this.O=t},r.extend=function(t){for(var e=0;e<arguments.length;e++)je(arguments[e],function(t,e){this.add(e,t)},this)},S(function(){},function(){}),(r=Ye.prototype).g=null,r.ga=function(t){this.A=t},r.connect=function(t){this.K=t,t=this.b.Sd(this.K),be(3);var e=this.b.Ib.$d;null!=e?(this.na=this.b.$a(e[0]),this.g=1,this.xd()):(t.dc("MODE","init"),!this.b.ta&&this.b.aa&&t.dc("X-HTTP-Session-Id",this.b.aa),this.f=new Ne(this,this.a,void 0,void 0,void 0),this.f.ga(this.A),this.f.jd(t,!1,null),this.g=0)},r.xd=function(){this.a.debug("TestConnection: starting stage 2");var t=this.b.Ib.od;if(null!=t)this.a.debug(function(){return"Buffered"}),be(4),t?(be(10),this.b.ub(this,!1)):(be(11),this.b.ub(this,!0));else{this.f=new Ne(this,this.a,void 0,void 0,void 0),this.f.ga(this.A);var e=this.b.Pd(this.na,this.K);be(4),e.dc("TYPE","xmlhttp");var n=this.b.aa,r=this.b.Kc;n&&r&&e.l(n,r),this.f.jd(e,!1,this.na)}},r.Jb=function(t){return this.b.Jb(t)},r.abort=function(){this.f&&(this.f.cancel(),this.f=null),this.w=-1},r.de=function(){return!1},r.ue=function(t,e){if(this.w=t.w,0==this.g)if(this.a.debug("TestConnection: Got data for stage 1"),this.pc(t),e){try{var n=this.b.kc.zc(e)}catch(r){return this.a.cb(r),void this.b.dd(this)}this.na=this.b.$a(n[0])}else this.a.debug("TestConnection: Null responseText"),this.b.dd(this);else 1==this.g&&(this.bc?be(6):"11111"==e?(be(5),this.bc=!0,this.Ze()&&(this.w=200,this.f.cancel(),this.a.debug("Test connection succeeded; using streaming connection"),be(11),this.b.ub(this,!0))):(be(7),this.bc=!1))},r.Tc=function(){this.w=this.f.w,this.f.S?0==this.g?(this.g=1,this.a.debug("TestConnection: request complete for initial check"),this.xd()):1==this.g&&(this.a.debug("TestConnection: request complete for stage 2"),this.bc?(this.a.debug("Test connection succeeded; using streaming connection"),be(11),this.b.ub(this,!0)):(this.a.debug("Test connection failed; not using streaming"),be(10),this.b.ub(this,!1))):(this.a.debug("TestConnection: request failed, in state "+this.g),0==this.g?be(8):1==this.g&&be(9),this.b.dd(this))},r.pc=function(t){if(!this.b.ta&&(t=t.h)){var e=t.kb("X-Client-Wire-Protocol");this.Ad=e||null,this.b.aa&&((t=t.kb("X-HTTP-Session-Id"))?this.b.Fe(t):this.a.T("Missing X_HTTP_SESSION_ID in the handshake response"))}},r.fc=function(){return this.b.fc()},r.Ba=function(){return this.b.Ba()},r.Ze=function(){return!$||10<=Number(ut)},(r=Ze.prototype).C=function(){return this.D.C()},r.add=function(t){this.D.set($e(t),t)},r.addAll=function(t){for(var e=(t=Me(t)).length,n=0;n<e;n++)this.add(t[n])},r.pb=function(t){for(var e=(t=Me(t)).length,n=0;n<e;n++)this.remove(t[n])},r.remove=function(t){return this.D.remove($e(t))},r.clear=function(){this.D.clear()},r.X=function(){return this.D.X()},r.contains=function(t){return this.D.va($e(t))},r.H=function(){return this.D.H()},r.clone=function(){return new Ze(this)};var nn=10;function rn(){this.xg=this.rg=void 0}function on(){this.jg=new rn}function an(t,e,n,r,i){try{t.debug(n),e.onload=null,e.onerror=null,e.onabort=null,e.ontimeout=null,i(r)}catch(o){t.cb(o)}}(r=en.prototype).ld=function(t){this.v||-1==t.indexOf("spdy")&&-1==t.indexOf("quic")&&-1==t.indexOf("h2")||(this.Xb=this.me,this.v=new Ze,this.f&&(this.oc(this.f),this.f=null))},r.ee=function(){return!!this.f||!!this.v&&this.v.C()>=this.Xb},r.xf=function(){return this.f?1:this.v?this.v.C():0},r.Jc=function(t){return this.f?this.f==t:!!this.v&&this.v.contains(t)},r.oc=function(t){this.v?this.v.add(t):this.f=t},r.ze=function(t){this.f&&this.f==t?this.f=null:this.v&&this.v.contains(t)&&this.v.remove(t)},r.cancel=function(){this.ba=this.la(),this.f?(this.f.cancel(),this.f=null):this.v&&!this.v.X()&&(k(this.v.H(),function(t){t.cancel()}),this.v.clear())},r.la=function(){if(null!=this.f)return this.ba.concat(this.f.la());if(null!=this.v&&!this.v.X()){var t=this.ba;return k(this.v.H(),function(e){t=t.concat(e.la())}),t}return M(this.ba)},r.Re=function(t){this.ba=this.ba.concat(t)},r.$e=function(){this.ba.length=0},rn.prototype.stringify=function(t){return a.JSON.stringify(t,this.rg)},rn.prototype.parse=function(t){return a.JSON.parse(t,this.xg)},on.prototype.hf=function(t,e,n){var r=n||"";try{je(t,function(t,n){var i=t;d(t)&&(i=Vt(t)),e.push(r+n+"="+encodeURIComponent(i))})}catch(i){throw e.push(r+"type="+encodeURIComponent("_badmap")),i}},on.prototype.jf=function(t,e,n){for(var r=-1;;){var i=["count="+e];-1==r?0<e?i.push("ofs="+(r=t[0].Pc)):r=0:i.push("ofs="+r);for(var o=!0,a=0;a<e;a++){var s=t[a].Pc,u=t[a].map;if(0>(s-=r))r=Math.max(0,t[a].Pc-100),o=!1;else try{this.hf(u,i,"req"+s+"_")}catch(c){n&&n(u)}}if(o)return i.join("&")}},on.prototype.zc=function(t){return this.jg.parse(t)};var sn=a.JSON.parse;function un(t){Ut.call(this),this.headers=new Le,this.Xa=t||null,this.ha=!1,this.mc=this.c=null,this.ge=this.Tb="",this.Pa=0,this.I="",this.Aa=this.Lc=this.Qb=this.Ec=!1,this.vb=0,this.hc=null,this.Ae=cn,this.jc=this.lg=this.Ab=!1}S(un,Ut);var cn="";un.prototype.s=he("goog.net.XhrIo");var ln=/^https?$/i,hn=["POST","PUT"];function fn(t){return"content-type"==t.toLowerCase()}function pn(t,e){return{type:e,lengthComputable:t.lengthComputable,loaded:t.loaded,total:t.total}}function dn(t,e,n){t:{for(r in n){var r=!1;break t}r=!0}if(r)return t;if(n=function(t){var e="";return H(n,function(t,n){e+=n,e+=":",e+=t,e+="\r\n"}),e}(),s(t)){if(e=encodeURIComponent(String(e)),e+=n=null!=n?"="+encodeURIComponent(String(n)):""){if(0>(n=t.indexOf("#"))&&(n=t.length),0>(r=t.indexOf("?"))||r>n){r=n;var i=""}else i=t.substring(r+1,n);n=(t=[t.substr(0,r),i,t.substr(n)])[1],t[1]=e?n?n+"&"+e:e:n,t=t[0]+(t[1]?"?"+t[1]:"")+t[2]}return t}return t.l(e,n),t}function yn(t){this.Bd=22,this.De=0,this.M=[],this.a=new de,this.Ib=new Je,this.na=this.md=this.hb=this.K=this.u=this.Kc=this.aa=this.gb=this.N=this.Rb=this.A=null,this.Te=!0,this.ag=this.Yb=0,this.kf=!!u("internalChannelParams.failFast",t),this.fd=this.Ja=this.wa=this.ia=this.ea=this.i=null,this.Se=!0,this.w=this.he=this.Sb=-1,this.rc=this.Ha=this.La=0,this.Ve=u("internalChannelParams.baseRetryDelayMs",t)||5e3,this.vg=u("internalChannelParams.retryDelaySeedMs",t)||1e4,this.nf=u("internalChannelParams.forwardChannelMaxRetries",t)||2,this.Od=u("internalChannelParams.forwardChannelRequestTimeoutMs",t)||2e4,this.Xa=t&&t.oh||void 0,this.Db=void 0,this.Ra=0,this.gc=t&&t.supportsCrossDomainXhr||!1,this.ra="",this.G=new en(t&&t.concurrentRequestLimit),this.kc=new on,this.ta=!t||void 0===t.backgroundChannelTest||t.backgroundChannelTest,(this.Nd=t&&t.fastHandshake||!1)&&!this.ta&&(this.a.T("Force backgroundChannelTest when fastHandshake is enabled."),this.ta=!0),t&&t.Id&&this.a.Id()}function gn(){}function mn(){if($&&!(10<=Number(ut)))throw Error("Environmental error: no available transport.")}function vn(t,e){Ut.call(this),this.b=new yn(e),this.yb=t,this.Qg=e&&e.testUrl?e.testUrl:function(t){for(var e=arguments[0],n=1;n<arguments.length;n++){var r,i=arguments[n];0==i.lastIndexOf("/",0)?e=i:((r=""==e)||(r=0<=(r=e.length-1)&&e.indexOf("/",r)==r),e=r?e+i:e+"/"+i)}return e}(this.yb,"test"),this.s=he("goog.labs.net.webChannel.WebChannelBaseTransport"),this.Rc=e&&e.messageUrlParams||null,t=e&&e.messageHeaders||null,e&&e.clientProtocolHeaderRequired&&(t?t["X-Client-Protocol"]="webchannel":t={"X-Client-Protocol":"webchannel"}),this.b.ga(t),t=e&&e.initMessageHeaders||null,e&&e.messageContentType&&(t?t["X-WebChannel-Content-Type"]=e.messageContentType:t={"X-WebChannel-Content-Type":e.messageContentType}),e&&e.zd&&(t?t["X-WebChannel-Client-Profile"]=e.zd:t={"X-WebChannel-Client-Profile":e.zd}),this.b.Eg(t),(t=e&&e.httpHeadersOverwriteParam)&&!j(t)&&this.b.Cg(t),this.Og=e&&e.supportsCrossDomainXhr||!1,this.zg=e&&e.sendRawJson||!1,(e=e&&e.httpSessionIdParam)&&!j(e)&&(this.b.Dg(e),null!==(t=this.Rc)&&e in t&&(e in(t=this.Rc)&&delete t[e],(t=this.s)&&t.T("Ignore httpSessionIdParam also specified with messageUrlParams: "+e,void 0))),this.vd=new _n(this)}function bn(t){Oe.call(this);var e=t.__sm__;if(e){t:{for(var n in e){t=n;break t}t=void 0}(this.ne=t)&&(t=this.ne,e=null!==e&&t in e?e[t]:void 0),this.data=e}else this.data=t}function wn(t){De.call(this),this.status=1,this.errorCode=t}function _n(t){this.b=t}(r=un.prototype).Je=function(t){this.Ab=t},r.send=function(t,e,n,r){if(this.c)throw Error("[goog.net.XhrIo] Object is active with another request="+this.Tb+"; newUri="+t);e=e?e.toUpperCase():"GET",this.Tb=t,this.I="",this.Pa=0,this.ge=e,this.Ec=!1,this.ha=!0,this.c=this.df(),this.mc=this.Xa?this.Xa.Vd():Ie.Vd(),this.c.onreadystatechange=b(this.te,this),this.lg&&"onprogress"in this.c&&(this.c.onprogress=b(function(t){this.re(t,!0)},this),this.c.upload&&(this.c.upload.onprogress=b(this.re,this)));try{pe(this.s,this.da("Opening Xhr")),this.Lc=!0,this.c.open(e,String(t),!0),this.Lc=!1}catch(o){return pe(this.s,this.da("Error opening Xhr: "+o.message)),void this.Ld(o)}t=n||"";var i=this.headers.clone();r&&je(r,function(t,e){i.set(e,t)}),r=function(t){t:{for(var e=fn,n=t.length,r=s(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:s(t)?t.charAt(e):t[e]}(i.W()),n=a.FormData&&t instanceof a.FormData,!(0<=O(hn,e))||r||n||i.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8"),i.forEach(function(t,e){this.c.setRequestHeader(e,t)},this),this.Ae&&(this.c.responseType=this.Ae),"withCredentials"in this.c&&this.c.withCredentials!==this.Ab&&(this.c.withCredentials=this.Ab);try{this.yd(),0<this.vb&&(this.jc=function(t){return $&<(9)&&"number"==typeof t.timeout&&void 0!==t.ontimeout}(this.c),pe(this.s,this.da("Will abort after "+this.vb+"ms if incomplete, xhr2 "+this.jc)),this.jc?(this.c.timeout=this.vb,this.c.ontimeout=b(this.Ua,this)):this.hc=Jt(this.Ua,this.vb,this)),pe(this.s,this.da("Sending request")),this.Qb=!0,this.c.send(t),this.Qb=!1}catch(o){pe(this.s,this.da("Send error: "+o.message)),this.Ld(o)}},r.df=function(){return this.Xa?this.Xa.Dd():Ie.Dd()},r.Ua=function(){void 0!==o&&this.c&&(this.I="Timed out after "+this.vb+"ms, aborting",this.Pa=8,pe(this.s,this.da(this.I)),this.dispatchEvent("timeout"),this.abort(8))},r.Ld=function(t){this.ha=!1,this.c&&(this.Aa=!0,this.c.abort(),this.Aa=!1),this.I=t,this.Pa=5,this.Jd(),this.Gb()},r.Jd=function(){this.Ec||(this.Ec=!0,this.dispatchEvent("complete"),this.dispatchEvent("error"))},r.abort=function(t){this.c&&this.ha&&(pe(this.s,this.da("Aborting")),this.ha=!1,this.Aa=!0,this.c.abort(),this.Aa=!1,this.Pa=t||7,this.dispatchEvent("complete"),this.dispatchEvent("abort"),this.Gb())},r.F=function(){this.c&&(this.ha&&(this.ha=!1,this.Aa=!0,this.c.abort(),this.Aa=!1),this.Gb(!0)),un.L.F.call(this)},r.te=function(){this.Ka||(this.Lc||this.Qb||this.Aa?this.se():this.eg())},r.eg=function(){this.se()},r.se=function(){if(this.ha&&void 0!==o)if(this.mc[1]&&4==this.ma()&&2==this.za())pe(this.s,this.da("Local request error detected and ignored"));else if(this.Qb&&4==this.ma())Jt(this.te,0,this);else if(this.dispatchEvent("readystatechange"),this.Mc()){pe(this.s,this.da("Request complete")),this.ha=!1;try{this.Rf()?(this.dispatchEvent("complete"),this.dispatchEvent("success")):(this.Pa=6,this.I=this.Yd()+" ["+this.za()+"]",this.Jd())}finally{this.Gb()}}},r.re=function(t,e){this.dispatchEvent(pn(t,"progress")),this.dispatchEvent(pn(t,e?"downloadprogress":"uploadprogress"))},r.Gb=function(t){if(this.c){this.yd();var e=this.c,n=this.mc[0]?c:null;this.mc=this.c=null,t||this.dispatchEvent("ready");try{e.onreadystatechange=n}catch(r){(t=this.s)&&t.ca("Problem encountered resetting onreadystatechange: "+r.message,void 0)}}},r.yd=function(){this.c&&this.jc&&(this.c.ontimeout=null),this.hc&&(a.clearTimeout(this.hc),this.hc=null)},r.Ba=function(){return!!this.c},r.Mc=function(){return 4==this.ma()},r.Rf=function(){var t=this.za();t:switch(t){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var e=!0;break t;default:e=!1}return e||0===t&&!this.Of()},r.Of=function(){var t=String(this.Tb).match(Ve)[1]||null;return!t&&a.self&&a.self.location&&(t=(t=a.self.location.protocol).substr(0,t.length-1)),ln.test(t?t.toLowerCase():"")},r.ma=function(){return this.c?this.c.readyState:0},r.za=function(){try{return 2<this.ma()?this.c.status:-1}catch(J){return-1}},r.Yd=function(){try{return 2<this.ma()?this.c.statusText:""}catch(J){return pe(this.s,"Can not get status: "+J.message),""}},r.ya=function(){try{return this.c?this.c.responseText:""}catch(J){return pe(this.s,"Can not get responseText: "+J.message),""}},r.yf=function(t){if(this.c){var e=this.c.responseText;return t&&0==e.indexOf(t)&&(e=e.substring(t.length)),sn(e)}},r.getResponseHeader=function(t){if(this.c&&this.Mc())return null===(t=this.c.getResponseHeader(t))?void 0:t},r.getAllResponseHeaders=function(){return this.c&&this.Mc()&&this.c.getAllResponseHeaders()||""},r.kb=function(t){return this.c?this.c.getResponseHeader(t):null},r.Ud=function(){return this.Pa},r.Hc=function(){return s(this.I)?this.I:String(this.I)},r.da=function(t){return t+" ["+this.ge+" "+this.Tb+" "+this.za()+"]"},(r=yn.prototype).tc=8,r.g=1,r.connect=function(t,e,n,r,i){this.a.debug("connect()"),be(0),this.K=e,this.gb=n||{},r&&void 0!==i&&(this.gb.OSID=r,this.gb.OAID=i),this.ta&&(this.a.debug("connect() bypassed channel-test."),this.Ib.$d=[],this.Ib.od=!1),this.bf(t)},r.disconnect=function(){if(this.a.debug("disconnect()"),this.qd(),3==this.g){var t=this.Yb++,e=this.hb.clone();e.l("SID",this.ra),e.l("RID",t),e.l("TYPE","terminate"),this.Ya(e),new Ne(this,this.a,this.ra,t,void 0).yg(e)}this.qe()},r.bf=function(t){this.a.debug("connectTest_()"),this.Ja=new Ye(this,this.a),null===this.N&&this.Ja.ga(this.A);var e=t;this.N&&this.A&&(e=dn(t,this.N,this.A)),this.Ja.connect(e)},r.af=function(){this.a.debug("connectChannel_()"),this.hb=this.Sd(this.K),this.Dc()},r.qd=function(){this.Ja&&(this.Ja.abort(),this.Ja=null),this.u&&(this.u.cancel(),this.u=null),this.ia&&(a.clearTimeout(this.ia),this.ia=null),this.Hb(),this.G.cancel(),this.ea&&(a.clearTimeout(this.ea),this.ea=null)},r.ga=function(t){this.A=t},r.Eg=function(t){this.Rb=t},r.Cg=function(t){this.N=t},r.Dg=function(t){this.aa=t},r.Fe=function(t){this.Kc=t},r.He=function(t){this.Ra=t},r.Hg=function(){this.gc=!0},r.Ee=function(t){this.i=t},r.Nf=function(){return!this.fd},r.Zc=function(t){1e3==this.M.length&&this.a.ca(function(){return"Already have 1000 queued maps upon queueing "+Vt(t)}),this.M.push(new tn(this.ag++,t)),3==this.g&&this.Dc()},r.qf=function(){return this.kf?0:this.nf},r.de=function(){return 0==this.g},r.getState=function(){return this.g},r.Dc=function(){this.G.ee()||this.ea||(this.ea=_e(b(this.we,this),0),this.La=0)},r.Yf=function(t){return this.G.xf()>=this.G.Xb-(this.ea?1:0)?(this.a.ca("Unexpected retry request is scheduled."),!1):this.ea?(this.a.debug("Use the retry request that is already scheduled."),this.M=t.la().concat(this.M),!0):!(1==this.g||2==this.g||this.La>=this.qf()||(this.a.debug("Going to retry POST"),this.ea=_e(b(this.we,this,t),this.Xd(this.La)),this.La++,0))},r.we=function(t){this.ea=null,this.Mg(t)},r.Mg=function(t){this.a.debug("startForwardChannel_"),1==this.g?t?this.a.ca("Not supposed to retry the open"):(this.ig(),this.g=2):3==this.g&&(t?this.le(t):0==this.M.length?this.a.debug("startForwardChannel_ returned: nothing to send"):this.G.ee()?this.a.ca("startForwardChannel_ returned: connection already in progress"):(this.le(),this.a.debug("startForwardChannel_ finished, sent request")))},r.ig=function(){this.a.debug("open_()"),this.Yb=Math.floor(1e5*Math.random());var t=this.Yb++,e=new Ne(this,this.a,"",t,void 0),n=this.A;this.Rb&&(n?Q(n=K(n),this.Rb):n=this.Rb),null===this.N&&e.ga(n);var r=this.Hd(e),i=this.hb.clone();i.l("RID",t),0<this.Bd&&i.l("CVER",this.Bd),this.ta&&this.aa&&i.l("X-HTTP-Session-Id",this.aa),this.Ya(i),this.N&&n&&dn(i,this.N,n),this.G.oc(e),this.Nd?(i.l("$req",r),i.l("SID","null"),e.Ag(),e.kd(i,null)):e.kd(i,r)},r.le=function(t){var e=t?t.R:this.Yb++,n=this.hb.clone();n.l("SID",this.ra),n.l("RID",e),n.l("AID",this.Sb),this.Ya(n),this.N&&this.A&&dn(n,this.N,this.A),e=new Ne(this,this.a,this.ra,e,this.La+1),null===this.N&&e.ga(this.A),t&&this.sg(t),t=this.Hd(e),e.setTimeout(Math.round(.5*this.Od)+Math.round(.5*this.Od*Math.random())),this.G.oc(e),e.kd(n,t)},r.Ya=function(t){this.i&&je({},function(e,n){t.l(n,e)})},r.Hd=function(t){var e=Math.min(this.M.length,1e3),n=this.i?b(this.i.Ue,this.i,this):null;return n=this.kc.jf(this.M,e,n),t.Gg(this.M.splice(0,e)),n},r.sg=function(t){this.M=t.la().concat(this.M)},r.Kd=function(){if(!this.u&&!this.ia){this.rc=1;var t=this.ve;Ht||function(){if(a.Promise&&a.Promise.resolve){var t=a.Promise.resolve(void 0);Ht=function(){t.then(Xt)}}else Ht=function(){var t=Xt;!p(a.setImmediate)||a.Window&&a.Window.prototype&&!B("Edge")&&a.Window.prototype.setImmediate==a.setImmediate?(Bt||(Bt=function(){var t=a.MessageChannel;if(void 0===t&&"undefined"!=typeof window&&window.postMessage&&window.addEventListener&&!B("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).open(),t.write(""),t.close();var n="callImmediate"+Math.random(),r="file:"==e.location.protocol?"*":e.location.protocol+"//"+e.location.host;t=b(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)}}}),void 0!==t&&!B("Trident")&&!B("MSIE")){var e=new t,n={},r=n;return e.port1.onmessage=function(){if(void 0!==n.next){var t=(n=n.next).rd;n.rd=null,t()}},function(t){r.next={rd:t},r=r.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){a.setTimeout(t,0)}}()),Bt(t)):a.setImmediate(t)}}(),Gt||(Ht(),Gt=!0),Qt.add(t,this),this.Ha=0}},r.Qc=function(){return this.u||this.ia?(this.a.ca("Request already in progress"),!1):!(3<=this.Ha||(this.a.debug("Going to retry GET"),this.rc++,this.ia=_e(b(this.ve,this),this.Xd(this.Ha)),this.Ha++,0))},r.ve=function(){this.ia=null,this.Kg()},r.Kg=function(){this.a.debug("Creating new HttpRequest"),this.u=new Ne(this,this.a,this.ra,"rpc",this.rc),null===this.N&&this.u.ga(this.A),this.u.He(this.Ra);var t=this.md.clone();t.l("RID","rpc"),t.l("SID",this.ra),t.l("CI",this.fd?"0":"1"),t.l("AID",this.Sb),this.Ya(t),t.l("TYPE","xmlhttp"),this.N&&this.A&&dn(t,this.N,this.A),this.Db&&this.u.setTimeout(this.Db),this.u.jd(t,!0,this.na),this.a.debug("New Request created")},r.ub=function(t,e){this.a.debug("Test Connection Finished");var n=t.Ad;n&&this.G.ld(n),this.fd=this.Se&&e,this.w=t.w,this.af()},r.dd=function(t){this.a.debug("Test Connection Failed"),this.w=t.w,this.sa(2)},r.ue=function(t,e){if(0!=this.g&&(this.u==t||this.G.Jc(t)))if(this.w=t.w,!t.lb&&this.G.Jc(t)&&3==this.g){try{var n=this.kc.zc(e)}catch(r){n=null}h(n)&&3==n.length?this.Cf(n,t):(this.a.debug("Bad POST response data returned"),this.sa(11))}else(t.lb||this.u==t)&&this.Hb(),j(e)||(n=this.kc.zc(e),this.dg(n,t))},r.Cf=function(t,e){0==t[0]?this.Bf(e):(this.he=t[1],0<(e=this.he-this.Sb)&&(this.a.debug((t=t[2])+" bytes (in "+e+" arrays) are outstanding on the BackChannel"),this.Jg(t)&&!this.wa&&(this.wa=_e(b(this.bg,this),6e3))))},r.Bf=function(t){if(this.a.debug("Server claims our backchannel is missing."),this.ia)this.a.debug("But we are currently starting the request.");else{if(this.u){if(!(this.u.qb+3e3<t.qb))return;this.Hb(),this.u.cancel(),this.u=null}else this.a.T("We do not have a BackChannel established");this.Qc(),be(18)}},r.Jg=function(t){return 37500>t&&!this.Nf()&&0==this.Ha},r.$a=function(t){return this.Te?this.i?this.i.$a(t):t:null},r.bg=function(){null!=this.wa&&(this.wa=null,this.u.cancel(),this.u=null,this.Qc(),be(19))},r.Hb=function(){null!=this.wa&&(a.clearTimeout(this.wa),this.wa=null)},r.Tc=function(t){this.a.debug("Request complete");var e=null;if(this.u==t){this.Hb(),this.u=null;var n=2}else{if(!this.G.Jc(t))return;e=t.la(),this.G.ze(t),n=1}if(this.w=t.w,0!=this.g)if(t.S)1==n?(function(t,e,n){ye.dispatchEvent(new we(ye,t,e,n))}(t.Da?t.Da.length:0,_()-t.qb,this.La),this.Dc()):this.Kd();else{var r=t.Hc();if(3==r||0==r&&0<this.w)this.a.debug("Not retrying due to error type");else{var i=this;if(this.a.debug(function(){return"Maybe retrying, last error: "+function(t,e){switch(r){case 0:return"Non-200 return code ("+e+")";case 1:return"XMLHTTP failure (no data)";case 2:return"HttpConnection timeout";default:return"Unknown error"}}(0,i.w)}),1==n&&this.Yf(t)||2==n&&this.Qc())return;this.a.debug("Exceeded max number of retries")}switch(e&&0<e.length&&this.G.Re(e),this.a.debug("Error: HTTP request failed"),r){case 1:this.sa(5);break;case 4:this.sa(10);break;case 3:this.sa(6);break;default:this.sa(2)}}},r.Xd=function(t){var e=this.Ve+Math.floor(Math.random()*this.vg);return this.Ba()||(this.a.debug("Inactive channel"),e*=2),e*t},r.pc=function(t){if(this.ta&&(t=t.h)){var e=t.kb("X-Client-Wire-Protocol");e&&this.G.ld(e),this.aa&&((t=t.kb("X-HTTP-Session-Id"))?(this.Fe(t),this.hb.l(this.aa,t)):this.a.T("Missing X_HTTP_SESSION_ID in the handshake response"))}},r.dg=function(t,e){for(var n=this.i&&this.i.sc?[]:null,r=0;r<t.length;r++){var i=t[r];if(this.Sb=i[0],i=i[1],2==this.g)if("c"==i[0]){this.ra=i[1],this.na=this.$a(i[2]);var o=i[3];null!=o&&(this.tc=o,this.a.info("VER="+this.tc)),null!=(o=i[4])&&(this.De=o,this.a.info("SVER="+this.De)),null!=(i=i[5])&&"number"==typeof i&&0<i&&(this.Db=i*=1.5,this.a.info("backChannelRequestTimeoutMs_="+i)),this.pc(e),this.g=3,this.i&&this.i.wd(),this.Lg(e)}else"stop"!=i[0]&&"close"!=i[0]||this.sa(7);else 3==this.g&&("stop"==i[0]||"close"==i[0]?(n&&0!=n.length&&(this.i.sc(this,n),n.length=0),"stop"==i[0]?this.sa(7):this.disconnect()):"noop"!=i[0]&&(n?n.push(i):this.i&&this.i.ud(i)),this.Ha=0)}n&&0!=n.length&&this.i.sc(this,n)},r.Lg=function(t){this.md=this.Pd(this.na,this.K),t.lb?(this.a.debug("Upgrade the handshake request to a backchannel."),this.G.ze(t),t.tg(this.Db),this.u=t):this.Kd()},r.sa=function(t){if(this.a.info("Error code "+t),2==t){var e=null;this.i&&(e=null);var n=b(this.Pg,this);e||(e=new Fe("//www.google.com/images/cleardot.gif"),a.location&&"http"==a.location.protocol||e.tb("https"),e.Ub()),function(t,e){var n=new de;n.debug("TestLoadImage: loading "+t);var r=new Image;r.onload=w(an,n,r,"TestLoadImage: loaded",!0,e),r.onerror=w(an,n,r,"TestLoadImage: error",!1,e),r.onabort=w(an,n,r,"TestLoadImage: abort",!1,e),r.ontimeout=w(an,n,r,"TestLoadImage: timeout",!1,e),a.setTimeout(function(){r.ontimeout&&r.ontimeout()},1e4),r.src=t}(e.toString(),n)}else be(2);this.cg(t)},r.Pg=function(t){t?(this.a.info("Successfully pinged google.com"),be(2)):(this.a.info("Failed to ping google.com"),be(1))},r.cg=function(t){this.a.debug("HttpChannel: error - "+t),this.g=0,this.i&&this.i.td(t),this.qe(),this.qd()},r.qe=function(){if(this.g=0,this.w=-1,this.i){var t=this.G.la();if(0!=t.length||0!=this.M.length){var e=this;this.a.debug(function(){return"Number of undelivered maps, pending: "+t.length+", outgoing: "+e.M.length}),this.G.$e(),M(this.M),this.M.length=0}this.i.sd()}},r.Sd=function(t){return t=this.Cd(null,t),this.a.debug("GetForwardChannelUri: "+t),t},r.Pd=function(t,e){return t=this.Cd(this.fc()?t:null,e),this.a.debug("GetBackChannelUri: "+t),t},r.Cd=function(t,e){var n=function(t){return t instanceof Fe?t.clone():new Fe(t,void 0)}(e);if(""!=n.xa)t&&n.rb(t+"."+n.xa),n.sb(n.Ca);else{var r=a.location;n=function(t,e,n,r){var i=new Fe(null,void 0);return t&&i.tb(t),e&&i.rb(e),n&&i.sb(n),r&&i.ec(r),i}(r.protocol,t?t+"."+r.hostname:r.hostname,+r.port,e)}return this.gb&&H(this.gb,function(t,e){n.l(e,t)}),e=this.Kc,(t=this.aa)&&e&&n.l(t,e),n.l("VER",this.tc),this.Ya(n),n},r.Jb=function(t){if(t&&!this.gc)throw Error("Can't create secondary domain capable XhrIo object.");return(t=new un(this.Xa)).Je(this.gc),t},r.Ba=function(){return!!this.i&&this.i.Ba()},r.fc=function(){return this.gc},(r=gn.prototype).sc=null,r.wd=function(){},r.ud=function(){},r.td=function(){},r.sd=function(){},r.Ba=function(){return!0},r.Ue=function(){},r.$a=function(t){return t},mn.prototype.cf=function(t,e){return new vn(t,e)},S(vn,Ut),(r=vn.prototype).addEventListener=function(t,e,n,r){vn.L.addEventListener.call(this,t,e,n,r)},r.removeEventListener=function(t,e,n,r){vn.L.removeEventListener.call(this,t,e,n,r)},r.open=function(){this.b.Ee(this.vd),this.Og&&this.b.Hg(),this.b.connect(this.Qg,this.yb,this.Rc||void 0)},r.close=function(){this.b.disconnect()},r.send=function(t){if(s(t)){var e={};e.__data__=t,this.b.Zc(e)}else this.zg?((e={}).__data__=Vt(t),this.b.Zc(e)):this.b.Zc(t)},r.F=function(){this.b.Ee(null),delete this.vd,this.b.disconnect(),delete this.b,vn.L.F.call(this)},S(bn,Oe),S(wn,De),S(_n,gn),_n.prototype.wd=function(){fe(this.b.s,"WebChannel opened on "+this.b.yb),this.b.dispatchEvent("a")},_n.prototype.ud=function(t){this.b.dispatchEvent(new bn(t))},_n.prototype.td=function(t){fe(this.b.s,"WebChannel aborted on "+this.b.yb+" due to channel error: "+t),this.b.dispatchEvent(new wn(t))},_n.prototype.sd=function(){fe(this.b.s,"WebChannel closed on "+this.b.yb),this.b.dispatchEvent("b")};var Sn=w(function(t,e){function n(){}n.prototype=t.prototype;var r=new n;return t.apply(r,Array.prototype.slice.call(arguments,1)),r},mn);function En(){this.V=[],this.Z=[]}function Tn(t,e){if(C.call(this),this.oe=t||0,this.Wb=e||10,this.oe>this.Wb)throw Error(Cn);this.fa=new En,this.oa=new Ze,this.Ac=0,this.Nc=null,this.Cb()}(r=En.prototype).Vf=function(){0==this.V.length&&(this.V=this.Z,this.V.reverse(),this.Z=[])},r.enqueue=function(t){this.Z.push(t)},r.ab=function(){return this.Vf(),this.V.pop()},r.C=function(){return this.V.length+this.Z.length},r.X=function(){return 0==this.V.length&&0==this.Z.length},r.clear=function(){this.V=[],this.Z=[]},r.contains=function(t){return 0<=O(this.V,t)||0<=O(this.Z,t)},r.remove=function(t){var e=this.V,n=D(e,t);return 0<=n?(Array.prototype.splice.call(e,n,1),e=!0):e=!1,e||R(this.Z,t)},r.H=function(){for(var t=[],e=this.V.length-1;0<=e;--e)t.push(this.V[e]);var n=this.Z.length;for(e=0;e<n;++e)t.push(this.Z[e]);return t},S(Tn,C);var Cn="[goog.structs.Pool] Min can not be greater than max";function In(t,e){this.fe=t,this.gd=e}function An(t){this.Y=[],t&&this.Lf(t)}function On(){An.call(this)}function Dn(t,e){this.Gd=void 0,this.cc=new On,Tn.call(this,t,e)}function kn(t,e,n,r){this.Jf=t,this.Ab=!!r,Dn.call(this,e,n)}(r=Tn.prototype).Mb=function(){var t=_();if(!(null!=this.Nc&&t-this.Nc<this.Ac)){var e=this.qg();return e&&(this.Nc=t,this.oa.add(e)),e}},r.og=function(t){return!!this.oa.remove(t)&&(this.nc(t),!0)},r.qg=function(){for(var t;0<this.Td()&&(t=this.fa.ab(),!this.Sc(t));)this.Cb();return!t&&this.C()<this.Wb&&(t=this.xc()),t},r.nc=function(t){this.oa.remove(t),this.Sc(t)&&this.C()<this.Wb?this.fa.enqueue(t):this.Bc(t)},r.Cb=function(){for(var t=this.fa;this.C()<this.oe;)t.enqueue(this.xc());for(;this.C()>this.Wb&&0<this.Td();)this.Bc(t.ab())},r.xc=function(){return{}},r.Bc=function(t){if("function"==typeof t.bb)t.bb();else for(var e in t)t[e]=null},r.Sc=function(t){return"function"!=typeof t.Ye||t.Ye()},r.contains=function(t){return this.fa.contains(t)||this.oa.contains(t)},r.C=function(){return this.fa.C()+this.oa.C()},r.rf=function(){return this.oa.C()},r.Td=function(){return this.fa.C()},r.X=function(){return this.fa.X()&&this.oa.X()},r.F=function(){if(Tn.L.F.call(this),0<this.rf())throw Error("[goog.structs.Pool] Objects not released");delete this.oa;for(var t=this.fa;!t.X();)this.Bc(t.ab());delete this.fa},In.prototype.getKey=function(){return this.fe},In.prototype.clone=function(){return new In(this.fe,this.gd)},(r=An.prototype).ce=function(t,e){var n=this.Y;n.push(new In(t,e)),this.$f(n.length-1)},r.Lf=function(t){if(t instanceof An){var e=t.W();if(t=t.H(),0>=this.C()){for(var n=this.Y,r=0;r<e.length;r++)n.push(new In(e[r],t[r]));return}}else e=W(t),t=z(t);for(r=0;r<e.length;r++)this.ce(e[r],t[r])},r.remove=function(){var t=this.Y,e=t.length,n=t[0];if(!(0>=e))return 1==e?P(t):(t[0]=t.pop(),this.Zf()),n.gd},r.Zf=function(){for(var t=0,e=this.Y,n=e.length,r=e[t];t<n>>1;){var i=this.tf(t),o=this.zf(t);if(i=o<n&&e[o].getKey()<e[i].getKey()?o:i,e[i].getKey()>r.getKey())break;e[t]=e[i],t=i}e[t]=r},r.$f=function(t){for(var e=this.Y,n=e[t];0<t;){var r=this.wf(t);if(!(e[r].getKey()>n.getKey()))break;e[t]=e[r],t=r}e[t]=n},r.tf=function(t){return 2*t+1},r.zf=function(t){return 2*t+2},r.wf=function(t){return t-1>>1},r.H=function(){for(var t=this.Y,e=[],n=t.length,r=0;r<n;r++)e.push(t[r].gd);return e},r.W=function(){for(var t=this.Y,e=[],n=t.length,r=0;r<n;r++)e.push(t[r].getKey());return e},r.va=function(t){return N(this.Y,function(e){return e.getKey()==t})},r.clone=function(){return new An(this)},r.C=function(){return this.Y.length},r.X=function(){return 0==this.Y.length},r.clear=function(){P(this.Y)},S(On,An),On.prototype.enqueue=function(t,e){this.ce(t,e)},On.prototype.ab=function(){return this.remove()},S(Dn,Tn),(r=Dn.prototype).Mb=function(t,e){if(!t)return(t=Dn.L.Mb.call(this))&&this.Ac&&(this.Gd=a.setTimeout(b(this.Nb,this),this.Ac)),t;this.cc.enqueue(void 0!==e?e:100,t),this.Nb()},r.Nb=function(){for(var t=this.cc;0<t.C();){var e=this.Mb();if(!e)break;t.ab().apply(this,[e])}},r.nc=function(t){Dn.L.nc.call(this,t),this.Nb()},r.Cb=function(){Dn.L.Cb.call(this),this.Nb()},r.F=function(){Dn.L.F.call(this),a.clearTimeout(this.Gd),this.cc.clear(),this.cc=null},S(kn,Dn),kn.prototype.xc=function(){var t=new un,e=this.Jf;return e&&e.forEach(function(e,n){t.headers.set(n,e)}),this.Ab&&t.Je(!0),t},kn.prototype.Sc=function(t){return!t.Ka&&!t.Ba()},mn.prototype.createWebChannel=mn.prototype.cf,vn.prototype.send=vn.prototype.send,vn.prototype.open=vn.prototype.open,vn.prototype.close=vn.prototype.close,Se.NO_ERROR=0,Se.TIMEOUT=8,Se.HTTP_ERROR=6,Ee.COMPLETE="complete",Ce.EventType=Ae,Ae.OPEN="a",Ae.CLOSE="b",Ae.ERROR="c",Ae.MESSAGE="d",Ut.prototype.listen=Ut.prototype.nb,kn.prototype.getObject=kn.prototype.Mb,kn.prototype.releaseObject=kn.prototype.og,un.prototype.listenOnce=un.prototype.Oc,un.prototype.getLastError=un.prototype.Hc,un.prototype.getLastErrorCode=un.prototype.Ud,un.prototype.getStatus=un.prototype.za,un.prototype.getStatusText=un.prototype.Yd,un.prototype.getResponseJson=un.prototype.yf,un.prototype.getResponseText=un.prototype.ya,un.prototype.getResponseText=un.prototype.ya,un.prototype.send=un.prototype.send;var Nn={createWebChannelTransport:Sn,ErrorCode:Se,EventType:Ee,WebChannel:Ce,XhrIoPool:kn},Pn=Nn.createWebChannelTransport,Rn=Nn.ErrorCode,xn=Nn.EventType,Mn=Nn.WebChannel,jn=Nn.XhrIoPool;e.default=Nn},xTla:function(t,e,n){"use strict";n.d(e,"a",function(){return r});var r="function"==typeof Symbol&&Symbol.observable||"@@observable"},y3By:function(t,e,n){"use strict";n.d(e,"a",function(){return i}),n.d(e,"b",function(){return o});var r=n("+umK");function i(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return o(t)}function o(t){return t?1===t.length?t[0]:function(e){return t.reduce(function(t,e){return e(t)},e)}:r.a}},zUnb:function(t,e,n){"use strict";n.r(e);var r=n("CcnG"),i=function(){return function(){}}(),o=function(){return function(){this.title="poly"}}(),a=n("mrSG"),s=n("F/XL"),u=n("0/uQ"),c=n("K9Ia"),l=n("8g8A"),h=function(t){function e(e){var n=t.call(this)||this;return n._value=e,n}return a.c(e,t),Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0}),e.prototype._subscribe=function(e){var n=t.prototype._subscribe.call(this,e);return n&&!n.closed&&e.next(this._value),n},e.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(this.closed)throw new l.a;return this._value},e.prototype.next=function(e){t.prototype.next.call(this,this._value=e)},e}(c.a),f=n("6blF");function p(){return Error.call(this),this.message="no elements in sequence",this.name="EmptyError",this}p.prototype=Object.create(Error.prototype);var d=p,y=n("nkY7"),g=n("isby"),m=n("MGBS"),v=n("zotm"),b=n("IUTb"),w={},_=function(){function t(t){this.resultSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new S(t,this.resultSelector))},t}(),S=function(t){function e(e,n){var r=t.call(this,e)||this;return r.resultSelector=n,r.active=0,r.values=[],r.observables=[],r}return a.c(e,t),e.prototype._next=function(t){this.values.push(w),this.observables.push(t)},e.prototype._complete=function(){var t=this.observables,e=t.length;if(0===e)this.destination.complete();else{this.active=e,this.toRespond=e;for(var n=0;n<e;n++){var r=t[n];this.add(Object(v.a)(this,r,r,n))}}},e.prototype.notifyComplete=function(t){0==(this.active-=1)&&this.destination.complete()},e.prototype.notifyNext=function(t,e,n,r,i){var o=this.values,a=this.toRespond?o[n]===w?--this.toRespond:this.toRespond:0;o[n]=e,0===a&&(this.resultSelector?this._tryResultSelector(o):this.destination.next(o.slice()))},e.prototype._tryResultSelector=function(t){var e;try{e=this.resultSelector.apply(this,t)}catch(n){return void this.destination.error(n)}this.destination.next(e)},e}(m.a),E=n("G5J1");function T(t){return new f.a(function(e){var n;try{n=t()}catch(r){return void e.error(r)}return(n?Object(u.a)(n):Object(E.b)()).subscribe(e)})}var C=n("67Y/"),I=n("Zn8D");function A(){return Object(I.a)(1)}var O=n("VnD/"),D=n("FFOo");function k(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}k.prototype=Object.create(Error.prototype);var N=k;function P(t){return function(e){return 0===t?Object(E.b)():e.lift(new R(t))}}var R=function(){function t(t){if(this.total=t,this.total<0)throw new N}return t.prototype.call=function(t,e){return e.subscribe(new x(t,this.total))},t}(),x=function(t){function e(e,n){var r=t.call(this,e)||this;return r.total=n,r.ring=new Array,r.count=0,r}return a.c(e,t),e.prototype._next=function(t){var e=this.ring,n=this.total,r=this.count++;e.length<n?e.push(t):e[r%n]=t},e.prototype._complete=function(){var t=this.destination,e=this.count;if(e>0)for(var n=this.count>=this.total?this.total:this.count,r=this.ring,i=0;i<n;i++){var o=e++%n;t.next(r[o])}t.complete()},e}(D.a),M=n("+umK"),j=n("2Bdj");function L(t,e,n){return function(r){return r.lift(new U(t,e,n))}}var U=function(){function t(t,e,n){this.nextOrObserver=t,this.error=e,this.complete=n}return t.prototype.call=function(t,e){return e.subscribe(new V(t,this.nextOrObserver,this.error,this.complete))},t}(),V=function(t){function e(e,n,r,i){var o=t.call(this,e)||this;return o._tapNext=M.a,o._tapError=M.a,o._tapComplete=M.a,o._tapError=r||M.a,o._tapComplete=i||M.a,Object(j.a)(n)?(o._context=o,o._tapNext=n):n&&(o._context=n,o._tapNext=n.next||M.a,o._tapError=n.error||M.a,o._tapComplete=n.complete||M.a),o}return a.c(e,t),e.prototype._next=function(t){try{this._tapNext.call(this._context,t)}catch(e){return void this.destination.error(e)}this.destination.next(t)},e.prototype._error=function(t){try{this._tapError.call(this._context,t)}catch(t){return void this.destination.error(t)}this.destination.error(t)},e.prototype._complete=function(){try{this._tapComplete.call(this._context)}catch(t){return void this.destination.error(t)}return this.destination.complete()},e}(D.a),F=function(t){return void 0===t&&(t=q),L({hasValue:!1,next:function(){this.hasValue=!0},complete:function(){if(!this.hasValue)throw t()}})};function q(){return new d}function B(t){return void 0===t&&(t=null),function(e){return e.lift(new H(t))}}var H=function(){function t(t){this.defaultValue=t}return t.prototype.call=function(t,e){return e.subscribe(new z(t,this.defaultValue))},t}(),z=function(t){function e(e,n){var r=t.call(this,e)||this;return r.defaultValue=n,r.isEmpty=!0,r}return a.c(e,t),e.prototype._next=function(t){this.isEmpty=!1,this.destination.next(t)},e.prototype._complete=function(){this.isEmpty&&this.destination.next(this.defaultValue),this.destination.complete()},e}(D.a),W=n("mChF");function K(t,e){var n=arguments.length>=2;return function(r){return r.pipe(t?Object(O.a)(function(e,n){return t(e,n,r)}):W.a,P(1),n?B(e):F(function(){return new d}))}}var G=n("rPjj");function Q(t){return function(e){var n=new X(t),r=e.lift(n);return n.caught=r}}var X=function(){function t(t){this.selector=t}return t.prototype.call=function(t,e){return e.subscribe(new Y(t,this.selector,this.caught))},t}(),Y=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.selector=n,i.caught=r,i}return a.c(e,t),e.prototype.error=function(e){if(!this.isStopped){var n=void 0;try{n=this.selector(e,this.caught)}catch(i){return void t.prototype.error.call(this,i)}this._unsubscribeAndRecycle();var r=new G.a(this,void 0,void 0);this.add(r),Object(v.a)(this,n,void 0,void 0,r)}},e}(m.a);function J(t){return function(e){return 0===t?Object(E.b)():e.lift(new Z(t))}}var Z=function(){function t(t){if(this.total=t,this.total<0)throw new N}return t.prototype.call=function(t,e){return e.subscribe(new $(t,this.total))},t}(),$=function(t){function e(e,n){var r=t.call(this,e)||this;return r.total=n,r.count=0,r}return a.c(e,t),e.prototype._next=function(t){var e=this.total,n=++this.count;n<=e&&(this.destination.next(t),n===e&&(this.destination.complete(),this.unsubscribe()))},e}(D.a);function tt(t,e){var n=arguments.length>=2;return function(r){return r.pipe(t?Object(O.a)(function(e,n){return t(e,n,r)}):W.a,J(1),n?B(e):F(function(){return new d}))}}var et=n("psW0"),nt=function(){function t(t,e,n){this.predicate=t,this.thisArg=e,this.source=n}return t.prototype.call=function(t,e){return e.subscribe(new rt(t,this.predicate,this.thisArg,this.source))},t}(),rt=function(t){function e(e,n,r,i){var o=t.call(this,e)||this;return o.predicate=n,o.thisArg=r,o.source=i,o.index=0,o.thisArg=r||o,o}return a.c(e,t),e.prototype.notifyComplete=function(t){this.destination.next(t),this.destination.complete()},e.prototype._next=function(t){var e=!1;try{e=this.predicate.call(this.thisArg,t,this.index++,this.source)}catch(n){return void this.destination.error(n)}e||this.notifyComplete(!1)},e.prototype._complete=function(){this.notifyComplete(!0)},e}(D.a),it=n("15JJ"),ot=n("PU8L"),at=n("dC0D");function st(t,e){return Object(et.a)(t,e,1)}var ut=n("y3By"),ct=n("pugT"),lt=function(){function t(t){this.callback=t}return t.prototype.call=function(t,e){return e.subscribe(new ht(t,this.callback))},t}(),ht=function(t){function e(e,n){var r=t.call(this,e)||this;return r.add(new ct.a(n)),r}return a.c(e,t),e}(D.a),ft=n("Ip0R"),pt=null;function dt(){return pt}var yt,gt={class:"className",innerHtml:"innerHTML",readonly:"readOnly",tabindex:"tabIndex"},mt={"\b":"Backspace","\t":"Tab","\x7f":"Delete","\x1b":"Escape",Del:"Delete",Esc:"Escape",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown",Menu:"ContextMenu",Scroll:"ScrollLock",Win:"OS"},vt={A:"1",B:"2",C:"3",D:"4",E:"5",F:"6",G:"7",H:"8",I:"9",J:"*",K:"+",M:"-",N:".",O:"/","`":"0","\x90":"NumLock"};r.qb.Node&&(yt=r.qb.Node.prototype.contains||function(t){return!!(16&this.compareDocumentPosition(t))});var bt,wt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(a.c)(e,t),e.prototype.parse=function(t){throw new Error("parse not implemented")},e.makeCurrent=function(){var t;t=new e,pt||(pt=t)},e.prototype.hasProperty=function(t,e){return e in t},e.prototype.setProperty=function(t,e,n){t[e]=n},e.prototype.getProperty=function(t,e){return t[e]},e.prototype.invoke=function(t,e,n){var r;(r=t)[e].apply(r,Object(a.g)(n))},e.prototype.logError=function(t){window.console&&(console.error?console.error(t):console.log(t))},e.prototype.log=function(t){window.console&&window.console.log&&window.console.log(t)},e.prototype.logGroup=function(t){window.console&&window.console.group&&window.console.group(t)},e.prototype.logGroupEnd=function(){window.console&&window.console.groupEnd&&window.console.groupEnd()},Object.defineProperty(e.prototype,"attrToPropMap",{get:function(){return gt},enumerable:!0,configurable:!0}),e.prototype.contains=function(t,e){return yt.call(t,e)},e.prototype.querySelector=function(t,e){return t.querySelector(e)},e.prototype.querySelectorAll=function(t,e){return t.querySelectorAll(e)},e.prototype.on=function(t,e,n){t.addEventListener(e,n,!1)},e.prototype.onAndCancel=function(t,e,n){return t.addEventListener(e,n,!1),function(){t.removeEventListener(e,n,!1)}},e.prototype.dispatchEvent=function(t,e){t.dispatchEvent(e)},e.prototype.createMouseEvent=function(t){var e=this.getDefaultDocument().createEvent("MouseEvent");return e.initEvent(t,!0,!0),e},e.prototype.createEvent=function(t){var e=this.getDefaultDocument().createEvent("Event");return e.initEvent(t,!0,!0),e},e.prototype.preventDefault=function(t){t.preventDefault(),t.returnValue=!1},e.prototype.isPrevented=function(t){return t.defaultPrevented||null!=t.returnValue&&!t.returnValue},e.prototype.getInnerHTML=function(t){return t.innerHTML},e.prototype.getTemplateContent=function(t){return"content"in t&&this.isTemplateElement(t)?t.content:null},e.prototype.getOuterHTML=function(t){return t.outerHTML},e.prototype.nodeName=function(t){return t.nodeName},e.prototype.nodeValue=function(t){return t.nodeValue},e.prototype.type=function(t){return t.type},e.prototype.content=function(t){return this.hasProperty(t,"content")?t.content:t},e.prototype.firstChild=function(t){return t.firstChild},e.prototype.nextSibling=function(t){return t.nextSibling},e.prototype.parentElement=function(t){return t.parentNode},e.prototype.childNodes=function(t){return t.childNodes},e.prototype.childNodesAsList=function(t){for(var e=t.childNodes,n=new Array(e.length),r=0;r<e.length;r++)n[r]=e[r];return n},e.prototype.clearNodes=function(t){for(;t.firstChild;)t.removeChild(t.firstChild)},e.prototype.appendChild=function(t,e){t.appendChild(e)},e.prototype.removeChild=function(t,e){t.removeChild(e)},e.prototype.replaceChild=function(t,e,n){t.replaceChild(e,n)},e.prototype.remove=function(t){return t.parentNode&&t.parentNode.removeChild(t),t},e.prototype.insertBefore=function(t,e,n){t.insertBefore(n,e)},e.prototype.insertAllBefore=function(t,e,n){n.forEach(function(n){return t.insertBefore(n,e)})},e.prototype.insertAfter=function(t,e,n){t.insertBefore(n,e.nextSibling)},e.prototype.setInnerHTML=function(t,e){t.innerHTML=e},e.prototype.getText=function(t){return t.textContent},e.prototype.setText=function(t,e){t.textContent=e},e.prototype.getValue=function(t){return t.value},e.prototype.setValue=function(t,e){t.value=e},e.prototype.getChecked=function(t){return t.checked},e.prototype.setChecked=function(t,e){t.checked=e},e.prototype.createComment=function(t){return this.getDefaultDocument().createComment(t)},e.prototype.createTemplate=function(t){var e=this.getDefaultDocument().createElement("template");return e.innerHTML=t,e},e.prototype.createElement=function(t,e){return(e=e||this.getDefaultDocument()).createElement(t)},e.prototype.createElementNS=function(t,e,n){return(n=n||this.getDefaultDocument()).createElementNS(t,e)},e.prototype.createTextNode=function(t,e){return(e=e||this.getDefaultDocument()).createTextNode(t)},e.prototype.createScriptTag=function(t,e,n){var r=(n=n||this.getDefaultDocument()).createElement("SCRIPT");return r.setAttribute(t,e),r},e.prototype.createStyleElement=function(t,e){var n=(e=e||this.getDefaultDocument()).createElement("style");return this.appendChild(n,this.createTextNode(t,e)),n},e.prototype.createShadowRoot=function(t){return t.createShadowRoot()},e.prototype.getShadowRoot=function(t){return t.shadowRoot},e.prototype.getHost=function(t){return t.host},e.prototype.clone=function(t){return t.cloneNode(!0)},e.prototype.getElementsByClassName=function(t,e){return t.getElementsByClassName(e)},e.prototype.getElementsByTagName=function(t,e){return t.getElementsByTagName(e)},e.prototype.classList=function(t){return Array.prototype.slice.call(t.classList,0)},e.prototype.addClass=function(t,e){t.classList.add(e)},e.prototype.removeClass=function(t,e){t.classList.remove(e)},e.prototype.hasClass=function(t,e){return t.classList.contains(e)},e.prototype.setStyle=function(t,e,n){t.style[e]=n},e.prototype.removeStyle=function(t,e){t.style[e]=""},e.prototype.getStyle=function(t,e){return t.style[e]},e.prototype.hasStyle=function(t,e,n){var r=this.getStyle(t,e)||"";return n?r==n:r.length>0},e.prototype.tagName=function(t){return t.tagName},e.prototype.attributeMap=function(t){for(var e=new Map,n=t.attributes,r=0;r<n.length;r++){var i=n.item(r);e.set(i.name,i.value)}return e},e.prototype.hasAttribute=function(t,e){return t.hasAttribute(e)},e.prototype.hasAttributeNS=function(t,e,n){return t.hasAttributeNS(e,n)},e.prototype.getAttribute=function(t,e){return t.getAttribute(e)},e.prototype.getAttributeNS=function(t,e,n){return t.getAttributeNS(e,n)},e.prototype.setAttribute=function(t,e,n){t.setAttribute(e,n)},e.prototype.setAttributeNS=function(t,e,n,r){t.setAttributeNS(e,n,r)},e.prototype.removeAttribute=function(t,e){t.removeAttribute(e)},e.prototype.removeAttributeNS=function(t,e,n){t.removeAttributeNS(e,n)},e.prototype.templateAwareRoot=function(t){return this.isTemplateElement(t)?this.content(t):t},e.prototype.createHtmlDocument=function(){return document.implementation.createHTMLDocument("fakeTitle")},e.prototype.getDefaultDocument=function(){return document},e.prototype.getBoundingClientRect=function(t){try{return t.getBoundingClientRect()}catch(e){return{top:0,bottom:0,left:0,right:0,width:0,height:0}}},e.prototype.getTitle=function(t){return t.title},e.prototype.setTitle=function(t,e){t.title=e||""},e.prototype.elementMatches=function(t,e){return!!this.isElementNode(t)&&(t.matches&&t.matches(e)||t.msMatchesSelector&&t.msMatchesSelector(e)||t.webkitMatchesSelector&&t.webkitMatchesSelector(e))},e.prototype.isTemplateElement=function(t){return this.isElementNode(t)&&"TEMPLATE"===t.nodeName},e.prototype.isTextNode=function(t){return t.nodeType===Node.TEXT_NODE},e.prototype.isCommentNode=function(t){return t.nodeType===Node.COMMENT_NODE},e.prototype.isElementNode=function(t){return t.nodeType===Node.ELEMENT_NODE},e.prototype.hasShadowRoot=function(t){return null!=t.shadowRoot&&t instanceof HTMLElement},e.prototype.isShadowRoot=function(t){return t instanceof DocumentFragment},e.prototype.importIntoDoc=function(t){return document.importNode(this.templateAwareRoot(t),!0)},e.prototype.adoptNode=function(t){return document.adoptNode(t)},e.prototype.getHref=function(t){return t.getAttribute("href")},e.prototype.getEventKey=function(t){var e=t.key;if(null==e){if(null==(e=t.keyIdentifier))return"Unidentified";e.startsWith("U+")&&(e=String.fromCharCode(parseInt(e.substring(2),16)),3===t.location&&vt.hasOwnProperty(e)&&(e=vt[e]))}return mt[e]||e},e.prototype.getGlobalEventTarget=function(t,e){return"window"===e?window:"document"===e?t:"body"===e?t.body:null},e.prototype.getHistory=function(){return window.history},e.prototype.getLocation=function(){return window.location},e.prototype.getBaseHref=function(t){var e,n=_t||(_t=document.querySelector("base"))?_t.getAttribute("href"):null;return null==n?null:(e=n,bt||(bt=document.createElement("a")),bt.setAttribute("href",e),"/"===bt.pathname.charAt(0)?bt.pathname:"/"+bt.pathname)},e.prototype.resetBaseElement=function(){_t=null},e.prototype.getUserAgent=function(){return window.navigator.userAgent},e.prototype.setData=function(t,e,n){this.setAttribute(t,"data-"+e,n)},e.prototype.getData=function(t,e){return this.getAttribute(t,"data-"+e)},e.prototype.getComputedStyle=function(t){return getComputedStyle(t)},e.prototype.supportsWebAnimation=function(){return"function"==typeof Element.prototype.animate},e.prototype.performanceNow=function(){return window.performance&&window.performance.now?window.performance.now():(new Date).getTime()},e.prototype.supportsCookies=function(){return!0},e.prototype.getCookie=function(t){return Object(ft.t)(document.cookie,t)},e.prototype.setCookie=function(t,e){document.cookie=encodeURIComponent(t)+"="+encodeURIComponent(e)},e}(function(t){function e(){var e=t.call(this)||this;e._animationPrefix=null,e._transitionEnd=null;try{var n=e.createElement("div",document);if(null!=e.getStyle(n,"animationName"))e._animationPrefix="";else for(var r=["Webkit","Moz","O","ms"],i=0;i<r.length;i++)if(null!=e.getStyle(n,r[i]+"AnimationName")){e._animationPrefix="-"+r[i].toLowerCase()+"-";break}var o={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};Object.keys(o).forEach(function(t){null!=e.getStyle(n,t)&&(e._transitionEnd=o[t])})}catch(a){e._animationPrefix=null,e._transitionEnd=null}return e}return Object(a.c)(e,t),e.prototype.getDistributedNodes=function(t){return t.getDistributedNodes()},e.prototype.resolveAndSetHref=function(t,e,n){t.href=null==n?e:e+"/../"+n},e.prototype.supportsDOMEvents=function(){return!0},e.prototype.supportsNativeShadowDOM=function(){return"function"==typeof document.body.createShadowRoot},e.prototype.getAnimationPrefix=function(){return this._animationPrefix?this._animationPrefix:""},e.prototype.getTransitionEnd=function(){return this._transitionEnd?this._transitionEnd:""},e.prototype.supportsAnimation=function(){return null!=this._animationPrefix&&null!=this._transitionEnd},e}(function(){function t(){this.resourceLoaderType=null}return Object.defineProperty(t.prototype,"attrToPropMap",{get:function(){return this._attrToPropMap},set:function(t){this._attrToPropMap=t},enumerable:!0,configurable:!0}),t}())),_t=null,St=ft.d;function Et(){return!!window.history.pushState}var Tt=function(t){function e(e){var n=t.call(this)||this;return n._doc=e,n._init(),n}return Object(a.c)(e,t),e.prototype._init=function(){this.location=dt().getLocation(),this._history=dt().getHistory()},e.prototype.getBaseHrefFromDOM=function(){return dt().getBaseHref(this._doc)},e.prototype.onPopState=function(t){dt().getGlobalEventTarget(this._doc,"window").addEventListener("popstate",t,!1)},e.prototype.onHashChange=function(t){dt().getGlobalEventTarget(this._doc,"window").addEventListener("hashchange",t,!1)},Object.defineProperty(e.prototype,"pathname",{get:function(){return this.location.pathname},set:function(t){this.location.pathname=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"search",{get:function(){return this.location.search},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hash",{get:function(){return this.location.hash},enumerable:!0,configurable:!0}),e.prototype.pushState=function(t,e,n){Et()?this._history.pushState(t,e,n):this.location.hash=n},e.prototype.replaceState=function(t,e,n){Et()?this._history.replaceState(t,e,n):this.location.hash=n},e.prototype.forward=function(){this._history.forward()},e.prototype.back=function(){this._history.back()},Object(a.b)([Object(a.e)(0,Object(r.o)(St)),Object(a.d)("design:paramtypes",[Object])],e)}(ft.n),Ct=new r.p("TRANSITION_ID"),It=[{provide:r.d,useFactory:function(t,e,n){return function(){n.get(r.e).donePromise.then(function(){var n=dt();Array.prototype.slice.apply(n.querySelectorAll(e,"style[ng-transition]")).filter(function(e){return n.getAttribute(e,"ng-transition")===t}).forEach(function(t){return n.remove(t)})})}},deps:[Ct,St,r.q],multi:!0}],At=function(){function t(){}return t.init=function(){Object(r.Z)(new t)},t.prototype.addToWindow=function(t){r.qb.getAngularTestability=function(e,n){void 0===n&&(n=!0);var r=t.findTestabilityInTree(e,n);if(null==r)throw new Error("Could not find testability for element.");return r},r.qb.getAllAngularTestabilities=function(){return t.getAllTestabilities()},r.qb.getAllAngularRootElements=function(){return t.getAllRootElements()},r.qb.frameworkStabilizers||(r.qb.frameworkStabilizers=[]),r.qb.frameworkStabilizers.push(function(t){var e=r.qb.getAllAngularTestabilities(),n=e.length,i=!1,o=function(e){i=i||e,0==--n&&t(i)};e.forEach(function(t){t.whenStable(o)})})},t.prototype.findTestabilityInTree=function(t,e,n){if(null==e)return null;var r=t.getTestability(e);return null!=r?r:n?dt().isShadowRoot(e)?this.findTestabilityInTree(t,dt().getHost(e),!0):this.findTestabilityInTree(t,dt().parentElement(e),!0):null},t}();function Ot(t,e){"undefined"!=typeof COMPILED&&COMPILED||((r.qb.ng=r.qb.ng||{})[t]=e)}var Dt={ApplicationRef:r.g,NgZone:r.z};function kt(t){return Object(r.V)(t)}var Nt=new r.p("EventManagerPlugins"),Pt=function(){function t(t,e){var n=this;this._zone=e,this._eventNameToPlugin=new Map,t.forEach(function(t){return t.manager=n}),this._plugins=t.slice().reverse()}return t.prototype.addEventListener=function(t,e,n){return this._findPluginFor(e).addEventListener(t,e,n)},t.prototype.addGlobalEventListener=function(t,e,n){return this._findPluginFor(e).addGlobalEventListener(t,e,n)},t.prototype.getZone=function(){return this._zone},t.prototype._findPluginFor=function(t){var e=this._eventNameToPlugin.get(t);if(e)return e;for(var n=this._plugins,r=0;r<n.length;r++){var i=n[r];if(i.supports(t))return this._eventNameToPlugin.set(t,i),i}throw new Error("No event manager plugin found for event "+t)},t}(),Rt=function(){function t(t){this._doc=t}return t.prototype.addGlobalEventListener=function(t,e,n){var r=dt().getGlobalEventTarget(this._doc,t);if(!r)throw new Error("Unsupported event target "+r+" for event "+e);return this.addEventListener(r,e,n)},t}(),xt=function(){function t(){this._stylesSet=new Set}return t.prototype.addStyles=function(t){var e=this,n=new Set;t.forEach(function(t){e._stylesSet.has(t)||(e._stylesSet.add(t),n.add(t))}),this.onStylesAdded(n)},t.prototype.onStylesAdded=function(t){},t.prototype.getAllStyles=function(){return Array.from(this._stylesSet)},t}(),Mt=function(t){function e(e){var n=t.call(this)||this;return n._doc=e,n._hostNodes=new Set,n._styleNodes=new Set,n._hostNodes.add(e.head),n}return Object(a.c)(e,t),e.prototype._addStylesToHost=function(t,e){var n=this;t.forEach(function(t){var r=n._doc.createElement("style");r.textContent=t,n._styleNodes.add(e.appendChild(r))})},e.prototype.addHost=function(t){this._addStylesToHost(this._stylesSet,t),this._hostNodes.add(t)},e.prototype.removeHost=function(t){this._hostNodes.delete(t)},e.prototype.onStylesAdded=function(t){var e=this;this._hostNodes.forEach(function(n){return e._addStylesToHost(t,n)})},e.prototype.ngOnDestroy=function(){this._styleNodes.forEach(function(t){return dt().remove(t)})},e}(xt),jt={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},Lt=/%COMP%/g,Ut="_nghost-%COMP%",Vt="_ngcontent-%COMP%";function Ft(t,e,n){for(var r=0;r<e.length;r++){var i=e[r];Array.isArray(i)?Ft(t,i,n):(i=i.replace(Lt,t),n.push(i))}return n}function qt(t){return function(e){!1===t(e)&&(e.preventDefault(),e.returnValue=!1)}}var Bt=function(){function t(t,e){this.eventManager=t,this.sharedStylesHost=e,this.rendererByCompId=new Map,this.defaultRenderer=new Ht(t)}return t.prototype.createRenderer=function(t,e){if(!t||!e)return this.defaultRenderer;switch(e.encapsulation){case r.P.Emulated:var n=this.rendererByCompId.get(e.id);return n||(n=new Gt(this.eventManager,this.sharedStylesHost,e),this.rendererByCompId.set(e.id,n)),n.applyToHost(t),n;case r.P.Native:case r.P.ShadowDom:return new Qt(this.eventManager,this.sharedStylesHost,t,e);default:if(!this.rendererByCompId.has(e.id)){var i=Ft(e.id,e.styles,[]);this.sharedStylesHost.addStyles(i),this.rendererByCompId.set(e.id,this.defaultRenderer)}return this.defaultRenderer}},t.prototype.begin=function(){},t.prototype.end=function(){},t}(),Ht=function(){function t(t){this.eventManager=t,this.data=Object.create(null)}return t.prototype.destroy=function(){},t.prototype.createElement=function(t,e){return e?document.createElementNS(jt[e],t):document.createElement(t)},t.prototype.createComment=function(t){return document.createComment(t)},t.prototype.createText=function(t){return document.createTextNode(t)},t.prototype.appendChild=function(t,e){t.appendChild(e)},t.prototype.insertBefore=function(t,e,n){t&&t.insertBefore(e,n)},t.prototype.removeChild=function(t,e){t&&t.removeChild(e)},t.prototype.selectRootElement=function(t,e){var n="string"==typeof t?document.querySelector(t):t;if(!n)throw new Error('The selector "'+t+'" did not match any elements');return e||(n.textContent=""),n},t.prototype.parentNode=function(t){return t.parentNode},t.prototype.nextSibling=function(t){return t.nextSibling},t.prototype.setAttribute=function(t,e,n,r){if(r){e=r+":"+e;var i=jt[r];i?t.setAttributeNS(i,e,n):t.setAttribute(e,n)}else t.setAttribute(e,n)},t.prototype.removeAttribute=function(t,e,n){if(n){var r=jt[n];r?t.removeAttributeNS(r,e):t.removeAttribute(n+":"+e)}else t.removeAttribute(e)},t.prototype.addClass=function(t,e){t.classList.add(e)},t.prototype.removeClass=function(t,e){t.classList.remove(e)},t.prototype.setStyle=function(t,e,n,i){i&r.F.DashCase?t.style.setProperty(e,n,i&r.F.Important?"important":""):t.style[e]=n},t.prototype.removeStyle=function(t,e,n){n&r.F.DashCase?t.style.removeProperty(e):t.style[e]=""},t.prototype.setProperty=function(t,e,n){Wt(e,"property"),t[e]=n},t.prototype.setValue=function(t,e){t.nodeValue=e},t.prototype.listen=function(t,e,n){return Wt(e,"listener"),"string"==typeof t?this.eventManager.addGlobalEventListener(t,e,qt(n)):this.eventManager.addEventListener(t,e,qt(n))},t}(),zt="@".charCodeAt(0);function Wt(t,e){if(t.charCodeAt(0)===zt)throw new Error("Found the synthetic "+e+" "+t+'. Please include either "BrowserAnimationsModule" or "NoopAnimationsModule" in your application.')}var Kt,Gt=function(t){function e(e,n,r){var i=t.call(this,e)||this;i.component=r;var o=Ft(r.id,r.styles,[]);return n.addStyles(o),i.contentAttr=Vt.replace(Lt,r.id),i.hostAttr=Ut.replace(Lt,r.id),i}return Object(a.c)(e,t),e.prototype.applyToHost=function(e){t.prototype.setAttribute.call(this,e,this.hostAttr,"")},e.prototype.createElement=function(e,n){var r=t.prototype.createElement.call(this,e,n);return t.prototype.setAttribute.call(this,r,this.contentAttr,""),r},e}(Ht),Qt=function(t){function e(e,n,i,o){var a=t.call(this,e)||this;a.sharedStylesHost=n,a.hostEl=i,a.component=o,a.shadowRoot=o.encapsulation===r.P.ShadowDom?i.attachShadow({mode:"open"}):i.createShadowRoot(),a.sharedStylesHost.addHost(a.shadowRoot);for(var s=Ft(o.id,o.styles,[]),u=0;u<s.length;u++){var c=document.createElement("style");c.textContent=s[u],a.shadowRoot.appendChild(c)}return a}return Object(a.c)(e,t),e.prototype.nodeOrShadowRoot=function(t){return t===this.hostEl?this.shadowRoot:t},e.prototype.destroy=function(){this.sharedStylesHost.removeHost(this.shadowRoot)},e.prototype.appendChild=function(e,n){return t.prototype.appendChild.call(this,this.nodeOrShadowRoot(e),n)},e.prototype.insertBefore=function(e,n,r){return t.prototype.insertBefore.call(this,this.nodeOrShadowRoot(e),n,r)},e.prototype.removeChild=function(e,n){return t.prototype.removeChild.call(this,this.nodeOrShadowRoot(e),n)},e.prototype.parentNode=function(e){return this.nodeOrShadowRoot(t.prototype.parentNode.call(this,this.nodeOrShadowRoot(e)))},e}(Ht),Xt="undefined"!=typeof Zone&&Zone.__symbol__||function(t){return"__zone_symbol__"+t},Yt=Xt("addEventListener"),Jt=Xt("removeEventListener"),Zt={},$t="__zone_symbol__propagationStopped";"undefined"!=typeof Zone&&Zone[Xt("BLACK_LISTED_EVENTS")]&&(Kt={});var te=function(t){return!!Kt&&Kt.hasOwnProperty(t)},ee=function(t){var e=Zt[t.type];if(e){var n=this[e];if(n){var r=[t];if(1===n.length)return(a=n[0]).zone!==Zone.current?a.zone.run(a.handler,this,r):a.handler.apply(this,r);for(var i=n.slice(),o=0;o<i.length&&!0!==t[$t];o++){var a;(a=i[o]).zone!==Zone.current?a.zone.run(a.handler,this,r):a.handler.apply(this,r)}}}},ne=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.ngZone=n,r&&Object(ft.q)(r)||i.patchEvent(),i}return Object(a.c)(e,t),e.prototype.patchEvent=function(){if("undefined"!=typeof Event&&Event&&Event.prototype&&!Event.prototype.__zone_symbol__stopImmediatePropagation){var t=Event.prototype.__zone_symbol__stopImmediatePropagation=Event.prototype.stopImmediatePropagation;Event.prototype.stopImmediatePropagation=function(){this&&(this[$t]=!0),t&&t.apply(this,arguments)}}},e.prototype.supports=function(t){return!0},e.prototype.addEventListener=function(t,e,n){var i=this,o=n;if(!t[Yt]||r.z.isInAngularZone()&&!te(e))t.addEventListener(e,o,!1);else{var a=Zt[e];a||(a=Zt[e]=Xt("ANGULAR"+e+"FALSE"));var s=t[a],u=s&&s.length>0;s||(s=t[a]=[]);var c=te(e)?Zone.root:Zone.current;if(0===s.length)s.push({zone:c,handler:o});else{for(var l=!1,h=0;h<s.length;h++)if(s[h].handler===o){l=!0;break}l||s.push({zone:c,handler:o})}u||t[Yt](e,ee,!1)}return function(){return i.removeEventListener(t,e,o)}},e.prototype.removeEventListener=function(t,e,n){var r=t[Jt];if(!r)return t.removeEventListener.apply(t,[e,n,!1]);var i=Zt[e],o=i&&t[i];if(!o)return t.removeEventListener.apply(t,[e,n,!1]);for(var a=!1,s=0;s<o.length;s++)if(o[s].handler===n){a=!0,o.splice(s,1);break}a?0===o.length&&r.apply(t,[e,ee,!1]):t.removeEventListener.apply(t,[e,n,!1])},e}(Rt),re={pan:!0,panstart:!0,panmove:!0,panend:!0,pancancel:!0,panleft:!0,panright:!0,panup:!0,pandown:!0,pinch:!0,pinchstart:!0,pinchmove:!0,pinchend:!0,pinchcancel:!0,pinchin:!0,pinchout:!0,press:!0,pressup:!0,rotate:!0,rotatestart:!0,rotatemove:!0,rotateend:!0,rotatecancel:!0,swipe:!0,swipeleft:!0,swiperight:!0,swipeup:!0,swipedown:!0,tap:!0},ie=new r.p("HammerGestureConfig"),oe=new r.p("HammerLoader"),ae=function(){function t(){this.events=[],this.overrides={}}return t.prototype.buildHammer=function(t){var e=new Hammer(t,this.options);for(var n in e.get("pinch").set({enable:!0}),e.get("rotate").set({enable:!0}),this.overrides)e.get(n).set(this.overrides[n]);return e},t}(),se=function(t){function e(e,n,r,i){var o=t.call(this,e)||this;return o._config=n,o.console=r,o.loader=i,o}return Object(a.c)(e,t),e.prototype.supports=function(t){return!(!re.hasOwnProperty(t.toLowerCase())&&!this.isCustomEvent(t)||!window.Hammer&&!this.loader&&(this.console.warn('The "'+t+'" event cannot be bound because Hammer.JS is not loaded and no custom loader has been specified.'),1))},e.prototype.addEventListener=function(t,e,n){var r=this,i=this.manager.getZone();if(e=e.toLowerCase(),!window.Hammer&&this.loader){var o=!1,a=function(){o=!0};return this.loader().then(function(){if(!window.Hammer)return r.console.warn("The custom HAMMER_LOADER completed, but Hammer.JS is not present."),void(a=function(){});o||(a=r.addEventListener(t,e,n))}).catch(function(){r.console.warn('The "'+e+'" event cannot be bound because the custom Hammer.JS loader failed.'),a=function(){}}),function(){a()}}return i.runOutsideAngular(function(){var o=r._config.buildHammer(t),a=function(t){i.runGuarded(function(){n(t)})};return o.on(e,a),function(){o.off(e,a),"function"==typeof o.destroy&&o.destroy()}})},e.prototype.isCustomEvent=function(t){return this._config.events.indexOf(t)>-1},e}(Rt),ue=["alt","control","meta","shift"],ce={alt:function(t){return t.altKey},control:function(t){return t.ctrlKey},meta:function(t){return t.metaKey},shift:function(t){return t.shiftKey}},le=function(t){function e(e){return t.call(this,e)||this}var n;return Object(a.c)(e,t),n=e,e.prototype.supports=function(t){return null!=n.parseEventName(t)},e.prototype.addEventListener=function(t,e,r){var i=n.parseEventName(e),o=n.eventCallback(i.fullKey,r,this.manager.getZone());return this.manager.getZone().runOutsideAngular(function(){return dt().onAndCancel(t,i.domEventName,o)})},e.parseEventName=function(t){var e=t.toLowerCase().split("."),r=e.shift();if(0===e.length||"keydown"!==r&&"keyup"!==r)return null;var i=n._normalizeKey(e.pop()),o="";if(ue.forEach(function(t){var n=e.indexOf(t);n>-1&&(e.splice(n,1),o+=t+".")}),o+=i,0!=e.length||0===i.length)return null;var a={};return a.domEventName=r,a.fullKey=o,a},e.getEventFullKey=function(t){var e="",n=dt().getEventKey(t);return" "===(n=n.toLowerCase())?n="space":"."===n&&(n="dot"),ue.forEach(function(r){r!=n&&(0,ce[r])(t)&&(e+=r+".")}),e+=n},e.eventCallback=function(t,e,r){return function(i){n.getEventFullKey(i)===t&&r.runGuarded(function(){return e(i)})}},e._normalizeKey=function(t){switch(t){case"esc":return"escape";default:return t}},e}(Rt),he=function(){return function(){}}(),fe=function(t){function e(e){var n=t.call(this)||this;return n._doc=e,n}return Object(a.c)(e,t),e.prototype.sanitize=function(t,e){if(null==e)return null;switch(t){case r.H.NONE:return e;case r.H.HTML:return e instanceof de?e.changingThisBreaksApplicationSecurity:(this.checkNotSafeValue(e,"HTML"),Object(r.db)(this._doc,String(e)));case r.H.STYLE:return e instanceof ye?e.changingThisBreaksApplicationSecurity:(this.checkNotSafeValue(e,"Style"),Object(r.eb)(e));case r.H.SCRIPT:if(e instanceof ge)return e.changingThisBreaksApplicationSecurity;throw this.checkNotSafeValue(e,"Script"),new Error("unsafe value used in a script context");case r.H.URL:return e instanceof ve||e instanceof me?e.changingThisBreaksApplicationSecurity:(this.checkNotSafeValue(e,"URL"),Object(r.fb)(String(e)));case r.H.RESOURCE_URL:if(e instanceof ve)return e.changingThisBreaksApplicationSecurity;throw this.checkNotSafeValue(e,"ResourceURL"),new Error("unsafe value used in a resource URL context (see http://g.co/ng/security#xss)");default:throw new Error("Unexpected SecurityContext "+t+" (see http://g.co/ng/security#xss)")}},e.prototype.checkNotSafeValue=function(t,e){if(t instanceof pe)throw new Error("Required a safe "+e+", got a "+t.getTypeName()+" (see http://g.co/ng/security#xss)")},e.prototype.bypassSecurityTrustHtml=function(t){return new de(t)},e.prototype.bypassSecurityTrustStyle=function(t){return new ye(t)},e.prototype.bypassSecurityTrustScript=function(t){return new ge(t)},e.prototype.bypassSecurityTrustUrl=function(t){return new me(t)},e.prototype.bypassSecurityTrustResourceUrl=function(t){return new ve(t)},e}(he),pe=function(){function t(t){this.changingThisBreaksApplicationSecurity=t}return t.prototype.toString=function(){return"SafeValue must use [property]=binding: "+this.changingThisBreaksApplicationSecurity+" (see http://g.co/ng/security#xss)"},t}(),de=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(a.c)(e,t),e.prototype.getTypeName=function(){return"HTML"},e}(pe),ye=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(a.c)(e,t),e.prototype.getTypeName=function(){return"Style"},e}(pe),ge=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(a.c)(e,t),e.prototype.getTypeName=function(){return"Script"},e}(pe),me=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(a.c)(e,t),e.prototype.getTypeName=function(){return"URL"},e}(pe),ve=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(a.c)(e,t),e.prototype.getTypeName=function(){return"ResourceURL"},e}(pe),be=[{provide:r.B,useValue:ft.r},{provide:r.C,useValue:function(){wt.makeCurrent(),At.init()},multi:!0},{provide:ft.n,useClass:Tt,deps:[St]},{provide:St,useFactory:function(){return document},deps:[]}],we=Object(r.R)(r.Y,"browser",be);function _e(){return new r.l}var Se=function(){function t(t){if(t)throw new Error("BrowserModule has already been loaded. If you need access to common directives such as NgIf and NgFor from a lazy loaded module, import CommonModule instead.")}var e;return e=t,t.withServerTransition=function(t){return{ngModule:e,providers:[{provide:r.c,useValue:t.appId},{provide:Ct,useExisting:r.c},It]}},t}();"undefined"!=typeof window&&window;var Ee=function(){return function(t,e){this.id=t,this.url=e}}(),Te=function(t){function e(e,n,r,i){void 0===r&&(r="imperative"),void 0===i&&(i=null);var o=t.call(this,e,n)||this;return o.navigationTrigger=r,o.restoredState=i,o}return Object(a.c)(e,t),e.prototype.toString=function(){return"NavigationStart(id: "+this.id+", url: '"+this.url+"')"},e}(Ee),Ce=function(t){function e(e,n,r){var i=t.call(this,e,n)||this;return i.urlAfterRedirects=r,i}return Object(a.c)(e,t),e.prototype.toString=function(){return"NavigationEnd(id: "+this.id+", url: '"+this.url+"', urlAfterRedirects: '"+this.urlAfterRedirects+"')"},e}(Ee),Ie=function(t){function e(e,n,r){var i=t.call(this,e,n)||this;return i.reason=r,i}return Object(a.c)(e,t),e.prototype.toString=function(){return"NavigationCancel(id: "+this.id+", url: '"+this.url+"')"},e}(Ee),Ae=function(t){function e(e,n,r){var i=t.call(this,e,n)||this;return i.error=r,i}return Object(a.c)(e,t),e.prototype.toString=function(){return"NavigationError(id: "+this.id+", url: '"+this.url+"', error: "+this.error+")"},e}(Ee),Oe=function(t){function e(e,n,r,i){var o=t.call(this,e,n)||this;return o.urlAfterRedirects=r,o.state=i,o}return Object(a.c)(e,t),e.prototype.toString=function(){return"RoutesRecognized(id: "+this.id+", url: '"+this.url+"', urlAfterRedirects: '"+this.urlAfterRedirects+"', state: "+this.state+")"},e}(Ee),De=function(t){function e(e,n,r,i){var o=t.call(this,e,n)||this;return o.urlAfterRedirects=r,o.state=i,o}return Object(a.c)(e,t),e.prototype.toString=function(){return"GuardsCheckStart(id: "+this.id+", url: '"+this.url+"', urlAfterRedirects: '"+this.urlAfterRedirects+"', state: "+this.state+")"},e}(Ee),ke=function(t){function e(e,n,r,i,o){var a=t.call(this,e,n)||this;return a.urlAfterRedirects=r,a.state=i,a.shouldActivate=o,a}return Object(a.c)(e,t),e.prototype.toString=function(){return"GuardsCheckEnd(id: "+this.id+", url: '"+this.url+"', urlAfterRedirects: '"+this.urlAfterRedirects+"', state: "+this.state+", shouldActivate: "+this.shouldActivate+")"},e}(Ee),Ne=function(t){function e(e,n,r,i){var o=t.call(this,e,n)||this;return o.urlAfterRedirects=r,o.state=i,o}return Object(a.c)(e,t),e.prototype.toString=function(){return"ResolveStart(id: "+this.id+", url: '"+this.url+"', urlAfterRedirects: '"+this.urlAfterRedirects+"', state: "+this.state+")"},e}(Ee),Pe=function(t){function e(e,n,r,i){var o=t.call(this,e,n)||this;return o.urlAfterRedirects=r,o.state=i,o}return Object(a.c)(e,t),e.prototype.toString=function(){return"ResolveEnd(id: "+this.id+", url: '"+this.url+"', urlAfterRedirects: '"+this.urlAfterRedirects+"', state: "+this.state+")"},e}(Ee),Re=function(){function t(t){this.route=t}return t.prototype.toString=function(){return"RouteConfigLoadStart(path: "+this.route.path+")"},t}(),xe=function(){function t(t){this.route=t}return t.prototype.toString=function(){return"RouteConfigLoadEnd(path: "+this.route.path+")"},t}(),Me=function(){function t(t){this.snapshot=t}return t.prototype.toString=function(){return"ChildActivationStart(path: '"+(this.snapshot.routeConfig&&this.snapshot.routeConfig.path||"")+"')"},t}(),je=function(){function t(t){this.snapshot=t}return t.prototype.toString=function(){return"ChildActivationEnd(path: '"+(this.snapshot.routeConfig&&this.snapshot.routeConfig.path||"")+"')"},t}(),Le=function(){function t(t){this.snapshot=t}return t.prototype.toString=function(){return"ActivationStart(path: '"+(this.snapshot.routeConfig&&this.snapshot.routeConfig.path||"")+"')"},t}(),Ue=function(){function t(t){this.snapshot=t}return t.prototype.toString=function(){return"ActivationEnd(path: '"+(this.snapshot.routeConfig&&this.snapshot.routeConfig.path||"")+"')"},t}(),Ve=function(){function t(t,e,n){this.routerEvent=t,this.position=e,this.anchor=n}return t.prototype.toString=function(){return"Scroll(anchor: '"+this.anchor+"', position: '"+(this.position?this.position[0]+", "+this.position[1]:null)+"')"},t}(),Fe=function(){return function(){}}(),qe="primary",Be=function(){function t(t){this.params=t||{}}return t.prototype.has=function(t){return this.params.hasOwnProperty(t)},t.prototype.get=function(t){if(this.has(t)){var e=this.params[t];return Array.isArray(e)?e[0]:e}return null},t.prototype.getAll=function(t){if(this.has(t)){var e=this.params[t];return Array.isArray(e)?e:[e]}return[]},Object.defineProperty(t.prototype,"keys",{get:function(){return Object.keys(this.params)},enumerable:!0,configurable:!0}),t}();function He(t){return new Be(t)}var ze="ngNavigationCancelingError";function We(t){var e=Error("NavigationCancelingError: "+t);return e[ze]=!0,e}function Ke(t,e,n){var r=n.path.split("/");if(r.length>t.length)return null;if("full"===n.pathMatch&&(e.hasChildren()||r.length<t.length))return null;for(var i={},o=0;o<r.length;o++){var a=r[o],s=t[o];if(a.startsWith(":"))i[a.substring(1)]=s;else if(a!==s.path)return null}return{consumed:t.slice(0,r.length),posParams:i}}var Ge=function(){return function(t,e){this.routes=t,this.module=e}}();function Qe(t,e){void 0===e&&(e="");for(var n=0;n<t.length;n++){var r=t[n];Xe(r,Ye(e,r))}}function Xe(t,e){if(!t)throw new Error("\n Invalid configuration of route '"+e+"': Encountered undefined route.\n The reason might be an extra comma.\n\n Example:\n const routes: Routes = [\n { path: '', redirectTo: '/dashboard', pathMatch: 'full' },\n { path: 'dashboard', component: DashboardComponent },, << two commas\n { path: 'detail/:id', component: HeroDetailComponent }\n ];\n ");if(Array.isArray(t))throw new Error("Invalid configuration of route '"+e+"': Array cannot be specified");if(!t.component&&!t.children&&!t.loadChildren&&t.outlet&&t.outlet!==qe)throw new Error("Invalid configuration of route '"+e+"': a componentless route without children or loadChildren cannot have a named outlet set");if(t.redirectTo&&t.children)throw new Error("Invalid configuration of route '"+e+"': redirectTo and children cannot be used together");if(t.redirectTo&&t.loadChildren)throw new Error("Invalid configuration of route '"+e+"': redirectTo and loadChildren cannot be used together");if(t.children&&t.loadChildren)throw new Error("Invalid configuration of route '"+e+"': children and loadChildren cannot be used together");if(t.redirectTo&&t.component)throw new Error("Invalid configuration of route '"+e+"': redirectTo and component cannot be used together");if(t.path&&t.matcher)throw new Error("Invalid configuration of route '"+e+"': path and matcher cannot be used together");if(void 0===t.redirectTo&&!t.component&&!t.children&&!t.loadChildren)throw new Error("Invalid configuration of route '"+e+"'. One of the following must be provided: component, redirectTo, children or loadChildren");if(void 0===t.path&&void 0===t.matcher)throw new Error("Invalid configuration of route '"+e+"': routes must have either a path or a matcher specified");if("string"==typeof t.path&&"/"===t.path.charAt(0))throw new Error("Invalid configuration of route '"+e+"': path cannot start with a slash");if(""===t.path&&void 0!==t.redirectTo&&void 0===t.pathMatch)throw new Error("Invalid configuration of route '{path: \""+e+'", redirectTo: "'+t.redirectTo+"\"}': please provide 'pathMatch'. The default value of 'pathMatch' is 'prefix', but often the intent is to use 'full'.");if(void 0!==t.pathMatch&&"full"!==t.pathMatch&&"prefix"!==t.pathMatch)throw new Error("Invalid configuration of route '"+e+"': pathMatch can only be set to 'prefix' or 'full'");t.children&&Qe(t.children,e)}function Ye(t,e){return e?t||e.path?t&&!e.path?t+"/":!t&&e.path?e.path:t+"/"+e.path:"":t}function Je(t){var e=t.children&&t.children.map(Je),n=e?Object(a.a)({},t,{children:e}):Object(a.a)({},t);return!n.component&&(e||n.loadChildren)&&n.outlet&&n.outlet!==qe&&(n.component=Fe),n}function Ze(t,e){var n,r=Object.keys(t),i=Object.keys(e);if(r.length!=i.length)return!1;for(var o=0;o<r.length;o++)if(t[n=r[o]]!==e[n])return!1;return!0}function $e(t){return Array.prototype.concat.apply([],t)}function tn(t){return t.length>0?t[t.length-1]:null}function en(t,e){for(var n in t)t.hasOwnProperty(n)&&e(t[n],n)}function nn(t){return Object(r.sb)(t)?t:Object(r.tb)(t)?Object(u.a)(Promise.resolve(t)):Object(s.a)(t)}function rn(t,e,n){return n?function(t,e){return Ze(t,e)}(t.queryParams,e.queryParams)&&function t(e,n){if(!un(e.segments,n.segments))return!1;if(e.numberOfChildren!==n.numberOfChildren)return!1;for(var r in n.children){if(!e.children[r])return!1;if(!t(e.children[r],n.children[r]))return!1}return!0}(t.root,e.root):function(t,e){return Object.keys(e).length<=Object.keys(t).length&&Object.keys(e).every(function(n){return e[n]===t[n]})}(t.queryParams,e.queryParams)&&function t(e,n){return function e(n,r,i){if(n.segments.length>i.length)return!!un(a=n.segments.slice(0,i.length),i)&&!r.hasChildren();if(n.segments.length===i.length){if(!un(n.segments,i))return!1;for(var o in r.children){if(!n.children[o])return!1;if(!t(n.children[o],r.children[o]))return!1}return!0}var a=i.slice(0,n.segments.length),s=i.slice(n.segments.length);return!!un(n.segments,a)&&!!n.children[qe]&&e(n.children[qe],r,s)}(e,n,n.segments)}(t.root,e.root)}var on=function(){function t(t,e,n){this.root=t,this.queryParams=e,this.fragment=n}return Object.defineProperty(t.prototype,"queryParamMap",{get:function(){return this._queryParamMap||(this._queryParamMap=He(this.queryParams)),this._queryParamMap},enumerable:!0,configurable:!0}),t.prototype.toString=function(){return fn.serialize(this)},t}(),an=function(){function t(t,e){var n=this;this.segments=t,this.children=e,this.parent=null,en(e,function(t,e){return t.parent=n})}return t.prototype.hasChildren=function(){return this.numberOfChildren>0},Object.defineProperty(t.prototype,"numberOfChildren",{get:function(){return Object.keys(this.children).length},enumerable:!0,configurable:!0}),t.prototype.toString=function(){return pn(this)},t}(),sn=function(){function t(t,e){this.path=t,this.parameters=e}return Object.defineProperty(t.prototype,"parameterMap",{get:function(){return this._parameterMap||(this._parameterMap=He(this.parameters)),this._parameterMap},enumerable:!0,configurable:!0}),t.prototype.toString=function(){return bn(this)},t}();function un(t,e){return t.length===e.length&&t.every(function(t,n){return t.path===e[n].path})}function cn(t,e){var n=[];return en(t.children,function(t,r){r===qe&&(n=n.concat(e(t,r)))}),en(t.children,function(t,r){r!==qe&&(n=n.concat(e(t,r)))}),n}var ln=function(){return function(){}}(),hn=function(){function t(){}return t.prototype.parse=function(t){var e=new Tn(t);return new on(e.parseRootSegment(),e.parseQueryParams(),e.parseFragment())},t.prototype.serialize=function(t){var e,n;return"/"+function t(e,n){if(!e.hasChildren())return pn(e);if(n){var r=e.children[qe]?t(e.children[qe],!1):"",i=[];return en(e.children,function(e,n){n!==qe&&i.push(n+":"+t(e,!1))}),i.length>0?r+"("+i.join("//")+")":r}var o=cn(e,function(n,r){return r===qe?[t(e.children[qe],!1)]:[r+":"+t(n,!1)]});return pn(e)+"/("+o.join("//")+")"}(t.root,!0)+(e=t.queryParams,(n=Object.keys(e).map(function(t){var n=e[t];return Array.isArray(n)?n.map(function(e){return yn(t)+"="+yn(e)}).join("&"):yn(t)+"="+yn(n)})).length?"?"+n.join("&"):"")+("string"==typeof t.fragment?"#"+encodeURI(t.fragment):"")},t}(),fn=new hn;function pn(t){return t.segments.map(function(t){return bn(t)}).join("/")}function dn(t){return encodeURIComponent(t).replace(/%40/g,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",")}function yn(t){return dn(t).replace(/%3B/gi,";")}function gn(t){return dn(t).replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/%26/gi,"&")}function mn(t){return decodeURIComponent(t)}function vn(t){return mn(t.replace(/\+/g,"%20"))}function bn(t){return""+gn(t.path)+(e=t.parameters,Object.keys(e).map(function(t){return";"+gn(t)+"="+gn(e[t])}).join(""));var e}var wn=/^[^\/()?;=#]+/;function _n(t){var e=t.match(wn);return e?e[0]:""}var Sn=/^[^=?&#]+/,En=/^[^?&#]+/,Tn=function(){function t(t){this.url=t,this.remaining=t}return t.prototype.parseRootSegment=function(){return this.consumeOptional("/"),""===this.remaining||this.peekStartsWith("?")||this.peekStartsWith("#")?new an([],{}):new an([],this.parseChildren())},t.prototype.parseQueryParams=function(){var t={};if(this.consumeOptional("?"))do{this.parseQueryParam(t)}while(this.consumeOptional("&"));return t},t.prototype.parseFragment=function(){return this.consumeOptional("#")?decodeURIComponent(this.remaining):null},t.prototype.parseChildren=function(){if(""===this.remaining)return{};this.consumeOptional("/");var t=[];for(this.peekStartsWith("(")||t.push(this.parseSegment());this.peekStartsWith("/")&&!this.peekStartsWith("//")&&!this.peekStartsWith("/(");)this.capture("/"),t.push(this.parseSegment());var e={};this.peekStartsWith("/(")&&(this.capture("/"),e=this.parseParens(!0));var n={};return this.peekStartsWith("(")&&(n=this.parseParens(!1)),(t.length>0||Object.keys(e).length>0)&&(n[qe]=new an(t,e)),n},t.prototype.parseSegment=function(){var t=_n(this.remaining);if(""===t&&this.peekStartsWith(";"))throw new Error("Empty path url segment cannot have parameters: '"+this.remaining+"'.");return this.capture(t),new sn(mn(t),this.parseMatrixParams())},t.prototype.parseMatrixParams=function(){for(var t={};this.consumeOptional(";");)this.parseParam(t);return t},t.prototype.parseParam=function(t){var e=_n(this.remaining);if(e){this.capture(e);var n="";if(this.consumeOptional("=")){var r=_n(this.remaining);r&&this.capture(n=r)}t[mn(e)]=mn(n)}},t.prototype.parseQueryParam=function(t){var e,n=(e=this.remaining.match(Sn))?e[0]:"";if(n){this.capture(n);var r="";if(this.consumeOptional("=")){var i=function(t){var e=t.match(En);return e?e[0]:""}(this.remaining);i&&this.capture(r=i)}var o=vn(n),a=vn(r);if(t.hasOwnProperty(o)){var s=t[o];Array.isArray(s)||(t[o]=s=[s]),s.push(a)}else t[o]=a}},t.prototype.parseParens=function(t){var e={};for(this.capture("(");!this.consumeOptional(")")&&this.remaining.length>0;){var n=_n(this.remaining),r=this.remaining[n.length];if("/"!==r&&")"!==r&&";"!==r)throw new Error("Cannot parse url '"+this.url+"'");var i=void 0;n.indexOf(":")>-1?(i=n.substr(0,n.indexOf(":")),this.capture(i),this.capture(":")):t&&(i=qe);var o=this.parseChildren();e[i]=1===Object.keys(o).length?o[qe]:new an([],o),this.consumeOptional("//")}return e},t.prototype.peekStartsWith=function(t){return this.remaining.startsWith(t)},t.prototype.consumeOptional=function(t){return!!this.peekStartsWith(t)&&(this.remaining=this.remaining.substring(t.length),!0)},t.prototype.capture=function(t){if(!this.consumeOptional(t))throw new Error('Expected "'+t+'".')},t}(),Cn=function(){function t(t){this._root=t}return Object.defineProperty(t.prototype,"root",{get:function(){return this._root.value},enumerable:!0,configurable:!0}),t.prototype.parent=function(t){var e=this.pathFromRoot(t);return e.length>1?e[e.length-2]:null},t.prototype.children=function(t){var e=In(t,this._root);return e?e.children.map(function(t){return t.value}):[]},t.prototype.firstChild=function(t){var e=In(t,this._root);return e&&e.children.length>0?e.children[0].value:null},t.prototype.siblings=function(t){var e=An(t,this._root);return e.length<2?[]:e[e.length-2].children.map(function(t){return t.value}).filter(function(e){return e!==t})},t.prototype.pathFromRoot=function(t){return An(t,this._root).map(function(t){return t.value})},t}();function In(t,e){var n,r;if(t===e.value)return e;try{for(var i=Object(a.h)(e.children),o=i.next();!o.done;o=i.next()){var s=In(t,o.value);if(s)return s}}catch(u){n={error:u}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return null}function An(t,e){var n,r;if(t===e.value)return[e];try{for(var i=Object(a.h)(e.children),o=i.next();!o.done;o=i.next()){var s=An(t,o.value);if(s.length)return s.unshift(e),s}}catch(u){n={error:u}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return[]}var On=function(){function t(t,e){this.value=t,this.children=e}return t.prototype.toString=function(){return"TreeNode("+this.value+")"},t}();function Dn(t){var e={};return t&&t.children.forEach(function(t){return e[t.value.outlet]=t}),e}var kn=function(t){function e(e,n){var r=t.call(this,e)||this;return r.snapshot=n,jn(r,e),r}return Object(a.c)(e,t),e.prototype.toString=function(){return this.snapshot.toString()},e}(Cn);function Nn(t,e){var n=function(t,e){var n=new xn([],{},{},"",{},qe,e,null,t.root,-1,{});return new Mn("",new On(n,[]))}(t,e),r=new h([new sn("",{})]),i=new h({}),o=new h({}),a=new h({}),s=new h(""),u=new Pn(r,i,a,s,o,qe,e,n.root);return u.snapshot=n.root,new kn(new On(u,[]),n)}var Pn=function(){function t(t,e,n,r,i,o,a,s){this.url=t,this.params=e,this.queryParams=n,this.fragment=r,this.data=i,this.outlet=o,this.component=a,this._futureSnapshot=s}return Object.defineProperty(t.prototype,"routeConfig",{get:function(){return this._futureSnapshot.routeConfig},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"root",{get:function(){return this._routerState.root},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){return this._routerState.parent(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"firstChild",{get:function(){return this._routerState.firstChild(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"children",{get:function(){return this._routerState.children(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"pathFromRoot",{get:function(){return this._routerState.pathFromRoot(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"paramMap",{get:function(){return this._paramMap||(this._paramMap=this.params.pipe(Object(C.a)(function(t){return He(t)}))),this._paramMap},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"queryParamMap",{get:function(){return this._queryParamMap||(this._queryParamMap=this.queryParams.pipe(Object(C.a)(function(t){return He(t)}))),this._queryParamMap},enumerable:!0,configurable:!0}),t.prototype.toString=function(){return this.snapshot?this.snapshot.toString():"Future("+this._futureSnapshot+")"},t}();function Rn(t,e){void 0===e&&(e="emptyOnly");var n=t.pathFromRoot,r=0;if("always"!==e)for(r=n.length-1;r>=1;){var i=n[r],o=n[r-1];if(i.routeConfig&&""===i.routeConfig.path)r--;else{if(o.component)break;r--}}return function(t){return t.reduce(function(t,e){return{params:Object(a.a)({},t.params,e.params),data:Object(a.a)({},t.data,e.data),resolve:Object(a.a)({},t.resolve,e._resolvedData)}},{params:{},data:{},resolve:{}})}(n.slice(r))}var xn=function(){function t(t,e,n,r,i,o,a,s,u,c,l){this.url=t,this.params=e,this.queryParams=n,this.fragment=r,this.data=i,this.outlet=o,this.component=a,this.routeConfig=s,this._urlSegment=u,this._lastPathIndex=c,this._resolve=l}return Object.defineProperty(t.prototype,"root",{get:function(){return this._routerState.root},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){return this._routerState.parent(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"firstChild",{get:function(){return this._routerState.firstChild(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"children",{get:function(){return this._routerState.children(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"pathFromRoot",{get:function(){return this._routerState.pathFromRoot(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"paramMap",{get:function(){return this._paramMap||(this._paramMap=He(this.params)),this._paramMap},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"queryParamMap",{get:function(){return this._queryParamMap||(this._queryParamMap=He(this.queryParams)),this._queryParamMap},enumerable:!0,configurable:!0}),t.prototype.toString=function(){return"Route(url:'"+this.url.map(function(t){return t.toString()}).join("/")+"', path:'"+(this.routeConfig?this.routeConfig.path:"")+"')"},t}(),Mn=function(t){function e(e,n){var r=t.call(this,n)||this;return r.url=e,jn(r,n),r}return Object(a.c)(e,t),e.prototype.toString=function(){return Ln(this._root)},e}(Cn);function jn(t,e){e.value._routerState=t,e.children.forEach(function(e){return jn(t,e)})}function Ln(t){var e=t.children.length>0?" { "+t.children.map(Ln).join(", ")+" } ":"";return""+t.value+e}function Un(t){if(t.snapshot){var e=t.snapshot,n=t._futureSnapshot;t.snapshot=n,Ze(e.queryParams,n.queryParams)||t.queryParams.next(n.queryParams),e.fragment!==n.fragment&&t.fragment.next(n.fragment),Ze(e.params,n.params)||t.params.next(n.params),function(t,e){if(t.length!==e.length)return!1;for(var n=0;n<t.length;++n)if(!Ze(t[n],e[n]))return!1;return!0}(e.url,n.url)||t.url.next(n.url),Ze(e.data,n.data)||t.data.next(n.data)}else t.snapshot=t._futureSnapshot,t.data.next(t._futureSnapshot.data)}function Vn(t,e){var n,r;return Ze(t.params,e.params)&&un(n=t.url,r=e.url)&&n.every(function(t,e){return Ze(t.parameters,r[e].parameters)})&&!(!t.parent!=!e.parent)&&(!t.parent||Vn(t.parent,e.parent))}function Fn(t){return"object"==typeof t&&null!=t&&!t.outlets&&!t.segmentPath}function qn(t,e,n,r,i){var o={};return r&&en(r,function(t,e){o[e]=Array.isArray(t)?t.map(function(t){return""+t}):""+t}),new on(n.root===t?e:function t(e,n,r){var i={};return en(e.children,function(e,o){i[o]=e===n?r:t(e,n,r)}),new an(e.segments,i)}(n.root,t,e),o,i)}var Bn=function(){function t(t,e,n){if(this.isAbsolute=t,this.numberOfDoubleDots=e,this.commands=n,t&&n.length>0&&Fn(n[0]))throw new Error("Root segment cannot have matrix parameters");var r=n.find(function(t){return"object"==typeof t&&null!=t&&t.outlets});if(r&&r!==tn(n))throw new Error("{outlets:{}} has to be the last command")}return t.prototype.toRoot=function(){return this.isAbsolute&&1===this.commands.length&&"/"==this.commands[0]},t}(),Hn=function(){return function(t,e,n){this.segmentGroup=t,this.processChildren=e,this.index=n}}();function zn(t){return"object"==typeof t&&null!=t&&t.outlets?t.outlets[qe]:""+t}function Wn(t,e,n){if(t||(t=new an([],{})),0===t.segments.length&&t.hasChildren())return Kn(t,e,n);var r=function(t,e,n){for(var r=0,i=e,o={match:!1,pathIndex:0,commandIndex:0};i<t.segments.length;){if(r>=n.length)return o;var a=t.segments[i],s=zn(n[r]),u=r<n.length-1?n[r+1]:null;if(i>0&&void 0===s)break;if(s&&u&&"object"==typeof u&&void 0===u.outlets){if(!Yn(s,u,a))return o;r+=2}else{if(!Yn(s,{},a))return o;r++}i++}return{match:!0,pathIndex:i,commandIndex:r}}(t,e,n),i=n.slice(r.commandIndex);if(r.match&&r.pathIndex<t.segments.length){var o=new an(t.segments.slice(0,r.pathIndex),{});return o.children[qe]=new an(t.segments.slice(r.pathIndex),t.children),Kn(o,0,i)}return r.match&&0===i.length?new an(t.segments,{}):r.match&&!t.hasChildren()?Gn(t,e,n):r.match?Kn(t,0,i):Gn(t,e,n)}function Kn(t,e,n){if(0===n.length)return new an(t.segments,{});var r=function(t){var e,n;return"object"!=typeof t[0]?((e={})[qe]=t,e):void 0===t[0].outlets?((n={})[qe]=t,n):t[0].outlets}(n),i={};return en(r,function(n,r){null!==n&&(i[r]=Wn(t.children[r],e,n))}),en(t.children,function(t,e){void 0===r[e]&&(i[e]=t)}),new an(t.segments,i)}function Gn(t,e,n){for(var r=t.segments.slice(0,e),i=0;i<n.length;){if("object"==typeof n[i]&&void 0!==n[i].outlets){var o=Qn(n[i].outlets);return new an(r,o)}if(0===i&&Fn(n[0]))r.push(new sn(t.segments[e].path,n[0])),i++;else{var a=zn(n[i]),s=i<n.length-1?n[i+1]:null;a&&s&&Fn(s)?(r.push(new sn(a,Xn(s))),i+=2):(r.push(new sn(a,{})),i++)}}return new an(r,{})}function Qn(t){var e={};return en(t,function(t,n){null!==t&&(e[n]=Gn(new an([],{}),0,t))}),e}function Xn(t){var e={};return en(t,function(t,n){return e[n]=""+t}),e}function Yn(t,e,n){return t==n.path&&Ze(e,n.parameters)}var Jn=function(){function t(t,e,n,r){this.routeReuseStrategy=t,this.futureState=e,this.currState=n,this.forwardEvent=r}return t.prototype.activate=function(t){var e=this.futureState._root,n=this.currState?this.currState._root:null;this.deactivateChildRoutes(e,n,t),Un(this.futureState.root),this.activateChildRoutes(e,n,t)},t.prototype.deactivateChildRoutes=function(t,e,n){var r=this,i=Dn(e);t.children.forEach(function(t){var e=t.value.outlet;r.deactivateRoutes(t,i[e],n),delete i[e]}),en(i,function(t,e){r.deactivateRouteAndItsChildren(t,n)})},t.prototype.deactivateRoutes=function(t,e,n){var r=t.value,i=e?e.value:null;if(r===i)if(r.component){var o=n.getContext(r.outlet);o&&this.deactivateChildRoutes(t,e,o.children)}else this.deactivateChildRoutes(t,e,n);else i&&this.deactivateRouteAndItsChildren(e,n)},t.prototype.deactivateRouteAndItsChildren=function(t,e){this.routeReuseStrategy.shouldDetach(t.value.snapshot)?this.detachAndStoreRouteSubtree(t,e):this.deactivateRouteAndOutlet(t,e)},t.prototype.detachAndStoreRouteSubtree=function(t,e){var n=e.getContext(t.value.outlet);if(n&&n.outlet){var r=n.outlet.detach(),i=n.children.onOutletDeactivated();this.routeReuseStrategy.store(t.value.snapshot,{componentRef:r,route:t,contexts:i})}},t.prototype.deactivateRouteAndOutlet=function(t,e){var n=this,r=e.getContext(t.value.outlet);if(r){var i=Dn(t),o=t.value.component?r.children:e;en(i,function(t,e){return n.deactivateRouteAndItsChildren(t,o)}),r.outlet&&(r.outlet.deactivate(),r.children.onOutletDeactivated())}},t.prototype.activateChildRoutes=function(t,e,n){var r=this,i=Dn(e);t.children.forEach(function(t){r.activateRoutes(t,i[t.value.outlet],n),r.forwardEvent(new Ue(t.value.snapshot))}),t.children.length&&this.forwardEvent(new je(t.value.snapshot))},t.prototype.activateRoutes=function(t,e,n){var r=t.value,i=e?e.value:null;if(Un(r),r===i)if(r.component){var o=n.getOrCreateContext(r.outlet);this.activateChildRoutes(t,e,o.children)}else this.activateChildRoutes(t,e,n);else if(r.component)if(o=n.getOrCreateContext(r.outlet),this.routeReuseStrategy.shouldAttach(r.snapshot)){var a=this.routeReuseStrategy.retrieve(r.snapshot);this.routeReuseStrategy.store(r.snapshot,null),o.children.onOutletReAttached(a.contexts),o.attachRef=a.componentRef,o.route=a.route.value,o.outlet&&o.outlet.attach(a.componentRef,a.route.value),Zn(a.route)}else{var s=function(t){for(var e=r.snapshot.parent;e;e=e.parent){var n=e.routeConfig;if(n&&n._loadedConfig)return n._loadedConfig;if(n&&n.component)return null}return null}(),u=s?s.module.componentFactoryResolver:null;o.attachRef=null,o.route=r,o.resolver=u,o.outlet&&o.outlet.activateWith(r,u),this.activateChildRoutes(t,null,o.children)}else this.activateChildRoutes(t,null,n)},t}();function Zn(t){Un(t.value),t.children.forEach(Zn)}function $n(t){return"function"==typeof t}function tr(t){return t instanceof on}var er=function(){return function(t){this.segmentGroup=t||null}}(),nr=function(){return function(t){this.urlTree=t}}();function rr(t){return new f.a(function(e){return e.error(new er(t))})}function ir(t){return new f.a(function(e){return e.error(new nr(t))})}function or(t){return new f.a(function(e){return e.error(new Error("Only absolute redirects can have named outlets. redirectTo: '"+t+"'"))})}var ar=function(){function t(t,e,n,i,o){this.configLoader=e,this.urlSerializer=n,this.urlTree=i,this.config=o,this.allowRedirects=!0,this.ngModule=t.get(r.x)}return t.prototype.apply=function(){var t=this;return this.expandSegmentGroup(this.ngModule,this.config,this.urlTree.root,qe).pipe(Object(C.a)(function(e){return t.createUrlTree(e,t.urlTree.queryParams,t.urlTree.fragment)})).pipe(Q(function(e){if(e instanceof nr)return t.allowRedirects=!1,t.match(e.urlTree);if(e instanceof er)throw t.noMatchError(e);throw e}))},t.prototype.match=function(t){var e=this;return this.expandSegmentGroup(this.ngModule,this.config,t.root,qe).pipe(Object(C.a)(function(n){return e.createUrlTree(n,t.queryParams,t.fragment)})).pipe(Q(function(t){if(t instanceof er)throw e.noMatchError(t);throw t}))},t.prototype.noMatchError=function(t){return new Error("Cannot match any routes. URL Segment: '"+t.segmentGroup+"'")},t.prototype.createUrlTree=function(t,e,n){var r,i=t.segments.length>0?new an([],((r={})[qe]=t,r)):t;return new on(i,e,n)},t.prototype.expandSegmentGroup=function(t,e,n,r){return 0===n.segments.length&&n.hasChildren()?this.expandChildren(t,e,n).pipe(Object(C.a)(function(t){return new an([],t)})):this.expandSegment(t,n,e,n.segments,r,!0)},t.prototype.expandChildren=function(t,e,n){var r=this;return function(n,i){if(0===Object.keys(n).length)return Object(s.a)({});var o=[],a=[],u={};return en(n,function(n,i){var s,c,l=(s=i,c=n,r.expandSegmentGroup(t,e,c,s)).pipe(Object(C.a)(function(t){return u[i]=t}));i===qe?o.push(l):a.push(l)}),s.a.apply(null,o.concat(a)).pipe(A(),K(),Object(C.a)(function(){return u}))}(n.children)},t.prototype.expandSegment=function(t,e,n,r,i,o){var u=this;return s.a.apply(void 0,Object(a.g)(n)).pipe(Object(C.a)(function(a){return u.expandSegmentAgainstRoute(t,e,n,a,r,i,o).pipe(Q(function(t){if(t instanceof er)return Object(s.a)(null);throw t}))}),A(),tt(function(t){return!!t}),Q(function(t,n){if(t instanceof d||"EmptyError"===t.name){if(u.noLeftoversInUrl(e,r,i))return Object(s.a)(new an([],{}));throw new er(e)}throw t}))},t.prototype.noLeftoversInUrl=function(t,e,n){return 0===e.length&&!t.children[n]},t.prototype.expandSegmentAgainstRoute=function(t,e,n,r,i,o,a){return lr(r)!==o?rr(e):void 0===r.redirectTo?this.matchSegmentAgainstRoute(t,e,r,i):a&&this.allowRedirects?this.expandSegmentAgainstRouteUsingRedirect(t,e,n,r,i,o):rr(e)},t.prototype.expandSegmentAgainstRouteUsingRedirect=function(t,e,n,r,i,o){return"**"===r.path?this.expandWildCardWithParamsAgainstRouteUsingRedirect(t,n,r,o):this.expandRegularSegmentAgainstRouteUsingRedirect(t,e,n,r,i,o)},t.prototype.expandWildCardWithParamsAgainstRouteUsingRedirect=function(t,e,n,r){var i=this,o=this.applyRedirectCommands([],n.redirectTo,{});return n.redirectTo.startsWith("/")?ir(o):this.lineralizeSegments(n,o).pipe(Object(et.a)(function(n){var o=new an(n,{});return i.expandSegment(t,o,e,n,r,!1)}))},t.prototype.expandRegularSegmentAgainstRouteUsingRedirect=function(t,e,n,r,i,o){var a=this,s=sr(e,r,i),u=s.consumedSegments,c=s.lastChild,l=s.positionalParamSegments;if(!s.matched)return rr(e);var h=this.applyRedirectCommands(u,r.redirectTo,l);return r.redirectTo.startsWith("/")?ir(h):this.lineralizeSegments(r,h).pipe(Object(et.a)(function(r){return a.expandSegment(t,e,n,r.concat(i.slice(c)),o,!1)}))},t.prototype.matchSegmentAgainstRoute=function(t,e,n,r){var i=this;if("**"===n.path)return n.loadChildren?this.configLoader.load(t.injector,n).pipe(Object(C.a)(function(t){return n._loadedConfig=t,new an(r,{})})):Object(s.a)(new an(r,{}));var o=sr(e,n,r),u=o.consumedSegments,c=o.lastChild;if(!o.matched)return rr(e);var l=r.slice(c);return this.getChildConfig(t,n,r).pipe(Object(et.a)(function(t){var n=t.module,r=t.routes,o=function(t,e,n,r){return n.length>0&&function(t,e,n){return r.some(function(n){return cr(t,e,n)&&lr(n)!==qe})}(t,n)?{segmentGroup:ur(new an(e,function(t,e){var n,r,i={};i[qe]=e;try{for(var o=Object(a.h)(t),s=o.next();!s.done;s=o.next()){var u=s.value;""===u.path&&lr(u)!==qe&&(i[lr(u)]=new an([],{}))}}catch(c){n={error:c}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return i}(r,new an(n,t.children)))),slicedSegments:[]}:0===n.length&&function(t,e,n){return r.some(function(n){return cr(t,e,n)})}(t,n)?{segmentGroup:ur(new an(t.segments,function(t,e,n,r){var i,o,s={};try{for(var u=Object(a.h)(n),c=u.next();!c.done;c=u.next()){var l=c.value;cr(t,e,l)&&!r[lr(l)]&&(s[lr(l)]=new an([],{}))}}catch(h){i={error:h}}finally{try{c&&!c.done&&(o=u.return)&&o.call(u)}finally{if(i)throw i.error}}return Object(a.a)({},r,s)}(t,n,r,t.children))),slicedSegments:n}:{segmentGroup:t,slicedSegments:n}}(e,u,l,r),c=o.segmentGroup,h=o.slicedSegments;return 0===h.length&&c.hasChildren()?i.expandChildren(n,r,c).pipe(Object(C.a)(function(t){return new an(u,t)})):0===r.length&&0===h.length?Object(s.a)(new an(u,{})):i.expandSegment(n,c,r,h,qe,!0).pipe(Object(C.a)(function(t){return new an(u.concat(t.segments),t.children)}))}))},t.prototype.getChildConfig=function(t,e,n){var r=this;return e.children?Object(s.a)(new Ge(e.children,t)):e.loadChildren?void 0!==e._loadedConfig?Object(s.a)(e._loadedConfig):function(t,e,n){var r,i=e.canLoad;return i&&0!==i.length?Object(u.a)(i).pipe(Object(C.a)(function(r){var i,o=t.get(r);if(function(t){return t&&$n(t.canLoad)}(o))i=o.canLoad(e,n);else{if(!$n(o))throw new Error("Invalid CanLoad guard");i=o(e,n)}return nn(i)})).pipe(A(),(r=function(t){return!0===t},function(t){return t.lift(new nt(r,void 0,t))})):Object(s.a)(!0)}(t.injector,e,n).pipe(Object(et.a)(function(n){return n?r.configLoader.load(t.injector,e).pipe(Object(C.a)(function(t){return e._loadedConfig=t,t})):function(t){return new f.a(function(e){return e.error(We("Cannot load children because the guard of the route \"path: '"+t.path+"'\" returned false"))})}(e)})):Object(s.a)(new Ge([],t))},t.prototype.lineralizeSegments=function(t,e){for(var n=[],r=e.root;;){if(n=n.concat(r.segments),0===r.numberOfChildren)return Object(s.a)(n);if(r.numberOfChildren>1||!r.children[qe])return or(t.redirectTo);r=r.children[qe]}},t.prototype.applyRedirectCommands=function(t,e,n){return this.applyRedirectCreatreUrlTree(e,this.urlSerializer.parse(e),t,n)},t.prototype.applyRedirectCreatreUrlTree=function(t,e,n,r){var i=this.createSegmentGroup(t,e.root,n,r);return new on(i,this.createQueryParams(e.queryParams,this.urlTree.queryParams),e.fragment)},t.prototype.createQueryParams=function(t,e){var n={};return en(t,function(t,r){if("string"==typeof t&&t.startsWith(":")){var i=t.substring(1);n[r]=e[i]}else n[r]=t}),n},t.prototype.createSegmentGroup=function(t,e,n,r){var i=this,o=this.createSegments(t,e.segments,n,r),a={};return en(e.children,function(e,o){a[o]=i.createSegmentGroup(t,e,n,r)}),new an(o,a)},t.prototype.createSegments=function(t,e,n,r){var i=this;return e.map(function(e){return e.path.startsWith(":")?i.findPosParam(t,e,r):i.findOrReturn(e,n)})},t.prototype.findPosParam=function(t,e,n){var r=n[e.path.substring(1)];if(!r)throw new Error("Cannot redirect to '"+t+"'. Cannot find '"+e.path+"'.");return r},t.prototype.findOrReturn=function(t,e){var n,r,i=0;try{for(var o=Object(a.h)(e),s=o.next();!s.done;s=o.next()){var u=s.value;if(u.path===t.path)return e.splice(i),u;i++}}catch(c){n={error:c}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return t},t}();function sr(t,e,n){if(""===e.path)return"full"===e.pathMatch&&(t.hasChildren()||n.length>0)?{matched:!1,consumedSegments:[],lastChild:0,positionalParamSegments:{}}:{matched:!0,consumedSegments:[],lastChild:0,positionalParamSegments:{}};var r=(e.matcher||Ke)(n,t,e);return r?{matched:!0,consumedSegments:r.consumed,lastChild:r.consumed.length,positionalParamSegments:r.posParams}:{matched:!1,consumedSegments:[],lastChild:0,positionalParamSegments:{}}}function ur(t){if(1===t.numberOfChildren&&t.children[qe]){var e=t.children[qe];return new an(t.segments.concat(e.segments),e.children)}return t}function cr(t,e,n){return(!(t.hasChildren()||e.length>0)||"full"!==n.pathMatch)&&""===n.path&&void 0!==n.redirectTo}function lr(t){return t.outlet||qe}var hr=function(){return function(t){this.path=t,this.route=this.path[this.path.length-1]}}(),fr=function(){return function(t,e){this.component=t,this.route=e}}();function pr(t,e,n){var r=function(t){if(!t)return null;for(var e=t.parent;e;e=e.parent){var n=e.routeConfig;if(n&&n._loadedConfig)return n._loadedConfig}return null}(e);return(r?r.module.injector:n).get(t)}function dr(t,e,n,r,i){void 0===i&&(i={canDeactivateChecks:[],canActivateChecks:[]});var o=Dn(e);return t.children.forEach(function(t){!function(t,e,n,r,i){void 0===i&&(i={canDeactivateChecks:[],canActivateChecks:[]});var o=t.value,a=e?e.value:null,s=n?n.getContext(t.value.outlet):null;if(a&&o.routeConfig===a.routeConfig){var u=function(t,e,n){switch(n){case"pathParamsChange":return!un(t.url,e.url);case"always":return!0;case"paramsOrQueryParamsChange":return!Vn(t,e)||!Ze(t.queryParams,e.queryParams);case"paramsChange":default:return!Vn(t,e)}}(a,o,o.routeConfig.runGuardsAndResolvers);u?i.canActivateChecks.push(new hr(r)):(o.data=a.data,o._resolvedData=a._resolvedData),dr(t,e,o.component?s?s.children:null:n,r,i),u&&i.canDeactivateChecks.push(new fr(s&&s.outlet&&s.outlet.component||null,a))}else a&&yr(e,s,i),i.canActivateChecks.push(new hr(r)),dr(t,null,o.component?s?s.children:null:n,r,i)}(t,o[t.value.outlet],n,r.concat([t.value]),i),delete o[t.value.outlet]}),en(o,function(t,e){return yr(t,n.getContext(e),i)}),i}function yr(t,e,n){var r=Dn(t),i=t.value;en(r,function(t,r){yr(t,i.component?e?e.children.getContext(r):null:e,n)}),n.canDeactivateChecks.push(new fr(i.component&&e&&e.outlet&&e.outlet.isActivated?e.outlet.component:null,i))}var gr=Symbol("INITIAL_VALUE");function mr(){return Object(it.a)(function(t){return(function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=null,r=null;return Object(y.a)(t[t.length-1])&&(r=t.pop()),"function"==typeof t[t.length-1]&&(n=t.pop()),1===t.length&&Object(g.a)(t[0])&&(t=t[0]),Object(b.a)(t,r).lift(new _(n))}).apply(void 0,Object(a.g)(t.map(function(t){return t.pipe(J(1),function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){var n=t[t.length-1];Object(y.a)(n)?t.pop():n=null;var r=t.length;return function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return 1===t.length||2===t.length&&Object(y.a)(t[1])?Object(u.a)(t[0]):A()(s.a.apply(void 0,t))}(1!==r||n?r>0?Object(b.a)(t,n):Object(E.b)(n):Object(ot.a)(t[0]),e)}}(gr))}))).pipe(Object(at.a)(function(t,e){var n=!1;return e.reduce(function(t,r,i){if(t!==gr)return t;if(r===gr&&(n=!0),!n){if(!1===r)return r;if(i===e.length-1||tr(r))return r}return t},t)},gr),Object(O.a)(function(t){return t!==gr}),Object(C.a)(function(t){return tr(t)?t:!0===t}),J(1))})}function vr(t,e){return null!==t&&e&&e(new Le(t)),Object(s.a)(!0)}function br(t,e){return null!==t&&e&&e(new Me(t)),Object(s.a)(!0)}function wr(t,e,n){var r=e.routeConfig?e.routeConfig.canActivate:null;if(!r||0===r.length)return Object(s.a)(!0);var i=r.map(function(r){return T(function(){var i,o=pr(r,e,n);if(function(t){return t&&$n(t.canActivate)}(o))i=nn(o.canActivate(e,t));else{if(!$n(o))throw new Error("Invalid CanActivate guard");i=nn(o(e,t))}return i.pipe(tt())})});return Object(s.a)(i).pipe(mr())}function _r(t,e,n){var r=e[e.length-1],i=e.slice(0,e.length-1).reverse().map(function(t){return function(t){var e=t.routeConfig?t.routeConfig.canActivateChild:null;return e&&0!==e.length?{node:t,guards:e}:null}(t)}).filter(function(t){return null!==t}).map(function(e){return T(function(){var i=e.guards.map(function(i){var o,a=pr(i,e.node,n);if(function(t){return t&&$n(t.canActivateChild)}(a))o=nn(a.canActivateChild(r,t));else{if(!$n(a))throw new Error("Invalid CanActivateChild guard");o=nn(a(r,t))}return o.pipe(tt())});return Object(s.a)(i).pipe(mr())})});return Object(s.a)(i).pipe(mr())}var Sr=function(){return function(){}}(),Er=function(){function t(t,e,n,r,i,o){this.rootComponentType=t,this.config=e,this.urlTree=n,this.url=r,this.paramsInheritanceStrategy=i,this.relativeLinkResolution=o}return t.prototype.recognize=function(){try{var t=Ir(this.urlTree.root,[],[],this.config,this.relativeLinkResolution).segmentGroup,e=this.processSegmentGroup(this.config,t,qe),n=new xn([],Object.freeze({}),Object.freeze(Object(a.a)({},this.urlTree.queryParams)),this.urlTree.fragment,{},qe,this.rootComponentType,null,this.urlTree.root,-1,{}),r=new On(n,e),i=new Mn(this.url,r);return this.inheritParamsAndData(i._root),Object(s.a)(i)}catch(o){return new f.a(function(t){return t.error(o)})}},t.prototype.inheritParamsAndData=function(t){var e=this,n=t.value,r=Rn(n,this.paramsInheritanceStrategy);n.params=Object.freeze(r.params),n.data=Object.freeze(r.data),t.children.forEach(function(t){return e.inheritParamsAndData(t)})},t.prototype.processSegmentGroup=function(t,e,n){return 0===e.segments.length&&e.hasChildren()?this.processChildren(t,e):this.processSegment(t,e,e.segments,n)},t.prototype.processChildren=function(t,e){var n,r=this,i=cn(e,function(e,n){return r.processSegmentGroup(t,e,n)});return n={},i.forEach(function(t){var e=n[t.value.outlet];if(e){var r=e.url.map(function(t){return t.toString()}).join("/"),i=t.value.url.map(function(t){return t.toString()}).join("/");throw new Error("Two segments cannot have the same outlet name: '"+r+"' and '"+i+"'.")}n[t.value.outlet]=t.value}),i.sort(function(t,e){return t.value.outlet===qe?-1:e.value.outlet===qe?1:t.value.outlet.localeCompare(e.value.outlet)}),i},t.prototype.processSegment=function(t,e,n,r){var i,o;try{for(var s=Object(a.h)(t),u=s.next();!u.done;u=s.next()){var c=u.value;try{return this.processSegmentAgainstRoute(c,e,n,r)}catch(l){if(!(l instanceof Sr))throw l}}}catch(h){i={error:h}}finally{try{u&&!u.done&&(o=s.return)&&o.call(s)}finally{if(i)throw i.error}}if(this.noLeftoversInUrl(e,n,r))return[];throw new Sr},t.prototype.noLeftoversInUrl=function(t,e,n){return 0===e.length&&!t.children[n]},t.prototype.processSegmentAgainstRoute=function(t,e,n,r){if(t.redirectTo)throw new Sr;if((t.outlet||qe)!==r)throw new Sr;var i,o=[],s=[];if("**"===t.path){var u=n.length>0?tn(n).parameters:{};i=new xn(n,u,Object.freeze(Object(a.a)({},this.urlTree.queryParams)),this.urlTree.fragment,Dr(t),r,t.component,t,Tr(e),Cr(e)+n.length,kr(t))}else{var c=function(t,e,n){if(""===e.path){if("full"===e.pathMatch&&(t.hasChildren()||n.length>0))throw new Sr;return{consumedSegments:[],lastChild:0,parameters:{}}}var r=(e.matcher||Ke)(n,t,e);if(!r)throw new Sr;var i={};en(r.posParams,function(t,e){i[e]=t.path});var o=r.consumed.length>0?Object(a.a)({},i,r.consumed[r.consumed.length-1].parameters):i;return{consumedSegments:r.consumed,lastChild:r.consumed.length,parameters:o}}(e,t,n);o=c.consumedSegments,s=n.slice(c.lastChild),i=new xn(o,c.parameters,Object.freeze(Object(a.a)({},this.urlTree.queryParams)),this.urlTree.fragment,Dr(t),r,t.component,t,Tr(e),Cr(e)+o.length,kr(t))}var l=function(t){return t.children?t.children:t.loadChildren?t._loadedConfig.routes:[]}(t),h=Ir(e,o,s,l,this.relativeLinkResolution),f=h.segmentGroup,p=h.slicedSegments;if(0===p.length&&f.hasChildren()){var d=this.processChildren(l,f);return[new On(i,d)]}if(0===l.length&&0===p.length)return[new On(i,[])];var y=this.processSegment(l,f,p,qe);return[new On(i,y)]},t}();function Tr(t){for(var e=t;e._sourceSegment;)e=e._sourceSegment;return e}function Cr(t){for(var e=t,n=e._segmentIndexShift?e._segmentIndexShift:0;e._sourceSegment;)n+=(e=e._sourceSegment)._segmentIndexShift?e._segmentIndexShift:0;return n-1}function Ir(t,e,n,r,i){if(n.length>0&&function(t,e,n){return r.some(function(n){return Ar(t,e,n)&&Or(n)!==qe})}(t,n)){var o=new an(e,function(t,e,n,r){var i,o,s={};s[qe]=r,r._sourceSegment=t,r._segmentIndexShift=e.length;try{for(var u=Object(a.h)(n),c=u.next();!c.done;c=u.next()){var l=c.value;if(""===l.path&&Or(l)!==qe){var h=new an([],{});h._sourceSegment=t,h._segmentIndexShift=e.length,s[Or(l)]=h}}}catch(f){i={error:f}}finally{try{c&&!c.done&&(o=u.return)&&o.call(u)}finally{if(i)throw i.error}}return s}(t,e,r,new an(n,t.children)));return o._sourceSegment=t,o._segmentIndexShift=e.length,{segmentGroup:o,slicedSegments:[]}}if(0===n.length&&function(t,e,n){return r.some(function(n){return Ar(t,e,n)})}(t,n)){var s=new an(t.segments,function(t,e,n,r,i,o){var s,u,c={};try{for(var l=Object(a.h)(r),h=l.next();!h.done;h=l.next()){var f=h.value;if(Ar(t,n,f)&&!i[Or(f)]){var p=new an([],{});p._sourceSegment=t,p._segmentIndexShift="legacy"===o?t.segments.length:e.length,c[Or(f)]=p}}}catch(d){s={error:d}}finally{try{h&&!h.done&&(u=l.return)&&u.call(l)}finally{if(s)throw s.error}}return Object(a.a)({},i,c)}(t,e,n,r,t.children,i));return s._sourceSegment=t,s._segmentIndexShift=e.length,{segmentGroup:s,slicedSegments:n}}var u=new an(t.segments,t.children);return u._sourceSegment=t,u._segmentIndexShift=e.length,{segmentGroup:u,slicedSegments:n}}function Ar(t,e,n){return(!(t.hasChildren()||e.length>0)||"full"!==n.pathMatch)&&""===n.path&&void 0===n.redirectTo}function Or(t){return t.outlet||qe}function Dr(t){return t.data||{}}function kr(t){return t.resolve||{}}function Nr(t,e,n,r){var i=pr(t,e,r);return nn(i.resolve?i.resolve(e,n):i(e,n))}function Pr(t){return function(e){return e.pipe(Object(it.a)(function(e){var n=t(e);return n?Object(u.a)(n).pipe(Object(C.a)(function(){return e})):Object(u.a)([e])}))}}var Rr=function(){return function(){}}(),xr=function(){function t(){}return t.prototype.shouldDetach=function(t){return!1},t.prototype.store=function(t,e){},t.prototype.shouldAttach=function(t){return!1},t.prototype.retrieve=function(t){return null},t.prototype.shouldReuseRoute=function(t,e){return t.routeConfig===e.routeConfig},t}(),Mr=new r.p("ROUTES"),jr=function(){function t(t,e,n,r){this.loader=t,this.compiler=e,this.onLoadStartListener=n,this.onLoadEndListener=r}return t.prototype.load=function(t,e){var n=this;return this.onLoadStartListener&&this.onLoadStartListener(e),this.loadModuleFactory(e.loadChildren).pipe(Object(C.a)(function(r){n.onLoadEndListener&&n.onLoadEndListener(e);var i=r.create(t);return new Ge($e(i.injector.get(Mr)).map(Je),i)}))},t.prototype.loadModuleFactory=function(t){var e=this;return"string"==typeof t?Object(u.a)(this.loader.load(t)):nn(t()).pipe(Object(et.a)(function(t){return t instanceof r.v?Object(s.a)(t):Object(u.a)(e.compiler.compileModuleAsync(t))}))},t}(),Lr=function(){return function(){}}(),Ur=function(){function t(){}return t.prototype.shouldProcessUrl=function(t){return!0},t.prototype.extract=function(t){return t},t.prototype.merge=function(t,e){return t},t}();function Vr(t){throw t}function Fr(t,e,n){return e.parse("/")}function qr(t,e){return Object(s.a)(null)}var Br=function(){function t(t,e,n,i,o,a,s,u){var l=this;this.rootComponentType=t,this.urlSerializer=e,this.rootContexts=n,this.location=i,this.config=u,this.navigationId=0,this.isNgZoneEnabled=!1,this.events=new c.a,this.errorHandler=Vr,this.malformedUriErrorHandler=Fr,this.navigated=!1,this.lastSuccessfulId=-1,this.hooks={beforePreactivation:qr,afterPreactivation:qr},this.urlHandlingStrategy=new Ur,this.routeReuseStrategy=new xr,this.onSameUrlNavigation="ignore",this.paramsInheritanceStrategy="emptyOnly",this.urlUpdateStrategy="deferred",this.relativeLinkResolution="legacy",this.ngModule=o.get(r.x),this.console=o.get(r.cb);var f=o.get(r.z);this.isNgZoneEnabled=f instanceof r.z,this.resetConfig(u),this.currentUrlTree=new on(new an([],{}),{},null),this.rawUrlTree=this.currentUrlTree,this.configLoader=new jr(a,s,function(t){return l.triggerEvent(new Re(t))},function(t){return l.triggerEvent(new xe(t))}),this.routerState=Nn(this.currentUrlTree,this.rootComponentType),this.transitions=new h({id:0,currentUrlTree:this.currentUrlTree,currentRawUrl:this.currentUrlTree,extractedUrl:this.urlHandlingStrategy.extract(this.currentUrlTree),urlAfterRedirects:this.urlHandlingStrategy.extract(this.currentUrlTree),rawUrl:this.currentUrlTree,extras:{},resolve:null,reject:null,promise:Promise.resolve(!0),source:"imperative",state:null,currentSnapshot:this.routerState.snapshot,targetSnapshot:null,currentRouterState:this.routerState,targetRouterState:null,guards:{canActivateChecks:[],canDeactivateChecks:[]},guardsResult:null}),this.navigations=this.setupNavigations(this.transitions),this.processNavigations()}return t.prototype.setupNavigations=function(t){var e=this,n=this.events;return t.pipe(Object(O.a)(function(t){return 0!==t.id}),Object(C.a)(function(t){return Object(a.a)({},t,{extractedUrl:e.urlHandlingStrategy.extract(t.rawUrl)})}),Object(it.a)(function(t){var r,i,o,c,l=!1,f=!1;return Object(s.a)(t).pipe(Object(it.a)(function(t){var r,i,o,u,c=!e.navigated||t.extractedUrl.toString()!==e.currentUrlTree.toString();if(("reload"===e.onSameUrlNavigation||c)&&e.urlHandlingStrategy.shouldProcessUrl(t.rawUrl))return Object(s.a)(t).pipe(L(function(t){return"eager"===e.urlUpdateStrategy&&!t.extras.skipLocationChange&&e.setBrowserUrl(t.rawUrl,!!t.extras.replaceUrl,t.id)}),Object(it.a)(function(t){var r=e.transitions.getValue();return n.next(new Te(t.id,e.serializeUrl(t.extractedUrl),t.source,t.state)),r!==e.transitions.getValue()?E.a:[t]}),Object(it.a)(function(t){return Promise.resolve(t)}),(r=e.ngModule.injector,i=e.configLoader,o=e.urlSerializer,u=e.config,function(t){return t.pipe(Object(it.a)(function(t){return function(e,n,r,i,o){return new ar(e,n,r,t.extractedUrl,o).apply()}(r,i,o,0,u).pipe(Object(C.a)(function(e){return Object(a.a)({},t,{urlAfterRedirects:e})}))}))}),function(t,n,r,i,o){return function(r){return r.pipe(Object(et.a)(function(r){return function(t,e,n,r,i,o){return void 0===i&&(i="emptyOnly"),void 0===o&&(o="legacy"),new Er(t,e,n,r,i,o).recognize()}(t,n,r.urlAfterRedirects,(s=r.urlAfterRedirects,e.serializeUrl(s)),i,o).pipe(Object(C.a)(function(t){return Object(a.a)({},r,{targetSnapshot:t})}));var s}))}}(e.rootComponentType,e.config,0,e.paramsInheritanceStrategy,e.relativeLinkResolution),L(function(t){var r=new Oe(t.id,e.serializeUrl(t.extractedUrl),e.serializeUrl(t.urlAfterRedirects),t.targetSnapshot);n.next(r)}));if(c&&e.rawUrlTree&&e.urlHandlingStrategy.shouldProcessUrl(e.rawUrlTree)){var l=t.extractedUrl,h=t.source,f=t.state,p=t.extras,d=new Te(t.id,e.serializeUrl(l),h,f);n.next(d);var y=Nn(l,e.rootComponentType).snapshot;return Object(s.a)(Object(a.a)({},t,{targetSnapshot:y,urlAfterRedirects:l,extras:Object(a.a)({},p,{skipLocationChange:!1,replaceUrl:!1})}))}return e.rawUrlTree=t.rawUrl,t.resolve(null),E.a}),Pr(function(t){var n=t.extras;return e.hooks.beforePreactivation(t.targetSnapshot,{navigationId:t.id,appliedUrlTree:t.extractedUrl,rawUrlTree:t.rawUrl,skipLocationChange:!!n.skipLocationChange,replaceUrl:!!n.replaceUrl})}),L(function(t){var n=new De(t.id,e.serializeUrl(t.extractedUrl),e.serializeUrl(t.urlAfterRedirects),t.targetSnapshot);e.triggerEvent(n)}),Object(C.a)(function(t){return Object(a.a)({},t,{guards:(n=t.targetSnapshot,r=t.currentSnapshot,i=e.rootContexts,o=n._root,dr(o,r?r._root:null,i,[o.value]))});var n,r,i,o}),function(t,e){return function(n){return n.pipe(Object(et.a)(function(n){var r=n.targetSnapshot,i=n.currentSnapshot,o=n.guards,c=o.canActivateChecks,l=o.canDeactivateChecks;return 0===l.length&&0===c.length?Object(s.a)(Object(a.a)({},n,{guardsResult:!0})):function(t,e,n,r){return Object(u.a)(t).pipe(Object(et.a)(function(t){return function(t,e,n,r,i){var o=e&&e.routeConfig?e.routeConfig.canDeactivate:null;if(!o||0===o.length)return Object(s.a)(!0);var a=o.map(function(o){var a,s=pr(o,e,i);if(function(t){return t&&$n(t.canDeactivate)}(s))a=nn(s.canDeactivate(t,e,n,r));else{if(!$n(s))throw new Error("Invalid CanDeactivate guard");a=nn(s(t,e,n,r))}return a.pipe(tt())});return Object(s.a)(a).pipe(mr())}(t.component,t.route,n,e,r)}),tt(function(t){return!0!==t},!0))}(l,r,i,t).pipe(Object(et.a)(function(n){return n&&"boolean"==typeof n?function(t,e,n,r){return Object(u.a)(e).pipe(st(function(e){return Object(u.a)([br(e.route.parent,r),vr(e.route,r),_r(t,e.path,n),wr(t,e.route,n)]).pipe(A(),tt(function(t){return!0!==t},!0))}),tt(function(t){return!0!==t},!0))}(r,c,t,e):Object(s.a)(n)}),Object(C.a)(function(t){return Object(a.a)({},n,{guardsResult:t})}))}))}}(e.ngModule.injector,function(t){return e.triggerEvent(t)}),L(function(t){if(tr(t.guardsResult)){var n=We('Redirecting to "'+e.serializeUrl(t.guardsResult)+'"');throw n.url=t.guardsResult,n}}),L(function(t){var n=new ke(t.id,e.serializeUrl(t.extractedUrl),e.serializeUrl(t.urlAfterRedirects),t.targetSnapshot,!!t.guardsResult);e.triggerEvent(n)}),Object(O.a)(function(t){if(!t.guardsResult){e.resetUrlToCurrentUrlTree();var r=new Ie(t.id,e.serializeUrl(t.extractedUrl),"");return n.next(r),t.resolve(!1),!1}return!0}),Pr(function(t){if(t.guards.canActivateChecks.length)return Object(s.a)(t).pipe(L(function(t){var n=new Ne(t.id,e.serializeUrl(t.extractedUrl),e.serializeUrl(t.urlAfterRedirects),t.targetSnapshot);e.triggerEvent(n)}),(n=e.paramsInheritanceStrategy,r=e.ngModule.injector,function(t){return t.pipe(Object(et.a)(function(t){var e=t.targetSnapshot,i=t.guards.canActivateChecks;return i.length?Object(u.a)(i).pipe(st(function(t){return function(t,n,r,i){return function(t,e,n,r){var i=Object.keys(t);if(0===i.length)return Object(s.a)({});if(1===i.length){var o=i[0];return Nr(t[o],e,n,r).pipe(Object(C.a)(function(t){var e;return(e={})[o]=t,e}))}var a={};return Object(u.a)(i).pipe(Object(et.a)(function(i){return Nr(t[i],e,n,r).pipe(Object(C.a)(function(t){return a[i]=t,t}))})).pipe(K(),Object(C.a)(function(){return a}))}(t._resolve,t,e,i).pipe(Object(C.a)(function(e){return t._resolvedData=e,t.data=Object(a.a)({},t.data,Rn(t,r).resolve),null}))}(t.route,0,n,r)}),function(t,e){return arguments.length>=2?function(e){return Object(ut.a)(Object(at.a)(t,void 0),P(1),B(void 0))(e)}:function(e){return Object(ut.a)(Object(at.a)(function(e,n,r){return t(e)}),P(1))(e)}}(function(t,e){return t}),Object(C.a)(function(e){return t})):Object(s.a)(t)}))}),L(function(t){var n=new Pe(t.id,e.serializeUrl(t.extractedUrl),e.serializeUrl(t.urlAfterRedirects),t.targetSnapshot);e.triggerEvent(n)}));var n,r}),Pr(function(t){var n=t.extras;return e.hooks.afterPreactivation(t.targetSnapshot,{navigationId:t.id,appliedUrlTree:t.extractedUrl,rawUrlTree:t.rawUrl,skipLocationChange:!!n.skipLocationChange,replaceUrl:!!n.replaceUrl})}),Object(C.a)(function(t){var n,r,i,o=(i=function t(e,n,r){if(r&&e.shouldReuseRoute(n.value,r.value.snapshot)){(c=r.value)._futureSnapshot=n.value;var i=function(e,n,r){return n.children.map(function(n){var i,o;try{for(var s=Object(a.h)(r.children),u=s.next();!u.done;u=s.next()){var c=u.value;if(e.shouldReuseRoute(c.value.snapshot,n.value))return t(e,n,c)}}catch(l){i={error:l}}finally{try{u&&!u.done&&(o=s.return)&&o.call(s)}finally{if(i)throw i.error}}return t(e,n)})}(e,n,r);return new On(c,i)}var o=e.retrieve(n.value);if(o){var s=o.route;return function t(e,n){if(e.value.routeConfig!==n.value.routeConfig)throw new Error("Cannot reattach ActivatedRouteSnapshot created from a different route");if(e.children.length!==n.children.length)throw new Error("Cannot reattach ActivatedRouteSnapshot with a different number of children");n.value._futureSnapshot=e.value;for(var r=0;r<e.children.length;++r)t(e.children[r],n.children[r])}(n,s),s}var u,c=new Pn(new h((u=n.value).url),new h(u.params),new h(u.queryParams),new h(u.fragment),new h(u.data),u.outlet,u.component,u);return i=n.children.map(function(n){return t(e,n)}),new On(c,i)}(e.routeReuseStrategy,(n=t.targetSnapshot)._root,(r=t.currentRouterState)?r._root:void 0),new kn(i,n));return Object(a.a)({},t,{targetRouterState:o})}),L(function(t){e.currentUrlTree=t.urlAfterRedirects,e.rawUrlTree=e.urlHandlingStrategy.merge(e.currentUrlTree,t.rawUrl),e.routerState=t.targetRouterState,"deferred"!==e.urlUpdateStrategy||t.extras.skipLocationChange||e.setBrowserUrl(e.rawUrlTree,!!t.extras.replaceUrl,t.id)}),(i=e.rootContexts,o=e.routeReuseStrategy,c=function(t){return e.triggerEvent(t)},Object(C.a)(function(t){return new Jn(o,t.targetRouterState,t.currentRouterState,c).activate(i),t})),L({next:function(){l=!0},complete:function(){l=!0}}),(r=function(){if(!l&&!f){e.resetUrlToCurrentUrlTree();var r=new Ie(t.id,e.serializeUrl(t.extractedUrl),"Navigation ID "+t.id+" is not equal to the current navigation id "+e.navigationId);n.next(r),t.resolve(!1)}},function(t){return t.lift(new lt(r))}),Q(function(r){if(f=!0,(s=r)&&s[ze]){e.navigated=!0;var i=tr(r.url);i||e.resetStateAndUrl(t.currentRouterState,t.currentUrlTree,t.rawUrl);var o=new Ie(t.id,e.serializeUrl(t.extractedUrl),r.message);n.next(o),t.resolve(!1),i&&e.navigateByUrl(r.url)}else{e.resetStateAndUrl(t.currentRouterState,t.currentUrlTree,t.rawUrl);var a=new Ae(t.id,e.serializeUrl(t.extractedUrl),r);n.next(a);try{t.resolve(e.errorHandler(r))}catch(u){t.reject(u)}}var s;return E.a}))}))},t.prototype.resetRootComponentType=function(t){this.rootComponentType=t,this.routerState.root.component=this.rootComponentType},t.prototype.getTransition=function(){return this.transitions.value},t.prototype.setTransition=function(t){this.transitions.next(Object(a.a)({},this.getTransition(),t))},t.prototype.initialNavigation=function(){this.setUpLocationChangeListener(),0===this.navigationId&&this.navigateByUrl(this.location.path(!0),{replaceUrl:!0})},t.prototype.setUpLocationChangeListener=function(){var t=this;this.locationSubscription||(this.locationSubscription=this.location.subscribe(function(e){var n=t.parseUrl(e.url),r="popstate"===e.type?"popstate":"hashchange",i=e.state&&e.state.navigationId?{navigationId:e.state.navigationId}:null;setTimeout(function(){t.scheduleNavigation(n,r,i,{replaceUrl:!0})},0)}))},Object.defineProperty(t.prototype,"url",{get:function(){return this.serializeUrl(this.currentUrlTree)},enumerable:!0,configurable:!0}),t.prototype.triggerEvent=function(t){this.events.next(t)},t.prototype.resetConfig=function(t){Qe(t),this.config=t.map(Je),this.navigated=!1,this.lastSuccessfulId=-1},t.prototype.ngOnDestroy=function(){this.dispose()},t.prototype.dispose=function(){this.locationSubscription&&(this.locationSubscription.unsubscribe(),this.locationSubscription=null)},t.prototype.createUrlTree=function(t,e){void 0===e&&(e={});var n=e.relativeTo,i=e.queryParams,o=e.fragment,s=e.preserveQueryParams,u=e.queryParamsHandling,c=e.preserveFragment;Object(r.X)()&&s&&console&&console.warn&&console.warn("preserveQueryParams is deprecated, use queryParamsHandling instead.");var l=n||this.routerState.root,h=c?this.currentUrlTree.fragment:o,f=null;if(u)switch(u){case"merge":f=Object(a.a)({},this.currentUrlTree.queryParams,i);break;case"preserve":f=this.currentUrlTree.queryParams;break;default:f=i||null}else f=s?this.currentUrlTree.queryParams:i||null;return null!==f&&(f=this.removeEmptyProps(f)),function(t,e,n,r,i){if(0===n.length)return qn(e.root,e.root,e,r,i);var o=function(t){if("string"==typeof t[0]&&1===t.length&&"/"===t[0])return new Bn(!0,0,t);var e=0,n=!1,r=t.reduce(function(t,r,i){if("object"==typeof r&&null!=r){if(r.outlets){var o={};return en(r.outlets,function(t,e){o[e]="string"==typeof t?t.split("/"):t}),Object(a.g)(t,[{outlets:o}])}if(r.segmentPath)return Object(a.g)(t,[r.segmentPath])}return"string"!=typeof r?Object(a.g)(t,[r]):0===i?(r.split("/").forEach(function(r,i){0==i&&"."===r||(0==i&&""===r?n=!0:".."===r?e++:""!=r&&t.push(r))}),t):Object(a.g)(t,[r])},[]);return new Bn(n,e,r)}(n);if(o.toRoot())return qn(e.root,new an([],{}),e,r,i);var s=function(t,n,r){if(t.isAbsolute)return new Hn(e.root,!0,0);if(-1===r.snapshot._lastPathIndex)return new Hn(r.snapshot._urlSegment,!0,0);var i=Fn(t.commands[0])?0:1;return function(e,n,o){for(var a=r.snapshot._urlSegment,s=r.snapshot._lastPathIndex+i,u=t.numberOfDoubleDots;u>s;){if(u-=s,!(a=a.parent))throw new Error("Invalid number of '../'");s=a.segments.length}return new Hn(a,!1,s-u)}()}(o,0,t),u=s.processChildren?Kn(s.segmentGroup,s.index,o.commands):Wn(s.segmentGroup,s.index,o.commands);return qn(s.segmentGroup,u,e,r,i)}(l,this.currentUrlTree,t,f,h)},t.prototype.navigateByUrl=function(t,e){void 0===e&&(e={skipLocationChange:!1}),Object(r.X)()&&this.isNgZoneEnabled&&!r.z.isInAngularZone()&&this.console.warn("Navigation triggered outside Angular zone, did you forget to call 'ngZone.run()'?");var n=tr(t)?t:this.parseUrl(t),i=this.urlHandlingStrategy.merge(n,this.rawUrlTree);return this.scheduleNavigation(i,"imperative",null,e)},t.prototype.navigate=function(t,e){return void 0===e&&(e={skipLocationChange:!1}),function(t){for(var e=0;e<t.length;e++){var n=t[e];if(null==n)throw new Error("The requested path contains "+n+" segment at index "+e)}}(t),this.navigateByUrl(this.createUrlTree(t,e),e)},t.prototype.serializeUrl=function(t){return this.urlSerializer.serialize(t)},t.prototype.parseUrl=function(t){var e;try{e=this.urlSerializer.parse(t)}catch(n){e=this.malformedUriErrorHandler(n,this.urlSerializer,t)}return e},t.prototype.isActive=function(t,e){if(tr(t))return rn(this.currentUrlTree,t,e);var n=this.parseUrl(t);return rn(this.currentUrlTree,n,e)},t.prototype.removeEmptyProps=function(t){return Object.keys(t).reduce(function(e,n){var r=t[n];return null!=r&&(e[n]=r),e},{})},t.prototype.processNavigations=function(){var t=this;this.navigations.subscribe(function(e){t.navigated=!0,t.lastSuccessfulId=e.id,t.events.next(new Ce(e.id,t.serializeUrl(e.extractedUrl),t.serializeUrl(t.currentUrlTree))),e.resolve(!0)},function(e){t.console.warn("Unhandled Navigation Error: ")})},t.prototype.scheduleNavigation=function(t,e,n,r){var i=this.getTransition();if(i&&"imperative"!==e&&"imperative"===i.source&&i.rawUrl.toString()===t.toString())return Promise.resolve(!0);if(i&&"hashchange"==e&&"popstate"===i.source&&i.rawUrl.toString()===t.toString())return Promise.resolve(!0);if(i&&"popstate"==e&&"hashchange"===i.source&&i.rawUrl.toString()===t.toString())return Promise.resolve(!0);var o=null,a=null,s=new Promise(function(t,e){o=t,a=e}),u=++this.navigationId;return this.setTransition({id:u,source:e,state:n,currentUrlTree:this.currentUrlTree,currentRawUrl:this.rawUrlTree,rawUrl:t,extras:r,resolve:o,reject:a,promise:s,currentSnapshot:this.routerState.snapshot,currentRouterState:this.routerState}),s.catch(function(t){return Promise.reject(t)})},t.prototype.setBrowserUrl=function(t,e,n){var r=this.urlSerializer.serialize(t);this.location.isCurrentPathEqualTo(r)||e?this.location.replaceState(r,"",{navigationId:n}):this.location.go(r,"",{navigationId:n})},t.prototype.resetStateAndUrl=function(t,e,n){this.routerState=t,this.currentUrlTree=e,this.rawUrlTree=this.urlHandlingStrategy.merge(this.currentUrlTree,n),this.resetUrlToCurrentUrlTree()},t.prototype.resetUrlToCurrentUrlTree=function(){this.location.replaceState(this.urlSerializer.serialize(this.rawUrlTree),"",{navigationId:this.lastSuccessfulId})},t}(),Hr=function(){return function(){this.outlet=null,this.route=null,this.resolver=null,this.children=new zr,this.attachRef=null}}(),zr=function(){function t(){this.contexts=new Map}return t.prototype.onChildOutletCreated=function(t,e){var n=this.getOrCreateContext(t);n.outlet=e,this.contexts.set(t,n)},t.prototype.onChildOutletDestroyed=function(t){var e=this.getContext(t);e&&(e.outlet=null)},t.prototype.onOutletDeactivated=function(){var t=this.contexts;return this.contexts=new Map,t},t.prototype.onOutletReAttached=function(t){this.contexts=t},t.prototype.getOrCreateContext=function(t){var e=this.getContext(t);return e||(e=new Hr,this.contexts.set(t,e)),e},t.prototype.getContext=function(t){return this.contexts.get(t)||null},t}(),Wr=function(){function t(t,e,n,i,o){this.parentContexts=t,this.location=e,this.resolver=n,this.changeDetector=o,this.activated=null,this._activatedRoute=null,this.activateEvents=new r.m,this.deactivateEvents=new r.m,this.name=i||qe,t.onChildOutletCreated(this.name,this)}return t.prototype.ngOnDestroy=function(){this.parentContexts.onChildOutletDestroyed(this.name)},t.prototype.ngOnInit=function(){if(!this.activated){var t=this.parentContexts.getContext(this.name);t&&t.route&&(t.attachRef?this.attach(t.attachRef,t.route):this.activateWith(t.route,t.resolver||null))}},Object.defineProperty(t.prototype,"isActivated",{get:function(){return!!this.activated},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"component",{get:function(){if(!this.activated)throw new Error("Outlet is not activated");return this.activated.instance},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"activatedRoute",{get:function(){if(!this.activated)throw new Error("Outlet is not activated");return this._activatedRoute},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"activatedRouteData",{get:function(){return this._activatedRoute?this._activatedRoute.snapshot.data:{}},enumerable:!0,configurable:!0}),t.prototype.detach=function(){if(!this.activated)throw new Error("Outlet is not activated");this.location.detach();var t=this.activated;return this.activated=null,this._activatedRoute=null,t},t.prototype.attach=function(t,e){this.activated=t,this._activatedRoute=e,this.location.insert(t.hostView)},t.prototype.deactivate=function(){if(this.activated){var t=this.component;this.activated.destroy(),this.activated=null,this._activatedRoute=null,this.deactivateEvents.emit(t)}},t.prototype.activateWith=function(t,e){if(this.isActivated)throw new Error("Cannot activate an already activated outlet");this._activatedRoute=t;var n=(e=e||this.resolver).resolveComponentFactory(t._futureSnapshot.routeConfig.component),r=this.parentContexts.getOrCreateContext(this.name).children,i=new Kr(t,r,this.location.injector);this.activated=this.location.createComponent(n,this.location.length,i),this.changeDetector.markForCheck(),this.activateEvents.emit(this.activated.instance)},t}(),Kr=function(){function t(t,e,n){this.route=t,this.childContexts=e,this.parent=n}return t.prototype.get=function(t,e){return t===Pn?this.route:t===zr?this.childContexts:this.parent.get(t,e)},t}(),Gr=function(){return function(){}}(),Qr=function(){function t(){}return t.prototype.preload=function(t,e){return e().pipe(Q(function(){return Object(s.a)(null)}))},t}(),Xr=function(){function t(){}return t.prototype.preload=function(t,e){return Object(s.a)(null)},t}(),Yr=function(){function t(t,e,n,r,i){this.router=t,this.injector=r,this.preloadingStrategy=i,this.loader=new jr(e,n,function(e){return t.triggerEvent(new Re(e))},function(e){return t.triggerEvent(new xe(e))})}return t.prototype.setUpPreloading=function(){var t=this;this.subscription=this.router.events.pipe(Object(O.a)(function(t){return t instanceof Ce}),st(function(){return t.preload()})).subscribe(function(){})},t.prototype.preload=function(){var t=this.injector.get(r.x);return this.processRoutes(t,this.router.config)},t.prototype.ngOnDestroy=function(){this.subscription.unsubscribe()},t.prototype.processRoutes=function(t,e){var n,r,i=[];try{for(var o=Object(a.h)(e),s=o.next();!s.done;s=o.next()){var c=s.value;if(c.loadChildren&&!c.canLoad&&c._loadedConfig){var l=c._loadedConfig;i.push(this.processRoutes(l.module,l.routes))}else c.loadChildren&&!c.canLoad?i.push(this.preloadConfig(t,c)):c.children&&i.push(this.processRoutes(t,c.children))}}catch(h){n={error:h}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return Object(u.a)(i).pipe(Object(I.a)(),Object(C.a)(function(t){}))},t.prototype.preloadConfig=function(t,e){var n=this;return this.preloadingStrategy.preload(e,function(){return n.loader.load(t.injector,e).pipe(Object(et.a)(function(t){return e._loadedConfig=t,n.processRoutes(t.module,t.routes)}))})},t}(),Jr=function(){function t(t,e,n){void 0===n&&(n={}),this.router=t,this.viewportScroller=e,this.options=n,this.lastId=0,this.lastSource="imperative",this.restoredId=0,this.store={},n.scrollPositionRestoration=n.scrollPositionRestoration||"disabled",n.anchorScrolling=n.anchorScrolling||"disabled"}return t.prototype.init=function(){"disabled"!==this.options.scrollPositionRestoration&&this.viewportScroller.setHistoryScrollRestoration("manual"),this.routerEventsSubscription=this.createScrollEvents(),this.scrollEventsSubscription=this.consumeScrollEvents()},t.prototype.createScrollEvents=function(){var t=this;return this.router.events.subscribe(function(e){e instanceof Te?(t.store[t.lastId]=t.viewportScroller.getScrollPosition(),t.lastSource=e.navigationTrigger,t.restoredId=e.restoredState?e.restoredState.navigationId:0):e instanceof Ce&&(t.lastId=e.id,t.scheduleScrollEvent(e,t.router.parseUrl(e.urlAfterRedirects).fragment))})},t.prototype.consumeScrollEvents=function(){var t=this;return this.router.events.subscribe(function(e){e instanceof Ve&&(e.position?"top"===t.options.scrollPositionRestoration?t.viewportScroller.scrollToPosition([0,0]):"enabled"===t.options.scrollPositionRestoration&&t.viewportScroller.scrollToPosition(e.position):e.anchor&&"enabled"===t.options.anchorScrolling?t.viewportScroller.scrollToAnchor(e.anchor):"disabled"!==t.options.scrollPositionRestoration&&t.viewportScroller.scrollToPosition([0,0]))})},t.prototype.scheduleScrollEvent=function(t,e){this.router.triggerEvent(new Ve(t,"popstate"===this.lastSource?this.store[this.restoredId]:null,e))},t.prototype.ngOnDestroy=function(){this.routerEventsSubscription&&this.routerEventsSubscription.unsubscribe(),this.scrollEventsSubscription&&this.scrollEventsSubscription.unsubscribe()},t}(),Zr=new r.p("ROUTER_CONFIGURATION"),$r=new r.p("ROUTER_FORROOT_GUARD"),ti=[ft.g,{provide:ln,useClass:hn},{provide:Br,useFactory:si,deps:[r.g,ln,zr,ft.g,r.q,r.w,r.i,Mr,Zr,[Lr,new r.A],[Rr,new r.A]]},zr,{provide:Pn,useFactory:ui,deps:[Br]},{provide:r.w,useClass:r.J},Yr,Xr,Qr,{provide:Zr,useValue:{enableTracing:!1}}];function ei(){return new r.y("Router",Br)}var ni=function(){function t(t,e){}var e;return e=t,t.forRoot=function(t,n){return{ngModule:e,providers:[ti,ai(t),{provide:$r,useFactory:oi,deps:[[Br,new r.A,new r.I]]},{provide:Zr,useValue:n||{}},{provide:ft.h,useFactory:ii,deps:[ft.n,[new r.o(ft.a),new r.A],Zr]},{provide:Jr,useFactory:ri,deps:[Br,ft.o,Zr]},{provide:Gr,useExisting:n&&n.preloadingStrategy?n.preloadingStrategy:Xr},{provide:r.y,multi:!0,useFactory:ei},[ci,{provide:r.d,multi:!0,useFactory:li,deps:[ci]},{provide:fi,useFactory:hi,deps:[ci]},{provide:r.b,multi:!0,useExisting:fi}]]}},t.forChild=function(t){return{ngModule:e,providers:[ai(t)]}},t}();function ri(t,e,n){return n.scrollOffset&&e.setOffset(n.scrollOffset),new Jr(t,e,n)}function ii(t,e,n){return void 0===n&&(n={}),n.useHash?new ft.e(t,e):new ft.m(t,e)}function oi(t){if(t)throw new Error("RouterModule.forRoot() called twice. Lazy loaded modules should use RouterModule.forChild() instead.");return"guarded"}function ai(t){return[{provide:r.a,multi:!0,useValue:t},{provide:Mr,multi:!0,useValue:t}]}function si(t,e,n,r,i,o,a,s,u,c,l){void 0===u&&(u={});var h=new Br(null,e,n,r,i,o,a,$e(s));if(c&&(h.urlHandlingStrategy=c),l&&(h.routeReuseStrategy=l),u.errorHandler&&(h.errorHandler=u.errorHandler),u.malformedUriErrorHandler&&(h.malformedUriErrorHandler=u.malformedUriErrorHandler),u.enableTracing){var f=dt();h.events.subscribe(function(t){f.logGroup("Router Event: "+t.constructor.name),f.log(t.toString()),f.log(t),f.logGroupEnd()})}return u.onSameUrlNavigation&&(h.onSameUrlNavigation=u.onSameUrlNavigation),u.paramsInheritanceStrategy&&(h.paramsInheritanceStrategy=u.paramsInheritanceStrategy),u.urlUpdateStrategy&&(h.urlUpdateStrategy=u.urlUpdateStrategy),u.relativeLinkResolution&&(h.relativeLinkResolution=u.relativeLinkResolution),h}function ui(t){return t.routerState.root}var ci=function(){function t(t){this.injector=t,this.initNavigation=!1,this.resultOfPreactivationDone=new c.a}return t.prototype.appInitializer=function(){var t=this;return this.injector.get(ft.f,Promise.resolve(null)).then(function(){var e=null,n=new Promise(function(t){return e=t}),r=t.injector.get(Br),i=t.injector.get(Zr);if(t.isLegacyDisabled(i)||t.isLegacyEnabled(i))e(!0);else if("disabled"===i.initialNavigation)r.setUpLocationChangeListener(),e(!0);else{if("enabled"!==i.initialNavigation)throw new Error("Invalid initialNavigation options: '"+i.initialNavigation+"'");r.hooks.afterPreactivation=function(){return t.initNavigation?Object(s.a)(null):(t.initNavigation=!0,e(!0),t.resultOfPreactivationDone)},r.initialNavigation()}return n})},t.prototype.bootstrapListener=function(t){var e=this.injector.get(Zr),n=this.injector.get(Yr),i=this.injector.get(Jr),o=this.injector.get(Br),a=this.injector.get(r.g);t===a.components[0]&&(this.isLegacyEnabled(e)?o.initialNavigation():this.isLegacyDisabled(e)&&o.setUpLocationChangeListener(),n.setUpPreloading(),i.init(),o.resetRootComponentType(a.componentTypes[0]),this.resultOfPreactivationDone.next(null),this.resultOfPreactivationDone.complete())},t.prototype.isLegacyEnabled=function(t){return"legacy_enabled"===t.initialNavigation||!0===t.initialNavigation||void 0===t.initialNavigation},t.prototype.isLegacyDisabled=function(t){return"legacy_disabled"===t.initialNavigation||!1===t.initialNavigation},t}();function li(t){return t.appInitializer.bind(t)}function hi(t){return t.bootstrapListener.bind(t)}var fi=new r.p("Router Initializer"),pi=r.nb({encapsulation:2,styles:[],data:{}});function di(t){return r.Db(0,[(t()(),r.pb(0,16777216,null,null,1,"router-outlet",[],null,null,null,null,null)),r.ob(1,212992,null,0,Wr,[zr,r.O,r.j,[8,null],r.h],null,null)],function(t,e){t(e,1,0)},null)}function yi(t){return r.Db(0,[(t()(),r.pb(0,0,null,null,1,"ng-component",[],null,null,null,di,pi)),r.ob(1,49152,null,0,Fe,[],null,null)],null,null)}var gi=r.lb("ng-component",Fe,yi,{},{},[]),mi=function(){function t(){}return t.prototype.ngOnInit=function(){},t}(),vi=r.nb({encapsulation:0,styles:[[""]],data:{}});function bi(t){return r.Db(0,[(t()(),r.pb(0,0,null,null,25,"nav",[["class","navbar navbar-dark navbar-expand-md"],["style","font-weight:600;"]],null,null,null,null,null)),(t()(),r.pb(1,0,null,null,24,"div",[["class","container-fluid"]],null,null,null,null,null)),(t()(),r.pb(2,0,null,null,1,"a",[["class","navbar-brand"],["href","#"]],null,null,null,null,null)),(t()(),r.Bb(-1,null,["POLY BANK"])),(t()(),r.pb(4,0,null,null,3,"button",[["class","navbar-toggler"],["data-target","#navcol-1"],["data-toggle","collapse"]],null,null,null,null,null)),(t()(),r.pb(5,0,null,null,1,"span",[["class","sr-only"]],null,null,null,null,null)),(t()(),r.Bb(-1,null,["Toggle navigation"])),(t()(),r.pb(7,0,null,null,0,"span",[["class","navbar-toggler-icon"]],null,null,null,null,null)),(t()(),r.pb(8,0,null,null,17,"div",[["class","collapse navbar-collapse"],["id","navcol-1"]],null,null,null,null,null)),(t()(),r.pb(9,0,null,null,12,"ul",[["class","nav navbar-nav mx-auto"]],null,null,null,null,null)),(t()(),r.pb(10,0,null,null,2,"li",[["class","nav-item"],["role","presentation"]],null,null,null,null,null)),(t()(),r.pb(11,0,null,null,1,"a",[["class","nav-link active"],["href","#"]],null,null,null,null,null)),(t()(),r.Bb(-1,null,["HOME"])),(t()(),r.pb(13,0,null,null,2,"li",[["class","nav-item"],["role","presentation"]],null,null,null,null,null)),(t()(),r.pb(14,0,null,null,1,"a",[["class","nav-link"],["href","#"]],null,null,null,null,null)),(t()(),r.Bb(-1,null,["QUESTIONS"])),(t()(),r.pb(16,0,null,null,2,"li",[["class","nav-item"],["role","presentation"]],null,null,null,null,null)),(t()(),r.pb(17,0,null,null,1,"a",[["class","nav-link"],["href","#"]],null,null,null,null,null)),(t()(),r.Bb(-1,null,["NOTES"])),(t()(),r.pb(19,0,null,null,2,"li",[["class","nav-item"],["role","presentation"]],null,null,null,null,null)),(t()(),r.pb(20,0,null,null,1,"a",[["class","nav-link"],["href","#"]],null,null,null,null,null)),(t()(),r.Bb(-1,null,["ANNOUNCEMENT"])),(t()(),r.pb(22,0,null,null,3,"ul",[["class","nav navbar-nav"]],null,null,null,null,null)),(t()(),r.pb(23,0,null,null,2,"li",[["class","nav-item"],["role","presentation"]],null,null,null,null,null)),(t()(),r.pb(24,0,null,null,1,"a",[["class","nav-link"],["href","#"]],null,null,null,null,null)),(t()(),r.Bb(-1,null,["LOGIN"]))],null,null)}var wi=function(){function t(){}return t.prototype.ngOnInit=function(){},t}(),_i=r.nb({encapsulation:0,styles:[[""]],data:{}});function Si(t){return r.Db(0,[(t()(),r.pb(0,0,null,null,5,"div",[["class","col-sm-12 col-md-6 col-lg-4"]],null,null,null,null,null)),(t()(),r.pb(1,0,null,null,0,"img",[["class","d-inline-block"],["src","assets/img/sreejesh.jpg"],["style","width:40px;background-position:center;background-size:contain;background-repeat:no-repeat;"]],null,null,null,null,null)),(t()(),r.pb(2,0,null,null,1,"p",[["class","text-light d-inline-block"],["style","margin-left:5px;"]],null,null,null,null,null)),(t()(),r.Bb(-1,null,["vkb > posted 6 new pdfs"])),(t()(),r.pb(4,0,null,null,1,"p",[["class","text-light"]],null,null,null,null,null)),(t()(),r.Bb(-1,null,["please check the module 1sn and 2nd notes and prepair for exam on tomorrow"])),(t()(),r.pb(6,0,null,null,5,"div",[["class","col-sm-12 col-md-6 col-lg-4"]],null,null,null,null,null)),(t()(),r.pb(7,0,null,null,0,"img",[["class","d-inline-block"],["src","assets/img/gangumahi.jpg"],["style","width:40px;"]],null,null,null,null,null)),(t()(),r.pb(8,0,null,null,1,"p",[["class","text-light d-inline-block"],["style","margin-left:5px;"]],null,null,null,null,null)),(t()(),r.Bb(-1,null,["sreejesh > bring your rough record today"])),(t()(),r.pb(10,0,null,null,1,"p",[["class","text-light"]],null,null,null,null,null)),(t()(),r.Bb(-1,null,["bring your routh record and assignment"])),(t()(),r.pb(12,0,null,null,5,"div",[["class","col-sm-12 col-md-6 col-lg-4"]],null,null,null,null,null)),(t()(),r.pb(13,0,null,null,0,"img",[["class","d-inline-block"],["src","assets/img/sreejesh.jpg"],["style","width:40px;"]],null,null,null,null,null)),(t()(),r.pb(14,0,null,null,1,"p",[["class","text-light d-inline-block"],["style","margin-left:5px;"]],null,null,null,null,null)),(t()(),r.Bb(-1,null,["gangumahi > assignment submission last date\xa0"])),(t()(),r.pb(16,0,null,null,1,"p",[["class","text-light"]],null,null,null,null,null)),(t()(),r.Bb(-1,null,["please check the module 1sn and 2nd notes and prepair for exam on tomorrow"])),(t()(),r.pb(18,0,null,null,5,"div",[["class","col-sm-12 col-md-6 col-lg-4"]],null,null,null,null,null)),(t()(),r.pb(19,0,null,null,0,"img",[["class","d-inline-block"],["src","assets/img/sreejesh.jpg"],["style","width:40px;"]],null,null,null,null,null)),(t()(),r.pb(20,0,null,null,1,"p",[["class","text-light d-inline-block"],["style","margin-left:5px;"]],null,null,null,null,null)),(t()(),r.Bb(-1,null,["vkb > posted 6 new pdfs"])),(t()(),r.pb(22,0,null,null,1,"p",[["class","text-light"]],null,null,null,null,null)),(t()(),r.Bb(-1,null,["please check the module 1sn and 2nd notes and prepair for exam on tomorrow"]))],null,null)}f.a.prototype.map=function(t,e){return Object(C.a)(t,e)(this)},n("CqG3");var Ei=n("tct4"),Ti=function(){function t(t){this.afs=t,this.remindercollection=this.afs.collection("remider"),this.reminder=this.remindercollection.snapshotChanges().map(function(t){return t.map(function(t){var e=t.payload.doc.data();return e.id=t.payload.doc.id,e})})}return t.prototype.getItems=function(){return this.reminder},t.ngInjectableDef=r.S({factory:function(){return new t(r.W(Ei.AngularFirestore))},token:t,providedIn:"root"}),t}(),Ci=function(){function t(t){this.itemService=t,this.info=[{date:"2/11/1999",remainder:"all students must do assignmet"},{date:"3/11/1999",remainder:"all students must compleate record"},{date:"4/11/1999",remainder:"all students must present"},{date:"5/11/1999",remainder:"all students must read text book"}],console.log("information")}return t.prototype.ngOnInit=function(){var t=this;this.itemService.getItems().subscribe(function(e){console.log(e),t.reminder=e})},t}(),Ii=r.nb({encapsulation:0,styles:[[""]],data:{}});function Ai(t){return r.Db(0,[(t()(),r.pb(0,0,null,null,4,"div",[["class","col-sm-12"]],null,null,null,null,null)),(t()(),r.pb(1,0,null,null,1,"p",[["class","text-center text-light"],["style","margin-left:5px;font-size:25px;font-weight:600;"]],null,null,null,null,null)),(t()(),r.Bb(2,null,["REMAINDER| "," TOMORROW"])),(t()(),r.pb(3,0,null,null,1,"p",[["class","text-center text-light"]],null,null,null,null,null)),(t()(),r.Bb(4,null,["",""]))],null,function(t,e){t(e,2,0,e.context.$implicit.date),t(e,4,0,e.context.$implicit.reminder)})}function Oi(t){return r.Db(0,[(t()(),r.gb(16777216,null,null,1,null,Ai)),r.ob(1,278528,null,0,ft.i,[r.O,r.L,r.s],{ngForOf:[0,"ngForOf"]},null)],function(t,e){t(e,1,0,e.component.reminder)},null)}var Di=function(){function t(){}return t.prototype.ngOnInit=function(){},t}(),ki=r.nb({encapsulation:0,styles:[[""]],data:{}});function Ni(t){return r.Db(0,[(t()(),r.pb(0,0,null,null,21,"div",[["class","footer-basic"]],null,null,null,null,null)),(t()(),r.pb(1,0,null,null,20,"footer",[],null,null,null,null,null)),(t()(),r.pb(2,0,null,null,8,"div",[["class","social"]],null,null,null,null,null)),(t()(),r.pb(3,0,null,null,1,"a",[["href","#"]],null,null,null,null,null)),(t()(),r.pb(4,0,null,null,0,"i",[["class","icon ion-social-instagram"]],null,null,null,null,null)),(t()(),r.pb(5,0,null,null,1,"a",[["href","#"]],null,null,null,null,null)),(t()(),r.pb(6,0,null,null,0,"i",[["class","icon ion-social-snapchat"]],null,null,null,null,null)),(t()(),r.pb(7,0,null,null,1,"a",[["href","#"]],null,null,null,null,null)),(t()(),r.pb(8,0,null,null,0,"i",[["class","icon ion-social-twitter"]],null,null,null,null,null)),(t()(),r.pb(9,0,null,null,1,"a",[["href","#"]],null,null,null,null,null)),(t()(),r.pb(10,0,null,null,0,"i",[["class","icon ion-social-facebook"]],null,null,null,null,null)),(t()(),r.pb(11,0,null,null,10,"ul",[["class","list-inline"]],null,null,null,null,null)),(t()(),r.pb(12,0,null,null,2,"li",[["class","list-inline-item"]],null,null,null,null,null)),(t()(),r.pb(13,0,null,null,1,"a",[["href","#"]],null,null,null,null,null)),(t()(),r.Bb(-1,null,["Home"])),(t()(),r.pb(15,0,null,null,2,"li",[["class","list-inline-item"]],null,null,null,null,null)),(t()(),r.pb(16,0,null,null,1,"a",[["href","#"]],null,null,null,null,null)),(t()(),r.Bb(-1,null,["Services"])),(t()(),r.pb(18,0,null,null,2,"li",[["class","list-inline-item"]],null,null,null,null,null)),(t()(),r.pb(19,0,null,null,1,"a",[["href","#"]],null,null,null,null,null)),(t()(),r.Bb(-1,null,["About"])),(t()(),r.pb(21,0,null,null,0,"li",[["class","list-inline-item"]],null,null,null,null,null))],null,null)}var Pi=function(){function t(){}return t.prototype.ngOnInit=function(){},t}(),Ri=r.nb({encapsulation:0,styles:[[""]],data:{}});function xi(t){return r.Db(0,[(t()(),r.pb(0,0,null,null,9,"div",[["id","bottom"],["style","margin-right:5px;"]],null,null,null,null,null)),(t()(),r.pb(1,0,null,null,1,"h2",[["class","text-center text-light"],["id","title"]],null,null,null,null,null)),(t()(),r.Bb(-1,null,["S4 CHE | REBORN"])),(t()(),r.pb(3,0,null,null,6,"div",[["id","cont"]],null,null,null,null,null)),(t()(),r.pb(4,0,null,null,1,"app-announcement",[],null,null,null,Si,_i)),r.ob(5,114688,null,0,wi,[],null,null),(t()(),r.pb(6,0,null,null,1,"app-reminder",[],null,null,null,Oi,Ii)),r.ob(7,114688,null,0,Ci,[Ti],null,null),(t()(),r.pb(8,0,null,null,1,"app-footer",[],null,null,null,Ni,ki)),r.ob(9,114688,null,0,Di,[],null,null)],function(t,e){t(e,5,0),t(e,7,0),t(e,9,0)},null)}var Mi=function(t){function e(e,n){var r=t.call(this,e)||this;r.sources=n,r.completed=0,r.haveValues=0;var i=n.length;r.values=new Array(i);for(var o=0;o<i;o++){var a=n[o],s=Object(v.a)(r,a,null,o);s&&r.add(s)}return r}return a.c(e,t),e.prototype.notifyNext=function(t,e,n,r,i){this.values[n]=e,i._hasValue||(i._hasValue=!0,this.haveValues++)},e.prototype.notifyComplete=function(t){var e=this.destination,n=this.haveValues,r=this.values,i=r.length;t._hasValue?(this.completed++,this.completed===i&&(n===i&&e.next(r),e.complete())):e.complete()},e}(m.a),ji=function(){function t(){}return Object.defineProperty(t.prototype,"value",{get:function(){return this.control?this.control.value:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"valid",{get:function(){return this.control?this.control.valid:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"invalid",{get:function(){return this.control?this.control.invalid:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"pending",{get:function(){return this.control?this.control.pending:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"disabled",{get:function(){return this.control?this.control.disabled:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"enabled",{get:function(){return this.control?this.control.enabled:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"errors",{get:function(){return this.control?this.control.errors:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"pristine",{get:function(){return this.control?this.control.pristine:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dirty",{get:function(){return this.control?this.control.dirty:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"touched",{get:function(){return this.control?this.control.touched:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"status",{get:function(){return this.control?this.control.status:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"untouched",{get:function(){return this.control?this.control.untouched:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"statusChanges",{get:function(){return this.control?this.control.statusChanges:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"valueChanges",{get:function(){return this.control?this.control.valueChanges:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"path",{get:function(){return null},enumerable:!0,configurable:!0}),t.prototype.reset=function(t){void 0===t&&(t=void 0),this.control&&this.control.reset(t)},t.prototype.hasError=function(t,e){return!!this.control&&this.control.hasError(t,e)},t.prototype.getError=function(t,e){return this.control?this.control.getError(t,e):null},t}(),Li=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(a.c)(e,t),Object.defineProperty(e.prototype,"formDirective",{get:function(){return null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"path",{get:function(){return null},enumerable:!0,configurable:!0}),e}(ji);function Ui(t){return null==t||0===t.length}var Vi=/^(?=.{1,254}$)(?=.{1,64}@)[-!#$%&'*+\/0-9=?A-Z^_`a-z{|}~]+(\.[-!#$%&'*+\/0-9=?A-Z^_`a-z{|}~]+)*@[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?(\.[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?)*$/,Fi=function(){function t(){}return t.min=function(t){return function(e){if(Ui(e.value)||Ui(t))return null;var n=parseFloat(e.value);return!isNaN(n)&&n<t?{min:{min:t,actual:e.value}}:null}},t.max=function(t){return function(e){if(Ui(e.value)||Ui(t))return null;var n=parseFloat(e.value);return!isNaN(n)&&n>t?{max:{max:t,actual:e.value}}:null}},t.required=function(t){return Ui(t.value)?{required:!0}:null},t.requiredTrue=function(t){return!0===t.value?null:{required:!0}},t.email=function(t){return Ui(t.value)?null:Vi.test(t.value)?null:{email:!0}},t.minLength=function(t){return function(e){if(Ui(e.value))return null;var n=e.value?e.value.length:0;return n<t?{minlength:{requiredLength:t,actualLength:n}}:null}},t.maxLength=function(t){return function(e){var n=e.value?e.value.length:0;return n>t?{maxlength:{requiredLength:t,actualLength:n}}:null}},t.pattern=function(e){return e?("string"==typeof e?(r="","^"!==e.charAt(0)&&(r+="^"),r+=e,"$"!==e.charAt(e.length-1)&&(r+="$"),n=new RegExp(r)):(r=e.toString(),n=e),function(t){if(Ui(t.value))return null;var e=t.value;return n.test(e)?null:{pattern:{requiredPattern:r,actualValue:e}}}):t.nullValidator;var n,r},t.nullValidator=function(t){return null},t.compose=function(t){if(!t)return null;var e=t.filter(qi);return 0==e.length?null:function(t){return Hi(function(t,n){return e.map(function(e){return e(t)})}(t))}},t.composeAsync=function(t){if(!t)return null;var e=t.filter(qi);return 0==e.length?null:function(t){return function t(){for(var e,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return"function"==typeof n[n.length-1]&&(e=n.pop()),1===n.length&&Object(g.a)(n[0])&&(n=n[0]),0===n.length?E.a:e?t(n).pipe(Object(C.a)(function(t){return e.apply(void 0,t)})):new f.a(function(t){return new Mi(t,n)})}(function(t,n){return e.map(function(e){return e(t)})}(t).map(Bi)).pipe(Object(C.a)(Hi))}},t}();function qi(t){return null!=t}function Bi(t){var e=Object(r.tb)(t)?Object(u.a)(t):t;if(!Object(r.sb)(e))throw new Error("Expected validator to return Promise or Observable.");return e}function Hi(t){var e=t.reduce(function(t,e){return null!=e?Object(a.a)({},t,e):t},{});return 0===Object.keys(e).length?null:e}var zi=new r.p("NgValueAccessor"),Wi=function(){function t(t,e){this._renderer=t,this._elementRef=e,this.onChange=function(t){},this.onTouched=function(){}}return t.prototype.writeValue=function(t){this._renderer.setProperty(this._elementRef.nativeElement,"checked",t)},t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.setDisabledState=function(t){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",t)},t}(),Ki=new r.p("CompositionEventMode"),Gi=function(){function t(t,e,n){var r;this._renderer=t,this._elementRef=e,this._compositionMode=n,this.onChange=function(t){},this.onTouched=function(){},this._composing=!1,null==this._compositionMode&&(this._compositionMode=(r=dt()?dt().getUserAgent():"",!/android (\d+)/.test(r.toLowerCase())))}return t.prototype.writeValue=function(t){this._renderer.setProperty(this._elementRef.nativeElement,"value",null==t?"":t)},t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.setDisabledState=function(t){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",t)},t.prototype._handleInput=function(t){(!this._compositionMode||this._compositionMode&&!this._composing)&&this.onChange(t)},t.prototype._compositionStart=function(){this._composing=!0},t.prototype._compositionEnd=function(t){this._composing=!1,this._compositionMode&&this.onChange(t)},t}();function Qi(t){return t.validate?function(e){return t.validate(e)}:t}function Xi(t){return t.validate?function(e){return t.validate(e)}:t}var Yi=function(){function t(t,e){this._renderer=t,this._elementRef=e,this.onChange=function(t){},this.onTouched=function(){}}return t.prototype.writeValue=function(t){this._renderer.setProperty(this._elementRef.nativeElement,"value",null==t?"":t)},t.prototype.registerOnChange=function(t){this.onChange=function(e){t(""==e?null:parseFloat(e))}},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.setDisabledState=function(t){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",t)},t}();function Ji(){throw new Error("unimplemented")}var Zi=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._parent=null,e.name=null,e.valueAccessor=null,e._rawValidators=[],e._rawAsyncValidators=[],e}return Object(a.c)(e,t),Object.defineProperty(e.prototype,"validator",{get:function(){return Ji()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"asyncValidator",{get:function(){return Ji()},enumerable:!0,configurable:!0}),e}(ji),$i=function(){function t(){this._accessors=[]}return t.prototype.add=function(t,e){this._accessors.push([t,e])},t.prototype.remove=function(t){for(var e=this._accessors.length-1;e>=0;--e)if(this._accessors[e][1]===t)return void this._accessors.splice(e,1)},t.prototype.select=function(t){var e=this;this._accessors.forEach(function(n){e._isSameGroup(n,t)&&n[1]!==t&&n[1].fireUncheck(t.value)})},t.prototype._isSameGroup=function(t,e){return!!t[0].control&&t[0]._parent===e._control._parent&&t[1].name===e.name},t}(),to=function(){function t(t,e,n,r){this._renderer=t,this._elementRef=e,this._registry=n,this._injector=r,this.onChange=function(){},this.onTouched=function(){}}return t.prototype.ngOnInit=function(){this._control=this._injector.get(Zi),this._checkName(),this._registry.add(this._control,this)},t.prototype.ngOnDestroy=function(){this._registry.remove(this)},t.prototype.writeValue=function(t){this._state=t===this.value,this._renderer.setProperty(this._elementRef.nativeElement,"checked",this._state)},t.prototype.registerOnChange=function(t){var e=this;this._fn=t,this.onChange=function(){t(e.value),e._registry.select(e)}},t.prototype.fireUncheck=function(t){this.writeValue(t)},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.setDisabledState=function(t){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",t)},t.prototype._checkName=function(){this.name&&this.formControlName&&this.name!==this.formControlName&&this._throwNameError(),!this.name&&this.formControlName&&(this.name=this.formControlName)},t.prototype._throwNameError=function(){throw new Error('\n If you define both a name and a formControlName attribute on your radio button, their values\n must match. Ex: <input type="radio" formControlName="food" name="food">\n ')},t}(),eo='\n <div [formGroup]="myGroup">\n <div formGroupName="person">\n <input formControlName="firstName">\n </div>\n </div>\n\n In your class:\n\n this.myGroup = new FormGroup({\n person: new FormGroup({ firstName: new FormControl() })\n });',no='\n <form>\n <div ngModelGroup="person">\n <input [(ngModel)]="person.name" name="firstName">\n </div>\n </form>';function ro(t,e){return Object(a.g)(e.path,[t])}function io(t,e){t||ao(e,"Cannot find control with"),e.valueAccessor||ao(e,"No value accessor for form control with"),t.validator=Fi.compose([t.validator,e.validator]),t.asyncValidator=Fi.composeAsync([t.asyncValidator,e.asyncValidator]),e.valueAccessor.writeValue(t.value),function(t,e){e.valueAccessor.registerOnChange(function(n){t._pendingValue=n,t._pendingChange=!0,t._pendingDirty=!0,"change"===t.updateOn&&oo(t,e)})}(t,e),function(t,e){t.registerOnChange(function(t,n){e.valueAccessor.writeValue(t),n&&e.viewToModelUpdate(t)})}(t,e),function(t,e){e.valueAccessor.registerOnTouched(function(){t._pendingTouched=!0,"blur"===t.updateOn&&t._pendingChange&&oo(t,e),"submit"!==t.updateOn&&t.markAsTouched()})}(t,e),e.valueAccessor.setDisabledState&&t.registerOnDisabledChange(function(t){e.valueAccessor.setDisabledState(t)}),e._rawValidators.forEach(function(e){e.registerOnValidatorChange&&e.registerOnValidatorChange(function(){return t.updateValueAndValidity()})}),e._rawAsyncValidators.forEach(function(e){e.registerOnValidatorChange&&e.registerOnValidatorChange(function(){return t.updateValueAndValidity()})})}function oo(t,e){t._pendingDirty&&t.markAsDirty(),t.setValue(t._pendingValue,{emitModelToViewChange:!1}),e.viewToModelUpdate(t._pendingValue),t._pendingChange=!1}function ao(t,e){var n;throw n=t.path.length>1?"path: '"+t.path.join(" -> ")+"'":t.path[0]?"name: '"+t.path+"'":"unspecified name attribute",new Error(e+" "+n)}function so(t){return null!=t?Fi.compose(t.map(Qi)):null}function uo(t){return null!=t?Fi.composeAsync(t.map(Xi)):null}var co=[Wi,function(){function t(t,e){this._renderer=t,this._elementRef=e,this.onChange=function(t){},this.onTouched=function(){}}return t.prototype.writeValue=function(t){this._renderer.setProperty(this._elementRef.nativeElement,"value",parseFloat(t))},t.prototype.registerOnChange=function(t){this.onChange=function(e){t(""==e?null:parseFloat(e))}},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.setDisabledState=function(t){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",t)},t}(),Yi,function(){function t(t,e){this._renderer=t,this._elementRef=e,this._optionMap=new Map,this._idCounter=0,this.onChange=function(t){},this.onTouched=function(){},this._compareWith=r.ub}return Object.defineProperty(t.prototype,"compareWith",{set:function(t){if("function"!=typeof t)throw new Error("compareWith must be a function, but received "+JSON.stringify(t));this._compareWith=t},enumerable:!0,configurable:!0}),t.prototype.writeValue=function(t){this.value=t;var e=this._getOptionId(t);null==e&&this._renderer.setProperty(this._elementRef.nativeElement,"selectedIndex",-1);var n=function(t,e){return null==t?""+e:(e&&"object"==typeof e&&(e="Object"),(t+": "+e).slice(0,50))}(e,t);this._renderer.setProperty(this._elementRef.nativeElement,"value",n)},t.prototype.registerOnChange=function(t){var e=this;this.onChange=function(n){e.value=e._getOptionValue(n),t(e.value)}},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.setDisabledState=function(t){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",t)},t.prototype._registerOption=function(){return(this._idCounter++).toString()},t.prototype._getOptionId=function(t){var e,n;try{for(var r=Object(a.h)(Array.from(this._optionMap.keys())),i=r.next();!i.done;i=r.next()){var o=i.value;if(this._compareWith(this._optionMap.get(o),t))return o}}catch(s){e={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}return null},t.prototype._getOptionValue=function(t){var e=function(t){return t.split(":")[0]}(t);return this._optionMap.has(e)?this._optionMap.get(e):t},t}(),function(){function t(t,e){this._renderer=t,this._elementRef=e,this._optionMap=new Map,this._idCounter=0,this.onChange=function(t){},this.onTouched=function(){},this._compareWith=r.ub}return Object.defineProperty(t.prototype,"compareWith",{set:function(t){if("function"!=typeof t)throw new Error("compareWith must be a function, but received "+JSON.stringify(t));this._compareWith=t},enumerable:!0,configurable:!0}),t.prototype.writeValue=function(t){var e,n=this;if(this.value=t,Array.isArray(t)){var r=t.map(function(t){return n._getOptionId(t)});e=function(t,e){t._setSelected(r.indexOf(e.toString())>-1)}}else e=function(t,e){t._setSelected(!1)};this._optionMap.forEach(e)},t.prototype.registerOnChange=function(t){var e=this;this.onChange=function(n){var r=[];if(n.hasOwnProperty("selectedOptions"))for(var i=n.selectedOptions,o=0;o<i.length;o++){var a=i.item(o),s=e._getOptionValue(a.value);r.push(s)}else for(i=n.options,o=0;o<i.length;o++)(a=i.item(o)).selected&&(s=e._getOptionValue(a.value),r.push(s));e.value=r,t(r)}},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.setDisabledState=function(t){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",t)},t.prototype._registerOption=function(t){var e=(this._idCounter++).toString();return this._optionMap.set(e,t),e},t.prototype._getOptionId=function(t){var e,n;try{for(var r=Object(a.h)(Array.from(this._optionMap.keys())),i=r.next();!i.done;i=r.next()){var o=i.value;if(this._compareWith(this._optionMap.get(o)._value,t))return o}}catch(s){e={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}return null},t.prototype._getOptionValue=function(t){var e=function(t){return t.split(":")[0]}(t);return this._optionMap.has(e)?this._optionMap.get(e)._value:t},t}(),to],lo=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(a.c)(e,t),e.prototype.ngOnInit=function(){this._checkParentType(),this.formDirective.addFormGroup(this)},e.prototype.ngOnDestroy=function(){this.formDirective&&this.formDirective.removeFormGroup(this)},Object.defineProperty(e.prototype,"control",{get:function(){return this.formDirective.getFormGroup(this)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"path",{get:function(){return ro(this.name,this._parent)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"formDirective",{get:function(){return this._parent?this._parent.formDirective:null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"validator",{get:function(){return so(this._validators)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"asyncValidator",{get:function(){return uo(this._asyncValidators)},enumerable:!0,configurable:!0}),e.prototype._checkParentType=function(){},e}(Li),ho=function(){function t(t){this._cd=t}return Object.defineProperty(t.prototype,"ngClassUntouched",{get:function(){return!!this._cd.control&&this._cd.control.untouched},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ngClassTouched",{get:function(){return!!this._cd.control&&this._cd.control.touched},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ngClassPristine",{get:function(){return!!this._cd.control&&this._cd.control.pristine},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ngClassDirty",{get:function(){return!!this._cd.control&&this._cd.control.dirty},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ngClassValid",{get:function(){return!!this._cd.control&&this._cd.control.valid},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ngClassInvalid",{get:function(){return!!this._cd.control&&this._cd.control.invalid},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ngClassPending",{get:function(){return!!this._cd.control&&this._cd.control.pending},enumerable:!0,configurable:!0}),t}(),fo=function(t){function e(e){return t.call(this,e)||this}return Object(a.c)(e,t),e}(ho),po=function(t){function e(e){return t.call(this,e)||this}return Object(a.c)(e,t),e}(ho);function yo(t){var e=mo(t)?t.validators:t;return Array.isArray(e)?so(e):e||null}function go(t,e){var n=mo(e)?e.asyncValidators:t;return Array.isArray(n)?uo(n):n||null}function mo(t){return null!=t&&!Array.isArray(t)&&"object"==typeof t}var vo=function(){function t(t,e){this.validator=t,this.asyncValidator=e,this._onCollectionChange=function(){},this.pristine=!0,this.touched=!1,this._onDisabledChange=[]}return Object.defineProperty(t.prototype,"parent",{get:function(){return this._parent},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"valid",{get:function(){return"VALID"===this.status},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"invalid",{get:function(){return"INVALID"===this.status},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"pending",{get:function(){return"PENDING"==this.status},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"disabled",{get:function(){return"DISABLED"===this.status},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"enabled",{get:function(){return"DISABLED"!==this.status},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dirty",{get:function(){return!this.pristine},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"untouched",{get:function(){return!this.touched},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"updateOn",{get:function(){return this._updateOn?this._updateOn:this.parent?this.parent.updateOn:"change"},enumerable:!0,configurable:!0}),t.prototype.setValidators=function(t){this.validator=yo(t)},t.prototype.setAsyncValidators=function(t){this.asyncValidator=go(t)},t.prototype.clearValidators=function(){this.validator=null},t.prototype.clearAsyncValidators=function(){this.asyncValidator=null},t.prototype.markAsTouched=function(t){void 0===t&&(t={}),this.touched=!0,this._parent&&!t.onlySelf&&this._parent.markAsTouched(t)},t.prototype.markAsUntouched=function(t){void 0===t&&(t={}),this.touched=!1,this._pendingTouched=!1,this._forEachChild(function(t){t.markAsUntouched({onlySelf:!0})}),this._parent&&!t.onlySelf&&this._parent._updateTouched(t)},t.prototype.markAsDirty=function(t){void 0===t&&(t={}),this.pristine=!1,this._parent&&!t.onlySelf&&this._parent.markAsDirty(t)},t.prototype.markAsPristine=function(t){void 0===t&&(t={}),this.pristine=!0,this._pendingDirty=!1,this._forEachChild(function(t){t.markAsPristine({onlySelf:!0})}),this._parent&&!t.onlySelf&&this._parent._updatePristine(t)},t.prototype.markAsPending=function(t){void 0===t&&(t={}),this.status="PENDING",!1!==t.emitEvent&&this.statusChanges.emit(this.status),this._parent&&!t.onlySelf&&this._parent.markAsPending(t)},t.prototype.disable=function(t){void 0===t&&(t={}),this.status="DISABLED",this.errors=null,this._forEachChild(function(e){e.disable(Object(a.a)({},t,{onlySelf:!0}))}),this._updateValue(),!1!==t.emitEvent&&(this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._updateAncestors(t),this._onDisabledChange.forEach(function(t){return t(!0)})},t.prototype.enable=function(t){void 0===t&&(t={}),this.status="VALID",this._forEachChild(function(e){e.enable(Object(a.a)({},t,{onlySelf:!0}))}),this.updateValueAndValidity({onlySelf:!0,emitEvent:t.emitEvent}),this._updateAncestors(t),this._onDisabledChange.forEach(function(t){return t(!1)})},t.prototype._updateAncestors=function(t){this._parent&&!t.onlySelf&&(this._parent.updateValueAndValidity(t),this._parent._updatePristine(),this._parent._updateTouched())},t.prototype.setParent=function(t){this._parent=t},t.prototype.updateValueAndValidity=function(t){void 0===t&&(t={}),this._setInitialStatus(),this._updateValue(),this.enabled&&(this._cancelExistingSubscription(),this.errors=this._runValidator(),this.status=this._calculateStatus(),"VALID"!==this.status&&"PENDING"!==this.status||this._runAsyncValidator(t.emitEvent)),!1!==t.emitEvent&&(this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._parent&&!t.onlySelf&&this._parent.updateValueAndValidity(t)},t.prototype._updateTreeValidity=function(t){void 0===t&&(t={emitEvent:!0}),this._forEachChild(function(e){return e._updateTreeValidity(t)}),this.updateValueAndValidity({onlySelf:!0,emitEvent:t.emitEvent})},t.prototype._setInitialStatus=function(){this.status=this._allControlsDisabled()?"DISABLED":"VALID"},t.prototype._runValidator=function(){return this.validator?this.validator(this):null},t.prototype._runAsyncValidator=function(t){var e=this;if(this.asyncValidator){this.status="PENDING";var n=Bi(this.asyncValidator(this));this._asyncValidationSubscription=n.subscribe(function(n){return e.setErrors(n,{emitEvent:t})})}},t.prototype._cancelExistingSubscription=function(){this._asyncValidationSubscription&&this._asyncValidationSubscription.unsubscribe()},t.prototype.setErrors=function(t,e){void 0===e&&(e={}),this.errors=t,this._updateControlsErrors(!1!==e.emitEvent)},t.prototype.get=function(t){return function(t,e,n){return null==e?null:(e instanceof Array||(e=e.split(".")),e instanceof Array&&0===e.length?null:e.reduce(function(t,e){return t instanceof wo?t.controls.hasOwnProperty(e)?t.controls[e]:null:t instanceof _o&&t.at(e)||null},t))}(this,t)},t.prototype.getError=function(t,e){var n=e?this.get(e):this;return n&&n.errors?n.errors[t]:null},t.prototype.hasError=function(t,e){return!!this.getError(t,e)},Object.defineProperty(t.prototype,"root",{get:function(){for(var t=this;t._parent;)t=t._parent;return t},enumerable:!0,configurable:!0}),t.prototype._updateControlsErrors=function(t){this.status=this._calculateStatus(),t&&this.statusChanges.emit(this.status),this._parent&&this._parent._updateControlsErrors(t)},t.prototype._initObservables=function(){this.valueChanges=new r.m,this.statusChanges=new r.m},t.prototype._calculateStatus=function(){return this._allControlsDisabled()?"DISABLED":this.errors?"INVALID":this._anyControlsHaveStatus("PENDING")?"PENDING":this._anyControlsHaveStatus("INVALID")?"INVALID":"VALID"},t.prototype._anyControlsHaveStatus=function(t){return this._anyControls(function(e){return e.status===t})},t.prototype._anyControlsDirty=function(){return this._anyControls(function(t){return t.dirty})},t.prototype._anyControlsTouched=function(){return this._anyControls(function(t){return t.touched})},t.prototype._updatePristine=function(t){void 0===t&&(t={}),this.pristine=!this._anyControlsDirty(),this._parent&&!t.onlySelf&&this._parent._updatePristine(t)},t.prototype._updateTouched=function(t){void 0===t&&(t={}),this.touched=this._anyControlsTouched(),this._parent&&!t.onlySelf&&this._parent._updateTouched(t)},t.prototype._isBoxedValue=function(t){return"object"==typeof t&&null!==t&&2===Object.keys(t).length&&"value"in t&&"disabled"in t},t.prototype._registerOnCollectionChange=function(t){this._onCollectionChange=t},t.prototype._setUpdateStrategy=function(t){mo(t)&&null!=t.updateOn&&(this._updateOn=t.updateOn)},t}(),bo=function(t){function e(e,n,r){void 0===e&&(e=null);var i=t.call(this,yo(n),go(r,n))||this;return i._onChange=[],i._applyFormState(e),i._setUpdateStrategy(n),i.updateValueAndValidity({onlySelf:!0,emitEvent:!1}),i._initObservables(),i}return Object(a.c)(e,t),e.prototype.setValue=function(t,e){var n=this;void 0===e&&(e={}),this.value=this._pendingValue=t,this._onChange.length&&!1!==e.emitModelToViewChange&&this._onChange.forEach(function(t){return t(n.value,!1!==e.emitViewToModelChange)}),this.updateValueAndValidity(e)},e.prototype.patchValue=function(t,e){void 0===e&&(e={}),this.setValue(t,e)},e.prototype.reset=function(t,e){void 0===t&&(t=null),void 0===e&&(e={}),this._applyFormState(t),this.markAsPristine(e),this.markAsUntouched(e),this.setValue(this.value,e),this._pendingChange=!1},e.prototype._updateValue=function(){},e.prototype._anyControls=function(t){return!1},e.prototype._allControlsDisabled=function(){return this.disabled},e.prototype.registerOnChange=function(t){this._onChange.push(t)},e.prototype._clearChangeFns=function(){this._onChange=[],this._onDisabledChange=[],this._onCollectionChange=function(){}},e.prototype.registerOnDisabledChange=function(t){this._onDisabledChange.push(t)},e.prototype._forEachChild=function(t){},e.prototype._syncPendingControls=function(){return!("submit"!==this.updateOn||(this._pendingDirty&&this.markAsDirty(),this._pendingTouched&&this.markAsTouched(),!this._pendingChange)||(this.setValue(this._pendingValue,{onlySelf:!0,emitModelToViewChange:!1}),0))},e.prototype._applyFormState=function(t){this._isBoxedValue(t)?(this.value=this._pendingValue=t.value,t.disabled?this.disable({onlySelf:!0,emitEvent:!1}):this.enable({onlySelf:!0,emitEvent:!1})):this.value=this._pendingValue=t},e}(vo),wo=function(t){function e(e,n,r){var i=t.call(this,yo(n),go(r,n))||this;return i.controls=e,i._initObservables(),i._setUpdateStrategy(n),i._setUpControls(),i.updateValueAndValidity({onlySelf:!0,emitEvent:!1}),i}return Object(a.c)(e,t),e.prototype.registerControl=function(t,e){return this.controls[t]?this.controls[t]:(this.controls[t]=e,e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange),e)},e.prototype.addControl=function(t,e){this.registerControl(t,e),this.updateValueAndValidity(),this._onCollectionChange()},e.prototype.removeControl=function(t){this.controls[t]&&this.controls[t]._registerOnCollectionChange(function(){}),delete this.controls[t],this.updateValueAndValidity(),this._onCollectionChange()},e.prototype.setControl=function(t,e){this.controls[t]&&this.controls[t]._registerOnCollectionChange(function(){}),delete this.controls[t],e&&this.registerControl(t,e),this.updateValueAndValidity(),this._onCollectionChange()},e.prototype.contains=function(t){return this.controls.hasOwnProperty(t)&&this.controls[t].enabled},e.prototype.setValue=function(t,e){var n=this;void 0===e&&(e={}),this._checkAllValuesPresent(t),Object.keys(t).forEach(function(r){n._throwIfControlMissing(r),n.controls[r].setValue(t[r],{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e)},e.prototype.patchValue=function(t,e){var n=this;void 0===e&&(e={}),Object.keys(t).forEach(function(r){n.controls[r]&&n.controls[r].patchValue(t[r],{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e)},e.prototype.reset=function(t,e){void 0===t&&(t={}),void 0===e&&(e={}),this._forEachChild(function(n,r){n.reset(t[r],{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e),this._updatePristine(e),this._updateTouched(e)},e.prototype.getRawValue=function(){return this._reduceChildren({},function(t,e,n){return t[n]=e instanceof bo?e.value:e.getRawValue(),t})},e.prototype._syncPendingControls=function(){var t=this._reduceChildren(!1,function(t,e){return!!e._syncPendingControls()||t});return t&&this.updateValueAndValidity({onlySelf:!0}),t},e.prototype._throwIfControlMissing=function(t){if(!Object.keys(this.controls).length)throw new Error("\n There are no form controls registered with this group yet. If you're using ngModel,\n you may want to check next tick (e.g. use setTimeout).\n ");if(!this.controls[t])throw new Error("Cannot find form control with name: "+t+".")},e.prototype._forEachChild=function(t){var e=this;Object.keys(this.controls).forEach(function(n){return t(e.controls[n],n)})},e.prototype._setUpControls=function(){var t=this;this._forEachChild(function(e){e.setParent(t),e._registerOnCollectionChange(t._onCollectionChange)})},e.prototype._updateValue=function(){this.value=this._reduceValue()},e.prototype._anyControls=function(t){var e=this,n=!1;return this._forEachChild(function(r,i){n=n||e.contains(i)&&t(r)}),n},e.prototype._reduceValue=function(){var t=this;return this._reduceChildren({},function(e,n,r){return(n.enabled||t.disabled)&&(e[r]=n.value),e})},e.prototype._reduceChildren=function(t,e){var n=t;return this._forEachChild(function(t,r){n=e(n,t,r)}),n},e.prototype._allControlsDisabled=function(){var t,e;try{for(var n=Object(a.h)(Object.keys(this.controls)),r=n.next();!r.done;r=n.next())if(this.controls[r.value].enabled)return!1}catch(i){t={error:i}}finally{try{r&&!r.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}return Object.keys(this.controls).length>0||this.disabled},e.prototype._checkAllValuesPresent=function(t){this._forEachChild(function(e,n){if(void 0===t[n])throw new Error("Must supply a value for form control with name: '"+n+"'.")})},e}(vo),_o=function(t){function e(e,n,r){var i=t.call(this,yo(n),go(r,n))||this;return i.controls=e,i._initObservables(),i._setUpdateStrategy(n),i._setUpControls(),i.updateValueAndValidity({onlySelf:!0,emitEvent:!1}),i}return Object(a.c)(e,t),e.prototype.at=function(t){return this.controls[t]},e.prototype.push=function(t){this.controls.push(t),this._registerControl(t),this.updateValueAndValidity(),this._onCollectionChange()},e.prototype.insert=function(t,e){this.controls.splice(t,0,e),this._registerControl(e),this.updateValueAndValidity()},e.prototype.removeAt=function(t){this.controls[t]&&this.controls[t]._registerOnCollectionChange(function(){}),this.controls.splice(t,1),this.updateValueAndValidity()},e.prototype.setControl=function(t,e){this.controls[t]&&this.controls[t]._registerOnCollectionChange(function(){}),this.controls.splice(t,1),e&&(this.controls.splice(t,0,e),this._registerControl(e)),this.updateValueAndValidity(),this._onCollectionChange()},Object.defineProperty(e.prototype,"length",{get:function(){return this.controls.length},enumerable:!0,configurable:!0}),e.prototype.setValue=function(t,e){var n=this;void 0===e&&(e={}),this._checkAllValuesPresent(t),t.forEach(function(t,r){n._throwIfControlMissing(r),n.at(r).setValue(t,{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e)},e.prototype.patchValue=function(t,e){var n=this;void 0===e&&(e={}),t.forEach(function(t,r){n.at(r)&&n.at(r).patchValue(t,{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e)},e.prototype.reset=function(t,e){void 0===t&&(t=[]),void 0===e&&(e={}),this._forEachChild(function(n,r){n.reset(t[r],{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e),this._updatePristine(e),this._updateTouched(e)},e.prototype.getRawValue=function(){return this.controls.map(function(t){return t instanceof bo?t.value:t.getRawValue()})},e.prototype._syncPendingControls=function(){var t=this.controls.reduce(function(t,e){return!!e._syncPendingControls()||t},!1);return t&&this.updateValueAndValidity({onlySelf:!0}),t},e.prototype._throwIfControlMissing=function(t){if(!this.controls.length)throw new Error("\n There are no form controls registered with this array yet. If you're using ngModel,\n you may want to check next tick (e.g. use setTimeout).\n ");if(!this.at(t))throw new Error("Cannot find form control at index "+t)},e.prototype._forEachChild=function(t){this.controls.forEach(function(e,n){t(e,n)})},e.prototype._updateValue=function(){var t=this;this.value=this.controls.filter(function(e){return e.enabled||t.disabled}).map(function(t){return t.value})},e.prototype._anyControls=function(t){return this.controls.some(function(e){return e.enabled&&t(e)})},e.prototype._setUpControls=function(){var t=this;this._forEachChild(function(e){return t._registerControl(e)})},e.prototype._checkAllValuesPresent=function(t){this._forEachChild(function(e,n){if(void 0===t[n])throw new Error("Must supply a value for form control at index: "+n+".")})},e.prototype._allControlsDisabled=function(){var t,e;try{for(var n=Object(a.h)(this.controls),r=n.next();!r.done;r=n.next())if(r.value.enabled)return!1}catch(i){t={error:i}}finally{try{r&&!r.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}return this.controls.length>0||this.disabled},e.prototype._registerControl=function(t){t.setParent(this),t._registerOnCollectionChange(this._onCollectionChange)},e}(vo),So=Promise.resolve(null),Eo=function(t){function e(e,n){var i=t.call(this)||this;return i.submitted=!1,i._directives=[],i.ngSubmit=new r.m,i.form=new wo({},so(e),uo(n)),i}return Object(a.c)(e,t),e.prototype.ngAfterViewInit=function(){this._setUpdateStrategy()},Object.defineProperty(e.prototype,"formDirective",{get:function(){return this},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"control",{get:function(){return this.form},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"path",{get:function(){return[]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"controls",{get:function(){return this.form.controls},enumerable:!0,configurable:!0}),e.prototype.addControl=function(t){var e=this;So.then(function(){var n=e._findContainer(t.path);t.control=n.registerControl(t.name,t.control),io(t.control,t),t.control.updateValueAndValidity({emitEvent:!1}),e._directives.push(t)})},e.prototype.getControl=function(t){return this.form.get(t.path)},e.prototype.removeControl=function(t){var e=this;So.then(function(){var n,r,i=e._findContainer(t.path);i&&i.removeControl(t.name),(r=(n=e._directives).indexOf(t))>-1&&n.splice(r,1)})},e.prototype.addFormGroup=function(t){var e=this;So.then(function(){var n=e._findContainer(t.path),r=new wo({});(function(t,e){null==t&&ao(e,"Cannot find control with"),t.validator=Fi.compose([t.validator,e.validator]),t.asyncValidator=Fi.composeAsync([t.asyncValidator,e.asyncValidator])})(r,t),n.registerControl(t.name,r),r.updateValueAndValidity({emitEvent:!1})})},e.prototype.removeFormGroup=function(t){var e=this;So.then(function(){var n=e._findContainer(t.path);n&&n.removeControl(t.name)})},e.prototype.getFormGroup=function(t){return this.form.get(t.path)},e.prototype.updateModel=function(t,e){var n=this;So.then(function(){n.form.get(t.path).setValue(e)})},e.prototype.setValue=function(t){this.control.setValue(t)},e.prototype.onSubmit=function(t){return this.submitted=!0,e=this._directives,this.form._syncPendingControls(),e.forEach(function(t){var e=t.control;"submit"===e.updateOn&&e._pendingChange&&(t.viewToModelUpdate(e._pendingValue),e._pendingChange=!1)}),this.ngSubmit.emit(t),!1;var e},e.prototype.onReset=function(){this.resetForm()},e.prototype.resetForm=function(t){void 0===t&&(t=void 0),this.form.reset(t),this.submitted=!1},e.prototype._setUpdateStrategy=function(){this.options&&null!=this.options.updateOn&&(this.form._updateOn=this.options.updateOn)},e.prototype._findContainer=function(t){return t.pop(),t.length?this.form.get(t):this.form},e}(Li),To=function(){function t(){}return t.modelParentException=function(){throw new Error('\n ngModel cannot be used to register form controls with a parent formGroup directive. Try using\n formGroup\'s partner directive "formControlName" instead. Example:\n\n \n <div [formGroup]="myGroup">\n <input formControlName="firstName">\n </div>\n\n In your class:\n\n this.myGroup = new FormGroup({\n firstName: new FormControl()\n });\n\n Or, if you\'d like to avoid registering this form control, indicate that it\'s standalone in ngModelOptions:\n\n Example:\n\n \n <div [formGroup]="myGroup">\n <input formControlName="firstName">\n <input [(ngModel)]="showMoreControls" [ngModelOptions]="{standalone: true}">\n </div>\n ')},t.formGroupNameException=function(){throw new Error("\n ngModel cannot be used to register form controls with a parent formGroupName or formArrayName directive.\n\n Option 1: Use formControlName instead of ngModel (reactive strategy):\n\n "+eo+"\n\n Option 2: Update ngModel's parent be ngModelGroup (template-driven strategy):\n\n "+no)},t.missingNameException=function(){throw new Error('If ngModel is used within a form tag, either the name attribute must be set or the form\n control must be defined as \'standalone\' in ngModelOptions.\n\n Example 1: <input [(ngModel)]="person.firstName" name="first">\n Example 2: <input [(ngModel)]="person.firstName" [ngModelOptions]="{standalone: true}">')},t.modelGroupParentException=function(){throw new Error("\n ngModelGroup cannot be used with a parent formGroup directive.\n\n Option 1: Use formGroupName instead of ngModelGroup (reactive strategy):\n\n "+eo+"\n\n Option 2: Use a regular form tag instead of the formGroup directive (template-driven strategy):\n\n "+no)},t.ngFormWarning=function(){console.warn("\n It looks like you're using 'ngForm'.\n\n Support for using the 'ngForm' element selector has been deprecated in Angular v6 and will be removed\n in Angular v9.\n\n Use 'ng-form' instead.\n\n Before:\n <ngForm #myForm=\"ngForm\">\n\n After:\n <ng-form #myForm=\"ngForm\">\n ")},t}(),Co=new r.p("NgFormSelectorWarning"),Io=function(t){function e(e,n,r){var i=t.call(this)||this;return i._parent=e,i._validators=n,i._asyncValidators=r,i}var n;return Object(a.c)(e,t),n=e,e.prototype._checkParentType=function(){this._parent instanceof n||this._parent instanceof Eo||To.modelGroupParentException()},e}(lo),Ao=Promise.resolve(null),Oo=function(t){function e(e,n,i,o){var a=t.call(this)||this;return a.control=new bo,a._registered=!1,a.update=new r.m,a._parent=e,a._rawValidators=n||[],a._rawAsyncValidators=i||[],a.valueAccessor=function(t,e){if(!e)return null;Array.isArray(e)||ao(t,"Value accessor was not provided as an array for form control with");var n=void 0,r=void 0,i=void 0;return e.forEach(function(e){var o;e.constructor===Gi?n=e:(o=e,co.some(function(t){return o.constructor===t})?(r&&ao(t,"More than one built-in value accessor matches form control with"),r=e):(i&&ao(t,"More than one custom value accessor matches form control with"),i=e))}),i||r||n||(ao(t,"No valid value accessor for form control with"),null)}(a,o),a}return Object(a.c)(e,t),e.prototype.ngOnChanges=function(t){this._checkForErrors(),this._registered||this._setUpControl(),"isDisabled"in t&&this._updateDisabled(t),function(t,e){if(!t.hasOwnProperty("model"))return!1;var n=t.model;return!!n.isFirstChange()||!Object(r.ub)(e,n.currentValue)}(t,this.viewModel)&&(this._updateValue(this.model),this.viewModel=this.model)},e.prototype.ngOnDestroy=function(){this.formDirective&&this.formDirective.removeControl(this)},Object.defineProperty(e.prototype,"path",{get:function(){return this._parent?ro(this.name,this._parent):[this.name]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"formDirective",{get:function(){return this._parent?this._parent.formDirective:null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"validator",{get:function(){return so(this._rawValidators)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"asyncValidator",{get:function(){return uo(this._rawAsyncValidators)},enumerable:!0,configurable:!0}),e.prototype.viewToModelUpdate=function(t){this.viewModel=t,this.update.emit(t)},e.prototype._setUpControl=function(){this._setUpdateStrategy(),this._isStandalone()?this._setUpStandalone():this.formDirective.addControl(this),this._registered=!0},e.prototype._setUpdateStrategy=function(){this.options&&null!=this.options.updateOn&&(this.control._updateOn=this.options.updateOn)},e.prototype._isStandalone=function(){return!this._parent||!(!this.options||!this.options.standalone)},e.prototype._setUpStandalone=function(){io(this.control,this),this.control.updateValueAndValidity({emitEvent:!1})},e.prototype._checkForErrors=function(){this._isStandalone()||this._checkParentType(),this._checkName()},e.prototype._checkParentType=function(){!(this._parent instanceof Io)&&this._parent instanceof lo?To.formGroupNameException():this._parent instanceof Io||this._parent instanceof Eo||To.modelParentException()},e.prototype._checkName=function(){this.options&&this.options.name&&(this.name=this.options.name),this._isStandalone()||this.name||To.missingNameException()},e.prototype._updateValue=function(t){var e=this;Ao.then(function(){e.control.setValue(t,{emitViewToModelChange:!1})})},e.prototype._updateDisabled=function(t){var e=this,n=t.isDisabled.currentValue,r=""===n||n&&"false"!==n;Ao.then(function(){r&&!e.control.disabled?e.control.disable():!r&&e.control.disabled&&e.control.enable()})},e}(Zi),Do=function(){return function(){}}(),ko=function(){return function(){}}(),No=function(){function t(){}var e;return e=t,t.withConfig=function(t){return{ngModule:e,providers:[{provide:Co,useValue:t.warnOnDeprecatedNgFormSelector}]}},t}(),Po=(n("Oipj"),n("Wcq6")),Ro=n("CB3U"),xo=function(){function t(t){this.firebaseAuth=t,this.userDetails=null,this.user=t.authState}return t.prototype.signup=function(t,e){this.firebaseAuth.auth.createUserWithEmailAndPassword(t,e).then(function(t){console.log("Success!",t)}).catch(function(t){console.log("Something went wrong:",t.message)})},t.prototype.signInWithGoogle=function(){return console.log("it called"),this.firebaseAuth.auth.signInWithPopup(new Po.auth.GoogleAuthProvider)},t.prototype.login=function(t,e){this.firebaseAuth.auth.signInWithEmailAndPassword(t,e).then(function(t){console.log("Nice, it worked!")}).catch(function(t){console.log("Something went wrong:",t.message)})},t.prototype.signInWithFacebook=function(){console.log("facebook login called "),this.firebaseAuth.auth.signInWithPopup(new Po.auth.FacebookAuthProvider)},t.prototype.isLoggedIn=function(){return null!=this.userDetails},t.prototype.logout=function(){this.firebaseAuth.auth.signOut()},t.ngInjectableDef=r.S({factory:function(){return new t(r.W(Ro.AngularFireAuth))},token:t,providedIn:"root"}),t}(),Mo=function(){function t(t){this.authService=t,this.logio=!1}return t.prototype.signup=function(){this.authService.signup(this.email,this.password),this.email=this.password=""},t.prototype.login=function(){this.authService.login(this.email,this.password),this.email=this.password=""},t.prototype.signInWithFacebook=function(){this.authService.signInWithFacebook()},t.prototype.logout=function(){this.authService.logout()},t.prototype.signInWithGoogle=function(){this.authService.signInWithGoogle()},t.prototype.signupbtn=function(){this.logio=!0},t.prototype.getuserst=function(){return 1==this.logio?"new username":"username"},t.prototype.ngOnInit=function(){},t}(),jo=r.nb({encapsulation:0,styles:[[""]],data:{}});function Lo(t){return r.Db(0,[(t()(),r.pb(0,0,null,null,4,"h1",[],null,null,null,null,null)),(t()(),r.Bb(1,null,["Welcome ","! "])),r.yb(131072,ft.b,[r.h]),(t()(),r.pb(3,0,null,null,1,"button",[],null,[[null,"click"]],function(t,e,n){var r=!0;return"click"===e&&(r=!1!==t.component.logout()&&r),r},null,null)),(t()(),r.Bb(-1,null,["log out please.."]))],null,function(t,e){var n,i=e.component;t(e,1,0,null==(n=r.Cb(e,1,0,r.xb(e,2).transform(i.authService.user)))?null:n.email)})}function Uo(t){return r.Db(0,[(t()(),r.pb(0,0,null,null,52,"div",[["class","limiter"]],null,null,null,null,null)),(t()(),r.pb(1,0,null,null,51,"div",[["class","container-login100"],["style","background-image: url('assets/images/bg-01.jpg');"]],null,null,null,null,null)),(t()(),r.pb(2,0,null,null,50,"div",[["class","wrap-login100 p-l-55 p-r-55 p-t-65 p-b-54"]],null,null,null,null,null)),(t()(),r.pb(3,0,null,null,49,"form",[["class","login100-form validate-form"],["novalidate",""]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"submit"],[null,"reset"]],function(t,e,n){var i=!0;return"submit"===e&&(i=!1!==r.xb(t,5).onSubmit(n)&&i),"reset"===e&&(i=!1!==r.xb(t,5).onReset()&&i),i},null,null)),r.ob(4,16384,null,0,Do,[],null,null),r.ob(5,4210688,null,0,Eo,[[8,null],[8,null]],null,null),r.zb(2048,null,Li,null,[Eo]),r.ob(7,16384,null,0,po,[[4,Li]],null,null),(t()(),r.pb(8,0,null,null,1,"span",[["class","login100-form-title p-b-49"]],null,null,null,null,null)),(t()(),r.Bb(-1,null,[" Login "])),(t()(),r.pb(10,0,null,null,9,"div",[["class","wrap-input100 validate-input m-b-23"],["data-validate","Username is reauired"]],null,null,null,null,null)),(t()(),r.pb(11,0,null,null,1,"span",[["class","label-input100"]],null,null,null,null,null)),(t()(),r.Bb(-1,null,["Username"])),(t()(),r.pb(13,0,null,null,5,"input",[["class","input100"],["name","username"],["placeholder","Type your username"],["type","text"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(t,e,n){var i=!0,o=t.component;return"input"===e&&(i=!1!==r.xb(t,14)._handleInput(n.target.value)&&i),"blur"===e&&(i=!1!==r.xb(t,14).onTouched()&&i),"compositionstart"===e&&(i=!1!==r.xb(t,14)._compositionStart()&&i),"compositionend"===e&&(i=!1!==r.xb(t,14)._compositionEnd(n.target.value)&&i),"ngModelChange"===e&&(i=!1!==(o.email=n)&&i),i},null,null)),r.ob(14,16384,null,0,Gi,[r.D,r.k,[2,Ki]],null,null),r.zb(1024,null,zi,function(t){return[t]},[Gi]),r.ob(16,671744,null,0,Oo,[[2,Li],[8,null],[8,null],[6,zi]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),r.zb(2048,null,Zi,null,[Oo]),r.ob(18,16384,null,0,fo,[[4,Zi]],null,null),(t()(),r.pb(19,0,null,null,0,"span",[["class","focus-input100"],["data-symbol","\uf206"]],null,null,null,null,null)),(t()(),r.pb(20,0,null,null,9,"div",[["class","wrap-input100 validate-input"],["data-validate","Password is required"]],null,null,null,null,null)),(t()(),r.pb(21,0,null,null,1,"span",[["class","label-input100"]],null,null,null,null,null)),(t()(),r.Bb(-1,null,["Password"])),(t()(),r.pb(23,0,null,null,5,"input",[["class","input100"],["name","pass"],["placeholder","Type your password"],["type","password"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(t,e,n){var i=!0,o=t.component;return"input"===e&&(i=!1!==r.xb(t,24)._handleInput(n.target.value)&&i),"blur"===e&&(i=!1!==r.xb(t,24).onTouched()&&i),"compositionstart"===e&&(i=!1!==r.xb(t,24)._compositionStart()&&i),"compositionend"===e&&(i=!1!==r.xb(t,24)._compositionEnd(n.target.value)&&i),"ngModelChange"===e&&(i=!1!==(o.password=n)&&i),i},null,null)),r.ob(24,16384,null,0,Gi,[r.D,r.k,[2,Ki]],null,null),r.zb(1024,null,zi,function(t){return[t]},[Gi]),r.ob(26,671744,null,0,Oo,[[2,Li],[8,null],[8,null],[6,zi]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),r.zb(2048,null,Zi,null,[Oo]),r.ob(28,16384,null,0,fo,[[4,Zi]],null,null),(t()(),r.pb(29,0,null,null,0,"span",[["class","focus-input100"],["data-symbol","\uf190"]],null,null,null,null,null)),(t()(),r.pb(30,0,null,null,2,"div",[["class","text-right p-t-8 p-b-31"]],null,null,null,null,null)),(t()(),r.pb(31,0,null,null,1,"a",[["href","#"]],null,null,null,null,null)),(t()(),r.Bb(-1,null,[" Forgot password? "])),(t()(),r.pb(33,0,null,null,4,"div",[["class","container-login100-form-btn"]],null,null,null,null,null)),(t()(),r.pb(34,0,null,null,3,"div",[["class","wrap-login100-form-btn"]],null,null,null,null,null)),(t()(),r.pb(35,0,null,null,0,"div",[["class","login100-form-bgbtn"]],null,null,null,null,null)),(t()(),r.pb(36,0,null,null,1,"button",[["class","login100-form-btn"]],[[8,"disabled",0]],[[null,"click"]],function(t,e,n){var r=!0;return"click"===e&&(r=!1!==t.component.signup()&&r),r},null,null)),(t()(),r.Bb(-1,null,[" Login "])),(t()(),r.pb(38,0,null,null,2,"div",[["class","txt1 text-center p-t-54 p-b-20"]],null,null,null,null,null)),(t()(),r.pb(39,0,null,null,1,"span",[],null,null,null,null,null)),(t()(),r.Bb(-1,null,[" Or Sign Up Using "])),(t()(),r.pb(41,0,null,null,6,"div",[["class","flex-c-m"]],null,null,null,null,null)),(t()(),r.pb(42,0,null,null,1,"a",[["class","login100-social-item bg1"]],null,[[null,"click"]],function(t,e,n){var r=!0;return"click"===e&&(r=!1!==t.component.signInWithFacebook()&&r),r},null,null)),(t()(),r.pb(43,0,null,null,0,"i",[["class","fa fa-facebook"]],null,null,null,null,null)),(t()(),r.pb(44,0,null,null,1,"a",[["class","login100-social-item bg2"],["href","#"]],null,null,null,null,null)),(t()(),r.pb(45,0,null,null,0,"i",[["class","fa fa-twitter"]],null,null,null,null,null)),(t()(),r.pb(46,0,null,null,1,"a",[["class","login100-social-item bg3"]],null,[[null,"click"]],function(t,e,n){var r=!0;return"click"===e&&(r=!1!==t.component.signInWithGoogle()&&r),r},null,null)),(t()(),r.pb(47,0,null,null,0,"i",[["class","fa fa-google"]],null,null,null,null,null)),(t()(),r.pb(48,0,null,null,4,"div",[["class","flex-col-c p-t-155"]],null,null,null,null,null)),(t()(),r.pb(49,0,null,null,1,"span",[["class","txt1 p-b-17"]],null,null,null,null,null)),(t()(),r.Bb(-1,null,[" Or Sign Up Using "])),(t()(),r.pb(51,0,null,null,1,"a",[["class","txt2"],["href","#"]],null,null,null,null,null)),(t()(),r.Bb(-1,null,[" Sign Up "]))],function(t,e){var n=e.component;t(e,16,0,"username",n.email),t(e,26,0,"pass",n.password)},function(t,e){var n=e.component;t(e,3,0,r.xb(e,7).ngClassUntouched,r.xb(e,7).ngClassTouched,r.xb(e,7).ngClassPristine,r.xb(e,7).ngClassDirty,r.xb(e,7).ngClassValid,r.xb(e,7).ngClassInvalid,r.xb(e,7).ngClassPending),t(e,13,0,r.xb(e,18).ngClassUntouched,r.xb(e,18).ngClassTouched,r.xb(e,18).ngClassPristine,r.xb(e,18).ngClassDirty,r.xb(e,18).ngClassValid,r.xb(e,18).ngClassInvalid,r.xb(e,18).ngClassPending),t(e,23,0,r.xb(e,28).ngClassUntouched,r.xb(e,28).ngClassTouched,r.xb(e,28).ngClassPristine,r.xb(e,28).ngClassDirty,r.xb(e,28).ngClassValid,r.xb(e,28).ngClassInvalid,r.xb(e,28).ngClassPending),t(e,36,0,!n.email||!n.password)})}function Vo(t){return r.Db(0,[(t()(),r.gb(16777216,null,null,2,null,Lo)),r.ob(1,16384,null,0,ft.j,[r.O,r.L],{ngIf:[0,"ngIf"],ngIfElse:[1,"ngIfElse"]},null),r.yb(131072,ft.b,[r.h]),(t()(),r.gb(0,[["yathis",2]],null,0,null,Uo)),(t()(),r.pb(4,0,null,null,0,"div",[["id","dropDownSelect1"]],null,null,null,null,null))],function(t,e){var n=e.component;t(e,1,0,r.Cb(e,1,0,r.xb(e,2).transform(n.authService.user)),r.xb(e,3))},null)}var Fo=r.nb({encapsulation:0,styles:[[""]],data:{}});function qo(t){return r.Db(0,[(t()(),r.pb(0,0,null,null,4,"section",[["id","top"],["style",'background-image:url("https://poly-bank.gq/assets/img/about.jpg");width:100%;background-position:center;background-size:cover;background-repeat:no-repeat;min-height:100vh;']],null,null,null,null,null)),(t()(),r.pb(1,0,null,null,1,"app-navigationbar",[],null,null,null,bi,vi)),r.ob(2,114688,null,0,mi,[],null,null),(t()(),r.pb(3,0,null,null,1,"app-bottom",[],null,null,null,xi,Ri)),r.ob(4,114688,null,0,Pi,[],null,null),(t()(),r.pb(5,0,null,null,1,"app-login",[],null,null,null,Vo,jo)),r.ob(6,114688,null,0,Mo,[xo],null,null)],function(t,e){t(e,2,0),t(e,4,0),t(e,6,0)},null)}function Bo(t){return r.Db(0,[(t()(),r.pb(0,0,null,null,1,"app-root",[],null,null,null,qo,Fo)),r.ob(1,49152,null,0,o,[],null,null)],null,null)}var Ho=r.lb("app-root",o,Bo,{},{},[]),zo=n("ORnb"),Wo=function(){function t(){}return t.ngInjectableDef=r.S({factory:function(){return new t},token:t,providedIn:"root"}),t}(),Ko=function(){return function(){}}(),Go=r.mb(i,[o],function(t){return r.vb([r.wb(512,r.j,r.bb,[[8,[gi,Ho]],[3,r.j],r.x]),r.wb(5120,zo.b,zo.f,[zo.d,[2,zo.c]]),r.wb(4608,Ei.AngularFirestore,Ei.AngularFirestore,[zo.d,[2,zo.c],[2,Ei.EnablePersistenceToken],[2,Ei.FirestoreSettingsToken],r.B,r.z,[2,Ei.PersistenceSettingsToken]]),r.wb(5120,r.u,r.kb,[[3,r.u]]),r.wb(4608,ft.l,ft.k,[r.u,[2,ft.s]]),r.wb(5120,r.c,r.hb,[]),r.wb(5120,r.s,r.ib,[]),r.wb(5120,r.t,r.jb,[]),r.wb(4608,he,fe,[ft.d]),r.wb(6144,r.G,null,[he]),r.wb(4608,ie,ae,[]),r.wb(5120,Nt,function(t,e,n,r,i,o,a,s){return[new ne(t,e,n),new le(r),new se(i,o,a,s)]},[ft.d,r.z,r.B,ft.d,ft.d,ie,r.cb,[2,oe]]),r.wb(4608,Pt,Pt,[Nt,r.z]),r.wb(135680,Mt,Mt,[ft.d]),r.wb(4608,Bt,Bt,[Pt,Mt]),r.wb(6144,r.E,null,[Bt]),r.wb(6144,xt,null,[Mt]),r.wb(4608,r.M,r.M,[r.z]),r.wb(5120,Pn,ui,[Br]),r.wb(4608,Xr,Xr,[]),r.wb(6144,Gr,null,[Xr]),r.wb(135680,Yr,Yr,[Br,r.w,r.i,r.q,Gr]),r.wb(4608,Qr,Qr,[]),r.wb(5120,Jr,ri,[Br,ft.o,Zr]),r.wb(5120,fi,hi,[ci]),r.wb(5120,r.b,function(t){return[t]},[fi]),r.wb(4608,$i,$i,[]),r.wb(4608,Ro.AngularFireAuth,Ro.AngularFireAuth,[zo.d,[2,zo.c],r.B,r.z]),r.wb(4608,Ti,Ti,[Ei.AngularFirestore]),r.wb(4608,xo,xo,[Ro.AngularFireAuth]),r.wb(4608,Wo,Wo,[]),r.wb(1073742336,zo.a,zo.a,[]),r.wb(1073742336,Ei.AngularFirestoreModule,Ei.AngularFirestoreModule,[]),r.wb(1073742336,ft.c,ft.c,[]),r.wb(1024,r.l,_e,[]),r.wb(1024,r.y,function(){return[ei()]},[]),r.wb(512,ci,ci,[r.q]),r.wb(1024,r.d,function(t,e){return[(n=t,Ot("probe",kt),Ot("coreTokens",Object(a.a)({},Dt,(n||[]).reduce(function(t,e){return t[e.name]=e.token,t},{}))),function(){return kt}),li(e)];var n},[[2,r.y],ci]),r.wb(512,r.e,r.e,[[2,r.d]]),r.wb(131584,r.g,r.g,[r.z,r.cb,r.q,r.l,r.j,r.e]),r.wb(1073742336,r.f,r.f,[r.g]),r.wb(1073742336,Se,Se,[[3,Se]]),r.wb(1024,$r,oi,[[3,Br]]),r.wb(512,ln,hn,[]),r.wb(512,zr,zr,[]),r.wb(256,Zr,{},[]),r.wb(1024,ft.h,ii,[ft.n,[2,ft.a],Zr]),r.wb(512,ft.g,ft.g,[ft.h]),r.wb(512,r.i,r.i,[]),r.wb(512,r.w,r.J,[r.i,[2,r.K]]),r.wb(1024,Mr,function(){return[[]]},[]),r.wb(1024,Br,si,[r.g,ln,zr,ft.g,r.q,r.w,r.i,Mr,Zr,[2,Lr],[2,Rr]]),r.wb(1073742336,ni,ni,[[2,$r],[2,Br]]),r.wb(1073742336,Ko,Ko,[]),r.wb(1073742336,ko,ko,[]),r.wb(1073742336,No,No,[]),r.wb(1073742336,Ro.AngularFireAuthModule,Ro.AngularFireAuthModule,[]),r.wb(1073742336,i,i,[]),r.wb(256,zo.d,{apiKey:"AIzaSyANR-qTFZater1wKiKTjORpD62tRGcRKFU",authDomain:"web-projects-ac2fc.firebaseapp.com",databaseURL:"https://web-projects-ac2fc.firebaseio.com",projectId:"web-projects-ac2fc",storageBucket:"",messagingSenderId:"953650920811"},[]),r.wb(256,zo.c,"angularfs",[]),r.wb(256,r.ab,!0,[])])});Object(r.T)(),we().bootstrapModuleFactory(Go).catch(function(t){return console.error(t)})},zVF4:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n("+7AZ"),i={NODE_CLIENT:!1,NODE_ADMIN:!1,SDK_VERSION:"${JSCORE_VERSION}"},o=function(t,e){if(!t)throw a(e)},a=function(t){return new Error("Firebase Database ("+i.SDK_VERSION+") INTERNAL ASSERT FAILED: "+t)},s=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},u={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,l=(15&s)<<2|c>>6,h=63&c;u||(h=64,a||(l=64)),r.push(n[o>>2],n[(3&o)<<4|s>>4],n[l],n[h])}return r.join("")},encodeString:function(t,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(t):this.encodeByteArray(s(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();r.push(o<<2|a>>4),64!=s&&(r.push(a<<4&240|s>>2),64!=u&&r.push(s<<6&192|u))}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)}}},c=function(t){try{return u.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 h=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}(),f=function(){return"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:""},p=Error.captureStackTrace,d=function(){return function(t,e){if(this.code=t,this.message=e,p)p(this,y.prototype.create);else try{throw Error.apply(this,arguments)}catch(n){this.name="FirebaseError",Object.defineProperty(this,"stack",{get:function(){return n.stack}})}}}();d.prototype=Object.create(Error.prototype),d.prototype.constructor=d,d.prototype.name="FirebaseError";var y=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+"?>"});var o=new d(i,n=this.serviceName+": "+n+" ("+i+").");for(var a in e)e.hasOwnProperty(a)&&"_"!==a.slice(-1)&&(o[a]=e[a]);return o},t}();function g(t){return JSON.parse(t)}var m=function(t){var e={},n={},r={},i="";try{var o=t.split(".");e=g(c(o[0])||""),n=g(c(o[1])||""),i=o[2],r=n.d||{},delete n.d}catch(a){}return{header:e,claims:n,data:r,signature:i}},v=function(t,e){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e(n,t[n])},b=function(t,e){return v(e,function(e,n){t[e]=n}),t},w=function(t,e,n){for(var r in t)if(e.call(n,t[r],r,t))return r},_=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 r.__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++)n[r]=4294967295&((h=n[r-3]^n[r-8]^n[r-14]^n[r-16])<<1|h>>>31);var i,o,a=this.chain_[0],s=this.chain_[1],u=this.chain_[2],c=this.chain_[3],l=this.chain_[4];for(r=0;r<80;r++){r<40?r<20?(i=c^s&(u^c),o=1518500249):(i=s^u^c,o=1859775393):r<60?(i=s&u|c&(s|u),o=2400959708):(i=s^u^c,o=3395469782);var h=(a<<5|a>>>27)+i+l+o+n[r]&4294967295;l=c,c=u,u=4294967295&(s<<30|s>>>2),s=a,a=h}this.chain_[0]=this.chain_[0]+a&4294967295,this.chain_[1]=this.chain_[1]+s&4294967295,this.chain_[2]=this.chain_[2]+u&4294967295,this.chain_[3]=this.chain_[3]+c&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.update(this.pad_,this.inbuf_<56?56-this.inbuf_: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(){return function(){this.blockSize=-1}}()),S=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 r,i=this;if(void 0===t&&void 0===e&&void 0===n)throw new Error("Missing Observer.");void 0===(r=function(t,e){if("object"!=typeof t||null===t)return!1;for(var n=0,r=["next","error","complete"];n<r.length;n++){var i=r[n];if(i in t&&"function"==typeof t[i])return!0}return!1}(t)?t:{next:t,error:e,complete:n}).next&&(r.next=E),void 0===r.error&&(r.error=E),void 0===r.complete&&(r.complete=E);var o=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(function(){try{i.finalError?r.error(i.finalError):r.complete()}catch(t){}}),this.observers.push(r),o},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 E(){}function T(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?")}return t+" failed: "+r+" argument "}e.assert=o,e.assertionError=a,e.base64=u,e.base64Decode=c,e.base64Encode=function(t){var e=s(t);return u.encodeByteArray(e,!0)},e.CONSTANTS=i,e.deepCopy=function(t){return l(void 0,t)},e.deepExtend=l,e.patchProperty=function(t,e,n){t[e]=n},e.Deferred=h,e.getUA=f,e.isMobileCordova=function(){return"undefined"!=typeof window&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(f())},e.isNodeSdk=function(){return!0===i.NODE_CLIENT||!0===i.NODE_ADMIN},e.isReactNative=function(){return"object"==typeof navigator&&"ReactNative"===navigator.product},e.ErrorFactory=y,e.FirebaseError=d,e.patchCapture=function(t){var e=p;return p=t,e},e.jsonEval=g,e.stringify=function(t){return JSON.stringify(t)},e.decode=m,e.isAdmin=function(t){var e=m(t).claims;return"object"==typeof e&&!0===e.admin},e.issuedAtTime=function(t){var e=m(t).claims;return"object"==typeof e&&e.hasOwnProperty("iat")?e.iat:null},e.isValidFormat=function(t){var e=m(t).claims;return!!e&&"object"==typeof e&&e.hasOwnProperty("iat")},e.isValidTimestamp=function(t){var e,n,r=m(t).claims,i=Math.floor((new Date).getTime()/1e3);return"object"==typeof r&&(r.hasOwnProperty("nbf")?e=r.nbf:r.hasOwnProperty("iat")&&(e=r.iat),n=r.hasOwnProperty("exp")?r.exp:e+86400),i&&e&&n&&i>=e&&i<=n},e.clone=function(t){return b({},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=b,e.findKey=w,e.findValue=function(t,e,n){var r=w(t,e,n);return r&&t[r]},e.forEach=v,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"==typeof 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 v(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=_,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 S(t,e);return n.subscribe.bind(n)},e.errorPrefix=T,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(T(t,e,r)+"must be a valid function.")},e.validateContextObject=function(t,e,n,r){if((!r||n)&&("object"!=typeof n||null===n))throw new Error(T(t,e,r)+"must be a valid context object.")},e.validateNamespace=function(t,e,n,r){if((!r||n)&&"string"!=typeof n)throw new Error(T(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 a=i-55296;o(++r<t.length,"Surrogate pair missing trail surrogate."),i=65536+(a<<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}},zotm:function(t,e,n){"use strict";n.d(e,"a",function(){return o});var r=n("rPjj"),i=n("Fxb1");function o(t,e,n,o,a){if(void 0===a&&(a=new r.a(t,n,o)),!a.closed)return Object(i.a)(e)(a)}}},[[0,0]]]);