PageSourceSearch

https://ieeeunm.web.app/main-es2015.7b85db2cad6b5e8c2393.js

js ieeeunm.web.app collected 2026-10-03 12:26:25 UTC 745,412 bytes, 1 lines download raw bytes

1(window.webpackJsonp=window.webpackJsonp||[]).push([[1],{0:function(e,t,n){e.exports=n("zUnb")},"1XSQ":function(e,t,n){"use strict";n("8Y7J");var r=n("SVse"),i=n("3N8a");class o extends i.a{constructor(e,t){super(e,t),this.scheduler=e,this.work=t}schedule(e,t=0){return t>0?super.schedule(e,t):(this.delay=t,this.state=e,this.scheduler.flush(this),this)}execute(e,t){return t>0||this.closed?super.execute(e,t):this._execute(e,t)}requestAsyncId(e,t,n=0){return null!==n&&n>0||null===n&&this.delay>0?super.requestAsyncId(e,t,n):e.flush(this)}}var s=n("IjjT");class a extends s.a{}const u=new a(o);var l=n("HDdC");n.d(t,"a",function(){return c}),n.d(t,"b",function(){return h});class c{constructor(e,t){this.zone=e,this.platformId=t}schedule(...e){return this.zone.runGuarded(function(){return u.schedule.apply(u,e)})}keepUnstableUntilFirst(e){return Object(r.x)(this.platformId)?new l.a(t=>{const n=()=>{},r=Zone.current.scheduleMacroTask("firebaseZoneBlock",n,{},n,n);e.subscribe(e=>{"scheduled"===r.state&&r.invoke(),t.next(e)},e=>{"scheduled"===r.state&&r.invoke(),t.error(e)},()=>{"scheduled"===r.state&&r.invoke(),t.complete()})}):e}runOutsideAngular(e){return new l.a(t=>this.zone.runOutsideAngular(()=>e.subscribe(e=>this.zone.run(()=>t.next(e)),e=>this.zone.run(()=>t.error(e)),()=>this.zone.run(()=>t.complete()))))}}const h=e=>t=>new l.a(n=>t.subscribe(t=>e.run(()=>n.next(t)),t=>e.run(()=>n.error(t)),()=>e.run(()=>n.complete())))},"2QA8":function(e,t,n){"use strict";n.d(t,"a",function(){return r});const r=(()=>"function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random())()},"2fFW":function(e,t,n){"use strict";n.d(t,"a",function(){return i});let r=!1;const i={Promise:void 0,set useDeprecatedSynchronousErrorHandling(e){if(e){const e=new Error;console.warn("DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at: \n"+e.stack)}else r&&console.log("RxJS: Back to a better error behavior. Thank you. <3");r=e},get useDeprecatedSynchronousErrorHandling(){return r}}},"3N8a":function(e,t,n){"use strict";var r=n("quSY");class i extends r.a{constructor(e,t){super()}schedule(e,t=0){return this}}n.d(t,"a",function(){return o});class o extends i{constructor(e,t){super(e,t),this.scheduler=e,this.work=t,this.pending=!1}schedule(e,t=0){if(this.closed)return this;this.state=e;const n=this.id,r=this.scheduler;return null!=n&&(this.id=this.recycleAsyncId(r,n,t)),this.pending=!0,this.delay=t,this.id=this.id||this.requestAsyncId(r,this.id,t),this}requestAsyncId(e,t,n=0){return setInterval(e.flush.bind(e,this),n)}recycleAsyncId(e,t,n=0){if(null!==n&&this.delay===n&&!1===this.pending)return t;clearInterval(t)}execute(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;const n=this._execute(e,t);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))}_execute(e,t){let n=!1,r=void 0;try{this.work(e)}catch(i){n=!0,r=!!i&&i||new Error(i)}if(n)return this.unsubscribe(),r}_unsubscribe(){const e=this.id,t=this.scheduler,n=t.actions,r=n.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==r&&n.splice(r,1),null!=e&&(this.id=this.recycleAsyncId(t,e,null)),this.delay=null}}},"5+tZ":function(e,t,n){"use strict";n.d(t,"a",function(){return u});var r=n("ZUHj"),i=n("l7GE"),o=n("51Dv"),s=n("lJxs"),a=n("Cfvw");function u(e,t,n=Number.POSITIVE_INFINITY){return"function"==typeof t?r=>r.pipe(u((n,r)=>Object(a.a)(e(n,r)).pipe(Object(s.a)((e,i)=>t(n,e,r,i))),n)):("number"==typeof t&&(n=t),t=>t.lift(new l(e,n)))}class l{constructor(e,t=Number.POSITIVE_INFINITY){this.project=e,this.concurrent=t}call(e,t){return t.subscribe(new c(e,this.project,this.concurrent))}}class c extends i.a{constructor(e,t,n=Number.POSITIVE_INFINITY){super(e),this.project=t,this.concurrent=n,this.hasCompleted=!1,this.buffer=[],this.active=0,this.index=0}_next(e){this.active<this.concurrent?this._tryNext(e):this.buffer.push(e)}_tryNext(e){let t;const n=this.index++;try{t=this.project(e,n)}catch(r){return void this.destination.error(r)}this.active++,this._innerSub(t,e,n)}_innerSub(e,t,n){const i=new o.a(this,void 0,void 0);this.destination.add(i),Object(r.a)(this,e,t,n,i)}_complete(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&this.destination.complete(),this.unsubscribe()}notifyNext(e,t,n,r,i){this.destination.next(t)}notifyComplete(e){const t=this.buffer;this.remove(e),this.active--,t.length>0?this._next(t.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()}}},"51Dv":function(e,t,n){"use strict";n.d(t,"a",function(){return i});var r=n("7o/Q");class i extends r.a{constructor(e,t,n){super(),this.parent=e,this.outerValue=t,this.outerIndex=n,this.index=0}_next(e){this.parent.notifyNext(this.outerValue,e,this.outerIndex,this.index++,this)}_error(e){this.parent.notifyError(e,this),this.unsubscribe()}_complete(){this.parent.notifyComplete(this),this.unsubscribe()}}},"6Joi":function(e,t,n){"use strict";
1Object.defineProperty(t,"__esModule",{value:!0});var r,i=(r=n("wj3C"))&&"object"==typeof r&&"default"in r?r.default:r,o=n("q/0M"),s=n("mrSG"),a=n("zVF4"),u=n("x7I3"),l=i.SDK_VERSION,c=new o.Logger("@firebase/firestore"),h=function(e){return e[e.DEBUG=0]="DEBUG",e[e.ERROR=1]="ERROR",e[e.SILENT=2]="SILENT",e}({});function d(){return c.logLevel===o.LogLevel.DEBUG?h.DEBUG:c.logLevel===o.LogLevel.SILENT?h.SILENT:h.ERROR}function f(e){switch(e){case h.DEBUG:c.logLevel=o.LogLevel.DEBUG;break;case h.ERROR:c.logLevel=o.LogLevel.ERROR;break;case h.SILENT:c.logLevel=o.LogLevel.SILENT;break;default:c.error("Firestore ("+l+"): Invalid value passed to `setLogLevel`")}}function p(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];if(c.logLevel<=o.LogLevel.DEBUG){var i=n.map(g);c.debug.apply(c,["Firestore ("+l+") ["+e+"]: "+t].concat(i))}}function m(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(c.logLevel<=o.LogLevel.ERROR){var r=t.map(g);c.error.apply(c,["Firestore ("+l+"): "+e].concat(r))}}function g(e){if("string"==typeof e)return e;var t=v.getPlatform();try{return t.formatJSON(e)}catch(n){return e}}function y(e){var t="FIRESTORE ("+l+") INTERNAL ASSERTION FAILED: "+e;throw m(t),new Error(t)}function b(e,t){e||y(t)}var v=function(){function e(){}return e.setPlatform=function(t){e.platform&&y("Platform already defined"),e.platform=t},e.getPlatform=function(){return e.platform||y("Platform not set"),e.platform},e}();function w(){return v.getPlatform().emptyByteString}var _={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"},S=function(e){function t(t,n){var r=e.call(this,n)||this;return r.code=t,r.message=n,r.name="FirebaseError",r.toString=function(){return r.name+": [code="+r.code+"]: "+r.message},r}return s.__extends(t,e),t}(Error);function E(e,t){function n(){var e="This constructor is private.";throw t&&(e+=" ",e+=t),new S(_.INVALID_ARGUMENT,e)}for(var r in n.prototype=e.prototype,e)e.hasOwnProperty(r)&&(n[r]=e[r]);return n}function C(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function T(e,t){return void 0!==e?e:t}function I(e,t){for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=Number(n);isNaN(r)||t(r,e[n])}}function D(e,t){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t(n,e[n])}function x(e){for(var t in b(null!=e&&"object"==typeof e,"isEmpty() expects object parameter."),e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}function k(e,t){if(0!==t.length)throw new S(_.INVALID_ARGUMENT,"Function "+e+"() does not support arguments, but was called with "+Q(t.length,"argument")+".")}function A(e,t,n){if(t.length!==n)throw new S(_.INVALID_ARGUMENT,"Function "+e+"() requires "+Q(n,"argument")+", but was called with "+Q(t.length,"argument")+".")}function O(e,t,n){if(t.length<n)throw new S(_.INVALID_ARGUMENT,"Function "+e+"() requires at least "+Q(n,"argument")+", but was called with "+Q(t.length,"argument")+".")}function N(e,t,n,r){if(t.length<n||t.length>r)throw new S(_.INVALID_ARGUMENT,"Function "+e+"() requires between "+n+" and "+r+" arguments, but was called with "+Q(t.length,"argument")+".")}function R(e,t,n,r){V(e,t,W(n)+" argument",r)}function M(e,t,n,r){void 0!==r&&R(e,t,n,r)}function P(e,t,n,r){V(e,t,n+" option",r)}function L(e,t,n,r){void 0!==r&&P(e,t,n,r)}function F(e,t,n,r,i){void 0!==r&&function(e,t,n,r,i){for(var o=[],s=0,a=i;s<a.length;s++){var u=a[s];if(u===r)return;o.push(q(u))}var l=q(r);throw new S(_.INVALID_ARGUMENT,"Invalid value "+l+" provided to function "+e+'() for option "'+n+'". Acceptable values: '+o.join(", "))}(e,0,n,r,i)}function j(e,t,n,r){if(!t.some(function(e){return e===r}))throw new S(_.INVALID_ARGUMENT,"Invalid value "+q(r)+" provided to function "+e+"() for its "+W(n)+" argument. Acceptable values: "+t.join(", "))}function V(e,t,n,r){if(!("object"===t?U(r):"non-empty string"===t?"string"==typeof r&&""!==r:typeof r===t)){var i=q(r);
1throw new S(_.INVALID_ARGUMENT,"Function "+e+"() requires its "+n+" to be of type "+t+", but it was: "+i)}}function U(e){return"object"==typeof e&&null!==e&&(Object.getPrototypeOf(e)===Object.prototype||null===Object.getPrototypeOf(e))}function q(e){if(void 0===e)return"undefined";if(null===e)return"null";if("string"==typeof e)return e.length>20&&(e=e.substring(0,20)+"..."),JSON.stringify(e);if("number"==typeof e||"boolean"==typeof e)return""+e;if("object"==typeof e){if(e instanceof Array)return"an array";var t=function(e){if(e.constructor){var t=/function\s+([^\s(]+)\s*\(/.exec(e.constructor.toString());if(t&&t.length>1)return t[1]}return null}(e);return t?"a custom "+t+" object":"an object"}return"function"==typeof e?"a function":y("Unknown wrong type: "+typeof e)}function B(e,t,n){if(void 0===n)throw new S(_.INVALID_ARGUMENT,"Function "+e+"() requires a valid "+W(t)+" argument, but it was undefined.")}function H(e,t,n){D(t,function(t,r){if(n.indexOf(t)<0)throw new S(_.INVALID_ARGUMENT,"Unknown option '"+t+"' passed to function "+e+"(). Available options: "+n.join(", "))})}function z(e,t,n,r){var i=q(r);return new S(_.INVALID_ARGUMENT,"Function "+e+"() requires its "+W(n)+" argument to be a "+t+", but it was: "+i)}function W(e){switch(e){case 1:return"first";
1case 2:return"second";case 3:return"third";default:return e+"th"}}function Q(e,t){return e+" "+t+(1===e?"":"s")}var G=function(){function e(){}return e.newId=function(){for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",t="",n=0;n<20;n++)t+=e.charAt(Math.floor(Math.random()*e.length));return b(20===t.length,"Invalid auto ID: "+t),t},e}();function K(e,t){return e<t?-1:e>t?1:0}function $(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!e[n].isEqual(t[n]))return!1;return!0}function Y(e){return e+"\0"}function Z(){if("undefined"==typeof Uint8Array)throw new S(_.UNIMPLEMENTED,"Uint8Arrays are not available in this environment.")}function J(){if(!v.getPlatform().base64Available)throw new S(_.UNIMPLEMENTED,"Blobs are unavailable in Firestore in this environment.")}var X=function(){function e(e){J(),this._binaryString=e}return e.fromBase64String=function(t){A("Blob.fromBase64String",arguments,1),R("Blob.fromBase64String","string",1,t),J();try{var n=v.getPlatform().atob(t);return new e(n)}catch(r){throw new S(_.INVALID_ARGUMENT,"Failed to construct Blob from Base64 string: "+r)}},e.fromUint8Array=function(t){if(A("Blob.fromUint8Array",arguments,1),Z(),!(t instanceof Uint8Array))throw z("Blob.fromUint8Array","Uint8Array",1,t);var n=Array.prototype.map.call(t,function(e){return String.fromCharCode(e)}).join("");return new e(n)},e.prototype.toBase64=function(){return A("Blob.toBase64",arguments,0),J(),v.getPlatform().btoa(this._binaryString)},e.prototype.toUint8Array=function(){A("Blob.toUint8Array",arguments,0),Z();for(var e=new Uint8Array(this._binaryString.length),t=0;t<this._binaryString.length;t++)e[t]=this._binaryString.charCodeAt(t);return e},e.prototype.toString=function(){return"Blob(base64: "+this.toBase64()+")"},e.prototype.isEqual=function(e){return this._binaryString===e._binaryString},e.prototype._compareTo=function(e){return K(this._binaryString,e._binaryString)},e}(),ee=E(X,"Use Blob.fromUint8Array() or Blob.fromBase64String() instead."),te=function(){return function(e,t,n,r,i){this.databaseId=e,this.persistenceKey=t,this.host=n,this.ssl=r,this.forceLongPolling=i}}(),ne="(default)",re=function(){function e(e,t){this.projectId=e,this.database=t||ne}return Object.defineProperty(e.prototype,"isDefaultDatabase",{get:function(){return this.database===ne},enumerable:!0,configurable:!0}),e.prototype.isEqual=function(t){return t instanceof e&&t.projectId===this.projectId&&t.database===this.database},e.prototype.compareTo=function(e){return K(this.projectId,e.projectId)||K(this.database,e.database)},e}(),ie=function(){function e(e,t){var n=this;this.previousValue=e,t&&(t.sequenceNumberHandler=function(e){return n.setPreviousValue(e)},this.writeNewSequenceNumber=function(e){return t.writeSequenceNumber(e)})}return e.prototype.setPreviousValue=function(e){return this.previousValue=Math.max(e,this.previousValue),this.previousValue},e.prototype.next=function(){var e=++this.previousValue;return this.writeNewSequenceNumber&&this.writeNewSequenceNumber(e),e},e.INVALID=-1,e}(),oe=function(){function e(e,t,n){this.init(e,t,n)}return e.prototype.init=function(e,t,n){void 0===t?t=0:t>e.length&&y("offset "+t+" out of range "+e.length),void 0===n?n=e.length-t:n>e.length-t&&y("length "+n+" out of range "+(e.length-t)),this.segments=e,this.offset=t,this.len=n},e.prototype.construct=function(e,t,n){var r=Object.create(Object.getPrototypeOf(this));return r.init(e,t,n),r},Object.defineProperty(e.prototype,"length",{get:function(){return this.len},enumerable:!0,configurable:!0}),e.prototype.isEqual=function(t){return 0===e.comparator(this,t)},e.prototype.child=function(t){var n=this.segments.slice(this.offset,this.limit());return t instanceof e?t.forEach(function(e){n.push(e)}):"string"==typeof t?n.push(t):y("Unknown parameter type for Path.child(): "+t),this.construct(n)},e.prototype.limit=function(){return this.offset+this.length},e.prototype.popFirst=function(e){return b(this.length>=(e=void 0===e?1:e),"Can't call popFirst() with less segments"),this.construct(this.segments,this.offset+e,this.length-e)},e.prototype.popLast=function(){return b(!this.isEmpty(),"Can't 
1call popLast() on empty path"),this.construct(this.segments,this.offset,this.length-1)},e.prototype.firstSegment=function(){return b(!this.isEmpty(),"Can't call firstSegment() on empty path"),this.segments[this.offset]},e.prototype.lastSegment=function(){return this.get(this.length-1)},e.prototype.get=function(e){return b(e<this.length,"Index out of range"),this.segments[this.offset+e]},e.prototype.isEmpty=function(){return 0===this.length},e.prototype.isPrefixOf=function(e){if(e.length<this.length)return!1;for(var t=0;t<this.length;t++)if(this.get(t)!==e.get(t))return!1;return!0},e.prototype.isImmediateParentOf=function(e){if(this.length+1!==e.length)return!1;for(var t=0;t<this.length;t++)if(this.get(t)!==e.get(t))return!1;return!0},e.prototype.forEach=function(e){for(var t=this.offset,n=this.limit();t<n;t++)e(this.segments[t])},e.prototype.toArray=function(){return this.segments.slice(this.offset,this.limit())},e.comparator=function(e,t){for(var n=Math.min(e.length,t.length),r=0;r<n;r++){var i=e.get(r),o=t.get(r);if(i<o)return-1;if(i>o)return 1}return e.length<t.length?-1:e.length>t.length?1:0},e}(),se=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return s.__extends(t,e),t.prototype.canonicalString=function(){return this.toArray().join("/")},t.prototype.toString=function(){return this.canonicalString()},t.fromString=function(e){if(e.indexOf("//")>=0)throw new S(_.INVALID_ARGUMENT,"Invalid path ("+e+"). Paths must not contain // in them.");return new t(e.split("/").filter(function(e){return e.length>0}))},t.EMPTY_PATH=new t([]),t}(oe),ae=/^[_a-zA-Z][_a-zA-Z0-9]*$/,ue=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return s.__extends(t,e),t.isValidIdentifier=function(e){return ae.test(e)},t.prototype.canonicalString=function(){return this.toArray().map(function(e){return e=e.replace("\\","\\\\").replace("`","\\`"),t.isValidIdentifier(e)||(e="`"+e+"`"),e}).join(".")},t.prototype.toString=function(){return this.canonicalString()},t.prototype.isKeyField=function(){return 1===this.length&&"__name__"===this.get(0)},t.keyField=function(){return new t(["__name__"])},t.fromServerFormat=function(e){for(var n=[],r="",i=0,o=function(){if(0===r.length)throw new S(_.INVALID_ARGUMENT,"Invalid field path ("+e+"). Paths must not be empty, begin with '.', end with '.', or contain '..'");n.push(r),r=""},s=!1;i<e.length;){var a=e[i];if("\\"===a){if(i+1===e.length)throw new S(_.INVALID_ARGUMENT,"Path has trailing escape character: "+e);var u=e[i+1];if("\\"!==u&&"."!==u&&"`"!==u)throw new S(_.INVALID_ARGUMENT,"Path has invalid escape sequence: "+e);r+=u,i+=2}else"`"===a?(s=!s,i++):"."!==a||s?(r+=a,i++):(o(),i++)}if(o(),s)throw new S(_.INVALID_ARGUMENT,"Unterminated ` in path: "+e);return new t(n)},t.EMPTY_PATH=new t([]),t}(oe),le=function(){function e(t){this.path=t,b(e.isDocumentKey(t),"Invalid DocumentKey with an odd number of segments: "+t.toArray().join("/"))}return e.prototype.hasCollectionId=function(e){return this.path.length>=2&&this.path.get(this.path.length-2)===e},e.prototype.isEqual=function(e){return null!==e&&0===se.comparator(this.path,e.path)},e.prototype.toString=function(){return this.path.toString()},e.comparator=function(e,t){return se.comparator(e.path,t.path)},e.isDocumentKey=function(e){return e.length%2==0},e.fromSegments=function(t){return new e(new se(t.slice()))},e.fromPathString=function(t){return new e(se.fromString(t))},e.EMPTY=new e(new se([])),e}(),ce=function(){return function(){var e=this;this.promise=new Promise(function(t,n){e.resolve=t,e.reject=n})}}(),he=function(e){return e.All="all",e.ListenStreamIdle="listen_stream_idle",e.ListenStreamConnectionBackoff="listen_stream_connection_backoff",e.WriteStreamIdle="write_stream_idle",e.WriteStreamConnectionBackoff="write_stream_connection_backoff",e.OnlineStateTimeout="online_state_timeout",e.ClientMetadataRefresh="client_metadata_refresh",e.LruGarbageCollection="lru_garbage_collection",e}({}),de=function(){function e(e,t,n,r,i){this.asyncQueue=e,this.timerId=t,this.targetTimeMs=n,this.op=r,this.removalCallback=i,this.deferred=new ce,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(e){})}return e.createAndSchedule=function(t,n,r,i,o){var s=new e(t,n,Date.now()+r,i,o);return s.start(r),s},e.prototype.start=function(e){var t=this;this.timerHandle=setTimeout(function(){return t.handleDelayElapsed()},e)},e.prototype.skipDelay=function(){return this.handleDelayElapsed()},e.prototype.cancel=function(e){null!==this.timerHandle&&(this.clearTimeout(),this.deferred.reject(new S(_.CANCELLED,"Operation cancelled"+(e?": "+e:""))))},e.prototype.handleDelayElapsed=function(){var e=this;this.asyncQueue.enqueueAndForget(function(){return null!==e.timerHandle?(e.clearTimeout(),e.op().then(function(t){return e.deferred.resolve(t)})):Promise.resolve()})},e.prototype.clearTimeout=function(){null!==this.timerHandle&&(this.removalCallback(this),clearTimeout(this.timerHandle),this.timerHandle=null)},e}(),fe=function(){function e(){this.tail=Promise.resolve(),this.delayedOperations=[],this.operationInProgress=!1}return e.prototype.enqueueAndForget=function(e){this.enqueue(e)},e.prototype.enqueue=function(e){var t=this;this.verifyNotFailed();var n=this.tail.then(function(){return t.operationInProgress=!0,e().catch(function(e){t.failure=e,t.operationInProgress=!1;var n=e.stack||e.message||"";throw m("INTERNAL UNHANDLED ERROR: ",n),n.indexOf("Firestore Test Simulated Error")<0&&setTimeout(function(){throw e},0),e}).then(function(e){return t.operationInProgress=!1,e})});return this.tail=n,n},e.prototype.enqueueAfterDelay=function(e,t,n){var r=this;this.verifyNotFailed(),b(t>=0,"Attempted to schedule an operation with a negative delay of "+t),b(!this.containsDelayedOperation(e),"Attempted to schedule multiple operations with timer id "+e+".");var i=de.createAndSchedule(this,e,t,n,function(e){return r.removeDelayedOperation(e)});return this.delayedOperations.push(i),i},e.prototype.verifyNotFailed=function(){this.failure&&y("AsyncQueue is already failed: "+(this.failure.stack||this.failure.message))},e.prototype.verifyOperationInProgress=function(){b(this.operationInProgress,"verifyOpInProgress() called when no op in progress on this queue.")},e.prototype.drain=function(){return this.enqueue(function(){return Promise.resolve()})},e.prototype.containsDelayedOperation=function(e){for(var t=0,n=this.delayedOperations;t<n.length;t++)if(n[t].timerId===e)return!0;return!1},e.prototype.runDelayedOperationsEarly=function(e){var t=this;return this.drain().then(function(){b(e===he.All||t.containsDelayedOperation(e),"Attempted to drain to missing operation "+e),t.delayedOperations.sort(function(e,t){return e.targetTimeMs-t.targetTimeMs});for(var n=0,r=t.delayedOperations;n<r.length;n++){var i=r[n];if(i.skipDelay(),e!==he.All&&i.timerId===e)break}return t.drain()})},e.prototype.removeDelayedOperation=function(e){var t=this.delayedOperations.indexOf(e);b(t>=0,"Delayed operation not found."),this.delayedOperations.splice(t,1)},e}
1(),pe="\x01",me="\x01",ge="\x10",ye="\x11";function be(e){for(var t="",n=0;n<e.length;n++)t.length>0&&(t=we(t)),t=ve(e.get(n),t);return we(t)}function ve(e,t){for(var n=t,r=e.length,i=0;i<r;i++){var o=e.charAt(i);switch(o){case"\0":n+=pe+ge;break;case pe:n+=pe+ye;break;default:n+=o}}return n}function we(e){return e+pe+me}function _e(e){var t=e.length;if(b(t>=2,"Invalid path "+e),2===t)return b(e.charAt(0)===pe&&e.charAt(1)===me,"Non-empty path "+e+" had length 2"),se.EMPTY_PATH;for(var n=t-2,r=[],i="",o=0;o<t;){var s=e.indexOf(pe,o);switch((s<0||s>n)&&y('Invalid encoded resource path: "'+e+'"'),e.charAt(s+1)){case me:var a=e.substring(o,s),u=void 0;0===i.length?u=a:(u=i+=a,i=""),r.push(u);break;case ge:i+=e.substring(o,s),i+="\0";break;case ye:i+=e.substring(o,s+1);break;default:y('Invalid encoded resource path: "'+e+'"')}o=s+2}return new se(r)}var Se=function(){function e(e,t){if(this.seconds=e,this.nanoseconds=t,t<0)throw new S(_.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+t);if(t>=1e9)throw new S(_.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+t);if(e<-62135596800)throw new S(_.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e);if(e>=253402300800)throw new S(_.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e)}return e.now=function(){return e.fromMillis(Date.now())},e.fromDate=function(t){return e.fromMillis(t.getTime())},e.fromMillis=function(t){var n=Math.floor(t/1e3);return new e(n,1e6*(t-1e3*n))},e.prototype.toDate=function(){return new Date(this.toMillis())},e.prototype.toMillis=function(){return 1e3*this.seconds+this.nanoseconds/1e6},e.prototype._compareTo=function(e){return this.seconds===e.seconds?K(this.nanoseconds,e.nanoseconds):K(this.seconds,e.seconds)},e.prototype.isEqual=function(e){return e.seconds===this.seconds&&e.nanoseconds===this.nanoseconds},e.prototype.toString=function(){return"Timestamp(seconds="+this.seconds+", nanoseconds="+this.nanoseconds+")"},e}(),Ee=function(){function e(e){this.timestamp=e}return e.fromMicroseconds=function(t){var n=Math.floor(t/1e6);return new e(new Se(n,t%1e6*1e3))},e.fromTimestamp=function(t){return new e(t)},e.forDeletedDoc=function(){return e.MIN},e.prototype.compareTo=function(e){return this.timestamp._compareTo(e.timestamp)},e.prototype.isEqual=function(e){return this.timestamp.isEqual(e.timestamp)},e.prototype.toMicroseconds=function(){return 1e6*this.timestamp.seconds+this.timestamp.nanoseconds/1e3},e.prototype.toString=function(){return"SnapshotVersion("+this.timestamp.toString()+")"},e.prototype.toTimestamp=function(){return this.timestamp},e.MIN=new e(new Se(0,0)),e}(),Ce=function(){function e(e,t){this.comparator=e,this.root=t||Ie.EMPTY}return e.prototype.insert=function(t,n){return new e(this.comparator,this.root.insert(t,n,this.comparator).copy(null,null,Ie.BLACK,null,null))},e.prototype.remove=function(t){return new e(this.comparator,this.root.remove(t,this.comparator).copy(null,null,Ie.BLACK,null,null))},e.prototype.get=function(e){for(var t=this.root;!t.isEmpty();){var n=this.comparator(e,t.key);if(0===n)return t.value;n<0?t=t.left:n>0&&(t=t.right)}return null},e.prototype.indexOf=function(e){for(var t=0,n=this.root;!n.isEmpty();){var r=this.comparator(e,n.key);if(0===r)return t+n.left.size;r<0?n=n.left:(t+=n.left.size+1,n=n.right)}return-1},e.prototype.isEmpty=function(){return this.root.isEmpty()},Object.defineProperty(e.prototype,"size",{get:function(){return this.root.size},enumerable:!0,configurable:!0}),e.prototype.minKey=function(){return this.root.minKey()},e.prototype.maxKey=function(){return this.root.maxKey()},e.prototype.inorderTraversal=function(e){return this.root.inorderTraversal(e)},e.prototype.forEach=function(e){this.inorderTraversal(function(t,n){return e(t,n),!1})},e.prototype.toString=function(){var e=[];return this.inorderTraversal(function(t,n){return e.push(t+":"+n),!1}),"{"+e.join(", ")+"}"},e.prototype.reverseTraversal=function(e){return this.root.reverseTraversal(e)},e.prototype.getIterator=function(){return new Te(this.root,null,this.comparator,!1)},e.prototype.getIteratorFrom=function(e){return new Te(this.root,e,this.comparator,!1)},e.prototype.getReverseIterator=function(){return new Te(this.root,null,this.comparator,!0)}
1,e.prototype.getReverseIteratorFrom=function(e){return new Te(this.root,e,this.comparator,!0)},e}(),Te=function(){function e(e,t,n,r){this.isReverse=r,this.nodeStack=[];for(var i=1;!e.isEmpty();)if(i=t?n(e.key,t):1,r&&(i*=-1),i<0)e=this.isReverse?e.left:e.right;else{if(0===i){this.nodeStack.push(e);break}this.nodeStack.push(e),e=this.isReverse?e.right:e.left}}return e.prototype.getNext=function(){b(this.nodeStack.length>0,"getNext() called on iterator when hasNext() is false.");var e=this.nodeStack.pop(),t={key:e.key,value:e.value};if(this.isReverse)for(e=e.left;!e.isEmpty();)this.nodeStack.push(e),e=e.right;else for(e=e.right;!e.isEmpty();)this.nodeStack.push(e),e=e.left;return t},e.prototype.hasNext=function(){return this.nodeStack.length>0},e.prototype.peek=function(){if(0===this.nodeStack.length)return null;var e=this.nodeStack[this.nodeStack.length-1];return{key:e.key,value:e.value}},e}(),Ie=function(){function e(t,n,r,i,o){this.key=t,this.value=n,this.color=null!=r?r:e.RED,this.left=null!=i?i:e.EMPTY,this.right=null!=o?o:e.EMPTY,this.size=this.left.size+1+this.right.size}return e.prototype.copy=function(t,n,r,i,o){return new e(null!=t?t:this.key,null!=n?n:this.value,null!=r?r:this.color,null!=i?i:this.left,null!=o?o:this.right)},e.prototype.isEmpty=function(){return!1},e.prototype.inorderTraversal=function(e){return this.left.inorderTraversal(e)||e(this.key,this.value)||this.right.inorderTraversal(e)},e.prototype.reverseTraversal=function(e){return this.right.reverseTraversal(e)||e(this.key,this.value)||this.left.reverseTraversal(e)},e.prototype.min=function(){return this.left.isEmpty()?this:this.left.min()},e.prototype.minKey=function(){return this.min().key},e.prototype.maxKey=function(){return this.right.isEmpty()?this.key:this.right.maxKey()},e.prototype.insert=function(e,t,n){var r=this,i=n(e,r.key);return(r=i<0?r.copy(null,null,null,r.left.insert(e,t,n),null):0===i?r.copy(null,t,null,null,null):r.copy(null,null,null,null,r.right.insert(e,t,n))).fixUp()},e.prototype.removeMin=function(){if(this.left.isEmpty())return e.EMPTY;var t=this;return t.left.isRed()||t.left.left.isRed()||(t=t.moveRedLeft()),(t=t.copy(null,null,null,t.left.removeMin(),null)).fixUp()},e.prototype.remove=function(t,n){var r,i=this;if(n(t,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(t,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(t,i.key)){if(i.right.isEmpty())return e.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(t,n))}return i.fixUp()},e.prototype.isRed=function(){return this.color},e.prototype.fixUp=function(){var e=this;return e.right.isRed()&&!e.left.isRed()&&(e=e.rotateLeft()),e.left.isRed()&&e.left.left.isRed()&&(e=e.rotateRight()),e.left.isRed()&&e.right.isRed()&&(e=e.colorFlip()),e},e.prototype.moveRedLeft=function(){var e=this.colorFlip();return e.right.left.isRed()&&(e=(e=(e=e.copy(null,null,null,null,e.right.rotateRight())).rotateLeft()).colorFlip()),e},e.prototype.moveRedRight=function(){var e=this.colorFlip();return e.left.left.isRed()&&(e=(e=e.rotateRight()).colorFlip()),e},e.prototype.rotateLeft=function(){var t=this.copy(null,null,e.RED,null,this.right.left);return this.right.copy(null,null,this.color,t,null)},e.prototype.rotateRight=function(){var t=this.copy(null,null,e.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,t)},e.prototype.colorFlip=function(){var e=this.left.copy(null,null,!this.left.color,null,null),t=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,e,t)},e.prototype.checkMaxDepth=function(){var e=this.check();return Math.pow(2,e)<=this.size+1},e.prototype.check=function(){if(this.isRed()&&this.left.isRed())throw y("Red node has red child("+this.key+","+this.value+")");if(this.right.isRed())throw y("Right child of ("+this.key+","+this.value+") is red");var e=this.left.check();if(e!==this.right.check())throw y("Black depths differ");return e+(this.isRed()?0:1)},e.EMPTY=null,e.RED=!0,e.BLACK=!1,e}(),De=function(){function e(){this.size=0}return e.prototype.copy=function(e,t,n,r,i){return this},e.prototype.insert=function(e,t,n){return new Ie(e,t)},e.prototype.remove=function(e,t){return this},e.prototype.isEmpty=function(){return!0},e.prototype.inorderTraversal=function(e){return!1},e.prototype.reverseTraversal=function(e){return!1},e.prototype.minKey=function(){return null},e.prototype.maxKey=function(){return null},e.prototype.isRed=function(){return!1},e.prototype.checkMaxDepth=function(){return!0},e.prototype.check=function(){return 0},e}();
1Ie.EMPTY=new De;var xe=function(){function e(e){this.comparator=e,this.data=new Ce(this.comparator)}return e.fromMapKeys=function(t){var n=new e(t.comparator);return t.forEach(function(e){n=n.add(e)}),n},e.prototype.has=function(e){return null!==this.data.get(e)},e.prototype.first=function(){return this.data.minKey()},e.prototype.last=function(){return this.data.maxKey()},Object.defineProperty(e.prototype,"size",{get:function(){return this.data.size},enumerable:!0,configurable:!0}),e.prototype.indexOf=function(e){return this.data.indexOf(e)},e.prototype.forEach=function(e){this.data.inorderTraversal(function(t,n){return e(t),!1})},e.prototype.forEachInRange=function(e,t){for(var n=this.data.getIteratorFrom(e[0]);n.hasNext();){var r=n.getNext();if(this.comparator(r.key,e[1])>=0)return;t(r.key)}},e.prototype.forEachWhile=function(e,t){var n;for(n=void 0!==t?this.data.getIteratorFrom(t):this.data.getIterator();n.hasNext();)if(!e(n.getNext().key))return},e.prototype.firstAfterOrEqual=function(e){var t=this.data.getIteratorFrom(e);return t.hasNext()?t.getNext().key:null},e.prototype.getIterator=function(){return new ke(this.data.getIterator())},e.prototype.getIteratorFrom=function(e){return new ke(this.data.getIteratorFrom(e))},e.prototype.add=function(e){return this.copy(this.data.remove(e).insert(e,!0))},e.prototype.delete=function(e){return this.has(e)?this.copy(this.data.remove(e)):this},e.prototype.isEmpty=function(){return this.data.isEmpty()},e.prototype.unionWith=function(e){var t=this;return e.forEach(function(e){t=t.add(e)}),t},e.prototype.isEqual=function(t){if(!(t instanceof e))return!1;if(this.size!==t.size)return!1;for(var n=this.data.getIterator(),r=t.data.getIterator();n.hasNext();){var i=n.getNext().key,o=r.getNext().key;if(0!==this.comparator(i,o))return!1}return!0},e.prototype.toArray=function(){var e=[];return this.forEach(function(t){e.push(t)}),e},e.prototype.toString=function(){var e=[];return this.forEach(function(t){return e.push(t)}),"SortedSet("+e.toString()+")"},e.prototype.copy=function(t){var n=new e(this.comparator);return n.data=t,n},e}(),ke=function(){function e(e){this.iter=e}return e.prototype.getNext=function(){return this.iter.getNext().key},e.prototype.hasNext=function(){return this.iter.hasNext()},e}(),Ae=new Ce(le.comparator);function Oe(){return Ae}function Ne(){return Oe()}var Re=new Ce(le.comparator);function Me(){return Re}var Pe=new Ce(le.comparator);function Le(){return Pe}var Fe=new xe(le.comparator);function je(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=Fe,r=0,i=e;r<i.length;r++)n=n.add(i[r]);return n}var Ve=new xe(K);function Ue(){return Ve}var qe=function(){function e(e,t,n,r){this.batchId=e,this.localWriteTime=t,this.baseMutations=n,this.mutations=r,b(r.length>0,"Cannot create an empty mutation batch")}return e.prototype.applyToRemoteDocument=function(e,t,n){t&&b(t.key.isEqual(e),"applyToRemoteDocument: key "+e+" should match maybeDoc key\n        "+t.key);var r=n.mutationResults;b(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(e)&&(t=o.applyToRemoteDocument(t,r[i]))}return t},e.prototype.applyToLocalView=function(e,t){t&&b(t.key.isEqual(e),"applyToLocalDocument: key "+e+" should match maybeDoc key\n        "+t.key);for(var n=0,r=this.baseMutations;n<r.length;n++)(a=r[n]).key.isEqual(e)&&(t=a.applyToLocalView(t,t,this.localWriteTime));for(var i=t,o=0,s=this.mutations;o<s.length;o++){var a;(a=s[o]).key.isEqual(e)&&(t=a.applyToLocalView(t,i,this.localWriteTime))}return t},e.prototype.applyToLocalDocumentSet=function(e){var t=this,n=e;return this.mutations.forEach(function(r){var i=t.applyToLocalView(r.key,e.get(r.key));i&&(n=n.insert(r.key,i))}),n},e.prototype.keys=function(){return this.mutations.reduce(function(e,t){return e.add(t.key)},je())},e.prototype.isEqual=function(e){return this.batchId===e.batchId&&$(this.mutations,e.mutations)&&$(this.baseMutations,e.baseMutations)},e}(),Be=function(){function e(e,t,n,r,i){this.batch=e,this.commitVersion=t,this.mutationResults=n,this.streamToken=r,this.docVersions=i}return e.from=function(t,n,r,i){b(t.mutations.length===r.length,"Mutations sent "+t.mutations.length+" must equal results received "+r.length);for(var o=Le(),s=t.mutations,a=0;a<s.length;a++)o=o.insert(s[a].key,r[a].version);return new e(t,n,r,i,o)},e}(),He=function(){function e(e){var t=this;this.nextCallback=null,this.catchCallback=null,this.result=void 0,this.error=void 0,this.isDone=!1,this.callbackAttached=!1,e(function(e){t.isDone=!0,t.result=e,t.nextCallback&&t.nextCallback(e)},function(e){t.isDone=!0,t.error=e,t.catchCallback&&t.catchCallback(e)})}return e.prototype.catch=function(e){return this.next(void 0,e)},e.prototype.next=function(t,n){var r=this;return this.callbackAttached&&y("Called next() or catch() twice for PersistencePromise"),this.callbackAttached=!0,this.isDone?this.error?this.wrapFailure(n,this.error):this.wrapSuccess(t,this.result):new e(function(e,i){r.nextCallback=function(n){r.wrapSuccess(t,n).next(e,i)},r.catchCallback=function(t){r.wrapFailure(n,t).next(e,i)}})},e.prototype.toPromise=function(){var e=this;return new Promise(function(t,n){e.next(t,n)})},e.prototype.wrapUserFunction=function(t){try{var n=t();return n instanceof e?n:e.resolve(n)}catch(r){return e.reject(r)}},e.prototype.wrapSuccess=function(t,n){return t?this.wrapUserFunction(function(){return t(n)}):e.resolve(n)},e.prototype.wrapFailure=function(t,n){return t?this.wrapUserFunction(function(){return t(n)}):e.reject(n)},e.resolve=function(t){return new e(function(e,n){e(t)})}
1,e.reject=function(t){return new e(function(e,n){n(t)})},e.waitFor=function(t){return new e(function(e,n){var r=0,i=0,o=!1;t.forEach(function(t){++r,t.next(function(){++i,o&&i===r&&e()},function(e){return n(e)})}),o=!0,i===r&&e()})},e.or=function(t){for(var n=e.resolve(!1),r=function(t){n=n.next(function(n){return n?e.resolve(n):t()})},i=0,o=t;i<o.length;i++)r(o[i]);return n},e.forEach=function(e,t){var n=this,r=[];return e.forEach(function(e,i){r.push(t.call(n,e,i))}),this.waitFor(r)},e}(),ze=function(){function e(e,t,n,r){this.userId=e,this.serializer=t,this.indexManager=n,this.referenceDelegate=r,this.documentKeysByBatchId={}}return e.forUser=function(t,n,r,i){return b(""!==t.uid,"UserID must not be an empty string."),new e(t.isAuthenticated()?t.uid:"",n,r,i)},e.prototype.checkEmpty=function(e){var t=!0,n=IDBKeyRange.bound([this.userId,Number.NEGATIVE_INFINITY],[this.userId,Number.POSITIVE_INFINITY]);return Ke(e).iterate({index:Mt.userMutationsIndex,range:n},function(e,n,r){t=!1,r.done()}).next(function(){return t})},e.prototype.acknowledgeBatch=function(e,t,n){return this.getMutationQueueMetadata(e).next(function(t){return t.lastStreamToken=Ge(n),Ye(e).put(t)})},e.prototype.getLastStreamToken=function(e){return this.getMutationQueueMetadata(e).next(function(e){return e.lastStreamToken})},e.prototype.setLastStreamToken=function(e,t){return this.getMutationQueueMetadata(e).next(function(n){return n.lastStreamToken=Ge(t),Ye(e).put(n)})},e.prototype.addMutationBatch=function(e,t,n,r){var i=this,o=$e(e),s=Ke(e);return s.add({}).next(function(a){b("number"==typeof a,"Auto-generated key is not a number");var u=new qe(a,t,n,r),l=i.serializer.toDbMutationBatch(i.userId,u);i.documentKeysByBatchId[a]=u.keys();for(var c=[],h=0,d=r;h<d.length;h++){var f=d[h],p=Pt.key(i.userId,f.key.path,a);c.push(s.put(l)),c.push(o.put(p,Pt.PLACEHOLDER)),c.push(i.indexManager.addToCollectionParentIndex(e,f.key.path.popLast()))}return He.waitFor(c).next(function(){return u})})},e.prototype.lookupMutationBatch=function(e,t){var n=this;return Ke(e).get(t).next(function(e){return e?(b(e.userId===n.userId,"Unexpected user '"+e.userId+"' for mutation batch "+t),n.serializer.fromDbMutationBatch(e)):null})},e.prototype.lookupMutationKeys=function(e,t){var n=this;return this.documentKeysByBatchId[t]?He.resolve(this.documentKeysByBatchId[t]):this.lookupMutationBatch(e,t).next(function(e){if(e){var r=e.keys();return n.documentKeysByBatchId[t]=r,r}return null})},e.prototype.getNextMutationBatchAfterBatchId=function(e,t){var n=this,r=t+1,i=IDBKeyRange.lowerBound([this.userId,r]),o=null;return Ke(e).iterate({index:Mt.userMutationsIndex,range:i},function(e,t,i){t.userId===n.userId&&(b(t.batchId>=r,"Should have found mutation after "+r),o=n.serializer.fromDbMutationBatch(t)),i.done()}).next(function(){return o})},e.prototype.getAllMutationBatches=function(e){var t=this,n=IDBKeyRange.bound([this.userId,-1],[this.userId,Number.POSITIVE_INFINITY]);return Ke(e).loadAll(Mt.userMutationsIndex,n).next(function(e){return e.map(function(e){return t.serializer.fromDbMutationBatch(e)})})},e.prototype.getAllMutationBatchesAffectingDocumentKey=function(e,t){var n=this,r=Pt.prefixForPath(this.userId,t.path),i=IDBKeyRange.lowerBound(r),o=[];return $e(e).iterate({range:i},function(r,i,s){var a=r[0],u=r[2],l=_e(r[1]);if(a===n.userId&&t.path.isEqual(l))return Ke(e).get(u).next(function(e){if(!e)throw y("Dangling document-mutation reference found: "+r+" which points to "+u);b(e.userId===n.userId,"Unexpected user '"+e.userId+"' for mutation batch "+u),o.push(n.serializer.fromDbMutationBatch(e))});s.done()}).next(function(){return o})},e.prototype.getAllMutationBatchesAffectingDocumentKeys=function(e,t){var n=this,r=new xe(K),i=[];return t.forEach(function(t){var o=Pt.prefixForPath(n.userId,t.path),s=IDBKeyRange.lowerBound(o),a=$e(e).iterate({range:s},function(e,i,o){var s=e[0],a=e[2],u=_e(e[1]);s===n.userId&&t.path.isEqual(u)?r=r.add(a):o.done()});i.push(a)}),He.waitFor(i).next(function(){return n.lookupMutationBatches(e,r)})},e.prototype.getAllMutationBatchesAffectingQuery=function(e,t){var n=this;b(!t.isDocumentQuery(),"Document queries shouldn't go down this path"),b(!t.isCollectionGroupQuery(),"CollectionGroup queries should be handled in LocalDocumentsView");var r=t.path,i=r.length+1,o=Pt.prefixForPath(this.userId,r),s=IDBKeyRange.lowerBound(o),a=new xe(K);return $e(e).iterate({range:s},function(e,t,o){var s=e[0],u=e[2],l=_e(e[1]);s===n.userId&&r.isPrefixOf(l)?l.length===i&&(a=a.add(u)):o.done()}).next(function(){return n.lookupMutationBatches(e,a)})},e.prototype.lookupMutationBatches=function(e,t){var n=this,r=[],i=[];return t.forEach(function(t){i.push(Ke(e).get(t).next(function(e){if(null===e)throw y("Dangling document-mutation reference found, which points to "+t);b(e.userId===n.userId,"Unexpected user '"+e.userId+"' for mutation batch "+t),r.push(n.serializer.fromDbMutationBatch(e))}))}),He.waitFor(i).next(function(){return r})},e.prototype.removeMutationBatch=function(e,t){var n=this;return Qe(e.simpleDbTransaction,this.userId,t).next(function(r){return n.removeCachedMutationKeys(t.batchId),He.forEach(r,function(t){return n.referenceDelegate.removeMutationReference(e,t)})})},e.prototype.removeCachedMutationKeys=function(e){delete this.documentKeysByBatchId[e]},e.prototype.performConsistencyCheck=function(e){var t=this;return this.checkEmpty(e).next(function(n){if(!n)return He.resolve();
1var r=IDBKeyRange.lowerBound(Pt.prefixForUser(t.userId)),i=[];return $e(e).iterate({range:r},function(e,n,r){if(e[0]===t.userId){var o=_e(e[1]);i.push(o)}else r.done()}).next(function(){b(0===i.length,"Document leak -- detected dangling mutation references when queue is empty. Dangling keys: "+i.map(function(e){return e.canonicalString()}))})})},e.prototype.containsKey=function(e,t){return We(e,this.userId,t)},e.prototype.getMutationQueueMetadata=function(e){var t=this;return Ye(e).get(this.userId).next(function(e){return e||new Rt(t.userId,-1,"")})},e}();function We(e,t,n){var r=Pt.prefixForPath(t,n.path),i=r[1],o=IDBKeyRange.lowerBound(r),s=!1;return $e(e).iterate({range:o,keysOnly:!0},function(e,n,r){e[0]===t&&e[1]===i&&(s=!0),r.done()}).next(function(){return s})}function Qe(e,t,n){var r=e.store(Mt.store),i=e.store(Pt.store),o=[],s=IDBKeyRange.only(n.batchId),a=0,u=r.iterate({range:s},function(e,t,n){return a++,n.delete()});o.push(u.next(function(){b(1===a,"Dangling document-mutation reference found: Missing batch "+n.batchId)}));for(var l=[],c=0,h=n.mutations;c<h.length;c++){var d=h[c],f=Pt.key(t,d.key.path,n.batchId);o.push(i.delete(f)),l.push(d.key)}return He.waitFor(o).next(function(){return l})}function Ge(e){return e instanceof Uint8Array?(b("YES"===process.env.USE_MOCK_PERSISTENCE,"Persisting non-string stream tokens is only supported with mock persistence."),e.toString()):e}function Ke(e){return hn.getStore(e,Mt.store)}function $e(e){return hn.getStore(e,Pt.store)}function Ye(e){return hn.getStore(e,Rt.store)}var Ze=1,Je=function(e){return e[e.QueryCache=0]="QueryCache",e[e.SyncEngine=1]="SyncEngine",e}({}),Xe=function(){function e(e,t){this.generatorId=e,b((e&Ze)===e,"Generator ID "+e+" contains more than "+Ze+" reserved bits"),this.seek(void 0!==t?t:this.generatorId)}return e.prototype.next=function(){var e=this.nextId;return this.nextId+=1<<Ze,e},e.prototype.after=function(e){return this.seek(e+(1<<Ze)),this.next()},e.prototype.seek=function(e){b((e&Ze)===this.generatorId,"Cannot supply target ID from different generator ID"),this.nextId=e},e.forQueryCache=function(){return new e(Je.QueryCache,2)},e.forSyncEngine=function(){return new e(Je.SyncEngine)},e}(),et="SimpleDb",tt=function(){function e(t){this.db=t,12.2===e.getIOSVersion(a.getUA())&&m("Firestore persistence suffers from a bug in iOS 12.2 Safari that may cause your app to stop working. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.")}return e.openOrCreate=function(t,n,r){return b(e.isAvailable(),"IndexedDB not supported in current environment."),p(et,"Opening database:",t),new He(function(i,o){var s=window.indexedDB.open(t,n);s.onsuccess=function(t){i(new e(t.target.result))},s.onblocked=function(){o(new S(_.FAILED_PRECONDITION,"Cannot upgrade IndexedDB schema while another tab is open. Close all tabs that access Firestore and reload this page to proceed."))},s.onerror=function(e){var t=e.target.error;o("VersionError"===t.name?new S(_.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."):t)},s.onupgradeneeded=function(e){p(et,'Database "'+t+'" requires upgrade from version:',e.oldVersion);var n=e.target.result,i=new rt(s.transaction);r.createOrUpgrade(n,i,e.oldVersion,kt).next(function(){p(et,"Database upgrade to version "+kt+" complete")})}}).toPromise()},e.delete=function(e){return p(et,"Removing database:",e),ot(window.indexedDB.deleteDatabase(e)).toPromise()},e.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=a.getUA(),n=e.getIOSVersion(t),r=0<n&&n<10,i=e.getAndroidVersion(t),o=0<i&&i<4.5;return!(t.indexOf("MSIE ")>0||t.indexOf("Trident/")>0||t.indexOf("Edge/")>0||r||o)},e.getStore=function(e,t){return e.store(t)},e.getIOSVersion=function(e){var t=e.match(/i(?:phone|pad|pod) os ([\d_]+)/i),n=t?t[1].split("_").slice(0,2).join("."):"-1";return Number(n)},e.getAndroidVersion=function(e){var t=e.match(/Android ([\d.]+)/i),n=t?t[1].split(".").slice(0,2).join("."):"-1";return Number(n)},e.prototype.setVersionChangeListener=function(e){this.db.onversionchange=function(t){return e(t)}},e.prototype.runTransaction=function(e,t,n){var r=rt.open(this.db,e,t),i=n(r).catch(function(e){return r.abort(e),He.reject(e)}).toPromise();return i.catch(function(){}),r.completionPromise.then(function(){return i})},e.prototype.close=function(){this.db.close()},e}(),nt=function(){function e(e){this.dbCursor=e,this.shouldStop=!1,this.nextKey=null}return Object.defineProperty(e.prototype,"isDone",{get:function(){return this.shouldStop},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"skipToKey",{get:function(){return this.nextKey},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"cursor",{set:function(e){this.dbCursor=e},enumerable:!0,configurable:!0}),e.prototype.done=function(){this.shouldStop=!0},e.prototype.skip=function(e){this.nextKey=e},e.prototype.delete=function(){return ot(this.dbCursor.delete())},e}(),rt=function(){function e(e){var t=this;this.transaction=e,this.aborted=!1,this.completionDeferred=new ce,this.transaction.oncomplete=function(){t.completionDeferred.resolve()},this.transaction.onabort=function(){e.error?t.completionDeferred.reject(e.error):t.completionDeferred.resolve()},this.transaction.onerror=function(e){var n=at(e.target.error);t.completionDeferred.reject(n)}}return e.open=function(t,n,r){return new e(t.transaction(r,n))},Object.defineProperty(e.prototype,"completionPromise",{get:function(){return this.completionDeferred.promise},enumerable:!0,configurable:!0}),e.prototype.abort=function(e){e&&this.completionDeferred.reject(e),this.aborted||(p(et,"Aborting transaction:",e?e.message:"Client-initiated abort"),this.aborted=!0,this.transaction.abort())},e.prototype.store=function(e){var t=this.transaction.objectStore(e);return b(!!t,"Object store not part of transaction: "+e),new it(t)},e}(),it=function(){function e(e){this.store=e}return e.prototype.put=function(e,t){var n;return void 0!==t?(p(et,"PUT",this.store.name,e,t),n=this.store.put(t,e)):(p(et,"PUT",this.store.name,"<auto-key>",e),n=this.store.put(e)),ot(n)},e.prototype.add=function(e){return p(et,"ADD",this.store.name,e,e),ot(this.store.add(e))},e.prototype.get=function(e){var t=this;return ot(this.store.get(e)).next(function(n){return void 0===n&&(n=null),p(et,"GET",t.store.name,e,n),n})},e.prototype.delete=function(e){return p(et,"DELETE",this.store.name,e),ot(this.store.delete(e))},e.prototype.count=function(){return p(et,"COUNT",this.store.name),ot(this.store.count())},e.prototype.loadAll=function(e,t){var n=this.cursor(this.options(e,t)),r=[];return this.iterateCursor(n,function(e,t){r.push(t)}).next(function(){return r})},e.prototype.deleteAll=function(e,t){p(et,"DELETE ALL",this.store.name);var n=this.options(e,t);n.keysOnly=!1;var r=this.cursor(n);return this.iterateCursor(r,function(e,t,n){return n.delete()})},e.prototype.iterate=function(e,t){var n;t?n=e:(n={},t=e);var r=this.cursor(n);return this.iterateCursor(r,t)},e.prototype.iterateSerial=function(e){var t=this.cursor({});return new He(function(n,r){t.onerror=function(e){var t=at(e.target.error);r(t)},t.onsuccess=function(t){var r=t.target.result;r?e(r.primaryKey,r.value).next(function(e){e?r.continue():n()}):n()}})},e.prototype.iterateCursor=function(e,t){var n=[];return new He(function(r,i){e.onerror=function(e){i(e.target.error)},e.onsuccess=function(e){var i=e.target.result;if(i){var o=new nt(i),s=t(i.primaryKey,i.value,o);if(s instanceof He){var a=s.catch(function(e){return o.done(),He.reject(e)});n.push(a)}o.isDone?r():null===o.skipToKey?i.continue():i.continue(o.skipToKey)}else r()}}).next(function(){return He.waitFor(n)})},e.prototype.options=function(e,t){var n=void 0;return void 0!==e&&("string"==typeof e?n=e:(b(void 0===t,"3rd argument must not be defined if 2nd is a range."),t=e)),{index:n,range:t}},e.prototype.cursor=function(e){var t="next";if(e.reverse&&(t="prev"),e.index){var n=this.store.index(e.index);return e.keysOnly?n.openKeyCursor(e.range,t):n.openCursor(e.range,t)}return this.store.openCursor(e.range,t)},e}();function ot(e){return new He(function(t,n){e.onsuccess=function(e){t(e.target.result)},e.onerror=function(e){var t=at(e.target.error);n(t)}})}var st=!1;function at(e){var t=tt.getIOSVersion(a.getUA());if(t>=12.2&&t<13){var n="An internal error was encountered in the Indexed Database server";if(e.message.indexOf(n)>=0){var r=new S("internal","IOS_INDEXEDDB_BUG1: IndexedDb has thrown '"+n+"'. This is likely due to an unavoidable bug in iOS. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.");return st||(st=!0,setTimeout(function(){throw r},0)),r}}return e}var ut=function(){function e(e,t){this.referenceDelegate=e,this.serializer
1=t,this.targetIdGenerator=Xe.forQueryCache()}return e.prototype.allocateTargetId=function(e){var t=this;return this.retrieveMetadata(e).next(function(n){return n.highestTargetId=t.targetIdGenerator.after(n.highestTargetId),t.saveMetadata(e,n).next(function(){return n.highestTargetId})})},e.prototype.getLastRemoteSnapshotVersion=function(e){return this.retrieveMetadata(e).next(function(e){return Ee.fromTimestamp(new Se(e.lastRemoteSnapshotVersion.seconds,e.lastRemoteSnapshotVersion.nanoseconds))})},e.prototype.getHighestSequenceNumber=function(e){return ht(e.simpleDbTransaction)},e.prototype.setTargetsMetadata=function(e,t,n){var r=this;return this.retrieveMetadata(e).next(function(i){return i.highestListenSequenceNumber=t,n&&(i.lastRemoteSnapshotVersion=n.toTimestamp()),t>i.highestListenSequenceNumber&&(i.highestListenSequenceNumber=t),r.saveMetadata(e,i)})},e.prototype.addQueryData=function(e,t){var n=this;return this.saveQueryData(e,t).next(function(){return n.retrieveMetadata(e).next(function(r){return r.targetCount+=1,n.updateMetadataFromQueryData(t,r),n.saveMetadata(e,r)})})},e.prototype.updateQueryData=function(e,t){return this.saveQueryData(e,t)},e.prototype.removeQueryData=function(e,t){var n=this;return this.removeMatchingKeysForTargetId(e,t.targetId).next(function(){return lt(e).delete(t.targetId)}).next(function(){return n.retrieveMetadata(e)}).next(function(t){return b(t.targetCount>0,"Removing from an empty query cache"),t.targetCount-=1,n.saveMetadata(e,t)})},e.prototype.removeTargets=function(e,t,n){var r=this,i=0,o=[];return lt(e).iterate(function(s,a){var u=r.serializer.fromDbTarget(a);u.sequenceNumber<=t&&void 0===n[u.targetId]&&(i++,o.push(r.removeQueryData(e,u)))}).next(function(){return He.waitFor(o)}).next(function(){return i})},e.prototype.forEachTarget=function(e,t){var n=this;return lt(e).iterate(function(e,r){var i=n.serializer.fromDbTarget(r);t(i)})},e.prototype.retrieveMetadata=function(e){return ct(e.simpleDbTransaction)},e.prototype.saveMetadata=function(e,t){return(n=e,hn.getStore(n,Bt.store)).put(Bt.key,t);var n},e.prototype.saveQueryData=function(e,t){return lt(e).put(this.serializer.toDbTarget(t))},e.prototype.updateMetadataFromQueryData=function(e,t){var n=!1;return e.targetId>t.highestTargetId&&(t.highestTargetId=e.targetId,n=!0),e.sequenceNumber>t.highestListenSequenceNumber&&(t.highestListenSequenceNumber=e.sequenceNumber,n=!0),n},e.prototype.getQueryCount=function(e){return this.retrieveMetadata(e).next(function(e){return e.targetCount})},e.prototype.getQueryData=function(e,t){var n=this,r=t.canonicalId(),i=IDBKeyRange.bound([r,Number.NEGATIVE_INFINITY],[r,Number.POSITIVE_INFINITY]),o=null;return lt(e).iterate({range:i,index:Ut.queryTargetsIndexName},function(e,r,i){var s=n.serializer.fromDbTarget(r);t.isEqual(s.query)&&(o=s,i.done())}).next(function(){return o})},e.prototype.addMatchingKeys=function(e,t,n){var r=this,i=[],o=dt(e);return t.forEach(function(t){var s=be(t.path);i.push(o.put(new qt(n,s))),i.push(r.referenceDelegate.addReference(e,t))}),He.waitFor(i)},e.prototype.removeMatchingKeys=function(e,t,n){var r=this,i=dt(e);return He.forEach(t,function(t){var o=be(t.path);return He.waitFor([i.delete([n,o]),r.referenceDelegate.removeReference(e,t)])})},e.prototype.removeMatchingKeysForTargetId=function(e,t){var n=dt(e),r=IDBKeyRange.bound([t],[t+1],!1,!0);return n.delete(r)},e.prototype.getMatchingKeysForTargetId=function(e,t){var n=IDBKeyRange.bound([t],[t+1],!1,!0),r=dt(e),i=je();return r.iterate({range:n,keysOnly:!0},function(e,t,n){var r=_e(e[1]),o=new le(r);i=i.add(o)}).next(function(){return i})},e.prototype.containsKey=function(e,t){var n=be(t.path),r=IDBKeyRange.bound([n],[Y(n)],!1,!0),i=0;return dt(e).iterate({index:qt.documentTargetsIndex,keysOnly:!0,range:r},function(e,t,n){0!==e[0]&&(i++,n.done())}).next(function(){return i>0})},e.prototype.getQueryDataForTarget=function(e,t){var n=this;return lt(e).get(t).next(function(e){return e?n.serializer.fromDbTarget(e):null})},e}();function lt(e){return hn.getStore(e,Ut.store)}function ct(e){return tt.getStore(e,Bt.store).get(Bt.key).next(function(e){return b(null!==e,"Missing metadata row."),e})}function ht(e){return ct(e).next(function(e){return e.highestListenSequenceNumber})}function dt(e){return hn.getStore(e,qt.store)}var ft=function(){function e(e,t){this.key=e,this.version=t}return e.compareByKey=function(e,t){return le.comparator(e.key,t.key)},e}(),pt=function(e){function t(t,n,r,i,o){var s=e.call(this,t,n)||this;return s.data=r,s.proto=o,s.hasLocalMutations=!!i.hasLocalMutations,s.hasCommittedMutations=!!i.hasCommittedMutations,s}return s.__extends(t,e),t.prototype.field=function(e){return this.data.field(e)},t.prototype.fieldValue=function(e){var t=this.field(e);return t?t.value():void 0},t.prototype.value=function(){return this.data.value()},t.prototype.isEqual=function(e){return e instanceof t&&this.key.isEqual(e.key)&&this.version.isEqual(e.version)&&this.data.isEqual(e.data)&&this.hasLocalMutations===e.hasLocalMutations&&this.hasCommittedMutations===e.hasCommittedMutations},t.prototype.toString=function(){return"Document("+this.key+", "+this.version+", "+this.data.toString()+", {hasLocalMutations: "+this.hasLocalMutations+"}), {hasCommittedMutations: "+this.hasCommittedMutations+"})"},Object.defineProperty(t.prototype,"hasPendingWrites",{get:function(){return this.hasLocalMutations||this.hasCommittedMutations},enumerable:!0,configurable:!0}),t.compareByField=function(e,t,n){var r=t.field(e),i=n.field(e);return null!==r&&null!==i?r.compareTo(i):y("Trying to compare documents on fields that don't exist")},t}(ft),mt=function(e){function t(t,n,r){var i=e.call(this,t,n)||this;return i.hasCommittedMutations=!(!r||!r.hasCommittedMutations),i}return s.__extends(t,e),t.prototype.toString=function(){return"NoDocument("+this.key+", "+this.version+")"},Object.defineProperty(t.prototype,"hasPendingWrites",{get:function(){return this.hasCommittedMutations},enumerable:!0,configurable:!0}),t.prototype.isEqual=function(e){return e instanceof t&&e.hasCommittedMutations===this.hasCommittedMutations&&e.version.isEqual(this.version)&&e.key.isEqual(this.key)},t}(ft),gt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return s.__extends(t,e),t.prototype.toString=function(){return"UnknownDocument("+this.key+", "+this.version+")"},Object.defineProperty(t.prototype,"hasPendingWrites",{get:function(){return!0},enumerable:!0,configurable:!0}
1),t.prototype.isEqual=function(e){return e instanceof t&&e.version.isEqual(this.version)&&e.key.isEqual(this.key)},t}(ft),yt=function(){function e(e){this.mapKeyFn=e,this.inner={}}return e.prototype.get=function(e){var t=this.mapKeyFn(e),n=this.inner[t];if(void 0!==n)for(var r=0,i=n;r<i.length;r++){var o=i[r],s=o[1];if(o[0].isEqual(e))return s}},e.prototype.has=function(e){return void 0!==this.get(e)},e.prototype.set=function(e,t){var n=this.mapKeyFn(e),r=this.inner[n];if(void 0!==r){for(var i=0;i<r.length;i++)if(r[i][0].isEqual(e))return void(r[i]=[e,t]);r.push([e,t])}else this.inner[n]=[[e,t]]},e.prototype.delete=function(e){var t=this.mapKeyFn(e),n=this.inner[t];if(void 0===n)return!1;for(var r=0;r<n.length;r++)if(n[r][0].isEqual(e))return 1===n.length?delete this.inner[t]:n.splice(r,1),!0;return!1},e.prototype.forEach=function(e){D(this.inner,function(t,n){for(var r=0,i=n;r<i.length;r++){var o=i[r];e(o[0],o[1])}})},e.prototype.isEmpty=function(){return x(this.inner)},e}(),bt=function(){function e(){this.changes=Oe(),this.documentSizes=new yt(function(e){return e.toString()})}return e.prototype.addEntry=function(e){var t=this.assertChanges();this.changes=t.insert(e.key,e)},e.prototype.getEntry=function(e,t){var n=this,r=this.assertChanges().get(t);return r?He.resolve(r):this.getFromCache(e,t).next(function(e){return null===e?(n.documentSizes.set(t,0),null):(n.documentSizes.set(t,e.size),e.maybeDocument)})},e.prototype.getEntries=function(e,t){var n=this;return this.getAllFromCache(e,t).next(function(e){var t=e.maybeDocuments;return e.sizeMap.forEach(function(e,t){n.documentSizes.set(e,t)}),t})},e.prototype.apply=function(e){var t=this.applyChanges(e);return this.changes=null,t},e.prototype.assertChanges=function(){return b(null!==this.changes,"Changes have already been applied."),this.changes},e}(),vt="The remote document changelog no longer contains all changes for all local query views. It may be necessary to rebuild these views.",wt=function(){function e(e,t,n){this.serializer=e,this.indexManager=t,this.keepDocumentChangeLog=n,this._lastProcessedDocumentChangeId=0}return Object.defineProperty(e.prototype,"lastProcessedDocumentChangeId",{get:function(){return this._lastProcessedDocumentChangeId},enumerable:!0,configurable:!0}),e.prototype.start=function(e){var t=tt.getStore(e,Wt.store);return this.synchronizeLastDocumentChangeId(t)},e.prototype.addEntries=function(e,t,n){var r=[];if(t.length>0){for(var i=Et(e),o=je(),s=0,a=t;s<a.length;s++){var u=a[s],l=u.key,c=u.doc;r.push(i.put(Tt(l),c)),o=o.add(l),r.push(this.indexManager.addToCollectionParentIndex(e,l.path.popLast()))}this.keepDocumentChangeLog&&r.push(Ct(e).put({changes:this.serializer.toDbResourcePaths(o)})),r.push(this.updateSize(e,n))}return He.waitFor(r)},e.prototype.removeEntry=function(e,t){var n=Et(e),r=Tt(t);return n.get(r).next(function(e){return e?n.delete(r).next(function(){return It(e)}):He.resolve(0)})},e.prototype.getEntry=function(e,t){var n=this;return Et(e).get(Tt(t)).next(function(e){return e?n.serializer.fromDbRemoteDocument(e):null})},e.prototype.getSizedEntry=function(e,t){var n=this;return Et(e).get(Tt(t)).next(function(e){return e?{maybeDocument:n.serializer.fromDbRemoteDocument(e),size:It(e)}:null})},e.prototype.getEntries=function(e,t){var n=this,r=Ne();return this.forEachDbEntry(e,t,function(e,t){r=r.insert(e,t?n.serializer.fromDbRemoteDocument(t):null)}).next(function(){return r})},e.prototype.getSizedEntries=function(e,t){var n=this,r=Ne(),i=new Ce(le.comparator);return this.forEachDbEntry(e,t,function(e,t){t?(r=r.insert(e,n.serializer.fromDbRemoteDocument(t)),i=i.insert(e,It(t))):(r=r.insert(e,null),i=i.insert(e,0))}).next(function(){return{maybeDocuments:r,sizeMap:i}})},e.prototype.forEachDbEntry=function(e,t,n){if(t.isEmpty())return He.resolve();var r=IDBKeyRange.bound(t.first().path.toArray(),t.last().path.toArray()),i=t.getIterator(),o=i.getNext();return Et(e).iterate({range:r},function(e,t,r){for(var s=le.fromSegments(e);o&&le.comparator(o,s)<0;)n(o,null),o=i.getNext();o&&o.isEqual(s)&&(n(o,t),o=i.hasNext()?i.getNext():null),o?r.skip(o.path.toArray()):r.done()}).next(function(){for(;o;)n(o,null),o=i.hasNext()?i.getNext():null})},e.prototype.getDocumentsMatchingQuery=function(e,t){var n=this;b(!t.isCollectionGroupQuery(),"CollectionGroup queries should be handled in LocalDocumentsView");var r=Me(),i=t.path.length+1,o=t.path.toArray(),s=IDBKeyRange.lowerBound(o);return Et(e).iterate({range:s},function(e,o,s){if(e.length===i){var a=n.serializer.fromDbRemoteDocument(o);t.path.isPrefixOf(a.key.path)?a instanceof pt&&t.matches(a)&&(r=r.
1insert(a.key,a)):s.done()}}).next(function(){return r})},e.prototype.getNewDocumentChanges=function(e){var t=this;b(this.keepDocumentChangeLog,"Can only call getNewDocumentChanges() when document change log is enabled");var n=je(),r=Oe(),i=IDBKeyRange.lowerBound(this._lastProcessedDocumentChangeId+1),o=!0,s=Ct(e);return s.iterate({range:i},function(e,r){if(o&&(o=!1,t._lastProcessedDocumentChangeId+1!==r.id))return t.synchronizeLastDocumentChangeId(s).next(function(){return He.reject(new S(_.DATA_LOSS,vt))});n=n.unionWith(t.serializer.fromDbResourcePaths(r.changes)),t._lastProcessedDocumentChangeId=r.id}).next(function(){var i=[];return n.forEach(function(n){i.push(t.getEntry(e,n).next(function(e){var t=e||new mt(n,Ee.forDeletedDoc());r=r.insert(n,t)}))}),He.waitFor(i)}).next(function(){return r})},e.prototype.removeDocumentChangesThroughChangeId=function(e,t){var n=IDBKeyRange.upperBound(t);return Ct(e).delete(n)},e.prototype.synchronizeLastDocumentChangeId=function(e){var t=this;return this._lastProcessedDocumentChangeId=0,e.iterate({keysOnly:!0,reverse:!0},function(e,n,r){t._lastProcessedDocumentChangeId=e,r.done()})},e.prototype.newChangeBuffer=function(){return new St(this)},e.prototype.getSize=function(e){return this.getMetadata(e).next(function(e){return e.byteSize})},e.prototype.getMetadata=function(e){return _t(e).get(Vt.key).next(function(e){return b(!!e,"Missing document cache metadata"),e})},e.prototype.setMetadata=function(e,t){return _t(e).put(Vt.key,t)},e.prototype.updateSize=function(e,t){var n=this;return this.getMetadata(e).next(function(r){return r.byteSize+=t,n.setMetadata(e,r)})},e}();function _t(e){return hn.getStore(e,Vt.store)}var St=function(e){function t(t){var n=e.call(this)||this;return n.documentCache=t,n}return s.__extends(t,e),t.prototype.applyChanges=function(e){var t=this,n=this.assertChanges(),r=0,i=[];return n.forEach(function(e,n){var o=t.documentCache.serializer.toDbRemoteDocument(n),s=t.documentSizes.get(e);b(void 0!==s,"Attempting to change document "+e.toString()+" without having read it first");var a=It(o);r+=a-s,i.push({key:e,doc:o})}),this.documentCache.addEntries(e,i,r)},t.prototype.getFromCache=function(e,t){return this.documentCache.getSizedEntry(e,t)},t.prototype.getAllFromCache=function(e,t){return this.documentCache.getSizedEntries(e,t)},t}(bt);function Et(e){return hn.getStore(e,jt.store)}function Ct(e){return hn.getStore(e,Wt.store)}function Tt(e){return e.path.toArray()}function It(e){var t;if(e.document)t=e.document;else if(e.unknownDocument)t=e.unknownDocument;else{if(!e.noDocument)throw y("Unknown remote document type");t=e.noDocument}return JSON.stringify(t).length}var Dt=function(){function e(){this.collectionParentIndex=new xt}return e.prototype.addToCollectionParentIndex=function(e,t){return this.collectionParentIndex.add(t),He.resolve()},e.prototype.getCollectionParents=function(e,t){return He.resolve(this.collectionParentIndex.getEntries(t))},e}(),xt=function(){function e(){this.index={}}return e.prototype.add=function(e){b(e.length%2==1,"Expected a collection path.");var t=e.lastSegment(),n=e.popLast(),r=this.index[t]||new xe(se.comparator),i=!r.has(n);return this.index[t]=r.add(n),i},e.prototype.getEntries=function(e){return(this.index[e]||new xe(se.comparator)).toArray()},e}(),kt=8,At=function(){function e(e){this.serializer=e}return e.prototype.createOrUpgrade=function(e,t,n,r){var i=this;b(n<r&&n>=0&&r<=kt,"Unexpected schema upgrade from v"+n+" to v{toVersion}."),n<1&&r>=1&&(function(e){e.createObjectStore(Nt.store)}(e),function(e){e.createObjectStore(Rt.store,{keyPath:Rt.keyPath}),e.createObjectStore(Mt.store,{keyPath:Mt.keyPath,autoIncrement:!0}).createIndex(Mt.userMutationsIndex,Mt.userMutationsKeyPath,{unique:!0}),e.createObjectStore(Pt.store)}(e),zt(e),function(e){e.createObjectStore(jt.store)}(e));var o=He.resolve();return n<3&&r>=3&&(0!==n&&(function(e){e.deleteObjectStore(qt.store),e.deleteObjectStore(Ut.store),e.deleteObjectStore(Bt.store)}(e),zt(e)),o=o.next(function(){return function(e){var t=e.store(Bt.store),n=new Bt(0,0,Ee.MIN.toTimestamp(),0);return t.put(Bt.key,n)}(t)})),n<4&&r>=4&&(0!==n&&(o=o.next(function(){return function(e,t){return t.store(Mt.store).loadAll().next(function(n){e.deleteObjectStore(Mt.store),e.createObjectStore(Mt.store,{keyPath:Mt.keyPath,autoIncrement:!0}).createIndex(Mt.userMutationsIndex,Mt.userMutationsKeyPath,{unique:!0});var r=t.store(Mt.store),i=n.map(function(e){return r.put(e)});return He.waitFor(i)})}(e,t)})),o=o.next(function(){!function(e){e.createObjectStore(Qt.store,{keyPath:Qt.keyPath})}(e),function(e){e.createObjectStore(Wt.store,{keyPath:"id",autoIncrement:!0})}(e)})),n<5&&r>=5&&(o=o.next(function(){return i.removeAcknowledgedMutations(t)})),n<6&&r>=6&&(o=o.next(function(){return function(e){e.createObjectStore(Vt.store)}(e),i.addDocumentGlobal(t)})),n<7&&r>=7&&(o=o.next(function(){return i.ensureSequenceNumbers(t)})),n<8&&r>=8&&(o=o.next(function(){return i.createCollectionParentIndex(e,t)})),o},e.prototype.addDocumentGlobal=function(e){var t=0;return e.store(jt.store).iterate(function(e,n){t+=It(n)}).next(function(){var n=new Vt(t);return e.store(Vt.store).put(Vt.key,n)})},e.prototype.removeAcknowledgedMutations=function(e){var t=this,n=e.store(Rt.store),r=e.store(Mt.store);return n.loadAll().next(function(n){return He.forEach(n,function(n){var i=IDBKeyRange.bound([n.userId,-1],[n.userId,n.lastAcknowledgedBatchId]);return r.loadAll(Mt.userMutationsIndex,i).next(function(r){return He.forEach(r,function(r){b(r.userId===n.userId,"Cannot process batch "+r.batchId+" from unexpected user");var i=t.serializer.fromDbMutationBatch(r);return Qe(e,n.userId,i).next(function(){})})})})})},e.prototype.ensureSequenceNumbers=function(e){var t=e.store(qt.store),n=e.store(jt.store);return ht(e).next(function(e){var r=[];return n.iterate(function(n,i){var o=new se(n),s=function(e){return[0,be(e)]}(o);r.push(t.get(s).next(function(n){return n?He.resolve():function(n){return t.put(new qt(0,be(n),e))}(o)}))}).next(function(){return He.waitFor(r)})})},e.prototype.createCollectionParentIndex=function(e,t){e.createObjectStore(Ht.store,{keyPath:Ht.keyPath});var n=t.store(Ht.store),r=new xt,i=function(e){if(r.add(e)){var t=e.lastSegment(),i=e.popLast();return n.put({collectionId:t,parent:be(i)})}};return t.store(jt.store).iterate({keysOnly:!0},function(e,t){var n=new se(e);return i(n.popLast())}).next(function(){return t.store(Pt.store).iterate({keysOnly:!0},function(e,t){var n=_e(e[1]);return i(n.popLast())})})},e}(),Ot=function(){return function(e,t){this.seconds=e,this.nanoseconds=t}}(),Nt=function(){function e(e,t,n){this.ownerId=e,this.allowTabSynchronization=t,this.leaseTimestampMs=n}return e.store="owner",e.key="owner",e}(),Rt=function(){function e(e,t,n){this.userId=e,this.lastAcknowledgedBatchId=t,this.lastStreamToken=n}
1return e.store="mutationQueues",e.keyPath="userId",e}(),Mt=function(){function e(e,t,n,r,i){this.userId=e,this.batchId=t,this.localWriteTimeMs=n,this.baseMutations=r,this.mutations=i}return e.store="mutations",e.keyPath="batchId",e.userMutationsIndex="userMutationsIndex",e.userMutationsKeyPath=["userId","batchId"],e}(),Pt=function(){function e(){}return e.prefixForUser=function(e){return[e]},e.prefixForPath=function(e,t){return[e,be(t)]},e.key=function(e,t,n){return[e,be(t),n]},e.store="documentMutations",e.PLACEHOLDER=new e,e}(),Lt=function(){return function(e,t){this.path=e,this.readTime=t}}(),Ft=function(){return function(e,t){this.path=e,this.version=t}}(),jt=function(){function e(e,t,n,r){this.unknownDocument=e,this.noDocument=t,this.document=n,this.hasCommittedMutations=r}return e.store="remoteDocuments",e}(),Vt=function(){function e(e){this.byteSize=e}return e.store="remoteDocumentGlobal",e.key="remoteDocumentGlobalKey",e}(),Ut=function(){function e(e,t,n,r,i,o){this.targetId=e,this.canonicalId=t,this.readTime=n,this.resumeToken=r,this.lastListenSequenceNumber=i,this.query=o}return e.store="targets",e.keyPath="targetId",e.queryTargetsIndexName="queryTargetsIndex",e.queryTargetsKeyPath=["canonicalId","targetId"],e}(),qt=function(){function e(e,t,n){this.targetId=e,this.path=t,this.sequenceNumber=n,b(0===e==(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 e.store="targetDocuments",e.keyPath=["targetId","path"],e.documentTargetsIndex="documentTargetsIndex",e.documentTargetsKeyPath=["path","targetId"],e}(),Bt=function(){function e(e,t,n,r){this.highestTargetId=e,this.highestListenSequenceNumber=t,this.lastRemoteSnapshotVersion=n,this.targetCount=r}return e.key="targetGlobalKey",e.store="targetGlobal",e}(),Ht=function(){function e(e,t){this.collectionId=e,this.parent=t}return e.store="collectionParents",e.keyPath=["collectionId","parent"],e}();function zt(e){e.createObjectStore(qt.store,{keyPath:qt.keyPath}).createIndex(qt.documentTargetsIndex,qt.documentTargetsKeyPath,{unique:!0}),e.createObjectStore(Ut.store,{keyPath:Ut.keyPath}).createIndex(Ut.queryTargetsIndexName,Ut.queryTargetsKeyPath,{unique:!0}),e.createObjectStore(Bt.store)}var Wt=function(){function e(e){this.changes=e}return e.store="remoteDocumentChanges",e.keyPath="id",e}(),Qt=function(){function e(e,t,n,r,i){this.clientId=e,this.updateTimeMs=t,this.networkEnabled=n,this.inForeground=r,this.lastProcessedDocumentChangeId=i}return e.store="clientMetadata",e.keyPath="clientId",e}(),Gt=[Rt.store,Mt.store,Pt.store,jt.store,Ut.store,Nt.store,Bt.store,qt.store].concat([Qt.store,Wt.store]).concat([Vt.store]).concat([Ht.store]),Kt=function(){function e(){this.collectionParentsCache=new xt}return e.prototype.addToCollectionParentIndex=function(e,t){if(b(t.length%2==1,"Expected a collection path."),this.collectionParentsCache.add(t)){b(t.length>=1,"Invalid collection path.");var n=t.lastSegment(),r=t.popLast();return $t(e).put({collectionId:n,parent:be(r)})}return He.resolve()},e.prototype.getCollectionParents=function(e,t){var n=[],r=IDBKeyRange.bound([t,""],[Y(t),""],!1,!0);return $t(e).loadAll(r).next(function(e){for(var r=0,i=e;r<i.length;r++){var o=i[r];if(o.collectionId!==t)break;n.push(_e(o.parent))}return n})},e}();function $t(e){return hn.getStore(e,Ht.store)}var Yt=function(e){return e[e.Listen=0]="Listen",e[e.ExistenceFilterMismatch=1]="ExistenceFilterMismatch",e[e.LimboResolution=2]="LimboResolution",e}({}),Zt=function(){function e(e,t,n,r,i,o){void 0===i&&(i=Ee.MIN),void 0===o&&(o=w()),this.query=e,this.targetId=t,this.purpose=n,this.sequenceNumber=r,this.snapshotVersion=i,this.resumeToken=o}return e.prototype.copy=function(t){return new e(this.query,this.targetId,this.purpose,void 0===t.sequenceNumber?this.sequenceNumber:t.sequenceNumber,void 0===t.snapshotVersion?this.snapshotVersion:t.snapshotVersion,void 0===t.resumeToken?this.resumeToken:t.resumeToken)},e.prototype.isEqual=function(e){return this.targetId===e.targetId&&this.purpose===e.purpose&&this.sequenceNumber===e.sequenceNumber&&this.snapshotVersion.isEqual(e.snapshotVersion)&&this.resumeToken===e.resumeToken&&this.query.isEqual(e.query)},e}
1(),Jt=function(){function e(e){this.remoteSerializer=e}return e.prototype.fromDbRemoteDocument=function(e){if(e.document)return this.remoteSerializer.fromDocument(e.document,!!e.hasCommittedMutations);if(e.noDocument){var t=le.fromSegments(e.noDocument.path),n=this.fromDbTimestamp(e.noDocument.readTime);return new mt(t,n,{hasCommittedMutations:!!e.hasCommittedMutations})}return e.unknownDocument?(t=le.fromSegments(e.unknownDocument.path),n=this.fromDbTimestamp(e.unknownDocument.version),new gt(t,n)):y("Unexpected DbRemoteDocument")},e.prototype.toDbRemoteDocument=function(e){if(e instanceof pt){var t=e.proto?e.proto:this.remoteSerializer.toDocument(e);return new jt(null,null,t,i=e.hasCommittedMutations)}if(e instanceof mt){var n=e.key.path.toArray(),r=this.toDbTimestamp(e.version),i=e.hasCommittedMutations;return new jt(null,new Lt(n,r),null,i)}return e instanceof gt?(n=e.key.path.toArray(),r=this.toDbTimestamp(e.version),new jt(new Ft(n,r),null,null,!0)):y("Unexpected MaybeDocumment")},e.prototype.toDbTimestamp=function(e){var t=e.toTimestamp();return new Ot(t.seconds,t.nanoseconds)},e.prototype.fromDbTimestamp=function(e){var t=new Se(e.seconds,e.nanoseconds);return Ee.fromTimestamp(t)},e.prototype.toDbMutationBatch=function(e,t){var n=this,r=t.baseMutations.map(function(e){return n.remoteSerializer.toMutation(e)}),i=t.mutations.map(function(e){return n.remoteSerializer.toMutation(e)});return new Mt(e,t.batchId,t.localWriteTime.toMillis(),r,i)},e.prototype.fromDbMutationBatch=function(e){var t=this,n=(e.baseMutations||[]).map(function(e){return t.remoteSerializer.fromMutation(e)}),r=e.mutations.map(function(e){return t.remoteSerializer.fromMutation(e)}),i=Se.fromMillis(e.localWriteTimeMs);return new qe(e.batchId,i,n,r)},e.prototype.toDbResourcePaths=function(e){var t=[];return e.forEach(function(e){t.push(be(e.path))}),t},e.prototype.fromDbResourcePaths=function(e){for(var t=je(),n=0,r=e;n<r.length;n++)t=t.add(new le(_e(r[n])));return t},e.prototype.fromDbTarget=function(e){var t,n=this.fromDbTimestamp(e.readTime);return t=void 0!==e.query.documents?this.remoteSerializer.fromDocumentsTarget(e.query):this.remoteSerializer.fromQueryTarget(e.query),new Zt(t,e.targetId,Yt.Listen,e.lastListenSequenceNumber,n,e.resumeToken)},e.prototype.toDbTarget=function(e){b(Yt.Listen===e.purpose,"Only queries with purpose "+Yt.Listen+" may be stored, got "+e.purpose);var t,n,r=this.toDbTimestamp(e.snapshotVersion);return t=e.query.isDocumentQuery()?this.remoteSerializer.toDocumentsTarget(e.query):this.remoteSerializer.toQueryTarget(e.query),e.resumeToken instanceof Uint8Array?(b("YES"===process.env.USE_MOCK_PERSISTENCE,"Persisting non-string stream tokens is only supported with mock persistence ."),n=e.resumeToken.toString()):n=e.resumeToken,new Ut(e.targetId,e.query.canonicalId(),r,n,e.sequenceNumber,t)},e}();function Xt(e,t){var n=e[1],r=t[1],i=K(e[0],t[0]);return 0===i?K(n,r):i}var en=function(){function e(e){this.maxElements=e,this.buffer=new xe(Xt),this.previousIndex=0}return e.prototype.nextIndex=function(){return++this.previousIndex},e.prototype.addElement=function(e){var t=[e,this.nextIndex()];if(this.buffer.size<this.maxElements)this.buffer=this.buffer.add(t);else{var n=this.buffer.last();Xt(t,n)<0&&(this.buffer=this.buffer.delete(n).add(t))}},Object.defineProperty(e.prototype,"maxValue",{get:function(){return this.buffer.last()[0]},enumerable:!0,configurable:!0}),e}(),tn={didRun:!1,sequenceNumbersCollected:0,targetsRemoved:0,documentsRemoved:0},nn=function(){function e(e,t,n){this.cacheSizeCollectionThreshold=e,this.percentileToCollect=t,this.maximumSequenceNumbersToCollect=n}return e.withCacheSize=function(t){return new e(t,e.DEFAULT_COLLECTION_PERCENTILE,e.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT)},e.COLLECTION_DISABLED=-1,e.MINIMUM_CACHE_SIZE_BYTES=1048576,e.DEFAULT=new e(e.DEFAULT_CACHE_SIZE_BYTES=41943040,e.DEFAULT_COLLECTION_PERCENTILE=10,e.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT=1e3),e.DISABLED=new e(e.COLLECTION_DISABLED,0,0),e}(),rn=function(){function e(e,t,n){this.garbageCollector=e,this.asyncQueue=t,this.localStore=n,this.gcTask=null}return e.prototype.start=function(){b(null===this.gcTask,"Cannot start an already started LruScheduler"),this.garbageCollector.params.cacheSizeCollectionThreshold!==nn.COLLECTION_DISABLED&&this.scheduleGC()},e.prototype.stop=function(){this.gcTask&&(this.gcTask.cancel(),this.gcTask=null)},Object.defineProperty(e.prototype,"started",{get:function(){return null!==this.gcTask},enumerable:!0,configurable:!0}),e.prototype.scheduleGC=function(){var e=this;b(null===this.gcTask,"Cannot schedule GC while a task is pending");var t=this.hasRun?3e5:6e4;p("LruGarbageCollector","Garbage collection scheduled in "+t+"ms"),this.gcTask=this.asyncQueue.enqueueAfterDelay(he.LruGarbageCollection,t,function(){return e.gcTask=null,e.hasRun=!0,e.localStore.collectGarbage(e.garbageCollector).then(function(){return e.scheduleGC()}).catch(dn)})},e}(),on=function(){function e(e,t){this.delegate=e,this.params=t}return e.prototype.calculateTargetCount=function(e,t){return this.delegate.getSequenceNumberCount(e).next(function(e){return Math.floor(t/100*e)})},e.prototype.nthSequenceNumber=function(e,t){var n=this;if(0===t)return He.resolve(ie.INVALID);var r=new en(t);return this.delegate.forEachTarget(e,function(e){return r.addElement(e.sequenceNumber)}).next(function(){return n.delegate.forEachOrphanedDocumentSequenceNumber(e,function(e){return r.addElement(e)})}).next(function(){return r.maxValue})},e.prototype.removeTargets=function(e,t,n){return this.delegate.removeTargets(e,t,n)},e.prototype.removeOrphanedDocuments=function(e,t){return this.delegate.removeOrphanedDocuments(e,t)},e.prototype.collect=function(e,t){var n=this;return this.params.cacheSizeCollectionThreshold===nn.COLLECTION_DISABLED?(p("LruGarbageCollector","Garbage collection skipped; disabled"),He.resolve(tn)):this.getCacheSize(e).next(function(r){return r<n.params.cacheSizeCollectionThreshold?(p("LruGarbageCollector","Garbage collection skipped; Cache size "+r+" is lower than threshold "+n.params.cacheSizeCollectionThreshold),tn):n.runGarbageCollection(e,t)})},e.prototype.getCacheSize=function(e){return this.delegate.getCacheSize(e)},e.prototype.runGarbageCollection=function(e,t){var n,r,i,o,s,a,u,l=this,c=Date.now();return this.calculateTargetCount(e,this.params.percentileToCollect).next(function(t){return t>l.params.maximumSequenceNumbersToCollect?(p("LruGarbageCollector","Capping sequence numbers to collect down to the maximum of "+l.params.maximumSequenceNumbersToCollect+" from "+t),r=l.params.maximumSequenceNumbersToCollect):r=t,o=Date.now(),l.nthSequenceNumber(e,r)}).next(function(r){return n=r,s=Date.now(),l.removeTargets(e,n,t)}).next(function(t){return i=t,a=Date.now(),l.removeOrphanedDocuments(e,n)}).next(function(e){return u=Date.now(),d()<=h.DEBUG&&p("LruGarbageCollector","LRU Garbage Collection\n\tCounted targets in "+(o-c)+"ms\n\tDetermined least recently used "+r+" in "+(s-o)+"ms\n\tRemoved "+i+" targets in "+(a-s)+"ms\n\tRemoved "+e+" documents in "+(u-a)+"ms\nTotal Duration: "+(u-c)+"ms"),He.resolve({didRun:!0,sequenceNumbersCollected:r,targetsRemoved:i,documentsRemoved:e})})},e}(),sn="IndexedDbPersistence",an="The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.",un="Another tab has exclusive access to the persistence layer. To allow shared access, make sure to invoke `enablePersistence()` with `synchronizeTabs:true` in all tabs.",ln="This platform is either missing IndexedDB or is known to have an incomplete implementation. Offline persistence has been disabled.",cn=function(e){function t(t,n){var r=e.call(this)||this;return r.simpleDbTransaction=t,r.currentSequenceNumber=n,r}return s.__extends(t,e),t}(function(){return function(){}}()),hn=function(){function e(t,n,r,i,o,s,a){if(this.persistenceKey=t,this.clientId=n,this.queue=i,this.multiClientParams=a,this._started=!1,this.isPrimary=!1,this.networkEnabled=!0,this.inForeground=!1,this.lastGarbageCollectionTime=Number.NEGATIVE_INFINITY,this.primaryStateListener=function(e){return Promise.resolve()}
1,!e.isAvailable())throw new S(_.UNIMPLEMENTED,ln);if(this.referenceDelegate=new mn(this,s),this.dbName=t+e.MAIN_DATABASE,this.serializer=new Jt(o),this.document=r.document,this.allowTabSynchronization=void 0!==a,this.queryCache=new ut(this.referenceDelegate,this.serializer),this.indexManager=new Kt,this.remoteDocumentCache=new wt(this.serializer,this.indexManager,this.allowTabSynchronization),!r.window||!r.window.localStorage)throw new S(_.UNIMPLEMENTED,"IndexedDB persistence is only available on platforms that support LocalStorage.");this.window=r.window,this.webStorage=this.window.localStorage}return e.getStore=function(e,t){if(e instanceof cn)return tt.getStore(e.simpleDbTransaction,t);throw y("IndexedDbPersistence must use instances of IndexedDbTransaction")},e.createIndexedDbPersistence=function(t,n,r,i,o,a){return s.__awaiter(this,void 0,void 0,function(){var u;return s.__generator(this,function(s){switch(s.label){case 0:return[4,(u=new e(t,n,r,i,o,a)).start()];case 1:return s.sent(),[2,u]}})})},e.createMultiClientIndexedDbPersistence=function(t,n,r,i,o,a,u){return s.__awaiter(this,void 0,void 0,function(){var l;return s.__generator(this,function(s){switch(s.label){case 0:return[4,(l=new e(t,n,r,i,o,a,u)).start()];case 1:return s.sent(),[2,l]}})})},e.prototype.start=function(){var e=this;return b(!this.started,"IndexedDbPersistence double-started!"),b(null!==this.window,"Expected 'window' to be defined"),tt.openOrCreate(this.dbName,kt,new At(this.serializer)).then(function(t){return e.simpleDb=t,e.updateClientMetadataAndTryBecomePrimary()}).then(function(){return e.attachVisibilityHandler(),e.attachWindowUnloadHook(),e.scheduleClientMetadataAndPrimaryLeaseRefreshes(),e.startRemoteDocumentCache()}).then(function(){return e.simpleDb.runTransaction("readonly",[Bt.store],function(t){return ht(t).next(function(t){e.listenSequence=new ie(t,e.multiClientParams?e.multiClientParams.sequenceNumberSyncer:void 0)})})}).then(function(){e._started=!0}).catch(function(t){return e.simpleDb&&e.simpleDb.close(),Promise.reject(t)})},e.prototype.startRemoteDocumentCache=function(){var e=this;return this.simpleDb.runTransaction("readonly",Gt,function(t){return e.remoteDocumentCache.start(t)})},e.prototype.setPrimaryStateListener=function(e){var t=this;return this.primaryStateListener=function(n){return s.__awaiter(t,void 0,void 0,function(){return s.__generator(this,function(t){return this.started?[2,e(n)]:[2]})})},e(this.isPrimary)},e.prototype.setDatabaseDeletedListener=function(e){var t=this;this.simpleDb.setVersionChangeListener(function(n){return s.__awaiter(t,void 0,void 0,function(){return s.__generator(this,function(t){switch(t.label){case 0:return null!==n.newVersion?[3,2]:[4,e()];case 1:t.sent(),t.label=2;case 2:return[2]}})})})},e.prototype.setNetworkEnabled=function(e){var t=this;this.networkEnabled!==e&&(this.networkEnabled=e,this.queue.enqueueAndForget(function(){return s.__awaiter(t,void 0,void 0,function(){return s.__generator(this,function(e){switch(e.label){case 0:return this.started?[4,this.updateClientMetadataAndTryBecomePrimary()]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}})})}))},e.prototype.updateClientMetadataAndTryBecomePrimary=function(){var e=this;return this.simpleDb.runTransaction("readwrite",Gt,function(t){return pn(t).put(new Qt(e.clientId,Date.now(),e.networkEnabled,e.inForeground,e.remoteDocumentCache.lastProcessedDocumentChangeId)).next(function(){if(e.isPrimary)return e.verifyPrimaryLease(t).next(function(t){t||(e.isPrimary=!1,e.queue.enqueueAndForget(function(){return e.primaryStateListener(!1)}))})}).next(function(){return e.canActAsPrimary(t)}).next(function(n){var r=e.isPrimary;return e.isPrimary=n,r!==e.isPrimary&&e.queue.enqueueAndForget(function(){return e.primaryStateListener(e.isPrimary)}),r&&!e.isPrimary?e.releasePrimaryLeaseIfHeld(t):e.isPrimary?e.acquireOrExtendPrimaryLease(t):void 0})})},e.prototype.verifyPrimaryLease=function(e){var t=this;return fn(e).get(Nt.key).next(function(e){return He.resolve(t.isLocalClient(e))})},e.prototype.removeClientMetadata=function(e){return pn(e).delete(this.clientId)},e.prototype.maybeGarbageCollectMultiClientState=function(){return s.__awaiter(this,void 0,void 0,function(){var t,n,r=this;return s.__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=e.getStore(i,Qt.store);return o.loadAll().next(function(e){t=r.filterActiveClients(e,18e5),n=e.filter(function(e){return-1===t.indexOf(e)})}).next(function(){return He.forEach(n,function(e){return o.delete(e.clientId)})}).next(function(){if((t=t.filter(function(e){return e.clientId!==r.clientId})).length>0){var e=t.map(function(e){return e.lastProcessedDocumentChangeId||0}),n=Math.min.apply(Math,e);return r.remoteDocumentCache.removeDocumentChangesThroughChangeId(i,n)}})})]);
1case 1:i.sent(),n.forEach(function(e){r.window.localStorage.removeItem(r.zombiedClientLocalStorageKey(e.clientId))}),i.label=2;case 2:return[2]}})})},e.prototype.scheduleClientMetadataAndPrimaryLeaseRefreshes=function(){var e=this;this.clientMetadataRefresher=this.queue.enqueueAfterDelay(he.ClientMetadataRefresh,4e3,function(){return e.updateClientMetadataAndTryBecomePrimary().then(function(){return e.maybeGarbageCollectMultiClientState()}).then(function(){return e.scheduleClientMetadataAndPrimaryLeaseRefreshes()})})},e.prototype.isLocalClient=function(e){return!!e&&e.ownerId===this.clientId},e.prototype.canActAsPrimary=function(e){var t=this;return fn(e).get(Nt.key).next(function(n){if(null!==n&&t.isWithinAge(n.leaseTimestampMs,5e3)&&!t.isClientZombied(n.ownerId)){if(t.isLocalClient(n)&&t.networkEnabled)return!0;if(!t.isLocalClient(n)){if(!n.allowTabSynchronization)throw new S(_.FAILED_PRECONDITION,un);return!1}}return!(!t.networkEnabled||!t.inForeground)||pn(e).loadAll().next(function(e){return void 0===t.filterActiveClients(e,5e3).find(function(e){return!(t.clientId===e.clientId||!(!t.networkEnabled&&e.networkEnabled||!t.inForeground&&e.inForeground&&t.networkEnabled===e.networkEnabled))})})}).next(function(e){return t.isPrimary!==e&&p(sn,"Client "+(e?"is":"is not")+" eligible for a primary lease."),e})},e.prototype.shutdown=function(){return s.__awaiter(this,void 0,void 0,function(){var e=this;return s.__generator(this,function(t){switch(t.label){case 0:return this._started=!1,this.markClientZombied(),this.clientMetadataRefresher&&this.clientMetadataRefresher.cancel(),this.detachVisibilityHandler(),this.detachWindowUnloadHook(),[4,this.simpleDb.runTransaction("readwrite",[Nt.store,Qt.store],function(t){return e.releasePrimaryLeaseIfHeld(t).next(function(){return e.removeClientMetadata(t)})})];case 1:return t.sent(),this.simpleDb.close(),this.removeClientZombiedEntry(),[2]}})})},e.prototype.filterActiveClients=function(e,t){var n=this;return e.filter(function(e){return n.isWithinAge(e.updateTimeMs,t)&&!n.isClientZombied(e.clientId)})},e.prototype.getActiveClients=function(){var e=this;return this.simpleDb.runTransaction("readonly",[Qt.store],function(t){return pn(t).loadAll().next(function(t){return e.filterActiveClients(t,18e5).map(function(e){return e.clientId})})})},e.clearPersistence=function(t){return s.__awaiter(this,void 0,void 0,function(){return s.__generator(this,function(n){switch(n.label){case 0:return e.isAvailable()?[4,tt.delete(t+e.MAIN_DATABASE)]:[2,Promise.resolve()];case 1:return n.sent(),[2]}})})},Object.defineProperty(e.prototype,"started",{get:function(){return this._started},enumerable:!0,configurable:!0}),e.prototype.getMutationQueue=function(e){return b(this.started,"Cannot initialize MutationQueue before persistence is started."),ze.forUser(e,this.serializer,this.indexManager,this.referenceDelegate)},e.prototype.getQueryCache=function(){return b(this.started,"Cannot initialize QueryCache before persistence is started."),this.queryCache},e.prototype.getRemoteDocumentCache=function(){return b(this.started,"Cannot initialize RemoteDocumentCache before persistence is started."),this.remoteDocumentCache},e.prototype.getIndexManager=function(){return b(this.started,"Cannot initialize IndexManager before persistence is started."),this.indexManager},e.prototype.runTransaction=function(e,t,n){var r=this;return p(sn,"Starting transaction:",e),this.simpleDb.runTransaction("readonly"===t?"readonly":"readwrite",Gt,function(i){return"readwrite-primary"===t?r.verifyPrimaryLease(i).next(function(t){if(!t)throw m("Failed to obtain primary lease for action '"+e+"'."),r.isPrimary=!1,r.queue.enqueueAndForget(function(){return r.primaryStateListener(!1)}),new S(_.FAILED_PRECONDITION,an);return n(new cn(i,r.listenSequence.next()))}).next(function(e){return r.acquireOrExtendPrimaryLease(i).next(function(){return e})}):r.verifyAllowTabSynchronization(i).next(function(){return n(new cn(i,r.listenSequence.next()))})})},e.prototype.verifyAllowTabSynchronization=function(e){var t=this;return fn(e).get(Nt.key).next(function(e){if(null!==e&&t.isWithinAge(e.leaseTimestampMs,5e3)&&!t.isClientZombied(e.ownerId)&&!t.isLocalClient(e)&&!e.allowTabSynchronization)throw new S(_.FAILED_PRECONDITION,un)})},e.prototype.acquireOrExtendPrimaryLease=function(e){var t=new Nt(this.clientId,this.allowTabSynchronization,Date.now());return fn(e).put(Nt.key,t)}
1,e.isAvailable=function(){return tt.isAvailable()},e.buildStoragePrefix=function(e){var t=e.databaseId.projectId;return e.databaseId.isDefaultDatabase||(t+="."+e.databaseId.database),"firestore/"+e.persistenceKey+"/"+t+"/"},e.prototype.releasePrimaryLeaseIfHeld=function(e){var t=this,n=fn(e);return n.get(Nt.key).next(function(e){return t.isLocalClient(e)?(p(sn,"Releasing primary lease."),n.delete(Nt.key)):He.resolve()})},e.prototype.isWithinAge=function(e,t){var n=Date.now();return!(e<n-t||e>n&&(m("Detected an update time that is in the future: "+e+" > "+n),1))},e.prototype.attachVisibilityHandler=function(){var e=this;null!==this.document&&"function"==typeof this.document.addEventListener&&(this.documentVisibilityHandler=function(){e.queue.enqueueAndForget(function(){return e.inForeground="visible"===e.document.visibilityState,e.updateClientMetadataAndTryBecomePrimary()})},this.document.addEventListener("visibilitychange",this.documentVisibilityHandler),this.inForeground="visible"===this.document.visibilityState)},e.prototype.detachVisibilityHandler=function(){this.documentVisibilityHandler&&(b(null!==this.document&&"function"==typeof this.document.addEventListener,"Expected 'document.addEventListener' to be a function"),this.document.removeEventListener("visibilitychange",this.documentVisibilityHandler),this.documentVisibilityHandler=null)},e.prototype.attachWindowUnloadHook=function(){var e=this;"function"==typeof this.window.addEventListener&&(this.windowUnloadHandler=function(){e.markClientZombied(),e.queue.enqueueAndForget(function(){return e.shutdown()})},this.window.addEventListener("unload",this.windowUnloadHandler))},e.prototype.detachWindowUnloadHook=function(){this.windowUnloadHandler&&(b("function"==typeof this.window.removeEventListener,"Expected 'window.removeEventListener' to be a function"),this.window.removeEventListener("unload",this.windowUnloadHandler),this.windowUnloadHandler=null)},e.prototype.isClientZombied=function(e){try{var t=null!==this.webStorage.getItem(this.zombiedClientLocalStorageKey(e));return p(sn,"Client '"+e+"' "+(t?"is":"is not")+" zombied in LocalStorage"),t}catch(n){return m(sn,"Failed to get zombied client id.",n),!1}},e.prototype.markClientZombied=function(){try{this.webStorage.setItem(this.zombiedClientLocalStorageKey(this.clientId),String(Date.now()))}catch(e){m("Failed to set zombie client id.",e)}},e.prototype.removeClientZombiedEntry=function(){try{this.webStorage.removeItem(this.zombiedClientLocalStorageKey(this.clientId))}catch(e){}},e.prototype.zombiedClientLocalStorageKey=function(e){return"firestore_zombie_"+this.persistenceKey+"_"+e},e.MAIN_DATABASE="main",e}();function dn(e){return s.__awaiter(this,void 0,void 0,function(){return s.__generator(this,function(t){if(!function(e){return e.code===_.FAILED_PRECONDITION&&e.message===an}(e))throw e;return p(sn,"Unexpectedly lost primary lease"),[2]})})}function fn(e){return e.store(Nt.store)}function pn(e){return e.store(Qt.store)}var mn=function(){function e(e,t){this.db=e,this.garbageCollector=new on(this,t)}return e.prototype.getSequenceNumberCount=function(e){var t=this.orphanedDocmentCount(e);return this.db.getQueryCache().getQueryCount(e).next(function(e){return t.next(function(t){return e+t})})},e.prototype.orphanedDocmentCount=function(e){var t=0;return this.forEachOrphanedDocumentSequenceNumber(e,function(e){t++}).next(function(){return t})},e.prototype.forEachTarget=function(e,t){return this.db.getQueryCache().forEachTarget(e,t)},e.prototype.forEachOrphanedDocumentSequenceNumber=function(e,t){return this.forEachOrphanedDocument(e,function(e,n){return t(n)})},e.prototype.setInMemoryPins=function(e){this.inMemoryPins=e},e.prototype.addReference=function(e,t){return gn(e,t)},e.prototype.removeReference=function(e,t){return gn(e,t)},e.prototype.removeTargets=function(e,t,n){return this.db.getQueryCache().removeTargets(e,t,n)},e.prototype.removeMutationReference=function(e,t){return gn(e,t)},e.prototype.isPinned=function(e,t){return this.inMemoryPins.containsKey(t)?He.resolve(!0):function(e,t){var n=!1;return Ye(e).iterateSerial(function(r){return We(e,r,t).next(function(e){return e&&(n=!0),He.resolve(!e)})}).next(function(){return n})}(e,t)},e.prototype.removeOrphanedDocuments=function(e,t){var n=this,r=0,i=0,o=[];return this.forEachOrphanedDocument(e,function(s,a){if(a<=t){var u=n.isPinned(e,s).next(function(t){if(!t)return r++,n.removeOrphanedDocument(e,s).next(function(e){i+=e})});o.push(u)}}).next(function(){return He.waitFor(o)}).next(function(){return n.db.getRemoteDocumentCache().updateSize(e,-i)}).next(function(){return r})},e.prototype.removeOrphanedDocument=function(e,t){var n,r=0,i=this.db.getRemoteDocumentCache();return He.waitFor([dt(e).delete((n=t,[0,be(n.path)])),i.removeEntry(e,t).next(function(e){r+=e})]).next(function(){return r})},e.prototype.removeTarget=function(e,t){var n=t.copy({sequenceNumber:e.currentSequenceNumber});return this.db.getQueryCache().updateQueryData(e,n)},e.prototype.updateLimboDocument=function(e,t){return gn(e,t)},e.prototype.forEachOrphanedDocument=function(e,t){var n,r=dt(e),i=ie.INVA
1LID;return r.iterate({index:qt.documentTargetsIndex},function(e,r){var o=r.path,s=r.sequenceNumber;0===e[0]?(i!==ie.INVALID&&t(new le(_e(n)),i),i=s,n=o):i=ie.INVALID}).next(function(){i!==ie.INVALID&&t(new le(_e(n)),i)})},e.prototype.getCacheSize=function(e){return this.db.getRemoteDocumentCache().getSize(e)},e}();function gn(e,t){return dt(e).put(function(e,t){return new qt(0,be(e.path),t)}(t,e.currentSequenceNumber))}var yn=function(e){return e[e.NullValue=0]="NullValue",e[e.BooleanValue=1]="BooleanValue",e[e.NumberValue=2]="NumberValue",e[e.TimestampValue=3]="TimestampValue",e[e.StringValue=4]="StringValue",e[e.BlobValue=5]="BlobValue",e[e.RefValue=6]="RefValue",e[e.GeoPointValue=7]="GeoPointValue",e[e.ArrayValue=8]="ArrayValue",e[e.ObjectValue=9]="ObjectValue",e}({}),bn=function(e){return e[e.Default=0]="Default",e[e.Estimate=1]="Estimate",e[e.Previous=2]="Previous",e}({}),vn=function(){function e(e,t){this.serverTimestampBehavior=e,this.timestampsInSnapshots=t}return e.fromSnapshotOptions=function(t,n){switch(t.serverTimestamps){case"estimate":return new e(bn.Estimate,n);case"previous":return new e(bn.Previous,n);case"none":case void 0:return new e(bn.Default,n);default:return y("fromSnapshotOptions() called with invalid options.")}},e}(),wn=function(){function e(){}return e.prototype.toString=function(){var e=this.value();return null===e?"null":e.toString()},e.prototype.defaultCompareTo=function(e){return b(this.typeOrder!==e.typeOrder,"Default compareTo should not be used for values of same type."),K(this.typeOrder,e.typeOrder)},e}(),_n=function(e){function t(){var t=e.call(this)||this;return t.typeOrder=yn.NullValue,t.internalValue=null,t}return s.__extends(t,e),t.prototype.value=function(e){return null},t.prototype.isEqual=function(e){return e instanceof t},t.prototype.compareTo=function(e){return e instanceof t?0:this.defaultCompareTo(e)},t.INSTANCE=new t,t}(wn),Sn=function(e){function t(t){var n=e.call(this)||this;return n.internalValue=t,n.typeOrder=yn.BooleanValue,n}return s.__extends(t,e),t.prototype.value=function(e){return this.internalValue},t.prototype.isEqual=function(e){return e instanceof t&&this.internalValue===e.internalValue},t.prototype.compareTo=function(e){return e instanceof t?K(this,e):this.defaultCompareTo(e)},t.of=function(e){return e?t.TRUE:t.FALSE},t.TRUE=new t(!0),t.FALSE=new t(!1),t}(wn),En=function(e){function t(t){var n=e.call(this)||this;return n.internalValue=t,n.typeOrder=yn.NumberValue,n}return s.__extends(t,e),t.prototype.value=function(e){return this.internalValue},t.prototype.compareTo=function(e){return e instanceof t?(n=this.internalValue)<(r=e.internalValue)?-1:n>r?1:n===r?0:isNaN(n)?isNaN(r)?0:-1:1:this.defaultCompareTo(e);var n,r},t}(wn);function Cn(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}var Tn=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return s.__extends(t,e),t.prototype.isEqual=function(e){return e instanceof t&&Cn(this.internalValue,e.internalValue)},t}(En),In=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return s.__extends(t,e),t.prototype.isEqual=function(e){return e instanceof t&&Cn(this.internalValue,e.internalValue)},t.NAN=new t(NaN),t.POSITIVE_INFINITY=new t(1/0),t.NEGATIVE_INFINITY=new t(-1/0),t}(En),Dn=function(e){function t(t){var n=e.call(this)||this;return n.internalValue=t,n.typeOrder=yn.StringValue,n}return s.__extends(t,e),t.prototype.value=function(e){return this.internalValue},t.prototype.isEqual=function(e){return e instanceof t&&this.internalValue===e.internalValue},t.prototype.compareTo=function(e){return e instanceof t?K(this.internalValue,e.internalValue):this.defaultCompareTo(e)},t}(wn),xn=function(e){function t(t){var n=e.call(this)||this;return n.internalValue=t,n.typeOrder=yn.TimestampValue,n}return s.__extends(t,e),t.prototype.value=function(e){return!e||e.timestampsInSnapshots?this.internalValue:this.internalValue.toDate()},t.prototype.isEqual=function(e){return e instanceof t&&this.internalValue.isEqual(e.internalValue)},t.prototype.compareTo=function(e){return e instanceof t?this.internalValue._compareTo(e.internalValue):e instanceof kn?-1:this.defaultCompareTo(e)},t}(wn),kn=function(e){function t(t,n){var r=e.call(this)||this;return r.localWriteTime=t,r.previousValue=n,r.typeOrder=yn.TimestampValue,r}return s.__extends(t,e),t.prototype.value=function(e){return e&&e.serverTimestampBehavior===bn.Estimate?new xn(this.localWriteTime).value(e):e&&e.serverTimestampBehavior===bn.Previous&&this.previousValue?this.previousValue.value(e):null},t.prototype.isEqual=function(e){return e instanceof t&&this.localWriteTime.isEqual(e.localWriteTime)},t.prototype.compareTo=function(e){return e instanceof t?this.localWriteTime._compareTo(e.localWriteTime):e instanceof xn?1:this.defaultCompareTo(e)},t.prototype.toString=function(){return"<ServerTimestamp localTime="+this.localWriteTime.toString()+">"},t}(wn),An=function(e){function t(t){var n=e.call(this)||this;return n.internalValue=t,n.typeOrder=yn.BlobValue,n}return s.__extends(t,e),t.prototype.value=function(e){return this.internalValue},t.prototype.isEqual=function(e){return e instanceof t&&this.internalValue.isEqual(e.internalValue)},t.prototype.compareTo=function(e){return e instanceof t?this.internalValue._compareTo(e.internalValue):this.defaultCompareTo(e)},t}
1(wn),On=function(e){function t(t,n){var r=e.call(this)||this;return r.databaseId=t,r.key=n,r.typeOrder=yn.RefValue,r}return s.__extends(t,e),t.prototype.value=function(e){return this.key},t.prototype.isEqual=function(e){return e instanceof t&&this.key.isEqual(e.key)&&this.databaseId.isEqual(e.databaseId)},t.prototype.compareTo=function(e){if(e instanceof t){var n=this.databaseId.compareTo(e.databaseId);return 0!==n?n:le.comparator(this.key,e.key)}return this.defaultCompareTo(e)},t}(wn),Nn=function(e){function t(t){var n=e.call(this)||this;return n.internalValue=t,n.typeOrder=yn.GeoPointValue,n}return s.__extends(t,e),t.prototype.value=function(e){return this.internalValue},t.prototype.isEqual=function(e){return e instanceof t&&this.internalValue.isEqual(e.internalValue)},t.prototype.compareTo=function(e){return e instanceof t?this.internalValue._compareTo(e.internalValue):this.defaultCompareTo(e)},t}(wn),Rn=function(e){function t(t){var n=e.call(this)||this;return n.internalValue=t,n.typeOrder=yn.ObjectValue,n}return s.__extends(t,e),t.prototype.value=function(e){var t={};return this.internalValue.inorderTraversal(function(n,r){t[n]=r.value(e)}),t},t.prototype.forEach=function(e){this.internalValue.inorderTraversal(e)},t.prototype.isEqual=function(e){if(e instanceof t){for(var n=this.internalValue.getIterator(),r=e.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},t.prototype.compareTo=function(e){if(e instanceof t){for(var n=this.internalValue.getIterator(),r=e.internalValue.getIterator();n.hasNext()&&r.hasNext();){var i=n.getNext(),o=r.getNext(),s=K(i.key,o.key)||i.value.compareTo(o.value);if(s)return s}return K(n.hasNext(),r.hasNext())}return this.defaultCompareTo(e)},t.prototype.set=function(e,n){if(b(!e.isEmpty(),"Cannot set field for empty path on ObjectValue"),1===e.length)return this.setChild(e.firstSegment(),n);var r=this.child(e.firstSegment());r instanceof t||(r=t.EMPTY);var i=r.set(e.popFirst(),n);return this.setChild(e.firstSegment(),i)},t.prototype.delete=function(e){if(b(!e.isEmpty(),"Cannot delete field for empty path on ObjectValue"),1===e.length)return new t(this.internalValue.remove(e.firstSegment()));var n=this.child(e.firstSegment());if(n instanceof t){var r=n.delete(e.popFirst());return new t(this.internalValue.insert(e.firstSegment(),r))}return this},t.prototype.contains=function(e){return null!==this.field(e)},t.prototype.field=function(e){b(!e.isEmpty(),"Can't get field of empty path");var n=this;return e.forEach(function(e){n=n instanceof t?n.internalValue.get(e):null}),n},t.prototype.fieldMask=function(){var e=new xe(ue.comparator);return this.internalValue.forEach(function(n,r){var i=new ue([n]);if(r instanceof t){var o=r.fieldMask().fields;o.isEmpty()?e=e.add(i):o.forEach(function(t){e=e.add(i.child(t))})}else e=e.add(i)}),Pn.fromSet(e)},t.prototype.toString=function(){return this.internalValue.toString()},t.prototype.child=function(e){return this.internalValue.get(e)||void 0},t.prototype.setChild=function(e,n){return new t(this.internalValue.insert(e,n))},t.EMPTY=new t(new Ce(K)),t}(wn),Mn=function(e){function t(t){var n=e.call(this)||this;return n.internalValue=t,n.typeOrder=yn.ArrayValue,n}return s.__extends(t,e),t.prototype.value=function(e){return this.internalValue.map(function(t){return t.value(e)})},t.prototype.contains=function(e){for(var t=0,n=this.internalValue;t<n.length;t++)if(n[t].isEqual(e))return!0;return!1},t.prototype.forEach=function(e){this.internalValue.forEach(e)},t.prototype.isEqual=function(e){if(e instanceof t){if(this.internalValue.length!==e.internalValue.length)return!1;for(var n=0;n<this.internalValue.length;n++)if(!this.internalValue[n].isEqual(e.internalValue[n]))return!1;return!0}return!1},t.prototype.compareTo=function(e){if(e instanceof t){for(var n=Math.min(this.internalValue.length,e.internalValue.length),r=0;r<n;r++){var i=this.internalValue[r].compareTo(e.internalValue[r]);if(i)return i}return K(this.internalValue.length,e.internalValue.length)}return this.defaultCompareTo(e)},t.prototype.toString=function(){return"["+this.internalValue.map(function(e){return e.toString()}).join(",")+"]"},t}(wn),Pn=function(){function e(e){this.fields=e}return e.fromSet=function(t){return new e(t)},e.fromArray=function(t){var n=new xe(ue.comparator);return t.forEach(function(e){return n=n.add(e)}),new e(n)},e.prototype.covers=function(e){var t=!1;return this.fields.forEach(function(n){n.isPrefixOf(e)&&(t=!0)}),t},e.prototype.isEqual=function(e){return this.fields.isEqual(e.fields)},e}(),Ln=function(){function e(e,t){this.field=e,this.transform=t}return e.prototype.isEqual=function(e){return this.field.isEqual(e.field)&&this.transform.isEqual(e.transform)},e}(),Fn=function(){return function(e,t){this.version=e,this.transformResults=t}}(),jn=function(e){return e[e.Set=0]="Set",e[e.Patch=1]="Patch",e[e.Transform=2]="Transform",e[e.Delete=3]="Delete",e}({}),Vn=function(){function e(e,t){this.updateTime=e,this.exists=t,b(void 0===e||void 0===t,'Precondition can specify "exists" or "updateTime" but not both')}return e.exists=function(t){return new e(void 0,t)},e.updateTime=function(t){return new e(t)},Object.defineProperty(e.prototype,"isNone",{get:function(){return void 0===this.updateTime&&void 0===this.exists},enumerable:!0,configurable:!0}),e.prototype.isValidFor=function(e){return void 0!==this.updateTime?e instanceof pt&&e.version.isEqual(this.updateTime):void 0!==this.exists?this.exists===e instanceof pt:(b(this.isNone,"Precondition should be empty"),!0)},e.prototype.isEqual=function(e){return n=e.updateTime,(null!=(t=this.updateTime)?!(!n||!t.isEqual(n)):t===n)&&this.exists===e.exists;var t,n},e.NONE=new e,e}(),Un=function(){function e(){}return e.prototype.verifyKeyMatches=function(e){null!=e&&b(e.key.isEqual(this.key),"Can only apply a mutation to a document with the same key")},e.getPostMutationVersion=function(e){return e instanceof pt?e.ver
1sion:Ee.MIN},e}(),qn=function(e){function t(t,n,r){var i=e.call(this)||this;return i.key=t,i.value=n,i.precondition=r,i.type=jn.Set,i}return s.__extends(t,e),t.prototype.applyToRemoteDocument=function(e,t){return this.verifyKeyMatches(e),b(null==t.transformResults,"Transform results received by SetMutation."),new pt(this.key,t.version,this.value,{hasCommittedMutations:!0})},t.prototype.applyToLocalView=function(e,t,n){if(this.verifyKeyMatches(e),!this.precondition.isValidFor(e))return e;var r=Un.getPostMutationVersion(e);return new pt(this.key,r,this.value,{hasLocalMutations:!0})},t.prototype.extractBaseValue=function(e){return null},t.prototype.isEqual=function(e){return e instanceof t&&this.key.isEqual(e.key)&&this.value.isEqual(e.value)&&this.precondition.isEqual(e.precondition)},t}(Un),Bn=function(e){function t(t,n,r,i){var o=e.call(this)||this;return o.key=t,o.data=n,o.fieldMask=r,o.precondition=i,o.type=jn.Patch,o}return s.__extends(t,e),t.prototype.applyToRemoteDocument=function(e,t){if(this.verifyKeyMatches(e),b(null==t.transformResults,"Transform results received by PatchMutation."),!this.precondition.isValidFor(e))return new gt(this.key,t.version);var n=this.patchDocument(e);return new pt(this.key,t.version,n,{hasCommittedMutations:!0})},t.prototype.applyToLocalView=function(e,t,n){if(this.verifyKeyMatches(e),!this.precondition.isValidFor(e))return e;var r=Un.getPostMutationVersion(e),i=this.patchDocument(e);return new pt(this.key,r,i,{hasLocalMutations:!0})},t.prototype.extractBaseValue=function(e){return null},t.prototype.isEqual=function(e){return e instanceof t&&this.key.isEqual(e.key)&&this.fieldMask.isEqual(e.fieldMask)&&this.precondition.isEqual(e.precondition)},t.prototype.patchDocument=function(e){return this.patchObject(e instanceof pt?e.data:Rn.EMPTY)},t.prototype.patchObject=function(e){var t=this;return this.fieldMask.fields.forEach(function(n){if(!n.isEmpty()){var r=t.data.field(n);e=null!==r?e.set(n,r):e.delete(n)}}),e},t}(Un),Hn=function(e){function t(t,n){var r=e.call(this)||this;return r.key=t,r.fieldTransforms=n,r.type=jn.Transform,r.precondition=Vn.exists(!0),r}return s.__extends(t,e),t.prototype.applyToRemoteDocument=function(e,t){if(this.verifyKeyMatches(e),b(null!=t.transformResults,"Transform results missing for TransformMutation."),!this.precondition.isValidFor(e))return new gt(this.key,t.version);var n=this.requireDocument(e),r=this.serverTransformResults(e,t.transformResults),i=t.version,o=this.transformObject(n.data,r);return new pt(this.key,i,o,{hasCommittedMutations:!0})},t.prototype.applyToLocalView=function(e,t,n){if(this.verifyKeyMatches(e),!this.precondition.isValidFor(e))return e;var r=this.requireDocument(e),i=this.localTransformResults(n,e,t),o=this.transformObject(r.data,i);return new pt(this.key,r.version,o,{hasLocalMutations:!0})},t.prototype.extractBaseValue=function(e){for(var t=null,n=0,r=this.fieldTransforms;n<r.length;n++){var i=r[n],o=e instanceof pt?e.field(i.field):void 0,s=i.transform.computeBaseValue(o||null);null!=s&&(t=null==t?Rn.EMPTY.set(i.field,s):t.set(i.field,s))}return t},t.prototype.isEqual=function(e){return e instanceof t&&this.key.isEqual(e.key)&&$(this.fieldTransforms,e.fieldTransforms)&&this.precondition.isEqual(e.precondition)},t.prototype.requireDocument=function(e){b(e instanceof pt,"Unknown MaybeDocument type "+e);var t=e;return b(t.key.isEqual(this.key),"Can only transform a document with the same key"),t},t.prototype.serverTransformResults=function(e,t){var n=[];b(this.fieldTransforms.length===t.length,"server transform result count ("+t.length+") should match field transform count ("+this.fieldTransforms.length+")");for(var r=0;r<t.length;r++){var i=this.fieldTransforms[r],o=i.transform,s=null;e instanceof pt&&(s=e.field(i.field)),n.push(o.applyToRemoteDocument(s,t[r]))}return n},t.prototype.localTransformResults=function(e,t,n){for(var r=[],i=0,o=this.fieldTransforms;i<o.length;i++){var s=o[i],a=s.transform,u=null;t instanceof pt&&(u=t.field(s.field)),null===u&&n instanceof pt&&(u=n.field(s.field)),r.push(a.applyToLocalView(u,e))}return r},t.prototype.transformObject=function(e,t){b(t.length===this.fieldTransforms.length,"TransformResults length mismatch.");for(var n=0;n<this.fieldTransforms.length;n++)e=e.set(this.fieldTransforms[n].field,t[n]);return e},t}(Un),zn=function(e){function t(t,n){var r=e.call(this)||this;return r.key=t,r.precondition=n,r.type=jn.Delete,r}return s.__extends(t,e),t.prototype.applyToRemoteDocument=function(e,t){return this.verifyKeyMatches(e),b(null==t.transformResults,"Transform results received by DeleteMutation."),new mt(this.key,t.version,{hasCommittedMutations:!0})},t.prototype.applyToLocalView=function(e,t,n){return this.verifyKeyMatches(e),this.prec
1ondition.isValidFor(e)?(e&&b(e.key.isEqual(this.key),"Can only apply mutation to document with same key"),new mt(this.key,Ee.forDeletedDoc())):e},t.prototype.extractBaseValue=function(e){return null},t.prototype.isEqual=function(e){return e instanceof t&&this.key.isEqual(e.key)&&this.precondition.isEqual(e.precondition)},t}(Un),Wn=function(){function e(e,t,n){this.remoteDocumentCache=e,this.mutationQueue=t,this.indexManager=n}return e.prototype.getDocument=function(e,t){var n=this;return this.mutationQueue.getAllMutationBatchesAffectingDocumentKey(e,t).next(function(r){return n.getDocumentInternal(e,t,r)})},e.prototype.getDocumentInternal=function(e,t,n){return this.remoteDocumentCache.getEntry(e,t).next(function(e){for(var r=0,i=n;r<i.length;r++)e=i[r].applyToLocalView(t,e);return e})},e.prototype.applyLocalMutationsToDocuments=function(e,t,n){var r=Ne();return t.forEach(function(e,t){for(var i=0,o=n;i<o.length;i++)t=o[i].applyToLocalView(e,t);r=r.insert(e,t)}),r},e.prototype.getDocuments=function(e,t){var n=this;return this.remoteDocumentCache.getEntries(e,t).next(function(t){return n.getLocalViewOfDocuments(e,t)})},e.prototype.getLocalViewOfDocuments=function(e,t){var n=this;return this.mutationQueue.getAllMutationBatchesAffectingDocumentKeys(e,t).next(function(r){var i=n.applyLocalMutationsToDocuments(e,t,r),o=Oe();return i.forEach(function(e,t){t||(t=new mt(e,Ee.forDeletedDoc())),o=o.insert(e,t)}),o})},e.prototype.getDocumentsMatchingQuery=function(e,t){return t.isDocumentQuery()?this.getDocumentsMatchingDocumentQuery(e,t.path):t.isCollectionGroupQuery()?this.getDocumentsMatchingCollectionGroupQuery(e,t):this.getDocumentsMatchingCollectionQuery(e,t)},e.prototype.getDocumentsMatchingDocumentQuery=function(e,t){return this.getDocument(e,new le(t)).next(function(e){var t=Me();return e instanceof pt&&(t=t.insert(e.key,e)),t})},e.prototype.getDocumentsMatchingCollectionGroupQuery=function(e,t){var n=this;b(t.path.isEmpty(),"Currently we only support collection group queries at the root.");var r=t.collectionGroup,i=Me();return this.indexManager.getCollectionParents(e,r).next(function(o){return He.forEach(o,function(o){var s=t.asCollectionQueryAtPath(o.child(r));return n.getDocumentsMatchingCollectionQuery(e,s).next(function(e){e.forEach(function(e,t){i=i.insert(e,t)})})}).next(function(){return i})})},e.prototype.getDocumentsMatchingCollectionQuery=function(e,t){var n,r,i=this;return this.remoteDocumentCache.getDocumentsMatchingQuery(e,t).next(function(r){return n=r,i.mutationQueue.getAllMutationBatchesAffectingQuery(e,t)}).next(function(t){return i.addMissingBaseDocuments(e,r=t,n).next(function(e){n=e;for(var t=0,i=r;t<i.length;t++)for(var o=i[t],s=0,a=o.mutations;s<a.length;s++){var u=a[s],l=u.key,c=n.get(l),h=u.applyToLocalView(c,c,o.localWriteTime);n=h instanceof pt?n.insert(l,h):n.remove(l)}})}).next(function(){return n.forEach(function(e,r){t.matches(r)||(n=n.remove(e))}),n})},e.prototype.addMissingBaseDocuments=function(e,t,n){for(var r=je(),i=0,o=t;i<o.length;i++)for(var s=0,a=o[i].mutations;s<a.length;s++){var u=a[s];u instanceof Bn&&null===n.get(u.key)&&(r=r.add(u.key))}var l=n;return this.remoteDocumentCache.getEntries(e,r).next(function(e){return e.forEach(function(e,t){null!==t&&t instanceof pt&&(l=l.insert(e,t))}),l})},e}(),Qn=function(){function e(){this.refsByKey=new xe(Gn.compareByKey),this.refsByTarget=new xe(Gn.compareByTargetId)}return e.prototype.isEmpty=function(){return this.refsByKey.isEmpty()},e.prototype.addReference=function(e,t){var n=new Gn(e,t);this.refsByKey=this.refsByKey.add(n),this.refsByTarget=this.refsByTarget.add(n)},e.prototype.addReferences=function(e,t){var n=this;e.forEach(function(e){return n.addReference(e,t)})},e.prototype.removeReference=function(e,t){this.removeRef(new Gn(e,t))},e.prototype.removeReferences=function(e,t){var n=this;e.forEach(function(e){return n.removeReference(e,t)})},e.prototype.removeReferencesForId=function(e){var t=this,n=le.EMPTY,r=new Gn(n,e),i=new Gn(n,e+1),o=[];return this.refsByTarget.forEachInRange([r,i],function(e){t.removeRef(e),o.push(e.key)}),o},e.prototype.removeAllReferences=function(){var e=this;
1this.refsByKey.forEach(function(t){return e.removeRef(t)})},e.prototype.removeRef=function(e){this.refsByKey=this.refsByKey.delete(e),this.refsByTarget=this.refsByTarget.delete(e)},e.prototype.referencesForId=function(e){var t=le.EMPTY,n=new Gn(t,e),r=new Gn(t,e+1),i=je();return this.refsByTarget.forEachInRange([n,r],function(e){i=i.add(e.key)}),i},e.prototype.containsKey=function(e){var t=new Gn(e,0),n=this.refsByKey.firstAfterOrEqual(t);return null!==n&&e.isEqual(n.key)},e}(),Gn=function(){function e(e,t){this.key=e,this.targetOrBatchId=t}return e.compareByKey=function(e,t){return le.comparator(e.key,t.key)||K(e.targetOrBatchId,t.targetOrBatchId)},e.compareByTargetId=function(e,t){return K(e.targetOrBatchId,t.targetOrBatchId)||le.comparator(e.key,t.key)},e}(),Kn=function(){function e(e,t){this.persistence=e,this.localViewReferences=new Qn,this.queryDataByTarget={},b(e.started,"LocalStore was passed an unstarted persistence implementation"),this.persistence.referenceDelegate.setInMemoryPins(this.localViewReferences),this.mutationQueue=e.getMutationQueue(t),this.remoteDocuments=e.getRemoteDocumentCache(),this.queryCache=e.getQueryCache(),this.localDocuments=new Wn(this.remoteDocuments,this.mutationQueue,this.persistence.getIndexManager())}return e.prototype.handleUserChange=function(e){var t=this;return this.persistence.runTransaction("Handle user change","readonly",function(n){var r;return t.mutationQueue.getAllMutationBatches(n).next(function(i){return r=i,t.mutationQueue=t.persistence.getMutationQueue(e),t.localDocuments=new Wn(t.remoteDocuments,t.mutationQueue,t.persistence.getIndexManager()),t.mutationQueue.getAllMutationBatches(n)}).next(function(e){for(var i=[],o=[],s=je(),a=0,u=r;a<u.length;a++){i.push((f=u[a]).batchId);for(var l=0,c=f.mutations;l<c.length;l++)s=s.add(c[l].key)}for(var h=0,d=e;h<d.length;h++){var f;o.push((f=d[h]).batchId);for(var p=0,m=f.mutations;p<m.length;p++)s=s.add(m[p].key)}return t.localDocuments.getDocuments(n,s).next(function(e){return{affectedDocuments:e,removedBatchIds:i,addedBatchIds:o}})})})},e.prototype.localWrite=function(e){var t=this,n=Se.now(),r=e.reduce(function(e,t){return e.add(t.key)},je());return this.persistence.runTransaction("Locally write mutations","readwrite",function(i){return t.localDocuments.getDocuments(i,r).next(function(r){for(var o=[],s=0,a=e;s<a.length;s++){var u=a[s],l=u.extractBaseValue(r.get(u.key));null!=l&&o.push(new Bn(u.key,l,l.fieldMask(),Vn.exists(!0)))}return t.mutationQueue.addMutationBatch(i,n,o,e).next(function(e){var t=e.applyToLocalDocumentSet(r);return{batchId:e.batchId,changes:t}})})})},e.prototype.lookupMutationDocuments=function(e){var t=this;return this.persistence.runTransaction("Lookup mutation documents","readonly",function(n){return t.mutationQueue.lookupMutationKeys(n,e).next(function(e){return e?t.localDocuments.getDocuments(n,e):He.resolve(null)})})},e.prototype.acknowledgeBatch=function(e){var t=this;return this.persistence.runTransaction("Acknowledge batch","readwrite-primary",function(n){var r=e.batch.keys(),i=t.remoteDocuments.newChangeBuffer();return t.mutationQueue.acknowledgeBatch(n,e.batch,e.streamToken).next(function(){return t.applyWriteToRemoteDocuments(n,e,i)}).next(function(){return i.apply(n)}).next(function(){return t.mutationQueue.performConsistencyCheck(n)}).next(function(){return t.localDocuments.getDocuments(n,r)})})},e.prototype.rejectBatch=function(e){var t=this;return this.persistence.runTransaction("Reject batch","readwrite-primary",function(n){var r;return t.mutationQueue.lookupMutationBatch(n,e).next(function(e){return b(null!==e,"Attempt to reject nonexistent batch!"),r=e.keys(),t.mutationQueue.removeMutationBatch(n,e)}).next(function(){return t.mutationQueue.performConsistencyCheck(n)}).next(function(){return t.localDocuments.getDocuments(n,r)})})},e.prototype.getLastStreamToken=function(){var e=this;return this.persistence.runTransaction("Get last stream token","readonly",function(t){return e.mutationQueue.getLastStreamToken(t)})},e.prototype.setLastStreamToken=function(e){var t=this;return this.persistence.runTransaction("Set last stream token","readwrite-primary",function(n){return t.mutation
1Queue.setLastStreamToken(n,e)})},e.prototype.getLastRemoteSnapshotVersion=function(){var e=this;return this.persistence.runTransaction("Get last remote snapshot version","readonly",function(t){return e.queryCache.getLastRemoteSnapshotVersion(t)})},e.prototype.applyRemoteEvent=function(t){var n=this,r=this.remoteDocuments.newChangeBuffer();return this.persistence.runTransaction("Apply remote event","readwrite-primary",function(i){var o=[],s=je();I(t.targetChanges,function(r,a){var u=n.queryDataByTarget[r];if(u){a.addedDocuments.forEach(function(e){s=s.add(e)}),a.modifiedDocuments.forEach(function(e){s=s.add(e)}),o.push(n.queryCache.removeMatchingKeys(i,a.removedDocuments,r).next(function(){return n.queryCache.addMatchingKeys(i,a.addedDocuments,r)}));var l=a.resumeToken;if(l.length>0){var c=u;u=u.copy({resumeToken:l,snapshotVersion:t.snapshotVersion}),n.queryDataByTarget[r]=u,e.shouldPersistQueryData(c,u,a)&&o.push(n.queryCache.updateQueryData(i,u))}}});var a=Oe(),u=je();t.documentUpdates.forEach(function(e,t){u=u.add(e)}),o.push(r.getEntries(i,u).next(function(e){t.documentUpdates.forEach(function(u,l){var c=e.get(u);null==c||l.version.isEqual(Ee.MIN)||s.has(l.key)&&!c.hasPendingWrites||l.version.compareTo(c.version)>=0?(r.addEntry(l),a=a.insert(u,l)):p("LocalStore","Ignoring outdated watch update for ",u,". Current version:",c.version," Watch version:",l.version),t.resolvedLimboDocuments.has(u)&&o.push(n.persistence.referenceDelegate.updateLimboDocument(i,u))})}));var l=t.snapshotVersion;if(!l.isEqual(Ee.MIN)){var c=n.queryCache.getLastRemoteSnapshotVersion(i).next(function(e){return b(l.compareTo(e)>=0,"Watch stream reverted to previous snapshot?? "+l+" < "+e),n.queryCache.setTargetsMetadata(i,i.currentSequenceNumber,l)});o.push(c)}return He.waitFor(o).next(function(){return r.apply(i)}).next(function(){return n.localDocuments.getLocalViewOfDocuments(i,a)})})},e.shouldPersistQueryData=function(e,t,n){return 0!==t.resumeToken.length&&(0===e.resumeToken.length||t.snapshotVersion.toMicroseconds()-e.snapshotVersion.toMicroseconds()>=this.RESUME_TOKEN_MAX_AGE_MICROS||n.addedDocuments.size+n.modifiedDocuments.size+n.removedDocuments.size>0)},e.prototype.notifyLocalViewChanges=function(e){var t=this;return this.persistence.runTransaction("notifyLocalViewChanges","readwrite",function(n){return He.forEach(e,function(e){return t.localViewReferences.addReferences(e.addedKeys,e.targetId),t.localViewReferences.removeReferences(e.removedKeys,e.targetId),He.forEach(e.removedKeys,function(e){return t.persistence.referenceDelegate.removeReference(n,e)})})})},e.prototype.nextMutationBatch=function(e){var t=this;return this.persistence.runTransaction("Get next mutation batch","readonly",function(n){return void 0===e&&(e=-1),t.mutationQueue.getNextMutationBatchAfterBatchId(n,e)})},e.prototype.readDocument=function(e){var t=this;return this.persistence.runTransaction("read document","readonly",function(n){return t.localDocuments.getDocument(n,e)})},e.prototype.allocateQuery=function(e){var t=this;return this.persistence.runTransaction("Allocate query","readwrite",function(n){var r;return t.queryCache.getQueryData(n,e).next(function(i){return i?(r=i,He.resolve()):t.queryCache.allocateTargetId(n).next(function(i){return r=new Zt(e,i,Yt.Listen,n.currentSequenceNumber),t.queryCache.addQueryData(n,r)})}).next(function(){return b(!t.queryDataByTarget[r.targetId],"Tried to allocate an already allocated query: "+e),t.queryDataByTarget[r.targetId]=r,r})})},e.prototype.releaseQuery=function(e,t){var n=this;return this.persistence.runTransaction("Release query",t?"readwrite":"readwrite-primary",function(r){return n.queryCache.getQueryData(r,e).next(function(i){b(null!=i,"Tried to release nonexistent query: "+e);var o=i.targetId,s=n.queryDataByTarget[o],a=n.localViewReferences.removeReferencesForId(o);return delete n.queryDataByTarget[o],t?He.resolve():He.forEach(a,function(e){return n.persistence.referenceDelegate.removeReference(r,e)}).next(function(){return n.persistence.referenceDelegate.removeTarget(r,s)})})})},e.prototype.executeQuery=function(e){var t=this;
1return this.persistence.runTransaction("Execute query","readonly",function(n){return t.localDocuments.getDocumentsMatchingQuery(n,e)})},e.prototype.remoteDocumentKeys=function(e){var t=this;return this.persistence.runTransaction("Remote document keys","readonly",function(n){return t.queryCache.getMatchingKeysForTargetId(n,e)})},e.prototype.getActiveClients=function(){return this.persistence.getActiveClients()},e.prototype.removeCachedMutationBatchMetadata=function(e){this.mutationQueue.removeCachedMutationKeys(e)},e.prototype.setNetworkEnabled=function(e){this.persistence.setNetworkEnabled(e)},e.prototype.applyWriteToRemoteDocuments=function(e,t,n){var r=this,i=t.batch,o=i.keys(),s=He.resolve();return o.forEach(function(r){s=s.next(function(){return n.getEntry(e,r)}).next(function(e){var o=e,s=t.docVersions.get(r);b(null!==s,"ackVersions should contain every doc in the write."),(!o||o.version.compareTo(s)<0)&&((o=i.applyToRemoteDocument(r,o,t))?n.addEntry(o):b(!e,"Mutation batch "+i+" applied to document "+e+" resulted in null"))})}),s.next(function(){return r.mutationQueue.removeMutationBatch(e,i)})},e.prototype.collectGarbage=function(e){var t=this;return this.persistence.runTransaction("Collect garbage","readwrite-primary",function(n){return e.collect(n,t.queryDataByTarget)})},e.prototype.getQueryForTarget=function(e){var t=this;return this.queryDataByTarget[e]?Promise.resolve(this.queryDataByTarget[e].query):this.persistence.runTransaction("Get query data","readonly",function(n){return t.queryCache.getQueryDataForTarget(n,e).next(function(e){return e?e.query:null})})},e.prototype.getNewDocumentChanges=function(){var e=this;return this.persistence.runTransaction("Get new document changes","readonly",function(t){return e.remoteDocuments.getNewDocumentChanges(t)})},e.RESUME_TOKEN_MAX_AGE_MICROS=3e8,e}(),$n=function(){function e(e,t){this.indexManager=e,this.referenceDelegate=t,this.mutationQueue=[],this.nextBatchId=1,this.lastStreamToken=w(),this.batchesByDocumentKey=new xe(Gn.compareByKey)}return e.prototype.checkEmpty=function(e){return He.resolve(0===this.mutationQueue.length)},e.prototype.acknowledgeBatch=function(e,t,n){var r=t.batchId,i=this.indexOfExistingBatchId(r,"acknowledged");b(0===i,"Can only acknowledge the first batch in the mutation queue");var o=this.mutationQueue[i];return b(r===o.batchId,"Queue ordering failure: expected batch "+r+", got batch "+o.batchId),this.lastStreamToken=n,He.resolve()},e.prototype.getLastStreamToken=function(e){return He.resolve(this.lastStreamToken)},e.prototype.setLastStreamToken=function(e,t){return this.lastStreamToken=t,He.resolve()},e.prototype.addMutationBatch=function(e,t,n,r){b(0!==r.length,"Mutation batches should not be empty");var i=this.nextBatchId;this.nextBatchId++,this.mutationQueue.length>0&&b(this.mutationQueue[this.mutationQueue.length-1].batchId<i,"Mutation batchIDs must be monotonically increasing order");var o=new qe(i,t,n,r);this.mutationQueue.push(o);for(var s=0,a=r;s<a.length;s++){var u=a[s];this.batchesByDocumentKey=this.batchesByDocumentKey.add(new Gn(u.key,i)),this.indexManager.addToCollectionParentIndex(e,u.key.path.popLast())}return He.resolve(o)},e.prototype.lookupMutationBatch=function(e,t){return He.resolve(this.findMutationBatch(t))},e.prototype.lookupMutationKeys=function(e,t){var n=this.findMutationBatch(t);return b(null!=n,"Failed to find local mutation batch."),He.resolve(n.keys())},e.prototype.getNextMutationBatchAfterBatchId=function(e,t){var n=this.indexOfBatchId(t+1),r=n<0?0:n;return He.resolve(this.mutationQueue.length>r?this.mutationQueue[r]:null)},e.prototype.getAllMutationBatches=function(e){return He.resolve(this.mutationQueue.slice())},e.prototype.getAllMutationBatchesAffectingDocumentKey=function(e,t){var n=this,r=new Gn(t,0),i=new Gn(t,Number.POSITIVE_INFINITY),o=[];return this.batchesByDocumentKey.forEachInRange([r,i],function(e){b(t.isEqual(e.key),"Should only iterate over a single key's batches");var r=n.findMutationBatch(e.targetOrBatchId);b(null!==r,"Batches in the index must exist in the main table"),o.push(r)}),He.resolve(o)},e.prototype.getAllMutationBatchesAffectingDocumentKeys=function(e,t){var n=this,r=new xe(K);return t.forEach(function(e){var t=new Gn(e,0),i=new Gn(e,Number.POSITIVE_INFINITY);
1n.batchesByDocumentKey.forEachInRange([t,i],function(t){b(e.isEqual(t.key),"For each key, should only iterate over a single key's batches"),r=r.add(t.targetOrBatchId)})}),He.resolve(this.findMutationBatches(r))},e.prototype.getAllMutationBatchesAffectingQuery=function(e,t){b(!t.isCollectionGroupQuery(),"CollectionGroup queries should be handled in LocalDocumentsView");var n=t.path,r=n.length+1,i=n;le.isDocumentKey(i)||(i=i.child(""));var o=new Gn(new le(i),0),s=new xe(K);return this.batchesByDocumentKey.forEachWhile(function(e){var t=e.key.path;return!!n.isPrefixOf(t)&&(t.length===r&&(s=s.add(e.targetOrBatchId)),!0)},o),He.resolve(this.findMutationBatches(s))},e.prototype.findMutationBatches=function(e){var t=this,n=[];return e.forEach(function(e){var r=t.findMutationBatch(e);null!==r&&n.push(r)}),n},e.prototype.removeMutationBatch=function(e,t){var n=this;b(0===this.indexOfExistingBatchId(t.batchId,"removed"),"Can only remove the first entry of the mutation queue"),this.mutationQueue.shift();var r=this.batchesByDocumentKey;return He.forEach(t.mutations,function(i){var o=new Gn(i.key,t.batchId);return r=r.delete(o),n.referenceDelegate.removeMutationReference(e,i.key)}).next(function(){n.batchesByDocumentKey=r})},e.prototype.removeCachedMutationKeys=function(e){},e.prototype.containsKey=function(e,t){var n=new Gn(t,0),r=this.batchesByDocumentKey.firstAfterOrEqual(n);return He.resolve(t.isEqual(r&&r.key))},e.prototype.performConsistencyCheck=function(e){return 0===this.mutationQueue.length&&b(this.batchesByDocumentKey.isEmpty(),"Document leak -- detected dangling mutation references when queue is empty."),He.resolve()},e.prototype.indexOfExistingBatchId=function(e,t){var n=this.indexOfBatchId(e);return b(n>=0&&n<this.mutationQueue.length,"Batches must exist to be "+t),n},e.prototype.indexOfBatchId=function(e){return 0===this.mutationQueue.length?0:e-this.mutationQueue[0].batchId},e.prototype.findMutationBatch=function(e){var t=this.indexOfBatchId(e);if(t<0||t>=this.mutationQueue.length)return null;var n=this.mutationQueue[t];return b(n.batchId===e,"If found batch must match"),n},e}(),Yn=function(){function e(e){this.persistence=e,this.queries=new yt(function(e){return e.canonicalId()}),this.lastRemoteSnapshotVersion=Ee.MIN,this.highestTargetId=0,this.highestSequenceNumber=0,this.references=new Qn,this.targetCount=0,this.targetIdGenerator=Xe.forQueryCache()}return e.prototype.getTargetCount=function(e){return He.resolve(this.targetCount)},e.prototype.forEachTarget=function(e,t){return this.queries.forEach(function(e,n){return t(n)}),He.resolve()},e.prototype.getLastRemoteSnapshotVersion=function(e){return He.resolve(this.lastRemoteSnapshotVersion)},e.prototype.getHighestSequenceNumber=function(e){return He.resolve(this.highestSequenceNumber)},e.prototype.allocateTargetId=function(e){var t=this.targetIdGenerator.after(this.highestTargetId);return this.highestTargetId=t,He.resolve(t)},e.prototype.setTargetsMetadata=function(e,t,n){return n&&(this.lastRemoteSnapshotVersion=n),t>this.highestSequenceNumber&&(this.highestSequenceNumber=t),He.resolve()},e.prototype.saveQueryData=function(e){this.queries.set(e.query,e);var t=e.targetId;t>this.highestTargetId&&(this.highestTargetId=t),e.sequenceNumber>this.highestSequenceNumber&&(this.highestSequenceNumber=e.sequenceNumber)},e.prototype.addQueryData=function(e,t){return b(!this.queries.has(t.query),"Adding a query that already exists"),this.saveQueryData(t),this.targetCount+=1,He.resolve()},e.prototype.updateQueryData=function(e,t){return b(this.queries.has(t.query),"Updating a non-existent query"),this.saveQueryData(t),He.resolve()},e.prototype.removeQueryData=function(e,t){return b(this.targetCount>0,"Removing a target from an empty cache"),b(this.queries.has(t.query),"Removing a non-existent target from the cache"),this.queries.delete(t.query),this.references.removeReferencesForId(t.targetId),this.targetCount-=1,He.resolve()},e.prototype.removeTargets=function(e,t,n){var r=this,i=0,o=[];return this.queries.forEach(function(s,a){a.sequenceNumber<=t&&!n[a.targetId]&&(r.queries.delete(s),o.push(r.removeMatchingKeysForTargetId(e,a.targetId)),i++)}),He.waitFor(o).next(function(){return i})},e.prototype.getQueryCount=function(e){return He.resolve(this.targetCount)},e.prototype.getQueryData=function(e,t){var n=this.queries.get(t)||null;return He.resolve(n)},e.prototype.getQueryDataForTarget=function(e,t){return y("Not yet implemented.")},e.prototype.addMatchingKeys=function(e,t,n){this.references.addReferences(t,n);var r=this.persistence.referenceDelegate,i=[];return r&&t.forEach(function(t){i.push(r.addReference(e,t))}),He.waitFor(i)},e.prototype.removeMatchingKeys=function(e,t,n){this.references.removeReferences(t,n);var r=this.persistence.referenceDelegate,i=[];return r&&t.forEach(function(t){i.push(r.removeReference(e,t))}),He.waitFor(i)},e.prototype.removeMatchingKeysForTargetId=function(e,t){return this.references.removeReferencesForId(t),He.resolve()},e.prototype.getMatchingKeysForTargetId=function(e,t){var n=this.references.referencesForId(t);return He.resolve(n)},e.prototype.containsKey=function(e,t){return He.resolve(this.references.containsKey(t))},e}(),Zn=function(){function e(e,t){this.indexManager=e,this.sizer=t,this.docs=new Ce(le.comparator),this.newDocumentChanges=je(),this.size=0}return e.prototype.addEntries=function(e,t,n){for(var r=[],i=0,o=t;i<o.length;i++){var s=o[i],a=s.maybeDocument.key;this.docs=this.docs.insert(a,s),this.newDocumentChanges=this.newDocumentChanges.add(a),r.push(this.indexManager.addToCollectionParentIndex(e,a.path.popLast()))}return this.size+=n,He.waitFor(r)},e.prototype.removeEntry=function(e,t){var n=this.docs.get(t);return n?(this.docs=this.docs.remove(t),this.size-=n.size,He.resolve(n.size)):He.resolve(0)},e.prototype.getEntry=function(e,t){var n=this.docs.get(t);return He.resolve(n?n.maybeDocument:null)},e.prototype.getSizedEntry=function(e,t){return He.resolve(this.docs.get(t))},e.prototype.getEntries=function(e,t){var n=this,r=Ne();return t.forEach(function(e){var t=n.docs.get(e);r=r.insert(e,t?t.maybeDocument:null)}),He.resolve(r)},e.prototype.getSizedEntries=function(e,t){var n=this,r=Ne(),i=new Ce(le.comparator);return t.forEach(function(e){var t=n.docs.get(e);r=r.insert(e,t?t.maybeDocument:null),i=i.insert(e,t?t.size:0)}),He.resolve({maybeDocuments:r,sizeMap:i})},e.prototype.getDocumentsMatchingQuery=function(e,t){b(!t.isCollectionGroupQuery(),"CollectionGroup queries should be handled in LocalDocumentsView");for(var n=Me(),r=new le(t.path.child("")),i=this.docs.getIteratorFrom(r);i.hasNext();){var o=i.getNext(),s=o.value.maybeDocument;if(!t.path.isPrefixOf(o.key.path))break;s instanceof pt&&t.matches(s)&&(n=n.insert(s.key,s))}return He.resolve(n)},e.prototype.forEachDocumentKey=function(e,t){return He.forEach(this.docs,function(e){return t(e)})},e.prototype.getNewDocumentChanges=function(e){var t=this,n=Oe();
1return this.newDocumentChanges.forEach(function(e){var r=t.docs.get(e),i=r?r.maybeDocument:new mt(e,Ee.forDeletedDoc());n=n.insert(e,i)}),this.newDocumentChanges=je(),He.resolve(n)},e.prototype.newChangeBuffer=function(){return new Jn(this.sizer,this)},e.prototype.getSize=function(e){return He.resolve(this.size)},e}(),Jn=function(e){function t(t,n){var r=e.call(this)||this;return r.sizer=t,r.documentCache=n,r}return s.__extends(t,e),t.prototype.applyChanges=function(e){var t=this,n=this.assertChanges(),r=0,i=[];return n.forEach(function(e,n){var o=t.documentSizes.get(e);b(void 0!==o,"Attempting to change document "+e.toString()+" without having read it first");var s=t.sizer(n);r+=s-o,i.push({maybeDocument:n,size:s})}),this.documentCache.addEntries(e,i,r)},t.prototype.getFromCache=function(e,t){return this.documentCache.getSizedEntry(e,t)},t.prototype.getAllFromCache=function(e,t){return this.documentCache.getSizedEntries(e,t)},t}(bt),Xn=function(){function e(e,t){var n=this;this.clientId=e,this.mutationQueues={},this.listenSequence=new ie(0),this._started=!1,this._started=!0,this.referenceDelegate=t(this),this.queryCache=new Yn(this),this.indexManager=new Dt,this.remoteDocumentCache=new Zn(this.indexManager,function(e){return n.referenceDelegate.documentSize(e)})}return e.createLruPersistence=function(t,n,r){return new e(t,function(e){return new nr(e,new Jt(n),r)})},e.createEagerPersistence=function(t){return new e(t,function(e){return new tr(e)})},e.prototype.shutdown=function(){return this._started=!1,Promise.resolve()},Object.defineProperty(e.prototype,"started",{get:function(){return this._started},enumerable:!0,configurable:!0}),e.prototype.getActiveClients=function(){return s.__awaiter(this,void 0,void 0,function(){return s.__generator(this,function(e){return[2,[this.clientId]]})})},e.prototype.setPrimaryStateListener=function(e){return e(!0)},e.prototype.setDatabaseDeletedListener=function(){},e.prototype.setNetworkEnabled=function(e){},e.prototype.getIndexManager=function(){return this.indexManager},e.prototype.getMutationQueue=function(e){var t=this.mutationQueues[e.toKey()];return t||(t=new $n(this.indexManager,this.referenceDelegate),this.mutationQueues[e.toKey()]=t),t},e.prototype.getQueryCache=function(){return this.queryCache},e.prototype.getRemoteDocumentCache=function(){return this.remoteDocumentCache},e.prototype.runTransaction=function(e,t,n){var r=this;p("MemoryPersistence","Starting transaction:",e);var i=new er(this.listenSequence.next());return this.referenceDelegate.onTransactionStarted(),n(i).next(function(e){return r.referenceDelegate.onTransactionCommitted(i).next(function(){return e})}).toPromise()},e.prototype.mutationQueuesContainKey=function(e,t){return He.or((n=this.mutationQueues,r=[],D(n,function(e,t){return r.push(t)}),r).map(function(n){return function(){return n.containsKey(e,t)}}));var n,r},e}(),er=function(){return function(e){this.currentSequenceNumber=e}}(),tr=function(){function e(e){this.persistence=e}return e.prototype.setInMemoryPins=function(e){this.inMemoryPins=e},e.prototype.addReference=function(e,t){return this.orphanedDocuments.delete(t),He.resolve()},e.prototype.removeReference=function(e,t){return this.orphanedDocuments.add(t),He.resolve()},e.prototype.removeMutationReference=function(e,t){return this.orphanedDocuments.add(t),He.resolve()},e.prototype.removeTarget=function(e,t){var n=this,r=this.persistence.getQueryCache();return r.getMatchingKeysForTargetId(e,t.targetId).next(function(e){e.forEach(function(e){return n.orphanedDocuments.add(e)})}).next(function(){return r.removeQueryData(e,t)})},e.prototype.onTransactionStarted=function(){this.orphanedDocuments=new Set},e.prototype.onTransactionCommitted=function(e){var t=this,n=this.persistence.getRemoteDocumentCache();return He.forEach(this.orphanedDocuments,function(r){return t.isReferenced(e,r).next(function(t){return t?He.resolve():n.removeEntry(e,r).next(function(){})})})},e.prototype.updateLimboDocument=function(e,t){var n=this;return this.isReferenced(e,t).next(function(e){e?n.orphanedDocuments.delete(t):n.orphanedDocuments.add(t)})},e.prototype.documentSize=function(e){return 0},e.prototype.isReferenced=function(e,t){var n=this;return He.or([function(){return n.persistence.getQueryCache().containsKey(e,t)}
1,function(){return n.persistence.mutationQueuesContainKey(e,t)},function(){return He.resolve(n.inMemoryPins.containsKey(t))}])},e}(),nr=function(){function e(e,t,n){this.persistence=e,this.serializer=t,this.orphanedSequenceNumbers=new yt(function(e){return be(e.path)}),this.garbageCollector=new on(this,n)}return e.prototype.onTransactionStarted=function(){},e.prototype.onTransactionCommitted=function(e){return He.resolve()},e.prototype.forEachTarget=function(e,t){return this.persistence.getQueryCache().forEachTarget(e,t)},e.prototype.getSequenceNumberCount=function(e){var t=this.orphanedDocumentCount(e);return this.persistence.getQueryCache().getTargetCount(e).next(function(e){return t.next(function(t){return e+t})})},e.prototype.orphanedDocumentCount=function(e){var t=0;return this.forEachOrphanedDocumentSequenceNumber(e,function(e){t++}).next(function(){return t})},e.prototype.forEachOrphanedDocumentSequenceNumber=function(e,t){var n=this;return He.forEach(this.orphanedSequenceNumbers,function(r,i){return n.isPinned(e,r,i).next(function(e){return e?He.resolve():t(i)})})},e.prototype.setInMemoryPins=function(e){this.inMemoryPins=e},e.prototype.removeTargets=function(e,t,n){return this.persistence.getQueryCache().removeTargets(e,t,n)},e.prototype.removeOrphanedDocuments=function(e,t){var n=this,r=0,i=this.persistence.getRemoteDocumentCache();return i.forEachDocumentKey(e,function(o){return n.isPinned(e,o,t).next(function(t){return t?He.resolve():(r++,i.removeEntry(e,o).next())})}).next(function(){return r})},e.prototype.removeMutationReference=function(e,t){return this.orphanedSequenceNumbers.set(t,e.currentSequenceNumber),He.resolve()},e.prototype.removeTarget=function(e,t){var n=t.copy({sequenceNumber:e.currentSequenceNumber});return this.persistence.getQueryCache().updateQueryData(e,n)},e.prototype.addReference=function(e,t){return this.orphanedSequenceNumbers.set(t,e.currentSequenceNumber),He.resolve()},e.prototype.removeReference=function(e,t){return this.orphanedSequenceNumbers.set(t,e.currentSequenceNumber),He.resolve()},e.prototype.updateLimboDocument=function(e,t){return this.orphanedSequenceNumbers.set(t,e.currentSequenceNumber),He.resolve()},e.prototype.documentSize=function(e){var t,n=this.serializer.toDbRemoteDocument(e);if(n.document)t=n.document;else if(n.unknownDocument)t=n.unknownDocument;else{if(!n.noDocument)throw y("Unknown remote document type");t=n.noDocument}return JSON.stringify(t).length},e.prototype.isPinned=function(e,t,n){var r=this;return He.or([function(){return r.persistence.mutationQueuesContainKey(e,t)},function(){return He.resolve(r.inMemoryPins.containsKey(t))},function(){return r.persistence.getQueryCache().containsKey(e,t)},function(){var e=r.orphanedSequenceNumbers.get(t);return He.resolve(void 0!==e&&e>n)}])},e.prototype.getCacheSize=function(e){return this.persistence.getRemoteDocumentCache().getSize(e)},e}(),rr=Number,ir=rr.MIN_SAFE_INTEGER||-(Math.pow(2,53)-1),or=rr.MAX_SAFE_INTEGER||Math.pow(2,53)-1,sr=rr.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e};function ar(e){return null==e}function ur(e){return sr(e)&&e<=or&&e>=ir}var lr=function(){function e(e,t,n,r,i){this.queue=e,this.timerId=t,this.initialDelayMs=n,this.backoffFactor=r,this.maxDelayMs=i,this.timerPromise=null,this.lastAttemptTime=Date.now(),this.reset()}return e.prototype.reset=function(){this.currentBaseMs=0},e.prototype.resetToMax=function(){this.currentBaseMs=this.maxDelayMs},e.prototype.backoffAndRun=function(e){var t=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 t.lastAttemptTime=Date.now(),e()}),this.currentBaseMs*=this.backoffFactor,this.currentBaseMs<this.initialDelayMs&&(this.currentBaseMs=this.initialDelayMs),this.currentBaseMs>this.maxDelayMs&&(this.currentBaseMs=this.maxDelayMs)},e.prototype.cancel=function(){null!==this.timerPromise&&(this.timerPromise.cancel(),this.timerPromise=null)},e.prototype.jitterDelayMs=function(){return(Math.random()-.5)*this.currentBaseMs},e}(),cr=function(e){return e[e.Initial=0]="Initial",e[e.Starting=1]="Starting",e[e.Open=2]="Open",e[e.Error=3]="Error",e[e.Backoff=4]="Backoff",e}({}),hr=1e3,dr=6e4,fr=1.5,pr=function(){function e(e,t,n,r,i,o){this.queue=e,this.idleTimerId=n,this.connection=r,this.credentialsProvider=i,this.listener=o,this.state=cr.Initial,this.closeCount=0,this.idleTimer=null,this.stream=null,this.backoff=new lr(e,t,hr,fr,dr)}return e.prototype.isStarted=function(){return this.state===cr.Starting||this.state===cr.Open||this.state===cr.Backoff},e.prototype.isOpen=function(){return this.state===cr.Open},e.prototype.start=function(){this.state!==cr.Error?(b(this.state===cr.Initial,"Already started"),this.auth()):this.performBackoff()},e.prototype.stop=function(){return s.__awaiter(this,void 0,void 0,function(){return s.__generator(this,function(e){switch(e.label){case 0:return this.isStarted()?[4,this.close(cr.Initial)]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}})})},e.prototype.inhibitBackoff=function(){b(!this.isStarted(),"Can only inhibit backoff in a stopped state"),this.state=cr.Initial,this.backoff.reset()},e.prototype.markIdle=function(){var e=this;this.isOpen()&&null===this.idleTimer&&(this.idleTimer=this.queue.enqueueAfterDelay(this.idleTimerId,6e4,function(){return e.handleIdleCloseTimer()}))},e.prototype.sendRequest=function(e){this.cancelIdleCheck(),this.stream.send(e)},e.prototype.handleIdleCloseTimer=function(){return s.__awaiter(this,void 0,void 0,function(){return s.__generator(this,function(e){return this.isOpen()?[2,this.close(cr.Initial)]:[2]})})},e.prototype.cancelIdleCheck=function(){this.idleTimer&&(this.idleTimer.cancel(),this.idleTimer=null)},e.prototype.close=function(e,t){return s.__awaiter(this,void 0,void 0,function(){return s.__generator(this,function(n){switch(n.label){case 0:return b(this.isStarted(),"Only started streams should be closed."),b(e===cr.Error||ar(t),"Can't provide an error when not in an error state."),this.cancelIdleCheck(),this.backoff.cancel(),this.closeCount++,e!==cr.Error?this.backoff.reset():t&&t.code===_.RESOURCE_EXHAUSTED?(m(t.toString()),m("Using maximum backoff delay to prevent overloading the backend."),this.backoff.resetToMax()):t&&t.code===_.UNAUTHENTICATED&&this.credentialsProvider.invalidateToken(),null!==this.stream&&(this.tearDown(),this.stream.close(),this.stream=null),this.state=e,[4,this.listener.onClose(t)];case 1:return n.sent(),[2]}})})},e.prototype.tearDown=function(){},e.prototype.auth=function(){var e=this;b(this.state===cr.Initial,"Must be in initial state to auth"),this.state=cr.Starting;var t=this.getCloseGuardedDispatcher(this.closeCount),n=this.closeCount;this.credentialsProvider.getToken().then(function(t){e.closeCount===n&&e.startStream(t)},function(n){t(function(){var t=new S(_.UNKNOWN,"Fetching auth token failed: "+n.message);return e.handleStreamClose(t)})})},e.prototype.startStream=function(e){var t=this;b(this.state===cr.Starting,"Trying to start stream in a non-starting state");var n=this.getCloseGuardedDispatcher(this.closeCount);this.stream=this.startRpc(e),this.stream.onOpen(function(){n(function(){return b(t.state===cr.Starting,"Expected stream to be in state Starting, but was "+t.state),t.state=cr.Open,t.listener.onOpen()})}),this.stream.onClose(function(e){n(function(){return t.handleStreamClose(e)})}),this.stream.onMessage(function(e){n(function(){return t.onMessage(e)})})},e.prototype.performBackoff=function(){var e=this;
1b(this.state===cr.Error,"Should only perform backoff when in Error state"),this.state=cr.Backoff,this.backoff.backoffAndRun(function(){return s.__awaiter(e,void 0,void 0,function(){return s.__generator(this,function(e){return b(this.state===cr.Backoff,"Backoff elapsed but state is now: "+this.state),this.state=cr.Initial,this.start(),b(this.isStarted(),"PersistentStream should have started"),[2]})})})},e.prototype.handleStreamClose=function(e){return b(this.isStarted(),"Can't handle server close on non-started stream"),p("PersistentStream","close with error: "+e),this.stream=null,this.close(cr.Error,e)},e.prototype.getCloseGuardedDispatcher=function(e){var t=this;return function(n){t.queue.enqueueAndForget(function(){return t.closeCount===e?n():(p("PersistentStream","stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve())})}},e}(),mr=function(e){function t(t,n,r,i,o){var s=e.call(this,t,he.ListenStreamConnectionBackoff,he.ListenStreamIdle,n,r,o)||this;return s.serializer=i,s}return s.__extends(t,e),t.prototype.startRpc=function(e){return this.connection.openStream("Listen",e)},t.prototype.onMessage=function(e){this.backoff.reset();var t=this.serializer.fromWatchChange(e),n=this.serializer.versionFromListenResponse(e);return this.listener.onWatchChange(t,n)},t.prototype.watch=function(e){var t={};t.database=this.serializer.encodedDatabaseId,t.addTarget=this.serializer.toTarget(e);var n=this.serializer.toListenRequestLabels(e);n&&(t.labels=n),this.sendRequest(t)},t.prototype.unwatch=function(e){var t={};t.database=this.serializer.encodedDatabaseId,t.removeTarget=e,this.sendRequest(t)},t}(pr),gr=function(e){function t(t,n,r,i,o){var s=e.call(this,t,he.WriteStreamConnectionBackoff,he.WriteStreamIdle,n,r,o)||this;return s.serializer=i,s.handshakeComplete_=!1,s}return s.__extends(t,e),Object.defineProperty(t.prototype,"handshakeComplete",{get:function(){return this.handshakeComplete_},enumerable:!0,configurable:!0}),t.prototype.start=function(){this.handshakeComplete_=!1,e.prototype.start.call(this)},t.prototype.tearDown=function(){this.handshakeComplete_&&this.writeMutations([])},t.prototype.startRpc=function(e){return this.connection.openStream("Write",e)},t.prototype.onMessage=function(e){if(b(!!e.streamToken,"Got a write response without a stream token"),this.lastStreamToken=e.streamToken,this.handshakeComplete_){this.backoff.reset();var t=this.serializer.fromWriteResults(e.writeResults,e.commitTime),n=this.serializer.fromVersion(e.commitTime);return this.listener.onMutationResult(n,t)}return b(!e.writeResults||0===e.writeResults.length,"Got mutation results for handshake"),this.handshakeComplete_=!0,this.listener.onHandshakeComplete()},t.prototype.writeHandshake=function(){b(this.isOpen(),"Writing handshake requires an opened stream"),b(!this.handshakeComplete_,"Handshake already completed");var e={};e.database=this.serializer.encodedDatabaseId,this.sendRequest(e)},t.prototype.writeMutations=function(e){var t=this;b(this.isOpen(),"Writing mutations requires an opened stream"),b(this.handshakeComplete_,"Handshake must be complete before writing mutations"),b(this.lastStreamToken.length>0,"Trying to write mutation without a token");var n={streamToken:this.lastStreamToken,writes:e.map(function(e){return t.serializer.toMutation(e)})};this.sendRequest(n)},t}(pr),yr=function(){function e(e,t,n,r){this.queue=e,this.connection=t,this.credentials=n,this.serializer=r}return e.prototype.newPersistentWriteStream=function(e){return new gr(this.queue,this.connection,this.credentials,this.serializer,e)},e.prototype.newPersistentWatchStream=function(e){return new mr(this.queue,this.connection,this.credentials,this.serializer,e)},e.prototype.commit=function(e){var t=this,n={database:this.serializer.encodedDatabaseId,writes:e.map(function(e){return t.serializer.toMutation(e)})};return this.invokeRPC("Commit",n).then(function(e){return t.serializer.fromWriteResults(e.writeResults,e.commitTime)})},e.prototype.lookup=function(e){var t=this,n={database:this.serializer.encodedDatabaseId,documents:e.map(function(e){return t.serializer.toName(e)})};return this.invokeStreamingRPC("BatchGetDocuments",n).then(function(n){var r=Oe();
1n.forEach(function(e){var n=t.serializer.fromMaybeDocument(e);r=r.insert(n.key,n)});var i=[];return e.forEach(function(e){var t=r.get(e);b(!!t,"Missing entity in write response for "+e),i.push(t)}),i})},e.prototype.invokeRPC=function(e,t){var n=this;return this.credentials.getToken().then(function(r){return n.connection.invokeRPC(e,t,r)}).catch(function(e){throw e.code===_.UNAUTHENTICATED&&n.credentials.invalidateToken(),e})},e.prototype.invokeStreamingRPC=function(e,t){var n=this;return this.credentials.getToken().then(function(r){return n.connection.invokeStreamingRPC(e,t,r)}).catch(function(e){throw e.code===_.UNAUTHENTICATED&&n.credentials.invalidateToken(),e})},e}(),br=function(){function e(e){this.datastore=e,this.readVersions=Le(),this.mutations=[],this.committed=!1,this.writtenDocs=new Set}return e.prototype.lookup=function(e){return s.__awaiter(this,void 0,void 0,function(){var t,n=this;return s.__generator(this,function(r){switch(r.label){case 0:if(this.ensureCommitNotCalled(),this.mutations.length>0)throw new S(_.INVALID_ARGUMENT,"Firestore transactions require all reads to be executed before all writes.");return[4,this.datastore.lookup(e)];case 1:return(t=r.sent()).forEach(function(e){e instanceof mt||e instanceof pt?n.recordVersion(e):y("Document in a transaction was a "+e.constructor.name)}),[2,t]}})})},e.prototype.set=function(e,t){this.write(t.toMutations(e,this.precondition(e))),this.writtenDocs.add(e)},e.prototype.update=function(e,t){try{this.write(t.toMutations(e,this.preconditionForUpdate(e)))}catch(n){this.lastWriteError=n}this.writtenDocs.add(e)},e.prototype.delete=function(e){this.write([new zn(e,this.precondition(e))]),this.writtenDocs.add(e)},e.prototype.commit=function(){return s.__awaiter(this,void 0,void 0,function(){var e;return s.__generator(this,function(t){switch(t.label){case 0:if(this.ensureCommitNotCalled(),this.lastWriteError)throw this.lastWriteError;if(e=this.readVersions,this.mutations.forEach(function(t){e=e.remove(t.key)}),!e.isEmpty())throw new S(_.INVALID_ARGUMENT,"Every document read in a transaction must also be written.");return[4,this.datastore.commit(this.mutations)];case 1:return t.sent(),this.committed=!0,[2]}})})},e.prototype.recordVersion=function(e){var t;if(e instanceof pt)t=e.version;else{if(!(e instanceof mt))throw y("Document in a transaction was a "+e.constructor.name);t=Ee.forDeletedDoc()}var n=this.readVersions.get(e.key);if(null!==n){if(!t.isEqual(n))throw new S(_.ABORTED,"Document version changed between two reads.")}else this.readVersions=this.readVersions.insert(e.key,t)},e.prototype.precondition=function(e){var t=this.readVersions.get(e);return!this.writtenDocs.has(e)&&t?Vn.updateTime(t):Vn.NONE},e.prototype.preconditionForUpdate=function(e){var t=this.readVersions.get(e);if(!this.writtenDocs.has(e)&&t){if(t.isEqual(Ee.forDeletedDoc()))throw new S(_.INVALID_ARGUMENT,"Can't update a document that doesn't exist.");return Vn.updateTime(t)}return Vn.exists(!0)},e.prototype.write=function(e){this.ensureCommitNotCalled(),this.mutations=this.mutations.concat(e)},e.prototype.ensureCommitNotCalled=function(){b(!this.committed,"A transaction object cannot be used after its update callback has been invoked.")},e}(),vr=function(e){return e[e.Unknown=0]="Unknown",e[e.Online=1]="Online",e[e.Offline=2]="Offline",e}({}),wr=function(e){return e[e.RemoteStore=0]="RemoteStore",e[e.SharedClientState=1]="SharedClientState",e}({}),_r=function(){function e(e,t){this.asyncQueue=e,this.onlineStateHandler=t,this.state=vr.Unknown,this.watchStreamFailures=0,this.onlineStateTimer=null,this.shouldWarnClientIsOffline=!0}return e.prototype.handleWatchStreamStart=function(){var e=this;0===this.watchStreamFailures&&(this.setAndBroadcast(vr.Unknown),b(null===this.onlineStateTimer,"onlineStateTimer shouldn't be started yet"),this.onlineStateTimer=this.asyncQueue.enqueueAfterDelay(he.OnlineStateTimeout,1e4,function(){return e.onlineStateTimer=null,b(e.state===vr.Unknown,"Timer should be canceled if we transitioned to a different state."),e.logClientOfflineWarningIfNecessary("Backend didn't respond within 10 seconds."),e.setAndBroadcast(vr.Offline),Promise.resolve()}))},e.prototype.handleWatchStreamFailure=function(e){this.state===vr.Online?(this.setAndBroadcast(vr.Unknown),b(0===this.watchStreamFailures,"watchStreamFailures must be 0"),b(null===this.onlineStateTimer,"onlineStateTimer must be null")):(this.watchStreamFailures++,this.watchStreamFailures>=1&&(this.clearOnlineStateTimer(),this.logClientOfflineWarningIfNecessary("Connection failed 1 times. Most recent error: "+e.toString()),this.setAndBroadcast(vr.Offline)))},e.prototype.set=function(e){this.clearOnlineStateTimer(),this.watchStreamFailures=0,e===vr.Online&&(this.shouldWarnClientIsOffline=!1),this.setAndBroadcast(e)},e.prototype.setAndBroadcast=function(e){e!==this.state&&(this.state=e,this.onlineStateHandler(e))},e.prototype.logClientOfflineWarningIfNecessary=function(e){var t="Could not reach Cloud Firestore backend. "+e+"\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?(m(t),this.shouldWarnClientIsOffline=!1):p("OnlineStateTracker",t)},e.prototype.clearOnlineStateTimer=function(){null!==this.onlineStateTimer&&(this.onlineStateTimer.cancel(),this.onlineStateTimer=null)},e}(),Sr=function(e){return e[e.OK=0]="OK",e[e.CANCELLED=1]="CANCELLED",e[e.UNKNOWN=2]="UNKNOWN",e[e.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",e[e.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",e[e.NOT_FOUND=5]="NOT_FOUND",e[e.ALREADY_EXISTS=6]="ALREADY_EXISTS",e[e.PERMISSION_DENIED=7]="PERMISSION_DENIED",e[e.UNAUTHENTICATED=16]="UNAUTHENTICATED",e[e.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",e[e.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",e[e.ABORTED=10]="ABORTED",e[e.OUT_OF_RANGE=11]="OUT_OF_RANGE",e[e.UNIMPLEMENT
1ED=12]="UNIMPLEMENTED",e[e.INTERNAL=13]="INTERNAL",e[e.UNAVAILABLE=14]="UNAVAILABLE",e[e.DATA_LOSS=15]="DATA_LOSS",e}({});function Er(e){switch(e){case _.OK:return y("Treated status OK as error");case _.CANCELLED:case _.UNKNOWN:case _.DEADLINE_EXCEEDED:case _.RESOURCE_EXHAUSTED:case _.INTERNAL:case _.UNAVAILABLE:case _.UNAUTHENTICATED:return!1;case _.INVALID_ARGUMENT:case _.NOT_FOUND:case _.ALREADY_EXISTS:case _.PERMISSION_DENIED:case _.FAILED_PRECONDITION:case _.ABORTED:case _.OUT_OF_RANGE:case _.UNIMPLEMENTED:case _.DATA_LOSS:return!0;default:return y("Unknown status code: "+e)}}function Cr(e){if(void 0===e)return m("GRPC error has no .code"),_.UNKNOWN;switch(e){case Sr.OK:return _.OK;case Sr.CANCELLED:return _.CANCELLED;case Sr.UNKNOWN:return _.UNKNOWN;case Sr.DEADLINE_EXCEEDED:return _.DEADLINE_EXCEEDED;case Sr.RESOURCE_EXHAUSTED:return _.RESOURCE_EXHAUSTED;case Sr.INTERNAL:return _.INTERNAL;case Sr.UNAVAILABLE:return _.UNAVAILABLE;case Sr.UNAUTHENTICATED:return _.UNAUTHENTICATED;case Sr.INVALID_ARGUMENT:return _.INVALID_ARGUMENT;case Sr.NOT_FOUND:return _.NOT_FOUND;case Sr.ALREADY_EXISTS:return _.ALREADY_EXISTS;case Sr.PERMISSION_DENIED:return _.PERMISSION_DENIED;case Sr.FAILED_PRECONDITION:return _.FAILED_PRECONDITION;case Sr.ABORTED:return _.ABORTED;case Sr.OUT_OF_RANGE:return _.OUT_OF_RANGE;case Sr.UNIMPLEMENTED:return _.UNIMPLEMENTED;case Sr.DATA_LOSS:return _.DATA_LOSS;default:return y("Unknown status code: "+e)}}function Tr(e){if(void 0===e)return Sr.OK;switch(e){case _.OK:return Sr.OK;case _.CANCELLED:return Sr.CANCELLED;case _.UNKNOWN:return Sr.UNKNOWN;case _.DEADLINE_EXCEEDED:return Sr.DEADLINE_EXCEEDED;case _.RESOURCE_EXHAUSTED:return Sr.RESOURCE_EXHAUSTED;case _.INTERNAL:return Sr.INTERNAL;case _.UNAVAILABLE:return Sr.UNAVAILABLE;case _.UNAUTHENTICATED:return Sr.UNAUTHENTICATED;case _.INVALID_ARGUMENT:return Sr.INVALID_ARGUMENT;case _.NOT_FOUND:return Sr.NOT_FOUND;case _.ALREADY_EXISTS:return Sr.ALREADY_EXISTS;case _.PERMISSION_DENIED:return Sr.PERMISSION_DENIED;case _.FAILED_PRECONDITION:return Sr.FAILED_PRECONDITION;case _.ABORTED:return Sr.ABORTED;case _.OUT_OF_RANGE:return Sr.OUT_OF_RANGE;case _.UNIMPLEMENTED:return Sr.UNIMPLEMENTED;case _.DATA_LOSS:return Sr.DATA_LOSS;default:return y("Unknown status code: "+e)}}var Ir=function(){function e(e){this.comparator=e?function(t,n){return e(t,n)||le.comparator(t.key,n.key)}:function(e,t){return le.comparator(e.key,t.key)},this.keyedMap=Me(),this.sortedSet=new Ce(this.comparator)}return e.emptySet=function(t){return new e(t.comparator)},e.prototype.has=function(e){return null!=this.keyedMap.get(e)},e.prototype.get=function(e){return this.keyedMap.get(e)},e.prototype.first=function(){return this.sortedSet.minKey()},e.prototype.last=function(){return this.sortedSet.maxKey()},e.prototype.isEmpty=function(){return this.sortedSet.isEmpty()},e.prototype.indexOf=function(e){var t=this.keyedMap.get(e);return t?this.sortedSet.indexOf(t):-1},Object.defineProperty(e.prototype,"size",{get:function(){return this.sortedSet.size},enumerable:!0,configurable:!0}),e.prototype.forEach=function(e){this.sortedSet.inorderTraversal(function(t,n){return e(t),!1})},e.prototype.add=function(e){var t=this.delete(e.key);return t.copy(t.keyedMap.insert(e.key,e),t.sortedSet.insert(e,null))},e.prototype.delete=function(e){var t=this.get(e);return t?this.copy(this.keyedMap.remove(e),this.sortedSet.remove(t)):this},e.prototype.isEqual=function(t){if(!(t instanceof e))return!1;if(this.size!==t.size)return!1;for(var n=this.sortedSet.getIterator(),r=t.sortedSet.getIterator();n.hasNext();){var i=n.getNext().key,o=r.getNext().key;if(!i.isEqual(o))return!1}return!0},e.prototype.toString=function(){var e=[];return this.forEach(function(t){e.push(t.toString())}),0===e.length?"DocumentSet ()":"DocumentSet (\n  "+e.join("  \n")+"\n)"},e.prototype.copy=function(t,n){var r=new e;return r.comparator=this.comparator,r.keyedMap=t,r.sortedSet=n,r},e}(),Dr=function(e){return e[e.Added=0]="Added",e[e.Removed=1]="Removed",e[e.Modified=2]="Modified",e[e.Metadata=3]="Metadata",e}({}),xr=function(e){return e[e.Local=0]="Local",e[e.Synced=1]="Synced",e}({}),kr=function(){function e(){this.changeMap=new Ce(le.comparator)}return e.prototype.track=function(e){var t=e.doc.key,n=this.changeMap.get(t);n?e.type!==Dr.Added&&n.type===Dr.Metadata?this.changeMap=this.changeMap.insert(t,e):e.type===Dr.Metadata&&n.type!==Dr.Removed?this.changeMap=this.changeMap.insert(t,{type:n.type,doc:e.doc}):e.type===Dr.Modified&&n.type===Dr.Modified?this.changeMap=this.changeMap.insert(t,{type:Dr.Modified,doc:e.doc}):e.type===Dr.Modified&&n.type===Dr.Added?this.changeMap=this.changeMap.insert(t,{type:Dr.Added,doc:e.doc}):e.type===Dr.Removed&&n.type===Dr.Added?this.changeMap=this.changeMap.remove(t):e.type===Dr.Removed&&n.type===Dr.Modified?this.changeMap=this.changeMap.insert(t,{type:Dr.Removed,doc:n.doc}):e.type===Dr.Added&&n.type===Dr.Removed?this.changeMap=this.changeMap.insert(t,{type:Dr.Modified,doc:e.doc}):y("unsupported combination of changes: "+JSON.stringify(e)+" after "+JSON.stringify(n)):this.changeMap=this.changeMap.insert(t,e)},e.prototype.getChanges=function(){var e=[];return this.changeMap.inorderTraversal(function(t,n){e.push(n)}),e},e}(),Ar=function(){function e(e,t,n,r,i,o,s,a){this.query=e,this.docs=t,this.oldDocs=n,this.docChanges=r,this.mutatedKeys=i,this.fromCache=o,this.syncStateChanged=s,this.excludesMetadataChanges=a}return e.fromInitialDocuments=function(t,n,r,i){var o=[];
1return n.forEach(function(e){o.push({type:Dr.Added,doc:e})}),new e(t,n,Ir.emptySet(n),o,r,i,!0,!1)},Object.defineProperty(e.prototype,"hasPendingWrites",{get:function(){return!this.mutatedKeys.isEmpty()},enumerable:!0,configurable:!0}),e.prototype.isEqual=function(e){if(!(this.fromCache===e.fromCache&&this.syncStateChanged===e.syncStateChanged&&this.mutatedKeys.isEqual(e.mutatedKeys)&&this.query.isEqual(e.query)&&this.docs.isEqual(e.docs)&&this.oldDocs.isEqual(e.oldDocs)))return!1;var t=this.docChanges,n=e.docChanges;if(t.length!==n.length)return!1;for(var r=0;r<t.length;r++)if(t[r].type!==n[r].type||!t[r].doc.isEqual(n[r].doc))return!1;return!0},e}(),Or=function(){function e(e,t,n,r,i){this.snapshotVersion=e,this.targetChanges=t,this.targetMismatches=n,this.documentUpdates=r,this.resolvedLimboDocuments=i}return e.createSynthesizedRemoteEventForCurrentChange=function(t,n){var r,i=((r={})[t]=Nr.createSynthesizedTargetChangeForCurrentChange(t,n),r);return new e(Ee.MIN,i,Ue(),Oe(),je())},e}(),Nr=function(){function e(e,t,n,r,i){this.resumeToken=e,this.current=t,this.addedDocuments=n,this.modifiedDocuments=r,this.removedDocuments=i}return e.createSynthesizedTargetChangeForCurrentChange=function(t,n){return new e(w(),n,je(),je(),je())},e}(),Rr=function(){return function(e,t,n,r){this.updatedTargetIds=e,this.removedTargetIds=t,this.key=n,this.newDoc=r}}(),Mr=function(){return function(e,t){this.targetId=e,this.existenceFilter=t}}(),Pr=function(e){return e[e.NoChange=0]="NoChange",e[e.Added=1]="Added",e[e.Removed=2]="Removed",e[e.Current=3]="Current",e[e.Reset=4]="Reset",e}({}),Lr=function(){return function(e,t,n,r){void 0===n&&(n=w()),void 0===r&&(r=null),this.state=e,this.targetIds=t,this.resumeToken=n,this.cause=r}}(),Fr=function(){function e(){this.pendingResponses=0,this.documentChanges=Ur(),this._resumeToken=w(),this._current=!1,this._hasPendingChanges=!0}return Object.defineProperty(e.prototype,"current",{get:function(){return this._current},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"resumeToken",{get:function(){return this._resumeToken},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isPending",{get:function(){return 0!==this.pendingResponses},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasPendingChanges",{get:function(){return this._hasPendingChanges},enumerable:!0,configurable:!0}),e.prototype.updateResumeToken=function(e){e.length>0&&(this._hasPendingChanges=!0,this._resumeToken=e)},e.prototype.toTargetChange=function(){var e=je(),t=je(),n=je();
1return this.documentChanges.forEach(function(r,i){switch(i){case Dr.Added:e=e.add(r);break;case Dr.Modified:t=t.add(r);break;case Dr.Removed:n=n.add(r);break;default:y("Encountered invalid change type: "+i)}}),new Nr(this._resumeToken,this._current,e,t,n)},e.prototype.clearPendingChanges=function(){this._hasPendingChanges=!1,this.documentChanges=Ur()},e.prototype.addDocumentChange=function(e,t){this._hasPendingChanges=!0,this.documentChanges=this.documentChanges.insert(e,t)},e.prototype.removeDocumentChange=function(e){this._hasPendingChanges=!0,this.documentChanges=this.documentChanges.remove(e)},e.prototype.recordPendingTargetRequest=function(){this.pendingResponses+=1},e.prototype.recordTargetResponse=function(){this.pendingResponses-=1},e.prototype.markCurrent=function(){this._hasPendingChanges=!0,this._current=!0},e}(),jr=function(){function e(e){this.metadataProvider=e,this.targetStates={},this.pendingDocumentUpdates=Oe(),this.pendingDocumentTargetMapping=Vr(),this.pendingTargetResets=new xe(K)}return e.prototype.handleDocumentChange=function(e){for(var t=0,n=e.updatedTargetIds;t<n.length;t++){var r=n[t];e.newDoc instanceof pt?this.addDocumentToTarget(r,e.newDoc):e.newDoc instanceof mt&&this.removeDocumentFromTarget(r,e.key,e.newDoc)}for(var i=0,o=e.removedTargetIds;i<o.length;i++)this.removeDocumentFromTarget(r=o[i],e.key,e.newDoc)},e.prototype.handleTargetChange=function(e){var t=this;this.forEachTarget(e,function(n){var r=t.ensureTargetState(n);switch(e.state){case Pr.NoChange:t.isActiveTarget(n)&&r.updateResumeToken(e.resumeToken);break;case Pr.Added:r.recordTargetResponse(),r.isPending||r.clearPendingChanges(),r.updateResumeToken(e.resumeToken);break;case Pr.Removed:r.recordTargetResponse(),r.isPending||t.removeTarget(n),b(!e.cause,"WatchChangeAggregator does not handle errored targets");break;case Pr.Current:t.isActiveTarget(n)&&(r.markCurrent(),r.updateResumeToken(e.resumeToken));break;case Pr.Reset:t.isActiveTarget(n)&&(t.resetTarget(n),r.updateResumeToken(e.resumeToken));break;default:y("Unknown target watch change state: "+e.state)}})},e.prototype.forEachTarget=function(e,t){e.targetIds.length>0?e.targetIds.forEach(t):I(this.targetStates,t)},e.prototype.handleExistenceFilter=function(e){var t=e.targetId,n=e.existenceFilter.count,r=this.queryDataForActiveTarget(t);if(r){var i=r.query;if(i.isDocumentQuery())if(0===n){var o=new le(i.path);this.removeDocumentFromTarget(t,o,new mt(o,Ee.forDeletedDoc()))}else b(1===n,"Single document existence filter with count: "+n);else this.getCurrentDocumentCountForTarget(t)!==n&&(this.resetTarget(t),this.pendingTargetResets=this.pendingTargetResets.add(t))}},e.prototype.createRemoteEvent=function(e){var t=this,n={};I(this.targetStates,function(r,i){var o=t.queryDataForActiveTarget(r);if(o){if(i.current&&o.query.isDocumentQuery()){var s=new le(o.query.path);null!==t.pendingDocumentUpdates.get(s)||t.targetContainsDocument(r,s)||t.removeDocumentFromTarget(r,s,new mt(s,e))}i.hasPendingChanges&&(n[r]=i.toTargetChange(),i.clearPendingChanges())}});var r=je();this.pendingDocumentTargetMapping.forEach(function(e,n){var i=!0;n.forEachWhile(function(e){var n=t.queryDataForActiveTarget(e);return!n||n.purpose===Yt.LimboResolution||(i=!1,!1)}),i&&(r=r.add(e))});var i=new Or(e,n,this.pendingTargetResets,this.pendingDocumentUpdates,r);return this.pendingDocumentUpdates=Oe(),this.pendingDocumentTargetMapping=Vr(),this.pendingTargetResets=new xe(K),i},e.prototype.addDocumentToTarget=function(e,t){if(this.isActiveTarget(e)){var n=this.targetContainsDocument(e,t.key)?Dr.Modified:Dr.Added;this.ensureTargetState(e).addDocumentChange(t.key,n),this.pendingDocumentUpdates=this.pendingDocumentUpdates.insert(t.key,t),this.pendingDocumentTargetMapping=this.pendingDocumentTargetMapping.insert(t.key,this.ensureDocumentTargetMapping(t.key).add(e))}},e.prototype.removeDocumentFromTarget=function(e,t,n){if(this.isActiveTarget(e)){var r=this.ensureTargetState(e);this.targetContainsDocument(e,t)?r.addDocumentChange(t,Dr.Removed):r.removeDocumentChange(t),this.pendingDocumentTargetMapping=this.pendingDocumentTargetMapping.insert(t,this.ensureDocumentTargetMapping(t).delete(e)),n&&(this.pendingDocumentUpdates=this.pendingDocumentUpdates.insert(t,n))}},e.prototype.removeTarget=function(e){delete this.targetStates[e]},e.prototype.getCurrentDocumentCountForTarget=function(e){var t=this.ensureTargetState(e).toTargetChange();return this.metadataProvider.getRemoteKeysForTarget(e).size+t.addedDocuments.size-t.removedDocuments.size},e.prototype.recordPendingTargetRequest=function(e){this.ensureTargetState(e).recordPendingTargetRequest
1()},e.prototype.ensureTargetState=function(e){return this.targetStates[e]||(this.targetStates[e]=new Fr),this.targetStates[e]},e.prototype.ensureDocumentTargetMapping=function(e){var t=this.pendingDocumentTargetMapping.get(e);return t||(t=new xe(K),this.pendingDocumentTargetMapping=this.pendingDocumentTargetMapping.insert(e,t)),t},e.prototype.isActiveTarget=function(e){var t=null!==this.queryDataForActiveTarget(e);return t||p("WatchChangeAggregator","Detected inactive target",e),t},e.prototype.queryDataForActiveTarget=function(e){var t=this.targetStates[e];return t&&t.isPending?null:this.metadataProvider.getQueryDataForTarget(e)},e.prototype.resetTarget=function(e){var t=this;b(!this.targetStates[e].isPending,"Should only reset active targets"),this.targetStates[e]=new Fr,this.metadataProvider.getRemoteKeysForTarget(e).forEach(function(n){t.removeDocumentFromTarget(e,n,null)})},e.prototype.targetContainsDocument=function(e,t){return this.metadataProvider.getRemoteKeysForTarget(e).has(t)},e}();function Vr(){return new Ce(le.comparator)}function Ur(){return new Ce(le.comparator)}var qr="RemoteStore",Br=function(){function e(e,t,n,r,i){var o=this;this.localStore=e,this.datastore=t,this.writePipeline=[],this.listenTargets={},this.watchChangeAggregator=null,this.networkEnabled=!1,this.isPrimary=!1,this.connectivityMonitor=i,this.connectivityMonitor.addCallback(function(e){n.enqueueAndForget(function(){return s.__awaiter(o,void 0,void 0,function(){return s.__generator(this,function(e){switch(e.label){case 0:return this.canUseNetwork()?(p(qr,"Restarting streams for network reachability change."),[4,this.restartNetwork()]):[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}})})})}),this.onlineStateTracker=new _r(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 e.prototype.start=function(){return this.enableNetwork()},e.prototype.enableNetwork=function(){return s.__awaiter(this,void 0,void 0,function(){var e;return s.__generator(this,function(t){switch(t.label){case 0:return this.networkEnabled=!0,this.canUseNetwork()?(e=this.writeStream,[4,this.localStore.getLastStreamToken()]):[3,3];case 1:return e.lastStreamToken=t.sent(),this.shouldStartWatchStream()?this.startWatchStream():this.onlineStateTracker.set(vr.Unknown),[4,this.fillWritePipeline()];case 2:t.sent(),t.label=3;case 3:return[2]}})})},e.prototype.disableNetwork=function(){return s.__awaiter(this,void 0,void 0,function(){return s.__generator(this,function(e){switch(e.label){case 0:return this.networkEnabled=!1,[4,this.disableNetworkInternal()];case 1:return e.sent(),this.onlineStateTracker.set(vr.Offline),[2]}})})},e.prototype.disableNetworkInternal=function(){return s.__awaiter(this,void 0,void 0,function(){return s.__generator(this,function(e){switch(e.label){case 0:return[4,this.writeStream.stop()];case 1:return e.sent(),[4,this.watchStream.stop()];case 2:return e.sent(),this.writePipeline.length>0&&(p(qr,"Stopping write stream with "+this.writePipeline.length+" pending writes"),this.writePipeline=[]),this.cleanUpWatchStreamState(),[2]}})})},e.prototype.shutdown=function(){return s.__awaiter(this,void 0,void 0,function(){return s.__generator(this,function(e){switch(e.label){case 0:return p(qr,"RemoteStore shutting down."),this.networkEnabled=!1,[4,this.disableNetworkInternal()];case 1:return e.sent(),this.connectivityMonitor.shutdown(),this.onlineStateTracker.set(vr.Unknown),[2]}})})},e.prototype.listen=function(e){b(!C(this.listenTargets,e.targetId),"listen called with duplicate targetId!"),this.listenTargets[e.targetId]=e,this.shouldStartWatchStream()?this.startWatchStream():this.watchStream.isOpen()&&this.sendWatchRequest(e)},e.prototype.unlisten=function(e){b(C(this.listenTargets,e),"unlisten called without assigned target ID!"),delete this.listenTargets[e],this.watchStream.isOpen()&&this.sendUnwatchRequest(e),x(this.listenTargets)&&(this.watchStream.isOpen()?this.watchStream.markIdle():this.canUseNetwork()&&this.onlineStateTracker.set(vr.Unknown))},e.prototype.getQueryDataForTarget=function(e){return this.listenTargets[e]||null},e.prototype.getRemoteKeysForTarget=function(e){return this.syncEngine.getRemoteKeysForTarget(e)}
1,e.prototype.sendWatchRequest=function(e){this.watchChangeAggregator.recordPendingTargetRequest(e.targetId),this.watchStream.watch(e)},e.prototype.sendUnwatchRequest=function(e){this.watchChangeAggregator.recordPendingTargetRequest(e),this.watchStream.unwatch(e)},e.prototype.startWatchStream=function(){b(this.shouldStartWatchStream(),"startWatchStream() called when shouldStartWatchStream() is false."),this.watchChangeAggregator=new jr(this),this.watchStream.start(),this.onlineStateTracker.handleWatchStreamStart()},e.prototype.shouldStartWatchStream=function(){return this.canUseNetwork()&&!this.watchStream.isStarted()&&!x(this.listenTargets)},e.prototype.canUseNetwork=function(){return this.isPrimary&&this.networkEnabled},e.prototype.cleanUpWatchStreamState=function(){this.watchChangeAggregator=null},e.prototype.onWatchStreamOpen=function(){return s.__awaiter(this,void 0,void 0,function(){var e=this;return s.__generator(this,function(t){return I(this.listenTargets,function(t,n){e.sendWatchRequest(n)}),[2]})})},e.prototype.onWatchStreamClose=function(e){return s.__awaiter(this,void 0,void 0,function(){return s.__generator(this,function(t){return void 0===e&&b(!this.shouldStartWatchStream(),"Watch stream was stopped gracefully while still needed."),this.cleanUpWatchStreamState(),this.shouldStartWatchStream()?(this.onlineStateTracker.handleWatchStreamFailure(e),this.startWatchStream()):this.onlineStateTracker.set(vr.Unknown),[2]})})},e.prototype.onWatchStreamChange=function(e,t){return s.__awaiter(this,void 0,void 0,function(){var n;return s.__generator(this,function(r){switch(r.label){case 0:return this.onlineStateTracker.set(vr.Online),e instanceof Lr&&e.state===Pr.Removed&&e.cause?[2,this.handleTargetError(e)]:(e instanceof Rr?this.watchChangeAggregator.handleDocumentChange(e):e instanceof Mr?this.watchChangeAggregator.handleExistenceFilter(e):(b(e instanceof Lr,"Expected watchChange to be an instance of WatchTargetChange"),this.watchChangeAggregator.handleTargetChange(e)),t.isEqual(Ee.MIN)?[3,3]:[4,this.localStore.getLastRemoteSnapshotVersion()]);case 1:return n=r.sent(),t.compareTo(n)>=0?[4,this.raiseWatchSnapshot(t)]:[3,3];case 2:r.sent(),r.label=3;case 3:return[2]}})})},e.prototype.raiseWatchSnapshot=function(e){var t=this;b(!e.isEqual(Ee.MIN),"Can't raise event for unknown SnapshotVersion");var n=this.watchChangeAggregator.createRemoteEvent(e);return I(n.targetChanges,function(n,r){if(r.resumeToken.length>0){var i=t.listenTargets[n];i&&(t.listenTargets[n]=i.copy({resumeToken:r.resumeToken,snapshotVersion:e}))}}),n.targetMismatches.forEach(function(e){var n=t.listenTargets[e];if(n){t.listenTargets[e]=n.copy({resumeToken:w()}),t.sendUnwatchRequest(e);var r=new Zt(n.query,e,Yt.ExistenceFilterMismatch,n.sequenceNumber);t.sendWatchRequest(r)}}),this.syncEngine.applyRemoteEvent(n)},e.prototype.handleTargetError=function(e){var t=this;b(!!e.cause,"Handling target error without a cause");var n=e.cause,r=Promise.resolve();return e.targetIds.forEach(function(e){r=r.then(function(){return s.__awaiter(t,void 0,void 0,function(){return s.__generator(this,function(t){return C(this.listenTargets,e)?(delete this.listenTargets[e],this.watchChangeAggregator.removeTarget(e),[2,this.syncEngine.rejectListen(e,n)]):[2]})})})}),r},e.prototype.fillWritePipeline=function(){return s.__awaiter(this,void 0,void 0,function(){var e;return s.__generator(this,function(t){switch(t.label){case 0:return this.canAddToWritePipeline()?[4,this.localStore.nextMutationBatch(this.writePipeline.length>0?this.writePipeline[this.writePipeline.length-1].batchId:-1)]:[3,4];case 1:return null!==(e=t.sent())?[3,2]:(0===this.writePipeline.length&&this.writeStream.markIdle(),[3,4]);case 2:return this.addToWritePipeline(e),[4,this.fillWritePipeline()];case 3:t.sent(),t.label=4;case 4:return this.shouldStartWriteStream()&&this.startWriteStream(),[2]}})})},e.prototype.canAddToWritePipeline=function(){return this.canUseNetwork()&&this.writePipeline.length<10},e.prototype.outstandingWrites=function(){return this.writePipeline.length},e.prototype.addToWritePipeline=function(e){b(this.canAddToWritePipeline(),"addToWritePipeline called when pipeline is full"),this.writePipeline.push(e),this.writeStream.isOpen()&&this.writeStream.handshakeComplete&&this.writeStream.writeMutations(e.mutations)},e.prototype.shouldStartWriteStream=function(){return this.canUseNetwork()&&!this.writeStream.isStarted()&&this.writePipeline.length>0},e.prototype.startWriteStream=function(){b(this.shouldStartWriteStream(),"startWriteStream() called when shouldStartWriteStream() is false."),this.writeStream.start()},e.prototype.onWriteStreamOpen=function(){return s.__awaiter(this,void 0,void 0,function(){return s.__generator(this,function(e){return this.writeStream.writeHandshake(),[2]})})},e.prototype.onWriteHandshakeComplete=function(){var e=this;return this.localStore.setLastStreamToken(this.writeStream.lastStreamToken).then(function(){for(var t=0,n=e.writePipeline;t<n.length;t++)e.writeStream.writeMutations(n[t].mutations)}).catch(dn)},e.prototype.onMutationResult=function(e,t){var n=this;b(this.writePipeline.length>0,"Got result for empty write pipeline");var r=this.writePipeline.shift(),i=Be.from(r,e,t,this.writeStream.lastStreamToken);return this.syncEngine.applySuccessfulWrite(i).then(function(){return n.fillWritePipeline()})},e.prototype.onWriteStreamClose=function(e){return s.__awaiter(this,void 0,void 0,function(){var t=this;return s.__generator(this,function(n){return void 0===e&&b(!this.shouldStartWriteStream(),"Write stream was stopped gracefully while still needed."),e&&this.writePipeline.length>0?[2,(this.writeStream.handshakeComplete?this.handleWriteError(e):this.handleHandshakeError(e)).then(function(){t.shouldStartWriteStream()&&t.startWriteStream()})]:[2]})})},e.prototype.handleHandshakeError=function(e){return s.__awaiter(this,void 0,void 0,function(){return s.__generator(this,function(t){return Er(e.code)?(p(qr,"RemoteStore error before completed handshake; resetting stream token: ",this.writeStream.lastStreamToken),this.writeStream.lastStreamToken=w(),[2,this.localStore.setLastStreamToken(w()).catch(dn)]):[2]})})},e.prototype.handleWriteError=function(e){return s.__awaiter(this,void 0,void 0,function(){var t,n=this;return s.__generator(this,function(r){return Er(i=e.code)&&i!==_.ABORTED?(t=this.writePipeline.shift(),this.writeStream.inhibitBackoff(),[2,this.syncEngine.rejectFailedWrite(t.batchId,e).then(function(){return n.fillWritePipeline()})]):[2];var i})})},e.prototype.createTransaction=function(){return new br(this.datastore)},e.prototype.restartNetwork=function(){return s.__awaiter(this,void 0,void 0,function(){return s.__generator(this,function(e){switch(e.label){case 0:return this.networkEnabled=!1,[4,this.disableNetworkInternal()];case 1:return e.sent(),this.onlineStateTracker.set(vr.Unknown),[4,this.enableNetwork()];case 2:return e.sent(),[2]}})})},e.prototype.handleCredentialChange=function(){return s.__awaiter(this,void 0,void 0,function(){return s.__generator(this,function(e){switch(e.label){case 0:return this.canUseNetwork()?(p(qr,"RemoteStore restarting streams for new credential"),[4,this.restartNetwork()]):[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}})})},e.prototype.applyPrimaryState=function(e){return s.__awaiter(this,void 0,void 0,function(){return s.__generator(this,function(t){switch(t.label){case 0:return this.isPrimary=e,e&&this.networkEnabled?[4,this.enableNetwork()]:[3,2];case 1:return t.sent(),[3,4];case 2:return e?[3,4]:[4,this.disableNetworkInternal()];case 3:t.sent(),this.onlineStateTracker.set(vr.Unknown),t.label=4;case 4:return[2]}})})},e}(),Hr=function(){function e(e,t){if(A("GeoPoint",arguments,2),R("GeoPoint","number",1,e),R("GeoPoint","number",2,t),!isFinite(e)||e<-90||e>
190)throw new S(_.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+e);if(!isFinite(t)||t<-180||t>180)throw new S(_.INVALID_ARGUMENT,"Longitude must be a number between -180 and 180, but was: "+t);this._lat=e,this._long=t}return Object.defineProperty(e.prototype,"latitude",{get:function(){return this._lat},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"longitude",{get:function(){return this._long},enumerable:!0,configurable:!0}),e.prototype.isEqual=function(e){return this._lat===e._lat&&this._long===e._long},e.prototype._compareTo=function(e){return K(this._lat,e._lat)||K(this._long,e._long)},e}(),zr=function(){function e(e,t,n,r,i,o,s){void 0===t&&(t=null),void 0===n&&(n=[]),void 0===r&&(r=[]),void 0===i&&(i=null),void 0===o&&(o=null),void 0===s&&(s=null),this.path=e,this.collectionGroup=t,this.explicitOrderBy=n,this.filters=r,this.limit=i,this.startAt=o,this.endAt=s,this.memoizedCanonicalId=null,this.memoizedOrderBy=null,this.startAt&&this.assertValidBound(this.startAt),this.endAt&&this.assertValidBound(this.endAt)}return e.atPath=function(t){return new e(t)},Object.defineProperty(e.prototype,"orderBy",{get:function(){if(null===this.memoizedOrderBy){var e=this.getInequalityFilterField(),t=this.getFirstOrderByField();if(null!==e&&null===t)this.memoizedOrderBy=e.isKeyField()?[ni]:[new ti(e),ni];else{b(null===e||null!==t&&e.isEqual(t),"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:Xr.ASCENDING)===Xr.ASCENDING?ni:ri)}}return this.memoizedOrderBy},enumerable:!0,configurable:!0}),e.prototype.addFilter=function(t){b(null==this.getInequalityFilterField()||!(t instanceof Gr)||!t.isInequality()||t.field.isEqual(this.getInequalityFilterField()),"Query must only have one inequality field."),b(!this.isDocumentQuery(),"No filtering allowed for document query");var n=this.filters.concat([t]);return new e(this.path,this.collectionGroup,this.explicitOrderBy.slice(),n,this.limit,this.startAt,this.endAt)},e.prototype.addOrderBy=function(t){b(!this.startAt&&!this.endAt,"Bounds must be set after orderBy");var n=this.explicitOrderBy.concat([t]);return new e(this.path,this.collectionGroup,n,this.filters.slice(),this.limit,this.startAt,this.endAt)},e.prototype.withLimit=function(t){return new e(this.path,this.collectionGroup,this.explicitOrderBy.slice(),this.filters.slice(),t,this.startAt,this.endAt)},e.prototype.withStartAt=function(t){return new e(this.path,this.collectionGroup,this.explicitOrderBy.slice(),this.filters.slice(),this.limit,t,this.endAt)},e.prototype.withEndAt=function(t){return new e(this.path,this.collectionGroup,this.explicitOrderBy.slice(),this.filters.slice(),this.limit,this.startAt,t)},e.prototype.asCollectionQueryAtPath=function(t){return new e(t,null,this.explicitOrderBy.slice(),this.filters.slice(),this.limit,this.startAt,this.endAt)},e.prototype.canonicalId=function(){if(null===this.memoizedCanonicalId){var e=this.path.canonicalString();this.isCollectionGroupQuery()&&(e+="|cg:"+this.collectionGroup),e+="|f:";for(var t=0,n=this.filters;t<n.length;t++)e+=n[t].canonicalId(),e+=",";e+="|ob:";for(var r=0,i=this.orderBy;r<i.length;r++)e+=i[r].canonicalId(),e+=",";ar(this.limit)||(e+="|l:",e+=this.limit),this.startAt&&(e+="|lb:",e+=this.startAt.canonicalId()),this.endAt&&(e+="|ub:",e+=this.endAt.canonicalId()),this.memoizedCanonicalId=e}return this.memoizedCanonicalId},e.prototype.toString=function(){var e="Query("+this.path.canonicalString();return this.isCollectionGroupQuery()&&(e+=" collectionGroup="+this.collectionGroup),this.filters.length>0&&(e+=", filters: ["+this.filters.join(", ")+"]"),ar(this.limit)||(e+=", limit: "+this.limit),this.explicitOrderBy.length>0&&(e+=", orderBy: ["+this.explicitOrderBy.join(", ")+"]"),this.startAt&&(e+=", startAt: "+this.startAt.canonicalId()),this.endAt&&(e+=", endAt: "+this.endAt.canonicalId()),e+")"},e.prototype.isEqual=function(e){if(this.limit!==e.limit)return!1;if(this.orderBy.length!==e.orderBy.length)return!1;for(var t=0;t<this.orderBy.length;t++)if(!this.orderBy[t].isEqual(e.orderBy[t]))return!1;if(this.filters.length!==e.filters.length)return!1;for(t=0;t<this.filters.length;t++)if(!this.filters[t].isEqual(e.filters[t]))return!1;return this.collectionGroup===e.collectionGroup&&!!this.path.isEqual(e.path)&&!(null!==this.startAt?!this.startAt.isEqual(e.startAt):null!==e.startAt)&&(null!==this.endAt?this.endAt.isEqual(e.endAt):null===e.endAt)},e.prototype.docComparator=function(e,t){for(var n=!1,r=0,i=this.orderBy;r<i.length;r++){var o=i[r],s=o.compare(e,t);if(0!==s)return s;n=n||o.field.isKeyField()}return b(n,"orderBy used that doesn't compare on key field"),0},e.prototype.matches=function(e){return this.matchesPathAndCollectionGroup(e)&&this.matchesOrderBy(e)&&this.matchesFilters(e)&&this.matchesBounds(e)},e.prototype.hasLimit=function(){return!ar(this.limit)},e.prototype.getFirstOrderByField=function(){return this.explicitOrderBy.length>0?this.explicitOrderBy[0].field:null},e.prototype.getInequalityFilterField=function(){for(var e=0,t=this.filters;e<t.length;e++){var n=t[e];if(n instanceof Gr&&n.isInequality())return n.field}return null},e.prototype.findFilterOperator=function(e){for(var t=0,n=this.filters;t<n.length;t++){var r=n[t];if(r instanceof Gr&&e.indexOf(r.op)>=0)return r.op}return null},e.prototype.isDocumentQuery=function(){return le.isDocumentKey(this.path)&&null===this.collectionGroup&&0===this.filters.length},e.prototype.isCollectionGroupQuery=function(){return null!==this.collectionGroup},e.prototype.matchesPathAndCollectionGroup=function(e){var t=e.key.path;return null!==this.collectionGroup?e.key.hasCollectionId(this.collectionGroup)&&this.path.isPrefixOf(t):le.isDocumentKey(this.path)?this.path.isEqual(t):this.path.isImmediateParentOf(t)},e.prototype.matchesOrderBy=function(e){for(var t=0,n=this.explicitOrderBy;t<n.length;t++){var r=n[t];if(!r.field.isKeyField()&&null===e.field(r.field))return!1}return!0},e.prototype.matchesFilters=function(e){for(var t=0,n=this.filters;t<n.length;t++)if(!n[t].matches(e))return!1;return!0},e.prototype.matchesBounds=function(e){return!(this.startAt&&!this.startAt.sortsBeforeDocument(this.orderBy,e)||this.endAt&&this.endAt.sortsBeforeDocument(this.orderBy,e))},e.prototype.assertValidBound=function(e){b(e.position.length<=this.orderBy.length,"Bound is longer than orderBy")},e}(),Wr=function(){return function(){}}(),Qr=function(){function e(e){this.name=e}return e.fromString=function(t){switch(t){case"<":return e.LESS_THAN;case"<=":return e.LESS_THAN_OR_EQUAL;case"==":return e.EQUAL;case">=":return e.GREATER_THAN_OR_EQUAL;case">":return e.GREATER_THAN;case"array-contains":return e.ARRAY_CONTAINS;case"in":return e.IN;case"array-contains-any":return e.ARRAY_CONTAINS_ANY;default:return y("Unknown FieldFilter operator: "+t)}},e.prototype.toString=function(){return this.name},e.prototype.isEqual=function(e){return this.name===e.name},e.LESS_THAN=new e("<"),e.LESS_THAN_OR_EQUAL=new e("<="),e.EQUAL=new e("=="),e.GREATER_THAN=new e(">"),e.GREATER_THAN_OR_EQUAL=new e(">="),e.ARRAY_CONTAINS=new e("array-contains"),e.IN=new e("in"),e.ARRAY_CONTAINS_ANY=new e("array-contains-any"),e}(),Gr=function(e){function t(t,n,r){var i=e.call(this)||this;return i.field=t,i.op=n,i.value=r,i}return s.__extends(t,e),t.create=function(e,n,r){if(e.isKeyField())return n===Qr.IN?(b(r instanceof Mn,"Comparing on key with IN, but filter value not an ArrayValue"),b(r.internalValue.every(function(e){return e instanceof On}),"Comparing on key with IN, but an array value was not a RefValue"),new $r(e,r)):(b(r instanceof On,"Comparing on key, but filter value not a RefValue"),b(n!==Qr.ARRAY_CONTAINS&&n!==Qr.ARRAY_CONTAINS_ANY,"'"+n.toString()+"' queries don't make sense on document keys."),new Kr(e,n,r));
1if(r.isEqual(_n.INSTANCE)){if(n!==Qr.EQUAL)throw new S(_.INVALID_ARGUMENT,"Invalid query. Null supports only equality comparisons.");return new t(e,n,r)}if(r.isEqual(In.NAN)){if(n!==Qr.EQUAL)throw new S(_.INVALID_ARGUMENT,"Invalid query. NaN supports only equality comparisons.");return new t(e,n,r)}return n===Qr.ARRAY_CONTAINS?new Yr(e,r):n===Qr.IN?(b(r instanceof Mn,"IN filter has invalid value: "+r.toString()),new Zr(e,r)):n===Qr.ARRAY_CONTAINS_ANY?(b(r instanceof Mn,"ARRAY_CONTAINS_ANY filter has invalid value: "+r.toString()),new Jr(e,r)):new t(e,n,r)},t.prototype.matches=function(e){var t=e.field(this.field);return null!==t&&this.value.typeOrder===t.typeOrder&&this.matchesComparison(t.compareTo(this.value))},t.prototype.matchesComparison=function(e){switch(this.op){case Qr.LESS_THAN:return e<0;case Qr.LESS_THAN_OR_EQUAL:return e<=0;case Qr.EQUAL:return 0===e;case Qr.GREATER_THAN:return e>0;case Qr.GREATER_THAN_OR_EQUAL:return e>=0;default:return y("Unknown FieldFilter operator: "+this.op)}},t.prototype.isInequality=function(){return[Qr.LESS_THAN,Qr.LESS_THAN_OR_EQUAL,Qr.GREATER_THAN,Qr.GREATER_THAN_OR_EQUAL].indexOf(this.op)>=0},t.prototype.canonicalId=function(){return this.field.canonicalString()+this.op.toString()+this.value.toString()},t.prototype.isEqual=function(e){return e instanceof t&&this.op.isEqual(e.op)&&this.field.isEqual(e.field)&&this.value.isEqual(e.value)},t.prototype.toString=function(){return this.field.canonicalString()+" "+this.op+" "+this.value.value()},t}(Wr),Kr=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return s.__extends(t,e),t.prototype.matches=function(e){var t=le.comparator(e.key,this.value.key);return this.matchesComparison(t)},t}(Gr),$r=function(e){function t(t,n){var r=e.call(this,t,Qr.IN,n)||this;return r.value=n,r}return s.__extends(t,e),t.prototype.matches=function(e){return this.value.internalValue.some(function(t){return e.key.isEqual(t.key)})},t}(Gr),Yr=function(e){function t(t,n){return e.call(this,t,Qr.ARRAY_CONTAINS,n)||this}return s.__extends(t,e),t.prototype.matches=function(e){var t=e.field(this.field);return t instanceof Mn&&t.contains(this.value)},t}(Gr),Zr=function(e){function t(t,n){var r=e.call(this,t,Qr.IN,n)||this;return r.value=n,r}return s.__extends(t,e),t.prototype.matches=function(e){var t=this.value,n=e.field(this.field);return null!==n&&t.contains(n)},t}(Gr),Jr=function(e){function t(t,n){var r=e.call(this,t,Qr.ARRAY_CONTAINS_ANY,n)||this;return r.value=n,r}return s.__extends(t,e),t.prototype.matches=function(e){var t=this,n=e.field(this.field);return n instanceof Mn&&n.internalValue.some(function(e){return t.value.contains(e)})},t}(Gr),Xr=function(){function e(e){this.name=e}return e.prototype.toString=function(){return this.name},e.ASCENDING=new e("asc"),e.DESCENDING=new e("desc"),e}(),ei=function(){function e(e,t){this.position=e,this.before=t}return e.prototype.canonicalId=function(){for(var e=this.before?"b:":"a:",t=0,n=this.position;t<n.length;t++)e+=n[t].toString();return e},e.prototype.sortsBeforeDocument=function(e,t){b(this.position.length<=e.length,"Bound has more components than query's orderBy");for(var n=0,r=0;r<this.position.length;r++){var i=e[r],o=this.position[r];if(i.field.isKeyField())b(o instanceof On,"Bound has a non-key value where the key path is being used."),n=le.comparator(o.key,t.key);else{var s=t.field(i.field);b(void 0!==s,"Field should exist since document matched the orderBy already."),n=o.compareTo(s)}if(i.dir===Xr.DESCENDING&&(n*=-1),0!==n)break}return this.before?n<=0:n<0},e.prototype.isEqual=function(e){if(null===e)return!1;if(this.before!==e.before||this.position.length!==e.position.length)return!1;for(var t=0;t<this.position.length;t++)if(!this.position[t].isEqual(e.position[t]))return!1;return!0},e}(),ti=function(){function e(e,t){this.field=e,void 0===t&&(t=Xr.ASCENDING),this.dir=t,this.isKeyOrderBy=e.isKeyField()}return e.prototype.compare=function(e,t){var n=this.isKeyOrderBy?pt.compareByKey(e,t):pt.compareByField(this.field,e,t);switch(this.dir){case Xr.ASCENDING:return n;case Xr.DESCENDING:return-1*n;default:return y("Unknown direction: "+this.dir)}},e.prototype.canonicalId=function(){return this.field.canonicalString()+this.dir.toString()},e.prototype.toString=function(){return this.field.canonicalString()+" ("+this.dir+")"},e.prototype.isEqual=function(e){return this.dir===e.dir&&this.field.isEqual(e.field)},e}(),ni=new ti(ue.keyField(),Xr.ASCENDING),ri=new ti(ue.keyField(),Xr.DESCENDING),ii=function(){function e(){}return e.prototype.applyToLocalView=function(e,t){return new kn(t,e)},e.prototype.applyToRemoteDocument=function(e,t){return t},e.prototype.computeBaseValue=function(e){return null},e.prototype.isEqual=function(t){return t instanceof e},e.instance=new e,e}(),oi=function(){function e(e){this.elements=e}return e.prototype.applyToLocalView=function(e,t){return this.apply(e)},e.prototype.applyToRemoteDocument=function(e,t){return this.apply(e)},e.prototype.apply=function(e){for(var t=ui(e),n=function(e){t.find(function(t){return t.isEqual(e)}
1)||t.push(e)},r=0,i=this.elements;r<i.length;r++)n(i[r]);return new Mn(t)},e.prototype.computeBaseValue=function(e){return null},e.prototype.isEqual=function(t){return t instanceof e&&$(t.elements,this.elements)},e}(),si=function(){function e(e){this.elements=e}return e.prototype.applyToLocalView=function(e,t){return this.apply(e)},e.prototype.applyToRemoteDocument=function(e,t){return this.apply(e)},e.prototype.apply=function(e){for(var t=ui(e),n=function(e){t=t.filter(function(t){return!t.isEqual(e)})},r=0,i=this.elements;r<i.length;r++)n(i[r]);return new Mn(t)},e.prototype.computeBaseValue=function(e){return null},e.prototype.isEqual=function(t){return t instanceof e&&$(t.elements,this.elements)},e}(),ai=function(){function e(e){this.operand=e}return e.prototype.applyToLocalView=function(e,t){var n=this.computeBaseValue(e);return n instanceof Tn&&this.operand instanceof Tn?new Tn(n.internalValue+this.operand.internalValue):new In(n.internalValue+this.operand.internalValue)},e.prototype.applyToRemoteDocument=function(e,t){return b(null!==t,"Didn't receive transformResult for NUMERIC_ADD transform"),t},e.prototype.computeBaseValue=function(e){return e instanceof En?e:new Tn(0)},e.prototype.isEqual=function(t){return t instanceof e&&this.operand.isEqual(t.operand)},e}();function ui(e){return e instanceof Mn?e.internalValue.slice():[]}var li,ci,hi=function(){function e(e){this.count=e}return e.prototype.isEqual=function(e){return e&&e.count===this.count},e}(),di=((li={})[Xr.ASCENDING.name]="ASCENDING",li[Xr.DESCENDING.name]="DESCENDING",li),fi=((ci={})[Qr.LESS_THAN.name]="LESS_THAN",ci[Qr.LESS_THAN_OR_EQUAL.name]="LESS_THAN_OR_EQUAL",ci[Qr.GREATER_THAN.name]="GREATER_THAN",ci[Qr.GREATER_THAN_OR_EQUAL.name]="GREATER_THAN_OR_EQUAL",ci[Qr.EQUAL.name]="EQUAL",ci[Qr.ARRAY_CONTAINS.name]="ARRAY_CONTAINS",ci[Qr.IN.name]="IN",ci[Qr.ARRAY_CONTAINS_ANY.name]="ARRAY_CONTAINS_ANY",ci),pi=new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);function mi(e,t){b(!ar(e),t+" is missing")}function gi(e){return"number"==typeof e?e:"string"==typeof e?Number(e):y("can't parse "+e)}var yi=function(){function e(e,t){this.databaseId=e,this.options=t}return e.prototype.emptyByteString=function(){return this.options.useProto3Json?"":new Uint8Array(0)},e.prototype.unsafeCastProtoByteString=function(e){return e},e.prototype.fromRpcStatus=function(e){var t=void 0===e.code?_.UNKNOWN:Cr(e.code);return new S(t,e.message||"")},e.prototype.toInt32Value=function(e){return ar(e)?void 0:{value:e}},e.prototype.fromInt32Value=function(e){var t;return ar(t="object"==typeof e?e.value:e)?null:t},e.prototype.toTimestamp=function(e){return{seconds:""+e.seconds,nanos:e.nanoseconds}},e.prototype.fromTimestamp=function(e){if("string"==typeof e)return this.fromIso8601String(e);b(!!e,"Cannot deserialize null or undefined timestamp.");var t=gi(e.seconds||"0");return new Se(t,e.nanos||0)},e.prototype.fromIso8601String=function(e){var t=0,n=pi.exec(e);if(b(!!n,"invalid timestamp: "+e),n[1]){var r=n[1];r=(r+"000000000").substr(0,9),t=Number(r)}var i=new Date(e),o=Math.floor(i.getTime()/1e3);return new Se(o,t)},e.prototype.toBytes=function(e){return this.options.useProto3Json?e.toBase64():this.unsafeCastProtoByteString(e.toUint8Array())},e.prototype.fromBlob=function(e){return"string"==typeof e?(b(this.options.useProto3Json,"Expected bytes to be passed in as Uint8Array, but got a string instead."),X.fromBase64String(e)):(b(!this.options.useProto3Json,"Expected bytes to be passed in as Uint8Array, but got a string instead."),X.fromUint8Array(e))},e.prototype.toVersion=function(e){return this.toTimestamp(e.toTimestamp())},e.prototype.fromVersion=function(e){return b(!!e,"Trying to deserialize version that isn't set"),Ee.fromTimestamp(this.fromTimestamp(e))},e.prototype.toResourceName=function(e,t){return this.fullyQualifiedPrefixPath(e).child("documents").child(t).canonicalString()},e.prototype.fromResourceName=function(e){var t=se.fromString(e);return b(this.isValidResourceName(t),"Tried to deserialize invalid key "+t.toString()),t},e.prototype.toName=function(e){return this.toResourceName(this.databaseId,e.path)},e.prototype.fromName=function(e){var t=this.fromResourceName(e);return b(t.get(1)===this.databaseId.projectId,"Tried to deserialize key from different project: "+t.get(1)+" vs "+this.databaseId.projectId),b(!t.get(3)&&!this.databaseId.database||t.get(3)===this.databaseId.database,"Tried to deserialize key from different database: "+t.get(3)+" vs "+this.databaseId.database),new le(this.extractLocalPathFromResourceName(t))},e.prototype.toQueryPath=function(e){return this.toResourceName(this.databaseId,e)},e.prototype.fromQueryPath=function(e){var t=this.fromResourceName(e);return 4===t.length?se.EMPTY_PATH:this.extractLocalPathFromResourceName(t)},Object.defineProperty(e.prototype,"encodedDatabaseId",{get:function(){return new se(["projects",this.databaseId.projectId,"databases",this.databaseId.database]).canonicalString()},enumerable:!0,configurable:!0}),e.prototype.fullyQualifiedPrefixPath=function(e){return new se(["projects",e.projectId,"databases",e.database])},e.prototype.extractLocalPathFromResourceName=function(e){return b(e.length>4&&"documents"===e.get(4),"tried to deserialize invalid key "+e.toString()),e.popFirst(5)},e.prototype.isValidResourceName=function(e){return e.length>=4&&"projects"===e.get(0)&&"databases"===e.get(2)},e.prototype.toValue=function(e){if(e instanceof _n)return{nullValue:"NULL_VALUE"};if(e instanceof Sn)return{booleanValue:e.value()};if(e instanceof Tn)return{integerValue:""+e.value()};if(e instanceof In){var t=e.value();if(this.options.useProto3Json){if(isNaN(t))return{doubleValue:"NaN"};if(t===1/0)return{doubleValue:"Infinity"};if(t===-1/0)return{doubleValue:"-Infinity"}}return{doubleValue:e.value()}}return e instanceof Dn?{stringValue:e.value()}:e instanceof Rn?{mapValue:this.toMapValue(e)}:e instanceof Mn?{arrayValue:this.toArrayValue(e)}
1:e instanceof xn?{timestampValue:this.toTimestamp(e.internalValue)}:e instanceof Nn?{geoPointValue:{latitude:e.value().latitude,longitude:e.value().longitude}}:e instanceof An?{bytesValue:this.toBytes(e.value())}:e instanceof On?{referenceValue:this.toResourceName(e.databaseId,e.key.path)}:y("Unknown FieldValue "+JSON.stringify(e))},e.prototype.fromValue=function(e){var t=this;if("nullValue"in e)return _n.INSTANCE;if("booleanValue"in e)return Sn.of(e.booleanValue);if("integerValue"in e)return new Tn(gi(e.integerValue));if("doubleValue"in e){if(this.options.useProto3Json){if("NaN"===e.doubleValue)return In.NAN;if("Infinity"===e.doubleValue)return In.POSITIVE_INFINITY;if("-Infinity"===e.doubleValue)return In.NEGATIVE_INFINITY}return new In(e.doubleValue)}if("stringValue"in e)return new Dn(e.stringValue);if("mapValue"in e)return this.fromFields(e.mapValue.fields||{});if("arrayValue"in e)return mi(e.arrayValue,"arrayValue"),new Mn((e.arrayValue.values||[]).map(function(e){return t.fromValue(e)}));if("timestampValue"in e)return mi(e.timestampValue,"timestampValue"),new xn(this.fromTimestamp(e.timestampValue));if("geoPointValue"in e)return mi(e.geoPointValue,"geoPointValue"),new Nn(new Hr(e.geoPointValue.latitude||0,e.geoPointValue.longitude||0));if("bytesValue"in e){mi(e.bytesValue,"bytesValue");var n=this.fromBlob(e.bytesValue);return new An(n)}if("referenceValue"in e){mi(e.referenceValue,"referenceValue");var r=this.fromResourceName(e.referenceValue),i=new re(r.get(1),r.get(3)),o=new le(this.extractLocalPathFromResourceName(r));return new On(i,o)}return y("Unknown Value proto "+JSON.stringify(e))},e.prototype.toMutationDocument=function(e,t){return{name:this.toName(e),fields:this.toFields(t)}},e.prototype.toDocument=function(e){return b(!e.hasLocalMutations,"Can't serialize documents with mutations."),{name:this.toName(e.key),fields:this.toFields(e.data),updateTime:this.toTimestamp(e.version.toTimestamp())}},e.prototype.fromDocument=function(e,t){return new pt(this.fromName(e.name),this.fromVersion(e.updateTime),this.fromFields(e.fields||{}),{hasCommittedMutations:!!t})},e.prototype.toFields=function(e){var t=this,n={};return e.forEach(function(e,r){n[e]=t.toValue(r)}),n},e.prototype.fromFields=function(e){var t=this,n=Rn.EMPTY;return D(e,function(e,r){n=n.set(new ue([e]),t.fromValue(r))}),n},e.prototype.toMapValue=function(e){return{fields:this.toFields(e)}},e.prototype.toArrayValue=function(e){var t=this,n=[];return e.forEach(function(e){n.push(t.toValue(e))}),{values:n}},e.prototype.fromFound=function(e){b(!!e.found,"Tried to deserialize a found document from a missing document."),mi(e.found.name,"doc.found.name"),mi(e.found.updateTime,"doc.found.updateTime");var t=this.fromName(e.found.name),n=this.fromVersion(e.found.updateTime),r=this.fromFields(e.found.fields||{});return new pt(t,n,r,{},e.found)},e.prototype.fromMissing=function(e){b(!!e.missing,"Tried to deserialize a missing document from a found document."),b(!!e.readTime,"Tried to deserialize a missing document without a read time.");var t=this.fromName(e.missing),n=this.fromVersion(e.readTime);return new mt(t,n)},e.prototype.fromMaybeDocument=function(e){return"found"in e?this.fromFound(e):"missing"in e?this.fromMissing(e):y("invalid batch get response: "+JSON.stringify(e))},e.prototype.toWatchTargetChangeState=function(e){switch(e){case Pr.Added:return"ADD";case Pr.Current:return"CURRENT";case Pr.NoChange:return"NO_CHANGE";case Pr.Removed:return"REMOVE";case Pr.Reset:return"RESET";default:return y("Unknown WatchTargetChangeState: "+e)}},e.prototype.toTestWatchChange=function(e){if(e instanceof Mr)return{filter:{count:e.existenceFilter.count,targetId:e.targetId}};if(e instanceof Rr){var t;if(e.newDoc instanceof pt)return{documentChange:{document:{name:this.toName((t=e.newDoc).key),fields:this.toFields(t.data),updateTime:this.toVersion(t.version)},targetIds:e.updatedTargetIds,removedTargetIds:e.removedTargetIds}};if(e.newDoc instanceof mt)return{documentDelete:{document:this.toName((t=e.newDoc).key),readTime:this.toVersion(t.version),removedTargetIds:e.removedTargetIds}};if(null===e.newDoc)return{documentRemove:{document:this.toName(e.key),removedTargetIds:e.removedTargetIds}}}if(e instanceof Lr){var n=void 0;return e.cause&&(n={code:Tr(e.cause.code),message:e.cause.message}),{targetChange:{targetChangeType:this.toWatchTargetChangeState(e.state),targetIds:e.targetIds,resumeToken:this.unsafeCastProtoByteString(e.resumeToken),cause:n}}}
1return y("Unrecognized watch change: "+JSON.stringify(e))},e.prototype.fromWatchChange=function(e){var t;if("targetChange"in e){mi(e.targetChange,"targetChange");var n=this.fromWatchTargetChangeState(e.targetChange.targetChangeType||"NO_CHANGE"),r=e.targetChange.targetIds||[],i=e.targetChange.resumeToken||this.emptyByteString(),o=e.targetChange.cause,s=o&&this.fromRpcStatus(o);t=new Lr(n,r,i,s||null)}else if("documentChange"in e){mi(e.documentChange,"documentChange"),mi(e.documentChange.document,"documentChange.name"),mi(e.documentChange.document.name,"documentChange.document.name"),mi(e.documentChange.document.updateTime,"documentChange.document.updateTime");var a=e.documentChange,u=this.fromName(a.document.name),l=this.fromVersion(a.document.updateTime),c=this.fromFields(a.document.fields||{}),h=new pt(u,l,c,{},a.document);t=new Rr(a.targetIds||[],a.removedTargetIds||[],h.key,h)}else if("documentDelete"in e){mi(e.documentDelete,"documentDelete"),mi(e.documentDelete.document,"documentDelete.document");var d=e.documentDelete;u=this.fromName(d.document),l=d.readTime?this.fromVersion(d.readTime):Ee.forDeletedDoc(),h=new mt(u,l),t=new Rr([],d.removedTargetIds||[],h.key,h)}else if("documentRemove"in e){mi(e.documentRemove,"documentRemove"),mi(e.documentRemove.document,"documentRemove");var f=e.documentRemove;u=this.fromName(f.document),t=new Rr([],f.removedTargetIds||[],u,null)}else{if(!("filter"in e))return y("Unknown change type "+JSON.stringify(e));mi(e.filter,"filter"),mi(e.filter.targetId,"filter.targetId");var p=e.filter,m=new hi(p.count||0);t=new Mr(p.targetId,m)}return t},e.prototype.fromWatchTargetChangeState=function(e){return"NO_CHANGE"===e?Pr.NoChange:"ADD"===e?Pr.Added:"REMOVE"===e?Pr.Removed:"CURRENT"===e?Pr.Current:"RESET"===e?Pr.Reset:y("Got unexpected TargetChange.state: "+e)},e.prototype.versionFromListenResponse=function(e){if(!("targetChange"in e))return Ee.MIN;var t=e.targetChange;return t.targetIds&&t.targetIds.length?Ee.MIN:t.readTime?this.fromVersion(t.readTime):Ee.MIN},e.prototype.toMutation=function(e){var t,n=this;if(e instanceof qn)t={update:this.toMutationDocument(e.key,e.value)};else if(e instanceof zn)t={delete:this.toName(e.key)};else if(e instanceof Bn)t={update:this.toMutationDocument(e.key,e.data),updateMask:this.toDocumentMask(e.fieldMask)};else{if(!(e instanceof Hn))return y("Unknown mutation type "+e.type);t={transform:{document:this.toName(e.key),fieldTransforms:e.fieldTransforms.map(function(e){return n.toFieldTransform(e)})}}}return e.precondition.isNone||(t.currentDocument=this.toPrecondition(e.precondition)),t},e.prototype.fromMutation=function(e){var t=this,n=e.currentDocument?this.fromPrecondition(e.currentDocument):Vn.NONE;if(e.update){mi(e.update.name,"name");var r=this.fromName(e.update.name),i=this.fromFields(e.update.fields||{});if(e.updateMask){var o=this.fromDocumentMask(e.updateMask);return new Bn(r,i,o,n)}return new qn(r,i,n)}if(e.delete)return r=this.fromName(e.delete),new zn(r,n);if(e.transform){r=this.fromName(e.transform.document);var s=e.transform.fieldTransforms.map(function(e){return t.fromFieldTransform(e)});return b(!0===n.exists,'Transforms only support precondition "exists == true"'),new Hn(r,s)}return y("unknown mutation proto: "+JSON.stringify(e))},e.prototype.toPrecondition=function(e){return b(!e.isNone,"Can't serialize an empty precondition"),void 0!==e.updateTime?{updateTime:this.toVersion(e.updateTime)}:void 0!==e.exists?{exists:e.exists}:y("Unknown precondition")},e.prototype.fromPrecondition=function(e){return void 0!==e.updateTime?Vn.updateTime(this.fromVersion(e.updateTime)):void 0!==e.exists?Vn.exists(e.exists):Vn.NONE},e.prototype.fromWriteResult=function(e,t){var n=this,r=this.fromVersion(e.updateTime?e.updateTime:t),i=null;return e.transformResults&&e.transformResults.length>0&&(i=e.transformResults.map(function(e){return n.fromValue(e)})),new Fn(r,i)},e.prototype.fromWriteResults=function(e,t){var n=this;return e&&e.length>0?(b(void 0!==t,"Received a write result without a commit time"),e.map(function(e){return n.fromWriteResult(e,t)})):[]},e.prototype.toFieldTransform=function(e){var t=this,n=e.transform;if(n instanceof ii)return{fieldPath:e.field.canonicalString(),setToServerValue:"REQUEST_TIME"};if(n instanceof oi)return{fieldPath:e.field.canonicalString(),appendMissingElements:{values:n.elements.map(function(e){return t.toValue(e)})}};if(n instanceof si)return{fieldPath:e.field.canonicalString(),removeAllFromArray:{values:n.elements.map(function(e){return t.toValue(e)})}};if(n instanceof ai)return{fieldPath:e.field.canonicalString(),increment:this.toValue(n.operand)};throw y("Unknown transform: "+e.transform)},e.prototype.fromFieldTransform=function(e){var t=this,n=null;if("setToServerValue"in e)b("REQUEST_TIME"===e.setToServerValue,"Unknown server value transform proto: "+JSON.stringify(e)),n=ii.instance;else if("appendMissingElements"in e)n=new oi((e.appendMissingElements.values||[]).map(function(e){return t.fromValue(e)}));else if("removeAllFromArray"in e)n=new si((e.removeAllFromArray.values||[]).map(function(e){return t.fromValue(e)}));else if("increment"in e){var r=this.fromValue(e.increment);b(r instanceof En,"NUMERIC_ADD transform requires a NumberValue"),n=new ai(r)}else y("Unknown transform proto: "+JSON.stringify(e));var i=ue.fromServerFormat(e.fieldPath);return new Ln(i,n)},e.prototype.toDocumentsTarget=function(e){return{documents:[this.toQueryPath(e.path)]}},e.prototype.fromDocumentsTarget=function(e){var t=e.documents.length;return b(1===t,"DocumentsTarget contained other than 1 document: "+t),zr.atPath(this.fromQueryPath(e.documents[0]))},e.prototype.toQueryTarget=function(e){var t={structuredQuery:{}},n=e.path;null!==e.collectionGroup?(b(n.length%2==0,"Collection Group queries should be within a document path or root."),t.parent=this.toQueryPath(n),t.structuredQuery.from=[{collectionId:e.collectionGroup,allDescendants:!0}]):(b(n.length%2!=0,"Document queries with filters are not supported."),t.parent=this.toQueryPath(n.popLast()),t.structuredQuery.from=[{collectionId:n.lastSegment()}]);var r=this.toFilter(e.filters);r&&(t.structuredQuery.where=r);var i=this.toOrder(e.orderBy);i&&(t.structuredQuery.orderBy=i);var o=this.toInt32Value(e.limit);return void 0!==o&&(t.structuredQuery.limit=o),e.startAt&&(t.structuredQuery.startAt=this.toCursor(e.startAt)),e.endAt&&(t.structuredQuery.endAt=this.toCursor(e.endAt)),t},e.prototype.fromQueryTarget=function(e){var t=this.fromQueryPath(e.parent),n=e.structuredQuery,r
1=n.from?n.from.length:0,i=null;if(r>0){b(1===r,"StructuredQuery.from with more than one collection is not supported.");var o=n.from[0];o.allDescendants?i=o.collectionId:t=t.child(o.collectionId)}var s=[];n.where&&(s=this.fromFilter(n.where));var a=[];n.orderBy&&(a=this.fromOrder(n.orderBy));var u=null;n.limit&&(u=this.fromInt32Value(n.limit));var l=null;n.startAt&&(l=this.fromCursor(n.startAt));var c=null;return n.endAt&&(c=this.fromCursor(n.endAt)),new zr(t,i,a,s,u,l,c)},e.prototype.toListenRequestLabels=function(e){var t=this.toLabel(e.purpose);return null==t?null:{"goog-listen-tags":t}},e.prototype.toLabel=function(e){switch(e){case Yt.Listen:return null;case Yt.ExistenceFilterMismatch:return"existence-filter-mismatch";case Yt.LimboResolution:return"limbo-document";default:return y("Unrecognized query purpose: "+e)}},e.prototype.toTarget=function(e){var t,n=e.query;return(t=n.isDocumentQuery()?{documents:this.toDocumentsTarget(n)}:{query:this.toQueryTarget(n)}).targetId=e.targetId,e.resumeToken.length>0&&(t.resumeToken=this.unsafeCastProtoByteString(e.resumeToken)),t},e.prototype.toFilter=function(e){var t=this;if(0!==e.length){var n=e.map(function(e){return e instanceof Gr?t.toUnaryOrFieldFilter(e):y("Unrecognized filter: "+JSON.stringify(e))});return 1===n.length?n[0]:{compositeFilter:{op:"AND",filters:n}}}},e.prototype.fromFilter=function(e){var t=this;return e?void 0!==e.unaryFilter?[this.fromUnaryFilter(e)]:void 0!==e.fieldFilter?[this.fromFieldFilter(e)]:void 0!==e.compositeFilter?e.compositeFilter.filters.map(function(e){return t.fromFilter(e)}).reduce(function(e,t){return e.concat(t)}):y("Unknown filter: "+JSON.stringify(e)):[]},e.prototype.toOrder=function(e){var t=this;if(0!==e.length)return e.map(function(e){return t.toPropertyOrder(e)})},e.prototype.fromOrder=function(e){var t=this;return e.map(function(e){return t.fromPropertyOrder(e)})},e.prototype.toCursor=function(e){var t=this;return{before:e.before,values:e.position.map(function(e){return t.toValue(e)})}},e.prototype.fromCursor=function(e){var t=this,n=!!e.before,r=e.values.map(function(e){return t.fromValue(e)});return new ei(r,n)},e.prototype.toDirection=function(e){return di[e.name]},e.prototype.fromDirection=function(e){switch(e){case"ASCENDING":return Xr.ASCENDING;case"DESCENDING":return Xr.DESCENDING;default:return}},e.prototype.toOperatorName=function(e){return fi[e.name]},e.prototype.fromOperatorName=function(e){switch(e){case"EQUAL":return Qr.EQUAL;case"GREATER_THAN":return Qr.GREATER_THAN;case"GREATER_THAN_OR_EQUAL":return Qr.GREATER_THAN_OR_EQUAL;case"LESS_THAN":return Qr.LESS_THAN;case"LESS_THAN_OR_EQUAL":return Qr.LESS_THAN_OR_EQUAL;case"ARRAY_CONTAINS":return Qr.ARRAY_CONTAINS;case"IN":return Qr.IN;case"ARRAY_CONTAINS_ANY":return Qr.ARRAY_CONTAINS_ANY;case"OPERATOR_UNSPECIFIED":return y("Unspecified operator");default:return y("Unknown operator")}},e.prototype.toFieldPathReference=function(e){return{fieldPath:e.canonicalString()}},e.prototype.fromFieldPathReference=function(e){return ue.fromServerFormat(e.fieldPath)},e.prototype.toPropertyOrder=function(e){return{field:this.toFieldPathReference(e.field),direction:this.toDirection(e.dir)}},e.prototype.fromPropertyOrder=function(e){return new ti(this.fromFieldPathReference(e.field),this.fromDirection(e.direction))},e.prototype.fromFieldFilter=function(e){return Gr.create(this.fromFieldPathReference(e.fieldFilter.field),this.fromOperatorName(e.fieldFilter.op),this.fromValue(e.fieldFilter.value))},e.prototype.toUnaryOrFieldFilter=function(e){if(e.op===Qr.EQUAL){if(e.value.isEqual(In.NAN))return{unaryFilter:{field:this.toFieldPathReference(e.field),op:"IS_NAN"}};if(e.value.isEqual(_n.INSTANCE))return{unaryFilter:{field:this.toFieldPathReference(e.field),op:"IS_NULL"}}}return{fieldFilter:{field:this.toFieldPathReference(e.field),op:this.toOperatorName(e.op),value:this.toValue(e.value)}}},e.prototype.fromUnaryFilter=function(e){switch(e.unaryFilter.op){case"IS_NAN":var t=this.fromFieldPathReference(e.unaryFilter.field);return Gr.create(t,Qr.EQUAL,In.NAN);case"IS_NULL":var n=this.fromFieldPathReference(e.unaryFilter.field);return Gr.create(n,Qr.EQUAL,_n.INSTANCE);case"OPERATOR_UNSPECIFIED":return y("Unspecified filter");default:return y("Unknown filter")}},e.prototype.toDocumentMask=function(e){var t=[];return e.fields.forEach(function(e){return t.push(e.canonicalString())}),{fieldPaths:t}},e.prototype.fromDocumentMask=function(e){var t=(e.fieldPaths||[]).map(function(e){return ue.fromServerFormat(e)});return Pn.fromArray(t)},e}(),bi=function(){return function(){this.listeners=[]}}(),vi=function(){function e(e){this.syncEngine=e,this.queries=new yt(function(e){return e.canonicalId()}),this.onlineState=vr.Unknown,this.syncEngine.subscribe(this)}return e.prototype.listen=function(e){var t=e.query,n=!1,r=this.queries.get(t);return r||(n=!0,r=new bi,this.queries.set(t,r)),r.listeners.push(e),e.applyOnlineStateChange(this.onlineState),r.viewSnap&&e.onViewSnapsh
1ot(r.viewSnap),n?this.syncEngine.listen(t).then(function(e){return r.targetId=e,e}):Promise.resolve(r.targetId)},e.prototype.unlisten=function(e){return s.__awaiter(this,void 0,void 0,function(){var t,n,r,i;return s.__generator(this,function(o){return n=!1,(r=this.queries.get(t=e.query))&&(i=r.listeners.indexOf(e))>=0&&(r.listeners.splice(i,1),n=0===r.listeners.length),n?(this.queries.delete(t),[2,this.syncEngine.unlisten(t)]):[2]})})},e.prototype.onWatchChange=function(e){for(var t=0,n=e;t<n.length;t++){var r=n[t],i=this.queries.get(r.query);if(i){for(var o=0,s=i.listeners;o<s.length;o++)s[o].onViewSnapshot(r);i.viewSnap=r}}},e.prototype.onWatchError=function(e,t){var n=this.queries.get(e);if(n)for(var r=0,i=n.listeners;r<i.length;r++)i[r].onError(t);this.queries.delete(e)},e.prototype.onOnlineStateChange=function(e){this.onlineState=e,this.queries.forEach(function(t,n){for(var r=0,i=n.listeners;r<i.length;r++)i[r].applyOnlineStateChange(e)})},e}(),wi=function(){function e(e,t,n){this.query=e,this.queryObserver=t,this.raisedInitialEvent=!1,this.onlineState=vr.Unknown,this.options=n||{}}return e.prototype.onViewSnapshot=function(e){if(b(e.docChanges.length>0||e.syncStateChanged,"We got a new snapshot with no changes?"),!this.options.includeMetadataChanges){for(var t=[],n=0,r=e.docChanges;n<r.length;n++){var i=r[n];i.type!==Dr.Metadata&&t.push(i)}e=new Ar(e.query,e.docs,e.oldDocs,t,e.mutatedKeys,e.fromCache,e.syncStateChanged,!0)}this.raisedInitialEvent?this.shouldRaiseEvent(e)&&this.queryObserver.next(e):this.shouldRaiseInitialEvent(e,this.onlineState)&&this.raiseInitialEvent(e),this.snap=e},e.prototype.onError=function(e){this.queryObserver.error(e)},e.prototype.applyOnlineStateChange=function(e){this.onlineState=e,this.snap&&!this.raisedInitialEvent&&this.shouldRaiseInitialEvent(this.snap,e)&&this.raiseInitialEvent(this.snap)},e.prototype.shouldRaiseInitialEvent=function(e,t){return b(!this.raisedInitialEvent,"Determining whether to raise first event but already had first event"),!e.fromCache||(this.options.waitForSyncWhenOnline&&t!==vr.Offline?(b(e.fromCache,"Waiting for sync, but snapshot is not from cache"),!1):!e.docs.isEmpty()||t===vr.Offline)},e.prototype.shouldRaiseEvent=function(e){return e.docChanges.length>0||!!(e.syncStateChanged||this.snap&&this.snap.hasPendingWrites!==e.hasPendingWrites)&&!0===this.options.includeMetadataChanges},e.prototype.raiseInitialEvent=function(e){b(!this.raisedInitialEvent,"Trying to raise initial events for second time"),e=Ar.fromInitialDocuments(e.query,e.docs,e.mutatedKeys,e.fromCache),this.raisedInitialEvent=!0,this.queryObserver.next(e)},e}(),_i=function(){function e(e,t,n){this.targetId=e,this.addedKeys=t,this.removedKeys=n}return e.fromSnapshot=function(t,n){for(var r=je(),i=je(),o=0,s=n.docChanges;o<s.length;o++){var a=s[o];switch(a.type){case Dr.Added:r=r.add(a.doc.key);break;case Dr.Removed:i=i.add(a.doc.key)}}return new e(t,r,i)},e}(),Si=function(){return function(e){this.key=e}}(),Ei=function(){return function(e){this.key=e}}(),Ci=function(){function e(e,t){this.query=e,this._syncedDocuments=t,this.syncState=null,this.current=!1,this.limboDocuments=je(),this.mutatedKeys=je(),this.documentSet=new Ir(e.docComparator.bind(e))}return Object.defineProperty(e.prototype,"syncedDocuments",{get:function(){return this._syncedDocuments},enumerable:!0,configurable:!0}),e.prototype.computeDocChanges=function(e,t){var n=this,r=t?t.changeSet:new kr,i=t?t.documentSet:this.documentSet,o=t?t.mutatedKeys:this.mutatedKeys,s=i,a=!1,u=this.query.hasLimit()&&i.size===this.query.limit?i.last():null;if(e.inorderTraversal(function(e,t){var l=i.get(e),c=t instanceof pt?t:null;c&&(b(e.isEqual(c.key),"Mismatching keys found in document changes: "+e+" != "+c.key),c=n.query.matches(c)?c:null);var h=!!l&&n.mutatedKeys.has(l.key),d=!!c&&(c.hasLocalMutations||n.mutatedKeys.has(c.key)&&c.hasCommittedMutations),f=!1;l&&c?l.data.isEqual(c.data)?h!==d&&(r.track({type:Dr.Metadata,doc:c}),f=!0):n.shouldWaitForSyncedDocument(l,c)||(r.track({type:Dr.Modified,doc:c}),f=!0,u&&n.query.docComparator(c,u)>0&&(a=!0)):!l&&c?(r.track({type:Dr.Added,doc:c}),f=!0):l&&!c&&(r.track({type:Dr.Removed,doc:l}),f=!0,u&&(a=!0)),f&&(c?(s=s.add(c),o=d?o.add(e):o.delete(e)):(s=s.delete(e),o=o.delete(e)))}),this.query.hasLimit())for(;s.size>this.query.limit;){var l=s.last();s=s.delete(l.key),o=o.delete(l.key),r.track({type:Dr.Removed,doc:l})}return b(!a||!t,"View was refilled using docs that themselves needed refilling."),{documentSet
1:s,changeSet:r,needsRefill:a,mutatedKeys:o}},e.prototype.shouldWaitForSyncedDocument=function(e,t){return e.hasLocalMutations&&t.hasCommittedMutations&&!t.hasLocalMutations},e.prototype.applyChanges=function(e,t,n){var r=this;b(!e.needsRefill,"Cannot apply changes that need a refill");var i=this.documentSet;this.documentSet=e.documentSet,this.mutatedKeys=e.mutatedKeys;var o=e.changeSet.getChanges();o.sort(function(e,t){return function(e,t){var n=function(e){switch(e){case Dr.Added:return 1;case Dr.Modified:case Dr.Metadata:return 2;case Dr.Removed:return 0;default:return y("Unknown ChangeType: "+e)}};return n(e)-n(t)}(e.type,t.type)||r.query.docComparator(e.doc,t.doc)}),this.applyTargetChange(n);var s=t?this.updateLimboDocuments():[],a=0===this.limboDocuments.size&&this.current?xr.Synced:xr.Local,u=a!==this.syncState;return this.syncState=a,0!==o.length||u?{snapshot:new Ar(this.query,e.documentSet,i,o,e.mutatedKeys,a===xr.Local,u,!1),limboChanges:s}:{limboChanges:s}},e.prototype.applyOnlineStateChange=function(e){return this.current&&e===vr.Offline?(this.current=!1,this.applyChanges({documentSet:this.documentSet,changeSet:new kr,mutatedKeys:this.mutatedKeys,needsRefill:!1},!1)):{limboChanges:[]}},e.prototype.shouldBeInLimbo=function(e){return!this._syncedDocuments.has(e)&&!!this.documentSet.has(e)&&!this.documentSet.get(e).hasLocalMutations},e.prototype.applyTargetChange=function(e){var t=this;e&&(e.addedDocuments.forEach(function(e){return t._syncedDocuments=t._syncedDocuments.add(e)}),e.modifiedDocuments.forEach(function(e){return b(t._syncedDocuments.has(e),"Modified document "+e+" not found in view.")}),e.removedDocuments.forEach(function(e){return t._syncedDocuments=t._syncedDocuments.delete(e)}),this.current=e.current)},e.prototype.updateLimboDocuments=function(){var e=this;if(!this.current)return[];var t=this.limboDocuments;this.limboDocuments=je(),this.documentSet.forEach(function(t){e.shouldBeInLimbo(t.key)&&(e.limboDocuments=e.limboDocuments.add(t.key))});var n=[];return t.forEach(function(t){e.limboDocuments.has(t)||n.push(new Ei(t))}),this.limboDocuments.forEach(function(e){t.has(e)||n.push(new Si(e))}),n},e.prototype.synchronizeWithPersistedState=function(e,t){this._syncedDocuments=t,this.limboDocuments=je();var n=this.computeDocChanges(e);return this.applyChanges(n,!0)},e.prototype.computeInitialSnapshot=function(){return Ar.fromInitialDocuments(this.query,this.documentSet,this.mutatedKeys,this.syncState===xr.Local)},e}(),Ti=function(){return function(e,t,n){this.query=e,this.targetId=t,this.view=n}}(),Ii=function(){return function(e){this.key=e}}(),Di=function(){function e(e,t,n,r){this.localStore=e,this.remoteStore=t,this.sharedClientState=n,this.currentUser=r,this.syncEngineListener=null,this.queryViewsByQuery=new yt(function(e){return e.canonicalId()}),this.queryViewsByTarget={},this.limboTargetsByKey=new Ce(le.comparator),this.limboResolutionsByTarget={},this.limboDocumentRefs=new Qn,this.mutationUserCallbacks={},this.limboTargetIdGenerator=Xe.forSyncEngine(),this.isPrimary=void 0,this.onlineState=vr.Unknown}return Object.defineProperty(e.prototype,"isPrimaryClient",{get:function(){return!0===this.isPrimary},enumerable:!0,configurable:!0}),e.prototype.subscribe=function(e){b(null!==e,"SyncEngine listener cannot be null"),b(null===this.syncEngineListener,"SyncEngine already has a subscriber."),this.syncEngineListener=e},e.prototype.listen=function(e){return s.__awaiter(this,void 0,void 0,function(){var t,n,r,i,o;return s.__generator(this,function(s){switch(s.label){case 0:return this.assertSubscribed("listen()"),(r=this.queryViewsByQuery.get(e))?(this.sharedClientState.addLocalQueryTarget(t=r.targetId),n=r.view.computeInitialSnapshot(),[3,4]):[3,1];case 1:return[4,this.localStore.allocateQuery(e)];case 2:return i=s.sent(),o=this.sharedClientState.addLocalQueryTarget(i.targetId),t=i.targetId,[4,this.initializeViewAndComputeSnapshot(i,"current"===o)];case 3:n=s.sent(),this.isPrimary&&this.remoteStore.listen(i),s.label=4;case 4:return this.syncEngineListener.onWatchChange([n]),[2,t]}})})},e.prototype.initializeViewAndComputeSnapshot=function(e,t){return s.__awaiter(this,void 0,void 0,function(){var n,r,i,o,a,u,l,c;return s.__generator(this,function(s){switch(s.label){case 0:return[4,this.localStore.executeQuery(n=e.query)];case 1:return r=s.sent(),[4,this.localStore.remoteDocumentKeys(e.targetId)];case 2:return i=s.sent(),o=new Ci(n,i),a=o.computeDocChanges(r),u=Nr.createSynthesizedTargetChangeForCurrentChange(e.targetId,t&&this.onlineState!==vr.Offline),b(0===(l=o.applyChanges(a,!0===this.isPrimary,u)).limboChanges.length,"View returned limbo docs before target ack from the server."),b(!!l.snapshot,"applyChanges for new view should always return a snapshot"),c=new Ti(n,e.targetId,o),this.queryViewsByQuery.set(n,c),this.queryViewsByTarget[e.targetId]=c,[2,l.snapshot]}})})},e.prototype.synchronizeViewAndComputeSnapshot=function(e){return s.__awaiter(this,void 0,void 0,function(){var t,n,r;return s.__generator(this,function(i){switch(i.label){case 0:return[4,this.localStore.executeQuery(e.query)];case 1:return t=i.sent(),[4,this.localStore.remoteDocumentKeys(e.targetId)];case 2:return n=i.sent(),r=e.view.synchronizeWithPersistedState(t,n),this.isPrimary&&this.updateTrackedLimbos(e.targetId,r.limboChanges),[2,r]}})})},e.prototype.unlisten=function(e){return s.__awaiter(this,void 0,void 0,function(){var t,n=this;return s.__generator(this,function(r){switch(r.label){case 0:return this.assertSubscribed("unlisten()"),b(!!(t=this.queryViewsByQuery.get(e)),"Trying to unlisten on query not found:"+e),this.isPrimary?(this.sharedCl
1ientState.removeLocalQueryTarget(t.targetId),this.sharedClientState.isActiveQueryTarget(t.targetId)?[3,2]:[4,this.localStore.releaseQuery(e,!1).then(function(){n.sharedClientState.clearQueryState(t.targetId),n.remoteStore.unlisten(t.targetId),n.removeAndCleanupQuery(t)}).catch(dn)]):[3,3];case 1:r.sent(),r.label=2;case 2:return[3,5];case 3:return this.removeAndCleanupQuery(t),[4,this.localStore.releaseQuery(e,!0)];case 4:r.sent(),r.label=5;case 5:return[2]}})})},e.prototype.write=function(e,t){return s.__awaiter(this,void 0,void 0,function(){var n;return s.__generator(this,function(r){switch(r.label){case 0:return this.assertSubscribed("write()"),[4,this.localStore.localWrite(e)];case 1:return n=r.sent(),this.sharedClientState.addPendingMutation(n.batchId),this.addMutationCallback(n.batchId,t),[4,this.emitNewSnapsAndNotifyLocalStore(n.changes)];case 2:return r.sent(),[4,this.remoteStore.fillWritePipeline()];case 3:return r.sent(),[2]}})})},e.prototype.runTransaction=function(e,t){return void 0===t&&(t=5),s.__awaiter(this,void 0,void 0,function(){var n,r,i,o;return s.__generator(this,function(s){switch(s.label){case 0:if(b(t>=0,"Got negative number of retries for transaction."),n=this.remoteStore.createTransaction(),ar(r=e(n))||!r.catch||!r.then)return[2,Promise.reject(Error("Transaction callback must return a Promise"))];s.label=1;case 1:return s.trys.push([1,4,,5]),[4,r];case 2:return i=s.sent(),[4,n.commit()];case 3:return s.sent(),[2,i];case 4:return o=s.sent(),t>0&&this.isRetryableTransactionError(o)?[2,this.runTransaction(e,t-1)]:[2,Promise.reject(o)];case 5:return[2]}})})},e.prototype.applyRemoteEvent=function(e){return s.__awaiter(this,void 0,void 0,function(){var t,n=this;return s.__generator(this,function(r){switch(r.label){case 0:this.assertSubscribed("applyRemoteEvent()"),r.label=1;case 1:return r.trys.push([1,4,,6]),[4,this.localStore.applyRemoteEvent(e)];case 2:return t=r.sent(),D(e.targetChanges,function(e,t){var r=n.limboResolutionsByTarget[Number(e)];r&&(b(t.addedDocuments.size+t.modifiedDocuments.size+t.removedDocuments.size<=1,"Limbo resolution for single document contains multiple changes."),t.addedDocuments.size>0?r.receivedDocument=!0:t.modifiedDocuments.size>0?b(r.receivedDocument,"Received change for limbo target document without add."):t.removedDocuments.size>0&&(b(r.receivedDocument,"Received remove for limbo target document without add."),r.receivedDocument=!1))}),[4,this.emitNewSnapsAndNotifyLocalStore(t,e)];case 3:return r.sent(),[3,6];case 4:return[4,dn(r.sent())];case 5:return r.sent(),[3,6];case 6:return[2]}})})},e.prototype.applyOnlineStateChange=function(e,t){if(this.isPrimary&&t===wr.RemoteStore||!this.isPrimary&&t===wr.SharedClientState){var n=[];this.queryViewsByQuery.forEach(function(t,r){var i=r.view.applyOnlineStateChange(e);b(0===i.limboChanges.length,"OnlineState should not affect limbo documents."),i.snapshot&&n.push(i.snapshot)}),this.syncEngineListener.onOnlineStateChange(e),this.syncEngineListener.onWatchChange(n),this.onlineState=e,this.isPrimary&&this.sharedClientState.setOnlineState(e)}},e.prototype.rejectListen=function(e,t){return s.__awaiter(this,void 0,void 0,function(){var n,r,i,o,a,u,l=this;return s.__generator(this,function(s){switch(s.label){case 0:return this.assertSubscribed("rejectListens()"),this.sharedClientState.updateQueryState(e,"rejected",t),(r=(n=this.limboResolutionsByTarget[e])&&n.key)?(this.limboTargetsByKey=this.limboTargetsByKey.remove(r),delete this.limboResolutionsByTarget[e],i=(i=new Ce(le.comparator)).insert(r,new mt(r,Ee.forDeletedDoc())),o=je().add(r),a=new Or(Ee.MIN,{},new xe(K),i,o),[2,this.applyRemoteEvent(a)]):[3,1];case 1:return b(!!(u=this.queryViewsByTarget[e]),"Unknown targetId: "+e),[4,this.localStore.releaseQuery(u.query,!1).then(function(){return l.removeAndCleanupQuery(u)}).catch(dn)];case 2:s.sent(),this.syncEngineListener.onWatchError(u.query,t),s.label=3;case 3:return[2]}})})},e.prototype.applyBatchState=function(e,t,n){return s.__awaiter(this,void 0,void 0,function(){var r;return s.__generator(this,function(i){switch(i.label){case 0:return this.assertSubscribed("applyBatchState()"),[4,this.localStore.lookupMutationDocuments(e)];case 1:return null===(r=i.sent())?(p("SyncEngine","Cannot apply mutation batch with id: "+e),[2]):"pending"!==t?[3,3]:[4,this.remoteStore.fillWritePipeline()];case 2:return i.sent(),[3,4];case 3:"acknowledged"===t||"rejected"===t?(this.processUserCallback(e,n||null),this.localStore.removeCachedMutationBatchMetadata(e)):y("Unknown batchState: "+t),i.label=4;case 4:return[4,this.emitNewSnapsAndNotifyLocalStore(r)];case 5:return i.sent(),[2]}})})},e.prototype.applySuccessfulWrite=function(e){return s.__awaiter(this,void 0,void 0,function(){var t,n;return s.__generator(this,function(r){switch(r.label){case 0:this.assertSubscribed("applySuccessfulWrite()"),this.processUserCallback(t=e.batch.batchId,null),r.label=1;case 1:return r.trys.push([1,4,,6]),[4,this.localStore.acknowledgeBatch(e)];
1case 2:return n=r.sent(),this.sharedClientState.updateMutationState(t,"acknowledged"),[4,this.emitNewSnapsAndNotifyLocalStore(n)];case 3:return r.sent(),[3,6];case 4:return[4,dn(r.sent())];case 5:return r.sent(),[3,6];case 6:return[2]}})})},e.prototype.rejectFailedWrite=function(e,t){return s.__awaiter(this,void 0,void 0,function(){var n;return s.__generator(this,function(r){switch(r.label){case 0:this.assertSubscribed("rejectFailedWrite()"),this.processUserCallback(e,t),r.label=1;case 1:return r.trys.push([1,4,,6]),[4,this.localStore.rejectBatch(e)];case 2:return n=r.sent(),this.sharedClientState.updateMutationState(e,"rejected",t),[4,this.emitNewSnapsAndNotifyLocalStore(n)];case 3:return r.sent(),[3,6];case 4:return[4,dn(r.sent())];case 5:return r.sent(),[3,6];case 6:return[2]}})})},e.prototype.addMutationCallback=function(e,t){var n=this.mutationUserCallbacks[this.currentUser.toKey()];n||(n=new Ce(K)),n=n.insert(e,t),this.mutationUserCallbacks[this.currentUser.toKey()]=n},e.prototype.processUserCallback=function(e,t){var n=this.mutationUserCallbacks[this.currentUser.toKey()];if(n){var r=n.get(e);r&&(b(e===n.minKey(),"Mutation callbacks processed out-of-order?"),t?r.reject(t):r.resolve(),n=n.remove(e)),this.mutationUserCallbacks[this.currentUser.toKey()]=n}},e.prototype.removeAndCleanupQuery=function(e){var t=this;if(this.sharedClientState.removeLocalQueryTarget(e.targetId),this.queryViewsByQuery.delete(e.query),delete this.queryViewsByTarget[e.targetId],this.isPrimary){var n=this.limboDocumentRefs.referencesForId(e.targetId);this.limboDocumentRefs.removeReferencesForId(e.targetId),n.forEach(function(e){t.limboDocumentRefs.containsKey(e)||t.removeLimboTarget(e)})}},e.prototype.removeLimboTarget=function(e){var t=this.limboTargetsByKey.get(e);null!==t&&(this.remoteStore.unlisten(t),this.limboTargetsByKey=this.limboTargetsByKey.remove(e),delete this.limboResolutionsByTarget[t])},e.prototype.updateTrackedLimbos=function(e,t){for(var n=0,r=t;n<r.length;n++){var i=r[n];i instanceof Si?(this.limboDocumentRefs.addReference(i.key,e),this.trackLimboChange(i)):i instanceof Ei?(p("SyncEngine","Document no longer in limbo: "+i.key),this.limboDocumentRefs.removeReference(i.key,e),this.limboDocumentRefs.containsKey(i.key)||this.removeLimboTarget(i.key)):y("Unknown limbo change: "+JSON.stringify(i))}},e.prototype.trackLimboChange=function(e){var t=e.key;if(!this.limboTargetsByKey.get(t)){p("SyncEngine","New document in limbo: "+t);var n=this.limboTargetIdGenerator.next(),r=zr.atPath(t.path);this.limboResolutionsByTarget[n]=new Ii(t),this.remoteStore.listen(new Zt(r,n,Yt.LimboResolution,ie.INVALID)),this.limboTargetsByKey=this.limboTargetsByKey.insert(t,n)}},e.prototype.currentLimboDocs=function(){return this.limboTargetsByKey},e.prototype.emitNewSnapsAndNotifyLocalStore=function(e,t){return s.__awaiter(this,void 0,void 0,function(){var n,r,i,o=this;return s.__generator(this,function(s){switch(s.label){case 0:return n=[],r=[],i=[],this.queryViewsByQuery.forEach(function(s,a){i.push(Promise.resolve().then(function(){var t=a.view.computeDocChanges(e);return t.needsRefill?o.localStore.executeQuery(a.query).then(function(e){return a.view.computeDocChanges(e,t)}):t}).then(function(e){var i=a.view.applyChanges(e,!0===o.isPrimary,t&&t.targetChanges[a.targetId]);if(o.updateTrackedLimbos(a.targetId,i.limboChanges),i.snapshot){o.isPrimary&&o.sharedClientState.updateQueryState(a.targetId,i.snapshot.fromCache?"not-current":"current"),n.push(i.snapshot);var s=_i.fromSnapshot(a.targetId,i.snapshot);r.push(s)}}))}),[4,Promise.all(i)];case 1:return s.sent(),this.syncEngineListener.onWatchChange(n),[4,this.localStore.notifyLocalViewChanges(r)];case 2:return s.sent(),[2]}})})},e.prototype.assertSubscribed=function(e){b(null!==this.syncEngineListener,"Trying to call "+e+" before calling subscribe().")},e.prototype.handleCredentialChange=function(e){return s.__awaiter(this,void 0,void 0,function(){var t,n;return s.__generator(this,function(r){switch(r.label){case 0:return t=!this.currentUser.isEqual(e),this.currentUser=e,t?[4,this.localStore.handleUserChange(e)]:[3,3];
1case 1:return n=r.sent(),this.sharedClientState.handleUserChange(e,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]}})})},e.prototype.applyPrimaryState=function(e){return s.__awaiter(this,void 0,void 0,function(){var t,n,r,i,o,a,u=this;return s.__generator(this,function(s){switch(s.label){case 0:return!0!==e||!0===this.isPrimary?[3,3]:(this.isPrimary=!0,[4,this.remoteStore.applyPrimaryState(!0)]);case 1:return s.sent(),t=this.sharedClientState.getAllActiveQueryTargets(),[4,this.synchronizeQueryViewsAndRaiseSnapshots(t.toArray())];case 2:for(n=s.sent(),r=0,i=n;r<i.length;r++)this.remoteStore.listen(i[r]);return[3,7];case 3:return!1!==e||!1===this.isPrimary?[3,7]:(this.isPrimary=!1,o=[],a=Promise.resolve(),I(this.queryViewsByTarget,function(e,t){u.sharedClientState.isLocalQueryTarget(e)?o.push(e):a=a.then(function(){return u.unlisten(t.query)}),u.remoteStore.unlisten(t.targetId)}),[4,a]);case 4:return s.sent(),[4,this.synchronizeQueryViewsAndRaiseSnapshots(o)];case 5:return s.sent(),this.resetLimboDocuments(),[4,this.remoteStore.applyPrimaryState(!1)];case 6:s.sent(),s.label=7;case 7:return[2]}})})},e.prototype.resetLimboDocuments=function(){var e=this;I(this.limboResolutionsByTarget,function(t){e.remoteStore.unlisten(t)}),this.limboDocumentRefs.removeAllReferences(),this.limboResolutionsByTarget=[],this.limboTargetsByKey=new Ce(le.comparator)},e.prototype.synchronizeQueryViewsAndRaiseSnapshots=function(e){return s.__awaiter(this,void 0,void 0,function(){var t,n,r,i,o,a,u,l,c;return s.__generator(this,function(s){switch(s.label){case 0:t=[],n=[],r=0,i=e,s.label=1;case 1:return r<i.length?(a=void 0,(u=this.queryViewsByTarget[o=i[r]])?[4,this.localStore.releaseQuery(u.query,!0)]:[3,5]):[3,11];case 2:return s.sent(),[4,this.localStore.allocateQuery(u.query)];case 3:return a=s.sent(),[4,this.synchronizeViewAndComputeSnapshot(u)];case 4:return(l=s.sent()).snapshot&&n.push(l.snapshot),[3,9];case 5:return b(!0===this.isPrimary,"A secondary tab should never have an active query without an active view."),[4,this.localStore.getQueryForTarget(o)];case 6:return b(!!(c=s.sent()),"Query data for target "+o+" not found"),[4,this.localStore.allocateQuery(c)];case 7:return a=s.sent(),[4,this.initializeViewAndComputeSnapshot(a,!1)];case 8:s.sent(),s.label=9;case 9:t.push(a),s.label=10;case 10:return r++,[3,1];case 11:return this.syncEngineListener.onWatchChange(n),[2,t]}})})},e.prototype.isRetryableTransactionError=function(e){if("FirebaseError"===e.name){var t=e.code;return"aborted"===t||"failed-precondition"===t||!Er(t)}return!1},e.prototype.getActiveClients=function(){return this.localStore.getActiveClients()},e.prototype.applyTargetState=function(e,t,n){return s.__awaiter(this,void 0,void 0,function(){var r,i,o,a,u;return s.__generator(this,function(s){switch(s.label){case 0:if(this.isPrimary)return p("SyncEngine","Ignoring unexpected query state notification."),[2];if(!this.queryViewsByTarget[e])return[3,11];switch(t){case"current":case"not-current":return[3,1];case"rejected":return[3,8]}return[3,10];case 1:return s.trys.push([1,4,,8]),[4,this.localStore.getNewDocumentChanges()];case 2:return r=s.sent(),i=Or.createSynthesizedRemoteEventForCurrentChange(e,"current"===t),[4,this.emitNewSnapsAndNotifyLocalStore(r,i)];case 3:return s.sent(),[3,11];case 4:return(l=o=s.sent()).code!==_.DATA_LOSS||l.message!==vt?[3,6]:(a=[],I(this.queryViewsByTarget,function(e){return a.push(e)}),[4,this.synchronizeQueryViewsAndRaiseSnapshots(a)]);case 5:return s.sent(),[3,7];case 6:throw o;case 7:return[3,8];case 8:return this.removeAndCleanupQuery(u=this.queryViewsByTarget[e]),[4,this.localStore.releaseQuery(u.query,!0)];case 9:return s.sent(),this.syncEngineListener.onWatchError(u.query,n),[3,11];case 10:y("Unexpected target state: "+t),s.label=11;case 11:return[2]}var l})})},e.prototype.applyActiveTargetsChange=function(e,t){return s.__awaiter(this,void 0,void 0,function(){var n,r,i,o,a,u,l,c,h,d=this;return s.__generator(this,function(f){switch(f.label){case 0:if(!this.isPrimary)return[2];n=0,r=e,f.label=1;case 1:return n<r.length?(b(!this.queryViewsByTarget[h=r[n]],"Trying to add an already active target"),[4,this.localStore.getQueryForTarget(h)]):[3,6];case 2:return b(!!(i=f.sent()),"Query data for active target "+h+" not found"),[4,this.localStore.allocateQuery(i)];case 3:return o=f.sent(),[4,this.initializeViewAndComputeSnapshot(o,!1)];case 4:f.sent(),this.remoteStore.listen(o),f.label=5;case 5:return n++,[3,1];case 6:a=function(e){var t;return s.__generator(this,function(n){switch(n.label){case 0:return(t=u.queryViewsByTarget[e])?[4,u.localStore.releaseQuery(t.query,!1).then(function(){d.remoteStore.unlisten(e),d.removeAndCleanupQuery(t)}
1).catch(dn)]:[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}})},u=this,l=0,c=t,f.label=7;case 7:return l<c.length?[5,a(h=c[l])]:[3,10];case 8:f.sent(),f.label=9;case 9:return l++,[3,7];case 10:return[2]}})})},e.prototype.enableNetwork=function(){return this.localStore.setNetworkEnabled(!0),this.remoteStore.enableNetwork()},e.prototype.disableNetwork=function(){return this.localStore.setNetworkEnabled(!1),this.remoteStore.disableNetwork()},e.prototype.getRemoteKeysForTarget=function(e){var t=this.limboResolutionsByTarget[e];return t&&t.receivedDocument?je().add(t.key):this.queryViewsByTarget[e]?this.queryViewsByTarget[e].view.syncedDocuments:je()},e}(),xi=function(){function e(e){this.uid=e}return e.prototype.isAuthenticated=function(){return null!=this.uid},e.prototype.toKey=function(){return this.isAuthenticated()?"uid:"+this.uid:"anonymous-user"},e.prototype.isEqual=function(e){return e.uid===this.uid},e.UNAUTHENTICATED=new e(null),e.GOOGLE_CREDENTIALS=new e("google-credentials-uid"),e.FIRST_PARTY=new e("first-party-uid"),e}(),ki="SharedClientState",Ai="firestore_clients",Oi="firestore_mutations",Ni="firestore_targets",Ri="firestore_online_state",Mi="firestore_sequence_number",Pi=function(){function e(e,t,n,r){this.user=e,this.batchId=t,this.state=n,this.error=r,b(void 0!==r==("rejected"===n),"MutationMetadata must contain an error iff state is 'rejected'")}return e.fromWebStorageEntry=function(t,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),s=void 0;return o&&i.error&&(o="string"==typeof i.error.message&&"string"==typeof i.error.code)&&(s=new S(i.error.code,i.error.message)),o?new e(t,n,i.state,s):(m(ki,"Failed to parse mutation state for ID '"+n+"': "+r),null)},e.prototype.toWebStorageJSON=function(){var e={state:this.state,updateTimeMs:Date.now()};return this.error&&(e.error={code:this.error.code,message:this.error.message}),JSON.stringify(e)},e}(),Li=function(){function e(e,t,n){this.targetId=e,this.state=t,this.error=n,b(void 0!==n==("rejected"===t),"QueryTargetMetadata must contain an error iff state is 'rejected'")}return e.fromWebStorageEntry=function(t,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 S(r.error.code,r.error.message)),i?new e(t,r.state,o):(m(ki,"Failed to parse target state for ID '"+t+"': "+n),null)},e.prototype.toWebStorageJSON=function(){var e={state:this.state,updateTimeMs:Date.now()};return this.error&&(e.error={code:this.error.code,message:this.error.message}),JSON.stringify(e)},e}(),Fi=function(){function e(e,t){this.clientId=e,this.activeTargetIds=t}return e.fromWebStorageEntry=function(t,n){for(var r=JSON.parse(n),i="object"==typeof r&&r.activeTargetIds instanceof Array,o=Ue(),s=0;i&&s<r.activeTargetIds.length;++s)i=ur(r.activeTargetIds[s]),o=o.add(r.activeTargetIds[s]);return i?new e(t,o):(m(ki,"Failed to parse client data for instance '"+t+"': "+n),null)},e}(),ji=function(){function e(e,t){this.clientId=e,this.onlineState=t}return e.fromWebStorageEntry=function(t){var n=JSON.parse(t);return"object"==typeof n&&n.onlineState in vr&&"string"==typeof n.clientId?new e(n.clientId,vr[n.onlineState]):(m(ki,"Failed to parse online state: "+t),null)},e}(),Vi=function(){function e(){this.activeTargetIds=Ue()}return e.prototype.addQueryTarget=function(e){b(!this.activeTargetIds.has(e),"Target with ID '"+e+"' already active."),this.activeTargetIds=this.activeTargetIds.add(e)},e.prototype.removeQueryTarget=function(e){this.activeTargetIds=this.activeTargetIds.delete(e)},e.prototype.toWebStorageJSON=function(){var e={activeTargetIds:this.activeTargetIds.toArray(),updateTimeMs:Date.now()};return JSON.stringify(e)},e}(),Ui=function(){function e(t,n,r,i,o){if(this.queue=t,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=[],!e.isAvailable(this.platform))throw new S(_.UNIMPLEMENT
1ED,"LocalStorage is not available on this platform.");var s=r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");this.storage=this.platform.window.localStorage,this.currentUser=o,this.localClientStorageKey=this.toWebStorageClientStateKey(this.localClientId),this.sequenceNumberKey=Mi+"_"+r,this.activeClients[this.localClientId]=new Vi,this.clientStateKeyRe=new RegExp("^"+Ai+"_"+s+"_([^_]*)$"),this.mutationBatchKeyRe=new RegExp("^"+Oi+"_"+s+"_(\\d+)(?:_(.*))?$"),this.queryTargetKeyRe=new RegExp("^"+Ni+"_"+s+"_(\\d+)$"),this.onlineStateKey=Ri+"_"+r,this.platform.window.addEventListener("storage",this.storageListener)}return e.isAvailable=function(e){return!(!e.window||null==e.window.localStorage)},e.prototype.start=function(){return s.__awaiter(this,void 0,void 0,function(){var e,t,n,r,i,o,a,u,l,c,h=this;return s.__generator(this,function(s){switch(s.label){case 0:return b(!this.started,"WebStorageSharedClientState already started"),b(null!==this.syncEngine,"syncEngine property must be set before calling start()"),b(null!==this.onlineStateHandler,"onlineStateHandler property must be set before calling start()"),[4,this.syncEngine.getActiveClients()];case 1:for(e=s.sent(),t=0,n=e;t<n.length;t++)(r=n[t])!==this.localClientId&&(i=this.getItem(this.toWebStorageClientStateKey(r)))&&(o=Fi.fromWebStorageEntry(r,i))&&(this.activeClients[o.clientId]=o);for(this.persistClientState(),(a=this.storage.getItem(this.onlineStateKey))&&(u=this.fromWebStorageOnlineState(a))&&this.handleOnlineStateEvent(u),l=0,c=this.earlyEvents;l<c.length;l++)this.handleWebStorageEvent(c[l]);return this.earlyEvents=[],this.platform.window.addEventListener("unload",function(){return h.shutdown()}),this.started=!0,[2]}})})},e.prototype.writeSequenceNumber=function(e){this.setItem(this.sequenceNumberKey,JSON.stringify(e))},e.prototype.getAllActiveQueryTargets=function(){var e=Ue();return D(this.activeClients,function(t,n){e=e.unionWith(n.activeTargetIds)}),e},e.prototype.isActiveQueryTarget=function(e){for(var t in this.activeClients)if(this.activeClients.hasOwnProperty(t)&&this.activeClients[t].activeTargetIds.has(e))return!0;return!1},e.prototype.addPendingMutation=function(e){this.persistMutationState(e,"pending")},e.prototype.updateMutationState=function(e,t,n){this.persistMutationState(e,t,n),this.removeMutationState(e)},e.prototype.addLocalQueryTarget=function(e){var t="not-current";if(this.isActiveQueryTarget(e)){var n=this.storage.getItem(this.toWebStorageQueryTargetMetadataKey(e));if(n){var r=Li.fromWebStorageEntry(e,n);r&&(t=r.state)}}return this.localClientState.addQueryTarget(e),this.persistClientState(),t},e.prototype.removeLocalQueryTarget=function(e){this.localClientState.removeQueryTarget(e),this.persistClientState()},e.prototype.isLocalQueryTarget=function(e){return this.localClientState.activeTargetIds.has(e)},e.prototype.clearQueryState=function(e){this.removeItem(this.toWebStorageQueryTargetMetadataKey(e))},e.prototype.updateQueryState=function(e,t,n){this.persistQueryTargetState(e,t,n)},e.prototype.handleUserChange=function(e,t,n){var r=this;t.forEach(function(e){r.removeMutationState(e)}),this.currentUser=e,n.forEach(function(e){r.addPendingMutation(e)})},e.prototype.setOnlineState=function(e){this.persistOnlineState(e)},e.prototype.shutdown=function(){this.started&&(this.platform.window.removeEventListener("storage",this.storageListener),this.removeItem(this.localClientStorageKey),this.started=!1)},e.prototype.getItem=function(e){var t=this.storage.getItem(e);return p(ki,"READ",e,t),t},e.prototype.setItem=function(e,t){p(ki,"SET",e,t),this.storage.setItem(e,t)},e.prototype.removeItem=function(e){p(ki,"REMOVE",e),this.storage.removeItem(e)},e.prototype.handleWebStorageEvent=function(e){var t=this;if(e.storageArea===this.storage){if(p(ki,"EVENT",e.key,e.newValue),e.key===this.localClientStorageKey)return void m("Received WebStorage notification for local change. Another client might have garbage-collected our state");this.queue.enqueueAndForget(function(){return s.__awaiter(t,void 0,void 0,function(){var t,n,r,i,o,a;return s.__generator(this,function(s){if(!this.started)return this.earlyEvents.push(e),[2];if(null===e.key)return[2];if(this.clientStateKeyRe.test(e.key)){if(null==e.newValue)return n=this.fromWebStorageClientStateKey(e.ke
1y),[2,this.handleClientStateEvent(n,null)];if(t=this.fromWebStorageClientState(e.key,e.newValue))return[2,this.handleClientStateEvent(t.clientId,t)]}else if(this.mutationBatchKeyRe.test(e.key)){if(null!==e.newValue&&(r=this.fromWebStorageMutationMetadata(e.key,e.newValue)))return[2,this.handleMutationBatchEvent(r)]}else if(this.queryTargetKeyRe.test(e.key)){if(null!==e.newValue&&(i=this.fromWebStorageQueryTargetMetadata(e.key,e.newValue)))return[2,this.handleQueryTargetEvent(i)]}else if(e.key===this.onlineStateKey){if(null!==e.newValue&&(o=this.fromWebStorageOnlineState(e.newValue)))return[2,this.handleOnlineStateEvent(o)]}else e.key===this.sequenceNumberKey&&(b(!!this.sequenceNumberHandler,"Missing sequenceNumberHandler"),(a=function(e){var t=ie.INVALID;if(null!=e)try{var n=JSON.parse(e);b("number"==typeof n,"Found non-numeric sequence number"),t=n}catch(r){m(ki,"Failed to read sequence number from WebStorage",r)}return t}(e.newValue))!==ie.INVALID&&this.sequenceNumberHandler(a));return[2]})})})}},Object.defineProperty(e.prototype,"localClientState",{get:function(){return this.activeClients[this.localClientId]},enumerable:!0,configurable:!0}),e.prototype.persistClientState=function(){this.setItem(this.localClientStorageKey,this.localClientState.toWebStorageJSON())},e.prototype.persistMutationState=function(e,t,n){var r=new Pi(this.currentUser,e,t,n),i=this.toWebStorageMutationBatchKey(e);this.setItem(i,r.toWebStorageJSON())},e.prototype.removeMutationState=function(e){var t=this.toWebStorageMutationBatchKey(e);this.removeItem(t)},e.prototype.persistOnlineState=function(e){this.storage.setItem(this.onlineStateKey,JSON.stringify({clientId:this.localClientId,onlineState:vr[e]}))},e.prototype.persistQueryTargetState=function(e,t,n){var r=this.toWebStorageQueryTargetMetadataKey(e),i=new Li(e,t,n);this.setItem(r,i.toWebStorageJSON())},e.prototype.toWebStorageClientStateKey=function(e){return b(-1===e.indexOf("_"),"Client key cannot contain '_', but was '"+e+"'"),Ai+"_"+this.persistenceKey+"_"+e},e.prototype.toWebStorageQueryTargetMetadataKey=function(e){return Ni+"_"+this.persistenceKey+"_"+e},e.prototype.toWebStorageMutationBatchKey=function(e){var t=Oi+"_"+this.persistenceKey+"_"+e;return this.currentUser.isAuthenticated()&&(t+="_"+this.currentUser.uid),t},e.prototype.fromWebStorageClientStateKey=function(e){var t=this.clientStateKeyRe.exec(e);return t?t[1]:null},e.prototype.fromWebStorageClientState=function(e,t){var n=this.fromWebStorageClientStateKey(e);return b(null!==n,"Cannot parse client state key '"+e+"'"),Fi.fromWebStorageEntry(n,t)},e.prototype.fromWebStorageMutationMetadata=function(e,t){var n=this.mutationBatchKeyRe.exec(e);b(null!==n,"Cannot parse mutation batch key '"+e+"'");var r=Number(n[1]);return Pi.fromWebStorageEntry(new xi(void 0!==n[2]?n[2]:null),r,t)},e.prototype.fromWebStorageQueryTargetMetadata=function(e,t){var n=this.queryTargetKeyRe.exec(e);b(null!==n,"Cannot parse query target key '"+e+"'");var r=Number(n[1]);return Li.fromWebStorageEntry(r,t)},e.prototype.fromWebStorageOnlineState=function(e){return ji.fromWebStorageEntry(e)},e.prototype.handleMutationBatchEvent=function(e){return s.__awaiter(this,void 0,void 0,function(){return s.__generator(this,function(t){return e.user.uid!==this.currentUser.uid?(p(ki,"Ignoring mutation for non-active user "+e.user.uid),[2]):[2,this.syncEngine.applyBatchState(e.batchId,e.state,e.error)]})})},e.prototype.handleQueryTargetEvent=function(e){return this.syncEngine.applyTargetState(e.targetId,e.state,e.error)},e.prototype.handleClientStateEvent=function(e,t){var n=this,r=this.getAllActiveQueryTargets();t?this.activeClients[e]=t:delete this.activeClients[e];var i=this.getAllActiveQueryTargets(),o=[],a=[];return i.forEach(function(e){return s.__awaiter(n,void 0,void 0,function(){return s.__generator(this,function(t){return r.has(e)||o.push(e),[2]})})}),r.forEach(function(e){return s.__awaiter(n,void 0,void 0,function(){return s.__generator(this,function(t){return i.has(e)||a.push(e),[2]})})}),this.syncEngine.applyActiveTargetsChange(o,a)},e.prototype.handleOnlineStateEvent=function(e){this.activeClients[e.clientId]&&this.onlineStateHandler(e.onlineState)},e}(),qi=function(){function e(){this.localState=new Vi,this.queryState={},this.syncEngine=null,this.onlineStateHandler=null,this.sequenceNumberHandler=null}return e.prototype.addPendingMutation=function(e){},e.prototype.updateMutationState=function(e,t,n){},e.prototype.addLocalQueryTarget=function(e){return this.localState.addQueryTarget(e),this.queryState[e]||"not-current"},e.prototype.updateQueryState=function(e,t,n){this.queryState[e]=t},e.prototype.removeLocalQueryTarget=function(e){this.localState.removeQueryTarget(e)},e.prototype.isLocalQueryTarget=function(e){return this.localState.activeTargetIds.has(e)},e.prototype.clearQueryState=function(e){delete this.queryState[e]},e.prototype.getAllActiveQueryTargets=function(){return this.localState.activeTargetIds},e.prototype.isActiveQueryTarget=function(e){return this.localState.activeTargetIds.has(e)},e.prototype.start=function(){return this.localState=new Vi,Promise.resolve()},e.prototype.handleUserChange=function(e,t,n){},e.prototype.setOnlineState=function(e){},e.prototype.shutdown=function(){},e.prototype.writeSequenceNumber=function(e){},e}(),Bi=function(){function e(e,t){this.cacheSizeBytes=e,this.synchronizeTabs=t}return e.prototype.lruParams=function(){return nn.withCacheSize(this.cacheSizeBytes)},e}(),Hi=function(){return function(){}}(),zi=function(){function e(e,t,n,r){this.platform=e,this.databaseInfo=t,this.credentials=n,this.asyncQueue=r,this.clientId=G.newId(),this._clientShutdown=!1}return e.prototype.start=function(e){var t=this;this.verifyNotShutdown();var n=new ce,r=new ce,i=!1;return this.credentials.setChangeListener(function(o){i?t.asyncQueue.enqueueAndForget(function(){return t.handleCredentialChange(o)}):(i=!0,t.initializePersistence(e,r,o).then(function(e){return t.initializeRest(o,e)}).then(n.resolve,n.reject))}),this.asyncQueue.enqueueAndForget(function(){return n.promise}),r.promise},e.prototype.enableNetwork=function(){var e=this;return this.verifyNotShutdown(),this.asyncQueue.enqueue(function(){return e.syncEngine.enableNetwork()})},e.prototype.initializePersistence=function(e,t,n){var r=this;return e instanceof Bi?this.startIndexedDbPersistence(n,e).then(function(e){return t.resolve(),e}).catch(function(e){if(t.reject(e),!r.canFallback(e))throw e;return console.warn("Error enabling offline persistence. Falling back to persistence disabled: "+e),r.startMemoryPersistence()}):(t.resolve(),this.startMemoryPersistence())},e.prototype.canFallback=function(e){return e instanceof S?e.code===_.FAILED_PRECONDITION||e.code===_.UNIMPLEMENT
1ED:!("undefined"!=typeof DOMException&&e instanceof DOMException)||22===e.code||20===e.code||11===e.code},e.prototype.verifyNotShutdown=function(){if(this._clientShutdown)throw new S(_.FAILED_PRECONDITION,"The client has already been shutdown.")},e.prototype.startIndexedDbPersistence=function(e,t){var n=this,r=hn.buildStoragePrefix(this.databaseInfo),i=new yi(this.databaseInfo.databaseId,{useProto3Json:!0});return Promise.resolve().then(function(){return s.__awaiter(n,void 0,void 0,function(){var n,o;return s.__generator(this,function(s){switch(s.label){case 0:if(t.synchronizeTabs&&!Ui.isAvailable(this.platform))throw new S(_.UNIMPLEMENTED,"IndexedDB persistence is only available on platforms that support LocalStorage.");return o=t.lruParams(),t.synchronizeTabs?(this.sharedClientState=new Ui(this.asyncQueue,this.platform,r,this.clientId,e),[4,hn.createMultiClientIndexedDbPersistence(r,this.clientId,this.platform,this.asyncQueue,i,o,{sequenceNumberSyncer:this.sharedClientState})]):[3,2];case 1:return n=s.sent(),[3,4];case 2:return this.sharedClientState=new qi,[4,hn.createIndexedDbPersistence(r,this.clientId,this.platform,this.asyncQueue,i,o)];case 3:n=s.sent(),s.label=4;case 4:return this.persistence=n,[2,n.referenceDelegate.garbageCollector]}})})})},e.prototype.startMemoryPersistence=function(){return this.persistence=Xn.createEagerPersistence(this.clientId),this.sharedClientState=new qi,Promise.resolve(null)},e.prototype.initializeRest=function(e,t){var n=this;return p("FirestoreClient","Initializing. user=",e.uid),this.platform.loadConnection(this.databaseInfo).then(function(r){return s.__awaiter(n,void 0,void 0,function(){var n,i,o,a,u=this;return s.__generator(this,function(l){switch(l.label){case 0:return this.localStore=new Kn(this.persistence,e),t&&(this.lruScheduler
1=new rn(t,this.asyncQueue,this.localStore)),n=this.platform.newConnectivityMonitor(),i=this.platform.newSerializer(this.databaseInfo.databaseId),o=new yr(this.asyncQueue,r,this.credentials,i),a=function(e){return u.syncEngine.applyOnlineStateChange(e,wr.SharedClientState)},this.remoteStore=new Br(this.localStore,o,this.asyncQueue,function(e){return u.syncEngine.applyOnlineStateChange(e,wr.RemoteStore)},n),this.syncEngine=new Di(this.localStore,this.remoteStore,this.sharedClientState,e),this.sharedClientState.onlineStateHandler=a,this.remoteStore.syncEngine=this.syncEngine,this.sharedClientState.syncEngine=this.syncEngine,this.eventMgr=new vi(this.syncEngine),[4,this.sharedClientState.start()];case 1:return l.sent(),[4,this.remoteStore.start()];case 2:return l.sent(),[4,this.persistence.setPrimaryStateListener(function(e){return s.__awaiter(u,void 0,void 0,function(){return s.__generator(this,function(t){switch(t.label){case 0:return[4,this.syncEngine.applyPrimaryState(e)];case 1:return t.sent(),this.lruScheduler&&(e&&!this.lruScheduler.started?this.lruScheduler.start():e||this.lruScheduler.stop()),[2]}})})})];case 3:return l.sent(),[4,this.persistence.setDatabaseDeletedListener(function(){return s.__awaiter(u,void 0,void 0,function(){return s.__generator(this,function(e){switch(e.label){case 0:return[4,this.shutdown()];case 1:return e.sent(),[2]}})})})];case 4:return l.sent(),[2]}})})})},e.prototype.handleCredentialChange=function(e){return this.asyncQueue.verifyOperationInProgress(),p("FirestoreClient","Credential Changed. Current user: "+e.uid),this.syncEngine.handleCredentialChange(e)},e.prototype.disableNetwork=function(){var e=this;return this.verifyNotShutdown(),this.asyncQueue.enqueue(function(){return e.syncEngine.disableNetwork()})},e.prototype.shutdown=function(){var e=this;return this.asyncQueue.enqueue(function(){return s.__awaiter(e,void 0,void 0,function(){return s.__generator(this,function(e){switch(e.label){case 0:return this._clientShutdown?[3,4]:(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()];case 3:e.sent(),this.credentials.removeChangeListener(),this._clientShutdown=!0,e.label=4;case 4:return[2]}})})})},e.prototype.listen=function(e,t,n){var r=this;this.verifyNotShutdown();var i=new wi(e,t,n);return this.asyncQueue.enqueueAndForget(function(){return r.eventMgr.listen(i)}),i},e.prototype.unlisten=function(e){var t=this;this.verifyNotShutdown(),this.asyncQueue.enqueueAndForget(function(){return t.eventMgr.unlisten(e)})},e.prototype.getDocumentFromLocalCache=function(e){var t=this;return this.verifyNotShutdown(),this.asyncQueue.enqueue(function(){return t.localStore.readDocument(e)}).then(function(e){if(e instanceof pt)return e;if(e instanceof mt)return null;throw new S(_.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.)")})},e.prototype.getDocumentsFromLocalCache=function(e){var t=this;return this.verifyNotShutdown(),this.asyncQueue.enqueue(function(){return t.localStore.executeQuery(e)}).then(function(t){var n=je(),r=new Ci(e,n),i=r.computeDocChanges(t);return r.applyChanges(i,!1).snapshot})},e.prototype.write=function(e){var t=this;this.verifyNotShutdown();var n=new ce;return this.asyncQueue.enqueueAndForget(function(){return t.syncEngine.write(e,n)}),n.promise},e.prototype.databaseId=function(){return this.databaseInfo.databaseId},Object.defineProperty(e.prototype,"clientShutdown",{get:function(){return this._clientShutdown},enumerable:!0,configurable:!0}),e.prototype.transaction=function(e){var t=this;return this.verifyNotShutdown(),this.asyncQueue.enqueue(function(){return s.__awaiter(t,void 0,void 0,function(){return s.__generator(this,function(e){return[2]})})}).then(function(){return t.syncEngine.runTransaction(e)})},e}(),Wi=function(){function e(e){this.observer=e,this.muted=!1}return e.prototype.next=function(e){this.scheduleEvent(this.observer.next,e)},e.prototype.error=function(e){this.scheduleEvent(this.observer.error,e)},e.prototype.mute=function(){this.muted=!0}
1,e.prototype.scheduleEvent=function(e,t){var n=this;this.muted||setTimeout(function(){n.muted||e(t)},0)},e}(),Qi=function(){function e(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];!function(t,n,r,i){if(!(e instanceof Array)||e.length<1)throw new S(_.INVALID_ARGUMENT,"Function FieldPath() requires its fieldNames argument to be an array with at least "+Q(1,"element")+".")}();for(var n=0;n<e.length;++n)if(R("FieldPath","string",n,e[n]),0===e[n].length)throw new S(_.INVALID_ARGUMENT,"Invalid field name at argument $(i + 1). Field names must not be empty.");this._internalPath=new ue(e)}return e.documentId=function(){return e._DOCUMENT_ID},e.prototype.isEqual=function(t){if(!(t instanceof e))throw z("isEqual","FieldPath",1,t);return this._internalPath.isEqual(t._internalPath)},e._DOCUMENT_ID=new e(ue.keyField().canonicalString()),e}(),Gi=new RegExp("[~\\*/\\[\\]]"),Ki=function(){return function(e,t){this.user=t,this.type="OAuth",this.authHeaders={Authorization:"Bearer "+e}}}(),$i=function(){function e(){this.changeListener=null}return e.prototype.getToken=function(){return Promise.resolve(null)},e.prototype.invalidateToken=function(){},e.prototype.setChangeListener=function(e){b(!this.changeListener,"Can only call setChangeListener() once."),this.changeListener=e,e(xi.UNAUTHENTICATED)},e.prototype.removeChangeListener=function(){b(null!==this.changeListener,"removeChangeListener() when no listener registered"),this.changeListener=null},e}(),Yi=function(){function e(e){var t=this;this.app=e,this.tokenListener=null,this.tokenCounter=0,this.changeListener=null,this.forceRefresh=!1,this.tokenListener=function(){t.tokenCounter++,t.currentUser=t.getUser(),t.changeListener&&t.changeListener(t.currentUser)},this.tokenCounter=0,this.app.INTERNAL.addAuthTokenListener(this.tokenListener)}return e.prototype.getToken=function(){var e=this;b(null!=this.tokenListener,"getToken cannot be called after listener removed.");var t=this.tokenCounter,n=this.forceRefresh;return this.forceRefresh=!1,this.app.INTERNAL.getToken(n).then(function(n){if(e.tokenCounter!==t)throw new S(_.ABORTED,"getToken aborted due to token change.");return n?(b("string"==typeof n.accessToken,"Invalid tokenData returned from getToken():"+n),new Ki(n.accessToken,e.currentUser)):null})},e.prototype.invalidateToken=function(){this.forceRefresh=!0},e.prototype.setChangeListener=function(e){b(!this.changeListener,"Can only call setChangeListener() once."),this.changeListener=e,this.currentUser&&e(this.currentUser)},e.prototype.removeChangeListener=function(){b(null!=this.tokenListener,"removeChangeListener() called twice"),b(null!==this.changeListener,"removeChangeListener() called when no listener registered"),this.app.INTERNAL.removeAuthTokenListener(this.tokenListener),this.tokenListener=null,this.changeListener=null},e.prototype.getUser=function(){var e=this.app.INTERNAL.getUid();return b(null===e||"string"==typeof e,"Received invalid UID: "+e),new xi(e)},e}(),Zi=function(){function e(e,t){this.gapi=e,this.sessionIndex=t,this.type="FirstParty",this.user=xi.FIRST_PARTY}return Object.defineProperty(e.prototype,"authHeaders",{get:function(){var e={"X-Goog-AuthUser":this.sessionIndex},t=this.gapi.auth.getAuthHeaderValueForFirstParty([]);return t&&(e.Authorization=t),e},enumerable:!0,configurable:!0}),e}(),Ji=function(){function e(e,t){this.gapi=e,this.sessionIndex=t}return e.prototype.getToken=function(){return Promise.resolve(new Zi(this.gapi,this.sessionIndex))},e.prototype.setChangeListener=function(e){e(xi.FIRST_PARTY)},e.prototype.removeChangeListener=function(){},e.prototype.invalidateToken=function(){},e}();function Xi(e){if(!e)return new $i;switch(e.type){case"gapi":var t=e.client;return b(!("object"!=typeof t||null===t||!t.auth||!t.auth.getAuthHeaderValueForFirstParty),"unexpected gapi interface"),new Ji(t,e.sessionIndex||"0");case"provider":return e.client;default:throw new S(_.INVALID_ARGUMENT,"makeCredentialsProvider failed due to invalid credential type")}}function eo(e){return function(e,t){if("object"!=typeof e||null===e)return!1;for(var n=e,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}(e)}var to=function(){function e(e){this._methodName=e}return e.delete=function(){return k("FieldValue.delete",arguments),no.instance},e.serverTimestamp=function(){return k("FieldValue.serverTimestamp",arguments),ro.instance},e.arrayUnion=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];
1return O("FieldValue.arrayUnion",arguments,1),new io(e)},e.arrayRemove=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return O("FieldValue.arrayRemove",arguments,1),new oo(e)},e.increment=function(e){return R("FieldValue.increment","number",1,e),A("FieldValue.increment",arguments,1),new so(e)},e.prototype.isEqual=function(e){return this===e},e}(),no=function(e){function t(){return e.call(this,"FieldValue.delete")||this}return s.__extends(t,e),t.instance=new t,t}(to),ro=function(e){function t(){return e.call(this,"FieldValue.serverTimestamp")||this}return s.__extends(t,e),t.instance=new t,t}(to),io=function(e){function t(t){var n=e.call(this,"FieldValue.arrayUnion")||this;return n._elements=t,n}return s.__extends(t,e),t}(to),oo=function(e){function t(t){var n=e.call(this,"FieldValue.arrayRemove")||this;return n._elements=t,n}return s.__extends(t,e),t}(to),so=function(e){function t(t){var n=e.call(this,"FieldValue.increment")||this;return n._operand=t,n}return s.__extends(t,e),t}(to),ao=E(to,"Use FieldValue.<field>() instead."),uo=/^__.*__$/,lo=function(){function e(e,t,n){this.data=e,this.fieldMask=t,this.fieldTransforms=n}return e.prototype.toMutations=function(e,t){var n=[];return n.push(null!==this.fieldMask?new Bn(e,this.data,this.fieldMask,t):new qn(e,this.data,t)),this.fieldTransforms.length>0&&n.push(new Hn(e,this.fieldTransforms)),n},e}(),co=function(){function e(e,t,n){this.data=e,this.fieldMask=t,this.fieldTransforms=n}return e.prototype.toMutations=function(e,t){var n=[new Bn(e,this.data,this.fieldMask,t)];return this.fieldTransforms.length>0&&n.push(new Hn(e,this.fieldTransforms)),n},e}(),ho=function(e){return e[e.Set=0]="Set",e[e.Update=1]="Update",e[e.MergeSet=2]="MergeSet",e[e.Argument=3]="Argument",e}({});function fo(e){switch(e){case ho.Set:case ho.MergeSet:case ho.Update:return!0;case ho.Argument:return!1;default:throw y("Unexpected case for UserDataSource: "+e)}}var po=function(){function e(e,t,n,r,i,o){this.dataSource=e,this.methodName=t,this.path=n,this.arrayElement=r,void 0===i&&this.validatePath(),this.arrayElement=void 0!==r&&r,this.fieldTransforms=i||[],this.fieldMask=o||[]}return e.prototype.childContextForField=function(t){var n=null==this.path?null:this.path.child(t),r=new e(this.dataSource,this.methodName,n,!1,this.fieldTransforms,this.fieldMask);return r.validatePathSegment(t),r},e.prototype.childContextForFieldPath=function(t){var n=null==this.path?null:this.path.child(t),r=new e(this.dataSource,this.methodName,n,!1,this.fieldTransforms,this.fieldMask);return r.validatePath(),r},e.prototype.childContextForArray=function(t){return new e(this.dataSource,this.methodName,null,!0,this.fieldTransforms,this.fieldMask)},e.prototype.createError=function(e){var t=null===this.path||this.path.isEmpty()?"":" (found in field "+this.path.toString()+")";return new S(_.INVALID_ARGUMENT,"Function "+this.methodName+"() called with invalid data. "+e+t)},e.prototype.contains=function(e){return void 0!==this.fieldMask.find(function(t){return e.isPrefixOf(t)})||void 0!==this.fieldTransforms.find(function(t){return e.isPrefixOf(t.field)})},e.prototype.validatePath=function(){if(null!==this.path)for(var e=0;e<this.path.length;e++)this.validatePathSegment(this.path.get(e))},e.prototype.validatePathSegment=function(e){if(fo(this.dataSource)&&uo.test(e))throw this.createError("Document fields cannot begin and end with __")},e}(),mo=function(){return function(e,t){this.databaseId=e,this.key=t}}(),go=function(){function e(e){this.preConverter=e}return e.prototype.parseSetData=function(e,t){var n=new po(ho.Set,e,ue.EMPTY_PATH);bo("Data must be an object, but it was:",n,t);var r=this.parseData(t,n);return new lo(r,null,n.fieldTransforms)},e.prototype.parseMergeData=function(e,t,n){var r=new po(ho.MergeSet,e,ue.EMPTY_PATH);bo("Data must be an object, but it was:",r,t);var i,o,s=this.parseData(t,r);if(n){for(var a=new xe(ue.comparator),u=0,l=n;u<l.length;u++){var c=l[u],h=void 0;if(c instanceof Qi)h=c._internalPath;else{if("string"!=typeof c)throw y("Expected stringOrFieldPath to be a string or a FieldPath");h=wo(e,c)}
1if(!r.contains(h))throw new S(_.INVALID_ARGUMENT,"Field '"+h+"' is specified in your field mask but missing from your input data.");a=a.add(h)}i=Pn.fromSet(a),o=r.fieldTransforms.filter(function(e){return i.covers(e.field)})}else i=Pn.fromArray(r.fieldMask),o=r.fieldTransforms;return new lo(s,i,o)},e.prototype.parseUpdateData=function(e,t){var n=this,r=new po(ho.Update,e,ue.EMPTY_PATH);bo("Data must be an object, but it was:",r,t);var i=new xe(ue.comparator),o=Rn.EMPTY;D(t,function(t,s){var a=wo(e,t),u=r.childContextForFieldPath(a);if((s=n.runPreConverter(s,u))instanceof no)i=i.add(a);else{var l=n.parseData(s,u);null!=l&&(i=i.add(a),o=o.set(a,l))}});var s=Pn.fromSet(i);return new co(o,s,r.fieldTransforms)},e.prototype.parseUpdateVarargs=function(e,t,n,r){var i=new po(ho.Update,e,ue.EMPTY_PATH),o=[vo(e,t)],s=[n];if(r.length%2!=0)throw new S(_.INVALID_ARGUMENT,"Function "+e+"() needs to be called with an even number of arguments that alternate between field names and values.");for(var a=0;a<r.length;a+=2)o.push(vo(e,r[a])),s.push(r[a+1]);var u=new xe(ue.comparator),l=Rn.EMPTY;for(a=0;a<o.length;++a){var c=o[a],h=i.childContextForFieldPath(c),d=this.runPreConverter(s[a],h);if(d instanceof no)u=u.add(c);else{var f=this.parseData(d,h);null!=f&&(u=u.add(c),l=l.set(c,f))}}var p=Pn.fromSet(u);return new co(l,p,i.fieldTransforms)},e.prototype.parseQueryValue=function(e,t){var n=new po(ho.Argument,e,ue.EMPTY_PATH),r=this.parseData(t,n);return b(null!=r,"Parsed data should not be null."),b(0===n.fieldTransforms.length,"Field transforms should have been disallowed."),r},e.prototype.runPreConverter=function(e,t){try{return this.preConverter(e)}catch(r){var n=_o(r);throw t.createError(n)}},e.prototype.parseData=function(e,t){if(yo(e=this.runPreConverter(e,t)))return bo("Unsupported field value:",t,e),this.parseObject(e,t);if(e instanceof to)return this.parseSentinelFieldValue(e,t),null;if(t.path&&t.fieldMask.push(t.path),e instanceof Array){if(t.arrayElement)throw t.createError("Nested arrays are not supported");return this.parseArray(e,t)}return this.parseScalarValue(e,t)},e.prototype.parseObject=function(e,t){var n=this,r=new Ce(K);return x(e)?t.path&&t.path.length>0&&t.fieldMask.push(t.path):D(e,function(e,i){var o=n.parseData(i,t.childContextForField(e));null!=o&&(r=r.insert(e,o))}),new Rn(r)},e.prototype.parseArray=function(e,t){for(var n=[],r=0,i=0,o=e;i<o.length;i++){var s=this.parseData(o[i],t.childContextForArray(r));null==s&&(s=_n.INSTANCE),n.push(s),r++}return new Mn(n)},e.prototype.parseSentinelFieldValue=function(e,t){if(!fo(t.dataSource))throw t.createError(e._methodName+"() can only be used with update() and set()");if(null===t.path)throw t.createError(e._methodName+"() is not currently supported inside arrays");if(e instanceof no){if(t.dataSource!==ho.MergeSet)throw t.dataSource===ho.Update?(b(t.path.length>0,"FieldValue.delete() at the top level should have already been handled."),t.createError("FieldValue.delete() can only appear at the top level of your update data")):t.createError("FieldValue.delete() cannot be used with set() unless you pass {merge:true}");t.fieldMask.push(t.path)}else if(e instanceof ro)t.fieldTransforms.push(new Ln(t.path,ii.instance));else if(e instanceof io){var n=this.parseArrayTransformElements(e._methodName,e._elements),r=new oi(n);t.fieldTransforms.push(new Ln(t.path,r))}else if(e instanceof oo){n=this.parseArrayTransformElements(e._methodName,e._elements);var i=new si(n);t.fieldTransforms.push(new Ln(t.path,i))}else if(e instanceof so){var o=this.parseQueryValue("FieldValue.increment",e._operand),s=new ai(o);t.fieldTransforms.push(new Ln(t.path,s))}else y("Unknown FieldValue type: "+e)},e.prototype.parseScalarValue=function(e,t){if(null===e)return _n.INSTANCE;if("number"==typeof e)return ur(e)?new Tn(e):new In(e);if("boolean"==typeof e)return Sn.of(e);if("string"==typeof e)return new Dn(e);if(e instanceof Date)return new xn(Se.fromDate(e));if(e instanceof Se)return new xn(new Se(e.seconds,1e3*Math.floor(e.nanoseconds/1e3)));if(e instanceof Hr)return new Nn(e);if(e instanceof X)return new An(e);if(e instanceof mo)return new On(e.databaseId,e.key);throw t.createError("Unsupported field value: "+q(e))},e.prototype.parseArrayTransformElements=function(e,t){var n=this;
1return t.map(function(t,r){var i=new po(ho.Argument,e,ue.EMPTY_PATH);return n.parseData(t,i.childContextForArray(r))})},e}();function yo(e){return!("object"!=typeof e||null===e||e instanceof Array||e instanceof Date||e instanceof Se||e instanceof Hr||e instanceof X||e instanceof mo||e instanceof to)}function bo(e,t,n){if(!yo(n)||!U(n)){var r=q(n);throw t.createError("an object"===r?e+" a custom object":e+" "+r)}}function vo(e,t){if(t instanceof Qi)return t._internalPath;if("string"==typeof t)return wo(e,t);throw new S(_.INVALID_ARGUMENT,"Function "+e+"() called with invalid data. Field path arguments must be of type string or FieldPath.")}function wo(e,t){try{return function(e){if(e.search(Gi)>=0)throw new S(_.INVALID_ARGUMENT,"Invalid field path ("+e+"). Paths must not contain '~', '*', '/', '[', or ']'");try{return new(Qi.bind.apply(Qi,[void 0].concat(e.split("."))))}catch(t){throw new S(_.INVALID_ARGUMENT,"Invalid field path ("+e+"). Paths must not be empty, begin with '.', end with '.', or contain '..'")}}(t)._internalPath}catch(r){var n=_o(r);throw new S(_.INVALID_ARGUMENT,"Function "+e+"() called with invalid data. "+n)}}function _o(e){return e instanceof Error?e.message:e.toString()}var So="firestore.googleapis.com",Eo=!0,Co=!0,To=!1,Io=nn.COLLECTION_DISABLED,Do=function(){function e(e){if(void 0===e.host){if(void 0!==e.ssl)throw new S(_.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host=So,this.ssl=Eo}else P("settings","non-empty string","host",e.host),this.host=e.host,L("settings","boolean","ssl",e.ssl),this.ssl=T(e.ssl,Eo);if(H("settings",e,["host","ssl","credentials","timestampsInSnapshots","cacheSizeBytes","experimentalForceLongPolling"]),L("settings","object","credentials",e.credentials),this.credentials=e.credentials,L("settings","boolean","timestampsInSnapshots",e.timestampsInSnapshots),!0===e.timestampsInSnapshots?m("\n  The timestampsInSnapshots setting now defaults to true and you no\n  longer need to explicitly set it. In a future release, the setting\n  will be removed entirely and so it is recommended that you remove it\n  from your firestore.settings() call now."):!1===e.timestampsInSnapshots&&m("\n  The timestampsInSnapshots setting will soon be removed. YOU MUST UPDATE\n  YOUR CODE.\n\n  To hide this warning, stop using the timestampsInSnapshots setting in your\n  firestore.settings({ ... }) call.\n\n  Once you remove the setting, Timestamps stored in Cloud Firestore will be\n  read back as Firebase Timestamp objects instead of as system Date objects.\n  So you will also need to update code expecting a Date to instead expect a\n  Timestamp. For example:\n\n  // Old:\n  const date = snapshot.get('created_at');\n  // New:\n  const timestamp = snapshot.get('created_at'); const date =\n  timestamp.toDate();\n\n  Please audit all existing usages of Date when you enable the new\n  behavior."),this.timestampsInSnapshots=T(e.timestampsInSnapshots,Co),L("settings","number","cacheSizeBytes",e.cacheSizeBytes),void 0===e.cacheSizeBytes)this.cacheSizeBytes=nn.DEFAULT_CACHE_SIZE_BYTES;else{if(e.cacheSizeBytes!==Io&&e.cacheSizeBytes<nn.MINIMUM_CACHE_SIZE_BYTES)throw new S(_.INVALID_ARGUMENT,"cacheSizeBytes must be at least "+nn.MINIMUM_CACHE_SIZE_BYTES);this.cacheSizeBytes=e.cacheSizeBytes}L("settings","boolean","experimentalForceLongPolling",e.experimentalForceLongPolling),this.forceLongPolling=void 0===e.experimentalForceLongPolling?To:e.experimentalForceLongPolling}return e.prototype.isEqual=function(e){return this.host===e.host&&this.ssl===e.ssl&&this.timestampsInSnapshots===e.timestampsInSnapshots&&this.credentials===e.credentials&&this.cacheSizeBytes===e.cacheSizeBytes&&this.forceLongPolling===e.forceLongPolling},e}(),xo=function(){return function(){}}(),ko=function(){function e(t){var n=this;this._queue=new fe,this.INTERNAL={delete:function(){return s.__awaiter(n,void 0,void 0,function(){return s.__generator(this,function(e){switch(e.label){case 0:return this.ensureClientConfigured(),[4,this._firestoreClient.shutdown()];case 1:return e.sent(),[2]}})})}};var r=new xo;if("object"==typeof t.options){var i=t;r.firebaseApp=i,r.databaseId=e.databaseIdFromApp(i),r.persistenceKey=r.firebaseApp.name,r.credentials=new Yi(i)}else{var o=t;
1if(!o.projectId)throw new S(_.INVALID_ARGUMENT,"Must provide projectId");r.databaseId=new re(o.projectId,o.database),r.persistenceKey="[DEFAULT]",r.credentials=new $i}r.settings=new Do({}),this._config=r,this._databaseId=r.databaseId}return e.prototype.settings=function(e){if(A("Firestore.settings",arguments,1),R("Firestore.settings","object",1,e),C(e,"persistence"))throw new S(_.INVALID_ARGUMENT,'"persistence" is now specified with a separate call to firestore.enablePersistence().');var t=new Do(e);if(this._firestoreClient&&!this._config.settings.isEqual(t))throw new S(_.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=t,void 0!==t.credentials&&(this._config.credentials=Xi(t.credentials))},e.prototype.enableNetwork=function(){return this.ensureClientConfigured(),this._firestoreClient.enableNetwork()},e.prototype.disableNetwork=function(){return this.ensureClientConfigured(),this._firestoreClient.disableNetwork()},e.prototype.enablePersistence=function(e){if(this._firestoreClient)throw new S(_.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.");var t=!1;return e&&(void 0!==e.experimentalTabSynchronization&&m("The 'experimentalTabSynchronization' setting has been renamed to 'synchronizeTabs'. In a future release, the setting will be removed and it is recommended that you update your firestore.enablePersistence() call to use 'synchronizeTabs'."),t=T(void 0!==e.synchronizeTabs?e.synchronizeTabs:e.experimentalTabSynchronization,!1)),this.configureClient(new Bi(this._config.settings.cacheSizeBytes,t))},e.prototype.clearPersistence=function(){var e=this,t=hn.buildStoragePrefix(this.makeDatabaseInfo()),n=new ce;return this._queue.enqueueAndForget(function(){return s.__awaiter(e,void 0,void 0,function(){var e;return s.__generator(this,function(r){switch(r.label){case 0:if(r.trys.push([0,2,,3]),void 0!==this._firestoreClient&&!this._firestoreClient.clientShutdown)throw new S(_.FAILED_PRECONDITION,"Persistence cannot be cleared after this Firestore instance is initialized.");return[4,hn.clearPersistence(t)];case 1:return r.sent(),n.resolve(),[3,3];case 2:return e=r.sent(),n.reject(e),[3,3];case 3:return[2]}})})}),n.promise},e.prototype.ensureClientConfigured=function(){return this._firestoreClient||this.configureClient(new Hi),this._firestoreClient},e.prototype.makeDatabaseInfo=function(){return new te(this._config.databaseId,this._config.persistenceKey,this._config.settings.host,this._config.settings.ssl,this._config.settings.forceLongPolling)},e.prototype.configureClient=function(e){var t=this;b(!!this._config.settings.host,"FirestoreSettings.host cannot be falsey"),b(!this._firestoreClient,"configureClient() called multiple times");var n=this.makeDatabaseInfo();return this._dataConverter=new go(function(e){if(e instanceof No){var n=t._config.databaseId,r=e.firestore._config.databaseId;if(!r.isEqual(n))throw new S(_.INVALID_ARGUMENT,"Document reference is for database "+r.projectId+"/"+r.database+" but should be for database "+n.projectId+"/"+n.database);return new mo(t._config.databaseId,e._key)}return e}),this._firestoreClient=new zi(v.getPlatform(),n,this._config.credentials,this._queue),this._firestoreClient.start(e)},e.databaseIdFromApp=function(e){var t=e.options;if(!C(t,"projectId"))throw new S(_.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');var n=t.projectId;if(!n||"string"!=typeof n)throw new S(_.INVALID_ARGUMENT,"projectId must be a string in FirebaseApp.options");return new re(n)},Object.defineProperty(e.prototype,"app",{get:function(){if(!this._config.firebaseApp)throw new S(_.FAILED_PRECONDITION,"Firestore was not initialized using the Firebase SDK. 'app' is not available");return this._config.firebaseApp},enumerable:!0,configurable:!0}),e.prototype.collection=function(e){return A("Firestore.collection",arguments,1
1),R("Firestore.collection","non-empty string",1,e),this.ensureClientConfigured(),new jo(se.fromString(e),this)},e.prototype.doc=function(e){return A("Firestore.doc",arguments,1),R("Firestore.doc","non-empty string",1,e),this.ensureClientConfigured(),No.forPath(se.fromString(e),this)},e.prototype.collectionGroup=function(e){if(A("Firestore.collectionGroup",arguments,1),R("Firestore.collectionGroup","non-empty string",1,e),e.indexOf("/")>=0)throw new S(_.INVALID_ARGUMENT,"Invalid collection ID '"+e+"' passed to function Firestore.collectionGroup(). Collection IDs must not contain '/'.");return this.ensureClientConfigured(),new Lo(new zr(se.EMPTY_PATH,e),this)},e.prototype.runTransaction=function(e){var t=this;return A("Firestore.runTransaction",arguments,1),R("Firestore.runTransaction","function",1,e),this.ensureClientConfigured().transaction(function(n){return e(new Ao(t,n))})},e.prototype.batch=function(){return this.ensureClientConfigured(),new Oo(this)},Object.defineProperty(e,"logLevel",{get:function(){switch(d()){case h.DEBUG:return"debug";case h.ERROR:return"error";case h.SILENT:return"silent";default:return y("Unknown log level: "+d())}},enumerable:!0,configurable:!0}),e.setLogLevel=function(e){switch(A("Firestore.setLogLevel",arguments,1),R("Firestore.setLogLevel","non-empty string",1,e),e){case"debug":f(h.DEBUG);break;case"error":f(h.ERROR);break;case"silent":f(h.SILENT);break;default:throw new S(_.INVALID_ARGUMENT,"Invalid log level: "+e)}},e.prototype._areTimestampsInSnapshotsEnabled=function(){return this._config.settings.timestampsInSnapshots},e}(),Ao=function(){function e(e,t){this._firestore=e,this._transaction=t}return e.prototype.get=function(e){var t=this;A("Transaction.get",arguments,1);var n=Bo("Transaction.get",e,this._firestore);return this._transaction.lookup([n._key]).then(function(e){if(!e||1!==e.length)return y("Mismatch in docs returned from document lookup.");var r=e[0];if(r instanceof mt)return new Mo(t._firestore,n._key,null,!1,!1);if(r instanceof pt)return new Mo(t._firestore,n._key,r,!1,!1);throw y("BatchGetDocumentsRequest returned unexpected document type: "+r.constructor.name)})},e.prototype.set=function(e,t,n){N("Transaction.set",arguments,2,3);var r=Bo("Transaction.set",e,this._firestore),i=(n=Vo("Transaction.set",n)).merge||n.mergeFields?this._firestore._dataConverter.parseMergeData("Transaction.set",t,n.mergeFields):this._firestore._dataConverter.parseSetData("Transaction.set",t);return this._transaction.set(r._key,i),this},e.prototype.update=function(e,t,n){for(var r,i,o=[],s=3;s<arguments.length;s++)o[s-3]=arguments[s];return"string"==typeof t||t instanceof Qi?(O("Transaction.update",arguments,3),r=Bo("Transaction.update",e,this._firestore),i=this._firestore._dataConverter.parseUpdateVarargs("Transaction.update",t,n,o)):(A("Transaction.update",arguments,2),r=Bo("Transaction.update",e,this._firestore),i=this._firestore._dataConverter.parseUpdateData("Transaction.update",t)),this._transaction.update(r._key,i),this},e.prototype.delete=function(e){A("Transaction.delete",arguments,1);var t=Bo("Transaction.delete",e,this._firestore);return this._transaction.delete(t._key),this},e}(),Oo=function(){function e(e){this._firestore=e,this._mutations=[],this._committed=!1}return e.prototype.set=function(e,t,n){N("WriteBatch.set",arguments,2,3),this.verifyNotCommitted();var r=Bo("WriteBatch.set",e,this._firestore),i=(n=Vo("WriteBatch.set",n)).merge||n.mergeFields?this._firestore._dataConverter.parseMergeData("WriteBatch.set",t,n.mergeFields):this._firestore._dataConverter.parseSetData("WriteBatch.set",t);return this._mutations=this._mutations.concat(i.toMutations(r._key,Vn.NONE)),this},e.prototype.update=function(e,t,n){for(var r,i,o=[],s=3;s<arguments.length;s++)o[s-3]=arguments[s];return this.verifyNotCommitted(),"string"==typeof t||t instanceof Qi?(O("WriteBatch.update",arguments,3),r=Bo("WriteBatch.update",e,this._firestore),i=this._firestore._dataConverter.parseUpdateVarargs("WriteBatch.update",t,n,o)):(A("WriteBatch.update",arguments,2),r=Bo("WriteBatch.update",e,this._firestore),i=this._firestore._dataConverter.parseUpd
1ateData("WriteBatch.update",t)),this._mutations=this._mutations.concat(i.toMutations(r._key,Vn.exists(!0))),this},e.prototype.delete=function(e){A("WriteBatch.delete",arguments,1),this.verifyNotCommitted();var t=Bo("WriteBatch.delete",e,this._firestore);return this._mutations=this._mutations.concat(new zn(t._key,Vn.NONE)),this},e.prototype.commit=function(){return s.__awaiter(this,void 0,void 0,function(){return s.__generator(this,function(e){return this.verifyNotCommitted(),this._committed=!0,this._mutations.length>0?[2,this._firestore.ensureClientConfigured().write(this._mutations)]:[2]})})},e.prototype.verifyNotCommitted=function(){if(this._committed)throw new S(_.FAILED_PRECONDITION,"A write batch can no longer be used after commit() has been called.")},e}(),No=function(){function e(e,t){this._key=e,this.firestore=t,this._firestoreClient=this.firestore.ensureClientConfigured()}return e.forPath=function(t,n){if(t.length%2!=0)throw new S(_.INVALID_ARGUMENT,"Invalid document reference. Document references must have an even number of segments, but "+t.canonicalString()+" has "+t.length);return new e(new le(t),n)},Object.defineProperty(e.prototype,"id",{get:function(){return this._key.path.lastSegment()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){return new jo(this._key.path.popLast(),this.firestore)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"path",{get:function(){return this._key.path.canonicalString()},enumerable:!0,configurable:!0}),e.prototype.collection=function(e){if(A("DocumentReference.collection",arguments,1),R("DocumentReference.collection","non-empty string",1,e),!e)throw new S(_.INVALID_ARGUMENT,"Must provide a non-empty collection name to collection()");var t=se.fromString(e);return new jo(this._key.path.child(t),this.firestore)},e.prototype.isEqual=function(t){if(!(t instanceof e))throw z("isEqual","DocumentReference",1,t);return this.firestore===t.firestore&&this._key.isEqual(t._key)},e.prototype.set=function(e,t){N("DocumentReference.set",arguments,1,2);var n=(t=Vo("DocumentReference.set",t)).merge||t.mergeFields?this.firestore._dataConverter.parseMergeData("DocumentReference.set",e,t.mergeFields):this.firestore._dataConverter.parseSetData("DocumentReference.set",e);return this._firestoreClient.write(n.toMutations(this._key,Vn.NONE))},e.prototype.update=function(e,t){for(var n,r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];return"string"==typeof e||e instanceof Qi?(O("DocumentReference.update",arguments,2),n=this.firestore._dataConverter.parseUpdateVarargs("DocumentReference.update",e,t,r)):(A("DocumentReference.update",arguments,1),n=this.firestore._dataConverter.parseUpdateData("DocumentReference.update",e)),this._firestoreClient.write(n.toMutations(this._key,Vn.exists(!0)))},e.prototype.delete=function(){return A("DocumentReference.delete",arguments,0),this._firestoreClient.write([new zn(this._key,Vn.NONE)])},e.prototype.onSnapshot=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];N("DocumentReference.onSnapshot",arguments,1,4);var n,r={includeMetadataChanges:!1},i=0;"object"!=typeof e[i]||eo(e[i])||(H("DocumentReference.onSnapshot",r=e[i],["includeMetadataChanges"]),L("DocumentReference.onSnapshot","boolean","includeMetadataChanges",r.includeMetadataChanges),i++);var o={includeMetadataChanges:r.includeMetadataChanges};return eo(e[i])?n=e[i]:(R("DocumentReference.onSnapshot","function",i,e[i]),M("DocumentReference.onSnapshot","function",i+1,e[i+1]),M("DocumentReference.onSnapshot","function",i+2,e[i+2]),n={next:e[i],error:e[i+1],complete:e[i+2]}),this.onSnapshotInternal(o,n)},e.prototype.onSnapshotInternal=function(e,t){var n=this,r=function(e){console.error("Uncaught Error in onSnapshot:",e)};t.error&&(r=t.error.bind(t));var i=new Wi({next:function(e){if(t.next){b(e.docs.size<=1,"Too many documents returned on a document query");var r=e.docs.get(n._key);t.next(new Mo(n.firestore,n._key,r,e.fromCache,e.hasPendingWrites))}},error:r}),o=this._firestoreClient.listen(zr.atPath(this._key.path),i,e);return function(){i.mute(),n._firestoreClient.unlisten(o)}},e.prototype.get=function(e){var t=this;return N("DocumentReference.get",arguments,0,1),qo("DocumentReference.get",e),new Promise(function(n,r){e&&"cache"===e.source?t.firestore.ensureClientConfigured().getDocumentFrom
1LocalCache(t._key).then(function(e){n(new Mo(t.firestore,t._key,e,!0,e instanceof pt&&e.hasLocalMutations))},r):t.getViaSnapshotListener(n,r,e)})},e.prototype.getViaSnapshotListener=function(e,t,n){var r=this.onSnapshotInternal({includeMetadataChanges:!0,waitForSyncWhenOnline:!0},{next:function(i){r(),!i.exists&&i.metadata.fromCache?t(new S(_.UNAVAILABLE,"Failed to get document because the client is offline.")):i.exists&&i.metadata.fromCache&&n&&"server"===n.source?t(new S(_.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.)')):e(i)},error:t})},e}(),Ro=function(){function e(e,t){this.hasPendingWrites=e,this.fromCache=t}return e.prototype.isEqual=function(e){return this.hasPendingWrites===e.hasPendingWrites&&this.fromCache===e.fromCache},e}(),Mo=function(){function e(e,t,n,r,i){this._firestore=e,this._key=t,this._document=n,this._fromCache=r,this._hasPendingWrites=i}return e.prototype.data=function(e){return N("DocumentSnapshot.data",arguments,0,1),e=Uo("DocumentSnapshot.data",e),this._document?this.convertObject(this._document.data,vn.fromSnapshotOptions(e,this._firestore._areTimestampsInSnapshotsEnabled())):void 0},e.prototype.get=function(e,t){if(N("DocumentSnapshot.get",arguments,1,2),t=Uo("DocumentSnapshot.get",t),this._document){var n=this._document.data.field(vo("DocumentSnapshot.get",e));if(null!==n)return this.convertValue(n,vn.fromSnapshotOptions(t,this._firestore._areTimestampsInSnapshotsEnabled()))}},Object.defineProperty(e.prototype,"id",{get:function(){return this._key.path.lastSegment()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ref",{get:function(){return new No(this._key,this._firestore)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"exists",{get:function(){return null!==this._document},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"metadata",{get:function(){return new Ro(this._hasPendingWrites,this._fromCache)},enumerable:!0,configurable:!0}),e.prototype.isEqual=function(t){if(!(t instanceof e))throw z("isEqual","DocumentSnapshot",1,t);return this._firestore===t._firestore&&this._fromCache===t._fromCache&&this._key.isEqual(t._key)&&(null===this._document?null===t._document:this._document.isEqual(t._document))},e.prototype.convertObject=function(e,t){var n=this,r={};return e.forEach(function(e,i){r[e]=n.convertValue(i,t)}),r},e.prototype.convertValue=function(e,t){if(e instanceof Rn)return this.convertObject(e,t);if(e instanceof Mn)return this.convertArray(e,t);if(e instanceof On){var n=e.value(t),r=this._firestore.ensureClientConfigured().databaseId();return e.databaseId.isEqual(r)||m("Document "+this._key.path+" contains a document reference within a different database ("+e.databaseId.projectId+"/"+e.databaseId.database+") which is not supported. It will be treated as a reference in the current database ("+r.projectId+"/"+r.database+") instead."),new No(n,this._firestore)}return e.value(t)},e.prototype.convertArray=function(e,t){var n=this;return e.internalValue.map(function(e){return n.convertValue(e,t)})},e}(),Po=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return s.__extends(t,e),t.prototype.data=function(t){var n=e.prototype.data.call(this,t);return b("object"==typeof n,"Document in a QueryDocumentSnapshot should exist"),n},t}(Mo),Lo=function(){function e(e,t){this._query=e,this.firestore=t}return e.prototype.where=function(t,n,r){if(A("Query.where",arguments,3),B("Query.where",3,r),"in"!==n&&"array-contains-any"!==n){var i=["<","<=","==",">=",">","array-contains"];j("Query.where",i,2,n)}var o,s=vo("Query.where",t),a=Qr.fromString(n);if(s.isKeyField()){if(a===Qr.ARRAY_CONTAINS||a===Qr.ARRAY_CONTAINS_ANY)throw new S(_.INVALID_ARGUMENT,"Invalid Query. You can't perform '"+a.toString()+"' queries on FieldPath.documentId().");if(a===Qr.IN){this.validateDisjunctiveFilterElements(r,a);for(var u=[],l=0,c=r;l<c.length;l++){var h=c[l];u.push(this.parseDocumentIdValue(h))}o=new Mn(u)}else o=this.parseDocumentIdValue(r)}else a!==Qr.IN&&a!==Qr.ARRAY_CONTAINS_ANY||this.validateDisjunctiveFilterElements(r,a),o=this.firestore._dataConverter.parseQueryValue("Query.where",r);var d=Gr.create(s,a,o);return this.validateNewFilter(d),new e(this._query.addFilter(d),this.firestore)},e.prototype.orderBy=function(t,n){var r;if(N("Query.orderBy",arguments,1,2),M("Query.orderBy","non-empty string",2,n),void 0===n||"asc"===n)r=Xr.ASCENDING;
1else{if("desc"!==n)throw new S(_.INVALID_ARGUMENT,"Function Query.orderBy() has unknown direction '"+n+"', expected 'asc' or 'desc'.");r=Xr.DESCENDING}if(null!==this._query.startAt)throw new S(_.INVALID_ARGUMENT,"Invalid query. You must not call Query.startAt() or Query.startAfter() before calling Query.orderBy().");if(null!==this._query.endAt)throw new S(_.INVALID_ARGUMENT,"Invalid query. You must not call Query.endAt() or Query.endBefore() before calling Query.orderBy().");var i=vo("Query.orderBy",t),o=new ti(i,r);return this.validateNewOrderBy(o),new e(this._query.addOrderBy(o),this.firestore)},e.prototype.limit=function(t){if(A("Query.limit",arguments,1),R("Query.limit","number",1,t),t<=0)throw new S(_.INVALID_ARGUMENT,"Invalid Query. Query limit ("+t+") is invalid. Limit must be positive.");return new e(this._query.withLimit(t),this.firestore)},e.prototype.startAt=function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];O("Query.startAt",arguments,1);var i=this.boundFromDocOrFields("Query.startAt",t,n,!0);return new e(this._query.withStartAt(i),this.firestore)},e.prototype.startAfter=function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];O("Query.startAfter",arguments,1);var i=this.boundFromDocOrFields("Query.startAfter",t,n,!1);return new e(this._query.withStartAt(i),this.firestore)},e.prototype.endBefore=function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];O("Query.endBefore",arguments,1);var i=this.boundFromDocOrFields("Query.endBefore",t,n,!0);return new e(this._query.withEndAt(i),this.firestore)},e.prototype.endAt=function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];O("Query.endAt",arguments,1);var i=this.boundFromDocOrFields("Query.endAt",t,n,!1);return new e(this._query.withEndAt(i),this.firestore)},e.prototype.isEqual=function(t){if(!(t instanceof e))throw z("isEqual","Query",1,t);return this.firestore===t.firestore&&this._query.isEqual(t._query)},e.prototype.boundFromDocOrFields=function(e,t,n,r){if(B(e,1,t),t instanceof Mo){if(n.length>0)throw new S(_.INVALID_ARGUMENT,"Too many arguments provided to "+e+"().");var i=t;if(!i.exists)throw new S(_.NOT_FOUND,"Can't use a DocumentSnapshot that doesn't exist for "+e+"().");return this.boundFromDocument(e,i._document,r)}var o=[t].concat(n);return this.boundFromFields(e,o,r)},e.prototype.boundFromDocument=function(e,t,n){for(var r=[],i=0,o=this._query.orderBy;i<o.length;i++){var s=o[i];if(s.field.isKeyField())r.push(new On(this.firestore._databaseId,t.key));else{var a=t.field(s.field);if(a instanceof kn)throw new S(_.INVALID_ARGUMENT,'Invalid query. You are trying to start or end a query using a document for which the field "'+s.field+'" is an uncommitted server timestamp. (Since the value of this field is unknown, you cannot start/end a query with it.)');if(null===a){var u=s.field.canonicalString();throw new S(_.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(a)}}return new ei(r,n)},e.prototype.boundFromFields=function(e,t,n){var r=this._query.explicitOrderBy;if(t.length>r.length)throw new S(_.INVALID_ARGUMENT,"Too many arguments provided to "+e+"(). The number of arguments must be less than or equal to the number of Query.orderBy() clauses");for(var i=[],o=0;o<t.length;o++){var s=t[o];if(r[o].field.isKeyField()){if("string"!=typeof s)throw new S(_.INVALID_ARGUMENT,"Invalid query. Expected a string for document ID in "+e+"(), but got a "+typeof s);if(!this._query.isCollectionGroupQuery()&&-1!==s.indexOf("/"))throw new S(_.INVALID_ARGUMENT,"Invalid query. When querying a collection and ordering by FieldPath.documentId(), the value passed to "+e+"() must be a plain document ID, but '"+s+"' contains a slash.");var a=this._query.path.child(se.fromString(s));if(!le.isDocumentKey(a))throw new S(_.INVALID_ARGUMENT,"Invalid query. When querying a collection group and ordering by FieldPath.documentId(), the value passed to "+e+"() must result in a valid document path, but '"+a+"' is not because it c
1ontains an odd number of segments.");var u=new le(a);i.push(new On(this.firestore._databaseId,u))}else{var l=this.firestore._dataConverter.parseQueryValue(e,s);i.push(l)}}return new ei(i,n)},e.prototype.onSnapshot=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];N("Query.onSnapshot",arguments,1,4);var n,r={},i=0;return"object"!=typeof e[i]||eo(e[i])||(H("Query.onSnapshot",r=e[i],["includeMetadataChanges"]),L("Query.onSnapshot","boolean","includeMetadataChanges",r.includeMetadataChanges),i++),eo(e[i])?n=e[i]:(R("Query.onSnapshot","function",i,e[i]),M("Query.onSnapshot","function",i+1,e[i+1]),M("Query.onSnapshot","function",i+2,e[i+2]),n={next:e[i],error:e[i+1],complete:e[i+2]}),this.onSnapshotInternal(r,n)},e.prototype.onSnapshotInternal=function(e,t){var n=this,r=function(e){console.error("Uncaught Error in onSnapshot:",e)};t.error&&(r=t.error.bind(t));var i=new Wi({next:function(e){t.next&&t.next(new Fo(n.firestore,n._query,e))},error:r}),o=this.firestore.ensureClientConfigured(),s=o.listen(this._query,i,e);return function(){i.mute(),o.unlisten(s)}},e.prototype.get=function(e){var t=this;return N("Query.get",arguments,0,1),qo("Query.get",e),new Promise(function(n,r){e&&"cache"===e.source?t.firestore.ensureClientConfigured().getDocumentsFromLocalCache(t._query).then(function(e){n(new Fo(t.firestore,t._query,e))},r):t.getViaSnapshotListener(n,r,e)})},e.prototype.getViaSnapshotListener=function(e,t,n){var r=this.onSnapshotInternal({includeMetadataChanges:!0,waitForSyncWhenOnline:!0},{next:function(i){r(),i.metadata.fromCache&&n&&"server"===n.source?t(new S(_.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.)')):e(i)},error:t})},e.prototype.parseDocumentIdValue=function(e){if("string"==typeof e){if(""===e)throw new S(_.INVALID_ARGUMENT,"Invalid query. When querying with FieldPath.documentId(), you must provide a valid document ID, but it was an empty string.");if(!this._query.isCollectionGroupQuery()&&-1!==e.indexOf("/"))throw new S(_.INVALID_ARGUMENT,"Invalid query. When querying a collection by FieldPath.documentId(), you must provide a plain document ID, but '"+e+"' contains a '/' character.");var t=this._query.path.child(se.fromString(e));if(!le.isDocumentKey(t))throw new S(_.INVALID_ARGUMENT,"Invalid query. When querying a collection group by FieldPath.documentId(), the value provided must result in a valid document path, but '"+t+"' is not because it has an odd number of segments ("+t.length+").");return new On(this.firestore._databaseId,new le(t))}if(e instanceof No)return new On(this.firestore._databaseId,e._key);throw new S(_.INVALID_ARGUMENT,"Invalid query. When querying with FieldPath.documentId(), you must provide a valid string or a DocumentReference, but it was: "+q(e)+".")},e.prototype.validateDisjunctiveFilterElements=function(e,t){if(!Array.isArray(e)||0===e.length)throw new S(_.INVALID_ARGUMENT,"Invalid Query. A non-empty array is required for '"+t.toString()+"' filters.");if(e.length>10)throw new S(_.INVALID_ARGUMENT,"Invalid Query. '"+t.toString()+"' filters support a maximum of 10 elements in the value array.");if(e.indexOf(null)>=0)throw new S(_.INVALID_ARGUMENT,"Invalid Query. '"+t.toString()+"' filters cannot contain 'null' in the value array.");if(e.filter(function(e){return Number.isNaN(e)}).length>0)throw new S(_.INVALID_ARGUMENT,"Invalid Query. '"+t.toString()+"' filters cannot contain 'NaN' in the value array.")},e.prototype.validateNewFilter=function(e){if(e instanceof Gr){var t=[Qr.ARRAY_CONTAINS,Qr.ARRAY_CONTAINS_ANY],n=[Qr.IN,Qr.ARRAY_CONTAINS_ANY],r=t.indexOf(e.op)>=0,i=n.indexOf(e.op)>=0;if(e.isInequality()){var o=this._query.getInequalityFilterField();if(null!==o&&!o.isEqual(e.field))throw new S(_.INVALID_ARGUMENT,"Invalid query. All where filters with an inequality (<, <=, >, or >=) must be on the same field. But you have inequality filters on '"+o.toString()+"' and '"+e.field.toString()+"'");var s=this._query.getFirstOrderByField();null!==s&&this.validateOrderByAndInequalityMatch(e.field,s)}else if(i||r){var a=null;if(i&&(a=this._query.findFilterOperator(n)),null===a&&r&&(a=this._query.findFilterOperator(t)),null!=a)throw new S(_.INVA
1LID_ARGUMENT,a===e.op?"Invalid query. You cannot use more than one '"+e.op.toString()+"' filter.":"Invalid query. You cannot use '"+e.op.toString()+"' filters with '"+a.toString()+"' filters.")}}},e.prototype.validateNewOrderBy=function(e){if(null===this._query.getFirstOrderByField()){var t=this._query.getInequalityFilterField();null!==t&&this.validateOrderByAndInequalityMatch(t,e.field)}},e.prototype.validateOrderByAndInequalityMatch=function(e,t){if(!t.isEqual(e))throw new S(_.INVALID_ARGUMENT,"Invalid query. You have a where filter with an inequality (<, <=, >, or >=) on field '"+e.toString()+"' and so you must also use '"+e.toString()+"' as your first Query.orderBy(), but your first Query.orderBy() is on field '"+t.toString()+"' instead.")},e}(),Fo=function(){function e(e,t,n){this._firestore=e,this._originalQuery=t,this._snapshot=n,this._cachedChanges=null,this._cachedChangesIncludeMetadataChanges=null,this.metadata=new Ro(n.hasPendingWrites,n.fromCache)}return Object.defineProperty(e.prototype,"docs",{get:function(){var e=[];return this.forEach(function(t){return e.push(t)}),e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"empty",{get:function(){return this._snapshot.docs.isEmpty()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return this._snapshot.docs.size},enumerable:!0,configurable:!0}),e.prototype.forEach=function(e,t){var n=this;N("QuerySnapshot.forEach",arguments,1,2),R("QuerySnapshot.forEach","function",1,e),this._snapshot.docs.forEach(function(r){e.call(t,n.convertToDocumentImpl(r))})},Object.defineProperty(e.prototype,"query",{get:function(){return new Lo(this._originalQuery,this._firestore)},enumerable:!0,configurable:!0}),e.prototype.docChanges=function(e){e&&(H("QuerySnapshot.docChanges",e,["includeMetadataChanges"]),L("QuerySnapshot.docChanges","boolean","includeMetadataChanges",e.includeMetadataChanges));var t=!(!e||!e.includeMetadataChanges);if(t&&this._snapshot.excludesMetadataChanges)throw new S(_.INVALID_ARGUMENT,"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");return this._cachedChanges&&this._cachedChangesIncludeMetadataChanges===t||(this._cachedChanges=function(e,t,n){if(n.oldDocs.isEmpty()){var r,i=0;return n.docChanges.map(function(t){var o=new Po(e,t.doc.key,t.doc,n.fromCache,n.mutatedKeys.has(t.doc.key));return b(t.type===Dr.Added,"Invalid event type for first snapshot"),b(!r||n.query.docComparator(r,t.doc)<0,"Got added events in wrong order"),r=t.doc,{type:"added",doc:o,oldIndex:-1,newIndex:i++}})}var o=n.oldDocs;return n.docChanges.filter(function(e){return t||e.type!==Dr.Metadata}).map(function(t){var r=new Po(e,t.doc.key,t.doc,n.fromCache,n.mutatedKeys.has(t.doc.key)),i=-1,s=-1;return t.type!==Dr.Added&&(b((i=o.indexOf(t.doc.key))>=0,"Index for document not found"),o=o.delete(t.doc.key)),t.type!==Dr.Removed&&(s=(o=o.add(t.doc)).indexOf(t.doc.key)),{type:Ho(t.type),doc:r,oldIndex:i,newIndex:s}})}(this._firestore,t,this._snapshot),this._cachedChangesIncludeMetadataChanges=t),this._cachedChanges},e.prototype.isEqual=function(t){if(!(t instanceof e))throw z("isEqual","QuerySnapshot",1,t);return this._firestore===t._firestore&&this._originalQuery.isEqual(t._originalQuery)&&this._snapshot.isEqual(t._snapshot)},e.prototype.convertToDocumentImpl=function(e){return new Po(this._firestore,e.key,e,this.metadata.fromCache,this._snapshot.mutatedKeys.has(e.key))},e}();["length","forEach","map"].concat("undefined"!=typeof Symbol?[Symbol.iterator]:[]).forEach(function(e){try{Object.defineProperty(Fo.prototype.docChanges,e,{get:function(){return function(){throw new S(_.INVALID_ARGUMENT,'QuerySnapshot.docChanges has been changed from a property into a method, so usages like "querySnapshot.docChanges" should become "querySnapshot.docChanges()"')}()}})}catch(t){}});var jo=function(e){function t(t,n){var r=e.call(this,zr.atPath(t),n)||this;if(t.length%2!=1)throw new S(_.INVALID_ARGUMENT,"Invalid collection reference. Collection references must have an odd number of segments, but "+t.canonicalString()+" has "+t.length);return r}return s.__extends(t,e),Object.defineProperty(t.prototype,"id",{get:function(){return this._query.path.lastSegment()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){var e=this._query.path.popLast();return e.isEmpty()?null:new No(new le(e),this.firestore)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"path",{get:function(){return this._query.path.
1canonicalString()},enumerable:!0,configurable:!0}),t.prototype.doc=function(e){if(N("CollectionReference.doc",arguments,0,1),0===arguments.length&&(e=G.newId()),R("CollectionReference.doc","non-empty string",1,e),""===e)throw new S(_.INVALID_ARGUMENT,"Document path must be a non-empty string");var t=se.fromString(e);return No.forPath(this._query.path.child(t),this.firestore)},t.prototype.add=function(e){A("CollectionReference.add",arguments,1),R("CollectionReference.add","object",1,e);var t=this.doc();return t.set(e).then(function(){return t})},t}(Lo);function Vo(e,t){if(void 0===t)return{merge:!1};if(H(e,t,["merge","mergeFields"]),L(e,"boolean","merge",t.merge),"mergeFields","a string or a FieldPath",void 0!==(n=t.mergeFields)&&function(e,t,n,r,i){if(!(r instanceof Array))throw new S(_.INVALID_ARGUMENT,"Function "+e+"() requires its mergeFields option to be an array, but it was: "+q(r));for(var o=0;o<r.length;++o)if(!i(r[o]))throw new S(_.INVALID_ARGUMENT,"Function "+e+"() requires all mergeFields elements to be a string or a FieldPath, but the value at index "+o+" was: "+q(r[o]))}(e,0,0,n,function(e){return"string"==typeof e||e instanceof Qi}),void 0!==t.mergeFields&&void 0!==t.merge)throw new S(_.INVALID_ARGUMENT,"Invalid options passed to function "+e+'(): You cannot specify both "merge" and "mergeFields".');var n;return t}function Uo(e,t){return void 0===t?{}:(H(e,t,["serverTimestamps"]),F(e,0,"serverTimestamps",t.serverTimestamps,["estimate","previous","none"]),t)}function qo(e,t){M(e,"object",1,t),t&&(H(e,t,["source"]),F(e,0,"source",t.source,["default","server","cache"]))}function Bo(e,t,n){if(t instanceof No){if(t.firestore!==n)throw new S(_.INVALID_ARGUMENT,"Provided document reference is from a different Firestore instance.");return t}throw z(e,"DocumentReference",1,t)}function Ho(e){switch(e){case Dr.Added:return"added";case Dr.Modified:case Dr.Metadata:return"modified";case Dr.Removed:return"removed";default:return y("Unknown change type: "+e)}}var zo=E(ko,"Use firebase.firestore() instead."),Wo=E(Ao,"Use firebase.firestore().runTransaction() instead."),Qo=E(Oo,"Use firebase.firestore().batch() instead."),Go=E(No,"Use firebase.firestore().doc() instead."),Ko=E(Mo),$o=E(Po),Yo=E(Lo),Zo=E(Fo),Jo=E(jo,"Use firebase.firestore().collection() instead."),Xo={Firestore:zo,GeoPoint:Hr,Timestamp:Se,Blob:ee,Transaction:Wo,WriteBatch:Qo,DocumentReference:Go,DocumentSnapshot:Ko,Query:Yo,QueryDocumentSnapshot:$o,QuerySnapshot:Zo,CollectionReference:Jo,FieldPath:Qi,FieldValue:ao,setLogLevel:ko.setLogLevel,CACHE_SIZE_UNLIMITED:Io},es=function(){function e(){}return e.prototype.addCallback=function(e){},e.prototype.shutdown=function(){},e}(),ts=function(){function e(){var e=this;this.networkAvailableListener=function(){return e.onNetworkAvailable()},this.networkUnavailableListener=function(){return e.onNetworkUnavailable()},this.callbacks=[],this.configureNetworkMonitoring()}return e.prototype.addCallback=function(e){this.callbacks.push(e)},e.prototype.shutdown=function(){window.removeEventListener("online",this.networkAvailableListener),window.removeEventListener("offline",this.networkUnavailableListener)},e.prototype.configureNetworkMonitoring=function(){window.addEventListener("online",this.networkAvailableListener),window.addEventListener("offline",this.networkUnavailableListener)},e.prototype.onNetworkAvailable=function(){p("ConnectivityMonitor","Network connectivity changed: AVAILABLE");for(var e=0,t=this.callbacks;e<t.length;e++)(0,t[e])(0)},e.prototype.onNetworkUnavailable=function(){p("ConnectivityMonitor","Network connectivity changed: UNAVAILABLE");for(var e=0,t=this.callbacks;e<t.length;e++)(0,t[e])(1)},e.isAvailable=function(){return"undefined"!=typeof window&&void 0!==window.addEventListener&&void 0!==window.removeEventListener},e}(),ns=function(){function e(e){this.sendFn=e.sendFn,this.closeFn=e.closeFn}return e.prototype.onOpen=function(e){b(!this.wrappedOnOpen,"Called onOpen on stream twice!"),this.wrappedOnOpen=e},e.prototype.onClose=function(e){b(!this.wrappedOnClose,"Called onClose on stream twice!"),this.wrappedOnClose=e},e.prototype.onMessage=function(e){b(!this.wrappedOnMessage,"Called onMessage on stream twice!"),this.wrappedOnMessage=e},e.prototype.close=function(){this.closeFn()},e.prototype.send=function(e){this.sendFn(e)},e.prototype.callOnOpen=function(){b(void 0!==this.wrappedOnOpen,"Cannot call onOpen because no callback was set"),this.wrappedOnOpen()},e.prototype.callOnClose=function(e){b(void 0!==this.wrappedOnClose,"Cannot call onClose because no callback was set"),this.wrappedOnClose(e)},e.prototype.callOnMessage=function(e){b(void 0!==this.wrappedOnMessage,"Cannot call onMessage because no callback was set"),this.wrappedOnMessage(e)},e}(),rs="Connection",is={BatchGetDocuments:"batchGet",Commit:"commit"},os="gl-js/ fire/"+l,ss=function(){function e(e){this.databaseId=e.databaseId,this.baseUrl=(e.ssl?"https":"http")+"://"+e.host,this.forceLongPolling=e.forceLongPolling}return e.prototype.modifyHeadersForRequest=function(e,t){if(t)for(var n in t.authHeaders)t.authHeaders.hasOwnProperty(n)&&(e[n]=t.authHeaders[n]);e["X-Goog-Api-Client"]=os},e.prototype.invokeRPC=function(e,t,n){var r=this,i=this.makeUrl(e);return new Promise(function(o,s){var a=new u.XhrIo;
1a.listenOnce(u.EventType.COMPLETE,function(){try{switch(a.getLastErrorCode()){case u.ErrorCode.NO_ERROR:var t=a.getResponseJson();p(rs,"XHR received:",JSON.stringify(t)),o(t);break;case u.ErrorCode.TIMEOUT:p(rs,'RPC "'+e+'" timed out'),s(new S(_.DEADLINE_EXCEEDED,"Request time out"));break;case u.ErrorCode.HTTP_ERROR:var n=a.getStatus();if(p(rs,'RPC "'+e+'" failed with status:',n,"response text:",a.getResponseText()),n>0){var r=a.getResponseJson().error;if(r&&r.status&&r.message){var i=(l=r.status.toLowerCase().replace("_","-"),Object.values(_).indexOf(l)>=0?l:_.UNKNOWN);s(new S(i,r.message))}else s(new S(_.UNKNOWN,"Server responded with status "+a.getStatus()))}else p(rs,'RPC "'+e+'" failed'),s(new S(_.UNAVAILABLE,"Connection failed."));break;default:y('RPC "'+e+'" failed with unanticipated webchannel error '+a.getLastErrorCode()+": "+a.getLastError()+", giving up.")}}finally{p(rs,'RPC "'+e+'" completed.')}var l});var l=JSON.stringify(t);p(rs,"XHR sending: ",i+" "+l);var c={"Content-Type":"text/plain"};r.modifyHeadersForRequest(c,n),a.send(i,"POST",l,c,15)})},e.prototype.invokeStreamingRPC=function(e,t,n){return this.invokeRPC(e,t,n)},e.prototype.openStream=function(e,t){var n=[this.baseUrl,"/","google.firestore.v1.Firestore","/",e,"/channel"],r=u.createWebChannelTransport(),i={backgroundChannelTest:!0,httpSessionIdParam:"gsessionid",initMessageHeaders:{},messageUrlParams:{database:"projects/"+this.databaseId.projectId+"/databases/"+this.databaseId.database},sendRawJson:!0,supportsCrossDomainXhr:!0,internalChannelParams:{forwardChannelRequestTimeoutMs:6e5},forceLongPolling:this.forceLongPolling};this.modifyHeadersForRequest(i.initMessageHeaders,t),a.isReactNative()||(i.httpHeadersOverwriteParam="$httpHeaders");var o=n.join("");p(rs,"Creating WebChannel: "+o+" "+i);var s=r.createWebChannel(o,i),l=!1,c=!1,h=new ns({sendFn:function(e){c?p(rs,"Not sending because WebChannel is closed:",e):(l||(p(rs,"Opening WebChannel transport."),s.open(),l=!0),p(rs,"WebChannel sending:",e),s.send(e))},closeFn:function(){return s.close()}}),d=function(e,t){s.listen(e,function(e){try{t(e)}catch(n){setTimeout(function(){throw n},0)}})};return d(u.WebChannel.EventType.OPEN,function(){c||p(rs,"WebChannel transport opened.")}),d(u.WebChannel.EventType.CLOSE,function(){c||(c=!0,p(rs,"WebChannel transport closed"),h.callOnClose())}),d(u.WebChannel.EventType.ERROR,function(e){c||(c=!0,p(rs,"WebChannel transport errored:",e),h.callOnClose(new S(_.UNAVAILABLE,"The operation could not be completed")))}),d(u.WebChannel.EventType.MESSAGE,function(e){if(!c){var t=e.data[0];b(!!t,"Got a webchannel message without data.");var n=t.error||t[0]&&t[0].error;if(n){p(rs,"WebChannel received error:",n);var r=n.status,i=function(e){var t=Sr[r];if(void 0!==t)return Cr(t)}(),o=n.message;void 0===i&&(i=_.INTERNAL,o="Unknown error status: "+r+" with message "+n.message),c=!0,h.callOnClose(new S(i,o)),s.close()}else p(rs,"WebChannel received:",t),h.callOnMessage(t)}}),setTimeout(function(){h.callOnOpen()},0),h},e.prototype.makeUrl=function(e){var t=is[e];b(void 0!==t,"Unknown REST mapping for: "+e);var n=[this.baseUrl,"/","v1"];return n.push("/projects/"),n.push(this.databaseId.projectId),n.push("/databases/"),n.push(this.databaseId.database),n.push("/documents"),n.push(":"),n.push(t),n.join("")},e}();function as(e){e.INTERNAL.registerService("firestore",function(e){return new ko(e)},function(e){b(e&&"object"==typeof e,"shallowCopy() expects object parameter.");var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}(Xo))}v.setPlatform(new(function(){function e(){this.emptyByteString="",this.base64Available="undefined"!=typeof atob}return Object.defineProperty(e.prototype,"document",{get:function(){return"undefined"!=typeof document?document:null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"window",{get:function(){return"undefined"!=typeof window?window:null},enumerable:!0,configurable:!0}),e.prototype.loadConnection=function(e){return Promise.resolve(new ss(e))},e.prototype.newConnectivityMonitor=function(){return ts.isAvailable()?new ts:new es}
1,e.prototype.newSerializer=function(e){return new yi(e,{useProto3Json:!0})},e.prototype.formatJSON=function(e){return JSON.stringify(e)},e.prototype.atob=function(e){return atob(e)},e.prototype.btoa=function(e){return btoa(e)},e}())),as(i),t.registerFirestore=as},"7o/Q":function(e,t,n){"use strict";n.d(t,"a",function(){return l});var r=n("n6bG"),i=n("gRHU"),o=n("quSY"),s=n("2QA8"),a=n("2fFW"),u=n("NJ4a");class l extends o.a{constructor(e,t,n){switch(super(),this.syncErrorValue=null,this.syncErrorThrown=!1,this.syncErrorThrowable=!1,this.isStopped=!1,arguments.length){case 0:this.destination=i.a;break;case 1:if(!e){this.destination=i.a;break}if("object"==typeof e){e instanceof l?(this.syncErrorThrowable=e.syncErrorThrowable,this.destination=e,e.add(this)):(this.syncErrorThrowable=!0,this.destination=new c(this,e));break}default:this.syncErrorThrowable=!0,this.destination=new c(this,e,t,n)}}[s.a](){return this}static create(e,t,n){const r=new l(e,t,n);return r.syncErrorThrowable=!1,r}next(e){this.isStopped||this._next(e)}error(e){this.isStopped||(this.isStopped=!0,this._error(e))}complete(){this.isStopped||(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe())}_next(e){this.destination.next(e)}_error(e){this.destination.error(e),this.unsubscribe()}_complete(){this.destination.complete(),this.unsubscribe()}_unsubscribeAndRecycle(){const{_parentOrParents:e}=this;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=e,this}}class c extends l{constructor(e,t,n,o){let s;super(),this._parentSubscriber=e;let a=this;Object(r.a)(t)?s=t:t&&(s=t.next,n=t.error,o=t.complete,t!==i.a&&(a=Object.create(t),Object(r.a)(a.unsubscribe)&&this.add(a.unsubscribe.bind(a)),a.unsubscribe=this.unsubscribe.bind(this))),this._context=a,this._next=s,this._error=n,this._complete=o}next(e){if(!this.isStopped&&this._next){const{_parentSubscriber:t}=this;a.a.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?this.__tryOrSetError(t,this._next,e)&&this.unsubscribe():this.__tryOrUnsub(this._next,e)}}error(e){if(!this.isStopped){const{_parentSubscriber:t}=this,{useDeprecatedSynchronousErrorHandling:n}=a.a;if(this._error)n&&t.syncErrorThrowable?(this.__tryOrSetError(t,this._error,e),this.unsubscribe()):(this.__tryOrUnsub(this._error,e),this.unsubscribe());else if(t.syncErrorThrowable)n?(t.syncErrorValue=e,t.syncErrorThrown=!0):Object(u.a)(e),this.unsubscribe();else{if(this.unsubscribe(),n)throw e;Object(u.a)(e)}}}complete(){if(!this.isStopped){const{_parentSubscriber:e}=this;if(this._complete){const t=()=>this._complete.call(this._context);a.a.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?(this.__tryOrSetError(e,t),this.unsubscribe()):(this.__tryOrUnsub(t),this.unsubscribe())}else this.unsubscribe()}}__tryOrUnsub(e,t){try{e.call(this._context,t)}catch(n){if(this.unsubscribe(),a.a.useDeprecatedSynchronousErrorHandling)throw n;Object(u.a)(n)}}__tryOrSetError(e,t,n){if(!a.a.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{t.call(this._context,n)}catch(r){return a.a.useDeprecatedSynchronousErrorHandling?(e.syncErrorValue=r,e.syncErrorThrown=!0,!0):(Object(u.a)(r),!0)}return!1}_unsubscribe(){const{_parentSubscriber:e}=this;this._context=null,this._parentSubscriber=null,e.unsubscribe()}}},"8Y7J":function(e,t,n){"use strict";n.d(t,"kb",function(){return Hs}),n.d(t,"lb",function(){return zs}),n.d(t,"mb",function(){return Ws}),n.d(t,"nb",function(){return Qs}),n.d(t,"jb",function(){return Eo}),n.d(t,"g",function(){return Ds}),n.d(t,"R",function(){return Es}),n.d(t,"x",function(){return Ss}),n.d(t,"T",function(){return mt}),n.d(t,"X",function(){return pt}),n.d(t,"c",function(){return jo}),n.d(t,"B",function(){return Vo}),n.d(t,"A",function(){return Uo}),n.d(t,"b",function(){return qo}),n.d(t,"d",function(){return Lo}),n.d(t,"e",function(){return Fo}),n.d(t,"V",function(){return Us}),n.d(t,"M",function(){return fs}),n.d(t,"Z",function(){return gs}),n.d(t,"t",function(){return Ho}),n.d(t,"f",function(){return Gs}),n.d(t,"m",function(){return Ro}),n.d(t,"l",function(){return ht}),n.d(t,"G",function(){return Vt}),n.d(t,"H",function(){return jt}),n.d(t,"a",function(){return Tn}),n.d(t,"P",function(){return Y}),n.d(t,"N",function(){return cr}),n.d(t,"Sb",function(){return g}),n.d(t,"S",function(){return y}),n.d(t,"U",function(){return S}),n.d(t,"q",function(){return gn}),n.d(t,"Tb",function(){return q}),n.d(t,"W",function(){return B}),n.d(t,"n",function(){return A}),n.d(t,"p",function(){return k}),n.d(t,"o",function(){return c}),n.d(t,"z",function(){return h}),n.d(t,"I",function(){return f}),n.d(t,"y",function(){return ss}),n.d(t,"C",function(){return or}),n.d(t,"D",function(){return ur}),n.d(t,"E",function(){return sr}),n.d(t,"F",function(){return ar}),n.d(t,"i",function(){return Yo}),n.d(t,"j",function(){return Xn}),n.d(t,"k",function(){return rr}),n.d(t,"u",function(){return Q}),n.d(t,"w",function(){return W}),n.d(t,"v",function(){return ks}),n.d(t,"J",function(){return Ms}),n.d(t,"K",function(){return Ns}),n.d(t,"L",function(){return Dr}),n.d(t,"O",function(){return kr}),n.d(t,"h",function(){return dn}),n.d(t,"r",function(){return Sr}),n.d(t,"s",function(){return Er}),n.d(t,"Q",function(){return On}),n.d(t,"Y",function(){return Bs}),n.d(t,"xb",function(){return Nn}),n.d(t,"cb",function(){return Bo}),n.d(t,"ab",function(){return pn}),n.d(t,"bb",function(){return er}),n.d(t,"fb",function(){return Lt}),n.d(t,"gb",function(){return Bt}),n.d(t,"hb",function(){return vt}),n.d(t,"vb",function(){return x}),n.d(t,"Ab",function(){return kn}),n.d(t,"Lb",function(){return w}),n.d(t,"yb",function(){return Qn}),n.d(t,"zb",function(){return Wn}),n.d(t,"ub",function(){return xo}),n.d(t,"tb",function(){return ko}),n.d(t,"db",function(){return Co}),n.d(t,"eb",function(){return To}),n.d(t,"Rb",function(){return se}),n.d(t,"Pb",function(){return In}),n.d(t,"Vb",function(){return Mn}),n.d(t,"Ub",function(){return Pn}),n.d(t,"Qb",function(){return Ln}),n.d(t,"Wb",function(){return Vn}),n.d(t,"ib",function(){return Ks}),n.d(t,"ob",function(){return Pi}),n.d(t,"pb",function(){return vu}),n.d(t,"qb",function(){return Kr}),n.d(t,"rb",function(){return oo}),n.d(t,"sb",function(){return $s}),n.d(t,"wb",function(){return _i}),n.d(t,"Bb",function(){return xi}),n.d(t,"Cb",function(){return Di}),n.d(t,"Db",function(){return oa}),n.d(t,"Eb",function(){return Qi}),n.d(t,"Gb",function(){return so}),n.d(t,"Jb",function(){return ao}),n.d(t,"Fb",function(){return ua}),n.d(t,"Hb",function(){return la}),n.d(t,"Ib",function(){return aa}),n.d(t,"Kb",function(){return ea}),n.d(t,"Mb",function(){return ha}),n.d(t,"Nb",function(){return Wr}),n.d(t,"Ob",function(){return pa});var r=n("XNiG"),i=n("quSY"),o=n("HDdC"),s=n("VRyK"),a=n("w1tV");const u="__parameters__";function l(e,t,n){const r=function(e){return function(...t){if(e){const n=e(...t);for(const e in n)this[e]=n[e]}}}(t);function i(...e){if(this instanceof i)return r.apply(this,e),this;const t=new i(...e);return n.annotation=t,n;function n(e,n,r){const i=e.hasOwnProperty(u)?e[u]:Object.defineProperty(e,u,{value:[]})[u];for(;i.length<=r;)i.push(null);return(i[r]=i[r]||[]).push(t),e}}return n&&(i.prototype=Object.create(n.prototype)),i.prototype.ngMetadataName=e,i.annotationCls=i,i}const c=l("Inject",e=>({token:e})),h=l("Optional"),d=l("Self"),f=l("SkipSelf");var p=function(e){return e[e.Default=0]="Default",e[e.Host=1]="Host",e[e.Self=2]="Self",e[e.SkipSelf=4]="SkipSelf",e[e.Optional=8]="Optional",e}({});function m(e){for(let t in e)if(e[t]===m)return t;throw Error("Could not find renamed property on target object.")}function g(e){return{token:e.token,providedIn:e.providedIn||null,factory:e.factory,value:void 0}}const y=g;function b(e){const t=e[v];return t&&t.token===e?t:null}const v=m({ngInjectableDef:m});function w(e){if("string"==typeof e)return e;if(e instanceof Array)return"["+e.map(w).join(", ")+"]";if(null==e)return""+e;if(e.overriddenName)return`${e.overriddenName}`;if(e.name)return`${e.name}`;const t=e.toString();if(null==t)return""+t;const n=t.indexOf("\n");return-1===n?t:t.substring(0,n)}const _=m({__forward_ref__:m});function S(e){return e.__forward_ref__=S,e.toString=function(){return w(this())},e}function E(e){const t=e;return"function"==typeof t&&t.hasOwnProperty(_)&&t.__forward_ref__===S?t():e}const C="undefined"!=typeof globalThis&&globalThis,T="undefined"!=typeof window&&window,I="undefined"!=typeof self&&"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self,D="undefined"!=typeof global&&global,x=C||D||T||I;class k{constructor(e,t){this._desc=e,this.ngMetadataName="InjectionToken",this.ngInjectableDef=void 0,"number"==typeof t?this.__NG_ELEMENT_ID__=t:void 0!==t&&(this.ngInjectableDef=g({token:this,providedIn:t.providedIn||"root",factory:t.factory}))}toString(){return`InjectionToken ${this._desc}`}}const A=new k("INJECTOR",-1),O=new Object,N="ngTempTokenPath",R="ngTokenPath",M=/\n/gm,P="\u0275",L="__source",F=m({provide:String,useValue:m});let j,V=void 0;function U(e){const t=V;return V=e,t}function q(e,t=p.Default){return(j||function(e,t=p.Default){if(void 0===V)throw new Error("inject() must be called from an injection context");return null===V?function(e,t,n){const r=b(e);
1if(r&&"root"==r.providedIn)return void 0===r.value?r.value=r.factory():r.value;if(n&p.Optional)return null;throw new Error(`Injector: NOT_FOUND [${w(e)}]`)}(e,0,t):V.get(e,t&p.Optional?null:void 0,t)})(e,t)}const B=q;class H{get(e,t=O){if(t===O){const t=new Error(`NullInjectorError: No provider for ${w(e)}!`);throw t.name="NullInjectorError",t}return t}}function z(e,t,n,r=null){e=e&&"\n"===e.charAt(0)&&e.charAt(1)==P?e.substr(2):e;let i=w(t);if(t instanceof Array)i=t.map(w).join(" -> ");else if("object"==typeof t){let e=[];for(let n in t)if(t.hasOwnProperty(n)){let r=t[n];e.push(n+":"+("string"==typeof r?JSON.stringify(r):w(r)))}i=`{${e.join(", ")}}`}return`${n}${r?"("+r+")":""}[${i}]: ${e.replace(M,"\n  ")}`}class W{}class Q{}function G(e,t,n){t>=e.length?e.push(n):e.splice(t,0,n)}function K(e,t){return t>=e.length-1?e.pop():e.splice(t,1)[0]}const $=function(){var e={OnPush:0,Default:1};return e[e.OnPush]="OnPush",e[e.Default]="Default",e}(),Y=function(){var e={Emulated:0,Native:1,None:2,ShadowDom:3};return e[e.Emulated]="Emulated",e[e.Native]="Native",e[e.None]="None",e[e.ShadowDom]="ShadowDom",e}(),Z={},J=[],X=m({ngComponentDef:m}),ee=m({ngDirectiveDef:m}),te=m({ngPipeDef:m});let ne=0;function re(e){return function(e){return e[X]||null}(e)||function(e){return e[ee]||null}(e)}function ie(e){return function(e){return e[te]||null}(e)}function oe(e,t){if(null==e)return Z;const n={};for(const r in e)if(e.hasOwnProperty(r)){let i=e[r],o=i;Array.isArray(i)&&(o=i[1],i=i[0]),n[i]=r,t&&(t[i]=o)}return n}const se=function(e){const t=e.type,n=t.prototype,r={},i={type:t,providersResolver:null,consts:e.consts,vars:e.vars,factory:e.factory,template:e.template||null,ngContentSelectors:e.ngContentSelectors,hostBindings:e.hostBindings||null,contentQueries:e.contentQueries||null,declaredInputs:r,inputs:null,outputs:null,exportAs:e.exportAs||null,onChanges:null,onInit:n.ngOnInit||null,doCheck:n.ngDoCheck||null,afterContentInit:n.ngAfterContentInit||null,afterContentChecked:n.ngAfterContentChecked||null,afterViewInit:n.ngAfterViewInit||null,afterViewChecked:n.ngAfterViewChecked||null,onDestroy:n.ngOnDestroy||null,onPush:e.changeDetection===$.OnPush,directiveDefs:null,pipeDefs:null,selectors:e.selectors,viewQuery:e.viewQuery||null,features:e.features||null,data:e.data||{},encapsulation:e.encapsulation||Y.Emulated,id:"c",styles:e.styles||J,_:null,setInput:null,schemas:e.schemas||null,tView:null};return i._=""+{toString:()=>{const n=e.directives,o=e.features,s=e.pipes;i.id+=ne++,i.inputs=oe(e.inputs,r),i.outputs=oe(e.outputs),o&&o.forEach(e=>e(i)),i.directiveDefs=n?()=>("function"==typeof n?n():n).map(re):null,i.pipeDefs=s?()=>("function"==typeof s?s():s).map(ie):null,t.hasOwnProperty(v)||(t[v]=g({token:t,factory:e.factory}))}},i},ae=0,ue=1,le=7,ce=12,he=19;let de=null;const fe=new Map;let pe=null;const me=1,ge=0;function ye(e,t){return pe&&e===pe||(pe=e,t&&(de=fe.get(e)||null),de=de||{classesBitMask:ge,classesIndex:me,stylesBitMask:ge,stylesIndex:me}),de}function be(e,t){return function(e){for(;Array.isArray(e);)e=e[ae];return e}(t[e.index])}function ve(e,t){return t[ue].data[e+he]}let we=null;function _e(){return Ee}let Se,Ee,Ce,Te=1,Ie=0,De=0,xe=-1;function ke(){return xe}function Ae(){return Ce}const Oe=(()=>("undefined"!=typeof requestAnimationFrame&&requestAnimationFrame||setTimeout).bind(x))(),Ne="--MAP--",Re=0;function Me(e,t){t===Re?e[2]>Re&&function(e){Le(e,2|Pe(e))}(e):e[2]=t}function Pe(e){return e[1]}function Le(e,t){e[1]=t}function Fe(e,t){return e[t+2]}function je(e,t){return 1&e[t+0]}function Ve(e,t){return(1&je(e,t))>0}function Ue(e,t){return e[t+0]>>1}function qe(e,t,n){const r=je(e,t);e[t+0]=r|n<<1}function Be(e,t){return e[t+1]}function He(e,t,n){return e[t+3+n]}function ze(e,t){return!(!e||t!==e[2])}function We(e){return(1&Pe(e))>0}function Qe(e){return(2&Pe(e))>0}function Ge(e){return 6+e[4]}function Ke(e,t){let n=Array.isArray(e)?e[0]:e,r=Array.isArray(t)?t[0]:t;return n instanceof String&&(n=n.toString()),r instanceof String&&(r=r.toString()),!(n!=n&&r!=r)&&n!==r}function $e(e){return null!=e&&""!==e}function Ye(e,t,n=" "){return e+(t.length&&e.length?n:"")+t}function Ze(e){return e.replace(/[a-z][A-Z]/g,e=>e.charAt(0)+"-"+e.charAt(1)).toLowerCase()}function Je(e){return Xe(e)?e[0]:e}function Xe(e){return Array.isArray(e)&&e.length>=6&&"string"!=typeof e[1]}function et(e,t){return e[t+0]}function tt(e,t,n){e[t+1]=n}function nt(e,t){return e[t+1]}const rt=function(){var e={Important:1,DashCase:2};return e[e.Important]="Important",e[e.DashCase]="DashCase",e}();function it(e){return!!e.listen}const ot="ngDebugContext",st="ngOriginalError",at="ngErrorLogger";function ut(e){return e[ot]}function lt(e){return e[st]}function ct(e,...t){e.error(...t)}class ht{constructor(){this._console=console}handleError(e){const t=this._findOriginalError(e),n=this._findContext(e),r=function(e){return e[at]||ct}(e);r(this._console,"ERROR",e),t&&r(this._console,"ORIGINAL ERROR",t),n&&r(this._console,"ERROR CONTEXT",n)}_findContext(e){return e?ut(e)?ut(e):this._findContext(lt(e)):null}_findOriginalError(e){let t=lt(e);for(;t&&lt(t);)t=lt(t);return t}}let dt=!0,ft=!1;function pt(){return ft=!0,dt}
vendor: 5,267 bytes, line 1
1function mt(){if(ft)throw new Error("Cannot enable prod mode after platform setup.");dt=!1}class gt{constructor(e){if(this.defaultDoc=e,this.inertDocument=this.defaultDoc.implementation.createHTMLDocument("sanitization-inert"),this.inertBodyElement=this.inertDocument.body,null==this.inertBodyElement){const 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(e){return!1}}()?this.getInertBodyElement_DOMParser:this.getInertBodyElement_InertDocument):this.getInertBodyElement=this.getInertBodyElement_XHR}getInertBodyElement_XHR(e){e="<body><remove></remove>"+e+"</body>";try{e=encodeURI(e)}catch(r){return null}const t=new XMLHttpRequest;t.responseType="document",t.open("GET","data:text/html;charset=utf-8,"+e,!1),t.send(void 0);const n=t.response.body;return n.removeChild(n.firstChild),n}getInertBodyElement_DOMParser(e){e="<body><remove></remove>"+e+"</body>";try{const n=(new window.DOMParser).parseFromString(e,"text/html").body;return n.removeChild(n.firstChild),n}catch(t){return null}}getInertBodyElement_InertDocument(e){const t=this.inertDocument.createElement("template");return"content"in t?(t.innerHTML=e,t):(this.inertBodyElement.innerHTML=e,this.defaultDoc.documentMode&&this.stripCustomNsAttrs(this.inertBodyElement),this.inertBodyElement)}stripCustomNsAttrs(e){const t=e.attributes;for(let r=t.length-1;0<r;r--){const n=t.item(r).name;"xmlns:ns1"!==n&&0!==n.indexOf("ns1:")||e.removeAttribute(n)}let n=e.firstChild;for(;n;)n.nodeType===Node.ELEMENT_NODE&&this.stripCustomNsAttrs(n),n=n.nextSibling}}const yt=/^(?:(?:https?|mailto|ftp|tel|file):|[^&:\/?#]*(?:[\/?#]|$))/gi,bt=/^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 vt(e){return(e=String(e)).match(yt)||e.match(bt)?e:(pt()&&console.warn(`WARNING: sanitizing unsafe URL value ${e} (see http://g.co/ng/security#xss)`),"unsafe:"+e)}function wt(e){const t={};for(const n of e.split(","))t[n]=!0;return t}function _t(...e){const t={};for(const n of e)for(const e in n)n.hasOwnProperty(e)&&(t[e]=!0);return t}const St=wt("area,br,col,hr,img,wbr"),Et=wt("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),Ct=wt("rp,rt"),Tt=_t(Ct,Et),It=_t(St,_t(Et,wt("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")),_t(Ct,wt("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")),Tt),Dt=wt("background,cite,href,itemtype,longdesc,poster,src,xlink:href"),xt=wt("srcset"),kt=_t(Dt,xt,wt("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"),wt("aria-activedescendant,aria-atomic,aria-autocomplete,aria-busy,aria-checked,aria-colcount,aria-colindex,aria-colspan,aria-controls,aria-current,aria-describedby,aria-details,aria-disabled,aria-dropeffect,aria-errormessage,aria-expanded,aria-flowto,aria-grabbed,aria-haspopup,aria-hidden,aria-invalid,aria-keyshortcuts,aria-label,aria-labelledby,aria-level,aria-live,aria-modal,aria-multiline,aria-multiselectable,aria-orientation,aria-owns,aria-placeholder,aria-posinset,aria-pressed,aria-readonly,aria-relevant,aria-required,aria-roledescription,aria-rowcount,aria-rowindex,aria-rowspan,aria-selected,aria-setsize,aria-sort,aria-valuemax,aria-valuemin,aria-valuenow,aria-valuetext")),At=wt("script,style,template");class Ot{constructor(){this.sanitizedSomething=!1,this.buf=[]}sanitizeChildren(e){let t=e.firstChild,n=!0;for(;t;)if(t.nodeType===Node.ELEMENT_NODE?n=this.startElement(t):t.nodeType===Node.TEXT_NODE?this.chars(t.nodeValue):this.sanitizedSomething=!0,n&&t.firstChild)t=t.firstChild;else for(;t;){t.nodeType===Node.ELEMENT_NODE&&this.endElement(t);let e=this.checkClobberedElement(t,t.nextSibling);if(e){t=e;break}t=this.checkClobberedElement(t,t.parentNode)}return this.buf.join("")}startElement(e){const t=e.nodeName.toLowerCase();if(!It.hasOwnProperty(t))return this.sanitizedSomething=!0,!At.hasOwnProperty(t);this.buf.push("<"),this.buf.push(t);const n=e.attributes;for(let i=0;i<n.length;i++){const e=n.item(i),t=e.name,o=t.toLowerCase();if(!kt.hasOwnProperty(o)){this.sanitizedSomething=!0;continue}let s=e.value;
1Dt[o]&&(s=vt(s)),xt[o]&&(r=s,s=(r=String(r)).split(",").map(e=>vt(e.trim())).join(", ")),this.buf.push(" ",t,'="',Mt(s),'"')}var r;return this.buf.push(">"),!0}endElement(e){const t=e.nodeName.toLowerCase();It.hasOwnProperty(t)&&!St.hasOwnProperty(t)&&(this.buf.push("</"),this.buf.push(t),this.buf.push(">"))}chars(e){this.buf.push(Mt(e))}checkClobberedElement(e,t){if(t&&(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY)===Node.DOCUMENT_POSITION_CONTAINED_BY)throw new Error(`Failed to sanitize html because the element is clobbered: ${e.outerHTML}`);return t}}const Nt=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Rt=/([^\#-~ |!])/g;function Mt(e){return e.replace(/&/g,"&amp;").replace(Nt,function(e){return"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";"}).replace(Rt,function(e){return"&#"+e.charCodeAt(0)+";"}).replace(/</g,"&lt;").replace(/>/g,"&gt;")}let Pt;function Lt(e,t){let n=null;try{Pt=Pt||new gt(e);let r=t?String(t):"";n=Pt.getInertBodyElement(r);let 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=Pt.getInertBodyElement(r)}while(r!==o);const s=new Ot,a=s.sanitizeChildren(Ft(n)||n);return pt()&&s.sanitizedSomething&&console.warn("WARNING: sanitizing HTML stripped some content, see http://g.co/ng/security#xss"),a}finally{if(n){const e=Ft(n)||n;for(;e.firstChild;)e.removeChild(e.firstChild)}}}function Ft(e){return"content"in e&&function(e){return e.nodeType===Node.ELEMENT_NODE&&"TEMPLATE"===e.nodeName}(e)?e.content:null}const jt=function(){var e={NONE:0,HTML:1,STYLE:2,SCRIPT:3,URL:4,RESOURCE_URL:5};return e[e.NONE]="NONE",e[e.HTML]="HTML",e[e.STYLE]="STYLE",e[e.SCRIPT]="SCRIPT",e[e.URL]="URL",e[e.RESOURCE_URL]="RESOURCE_URL",e}();class Vt{}const Ut=new RegExp("^([-,.\"'%_!# a-zA-Z0-9]+|(?:(?:matrix|translate|scale|rotate|skew|perspective)(?:X|Y|Z|3d)?|(?:rgb|hsl)a?|(?:repeating-)?(?:linear|radial)-gradient|(?:calc|attr))\\([-0-9.%, #a-zA-Z]+\\))$","g"),qt=/^url\(([^)]+)\)$/;function Bt(e){if(!(e=String(e).trim()))return"";const t=e.match(qt);return t&&vt(t[1])===t[1]||e.match(Ut)&&function(e){let t=!0,n=!0;for(let r=0;r<e.length;r++){const i=e.charAt(r);"'"===i&&n?t=!t:'"'===i&&t&&(n=!n)}return t&&n}(e)?e:(pt()&&console.warn(`WARNING: sanitizing unsafe style value ${e} (see http://g.co/ng/security#xss).`),"unsafe")}const Ht=/([A-Z])/g;function zt(e){try{return null!=e?e.toString().slice(0,30):e}catch(t){return"[ERROR] Exception while trying to serialize the value"}}const Wt=1,Qt=0,Gt=null,Kt=1;let $t=[];function Yt(e,t,n,r,i,o,s,a,u){We(e)||(s?function(e,t,n,r,i){$t.unshift(e,t,n,r,i)}(e,n,r,i,u):($t.length&&Zt(),Jt(e,n,r,i,u)));const l=a||Ke(t[i],o);return l&&(t[i]=o),l}function Zt(){let e=0;for(;e<$t.length;)Jt($t[e++],$t[e++],$t[e++],$t[e++],$t[e++]);$t.length=0}function Jt(e,t,n,r,i){let o=!1;if(n){let s=!1,a=Ge(e);for(;a<e.length;){const o=Be(e,a),u=Fe(e,a);if(s=n<=u){n<u&&Xt(e,a,n,i),en(e,!1,a,r,t);break}a+=3+o}s||(Xt(e,e.length,n,i),en(e,!1,a,r,t),o=!0)}else en(e,!0,3,r,t),o=!0;return o}function Xt(e,t,n,r){e.splice(t,0,r?1:0,Kt,n,Gt),qe(e,t,Wt)}function en(e,t,n,r,i){const o=n+3;let s=o+Be(e,n);if(t||s--,"number"==typeof r){for(let t=o;t<=s;t++)if(e[t]===r)return;e.splice(s,0,r),e[n+1]++,qe(e,n,Ue(e,n)|1<<i)}else null!==r&&null==e[s]&&(e[s]=r)}function tn(e,t,n,r,i,o,s,a){return i&&r&&(function(e){if(!We(e)){const t=Je(e);t&&function(e,t){for(let n=1;n<t.length;n+=2){const r=nt(t,n);r&&Jt(e,-1,et(t,n),r,!1)}}(e,t),function(e){Le(e,1|Pe(e))}(e)}}(r),function(e,t){return e&&t>ge}(r,o))?(function(e,t,n,r,i,o,s){const a=!0===(u=i)?-1:!1===u?0:u;var u;const l=nn,c=(a&Ue(e,3))>0?1:0;let h=Ge(e);for(;h<e.length;){const i=Be(e,h);if(a&Ue(e,h)){let a=!1;const u=Fe(e,h),d=i-1,f=He(e,h,d);for(let i=0;i<d;i++){const l=He(e,h,i),c=r[l];if($e(c)){o(t,n,u,s&&Ve(e,h)?s(u,c,2):c,l),a=!0;break}}if(l){const i=l(e,t,n,r,o,s,c|(a?4:2),u,f);a=a||i}a||o(t,n,u,f)}h+=3+i}l&&l(e,t,n,r,o,s,c)}(r,e,t,n,o,s,a),!0):i}let nn=null;const rn=(e,t,n,r)=>{const i=t.style;r?(r=r.toString(),e&&it(e)?e.setStyle(t,n,r,rt.DashCase):i&&i.setProperty(n,r)):e&&it(e)?e.removeStyle(t,n,rt.DashCase):i&&i.removeProperty(n)},on=(e,t,n,r)=>{if(""!==n){const i=t.classList;r?e&&it(e)?e.addClass(t,n):i&&i.add(n):e&&it(e)?e.removeClass(t,n):i&&i.remove(n)}},sn={},an=(e,t,n,r,i,o,s,a,u)=>{let l=!1;if(Be(e,3)){let c=!0;const h=!a;h&&-2&s&&(c=!1,l=!0),c&&(l=function e(t,n,r,i,o,s,a,u,l,c){let h=!1;if(l<Be(t,3)){const d=He(t,3,l),f=i[d];let p=function(e){return e>=cn.length&&cn.push(1),cn[e]}(l);for(;p<f.length;){const m=et(f,p),g=u&&m>u,y=!g&&m===u,b=nt(f,p),v=$e(b);let w=e(t,n,r,i,o,s,g?a:un(a,v,y),g?u:m,l+1,c);if(g){h||(h=w);break}
1if(!w&&ln(a,y)){const e=y&&!v,t=e?c:b,i=e?d:null;o(n,r,m,s?s(m,t,3):t,i),w=!0}h=w&&y,p+=2}if(cn[l]=p,1===f.length||!u)return e(t,n,r,i,o,s,a,u,l+1,c)}return h}(e,t,n,r,i,o,s,a||null,0,u||null)),h&&function(){for(let e=0;e<cn.length;e++)cn[e]=1}()}return l};function un(e,t,n){let r=e;return t||4&e||!(n||1&e)?(r|=4,r&=-3):(r|=2,r&=-5),r}function ln(e,t){let n=(1&e)>0;return n?4&e&&t&&(n=!1):2&e&&(n=t),n}const cn=[];function hn(e,t,n,r){for(let i=1;i<e.length;i+=2){const o=et(e,i);if(t<=o){let s=!1;if(o===t){const t=e[i];!r&&$e(t)||(s=!0,tt(e,i,n))}else s=!0,e.splice(i,0,t,n);return s}}return e.push(t,n),!0}let dn=(()=>{class e{}return e.__NG_ELEMENT_ID__=()=>fn(),e})();const fn=(...e)=>{},pn=new k("The presence of this token marks an injector as being the root injector."),mn=function(e,t,n){return new Sn(e,t,n)};let gn=(()=>{class e{static create(e,t){return Array.isArray(e)?mn(e,t,""):mn(e.providers,e.parent,e.name||"")}}return e.THROW_IF_NOT_FOUND=O,e.NULL=new H,e.ngInjectableDef=g({token:e,providedIn:"any",factory:()=>q(A)}),e.__NG_ELEMENT_ID__=-1,e})();const yn=function(e){return e},bn=[],vn=yn,wn=function(){return Array.prototype.slice.call(arguments)},_n="\u0275";class Sn{constructor(e,t=gn.NULL,n=null){this.parent=t,this.source=n;const r=this._records=new Map;r.set(gn,{token:gn,fn:yn,deps:bn,value:this,useNew:!1}),r.set(A,{token:A,fn:yn,deps:bn,value:this,useNew:!1}),function e(t,n){if(n)if((n=E(n))instanceof Array)for(let r=0;r<n.length;r++)e(t,n[r]);else{if("function"==typeof n)throw Cn("Function/Class not supported",n);if(!n||"object"!=typeof n||!n.provide)throw Cn("Unexpected provider",n);{let e=E(n.provide);const r=function(e){const t=function(e){let t=bn;const n=e.deps;if(n&&n.length){t=[];for(let e=0;e<n.length;e++){let r=6,i=E(n[e]);if(i instanceof Array)for(let e=0,t=i;e<t.length;e++){const n=t[e];n instanceof h||n==h?r|=1:n instanceof f||n==f?r&=-3:n instanceof d||n==d?r&=-5:i=n instanceof c?n.token:E(n)}t.push({token:i,options:r})}}else if(e.useExisting)t=[{token:E(e.useExisting),options:6}];else if(!(n||F in e))throw Cn("'deps' required",e);return t}(e);let n=yn,r=bn,i=!1,o=E(e.provide);
1if(F in e)r=e.useValue;else if(e.useFactory)n=e.useFactory;else if(e.useExisting);else if(e.useClass)i=!0,n=E(e.useClass);else{if("function"!=typeof o)throw Cn("StaticProvider does not have [useValue|useFactory|useExisting|useClass] or [provide] is not newable",e);i=!0,n=o}return{deps:t,fn:n,useNew:i,value:r}}(n);if(!0===n.multi){let r=t.get(e);if(r){if(r.fn!==wn)throw En(e)}else t.set(e,r={token:n.provide,deps:[],useNew:!1,fn:wn,value:bn});r.deps.push({token:e=n,options:6})}const i=t.get(e);if(i&&i.fn==wn)throw En(e);t.set(e,r)}}}(r,e)}get(e,t,n=p.Default){const r=this._records.get(e);try{return function e(t,n,r,i,o,s){try{return function(t,n,r,i,o,s){let a;if(!n||s&p.SkipSelf)s&p.Self||(a=i.get(t,o,p.Default));else{if((a=n.value)==vn)throw Error(_n+"Circular dependency");if(a===bn){n.value=vn;let t=void 0,o=n.useNew,s=n.fn,u=n.deps,l=bn;if(u.length){l=[];for(let t=0;t<u.length;t++){const n=u[t],o=n.options,s=2&o?r.get(n.token):void 0;l.push(e(n.token,s,r,s||4&o?i:gn.NULL,1&o?null:gn.THROW_IF_NOT_FOUND,p.Default))}}n.value=a=o?new s(...l):s.apply(t,l)}}return a}(t,n,r,i,o,s)}catch(a){throw a instanceof Error||(a=new Error(a)),(a[N]=a[N]||[]).unshift(t),n&&n.value==vn&&(n.value=bn),a}}(e,r,this._records,this.parent,t,n)}catch(i){return function(e,t,n,r){const i=e[N];throw t[L]&&i.unshift(t[L]),e.message=z("\n"+e.message,i,"StaticInjectorError",r),e[R]=i,e[N]=null,e}(i,e,0,this.source)}}toString(){const e=[];return this._records.forEach((t,n)=>e.push(w(n))),`StaticInjector[${e.join(", ")}]`}}function En(e){return Cn("Cannot mix multi providers and regular providers",e)}function Cn(e,t){return new Error(z(e,t,"StaticInjectorError"))}const Tn=new k("AnalyzeForEntryComponents");function In(e){const t=_e(),n=t[ue];n.firstTemplatePass&&(function(e,t,n){const r=e.expandoInstructions,i=r.length;i>=2&&r[i-2]===t.hostBindings?r[i-1]=r[i-1]+n:r.push(t.hostBindings,n)}(n,we,e),function(e,t,n){for(let r=0;r<n;r++)t.push(sn),e.blueprint.push(sn),e.data.push(null)}(n,t,e))}let Dn=null;function xn(){if(!Dn){const e=x.Symbol;if(e&&e.iterator)Dn=e.iterator;else{const e=Object.getOwnPropertyNames(Map.prototype);for(let t=0;t<e.length;++t){const n=e[t];"entries"!==n&&"size"!==n&&Map.prototype[n]===Map.prototype.entries&&(Dn=n)}}}return Dn}function kn(e,t){return e===t||"number"==typeof e&&"number"==typeof t&&isNaN(e)&&isNaN(t)}function An(e,t){const n=Nn(e),r=Nn(t);if(n&&r)return function(e,t,n){const r=e[xn()](),i=t[xn()]();for(;;){const e=r.next(),t=i.next();if(e.done&&t.done)return!0;if(e.done||t.done)return!1;if(!n(e.value,t.value))return!1}}(e,t,An);{const i=e&&("object"==typeof e||"function"==typeof e),o=t&&("object"==typeof t||"function"==typeof t);return!(n||!i||r||!o)||kn(e,t)}}class On{constructor(e){this.wrapped=e}static wrap(e){return new On(e)}static unwrap(e){return On.isWrapped(e)?e.wrapped:e}static isWrapped(e){return e instanceof On}}function Nn(e){return!!Rn(e)&&(Array.isArray(e)||!(e instanceof Map)&&xn()in e)}function Rn(e){return null!==e&&("function"==typeof e||"object"==typeof e)}function Mn(){var e,t;_e()[ue].firstTemplatePass&&(e=Se,t=Un(),Me(Bn(e),t),Me(qn(e),t))}function Pn(e){const t=ke(),n=_e(),r=ve(t,n),i=qn(r),o=Un(),s=n[le]++;!o&&function(e){return 0!=(16&e.flags)}(r)&&e!==sn&&(jn(i,n,r,s,e,!1),e=sn),Fn(t,i,s,e,!1,zn())}function Ln(e){!function(e,t){const n=_e(),r=ve(e,n),i=Bn(r),o=Un(),s=n[le]++;!o&&function(e){return 0!=(8&e.flags)}(r)&&t!==sn&&(jn(i,n,r,s,t,!0),t=sn),Fn(e,i,s,t,!0,zn())}(ke(),e)}function Fn(e,t,n,r,i,o){nn=an;const s=_e();let a=!1;if(r!==sn){const u=be(ve(e,s),s),l=s[n];a=Ke(l,r);const c=function(e,t,n){const r=Array.isArray(e)?e:[null];r[0]=t||null;for(let a=1;a<r.length;a+=2)tt(r,a,null);let i,o=null,s=!1;if("string"==typeof t?t.length&&(o=t.split(/\s+/),s=!0):(o=t?Object.keys(t):null,i=t),o)for(let a=0;a<o.length;a++){const e=o[a];hn(r,n?Ze(e):e,!!s||i[e],!0)}return r}(l,r,!i);i?function(e,t,n,r,i,o,s,a){const l=ye(u,Qe(e)),c=Qt;!Yt(e,t,c,null,i,o,s,a,!1)&&!a||(l.classesBitMask|=1<<c)}(t,s,0,0,n,c,o,a):function(e,t,n,r,i,o,s,a,u){const l=ye(n,Qe(e)),c=Qt;!Yt(e,t,c,null,i,o,a,u,!0)&&!u||(l.stylesBitMask|=1<<c)}(t,s,u,0,n,c,Ae(),o,a)}return a}function jn(e,t,n,r,i,o){t[r]!==i&&((i||We(e))&&function(e,t,n){const r=e[ue];for(let i=0;i<t.length;){const o=t[i++],s=t[i++],a=t[i++],u=e[o],l=r.data[o];l.setInput?l.setInput(u,n,s,a):u[a]=n}}(t,n.inputs[o?"class":"style"],function(e,t,n){let r=t;var i;return e.length>0&&(r=n?Ye(e,((i=t)&&"string"!=typeof i&&(i=Object.keys(i).join(" ")),i||"")):Ye(e,function(e){let t="";if(e){const n=Object.keys(e);for(let r=0;r<n.length;r++){const i=n[r];t=Ye(t,`${i}:${e[i]}`,";")}}return t}(t),";")),r}(function(e){const t=Je(e);return t&&t[0]||""}(e),i,o)),t[r]=i)}function Vn(){const e=ke(),t=_e(),n=ve(e,t),r=function(e,t){return 3===e.type?t[ce]:null}
vendor: 35,403 bytes, line 1
1(n,t),i=be(n,t),o=Un(),s=Ae();(function(e,t,n,r,i,o,s){const a=n?Qe(n):!!r&&Qe(r),u=ze(n,o),l=ze(r,o);$t.length&&(u||l)&&Zt();const c=ye(i,a),h=tn(e,i,t,n,u,c.classesBitMask,on,null),d=tn(e,i,t,r,l,c.stylesBitMask,rn,s);h&&d?(de=null,pe=null,a&&function(e){fe.delete(e)}(i)):a&&function(e,t){fe.set(e,t)}(i,c)})(r,t,Bn(n),qn(n),i,o,s),Ce=null}function Un(){return Te+Ie}function qn(e){return Hn(e,!1)}function Bn(e){return Hn(e,!0)}function Hn(e,t){let n=t?e.classes:e.styles;return Xe(n)||(n=[n||[""],0,Re,1,0,Ne],t?e.classes=n:e.styles=n),n}function zn(){return De>0}function Wn(e){return!!e&&"function"==typeof e.then}function Qn(e){return!!e&&"function"==typeof e.subscribe}class Gn{constructor(e,t,n){this.previousValue=e,this.currentValue=t,this.firstChange=n}isFirstChange(){return this.firstChange}}class Kn{}class $n{}function Yn(e){const t=Error(`No component factory found for ${w(e)}. Did you add it to @NgModule.entryComponents?`);return t[Zn]=e,t}const Zn="ngComponent";class Jn{resolveComponentFactory(e){throw Yn(e)}}let Xn=(()=>{class e{}return e.NULL=new Jn,e})();class er{constructor(e,t,n){this._parent=t,this._ngModule=n,this._factories=new Map;for(let r=0;r<e.length;r++){const t=e[r];this._factories.set(t.componentType,t)}}resolveComponentFactory(e){let t=this._factories.get(e);if(!t&&this._parent&&(t=this._parent.resolveComponentFactory(e)),!t)throw Yn(e);return new tr(t,this._ngModule)}}class tr extends $n{constructor(e,t){super(),this.factory=e,this.ngModule=t,this.selector=e.selector,this.componentType=e.componentType,this.ngContentSelectors=e.ngContentSelectors,this.inputs=e.inputs,this.outputs=e.outputs}create(e,t,n,r){return this.factory.create(e,t,n,r||this.ngModule)}}function nr(...e){}let rr=(()=>{class e{constructor(e){this.nativeElement=e}}return e.__NG_ELEMENT_ID__=()=>ir(e),e})();const ir=nr;class or{}class sr{}const ar=function(){var e={Important:1,DashCase:2};return e[e.Important]="Important",e[e.DashCase]="DashCase",e}();let ur=(()=>{class e{}return e.__NG_ELEMENT_ID__=()=>lr(),e})();const lr=nr;class cr{constructor(e){this.full=e,this.major=e.split(".")[0],this.minor=e.split(".")[1],this.patch=e.split(".").slice(2).join(".")}}const hr=new cr("8.2.8");class dr{constructor(){}supports(e){return Nn(e)}create(e){return new pr(e)}}const fr=(e,t)=>t;class pr{constructor(e){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=e||fr}forEachItem(e){let t;for(t=this._itHead;null!==t;t=t._next)e(t)}forEachOperation(e){let t=this._itHead,n=this._removalsHead,r=0,i=null;for(;t||n;){const o=!n||t&&t.currentIndex<br(n,r,i)?t:n,s=br(o,r,i),a=o.currentIndex;if(o===n)r--,n=n._nextRemoved;else if(t=t._next,null==o.previousIndex)r++;else{i||(i=[]);const e=s-r,t=a-r;if(e!=t){for(let n=0;n<e;n++){const r=n<i.length?i[n]:i[n]=0,o=r+n;t<=o&&o<e&&(i[n]=r+1)}i[o.previousIndex]=t-e}}s!==a&&e(o,s,a)}}forEachPreviousItem(e){let t;for(t=this._previousItHead;null!==t;t=t._nextPrevious)e(t)}forEachAddedItem(e){let t;for(t=this._additionsHead;null!==t;t=t._nextAdded)e(t)}forEachMovedItem(e){let t;for(t=this._movesHead;null!==t;t=t._nextMoved)e(t)}forEachRemovedItem(e){let t;for(t=this._removalsHead;null!==t;t=t._nextRemoved)e(t)}forEachIdentityChange(e){let t;for(t=this._identityChangesHead;null!==t;t=t._nextIdentityChange)e(t)}diff(e){if(null==e&&(e=[]),!Nn(e))throw new Error(`Error trying to diff '${w(e)}'. Only arrays and iterables are allowed`);return this.check(e)?this:null}onDestroy(){}check(e){this._reset();let t,n,r,i=this._itHead,o=!1;if(Array.isArray(e)){this.length=e.length;for(let t=0;t<this.length;t++)r=this._trackByFn(t,n=e[t]),null!==i&&kn(i.trackById,r)?(o&&(i=this._verifyReinsertion(i,n,r,t)),kn(i.item,n)||this._addIdentityChange(i,n)):(i=this._mismatch(i,n,r,t),o=!0),i=i._next}else t=0,function(e,t){if(Array.isArray(e))for(let n=0;n<e.length;n++)t(e[n]);else{const n=e[xn()]();let r;for(;!(r=n.next()).done;)t(r.value)}}(e,e=>{r=this._trackByFn(t,e),null!==i&&kn(i.trackById,r)?(o&&(i=this._verifyReinsertion(i,e,r,t)),kn(i.item,e)||this._addIdentityChange(i,e)):(i=this._mismatch(i,e,r,t),o=!0),i=i._next,t++}),this.length=t;return this._truncate(i),this.collection=e,this.isDirty}get isDirty(){return null!==this._additionsHead||null!==this._movesHead||null!==this._removalsHead||null!==this._identityChangesHead}_reset(){if(this.isDirty){let e,t;for(e=this._previousItHead=this._itHead;null!==e;e=e._next)e._nextPrevious=e._next;for(e=this._additionsHead;null!==e;e=e._nextAdded)e.previousIndex=e.currentIndex;for(this._additionsHead=this._additionsTail=null,e=this._movesHead;null!==e;e=t)e.previousIndex=e.currentIndex,t=e._nextMoved;this._movesHead=this._movesTail=null,this._removalsHead=this._removalsTail=null,this._identityChangesHead=this._identityChangesTail=null}}_mismatch(e,t,n,r){let i;return null===e?i=this._itTail:(i=e._prev,this._remove(e)),null!==(e=null===this._linkedRecords?null:this._linkedRecords.get(n,r))?(kn(e.item,t)||this._addIdentityChange(e,t),this._moveAfter(e,i,r)):null!==(e=null===this._unlinkedRecords?null:this._unlinkedRecords.get(n,null))?(kn(e.item,t)||this._addIdentityChange(e,t),this._reinsertAfter(e,i,r)):e=this._addAfter(new mr(t,n),i,r),e}_verifyReinsertion(e,t,n,r){let i=null===this._unlinkedRecords?null:this._unlinkedRecords.get(n,null);return null!==i?e=this._reinsertAfter(i,e._prev,r):e.currentIndex!=r&&(e.currentIndex=r,this._addToMoves(e,r)),e}_truncate(e){for(;null!==e;){const t=e._next;this._addToRemovals(this._unlink(e)),e=t}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)}_reinsertAfter(e,t,n){null!==this._unlinkedRecords&&this._unlinkedRecords.remove(e);const r=e._prevRemoved,i=e._nextRemoved;return null===r?this._removalsHead=i:r._nextRemoved=i,null===i?this._removalsTail=r:i._prevRemoved=r,this._insertAfter(e,t,n),this._addToMoves(e,n),e}_moveAfter(e,t,n){return this._unlink(e),this._insertAfter(e,t,n),this._addToMoves(e,n),e}_addAfter(e,t,n){return this._insertAfter(e,t,n),this._additionsTail=null===this._additionsTail?this._additionsHead=e:this._additionsTail._nextAdded=e,e}_insertAfter(e,t,n){const r=null===t?this._itHead:t._next;return e._next=r,e._prev=t,null===r?this._itTail=e:r._prev=e,null===t?this._itHead=e:t._next=e,null===this._linkedRecords&&(this._linkedRecords=new yr),this._linkedRecords.put(e),e.currentIndex=n,e}_remove(e){return this._addToRemovals(this._unlink(e))}_unlink(e){null!==this._linkedRecords&&this._linkedRecords.remove(e);const t=e._prev,n=e._next;return null===t?this._itHead=n:t._next=n,null===n?this._itTail=t:n._prev=t,e}_addToMoves(e,t){return e.previousIndex===t?e:(this._movesTail=null===this._movesTail?this._movesHead=e:this._movesTail._nextMoved=e,e)}_addToRemovals(e){return null===this._unlinkedRecords&&(this._unlinkedRecords=new yr),this._unlinkedRecords.put(e),e.currentIndex=null,e._nextRemoved=null,null===this._removalsTail?(this._removalsTail=this._removalsHead=e,e._prevRemoved=null):(e._prevRemoved=this._removalsTail,this._removalsTail=this._removalsTail._nextRemoved=e),e}_addIdentityChange(e,t){return e.item=t,this._identityChangesTail=null===this._identityChangesTail?this._identityChangesHead=e:this._identityChangesTail._nextIdentityChange=e,e}}class mr{constructor(e,t){this.item=e,this.trackById=t,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}}class gr{constructor(){this._head=null,this._tail=null}add(e){null===this._head?(this._head=this._tail=e,e._nextDup=null,e._prevDup=null):(this._tail._nextDup=e,e._prevDup=this._tail,e._nextDup=null,this._tail=e)}get(e,t){let n;for(n=this._head;null!==n;n=n._nextDup)if((null===t||t<=n.currentIndex)&&kn(n.trackById,e))return n;return null}remove(e){const t=e._prevDup,n=e._nextDup;return null===t?this._head=n:t._nextDup=n,null===n?this._tail=t:n._prevDup=t,null===this._head}}class yr{constructor(){this.map=new Map}put(e){const t=e.trackById;let n=this.map.get(t);n||(n=new gr,this.map.set(t,n)),n.add(e)}get(e,t){const n=this.map.get(e);return n?n.get(e,t):null}remove(e){const t=e.trackById;return this.map.get(t).remove(e)&&this.map.delete(t),e}get isEmpty(){return 0===this.map.size}clear(){this.map.clear()}}function br(e,t,n){const r=e.previousIndex;if(null===r)return r;let i=0;return n&&r<n.length&&(i=n[r]),r+t+i}class vr{constructor(){}supports(e){return e instanceof Map||Rn(e)}create(){return new wr}}class wr{constructor(){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}get isDirty(){return null!==this._additionsHead||null!==this._changesHead||null!==this._removalsHead}forEachItem(e){let t;for(t=this._mapHead;null!==t;t=t._next)e(t)}forEachPreviousItem(e){let t;for(t=this._previousMapHead;null!==t;t=t._nextPrevious)e(t)}forEachChangedItem(e){let t;for(t=this._changesHead;null!==t;t=t._nextChanged)e(t)}forEachAddedItem(e){let t;for(t=this._additionsHead;null!==t;t=t._nextAdded)e(t)}forEachRemovedItem(e){let t;for(t=this._removalsHead;null!==t;t=t._nextRemoved)e(t)}diff(e){if(e){if(!(e instanceof Map||Rn(e)))throw new Error(`Error trying to diff '${w(e)}'. Only maps and objects are allowed`)}else e=new Map;return this.check(e)?this:null}onDestroy(){}check(e){this._reset();let t=this._mapHead;if(this._appendAfter=null,this._forEach(e,(e,n)=>{if(t&&t.key===n)this._maybeAddToChanges(t,e),this._appendAfter=t,t=t._next;else{const r=this._getOrCreateRecordForKey(n,e);t=this._insertBeforeOrAppend(t,r)}}),t){t._prev&&(t._prev._next=null),this._removalsHead=t;for(let e=t;null!==e;e=e._nextRemoved)e===this._mapHead&&(this._mapHead=null),this._records.delete(e.key),e._nextRemoved=e._next,e.previousValue=e.currentValue,e.currentValue=null,e._prev=null,e._next=null}return this._changesTail&&(this._changesTail._nextChanged=null),this._additionsTail&&(this._additionsTail._nextAdded=null),this.isDirty}_insertBeforeOrAppend(e,t){if(e){const n=e._prev;return t._next=e,t._prev=n,e._prev=t,n&&(n._next=t),e===this._mapHead&&(this._mapHead=t),this._appendAfter=e,e}return this._appendAfter?(this._appendAfter._next=t,t._prev=this._appendAfter):this._mapHead=t,this._appendAfter=t,null}_getOrCreateRecordForKey(e,t){if(this._records.has(e)){const n=this._records.get(e);this._maybeAddToChanges(n,t);const r=n._prev,i=n._next;return r&&(r._next=i),i&&(i._prev=r),n._next=null,n._prev=null,n}const n=new _r(e);return this._records.set(e,n),n.currentValue=t,this._addToAdditions(n),n}_reset(){if(this.isDirty){let e;for(this._previousMapHead=this._mapHead,e=this._previousMapHead;null!==e;e=e._next)e._nextPrevious=e._next;for(e=this._changesHead;null!==e;e=e._nextChanged)e.previousValue=e.currentValue;for(e=this._additionsHead;null!=e;e=e._nextAdded)e.previousValue=e.currentValue;this._changesHead=this._changesTail=null,this._additionsHead=this._additionsTail=null,this._removalsHead=null}}_maybeAddToChanges(e,t){kn(t,e.currentValue)||(e.previousValue=e.currentValue,e.currentValue=t,this._addToChanges(e))}_addToAdditions(e){null===this._additionsHead?this._additionsHead=this._additionsTail=e:(this._additionsTail._nextAdded=e,this._additionsTail=e)}_addToChanges(e){null===this._changesHead?this._changesHead=this._changesTail=e:(this._changesTail._nextChanged=e,this._changesTail=e)}_forEach(e,t){e instanceof Map?e.forEach(t):Object.keys(e).forEach(n=>t(e[n],n))}}class _r{constructor(e){this.key=e,this.previousValue=null,this.currentValue=null,this._nextPrevious=null,this._next=null,this._prev=null,this._nextAdded=null,this._nextRemoved=null,this._nextChanged=null}}let Sr=(()=>{class e{constructor(e){this.factories=e}static create(t,n){if(null!=n){const e=n.factories.slice();t=t.concat(e)}return new e(t)}static extend(t){return{provide:e,useFactory:n=>{if(!n)throw new Error("Cannot extend IterableDiffers without a parent injector");return e.create(t,n)},deps:[[e,new f,new h]]}}find(e){const t=this.factories.find(t=>t.supports(e));if(null!=t)return t;throw new Error(`Cannot find a differ supporting object '${e}' of type '${n=e,n.name||typeof n}'`);var n}}return e.ngInjectableDef=g({token:e,providedIn:"root",factory:()=>new e([new dr])}),e})(),Er=(()=>{class e{constructor(e){this.factories=e}static create(t,n){if(n){const e=n.factories.slice();t=t.concat(e)}return new e(t)}static extend(t){return{provide:e,useFactory:n=>{if(!n)throw new Error("Cannot extend KeyValueDiffers without a parent injector");return e.create(t,n)},deps:[[e,new f,new h]]}}find(e){const t=this.factories.find(t=>t.supports(e));if(t)return t;throw new Error(`Cannot find a differ supporting object '${e}'`)}}return e.ngInjectableDef=g({token:e,providedIn:"root",factory:()=>new e([new vr])}),e})();const Cr=[new vr],Tr=new Sr([new dr]),Ir=new Er(Cr);let Dr=(()=>{class e{}return e.__NG_ELEMENT_ID__=()=>xr(e,rr),e})();const xr=nr;let kr=(()=>{class e{}return e.__NG_ELEMENT_ID__=()=>Ar(e,rr),e})();const Ar=nr;function Or(e,t,n,r){let i=`ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: '${t}'. 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(e,t){const n=new Error(e);return Nr(n,t),n}(i,e)}function Nr(e,t){e[ot]=t,e[at]=t.logError.bind(t)}function Rr(e){return new Error(`ViewDestroyedError: Attempt to use a destroyed view: ${e}`)}function Mr(e,t,n){const r=e.state,i=1792&r;return i===t?(e.state=-1793&r|n,e.initIndex=-1,!0):i===n}function Pr(e,t,n){return(1792&e.state)===t&&e.initIndex<=n&&(e.initIndex=n+1,!0)}function Lr(e,t){return e.nodes[t]}function Fr(e,t){return e.nodes[t]}function jr(e,t){return e.nodes[t]}function Vr(e,t){return e.nodes[t]}function Ur(e,t){return e.nodes[t]}const qr={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},Br=()=>{},Hr=new Map;function zr(e){let t=Hr.get(e);return t||(t=w(e)+"_"+Hr.size,Hr.set(e,t)),t}function Wr(e,t,n,r){if(On.isWrapped(r)){r=On.unwrap(r);const i=e.def.nodes[t].bindingIndex+n,o=On.unwrap(e.oldValues[i]);e.oldValues[i]=new On(o)}return r}const Qr="$$undefined",Gr="$$empty";function Kr(e){return{id:Qr,styles:e.styles,encapsulation:e.encapsulation,data:e.data}}let $r=0;function Yr(e,t,n,r){return!(!(2&e.state)&&kn(e.oldValues[t.bindingIndex+n],r))}function Zr(e,t,n,r){return!!Yr(e,t,n,r)&&(e.oldValues[t.bindingIndex+n]=r,!0)}function Jr(e,t,n,r){const i=e.oldValues[t.bindingIndex+n];if(1&e.state||!An(i,r)){const o=t.bindings[n].name;throw Or(qr.createDebugContext(e,t.nodeIndex),`${o}: ${i}`,`${o}: ${r}`,0!=(1&e.state))}}function Xr(e){let t=e;for(;t;)2&t.def.flags&&(t.state|=8),t=t.viewContainerParent||t.parent}function ei(e,t){let n=e;for(;n&&n!==t;)n.state|=64,n=n.viewContainerParent||n.parent}function ti(e,t,n,r){try{return Xr(33554432&e.def.nodes[t].flags?Fr(e,t).componentView:e),qr.handleEvent(e,t,n,r)}catch(i){e.root.errorHandler.handleError(i)}}function ni(e){return e.parent?Fr(e.parent,e.parentNodeDef.nodeIndex):null}function ri(e){return e.parent?e.parentNodeDef.parent:null}function ii(e,t){switch(201347067&t.flags){case 1:return Fr(e,t.nodeIndex).renderElement;case 2:return Lr(e,t.nodeIndex).renderText}}function oi(e){return!!e.parent&&!!(32768&e.parentNodeDef.flags)}function si(e){return!(!e.parent||32768&e.parentNodeDef.flags)}function ai(e){return 1<<e%32}function ui(e){const t={};let n=0;const r={};return e&&e.forEach(([e,i])=>{"number"==typeof e?(t[e]=i,n|=ai(e)):r[e]=i}),{matchedQueries:t,references:r,matchedQueryIds:n}}function li(e,t){return e.map(e=>{let n,r;return Array.isArray(e)?[r,n]=e:(r=0,n=e),n&&("function"==typeof n||"object"==typeof n)&&t&&Object.defineProperty(n,L,{value:t,configurable:!0}),{flags:r,token:n,tokenKey:zr(n)}})}function ci(e,t,n){let r=n.renderParent;return r?0==(1&r.flags)||0==(33554432&r.flags)||r.element.componentRendererType&&r.element.componentRendererType.encapsulation===Y.Native?Fr(e,n.renderParent.nodeIndex).renderElement:void 0:t}const hi=new WeakMap;function di(e){let t=hi.get(e);return t||((t=e(()=>Br)).factory=e,hi.set(e,t)),t}function fi(e,t,n,r,i){3===t&&(n=e.renderer.parentNode(ii(e,e.def.lastRenderRootNode))),pi(e,t,0,e.def.nodes.length-1,n,r,i)}function pi(e,t,n,r,i,o,s){for(let a=n;a<=r;a++){const n=e.def.nodes[a];11&n.flags&&gi(e,n,t,i,o,s),a+=n.childCount}}function mi(e,t,n,r,i,o){let s=e;for(;s&&!oi(s);)s=s.parent;const a=s.parent,u=ri(s),l=u.nodeIndex+u.childCount;for(let c=u.nodeIndex+1;c<=l;c++){const e=a.def.nodes[c];e.ngContentIndex===t&&gi(a,e,n,r,i,o),c+=e.childCount}if(!a.parent){const s=e.root.projectableNodes[t];if(s)for(let t=0;t<s.length;t++)yi(e,s[t],n,r,i,o)}}function gi(e,t,n,r,i,o){if(8&t.flags)mi(e,t.ngContent.index,n,r,i,o);else{const s=ii(e,t);if(3===n&&33554432&t.flags&&48&t.bindingFlags?(16&t.bindingFlags&&yi(e,s,n,r,i,o),32&t.bindingFlags&&yi(Fr(e,t.nodeIndex).componentView,s,n,r,i,o)):yi(e,s,n,r,i,o),16777216&t.flags){const s=Fr(e,t.nodeIndex).viewContainer._embeddedViews;for(let e=0;e<s.length;e++)fi(s[e],n,r,i,o)}1&t.flags&&!t.element.name&&pi(e,n,t.nodeIndex+1,t.nodeIndex+t.childCount,r,i,o)}}function yi(e,t,n,r,i,o){const s=e.renderer;switch(n){case 1:s.appendChild(r,t);break;case 2:s.insertBefore(r,t,i);break;case 3:s.removeChild(r,t);break;case 0:o.push(t)}}const bi=/^:([^:]+):(.+)$/;function vi(e){if(":"===e[0]){const t=e.match(bi);return[t[1],t[2]]}return["",e]}function wi(e){let t=0;for(let n=0;n<e.length;n++)t|=e[n].flags;return t}function _i(e,t,n,r,i,o,s,a,u,l,c,h,d,f,p,m,g,y,b,v){switch(e){case 1:return t+Si(n)+r;case 2:return t+Si(n)+r+Si(i)+o;case 3:return t+Si(n)+r+Si(i)+o+Si(s)+a;case 4:return t+Si(n)+r+Si(i)+o+Si(s)+a+Si(u)+l;case 5:return t+Si(n)+r+Si(i)+o+Si(s)+a+Si(u)+l+Si(c)+h;case 6:return t+Si(n)+r+Si(i)+o+Si(s)+a+Si(u)+l+Si(c)+h+Si(d)+f;case 7:return t+Si(n)+r+Si(i)+o+Si(s)+a+Si(u)+l+Si(c)+h+Si(d)+f+Si(p)+m;case 8:return t+Si(n)+r+Si(i)+o+Si(s)+a+Si(u)+l+Si(c)+h+Si(d)+f+Si(p)+m+Si(g)+y;case 9:return t+Si(n)+r+Si(i)+o+Si(s)+a+Si(u)+l+Si(c)+h+Si(d)+f+Si(p)+m+Si(g)+y+Si(b)+v;default:throw new Error("Does not support more than 9 expressions")}}function Si(e){return null!=e?e.toString():""}const Ei=new Object,Ci=zr(gn),Ti=zr(A),Ii=zr(W);function Di(e,t,n,r){return n=E(n),{index:-1,deps:li(r,w(t)),flags:e,token:t,value:n}}function xi(e){const t={},n=[];let r=!1;for(let i=0;i<e.length;i++){const o=e[i];o.token===pn&&!0===o.value&&(r=!0),1073741824&o.flags&&n.push(o.token),o.index=i,t[zr(o.token)]=o}return{factory:null,providersByKey:t,providers:e,modules:n,isRoot:r}}function ki(e,t,n=gn.THROW_IF_NOT_FOUND){const r=U(e);try{if(8&t.flags)return t.token;if(2&t.flags&&(n=null),1&t.flags)return e._parent.get(t.token,n);const s=t.tokenKey;switch(s){case Ci:case Ti:case Ii:return e}const a=e._def.providersByKey[s];let u;if(a){let t=e._providers[a.index];return void 0===t&&(t=e._providers[a.index]=Ai(e,a)),t===Ei?void 0:t}if((u=b(t.token))&&(i=e,null!=(o=u).providedIn&&(function(e,t){return e._def.modules.indexOf(o.providedIn)>-1}(i)||"root"===o.providedIn&&i._def.isRoot))){const n=e._providers.length;return e._def.providers[n]=e._def.providersByKey[t.tokenKey]={flags:5120,value:u.factory,deps:[],index:n,token:t.token},e._providers[n]=Ei,e._providers[n]=Ai(e,e._def.providersByKey[t.tokenKey])}return 4&t.flags?n:e._parent.get(t.token,n)}finally{U(r)}var i,o}function Ai(e,t){let n;switch(201347067&t.flags){case 512:n=function(e,t,n){const r=n.length;switch(r){case 0:return new t;case 1:return new t(ki(e,n[0]));case 2:return new t(ki(e,n[0]),ki(e,n[1]));case 3:return new t(ki(e,n[0]),ki(e,n[1]),ki(e,n[2]));default:const i=new Array(r);for(let t=0;t<r;t++)i[t]=ki(e,n[t]);return new t(...i)}}(e,t.value,t.deps);break;case 1024:n=function(e,t,n){const r=n.length;switch(r){case 0:return t();case 1:return t(ki(e,n[0]));case 2:return t(ki(e,n[0]),ki(e,n[1]));case 3:return t(ki(e,n[0]),ki(e,n[1]),ki(e,n[2]));default:const i=Array(r);for(let t=0;t<r;t++)i[t]=ki(e,n[t]);return t(...i)}}(e,t.value,t.deps);break;case 2048:n=ki(e,t.deps[0]);break;case 256:n=t.value}return n===Ei||null===n||"object"!=typeof n||131072&t.flags||"function"!=typeof n.ngOnDestroy||(t.flags|=131072),void 0===n?Ei:n}function Oi(e,t){const n=e.viewContainer._embeddedViews;if((null==t||t>=n.length)&&(t=n.length-1),t<0)return null;const r=n[t];return r.viewContainerParent=null,K(n,t),qr.dirtyParentQueries(r),Ri(r),r}function Ni(e,t,n){const r=t?ii(t,t.def.lastRenderRootNode):e.renderElement,i=n.renderer.parentNode(r),o=n.renderer.nextSibling(r);fi(n,2,i,o,void 0)}function Ri(e){fi(e,3,null,null,void 0)}const Mi=new Object;function Pi(e,t,n,r,i,o){return new Li(e,t,n,r,i,o)}class Li extends $n{constructor(e,t,n,r,i,o){super(),this.selector=e,this.componentType=t,this._inputs=r,this._outputs=i,this.ngContentSelectors=o,this.viewDefFactory=n}get inputs(){const e=[],t=this._inputs;for(let n in t)e.push({propName:n,templateName:t[n]});return e}get outputs(){const e=[];for(let t in this._outputs)e.push({propName:t,templateName:this._outputs[t]});return e}create(e,t,n,r){if(!r)throw new Error("ngModule should be provided");const i=di(this.viewDefFactory),o=i.nodes[0].element.componentProvider.nodeIndex,s=qr.createRootView(e,t||[],n,i,r,Mi),a=jr(s,o).instance;return n&&s.renderer.setAttribute(Fr(s,0).renderElement,"ng-version",hr.full),new Fi(s,new qi(s),a)}}class Fi extends Kn{constructor(e,t,n){super(),this._view=e,this._viewRef=t,this._component=n,this._elDef=this._view.def.nodes[0],this.hostView=t,this.changeDetectorRef=t,this.instance=n}get location(){return new rr(Fr(this._view,this._elDef.nodeIndex).renderElement)}get injector(){return new Wi(this._view,this._elDef)}get componentType(){return this._component.constructor}destroy(){this._viewRef.destroy()}onDestroy(e){this._viewRef.onDestroy(e)}}function ji(e,t,n){return new Vi(e,t,n)}class Vi{constructor(e,t,n){this._view=e,this._elDef=t,this._data=n,this._embeddedViews=[]}get element(){return new rr(this._data.renderElement)}get injector(){return new Wi(this._view,this._elDef)}get parentInjector(){let e=this._view,t=this._elDef.parent;for(;!t&&e;)t=ri(e),e=e.parent;return e?new Wi(e,t):new Wi(this._view,null)}clear(){for(let e=this._embeddedViews.length-1;e>=0;e--){const t=Oi(this._data,e);qr.destroyView(t)}}get(e){const t=this._embeddedViews[e];if(t){const e=new qi(t);return e.attachToViewContainerRef(this),e}return null}get length(){return this._embeddedViews.length}createEmbeddedView(e,t,n){const r=e.createEmbeddedView(t||{});return this.insert(r,n),r}createComponent(e,t,n,r,i){const o=n||this.parentInjector;i||e instanceof tr||(i=o.get(W));const s=e.create(o,r,void 0,i);return this.insert(s.hostView,t),s}insert(e,t){if(e.destroyed)throw new Error("Cannot insert a destroyed View in a ViewContainer!");const n=e;return function(e,t,n,r){let i=t.viewContainer._embeddedViews;null==n&&(n=i.length),r.viewContainerParent=e,G(i,n,r),function(e,t){const n=ni(t);if(!n||n===e||16&t.state)return;t.state|=16;let r=n.template._projectedViews;r||(r=n.template._projectedViews=[]),r.push(t),function(e,n){if(4&n.flags)return;t.parent.def.nodeFlags|=4,n.flags|=4;let r=n.parent;for(;r;)r.childFlags|=4,r=r.parent}(0,t.parentNodeDef)}(t,r),qr.dirtyParentQueries(r),Ni(t,n>0?i[n-1]:null,r)}(this._view,this._data,t,n._view),n.attachToViewContainerRef(this),e}move(e,t){if(e.destroyed)throw new Error("Cannot move a destroyed View in a ViewContainer!");const n=this._embeddedViews.indexOf(e._view);return function(e,t,r){const i=e.viewContainer._embeddedViews,o=i[n];K(i,n),null==r&&(r=i.length),G(i,r,o),qr.dirtyParentQueries(o),Ri(o),Ni(e,r>0?i[r-1]:null,o)}(this._data,0,t),e}indexOf(e){return this._embeddedViews.indexOf(e._view)}remove(e){const t=Oi(this._data,e);t&&qr.destroyView(t)}detach(e){const t=Oi(this._data,e);return t?new qi(t):null}}function Ui(e){return new qi(e)}class qi{constructor(e){this._view=e,this._viewContainerRef=null,this._appRef=null}get rootNodes(){return function(e){const t=[];return fi(e,0,void 0,void 0,t),t}(this._view)}get context(){return this._view.context}get destroyed(){return 0!=(128&this._view.state)}markForCheck(){Xr(this._view)}detach(){this._view.state&=-5}detectChanges(){const e=this._view.root.rendererFactory;e.begin&&e.begin();try{qr.checkAndUpdateView(this._view)}finally{e.end&&e.end()}}checkNoChanges(){qr.checkNoChangesView(this._view)}reattach(){this._view.state|=4}onDestroy(e){this._view.disposables||(this._view.disposables=[]),this._view.disposables.push(e)}destroy(){this._appRef?this._appRef.detachView(this):this._viewContainerRef&&this._viewContainerRef.detach(this._viewContainerRef.indexOf(this)),qr.destroyView(this._view)}detachFromAppRef(){this._appRef=null,Ri(this._view),qr.dirtyParentQueries(this._view)}attachToAppRef(e){if(this._viewContainerRef)throw new Error("This view is already attached to a ViewContainer!");this._appRef=e}attachToViewContainerRef(e){if(this._appRef)throw new Error("This view is already attached directly to the ApplicationRef!");this._viewContainerRef=e}}function Bi(e,t){return new Hi(e,t)}class Hi extends Dr{constructor(e,t){super(),this._parentView=e,this._def=t}createEmbeddedView(e){return new qi(qr.createEmbeddedView(this._parentView,this._def,this._def.element.template,e))}get elementRef(){return new rr(Fr(this._parentView,this._def.nodeIndex).renderElement)}}function zi(e,t){return new Wi(e,t)}class Wi{constructor(e,t){this.view=e,this.elDef=t}get(e,t=gn.THROW_IF_NOT_FOUND){return qr.resolveDep(this.view,this.elDef,!!this.elDef&&0!=(33554432&this.elDef.flags),{flags:0,token:e,tokenKey:zr(e)},t)}}function Qi(e,t){const n=e.def.nodes[t];if(1&n.flags){const t=Fr(e,n.nodeIndex);return n.element.template?t.template:t.renderElement}if(2&n.flags)return Lr(e,n.nodeIndex).renderText;if(20240&n.flags)return jr(e,n.nodeIndex).instance;throw new Error(`Illegal state: read nodeValue for node index ${t}`)}function Gi(e){return new Ki(e.renderer)}class Ki{constructor(e){this.delegate=e}selectRootElement(e){return this.delegate.selectRootElement(e)}createElement(e,t){const[n,r]=vi(t),i=this.delegate.createElement(r,n);return e&&this.delegate.appendChild(e,i),i}createViewRoot(e){return e}createTemplateAnchor(e){const t=this.delegate.createComment("");return e&&this.delegate.appendChild(e,t),t}createText(e,t){const n=this.delegate.createText(t);return e&&this.delegate.appendChild(e,n),n}projectNodes(e,t){for(let n=0;n<t.length;n++)this.delegate.appendChild(e,t[n])}attachViewAfter(e,t){const n=this.delegate.parentNode(e),r=this.delegate.nextSibling(e);for(let i=0;i<t.length;i++)this.delegate.insertBefore(n,t[i],r)}detachView(e){for(let t=0;t<e.length;t++){const n=e[t],r=this.delegate.parentNode(n);this.delegate.removeChild(r,n)}}destroyView(e,t){for(let n=0;n<t.length;n++)this.delegate.destroyNode(t[n])}listen(e,t,n){return this.delegate.listen(e,t,n)}listenGlobal(e,t,n){return this.delegate.listen(e,t,n)}setElementProperty(e,t,n){this.delegate.setProperty(e,t,n)}setElementAttribute(e,t,n){const[r,i]=vi(t);null!=n?this.delegate.setAttribute(e,i,n,r):this.delegate.removeAttribute(e,i,r)}setBindingDebugInfo(e,t,n){}setElementClass(e,t,n){n?this.delegate.addClass(e,t):this.delegate.removeClass(e,t)}setElementStyle(e,t,n){null!=n?this.delegate.setStyle(e,t,n):this.delegate.removeStyle(e,t)}invokeElementMethod(e,t,n){e[t].apply(e,n)}setText(e,t){this.delegate.setValue(e,t)}animate(){throw new Error("Renderer.animate is no longer supported!")}}function $i(e,t,n,r){return new Yi(e,t,n,r)}class Yi{constructor(e,t,n,r){this._moduleType=e,this._parent=t,this._bootstrapComponents=n,this._def=r,this._destroyListeners=[],this._destroyed=!1,this.injector=this,function(e){const t=e._def,n=e._providers=new Array(t.providers.length);for(let r=0;r<t.providers.length;r++){const i=t.providers[r];4096&i.flags||void 0===n[r]&&(n[r]=Ai(e,i))}}(this)}get(e,t=gn.THROW_IF_NOT_FOUND,n=p.Default){let r=0;return n&p.SkipSelf?r|=1:n&p.Self&&(r|=4),ki(this,{token:e,tokenKey:zr(e),flags:r},t)}get instance(){return this.get(this._moduleType)}get componentFactoryResolver(){return this.get(Xn)}destroy(){if(this._destroyed)throw new Error(`The ng module ${w(this.instance.constructor)} has already been destroyed.`);this._destroyed=!0,function(e,t){const n=e._def,r=new Set;for(let i=0;i<n.providers.length;i++)if(131072&n.providers[i].flags){const t=e._providers[i];if(t&&t!==Ei){const e=t.ngOnDestroy;"function"!=typeof e||r.has(t)||(e.apply(t),r.add(t))}}}(this),this._destroyListeners.forEach(e=>e())}onDestroy(e){this._destroyListeners.push(e)}}const Zi=zr(or),Ji=zr(ur),Xi=zr(rr),eo=zr(kr),to=zr(Dr),no=zr(dn),ro=zr(gn),io=zr(A);function oo(e,t,n,r,i,o,s,a){const u=[];if(s)for(let c in s){const[e,t]=s[c];u[e]={flags:8,name:c,nonMinifiedName:t,ns:null,securityContext:null,suffix:null}}const l=[];if(a)for(let c in a)l.push({type:1,propName:c,target:null,eventName:a[c]});return uo(e,t|=16384,n,r,i,i,o,u,l)}function so(e,t,n){return uo(-1,e|=16,null,0,t,t,n)}function ao(e,t,n,r,i){return uo(-1,e,t,0,n,r,i)}function uo(e,t,n,r,i,o,s,a,u){const{matchedQueries:l,references:c,matchedQueryIds:h}=ui(n);u||(u=[]),a||(a=[]),o=E(o);const d=li(s,w(i));return{nodeIndex:-1,parent:null,renderParent:null,bindingIndex:-1,outputIndex:-1,checkIndex:e,flags:t,childFlags:0,directChildFlags:0,childMatchedQueries:0,matchedQueries:l,matchedQueryIds:h,references:c,ngContentIndex:-1,childCount:r,bindings:a,bindingFlags:wi(a),outputs:u,element:null,provider:{token:i,value:o,deps:d},text:null,query:null,ngContent:null}}function lo(e,t){return po(e,t)}function co(e,t){let n=e;for(;n.parent&&!oi(n);)n=n.parent;return mo(n.parent,ri(n),!0,t.provider.value,t.provider.deps)}function ho(e,t){const n=mo(e,t.parent,(32768&t.flags)>0,t.provider.value,t.provider.deps);if(t.outputs.length)for(let r=0;r<t.outputs.length;r++){const i=t.outputs[r],o=n[i.propName];if(!Qn(o))throw new Error(`@Output ${i.propName} not initialized in '${n.constructor.name}'.`);{const n=o.subscribe(fo(e,t.parent.nodeIndex,i.eventName));e.disposables[t.outputIndex+r]=n.unsubscribe.bind(n)}}return n}function fo(e,t,n){return r=>ti(e,t,n,r)}function po(e,t){const n=(8192&t.flags)>0,r=t.provider;switch(201347067&t.flags){case 512:return mo(e,t.parent,n,r.value,r.deps);case 1024:return function(e,t,n,r,i){const o=i.length;switch(o){case 0:return r();case 1:return r(yo(e,t,n,i[0]));case 2:return r(yo(e,t,n,i[0]),yo(e,t,n,i[1]));case 3:return r(yo(e,t,n,i[0]),yo(e,t,n,i[1]),yo(e,t,n,i[2]));default:const s=Array(o);for(let r=0;r<o;r++)s[r]=yo(e,t,n,i[r]);return r(...s)}}(e,t.parent,n,r.value,r.deps);case 2048:return yo(e,t.parent,n,r.deps[0]);case 256:return r.value}}function mo(e,t,n,r,i){const o=i.length;switch(o){case 0:return new r;case 1:return new r(yo(e,t,n,i[0]));case 2:return new r(yo(e,t,n,i[0]),yo(e,t,n,i[1]));case 3:return new r(yo(e,t,n,i[0]),yo(e,t,n,i[1]),yo(e,t,n,i[2]));default:const s=new Array(o);for(let r=0;r<o;r++)s[r]=yo(e,t,n,i[r]);return new r(...s)}}const go={};function yo(e,t,n,r,i=gn.THROW_IF_NOT_FOUND){if(8&r.flags)return r.token;const o=e;2&r.flags&&(i=null);const s=r.tokenKey;s===no&&(n=!(!t||!t.element.componentView)),t&&1&r.flags&&(n=!1,t=t.parent);let a=e;for(;a;){if(t)switch(s){case Zi:return Gi(bo(a,t,n));case Ji:return bo(a,t,n).renderer;case Xi:return new rr(Fr(a,t.nodeIndex).renderElement);case eo:return Fr(a,t.nodeIndex).viewContainer;case to:if(t.element.template)return Fr(a,t.nodeIndex).template;break;case no:return Ui(bo(a,t,n));case ro:case io:return zi(a,t);default:const e=(n?t.element.allProviders:t.element.publicProviders)[s];if(e){let t=jr(a,e.nodeIndex);return t||(t={instance:po(a,e)},a.nodes[e.nodeIndex]=t),t.instance}}n=oi(a),t=ri(a),a=a.parent,4&r.flags&&(a=null)}const u=o.root.injector.get(r.token,go);return u!==go||i===go?u:o.root.ngModule.injector.get(r.token,i)}function bo(e,t,n){let r;if(n)r=Fr(e,t.nodeIndex).componentView;else for(r=e;r.parent&&!oi(r);)r=r.parent;return r}function vo(e,t,n,r,i,o){if(32768&n.flags){const t=Fr(e,n.parent.nodeIndex).componentView;2&t.def.flags&&(t.state|=8)}if(t.instance[n.bindings[r].name]=i,524288&n.flags){o=o||{};const t=On.unwrap(e.oldValues[n.bindingIndex+r]);o[n.bindings[r].nonMinifiedName]=new Gn(t,i,0!=(2&e.state))}return e.oldValues[n.bindingIndex+r]=i,o}function wo(e,t){if(!(e.def.nodeFlags&t))return;const n=e.def.nodes;let r=0;for(let i=0;i<n.length;i++){const o=n[i];let s=o.parent;for(!s&&o.flags&t&&So(e,i,o.flags&t,r++),0==(o.childFlags&t)&&(i+=o.childCount);s&&1&s.flags&&i===s.nodeIndex+s.childCount;)s.directChildFlags&t&&(r=_o(e,s,t,r)),s=s.parent}}function _o(e,t,n,r){for(let i=t.nodeIndex+1;i<=t.nodeIndex+t.childCount;i++){const t=e.def.nodes[i];t.flags&n&&So(e,i,t.flags&n,r++),i+=t.childCount}return r}function So(e,t,n,r){const i=jr(e,t);if(!i)return;const o=i.instance;o&&(qr.setCurrentNode(e,t),1048576&n&&Pr(e,512,r)&&o.ngAfterContentInit(),2097152&n&&o.ngAfterContentChecked(),4194304&n&&Pr(e,768,r)&&o.ngAfterViewInit(),8388608&n&&o.ngAfterViewChecked(),131072&n&&o.ngOnDestroy())}const Eo=new k("SCHEDULER_TOKEN",{providedIn:"root",factory:()=>Oe}),Co={},To=function(){var e={LocaleId:0,DayPeriodsFormat:1,DayPeriodsStandalone:2,DaysFormat:3,DaysStandalone:4,MonthsFormat:5,MonthsStandalone:6,Eras:7,FirstDayOfWeek:8,WeekendRange:9,DateFormat:10,TimeFormat:11,DateTimeFormat:12,NumberSymbols:13,NumberFormats:14,CurrencySymbol:15,CurrencyName:16,Currencies:17,PluralCase:18,ExtraData:19};return e[e.LocaleId]="LocaleId",e[e.DayPeriodsFormat]="DayPeriodsFormat",e[e.DayPeriodsStandalone]="DayPeriodsStandalone",e[e.DaysFormat]="DaysFormat",e[e.DaysStandalone]="DaysStandalone",e[e.MonthsFormat]="MonthsFormat",e[e.MonthsStandalone]="MonthsStandalone",e[e.Eras]="Eras",e[e.FirstDayOfWeek]="FirstDayOfWeek",e[e.WeekendRange]="WeekendRange",e[e.DateFormat]="DateFormat",e[e.TimeFormat]="TimeFormat",e[e.DateTimeFormat]="DateTimeFormat",e[e.NumberSymbols]="NumberSymbols",e[e.NumberFormats]="NumberFormats",e[e.CurrencySymbol]="CurrencySymbol",e[e.CurrencyName]="CurrencyName",e[e.Currencies]="Currencies",e[e.PluralCase]="PluralCase",e[e.ExtraData]="ExtraData",e}(),Io=void 0;var Do=["en",[["a","p"],["AM","PM"],Io],[["AM","PM"],Io,Io],[["S","M","T","W","T","F","S"],["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],["Sunday","Monday","Tuesday","Wednesday","Thursday","Frid
1ay","Saturday"],["Su","Mo","Tu","We","Th","Fr","Sa"]],Io,[["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"]],Io,[["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}",Io,"{1} 'at' {0}",Io],[".",",",";","%","+","-","E","\xd7","\u2030","\u221e","NaN",":"],["#,##0.###","#,##0%","\xa4#,##0.00","#E0"],"$","US Dollar",{},function(e){let t=Math.floor(Math.abs(e)),n=e.toString().replace(/^[^.]*\.?/,"").length;return 1===t&&0===n?1:5}];function xo(e){return ko(e)[To.PluralCase]}function ko(e){const t=e.toLowerCase().replace(/_/g,"-");let n=Co[t];if(n)return n;const r=t.split("-")[0];if(n=Co[r])return n;if("en"===r)return Do;throw new Error(`Missing locale data for the locale "${e}".`)}const Ao="en-US";let Oo=Ao;function No(e){var t;t="Expected localeId to be defined",null==e&&function(e){throw new Error(`ASSERTION ERROR: ${e}`)}(t),"string"==typeof e&&(Oo=e.toLowerCase().replace(/_/g,"-"))}class Ro extends r.a{constructor(e=!1){super(),this.__isAsync=e}emit(e){super.next(e)}subscribe(e,t,n){let r,o=e=>null,s=()=>null;e&&"object"==typeof e?(r=this.__isAsync?t=>{setTimeout(()=>e.next(t))}:t=>{e.next(t)},e.error&&(o=this.__isAsync?t=>{setTimeout(()=>e.error(t))}:t=>{e.error(t)}),e.complete&&(s=this.__isAsync?()=>{setTimeout(()=>e.complete())}:()=>{e.complete()})):(r=this.__isAsync?t=>{setTimeout(()=>e(t))}:t=>{e(t)},t&&(o=this.__isAsync?e=>{setTimeout(()=>t(e))}:e=>{t(e)}),n&&(s=this.__isAsync?()=>{setTimeout(()=>n())}:()=>{n()}));const a=super.subscribe(r,o,s);return e instanceof i.a&&e.add(a),a}}function Mo(){return this._results[xn()]()}class Po{constructor(){this.dirty=!0,this._results=[],this.changes=new Ro,this.length=0;const e=xn(),t=Po.prototype;t[e]||(t[e]=Mo)}map(e){return this._results.map(e)}filter(e){return this._results.filter(e)}find(e){return this._results.find(e)}reduce(e,t){return this._results.reduce(e,t)}forEach(e){this._results.forEach(e)}some(e){return this._results.some(e)}toArray(){return this._results.slice()}toString(){return this._results.toString()}reset(e){this._results=function e(t,n){void 0===n&&(n=t);for(let r=0;r<t.length;r++){let i=t[r];Array.isArray(i)?(n===t&&(n=t.slice(0,r)),e(i,n)):n!==t&&n.push(i)}return n}(e),this.dirty=!1,this.length=this._results.length,this.last=this._results[this.length-1],this.first=this._results[0]}notifyOnChanges(){this.changes.emit(this)}setDirty(){this.dirty=!0}destroy(){this.changes.complete(),this.changes.unsubscribe()}}const Lo=new k("Application Initializer");class Fo{constructor(e){this.appInits=e,this.initialized=!1,this.done=!1,this.donePromise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}runInitializers(){if(this.initialized)return;const e=[],t=()=>{this.done=!0,this.resolve()};if(this.appInits)for(let n=0;n<this.appInits.length;n++){const t=this.appInits[n]();Wn(t)&&e.push(t)}Promise.all(e).then(()=>{t()}).catch(e=>{this.reject(e)}),0===e.length&&t(),this.initialized=!0}}const jo=new k("AppId"),Vo=new k("Platform Initializer"),Uo=new k("Platform ID"),qo=new k("appBootstrapListener");class Bo{log(e){console.log(e)}warn(e){console.warn(e)}}const Ho=new k("LocaleId"),zo=!1;function Wo(){throw new Error("Runtime compiler is not loaded")}const Qo=Wo,Go=Wo,Ko=Wo,$o=Wo;class Yo{constructor(){this.compileModuleSync=Qo,this.compileModuleAsync=Go,this.compileModuleAndAllComponentsSync=Ko,this.compileModuleAndAllComponentsAsync=$o}clearCache(){}clearCacheFor(e){}getModuleId(e){}}class Zo{}let Jo,Xo;function es(){const e=x.wtf;return!(!e||!(Jo=e.trace)||(Xo=Jo.events,0))}const ts=es(),ns=ts?function(e,t=null){return Xo.createScope(e,t)}:(e,t)=>(function(e,t){return null}),rs=ts?function(e,t){return Jo.leaveScope(e,t),t}:(e,t)=>t,is=(()=>Promise.resolve(0))();function os(e){"undefined"==typeof Zone?is.then(()=>{e&&e.apply(null,null)}):Zone.current.scheduleMicroTask("scheduleMicrotask",e)}class ss{constructor({enableLongStackTrace:e=!1}){if(this.hasPendingMicrotasks=!1,this.hasPendingMacrotasks=!1,this.isStable=!0,this.onUnstable=new Ro(!1),this.onMicrotaskEmpty=new Ro(!1),this.onStable=new Ro(!1),this.onError=ne
vendor: 18,907 bytes, line 1
1w Ro(!1),"undefined"==typeof Zone)throw new Error("In this configuration Angular requires Zone.js");var t;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)),e&&Zone.longStackTraceZoneSpec&&(this._inner=this._inner.fork(Zone.longStackTraceZoneSpec)),(t=this)._inner=t._inner.fork({name:"angular",properties:{isAngularZone:!0},onInvokeTask:(e,n,r,i,o,s)=>{try{return cs(t),e.invokeTask(r,i,o,s)}finally{hs(t)}},onInvoke:(e,n,r,i,o,s,a)=>{try{return cs(t),e.invoke(r,i,o,s,a)}finally{hs(t)}},onHasTask:(e,n,r,i)=>{e.hasTask(r,i),n===r&&("microTask"==i.change?(t.hasPendingMicrotasks=i.microTask,ls(t)):"macroTask"==i.change&&(t.hasPendingMacrotasks=i.macroTask))},onHandleError:(e,n,r,i)=>(e.handleError(r,i),t.runOutsideAngular(()=>t.onError.emit(i)),!1)})}static isInAngularZone(){return!0===Zone.current.get("isAngularZone")}static assertInAngularZone(){if(!ss.isInAngularZone())throw new Error("Expected to be in Angular Zone, but it is not!")}static assertNotInAngularZone(){if(ss.isInAngularZone())throw new Error("Expected to not be in Angular Zone, but it is!")}run(e,t,n){return this._inner.run(e,t,n)}runTask(e,t,n,r){const i=this._inner,o=i.scheduleEventTask("NgZoneEvent: "+r,e,us,as,as);try{return i.runTask(o,t,n)}finally{i.cancelTask(o)}}runGuarded(e,t,n){return this._inner.runGuarded(e,t,n)}runOutsideAngular(e){return this._outer.run(e)}}function as(){}const us={};function ls(e){if(0==e._nesting&&!e.hasPendingMicrotasks&&!e.isStable)try{e._nesting++,e.onMicrotaskEmpty.emit(null)}finally{if(e._nesting--,!e.hasPendingMicrotasks)try{e.runOutsideAngular(()=>e.onStable.emit(null))}finally{e.isStable=!0}}}function cs(e){e._nesting++,e.isStable&&(e.isStable=!1,e.onUnstable.emit(null))}function hs(e){e._nesting--,ls(e)}class ds{constructor(){this.hasPendingMicrotasks=!1,this.hasPendingMacrotasks=!1,this.isStable=!0,this.onUnstable=new Ro,this.onMicrotaskEmpty=new Ro,this.onStable=new Ro,this.onError=new Ro}run(e){return e()}runGuarded(e){return e()}runOutsideAngular(e){return e()}runTask(e){return e()}}class fs{constructor(e){this._ngZone=e,this._pendingCount=0,this._isZoneStable=!0,this._didWork=!1,this._callbacks=[],this.taskTrackingZone=null,this._watchAngularEvents(),e.run(()=>{this.taskTrackingZone="undefined"==typeof Zone?null:Zone.current.get("TaskTrackingZone")})}_watchAngularEvents(){this._ngZone.onUnstable.subscribe({next:()=>{this._didWork=!0,this._isZoneStable=!1}}),this._ngZone.runOutsideAngular(()=>{this._ngZone.onStable.subscribe({next:()=>{ss.assertNotInAngularZone(),os(()=>{this._isZoneStable=!0,this._runCallbacksIfReady()})}})})}increasePendingRequestCount(){return this._pendingCount+=1,this._didWork=!0,this._pendingCount}decreasePendingRequestCount(){if(this._pendingCount-=1,this._pendingCount<0)throw new Error("pending async requests below zero");return this._runCallbacksIfReady(),this._pendingCount}isStable(){return this._isZoneStable&&0===this._pendingCount&&!this._ngZone.hasPendingMacrotasks}_runCallbacksIfReady(){if(this.isStable())os(()=>{for(;0!==this._callbacks.length;){let e=this._callbacks.pop();clearTimeout(e.timeoutId),e.doneCb(this._didWork)}this._didWork=!1});else{let e=this.getPendingTasks();this._callbacks=this._callbacks.filter(t=>!t.updateCb||!t.updateCb(e)||(clearTimeout(t.timeoutId),!1)),this._didWork=!0}}getPendingTasks(){return this.taskTrackingZone?this.taskTrackingZone.macroTasks.map(e=>({source:e.source,creationLocation:e.creationLocation,data:e.data})):[]}addCallback(e,t,n){let r=-1;t&&t>0&&(r=setTimeout(()=>{this._callbacks=this._callbacks.filter(e=>e.timeoutId!==r),e(this._didWork,this.getPendingTasks())},t)),this._callbacks.push({doneCb:e,timeoutId:r,updateCb:n})}whenStable(e,t,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(e,t,n),this._runCallbacksIfReady()}getPendingRequestCount(){return this._pendingCount}findProviders(e,t,n){return[]}}class ps{constructor(){this._applications=new Map,bs.addToWindow(this)}registerApplication(e,t){this._applications.set(e,t)}unregisterApplication(e){this._applications.delete(e)}unregisterAllApplications(){this._applications.clear()}getTestability(e){return this._applications.get(e)||null}getAllTestabilities(){return Array.from(this._applications.values())}getAllRootElements(){return Array.from(this._applications.keys())}findTestabilityInTree(e,t=!0){return bs.findTestabilityInTree(this,e,t)}}class ms{addToWindow(e){}findTestabilityInTree(e,t,n){return null}}function gs(e){bs=e}let ys,bs=new ms,vs=function(e,t,n){return e.get(Zo).createCompiler([t]).compileModuleAsync(n)},ws=function(e){return e instanceof tr};const _s=new k("AllowMultipleToken");class Ss{constructor(e,t){this.name=e,this.token=t}}function Es(e,t,n=[]){const r=`Platform: ${t}`,i=new k(r);return(t=[])=>{let o=Cs();if(!o||o.injector.get(_s,!1))if(e)e(n.concat(t).concat({provide:i,useValue:!0}));else{const e=n.concat(t).concat({provide:i,useValue:!0});!function(e){if(ys&&!ys.destroyed&&!ys.injector.get(_s,!1))throw new Error("There can be only one platform. Destroy the previous one to create a new one.");ys=e.get(Ts);const t=e.get(Vo,null);t&&t.forEach(e=>e())}(gn.create({providers:e,name:r}))}return function(e){const t=Cs();if(!t)throw new Error("No platform exists!");if(!t.injector.get(e,null))throw new Error("A platform with a different configuration has been created. Please destroy it first.");return t}(i)}}function Cs(){return ys&&!ys.destroyed?ys:null}class Ts{constructor(e){this._injector=e,this._modules=[],this._destroyListeners=[],this._destroyed=!1}bootstrapModuleFactory(e,t){const n="noop"===(i=t?t.ngZone:void 0)?new ds:("zone.js"===i?void 0:i)||new ss({enableLongStackTrace:pt()}),r=[{provide:ss,useValue:n}];var i;return n.run(()=>{const t=gn.create({providers:r,parent:this.injector,name:e.moduleType.name}),i=e.create(t),o=i.injector.get(ht,null);if(!o)throw new Error("No ErrorHandler. Is platform module (BrowserModule) included?");return zo&&No(i.injector.get(Ho,Ao)||Ao),i.onDestroy(()=>xs(this._modules,i)),n.runOutsideAngular(()=>n.onError.subscribe({next:e=>{o.handleError(e)}})),function(e,t,n){try{const i=n();return Wn(i)?i.catch(n=>{throw t.runOutsideAngular(()=>e.handleError(n)),n}):i}catch(r){throw t.runOutsideAngular(()=>e.handleError(r)),r}}(o,n,()=>{const e=i.injector.get(Fo);return e.runInitializers(),e.donePromise.then(()=>(this._moduleDoBootstrap(i),i))})})}bootstrapModule(e,t=[]){const n=Is({},t);return vs(this.injector,n,e).then(e=>this.bootstrapModuleFactory(e,n))}_moduleDoBootstrap(e){const t=e.injector.get(Ds);if(e._bootstrapComponents.length>0)e._bootstrapComponents.forEach(e=>t.bootstrap(e));else{if(!e.instance.ngDoBootstrap)throw new Error(`The module ${w(e.instance.constructor)} was bootstrapped, but it does not declare "@NgModule.bootstrap" components nor a "ngDoBootstrap" method. `+"Please define one of these.");e.instance.ngDoBootstrap(t)}this._modules.push(e)}onDestroy(e){this._destroyListeners.push(e)}get injector(){return this._injector}destroy(){if(this._destroyed)throw new Error("The platform has already been destroyed!");this._modules.slice().forEach(e=>e.destroy()),this._destroyListeners.forEach(e=>e()),this._destroyed=!0}get destroyed(){return this._destroyed}}function Is(e,t){return Array.isArray(t)?t.reduce(Is,e):Object.assign({},e,t)}let Ds=(()=>{class e{constructor(e,t,n,r,i,u){this._zone=e,this._console=t,this._injector=n,this._exceptionHandler=r,this._componentFactoryResolver=i,this._initStatus=u,this._bootstrapListeners=[],this._views=[],this._runningTick=!1,this._enforceNoNewChanges=!1,this._stable=!0,this.componentTypes=[],this.components=[],this._enforceNoNewChanges=pt(),this._zone.onMicrotaskEmpty.subscribe({next:()=>{this._zone.run(()=>{this.tick()})}});const l=new o.a(e=>{this._stable=this._zone.isStable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks,this._zone.runOutsideAngular(()=>{e.next(this._stable),e.complete()})}),c=new o.a(e=>{let t;this._zone.runOutsideAngular(()=>{t=this._zone.onStable.subscribe(()=>{ss.assertNotInAngularZone(),os(()=>{this._stable||this._zone.hasPendingMacrotasks||this._zone.hasPendingMicrotasks||(this._stable=!0,e.next(!0))})})});const n=this._zone.onUnstable.subscribe(()=>{ss.assertInAngularZone(),this._stable&&(this._stable=!1,this._zone.runOutsideAngular(()=>{e.next(!1)}))});return()=>{t.unsubscribe(),n.unsubscribe()}});this.isStable=Object(s.a)(l,c.pipe(Object(a.a)()))}bootstrap(e,t){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.");let n;n=e instanceof $n?e:this._componentFactoryResolver.resolveComponentFactory(e),this.componentTypes.push(n.componentType);const r=ws(n)?null:this._injector.get(W),i=n.create(gn.NULL,[],t||n.selector,r);i.onDestroy(()=>{this._unloadComponent(i)});const o=i.injector.get(fs,null);return o&&i.injector.get(ps).registerApplication(i.location.nativeElement,o),this._loadComponent(i),pt()&&this._console.log("Angular is running in the development mode. Call enableProdMode() to enable the production mode."),i}tick(){if(this._runningTick)throw new Error("ApplicationRef.tick is called recursively");const t=e._tickScope();try{this._runningTick=!0;for(let e of this._views)e.detectChanges();if(this._enforceNoNewChanges)for(let e of this._views)e.checkNoChanges()}catch(n){this._zone.runOutsideAngular(()=>this._exceptionHandler.handleError(n))}finally{this._runningTick=!1,rs(t)}}attachView(e){const t=e;this._views.push(t),t.attachToAppRef(this)}detachView(e){const t=e;xs(this._views,t),t.detachFromAppRef()}_loadComponent(e){this.attachView(e.hostView),this.tick(),this.components.push(e),this._injector.get(qo,[]).concat(this._bootstrapListeners).forEach(t=>t(e))}_unloadComponent(e){this.detachView(e.hostView),xs(this.components,e)}ngOnDestroy(){this._views.slice().forEach(e=>e.destroy())}get viewCount(){return this._views.length}}return e._tickScope=ns("ApplicationRef#tick()"),e})();function xs(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class ks{}const As="#",Os="NgFactory";class Ns{}const Rs={factoryPathPrefix:"",factoryPathSuffix:".ngfactory"};class Ms{constructor(e,t){this._compiler=e,this._config=t||Rs}load(e){return!zo&&this._compiler instanceof Yo?this.loadFactory(e):this.loadAndCompile(e)}loadAndCompile(e){let[t,r]=e.split(As);return void 0===r&&(r="default"),n("crnd")(t).then(e=>e[r]).then(e=>Ps(e,t,r)).then(e=>this._compiler.compileModuleAsync(e))}loadFactory(e){let[t,r]=e.split(As),i=Os;return void 0===r&&(r="default",i=""),n("crnd")(this._config.factoryPathPrefix+t+this._config.factoryPathSuffix).then(e=>e[r+i]).then(e=>Ps(e,t,r))}}function Ps(e,t,n){if(!e)throw new Error(`Cannot find '${n}' in '${t}'`);return e}class Ls{constructor(e,t){this.name=e,this.callback=t}}class Fs{constructor(e,t,n){this.listeners=[],this.parent=null,this._debugContext=n,this.nativeNode=e,t&&t instanceof js&&t.addChild(this)}get injector(){return this._debugContext.injector}get componentInstance(){return this._debugContext.component}get context(){return this._debugContext.context}get references(){return this._debugContext.references}get providerTokens(){return this._debugContext.providerTokens}}class js extends Fs{constructor(e,t,n){super(e,t,n),this.properties={},this.attributes={},this.classes={},this.styles={},this.childNodes=[],this.nativeElement=e}addChild(e){e&&(this.childNodes.push(e),e.parent=this)}removeChild(e){const t=this.childNodes.indexOf(e);-1!==t&&(e.parent=null,this.childNodes.splice(t,1))}insertChildrenAfter(e,t){const n=this.childNodes.indexOf(e);-1!==n&&(this.childNodes.splice(n+1,0,...t),t.forEach(t=>{t.parent&&t.parent.removeChild(t),e.parent=this}))}insertBefore(e,t){const n=this.childNodes.indexOf(e);-1===n?this.addChild(t):(t.parent&&t.parent.removeChild(t),t.parent=this,this.childNodes.splice(n,0,t))}query(e){return this.queryAll(e)[0]||null}queryAll(e){const t=[];return function e(t,n,r){t.childNodes.forEach(t=>{t instanceof js&&(n(t)&&r.push(t),e(t,n,r))})}(this,e,t),t}queryAllNodes(e){const t=[];return function e(t,n,r){t instanceof js&&t.childNodes.forEach(t=>{n(t)&&r.push(t),t instanceof js&&e(t,n,r)})}(this,e,t),t}get children(){return this.childNodes.filter(e=>e instanceof js)}triggerEventHandler(e,t){this.listeners.forEach(n=>{n.name==e&&n.callback(t)})}}const Vs=new Map,Us=function(e){return Vs.get(e)||null};function qs(e){Vs.set(e.nativeNode,e)}const Bs=Es(null,"core",[{provide:Uo,useValue:"unknown"},{provide:Ts,deps:[gn]},{provide:ps,deps:[]},{provide:Bo,deps:[]}]);function Hs(){return Tr}function zs(){return Ir}function Ws(e){return e?(zo&&No(e),e):Ao}function Qs(e){let t=[];return e.onStable.subscribe(()=>{for(;t.length;)t.pop()()}),function(e){t.push(e)}}class Gs{constructor(e){}}function Ks(e,t,n,r,i,o){e|=1;const{matchedQueries:s,references:a,matchedQueryIds:u}=ui(t);return{nodeIndex:-1,parent:null,renderParent:null,bindingIndex:-1,outputIndex:-1,flags:e,checkIndex:-1,childFlags:0,directChildFlags:0,childMatchedQueries:0,matchedQueries:s,matchedQueryIds:u,references:a,ngContentIndex:n,childCount:r,bindings:[],bindingFlags:0,outputs:[],element:{ns:null,name:null,attrs:null,template:o?di(o):null,componentProvider:null,componentView:null,componentRendererType:null,publicProviders:null,allProviders:null,handleEvent:i||Br},provider:null,text:null,query:null,ngContent:null}}function $s(e,t,n,r,i,o,s=[],a,u,l,c,h){l||(l=Br);const{matchedQueries:d,references:f,matchedQueryIds:p}=ui(n);let m=null,g=null;o&&([m,g]=vi(o)),a=a||[];const y=new Array(a.length);for(let w=0;w<a.length;w++){const[e,t,n]=a[w],[r,i]=vi(t);let o=void 0,s=void 0;switch(15&e){case 4:s=n;break;case 1:case 8:o=n}y[w]={flags:e,ns:r,name:i,nonMinifiedName:i,securityContext:o,suffix:s}}u=u||[];const b=new Array(u.length);for(let w=0;w<u.length;w++){const[e,t]=u[w];b[w]={type:0,target:e,eventName:t,propName:null}}const v=(s=s||[]).map(([e,t])=>{const[n,r]=vi(e);return[n,r,t]});return h=function(e){if(e&&e.id===Qr){const t=null!=e.encapsulation&&e.encapsulation!==Y.None||e.styles.length||Object.keys(e.data).length;e.id=t?`c${$r++}`:Gr}return e&&e.id===Gr&&(e=null),e||null}(h),c&&(t|=33554432),{nodeIndex:-1,parent:null,renderParent:null,bindingIndex:-1,outputIndex:-1,checkIndex:e,flags:t|=1,childFlags:0,directChildFlags:0,childMatchedQueries:0,matchedQueries:d,matchedQueryIds:p,references:f,ngContentIndex:r,childCount:i,bindings:y,bindingFlags:wi(y),outputs:b,element:{ns:m,name:g,attrs:v,template:null,componentProvider:null,componentView:c||null,componentRendererType:h,publicProviders:null,allProviders:null,handleEvent:l||Br},provider:null,text:null,query:null,ngContent:null}}function Ys(e,t,n){const r=n.element,i=e.root.selectorOrNode,o=e.renderer;let s;if(e.parent||!i){s=r.name?o.createElement(r.name,r.ns):o.createComment("");const i=ci(e,t,n);i&&o.appendChild(i,s)}else s=o.selectRootElement(i,!!r.componentRendererType&&r.componentRendererType.encapsulation===Y.ShadowDom);if(r.attrs)for(let a=0;a<r.attrs.length;a++){const[e,t,n]=r.attrs[a];o.setAttribute(s,t,n,e)}return s}function Zs(e,t,n,r){for(let s=0;s<n.outputs.length;s++){const a=n.outputs[s],u=Js(e,n.nodeIndex,(o=a.eventName,(i=a.target)?`${i}:${o}`:o));let l=a.target,c=e;"component"===a.target&&(l=null,c=t);const h=c.renderer.listen(l||r,a.eventName,u);e.disposables[n.outputIndex+s]=h}var i,o}function Js(e,t,n){return r=>ti(e,t,n,r)}function Xs(e,t,n,r){if(!Zr(e,t,n,r))return!1;const i=t.bindings[n],o=Fr(e,t.nodeIndex),s=o.renderElement,a=i.name;switch(15&i.flags){case 1:!function(e,t,n,r,i,o){const s=t.securityContext;let a=s?e.root.sanitizer.sanitize(s,o):o;a=null!=a?a.toString():null;const u=e.renderer;null!=o?u.setAttribute(n,i,a,r):u.removeAttribute(n,i,r)}(e,i,s,i.ns,a,r);break;case 2:!function(e,t,n,r){const i=e.renderer;r?i.addClass(t,n):i.removeClass(t,n)}(e,s,a,r);break;case 4:!function(e,t,n,r,i){let o=e.root.sanitizer.sanitize(jt.STYLE,i);if(null!=o){o=o.toString();const e=t.suffix;null!=e&&(o+=e)}else o=null;const s=e.renderer;null!=o?s.setStyle(n,r,o):s.removeStyle(n,r)}(e,i,s,a,r);break;case 8:!function(e,t,n,r,i){const o=t.securityContext;let s=o?e.root.sanitizer.sanitize(o,i):i;e.renderer.setProperty(n,r,s)}(33554432&t.flags&&32&i.flags?o.componentView:e,i,s,a,r)}return!0}function ea(e,t,n){let r=[];for(let i in n)r.push({propName:i,bindingType:n[i]});return{nodeIndex:-1,parent:null,renderParent:null,bindingIndex:-1,outputIndex:-1,checkIndex:-1,flags:e,childFlags:0,directChildFlags:0,childMatchedQueries:0,ngContentIndex:-1,matchedQueries:{},matchedQueryIds:0,references:{},childCount:0,bindings:[],bindingFlags:0,outputs:[],element:null,provider:null,text:null,query:{id:t,filterId:ai(t),bindings:r},ngContent:null}}function ta(e){const t=e.def.nodeMatchedQueries;for(;e.parent&&si(e);){let n=e.parentNodeDef;e=e.parent;const r=n.nodeIndex+n.childCount;for(let i=0;i<=r;i++){const r=e.def.nodes[i];67108864&r.flags&&536870912&r.flags&&(r.query.filterId&t)===r.query.filterId&&Ur(e,i).setDirty(),!(1&r.flags&&i+r.childCount<n.nodeIndex)&&67108864&r.childFlags&&536870912&r.childFlags||(i+=r.childCount)}}if(134217728&e.def.nodeFlags)for(let n=0;n<e.def.nodes.length;n++){const t=e.def.nodes[n];134217728&t.flags&&536870912&t.flags&&Ur(e,n).setDirty(),n+=t.childCount}}function na(e,t){const n=Ur(e,t.nodeIndex);if(!n.dirty)return;let r,i=void 0;if(67108864&t.flags){const n=t.parent.parent;i=ra(e,n.nodeIndex,n.nodeIndex+n.childCount,t.query,[]),r=jr(e,t.parent.nodeIndex).instance}else 134217728&t.flags&&(i=ra(e,0,e.def.nodes.length-1,t.query,[]),r=e.component);n.reset(i);const o=t.query.bindings;let s=!1;for(let a=0;a<o.length;a++){const e=o[a];let t;switch(e.bindingType){case 0:t=n.first;break;case 1:t=n,s=!0}r[e.propName]=t}s&&n.notifyOnChanges()}function ra(e,t,n,r,i){for(let o=t;o<=n;o++){const t=e.def.nodes[o],n=t.matchedQueries[r.id];if(null!=n&&i.push(ia(e,t,n)),1&t.flags&&t.element.template&&(t.element.template.nodeMatchedQueries&r.filterId)===r.filterId){const n=Fr(e,o);if((t.childMatchedQueries&r.filterId)===r.filterId&&(ra(e,o+1,o+t.childCount,r,i),o+=t.childCount),16777216&t.flags){const e=n.viewContainer._embeddedViews;for(let t=0;t<e.length;t++){const o=e[t],s=ni(o);s&&s===n&&ra(o,0,o.def.nodes.length-1,r,i)}}const s=n.template._projectedViews;if(s)for(let e=0;e<s.length;e++){const t=s[e];ra(t,0,t.def.nodes.length-1,r,i)}}(t.childMatchedQueries&r.filterId)!==r.filterId&&(o+=t.childCount)}return i}function ia(e,t,n){if(null!=n)switch(n){case 1:return Fr(e,t.nodeIndex).renderElement;case 0:return new rr(Fr(e,t.nodeIndex).renderElement);case 2:return Fr(e,t.nodeIndex).template;
1case 3:return Fr(e,t.nodeIndex).viewContainer;case 4:return jr(e,t.nodeIndex).instance}}function oa(e,t){return{nodeIndex:-1,parent:null,renderParent:null,bindingIndex:-1,outputIndex:-1,checkIndex:-1,flags:8,childFlags:0,directChildFlags:0,childMatchedQueries:0,matchedQueries:{},matchedQueryIds:0,references:{},ngContentIndex:e,childCount:0,bindings:[],bindingFlags:0,outputs:[],element:null,provider:null,text:null,query:null,ngContent:{index:t}}}function sa(e,t,n){const r=ci(e,t,n);r&&mi(e,n.ngContent.index,1,r,null,void 0)}function aa(e,t){return ca(128,e,new Array(t+1))}function ua(e,t){return ca(32,e,new Array(t))}function la(e,t){const n=Object.keys(t),r=n.length,i=new Array(r);for(let o=0;o<r;o++){const e=n[o];i[t[e]]=e}return ca(64,e,i)}function ca(e,t,n){const r=new Array(n.length);for(let i=0;i<n.length;i++){const e=n[i];r[i]={flags:8,name:e,ns:null,nonMinifiedName:e,securityContext:null,suffix:null}}return{nodeIndex:-1,parent:null,renderParent:null,bindingIndex:-1,outputIndex:-1,checkIndex:t,flags:e,childFlags:0,directChildFlags:0,childMatchedQueries:0,matchedQueries:{},matchedQueryIds:0,references:{},ngContentIndex:-1,childCount:0,bindings:r,bindingFlags:wi(r),outputs:[],element:null,provider:null,text:null,query:null,ngContent:null}}function ha(e,t,n){const r=new Array(n.length-1);for(let 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:e,flags:2,childFlags:0,directChildFlags:0,childMatchedQueries:0,matchedQueries:{},matchedQueryIds:0,references:{},ngContentIndex:t,childCount:0,bindings:r,bindingFlags:8,outputs:[],element:null,provider:null,text:{prefix:n[0]},query:null,ngContent:null}}function da(e,t,n){let r;const i=e.renderer;r=i.createText(n.text.prefix);const o=ci(e,t,n);return o&&i.appendChild(o,r),{renderText:r}}function fa(e,t){return(null!=e?e.toString():"")+t.suffix}function pa(e,t,n,r){let i=0,o=0,s=0,a=0,u=0,l=null,c=null,h=!1,d=!1,f=null;for(let p=0;p<t.length;p++){const e=t[p];if(e.nodeIndex=p,e.parent=l,e.bindingIndex=i,e.outputIndex=o,e.renderParent=c,s|=e.flags,u|=e.matchedQueryIds,e.element){const t=e.element;t.publicProviders=l?l.element.publicProviders:Object.create(null),t.allProviders=t.publicProviders,h=!1,d=!1,e.element.template&&(u|=e.element.template.nodeMatchedQueries)}if(ga(l,e,t.length),i+=e.bindings.length,o+=e.outputs.length,!c&&3&e.flags&&(f=e),20224&e.flags){h||(h=!0,l.element.publicProviders=Object.create(l.element.publicProviders),l.element.allProviders=l.element.publicProviders);const t=0!=(32768&e.flags);0==(8192&e.flags)||t?l.element.publicProviders[zr(e.provider.token)]=e:(d||(d=!0,l.element.allProviders=Object.create(l.element.publicProviders)),l.element.allProviders[zr(e.provider.token)]=e),t&&(l.element.componentProvider=e)}if(l?(l.childFlags|=e.flags,l.directChildFlags|=e.flags,l.childMatchedQueries|=e.matchedQueryIds,e.element&&e.element.template&&(l.childMatchedQueries|=e.element.template.nodeMatchedQueries)):a|=e.flags,e.childCount>0)l=e,ma(e)||(c=e);else for(;l&&p===l.nodeIndex+l.childCount;){const e=l.parent;e&&(e.childFlags|=l.childFlags,e.childMatchedQueries|=l.childMatchedQueries),c=(l=e)&&ma(l)?l.renderParent:l}}return{factory:null,nodeFlags:s,rootNodeFlags:a,nodeMatchedQueries:u,flags:e,nodes:t,updateDirectives:n||Br,updateRenderer:r||Br,handleEvent:(e,n,r,i)=>t[n].element.handleEvent(e,r,i),bindingCount:i,outputCount:o,lastRenderRootNode:f}}function ma(e){return 0!=(1&e.flags)&&null===e.element.name}function ga(e,t,n){const r=t.element&&t.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 ${t.nodeIndex}!`)}if(20224&t.flags&&0==(1&(e?e.flags:0)))throw new Error(`Illegal State: StaticProvider/Directive nodes need to be children of elements or anchors, at index ${t.nodeIndex}!`);if(t.query){if(67108864&t.flags&&(!e||0==(16384&e.flags)))throw new Error(`Illegal State: Content Query nodes need to be children of directives, at index ${t.nodeIndex}!`);if(134217728&t.flags&&e)throw new Error(`Illegal State: View Query nodes have to be top level nodes, at index ${t.nodeIndex}!`)}if(t.childCount){const r=e?e.nodeIndex+e.childCount:n-1;
vendor: 19,181 bytes, line 1
1if(t.nodeIndex<=r&&t.nodeIndex+t.childCount>r)throw new Error(`Illegal State: childCount of node leads outside of parent, at index ${t.nodeIndex}!`)}}function ya(e,t,n,r){const i=wa(e.root,e.renderer,e,t,n);return _a(i,e.component,r),Sa(i),i}function ba(e,t,n){const r=wa(e,e.renderer,null,null,t);return _a(r,n,n),Sa(r),r}function va(e,t,n,r){const i=t.element.componentRendererType;let o;return o=i?e.root.rendererFactory.createRenderer(r,i):e.root.renderer,wa(e.root,o,e,t.element.componentProvider,n)}function wa(e,t,n,r,i){const o=new Array(i.nodes.length),s=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:e,renderer:t,oldValues:new Array(i.bindingCount),disposables:s,initIndex:-1}}function _a(e,t,n){e.component=t,e.context=n}function Sa(e){let t;oi(e)&&(t=Fr(e.parent,e.parentNodeDef.parent.nodeIndex).renderElement);const n=e.def,r=e.nodes;for(let i=0;i<n.nodes.length;i++){const o=n.nodes[i];let s;switch(qr.setCurrentNode(e,i),201347067&o.flags){case 1:const n=Ys(e,t,o);let a=void 0;if(33554432&o.flags){const t=di(o.element.componentView);a=qr.createComponentView(e,o,t,n)}Zs(e,a,o,n),s={renderElement:n,componentView:a,viewContainer:null,template:o.element.template?Bi(e,o):void 0},16777216&o.flags&&(s.viewContainer=ji(e,o,s));break;case 2:s=da(e,t,o);break;case 512:case 1024:case 2048:case 256:(s=r[i])||4096&o.flags||(s={instance:lo(e,o)});break;case 16:s={instance:co(e,o)};break;case 16384:(s=r[i])||(s={instance:ho(e,o)}),32768&o.flags&&_a(Fr(e,o.parent.nodeIndex).componentView,s.instance,s.instance);break;case 32:case 64:case 128:s={value:void 0};break;case 67108864:case 134217728:s=new Po;break;case 8:sa(e,t,o),s=void 0}r[i]=s}Oa(e,Aa.CreateViewNodes),Pa(e,201326592,268435456,0)}function Ea(e){Ia(e),qr.updateDirectives(e,1),Na(e,Aa.CheckNoChanges),qr.updateRenderer(e,1),Oa(e,Aa.CheckNoChanges),e.state&=-97}function Ca(e){1&e.state?(e.state&=-2,e.state|=2):e.state&=-3,Mr(e,0,256),Ia(e),qr.updateDirectives(e,0),Na(e,Aa.CheckAndUpdate),Pa(e,67108864,536870912,0);let t=Mr(e,256,512);wo(e,2097152|(t?1048576:0)),qr.updateRenderer(e,0),Oa(e,Aa.CheckAndUpdate),Pa(e,134217728,536870912,0),wo(e,8388608|((t=Mr(e,512,768))?4194304:0)),2&e.def.flags&&(e.state&=-9),e.state&=-97,Mr(e,768,1024)}function Ta(e,t,n,r,i,o,s,a,u,l,c,h,d){return 0===n?function(e,t,n,r,i,o,s,a,u,l,c,h){switch(201347067&t.flags){case 1:return function(e,t,n,r,i,o,s,a,u,l,c,h){const d=t.bindings.length;let f=!1;return d>0&&Xs(e,t,0,n)&&(f=!0),d>1&&Xs(e,t,1,r)&&(f=!0),d>2&&Xs(e,t,2,i)&&(f=!0),d>3&&Xs(e,t,3,o)&&(f=!0),d>4&&Xs(e,t,4,s)&&(f=!0),d>5&&Xs(e,t,5,a)&&(f=!0),d>6&&Xs(e,t,6,u)&&(f=!0),d>7&&Xs(e,t,7,l)&&(f=!0),d>8&&Xs(e,t,8,c)&&(f=!0),d>9&&Xs(e,t,9,h)&&(f=!0),f}(e,t,n,r,i,o,s,a,u,l,c,h);case 2:return function(e,t,n,r,i,o,s,a,u,l,c,h){let d=!1;const f=t.bindings,p=f.length;if(p>0&&Zr(e,t,0,n)&&(d=!0),p>1&&Zr(e,t,1,r)&&(d=!0),p>2&&Zr(e,t,2,i)&&(d=!0),p>3&&Zr(e,t,3,o)&&(d=!0),p>4&&Zr(e,t,4,s)&&(d=!0),p>5&&Zr(e,t,5,a)&&(d=!0),p>6&&Zr(e,t,6,u)&&(d=!0),p>7&&Zr(e,t,7,l)&&(d=!0),p>8&&Zr(e,t,8,c)&&(d=!0),p>9&&Zr(e,t,9,h)&&(d=!0),d){let d=t.text.prefix;p>0&&(d+=fa(n,f[0])),p>1&&(d+=fa(r,f[1])),p>2&&(d+=fa(i,f[2])),p>3&&(d+=fa(o,f[3])),p>4&&(d+=fa(s,f[4])),p>5&&(d+=fa(a,f[5])),p>6&&(d+=fa(u,f[6])),p>7&&(d+=fa(l,f[7])),p>8&&(d+=fa(c,f[8])),p>9&&(d+=fa(h,f[9]));const m=Lr(e,t.nodeIndex).renderText;e.renderer.setValue(m,d)}return d}(e,t,n,r,i,o,s,a,u,l,c,h);case 16384:return function(e,t,n,r,i,o,s,a,u,l,c,h){const d=jr(e,t.nodeIndex),f=d.instance;let p=!1,m=void 0;const g=t.bindings.length;return g>0&&Yr(e,t,0,n)&&(p=!0,m=vo(e,d,t,0,n,m)),g>1&&Yr(e,t,1,r)&&(p=!0,m=vo(e,d,t,1,r,m)),g>2&&Yr(e,t,2,i)&&(p=!0,m=vo(e,d,t,2,i,m)),g>3&&Yr(e,t,3,o)&&(p=!0,m=vo(e,d,t,3,o,m)),g>4&&Yr(e,t,4,s)&&(p=!0,m=vo(e,d,t,4,s,m)),g>5&&Yr(e,t,5,a)&&(p=!0,m=vo(e,d,t,5,a,m)),g>6&&Yr(e,t,6,u)&&(p=!0,m=vo(e,d,t,6,u,m)),g>7&&Yr(e,t,7,l)&&(p=!0,m=vo(e,d,t,7,l,m)),g>8&&Yr(e,t,8,c)&&(p=!0,m=vo(e,d,t,8,c,m)),g>9&&Yr(e,t,9,h)&&(p=!0,m=vo(e,d,t,9,h,m)),m&&f.ngOnChanges(m),65536&t.flags&&Pr(e,256,t.nodeIndex)&&f.ngOnInit(),262144&t.flags&&f.ngDoCheck(),p}(e,t,n,r,i,o,s,a,u,l,c,h);case 32:case 64:case 128:return function(e,t,n,r,i,o,s,a,u,l,c,h){const d=t.bindings;let f=!1;const p=d.length;if(p>0&&Zr(e,t,0,n)&&(f=!0),p>1&&Zr(e,t,1,r)&&(f=!0),p>2&&Zr(e,t,2,i)&&(f=!0),p>3&&Zr(e,t,3,o)&&(f=!0),p>4&&Zr(e,t,4,s)&&(f=!0),p>5&&Zr(e,t,5,a)&&(f=!0),p>6&&Zr(e,t,6,u)&&(f=!0),p>7&&Zr(e,t,7,l)&&(f=!0),p>8&&Zr(e,t,8,c)&&(f=!0),p>9&&Zr(e,t,9,h)&&(f=!0),f){const f=Vr(e,t.nodeIndex);let m;switch(201347067&t.flags){case 32:m=new Array(d.length),p>0&&(m[0]=n),p>1&&(m[1]=r),p>2&&(m[2]=i),p>3&&(m[3]=o),p>4&&(m[4]=s),p>5&&(m[5]=a),p>6&&(m[6]=u),p>7&&(m[7]=l),p>8&&(m[8]=c),p>9&&(m[9]=h);break;case 64:m={},p>0&&(m[d[0].name]=n),p>1&&(m[d[1].name]=r),p>2&&(m[d[2].name]=i),p>3&&(m[d[3].name]=o),p>4&&(m[d[4].name]=s),p>5&&(m[d[5].name]=a),p>6&&(m[d[6].name]=u),p>7&&(m[d[7].name]=l),p>8&&(m[d[8].name]=c),p>9&&(m[d[9].name]=h);break;case 128:const e=n;switch(p){case 1:m=e.transform(n);break;case 2:m=e.transform(r);break;case 3:m=e.transform(r,i);break;case 4:m=e.transform(r,i,o);break;case 5:m=e.transform(r,i,o,s);break;case 6:m=e.transform(r,i,o,s,a);break;case 7:m=e.transform(r,i,o,s,a,u);break;case 8:m=e.transform(r,i,o,s,a,u,l);break;case 9:m=e.transform(r,i,o,s,a,u,l,c);break;case 10:m=e.transform(r,i,o,s,a,u,l,c,h)}}f.value=m}return f}(e,t,n,r,i,o,s,a,u,l,c,h);default:throw"unreachable"}}(e,t,r,i,o,s,a,u,l,c,h,d):function(e,t,n){switch(201347067&t.flags){case 1:return function(e,t,n){let r=!1;for(let i=0;i<n.length;i++)Xs(e,t,i,n[i])&&(r=!0);return r}(e,t,n);case 2:return function(e,t,n){const r=t.bindings;let i=!1;for(let o=0;o<n.length;o++)Zr(e,t,o,n[o])&&(i=!0);if(i){let i="";for(let e=0;e<n.length;e++)i+=fa(n[e],r[e]);i=t.text.prefix+i;const o=Lr(e,t.nodeIndex).renderText;e.renderer.setValue(o,i)}return i}(e,t,n);case 16384:return function(e,t,n){const r=jr(e,t.nodeIndex),i=r.instance;let o=!1,s=void 0;for(let a=0;a<n.length;a++)Yr(e,t,a,n[a])&&(o=!0,s=vo(e,r,t,a,n[a],s));return s&&i.ngOnChanges(s),65536&t.flags&&Pr(e,256,t.nodeIndex)&&i.ngOnInit(),262144&t.flags&&i.ngDoCheck(),o}(e,t,n);case 32:case 64:case 128:return function(e,t,n){const r=t.bindings;let i=!1;for(let o=0;o<n.length;o++)Zr(e,t,o,n[o])&&(i=!0);if(i){const i=Vr(e,t.nodeIndex);let o;switch(201347067&t.flags){case 32:o=n;break;case 64:o={};for(let t=0;t<n.length;t++)o[r[t].name]=n[t];break;case 128:const e=n[0],i=n.slice(1);o=e.transform(...i)}i.value=o}return i}(e,t,n);default:throw"unreachable"}}(e,t,r)}function Ia(e){const t=e.def;if(4&t.nodeFlags)for(let n=0;n<t.nodes.length;n++){const r=t.nodes[n];if(4&r.flags){const t=Fr(e,n).template._projectedViews;if(t)for(let n=0;n<t.length;n++){const r=t[n];r.state|=32,ei(r,e)}}else 0==(4&r.childFlags)&&(n+=r.childCount)}}function Da(e,t,n,r,i,o,s,a,u,l,c,h,d){return 0===n?function(e,t,n,r,i,o,s,a,u,l,c,h){const d=t.bindings.length;d>0&&Jr(e,t,0,n),d>1&&Jr(e,t,1,r),d>2&&Jr(e,t,2,i),d>3&&Jr(e,t,3,o),d>4&&Jr(e,t,4,s),d>5&&Jr(e,t,5,a),d>6&&Jr(e,t,6,u),d>7&&Jr(e,t,7,l),d>8&&Jr(e,t,8,c),d>9&&Jr(e,t,9,h)}(e,t,r,i,o,s,a,u,l,c,h,d):function(e,t,n){for(let r=0;r<n.length;r++)Jr(e,t,r,n[r])}(e,t,r),!1}function xa(e,t){if(Ur(e,t.nodeIndex).dirty)throw Or(qr.createDebugContext(e,t.nodeIndex),`Query ${t.query.id} not dirty`,`Query ${t.query.id} dirty`,0!=(1&e.state))}function ka(e){if(!(128&e.state)){if(Na(e,Aa.Destroy),Oa(e,Aa.Destroy),wo(e,131072),e.disposables)for(let t=0;t<e.disposables.length;t++)e.disposables[t]();!function(e){if(!(16&e.state))return;const t=ni(e);if(t){const n=t.template._projectedViews;n&&(K(n,n.indexOf(e)),qr.dirtyParentQueries(e))}}(e),e.renderer.destroyNode&&function(e){const t=e.def.nodes.length;for(let n=0;n<t;n++){const t=e.def.nodes[n];1&t.flags?e.renderer.destroyNode(Fr(e,n).renderElement):2&t.flags?e.renderer.destroyNode(Lr(e,n).renderText):(67108864&t.flags||134217728&t.flags)&&Ur(e,n).destroy()}}(e),oi(e)&&e.renderer.destroy(),e.state|=128}}const Aa=function(){var e={CreateViewNodes:0,CheckNoChanges:1,CheckNoChangesProjectedViews:2,CheckAndUpdate:3,CheckAndUpdateProjectedViews:4,Destroy:5};return e[e.CreateViewNodes]="CreateViewNodes",e[e.CheckNoChanges]="CheckNoChanges",e[e.CheckNoChangesProjectedViews]="CheckNoChangesProjectedViews",e[e.CheckAndUpdate]="CheckAndUpdate",e[e.CheckAndUpdateProjectedViews]="CheckAndUpdateProjectedViews",e[e.Destroy]="Destroy",e}();function Oa(e,t){const n=e.def;if(33554432&n.nodeFlags)for(let r=0;r<n.nodes.length;r++){const i=n.nodes[r];33554432&i.flags?Ra(Fr(e,r).componentView,t):0==(33554432&i.childFlags)&&(r+=i.childCount)}}function Na(e,t){const n=e.def;if(16777216&n.nodeFlags)for(let r=0;r<n.nodes.length;r++){const i=n.nodes[r];if(16777216&i.flags){const n=Fr(e,r).viewContainer._embeddedViews;for(let e=0;e<n.length;e++)Ra(n[e],t)}else 0==(16777216&i.childFlags)&&(r+=i.childCount)}}function Ra(e,t){const n=e.state;switch(t){case Aa.CheckNoChanges:0==(128&n)&&(12==(12&n)?Ea(e):64&n&&Ma(e,Aa.CheckNoChangesProjectedViews));break;case Aa.CheckNoChangesProjectedViews:0==(128&n)&&(32&n?Ea(e):64&n&&Ma(e,t));break;case Aa.CheckAndUpdate:0==(128&n)&&(12==(12&n)?Ca(e):64&n&&Ma(e,Aa.CheckAndUpdateProjectedViews));break;case Aa.CheckAndUpdateProjectedViews:0==(128&n)&&(32&n?Ca(e):64&n&&Ma(e,t));break;case Aa.Destroy:ka(e);break;case Aa.CreateViewNodes:Sa(e)}}function Ma(e,t){Na(e,t),Oa(e,t)}function Pa(e,t,n,r){if(!(e.def.nodeFlags&t&&e.def.nodeFlags&n))return;const i=e.def.nodes.length;for(let o=0;o<i;o++){const i=e.def.nodes[o];if(i.flags&t&&i.flags&n)switch(qr.setCurrentNode(e,i.nodeIndex),r){case 0:na(e,i);break;case 1:xa(e,i)}i.childFlags&t&&i.childFlags&n||(o+=i.childCount)}}let La=!1;function Fa(e,t,n,r,i,o){const s=i.injector.get(sr);return ba(Va(e,i,s,t,n),r,o)}function ja(e,t,n,r,i,o){const s=i.injector.get(sr),a=Va(e,i,new yu(s),t,n),u=$a(r);return mu(tu.create,ba,null,[a,u,o])}function Va(e,t,n,r,i){const o=t.injector.get(Vt),s=t.injector.get(ht),a=n.createRenderer(null,null);return{ngModule:t,injector:e,projectableNodes:r,selectorOrNode:i,sanitizer:o,rendererFactory:n,renderer:a,errorHandler:s}}function Ua(e,t,n,r){const i=$a(n);return mu(tu.create,ya,null,[e,t,i,r])}function qa(e,t,n,r){return n=Wa.get(t.element.componentProvider.provider.token)||$a(n),mu(tu.create,va,null,[e,t,n,r])}function Ba(e,t,n,r){return $i(e,t,n,function(e){const{hasOverrides:t,hasDeprecatedOverrides:n}=function(e){let t=!1,n=!1;return 0===Ha.size?{hasOverrides:t,hasDeprecatedOverrides:n}:(e.providers.forEach(e=>{const r=Ha.get(e.token);3840&e.flags&&r&&(t=!0,n=n||r.deprecatedBehavior)}),e.modules.forEach(e=>{za.forEach((r,i)=>{b(i).providedIn===e&&(t=!0,n=n||r.deprecatedBehavior)})}),{hasOverrides:t,hasDeprecatedOverrides:n})}(e);return t?(function(e){for(let t=0;t<e.providers.length;t++){const r=e.providers[t];n&&(r.flags|=4096);const i=Ha.get(r.token);i&&(r.flags=-3841&r.flags|i.flags,r.deps=li(i.deps),r.value=i.value)}if(za.size>0){let t=new Set(e.modules);za.forEach((r,i)=>{if(t.has(b(i).providedIn)){let t={token:i,flags:r.flags|(n?4096:0),deps:li(r.deps),value:r.value,index:e.providers.length};e.providers.push(t),e.providersByKey[zr(i)]=t}})}}(e=e.factory(()=>Br)),e):e}(r))}const Ha=new Map,za=new Map,Wa=new Map;function Qa(e){let t;Ha.set(e.token,e),"function"==typeof e.token&&(t=b(e.token))&&"function"==typeof t.providedIn&&za.set(e.token,e)}function Ga(e,t){const n=di(t.viewDefFactory),r=di(n.nodes[0].element.componentView);Wa.set(e,r)}function Ka(){Ha.clear(),za.clear(),Wa.clear()}function $a(e){if(0===Ha.size)return e;const t=function(e){const t=[];let n=null;for(let r=0;r<e.nodes.length;r++){const i=e.nodes[r];1&i.flags&&(n=i),n&&3840&i.flags&&Ha.has(i.provider.token)&&(t.push(n.nodeIndex),n=null)}return t}(e);if(0===t.length)return e;e=e.factory(()=>Br);for(let r=0;r<t.length;r++)n(e,t[r]);return e;function n(e,t){for(let n=t+1;n<e.nodes.length;n++){const t=e.nodes[n];if(1&t.flags)return;if(3840&t.flags){const e=t.provider,n=Ha.get(e.token);n&&(t.flags=-3841&t.flags|n.flags,e.deps=li(n.deps),e.value=n.value)}}}}function Ya(e,t,n,r,i,o,s,a,u,l,c,h,d){const f=e.def.nodes[t];return Ta(e,f,n,r,i,o,s,a,u,l,c,h,d),224&f.flags?Vr(e,t).value:void 0}function Za(e,t,n,r,i,o,s,a,u,l,c,h,d){const f=e.def.nodes[t];return Da(e,f,n,r,i,o,s,a,u,l,c,h,d),224&f.flags?Vr(e,t).value:void 0}function Ja(e){return mu(tu.detectChanges,Ca,null,[e])}function Xa(e){return mu(tu.checkNoChanges,Ea,null,[e])}function eu(e){return mu(tu.destroy,ka,null,[e])}const tu=function(){var e={create:0,detectChanges:1,checkNoChanges:2,destroy:3,handleEvent:4};return e[e.create]="create",e[e.detectChanges]="detectChanges",e[e.checkNoChanges]="checkNoChanges",e[e.destroy]="destroy",e[e.handleEvent]="handleEvent",e}();let nu,ru,iu;function ou(e,t){ru=e,iu=t}function su(e,t,n,r){return ou(e,t),mu(tu.handleEvent,e.def.handleEvent,null,[e,t,n,r])}function au(e,t){if(128&e.state)throw Rr(tu[nu]);return ou(e,hu(e,0)),e.def.updateDirectives(function(e,n,r,...i){const o=e.def.nodes[n];return 0===t?lu(e,o,r,i):cu(e,o,r,i),16384&o.flags&&ou(e,hu(e,n)),224&o.flags?Vr(e,o.nodeIndex).value:void 0},e)}function uu(e,t){if(128&e.state)throw Rr(tu[nu]);return ou(e,du(e,0)),e.def.updateRenderer(function(e,n,r,...i){const o=e.def.nodes[n];return 0===t?lu(e,o,r,i):cu(e,o,r,i),3&o.flags&&ou(e,du(e,n)),224&o.flags?Vr(e,o.nodeIndex).value:void 0},e)}function lu(e,t,n,r){if(Ta(e,t,n,...r)){const s=1===n?r[0]:r;if(16384&t.flags){const n={};for(let e=0;e<t.bindings.length;e++){const r=t.bindings[e],a=s[e];8&r.flags&&(n[(i=r.nonMinifiedName,o=void 0,o=i.replace(/[$@]/g,"_"),`ng-reflect-${i=o.replace(Ht,(...e)=>"-"+e[1].toLowerCase())}`)]=zt(a))}const r=t.parent,a=Fr(e,r.nodeIndex).renderElement;if(r.element.name)for(let t in n){const r=n[t];null!=r?e.renderer.setAttribute(a,t,r):e.renderer.removeAttribute(a,t)}else e.renderer.setValue(a,`bindings=${JSON.stringify(n,null,2)}`)}}var i,o}function cu(e,t,n,r){Da(e,t,n,...r)}function hu(e,t){for(let n=t;n<e.def.nodes.length;n++){const t=e.def.nodes[n];if(16384&t.flags&&t.bindings&&t.bindings.length)return n}return null}function du(e,t){for(let n=t;n<e.def.nodes.length;n++){const t=e.def.nodes[n];if(3&t.flags&&t.bindings&&t.bindings.length)return n}return null}class fu{constructor(e,t){this.view=e,this.nodeIndex=t,null==t&&(this.nodeIndex=t=0),this.nodeDef=e.def.nodes[t];let n=this.nodeDef,r=e;for(;n&&0==(1&n.flags);)n=n.parent;if(!n)for(;!n&&r;)n=ri(r),r=r.parent;this.elDef=n,this.elView=r}get elOrCompView(){return Fr(this.elView,this.elDef.nodeIndex).componentView||this.view}get injector(){return zi(this.elView,this.elDef)}get component(){return this.elOrCompView.component}get context(){return this.elOrCompView.context}get providerTokens(){const e=[];if(this.elDef)for(let t=this.elDef.nodeIndex+1;t<=this.elDef.nodeIndex+this.elDef.childCount;t++){const n=this.elView.def.nodes[t];20224&n.flags&&e.push(n.provider.token),t+=n.childCount}return e}get references(){const e={};if(this.elDef){pu(this.elView,this.elDef,e);for(let t=this.elDef.nodeIndex+1;t<=this.elDef.nodeIndex+this.elDef.childCount;t++){const n=this.elView.def.nodes[t];20224&n.flags&&pu(this.elView,n,e),t+=n.childCount}}return e}get componentRenderElement(){const e=function(e){for(;e&&!oi(e);)e=e.parent;return e.parent?Fr(e.parent,ri(e).nodeIndex):null}(this.elOrCompView);return e?e.renderElement:void 0}get renderNode(){return 2&this.nodeDef.flags?ii(this.view,this.nodeDef):ii(this.elView,this.elDef)}logError(e,...t){let n,r;2&this.nodeDef.flags?(n=this.view.def,r=this.nodeDef.nodeIndex):(n=this.elView.def,r=this.elDef.nodeIndex);const i=function(e,t){let n=-1;for(let r=0;r<=t;r++)3&e.nodes[r].flags&&n++;return n}(n,r);let o=-1;n.factory(()=>++o===i?e.error.bind(e,...t):Br),o<i&&(e.error("Illegal state: the ViewDefinitionFactory did not call the logger!"),e.error(...t))}}function pu(e,t,n){for(let r in t.references)n[r]=ia(e,t,t.references[r])}function mu(e,t,n,r){const i=nu,o=ru,s=iu;try{nu=e;const u=t.apply(n,r);return ru=o,iu=s,nu=i,u}catch(a){if(ut(a)||!ru)throw a;throw function(e,t){return e instanceof Error||(e=new Error(e.toString())),Nr(e,t),e}(a,gu())}}function gu(){return ru?new fu(ru,iu):null}class yu{constructor(e){this.delegate=e}createRenderer(e,t){return new bu(this.delegate.createRenderer(e,t))}begin(){this.delegate.begin&&this.delegate.begin()}end(){this.delegate.end&&this.delegate.end()}whenRenderingDone(){return this.delegate.whenRenderingDone?this.delegate.whenRenderingDone():Promise.resolve(null)}}class bu{constructor(e){this.delegate=e,this.debugContextFactory=gu,this.data=this.delegate.data}createDebugContext(e){return this.debugContextFactory(e)}destroyNode(e){const t=Us(e);Vs.delete(t.nativeNode),t instanceof Fs&&(t.listeners.length=0),this.delegate.destroyNode&&this.delegate.destroyNode(e)}destroy(){this.delegate.destroy()}createElement(e,t){const n=this.delegate.createElement(e,t),r=this.createDebugContext(n);if(r){const t=new js(n,null,r);t.name=e,qs(t)}return n}createComment(e){const t=this.delegate.createComment(e),n=this.createDebugContext(t);return n&&qs(new Fs(t,null,n)),t}createText(e){const t=this.delegate.createText(e),n=this.createDebugContext(t);return n&&qs(new Fs(t,null,n)),t}appendChild(e,t){const n=Us(e),r=Us(t);n&&r&&n instanceof js&&n.addChild(r),this.delegate.appendChild(e,t)}insertBefore(e,t,n){const r=Us(e),i=Us(t),o=Us(n);r&&i&&r instanceof js&&r.insertBefore(o,i),this.delegate.insertBefore(e,t,n)}removeChild(e,t){const n=Us(e),r=Us(t);n&&r&&n instanceof js&&n.removeChild(r),this.delegate.removeChild(e,t)}selectRootElement(e,t){const n=this.delegate.selectRootElement(e,t),r=gu();return r&&qs(new js(n,null,r)),n}setAttribute(e,t,n,r){const i=Us(e);i&&i instanceof js&&(i.attributes[r?r+":"+t:t]=n),this.delegate.setAttribute(e,t,n,r)}removeAttribute(e,t,n){const r=Us(e);r&&r instanceof js&&(r.attributes[n?n+":"+t:t]=null),this.delegate.removeAttribute(e,t,n)}addClass(e,t){const n=Us(e);n&&n instanceof js&&(n.classes[t]=!0),this.delegate.addClass(e,t)}removeClass(e,t){const n=Us(e);n&&n instanceof js&&(n.classes[t]=!1),this.delegate.removeClass(e,t)}setStyle(e,t,n,r){const i=Us(e);i&&i instanceof js&&(i.styles[t]=n),this.delegate.setStyle(e,t,n,r)}removeStyle(e,t,n){const r=Us(e);r&&r instanceof js&&(r.styles[t]=null),this.delegate.removeStyle(e,t,n)}setProperty(e,t,n){const r=Us(e);r&&r instanceof js&&(r.properties[t]=n),this.delegate.setProperty(e,t,n)}listen(e,t,n){if("string"!=typeof e){const r=Us(e);r&&r.listeners.push(new Ls(t,n))}return this.delegate.listen(e,t,n)}parentNode(e){return this.delegate.parentNode(e)}nextSibling(e){return this.delegate.nextSibling(e)}setValue(e,t){return this.delegate.setValue(e,t)}}function vu(e,t,n){return new wu(e,t,n)}class wu extends Q{constructor(e,t,n){super(),this.moduleType=e,this._bootstrapComponents=t,this._ngModuleDefFactory=n}create(e){!function(){if(La)return;La=!0;const e=pt()?{setCurrentNode:ou,createRootView:ja,createEmbeddedView:Ua,createComponentView:qa,createNgModuleRef:Ba,overrideProvider:Qa,overrideComponentView:Ga,clearOverrides:Ka,checkAndUpdateView:Ja,checkNoChangesView:Xa,destroyView:eu,createDebugContext:(e,t)=>
1new fu(e,t),handleEvent:su,updateDirectives:au,updateRenderer:uu}:{setCurrentNode:()=>{},createRootView:Fa,createEmbeddedView:ya,createComponentView:va,createNgModuleRef:$i,overrideProvider:Br,overrideComponentView:Br,clearOverrides:Br,checkAndUpdateView:Ca,checkNoChangesView:Ea,destroyView:ka,createDebugContext:(e,t)=>new fu(e,t),handleEvent:(e,t,n,r)=>e.def.handleEvent(e,t,n,r),updateDirectives:(e,t)=>e.def.updateDirectives(0===t?Ya:Za,e),updateRenderer:(e,t)=>e.def.updateRenderer(0===t?Ya:Za,e)};qr.setCurrentNode=e.setCurrentNode,qr.createRootView=e.createRootView,qr.createEmbeddedView=e.createEmbeddedView,qr.createComponentView=e.createComponentView,qr.createNgModuleRef=e.createNgModuleRef,qr.overrideProvider=e.overrideProvider,qr.overrideComponentView=e.overrideComponentView,qr.clearOverrides=e.clearOverrides,qr.checkAndUpdateView=e.checkAndUpdateView,qr.checkNoChangesView=e.checkNoChangesView,qr.destroyView=e.destroyView,qr.resolveDep=yo,qr.createDebugContext=e.createDebugContext,qr.handleEvent=e.handleEvent,qr.updateDirectives=e.updateDirectives,qr.updateRenderer=e.updateRenderer,qr.dirtyParentQueries=ta}();const t=function(e){const t=Array.from(e.providers),n=Array.from(e.modules),r={};for(const i in e.providersByKey)r[i]=e.providersByKey[i];return{factory:e.factory,isRoot:e.isRoot,providers:t,modules:n,providersByKey:r}}(di(this._ngModuleDefFactory));return qr.createNgModuleRef(this.moduleType,e||gn.NULL,this._bootstrapComponents,t)}}},"9ppp":function(e,t,n){"use strict";n.d(t,"a",function(){return r});const r=(()=>{function e(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return e.prototype=Object.create(Error.prototype),e})()},Cfvw:function(e,t,n){"use strict";var r=n("HDdC"),i=n("SeVD"),o=n("quSY"),s=n("kJWO"),a=n("jZKg"),u=n("Lhse"),l=n("c2HN"),c=n("I55L");function h(e,t){return t?function(e,t){if(null!=e){if(function(e){return e&&"function"==typeof e[s.a]}(e))return function(e,t){return new r.a(n=>{const r=new o.a;return r.add(t.schedule(()=>{const i=e[s.a]();r.add(i.subscribe({next(e){r.add(t.schedule(()=>n.next(e)))},error(e){r.add(t.schedule(()=>n.error(e)))},complete(){r.add(t.schedule(()=>n.complete()))}}))})),r})}(e,t);if(Object(l.a)(e))return function(e,t){return new r.a(n=>{const r=new o.a;return r.add(t.schedule(()=>e.then(e=>{r.add(t.schedule(()=>{n.next(e),r.add(t.schedule(()=>n.complete()))}))},e=>{r.add(t.schedule(()=>n.error(e)))}))),r})}(e,t);if(Object(c.a)(e))return Object(a.a)(e,t);if(function(e){return e&&"function"==typeof e[u.a]}(e)||"string"==typeof e)return function(e,t){if(!e)throw new Error("Iterable cannot be null");return new r.a(n=>{const r=new o.a;let i;return r.add(()=>{i&&"function"==typeof i.return&&i.return()}),r.add(t.schedule(()=>{i=e[u.a](),r.add(t.schedule(function(){if(n.closed)return;let e,t;try{const o=i.next();e=o.value,t=o.done}catch(r){return void n.error(r)}t?n.complete():(n.next(e),this.schedule())}))})),r})}(e,t)}throw new TypeError((null!==e&&typeof e||e)+" is not observable")}(e,t):e instanceof r.a?e:new r.a(Object(i.a)(e))}n.d(t,"a",function(){return h})},CqG3:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n("g+7Q"))},DH7j:function(e,t,n){"use strict";n.d(t,"a",function(){return r});const r=(()=>Array.isArray||(e=>e&&"number"==typeof e.length))()},HDdC:function(e,t,n){"use strict";var r=n("7o/Q"),i=n("2QA8"),o=n("gRHU"),s=n("kJWO"),a=n("mCNh"),u=n("2fFW");n.d(t,"a",function(){return l});let l=(()=>{class e{constructor(e){this._isScalar=!1,e&&(this._subscribe=e)}lift(t){const n=new e;return n.source=this,n.operator=t,n}subscribe(e,t,n){const{operator:s}=this,a=function(e,t,n){if(e){if(e instanceof r.a)return e;if(e[i.a])return e[i.a]()}return e||t||n?new r.a(e,t,n):new r.a(o.a)}(e,t,n);if(a.add(s?s.call(a,this.source):this.source||u.a.useDeprecatedSynchronousErrorHandling&&!a.syncErrorThrowable?this._subscribe(a):this._trySubscribe(a)),u.a.useDeprecatedSynchronousErrorHandling&&a.syncErrorThrowable&&(a.syncErrorThrowable=!1,a.syncErrorThrown))throw a.syncErrorValue;return a}_trySubscribe(e){try{return this._subscribe(e)}catch(t){u.a.useDeprecatedSynchronousErrorHandling&&(e.syncErrorThrown=!0,e.syncErrorValue=t),function(e){for(;e;){const{closed:t,destination:n,isStopped:i}=e;if(t||i)return!1;e=n&&n instanceof r.a?n:null}return!0}(e)?e.error(t):console.warn(t)}}forEach(e,t){return new(t=c(t))((t,n)=>{let r;r=this.subscribe(t=>{try{e(t)}catch(i){n(i),r&&r.unsubscribe()}},n,t)})}_subscribe(e){const{source:t}=this;return t&&t.subscribe(e)}[s.a](){return this}pipe(...e){return 0===e.length?this:Object(a.b)(e)(this)}toPromise(e){return new(e=c(e))((e,t)=>{let n;this.subscribe(e=>n=e,e=>t(e),()=>e(n))})}}return e.create=t=>new e(t),e})();function c(e){if(e||(e=u.a.Promise||Promise),!e)throw new Error("no Promise impl found");return e}},I55L:function(e,t,n){"use strict";n.d(t,"a",function(){return r});const r=e=>e&&"number"==typeof e.length&&"function"!=typeof e},IjjT:function(e,t,n){"use strict";let r=(()=>
1{class e{constructor(t,n=e.now){this.SchedulerAction=t,this.now=n}schedule(e,t=0,n){return new this.SchedulerAction(this,e).schedule(n,t)}}return e.now=()=>Date.now(),e})();n.d(t,"a",function(){return i});class i extends r{constructor(e,t=r.now){super(e,()=>i.delegate&&i.delegate!==this?i.delegate.now():t()),this.actions=[],this.active=!1,this.scheduled=void 0}schedule(e,t=0,n){return i.delegate&&i.delegate!==this?i.delegate.schedule(e,t,n):super.schedule(e,t,n)}flush(e){const{actions:t}=this;if(this.active)return void t.push(e);let n;this.active=!0;do{if(n=e.execute(e.state,e.delay))break}while(e=t.shift());if(this.active=!1,n){for(;e=t.shift();)e.unsubscribe();throw n}}}},Kqap:function(e,t,n){"use strict";n.d(t,"a",function(){return i});var r=n("7o/Q");function i(e,t){let n=!1;return arguments.length>=2&&(n=!0),function(r){return r.lift(new o(e,t,n))}}class o{constructor(e,t,n=!1){this.accumulator=e,this.seed=t,this.hasSeed=n}call(e,t){return t.subscribe(new s(e,this.accumulator,this.seed,this.hasSeed))}}class s extends r.a{constructor(e,t,n,r){super(e),this.accumulator=t,this._seed=n,this.hasSeed=r,this.index=0}get seed(){return this._seed}set seed(e){this.hasSeed=!0,this._seed=e}_next(e){if(this.hasSeed)return this._tryNext(e);this.seed=e,this.destination.next(e)}_tryNext(e){const t=this.index++;let n;try{n=this.accumulator(this.seed,e,t)}catch(r){this.destination.error(r)}this.seed=n,this.destination.next(n)}}},KqfI:function(e,t,n){"use strict";function r(){}n.d(t,"a",function(){return r})},LRne:function(e,t,n){"use strict";n.d(t,"a",function(){return s});var r=n("z+Ro"),i=n("yCtX"),o=n("jZKg");function s(...e){let t=e[e.length-1];return Object(r.a)(t)?(e.pop(),Object(o.a)(e,t)):Object(i.a)(e)}},Lhse:function(e,t,n){"use strict";function r(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}n.d(t,"a",function(){return i});const i=r()},NJ4a:function(e,t,n){"use strict";function r(e){setTimeout(()=>{throw e},0)}n.d(t,"a",function(){return r})},SVse:function(e,t,n){"use strict";n.d(t,"z",function(){return W}),n.d(t,"t",function(){return R}),n.d(t,"l",function(){return G}),n.d(t,"m",function(){return Q}),n.d(t,"e",function(){return f}),n.d(t,"r",function(){return p}),n.d(t,"u",function(){return y}),n.d(t,"v",function(){return b}),n.d(t,"A",function(){return K}),n.d(t,"b",function(){return oe}),n.d(t,"j",function(){return Y}),n.d(t,"k",function(){return J}),n.d(t,"n",function(){return te}),n.d(t,"c",function(){return se}),n.d(t,"d",function(){return re}),n.d(t,"q",function(){return ie}),n.d(t,"y",function(){return ae}),n.d(t,"w",function(){return le}),n.d(t,"x",function(){return ce}),n.d(t,"s",function(){return he}),n.d(t,"p",function(){return i}),n.d(t,"g",function(){return o}),n.d(t,"i",function(){return s}),n.d(t,"a",function(){return a}),n.d(t,"f",function(){return c}),n.d(t,"o",function(){return h}),n.d(t,"h",function(){return u});var r=n("8Y7J");class i{}const o=new r.p("Location Initialized");class s{}const a=new r.p("appBaseHref");class u{constructor(e,t){this._subject=new r.m,this._urlChangeListeners=[],this._platformStrategy=e;const n=this._platformStrategy.getBaseHref();this._platformLocation=t,this._baseHref=u.stripTrailingSlash(l(n)),this._platformStrategy.onPopState(e=>{this._subject.emit({url:this.path(!0),pop:!0,state:e.state,type:e.type})})}path(e=!1){return this.normalize(this._platformStrategy.path(e))}getState(){return this._platformLocation.getState()}isCurrentPathEqualTo(e,t=""){return this.path()==this.normalize(e+u.normalizeQueryParams(t))}normalize(e){return u.stripTrailingSlash(function(e,t){return e&&t.startsWith(e)?t.substring(e.length):t}(this._baseHref,l(e)))}prepareExternalUrl(e){return e&&"/"!==e[0]&&(e="/"+e),this._platformStrategy.prepareExternalUrl(e)}go(e,t="",n=null){this._platformStrategy.pushState(n,"",e,t),this._notifyUrlChangeListeners(this.prepareExternalUrl(e+u.normalizeQueryParams(t)),n)}replaceState(e,t="",n=null){this._platformStrategy.replaceState(n,"",e,t),this._notifyUrlChangeListeners(this.prepareExternalUrl(e+u.normalizeQueryParams(t)),n)}forward(){this._platformStrategy.forward()}back(){this._platformStrategy.back()}onUrlChange(e){this._urlChangeListeners.push(e),this.subscribe(e=>{this._notifyUrlChangeListeners(e.url,e.state)})}
1_notifyUrlChangeListeners(e="",t){this._urlChangeListeners.forEach(n=>n(e,t))}subscribe(e,t,n){return this._subject.subscribe({next:e,error:t,complete:n})}static normalizeQueryParams(e){return e&&"?"!==e[0]?"?"+e:e}static joinWithSlash(e,t){if(0==e.length)return t;if(0==t.length)return e;let n=0;return e.endsWith("/")&&n++,t.startsWith("/")&&n++,2==n?e+t.substring(1):1==n?e+t:e+"/"+t}static stripTrailingSlash(e){const t=e.match(/#|\?|$/),n=t&&t.index||e.length;return e.slice(0,n-("/"===e[n-1]?1:0))+e.slice(n)}}function l(e){return e.replace(/\/index.html$/,"")}class c extends s{constructor(e,t){super(),this._platformLocation=e,this._baseHref="",null!=t&&(this._baseHref=t)}onPopState(e){this._platformLocation.onPopState(e),this._platformLocation.onHashChange(e)}getBaseHref(){return this._baseHref}path(e=!1){let t=this._platformLocation.hash;return null==t&&(t="#"),t.length>0?t.substring(1):t}prepareExternalUrl(e){const t=u.joinWithSlash(this._baseHref,e);return t.length>0?"#"+t:t}pushState(e,t,n,r){let i=this.prepareExternalUrl(n+u.normalizeQueryParams(r));0==i.length&&(i=this._platformLocation.pathname),this._platformLocation.pushState(e,t,i)}replaceState(e,t,n,r){let i=this.prepareExternalUrl(n+u.normalizeQueryParams(r));0==i.length&&(i=this._platformLocation.pathname),this._platformLocation.replaceState(e,t,i)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}}class h extends s{constructor(e,t){if(super(),this._platformLocation=e,null==t&&(t=this._platformLocation.getBaseHrefFromDOM()),null==t)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.");this._baseHref=t}onPopState(e){this._platformLocation.onPopState(e),this._platformLocation.onHashChange(e)}getBaseHref(){return this._baseHref}prepareExternalUrl(e){return u.joinWithSlash(this._baseHref,e)}path(e=!1){const t=this._platformLocation.pathname+u.normalizeQueryParams(this._platformLocation.search),n=this._platformLocation.hash;return n&&e?`${t}${n}`:t}pushState(e,t,n,r){const i=this.prepareExternalUrl(n+u.normalizeQueryParams(r));this._platformLocation.pushState(e,t,i)}replaceState(e,t,n,r){const i=this.prepareExternalUrl(n+u.normalizeQueryParams(r));this._platformLocation.replaceState(e,t,i)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}}const d=function(){var e={Zero:0,One:1,Two:2,Few:3,Many:4,Other:5};return e[e.Zero]="Zero",e[e.One]="One",e[e.Two]="Two",e[e.Few]="Few",e[e.Many]="Many",e[e.Other]="Other",e}(),f=function(){var e={Format:0,Standalone:1};return e[e.Format]="Format",e[e.Standalone]="Standalone",e}(),p=function(){var e={Narrow:0,Abbreviated:1,Wide:2,Short:3};return e[e.Narrow]="Narrow",e[e.Abbreviated]="Abbreviated",e[e.Wide]="Wide",e[e.Short]="Short",e}(),m=function(){var e={Short:0,Medium:1,Long:2,Full:3};return e[e.Short]="Short",e[e.Medium]="Medium",e[e.Long]="Long",e[e.Full]="Full",e}(),g=function(){var e={Decimal:0,Group:1,List:2,PercentSign:3,PlusSign:4,MinusSign:5,Exponential:6,SuperscriptingExponent:7,PerMille:8,Infinity:9,NaN:10,TimeSeparator:11,CurrencyDecimal:12,CurrencyGroup:13};return e[e.Decimal]="Decimal",e[e.Group]="Group",e[e.List]="List",e[e.PercentSign]="PercentSign",e[e.PlusSign]="PlusSign",e[e.MinusSign]="MinusSign",e[e.Exponential]="Exponential",e[e.SuperscriptingExponent]="SuperscriptingExponent",e[e.PerMille]="PerMille",e[e.Infinity]="Infinity",e[e.NaN]="NaN",e[e.TimeSeparator]="TimeSeparator",e[e.CurrencyDecimal]="CurrencyDecimal",e[e.CurrencyGroup]="CurrencyGroup",e}();function y(e,t,n){const i=Object(r.tb)(e),o=T([i[r.eb.DaysFormat],i[r.eb.DaysStandalone]],t);return T(o,n)}function b(e,t,n){const i=Object(r.tb)(e),o=T([i[r.eb.MonthsFormat],i[r.eb.MonthsStandalone]],t);return T(o,n)}function v(e,t){return T(Object(r.tb)(e)[r.eb.DateFormat],t)}function w(e,t){return T(Object(r.tb)(e)[r.eb.TimeFormat],t)}function _(e,t){return T(Object(r.tb)(e)[r.eb.DateTimeFormat],t)}function S(e,t){const n=Object(r.tb)(e),i=n[r.eb.NumberSymbols][t];if(void 0===i){if(t===g.CurrencyDecimal)return n[r.eb.NumberSymbols][g.Decimal];if(t===g.CurrencyGroup)return n[r.eb.NumberSymbols][g.Group]}return i}const E=r.ub;function C(e){if(!e[r.eb.ExtraData])throw new Error(`Missing extra locale data for the locale "${e[r.eb.LocaleId]}". Use "registerLocaleData" to load new data. See the "I18n guide" on angular.io to know more.`)}function T(e,t){for(let n=t;n>-1;n--)if(void 0!==e[n])return e[n];throw new Error("Locale data API: locale data undefined")}function I(e){const[t,n]=e.split(":");return{hours:+t,minutes:+n}}const D=/^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/,x={},k=/((?:[^GyMLwWdEabBhHmsSzZO']+)|(?:'(?:[^']|'')*')|(?:G{1,5}|y{1,4}|M{1,5}|L{1,5}|w{1,2}|W{1}|d{1,2}|E{1,6}|a{1,5}|b{1,5}|B{1,5}|h{1,2}|H{1,2}|m{1,2}|s{1,2}|S{1,3}|z{1,4}|Z{1,5}|O{1,4}))([\s\S]*)/,A=function(){var e={Short:0,ShortGMT:1,Long:2,Extended:3};return e[e.Short]="Short",e[e.ShortGMT]="ShortGMT",e[e.Long]="Long",e[e.Extended]="Extended",e}(),O=function(){var e={FullYear:0,Month:1,Date:2,Hours:3,Minutes:4,Seconds:5,FractionalSeconds:6,Day:7};return e[e.FullYear]="FullYear",e[e.Month]="Month",e[e.Date]="Date",e[e.Hours]="Hours",e[e.Minutes]="Minutes",e[e.Seconds]="Seconds",e[e.FractionalSeconds]="FractionalSeconds",e[e.Day]="Day",e}(),N=function(){var e={DayPeriods:0,Days:1,Months:2,Eras:3};return e[e.DayPeriods]="DayPeriods",e[e.Days]="Days",e[e.Months]="Months",e[e.Eras]="Eras",e}();function R(e,t,n,i){let o=function(e){if(z(e))return e;if("number"==typeof e&&!isNaN(e))return new Date(e);if("string"==typeof e){e=e.trim();const t=parseFloat(e);
1if(!isNaN(e-t))return new Date(t);if(/^(\d{4}-\d{1,2}-\d{1,2})$/.test(e)){const[t,n,r]=e.split("-").map(e=>+e);return new Date(t,n-1,r)}let n;if(n=e.match(D))return function(e){const t=new Date(0);let n=0,r=0;const i=e[8]?t.setUTCFullYear:t.setFullYear,o=e[8]?t.setUTCHours:t.setHours;e[9]&&(n=Number(e[9]+e[10]),r=Number(e[9]+e[11])),i.call(t,Number(e[1]),Number(e[2])-1,Number(e[3]));const s=Number(e[4]||0)-n,a=Number(e[5]||0)-r,u=Number(e[6]||0),l=Math.round(1e3*parseFloat("0."+(e[7]||0)));return o.call(t,s,a,u,l),t}(n)}const t=new Date(e);if(!z(t))throw new Error(`Unable to convert "${e}" into a date`);return t}(e);t=function e(t,n){const i=function(e){return Object(r.tb)(e)[r.eb.LocaleId]}(t);if(x[i]=x[i]||{},x[i][n])return x[i][n];let o="";switch(n){case"shortDate":o=v(t,m.Short);break;case"mediumDate":o=v(t,m.Medium);break;case"longDate":o=v(t,m.Long);break;case"fullDate":o=v(t,m.Full);break;case"shortTime":o=w(t,m.Short);break;case"mediumTime":o=w(t,m.Medium);break;case"longTime":o=w(t,m.Long);break;case"fullTime":o=w(t,m.Full);break;case"short":const r=e(t,"shortTime"),i=e(t,"shortDate");o=M(_(t,m.Short),[r,i]);break;case"medium":const s=e(t,"mediumTime"),a=e(t,"mediumDate");o=M(_(t,m.Medium),[s,a]);break;case"long":const u=e(t,"longTime"),l=e(t,"longDate");o=M(_(t,m.Long),[u,l]);break;case"full":const c=e(t,"fullTime"),h=e(t,"fullDate");o=M(_(t,m.Full),[c,h])}return o&&(x[i][n]=o),o}(n,t)||t;let s,a=[];for(;t;){if(!(s=k.exec(t))){a.push(t);break}{const e=(a=a.concat(s.slice(1))).pop();if(!e)break;t=e}}let u=o.getTimezoneOffset();i&&(u=H(i,u),o=function(e,t,n){const r=e.getTimezoneOffset();return function(e,t){return(e=new Date(e.getTime())).setMinutes(e.getMinutes()+t),e}(e,-1*(H(t,r)-r))}(o,i));let l="";return a.forEach(e=>{const t=function(e){if(B[e])return B[e];let t;switch(e){case"G":case"GG":case"GGG":t=F(N.Eras,p.Abbreviated);break;case"GGGG":t=F(N.Eras,p.Wide);break;case"GGGGG":t=F(N.Eras,p.Narrow);break;case"y":t=L(O.FullYear,1,0,!1,!0);break;case"yy":t=L(O.FullYear,2,0,!0,!0);break;case"yyy":t=L(O.FullYear,3,0,!1,!0);break;case"yyyy":t=L(O.FullYear,4,0,!1,!0);break;case"M":case"L":t=L(O.Month,1,1);break;case"MM":case"LL":t=L(O.Month,2,1);break;case"MMM":t=F(N.Months,p.Abbreviated);break;case"MMMM":t=F(N.Months,p.Wide);break;case"MMMMM":t=F(N.Months,p.Narrow);break;case"LLL":t=F(N.Months,p.Abbreviated,f.Standalone);break;case"LLLL":t=F(N.Months,p.Wide,f.Standalone);break;case"LLLLL":t=F(N.Months,p.Narrow,f.Standalone);break;case"w":t=q(1);break;case"ww":t=q(2);break;case"W":t=q(1,!0);break;case"d":t=L(O.Date,1);break;case"dd":t=L(O.Date,2);break;case"E":case"EE":case"EEE":t=F(N.Days,p.Abbreviated);break;case"EEEE":t=F(N.Days,p.Wide);break;case"EEEEE":t=F(N.Days,p.Narrow);break;case"EEEEEE":t=F(N.Days,p.Short);break;case"a":case"aa":case"aaa":t=F(N.DayPeriods,p.Abbreviated);break;case"aaaa":t=F(N.DayPeriods,p.Wide);break;case"aaaaa":t=F(N.DayPeriods,p.Narrow);break;case"b":case"bb":case"bbb":t=F(N.DayPeriods,p.Abbreviated,f.Standalone,!0);break;case"bbbb":t=F(N.DayPeriods,p.Wide,f.Standalone,!0);break;case"bbbbb":t=F(N.DayPeriods,p.Narrow,f.Standalone,!0);break;case"B":case"BB":case"BBB":t=F(N.DayPeriods,p.Abbreviated,f.Format,!0);break;case"BBBB":t=F(N.DayPeriods,p.Wide,f.Format,!0);break;case"BBBBB":t=F(N.DayPeriods,p.Narrow,f.Format,!0);break;case"h":t=L(O.Hours,1,-12);break;case"hh":t=L(O.Hours,2,-12);break;case"H":t=L(O.Hours,1);break;case"HH":t=L(O.Hours,2);break;case"m":t=L(O.Minutes,1);break;case"mm":t=L(O.Minutes,2);break;case"s":t=L(O.Seconds,1);break;case"ss":t=L(O.Seconds,2);break;case"S":t=L(O.FractionalSeconds,1);break;case"SS":t=L(O.FractionalSeconds,2);break;case"SSS":t=L(O.FractionalSeconds,3);break;case"Z":case"ZZ":case"ZZZ":t=j(A.Short);break;case"ZZZZZ":t=j(A.Extended);break;case"O":case"OO":case"OOO":case"z":case"zz":case"zzz":t=j(A.ShortGMT);break;case"OOOO":case"ZZZZ":case"zzzz":t=j(A.Long);break;default:return null}return B[e]=t,t}(e);l+=t?t(o,n,u):"''"===e?"'":e.replace(/(^'|'$)/g,"").replace(/''/g,"'")}),l}function M(e,t){return t&&(e=e.replace(/\{([^}]+)}/g,function(e,n){return null!=t&&n in t?t[n]:e})),e}function P(e,t,n="-",r,i){let o="";(e<0||i&&e<=0)&&(i?e=1-e:(e=-e,o=n));let s=String(e);for(;s.length<t;)s="0"+s;return r&&(s=s.substr(s.length-t)),o+s}function L(e,t,n=0,r=!1,i=!1){return function(o,s){let a=function(e,t){switch(e){case O.FullYear:return t.getFullYear();case O.Month:return t.getMonth();case O.Date:return t.getDate();case O.Hours:return t.getHours();case O.Minutes:return t.getMinutes();case O.Seconds:return t.getSeconds();case O.FractionalSeconds:return t.getMilliseconds();case O.Day:return t.getDay();default:throw new Error(`Unknown DateType value "${e}".`)}}(e,o);if((n>0||a>-n)&&(a+=n),e===O.Hours)0===a&&-12===n&&(a=12);else if(e===O.FractionalSeconds)return u=t,P(a,3).substr(0,u);var u;const l=S(s,g.MinusSign);return P(a,t,l,r,i)}}function F(e,t,n=f.Format,i=!1){return function(o,s){return function(e,t,n,i,o,s){switch(n){case N.Months:return b(t,o,i)[e.getMonth()];case N.Days:return y(t,o,i)[e.getDay()];case N.DayPeriods:const a=e.getHours(),u=e.getMinutes();if(s){const e=function(e){const t=Object(r.tb)(e);return C(t),(t[r.eb.ExtraData][2]||[]).map(e=>"string"==typeof e?I(e):[I(e[0]),I(e[1])])}(t),n=function(e,t,n){const i=Object(r.tb)(e);C(i);const o=T([i[r.eb.ExtraData][0],i[r.eb.ExtraData][1]],t)||[];return T(o,n)||[]}(t,o,i);let s;if(e.forEach((e,t)=>{if(Array.isArray(e)){const{hours:r,minutes:i}=e[0],{hours:o,minutes:l}=e[1];a>=r&&u>=i&&(a<o||a===o&&u<l)&&(s=n[t])}else{const{hours:r,minutes:i}=e;r===a&&i===u&&(s=n[t])}}),s)return s}return function(e,t,n){const i=Object(r.tb)(e),o=T([i[r.eb.DayPeriodsFormat],i[r.eb.DayPeriodsStandalone]],t);return T(o,n)}(t,o,i)[a<12?0:1];case N.Eras:return function(e,t){return T(Object(r.tb)(e)[r.eb.Eras],t)}(t,i)[e.getFullYear()<=0?0:1];default:throw new Error(`unexpected translation type ${n}`)}}(o,s,e,t,n,i)}}function j(e){return function(t,n,r){const i=-1*r,o=S(n,g.MinusSign),s=i>0?Math.floor(i/60):Math.ceil(i/60);switch(e){case A.Short:return(i>=0?"+":"")+P(s,2,o)+P(Math.abs(i%60),2,o);case A.ShortGMT:return"GMT"+(i>
1=0?"+":"")+P(s,1,o);case A.Long:return"GMT"+(i>=0?"+":"")+P(s,2,o)+":"+P(Math.abs(i%60),2,o);case A.Extended:return 0===r?"Z":(i>=0?"+":"")+P(s,2,o)+":"+P(Math.abs(i%60),2,o);default:throw new Error(`Unknown zone width "${e}"`)}}}const V=0,U=4;function q(e,t=!1){return function(n,r){let i;if(t){const e=new Date(n.getFullYear(),n.getMonth(),1).getDay()-1,t=n.getDate();i=1+Math.floor((t+e)/7)}else{const e=function(e){const t=new Date(e,V,1).getDay();return new Date(e,0,1+(t<=U?U:U+7)-t)}(n.getFullYear()),t=(o=n,new Date(o.getFullYear(),o.getMonth(),o.getDate()+(U-o.getDay()))).getTime()-e.getTime();i=1+Math.round(t/6048e5)}var o;return P(i,e,S(r,g.MinusSign))}}const B={};function H(e,t){e=e.replace(/:/g,"");const n=Date.parse("Jan 01, 1970 00:00:00 "+e)/6e4;return isNaN(n)?t:n}function z(e){return e instanceof Date&&!isNaN(e.valueOf())}const W=new r.p("UseV4Plurals");class Q{}class G extends Q{constructor(e,t){super(),this.locale=e,this.deprecatedPluralFn=t}getPluralCategory(e,t){switch(this.deprecatedPluralFn?this.deprecatedPluralFn(t||this.locale,e):E(t||this.locale)(e)){case d.Zero:return"zero";case d.One:return"one";case d.Two:return"two";case d.Few:return"few";case d.Many:return"many";default:return"other"}}}function K(e,t){t=encodeURIComponent(t);for(const n of e.split(";")){const e=n.indexOf("="),[r,i]=-1==e?[n,""]:[n.slice(0,e),n.slice(e+1)];if(r.trim()===t)return decodeURIComponent(i)}return null}class ${constructor(e,t,n,r){this.$implicit=e,this.ngForOf=t,this.index=n,this.count=r}get first(){return 0===this.index}get last(){return this.index===this.count-1}get even(){return this.index%2==0}get odd(){return!this.even}}class Y{constructor(e,t,n){this._viewContainer=e,this._template=t,this._differs=n,this._ngForOfDirty=!0,this._differ=null}set ngForOf(e){this._ngForOf=e,this._ngForOfDirty=!0}set ngForTrackBy(e){Object(r.X)()&&null!=e&&"function"!=typeof e&&console&&console.warn&&console.warn(`trackBy must be a function, but received ${JSON.stringify(e)}. `+"See https://angular.io/docs/ts/latest/api/common/index/NgFor-directive.html#!#change-propagation for more information."),this._trackByFn=e}get ngForTrackBy(){return this._trackByFn}set ngForTemplate(e){e&&(this._template=e)}ngDoCheck(){if(this._ngForOfDirty){this._ngForOfDirty=!1;const n=this._ngForOf;if(!this._differ&&n)try{this._differ=this._differs.find(n).create(this.ngForTrackBy)}catch(t){throw new Error(`Cannot find a differ supporting object '${n}' of type '${e=n,e.name||typeof e}'. NgFor only supports binding to Iterables such as Arrays.`)}}var e;if(this._differ){const e=this._differ.diff(this._ngForOf);e&&this._applyChanges(e)}}_applyChanges(e){const t=[];e.forEachOperation((e,n,r)=>{if(null==e.previousIndex){const n=this._viewContainer.createEmbeddedView(this._template,new $(null,this._ngForOf,-1,-1),null===r?void 0:r),i=new Z(e,n);t.push(i)}else if(null==r)this._viewContainer.remove(null===n?void 0:n);else if(null!==n){const i=this._viewContainer.get(n);this._viewContainer.move(i,r);const o=new Z(e,i);t.push(o)}});for(let n=0;n<t.length;n++)this._perViewChange(t[n].view,t[n].record);for(let n=0,r=this._viewContainer.length;n<r;n++){const e=this._viewContainer.get(n);e.context.index=n,e.context.count=r,e.context.ngForOf=this._ngForOf}e.forEachIdentityChange(e=>{this._viewContainer.get(e.currentIndex).context.$implicit=e.item})}_perViewChange(e,t){e.context.$implicit=t.item}static ngTemplateContextGuard(e,t){return!0}}class Z{constructor(e,t){this.record=e,this.view=t}}class J{constructor(e,t){this._viewContainer=e,this._context=new X,this._thenTemplateRef=null,this._elseTemplateRef=null,this._thenViewRef=null,this._elseViewRef=null,this._thenTemplateRef=t}set ngIf(e){this._context.$implicit=this._context.ngIf=e,this._updateView()}set ngIfThen(e){ee("ngIfThen",e),this._thenTemplateRef=e,this._thenViewRef=null,this._updateView()}set ngIfElse(e){ee("ngIfElse",e),this._elseTemplateRef=e,this._elseViewRef=null,this._updateView()}_updateView(){this._context.$implicit?this._thenViewRef||(this._viewContainer.clear(),this._elseViewRef=null,this._thenTemplateRef&&(this._thenView
1Ref=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)))}}class X{constructor(){this.$implicit=null,this.ngIf=null}}function ee(e,t){if(t&&!t.createEmbeddedView)throw new Error(`${e} must be a TemplateRef, but received '${Object(r.Lb)(t)}'.`)}class te{constructor(e){this._viewContainerRef=e,this._viewRef=null,this.ngTemplateOutletContext=null,this.ngTemplateOutlet=null}ngOnChanges(e){this._shouldRecreateView(e)?(this._viewRef&&this._viewContainerRef.remove(this._viewContainerRef.indexOf(this._viewRef)),this.ngTemplateOutlet&&(this._viewRef=this._viewContainerRef.createEmbeddedView(this.ngTemplateOutlet,this.ngTemplateOutletContext))):this._viewRef&&this.ngTemplateOutletContext&&this._updateExistingContext(this.ngTemplateOutletContext)}_shouldRecreateView(e){const t=e.ngTemplateOutletContext;return!!e.ngTemplateOutlet||t&&this._hasContextShapeChanged(t)}_hasContextShapeChanged(e){const t=Object.keys(e.previousValue||{}),n=Object.keys(e.currentValue||{});if(t.length===n.length){for(let e of n)if(-1===t.indexOf(e))return!0;return!1}return!0}_updateExistingContext(e){for(let t of Object.keys(e))this._viewRef.context[t]=this.ngTemplateOutletContext[t]}}function ne(e,t){return Error(`InvalidPipeArgument: '${t}' for pipe '${Object(r.Lb)(e)}'`)}class re{constructor(e){this.locale=e}transform(e,t="mediumDate",n,r){if(null==e||""===e||e!=e)return null;try{return R(e,t,r||this.locale,n)}catch(i){throw ne(re,i.message)}}}class ie{transform(e,t,n){if(null==e)return e;if(!this.supports(e))throw ne(ie,e);return e.slice(t,n)}supports(e){return"string"==typeof e||Array.isArray(e)}}class oe{}const se=new r.p("DocumentToken"),ae="browser",ue="server";function le(e){return e===ae}function ce(e){return e===ue}let he=(()=>{class e{}return e.ngInjectableDef=Object(r.Sb)({token:e,providedIn:"root",factory:()=>new de(Object(r.Tb)(se),window,Object(r.Tb)(r.l))}),e})();class de{constructor(e,t,n){this.document=e,this.window=t,this.errorHandler=n,this.offset=()=>[0,0]}setOffset(e){this.offset=Array.isArray(e)?()=>e:e}getScrollPosition(){return this.supportScrollRestoration()?[this.window.scrollX,this.window.scrollY]:[0,0]}scrollToPosition(e){this.supportScrollRestoration()&&this.window.scrollTo(e[0],e[1])}scrollToAnchor(e){if(this.supportScrollRestoration()){e=this.window.CSS&&this.window.CSS.escape?this.window.CSS.escape(e):e.replace(/(\"|\'\ |:|\.|\[|\]|,|=)/g,"\\$1");try{const n=this.document.querySelector(`#${e}`);if(n)return void this.scrollToElement(n);const r=this.document.querySelector(`[name='${e}']`);if(r)return void this.scrollToElement(r)}catch(t){this.errorHandler.handleError(t)}}}setHistoryScrollRestoration(e){if(this.supportScrollRestoration()){const t=this.window.history;t&&t.scrollRestoration&&(t.scrollRestoration=e)}}scrollToElement(e){const t=e.getBoundingClientRect(),n=t.left+this.window.pageXOffset,r=t.top+this.window.pageYOffset,i=this.offset();this.window.scrollTo(n-i[0],r-i[1])}supportScrollRestoration(){try{return!!this.window&&!!this.window.scrollTo}catch(e){return!1}}}},SeVD:function(e,t,n){"use strict";var r=n("ngJS"),i=n("NJ4a"),o=n("Lhse"),s=n("kJWO"),a=n("I55L"),u=n("c2HN"),l=n("XoHu");n.d(t,"a",function(){return c});const c=e=>{if(e&&"function"==typeof e[s.a])return(e=>t=>{const n=e[s.a]();if("function"!=typeof n.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return n.subscribe(t)})(e);if(Object(a.a)(e))return Object(r.a)(e);if(Object(u.a)(e))return(e=>t=>(e.then(e=>{t.closed||(t.next(e),t.complete())},e=>t.error(e)).then(null,i.a),t))(e);if(e&&"function"==typeof e[o.a])return(e=>t=>{const n=e[o.a]();for(;;){const e=n.next();if(e.done){t.complete();break}if(t.next(e.value),t.closed)break}return"function"==typeof n.return&&t.add(()=>{n.return&&n.return()}),t})(e);{const t=Object(l.a)(e)?"an invalid object":`'${e}'`;throw new TypeError(`You provided ${t} where a stream was expected.`+" You can provide an Observable, Promise, Array, or Iterable.")}}},SpAZ:function(e,t,n){"use strict";function r(e){return e}n.d(t,"a",function(){return r})},VRyK:function(e,t,n){"use strict";n.d(t,"a",function(){return a});var r=n("HDdC"),i=n("z+Ro"),o=n("bHdf"),s=n("yCtX");function a(...e){let t=Number.POSITIVE_INFINITY,n=null,a=e[e.length-1];return Object(i.a)(a)?(n=e.pop(),e.length>1&&"number"==typeof e[e.length-1]&&(t=e.pop())):"number"==typeof a&&(t=e.pop()),null===n&&1===e.length&&e[0]instanceof r.a?e[0]:Object(o.a)(t)(Object(s.a)(e,n))}},Wcq6:function(e,t,n){"use strict";var r,i=(r=n("wj3C"))&&"object"==typeof r&&"default"in r?r.default:r;e.exports=i},XNiG:function(e,t,n){"use strict";var r=n("HDdC"),i=n("7o/Q"),o=n("quSY"),s=n("9ppp");class a extends o.a{constructor(e,t){super(),this.subject=e,this.subscriber=t,this.closed=!1}
1unsubscribe(){if(this.closed)return;this.closed=!0;const e=this.subject,t=e.observers;if(this.subject=null,!t||0===t.length||e.isStopped||e.closed)return;const n=t.indexOf(this.subscriber);-1!==n&&t.splice(n,1)}}var u=n("2QA8");n.d(t,"b",function(){return l}),n.d(t,"a",function(){return c});class l extends i.a{constructor(e){super(e),this.destination=e}}let c=(()=>{class e extends r.a{constructor(){super(),this.observers=[],this.closed=!1,this.isStopped=!1,this.hasError=!1,this.thrownError=null}[u.a](){return new l(this)}lift(e){const t=new h(this,this);return t.operator=e,t}next(e){if(this.closed)throw new s.a;if(!this.isStopped){const{observers:t}=this,n=t.length,r=t.slice();for(let i=0;i<n;i++)r[i].next(e)}}error(e){if(this.closed)throw new s.a;this.hasError=!0,this.thrownError=e,this.isStopped=!0;const{observers:t}=this,n=t.length,r=t.slice();for(let i=0;i<n;i++)r[i].error(e);this.observers.length=0}complete(){if(this.closed)throw new s.a;this.isStopped=!0;const{observers:e}=this,t=e.length,n=e.slice();for(let r=0;r<t;r++)n[r].complete();this.observers.length=0}unsubscribe(){this.isStopped=!0,this.closed=!0,this.observers=null}_trySubscribe(e){if(this.closed)throw new s.a;return super._trySubscribe(e)}_subscribe(e){if(this.closed)throw new s.a;return this.hasError?(e.error(this.thrownError),o.a.EMPTY):this.isStopped?(e.complete(),o.a.EMPTY):(this.observers.push(e),new a(this,e))}asObservable(){const e=new r.a;return e.source=this,e}}return e.create=(e,t)=>new h(e,t),e})();class h extends c{constructor(e,t){super(),this.destination=e,this.source=t}next(e){const{destination:t}=this;t&&t.next&&t.next(e)}error(e){const{destination:t}=this;t&&t.error&&this.destination.error(e)}complete(){const{destination:e}=this;e&&e.complete&&this.destination.complete()}_subscribe(e){const{source:t}=this;return t?this.source.subscribe(e):o.a.EMPTY}}},XoHu:function(e,t,n){"use strict";function r(e){return null!==e&&"object"==typeof e}n.d(t,"a",function(){return r})},Xr7G:function(e,t,n){"use strict";n.d(t,"c",function(){return p}),n.d(t,"e",function(){return m}),n.d(t,"d",function(){return g}),n.d(t,"b",function(){return b}),n.d(t,"f",function(){return v}),n.d(t,"a",function(){return w}),n("mrSG");var r=n("8Y7J"),i=n("Cfvw"),o=n("LRne"),s=n("bMVn"),a=n("m+Ru"),u=n("fKx8"),l=n("1XSQ"),c=n("yA/v"),h=n("SVse"),d=n("Wcq6"),f=n.n(d);const p=new r.p("angularfire2.enableFirestorePersistence"),m=new r.p("angularfire2.firestore.persistenceSettings"),g=new r.p("angularfire2.firestore.settings"),y=parseInt(f.a.SDK_VERSION.split(".")[0]),b=y<5||5==y&&parseInt(f.a.SDK_VERSION.split(".")[1])<8?{timestampsInSnapshots:!0}:{};function v(e,t=(e=>e)){return{query:t(e),ref:e}}let w=class{constructor(e,t,n,r,s,a,u){this.scheduler=new l.a(a,s),this.firestore=a.runOutsideAngular(()=>{const n=Object(c.e)(e,t).firestore();return n.settings(r||b),n}),this.persistenceEnabled$=n&&!Object(h.x)(s)?a.runOutsideAngular(()=>{try{return Object(i.a)(this.firestore.enablePersistence(u||void 0).then(()=>!0,()=>!1))}catch(e){return Object(o.a)(!1)}}):Object(o.a)(!1)}collection(e,t){let n;n="string"==typeof e?this.firestore.collection(e):e;const{ref:r,query:i}=v(n,t);return new a.a(r,i,this)}collectionGroup(e,t){if(y<6)throw"collection group queries require Firebase JS SDK >= 6.0";const n=t||(e=>e),r=this.firestore.collectionGroup(e);return new u.a(n(r),this)}doc(e){let t;return t="string"==typeof e?this.firestore.doc(e):e,new s.a(t,this)}createId(){return this.firestore.collection("_").doc().id}}},ZUHj:function(e,t,n){"use strict";n.d(t,"a",function(){return s});var r=n("51Dv"),i=n("SeVD"),o=n("HDdC");function s(e,t,n,s,a=new r.a(e,n,s)){if(!a.closed)return t instanceof o.a?t.subscribe(a):Object(i.a)(t)(a)}},bHdf:function(e,t,n){"use strict";n.d(t,"a",function(){return o});var r=n("5+tZ"),i=n("SpAZ");function o(e=Number.POSITIVE_INFINITY){return Object(r.a)(i.a,e)}},bMVn:function(e,t,n){"use strict";n.d(t,"a",function(){return l});var r=n("Cfvw"),i=n("cNHj"),o=n("lJxs"),s=n("Xr7G"),a=n("m+Ru"),u=n("1XSQ");class l{constructor(e,t){this.ref=e,this.afs=t}set(e,t){return this.ref.set(e,t)}update(e){return this.ref.update(e)}delete(){return this.ref.delete()}collection(e,t){const n=this.ref.collection(e),{ref:r,query:i}=Object(s.f)(n,t);return new a.a(r,i,this.afs)}
1snapshotChanges(){const e=Object(i.b)(this.ref),t=this.afs.scheduler.runOutsideAngular(e);return this.afs.scheduler.keepUnstableUntilFirst(t)}valueChanges(){return this.snapshotChanges().pipe(Object(o.a)(e=>e.payload.data()))}get(e){return Object(r.a)(this.ref.get(e)).pipe(Object(u.b)(this.afs.scheduler.zone))}}},c2HN:function(e,t,n){"use strict";function r(e){return!!e&&"function"!=typeof e.subscribe&&"function"==typeof e.then}n.d(t,"a",function(){return r})},cNHj:function(e,t,n){"use strict";n.d(t,"c",function(){return s}),n.d(t,"b",function(){return a}),n.d(t,"a",function(){return u});var r=n("HDdC"),i=n("w1tV"),o=n("lJxs");function s(e){return function(e){return new r.a(t=>({unsubscribe:e.onSnapshot(t)}))}(e).pipe(Object(i.a)())}function a(e){return s(e).pipe(Object(o.a)(e=>({payload:e,type:"value"})))}function u(e){return s(e).pipe(Object(o.a)(e=>({payload:e,type:"query"})))}},crnd:function(e,t){function n(e){return Promise.resolve().then(function(){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t})}n.keys=function(){return[]},n.resolve=n,e.exports=n,n.id="crnd"},fKx8:function(e,t,n){"use strict";n.d(t,"a",function(){return h});var r=n("Cfvw"),i=n("cNHj"),o=n("lJxs"),s=n("pLZG"),a=n("Kqap"),u=n("m+Ru"),l=n("iKj2"),c=n("1XSQ");class h{constructor(e,t){this.query=e,this.afs=t}stateChanges(e){return e&&0!==e.length?this.afs.scheduler.keepUnstableUntilFirst(this.afs.scheduler.runOutsideAngular(Object(l.c)(this.query))).pipe(Object(o.a)(t=>t.filter(t=>e.indexOf(t.type)>-1)),Object(s.a)(e=>e.length>0)):this.afs.scheduler.keepUnstableUntilFirst(this.afs.scheduler.runOutsideAngular(Object(l.c)(this.query)))}auditTrail(e){return this.stateChanges(e).pipe(Object(a.a)((e,t)=>[...e,...t],[]))}snapshotChanges(e){const t=Object(u.b)(e),n=Object(l.d)(this.query,t),r=this.afs.scheduler.runOutsideAngular(n);return this.afs.scheduler.keepUnstableUntilFirst(r)}valueChanges(){const e=Object(i.a)(this.query),t=this.afs.scheduler.runOutsideAngular(e);return this.afs.scheduler.keepUnstableUntilFirst(t).pipe(Object(o.a)(e=>e.payload.docs.map(e=>e.data())))}get(e){return Object(r.a)(this.query.get(e)).pipe(Object(c.b)(this.afs.scheduler.zone))}}},"g+7Q":function(e,t,n){"use strict";n.r(t);var r=n("Xr7G"),i=n("m7gy"),o=n("m+Ru"),s=n("fKx8"),a=n("bMVn"),u=n("iKj2"),l=n("cNHj");n.d(t,"EnablePersistenceToken",function(){return r.c}),n.d(t,"PersistenceSettingsToken",function(){return r.e}),n.d(t,"FirestoreSettingsToken",function(){return r.d}),n.d(t,"DefaultFirestoreSettings",function(){return r.b}),n.d(t,"associateQuery",function(){return r.f}),n.d(t,"AngularFirestore",function(){return r.a}),n.d(t,"AngularFirestoreModule",function(){return i.a}),n.d(t,"validateEventsArray",function(){return o.b}),n.d(t,"AngularFirestoreCollection",function(){return o.a}),n.d(t,"AngularFirestoreCollectionGroup",function(){return s.a}),n.d(t,"AngularFirestoreDocument",function(){return a.a}),n.d(t,"docChanges",function(){return u.c}),n.d(t,"sortedChanges",function(){return u.d}),n.d(t,"combineChanges",function(){return u.b}),n.d(t,"combineChange",function(){return u.a}),n.d(t,"fromRef",function(){return l.c}),n.d(t,"fromDocRef",function(){return l.b}),n.d(t,"fromCollectionRef",function(){return l.a})},gRHU:function(e,t,n){"use strict";n.d(t,"a",function(){return o});var r=n("2fFW"),i=n("NJ4a");const o={closed:!0,next(e){},error(e){if(r.a.useDeprecatedSynchronousErrorHandling)throw e;Object(i.a)(e)},complete(){}}},iKj2:function(e,t,n){"use strict";n.d(t,"c",function(){return s}),n.d(t,"d",function(){return a}),n.d(t,"b",function(){return u}),n.d(t,"a",function(){return l});var r=n("cNHj"),i=n("lJxs"),o=n("Kqap");function s(e){return Object(r.a)(e).pipe(Object(i.a)(e=>e.payload.docChanges().map(e=>({type:e.type,payload:e}))))}function a(e,t){return Object(r.a)(e).pipe(Object(i.a)(e=>e.payload.docChanges()),Object(o.a)((e,n)=>u(e,n,t),[]),Object(i.a)(e=>e.map(e=>({type:e.type,payload:e}))))}function u(e,t,n){return t.forEach(t=>{n.indexOf(t.type)>-1&&(e=l(e,t))}),e}function l(e,t){switch(t.type){case"added":e[t.newIndex]&&e[t.newIndex].doc.ref.isEqual(t.doc.ref)||e.splice(t.newIndex,0,t);break;case"modified":(null==e[t.oldIndex]||e[t.oldIndex].doc.ref.isEqual(t.doc.ref))&&(t.oldIndex!==t.newIndex?(e.splice(t.oldIndex,1),e.splice(t.newIndex,0,t)):e.splice(t.newIndex,1,t));break;case"removed":e[t.oldIndex]&&e[t.oldIndex].doc.ref.isEqual(t.doc.ref)&&e.splice(t.oldIndex,1)}return e}},jZKg:function(e,t,n){"use strict";n.d(t,"a",function(){return o}
1);var r=n("HDdC"),i=n("quSY");function o(e,t){return new r.a(n=>{const r=new i.a;let o=0;return r.add(t.schedule(function(){o!==e.length?(n.next(e[o++]),n.closed||r.add(this.schedule())):n.complete()})),r})}},kJWO:function(e,t,n){"use strict";n.d(t,"a",function(){return r});const r=(()=>"function"==typeof Symbol&&Symbol.observable||"@@observable")()},l7GE:function(e,t,n){"use strict";n.d(t,"a",function(){return i});var r=n("7o/Q");class i extends r.a{notifyNext(e,t,n,r,i){this.destination.next(t)}notifyError(e,t){this.destination.error(e)}notifyComplete(e){this.destination.complete()}}},lJxs:function(e,t,n){"use strict";n.d(t,"a",function(){return i});var r=n("7o/Q");function i(e,t){return function(n){if("function"!=typeof e)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return n.lift(new o(e,t))}}class o{constructor(e,t){this.project=e,this.thisArg=t}call(e,t){return t.subscribe(new s(e,this.project,this.thisArg))}}class s extends r.a{constructor(e,t,n){super(e),this.project=t,this.count=0,this.thisArg=n||this}_next(e){let t;try{t=this.project.call(this.thisArg,e,this.count++)}catch(n){return void this.destination.error(n)}this.destination.next(t)}}},"m+Ru":function(e,t,n){"use strict";n.d(t,"b",function(){return h}),n.d(t,"a",function(){return d});var r=n("Cfvw"),i=n("cNHj"),o=n("lJxs"),s=n("pLZG"),a=n("Kqap"),u=n("iKj2"),l=n("bMVn"),c=n("1XSQ");function h(e){return e&&0!==e.length||(e=["added","removed","modified"]),e}class d{constructor(e,t,n){this.ref=e,this.query=t,this.afs=n}stateChanges(e){return e&&0!==e.length?this.afs.scheduler.keepUnstableUntilFirst(this.afs.scheduler.runOutsideAngular(Object(u.c)(this.query))).pipe(Object(o.a)(t=>t.filter(t=>e.indexOf(t.type)>-1)),Object(s.a)(e=>e.length>0)):this.afs.scheduler.keepUnstableUntilFirst(this.afs.scheduler.runOutsideAngular(Object(u.c)(this.query)))}auditTrail(e){return this.stateChanges(e).pipe(Object(a.a)((e,t)=>[...e,...t],[]))}snapshotChanges(e){const t=h(e),n=Object(u.d)(this.query,t),r=this.afs.scheduler.runOutsideAngular(n);return this.afs.scheduler.keepUnstableUntilFirst(r)}valueChanges(e={}){const t=Object(i.a)(this.query),n=this.afs.scheduler.runOutsideAngular(t);return this.afs.scheduler.keepUnstableUntilFirst(n).pipe(Object(o.a)(t=>t.payload.docs.map(t=>e.idField?Object.assign({},t.data(),{[e.idField]:t.id}):t.data())))}get(e){return Object(r.a)(this.query.get(e)).pipe(Object(c.b)(this.afs.scheduler.zone))}add(e){return this.ref.add(e)}doc(e){return new l.a(this.ref.doc(e),this.afs)}}},m7gy:function(e,t,n){"use strict";n("mrSG");var r,i=n("Xr7G");n("6Joi"),n.d(t,"a",function(){return o});let o=r=class{static enablePersistence(e){return{ngModule:r,providers:[{provide:i.c,useValue:!0},{provide:i.e,useValue:e}]}}}},mCNh:function(e,t,n){"use strict";n.d(t,"a",function(){return i}),n.d(t,"b",function(){return o});var r=n("KqfI");function i(...e){return o(e)}function o(e){return e?1===e.length?e[0]:function(t){return e.reduce((e,t)=>t(e),t)}:r.a}},mrSG:function(e,t,n){"use strict";n.r(t),n.d(t,"__extends",function(){return i}),n.d(t,"__assign",function(){return o}),n.d(t,"__rest",function(){return s}),n.d(t,"__decorate",function(){return a}),n.d(t,"__param",function(){return u}),n.d(t,"__metadata",function(){return l}),n.d(t,"__awaiter",function(){return c}),n.d(t,"__generator",function(){return h}),n.d(t,"__exportStar",function(){return d}),n.d(t,"__values",function(){return f}),n.d(t,"__read",function(){return p}),n.d(t,"__spread",function(){return m}),n.d(t,"__spreadArrays",function(){return g}),n.d(t,"__await",function(){return y}),n.d(t,"__asyncGenerator",function(){return b}),n.d(t,"__asyncDelegator",function(){return v}),n.d(t,"__asyncValues",function(){return w}
1),n.d(t,"__makeTemplateObject",function(){return _}),n.d(t,"__importStar",function(){return S}),n.d(t,"__importDefault",function(){return E});var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function i(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var o=function(){return(o=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function s(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}function a(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s}function u(e,t){return function(n,r){t(n,r,e)}}function l(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function c(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{u(r.next(e))}catch(t){o(t)}}function a(e){try{u(r.throw(e))}catch(t){o(t)}}function u(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(s,a)}u((r=r.apply(e,t||[])).next())})}function h(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(a){o=[6,a],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}function d(e,t){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}function f(e){var t="function"==typeof Symbol&&e[Symbol.iterator],n=0;return t?t.call(e):{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}function p(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(a){i={error:a}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}function m(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(p(arguments[t]));return e}function g(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var o=arguments[t],s=0,a=o.length;s<a;s++,i++)r[i]=o[s];return r}function y(e){return this instanceof y?(this.v=e,this):new y(e)}function b(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(e,t||[]),o=[];return r={},s("next"),s("throw"),s("return"),r[Symbol.asyncIterator]=function(){return this},r;function s(e){i[e]&&(r[e]=function(t){return new Promise(function(n,r){o.push([e,t,n,r])>1||a(e,t)})})}function a(e,t){try{(n=i[e](t)).value instanceof y?Promise.resolve(n.value.v).then(u,l):c(o[0][2],n)}catch(r){c(o[0][3],r)}var n}function u(e){a("next",e)}function l(e){a("throw",e)}function c(e,t){e(t),o.shift(),o.length&&a(o[0][0],o[0][1])}}function v(e){var t,n;return t={},r("next"),r("throw",function(e){throw e}),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,i){t[r]=e[r]?function(t){return(n=!n)?{value:y(e[r](t)),done:"return"===r}:i?i(t):t}:i}}function w(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=f(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise(function(r,i){!function(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)}(r,i,(t=e[n](t)).done,t.value)})}}}function _(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}
1function S(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function E(e){return e&&e.__esModule?e:{default:e}}},n6bG:function(e,t,n){"use strict";function r(e){return"function"==typeof e}n.d(t,"a",function(){return r})},ngJS:function(e,t,n){"use strict";n.d(t,"a",function(){return r});const r=e=>t=>{for(let n=0,r=e.length;n<r&&!t.closed;n++)t.next(e[n]);t.complete()}},pLZG:function(e,t,n){"use strict";n.d(t,"a",function(){return i});var r=n("7o/Q");function i(e,t){return function(n){return n.lift(new o(e,t))}}class o{constructor(e,t){this.predicate=e,this.thisArg=t}call(e,t){return t.subscribe(new s(e,this.predicate,this.thisArg))}}class s extends r.a{constructor(e,t,n){super(e),this.predicate=t,this.thisArg=n,this.count=0}_next(e){let t;try{t=this.predicate.call(this.thisArg,e,this.count++)}catch(n){return void this.destination.error(n)}t&&this.destination.next(e)}}},"q/0M":function(e,t,n){"use strict";n.r(t),n.d(t,"LogLevel",function(){return i}),n.d(t,"Logger",function(){return a}),n.d(t,"setLogLevel",function(){return u});var r=[],i=function(e){return e[e.DEBUG=0]="DEBUG",e[e.VERBOSE=1]="VERBOSE",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR",e[e.SILENT=5]="SILENT",e}({}),o=i.INFO,s=function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];if(!(t<e.logLevel)){var o=(new Date).toISOString();switch(t){case i.DEBUG:case i.VERBOSE:console.log.apply(console,["["+o+"]  "+e.name+":"].concat(n));break;case i.INFO:console.info.apply(console,["["+o+"]  "+e.name+":"].concat(n));break;case i.WARN:console.warn.apply(console,["["+o+"]  "+e.name+":"].concat(n));break;case i.ERROR:console.error.apply(console,["["+o+"]  "+e.name+":"].concat(n));break;default:throw new Error("Attempted to log a message with an invalid logType (value: "+t+")")}}},a=function(){function e(e){this.name=e,this._logLevel=o,this._logHandler=s,r.push(this)}return Object.defineProperty(e.prototype,"logLevel",{get:function(){return this._logLevel},set:function(e){if(!(e in i))throw new TypeError("Invalid value assigned to `logLevel`");this._logLevel=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"logHandler",{get:function(){return this._logHandler},set:function(e){if("function"!=typeof e)throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e},enumerable:!0,configurable:!0}),e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._logHandler.apply(this,[this,i.DEBUG].concat(e))},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._logHandler.apply(this,[this,i.VERBOSE].concat(e))},e.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._logHandler.apply(this,[this,i.INFO].concat(e))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._logHandler.apply(this,[this,i.WARN].concat(e))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._logHandler.apply(this,[this,i.ERROR].concat(e))},e}();function u(e){r.forEach(function(t){t.logLevel=e})}},quSY:function(e,t,n){"use strict";var r=n("DH7j"),i=n("XoHu"),o=n("n6bG");const s=(()=>{function e(e){return Error.call(this),this.message=e?`${e.length} errors occurred during unsubscription:\n${e.map((e,t)=>`${t+1}) ${e.toString()}`).join("\n  ")}`:"",this.name="UnsubscriptionError",this.errors=e,this}return e.prototype=Object.create(Error.prototype),e})();n.d(t,"a",function(){return a});let a=(()=>{class e{constructor(e){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,e&&(this._unsubscribe=e)}unsubscribe(){let t;if(this.closed)return;let{_parentOrParents:n,_unsubscribe:a,_subscriptions:l}=this;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,n instanceof e)n.remove(this);else if(null!==n)for(let e=0;e<n.length;++e)n[e].remove(this);if(Object(o.a)(a))try{a.call(this)}catch(c){t=c instanceof s?u(c.errors):[c]}if(Object(r.a)(l)){let e=-1,n=l.length;for(;++e<n;){const n=l[e];
1if(Object(i.a)(n))try{n.unsubscribe()}catch(c){t=t||[],c instanceof s?t=t.concat(u(c.errors)):t.push(c)}}}if(t)throw new s(t)}add(t){let n=t;if(!t)return e.EMPTY;switch(typeof t){case"function":n=new e(t);case"object":if(n===this||n.closed||"function"!=typeof n.unsubscribe)return n;if(this.closed)return n.unsubscribe(),n;if(!(n instanceof e)){const t=n;(n=new e)._subscriptions=[t]}break;default:throw new Error("unrecognized teardown "+t+" added to Subscription.")}let{_parentOrParents:r}=n;if(null===r)n._parentOrParents=this;else if(r instanceof e){if(r===this)return n;n._parentOrParents=[r,this]}else{if(-1!==r.indexOf(this))return n;r.push(this)}const i=this._subscriptions;return null===i?this._subscriptions=[n]:i.push(n),n}remove(e){const t=this._subscriptions;if(t){const n=t.indexOf(e);-1!==n&&t.splice(n,1)}}}return e.EMPTY=function(e){return e.closed=!0,e}(new e),e})();function u(e){return e.reduce((e,t)=>e.concat(t instanceof s?t.errors:t),[])}},w1tV:function(e,t,n){"use strict";var r=n("XNiG"),i=n("HDdC"),o=n("7o/Q"),s=n("quSY");function a(){return function(e){return e.lift(new u(e))}}class u{constructor(e){this.connectable=e}call(e,t){const{connectable:n}=this;n._refCount++;const r=new l(e,n),i=t.subscribe(r);return r.closed||(r.connection=n.connect()),i}}class l extends o.a{constructor(e,t){super(e),this.connectable=t}_unsubscribe(){const{connectable:e}=this;if(!e)return void(this.connection=null);this.connectable=null;const t=e._refCount;if(t<=0)return void(this.connection=null);if(e._refCount=t-1,t>1)return void(this.connection=null);const{connection:n}=this,r=e._connection;this.connection=null,!r||n&&r!==n||r.unsubscribe()}}class c extends i.a{constructor(e,t){super(),this.source=e,this.subjectFactory=t,this._refCount=0,this._isComplete=!1}_subscribe(e){return this.getSubject().subscribe(e)}getSubject(){const e=this._subject;return e&&!e.isStopped||(this._subject=this.subjectFactory()),this._subject}connect(){let e=this._connection;return e||(this._isComplete=!1,(e=this._connection=new s.a).add(this.source.subscribe(new d(this.getSubject(),this))),e.closed&&(this._connection=null,e=s.a.EMPTY)),e}refCount(){return a()(this)}}const h=(()=>{const e=c.prototype;return{operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:e._subscribe},_isComplete:{value:e._isComplete,writable:!0},getSubject:{value:e.getSubject},connect:{value:e.connect},refCount:{value:e.refCount}}})();class d extends r.b{constructor(e,t){super(e),this.connectable=t}_error(e){this._unsubscribe(),super._error(e)}_complete(){this.connectable._isComplete=!0,this._unsubscribe(),super._complete()}_unsubscribe(){const e=this.connectable;if(e){this.connectable=null;const t=e._connection;e._refCount=0,e._subject=null,e._connection=null,t&&t.unsubscribe()}}}function f(){return new r.a}function p(){return e=>a()(function(e,t){return function(t){let n;n="function"==typeof e?e:function(){return e};const r=Object.create(t,h);return r.source=t,r.subjectFactory=n,r}}(f)(e))}n.d(t,"a",function(){return p})},wj3C:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n("mrSG"),o=n("zVF4"),s=n("q/0M"),a=((r={})["no-app"]="No Firebase App '{$appName}' has been created - call Firebase App.initializeApp()",r["bad-app-name"]="Illegal App name: '{$appName}",r["duplicate-app"]="Firebase App named '{$appName}' already exists",r["app-deleted"]="Firebase App named '{$appName}' already deleted",r["duplicate-service"]="Firebase service named '{$appName}' already registered",r["invalid-app-argument"]="firebase.{$appName}() takes either no argument or a Firebase App instance.",r),u=new o.ErrorFactory("app","Firebase",a),l="[DEFAULT]",c=[],h=function(){function e(e,t,n){this.firebase_=n,this.isDeleted_=!1,this.services_={},this.name_=t.name,this.automaticDataCollectionEnabled_=t.automaticDataCollectionEnabled||!1,this.options_=o.deepCopy(e),this.INTERNAL={getUid:function(){return null},getToken:function(){return Promise.resolve(null)},addAuthTokenListener:function(e){c.push(e),setTimeout(function(){return e(null)},0)},removeAuthTokenListener:function(e){c=c.filter(function(t){return t!==e})}}}return Object.defineProperty(e.prototype,"automaticDataCollectionEnabled",{get:function(){return this.checkDestroyed_(),this.automaticDataCollectionEnabled_},set:function(e){this.checkDestroyed_(),this.automaticDataCollectionEnabled_=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"name",{get:function(){return this.checkDestroyed_(),this.name_},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"options",{get:function(){return this.checkDestroyed_(),this.options_},enumerable:!0,configurable:!0}),e.prototype.delete=function(){var e=this;return new Promise(function(t){e.checkDestroyed_(),t()}).then(function(){e.firebase_.INTERNAL.removeApp(e.name_);for(var t=[],n=0,r=Object.keys(e.services_);n<r.length;n++)for(var i=r[n],o=0,s=Object.keys(e.services_[i]);o<s.length;o++)t.push(e.services_[i][s[o]]);return Promise.all(t.filter(function(e){return"INTERNAL"in e}).map(function(e){return e.INTERNAL.delete()}))}).then(function(){e.isDeleted_=!0,e.services_={}})},e.prototype._getService=function(e,t){if(void 0===t&&(t=l),this.checkDestroyed_(),this.services_[e]||(this.services_[e]={}),!this.services_[e][t]){var n=t!==l?t:void 0,r=this.firebase_.INTERNAL.factories[e](this,this.extendApp.bind(this),n);this.services_[e][t]=r}return this.services_[e][t]},e.prototype._removeServiceInstance=function(e,t){void 0===t&&(t=l),this.services_[e]&&this.services_[e][t]&&delete this.services_[e][t]},e.prototype.extendApp=function(e){var t=this;o.deepExtend(this,e),e.INTERNAL&&e.INTERNAL.addAuthTokenListener&&(c.forEach(function(e){t.INTERNAL.addAuthTokenListener(e)}),c=[])},e.prototype.checkDestroyed_=function(){if(this.isDeleted_)throw u.create("app-deleted",{appName:this.name_})},e}();h.prototype.name&&h.prototype.options||h.prototype.delete||console.log("dc");var d=new s.Logger("@firebase/app");if(o.isBrowser()&&void 0!==self.firebase){d.warn("\n    Warning: Firebase is already defined in the global scope. Please make sure\n    Firebase library is only loaded once.\n  ");var f=self.firebase.SDK_VERSION;f&&f.indexOf("LITE")>=0&&d.warn("\n    Warning: You are trying to load Firebase while using Firebase Performance standalone script.\n    You should load Firebase Performance with this instance of Firebase to avoid loading duplicate code.\n    ")}var p=function e(){var t=function(e){var t={},n={},r={},i={__esModule:!0,initializeApp:function(n,r){void 0===r&&(r={}),"object"==typeof r&&null!==r||(r={name:r});var s=r;void 0===s.name&&(s.name=l);var a=s.name;if("string"!=typeof a||!a)throw u.create("bad-app-name",{appName:String(a)});if(o.contains(t,a))throw u.create("duplicate-app",{appName:a});var h=new e(n,s,i);return t[a]=h,c(h,"create"),h},app:s,apps:null,SDK_VERSION:"6.3.4",INTERNAL:{registerService:function(t,l,c,h,d){if(void 0===d&&(d=!1),n[t])throw u.create("duplicate-service",{appName:t});function f(e){if(void 0===e&&(e=s()),"function"!=typeof e[t])throw u.create("invalid-app-argument",{appName:t});return e[t]()}
1return n[t]=l,h&&(r[t]=h,a().forEach(function(e){h("create",e)})),void 0!==c&&o.deepExtend(f,c),i[t]=f,e.prototype[t]=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=this._getService.bind(this,t);return r.apply(this,d?e:[])},f},removeApp:function(e){c(t[e],"delete"),delete t[e]},factories:n,useAsService:h}};function s(e){if(!o.contains(t,e=e||l))throw u.create("no-app",{appName:e});return t[e]}function a(){return Object.keys(t).map(function(e){return t[e]})}function c(e,t){for(var i=0,o=Object.keys(n);i<o.length;i++){var s=h(0,o[i]);if(null===s)return;r[s]&&r[s](t,e)}}function h(e,t){return"serverAuth"===t?null:t}return i.default=i,Object.defineProperty(i,"apps",{get:a}),s.App=e,i}(h);return t.INTERNAL=i.__assign({},t.INTERNAL,{createFirebaseNamespace:e,extendNamespace:function(e){o.deepExtend(t,e)},createSubscribe:o.createSubscribe,ErrorFactory:o.ErrorFactory,deepExtend:o.deepExtend}),t}(),m=p.initializeApp;p.initializeApp=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o.isNode()&&d.warn('\n      Warning: This is a browser-targeted Firebase bundle but it appears it is being\n      run in a Node environment.  If running in a Node environment, make sure you\n      are using the bundle specified by the "main" field in package.json.\n      \n      If you are using Webpack, you can specify "main" as the first item in\n      "resolve.mainFields":\n      https://webpack.js.org/configuration/resolve/#resolvemainfields\n      \n      If using Rollup, use the rollup-plugin-node-resolve plugin and specify "main"\n      as the first item in "mainFields", e.g. [\'main\', \'module\'].\n      https://github.com/rollup/rollup-plugin-node-resolve\n      '),m.apply(void 0,e)};var g=p;t.default=g,t.firebase=g},x7I3:function(e,t,n){"use strict";n.r(t),n.d(t,"ErrorCode",function(){return ar}),n.d(t,"EventType",function(){return ur}),n.d(t,"WebChannel",function(){return lr}),n.d(t,"XhrIo",function(){return cr}),n.d(t,"createWebChannelTransport",function(){return sr});var r,i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},o=o||{},s=i;function a(e){return"string"==typeof e}function u(e){return"number"==typeof e}function l(e,t){e=e.split("."),t=t||s;for(var n=0;n<e.length;n++)if(null==(t=t[e[n]]))return null;return t}function c(){}function h(e){var t=typeof e;if("object"==t){if(!e)return"null";if(e instanceof Array)return"array";if(e instanceof Object)return t;var n=Object.prototype.toString.call(e);if("[object Window]"==n)return"object";if("[object Array]"==n||"number"==typeof e.length&&void 0!==e.splice&&void 0!==e.propertyIsEnumerable&&!e.propertyIsEnumerable("splice"))return"array";if("[object Function]"==n||void 0!==e.call&&void 0!==e.propertyIsEnumerable&&!e.propertyIsEnumerable("call"))return"function"}else if("function"==t&&void 0===e.call)return"object";return t}function d(e){return"array"==h(e)}function f(e){var t=h(e);return"array"==t||"object"==t&&"number"==typeof e.length}function p(e){var t=typeof e;return"object"==t&&null!=e||"function"==t}var m="closure_uid_"+(1e9*Math.random()>>>0),g=0;function y(e,t,n){return e.call.apply(e.bind,arguments)}function b(e,t,n){if(!e)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),e.apply(t,n)}}return function(){return e.apply(t,arguments)}}function v(e,t,n){return(v=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?y:b).apply(null,arguments)}function w(e,t){var n=Array.prototype.slice.call(arguments,1);return function(){var t=n.slice();return t.push.apply(t,arguments),e.apply(this,t)}}var _=Date.now||function(){return+new Date};function S(e,t){function n(){}n.prototype=t.prototype,e.N=t.prototype,e.prototype=new n,e.prototype.constructor=e,e.yb=function(e,n,r){for(var i=Array(arguments.length-2),o=2;o<arguments.length;o++)i[o-2]=arguments[o];return t.prototype[n].apply(e,i)}}function E(){this.j=this.j,this.i=this.i}E.prototype.j=!1,E.prototype.la=function(){!this.j&&(this.j=!0,this.G(),0)&&(this[m]||(this[m]=++g))},E.prototype.G=function(){if(this.i)for(;this.i.length;)this.i.shift()()};var C=Array.prototype.indexOf?function(e,t){return Array.prototype.indexOf.call(e,t,void 0)}:function(e,t){if(a(e))return a(t)&&1==t.length?e.indexOf(t,0):-1;for(var n=0;n<e.length;n++)if(n in e&&e[n]===t)return n;return-1},T=Array.prototype.forEach?function(e,t,n){Array.prototype.forEach.call(e,t,n)}:function(e,t,n){for(var r=e.length,i=a(e)?e.split(""):e,o=0;o<r;o++)o in i&&t.call(n,i[o],o,e)};function I(e){return Array.prototype.concat.apply([],arguments)}function D(e){var t=e.length;if(0<t){for(var n=Array(t),r=0;r<t;r++)n[r]=e[r];return n}return[]}function x(e){return/^[\s\xa0]*$/.test(e)}var k,A=String.prototype.trim?function(e){return e.trim()}:function(e){return/^[\s\xa0]*([\s\S]*?)[\s\xa0]*$/.exec(e)[1]};function O(e,t){return-1!=e.indexOf(t)}function N(e,t){return e<t?-1:e>t?1:0}e:{var R=s.navigator;if(R){var M=R.userAgent;if(M){k=M;break e}}k=""}function P(e,t,n){for(var r in e)t.call(n,e[r],r,e)}function L(e){var t,n={};for(t in e)n[t]=e[t];return n}var F="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleStr
1ing toString valueOf".split(" ");function j(e,t){for(var n,r,i=1;i<arguments.length;i++){for(n in r=arguments[i])e[n]=r[n];for(var o=0;o<F.length;o++)n=F[o],Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}}function V(e){return V[" "](e),e}V[" "]=c;var U,q,B=O(k,"Opera"),H=O(k,"Trident")||O(k,"MSIE"),z=O(k,"Edge"),W=z||H,Q=O(k,"Gecko")&&!(O(k.toLowerCase(),"webkit")&&!O(k,"Edge"))&&!(O(k,"Trident")||O(k,"MSIE"))&&!O(k,"Edge"),G=O(k.toLowerCase(),"webkit")&&!O(k,"Edge");function K(){var e=s.document;return e?e.documentMode:void 0}e:{var $="",Y=(q=k,Q?/rv:([^\);]+)(\)|;)/.exec(q):z?/Edge\/([\d\.]+)/.exec(q):H?/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(q):G?/WebKit\/(\S+)/.exec(q):B?/(?:Version)[ \/]?(\S+)/.exec(q):void 0);if(Y&&($=Y?Y[1]:""),H){var Z=K();if(null!=Z&&Z>parseFloat($)){U=String(Z);break e}}U=$}var J,X={};function ee(e){return function(e,t){var n=X;return Object.prototype.hasOwnProperty.call(n,e)?n[e]:n[e]=t()}(e,function(){for(var t=0,n=A(String(U)).split("."),r=A(String(e)).split("."),i=Math.max(n.length,r.length),o=0;0==t&&o<i;o++){var s=n[o]||"",a=r[o]||"";do{if(s=/(\d*)(\D*)(.*)/.exec(s)||["","","",""],a=/(\d*)(\D*)(.*)/.exec(a)||["","","",""],0==s[0].length&&0==a[0].length)break;t=N(0==s[1].length?0:parseInt(s[1],10),0==a[1].length?0:parseInt(a[1],10))||N(0==s[2].length,0==a[2].length)||N(s[2],a[2]),s=s[3],a=a[3]}while(0==t)}return 0<=t})}var te=s.document;J=te&&H?K()||("CSS1Compat"==te.compatMode?parseInt(U,10):5):void 0;var ne=!H||9<=Number(J),re=H&&!ee("9"),ie=function(){if(!s.addEventListener||!Object.defineProperty)return!1;var e=!1,t=Object.defineProperty({},"passive",{get:function(){e=!0}});try{s.addEventListener("test",c,t),s.removeEventListener("test",c,t)}catch(n){}return e}();function oe(e,t){this.type=e,this.a=this.target=t,this.Ja=!0}function se(e,t){if(oe.call(this,e?e.type:""),this.relatedTarget=this.a=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.c=null,e){var n=this.type=e.type,r=e.changedTouches&&e.changedTouches.length?e.changedTouches[0]:null;if(this.target=e.target||e.srcElement,this.a=t,t=e.relatedTarget){if(Q){e:{try{V(t.nodeName);var i=!0;break e}catch(o){}i=!1}i||(t=null)}}else"mouseover"==n?t=e.fromElement:"mouseout"==n&&(t=e.toElement);this.relatedTarget=t,r?(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.clientX=void 0!==e.clientX?e.clientX:e.pageX,this.clientY=void 0!==e.clientY?e.clientY:e.pageY,this.screenX=e.screenX||0,this.screenY=e.screenY||0),this.button=e.button,this.key=e.key||"",this.ctrlKey=e.ctrlKey,this.altKey=e.altKey,this.shiftKey=e.shiftKey,this.metaKey=e.metaKey,this.pointerId=e.pointerId||0,this.pointerType=a(e.pointerType)?e.pointerType:ae[e.pointerType]||"",this.c=e,e.defaultPrevented&&this.b()}}oe.prototype.b=function(){this.Ja=!1},S(se,oe);var ae={2:"touch",3:"pen",4:"mouse"};se.prototype.b=function(){se.N.b.call(this);var e=this.c;if(e.preventDefault)e.preventDefault();else if(e.returnValue=!1,re)try{(e.ctrlKey||112<=e.keyCode&&123>=e.keyCode)&&(e.keyCode=-1)}catch(t){}};var ue="closure_listenable_"+(1e6*Math.random()|0),le=0;function ce(e,t,n,r,i){this.listener=e,this.proxy=null,this.src=t,this.type=n,this.capture=!!r,this.da=i,this.key=++le,this.X=this.Z=!1}function he(e){e.X=!0,e.listener=null,e.proxy=null,e.src=null,e.da=null}function de(e){this.src=e,this.a={},this.b=0}function fe(e,t){var n=t.type;if(n in e.a){var r,i=e.a[n],o=C(i,t);(r=0<=o)&&Array.prototype.splice.call(i,o,1),r&&(he(t),0==e.a[n].length&&(delete e.a[n],e.b--))}}function pe(e,t,n,r){for(var i=0;i<e.length;++i){var o=e[i];if(!o.X&&o.listener==t&&o.capture==!!n&&o.da==r)return i}return-1}de.prototype.add=function(e,t,n,r,i){var o=e.toString();(e=this.a[o])||(e=this.a[o]=[],this.b++);var s=pe(e,t,r,i);return-1<s?(t=e[s],n||(t.Z=!1)):((t=new ce(t,this.src,o,!!r,i)).Z=n,e.push(t)),t};var me="closure_lm_"+(1e6*Math.random()|0),ge={};function ye(e,t,n,r,i){if(r&&r.once)return function e(t,n,r,i,o){if(d(n)){for(var s=0;s<n.length;s++)e(t,n[s],r,i,o);return null}return r=Ce(r),t&&t[ue]?t.Ba(n,r,p(i)?!!i.capture:!!i,o):be(t,n,r,!0,i,o)}(e,t,n,r,i);if(d(t)){for(var o=0;o<t.length;o++)ye(e,t[o],n,r,i);return null}return n=Ce(n),e&&e[ue]?e.Aa(t,n,p(r)?!!r.capture:!!r,i):be(e,t,n,!1,r,i)}function be(e,t,n,r,i,o){if(!t)throw Error("Invalid event type");var s=p(i)?!!i.capture:!!i;if(s&&!ne)return null;var a=Se(e);if(a||(e[me]=a=new de(e)),(n=a.add(t,n,r,s,o)).proxy)return n;if(r=function(){var e=_e,t=ne?function(n){return e.call(t.src,t.listener,n)}:function(n){if(!(n=e.call(t.src,t.listener,n)))return n};return t}(),n.proxy=r,r.src=e,r.listener=n,e.addEventListener)ie||(i=s),void 0===i&&(i=!1),e.addEventListener(t.toString(),r,i);else if(e.attachEvent)e.attachEvent(we(t.toString()),r);else{if(!e.addListener||!e.removeListener)throw Error("addEventListener and attachEvent are unavailable.");e.addListener(r)}return n}function ve(e){if(!u(e)&&e&&!e.X){var t=e.src;if(t&&t[ue])fe(t.c,e);else{var n=e.type,r=e.proxy;t.removeEventListener?t.removeEventListener(n,r,e.capture):t.detachEvent?t.detachEvent(we(n),r):t.addListener&&t.removeListener&&t.removeListener(r),(n=Se(t))?(fe(n,e),0==n.b&&(n.src=null,t[me]=null)):he(e)}}}function we(e){return e in ge?ge[e]:ge[e]="on"+e}function _e(e,t){return!!e.X||function(e,t){var n=e.listener,r=e.da||e.src;return e.Z&&ve(e),n.call(r,t)}(e,ne?new se(t,this):t=new se(t||l("window.event"),this))}function Se(e){return(e=e[me])instanceof de?e:null}var Ee="__closure_events_fn_"+(1e9*Math.random()>>>0);function Ce(e){return"function"==h(e)?e:(e[Ee]||(e[Ee]=function(t){return e.handleEvent(t)}),e[Ee])}function Te(){E.call(this),this.c=new de(this),this.J=this,this.B=null}function Ie(e,t,n,r){if(!(t=e.c.a[String(t)]))return!0;t=t.concat();for(var i=!0,o=0;o<t.length;++o){var s=t[o];if(s&&!s.X&&s.capture==n){var a=s.listener,u=s.da||s.src;s.Z&&fe(e.c,s),i=!1!==a.call(u,r)&&i}}return i&&0!=r.Ja}S(Te,E),Te.prototype[ue]=!0,(r=Te.prototype).addEventListener=function(e,t,n,r){ye(this,e,t,n,r)},r.removeEventListener=function(e,t,n,r){!function e(t,n,r,i,o){if(d(n))for(var s=0;s<n.length;s++)e(t,n[s],r,i,o);else i=p(i)?!!i.capture:!!i,r=Ce(r),t&&t[ue]?(t=t.c,(n=String(n).toString())in t.a&&-1<(r=pe(s=t.a[n],r,i,o))&&(he(s[r]),Array.prototype.splice.call(s,r,1),0==s.length&&(delete t.a[n],t.b--))):t&&(t=Se(t))&&(n=t.a[n.toString()],t=-1,n&&(t=pe(n,r,i,o)),(r=-1<t?n[t]:null)&&ve(r))}(this,e,t,n,r)},r.dispatchEvent=function(e){var t,n=this.B;if(n)for(t=[];n;n=n.B)t.push(n);n=this.J;var r=e.type||e;if(a(e))e=new oe(e,n);else if(e instanceof oe)e.target=e.target||n;else{var i=e;j(e=new oe(r,n),i)}if(i=!0,t)for(var o=t.length-1;0<=o;o--){var s=e.a=t[o];i=Ie(s,r,!0,e)&&i}if(i=Ie(s=e.a=n,r,!0,e)&&i,i=Ie(s,r,!1,e)&&i,t)for(o=0;o<t.length;o++)i=Ie(s=e.a=t[o],r,!1,e)&&i;return i}
1,r.G=function(){if(Te.N.G.call(this),this.c){var e,t=this.c;for(e in t.a){for(var n=t.a[e],r=0;r<n.length;r++)he(n[r]);delete t.a[e],t.b--}}this.B=null},r.Aa=function(e,t,n,r){return this.c.add(String(e),t,!1,n,r)},r.Ba=function(e,t,n,r){return this.c.add(String(e),t,!0,n,r)};var De=s.JSON.stringify;function xe(e,t){this.c=e,this.f=t,this.b=0,this.a=null}function ke(){this.b=this.a=null}xe.prototype.get=function(){if(0<this.b){this.b--;var e=this.a;this.a=e.next,e.next=null}else e=this.c();return e};var Ae,Oe=new xe(function(){return new Re},function(e){e.reset()});function Ne(){var e=Fe,t=null;return e.a&&(t=e.a,e.a=e.a.next,e.a||(e.b=null),t.next=null),t}function Re(){this.next=this.b=this.a=null}function Me(e){s.setTimeout(function(){throw e},0)}function Pe(e,t){Ae||function(){var e=s.Promise.resolve(void 0);Ae=function(){e.then(je)}}(),Le||(Ae(),Le=!0),Fe.add(e,t)}ke.prototype.add=function(e,t){var n=Oe.get();n.set(e,t),this.b?this.b.next=n:this.a=n,this.b=n},Re.prototype.set=function(e,t){this.a=e,this.b=t,this.next=null},Re.prototype.reset=function(){this.next=this.b=this.a=null};var Le=!1,Fe=new ke;function je(){for(var e;e=Ne();){try{e.a.call(e.b)}catch(n){Me(n)}var t=Oe;t.f(e),100>t.b&&(t.b++,e.next=t.a,t.a=e)}Le=!1}function Ve(e,t){Te.call(this),this.b=e||1,this.a=t||s,this.f=v(this.gb,this),this.g=_()}function Ue(e){e.ba=!1,e.L&&(e.a.clearTimeout(e.L),e.L=null)}function qe(e,t,n){if("function"==h(e))n&&(e=v(e,n));else{if(!e||"function"!=typeof e.handleEvent)throw Error("Invalid listener argument");e=v(e.handleEvent,e)}return 2147483647<Number(t)?-1:s.setTimeout(e,t||0)}function Be(e,t,n){E.call(this),this.f=null!=n?v(e,n):e,this.c=t,this.b=v(this.ab,this),this.a=[]}function He(e){e.U=qe(e.b,e.c),e.f.apply(null,e.a)}function ze(e){E.call(this),this.b=e,this.a={}}S(Ve,Te),(r=Ve.prototype).ba=!1,r.L=null,r.gb=function(){if(this.ba){var e=_()-this.g;0<e&&e<.8*this.b?this.L=this.a.setTimeout(this.f,this.b-e):(this.L&&(this.a.clearTimeout(this.L),this.L=null),this.dispatchEvent("tick"),this.ba&&(Ue(this),this.start()))}},r.start=function(){this.ba=!0,this.L||(this.L=this.a.setTimeout(this.f,this.b),this.g=_())},r.G=function(){Ve.N.G.call(this),Ue(this),delete this.a},S(Be,E),(r=Be.prototype).ea=!1,r.U=null,r.Ua=function(e){this.a=arguments,this.U?this.ea=!0:He(this)},r.G=function(){Be.N.G.call(this),this.U&&(s.clearTimeout(this.U),this.U=null,this.ea=!1,this.a=[])},r.ab=function(){this.U=null,this.ea&&(this.ea=!1,He(this))},S(ze,E);var We=[];function Qe(e,t,n,r){d(n)||(n&&(We[0]=n.toString()),n=We);for(var i=0;i<n.length;i++){var o=ye(t,n[i],r||e.handleEvent,!1,e.b||e);if(!o)break;e.a[o.key]=o}}function Ge(e){P(e.a,function(e,t){this.a.hasOwnProperty(t)&&ve(e)},e),e.a={}}function Ke(){}ze.prototype.G=function(){ze.N.G.call(this),Ge(this)},ze.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented")};var $e=new Te;function Ye(e){oe.call(this,"serverreachability",e)}function Ze(e){$e.dispatchEvent(new Ye($e,e))}function Je(e){oe.call(this,"statevent",e)}function Xe(e){$e.dispatchEvent(new Je($e,e))}function et(e){oe.call(this,"timingevent",e)}function tt(e,t){if("function"!=h(e))throw Error("Fn must not be null and must be a function");return s.setTimeout(function(){e()},t)}S(Ye,oe),S(Je,oe),S(et,oe);var nt={NO_ERROR:0,hb:1,ob:2,nb:3,kb:4,mb:5,pb:6,Ma:7,TIMEOUT:8,sb:9},rt={jb:"complete",wb:"success",Na:"error",Ma:"abort",ub:"ready",vb:"readystatechange",TIMEOUT:"timeout",qb:"incrementaldata",tb:"progress",lb:"downloadprogress",xb:"uploadprogress"};function it(){}function ot(){}it.prototype.a=null;var st,at={OPEN:"a",ib:"b",Na:"c",rb:"d"};function ut(){oe.call(this,"d")}function lt(){oe.call(this,"c")}function ct(){}function ht(e,t,n){this.g=e,this.W=t,this.V=n||1,this.I=new ze(this),this.O=dt,this.P=new Ve(e=W?125:void 0),this.h=null,this.b=!1,this.l=this.D=this.f=this.F=this.v=this.R=this.i=null,this.j=[],this.a=null,this.A=0,this.c=this.w=null,this.o=-1,this.m=!1,this.J=0,this.B=null,this.s=this.S=this.H=!1}S(ut,oe),S(lt,oe),S(ct,it),st=new ct;var dt=45e3,ft={},pt={};function mt(e,t,n){e.F=1,e.f=Ut(Rt(t)),e.l=n,e.H=!0,yt(e,null)}function gt(e,t,n,r){e.F=1,e.f=Ut(Rt(t)),e.l=null,e.H=n,yt(e,r)}function yt(e,t){e.v=_(),wt(e),e.D=Rt(e.f),Vt(e.D,"t",e.V),e.A=0,e.a=e.g.$(e.g.Y()?t:null),0<e.J&&(e.B=new Be(v(e.Ka,e,e.a),e.J)),Qe(e.I,e.a,"readystatechange",e.eb),t=e.h?L(e.h):{},e.l?(e.w||(e.w="POST"),t["Content-Type"]="application/x-www-form-urlencoded",e.a.ca(e.D,e.w,e.l,t)):(e.w="GET",e.a.ca(e.D,e.w,null,t)),Ze(1)}function bt(e,t,n){for(var r=!0;!e.m&&e.A<n.length;){var i=vt(e,n);if(i==pt){4==t&&(e.c=4,Xe(14),r=!1);break}if(i==ft){e.c=4,Xe(15),r=!1;break}Tt(e,i)}4==t&&0==n.length&&(e.c=1,Xe(16),r=!1),e.b=e.b&&r,r||(Ct(e),Et(e))}function vt(e,t){var n=e.A,r=t.indexOf("\n",n);return-1==r?pt:(n=Number(t.substring(n,r)),isNaN(n)?ft:(r+=1)+n>t.length?pt:(t=t.substr(r,n),e.A=r+n,t))}function wt(e){e.R=_()+e.O,_t(e,e.O)}function _t(e,t){if(null!=e.i)throw Error("WatchDog timer not null");e.i=tt(v(e.bb,e),t)}
1function St(e){e.i&&(s.clearTimeout(e.i),e.i=null)}function Et(e){e.g.Da()||e.m||e.g.na(e)}function Ct(e){St(e);var t=e.B;t&&"function"==typeof t.la&&t.la(),e.B=null,Ue(e.P),Ge(e.I),e.a&&(t=e.a,e.a=null,t.abort(),t.la())}function Tt(e,t){try{e.g.Ga(e,t),Ze(4)}catch(n){}}function It(e,t){if(e.forEach&&"function"==typeof e.forEach)e.forEach(t,void 0);else if(f(e)||a(e))T(e,t,void 0);else{if(e.K&&"function"==typeof e.K)var n=e.K();else if(e.C&&"function"==typeof e.C)n=void 0;else if(f(e)||a(e)){n=[];for(var r=e.length,i=0;i<r;i++)n.push(i)}else for(i in n=[],r=0,e)n[r++]=i;i=(r=function(e){if(e.C&&"function"==typeof e.C)return e.C();if(a(e))return e.split("");if(f(e)){for(var t=[],n=e.length,r=0;r<n;r++)t.push(e[r]);return t}for(r in t=[],n=0,e)t[n++]=e[r];return t}(e)).length;for(var o=0;o<i;o++)t.call(void 0,r[o],n&&n[o],e)}}function Dt(e,t){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(e)if(e instanceof Dt)for(n=e.K(),r=0;r<n.length;r++)this.set(n[r],e.get(n[r]));else for(r in e)this.set(r,e[r])}function xt(e,t){At(e.b,t)&&(delete e.b[t],e.c--,e.a.length>2*e.c&&kt(e))}function kt(e){if(e.c!=e.a.length){for(var t=0,n=0;t<e.a.length;){var r=e.a[t];At(e.b,r)&&(e.a[n++]=r),t++}e.a.length=n}if(e.c!=e.a.length){var i={};for(n=t=0;t<e.a.length;)At(i,r=e.a[t])||(e.a[n++]=r,i[r]=1),t++;e.a.length=n}}function At(e,t){return Object.prototype.hasOwnProperty.call(e,t)}(r=ht.prototype).setTimeout=function(e){this.O=e},r.eb=function(e){e=e.target;var t=this.B;t&&3==Rn(e)?t.Ua():this.Ka(e)},r.Ka=function(e){try{if(e==this.a)e:{var t=Rn(this.a),n=this.a.ya(),r=this.a.T();if(!(3>t||3==t&&!W&&!this.a.aa())){this.m||4!=t||7==n||Ze(8==n||0>=r?3:2),St(this);var i=this.a.T();this.o=i;var o=this.a.aa();if(this.b=200==i){if(this.S&&!this.s){t:{if(this.a){var s=Mn(this.a,"X-HTTP-Initial-Response");if(s&&!x(s)){var a=s;break t}}a=null}if(!a){this.b=!1,this.c=3,Xe(12),Ct(this),Et(this);break e}this.s=!0,Tt(this,a)}this.H?(bt(this,t,o),W&&this.b&&3==t&&(Qe(this.I,this.P,"tick",this.cb),this.P.start())):Tt(this,o),4==t&&Ct(this),this.b&&!this.m&&(4==t?this.g.na(this):(this.b=!1,wt(this)))}else 400==i&&0<o.indexOf("Unknown SID")?(this.c=3,Xe(12)):(this.c=0,Xe(13)),Ct(this),Et(this)}}}catch(u){}},r.cb=function(){if(this.a){var e=Rn(this.a),t=this.a.aa();this.A<t.length&&(St(this),bt(this,e,t),this.b&&4!=e&&wt(this))}},r.cancel=function(){this.m=!0,Ct(this)},r.bb=function(){this.i=null;var e=_();0<=e-this.R?(2!=this.F&&(Ze(3),Xe(17)),Ct(this),this.c=2,Et(this)):_t(this,this.R-e)},(r=Dt.prototype).C=function(){kt(this);for(var e=[],t=0;t<this.a.length;t++)e.push(this.b[this.a[t]]);return e},r.K=function(){return kt(this),this.a.concat()},r.get=function(e,t){return At(this.b,e)?this.b[e]:t},r.set=function(e,t){At(this.b,e)||(this.c++,this.a.push(e)),this.b[e]=t},r.forEach=function(e,t){for(var n=this.K(),r=0;r<n.length;r++){var i=n[r],o=this.get(i);e.call(t,o,i,this)}};var Ot=/^(?:([^:\/?#.]+):)?(?:\/\/(?:([^\/?#]*)@)?([^\/#?]*?)(?::([0-9]+))?(?=[\/#?]|$))?([^?#]+)?(?:\?([^#]*))?(?:#([\s\S]*))?$/;function Nt(e,t){var n;this.b=this.j=this.f="",this.i=null,this.g=this.a="",this.h=!1,e instanceof Nt?(this.h=void 0!==t?t:e.h,Mt(this,e.f),this.j=e.j,Pt(this,e.b),Lt(this,e.i),this.a=e.a,Ft(this,en(e.c)),this.g=e.g):e&&(n=String(e).match(Ot))?(this.h=!!t,Mt(this,n[1]||"",!0),this.j=qt(n[2]||""),Pt(this,n[3]||"",!0),Lt(this,n[4]),this.a=qt(n[5]||"",!0),Ft(this,n[6]||"",!0),this.g=qt(n[7]||"")):(this.h=!!t,this.c=new $t(null,this.h))}function Rt(e){return new Nt(e)}function Mt(e,t,n){e.f=n?qt(t,!0):t,e.f&&(e.f=e.f.replace(/:$/,""))}function Pt(e,t,n){e.b=n?qt(t,!0):t}function Lt(e,t){if(t){if(t=Number(t),isNaN(t)||0>t)throw Error("Bad port number "+t);e.i=t}else e.i=null}function Ft(e,t,n){t instanceof $t?(e.c=t,function(e,t){t&&!e.f&&(Yt(e),e.c=null,e.a.forEach(function(e,t){var n=t.toLowerCase();t!=n&&(Zt(this,t),Xt(this,n,e))},e)),e.f=t}(e.c,e.h)):(n||(t=Bt(t,Gt)),e.c=new $t(t,e.h))}function jt(e,t,n){e.c.set(t,n)}function Vt(e,t,n){d(n)||(n=[String(n)]),Xt(e.c,t,n)}function Ut(e){return jt(e,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^_()).toString(36)),e}function qt(e,t){return e?t?decodeURI(e.replace(/%25/g,"%2525")):decodeURIComponent(e):""}function Bt(e,t,n){return a(e)?(e=encodeURI(e).replace(t,Ht),n&&(e=e.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),e):null}function Ht(e){return"%"+((e=e.charCodeAt(0))>>4&15).toString(16)+(15&e).toString(16)}Nt.prototype.toString=function(){var e=[],t=this.f;t&&e.push(Bt(t,zt,!0),":");var n=this.b;return(n||"file"==t)&&(e.push("//"),(t=this.j)&&e.push(Bt(t,zt,!0),"@"),e.push(encodeURIComponent(String(n)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),null!=(n=this.i)&&e.push(":",String(n))),(n=this.a)&&(this.b&&"/"!=n.charAt(0)&&e.push("/"),e.push(Bt(n,"/"==n.charAt(0)?Qt:Wt,!0))),(n=this.c.toString())&&e.push("?",n),(n=this.g)&&e.push("#",Bt(n,Kt)),e.join("")},Nt.prototype.resolve=function(e){var t=Rt(this),n=!!e.f;n?Mt(t,e.f):n=!!e.j,n?t.j=e.j:n=!!e.b,n?Pt(t,e.b):n=null!=e.i;var r=e.a;
1if(n)Lt(t,e.i);else if(n=!!e.a){if("/"!=r.charAt(0))if(this.b&&!this.a)r="/"+r;else{var i=t.a.lastIndexOf("/");-1!=i&&(r=t.a.substr(0,i+1)+r)}if(".."==(i=r)||"."==i)r="";else if(O(i,"./")||O(i,"/.")){r=0==i.lastIndexOf("/",0),i=i.split("/");for(var o=[],s=0;s<i.length;){var a=i[s++];"."==a?r&&s==i.length&&o.push(""):".."==a?((1<o.length||1==o.length&&""!=o[0])&&o.pop(),r&&s==i.length&&o.push("")):(o.push(a),r=!0)}r=o.join("/")}else r=i}return n?t.a=r:n=""!==e.c.toString(),n?Ft(t,en(e.c)):n=!!e.g,n&&(t.g=e.g),t};var zt=/[#\/\?@]/g,Wt=/[#\?:]/g,Qt=/[#\?]/g,Gt=/[#\?@]/g,Kt=/#/g;function $t(e,t){this.b=this.a=null,this.c=e||null,this.f=!!t}function Yt(e){e.a||(e.a=new Dt,e.b=0,e.c&&function(e,t){if(e){e=e.split("&");for(var n=0;n<e.length;n++){var r=e[n].indexOf("="),i=null;if(0<=r){var o=e[n].substring(0,r);i=e[n].substring(r+1)}else o=e[n];t(o,i?decodeURIComponent(i.replace(/\+/g," ")):"")}}}(e.c,function(t,n){e.add(decodeURIComponent(t.replace(/\+/g," ")),n)}))}function Zt(e,t){Yt(e),t=tn(e,t),At(e.a.b,t)&&(e.c=null,e.b-=e.a.get(t).length,xt(e.a,t))}function Jt(e,t){return Yt(e),t=tn(e,t),At(e.a.b,t)}function Xt(e,t,n){Zt(e,t),0<n.length&&(e.c=null,e.a.set(tn(e,t),D(n)),e.b+=n.length)}function en(e){var t=new $t;return t.c=e.c,e.a&&(t.a=new Dt(e.a),t.b=e.b),t}function tn(e,t){return t=String(t),e.f&&(t=t.toLowerCase()),t}function nn(e){this.a=e,this.b=this.h=null,this.g=!1,this.i=null,this.c=-1,this.l=this.f=null}function rn(e){var t=e.a.F.a;if(null!=t)Xe(4),t?(Xe(10),Qn(e.a,e,!1)):(Xe(11),Qn(e.a,e,!0));else{e.b=new ht(e,void 0,void 0),e.b.h=e.h,t=Zn(t=e.a,t.Y()?e.f:null,e.i),Xe(4),Vt(t,"TYPE","xmlhttp");var n=e.a.j,r=e.a.I;n&&r&&jt(t,n,r),gt(e.b,t,!1,e.f)}}function on(){this.a=this.b=null}function sn(){this.a=new Dt}function an(e){var t=typeof e;return"object"==t&&e||"function"==t?"o"+(e[m]||(e[m]=++g)):t.charAt(0)+e}function un(e,t){this.b=e,this.a=t}function ln(e){this.g=e||cn,e=s.PerformanceNavigationTiming?0<(e=s.performance.getEntriesByType("navigation")).length&&("hq"==e[0].nextHopProtocol||"h2"==e[0].nextHopProtocol):!!(s.ka&&s.ka.Ea&&s.ka.Ea()&&s.ka.Ea().zb),this.f=e?this.g:1,this.a=null,1<this.f&&(this.a=new sn),this.b=null,this.c=[]}(r=$t.prototype).add=function(e,t){Yt(this),this.c=null,e=tn(this,e);var n=this.a.get(e);return n||this.a.set(e,n=[]),n.push(t),this.b+=1,this},r.forEach=function(e,t){Yt(this),this.a.forEach(function(n,r){T(n,function(n){e.call(t,n,r,this)},this)},this)},r.K=function(){Yt(this);for(var e=this.a.C(),t=this.a.K(),n=[],r=0;r<t.length;r++)for(var i=e[r],o=0;o<i.length;o++)n.push(t[r]);return n},r.C=function(e){Yt(this);var t=[];if(a(e))Jt(this,e)&&(t=I(t,this.a.get(tn(this,e))));else{e=this.a.C();for(var n=0;n<e.length;n++)t=I(t,e[n])}return t},r.set=function(e,t){return Yt(this),this.c=null,Jt(this,e=tn(this,e))&&(this.b-=this.a.get(e).length),this.a.set(e,[t]),this.b+=1,this},r.get=function(e,t){return e&&0<(e=this.C(e)).length?String(e[0]):t},r.toString=function(){if(this.c)return this.c;if(!this.a)return"";for(var e=[],t=this.a.K(),n=0;n<t.length;n++){var r=t[n],i=encodeURIComponent(String(r));r=this.C(r);for(var o=0;o<r.length;o++){var s=i;""!==r[o]&&(s+="="+encodeURIComponent(String(r[o]))),e.push(s)}}return this.c=e.join("&")},S(function(){},function(){}),(r=nn.prototype).M=null,r.$=function(e){return this.a.$(e)},r.abort=function(){this.b&&(this.b.cancel(),this.b=null),this.c=-1},r.Da=function(){return!1},r.Ga=function(e,t){if(this.c=e.o,0==this.M){if(!this.a.o&&(e=e.a)){var n=Mn(e,"X-Client-Wire-Protocol");this.l=n||null,this.a.j&&(e=Mn(e,"X-HTTP-Session-Id"))&&(this.a.I=e)}if(t){try{var r=this.a.ja.a.parse(t)}catch(i){return(t=this.a).m=this.c,void $n(t,2)}this.f=r[0]}else(t=this.a).m=this.c,$n(t,2)}else 1==this.M&&(this.g?Xe(6):"11111"==t?(Xe(5),this.g=!0,(!H||10<=Number(J))&&(this.c=200,this.b.cancel(),Xe(11),Qn(this.a,this,!0))):(Xe(7),this.g=!1))},r.na=function(){if(this.c=this.b.o,this.b.b)0==this.M?(this.M=1,rn(this)):1==this.M&&(this.g?(Xe(11),Qn(this.a,this,!0)):(Xe(10),Qn(this.a,this,!1)));else{0==this.M?Xe(8):1==this.M&&Xe(9);var e=this.a;e.m=this.c,$n(e,2)}},r.Y=function(){return this.a.Y()},r.ma=function(){return this.a.ma()},sn.prototype.add=function(e){this.a.set(an(e),e)},sn.prototype.C=function(){return this.a.C()};var cn=10;function hn(e,t){!e.a&&(O(t,"spdy")||O(t,"quic")||O(t,"h2"))&&(e.f=e.g,e.a=new sn,e.b&&(mn(e,e.b),e.b=null))}function dn(e){return!!e.b||!!e.a&&e.a.a.c>=e.f}function fn(e){return e.b?1:e.a?e.a.a.c:0}function pn(e,t){return e.b?e=e.b==t:e.a?(t=an(t),e=At(e.a.a.b,t)):e=!1,e}function mn(e,t){e.a?e.a.add(t):e.b=t}function gn(e,t){var n;e.b&&e.b==t?e.b=null:((n=e.a)&&(n=an(t),n=At(e.a.a.b,n)),n&&xt(e.a.a,an(t)))}function yn(e){if(null!=e.b)return e.c.concat(e.b.j);if(null!=e.a&&0!=e.a.a.c){var t=e.c;return T(e.a.C(),function(e){t=t.concat(e.j)}),t}return D(e.c)}function bn(){}function vn(){this.a=new bn}function wn(e,t,n){var r=n||"";try{It(e,function(e,n){var i=e;p(e)&&(i=De(e)),t.push(r+n+"="+encodeURIComponent(i))})}catch(i){throw t.push(r+"type="+encodeURIComponent("_badmap")),i}}function _n(e,t,n,r,i){try{t.onload=null,t.onerror=null,t.onabort=null,t.ontimeout=null,i(r)}catch(o){}}ln.prototype.cancel=function(){this.c=yn(this),this.b?(this.b.cancel(),this.b=null):this.a&&0!=this.a.a.c&&
1(T(this.a.C(),function(e){e.cancel()}),function(e){e.b={},e.a.length=0,e.c=0}(this.a.a))},bn.prototype.stringify=function(e){return s.JSON.stringify(e,void 0)},bn.prototype.parse=function(e){return s.JSON.parse(e,void 0)};var Sn=s.JSON.parse;function En(e){Te.call(this),this.headers=new Dt,this.H=e||null,this.b=!1,this.s=this.a=null,this.A="",this.h=0,this.f="",this.g=this.w=this.l=this.v=!1,this.o=0,this.m=null,this.I=Cn,this.D=this.F=!1}S(En,Te);var Cn="",Tn=/^https?$/i,In=["POST","PUT"];function Dn(e){return"content-type"==e.toLowerCase()}function xn(e,t){e.b=!1,e.a&&(e.g=!0,e.a.abort(),e.g=!1),e.f=t,e.h=5,kn(e),On(e)}function kn(e){e.v||(e.v=!0,e.dispatchEvent("complete"),e.dispatchEvent("error"))}function An(e){if(e.b&&void 0!==o&&(!e.s[1]||4!=Rn(e)||2!=e.T()))if(e.l&&4==Rn(e))qe(e.Fa,0,e);else if(e.dispatchEvent("readystatechange"),4==Rn(e)){e.b=!1;try{var t,n=e.T();e:switch(n){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var r=!0;break e;default:r=!1}if(!(t=r)){var i;if(i=0===n){var a=String(e.A).match(Ot)[1]||null;if(!a&&s.self&&s.self.location){var u=s.self.location.protocol;a=u.substr(0,u.length-1)}i=!Tn.test(a?a.toLowerCase():"")}t=i}t?(e.dispatchEvent("complete"),e.dispatchEvent("success")):(e.h=6,e.f=e.za()+" ["+e.T()+"]",kn(e))}finally{On(e)}}}function On(e,t){if(e.a){Nn(e);var n=e.a,r=e.s[0]?c:null;e.a=null,e.s=null,t||e.dispatchEvent("ready");try{n.onreadystatechange=r}catch(i){}}}function Nn(e){e.a&&e.D&&(e.a.ontimeout=null),e.m&&(s.clearTimeout(e.m),e.m=null)}function Rn(e){return e.a?e.a.readyState:0}function Mn(e,t){return e.a?e.a.getResponseHeader(t):null}function Pn(e,t,n){e:{for(r in n){var r=!1;break e}r=!0}if(r)return e;if(n=function(e){var t="";return P(n,function(e,n){t+=n,t+=":",t+=e,t+="\r\n"}),t}(),a(e)){if(t=encodeURIComponent(String(t)),t+=n=null!=n?"="+encodeURIComponent(String(n)):""){if(0>(n=e.indexOf("#"))&&(n=e.length),0>(r=e.indexOf("?"))||r>n){r=n;var i=""}else i=e.substring(r+1,n);n=(e=[e.substr(0,r),i,e.substr(n)])[1],e[1]=t?n?n+"&"+t:t:n,e=e[0]+(e[1]?"?"+e[1]:"")+e[2]}return e}return jt(e,t,n),e}function Ln(e){this.f=[],this.F=new on,this.ga=this.pa=this.B=this.ha=this.a=this.I=this.j=this.V=this.g=this.J=this.i=null,this.Ra=this.P=0,this.Pa=!!l("internalChannelParams.failFast",e),this.ia=this.w=this.s=this.l=this.h=this.c=null,this.oa=!0,this.m=this.ra=this.O=-1,this.S=this.v=this.A=0,this.Oa=l("internalChannelParams.baseRetryDelayMs",e)||5e3,this.Sa=l("internalChannelParams.retryDelaySeedMs",e)||1e4,this.Qa=l("internalChannelParams.forwardChannelMaxRetries",e)||2,this.qa=l("internalChannelParams.forwardChannelRequestTimeoutMs",e)||2e4,this.La=e&&e.Ab||void 0,this.D=void 0,this.R=e&&e.supportsCrossDomainXhr||!1,this.H="",this.b=new ln(e&&e.concurrentRequestLimit),this.ja=new vn,this.o=!e||void 0===e.backgroundChannelTest||e.backgroundChannelTest,(this.W=e&&e.fastHandshake||!1)&&!this.o&&(this.o=!0),e&&e.forceLongPolling&&(this.oa=!1),this.fa=void 0}function Fn(e){if(jn(e),3==e.u){var t=e.P++,n=Rt(e.B);jt(n,"SID",e.H),jt(n,"RID",t),jt(n,"TYPE","terminate"),Bn(e,n),(t=new ht(e,t,void 0)).F=2,t.f=Ut(Rt(n)),n=!1,s.navigator&&s.navigator.sendBeacon&&(n=s.navigator.sendBeacon(t.f.toString(),"")),!n&&s.Image&&((new Image).src=t.f,n=!0),n||(t.a=t.g.$(null),t.a.ca(t.f)),t.v=_(),wt(t)}Yn(e)}function jn(e){e.w&&(e.w.abort(),e.w=null),e.a&&(e.a.cancel(),e.a=null),e.l&&(s.clearTimeout(e.l),e.l=null),Gn(e),e.b.cancel(),e.h&&(u(e.h)&&s.clearTimeout(e.h),e.h=null)}function Vn(e,t){e.f.push(new un(e.Ra++,t)),3==e.u&&Un(e)}function Un(e){dn(e.b)||e.h||(e.h=!0,Pe(e.Ia,e),e.A=0)}function qn(e,t){var n;n=t?t.W:e.P++;var r=Rt(e.B);jt(r,"SID",e.H),jt(r,"RID",n),jt(r,"AID",e.O),Bn(e,r),e.g&&e.i&&Pn(r,e.g,e.i),n=new ht(e,n,e.A+1),null===e.g&&(n.h=e.i),t&&(e.f=t.j.concat(e.f)),t=Hn(e,n,1e3),n.setTimeout(Math.round(.5*e.qa)+Math.round(.5*e.qa*Math.random())),mn(e.b,n),mt(n,r,t)}function Bn(e,t){e.c&&It({},function(e,n){jt(t,n,e)})}function Hn(e,t,n){n=Math.min(e.f.length,n);var r=e.c?v(e.c.Ta,e.c,e):null;e:for(var i=e.f,o=-1;;){var s=["count="+n];-1==o?0<n?s.push("ofs="+(o=i[0].b)):o=0:s.push("ofs="+o);for(var a=!0,u=0;u<n;u++){var l=i[u].b,c=i[u].a;if(0>(l-=o))o=Math.max(0,i[u].b-100),a=!1;else try{wn(c,s,"req"+l+"_")}catch(h){r&&r(c)}}if(a){r=s.join("&");break e}}return e=e.f.splice(0,n),t.j=e,r}function zn(e){e.a||e.l||(e.S=1,Pe(e.Ha,e),e.v=0)}function Wn(e){return!(e.a||e.l||3<=e.v||(e.S++,e.l=tt(v(e.Ha,e),Kn(e,e.v)),e.v++,0))}function Qn(e,t,n){var r=t.l;r&&hn(e.b,r),e.ia=e.oa&&n,e.m=t.c,e.B=Zn(e,null,e.ha),Un(e)}function Gn(e){null!=e.s&&(s.clearTimeout(e.s),e.s=null)}function Kn(e,t){var n=e.Oa+Math.floor(Math.random()*e.Sa);return e.ma()||(n*=2),n*t}function $n(e,t){if(2==t){var n=null;e.c&&(n=null);var r=v(e.fb,e);n||(n=new Nt("//www.google.com/images/cleardot.gif"),s.location&&"http"==s.location.protocol||Mt(n,"https"),Ut(n)),function(e,t){var n=new Ke;if(s.Image){var r=new Image;r.onload=w(_n,n,r,"TestLoadImage: loaded",!0,t),r.onerror=w(_n,n,r,"TestLoadImage: error",!1,t),r.onabort=w(_n,n,r,"TestLoadImage: abort",!1,t),r.ontimeout=w(_n,n,r,"TestLoadImage: timeout",!1,t),s.setTimeout(function(){r.ontimeout&&r.ontimeout()},1e4),r.src=e}else t(!1)}(n.toString(),r)}else Xe(2);e.u=0,e.c&&e.c.ta(t),Yn(e),jn(e)}function Yn(e){e.u=0,e.m=-1,e.c&&(0==yn(e.b).length&&0==e.f.length||(e.b.c.length=0,D(e.f),e.f.length=0),e.c.sa())}function Zn(e,t,n){var r=function(e){return e instanceof Nt?Rt(e):new Nt(e,void 0)}(n);if(""!=r.b)t&&Pt(r,t+"."+r.b),Lt(r,r.i);else{var i=s.location;r=function(e,t,n,r){var i=new Nt(null,void 0);return e&&Mt(i,e),t&&Pt(i,t),n&&Lt(i,n),r&&(i.a=r),i}(i.protocol,t?t+"."+i.hostname:i.hostname,+i.port,n)}return e.V&&P(e.V,function(e,t){jt(r,t,e)}),n=e.I,(t=e.j)&&n&&jt(r,t,n),jt(r,"VER",e.wa),Bn(e,r),r}function Jn(){}function Xn(){if(H&&!(10<=Number(J)))throw Error("Environmental error: no available transport.")}function er(e,t){Te.call(this),this.a=new Ln(t),this.g=e,this.m=t&&t.testUrl?t.testUrl:function(e){for(var t=arguments[0],n=1;n<arguments.length;n++){var r,i=arguments[n];0==i.lastIndexOf("/",0)?t=i:((r=""==t)||(r=0<=(r=t.length-1)&&t.indexOf("/",r)==r),t+=r?i:"/"+i)}return t}(this.g,"test"),this.b=t&&t.messageUrlParams||null,e=t&&t.messageHeaders||null,t&&t.clientProtocolHeaderRequired&&(e?e["X-Client-Protocol"]="webchannel":e={"X-Client-Protocol":"webchannel"}),this.a.i=e,e=t&&t.initMessageHeaders||null,t&&t.messageContentType&&(e?e["X-WebChannel-Content-Type"]=t.messageContentType:e={"X-WebChannel-Content-Type":t.messageContentType}),t&&t.xa&&(e?e["X-WebChannel-Client-Profile"]=t.xa:e={"X-WebChannel-Client-Profile":t.xa}),this.a.J=e,(e=t&&t.httpHeadersOverwriteParam)&&!x(e)&&(this.a.g=e),this.l=t&&t.supportsCrossDomainXhr||!1,this.h=t&&t.sendRawJson||!1,(t=t&&t.httpSessionIdParam)&&!x(t)&&(this.a.j=t,null!==(e=this.b)&&t in e&&t in(e=this.b)&&delete e[t]),this.f=new rr(this)}function tr(e){ut.call(this);var t=e.__sm__;if(t){e:{for(var n in t){e=n;break e}e=void 0}(this.c=e)?(e=this.c,this.data=null!==t&&e in t?t[e]:void 0):this.data=t}else this.data=e}function nr(){lt.call(this),this.status=1}function rr(e){this.a=e}(r=En.prototype).ca=function(e,t,n,r){if(this.a)throw Error("[goog.net.XhrIo] Object is active with another request="+this.A
1+"; newUri="+e);t=t?t.toUpperCase():"GET",this.A=e,this.f="",this.h=0,this.v=!1,this.b=!0,this.a=new XMLHttpRequest,this.s=function(e){var t;return(t=e.a)||(t=e.a={}),t}(this.H?this.H:st),this.a.onreadystatechange=v(this.Fa,this);try{this.w=!0,this.a.open(t,String(e),!0),this.w=!1}catch(o){return void xn(this,o)}e=n||"";var i=new Dt(this.headers);r&&It(r,function(e,t){i.set(t,e)}),r=function(e){e:{for(var t=Dn,n=e.length,r=a(e)?e.split(""):e,i=0;i<n;i++)if(i in r&&t.call(void 0,r[i],i,e)){t=i;break e}t=-1}return 0>t?null:a(e)?e.charAt(t):e[t]}(i.K()),n=s.FormData&&e instanceof s.FormData,!(0<=C(In,t))||r||n||i.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8"),i.forEach(function(e,t){this.a.setRequestHeader(t,e)},this),this.I&&(this.a.responseType=this.I),"withCredentials"in this.a&&this.a.withCredentials!==this.F&&(this.a.withCredentials=this.F);try{Nn(this),0<this.o&&((this.D=function(e){return H&&ee(9)&&u(e.timeout)&&void 0!==e.ontimeout}(this.a))?(this.a.timeout=this.o,this.a.ontimeout=v(this.Ca,this)):this.m=qe(this.Ca,this.o,this)),this.l=!0,this.a.send(e),this.l=!1}catch(o){xn(this,o)}},r.Ca=function(){void 0!==o&&this.a&&(this.f="Timed out after "+this.o+"ms, aborting",this.h=8,this.dispatchEvent("timeout"),this.abort(8))},r.abort=function(e){this.a&&this.b&&(this.b=!1,this.g=!0,this.a.abort(),this.g=!1,this.h=e||7,this.dispatchEvent("complete"),this.dispatchEvent("abort"),On(this))},r.G=function(){this.a&&(this.b&&(this.b=!1,this.g=!0,this.a.abort(),this.g=!1),On(this,!0)),En.N.G.call(this)},r.Fa=function(){this.j||(this.w||this.l||this.g?An(this):this.$a())},r.$a=function(){An(this)},r.T=function(){try{return 2<Rn(this)?this.a.status:-1}catch(q){return-1}},r.za=function(){try{return 2<Rn(this)?this.a.statusText:""}catch(q){return""}},r.aa=function(){try{return this.a?this.a.responseText:""}catch(q){return""}},r.Va=function(e){if(this.a){var t=this.a.responseText;return e&&0==t.indexOf(e)&&(t=t.substring(e.length)),Sn(t)}},r.ya=function(){return this.h},r.Ya=function(){return a(this.f)?this.f:String(this.f)},(r=Ln.prototype).wa=8,r.u=1,r.Da=function(){return 0==this.u},r.Ia=function(e){if(this.h)if(this.h=null,1==this.u){if(!e){this.P=Math.floor(1e5*Math.random());var t,n=new ht(this,e=this.P++,void 0),r=this.i;if(this.J&&(r?j(r=L(r),this.J):r=this.J),null===this.g&&(n.h=r),this.W)e:{for(var i=t=0;i<this.f.length;i++){var o=this.f[i];if(void 0===(o="__data__"in o.a&&a(o=o.a.__data__)?o.length:void 0))break;if(4096<(t+=o)){t=i;break e}if(4096===t||i===this.f.length-1){t=i+1;break e}}t=1e3}else t=1e3;t=Hn(this,n,t),jt(i=Rt(this.B),"RID",e),jt(i,"CVER",22),this.o&&this.j&&jt(i,"X-HTTP-Session-Id",this.j),Bn(this,i),this.g&&r&&Pn(i,this.g,r),mn(this.b,n),this.W?(jt(i,"$req",t),jt(i,"SID","null"),n.S=!0,mt(n,i,null)):mt(n,i,t),this.u=2}}else 3==this.u&&(e?qn(this,e):0==this.f.length||dn(this.b)||qn(this))},r.Ha=function(){this.l=null,this.a=new ht(this,"rpc",this.S),null===this.g&&(this.a.h=this.i),this.a.J=0;var e=Rt(this.pa);jt(e,"RID","rpc"),jt(e,"SID",this.H),jt(e,"CI",this.ia?"0":"1"),jt(e,"AID",this.O),Bn(this,e),jt(e,"TYPE","xmlhttp"),this.g&&this.i&&Pn(e,this.g,this.i),this.D&&this.a.setTimeout(this.D),gt(this.a,e,!0,this.ga)},r.Ga=function(e,t){if(0!=this.u&&(this.a==e||pn(this.b,e)))if(this.m=e.o,!e.s&&pn(this.b,e)&&3==this.u){try{var n=this.ja.a.parse(t)}catch(o){n=null}if(d(n)&&3==n.length){if(0==(t=n)[0]){e:if(!this.l){if(this.a){if(!(this.a.v+3e3<e.v))break e;Gn(this),this.a.cancel(),this.a=null}Wn(this),Xe(18)}}else this.ra=t[1],0<this.ra-this.O&&37500>t[2]&&this.ia&&0==this.v&&!this.s&&(this.s=tt(v(this.Za,this),6e3));if(1>=fn(this.b)&&this.fa){try{this.fa()}catch(o){}this.fa=void 0}}else $n(this,11)}else if((e.s||this.a==e)&&Gn(this),!x(t))for(t=n=this.ja.a.parse(t),n=0;n<t.length;n++){var r=t[n];if(this.O=r[0],r=r[1],2==this.u)if("c"==r[0]){this.H=r[1],this.ga=r[2];var i=r[3];null!=i&&(this.wa=i),null!=(r=r[5])&&u(r)&&0<r&&(this.D=1.5*r),this.o&&(r=e.a)&&((i=Mn(r,"X-Client-Wire-Protocol"))&&hn(this.b,i),this.j&&(r=Mn(r,"X-HTTP-Session-Id")))&&(this.I=r,jt(this.B,this.j,r)),this.u=3,this.c&&this.c.va(),r=e,this.pa=Zn(this,this.Y()?this.ga:null,this.ha),r.s?(gn(this.b,r),(i=this.D)&&r.setTimeout(i),r.i&&(St(r),wt(r)),this.a=r):zn(this),0<this.f.length&&Un(this)}else"stop"!=r[0]&&"close"!=r[0]||$n(this,7);else 3==this.u&&("stop"==r[0]||"close"==r[0]?"stop"==r[0]?$n(this,7):Fn(this):"noop"!=r[0]&&this.c&&this.c.ua(r),this.v=0)}},r.Za=function(){null!=this.s&&(this.s=null,this.a.cancel(),this.a=null,Wn(this),Xe(19))},r.na=function(e){var t=null;if(this.a==e){Gn(this),this.a=null;var n=2}else{if(!pn(this.b,e))return;t=e.j,gn(this.b,e),n=1}if(this.m=e.o,0!=this.u)if(e.b)1==n?(t=_()-e.v,$e.dispatchEvent(new et($e,e.l?e.l.length:0,t,this.A)),Un(this)):zn(this);else{var r=e.c;if(3==r||0==r&&0<this.m||!(1==n&&function(e,t){return!(fn(e.b)>=e.b.f-(e.h?1:0)||(e.h?(e.f=t.j.concat(e.f),0):1==e.u||2==e.u||e.A>=(e.Pa?0:e.Qa)||(e.h=tt(v(e.Ia,e,t),Kn(e,e.A)),e.A++,0)))}(this,e)||2==n&&Wn(this)))switch(t&&0<t.length&&(e=this.b,e.c=e.c.concat(t)),r){case 1:$n(this,5);break;case 4:$n(this,10);break;case 3:$n(this,6);break;default:$n(this,2)}}},r.fb=function(e){Xe(e?2:1)},r.$=function(e){if(e&&!this.R)throw Error("Can't create secondary domain capable XhrIo object.");return(e=new En(this.La)).F=this.R,e},r.ma=function(){return!!this.c&&!0},r.Y=function(){return this.R},(r=Jn.prototype).va=function(){},r.ua=function(){},r.ta=function(){},r.sa=function(){},r.Ta=function(){},Xn.prototype.a=function(e,t){return new er(e,t)},S(er,Te),(r=er.prototype).addEventListener=function(e,t,n,r){er.N.addEventListener.call(this,e,t,n,r)},r.removeEventListener=function(e,t,n,r){er.N.removeEventListener.call(this,e,t,n,r)},r.Wa=function(){this.a.c=this.f,this.l&&(this.a.R=!0);var e=this.a,t=this.m,n=this.g,r=this.b||void 0;Xe(0),e.ha=n,e.V=r||{}
1,e.o&&(e.F.b=[],e.F.a=!1),e.w=new nn(e),null===e.g&&(e.w.h=e.i),n=t,e.g&&e.i&&(n=Pn(t,e.g,e.i)),(e=e.w).i=n,t=Zn(e.a,null,e.i),Xe(3),null!=(n=e.a.F.b)?(e.f=n[0],e.M=1,rn(e)):(Vt(t,"MODE","init"),!e.a.o&&e.a.j&&Vt(t,"X-HTTP-Session-Id",e.a.j),e.b=new ht(e,void 0,void 0),e.b.h=e.h,gt(e.b,t,!1,null),e.M=0)},r.close=function(){Fn(this.a)},r.Xa=function(e){if(a(e)){var t={};t.__data__=e,Vn(this.a,t)}else this.h?((t={}).__data__=De(e),Vn(this.a,t)):Vn(this.a,e)},r.G=function(){this.a.c=null,delete this.f,Fn(this.a),delete this.a,er.N.G.call(this)},S(tr,ut),S(nr,lt),S(rr,Jn),rr.prototype.va=function(){this.a.dispatchEvent("a")},rr.prototype.ua=function(e){this.a.dispatchEvent(new tr(e))},rr.prototype.ta=function(e){this.a.dispatchEvent(new nr(e))},rr.prototype.sa=function(){this.a.dispatchEvent("b")};var ir=w(function(e,t){function n(){}n.prototype=e.prototype;var r=new n;return e.apply(r,Array.prototype.slice.call(arguments,1)),r},Xn);Xn.prototype.createWebChannel=Xn.prototype.a,er.prototype.send=er.prototype.Xa,er.prototype.open=er.prototype.Wa,er.prototype.close=er.prototype.close,nt.NO_ERROR=0,nt.TIMEOUT=8,nt.HTTP_ERROR=6,rt.COMPLETE="complete",ot.EventType=at,at.OPEN="a",at.CLOSE="b",at.ERROR="c",at.MESSAGE="d",Te.prototype.listen=Te.prototype.Aa,En.prototype.listenOnce=En.prototype.Ba,En.prototype.getLastError=En.prototype.Ya,En.prototype.getLastErrorCode=En.prototype.ya,En.prototype.getStatus=En.prototype.T,En.prototype.getStatusText=En.prototype.za,En.prototype.getResponseJson=En.prototype.Va,En.prototype.getResponseText=En.prototype.aa,En.prototype.send=En.prototype.ca;var or={createWebChannelTransport:ir,ErrorCode:nt,EventType:rt,WebChannel:ot,XhrIo:En},sr=or.createWebChannelTransport,ar=or.ErrorCode,ur=or.EventType,lr=or.WebChannel,cr=or.XhrIo;t.default=or},"yA/v":function(e,t,n){"use strict";n.d(t,"d",function(){return a}),n.d(t,"c",function(){return u}),n.d(t,"b",function(){return l}),n.d(t,"e",function(){return c}),n.d(t,"a",function(){return h}),n("mrSG");var r,i=n("8Y7J"),o=n("Wcq6"),s=n.n(o);const a=new i.p("angularfire2.app.options"),u=new i.p("angularfire2.app.nameOrConfig");class l{}function c(e,t){const n="object"==typeof t&&t||{};return n.name=n.name||"string"==typeof t&&t||"[DEFAULT]",s.a.apps.filter(e=>e&&e.name===n.name)[0]||s.a.initializeApp(e,n)}let h=r=class{static initializeApp(e,t){return{ngModule:r,providers:[{provide:a,useValue:e},{provide:u,useValue:t}]}}}},yCtX:function(e,t,n){"use strict";n.d(t,"a",function(){return s});var r=n("HDdC"),i=n("ngJS"),o=n("jZKg");function s(e,t){return t?Object(o.a)(e,t):new r.a(Object(i.a)(e))}},"z+Ro":function(e,t,n){"use strict";function r(e){return e&&"function"==typeof e.schedule}n.d(t,"a",function(){return r})},zUnb:function(e,t,n){"use strict";n.r(t);var r=n("8Y7J");class i{}var o=n("SVse"),s=n("LRne"),a=n("Cfvw"),u=n("XNiG"),l=n("9ppp");class c extends u.a{constructor(e){super(),this._value=e}get value(){return this.getValue()}_subscribe(e){const t=super._subscribe(e);return t&&!t.closed&&e.next(this._value),t}getValue(){if(this.hasError)throw this.thrownError;if(this.closed)throw new l.a;return this._value}next(e){super.next(this._value=e)}}var h=n("HDdC");const d=(()=>{function e(){return Error.call(this),this.message="no elements in sequence",this.name="EmptyError",this}return e.prototype=Object.create(Error.prototype),e})();var f=n("z+Ro"),p=n("DH7j"),m=n("l7GE"),g=n("ZUHj"),y=n("yCtX");const b={};class v{constructor(e){this.resultSelector=e}call(e,t){return t.subscribe(new w(e,this.resultSelector))}}class w extends m.a{constructor(e,t){super(e),this.resultSelector=t,this.active=0,this.values=[],this.observables=[]}_next(e){this.values.push(b),this.observables.push(e)}_complete(){const e=this.observables,t=e.length;if(0===t)this.destination.complete();else{this.active=t,this.toRespond=t;for(let n=0;n<t;n++){const t=e[n];this.add(Object(g.a)(this,t,t,n))}}}notifyComplete(e){0==(this.active-=1)&&this.destination.complete()}notifyNext(e,t,n,r,i){const o=this.values,s=this.toRespond?o[n]===b?--this.toRespond:this.toRespond:0;o[n]=t,0===s&&(this.resultSelector?this._tryResultSelector(o):this.destination.next(o.slice()))}_tryResultSelector(e){let t;try{t=this.resultSelector.apply(this,e)}catch(n){return void this.destination.error(n)}this.destination.next(t)}}const _=new h.a(e=>e.complete());function S(e){return e?function(e){return new h.a(t=>e.schedule(()=>t.complete()))}(e):_}function E(e){return new h.a(t=>{let n;try{n=e()}catch(r){return void t.error(r)}return(n?Object(a.a)(n):S()).subscribe(t)})}var C=n("lJxs"),T=n("bHdf");function I(){return Object(T.a)(1)}var D=n("pLZG"),x=n("7o/Q");const k=(()=>{function e(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return e.prototype=Object.create(Error.prototype),e})();function A(e){return function(t){return 0===e?S():t.lift(new O(e))}}class O{constructor(e){if(this.total=e,this.total<0)throw new k}call(e,t){return t.subscribe(new N(e,this.total))}}class N extends x.a{constructor(e,t){super(e),this.total=t,this.ring=new Array,this.count=0}_next(e){const t=this.ring,n=this.total,r=this.count++;t.length<n?t.push(e):t[r%n]=e}_complete(){const e=this.destination;let t=this.count;if(t>0){const n=this.count>=this.total?this.total:this.count,r=this.ring;for(let i=0;i<n;i++){const i=t++%n;e.next(r[i])}}e.complete()}}function R(e=function(){return new d}){return t=>t.lift(new M(e))}class M{constructor(e){this.errorFactory=e}
1call(e,t){return t.subscribe(new P(e,this.errorFactory))}}class P extends x.a{constructor(e,t){super(e),this.errorFactory=t,this.hasValue=!1}_next(e){this.hasValue=!0,this.destination.next(e)}_complete(){if(this.hasValue)return this.destination.complete();{let t;try{t=this.errorFactory()}catch(e){t=e}this.destination.error(t)}}}function L(e=null){return t=>t.lift(new F(e))}class F{constructor(e){this.defaultValue=e}call(e,t){return t.subscribe(new j(e,this.defaultValue))}}class j extends x.a{constructor(e,t){super(e),this.defaultValue=t,this.isEmpty=!0}_next(e){this.isEmpty=!1,this.destination.next(e)}_complete(){this.isEmpty&&this.destination.next(this.defaultValue),this.destination.complete()}}var V=n("SpAZ");function U(e,t){const n=arguments.length>=2;return r=>r.pipe(e?Object(D.a)((t,n)=>e(t,n,r)):V.a,A(1),n?L(t):R(()=>new d))}var q=n("51Dv");function B(e){return function(t){const n=new H(e),r=t.lift(n);return n.caught=r}}class H{constructor(e){this.selector=e}call(e,t){return t.subscribe(new z(e,this.selector,this.caught))}}class z extends m.a{constructor(e,t,n){super(e),this.selector=t,this.caught=n}error(e){if(!this.isStopped){let n;try{n=this.selector(e,this.caught)}catch(t){return void super.error(t)}this._unsubscribeAndRecycle();const r=new q.a(this,void 0,void 0);this.add(r),Object(g.a)(this,n,void 0,void 0,r)}}}function W(e){return t=>0===e?S():t.lift(new Q(e))}class Q{constructor(e){if(this.total=e,this.total<0)throw new k}call(e,t){return t.subscribe(new G(e,this.total))}}class G extends x.a{constructor(e,t){super(e),this.total=t,this.count=0}_next(e){const t=this.total,n=++this.count;n<=t&&(this.destination.next(e),n===t&&(this.destination.complete(),this.unsubscribe()))}}function K(e,t){const n=arguments.length>=2;return r=>r.pipe(e?Object(D.a)((t,n)=>e(t,n,r)):V.a,W(1),n?L(t):R(()=>new d))}var $=n("5+tZ");class Y{constructor(e,t,n){this.predicate=e,this.thisArg=t,this.source=n}call(e,t){return t.subscribe(new Z(e,this.predicate,this.thisArg,this.source))}}class Z extends x.a{constructor(e,t,n,r){super(e),this.predicate=t,this.thisArg=n,this.source=r,this.index=0,this.thisArg=n||this}notifyComplete(e){this.destination.next(e),this.destination.complete()}_next(e){let t=!1;try{t=this.predicate.call(this.thisArg,e,this.index++,this.source)}catch(n){return void this.destination.error(n)}t||this.notifyComplete(!1)}_complete(){this.notifyComplete(!0)}}function J(e,t){return"function"==typeof t?n=>n.pipe(J((n,r)=>Object(a.a)(e(n,r)).pipe(Object(C.a)((e,i)=>t(n,e,r,i))))):t=>t.lift(new X(e))}class X{constructor(e){this.project=e}call(e,t){return t.subscribe(new ee(e,this.project))}}class ee extends m.a{constructor(e,t){super(e),this.project=t,this.index=0}_next(e){let t;const n=this.index++;try{t=this.project(e,n)}catch(r){return void this.destination.error(r)}this._innerSub(t,e,n)}_innerSub(e,t,n){const r=this.innerSubscription;r&&r.unsubscribe();const i=new q.a(this,void 0,void 0);this.destination.add(i),this.innerSubscription=Object(g.a)(this,e,t,n,i)}_complete(){const{innerSubscription:e}=this;e&&!e.closed||super._complete(),this.unsubscribe()}_unsubscribe(){this.innerSubscription=null}notifyComplete(e){this.destination.remove(e),this.innerSubscription=null,this.isStopped&&super._complete()}notifyNext(e,t,n,r,i){this.destination.next(t)}}function te(...e){return I()(Object(s.a)(...e))}var ne=n("Kqap");function re(e,t){return Object($.a)(e,t,1)}var ie=n("mCNh"),oe=n("KqfI"),se=n("n6bG");function ae(e,t,n){return function(r){return r.lift(new ue(e,t,n))}}class ue{constructor(e,t,n){this.nextOrObserver=e,this.error=t,this.complete=n}call(e,t){return t.subscribe(new le(e,this.nextOrObserver,this.error,this.complete))}}class le extends x.a{constructor(e,t,n,r){super(e),this._tapNext=oe.a,this._tapError=oe.a,this._tapComplete=oe.a,this._tapError=n||oe.a,this._tapComplete=r||oe.a,Object(se.a)(t)?(this._context=this,this._tapNext=t):t&&(this._context=t,this._tapNext=t.next||oe.a,this._tapError=t.error||oe.a,this._tapComplete=t.complete||oe.a)}_next(e){try{this._tapNext.call(this._context,e)}catch(t){return void this.destination.error(t)}this.destination.next(e)}_error(e){try{this._tapError.call(this._context,e)}catch(e){return void this.destination.error(e)}this.destination.error(e)}_complete(){try{this._tapComplete.call(this._context)}catch(e){return void this.destination.error(e)}return this.destination.complete()}}var ce=n("quSY");class he{constructor(e){this.callback=e}call(e,t){return t.subscribe(new de(e,this.callback))}}class de extends x.a{constructor(e,t){super(e),this.add(new ce.a(t))}}let fe=null;function pe(){return fe}class me{constructor(){this.resourceLoaderType=null}
vendor: 6,477 bytes, line 1
1get attrToPropMap(){return this._attrToPropMap}set attrToPropMap(e){this._attrToPropMap=e}}class ge extends me{constructor(){super(),this._animationPrefix=null,this._transitionEnd=null;try{const t=this.createElement("div",document);if(null!=this.getStyle(t,"animationName"))this._animationPrefix="";else{const e=["Webkit","Moz","O","ms"];for(let n=0;n<e.length;n++)if(null!=this.getStyle(t,e[n]+"AnimationName")){this._animationPrefix="-"+e[n].toLowerCase()+"-";break}}const n={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};Object.keys(n).forEach(e=>{null!=this.getStyle(t,e)&&(this._transitionEnd=n[e])})}catch(e){this._animationPrefix=null,this._transitionEnd=null}}getDistributedNodes(e){return e.getDistributedNodes()}resolveAndSetHref(e,t,n){e.href=null==n?t:t+"/../"+n}supportsDOMEvents(){return!0}supportsNativeShadowDOM(){return"function"==typeof document.body.createShadowRoot}getAnimationPrefix(){return this._animationPrefix?this._animationPrefix:""}getTransitionEnd(){return this._transitionEnd?this._transitionEnd:""}supportsAnimation(){return null!=this._animationPrefix&&null!=this._transitionEnd}}const ye={class:"className",innerHtml:"innerHTML",readonly:"readOnly",tabindex:"tabIndex"},be=3,ve={"\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"},we={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"},_e=(()=>{if(r.vb.Node)return r.vb.Node.prototype.contains||function(e){return!!(16&this.compareDocumentPosition(e))}})();class Se extends ge{parse(e){throw new Error("parse not implemented")}static makeCurrent(){var e;e=new Se,fe||(fe=e)}hasProperty(e,t){return t in e}setProperty(e,t,n){e[t]=n}getProperty(e,t){return e[t]}invoke(e,t,n){e[t](...n)}logError(e){window.console&&(console.error?console.error(e):console.log(e))}log(e){window.console&&window.console.log&&window.console.log(e)}logGroup(e){window.console&&window.console.group&&window.console.group(e)}logGroupEnd(){window.console&&window.console.groupEnd&&window.console.groupEnd()}get attrToPropMap(){return ye}contains(e,t){return _e.call(e,t)}querySelector(e,t){return e.querySelector(t)}querySelectorAll(e,t){return e.querySelectorAll(t)}on(e,t,n){e.addEventListener(t,n,!1)}onAndCancel(e,t,n){return e.addEventListener(t,n,!1),()=>{e.removeEventListener(t,n,!1)}}dispatchEvent(e,t){e.dispatchEvent(t)}createMouseEvent(e){const t=this.getDefaultDocument().createEvent("MouseEvent");return t.initEvent(e,!0,!0),t}createEvent(e){const t=this.getDefaultDocument().createEvent("Event");return t.initEvent(e,!0,!0),t}preventDefault(e){e.preventDefault(),e.returnValue=!1}isPrevented(e){return e.defaultPrevented||null!=e.returnValue&&!e.returnValue}getInnerHTML(e){return e.innerHTML}getTemplateContent(e){return"content"in e&&this.isTemplateElement(e)?e.content:null}getOuterHTML(e){return e.outerHTML}nodeName(e){return e.nodeName}nodeValue(e){return e.nodeValue}type(e){return e.type}content(e){return this.hasProperty(e,"content")?e.content:e}firstChild(e){return e.firstChild}nextSibling(e){return e.nextSibling}parentElement(e){return e.parentNode}childNodes(e){return e.childNodes}childNodesAsList(e){const t=e.childNodes,n=new Array(t.length);for(let r=0;r<t.length;r++)n[r]=t[r];return n}clearNodes(e){for(;e.firstChild;)e.removeChild(e.firstChild)}appendChild(e,t){e.appendChild(t)}removeChild(e,t){e.removeChild(t)}replaceChild(e,t,n){e.replaceChild(t,n)}remove(e){return e.parentNode&&e.parentNode.removeChild(e),e}insertBefore(e,t,n){e.insertBefore(n,t)}insertAllBefore(e,t,n){n.forEach(n=>e.insertBefore(n,t))}insertAfter(e,t,n){e.insertBefore(n,t.nextSibling)}setInnerHTML(e,t){e.innerHTML=t}getText(e){return e.textContent}setText(e,t){e.textContent=t}getValue(e){return e.value}setValue(e,t){e.value=t}getChecked(e){return e.checked}setChecked(e,t){e.checked=t}createComment(e){return this.getDefaultDocument().createComment(e)}createTemplate(e){const t=this.getDefaultDocument().createElement("template");return t.innerHTML=e,t}createElement(e,t){return(t=t||this.getDefaultDocument()).createElement(e)}createElementNS(e,t,n){return(n=n||this.getDefaultDocument()).createElementNS(e,t)}createTextNode(e,t){return(t=t||this.getDefaultDocument()).createTextNode(e)}createScriptTag(e,t,n){const r=(n=n||this.getDefaultDocument()).createElement("SCRIPT");return r.setAttribute(e,t),r}createStyleElement(e,t){const n=(t=t||this.getDefaultDocument()).createElement("style");return this.appendChild(n,this.createTextNode(e,t)),n}createShadowRoot(e){return e.createShadowRoot()}getShadowRoot(e){return e.shadowRoot}getHost(e){return e.host}clone(e){return e.cloneNode(!0)}getElementsByClassName(e,t){return e.getElementsByClassName(t)}getElementsByTagName(e,t){return e.getElementsByTagName(t)}classList(e){return Array.prototype.slice.call(e.classList,0)}addClass(e,t){e.classList.add(t)}removeClass(e,t){e.classList.remove(t)}hasClass(e,t){return e.classList.contains(t)}setStyle(e,t,n){e.style[t]=n}removeStyle(e,t){e.style[t]=""}getStyle(e,t){return e.style[t]}hasStyle(e,t,n){const r=this.getStyle(e,t)||"";return n?r==n:r.length>0}tagName(e){return e.tagName}attributeMap(e){const t=new Map,n=e.attributes;for(let r=0;r<n.length;r++){const e=n.item(r);t.set(e.name,e.value)}return t}hasAttribute(e,t){return e.hasAttribute(t)}hasAttributeNS(e,t,n){return e.hasAttributeNS(t,n)}getAttribute(e,t){return e.getAttribute(t)}getAttributeNS(e,t,n){return e.getAttributeNS(t,n)}setAttribute(e,t,n){e.setAttribute(t,n)}setAttributeNS(e,t,n,r){e.setAttributeNS(t,n,r)}removeAttribute(e,t){e.removeAttribute(t)}removeAttributeNS(e,t,n){e.removeAttributeNS(t,n)}templateAwareRoot(e){return this.isTemplateElement(e)?this.content(e):e}createHtmlDocument(){return document.implementation.createHTMLDocument("fakeTitle")}getDefaultDocument(){return document}getBoundingClientRect(e){try{return e.getBoundingClientRect()}catch(t){return{top:0,bottom:0,left:0,right:0,width:0,height:0}}}getTitle(e){return e.title}setTitle(e,t){e.title=t||""}elementMatches(e,t){return!!this.isElementNode(e)&&(e.matches&&e.matches(t)||e.msMatchesSelector&&e.msMatchesSelector(t)||e.webkitMatchesSelector&&e.webkitMatchesSelector(t))}isTemplateElement(e){return this.isElementNode(e)&&"TEMPLATE"===e.nodeName}
1isTextNode(e){return e.nodeType===Node.TEXT_NODE}isCommentNode(e){return e.nodeType===Node.COMMENT_NODE}isElementNode(e){return e.nodeType===Node.ELEMENT_NODE}hasShadowRoot(e){return null!=e.shadowRoot&&e instanceof HTMLElement}isShadowRoot(e){return e instanceof DocumentFragment}importIntoDoc(e){return document.importNode(this.templateAwareRoot(e),!0)}adoptNode(e){return document.adoptNode(e)}getHref(e){return e.getAttribute("href")}getEventKey(e){let t=e.key;if(null==t){if(null==(t=e.keyIdentifier))return"Unidentified";t.startsWith("U+")&&(t=String.fromCharCode(parseInt(t.substring(2),16)),e.location===be&&we.hasOwnProperty(t)&&(t=we[t]))}return ve[t]||t}getGlobalEventTarget(e,t){return"window"===t?window:"document"===t?e:"body"===t?e.body:null}getHistory(){return window.history}getLocation(){return window.location}getBaseHref(e){const t=Ce||(Ce=document.querySelector("base"))?Ce.getAttribute("href"):null;return null==t?null:(n=t,Ee||(Ee=document.createElement("a")),Ee.setAttribute("href",n),"/"===Ee.pathname.charAt(0)?Ee.pathname:"/"+Ee.pathname);var n}resetBaseElement(){Ce=null}getUserAgent(){return window.navigator.userAgent}setData(e,t,n){this.setAttribute(e,"data-"+t,n)}getData(e,t){return this.getAttribute(e,"data-"+t)}getComputedStyle(e){return getComputedStyle(e)}supportsWebAnimation(){return"function"==typeof Element.prototype.animate}performanceNow(){return window.performance&&window.performance.now?window.performance.now():(new Date).getTime()}supportsCookies(){return!0}getCookie(e){return Object(o.A)(document.cookie,e)}setCookie(e,t){document.cookie=encodeURIComponent(e)+"="+encodeURIComponent(t)}}let Ee,Ce=null;function Te(){return!!window.history.pushState}const Ie=new r.p("TRANSITION_ID");function De(e,t,n){return()=>{n.get(r.e).donePromise.then(()=>{const n=pe();Array.prototype.slice.apply(n.querySelectorAll(t,"style[ng-transition]")).filter(t=>n.getAttribute(t,"ng-transition")===e).forEach(e=>n.remove(e))})}}const xe=[{provide:r.d,useFactory:De,deps:[Ie,o.c,r.q],multi:!0}];class ke{static init(){Object(r.Z)(new ke)}addToWindow(e){r.vb.getAngularTestability=(t,n=!0)=>{const r=e.findTestabilityInTree(t,n);if(null==r)throw new Error("Could not find testability for element.");return r},r.vb.getAllAngularTestabilities=()=>e.getAllTestabilities(),r.vb.getAllAngularRootElements=()=>e.getAllRootElements(),r.vb.frameworkStabilizers||(r.vb.frameworkStabilizers=[]),r.vb.frameworkStabilizers.push(e=>{const t=r.vb.getAllAngularTestabilities();let n=t.length,i=!1;const o=function(t){i=i||t,0==--n&&e(i)};t.forEach(function(e){e.whenStable(o)})})}findTestabilityInTree(e,t,n){if(null==t)return null;const r=e.getTestability(t);return null!=r?r:n?pe().isShadowRoot(t)?this.findTestabilityInTree(e,pe().getHost(t),!0):this.findTestabilityInTree(e,pe().parentElement(t),!0):null}}function Ae(e,t){"undefined"!=typeof COMPILED&&COMPILED||((r.vb.ng=r.vb.ng||{})[e]=t)}const Oe=(()=>({ApplicationRef:r.g,NgZone:r.y}))();function Ne(e){return Object(r.V)(e)}const Re=new r.p("EventManagerPlugins");class Me{constructor(e,t){this._zone=t,this._eventNameToPlugin=new Map,e.forEach(e=>e.manager=this),this._plugins=e.slice().reverse()}addEventListener(e,t,n){return this._findPluginFor(t).addEventListener(e,t,n)}addGlobalEventListener(e,t,n){return this._findPluginFor(t).addGlobalEventListener(e,t,n)}getZone(){return this._zone}_findPluginFor(e){const t=this._eventNameToPlugin.get(e);if(t)return t;const n=this._plugins;for(let r=0;r<n.length;r++){const t=n[r];if(t.supports(e))return this._eventNameToPlugin.set(e,t),t}throw new Error(`No event manager plugin found for event ${e}`)}}class Pe{constructor(e){this._doc=e}addGlobalEventListener(e,t,n){const r=pe().getGlobalEventTarget(this._doc,e);if(!r)throw new Error(`Unsupported event target ${r} for event ${t}`);return this.addEventListener(r,t,n)}}class Le{constructor(){this._stylesSet=new Set}addStyles(e){const t=new Set;e.forEach(e=>{this._stylesSet.has(e)||(this._stylesSet.add(e),t.add(e))}),this.onStylesAdded(t)}onStylesAdded(e){}getAllStyles(){return Array.from(this._stylesSet)}}class Fe extends Le{constructor(e){super(),this._doc=e,this._hostNodes=new Set,this._styleNodes=new Set,this._hostNodes.add(e.head)}
vendor: 34,799 bytes, line 1
1_addStylesToHost(e,t){e.forEach(e=>{const n=this._doc.createElement("style");n.textContent=e,this._styleNodes.add(t.appendChild(n))})}addHost(e){this._addStylesToHost(this._stylesSet,e),this._hostNodes.add(e)}removeHost(e){this._hostNodes.delete(e)}onStylesAdded(e){this._hostNodes.forEach(t=>this._addStylesToHost(e,t))}ngOnDestroy(){this._styleNodes.forEach(e=>pe().remove(e))}}const je={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/"},Ve=/%COMP%/g,Ue="_nghost-%COMP%",qe="_ngcontent-%COMP%";function Be(e,t,n){for(let r=0;r<t.length;r++){let i=t[r];Array.isArray(i)?Be(e,i,n):(i=i.replace(Ve,e),n.push(i))}return n}function He(e){return t=>{!1===e(t)&&(t.preventDefault(),t.returnValue=!1)}}class ze{constructor(e,t,n){this.eventManager=e,this.sharedStylesHost=t,this.appId=n,this.rendererByCompId=new Map,this.defaultRenderer=new We(e)}createRenderer(e,t){if(!e||!t)return this.defaultRenderer;switch(t.encapsulation){case r.P.Emulated:{let n=this.rendererByCompId.get(t.id);return n||(n=new Ke(this.eventManager,this.sharedStylesHost,t,this.appId),this.rendererByCompId.set(t.id,n)),n.applyToHost(e),n}case r.P.Native:case r.P.ShadowDom:return new $e(this.eventManager,this.sharedStylesHost,e,t);default:if(!this.rendererByCompId.has(t.id)){const e=Be(t.id,t.styles,[]);this.sharedStylesHost.addStyles(e),this.rendererByCompId.set(t.id,this.defaultRenderer)}return this.defaultRenderer}}begin(){}end(){}}class We{constructor(e){this.eventManager=e,this.data=Object.create(null)}destroy(){}createElement(e,t){return t?document.createElementNS(je[t]||t,e):document.createElement(e)}createComment(e){return document.createComment(e)}createText(e){return document.createTextNode(e)}appendChild(e,t){e.appendChild(t)}insertBefore(e,t,n){e&&e.insertBefore(t,n)}removeChild(e,t){e&&e.removeChild(t)}selectRootElement(e,t){let n="string"==typeof e?document.querySelector(e):e;if(!n)throw new Error(`The selector "${e}" did not match any elements`);return t||(n.textContent=""),n}parentNode(e){return e.parentNode}nextSibling(e){return e.nextSibling}setAttribute(e,t,n,r){if(r){t=r+":"+t;const i=je[r];i?e.setAttributeNS(i,t,n):e.setAttribute(t,n)}else e.setAttribute(t,n)}removeAttribute(e,t,n){if(n){const r=je[n];r?e.removeAttributeNS(r,t):e.removeAttribute(`${n}:${t}`)}else e.removeAttribute(t)}addClass(e,t){e.classList.add(t)}removeClass(e,t){e.classList.remove(t)}setStyle(e,t,n,i){i&r.F.DashCase?e.style.setProperty(t,n,i&r.F.Important?"important":""):e.style[t]=n}removeStyle(e,t,n){n&r.F.DashCase?e.style.removeProperty(t):e.style[t]=""}setProperty(e,t,n){Ge(t,"property"),e[t]=n}setValue(e,t){e.nodeValue=t}listen(e,t,n){return Ge(t,"listener"),"string"==typeof e?this.eventManager.addGlobalEventListener(e,t,He(n)):this.eventManager.addEventListener(e,t,He(n))}}const Qe=(()=>"@".charCodeAt(0))();function Ge(e,t){if(e.charCodeAt(0)===Qe)throw new Error(`Found the synthetic ${t} ${e}. Please include either "BrowserAnimationsModule" or "NoopAnimationsModule" in your application.`)}class Ke extends We{constructor(e,t,n,r){super(e),this.component=n;const i=Be(r+"-"+n.id,n.styles,[]);t.addStyles(i),this.contentAttr=qe.replace(Ve,r+"-"+n.id),this.hostAttr=Ue.replace(Ve,r+"-"+n.id)}applyToHost(e){super.setAttribute(e,this.hostAttr,"")}createElement(e,t){const n=super.createElement(e,t);return super.setAttribute(n,this.contentAttr,""),n}}class $e extends We{constructor(e,t,n,i){super(e),this.sharedStylesHost=t,this.hostEl=n,this.component=i,this.shadowRoot=i.encapsulation===r.P.ShadowDom?n.attachShadow({mode:"open"}):n.createShadowRoot(),this.sharedStylesHost.addHost(this.shadowRoot);const o=Be(i.id,i.styles,[]);for(let r=0;r<o.length;r++){const e=document.createElement("style");e.textContent=o[r],this.shadowRoot.appendChild(e)}}nodeOrShadowRoot(e){return e===this.hostEl?this.shadowRoot:e}destroy(){this.sharedStylesHost.removeHost(this.shadowRoot)}appendChild(e,t){return super.appendChild(this.nodeOrShadowRoot(e),t)}insertBefore(e,t,n){return super.insertBefore(this.nodeOrShadowRoot(e),t,n)}removeChild(e,t){return super.removeChild(this.nodeOrShadowRoot(e),t)}parentNode(e){return this.nodeOrShadowRoot(super.parentNode(this.nodeOrShadowRoot(e)))}}const Ye=(()=>"undefined"!=typeof Zone&&Zone.__symbol__||function(e){return"__zone_symbol__"+e})(),Ze=Ye("addEventListener"),Je=Ye("removeEventListener"),Xe={},et="FALSE",tt="ANGULAR",nt="addEventListener",rt="removeEventListener",it="__zone_symbol__propagationStopped",ot="__zone_symbol__stopImmediatePropagation",st=(()=>{const e="undefined"!=typeof Zone&&Zone[Ye("BLACK_LISTED_EVENTS")];if(e){const t={};return e.forEach(e=>{t[e]=e}),t}})(),at=function(e){return!!st&&st.hasOwnProperty(e)},ut=function(e){const t=Xe[e.type];if(!t)return;const n=this[t];if(!n)return;const r=[e];if(1===n.length){const e=n[0];return e.zone!==Zone.current?e.zone.run(e.handler,this,r):e.handler.apply(this,r)}{const t=n.slice();for(let n=0;n<t.length&&!0!==e[it];n++){const e=t[n];e.zone!==Zone.current?e.zone.run(e.handler,this,r):e.handler.apply(this,r)}}};class lt extends Pe{constructor(e,t,n){super(e),this.ngZone=t,n&&Object(o.x)(n)||this.patchEvent()}patchEvent(){if("undefined"==typeof Event||!Event||!Event.prototype)return;if(Event.prototype[ot])return;const e=Event.prototype[ot]=Event.prototype.stopImmediatePropagation;Event.prototype.stopImmediatePropagation=function(){this&&(this[it]=!0),e&&e.apply(this,arguments)}}supports(e){return!0}addEventListener(e,t,n){let i=n;if(!e[Ze]||r.y.isInAngularZone()&&!at(t))e[nt](t,i,!1);else{let n=Xe[t];n||(n=Xe[t]=Ye(tt+t+et));let r=e[n];const o=r&&r.length>0;r||(r=e[n]=[]);const s=at(t)?Zone.root:Zone.current;if(0===r.length)r.push({zone:s,handler:i});else{let e=!1;for(let t=0;t<r.length;t++)if(r[t].handler===i){e=!0;break}e||r.push({zone:s,handler:i})}o||e[Ze](t,ut,!1)}return()=>this.removeEventListener(e,t,i)}removeEventListener(e,t,n){let r=e[Je];if(!r)return e[rt].apply(e,[t,n,!1]);let i=Xe[t],o=i&&e[i];if(!o)return e[rt].apply(e,[t,n,!1]);let s=!1;for(let a=0;a<o.length;a++)if(o[a].handler===n){s=!0,o.splice(a,1);break}s?0===o.length&&r.apply(e,[t,ut,!1]):e[rt].apply(e,[t,n,!1])}}const ct={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},ht=new r.p("HammerGestureConfig"),dt=new r.p("HammerLoader");class ft{constructor(){this.events=[],this.overrides={}}buildHammer(e){const t=new Hammer(e,this.options);t.get("pinch").set({enable:!0}),t.get("rotate").set({enable:!0});for(const n in this.overrides)t.get(n).set(this.overrides[n]);return t}}class pt extends Pe{constructor(e,t,n,r){super(e),this._config=t,this.console=n,this.loader=r}supports(e){return!(!ct.hasOwnProperty(e.toLowerCase())&&!this.isCustomEvent(e)||!window.Hammer&&!this.loader&&(this.console.warn(`The "${e}" event cannot be bound because Hammer.JS is not `+"loaded and no custom loader has been specified."),1))}addEventListener(e,t,n){const r=this.manager.getZone();if(t=t.toLowerCase(),!window.Hammer&&this.loader){let r=!1,i=()=>{r=!0};return this.loader().then(()=>{if(!window.Hammer)return this.console.warn("The custom HAMMER_LOADER completed, but Hammer.JS is not present."),void(i=()=>{});r||(i=this.addEventListener(e,t,n))}).catch(()=>{this.console.warn(`The "${t}" event cannot be bound because the custom `+"Hammer.JS loader failed."),i=()=>{}}),()=>{i()}}return r.runOutsideAngular(()=>{const i=this._config.buildHammer(e),o=function(e){r.runGuarded(function(){n(e)})};return i.on(t,o),()=>{i.off(t,o),"function"==typeof i.destroy&&i.destroy()}})}isCustomEvent(e){return this._config.events.indexOf(e)>-1}}const mt=["alt","control","meta","shift"],gt={alt:e=>e.altKey,control:e=>e.ctrlKey,meta:e=>e.metaKey,shift:e=>e.shiftKey};class yt extends Pe{constructor(e){super(e)}supports(e){return null!=yt.parseEventName(e)}addEventListener(e,t,n){const r=yt.parseEventName(t),i=yt.eventCallback(r.fullKey,n,this.manager.getZone());return this.manager.getZone().runOutsideAngular(()=>pe().onAndCancel(e,r.domEventName,i))}static parseEventName(e){const t=e.toLowerCase().split("."),n=t.shift();if(0===t.length||"keydown"!==n&&"keyup"!==n)return null;const r=yt._normalizeKey(t.pop());let i="";if(mt.forEach(e=>{const n=t.indexOf(e);n>-1&&(t.splice(n,1),i+=e+".")}),i+=r,0!=t.length||0===r.length)return null;const o={};return o.domEventName=n,o.fullKey=i,o}static getEventFullKey(e){let t="",n=pe().getEventKey(e);return" "===(n=n.toLowerCase())?n="space":"."===n&&(n="dot"),mt.forEach(r=>{r!=n&&(0,gt[r])(e)&&(t+=r+".")}),t+=n}static eventCallback(e,t,n){return r=>{yt.getEventFullKey(r)===e&&n.runGuarded(()=>t(r))}}static _normalizeKey(e){switch(e){case"esc":return"escape";default:return e}}}class bt{}class vt extends bt{constructor(e){super(),this._doc=e}sanitize(e,t){if(null==t)return null;switch(e){case r.H.NONE:return t;case r.H.HTML:return t instanceof _t?t.changingThisBreaksApplicationSecurity:(this.checkNotSafeValue(t,"HTML"),Object(r.fb)(this._doc,String(t)));case r.H.STYLE:return t instanceof St?t.changingThisBreaksApplicationSecurity:(this.checkNotSafeValue(t,"Style"),Object(r.gb)(t));case r.H.SCRIPT:if(t instanceof Et)return t.changingThisBreaksApplicationSecurity;throw this.checkNotSafeValue(t,"Script"),new Error("unsafe value used in a script context");case r.H.URL:return t instanceof Tt||t instanceof Ct?t.changingThisBreaksApplicationSecurity:(this.checkNotSafeValue(t,"URL"),Object(r.hb)(String(t)));case r.H.RESOURCE_URL:if(t instanceof Tt)return t.changingThisBreaksApplicationSecurity;throw this.checkNotSafeValue(t,"ResourceURL"),new Error("unsafe value used in a resource URL context (see http://g.co/ng/security#xss)");default:throw new Error(`Unexpected SecurityContext ${e} (see http://g.co/ng/security#xss)`)}}checkNotSafeValue(e,t){if(e instanceof wt)throw new Error(`Required a safe ${t}, got a ${e.getTypeName()} `+"(see http://g.co/ng/security#xss)")}bypassSecurityTrustHtml(e){return new _t(e)}bypassSecurityTrustStyle(e){return new St(e)}bypassSecurityTrustScript(e){return new Et(e)}bypassSecurityTrustUrl(e){return new Ct(e)}bypassSecurityTrustResourceUrl(e){return new Tt(e)}}class wt{constructor(e){this.changingThisBreaksApplicationSecurity=e}toString(){return`SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity}`+" (see http://g.co/ng/security#xss)"}}class _t extends wt{getTypeName(){return"HTML"}}class St extends wt{getTypeName(){return"Style"}}class Et extends wt{getTypeName(){return"Script"}}class Ct extends wt{getTypeName(){return"URL"}}class Tt extends wt{getTypeName(){return"ResourceURL"}}const It=[{provide:r.A,useValue:o.y},{provide:r.B,useValue:function(){Se.makeCurrent(),ke.init()},multi:!0},{provide:o.p,useClass:class extends o.p{constructor(e){super(),this._doc=e,this._init()}_init(){this.location=pe().getLocation(),this._history=pe().getHistory()}getBaseHrefFromDOM(){return pe().getBaseHref(this._doc)}onPopState(e){pe().getGlobalEventTarget(this._doc,"window").addEventListener("popstate",e,!1)}onHashChange(e){pe().getGlobalEventTarget(this._doc,"window").addEventListener("hashchange",e,!1)}get href(){return this.location.href}get protocol(){return this.location.protocol}get hostname(){return this.location.hostname}get port(){return this.location.port}get pathname(){return this.location.pathname}get search(){return this.location.search}get hash(){return this.location.hash}set pathname(e){this.location.pathname=e}pushState(e,t,n){Te()?this._history.pushState(e,t,n):this.location.hash=n}replaceState(e,t,n){Te()?this._history.replaceState(e,t,n):this.location.hash=n}forward(){this._history.forward()}back(){this._history.back()}getState(){return this._history.state}},deps:[o.c]},{provide:o.c,useFactory:function(){return document},deps:[]}],Dt=Object(r.R)(r.Y,"browser",It);function xt(){return new r.l}class kt{constructor(e){if(e)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.")}static withServerTransition(e){return{ngModule:kt,providers:[{provide:r.c,useValue:e.appId},{provide:Ie,useExisting:r.c},xe]}}}"undefined"!=typeof window&&window;class At{constructor(e,t){this.id=e,this.url=t}}class Ot extends At{constructor(e,t,n="imperative",r=null){super(e,t),this.navigationTrigger=n,this.restoredState=r}toString(){return`NavigationStart(id: ${this.id}, url: '${this.url}')`}}class Nt extends At{constructor(e,t,n){super(e,t),this.urlAfterRedirects=n}toString(){return`NavigationEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}')`}}class Rt extends At{constructor(e,t,n){super(e,t),this.reason=n}toString(){return`NavigationCancel(id: ${this.id}, url: '${this.url}')`}}class Mt extends At{constructor(e,t,n){super(e,t),this.error=n}toString(){return`NavigationError(id: ${this.id}, url: '${this.url}', error: ${this.error})`}}class Pt extends At{constructor(e,t,n,r){super(e,t),this.urlAfterRedirects=n,this.state=r}toString(){return`RoutesRecognized(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class Lt extends At{constructor(e,t,n,r){super(e,t),this.urlAfterRedirects=n,this.state=r}toString(){return`GuardsCheckStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class Ft extends At{constructor(e,t,n,r,i){super(e,t),this.urlAfterRedirects=n,this.state=r,this.shouldActivate=i}toString(){return`GuardsCheckEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state}, shouldActivate: ${this.shouldActivate})`}}class jt extends At{constructor(e,t,n,r){super(e,t),this.urlAfterRedirects=n,this.state=r}toString(){return`ResolveStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class Vt extends At{constructor(e,t,n,r){super(e,t),this.urlAfterRedirects=n,this.state=r}toString(){return`ResolveEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class Ut{constructor(e){this.route=e}toString(){return`RouteConfigLoadStart(path: ${this.route.path})`}}class qt{constructor(e){this.route=e}toString(){return`RouteConfigLoadEnd(path: ${this.route.path})`}}class Bt{constructor(e){this.snapshot=e}toString(){return`ChildActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class Ht{constructor(e){this.snapshot=e}toString(){return`ChildActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class zt{constructor(e){this.snapshot=e}toString(){return`ActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class Wt{constructor(e){this.snapshot=e}toString(){return`ActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class Qt{constructor(e,t,n){this.routerEvent=e,this.position=t,this.anchor=n}toString(){return`Scroll(anchor: '${this.anchor}', position: '${this.position?`${this.position[0]}, ${this.position[1]}`:null}')`}}class Gt{}const Kt="primary";class $t{constructor(e){this.params=e||{}}has(e){return this.params.hasOwnProperty(e)}get(e){if(this.has(e)){const t=this.params[e];return Array.isArray(t)?t[0]:t}return null}getAll(e){if(this.has(e)){const t=this.params[e];return Array.isArray(t)?t:[t]}return[]}get keys(){return Object.keys(this.params)}}function Yt(e){return new $t(e)}const Zt="ngNavigationCancelingError";function Jt(e){const t=Error("NavigationCancelingError: "+e);return t[Zt]=!0,t}function Xt(e,t,n){const r=n.path.split("/");if(r.length>e.length)return null;if("full"===n.pathMatch&&(t.hasChildren()||r.length<e.length))return null;const i={};for(let o=0;o<r.length;o++){const t=r[o],n=e[o];if(t.startsWith(":"))i[t.substring(1)]=n;else if(t!==n.path)return null}return{consumed:e.slice(0,r.length),posParams:i}}class en{constructor(e,t){this.routes=e,this.module=t}}function tn(e,t=""){for(let n=0;n<e.length;n++){const r=e[n];nn(r,rn(t,r))}}function nn(e,t){if(!e)throw new Error(`\n      Invalid configuration of route '${t}': 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(e))throw new Error(`Invalid configuration of route '${t}': Array cannot be specified`);if(!e.component&&!e.children&&!e.loadChildren&&e.outlet&&e.outlet!==Kt)throw new Error(`Invalid configuration of route '${t}': a componentless route without children or loadChildren cannot have a named outlet set`);if(e.redirectTo&&e.children)throw new Error(`Invalid configuration of route '${t}': redirectTo and children cannot be used together`);if(e.redirectTo&&e.loadChildren)throw new Error(`Invalid configuration of route '${t}': redirectTo and loadChildren cannot be used together`);if(e.children&&e.loadChildren)throw new Error(`Invalid configuration of route '${t}': children and loadChildren cannot be used together`);if(e.redirectTo&&e.component)throw new Error(`Invalid configuration of route '${t}': redirectTo and component cannot be used together`);if(e.path&&e.matcher)throw new Error(`Invalid configuration of route '${t}': path and matcher cannot be used together`);if(void 0===e.redirectTo&&!e.component&&!e.children&&!e.loadChildren)throw new Error(`Invalid configuration of route '${t}'. One of the following must be provided: component, redirectTo, children or loadChildren`);if(void 0===e.path&&void 0===e.matcher)throw new Error(`Invalid configuration of route '${t}': routes must have either a path or a matcher specified`);if("string"==typeof e.path&&"/"===e.path.charAt(0))throw new Error(`Invalid configuration of route '${t}': path cannot start with a slash`);if(""===e.path&&void 0!==e.redirectTo&&void 0===e.pathMatch)throw new Error(`Invalid configuration of route '{path: "${t}", redirectTo: "${e.redirectTo}"}': please provide 'pathMatch'. The default value of 'pathMatch' is 'prefix', but often the intent is to use 'full'.`);if(void 0!==e.pathMatch&&"full"!==e.pathMatch&&"prefix"!==e.pathMatch)throw new Error(`Invalid configuration of route '${t}': pathMatch can only be set to 'prefix' or 'full'`);e.children&&tn(e.children,t)}function rn(e,t){return t?e||t.path?e&&!t.path?`${e}/`:!e&&t.path?t.path:`${e}/${t.path}`:"":e}function on(e){const t=e.children&&e.children.map(on),n=t?Object.assign({},e,{children:t}):Object.assign({},e);return!n.component&&(t||n.loadChildren)&&n.outlet&&n.outlet!==Kt&&(n.component=Gt),n}function sn(e,t){const n=Object.keys(e),r=Object.keys(t);if(!n||!r||n.length!=r.length)return!1;let i;for(let o=0;o<n.length;o++)if(e[i=n[o]]!==t[i])return!1;return!0}function an(e){return Array.prototype.concat.apply([],e)}function un(e){return e.length>0?e[e.length-1]:null}function ln(e,t){for(const n in e)e.hasOwnProperty(n)&&t(e[n],n)}function cn(e){return Object(r.yb)(e)?e:Object(r.zb)(e)?Object(a.a)(Promise.resolve(e)):Object(s.a)(e)}function hn(e,t,n){return n?function(e,t){return sn(e,t)}(e.queryParams,t.queryParams)&&function e(t,n){if(!mn(t.segments,n.segments))return!1;if(t.numberOfChildren!==n.numberOfChildren)return!1;for(const r in n.children){if(!t.children[r])return!1;if(!e(t.children[r],n.children[r]))return!1}return!0}(e.root,t.root):function(e,t){return Object.keys(t).length<=Object.keys(e).length&&Object.keys(t).every(n=>t[n]===e[n])}(e.queryParams,t.queryParams)&&function e(t,n){return function t(n,r,i){if(n.segments.length>i.length){return!!mn(n.segments.slice(0,i.length),i)&&!r.hasChildren()}if(n.segments.length===i.length){if(!mn(n.segments,i))return!1;for(const t in r.children){if(!n.children[t])return!1;if(!e(n.children[t],r.children[t]))return!1}return!0}{const e=i.slice(0,n.segments.length),o=i.slice(n.segments.length);return!!mn(n.segments,e)&&!!n.children[Kt]&&t(n.children[Kt],r,o)}}(t,n,n.segments)}(e.root,t.root)}class dn{constructor(e,t,n){this.root=e,this.queryParams=t,this.fragment=n}get queryParamMap(){return this._queryParamMap||(this._queryParamMap=Yt(this.queryParams)),this._queryParamMap}toString(){return vn.serialize(this)}}class fn{constructor(e,t){this.segments=e,this.children=t,this.parent=null,ln(t,(e,t)=>e.parent=this)}hasChildren(){return this.numberOfChildren>0}get numberOfChildren(){return Object.keys(this.children).length}toString(){return wn(this)}}class pn{constructor(e,t){this.path=e,this.parameters=t}get parameterMap(){return this._parameterMap||(this._parameterMap=Yt(this.parameters)),this._parameterMap}toString(){return In(this)}}function mn(e,t){return e.length===t.length&&e.every((e,n)=>e.path===t[n].path)}function gn(e,t){let n=[];return ln(e.children,(e,r)=>{r===Kt&&(n=n.concat(t(e,r)))}),ln(e.children,(e,r)=>{r!==Kt&&(n=n.concat(t(e,r)))}),n}class yn{}class bn{parse(e){const t=new On(e);return new dn(t.parseRootSegment(),t.parseQueryParams(),t.parseFragment())}serialize(e){var t;return`${`/${function e(t,n){if(!t.hasChildren())return wn(t);if(n){const n=t.children[Kt]?e(t.children[Kt],!1):"",r=[];return ln(t.children,(t,n)=>{n!==Kt&&r.push(`${n}:${e(t,!1)}`)}),r.length>0?`${n}(${r.join("//")})`:n}{const n=gn(t,(n,r)=>r===Kt?[e(t.children[Kt],!1)]:[`${r}:${e(n,!1)}`]);return`${wn(t)}/(${n.join("//")})`}}(e.root,!0)}`}${function(e){const t=Object.keys(e).map(t=>{const n=e[t];return Array.isArray(n)?n.map(e=>`${Sn(t)}=${Sn(e)}`).join("&"):`${Sn(t)}=${Sn(n)}`});return t.length?`?${t.join("&")}`:""}(e.queryParams)}${"string"==typeof e.fragment?`#${t=e.fragment,encodeURI(t)}`:""}`}}const vn=new bn;function wn(e){return e.segments.map(e=>In(e)).join("/")}function _n(e){return encodeURIComponent(e).replace(/%40/g,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",")}function Sn(e){return _n(e).replace(/%3B/gi,";")}function En(e){return _n(e).replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/%26/gi,"&")}function Cn(e){return decodeURIComponent(e)}function Tn(e){return Cn(e.replace(/\+/g,"%20"))}function In(e){return`${En(e.path)}${t=e.parameters,Object.keys(t).map(e=>`;${En(e)}=${En(t[e])}`).join("")}`;var t}const Dn=/^[^\/()?;=#]+/;function xn(e){const t=e.match(Dn);return t?t[0]:""}const kn=/^[^=?&#]+/,An=/^[^?&#]+/;class On{constructor(e){this.url=e,this.remaining=e}parseRootSegment(){return this.consumeOptional("/"),""===this.remaining||this.peekStartsWith("?")||this.peekStartsWith("#")?new fn([],{}):new fn([],this.parseChildren())}parseQueryParams(){const e={};if(this.consumeOptional("?"))do{this.parseQueryParam(e)}while(this.consumeOptional("&"));return e}parseFragment(){return this.consumeOptional("#")?decodeURIComponent(this.remaining):null}parseChildren(){if(""===this.remaining)return{};this.consumeOptional("/");const e=[];for(this.peekStartsWith("(")||e.push(this.parseSegment());this.peekStartsWith("/")&&!this.peekStartsWith("//")&&!this.peekStartsWith("/(");)this.capture("/"),e.push(this.parseSegment());let t={};this.peekStartsWith("/(")&&(this.capture("/"),t=this.parseParens(!0));let n={};return this.peekStartsWith("(")&&(n=this.parseParens(!1)),(e.length>0||Object.keys(t).length>0)&&(n[Kt]=new fn(e,t)),n}parseSegment(){const e=xn(this.remaining);if(""===e&&this.peekStartsWith(";"))throw new Error(`Empty path url segment cannot have parameters: '${this.remaining}'.`);return this.capture(e),new pn(Cn(e),this.parseMatrixParams())}parseMatrixParams(){const e={};for(;this.consumeOptional(";");)this.parseParam(e);return e}parseParam(e){const t=xn(this.remaining);if(!t)return;this.capture(t);let n="";if(this.consumeOptional("=")){const e=xn(this.remaining);e&&this.capture(n=e)}e[Cn(t)]=Cn(n)}parseQueryParam(e){const t=function(e){const t=e.match(kn);return t?t[0]:""}(this.remaining);if(!t)return;this.capture(t);let n="";if(this.consumeOptional("=")){const e=function(e){const t=e.match(An);return t?t[0]:""}(this.remaining);e&&this.capture(n=e)}const r=Tn(t),i=Tn(n);if(e.hasOwnProperty(r)){let t=e[r];Array.isArray(t)||(e[r]=t=[t]),t.push(i)}else e[r]=i}parseParens(e){const t={};for(this.capture("(");!this.consumeOptional(")")&&this.remaining.length>0;){const n=xn(this.remaining),r=this.remaining[n.length];if("/"!==r&&")"!==r&&";"!==r)throw new Error(`Cannot parse url '${this.url}'`);let i=void 0;n.indexOf(":")>-1?(i=n.substr(0,n.indexOf(":")),this.capture(i),this.capture(":")):e&&(i=Kt);const o=this.parseChildren();t[i]=1===Object.keys(o).length?o[Kt]:new fn([],o),this.consumeOptional("//")}return t}peekStartsWith(e){return this.remaining.startsWith(e)}consumeOptional(e){return!!this.peekStartsWith(e)&&(this.remaining=this.remaining.substring(e.length),!0)}capture(e){if(!this.consumeOptional(e))throw new Error(`Expected "${e}".`)}}class Nn{constructor(e){this._root=e}get root(){return this._root.value}parent(e){const t=this.pathFromRoot(e);return t.length>1?t[t.length-2]:null}children(e){const t=Rn(e,this._root);return t?t.children.map(e=>e.value):[]}firstChild(e){const t=Rn(e,this._root);return t&&t.children.length>0?t.children[0].value:null}siblings(e){const t=Mn(e,this._root);return t.length<2?[]:t[t.length-2].children.map(e=>e.value).filter(t=>t!==e)}pathFromRoot(e){return Mn(e,this._root).map(e=>e.value)}}function Rn(e,t){if(e===t.value)return t;for(const n of t.children){const t=Rn(e,n);if(t)return t}return null}function Mn(e,t){if(e===t.value)return[t];for(const n of t.children){const r=Mn(e,n);if(r.length)return r.unshift(t),r}return[]}class Pn{constructor(e,t){this.value=e,this.children=t}toString(){return`TreeNode(${this.value})`}}function Ln(e){const t={};return e&&e.children.forEach(e=>t[e.value.outlet]=e),t}class Fn extends Nn{constructor(e,t){super(e),this.snapshot=t,Hn(this,e)}toString(){return this.snapshot.toString()}}function jn(e,t){const n=function(e,t){const n=new qn([],{},{},"",{},Kt,t,null,e.root,-1,{});return new Bn("",new Pn(n,[]))}(e,t),r=new c([new pn("",{})]),i=new c({}),o=new c({}),s=new c({}),a=new c(""),u=new Vn(r,i,s,a,o,Kt,t,n.root);return u.snapshot=n.root,new Fn(new Pn(u,[]),n)}class Vn{constructor(e,t,n,r,i,o,s,a){this.url=e,this.params=t,this.queryParams=n,this.fragment=r,this.data=i,this.outlet=o,this.component=s,this._futureSnapshot=a}get routeConfig(){return this._futureSnapshot.routeConfig}get root(){return this._routerState.root}get parent(){return this._routerState.parent(this)}get firstChild(){return this._routerState.firstChild(this)}get children(){return this._routerState.children(this)}get pathFromRoot(){return this._routerState.pathFromRoot(this)}get paramMap(){return this._paramMap||(this._paramMap=this.params.pipe(Object(C.a)(e=>Yt(e)))),this._paramMap}get queryParamMap(){return this._queryParamMap||(this._queryParamMap=this.queryParams.pipe(Object(C.a)(e=>Yt(e)))),this._queryParamMap}toString(){return this.snapshot?this.snapshot.toString():`Future(${this._futureSnapshot})`}}function Un(e,t="emptyOnly"){const n=e.pathFromRoot;let r=0;if("always"!==t)for(r=n.length-1;r>=1;){const e=n[r],t=n[r-1];if(e.routeConfig&&""===e.routeConfig.path)r--;else{if(t.component)break;r--}}return function(e){return e.reduce((e,t)=>({params:Object.assign({},e.params,t.params),data:Object.assign({},e.data,t.data),resolve:Object.assign({},e.resolve,t._resolvedData)}),{params:{},data:{},resolve:{}})}(n.slice(r))}class qn{constructor(e,t,n,r,i,o,s,a,u,l,c){this.url=e,this.params=t,this.queryParams=n,this.fragment=r,this.data=i,this.outlet=o,this.component=s,this.routeConfig=a,this._urlSegment=u,this._lastPathIndex=l,this._resolve=c}get root(){return this._routerState.root}get parent(){return this._routerState.parent(this)}get firstChild(){return this._routerState.firstChild(this)}get children(){return this._routerState.children(this)}get pathFromRoot(){return this._routerState.pathFromRoot(this)}get paramMap(){return this._paramMap||(this._paramMap=Yt(this.params)),this._paramMap}get queryParamMap(){return this._queryParamMap||(this._queryParamMap=Yt(this.queryParams)),this._queryParamMap}toString(){return`Route(url:'${this.url.map(e=>e.toString()).join("/")}', path:'${this.routeConfig?this.routeConfig.path:""}')`}}class Bn extends Nn{constructor(e,t){super(t),this.url=e,Hn(this,t)}toString(){return zn(this._root)}}function Hn(e,t){t.value._routerState=e,t.children.forEach(t=>Hn(e,t))}function zn(e){const t=e.children.length>0?` { ${e.children.map(zn).join(", ")} } `:"";return`${e.value}${t}`}function Wn(e){if(e.snapshot){const t=e.snapshot,n=e._futureSnapshot;e.snapshot=n,sn(t.queryParams,n.queryParams)||e.queryParams.next(n.queryParams),t.fragment!==n.fragment&&e.fragment.next(n.fragment),sn(t.params,n.params)||e.params.next(n.params),function(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;++n)if(!sn(e[n],t[n]))return!1;return!0}(t.url,n.url)||e.url.next(n.url),sn(t.data,n.data)||e.data.next(n.data)}else e.snapshot=e._futureSnapshot,e.data.next(e._futureSnapshot.data)}function Qn(e,t){var n,r;return sn(e.params,t.params)&&mn(n=e.url,r=t.url)&&n.every((e,t)=>sn(e.parameters,r[t].parameters))&&!(!e.parent!=!t.parent)&&(!e.parent||Qn(e.parent,t.parent))}function Gn(e){return"object"==typeof e&&null!=e&&!e.outlets&&!e.segmentPath}function Kn(e,t,n,r,i){let o={};return r&&ln(r,(e,t)=>{o[t]=Array.isArray(e)?e.map(e=>`${e}`):`${e}`}),new dn(n.root===e?t:function e(t,n,r){const i={};return ln(t.children,(t,o)=>{i[o]=t===n?r:e(t,n,r)}),new fn(t.segments,i)}(n.root,e,t),o,i)}class $n{constructor(e,t,n){if(this.isAbsolute=e,this.numberOfDoubleDots=t,this.commands=n,e&&n.length>0&&Gn(n[0]))throw new Error("Root segment cannot have matrix parameters");const r=n.find(e=>"object"==typeof e&&null!=e&&e.outlets);if(r&&r!==un(n))throw new Error("{outlets:{}} has to be the last command")}toRoot(){return this.isAbsolute&&1===this.commands.length&&"/"==this.commands[0]}}class Yn{constructor(e,t,n){this.segmentGroup=e,this.processChildren=t,this.index=n}}function Zn(e){return"object"==typeof e&&null!=e&&e.outlets?e.outlets[Kt]:`${e}`}function Jn(e,t,n){if(e||(e=new fn([],{})),0===e.segments.length&&e.hasChildren())return Xn(e,t,n);const r=function(e,t,n){let r=0,i=t;const o={match:!1,pathIndex:0,commandIndex:0};for(;i<e.segments.length;){if(r>=n.length)return o;const t=e.segments[i],s=Zn(n[r]),a=r<n.length-1?n[r+1]:null;if(i>0&&void 0===s)break;if(s&&a&&"object"==typeof a&&void 0===a.outlets){if(!rr(s,a,t))return o;r+=2}else{if(!rr(s,{},t))return o;r++}i++}return{match:!0,pathIndex:i,commandIndex:r}}(e,t,n),i=n.slice(r.commandIndex);if(r.match&&r.pathIndex<e.segments.length){const t=new fn(e.segments.slice(0,r.pathIndex),{});return t.children[Kt]=new fn(e.segments.slice(r.pathIndex),e.children),Xn(t,0,i)}return r.match&&0===i.length?new fn(e.segments,{}):r.match&&!e.hasChildren()?er(e,t,n):r.match?Xn(e,0,i):er(e,t,n)}function Xn(e,t,n){if(0===n.length)return new fn(e.segments,{});{const r=function(e){return"object"!=typeof e[0]?{[Kt]:e}:void 0===e[0].outlets?{[Kt]:e}:e[0].outlets}(n),i={};return ln(r,(n,r)=>{null!==n&&(i[r]=Jn(e.children[r],t,n))}),ln(e.children,(e,t)=>{void 0===r[t]&&(i[t]=e)}),new fn(e.segments,i)}}function er(e,t,n){const r=e.segments.slice(0,t);let i=0;for(;i<n.length;){if("object"==typeof n[i]&&void 0!==n[i].outlets){const e=tr(n[i].outlets);return new fn(r,e)}if(0===i&&Gn(n[0])){r.push(new pn(e.segments[t].path,n[0])),i++;continue}const o=Zn(n[i]),s=i<n.length-1?n[i+1]:null;o&&s&&Gn(s)?(r.push(new pn(o,nr(s))),i+=2):(r.push(new pn(o,{})),i++)}return new fn(r,{})}function tr(e){const t={};return ln(e,(e,n)=>{null!==e&&(t[n]=er(new fn([],{}),0,e))}),t}function nr(e){const t={};return ln(e,(e,n)=>t[n]=`${e}`),t}function rr(e,t,n){return e==n.path&&sn(t,n.parameters)}const ir=(e,t,n)=>Object(C.a)(r=>(new or(t,r.targetRouterState,r.currentRouterState,n).activate(e),r));class or{constructor(e,t,n,r){this.routeReuseStrategy=e,this.futureState=t,this.currState=n,this.forwardEvent=r}activate(e){const t=this.futureState._root,n=this.currState?this.currState._root:null;this.deactivateChildRoutes(t,n,e),Wn(this.futureState.root),this.activateChildRoutes(t,n,e)}deactivateChildRoutes(e,t,n){const r=Ln(t);e.children.forEach(e=>{const t=e.value.outlet;this.deactivateRoutes(e,r[t],n),delete r[t]}),ln(r,(e,t)=>{this.deactivateRouteAndItsChildren(e,n)})}deactivateRoutes(e,t,n){const r=e.value,i=t?t.value:null;if(r===i)if(r.component){const i=n.getContext(r.outlet);i&&this.deactivateChildRoutes(e,t,i.children)}else this.deactivateChildRoutes(e,t,n);else i&&this.deactivateRouteAndItsChildren(t,n)}deactivateRouteAndItsChildren(e,t){this.routeReuseStrategy.shouldDetach(e.value.snapshot)?this.detachAndStoreRouteSubtree(e,t):this.deactivateRouteAndOutlet(e,t)}detachAndStoreRouteSubtree(e,t){const n=t.getContext(e.value.outlet);if(n&&n.outlet){const t=n.outlet.detach(),r=n.children.onOutletDeactivated();this.routeReuseStrategy.store(e.value.snapshot,{componentRef:t,route:e,contexts:r})}}deactivateRouteAndOutlet(e,t){const n=t.getContext(e.value.outlet);if(n){const r=Ln(e),i=e.value.component?n.children:t;ln(r,(e,t)=>this.deactivateRouteAndItsChildren(e,i)),n.outlet&&(n.outlet.deactivate(),n.children.onOutletDeactivated())}}activateChildRoutes(e,t,n){const r=Ln(t);e.children.forEach(e=>{this.activateRoutes(e,r[e.value.outlet],n),this.forwardEvent(new Wt(e.value.snapshot))}),e.children.length&&this.forwardEvent(new Ht(e.value.snapshot))}activateRoutes(e,t,n){const r=e.value,i=t?t.value:null;if(Wn(r),r===i)if(r.component){const i=n.getOrCreateContext(r.outlet);this.activateChildRoutes(e,t,i.children)}else this.activateChildRoutes(e,t,n);else if(r.component){const t=n.getOrCreateContext(r.outlet);if(this.routeReuseStrategy.shouldAttach(r.snapshot)){const e=this.routeReuseStrategy.retrieve(r.snapshot);this.routeReuseStrategy.store(r.snapshot,null),t.children.onOutletReAttached(e.contexts),t.attachRef=e.componentRef,t.route=e.route.value,t.outlet&&t.outlet.attach(e.componentRef,e.route.value),sr(e.route)}else{const n=function(e){for(let t=r.snapshot.parent;t;t=t.parent){const e=t.routeConfig;if(e&&e._loadedConfig)return e._loadedConfig;if(e&&e.component)return null}return null}(),i=n?n.module.componentFactoryResolver:null;t.attachRef=null,t.route=r,t.resolver=i,t.outlet&&t.outlet.activateWith(r,i),this.activateChildRoutes(e,null,t.children)}}else this.activateChildRoutes(e,null,n)}}
1function sr(e){Wn(e.value),e.children.forEach(sr)}function ar(e){return"function"==typeof e}function ur(e){return e instanceof dn}class lr{constructor(e){this.segmentGroup=e||null}}class cr{constructor(e){this.urlTree=e}}function hr(e){return new h.a(t=>t.error(new lr(e)))}function dr(e){return new h.a(t=>t.error(new cr(e)))}function fr(e){return new h.a(t=>t.error(new Error(`Only absolute redirects can have named outlets. redirectTo: '${e}'`)))}class pr{constructor(e,t,n,i,o){this.configLoader=t,this.urlSerializer=n,this.urlTree=i,this.config=o,this.allowRedirects=!0,this.ngModule=e.get(r.w)}apply(){return this.expandSegmentGroup(this.ngModule,this.config,this.urlTree.root,Kt).pipe(Object(C.a)(e=>this.createUrlTree(e,this.urlTree.queryParams,this.urlTree.fragment))).pipe(B(e=>{if(e instanceof cr)return this.allowRedirects=!1,this.match(e.urlTree);if(e instanceof lr)throw this.noMatchError(e);throw e}))}match(e){return this.expandSegmentGroup(this.ngModule,this.config,e.root,Kt).pipe(Object(C.a)(t=>this.createUrlTree(t,e.queryParams,e.fragment))).pipe(B(e=>{if(e instanceof lr)throw this.noMatchError(e);throw e}))}noMatchError(e){return new Error(`Cannot match any routes. URL Segment: '${e.segmentGroup}'`)}createUrlTree(e,t,n){const r=e.segments.length>0?new fn([],{[Kt]:e}):e;return new dn(r,t,n)}expandSegmentGroup(e,t,n,r){return 0===n.segments.length&&n.hasChildren()?this.expandChildren(e,t,n).pipe(Object(C.a)(e=>new fn([],e))):this.expandSegment(e,n,t,n.segments,r,!0)}expandChildren(e,t,n){return function(e,t){if(0===Object.keys(e).length)return Object(s.a)({});const n=[],r=[],i={};return ln(e,(e,o)=>{const s=t(o,e).pipe(Object(C.a)(e=>i[o]=e));o===Kt?n.push(s):r.push(s)}),s.a.apply(null,n.concat(r)).pipe(I(),U(),Object(C.a)(()=>i))}(n.children,(n,r)=>this.expandSegmentGroup(e,t,r,n))}expandSegment(e,t,n,r,i,o){return Object(s.a)(...n).pipe(Object(C.a)(a=>this.expandSegmentAgainstRoute(e,t,n,a,r,i,o).pipe(B(e=>{if(e instanceof lr)return Object(s.a)(null);throw e}))),I(),K(e=>!!e),B((e,n)=>{if(e instanceof d||"EmptyError"===e.name){if(this.noLeftoversInUrl(t,r,i))return Object(s.a)(new fn([],{}));throw new lr(t)}throw e}))}noLeftoversInUrl(e,t,n){return 0===t.length&&!e.children[n]}expandSegmentAgainstRoute(e,t,n,r,i,o,s){return br(r)!==o?hr(t):void 0===r.redirectTo?this.matchSegmentAgainstRoute(e,t,r,i):s&&this.allowRedirects?this.expandSegmentAgainstRouteUsingRedirect(e,t,n,r,i,o):hr(t)}expandSegmentAgainstRouteUsingRedirect(e,t,n,r,i,o){return"**"===r.path?this.expandWildCardWithParamsAgainstRouteUsingRedirect(e,n,r,o):this.expandRegularSegmentAgainstRouteUsingRedirect(e,t,n,r,i,o)}expandWildCardWithParamsAgainstRouteUsingRedirect(e,t,n,r){const i=this.applyRedirectCommands([],n.redirectTo,{});return n.redirectTo.startsWith("/")?dr(i):this.lineralizeSegments(n,i).pipe(Object($.a)(n=>{const i=new fn(n,{});return this.expandSegment(e,i,t,n,r,!1)}))}expandRegularSegmentAgainstRouteUsingRedirect(e,t,n,r,i,o){const{matched:s,consumedSegments:a,lastChild:u,positionalParamSegments:l}=mr(t,r,i);if(!s)return hr(t);const c=this.applyRedirectCommands(a,r.redirectTo,l);return r.redirectTo.startsWith("/")?dr(c):this.lineralizeSegments(r,c).pipe(Object($.a)(r=>this.expandSegment(e,t,n,r.concat(i.slice(u)),o,!1)))}matchSegmentAgainstRoute(e,t,n,r){if("**"===n.path)return n.loadChildren?this.configLoader.load(e.injector,n).pipe(Object(C.a)(e=>(n._loadedConfig=e,new fn(r,{})))):Object(s.a)(new fn(r,{}));const{matched:i,consumedSegments:o,lastChild:a}=mr(t,n,r);if(!i)return hr(t);const u=r.slice(a);return this.getChildConfig(e,n,r).pipe(Object($.a)(e=>{const n=e.module,r=e.routes,{segmentGroup:i,slicedSegments:a}=function(e,t,n,r){return n.length>0&&function(e,t,n){return r.some(n=>yr(e,t,n)&&br(n)!==Kt)}(e,n)?{segmentGroup:gr(new fn(t,function(e,t){const n={};n[Kt]=t;for(const r of e)""===r.path&&br(r)!==Kt&&(n[br(r)]=new fn([],{}));return n}(r,new fn(n,e.children)))),slicedSegments:[]}:0===n.length&&function(e,t,n){return r.some(n=>yr(e,t,n))}(e,n)?{segmentGroup:gr(new fn(e.segments,function(e,t,n,r){const i={};for(const o of n)yr(e,t,o)&&!r[br(o)]&&(i[br(o)]=new fn([],{}));return Object.assign({},r,i)}(e,n,r,e.children))),slicedSegments:n}:{segmentGroup:e,slicedSegments:n}}(t,o,u,r);return 0===a.length&&i.hasChildren()?this.expandChildren(n,r,i).pipe(Object(C.a)(e=>new fn(o,e))):0===r.length&&0===a.length?Object(s.a)(new fn(o,{})):this.expandSegment(n,i,r,a,Kt,!0).pipe(Object(C.a)(e=>new fn(o.concat(e.segments),e.children)))}))}getChildConfig(e,t,n){return t.children?Object(s.a)(new en(t.children,e)):t.loadChildren?void 0!==t._loadedConfig?Object(s.a)(t._loadedConfig):function(e,t,n){const r=t.canLoad;return r&&0!==r.length?Object(a.a)(r).pipe(Object(C.a)(r=>{const i=e.get(r);let o;if(function(e){return e&&ar(e.canLoad)}(i))o=i.canLoad(t,n);else{if(!ar(i))throw new Error("Invalid CanLoad guard");o=i(t,n)}return cn(o)})).pipe(I(),(i=e=>!0===e,e=>e.lift(new Y(i,void 0,e)))):Object(s.a)(!0);var i}(e.injector,t,n).pipe(Object($.a)(n=>n?this.configLoader.load(e.injector,t).pipe(Object(C.a)(e=>(t._loadedConfig=e,e))):function(e){return new h.a(t=>t.error(Jt(`Cannot load children because the guard of the route "path: '${e.path}'" returned false`)))}(t))):Object(s.a)(new en([],e))}lineralizeSegments(e,t){let n=[],r=t.root;for(;;){if(n=n.concat(r.segments),0===r.numberOfChildren)return Object(s.a)(n);if(r.numberOfChildren>1||!r.children[Kt])return fr(e.redirectTo);r=r.children[Kt]}}applyRedirectCommands(e,t,n){return this.applyRedirectCreatreUrlTree(t,this.urlSerializer.parse(t),e,n)}applyRedirectCreatreUrlTree(e,t,n,r){const i=this.createSegmentGroup(e,t.root,n,r);return new dn(i,this.createQueryParams(t.queryParams,this.urlTree.queryParams),t.fragment)}createQueryParams(e,t){const n={};return ln(e,(e,r)=>{if("string"==typeof e&&e.startsWith(":")){const i=e.substring(1);n[r]=t[i]}else n[r]=e}),n}createSegmentGroup(e,t,n,r){const i=this.createSegments(e,t.segments,n,r);let o={};return ln(t.children,(t,i)=>{o[i]=this.createSegmentGroup(e,t,n,r)}),new fn(i,o)}createSegments(e,t,n,r){return t.map(t=>t.path.startsWith(":")?this.findPosParam(e,t,r):this.findOrReturn(t,n))}findPosParam(e,t,n){const r=n[t.path.substring(1)];if(!r)throw new Error(`Cannot redirect to '${e}'. Cannot find '${t.path}'.`);return r}findOrReturn(e,t){let n=0;for(const r of t){if(r.path===e.path)return t.splice(n),r;n++}return e}}function mr(e,t,n){if(""===t.path)return"full"===t.pathMatch&&(e.hasChildren()||n.length>0)?{matched:!1,consumedSegments:[],lastChild:0,positionalParamSegments:{}}:{matched:!0,consumedSegments:[],lastChild:0,positionalParamSegments:{}};const r=(t.matcher||Xt)(n,e,t);return r?{matched:!0,consumedSegments:r.consumed,lastChild:r.consumed.length,positionalParamSegments:r.posParams}:{matched:!1,consumedSegments:[],lastChild:0,positionalParamSegments:{}}}function gr(e){if(1===e.numberOfChildren&&e.children[Kt]){const t=e.children[Kt];return new fn(e.segments.concat(t.segments),t.children)}return e}function yr(e,t,n){return(!(e.hasChildren()||t.length>0)||"full"!==n.pathMatch)&&""===n.path&&void 0!==n.redirectTo}function br(e){return e.outlet||Kt}class vr{constructor(e){this.path=e,this.route=this.path[this.path.length-1]}}class wr{constructor(e,t){this.component=e,this.route=t}}function _r(e,t,n){const r=e._root;return function e(t,n,r,i,o={canDeactivateChecks:[],canActivateChecks:[]}){const s=Ln(n);
1return t.children.forEach(t=>{!function(t,n,r,i,o={canDeactivateChecks:[],canActivateChecks:[]}){const s=t.value,a=n?n.value:null,u=r?r.getContext(t.value.outlet):null;if(a&&s.routeConfig===a.routeConfig){const l=function(e,t,n){if("function"==typeof n)return n(e,t);switch(n){case"pathParamsChange":return!mn(e.url,t.url);case"pathParamsOrQueryParamsChange":return!mn(e.url,t.url)||!sn(e.queryParams,t.queryParams);case"always":return!0;case"paramsOrQueryParamsChange":return!Qn(e,t)||!sn(e.queryParams,t.queryParams);case"paramsChange":default:return!Qn(e,t)}}(a,s,s.routeConfig.runGuardsAndResolvers);l?o.canActivateChecks.push(new vr(i)):(s.data=a.data,s._resolvedData=a._resolvedData),e(t,n,s.component?u?u.children:null:r,i,o),l&&o.canDeactivateChecks.push(new wr(u&&u.outlet&&u.outlet.component||null,a))}else a&&Er(n,u,o),o.canActivateChecks.push(new vr(i)),e(t,null,s.component?u?u.children:null:r,i,o)}(t,s[t.value.outlet],r,i.concat([t.value]),o),delete s[t.value.outlet]}),ln(s,(e,t)=>Er(e,r.getContext(t),o)),o}(r,t?t._root:null,n,[r.value])}function Sr(e,t,n){const r=function(e){if(!e)return null;for(let t=e.parent;t;t=t.parent){const e=t.routeConfig;if(e&&e._loadedConfig)return e._loadedConfig}return null}(t);return(r?r.module.injector:n).get(e)}function Er(e,t,n){const r=Ln(e),i=e.value;ln(r,(e,r)=>{Er(e,i.component?t?t.children.getContext(r):null:t,n)}),n.canDeactivateChecks.push(new wr(i.component&&t&&t.outlet&&t.outlet.isActivated?t.outlet.component:null,i))}const Cr=Symbol("INITIAL_VALUE");function Tr(){return J(e=>(function(...e){let t=null,n=null;return Object(f.a)(e[e.length-1])&&(n=e.pop()),"function"==typeof e[e.length-1]&&(t=e.pop()),1===e.length&&Object(p.a)(e[0])&&(e=e[0]),Object(y.a)(e,n).lift(new v(t))})(...e.map(e=>e.pipe(W(1),function(...e){const t=e[e.length-1];return Object(f.a)(t)?(e.pop(),n=>te(e,n,t)):t=>te(e,t)}(Cr)))).pipe(Object(ne.a)((e,t)=>{let n=!1;return t.reduce((e,r,i)=>{if(e!==Cr)return e;if(r===Cr&&(n=!0),!n){if(!1===r)return r;if(i===t.length-1||ur(r))return r}return e},e)},Cr),Object(D.a)(e=>e!==Cr),Object(C.a)(e=>ur(e)?e:!0===e),W(1)))}function Ir(e,t){return null!==e&&t&&t(new zt(e)),Object(s.a)(!0)}function Dr(e,t){return null!==e&&t&&t(new Bt(e)),Object(s.a)(!0)}function xr(e,t,n){const r=t.routeConfig?t.routeConfig.canActivate:null;if(!r||0===r.length)return Object(s.a)(!0);const i=r.map(r=>E(()=>{const i=Sr(r,t,n);let o;if(function(e){return e&&ar(e.canActivate)}(i))o=cn(i.canActivate(t,e));else{if(!ar(i))throw new Error("Invalid CanActivate guard");o=cn(i(t,e))}return o.pipe(K())}));return Object(s.a)(i).pipe(Tr())}function kr(e,t,n){const r=t[t.length-1],i=t.slice(0,t.length-1).reverse().map(e=>(function(e){const t=e.routeConfig?e.routeConfig.canActivateChild:null;return t&&0!==t.length?{node:e,guards:t}:null})(e)).filter(e=>null!==e).map(t=>E(()=>{const i=t.guards.map(i=>{const o=Sr(i,t.node,n);let s;if(function(e){return e&&ar(e.canActivateChild)}(o))s=cn(o.canActivateChild(r,e));else{if(!ar(o))throw new Error("Invalid CanActivateChild guard");s=cn(o(r,e))}return s.pipe(K())});return Object(s.a)(i).pipe(Tr())}));return Object(s.a)(i).pipe(Tr())}class Ar{}class Or{constructor(e,t,n,r,i,o){this.rootComponentType=e,this.config=t,this.urlTree=n,this.url=r,this.paramsInheritanceStrategy=i,this.relativeLinkResolution=o}recognize(){try{const t=Mr(this.urlTree.root,[],[],this.config,this.relativeLinkResolution).segmentGroup,n=this.processSegmentGroup(this.config,t,Kt),r=new qn([],Object.freeze({}),Object.freeze(Object.assign({},this.urlTree.queryParams)),this.urlTree.fragment,{},Kt,this.rootComponentType,null,this.urlTree.root,-1,{}),i=new Pn(r,n),o=new Bn(this.url,i);return this.inheritParamsAndData(o._root),Object(s.a)(o)}catch(e){return new h.a(t=>t.error(e))}}inheritParamsAndData(e){const t=e.value,n=Un(t,this.paramsInheritanceStrategy);t.params=Object.freeze(n.params),t.data=Object.freeze(n.data),e.children.forEach(e=>this.inheritParamsAndData(e))}processSegmentGroup(e,t,n){return 0===t.segments.length&&t.hasChildren()?this.processChildren(e,t):this.processSegment(e,t,t.segments,n)}processChildren(e,t){const n=gn(t,(t,n)=>this.processSegmentGroup(e,t,n));return function(e){const t={};
vendor: 4,645 bytes, line 1
1n.forEach(e=>{const n=t[e.value.outlet];if(n){const t=n.url.map(e=>e.toString()).join("/"),r=e.value.url.map(e=>e.toString()).join("/");throw new Error(`Two segments cannot have the same outlet name: '${t}' and '${r}'.`)}t[e.value.outlet]=e.value})}(),n.sort((e,t)=>e.value.outlet===Kt?-1:t.value.outlet===Kt?1:e.value.outlet.localeCompare(t.value.outlet)),n}processSegment(e,t,n,r){for(const o of e)try{return this.processSegmentAgainstRoute(o,t,n,r)}catch(i){if(!(i instanceof Ar))throw i}if(this.noLeftoversInUrl(t,n,r))return[];throw new Ar}noLeftoversInUrl(e,t,n){return 0===t.length&&!e.children[n]}processSegmentAgainstRoute(e,t,n,r){if(e.redirectTo)throw new Ar;if((e.outlet||Kt)!==r)throw new Ar;let i,o=[],s=[];if("**"===e.path){const o=n.length>0?un(n).parameters:{};i=new qn(n,o,Object.freeze(Object.assign({},this.urlTree.queryParams)),this.urlTree.fragment,Fr(e),r,e.component,e,Nr(t),Rr(t)+n.length,jr(e))}else{const a=function(e,t,n){if(""===t.path){if("full"===t.pathMatch&&(e.hasChildren()||n.length>0))throw new Ar;return{consumedSegments:[],lastChild:0,parameters:{}}}const r=(t.matcher||Xt)(n,e,t);if(!r)throw new Ar;const i={};ln(r.posParams,(e,t)=>{i[t]=e.path});const o=r.consumed.length>0?Object.assign({},i,r.consumed[r.consumed.length-1].parameters):i;return{consumedSegments:r.consumed,lastChild:r.consumed.length,parameters:o}}(t,e,n);o=a.consumedSegments,s=n.slice(a.lastChild),i=new qn(o,a.parameters,Object.freeze(Object.assign({},this.urlTree.queryParams)),this.urlTree.fragment,Fr(e),r,e.component,e,Nr(t),Rr(t)+o.length,jr(e))}const a=function(e){return e.children?e.children:e.loadChildren?e._loadedConfig.routes:[]}(e),{segmentGroup:u,slicedSegments:l}=Mr(t,o,s,a,this.relativeLinkResolution);if(0===l.length&&u.hasChildren()){const e=this.processChildren(a,u);return[new Pn(i,e)]}if(0===a.length&&0===l.length)return[new Pn(i,[])];const c=this.processSegment(a,u,l,Kt);return[new Pn(i,c)]}}function Nr(e){let t=e;for(;t._sourceSegment;)t=t._sourceSegment;return t}function Rr(e){let t=e,n=t._segmentIndexShift?t._segmentIndexShift:0;for(;t._sourceSegment;)n+=(t=t._sourceSegment)._segmentIndexShift?t._segmentIndexShift:0;return n-1}function Mr(e,t,n,r,i){if(n.length>0&&function(e,t,n){return r.some(n=>Pr(e,t,n)&&Lr(n)!==Kt)}(e,n)){const i=new fn(t,function(e,t,n,r){const i={};i[Kt]=r,r._sourceSegment=e,r._segmentIndexShift=t.length;for(const o of n)if(""===o.path&&Lr(o)!==Kt){const n=new fn([],{});n._sourceSegment=e,n._segmentIndexShift=t.length,i[Lr(o)]=n}return i}(e,t,r,new fn(n,e.children)));return i._sourceSegment=e,i._segmentIndexShift=t.length,{segmentGroup:i,slicedSegments:[]}}if(0===n.length&&function(e,t,n){return r.some(n=>Pr(e,t,n))}(e,n)){const o=new fn(e.segments,function(e,t,n,r,i,o){const s={};for(const a of r)if(Pr(e,n,a)&&!i[Lr(a)]){const n=new fn([],{});n._sourceSegment=e,n._segmentIndexShift="legacy"===o?e.segments.length:t.length,s[Lr(a)]=n}return Object.assign({},i,s)}(e,t,n,r,e.children,i));return o._sourceSegment=e,o._segmentIndexShift=t.length,{segmentGroup:o,slicedSegments:n}}const o=new fn(e.segments,e.children);return o._sourceSegment=e,o._segmentIndexShift=t.length,{segmentGroup:o,slicedSegments:n}}function Pr(e,t,n){return(!(e.hasChildren()||t.length>0)||"full"!==n.pathMatch)&&""===n.path&&void 0===n.redirectTo}function Lr(e){return e.outlet||Kt}function Fr(e){return e.data||{}}function jr(e){return e.resolve||{}}function Vr(e,t,n,r){const i=Sr(e,t,r);return cn(i.resolve?i.resolve(t,n):i(t,n))}function Ur(e){return function(t){return t.pipe(J(t=>{const n=e(t);return n?Object(a.a)(n).pipe(Object(C.a)(()=>t)):Object(a.a)([t])}))}}class qr{}class Br{shouldDetach(e){return!1}store(e,t){}shouldAttach(e){return!1}retrieve(e){return null}shouldReuseRoute(e,t){return e.routeConfig===t.routeConfig}}const Hr=new r.p("ROUTES");class zr{constructor(e,t,n,r){this.loader=e,this.compiler=t,this.onLoadStartListener=n,this.onLoadEndListener=r}load(e,t){return this.onLoadStartListener&&this.onLoadStartListener(t),this.loadModuleFactory(t.loadChildren).pipe(Object(C.a)(n=>{this.onLoadEndListener&&this.onLoadEndListener(t);const r=n.create(e);return new en(an(r.injector.get(Hr)).map(on),r)}))}loadModuleFactory(e){return"string"==typeof e?Object(a.a)(this.loader.load(e)):cn(e()).pipe(Object($.a)(e=>e instanceof r.u?Object(s.a)(e):Object(a.a)(this.compiler.compileModuleAsync(e))))}}class Wr{}class Qr{shouldProcessUrl(e){return!0}extract(e){return e}merge(e,t){return e}}function Gr(e){throw e}function Kr(e,t,n){return t.parse("/")}function $r(e,t){return Object(s.a)(null)}class Yr{constructor(e,t,n,i,o,s,a,l){this.rootComponentType=e,this.urlSerializer
1=t,this.rootContexts=n,this.location=i,this.config=l,this.lastSuccessfulNavigation=null,this.currentNavigation=null,this.navigationId=0,this.isNgZoneEnabled=!1,this.events=new u.a,this.errorHandler=Gr,this.malformedUriErrorHandler=Kr,this.navigated=!1,this.lastSuccessfulId=-1,this.hooks={beforePreactivation:$r,afterPreactivation:$r},this.urlHandlingStrategy=new Qr,this.routeReuseStrategy=new Br,this.onSameUrlNavigation="ignore",this.paramsInheritanceStrategy="emptyOnly",this.urlUpdateStrategy="deferred",this.relativeLinkResolution="legacy",this.ngModule=o.get(r.w),this.console=o.get(r.cb);const h=o.get(r.y);this.isNgZoneEnabled=h instanceof r.y,this.resetConfig(l),this.currentUrlTree=new dn(new fn([],{}),{},null),this.rawUrlTree=this.currentUrlTree,this.browserUrlTree=this.currentUrlTree,this.configLoader=new zr(s,a,e=>this.triggerEvent(new Ut(e)),e=>this.triggerEvent(new qt(e))),this.routerState=jn(this.currentUrlTree,this.rootComponentType),this.transitions=new c({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",restoredState: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()}setupNavigations(e){const t=this.events;return e.pipe(Object(D.a)(e=>0!==e.id),Object(C.a)(e=>Object.assign({},e,{extractedUrl:this.urlHandlingStrategy.extract(e.rawUrl)})),J(e=>{let n=!1,r=!1;return Object(s.a)(e).pipe(ae(e=>{this.currentNavigation={id:e.id,initialUrl:e.currentRawUrl,extractedUrl:e.extractedUrl,trigger:e.source,extras:e.extras,previousNavigation:this.lastSuccessfulNavigation?Object.assign({},this.lastSuccessfulNavigation,{previousNavigation:null}):null}}),J(e=>{const n=!this.navigated||e.extractedUrl.toString()!==this.browserUrlTree.toString();if(("reload"===this.onSameUrlNavigation||n)&&this.urlHandlingStrategy.shouldProcessUrl(e.rawUrl))return Object(s.a)(e).pipe(J(e=>{const n=this.transitions.getValue();return t.next(new Ot(e.id,this.serializeUrl(e.extractedUrl),e.source,e.restoredState)),n!==this.transitions.getValue()?_:[e]}),J(e=>Promise.resolve(e)),function(e,t,n,r){return function(i){return i.pipe(J(i=>(function(e,t,n,r,o){return new pr(e,t,n,i.extractedUrl,o).apply()})(e,t,n,0,r).pipe(Object(C.a)(e=>Object.assign({},i,{urlAfterRedirects:e})))))}}(this.ngModule.injector,this.configLoader,this.urlSerializer,this.config),ae(e=>{this.currentNavigation=Object.assign({},this.currentNavigation,{finalUrl:e.urlAfterRedirects})}),function(e,t,n,r,i){return function(o){return o.pipe(Object($.a)(o=>(function(e,t,n,r,i="emptyOnly",o="legacy"){return new Or(e,t,n,r,i,o).recognize()})(e,t,o.urlAfterRedirects,n(o.urlAfterRedirects),r,i).pipe(Object(C.a)(e=>Object.assign({},o,{targetSnapshot:e})))))}}(this.rootComponentType,this.config,e=>this.serializeUrl(e),this.paramsInheritanceStrategy,this.relativeLinkResolution),ae(e=>{"eager"===this.urlUpdateStrategy&&(e.extras.skipLocationChange||this.setBrowserUrl(e.urlAfterRedirects,!!e.extras.replaceUrl,e.id,e.extras.state),this.browserUrlTree=e.urlAfterRedirects)}),ae(e=>{const n=new Pt(e.id,this.serializeUrl(e.extractedUrl),this.serializeUrl(e.urlAfterRedirects),e.targetSnapshot);t.next(n)}));if(n&&this.rawUrlTree&&this.urlHandlingStrategy.shouldProcessUrl(this.rawUrlTree)){const{id:n,extractedUrl:r,source:i,restoredState:o,extras:a}=e,u=new Ot(n,this.serializeUrl(r),i,o);t.next(u);const l=jn(r,this.rootComponentType).snapshot;return Object(s.a)(Object.assign({},e,{targetSnapshot:l,urlAfterRedirects:r,extras:Object.assign({},a,{skipLocationChange:!1,replaceUrl:!1})}))}return this.rawUrlTree=e.rawUrl,this.browserUrlTree=e.urlAfterRedirects,e.resolve(null),_}),Ur(e=>{const{targetSnapshot:t,id:n,extractedUrl:r,rawUrl:i,extras:{skipLocationChange:o,replaceUrl:s}}=e;return this.hooks.beforePreactivation(t,{navigationId:n,appliedUrlTree:r,rawUrlTree:i,skipLocationChange:!!o,replaceUrl:!!s})}),ae(e=>{const t=new Lt(e.id,this.serializeUrl(e.extractedUrl),this.serializeUrl(e.urlAfterRedirects),e.targetSnapshot);this.triggerEvent(t)}),Object(C.a)(e=>Object.assign({},e,{guards:_r(e.targetSnapshot,e.currentSnapshot,this.rootContexts)})),function(e,t){return function(n){return n.pipe(Object($.a)(n=>{const{targetSnapshot:r,currentSnapshot:i,guards:{canActivateChecks:o,canDeactivateChecks:u}}=n;return 0===u.length&&0===o.length?Object(s.a)(Object.assign({},n,{guardsResult:!0})):function(e,t,n,r){return Object(a.a)(e).pipe(Object($.a)(e=>(function(e,t,n,r,i){const o=t&&t.routeConfig?t.routeConfig.canDeactivate:null;if(!o||0===o.length)return Object(s.a)(!0);const a=o.map(o=>{const s=Sr(o,t,i);let a;if(function(e){return e&&ar(e.canDeactivate)}(s))a=cn(s.canDeactivate(e,t,n,r));else{if(!ar(s))throw new Error("Invalid CanDeactivate guard");a=cn(s(e,t,n,r))}return a.pipe(K())});return Object(s.a)(a).pipe(Tr())})(e.component,e.route,n,t,r)),K(e=>!0!==e,!0))}(u,r,i,e).pipe(Object($.a)(n=>n&&function(e){return"boolean"==typeof n}()?function(e,t,n,r){return Object(a.a)(t).pipe(re(t=>Object(a.a)([Dr(t.route.parent,r),Ir(t.route,r),kr(e,t.path,n),xr(e,t.route,n)]).pipe(I(),K(e=>
1!0!==e,!0))),K(e=>!0!==e,!0))}(r,o,e,t):Object(s.a)(n)),Object(C.a)(e=>Object.assign({},n,{guardsResult:e})))}))}}(this.ngModule.injector,e=>this.triggerEvent(e)),ae(e=>{if(ur(e.guardsResult)){const t=Jt(`Redirecting to "${this.serializeUrl(e.guardsResult)}"`);throw t.url=e.guardsResult,t}}),ae(e=>{const t=new Ft(e.id,this.serializeUrl(e.extractedUrl),this.serializeUrl(e.urlAfterRedirects),e.targetSnapshot,!!e.guardsResult);this.triggerEvent(t)}),Object(D.a)(e=>{if(!e.guardsResult){this.resetUrlToCurrentUrlTree();const n=new Rt(e.id,this.serializeUrl(e.extractedUrl),"");return t.next(n),e.resolve(!1),!1}return!0}),Ur(e=>{if(e.guards.canActivateChecks.length)return Object(s.a)(e).pipe(ae(e=>{const t=new jt(e.id,this.serializeUrl(e.extractedUrl),this.serializeUrl(e.urlAfterRedirects),e.targetSnapshot);this.triggerEvent(t)}),function(e,t){return function(n){return n.pipe(Object($.a)(n=>{const{targetSnapshot:r,guards:{canActivateChecks:i}}=n;return i.length?Object(a.a)(i).pipe(re(n=>(function(e,t,n,i){return function(e,t,n,r){const i=Object.keys(e);if(0===i.length)return Object(s.a)({});if(1===i.length){const o=i[0];return Vr(e[o],t,n,r).pipe(Object(C.a)(e=>({[o]:e})))}const o={};return Object(a.a)(i).pipe(Object($.a)(i=>Vr(e[i],t,n,r).pipe(Object(C.a)(e=>(o[i]=e,e))))).pipe(U(),Object(C.a)(()=>o))}(e._resolve,e,r,i).pipe(Object(C.a)(t=>(e._resolvedData=t,e.data=Object.assign({},e.data,Un(e,n).resolve),null)))})(n.route,0,e,t)),function(e,t){return arguments.length>=2?function(n){return Object(ie.a)(Object(ne.a)(e,t),A(1),L(t))(n)}:function(t){return Object(ie.a)(Object(ne.a)((t,n,r)=>e(t,n,r+1)),A(1))(t)}}((e,t)=>e),Object(C.a)(e=>n)):Object(s.a)(n)}))}}(this.paramsInheritanceStrategy,this.ngModule.injector),ae(e=>{const t=new Vt(e.id,this.serializeUrl(e.extractedUrl),this.serializeUrl(e.urlAfterRedirects),e.targetSnapshot);this.triggerEvent(t)}))}),Ur(e=>{const{targetSnapshot:t,id:n,extractedUrl:r,rawUrl:i,extras:{skipLocationChange:o,replaceUrl:s}}=e;return this.hooks.afterPreactivation(t,{navigationId:n,appliedUrlTree:r,rawUrlTree:i,skipLocationChange:!!o,replaceUrl:!!s})}),Object(C.a)(e=>{const t=function(e,t,n){const r=function e(t,n,r){if(r&&t.shouldReuseRoute(n.value,r.value.snapshot)){const i=r.value;i._futureSnapshot=n.value;const o=function(t,n,r){return n.children.map(n=>{for(const i of r.children)if(t.shouldReuseRoute(i.value.snapshot,n.value))return e(t,n,i);return e(t,n)})}(t,n,r);return new Pn(i,o)}{const r=t.retrieve(n.value);if(r){const e=r.route;return function e(t,n){if(t.value.routeConfig!==n.value.routeConfig)throw new Error("Cannot reattach ActivatedRouteSnapshot created from a different route");if(t.children.length!==n.children.length)throw new Error("Cannot reattach ActivatedRouteSnapshot with a different number of children");n.value._futureSnapshot=t.value;for(let r=0;r<t.children.length;++r)e(t.children[r],n.children[r])}(n,e),e}{const r=new Vn(new c((i=n.value).url),new c(i.params),new c(i.queryParams),new c(i.fragment),new c(i.data),i.outlet,i.component,i),o=n.children.map(n=>e(t,n));return new Pn(r,o)}}var i}(e,t._root,n?n._root:void 0);return new Fn(r,t)}(this.routeReuseStrategy,e.targetSnapshot,e.currentRouterState);return Object.assign({},e,{targetRouterState:t})}),ae(e=>{this.currentUrlTree=e.urlAfterRedirects,this.rawUrlTree=this.urlHandlingStrategy.merge(this.currentUrlTree,e.rawUrl),this.routerState=e.targetRouterState,"deferred"===this.urlUpdateStrategy&&(e.extras.skipLocationChange||this.setBrowserUrl(this.rawUrlTree,!!e.extras.replaceUrl,e.id,e.extras.state),this.browserUrlTree=e.urlAfterRedirects)}),ir(this.rootContexts,this.routeReuseStrategy,e=>this.triggerEvent(e)),ae({next(){n=!0},complete(){n=!0}}),function(e){return t=>t.lift(new he(e))}(()=>{if(!n&&!r){this.resetUrlToCurrentUrlTree();const n=new Rt(e.id,this.serializeUrl(e.extractedUrl),`Navigation ID ${e.id} is not equal to the current navigation id ${this.navigationId}`);t.next(n),e.resolve(!1)}this.currentNavigation=null}),B(n=>{if(r=!0,function(e){return n&&n[Zt]}()){const r=ur(n.url);r||(this.navigated=!0,this.resetStateAndUrl(e.currentRouterState,e.currentUrlTree,e.rawUrl));const i=new Rt(e.id,this.serializeUrl(e.extractedUrl),n.message);t.next(i),e.resolve(!1),r&&this.navigateByUrl(n.url)}else{this.resetStateAndUrl(e.currentRouterState,e.currentUrlTree,e.rawUrl);const r=new Mt(e.id,this.serializeUrl(e.extractedUrl),n);t.next(r);try{e.resolve(this.errorHandler(n))}catch(i){e.reject(i)}}return _}))}))}resetRootComponentType(e){this.rootComponentType=e,this.routerState.root.component=this.rootComponentType}getTransition(){const e=this.transitions.value;return e.urlAfterRedirects=this.browserUrlTree,e}setTransition(e){this.transitions.next(Object.assign({},this.getTransition(),e))}initialNavigation(){this.setUpLocationChangeListener(),0===this.navigationId&&this.navigateByUrl(this.location.path(!0),{replaceUrl:!0})}setUpLocationChangeListener(){this.locationSubscription||(this.locationSubscription=this.location.subscribe(e=>{let t=this.parseUrl(e.url);const n="popstate"===e.type?"popstate":"hashchange",r=e.state&&e.state.navigationId?e.state:null;setTimeout(()=>{this.scheduleNavigation(t,n,r,{replaceUrl:!0})},0)}))}get url(){return this.serializeUrl(this.currentUrlTree)}getCurrentNavigation(){return this.currentNavigation}triggerEvent(e){this.events.next(e)}resetConfig(e){tn(e),this.config=e.map(on),this.navigated=!1,this.lastSuccessfulId=-1}ngOnDestroy(){this.dispose()}dispose(){this.locationSubscription&&(this.locationSubscription.unsubscribe(),this.locationSubscription=null)}createUrlTree(e,t={}){const{relativeTo:n,queryParams:i,fragment:o,preserveQueryParams:s,queryParamsHandling:a,preserveFragment:u}=t;
vendor: 4,827 bytes, line 1
1Object(r.X)()&&s&&console&&console.warn&&console.warn("preserveQueryParams is deprecated, use queryParamsHandling instead.");const l=n||this.routerState.root,c=u?this.currentUrlTree.fragment:o;let h=null;if(a)switch(a){case"merge":h=Object.assign({},this.currentUrlTree.queryParams,i);break;case"preserve":h=this.currentUrlTree.queryParams;break;default:h=i||null}else h=s?this.currentUrlTree.queryParams:i||null;return null!==h&&(h=this.removeEmptyProps(h)),function(e,t,n,r,i){if(0===n.length)return Kn(t.root,t.root,t,r,i);const o=function(e){if("string"==typeof e[0]&&1===e.length&&"/"===e[0])return new $n(!0,0,e);let t=0,n=!1;const r=e.reduce((e,r,i)=>{if("object"==typeof r&&null!=r){if(r.outlets){const t={};return ln(r.outlets,(e,n)=>{t[n]="string"==typeof e?e.split("/"):e}),[...e,{outlets:t}]}if(r.segmentPath)return[...e,r.segmentPath]}return"string"!=typeof r?[...e,r]:0===i?(r.split("/").forEach((r,i)=>{0==i&&"."===r||(0==i&&""===r?n=!0:".."===r?t++:""!=r&&e.push(r))}),e):[...e,r]},[]);return new $n(n,t,r)}(n);if(o.toRoot())return Kn(t.root,new fn([],{}),t,r,i);const s=function(e,n,r){if(e.isAbsolute)return new Yn(t.root,!0,0);if(-1===r.snapshot._lastPathIndex)return new Yn(r.snapshot._urlSegment,!0,0);const i=Gn(e.commands[0])?0:1;return function(t,n,o){let s=r.snapshot._urlSegment,a=r.snapshot._lastPathIndex+i,u=e.numberOfDoubleDots;for(;u>a;){if(u-=a,!(s=s.parent))throw new Error("Invalid number of '../'");a=s.segments.length}return new Yn(s,!1,a-u)}()}(o,0,e),a=s.processChildren?Xn(s.segmentGroup,s.index,o.commands):Jn(s.segmentGroup,s.index,o.commands);return Kn(s.segmentGroup,a,t,r,i)}(l,this.currentUrlTree,e,h,c)}navigateByUrl(e,t={skipLocationChange:!1}){Object(r.X)()&&this.isNgZoneEnabled&&!r.y.isInAngularZone()&&this.console.warn("Navigation triggered outside Angular zone, did you forget to call 'ngZone.run()'?");const n=ur(e)?e:this.parseUrl(e),i=this.urlHandlingStrategy.merge(n,this.rawUrlTree);return this.scheduleNavigation(i,"imperative",null,t)}navigate(e,t={skipLocationChange:!1}){return function(e){for(let t=0;t<e.length;t++){const n=e[t];if(null==n)throw new Error(`The requested path contains ${n} segment at index ${t}`)}}(e),this.navigateByUrl(this.createUrlTree(e,t),t)}serializeUrl(e){return this.urlSerializer.serialize(e)}parseUrl(e){let t;try{t=this.urlSerializer.parse(e)}catch(n){t=this.malformedUriErrorHandler(n,this.urlSerializer,e)}return t}isActive(e,t){if(ur(e))return hn(this.currentUrlTree,e,t);const n=this.parseUrl(e);return hn(this.currentUrlTree,n,t)}removeEmptyProps(e){return Object.keys(e).reduce((t,n)=>{const r=e[n];return null!=r&&(t[n]=r),t},{})}processNavigations(){this.navigations.subscribe(e=>{this.navigated=!0,this.lastSuccessfulId=e.id,this.events.next(new Nt(e.id,this.serializeUrl(e.extractedUrl),this.serializeUrl(this.currentUrlTree))),this.lastSuccessfulNavigation=this.currentNavigation,this.currentNavigation=null,e.resolve(!0)},e=>{this.console.warn("Unhandled Navigation Error: ")})}scheduleNavigation(e,t,n,r){const i=this.getTransition();if(i&&"imperative"!==t&&"imperative"===i.source&&i.rawUrl.toString()===e.toString())return Promise.resolve(!0);if(i&&"hashchange"==t&&"popstate"===i.source&&i.rawUrl.toString()===e.toString())return Promise.resolve(!0);if(i&&"popstate"==t&&"hashchange"===i.source&&i.rawUrl.toString()===e.toString())return Promise.resolve(!0);let o=null,s=null;const a=new Promise((e,t)=>{o=e,s=t}),u=++this.navigationId;return this.setTransition({id:u,source:t,restoredState:n,currentUrlTree:this.currentUrlTree,currentRawUrl:this.rawUrlTree,rawUrl:e,extras:r,resolve:o,reject:s,promise:a,currentSnapshot:this.routerState.snapshot,currentRouterState:this.routerState}),a.catch(e=>Promise.reject(e))}setBrowserUrl(e,t,n,r){const i=this.urlSerializer.serialize(e);r=r||{},this.location.isCurrentPathEqualTo(i)||t?this.location.replaceState(i,"",Object.assign({},r,{navigationId:n})):this.location.go(i,"",Object.assign({},r,{navigationId:n}))}resetStateAndUrl(e,t,n){this.routerState=e,this.currentUrlTree=t,this.rawUrlTree=this.urlHandlingStrategy.merge(this.currentUrlTree,n),this.resetUrlToCurrentUrlTree()}resetUrlToCurrentUrlTree(){this.location.replaceState(this.urlSerializer.serialize(this.rawUrlTree),"",{navigationId:this.lastSuccessfulId})}}class Zr{constructor(e,t,n){this.router=e,this.route=t,this.locationStrategy=n,this.commands=[],this.subscription=e.events.subscribe(e=>{e instanceof Nt&&this.updateTargetUrlAndHref()})}set routerLink(e){this.commands=null!=e?Array.isArray(e)?e:[e]:[]}set preserveQueryParams(e){Object(r.X)()&&console&&console.warn&&console.warn("preserveQueryParams is deprecated, use queryParamsHandling instead."),this.preserve=e}ngOnChanges(e){this.updateTargetUrlAndHref()}ngOnDestroy(){this.subscription.unsubscribe()}onClick(e,t,n,r){if(0!==e||t||n||r)return!0;
1if("string"==typeof this.target&&"_self"!=this.target)return!0;const i={skipLocationChange:Jr(this.skipLocationChange),replaceUrl:Jr(this.replaceUrl),state:this.state};return this.router.navigateByUrl(this.urlTree,i),!1}updateTargetUrlAndHref(){this.href=this.locationStrategy.prepareExternalUrl(this.router.serializeUrl(this.urlTree))}get urlTree(){return this.router.createUrlTree(this.commands,{relativeTo:this.route,queryParams:this.queryParams,fragment:this.fragment,preserveQueryParams:Jr(this.preserve),queryParamsHandling:this.queryParamsHandling,preserveFragment:Jr(this.preserveFragment)})}}function Jr(e){return""===e||!!e}class Xr{constructor(){this.outlet=null,this.route=null,this.resolver=null,this.children=new ei,this.attachRef=null}}class ei{constructor(){this.contexts=new Map}onChildOutletCreated(e,t){const n=this.getOrCreateContext(e);n.outlet=t,this.contexts.set(e,n)}onChildOutletDestroyed(e){const t=this.getContext(e);t&&(t.outlet=null)}onOutletDeactivated(){const e=this.contexts;return this.contexts=new Map,e}onOutletReAttached(e){this.contexts=e}getOrCreateContext(e){let t=this.getContext(e);return t||(t=new Xr,this.contexts.set(e,t)),t}getContext(e){return this.contexts.get(e)||null}}class ti{constructor(e,t,n,i,o){this.parentContexts=e,this.location=t,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||Kt,e.onChildOutletCreated(this.name,this)}ngOnDestroy(){this.parentContexts.onChildOutletDestroyed(this.name)}ngOnInit(){if(!this.activated){const e=this.parentContexts.getContext(this.name);e&&e.route&&(e.attachRef?this.attach(e.attachRef,e.route):this.activateWith(e.route,e.resolver||null))}}get isActivated(){return!!this.activated}get component(){if(!this.activated)throw new Error("Outlet is not activated");return this.activated.instance}get activatedRoute(){if(!this.activated)throw new Error("Outlet is not activated");return this._activatedRoute}get activatedRouteData(){return this._activatedRoute?this._activatedRoute.snapshot.data:{}}detach(){if(!this.activated)throw new Error("Outlet is not activated");this.location.detach();const e=this.activated;return this.activated=null,this._activatedRoute=null,e}attach(e,t){this.activated=e,this._activatedRoute=t,this.location.insert(e.hostView)}deactivate(){if(this.activated){const e=this.component;this.activated.destroy(),this.activated=null,this._activatedRoute=null,this.deactivateEvents.emit(e)}}activateWith(e,t){if(this.isActivated)throw new Error("Cannot activate an already activated outlet");this._activatedRoute=e;const n=(t=t||this.resolver).resolveComponentFactory(e._futureSnapshot.routeConfig.component),r=this.parentContexts.getOrCreateContext(this.name).children,i=new ni(e,r,this.location.injector);this.activated=this.location.createComponent(n,this.location.length,i),this.changeDetector.markForCheck(),this.activateEvents.emit(this.activated.instance)}}class ni{constructor(e,t,n){this.route=e,this.childContexts=t,this.parent=n}get(e,t){return e===Vn?this.route:e===ei?this.childContexts:this.parent.get(e,t)}}class ri{}class ii{preload(e,t){return t().pipe(B(()=>Object(s.a)(null)))}}class oi{preload(e,t){return Object(s.a)(null)}}class si{constructor(e,t,n,r,i){this.router=e,this.injector=r,this.preloadingStrategy=i,this.loader=new zr(t,n,t=>e.triggerEvent(new Ut(t)),t=>e.triggerEvent(new qt(t)))}setUpPreloading(){this.subscription=this.router.events.pipe(Object(D.a)(e=>e instanceof Nt),re(()=>this.preload())).subscribe(()=>{})}preload(){const e=this.injector.get(r.w);return this.processRoutes(e,this.router.config)}ngOnDestroy(){this.subscription.unsubscribe()}processRoutes(e,t){const n=[];for(const r of t)if(r.loadChildren&&!r.canLoad&&r._loadedConfig){const e=r._loadedConfig;n.push(this.processRoutes(e.module,e.routes))}else r.loadChildren&&!r.canLoad?n.push(this.preloadConfig(e,r)):r.children&&n.push(this.processRoutes(e,r.children));return Object(a.a)(n).pipe(Object(T.a)(),Object(C.a)(e=>void 0))}preloadConfig(e,t){return this.preloadingStrategy.preload(t,()=>this.loader.load(e.injector,t).pipe(Object($.a)(e=>(t._loadedConfig=e,this.processRoutes(e.module,e.routes)))))}}class ai{constructor(e,t,n={}){this.router=e,this.viewportScroller=t,this.options=n,this.lastId=0,this.lastSource="imperative",this.restoredId=0,this.store={},n.scrollPositionRestoration=n.scrollPositionRestoration||"disabled",n.anchorScrolling=n.anch
1orScrolling||"disabled"}init(){"disabled"!==this.options.scrollPositionRestoration&&this.viewportScroller.setHistoryScrollRestoration("manual"),this.routerEventsSubscription=this.createScrollEvents(),this.scrollEventsSubscription=this.consumeScrollEvents()}createScrollEvents(){return this.router.events.subscribe(e=>{e instanceof Ot?(this.store[this.lastId]=this.viewportScroller.getScrollPosition(),this.lastSource=e.navigationTrigger,this.restoredId=e.restoredState?e.restoredState.navigationId:0):e instanceof Nt&&(this.lastId=e.id,this.scheduleScrollEvent(e,this.router.parseUrl(e.urlAfterRedirects).fragment))})}consumeScrollEvents(){return this.router.events.subscribe(e=>{e instanceof Qt&&(e.position?"top"===this.options.scrollPositionRestoration?this.viewportScroller.scrollToPosition([0,0]):"enabled"===this.options.scrollPositionRestoration&&this.viewportScroller.scrollToPosition(e.position):e.anchor&&"enabled"===this.options.anchorScrolling?this.viewportScroller.scrollToAnchor(e.anchor):"disabled"!==this.options.scrollPositionRestoration&&this.viewportScroller.scrollToPosition([0,0]))})}scheduleScrollEvent(e,t){this.router.triggerEvent(new Qt(e,"popstate"===this.lastSource?this.store[this.restoredId]:null,t))}ngOnDestroy(){this.routerEventsSubscription&&this.routerEventsSubscription.unsubscribe(),this.scrollEventsSubscription&&this.scrollEventsSubscription.unsubscribe()}}const ui=new r.p("ROUTER_CONFIGURATION"),li=new r.p("ROUTER_FORROOT_GUARD"),ci=[o.h,{provide:yn,useClass:bn},{provide:Yr,useFactory:yi,deps:[r.g,yn,ei,o.h,r.q,r.v,r.i,Hr,ui,[Wr,new r.z],[qr,new r.z]]},ei,{provide:Vn,useFactory:bi,deps:[Yr]},{provide:r.v,useClass:r.J},si,oi,ii,{provide:ui,useValue:{enableTracing:!1}}];function hi(){return new r.x("Router",Yr)}class di{constructor(e,t){}static forRoot(e,t){return{ngModule:di,providers:[ci,gi(e),{provide:li,useFactory:mi,deps:[[Yr,new r.z,new r.I]]},{provide:ui,useValue:t||{}},{provide:o.i,useFactory:pi,deps:[o.p,[new r.o(o.a),new r.z],ui]},{provide:ai,useFactory:fi,deps:[Yr,o.s,ui]},{provide:ri,useExisting:t&&t.preloadingStrategy?t.preloadingStrategy:oi},{provide:r.x,multi:!0,useFactory:hi},[vi,{provide:r.d,multi:!0,useFactory:wi,deps:[vi]},{provide:Si,useFactory:_i,deps:[vi]},{provide:r.b,multi:!0,useExisting:Si}]]}}static forChild(e){return{ngModule:di,providers:[gi(e)]}}}function fi(e,t,n){return n.scrollOffset&&t.setOffset(n.scrollOffset),new ai(e,t,n)}function pi(e,t,n={}){return n.useHash?new o.f(e,t):new o.o(e,t)}function mi(e){if(e)throw new Error("RouterModule.forRoot() called twice. Lazy loaded modules should use RouterModule.forChild() instead.");return"guarded"}function gi(e){return[{provide:r.a,multi:!0,useValue:e},{provide:Hr,multi:!0,useValue:e}]}function yi(e,t,n,r,i,o,s,a,u={},l,c){const h=new Yr(null,t,n,r,i,o,s,an(a));if(l&&(h.urlHandlingStrategy=l),c&&(h.routeReuseStrategy=c),u.errorHandler&&(h.errorHandler=u.errorHandler),u.malformedUriErrorHandler&&(h.malformedUriErrorHandler=u.malformedUriErrorHandler),u.enableTracing){const e=pe();h.events.subscribe(t=>{e.logGroup(`Router Event: ${t.constructor.name}`),e.log(t.toString()),e.log(t),e.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 bi(e){return e.routerState.root}class vi{constructor(e){this.injector=e,this.initNavigation=!1,this.resultOfPreactivationDone=new u.a}appInitializer(){return this.injector.get(o.g,Promise.resolve(null)).then(()=>{let e=null;const t=new Promise(t=>e=t),n=this.injector.get(Yr),r=this.injector.get(ui);if(this.isLegacyDisabled(r)||this.isLegacyEnabled(r))e(!0);else if("disabled"===r.initialNavigation)n.setUpLocationChangeListener(),e(!0);else{if("enabled"!==r.initialNavigation)throw new Error(`Invalid initialNavigation options: '${r.initialNavigation}'`);n.hooks.afterPreactivation=()=>this.initNavigation?Object(s.a)(null):(this.initNavigation=!0,e(!0),this.resultOfPreactivationDone),n.initialNavigation()}return t})}bootstrapListener(e){const t=this.injector.get(ui),n=this.injector.get(si),i=this.injector.get(ai),o=this.injector.get(Yr),s=this.injector.get(r.g);e===s.components[0]&&(this.isLegacyEnabled(t)?o.initialNavigation():this.isLegacyDisabled(t)&&o.setUpLocationChangeListener(),n.setUpPreloading(),i.init(),o.resetRootComponentType(s.componentTypes[0]),this.resultOfPreactivationDone.next(null),this.resultOfPreactivationDone.complete())}isLegacyEnabled(e){return"legacy_enabled"===e.initialNavigation||!0===e.initialNavigation||void 0===e.initialNavigation}isLegacyDisabled(e){return"legacy_disabled"===e.initialNavigation||!1===e.initialNavigation}}function wi(e){return e.appInitializer.bind(e)}function _i(e){return e.bootstrapListener.bind(e)}const Si=new r.p("Router Initializer");h.a.prototype.filter=function(e,t){return Object(D.a)(e,t)(this)};var Ei=0,Ci=5,Ti=0;class Ii{constructor(e,t,n,r,i){this.renderer=e,this.router=t,this.document=n,this.element=r,this.location=i}hasScrolled(){var e=window.pageYOffset;if(!(Math.abs(Ei-e)<=Ci)){var t=document.getElementsByTagName("nav")[0];e>Ei&&e>Ti?t.classList.contains("headroom--pinned")&&(t.classList.remove("headroom--pinned"),t.classList.add("headroom--unpinned")):e+window.innerHeight<document.body.scrollHeight&&t.classList.contains("headroom--unpinned")&&(t.classList.remove("headroom--unpinned"),t.classList.add("headroom--pinned")),Ei=e}}ngOnInit(){var e=this.element.nativeElement.children[0].children[0];this._router=this.router.events.filter(e=>e instanceof Nt).subscribe(t=>{window.outerWidth>991?window.document.children[0].scrollTop=0:window.document.activeElement.scrollTop=0,this.renderer.listenGlobal("window","
1scroll",t=>{window.scrollY>150||window.pageYOffset>150?e.classList.add("headroom--not-top"):e.classList.remove("headroom--not-top")})}),this.hasScrolled()}}n("XoHu");const Di=new r.p("NgValueAccessor");class xi{constructor(){this._accessors=[]}add(e,t){this._accessors.push([e,t])}remove(e){for(let t=this._accessors.length-1;t>=0;--t)if(this._accessors[t][1]===e)return void this._accessors.splice(t,1)}select(e){this._accessors.forEach(t=>{this._isSameGroup(t,e)&&t[1]!==e&&t[1].fireUncheck(e.value)})}_isSameGroup(e,t){return!!e[0].control&&e[0]._parent===t._control._parent&&e[1].name===t.name}}class ki{constructor(e,t,n){this._element=e,this._renderer=t,this._select=n,this._select&&(this.id=this._select._registerOption())}set ngValue(e){null!=this._select&&(this._select._optionMap.set(this.id,e),this._setElementValue(function(e,t){return null==e?`${t}`:(t&&"object"==typeof t&&(t="Object"),`${e}: ${t}`.slice(0,50))}(this.id,e)),this._select.writeValue(this._select.value))}set value(e){this._setElementValue(e),this._select&&this._select.writeValue(this._select.value)}_setElementValue(e){this._renderer.setProperty(this._element.nativeElement,"value",e)}ngOnDestroy(){this._select&&(this._select._optionMap.delete(this.id),this._select.writeValue(this._select.value))}}function Ai(e,t){return null==e?`${t}`:("string"==typeof t&&(t=`'${t}'`),t&&"object"==typeof t&&(t="Object"),`${e}: ${t}`.slice(0,50))}class Oi{constructor(e,t,n){this._element=e,this._renderer=t,this._select=n,this._select&&(this.id=this._select._registerOption(this))}set ngValue(e){null!=this._select&&(this._value=e,this._setElementValue(Ai(this.id,e)),this._select.writeValue(this._select.value))}set value(e){this._select?(this._value=e,this._setElementValue(Ai(this.id,e)),this._select.writeValue(this._select.value)):this._setElementValue(e)}_setElementValue(e){this._renderer.setProperty(this._element.nativeElement,"value",e)}_setSelected(e){this._renderer.setProperty(this._element.nativeElement,"selected",e)}ngOnDestroy(){this._select&&(this._select._optionMap.delete(this.id),this._select.writeValue(this._select.value))}}const Ni=new r.p("NgFormSelectorWarning");class Ri{}class Mi{static withConfig(e){return{ngModule:Mi,providers:[{provide:Ni,useValue:e.warnOnDeprecatedNgFormSelector}]}}}var Pi=n("3N8a");const Li=new(n("IjjT").a)(Pi.a);function Fi(e){return!Object(p.a)(e)&&e-parseFloat(e)+1>=0}function ji(e){const{index:t,period:n,subscriber:r}=e;if(r.next(t),!r.closed){if(-1===n)return r.complete();e.index=t+1,this.schedule(e,n)}}var Vi=n("VRyK");function Ui(e,t,n,r){return Object(se.a)(n)&&(r=n,n=void 0),r?Ui(e,t,n).pipe(Object(C.a)(e=>Object(p.a)(e)?r(...e):r(e))):new h.a(r=>{!function e(t,n,r,i,o){let s;if(function(e){return e&&"function"==typeof e.addEventListener&&"function"==typeof e.removeEventListener}(t)){const e=t;t.addEventListener(n,r,o),s=()=>e.removeEventListener(n,r,o)}else if(function(e){return e&&"function"==typeof e.on&&"function"==typeof e.off}(t)){const e=t;t.on(n,r),s=()=>e.off(n,r)}else if(function(e){return e&&"function"==typeof e.addListener&&"function"==typeof e.removeListener}(t)){const e=t;t.addListener(n,r),s=()=>e.removeListener(n,r)}else{if(!t||!t.length)throw new TypeError("Invalid event target");for(let s=0,a=t.length;s<a;s++)e(t[s],n,r,i,o)}i.add(s)}(e,t,function(e){r.next(arguments.length>1?Array.prototype.slice.call(arguments):e)},r,n)})}function qi(e){return t=>t.lift(new Bi(e))}class Bi{constructor(e){this.notifier=e}call(e,t){const n=new Hi(e),r=Object(g.a)(n,this.notifier);return r&&!n.seenValue?(n.add(r),t.subscribe(n)):n}}class Hi extends m.a{constructor(e){super(e),this.seenValue=!1}notifyNext(e,t,n,r,i){this.seenValue=!0,this.complete()}notifyComplete(){}}function zi(...e){return t=>{let n;return"function"==typeof e[e.length-1]&&(n=e.pop()),t.lift(new Wi(e,n))}}class Wi{constructor(e,t){this.observables=e,this.project=t}call(e,t){return t.subscribe(new Qi(e,this.observables,this.project))}}class Qi extends m.a{constructor(e,t,n){super(e),this.observables=t,this.project=n,this.toRespond=[];const r=t.length;this.values=new Array(r);for(let i=0;i<r;i++)this.toRespond.push(i);for(let i=0;i<r;i++){let e=t[i];this.add(Object(g.a)(this,e,e,i))}}notifyNext(e,t,n,r,i){this.values[n]=t;const o=this.toRespond;if(o.length>0){const e=o.indexOf(n);-1!==e&&o.splice(e,1)}}notifyComplete(){}_next(e){if(0===this.toRespond.length){const t=[e,...this.values];this.project?this._tryProject(t):this.destination.next(t)}}_tryProject(e){let t;try{t=this.project.apply(this,e)}catch(n){return void this.destination.error(n)}this.destination.next(t)}}function Gi(e){return parseInt(`${e}`,10)}function Ki(e){return null!=e?`${e}`:""}function $i(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e}function Yi(e){return null!=e}function Zi(e,t){return e&&e.className&&e.className.split&&e.className.split(/\s+/).indexOf(t)>=0}n("w1tV");class Ji{static forRoot(){return{ngModule:Ji}}}
1let Xi=(()=>{class e{constructor(){this.dismissible=!0,this.type="warning"}}return e.ngInjectableDef=Object(r.S)({factory:function(){return new e},token:e,providedIn:"root"}),e})();class eo{constructor(e,t,n){this._renderer=t,this._element=n,this.close=new r.m,this.dismissible=e.dismissible,this.type=e.type}closeHandler(){this.close.emit(null)}ngOnChanges(e){const t=e.type;t&&!t.firstChange&&(this._renderer.removeClass(this._element.nativeElement,`alert-${t.previousValue}`),this._renderer.addClass(this._element.nativeElement,`alert-${t.currentValue}`))}ngOnInit(){this._renderer.addClass(this._element.nativeElement,`alert-${this.type}`)}}class to{static forRoot(){return{ngModule:to}}}class no{static forRoot(){return{ngModule:no}}}let ro=(()=>{class e{constructor(){this.interval=5e3,this.wrap=!0,this.keyboard=!0,this.pauseOnHover=!0,this.showNavigationArrows=!0,this.showNavigationIndicators=!0}}return e.ngInjectableDef=Object(r.S)({factory:function(){return new e},token:e,providedIn:"root"}),e})(),io=0;class oo{constructor(e){this.tplRef=e,this.id=`ngb-slide-${io++}`}}class so{constructor(e,t,n,i){this._platformId=t,this._ngZone=n,this._cd=i,this._destroy$=new u.a,this._start$=new u.a,this._stop$=new u.a,this.slide=new r.m,this.interval=e.interval,this.wrap=e.wrap,this.keyboard=e.keyboard,this.pauseOnHover=e.pauseOnHover,this.showNavigationArrows=e.showNavigationArrows,this.showNavigationIndicators=e.showNavigationIndicators}ngAfterContentInit(){Object(o.w)(this._platformId)&&this._ngZone.runOutsideAngular(()=>{this._start$.pipe(Object(C.a)(()=>this.interval),Object(D.a)(e=>e>0&&this.slides.length>0),J(e=>(function(e=0,t,n){let r=-1;return Fi(void 0)?r=Number(void 0)<1?1:Number(void 0):Object(f.a)(void 0)&&(n=void 0),Object(f.a)(n)||(n=Li),new h.a(t=>{const i=Fi(e)?e:+e-n.now();return n.schedule(ji,i,{index:0,period:r,subscriber:t})})})(e).pipe(qi(Object(Vi.a)(this._stop$,this._destroy$))))).subscribe(()=>this._ngZone.run(()=>this.next())),this._start$.next()}),this.slides.changes.pipe(qi(this._destroy$)).subscribe(()=>this._cd.markForCheck())}ngAfterContentChecked(){let e=this._getSlideById(this.activeId);this.activeId=e?e.id:this.slides.length?this.slides.first.id:null}ngOnDestroy(){this._destroy$.next()}ngOnChanges(e){"interval"in e&&!e.interval.isFirstChange()&&this._start$.next()}select(e){this._cycleToSelected(e,this._getSlideEventDirection(this.activeId,e))}prev(){this._cycleToSelected(this._getPrevSlide(this.activeId),ao.RIGHT)}next(){this._cycleToSelected(this._getNextSlide(this.activeId),ao.LEFT)}pause(){this._stop$.next()}cycle(){this._start$.next()}_cycleToSelected(e,t){let n=this._getSlideById(e);n&&n.id!==this.activeId&&(this.slide.emit({prev:this.activeId,current:n.id,direction:t}),this._start$.next(),this.activeId=n.id),this._cd.markForCheck()}_getSlideEventDirection(e,t){return this._getSlideIdxById(e)>this._getSlideIdxById(t)?ao.RIGHT:ao.LEFT}_getSlideById(e){return this.slides.find(t=>t.id===e)}_getSlideIdxById(e){return this.slides.toArray().indexOf(this._getSlideById(e))}_getNextSlide(e){const t=this.slides.toArray(),n=this._getSlideIdxById(e);return n===t.length-1?this.wrap?t[0].id:t[t.length-1].id:t[n+1].id}_getPrevSlide(e){const t=this.slides.toArray(),n=this._getSlideIdxById(e);return 0===n?this.wrap?t[t.length-1].id:t[0].id:t[n-1].id}}const ao={LEFT:"left",RIGHT:"right"};class uo{static forRoot(){return{ngModule:uo}}}class lo{constructor(){this.collapsed=!1}}class co{static forRoot(){return{ngModule:co}}}class ho{static from(e){return e instanceof ho?e:e?new ho(e.year,e.month,e.day):null}constructor(e,t,n){this.year=$i(e)?e:null,this.month=$i(t)?t:null,this.day=$i(n)?n:null}equals(e){return e&&this.year===e.year&&this.month===e.month&&this.day===e.day}before(e){return!!e&&(this.year===e.year?this.month===e.month?this.day!==e.day&&this.day<e.day:this.month<e.month:this.year<e.year)}after(e){return!!e&&(this.year===e.year?this.month===e.month?this.day!==e.day&&this.day>e.day:this.month>e.month:this.year>e.year)}}function fo(e){return new ho(e.getFullYear(),e.getMonth()+1,e.getDate())}function po(e){const t=new Date(e.year,e.month-1,e.day,12);return isNaN(t.getTime())||t.setFullYear(e.year),t}function mo(){return new yo}let go=(()=>{class e{}return e.ngInjectableDef=Object(r.S)({factory:mo,token:e,providedIn:"root"}),e})();class yo extends go{getDaysPerWeek(){return 7}getMonths(){return[1,2,3,4,5,6,7,8,9,10,11,12]}getWeeksPerMonth(){return 6}getNext(e,t="d",n=1){let r=po(e);
1switch(t){case"y":return new ho(e.year+n,1,1);case"m":r=new Date(e.year,e.month+n-1,1,12);break;case"d":r.setDate(r.getDate()+n);break;default:return e}return fo(r)}getPrev(e,t="d",n=1){return this.getNext(e,t,-n)}getWeekday(e){let t=po(e).getDay();return 0===t?7:t}getWeekNumber(e,t){7===t&&(t=0);const n=po(e[(11-t)%7]);n.setDate(n.getDate()+4-(n.getDay()||7));const r=n.getTime();return n.setMonth(0),n.setDate(1),Math.floor(Math.round((r-n.getTime())/864e5)/7)+1}getToday(){return fo(new Date)}isValid(e){if(!(e&&$i(e.year)&&$i(e.month)&&$i(e.day)))return!1;if(0===e.year)return!1;const t=po(e);return!isNaN(t.getTime())&&t.getFullYear()===e.year&&t.getMonth()+1===e.month&&t.getDate()===e.day}}function bo(e,t){return!function(e,t){return!e&&!t||!!e&&!!t&&e.equals(t)}(e,t)}function vo(e,t,n){return e&&t&&e.before(t)?t:e&&n&&e.after(n)?n:e}function wo(e,t){const{minDate:n,maxDate:r,disabled:i,markDisabled:o}=t;return!(!Yi(e)||i||o&&o(e,{year:e.year,month:e.month})||n&&e.before(n)||r&&e.after(r))}let _o=(()=>{class e{getDayNumerals(e){return`${e.day}`}getWeekNumerals(e){return`${e}`}getYearNumerals(e){return`${e}`}}return e.ngInjectableDef=Object(r.S)({factory:function(){return e=Object(r.W)(r.t),new So(e);var e},token:e,providedIn:"root"}),e})();class So extends _o{constructor(e){super(),this._locale=e;const t=Object(o.u)(e,o.e.Standalone,o.r.Short);this._weekdaysShort=t.map((e,n)=>t[(n+1)%7]),this._monthsShort=Object(o.v)(e,o.e.Standalone,o.r.Abbreviated),this._monthsFull=Object(o.v)(e,o.e.Standalone,o.r.Wide)}getWeekdayShortName(e){return this._weekdaysShort[e-1]}getMonthShortName(e){return this._monthsShort[e-1]}getMonthFullName(e){return this._monthsFull[e-1]}getDayAriaLabel(e){const t=new Date(e.year,e.month-1,e.day);return Object(o.t)(t,"fullDate",this._locale)}}class Eo{constructor(e,t){this._calendar=e,this._i18n=t,this._model$=new u.a,this._select$=new u.a,this._state={disabled:!1,displayMonths:1,firstDayOfWeek:1,focusVisible:!1,months:[],navigation:"select",outsideDays:"visible",prevDisabled:!1,nextDisabled:!1,selectBoxes:{years:[],months:[]},selectedDate:null}}get model$(){return this._model$.pipe(Object(D.a)(e=>e.months.length>0))}get select$(){return this._select$.pipe(Object(D.a)(e=>null!==e))}set dayTemplateData(e){this._state.dayTemplateData!==e&&this._nextState({dayTemplateData:e})}set disabled(e){this._state.disabled!==e&&this._nextState({disabled:e})}set displayMonths(e){$i(e=Gi(e))&&e>0&&this._state.displayMonths!==e&&this._nextState({displayMonths:e})}set firstDayOfWeek(e){$i(e=Gi(e))&&e>=0&&this._state.firstDayOfWeek!==e&&this._nextState({firstDayOfWeek:e})}set focusVisible(e){this._state.focusVisible===e||this._state.disabled||this._nextState({focusVisible:e})}set maxDate(e){const t=this.toValidDate(e,null);bo(this._state.maxDate,t)&&this._nextState({maxDate:t})}set markDisabled(e){this._state.markDisabled!==e&&this._nextState({markDisabled:e})}set minDate(e){const t=this.toValidDate(e,null);bo(this._state.minDate,t)&&this._nextState({minDate:t})}set navigation(e){this._state.navigation!==e&&this._nextState({navigation:e})}set outsideDays(e){this._state.outsideDays!==e&&this._nextState({outsideDays:e})}focus(e){!this._state.disabled&&this._calendar.isValid(e)&&bo(this._state.focusDate,e)&&this._nextState({focusDate:e})}focusMove(e,t){this.focus(this._calendar.getNext(this._state.focusDate,e,t))}focusSelect(){wo(this._state.focusDate,this._state)&&this.select(this._state.focusDate,{emitEvent:!0})}open(e){const t=this.toValidDate(e,this._calendar.getToday());this._state.disabled||this._nextState({firstDate:t})}reset(e){this._state=e}select(e,t={}){const n=this.toValidDate(e,null);this._state.disabled||(bo(this._state.selectedDate,n)&&this._nextState({selectedDate:n}),t.emitEvent&&wo(n,this._state)&&this._select$.next(n))}toValidDate(e,t){const n=ho.from(e);return void 0===t&&(t=this._calendar.getToday()),this._calendar.isValid(n)?n:t}_nextState(e){const t=this._updateState(e);this._patchContexts(t),this._state=t,this._model$.next(this._state)}_patchContexts(e){const{months:t,displayMonths:n,selectedDate:r,focusDate:i,focusVisible:o,disabled:s,outsideDays:a}=e;
1e.months.forEach(e=>{e.weeks.forEach(u=>{u.days.forEach(u=>{i&&(u.context.focused=i.equals(u.date)&&o),u.tabindex=!s&&u.date.equals(i)&&i.month===e.number?0:-1,!0===s&&(u.context.disabled=!0),void 0!==r&&(u.context.selected=null!==r&&r.equals(u.date)),e.number!==u.date.month&&(u.hidden="hidden"===a||"collapsed"===a||n>1&&u.date.after(t[0].firstDate)&&u.date.before(t[n-1].lastDate))})})})}_updateState(e){const t=Object.assign({},this._state,e);let n=t.firstDate;if(("minDate"in e||"maxDate"in e)&&(function(e,t){if(t&&e&&t.before(e))throw new Error(`'maxDate' ${t} should be greater than 'minDate' ${e}`)}(t.minDate,t.maxDate),t.focusDate=vo(t.focusDate,t.minDate,t.maxDate),t.firstDate=vo(t.firstDate,t.minDate,t.maxDate),n=t.focusDate),"disabled"in e&&(t.focusVisible=!1),"selectedDate"in e&&0===this._state.months.length&&(n=t.selectedDate),"focusVisible"in e)return t;if("focusDate"in e&&(t.focusDate=vo(t.focusDate,t.minDate,t.maxDate),n=t.focusDate,0!==t.months.length&&!t.focusDate.before(t.firstDate)&&!t.focusDate.after(t.lastDate)))return t;if("firstDate"in e&&(t.firstDate=vo(t.firstDate,t.minDate,t.maxDate),n=t.firstDate),n){const i=function(e,t,n,r,i){const{displayMonths:o,months:s}=n,a=s.splice(0,s.length);return Array.from({length:o},(n,r)=>{const o=e.getNext(t,"m",r);if(s[r]=null,!i){const e=a.findIndex(e=>e.firstDate.equals(o));-1!==e&&(s[r]=a.splice(e,1)[0])}return o}).forEach((t,i)=>{null===s[i]&&(s[i]=function(e,t,n,r,i={}){const{dayTemplateData:o,minDate:s,maxDate:a,firstDayOfWeek:u,markDisabled:l,outsideDays:c}=n,h=e.getToday();i.firstDate=null,i.lastDate=null,i.number=t.month,i.year=t.year,i.weeks=i.weeks||[],i.weekdays=i.weekdays||[],t=function(e,t,n){const r=e.getDaysPerWeek(),i=new ho(t.year,t.month,1),o=e.getWeekday(i)%r;return e.getPrev(i,"d",(r+o-n)%r)}(e,t,u);for(let d=0;d<e.getWeeksPerMonth();d++){let n=i.weeks[d];n||(n=i.weeks[d]={number:0,days:[],collapsed:!0});const f=n.days;for(let u=0;u<e.getDaysPerWeek();u++){0===d&&(i.weekdays[u]=e.getWeekday(t));const n=new ho(t.year,t.month,t.day),c=e.getNext(n),p=r.getDayAriaLabel(n);let m=!!(s&&n.before(s)||a&&n.after(a));!m&&l&&(m=l(n,{month:i.number,year:i.year}));let g=n.equals(h),y=o?o(n,{month:i.number,year:i.year}):void 0;null===i.firstDate&&n.month===i.number&&(i.firstDate=n),n.month===i.number&&c.month!==i.number&&(i.lastDate=n);let b=f[u];b||(b=f[u]={}),b.date=n,b.context=Object.assign(b.context||{},{$implicit:n,date:n,data:y,currentMonth:i.number,disabled:m,focused:!1,selected:!1,today:g}),b.tabindex=-1,b.ariaLabel=p,b.hidden=!1,t=c}n.number=e.getWeekNumber(f.map(e=>e.date),u),n.collapsed="collapsed"===c&&f[0].date.month!==i.number&&f[f.length-1].date.month!==i.number}return i}(e,t,n,r,a.shift()||{}))}),s}(this._calendar,n,t,this._i18n,"dayTemplateData"in e||"firstDayOfWeek"in e||"markDisabled"in e||"minDate"in e||"maxDate"in e||"disabled"in e||"outsideDays"in e);t.months=i,t.firstDate=i.length>0?i[0].firstDate:void 0,t.lastDate=i.length>0?i[i.length-1].lastDate:void 0,"selectedDate"in e&&!wo(t.selectedDate,t)&&(t.selectedDate=null),"firstDate"in e&&(void 0===t.focusDate||t.focusDate.before(t.firstDate)||t.focusDate.after(t.lastDate))&&(t.focusDate=n);const o=!this._state.firstDate||this._state.firstDate.year!==t.firstDate.year,s=!this._state.firstDate||this._state.firstDate.month!==t.firstDate.month;"select"===t.navigation?(("minDate"in e||"maxDate"in e||0===t.selectBoxes.years.length||o)&&(t.selectBoxes.years=function(e,t,n){if(!e)return[];const r=t&&t.year||e.year-10;return Array.from({length:(n&&n.year||e.year+10)-r+1},(e,t)=>r+t)}(t.firstDate,t.minDate,t.maxDate)),("minDate"in e||"maxDate"in e||0===t.selectBoxes.months.length||o)&&(t.selectBoxes.months=function(e,t,n,r){if(!t)return[];let i=e.getMonths(t.year);if(n&&t.year===n.year){const e=i.findIndex(e=>e===n.month);i=i.slice(e)}if(r&&t.year===r.year){const e=i.findIndex(e=>e===r.month);i=i.slice(0,e+1)}return i}(this._calendar,t.firstDate,t.minDate,t.maxDate))):t.selectBoxes={years:[],months:[]},"arrows"!==t.navigation&&"select"!==t.navigation||!(s||o||"minDate"in e||"maxDate"in e||"disabled"in e)||(t.prevDisabled=t.disabled||function(e,n,r){const i=e.getPrev(t.firstDate,"m");return r&&(i.year===r.year&&i.month<r.month||i.year<r.year&&1===r.month)}(this._calendar,0,t.minDate),t.nextDisabled=t.disabled||(r=t.maxDate)&&this._calendar.getNext(t.lastDate,"m").after(r))}var r;return t}}const Co=function(){var e={Tab:9,Enter:13,Escape:27,Space:32,PageUp:33,PageDown:34,End:35,Home:36,ArrowLeft:37,ArrowUp:38,ArrowRight:39,ArrowDown:40};return e[e.Tab]="Tab",e[e.Enter]="Enter",e[e.Escape]="Escape",e[e.Space]="Space",e[e.PageUp]="PageUp",e[e.PageDown]="PageDown",e[e.End]="End",e[e.Home]="Home",e[e.ArrowLeft]="ArrowLeft",e[e.ArrowUp]="ArrowUp",e[e.ArrowRight]="ArrowRight",e[e.ArrowDown]="ArrowDown",e}();class To{constructor(e,t){this._service=e,this._calendar=t,e.model$.subscribe(e=>{this._minDate=e.minDate,this._maxDate=e.maxDate,this._firstViewDate=e.firstDate,this._lastViewDate=e.lastDate})}processKey(e){switch(e.which){case Co.PageUp:this._service.focusMove(e.shiftKey?"y":"m",-1);break;case Co.PageDown:this._service.focusMove(e.shiftKey?"y":"m",1);break;case Co.End:this._service.focus(e.shiftKey?this._maxDate:this._lastViewDate);break;case Co.Home:this._service.focus(e.shiftKey?this._minDate:this._firstViewDate);break;case Co.ArrowLeft:this._service.focusMove("d",-1);break;case Co.ArrowUp:this._service.focusMove("d",-this._calendar.getDaysPerWeek());break;case Co.ArrowRight:this._service.focusMove("d",1);break;case Co.ArrowDown:this._service.focusMove("d",this._calendar.getDaysPerWeek());break;case Co.Enter:case Co.Space:this._service.focusSelect();break;default:return}e.preventDefault(),e.stopPropagation()}}const Io=function(){var e={PREV:0,NEXT:1};return e[e.PREV]="PREV",e[e.NEXT]="NEXT",e}();let Do=(()=>{class e{constructor(){this.displayMonths=1,this.firstDayOfWeek=1,this.navigation="select",this.outsideDays="visible",this.showWeekdays=!0,this.showWeekNumbers=!1}}return e.ngInjectableDef=Object(r.S)({factory:function(){return new e},token:e,providedIn:"root"}),e})();function xo(){return new Ao}let ko=(()=>{class e{}return e.ngInjectableDef=Object(r.S)({factory:xo,token:e,providedIn:"root"}),e})();class Ao extends ko{fromModel(e){return e&&$i(e.year)&&$i(e.month)&&$i(e.day)?{year:e.year,month:e.month,day:e.day}:null}toModel(e){return e&&$i(e.year)&&$i(e.month)&&$i(e.day)?{year:e.year,month:e.month,day:e.day}:null}}class Oo{constructor(e,t,n,i,o,s,a,l,c){this._keyMapService=e,this._service=t,this._calendar=n,this.i18n=i,this._cd=s,this._elementRef=a,this._ngbDateAdapter=l,this._ngZone=c,this._destroyed$=new u.a,this.navigate=new r.m,this.select=new r.m,this.onChange=e=>{},this.onTouched=()=>{},["dayTemplate","dayTemplateData","displayMonths","firstDayOfWeek","footerTemplate","markDisabled","minDate","maxDate","navigation","outsideDays","showWeekdays","showWeekNumbers","startDate"].forEach(e
1=>this[e]=o[e]),t.select$.pipe(qi(this._destroyed$)).subscribe(e=>{this.select.emit(e)}),t.model$.pipe(qi(this._destroyed$)).subscribe(e=>{const t=e.firstDate,n=this.model?this.model.firstDate:null;let r=!1;if(!t.equals(n)&&(this.navigate.emit({current:n?{year:n.year,month:n.month}:null,next:{year:t.year,month:t.month},preventDefault:()=>r=!0}),r&&null!==n))return void this._service.reset(this.model);const i=e.selectedDate,o=e.focusDate,a=this.model?this.model.focusDate:null;this.model=e,bo(i,this._controlValue)&&(this._controlValue=i,this.onTouched(),this.onChange(this._ngbDateAdapter.toModel(i))),bo(o,a)&&a&&e.focusVisible&&this.focus(),s.markForCheck()})}focus(){this._ngZone.onStable.asObservable().pipe(W(1)).subscribe(()=>{const e=this._elementRef.nativeElement.querySelector('div.ngb-dp-day[tabindex="0"]');e&&e.focus()})}navigateTo(e){this._service.open(ho.from(e?e.day?e:Object.assign({},e,{day:1}):null))}ngAfterContentInit(){this._ngZone.runOutsideAngular(()=>{const e=Ui(this._monthsEl.nativeElement,"focusin"),t=Ui(this._monthsEl.nativeElement,"focusout");Object(Vi.a)(e,t).pipe(Object(D.a)(({target:e,relatedTarget:t})=>!(Zi(e,"ngb-dp-day")&&Zi(t,"ngb-dp-day"))),qi(this._destroyed$)).subscribe(({type:e})=>this._ngZone.run(()=>this._service.focusVisible="focusin"===e))})}ngOnDestroy(){this._destroyed$.next()}ngOnInit(){void 0===this.model&&(["dayTemplateData","displayMonths","markDisabled","firstDayOfWeek","navigation","minDate","maxDate","outsideDays"].forEach(e=>this._service[e]=this[e]),this.navigateTo(this.startDate))}ngOnChanges(e){["dayTemplateData","displayMonths","markDisabled","firstDayOfWeek","navigation","minDate","maxDate","outsideDays"].filter(t=>t in e).forEach(e=>this._service[e]=this[e]),"startDate"in e&&this.navigateTo(this.startDate)}onDateSelect(e){this._service.focus(e),this._service.select(e,{emitEvent:!0})}onKeyDown(e){this._keyMapService.processKey(e)}onNavigateDateSelect(e){this._service.open(e)}onNavigateEvent(e){switch(e){case Io.PREV:this._service.open(this._calendar.getPrev(this.model.firstDate,"m",1));break;case Io.NEXT:this._service.open(this._calendar.getNext(this.model.firstDate,"m",1))}}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}setDisabledState(e){this._service.disabled=e}writeValue(e){this._controlValue=ho.from(this._ngbDateAdapter.fromModel(e)),this._service.select(this._controlValue)}}class No{constructor(e){this.i18n=e,this.select=new r.m}doSelect(e){e.context.disabled||e.hidden||this.select.emit(e.date)}}class Ro{constructor(e){this.i18n=e,this.navigation=Io,this.months=[],this.navigate=new r.m,this.select=new r.m}}"undefined"!=typeof navigator&&navigator.userAgent&&navigator;const Mo=["a[href]","button:not([disabled])",'input:not([disabled]):not([type="hidden"])',"select:not([disabled])","textarea:not([disabled])","[contenteditable]",'[tabindex]:not([tabindex="-1"])'].join(", ");function Po(e){const t=Array.from(e.querySelectorAll(Mo)).filter(e=>-1!==e.tabIndex);return[t[0],t[t.length-1]]}const Lo=(e,t,n=!1)=>{const r=Ui(e,"focusin").pipe(qi(t),Object(C.a)(e=>e.target));Ui(e,"keydown").pipe(qi(t),Object(D.a)(e=>e.which===Co.Tab),zi(r)).subscribe(([t,n])=>{const[r,i]=Po(e);n!==r&&n!==e||!t.shiftKey||(i.focus(),t.preventDefault()),n!==i||t.shiftKey||(r.focus(),t.preventDefault())}),n&&Ui(e,"click").pipe(qi(t),zi(r),Object(C.a)(e=>e[1])).subscribe(e=>e.focus())};class Fo{constructor(e){this.i18n=e}isMuted(){return!this.selected&&(this.date.month!==this.currentMonth||this.disabled)}}class jo{constructor(e){this.i18n=e,this.select=new r.m}changeMonth(e){this.select.emit(new ho(this.date.year,Gi(e),1))}changeYear(e){this.select.emit(new ho(Gi(e),this.date.month,1))}}class Vo{static forRoot(){return{ngModule:Vo}}}class Uo{static forRoot(){return{ngModule:Uo}}}let qo=(()=>{class e{constructor(){this.backdrop=!0,this.keyboard=!0}}return e.ngInjectableDef=Object(r.S)({factory:function(){return new e},token:e,providedIn:"root"}),e})();class Bo{constructor(e,t,n){this.nodes=e,this.viewRef=t,this.componentRef=n}}const Ho=()=>{};let zo=(()=>{class e{constructor(e){this._document=e}compensate(){return this._isPresent()?this._adjustBody(this._getWidth()):Ho}_adjustBody(e){const t=this._document.body,n=t.style.paddingRight,r=parseFloat(window.getComputedStyle(t)["padding-right"]);return t.style["padding-right"]=`${r+e}px`,()=>t.style["padding-right"]=n}_isPresent(){const e=this._document.body.getBoundingClientRect();return e.left+e.right<window.innerWidth}_getWidth(){const e=this._document.createElement("div");e.className="modal-scrollbar-measure";const t=this._document.body;t.appendChild(e);const n=e.getBoundingClientRect().width-e.clientWidth;return t.removeChild(e),n}}return e.ngInjectableDef=Object(r.S)({factory:function(){return new e(Object(r.W)(o.c))},token:e,providedIn:"root"}),e})();class Wo{}class Qo{close(e){}dismiss(e){}}class Go{constructor(e,t,n,r){this._windowCmptRef=e,this._contentRef=t,this._backdropCmptRef=n,this._beforeDismiss=r,e.instance.dismissEvent.subscribe(e=>{this.dismiss(e)}),this.result=new Promise((e,t)=>
1{this._resolve=e,this._reject=t}),this.result.then(null,()=>{})}get componentInstance(){if(this._contentRef.componentRef)return this._contentRef.componentRef.instance}close(e){this._windowCmptRef&&(this._resolve(e),this._removeModalElements())}_dismiss(e){this._reject(e),this._removeModalElements()}dismiss(e){if(this._windowCmptRef)if(this._beforeDismiss){const t=this._beforeDismiss();t&&t.then?t.then(t=>{!1!==t&&this._dismiss(e)},()=>{}):!1!==t&&this._dismiss(e)}else this._dismiss(e)}_removeModalElements(){const e=this._windowCmptRef.location.nativeElement;if(e.parentNode.removeChild(e),this._windowCmptRef.destroy(),this._backdropCmptRef){const e=this._backdropCmptRef.location.nativeElement;e.parentNode.removeChild(e),this._backdropCmptRef.destroy()}this._contentRef&&this._contentRef.viewRef&&this._contentRef.viewRef.destroy(),this._windowCmptRef=null,this._backdropCmptRef=null,this._contentRef=null}}const Ko=function(){var e={BACKDROP_CLICK:0,ESC:1};return e[e.BACKDROP_CLICK]="BACKDROP_CLICK",e[e.ESC]="ESC",e}();class $o{constructor(e,t){this._document=e,this._elRef=t,this.backdrop=!0,this.keyboard=!0,this.dismissEvent=new r.m}backdropClick(e){!0===this.backdrop&&this._elRef.nativeElement===e.target&&this.dismiss(Ko.BACKDROP_CLICK)}escKey(e){this.keyboard&&!e.defaultPrevented&&this.dismiss(Ko.ESC)}dismiss(e){this.dismissEvent.emit(e)}ngOnInit(){this._elWithFocus=this._document.activeElement}ngAfterViewInit(){if(!this._elRef.nativeElement.contains(document.activeElement)){const e=this._elRef.nativeElement.querySelector("[ngbAutofocus]"),t=Po(this._elRef.nativeElement)[0];(e||t||this._elRef.nativeElement).focus()}}ngOnDestroy(){const e=this._document.body,t=this._elWithFocus;let n;(n=t&&t.focus&&e.contains(t)?t:e).focus(),this._elWithFocus=null}}let Yo=(()=>{class e{constructor(e,t,n,r,i){this._applicationRef=e,this._injector=t,this._document=n,this._scrollBar=r,this._rendererFactory=i,this._activeWindowCmptHasChanged=new u.a,this._ariaHiddenValues=new Map,this._backdropAttributes=["backdropClass"],this._modalRefs=[],this._windowAttributes=["ariaLabelledBy","backdrop","centered","keyboard","size","windowClass"],this._windowCmpts=[],this._activeWindowCmptHasChanged.subscribe(()=>{if(this._windowCmpts.length){const e=this._windowCmpts[this._windowCmpts.length-1];Lo(e.location.nativeElement,this._activeWindowCmptHasChanged),this._revertAriaHidden(),this._setAriaHidden(e.location.nativeElement)}})}open(e,t,n,r){const i=Yi(r.container)?this._document.querySelector(r.container):this._document.body,o=this._rendererFactory.createRenderer(null,null),s=this._scrollBar.compensate(),a=()=>{this._modalRefs.length||(o.removeClass(this._document.body,"modal-open"),this._revertAriaHidden())};if(!i)throw new Error(`The specified modal container "${r.container||"body"}" was not found in the DOM.`);const u=new Qo,l=this._getContentRef(e,r.injector||t,n,u);let c=!1!==r.backdrop?this._attachBackdrop(e,i):null,h=this._attachWindowComponent(e,i,l),d=new Go(h,l,c,r.beforeDismiss);return this._registerModalRef(d),this._registerWindowCmpt(h),d.result.then(s,s),d.result.then(a,a),u.close=e=>{d.close(e)},u.dismiss=e=>{d.dismiss(e)},this._applyWindowOptions(h.instance,r),1===this._modalRefs.length&&o.addClass(this._document.body,"modal-open"),c&&c.instance&&this._applyBackdropOptions(c.instance,r),d}dismissAll(e){this._modalRefs.forEach(t=>t.dismiss(e))}hasOpenModals(){return this._modalRefs.length>0}_attachBackdrop(e,t){let n=e.resolveComponentFactory(Wo).create(this._injector);return this._applicationRef.attachView(n.hostView),t.appendChild(n.location.nativeElement),n}_attachWindowComponent(e,t,n){let r=e.resolveComponentFactory($o).create(this._injector,n.nodes);return this._applicationRef.attachView(r.hostView),t.appendChild(r.location.nativeElement),r}_applyWindowOptions(e,t){this._windowAttributes.forEach(n=>{Yi(t[n])&&(e[n]=t[n])})}_applyBackdropOptions(e,t){this._backdropAttributes.forEach(n=>{Yi(t[n])&&(e[n]=t[n])})}_getContentRef(e,t,n,i){return n?n instanceof r.L?this._createFromTemplateRef(n,i):"string"==typeof n?this._createFromString(n):this._createFromComponent(e,t,n,i):new Bo([])}_createFromTemplateRef(e,t){const n=e.createEmbeddedView({$implicit:t,close(e){t.close(e)},dismiss(e){t.dismiss(e)}});return this._applicationRef.attachView(n),new Bo([n.rootNodes],n)}_createFromString(e){const t=this._document.createTextNode(`${e}`);return new Bo([[t]])}
1_createFromComponent(e,t,n,i){const o=e.resolveComponentFactory(n),s=r.q.create({providers:[{provide:Qo,useValue:i}],parent:t}),a=o.create(s);return this._applicationRef.attachView(a.hostView),new Bo([[a.location.nativeElement]],a.hostView,a)}_setAriaHidden(e){const t=e.parentElement;t&&e!==this._document.body&&(Array.from(t.children).forEach(t=>{t!==e&&"SCRIPT"!==t.nodeName&&(this._ariaHiddenValues.set(t,t.getAttribute("aria-hidden")),t.setAttribute("aria-hidden","true"))}),this._setAriaHidden(t))}_revertAriaHidden(){this._ariaHiddenValues.forEach((e,t)=>{e?t.setAttribute("aria-hidden",e):t.removeAttribute("aria-hidden")}),this._ariaHiddenValues.clear()}_registerModalRef(e){const t=()=>{const t=this._modalRefs.indexOf(e);t>-1&&this._modalRefs.splice(t,1)};this._modalRefs.push(e),e.result.then(t,t)}_registerWindowCmpt(e){this._windowCmpts.push(e),this._activeWindowCmptHasChanged.next(),e.onDestroy(()=>{const t=this._windowCmpts.indexOf(e);t>-1&&(this._windowCmpts.splice(t,1),this._activeWindowCmptHasChanged.next())})}}return e.ngInjectableDef=Object(r.S)({factory:function(){return new e(Object(r.W)(r.g),Object(r.W)(r.n),Object(r.W)(o.c),Object(r.W)(zo),Object(r.W)(r.E))},token:e,providedIn:"root"}),e})(),Zo=(()=>{class e{constructor(e,t,n,r){this._moduleCFR=e,this._injector=t,this._modalStack=n,this._config=r}open(e,t={}){const n=Object.assign({},this._config,t);return this._modalStack.open(this._moduleCFR,this._injector,e,n)}dismissAll(e){this._modalStack.dismissAll(e)}hasOpenModals(){return this._modalStack.hasOpenModals()}}return e.ngInjectableDef=Object(r.S)({factory:function(){return new e(Object(r.W)(r.j),Object(r.W)(r.n),Object(r.W)(Yo),Object(r.W)(qo))},token:e,providedIn:"root"}),e})();class Jo{static forRoot(){return{ngModule:Jo}}}class Xo{static forRoot(){return{ngModule:Xo}}}class es{isTitleTemplate(){return this.title instanceof r.L}}class ts{static forRoot(){return{ngModule:ts}}}class ns{static forRoot(){return{ngModule:ns}}}class rs{static forRoot(){return{ngModule:rs}}}class is{static forRoot(){return{ngModule:is}}}class os{static forRoot(){return{ngModule:os}}}class ss{}class as{static forRoot(){return{ngModule:as}}}class us{constructor(){this.highlightClass="ngb-highlight"}ngOnChanges(e){const t=Ki(this.result),n=t.toLowerCase(),r=Ki(this.term).toLowerCase();let i=0;var o;this.parts=r.length>0?n.split(new RegExp(`(${o=r,o.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")})`)).map(e=>{const n=t.substr(i,e.length);return i+=e.length,n}):[t]}}class ls{constructor(){this.activeIdx=0,this.focusFirst=!0,this.formatter=Ki,this.selectEvent=new r.m,this.activeChangeEvent=ne
1w r.m}hasActive(){return this.activeIdx>-1&&this.activeIdx<this.results.length}getActive(){return this.results[this.activeIdx]}markActive(e){this.activeIdx=e,this._activeChanged()}next(){this.activeIdx===this.results.length-1?this.activeIdx=this.focusFirst?(this.activeIdx+1)%this.results.length:-1:this.activeIdx++,this._activeChanged()}prev(){this.activeIdx<0?this.activeIdx=this.results.length-1:0===this.activeIdx?this.activeIdx=this.focusFirst?this.results.length-1:-1:this.activeIdx--,this._activeChanged()}resetActive(){this.activeIdx=this.focusFirst?0:-1,this._activeChanged()}select(e){this.selectEvent.emit(e)}ngOnInit(){this.resetActive()}_activeChanged(){this.activeChangeEvent.emit(this.activeIdx>=0?this.id+"-"+this.activeIdx:void 0)}}class cs{static forRoot(){return{ngModule:cs}}}class hs{static forRoot(){return{ngModule:hs}}}var ds=r.qb({encapsulation:2,styles:["ngb-alert{display:block}"],data:{}});function fs(e){return r.Ob(0,[(e()(),r.sb(0,0,null,null,2,"button",[["aria-label","Close"],["class","close"],["type","button"]],null,[[null,"click"]],function(e,t,n){var r=!0;return"click"===t&&(r=!1!==e.component.closeHandler()&&r),r},null,null)),(e()(),r.sb(1,0,null,null,1,"span",[["aria-hidden","true"]],null,null,null,null,null)),(e()(),r.Mb(-1,null,["\xd7"]))],null,null)}function ps(e){return r.Ob(2,[(e()(),r.ib(16777216,null,null,1,null,fs)),r.rb(1,16384,null,0,o.k,[r.O,r.L],{ngIf:[0,"ngIf"]},null),r.Db(null,0)],function(e,t){e(t,1,0,t.component.dismissible)},null)}function ms(e){return r.Ob(0,[(e()(),r.sb(0,0,null,null,1,"ngb-alert",[["class","alert"],["role","alert"]],[[2,"alert-dismissible",null]],null,null,ps,ds)),r.rb(1,638976,null,0,eo,[Xi,r.D,r.k],null,null)],function(e,t){e(t,1,0)},function(e,t){e(t,0,0,r.Eb(t,1).dismissible)})}var gs=r.ob("ngb-alert",eo,ms,{dismissible:"dismissible",type:"type"},{close:"close"},["*"]),ys=r.qb({encapsulation:2,styles:[],data:{}});function bs(e){return r.Ob(0,[(e()(),r.sb(0,0,null,null,0,"li",[],[[8,"id",0],[2,"active",null]],[[null,"click"]],function(e,t,n){var r=!0,i=e.component;return"click"===t&&(i.select(e.context.$implicit.id),r=!1!==(i.pauseOnHover&&i.pause())&&r),r},null,null))],null,function(e,t){e(t,0,0,t.context.$implicit.id,t.context.$implicit.id===t.component.activeId)})}function vs(e){return r.Ob(0,[(e()(),r.sb(0,0,null,null,2,"ol",[["class","carousel-indicators"]],null,null,null,null,null)),(e()(),r.ib(16777216,null,null,1,null,bs)),r.rb(2,278528,null,0,o.j,[r.O,r.L,r.r],{ngForOf:[0,"ngForOf"]},null)],function(e,t){e(t,2,0,t.component.slides)},null)}function ws(e){return r.Ob(0,[(e()(),r.ib(0,null,null,0))],null,null)}function _s(e){return r.Ob(0,[(e()(),r.sb(0,0,null,null,2,"div",[["class","carousel-item"]],[[2,"active",null]],null,null,null,null)),(e()(),r.ib(16777216,null,null,1,null,ws)),r.rb(2,540672,null,0,o.n,[r.O],{ngTemplateOutlet:[0,"ngTemplateOutlet"]},null)],function(e,t){e(t,2,0,t.context.$implicit.tplRef)},function(e,t){e(t,0,0,t.context.$implicit.id===t.component.activeId)})}function Ss(e){return r.Ob(0,[(e()(),r.sb(0,0,null,null,3,"a",[["class","carousel-control-prev"],["role","button"]],null,[[null,"click"]],function(e,t,n){var r=!0;return"click"===t&&(r=!1!==e.component.prev()&&r),r},null,null)),(e()(),r.sb(1,0,null,null,0,"span",[["aria-hidden","true"],["class","carousel-control-prev-icon"]],null,null,null,null,null)),(e()(),r.sb(2,0,null,null,1,"span",[["class","sr-only"]],null,null,null,null,null)),(e()(),r.Mb(-1,null,["Previous"]))],null,null)}function Es(e){return r.Ob(0,[(e()(),r.sb(0,0,null,null,3,"a",[["class","carousel-control-next"],["role","button"]],null,[[null,"click"]],function(e,t,n){var r=!0;return"click"===t&&(r=!1!==e.component.next()&&r),r},null,null)),(e()(),r.sb(1,0,null,null,0,"span",[["aria-hidden","true"],["class","carousel-control-next-icon"]],null,null,null,null,null)),(e()(),r.sb(2,0,null,null,1,"span",[["class","sr-only"]],null,null,null,null,null)),(e()(),r.Mb(-1,null,["Next"]))],null,null)}function Cs(e){return r.Ob(2,[(e()(),r.ib(16777216,null,null,1,null,vs)),r.rb(1,16384,null,0,o.k,[r.O,r.L],{ngIf:[0,"ngIf"]},null),(e()(),r.sb(2,0,null,null,2,"div",[["class","carousel-inner"]],null,null,null,null,null)),(e()(),r.ib(16777216,null,null,1,null,_s)),r.rb(4,278528,null,0,o.j,[r.O,r.L,r.r],{ngForOf:[0,"ngForOf"]},null),(e()(),r.ib(16777216,null,null,1,null,Ss)),r.rb(6,16384,null,0,o.k,[r.O,r.L],{ngIf:[0,"ngIf"]},null),(e()(),r.ib(16777216,null,null,1,null,Es)),r.rb(8,16384,null,0,o.k,[r.O,r.L],{ngIf:[0,"ngIf"]},null)],function(e,t){var n=t.component;e(t,1,0,n.showNavigationIndicators),e(t,4,0,n.slides),e(t,6,0,n.showNavigationArrows),e(t,8,0,n.showNavigationArrows)},null)}var Ts=r.qb({encapsulation:2,styles:["ngb-datepicker-month-view{display:block}.ngb-dp-week-number,.ngb-dp-weekday{line-height:2rem;text-align:center;font-style:italic}.ngb-dp-weekday{color:#5bc0de;color:var(--info)}.ngb-dp-week{border-radius:.25rem;display:-ms-flexbox;display:flex}.ngb-dp-weekdays{border-bottom:1px solid rgba(0,0,0,.125);border-radius:0}.ngb-dp-day,.ngb-dp-week-number,.ngb-dp-weekday{width:2rem;height:2rem}.ngb-dp-day{cursor:pointer}.ngb-dp-day.disabled,.ngb-dp-day.hidden{cursor:default}"],data:{}});function Is(e){return r.Ob(0,[(e()(),r.sb(0,0,null,null,0,"div",[["class","ngb-dp-weekday ngb-dp-showweek"]],null,null,null,null,null))],null,null)}function Ds(e){return r.Ob(0,[(e()(),r.sb(0,0,null,null,1,"div",[["class","ngb-dp-weekday small"]],null,null,null,null,null)),(e()(),r.Mb(1,null,[" "," "]))],null,function(e,t){e(t,1,0,t.component.i18n.getWeekdayShortName(t.context.$implicit))})}function xs(e){return r.Ob(0,[(e()(),r.sb(0,0,null,null,4,"div",[["class","ngb-dp-week ngb-dp-weekdays bg-light"]],null,null,null,null,null)),(e()(),r.ib(16777216,null,null,1,null,Is)),r.rb(2,16384,null,0,o.k,[r.O,r.L],{ngIf:[0,"ngIf"]},null),(e()(),r.ib(16777216,null,null,1,null,Ds)),r.rb(4,278528,null,0,o.j,[r.O,r.L,r.r],{ngForOf:[0,"ngForOf"]},null)],function(e,t){var n=t.component;e(t,2,0,n.showWeekNumbers),e(t,4,0,n.month.weekdays)},null)}function ks(e){return r.Ob(0,[(e()(),r.sb(0,0,null,null,1,"div",[["class","ngb-dp-week-number small text-muted"]],null,null,null,null,null)),(e()(),r.Mb(1,null,["",""]))],null,function(e,t){e(t,1,0,t.component.i18n.getWeekNumeral
1s(t.parent.parent.context.$implicit.number))})}function As(e){return r.Ob(0,[(e()(),r.ib(0,null,null,0))],null,null)}function Os(e){return r.Ob(0,[(e()(),r.ib(16777216,null,null,1,null,As)),r.rb(1,540672,null,0,o.n,[r.O],{ngTemplateOutletContext:[0,"ngTemplateOutletContext"],ngTemplateOutlet:[1,"ngTemplateOutlet"]},null),(e()(),r.ib(0,null,null,0))],function(e,t){e(t,1,0,t.parent.context.$implicit.context,t.component.dayTemplate)},null)}function Ns(e){return r.Ob(0,[(e()(),r.sb(0,0,null,null,2,"div",[["class","ngb-dp-day"],["role","gridcell"]],[[2,"disabled",null],[8,"tabIndex",0],[2,"hidden",null],[2,"ngb-dp-today",null],[1,"aria-label",0]],[[null,"click"]],function(e,t,n){var r=!0;return"click"===t&&(r=!1!==e.component.doSelect(e.context.$implicit)&&r),r},null,null)),(e()(),r.ib(16777216,null,null,1,null,Os)),r.rb(2,16384,null,0,o.k,[r.O,r.L],{ngIf:[0,"ngIf"]},null)],function(e,t){e(t,2,0,!t.context.$implicit.hidden)},function(e,t){e(t,0,0,t.context.$implicit.context.disabled,t.context.$implicit.tabindex,t.context.$implicit.hidden,t.context.$implicit.context.today,t.context.$implicit.ariaLabel)})}function Rs(e){return r.Ob(0,[(e()(),r.sb(0,0,null,null,4,"div",[["class","ngb-dp-week"],["role","row"]],null,null,null,null,null)),(e()(),r.ib(16777216,null,null,1,null,ks)),r.rb(2,16384,null,0,o.k,[r.O,r.L],{ngIf:[0,"ngIf"]},null),(e()(),r.ib(16777216,null,null,1,null,Ns)),r.rb(4,278528,null,0,o.j,[r.O,r.L,r.r],{ngForOf:[0,"ngForOf"]},null)],function(e,t){e(t,2,0,t.component.showWeekNumbers),e(t,4,0,t.parent.context.$implicit.days)},null)}function Ms(e){return r.Ob(0,[(e()(),r.ib(16777216,null,null,1,null,Rs)),r.rb(1,16384,null,0,o.k,[r.O,r.L],{ngIf:[0,"ngIf"]},null),(e()(),r.ib(0,null,null,0))],function(e,t){e(t,1,0,!t.context.$implicit.collapsed)},null)}function Ps(e){return r.Ob(0,[(e()(),r.ib(16777216,null,null,1,null,xs)),r.rb(1,16384,null,0,o.k,[r.O,r.L],{ngIf:[0,"ngIf"]},null),(e()(),r.ib(16777216,null,null,1,null,Ms)),r.rb(3,278528,null,0,o.j,[r.O,r.L,r.r],{ngForOf:[0,"ngForOf"]},null)],function(e,t){var n=t.component;e(t,1,0,n.showWeekdays),e(t,3,0,n.month.weeks)},null)}var Ls=r.qb({encapsulation:2,styles:["[ngbDatepickerDayView]{text-align:center;width:2rem;height:2rem;line-height:2rem;border-radius:.25rem;background:0 0}[ngbDatepickerDayView].outside{opacity:.5}"],data:{}});function Fs(e){return r.Ob(2,[(e()(),r.Mb(0,null,["",""]))],null,function(e,t){var n=t.component;e(t,0,0,n.i18n.getDayNumerals(n.date))})}var js=r.qb({encapsulation:2,styles:["ngb-datepicker-navigation{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.ngb-dp-navigation-chevron{border-style:solid;border-width:.2em .2em 0 0;display:inline-block;width:.75em;height:.75em;margin-left:.25em;margin-right:.15em;-webkit-transform:rotate(-135deg);transform:rotate(-135deg)}.right .ngb-dp-navigation-chevron{-webkit-transform:rotate(45deg);transform:rotate(45deg);margin-left:.15em;margin-right:.25em}.ngb-dp-arrow{display:-ms-flexbox;display:flex;-ms-flex:1 1 auto;flex:1 1 auto;padding-right:0;padding-left:0;margin:0;width:2rem;height:2rem}.ngb-dp-arrow.right{-ms-flex-pack:end;justify-content:flex-end}.ngb-dp-arrow-btn{padding:0 .25rem;margin:0 .5rem;border:none;background-color:transparent;z-index:1}.ngb-dp-arrow-btn:focus{outline-width:1px;outline-style:auto}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){.ngb-dp-arrow-btn:focus{outline-style:solid}}.ngb-dp-month-name{font-size:larger;height:2rem;line-height:2rem;text-align:center}.ngb-dp-navigation-select{display:-ms-flexbox;display:flex;-ms-flex:1 1 9rem;flex:1 1 9rem}"],data:{}});function Vs(e){return r.Ob(0,[(e()(),r.sb(0,0,null,null,1,"ngb-datepicker-navigation-select",[["class","ngb-dp-navigation-select"]],null,[[null,"select"]],function(e,t,n){var r=!0;return"select"===t&&(r=!1!==e.component.select.emit(n)&&r),r}
1,Ks,Ws)),r.rb(1,49152,null,0,jo,[_o],{date:[0,"date"],disabled:[1,"disabled"],months:[2,"months"],years:[3,"years"]},{select:"select"})],function(e,t){var n=t.component;e(t,1,0,n.date,n.disabled,n.selectBoxes.months,n.selectBoxes.years)},null)}function Us(e){return r.Ob(0,[(e()(),r.sb(0,0,null,null,0,"div",[["class","ngb-dp-arrow"]],null,null,null,null,null))],null,null)}function qs(e){return r.Ob(0,[(e()(),r.sb(0,0,null,null,0,"div",[["class","ngb-dp-arrow"]],null,null,null,null,null))],null,null)}function Bs(e){return r.Ob(0,[(e()(),r.ib(16777216,null,null,1,null,Us)),r.rb(1,16384,null,0,o.k,[r.O,r.L],{ngIf:[0,"ngIf"]},null),(e()(),r.sb(2,0,null,null,1,"div",[["class","ngb-dp-month-name"]],null,null,null,null,null)),(e()(),r.Mb(3,null,[" "," "," "])),(e()(),r.ib(16777216,null,null,1,null,qs)),r.rb(5,16384,null,0,o.k,[r.O,r.L],{ngIf:[0,"ngIf"]},null),(e()(),r.ib(0,null,null,0))],function(e,t){var n=t.component;e(t,1,0,t.context.index>0),e(t,5,0,t.context.index!==n.months.length-1)},function(e,t){var n=t.component;e(t,3,0,n.i18n.getMonthFullName(t.context.$implicit.number,t.context.$implicit.year),n.i18n.getYearNumerals(t.context.$implicit.year))})}function Hs(e){return r.Ob(0,[(e()(),r.ib(16777216,null,null,1,null,Bs)),r.rb(1,278528,null,0,o.j,[r.O,r.L,r.r],{ngForOf:[0,"ngForOf"]},null),(e()(),r.ib(0,null,null,0))],function(e,t){e(t,1,0,t.component.months)},null)}function zs(e){return r.Ob(2,[(e()(),r.sb(0,0,null,null,2,"div",[["class","ngb-dp-arrow"]],null,null,null,null,null)),(e()(),r.sb(1,0,null,null,1,"button",[["aria-label","Previous month"],["class","btn btn-link ngb-dp-arrow-btn"],["title","Previous month"],["type","button"]],[[8,"disabled",0]],[[null,"click"]],function(e,t,n){var r=!0,i=e.component;return"click"===t&&(r=!1!==i.navigate.emit(i.navigation.PREV)&&r),r},null,null)),(e()(),r.sb(2,0,null,null,0,"span",[["class","ngb-dp-navigation-chevron"]],null,null,null,null,null)),(e()(),r.ib(16777216,null,null,1,null,Vs)),r.rb(4,16384,null,0,o.k,[r.O,r.L],{ngIf:[0,"ngIf"]},null),(e()(),r.ib(16777216,null,null,1,null,Hs)),r.rb(6,16384,null,0,o.k,[r.O,r.L],{ngIf:[0,"ngIf"]},null),(e()(),r.sb(7,0,null,null,2,"div",[["class","ngb-dp-arrow right"]],null,null,null,null,null)),(e()(),r.sb(8,0,null,null,1,"button",[["aria-label","Next month"],["class","btn btn-link ngb-dp-arrow-btn"],["title","Next month"],["type","button"]],[[8,"disabled",0]],[[null,"click"]],function(e,t,n){var r=!0,i=e.component;return"click"===t&&(r=!1!==i.navigate.emit(i.navigation.NEXT)&&r),r},null,null)),(e()(),r.sb(9,0,null,null,0,"span",[["class","ngb-dp-navigation-chevron"]],null,null,null,null,null))],function(e,t){var n=t.component;e(t,4,0,n.showSelect),e(t,6,0,!n.showSelect)},function(e,t){var n=t.component;e(t,1,0,n.prevDisabled),e(t,8,0,n.nextDisabled)})}var Ws=r.qb({encapsulation:2,styles:["ngb-datepicker-navigation-select>.custom-select{-ms-flex:1 1 auto;flex:1 1 auto;padding:0 .5rem;font-size:.875rem;height:1.85rem}"],data:{}});function Qs(e){return r.Ob(0,[(e()(),r.sb(0,0,null,null,3,"option",[],[[1,"aria-label",0]],null,null,null,null)),r.rb(1,147456,null,0,ki,[r.k,r.D,[8,null]],{value:[0,"value"]},null),r.rb(2,147456,null,0,Oi,[r.k,r.D,[8,null]],{value:[0,"value"]},null),(e()(),r.Mb(3,null,["",""]))],function(e,t){e(t,1,0,t.context.$implicit),e(t,2,0,t.context.$implicit)},function(e,t){var n=t.component;e(t,0,0,n.i18n.getMonthFullName(t.context.$implicit,null==n.date?null:n.date.year)),e(t,3,0,n.i18n.getMonthShortName(t.context.$implicit,null==n.date?null:n.date.year))})}function Gs(e){return r.Ob(0,[(e()(),r.sb(0,0,null,null,3,"option",[],null,null,null,null,null)),r.rb(1,147456,null,0,ki,[r.k,r.D,[8,null]],{value:[0,"value"]},null),r.rb(2,147456,null,0,Oi,[r.k,r.D,[8,null]],{value:[0,"value"]},null),(e()(),r.Mb(3,null,["",""]))],function(e,t){e(t,1,0,t.context.$implicit),e(t,2,0,t.context.$implicit)},function(e,t){e(t,3,0,t.component.i18n.getYearNumerals(t.context.$implicit))})}function Ks(e){return r.Ob(2,[(e()(),r.sb(0,0,null,null,2,"select",[["aria-label","Select month"],["class","custom-select"],["title","Select month"]],[[8,"disabled",0],[8,"value",0]],[[null,"change"]],function(e,t,n){var r=!0;return"change"===t&&(r=!1!==e.component.changeMonth(n.target.value)&&r),r}
1,null,null)),(e()(),r.ib(16777216,null,null,1,null,Qs)),r.rb(2,278528,null,0,o.j,[r.O,r.L,r.r],{ngForOf:[0,"ngForOf"]},null),(e()(),r.sb(3,0,null,null,2,"select",[["aria-label","Select year"],["class","custom-select"],["title","Select year"]],[[8,"disabled",0],[8,"value",0]],[[null,"change"]],function(e,t,n){var r=!0;return"change"===t&&(r=!1!==e.component.changeYear(n.target.value)&&r),r},null,null)),(e()(),r.ib(16777216,null,null,1,null,Gs)),r.rb(5,278528,null,0,o.j,[r.O,r.L,r.r],{ngForOf:[0,"ngForOf"]},null)],function(e,t){var n=t.component;e(t,2,0,n.months),e(t,5,0,n.years)},function(e,t){var n=t.component;e(t,0,0,n.disabled,null==n.date?null:n.date.month),e(t,3,0,n.disabled,null==n.date?null:n.date.year)})}var $s=r.qb({encapsulation:2,styles:["ngb-datepicker{border:1px solid #dfdfdf;border-radius:.25rem;display:inline-block}.ngb-dp-month{pointer-events:none}.ngb-dp-header{border-bottom:0;border-radius:.25rem .25rem 0 0;padding-top:.25rem}ngb-datepicker-month-view{pointer-events:auto}.ngb-dp-month-name{font-size:larger;height:2rem;line-height:2rem;text-align:center}.ngb-dp-month+.ngb-dp-month>.ngb-dp-month-name,.ngb-dp-month+.ngb-dp-month>ngb-datepicker-month-view>.ngb-dp-week{padding-left:1rem}.ngb-dp-month:last-child .ngb-dp-week{padding-right:.25rem}.ngb-dp-month:first-child .ngb-dp-week{padding-left:.25rem}.ngb-dp-month>ngb-datepicker-month-view>.ngb-dp-week:last-child{padding-bottom:.25rem}.ngb-dp-months{display:-ms-flexbox;display:flex}"],data:{}});function Ys(e){return r.Ob(0,[(e()(),r.sb(0,0,null,null,1,"div",[["class","btn-light"],["ngbDatepickerDayView",""]],[[2,"bg-primary",null],[2,"text-white",null],[2,"text-muted",null],[2,"outside",null],[2,"active",null]],null,null,Fs,Ls)),r.rb(1,49152,null,0,Fo,[_o],{currentMonth:[0,"currentMonth"],date:[1,"date"],disabled:[2,"disabled"],focused:[3,"focused"],selected:[4,"selected"]},null)],function(e,t){e(t,1,0,t.context.currentMonth,t.context.date,t.context.disabled,t.context.focused,t.context.selected)},function(e,t){e(t,0,0,r.Eb(t,1).selected,r.Eb(t,1).selected,r.Eb(t,1).isMuted(),r.Eb(t,1).isMuted(),r.Eb(t,1).focused)})}function Zs(e){return r.Ob(0,[(e()(),r.sb(0,0,null,null,1,"ngb-datepicker-navigation",[],null,[[null,"navigate"],[null,"select"]],function(e,t,n){var r=!0,i=e.component;return"navigate"===t&&(r=!1!==i.onNavigateEvent(n)&&r),"select"===t&&(r=!1!==i.onNavigateDateSelect(n)&&r),r},zs,js)),r.rb(1,49152,null,0,Ro,[_o],{date:[0,"date"],disabled:[1,"disabled"],months:[2,"months"],showSelect:[3,"showSelect"],prevDisabled:[4,"prevDisabled"],nextDisabled:[5,"nextDisabled"],selectBoxes:[6,"selectBoxes"]},{navigate:"navigate",select:"select"})],function(e,t){var n=t.component;e(t,1,0,n.model.firstDate,n.model.disabled,n.model.months,"select"===n.model.navigation,n.model.prevDisabled,n.model.nextDisabled,n.model.selectBoxes)},null)}function Js(e){return r.Ob(0,[(e()(),r.sb(0,0,null,null,1,"div",[["class","ngb-dp-month-name bg-light"]],null,null,null,null,null)),(e()(),r.Mb(1,null,[" "," "," "]))],null,function(e,t){var n=t.component;e(t,1,0,n.i18n.getMonthFullName(t.parent.context.$implicit.number,t.parent.context.$implicit.year),n.i18n.getYearNumerals(t.parent.context.$implicit.year))})}function Xs(e){return r.Ob(0,[(e()(),r.sb(0,0,null,null,4,"div",[["class","ngb-dp-month"]],null,null,null,null,null)),(e()(),r.ib(16777216,null,null,1,null,Js)),r.rb(2,16384,null,0,o.k,[r.O,r.L],{ngIf:[0,"ngIf"]},null),(e()(),r.sb(3,0,null,null,1,"ngb-datepicker-month-view",[["role","grid"]],null,[[null,"select"]],function(e,t,n){var r=!0;return"select"===t&&(r=!1!==e.component.onDateSelect(n)&&r),r},Ps,Ts)),r.rb(4,49152,null,0,No,[_o],{dayTemplate:[0,"dayTemplate"],month:[1,"month"],showWeekdays:[2,"showWeekdays"],showWeekNumbers:[3,"showWeekNumbers"]},{select:"select"})],function(e,t){var n=t.component;e(t,2,0,"none"===n.navigation||n.displayMonths>1&&"select"===n.navigation),e(t,4,0,n.dayTemplate||r.Eb(t.parent,1),t.context.$implicit,n.showWeekdays,n.showWeekNumbers)},null)}function ea(e){return r.Ob(0,[(e()(),r.ib(0,null,null,0))],null,null)}function ta(e){return r.Ob(2,[r.Kb(402653184,1,{_monthsEl:0}),(e()(),r.ib(0,[["dt",2]],null,0,null,Ys)),(e()(),r.sb(2,0,null,null,2,"div",[["class","ngb-dp-header bg-light"]],null,null,null,null,null)),(e()(),r.ib(16777216,null,null,1,null,Zs)),r.rb(4,16384,null,0,o.k,[r.O,r.L],{ngIf:[0,"ngIf"]},null),(e()(),r.sb(5,0,[[1,0],["months",1]],null,2,"div",[["class","ngb-dp-months"]],null,[[null,"keydown"]],function(e,t,n){var r=!0;return"keydown"===t&&(r=!1!==e.component.onKeyDown(n)&&r),r}
1,null,null)),(e()(),r.ib(16777216,null,null,1,null,Xs)),r.rb(7,278528,null,0,o.j,[r.O,r.L,r.r],{ngForOf:[0,"ngForOf"]},null),(e()(),r.ib(16777216,null,null,1,null,ea)),r.rb(9,540672,null,0,o.n,[r.O],{ngTemplateOutlet:[0,"ngTemplateOutlet"]},null)],function(e,t){var n=t.component;e(t,4,0,"none"!==n.navigation),e(t,7,0,n.model.months),e(t,9,0,n.footerTemplate)},null)}function na(e){return r.Ob(0,[(e()(),r.sb(0,0,null,null,4,"ngb-datepicker",[],null,null,null,ta,$s)),r.Jb(5120,null,Di,function(e){return[e]},[Oo]),r.Jb(512,null,Eo,Eo,[go,_o]),r.Jb(512,null,To,To,[Eo,go]),r.rb(4,1818624,null,0,Oo,[To,Eo,go,_o,Do,r.h,r.k,ko,r.y],null,null)],function(e,t){e(t,4,0)},null)}var ra=r.ob("ngb-datepicker",Oo,na,{dayTemplate:"dayTemplate",dayTemplateData:"dayTemplateData",displayMonths:"displayMonths",firstDayOfWeek:"firstDayOfWeek",footerTemplate:"footerTemplate",markDisabled:"markDisabled",maxDate:"maxDate",minDate:"minDate",navigation:"navigation",outsideDays:"outsideDays",showWeekdays:"showWeekdays",showWeekNumbers:"showWeekNumbers",startDate:"startDate"},{navigate:"navigate",select:"select"},[]),ia=r.qb({encapsulation:2,styles:["ngb-popover-window.bs-popover-bottom .arrow,ngb-popover-window.bs-popover-top .arrow{left:50%;margin-left:-.5rem}ngb-popover-window.bs-popover-bottom-left .arrow,ngb-popover-window.bs-popover-top-left .arrow{left:2em}ngb-popover-window.bs-popover-bottom-right .arrow,ngb-popover-window.bs-popover-top-right .arrow{left:auto;right:2em}ngb-popover-window.bs-popover-left .arrow,ngb-popover-window.bs-popover-right .arrow{top:50%;margin-top:-.5rem}ngb-popover-window.bs-popover-left-top .arrow,ngb-popover-window.bs-popover-right-top .arrow{top:.7em}ngb-popover-window.bs-popover-left-bottom .arrow,ngb-popover-window.bs-popover-right-bottom .arrow{top:auto;bottom:.7em}"],data:{}});function oa(e){return r.Ob(0,[(e()(),r.Mb(0,null,["",""]))],null,function(e,t){e(t,0,0,t.component.title)})}function sa(e){return r.Ob(0,[(e()(),r.ib(0,null,null,0))],null,null)}function aa(e){return r.Ob(0,[(e()(),r.sb(0,0,null,null,3,"h3",[["class","popover-header"]],null,null,null,null,null)),(e()(),r.ib(0,[["simpleTitle",2]],null,0,null,oa)),(e()(),r.ib(16777216,null,null,1,null,sa)),r.rb(3,540672,null,0,o.n,[r.O],{ngTemplateOutletContext:[0,"ngTemplateOutletContext"],ngTemplateOutlet:[1,"ngTemplateOutlet"]},null)],function(e,t){var n=t.component;e(t,3,0,n.context,n.isTitleTemplate()?n.title:r.Eb(t,1))},null)}function ua(e){return r.Ob(2,[(e()(),r.sb(0,0,null,null,0,"div",[["class","arrow"]],null,null,null,null,null)),(e()(),r.ib(16777216,null,null,1,null,aa)),r.rb(2,16384,null,0,o.k,[r.O,r.L],{ngIf:[0,"ngIf"]},null),(e()(),r.sb(3,0,null,null,1,"div",[["class","popover-body"]],null,null,null,null,null)),r.Db(null,0)],function(e,t){e(t,2,0,null!=t.component.title)},null)}function la(e){return r.Ob(0,[(e()(),r.sb(0,0,null,null,1,"ngb-popover-window",[["role","tooltip"]],[[8,"className",0],[8,"id",0]],null,null,ua,ia)),r.rb(1,49152,null,0,es,[],null,null)],null,function(e,t){e(t,0,0,"popover"+(r.Eb(t,1).popoverClass?" "+r.Eb(t,1).popoverClass:""),r.Eb(t,1).id)})}var ca=r.ob("ngb-popover-window",es,la,{title:"title",id:"id",popoverClass:"popoverClass",context:"context"},{},["*"]),ha=r.qb({encapsulation:2,styles:["ngb-tooltip-window.bs-tooltip-bottom .arrow,ngb-tooltip-window.bs-tooltip-top .arrow{left:calc(50% - .4rem)}ngb-tooltip-window.bs-tooltip-bottom-left .arrow,ngb-tooltip-window.bs-tooltip-top-left .arrow{left:1em}ngb-tooltip-window.bs-tooltip-bottom-right .arrow,ngb-tooltip-window.bs-tooltip-top-right .arrow{left:auto;right:.8rem}ngb-tooltip-window.bs-tooltip-left .arrow,ngb-tooltip-window.bs-tooltip-right .arrow{top:calc(50% - .4rem)}ngb-tooltip-window.bs-tooltip-left-top .arrow,ngb-tooltip-window.bs-tooltip-right-top .arrow{top:.4rem}ngb-tooltip-window.bs-tooltip-left-bottom .arrow,ngb-tooltip-window.bs-tooltip-right-bottom .arrow{top:auto;bottom:.4rem}"],data:{}});function da(e){return r.Ob(2,[(e()(),r.sb(0,0,null,null,0,"div",[["class","arrow"]],null,null,null,null,null)),(e()(),r.sb(1,0,null,null,1,"div",[["class","tooltip-inner"]],null,null,null,null,null)),r.Db(null,0)],null,null)}function fa(e){return r.Ob(0,[(e()(),r.sb(0,0,null,null,1,"ngb-tooltip-window",[["role","tooltip"]],[[8,"className",0],[8,"id",0]],null,null,da,ha)),r.rb(1,49152,null,0,ss,[],null,
1null)],null,function(e,t){e(t,0,0,"tooltip show"+(r.Eb(t,1).tooltipClass?" "+r.Eb(t,1).tooltipClass:""),r.Eb(t,1).id)})}var pa=r.ob("ngb-tooltip-window",ss,fa,{id:"id",tooltipClass:"tooltipClass"},{},["*"]),ma=r.qb({encapsulation:2,styles:[],data:{}});function ga(e){return r.Ob(0,[(e()(),r.sb(0,0,null,null,1,"ngb-highlight",[],null,null,null,Ia,Sa)),r.rb(1,573440,null,0,us,[],{result:[0,"result"],term:[1,"term"]},null)],function(e,t){var n=t.context.formatter(t.context.result);e(t,1,0,n,t.context.term)},null)}function ya(e){return r.Ob(0,[(e()(),r.ib(0,null,null,0))],null,null)}function ba(e){return r.Ob(0,[(e()(),r.sb(0,0,null,null,3,"button",[["class","dropdown-item"],["role","option"],["type","button"]],[[8,"id",0],[2,"active",null]],[[null,"mouseenter"],[null,"click"]],function(e,t,n){var r=!0,i=e.component;return"mouseenter"===t&&(r=!1!==i.markActive(e.context.index)&&r),"click"===t&&(r=!1!==i.select(e.context.$implicit)&&r),r},null,null)),(e()(),r.ib(16777216,null,null,2,null,ya)),r.rb(2,540672,null,0,o.n,[r.O],{ngTemplateOutletContext:[0,"ngTemplateOutletContext"],ngTemplateOutlet:[1,"ngTemplateOutlet"]},null),r.Hb(3,{result:0,term:1,formatter:2})],function(e,t){var n=t.component,i=e(t,3,0,t.context.$implicit,n.term,n.formatter);e(t,2,0,i,n.resultTemplate||r.Eb(t.parent,0))},function(e,t){var n=t.component;e(t,0,0,n.id+"-"+t.context.index,t.context.index===n.activeIdx)})}function va(e){return r.Ob(0,[(e()(),r.ib(0,[["rt",2]],null,0,null,ga)),(e()(),r.ib(16777216,null,null,1,null,ba)),r.rb(2,278528,null,0,o.j,[r.O,r.L,r.r],{ngForOf:[0,"ngForOf"]},null)],function(e,t){e(t,2,0,t.component.results)},null)}function wa(e){return r.Ob(0,[(e()(),r.sb(0,0,null,null,1,"ngb-typeahead-window",[["class","dropdown-menu show"],["role","listbox"]],[[8,"id",0]],[[null,"mousedown"]],function(e,t,n){var r=!0;return"mousedown"===t&&(r=!1!==n.preventDefault()&&r),r},va,ma)),r.rb(1,114688,null,0,ls,[],null,null)],function(e,t){e(t,1,0)},function(e,t){e(t,0,0,r.Eb(t,1).id)})}var _a=r.ob("ngb-typeahead-window",ls,wa,{id:"id",focusFirst:"focusFirst",results:"results",term:"term",formatter:"formatter",resultTemplate:"resultTemplate"},{selectEvent:"select",activeChangeEvent:"activeChange"},[]),Sa=r.qb({encapsulation:2,styles:[".ngb-highlight{font-weight:700}"],data:{}});function Ea(e){return r.Ob(0,[(e()(),r.sb(0,0,null,null,1,"span",[],[[8,"className",0]],null,null,null,null)),(e()(),r.Mb(1,null,["",""]))],null,function(e,t){e(t,0,0,t.component.highlightClass),e(t,1,0,t.parent.context.$implicit)})}function Ca(e){return r.Ob(0,[(e()(),r.Mb(0,null,["",""]))],null,function(e,t){e(t,0,0,t.parent.context.$implicit)})}function Ta(e){return r.Ob(0,[(e()(),r.ib(16777216,null,null,1,null,Ea)),r.rb(1,16384,null,0,o.k,[r.O,r.L],{ngIf:[0,"ngIf"],ngIfElse:[1,"ngIfElse"]},null),(e()(),r.ib(0,[["even",2]],null,0,null,Ca))],function(e,t){e(t,1,0,t.context.odd,r.Eb(t,2))},null)}function Ia(e){return r.Ob(2,[(e()(),r.ib(16777216,null,null,1,null,Ta)),r.rb(1,278528,null,0,o.j,[r.O,r.L,r.r],{ngForOf:[0,"ngForOf"]},null)],function(e,t){e(t,1,0,t.component.parts)},null)}var Da=r.qb({encapsulation:2,styles:[],data:{}});function xa(e){return r.Ob(0,[],null,null)}function ka(e){return r.Ob(0,[(e()(),r.sb(0,0,null,null,1,"ngb-modal-backdrop",[["style","z-index: 1050"]],[[8,"className",0]],null,null,xa,Da)),r.rb(1,49152,null,0,Wo,[],null,null)],null,function(e,t){e(t,0,0,"modal-backdrop fade show"+(r.Eb(t,1).backdropClass?" "+r.Eb(t,1).backdropClass:""))})}var Aa=r.ob("ngb-modal-backdrop",Wo,ka,{backdropClass:"backdropClass"},{},[]),Oa=r.qb({encapsulation:2,styles:[],data:{}});function Na(e){return r.Ob(0,[(e()(),r.sb(0,0,null,null,2,"div",[["role","document"]],[[8,"className",0]],null,null,null,null)),(e()(),r.sb(1,0,null,null,1,"div",[["class","modal-content"]],null,null,null,null,null)),r.Db(null,0)],null,function(e,t){var n=t.component;e(t,0,0,"modal-dialog"+(n.size?" modal-"+n.size:"")+(n.centered?" modal-dialog-centered":""))})}function Ra(e){return r.Ob(0,[(e()(),r.sb(0,0,null,null,1,"ngb-modal-window",[["role","dialog"],["tabindex","-1"]],[[8,"className",0],[1,"aria-modal",0],[1,"aria-labelledby",0]],[[null,"keyup.esc"],[null,"click"]],function(e,t,n){var i=!0;return"keyup.esc"===t&&(i=!1!==r.Eb(e,1).escKey(n)&&i),"click"===t&&(i=!1!==r.Eb(e,1).backdropClick(n)&&i),i},Na,Oa)),r.rb(1,4440064,null,0,$o,[o.c,r.k],null,null)],function(e,t){e(t,1,0)},function(e,t){e(t,0,0,"modal fade show d-block"+(r.Eb(t,1).windowClass?" "+r.Eb(t,1).windowClass:""),!0,r.Eb(t,1).ariaLabelledBy)})}var Ma=r.ob("ngb-modal-window",$o,Ra,{ariaLabelledBy:"ariaLabelledBy",backdrop:"backdrop",centered:"centered",keyboard:"keyboard",size:"size",windowClass:"windowClass"},{dismissEvent:"dismiss"},["*"]),Pa=r.qb({encapsulation:2,styles:[],data:{}});function La(e){return r.Ob(0,[(e()(),r.sb(0,16777216,null,null,1,"router-outlet",[],null,
1null,null,null,null)),r.rb(1,212992,null,0,ti,[ei,r.O,r.j,[8,null],r.h],null,null)],function(e,t){e(t,1,0)},null)}function Fa(e){return r.Ob(0,[(e()(),r.sb(0,0,null,null,1,"ng-component",[],null,null,null,La,Pa)),r.rb(1,49152,null,0,Gt,[],null,null)],null,null)}var ja=r.ob("ng-component",Gt,Fa,{},{},[]);n("CqG3");class Va{constructor(e){this.afs=e}getIntros(){return this.afs.collection("intro").valueChanges()}getTeams(){return this.afs.collection("team").valueChanges()}}class Ua{constructor(e){this.landingService=e}ngOnInit(){this.landingService.getIntros().subscribe(e=>{this.intros=e}),this.landingService.getTeams().subscribe(e=>{this.teams=e})}}var qa=r.qb({encapsulation:0,styles:[[""]],data:{}});function Ba(e){return r.Ob(0,[(e()(),r.sb(0,0,null,null,0,"img",[["alt","group picture"],["class","img-fluid"]],[[8,"src",4]],null,null,null,null))],null,function(e,t){e(t,0,0,r.wb(1,"",t.parent.context.$implicit.img,""))})}function Ha(e){return r.Ob(0,[(e()(),r.ib(0,null,null,1,null,Ba)),r.rb(1,16384,[[1,4]],0,oo,[r.L],null,null)],null,null)}function za(e){return r.Ob(0,[(e()(),r.sb(0,0,null,null,8,"div",[["class","col-md-6 col-lg-3 mb-5 mb-lg-0"]],null,null,null,null,null)),(e()(),r.sb(1,0,null,null,7,"div",[["class","px-4"]],null,null,null,null,null)),(e()(),r.sb(2,0,null,null,0,"img",[["class","rounded-circle img-center img-fluid shadow shadow-lg--hover"],["style","width: 200px; height:180px;"]],[[8,"src",4]],null,null,null,null)),(e()(),r.sb(3,0,null,null,5,"div",[["class","pt-4 text-center"]],null,null,null,null,null)),(e()(),r.sb(4,0,null,null,4,"h5",[["class","title"]],null,null,null,null,null)),(e()(),r.sb(5,0,null,null,1,"span",[["class","d-block mb-1"]],null,null,null,null,null)),(e()(),r.Mb(6,null,["",""])),(e()(),r.sb(7,0,null,null,1,"small",[["class","h6 text-muted"]],null,null,null,null,null)),(e()(),r.Mb(8,null,["",""]))],null,function(e,t){e(t,2,0,r.wb(1,"",t.context.$implicit.img,"")),e(t,6,0,t.context.$implicit.name),e(t,8,0,t.context.$implicit.position)})}function Wa(e){return r.Ob(0,[(e()(),r.sb(0,0,null,null,125,"main",[],null,null,null,null,null)),(e()(),r.sb(1,0,null,null,31,"div",[["class","position-relative"]],null,null,null,null,null)),(e()(),r.sb(2,0,null,null,30,"section",[["class","section section-lg section-shaped pb-250"]],null,null,null,null,null)),(e()(),r.sb(3,0,null,null,9,"div",[["class","shape shape-style-1 shape-primary"]],null,null,null,null,null)),(e()(),r.sb(4,0,null,null,0,"span",[],null,null,null,null,null)),(e()(),r.sb(5,0,null,null,0,"span",[],null,null,null,null,null)),(e()(),r.sb(6,0,null,null,0,"span",[],null,null,null,null,null)),(e()(),r.sb(7,0,null,null,0,"span",[],null,null,null,null,null)),(e()(),r.sb(8,0,null,null,0,"span",[],null,null,null,null,null)),(e()(),r.sb(9,0,null,null,0,"span",[],null,null,null,null,null)),(e()(),r.sb(10,0,null,null,0,"span",[],null,null,null,null,null)),(e()(),r.sb(11,0,null,null,0,"span",[],null,null,null,null,null)),(e()(),r.sb(12,0,null,null,0,"span",[],null,null,null,null,null)),(e()(),r.sb(13,0,null,null,16,"div",[["class","container py-lg-md d-flex"]],null,null,null,null,null)),(e()(),r.sb(14,0,null,null,15,"div",[["class","col px-0"]],null,null,null,null,null)),(e()(),r.sb(15,0,null,null,14,"div",[["class","row"]],null,null,null,null,null)),(e()(),r.sb(16,0,null,null,6,"div",[["class","col-lg-6"]],null,null,null,null,null)),(e()(),r.sb(17,0,null,null,3,"h1",[["class","display-3  text-white"]],null,null,null,null,null)),(e()(),r.Mb(-1,null,["IEEE UNM "])),(e()(),r.sb(19,0,null,null,1,"span",[],null,null,null,null,null)),(e()(),r.Mb(-1,null,["Advancing Technology for Humanity"])),(e()(),r.sb(21,0,null,null,1,"p",[["class","lead  text-white"]],null,null,null,null,null)),(e()(),r.Mb(-1,null,["An organisation founded on 1 March 2013 aiming to create a free platform to hold events that benefits the student community in terms of academics, technical skills, and leadership skills."])),(e()(),r.sb(23,0,null,null,6,"div",[["class","col-lg-6 mb-lg-auto"]],null,null,null,null,null)),(e()(),r.sb(24,0,null,null,5,"div",[["class","rounded shadow-lg overflow-hidden transform-perspective-right"]],null,null,null,null,null)),(e()(),r.sb(25,0,null,null,4,"ngb-carousel",[["class","carousel slide"],["tabIndex","0"]],[[4,"display",null]],[[null,"mouseenter"],[null,"mouseleave"],[null,"keydown.arrowLeft"],[null,"keydown.arrowRight"]],function(e,t,n){var i=!0;
1return"mouseenter"===t&&(i=!1!==(r.Eb(e,26).pauseOnHover&&r.Eb(e,26).pause())&&i),"mouseleave"===t&&(i=!1!==(r.Eb(e,26).pauseOnHover&&r.Eb(e,26).cycle())&&i),"keydown.arrowLeft"===t&&(i=!1!==(r.Eb(e,26).keyboard&&r.Eb(e,26).prev())&&i),"keydown.arrowRight"===t&&(i=!1!==(r.Eb(e,26).keyboard&&r.Eb(e,26).next())&&i),i},Cs,ys)),r.rb(26,3850240,null,1,so,[ro,r.A,r.y,r.h],null,null),r.Kb(603979776,1,{slides:1}),(e()(),r.ib(16777216,null,null,1,null,Ha)),r.rb(29,278528,null,0,o.j,[r.O,r.L,r.r],{ngForOf:[0,"ngForOf"]},null),(e()(),r.sb(30,0,null,null,2,"div",[["class","separator separator-bottom separator-skew"]],null,null,null,null,null)),(e()(),r.sb(31,0,null,null,1,":svg:svg",[["preserveAspectRatio","none"],["version","1.1"],["viewBox","0 0 2560 100"],["x","0"],["xmlns","http://www.w3.org/2000/svg"],["y","0"]],null,null,null,null,null)),(e()(),r.sb(32,0,null,null,0,":svg:polygon",[["class","fill-white"],["points","2560 0 2560 100 0 100"]],null,null,null,null,null)),(e()(),r.sb(33,0,null,null,54,"section",[["class","section section-lg pt-lg-0 mt--200"]],null,null,null,null,null)),(e()(),r.sb(34,0,null,null,53,"div",[["class","container"]],null,null,null,null,null)),(e()(),r.sb(35,0,null,null,52,"div",[["class","row justify-content-center"]],null,null,null,null,null)),(e()(),r.sb(36,0,null,null,51,"div",[["class","col-lg-12"]],null,null,null,null,null)),(e()(),r.sb(37,0,null,null,50,"div",[["class","row row-grid"]],null,null,null,null,null)),(e()(),r.sb(38,0,null,null,17,"div",[["class","col-lg-4"]],null,null,null,null,null)),(e()(),r.sb(39,0,null,null,16,"div",[["class","card card-lift--hover shadow border-0"]],null,null,null,null,null)),(e()(),r.sb(40,0,null,null,15,"div",[["class","card-body py-5"]],null,null,null,null,null)),(e()(),r.sb(41,0,null,null,1,"div",[["class","icon icon-shape icon-shape-primary rounded-circle mb-4"]],null,null,null,null,null)),(e()(),r.sb(42,0,null,null,0,"i",[["class","ni ni-world-2"]],null,null,null,null,null)),(e()(),r.sb(43,0,null,null,1,"h6",[["class","text-primary text-uppercase"]],null,null,null,null,null)),(e()(),r.Mb(-1,null,["Platform"])),(e()(),r.sb(45,0,null,null,10,"p",[["class","description mt-3"]],null,null,null,null,null)),(e()(),r.Mb(-1,null,["Provide a platform of "])),(e()(),r.sb(47,0,null,null,1,"span",[["class","badge badge-pill badge-primary"]],null,null,null,null,null)),(e()(),r.Mb(-1,null,["networking"])),(e()(),r.Mb(-1,null,[" for University students, at the same time nurturing the mindset of "])),(e()(),r.sb(50,0,null,null,1,"span",[["class","badge badge-pill badge-primary"]],null,null,null,null,null)),(e()(),r.Mb(-1,null,["professionalism"])),(e()(),r.Mb(-1,null,[" and "])),(e()(),r.sb(53,0,null,null,1,"span",[["class","badge badge-pill badge-primary"]],null,null,null,null,null)),(e()(),r.Mb(-1,null,["innovative thinking"])),(e()(),r.Mb(-1,null,["."])),(e()(),r.sb(56,0,null,null,16,"div",[["class","col-lg-4"]],null,null,null,null,null)),(e()(),r.sb(57,0,null,null,15,"div",[["class","card card-lift--hover shadow border-0"]],null,null,null,null,null)),(e()(),r.sb(58,0,null,null,14,"div",[["class","card-body py-5"]],null,null,null,null,null)),(e()(),r.sb(59,0,null,null,1,"div",[["class","icon icon-shape icon-shape-success rounded-circle mb-4"]],null,null,null,null,null)),(e()(),r.sb(60,0,null,null,0,"i",[["class","ni ni-bulb-61"]],null,null,null,null,null)),(e()(),r.sb(61,0,null,null,1,"h6",[["class","text-success text-uppercase"]],null,null,null,null,null)),(e()(),r.Mb(-1,null,["Enhance"])),(e()(),r.sb(63,0,null,null,7,"p",[["class","description mt-3"]],null,null,null,null,null)),(e()(),r.Mb(-1,null,["Enhance member's knowledge on "])),(e()(),r.sb(65,0,null,null,1,"span",[["class","badge badge-pill badge-success"]],null,null,null,null,null)),(e()(),r.Mb(-1,null,["technical"])),(e()(),r.Mb(-1,null,[" skills as well as "])),(e()(),r.sb(68,0,null,null,1,"span",[["class","badge badge-pill badge-success"]],null,null,null,null,null)),(e()(),r.Mb(-1,null,["soft"])),(e()(),r.Mb(-1,null,[" skills."])),(e()(),r.sb(71,0,null,null,0,"br",[],null,null,null,null,null)),(e()(),r.sb(72,0,null,null,0,"br",[],null,
1null,null,null,null)),(e()(),r.sb(73,0,null,null,14,"div",[["class","col-lg-4"]],null,null,null,null,null)),(e()(),r.sb(74,0,null,null,13,"div",[["class","card card-lift--hover shadow border-0"]],null,null,null,null,null)),(e()(),r.sb(75,0,null,null,12,"div",[["class","card-body py-5"]],null,null,null,null,null)),(e()(),r.sb(76,0,null,null,1,"div",[["class","icon icon-shape icon-shape-warning rounded-circle mb-4"]],null,null,null,null,null)),(e()(),r.sb(77,0,null,null,0,"i",[["class","ni ni-briefcase-24"]],null,null,null,null,null)),(e()(),r.sb(78,0,null,null,1,"h6",[["class","text-warning text-uppercase"]],null,null,null,null,null)),(e()(),r.Mb(-1,null,["Prepare"])),(e()(),r.sb(80,0,null,null,7,"p",[["class","description mt-3"]],null,null,null,null,null)),(e()(),r.Mb(-1,null,["Give members the "])),(e()(),r.sb(82,0,null,null,1,"span",[["class","badge badge-pill badge-warning"]],null,null,null,null,null)),(e()(),r.Mb(-1,null,["opportunity"])),(e()(),r.Mb(-1,null,[" to get to know members from other universities/companies and prepare them for future "])),(e()(),r.sb(85,0,null,null,1,"span",[["class","badge badge-pill badge-warning"]],null,null,null,null,null)),(e()(),r.Mb(-1,null,["challenges"])),(e()(),r.Mb(-1,null,["."])),(e()(),r.sb(88,0,null,null,5,"section",[["class","section section-lg"],["id","event-calendar"]],null,null,null,null,null)),(e()(),r.sb(89,0,null,null,4,"div",[["class","container"]],null,null,null,null,null)),(e()(),r.sb(90,0,null,null,3,"div",[["class","row row-grid align-items-center"]],null,null,null,null,null)),(e()(),r.sb(91,0,null,null,1,"h3",[],null,null,null,null,null)),(e()(),r.Mb(-1,null,["Event Calendar"])),(e()(),r.sb(93,0,null,null,0,"iframe",[["frameborder","0"],["height","600"],["scrolling","no"],["src","https://calendar.google.com/calendar/embed?height=600&wkst=1&bgcolor=%23ffffff&ctz=Asia%2FKuala_Lumpur&src=aWVlZS51bm1jQGdtYWlsLmNvbQ&src=ZW4ubWFsYXlzaWEjaG9saWRheUBncm91cC52LmNhbGVuZGFyLmdvb2dsZS5jb20&color=%237986CB&color=%23616161&showTitle=0"],["style","border-width:0"],["width","1100"]],null,null,null,null,null)),(e()(),r.sb(94,0,null,null,10,"section",[["class","section section-lg"],["id","team"]],null,null,null,null,null)),(e()(),r.sb(95,0,null,null,9,"div",[["class","container"]],null,null,null,null,null)),(e()(),r.sb(96,0,null,null,5,"div",[["class","row justify-content-center text-center mb-lg"]],null,null,null,null,null)),(e()(),r.sb(97,0,null,null,4,"div",[["class","col-lg-8"]],null,null,null,null,null)),(e()(),r.sb(98,0,null,null,1,"h2",[["class","display-3"]],null,null,null,null,null)),(e()(),r.Mb(-1,null,["Our Amazing Team"])),(e()(),r.sb(100,0,null,null,1,"p",[["class","lead text-muted"]],null,null,null,null,null)),(e()(),r.Mb(-1,null,["Feel free to have a chat with them."])),(e()(),r.sb(102,0,null,null,2,"div",[["class","row"]],null,null,null,null,null)),(e()(),r.ib(16777216,null,null,1,null,za)),r.rb(104,278528,null,0,o.j,[r.O,r.L,r.r],{ngForOf:[0,"ngForOf"]},null),(e()(),r.sb(105,0,null,null,4,"section",[["class","section section-lg bg-gradient-default"],["id","achievement"]],null,null,null,null,null)),(e()(),r.sb(106,0,null,null,0,"div",[["class","container pb-300"]],null,null,null,null,null)),(e()(),r.sb(107,0,null,null,2,"div",[["class","separator separator-bottom separator-skew zindex-100"]],null,null,null,null,null)),(e()(),r.sb(108,0,null,null,1,":svg:svg",[["preserveAspectRatio","none"],["version","1.1"],["viewBox","0 0 2560 100"],["x","0"],["xmlns","http://www.w3.org/2000/svg"],["y","0"]],null,null,null,null,null)),(e()(),r.sb(109,0,null,null,0,":svg:polygon",[["class","fill-white"],["points","2560 0 2560 100 0 100"]],null,null,null,null,null)),(e()(),r.sb(110,0,null,null,15,"section",[["class","section section-lg pt-lg-0 section-contact-us"],["id","contact-us"]],null,null,null,null,null)),(e()(),r.sb(111,0,null,null,14,"div",[["class","container"]],null,null,null,null,null)),(e()(),r.sb(112,0,null,null,13,"div",[["class","row justify-content-center mt--300"]],null,null,null,null,null)),(e()(),r.sb(113,0,null,null,12,"div",[["class","col-lg-8"]],null,null,null,null,null)),(e()(),r.sb(114,0,null,null,11,"div",[["class","card bg-gradient-secondary shadow"]],null,null,null,null,null)),(e()(),r.sb(115,0,null,null,10,"div",[["class","card-body p-lg-5"]],null,null,null,null,null)),(e()(),r.sb(116,0,null,null,1,"h4",[["class","text-center mb-1"]],null,null,null,null,null)),(e()(),r.Mb(-1,null,["Any queries?"])),(e()(),r.sb(118,0,null,null,1,"p",[["class","text-center mt-0"]],null,null,null,null,null)),(e()(),r.Mb(-1,null,["Contact us now."])),(e()(),r.sb(120,0,null,null,0,"img",[["alt","logo"],["class","img-fluid"],["src","../../assets/img/brand/blue.png"]],null,null,null,null,null)),(e()(),r.sb(121,0,null,null,0,"br",[],null,
1null,null,null,null)),(e()(),r.sb(122,0,null,null,0,"br",[],null,null,null,null,null)),(e()(),r.sb(123,0,null,null,2,"div",[],null,null,null,null,null)),(e()(),r.sb(124,0,null,null,1,"button",[["class","btn btn-default btn-round btn-block btn-lg"],["onclick","window.location.href='mailto:[email protected]'"],["type","button"]],null,null,null,null,null)),(e()(),r.Mb(-1,null,[" Send Message "]))],function(e,t){var n=t.component;e(t,29,0,n.intros),e(t,104,0,n.teams)},function(e,t){e(t,25,0,"block")})}function Qa(e){return r.Ob(0,[(e()(),r.sb(0,0,null,null,1,"app-landing",[],null,null,null,Wa,qa)),r.rb(1,114688,null,0,Ua,[Va],null,null)],function(e,t){e(t,1,0)},null)}var Ga=r.ob("app-landing",Ua,Qa,{},{},[]);class Ka{constructor(e){this.afs=e}getPress(){return this.afs.collection("press",e=>e.orderBy("id","desc")).valueChanges()}}class $a{constructor(e){this.pressService=e}ngOnInit(){this.pressService.getPress().subscribe(e=>{this.pressArray=e})}}var Ya=r.qb({encapsulation:0,styles:[['section[_ngcontent-%COMP%]{padding:80px 0}.timeline[_ngcontent-%COMP%]{position:relative}.timeline[_ngcontent-%COMP%]::before{content:"";background:#c5cae9;width:5px;height:95%;position:absolute;left:50%;transform:translateX(-50%)}.title[_ngcontent-%COMP%]{font-size:25px;padding-left:15px}.timeline-item-left[_ngcontent-%COMP%]{width:100%;margin-bottom:70px}.timeline-item-left[_ngcontent-%COMP%]   .timeline-content[_ngcontent-%COMP%]{float:0;padding:40px 30px 10px}.timeline-item-left[_ngcontent-%COMP%]   .timeline-content[_ngcontent-%COMP%]   .date[_ngcontent-%COMP%]{right:auto;left:0}.timeline-item-left[_ngcontent-%COMP%]::after{content:"";display:block;clear:both}.timeline-item-right[_ngcontent-%COMP%]{width:100%;margin-bottom:70px}.timeline-item-right[_ngcontent-%COMP%]   .timeline-content[_ngcontent-%COMP%]{float:right;padding:40px 30px 10px}.timeline-item-right[_ngcontent-%COMP%]   .timeline-content[_ngcontent-%COMP%]   .date[_ngcontent-%COMP%]{right:auto;left:0}.timeline-item-right[_ngcontent-%COMP%]::after{content:"";display:block;clear:both}.timeline-content[_ngcontent-%COMP%]{position:relative;width:47%;padding:10px 30px;border-radius:10px;background:#f5f5f5;box-shadow:0 20px 25px -8px rgba(0,0,0,.3)}.timeline-content[_ngcontent-%COMP%]::after{content:"";position:absolute;border-style:solid;width:0;height:0;top:30px;right:-15px;border-width:10px 0 10px 15px;border-color:transparent transparent transparent #f5f5f5}.timeline-img[_ngcontent-%COMP%]{width:30px;height:30px;background:#3f51b5;border-radius:50%;position:absolute;left:50%;margin-top:25px;margin-left:-15px}a[_ngcontent-%COMP%]{background:#9235c8;color:#fff;padding:8px 20px;text-transform:uppercase;font-size:10px;margin-bottom:20px;margin-top:10px;display:inline-block;border-radius:2px;box-shadow:0 1px 3px -1px rgba(0,0,0,.6)}a[_ngcontent-%COMP%]:active, a[_ngcontent-%COMP%]:focus, a[_ngcontent-%COMP%]:hover{background:#32408f;color:#fff;text-decoration:none}.timeline-card[_ngcontent-%COMP%]{padding:0!important}.timeline-card[_ngcontent-%COMP%]   p[_ngcontent-%COMP%]{padding:0 20px}.timeline-card[_ngcontent-%COMP%]   a[_ngcontent-%COMP%]{margin-left:20px}.timeline-img-header[_ngcontent-%COMP%]{height:275px;position:relative;margin-bottom:20px}blockquote[_ngcontent-%COMP%]{margin-top:30px;color:#757575;border-left-color:#3f51b5;padding:0 20px}.date[_ngcontent-%COMP%]{background:#9235c8;display:inline-block;color:#fff;padding:10px;position:absolute;top:0;right:0}@media screen and (max-width:600px){.timeline[_ngcontent-%COMP%]::before{left:10%}.timeline-img[_ngcontent-%COMP%]{position:absolute;left:10%}.timeline-content[_ngcontent-%COMP%]{position:relative;width:100%}.container[_ngcontent-%COMP%]{padding-left:15%}.container[_ngcontent-%COMP%]   .title[_ngcontent-%COMP%]{font-size:20px}}']],data:{}});function Za(e){return r.Ob(0,[(e()(),r.sb(0,0,null,null,15,"div",[],null,null,null,null,null)),(e()(),r.sb(1,0,null,null,14,"div",[["class","timeline-item-left"]],null,null,null,null,null)),(e()(),r.sb(2,0,null,null,0,"div",[["class","timeline-img"]],null,null,null,null,null)),(e()(),r.sb(3,0,null,null,12,"div",[["class","timeline-content timeline-card"]],null,null,null,null,null)),(e()(),r.sb(4,0,null,null,0,"div",[["class","timeline-img-header"],["style","background-size: 100% "]],[[4,"background-image",null]],null,null,null,null)),(e()(),r.sb(5,0,null,null,1,"div",[["class","date"]],null,null,null,null,null)),(e()(),r.Mb(6,null,["",""])),(e()(),r.sb(7,0,null,null,1,"h2",[["class","title"]],null,null,null,null,null)),(e()(),r.Mb(8,null,["",""])),(e()(),r.sb(9,0,null,null,2,"p",[],null,
1null,null,null,null)),(e()(),r.Mb(10,null,["",""])),r.Gb(0,o.q,[]),(e()(),r.sb(12,0,null,null,3,"a",[["class","bnt-more"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(e,t,n){var i=!0;return"click"===t&&(i=!1!==r.Eb(e,13).onClick(n.button,n.ctrlKey,n.metaKey,n.shiftKey)&&i),i},null,null)),r.rb(13,671744,null,0,Zr,[Yr,Vn,o.i],{routerLink:[0,"routerLink"]},null),r.Fb(14,2),(e()(),r.Mb(-1,null,["More"]))],function(e,t){var n=e(t,14,0,"/press",t.parent.context.$implicit.id);e(t,13,0,n)},function(e,t){e(t,4,0,"url("+t.parent.context.$implicit.images[0]+")"),e(t,6,0,t.parent.context.$implicit.date),e(t,8,0,t.parent.context.$implicit.name),e(t,10,0,t.parent.context.$implicit.content.length>100?r.Nb(t,10,0,r.Eb(t,11).transform(t.parent.context.$implicit.content,0,100))+".....":t.parent.context.$implicit.content),e(t,12,0,r.Eb(t,13).target,r.Eb(t,13).href)})}function Ja(e){return r.Ob(0,[(e()(),r.sb(0,0,null,null,15,"div",[],null,null,null,null,null)),(e()(),r.sb(1,0,null,null,14,"div",[["class","timeline-item-right"]],null,null,null,null,null)),(e()(),r.sb(2,0,null,null,0,"div",[["class","timeline-img"]],null,null,null,null,null)),(e()(),r.sb(3,0,null,null,12,"div",[["class","timeline-content timeline-card "]],null,null,null,null,null)),(e()(),r.sb(4,0,null,null,0,"div",[["class","timeline-img-header"],["style","background-size: 100% auto"]],[[4,"background-image",null]],null,null,null,null)),(e()(),r.sb(5,0,null,null,1,"div",[["class","date"]],null,null,null,null,null)),(e()(),r.Mb(6,null,["",""])),(e()(),r.sb(7,0,null,null,1,"h2",[["class","title"]],null,null,null,null,null)),(e()(),r.Mb(8,null,["",""])),(e()(),r.sb(9,0,null,null,2,"p",[],null,null,null,null,null)),(e()(),r.Mb(10,null,["",""])),r.Gb(0,o.q,[]),(e()(),r.sb(12,0,null,null,3,"a",[["class","bnt-more"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(e,t,n){var i=!0;return"click"===t&&(i=!1!==r.Eb(e,13).onClick(n.button,n.ctrlKey,n.metaKey,n.shiftKey)&&i),i},null,null)),r.rb(13,671744,null,0,Zr,[Yr,Vn,o.i],{routerLink:[0,"routerLink"]},null),r.Fb(14,2),(e()(),r.Mb(-1,null,["More"]))],function(e,t){var n=e(t,14,0,"/press",t.parent.context.$implicit.id);e(t,13,0,n)},function(e,t){e(t,4,0,"url("+t.parent.context.$implicit.images[0]+")"),e(t,6,0,t.parent.context.$implicit.date),e(t,8,0,t.parent.context.$implicit.name),e(t,10,0,t.parent.context.$implicit.content.length>100?r.Nb(t,10,0,r.Eb(t,11).transform(t.parent.context.$implicit.content,0,100))+".....":t.parent.context.$implicit.content),e(t,12,0,r.Eb(t,13).target,r.Eb(t,13).href)})}function Xa(e){return r.Ob(0,[(e()(),r.sb(0,0,null,null,4,"div",[],null,null,null,null,null)),(e()(),r.ib(16777216,null,null,1,null,Za)),r.rb(2,16384,null,0,o.k,[r.O,r.L],{ngIf:[0,"ngIf"]},null),(e()(),r.ib(16777216,null,null,1,null,Ja)),r.rb(4,16384,null,0,o.k,[r.O,r.L],{ngIf:[0,"ngIf"]},null)],function(e,t){e(t,2,0,t.context.$implicit.id%2==0),e(t,4,0,t.context.$implicit.id%2!=0)},null)}function eu(e){return r.Ob(0,[(e()(),r.sb(0,0,null,null,23,"main",[["class","profile-page"]],null,null,null,null,null)),(e()(),r.sb(1,0,null,null,18,"section",[["class","section section-lg section-shaped pb-80"]],null,null,null,null,null)),(e()(),r.sb(2,0,null,null,9,"div",[["class","shape shape-style-1 shape-primary"]],null,null,null,null,null)),(e()(),r.sb(3,0,null,null,0,"span",[],null,null,null,null,null)),(e()(),r.sb(4,0,null,null,0,"span",[],null,null,null,null,null)),(e()(),r.sb(5,0,null,null,0,"span",[],null,null,null,null,null)),(e()(),r.sb(6,0,null,null,0,"span",[],null,null,null,null,null)),(e()(),r.sb(7,0,null,null,0,"span",[],null,null,null,null,null)),(e()(),r.sb(8,0,null,null,0,"span",[],null,null,null,null,null)),(e()(),r.sb(9,0,null,null,0,"span",[],null,null,null,null,null)),(e()(),r.sb(10,0,null,null,0,"span",[],null,null,null,null,null)),(e()(),r.sb(11,0,null,null,0,"span",[],null,null,null,null,null)),(e()(),r.sb(12,0,null,null,7,"div",[["class","container py-lg-md d-flex"]],null,null,null,null,null)),(e()(),r.sb(13,0,null,null,6,"div",[["class","col px-0"]],null,null,null,null,null)),(e()(),r.sb(14,0,null,null,5,"div",[["class","row"]],null,null,null,null,null)),(e()(),r.sb(15,0,null,null,4,"div",[["class","col-lg-6"]],null,null,null,null,null)),(e()(),r.sb(16,0,null,null,1,"h1",[["class","display-3  text-white"]],null,null,null,null,null)),(e()(),r.Mb(-1,null,["Previous Events "])),(e()(),r.sb(18,0,null,null,1,"p",[["class","lead  text-white"]],null,null,null,null,null)),(e()(),r.Mb(-1,null,["Since the beginning of this organization, we have hosted various events to help members and even other students in gaining exposure from the electrical and electronic engineering indsutry. "])),(e()(),r.sb(20,0,null,null,3,"section",[["class","timeline"]],null,null,null,null,null)),(e()(),r.sb(21,0,null,null,2,"div",[["class","container"]],null,null,null,null,null)),(e()(),r.ib(16777216,null,null,1,null,Xa)),r.rb(23,278528,null,0,o.j,[r.O,r.L,r.r],{ngForOf:[0,"ngForOf"]},null)],function(e,t){e(t,23,0,t.component.pressArray)},null)}function tu(e){return r.Ob(0,[(e()(),r.sb(0,0,null,null,1,"app-press",[],null,
1null,null,eu,Ya)),r.rb(1,114688,null,0,$a,[Ka],null,null)],function(e,t){e(t,1,0)},null)}var nu=r.ob("app-press",$a,tu,{},{},[]);class ru{constructor(e,t,n){this.activatedRoute=e,this.pressService=t,this.afs=n,this.insight={}}ngOnInit(){this.sub=this.activatedRoute.params.subscribe(e=>{this.fetchInsights(e.id)})}ngOnDestroy(){this.sub.unsubscribe()}fetchInsights(e){this.afs.collection("press").ref.where("id","==",Number(e)).get().then(e=>{e.forEach(e=>{this.insight=e.data()})})}}var iu=n("Xr7G"),ou=r.qb({encapsulation:0,styles:[[""]],data:{}});function su(e){return r.Ob(0,[(e()(),r.sb(0,0,null,null,0,"img",[["alt","group picture"],["class","img-fluid"]],[[8,"src",4]],null,null,null,null))],null,function(e,t){e(t,0,0,r.wb(1,"",t.parent.context.$implicit,""))})}function au(e){return r.Ob(0,[(e()(),r.ib(0,null,null,1,null,su)),r.rb(1,16384,[[1,4]],0,oo,[r.L],null,null)],null,null)}function uu(e){return r.Ob(0,[(e()(),r.sb(0,0,null,null,44,"main",[["class","profile-page"]],null,null,null,null,null)),(e()(),r.sb(1,0,null,null,15,"section",[["class","section section-lg section-shaped pb-250"]],null,null,null,null,null)),(e()(),r.sb(2,0,null,null,8,"div",[["class","shape shape-style-1 bg-gradient-default"]],null,null,null,null,null)),(e()(),r.sb(3,0,null,null,0,"span",[],null,null,null,null,null)),(e()(),r.sb(4,0,null,null,0,"span",[],null,null,null,null,null)),(e()(),r.sb(5,0,null,null,0,"span",[],null,null,null,null,null)),(e()(),r.sb(6,0,null,null,0,"span",[],null,null,null,null,null)),(e()(),r.sb(7,0,null,null,0,"span",[],null,null,null,null,null)),(e()(),r.sb(8,0,null,null,0,"span",[],null,null,null,null,null)),(e()(),r.sb(9,0,null,null,0,"span",[],null,null,null,null,null)),(e()(),r.sb(10,0,null,null,0,"span",[],null,null,null,null,null)),(e()(),r.sb(11,0,null,null,5,"div",[["class","container py-lg-md d-flex"]],null,null,null,null,null)),(e()(),r.sb(12,0,null,null,4,"div",[["class","col px-0"]],null,null,null,null,null)),(e()(),r.sb(13,0,null,null,3,"div",[["class","row"]],null,null,null,null,null)),(e()(),r.sb(14,0,null,null,2,"div",[["class","col-lg-6"]],null,null,null,null,null)),(e()(),r.sb(15,0,null,null,1,"h1",[["class","display-3  text-white"]],null,null,null,null,null)),(e()(),r.Mb(-1,null,["Previous Events "])),(e()(),r.sb(17,0,null,null,19,"section",[["class","section"]],null,null,null,null,null)),(e()(),r.sb(18,0,null,null,18,"div",[["class","container"]],null,null,null,null,null)),(e()(),r.sb(19,0,null,null,17,"div",[["class","card card-profile shadow mt--300"]],null,null,null,null,null)),(e()(),r.sb(20,0,null,null,16,"div",[["class","px-4"]],null,null,null,null,null)),(e()(),r.sb(21,0,null,null,10,"div",[["class","text-center mt-5"]],null,null,null,null,null)),(e()(),r.sb(22,0,null,null,1,"h3",[],null,null,null,null,null)),(e()(),r.Mb(23,null,["",""])),(e()(),r.sb(24,0,null,null,2,"div",[["class","h6 font-weight-300"]],null,null,null,null,null)),(e()(),r.sb(25,0,null,null,0,"i",[["class","ni location_pin mr-2"]],null,null,null,null,null)),(e()(),r.Mb(26,null,["",""])),(e()(),r.sb(27,0,null,null,4,"ngb-carousel",[["class","carousel slide"],["tabIndex","0"]],[[4,"display",null]],[[null,"mouseenter"],[null,"mouseleave"],[null,"keydown.arrowLeft"],[null,"keydown.arrowRight"]],function(e,t,n){var i=!0;return"mouseenter"===t&&(i=!1!==(r.Eb(e,28).pauseOnHover&&r.Eb(e,28).pause())&&i),"mouseleave"===t&&(i=!1!==(r.Eb(e,28).pauseOnHover&&r.Eb(e,28).cycle())&&i),"keydown.arrowLeft"===t&&(i=!1!==(r.Eb(e,28).keyboard&&r.Eb(e,28).prev())&&i),"keydown.arrowRight"===t&&(i=!1!==(r.Eb(e,28).keyboard&&r.Eb(e,28).next())&&i),i},Cs,ys)),r.rb(28,3850240,null,1,so,[ro,r.A,r.y,r.h],null,null),r.Kb(603979776,1,{slides:1}),(e()(),r.ib(16777216,null,null,1,null,au)),r.rb(31,278528,null,0,o.j,[r.O,r.L,r.r],{ngForOf:[0,"ngForOf"]},null),(e()(),r.sb(32,0,null,null,4,"div",[["class","mt-5 py-5 border-top text-center"]],null,null,null,null,null)),(e()(),r.sb(33,0,null,null,3,"div",[["class","row justify-content-center"]],null,null,null,null,null)),(e()(),r.sb(34,0,null,null,2,"div",[["class","col-lg-9"]],null,null,null,null,null)),(e()(),r.sb(35,0,null,null,1,"p",[],null,
1null,null,null,null)),(e()(),r.Mb(36,null,["",""])),(e()(),r.sb(37,0,null,null,0,"br",[],null,null,null,null,null)),(e()(),r.sb(38,0,null,null,0,"br",[],null,null,null,null,null)),(e()(),r.sb(39,0,null,null,0,"br",[],null,null,null,null,null)),(e()(),r.sb(40,0,null,null,0,"br",[],null,null,null,null,null)),(e()(),r.sb(41,0,null,null,0,"br",[],null,null,null,null,null)),(e()(),r.sb(42,0,null,null,0,"br",[],null,null,null,null,null)),(e()(),r.sb(43,0,null,null,0,"br",[],null,null,null,null,null)),(e()(),r.sb(44,0,null,null,0,"br",[],null,null,null,null,null))],function(e,t){e(t,31,0,t.component.insight.images)},function(e,t){var n=t.component;e(t,23,0,n.insight.name),e(t,26,0,n.insight.date),e(t,27,0,"block"),e(t,36,0,n.insight.content)})}function lu(e){return r.Ob(0,[(e()(),r.sb(0,0,null,null,1,"app-insights",[],null,null,null,uu,ou)),r.rb(1,245760,null,0,ru,[Vn,Ka,iu.a],null,null)],function(e,t){e(t,1,0)},null)}var cu=r.ob("app-insights",ru,lu,{},{},[]);class hu{constructor(e,t){this.location=e,this.router=t,this.isCollapsed=!0,this.yScrollStack=[]}ngOnInit(){this.router.events.subscribe(e=>{this.isCollapsed=!0,e instanceof Ot?e.url!=this.lastPoppedUrl&&this.yScrollStack.push(window.scrollY):e instanceof Nt&&(e.url==this.lastPoppedUrl?(this.lastPoppedUrl=void 0,window.scrollTo(0,this.yScrollStack.pop())):window.scrollTo(0,0))}),this.location.subscribe(e=>{this.lastPoppedUrl=e.url})}isHome(){return"#/home"===this.location.prepareExternalUrl(this.location.path())}isDocumentation(){return"#/documentation"===this.location.prepareExternalUrl(this.location.path())}}var du=r.qb({encapsulation:0,styles:[[""]],data:{}});function fu(e){return r.Ob(0,[(e()(),r.sb(0,0,null,null,48,"nav",[["class","navbar navbar-main navbar-expand-lg navbar-transparent navbar-light headroom headroom--top headroom--pinned"],["
1id","navbar-main"]],null,null,null,null,null)),(e()(),r.sb(1,0,null,null,47,"div",[["class","container"]],null,null,null,null,null)),(e()(),r.sb(2,0,null,null,3,"a",[["class","navbar-brand mr-lg-5"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(e,t,n){var i=!0;return"click"===t&&(i=!1!==r.Eb(e,3).onClick(n.button,n.ctrlKey,n.metaKey,n.shiftKey)&&i),i},null,null)),r.rb(3,671744,null,0,Zr,[Yr,Vn,o.i],{routerLink:[0,"routerLink"]},null),r.Fb(4,1),(e()(),r.sb(5,0,null,null,0,"img",[["src","./assets/img/brand/argon-white.png"]],null,null,null,null,null)),(e()(),r.sb(6,0,null,null,1,"button",[["aria-controls","navbar_global"],["class","navbar-toggler"],["type","button"]],[[1,"aria-expanded",0]],[[null,"click"]],function(e,t,n){var r=!0,i=e.component;return"click"===t&&(r=0!=(i.isCollapsed=!i.isCollapsed)&&r),r},null,null)),(e()(),r.sb(7,0,null,null,0,"span",[["class","navbar-toggler-icon"]],null,null,null,null,null)),(e()(),r.sb(8,0,null,null,40,"div",[["class","navbar-collapse collapse"],["id","navbar_global"]],[[2,"collapse",null],[2,"show",null]],null,null,null,null)),r.rb(9,16384,null,0,lo,[],{collapsed:[0,"collapsed"]},null),(e()(),r.sb(10,0,null,null,10,"div",[["class","navbar-collapse-header"]],null,null,null,null,null)),(e()(),r.sb(11,0,null,null,9,"div",[["class","row"]],null,null,null,null,null)),(e()(),r.sb(12,0,null,null,4,"div",[["class","col-6 collapse-brand"]],null,null,null,null,null)),(e()(),r.sb(13,0,null,null,3,"a",[],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(e,t,n){var i=!0;return"click"===t&&(i=!1!==r.Eb(e,14).onClick(n.button,n.ctrlKey,n.metaKey,n.shiftKey)&&i),i},null,null)),r.rb(14,671744,null,0,Zr,[Yr,Vn,o.i],{routerLink:[0,"routerLink"]},null),r.Fb(15,1),(e()(),r.sb(16,0,null,null,0,"img",[["src","./assets/img/brand/blue.png"]],null,null,null,null,null)),(e()(),r.sb(17,0,null,null,3,"div",[["class","col-6 collapse-close"]],null,null,null,null,null)),(e()(),r.sb(18,0,null,null,2,"button",[["aria-controls","navbar_global"],["class","navbar-toggler"],["type","button"]],[[1,"aria-expanded",0]],[[null,"click"]],function(e,t,n){var r=!0,i=e.component;return"click"===t&&(r=0!=(i.isCollapsed=!i.isCollapsed)&&r),r},null,null)),(e()(),r.sb(19,0,null,null,0,"span",[],null,null,null,null,null)),(e()(),r.sb(20,0,null,null,0,"span",[],null,null,null,null,null)),(e()(),r.sb(21,0,null,null,27,"ul",[["class","navbar-nav align-items-lg-center ml-lg-auto"]],null,null,null,null,null)),(e()(),r.sb(22,0,null,null,6,"li",[["class","nav-item"]],null,null,null,null,null)),(e()(),r.sb(23,0,null,null,5,"a",[["class","nav-link no-caret"],["role","button"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(e,t,n){var i=!0;return"click"===t&&(i=!1!==r.Eb(e,24).onClick(n.button,n.ctrlKey,n.metaKey,n.shiftKey)&&i),i},null,null)),r.rb(24,671744,null,0,Zr,[Yr,Vn,o.i],{routerLink:[0,"routerLink"]},null),r.Fb(25,1),(e()(),r.sb(26,0,null,null,0,"i",[["class","ni ni-ui-04 d-lg-none"]],null,null,null,null,null)),(e()(),r.sb(27,0,null,null,1,"span",[["class","nav-link-inner--text"]],null,null,null,null,null)),(e()(),r.Mb(-1,null,["Press"])),(e()(),r.sb(29,0,null,null,4,"li",[["class","nav-item"]],null,null,null,null,null)),(e()(),r.sb(30,0,null,null,3,"a",[["class","nav-link no-caret"],["href","#/home#event-calendar"],["role","button"]],null,null,null,null,null)),(e()(),r.sb(31,0,null,null,0,"i",[["class","ni ni-ui-04 d-lg-none"]],null,null,null,null,null)),(e()(),r.sb(32,0,null,null,1,"span",[["class","nav-link-inner--text"]],null,null,null,null,null)),(e()(),r.Mb(-1,null,["Event Calendar"])),(e()(),r.sb(34,0,null,null,4,"li",[["class","nav-item"]],null,null,null,null,null)),(e()(),r.sb(35,0,null,null,3,"a",[["class","nav-link no-caret"],["href","#/home#team"],["role","button"]],null,null,null,null,null)),(e()(),r.sb(36,0,null,null,0,"i",[["class","ni ni-ui-04 d-lg-none"]],null,null,null,null,null)),(e()(),r.sb(37,0,null,null,1,"span",[["class","nav-link-inner--text"]],null,null,null,null,null)),(e()(),r.Mb(-1,null,["Team"])),(e()(),r.sb(39,0,null,null,4,"li",[["class","nav-item"]],null,null,null,null,null)),(e()(),r.sb(40,0,null,null,3,"a",[["class","nav-link no-caret"],["href","#/home#contact-us"],["role","button"]],null,null,null,null,null)),(e()(),r.sb(41,0,null,null,0,"i",[["class","ni ni-ui-04 d-lg-none"]],null,null,null,null,null)),(e()(),r.sb(42,0,null,null,1,"span",[["class","nav-link-inner--text"]],null,null,null,null,null)),(e()(),r.Mb(-1,null,["Contact Us"])),(e()(),r.sb(44,0,null,null,4,"li",[["class","nav-item"]],null,null,null,null,null)),(e()(),r.sb(45,0,null,null,3,"a",[["class","nav-link nav-link-icon"],["data-toggle","tooltip"],["href","https://www.facebook.com/ieeeunmc/"],["target","_blank"],["title","Like us on Facebook"]],null,null,null,null,null)),(e()(),r.sb(46,0,null,null,0,"i",[["class","fa fa-facebook-square"]],null,null,null,null,null)),(e()(),r.sb(47,0,null,null,1,"span",[["class","nav-link-inner--text d-lg-none"]],null,null,null,null,null)),(e()(),r.Mb(-1,null,["Facebook"]))],function(e,t){var n=t.component,r=e(t,4,0,"/home");e(t,3,0,r),e(t,9,0,n.isCollapsed);var i=e(t,15,0,"");e(t,14,0,i);var o=e(t,25,0,"/press");e(t,24,0,o)},function(e,t){var n=t.component;e(t,2,0,r.Eb(t,3).target,r.Eb(t,3).href),e(t,6,0,!n.isCollapsed),e(t,8,0,!0,!r.Eb(t,9).collapsed),e(t,13,0,r.Eb(t,14).target,r.Eb(t,14).href),e(t,18,0,!n.isCollapsed),e(t,23,0,r.Eb(t,24).target,r.Eb(t,24).href)})}
1class pu{constructor(e){this.router=e,this.test=new Date}ngOnInit(){}getPath(){return this.router.url}}var mu=r.qb({encapsulation:0,styles:[[""]],data:{}});function gu(e){return r.Ob(0,[r.Gb(0,o.d,[r.t]),(e()(),r.sb(1,0,null,null,10,"footer",[["class","footer"]],null,null,null,null,null)),(e()(),r.sb(2,0,null,null,9,"div",[["class","container"]],null,null,null,null,null)),(e()(),r.sb(3,0,null,null,0,"hr",[],null,null,null,null,null)),(e()(),r.sb(4,0,null,null,7,"div",[["class","row align-items-center justify-content-md-between"]],null,null,null,null,null)),(e()(),r.sb(5,0,null,null,6,"div",[["class","col-md-6"]],null,null,null,null,null)),(e()(),r.sb(6,0,null,null,5,"div",[["class","copyright"]],null,null,null,null,null)),(e()(),r.Mb(7,null,[" \xa9 "," "])),r.Ib(8,2),(e()(),r.sb(9,0,null,null,1,"a",[["href","https://www.creative-tim.com?ref=adsa-footer"],["target","_blank"]],null,null,null,null,null)),(e()(),r.Mb(-1,null,["IEEE UNM"])),(e()(),r.Mb(-1,null,[". "]))],null,function(e,t){var n=t.component,i=r.Nb(t,7,0,e(t,8,0,r.Eb(t,0),n.test,"yyyy"));e(t,7,0,i)})}var yu=r.qb({encapsulation:0,styles:[[""]],data:{}});function bu(e){return r.Ob(0,[(e()(),r.sb(0,0,null,null,1,"app-navbar",[],null,
1null,null,fu,du)),r.rb(1,114688,null,0,hu,[o.h,Yr],null,null),(e()(),r.sb(2,16777216,null,null,1,"router-outlet",[],null,null,null,null,null)),r.rb(3,212992,null,0,ti,[ei,r.O,r.j,[8,null],r.h],null,null),(e()(),r.sb(4,0,null,null,1,"app-footer",[],null,null,null,gu,mu)),r.rb(5,114688,null,0,pu,[Yr],null,null)],function(e,t){e(t,1,0),e(t,3,0),e(t,5,0)},null)}function vu(e){return r.Ob(0,[(e()(),r.sb(0,0,null,null,1,"app-root",[],null,[["window","scroll"]],function(e,t,n){var i=!0;return"window:scroll"===t&&(i=!1!==r.Eb(e,1).hasScrolled(n)&&i),i},bu,yu)),r.rb(1,114688,null,0,Ii,[r.C,Yr,o.c,r.k,o.h],null,null)],function(e,t){e(t,1,0)},null)}var wu=r.ob("app-root",Ii,vu,{},{},[]),_u=n("yA/v"),Su=n("m7gy");class Eu{}var Cu=r.pb(i,[Ii],function(e){return r.Bb([r.Cb(512,r.j,r.bb,[[8,[gs,ra,Aa,Ma,ca,pa,_a,ja,Ga,nu,cu,wu]],[3,r.j],r.w]),r.Cb(5120,r.t,r.mb,[[3,r.t]]),r.Cb(4608,o.m,o.l,[r.t,[2,o.z]]),r.Cb(5120,r.jb,r.nb,[r.y]),r.Cb(5120,r.r,r.kb,[]),r.Cb(5120,r.s,r.lb,[]),r.Cb(4608,bt,vt,[o.c]),r.Cb(6144,r.G,null,[bt]),r.Cb(4608,ht,ft,[]),r.Cb(5120,Re,function(e,t,n,r,i,o,s,a){return[new lt(e,t,n),new yt(r),new pt(i,o,s,a)]},[o.c,r.y,r.A,o.c,o.c,ht,r.cb,[2,dt]]),r.Cb(4608,Me,Me,[Re,r.y]),r.Cb(135680,Fe,Fe,[o.c]),r.Cb(4608,ze,ze,[Me,Fe,r.c]),r.Cb(6144,r.E,null,[ze]),r.Cb(6144,Le,null,[Fe]),r.Cb(4608,r.M,r.M,[r.y]),r.Cb(4608,xi,xi,[]),r.Cb(4608,Zo,Zo,[r.j,r.q,Yo,qo]),r.Cb(5120,Vn,bi,[Yr]),r.Cb(4608,oi,oi,[]),r.Cb(6144,ri,null,[oi]),r.Cb(135680,si,si,[Yr,r.v,r.i,r.q,ri]),r.Cb(4608,ii,ii,[]),r.Cb(5120,ai,fi,[Yr,o.s,ui]),r.Cb(5120,Si,_i,[vi]),r.Cb(5120,r.b,function(e){return[e]},[Si]),r.Cb(5120,_u.b,_u.e,[_u.d,[2,_u.c]]),r.Cb(4608,iu.a,iu.a,[_u.d,[2,_u.c],[2,iu.c],[2,iu.d],r.A,r.y,[2,iu.e]]),r.Cb(4608,Va,Va,[iu.a]),r.Cb(4608,Ka,Ka,[iu.a]),r.Cb(1073742336,o.b,o.b,[]),r.Cb(1024,r.l,xt,[]),r.Cb(1024,r.x,function(){return[hi()]},[]),r.Cb(512,vi,vi,[r.q]),r.Cb(256,r.c,"serverApp",[]),r.Cb(2048,Ie,null,[r.c]),r.Cb(1024,r.d,function(e,t,n,r,i){return[(o=e,Ae("probe",Ne),Ae("coreTokens",Object.assign({},Oe,(o||[]).reduce((e,t)=>(e[t.name]=t.token,e),{}))),()=>Ne),wi(t),De(n,r,i)];var o},[[2,r.x],vi,Ie,o.c,r.q]),r.Cb(512,r.e,r.e,[[2,r.d]]),r.Cb(131584,r.g,r.g,[r.y,r.cb,r.q,r.l,r.j,r.e]),r.Cb(1073742336,r.f,r.f,[r.g]),r.Cb(1073742336,kt,kt,[[3,kt]]),r.Cb(1073742336,Ji,Ji,[]),r.Cb(1073742336,to,to,[]),r.Cb(1073742336,no,no,[]),r.Cb(1073742336,uo,uo,[]),r.Cb(1073742336,co,co,[]),r.Cb(1073742336,Ri,Ri,[]),r.Cb(1073742336,Mi,Mi,[]),r.Cb(1073742336,Vo,Vo,[]),r.Cb(1073742336,Uo,Uo,[]),r.Cb(1073742336,Jo,Jo,[]),r.Cb(1073742336,Xo,Xo,[]),r.Cb(1073742336,ts,ts,[]),r.Cb(1073742336,ns,ns,[]),r.Cb(1073742336,rs,rs,[]),r.Cb(1073742336,is,is,[]),r.Cb(1073742336,os,os,[]),r.Cb(1073742336,as,as,[]),r.Cb(1073742336,cs,cs,[]),r.Cb(1073742336,hs,hs,[]),r.Cb(1024,li,mi,[[3,Yr]]),r.Cb(512,yn,bn,[]),r.Cb(512,ei,ei,[]),r.Cb(256,ui,{useHash:!0,scrollPositionRestoration:"enabled",anchorScrolling:"enabled",scrollOffset:[0,64]},[]),r.Cb(1024,o.i,pi,[o.p,[2,o.a],ui]),r.Cb(512,o.h,o.h,[o.i,o.p]),r.Cb(512,r.i,r.i,[]),r.Cb(512,r.v,r.J,[r.i,[2,r.K]]),r.Cb(1024,Hr,function(){return[[{path:"home",component:Ua},{path:"press",component:$a},{path:"press/:id",component:ru},{path:"**",redirectTo:"home",pathMatch:"full"}]]},[]),r.Cb(1024,Yr,yi,[r.g,yn,ei,o.h,r.q,r.v,r.i,Hr,ui,[2,Wr],[2,qr]]),r.Cb(1073742336,di,di,[[2,li],[2,Yr]]),r.Cb(1073742336,Eu,Eu,[]),r.Cb(1073742336,_u.a,_u.a,[]),r.Cb(1073742336,Su.a,Su.a,[]),r.Cb(1073742336,i,i,[]),r.Cb(256,r.ab,!0,[]),r.Cb(256,_u.d,{apiKey:"AIzaSyAy3WryWEiSVzFaw1LMPI2LUUiM5yDZsg8",authDomain:"ieeeunm.firebaseapp.com",databaseURL:"https://ieeeunm.firebaseio.com",projectId:"ieeeunm",storageBucket:"ieeeunm.appspot.com",messagingSenderId:"594893952443",appId:"1:594893952443:web:38e580750269e16f"},[]),r.Cb(256,_u.c,"ieeeunm",[])])});Object(r.T)(),document.addEventListener("DOMContentLoaded",()=>{Dt().bootstrapModuleFactory(Cu).catch(e=>console.error(e))})},zVF4:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n("mrSG"),i={NODE_CLIENT:!1,NODE_ADMIN:!1,SDK_VERSION:"${JSCORE_VERSION}"},o=function(e,t){if(!e)throw s(t)},s=function(e){return new Error("Firebase Database ("+i.SDK_VERSION+") INTERNAL ASSERT FAILED: "+e)},a=function(e){for(var t=[],n=0,r=0;r<e.length;r++){var i=e.charCodeAt(r);i<128?t[n++]=i:i<2048?(t[n++]=i>>6|192,t[n++]=63&i|128):55296==(64512&i)&&r+1<e.length&&56320==(64512&e.charCodeAt(r+1))?(i=65536+((1023&i)<<10)+(1023&e.charCodeAt(++r)),t[n++]=i>>18|240,t[n++]=i>>12&63|128,t[n++]=i>>6&63|128,t[n++]=63&i|128):(t[n++]=i>>12|224,t[n++]=i>>6&63|128,t[n++]=63&i|128)}return t},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(e,t){if(!Array.isArray(e))throw Error("encodeByteArray takes an array as a parameter");this.init_();for(var n=t?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[],i=0;i<e.length;i+=3){var o=e[i],s=i+1<e.length,a=s?e[i+1]:0,u=i+2<e.length,l=u?e[i+2]:0,c=(15&a)<<2|l>>6,h=63&l;u||(h=64,s||(c=64)),r.push(n[o>>2],n[(3&o)<<4|a>>4],n[c],n[h])}return r.join("")},encodeString:function(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(a(e),t)},decodeString:function(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):function(e){for(var t=[],n=0,r=0;n<e.length;){var i=e[n++];if(i<128)t[r++]=String.fromCharCode(i);else if(i>191&&i<224){var o=e[n++];t[r++]=String.fromCharCode((31&i)<<6|63&o)}else if(i>239&&i<365){var s=((7&i)<<18|(63&(o=e[n++]))<<12|(63&(a=e[n++]))<<6|63&e[n++])-65536;t[r++]=String.fromCharCode(55296+(s>>10)),t[r++]=String.fromCharCode(56320+(1023&s))}else{o=e[n++];var a=e[n++];
1t[r++]=String.fromCharCode((15&i)<<12|(63&o)<<6|63&a)}}return t.join("")}(this.decodeStringToByteArray(e,t))},decodeStringToByteArray:function(e,t){this.init_();for(var n=t?this.charToByteMapWebSafe_:this.charToByteMap_,r=[],i=0;i<e.length;){var o=n[e.charAt(i++)],s=i<e.length?n[e.charAt(i)]:0,a=++i<e.length?n[e.charAt(i)]:64,u=++i<e.length?n[e.charAt(i)]:64;if(++i,null==o||null==s||null==a||null==u)throw Error();r.push(o<<2|s>>4),64!==a&&(r.push(s<<4&240|a>>2),64!==u&&r.push(a<<6&192|u))}return r},init_:function(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(var e=0;e<this.ENCODED_VALS.length;e++)this.byteToCharMap_[e]=this.ENCODED_VALS.charAt(e),this.charToByteMap_[this.byteToCharMap_[e]]=e,this.byteToCharMapWebSafe_[e]=this.ENCODED_VALS_WEBSAFE.charAt(e),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[e]]=e,e>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(e)]=e,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(e)]=e)}}},l=function(e){try{return u.decodeString(e,!0)}catch(t){console.error("base64Decode failed: ",t)}return null};function c(e,t){if(!(t instanceof Object))return t;switch(t.constructor){case Date:return new Date(t.getTime());case Object:void 0===e&&(e={});break;case Array:e=[];break;default:return t}for(var n in t)t.hasOwnProperty(n)&&(e[n]=c(e[n],t[n]));return e}var h=function(){function e(){var e=this;this.reject=function(){},this.resolve=function(){},this.promise=new Promise(function(t,n){e.resolve=t,e.reject=n})}return e.prototype.wrapCallback=function(e){var t=this;return function(n,r){n?t.reject(n):t.resolve(r),"function"==typeof e&&(t.promise.catch(function(){}),1===e.length?e(n):e(n,r))}},e}();function d(){return"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:""}var f="FirebaseError",p=function(e){function t(n,r){var i=e.call(this,r)||this;return i.code=n,i.name=f,Object.setPrototypeOf(i,t.prototype),Error.captureStackTrace&&Error.captureStackTrace(i,m.prototype.create),i}return r.__extends(t,e),t}(Error),m=function(){function e(e,t,n){this.service=e,this.serviceName=t,this.errors=n}return e.prototype.create=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var r=t[0]||{},i=this.service+"/"+e,o=this.errors[e],s=o?g(o,r):"Error",a=this.serviceName+": "+s+" ("+i+").",u=new p(i,a),l=0,c=Object.keys(r);l<c.length;l++){var h=c[l];"_"!==h.slice(-1)&&(h in u&&console.warn('Overwriting FirebaseError base field "'+h+'" can cause unexpected behavior.'),u[h]=r[h])}return u},e}();function g(e,t){return e.replace(y,function(e,n){var r=t[n];return null!=r?r.toString():"<"+n+"?>"})}var y=/\{\$([^}]+)}/g;function b(e){return JSON.parse(e)}var v=function(e){var t={},n={},r={},i="";try{var o=e.split(".");t=b(l(o[0])||""),n=b(l(o[1])||""),i=o[2],r=n.d||{},delete n.d}catch(s){}return{header:t,claims:n,data:r,signature:i}},w=function(){function e(){this.chain_=[],this.buf_=[],this.W_=[],this.pad_=[],this.inbuf_=0,this.total_=0,this.blockSize=64,this.pad_[0]=128;for(var e=1;e<this.blockSize;++e)this.pad_[e]=0;this.reset()}return 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(e,t){t||(t=0);var n=this.W_;if("string"==typeof e)for(var r=0;r<16;r++)n[r]=e.charCodeAt(t)<<24|e.charCodeAt(t+1)<<16|e.charCodeAt(t+2)<<8|e.charCodeAt(t+3),t+=4;else for(r=0;r<16;r++)n[r]=e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3],t+=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,s=this.chain_[0],a=this.chain_[1],u=this.chain_[2],l=this.chain_[3],c=this.chain_[4];for(r=0;r<80;r++){r<40?r<20?(i=l^a&(u^l),o=1518500249):(i=a^u^l,o=1859775393):r<60?(i=a&u|l&(a|u),o=2400959708):(i=a^u^l,o=3395469782);var h=(s<<5|s>>>27)+i+c+o+n[r]&4294967295;c=l,l=u,u=4294967295&(a<<30|a>>>2),a=s,s=h}this.chain_[0]=this.chain_[0]+s&4294967295,this.chain_[1]=this.chain_[1]+a&4294967295,this.chain_[2]=this.chain_[2]+u&4294967295,this.chain_[3]=this.chain_[3]+l&4294967295,this.chain_[4]=this.chain_[4]+c&4294967295},e.prototype.update=function(e,t){if(null!=e){void 0===t&&(t=e.length);for(var n=t-this.blockSize,r=0,i=this.buf_,o=this.inbuf_;r<t;){if(0===o)for(;r<=n;)this.compress_(e,r),r+=this.blockSize;if("string"==typeof e){for(;r<t;)if(i[o]=e.charCodeAt(r),++r,++o===this.blockSize){this.compress_(i),o=0;break}}else for(;r<t;)if(i[o]=e[r],++r,++o===this.blockSize){this.compress_(i),o=0;break}}this.inbuf_=o,this.total_+=t}},e.prototype.digest=function(){var e=[],t=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&t,t/=256;this.compress_(this.buf_);var r=0;for(n=0;n<5;n++)for(var i=24;i>=0;i-=8)e[r]=this.chain_[n]>>i&255,++r;return e},e}(),_=function(){function e(e,t){var n=this;this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Prom
1ise.resolve(),this.finalized=!1,this.onNoObservers=t,this.task.then(function(){e(n)}).catch(function(e){n.error(e)})}return e.prototype.next=function(e){this.forEachObserver(function(t){t.next(e)})},e.prototype.error=function(e){this.forEachObserver(function(t){t.error(e)}),this.close(e)},e.prototype.complete=function(){this.forEachObserver(function(e){e.complete()}),this.close()},e.prototype.subscribe=function(e,t,n){var r,i=this;if(void 0===e&&void 0===t&&void 0===n)throw new Error("Missing Observer.");void 0===(r=function(e,t){if("object"!=typeof e||null===e)return!1;for(var n=0,r=["next","error","complete"];n<r.length;n++){var i=r[n];if(i in e&&"function"==typeof e[i])return!0}return!1}(e)?e:{next:e,error:t,complete:n}).next&&(r.next=S),void 0===r.error&&(r.error=S),void 0===r.complete&&(r.complete=S);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(e){}}),this.observers.push(r),o},e.prototype.unsubscribeOne=function(e){void 0!==this.observers&&void 0!==this.observers[e]&&(delete this.observers[e],this.observerCount-=1,0===this.observerCount&&void 0!==this.onNoObservers&&this.onNoObservers(this))},e.prototype.forEachObserver=function(e){if(!this.finalized)for(var t=0;t<this.observers.length;t++)this.sendOne(t,e)},e.prototype.sendOne=function(e,t){var n=this;this.task.then(function(){if(void 0!==n.observers&&void 0!==n.observers[e])try{t(n.observers[e])}catch(r){"undefined"!=typeof console&&console.error&&console.error(r)}})},e.prototype.close=function(e){var t=this;this.finalized||(this.finalized=!0,void 0!==e&&(this.finalError=e),this.task.then(function(){t.observers=void 0,t.onNoObservers=void 0}))},e}();function S(){}function E(e,t,n){var r="";switch(t){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 e+" failed: "+r+" argument "}t.CONSTANTS=i,t.Deferred=h,t.ErrorFactory=m,t.FirebaseError=p,t.Sha1=w,t.assert=o,t.assertionError=s,t.async=function(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];Promise.resolve(!0).then(function(){e.apply(void 0,n)}).catch(function(e){t&&t(e)})}},t.base64=u,t.base64Decode=l,t.base64Encode=function(e){var t=a(e);return u.encodeByteArray(t,!0)},t.contains=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.createSubscribe=function(e,t){var n=new _(e,t);return n.subscribe.bind(n)},t.decode=v,t.deepCopy=function(e){return c(void 0,e)},t.deepExtend=c,t.errorPrefix=E,t.getUA=d,t.isAdmin=function(e){var t=v(e).claims;return"object"==typeof t&&!0===t.admin},t.isBrowser=function(){return"object"==typeof self&&self.self===self},t.isEmpty=function(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0},t.isMobileCordova=function(){return"undefined"!=typeof window&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(d())},t.isNode=function(){try{return"[object process]"===Object.prototype.toString.call(global.process)}catch(e){return!1}},t.isNodeSdk=function(){return!0===i.NODE_CLIENT||!0===i.NODE_ADMIN},t.isReactNative=function(){return"object"==typeof navigator&&"ReactNative"===navigator.product},t.isValidFormat=function(e){var t=v(e).claims;return!!t&&"object"==typeof t&&t.hasOwnProperty("iat")},t.isValidTimestamp=function(e){var t=v(e).claims,n=Math.floor((new Date).getTime()/1e3),r=0,i=0;return"object"==typeof t&&(t.hasOwnProperty("nbf")?r=t.nbf:t.hasOwnProperty("iat")&&(r=t.iat),i=t.hasOwnProperty("exp")?t.exp:r+86400),!!n&&!!r&&!!i&&n>=r&&n<=i},t.issuedAtTime=function(e){var t=v(e).claims;return"object"==typeof t&&t.hasOwnProperty("iat")?t.iat:null},t.jsonEval=b,t.map=function(e,t,n){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=t.call(n,e[i],i,e));return r},t.querystring=function(e){for(var t=[],n=function(e,n){Array.isArray(n)?n.forEac
1h(function(n){t.push(encodeURIComponent(e)+"="+encodeURIComponent(n))}):t.push(encodeURIComponent(e)+"="+encodeURIComponent(n))},r=0,i=Object.entries(e);r<i.length;r++){var o=i[r];n(o[0],o[1])}return t.length?"&"+t.join("&"):""},t.querystringDecode=function(e){var t={};return e.replace(/^\?/,"").split("&").forEach(function(e){if(e){var n=e.split("=");t[n[0]]=n[1]}}),t},t.safeGet=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0},t.stringLength=function(e){for(var t=0,n=0;n<e.length;n++){var r=e.charCodeAt(n);r<128?t++:r<2048?t+=2:r>=55296&&r<=56319?(t+=4,n++):t+=3}return t},t.stringToByteArray=function(e){for(var t=[],n=0,r=0;r<e.length;r++){var i=e.charCodeAt(r);if(i>=55296&&i<=56319){var s=i-55296;o(++r<e.length,"Surrogate pair missing trail surrogate."),i=65536+(s<<10)+(e.charCodeAt(r)-56320)}i<128?t[n++]=i:i<2048?(t[n++]=i>>6|192,t[n++]=63&i|128):i<65536?(t[n++]=i>>12|224,t[n++]=i>>6&63|128,t[n++]=63&i|128):(t[n++]=i>>18|240,t[n++]=i>>12&63|128,t[n++]=i>>6&63|128,t[n++]=63&i|128)}return t},t.stringify=function(e){return JSON.stringify(e)},t.validateArgCount=function(e,t,n,r){var i;if(r<t?i="at least "+t:r>n&&(i=0===n?"none":"no more than "+n),i)throw new Error(e+" failed: Was called with "+r+(1===r?" argument.":" arguments.")+" Expects "+i+".")},t.validateCallback=function(e,t,n,r){if((!r||n)&&"function"!=typeof n)throw new Error(E(e,t,r)+"must be a valid function.")},t.validateContextObject=function(e,t,n,r){if((!r||n)&&("object"!=typeof n||null===n))throw new Error(E(e,t,r)+"must be a valid context object.")},t.validateNamespace=function(e,t,n,r){if((!r||n)&&"string"!=typeof n)throw new Error(E(e,t,r)+"must be a valid firebase namespace.")}}},[[0,0]]]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.