PageSourceSearch

https://kumanoyakitori.co.jp/main.9bb259664cde9d9ba957.js

js kumanoyakitori.co.jp collected 2026-10-07 23:21:24 UTC 1,389,057 bytes, 1 lines download raw bytes

1(window.webpackJsonp=window.webpackJsonp||[]).push([[12],{"+7AZ":function(t,e,n){"use strict";n.r(e),n.d(e,"__extends",(function(){return i})),n.d(e,"__assign",(function(){return o})),n.d(e,"__rest",(function(){return a})),n.d(e,"__decorate",(function(){return s})),n.d(e,"__param",(function(){return u})),n.d(e,"__metadata",(function(){return c})),n.d(e,"__awaiter",(function(){return l})),n.d(e,"__generator",(function(){return h})),n.d(e,"__exportStar",(function(){return f})),n.d(e,"__values",(function(){return d})),n.d(e,"__read",(function(){return p})),n.d(e,"__spread",(function(){return m})),n.d(e,"__await",(function(){return y})),n.d(e,"__asyncGenerator",(function(){return v})),n.d(e,"__asyncDelegator",(function(){return g})),n.d(e,"__asyncValues",(function(){return b})),n.d(e,"__makeTemplateObject",(function(){return w})),n.d(e,"__importStar",(function(){return _})),n.d(e,"__importDefault",(function(){return S}));var r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};function i(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var o=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t};function a(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&(n[r[i]]=t[r[i]])}return n}function s(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a}function u(t,e){return function(n,r){e(n,r,t)}}function c(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function l(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(e){o(e)}}function s(t){try{u(r.throw(t))}catch(e){o(e)}}function u(t){t.done?i(t.value):new n((function(e){e(t.value)})).then(a,s)}u((r=r.apply(t,e||[])).next())}))}function h(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=r[2&o[0]?"return":o[0]?"throw":"next"])&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[0,i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}function f(t,e){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}function d(t){var e="function"==typeof Symbol&&t[Symbol.iterator],n=0;return e?e.call(t):{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}}function p(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function m(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(p(arguments[e]));return t}function y(t){return this instanceof y?(this.v=t,this):new y(t)}function v(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(t,e||[]),o=[];return r={},a("next"),a("throw"),a("return"),r[Symbol.asyncIterator]=function(){return this},r;function a(t){i[t]&&(r[t]=function(e){return new Promise((function(n,r){o.push([t,e,n,r])>1||s(t,e)}))})}function s(t,e){try{(n=i[t](e)).value instanceof y?Promise.resolve(n.value.v).then(u,c):l(o[0][2],n)}catch(r){l(o[0][3],r)}var n}function u(t){s("next",t)}function c(t){s("throw",t)}function l(t,e){t(e),o.shift(),o.length&&s(o[0][0],o[0][1])}}function g(t){var e,n;return e={},r("next"),r("throw",(function(t){throw t})),r("return"),e[Symbol.iterator]=function(){return this},e;function r(r,i){t[r]&&(e[r]=function(e){return(n=!n)?{value:y(t[r](e)),done:"return"===r}:i?i(e):e})}}function b(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator];return e?e.call(t):d(t)}function w(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function _(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function S(t){return t&&t.__esModule?t:{default:t}}},"+tJ4":function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(t){return function(e){for(var n=0,r=t.length;n<r&&!e.closed;n++)e.next(t[n]);e.closed||e.complete()}}},"+umK":function(t,e,n){"use strict";function r(){}n.d(e,"a",(function(){return r}))},"/WYv":function(t,e,n){"use strict";function r(t){return t&&"function"!=typeof t.subscribe&&"function"==typeof t.then}n.d(e,"a",(function(){return r}))},0:function(t,e,n){t.exports=n("zUnb")},"0/uQ":function(t,e,n){"use strict";var r=n("6blF"),i=n("/WYv"),o=n("2ePl"),a=n("xTla"),s=n("En8+"),u=n("IUTb"),c=n("pugT"),l=n("S5XQ"),h=n("u67D"),f=n("JcRv"),d=n("Fxb1");function p(t,e){if(!e)return t instanceof r.a?t:new r.a(Object(d.a)(t));if(null!=t){if(function(t){return t&&"function"==typeof t[a.a]}(t))return function(t,e){return new r.a(e?function(n){var r=new c.a;return r.add(e.schedule((function(){var i=t[a.a]();r.add(i.subscribe({next:function(t){r.add(e.schedule((function(){return n.next(t)})))},error:function(t){r.add(e.schedule((function(){return n.error(t)})))},complete:function(){r.add(e.schedule((function(){return n.complete()}
1)))}}))}))),r}:Object(f.a)(t))}(t,e);if(Object(i.a)(t))return function(t,e){return new r.a(e?function(n){var r=new c.a;return r.add(e.schedule((function(){return t.then((function(t){r.add(e.schedule((function(){n.next(t),r.add(e.schedule((function(){return n.complete()})))})))}),(function(t){r.add(e.schedule((function(){return n.error(t)})))}))}))),r}:Object(l.a)(t))}(t,e);if(Object(o.a)(t))return Object(u.a)(t,e);if(function(t){return t&&"function"==typeof t[s.a]}(t)||"string"==typeof t)return function(t,e){if(!t)throw new Error("Iterable cannot be null");return new r.a(e?function(n){var r,i=new c.a;return i.add((function(){r&&"function"==typeof r.return&&r.return()})),i.add(e.schedule((function(){r=t[s.a](),i.add(e.schedule((function(){if(!n.closed){var t,e;try{var i=r.next();t=i.value,e=i.done}catch(o){return void n.error(o)}e?n.complete():(n.next(t),this.schedule())}})))}))),i}:Object(h.a)(t))}(t,e)}throw new TypeError((null!==t&&typeof t||t)+" is not observable")}n.d(e,"a",(function(){return p}))},"15JJ":function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var r=n("mrSG"),i=n("MGBS"),o=n("rPjj"),a=n("zotm"),s=n("67Y/"),u=n("0/uQ");function c(t,e){return"function"==typeof e?function(n){return n.pipe(c((function(n,r){return Object(u.a)(t(n,r)).pipe(Object(s.a)((function(t,i){return e(n,t,r,i)})))})))}:function(e){return e.lift(new l(t))}}var l=function(){function t(t){this.project=t}return t.prototype.call=function(t,e){return e.subscribe(new h(t,this.project))},t}(),h=function(t){function e(e,n){var r=t.call(this,e)||this;return r.project=n,r.index=0,r}return r.d(e,t),e.prototype._next=function(t){var e,n=this.index++;try{e=this.project(t,n)}catch(r){return void this.destination.error(r)}this._innerSub(e,t,n)},e.prototype._innerSub=function(t,e,n){var r=this.innerSubscription;r&&r.unsubscribe();var i=new o.a(this,void 0,void 0);this.destination.add(i),this.innerSubscription=Object(a.a)(this,t,e,n,i)},e.prototype._complete=function(){var e=this.innerSubscription;e&&!e.closed||t.prototype._complete.call(this),this.unsubscribe()},e.prototype._unsubscribe=function(){this.innerSubscription=null},e.prototype.notifyComplete=function(e){this.destination.remove(e),this.innerSubscription=null,this.isStopped&&t.prototype._complete.call(this)},e.prototype.notifyNext=function(t,e,n,r,i){this.destination.next(e)},e}(i.a)},"26FU":function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r=n("mrSG"),i=n("K9Ia"),o=n("8g8A"),a=function(t){function e(e){var n=t.call(this)||this;return n._value=e,n}return r.d(e,t),Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0}),e.prototype._subscribe=function(e){var n=t.prototype._subscribe.call(this,e);return n&&!n.closed&&e.next(this._value),n},e.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(this.closed)throw new o.a;return this._value},e.prototype.next=function(e){t.prototype.next.call(this,this._value=e)},e}(i.a)},"2Bdj":function(t,e,n){"use strict";function r(t){return"function"==typeof t}n.d(e,"a",(function(){return r}))},"2ePl":function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(t){return t&&"number"==typeof t.length&&"function"!=typeof t}},"4ftG":function(t,e,n){var r=n("rSCU"),i=n("GMxU").f,o={}.toString,a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.f=function(t){return a&&"[object Window]"==o.call(t)?function(t){try{return i(t)}catch(e){return a.slice()}}(t):i(r(t))}},"5x/H":function(t,e,n){"use strict";n("6Joi")},"61rj":function(t,e){t.exports=function(t){try{return!!t()}catch(e){return!0}}},"67Y/":function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n("mrSG"),i=n("FFOo");function o(t,e){return function(n){if("function"!=typeof t)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return n.lift(new a(t,e))}}var a=function(){function t(t,e){this.project=t,this.thisArg=e}return t.prototype.call=function(t,e){return e.subscribe(new s(t,this.project,this.thisArg))},t}(),s=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.project=n,i.count=0,i.thisArg=r||i,i}return r.d(e,t),e.prototype._next=function(t){var e;try{e=this.project.call(this.thisArg,t,this.count++)}catch(n){return void this.destination.error(n)}this.destination.next(e)},e}(i.a)},"6CFf":function(t,e,n){var r=n("L97z");t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,i){return t.call(e,n,r,i)}}return function(){return t.apply(e,arguments)}}},"6Joi":function(t,e,n){"use strict";
1Object.defineProperty(e,"__esModule",{value:!0});var r,i=(r=n("wj3C"))&&"object"==typeof r&&"default"in r?r.default:r,o=n("q/0M"),a=n("os0x"),s=n("x7I3"),u=n("zVF4"),c=i.SDK_VERSION,l=new o.Logger("@firebase/firestore"),h=function(t){return t[t.DEBUG=0]="DEBUG",t[t.ERROR=1]="ERROR",t[t.SILENT=2]="SILENT",t}({});function f(){return l.logLevel===o.LogLevel.DEBUG?h.DEBUG:l.logLevel===o.LogLevel.SILENT?h.SILENT:h.ERROR}function d(t){switch(t){case h.DEBUG:l.logLevel=o.LogLevel.DEBUG;break;case h.ERROR:l.logLevel=o.LogLevel.ERROR;break;case h.SILENT:l.logLevel=o.LogLevel.SILENT;break;default:l.error("Firestore ("+c+"): Invalid value passed to `setLogLevel`")}}function p(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];if(l.logLevel<=o.LogLevel.DEBUG){var i=n.map(y);l.debug.apply(l,["Firestore ("+c+") ["+t+"]: "+e].concat(i))}}function m(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(l.logLevel<=o.LogLevel.ERROR){var r=e.map(y);l.error.apply(l,["Firestore ("+c+"): "+t].concat(r))}}function y(t){if("string"==typeof t)return t;var e=b.getPlatform();try{return e.formatJSON(t)}catch(n){return t}}function v(t){var e="FIRESTORE ("+c+") INTERNAL ASSERTION FAILED: "+t;throw m(e),new Error(e)}function g(t,e){t||v(e)}var b=function(){function t(){}return t.setPlatform=function(e){t.platform&&v("Platform already defined"),t.platform=e},t.getPlatform=function(){return t.platform||v("Platform not set"),t.platform},t}();function w(){return b.getPlatform().emptyByteString}var _=function(t){function e(e,n){var r=t.call(this,n)||this;return r.code=e,r.message=n,r.name="FirebaseError",r.toString=function(){return r.name+": [code="+r.code+"]: "+r.message},r}return a.__extends(e,t),e}(Error);function S(t,e){function n(){var t="This constructor is private.";throw e&&(t+=" ",t+=e),new _("invalid-argument",t)}for(var r in n.prototype=t.prototype,t)t.hasOwnProperty(r)&&(n[r]=t[r]);return n}function C(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function E(t,e){return void 0!==t?t:e}function T(t,e){for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){var r=Number(n);isNaN(r)||e(r,t[n])}}function k(t,e){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e(n,t[n])}function I(t){for(var e in g(null!=t&&"object"==typeof t,"isEmpty() expects object parameter."),t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}function O(t,e,n){if(e.length!==n)throw new _("invalid-argument","Function "+t+"() requires "+z(n,"argument")+", but was called with "+z(e.length,"argument")+".")}function x(t,e,n){if(e.length<n)throw new _("invalid-argument","Function "+t+"() requires at least "+z(n,"argument")+", but was called with "+z(e.length,"argument")+".")}function A(t,e,n,r){if(e.length<n||e.length>r)throw new _("invalid-argument","Function "+t+"() requires between "+n+" and "+r+" arguments, but was called with "+z(e.length,"argument")+".")}function P(t,e,n,r){if(!(e instanceof Array)||e.length<r)throw new _("invalid-argument","Function "+t+"() requires its "+n+" argument to be an array with at least "+z(r,"element")+".")}function D(t,e,n,r){L(t,e,W(n)+" argument",r)}function R(t,e,n,r){void 0!==r&&D(t,e,n,r)}function N(t,e,n,r){L(t,e,n+" option",r)}function j(t,e,n,r){void 0!==r&&N(t,e,n,r)}function M(t,e,n,r,i){void 0!==r&&function(t,e,n,r,i){for(var o=[],a=0,s=i;a<s.length;a++){var u=s[a];if(u===r)return;o.push(U(u))}var c=U(r);throw new _("invalid-argument","Invalid value "+c+" provided to function "+t+'() for option "'+n+'". Acceptable values: '+o.join(", "))}(t,0,n,r,i)}function L(t,e,n,r){if(!("object"===e?F(r):"non-empty string"===e?"string"==typeof r&&""!==r:typeof r===e)){var i=U(r);throw new _("invalid-argument","Function "+t+"() requires its "+n+" to be of type "+e+", but it was: "+i)}}function F(t){return"object"==typeof t&&null!==t&&(Object.getPrototypeOf(t)===Object.prototype||null===Object.getPrototypeOf(t))}function U(t){if(void 0===t)return"undefined";if(null===t)return"null";if("string"==typeof t)return t.length>20&&(t=t.substring(0,20)+"..."),JSON.stringify(t);if("number"==typeof t||"boolean"==typeof t)return""+t;if("object"==typeof t){if(t instanceof Array)return"an array";var e=function(t){if(t.constructor){var e=/function\s+([^\s(]+)\s*\(/.exec(t.constructor.toString());if(e&&e.length>1)return e[1]}return null}(t);return e?"a custom "+e+" object":"an object"}return"function"==typeof t?"a function":v("Unknown wrong type: "+typeof t)}function V(t,e,n){if(void 0===n)throw new _("invalid-argument","Function "+t+"() requires a valid "+W(e)+" argument, but it was undefined.")}function q(t,e,n){k(e,(function(e,r){if(n.indexOf(e)<0)throw new _("invalid-argument","Unknown option '"+e+"' passed to function "+t+"(). Available options: "+n.join(", "))}))}function B(t,e,n,r){var i=U(r);return new _("invalid-argument","Function "+t+"() requires its "+W(n)+" argument to be a "+e+", but it was: "+i)}function W(t){switch(t){case 1:return"first";
1case 2:return"second";case 3:return"third";default:return t+"th"}}function z(t,e){return t+" "+e+(1===t?"":"s")}var H=function(){function t(){}return t.newId=function(){for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",e="",n=0;n<20;n++)e+=t.charAt(Math.floor(Math.random()*t.length));return g(20===e.length,"Invalid auto ID: "+e),e},t}();function $(t,e){return t<e?-1:t>e?1:0}function K(t,e){if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(!t[n].isEqual(e[n]))return!1;return!0}function G(){if("undefined"==typeof Uint8Array)throw new _("unimplemented","Uint8Arrays are not available in this environment.")}function Q(){if(!b.getPlatform().base64Available)throw new _("unimplemented","Blobs are unavailable in Firestore in this environment.")}var Y=function(){function t(t){Q(),this._binaryString=t}return t.fromBase64String=function(e){O("Blob.fromBase64String",arguments,1),D("Blob.fromBase64String","string",1,e),Q();try{var n=b.getPlatform().atob(e);return new t(n)}catch(r){throw new _("invalid-argument","Failed to construct Blob from Base64 string: "+r)}},t.fromUint8Array=function(e){if(O("Blob.fromUint8Array",arguments,1),G(),!(e instanceof Uint8Array))throw B("Blob.fromUint8Array","Uint8Array",1,e);var n=Array.prototype.map.call(e,(function(t){return String.fromCharCode(t)})).join("");return new t(n)},t.prototype.toBase64=function(){return O("Blob.toBase64",arguments,0),Q(),b.getPlatform().btoa(this._binaryString)},t.prototype.toUint8Array=function(){O("Blob.toUint8Array",arguments,0),G();for(var t=new Uint8Array(this._binaryString.length),e=0;e<this._binaryString.length;e++)t[e]=this._binaryString.charCodeAt(e);return t},t.prototype.toString=function(){return"Blob(base64: "+this.toBase64()+")"},t.prototype.isEqual=function(t){return this._binaryString===t._binaryString},t.prototype._compareTo=function(t){return $(this._binaryString,t._binaryString)},t}(),X=S(Y,"Use Blob.fromUint8Array() or Blob.fromBase64String() instead."),J=function(){function t(t,e){if(O("GeoPoint",arguments,2),D("GeoPoint","number",1,t),D("GeoPoint","number",2,e),!isFinite(t)||t<-90||t>90)throw new _("invalid-argument","Latitude must be a number between -90 and 90, but was: "+t);if(!isFinite(e)||e<-180||e>180)throw new _("invalid-argument","Longitude must be a number between -180 and 180, but was: "+e);this._lat=t,this._long=e}return Object.defineProperty(t.prototype,"latitude",{get:function(){return this._lat},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"longitude",{get:function(){return this._long},enumerable:!0,configurable:!0}),t.prototype.isEqual=function(t){return this._lat===t._lat&&this._long===t._long},t.prototype._compareTo=function(t){return $(this._lat,t._lat)||$(this._long,t._long)},t}(),Z=function(){function t(t,e){if(this.seconds=t,this.nanoseconds=e,e<0)throw new _("invalid-argument","Timestamp nanoseconds out of range: "+e);if(e>=1e9)throw new _("invalid-argument","Timestamp nanoseconds out of range: "+e);if(t<-62135596800)throw new _("invalid-argument","Timestamp seconds out of range: "+t);if(t>=253402300800)throw new _("invalid-argument","Timestamp seconds out of range: "+t)}return t.now=function(){return t.fromMillis(Date.now())},t.fromDate=function(e){return t.fromMillis(e.getTime())},t.fromMillis=function(e){var n=Math.floor(e/1e3);return new t(n,1e6*(e-1e3*n))},t.prototype.toDate=function(){return new Date(this.toMillis())},t.prototype.toMillis=function(){return 1e3*this.seconds+this.nanoseconds/1e6},t.prototype._compareTo=function(t){return this.seconds===t.seconds?$(this.nanoseconds,t.nanoseconds):$(this.seconds,t.seconds)},t.prototype.isEqual=function(t){return t.seconds===this.seconds&&t.nanoseconds===this.nanoseconds},t.prototype.toString=function(){return"Timestamp(seconds="+this.seconds+", nanoseconds="+this.nanoseconds+")"},t}(),tt=function(){return function(t,e,n,r){this.databaseId=t,this.persistenceKey=e,this.host=n,this.ssl=r}}(),et=function(){function t(t,e){this.projectId=t,this.database=e||"(default)"}return Object.defineProperty(t.prototype,"isDefaultDatabase",{get:function(){return"(default)"===this.database},enumerable:!0,configurable:!0}),t.prototype.isEqual=function(e){return e instanceof t&&e.projectId===this.projectId&&e.database===this.database},t.prototype.compareTo=function(t){return $(this.projectId,t.projectId)||$(this.database,t.database)},t}(),nt=function(){function t(t,e,n){this.init(t,e,n)}return t.prototype.init=function(t,e,n){void 0===e?e=0:e>t.length&&v("offset "+e+" out of range "+t.length),void 0===n?n=t.length-e:n>t.length-e&&v("length "+n+" out of range "+(t.length-e)),this.segments=t,this.offset=e,this.len=n},t.prototype.construct=function(t,e,n){var r=Object.create(Object.getPrototypeOf(this));return r.init(t,e,n),r},Object.defineProperty(t.prototype,"length",{get:function(){return this.len},enumerable:!0,configurable:!0}),t.prototype.isEqual=function(e){return 0===t.comparator(this,e)},t.prototype.child=function(e){var n=this.segments.slice(this.offset,this.limit());return e instanceof t?e.forEach((function(t){n.push(t)})):"string"==typeof e?n.push(e):v("Unknown parameter type for Path.child(): "+e),this.construct(n)},t.prototype.limit=function(){return this.offset+this.length},t.prototype.popFirst=function(t){return g(this.length>
1=(t=void 0===t?1:t),"Can't call popFirst() with less segments"),this.construct(this.segments,this.offset+t,this.length-t)},t.prototype.popLast=function(){return g(!this.isEmpty(),"Can't call popLast() on empty path"),this.construct(this.segments,this.offset,this.length-1)},t.prototype.firstSegment=function(){return g(!this.isEmpty(),"Can't call firstSegment() on empty path"),this.segments[this.offset]},t.prototype.lastSegment=function(){return g(!this.isEmpty(),"Can't call lastSegment() on empty path"),this.segments[this.limit()-1]},t.prototype.get=function(t){return g(t<this.length,"Index out of range"),this.segments[this.offset+t]},t.prototype.isEmpty=function(){return 0===this.length},t.prototype.isPrefixOf=function(t){if(t.length<this.length)return!1;for(var e=0;e<this.length;e++)if(this.get(e)!==t.get(e))return!1;return!0},t.prototype.isImmediateParentOf=function(t){if(this.length+1!==t.length)return!1;for(var e=0;e<this.length;e++)if(this.get(e)!==t.get(e))return!1;return!0},t.prototype.forEach=function(t){for(var e=this.offset,n=this.limit();e<n;e++)t(this.segments[e])},t.prototype.toArray=function(){return this.segments.slice(this.offset,this.limit())},t.comparator=function(t,e){for(var n=Math.min(t.length,e.length),r=0;r<n;r++){var i=t.get(r),o=e.get(r);if(i<o)return-1;if(i>o)return 1}return t.length<e.length?-1:t.length>e.length?1:0},t}(),rt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e.prototype.canonicalString=function(){return this.toArray().join("/")},e.prototype.toString=function(){return this.canonicalString()},e.fromString=function(t){if(t.indexOf("//")>=0)throw new _("invalid-argument","Invalid path ("+t+"). Paths must not contain // in them.");return new e(t.split("/").filter((function(t){return t.length>0})))},e.EMPTY_PATH=new e([]),e}(nt),it=/^[_a-zA-Z][_a-zA-Z0-9]*$/,ot=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e.isValidIdentifier=function(t){return it.test(t)},e.prototype.canonicalString=function(){return this.toArray().map((function(t){return t=t.replace("\\","\\\\").replace("`","\\`"),e.isValidIdentifier(t)||(t="`"+t+"`"),t})).join(".")},e.prototype.toString=function(){return this.canonicalString()},e.prototype.isKeyField=function(){return 1===this.length&&"__name__"===this.get(0)},e.keyField=function(){return new e(["__name__"])},e.fromServerFormat=function(t){for(var n=[],r="",i=0,o=function(){if(0===r.length)throw new _("invalid-argument","Invalid field path ("+t+"). Paths must not be empty, begin with '.', end with '.', or contain '..'");n.push(r),r=""},a=!1;i<t.length;){var s=t[i];if("\\"===s){if(i+1===t.length)throw new _("invalid-argument","Path has trailing escape character: "+t);var u=t[i+1];if("\\"!==u&&"."!==u&&"`"!==u)throw new _("invalid-argument","Path has invalid escape sequence: "+t);r+=u,i+=2}else"`"===s?(a=!a,i++):"."!==s||a?(r+=s,i++):(o(),i++)}if(o(),a)throw new _("invalid-argument","Unterminated ` in path: "+t);return new e(n)},e.EMPTY_PATH=new e([]),e}(nt),at=function(){function t(e){this.path=e,g(t.isDocumentKey(e),"Invalid DocumentKey with an odd number of segments: "+e.toArray().join("/"))}return t.prototype.isEqual=function(t){return null!==t&&0===rt.comparator(this.path,t.path)},t.prototype.toString=function(){return this.path.toString()},t.comparator=function(t,e){return rt.comparator(t.path,e.path)},t.isDocumentKey=function(t){return t.length%2==0},t.fromSegments=function(e){return new t(new rt(e.slice()))},t.fromPathString=function(e){return new t(rt.fromString(e))},t.EMPTY=new t(new rt([])),t}(),st=function(){function t(t,e){this.key=t,this.version=e}return t.compareByKey=function(t,e){return at.comparator(t.key,e.key)},t}(),ut=function(t){function e(e,n,r,i,o){var a=t.call(this,e,n)||this;return a.data=r,a.proto=o,a.hasLocalMutations=!!i.hasLocalMutations,a.hasCommittedMutations=!!i.hasCommittedMutations,a}return a.__extends(e,t),e.prototype.field=function(t){return this.data.field(t)},e.prototype.fieldValue=function(t){var e=this.field(t);return e?e.value():void 0},e.prototype.value=function(){return this.data.value()},e.prototype.isEqual=function(t){return t instanceof e&&this.key.isEqual(t.key)&&this.version.isEqual(t.version)&&this.data.isEqual(t.data)&&this.hasLocalMutations===t.hasLocalMutations&&this.hasCommittedMutations===t.hasCommittedMutations},e.prototype.toString=function(){return"Document("+this.key+", "+this.version+", "+this.data.toString()+", {hasLocalMutations: "+this.hasLocalMutations+"}), {hasCommittedMutations: "+this.hasCommittedMutations+"})"},Object.defineProperty(e.prototype,"hasPendingWrites",{get:function(){return this.hasLocalMutations||this.hasCommittedMutations},enumerable:!0,configurable:!0}),e.compareByField=function(t,e,n){var r=e.field(t),i=n.field(t);return void 0!==r&&void 0!==i?r.compareTo(i):v("Trying to compare documents on fields that don't exist")},e}
1(st),ct=function(t){function e(e,n,r){var i=t.call(this,e,n)||this;return i.hasCommittedMutations=!(!r||!r.hasCommittedMutations),i}return a.__extends(e,t),e.prototype.toString=function(){return"NoDocument("+this.key+", "+this.version+")"},Object.defineProperty(e.prototype,"hasPendingWrites",{get:function(){return this.hasCommittedMutations},enumerable:!0,configurable:!0}),e.prototype.isEqual=function(t){return t instanceof e&&t.hasCommittedMutations===this.hasCommittedMutations&&t.version.isEqual(this.version)&&t.key.isEqual(this.key)},e}(st),lt=function(t){function e(e,n){return t.call(this,e,n)||this}return a.__extends(e,t),e.prototype.toString=function(){return"UnknownDocument("+this.key+", "+this.version+")"},Object.defineProperty(e.prototype,"hasPendingWrites",{get:function(){return!0},enumerable:!0,configurable:!0}),e.prototype.isEqual=function(t){return t instanceof e&&t.version.isEqual(this.version)&&t.key.isEqual(this.key)},e}(st),ht=function(){function t(t,e){this.comparator=t,this.root=e||dt.EMPTY}return t.prototype.insert=function(e,n){return new t(this.comparator,this.root.insert(e,n,this.comparator).copy(null,null,dt.BLACK,null,null))},t.prototype.remove=function(e){return new t(this.comparator,this.root.remove(e,this.comparator).copy(null,null,dt.BLACK,null,null))},t.prototype.get=function(t){for(var e=this.root;!e.isEmpty();){var n=this.comparator(t,e.key);if(0===n)return e.value;n<0?e=e.left:n>0&&(e=e.right)}return null},t.prototype.indexOf=function(t){for(var e=0,n=this.root;!n.isEmpty();){var r=this.comparator(t,n.key);if(0===r)return e+n.left.size;r<0?n=n.left:(e+=n.left.size+1,n=n.right)}return-1},t.prototype.isEmpty=function(){return this.root.isEmpty()},Object.defineProperty(t.prototype,"size",{get:function(){return this.root.size},enumerable:!0,configurable:!0}),t.prototype.minKey=function(){return this.root.minKey()},t.prototype.maxKey=function(){return this.root.maxKey()},t.prototype.inorderTraversal=function(t){return this.root.inorderTraversal(t)},t.prototype.forEach=function(t){this.inorderTraversal((function(e,n){return t(e,n),!1}))},t.prototype.reverseTraversal=function(t){return this.root.reverseTraversal(t)},t.prototype.getIterator=function(){return new ft(this.root,null,this.comparator,!1)},t.prototype.getIteratorFrom=function(t){return new ft(this.root,t,this.comparator,!1)},t.prototype.getReverseIterator=function(){return new ft(this.root,null,this.comparator,!0)},t.prototype.getReverseIteratorFrom=function(t){return new ft(this.root,t,this.comparator,!0)},t}(),ft=function(){function t(t,e,n,r){this.isReverse=r,this.nodeStack=[];for(var i=1;!t.isEmpty();)if(i=e?n(t.key,e):1,r&&(i*=-1),i<0)t=this.isReverse?t.left:t.right;else{if(0===i){this.nodeStack.push(t);break}this.nodeStack.push(t),t=this.isReverse?t.right:t.left}}return t.prototype.getNext=function(){g(this.nodeStack.length>0,"getNext() called on iterator when hasNext() is false.");var t=this.nodeStack.pop(),e={key:t.key,value:t.value};if(this.isReverse)for(t=t.left;!t.isEmpty();)this.nodeStack.push(t),t=t.right;else for(t=t.right;!t.isEmpty();)this.nodeStack.push(t),t=t.left;return e},t.prototype.hasNext=function(){return this.nodeStack.length>0},t.prototype.peek=function(){if(0===this.nodeStack.length)return null;var t=this.nodeStack[this.nodeStack.length-1];return{key:t.key,value:t.value}},t}(),dt=function(){function t(e,n,r,i,o){this.key=e,this.value=n,this.color=null!=r?r:t.RED,this.left=null!=i?i:t.EMPTY,this.right=null!=o?o:t.EMPTY,this.size=this.left.size+1+this.right.size}return t.prototype.copy=function(e,n,r,i,o){return new t(null!=e?e:this.key,null!=n?n:this.value,null!=r?r:this.color,null!=i?i:this.left,null!=o?o:this.right)},t.prototype.isEmpty=function(){return!1},t.prototype.inorderTraversal=function(t){return this.left.inorderTraversal(t)||t(this.key,this.value)||this.right.inorderTraversal(t)},t.prototype.reverseTraversal=function(t){return this.right.reverseTraversal(t)||t(this.key,this.value)||this.left.reverseTraversal(t)},t.prototype.min=function(){return this.left.isEmpty()?this:this.left.min()},t.prototype.minKey=function(){return this.min().key},t.prototype.maxKey=function(){return this.right.isEmpty()?this.key:this.right.maxKey()},t.prototype.insert=function(t,e,n){var r=this,i=n(t,r.key);return(r=i<0?r.copy(null,null,null,r.left.insert(t,e,n),null):0===i?r.copy(null,e,null,null,null):r.copy(null,null,null,null,r.right.insert(t,e,n))).fixUp()},t.prototype.removeMin=function(){if(this.left.isEmpty())return t.EMPTY;var e=this;return e.left.isRed()||e.left.left.isRed()||(e=e.moveRedLeft()),(e=e.copy(null,null,null,e.left.removeMin(),null)).fixUp()},t.prototype.remove=function(e,n){var r,i=this;if(n(e,i.key)<0)i.left.isEmpty()||i.left.isRed()||i.left.left.isRed()||(i=i.moveRedLeft()),i=i.copy(null,null,null,i.left.remove(e,n),null);else{if(i.left.isRed()&&(i=i.rotateRight()),i.right.isEmpty()||i.right.isRed()||i.right.left.isRed()||(i=i.moveRedRight()),0===n(e,i.key)){if(i.right.isEmpty())return t.EMPTY;r=i.right.min(),i=i.copy(r.key,r.value,null,null,i.right.removeMin())}i=i.copy(null,null,null,null,i.right.remove(e,n))}return i.fixUp()},t.prototype.isRed=function(){return this.color},t.prototype.fixUp=function(){var t=this;return t.right.isRed()&&!t.left.isRed()&&(t=t.rotateLeft()),t.left.isRed()&&t.left.left.isRed()&&(t=t.rotateRight()),t.left.isRed()&&t.right.isRed()&&(t=t.colorFlip()),t},t.prototype.moveRedLeft=function(){var t=this.colorFlip();return t.right.left.isRed()&&(t=(t=(t=t.copy(null,null,null,null,t.right.rotateRight())).rotateLeft()).colorFlip()),t},t.prototype.moveRedRight=function(){var t=this.colorFlip();return t.left.left.isRed()&&(t=(t=t.rotateRight()).colorFlip()),t},t.prototype.rotateLeft=function(){var e=this.copy(null,null,t.RED,null,this.right.left);return this.right.copy(null,null,this.color,e,null)},t.prototype.rotateRight=function(){var e=this.copy(null,null,t.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,e)},t.prototype.colorFlip=function(){var t=this.left.copy(null,null,!this.left.color,null,null),e=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,t,e)},t.prototype.checkMaxDepth=function(){var t=this.check();return Math.pow(2,t)<=this.size+1},t.prototype.check=function(){if(this.isRed()&&this.left.isRed())throw v("Red node has red child("+this.key+","+this.value+")");if(this.right.isRed())throw v("Right child of ("+this.key+","+this.value+") is red");var t=this.left.check();if(t!==this.right.check())throw v("Black depths differ");return t+(this.isRed()?0:1)},t.EMPTY=null,t.RED=!0,t.BLACK=!1,t}(),pt=function(){function t(){this.size=0}return t.prototype.copy=function(t,e,n,r,i){return this},t.prototype.insert=function(t,e,n){return new dt(t,e)},t.prototype.remove=function(t,e){return this},t.prototype.isEmpty=function(){return!0},t.prototype.inorderTraversal=function(t){return!1},t.prototype.reverseTraversal=function(t){return!1},t.prototype.minKey=function(){return null},t.prototype.maxKey=function(){return null},t.prototype.isRed=function(){return!1},t.prototype.checkMaxDepth=function(){return!0},t.prototype.check=function(){return 0},t}();
1dt.EMPTY=new pt;var mt=function(t){return t[t.NullValue=0]="NullValue",t[t.BooleanValue=1]="BooleanValue",t[t.NumberValue=2]="NumberValue",t[t.TimestampValue=3]="TimestampValue",t[t.StringValue=4]="StringValue",t[t.BlobValue=5]="BlobValue",t[t.RefValue=6]="RefValue",t[t.GeoPointValue=7]="GeoPointValue",t[t.ArrayValue=8]="ArrayValue",t[t.ObjectValue=9]="ObjectValue",t}({}),yt=function(t){return t[t.Default=0]="Default",t[t.Estimate=1]="Estimate",t[t.Previous=2]="Previous",t}({}),vt=function(){function t(t,e){this.serverTimestampBehavior=t,this.timestampsInSnapshots=e}return t.fromSnapshotOptions=function(e,n){switch(e.serverTimestamps){case"estimate":return new t(yt.Estimate,n);case"previous":return new t(yt.Previous,n);case"none":case void 0:return new t(yt.Default,n);default:return v("fromSnapshotOptions() called with invalid options.")}},t}(),gt=function(){function t(){}return t.prototype.toString=function(){var t=this.value();return null===t?"null":t.toString()},t.prototype.defaultCompareTo=function(t){return g(this.typeOrder!==t.typeOrder,"Default compareTo should not be used for values of same type."),$(this.typeOrder,t.typeOrder)},t}(),bt=function(t){function e(){var e=t.call(this)||this;return e.typeOrder=mt.NullValue,e.internalValue=null,e}return a.__extends(e,t),e.prototype.value=function(t){return null},e.prototype.isEqual=function(t){return t instanceof e},e.prototype.compareTo=function(t){return t instanceof e?0:this.defaultCompareTo(t)},e.INSTANCE=new e,e}(gt),wt=function(t){function e(e){var n=t.call(this)||this;return n.internalValue=e,n.typeOrder=mt.BooleanValue,n}return a.__extends(e,t),e.prototype.value=function(t){return this.internalValue},e.prototype.isEqual=function(t){return t instanceof e&&this.internalValue===t.internalValue},e.prototype.compareTo=function(t){return t instanceof e?$(this,t):this.defaultCompareTo(t)},e.of=function(t){return t?e.TRUE:e.FALSE},e.TRUE=new e(!0),e.FALSE=new e(!1),e}(gt),_t=function(t){function e(e){var n=t.call(this)||this;return n.internalValue=e,n.typeOrder=mt.NumberValue,n}return a.__extends(e,t),e.prototype.value=function(t){return this.internalValue},e.prototype.compareTo=function(t){return t instanceof e?(n=this.internalValue)<(r=t.internalValue)?-1:n>r?1:n===r?0:isNaN(n)?isNaN(r)?0:-1:1:this.defaultCompareTo(t);var n,r},e}(gt);function St(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e}var Ct=function(t){function e(e){return t.call(this,e)||this}return a.__extends(e,t),e.prototype.isEqual=function(t){return t instanceof e&&St(this.internalValue,t.internalValue)},e}(_t),Et=function(t){function e(e){var n=t.call(this,e)||this;return n.internalValue=e,n}return a.__extends(e,t),e.prototype.isEqual=function(t){return t instanceof e&&St(this.internalValue,t.internalValue)},e.NAN=new e(NaN),e.POSITIVE_INFINITY=new e(1/0),e.NEGATIVE_INFINITY=new e(-1/0),e}(_t),Tt=function(t){function e(e){var n=t.call(this)||this;return n.internalValue=e,n.typeOrder=mt.StringValue,n}return a.__extends(e,t),e.prototype.value=function(t){return this.internalValue},e.prototype.isEqual=function(t){return t instanceof e&&this.internalValue===t.internalValue},e.prototype.compareTo=function(t){return t instanceof e?$(this.internalValue,t.internalValue):this.defaultCompareTo(t)},e}(gt),kt=function(t){function e(e){var n=t.call(this)||this;return n.internalValue=e,n.typeOrder=mt.TimestampValue,n}return a.__extends(e,t),e.prototype.value=function(t){return!t||t.timestampsInSnapshots?this.internalValue:this.internalValue.toDate()},e.prototype.isEqual=function(t){return t instanceof e&&this.internalValue.isEqual(t.internalValue)},e.prototype.compareTo=function(t){return t instanceof e?this.internalValue._compareTo(t.internalValue):t instanceof It?-1:this.defaultCompareTo(t)},e}(gt),It=function(t){function e(e,n){var r=t.call(this)||this;return r.localWriteTime=e,r.previousValue=n,r.typeOrder=mt.TimestampValue,r}return a.__extends(e,t),e.prototype.value=function(t){return t&&t.serverTimestampBehavior===yt.Estimate?new kt(this.localWriteTime).value(t):t&&t.serverTimestampBehavior===yt.Previous&&this.previousValue?this.previousValue.value(t):null},e.prototype.isEqual=function(t){return t instanceof e&&this.localWriteTime.isEqual(t.localWriteTime)},e.prototype.compareTo=function(t){return t instanceof e?this.localWriteTime._compareTo(t.localWriteTime):t instanceof kt?1:this.defaultCompareTo(t)},e.prototype.toString=function(){return"<ServerTimestamp localTime="+this.localWriteTime.toString()+">"},e}(gt),Ot=function(t){function e(e){var n=t.call(this)||this;return n.internalValue=e,n.typeOrder=mt.BlobValue,n}return a.__extends(e,t),e.prototype.value=function(t){return this.internalValue},e.prototype.isEqual=function(t){return t instanceof e&&this.internalValue.isEqual(t.internalValue)},e.prototype.compareTo=function(t){return t instanceof e?this.internalValue._compareTo(t.internalValue):this.defaultCompareTo(t)},e}(gt),xt=function(t){function e(e,n){var r=t.call(this)||this;return r.databaseId=e,r.key=n,r.typeOrder=mt.RefValue,r}return a.__extends(e,t),e.prototype.value=function(t){return this.key},e.prototype.isEqual=function(t){return t instanceof e&&this.key.isEqual(t.key)&&this.databaseId.isEqual(t.databaseId)},e.prototype.compareTo=function(t){if(t instanceof e){var n=this.databaseId.compareTo(t.databaseId);return 0!==n?n:at.comparator(this.key,t.key)}return this.defaultCompareTo(t)},e}(gt),At=function(t){function e(e){var n=t.call(this)||this;return n.internalValue=e,n.typeOrder=mt.GeoPointValue,n}return a.__extends(e,t),e.prototype.value=function(t){return this.internalValue},e.prototype.isEqual=function(t){return t instanceof e&&this.internalValue.isEqual(t.internalValue)},e.prototype.compareTo=function(t){return t instanceof e?this.internalValue._compareTo(t.internalValue):this.defaultCompareTo(t)},e}(gt),Pt=function(t){function e(e){var n=t.call(this)||this;return n.internalValue=e,n.typeOrder=mt.ObjectValue,n}return a.__extends(e,t),e.prototype.value=function(t){var e={};return this.internalValue.inorderTraversal((function(n,r){e[n]=r.value(t)})),e},e.prototype.forEach=function(t){this.internalValue.inorderTraversal(t)},e.prototype.isEqual=function(t){if(t instanceof e){for(var n=this.internalValue.getIterator(),r=t.internalValue.getIterator();n.hasNext()&&r.hasNext();){var i=n.getNext(),o=r.getNext();if(i.key!==o.key||!i.value.isEqual(o.value))return!1}return!n.hasNext()&&!r.hasNext()}return!1},e.prototype.compareTo=function(t){if(t instanceof e){for(var n=this.internalValue.getIterator(),r=t.internalValue.getIterator();n.hasNext()&&r.hasNext();){var i=n.getNext(),o=r.getNext(),a=$(i.key,o.key)||i.value.compareTo(o.value);if(a)return a}return $(n.hasNext(),r.hasNext())}return this.defaultCompareTo(t)},e.prototype.set=function(t,n){if(g(!t.isEmpty(),"Cannot set field for empty path on ObjectValue"),1===t.length)return this.setChild(t.firstSegment(),n);var r=this.child(t.firstSegment());r instanceof e||(r=e.EMPTY);var i=r.set(t.popFirst(),n);return this.setChild(t.firstSegment(),i)},e.prototype.delete=function(t){if(g(!t.isEmpty(),"Cannot delete field for empty path on ObjectValue"),1===t.length)return new e(this.internalValue.remove(t.firstSegment()));var n=this.child(t.firstSegment());if(n instanceof e){var r=n.delete(t.popFirst());return new e(this.internalValue.insert(t.firstSegment(),r))}return this},e.prototype.contains=function(t){return void 0!==this.field(t)},e.prototype.field=function(t){g(!t.isEmpty(),"Can't get field of empty path");var n=this;return t.forEach((function(t){n=n instanceof e&&n.internalValue.get(t)||void 0})),n},e.prototype.toString=function(){return JSON.stringify(this.value())},e.prototype.child=function(t){return this.internalValue.get(t)||void 0},e.prototype.setChild=function(t,n){return new e(this.internalValue.insert(t,n))}
1,e.EMPTY=new e(new ht($)),e}(gt),Dt=function(t){function e(e){var n=t.call(this)||this;return n.internalValue=e,n.typeOrder=mt.ArrayValue,n}return a.__extends(e,t),e.prototype.value=function(t){return this.internalValue.map((function(e){return e.value(t)}))},e.prototype.forEach=function(t){this.internalValue.forEach(t)},e.prototype.isEqual=function(t){if(t instanceof e){if(this.internalValue.length!==t.internalValue.length)return!1;for(var n=0;n<this.internalValue.length;n++)if(!this.internalValue[n].isEqual(t.internalValue[n]))return!1;return!0}return!1},e.prototype.compareTo=function(t){if(t instanceof e){for(var n=Math.min(this.internalValue.length,t.internalValue.length),r=0;r<n;r++){var i=this.internalValue[r].compareTo(t.internalValue[r]);if(i)return i}return $(this.internalValue.length,t.internalValue.length)}return this.defaultCompareTo(t)},e.prototype.toString=function(){return JSON.stringify(this.value())},e}(gt),Rt=Number,Nt=Rt.MIN_SAFE_INTEGER||-(Math.pow(2,53)-1),jt=Rt.MAX_SAFE_INTEGER||Math.pow(2,53)-1,Mt=Rt.isInteger||function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t};function Lt(t){return null==t}function Ft(t){return Mt(t)&&t<=jt&&t>=Nt}var Ut=function(){function t(t,e,n,r,i,o){void 0===e&&(e=[]),void 0===n&&(n=[]),void 0===r&&(r=null),void 0===i&&(i=null),void 0===o&&(o=null),this.path=t,this.explicitOrderBy=e,this.filters=n,this.limit=r,this.startAt=i,this.endAt=o,this.memoizedCanonicalId=null,this.memoizedOrderBy=null,this.startAt&&this.assertValidBound(this.startAt),this.endAt&&this.assertValidBound(this.endAt)}return t.atPath=function(e){return new t(e)},Object.defineProperty(t.prototype,"orderBy",{get:function(){if(null===this.memoizedOrderBy){var t=this.getInequalityFilterField(),e=this.getFirstOrderByField();if(null!==t&&null===e)this.memoizedOrderBy=t.isKeyField()?[Gt]:[new Kt(t),Gt];else{g(null===t||null!==e&&t.isEqual(e),"First orderBy should match inequality field."),this.memoizedOrderBy=[];for(var n=!1,r=0,i=this.explicitOrderBy;r<i.length;r++){var o=i[r];this.memoizedOrderBy.push(o),o.field.isKeyField()&&(n=!0)}n||this.memoizedOrderBy.push((this.explicitOrderBy.length>0?this.explicitOrderBy[this.explicitOrderBy.length-1].dir:Ht.ASCENDING)===Ht.ASCENDING?Gt:Qt)}}return this.memoizedOrderBy},enumerable:!0,configurable:!0}),t.prototype.addFilter=function(e){g(null==this.getInequalityFilterField()||!(e instanceof Bt)||!e.isInequality()||e.field.isEqual(this.getInequalityFilterField()),"Query must only have one inequality field."),g(!at.isDocumentKey(this.path),"No filtering allowed for document query");var n=this.filters.concat([e]);return new t(this.path,this.explicitOrderBy.slice(),n,this.limit,this.startAt,this.endAt)},t.prototype.addOrderBy=function(e){g(!at.isDocumentKey(this.path),"No ordering allowed for document query"),g(!this.startAt&&!this.endAt,"Bounds must be set after orderBy");var n=this.explicitOrderBy.concat([e]);return new t(this.path,n,this.filters.slice(),this.limit,this.startAt,this.endAt)},t.prototype.withLimit=function(e){return new t(this.path,this.explicitOrderBy.slice(),this.filters.slice(),e,this.startAt,this.endAt)},t.prototype.withStartAt=function(e){return new t(this.path,this.explicitOrderBy.slice(),this.filters.slice(),this.limit,e,this.endAt)},t.prototype.withEndAt=function(e){return new t(this.path,this.explicitOrderBy.slice(),this.filters.slice(),this.limit,this.startAt,e)},t.prototype.canonicalId=function(){if(null===this.memoizedCanonicalId){var t=this.path.canonicalString();t+="|f:";for(var e=0,n=this.filters;e<n.length;e++)t+=n[e].canonicalId(),t+=",";t+="|ob:";for(var r=0,i=this.orderBy;r<i.length;r++)t+=i[r].canonicalId(),t+=",";Lt(this.limit)||(t+="|l:",t+=this.limit),this.startAt&&(t+="|lb:",t+=this.startAt.canonicalId()),this.endAt&&(t+="|ub:",t+=this.endAt.canonicalId()),this.memoizedCanonicalId=t}return this.memoizedCanonicalId},t.prototype.toString=function(){var t="Query("+this.path.canonicalString();return this.filters.length>0&&(t+=", filters: ["+this.filters.join(", ")+"]"),Lt(this.limit)||(t+=", limit: "+this.limit),this.explicitOrderBy.length>0&&(t+=", orderBy: ["+this.explicitOrderBy.join(", ")+"]"),this.startAt&&(t+=", startAt: "+this.startAt.canonicalId()),this.endAt&&(t+=", endAt: "+this.endAt.canonicalId()),t+")"},t.prototype.isEqual=function(t){if(this.limit!==t.limit)return!1;if(this.orderBy.length!==t.orderBy.length)return!1;for(var e=0;e<this.orderBy.length;e++)if(!this.orderBy[e].isEqual(t.orderBy[e]))return!1;if(this.filters.length!==t.filters.length)return!1;for(e=0;e<this.filters.length;e++)if(!this.filters[e].isEqual(t.filters[e]))return!1;return!!this.path.isEqual(t.path)&&!!(null!==this.startAt?this.startAt.isEqual(t.startAt):null===t.startAt)&&(null!==this.endAt?this.endAt.isEqual(t.endAt):null===t.endAt)},t.prototype.docComparator=function(t,e){for(var n=!1,r=0,i=this.orderBy;r<i.length;r++){var o=i[r],a=o.compare(t,e);if(0!==a)return a;n=n||o.field.isKeyField()}return g(n,"orderBy used that doesn't compare on key field"),0},t.prototype.matches=function(t){return this.matchesAncestor(t)&&this.matchesOrderBy(t)&&this.matchesFilters(t)&&this.matchesBounds(t)},t.prototype.hasLimit=function(){return!Lt(this.limit)},t.prototype.getFirstOrderByField=function(){return this.explicitOrderBy.length>0?this.explicitOrderBy[0].field:null},t.prototype.getInequalityFilterField=function(){for(var t=0,e=this.filters;t<e.length;t++){var n=e[t];if(n instanceof Bt&&n.isInequality())return n.field}return null},t.prototype.hasArrayContainsFilter=function(){return void 0!==this.filters.find((function(t){return t instanceof Bt&&t.op===qt.ARRAY_CONTAINS}))},t.prototype.isDocumentQuery=function(){return at.isDocumentKey(this.path)&&0===this.filters.length},t.prototype.matchesAncestor=function(t){var e=t.key.path;return at.isDocumentKey(this.path)?this.path.isEqual(e):this.path.isPrefixOf(e)&&this.path.length===e.length-1},t.prototype.matchesOrderBy=function(t){for(var e=0,n=this.explicitOrderBy;e<n.length;e++){var r=n[e];if(!r.field.isKeyField()&&void 0===t.field(r.field))return!1}return!0},t.prototype.matchesFilters=function(t){for(var e=0,n=this.filters;e<n.length;e++)if(!n[e].matches(t))return!1;return!0},t.prototype.matchesBounds=function(t){return!(this.startAt&&!this.startAt.sortsBeforeDocument(this.orderBy,t)||this.endAt&&this.endAt.sortsBeforeDocument(this.orderBy,t))},t.prototype.assertValidBound=function(t){g(t.position.length<=this.orderBy.length,"Bound is longer than orderBy")},t}(),Vt=function(){function t(){}return t.create=function(t,e,n){if(n.isEqual(bt.INSTANCE)){if(e!==qt.EQUAL)throw new _("invalid-argument","Invalid query. You can only perform equals comparisons on null.");return new Wt(t)}if(n.isEqual(Et.NAN)){if(e!==qt.EQUAL)throw new _("invalid-argument","Invalid query. You can only perform equals comparisons on NaN.");return new zt(t)}return new Bt(t,e,n)},t}(),qt=function(){function t(t){this.name=t}return t.fromString=function(e){switch(e){case"<":return t.LESS_THAN;case"<=":return t.LESS_THAN_OR_EQUAL;case"==":return t.EQUAL;case">=":return t.GREATER_THAN_OR_EQUAL;case">":return t.GREATER_THAN;case"array-contains":return t.ARRAY_CONTAINS;default:return v("Unknown relation: "+e)}},t.prototype.toString=function(){return this.name},t.prototype.isEqual=function(t){return this.name===t.name},t.LESS_THAN=new t("<"),t.LESS_THAN_OR_EQUAL=new t("<="),t.EQUAL=new t("=="),t.GREATER_THAN=new t(">"),t.GREATER_THAN_OR_EQUAL=new t(">="),t.ARRAY_CONTAINS=new t("array-contains"),t}(),Bt=function(t){function e(e,n,r){var i=t.call(this)||this;return i.field=e,i.op=n,i.value=r,i}return a.__extends(e,t),e.prototype.matches=function(t){if(this.field.isKeyField()){g(this.value instanceof xt,"Comparing on key, but filter value not a RefValue"),g(this.op!==qt.ARRAY_CONTAINS,"array-contains queries don't make sense on document keys.");var e=at.comparator(t.key,this.value.key);return this.matchesComparison(e)}var n=t.field(this.field);return void 0!==n&&this.matchesValue(n)},e.prototype.matchesValue=function(t){var e=this;return this.op===qt.ARRAY_CONTAINS?t instanceof Dt&&void 0!==t.internalValue.find((function(t){return t.isEqual(e.value)})):this.value.typeOrder===t.typeOrder&&this.matchesComparison(t.compareTo(this.value))},e.prototype.matchesComparison=function(t){switch(this.op){case qt.LESS_THAN:return t<0;case qt.LESS_THAN_OR_EQUAL:return t<=0;case qt.EQUAL:return 0===t;case qt.GREATER_THAN:return t>0;case qt.GREATER_THAN_OR_EQUAL:return t>=0;default:return v("Unknown relation op"+this.op)}},e.prototype.isInequality=function(){return this.op!==qt.EQUAL&&this.op!==qt.ARRAY_CONTAINS},e.prototype.canonicalId=function(){return this.field.canonicalString()+this.op.toString()+this.value.toString()},e.prototype.isEqual=function(t){return t instanceof e&&this.op.isEqual(t.op)&&this.field.isEqual(t.field)&&this.value.isEqual(t.value)},e.prototype.toString=function(){return this.field.canonicalString()+" "+this.op+" "+this.value.value()},e}(Vt),Wt=function(t){function e(e){var n=t.call(this)||this;return n.field=e,n}return a.__extends(e,t),e.prototype.matches=function(t){var e=t.field(this.field);return void 0!==e&&null===e.value()},e.prototype.canonicalId=function(){return this.field.canonicalString()+" IS null"},e.prototype.toString=function(){return this.field.canonicalString()+" IS null"},e.prototype.isEqual=function(t){return t instanceof e&&this.field.isEqual(t.field)},e}(Vt),zt=function(t){function e(e){var n=t.call(this)||this;return n.field=e,n}return a.__extends(e,t),e.prototype.matches=function(t){var e=t.field(this.field),n=e&&e.value();return"number"==typeof n&&isNaN(n)},e.prototype.canonicalId=function(){return this.field.canonicalString()+" IS NaN"},e.prototype.toString=function(){return this.field.canonicalString()+" IS NaN"},e.prototype.isEqual=function(t){return t instanceof e&&this.field.isEqual(t.field)},e}(Vt),Ht=function(){function t(t){this.name=t}return t.prototype.toString=function(){return this.name},t.ASCENDING=new t("asc"),t.DESCENDING=new t("desc"),t}(),$t=function(){function t(t,e){this.position=t,this.before=e}return t.prototype.canonicalId=function(){for(var t=this.before?"b:":"a:",e=0,n=this.position;e<n.length;e++)t+=n[e].toString();return t},t.prototype.sortsBeforeDocument=function(t,e){g(this.position.length<=t.length,"Bound has more components than query's orderBy");for(var n=0,r=0;r<this.position.length;r++){var i=t[r],o=this.position[r];
1if(i.field.isKeyField())g(o instanceof xt,"Bound has a non-key value where the key path is being used."),n=at.comparator(o.key,e.key);else{var a=e.field(i.field);g(void 0!==a,"Field should exist since document matched the orderBy already."),n=o.compareTo(a)}if(i.dir===Ht.DESCENDING&&(n*=-1),0!==n)break}return this.before?n<=0:n<0},t.prototype.isEqual=function(t){if(null===t)return!1;if(this.before!==t.before||this.position.length!==t.position.length)return!1;for(var e=0;e<this.position.length;e++)return this.position[e].isEqual(t.position[e]);return!0},t}(),Kt=function(){function t(t,e){this.field=t,void 0===e&&(e=Ht.ASCENDING),this.dir=e,this.isKeyOrderBy=t.isKeyField()}return t.prototype.compare=function(t,e){var n=this.isKeyOrderBy?ut.compareByKey(t,e):ut.compareByField(this.field,t,e);switch(this.dir){case Ht.ASCENDING:return n;case Ht.DESCENDING:return-1*n;default:return v("Unknown direction: "+this.dir)}},t.prototype.canonicalId=function(){return this.field.canonicalString()+this.dir.toString()},t.prototype.toString=function(){return this.field.canonicalString()+" ("+this.dir+")"},t.prototype.isEqual=function(t){return this.dir===t.dir&&this.field.isEqual(t.field)},t}(),Gt=new Kt(ot.keyField(),Ht.ASCENDING),Qt=new Kt(ot.keyField(),Ht.DESCENDING),Yt=function(){function t(t){this.timestamp=t}return t.fromMicroseconds=function(e){var n=Math.floor(e/1e6);return new t(new Z(n,e%1e6*1e3))},t.fromTimestamp=function(e){return new t(e)},t.forDeletedDoc=function(){return t.MIN},t.prototype.compareTo=function(t){return this.timestamp._compareTo(t.timestamp)},t.prototype.isEqual=function(t){return this.timestamp.isEqual(t.timestamp)},t.prototype.toMicroseconds=function(){return 1e6*this.timestamp.seconds+this.timestamp.nanoseconds/1e3},t.prototype.toString=function(){return"SnapshotVersion("+this.timestamp.toString()+")"},t.prototype.toTimestamp=function(){return this.timestamp},t.MIN=new t(new Z(0,0)),t}(),Xt=function(t){return t[t.Listen=0]="Listen",t[t.ExistenceFilterMismatch=1]="ExistenceFilterMismatch",t[t.LimboResolution=2]="LimboResolution",t}({}),Jt=function(){function t(t,e,n,r,i,o){void 0===i&&(i=Yt.MIN),void 0===o&&(o=w()),this.query=t,this.targetId=e,this.purpose=n,this.sequenceNumber=r,this.snapshotVersion=i,this.resumeToken=o}return t.prototype.copy=function(e){return new t(this.query,this.targetId,this.purpose,void 0===e.sequenceNumber?this.sequenceNumber:e.sequenceNumber,void 0===e.snapshotVersion?this.snapshotVersion:e.snapshotVersion,void 0===e.resumeToken?this.resumeToken:e.resumeToken)},t.prototype.isEqual=function(t){return this.targetId===t.targetId&&this.purpose===t.purpose&&this.sequenceNumber===t.sequenceNumber&&this.snapshotVersion.isEqual(t.snapshotVersion)&&this.resumeToken===t.resumeToken&&this.query.isEqual(t.query)},t}(),Zt=function(){function t(t){this.comparator=t,this.data=new ht(this.comparator)}return t.fromMapKeys=function(e){var n=new t(e.comparator);return e.forEach((function(t){n=n.add(t)})),n},t.prototype.has=function(t){return null!==this.data.get(t)},t.prototype.first=function(){return this.data.minKey()},t.prototype.last=function(){return this.data.maxKey()},Object.defineProperty(t.prototype,"size",{get:function(){return this.data.size},enumerable:!0,configurable:!0}),t.prototype.indexOf=function(t){return this.data.indexOf(t)},t.prototype.forEach=function(t){this.data.inorderTraversal((function(e,n){return t(e),!1}))},t.prototype.forEachInRange=function(t,e){for(var n=this.data.getIteratorFrom(t[0]);n.hasNext();){var r=n.getNext();if(this.comparator(r.key,t[1])>=0)return;e(r.key)}},t.prototype.forEachWhile=function(t,e){var n;for(n=void 0!==e?this.data.getIteratorFrom(e):this.data.getIterator();n.hasNext();)if(!t(n.getNext().key))return},t.prototype.firstAfterOrEqual=function(t){var e=this.data.getIteratorFrom(t);return e.hasNext()?e.getNext().key:null},t.prototype.getIterator=function(){return new te(this.data.getIterator())},t.prototype.getIteratorFrom=function(t){return new te(this.data.getIteratorFrom(t))},t.prototype.add=function(t){return this.copy(this.data.remove(t).insert(t,!0))},t.prototype.delete=function(t){return this.has(t)?this.copy(this.data.remove(t)):this},t.prototype.isEmpty=function(){return this.data.isEmpty()},t.prototype.unionWith=function(t){var e=this;return t.forEach((function(t){e=e.add(t)})),e},t.prototype.isEqual=function(e){if(!(e instanceof t))return!1;if(this.size!==e.size)return!1;for(var n=this.data.getIterator(),r=e.data.getIterator();n.hasNext();){var i=n.getNext().key,o=r.getNext().key;if(0!==this.comparator(i,o))return!1}return!0},t.prototype.toArray=function(){var t=[];return this.forEach((function(e){t.push(e)})),t},t.prototype.toString=function(){var t=[];return this.forEach((function(e){return t.push(e)})),"SortedSet("+t.toString()+")"},t.prototype.copy=function(e){var n=new t(this.comparator);return n.data=e,n},t}
1(),te=function(){function t(t){this.iter=t}return t.prototype.getNext=function(){return this.iter.getNext().key},t.prototype.hasNext=function(){return this.iter.hasNext()},t}(),ee=function(){function t(t){this.fields=t}return t.fromSet=function(e){return new t(e)},t.fromArray=function(e){var n=new Zt(ot.comparator);return e.forEach((function(t){return n=n.add(t)})),new t(n)},t.prototype.covers=function(t){var e=!1;return this.fields.forEach((function(n){n.isPrefixOf(t)&&(e=!0)})),e},t.prototype.isEqual=function(t){return this.fields.isEqual(t.fields)},t}(),ne=function(){function t(t,e){this.field=t,this.transform=e}return t.prototype.isEqual=function(t){return this.field.isEqual(t.field)&&this.transform.isEqual(t.transform)},t}(),re=function(){return function(t,e){this.version=t,this.transformResults=e}}(),ie=function(t){return t[t.Set=0]="Set",t[t.Patch=1]="Patch",t[t.Transform=2]="Transform",t[t.Delete=3]="Delete",t}({}),oe=function(){function t(t,e){this.updateTime=t,this.exists=e,g(void 0===t||void 0===e,'Precondition can specify "exists" or "updateTime" but not both')}return t.exists=function(e){return new t(void 0,e)},t.updateTime=function(e){return new t(e)},Object.defineProperty(t.prototype,"isNone",{get:function(){return void 0===this.updateTime&&void 0===this.exists},enumerable:!0,configurable:!0}),t.prototype.isValidFor=function(t){return void 0!==this.updateTime?t instanceof ut&&t.version.isEqual(this.updateTime):void 0!==this.exists?this.exists===t instanceof ut:(g(this.isNone,"Precondition should be empty"),!0)},t.prototype.isEqual=function(t){return n=t.updateTime,!((null!=(e=this.updateTime)?!n||!e.isEqual(n):e!==n)||this.exists!==t.exists);var e,n},t.NONE=new t,t}(),ae=function(){function t(){}return t.prototype.verifyKeyMatches=function(t){null!=t&&g(t.key.isEqual(this.key),"Can only apply a mutation to a document with the same key")},t.getPostMutationVersion=function(t){return t instanceof ut?t.version:Yt.MIN},t}(),se=function(t){function e(e,n,r){var i=t.call(this)||this;return i.key=e,i.value=n,i.precondition=r,i.type=ie.Set,i}return a.__extends(e,t),e.prototype.applyToRemoteDocument=function(t,e){return this.verifyKeyMatches(t),g(null==e.transformResults,"Transform results received by SetMutation."),new ut(this.key,e.version,this.value,{hasCommittedMutations:!0})},e.prototype.applyToLocalView=function(t,e,n){if(this.verifyKeyMatches(t),!this.precondition.isValidFor(t))return t;var r=ae.getPostMutationVersion(t);return new ut(this.key,r,this.value,{hasLocalMutations:!0})},e.prototype.isEqual=function(t){return t instanceof e&&this.key.isEqual(t.key)&&this.value.isEqual(t.value)&&this.precondition.isEqual(t.precondition)},e}(ae),ue=function(t){function e(e,n,r,i){var o=t.call(this)||this;return o.key=e,o.data=n,o.fieldMask=r,o.precondition=i,o.type=ie.Patch,o}return a.__extends(e,t),e.prototype.applyToRemoteDocument=function(t,e){if(this.verifyKeyMatches(t),g(null==e.transformResults,"Transform results received by PatchMutation."),!this.precondition.isValidFor(t))return new lt(this.key,e.version);var n=this.patchDocument(t);return new ut(this.key,e.version,n,{hasCommittedMutations:!0})},e.prototype.applyToLocalView=function(t,e,n){if(this.verifyKeyMatches(t),!this.precondition.isValidFor(t))return t;var r=ae.getPostMutationVersion(t),i=this.patchDocument(t);return new ut(this.key,r,i,{hasLocalMutations:!0})},e.prototype.isEqual=function(t){return t instanceof e&&this.key.isEqual(t.key)&&this.fieldMask.isEqual(t.fieldMask)&&this.precondition.isEqual(t.precondition)},e.prototype.patchDocument=function(t){return this.patchObject(t instanceof ut?t.data:Pt.EMPTY)},e.prototype.patchObject=function(t){var e=this;return this.fieldMask.fields.forEach((function(n){if(!n.isEmpty()){var r=e.data.field(n);t=void 0!==r?t.set(n,r):t.delete(n)}})),t},e}(ae),ce=function(t){function e(e,n){var r=t.call(this)||this;return r.key=e,r.fieldTransforms=n,r.type=ie.Transform,r.precondition=oe.exists(!0),r}return a.__extends(e,t),e.prototype.applyToRemoteDocument=function(t,e){if(this.verifyKeyMatches(t),g(null!=e.transformResults,"Transform results missing for TransformMutation."),!this.prec
1ondition.isValidFor(t))return new lt(this.key,e.version);var n=this.requireDocument(t),r=this.serverTransformResults(t,e.transformResults),i=e.version,o=this.transformObject(n.data,r);return new ut(this.key,i,o,{hasCommittedMutations:!0})},e.prototype.applyToLocalView=function(t,e,n){if(this.verifyKeyMatches(t),!this.precondition.isValidFor(t))return t;var r=this.requireDocument(t),i=this.localTransformResults(n,e),o=this.transformObject(r.data,i);return new ut(this.key,r.version,o,{hasLocalMutations:!0})},e.prototype.isEqual=function(t){return t instanceof e&&this.key.isEqual(t.key)&&K(this.fieldTransforms,t.fieldTransforms)&&this.precondition.isEqual(t.precondition)},e.prototype.requireDocument=function(t){g(t instanceof ut,"Unknown MaybeDocument type "+t);var e=t;return g(e.key.isEqual(this.key),"Can only transform a document with the same key"),e},e.prototype.serverTransformResults=function(t,e){var n=[];g(this.fieldTransforms.length===e.length,"server transform result count ("+e.length+") should match field transform count ("+this.fieldTransforms.length+")");for(var r=0;r<e.length;r++){var i=this.fieldTransforms[r],o=i.transform,a=null;t instanceof ut&&(a=t.field(i.field)||null),n.push(o.applyToRemoteDocument(a,e[r]))}return n},e.prototype.localTransformResults=function(t,e){for(var n=[],r=0,i=this.fieldTransforms;r<i.length;r++){var o=i[r],a=o.transform,s=null;e instanceof ut&&(s=e.field(o.field)||null),n.push(a.applyToLocalView(s,t))}return n},e.prototype.transformObject=function(t,e){g(e.length===this.fieldTransforms.length,"TransformResults length mismatch.");for(var n=0;n<this.fieldTransforms.length;n++)t=t.set(this.fieldTransforms[n].field,e[n]);return t},e}(ae),le=function(t){function e(e,n){var r=t.call(this)||this;return r.key=e,r.precondition=n,r.type=ie.Delete,r}return a.__extends(e,t),e.prototype.applyToRemoteDocument=function(t,e){return this.verifyKeyMatches(t),g(null==e.transformResults,"Transform results received by DeleteMutation."),new ct(this.key,e.version,{hasCommittedMutations:!0})},e.prototype.applyToLocalView=function(t,e,n){return this.verifyKeyMatches(t),this.precondition.isValidFor(t)?(t&&g(t.key.isEqual(this.key),"Can only apply mutation to document with same key"),new ct(this.key,Yt.forDeletedDoc())):t},e.prototype.isEqual=function(t){return t instanceof e&&this.key.isEqual(t.key)&&this.precondition.isEqual(t.precondition)},e}(ae),he=function(){function t(){}return t.prototype.applyToLocalView=function(t,e){return new It(e,t)},t.prototype.applyToRemoteDocument=function(t,e){return e},t.prototype.isEqual=function(e){return e instanceof t},t.instance=new t,t}(),fe=function(){function t(t){this.elements=t}return t.prototype.applyToLocalView=function(t,e){return this.apply(t)},t.prototype.applyToRemoteDocument=function(t,e){return this.apply(t)},t.prototype.apply=function(t){for(var e=pe(t),n=function(t){e.find((function(e){return e.isEqual(t)}))||e.push(t)},r=0,i=this.elements;r<i.length;r++)n(i[r]);return new Dt(e)},t.prototype.isEqual=function(e){return e instanceof t&&K(e.elements,this.elements)},t}(),de=function(){function t(t){this.elements=t}return t.prototype.applyToLocalView=function(t,e){return this.apply(t)},t.prototype.applyToRemoteDocument=function(t,e){return this.apply(t)},t.prototype.apply=function(t){for(var e=pe(t),n=function(t){e=e.filter((function(e){return!e.isEqual(t)}))},r=0,i=this.elements;r<i.length;r++)n(i[r]);return new Dt(e)},t.prototype.isEqual=function(e){return e instanceof t&&K(e.elements,this.elements)},t}();function pe(t){return t instanceof Dt?t.internalValue.slice():[]}var me=function(){function t(t){this.count=t}return t.prototype.isEqual=function(t){return t&&t.count===this.count},t}(),ye=function(t){return t[t.OK=0]="OK",t[t.CANCELLED=1]="CANCELLED",t[t.UNKNOWN=2]="UNKNOWN",t[t.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",t[t.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",t[t.NOT_FOUND=5]="NOT_FOUND",t[t.ALREADY_EXISTS=6]="ALREADY_EXISTS",t[t.PERMISSION_DENIED=7]="PERMISSION_DENIED",t[t.UNAUTHENTICATED=16]="UNAUTHENTICATED",t[t.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",t[t.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",t[t.ABORTED=10]="ABORTED",t[t.OUT_OF_RANGE=11]="OUT_OF_RANGE",t[t.UNIMPLEMENT
1ED=12]="UNIMPLEMENTED",t[t.INTERNAL=13]="INTERNAL",t[t.UNAVAILABLE=14]="UNAVAILABLE",t[t.DATA_LOSS=15]="DATA_LOSS",t}({});function ve(t){switch(t){case"ok":return v("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 v("Unknown status code: "+t)}}function ge(t){if(void 0===t)return m("GRPC error has no .code"),"unknown";switch(t){case ye.OK:return"ok";case ye.CANCELLED:return"cancelled";case ye.UNKNOWN:return"unknown";case ye.DEADLINE_EXCEEDED:return"deadline-exceeded";case ye.RESOURCE_EXHAUSTED:return"resource-exhausted";case ye.INTERNAL:return"internal";case ye.UNAVAILABLE:return"unavailable";case ye.UNAUTHENTICATED:return"unauthenticated";case ye.INVALID_ARGUMENT:return"invalid-argument";case ye.NOT_FOUND:return"not-found";case ye.ALREADY_EXISTS:return"already-exists";case ye.PERMISSION_DENIED:return"permission-denied";case ye.FAILED_PRECONDITION:return"failed-precondition";case ye.ABORTED:return"aborted";case ye.OUT_OF_RANGE:return"out-of-range";case ye.UNIMPLEMENTED:return"unimplemented";case ye.DATA_LOSS:return"data-loss";default:return v("Unknown status code: "+t)}}function be(t){if(void 0===t)return ye.OK;switch(t){case"ok":return ye.OK;case"cancelled":return ye.CANCELLED;case"unknown":return ye.UNKNOWN;case"deadline-exceeded":return ye.DEADLINE_EXCEEDED;case"resource-exhausted":return ye.RESOURCE_EXHAUSTED;case"internal":return ye.INTERNAL;case"unavailable":return ye.UNAVAILABLE;case"unauthenticated":return ye.UNAUTHENTICATED;case"invalid-argument":return ye.INVALID_ARGUMENT;case"not-found":return ye.NOT_FOUND;case"already-exists":return ye.ALREADY_EXISTS;case"permission-denied":return ye.PERMISSION_DENIED;case"failed-precondition":return ye.FAILED_PRECONDITION;case"aborted":return ye.ABORTED;case"out-of-range":return ye.OUT_OF_RANGE;case"unimplemented":return ye.UNIMPLEMENTED;case"data-loss":return ye.DATA_LOSS;default:return v("Unknown status code: "+t)}}var we=new ht(at.comparator);function _e(){return we}function Se(){return _e()}var Ce=new ht(at.comparator);function Ee(){return Ce}var Te=new ht(at.comparator);function ke(){return Te}var Ie=new Zt(at.comparator);function Oe(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var n=Ie,r=0,i=t;r<i.length;r++){var o=i[r];n=n.add(o)}return n}var xe=new Zt($);function Ae(){return xe}var Pe=function(){function t(t){this.comparator=t?function(e,n){return t(e,n)||at.comparator(e.key,n.key)}:function(t,e){return at.comparator(t.key,e.key)},this.keyedMap=Ee(),this.sortedSet=new ht(this.comparator)}return t.emptySet=function(e){return new t(e.comparator)},t.prototype.has=function(t){return null!=this.keyedMap.get(t)},t.prototype.get=function(t){return this.keyedMap.get(t)},t.prototype.first=function(){return this.sortedSet.minKey()},t.prototype.last=function(){return this.sortedSet.maxKey()},t.prototype.isEmpty=function(){return this.sortedSet.isEmpty()},t.prototype.indexOf=function(t){var e=this.keyedMap.get(t);return e?this.sortedSet.indexOf(e):-1},Object.defineProperty(t.prototype,"size",{get:function(){return this.sortedSet.size},enumerable:!0,configurable:!0}),t.prototype.forEach=function(t){this.sortedSet.inorderTraversal((function(e,n){return t(e),!1}))},t.prototype.add=function(t){var e=this.delete(t.key);return e.copy(e.keyedMap.insert(t.key,t),e.sortedSet.insert(t,null))},t.prototype.delete=function(t){var e=this.get(t);return e?this.copy(this.keyedMap.remove(t),this.sortedSet.remove(e)):this},t.prototype.isEqual=function(e){if(!(e instanceof t))return!1;if(this.size!==e.size)return!1;for(var n=this.sortedSet.getIterator(),r=e.sortedSet.getIterator();n.hasNext();){var i=n.getNext().key,o=r.getNext().key;if(!i.isEqual(o))return!1}return!0},t.prototype.toString=function(){var t=[];return this.forEach((function(e){t.push(e.toString())})),0===t.length?"DocumentSet ()":"DocumentSet (\n  "+t.join("  \n")+"\n)"},t.prototype.copy=function(e,n){var r=new t;return r.comparator=this.comparator,r.keyedMap=e,r.sortedSet=n,r},t}(),De=function(t){return t[t.Added=0]="Added",t[t.Removed=1]="Removed",t[t.Modified=2]="Modified",t[t.Metadata=3]="Metadata",t}({}),Re=function(t){return t[t.Local=0]="Local",t[t.Synced=1]="Synced",t}({}),Ne=function(){function t(){this.changeMap=new ht(at.comparator)}return t.prototype.track=function(t){var e=t.doc.key,n=this.changeMap.get(e);n?t.type!==De.Added&&n.type===De.Metadata?this.changeMap=this.changeMap.insert(e,t):t.type===De.Metadata&&n.type!==De.Removed?this.changeMap=this.changeMap.insert(e,{type:n.type,doc:t.doc}):t.type===De.Modified&&n.type===De.Modified?this.changeMap=this.changeMap.insert(e,{type:De.Modified,doc:t.doc}):t.type===De.Modified&&n.type===De.Added?this.changeMap=this.changeMap.insert(e,{type:De.Added,doc:t.doc}):t.type===De.Removed&&n.type===De.Added?this.changeMap=this.changeMap.remove(e):t.type===De.Removed&&n.type===De.Modified?this.changeMap=this.changeMap.insert(e,{type:De.Removed,doc:n.doc}):t.type===De.Added&&n.type===De.Removed?this.changeMap=this.changeMap.insert(e,{type:De.Modified,doc:t.doc}):v("unsupported combination of changes: "+JSON.stringify(t)+" after "+JSON.stringify(n)):this.changeMap=this.changeMap.insert(e,t)},t.prototype.getChanges=function(){var t=[];return this.changeMap.inorderTraversal((function(e,n){t.push(n)})),t},t}(),je=function(){function t(t,e,n,r,i,o,a,s){this.query=t,this.docs=e,this.oldDocs=n,this.docChanges=r,this.mutatedKeys=i,this.fromCache=o,this.syncStateChanged=a,this.excludesMetadataChanges=s}return t.fromInitialDocuments=function(e,n,r,i){var o=[];
1return n.forEach((function(t){o.push({type:De.Added,doc:t})})),new t(e,n,Pe.emptySet(n),o,r,i,!0,!1)},Object.defineProperty(t.prototype,"hasPendingWrites",{get:function(){return!this.mutatedKeys.isEmpty()},enumerable:!0,configurable:!0}),t.prototype.isEqual=function(t){if(!(this.fromCache===t.fromCache&&this.syncStateChanged===t.syncStateChanged&&this.mutatedKeys.isEqual(t.mutatedKeys)&&this.query.isEqual(t.query)&&this.docs.isEqual(t.docs)&&this.oldDocs.isEqual(t.oldDocs)))return!1;var e=this.docChanges,n=t.docChanges;if(e.length!==n.length)return!1;for(var r=0;r<e.length;r++)if(e[r].type!==n[r].type||!e[r].doc.isEqual(n[r].doc))return!1;return!0},t}(),Me=function(){function t(t,e,n,r,i){this.snapshotVersion=t,this.targetChanges=e,this.targetMismatches=n,this.documentUpdates=r,this.resolvedLimboDocuments=i}return t.createSynthesizedRemoteEventForCurrentChange=function(e,n){var r,i=((r={})[e]=Le.createSynthesizedTargetChangeForCurrentChange(e,n),r);return new t(Yt.MIN,i,Ae(),_e(),Oe())},t}(),Le=function(){function t(t,e,n,r,i){this.resumeToken=t,this.current=e,this.addedDocuments=n,this.modifiedDocuments=r,this.removedDocuments=i}return t.createSynthesizedTargetChangeForCurrentChange=function(e,n){return new t(w(),n,Oe(),Oe(),Oe())},t}(),Fe=function(){return function(t,e,n,r){this.updatedTargetIds=t,this.removedTargetIds=e,this.key=n,this.newDoc=r}}(),Ue=function(){return function(t,e){this.targetId=t,this.existenceFilter=e}}(),Ve=function(t){return t[t.NoChange=0]="NoChange",t[t.Added=1]="Added",t[t.Removed=2]="Removed",t[t.Current=3]="Current",t[t.Reset=4]="Reset",t}({}),qe=function(){return function(t,e,n,r){void 0===n&&(n=w()),void 0===r&&(r=null),this.state=t,this.targetIds=e,this.resumeToken=n,this.cause=r}}(),Be=function(){function t(){this.pendingResponses=0,this.documentChanges=He(),this._resumeToken=w(),this._current=!1,this._hasPendingChanges=!0}return Object.defineProperty(t.prototype,"current",{get:function(){return this._current},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"resumeToken",{get:function(){return this._resumeToken},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isPending",{get:function(){return 0!==this.pendingResponses},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"hasPendingChanges",{get:function(){return this._hasPendingChanges},enumerable:!0,configurable:!0}),t.prototype.updateResumeToken=function(t){t.length>0&&(this._hasPendingChanges=!0,this._resumeToken=t)},t.prototype.toTargetChange=function(){var t=Oe(),e=Oe(),n=Oe();
1return this.documentChanges.forEach((function(r,i){switch(i){case De.Added:t=t.add(r);break;case De.Modified:e=e.add(r);break;case De.Removed:n=n.add(r);break;default:v("Encountered invalid change type: "+i)}})),new Le(this._resumeToken,this._current,t,e,n)},t.prototype.clearPendingChanges=function(){this._hasPendingChanges=!1,this.documentChanges=He()},t.prototype.addDocumentChange=function(t,e){this._hasPendingChanges=!0,this.documentChanges=this.documentChanges.insert(t,e)},t.prototype.removeDocumentChange=function(t){this._hasPendingChanges=!0,this.documentChanges=this.documentChanges.remove(t)},t.prototype.recordPendingTargetRequest=function(){this.pendingResponses+=1},t.prototype.recordTargetResponse=function(){this.pendingResponses-=1},t.prototype.markCurrent=function(){this._hasPendingChanges=!0,this._current=!0},t}(),We=function(){function t(t){this.metadataProvider=t,this.targetStates={},this.pendingDocumentUpdates=_e(),this.pendingDocumentTargetMapping=ze(),this.pendingTargetResets=new Zt($)}return t.prototype.handleDocumentChange=function(t){for(var e=0,n=t.updatedTargetIds;e<n.length;e++){var r=n[e];t.newDoc instanceof ut?this.addDocumentToTarget(r,t.newDoc):t.newDoc instanceof ct&&this.removeDocumentFromTarget(r,t.key,t.newDoc)}for(var i=0,o=t.removedTargetIds;i<o.length;i++)this.removeDocumentFromTarget(r=o[i],t.key,t.newDoc)},t.prototype.handleTargetChange=function(t){var e=this;this.forEachTarget(t,(function(n){var r=e.ensureTargetState(n);switch(t.state){case Ve.NoChange:e.isActiveTarget(n)&&r.updateResumeToken(t.resumeToken);break;case Ve.Added:r.recordTargetResponse(),r.isPending||r.clearPendingChanges(),r.updateResumeToken(t.resumeToken);break;case Ve.Removed:r.recordTargetResponse(),r.isPending||e.removeTarget(n),g(!t.cause,"WatchChangeAggregator does not handle errored targets");break;case Ve.Current:e.isActiveTarget(n)&&(r.markCurrent(),r.updateResumeToken(t.resumeToken));break;case Ve.Reset:e.isActiveTarget(n)&&(e.resetTarget(n),r.updateResumeToken(t.resumeToken));break;default:v("Unknown target watch change state: "+t.state)}}))},t.prototype.forEachTarget=function(t,e){t.targetIds.length>0?t.targetIds.forEach(e):T(this.targetStates,e)},t.prototype.handleExistenceFilter=function(t){var e=t.targetId,n=t.existenceFilter.count,r=this.queryDataForActiveTarget(e);if(r){var i=r.query;if(i.isDocumentQuery())if(0===n){var o=new at(i.path);this.removeDocumentFromTarget(e,o,new ct(o,Yt.forDeletedDoc()))}else g(1===n,"Single document existence filter with count: "+n);else this.getCurrentDocumentCountForTarget(e)!==n&&(this.resetTarget(e),this.pendingTargetResets=this.pendingTargetResets.add(e))}},t.prototype.createRemoteEvent=function(t){var e=this,n={};T(this.targetStates,(function(r,i){var o=e.queryDataForActiveTarget(r);if(o){if(i.current&&o.query.isDocumentQuery()){var a=new at(o.query.path);null!==e.pendingDocumentUpdates.get(a)||e.targetContainsDocument(r,a)||e.removeDocumentFromTarget(r,a,new ct(a,t))}i.hasPendingChanges&&(n[r]=i.toTargetChange(),i.clearPendingChanges())}}));var r=Oe();this.pendingDocumentTargetMapping.forEach((function(t,n){var i=!0;n.forEachWhile((function(t){var n=e.queryDataForActiveTarget(t);return!n||n.purpose===Xt.LimboResolution||(i=!1,!1)})),i&&(r=r.add(t))}));var i=new Me(t,n,this.pendingTargetResets,this.pendingDocumentUpdates,r);return this.pendingDocumentUpdates=_e(),this.pendingDocumentTargetMapping=ze(),this.pendingTargetResets=new Zt($),i},t.prototype.addDocumentToTarget=function(t,e){if(this.isActiveTarget(t)){var n=this.targetContainsDocument(t,e.key)?De.Modified:De.Added;this.ensureTargetState(t).addDocumentChange(e.key,n),this.pendingDocumentUpdates=this.pendingDocumentUpdates.insert(e.key,e),this.pendingDocumentTargetMapping=this.pendingDocumentTargetMapping.insert(e.key,this.ensureDocumentTargetMapping(e.key).add(t))}},t.prototype.removeDocumentFromTarget=function(t,e,n){if(this.isActiveTarget(t)){var r=this.ensureTargetState(t);this.targetContainsDocument(t,e)?r.addDocumentChange(e,De.Removed):r.removeDocumentChange(e),this.pendingDocumentTargetMapping=this.pendingDocumentTargetMapping.insert(e,this.ensureDocumentTargetMapping(e).delete(t)),n&&(this.pendingDocumentUpdates=this.pendingDocumentUpdates.insert(e,n))}},t.prototype.removeTarget=function(t){delete this.targetStates[t]},t.prototype.getCurrentDocumentCountForTarget=function(t){var e=this.ensureTargetState(t).toTargetChange();return this.metadataProvider.getRemoteKeysForTarget(t).size+e.addedDocuments.size-e.removedDocuments.size},t.prototype.recordPendingTargetRequest=function(t){this.ensureTargetState(t).recordPendingTargetRequest
1()},t.prototype.ensureTargetState=function(t){return this.targetStates[t]||(this.targetStates[t]=new Be),this.targetStates[t]},t.prototype.ensureDocumentTargetMapping=function(t){var e=this.pendingDocumentTargetMapping.get(t);return e||(e=new Zt($),this.pendingDocumentTargetMapping=this.pendingDocumentTargetMapping.insert(t,e)),e},t.prototype.isActiveTarget=function(t){return null!==this.queryDataForActiveTarget(t)},t.prototype.queryDataForActiveTarget=function(t){var e=this.targetStates[t];return e&&e.isPending?null:this.metadataProvider.getQueryDataForTarget(t)},t.prototype.resetTarget=function(t){var e=this;g(!this.targetStates[t].isPending,"Should only reset active targets"),this.targetStates[t]=new Be,this.metadataProvider.getRemoteKeysForTarget(t).forEach((function(n){e.removeDocumentFromTarget(t,n,null)}))},t.prototype.targetContainsDocument=function(t,e){return this.metadataProvider.getRemoteKeysForTarget(t).has(e)},t}();function ze(){return new ht(at.comparator)}function He(){return new ht(at.comparator)}var $e,Ke,Ge=(($e={})[Ht.ASCENDING.name]="ASCENDING",$e[Ht.DESCENDING.name]="DESCENDING",$e),Qe=((Ke={})[qt.LESS_THAN.name]="LESS_THAN",Ke[qt.LESS_THAN_OR_EQUAL.name]="LESS_THAN_OR_EQUAL",Ke[qt.GREATER_THAN.name]="GREATER_THAN",Ke[qt.GREATER_THAN_OR_EQUAL.name]="GREATER_THAN_OR_EQUAL",Ke[qt.EQUAL.name]="EQUAL",Ke[qt.ARRAY_CONTAINS.name]="ARRAY_CONTAINS",Ke),Ye=new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);function Xe(t,e){g(!Lt(t),e+" is missing")}function Je(t){return"number"==typeof t?t:"string"==typeof t?Number(t):v("can't parse "+t)}var Ze=function(){function t(t,e){this.databaseId=t,this.options=e}return t.prototype.emptyByteString=function(){return this.options.useProto3Json?"":new Uint8Array(0)},t.prototype.unsafeCastProtoByteString=function(t){return t},t.prototype.fromRpcStatus=function(t){var e=void 0===t.code?"unknown":ge(t.code);return new _(e,t.message||"")},t.prototype.toInt32Value=function(t){return Lt(t)?void 0:{value:t}},t.prototype.fromInt32Value=function(t){var e;return Lt(e="object"==typeof t?t.value:t)?null:e},t.prototype.toTimestamp=function(t){return{seconds:t.seconds,nanos:t.nanoseconds}},t.prototype.fromTimestamp=function(t){if("string"==typeof t)return this.fromIso8601String(t);g(!!t,"Cannot deserialize null or undefined timestamp.");var e=Je(t.seconds||"0");return new Z(e,t.nanos||0)},t.prototype.fromIso8601String=function(t){var e=0,n=Ye.exec(t);if(g(!!n,"invalid timestamp: "+t),n[1]){var r=n[1];r=(r+"000000000").substr(0,9),e=Number(r)}var i=new Date(t),o=Math.floor(i.getTime()/1e3);return new Z(o,e)},t.prototype.toBytes=function(t){return this.options.useProto3Json?t.toBase64():this.unsafeCastProtoByteString(t.toUint8Array())},t.prototype.fromBlob=function(t){return"string"==typeof t?(g(this.options.useProto3Json,"Expected bytes to be passed in as Uint8Array, but got a string instead."),Y.fromBase64String(t)):(g(!this.options.useProto3Json,"Expected bytes to be passed in as string, but got something else instead."),Y.fromUint8Array(t))},t.prototype.toVersion=function(t){return this.toTimestamp(t.toTimestamp())},t.prototype.fromVersion=function(t){return g(!!t,"Trying to deserialize version that isn't set"),Yt.fromTimestamp(this.fromTimestamp(t))},t.prototype.toResourceName=function(t,e){return this.fullyQualifiedPrefixPath(t).child("documents").child(e).canonicalString()},t.prototype.fromResourceName=function(t){var e=rt.fromString(t);return g(this.isValidResourceName(e),"Tried to deserialize invalid key "+e.toString()),e},t.prototype.toName=function(t){return this.toResourceName(this.databaseId,t.path)},t.prototype.fromName=function(t){var e=this.fromResourceName(t);return g(e.get(1)===this.databaseId.projectId,"Tried to deserialize key from different project: "+e.get(1)+" vs "+this.databaseId.projectId),g(!e.get(3)&&!this.databaseId.database||e.get(3)===this.databaseId.database,"Tried to deserialize key from different database: "+e.get(3)+" vs "+this.databaseId.database),new at(this.extractLocalPathFromResourceName(e))},t.prototype.toQueryPath=function(t){return this.toResourceName(this.databaseId,t)},t.prototype.fromQueryPath=function(t){var e=this.fromResourceName(t);return 4===e.length?rt.EMPTY_PATH:this.extractLocalPathFromResourceName(e)},Object.defineProperty(t.prototype,"encodedDatabaseId",{get:function(){return new rt(["projects",this.databaseId.projectId,"databases",this.databaseId.database]).canonicalString()},enumerable:!0,configurable:!0}),t.prototype.fullyQualifiedPrefixPath=function(t){return new rt(["projects",t.projectId,"databases",t.database])},t.prototype.extractLocalPathFromResourceName=function(t){return g(t.length>4&&"documents"===t.get(4),"tried to deserialize invalid key "+t.toString()),t.popFirst(5)},t.prototype.isValidResourceName=function(t){return t.length>=4&&"projects"===t.get(0)&&"databases"===t.get(2)},t.prototype.toValue=function(t){if(t instanceof bt)return{nullValue:"NULL_VALUE"};if(t instanceof wt)return{booleanValue:t.value()};if(t instanceof Ct)return{integerValue:""+t.value()};if(t instanceof Et){var e=t.value();if(this.options.useProto3Json){if(isNaN(e))return{doubleValue:"NaN"};if(e===1/0)return{doubleValue:"Infinity"};if(e===-1/0)return{doubleValue:"-Infinity"}}return{doubleValue:t.value()}}return t instanceof Tt?{stringValue:t.value()}:t instanceof Pt?{mapValue:this.toMapValue(t)}:t instanceof Dt?{arrayValue:this.toArrayValue(t)}
1:t instanceof kt?{timestampValue:this.toTimestamp(t.internalValue)}:t instanceof At?{geoPointValue:{latitude:t.value().latitude,longitude:t.value().longitude}}:t instanceof Ot?{bytesValue:this.toBytes(t.value())}:t instanceof xt?{referenceValue:this.toResourceName(t.databaseId,t.key.path)}:v("Unknown FieldValue "+JSON.stringify(t))},t.prototype.fromValue=function(t){var e=this,n=t.value_type;if(tn(t,n,"nullValue"))return bt.INSTANCE;if(tn(t,n,"booleanValue"))return wt.of(t.booleanValue);if(tn(t,n,"integerValue"))return new Ct(Je(t.integerValue));if(tn(t,n,"doubleValue")){if(this.options.useProto3Json){if("NaN"===t.doubleValue)return Et.NAN;if("Infinity"===t.doubleValue)return Et.POSITIVE_INFINITY;if("-Infinity"===t.doubleValue)return Et.NEGATIVE_INFINITY}return new Et(t.doubleValue)}if(tn(t,n,"stringValue"))return new Tt(t.stringValue);if(tn(t,n,"mapValue"))return this.fromFields(t.mapValue.fields||{});if(tn(t,n,"arrayValue"))return Xe(t.arrayValue,"arrayValue"),new Dt((t.arrayValue.values||[]).map((function(t){return e.fromValue(t)})));if(tn(t,n,"timestampValue"))return Xe(t.timestampValue,"timestampValue"),new kt(this.fromTimestamp(t.timestampValue));if(tn(t,n,"geoPointValue"))return Xe(t.geoPointValue,"geoPointValue"),new At(new J(t.geoPointValue.latitude||0,t.geoPointValue.longitude||0));if(tn(t,n,"bytesValue")){Xe(t.bytesValue,"bytesValue");var r=this.fromBlob(t.bytesValue);return new Ot(r)}if(tn(t,n,"referenceValue")){Xe(t.referenceValue,"referenceValue");var i=this.fromResourceName(t.referenceValue),o=new et(i.get(1),i.get(3)),a=new at(this.extractLocalPathFromResourceName(i));return new xt(o,a)}return v("Unknown Value proto "+JSON.stringify(t))},t.prototype.toMutationDocument=function(t,e){return{name:this.toName(t),fields:this.toFields(e)}},t.prototype.toDocument=function(t){return g(!t.hasLocalMutations,"Can't serialize documents with mutations."),{name:this.toName(t.key),fields:this.toFields(t.data),updateTime:this.toTimestamp(t.version.toTimestamp())}},t.prototype.fromDocument=function(t,e){return new ut(this.fromName(t.name),this.fromVersion(t.updateTime),this.fromFields(t.fields||{}),{hasCommittedMutations:!!e})},t.prototype.toFields=function(t){var e=this,n={};return t.forEach((function(t,r){n[t]=e.toValue(r)})),n},t.prototype.fromFields=function(t){var e=this,n=Pt.EMPTY;return k(t,(function(t,r){n=n.set(new ot([t]),e.fromValue(r))})),n},t.prototype.toMapValue=function(t){return{fields:this.toFields(t)}},t.prototype.toArrayValue=function(t){var e=this,n=[];return t.forEach((function(t){n.push(e.toValue(t))})),{values:n}},t.prototype.fromFound=function(t){g(!!t.found,"Tried to deserialize a found document from a missing document."),Xe(t.found.name,"doc.found.name"),Xe(t.found.updateTime,"doc.found.updateTime");var e=this.fromName(t.found.name),n=this.fromVersion(t.found.updateTime),r=this.fromFields(t.found.fields||{});return new ut(e,n,r,{},t.found)},t.prototype.fromMissing=function(t){g(!!t.missing,"Tried to deserialize a missing document from a found document."),g(!!t.readTime,"Tried to deserialize a missing document without a read time.");var e=this.fromName(t.missing),n=this.fromVersion(t.readTime);return new ct(e,n)},t.prototype.fromMaybeDocument=function(t){var e=t.result;return tn(t,e,"found")?this.fromFound(t):tn(t,e,"missing")?this.fromMissing(t):v("invalid batch get response: "+JSON.stringify(t))},t.prototype.toWatchTargetChangeState=function(t){switch(t){case Ve.Added:return"ADD";case Ve.Current:return"CURRENT";case Ve.NoChange:return"NO_CHANGE";case Ve.Removed:return"REMOVE";case Ve.Reset:return"RESET";default:return v("Unknown WatchTargetChangeState: "+t)}},t.prototype.toTestWatchChange=function(t){if(t instanceof Ue)return{filter:{count:t.existenceFilter.count,targetId:t.targetId}};if(t instanceof Fe){var e;if(t.newDoc instanceof ut)return{documentChange:{document:{name:this.toName((e=t.newDoc).key),fields:this.toFields(e.data),updateTime:this.toVersion(e.version)},targetIds:t.updatedTargetIds,removedTargetIds:t.removedTargetIds}};if(t.newDoc instanceof ct)return{documentDelete:{document:this.toName((e=t.newDoc).key),readTime:this.toVersion(e.version),removedTargetIds:t.removedTargetIds}};if(null===t.newDoc)return{documentRemove:{document:this.toName(t.key),removedTargetIds:t.removedTargetIds}}}if(t instanceof qe){var n=void 0;return t.cause&&(n={code:be(t.cause.code),message:t.cause.message}),{targetChange:{targetChangeType:this.toWatchTargetChangeState(t.state),targetIds:t.targetIds,resumeToken:this.unsafeCastProtoByteString(t.resumeToken),cause:n}}}
1return v("Unrecognized watch change: "+JSON.stringify(t))},t.prototype.fromWatchChange=function(t){var e,n=t.response_type;if(tn(t,n,"targetChange")){Xe(t.targetChange,"targetChange");var r=this.fromWatchTargetChangeState(t.targetChange.targetChangeType||"NO_CHANGE"),i=t.targetChange.targetIds||[],o=t.targetChange.resumeToken||this.emptyByteString(),a=t.targetChange.cause,s=a&&this.fromRpcStatus(a);e=new qe(r,i,o,s||null)}else if(tn(t,n,"documentChange")){Xe(t.documentChange,"documentChange"),Xe(t.documentChange.document,"documentChange.name"),Xe(t.documentChange.document.name,"documentChange.document.name"),Xe(t.documentChange.document.updateTime,"documentChange.document.updateTime");var u=t.documentChange,c=this.fromName(u.document.name),l=this.fromVersion(u.document.updateTime),h=this.fromFields(u.document.fields||{}),f=new ut(c,l,h,{},u.document);e=new Fe(u.targetIds||[],u.removedTargetIds||[],f.key,f)}else if(tn(t,n,"documentDelete")){Xe(t.documentDelete,"documentDelete"),Xe(t.documentDelete.document,"documentDelete.document");var d=t.documentDelete;c=this.fromName(d.document),l=d.readTime?this.fromVersion(d.readTime):Yt.forDeletedDoc(),f=new ct(c,l),e=new Fe([],d.removedTargetIds||[],f.key,f)}else if(tn(t,n,"documentRemove")){Xe(t.documentRemove,"documentRemove"),Xe(t.documentRemove.document,"documentRemove");var p=t.documentRemove;c=this.fromName(p.document),e=new Fe([],p.removedTargetIds||[],c,null)}else{if(!tn(t,n,"filter"))return v("Unknown change type "+JSON.stringify(t));Xe(t.filter,"filter"),Xe(t.filter.targetId,"filter.targetId");var m=t.filter,y=new me(m.count||0);e=new Ue(m.targetId,y)}return e},t.prototype.fromWatchTargetChangeState=function(t){return"NO_CHANGE"===t?Ve.NoChange:"ADD"===t?Ve.Added:"REMOVE"===t?Ve.Removed:"CURRENT"===t?Ve.Current:"RESET"===t?Ve.Reset:v("Got unexpected TargetChange.state: "+t)},t.prototype.versionFromListenResponse=function(t){if(!tn(t,t.response_type,"targetChange"))return Yt.MIN;var e=t.targetChange;return e.targetIds&&e.targetIds.length?Yt.MIN:e.readTime?this.fromVersion(e.readTime):Yt.MIN},t.prototype.toMutation=function(t){var e,n=this;if(t instanceof se)e={update:this.toMutationDocument(t.key,t.value)};else if(t instanceof le)e={delete:this.toName(t.key)};else if(t instanceof ue)e={update:this.toMutationDocument(t.key,t.data),updateMask:this.toDocumentMask(t.fieldMask)};else{if(!(t instanceof ce))return v("Unknown mutation type "+t.type);e={transform:{document:this.toName(t.key),fieldTransforms:t.fieldTransforms.map((function(t){return n.toFieldTransform(t)}))}}}return t.precondition.isNone||(e.currentDocument=this.toPrecondition(t.precondition)),e},t.prototype.fromMutation=function(t){var e=this,n=t.currentDocument?this.fromPrecondition(t.currentDocument):oe.NONE;if(t.update){Xe(t.update.name,"name");var r=this.fromName(t.update.name),i=this.fromFields(t.update.fields||{});if(t.updateMask){var o=this.fromDocumentMask(t.updateMask);return new ue(r,i,o,n)}return new se(r,i,n)}if(t.delete)return r=this.fromName(t.delete),new le(r,n);if(t.transform){r=this.fromName(t.transform.document);var a=t.transform.fieldTransforms.map((function(t){return e.fromFieldTransform(t)}));return g(!0===n.exists,'Transforms only support precondition "exists == true"'),new ce(r,a)}return v("unknown mutation proto: "+JSON.stringify(t))},t.prototype.toPrecondition=function(t){return g(!t.isNone,"Can't serialize an empty precondition"),void 0!==t.updateTime?{updateTime:this.toVersion(t.updateTime)}:void 0!==t.exists?{exists:t.exists}:v("Unknown precondition")},t.prototype.fromPrecondition=function(t){return void 0!==t.updateTime?oe.updateTime(this.fromVersion(t.updateTime)):void 0!==t.exists?oe.exists(t.exists):oe.NONE},t.prototype.fromWriteResult=function(t,e){var n=this,r=this.fromVersion(t.updateTime?t.updateTime:e),i=null;return t.transformResults&&t.transformResults.length>0&&(i=t.transformResults.map((function(t){return n.fromValue(t)}))),new re(r,i)},t.prototype.fromWriteResults=function(t,e){var n=this;return t&&t.length>0?(g(void 0!==e,"Received a write result without a commit time"),t.map((function(t){return n.fromWriteResult(t,e)}))):[]},t.prototype.toFieldTransform=function(t){var e=this,n=t.transform;if(n instanceof he)return{fieldPath:t.field.canonicalString(),setToServerValue:"REQUEST_TIME"};if(n instanceof fe)return{fieldPath:t.field.canonicalString(),appendMissingElements:{values:n.elements.map((function(t){return e.toValue(t)}))}};if(n instanceof de)return{fieldPath:t.field.canonicalString(),removeAllFromArray:{values:n.elements.map((function(t){return e.toValue(t)}))}};
1throw v("Unknown transform: "+t.transform)},t.prototype.fromFieldTransform=function(t){var e=this,n=t.transform_type,r=null;tn(t,n,"setToServerValue")?(g("REQUEST_TIME"===t.setToServerValue,"Unknown server value transform proto: "+JSON.stringify(t)),r=he.instance):tn(t,n,"appendMissingElements")?r=new fe((t.appendMissingElements.values||[]).map((function(t){return e.fromValue(t)}))):tn(t,n,"removeAllFromArray")?r=new de((t.removeAllFromArray.values||[]).map((function(t){return e.fromValue(t)}))):v("Unknown transform proto: "+JSON.stringify(t));var i=ot.fromServerFormat(t.fieldPath);return new ne(i,r)},t.prototype.toDocumentsTarget=function(t){return{documents:[this.toQueryPath(t.path)]}},t.prototype.fromDocumentsTarget=function(t){var e=t.documents.length;return g(1===e,"DocumentsTarget contained other than 1 document: "+e),Ut.atPath(this.fromQueryPath(t.documents[0]))},t.prototype.toQueryTarget=function(t){var e={structuredQuery:{}};if(t.path.isEmpty())e.parent=this.toQueryPath(rt.EMPTY_PATH);else{var n=t.path;g(n.length%2!=0,"Document queries with filters are not supported."),e.parent=this.toQueryPath(n.popLast()),e.structuredQuery.from=[{collectionId:n.lastSegment()}]}var r=this.toFilter(t.filters);r&&(e.structuredQuery.where=r);var i=this.toOrder(t.orderBy);i&&(e.structuredQuery.orderBy=i);var o=this.toInt32Value(t.limit);return void 0!==o&&(e.structuredQuery.limit=o),t.startAt&&(e.structuredQuery.startAt=this.toCursor(t.startAt)),t.endAt&&(e.structuredQuery.endAt=this.toCursor(t.endAt)),e},t.prototype.fromQueryTarget=function(t){var e=this.fromQueryPath(t.parent),n=t.structuredQuery,r=n.from?n.from.length:0;r>0&&(g(1===r,"StructuredQuery.from with more than one collection is not supported."),e=e.child(n.from[0].collectionId));var i=[];n.where&&(i=this.fromFilter(n.where));var o=[];n.orderBy&&(o=this.fromOrder(n.orderBy));var a=null;n.limit&&(a=this.fromInt32Value(n.limit));var s=null;n.startAt&&(s=this.fromCursor(n.startAt));var u=null;return n.endAt&&(u=this.fromCursor(n.endAt)),new Ut(e,o,i,a,s,u)},t.prototype.toListenRequestLabels=function(t){var e=this.toLabel(t.purpose);return null==e?null:{"goog-listen-tags":e}},t.prototype.toLabel=function(t){switch(t){case Xt.Listen:return null;case Xt.ExistenceFilterMismatch:return"existence-filter-mismatch";case Xt.LimboResolution:return"limbo-document";default:return v("Unrecognized query purpose: "+t)}},t.prototype.toTarget=function(t){var e,n=t.query;return(e=n.isDocumentQuery()?{documents:this.toDocumentsTarget(n)}:{query:this.toQueryTarget(n)}).targetId=t.targetId,t.resumeToken.length>0&&(e.resumeToken=this.unsafeCastProtoByteString(t.resumeToken)),e},t.prototype.toFilter=function(t){var e=this;if(0!==t.length){var n=t.map((function(t){return t instanceof Bt?e.toRelationFilter(t):e.toUnaryFilter(t)}));return 1===n.length?n[0]:{compositeFilter:{op:"AND",filters:n}}}},t.prototype.fromFilter=function(t){var e=this;return t?void 0!==t.unaryFilter?[this.fromUnaryFilter(t)]:void 0!==t.fieldFilter?[this.fromRelationFilter(t)]:void 0!==t.compositeFilter?t.compositeFilter.filters.map((function(t){return e.fromFilter(t)})).reduce((function(t,e){return t.concat(e)})):v("Unknown filter: "+JSON.stringify(t)):[]},t.prototype.toOrder=function(t){var e=this;if(0!==t.length)return t.map((function(t){return e.toPropertyOrder(t)}))},t.prototype.fromOrder=function(t){var e=this;return t.map((function(t){return e.fromPropertyOrder(t)}))},t.prototype.toCursor=function(t){var e=this;return{before:t.before,values:t.position.map((function(t){return e.toValue(t)}))}},t.prototype.fromCursor=function(t){var e=this,n=!!t.before,r=t.values.map((function(t){return e.fromValue(t)}));return new $t(r,n)},t.prototype.toDirection=function(t){return Ge[t.name]},t.prototype.fromDirection=function(t){switch(t){case"ASCENDING":return Ht.ASCENDING;case"DESCENDING":return Ht.DESCENDING;default:return}},t.prototype.toOperatorName=function(t){return Qe[t.name]},t.prototype.fromOperatorName=function(t){switch(t){case"EQUAL":return qt.EQUAL;case"GREATER_THAN":return qt.GREATER_THAN;case"GREATER_THAN_OR_EQUAL":return qt.GREATER_THAN_OR_EQUAL;case"LESS_THAN":return qt.LESS_THAN;case"LESS_THAN_OR_EQUAL":return qt.LESS_THAN_OR_EQUAL;case"ARRAY_CONTAINS":return qt.ARRAY_CONTAINS;case"OPERATOR_UNSPECIFIED":return v("Unspecified relation");default:return v("Unknown relation")}},t.prototype.toFieldPathReference=function(t){return{fieldPath:t.canonicalString()}},t.prototype.fromFieldPathReference=function(t){return ot.fromServerFormat(t.fieldPath)},t.prototype.toPropertyOrder=function(t){return{field:this.toFieldPathReference(t.field),direction:this.toDirection(t.dir)}},t.prototype.fromPropertyOrder=function(t){return new Kt(this.fromFieldPathReference(t.field),this.fromDirection(t.direction))},t.prototype.toRelationFilter=function(t){return t instanceof Bt?{fieldFilter:{field:this.toFieldPathReference(t.field),op:this.toOperatorName(t.op),value:this.toValue(t.value)}}:v("Unrecognized filter: "+JSON.stringify(t))},t.prototype.fromRelationFilter=function(t){return new Bt(this.fromFieldPathReference(t.fieldFilter.field),this.fromOperatorName(t.fieldFilter.op),this.fromValue(t.fieldFilter.value))},t.prototype.toUnaryFilter=function(t){return t instanceof zt?{unaryFilter:{field:this.toFieldPathReference(t.field),op:"IS_NAN"}}:t instanceof Wt?{unaryFilter:{field:this.toFieldPathReference(t.field),op:"IS_NULL"}}:v("Unrecognized filter: "+JSON.stringify(t))},t.prototype.fromUnaryFilter=function(t){switch(t.unaryFilter.op){case"IS_NAN":var e=this.fromFieldPathReference(t.unaryFilter.field);return new zt(e);case"IS_NULL":var n=this.fromFieldPathReference(t.unaryFilter.field);return new Wt(n);case"OPERATOR_UNSPECIFIED":return v("Unspecified filter");default:return v("Unknown filter")}},t.prototype.toDocumentMask=function(t){var e=[];return t.fields.forEach((function(t){return e.push(t.canonicalString())})),{fieldPaths:e}},t.prototype.fromDocumentMask=function(t){var e=(t.fieldPaths||[]).map((function(t){return ot.fromServerFormat(t)}));return ee.fromArray(e)},t}();function tn(t,e,n){return e===n||!e&&n in t}var en=function(){function t(t){this.sendFn=t.sendFn,this.closeFn=t.closeFn}return t.prototype.onOpen=function(t){g(!this.wrappedOnOpen,"Called onOpen on stream twice!"),this.wrappedOnOpen=t},t.prototype.onClose=function(t){g(!this.wrappedOnClose,"Called onClose on stream twice!"),this.wrappedOnClose=t},t.prototype.onMessage=function(t){g(!this.wrappedOnMessage,"Called onMessage on stream twice!"),this.wrappedOnMessage=t},t.prototype.close=function(){this.closeFn()},t.prototype.send=function(t){this.sendFn(t)},t.prototype.callOnOpen=function(){g(void 0!==this.wrappedOnOpen,"Cannot call onOpen because no callback was set"),this.wrappedOnOpen()},t.prototype.callOnClose=function(t){g(void 0!==this.wrappedOnClose,"Cannot call onClose because no callback was set"),this.wrappedOnClose(t)},t.prototype.callOnMessage=function(t){g(void 0!==this.wrappedOnMessage,"Cannot call onMessage because no callback was set"),this.wrappedOnMessage(t)},t}(),nn="Connection",rn={BatchGetDocuments:"batchGet",Commit:"commit"},on="gl-js/ fire/"+c,an=function(){function t(t){this.databaseId=t.databaseId,this.pool=new s.XhrIoPool,this.baseUrl=(t.ssl?"https":"http")+"://"+t.host}return t.prototype.modifyHeadersForRequest=function(t,e){if(e)for(var n in e.authHeaders)e.authHeaders.hasOwnProperty(n)&&(t[n]=e.authHeaders[n]);t["X-Goog-Api-Client"]=on},t.prototype.invokeRPC=function(t,e,n){var r=this,i=this.makeUrl(t);return new Promise((function(o,a){r.pool.getObject((function(u){u.listenOnce(s.EventType.COMPLETE,(function(){try{
1switch(u.getLastErrorCode()){case s.ErrorCode.NO_ERROR:var e=u.getResponseJson();p(nn,"XHR received:",JSON.stringify(e)),o(e);break;case s.ErrorCode.TIMEOUT:p(nn,'RPC "'+t+'" timed out'),a(new _("deadline-exceeded","Request time out"));break;case s.ErrorCode.HTTP_ERROR:var n=u.getStatus();p(nn,'RPC "'+t+'" failed with status:',n,"response text:",u.getResponseText()),n>0?a(new _(function(t){switch(t){case 200:return"ok";case 400:return"invalid-argument";case 401:return"unauthenticated";case 403:return"permission-denied";case 404:return"not-found";case 409:return"aborted";case 416:return"out-of-range";case 429:return"resource-exhausted";case 499:return"cancelled";case 500:return"unknown";case 501:return"unimplemented";case 503:return"unavailable";case 504:return"deadline-exceeded";default:return t>=200&&t<300?"ok":t>=400&&t<500?"failed-precondition":t>=500&&t<600?"internal":"unknown"}}(n),"Server responded with status "+u.getStatusText())):(p(nn,'RPC "'+t+'" failed'),a(new _("unavailable","Connection failed.")));break;default:v('RPC "'+t+'" failed with unanticipated webchannel error '+u.getLastErrorCode()+": "+u.getLastError()+", giving up.")}}finally{p(nn,'RPC "'+t+'" completed.'),r.pool.releaseObject(u)}}));var c=JSON.stringify(e);p(nn,"XHR sending: ",i+" "+c);var l={"Content-Type":"text/plain"};r.modifyHeadersForRequest(l,n),u.send(i,"POST",c,l,15)}))}))},t.prototype.invokeStreamingRPC=function(t,e,n){return this.invokeRPC(t,e,n)},t.prototype.openStream=function(t,e){var n=[this.baseUrl,"/","google.firestore.v1.Firestore","/",t,"/channel"],r=s.createWebChannelTransport(),i={backgroundChannelTest:!0,httpSessionIdParam:"gsessionid",initMessageHeaders:{},messageUrlParams:{database:"projects/"+this.databaseId.projectId+"/databases/"+this.databaseId.database},sendRawJson:!0,supportsCrossDomainXhr:!0};this.modifyHeadersForRequest(i.initMessageHeaders,e),u.isReactNative()||(i.httpHeadersOverwriteParam="$httpHeaders");var o=n.join("");p(nn,"Creating WebChannel: "+o+" "+i);var a=r.createWebChannel(o,i),c=!1,l=!1,h=new en({sendFn:function(t){l?p(nn,"Not sending because WebChannel is closed:",t):(c||(p(nn,"Opening WebChannel transport."),a.open(),c=!0),p(nn,"WebChannel sending:",t),a.send(t))},closeFn:function(){return a.close()}}),f=function(t,e){a.listen(t,(function(t){try{e(t)}catch(n){setTimeout((function(){throw n}),0)}}))};return f(s.WebChannel.EventType.OPEN,(function(){l||p(nn,"WebChannel transport opened.")})),f(s.WebChannel.EventType.CLOSE,(function(){l||(l=!0,p(nn,"WebChannel transport closed"),h.callOnClose())})),f(s.WebChannel.EventType.ERROR,(function(t){l||(l=!0,p(nn,"WebChannel transport errored:",t),h.callOnClose(new _("unavailable","The operation could not be completed")))})),f(s.WebChannel.EventType.MESSAGE,(function(t){if(!l){var e=t.data[0];g(!!e,"Got a webchannel message without data.");var n=e.error||e[0]&&e[0].error;if(n){p(nn,"WebChannel received error:",n);var r=n.status,i=function(t){var e=ye[t];if(void 0!==e)return ge(e)}(r),o=n.message;void 0===i&&(i="internal",o="Unknown error status: "+r+" with message "+n.message),l=!0,h.callOnClose(new _(i,o)),a.close()}else p(nn,"WebChannel received:",e),h.callOnMessage(e)}})),setTimeout((function(){h.callOnOpen()}),0),h},t.prototype.makeUrl=function(t){var e=rn[t];g(void 0!==e,"Unknown REST mapping for: "+t);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(e),n.join("")},t}();b.setPlatform(new(function(){function t(){this.emptyByteString="",this.base64Available="undefined"!=typeof atob}return Object.defineProperty(t.prototype,"document",{get:function(){return"undefined"!=typeof document?document:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"window",{get:function(){return"undefined"!=typeof window?window:null},enumerable:!0,configurable:!0}),t.prototype.loadConnection=function(t){return Promise.resolve(new an(t))},t.prototype.newSerializer=function(t){return new Ze(t,{useProto3Json:!0})},t.prototype.formatJSON=function(t){return JSON.stringify(t)},t.prototype.atob=function(t){return atob(t)},t.prototype.btoa=function(t){return btoa(t)},t}()));var sn,un=function(){function t(t,e){var n=this;this.previousValue=t,e&&(e.sequenceNumberHandler=function(t){return n.setPreviousValue(t)},this.writeNewSequenceNumber=function(t){return e.writeSequenceNumber(t)})}return t.prototype.setPreviousValue=function(t){return this.previousValue=Math.max(t,this.previousValue),this.previousValue},t.prototype.next=function(){var t=++this.previousValue;return this.writeNewSequenceNumber&&this.writeNewSequenceNumber(t),t},t.INVALID=-1,t}(),cn=function(){return function(){var t=this;this.promise=new Promise((function(e,n){t.resolve=e,t.reject=n}))}}();!function(t){t.All="all",t.ListenStreamIdle="listen_stream_idle",t.ListenStreamConnectionBackoff="listen_stream_connection_backoff",t.WriteStreamIdle="write_stream_idle",t.WriteStreamConnectionBackoff="write_stream_connection_backoff",t.OnlineStateTimeout="online_state_timeout",t.ClientMetadataRefresh="client_metadata_refresh",t.LruGarbageCollection="lru_garbage_collection"}(sn||(sn={}));var ln=function(){function t(t,e,n,r,i){this.asyncQueue=t,this.timerId=e,this.targetTimeMs=n,this.op=r,this.removalCallback=i,this.deferred=new cn,this.then=this.deferred.promise.then.bind(this.deferred.promise),this.catch=this.deferred.promise.catch.bind(this.deferred.promise),this.deferred.promise.catch((function(t){}))}return t.createAndSchedule=function(e,n,r,i,o){var a=new t(e,n,Date.now()+r,i,o);return a.start(r),a},t.prototype.start=function(t){var e=this;this.timerHandle=setTimeout((function(){return e.handleDelayElapsed()}),t)},t.prototype.skipDelay=function(){return this.handleDelayElapsed()},t.prototype.cancel=function(t){null!==this.timerHandle&&(this.clearTimeout(),this.deferred.reject(new _("cancelled","Operation cancelled"+(t?": "+t:"")))
1)},t.prototype.handleDelayElapsed=function(){var t=this;this.asyncQueue.enqueueAndForget((function(){return null!==t.timerHandle?(t.clearTimeout(),t.op().then((function(e){return t.deferred.resolve(e)}))):Promise.resolve()}))},t.prototype.clearTimeout=function(){null!==this.timerHandle&&(this.removalCallback(this),clearTimeout(this.timerHandle),this.timerHandle=null)},t}(),hn=function(){function t(){this.tail=Promise.resolve(),this.delayedOperations=[],this.operationInProgress=!1}return t.prototype.enqueueAndForget=function(t){this.enqueue(t)},t.prototype.enqueue=function(t){var e=this;this.verifyNotFailed();var n=this.tail.then((function(){return e.operationInProgress=!0,t().catch((function(t){e.failure=t,e.operationInProgress=!1;var n=t.stack||t.message||"";throw m("INTERNAL UNHANDLED ERROR: ",n),n.indexOf("Firestore Test Simulated Error")<0&&setTimeout((function(){throw t}),0),t})).then((function(t){return e.operationInProgress=!1,t}))}));return this.tail=n,n},t.prototype.enqueueAfterDelay=function(t,e,n){var r=this;this.verifyNotFailed(),g(e>=0,"Attempted to schedule an operation with a negative delay of "+e),g(!this.containsDelayedOperation(t),"Attempted to schedule multiple operations with timer id "+t+".");var i=ln.createAndSchedule(this,t,e,n,(function(t){return r.removeDelayedOperation(t)}));return this.delayedOperations.push(i),i},t.prototype.verifyNotFailed=function(){this.failure&&v("AsyncQueue is already failed: "+(this.failure.stack||this.failure.message))},t.prototype.verifyOperationInProgress=function(){g(this.operationInProgress,"verifyOpInProgress() called when no op in progress on this queue.")},t.prototype.drain=function(){return this.enqueue((function(){return Promise.resolve()}))},t.prototype.containsDelayedOperation=function(t){for(var e=0,n=this.delayedOperations;e<n.length;e++)if(n[e].timerId===t)return!0;return!1},t.prototype.runDelayedOperationsEarly=function(t){var e=this;return this.drain().then((function(){g(t===sn.All||e.containsDelayedOperation(t),"Attempted to drain to missing operation "+t),e.delayedOperations.sort((function(t,e){return t.targetTimeMs-e.targetTimeMs}));for(var n=0,r=e.delayedOperations;n<r.length;n++){var i=r[n];if(i.skipDelay(),t!==sn.All&&i.timerId===t)break}return e.drain()}))},t.prototype.removeDelayedOperation=function(t){var e=this.delayedOperations.indexOf(t);g(e>=0,"Delayed operation not found."),this.delayedOperations.splice(e,1)},t}();function fn(t){for(var e="",n=0;n<t.length;n++)e.length>0&&(e=pn(e)),e=dn(t.get(n),e);return pn(e)}function dn(t,e){for(var n=e,r=t.length,i=0;i<r;i++){var o=t.charAt(i);switch(o){case"\0":n+="\x01\x10";break;case"\x01":n+="\x01\x11";break;default:n+=o}}return n}function pn(t){return t+"\x01\x01"}function mn(t){var e=t.length;if(g(e>=2,"Invalid path "+t),2===e)return g("\x01"===t.charAt(0)&&"\x01"===t.charAt(1),"Non-empty path "+t+" had length 2"),rt.EMPTY_PATH;for(var n=e-2,r=[],i="",o=0;o<e;){var a=t.indexOf("\x01",o);switch((a<0||a>n)&&v('Invalid encoded resource path: "'+t+'"'),t.charAt(a+1)){case"\x01":var s=t.substring(o,a),u=void 0;0===i.length?u=s:(u=i+=s,i=""),r.push(u);break;case"\x10":i+=t.substring(o,a),i+="\0";break;case"\x11":i+=t.substring(o,a+1);break;default:v('Invalid encoded resource path: "'+t+'"')}o=a+2}return new rt(r)}var yn=function(){function t(t,e,n){this.batchId=t,this.localWriteTime=e,this.mutations=n,g(n.length>0,"Cannot create an empty mutation batch")}return t.prototype.applyToRemoteDocument=function(t,e,n){e&&g(e.key.isEqual(t),"applyToRemoteDocument: key "+t+" should match maybeDoc key\n        "+e.key);var r=n.mutationResults;g(r.length===this.mutations.length,"Mismatch between mutations length\n      ("+this.mutations.length+") and mutation results length\n      ("+r.length+").");for(var i=0;i<this.mutations.length;i++){var o=this.mutations[i];o.key.isEqual(t)&&(e=o.applyToRemoteDocument(e,r[i]))}return e},t.prototype.applyToLocalView=function(t,e){e&&g(e.key.isEqual(t),"applyToLocalDocument: key "+t+" should match maybeDoc key\n        "+e.key);for(var n=e,r=0;r<this.mutations.length;r++){var i=this.mutations[r];i.key.isEqual(t)&&(e=i.applyToLocalView(e,n,this.localWriteTime))}return e},t.prototype.keys=function(){for(var t=Oe(),e=0,n=this.mutations;e<n.length;e++)t=t.add(n[e].key);return t},t.prototype.isEqual=function(t){return this.batchId===t.batchId&&K(this.mutations,t.mutations)},t}(),vn=function(){function t(t,e,n,r,i){this.batch=t,this.commitVersion=e,this.mutationResults=n,this.streamToken=r,this.docVersions=i}return t.from=function(e,n,r,i){g(e.mutations.length===r.length,"Mutations sent "+e.mutations.length+" must equal results received "+r.length);for(var o=ke(),a=e.mutations,s=0;s<a.length;s++)o=o.insert(a[s].key,r[s].version);return new t(e,n,r,i,o)},t}(),gn=function(t){return t[t.QueryCache=0]="QueryCache",t[t.SyncEngine=1]="SyncEngine",t}({}),bn=function(){function t(t,e){this.generatorId=t,g((1&t)===t,"Generator ID "+t+" c
1ontains more than 1 reserved bits"),this.seek(void 0!==e?e:this.generatorId)}return t.prototype.next=function(){var t=this.nextId;return this.nextId+=2,t},t.prototype.after=function(t){return this.seek(t+2),this.next()},t.prototype.seek=function(t){g((1&t)===this.generatorId,"Cannot supply target ID from different generator ID"),this.nextId=t},t.forQueryCache=function(){return new t(gn.QueryCache,2)},t.forSyncEngine=function(){return new t(gn.SyncEngine)},t}(),wn=function(){function t(t){var e=this;this.nextCallback=null,this.catchCallback=null,this.result=void 0,this.error=void 0,this.isDone=!1,this.callbackAttached=!1,t((function(t){e.isDone=!0,e.result=t,e.nextCallback&&e.nextCallback(t)}),(function(t){e.isDone=!0,e.error=t,e.catchCallback&&e.catchCallback(t)}))}return t.prototype.catch=function(t){return this.next(void 0,t)},t.prototype.next=function(e,n){var r=this;return this.callbackAttached&&v("Called next() or catch() twice for PersistencePromise"),this.callbackAttached=!0,this.isDone?this.error?this.wrapFailure(n,this.error):this.wrapSuccess(e,this.result):new t((function(t,i){r.nextCallback=function(n){r.wrapSuccess(e,n).next(t,i)},r.catchCallback=function(e){r.wrapFailure(n,e).next(t,i)}}))},t.prototype.toPromise=function(){var t=this;return new Promise((function(e,n){t.next(e,n)}))},t.prototype.wrapUserFunction=function(e){try{var n=e();return n instanceof t?n:t.resolve(n)}catch(r){return t.reject(r)}},t.prototype.wrapSuccess=function(e,n){return e?this.wrapUserFunction((function(){return e(n)})):t.resolve(n)},t.prototype.wrapFailure=function(e,n){return e?this.wrapUserFunction((function(){return e(n)})):t.reject(n)},t.resolve=function(e){return new t((function(t,n){t(e)}))},t.reject=function(e){return new t((function(t,n){n(e)}))},t.waitFor=function(e){return new t((function(t,n){var r=0,i=0,o=!1;e.forEach((function(e){++r,e.next((function(){++i,o&&i===r&&t()}),(function(t){return n(t)}))})),o=!0,i===r&&t()}))},t.or=function(e){for(var n=t.resolve(!1),r=function(e){n=n.next((function(n){return n?t.resolve(n):e()}))},i=0,o=e;i<o.length;i++)r(o[i]);return n},t.forEach=function(t,e){var n=this,r=[];return t.forEach((function(t,i){r.push(e.call(n,t,i))})),this.waitFor(r)},t}(),_n=function(){function t(t){this.db=t}return t.openOrCreate=function(e,n,r){return g(t.isAvailable(),"IndexedDB not supported in current environment."),p("SimpleDb","Opening database:",e),new wn((function(i,o){var a=window.indexedDB.open(e,n);a.onsuccess=function(e){i(new t(e.target.result))},a.onblocked=function(){o(new _("failed-precondition","Cannot upgrade IndexedDB schema while another tab is open. Close all tabs that access Firestore and reload this page to proceed."))},a.onerror=function(t){var e=t.target.error;o("VersionError"===e.name?new _("failed-precondition","A newer version of the Firestore SDK was previously used and so the persisted data is not compatible with the version of the SDK you are now using. The SDK will operate with persistence disabled. If you need persistence, please re-upgrade to a newer version of the SDK or else clear the persisted IndexedDB data for your app to start fresh."):e)},a.onupgradeneeded=function(t){p("SimpleDb",'Database "'+e+'" requires upgrade from version:',t.oldVersion);var n=t.target.result,i=new Cn(a.transaction);r.createOrUpgrade(n,i,t.oldVersion,qn).next((function(){p("SimpleDb","Database upgrade to version "+qn+" complete")}))}})).toPromise()},t.delete=function(t){return p("SimpleDb","Removing database:",t),Tn(window.indexedDB.deleteDatabase(t)).toPromise()},t.isAvailable=function(){if("undefined"==typeof window||null==window.indexedDB)return!1;if(void 0===window.navigator)return"YES"===process.env.USE_MOCK_PERSISTENCE;var t=window.navigator.userAgent;return!(t.indexOf("MSIE ")>0||t.indexOf("Trident/")>0||t.indexOf("Edge/")>0)},t.getStore=function(t,e){return t.store(e)},t.prototype.runTransaction=function(t,e,n){var r=Cn.open(this.db,t,e),i=n(r).catch((function(t){return r.abort(t),wn.reject(t)})).toPromise();return r.completionPromise.then((function(){return i}))},t.prototype.close=function(){this.db.close()},t}(),Sn=function(){function t(t){this.dbCursor=t,this.shouldStop=!1,this.nextKey=null}return Object.defineProperty(t.prototype,"isDone",{get:function(){return this.shouldStop},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"skipToKey",{get:function(){return this.nextKey},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"cursor",{set:function(t){this.dbCursor=t},enumerable:!0,configurable:!0}),t.prototype.done=function(){this.shouldStop=!0},t.prototype.skip=function(t){this.nextKey=t},t.prototype.delete=function(){return Tn(this.dbCursor.delete())},t}(),Cn=function(){function t(t){var e=this;this.transaction=t,this.aborted=!1,this.completionDeferred=new cn,this.transaction.oncomplete=function(){e.completionDeferred.resolve()},this.transaction.onabort=function(){t.error?e.completionDeferred.reject(t.error):e.completionDeferred.resolve()},this.transaction.onerror=function(t){e.completionDeferred.reject(t.target.error)}}return t.open=function(e,n,r){return new t(e.transaction(r,n))},Object.defineProperty(t.prototype,"completionPromise",{get:function(){return this.completionDeferred.promise},enumerable:!0,configurable:!0}),t.prototype.abort=function(t){t&&this.completionDeferred.reject(t),this.aborted||(p("SimpleDb","Aborting transaction:",t?t.message:"Client-initiated abort"),this.aborted=!0,this.transaction.abort())},t.prototype.store=function(t){var e=this.transaction.objectStore(t);return g(!!e,"Object store not part of transaction: "+t),new En(e)},t}(),En=function(){function t(t){this.store=t}return t.prototype.put=function(t,e){var n;return void 0!==e?(p("SimpleDb","PUT",this.store.name,t,e),n=this.store.put(e,t)):(p("SimpleDb","PUT",this.store.name,"<auto-key>",t),n=this.store.put(t)),Tn(n)},t.prototype.add=function(t){return p("SimpleDb","ADD",this.store.name,t,t),Tn(this.store.add(t))},t.prototype.get=function(t){var e=this;return Tn(this.store.get(t)).next((function(n){return void 0===n&&(n=null),p("SimpleDb","GET",e.store.name,t,n),n}))},t.prototype.delete=function(t){return p("SimpleDb","DELETE",this.store.name,t),Tn(this.store.delete(t))},t.prototype.count=function(){return p("SimpleDb","COUNT",this.store.name),Tn(this.store.count())},t.prototype.loadAll=function(t,e){var n=this.cursor(this.options(t,e)),r=[];return this.iterateCursor(n,(function(t,e){r.push(e)})).next((function(){return r}))},t.prototype.deleteAll=function(t,e){p("SimpleDb","DELETE ALL",this.store.name);var n=this.options(t,e);n.keysOnly=!1;var r=this.cursor(n);return this.iterateCursor(r,(function(t,e,n){return n.delete()}))},t.prototype.iterate=function(t,e){var n;e?n=t:(n={},e=t);var r=this.cursor(n);return this.iterateCursor(r,e)},t.prototype.iterateSerial=function(t){var e=this.cursor({});return new wn((function(n,r){e.onerror=function(t){r(t.target.error)},e.onsuccess=function(e){var r=e.target.result;r?t(r.primaryKey,r.value).next((function(t){t?r.continue():n()})):n()}}))},t.prototype.iterateCursor=function(t,e){var n=[];return new wn((function(r,i){t.onerror=function(t){i(t.target.error)},t.onsuccess=function(t){var i=t.target.result;if(i){var o=new Sn(i),a=e(i.primaryKey,i.value,o);if(a instanceof wn){var s=a.catch((function(t){return o.done(),wn.reject(t)}));n.push(s)}o.isDone?r():null===o.skipToKey?i.continue():i.continue(o.skipToKey)}else r()}})).next((function(){return wn.waitFor(n)}))},t.prototype.options=function(t,e){var n=void 0;return void 0!==t&&("string"==typeof t?n=t:(g(void 0===e,"3rd argument must not be defined if 2nd is a range."),e=t)),{index:n,range:e}},t.prototype.cursor=function(t){var e="next";if(t.reverse&&(e="prev"),t.index){var n=this.store.index(t.index);return t.keysOnly?n.openKeyCursor(t.range,e):n.openCursor(t.range,e)}return this.store.openCursor(t.range,e)},t}();function Tn(t){return new wn((function(e,n){t.onsuccess=function(t){e(t.target.result)},t.onerror=function(t){n(t.target.error)}}))}var kn=function(){function t(t,e){this.referenceDelegate=t,this.serializer
1=e,this.targetIdGenerator=bn.forQueryCache()}return t.prototype.allocateTargetId=function(t){var e=this;return this.retrieveMetadata(t).next((function(n){return n.highestTargetId=e.targetIdGenerator.after(n.highestTargetId),e.saveMetadata(t,n).next((function(){return n.highestTargetId}))}))},t.prototype.getLastRemoteSnapshotVersion=function(t){return this.retrieveMetadata(t).next((function(t){return Yt.fromTimestamp(new Z(t.lastRemoteSnapshotVersion.seconds,t.lastRemoteSnapshotVersion.nanoseconds))}))},t.prototype.getHighestSequenceNumber=function(t){return xn(t.simpleDbTransaction)},t.prototype.setTargetsMetadata=function(t,e,n){var r=this;return this.retrieveMetadata(t).next((function(i){return i.highestListenSequenceNumber=e,n&&(i.lastRemoteSnapshotVersion=n.toTimestamp()),e>i.highestListenSequenceNumber&&(i.highestListenSequenceNumber=e),r.saveMetadata(t,i)}))},t.prototype.addQueryData=function(t,e){var n=this;return this.saveQueryData(t,e).next((function(){return n.retrieveMetadata(t).next((function(r){return r.targetCount+=1,n.updateMetadataFromQueryData(e,r),n.saveMetadata(t,r)}))}))},t.prototype.updateQueryData=function(t,e){return this.saveQueryData(t,e)},t.prototype.removeQueryData=function(t,e){var n=this;return this.removeMatchingKeysForTargetId(t,e.targetId).next((function(){return In(t).delete(e.targetId)})).next((function(){return n.retrieveMetadata(t)})).next((function(e){return g(e.targetCount>0,"Removing from an empty query cache"),e.targetCount-=1,n.saveMetadata(t,e)}))},t.prototype.removeTargets=function(t,e,n){var r=this,i=0,o=[];return In(t).iterate((function(a,s){var u=r.serializer.fromDbTarget(s);u.sequenceNumber<=e&&void 0===n[u.targetId]&&(i++,o.push(r.removeQueryData(t,u)))})).next((function(){return wn.waitFor(o)})).next((function(){return i}))},t.prototype.forEachTarget=function(t,e){var n=this;return In(t).iterate((function(t,r){var i=n.serializer.fromDbTarget(r);e(i)}))},t.prototype.retrieveMetadata=function(t){return On(t.simpleDbTransaction)},t.prototype.saveMetadata=function(t,e){return(n=t,Cr.getStore(n,tr.store)).put(tr.key,e);var n},t.prototype.saveQueryData=function(t,e){return In(t).put(this.serializer.toDbTarget(e))},t.prototype.updateMetadataFromQueryData=function(t,e){var n=!1;return t.targetId>e.highestTargetId&&(e.highestTargetId=t.targetId,n=!0),t.sequenceNumber>e.highestListenSequenceNumber&&(e.highestListenSequenceNumber=t.sequenceNumber,n=!0),n},t.prototype.getQueryCount=function(t){return this.retrieveMetadata(t).next((function(t){return t.targetCount}))},t.prototype.getQueryData=function(t,e){var n=this,r=e.canonicalId(),i=IDBKeyRange.bound([r,Number.NEGATIVE_INFINITY],[r,Number.POSITIVE_INFINITY]),o=null;return In(t).iterate({range:i,index:Jn.queryTargetsIndexName},(function(t,r,i){var a=n.serializer.fromDbTarget(r);e.isEqual(a.query)&&(o=a,i.done())})).next((function(){return o}))},t.prototype.addMatchingKeys=function(t,e,n){var r=this,i=[],o=An(t);return e.forEach((function(e){var a=fn(e.path);i.push(o.put(new Zn(n,a))),i.push(r.referenceDelegate.addReference(t,e))})),wn.waitFor(i)},t.prototype.removeMatchingKeys=function(t,e,n){var r=this,i=An(t);return wn.forEach(e,(function(e){var o=fn(e.path);return wn.waitFor([i.delete([n,o]),r.referenceDelegate.removeReference(t,e)])}))},t.prototype.removeMatchingKeysForTargetId=function(t,e){var n=An(t),r=IDBKeyRange.bound([e],[e+1],!1,!0);return n.delete(r)},t.prototype.getMatchingKeysForTargetId=function(t,e){var n=IDBKeyRange.bound([e],[e+1],!1,!0),r=An(t),i=Oe();return r.iterate({range:n,keysOnly:!0},(function(t,e,n){var r=mn(t[1]),o=new at(r);i=i.add(o)})).next((function(){return i}))},t.prototype.containsKey=function(t,e){var n,r=fn(e.path),i=IDBKeyRange.bound([r],[(n=r,n+"\0")],!1,!0),o=0;return An(t).iterate({index:Zn.documentTargetsIndex,keysOnly:!0,range:i},(function(t,e,n){0!==t[0]&&(o++,n.done())})).next((function(){return o>0}))},t.prototype.getQueryDataForTarget=function(t,e){var n=this;return In(t).get(e).next((function(t){return t?n.serializer.fromDbTarget(t):null}))},t}();function In(t){return Cr.getStore(t,Jn.store)}function On(t){return _n.getStore(t,tr.store).get(tr.key).next((function(t){return g(null!==t,"Missing metadata row."),t}))}function xn(t){return On(t).next((function(t){return t.highestListenSequenceNumber}))}function An(t){return Cr.getStore(t,Zn.store)}var Pn=function(){function t(t){this.mapKeyFn=t,this.inner={}}return t.prototype.get=function(t){var e=this.mapKeyFn(t),n=this.inner[e];if(void 0!==n)for(var r=0,i=n;r<i.length;r++){var o=i[r],a=o[1];if(o[0].isEqual(t))return a}},t.prototype.has=function(t){return void 0!==this.get(t)},t.prototype.set=function(t,e){var n=this.mapKeyFn(t),r=this.inner[n];if(void 0!==r){for(var i=0;i<r.length;i++)if(r[i][0].isEqual(t))return void(r[i]=[t,e]);r.push([t,e])}else this.inner[n]=[[t,e]]},t.prototype.delete=function(t){var e=this.mapKeyFn(t),n=this.inner[e];if(void 0===n)return!1;for(var r=0;r<n.length;r++)if(n[r][0].isEqual(t))return 1===n.length?delete this.inner[e]:n.splice(r,1),!0;return!1},t.prototype.forEach=function(t){k(this.inner,(function(e,n){for(var r=0,i=n;r<i.length;r++){var o=i[r];t(o[0],o[1])}}))},t.prototype.isEmpty=function(){return I(this.inner)},t}(),Dn=function(){function t(){this.changes=_e(),this.documentSizes=new Pn((function(t){return t.toString()}))}return t.prototype.addEntry=function(t){var e=this.assertChanges();this.changes=e.insert(t.key,t)},t.prototype.getEntry=function(t,e){var n=this,r=this.assertChanges().get(e);return r?wn.resolve(r):this.getFromCache(t,e).next((function(t){return null===t?(n.documentSizes.set(e,0),null):(n.documentSizes.set(e,t.size),t.maybeDocument)}))},t.prototype.getEntries=function(t,e){var n=this;return this.getAllFromCache(t,e).next((function(t){var e=t.maybeDocuments;
1return t.sizeMap.forEach((function(t,e){n.documentSizes.set(t,e)})),e}))},t.prototype.apply=function(t){var e=this.applyChanges(t);return this.changes=null,e},t.prototype.assertChanges=function(){return g(null!==this.changes,"Changes have already been applied."),this.changes},t}(),Rn="The remote document changelog no longer contains all changes for all local query views. It may be necessary to rebuild these views.",Nn=function(){function t(t,e){this.serializer=t,this.keepDocumentChangeLog=e,this._lastProcessedDocumentChangeId=0}return Object.defineProperty(t.prototype,"lastProcessedDocumentChangeId",{get:function(){return this._lastProcessedDocumentChangeId},enumerable:!0,configurable:!0}),t.prototype.start=function(t){var e=_n.getStore(t,nr.store);return this.synchronizeLastDocumentChangeId(e)},t.prototype.addEntries=function(t,e,n){var r=[];if(e.length>0){for(var i=Ln(t),o=Oe(),a=0,s=e;a<s.length;a++){var u=s[a],c=u.key,l=u.doc;r.push(i.put(Un(c),l)),o=o.add(c)}this.keepDocumentChangeLog&&r.push(Fn(t).put({changes:this.serializer.toDbResourcePaths(o)})),r.push(this.updateSize(t,n))}return wn.waitFor(r)},t.prototype.removeEntry=function(t,e){var n=Ln(t),r=Un(e);return n.get(r).next((function(t){return t?n.delete(r).next((function(){return Vn(t)})):wn.resolve(0)}))},t.prototype.getEntry=function(t,e){var n=this;return Ln(t).get(Un(e)).next((function(t){return t?n.serializer.fromDbRemoteDocument(t):null}))},t.prototype.getSizedEntry=function(t,e){var n=this;return Ln(t).get(Un(e)).next((function(t){return t?{maybeDocument:n.serializer.fromDbRemoteDocument(t),size:Vn(t)}:null}))},t.prototype.getEntries=function(t,e){var n=this,r=Se();return this.forEachDbEntry(t,e,(function(t,e){r=r.insert(t,e?n.serializer.fromDbRemoteDocument(e):null)})).next((function(){return r}))},t.prototype.getSizedEntries=function(t,e){var n=this,r=Se(),i=new ht(at.comparator);return this.forEachDbEntry(t,e,(function(t,e){e?(r=r.insert(t,n.serializer.fromDbRemoteDocument(e)),i=i.insert(t,Vn(e))):(r=r.insert(t,null),i=i.insert(t,0))})).next((function(){return{maybeDocuments:r,sizeMap:i}}))},t.prototype.forEachDbEntry=function(t,e,n){if(e.isEmpty())return wn.resolve();var r=IDBKeyRange.bound(e.first().path.toArray(),e.last().path.toArray()),i=e.getIterator(),o=i.getNext();return Ln(t).iterate({range:r},(function(t,e,r){for(var a=at.fromSegments(t);o&&at.comparator(o,a)<0;)n(o,null),o=i.getNext();o&&o.isEqual(a)&&(n(o,e),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}))},t.prototype.getDocumentsMatchingQuery=function(t,e){var n=this,r=Ee(),i=e.path.toArray(),o=IDBKeyRange.lowerBound(i);return Ln(t).iterate({range:o},(function(t,i,o){var a=n.serializer.fromDbRemoteDocument(i);e.path.isPrefixOf(a.key.path)?a instanceof ut&&e.matches(a)&&(r=r.
1insert(a.key,a)):o.done()})).next((function(){return r}))},t.prototype.getNewDocumentChanges=function(t){var e=this;g(this.keepDocumentChangeLog,"Can only call getNewDocumentChanges() when document change log is enabled");var n=Oe(),r=_e(),i=IDBKeyRange.lowerBound(this._lastProcessedDocumentChangeId+1),o=!0,a=Fn(t);return a.iterate({range:i},(function(t,r){if(o&&(o=!1,e._lastProcessedDocumentChangeId+1!==r.id))return e.synchronizeLastDocumentChangeId(a).next((function(){return wn.reject(new _("data-loss",Rn))}));n=n.unionWith(e.serializer.fromDbResourcePaths(r.changes)),e._lastProcessedDocumentChangeId=r.id})).next((function(){var i=[];return n.forEach((function(n){i.push(e.getEntry(t,n).next((function(t){var e=t||new ct(n,Yt.forDeletedDoc());r=r.insert(n,e)})))})),wn.waitFor(i)})).next((function(){return r}))},t.prototype.removeDocumentChangesThroughChangeId=function(t,e){var n=IDBKeyRange.upperBound(e);return Fn(t).delete(n)},t.prototype.synchronizeLastDocumentChangeId=function(t){var e=this;return this._lastProcessedDocumentChangeId=0,t.iterate({keysOnly:!0,reverse:!0},(function(t,n,r){e._lastProcessedDocumentChangeId=t,r.done()}))},t.prototype.newChangeBuffer=function(){return new Mn(this)},t.prototype.getSize=function(t){return this.getMetadata(t).next((function(t){return t.byteSize}))},t.prototype.getMetadata=function(t){return jn(t).get(Xn.key).next((function(t){return g(!!t,"Missing document cache metadata"),t}))},t.prototype.setMetadata=function(t,e){return jn(t).put(Xn.key,e)},t.prototype.updateSize=function(t,e){var n=this;return this.getMetadata(t).next((function(r){return r.byteSize+=e,n.setMetadata(t,r)}))},t}();function jn(t){return Cr.getStore(t,Xn.store)}var Mn=function(t){function e(e){var n=t.call(this)||this;return n.documentCache=e,n}return a.__extends(e,t),e.prototype.applyChanges=function(t){var e=this,n=this.assertChanges(),r=0,i=[];return n.forEach((function(t,n){var o=e.documentCache.serializer.toDbRemoteDocument(n),a=e.documentSizes.get(t);g(void 0!==a,"Attempting to change document "+t.toString()+" without having read it first");var s=Vn(o);r+=s-a,i.push({key:t,doc:o})})),this.documentCache.addEntries(t,i,r)},e.prototype.getFromCache=function(t,e){return this.documentCache.getSizedEntry(t,e)},e.prototype.getAllFromCache=function(t,e){return this.documentCache.getSizedEntries(t,e)},e}(Dn);function Ln(t){return Cr.getStore(t,Yn.store)}function Fn(t){return Cr.getStore(t,nr.store)}function Un(t){return t.path.toArray()}function Vn(t){var e;if(t.document)e=t.document;else if(t.unknownDocument)e=t.unknownDocument;else{if(!t.noDocument)throw v("Unknown remote document type");e=t.noDocument}return JSON.stringify(e).length}var qn=7,Bn=function(){function t(t){this.serializer=t}return t.prototype.createOrUpgrade=function(t,e,n,r){var i=this;g(n<r&&n>=0&&r<=qn,"Unexpected schema upgrade from v"+n+" to v{toVersion}."),n<1&&r>=1&&(function(t){t.createObjectStore(zn.store)}(t),function(t){t.createObjectStore(Hn.store,{keyPath:Hn.keyPath}),t.createObjectStore($n.store,{keyPath:$n.keyPath,autoIncrement:!0}).createIndex($n.userMutationsIndex,$n.userMutationsKeyPath,{unique:!0}),t.createObjectStore(Kn.store)}(t),er(t),function(t){t.createObjectStore(Yn.store)}(t));var o=wn.resolve();return n<3&&r>=3&&(0!==n&&(function(t){t.deleteObjectStore(Zn.store),t.deleteObjectStore(Jn.store),t.deleteObjectStore(tr.store)}(t),er(t)),o=o.next((function(){return function(t){var e=t.store(tr.store),n=new tr(0,0,Yt.MIN.toTimestamp(),0);return e.put(tr.key,n)}(e)}))),n<4&&r>=4&&(0!==n&&(o=o.next((function(){return function(t,e){return e.store($n.store).loadAll().next((function(n){t.deleteObjectStore($n.store),t.createObjectStore($n.store,{keyPath:$n.keyPath,autoIncrement:!0}).createIndex($n.userMutationsIndex,$n.userMutationsKeyPath,{unique:!0});var r=e.store($n.store),i=n.map((function(t){return r.put(t)}));return wn.waitFor(i)}))}(t,e)}))),o=o.next((function(){!function(t){t.createObjectStore(rr.store,{keyPath:rr.keyPath})}(t),function(t){t.createObjectStore(nr.store,{keyPath:"id",autoIncrement:!0})}(t)}))),n<5&&r>=5&&(o=o.next((function(){return i.removeAcknowledgedMutations(e)}))),n<6&&r>=6&&(o=o.next((function(){return function(t){t.createObjectStore(Xn.store)}(t),i.addDocumentGlobal(e)}))),n<7&&r>=7&&(o=o.next((function(){return i.ensureSequenceNumbers(e)}))),o},t.prototype.addDocumentGlobal=function(t){var e=0;return t.store(Yn.store).iterate((function(t,n){e+=Vn(n)})).next((function(){var n=new Xn(e);return t.store(Xn.store).put(Xn.key,n)}))},t.prototype.removeAcknowledgedMutations=function(t){var e=this,n=t.store(Hn.store),r=t.store($n.store);return n.loadAll().next((function(n){return wn.forEach(n,(function(n){var i=IDBKeyRange.bound([n.userId,-1],[n.userId,n.lastAcknowledgedBatchId]);return r.loadAll($n.userMutationsIndex,i).next((function(r){return wn.forEach(r,(function(r){g(r.userId===n.userId,"Cannot process batch "+r.batchId+" from unexpected user");var i=e.serializer.fromDbMutationBatch(r);return sr(t,n.userId,i).next((function(){}))}))}))}))}))},t.prototype.ensureSequenceNumbers=function(t){var e=t.store(Zn.store),n=t.store(Yn.store);return xn(t).next((function(t){var r=[];return n.iterate((function(n,i){var o=new rt(n),a=function(t){return[0,fn(t)]}(o);r.push(e.get(a).next((function(n){return n?wn.resolve():function(n){return e.put(new Zn(0,fn(n),t))}(o)})))})).next((function(){return wn.waitFor(r)}))}))},t}(),Wn=function(){return function(t,e){this.seconds=t,this.nanoseconds=e}}(),zn=function(){function t(t,e,n){this.ownerId=t,this.allowTabSynchronization=e,this.leaseTimestampMs=n}return t.store="owner",t.key="owner",t}(),Hn=function(){function t(t,e,n){this.userId=t,this.lastAcknowledgedBatchId=e,this.lastStreamToken=n}
1return t.store="mutationQueues",t.keyPath="userId",t}(),$n=function(){function t(t,e,n,r){this.userId=t,this.batchId=e,this.localWriteTimeMs=n,this.mutations=r}return t.store="mutations",t.keyPath="batchId",t.userMutationsIndex="userMutationsIndex",t.userMutationsKeyPath=["userId","batchId"],t}(),Kn=function(){function t(){}return t.prefixForUser=function(t){return[t]},t.prefixForPath=function(t,e){return[t,fn(e)]},t.key=function(t,e,n){return[t,fn(e),n]},t.store="documentMutations",t.PLACEHOLDER=new t,t}(),Gn=function(){return function(t,e){this.path=t,this.readTime=e}}(),Qn=function(){return function(t,e){this.path=t,this.version=e}}(),Yn=function(){function t(t,e,n,r){this.unknownDocument=t,this.noDocument=e,this.document=n,this.hasCommittedMutations=r}return t.store="remoteDocuments",t}(),Xn=function(){function t(t){this.byteSize=t}return t.store="remoteDocumentGlobal",t.key="remoteDocumentGlobalKey",t}(),Jn=function(){function t(t,e,n,r,i,o){this.targetId=t,this.canonicalId=e,this.readTime=n,this.resumeToken=r,this.lastListenSequenceNumber=i,this.query=o}return t.store="targets",t.keyPath="targetId",t.queryTargetsIndexName="queryTargetsIndex",t.queryTargetsKeyPath=["canonicalId","targetId"],t}(),Zn=function(){function t(t,e,n){this.targetId=t,this.path=e,this.sequenceNumber=n,g(0===t==(void 0!==n),"A target-document row must either have targetId == 0 and a defined sequence number, or a non-zero targetId and no sequence number")}return t.store="targetDocuments",t.keyPath=["targetId","path"],t.documentTargetsIndex="documentTargetsIndex",t.documentTargetsKeyPath=["path","targetId"],t}(),tr=function(){function t(t,e,n,r){this.highestTargetId=t,this.highestListenSequenceNumber=e,this.lastRemoteSnapshotVersion=n,this.targetCount=r}return t.key="targetGlobalKey",t.store="targetGlobal",t}();function er(t){t.createObjectStore(Zn.store,{keyPath:Zn.keyPath}).createIndex(Zn.documentTargetsIndex,Zn.documentTargetsKeyPath,{unique:!0}),t.createObjectStore(Jn.store,{keyPath:Jn.keyPath}).createIndex(Jn.queryTargetsIndexName,Jn.queryTargetsKeyPath,{unique:!0}),t.createObjectStore(tr.store)}var nr=function(){function t(t){this.changes=t}return t.store="remoteDocumentChanges",t.keyPath="id",t}(),rr=function(){function t(t,e,n,r,i){this.clientId=t,this.updateTimeMs=e,this.networkEnabled=n,this.inForeground=r,this.lastProcessedDocumentChangeId=i}return t.store="clientMetadata",t.keyPath="clientId",t}(),ir=[Hn.store,$n.store,Kn.store,Yn.store,Jn.store,zn.store,tr.store,Zn.store].concat([rr.store,nr.store]).concat([Xn.store]),or=function(){function t(t,e,n){this.userId=t,this.serializer=e,this.referenceDelegate=n,this.documentKeysByBatchId={}}return t.forUser=function(e,n,r){return g(""!==e.uid,"UserID must not be an empty string."),new t(e.isAuthenticated()?e.uid:"",n,r)},t.prototype.checkEmpty=function(t){var e=!0,n=IDBKeyRange.bound([this.userId,Number.NEGATIVE_INFINITY],[this.userId,Number.POSITIVE_INFINITY]);return cr(t).iterate({index:$n.userMutationsIndex,range:n},(function(t,n,r){e=!1,r.done()})).next((function(){return e}))},t.prototype.acknowledgeBatch=function(t,e,n){return this.getMutationQueueMetadata(t).next((function(e){return e.lastStreamToken=ur(n),hr(t).put(e)}))},t.prototype.getLastStreamToken=function(t){return this.getMutationQueueMetadata(t).next((function(t){return t.lastStreamToken}))},t.prototype.setLastStreamToken=function(t,e){return this.getMutationQueueMetadata(t).next((function(n){return n.lastStreamToken=ur(e),hr(t).put(n)}))},t.prototype.addMutationBatch=function(t,e,n){var r=this,i=lr(t),o=cr(t);return o.add({}).next((function(t){g("number"==typeof t,"Auto-generated key is not a number");var a=new yn(t,e,n),s=r.serializer.toDbMutationBatch(r.userId,a);r.documentKeysByBatchId[t]=a.keys();for(var u=[],c=0,l=n;c<l.length;c++){var h=Kn.key(r.userId,l[c].key.path,t);u.push(o.put(s)),u.push(i.put(h,Kn.PLACEHOLDER))}return wn.waitFor(u).next((function(){return a}))}))},t.prototype.lookupMutationBatch=function(t,e){var n=this;return cr(t).get(e).next((function(t){return t?(g(t.userId===n.userId,"Unexpected user '"+t.userId+"' for mutation batch "+e),n.serializer.fromDbMutationBatch(t)):null}))},t.prototype.lookupMutationKeys=function(t,e){var n=this;return this.documentKeysByBatchId[e]?wn.resolve(this.documentKeysByBatchId[e]):this.lookupMutationBatch(t,e).next((function(t){if(t){var r=t.keys();return n.documentKeysByBatchId[e]=r,r}return null}))},t.prototype.getNextMutationBatchAfterBatchId=function(t,e){var n=this;return this.getMutationQueueMetadata(t).next((function(r){var i=e+1,o=IDBKeyRange.lowerBound([n.userId,i]),a=null;return cr(t).iterate({index:$n.userMutationsIndex,range:o},(function(t,e,r){e.userId===n.userId&&(g(e.batchId>=i,"Should have found mutation after "+i),a=n.serializer.fromDbMutationBatch(e)),r.done()})).next((function(){return a}))}))},t.prototype.getAllMutationBatches=function(t){var e=this,n=IDBKeyRange.bound([this.userId,-1],[this.userId,Number.POSITIVE_INFINITY]);return cr(t).loadAll($n.userMutationsIndex,n).next((function(t){return t.map((function(t){return e.serializer.fromDbMutationBatch(t)}))}))},t.prototype.getAllMutationBatchesAffectingDocumentKey=function(t,e){var n=this,r=Kn.prefixForPath(this.userId,e.path),i=IDBKeyRange.lowerBound(r),o=[];return lr(t).iterate({range:i},(function(r,i,a){var s=r[0],u=r[2],c=mn(r[1]);if(s===n.userId&&e.path.isEqual(c))return cr(t).get(u).next((function(t){if(!t)throw v("Dangling document-mutation reference found: "+r+" which points to "+u);g(t.userId===n.userId,"Unexpected user '"+t.userId+"' for mutation batch "+u),o.push(n.serializer.fromDbMutationBatch(t))}));a.done()})).next((function(){return o}
1))},t.prototype.getAllMutationBatchesAffectingDocumentKeys=function(t,e){var n=this,r=new Zt($),i=[];return e.forEach((function(e){var o=Kn.prefixForPath(n.userId,e.path),a=IDBKeyRange.lowerBound(o),s=lr(t).iterate({range:a},(function(t,i,o){var a=t[0],s=t[2],u=mn(t[1]);a===n.userId&&e.path.isEqual(u)?r=r.add(s):o.done()}));i.push(s)})),wn.waitFor(i).next((function(){return n.lookupMutationBatches(t,r)}))},t.prototype.getAllMutationBatchesAffectingQuery=function(t,e){var n=this;g(!e.isDocumentQuery(),"Document queries shouldn't go down this path");var r=e.path,i=r.length+1,o=Kn.prefixForPath(this.userId,r),a=IDBKeyRange.lowerBound(o),s=new Zt($);return lr(t).iterate({range:a},(function(t,e,o){var a=t[0],u=t[2],c=mn(t[1]);a===n.userId&&r.isPrefixOf(c)?c.length===i&&(s=s.add(u)):o.done()})).next((function(){return n.lookupMutationBatches(t,s)}))},t.prototype.lookupMutationBatches=function(t,e){var n=this,r=[],i=[];return e.forEach((function(e){i.push(cr(t).get(e).next((function(t){if(null===t)throw v("Dangling document-mutation reference found, which points to "+e);g(t.userId===n.userId,"Unexpected user '"+t.userId+"' for mutation batch "+e),r.push(n.serializer.fromDbMutationBatch(t))})))})),wn.waitFor(i).next((function(){return r}))},t.prototype.removeMutationBatch=function(t,e){var n=this;return sr(t.simpleDbTransaction,this.userId,e).next((function(r){return n.removeCachedMutationKeys(e.batchId),wn.forEach(r,(function(e){return n.referenceDelegate.removeMutationReference(t,e)}))}))},t.prototype.removeCachedMutationKeys=function(t){delete this.documentKeysByBatchId[t]},t.prototype.performConsistencyCheck=function(t){var e=this;return this.checkEmpty(t).next((function(n){if(!n)return wn.resolve();var r=IDBKeyRange.lowerBound(Kn.prefixForUser(e.userId)),i=[];return lr(t).iterate({range:r},(function(t,n,r){if(t[0]===e.userId){var o=mn(t[1]);i.push(o)}else r.done()})).next((function(){g(0===i.length,"Document leak -- detected dangling mutation references when queue is empty. Dangling keys: "+i.map((function(t){return t.canonicalString()})))}))}))},t.prototype.containsKey=function(t,e){return ar(t,this.userId,e)},t.prototype.getMutationQueueMetadata=function(t){var e=this;return hr(t).get(this.userId).next((function(t){return t||new Hn(e.userId,-1,"")}))},t}();function ar(t,e,n){var r=Kn.prefixForPath(e,n.path),i=r[1],o=IDBKeyRange.lowerBound(r),a=!1;return lr(t).iterate({range:o,keysOnly:!0},(function(t,n,r){t[0]===e&&t[1]===i&&(a=!0),r.done()})).next((function(){return a}))}function sr(t,e,n){var r=t.store($n.store),i=t.store(Kn.store),o=[],a=IDBKeyRange.only(n.batchId),s=0,u=r.iterate({range:a},(function(t,e,n){return s++,n.delete()}));o.push(u.next((function(){g(1===s,"Dangling document-mutation reference found: Missing batch "+n.batchId)})));for(var c=[],l=0,h=n.mutations;l<h.length;l++){var f=h[l],d=Kn.key(e,f.key.path,n.batchId);o.push(i.delete(d)),c.push(f.key)}return wn.waitFor(o).next((function(){return c}))}function ur(t){return t instanceof Uint8Array?(g("YES"===process.env.USE_MOCK_PERSISTENCE,"Persisting non-string stream tokens is only supported with mock persistence."),t.toString()):t}function cr(t){return Cr.getStore(t,$n.store)}function lr(t){return Cr.getStore(t,Kn.store)}function hr(t){return Cr.getStore(t,Hn.store)}var fr=function(){function t(t){this.remoteSerializer=t}return t.prototype.fromDbRemoteDocument=function(t){if(t.document)return this.remoteSerializer.fromDocument(t.document,!!t.hasCommittedMutations);if(t.noDocument){var e=at.fromSegments(t.noDocument.path),n=this.fromDbTimestamp(t.noDocument.readTime);return new ct(e,n,{hasCommittedMutations:!!t.hasCommittedMutations})}return t.unknownDocument?(e=at.fromSegments(t.unknownDocument.path),n=this.fromDbTimestamp(t.unknownDocument.version),new lt(e,n)):v("Unexpected DbRemoteDocument")},t.prototype.toDbRemoteDocument=function(t){if(t instanceof ut){var e=t.proto?t.proto:this.remoteSerializer.toDocument(t);return new Yn(null,null,e,i=t.hasCommittedMutations)}if(t instanceof ct){var n=t.key.path.toArray(),r=this.toDbTimestamp(t.version),i=t.hasCommittedMutations;return new Yn(null,new Gn(n,r),null,i)}return t instanceof lt?(n=t.key.path.toArray(),r=this.toDbTimestamp(t.version),new Yn(new Qn(n,r),null,null,!0)):v("Unexpected MaybeDocumment")},t.prototype.toDbTimestamp=function(t){var e=t.toTimestamp();return new Wn(e.seconds,e.nanoseconds)},t.prototype.fromDbTimestamp=function(t){var e=new Z(t.seconds,t.nanoseconds);return Yt.fromTimestamp(e)},t.prototype.toDbMutationBatch=function(t,e){var n=this,r=e.mutations.map((function(t){return n.remoteSeri
1alizer.toMutation(t)}));return new $n(t,e.batchId,e.localWriteTime.toMillis(),r)},t.prototype.fromDbMutationBatch=function(t){var e=this,n=t.mutations.map((function(t){return e.remoteSerializer.fromMutation(t)})),r=Z.fromMillis(t.localWriteTimeMs);return new yn(t.batchId,r,n)},t.prototype.toDbResourcePaths=function(t){var e=[];return t.forEach((function(t){e.push(fn(t.path))})),e},t.prototype.fromDbResourcePaths=function(t){for(var e=Oe(),n=0,r=t;n<r.length;n++)e=e.add(new at(mn(r[n])));return e},t.prototype.fromDbTarget=function(t){var e,n=this.fromDbTimestamp(t.readTime);return e=void 0!==t.query.documents?this.remoteSerializer.fromDocumentsTarget(t.query):this.remoteSerializer.fromQueryTarget(t.query),new Jt(e,t.targetId,Xt.Listen,t.lastListenSequenceNumber,n,t.resumeToken)},t.prototype.toDbTarget=function(t){g(Xt.Listen===t.purpose,"Only queries with purpose "+Xt.Listen+" may be stored, got "+t.purpose);var e,n,r=this.toDbTimestamp(t.snapshotVersion);return e=t.query.isDocumentQuery()?this.remoteSerializer.toDocumentsTarget(t.query):this.remoteSerializer.toQueryTarget(t.query),t.resumeToken instanceof Uint8Array?(g("YES"===process.env.USE_MOCK_PERSISTENCE,"Persisting non-string stream tokens is only supported with mock persistence ."),n=t.resumeToken.toString()):n=t.resumeToken,new Jn(t.targetId,t.query.canonicalId(),r,n,t.sequenceNumber,e)},t}();function dr(t,e){var n=t[1],r=e[1],i=$(t[0],e[0]);return 0===i?$(n,r):i}var pr=function(){function t(t){this.maxElements=t,this.buffer=new Zt(dr),this.previousIndex=0}return t.prototype.nextIndex=function(){return++this.previousIndex},t.prototype.addElement=function(t){var e=[t,this.nextIndex()];if(this.buffer.size<this.maxElements)this.buffer=this.buffer.add(e);else{var n=this.buffer.last();dr(e,n)<0&&(this.buffer=this.buffer.delete(n).add(e))}},Object.defineProperty(t.prototype,"maxValue",{get:function(){return this.buffer.last()[0]},enumerable:!0,configurable:!0}),t}(),mr={didRun:!1,sequenceNumbersCollected:0,targetsRemoved:0,documentsRemoved:0},yr=function(){function t(t,e,n){this.cacheSizeCollectionThreshold=t,this.percentileToCollect=e,this.maximumSequenceNumbersToCollect=n}return t.withCacheSize=function(e){return new t(e,t.DEFAULT_COLLECTION_PERCENTILE,t.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT)},t.COLLECTION_DISABLED=-1,t.MINIMUM_CACHE_SIZE_BYTES=1048576,t.DEFAULT=new t(t.DEFAULT_CACHE_SIZE_BYTES=41943040,t.DEFAULT_COLLECTION_PERCENTILE=10,t.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT=1e3),t.DISABLED=new t(t.COLLECTION_DISABLED,0,0),t}(),vr=function(){function t(t,e,n){this.garbageCollector=t,this.asyncQueue=e,this.localStore=n,this.gcTask=null}return t.prototype.start=function(){g(null===this.gcTask,"Cannot start an already started LruScheduler"),this.garbageCollector.params.cacheSizeCollectionThreshold!==yr.COLLECTION_DISABLED&&this.scheduleGC()},t.prototype.stop=function(){this.gcTask&&(this.gcTask.cancel(),this.gcTask=null)},Object.defineProperty(t.prototype,"started",{get:function(){return null!==this.gcTask},enumerable:!0,configurable:!0}),t.prototype.scheduleGC=function(){var t=this;g(null===this.gcTask,"Cannot schedule GC while a task is pending");var e=this.hasRun?3e5:6e4;p("LruGarbageCollector","Garbage collection scheduled in "+e+"ms"),this.gcTask=this.asyncQueue.enqueueAfterDelay(sn.LruGarbageCollection,e,(function(){return t.gcTask=null,t.hasRun=!0,t.localStore.collectGarbage(t.garbageCollector).then((function(){return t.scheduleGC()})).catch(Er)}))},t}(),gr=function(){function t(t,e){this.delegate=t,this.params=e}return t.prototype.calculateTargetCount=function(t,e){return this.delegate.getSequenceNumberCount(t).next((function(t){return Math.floor(e/100*t)}))},t.prototype.nthSequenceNumber=function(t,e){var n=this;if(0===e)return wn.resolve(un.INVALID);var r=new pr(e);return this.delegate.forEachTarget(t,(function(t){return r.addElement(t.sequenceNumber)})).next((function(){return n.delegate.forEachOrphanedDocumentSequenceNumber(t,(function(t){return r.addElement(t)}))})).next((function(){return r.maxValue}))},t.prototype.removeTargets=function(t,e,n){return this.delegate.removeTargets(t,e,n)},t.prototype.removeOrphanedDocuments=function(t,e){return this.delegate.removeOrphanedDocuments(t,e)},t.prototype.collect=function(t,e){var n=this;return this.params.cacheSizeCollectionThreshold===yr.COLLECTION_DISABLED?(p("LruGarbageCollector","Garbage collection skipped; disabled"),wn.resolve(mr)):this.getCacheSize(t).next((function(r){return r<n.params.cacheSizeCollectionThreshold?(p("LruGarbageCollector","Garbage collection skipped; Cache size "+r+" is lower than threshold "+n.params.cacheSizeCollectionThreshold),mr):n.runGarbageCollection(t,e)}))},t.prototype.getCacheSize=function(t){return this.delegate.getCacheSize(t)}
1,t.prototype.runGarbageCollection=function(t,e){var n,r,i,o,a,s,u,c,l=this;return o=Date.now(),this.calculateTargetCount(t,this.params.percentileToCollect).next((function(e){return e>l.params.maximumSequenceNumbersToCollect?(p("LruGarbageCollector","Capping sequence numbers to collect down to the maximum of "+l.params.maximumSequenceNumbersToCollect+" from "+e),r=l.params.maximumSequenceNumbersToCollect):r=e,a=Date.now(),l.nthSequenceNumber(t,r)})).next((function(r){return n=r,s=Date.now(),l.removeTargets(t,n,e)})).next((function(e){return i=e,u=Date.now(),l.removeOrphanedDocuments(t,n)})).next((function(t){return c=Date.now(),f()<=h.DEBUG&&p("LruGarbageCollector","LRU Garbage Collection\n\tCounted targets in "+(a-o)+"ms\n\tDetermined least recently used "+r+" in "+(s-a)+"ms\n\tRemoved "+i+" targets in "+(u-s)+"ms\n\tRemoved "+t+" documents in "+(c-u)+"ms\nTotal Duration: "+(c-o)+"ms"),wn.resolve({didRun:!0,sequenceNumbersCollected:r,targetsRemoved:i,documentsRemoved:t})}))},t}(),br="IndexedDbPersistence",wr="The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.",_r="Another tab has exclusive access to the persistence layer. To allow shared access, make sure to invoke `enablePersistence()` with `experimentalTabSynchronization:true` in all tabs.",Sr=function(t){function e(e,n){var r=t.call(this)||this;return r.simpleDbTransaction=e,r.currentSequenceNumber=n,r}return a.__extends(e,t),e}(function(){return function(){}}
1()),Cr=function(){function t(e,n,r,i,o,a,s){if(this.persistenceKey=e,this.clientId=n,this.queue=i,this.multiClientParams=s,this._started=!1,this.isPrimary=!1,this.networkEnabled=!0,this.inForeground=!1,this.lastGarbageCollectionTime=Number.NEGATIVE_INFINITY,this.primaryStateListener=function(t){return Promise.resolve()},!t.isAvailable())throw new _("unimplemented","This platform is either missing IndexedDB or is known to have an incomplete implementation. Offline persistence has been disabled.");if(this.referenceDelegate=new Ir(this,a),this.dbName=e+t.MAIN_DATABASE,this.serializer=new fr(o),this.document=r.document,this.allowTabSynchronization=void 0!==s,this.queryCache=new kn(this.referenceDelegate,this.serializer),this.remoteDocumentCache=new Nn(this.serializer,this.allowTabSynchronization),!r.window||!r.window.localStorage)throw new _("unimplemented","IndexedDB persistence is only available on platforms that support LocalStorage.");this.window=r.window,this.webStorage=this.window.localStorage}return t.getStore=function(t,e){if(t instanceof Sr)return _n.getStore(t.simpleDbTransaction,e);throw v("IndexedDbPersistence must use instances of IndexedDbTransaction")},t.createIndexedDbPersistence=function(e,n,r,i,o,s){return a.__awaiter(this,void 0,void 0,(function(){var u;return a.__generator(this,(function(a){switch(a.label){case 0:return[4,(u=new t(e,n,r,i,o,s)).start()];case 1:return a.sent(),[2,u]}}))}))},t.createMultiClientIndexedDbPersistence=function(e,n,r,i,o,s,u){return a.__awaiter(this,void 0,void 0,(function(){var c;return a.__generator(this,(function(a){switch(a.label){case 0:return[4,(c=new t(e,n,r,i,o,s,u)).start()];case 1:return a.sent(),[2,c]}}))}))},t.prototype.start=function(){var t=this;return g(!this.started,"IndexedDbPersistence double-started!"),g(null!==this.window,"Expected 'window' to be defined"),_n.openOrCreate(this.dbName,qn,new Bn(this.serializer)).then((function(e){t.simpleDb=e})).then((function(){return t.startRemoteDocumentCache()})).then((function(){return t.attachVisibilityHandler(),t.attachWindowUnloadHook(),t.updateClientMetadataAndTryBecomePrimary().then((function(){return t.scheduleClientMetadataAndPrimaryLeaseRefreshes()}))})).then((function(){return t.simpleDb.runTransaction("readonly",[tr.store],(function(e){return xn(e).next((function(e){t.listenSequence=new un(e,t.multiClientParams?t.multiClientParams.sequenceNumberSyncer:void 0)}))}))})).then((function(){t._started=!0})).catch((function(e){return t.simpleDb&&t.simpleDb.close(),Promise.reject(e)}))},t.prototype.startRemoteDocumentCache=function(){var t=this;return this.simpleDb.runTransaction("readonly",ir,(function(e){return t.remoteDocumentCache.start(e)}))},t.prototype.setPrimaryStateListener=function(t){var e=this;return this.primaryStateListener=function(n){return a.__awaiter(e,void 0,void 0,(function(){return a.__generator(this,(function(e){return this.started?[2,t(n)]:[2]}))}))},t(this.isPrimary)},t.prototype.setNetworkEnabled=function(t){var e=this;this.networkEnabled!==t&&(this.networkEnabled=t,this.queue.enqueueAndForget((function(){return a.__awaiter(e,void 0,void 0,(function(){return a.__generator(this,(function(t){switch(t.label){case 0:return this.started?[4,this.updateClientMetadataAndTryBecomePrimary()]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}}
1))}))})))},t.prototype.updateClientMetadataAndTryBecomePrimary=function(){var t=this;return this.simpleDb.runTransaction("readwrite",ir,(function(e){return kr(e).put(new rr(t.clientId,Date.now(),t.networkEnabled,t.inForeground,t.remoteDocumentCache.lastProcessedDocumentChangeId)).next((function(){if(t.isPrimary)return t.verifyPrimaryLease(e).next((function(e){e||(t.isPrimary=!1,t.queue.enqueueAndForget((function(){return t.primaryStateListener(!1)})))}))})).next((function(){return t.canActAsPrimary(e)})).next((function(n){var r=t.isPrimary;return t.isPrimary=n,r!==t.isPrimary&&t.queue.enqueueAndForget((function(){return t.primaryStateListener(t.isPrimary)})),r&&!t.isPrimary?t.releasePrimaryLeaseIfHeld(e):t.isPrimary?t.acquireOrExtendPrimaryLease(e):void 0}))}))},t.prototype.verifyPrimaryLease=function(t){var e=this;return Tr(t).get(zn.key).next((function(t){return wn.resolve(e.isLocalClient(t))}))},t.prototype.removeClientMetadata=function(t){return kr(t).delete(this.clientId)},t.prototype.maybeGarbageCollectMultiClientState=function(){return a.__awaiter(this,void 0,void 0,(function(){var e,n,r=this;return a.__generator(this,(function(i){switch(i.label){case 0:return!this.isPrimary||this.isWithinAge(this.lastGarbageCollectionTime,18e5)?[3,2]:(this.lastGarbageCollectionTime=Date.now(),n=[],[4,this.runTransaction("maybeGarbageCollectMultiClientState","readwrite-primary",(function(i){var o=t.getStore(i,rr.store);return o.loadAll().next((function(t){e=r.filterActiveClients(t,18e5),n=t.filter((function(t){return-1===e.indexOf(t)}))})).next((function(){return wn.forEach(n,(function(t){return o.delete(t.clientId)}))})).next((function(){if((e=e.filter((function(t){return t.clientId!==r.clientId}))).length>0){var t=e.map((function(t){return t.lastProcessedDocumentChangeId||0})),n=Math.min.apply(Math,t);return r.remoteDocumentCache.removeDocumentChangesThroughChangeId(i,n)}}))}))]);case 1:i.sent(),n.forEach((function(t){r.window.localStorage.removeItem(r.zombiedClientLocalStorageKey(t.clientId))})),i.label=2;case 2:return[2]}}
1))}))},t.prototype.scheduleClientMetadataAndPrimaryLeaseRefreshes=function(){var t=this;this.clientMetadataRefresher=this.queue.enqueueAfterDelay(sn.ClientMetadataRefresh,4e3,(function(){return t.updateClientMetadataAndTryBecomePrimary().then((function(){return t.maybeGarbageCollectMultiClientState()})).then((function(){return t.scheduleClientMetadataAndPrimaryLeaseRefreshes()}))}))},t.prototype.isLocalClient=function(t){return!!t&&t.ownerId===this.clientId},t.prototype.canActAsPrimary=function(t){var e=this;return Tr(t).get(zn.key).next((function(n){if(null!==n&&e.isWithinAge(n.leaseTimestampMs,5e3)&&!e.isClientZombied(n.ownerId)){if(e.isLocalClient(n)&&e.networkEnabled)return!0;if(!e.isLocalClient(n)){if(!n.allowTabSynchronization)throw new _("failed-precondition",_r);return!1}}return!(!e.networkEnabled||!e.inForeground)||kr(t).loadAll().next((function(t){return void 0===e.filterActiveClients(t,5e3).find((function(t){return!(e.clientId===t.clientId||!(!e.networkEnabled&&t.networkEnabled||!e.inForeground&&t.inForeground&&e.networkEnabled===t.networkEnabled))}))}))})).next((function(t){return e.isPrimary!==t&&p(br,"Client "+(t?"is":"is not")+" eligible for a primary lease."),t}))},t.prototype.shutdown=function(t){return a.__awaiter(this,void 0,void 0,(function(){var e=this;return a.__generator(this,(function(n){switch(n.label){case 0:return this._started=!1,this.markClientZombied(),this.clientMetadataRefresher&&this.clientMetadataRefresher.cancel(),this.detachVisibilityHandler(),this.detachWindowUnloadHook(),[4,this.simpleDb.runTransaction("readwrite",[zn.store,rr.store],(function(t){return e.releasePrimaryLeaseIfHeld(t).next((function(){return e.removeClientMetadata(t)}))}))];case 1:return n.sent(),this.simpleDb.close(),this.removeClientZombiedEntry(),t?[4,_n.delete(this.dbName)]:[3,3];case 2:n.sent(),n.label=3;case 3:return[2]}}
1))}))},t.prototype.filterActiveClients=function(t,e){var n=this;return t.filter((function(t){return n.isWithinAge(t.updateTimeMs,e)&&!n.isClientZombied(t.clientId)}))},t.prototype.getActiveClients=function(){var t=this;return this.simpleDb.runTransaction("readonly",[rr.store],(function(e){return kr(e).loadAll().next((function(e){return t.filterActiveClients(e,18e5).map((function(t){return t.clientId}))}))}))},Object.defineProperty(t.prototype,"started",{get:function(){return this._started},enumerable:!0,configurable:!0}),t.prototype.getMutationQueue=function(t){return g(this.started,"Cannot initialize MutationQueue before persistence is started."),or.forUser(t,this.serializer,this.referenceDelegate)},t.prototype.getQueryCache=function(){return g(this.started,"Cannot initialize QueryCache before persistence is started."),this.queryCache},t.prototype.getRemoteDocumentCache=function(){return g(this.started,"Cannot initialize RemoteDocumentCache before persistence is started."),this.remoteDocumentCache},t.prototype.runTransaction=function(t,e,n){var r=this;return p(br,"Starting transaction:",t),this.simpleDb.runTransaction("readonly"===e?"readonly":"readwrite",ir,(function(i){return"readwrite-primary"===e?r.verifyPrimaryLease(i).next((function(e){if(!e)throw m("Failed to obtain primary lease for action '"+t+"'."),r.isPrimary=!1,r.queue.enqueueAndForget((function(){return r.primaryStateListener(!1)})),new _("failed-precondition",wr);return n(new Sr(i,r.listenSequence.next()))})).next((function(t){return r.acquireOrExtendPrimaryLease(i).next((function(){return t}))})):r.verifyAllowTabSynchronization(i).next((function(){return n(new Sr(i,r.listenSequence.next()))}))}))},t.prototype.verifyAllowTabSynchronization=function(t){var e=this;return Tr(t).get(zn.key).next((function(t){if(null!==t&&e.isWithinAge(t.leaseTimestampMs,5e3)&&!e.isClientZombied(t.ownerId)&&!e.isLocalClient(t)&&!t.allowTabSynchronization)throw new _("failed-precondition",_r)}))},t.prototype.acquireOrExtendPrimaryLease=function(t){var e=new zn(this.clientId,this.allowTabSynchronization,Date.now());return Tr(t).put(zn.key,e)},t.isAvailable=function(){return _n.isAvailable()},t.buildStoragePrefix=function(t){var e=t.databaseId.projectId;return t.databaseId.isDefaultDatabase||(e+="."+t.databaseId.database),"firestore/"+t.persistenceKey+"/"+e+"/"},t.prototype.releasePrimaryLeaseIfHeld=function(t){var e=this,n=Tr(t);return n.get(zn.key).next((function(t){return e.isLocalClient(t)?(p(br,"Releasing primary lease."),n.delete(zn.key)):wn.resolve()}))},t.prototype.isWithinAge=function(t,e){var n=Date.now();return!(t<n-e||t>n&&(m("Detected an update time that is in the future: "+t+" > "+n),1))},t.prototype.attachVisibilityHandler=function(){var t=this;null!==this.document&&"function"==typeof this.document.addEventListener&&(this.documentVisibilityHandler=function(){t.queue.enqueueAndForget((function(){return t.inForeground="visible"===t.document.visibilityState,t.updateClientMetadataAndTryBecomePrimary()}))},this.document.addEventListener("visibilitychange",this.documentVisibilityHandler),this.inForeground="visible"===this.document.visibilityState)},t.prototype.detachVisibilityHandler=function(){this.documentVisibilityHandler&&(g(null!==this.document&&"function"==typeof this.document.addEventListener,"Expected 'document.addEventListener' to be a function"),this.document.removeEventListener("visibilitychange",this.documentVisibilityHandler),this.documentVisibilityHandler=null)},t.prototype.attachWindowUnloadHook=function(){var t=this;"function"==typeof this.window.addEventListener&&(this.windowUnloadHandler=function(){t.markClientZombied(),t.queue.enqueueAndForget((function(){return t.shutdown()}))},this.window.addEventListener("unload",this.windowUnloadHandler))},t.prototype.detachWindowUnloadHook=function(){this.windowUnloadHandler&&(g("function"==typeof this.window.removeEventListener,"Expected 'window.removeEventListener' to be a function"),this.window.removeEventListener("unload",this.windowUnloadHandler),this.windowUnloadHandler=null)},t.prototype.isClientZombied=function(t){try{var e=null!==this.webStorage.getItem(this.zombiedClientLocalStorageKey(t));return p(br,"Client '"+t+"' "+(e?"is":"is not")+" zombied in LocalStorage"),e}catch(n){return m(br,"Failed to get zombied client id.",n),!1}},t.prototype.markClientZombied=function(){try{this.webStorage.setItem(this.zombiedClientLocalStorageKey(this.clientId),String(Date.now()))}catch(t){m("Failed to set zombie client id.",t)}},t.prototype.removeClientZombiedEntry=function(){try{this.webStorage.removeItem(this.zombiedClientLocalStorageKey(this.clientId))}catch(t){}},t.prototype.zombiedClientLocalStorageKey=function(t){return"firestore_zombie_"+this.persistenceKey+"_"+t},t.MAIN_DATABASE="main",t}();function Er(t){return a.__awaiter(this,void 0,void 0,(function(){return a.__generator(this,(function(e){if(!function(t){return"failed-precondition"===t.code&&t.message===wr}(t))throw t;return p(br,"Unexpectedly lost primary lease"),[2]}))}
1))}function Tr(t){return t.store(zn.store)}function kr(t){return t.store(rr.store)}var Ir=function(){function t(t,e){this.db=t,this.garbageCollector=new gr(this,e)}return t.prototype.getSequenceNumberCount=function(t){var e=this.orphanedDocmentCount(t);return this.db.getQueryCache().getQueryCount(t).next((function(t){return e.next((function(e){return t+e}))}))},t.prototype.orphanedDocmentCount=function(t){var e=0;return this.forEachOrphanedDocumentSequenceNumber(t,(function(t){e++})).next((function(){return e}))},t.prototype.forEachTarget=function(t,e){return this.db.getQueryCache().forEachTarget(t,e)},t.prototype.forEachOrphanedDocumentSequenceNumber=function(t,e){return this.forEachOrphanedDocument(t,(function(t,n){return e(n)}))},t.prototype.setInMemoryPins=function(t){this.inMemoryPins=t},t.prototype.addReference=function(t,e){return Or(t,e)},t.prototype.removeReference=function(t,e){return Or(t,e)},t.prototype.removeTargets=function(t,e,n){return this.db.getQueryCache().removeTargets(t,e,n)},t.prototype.removeMutationReference=function(t,e){return Or(t,e)},t.prototype.isPinned=function(t,e){return this.inMemoryPins.containsKey(e)?wn.resolve(!0):function(t,e){var n=!1;return hr(t).iterateSerial((function(r){return ar(t,r,e).next((function(t){return t&&(n=!0),wn.resolve(!t)}))})).next((function(){return n}))}(t,e)},t.prototype.removeOrphanedDocuments=function(t,e){var n=this,r=0,i=0,o=[];return this.forEachOrphanedDocument(t,(function(a,s){if(s<=e){var u=n.isPinned(t,a).next((function(e){if(!e)return r++,n.removeOrphanedDocument(t,a).next((function(t){i+=t}))}));o.push(u)}})).next((function(){return wn.waitFor(o)})).next((function(){return n.db.getRemoteDocumentCache().updateSize(t,-i)})).next((function(){return r}))},t.prototype.removeOrphanedDocument=function(t,e){var n,r=0,i=this.db.getRemoteDocumentCache();return wn.waitFor([An(t).delete((n=e,[0,fn(n.path)])),i.removeEntry(t,e).next((function(t){r+=t}))]).next((function(){return r}))},t.prototype.removeTarget=function(t,e){var n=e.copy({sequenceNumber:t.currentSequenceNumber});return this.db.getQueryCache().updateQueryData(t,n)},t.prototype.updateLimboDocument=function(t,e){return Or(t,e)},t.prototype.forEachOrphanedDocument=function(t,e){var n,r=An(t),i=un.INVALID;return r.iterate({index:Zn.documentTargetsIndex},(function(t,r){var o=r.path,a=r.sequenceNumber;0===t[0]?(i!==un.INVALID&&e(new at(mn(n)),i),i=a,n=o):i=un.INVALID})).next((function(){i!==un.INVALID&&e(new at(mn(n)),i)}))},t.prototype.getCacheSize=function(t){return this.db.getRemoteDocumentCache().getSize(t)},t}();function Or(t,e){return An(t).put(function(t,e){return new Zn(0,fn(t.path),e)}(e,t.currentSequenceNumber))}var xr=function(){function t(t,e){this.remoteDocumentCache=t,this.mutationQueue=e}return t.prototype.getDocument=function(t,e){var n=this;return this.mutationQueue.getAllMutationBatchesAffectingDocumentKey(t,e).next((function(r){return n.getDocumentInternal(t,e,r)}))},t.prototype.getDocumentInternal=function(t,e,n){return this.remoteDocumentCache.getEntry(t,e).next((function(t){for(var r=0,i=n;r<i.length;r++)t=i[r].applyToLocalView(e,t);return t}))},t.prototype.applyLocalMutationsToDocuments=function(t,e,n){var r=Se();return e.forEach((function(t,e){for(var i=0,o=n;i<o.length;i++)e=o[i].applyToLocalView(t,e);r=r.insert(t,e)})),r},t.prototype.getDocuments=function(t,e){var n=this;return this.remoteDocumentCache.getEntries(t,e).next((function(e){return n.getLocalViewOfDocuments(t,e)}))},t.prototype.getLocalViewOfDocuments=function(t,e){var n=this;return this.mutationQueue.getAllMutationBatchesAffectingDocumentKeys(t,e).next((function(r){var i=n.applyLocalMutationsToDocuments(t,e,r),o=_e();return i.forEach((function(t,e){e||(e=new ct(t,Yt.forDeletedDoc())),o=o.insert(t,e)})),o}))},t.prototype.getDocumentsMatchingQuery=function(t,e){return at.isDocumentKey(e.path)?this.getDocumentsMatchingDocumentQuery(t,e.path):this.getDocumentsMatchingCollectionQuery(t,e)},t.prototype.getDocumentsMatchingDocumentQuery=function(t,e){return this.getDocument(t,new at(e)).next((function(t){var e=Ee();return t instanceof ut&&(e=e.insert(t.key,t)),e}))},t.prototype.getDocumentsMatchingCollectionQuery=function(t,e){var n,r=this;return this.remoteDocumentCache.getDocumentsMatchingQuery(t,e).next((function(i){return n=i,r.mutation
1Queue.getAllMutationBatchesAffectingQuery(t,e)})).next((function(t){for(var r=0,i=t;r<i.length;r++)for(var o=i[r],a=0,s=o.mutations;a<s.length;a++){var u=s[a],c=u.key;if(e.path.isImmediateParentOf(c.path)){var l=n.get(c),h=u.applyToLocalView(l,l,o.localWriteTime);n=h instanceof ut?n.insert(c,h):n.remove(c)}}})).next((function(){return n.forEach((function(t,r){e.matches(r)||(n=n.remove(t))})),n}))},t}(),Ar=function(){function t(){this.refsByKey=new Zt(Pr.compareByKey),this.refsByTarget=new Zt(Pr.compareByTargetId)}return t.prototype.isEmpty=function(){return this.refsByKey.isEmpty()},t.prototype.addReference=function(t,e){var n=new Pr(t,e);this.refsByKey=this.refsByKey.add(n),this.refsByTarget=this.refsByTarget.add(n)},t.prototype.addReferences=function(t,e){var n=this;t.forEach((function(t){return n.addReference(t,e)}))},t.prototype.removeReference=function(t,e){this.removeRef(new Pr(t,e))},t.prototype.removeReferences=function(t,e){var n=this;t.forEach((function(t){return n.removeReference(t,e)}))},t.prototype.removeReferencesForId=function(t){var e=this,n=at.EMPTY,r=new Pr(n,t),i=new Pr(n,t+1),o=[];return this.refsByTarget.forEachInRange([r,i],(function(t){e.removeRef(t),o.push(t.key)})),o},t.prototype.removeAllReferences=function(){var t=this;this.refsByKey.forEach((function(e){return t.removeRef(e)}))},t.prototype.removeRef=function(t){this.refsByKey=this.refsByKey.delete(t),this.refsByTarget=this.refsByTarget.delete(t)},t.prototype.referencesForId=function(t){var e=at.EMPTY,n=new Pr(e,t),r=new Pr(e,t+1),i=Oe();return this.refsByTarget.forEachInRange([n,r],(function(t){i=i.add(t.key)})),i},t.prototype.containsKey=function(t){var e=new Pr(t,0),n=this.refsByKey.firstAfterOrEqual(e);return null!==n&&t.isEqual(n.key)},t}(),Pr=function(){function t(t,e){this.key=t,this.targetOrBatchId=e}return t.compareByKey=function(t,e){return at.comparator(t.key,e.key)||$(t.targetOrBatchId,e.targetOrBatchId)},t.compareByTargetId=function(t,e){return $(t.targetOrBatchId,e.targetOrBatchId)||at.comparator(t.key,e.key)},t}(),Dr=function(){function t(t,e){this.persistence=t,this.localViewReferences=new Ar,this.queryDataByTarget={},g(t.started,"LocalStore was passed an unstarted persistence implementation"),this.persistence.referenceDelegate.setInMemoryPins(this.localViewReferences),this.mutationQueue=t.getMutationQueue(e),this.remoteDocuments=t.getRemoteDocumentCache(),this.queryCache=t.getQueryCache(),this.localDocuments=new xr(this.remoteDocuments,this.mutationQueue)}return t.prototype.handleUserChange=function(t){var e=this;return this.persistence.runTransaction("Handle user change","readonly",(function(n){var r;return e.mutationQueue.getAllMutationBatches(n).next((function(i){return r=i,e.mutationQueue=e.persistence.getMutationQueue(t),e.localDocuments=new xr(e.remoteDocuments,e.mutationQueue),e.mutationQueue.getAllMutationBatches(n)})).next((function(t){for(var i=[],o=[],a=Oe(),s=0,u=r;s<u.length;s++){i.push((d=u[s]).batchId);for(var c=0,l=d.mutations;c<l.length;c++)a=a.add(l[c].key)}for(var h=0,f=t;h<f.length;h++){var d;o.push((d=f[h]).batchId);for(var p=0,m=d.mutations;p<m.length;p++)a=a.add(m[p].key)}return e.localDocuments.getDocuments(n,a).next((function(t){return{affectedDocuments:t,removedBatchIds:i,addedBatchIds:o}}))}))}))},t.prototype.localWrite=function(t){var e=this;return this.persistence.runTransaction("Locally write mutations","readwrite",(function(n){var r,i=Z.now();return e.mutationQueue.addMutationBatch(n,i,t).next((function(t){var i=(r=t).keys();return e.localDocuments.getDocuments(n,i)})).next((function(t){return{batchId:r.batchId,changes:t}}))}))},t.prototype.lookupMutationDocuments=function(t){var e=this;return this.persistence.runTransaction("Lookup mutation documents","readonly",(function(n){return e.mutationQueue.lookupMutationKeys(n,t).next((function(t){return t?e.localDocuments.getDocuments(n,t):wn.resolve(null)}))}))},t.prototype.acknowledgeBatch=function(t){var e=this;return this.persistence.runTransaction("Acknowledge batch","readwrite-primary",(function(n){var r=t.batch.keys(),i=e.remoteDocuments.newChangeBuffer();
1return e.mutationQueue.acknowledgeBatch(n,t.batch,t.streamToken).next((function(){return e.applyWriteToRemoteDocuments(n,t,i)})).next((function(){return i.apply(n)})).next((function(){return e.mutationQueue.performConsistencyCheck(n)})).next((function(){return e.localDocuments.getDocuments(n,r)}))}))},t.prototype.rejectBatch=function(t){var e=this;return this.persistence.runTransaction("Reject batch","readwrite-primary",(function(n){var r;return e.mutationQueue.lookupMutationBatch(n,t).next((function(t){return g(null!==t,"Attempt to reject nonexistent batch!"),r=t.keys(),e.mutationQueue.removeMutationBatch(n,t)})).next((function(){return e.mutationQueue.performConsistencyCheck(n)})).next((function(){return e.localDocuments.getDocuments(n,r)}))}))},t.prototype.getLastStreamToken=function(){var t=this;return this.persistence.runTransaction("Get last stream token","readonly",(function(e){return t.mutationQueue.getLastStreamToken(e)}))},t.prototype.setLastStreamToken=function(t){var e=this;return this.persistence.runTransaction("Set last stream token","readwrite-primary",(function(n){return e.mutationQueue.setLastStreamToken(n,t)}))},t.prototype.getLastRemoteSnapshotVersion=function(){var t=this;return this.persistence.runTransaction("Get last remote snapshot version","readonly",(function(e){return t.queryCache.getLastRemoteSnapshotVersion(e)}))},t.prototype.applyRemoteEvent=function(e){var n=this,r=this.remoteDocuments.newChangeBuffer();return this.persistence.runTransaction("Apply remote event","readwrite-primary",(function(i){var o=[],a=Oe();T(e.targetChanges,(function(r,s){var u=n.queryDataByTarget[r];if(u){s.addedDocuments.forEach((function(t){a=a.add(t)})),s.modifiedDocuments.forEach((function(t){a=a.add(t)})),o.push(n.queryCache.removeMatchingKeys(i,s.removedDocuments,r).next((function(){return n.queryCache.addMatchingKeys(i,s.addedDocuments,r)})));var c=s.resumeToken;if(c.length>0){var l=u;u=u.copy({resumeToken:c,snapshotVersion:e.snapshotVersion}),n.queryDataByTarget[r]=u,t.shouldPersistQueryData(l,u,s)&&o.push(n.queryCache.updateQueryData(i,u))}}}));var s=_e(),u=Oe();e.documentUpdates.forEach((function(t,e){u=u.add(t)})),o.push(r.getEntries(i,u).next((function(t){e.documentUpdates.forEach((function(u,c){var l=t.get(u);null==l||c.version.isEqual(Yt.MIN)||a.has(c.key)&&!l.hasPendingWrites||c.version.compareTo(l.version)>=0?(r.addEntry(c),s=s.insert(u,c)):p("LocalStore","Ignoring outdated watch update for ",u,". Current version:",l.version," Watch version:",c.version),e.resolvedLimboDocuments.has(u)&&o.push(n.persistence.referenceDelegate.updateLimboDocument(i,u))}))})));var c=e.snapshotVersion;if(!c.isEqual(Yt.MIN)){var l=n.queryCache.getLastRemoteSnapshotVersion(i).next((function(t){return g(c.compareTo(t)>=0,"Watch stream reverted to previous snapshot?? "+c+" < "+t),n.queryCache.setTargetsMetadata(i,i.currentSequenceNumber,c)}));o.push(l)}return wn.waitFor(o).next((function(){return r.apply(i)})).next((function(){return n.localDocuments.getLocalViewOfDocuments(i,s)}))}))},t.shouldPersistQueryData=function(t,e,n){return 0!==e.resumeToken.length&&(0===t.resumeToken.length||e.snapshotVersion.toMicroseconds()-t.snapshotVersion.toMicroseconds()>=this.RESUME_TOKEN_MAX_AGE_MICROS||n.addedDocuments.size+n.modifiedDocuments.size+n.removedDocuments.size>0)},t.prototype.notifyLocalViewChanges=function(t){var e=this;return this.persistence.runTransaction("notifyLocalViewChanges","readwrite",(function(n){return wn.forEach(t,(function(t){return e.localViewReferences.addReferences(t.addedKeys,t.targetId),e.localViewReferences.removeReferences(t.removedKeys,t.targetId),wn.forEach(t.removedKeys,(function(t){return e.persistence.referenceDelegate.removeReference(n,t)}))}))}))},t.prototype.nextMutationBatch=function(t){var e=this;return this.persistence.runTransaction("Get next mutation batch","readonly",(function(n){return void 0===t&&(t=-1),e.mutationQueue.getNextMutationBatchAfterBatchId(n,t)}))},t.prototype.readDocument=function(t){var e=this;return this.persistence.runTransaction("read document","readonly",(function(n){return e.localDocuments.getDocument(n,t)}))},t.prototype.allocateQuery=function(t){var e=this;return this.persistence.runTransaction("Allocate query","readwrite",(function(n){var r;return e.queryCache.getQueryData(n,t).next((function(i){return i?(r=i,wn.resolve()):e.queryCache.allocateTargetId(n).next((function(i){return r=new Jt(t,i,Xt.Listen,n.currentSequenceNumber),e.queryCache.addQueryData(n,r)}))})).next((function(){return g(!e.queryDataByTarget[r.targetId],"Tried to allocate an already allocated query: "+t),e.queryDataByTarget[r.targetId]=r,r}))}))},t.prototype.releaseQuery=function(t,e){var n=this;return this.persistence.runTransaction("Release query",e?"readwrite":"readwrite-primary",(function(r){return n.queryCache.getQueryData(r,t).next((function(i){g(null!=i,"Tried to release nonexistent query: "+t);var o=i.targetId,a=n.queryDataByTarget[o],s=n.localViewReferences.removeReferencesForId(o);
1return delete n.queryDataByTarget[o],e?wn.resolve():wn.forEach(s,(function(t){return n.persistence.referenceDelegate.removeReference(r,t)})).next((function(){return n.persistence.referenceDelegate.removeTarget(r,a)}))}))}))},t.prototype.executeQuery=function(t){var e=this;return this.persistence.runTransaction("Execute query","readonly",(function(n){return e.localDocuments.getDocumentsMatchingQuery(n,t)}))},t.prototype.remoteDocumentKeys=function(t){var e=this;return this.persistence.runTransaction("Remote document keys","readonly",(function(n){return e.queryCache.getMatchingKeysForTargetId(n,t)}))},t.prototype.getActiveClients=function(){return this.persistence.getActiveClients()},t.prototype.removeCachedMutationBatchMetadata=function(t){this.mutationQueue.removeCachedMutationKeys(t)},t.prototype.setNetworkEnabled=function(t){this.persistence.setNetworkEnabled(t)},t.prototype.applyWriteToRemoteDocuments=function(t,e,n){var r=this,i=e.batch,o=i.keys(),a=wn.resolve();return o.forEach((function(r){a=a.next((function(){return n.getEntry(t,r)})).next((function(t){var o=t,a=e.docVersions.get(r);g(null!==a,"ackVersions should contain every doc in the write."),(!o||o.version.compareTo(a)<0)&&((o=i.applyToRemoteDocument(r,o,e))?n.addEntry(o):g(!t,"Mutation batch "+i+" applied to document "+t+" resulted in null"))}))})),a.next((function(){return r.mutationQueue.removeMutationBatch(t,i)}))},t.prototype.collectGarbage=function(t){var e=this;return this.persistence.runTransaction("Collect garbage","readwrite-primary",(function(n){return t.collect(n,e.queryDataByTarget)}))},t.prototype.getQueryForTarget=function(t){var e=this;return this.queryDataByTarget[t]?Promise.resolve(this.queryDataByTarget[t].query):this.persistence.runTransaction("Get query data","readonly",(function(n){return e.queryCache.getQueryDataForTarget(n,t).next((function(t){return t?t.query:null}))}))},t.prototype.getNewDocumentChanges=function(){var t=this;return this.persistence.runTransaction("Get new document changes","readonly",(function(e){return t.remoteDocuments.getNewDocumentChanges(e)}))},t.RESUME_TOKEN_MAX_AGE_MICROS=3e8,t}(),Rr=function(){function t(t){this.referenceDelegate=t,this.mutationQueue=[],this.nextBatchId=1,this.lastStreamToken=w(),this.batchesByDocumentKey=new Zt(Pr.compareByKey)}return t.prototype.checkEmpty=function(t){return wn.resolve(0===this.mutationQueue.length)},t.prototype.acknowledgeBatch=function(t,e,n){var r=e.batchId,i=this.indexOfExistingBatchId(r,"acknowledged");g(0===i,"Can only acknowledge the first batch in the mutation queue");var o=this.mutationQueue[i];return g(r===o.batchId,"Queue ordering failure: expected batch "+r+", got batch "+o.batchId),this.lastStreamToken=n,wn.resolve()},t.prototype.getLastStreamToken=function(t){return wn.resolve(this.lastStreamToken)},t.prototype.setLastStreamToken=function(t,e){return this.lastStreamToken=e,wn.resolve()},t.prototype.addMutationBatch=function(t,e,n){g(0!==n.length,"Mutation batches should not be empty");var r=this.nextBatchId;this.nextBatchId++,this.mutationQueue.length>0&&g(this.mutationQueue[this.mutationQueue.length-1].batchId<r,"Mutation batchIDs must be monotonically increasing order");var i=new yn(r,e,n);this.mutationQueue.push(i);for(var o=0,a=n;o<a.length;o++)this.batchesByDocumentKey=this.batchesByDocumentKey.add(new Pr(a[o].key,r));return wn.resolve(i)},t.prototype.lookupMutationBatch=function(t,e){return wn.resolve(this.findMutationBatch(e))},t.prototype.lookupMutationKeys=function(t,e){var n=this.findMutationBatch(e);return g(null!=n,"Failed to find local mutation batch."),wn.resolve(n.keys())},t.prototype.getNextMutationBatchAfterBatchId=function(t,e){var n=this.indexOfBatchId(e+1),r=n<0?0:n;return wn.resolve(this.mutationQueue.length>r?this.mutationQueue[r]:null)},t.prototype.getAllMutationBatches=function(t){return wn.resolve(this.mutationQueue.slice())},t.prototype.getAllMutationBatchesAffectingDocumentKey=function(t,e){var n=this,r=new Pr(e,0),i=new Pr(e,Number.POSITIVE_INFINITY),o=[];return this.batchesByDocumentKey.forEachInRange([r,i],(function(t){g(e.isEqual(t.key),"Should only iterate over a single key's batches");var r=n.findMutationBatch(t.targetOrBatchId);g(null!==r,"Batches in the index must exist in the main table"),o.push(r)})),wn.resolve(o)},t.prototype.getAllMutationBatchesAffectingDocumentKeys=function(t,e){var n=this,r=new Zt($);return e.forEach((function(t){var e=new Pr(t,0),i=new Pr(t,Number.POSITIVE_INFINITY);
1n.batchesByDocumentKey.forEachInRange([e,i],(function(e){g(t.isEqual(e.key),"For each key, should only iterate over a single key's batches"),r=r.add(e.targetOrBatchId)}))})),wn.resolve(this.findMutationBatches(r))},t.prototype.getAllMutationBatchesAffectingQuery=function(t,e){var n=e.path,r=n.length+1,i=n;at.isDocumentKey(i)||(i=i.child(""));var o=new Pr(new at(i),0),a=new Zt($);return this.batchesByDocumentKey.forEachWhile((function(t){var e=t.key.path;return!!n.isPrefixOf(e)&&(e.length===r&&(a=a.add(t.targetOrBatchId)),!0)}),o),wn.resolve(this.findMutationBatches(a))},t.prototype.findMutationBatches=function(t){var e=this,n=[];return t.forEach((function(t){var r=e.findMutationBatch(t);null!==r&&n.push(r)})),n},t.prototype.removeMutationBatch=function(t,e){var n=this;g(0===this.indexOfExistingBatchId(e.batchId,"removed"),"Can only remove the first entry of the mutation queue"),this.mutationQueue.shift();var r=this.batchesByDocumentKey;return wn.forEach(e.mutations,(function(i){var o=new Pr(i.key,e.batchId);return r=r.delete(o),n.referenceDelegate.removeMutationReference(t,i.key)})).next((function(){n.batchesByDocumentKey=r}))},t.prototype.removeCachedMutationKeys=function(t){},t.prototype.containsKey=function(t,e){var n=new Pr(e,0),r=this.batchesByDocumentKey.firstAfterOrEqual(n);return wn.resolve(e.isEqual(r&&r.key))},t.prototype.performConsistencyCheck=function(t){return 0===this.mutationQueue.length&&g(this.batchesByDocumentKey.isEmpty(),"Document leak -- detected dangling mutation references when queue is empty."),wn.resolve()},t.prototype.indexOfExistingBatchId=function(t,e){var n=this.indexOfBatchId(t);return g(n>=0&&n<this.mutationQueue.length,"Batches must exist to be "+e),n},t.prototype.indexOfBatchId=function(t){return 0===this.mutationQueue.length?0:t-this.mutationQueue[0].batchId},t.prototype.findMutationBatch=function(t){var e=this.indexOfBatchId(t);if(e<0||e>=this.mutationQueue.length)return null;var n=this.mutationQueue[e];return g(n.batchId===t,"If found batch must match"),n},t}(),Nr=function(){function t(t){this.persistence=t,this.queries=new Pn((function(t){return t.canonicalId()})),this.lastRemoteSnapshotVersion=Yt.MIN,this.highestTargetId=0,this.highestSequenceNumber=0,this.references=new Ar,this.targetCount=0,this.targetIdGenerator=bn.forQueryCache()}return t.prototype.getTargetCount=function(t){return wn.resolve(this.targetCount)},t.prototype.forEachTarget=function(t,e){return this.queries.forEach((function(t,n){return e(n)})),wn.resolve()},t.prototype.getLastRemoteSnapshotVersion=function(t){return wn.resolve(this.lastRemoteSnapshotVersion)},t.prototype.getHighestSequenceNumber=function(t){return wn.resolve(this.highestSequenceNumber)},t.prototype.allocateTargetId=function(t){var e=this.targetIdGenerator.after(this.highestTargetId);return this.highestTargetId=e,wn.resolve(e)},t.prototype.setTargetsMetadata=function(t,e,n){return n&&(this.lastRemoteSnapshotVersion=n),e>this.highestSequenceNumber&&(this.highestSequenceNumber=e),wn.resolve()},t.prototype.saveQueryData=function(t){this.queries.set(t.query,t);var e=t.targetId;e>this.highestTargetId&&(this.highestTargetId=e),t.sequenceNumber>this.highestSequenceNumber&&(this.highestSequenceNumber=t.sequenceNumber)},t.prototype.addQueryData=function(t,e){return g(!this.queries.has(e.query),"Adding a query that already exists"),this.saveQueryData(e),this.targetCount+=1,wn.resolve()},t.prototype.updateQueryData=function(t,e){return g(this.queries.has(e.query),"Updating a non-existent query"),this.saveQueryData(e),wn.resolve()},t.prototype.removeQueryData=function(t,e){return g(this.targetCount>0,"Removing a target from an empty cache"),g(this.queries.has(e.query),"Removing a non-existent target from the cache"),this.queries.delete(e.query),this.references.removeReferencesForId(e.targetId),this.targetCount-=1,wn.resolve()},t.prototype.removeTargets=function(t,e,n){var r=this,i=0,o=[];return this.queries.forEach((function(a,s){s.sequenceNumber<=e&&!n[s.targetId]&&(r.queries.delete(a),o.push(r.removeMatchingKeysForTargetId(t,s.targetId)),i++)})),wn.waitFor(o).next((function(){return i}))},t.prototype.getQueryCount=function(t){return wn.resolve(this.targetCount)},t.prototype.getQueryData=function(t,e){var n=this.queries.get(e)||null;return wn.resolve(n)},t.prototype.getQueryDataForTarget=function(t,e){return v("Not yet implemented.")},t.prototype.addMatchingKeys=function(t,e,n){this.references.addReferences(e,n);var r=this.persistence.referenceDelegate,i=[];return r&&e.forEach((function(e){i.push(r.addReference(t,e))})),wn.waitFor(i)},t.prototype.removeMatchingKeys=function(t,e,n){this.references.removeReferences(e,n);var r=this.persistence.referenceDelegate,i=[];return r&&e.forEach((function(e){i.push(r.removeReference(t,e))})),wn.waitFor(i)},t.prototype.removeMatchingKeysForTargetId=function(t,e){return this.references.removeReferencesForId(e),wn.resolve()},t.prototype.getMatchingKeysForTargetId=function(t,e){var n=this.references.referencesForId(e);return wn.resolve(n)},t.prototype.containsKey=function(t,e){return wn.resolve(this.references.containsKey(e))},t}(),jr=function(){function t(t){this.sizer=t,this.docs=new ht(at.comparator),this.newDocumentChanges=Oe(),this.size=0}return t.prototype.addEntries=function(t,e,n){for(var r=0,i=e;r<i.length;r++){var o=i[r],a=o.maybeDocument.key;this.docs=this.docs.insert(a,o),this.newDocumentChanges=this.newDocumentChanges.add(a)}return this.size+=n,wn.resolve()},t.prototype.removeEntry=function(t,e){var n=this.docs.get(e);return n?(this.docs=this.docs.remove(e),this.size-=n.size,wn.resolve(n.size)):wn.resolve(0)},t.prototype.getEntry=function(t,e){var n=this.docs.get(e);return wn.resolve(n?n.maybeDocument:null)},t.prototype.getSizedEntry=function(t,e){return wn.resolve(this.docs.get(e))},t.prototype.getEntries=function(t,e){var n=this,r=Se();return e.forEach((function(t){var e=n.docs.get(t);r=r.insert(t,e?e.maybeDocument:null)})),wn.resolve(r)},t.prototype.getSizedEntries=function(t,e){var n=this,r=Se(),i=new ht(at.comparator);return e.forEach((function(t){var e=n.docs.get(t);r=r.insert(t,e?e.maybeDocument:null),i=i.insert(t,e?e.size:0)})),wn.resolve({maybeDocuments:r,sizeMap:i})},t.prototype.getDocumentsMatchingQuery=function(t,e){for(var n=Ee(),r=new at(e.path.child("")),i=this.docs.getIteratorFrom(r);i.hasNext();){var o=i.getNext(),a=o.value.maybeDocument;if(!e.path.isPrefixOf(o.key.path))break;a instanceof ut&&e.matches(a)&&(n=n.insert(a.key,a))}return wn.resolve(n)},t.prototype.forEachDocumentKey=function(t,e){return wn.forEach(this.docs,(function(t){return e(t)}))},t.prototype.getNewDocumentChanges=function(t){var e=this,n=_e();
1return this.newDocumentChanges.forEach((function(t){var r=e.docs.get(t),i=r?r.maybeDocument:new ct(t,Yt.forDeletedDoc());n=n.insert(t,i)})),this.newDocumentChanges=Oe(),wn.resolve(n)},t.prototype.newChangeBuffer=function(){return new Mr(this.sizer,this)},t.prototype.getSize=function(t){return wn.resolve(this.size)},t}(),Mr=function(t){function e(e,n){var r=t.call(this)||this;return r.sizer=e,r.documentCache=n,r}return a.__extends(e,t),e.prototype.applyChanges=function(t){var e=this,n=this.assertChanges(),r=0,i=[];return n.forEach((function(t,n){var o=e.documentSizes.get(t);g(void 0!==o,"Attempting to change document "+t.toString()+" without having read it first");var a=e.sizer(n);r+=a-o,i.push({maybeDocument:n,size:a})})),this.documentCache.addEntries(t,i,r)},e.prototype.getFromCache=function(t,e){return this.documentCache.getSizedEntry(t,e)},e.prototype.getAllFromCache=function(t,e){return this.documentCache.getSizedEntries(t,e)},e}(Dn),Lr=function(){function t(t,e){var n=this;this.clientId=t,this.mutationQueues={},this.listenSequence=new un(0),this._started=!1,this._started=!0,this.referenceDelegate=e(this),this.queryCache=new Nr(this),this.remoteDocumentCache=new jr((function(t){return n.referenceDelegate.documentSize(t)}))}return t.createLruPersistence=function(e,n,r){return new t(e,(function(t){return new Vr(t,new fr(n),r)}))},t.createEagerPersistence=function(e){return new t(e,(function(t){return new Ur(t)}))},t.prototype.shutdown=function(t){return this._started=!1,Promise.resolve()},Object.defineProperty(t.prototype,"started",{get:function(){return this._started},enumerable:!0,configurable:!0}),t.prototype.getActiveClients=function(){return a.__awaiter(this,void 0,void 0,(function(){return a.__generator(this,(function(t){return[2,[this.clientId]]}))}))},t.prototype.setPrimaryStateListener=function(t){return t(!0)},t.prototype.setNetworkEnabled=function(t){},t.prototype.getMutationQueue=function(t){var e=this.mutationQueues[t.toKey()];return e||(e=new Rr(this.referenceDelegate),this.mutationQueues[t.toKey()]=e),e},t.prototype.getQueryCache=function(){return this.queryCache},t.prototype.getRemoteDocumentCache=function(){return this.remoteDocumentCache},t.prototype.runTransaction=function(t,e,n){var r=this;p("MemoryPersistence","Starting transaction:",t);var i=new Fr(this.listenSequence.next());return this.referenceDelegate.onTransactionStarted(),n(i).next((function(t){return r.referenceDelegate.onTransactionCommitted(i).next((function(){return t}))})).toPromise()},t.prototype.mutationQueuesContainKey=function(t,e){return wn.or((n=this.mutationQueues,r=[],k(n,(function(t,e){return r.push(e)})),r).map((function(n){return function(){return n.containsKey(t,e)}})));var n,r},t}(),Fr=function(){return function(t){this.currentSequenceNumber=t}}(),Ur=function(){function t(t){this.persistence=t}return t.prototype.setInMemoryPins=function(t){this.inMemoryPins=t},t.prototype.addReference=function(t,e){return this.orphanedDocuments.delete(e),wn.resolve()},t.prototype.removeReference=function(t,e){return this.orphanedDocuments.add(e),wn.resolve()},t.prototype.removeMutationReference=function(t,e){return this.orphanedDocuments.add(e),wn.resolve()},t.prototype.removeTarget=function(t,e){var n=this,r=this.persistence.getQueryCache();return r.getMatchingKeysForTargetId(t,e.targetId).next((function(t){t.forEach((function(t){return n.orphanedDocuments.add(t)}))})).next((function(){return r.removeQueryData(t,e)}))},t.prototype.onTransactionStarted=function(){this.orphanedDocuments=new Set},t.prototype.onTransactionCommitted=function(t){var e=this,n=this.persistence.getRemoteDocumentCache();return wn.forEach(this.orphanedDocuments,(function(r){return e.isReferenced(t,r).next((function(e){return e?wn.resolve():n.removeEntry(t,r).next((function(){}))}))}))},t.prototype.updateLimboDocument=function(t,e){var n=this;return this.isReferenced(t,e).next((function(t){t?n.orphanedDocuments.delete(e):n.orphanedDocuments.add(e)}))},t.prototype.documentSize=function(t){return 0},t.prototype.isReferenced=function(t,e){var n=this;return wn.or([function(){return n.persistence.getQueryCache().containsKey(t,e)}
1,function(){return n.persistence.mutationQueuesContainKey(t,e)},function(){return wn.resolve(n.inMemoryPins.containsKey(e))}])},t}(),Vr=function(){function t(t,e,n){this.persistence=t,this.serializer=e,this.orphanedSequenceNumbers=new Pn((function(t){return fn(t.path)})),this.garbageCollector=new gr(this,n)}return t.prototype.onTransactionStarted=function(){},t.prototype.onTransactionCommitted=function(t){return wn.resolve()},t.prototype.forEachTarget=function(t,e){return this.persistence.getQueryCache().forEachTarget(t,e)},t.prototype.getSequenceNumberCount=function(t){var e=this.orphanedDocumentCount(t);return this.persistence.getQueryCache().getTargetCount(t).next((function(t){return e.next((function(e){return t+e}))}))},t.prototype.orphanedDocumentCount=function(t){var e=0;return this.forEachOrphanedDocumentSequenceNumber(t,(function(t){e++})).next((function(){return e}))},t.prototype.forEachOrphanedDocumentSequenceNumber=function(t,e){var n=this;return wn.forEach(this.orphanedSequenceNumbers,(function(r,i){return n.isPinned(t,r,i).next((function(t){return t?wn.resolve():e(i)}))}))},t.prototype.setInMemoryPins=function(t){this.inMemoryPins=t},t.prototype.removeTargets=function(t,e,n){return this.persistence.getQueryCache().removeTargets(t,e,n)},t.prototype.removeOrphanedDocuments=function(t,e){var n=this,r=0,i=this.persistence.getRemoteDocumentCache();return i.forEachDocumentKey(t,(function(o){return n.isPinned(t,o,e).next((function(e){return e?wn.resolve():(r++,i.removeEntry(t,o).next())}))})).next((function(){return r}))},t.prototype.removeMutationReference=function(t,e){return this.orphanedSequenceNumbers.set(e,t.currentSequenceNumber),wn.resolve()},t.prototype.removeTarget=function(t,e){var n=e.copy({sequenceNumber:t.currentSequenceNumber});return this.persistence.getQueryCache().updateQueryData(t,n)},t.prototype.addReference=function(t,e){return this.orphanedSequenceNumbers.set(e,t.currentSequenceNumber),wn.resolve()},t.prototype.removeReference=function(t,e){return this.orphanedSequenceNumbers.set(e,t.currentSequenceNumber),wn.resolve()},t.prototype.updateLimboDocument=function(t,e){return this.orphanedSequenceNumbers.set(e,t.currentSequenceNumber),wn.resolve()},t.prototype.documentSize=function(t){var e,n=this.serializer.toDbRemoteDocument(t);if(n.document)e=n.document;else if(n.unknownDocument)e=n.unknownDocument;else{if(!n.noDocument)throw v("Unknown remote document type");e=n.noDocument}return JSON.stringify(e).length},t.prototype.isPinned=function(t,e,n){var r=this;return wn.or([function(){return r.persistence.mutationQueuesContainKey(t,e)},function(){return wn.resolve(r.inMemoryPins.containsKey(e))},function(){return r.persistence.getQueryCache().containsKey(t,e)},function(){var t=r.orphanedSequenceNumbers.get(e);return wn.resolve(void 0!==t&&t>n)}])},t.prototype.getCacheSize=function(t){return this.persistence.getRemoteDocumentCache().getSize(t)},t}(),qr=function(){function t(t,e,n,r,i){this.queue=t,this.timerId=e,this.initialDelayMs=n,this.backoffFactor=r,this.maxDelayMs=i,this.timerPromise=null,this.lastAttemptTime=Date.now(),this.reset()}return t.prototype.reset=function(){this.currentBaseMs=0},t.prototype.resetToMax=function(){this.currentBaseMs=this.maxDelayMs},t.prototype.backoffAndRun=function(t){var e=this;this.cancel();var n=Math.floor(this.currentBaseMs+this.jitterDelayMs()),r=Math.max(0,Date.now()-this.lastAttemptTime),i=Math.max(0,n-r);this.currentBaseMs>0&&p("ExponentialBackoff","Backing off for "+i+" ms (base delay: "+this.currentBaseMs+" ms, delay with jitter: "+n+" ms, last attempt: "+r+" ms ago)"),this.timerPromise=this.queue.enqueueAfterDelay(this.timerId,i,(function(){return e.lastAttemptTime=Date.now(),t()})),this.currentBaseMs*=this.backoffFactor,this.currentBaseMs<this.initialDelayMs&&(this.currentBaseMs=this.initialDelayMs),this.currentBaseMs>this.maxDelayMs&&(this.currentBaseMs=this.maxDelayMs)},t.prototype.cancel=function(){null!==this.timerPromise&&(this.timerPromise.cancel(),this.timerPromise=null)},t.prototype.jitterDelayMs=function(){return(Math.random()-.5)*this.currentBaseMs},t}(),Br=function(t){return t[t.Initial=0]="Initial",t[t.Starting=1]="Starting",t[t.Open=2]="Open",t[t.Error=3]="Error",t[t.Backoff=4]="Backoff",t}({}),Wr=function(){function t(t,e,n,r,i,o){this.queue=t,this.idleTimerId=n,this.connection=r,this.credentialsProvider=i,this.listener=o,this.state=Br.Initial,this.closeCount=0,this.idleTimer=null,this.stream=null,this.backoff=new qr(t,e,1e3,1.5,6e4)}return t.prototype.isStarted=function(){return this.state===Br.Starting||this.state===Br.Open||this.state===Br.Backoff},t.prototype.isOpen=function(){return this.state===Br.Open},t.prototype.start=function(){this.state!==Br.Error?(g(this.state===Br.Initial,"Already started"),this.auth()):this.performBackoff()},t.prototype.stop=function(){return a.__awaiter(this,void 0,void 0,(function(){return a.__generator(this,(function(t){switch(t.label){case 0:return this.isStarted()?[4,this.close(Br.Initial)]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}}
1))}))},t.prototype.inhibitBackoff=function(){g(!this.isStarted(),"Can only inhibit backoff in a stopped state"),this.state=Br.Initial,this.backoff.reset()},t.prototype.markIdle=function(){var t=this;this.isOpen()&&null===this.idleTimer&&(this.idleTimer=this.queue.enqueueAfterDelay(this.idleTimerId,6e4,(function(){return t.handleIdleCloseTimer()})))},t.prototype.sendRequest=function(t){this.cancelIdleCheck(),this.stream.send(t)},t.prototype.handleIdleCloseTimer=function(){return a.__awaiter(this,void 0,void 0,(function(){return a.__generator(this,(function(t){return this.isOpen()?[2,this.close(Br.Initial)]:[2]}))}))},t.prototype.cancelIdleCheck=function(){this.idleTimer&&(this.idleTimer.cancel(),this.idleTimer=null)},t.prototype.close=function(t,e){return a.__awaiter(this,void 0,void 0,(function(){return a.__generator(this,(function(n){switch(n.label){case 0:return g(this.isStarted(),"Only started streams should be closed."),g(t===Br.Error||Lt(e),"Can't provide an error when not in an error state."),this.cancelIdleCheck(),this.backoff.cancel(),this.closeCount++,t!==Br.Error?this.backoff.reset():e&&"resource-exhausted"===e.code?(m(e.toString()),m("Using maximum backoff delay to prevent overloading the backend."),this.backoff.resetToMax()):e&&"unauthenticated"===e.code&&this.credentialsProvider.invalidateToken(),null!==this.stream&&(this.tearDown(),this.stream.close(),this.stream=null),this.state=t,[4,this.listener.onClose(e)];case 1:return n.sent(),[2]}}))}))},t.prototype.tearDown=function(){},t.prototype.auth=function(){var t=this;g(this.state===Br.Initial,"Must be in initial state to auth"),this.state=Br.Starting;var e=this.getCloseGuardedDispatcher(this.closeCount),n=this.closeCount;this.credentialsProvider.getToken().then((function(e){t.closeCount===n&&t.startStream(e)}),(function(n){e((function(){var e=new _("unknown","Fetching auth token failed: "+n.message);return t.handleStreamClose(e)}))}))},t.prototype.startStream=function(t){var e=this;g(this.state===Br.Starting,"Trying to start stream in a non-starting state");var n=this.getCloseGuardedDispatcher(this.closeCount);this.stream=this.startRpc(t),this.stream.onOpen((function(){n((function(){return g(e.state===Br.Starting,"Expected stream to be in state Starting, but was "+e.state),e.state=Br.Open,e.listener.onOpen()}))})),this.stream.onClose((function(t){n((function(){return e.handleStreamClose(t)}))})),this.stream.onMessage((function(t){n((function(){return e.onMessage(t)}))}))},t.prototype.performBackoff=function(){var t=this;g(this.state===Br.Error,"Should only perform backoff when in Error state"),this.state=Br.Backoff,this.backoff.backoffAndRun((function(){return a.__awaiter(t,void 0,void 0,(function(){return a.__generator(this,(function(t){return g(this.state===Br.Backoff,"Backoff elapsed but state is now: "+this.state),this.state=Br.Initial,this.start(),g(this.isStarted(),"PersistentStream should have started"),[2]}))}))}))},t.prototype.handleStreamClose=function(t){return g(this.isStarted(),"Can't handle server close on non-started stream"),p("PersistentStream","close with error: "+t),this.stream=null,this.close(Br.Error,t)},t.prototype.getCloseGuardedDispatcher=function(t){var e=this;return function(n){e.queue.enqueueAndForget((function(){return e.closeCount===t?n():(p("PersistentStream","stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve())}))}},t}(),zr=function(t){function e(e,n,r,i,o){var a=t.call(this,e,sn.ListenStreamConnectionBackoff,sn.ListenStreamIdle,n,r,o)||this;return a.serializer=i,a}return a.__extends(e,t),e.prototype.startRpc=function(t){return this.connection.openStream("Listen",t)},e.prototype.onMessage=function(t){this.backoff.reset();var e=this.serializer.fromWatchChange(t),n=this.serializer.versionFromListenResponse(t);return this.listener.onWatchChange(e,n)},e.prototype.watch=function(t){var e={};e.database=this.serializer.encodedDatabaseId,e.addTarget=this.serializer.toTarget(t);var n=this.serializer.toListenRequestLabels(t);n&&(e.labels=n),this.sendRequest(e)},e.prototype.unwatch=function(t){var e={};e.database=this.serializer.encodedDatabaseId,e.removeTarget=t,this.sendRequest(e)},e}(Wr),Hr=function(t){function e(e,n,r,i,o){var a=t.call(this,e,sn.WriteStreamConnectionBackoff,sn.WriteStreamIdle,n,r,o)||this;
1return a.serializer=i,a.handshakeComplete_=!1,a}return a.__extends(e,t),Object.defineProperty(e.prototype,"handshakeComplete",{get:function(){return this.handshakeComplete_},enumerable:!0,configurable:!0}),e.prototype.start=function(){this.handshakeComplete_=!1,t.prototype.start.call(this)},e.prototype.tearDown=function(){this.handshakeComplete_&&this.writeMutations([])},e.prototype.startRpc=function(t){return this.connection.openStream("Write",t)},e.prototype.onMessage=function(t){if(g(!!t.streamToken,"Got a write response without a stream token"),this.lastStreamToken=t.streamToken,this.handshakeComplete_){this.backoff.reset();var e=this.serializer.fromWriteResults(t.writeResults,t.commitTime),n=this.serializer.fromVersion(t.commitTime);return this.listener.onMutationResult(n,e)}return g(!t.writeResults||0===t.writeResults.length,"Got mutation results for handshake"),this.handshakeComplete_=!0,this.listener.onHandshakeComplete()},e.prototype.writeHandshake=function(){g(this.isOpen(),"Writing handshake requires an opened stream"),g(!this.handshakeComplete_,"Handshake already completed");var t={};t.database=this.serializer.encodedDatabaseId,this.sendRequest(t)},e.prototype.writeMutations=function(t){var e=this;g(this.isOpen(),"Writing mutations requires an opened stream"),g(this.handshakeComplete_,"Handshake must be complete before writing mutations"),g(this.lastStreamToken.length>0,"Trying to write mutation without a token");var n={streamToken:this.lastStreamToken,writes:t.map((function(t){return e.serializer.toMutation(t)}))};this.sendRequest(n)},e}(Wr),$r=function(){function t(t,e,n,r){this.queue=t,this.connection=e,this.credentials=n,this.serializer=r}return t.prototype.newPersistentWriteStream=function(t){return new Hr(this.queue,this.connection,this.credentials,this.serializer,t)},t.prototype.newPersistentWatchStream=function(t){return new zr(this.queue,this.connection,this.credentials,this.serializer,t)},t.prototype.commit=function(t){var e=this,n={database:this.serializer.encodedDatabaseId,writes:t.map((function(t){return e.serializer.toMutation(t)}))};return this.invokeRPC("Commit",n).then((function(t){return e.serializer.fromWriteResults(t.writeResults,t.commitTime)}))},t.prototype.lookup=function(t){var e=this,n={database:this.serializer.encodedDatabaseId,documents:t.map((function(t){return e.serializer.toName(t)}))};return this.invokeStreamingRPC("BatchGetDocuments",n).then((function(n){var r=_e();n.forEach((function(t){var n=e.serializer.fromMaybeDocument(t);r=r.insert(n.key,n)}));var i=[];return t.forEach((function(t){var e=r.get(t);g(!!e,"Missing entity in write response for "+t),i.push(e)})),i}))},t.prototype.invokeRPC=function(t,e){var n=this;return this.credentials.getToken().then((function(r){return n.connection.invokeRPC(t,e,r)})).catch((function(t){throw"unauthenticated"===t.code&&n.credentials.invalidateToken(),t}))},t.prototype.invokeStreamingRPC=function(t,e){var n=this;return this.credentials.getToken().then((function(r){return n.connection.invokeStreamingRPC(t,e,r)})).catch((function(t){throw"unauthenticated"===t.code&&n.credentials.invalidateToken(),t}))},t}(),Kr=function(){function t(t){this.datastore=t,this.readVersions=ke(),this.mutations=[],this.committed=!1}return t.prototype.recordVersion=function(t){var e;if(t instanceof ut)e=t.version;else{if(!(t instanceof ct))throw v("Document in a transaction was a "+t.constructor.name);e=Yt.forDeletedDoc()}var n=this.readVersions.get(t.key);if(null!==n){if(!e.isEqual(n))throw new _("aborted","Document version changed between two reads.")}else this.readVersions=this.readVersions.insert(t.key,e)},t.prototype.lookup=function(t){var e=this;return this.committed?Promise.reject("Transaction has already completed."):this.mutations.length>0?Promise.reject("Transactions lookups are invalid after writes."):this.datastore.lookup(t).then((function(t){return t.forEach((function(t){t instanceof ct||t instanceof ut?e.recordVersion(t):v("Document in a transaction was a "+t.constructor.name)})),t}))},t.prototype.write=function(t){if(this.committed)throw new _("failed-precondition","Transaction has already completed.");this.mutations=this.mutations.concat(t)},t.prototype.precondition=function(t){var e=this.readVersions.get(t);return e?oe.updateTime(e):oe.NONE},t.prototype.preconditionForUpdate=function(t){var e=this.readVersions.get(t);if(e&&e.isEqual(Yt.forDeletedDoc()))throw new _("failed-precondition","Can't update a document that doesn't exist.");return e?oe.updateTime(e):oe.exists(!0)},t.prototype.set=function(t,e){this.write(e.toMutations(t,this.prec
1ondition(t)))},t.prototype.update=function(t,e){this.write(e.toMutations(t,this.preconditionForUpdate(t)))},t.prototype.delete=function(t){this.write([new le(t,this.precondition(t))]),this.readVersions=this.readVersions.insert(t,Yt.forDeletedDoc())},t.prototype.commit=function(){var t=this,e=this.readVersions;return this.mutations.forEach((function(t){e=e.remove(t.key)})),e.isEmpty()?this.datastore.commit(this.mutations).then((function(){t.committed=!0})):Promise.reject(Error("Every document read in a transaction must also be written."))},t}(),Gr=function(t){return t[t.Unknown=0]="Unknown",t[t.Online=1]="Online",t[t.Offline=2]="Offline",t}({}),Qr=function(t){return t[t.RemoteStore=0]="RemoteStore",t[t.SharedClientState=1]="SharedClientState",t}({}),Yr=function(){function t(t,e){this.asyncQueue=t,this.onlineStateHandler=e,this.state=Gr.Unknown,this.watchStreamFailures=0,this.onlineStateTimer=null,this.shouldWarnClientIsOffline=!0}return t.prototype.handleWatchStreamStart=function(){var t=this;0===this.watchStreamFailures&&(this.setAndBroadcast(Gr.Unknown),g(null===this.onlineStateTimer,"onlineStateTimer shouldn't be started yet"),this.onlineStateTimer=this.asyncQueue.enqueueAfterDelay(sn.OnlineStateTimeout,1e4,(function(){return t.onlineStateTimer=null,g(t.state===Gr.Unknown,"Timer should be canceled if we transitioned to a different state."),t.logClientOfflineWarningIfNecessary("Backend didn't respond within 10 seconds."),t.setAndBroadcast(Gr.Offline),Promise.resolve()})))},t.prototype.handleWatchStreamFailure=function(t){this.state===Gr.Online?(this.setAndBroadcast(Gr.Unknown),g(0===this.watchStreamFailures,"watchStreamFailures must be 0"),g(null===this.onlineStateTimer,"onlineStateTimer must be null")):(this.watchStreamFailures++,this.watchStreamFailures>=1&&(this.clearOnlineStateTimer(),this.logClientOfflineWarningIfNecessary("Connection failed 1 times. Most recent error: "+t.toString()),this.setAndBroadcast(Gr.Offline)))},t.prototype.set=function(t){this.clearOnlineStateTimer(),this.watchStreamFailures=0,t===Gr.Online&&(this.shouldWarnClientIsOffline=!1),this.setAndBroadcast(t)},t.prototype.setAndBroadcast=function(t){t!==this.state&&(this.state=t,this.onlineStateHandler(t))},t.prototype.logClientOfflineWarningIfNecessary=function(t){var e="Could not reach Cloud Firestore backend. "+t+"\nThis typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.";this.shouldWarnClientIsOffline?(m(e),this.shouldWarnClientIsOffline=!1):p("OnlineStateTracker",e)},t.prototype.clearOnlineStateTimer=function(){null!==this.onlineStateTimer&&(this.onlineStateTimer.cancel(),this.onlineStateTimer=null)},t}(),Xr=function(){function t(t,e,n,r){this.localStore=t,this.datastore=e,this.writePipeline=[],this.listenTargets={},this.watchChangeAggregator=null,this.networkEnabled=!1,this.isPrimary=!1,this.onlineStateTracker=new Yr(n,r),this.watchStream=this.datastore.newPersistentWatchStream({onOpen:this.onWatchStreamOpen.bind(this),onClose:this.onWatchStreamClose.bind(this),onWatchChange:this.onWatchStreamChange.bind(this)}),this.writeStream=this.datastore.newPersistentWriteStream({onOpen:this.onWriteStreamOpen.bind(this),onClose:this.onWriteStreamClose.bind(this),onHandshakeComplete:this.onWriteHandshakeComplete.bind(this),onMutationResult:this.onMutationResult.bind(this)})}return t.prototype.start=function(){return this.enableNetwork()},t.prototype.enableNetwork=function(){return a.__awaiter(this,void 0,void 0,(function(){var t;return a.__generator(this,(function(e){switch(e.label){case 0:return this.networkEnabled=!0,this.canUseNetwork()?(t=this.writeStream,[4,this.localStore.getLastStreamToken()]):[3,3];case 1:return t.lastStreamToken=e.sent(),this.shouldStartWatchStream()?this.startWatchStream():this.onlineStateTracker.set(Gr.Unknown),[4,this.fillWritePipeline()];case 2:e.sent(),e.label=3;case 3:return[2]}}
1))}))},t.prototype.disableNetwork=function(){return a.__awaiter(this,void 0,void 0,(function(){return a.__generator(this,(function(t){switch(t.label){case 0:return this.networkEnabled=!1,[4,this.disableNetworkInternal()];case 1:return t.sent(),this.onlineStateTracker.set(Gr.Offline),[2]}}))}))},t.prototype.disableNetworkInternal=function(){return a.__awaiter(this,void 0,void 0,(function(){return a.__generator(this,(function(t){switch(t.label){case 0:return[4,this.writeStream.stop()];case 1:return t.sent(),[4,this.watchStream.stop()];case 2:return t.sent(),this.writePipeline.length>0&&(p("RemoteStore","Stopping write stream with "+this.writePipeline.length+" pending writes"),this.writePipeline=[]),this.cleanUpWatchStreamState(),[2]}}))}))},t.prototype.shutdown=function(){return a.__awaiter(this,void 0,void 0,(function(){return a.__generator(this,(function(t){switch(t.label){case 0:return p("RemoteStore","RemoteStore shutting down."),this.networkEnabled=!1,[4,this.disableNetworkInternal()];case 1:return t.sent(),this.onlineStateTracker.set(Gr.Unknown),[2]}}))}))},t.prototype.listen=function(t){g(!C(this.listenTargets,t.targetId),"listen called with duplicate targetId!"),this.listenTargets[t.targetId]=t,this.shouldStartWatchStream()?this.startWatchStream():this.watchStream.isOpen()&&this.sendWatchRequest(t)},t.prototype.unlisten=function(t){g(C(this.listenTargets,t),"unlisten called without assigned target ID!"),delete this.listenTargets[t],this.watchStream.isOpen()&&this.sendUnwatchRequest(t),I(this.listenTargets)&&(this.watchStream.isOpen()?this.watchStream.markIdle():this.canUseNetwork()&&this.onlineStateTracker.set(Gr.Unknown))},t.prototype.getQueryDataForTarget=function(t){return this.listenTargets[t]||null},t.prototype.getRemoteKeysForTarget=function(t){return this.syncEngine.getRemoteKeysForTarget(t)},t.prototype.sendWatchRequest=function(t){this.watchChangeAggregator.recordPendingTargetRequest(t.targetId),this.watchStream.watch(t)},t.prototype.sendUnwatchRequest=function(t){this.watchChangeAggregator.recordPendingTargetRequest(t),this.watchStream.unwatch(t)},t.prototype.startWatchStream=function(){g(this.shouldStartWatchStream(),"startWatchStream() called when shouldStartWatchStream() is false."),this.watchChangeAggregator=new We(this),this.watchStream.start(),this.onlineStateTracker.handleWatchStreamStart()},t.prototype.shouldStartWatchStream=function(){return this.canUseNetwork()&&!this.watchStream.isStarted()&&!I(this.listenTargets)},t.prototype.canUseNetwork=function(){return this.isPrimary&&this.networkEnabled},t.prototype.cleanUpWatchStreamState=function(){this.watchChangeAggregator=null},t.prototype.onWatchStreamOpen=function(){return a.__awaiter(this,void 0,void 0,(function(){var t=this;return a.__generator(this,(function(e){return T(this.listenTargets,(function(e,n){t.sendWatchRequest(n)})),[2]}))}))},t.prototype.onWatchStreamClose=function(t){return a.__awaiter(this,void 0,void 0,(function(){return a.__generator(this,(function(e){return void 0===t&&g(!this.shouldStartWatchStream(),"Watch stream was stopped gracefully while still needed."),this.cleanUpWatchStreamState(),this.shouldStartWatchStream()?(this.onlineStateTracker.handleWatchStreamFailure(t),this.startWatchStream()):this.onlineStateTracker.set(Gr.Unknown),[2]}))}
1))},t.prototype.onWatchStreamChange=function(t,e){return a.__awaiter(this,void 0,void 0,(function(){var n;return a.__generator(this,(function(r){switch(r.label){case 0:return this.onlineStateTracker.set(Gr.Online),t instanceof qe&&t.state===Ve.Removed&&t.cause?[2,this.handleTargetError(t)]:(t instanceof Fe?this.watchChangeAggregator.handleDocumentChange(t):t instanceof Ue?this.watchChangeAggregator.handleExistenceFilter(t):(g(t instanceof qe,"Expected watchChange to be an instance of WatchTargetChange"),this.watchChangeAggregator.handleTargetChange(t)),e.isEqual(Yt.MIN)?[3,3]:[4,this.localStore.getLastRemoteSnapshotVersion()]);case 1:return n=r.sent(),e.compareTo(n)>=0?[4,this.raiseWatchSnapshot(e)]:[3,3];case 2:r.sent(),r.label=3;case 3:return[2]}}))}))},t.prototype.raiseWatchSnapshot=function(t){var e=this;g(!t.isEqual(Yt.MIN),"Can't raise event for unknown SnapshotVersion");var n=this.watchChangeAggregator.createRemoteEvent(t);return T(n.targetChanges,(function(n,r){if(r.resumeToken.length>0){var i=e.listenTargets[n];i&&(e.listenTargets[n]=i.copy({resumeToken:r.resumeToken,snapshotVersion:t}))}})),n.targetMismatches.forEach((function(t){var n=e.listenTargets[t];if(n){e.listenTargets[t]=n.copy({resumeToken:w()}),e.sendUnwatchRequest(t);var r=new Jt(n.query,t,Xt.ExistenceFilterMismatch,n.sequenceNumber);e.sendWatchRequest(r)}})),this.syncEngine.applyRemoteEvent(n)},t.prototype.handleTargetError=function(t){var e=this;g(!!t.cause,"Handling target error without a cause");var n=t.cause,r=Promise.resolve();return t.targetIds.forEach((function(t){r=r.then((function(){return a.__awaiter(e,void 0,void 0,(function(){return a.__generator(this,(function(e){return C(this.listenTargets,t)?(delete this.listenTargets[t],this.watchChangeAggregator.removeTarget(t),[2,this.syncEngine.rejectListen(t,n)]):[2]}))}))}))})),r},t.prototype.fillWritePipeline=function(){return a.__awaiter(this,void 0,void 0,(function(){var t;return a.__generator(this,(function(e){switch(e.label){case 0:return this.canAddToWritePipeline()?[4,this.localStore.nextMutationBatch(this.writePipeline.length>0?this.writePipeline[this.writePipeline.length-1].batchId:-1)]:[3,4];case 1:return null!==(t=e.sent())?[3,2]:(0===this.writePipeline.length&&this.writeStream.markIdle(),[3,4]);case 2:return this.addToWritePipeline(t),[4,this.fillWritePipeline()];case 3:e.sent(),e.label=4;case 4:return this.shouldStartWriteStream()&&this.startWriteStream(),[2]}}))}))},t.prototype.canAddToWritePipeline=function(){return this.canUseNetwork()&&this.writePipeline.length<10},t.prototype.outstandingWrites=function(){return this.writePipeline.length},t.prototype.addToWritePipeline=function(t){g(this.canAddToWritePipeline(),"addToWritePipeline called when pipeline is full"),this.writePipeline.push(t),this.writeStream.isOpen()&&this.writeStream.handshakeComplete&&this.writeStream.writeMutations(t.mutations)},t.prototype.shouldStartWriteStream=function(){return this.canUseNetwork()&&!this.writeStream.isStarted()&&this.writePipeline.length>0},t.prototype.startWriteStream=function(){g(this.shouldStartWriteStream(),"startWriteStream() called when shouldStartWriteStream() is false."),this.writeStream.start()},t.prototype.onWriteStreamOpen=function(){return a.__awaiter(this,void 0,void 0,(function(){return a.__generator(this,(function(t){return this.writeStream.writeHandshake(),[2]}))}))},t.prototype.onWriteHandshakeComplete=function(){var t=this;return this.localStore.setLastStreamToken(this.writeStream.lastStreamToken).then((function(){for(var e=0,n=t.writePipeline;e<n.length;e++)t.writeStream.writeMutations(n[e].mutations)})).catch(Er)},t.prototype.onMutationResult=function(t,e){var n=this;g(this.writePipeline.length>0,"Got result for empty write pipeline");var r=this.writePipeline.shift(),i=vn.from(r,t,e,this.writeStream.lastStreamToken);return this.syncEngine.applySuccessfulWrite(i).then((function(){return n.fillWritePipeline()}))},t.prototype.onWriteStreamClose=function(t){return a.__awaiter(this,void 0,void 0,(function(){var e=this;return a.__generator(this,(function(n){return void 0===t&&g(!this.shouldStartWriteStream(),"Write stream was stopped gracefully while still needed."),t&&this.writePipeline.length>0?[2,(this.writeStream.handshakeComplete?this.handleWriteError(t):this.handleHandshakeError(t)).then((function(){e.shouldStartWriteStream()&&e.startWriteStream()}))]:[2]}))}))},t.prototype.handleHandshakeError=function(t){return a.__awaiter(this,void 0,void 0,(function(){return a.__generator(this,(function(e){return ve(t.code)?(p("RemoteStore","RemoteStore error before completed handshake; resetting stream token: ",this.writeStream.lastStreamToken),this.writeStream.lastStreamToken=w(),[2,this.localStore.setLastStreamToken(w()).catch(Er)]):[2]}))}))},t.prototype.handleWriteError=function(t){return a.__awaiter(this,void 0,void 0,(function(){var e,n=this;return a.__generator(this,(function(r){return ve(i=t.code)&&"aborted"!==i?(e=this.writePipeline.shift(),this.writeStream.inhibitBackoff(),[2,this.syncEngine.rejectFailedWrite(e.batchId,t).then((function(){return n.fillWritePipeline()}))]):[2];var i}))}))},t.prototype.createTransaction=function(){return new Kr(this.datastore)},t.prototype.handleCredentialChange=function(){return a.__awaiter(this,void 0,void 0,(function(){return a.__generator(this,(function(t){switch(t.label){case 0:return this.canUseNetwork()?(p("RemoteStore","RemoteStore restarting streams for new credential"),this.networkEnabled=!1,[4,this.disableNetworkInternal()]):[3,3];case 1:return t.sent(),this.onlineStateTracker.set(Gr.Unknown),[4,this.enableNetwork()];case 2:t.sent(),t.label=3;case 3:return[2]}}
1))}))},t.prototype.applyPrimaryState=function(t){return a.__awaiter(this,void 0,void 0,(function(){return a.__generator(this,(function(e){switch(e.label){case 0:return this.isPrimary=t,t&&this.networkEnabled?[4,this.enableNetwork()]:[3,2];case 1:return e.sent(),[3,4];case 2:return t?[3,4]:[4,this.disableNetworkInternal()];case 3:e.sent(),this.onlineStateTracker.set(Gr.Unknown),e.label=4;case 4:return[2]}}))}))},t}(),Jr=function(){return function(){this.listeners=[]}}(),Zr=function(){function t(t){this.syncEngine=t,this.queries=new Pn((function(t){return t.canonicalId()})),this.onlineState=Gr.Unknown,this.syncEngine.subscribe(this)}return t.prototype.listen=function(t){var e=t.query,n=!1,r=this.queries.get(e);return r||(n=!0,r=new Jr,this.queries.set(e,r)),r.listeners.push(t),t.applyOnlineStateChange(this.onlineState),r.viewSnap&&t.onViewSnapshot(r.viewSnap),n?this.syncEngine.listen(e).then((function(t){return r.targetId=t,t})):Promise.resolve(r.targetId)},t.prototype.unlisten=function(t){return a.__awaiter(this,void 0,void 0,(function(){var e,n,r,i;return a.__generator(this,(function(o){return n=!1,(r=this.queries.get(e=t.query))&&(i=r.listeners.indexOf(t))>=0&&(r.listeners.splice(i,1),n=0===r.listeners.length),n?(this.queries.delete(e),[2,this.syncEngine.unlisten(e)]):[2]}))}))},t.prototype.onWatchChange=function(t){for(var e=0,n=t;e<n.length;e++){var r=n[e],i=this.queries.get(r.query);if(i){for(var o=0,a=i.listeners;o<a.length;o++)a[o].onViewSnapshot(r);i.viewSnap=r}}},t.prototype.onWatchError=function(t,e){var n=this.queries.get(t);if(n)for(var r=0,i=n.listeners;r<i.length;r++)i[r].onError(e);this.queries.delete(t)},t.prototype.onOnlineStateChange=function(t){this.onlineState=t,this.queries.forEach((function(e,n){for(var r=0,i=n.listeners;r<i.length;r++)i[r].applyOnlineStateChange(t)}))},t}(),ti=function(){function t(t,e,n){this.query=t,this.queryObserver=e,this.raisedInitialEvent=!1,this.onlineState=Gr.Unknown,this.options=n||{}}return t.prototype.onViewSnapshot=function(t){if(g(t.docChanges.length>0||t.syncStateChanged,"We got a new snapshot with no changes?"),!this.options.includeMetadataChanges){for(var e=[],n=0,r=t.docChanges;n<r.length;n++){var i=r[n];i.type!==De.Metadata&&e.push(i)}t=new je(t.query,t.docs,t.oldDocs,e,t.mutatedKeys,t.fromCache,t.syncStateChanged,!0)}this.raisedInitialEvent?this.shouldRaiseEvent(t)&&this.queryObserver.next(t):this.shouldRaiseInitialEvent(t,this.onlineState)&&this.raiseInitialEvent(t),this.snap=t},t.prototype.onError=function(t){this.queryObserver.error(t)},t.prototype.applyOnlineStateChange=function(t){this.onlineState=t,this.snap&&!this.raisedInitialEvent&&this.shouldRaiseInitialEvent(this.snap,t)&&this.raiseInitialEvent(this.snap)},t.prototype.shouldRaiseInitialEvent=function(t,e){return g(!this.raisedInitialEvent,"Determining whether to raise first event but already had first event"),!t.fromCache||(this.options.waitForSyncWhenOnline&&e!==Gr.Offline?(g(t.fromCache,"Waiting for sync, but snapshot is not from cache"),!1):!t.docs.isEmpty()||e===Gr.Offline)},t.prototype.shouldRaiseEvent=function(t){return t.docChanges.length>0||!!(t.syncStateChanged||this.snap&&this.snap.hasPendingWrites!==t.hasPendingWrites)&&!0===this.options.includeMetadataChanges},t.prototype.raiseInitialEvent=function(t){g(!this.raisedInitialEvent,"Trying to raise initial events for second time"),t=je.fromInitialDocuments(t.query,t.docs,t.mutatedKeys,t.fromCache),this.raisedInitialEvent=!0,this.queryObserver.next(t)},t}(),ei=function(){function t(t,e,n){this.targetId=t,this.addedKeys=e,this.removedKeys=n}return t.fromSnapshot=function(e,n){for(var r=Oe(),i=Oe(),o=0,a=n.docChanges;o<a.length;o++){var s=a[o];switch(s.type){case De.Added:r=r.add(s.doc.key);break;case De.Removed:i=i.add(s.doc.key)}}return new t(e,r,i)},t}(),ni=function(){return function(t){this.key=t}}(),ri=function(){return function(t){this.key=t}}(),ii=function(){function t(t,e){this.query=t,this._syncedDocuments=e,this.syncState=null,this.current=!1,this.limboDocuments=Oe(),this.mutatedKeys=Oe(),this.documentSet=new Pe(t.docComparator.bind(t))}return Object.defineProperty(t.prototype,"syncedDocuments",{get:function(){return this._syncedDocuments},enumerable:!0,configurable:!0}),t.prototype.computeDocChanges=function(t,e){var n=this,r=e?e.changeSet:new Ne,i=e?e.documentSet
1:this.documentSet,o=e?e.mutatedKeys:this.mutatedKeys,a=i,s=!1,u=this.query.hasLimit()&&i.size===this.query.limit?i.last():null;if(t.inorderTraversal((function(t,e){var c=i.get(t),l=e instanceof ut?e:null;l&&(g(t.isEqual(l.key),"Mismatching keys found in document changes: "+t+" != "+l.key),l=n.query.matches(l)?l:null);var h=!!c&&n.mutatedKeys.has(c.key),f=!!l&&(l.hasLocalMutations||n.mutatedKeys.has(l.key)&&l.hasCommittedMutations),d=!1;c&&l?c.data.isEqual(l.data)?h!==f&&(r.track({type:De.Metadata,doc:l}),d=!0):n.shouldWaitForSyncedDocument(c,l)||(r.track({type:De.Modified,doc:l}),d=!0,u&&n.query.docComparator(l,u)>0&&(s=!0)):!c&&l?(r.track({type:De.Added,doc:l}),d=!0):c&&!l&&(r.track({type:De.Removed,doc:c}),d=!0,u&&(s=!0)),d&&(l?(a=a.add(l),o=f?o.add(t):o.delete(t)):(a=a.delete(t),o=o.delete(t)))})),this.query.hasLimit())for(;a.size>this.query.limit;){var c=a.last();a=a.delete(c.key),o=o.delete(c.key),r.track({type:De.Removed,doc:c})}return g(!s||!e,"View was refilled using docs that themselves needed refilling."),{documentSet:a,changeSet:r,needsRefill:s,mutatedKeys:o}},t.prototype.shouldWaitForSyncedDocument=function(t,e){return t.hasLocalMutations&&e.hasCommittedMutations&&!e.hasLocalMutations},t.prototype.applyChanges=function(t,e,n){var r=this;g(!t.needsRefill,"Cannot apply changes that need a refill");var i=this.documentSet;this.documentSet=t.documentSet,this.mutatedKeys=t.mutatedKeys;var o=t.changeSet.getChanges();o.sort((function(t,e){return function(t,e){var n=function(t){switch(t){case De.Added:return 1;case De.Modified:case De.Metadata:return 2;case De.Removed:return 0;default:return v("Unknown ChangeType: "+t)}};return n(t)-n(e)}(t.type,e.type)||r.query.docComparator(t.doc,e.doc)})),this.applyTargetChange(n);var a=e?this.updateLimboDocuments():[],s=0===this.limboDocuments.size&&this.current?Re.Synced:Re.Local,u=s!==this.syncState;return this.syncState=s,0!==o.length||u?{snapshot:new je(this.query,t.documentSet,i,o,t.mutatedKeys,s===Re.Local,u,!1),limboChanges:a}:{limboChanges:a}},t.prototype.applyOnlineStateChange=function(t){return this.current&&t===Gr.Offline?(this.current=!1,this.applyChanges({documentSet:this.documentSet,changeSet:new Ne,mutatedKeys:this.mutatedKeys,needsRefill:!1},!1)):{limboChanges:[]}},t.prototype.shouldBeInLimbo=function(t){return!this._syncedDocuments.has(t)&&!!this.documentSet.has(t)&&!this.documentSet.get(t).hasLocalMutations},t.prototype.applyTargetChange=function(t){var e=this;t&&(t.addedDocuments.forEach((function(t){return e._syncedDocuments=e._syncedDocuments.add(t)})),t.modifiedDocuments.forEach((function(t){return g(e._syncedDocuments.has(t),"Modified document "+t+" not found in view.")})),t.removedDocuments.forEach((function(t){return e._syncedDocuments=e._syncedDocuments.delete(t)})),this.current=t.current)},t.prototype.updateLimboDocuments=function(){var t=this;if(!this.current)return[];var e=this.limboDocuments;this.limboDocuments=Oe(),this.documentSet.forEach((function(e){t.shouldBeInLimbo(e.key)&&(t.limboDocuments=t.limboDocuments.add(e.key))}));var n=[];return e.forEach((function(e){t.limboDocuments.has(e)||n.push(new ri(e))})),this.limboDocuments.forEach((function(t){e.has(t)||n.push(new ni(t))})),n},t.prototype.synchronizeWithPersistedState=function(t,e){this._syncedDocuments=e,this.limboDocuments=Oe();var n=this.computeDocChanges(t);return this.applyChanges(n,!0)},t.prototype.computeInitialSnapshot=function(){return je.fromInitialDocuments(this.query,this.documentSet,this.mutatedKeys,this.syncState===Re.Local)},t}(),oi=function(){return function(t,e,n){this.query=t,this.targetId=e,this.view=n}}(),ai=function(){return function(t){this.key=t}}(),si=function(){function t(t,e,n,r){this.localStore=t,this.remoteStore=e,this.sharedClientState=n,this.currentUser=r,this.syncEngineListener=null,this.queryViewsByQuery=new Pn((function(t){return t.canonicalId()})),this.queryViewsByTarget={},this.limboTargetsByKey=new ht(at.comparator),this.limboResolutionsByTarget={},this.limboDocumentRefs=new Ar,this.mutationUserCallbacks={},this.limboTargetIdGenerator=bn.forSyncEngine(),this.isPrimary=void 0,this.onlineState=Gr.Unknown}return Object.defineProperty(t.prototype,"isPrimaryClient",{get:function(){return!0===this.isPrimary},enumerable:!0,configurable:!0}),t.prototype.subscribe=function(t){g(null!==t,"SyncEngine listener cannot be null"),g(null===this.syncEngineListener,"SyncEngine already has a subscriber."),this.syncEngineListener=t},t.prototype.listen=function(t){return a.__awaiter(this,void 0,void 0,(function(){var e,n,r,i,o;return a.__generator(this,(function(a){switch(a.label){case 0:return this.assertSubscribed("listen()"),(r=this.queryViewsByQuery.get(t))?(this.sharedCl
1ientState.addLocalQueryTarget(e=r.targetId),n=r.view.computeInitialSnapshot(),[3,4]):[3,1];case 1:return[4,this.localStore.allocateQuery(t)];case 2:return i=a.sent(),o=this.sharedClientState.addLocalQueryTarget(i.targetId),e=i.targetId,[4,this.initializeViewAndComputeSnapshot(i,"current"===o)];case 3:n=a.sent(),this.isPrimary&&this.remoteStore.listen(i),a.label=4;case 4:return this.syncEngineListener.onWatchChange([n]),[2,e]}}))}))},t.prototype.initializeViewAndComputeSnapshot=function(t,e){var n=this,r=t.query;return this.localStore.executeQuery(r).then((function(i){return n.localStore.remoteDocumentKeys(t.targetId).then((function(o){var a=new ii(r,o),s=a.computeDocChanges(i),u=Le.createSynthesizedTargetChangeForCurrentChange(t.targetId,e&&n.onlineState!==Gr.Offline),c=a.applyChanges(s,!0===n.isPrimary,u);g(0===c.limboChanges.length,"View returned limbo docs before target ack from the server."),g(!!c.snapshot,"applyChanges for new view should always return a snapshot");var l=new oi(r,t.targetId,a);return n.queryViewsByQuery.set(r,l),n.queryViewsByTarget[t.targetId]=l,c.snapshot}))}))},t.prototype.synchronizeViewAndComputeSnapshot=function(t){var e=this;return this.localStore.executeQuery(t.query).then((function(n){return e.localStore.remoteDocumentKeys(t.targetId).then((function(r){return a.__awaiter(e,void 0,void 0,(function(){var e;return a.__generator(this,(function(i){return e=t.view.synchronizeWithPersistedState(n,r),this.isPrimary&&this.updateTrackedLimbos(t.targetId,e.limboChanges),[2,e]}))}))}))}))},t.prototype.unlisten=function(t){return a.__awaiter(this,void 0,void 0,(function(){var e,n=this;return a.__generator(this,(function(r){switch(r.label){case 0:return this.assertSubscribed("unlisten()"),g(!!(e=this.queryViewsByQuery.get(t)),"Trying to unlisten on query not found:"+t),this.isPrimary?(this.sharedClientState.removeLocalQueryTarget(e.targetId),this.sharedClientState.isActiveQueryTarget(e.targetId)?[3,2]:[4,this.localStore.releaseQuery(t,!1).then((function(){n.sharedClientState.clearQueryState(e.targetId),n.remoteStore.unlisten(e.targetId),n.removeAndCleanupQuery(e)})).catch(Er)]):[3,3];case 1:r.sent(),r.label=2;case 2:return[3,5];case 3:return this.removeAndCleanupQuery(e),[4,this.localStore.releaseQuery(t,!0)];case 4:r.sent(),r.label=5;case 5:return[2]}}
1))}))},t.prototype.write=function(t,e){var n=this;return this.assertSubscribed("write()"),this.localStore.localWrite(t).then((function(t){return n.sharedClientState.addPendingMutation(t.batchId),n.addMutationCallback(t.batchId,e),n.emitNewSnapsAndNotifyLocalStore(t.changes)})).then((function(){return n.remoteStore.fillWritePipeline()}))},t.prototype.wrapUpdateFunctionError=function(t){return t},t.prototype.runTransaction=function(t,e){var n=this;void 0===e&&(e=5),g(e>=0,"Got negative number of retries for transaction.");var r=this.remoteStore.createTransaction();return function(){try{var e=t(r);return!Lt(e)&&e.catch&&e.then?e.catch((function(t){return Promise.reject(n.wrapUpdateFunctionError(t))})):Promise.reject(Error("Transaction callback must return a Promise"))}catch(i){return Promise.reject(n.wrapUpdateFunctionError(i))}}().then((function(i){return r.commit().then((function(){return i})).catch((function(r){return 0===e?Promise.reject(r):n.runTransaction(t,e-1)}))}))},t.prototype.applyRemoteEvent=function(t){var e=this;return this.assertSubscribed("applyRemoteEvent()"),this.localStore.applyRemoteEvent(t).then((function(n){return k(t.targetChanges,(function(t,n){var r=e.limboResolutionsByTarget[t];r&&(g(n.addedDocuments.size+n.modifiedDocuments.size+n.removedDocuments.size<=1,"Limbo resolution for single document contains multiple changes."),n.addedDocuments.size>0?r.receivedDocument=!0:n.modifiedDocuments.size>0?g(r.receivedDocument,"Received change for limbo target document without add."):n.removedDocuments.size>0&&(g(r.receivedDocument,"Received remove for limbo target document without add."),r.receivedDocument=!1))})),e.emitNewSnapsAndNotifyLocalStore(n,t)})).catch(Er)},t.prototype.applyOnlineStateChange=function(t,e){if(this.isPrimary&&e===Qr.RemoteStore||!this.isPrimary&&e===Qr.SharedClientState){var n=[];this.queryViewsByQuery.forEach((function(e,r){var i=r.view.applyOnlineStateChange(t);g(0===i.limboChanges.length,"OnlineState should not affect limbo documents."),i.snapshot&&n.push(i.snapshot)})),this.syncEngineListener.onOnlineStateChange(t),this.syncEngineListener.onWatchChange(n),this.onlineState=t,this.isPrimary&&this.sharedClientState.setOnlineState(t)}},t.prototype.rejectListen=function(t,e){return a.__awaiter(this,void 0,void 0,(function(){var n,r,i,o,s,u,c=this;return a.__generator(this,(function(a){switch(a.label){case 0:return this.assertSubscribed("rejectListens()"),this.sharedClientState.updateQueryState(t,"rejected",e),(r=(n=this.limboResolutionsByTarget[t])&&n.key)?(this.limboTargetsByKey=this.limboTargetsByKey.remove(r),delete this.limboResolutionsByTarget[t],i=(i=new ht(at.comparator)).insert(r,new ct(r,Yt.forDeletedDoc())),o=Oe().add(r),s=new Me(Yt.MIN,{},new Zt($),i,o),[2,this.applyRemoteEvent(s)]):[3,1];case 1:return g(!!(u=this.queryViewsByTarget[t]),"Unknown targetId: "+t),[4,this.localStore.releaseQuery(u.query,!1).then((function(){return c.removeAndCleanupQuery(u)})).catch(Er)];case 2:a.sent(),this.syncEngineListener.onWatchError(u.query,e),a.label=3;case 3:return[2]}}
1))}))},t.prototype.applyBatchState=function(t,e,n){return a.__awaiter(this,void 0,void 0,(function(){var r;return a.__generator(this,(function(i){switch(i.label){case 0:return this.assertSubscribed("applyBatchState()"),[4,this.localStore.lookupMutationDocuments(t)];case 1:return null===(r=i.sent())?(p("SyncEngine","Cannot apply mutation batch with id: "+t),[2]):"pending"!==e?[3,3]:[4,this.remoteStore.fillWritePipeline()];case 2:return i.sent(),[3,4];case 3:"acknowledged"===e||"rejected"===e?(this.processUserCallback(t,n||null),this.localStore.removeCachedMutationBatchMetadata(t)):v("Unknown batchState: "+e),i.label=4;case 4:return[4,this.emitNewSnapsAndNotifyLocalStore(r)];case 5:return i.sent(),[2]}}))}))},t.prototype.applySuccessfulWrite=function(t){var e=this;this.assertSubscribed("applySuccessfulWrite()");var n=t.batch.batchId;return this.processUserCallback(n,null),this.localStore.acknowledgeBatch(t).then((function(t){return e.sharedClientState.updateMutationState(n,"acknowledged"),e.emitNewSnapsAndNotifyLocalStore(t)})).catch(Er)},t.prototype.rejectFailedWrite=function(t,e){var n=this;return this.assertSubscribed("rejectFailedWrite()"),this.processUserCallback(t,e),this.localStore.rejectBatch(t).then((function(r){return n.sharedClientState.updateMutationState(t,"rejected",e),n.emitNewSnapsAndNotifyLocalStore(r)})).catch(Er)},t.prototype.addMutationCallback=function(t,e){var n=this.mutationUserCallbacks[this.currentUser.toKey()];n||(n=new ht($)),n=n.insert(t,e),this.mutationUserCallbacks[this.currentUser.toKey()]=n},t.prototype.processUserCallback=function(t,e){var n=this.mutationUserCallbacks[this.currentUser.toKey()];if(n){var r=n.get(t);r&&(g(t===n.minKey(),"Mutation callbacks processed out-of-order?"),e?r.reject(e):r.resolve(),n=n.remove(t)),this.mutationUserCallbacks[this.currentUser.toKey()]=n}},t.prototype.removeAndCleanupQuery=function(t){var e=this;if(this.sharedClientState.removeLocalQueryTarget(t.targetId),this.queryViewsByQuery.delete(t.query),delete this.queryViewsByTarget[t.targetId],this.isPrimary){var n=this.limboDocumentRefs.referencesForId(t.targetId);this.limboDocumentRefs.removeReferencesForId(t.targetId),n.forEach((function(t){e.limboDocumentRefs.containsKey(t)||e.removeLimboTarget(t)}))}},t.prototype.removeLimboTarget=function(t){var e=this.limboTargetsByKey.get(t);null!==e&&(this.remoteStore.unlisten(e),this.limboTargetsByKey=this.limboTargetsByKey.remove(t),delete this.limboResolutionsByTarget[e])},t.prototype.updateTrackedLimbos=function(t,e){for(var n=0,r=e;n<r.length;n++){var i=r[n];i instanceof ni?(this.limboDocumentRefs.addReference(i.key,t),this.trackLimboChange(i)):i instanceof ri?(p("SyncEngine","Document no longer in limbo: "+i.key),this.limboDocumentRefs.removeReference(i.key,t),this.limboDocumentRefs.containsKey(i.key)||this.removeLimboTarget(i.key)):v("Unknown limbo change: "+JSON.stringify(i))}},t.prototype.trackLimboChange=function(t){var e=t.key;if(!this.limboTargetsByKey.get(e)){p("SyncEngine","New document in limbo: "+e);var n=this.limboTargetIdGenerator.next(),r=Ut.atPath(e.path);this.limboResolutionsByTarget[n]=new ai(e),this.remoteStore.listen(new Jt(r,n,Xt.LimboResolution,un.INVALID)),this.limboTargetsByKey=this.limboTargetsByKey.insert(e,n)}},t.prototype.currentLimboDocs=function(){return this.limboTargetsByKey},t.prototype.emitNewSnapsAndNotifyLocalStore=function(t,e){return a.__awaiter(this,void 0,void 0,(function(){var n,r,i,o=this;return a.__generator(this,(function(a){switch(a.label){case 0:return n=[],r=[],i=[],this.queryViewsByQuery.forEach((function(a,s){i.push(Promise.resolve().then((function(){var e=s.view.computeDocChanges(t);return e.needsRefill?o.localStore.executeQuery(s.query).then((function(t){return s.view.computeDocChanges(t,e)})):e})).then((function(t){var i=s.view.applyChanges(t,!0===o.isPrimary,e&&e.targetChanges[s.targetId]);if(o.updateTrackedLimbos(s.targetId,i.limboChanges),i.snapshot){o.isPrimary&&o.sharedClientState.updateQueryState(s.targetId,i.snapshot.fromCache?"not-current":"current"),n.push(i.snapshot);var a=ei.fromSnapshot(s.targetId,i.snapshot);r.push(a)}})))})),[4,Promise.all(i)];case 1:return a.sent(),this.syncEngineListener.onWatchChange(n),[4,this.localStore.notifyLocalViewChanges(r)];case 2:return a.sent(),[2]}}))}))},t.prototype.assertSubscribed=function(t){g(null!==this.syncEngineListener,"Trying to call "+t+" before calling subscribe().")},t.prototype.handleCredentialChange=function(t){return a.__awaiter(this,void 0,void 0,(function(){var e,n;return a.__generator(this,(function(r){switch(r.label){case 0:return e=!this.currentUser.isEqual(t),this.currentUser=t,e?[4,this.localStore.handleUserChange(t)]:[3,3];
1case 1:return n=r.sent(),this.sharedClientState.handleUserChange(t,n.removedBatchIds,n.addedBatchIds),[4,this.emitNewSnapsAndNotifyLocalStore(n.affectedDocuments)];case 2:r.sent(),r.label=3;case 3:return[4,this.remoteStore.handleCredentialChange()];case 4:return r.sent(),[2]}}))}))},t.prototype.applyPrimaryState=function(t){return a.__awaiter(this,void 0,void 0,(function(){var e,n,r,i,o,s,u=this;return a.__generator(this,(function(a){switch(a.label){case 0:return!0!==t||!0===this.isPrimary?[3,3]:(this.isPrimary=!0,[4,this.remoteStore.applyPrimaryState(!0)]);case 1:return a.sent(),e=this.sharedClientState.getAllActiveQueryTargets(),[4,this.synchronizeQueryViewsAndRaiseSnapshots(e.toArray())];case 2:for(n=a.sent(),r=0,i=n;r<i.length;r++)this.remoteStore.listen(i[r]);return[3,7];case 3:return!1!==t||!1===this.isPrimary?[3,7]:(this.isPrimary=!1,o=[],s=Promise.resolve(),T(this.queryViewsByTarget,(function(t,e){u.sharedClientState.isLocalQueryTarget(t)?o.push(t):s=s.then((function(){return u.unlisten(e.query)})),u.remoteStore.unlisten(e.targetId)})),[4,s]);case 4:return a.sent(),[4,this.synchronizeQueryViewsAndRaiseSnapshots(o)];case 5:return a.sent(),this.resetLimboDocuments(),[4,this.remoteStore.applyPrimaryState(!1)];case 6:a.sent(),a.label=7;case 7:return[2]}}
1))}))},t.prototype.resetLimboDocuments=function(){var t=this;T(this.limboResolutionsByTarget,(function(e){t.remoteStore.unlisten(e)})),this.limboDocumentRefs.removeAllReferences(),this.limboResolutionsByTarget=[],this.limboTargetsByKey=new ht(at.comparator)},t.prototype.synchronizeQueryViewsAndRaiseSnapshots=function(t){for(var e=this,n=Promise.resolve(),r=[],i=[],o=function(t){n=n.then((function(){return a.__awaiter(e,void 0,void 0,(function(){var e,n,o,s;return a.__generator(this,(function(a){switch(a.label){case 0:return(n=this.queryViewsByTarget[t])?[4,this.localStore.releaseQuery(n.query,!0)]:[3,4];case 1:return a.sent(),[4,this.localStore.allocateQuery(n.query)];case 2:return e=a.sent(),[4,this.synchronizeViewAndComputeSnapshot(n)];case 3:return(o=a.sent()).snapshot&&i.push(o.snapshot),[3,8];case 4:return g(!0===this.isPrimary,"A secondary tab should never have an active query without an active view."),[4,this.localStore.getQueryForTarget(t)];case 5:return g(!!(s=a.sent()),"Query data for target "+t+" not found"),[4,this.localStore.allocateQuery(s)];case 6:return e=a.sent(),[4,this.initializeViewAndComputeSnapshot(e,!1)];case 7:a.sent(),a.label=8;case 8:return r.push(e),[2]}}))}))}))},s=0,u=t;s<u.length;s++)o(u[s]);return n.then((function(){return e.syncEngineListener.onWatchChange(i),r}))},t.prototype.getActiveClients=function(){return this.localStore.getActiveClients()},t.prototype.applyTargetState=function(t,e,n){return a.__awaiter(this,void 0,void 0,(function(){var r,i=this;return a.__generator(this,(function(o){switch(o.label){case 0:if(this.isPrimary)return p("SyncEngine","Ignoring unexpected query state notification."),[2];if(!this.queryViewsByTarget[t])return[3,5];switch(e){case"current":case"not-current":return[3,1];case"rejected":return[3,2]}return[3,4];case 1:return[2,this.localStore.getNewDocumentChanges().then((function(n){return a.__awaiter(i,void 0,void 0,(function(){var r;return a.__generator(this,(function(i){switch(i.label){case 0:return r=Me.createSynthesizedRemoteEventForCurrentChange(t,"current"===e),[4,this.emitNewSnapsAndNotifyLocalStore(n,r)];case 1:return i.sent(),[2]}}))}))}),(function(t){return a.__awaiter(i,void 0,void 0,(function(){var e;return a.__generator(this,(function(n){switch(n.label){case 0:return function(t){return"data-loss"===t.code&&t.message===Rn}(t)?(e=[],T(this.queryViewsByTarget,(function(t){return e.push(t)})),[4,this.synchronizeQueryViewsAndRaiseSnapshots(e)]):[3,2];case 1:return n.sent(),[3,3];case 2:throw t;case 3:return[2]}}
1))}))}))];case 2:return this.removeAndCleanupQuery(r=this.queryViewsByTarget[t]),[4,this.localStore.releaseQuery(r.query,!0)];case 3:return o.sent(),this.syncEngineListener.onWatchError(r.query,n),[3,5];case 4:v("Unexpected target state: "+e),o.label=5;case 5:return[2]}}))}))},t.prototype.applyActiveTargetsChange=function(t,e){return a.__awaiter(this,void 0,void 0,(function(){var n,r,i,o,s,u,c,l,h,f=this;return a.__generator(this,(function(d){switch(d.label){case 0:if(!this.isPrimary)return[2];n=0,r=t,d.label=1;case 1:return n<r.length?(g(!this.queryViewsByTarget[h=r[n]],"Trying to add an already active target"),[4,this.localStore.getQueryForTarget(h)]):[3,6];case 2:return g(!!(i=d.sent()),"Query data for active target "+h+" not found"),[4,this.localStore.allocateQuery(i)];case 3:return o=d.sent(),[4,this.initializeViewAndComputeSnapshot(o,!1)];case 4:d.sent(),this.remoteStore.listen(o),d.label=5;case 5:return n++,[3,1];case 6:s=function(t){var e;return a.__generator(this,(function(n){switch(n.label){case 0:return(e=u.queryViewsByTarget[t])?[4,u.localStore.releaseQuery(e.query,!1).then((function(){f.remoteStore.unlisten(t),f.removeAndCleanupQuery(e)})).catch(Er)]:[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}}
1))},u=this,c=0,l=e,d.label=7;case 7:return c<l.length?[5,s(h=l[c])]:[3,10];case 8:d.sent(),d.label=9;case 9:return c++,[3,7];case 10:return[2]}}))}))},t.prototype.enableNetwork=function(){return this.localStore.setNetworkEnabled(!0),this.remoteStore.enableNetwork()},t.prototype.disableNetwork=function(){return this.localStore.setNetworkEnabled(!1),this.remoteStore.disableNetwork()},t.prototype.getRemoteKeysForTarget=function(t){var e=this.limboResolutionsByTarget[t];return e&&e.receivedDocument?Oe().add(e.key):this.queryViewsByTarget[t]?this.queryViewsByTarget[t].view.syncedDocuments:Oe()},t}(),ui=function(){function t(t){this.uid=t}return t.prototype.isAuthenticated=function(){return null!=this.uid},t.prototype.toKey=function(){return this.isAuthenticated()?"uid:"+this.uid:"anonymous-user"},t.prototype.isEqual=function(t){return t.uid===this.uid},t.UNAUTHENTICATED=new t(null),t.GOOGLE_CREDENTIALS=new t("google-credentials-uid"),t.FIRST_PARTY=new t("first-party-uid"),t}(),ci="SharedClientState",li=function(){function t(t,e,n,r){this.user=t,this.batchId=e,this.state=n,this.error=r,g(void 0!==r==("rejected"===n),"MutationMetadata must contain an error iff state is 'rejected'")}return t.fromWebStorageEntry=function(e,n,r){var i=JSON.parse(r),o="object"==typeof i&&-1!==["pending","acknowledged","rejected"].indexOf(i.state)&&(void 0===i.error||"object"==typeof i.error),a=void 0;return o&&i.error&&(o="string"==typeof i.error.message&&"string"==typeof i.error.code)&&(a=new _(i.error.code,i.error.message)),o?new t(e,n,i.state,a):(m(ci,"Failed to parse mutation state for ID '"+n+"': "+r),null)},t.prototype.toWebStorageJSON=function(){var t={state:this.state,updateTimeMs:Date.now()};return this.error&&(t.error={code:this.error.code,message:this.error.message}),JSON.stringify(t)},t}(),hi=function(){function t(t,e,n){this.targetId=t,this.state=e,this.error=n,g(void 0!==n==("rejected"===e),"QueryTargetMetadata must contain an error iff state is 'rejected'")}return t.fromWebStorageEntry=function(e,n){var r=JSON.parse(n),i="object"==typeof r&&-1!==["not-current","current","rejected"].indexOf(r.state)&&(void 0===r.error||"object"==typeof r.error),o=void 0;return i&&r.error&&(i="string"==typeof r.error.message&&"string"==typeof r.error.code)&&(o=new _(r.error.code,r.error.message)),i?new t(e,r.state,o):(m(ci,"Failed to parse target state for ID '"+e+"': "+n),null)},t.prototype.toWebStorageJSON=function(){var t={state:this.state,updateTimeMs:Date.now()};return this.error&&(t.error={code:this.error.code,message:this.error.message}),JSON.stringify(t)},t}(),fi=function(){function t(t,e){this.clientId=t,this.activeTargetIds=e}return t.fromWebStorageEntry=function(e,n){for(var r=JSON.parse(n),i="object"==typeof r&&r.activeTargetIds instanceof Array,o=Ae(),a=0;i&&a<r.activeTargetIds.length;++a)i=Ft(r.activeTargetIds[a]),o=o.add(r.activeTargetIds[a]);return i?new t(e,o):(m(ci,"Failed to parse client data for instance '"+e+"': "+n),null)},t}(),di=function(){function t(t,e){this.clientId=t,this.onlineState=e}return t.fromWebStorageEntry=function(e){var n=JSON.parse(e);return"object"==typeof n&&void 0!==Gr[n.onlineState]&&"string"==typeof n.clientId?new t(n.clientId,Gr[n.onlineState]):(m(ci,"Failed to parse online state: "+e),null)},t}(),pi=function(){function t(){this.activeTargetIds=Ae()}return t.prototype.addQueryTarget=function(t){g(!this.activeTargetIds.has(t),"Target with ID '"+t+"' already active."),this.activeTargetIds=this.activeTargetIds.add(t)},t.prototype.removeQueryTarget=function(t){this.activeTargetIds=this.activeTargetIds.delete(t)},t.prototype.toWebStorageJSON=function(){var t={activeTargetIds:this.activeTargetIds.toArray(),updateTimeMs:Date.now()};return JSON.stringify(t)},t}(),mi=function(){function t(e,n,r,i,o){if(this.queue=e,this.platform=n,this.persistenceKey=r,this.localClientId=i,this.syncEngine=null,this.onlineStateHandler=null,this.sequenceNumberHandler=null,this.activeClients={},this.storageListener=this.handleWebStorageEvent.bind(this),this.started=!1,this.earlyEvents=[],!t.isAvailable(this.platform))throw new _("unimplemented","LocalStorage is not available on this platform.");var a=r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");this.storage=this.platform.window.localStorage,this.currentUser=o,this.localClientStorageKey=this.toWeb
1StorageClientStateKey(this.localClientId),this.sequenceNumberKey="firestore_sequence_number_"+r,this.activeClients[this.localClientId]=new pi,this.clientStateKeyRe=new RegExp("^firestore_clients_"+a+"_([^_]*)$"),this.mutationBatchKeyRe=new RegExp("^firestore_mutations_"+a+"_(\\d+)(?:_(.*))?$"),this.queryTargetKeyRe=new RegExp("^firestore_targets_"+a+"_(\\d+)$"),this.onlineStateKey="firestore_online_state_"+r,this.platform.window.addEventListener("storage",this.storageListener)}return t.isAvailable=function(t){return!(!t.window||null==t.window.localStorage)},t.prototype.start=function(){return a.__awaiter(this,void 0,void 0,(function(){var t,e,n,r,i,o,s,u,c,l,h=this;return a.__generator(this,(function(a){switch(a.label){case 0:return g(!this.started,"WebStorageSharedClientState already started"),g(null!==this.syncEngine,"syncEngine property must be set before calling start()"),g(null!==this.onlineStateHandler,"onlineStateHandler property must be set before calling start()"),[4,this.syncEngine.getActiveClients()];case 1:for(t=a.sent(),e=0,n=t;e<n.length;e++)(r=n[e])!==this.localClientId&&(i=this.getItem(this.toWebStorageClientStateKey(r)))&&(o=fi.fromWebStorageEntry(r,i))&&(this.activeClients[o.clientId]=o);for(this.persistClientState(),(s=this.storage.getItem(this.onlineStateKey))&&(u=this.fromWebStorageOnlineState(s))&&this.handleOnlineStateEvent(u),c=0,l=this.earlyEvents;c<l.length;c++)this.handleWebStorageEvent(l[c]);return this.earlyEvents=[],this.platform.window.addEventListener("unload",(function(){return h.shutdown()})),this.started=!0,[2]}}))}))},t.prototype.writeSequenceNumber=function(t){this.setItem(this.sequenceNumberKey,JSON.stringify(t))},t.prototype.getAllActiveQueryTargets=function(){var t=Ae();return k(this.activeClients,(function(e,n){t=t.unionWith(n.activeTargetIds)})),t},t.prototype.isActiveQueryTarget=function(t){for(var e in this.activeClients)if(this.activeClients.hasOwnProperty(e)&&this.activeClients[e].activeTargetIds.has(t))return!0;return!1},t.prototype.addPendingMutation=function(t){this.persistMutationState(t,"pending")},t.prototype.updateMutationState=function(t,e,n){this.persistMutationState(t,e,n),this.removeMutationState(t)},t.prototype.addLocalQueryTarget=function(t){var e="not-current";if(this.isActiveQueryTarget(t)){var n=this.storage.getItem(this.toWebStorageQueryTargetMetadataKey(t));if(n){var r=hi.fromWebStorageEntry(t,n);r&&(e=r.state)}}return this.localClientState.addQueryTarget(t),this.persistClientState(),e},t.prototype.removeLocalQueryTarget=function(t){this.localClientState.removeQueryTarget(t),this.persistClientState()},t.prototype.isLocalQueryTarget=function(t){return this.localClientState.activeTargetIds.has(t)},t.prototype.clearQueryState=function(t){this.removeItem(this.toWebStorageQueryTargetMetadataKey(t))},t.prototype.updateQueryState=function(t,e,n){this.persistQueryTargetState(t,e,n)},t.prototype.handleUserChange=function(t,e,n){var r=this;e.forEach((function(t){r.removeMutationState(t)})),this.currentUser=t,n.forEach((function(t){r.addPendingMutation(t)}))},t.prototype.setOnlineState=function(t){this.persistOnlineState(t)},t.prototype.shutdown=function(){this.started&&(this.platform.window.removeEventListener("storage",this.storageListener),this.removeItem(this.localClientStorageKey),this.started=!1)},t.prototype.getItem=function(t){var e=this.storage.getItem(t);return p(ci,"READ",t,e),e},t.prototype.setItem=function(t,e){p(ci,"SET",t,e),this.storage.setItem(t,e)},t.prototype.removeItem=function(t){p(ci,"REMOVE",t),this.storage.removeItem(t)},t.prototype.handleWebStorageEvent=function(t){var e=this;if(t.storageArea===this.storage){if(p(ci,"EVENT",t.key,t.newValue),t.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 a.__awaiter(e,void 0,void 0,(function(){var e,n,r,i,o,s;return a.__generator(this,(function(a){if(!this.started)return this.earlyEvents.push(t),[2];if(null===t.key)return[2];if(this.clientStateKeyRe.test(t.key)){if(null==t.newValue)return n=this.fromWebStorageClientStateKey(t.key),[2,this.handleClientStateEvent(n,null)];if(e=this.fromWebStorageClientState(t.key,t.newValue))return[2,this.handleClientStateEvent(e.clientId,e)]}else if(this.mutationBatchKeyRe.test(t.key)){if(null!==t.newValue&&(r=this.fromWebStorageMutationMetadata(t.key,t.newValue)))return[2,this.handleMutationBatchEvent(r)]}else if(this.queryTargetKeyRe.test(t.key)){if(null!==t.newValue&&(i=this.fromWebStorageQueryTargetMetadata(t.key,t.newValue)))return[2,this.handleQueryTargetEvent(i)]}else if(t.key===this.onlineStateKey){if(null!==t.newValue&&(o=this.fromWebStorageOnlineState(t.newValue)))return[2,this.handleOnlineStateEvent(o)]}
1else t.key===this.sequenceNumberKey&&(g(!!this.sequenceNumberHandler,"Missing sequenceNumberHandler"),(s=function(t){var e=un.INVALID;if(null!=t)try{var n=JSON.parse(t);g("number"==typeof n,"Found non-numeric sequence number"),e=n}catch(r){m(ci,"Failed to read sequence number from WebStorage",r)}return e}(t.newValue))!==un.INVALID&&this.sequenceNumberHandler(s));return[2]}))}))}))}},Object.defineProperty(t.prototype,"localClientState",{get:function(){return this.activeClients[this.localClientId]},enumerable:!0,configurable:!0}),t.prototype.persistClientState=function(){this.setItem(this.localClientStorageKey,this.localClientState.toWebStorageJSON())},t.prototype.persistMutationState=function(t,e,n){var r=new li(this.currentUser,t,e,n),i=this.toWebStorageMutationBatchKey(t);this.setItem(i,r.toWebStorageJSON())},t.prototype.removeMutationState=function(t){var e=this.toWebStorageMutationBatchKey(t);this.removeItem(e)},t.prototype.persistOnlineState=function(t){this.storage.setItem(this.onlineStateKey,JSON.stringify({clientId:this.localClientId,onlineState:Gr[t]}))},t.prototype.persistQueryTargetState=function(t,e,n){var r=this.toWebStorageQueryTargetMetadataKey(t),i=new hi(t,e,n);this.setItem(r,i.toWebStorageJSON())},t.prototype.toWebStorageClientStateKey=function(t){return g(-1===t.indexOf("_"),"Client key cannot contain '_', but was '"+t+"'"),"firestore_clients_"+this.persistenceKey+"_"+t},t.prototype.toWebStorageQueryTargetMetadataKey=function(t){return"firestore_targets_"+this.persistenceKey+"_"+t},t.prototype.toWebStorageMutationBatchKey=function(t){var e="firestore_mutations_"+this.persistenceKey+"_"+t;return this.currentUser.isAuthenticated()&&(e+="_"+this.currentUser.uid),e},t.prototype.fromWebStorageClientStateKey=function(t){var e=this.clientStateKeyRe.exec(t);return e?e[1]:null},t.prototype.fromWebStorageClientState=function(t,e){var n=this.fromWebStorageClientStateKey(t);return g(null!==n,"Cannot parse client state key '"+t+"'"),fi.fromWebStorageEntry(n,e)},t.prototype.fromWebStorageMutationMetadata=function(t,e){var n=this.mutationBatchKeyRe.exec(t);g(null!==n,"Cannot parse mutation batch key '"+t+"'");var r=Number(n[1]);return li.fromWebStorageEntry(new ui(void 0!==n[2]?n[2]:null),r,e)},t.prototype.fromWebStorageQueryTargetMetadata=function(t,e){var n=this.queryTargetKeyRe.exec(t);g(null!==n,"Cannot parse query target key '"+t+"'");var r=Number(n[1]);return hi.fromWebStorageEntry(r,e)},t.prototype.fromWebStorageOnlineState=function(t){return di.fromWebStorageEntry(t)},t.prototype.handleMutationBatchEvent=function(t){return a.__awaiter(this,void 0,void 0,(function(){return a.__generator(this,(function(e){return t.user.uid!==this.currentUser.uid?(p(ci,"Ignoring mutation for non-active user "+t.user.uid),[2]):[2,this.syncEngine.applyBatchState(t.batchId,t.state,t.error)]}))}))},t.prototype.handleQueryTargetEvent=function(t){return this.syncEngine.applyTargetState(t.targetId,t.state,t.error)},t.prototype.handleClientStateEvent=function(t,e){var n=this,r=this.getAllActiveQueryTargets();e?this.activeClients[t]=e:delete this.activeClients[t];var i=this.getAllActiveQueryTargets(),o=[],s=[];return i.forEach((function(t){return a.__awaiter(n,void 0,void 0,(function(){return a.__generator(this,(function(e){return r.has(t)||o.push(t),[2]}))}))})),r.forEach((function(t){return a.__awaiter(n,void 0,void 0,(function(){return a.__generator(this,(function(e){return i.has(t)||s.push(t),[2]}))}))})),this.syncEngine.applyActiveTargetsChange(o,s)},t.prototype.handleOnlineStateEvent=function(t){this.activeClients[t.clientId]&&this.onlineStateHandler(t.onlineState)},t}(),yi=function(){function t(){this.localState=new pi,this.queryState={},this.syncEngine=null,this.onlineStateHandler=null,this.sequenceNumberHandler=null}return t.prototype.addPendingMutation=function(t){},t.prototype.updateMutationState=function(t,e,n){},t.prototype.addLocalQueryTarget=function(t){return this.localState.addQueryTarget(t),this.queryState[t]||"not-current"},t.prototype.updateQueryState=function(t,e,n){this.queryState[t]=e},t.prototype.removeLocalQueryTarget=function(t){this.localState.removeQueryTarget(t)},t.prototype.isLocalQueryTarget=function(t){return this.localState.activeTargetIds.has(t)},t.prototype.clearQueryState=function(t){delete this.queryState[t]},t.prototype.getAllActiveQueryTargets=function(){return this.localState.activeTargetIds},t.prototype.isActiveQueryTarget=function(t){return this.localState.activeTargetIds.has(t)},t.prototype.start=function(){return this.localState=new pi,Promise.resolve()},t.prototype.handleUserChange=function(t,e,n){},t.prototype.setOnlineState=function(t){},t.prototype.shutdown=function(){},t.prototype.writeSequenceNumber=function(t){},t}(),vi=function(){function t(t,e){this.cacheSizeBytes=t,this.experimentalTabSynchronization=e}return t.prototype.lruParams=function(){return yr.withCacheSize(this.cacheSizeBytes)},t}(),gi=function(){return function(){}}(),bi=function(){function t(t,e,n,r){this.platform=t,this.databaseInfo=e,this.credentials=n,this.asyncQueue=r,this.clientId=H.newId()}return t.prototype.start=function(t){var e=this,n=new cn,r=new cn,i=!1;return this.credentials.setChangeListener((function(o){i?e.asyncQueue.enqueueAndForget((function(){return e.handleCredentialChange(o)})):(i=!0,e.initializePersistence(t,r,o).then((function(t){return e.initializeRest(o,t)}
1)).then(n.resolve,n.reject))})),this.asyncQueue.enqueueAndForget((function(){return n.promise})),r.promise},t.prototype.enableNetwork=function(){var t=this;return this.asyncQueue.enqueue((function(){return t.syncEngine.enableNetwork()}))},t.prototype.initializePersistence=function(t,e,n){var r=this;return t instanceof vi?this.startIndexedDbPersistence(n,t).then((function(t){return e.resolve(),t})).catch((function(t){if(e.reject(t),!r.canFallback(t))throw t;return console.warn("Error enabling offline storage. Falling back to storage disabled: "+t),r.startMemoryPersistence()})):(e.resolve(),this.startMemoryPersistence())},t.prototype.canFallback=function(t){return t instanceof _?"failed-precondition"===t.code||"unimplemented"===t.code:!("undefined"!=typeof DOMException&&t instanceof DOMException)||22===t.code||20===t.code},t.prototype.startIndexedDbPersistence=function(t,e){var n=this,r=Cr.buildStoragePrefix(this.databaseInfo),i=new Ze(this.databaseInfo.databaseId,{useProto3Json:!0});return Promise.resolve().then((function(){return a.__awaiter(n,void 0,void 0,(function(){var n,o;return a.__generator(this,(function(a){switch(a.label){case 0:if(e.experimentalTabSynchronization&&!mi.isAvailable(this.platform))throw new _("unimplemented","IndexedDB persistence is only available on platforms that support LocalStorage.");return o=e.lruParams(),e.experimentalTabSynchronization?(this.sharedClientState=new mi(this.asyncQueue,this.platform,r,this.clientId,t),[4,Cr.createMultiClientIndexedDbPersistence(r,this.clientId,this.platform,this.asyncQueue,i,o,{sequenceNumberSyncer:this.sharedClientState})]):[3,2];case 1:return n=a.sent(),[3,4];case 2:return this.sharedClientState=new yi,[4,Cr.createIndexedDbPersistence(r,this.clientId,this.platform,this.asyncQueue,i,o)];case 3:n=a.sent(),a.label=4;case 4:return this.persistence=n,[2,n.referenceDelegate.garbageCollector]}}))}))}))},t.prototype.startMemoryPersistence=function(){return this.persistence=Lr.createEagerPersistence(this.clientId),this.sharedClientState=new yi,Promise.resolve(null)},t.prototype.initializeRest=function(t,e){var n=this;return p("FirestoreClient","Initializing. user=",t.uid),this.platform.loadConnection(this.databaseInfo).then((function(r){return a.__awaiter(n,void 0,void 0,(function(){var n,i,o,s=this;return a.__generator(this,(function(u){switch(u.label){case 0:return this.localStore=new Dr(this.persistence,t),e&&(this.lruScheduler
1=new vr(e,this.asyncQueue,this.localStore)),n=this.platform.newSerializer(this.databaseInfo.databaseId),i=new $r(this.asyncQueue,r,this.credentials,n),o=function(t){return s.syncEngine.applyOnlineStateChange(t,Qr.SharedClientState)},this.remoteStore=new Xr(this.localStore,i,this.asyncQueue,(function(t){return s.syncEngine.applyOnlineStateChange(t,Qr.RemoteStore)})),this.syncEngine=new si(this.localStore,this.remoteStore,this.sharedClientState,t),this.sharedClientState.onlineStateHandler=o,this.remoteStore.syncEngine=this.syncEngine,this.sharedClientState.syncEngine=this.syncEngine,this.eventMgr=new Zr(this.syncEngine),[4,this.sharedClientState.start()];case 1:return u.sent(),[4,this.remoteStore.start()];case 2:return u.sent(),[4,this.persistence.setPrimaryStateListener((function(t){return a.__awaiter(s,void 0,void 0,(function(){return a.__generator(this,(function(e){switch(e.label){case 0:return[4,this.syncEngine.applyPrimaryState(t)];case 1:return e.sent(),this.lruScheduler&&(t&&!this.lruScheduler.started?this.lruScheduler.start():t||this.lruScheduler.stop()),[2]}}))}))}))];case 3:return u.sent(),[2]}}))}))}))},t.prototype.handleCredentialChange=function(t){return this.asyncQueue.verifyOperationInProgress(),p("FirestoreClient","Credential Changed. Current user: "+t.uid),this.syncEngine.handleCredentialChange(t)},t.prototype.disableNetwork=function(){var t=this;return this.asyncQueue.enqueue((function(){return t.syncEngine.disableNetwork()}))},t.prototype.shutdown=function(t){var e=this;return this.asyncQueue.enqueue((function(){return a.__awaiter(e,void 0,void 0,(function(){return a.__generator(this,(function(e){switch(e.label){case 0:return this.lruScheduler&&this.lruScheduler.stop(),[4,this.remoteStore.shutdown()];case 1:return e.sent(),[4,this.sharedClientState.shutdown()];case 2:return e.sent(),[4,this.persistence.shutdown(t&&t.purgePersistenceWithDataLoss)];case 3:return e.sent(),this.credentials.removeChangeListener(),[2]}}))}))}))},t.prototype.listen=function(t,e,n){var r=this,i=new ti(t,e,n);return this.asyncQueue.enqueueAndForget((function(){return r.eventMgr.listen(i)})),i},t.prototype.unlisten=function(t){var e=this;this.asyncQueue.enqueueAndForget((function(){return e.eventMgr.unlisten(t)}))},t.prototype.getDocumentFromLocalCache=function(t){var e=this;return this.asyncQueue.enqueue((function(){return e.localStore.readDocument(t)})).then((function(t){if(t instanceof ut)return t;if(t instanceof ct)return null;throw new _("unavailable","Failed to get document from cache. (However, this document may exist on the server. Run again without setting 'source' in the GetOptions to attempt to retrieve the document from the server.)")}))},t.prototype.getDocumentsFromLocalCache=function(t){var e=this;return this.asyncQueue.enqueue((function(){return e.localStore.executeQuery(t)})).then((function(e){var n=Oe(),r=new ii(t,n),i=r.computeDocChanges(e);return r.applyChanges(i,!1).snapshot}))},t.prototype.write=function(t){var e=this,n=new cn;return this.asyncQueue.enqueueAndForget((function(){return e.syncEngine.write(t,n)})),n.promise},t.prototype.databaseId=function(){return this.databaseInfo.databaseId},t.prototype.transaction=function(t){var e=this;return this.asyncQueue.enqueue((function(){return a.__awaiter(e,void 0,void 0,(function(){return a.__generator(this,(function(t){return[2]}))}))})).then((function(){return e.syncEngine.runTransaction(t)}))},t}(),wi=function(){function t(t){this.observer=t,this.muted=!1}return t.prototype.next=function(t){this.scheduleEvent(this.observer.next,t)},t.prototype.error=function(t){this.scheduleEvent(this.observer.error,t)},t.prototype.mute=function(){this.muted=!0},t.prototype.scheduleEvent=function(t,e){var n=this;this.muted||setTimeout((function(){n.muted||t(e)}),0)},t}(),_i=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];P("FieldPath",t,"fieldNames",1);for(var n=0;n<t.length;++n)if(D("FieldPath","string",n,t[n]),0===t[n].length)throw new _("invalid-argument","Invalid field name at argument $(i + 1). Field names must not be empty.");this._internalPath=new ot(t)}return t.documentId=function(){return t._DOCUMENT_ID},t.prototype.isEqual=function(e){if(!(e instanceof t))throw B("isEqual","FieldPath",1,e);return this._internalPath.isEqual(e._internalPath)},t._DOCUMENT_ID=new t(ot.keyField().canonicalString()),t}(),Si=new RegExp("[~\\*/\\[\\]]"),Ci=function(){return function(t,e){this.user=e,this.type="OAuth",this.authHeaders={Authorization:"Bearer "+t}}}(),Ei=function(){function t(){this.changeListener=null}return t.prototype.getToken=function(){return Promise.resolve(null)},t.prototype.invalidateToken=function(){},t.prototype.setChangeListener=function(t){g(!this.changeListener,"Can only call setChangeListener() once."),this.changeListener=t,t(ui.UNAUTHENTICATED)},t.prototype.removeChangeListener=function(){g(null!==this.changeListener,"removeChangeListener() when no listener registered"),this.changeListener=null},t}(),Ti=function(){function t(t){var e=this;this.app=t,this.tokenListener=null,this.tokenCounter=0,this.changeListener=null,this.forceRefresh=!1,this.tokenListener=function(){e.tokenCounter++,e.currentUser=e.getUser(),e.changeListener&&e.changeListener(e.currentUser)},this.tokenCounter=0,this.app.INTERNAL.addAuthTokenListener(this.tokenListener)}return t.prototype.getToken=function(){var t=this;g(null!=this.tokenListener,"getToken cannot be called after listener removed.");var e=this.tokenCounter,n=this.forceRefresh;return this.forceRefresh=!1,this.app.INTERNAL.getToken(n).then((function(n){if(t.tokenCounter!==e)throw new _("aborted","getToken aborted due to token change.");return n?(g("string"==typeof n.accessToken,"Invalid tokenData returned from getToken():"+n),new Ci(n.accessToken,t.currentUser)):null}))},t.prototype.invalidateToken=function(){this.forceRefresh=!0},t.prototype.setChangeListener=function(t){g(!this.changeListener,"Can only call setChangeListener() once."),this.changeListener=t,this.currentUser&&t(this.currentUser)},t.prototype.removeChangeListener=function(){g(null!=this.tokenListener,"removeChangeListener() called twice"),g(null!==this.changeListener,"removeChangeListener() called when no listener registered"),this.app.INTERNAL.removeAuthTokenListener(this.tokenListener),this.tokenListener=null,this.changeListener=null},t.prototype.getUser=function(){var t=this.app.INTERNAL.getUid();
1return g(null===t||"string"==typeof t,"Received invalid UID: "+t),new ui(t)},t}(),ki=function(){function t(t,e){this.gapi=t,this.sessionIndex=e,this.type="FirstParty",this.user=ui.FIRST_PARTY,g(this.gapi&&this.gapi.auth&&this.gapi.auth.getAuthHeaderValueForFirstParty,"unexpected gapi interface")}return Object.defineProperty(t.prototype,"authHeaders",{get:function(){return{Authorization:this.gapi.auth.getAuthHeaderValueForFirstParty([]),"X-Goog-AuthUser":this.sessionIndex}},enumerable:!0,configurable:!0}),t}(),Ii=function(){function t(t,e){this.gapi=t,this.sessionIndex=e,g(this.gapi&&this.gapi.auth&&this.gapi.auth.getAuthHeaderValueForFirstParty,"unexpected gapi interface")}return t.prototype.getToken=function(){return Promise.resolve(new ki(this.gapi,this.sessionIndex))},t.prototype.setChangeListener=function(t){t(ui.FIRST_PARTY)},t.prototype.removeChangeListener=function(){},t.prototype.invalidateToken=function(){},t}();function Oi(t){if(!t)return new Ei;switch(t.type){case"gapi":return new Ii(t.client,t.sessionIndex||"0");case"provider":return t.client;default:throw new _("invalid-argument","makeCredentialsProvider failed due to invalid credential type")}}function xi(t){return function(t,e){if("object"!=typeof t||null===t)return!1;for(var n=t,r=0,i=["next","error","complete"];r<i.length;r++){var o=i[r];if(o in n&&"function"==typeof n[o])return!0}return!1}(t)}var Ai=function(){function t(t){this._methodName=t}return t.delete=function(){return Pi.instance},t.serverTimestamp=function(){return Di.instance},t.arrayUnion=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return x("FieldValue.arrayUnion",arguments,1),new Ri(t)},t.arrayRemove=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return x("FieldValue.arrayRemove",arguments,1),new Ni(t)},t.prototype.isEqual=function(t){return this===t},t}(),Pi=function(t){function e(){return t.call(this,"FieldValue.delete")||this}return a.__extends(e,t),e.instance=new e,e}(Ai),Di=function(t){function e(){return t.call(this,"FieldValue.serverTimestamp")||this}return a.__extends(e,t),e.instance=new e,e}(Ai),Ri=function(t){function e(e){var n=t.call(this,"FieldValue.arrayUnion")||this;return n._elements=e,n}return a.__extends(e,t),e}(Ai),Ni=function(t){function e(e){var n=t.call(this,"FieldValue.arrayRemove")||this;return n._elements=e,n}return a.__extends(e,t),e}(Ai),ji=S(Ai,"Use FieldValue.<field>() instead."),Mi=/^__.*__$/,Li=function(){function t(t,e,n){this.data=t,this.fieldMask=e,this.fieldTransforms=n}return t.prototype.toMutations=function(t,e){var n=[];return n.push(null!==this.fieldMask?new ue(t,this.data,this.fieldMask,e):new se(t,this.data,e)),this.fieldTransforms.length>0&&n.push(new ce(t,this.fieldTransforms)),n},t}(),Fi=function(){function t(t,e,n){this.data=t,this.fieldMask=e,this.fieldTransforms=n}return t.prototype.toMutations=function(t,e){var n=[new ue(t,this.data,this.fieldMask,e)];return this.fieldTransforms.length>0&&n.push(new ce(t,this.fieldTransforms)),n},t}(),Ui=function(t){return t[t.Set=0]="Set",t[t.Update=1]="Update",t[t.MergeSet=2]="MergeSet",t[t.Argument=3]="Argument",t}({});function Vi(t){switch(t){case Ui.Set:case Ui.MergeSet:case Ui.Update:return!0;case Ui.Argument:return!1;default:throw v("Unexpected case for UserDataSource: "+t)}}var qi=function(){function t(t,e,n,r,i,o){this.dataSource=t,this.methodName=e,this.path=n,this.arrayElement=r,void 0===i&&this.validatePath(),this.arrayElement=void 0!==r&&r,this.fieldTransforms=i||[],this.fieldMask=o||[]}return t.prototype.childContextForField=function(e){var n=null==this.path?null:this.path.child(e),r=new t(this.dataSource,this.methodName,n,!1,this.fieldTransforms,this.fieldMask);return r.validatePathSegment(e),r},t.prototype.childContextForFieldPath=function(e){var n=null==this.path?null:this.path.child(e),r=new t(this.dataSource,this.methodName,n,!1,this.fieldTransforms,this.fieldMask);return r.validatePath(),r},t.prototype.childContextForArray=function(e){return new t(this.dataSource,this.methodName,null,!0,this.fieldTransforms,this.fieldMask)},t.prototype.createError=function(t){var e=null===this.path||this.path.isEmpty()?"":" (found in field "+this.path.toString()+")";return new _("invalid-argument","Function "+this.methodName+"() called with invali
1d data. "+t+e)},t.prototype.contains=function(t){return void 0!==this.fieldMask.find((function(e){return t.isPrefixOf(e)}))||void 0!==this.fieldTransforms.find((function(e){return t.isPrefixOf(e.field)}))},t.prototype.validatePath=function(){if(null!==this.path)for(var t=0;t<this.path.length;t++)this.validatePathSegment(this.path.get(t))},t.prototype.validatePathSegment=function(t){if(Vi(this.dataSource)&&Mi.test(t))throw this.createError("Document fields cannot begin and end with __")},t}(),Bi=function(){return function(t,e){this.databaseId=t,this.key=e}}(),Wi=function(){function t(t){this.preConverter=t}return t.prototype.parseSetData=function(t,e){var n=new qi(Ui.Set,t,ot.EMPTY_PATH);Hi("Data must be an object, but it was:",n,e);var r=this.parseData(e,n);return new Li(r,null,n.fieldTransforms)},t.prototype.parseMergeData=function(t,e,n){var r=new qi(Ui.MergeSet,t,ot.EMPTY_PATH);Hi("Data must be an object, but it was:",r,e);var i,o,a=this.parseData(e,r);if(n){for(var s=new Zt(ot.comparator),u=0,c=n;u<c.length;u++){var l=c[u],h=void 0;if(l instanceof _i)h=l._internalPath;else{if("string"!=typeof l)throw v("Expected stringOrFieldPath to be a string or a FieldPath");h=Ki(t,l)}if(!r.contains(h))throw new _("invalid-argument","Field '"+h+"' is specified in your field mask but missing from your input data.");s=s.add(h)}i=ee.fromSet(s),o=r.fieldTransforms.filter((function(t){return i.covers(t.field)}))}else i=ee.fromArray(r.fieldMask),o=r.fieldTransforms;return new Li(a,i,o)},t.prototype.parseUpdateData=function(t,e){var n=this,r=new qi(Ui.Update,t,ot.EMPTY_PATH);Hi("Data must be an object, but it was:",r,e);var i=new Zt(ot.comparator),o=Pt.EMPTY;k(e,(function(e,a){var s=Ki(t,e),u=r.childContextForFieldPath(s);if((a=n.runPreConverter(a,u))instanceof Pi)i=i.add(s);else{var c=n.parseData(a,u);null!=c&&(i=i.add(s),o=o.set(s,c))}}));var a=ee.fromSet(i);return new Fi(o,a,r.fieldTransforms)},t.prototype.parseUpdateVarargs=function(t,e,n,r){var i=new qi(Ui.Update,t,ot.EMPTY_PATH),o=[$i(t,e)],a=[n];if(r.length%2!=0)throw new _("invalid-argument","Function "+t+"() needs to be called with an even number of arguments that alternate between field names and values.");for(var s=0;s<r.length;s+=2)o.push($i(t,r[s])),a.push(r[s+1]);var u=new Zt(ot.comparator),c=Pt.EMPTY;for(s=0;s<o.length;++s){var l=o[s],h=i.childContextForFieldPath(l),f=this.runPreConverter(a[s],h);if(f instanceof Pi)u=u.add(l);else{var d=this.parseData(f,h);null!=d&&(u=u.add(l),c=c.set(l,d))}}var p=ee.fromSet(u);return new Fi(c,p,i.fieldTransforms)},t.prototype.parseQueryValue=function(t,e){var n=new qi(Ui.Argument,t,ot.EMPTY_PATH),r=this.parseData(e,n);return g(null!=r,"Parsed data should not be null."),g(0===n.fieldTransforms.length,"Field transforms should have been disallowed."),r},t.prototype.runPreConverter=function(t,e){try{return this.preConverter(t)}catch(r){var n=Gi(r);throw e.createError(n)}},t.prototype.parseData=function(t,e){if(zi(t=this.runPreConverter(t,e)))return Hi("Unsupported field value:",e,t),this.parseObject(t,e);if(t instanceof Ai)return this.parseSentinelFieldValue(t,e),null;if(e.path&&e.fieldMask.push(e.path),t instanceof Array){if(e.arrayElement)throw e.createError("Nested arrays are not supported");return this.parseArray(t,e)}return this.parseScalarValue(t,e)},t.prototype.parseObject=function(t,e){var n=this,r=new ht($);return I(t)?e.path&&e.path.length>0&&e.fieldMask.push(e.path):k(t,(function(t,i){var o=n.parseData(i,e.childContextForField(t));null!=o&&(r=r.insert(t,o))})),new Pt(r)},t.prototype.parseArray=function(t,e){for(var n=[],r=0,i=0,o=t;i<o.length;i++){var a=this.parseData(o[i],e.childContextForArray(r));null==a&&(a=bt.INSTANCE),n.push(a),r++}return new Dt(n)},t.prototype.parseSentinelFieldValue=function(t,e){if(!Vi(e.dataSource))throw e.createError(t._methodName+"() can only be used with update() and set()");if(null===e.path)throw e.createError(t._methodName+"() is not currently supported inside arrays");if(t instanceof Pi){if(e.dataSource!==Ui.MergeSet)throw e.dataSource===Ui.Update?(g(e.path.length>0,"FieldValue.delete() at the top level should have already been handled."),e.createError("FieldValue.delete() can only appear at the top level of your update data")):e.createError("FieldValue.delete() cannot be used with set() unless you pass {merge:true}");e.fieldMask.push(e.path)}else if(t instanceof Di)e.fieldTransforms.push(new ne(e.path,he.instance));else if(t instanceof Ri){var n=this.parseArrayTransformElements(t._methodName,t._elements),r=new fe(n);e.fieldTransforms.push(new ne(e.path,r))}else if(t instanceof Ni){n=this.parseArrayTransformElements(t._methodName,t._elements);var i=new de(n);e.fieldTransforms.push(new ne(e.path,i))}else v("Unknown FieldValue type: "+t)},t.prototype.parseScalarValue=function(t,e){if(null===t)return bt.INSTANCE;if("number"==typeof t)return Ft(t)?new Ct(t):new Et(t);if("boolean"==typeof t)return wt.of(t);if("string"==typeof t)return new Tt(t);if(t instanceof Date)return new kt(Z.fromDate(t));if(t instanceof Z)return new kt(new Z(t.seconds,1e3*Math.floor(t.nanoseconds/1e3)));if(t instanceof J)return new At(t);if(t instanceof Y)return new Ot(t);if(t instanceof Bi)return new xt(t.databaseId,t.key);throw e.createError("Unsupported field value: "+U(t))},t.prototype.parseArrayTransformElements=function(t,e){var n=this;
1return e.map((function(e,r){var i=new qi(Ui.Argument,t,ot.EMPTY_PATH);return n.parseData(e,i.childContextForArray(r))}))},t}();function zi(t){return!("object"!=typeof t||null===t||t instanceof Array||t instanceof Date||t instanceof Z||t instanceof J||t instanceof Y||t instanceof Bi||t instanceof Ai)}function Hi(t,e,n){if(!zi(n)||!F(n)){var r=U(n);throw e.createError("an object"===r?t+" a custom object":t+" "+r)}}function $i(t,e){if(e instanceof _i)return e._internalPath;if("string"==typeof e)return Ki(t,e);throw new _("invalid-argument","Function "+t+"() called with invalid data. Field path arguments must be of type string or FieldPath.")}function Ki(t,e){try{return function(t){if(t.search(Si)>=0)throw new _("invalid-argument","Invalid field path ("+t+"). Paths must not contain '~', '*', '/', '[', or ']'");try{return new(_i.bind.apply(_i,[void 0].concat(t.split("."))))}catch(e){throw new _("invalid-argument","Invalid field path ("+t+"). Paths must not be empty, begin with '.', end with '.', or contain '..'")}}(e)._internalPath}catch(r){var n=Gi(r);throw new _("invalid-argument","Function "+t+"() called with invalid data. "+n)}}function Gi(t){return t instanceof Error?t.message:t.toString()}var Qi=yr.COLLECTION_DISABLED,Yi=function(){function t(t){if(void 0===t.host){if(void 0!==t.ssl)throw new _("invalid-argument","Can't provide ssl option if host option is not set");this.host="firestore.googleapis.com",this.ssl=!0}else N("settings","non-empty string","host",t.host),this.host=t.host,j("settings","boolean","ssl",t.ssl),this.ssl=E(t.ssl,!0);if(q("settings",t,["host","ssl","credentials","timestampsInSnapshots","cacheSizeBytes"]),j("settings","object","credentials",t.credentials),this.credentials=t.credentials,j("settings","boolean","timestampsInSnapshots",t.timestampsInSnapshots),!0===t.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===t.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=E(t.t
1imestampsInSnapshots,!0),j("settings","number","cacheSizeBytes",t.cacheSizeBytes),void 0===t.cacheSizeBytes)this.cacheSizeBytes=yr.DEFAULT_CACHE_SIZE_BYTES;else{if(t.cacheSizeBytes!==Qi&&t.cacheSizeBytes<yr.MINIMUM_CACHE_SIZE_BYTES)throw new _("invalid-argument","cacheSizeBytes must be at least "+yr.MINIMUM_CACHE_SIZE_BYTES);this.cacheSizeBytes=t.cacheSizeBytes}}return t.prototype.isEqual=function(t){return this.host===t.host&&this.ssl===t.ssl&&this.timestampsInSnapshots===t.timestampsInSnapshots&&this.credentials===t.credentials&&this.cacheSizeBytes===t.cacheSizeBytes},t}(),Xi=function(){return function(){}}(),Ji=function(){function t(e){var n=this;this._queue=new hn,this.INTERNAL={delete:function(t){return a.__awaiter(n,void 0,void 0,(function(){return a.__generator(this,(function(e){return this._firestoreClient?[2,this._firestoreClient.shutdown(t)]:[2]}))}))}};var r=new Xi;if("object"==typeof e.options){var i=e;r.firebaseApp=i,r.databaseId=t.databaseIdFromApp(i),r.persistenceKey=r.firebaseApp.name,r.credentials=new Ti(i)}else{var o=e;if(!o.projectId)throw new _("invalid-argument","Must provide projectId");r.databaseId=new et(o.projectId,o.database),r.persistenceKey="[DEFAULT]",r.credentials=new Ei}r.settings=new Yi({}),this._config=r,this._databaseId=r.databaseId}return t.prototype.settings=function(t){if(O("Firestore.settings",arguments,1),D("Firestore.settings","object",1,t),C(t,"persistence"))throw new _("invalid-argument",'"persistence" is now specified with a separate call to firestore.enablePersistence().');var e=new Yi(t);if(this._firestoreClient&&!this._config.settings.isEqual(e))throw new _("failed-precondition","Firestore has already been started and its settings can no longer be changed. You can only call settings() before calling any other methods on a Firestore object.");this._config.settings=e,void 0!==e.credentials&&(this._config.credentials=Oi(e.credentials))},t.prototype.enableNetwork=function(){return this.ensureClientConfigured(),this._firestoreClient.enableNetwork()},t.prototype.disableNetwork=function(){return this.ensureClientConfigured(),this._firestoreClient.disableNetwork()},t.prototype.enablePersistence=function(t){if(this._firestoreClient)throw new _("failed-precondition","Firestore has already been started and persistence can no longer be enabled. You can only call enablePersistence() before calling any other methods on a Firestore object.");return this.configureClient(new vi(this._config.settings.cacheSizeBytes,void 0!==t&&E(t.experimentalTabSynchronization,!1)))},t.prototype.ensureClientConfigured=function(){return this._firestoreClient||this.configureClient(new gi),this._firestoreClient},t.prototype.configureClient=function(t){var e=this;g(!!this._config.settings.host,"FirestoreSettings.host cannot be falsey"),g(!this._firestoreClient,"configureClient() called multiple times");var n=new tt(this._config.databaseId,this._config.persistenceKey,this._config.settings.host,this._config.settings.ssl);return this._dataConverter=new Wi((function(t){if(t instanceof eo){var n=e._config.databaseId,r=t.firestore._config.databaseId;if(!r.isEqual(n))throw new _("invalid-argument","Document reference is for database "+r.projectId+"/"+r.database+" but should be for database "+n.projectId+"/"+n.database);return new Bi(e._config.databaseId,t._key)}return t})),this._firestoreClient=new bi(b.getPlatform(),n,this._config.credentials,this._queue),this._firestoreClient.start(t)},t.databaseIdFromApp=function(t){var e=t.options;if(!C(e,"projectId"))throw new _("invalid-argument",'"projectId" not provided in firebase.initializeApp.');var n=e.projectId;if(!n||"string"!=typeof n)throw new _("invalid-argument","projectId must be a string in FirebaseApp.options");return new et(n)},Object.defineProperty(t.prototype,"app",{get:function(){if(!this._config.firebaseApp)throw new _("failed-precondition","Firestore was not initialized using the Firebase SDK. 'app' is not available");return this._config.firebaseApp},enumerable:!0,configurable:!0}),t.prototype.collection=function(t){if(O("Firestore.collection",arguments,1),D("Firestore.collection","non-empty string",1,t),!t)throw new _("invalid-argument","Must provide a non-empty collection path to collection()");return this.ensureClientConfigured(),new so(rt.fromString(t),this)}
1,t.prototype.doc=function(t){if(O("Firestore.doc",arguments,1),D("Firestore.doc","non-empty string",1,t),!t)throw new _("invalid-argument","Must provide a non-empty document path to doc()");return this.ensureClientConfigured(),eo.forPath(rt.fromString(t),this)},t.prototype.runTransaction=function(t){var e=this;return O("Firestore.runTransaction",arguments,1),D("Firestore.runTransaction","function",1,t),this.ensureClientConfigured().transaction((function(n){return t(new Zi(e,n))}))},t.prototype.batch=function(){return this.ensureClientConfigured(),new to(this)},Object.defineProperty(t,"logLevel",{get:function(){switch(f()){case h.DEBUG:return"debug";case h.ERROR:return"error";case h.SILENT:return"silent";default:return v("Unknown log level: "+f())}},enumerable:!0,configurable:!0}),t.setLogLevel=function(t){switch(O("Firestore.setLogLevel",arguments,1),D("Firestore.setLogLevel","non-empty string",1,t),t){case"debug":d(h.DEBUG);break;case"error":d(h.ERROR);break;case"silent":d(h.SILENT);break;default:throw new _("invalid-argument","Invalid log level: "+t)}},t.prototype._areTimestampsInSnapshotsEnabled=function(){return this._config.settings.timestampsInSnapshots},t}(),Zi=function(){function t(t,e){this._firestore=t,this._transaction=e}return t.prototype.get=function(t){var e=this;O("Transaction.get",arguments,1);var n=ho("Transaction.get",t,this._firestore);return this._transaction.lookup([n._key]).then((function(t){if(!t||1!==t.length)return v("Mismatch in docs returned from document lookup.");var r=t[0];if(r instanceof ct)return new ro(e._firestore,n._key,null,!1,!1);if(r instanceof ut)return new ro(e._firestore,n._key,r,!1,!1);throw v("BatchGetDocumentsRequest returned unexpected document type: "+r.constructor.name)}))},t.prototype.set=function(t,e,n){A("Transaction.set",arguments,2,3);var r=ho("Transaction.set",t,this._firestore),i=(n=uo("Transaction.set",n)).merge||n.mergeFields?this._firestore._dataConverter.parseMergeData("Transaction.set",e,n.mergeFields):this._firestore._dataConverter.parseSetData("Transaction.set",e);return this._transaction.set(r._key,i),this},t.prototype.update=function(t,e,n){for(var r,i,o=[],a=3;a<arguments.length;a++)o[a-3]=arguments[a];return"string"==typeof e||e instanceof _i?(x("Transaction.update",arguments,3),r=ho("Transaction.update",t,this._firestore),i=this._firestore._dataConverter.parseUpdateVarargs("Transaction.update",e,n,o)):(O("Transaction.update",arguments,2),r=ho("Transaction.update",t,this._firestore),i=this._firestore._dataConverter.parseUpdateData("Transaction.update",e)),this._transaction.update(r._key,i),this},t.prototype.delete=function(t){O("Transaction.delete",arguments,1);var e=ho("Transaction.delete",t,this._firestore);return this._transaction.delete(e._key),this},t}(),to=function(){function t(t){this._firestore=t,this._mutations=[],this._committed=!1}return t.prototype.set=function(t,e,n){A("WriteBatch.set",arguments,2,3),this.verifyNotCommitted();var r=ho("WriteBatch.set",t,this._firestore),i=(n=uo("WriteBatch.set",n)).merge||n.mergeFields?this._firestore._dataConverter.parseMergeData("WriteBatch.set",e,n.mergeFields):this._firestore._dataConverter.parseSetData("WriteBatch.set",e);return this._mutations=this._mutations.concat(i.toMutations(r._key,oe.NONE)),this},t.prototype.update=function(t,e,n){for(var r,i,o=[],a=3;a<arguments.length;a++)o[a-3]=arguments[a];return this.verifyNotCommitted(),"string"==typeof e||e instanceof _i?(x("WriteBatch.update",arguments,3),r=ho("WriteBatch.update",t,this._firestore),i=this._firestore._dataConverter.parseUpdateVarargs("WriteBatch.update",e,n,o)):(O("WriteBatch.update",arguments,2),r=ho("WriteBatch.update",t,this._firestore),i=this._firestore._dataConverter.parseUpdateData("WriteBatch.update",e)),this._mutations=this._mutations.concat(i.toMutations(r._key,oe.exists(!0))),this},t.prototype.delete=function(t){O("WriteBatch.delete",arguments,1),this.verifyNotCommitted();var e=ho("WriteBatch.delete",t,this._firestore);return this._mutations=this._mutations.concat(new le(e._key,oe.NONE)),this},t.prototype.commit=function(){return a.__awaiter(this,void 0,void 0,(function(){return a.__generator(this,(function(t){return this.verifyNotCommitted(),this._committed=!0,this._mutations.length>0?[2,this._firestore.ensureClientConfigured().write(this._mutations)]:[2]}))}))},t.prototype.verifyNotCommitted=function(){if(this._committed)throw new _("failed-precondition","A write batch can no longer be used after commit() has been called.")},t}(),eo=function(){function t(t,e){this._key=t,this.firestore=e,this._firestoreClient=this.firestore.ensureClientConfigured()}return t.forPath=function(e,n){if(e.length%2!=0)throw new _("invalid-argument","Invalid document reference. Document references must have an even number of segments, but "+e.canonicalString()+" has "+e.length);return new t(new at(e),n)}
1,Object.defineProperty(t.prototype,"id",{get:function(){return this._key.path.lastSegment()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){return new so(this._key.path.popLast(),this.firestore)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"path",{get:function(){return this._key.path.canonicalString()},enumerable:!0,configurable:!0}),t.prototype.collection=function(t){if(O("DocumentReference.collection",arguments,1),D("DocumentReference.collection","non-empty string",1,t),!t)throw new _("invalid-argument","Must provide a non-empty collection name to collection()");var e=rt.fromString(t);return new so(this._key.path.child(e),this.firestore)},t.prototype.isEqual=function(e){if(!(e instanceof t))throw B("isEqual","DocumentReference",1,e);return this.firestore===e.firestore&&this._key.isEqual(e._key)},t.prototype.set=function(t,e){A("DocumentReference.set",arguments,1,2);var n=(e=uo("DocumentReference.set",e)).merge||e.mergeFields?this.firestore._dataConverter.parseMergeData("DocumentReference.set",t,e.mergeFields):this.firestore._dataConverter.parseSetData("DocumentReference.set",t);return this._firestoreClient.write(n.toMutations(this._key,oe.NONE))},t.prototype.update=function(t,e){for(var n,r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];return"string"==typeof t||t instanceof _i?(x("DocumentReference.update",arguments,2),n=this.firestore._dataConverter.parseUpdateVarargs("DocumentReference.update",t,e,r)):(O("DocumentReference.update",arguments,1),n=this.firestore._dataConverter.parseUpdateData("DocumentReference.update",t)),this._firestoreClient.write(n.toMutations(this._key,oe.exists(!0)))},t.prototype.delete=function(){return O("DocumentReference.delete",arguments,0),this._firestoreClient.write([new le(this._key,oe.NONE)])},t.prototype.onSnapshot=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];A("DocumentReference.onSnapshot",arguments,1,4);var n,r={includeMetadataChanges:!1},i=0;"object"!=typeof t[i]||xi(t[i])||(q("DocumentReference.onSnapshot",r=t[i],["includeMetadataChanges"]),j("DocumentReference.onSnapshot","boolean","includeMetadataChanges",r.includeMetadataChanges),i++);var o={includeMetadataChanges:r.includeMetadataChanges};return xi(t[i])?n=t[i]:(D("DocumentReference.onSnapshot","function",i,t[i]),R("DocumentReference.onSnapshot","function",i+1,t[i+1]),R("DocumentReference.onSnapshot","function",i+2,t[i+2]),n={next:t[i],error:t[i+1],complete:t[i+2]}),this.onSnapshotInternal(o,n)},t.prototype.onSnapshotInternal=function(t,e){var n=this,r=function(t){console.error("Uncaught Error in onSnapshot:",t)};e.error&&(r=e.error.bind(e));var i=new wi({next:function(t){if(e.next){g(t.docs.size<=1,"Too many documents returned on a document query");var r=t.docs.get(n._key);e.next(new ro(n.firestore,n._key,r,t.fromCache,t.hasPendingWrites))}},error:r}),o=this._firestoreClient.listen(Ut.atPath(this._key.path),i,t);return function(){i.mute(),n._firestoreClient.unlisten(o)}},t.prototype.get=function(t){var e=this;return A("DocumentReference.get",arguments,0,1),lo("DocumentReference.get",t),new Promise((function(n,r){t&&"cache"===t.source?e.firestore.ensureClientConfigured().getDocumentFromLocalCache(e._key).then((function(t){n(new ro(e.firestore,e._key,t,!0,t instanceof ut&&t.hasLocalMutations))}),r):e.getViaSnapshotListener(n,r,t)}))},t.prototype.getViaSnapshotListener=function(t,e,n){var r=this.onSnapshotInternal({includeMetadataChanges:!0,waitForSyncWhenOnline:!0},{next:function(i){r(),!i.exists&&i.metadata.fromCache?e(new _("unavailable","Failed to get document because the client is offline.")):i.exists&&i.metadata.fromCache&&n&&"server"===n.source?e(new _("unavailable",'Failed to get document from server. (However, this document does exist in the local cache. Run again without setting source to "server" to retrieve the cached document.)')):t(i)},error:e})},t}(),no=function(){function t(t,e){this.hasPendingWrites=t,this.fromCache=e}return t.prototype.isEqual=function(t){return this.hasPendingWrites===t.hasPendingWrites&&this.fromCache===t.fromCache},t}(),ro=function(){function t(t,e,n,r,i){this._firestore=t,this._key=e,this._document=n,this._fromCache=r,this._hasPendingWrites=i}return t.prototype.data=function(t){return A("DocumentSnapshot.data",arguments,0,1),t=co("DocumentSnapshot.data",t),this._document?this.convertObject(this._document.data,vt.fromSnapshotOptions(t,this._firestore._areTimestampsInSnapshotsEnabled())):void 0},t.prototype.get=function(t,e){if(A("DocumentSnapshot.get",arguments,1,2),e=co("DocumentSnapshot.get",e),this._document){var n=this._document.data.field($i("DocumentSnapshot.get",t));if(void 0!==n)return this.convertValue(n,vt.fromSnapshotOptions(e,this._firestore._areTimestampsInSnapshotsEnabled()))}},Object.defineProperty(t.prototype,"id",{get:function(){return this._key.path.lastSegment()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ref",{get:function(){return new eo(this._key,this._firestore)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"exists",{get:function(){return null!==this._document},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"metadata",{get:function(){return new no(this._hasPendingWrites,this._fromCache)},enumerable:!0,configurable:!0}),t.prototype.isEqual=function(e){if(!(e instanceof t))throw B("isEqual","DocumentSnapshot",1,e);return this._firestore===e._firestore&&this._fromCache===e._fromCache&&this._key.isEqual(e._key)&&(null===this._document?null===e._document:this._document.isEqual(e._document))},t.prototype.convertObject=function(t,e){var n=this,r={};return t.forEach((function(t,i){r[t]=n.convertValue(i,e)})),r},t.prototype.convertValue=function(t,e){if(t instanceof Pt)return this.convertObject(t,e);if(t instanceof Dt)return this.convertArray(t,e);if(t instanceof xt){var n=t.value(e),r=this._firestore.ensureClientConfigured().databaseId();return t.databaseId.isEqual(r)||m("Document "+this._key.path+" contains a document reference within a different database ("+t.databaseId.projectId+"/"+t.databaseId.database+") which is not supported. It will be treated as a reference in the current database ("+r.projectId+"/"+r.database+") instead."),new eo(n,this._firestore)}return t.value(e)},t.prototype.convertArray=function(t,e){var n=this;return t.internalValue.map((function(t){return n.convertValue(t,e)}))},t}(),io=function(t){function e(e,n,r,i,o){return t.call(this,e,n,r,i,o)||this}return a.__extends(e,t),e.prototype.data=function(e){var n=t.prototype.data.call(this,e);return g("object"==typeof n,"Document in a QueryDocumentSnapshot should exist"),n},e}(ro),oo=function(){function t(t,e){this._query=t,this.firestore=e}return t.prototype.where=function(e,n,r){var i;O("Query.where",arguments,3),D("Query.where","non-empty string",2,n),V("Query.where",3,r);var o=$i("Query.where",e),a=qt.fromString(n);
1if(o.isKeyField()){if(a===qt.ARRAY_CONTAINS)throw new _("invalid-argument","Invalid Query. You can't perform array-contains queries on FieldPath.documentId() since document IDs are not arrays.");if("string"==typeof r){if(-1!==r.indexOf("/"))throw new _("invalid-argument","Function Query.where() requires its third parameter to be a valid document ID if the first parameter is FieldPath.documentId(), but it contains a slash.");if(""===r)throw new _("invalid-argument","Function Query.where() requires its third parameter to be a valid document ID if the first parameter is FieldPath.documentId(), but it was an empty string.");var s=this._query.path.child(new rt([r]));g(s.length%2==0,"Path should be a document key"),i=new xt(this.firestore._databaseId,new at(s))}else{if(!(r instanceof eo))throw new _("invalid-argument","Function Query.where() requires its third parameter to be a string or a DocumentReference if the first parameter is FieldPath.documentId(), but it was: "+U(r)+".");var u=r;i=new xt(this.firestore._databaseId,u._key)}}else i=this.firestore._dataConverter.parseQueryValue("Query.where",r);var c=Vt.create(o,a,i);return this.validateNewFilter(c),new t(this._query.addFilter(c),this.firestore)},t.prototype.orderBy=function(e,n){var r;if(A("Query.orderBy",arguments,1,2),R("Query.orderBy","non-empty string",2,n),void 0===n||"asc"===n)r=Ht.ASCENDING;else{if("desc"!==n)throw new _("invalid-argument","Function Query.orderBy() has unknown direction '"+n+"', expected 'asc' or 'desc'.");r=Ht.DESCENDING}if(null!==this._query.startAt)throw new _("invalid-argument","Invalid query. You must not call Query.startAt() or Query.startAfter() before calling Query.orderBy().");if(null!==this._query.endAt)throw new _("invalid-argument","Invalid query. You must not call Query.endAt() or Query.endBefore() before calling Query.orderBy().");var i=$i("Query.orderBy",e),o=new Kt(i,r);return this.validateNewOrderBy(o),new t(this._query.addOrderBy(o),this.firestore)},t.prototype.limit=function(e){if(O("Query.limit",arguments,1),D("Query.limit","number",1,e),e<=0)throw new _("invalid-argument","Invalid Query. Query limit ("+e+") is invalid. Limit must be positive.");return new t(this._query.withLimit(e),this.firestore)},t.prototype.startAt=function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];x("Query.startAt",arguments,1);var i=this.boundFromDocOrFields("Query.startAt",e,n,!0);return new t(this._query.withStartAt(i),this.firestore)},t.prototype.startAfter=function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];x("Query.startAfter",arguments,1);var i=this.boundFromDocOrFields("Query.startAfter",e,n,!1);return new t(this._query.withStartAt(i),this.firestore)},t.prototype.endBefore=function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];x("Query.endBefore",arguments,1);var i=this.boundFromDocOrFields("Query.endBefore",e,n,!0);return new t(this._query.withEndAt(i),this.firestore)},t.prototype.endAt=function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];x("Query.endAt",arguments,1);var i=this.boundFromDocOrFields("Query.endAt",e,n,!1);return new t(this._query.withEndAt(i),this.firestore)},t.prototype.isEqual=function(e){if(!(e instanceof t))throw B("isEqual","Query",1,e);return this.firestore===e.firestore&&this._query.isEqual(e._query)},t.prototype.boundFromDocOrFields=function(t,e,n,r){if(V(t,1,e),e instanceof ro){if(n.length>0)throw new _("invalid-argument","Too many arguments provided to "+t+"().");var i=e;if(!i.exists)throw new _("not-found","Can't use a DocumentSnapshot that doesn't exist for "+t+"().");return this.boundFromDocument(t,i._document,r)}var o=[e].concat(n);return this.boundFromFields(t,o,r)},t.prototype.boundFromDocument=function(t,e,n){for(var r=[],i=0,o=this._query.orderBy;i<o.length;i++){var a=o[i];if(a.field.isKeyField())r.push(new xt(this.firestore._databaseId,e.key));else{var s=e.field(a.field);if(void 0===s){var u=a.field.canonicalString();throw new _("invalid-argument","Invalid query. You are trying to start or end a query using a document for which the field '"+u+"' (used as the orderBy) does not exist.")}r.push(s)}}return new $t(r,n)},t.prototype.boundFromFields=function(t,e,n){var r=this._query.explicitOrderBy;if(e.length>r.length)throw new _("invalid-argument","Too many arguments provided to "+t+"(). The number of arguments must be less than or equal to the number of Query.orderBy() clauses");for(var i=[],o=0;o<e.length;o++){var a=e[o];
1if(r[o].field.isKeyField()){if("string"!=typeof a)throw new _("invalid-argument","Invalid query. Expected a string for document ID in "+t+"(), but got a "+typeof a);if(-1!==a.indexOf("/"))throw new _("invalid-argument","Invalid query. Document ID '"+a+"' contains a slash in "+t+"()");var s=new at(this._query.path.child(a));i.push(new xt(this.firestore._databaseId,s))}else{var u=this.firestore._dataConverter.parseQueryValue(t,a);i.push(u)}}return new $t(i,n)},t.prototype.onSnapshot=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];A("Query.onSnapshot",arguments,1,4);var n,r={},i=0;return"object"!=typeof t[i]||xi(t[i])||(q("Query.onSnapshot",r=t[i],["includeMetadataChanges"]),j("Query.onSnapshot","boolean","includeMetadataChanges",r.includeMetadataChanges),i++),xi(t[i])?n=t[i]:(D("Query.onSnapshot","function",i,t[i]),R("Query.onSnapshot","function",i+1,t[i+1]),R("Query.onSnapshot","function",i+2,t[i+2]),n={next:t[i],error:t[i+1],complete:t[i+2]}),this.onSnapshotInternal(r,n)},t.prototype.onSnapshotInternal=function(t,e){var n=this,r=function(t){console.error("Uncaught Error in onSnapshot:",t)};e.error&&(r=e.error.bind(e));var i=new wi({next:function(t){e.next&&e.next(new ao(n.firestore,n._query,t))},error:r}),o=this.firestore.ensureClientConfigured(),a=o.listen(this._query,i,t);return function(){i.mute(),o.unlisten(a)}},t.prototype.get=function(t){var e=this;return A("Query.get",arguments,0,1),lo("Query.get",t),new Promise((function(n,r){t&&"cache"===t.source?e.firestore.ensureClientConfigured().getDocumentsFromLocalCache(e._query).then((function(t){n(new ao(e.firestore,e._query,t))}),r):e.getViaSnapshotListener(n,r,t)}))},t.prototype.getViaSnapshotListener=function(t,e,n){var r=this.onSnapshotInternal({includeMetadataChanges:!0,waitForSyncWhenOnline:!0},{next:function(i){r(),i.metadata.fromCache&&n&&"server"===n.source?e(new _("unavailable",'Failed to get documents from server. (However, these documents may exist in the local cache. Run again without setting source to "server" to retrieve the cached documents.)')):t(i)},error:e})},t.prototype.validateNewFilter=function(t){if(t instanceof Bt)if(t.isInequality()){var e=this._query.getInequalityFilterField();if(null!==e&&!e.isEqual(t.field))throw new _("invalid-argument","Invalid query. All where filters with an inequality (<, <=, >, or >=) must be on the same field. But you have inequality filters on '"+e.toString()+"' and '"+t.field.toString()+"'");var n=this._query.getFirstOrderByField();null!==n&&this.validateOrderByAndInequalityMatch(t.field,n)}else if(t.op===qt.ARRAY_CONTAINS&&this._query.hasArrayContainsFilter())throw new _("invalid-argument","Invalid query. Queries only support a single array-contains filter.")},t.prototype.validateNewOrderBy=function(t){if(null===this._query.getFirstOrderByField()){var e=this._query.getInequalityFilterField();null!==e&&this.validateOrderByAndInequalityMatch(e,t.field)}},t.prototype.validateOrderByAndInequalityMatch=function(t,e){if(!e.isEqual(t))throw new _("invalid-argument","Invalid query. You have a where filter with an inequality (<, <=, >, or >=) on field '"+t.toString()+"' and so you must also use '"+t.toString()+"' as your first Query.orderBy(), but your first Query.orderBy() is on field '"+e.toString()+"' instead.")},t}(),ao=function(){function t(t,e,n){this._firestore=t,this._originalQuery=e,this._snapshot=n,this._cachedChanges=null,this._cachedChangesIncludeMetadataChanges=null,this.metadata=new no(n.hasPendingWrites,n.fromCache)}return Object.defineProperty(t.prototype,"docs",{get:function(){var t=[];return this.forEach((function(e){return t.push(e)})),t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"empty",{get:function(){return this._snapshot.docs.isEmpty()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return this._snapshot.docs.size},enumerable:!0,configurable:!0}),t.prototype.forEach=function(t,e){var n=this;A("QuerySnapshot.forEach",arguments,1,2),D("QuerySnapshot.forEach","function",1,t),this._snapshot.docs.forEach((function(r){t.call(e,n.convertToDocumentImpl(r))}))},Object.defineProperty(t.prototype,"query",{get:function(){return new oo(this._originalQuery,this._firestore)},enumerable:!0,configurable:!0}
1),t.prototype.docChanges=function(t){t&&(q("QuerySnapshot.docChanges",t,["includeMetadataChanges"]),j("QuerySnapshot.docChanges","boolean","includeMetadataChanges",t.includeMetadataChanges));var e=!(!t||!t.includeMetadataChanges);if(e&&this._snapshot.excludesMetadataChanges)throw new _("invalid-argument","To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");return this._cachedChanges&&this._cachedChangesIncludeMetadataChanges===e||(this._cachedChanges=function(t,e,n){if(n.oldDocs.isEmpty()){var r,i=0;return n.docChanges.map((function(e){var o=new io(t,e.doc.key,e.doc,n.fromCache,n.mutatedKeys.has(e.doc.key));return g(e.type===De.Added,"Invalid event type for first snapshot"),g(!r||n.query.docComparator(r,e.doc)<0,"Got added events in wrong order"),r=e.doc,{type:"added",doc:o,oldIndex:-1,newIndex:i++}}))}var o=n.oldDocs;return n.docChanges.filter((function(t){return e||t.type!==De.Metadata})).map((function(e){var r=new io(t,e.doc.key,e.doc,n.fromCache,n.mutatedKeys.has(e.doc.key)),i=-1,a=-1;return e.type!==De.Added&&(g((i=o.indexOf(e.doc.key))>=0,"Index for document not found"),o=o.delete(e.doc.key)),e.type!==De.Removed&&(a=(o=o.add(e.doc)).indexOf(e.doc.key)),{type:fo(e.type),doc:r,oldIndex:i,newIndex:a}}))}(this._firestore,e,this._snapshot),this._cachedChangesIncludeMetadataChanges=e),this._cachedChanges},t.prototype.isEqual=function(e){if(!(e instanceof t))throw B("isEqual","QuerySnapshot",1,e);return this._firestore===e._firestore&&this._originalQuery.isEqual(e._originalQuery)&&this._snapshot.isEqual(e._snapshot)},t.prototype.convertToDocumentImpl=function(t){return new io(this._firestore,t.key,t,this.metadata.fromCache,this._snapshot.mutatedKeys.has(t.key))},t}();["length","forEach","map"].concat("undefined"!=typeof Symbol?[Symbol.iterator]:[]).forEach((function(t){try{Object.defineProperty(ao.prototype.docChanges,t,{get:function(){return function(){throw new _("invalid-argument",'QuerySnapshot.docChanges has been changed from a property into a method, so usages like "querySnapshot.docChanges" should become "querySnapshot.docChanges()"')}()}})}catch(e){}}));var so=function(t){function e(e,n){var r=t.call(this,Ut.atPath(e),n)||this;if(e.length%2!=1)throw new _("invalid-argument","Invalid collection reference. Collection references must have an odd number of segments, but "+e.canonicalString()+" has "+e.length);return r}return a.__extends(e,t),Object.defineProperty(e.prototype,"id",{get:function(){return this._query.path.lastSegment()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){var t=this._query.path.popLast();return t.isEmpty()?null:new eo(new at(t),this.firestore)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"path",{get:function(){return this._query.path.canonicalString()},enumerable:!0,configurable:!0}),e.prototype.doc=function(t){if(A("CollectionReference.doc",arguments,0,1),0===arguments.length&&(t=H.newId()),D("CollectionReference.doc","non-empty string",1,t),""===t)throw new _("invalid-argument","Document path must be a non-empty string");var e=rt.fromString(t);return eo.forPath(this._query.path.child(e),this.firestore)},e.prototype.add=function(t){O("CollectionReference.add",arguments,1),D("CollectionReference.add","object",1,t);var e=this.doc();return e.set(t).then((function(){return e}))},e}(oo);function uo(t,e){if(void 0===e)return{merge:!1};if(q(t,e,["merge","mergeFields"]),j(t,"boolean","merge",e.merge),"mergeFields","a string or a FieldPath",void 0!==(n=e.mergeFields)&&function(t,e,n,r,i){if(!(r instanceof Array))throw new _("invalid-argument","Function "+t+"() requires its mergeFields option to be an array, but it was: "+U(r));for(var o=0;o<r.length;++o)if(!i(r[o]))throw new _("invalid-argument","Function "+t+"() requires all mergeFields elements to be a string or a FieldPath, but the value at index "+o+" was: "+U(r[o]))}(t,0,0,n,(function(t){return"string"==typeof t||t instanceof _i})),void 0!==e.mergeFields&&void 0!==e.merge)throw new _("invalid-argument","Invalid options passed to function "+t+'(): You cannot specify both "merge" and "mergeFields".');var n;return e}function co(t,e){return void 0===e?{}:(q(t,e,["serverTimestamps"]),M(t,0,"serverTimestamps",e.serverTimestamps,["estimate","previous","none"]),e)}function lo(t,e){R(t,"object",1,e),e&&(q(t,e,["source"]),M(t,0,"s
1ource",e.source,["default","server","cache"]))}function ho(t,e,n){if(e instanceof eo){if(e.firestore!==n)throw new _("invalid-argument","Provided document reference is from a different Firestore instance.");return e}throw B(t,"DocumentReference",1,e)}function fo(t){switch(t){case De.Added:return"added";case De.Modified:case De.Metadata:return"modified";case De.Removed:return"removed";default:return v("Unknown change type: "+t)}}var po=S(Ji,"Use firebase.firestore() instead."),mo=S(Zi,"Use firebase.firestore().runTransaction() instead."),yo=S(to,"Use firebase.firestore().batch() instead."),vo=S(eo,"Use firebase.firestore().doc() instead."),go=S(ro),bo=S(io),wo=S(oo),_o=S(ao),So=S(so,"Use firebase.firestore().collection() instead."),Co={Firestore:po,GeoPoint:J,Timestamp:Z,Blob:X,Transaction:mo,WriteBatch:yo,DocumentReference:vo,DocumentSnapshot:go,Query:wo,QueryDocumentSnapshot:bo,QuerySnapshot:_o,CollectionReference:So,FieldPath:_i,FieldValue:ji,setLogLevel:Ji.setLogLevel,CACHE_SIZE_UNLIMITED:Qi};function Eo(t){t.INTERNAL.registerService("firestore",(function(t){return new Ji(t)}),function(t){g(t&&"object"==typeof t,"shallowCopy() expects object parameter.");var e={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}(Co))}Eo(i),e.registerFirestore=Eo},"6ahw":function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n("iLxQ"),i=n("DKTb"),o={closed:!0,next:function(t){},error:function(t){if(r.a.useDeprecatedSynchronousErrorHandling)throw t;Object(i.a)(t)},complete:function(){}}},"6blF":function(t,e,n){"use strict";var r=n("FFOo"),i=n("L/V9"),o=n("6ahw"),a=n("xTla"),s=n("y3By"),u=n("iLxQ");n.d(e,"a",(function(){return c}));var c=function(){function t(t){this._isScalar=!1,t&&(this._subscribe=t)}return t.prototype.lift=function(e){var n=new t;return n.source=this,n.operator=e,n},t.prototype.subscribe=function(t,e,n){var a=this.operator,s=function(t,e,n){if(t){if(t instanceof r.a)return t;if(t[i.a])return t[i.a]()}return t||e||n?new r.a(t,e,n):new r.a(o.a)}(t,e,n);if(a?a.call(s,this.source):s.add(this.source||u.a.useDeprecatedSynchronousErrorHandling&&!s.syncErrorThrowable?this._subscribe(s):this._trySubscribe(s)),u.a.useDeprecatedSynchronousErrorHandling&&s.syncErrorThrowable&&(s.syncErrorThrowable=!1,s.syncErrorThrown))throw s.syncErrorValue;return s},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){u.a.useDeprecatedSynchronousErrorHandling&&(t.syncErrorThrown=!0,t.syncErrorValue=e),function(t){for(;t;){var e=t.destination;if(t.closed||t.isStopped)return!1;t=e&&e instanceof r.a?e:null}return!0}(t)?t.error(e):console.warn(e)}},t.prototype.forEach=function(t,e){var n=this;return new(e=l(e))((function(e,r){var i;i=n.subscribe((function(e){try{t(e)}catch(n){r(n),i&&i.unsubscribe()}}),r,e)}))},t.prototype._subscribe=function(t){var e=this.source;return e&&e.subscribe(t)},t.prototype[a.a]=function(){return this},t.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return 0===t.length?this:Object(s.b)(t)(this)},t.prototype.toPromise=function(t){var e=this;return new(t=l(t))((function(t,n){var r;e.subscribe((function(t){return r=t}),(function(t){return n(t)}),(function(){return t(r)}))}))},t.create=function(e){return new t(e)},t}();function l(t){if(t||(t=u.a.Promise||Promise),!t)throw new Error("no Promise impl found");return t}},"6d8W":function(t,e,n){"use strict";var r=n("I1rR"),i=n("mY8+")(6),o="findIndex",a=!0;o in[]&&Array(1)[o]((function(){a=!1})),r(r.P+r.F*a,"Array",{findIndex:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}}),n("dNFx")(o)},"74FJ":function(t,e,n){"use strict";var r=n("9Aud"),i=n("lv+R"),o=n("UOZm"),a=n("j/6h"),s=n("H1Af"),u=Object.assign;t.exports=!u||n("61rj")((function(){var t={},e={},n=Symbol(),r="abcdefghijklmnopqrst";return t[n]=7,r.split("").forEach((function(t){e[t]=t})),7!=u({},t)[n]||Object.keys(u({},e)).join("")!=r}))?function(t,e){for(var n=a(t),u=arguments.length,c=1,l=i.f,h=o.f;u>c;)for(var f,d=s(arguments[c++]),p=l?r(d).concat(l(d)):r(d),m=p.length,y=0;m>y;)h.call(d,f=p[y++])&&(n[f]=d[f]);return n}:u},"83ve":function(t,e,n){"use strict";n.d(e,"c",(function(){return a})),n.d(e,"d",(function(){return s})),n.d(e,"b",(function(){return u})),n.d(e,"a",(function(){return c}));var r=n("htu+"),i=n("67Y/"),o=n("dC0D");function a(t,e){return Object(r.a)(t,e).pipe(Object(i.a)((function(t){return t.payload.docChanges().map((function(t){return{type:t.type,payload:t}}
1))})))}function s(t,e,n){return Object(r.a)(t,n).pipe(Object(i.a)((function(t){return t.payload.docChanges()})),Object(o.a)((function(t,n){return u(t,n,e)}),[]),Object(i.a)((function(t){return t.map((function(t){return{type:t.type,payload:t}}))})))}function u(t,e,n){return e.forEach((function(e){n.indexOf(e.type)>-1&&(t=c(t,e))})),t}function c(t,e){switch(e.type){case"added":t[e.newIndex]&&t[e.newIndex].doc.ref.isEqual(e.doc.ref)||t.splice(e.newIndex,0,e);break;case"modified":(null==t[e.oldIndex]||t[e.oldIndex].doc.ref.isEqual(e.doc.ref))&&(e.oldIndex!==e.newIndex?(t.splice(e.oldIndex,1),t.splice(e.newIndex,0,e)):t.splice(e.newIndex,1,e));break;case"removed":t[e.oldIndex]&&t[e.oldIndex].doc.ref.isEqual(e.doc.ref)&&t.splice(e.oldIndex,1)}return t}},"8L4g":function(t,e){t.exports=!1},"8g8A":function(t,e,n){"use strict";function r(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}n.d(e,"a",(function(){return i})),r.prototype=Object.create(Error.prototype);var i=r},"8i1V":function(t,e,n){"use strict";var r=n("qtiw"),i=n("g0Mr"),o=n("lIov"),a=n("I1rR"),s=n("TDVo"),u=n("Oyqw").KEY,c=n("61rj"),l=n("ezrC"),h=n("A+3H"),f=n("U/+K"),d=n("jZgK"),p=n("eKN1"),m=n("u00B"),y=n("GShy"),v=n("oxOc"),g=n("UFGs"),b=n("Zp05"),w=n("rSCU"),_=n("IiNp"),S=n("xGvh"),C=n("xrBK"),E=n("4ftG"),T=n("bKVB"),k=n("ytDL"),I=n("9Aud"),O=T.f,x=k.f,A=E.f,P=r.Symbol,D=r.JSON,R=D&&D.stringify,N=d("_hidden"),j=d("toPrimitive"),M={}.propertyIsEnumerable,L=l("symbol-registry"),F=l("symbols"),U=l("op-symbols"),V=Object.prototype,q="function"==typeof P,B=r.QObject,W=!B||!B.prototype||!B.prototype.findChild,z=o&&c((function(){return 7!=C(x({},"a",{get:function(){return x(this,"a",{value:7}).a}})).a}))?function(t,e,n){var r=O(V,e);r&&delete V[e],x(t,e,n),r&&t!==V&&x(V,e,r)}:x,H=function(t){var e=F[t]=C(P.prototype);return e._k=t,e},$=q&&"symbol"==typeof P.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof P},K=function(t,e,n){return t===V&&K(U,e,n),g(t),e=_(e,!0),g(n),i(F,e)?(n.enumerable?(i(t,N)&&t[N][e]&&(t[N][e]=!1),n=C(n,{enumerable:S(0,!1)})):(i(t,N)||x(t,N,S(1,{})),t[N][e]=!0),z(t,e,n)):x(t,e,n)},G=function(t,e){g(t);for(var n,r=y(e=w(e)),i=0,o=r.length;o>i;)K(t,n=r[i++],e[n]);return t},Q=function(t){var e=M.call(this,t=_(t,!0));return!(this===V&&i(F,t)&&!i(U,t))&&(!(e||!i(this,t)||!i(F,t)||i(this,N)&&this[N][t])||e)},Y=function(t,e){if(t=w(t),e=_(e,!0),t!==V||!i(F,e)||i(U,e)){var n=O(t,e);return!n||!i(F,e)||i(t,N)&&t[N][e]||(n.enumerable=!0),n}},X=function(t){for(var e,n=A(w(t)),r=[],o=0;n.length>o;)i(F,e=n[o++])||e==N||e==u||r.push(e);return r},J=function(t){for(var e,n=t===V,r=A(n?U:w(t)),o=[],a=0;r.length>a;)!i(F,e=r[a++])||n&&!i(V,e)||o.push(F[e]);return o};q||(s((P=function(){if(this instanceof P)throw TypeError("Symbol is not a constructor!");var t=f(arguments.length>0?arguments[0]:void 0),e=function(n){this===V&&e.call(U,n),i(this,N)&&i(this[N],t)&&(this[N][t]=!1),z(this,t,S(1,n))};return o&&W&&z(V,t,{configurable:!0,set:e}),H(t)}).prototype,"toString",(function(){return this._k})),T.f=Y,k.f=K,n("GMxU").f=E.f=X,n("UOZm").f=Q,n("lv+R").f=J,o&&!n("8L4g")&&s(V,"propertyIsEnumerable",Q,!0),p.f=function(t){return H(d(t))}),a(a.G+a.W+a.F*!q,{Symbol:P});for(var Z="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),tt=0;Z.length>tt;)d(Z[tt++]);for(var et=I(d.store),nt=0;et.length>nt;)m(et[nt++]);a(a.S+a.F*!q,"Symbol",{for:function(t){return i(L,t+="")?L[t]:L[t]=P(t)},keyFor:function(t){if(!$(t))throw TypeError(t+" is not a symbol!");for(var e in L)if(L[e]===t)return e},useSetter:function(){W=!0},useSimple:function(){W=!1}}),a(a.S+a.F*!q,"Object",{create:function(t,e){return void 0===e?C(t):G(C(t),e)},defineProperty:K,defineProperties:G,getOwnPropertyDescriptor:Y,getOwnPropertyNames:X,getOwnPropertySymbols:J}),D&&a(a.S+a.F*(!q||c((function(){var t=P();return"[null]"!=R([t])||"{}"!=R({a:t})||"{}"!=R(Object(t))}))),"JSON",{stringify:function(t){for(var e,n,r=[t],i=1;arguments.length>i;)r.push(arguments[i++]);if(n=e=r[1],(b(e)||void 0!==t)&&!$(t))return v(e)||(e=function(t,e){if("function"==typeof n&&(e=n.call(this,t,e)),!$(e))return e}),r[1]=e,R.apply(D,r)}}),P.prototype[j]||n("GYIZ")(P.prototype,j,P.prototype.valueOf),h(P,"Symbol"),h(Math,"Math",!0),h(r.JSON,"JSON",!0)},"8nGB":function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){function t(){}return t.prototype.isISoftbank=function(t){var e=!1;return-1!==t.value.indexOf(".vodafone.ne")&&(e=!0),-1!==t.value.indexOf("@softbank.ne")&&(e=!0),e?{isISoftbank:!0}:null},t}()},"8ouO":function(t,e){t.exports=function(t){if(null==t)throw TypeError("Can't call method on  "+t);return t}},"9Aud":function(t,e,n){var r=n("Iy4/"),i=n("kSm0");t.exports=Object.keys||function(t){return r(t,i)}},"9V49":function(t,e,n){"use strict";n.d(e,"a",(function(){return h}));var r=n("0/uQ"),i=n("htu+"),o=n("67Y/"),a=n("VnD/"),s=n("dC0D"),u=n("mZXl"),c=n("UdJG"),l=n("83ve"),h=function(){function t(t,e){this.query=t,this.afs=e}return t.prototype.stateChanges=function(t){return t&&0!==t.length?Object(l.c)(this.query,this.afs.schedulers.outsideAngular).pipe(this.afs.keepUnstableUntilFirst,Object(o.a)((function(e){return e.filter((function(e){return t.indexOf(e.type)>-1}))}
1)),Object(a.a)((function(t){return t.length>0}))):Object(l.c)(this.query,this.afs.schedulers.outsideAngular).pipe(this.afs.keepUnstableUntilFirst)},t.prototype.auditTrail=function(t){return this.stateChanges(t).pipe(Object(s.a)((function(t,e){return t.concat(e)}),[]))},t.prototype.snapshotChanges=function(t){var e=Object(c.b)(t);return Object(l.d)(this.query,e,this.afs.schedulers.outsideAngular).pipe(this.afs.keepUnstableUntilFirst)},t.prototype.valueChanges=function(){return Object(i.a)(this.query,this.afs.schedulers.outsideAngular).pipe(this.afs.keepUnstableUntilFirst,Object(o.a)((function(t){return t.payload.docs.map((function(t){return t.data()}))})))},t.prototype.get=function(t){return Object(r.a)(this.query.get(t)).pipe(Object(u.a)(this.afs.schedulers.insideAngular))},t}()},"A+3H":function(t,e,n){var r=n("ytDL").f,i=n("g0Mr"),o=n("jZgK")("toStringTag");t.exports=function(t,e,n){t&&!i(t=n?t:t.prototype,o)&&r(t,o,{configurable:!0,value:e})}},ABqa:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,i=n("t7fG"),o=(r=n("wj3C"))&&"object"==typeof r&&"default"in r?r.default:r,a={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(t){function e(n,r,i){var o=t.call(this,r)||this;return Object.setPrototypeOf(o,e.prototype),o.code=n,o.details=i,o}return i.__extends(e,t),e}(Error),u=function(){function t(t){this.app=t}return t.prototype.getAuthToken=function(){return i.__awaiter(this,void 0,void 0,(function(){var t;return i.__generator(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,this.app.INTERNAL.getToken()];case 1:return(t=e.sent())?[2,t.accessToken]:[2,void 0];case 2:return e.sent(),[2,void 0];case 3:return[2]}}
1))}))},t.prototype.getInstanceIdToken=function(){return i.__awaiter(this,void 0,void 0,(function(){var t;return i.__generator(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),this.app.messaging?[4,this.app.messaging().getToken()]:[2,void 0];case 1:return(t=e.sent())?[2,t]:[2,void 0];case 2:return e.sent(),[2,void 0];case 3:return[2]}}))}))},t.prototype.getContext=function(){return i.__awaiter(this,void 0,void 0,(function(){var t,e;return i.__generator(this,(function(n){switch(n.label){case 0:return[4,this.getAuthToken()];case 1:return t=n.sent(),[4,this.getInstanceIdToken()];case 2:return e=n.sent(),[2,{authToken:t,instanceIdToken:e}]}}))}))},t}();function c(t,e){var n={};for(var r in t)t.hasOwnProperty(r)&&(n[r]=e(t[r]));return n}var l=function(){function t(){}return t.prototype.encode=function(t){var e=this;if(null==t)return null;if(t instanceof Number&&(t=t.valueOf()),"number"==typeof t&&isFinite(t))return t;if(!0===t||!1===t)return t;if("[object String]"===Object.prototype.toString.call(t))return t;if(Array.isArray(t))return t.map((function(t){return e.encode(t)}));if("function"==typeof t||"object"==typeof t)return c(t,(function(t){return e.encode(t)}));throw new Error("Data cannot be encoded in JSON: "+t)},t.prototype.decode=function(t){var e=this;if(null===t)return t;if(t["@type"])switch(t["@type"]){case"type.googleapis.com/google.protobuf.Int64Value":case"type.googleapis.com/google.protobuf.UInt64Value":var n=parseFloat(t.value);if(isNaN(n))throw new Error("Data cannot be decoded from JSON: "+t);return n;default:throw new Error("Data cannot be decoded from JSON: "+t)}return Array.isArray(t)?t.map((function(t){return e.decode(t)})):"function"==typeof t||"object"==typeof t?c(t,(function(t){return e.decode(t)})):t},t}(),h=function(){function t(t,e){void 0===e&&(e="us-central1"),this.app_=t,this.region_=e,this.serializer=new l,this.emulatorOrigin=null,this.contextProvider=new u(t)}return Object.defineProperty(t.prototype,"app",{get:function(){return this.app_},enumerable:!0,configurable:!0}),t.prototype._url=function(t){var e=this.app_.options.projectId,n=this.region_;return null!==this.emulatorOrigin?this.emulatorOrigin+"/"+e+"/"+n+"/"+t:"https://"+n+"-"+e+".cloudfunctions.net/"+t},t.prototype.useFunctionsEmulator=function(t){this.emulatorOrigin=t},t.prototype.httpsCallable=function(t){var e=this;return function(n){return e.call(t,n)}},t.prototype.postJSON=function(t,e,n){return i.__awaiter(this,void 0,void 0,(function(){var r,o;return i.__generator(this,(function(i){switch(i.label){case 0:n.append("Content-Type","application/json"),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,fetch(t,{method:"POST",body:JSON.stringify(e),headers:n})];case 2:return r=i.sent(),[3,4];case 3:return i.sent(),[2,{status:0,json:null}];case 4:o=null,i.label=5;case 5:return i.trys.push([5,7,,8]),[4,r.json()];case 6:return o=i.sent(),[3,8];case 7:return i.sent(),[3,8];case 8:return[2,{status:r.status,json:o}]}}))}))},t.prototype.call=function(t,e){return i.__awaiter(this,void 0,void 0,(function(){var n,r,o,u,c,l,h;return i.__generator(this,(function(i){switch(i.label){case 0:return n=this._url(t),e=this.serializer.encode(e),r={data:e},o=new Headers,[4,this.contextProvider.getContext()];case 1:return(u=i.sent()).authToken&&o.append("Authorization","Bearer "+u.authToken),u.instanceIdToken&&o.append("Firebase-Instance-ID-Token",u.instanceIdToken),[4,this.postJSON(n,r,o)];case 2:if(c=i.sent(),l=function(t,e,n){var r=function(t){if(t>=200&&t<300)return"ok";switch(t){case 0:return"internal";case 400:return"invalid-argument";case 401:return"unauthenticated";case 403:return"permission-denied";case 404:return"not-found";case 409:return"aborted";case 429:return"resource-exhausted";case 499:return"cancelled";case 500:return"internal";case 501:return"unimplemented";case 503:return"unavailable";case 504:return"deadline-exceeded"}return"unknown"}(t),i=r,o=void 0;try{var u=e.error;if(u){var c=u.status;if("string"==typeof c){if(!a[c])return new s("internal","internal");r=a[c]}i=c;var l=u.message;
1"string"==typeof l&&(i=l),void 0!==(o=u.details)&&(o=n.decode(o))}}catch(h){}return"ok"===r?null:new s(r,i,o)}(c.status,c.json,this.serializer))throw l;if(!c.json)throw new s("internal","Response is not valid JSON object.");if(void 0===(h=c.json.data)&&(h=c.json.result),void 0===h)throw new s("internal","Response is missing data field.");return[2,{data:this.serializer.decode(h)}]}}))}))},t}();function f(t,e,n){return new h(t,n)}function d(t){t.INTERNAL.registerService("functions",f,{Functions:h},void 0,!0)}d(o),e.registerFunctions=d},AR9Z:function(t,e,n){n("8i1V"),n("CNRE"),n("yLjp"),n("ZhmJ"),t.exports=n("Autd").Symbol},Autd:function(t,e){var n=t.exports={version:"2.5.5"};"number"==typeof __e&&(__e=n)},AytR:function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r={production:!0,firebaseConfig:{apiKey:"AIzaSyAADa0QhEakx5lHHR3ShUlxwBNWHL_o8Xw",authDomain:"kuma-member.firebaseapp.com",databaseURL:"https://kuma-member.firebaseio.com",projectId:"kuma-member",storageBucket:"kuma-member.appspot.com",messagingSenderId:"19816782538"},stripekey:"pk_test_U9qh5rObPVW9HOBVgTjW4fRD",paymentId:"108227",apiUrl:"https://kumanoyakitori.co.jp",analytics:{id:"UA-138541220-1"},newPaymentID:"11effe44-946c-4ee0-af91-9ba7c50f4465",applid:["eyJ0eXAiOiJKV1QiLCJh","bGciOiJIUzI1NiJ9.eyJ","zdWIiOiJhcHBfdG9rZW4","iLCJpYXQiOjE2OTc4NjM","3NTUsIm1lcmNoYW50X2l","kIjoiMTFlZDhjZDgtYjF","lNC0xYTk2LTlhMjAtZWY","3MDFlOGYyOTU1Iiwic3R","vcmVfaWQiOiIxMWVkOGN","kOS01YzU2LTRlYzItYjQ","zMi1jMzBmYzdhZTIyM2E","iLCJkb21haW5zIjpbXSw","ibW9kZSI6ImxpdmUiLCJ","jcmVhdG9yX2lkIjoiMTF","lYmI2YmItM2E1Yi1iYTE","0LWE3MTYtMWJjYzBmOGI","0OTUwIiwidmVyc2lvbiI","6MSwianRpIjoiMTFlZTZ","mY2QtMmZmZC1lMDFmLWI","2MzQtNTE1MTg4N2I3ZjA","yIn0.hBLhGGlnNlRiFXP","kidNZA6cAy1RRdlIMb63","GPEhevEo"],baseUrl:"https://kumanoyakitori.co.jp/"}},BCwa:function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var r=n("mrSG"),i=n("FX7f"),o=function(){return Object(i.a)().easing("cubic-bezier(0.0, 0.0, 0.2, 1)").duration(300)},a=function(t){var e,n,r=t.width+8,a=Object(i.a)(),s=Object(i.a)();return t.isEndSide?(e=r+"px",n="0px"):(e=-r+"px",n="0px"),a.addElement(t.menuInnerEl).fromTo("transform","translateX("+e+")","translateX("+n+")"),s.addElement(t.backdropEl).fromTo("opacity",.01,.32),o().addAnimation([a,s])},s=function(t){var e,n,r=t.width;t.isEndSide?(e=-r+"px",n=r+"px"):(e=r+"px",n=-r+"px");var a=Object(i.a)().addElement(t.menuInnerEl).fromTo("transform","translateX("+n+")","translateX(0px)"),s=Object(i.a)().addElement(t.contentEl).fromTo("transform","translateX(0px)","translateX("+e+")"),u=Object(i.a)().addElement(t.backdropEl).fromTo("opacity",.01,.32);return o().addAnimation([a,u,s])},u=function(t){var e=t.width*(t.isEndSide?-1:1)+"px",n=Object(i.a)().addElement(t.contentEl).fromTo("transform","translateX(0px)","translateX("+e+")");return o().addAnimation(n)},c=function(){var t=new Map,e=[],n=function(t){return Object(r.b)(void 0,void 0,void 0,(function(){var n,i;return Object(r.e)(this,(function(r){switch(r.label){case 0:return[4,d()];case 1:return r.sent(),"start"===t||"end"===t?(n=f((function(e){return e.side===t&&!e.disabled})))?[2,n]:[2,f((function(e){return e.side===t}))]:null!=t?[2,f((function(e){return e.menuId===t}))]:(i=f((function(t){return!t.disabled})))?[2,i]:[2,e.length>0?e[0].el:void 0]}}))}))},i=function(){return Object(r.b)(void 0,void 0,void 0,(function(){return Object(r.e)(this,(function(t){switch(t.label){case 0:return[4,d()];case 1:return t.sent(),[2,l()]}}))}))},o=function(e,n){t.set(e,n)},c=function(t){var n=t.side;e.filter((function(e){return e.side===n&&e!==t})).forEach((function(t){return t.disabled=!0}))},l=function(){return f((function(t){return t._isOpen}))},h=function(){return e.some((function(t){return t.isAnimating}))},f=function(t){var n=e.find(t);if(void 0!==n)return n.el},d=function(){return Promise.all(Array.from(document.querySelectorAll("ion-menu")).map((function(t){return t.componentOnReady()})))};return o("reveal",u),o("push",s),o("overlay",a),{registerAnimation:o,get:n,getMenus:function(){return Object(r.b)(void 0,void 0,void 0,(function(){return Object(r.e)(this,(function(t){switch(t.label){case 0:return[4,d()];case 1:return t.sent(),[2,e.map((function(t){return t.el}))]}}))}))},getOpen:i,isEnabled:function(t){return Object(r.b)(void 0,void 0,void 0,(function(){var e;return Object(r.e)(this,(function(r){switch(r.label){case 0:return[4,n(t)];case 1:return(e=r.sent())?[2,!e.disabled]:[2,!1]}}))}))},swipeGesture:function(t,e){return Object(r.b)(void 0,void 0,void 0,(function(){var i;return Object(r.e)(this,(function(r){switch(r.label){case 0:return[4,n(e)];case 1:return(i=r.sent())&&(i.swipeGesture=t),[2,i]}}))}))},isAnimating:function(){return Object(r.b)(void 0,void 0,void 0,(function(){return Object(r.e)(this,(function(t){switch(t.label){case 0:return[4,d()];case 1:return t.sent(),[2,h()]}}))}))},isOpen:function(t){return Object(r.b)(void 0,void 0,void 0,(function(){var e;return Object(r.e)(this,(function(r){switch(r.label){case 0:return null==t?[3,2]:[4,n(t)];case 1:return[2,void 0!==(e=r.sent())&&e.isOpen()];case 2:return[4,i()];case 3:return[2,void 0!==(e=r.sent())]}}))}))},enable:function(t,e){return Object(r.b)(void 0,void 0,void 0,(function(){var i;return Object(r.e)(this,(function(r){switch(r.label){case 0:return[4,n(e)];case 1:return(i=r.sent())&&(i.disabled=!t),[2,i]}}))}))},toggle:function(t){return Object(r.b)(void 0,void 0,void 0,(function(){var e;return Object(r.e)(this,(function(r){switch(r.label){case 0:return[4,n(t)];
1case 1:return(e=r.sent())?[2,e.toggle()]:[2,!1]}}))}))},close:function(t){return Object(r.b)(void 0,void 0,void 0,(function(){var e;return Object(r.e)(this,(function(r){switch(r.label){case 0:return[4,void 0!==t?n(t):i()];case 1:return void 0!==(e=r.sent())?[2,e.close()]:[2,!1]}}))}))},open:function(t){return Object(r.b)(void 0,void 0,void 0,(function(){var e;return Object(r.e)(this,(function(r){switch(r.label){case 0:return[4,n(t)];case 1:return(e=r.sent())?[2,e.open()]:[2,!1]}}))}))},_getOpenSync:l,_createAnimation:function(e,n){var r=t.get(e);if(!r)throw new Error("animation not registered");return r(n)},_register:function(t){e.indexOf(t)<0&&(t.disabled||c(t),e.push(t))},_unregister:function(t){var n=e.indexOf(t);n>-1&&e.splice(n,1)},_setOpen:function(t,e,n){return Object(r.b)(void 0,void 0,void 0,(function(){var o;return Object(r.e)(this,(function(r){switch(r.label){case 0:return h()?[2,!1]:e?[4,i()]:[3,3];case 1:return(o=r.sent())&&t.el!==o?[4,o.setOpen(!1,!1)]:[3,3];case 2:r.sent(),r.label=3;case 3:return[2,t._setOpen(e,n)]}}))}))},_setActiveMenu:c}}()},"Ba8/":function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){function t(){}return t.prototype.isLongEnough=function(t){var e=!1;return t.value.replace(/-/g,"").replace(/\u30fc/g,"").length>11&&(e=!0),e?{isLongEnough:!0}:null},t.prototype.isShortEnough=function(t){var e=!1;return t.value.replace(/-/g,"").replace(/\u30fc/g,"").length<9&&(e=!0),e?{isShortEnough:!0}:null},t}()},Bf66:function(t,e,n){var r={"./ion-action-sheet-controller_8.entry.js":["tiht",0,56],"./ion-action-sheet-ios.entry.js":["8fxj",0,57],"./ion-action-sheet-md.entry.js":["/NAp",0,58],"./ion-alert-ios.entry.js":["v39o",0,59],"./ion-alert-md.entry.js":["LO2T",0,60],"./ion-app_8-ios.entry.js":["QHj0",0,61],"./ion-app_8-md.entry.js":["qAXt",0,62],"./ion-avatar_3-ios.entry.js":["0dZQ",0,63],"./ion-avatar_3-md.entry.js":["KCJs",0,64],"./ion-back-button-ios.entry.js":["alfR",0,65],"./ion-back-button-md.entry.js":["U/jw",0,66],"./ion-backdrop-ios.entry.js":["R/c5",67],"./ion-backdrop-md.entry.js":["pA8c",68],"./ion-button_2-ios.entry.js":["Msuq",0,69],"./ion-button_2-md.entry.js":["u/MI",0,70],"./ion-card_5-ios.entry.js":["lVNE",0,71],"./ion-card_5-md.entry.js":["Gb/J",0,72],"./ion-checkbox-ios.entry.js":["2YsE",0,73],"./ion-checkbox-md.entry.js":["lSJ9",0,74],"./ion-chip-ios.entry.js":["h+UY",0,75],"./ion-chip-md.entry.js":["d14f",0,76],"./ion-col_3.entry.js":["aoqT",77],"./ion-datetime_3-ios.entry.js":["SV55",0,78],"./ion-datetime_3-md.entry.js":["KqJa",0,79],"./ion-fab_3-ios.entry.js":["QdBw",0,80],"./ion-fab_3-md.entry.js":["wLS3",0,81],"./ion-img.entry.js":["lYhy",82],"./ion-infinite-scroll_2-ios.entry.js":["W9z5",0,83],"./ion-infinite-scroll_2-md.entry.js":["Osuu",0,84],"./ion-input-ios.entry.js":["TW18",0,85],"./ion-input-md.entry.js":["A3vp",0,86],"./ion-item-option_3-ios.entry.js":["QSHf",0,87],"./ion-item-option_3-md.entry.js":["Lc8E",0,88],"./ion-item_8-ios.entry.js":["yJkF",0,89],"./ion-item_8-md.entry.js":["nJbe",0,90],"./ion-loading-ios.entry.js":["qfPd",0,91],"./ion-loading-md.entry.js":["Voy3",0,92],"./ion-menu_4-ios.entry.js":["FBP2",0,93],"./ion-menu_4-md.entry.js":["g/I3",0,94],"./ion-modal-ios.entry.js":["0+Bq",0,95],"./ion-modal-md.entry.js":["AF5P",0,96],"./ion-nav_5.entry.js":["nD5p",0,97],"./ion-popover-ios.entry.js":["ZG/G",0,98],"./ion-popover-md.entry.js":["z0lq",0,99],"./ion-progress-bar-ios.entry.js":["2YQO",0,100],"./ion-progress-bar-md.entry.js":["qDED",0,101],"./ion-radio_2-ios.entry.js":["IOpt",0,102],"./ion-radio_2-md.entry.js":["Q4Z5",0,103],"./ion-range-ios.entry.js":["t0+n",0,104],"./ion-range-md.entry.js":["Hy4L",0,105],"./ion-refresher_2-ios.entry.js":["ASjW",0,106],"./ion-refresher_2-md.entry.js":["liZc",0,107],"./ion-reorder_2-ios.entry.js":["aMvp",0,108],"./ion-reorder_2-md.entry.js":["wCZP",0,109],"./ion-ripple-effect.entry.js":["yNr1",110],"./ion-route_4.entry.js":["EOjV",0,111],"./ion-searchbar-ios.entry.js":["RXmo",0,112],"./ion-searchbar-md.entry.js":["ffsq",0,113],"./ion-segment_2-ios.entry.js":["Loa/",0,114],"./ion-segment_2-md.entry.js":["hm+o",0,115],"./ion-select_3-ios.entry.js":["kxfy",0,116],"./ion-select_3-md.entry.js":["RRhw",0,117],"./ion-slide_2-ios.entry.js":["MyoC",118],"./ion-slide_2-md.entry.js":["pKl9",119],"./ion-spinner.entry.js":["4RuT",0,120],"./ion-split-pane-ios.entry.js":["8LTB",121],"./ion-split-pane-md.entry.js":["zG3r",122],"./ion-tab-bar_2-ios.entry.js":["ri6M",0,123],"./ion-tab-bar_2-md.entry.js":["3xPB",0,124],"./ion-tab_2.entry.js":["ZyW4",0,125],"./ion-text.entry.js":["7Ttm",0,126],"./ion-textarea-ios.entry.js":["bRvG",0,127],"./ion-textarea-md.entry.js":["RoCC",0,128],"./ion-toast-ios.entry.js":["W9p6",0,129],"./ion-toast-md.entry.js":["XCFn",0,130],"./ion-toggle-ios.entry.js":["ba+K",0,131],"./ion-toggle-md.entry.js":["ro3r",0,132],"./ion-virtual-scroll.entry.js":["X9e5",133]};function i(t){var e=r[t];return e?Promise.all(e.slice(1).map(n.e)).then((function(){return n(e[0])})):Promise.resolve().then((function(){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}))}i.keys=function(){return Object.keys(r)},i.id="Bf66",t.exports=i},CB3U:function(t,e,n){"use strict";n.r(e);var r=n("ZBkt"),i=n("MGeu");n.d(e,"AngularFireAuth",(function(){return r.a})),n.d(e,"AngularFireAuthModule",(function(){return i.a}))},CNRE:function(t,e,n){"use strict";var r=n("QEVv"),i={};i[n("jZgK")("toStringTag")]="z",i+""!="[object z]"&&n("TDVo")(Object.prototype,"toString",(function(){return"[object "+r(this)+"]"}),!0)},CS9Q:function(t,e,n){"use strict";var r=n("mrSG"),i=function(){function t(e,n){void 0===n&&(n=t.now),this.SchedulerA
1ction=e,this.now=n}return t.prototype.schedule=function(t,e,n){return void 0===e&&(e=0),new this.SchedulerAction(this,t).schedule(n,e)},t.now=function(){return Date.now()},t}();n.d(e,"a",(function(){return o}));var o=function(t){function e(n,r){void 0===r&&(r=i.now);var o=t.call(this,n,(function(){return e.delegate&&e.delegate!==o?e.delegate.now():r()}))||this;return o.actions=[],o.active=!1,o.scheduled=void 0,o}return r.d(e,t),e.prototype.schedule=function(n,r,i){return void 0===r&&(r=0),e.delegate&&e.delegate!==this?e.delegate.schedule(n,r,i):t.prototype.schedule.call(this,n,r,i)},e.prototype.flush=function(t){var e=this.actions;if(this.active)e.push(t);else{var n;this.active=!0;do{if(n=t.execute(t.state,t.delay))break}while(t=e.shift());if(this.active=!1,n){for(;t=e.shift();)t.unsubscribe();throw n}}},e}(i)},CTpc:function(t,e,n){"use strict";n.d(e,"a",(function(){return x})),n.d(e,"b",(function(){return s})),n.d(e,"c",(function(){return u})),n.d(e,"d",(function(){return f})),n.d(e,"e",(function(){return p})),n.d(e,"f",(function(){return b})),n.d(e,"g",(function(){return w})),n.d(e,"h",(function(){return C})),n.d(e,"i",(function(){return m})),n.d(e,"j",(function(){return T})),n.d(e,"k",(function(){return v})),n.d(e,"l",(function(){return g})),n.d(e,"m",(function(){return c})),n.d(e,"n",(function(){return l})),n.d(e,"o",(function(){return h})),n.d(e,"p",(function(){return O})),n.d(e,"q",(function(){return d}));var r=n("mrSG"),i=n("ttJE"),o=0,a=function(t){return{create:function(e){return m(t,e)},dismiss:function(e,n,r){return v(document,e,n,t,r)},getTop:function(){return Object(r.b)(this,void 0,void 0,(function(){return Object(r.e)(this,(function(e){return[2,g(document,t)]}))}))}}},s=a("ion-alert"),u=a("ion-action-sheet"),c=a("ion-loading"),l=a("ion-modal"),h=a("ion-picker"),f=a("ion-popover"),d=a("ion-toast"),p=function(t){var e=document;y(e);var n=o++;t.overlayIndex=n,t.hasAttribute("id")||(t.id="ion-overlay-"+n)},m=function(t,e){return customElements.whenDefined(t).then((function(){var n=document,r=n.createElement(t);return r.classList.add("overlay-hidden"),Object.assign(r,e),_(n).appendChild(r),r.componentOnReady()}))},y=function(t){0===o&&(o=1,t.addEventListener("focusin",(function(e){var n=g(t);if(n&&n.backdropDismiss&&!k(n,e.target)){var r=n.querySelector("input,button");r&&r.focus()}})),t.addEventListener("ionBackButton",(function(e){var n=g(t);n&&n.backdropDismiss&&e.detail.register(100,(function(){return n.dismiss(void 0,x)}))})),t.addEventListener("keyup",(function(e){if("Escape"===e.key){var n=g(t);n&&n.backdropDismiss&&n.dismiss(void 0,x)}})))},v=function(t,e,n,r,i){var o=g(t,r,i);return o?o.dismiss(e,n):Promise.reject("overlay does not exist")},g=function(t,e,n){var r=function(t,e){return void 0===e&&(e="ion-alert,ion-action-sheet,ion-loading,ion-modal,ion-picker,ion-popover,ion-toast"),Array.from(t.querySelectorAll(e)).filter((function(t){return t.overlayIndex>0}))}(t,e);return void 0===n?r[r.length-1]:r.find((function(t){return t.id===n}))},b=function(t,e,n,o,a){return Object(r.b)(void 0,void 0,void 0,(function(){var s;return Object(r.e)(this,(function(r){switch(r.label){case 0:return t.presented?[2]:(t.presented=!0,t.willPresent.emit(),s=t.enterAnimation?t.enterAnimation:i.b.get(e,"ios"===t.mode?n:o),[4,S(t,s,t.el,a)]);case 1:return r.sent()&&t.didPresent.emit(),[2]}}))}))},w=function(t,e,n,o,a,s,u){return Object(r.b)(void 0,void 0,void 0,(function(){var c,l;return Object(r.e)(this,(function(r){switch(r.label){case 0:if(!t.presented)return[2,!1];t.presented=!1,r.label=1;case 1:return r.trys.push([1,3,,4]),t.willDismiss.emit({data:e,role:n}),c=t.leaveAnimation?t.leaveAnimation:i.b.get(o,"ios"===t.mode?a:s),[4,S(t,c,t.el,u)];case 2:return r.sent(),t.didDismiss.emit({data:e,role:n}),[3,4];case 3:return l=r.sent(),console.error(l),[3,4];case 4:return t.el.remove(),[2,!0]}}))}))},_=function(t){return t.querySelector("ion-app")||t.body},S=function(t,e,o,a){return Object(r.b)(void 0,void 0,void 0,(function(){var s,u,c,l,h;return Object(r.e)(this,(function(r){switch(r.label){case 0:if(t.animation)return t.animation.destroy(),t.animation=void 0,[2,!1];o.classList.remove("overlay-hidden"),s=o.shadowRoot||t.el,c=!0,r.label=1;case 1:return r.trys.push([1,4,,5]),[4,n.e(7).then(n.bind(null,"5QBn"))];case 2:return[4,r.sent().create(e,s,a)];case 3:return u=r.sent(),[3,5];case 4:return r.sent(),(u=e(s,a)).fill("both"),c=!1,[3,5];case 5:return t.animation=u,t.animated&&i.b.getBoolean("animated",!0)||u.duration(0),t.keyboardClose&&u.beforeAddWrite((function(){var t=o.ownerDocument.activeElement;t&&t.matches("input, ion-input, ion-textarea")&&t.blur()})),[4,u.playAsync()];case 6:return l=r.sent(),h=void 0===l||u.hasCompleted,c&&u.destroy(),t.animation=void 0,[2,h]}}))}))},C=function(t,e){var n,r=new Promise((function(t){return n=t}));return E(t,e,(function(t){n(t.detail)})),r},E=function(t,e,n){var r=function(i){t.removeEventListener(e,r),n(i)};t.addEventListener(e,r)},T=function(t){return"cancel"===t||t===x},k=function(t,e){for(;e;){if(e===t)return!0;e=e.parentElement}return!1},I=function(t){return t()},O=function(t,e){if("function"==typeof t)return i.b.get("_zoneGate",I)((function(){try{return t(e)}catch(n){console.error(n)}}))},x="backdrop"},CcnG:function(t,e,n){"use strict";n.d(e,"ib",(function(){return Kn})),n.d(e,"jb",(function(){return Gn})),n.d(e,"kb",(function(){return Qn})),n.d(e,"hb",(function(){return ke})),n.d(e,"g",(function(){return hn})),n.d(e,"R",(function(){return sn})),n.d(e,"y",(function(){return an})),n.d(e,"T",(function(){return Ft})),n.d(e,"X",(function(){return Lt})),n.d(e,"c",(function(){return Te})),n.d(e,"C",(function(){return Oe})),n.d(e,"B",(function(){return xe})),n.d(e,"b",(function(){return Ae})),n.d(e,"d",(function(){return Ce})),n.d(e,"e",(function(){return Ee})),n.d(e,"V",(function(){return On})),n.d(e,"L",(function(){return Ze})),n.d(e,"Z",(function(){return en})),n.d(e,"u",(function(){return $n})),n.d(e,"f",(function(){return Yn})),n.d(e,"m",(function(){return se})),n.d(e,"l",(function(){return we})),n.d(e,"F",(function(){return Dt})),n.d(e,"G",(function(){return Pt})),n.d(e,"a",(function(){return _})),n.d(e,"n",(function(){return ye})),n.d(e,"r",(function(){return me})),n.d(e,"P",(function(){return N})),n.d(e,"N",(function(){return Rt})),n.d(e,"M",(function(){return Nt})),n.d(e,"S",(function(){return d})),n.d(e,"U",(function(){return D})),n.d(e,"q",(function(){return tt})),n.d(e,"W",(function(){return B})),n.d(e,"p",(function(){return m})),n.d(e,"o",(function(){return j})),n.d(e,"A",(function(){return M})),n.d(e,"H",(function(){return F})),n.d(e,"z",(function(){return $e})),n.d(e,"D",(function(){return It})),n.d(e,"E",(function(){return Ot})),n.d(e,"i",(function(){return Ue})),n.d(e,"j",(function(){return bt})),n.d(e,"k",(function(){return Et})),n.d(e,"v",(function(){return Ct})),n.d(e,"x",(function(){return St})),n.d(e,"w",(function(){return de})),n.d(e,"I",(function(){return yn})),n.d(e,"J",(function(){return pn})),n.d(e,"K",(function(){return ue})),n.d(e,"O",(function(){return gn})),n.d(e,"h",(function(){return wn})),n.d(e,"s",(function(){return Vn})),n.d(e,"t",(function(){return qn})),n.d(e,"Q",(function(){return $})),n.d(e,"Y",(function(){return Hn})),n.d(e,"rb",(function(){return G})),n.d(e,"cb",(function(){return Pe})),n.d(e,"ab",(function(){return dt})),n.d(e,"bb",(function(){return wt})),n.d(e,"db",(function(){return oe})),n.d(e,"eb",(function(){return fe})),n.d(e,"fb",(function(){return Bt})),n.d(e,"qb",(function(){return E})),n.d(e,"ub",(function(){return x})),n.d(e,"Db",(function(){return A})),n.d(e,"sb",(function(){return Se})),n.d(e,"tb",(function(){return _e})),n.d(e,"gb",(function(){return Fr})),n.d(e,"lb",(function(){return ii})),n.d(e,"mb",(function(){return la})),n.d(e,"nb",(function(){return hr})),n.d(e,"ob",(function(){return Oi})),n.d(e,"pb",(function(){return Ur})),n.d(e,"vb",(function(){return Qr})),n.d(e,"wb",(function(){return Gr})),n.d(e,"xb",(function(){return Qi})),n.d(e,"yb",(function(){return mi})),n.d(e,"Bb",(function(){return xi})),n.d(e,"zb",(function(){return Xi})),n.d(e,"Ab",(function(){return Ji})),n.d(e,"Cb",(function(){return zi})),n.d(e,"Eb",(function(){return to})),n.d(e,"Fb",(function(){return ro}));var r=n("mrSG"),i=n("pugT"),o=n("K9Ia"),a=n("6blF"),s=n("p0ib"),u=n("S1nX");function c(t){for(var e in t)if(t[e]===c)return e;throw Error("Could not find renamed property on target object.")}function l(t,e){for(var n in e)e.hasOwnProperty(n)&&!t.hasOwnProperty(n)&&(t[n]=e[n])}var h=c({ngInjectableDef:c}),f=c({ngBaseDef:c});function d(t){return{providedIn:t.providedIn||null,factory:t.factory,value:void 0}}function p(t){return t&&t.hasOwnProperty(h)?t[h]:null}var m=function(){function t(t,e){this._desc=t,this.ngMetadataName="InjectionToken",this.ngInjectableDef=void 0!==e?d({providedIn:e.providedIn||"root",factory:e.factory}):void 0}return t.prototype.toString=function(){return"InjectionToken "+this._desc},t}(),y="__parameters__",v="__prop__metadata__";function g(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(t){var i=t.apply(void 0,Object(r.i)(e));for(var o in i)this[o]=i[o]}}}function b(t,e,n){var i=g(e);function o(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(this instanceof o)return i.apply(this,e),this;var a=new((t=o).bind.apply(t,Object(r.i)([void 0],e)));return s.annotation=a,s;function s(t,e,n){for(var r=t.hasOwnProperty(y)?t[y]:Object.defineProperty(t,y,{value:[]})[y];r.length<=n;)r.push(null);return(r[n]=r[n]||[]).push(a),t}}return n&&(o.prototype=Object.create(n.prototype)),o.prototype.ngMetadataName=t,o.annotationCls=o,o}function w(t,e,n,i){var o=g(e);function a(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(this instanceof a)return o.apply(this,e),this;var s=new((t=a).bind.apply(t,Object(r.i)([void 0],e)));function u(t,n){var o=t.constructor,a=o.hasOwnProperty(v)?o[v]:Object.defineProperty(o,v,{value:{}})[v];a[n]=a.hasOwnProperty(n)&&a[n]||[],a[n].unshift(s),i&&i.apply(void 0,Object(r.i)([t,n],e))}return u}return n&&(a.prototype=Object.create(n.prototype)),a.prototype.ngMetadataName=t,a.annotationCls=a,a}var _=new m("AnalyzeForEntryComponents"),S="undefined"!=typeof window&&window,C="undefined"!=typeof self&&"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self,E="undefined"!=typeof global&&global||S||C,T=Promise.resolve(0),k=null;function I(){if(!k){var t=E.Symbol;if(t&&t.iterator)k=t.iterator;else for(var e=Object.getOwnPropertyNames(Map.prototype),n=0;n<e.length;++n){var r=e[n];"entries"!==r&&"size"!==r&&Map.prototype[r]===Map.prototype.entries&&(k=r)}}return k}function O(t){"undefined"==typeof Zone?T.then((function(){t&&t.apply(null,null)})):Zone.current.scheduleMicroTask("scheduleMicrotask",t)}function x(t,e){return t===e||"number"==typeof t&&"number"==typeof e&&isNaN(t)&&isNaN(e)}function A(t){if("string"==typeof t)return t;if(t instanceof Array)return"["+t.map(A).join(", ")+"]";if(null==t)return""+t;if(t.overriddenName)return""+t.overriddenName;if(t.name)return""+t.name;var e=t.toString();if(null==e)return""+e;var n=e.indexOf("\n");return-1===n?e:e.substring(0,n)}var P=c({__forward_ref__:c});function D(t){return t.__forward_ref__=D,t.toString=function(){return A(this())},t}function R(t){var e=t;return"function"==typeof e&&e.hasOwnProperty(P)&&e.__forward_ref__===D?e():t}var N=function(t){return t[t.Emulated=0]="Emulated",t[t.Native=1]="Native",t[t.None=2]="None",t[t.ShadowDom=3]="ShadowDom",t}({}),j=b("Inject",(function(t){return{token:t}})),M=b("Optional"),L=b("Self"),F=b("SkipSelf"),U=function(t){return t[t.Default=0]="Default",t[t.Host=1]="Host",t[t.Self=2]="Self",t[t.SkipSelf=4]="SkipSelf",t[t.Optional=8]="Optional",t}({}),V=void 0;function q(t){var e=V;return V=t,e}function B(t,e){return void 0===e&&(e=U.Default),function(t,e){if(void 0===e&&(e=U.Default),void 0===V)throw new Error("inject() must be called from an injection context");return null===V?function(t,e,n){var r=p(t);if(r&&"root"==r.providedIn)return void 0===r.value?r.value=r.factory():r.value;if(n&U.Optional)return null;throw new Error("Injector: NOT_FOUND ["+A(t)+"]")}(t,0,e):V.get(t,e&U.Optional?null:void 0,e)}(t,e)}var W=/([A-Z])/g;function z(t){try{return null!=t?t.toString().slice(0,30):t}catch(e){return"[ERROR] Exception while trying to serialize the value"}}function H(t,e){var n=G(t),r=G(e);return n&&r?function(t,e,n){for(var r=t[I()](),i=e[I()]();;){var o=r.next(),a=i.next();if(o.done&&a.done)return!0;
vendor: 9,543 bytes, line 1
1if(o.done||a.done)return!1;if(!n(o.value,a.value))return!1}}(t,e,H):!(n||!t||"object"!=typeof t&&"function"!=typeof t||r||!e||"object"!=typeof e&&"function"!=typeof e)||x(t,e)}var $=function(){function t(t){this.wrapped=t}return t.wrap=function(e){return new t(e)},t.unwrap=function(e){return t.isWrapped(e)?e.wrapped:e},t.isWrapped=function(e){return e instanceof t},t}(),K=function(){function t(t,e,n){this.previousValue=t,this.currentValue=e,this.firstChange=n}return t.prototype.isFirstChange=function(){return this.firstChange},t}();function G(t){return!!Q(t)&&(Array.isArray(t)||!(t instanceof Map)&&I()in t)}function Q(t){return null!==t&&("function"==typeof t||"object"==typeof t)}function Y(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]}var X=new Object,J=new m("INJECTOR"),Z=function(){function t(){}return t.prototype.get=function(t,e){if(void 0===e&&(e=X),e===X)throw new Error("NullInjectorError: No provider for "+A(t)+"!");return e},t}(),tt=function(){function t(){}return t.create=function(t,e){return Array.isArray(t)?new ct(t,e):new ct(t.providers,t.parent,t.name||null)},t.THROW_IF_NOT_FOUND=X,t.NULL=new Z,t.ngInjectableDef=d({providedIn:"any",factory:function(){return B(J)}}),t.__NG_ELEMENT_ID__=function(){return et()},t}(),et=Y,nt=function(t){return t},rt=[],it=nt,ot=function(){return Array.prototype.slice.call(arguments)},at=c({provide:String,useValue:c}),st=tt.NULL,ut=/\n/gm,ct=function(){function t(t,e,n){void 0===e&&(e=st),void 0===n&&(n=null),this.parent=e,this.source=n;var r=this._records=new Map;r.set(tt,{token:tt,fn:nt,deps:rt,value:this,useNew:!1}),r.set(J,{token:J,fn:nt,deps:rt,value:this,useNew:!1}),function t(e,n){if(n)if((n=R(n))instanceof Array)for(var r=0;r<n.length;r++)t(e,n[r]);else{if("function"==typeof n)throw ft("Function/Class not supported",n);if(!n||"object"!=typeof n||!n.provide)throw ft("Unexpected provider",n);var i=R(n.provide),o=function(t){var e=function(t){var e=rt,n=t.deps;if(n&&n.length){e=[];for(var r=0;r<n.length;r++){var i=6;if((u=R(n[r]))instanceof Array)for(var o=0,a=u;o<a.length;o++){var s=a[o];s instanceof M||s==M?i|=1:s instanceof F||s==F?i&=-3:s instanceof L||s==L?i&=-5:u=s instanceof j?s.token:R(s)}e.push({token:u,options:i})}}else if(t.useExisting){var u=R(t.useExisting);e=[{token:u,options:6}]}else if(!n&&!(at in t))throw ft("'deps' required",t);return e}(t),n=nt,r=rt,i=!1,o=R(t.provide);if(at in t)r=t.useValue;else if(t.useFactory)n=t.useFactory;else if(t.useExisting);else if(t.useClass)i=!0,n=R(t.useClass);else{if("function"!=typeof o)throw ft("StaticProvider does not have [useValue|useFactory|useExisting|useClass] or [provide] is not newable",t);i=!0,n=o}return{deps:e,fn:n,useNew:i,value:r}}(n);if(!0===n.multi){var a=e.get(i);if(a){if(a.fn!==ot)throw lt(i)}else e.set(i,a={token:n.provide,deps:[],useNew:!1,fn:ot,value:rt});a.deps.push({token:i=n,options:6})}var s=e.get(i);if(s&&s.fn==ot)throw lt(i);e.set(i,o)}}(r,t)}return t.prototype.get=function(t,e,n){void 0===n&&(n=U.Default);var i=this._records.get(t);try{return function t(e,n,i,o,a,s){try{return function(e,n,i,o,a,s){var u,c;if(!n||s&U.SkipSelf)s&U.Self||(c=o.get(e,a,U.Default));else{if((c=n.value)==it)throw Error("\u0275Circular dependency");if(c===rt){n.value=it;var l=n.useNew,h=n.fn,f=n.deps,d=rt;if(f.length){d=[];for(var p=0;p<f.length;p++){var m=f[p],y=m.options,v=2&y?i.get(m.token):void 0;d.push(t(m.token,v,i,v||4&y?o:st,1&y?null:tt.THROW_IF_NOT_FOUND,U.Default))}}n.value=c=l?new((u=h).bind.apply(u,Object(r.i)([void 0],d))):h.apply(void 0,d)}}return c}(e,n,i,o,a,s)}catch(u){throw u instanceof Error||(u=new Error(u)),(u.ngTempTokenPath=u.ngTempTokenPath||[]).unshift(e),n&&n.value==it&&(n.value=rt),u}}(t,i,this._records,this.parent,e,n)}catch(a){var o=a.ngTempTokenPath;throw t.__source&&o.unshift(t.__source),a.message=ht("\n"+a.message,o,this.source),a.ngTokenPath=o,a.ngTempTokenPath=null,a}},t.prototype.toString=function(){var t=[];return this._records.forEach((function(e,n){return t.push(A(n))})),"StaticInjector["+t.join(", ")+"]"},t}();function lt(t){return ft("Cannot mix multi providers and regular providers",t)}function ht(t,e,n){void 0===n&&(n=null),t=t&&"\n"===t.charAt(0)&&"\u0275"==t.charAt(1)?t.substr(2):t;var r=A(e);if(e instanceof Array)r=e.map(A).join(" -> ");else if("object"==typeof e){var i=[];for(var o in e)if(e.hasOwnProperty(o)){var a=e[o];i.push(o+":"+("string"==typeof a?JSON.stringify(a):A(a)))}r="{"+i.join(", ")+"}"}return"StaticInjectorError"+(n?"("+n+")":"")+"["+r+"]: "+t.replace(ut,"\n  ")}function ft(t,e){return new Error(ht(t,e))}var dt=new m("The presence of this token marks an injector as being the root injector."),pt=function(){return function(){}}(),mt=function(){return function(){}}();function yt(t){var e=Error("No component factory found for "+A(t)+". Did you add it to @NgModule.entryComponents?");return e[vt]=t,e}var vt="ngComponent",gt=function(){function t(){}return t.prototype.resolveComponentFactory=function(t){throw yt(t)},t}(),bt=function(){function t(){}return t.NULL=new gt,t}(),wt=function(){function t(t,e,n){this._parent=e,this._ngModule=n,this._factories=new Map;for(var r=0;r<t.length;r++){var i=t[r];this._factories.set(i.componentType,i)}}return t.prototype.resolveComponentFactory=function(t){var e=this._factories.get(t);if(!e&&this._parent&&(e=this._parent.resolveComponentFactory(t)),!e)throw yt(t);return new _t(e,this._ngModule)},t}(),_t=function(t){function e(e,n){var r=t.call(this)||this;return r.factory=e,r.ngModule=n,r.selector=e.selector,r.componentType=e.componentType,r.ngContentSelectors=e.ngContentSelectors,r.inputs=e.inputs,r.outputs=e.outputs,r}return Object(r.d)(e,t),e.prototype.create=function(t,e,n,r){return this.factory.create(t,e,n,r||this.ngModule)},e}(mt),St=function(){return function(){}}(),Ct=function(){return function(){}}(),Et=function(){function t(t){this.nativeElement=t}return t.__NG_ELEMENT_ID__=function(){return Tt(t)},t}(),Tt=Y,kt=function(){return function(){}}(),It=function(){return function(){}}(),Ot=function(t){return t[t.Important=1]="Important",t[t.DashCase=2]="DashCase",t}({}),xt=function(){function t(){}return t.__NG_ELEMENT_ID__=function(){return At()},t}(),At=Y,Pt=function(t){return t[t.NONE=0]="NONE",t[t.HTML=1]="HTML",t[t.STYLE=2]="STYLE",t[t.SCRIPT=3]="SCRIPT",t[t.URL=4]="URL",t[t.RESOURCE_URL=5]="RESOURCE_URL",t}({}),Dt=function(){return function(){}}(),Rt=function(){return function(t){this.full=t,this.major=t.split(".")[0],this.minor=t.split(".")[1],this.patch=t.split(".").slice(2).join(".")}}(),Nt=new Rt("7.2.16"),jt=!0,Mt=!1;function Lt(){return Mt=!0,jt}function Ft(){if(Mt)throw new Error("Cannot enable prod mode after platform setup.");jt=!1}var Ut=function(){function t(t){if(this.defaultDoc=t,this.inertDocument=this.defaultDoc.implementation.createHTMLDocument("sanitization-inert"),this.inertBodyElement=this.inertDocument.body,null==this.inertBodyElement){var e=this.inertDocument.createElement("html");this.inertDocument.appendChild(e),this.inertBodyElement=this.inertDocument.createElement("body"),e.appendChild(this.inertBodyElement)}this.inertBodyElement.innerHTML='<svg><g onload="this.parentNode.remove()"></g></svg>',!this.inertBodyElement.querySelector||this.inertBodyElement.querySelector("svg")?(this.inertBodyElement.innerHTML='<svg><p><style><img src="</style><img src=x onerror=alert(1)//">',this.getInertBodyElement=this.inertBodyElement.querySelector&&this.inertBodyElement.querySelector("svg img")&&function(){try{return!!window.DOMParser}catch(t){return!1}}()?this.getInertBodyElement_DOMParser:this.getInertBodyElement_InertDocument):this.getInertBodyElement=this.getInertBodyElement_XHR}return t.prototype.getInertBodyElement_XHR=function(t){t="<body><remove></remove>"+t+"</body>";try{t=encodeURI(t)}catch(r){return null}var e=new XMLHttpRequest;e.responseType="document",e.open("GET","data:text/html;charset=utf-8,"+t,!1),e.send(void 0);var n=e.response.body;return n.removeChild(n.firstChild),n},t.prototype.getInertBodyElement_DOMParser=function(t){t="<body><remove></remove>"+t+"</body>";try{var e=(new window.DOMParser).parseFromString(t,"text/html").body;return e.removeChild(e.firstChild),e}catch(n){return null}},t.prototype.getInertBodyElement_InertDocument=function(t){var e=this.inertDocument.createElement("template");return"content"in e?(e.innerHTML=t,e):(this.inertBodyElement.innerHTML=t,this.defaultDoc.documentMode&&this.stripCustomNsAttrs(this.inertBodyElement),this.inertBodyElement)},t.prototype.stripCustomNsAttrs=function(t){for(var e=t.attributes,n=e.length-1;0<n;n--){var r=e.item(n).name;"xmlns:ns1"!==r&&0!==r.indexOf("ns1:")||t.removeAttribute(r)}for(var i=t.firstChild;i;)i.nodeType===Node.ELEMENT_NODE&&this.stripCustomNsAttrs(i),i=i.nextSibling},t}(),Vt=/^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi,qt=/^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 Bt(t){return(t=String(t)).match(Vt)||t.match(qt)?t:(Lt()&&console.warn("WARNING: sanitizing unsafe URL value "+t+" (see http://g.co/ng/security#xss)"),"unsafe:"+t)}function Wt(t){var e,n,i={};try{for(var o=Object(r.k)(t.split(",")),a=o.next();!a.done;a=o.next())i[a.value]=!0}catch(s){e={error:s}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}return i}function zt(){for(var t,e,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var o={};try{for(var a=Object(r.k)(n),s=a.next();!s.done;s=a.next()){var u=s.value;for(var c in u)u.hasOwnProperty(c)&&(o[c]=!0)}}
1catch(l){t={error:l}}finally{try{s&&!s.done&&(e=a.return)&&e.call(a)}finally{if(t)throw t.error}}return o}var Ht,$t=Wt("area,br,col,hr,img,wbr"),Kt=Wt("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),Gt=Wt("rp,rt"),Qt=zt(Gt,Kt),Yt=zt($t,zt(Kt,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")),zt(Gt,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")),Qt),Xt=Wt("background,cite,href,itemtype,longdesc,poster,src,xlink:href"),Jt=Wt("srcset"),Zt=zt(Xt,Jt,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")),te=Wt("script,style,template"),ee=function(){function t(){this.sanitizedSomething=!1,this.buf=[]}return t.prototype.sanitizeChildren=function(t){for(var e=t.firstChild,n=!0;e;)if(e.nodeType===Node.ELEMENT_NODE?n=this.startElement(e):e.nodeType===Node.TEXT_NODE?this.chars(e.nodeValue):this.sanitizedSomething=!0,n&&e.firstChild)e=e.firstChild;else for(;e;){e.nodeType===Node.ELEMENT_NODE&&this.endElement(e);var r=this.checkClobberedElement(e,e.nextSibling);if(r){e=r;break}e=this.checkClobberedElement(e,e.parentNode)}return this.buf.join("")},t.prototype.startElement=function(t){var e,n=t.nodeName.toLowerCase();if(!Yt.hasOwnProperty(n))return this.sanitizedSomething=!0,!te.hasOwnProperty(n);this.buf.push("<"),this.buf.push(n);for(var r=t.attributes,i=0;i<r.length;i++){var o=r.item(i),a=o.name,s=a.toLowerCase();if(Zt.hasOwnProperty(s)){var u=o.value;Xt[s]&&(u=Bt(u)),Jt[s]&&(e=u,u=(e=String(e)).split(",").map((function(t){return Bt(t.trim())})).join(", ")),this.buf.push(" ",a,'="',ie(u),'"')}else this.sanitizedSomething=!0}return this.buf.push(">"),!0},t.prototype.endElement=function(t){var e=t.nodeName.toLowerCase();Yt.hasOwnProperty(e)&&!$t.hasOwnProperty(e)&&(this.buf.push("</"),this.buf.push(e),this.buf.push(">"))},t.prototype.chars=function(t){this.buf.push(ie(t))},t.prototype.checkClobberedElement=function(t,e){if(e&&(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_CONTAINED_BY)===Node.DOCUMENT_POSITION_CONTAINED_BY)throw new Error("Failed to sanitize html because the element is clobbered: "+t.outerHTML);return e},t}(),ne=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,re=/([^\#-~ |!])/g;function ie(t){return t.replace(/&/g,"&amp;").replace(ne,(function(t){return"&#"+(1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320)+65536)+";"})).replace(re,(function(t){return"&#"+t.charCodeAt(0)+";"})).replace(/</g,"&lt;").replace(/>/g,"&gt;")}function oe(t,e){var n=null;try{Ht=Ht||new Ut(t);var r=e?String(e):"";n=Ht.getInertBodyElement(r);var i=5,o=r;do{if(0===i)throw new Error("Failed to sanitize html because the input is unstable");i--,r=o,o=n.innerHTML,n=Ht.getInertBodyElement(r)}while(r!==o);var a=new ee,s=a.sanitizeChildren(ae(n)||n);return Lt()&&a.sanitizedSomething&&console.warn("WARNING: sanitizing HTML stripped some content, see http://g.co/ng/security#xss"),s}finally{if(n)for(var u=ae(n)||n;u.firstChild;)u.removeChild(u.firstChild)}}function ae(t){return"content"in t&&function(t){return t.nodeType===Node.ELEMENT_NODE&&"TEMPLATE"===t.nodeName}(t)?t.content:null}var se=function(t){function e(e){void 0===e&&(e=!1);var n=t.call(this)||this;return n.__isAsync=e,n}return Object(r.d)(e,t),e.prototype.emit=function(e){t.prototype.next.call(this,e)},e.prototype.subscribe=function(e,n,r){var o,a=function(t){return null},s=function(){return null};e&&"object"==typeof e?(o=this.__isAsync?function(t){setTimeout((function(){return e.next(t)}))}:function(t){e.next(t)},e.error&&(a=this.__isAsync?function(t){setTimeout((function(){return e.error(t)}))}:function(t){e.error(t)}),e.complete&&(s=this.__isAsync?function(){setTimeout((function(){return e.complete()}
1))}:function(){e.complete()})):(o=this.__isAsync?function(t){setTimeout((function(){return e(t)}))}:function(t){e(t)},n&&(a=this.__isAsync?function(t){setTimeout((function(){return n(t)}))}:function(t){n(t)}),r&&(s=this.__isAsync?function(){setTimeout((function(){return r()}))}:function(){r()}));var u=t.prototype.subscribe.call(this,o,a,s);return e instanceof i.a&&e.add(u),u},e}(o.a),ue=function(){function t(){}return t.__NG_ELEMENT_ID__=function(){return ce(t,Et)},t}(),ce=Y,le=new RegExp("^([-,.\"'%_!# a-zA-Z0-9]+|(?:(?:matrix|translate|scale|rotate|skew|perspective)(?:X|Y|3d)?|(?:rgb|hsl)a?|(?:repeating-)?(?:linear|radial)-gradient|(?:calc|attr))\\([-0-9.%, #a-zA-Z]+\\))$","g"),he=/^url\(([^)]+)\)$/;function fe(t){if(!(t=String(t).trim()))return"";var e=t.match(he);return e&&Bt(e[1])===e[1]||t.match(le)&&function(t){for(var e=!0,n=!0,r=0;r<t.length;r++){var i=t.charAt(r);"'"===i&&n?e=!e:'"'===i&&e&&(n=!n)}return e&&n}(t)?t:(Lt()&&console.warn("WARNING: sanitizing unsafe style value "+t+" (see http://g.co/ng/security#xss)."),"unsafe")}var de=function(){return function(){}}(),pe=function(t){var e=t.constructor,n=e.ngBaseDef,r=e.ngBaseDef={inputs:{},outputs:{},declaredInputs:{}};n&&(l(r.inputs,n.inputs),l(r.outputs,n.outputs),l(r.declaredInputs,n.declaredInputs))},me=w("Input",(function(t){return{bindingPropertyName:t}}),void 0,function(t){return function(e,n){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];var o=e.constructor;o.hasOwnProperty(f)||pe(e);var a=o.ngBaseDef,s=t(a);s[n]=r[0]}}((function(t){return t.inputs||{}}))),ye=w("HostBinding",(function(t){return{hostPropertyName:t}}));function ve(t){return t.ngDebugContext}function ge(t){return t.ngOriginalError}function be(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];t.error.apply(t,Object(r.i)(e))}var we=function(){function t(){this._console=console}return t.prototype.handleError=function(t){var e=this._findOriginalError(t),n=this._findContext(t),r=function(t){return t.ngErrorLogger||be}(t);r(this._console,"ERROR",t),e&&r(this._console,"ORIGINAL ERROR",e),n&&r(this._console,"ERROR CONTEXT",n)},t.prototype._findContext=function(t){return t?ve(t)?ve(t):this._findContext(ge(t)):null},t.prototype._findOriginalError=function(t){for(var e=ge(t);e&&ge(e);)e=ge(e);return e},t}();function _e(t){return!!t&&"function"==typeof t.then}function Se(t){return!!t&&"function"==typeof t.subscribe}var Ce=new m("Application Initializer"),Ee=function(){function t(t){var e=this;this.appInits=t,this.initialized=!1,this.done=!1,this.donePromise=new Promise((function(t,n){e.resolve=t,e.reject=n}))}return t.prototype.runInitializers=function(){var t=this;if(!this.initialized){var e=[],n=function(){t.done=!0,t.resolve()};if(this.appInits)for(var r=0;r<this.appInits.length;r++){var i=this.appInits[r]();_e(i)&&e.push(i)}Promise.all(e).then((function(){n()})).catch((function(e){t.reject(e)})),0===e.length&&n(),this.initialized=!0}},t}(),Te=new m("AppId");function ke(){return""+Ie()+Ie()+Ie()}function Ie(){return String.fromCharCode(97+Math.floor(25*Math.random()))}var Oe=new m("Platform Initializer"),xe=new m("Platform ID"),Ae=new m("appBootstrapListener"),Pe=function(){function t(){}return t.prototype.log=function(t){console.log(t)},t.prototype.warn=function(t){console.warn(t)},t}();function De(){throw new Error("Runtime compiler is not loaded")}var Re,Ne,je=De,Me=De,Le=De,Fe=De,Ue=function(){function t(){this.compileModuleSync=je,this.compileModuleAsync=Me,this.compileModuleAndAllComponentsSync=Le,this.compileModuleAndAllComponentsAsync=Fe}return t.prototype.clearCache=function(){},t.prototype.clearCacheFor=function(t){},t.prototype.getModuleId=function(t){},t}(),Ve=function(){return function(){}}();function qe(){var t=E.wtf;return!(!t||!(Re=t.trace)||(Ne=Re.events,0))}var Be=qe();function We(t,e){return null}var ze=Be?function(t,e){return void 0===e&&(e=null),Ne.createScope(t,e)}:function(t,e){return We},He=Be?function(t,e){return Re.leaveScope(t,e),e}:function(t,e){return e},$e=function(){function t(t){var e,n=t.enableLongStackTrace,r=void 0!==n&&n;if(this.hasPendingMicrotasks=!1,this.hasPendingMacrotasks=!1,this.isStable=!0,this.onUnstable=new se(!1),this.onMicrotaskEmpty=new se(!1),this.onStable=new se(!1),this.onError=ne
1w se(!1),"undefined"==typeof Zone)throw new Error("In this configuration Angular requires Zone.js");Zone.assertZonePatched(),this._nesting=0,this._outer=this._inner=Zone.current,Zone.wtfZoneSpec&&(this._inner=this._inner.fork(Zone.wtfZoneSpec)),Zone.TaskTrackingZoneSpec&&(this._inner=this._inner.fork(new Zone.TaskTrackingZoneSpec)),r&&Zone.longStackTraceZoneSpec&&(this._inner=this._inner.fork(Zone.longStackTraceZoneSpec)),(e=this)._inner=e._inner.fork({name:"angular",properties:{isAngularZone:!0},onInvokeTask:function(t,n,r,i,o,a){try{return Ye(e),t.invokeTask(r,i,o,a)}finally{Xe(e)}},onInvoke:function(t,n,r,i,o,a,s){try{return Ye(e),t.invoke(r,i,o,a,s)}finally{Xe(e)}},onHasTask:function(t,n,r,i){t.hasTask(r,i),n===r&&("microTask"==i.change?(e.hasPendingMicrotasks=i.microTask,Qe(e)):"macroTask"==i.change&&(e.hasPendingMacrotasks=i.macroTask))},onHandleError:function(t,n,r,i){return t.handleError(r,i),e.runOutsideAngular((function(){return e.onError.emit(i)})),!1}})}return t.isInAngularZone=function(){return!0===Zone.current.get("isAngularZone")},t.assertInAngularZone=function(){if(!t.isInAngularZone())throw new Error("Expected to be in Angular Zone, but it is not!")},t.assertNotInAngularZone=function(){if(t.isInAngularZone())throw new Error("Expected to not be in Angular Zone, but it is!")},t.prototype.run=function(t,e,n){return this._inner.run(t,e,n)},t.prototype.runTask=function(t,e,n,r){var i=this._inner,o=i.scheduleEventTask("NgZoneEvent: "+r,t,Ge,Ke,Ke);try{return i.runTask(o,e,n)}finally{i.cancelTask(o)}},t.prototype.runGuarded=function(t,e,n){return this._inner.runGuarded(t,e,n)},t.prototype.runOutsideAngular=function(t){return this._outer.run(t)},t}();function Ke(){}var Ge={};function Qe(t){if(0==t._nesting&&!t.hasPendingMicrotasks&&!t.isStable)try{t._nesting++,t.onMicrotaskEmpty.emit(null)}finally{if(t._nesting--,!t.hasPendingMicrotasks)try{t.runOutsideAngular((function(){return t.onStable.emit(null)}))}finally{t.isStable=!0}}}function Ye(t){t._nesting++,t.isStable&&(t.isStable=!1,t.onUnstable.emit(null))}function Xe(t){t._nesting--,Qe(t)}var Je=function(){function t(){this.hasPendingMicrotasks=!1,this.hasPendingMacrotasks=!1,this.isStable=!0,this.onUnstable=new se,this.onMicrotaskEmpty=new se,this.onStable=new se,this.onError=new se}return t.prototype.run=function(t){return t()},t.prototype.runGuarded=function(t){return t()},t.prototype.runOutsideAngular=function(t){return t()},t.prototype.runTask=function(t){return t()},t}(),Ze=function(){function t(t){var e=this;this._ngZone=t,this._pendingCount=0,this._isZoneStable=!0,this._didWork=!1,this._callbacks=[],this.taskTrackingZone=null,this._watchAngularEvents(),t.run((function(){e.taskTrackingZone="undefined"==typeof Zone?null:Zone.current.get("TaskTrackingZone")}))}return t.prototype._watchAngularEvents=function(){var t=this;this._ngZone.onUnstable.subscribe({next:function(){t._didWork=!0,t._isZoneStable=!1}}),this._ngZone.runOutsideAngular((function(){t._ngZone.onStable.subscribe({next:function(){$e.assertNotInAngularZone(),O((function(){t._isZoneStable=!0,t._runCallbacksIfReady()}))}})}))},t.prototype.increasePendingRequestCount=function(){return this._pendingCount+=1,this._didWork=!0,this._pendingCount},t.prototype.decreasePendingRequestCount=function(){if(this._pendingCount-=1,this._pendingCount<0)throw new Error("pending async requests below zero");return this._runCallbacksIfReady(),this._pendingCount},t.prototype.isStable=function(){return this._isZoneStable&&0===this._pendingCount&&!this._ngZone.hasPendingMacrotasks},t.prototype._runCallbacksIfReady=function(){var t=this;if(this.isStable())O((function(){for(;0!==t._callbacks.length;){var e=t._callbacks.pop();clearTimeout(e.timeoutId),e.doneCb(t._didWork)}t._didWork=!1}));else{var e=this.getPendingTasks();this._callbacks=this._callbacks.filter((function(t){return!t.updateCb||!t.updateCb(e)||(clearTimeout(t.timeoutId),!1)})),this._didWork=!0}},t.prototype.getPendingTasks=function(){return this.taskTrackingZone?this.taskTrackingZone.macroTasks.map((function(t){return{source:t.source,creationLocation:t.creationLocation,data:t.data}})):[]},t.prototype.addCallback=function(t,e,n){var r=this,i=-1;e&&e>0&&(i=setTimeout((function(){r._callbacks=r._callbacks.filter((function(t){return t.timeoutId!==i})),t(r._didWork,r.getPendingTasks())}
1),e)),this._callbacks.push({doneCb:t,timeoutId:i,updateCb:n})},t.prototype.whenStable=function(t,e,n){if(n&&!this.taskTrackingZone)throw new Error('Task tracking zone is required when passing an update callback to whenStable(). Is "zone.js/dist/task-tracking.js" loaded?');this.addCallback(t,e,n),this._runCallbacksIfReady()},t.prototype.getPendingRequestCount=function(){return this._pendingCount},t.prototype.findProviders=function(t,e,n){return[]},t}(),tn=function(){function t(){this._applications=new Map,rn.addToWindow(this)}return t.prototype.registerApplication=function(t,e){this._applications.set(t,e)},t.prototype.unregisterApplication=function(t){this._applications.delete(t)},t.prototype.unregisterAllApplications=function(){this._applications.clear()},t.prototype.getTestability=function(t){return this._applications.get(t)||null},t.prototype.getAllTestabilities=function(){return Array.from(this._applications.values())},t.prototype.getAllRootElements=function(){return Array.from(this._applications.keys())},t.prototype.findTestabilityInTree=function(t,e){return void 0===e&&(e=!0),rn.findTestabilityInTree(this,t,e)},Object(r.c)([Object(r.f)("design:paramtypes",[])],t)}();function en(t){rn=t}var nn,rn=new(function(){function t(){}return t.prototype.addToWindow=function(t){},t.prototype.findTestabilityInTree=function(t,e,n){return null},t}()),on=new m("AllowMultipleToken"),an=function(){return function(t,e){this.name=t,this.token=e}}();function sn(t,e,n){void 0===n&&(n=[]);var r="Platform: "+e,i=new m(r);return function(e){void 0===e&&(e=[]);var o=un();if(!o||o.injector.get(on,!1))if(t)t(n.concat(e).concat({provide:i,useValue:!0}));else{var a=n.concat(e).concat({provide:i,useValue:!0});!function(t){if(nn&&!nn.destroyed&&!nn.injector.get(on,!1))throw new Error("There can be only one platform. Destroy the previous one to create a new one.");nn=t.get(cn);var e=t.get(Oe,null);e&&e.forEach((function(t){return t()}))}(tt.create({providers:a,name:r}))}return function(t){var e=un();if(!e)throw new Error("No platform exists!");if(!e.injector.get(t,null))throw new Error("A platform with a different configuration has been created. Please destroy it first.");return e}(i)}}function un(){return nn&&!nn.destroyed?nn:null}var cn=function(){function t(t){this._injector=t,this._modules=[],this._destroyListeners=[],this._destroyed=!1}return t.prototype.bootstrapModuleFactory=function(t,e){var n,r=this,i="noop"===(n=e?e.ngZone:void 0)?new Je:("zone.js"===n?void 0:n)||new $e({enableLongStackTrace:Lt()}),o=[{provide:$e,useValue:i}];return i.run((function(){var e=tt.create({providers:o,parent:r.injector,name:t.moduleType.name}),n=t.create(e),a=n.injector.get(we,null);if(!a)throw new Error("No ErrorHandler. Is platform module (BrowserModule) included?");return n.onDestroy((function(){return fn(r._modules,n)})),i.runOutsideAngular((function(){return i.onError.subscribe({next:function(t){a.handleError(t)}})})),function(t,e,i){try{var o=((a=n.injector.get(Ee)).runInitializers(),a.donePromise.then((function(){return r._moduleDoBootstrap(n),n})));return _e(o)?o.catch((function(n){throw e.runOutsideAngular((function(){return t.handleError(n)})),n})):o}catch(s){throw e.runOutsideAngular((function(){return t.handleError(s)})),s}var a}(a,i)}))},t.prototype.bootstrapModule=function(t,e){var n=this;void 0===e&&(e=[]);var r=ln({},e);return function(t,e,n){return t.get(Ve).createCompiler([e]).compileModuleAsync(n)}(this.injector,r,t).then((function(t){return n.bootstrapModuleFactory(t,r)}))},t.prototype._moduleDoBootstrap=function(t){var e=t.injector.get(hn);if(t._bootstrapComponents.length>0)t._bootstrapComponents.forEach((function(t){return e.bootstrap(t)}));else{if(!t.instance.ngDoBootstrap)throw new Error("The module "+A(t.instance.constructor)+' was bootstrapped, but it does not declare "@NgModule.bootstrap" components nor a "ngDoBootstrap" method. Please define one of these.');t.instance.ngDoBootstrap(e)}this._modules.push(t)},t.prototype.onDestroy=function(t){this._destroyListeners.push(t)},Object.defineProperty(t.prototype,"injector",{get:function(){return this._injector},enumerable:!0,configurable:!0}),t.prototype.destroy=function(){if(this._destroyed)throw new Error("The platform has already been destroyed!");
1this._modules.slice().forEach((function(t){return t.destroy()})),this._destroyListeners.forEach((function(t){return t()})),this._destroyed=!0},Object.defineProperty(t.prototype,"destroyed",{get:function(){return this._destroyed},enumerable:!0,configurable:!0}),t}();function ln(t,e){return Array.isArray(e)?e.reduce(ln,t):Object(r.a)({},t,e)}var hn=function(){function t(t,e,n,r,i,o){var c=this;this._zone=t,this._console=e,this._injector=n,this._exceptionHandler=r,this._componentFactoryResolver=i,this._initStatus=o,this._bootstrapListeners=[],this._views=[],this._runningTick=!1,this._enforceNoNewChanges=!1,this._stable=!0,this.componentTypes=[],this.components=[],this._enforceNoNewChanges=Lt(),this._zone.onMicrotaskEmpty.subscribe({next:function(){c._zone.run((function(){c.tick()}))}});var l=new a.a((function(t){c._stable=c._zone.isStable&&!c._zone.hasPendingMacrotasks&&!c._zone.hasPendingMicrotasks,c._zone.runOutsideAngular((function(){t.next(c._stable),t.complete()}))})),h=new a.a((function(t){var e;c._zone.runOutsideAngular((function(){e=c._zone.onStable.subscribe((function(){$e.assertNotInAngularZone(),O((function(){c._stable||c._zone.hasPendingMacrotasks||c._zone.hasPendingMicrotasks||(c._stable=!0,t.next(!0))}))}))}));var n=c._zone.onUnstable.subscribe((function(){$e.assertInAngularZone(),c._stable&&(c._stable=!1,c._zone.runOutsideAngular((function(){t.next(!1)})))}));return function(){e.unsubscribe(),n.unsubscribe()}}));this.isStable=Object(s.a)(l,h.pipe(Object(u.a)()))}var e;return e=t,t.prototype.bootstrap=function(t,e){var n,r=this;if(!this._initStatus.done)throw new Error("Cannot bootstrap as there are still asynchronous initializers running. Bootstrap components in the `ngDoBootstrap` method of the root module.");n=t instanceof mt?t:this._componentFactoryResolver.resolveComponentFactory(t),this.componentTypes.push(n.componentType);var i=n instanceof _t?null:this._injector.get(St),o=n.create(tt.NULL,[],e||n.selector,i);o.onDestroy((function(){r._unloadComponent(o)}));var a=o.injector.get(Ze,null);return a&&o.injector.get(tn).registerApplication(o.location.nativeElement,a),this._loadComponent(o),Lt()&&this._console.log("Angular is running in the development mode. Call enableProdMode() to enable the production mode."),o},t.prototype.tick=function(){var t=this;if(this._runningTick)throw new Error("ApplicationRef.tick is called recursively");var n=e._tickScope();try{this._runningTick=!0,this._views.forEach((function(t){return t.detectChanges()})),this._enforceNoNewChanges&&this._views.forEach((function(t){return t.checkNoChanges()}))}catch(r){this._zone.runOutsideAngular((function(){return t._exceptionHandler.handleError(r)}))}finally{this._runningTick=!1,He(n)}},t.prototype.attachView=function(t){var e=t;this._views.push(e),e.attachToAppRef(this)},t.prototype.detachView=function(t){var e=t;fn(this._views,e),e.detachFromAppRef()},t.prototype._loadComponent=function(t){this.attachView(t.hostView),this.tick(),this.components.push(t),this._injector.get(Ae,[]).concat(this._bootstrapListeners).forEach((function(e){return e(t)}))},t.prototype._unloadComponent=function(t){this.detachView(t.hostView),fn(this.components,t)},t.prototype.ngOnDestroy=function(){this._views.slice().forEach((function(t){return t.destroy()}))},Object.defineProperty(t.prototype,"viewCount",{get:function(){return this._views.length},enumerable:!0,configurable:!0}),t._tickScope=ze("ApplicationRef#tick()"),t}();function fn(t,e){var n=t.indexOf(e);n>-1&&t.splice(n,1)}var dn=function(){function t(){this.dirty=!0,this._results=[],this.changes=new se,this.length=0}return t.prototype.map=function(t){return this._results.map(t)},t.prototype.filter=function(t){return this._results.filter(t)},t.prototype.find=function(t){return this._results.find(t)},t.prototype.reduce=function(t,e){return this._results.reduce(t,e)},t.prototype.forEach=function(t){this._results.forEach(t)},t.prototype.some=function(t){return this._results.some(t)},t.prototype.toArray=function(){return this._results.slice()},t.prototype[I()]=function(){return this._results[I()]()},t.prototype.toString=function(){return this._results.toString()},t.prototype.reset=function(t){this._results=function t(e){return e.reduce((function(e,n){var r=Array.isArray(n)?t(n):n;return e.concat(r)}),[])}(t),this.dirty=!1,this.length=this._results.length,this.last=this._results[this.length-1],this.first=this._results[0]},t.prototype.notifyOnChanges=function(){this.changes.emit(this)},t.prototype.setDirty=function(){this.dirty=!0},t.prototype.destroy=function(){this.changes.complete(),this.changes.unsubscribe()},t}(),pn=function(){return function(){}}(),mn={factoryPathPrefix:"",factoryPathSuffix:".ngfactory"},yn=function(){function t(t,e){this._compiler=t,this._config=e||mn}return t.prototype.load=function(t){return this._compiler instanceof Ue?this.loadFactory(t):this.loadAndCompile(t)},t.prototype.loadAndCompile=function(t){var e=this,i=Object(r.h)(t.split("#"),2),o=i[0],a=i[1];return void 0===a&&(a="default"),n("crnd")(o).then((function(t){return t[a]})).then((function(t){return vn(t,o,a)})).then((function(t){return e._compiler.compileModuleAsync(t)}))},t.prototype.loadFactory=function(t){var e=Object(r.h)(t.split("#"),2),i=e[0],o=e[1],a="NgFactory";return void 0===o&&(o="default",a=""),n("crnd")(this._config.factoryPathPrefix+i+this._config.factoryPathSuffix).then((function(t){return t[o+a]})).then((function(t){return vn(t,i,o)}))},t}();function vn(t,e,n){if(!t)throw new Error("Cannot find '"+n+"' in '"+e+"'");return t}var gn=function(){function t(){}return t.__NG_ELEMENT_ID__=function(){return bn(t,Et)},t}(),bn=Y,wn=function(){function t(){}return t.__NG_ELEMENT_ID__=function(){return _n()},t}(),_n=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]},Sn=function(){return function(t,e){this.name=t,this.callback=e}}(),Cn=function(){function t(t,e,n){this.listeners=[],this.parent=null,this._debugContext=n,this.nativeNode=t,e&&e instanceof En&&e.addChild(this)}return Object.defineProperty(t.prototype,"injector",{get:function(){return this._debugContext.
vendor: 56,335 bytes, line 1
1injector},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"componentInstance",{get:function(){return this._debugContext.component},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"context",{get:function(){return this._debugContext.context},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"references",{get:function(){return this._debugContext.references},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"providerTokens",{get:function(){return this._debugContext.providerTokens},enumerable:!0,configurable:!0}),t}(),En=function(t){function e(e,n,r){var i=t.call(this,e,n,r)||this;return i.properties={},i.attributes={},i.classes={},i.styles={},i.childNodes=[],i.nativeElement=e,i}return Object(r.d)(e,t),e.prototype.addChild=function(t){t&&(this.childNodes.push(t),t.parent=this)},e.prototype.removeChild=function(t){var e=this.childNodes.indexOf(t);-1!==e&&(t.parent=null,this.childNodes.splice(e,1))},e.prototype.insertChildrenAfter=function(t,e){var n,i=this,o=this.childNodes.indexOf(t);-1!==o&&((n=this.childNodes).splice.apply(n,Object(r.i)([o+1,0],e)),e.forEach((function(e){e.parent&&e.parent.removeChild(e),t.parent=i})))},e.prototype.insertBefore=function(t,e){var n=this.childNodes.indexOf(t);-1===n?this.addChild(e):(e.parent&&e.parent.removeChild(e),e.parent=this,this.childNodes.splice(n,0,e))},e.prototype.query=function(t){return this.queryAll(t)[0]||null},e.prototype.queryAll=function(t){var e=[];return Tn(this,t,e),e},e.prototype.queryAllNodes=function(t){var e=[];return kn(this,t,e),e},Object.defineProperty(e.prototype,"children",{get:function(){return this.childNodes.filter((function(t){return t instanceof e}))},enumerable:!0,configurable:!0}),e.prototype.triggerEventHandler=function(t,e){this.listeners.forEach((function(n){n.name==t&&n.callback(e)}))},e}(Cn);function Tn(t,e,n){t.childNodes.forEach((function(t){t instanceof En&&(e(t)&&n.push(t),Tn(t,e,n))}))}function kn(t,e,n){t instanceof En&&t.childNodes.forEach((function(t){e(t)&&n.push(t),t instanceof En&&kn(t,e,n)}))}var In=new Map,On=function(t){return In.get(t)||null};function xn(t){In.set(t.nativeNode,t)}var An=function(){function t(){}return t.prototype.supports=function(t){return G(t)},t.prototype.create=function(t){return new Dn(t)},t}(),Pn=function(t,e){return e},Dn=function(){function t(t){this.length=0,this._linkedRecords=null,this._unlinkedRecords=null,this._previousItHead=null,this._itHead=null,this._itTail=null,this._additionsHead=null,this._additionsTail=null,this._movesHead=null,this._movesTail=null,this._removalsHead=null,this._removalsTail=null,this._identityChangesHead=null,this._identityChangesTail=null,this._trackByFn=t||Pn}return t.prototype.forEachItem=function(t){var e;for(e=this._itHead;null!==e;e=e._next)t(e)},t.prototype.forEachOperation=function(t){for(var e=this._itHead,n=this._removalsHead,r=0,i=null;e||n;){var o=!n||e&&e.currentIndex<Mn(n,r,i)?e:n,a=Mn(o,r,i),s=o.currentIndex;if(o===n)r--,n=n._nextRemoved;else if(e=e._next,null==o.previousIndex)r++;else{i||(i=[]);var u=a-r,c=s-r;if(u!=c){for(var l=0;l<u;l++){var h=l<i.length?i[l]:i[l]=0,f=h+l;c<=f&&f<u&&(i[l]=h+1)}i[o.previousIndex]=c-u}}a!==s&&t(o,a,s)}},t.prototype.forEachPreviousItem=function(t){var e;for(e=this._previousItHead;null!==e;e=e._nextPrevious)t(e)},t.prototype.forEachAddedItem=function(t){var e;for(e=this._additionsHead;null!==e;e=e._nextAdded)t(e)},t.prototype.forEachMovedItem=function(t){var e;for(e=this._movesHead;null!==e;e=e._nextMoved)t(e)},t.prototype.forEachRemovedItem=function(t){var e;for(e=this._removalsHead;null!==e;e=e._nextRemoved)t(e)},t.prototype.forEachIdentityChange=function(t){var e;for(e=this._identityChangesHead;null!==e;e=e._nextIdentityChange)t(e)},t.prototype.diff=function(t){if(null==t&&(t=[]),!G(t))throw new Error("Error trying to diff '"+A(t)+"'. Only arrays and iterables are allowed");return this.check(t)?this:null},t.prototype.onDestroy=function(){},t.prototype.check=function(t){var e=this;this._reset();var n,r,i,o=this._itHead,a=!1;if(Array.isArray(t)){this.length=t.length;for(var s=0;s<this.length;s++)i=this._trackByFn(s,r=t[s]),null!==o&&x(o.trackById,i)?(a&&(o=this._verifyReinsertion(o,r,i,s)),x(o.item,r)||this._addIdentityChange(o,r)):(o=this._mismatch(o,r,i,s),a=!0),o=o._next}else n=0,function(t,e){if(Array.isArray(t))for(var n=0;n<t.length;n++)e(t[n]);else for(var r=t[I()](),i=void 0;!(i=r.next()).done;)e(i.value)}(t,(function(t){i=e._trackByFn(n,t),null!==o&&x(o.trackById,i)?(a&&(o=e._verifyReinsertion(o,t,i,n)),x(o.item,t)||e._addIdentityChange(o,t)):(o=e._mismatch(o,t,i,n),a=!0),o=o._next,n++})),this.length=n;return this._truncate(o),this.collection=t,this.isDirty},Object.defineProperty(t.prototype,"isDirty",{get:function(){return null!==this._additionsHead||null!==this._movesHead||null!==this._removalsHead||null!==this._identityChangesHead},enumerable:!0,configurable:!0}),t.prototype._reset=function(){if(this.isDirty){var t=void 0,e=void 0;for(t=this._previousItHead=this._itHead;null!==t;t=t._next)t._nextPrevious=t._next;for(t=this._additionsHead;null!==t;t=t._nextAdded)t.previousIndex=t.currentIndex;for(this._additionsHead=this._additionsTail=null,t=this._movesHead;null!==t;t=e)t.previousIndex=t.currentIndex,e=t._nextMoved;this._movesHead=this._movesTail=null,this._removalsHead=this._removalsTail=null,this._identityChangesHead=this._identityChangesTail=null}},t.prototype._mismatch=function(t,e,n,r){var i;return null===t?i=this._itTail:(i=t._prev,this._remove(t)),null!==(t=null===this._linkedRecords?null:this._linkedRecords.get(n,r))?(x(t.item,e)||this._addIdentityChange(t,e),this._moveAfter(t,i,r)):null!==(t=null===this._unlinkedRecords?null:this._unlinkedRecords.get(n,null))?(x(t.item,e)||this._addIdentityChange(t,e),this._reinsertAfter(t,i,r)):t=this._addAfter(new Rn(e,n),i,r),t},t.prototype._verifyReinsertion=function(t,e,n,r){var i=null===this._unlinkedRecords?null:this._unlinkedRecords.get(n,null);return null!==i?t=this._reinsertAfter(i,t._prev,r):t.currentIndex!=r&&(t.currentIndex=r,this._addToMoves(t,r)),t},t.prototype._truncate=function(t){for(;null!==t;){var e=t._next;this._addToRemovals(this._unlink(t)),t=e}null!==this._unlinkedRecords&&this._unlinkedRecords.clear(),null!==this._additionsTail&&(this._additionsTail._nextAdded=null),null!==this._movesTail&&(this._movesTail._nextMoved=null),null!==this._itTail&&(this._itTail._next=null),null!==this._removalsTail&&(this._removalsTail._nextRemoved=null),null!==this._identityChangesTail&&(this._identityChangesTail._nextIdentityChange=null)},t.prototype._reinsertAfter=function(t,e,n){null!==this._unlinkedRecords&&this._unlinkedRecords.remove(t);var r=t._prevRemoved,i=t._nextRemoved;return null===r?this._removalsHead=i:r._nextRemoved=i,null===i?this._removalsTail=r:i._prevRemoved=r,this._insertAfter(t,e,n),this._addToMoves(t,n),t},t.prototype._moveAfter=function(t,e,n){return this._unlink(t),this._insertAfter(t,e,n),this._addToMoves(t,n),t},t.prototype._addAfter=function(t,e,n){return this._insertAfter(t,e,n),this._additionsTail=null===this._additionsTail?this._additionsHead=t:this._additionsTail._nextAdded=t,t},t.prototype._insertAfter=function(t,e,n){var r=null===e?this._itHead:e._next;return t._next=r,t._prev=e,null===r?this._itTail=t:r._prev=t,null===e?this._itHead=t:e._next=t,null===this._linkedRecords&&(this._linkedRecords=new jn),this._linkedRecords.put(t),t.currentIndex=n,t},t.prototype._remove=function(t){return this._addToRemovals(this._unlink(t))},t.prototype._unlink=function(t){null!==this._linkedRecords&&this._linkedRecords.remove(t);var e=t._prev,n=t._next;return null===e?this._itHead=n:e._next=n,null===n?this._itTail=e:n._prev=e,t},t.prototype._addToMoves=function(t,e){return t.previousIndex===e||(this._movesTail=null===this._movesTail?this._movesHead=t:this._movesTail._nextMoved=t),t},t.prototype._addToRemovals=function(t){return null===this._unlinkedRecords&&(this._unlinkedRecords=new jn),this._unlinkedRecords.put(t),t.currentIndex=null,t._nextRemoved=null,null===this._removalsTail?(this._removalsTail=this._removalsHead=t,t._prevRemoved=null):(t._prevRemoved=this._removalsTail,this._removalsTail=this._removalsTail._nextRemoved=t),t},t.prototype._addIdentityChange=function(t,e){return t.item=e,this._identityChangesTail=null===this._identityChangesTail?this._identityChangesHead=t:this._identityChangesTail._nextIdentityChange=t,t},t}(),Rn=function(){return function(t,e){this.item=t,this.trackById=e,this.currentIndex=null,this.previousIndex=null,this._nextPrevious=null,this._prev=null,this._next=null,this._prevDup=null,this._nextDup=null,this._prevRemoved=null,this._nextRemoved=null,this._nextAdded=null,this._nextMoved=null,this._nextIdentityChange=null}}(),Nn=function(){function t(){this._head=null,this._tail=null}return t.prototype.add=function(t){null===this._head?(this._head=this._tail=t,t._nextDup=null,t._prevDup=null):(this._tail._nextDup=t,t._prevDup=this._tail,t._nextDup=null,this._tail=t)},t.prototype.get=function(t,e){var n;for(n=this._head;null!==n;n=n._nextDup)if((null===e||e<=n.currentIndex)&&x(n.trackById,t))return n;return null},t.prototype.remove=function(t){var e=t._prevDup,n=t._nextDup;return null===e?this._head=n:e._nextDup=n,null===n?this._tail=e:n._prevDup=e,null===this._head},t}(),jn=function(){function t(){this.map=new Map}return t.prototype.put=function(t){var e=t.trackById,n=this.map.get(e);n||(n=new Nn,this.map.set(e,n)),n.add(t)},t.prototype.get=function(t,e){var n=this.map.get(t);return n?n.get(t,e):null},t.prototype.remove=function(t){var e=t.trackById;return this.map.get(e).remove(t)&&this.map.delete(e),t},Object.defineProperty(t.prototype,"isEmpty",{get:function(){return 0===this.map.size},enumerable:!0,configurable:!0}),t.prototype.clear=function(){this.map.clear()},t}();function Mn(t,e,n){var r=t.previousIndex;if(null===r)return r;var i=0;return n&&r<n.length&&(i=n[r]),r+e+i}var Ln=function(){function t(){}return t.prototype.supports=function(t){return t instanceof Map||Q(t)},t.prototype.create=function(){return new Fn},t}(),Fn=function(){function t(){this._records=new Map,this._mapHead=null,this._appendAfter=null,this._previousMapHead=null,this._changesHead=null,this._changesTail=null,this._additionsHead=null,this._additionsTail=null,this._removalsHead=null,this._removalsTail=null}return Object.defineProperty(t.prototype,"isDirty",{get:function(){return null!==this._additionsHead||null!==this._changesHead||null!==this._removalsHead},enumerable:!0,configurable:!0}),t.prototype.forEachItem=function(t){var e;for(e=this._mapHead;null!==e;e=e._next)t(e)},t.prototype.forEachPreviousItem=function(t){var e;for(e=this._previousMapHead;null!==e;e=e._nextPrevious)t(e)},t.prototype.forEachChangedItem=function(t){var e;for(e=this._changesHead;null!==e;e=e._nextChanged)t(e)},t.prototype.forEachAddedItem=function(t){var e;for(e=this._additionsHead;null!==e;e=e._nextAdded)t(e)},t.prototype.forEachRemovedItem=function(t){var e;for(e=this._removalsHead;null!==e;e=e._nextRemoved)t(e)},t.prototype.diff=function(t){if(t){if(!(t instanceof Map||Q(t)))throw new Error("Error trying to diff '"+A(t)+"'. Only maps and objects are allowed")}else t=new Map;return this.check(t)?this:null},t.prototype.onDestroy=function(){},t.prototype.check=function(t){var e=this;this._reset();var n=this._mapHead;if(this._appendAfter=null,this._forEach(t,(function(t,r){if(n&&n.key===r)e._maybeAddToChanges(n,t),e._appendAfter=n,n=n._next;else{var i=e._getOrCreateRecordForKey(r,t);n=e._insertBeforeOrAppend(n,i)}})),n){n._prev&&(n._prev._next=null),this._removalsHead=n;for(var r=n;null!==r;r=r._nextRemoved)r===this._mapHead&&(this._mapHead=null),this._records.delete(r.key),r._nextRemoved=r._next,r.previousValue=r.currentValue,r.currentValue=null,r._prev=null,r._next=null}return this._changesTail&&(this._changesTail._nextChanged=null),this._additionsTail&&(this._additionsTail._nextAdded=null),this.isDirty},t.prototype._insertBeforeOrAppend=function(t,e){if(t){var n=t._prev;return e._next=t,e._prev=n,t._prev=e,n&&(n._next=e),t===this._mapHead&&(this._mapHead=e),this._appendAfter=t,t}return this._appendAfter?(this._appendAfter._next=e,e._prev=this._appendAfter):this._mapHead=e,this._appendAfter=e,null},t.prototype._getOrCreateRecordForKey=function(t,e){if(this._records.has(t)){var n=this._records.get(t);this._maybeAddToChanges(n,e);var r=n._prev,i=n._next;return r&&(r._next=i),i&&(i._prev=r),n._next=null,n._prev=null,n}var o=new Un(t);return this._records.set(t,o),o.currentValue=e,this._addToAdditions(o),o},t.prototype._reset=function(){if(this.isDirty){var t=void 0;for(this._previousMapHead=this._mapHead,t=this._previousMapHead;null!==t;t=t._next)t._nextPrevious=t._next;for(t=this._changesHead;null!==t;t=t._nextChanged)t.previousValue=t.currentValue;for(t=this._additionsHead;null!=t;t=t._nextAdded)t.previousValue=t.currentValue;this._changesHead=this._changesTail=null,this._additionsHead=this._additionsTail=null,this._removalsHead=null}},t.prototype._maybeAddToChanges=function(t,e){x(e,t.currentValue)||(t.previousValue=t.currentValue,t.currentValue=e,this._addToChanges(t))},t.prototype._addToAdditions=function(t){null===this._additionsHead?this._additionsHead=this._additionsTail=t:(this._additionsTail._nextAdded=t,this._additionsTail=t)},t.prototype._addToChanges=function(t){null===this._changesHead?this._changesHead=this._changesTail=t:(this._changesTail._nextChanged=t,this._changesTail=t)},t.prototype._forEach=function(t,e){t instanceof Map?t.forEach(e):Object.keys(t).forEach((function(n){return e(t[n],n)}))},t}(),Un=function(){return function(t){this.key=t,this.previousValue=null,this.currentValue=null,this._nextPrevious=null,this._next=null,this._prev=null,this._nextAdded=null,this._nextRemoved=null,this._nextChanged=null}}(),Vn=function(){function t(t){this.factories=t}return t.create=function(e,n){if(null!=n){var r=n.factories.slice();e=e.concat(r)}return new t(e)},t.extend=function(e){return{provide:t,useFactory:function(n){if(!n)throw new Error("Cannot extend IterableDiffers without a parent injector");return t.create(e,n)},deps:[[t,new F,new M]]}},t.prototype.find=function(t){var e,n=this.factories.find((function(e){return e.supports(t)}));if(null!=n)return n;throw new Error("Cannot find a differ supporting object '"+t+"' of type '"+((e=t).name||typeof e)+"'")},t.ngInjectableDef=d({providedIn:"root",factory:function(){return new t([new An])}}),t}(),qn=function(){function t(t){this.factories=t}return t.create=function(e,n){if(n){var r=n.factories.slice();e=e.concat(r)}return new t(e)},t.extend=function(e){return{provide:t,useFactory:function(n){if(!n)throw new Error("Cannot extend KeyValueDiffers without a parent injector");return t.create(e,n)},deps:[[t,new F,new M]]}},t.prototype.find=function(t){var e=this.factories.find((function(e){return e.supports(t)}));if(e)return e;throw new Error("Cannot find a differ supporting object '"+t+"'")},t.ngInjectableDef=d({providedIn:"root",factory:function(){return new t([new Ln])}}),t}(),Bn=[new Ln],Wn=new Vn([new An]),zn=new qn(Bn),Hn=sn(null,"core",[{provide:xe,useValue:"unknown"},{provide:cn,deps:[tt]},{provide:tn,deps:[]},{provide:Pe,deps:[]}]),$n=new m("LocaleId");function Kn(){return Wn}function Gn(){return zn}function Qn(t){return t||"en-US"}var Yn=function(){return function(t){}}();function Xn(t,e,n){var r=t.state,i=1792&r;return i===e?(t.state=-1793&r|n,t.initIndex=-1,!0):i===n}function Jn(t,e,n){return(1792&t.state)===e&&t.initIndex<=n&&(t.initIndex=n+1,!0)}function Zn(t,e){return t.nodes[e]}function tr(t,e){return t.nodes[e]}function er(t,e){return t.nodes[e]}function nr(t,e){return t.nodes[e]}function rr(t,e){return t.nodes[e]}var ir={setCurrentNode:void 0,createRootView:void 0,createEmbeddedView:void 0,createComponentView:void 0,createNgModuleRef:void 0,overrideProvider:void 0,overrideComponentView:void 0,clearOverrides:void 0,checkAndUpdateView:void 0,checkNoChangesView:void 0,destroyView:void 0,resolveDep:void 0,createDebugContext:void 0,handleEvent:void 0,updateDirectives:void 0,updateRenderer:void 0,dirtyParentQueries:void 0};function or(t,e,n,r){var i="ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: '"+e+"'. Current value: '"+n+"'.";return r&&(i+=" It seems like the view has been created after its parent and its children have been dirty checked. Has it been created in a change detection hook ?"),function(t,e){var n=new Error(t);return ar(n,e),n}(i,t)}function ar(t,e){t.ngDebugContext=e,t.ngErrorLogger=e.logError.bind(e)}function sr(t){return new Error("ViewDestroyedError: Attempt to use a destroyed view: "+t)}var ur=function(){},cr=new Map;function lr(t){var e=cr.get(t);return e||(e=A(t)+"_"+cr.size,cr.set(t,e)),e}function hr(t){return{id:"$$undefined",styles:t.styles,encapsulation:t.encapsulation,data:t.data}}var fr=0;function dr(t,e,n,r){return!(!(2&t.state)&&x(t.oldValues[e.bindingIndex+n],r))}function pr(t,e,n,r){return!!dr(t,e,n,r)&&(t.oldValues[e.bindingIndex+n]=r,!0)}function mr(t,e,n,r){var i=t.oldValues[e.bindingIndex+n];if(1&t.state||!H(i,r)){var o=e.bindings[n].name;throw or(ir.createDebugContext(t,e.nodeIndex),o+": "+i,o+": "+r,0!=(1&t.state))}}function yr(t){for(var e=t;e;)2&e.def.flags&&(e.state|=8),e=e.viewContainerParent||e.parent}function vr(t,e){for(var n=t;n&&n!==e;)n.state|=64,n=n.viewContainerParent||n.parent}function gr(t,e,n,r){try{return yr(33554432&t.def.nodes[e].flags?tr(t,e).componentView:t),ir.handleEvent(t,e,n,r)}catch(i){t.root.errorHandler.handleError(i)}}function br(t){return t.parent?tr(t.parent,t.parentNodeDef.nodeIndex):null}function wr(t){return t.parent?t.parentNodeDef.parent:null}function _r(t,e){switch(201347067&e.flags){case 1:return tr(t,e.nodeIndex).renderElement;case 2:return Zn(t,e.nodeIndex).renderText}}function Sr(t){return!!t.parent&&!!(32768&t.parentNodeDef.flags)}function Cr(t){return!(!t.parent||32768&t.parentNodeDef.flags)}function Er(t){return 1<<t%32}function Tr(t){var e={},n=0,i={};return t&&t.forEach((function(t){var o=Object(r.h)(t,2),a=o[0],s=o[1];"number"==typeof a?(e[a]=s,n|=Er(a)):i[a]=s})),{matchedQueries:e,references:i,matchedQueryIds:n}}function kr(t,e){return t.map((function(t){var n,i,o;return Array.isArray(t)?(o=(n=Object(r.h)(t,2))[0],i=n[1]):(o=0,i=t),i&&("function"==typeof i||"object"==typeof i)&&e&&Object.defineProperty(i,"__source",{value:e,configurable:!0}),{flags:o,token:i,tokenKey:lr(i)}}))}function Ir(t,e,n){var r=n.renderParent;return r?0==(1&r.flags)||0==(33554432&r.flags)||r.element.componentRendererType&&r.element.componentRendererType.encapsulation===N.Native?tr(t,n.renderParent.nodeIndex).renderElement:void 0:e}var Or=new WeakMap;function xr(t){var e=Or.get(t);return e||((e=t((function(){return ur}))).factory=t,Or.set(t,e)),e}function Ar(t,e,n,r,i){3===e&&(n=t.renderer.parentNode(_r(t,t.def.lastRenderRootNode))),Pr(t,e,0,t.def.nodes.length-1,n,r,i)}function Pr(t,e,n,r,i,o,a){for(var s=n;s<=r;s++){var u=t.def.nodes[s];11&u.flags&&Rr(t,u,e,i,o,a),s+=u.childCount}}function Dr(t,e,n,r,i,o){for(var a=t;a&&!Sr(a);)a=a.parent;for(var s=a.parent,u=wr(a),c=u.nodeIndex+u.childCount,l=u.nodeIndex+1;l<=c;l++){var h=s.def.nodes[l];h.ngContentIndex===e&&Rr(s,h,n,r,i,o),l+=h.childCount}if(!s.parent){var f=t.root.projectableNodes[e];if(f)for(l=0;l<f.length;l++)Nr(t,f[l],n,r,i,o)}}function Rr(t,e,n,r,i,o){if(8&e.flags)Dr(t,e.ngContent.index,n,r,i,o);else{var a=_r(t,e);if(3===n&&33554432&e.flags&&48&e.bindingFlags?(16&e.bindingFlags&&Nr(t,a,n,r,i,o),32&e.bindingFlags&&Nr(tr(t,e.nodeIndex).componentView,a,n,r,i,o)):Nr(t,a,n,r,i,o),16777216&e.flags)for(var s=tr(t,e.nodeIndex).viewContainer._embeddedViews,u=0;u<s.length;u++)Ar(s[u],n,r,i,o);1&e.flags&&!e.element.name&&Pr(t,n,e.nodeIndex+1,e.nodeIndex+e.childCount,r,i,o)}}function Nr(t,e,n,r,i,o){var a=t.renderer;switch(n){case 1:a.appendChild(r,e);break;case 2:a.insertBefore(r,e,i);break;case 3:a.removeChild(r,e);break;case 0:o.push(e)}}var jr=/^:([^:]+):(.+)$/;function Mr(t){if(":"===t[0]){var e=t.match(jr);return[e[1],e[2]]}return["",t]}function Lr(t){for(var e=0,n=0;n<t.length;n++)e|=t[n].flags;return e}function Fr(t,e,n,r,i,o){t|=1;var a=Tr(e);return{nodeIndex:-1,parent:null,renderParent:null,bindingIndex:-1,outputIndex:-1,flags:t,checkIndex:-1,childFlags:0,directChildFlags:0,childMatchedQueries:0,matchedQueries:a.matchedQueries,matchedQueryIds:a.matchedQueryIds,references:a.references,ngContentIndex:n,childCount:r,bindings:[],bindingFlags:0,outputs:[],element:{ns:null,name:null,attrs:null,template:o?xr(o):null,componentProvider:null,componentView:null,componentRendererType:null,publicProviders:null,allProviders:null,handleEvent:i||ur},provider:null,text:null,query:null,ngContent:null}}function Ur(t,e,n,i,o,a,s,u,c,l,h,f){var d;void 0===s&&(s=[]),l||(l=ur);var p=Tr(n),m=p.matchedQueries,y=p.references,v=p.matchedQueryIds,g=null,b=null;a&&(g=(d=Object(r.h)(Mr(a),2))[0],b=d[1]),u=u||[];for(var w=new Array(u.length),_=0;_<u.length;_++){var S=Object(r.h)(u[_],3),C=S[0],E=S[1],T=S[2],k=Object(r.h)(Mr(E),2),I=k[0],O=k[1],x=void 0,A=void 0;switch(15&C){case 4:A=T;break;case 1:case 8:x=T}w[_]={flags:C,ns:I,name:O,nonMinifiedName:O,securityContext:x,suffix:A}}c=c||[];var P=new Array(c.length);for(_=0;_<c.length;_++){var D=Object(r.h)(c[_],2);P[_]={type:0,target:D[0],eventName:D[1],propName:null}}var R=(s=s||[]).map((function(t){var e=Object(r.h)(t,2),n=e[0],i=e[1],o=Object(r.h)(Mr(n),2);return[o[0],o[1],i]}));return f=function(t){if(t&&"$$undefined"===t.id){var e=null!=t.encapsulation&&t.encapsulation!==N.None||t.styles.length||Object.keys(t.data).length;t.id=e?"c"+fr++:"$$empty"}return t&&"$$empty"===t.id&&(t=null),t||null}(f),h&&(e|=33554432),{nodeIndex:-1,parent:null,renderParent:null,bindingIndex:-1,outputIndex:-1,checkIndex:t,flags:e|=1,childFlags:0,directChildFlags:0,childMatchedQueries:0,matchedQueries:m,matchedQueryIds:v,references:y,ngContentIndex:i,childCount:o,bindings:w,bindingFlags:Lr(w),outputs:P,element:{ns:g,name:b,attrs:R,template:null,componentProvider:null,componentView:h||null,componentRendererType:f,publicProviders:null,allProviders:null,handleEvent:l||ur},provider:null,text:null,query:null,ngContent:null}}function Vr(t,e,n){var i,o=n.element,a=t.root.selectorOrNode,s=t.renderer;if(t.parent||!a){i=o.name?s.createElement(o.name,o.ns):s.createComment("");var u=Ir(t,e,n);u&&s.appendChild(u,i)}else i=s.selectRootElement(a,!!o.componentRendererType&&o.componentRendererType.encapsulation===N.ShadowDom);if(o.attrs)for(var c=0;c<o.attrs.length;c++){var l=Object(r.h)(o.attrs[c],3);s.setAttribute(i,l[1],l[2],l[0])}return i}function qr(t,e,n,r){for(var i=0;i<n.outputs.length;i++){var o=n.outputs[i],a=Br(t,n.nodeIndex,(h=o.eventName,(l=o.target)?l+":"+h:h)),s=o.target,u=t;"component"===o.target&&(s=null,u=e);var c=u.renderer.listen(s||r,o.eventName,a);t.disposables[n.outputIndex+i]=c}var l,h}function Br(t,e,n){return function(r){return gr(t,e,n,r)}}function Wr(t,e,n,r){if(!pr(t,e,n,r))return!1;var i=e.bindings[n],o=tr(t,e.nodeIndex),a=o.renderElement,s=i.name;switch(15&i.flags){case 1:!function(t,e,n,r,i,o){var a=e.securityContext,s=a?t.root.sanitizer.sanitize(a,o):o;s=null!=s?s.toString():null;var u=t.renderer;null!=o?u.setAttribute(n,i,s,r):u.removeAttribute(n,i,r)}(t,i,a,i.ns,s,r);break;case 2:!function(t,e,n,r){var i=t.renderer;r?i.addClass(e,n):i.removeClass(e,n)}(t,a,s,r);break;case 4:!function(t,e,n,r,i){var o=t.root.sanitizer.sanitize(Pt.STYLE,i);if(null!=o){o=o.toString();var a=e.suffix;null!=a&&(o+=a)}else o=null;var s=t.renderer;null!=o?s.setStyle(n,r,o):s.removeStyle(n,r)}(t,i,a,s,r);break;case 8:!function(t,e,n,r,i){var o=e.securityContext,a=o?t.root.sanitizer.sanitize(o,i):i;t.renderer.setProperty(n,r,a)}(33554432&e.flags&&32&i.flags?o.componentView:t,i,a,s,r)}return!0}var zr=new Object,Hr=lr(tt),$r=lr(J),Kr=lr(St);function Gr(t,e,n,r){return n=R(n),{index:-1,deps:kr(r,A(e)),flags:t,token:e,value:n}}function Qr(t){for(var e={},n=[],r=!1,i=0;i<t.length;i++){var o=t[i];o.token===dt&&!0===o.value&&(r=!0),1073741824&o.flags&&n.push(o.token),o.index=i,e[lr(o.token)]=o}return{factory:null,providersByKey:e,providers:t,modules:n,isRoot:r}}function Yr(t,e,n){void 0===n&&(n=tt.THROW_IF_NOT_FOUND);var r,i,o=q(t);try{if(8&e.flags)return e.token;if(2&e.flags&&(n=null),1&e.flags)return t._parent.get(e.token,n);var a=e.tokenKey;switch(a){case Hr:case $r:case Kr:return t}var s,u=t._def.providersByKey[a];if(u){var c=t._providers[u.index];return void 0===c&&(c=t._providers[u.index]=Xr(t,u)),c===zr?void 0:c}if((s=p(e.token))&&(r=t,null!=(i=s).providedIn&&(function(t,e){return t._def.modules.indexOf(e)>-1}(r,i.providedIn)||"root"===i.providedIn&&r._def.isRoot))){var l=t._providers.length;return t._def.providersByKey[e.tokenKey]={flags:5120,value:s.factory,deps:[],index:l,token:e.token},t._providers[l]=zr,t._providers[l]=Xr(t,t._def.providersByKey[e.tokenKey])}return 4&e.flags?n:t._parent.get(e.token,n)}finally{q(o)}}function Xr(t,e){var n;switch(201347067&e.flags){case 512:n=function(t,e,n){var i=n.length;switch(i){case 0:return new e;case 1:return new e(Yr(t,n[0]));case 2:return new e(Yr(t,n[0]),Yr(t,n[1]));case 3:return new e(Yr(t,n[0]),Yr(t,n[1]),Yr(t,n[2]));default:for(var o=new Array(i),a=0;a<i;a++)o[a]=Yr(t,n[a]);return new(e.bind.apply(e,Object(r.i)([void 0],o)))}}(t,e.value,e.deps);break;case 1024:n=function(t,e,n){var i=n.length;switch(i){case 0:return e();case 1:return e(Yr(t,n[0]));case 2:return e(Yr(t,n[0]),Yr(t,n[1]));case 3:return e(Yr(t,n[0]),Yr(t,n[1]),Yr(t,n[2]));default:for(var o=Array(i),a=0;a<i;a++)o[a]=Yr(t,n[a]);return e.apply(void 0,Object(r.i)(o))}}(t,e.value,e.deps);break;case 2048:n=Yr(t,e.deps[0]);break;case 256:n=e.value}return n===zr||null==n||"object"!=typeof n||131072&e.flags||"function"!=typeof n.ngOnDestroy||(e.flags|=131072),void 0===n?zr:n}function Jr(t,e){var n=t.viewContainer._embeddedViews;if((null==e||e>=n.length)&&(e=n.length-1),e<0)return null;var r=n[e];return r.viewContainerParent=null,ni(n,e),ir.dirtyParentQueries(r),ti(r),r}function Zr(t,e,n){var r=e?_r(e,e.def.lastRenderRootNode):t.renderElement,i=n.renderer.parentNode(r),o=n.renderer.nextSibling(r);Ar(n,2,i,o,void 0)}function ti(t){Ar(t,3,null,null,void 0)}function ei(t,e,n){e>=t.length?t.push(n):t.splice(e,0,n)}function ni(t,e){e>=t.length-1?t.pop():t.splice(e,1)}var ri=new Object;function ii(t,e,n,r,i,o){return new oi(t,e,n,r,i,o)}var oi=function(t){function e(e,n,r,i,o,a){var s=t.call(this)||this;return s.selector=e,s.componentType=n,s._inputs=i,s._outputs=o,s.ngContentSelectors=a,s.viewDefFactory=r,s}return Object(r.d)(e,t),Object.defineProperty(e.prototype,"inputs",{get:function(){var t=[],e=this._inputs;for(var n in e)t.push({propName:n,templateName:e[n]});return t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"outputs",{get:function(){var t=[];for(var e in this._outputs)t.push({propName:e,templateName:this._outputs[e]});return t},enumerable:!0,configurable:!0}),e.prototype.create=function(t,e,n,r){if(!r)throw new Error("ngModule should be provided");var i=xr(this.viewDefFactory),o=i.nodes[0].element.componentProvider.nodeIndex,a=ir.createRootView(t,e||[],n,i,r,ri),s=er(a,o).instance;return n&&a.renderer.setAttribute(tr(a,0).renderElement,"ng-version",Nt.full),new ai(a,new li(a),s)},e}(mt),ai=function(t){function e(e,n,r){var i=t.call(this)||this;return i._view=e,i._viewRef=n,i._component=r,i._elDef=i._view.def.nodes[0],i.hostView=n,i.changeDetectorRef=n,i.instance=r,i}return Object(r.d)(e,t),Object.defineProperty(e.prototype,"location",{get:function(){return new Et(tr(this._view,this._elDef.nodeIndex).renderElement)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"injector",{get:function(){return new pi(this._view,this._elDef)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"componentType",{get:function(){return this._component.constructor},enumerable:!0,configurable:!0}),e.prototype.destroy=function(){this._viewRef.destroy()},e.prototype.onDestroy=function(t){this._viewRef.onDestroy(t)},e}(pt);function si(t,e,n){return new ui(t,e,n)}var ui=function(){function t(t,e,n){this._view=t,this._elDef=e,this._data=n,this._embeddedViews=[]}return Object.defineProperty(t.prototype,"element",{get:function(){return new Et(this._data.renderElement)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"injector",{get:function(){return new pi(this._view,this._elDef)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"parentInjector",{get:function(){for(var t=this._view,e=this._elDef.parent;!e&&t;)e=wr(t),t=t.parent;return t?new pi(t,e):new pi(this._view,null)},enumerable:!0,configurable:!0}),t.prototype.clear=function(){for(var t=this._embeddedViews.length-1;t>=0;t--){var e=Jr(this._data,t);ir.destroyView(e)}},t.prototype.get=function(t){var e=this._embeddedViews[t];if(e){var n=new li(e);return n.attachToViewContainerRef(this),n}return null},Object.defineProperty(t.prototype,"length",{get:function(){return this._embeddedViews.length},enumerable:!0,configurable:!0}),t.prototype.createEmbeddedView=function(t,e,n){var r=t.createEmbeddedView(e||{});return this.insert(r,n),r},t.prototype.createComponent=function(t,e,n,r,i){var o=n||this.parentInjector;i||t instanceof _t||(i=o.get(St));var a=t.create(o,r,void 0,i);return this.insert(a.hostView,e),a},t.prototype.insert=function(t,e){if(t.destroyed)throw new Error("Cannot insert a destroyed View in a ViewContainer!");var n,r,i,o,a=t;return o=(n=this._data).viewContainer._embeddedViews,null==(r=e)&&(r=o.length),(i=a._view).viewContainerParent=this._view,ei(o,r,i),function(t,e){var n=br(e);if(n&&n!==t&&!(16&e.state)){e.state|=16;var r=n.template._projectedViews;r||(r=n.template._projectedViews=[]),r.push(e),function(t,e){if(!(4&e.flags)){t.nodeFlags|=4,e.flags|=4;for(var n=e.parent;n;)n.childFlags|=4,n=n.parent}}(e.parent.def,e.parentNodeDef)}}(n,i),ir.dirtyParentQueries(i),Zr(n,r>0?o[r-1]:null,i),a.attachToViewContainerRef(this),t},t.prototype.move=function(t,e){if(t.destroyed)throw new Error("Cannot move a destroyed View in a ViewContainer!");var n,r,i,o,a,s=this._embeddedViews.indexOf(t._view);return i=e,a=(o=(n=this._data).viewContainer._embeddedViews)[r=s],ni(o,r),null==i&&(i=o.length),ei(o,i,a),ir.dirtyParentQueries(a),ti(a),Zr(n,i>0?o[i-1]:null,a),t},t.prototype.indexOf=function(t){return this._embeddedViews.indexOf(t._view)},t.prototype.remove=function(t){var e=Jr(this._data,t);e&&ir.destroyView(e)},t.prototype.detach=function(t){var e=Jr(this._data,t);return e?new li(e):null},t}();function ci(t){return new li(t)}var li=function(){function t(t){this._view=t,this._viewContainerRef=null,this._appRef=null}return Object.defineProperty(t.prototype,"rootNodes",{get:function(){return Ar(this._view,0,void 0,void 0,t=[]),t;var t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"context",{get:function(){return this._view.context},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"destroyed",{get:function(){return 0!=(128&this._view.state)},enumerable:!0,configurable:!0}),t.prototype.markForCheck=function(){yr(this._view)},t.prototype.detach=function(){this._view.state&=-5},t.prototype.detectChanges=function(){var t=this._view.root.rendererFactory;t.begin&&t.begin();try{ir.checkAndUpdateView(this._view)}finally{t.end&&t.end()}},t.prototype.checkNoChanges=function(){ir.checkNoChangesView(this._view)},t.prototype.reattach=function(){this._view.state|=4},t.prototype.onDestroy=function(t){this._view.disposables||(this._view.disposables=[]),this._view.disposables.push(t)},t.prototype.destroy=function(){this._appRef?this._appRef.detachView(this):this._viewContainerRef&&this._viewContainerRef.detach(this._viewContainerRef.indexOf(this)),ir.destroyView(this._view)},t.prototype.detachFromAppRef=function(){this._appRef=null,ti(this._view),ir.dirtyParentQueries(this._view)},t.prototype.attachToAppRef=function(t){if(this._viewContainerRef)throw new Error("This view is already attached to a ViewContainer!");this._appRef=t},t.prototype.attachToViewContainerRef=function(t){if(this._appRef)throw new Error("This view is already attached directly to the ApplicationRef!");this._viewContainerRef=t},t}();function hi(t,e){return new fi(t,e)}var fi=function(t){function e(e,n){var r=t.call(this)||this;return r._parentView=e,r._def=n,r}return Object(r.d)(e,t),e.prototype.createEmbeddedView=function(t){return new li(ir.createEmbeddedView(this._parentView,this._def,this._def.element.template,t))},Object.defineProperty(e.prototype,"elementRef",{get:function(){return new Et(tr(this._parentView,this._def.nodeIndex).renderElement)},enumerable:!0,configurable:!0}),e}(ue);function di(t,e){return new pi(t,e)}var pi=function(){function t(t,e){this.view=t,this.elDef=e}return t.prototype.get=function(t,e){return void 0===e&&(e=tt.THROW_IF_NOT_FOUND),ir.resolveDep(this.view,this.elDef,!!this.elDef&&0!=(33554432&this.elDef.flags),{flags:0,token:t,tokenKey:lr(t)},e)},t}();function mi(t,e){var n=t.def.nodes[e];if(1&n.flags){var r=tr(t,n.nodeIndex);return n.element.template?r.template:r.renderElement}if(2&n.flags)return Zn(t,n.nodeIndex).renderText;if(20240&n.flags)return er(t,n.nodeIndex).instance;throw new Error("Illegal state: read nodeValue for node index "+e)}function yi(t){return new vi(t.renderer)}var vi=function(){function t(t){this.delegate=t}return t.prototype.selectRootElement=function(t){return this.delegate.selectRootElement(t)},t.prototype.createElement=function(t,e){var n=Object(r.h)(Mr(e),2),i=this.delegate.createElement(n[1],n[0]);return t&&this.delegate.appendChild(t,i),i},t.prototype.createViewRoot=function(t){return t},t.prototype.createTemplateAnchor=function(t){var e=this.delegate.createComment("");return t&&this.delegate.appendChild(t,e),e},t.prototype.createText=function(t,e){var n=this.delegate.createText(e);return t&&this.delegate.appendChild(t,n),n},t.prototype.projectNodes=function(t,e){for(var n=0;n<e.length;n++)this.delegate.appendChild(t,e[n])},t.prototype.attachViewAfter=function(t,e){for(var n=this.delegate.parentNode(t),r=this.delegate.nextSibling(t),i=0;i<e.length;i++)this.delegate.insertBefore(n,e[i],r)},t.prototype.detachView=function(t){for(var e=0;e<t.length;e++){var n=t[e],r=this.delegate.parentNode(n);this.delegate.removeChild(r,n)}},t.prototype.destroyView=function(t,e){for(var n=0;n<e.length;n++)this.delegate.destroyNode(e[n])},t.prototype.listen=function(t,e,n){return this.delegate.listen(t,e,n)},t.prototype.listenGlobal=function(t,e,n){return this.delegate.listen(t,e,n)},t.prototype.setElementProperty=function(t,e,n){this.delegate.setProperty(t,e,n)},t.prototype.setElementAttribute=function(t,e,n){var i=Object(r.h)(Mr(e),2),o=i[0],a=i[1];null!=n?this.delegate.setAttribute(t,a,n,o):this.delegate.removeAttribute(t,a,o)},t.prototype.setBindingDebugInfo=function(t,e,n){},t.prototype.setElementClass=function(t,e,n){n?this.delegate.addClass(t,e):this.delegate.removeClass(t,e)},t.prototype.setElementStyle=function(t,e,n){null!=n?this.delegate.setStyle(t,e,n):this.delegate.removeStyle(t,e)},t.prototype.invokeElementMethod=function(t,e,n){t[e].apply(t,n)},t.prototype.setText=function(t,e){this.delegate.setValue(t,e)},t.prototype.animate=function(){throw new Error("Renderer.animate is no longer supported!")},t}();function gi(t,e,n,r){return new bi(t,e,n,r)}var bi=function(){function t(t,e,n,r){this._moduleType=t,this._parent=e,this._bootstrapComponents=n,this._def=r,this._destroyListeners=[],this._destroyed=!1,this.injector=this,function(t){for(var e=t._def,n=t._providers=new Array(e.providers.length),r=0;r<e.providers.length;r++){var i=e.providers[r];4096&i.flags||void 0===n[r]&&(n[r]=Xr(t,i))}}(this)}return t.prototype.get=function(t,e,n){void 0===e&&(e=tt.THROW_IF_NOT_FOUND),void 0===n&&(n=U.Default);var r=0;return n&U.SkipSelf?r|=1:n&U.Self&&(r|=4),Yr(this,{token:t,tokenKey:lr(t),flags:r},e)},Object.defineProperty(t.prototype,"instance",{get:function(){return this.get(this._moduleType)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"componentFactoryResolver",{get:function(){return this.get(bt)},enumerable:!0,configurable:!0}),t.prototype.destroy=function(){if(this._destroyed)throw new Error("The ng module "+A(this.instance.constructor)+" has already been destroyed.");this._destroyed=!0,function(t,e){for(var n=t._def,r=new Set,i=0;i<n.providers.length;i++)if(131072&n.providers[i].flags){var o=t._providers[i];if(o&&o!==zr){var a=o.ngOnDestroy;"function"!=typeof a||r.has(o)||(a.apply(o),r.add(o))}}}(this),this._destroyListeners.forEach((function(t){return t()}))},t.prototype.onDestroy=function(t){this._destroyListeners.push(t)},t}(),wi=lr(kt),_i=lr(xt),Si=lr(Et),Ci=lr(gn),Ei=lr(ue),Ti=lr(wn),ki=lr(tt),Ii=lr(J);function Oi(t,e,n,i,o,a,s,u){var c=[];if(s)for(var l in s){var h=Object(r.h)(s[l],2);c[h[0]]={flags:8,name:l,nonMinifiedName:h[1],ns:null,securityContext:null,suffix:null}}var f=[];if(u)for(var d in u)f.push({type:1,propName:d,target:null,eventName:u[d]});return Ai(t,e|=16384,n,i,o,o,a,c,f)}function xi(t,e,n,r,i){return Ai(-1,t,e,0,n,r,i)}function Ai(t,e,n,r,i,o,a,s,u){var c=Tr(n),l=c.matchedQueries,h=c.references,f=c.matchedQueryIds;u||(u=[]),s||(s=[]),o=R(o);var d=kr(a,A(i));return{nodeIndex:-1,parent:null,renderParent:null,bindingIndex:-1,outputIndex:-1,checkIndex:t,flags:e,childFlags:0,directChildFlags:0,childMatchedQueries:0,matchedQueries:l,matchedQueryIds:f,references:h,ngContentIndex:-1,childCount:r,bindings:s,bindingFlags:Lr(s),outputs:u,element:null,provider:{token:i,value:o,deps:d},text:null,query:null,ngContent:null}}function Pi(t,e){return ji(t,e)}function Di(t,e){for(var n=t;n.parent&&!Sr(n);)n=n.parent;return Mi(n.parent,wr(n),!0,e.provider.value,e.provider.deps)}function Ri(t,e){var n=Mi(t,e.parent,(32768&e.flags)>0,e.provider.value,e.provider.deps);if(e.outputs.length)for(var r=0;r<e.outputs.length;r++){var i=e.outputs[r],o=n[i.propName];if(!Se(o))throw new Error("@Output "+i.propName+" not initialized in '"+n.constructor.name+"'.");var a=o.subscribe(Ni(t,e.parent.nodeIndex,i.eventName));t.disposables[e.outputIndex+r]=a.unsubscribe.bind(a)}return n}function Ni(t,e,n){return function(r){return gr(t,e,n,r)}}function ji(t,e){var n=(8192&e.flags)>0,i=e.provider;switch(201347067&e.flags){case 512:return Mi(t,e.parent,n,i.value,i.deps);case 1024:return function(t,e,n,i,o){var a=o.length;switch(a){case 0:return i();case 1:return i(Fi(t,e,n,o[0]));case 2:return i(Fi(t,e,n,o[0]),Fi(t,e,n,o[1]));case 3:return i(Fi(t,e,n,o[0]),Fi(t,e,n,o[1]),Fi(t,e,n,o[2]));default:for(var s=Array(a),u=0;u<a;u++)s[u]=Fi(t,e,n,o[u]);return i.apply(void 0,Object(r.i)(s))}}(t,e.parent,n,i.value,i.deps);case 2048:return Fi(t,e.parent,n,i.deps[0]);case 256:return i.value}}function Mi(t,e,n,i,o){var a=o.length;switch(a){case 0:return new i;case 1:return new i(Fi(t,e,n,o[0]));case 2:return new i(Fi(t,e,n,o[0]),Fi(t,e,n,o[1]));case 3:return new i(Fi(t,e,n,o[0]),Fi(t,e,n,o[1]),Fi(t,e,n,o[2]));default:for(var s=new Array(a),u=0;u<a;u++)s[u]=Fi(t,e,n,o[u]);return new(i.bind.apply(i,Object(r.i)([void 0],s)))}}var Li={};function Fi(t,e,n,r,i){if(void 0===i&&(i=tt.THROW_IF_NOT_FOUND),8&r.flags)return r.token;var o=t;2&r.flags&&(i=null);var a=r.tokenKey;a===Ti&&(n=!(!e||!e.element.componentView)),e&&1&r.flags&&(n=!1,e=e.parent);for(var s=t;s;){if(e)switch(a){case wi:return yi(Ui(s,e,n));case _i:return Ui(s,e,n).renderer;case Si:return new Et(tr(s,e.nodeIndex).renderElement);case Ci:return tr(s,e.nodeIndex).viewContainer;case Ei:if(e.element.template)return tr(s,e.nodeIndex).template;break;case Ti:return ci(Ui(s,e,n));case ki:case Ii:return di(s,e);default:var u=(n?e.element.allProviders:e.element.publicProviders)[a];if(u){var c=er(s,u.nodeIndex);return c||(c={instance:ji(s,u)},s.nodes[u.nodeIndex]=c),c.instance}}n=Sr(s),e=wr(s),s=s.parent,4&r.flags&&(s=null)}var l=o.root.injector.get(r.token,Li);return l!==Li||i===Li?l:o.root.ngModule.injector.get(r.token,i)}function Ui(t,e,n){var r;if(n)r=tr(t,e.nodeIndex).componentView;else for(r=t;r.parent&&!Sr(r);)r=r.parent;return r}function Vi(t,e,n,r,i,o){if(32768&n.flags){var a=tr(t,n.parent.nodeIndex).componentView;2&a.def.flags&&(a.state|=8)}if(e.instance[n.bindings[r].name]=i,524288&n.flags){o=o||{};var s=$.unwrap(t.oldValues[n.bindingIndex+r]);o[n.bindings[r].nonMinifiedName]=new K(s,i,0!=(2&t.state))}return t.oldValues[n.bindingIndex+r]=i,o}function qi(t,e){if(t.def.nodeFlags&e)for(var n=t.def.nodes,r=0,i=0;i<n.length;i++){var o=n[i],a=o.parent;for(!a&&o.flags&e&&Wi(t,i,o.flags&e,r++),0==(o.childFlags&e)&&(i+=o.childCount);a&&1&a.flags&&i===a.nodeIndex+a.childCount;)a.directChildFlags&e&&(r=Bi(t,a,e,r)),a=a.parent}}function Bi(t,e,n,r){for(var i=e.nodeIndex+1;i<=e.nodeIndex+e.childCount;i++){var o=t.def.nodes[i];o.flags&n&&Wi(t,i,o.flags&n,r++),i+=o.childCount}return r}function Wi(t,e,n,r){var i=er(t,e);if(i){var o=i.instance;o&&(ir.setCurrentNode(t,e),1048576&n&&Jn(t,512,r)&&o.ngAfterContentInit(),2097152&n&&o.ngAfterContentChecked(),4194304&n&&Jn(t,768,r)&&o.ngAfterViewInit(),8388608&n&&o.ngAfterViewChecked(),131072&n&&o.ngOnDestroy())}}function zi(t,e,n){var r=[];for(var i in n)r.push({propName:i,bindingType:n[i]});return{nodeIndex:-1,parent:null,renderParent:null,bindingIndex:-1,outputIndex:-1,checkIndex:-1,flags:t,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:e,filterId:Er(e),bindings:r},ngContent:null}}function Hi(t){for(var e=t.def.nodeMatchedQueries;t.parent&&Cr(t);){var n=t.parentNodeDef;t=t.parent;for(var r=n.nodeIndex+n.childCount,i=0;i<=r;i++)67108864&(o=t.def.nodes[i]).flags&&536870912&o.flags&&(o.query.filterId&e)===o.query.filterId&&rr(t,i).setDirty(),!(1&o.flags&&i+o.childCount<n.nodeIndex)&&67108864&o.childFlags&&536870912&o.childFlags||(i+=o.childCount)}if(134217728&t.def.nodeFlags)for(i=0;i<t.def.nodes.length;i++){var o;134217728&(o=t.def.nodes[i]).flags&&536870912&o.flags&&rr(t,i).setDirty(),i+=o.childCount}}function $i(t,e){var n=rr(t,e.nodeIndex);if(n.dirty){var r,i=void 0;if(67108864&e.flags){var o=e.parent.parent;i=Ki(t,o.nodeIndex,o.nodeIndex+o.childCount,e.query,[]),r=er(t,e.parent.nodeIndex).instance}else 134217728&e.flags&&(i=Ki(t,0,t.def.nodes.length-1,e.query,[]),r=t.component);n.reset(i);for(var a=e.query.bindings,s=!1,u=0;u<a.length;u++){var c=a[u],l=void 0;switch(c.bindingType){case 0:l=n.first;break;case 1:l=n,s=!0}r[c.propName]=l}s&&n.notifyOnChanges()}}function Ki(t,e,n,r,i){for(var o=e;o<=n;o++){var a=t.def.nodes[o],s=a.matchedQueries[r.id];if(null!=s&&i.push(Gi(t,a,s)),1&a.flags&&a.element.template&&(a.element.template.nodeMatchedQueries&r.filterId)===r.filterId){var u=tr(t,o);if((a.childMatchedQueries&r.filterId)===r.filterId&&(Ki(t,o+1,o+a.childCount,r,i),o+=a.childCount),16777216&a.flags)for(var c=u.viewContainer._embeddedViews,l=0;l<c.length;l++){var h=c[l],f=br(h);f&&f===u&&Ki(h,0,h.def.nodes.length-1,r,i)}var d=u.template._projectedViews;if(d)for(l=0;l<d.length;l++){var p=d[l];Ki(p,0,p.def.nodes.length-1,r,i)}}(a.childMatchedQueries&r.filterId)!==r.filterId&&(o+=a.childCount)}return i}function Gi(t,e,n){if(null!=n)switch(n){case 1:return tr(t,e.nodeIndex).renderElement;case 0:return new Et(tr(t,e.nodeIndex).renderElement);case 2:return tr(t,e.nodeIndex).template;case 3:return tr(t,e.nodeIndex).viewContainer;case 4:return er(t,e.nodeIndex).instance}}function Qi(t,e){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:t,childCount:0,bindings:[],bindingFlags:0,outputs:[],element:null,provider:null,text:null,query:null,ngContent:{index:e}}}function Yi(t,e,n){var r=Ir(t,e,n);r&&Dr(t,n.ngContent.index,1,r,null,void 0)}function Xi(t,e){return Zi(32,t,new Array(e))}function Ji(t,e){for(var n=Object.keys(e),r=n.length,i=new Array(r),o=0;o<r;o++){var a=n[o];i[e[a]]=a}return Zi(64,t,i)}function Zi(t,e,n){for(var r=new Array(n.length),i=0;i<n.length;i++){var o=n[i];r[i]={flags:8,name:o,ns:null,nonMinifiedName:o,securityContext:null,suffix:null}}return{nodeIndex:-1,parent:null,renderParent:null,bindingIndex:-1,outputIndex:-1,checkIndex:e,flags:t,childFlags:0,directChildFlags:0,childMatchedQueries:0,matchedQueries:{},matchedQueryIds:0,references:{},ngContentIndex:-1,childCount:0,bindings:r,bindingFlags:Lr(r),outputs:[],element:null,provider:null,text:null,query:null,ngContent:null}}function to(t,e,n){for(var r=new Array(n.length-1),i=1;i<n.length;i++)r[i-1]={flags:8,name:null,ns:null,nonMinifiedName:null,securityContext:null,suffix:n[i]};return{nodeIndex:-1,parent:null,renderParent:null,bindingIndex:-1,outputIndex:-1,checkIndex:t,flags:2,childFlags:0,directChildFlags:0,childMatchedQueries:0,matchedQueries:{},matchedQueryIds:0,references:{},ngContentIndex:e,childCount:0,bindings:r,bindingFlags:8,outputs:[],element:null,provider:null,text:{prefix:n[0]},query:null,ngContent:null}}function eo(t,e,n){var r,i=t.renderer;r=i.createText(n.text.prefix);var o=Ir(t,e,n);return o&&i.appendChild(o,r),{renderText:r}}function no(t,e){return(null!=t?t.toString():"")+e.suffix}function ro(t,e,n,r){for(var i=0,o=0,a=0,s=0,u=0,c=null,l=null,h=!1,f=!1,d=null,p=0;p<e.length;p++){var m=e[p];if(m.nodeIndex=p,m.parent=c,m.bindingIndex=i,m.outputIndex=o,m.renderParent=l,a|=m.flags,u|=m.matchedQueryIds,m.element){var y=m.element;y.publicProviders=c?c.element.publicProviders:Object.create(null),y.allProviders=y.publicProviders,h=!1,f=!1,m.element.template&&(u|=m.element.template.nodeMatchedQueries)}if(oo(c,m,e.length),i+=m.bindings.length,o+=m.outputs.length,!l&&3&m.flags&&(d=m),20224&m.flags){h||(h=!0,c.element.publicProviders=Object.create(c.element.publicProviders),c.element.allProviders=c.element.publicProviders);var v=0!=(32768&m.flags);0==(8192&m.flags)||v?c.element.publicProviders[lr(m.provider.token)]=m:(f||(f=!0,c.element.allProviders=Object.create(c.element.publicProviders)),c.element.allProviders[lr(m.provider.token)]=m),v&&(c.element.componentProvider=m)}if(c?(c.childFlags|=m.flags,c.directChildFlags|=m.flags,c.childMatchedQueries|=m.matchedQueryIds,m.element&&m.element.template&&(c.childMatchedQueries|=m.element.template.nodeMatchedQueries)):s|=m.flags,m.childCount>0)c=m,io(m)||(l=m);else for(;c&&p===c.nodeIndex+c.childCount;){var g=c.parent;g&&(g.childFlags|=c.childFlags,g.childMatchedQueries|=c.childMatchedQueries),l=(c=g)&&io(c)?c.renderParent:c}}return{factory:null,nodeFlags:a,rootNodeFlags:s,nodeMatchedQueries:u,flags:t,nodes:e,updateDirectives:n||ur,updateRenderer:r||ur,handleEvent:function(t,n,r,i){return e[n].element.handleEvent(t,r,i)},bindingCount:i,outputCount:o,lastRenderRootNode:d}}function io(t){return 0!=(1&t.flags)&&null===t.element.name}function oo(t,e,n){var r=e.element&&e.element.template;if(r){if(!r.lastRenderRootNode)throw new Error("Illegal State: Embedded templates without nodes are not allowed!");if(r.lastRenderRootNode&&16777216&r.lastRenderRootNode.flags)throw new Error("Illegal State: Last root node of a template can't have embedded views, at index "+e.nodeIndex+"!")}if(20224&e.flags&&0==(1&(t?t.flags:0)))throw new Error("Illegal State: StaticProvider/Directive nodes need to be children of elements or anchors, at index "+e.nodeIndex+"!");if(e.query){if(67108864&e.flags&&(!t||0==(16384&t.flags)))throw new Error("Illegal State: Content Query nodes need to be children of directives, at index "+e.nodeIndex+"!");if(134217728&e.flags&&t)throw new Error("Illegal State: View Query nodes have to be top level nodes, at index "+e.nodeIndex+"!")}if(e.childCount){var i=t?t.nodeIndex+t.childCount:n-1;if(e.nodeIndex<=i&&e.nodeIndex+e.childCount>i)throw new Error("Illegal State: childCount of node leads outside of parent, at index "+e.nodeIndex+"!")}}function ao(t,e,n,r){var i=co(t.root,t.renderer,t,e,n);return lo(i,t.component,r),ho(i),i}function so(t,e,n){var r=co(t,t.renderer,null,null,e);return lo(r,n,n),ho(r),r}function uo(t,e,n,r){var i,o=e.element.componentRendererType;return i=o?t.root.rendererFactory.createRenderer(r,o):t.root.renderer,co(t.root,i,t,e.element.componentProvider,n)}function co(t,e,n,r,i){var o=new Array(i.nodes.length),a=i.outputCount?new Array(i.outputCount):null;return{def:i,parent:n,viewContainerParent:null,parentNodeDef:r,context:null,component:null,nodes:o,state:13,root:t,renderer:e,oldValues:new Array(i.bindingCount),disposables:a,initIndex:-1}}function lo(t,e,n){t.component=e,t.context=n}function ho(t){var e;Sr(t)&&(e=tr(t.parent,t.parentNodeDef.parent.nodeIndex).renderElement);for(var n=t.def,r=t.nodes,i=0;i<n.nodes.length;i++){var o=n.nodes[i];ir.setCurrentNode(t,i);var a=void 0;switch(201347067&o.flags){case 1:var s=Vr(t,e,o),u=void 0;if(33554432&o.flags){var c=xr(o.element.componentView);u=ir.createComponentView(t,o,c,s)}qr(t,u,o,s),a={renderElement:s,componentView:u,viewContainer:null,template:o.element.template?hi(t,o):void 0},16777216&o.flags&&(a.viewContainer=si(t,o,a));break;case 2:a=eo(t,e,o);break;case 512:case 1024:case 2048:case 256:(a=r[i])||4096&o.flags||(a={instance:Pi(t,o)});break;case 16:a={instance:Di(t,o)};break;case 16384:(a=r[i])||(a={instance:Ri(t,o)}),32768&o.flags&&lo(tr(t,o.parent.nodeIndex).componentView,a.instance,a.instance);break;case 32:case 64:case 128:a={value:void 0};break;case 67108864:case 134217728:a=new dn;break;case 8:Yi(t,e,o),a=void 0}r[i]=a}_o(t,wo.CreateViewNodes),To(t,201326592,268435456,0)}function fo(t){yo(t),ir.updateDirectives(t,1),So(t,wo.CheckNoChanges),ir.updateRenderer(t,1),_o(t,wo.CheckNoChanges),t.state&=-97}function po(t){1&t.state?(t.state&=-2,t.state|=2):t.state&=-3,Xn(t,0,256),yo(t),ir.updateDirectives(t,0),So(t,wo.CheckAndUpdate),To(t,67108864,536870912,0);var e=Xn(t,256,512);qi(t,2097152|(e?1048576:0)),ir.updateRenderer(t,0),_o(t,wo.CheckAndUpdate),To(t,134217728,536870912,0),qi(t,8388608|((e=Xn(t,512,768))?4194304:0)),2&t.def.flags&&(t.state&=-9),t.state&=-97,Xn(t,768,1024)}function mo(t,e,n,i,o,a,s,u,c,l,h,f,d){return 0===n?function(t,e,n,r,i,o,a,s,u,c,l,h){switch(201347067&e.flags){case 1:return function(t,e,n,r,i,o,a,s,u,c,l,h){var f=e.bindings.length,d=!1;return f>0&&Wr(t,e,0,n)&&(d=!0),f>1&&Wr(t,e,1,r)&&(d=!0),f>2&&Wr(t,e,2,i)&&(d=!0),f>3&&Wr(t,e,3,o)&&(d=!0),f>4&&Wr(t,e,4,a)&&(d=!0),f>5&&Wr(t,e,5,s)&&(d=!0),f>6&&Wr(t,e,6,u)&&(d=!0),f>7&&Wr(t,e,7,c)&&(d=!0),f>8&&Wr(t,e,8,l)&&(d=!0),f>9&&Wr(t,e,9,h)&&(d=!0),d}(t,e,n,r,i,o,a,s,u,c,l,h);case 2:return function(t,e,n,r,i,o,a,s,u,c,l,h){var f=!1,d=e.bindings,p=d.length;if(p>0&&pr(t,e,0,n)&&(f=!0),p>1&&pr(t,e,1,r)&&(f=!0),p>2&&pr(t,e,2,i)&&(f=!0),p>3&&pr(t,e,3,o)&&(f=!0),p>4&&pr(t,e,4,a)&&(f=!0),p>5&&pr(t,e,5,s)&&(f=!0),p>6&&pr(t,e,6,u)&&(f=!0),p>7&&pr(t,e,7,c)&&(f=!0),p>8&&pr(t,e,8,l)&&(f=!0),p>9&&pr(t,e,9,h)&&(f=!0),f){var m=e.text.prefix;p>0&&(m+=no(n,d[0])),p>1&&(m+=no(r,d[1])),p>2&&(m+=no(i,d[2])),p>3&&(m+=no(o,d[3])),p>4&&(m+=no(a,d[4])),p>5&&(m+=no(s,d[5])),p>6&&(m+=no(u,d[6])),p>7&&(m+=no(c,d[7])),p>8&&(m+=no(l,d[8])),p>9&&(m+=no(h,d[9]));var y=Zn(t,e.nodeIndex).renderText;t.renderer.setValue(y,m)}return f}(t,e,n,r,i,o,a,s,u,c,l,h);case 16384:return function(t,e,n,r,i,o,a,s,u,c,l,h){var f=er(t,e.nodeIndex),d=f.instance,p=!1,m=void 0,y=e.bindings.length;return y>0&&dr(t,e,0,n)&&(p=!0,m=Vi(t,f,e,0,n,m)),y>1&&dr(t,e,1,r)&&(p=!0,m=Vi(t,f,e,1,r,m)),y>2&&dr(t,e,2,i)&&(p=!0,m=Vi(t,f,e,2,i,m)),y>3&&dr(t,e,3,o)&&(p=!0,m=Vi(t,f,e,3,o,m)),y>4&&dr(t,e,4,a)&&(p=!0,m=Vi(t,f,e,4,a,m)),y>5&&dr(t,e,5,s)&&(p=!0,m=Vi(t,f,e,5,s,m)),y>6&&dr(t,e,6,u)&&(p=!0,m=Vi(t,f,e,6,u,m)),y>7&&dr(t,e,7,c)&&(p=!0,m=Vi(t,f,e,7,c,m)),y>8&&dr(t,e,8,l)&&(p=!0,m=Vi(t,f,e,8,l,m)),y>9&&dr(t,e,9,h)&&(p=!0,m=Vi(t,f,e,9,h,m)),m&&d.ngOnChanges(m),65536&e.flags&&Jn(t,256,e.nodeIndex)&&d.ngOnInit(),262144&e.flags&&d.ngDoCheck(),p}(t,e,n,r,i,o,a,s,u,c,l,h);case 32:case 64:case 128:return function(t,e,n,r,i,o,a,s,u,c,l,h){var f=e.bindings,d=!1,p=f.length;if(p>0&&pr(t,e,0,n)&&(d=!0),p>1&&pr(t,e,1,r)&&(d=!0),p>2&&pr(t,e,2,i)&&(d=!0),p>3&&pr(t,e,3,o)&&(d=!0),p>4&&pr(t,e,4,a)&&(d=!0),p>5&&pr(t,e,5,s)&&(d=!0),p>6&&pr(t,e,6,u)&&(d=!0),p>7&&pr(t,e,7,c)&&(d=!0),p>8&&pr(t,e,8,l)&&(d=!0),p>9&&pr(t,e,9,h)&&(d=!0),d){var m=nr(t,e.nodeIndex),y=void 0;switch(201347067&e.flags){case 32:y=new Array(f.length),p>0&&(y[0]=n),p>1&&(y[1]=r),p>2&&(y[2]=i),p>3&&(y[3]=o),p>4&&(y[4]=a),p>5&&(y[5]=s),p>6&&(y[6]=u),p>7&&(y[7]=c),p>8&&(y[8]=l),p>9&&(y[9]=h);break;case 64:y={},p>0&&(y[f[0].name]=n),p>1&&(y[f[1].name]=r),p>2&&(y[f[2].name]=i),p>3&&(y[f[3].name]=o),p>4&&(y[f[4].name]=a),p>5&&(y[f[5].name]=s),p>6&&(y[f[6].name]=u),p>7&&(y[f[7].name]=c),p>8&&(y[f[8].name]=l),p>9&&(y[f[9].name]=h);break;case 128:var v=n;switch(p){case 1:y=v.transform(n);break;case 2:y=v.transform(r);break;case 3:y=v.transform(r,i);break;case 4:y=v.transform(r,i,o);break;case 5:y=v.transform(r,i,o,a);break;case 6:y=v.transform(r,i,o,a,s);break;case 7:y=v.transform(r,i,o,a,s,u);break;case 8:y=v.transform(r,i,o,a,s,u,c);break;case 9:y=v.transform(r,i,o,a,s,u,c,l);break;case 10:y=v.transform(r,i,o,a,s,u,c,l,h)}}m.value=y}return d}(t,e,n,r,i,o,a,s,u,c,l,h);default:throw"unreachable"}}(t,e,i,o,a,s,u,c,l,h,f,d):function(t,e,n){switch(201347067&e.flags){case 1:return function(t,e,n){for(var r=!1,i=0;i<n.length;i++)Wr(t,e,i,n[i])&&(r=!0);return r}(t,e,n);case 2:return function(t,e,n){for(var r=e.bindings,i=!1,o=0;o<n.length;o++)pr(t,e,o,n[o])&&(i=!0);if(i){var a="";for(o=0;o<n.length;o++)a+=no(n[o],r[o]);a=e.text.prefix+a;var s=Zn(t,e.nodeIndex).renderText;t.renderer.setValue(s,a)}return i}(t,e,n);case 16384:return function(t,e,n){for(var r=er(t,e.nodeIndex),i=r.instance,o=!1,a=void 0,s=0;s<n.length;s++)dr(t,e,s,n[s])&&(o=!0,a=Vi(t,r,e,s,n[s],a));return a&&i.ngOnChanges(a),65536&e.flags&&Jn(t,256,e.nodeIndex)&&i.ngOnInit(),262144&e.flags&&i.ngDoCheck(),o}(t,e,n);case 32:case 64:case 128:return function(t,e,n){for(var i=e.bindings,o=!1,a=0;a<n.length;a++)pr(t,e,a,n[a])&&(o=!0);if(o){var s=nr(t,e.nodeIndex),u=void 0;switch(201347067&e.flags){case 32:u=n;break;case 64:for(u={},a=0;a<n.length;a++)u[i[a].name]=n[a];break;case 128:var c=n[0],l=n.slice(1);u=c.transform.apply(c,Object(r.i)(l))}s.value=u}return o}(t,e,n);default:throw"unreachable"}}(t,e,i)}function yo(t){var e=t.def;if(4&e.nodeFlags)for(var n=0;n<e.nodes.length;n++){var r=e.nodes[n];if(4&r.flags){var i=tr(t,n).template._projectedViews;if(i)for(var o=0;o<i.length;o++){var a=i[o];a.state|=32,vr(a,t)}}else 0==(4&r.childFlags)&&(n+=r.childCount)}}function vo(t,e,n,r,i,o,a,s,u,c,l,h,f){return 0===n?function(t,e,n,r,i,o,a,s,u,c,l,h){var f=e.bindings.length;f>0&&mr(t,e,0,n),f>1&&mr(t,e,1,r),f>2&&mr(t,e,2,i),f>3&&mr(t,e,3,o),f>4&&mr(t,e,4,a),f>5&&mr(t,e,5,s),f>6&&mr(t,e,6,u),f>7&&mr(t,e,7,c),f>8&&mr(t,e,8,l),f>9&&mr(t,e,9,h)}(t,e,r,i,o,a,s,u,c,l,h,f):function(t,e,n){for(var r=0;r<n.length;r++)mr(t,e,r,n[r])}(t,e,r),!1}function go(t,e){if(rr(t,e.nodeIndex).dirty)throw or(ir.createDebugContext(t,e.nodeIndex),"Query "+e.query.id+" not dirty","Query "+e.query.id+" dirty",0!=(1&t.state))}function bo(t){if(!(128&t.state)){if(So(t,wo.Destroy),_o(t,wo.Destroy),qi(t,131072),t.disposables)for(var e=0;e<t.disposables.length;e++)t.disposables[e]();!function(t){if(16&t.state){var e=br(t);if(e){var n=e.template._projectedViews;n&&(ni(n,n.indexOf(t)),ir.dirtyParentQueries(t))}}}(t),t.renderer.destroyNode&&function(t){for(var e=t.def.nodes.length,n=0;n<e;n++){var r=t.def.nodes[n];1&r.flags?t.renderer.destroyNode(tr(t,n).renderElement):2&r.flags?t.renderer.destroyNode(Zn(t,n).renderText):(67108864&r.flags||134217728&r.flags)&&rr(t,n).destroy()}}(t),Sr(t)&&t.renderer.destroy(),t.state|=128}}var wo=function(t){return t[t.CreateViewNodes=0]="CreateViewNodes",t[t.CheckNoChanges=1]="CheckNoChanges",t[t.CheckNoChangesProjectedViews=2]="CheckNoChangesProjectedViews",t[t.CheckAndUpdate=3]="CheckAndUpdate",t[t.CheckAndUpdateProjectedViews=4]="CheckAndUpdateProjectedViews",t[t.Destroy=5]="Destroy",t}({});function _o(t,e){var n=t.def;if(33554432&n.nodeFlags)for(var r=0;r<n.nodes.length;r++){var i=n.nodes[r];33554432&i.flags?Co(tr(t,r).componentView,e):0==(33554432&i.childFlags)&&(r+=i.childCount)}}function So(t,e){var n=t.def;if(16777216&n.nodeFlags)for(var r=0;r<n.nodes.length;r++){var i=n.nodes[r];if(16777216&i.flags)for(var o=tr(t,r).viewContainer._embeddedViews,a=0;a<o.length;a++)Co(o[a],e);
1else 0==(16777216&i.childFlags)&&(r+=i.childCount)}}function Co(t,e){var n=t.state;switch(e){case wo.CheckNoChanges:0==(128&n)&&(12==(12&n)?fo(t):64&n&&Eo(t,wo.CheckNoChangesProjectedViews));break;case wo.CheckNoChangesProjectedViews:0==(128&n)&&(32&n?fo(t):64&n&&Eo(t,e));break;case wo.CheckAndUpdate:0==(128&n)&&(12==(12&n)?po(t):64&n&&Eo(t,wo.CheckAndUpdateProjectedViews));break;case wo.CheckAndUpdateProjectedViews:0==(128&n)&&(32&n?po(t):64&n&&Eo(t,e));break;case wo.Destroy:bo(t);break;case wo.CreateViewNodes:ho(t)}}function Eo(t,e){So(t,e),_o(t,e)}function To(t,e,n,r){if(t.def.nodeFlags&e&&t.def.nodeFlags&n)for(var i=t.def.nodes.length,o=0;o<i;o++){var a=t.def.nodes[o];if(a.flags&e&&a.flags&n)switch(ir.setCurrentNode(t,a.nodeIndex),r){case 0:$i(t,a);break;case 1:go(t,a)}a.childFlags&e&&a.childFlags&n||(o+=a.childCount)}}var ko=!1;function Io(t,e,n,r,i,o){var a=i.injector.get(It);return so(xo(t,i,a,e,n),r,o)}function Oo(t,e,n,r,i,o){var a=i.injector.get(It),s=xo(t,i,new ua(a),e,n),u=Uo(r);return aa(Go.create,so,null,[s,u,o])}function xo(t,e,n,r,i){var o=e.injector.get(Dt),a=e.injector.get(we),s=n.createRenderer(null,null);return{ngModule:e,injector:t,projectableNodes:r,selectorOrNode:i,sanitizer:o,rendererFactory:n,renderer:s,errorHandler:a}}function Ao(t,e,n,r){var i=Uo(n);return aa(Go.create,ao,null,[t,e,i,r])}function Po(t,e,n,r){return n=jo.get(e.element.componentProvider.provider.token)||Uo(n),aa(Go.create,uo,null,[t,e,n,r])}function Do(t,e,n,r){return gi(t,e,n,function(t){var e=function(t){var e=!1,n=!1;return 0===Ro.size||(t.providers.forEach((function(t){var r=Ro.get(t.token);3840&t.flags&&r&&(e=!0,n=n||r.deprecatedBehavior)})),t.modules.forEach((function(t){No.forEach((function(r,i){p(i).providedIn===t&&(e=!0,n=n||r.deprecatedBehavior)}))}))),{hasOverrides:e,hasDeprecatedOverrides:n}}(t),n=e.hasDeprecatedOverrides;return e.hasOverrides?(function(t){for(var e=0;e<t.providers.length;e++){var r=t.providers[e];n&&(r.flags|=4096);var i=Ro.get(r.token);i&&(r.flags=-3841&r.flags|i.flags,r.deps=kr(i.deps),r.value=i.value)}if(No.size>0){var o=new Set(t.modules);No.forEach((function(e,r){if(o.has(p(r).providedIn)){var i={token:r,flags:e.flags|(n?4096:0),deps:kr(e.deps),value:e.value,index:t.providers.length};t.providers.push(i),t.providersByKey[lr(r)]=i}}))}}(t=t.factory((function(){return ur}))),t):t}(r))}var Ro=new Map,No=new Map,jo=new Map;function Mo(t){var e;Ro.set(t.token,t),"function"==typeof t.token&&(e=p(t.token))&&"function"==typeof e.providedIn&&No.set(t.token,t)}function Lo(t,e){var n=xr(e.viewDefFactory),r=xr(n.nodes[0].element.componentView);jo.set(t,r)}function Fo(){Ro.clear(),No.clear(),jo.clear()}function Uo(t){if(0===Ro.size)return t;var e=function(t){for(var e=[],n=null,r=0;r<t.nodes.length;r++){var i=t.nodes[r];1&i.flags&&(n=i),n&&3840&i.flags&&Ro.has(i.provider.token)&&(e.push(n.nodeIndex),n=null)}return e}(t);if(0===e.length)return t;t=t.factory((function(){return ur}));for(var n=0;n<e.length;n++)r(t,e[n]);return t;function r(t,e){for(var n=e+1;n<t.nodes.length;n++){var r=t.nodes[n];if(1&r.flags)return;if(3840&r.flags){var i=r.provider,o=Ro.get(i.token);o&&(r.flags=-3841&r.flags|o.flags,i.deps=kr(o.deps),i.value=o.value)}}}}function Vo(t,e,n,r,i,o,a,s,u,c,l,h,f){var d=t.def.nodes[e];return mo(t,d,n,r,i,o,a,s,u,c,l,h,f),224&d.flags?nr(t,e).value:void 0}function qo(t,e,n,r,i,o,a,s,u,c,l,h,f){var d=t.def.nodes[e];return vo(t,d,n,r,i,o,a,s,u,c,l,h,f),224&d.flags?nr(t,e).value:void 0}function Bo(t){return aa(Go.detectChanges,po,null,[t])}function Wo(t){return aa(Go.checkNoChanges,fo,null,[t])}function zo(t){return aa(Go.destroy,bo,null,[t])}var Ho,$o,Ko,Go=function(t){return t[t.create=0]="create",t[t.detectChanges=1]="detectChanges",t[t.checkNoChanges=2]="checkNoChanges",t[t.destroy=3]="destroy",t[t.handleEvent=4]="handleEvent",t}({});function Qo(t,e){$o=t,Ko=e}function Yo(t,e,n,r){return Qo(t,e),aa(Go.handleEvent,t.def.handleEvent,null,[t,e,n,r])}function Xo(t,e){if(128&t.state)throw sr(Go[Ho]);return Qo(t,ea(t,0)),t.def.updateDirectives((function(t,n,r){for(var i=[],o=3;o<arguments.length;o++)i[o-3]=arguments[o];var a=t.def.nodes[n];return 0===e?Zo(t,a,r,i):ta(t,a,r,i),16384&a.flags&&Qo(t,ea(t,n)),224&a.flags?nr(t,a.nodeIndex).value:void 0}),t)}function Jo(t,e){if(128&t.state)throw sr(Go[Ho]);return Qo(t,na(t,0)),t.def.updateRenderer((function(t,n,r){for(var i=[],o=3;o<arguments.length;o++)i[o-3]=arguments[o];var a=t.def.nodes[n];return 0===e?Zo(t,a,r,i):ta(t,a,r,i),3&a.flags&&Qo(t,na(t,n)),224&a.flags?nr(t,a.nodeIndex).value:void 0}),t)}function Zo(t,e,n,i){if(mo.apply(void 0,Object(r.i)([t,e,n],i))){var o=1===n?i[0]:i;if(16384&e.flags){for(var a={},s=0;s<e.bindings.length;s++){var u=e.bindings[s],c=o[s];8&u.flags&&(a[(d=u.nonMinifiedName,"ng-reflect-"+d.replace(/[$@]/g,"_").replace(W,(function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return"-"+t[1].toLowerCase()})))]=z(c))}var l=e.parent,h=tr(t,l.nodeIndex).renderElement;if(l.element.name)for(var f in a)null!=(c=a[f])?t.renderer.setAttribute(h,f,c):t.renderer.removeAttribute(h,f);else t.renderer.setValue(h,"bindings="+JSON.stringify(a,null,2))}}var d}function ta(t,e,n,i){vo.apply(void 0,Object(r.i)([t,e,n],i))}function ea(t,e){for(var n=e;n<t.def.nodes.length;n++){var r=t.def.nodes[n];
vendor: 7,893 bytes, line 1
1if(16384&r.flags&&r.bindings&&r.bindings.length)return n}return null}function na(t,e){for(var n=e;n<t.def.nodes.length;n++){var r=t.def.nodes[n];if(3&r.flags&&r.bindings&&r.bindings.length)return n}return null}var ra=function(){function t(t,e){this.view=t,this.nodeIndex=e,null==e&&(this.nodeIndex=e=0),this.nodeDef=t.def.nodes[e];for(var n=this.nodeDef,r=t;n&&0==(1&n.flags);)n=n.parent;if(!n)for(;!n&&r;)n=wr(r),r=r.parent;this.elDef=n,this.elView=r}return Object.defineProperty(t.prototype,"elOrCompView",{get:function(){return tr(this.elView,this.elDef.nodeIndex).componentView||this.view},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"injector",{get:function(){return di(this.elView,this.elDef)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"component",{get:function(){return this.elOrCompView.component},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"context",{get:function(){return this.elOrCompView.context},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"providerTokens",{get:function(){var t=[];if(this.elDef)for(var e=this.elDef.nodeIndex+1;e<=this.elDef.nodeIndex+this.elDef.childCount;e++){var n=this.elView.def.nodes[e];20224&n.flags&&t.push(n.provider.token),e+=n.childCount}return t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"references",{get:function(){var t={};if(this.elDef){oa(this.elView,this.elDef,t);for(var e=this.elDef.nodeIndex+1;e<=this.elDef.nodeIndex+this.elDef.childCount;e++){var n=this.elView.def.nodes[e];20224&n.flags&&oa(this.elView,n,t),e+=n.childCount}}return t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"componentRenderElement",{get:function(){var t=function(t){for(;t&&!Sr(t);)t=t.parent;return t.parent?tr(t.parent,wr(t).nodeIndex):null}(this.elOrCompView);return t?t.renderElement:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"renderNode",{get:function(){return 2&this.nodeDef.flags?_r(this.view,this.nodeDef):_r(this.elView,this.elDef)},enumerable:!0,configurable:!0}),t.prototype.logError=function(t){for(var e,n,i=[],o=1;o<arguments.length;o++)i[o-1]=arguments[o];2&this.nodeDef.flags?(e=this.view.def,n=this.nodeDef.nodeIndex):(e=this.elView.def,n=this.elDef.nodeIndex);var a=ia(e,n),s=-1,u=function(){var e;return++s===a?(e=t.error).bind.apply(e,Object(r.i)([t],i)):ur};e.factory(u),s<a&&(t.error("Illegal state: the ViewDefinitionFactory did not call the logger!"),t.error.apply(t,Object(r.i)(i)))},t}();function ia(t,e){for(var n=-1,r=0;r<=e;r++)3&t.nodes[r].flags&&n++;return n}function oa(t,e,n){for(var r in e.references)n[r]=Gi(t,e,e.references[r])}function aa(t,e,n,r){var i=Ho,o=$o,a=Ko;try{Ho=t;var s=e.apply(n,r);return $o=o,Ko=a,Ho=i,s}catch(u){if(ve(u)||!$o)throw u;throw function(t,e){return t instanceof Error||(t=new Error(t.toString())),ar(t,e),t}(u,sa())}}function sa(){return $o?new ra($o,Ko):null}var ua=function(){function t(t){this.delegate=t}return t.prototype.createRenderer=function(t,e){return new ca(this.delegate.createRenderer(t,e))},t.prototype.begin=function(){this.delegate.begin&&this.delegate.begin()},t.prototype.end=function(){this.delegate.end&&this.delegate.end()},t.prototype.whenRenderingDone=function(){return this.delegate.whenRenderingDone?this.delegate.whenRenderingDone():Promise.resolve(null)},t}(),ca=function(){function t(t){this.delegate=t,this.debugContextFactory=sa,this.data=this.delegate.data}return t.prototype.createDebugContext=function(t){return this.debugContextFactory(t)},t.prototype.destroyNode=function(t){!function(t){In.delete(t.nativeNode)}(On(t)),this.delegate.destroyNode&&this.delegate.destroyNode(t)},t.prototype.destroy=function(){this.delegate.destroy()},t.prototype.createElement=function(t,e){var n=this.delegate.createElement(t,e),r=this.createDebugContext(n);if(r){var i=new En(n,null,r);i.name=t,xn(i)}return n},t.prototype.createComment=function(t){var e=this.delegate.createComment(t),n=this.createDebugContext(e);return n&&xn(new Cn(e,null,n)),e},t.prototype.createText=function(t){var e=this.delegate.createText(t),n=this.createDebugContext(e);return n&&xn(new Cn(e,null,n)),e},t.prototype.appendChild=function(t,e){var n=On(t),r=On(e);n&&r&&n instanceof En&&n.addChild(r),this.delegate.appendChild(t,e)},t.prototype.insertBefore=function(t,e,n){var r=On(t),i=On(e),o=On(n);r&&i&&r instanceof En&&r.insertBefore(o,i),this.delegate.insertBefore(t,e,n)},t.prototype.removeChild=function(t,e){var n=On(t),r=On(e);n&&r&&n instanceof En&&n.removeChild(r),this.delegate.removeChild(t,e)},t.prototype.selectRootElement=function(t,e){var n=this.delegate.selectRootElement(t,e),r=sa();return r&&xn(new En(n,null,r)),n},t.prototype.setAttribute=function(t,e,n,r){var i=On(t);i&&i instanceof En&&(i.attributes[r?r+":"+e:e]=n),this.delegate.setAttribute(t,e,n,r)},t.prototype.removeAttribute=function(t,e,n){var r=On(t);r&&r instanceof En&&(r.attributes[n?n+":"+e:e]=null),this.delegate.removeAttribute(t,e,n)},t.prototype.addClass=function(t,e){var n=On(t);n&&n instanceof En&&(n.classes[e]=!0),this.delegate.addClass(t,e)},t.prototype.removeClass=function(t,e){var n=On(t);n&&n instanceof En&&(n.classes[e]=!1),this.delegate.removeClass(t,e)},t.prototype.setStyle=function(t,e,n,r){var i=On(t);i&&i instanceof En&&(i.styles[e]=n),this.delegate.setStyle(t,e,n,r)},t.prototype.removeStyle=function(t,e,n){var r=On(t);r&&r instanceof En&&(r.styles[e]=null),this.delegate.removeStyle(t,e,n)},t.prototype.setProperty=function(t,e,n){var r=On(t);r&&r instanceof En&&(r.properties[e]=n),this.delegate.setProperty(t,e,n)},t.prototype.listen=function(t,e,n){if("string"!=typeof t){var r=On(t);r&&r.listeners.push(new Sn(e,n))}return this.delegate.listen(t,e,n)},t.prototype.parentNode=function(t){return this.delegate.parentNode(t)},t.prototype.nextSibling=function(t){return this.delegate.nextSibling(t)},t.prototype.setValue=function(t,e){return this.delegate.setValue(t,e)},t}();function la(t,e,n){return new ha(t,e,n)}var ha=function(t){function e(e,n,r){var i=t.call(this)||this;return i.moduleType=e,i._bootstrapComponents=n,i._ngModuleDefFactory=r,i}return Object(r.d)(e,t),e.prototype.create=function(t){!function(){if(!ko){ko=!0;var t=Lt()?{setCurrentNode:Qo,createRootView:Oo,createEmbeddedView:Ao,createComponentView:Po,createNgModuleRef:Do,overrideProvider:Mo,overrideComponentView:Lo,clearOverrides:Fo,checkAndUpdateView:Bo,checkNoChangesView:Wo,destroyView:zo,createDebugContext:function(t,e){return new ra(t,e)},handleEvent:Yo,updateDirectives:Xo,updateRenderer:Jo}:{setCurrentNode:function(){},createRootView:Io,createEmbeddedView:ao,createComponentView:uo,createNgModuleRef:gi,overrideProvider:ur,overrideComponentView:ur,clearOverrides:ur,checkAndUpdateView:po,checkNoChangesView:fo,destroyView:bo,createDebugContext:function(t,e){return new ra(t,e)},handleEvent:function(t,e,n,r){return t.def.handleEvent(t,e,n,r)},updateDirectives:function(t,e){return t.def.updateDirectives(0===e?Vo:qo,t)},updateRenderer:function(t,e){return t.def.updateRenderer(0===e?Vo:qo,t)}};ir.setCurrentNode=t.setCurrentNode,ir.createRootView=t.createRootView,ir.createEmbeddedView=t.createEmbeddedView,ir.createComponentView=t.createComponentView,ir.createNgModuleRef=t.createNgModuleRef,ir.overrideProvider=t.overrideProvider,ir.overrideComponentView=t.overrideComponentView,ir.clearOverrides=t.clearOverrides,ir.checkAndUpdateView=t.checkAndUpdateView,ir.checkNoChangesView=t.checkNoChangesView,ir.destroyView=t.destroyView,ir.resolveDep=Fi,ir.createDebugContext=t.createDebugContext,ir.handleEvent=t.handleEvent,ir.updateDirectives=t.updateDirectives,ir.updateRenderer=t.updateRenderer,ir.dirtyParentQueries=Hi}}();var e=function(t){var e=Array.from(t.providers),n=Array.from(t.modules),r={};for(var i in t.providersByKey)r[i]=t.providersByKey[i];return{factory:t.factory,isRoot:t.isRoot,providers:e,modules:n,providersByKey:r}}
1(xr(this._ngModuleDefFactory));return ir.createNgModuleRef(this.moduleType,t||tt.NULL,this._bootstrapComponents,e)},e}(Ct)},CqG3:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}(n("tct4"))},D4gr:function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var r=n("0/uQ"),i=n("htu+"),o=n("67Y/"),a=n("mZXl"),s=n("fvl4"),u=n("UdJG"),c=function(){function t(t,e){this.ref=t,this.afs=e}return t.prototype.set=function(t,e){return this.ref.set(t,e)},t.prototype.update=function(t){return this.ref.update(t)},t.prototype.delete=function(){return this.ref.delete()},t.prototype.collection=function(t,e){var n=this.ref.collection(t),r=Object(s.i)(n,e);return new u.a(r.ref,r.query,this.afs)},t.prototype.snapshotChanges=function(){return Object(i.b)(this.ref,this.afs.schedulers.outsideAngular).pipe(this.afs.keepUnstableUntilFirst)},t.prototype.valueChanges=function(){return this.snapshotChanges().pipe(Object(o.a)((function(t){return t.payload.data()})))},t.prototype.get=function(t){return Object(r.a)(this.ref.get(t)).pipe(Object(a.a)(this.afs.schedulers.insideAngular))},t}()},DKTb:function(t,e,n){"use strict";function r(t){setTimeout((function(){throw t}))}n.d(e,"a",(function(){return r}))},Ehmk:function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r,i=n("eihs");function o(){try{return r.apply(this,arguments)}catch(t){return i.a.e=t,i.a}}function a(t){return r=t,o}},"En8+":function(t,e,n){"use strict";function r(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}n.d(e,"a",(function(){return i}));var i=r()},"F/XL":function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r=n("nkY7"),i=n("IUTb"),o=n("G5J1"),a=n("PU8L");function s(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t[t.length-1];switch(Object(r.a)(n)?t.pop():n=void 0,t.length){case 0:return Object(o.b)(n);case 1:return n?Object(i.a)(t,n):Object(a.a)(t[0]);default:return Object(i.a)(t,n)}}},FFOo:function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var r=n("mrSG"),i=n("2Bdj"),o=n("6ahw"),a=n("pugT"),s=n("L/V9"),u=n("iLxQ"),c=n("DKTb"),l=function(t){function e(n,r,i){var a=t.call(this)||this;switch(a.syncErrorValue=null,a.syncErrorThrown=!1,a.syncErrorThrowable=!1,a.isStopped=!1,a._parentSubscription=null,arguments.length){case 0:a.destination=o.a;break;case 1:if(!n){a.destination=o.a;break}if("object"==typeof n){n instanceof e?(a.syncErrorThrowable=n.syncErrorThrowable,a.destination=n,n.add(a)):(a.syncErrorThrowable=!0,a.destination=new h(a,n));break}default:a.syncErrorThrowable=!0,a.destination=new h(a,n,r,i)}return a}return r.d(e,t),e.prototype[s.a]=function(){return this},e.create=function(t,n,r){var i=new e(t,n,r);return i.syncErrorThrowable=!1,i},e.prototype.next=function(t){this.isStopped||this._next(t)},e.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this))},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){this.destination.error(t),this.unsubscribe()},e.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},e.prototype._unsubscribeAndRecycle=function(){var t=this._parent,e=this._parents;return this._parent=null,this._parents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parent=t,this._parents=e,this._parentSubscription=null,this},e}(a.a),h=function(t){function e(e,n,r,a){var s,u=t.call(this)||this;u._parentSubscriber=e;var c=u;return Object(i.a)(n)?s=n:n&&(s=n.next,r=n.error,a=n.complete,n!==o.a&&(c=Object.create(n),Object(i.a)(c.unsubscribe)&&u.add(c.unsubscribe.bind(c)),c.unsubscribe=u.unsubscribe.bind(u))),u._context=c,u._next=s,u._error=r,u._complete=a,u}return r.d(e,t),e.prototype.next=function(t){if(!this.isStopped&&this._next){var e=this._parentSubscriber;u.a.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?this.__tryOrSetError(e,this._next,t)&&this.unsubscribe():this.__tryOrUnsub(this._next,t)}},e.prototype.error=function(t){if(!this.isStopped){var e=this._parentSubscriber,n=u.a.useDeprecatedSynchronousErrorHandling;if(this._error)n&&e.syncErrorThrowable?(this.__tryOrSetError(e,this._error,t),this.unsubscribe()):(this.__tryOrUnsub(this._error,t),this.unsubscribe());else if(e.syncErrorThrowable)n?(e.syncErrorValue=t,e.syncErrorThrown=!0):Object(c.a)(t),this.unsubscribe();else{if(this.unsubscribe(),n)throw t;Object(c.a)(t)}}},e.prototype.complete=function(){var t=this;if(!this.isStopped){var e=this._parentSubscriber;if(this._complete){var n=function(){return t._complete.call(t._context)};u.a.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?(this.__tryOrSetError(e,n),this.unsubscribe()):(this.__tryOrUnsub(n),this.unsubscribe())}else this.unsubscribe()}},e.prototype.__tryOrUnsub=function(t,e){try{t.call(this._context,e)}catch(n){if(this.unsubscribe(),u.a.useDeprecatedSynchronousErrorHandling)throw n;Object(c.a)(n)}},e.prototype.__tryOrSetError=function(t,e,n){if(!u.a.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{e.call(this._context,n)}catch(r){return u.a.useDeprecatedSynchronousErrorHandling?(t.syncErrorValue=r,t.syncErrorThrown=!0,!0):(Object(c.a)(r),!0)}return!1},e.prototype._unsubscribe=function(){var t=this._parentSubscriber;this._context=null,this._parentSubscriber=null,t.unsubscribe()},e}(l)},FTyF:function(t,e,n){var r=n("I1rR");r(r.S+r.F,"Object",{assign:n("74FJ")})},FX7f:function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var r=n("mrSG"),i=n("wSPg"),o=function(t,e,n){t.style.setProperty(e,n)},a=function(t,e){t.style.removeProperty(e)},s=[],u=function(t,e){if(void 0===t&&(t=[]),void 0!==e){var n=Array.isArray(e)?e:[e];return Object(r.j)(t,n)}return t},c=function(){var t,e,n,c,l,h,f,d,p,m,y,v,g,b=[],w=[],_=[],S=!1,C={},E=[],T=[],k={},I=0,O=!1,x=!1,A=!0,P=!1,D=!0,R=[],N=[],j=[],M=[],L=[],F=[],U=[],V=[],q=[],B=[],W="function"==typeof AnimationEffect||"function"==typeof window.AnimationEffect,z="function"==typeof Element&&"function"==typeof Element.prototype.animate&&W,H=function(t,e){return(e&&e.oneTimeCallback?N:R).push({c:t,o:e}),g}
vendor: 1,794 bytes, line 1
1,$=function(){if(z)B.forEach((function(t){t.cancel()})),B.length=0;else{var t=j.slice();Object(i.k)((function(){t.forEach((function(t){a(t,"animation-name"),a(t,"animation-duration"),a(t,"animation-timing-function"),a(t,"animation-iteration-count"),a(t,"animation-delay"),a(t,"animation-play-state"),a(t,"animation-fill-mode"),a(t,"animation-direction")}))}))}},K=function(){L.forEach((function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})),L.length=0},G=function(){return void 0!==l?l:f?f.getFill():"both"},Q=function(){return void 0!==p?p:void 0!==h?h:f?f.getDirection():"normal"},Y=function(){return O?"linear":void 0!==n?n:f?f.getEasing():"linear"},X=function(){return x?0:void 0!==m?m:void 0!==e?e:f?f.getDuration():0},J=function(){return void 0!==c?c:f?f.getIterations():1},Z=function(){return void 0!==y?y:void 0!==t?t:f?f.getDelay():0},tt=function(){0!==I&&0==--I&&(function(){var t,e,n;st(),V.forEach((function(t){t()})),q.forEach((function(t){t()})),t=E,e=T,n=k,j.forEach((function(r){var i=r.classList;for(var a in t.forEach((function(t){return i.add(t)})),e.forEach((function(t){return i.remove(t)})),n)n.hasOwnProperty(a)&&o(r,a,n[a])}));var r=A?1:0;R.forEach((function(t){return t.c(r,g)})),N.forEach((function(t){return t.c(r,g)})),N.length=0,D=!0,P=!0}(),f&&f.animationFinish())},et=function(t){var e,n,r;void 0===t&&(t=!0),F.forEach((function(t){t()})),U.forEach((function(t){t()})),e=w,n=_,r=C,j.forEach((function(t){var i=t.classList;for(var a in e.forEach((function(t){return i.add(t)})),n.forEach((function(t){return i.remove(t)})),r)r.hasOwnProperty(a)&&o(t,a,r[a])})),b.length>0&&(z?(j.forEach((function(t){var e=t.animate(b,{delay:Z(),duration:X(),easing:Y(),iterations:J(),fill:G(),direction:Q()});e.pause(),B.push(e)})),B.length>0&&(B[0].onfinish=function(){tt()}
1)):function(t){void 0===t&&(t=!0),K(),j.forEach((function(e){if(b.length>0){var n=(void 0===(u=b)&&(u=[]),u.map((function(t){var e=t.offset,n=[];for(var r in t)t.hasOwnProperty(r)&&"offset"!==r&&n.push(r+": "+t[r]+";");return 100*e+"% { "+n.join(" ")+" }"})).join(" ")),r=function(t,e,n){var r=function(t){var e=t.getRootNode();return e.head||e}(n),i=r.querySelector("#"+t);if(i)return i;var o=(n.ownerDocument||document).createElement("style");return o.id=t,o.textContent="@keyframes "+t+" { "+e+" } @keyframes "+t+"-alt { "+e+" }",r.appendChild(o),o}(v=function(t){var e=s.indexOf(t);return e<0&&(e=s.push(t)-1),"ion-animation-"+e}(n),n,e);L.push(r),o(e,"animation-duration",X()+"ms"),o(e,"animation-timing-function",Y()),o(e,"animation-delay",Z()+"ms"),o(e,"animation-fill-mode",G()),o(e,"animation-direction",Q());var a=J()===1/0?"infinite":J().toString();o(e,"animation-iteration-count",a),o(e,"animation-play-state","paused"),t&&o(e,"animation-name",r.id+"-alt"),Object(i.k)((function(){o(e,"animation-name",r.id||null)}))}var u}))}(t)),S=!0},nt=function(t){if(t=Math.min(Math.max(t,0),.999),z)B.forEach((function(e){e.currentTime=e.effect.getComputedTiming().delay+X()*t,e.pause()}));else{var e="-"+((Z()||0)+X()*t)+"ms";j.forEach((function(t){b.length>0&&(o(t,"animation-delay",e),o(t,"animation-play-state","paused"))}))}},rt=function(t){void 0===t&&(t=!0),j.forEach((function(e){Object(i.k)((function(){o(e,"animation-name",v||null),o(e,"animation-duration",X()+"ms"),o(e,"animation-timing-function",Y()),o(e,"animation-delay",Z()+"ms"),o(e,"animation-fill-mode",G()||null),o(e,"animation-direction",Q()||null);var n=J()===1/0?"infinite":J().toString();o(e,"animation-iteration-count",n),t&&o(e,"animation-name",v+"-alt"),Object(i.k)((function(){o(e,"animation-name",v||null)}))}))}))},it=function(t,e){return void 0===t&&(t=!1),void 0===e&&(e=!0),t&&M.forEach((function(e){e.update(t)})),z?B.forEach((function(t){t.effect.updateTiming({delay:Z(),duration:X(),easing:Y(),iterations:J(),fill:G(),direction:Q()})})):rt(e),g},ot=function(){S&&(z?B.forEach((function(t){t.pause()})):j.forEach((function(t){o(t,"animation-play-state","paused")})))},at=function(){d=void 0,tt()},st=function(){d&&clearTimeout(d)},ut=function(t){return new Promise((function(e){t&&t.sync&&(x=!0,H((function(){return x=!1}),{oneTimeCallback:!0})),S||et(),P&&(z?nt(0):rt(),P=!1),D&&(I=M.length+1,D=!1),H((function(){return e()}),{oneTimeCallback:!0}),M.forEach((function(t){t.play()})),z?(B.forEach((function(t){t.play()})),0!==b.length&&0!==j.length||tt()):function(){if(st(),j.forEach((function(t){b.length>0&&Object(i.k)((function(){o(t,"animation-play-state","running")}))})),0===b.length||0===j.length)tt();else{var t=Z()||0,e=X()||0,n=J()||1;d=setTimeout(at,t+e*n+100),s=function(){st(),Object(i.k)((function(){j.forEach((function(t){a(t,"animation-duration"),a(t,"animation-delay"),a(t,"animation-play-state")})),Object(i.k)(tt)}))},c={passive:!0},l=function(){u&&u()},h=function(t){r===t.target&&(l(),s())},(r=j[0])&&(r.addEventListener("webkitAnimationEnd",h,c),r.addEventListener("animationend",h,c),u=function(){r.removeEventListener("webkitAnimationEnd",h,c),r.removeEventListener("animationend",h,c)})}var r,s,u,c,l,h}()}))},ct=function(t,e){var n,i=b[0];return void 0!==i&&0===i.offset?i[t]=e:b=Object(r.j)([(n={offset:0},n[t]=e,n)],b),g};return g={parentAnimation:f,elements:j,childAnimations:M,animationFinish:tt,from:ct,to:function(t,e){var n,i=b[b.length-1];return void 0!==i&&1===i.offset?i[t]=e:b=Object(r.j)(b,[(n={offset:1},n[t]=e,n)]),g},fromTo:function(t,e,n){return ct(t,e).to(t,n)},parent:function(t){return f=t,g},play:ut,playAsync:function(){return ut()},playSync:function(){return ut({sync:!0}),g},pause:function(){return M.forEach((function(t){t.pause()})),ot(),g},stop:function(){M.forEach((function(t){t.stop()})),S&&($(),S=!1)},destroy:function(){return M.forEach((function(t){t.destroy()})),$(),K(),j.length=0,M.length=0,b.length=0,R.length=0,N.length=0,S=!1,D=!0,g},keyframes:function(t){return b=t,g},addAnimation:function(t){if(null!=t)if(Array.isArray(t))for(var e=0,n=t;e<n.length;e++){var r=n[e];r.parent(g),M.push(r)}else t.parent(g),M.push(t);return g},addElement:function(t){if(null!=t)if(1===t.nodeType)j.push(t);else if(t.length>=0)for(var e=0;e<t.length;e++)j.push(t[e]);else console.error("Invalid addElement value");return g},update:it,fill:function(t){return l=t,it(!0),g},direction:function(t){return h=t,it(!0),g},iterations:function(t){return c=t,it(!0),g},duration:function(t){return z||0!==t||(t=1),e=t,it(!0),g},easing:function(t){return n=t,it(!0),g},delay:function(e){return t=e,it(!0),g},getWebAnimations:function(){return B},getKeyframes:function(){return b}
1,getFill:G,getDirection:Q,getDelay:Z,getIterations:J,getEasing:Y,getDuration:X,afterAddRead:function(t){return V.push(t),g},afterAddWrite:function(t){return q.push(t),g},afterClearStyles:function(t){void 0===t&&(t=[]);for(var e=0,n=t;e<n.length;e++)k[n[e]]="";return g},afterStyles:function(t){return void 0===t&&(t={}),k=t,g},afterRemoveClass:function(t){return T=u(T,t),g},afterAddClass:function(t){return E=u(E,t),g},beforeAddRead:function(t){return F.push(t),g},beforeAddWrite:function(t){return U.push(t),g},beforeClearStyles:function(t){void 0===t&&(t=[]);for(var e=0,n=t;e<n.length;e++)C[n[e]]="";return g},beforeStyles:function(t){return void 0===t&&(t={}),C=t,g},beforeRemoveClass:function(t){return _=u(_,t),g},beforeAddClass:function(t){return w=u(w,t),g},onFinish:H,progressStart:function(t){return void 0===t&&(t=!1),M.forEach((function(e){e.progressStart(t)})),ot(),O=t,S?(it(),nt(0)):et(),g},progressStep:function(t){return M.forEach((function(e){e.progressStep(t)})),nt(t),g},progressEnd:function(t,e,n){return O=!1,M.forEach((function(r){r.progressEnd(t,e,n)})),void 0!==n&&(m=n),P=!1,(A=1===t)?z||(y=e*X()*-1,it(!1,!1)):(p="reverse"===Q()?"normal":"reverse",z?(it(),nt(1-e)):(y=(1-e)*X()*-1,it(!1,!1))),H((function(){A=!0,m=void 0,p=void 0,y=void 0}),{oneTimeCallback:!0}),f||ut(),g}}}},Fxb1:function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var r=n("6blF"),i=n("+tJ4"),o=n("S5XQ"),a=n("u67D"),s=n("JcRv"),u=n("2ePl"),c=n("/WYv"),l=n("McSo"),h=n("En8+"),f=n("xTla"),d=function(t){if(t instanceof r.a)return function(e){return t._isScalar?(e.next(t.value),void e.complete()):t.subscribe(e)};if(t&&"function"==typeof t[f.a])return Object(s.a)(t);if(Object(u.a)(t))return Object(i.a)(t);if(Object(c.a)(t))return Object(o.a)(t);if(t&&"function"==typeof t[h.a])return Object(a.a)(t);var e=Object(l.a)(t)?"an invalid object":"'"+t+"'";throw new TypeError("You provided "+e+" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.")}},G5J1:function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return o}));var r=n("6blF"),i=new r.a((function(t){return t.complete()}));function o(t){return t?function(t){return new r.a((function(e){return t.schedule((function(){return e.complete()}))}))}(t):i}},GMxU:function(t,e,n){var r=n("Iy4/"),i=n("kSm0").concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,i)}},GShy:function(t,e,n){var r=n("9Aud"),i=n("lv+R"),o=n("UOZm");t.exports=function(t){var e=r(t),n=i.f;if(n)for(var a,s=n(t),u=o.f,c=0;s.length>c;)u.call(t,a=s[c++])&&e.push(a);return e}},GYIZ:function(t,e,n){var r=n("ytDL"),i=n("xGvh");t.exports=n("lIov")?function(t,e,n){return r.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},H1Af:function(t,e,n){var r=n("gYfK");t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},Hh92:function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=function(){return function(t,e,n,r,i,o,a,s){this.zipcode=t,this.prefcode=e,this.address1=n,this.address2=r,this.address3=i,this.kana1=o,this.kana2=a,this.kana3=s}}(),i=function(){function t(t,e){this.http=t,this.jsonp=e,console.log("Hello ZipadrProvider Provider")}return t.prototype.searchZipAdr=function(t){var e=this;return new Promise((function(n,i){if(t&&null!=t.match(/[0-9]{7}/)){var o="https://madefor.github.io/postal-code-api/api/v1/"+t.substr(0,3)+"/"+t.substr(3,4)+".json";e.http.get(o).subscribe((function(e){n(e.data.map((function(e){return new r(t,e.prefcode,e.ja.prefecture+e.ja.address1,e.ja.address2+e.ja.address3,e.ja.address4,e.ja.prefecture+e.ja.address1,e.ja.address2+e.ja.address3,e.ja.address4)})))}),(function(t){console.error(t),i()}))}else i()}))},t}()},I1rR:function(t,e,n){var r=n("qtiw"),i=n("Autd"),o=n("GYIZ"),a=n("TDVo"),s=n("6CFf"),u=function(t,e,n){var c,l,h,f,d=t&u.F,p=t&u.G,m=t&u.P,y=t&u.B,v=p?r:t&u.S?r[e]||(r[e]={}):(r[e]||{}).prototype,g=p?i:i[e]||(i[e]={}),b=g.prototype||(g.prototype={});for(c in p&&(n=e),n)h=((l=!d&&v&&void 0!==v[c])?v:n)[c],f=y&&l?s(h,r):m&&"function"==typeof h?s(Function.call,h):h,v&&a(v,c,h,t&u.U),g[c]!=h&&o(g,c,f),m&&b[c]!=h&&(b[c]=h)};r.core=i,u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,t.exports=u},IUTb:function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r=n("6blF"),i=n("pugT"),o=n("+tJ4");function a(t,e){return new r.a(e?function(n){var r=new i.a,o=0;return r.add(e.schedule((function(){o!==t.length?(n.next(t[o++]),n.closed||r.add(this.schedule())):n.complete()}
1))),r}:Object(o.a)(t))}},IiNp:function(t,e,n){var r=n("Zp05");t.exports=function(t,e){if(!r(t))return t;var n,i;if(e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;if("function"==typeof(n=t.valueOf)&&!r(i=n.call(t)))return i;if(!e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;throw TypeError("Can't convert object to primitive value")}},Ip0R:function(t,e,n){"use strict";n.d(e,"s",(function(){return v})),n.d(e,"j",(function(){return b})),n.d(e,"k",(function(){return g})),n.d(e,"t",(function(){return w})),n.d(e,"b",(function(){return A})),n.d(e,"h",(function(){return S})),n.d(e,"i",(function(){return E})),n.d(e,"l",(function(){return O})),n.d(e,"m",(function(){return x})),n.d(e,"c",(function(){return P})),n.d(e,"r",(function(){return D})),n.d(e,"q",(function(){return R})),n.d(e,"p",(function(){return N})),n.d(e,"o",(function(){return o})),n.d(e,"e",(function(){return a})),n.d(e,"g",(function(){return s})),n.d(e,"a",(function(){return u})),n.d(e,"d",(function(){return h})),n.d(e,"n",(function(){return f})),n.d(e,"f",(function(){return c}));var r=n("CcnG"),i=n("mrSG"),o=function(){return function(){}}(),a=new r.p("Location Initialized"),s=function(){return function(){}}(),u=new r.p("appBaseHref"),c=function(){function t(t){var n=this;this._subject=new r.m,this._platformStrategy=t;var i=this._platformStrategy.getBaseHref();this._baseHref=e.stripTrailingSlash(l(i)),this._platformStrategy.onPopState((function(t){n._subject.emit({url:n.path(!0),pop:!0,state:t.state,type:t.type})}))}var e;return e=t,t.prototype.path=function(t){return void 0===t&&(t=!1),this.normalize(this._platformStrategy.path(t))},t.prototype.isCurrentPathEqualTo=function(t,n){return void 0===n&&(n=""),this.path()==this.normalize(t+e.normalizeQueryParams(n))},t.prototype.normalize=function(t){return e.stripTrailingSlash(function(t,e){return t&&e.startsWith(t)?e.substring(t.length):e}(this._baseHref,l(t)))},t.prototype.prepareExternalUrl=function(t){return t&&"/"!==t[0]&&(t="/"+t),this._platformStrategy.prepareExternalUrl(t)},t.prototype.go=function(t,e,n){void 0===e&&(e=""),void 0===n&&(n=null),this._platformStrategy.pushState(n,"",t,e)},t.prototype.replaceState=function(t,e,n){void 0===e&&(e=""),void 0===n&&(n=null),this._platformStrategy.replaceState(n,"",t,e)},t.prototype.forward=function(){this._platformStrategy.forward()},t.prototype.back=function(){this._platformStrategy.back()},t.prototype.subscribe=function(t,e,n){return this._subject.subscribe({next:t,error:e,complete:n})},t.normalizeQueryParams=function(t){return t&&"?"!==t[0]?"?"+t:t},t.joinWithSlash=function(t,e){if(0==t.length)return e;if(0==e.length)return t;var n=0;return t.endsWith("/")&&n++,e.startsWith("/")&&n++,2==n?t+e.substring(1):1==n?t+e:t+"/"+e},t.stripTrailingSlash=function(t){var e=t.match(/#|\?|$/),n=e&&e.index||t.length;return t.slice(0,n-("/"===t[n-1]?1:0))+t.slice(n)},t}();function l(t){return t.replace(/\/index.html$/,"")}var h=function(t){function e(e,n){var r=t.call(this)||this;return r._platformLocation=e,r._baseHref="",null!=n&&(r._baseHref=n),r}return Object(i.d)(e,t),e.prototype.onPopState=function(t){this._platformLocation.onPopState(t),this._platformLocation.onHashChange(t)}
vendor: 9,643 bytes, line 1
1,e.prototype.getBaseHref=function(){return this._baseHref},e.prototype.path=function(t){void 0===t&&(t=!1);var e=this._platformLocation.hash;return null==e&&(e="#"),e.length>0?e.substring(1):e},e.prototype.prepareExternalUrl=function(t){var e=c.joinWithSlash(this._baseHref,t);return e.length>0?"#"+e:e},e.prototype.pushState=function(t,e,n,r){var i=this.prepareExternalUrl(n+c.normalizeQueryParams(r));0==i.length&&(i=this._platformLocation.pathname),this._platformLocation.pushState(t,e,i)},e.prototype.replaceState=function(t,e,n,r){var i=this.prepareExternalUrl(n+c.normalizeQueryParams(r));0==i.length&&(i=this._platformLocation.pathname),this._platformLocation.replaceState(t,e,i)},e.prototype.forward=function(){this._platformLocation.forward()},e.prototype.back=function(){this._platformLocation.back()},e}(s),f=function(t){function e(e,n){var r=t.call(this)||this;if(r._platformLocation=e,null==n&&(n=r._platformLocation.getBaseHrefFromDOM()),null==n)throw new Error("No base href set. Please provide a value for the APP_BASE_HREF token or add a base element to the document.");return r._baseHref=n,r}return Object(i.d)(e,t),e.prototype.onPopState=function(t){this._platformLocation.onPopState(t),this._platformLocation.onHashChange(t)},e.prototype.getBaseHref=function(){return this._baseHref},e.prototype.prepareExternalUrl=function(t){return c.joinWithSlash(this._baseHref,t)},e.prototype.path=function(t){void 0===t&&(t=!1);var e=this._platformLocation.pathname+c.normalizeQueryParams(this._platformLocation.search),n=this._platformLocation.hash;return n&&t?""+e+n:e},e.prototype.pushState=function(t,e,n,r){var i=this.prepareExternalUrl(n+c.normalizeQueryParams(r));this._platformLocation.pushState(t,e,i)},e.prototype.replaceState=function(t,e,n,r){var i=this.prepareExternalUrl(n+c.normalizeQueryParams(r));this._platformLocation.replaceState(t,e,i)},e.prototype.forward=function(){this._platformLocation.forward()},e.prototype.back=function(){this._platformLocation.back()},e}(s),d=void 0,p=["en",[["a","p"],["AM","PM"],d],[["AM","PM"],d,d],[["S","M","T","W","T","F","S"],["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],["Su","Mo","Tu","We","Th","Fr","Sa"]],d,[["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"]],d,[["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}",d,"{1} 'at' {0}",d],[".",",",";","%","+","-","E","\xd7","\u2030","\u221e","NaN",":"],["#,##0.###","#,##0%","\xa4#,##0.00","#E0"],"$","US Dollar",{},function(t){var e=Math.floor(Math.abs(t)),n=t.toString().replace(/^[^.]*\.?/,"").length;return 1===e&&0===n?1:5}],m={},y=function(t){return t[t.Zero=0]="Zero",t[t.One=1]="One",t[t.Two=2]="Two",t[t.Few=3]="Few",t[t.Many=4]="Many",t[t.Other=5]="Other",t}({}),v=new r.p("UseV4Plurals"),g=function(){return function(){}}(),b=function(t){function e(e,n){var r=t.call(this)||this;return r.locale=e,r.deprecatedPluralFn=n,r}return Object(i.d)(e,t),e.prototype.getPluralCategory=function(t,e){switch(this.deprecatedPluralFn?this.deprecatedPluralFn(e||this.locale,t):function(t){return function(t){var e=t.toLowerCase().replace(/_/g,"-"),n=m[e];if(n)return n;var r=e.split("-")[0];if(n=m[r])return n;if("en"===r)return p;throw new Error('Missing locale data for the locale "'+t+'".')}(t)[18]}(e||this.locale)(t)){case y.Zero:return"zero";case y.One:return"one";case y.Two:return"two";case y.Few:return"few";case y.Many:return"many";default:return"other"}},e}(g);function w(t,e){var n,r;e=encodeURIComponent(e);try{for(var o=Object(i.k)(t.split(";")),a=o.next();!a.done;a=o.next()){var s=a.value,u=s.indexOf("="),c=Object(i.h)(-1==u?[s,""]:[s.slice(0,u),s.slice(u+1)],2),l=c[1];if(c[0].trim()===e)return decodeURIComponent(l)}}catch(h){n={error:h}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return null}var _=function(){function t(t,e,n,r){this.$implicit=t,this.ngForOf=e,this.index=n,this.count=r}return Object.defineProperty(t.prototype,"first",{get:function(){return 0===this.index},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"last",{get:function(){return this.index===this.count-1},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"even",{get:function(){return this.index%2==0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"odd",{get:function(){return!this.even},enumerable:!0,configurable:!0}),t}(),S=function(){function t(t,e,n){this._viewContainer=t,this._template=e,this._differs=n,this._ngForOfDirty=!0,this._differ=null}return Object.defineProperty(t.prototype,"ngForOf",{set:function(t){this._ngForOf=t,this._ngForOfDirty=!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ngForTrackBy",{get:function(){return this._trackByFn},set:function(t){Object(r.X)()&&null!=t&&"function"!=typeof t&&console&&console.warn&&console.warn("trackBy must be a function, but received "+JSON.stringify(t)+". See https://angular.io/docs/ts/latest/api/common/index/NgFor-directive.html#!#change-propagation for more information."),this._trackByFn=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ngForTemplate",{set:function(t){t&&(this._template=t)},enumerable:!0,configurable:!0}),t.prototype.ngDoCheck=function(){if(this._ngForOfDirty){this._ngForOfDirty=!1;var t=this._ngForOf;if(!this._differ&&t)try{this._differ=this._differs.find(t).create(this.ngForTrackBy)}catch(r){throw new Error("Cannot find a differ supporting object '"+t+"' of type '"+((e=t).name||typeof e)+"'. NgFor only supports binding to Iterables such as Arrays.")}}var e;if(this._differ){var n=this._differ.diff(this._ngForOf);n&&this._applyChanges(n)}},t.prototype._applyChanges=function(t){var e=this,n=[];t.forEachOperation((function(t,r,i){if(null==t.previousIndex){var o=e._viewContainer.createEmbeddedView(e._template,new _(null,e._ngForOf,-1,-1),i),a=new C(t,o);n.push(a)}else null==i?e._viewContainer.remove(r):(o=e._viewContainer.get(r),e._viewContainer.move(o,i),a=new C(t,o),n.push(a))}));for(var r=0;r<n.length;r++)this._perViewChange(n[r].view,n[r].record);r=0;for(var i=this._viewContainer.length;r<i;r++){var o=this._viewContainer.get(r);o.context.index=r,o.context.count=i,o.context.ngForOf=this._ngForOf}t.forEachIdentityChange((function(t){e._viewContainer.get(t.currentIndex).context.$implicit=t.item}))},t.prototype._perViewChange=function(t,e){t.context.$implicit=e.item},t.ngTemplateContextGuard=function(t,e){return!0},t}(),C=function(){return function(t,e){this.record=t,this.view=e}}(),E=function(){function t(t,e){this._viewContainer=t,this._context=new T,this._thenTemplateRef=null,this._elseTemplateRef=null,this._thenViewRef=null,this._elseViewRef=null,this._thenTemplateRef=e}return Object.defineProperty(t.prototype,"ngIf",{set:function(t){this._context.$implicit=this._context.ngIf=t,this._updateView()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ngIfThen",{set:function(t){k("ngIfThen",t),this._thenTemplateRef=t,this._thenViewRef=null,this._updateView()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ngIfElse",{set:function(t){k("ngIfElse",t),this._elseTemplateRef=t,this._elseViewRef=null,this._updateView()},enumerable:!0,configurable:!0}),t.prototype._updateView=function(){this._context.$implicit?this._thenViewRef||(this._viewContainer.clear(),this._elseViewRef=null,this._thenTemplateRef&&(this._thenViewRef=this._viewContainer.createEmbeddedView(this._thenTemplateRef,this._context))):this._elseViewRef||(this._viewContainer.clear(),this._thenViewRef=null,this._elseTemplateRef&&(this._elseViewRef=this._viewContainer.createEmbeddedView(this._elseTemplateRef,this._context)))},t.ngTemplateGuard_ngIf=function(t,e){return!0},t}(),T=function(){return function(){this.$implicit=null,this.ngIf=null}}();function k(t,e){if(e&&!e.createEmbeddedView)throw new Error(t+" must be a TemplateRef, but received '"+Object(r.Db)(e)+"'.")}var I=function(){function t(t,e){this._viewContainerRef=t,this._templateRef=e,this._created=!1}return t.prototype.create=function(){this._created=!0,this._viewContainerRef.createEmbeddedView(this._templateRef)},t.prototype.destroy=function(){this._created=!1,this._viewContainerRef.clear()},t.prototype.enforceState=function(t){t&&!this._created?this.create():!t&&this._created&&this.destroy()},t}(),O=function(){function t(){this._defaultUsed=!1,this._caseCount=0,this._lastCaseCheckIndex=0,this._lastCasesMatched=!1}return Object.defineProperty(t.prototype,"ngSwitch",{set:function(t){this._ngSwitch=t,0===this._caseCount&&this._updateDefaultCases(!0)},enumerable:!0,configurable:!0}),t.prototype._addCase=function(){return this._caseCount++},t.prototype._addDefault=function(t){this._defaultViews||(this._defaultViews=[]),this._defaultViews.push(t)},t.prototype._matchCase=function(t){var e=t==this._ngSwitch;return this._lastCasesMatched=this._lastCasesMatched||e,this._lastCaseCheckIndex++,this._lastCaseCheckIndex===this._caseCount&&(this._updateDefaultCases(!this._lastCasesMatched),this._lastCaseCheckIndex=0,this._lastCasesMatched=!1),e},t.prototype._updateDefaultCases=function(t){if(this._defaultViews&&t!==this._defaultUsed){this._defaultUsed=t;for(var e=0;e<this._defaultViews.length;e++)this._defaultViews[e].enforceState(t)}},t}(),x=function(){function t(t,e,n){this.ngSwitch=n,n._addCase(),this._view=new I(t,e)}
1return t.prototype.ngDoCheck=function(){this._view.enforceState(this.ngSwitch._matchCase(this.ngSwitchCase))},t}(),A=function(){return function(){}}(),P=new r.p("DocumentToken"),D="browser";function R(t){return"server"===t}var N=function(){function t(){}return t.ngInjectableDef=Object(r.S)({providedIn:"root",factory:function(){return new j(Object(r.W)(P),window,Object(r.W)(r.l))}}),t}(),j=function(){function t(t,e,n){this.document=t,this.window=e,this.errorHandler=n,this.offset=function(){return[0,0]}}return t.prototype.setOffset=function(t){this.offset=Array.isArray(t)?function(){return t}:t},t.prototype.getScrollPosition=function(){return this.supportScrollRestoration()?[this.window.scrollX,this.window.scrollY]:[0,0]},t.prototype.scrollToPosition=function(t){this.supportScrollRestoration()&&this.window.scrollTo(t[0],t[1])},t.prototype.scrollToAnchor=function(t){if(this.supportScrollRestoration()){t=this.window.CSS&&this.window.CSS.escape?this.window.CSS.escape(t):t.replace(/(\"|\'\ |:|\.|\[|\]|,|=)/g,"\\$1");try{var e=this.document.querySelector("#"+t);if(e)return void this.scrollToElement(e);var n=this.document.querySelector("[name='"+t+"']");if(n)return void this.scrollToElement(n)}catch(r){this.errorHandler.handleError(r)}}},t.prototype.setHistoryScrollRestoration=function(t){if(this.supportScrollRestoration()){var e=this.window.history;e&&e.scrollRestoration&&(e.scrollRestoration=t)}},t.prototype.scrollToElement=function(t){var e=t.getBoundingClientRect(),n=e.left+this.window.pageXOffset,r=e.top+this.window.pageYOffset,i=this.offset();this.window.scrollTo(n-i[0],r-i[1])},t.prototype.supportScrollRestoration=function(){try{return!!this.window&&!!this.window.scrollTo}catch(t){return!1}},t}()},"Iy4/":function(t,e,n){var r=n("g0Mr"),i=n("rSCU"),o=n("b/Kf")(!1),a=n("ifzb")("IE_PROTO");t.exports=function(t,e){var n,s=i(t),u=0,c=[];for(n in s)n!=a&&r(s,n)&&c.push(n);for(;e.length>u;)r(s,n=e[u++])&&(~o(c,n)||c.push(n));return c}},JcRv:function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n("xTla"),i=function(t){return function(e){var n=t[r.a]();if("function"!=typeof n.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return n.subscribe(e)}}},JdN0:function(t,e,n){"use strict";n.d(e,"a",(function(){return l})),n("CqG3"),n("Oipj");var r=n("iqUP"),i=n("xXNJ"),o=n("K9Ia"),a=n("67Y/"),s=n("CcnG"),u=n("fvl4"),c=n("ZBkt"),l=function(){function t(t,e){this.afs=t,this.afAuth=e,this.applsession=new i.a,this.applsessionSubject=ne
1w o.a,this.applsessionState=this.applsessionSubject.asObservable(),this.applCollection=this.afs.collection("ApplTentativeUser"),this.doLogCollection=this.afs.collection("doLog")}return t.prototype.getApplUser=function(t){var e=this;return new Promise((function(n,r){e.afs.collection("/ApplTentativeUser").doc(t).valueChanges().subscribe((function(t){n(!0===t.regularMember&&!1===t.cancel?t:null)}),(function(t){n(null)}))}))},t.prototype.getAuthUid=function(){var t=this;return new Promise((function(e,n){return t.afAuth.auth.onAuthStateChanged((function(t){return console.log(t.uid),e(t.uid)}))}))},t.prototype.authMailLogin=function(t){var e=this;return new Promise((function(n,r){e.afAuth.auth.signInWithEmailLink(t,window.location.href).then((function(t){n()})).catch((function(t){r()}))}))},t.prototype.checkEmailLoginState=function(){var t=this;return this.afAuth.authState.pipe(Object(a.a)((function(e){return e?(console.log(e),e.emailVerified?(t.applsession.login=!0,t.applsession.isEmailAuth=e.emailVerified):(t.applsession.login=!1,t.applsession.isEmailAuth=e.emailVerified)):(t.applsession.login=!1,t.applsession.isEmailAuth=e.emailVerified),t.applsession})))},t.prototype.writeDoLog=function(t,e,n){var i=this;return new Promise((function(o,a){var s=window.navigator.userAgent,u={insDt:r.firestore.FieldValue.serverTimestamp(),fromId:t,toId:e,email:n,userAgent:s};i.doLogCollection.add(u).then((function(t){o()})).catch((function(t){a(t)}))}))},t.ngInjectableDef=s.S({factory:function(){return new t(s.W(u.a),s.W(c.a))},token:t,providedIn:"root"}),t}()},Jds6:function(t,e,n){"use strict";n("CqG3"),n("Oipj");var r=n("iqUP"),i=n("67Y/"),o=n("AytR"),a=n("CcnG"),s=n("fvl4"),u=n("ZBkt");n.d(e,"a",(function(){return c}));var c=function(){function t(t,e){this.afs=t,this.afAuth=e,this.paymentUrl="https://gw.ccps.jp/payment.aspx",this.paymentBody=null,this.paymentSid=o.a.paymentId,this.paymentSvid="1",this.paymentPtype="8",this.paymentJob="CAPTURE",this.paymentRt="1",this.paymentsicd2="corp_anual_membership_tax10",this.paymentsicd3="",this.paymentSucd="00011",this.newPaymentID=o.a.newPaymentID,this.newApplID=o.a.applid.join(""),this.baseUrl=o.a.baseUrl,this.tentatives=this.afs.collection("tentativeCorpMember")}return t.prototype.getShopList=function(){this.afs.collection("shopId",(function(t){return t.where("dispKb","==",!0)})).get().pipe(Object(i.a)((function(t){console.log(t)}))).subscribe((function(t){console.log(t)}),(function(t){console.error(t)}))},t.prototype.initService=function(){this.uid="",this.corpNo="",this.corpName="",this.inpName="",this.inpKana="",this.corpTel="",this.corpZipcd="",this.adr="",this.memberRank="",this.memberRankName="",this.creditPid="",this.creditResultInsDt=null,this.creditResult="",this.creditUrl="",this.regularMember=!1,this.email="",this.shopcd="",this.shopname="",this.insDt=null,this.cancel=!1,this.cancelDt=null,this.tel="",this.birthday="",this.sex="",this.sexDspValue="",this.job="",this.position=""},t.prototype.addCorpUser2Fire=function(){var t=this;return new Promise((function(e,n){t.afAuth.auth.signInAnonymously().catch((function(t){n(t)})).then((function(){return t.afAuth.auth.onAuthStateChanged((function(t){if(t)return console.log(t.uid),!0;n("user is logout")}))})).then((function(){return t.uid=t.afs.createId()})).then((function(){return console.log("processPayment"),t.processPaymentCorpUser()})).then((function(e){t.creditUrl=e;var n={uid:t.uid,corpName:t.corpName,inpName:t.inpName,inpKana:t.inpKana,corpTel:t.corpTel,corpZipcd:t.corpZipcd,adr:t.adr,memberRank:t.memberRank,memberRankName:t.memberRankName,creditPid:t.creditPid,creditResultInsDt:t.creditResultInsDt,creditResult:t.creditResult,creditUrl:t.creditUrl,regularMember:t.regularMember,email:t.email,shopcd:t.shopcd,shopname:t.shopname,insDt:r.firestore.FieldValue.serverTimestamp(),cancel:t.cancel,cancelDt:t.cancelDt,tel:t.tel,birthday:t.birthday,sex:t.sex,sexDspValue:t.sexDspValue,job:t.job,position:t.position};return t.tentatives.doc(t.uid).set(n)})).then((function(t){e()})).catch((function(t){n(t)}))}))},t.prototype.processPaymentCorpUser=function(){var t=this;return new Promise((function(e,n){t.paymentSod=t.uid,t.paymentMail=t.email,t.paymentTel=t.corpTel.replace(/-/g,""),t.paymentUid=t.uid,"black"===t.memberRank?t.paymentsicd1="Black_Corp_10_Membership":"gold"===t.memberRank&&(t.paymentsicd1="Gold_Corp_10_Membership");var r="https://checkout.univapay.com/forms/"+t.newPaymentID+"?appId="+t.newApplID;
1r=r+"&productCodes="+t.paymentsicd1,r=(r=(r=(r=(r=(r=(r=(r=(r+="&productQuantities=1")+"&emailAddress="+t.paymentMail)+"&phoneNumber="+t.paymentTel)+"&name="+t.inpName)+"&nameKana="+t.inpKana)+"&sod="+t.paymentSod)+"&successRedirectUrl="+t.baseUrl+"kumamember/appl-corp-end?result=1&pid=0000000&sod="+t.paymentSod)+"&failureRedirectUrl="+t.baseUrl+"kumamember/appl-corp-credit-error")+"&uid="+t.paymentUid,e(r+="&shopid=corp")}))},t.ngInjectableDef=a.S({factory:function(){return new t(a.W(s.a),a.W(u.a))},token:t,providedIn:"root"}),t}()},JiIP:function(t,e,n){"use strict";var r=n("xrBK"),i=n("xGvh"),o=n("A+3H"),a={};n("GYIZ")(a,n("jZgK")("iterator"),(function(){return this})),t.exports=function(t,e,n){t.prototype=r(a,{next:i(1,n)}),o(t,e+" Iterator")}},JilW:function(t,e,n){n("KxBS"),t.exports=n("Autd").String.repeat},K9Ia:function(t,e,n){"use strict";var r=n("mrSG"),i=n("6blF"),o=n("FFOo"),a=n("pugT"),s=n("8g8A"),u=function(t){function e(e,n){var r=t.call(this)||this;return r.subject=e,r.subscriber=n,r.closed=!1,r}return r.d(e,t),e.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var t=this.subject,e=t.observers;if(this.subject=null,e&&0!==e.length&&!t.isStopped&&!t.closed){var n=e.indexOf(this.subscriber);-1!==n&&e.splice(n,1)}}},e}(a.a),c=n("L/V9");n.d(e,"b",(function(){return l})),n.d(e,"a",(function(){return h}));var l=function(t){function e(e){var n=t.call(this,e)||this;return n.destination=e,n}return r.d(e,t),e}(o.a),h=function(t){function e(){var e=t.call(this)||this;return e.observers=[],e.closed=!1,e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return r.d(e,t),e.prototype[c.a]=function(){return new l(this)},e.prototype.lift=function(t){var e=new f(this,this);return e.operator=t,e},e.prototype.next=function(t){if(this.closed)throw new s.a;if(!this.isStopped)for(var e=this.observers,n=e.length,r=e.slice(),i=0;i<n;i++)r[i].next(t)},e.prototype.error=function(t){if(this.closed)throw new s.a;this.hasError=!0,this.thrownError=t,this.isStopped=!0;for(var e=this.observers,n=e.length,r=e.slice(),i=0;i<n;i++)r[i].error(t);this.observers.length=0},e.prototype.complete=function(){if(this.closed)throw new s.a;this.isStopped=!0;for(var t=this.observers,e=t.length,n=t.slice(),r=0;r<e;r++)n[r].complete();this.observers.length=0},e.prototype.unsubscribe=function(){this.isStopped=!0,this.closed=!0,this.observers=null},e.prototype._trySubscribe=function(e){if(this.closed)throw new s.a;return t.prototype._trySubscribe.call(this,e)},e.prototype._subscribe=function(t){if(this.closed)throw new s.a;return this.hasError?(t.error(this.thrownError),a.a.EMPTY):this.isStopped?(t.complete(),a.a.EMPTY):(this.observers.push(t),new u(this,t))},e.prototype.asObservable=function(){var t=new i.a;return t.source=this,t},e.create=function(t,e){return new f(t,e)},e}(i.a),f=function(t){function e(e,n){var r=t.call(this)||this;return r.destination=e,r.source=n,r}return r.d(e,t),e.prototype.next=function(t){var e=this.destination;e&&e.next&&e.next(t)},e.prototype.error=function(t){var e=this.destination;e&&e.error&&this.destination.error(t)},e.prototype.complete=function(){var t=this.destination;t&&t.complete&&this.destination.complete()},e.prototype._subscribe=function(t){return this.source?this.source.subscribe(t):a.a.EMPTY},e}(h)},KBN1:function(t,e,n){"use strict";var r=n("I1rR"),i=n("c0bx"),o=n("flRy"),a="".startsWith;r(r.P+r.F*n("tLdg")("startsWith"),"String",{startsWith:function(t){var e=o(this,t,"startsWith"),n=i(Math.min(arguments.length>1?arguments[1]:void 0,e.length)),r=String(t);return a?a.call(e,r,n):e.slice(n,n+r.length)===r}})},KxBS:function(t,e,n){var r=n("I1rR");r(r.P,"String",{repeat:n("gRXz")})},"L/V9":function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r="function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random()},L97z:function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},LmZi:function(t,e,n){"use strict";n.r(e),n.d(e,"registerStorage",(function(){return Ut}));var r=n("wj3C"),i=n.n(r),o="https://firebasestorage.googleapis.com",a=function(){function t(t,e){this.co
1de_=s(t),this.message_="Firebase Storage: "+e,this.serverResponse_=null,this.name_="FirebaseError"}return t.prototype.codeProp=function(){return this.code},t.prototype.codeEquals=function(t){return s(t)===this.codeProp()},t.prototype.serverResponseProp=function(){return this.serverResponse_},t.prototype.setServerResponseProp=function(t){this.serverResponse_=t},Object.defineProperty(t.prototype,"name",{get:function(){return this.name_},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"code",{get:function(){return this.code_},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"message",{get:function(){return this.message_},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"serverResponse",{get:function(){return this.serverResponse_},enumerable:!0,configurable:!0}),t}();function s(t){return"storage/"+t}function u(){return new a("unknown","An unknown error occurred, please check the error payload for server response.")}function c(){return new a("canceled","User canceled the upload/download.")}function l(){return new a("cannot-slice-blob","Cannot slice blob for upload. Please retry the upload.")}function h(){return new a("no-download-url","The given file does not have any download URLs.")}function f(t,e,n){return new a("invalid-argument","Invalid argument in `"+e+"` at index "+t+": "+n)}function d(){return new a("app-deleted","The Firebase app was deleted.")}function p(t,e){return new a("invalid-format","String does not match format '"+t+"': "+e)}function m(t){throw new a("internal-error","Internal error: "+t)}var y={RAW:"raw",BASE64:"base64",BASE64URL:"base64url",DATA_URL:"data_url"};function v(t){switch(t){case y.RAW:case y.BASE64:case y.BASE64URL:case y.DATA_URL:return;default:throw"Expected one of the event types: ["+y.RAW+", "+y.BASE64+", "+y.BASE64URL+", "+y.DATA_URL+"]."}}var g=function(){return function(t,e){this.data=t,this.contentType=e||null}}();function b(t,e){switch(t){case y.RAW:return new g(w(e));case y.BASE64:case y.BASE64URL:return new g(_(t,e));case y.DATA_URL:return new g(function(t){var e=new S(t);return e.base64?_(y.BASE64,e.rest):function(t){var e;try{e=decodeURIComponent(t)}catch(n){throw p(y.DATA_URL,"Malformed data URL.")}return w(e)}(e.rest)}(e),function(t){return new S(t).contentType}(e))}throw u()}function w(t){for(var e=[],n=0;n<t.length;n++){var r=t.charCodeAt(n);if(r<=127)e.push(r);else if(r<=2047)e.push(192|r>>6,128|63&r);else if(55296==(64512&r))if(n<t.length-1&&56320==(64512&t.charCodeAt(n+1))){var i=r,o=t.charCodeAt(++n);e.push(240|(r=65536|(1023&i)<<10|1023&o)>>18,128|r>>12&63,128|r>>6&63,128|63&r)}else e.push(239,191,189);else 56320==(64512&r)?e.push(239,191,189):e.push(224|r>>12,128|r>>6&63,128|63&r)}return new Uint8Array(e)}function _(t,e){switch(t){case y.BASE64:var n=-1!==e.indexOf("-"),r=-1!==e.indexOf("_");if(n||r)throw p(t,"Invalid character '"+(n?"-":"_")+"' found: is it base64url encoded?");break;case y.BASE64URL:var i=-1!==e.indexOf("+"),o=-1!==e.indexOf("/");if(i||o)throw p(t,"Invalid character '"+(i?"+":"/")+"' found: is it base64 encoded?");e=e.replace(/-/g,"+").replace(/_/g,"/")}var a;try{a=atob(e)}catch(c){throw p(t,"Invalid character found")}for(var s=new Uint8Array(a.length),u=0;u<a.length;u++)s[u]=a.charCodeAt(u);return s}var S=function(){return function(t){this.base64=!1,this.contentType=null;var e=t.match(/^data:([^,]+)?,/);if(null===e)throw p(y.DATA_URL,"Must be formatted 'data:[<mediatype>][;base64],<data>");var n,r=e[1]||null;null!=r&&(this.base64=(n=r).length>=";base64".length&&";base64"===n.substring(n.length-";base64".length),this.contentType=this.base64?r.substring(0,r.length-";base64".length):r),this.rest=t.substring(t.indexOf(",")+1)}}(),C={STATE_CHANGED:"state_changed"},E={RUNNING:"running",PAUSED:"paused",SUCCESS:"success",CANCELED:"canceled",ERROR:"error"};function T(t){switch(t){case"running":case"pausing":case"canceling":return E.RUNNING;case"paused":return E.PAUSED;case"success":return E.SUCCESS;case"canceled":return E.CANCELED;case"error":default:return E.ERROR}}function k(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function I(t,e){for(var n in t)k(t,n)&&e(n,t[n])}function O(t){if(null==t)return{};var e={};return I(t,(function(t,n){e[t]=n})),e}function x(t){return new Promise(t)}function A(t){return Promise.resolve(t)}function P(t){return null!=t}function D(t){return void 0!==t}function R(t){return"function"==typeof t}function N(t){return"object"==typeof t}function j(t){return N(t)&&null!==t}function M(t){return"string"==typeof t||t instanceof String}function L(t){return F()&&t instanceof Blob}function F(){return"undefined"!=typeof Blob}var U=function(t){return t[t.NO_ERROR=0]="NO_ERROR",t[t.NETWORK_E
1RROR=1]="NETWORK_ERROR",t[t.ABORT=2]="ABORT",t}({}),V=function(){function t(){var t=this;this.sent_=!1,this.xhr_=new XMLHttpRequest,this.errorCode_=U.NO_ERROR,this.sendPromise_=x((function(e,n){t.xhr_.addEventListener("abort",(function(n){t.errorCode_=U.ABORT,e(t)})),t.xhr_.addEventListener("error",(function(n){t.errorCode_=U.NETWORK_ERROR,e(t)})),t.xhr_.addEventListener("load",(function(n){e(t)}))}))}return t.prototype.send=function(t,e,n,r){var i=this;if(this.sent_)throw m("cannot .send() more than once");return this.sent_=!0,this.xhr_.open(e,t,!0),P(r)&&I(r,(function(t,e){i.xhr_.setRequestHeader(t,e.toString())})),P(n)?this.xhr_.send(n):this.xhr_.send(),this.sendPromise_},t.prototype.getErrorCode=function(){if(!this.sent_)throw m("cannot .getErrorCode() before sending");return this.errorCode_},t.prototype.getStatus=function(){if(!this.sent_)throw m("cannot .getStatus() before sending");try{return this.xhr_.status}catch(t){return-1}},t.prototype.getResponseText=function(){if(!this.sent_)throw m("cannot .getResponseText() before sending");return this.xhr_.responseText},t.prototype.abort=function(){this.xhr_.abort()},t.prototype.getResponseHeader=function(t){return this.xhr_.getResponseHeader(t)},t.prototype.addUploadProgressListener=function(t){P(this.xhr_.upload)&&this.xhr_.upload.addEventListener("progress",t)},t.prototype.removeUploadProgressListener=function(t){P(this.xhr_.upload)&&this.xhr_.upload.removeEventListener("progress",t)},t}(),q=function(){function t(){}return t.prototype.createXhrIo=function(){return new V},t}();function B(t){var e,n;try{e=JSON.parse(t)}catch(r){return null}return N(n=e)&&!Array.isArray(n)?e:null}var W=function(){function t(t,e){this.bucket=t,this.path_=e}return Object.defineProperty(t.prototype,"path",{get:function(){return this.path_},enumerable:!0,configurable:!0}),t.prototype.fullServerUrl=function(){var t=encodeURIComponent;return"/b/"+t(this.bucket)+"/o/"+t(this.path)},t.prototype.bucketOnlyServerUrl=function(){return"/b/"+encodeURIComponent(this.bucket)+"/o"},t.makeFromBucketSpec=function(e){var n;try{n=t.makeFromUrl(e)}catch(r){return new t(e,"")}if(""===n.path)return n;throw new a("invalid-default-bucket","Invalid default bucket '"+e+"'.")},t.makeFromUrl=function(e){for(var n=null,r=[{regex:new RegExp("^gs://([A-Za-z0-9.\\-_]+)(/(.*))?$","i"),indices:{bucket:1,path:3},postModify:function(t){"/"===t.path.charAt(t.path.length-1)&&(t.path_=t.path_.slice(0,-1))}},{regex:new RegExp("^https?://firebasestorage\\.googleapis\\.com/v[A-Za-z0-9_]+/b/([A-Za-z0-9.\\-_]+)/o(/([^?#]*).*)?$","i"),indices:{bucket:1,path:3},postModify:function(t){t.path_=decodeURIComponent(t.path)}}],i=0;i<r.length;i++){var o=r[i],s=o.regex.exec(e);if(s){var u=s[o.indices.path];u||(u=""),n=new t(s[o.indices.bucket],u),o.postModify(n);break}}if(null==n)throw function(t){return new a("invalid-url","Invalid URL '"+t+"'.")}(e);return n},t}();function z(t,e){var n=e.split("/").filter((function(t){return t.length>0})).join("/");return 0===t.length?n:t+"/"+n}function H(t){var e=t.lastIndexOf("/",t.length-2);return-1===e?t:t.slice(e+1)}function $(t){return o+"/v0"+t}function K(t){return o+"/v0"+t}function G(t){var e=encodeURIComponent,n="?";return I(t,(function(t,r){var i=e(t)+"="+e(r);n=n+i+"&"})),n=n.slice(0,-1)}function Q(t,e){return e}var Y=function(){return function(t,e,n,r){this.server=t,this.local=e||t,this.writable=!!n,this.xform=r||Q}}(),X=null;function J(t,e,n){var r=B(e);return null===r?null:function(t,e,n){for(var r={type:"file"},i=n.length,o=0;o<i;o++){var a=n[o];r[a.local]=a.xform(r,e[a.server])}return function(t,e){Object.defineProperty(t,"ref",{get:function(){var n=new W(t.bucket,t.fullPath);return e.makeStorageReference(n)}})}(r,t),r}(t,r,n)}function Z(t,e){for(var n={},r=e.length,i=0;i<r;i++){var o=e[i];o.writable&&(n[o.server]=t[o.local])}return JSON.stringify(n)}function tt(t){if(!t||!N(t))throw"Expected Metadata object.";for(var e in t){var n=t[e];if("customMetadata"===e){if(!N(n))throw"Expected object for 'customMetadata' mapping."}else if(j(n))throw"Mapping for '"+e+"' cannot be an object."}}function et(t,e,n){for(var r=e.length,i=e.length,o=0;o<e.length;o++)if(e[o].optional){r=o;break}var s,u,c,l;if(!(r<=n.length&&n.length<=i))throw(s=r)===(u=i)?(c=s,l=1===s?"argument":"arguments"):(c="between "+s+" and "+u,l="arguments"),new a("invalid-argument-count","Invalid argument count in `"+t+"`: Expected "+c+" "+l+", received "+n.length+".");for(o=0;o<n.length;o++)try{e[o].validator(n[o])}catch(h){throw h instanceof Error?f(o,t,h.message):f(o,t,h)}}var nt=function(){return function(t,e){var n=this;this.validator=function(e){n.optional&&!D(e)||t(e)},this.optional=!!e}}();function rt(t,e){function n(t){if(!M(t))throw"Expected string."}var r,i,o;return t?(i=n,o=t,r=function(t){i(t),o(t)}):r=n,new nt(r,e)}function it(){return new nt((function(t){if(!(t instanceof Uint8Array||t instanceof ArrayBuffer||F()&&t instanceof Blob))throw"Expected Blob or File."}))}function ot(t){return new nt(tt,t)}function at(){return new nt((function(t){if(!(function(t){return"number"==typeof t||t instanceof Number}(t)&&t>=0))throw"Expected a number 0 or greater."}))}function st(t,e){return new nt((function(e){if(!(null===e||P(e)&&e instanceof Object))throw"Expected an Object.";null!=t&&t(e)}),e)}function ut(t){return new nt((function(t){if(null!==t&&!R(t))throw"Expected a Function."}),t)}function ct(){return"undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof WebKitBlobBuilder?Web
1KitBlobBuilder:void 0}function lt(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=ct();if(void 0!==n){for(var r=new n,i=0;i<t.length;i++)r.append(t[i]);return r.getBlob()}if(F())return new Blob(t);throw Error("This browser doesn't seem to support creating Blobs")}var ht=function(){function t(t,e){var n=0,r="";L(t)?(this.data_=t,n=t.size,r=t.type):t instanceof ArrayBuffer?(e?this.data_=new Uint8Array(t):(this.data_=new Uint8Array(t.byteLength),this.data_.set(new Uint8Array(t))),n=this.data_.length):t instanceof Uint8Array&&(e?this.data_=t:(this.data_=new Uint8Array(t.length),this.data_.set(t)),n=t.length),this.size_=n,this.type_=r}return t.prototype.size=function(){return this.size_},t.prototype.type=function(){return this.type_},t.prototype.slice=function(e,n){if(L(this.data_)){var r=(o=e,a=n,(i=this.data_).webkitSlice?i.webkitSlice(o,a):i.mozSlice?i.mozSlice(o,a):i.slice?i.slice(o,a):null);return null===r?null:new t(r)}var i,o,a;return new t(new Uint8Array(this.data_.buffer,e,n-e),!0)},t.getBlob=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(F()){var r=e.map((function(e){return e instanceof t?e.data_:e}));return new t(lt.apply(null,r))}var i=e.map((function(t){return M(t)?b(y.RAW,t).data:t.data_})),o=0;i.forEach((function(t){o+=t.byteLength}));var a=new Uint8Array(o),s=0;return i.forEach((function(t){for(var e=0;e<t.length;e++)a[s++]=t[e]})),new t(a,!0)},t.prototype.uploadData=function(){return this.data_},t}();function ft(t,e){return-1!==t.indexOf(e)}var dt=function(){return function(t,e,n,r){this.url=t,this.method=e,this.handler=n,this.timeout=r,this.urlParams={},this.headers={},this.body=null,this.errorHandler=null,this.progressCallback=null,this.successCodes=[200],this.additionalRetryCodes=[]}}();function pt(t){if(!t)throw u()}function mt(t,e){return function(n,r){var i=J(t,r,e);return pt(null!==i),i}}function yt(t){return function(e,n){var r;return(r=401===e.getStatus()?new a("unauthenticated","User is not authenticated, please authenticate using Firebase Authentication and try again."):402===e.getStatus()?new a("quota-exceeded","Quota for bucket '"+t.bucket+"' exceeded, please view quota on https://firebase.google.com/pricing/."):403===e.getStatus()?new a("unauthorized","User does not have permission to access '"+t.path+"'."):n).setServerResponseProp(n.serverResponseProp()),r}}function vt(t){var e=yt(t);return function(n,r){var i=e(n,r);return 404===n.getStatus()&&(i=new a("object-not-found","Object '"+t.path+"' does not exist.")),i.setServerResponseProp(r.serverResponseProp()),i}}function gt(t,e,n){var r=$(e.fullServerUrl()),i=t.maxOperationRetryTime(),o=new dt(r,"GET",mt(t,n),i);return o.errorHandler=vt(e),o}function bt(t,e,n){var r=$(e.fullServerUrl()),i=t.maxOperationRetryTime(),o=new dt(r,"GET",function(t,e){return function(n,r){var i=J(t,r,e);return pt(null!==i),function(t,e){var n=B(e);if(null===n)return null;if(!M(n.downloadTokens))return null;var r=n.downloadTokens;if(0===r.length)return null;var i=encodeURIComponent;return r.split(",").map((function(e){var n=t.fullPath;return"https://firebasestorage.googleapis.com/v0/b/"+i(t.bucket)+"/o/"+i(n)+G({alt:"media",token:e})}))[0]}(i,r)}}(t,n),i);return o.errorHandler=vt(e),o}function wt(t,e,n,r){var i=$(e.fullServerUrl()),o=Z(n,r),a=t.maxOperationRetryTime(),s=new dt(i,"PATCH",mt(t,r),a);return s.headers={"Content-Type":"application/json; charset=utf-8"},s.body=o,s.errorHandler=vt(e),s}function _t(t,e){var n=$(e.fullServerUrl()),r=t.maxOperationRetryTime(),i=new dt(n,"DELETE",(function(t,e){}),r);return i.successCodes=[200,204],i.errorHandler=vt(e),i}function St(t,e,n){var r=O(n);return r.fullPath=t.path,r.size=e.size(),r.contentType||(r.contentType=function(t,e){return e&&e.type()||"application/octet-stream"}(0,e)),r}var Ct=function(){return function(t,e,n,r){this.current=t,this.total=e,this.finalized=!!n,this.metadata=r||null}}();function Et(t,e){var n;try{n=t.getResponseHeader("X-Goog-Upload-Status")}catch(r){pt(!1)}return pt(ft(e||["active"],n)),n}var Tt=function(){return function(t,e,n){if(R(t)||P(e)||P(n))this.next=t,this.error=e||null,this.complete=n||null;else{var r=t;this.next=r.next||null,this.error=r.error||null,this.complete=r.complete||null}}}(),kt=function(){return function(t,e,n,r,i,o){this.bytesTransferred=t,this.totalBytes=e,this.state=n,this.metadata=r,this.task=i,this.ref=o}}();function It(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];A(!0).then((function(){t.apply(null,e)}))}}var Ot=function(){function t(t,e,n,r,i,o){void 0===o&&(o=null);var a=this;this.transferred_=0,this.needToFetchStatus_=!1,this.needToFetchMetadata_=!1,this.observers_=[],this.error_=null,this.uploadUrl_=null,this.request_=null,this.chunkMultiplier_=1,this.resolve_=null,this.reject_=null,this.ref_=t,this.authWrapper_=e,this.location_=n,this.blob_=i,this.metadata_=o,this.mappings_=r,this.resumable_=this.shouldDoResumable_(this.blob_),this.state_="running",this.errorHandler_=function(t){a.request_=null,a.chunkMultiplier_=1,t.codeEquals("canceled")?(a.needToFetchStatus_=!0,a.completeTransitions_()):(a.error_=t,a.transition_("error"))},this.metadataErrorHandler_=function(t){a.request_=null,t.codeEquals("canceled")?a.completeTransitions_():(a.error_=t,a.transition_("error"))},this.promise_=x((function(t,e){a.resolve_=t,a.reject_=e,a.start_()}
1)),this.promise_.then(null,(function(){}))}return t.prototype.makeProgressCallback_=function(){var t=this,e=this.transferred_;return function(n,r){t.updateProgress_(e+n)}},t.prototype.shouldDoResumable_=function(t){return t.size()>262144},t.prototype.start_=function(){"running"===this.state_&&null===this.request_&&(this.resumable_?null===this.uploadUrl_?this.createResumable_():this.needToFetchStatus_?this.fetchStatus_():this.needToFetchMetadata_?this.fetchMetadata_():this.continueUpload_():this.oneShotUpload_())},t.prototype.resolveToken_=function(t){var e=this;this.authWrapper_.getAuthToken().then((function(n){switch(e.state_){case"running":t(n);break;case"canceling":e.transition_("canceled");break;case"pausing":e.transition_("paused")}}))},t.prototype.createResumable_=function(){var t=this;this.resolveToken_((function(e){var n=function(t,e,n,r,i){var o=e.bucketOnlyServerUrl(),a=St(e,r,i),s={name:a.fullPath},u=K(o),c={"X-Goog-Upload-Protocol":"resumable","X-Goog-Upload-Command":"start","X-Goog-Upload-Header-Content-Length":r.size(),"X-Goog-Upload-Header-Content-Type":a.contentType,"Content-Type":"application/json; charset=utf-8"},l=Z(a,n),h=t.maxUploadRetryTime(),f=new dt(u,"POST",(function(t,e){var n;Et(t);try{n=t.getResponseHeader("X-Goog-Upload-URL")}catch(r){pt(!1)}return pt(M(n)),n}),h);return f.urlParams=s,f.headers=c,f.body=l,f.errorHandler=yt(e),f}(t.authWrapper_,t.location_,t.mappings_,t.blob_,t.metadata_),r=t.authWrapper_.makeRequest(n,e);t.request_=r,r.getPromise().then((function(e){t.request_=null,t.uploadUrl_=e,t.needToFetchStatus_=!1,t.completeTransitions_()}),t.errorHandler_)}))},t.prototype.fetchStatus_=function(){var t=this,e=this.uploadUrl_;this.resolveToken_((function(n){var r=function(t,e,n,r){var i=t.maxUploadRetryTime(),o=new dt(n,"POST",(function(t,e){var n,i=Et(t,["active","final"]);try{n=t.getResponseHeader("X-Goog-Upload-Size-Received")}catch(a){pt(!1)}var o=parseInt(n,10);return pt(!isNaN(o)),new Ct(o,r.size(),"final"===i)}),i);return o.headers={"X-Goog-Upload-Command":"query"},o.errorHandler=yt(e),o}(t.authWrapper_,t.location_,e,t.blob_),i=t.authWrapper_.makeRequest(r,n);t.request_=i,i.getPromise().then((function(e){e=e,t.request_=null,t.updateProgress_(e.current),t.needToFetchStatus_=!1,e.finalized&&(t.needToFetchMetadata_=!0),t.completeTransitions_()}),t.errorHandler_)}))},t.prototype.continueUpload_=function(){var t=this,e=262144*this.chunkMultiplier_,n=new Ct(this.transferred_,this.blob_.size()),r=this.uploadUrl_;this.resolveToken_((function(i){var o;try{o=function(t,e,n,r,i,o,s,u){var c=new Ct(0,0);if(s?(c.current=s.current,c.total=s.total):(c.current=0,c.total=r.size()),r.size()!==c.total)throw new a("server-file-wrong-size","Server recorded incorrect upload file size, please retry the upload.");var h=c.total-c.current,f=h;i>0&&(f=Math.min(f,i));var d=c.current,p={"X-Goog-Upload-Command":f===h?"upload, finalize":"upload","X-Goog-Upload-Offset":c.current},m=r.slice(d,d+f);if(null===m)throw l();var y=e.maxUploadRetryTime(),v=new dt(n,"POST",(function(t,n){var i,a=Et(t,["active","final"]),s=c.current+f,u=r.size();return i="final"===a?mt(e,o)(t,n):null,new Ct(s,u,"final"===a,i)}),y);return v.headers=p,v.body=m.uploadData(),v.progressCallback=u||null,v.errorHandler=yt(t),v}(t.location_,t.authWrapper_,r,t.blob_,e,t.mappings_,n,t.makeProgressCallback_())}catch(u){return t.error_=u,void t.transition_("error")}var s=t.authWrapper_.makeRequest(o,i);t.request_=s,s.getPromise().then((function(e){t.increaseMultiplier_(),t.request_=null,t.updateProgress_(e.current),e.finalized?(t.metadata_=e.metadata,t.transition_("success")):t.completeTransitions_()}),t.errorHandler_)}))},t.prototype.increaseMultiplier_=function(){262144*this.chunkMultiplier_<33554432&&(this.chunkMultiplier_*=2)},t.prototype.fetchMetadata_=function(){var t=this;this.resolveToken_((function(e){var n=gt(t.authWrapper_,t.location_,t.mappings_),r=t.authWrapper_.makeRequest(n,e);t.request_=r,r.getPromise().then((function(e){t.request_=null,t.metadata_=e,t.transition_("success")}),t.metadataErrorHandler_)}))},t.prototype.oneShotUpload_=function(){var t=this;this.resolveToken_((function(e){var n=function(t,e,n,r,i){var o=e.bucketOnlyServerUrl(),a={"X-Goog-Upload-Protocol":"multipart"},s=function(){for(var t="",e=0;e<2;e++)t+=Math.random().toString().slice(2);return t}();a["Content-Type"]="multipart/related; boundary="+s;var u=St(e,r,i),c=Z(u,n),h=ht.getBlob("--"+s+"\r\nContent-Type: application/json; charset=utf-8\r\n\r\n"+c+"\r\n--"+s+"\r\nContent-Type: "+u.contentType+"\r\n\r\n",r,"\r\n--"
1+s+"--");if(null===h)throw l();var f={name:u.fullPath},d=K(o),p=t.maxUploadRetryTime(),m=new dt(d,"POST",mt(t,n),p);return m.urlParams=f,m.headers=a,m.body=h.uploadData(),m.errorHandler=yt(e),m}(t.authWrapper_,t.location_,t.mappings_,t.blob_,t.metadata_),r=t.authWrapper_.makeRequest(n,e);t.request_=r,r.getPromise().then((function(e){t.request_=null,t.metadata_=e,t.updateProgress_(t.blob_.size()),t.transition_("success")}),t.errorHandler_)}))},t.prototype.updateProgress_=function(t){var e=this.transferred_;this.transferred_=t,this.transferred_!==e&&this.notifyObservers_()},t.prototype.transition_=function(t){if(this.state_!==t)switch(t){case"canceling":case"pausing":this.state_=t,null!==this.request_&&this.request_.cancel();break;case"running":var e="paused"===this.state_;this.state_=t,e&&(this.notifyObservers_(),this.start_());break;case"paused":this.state_=t,this.notifyObservers_();break;case"canceled":this.error_=c(),this.state_=t,this.notifyObservers_();break;case"error":case"success":this.state_=t,this.notifyObservers_()}},t.prototype.completeTransitions_=function(){switch(this.state_){case"pausing":this.transition_("paused");break;case"canceling":this.transition_("canceled");break;case"running":this.start_()}},Object.defineProperty(t.prototype,"snapshot",{get:function(){var t=T(this.state_);return new kt(this.transferred_,this.blob_.size(),t,this.metadata_,this,this.ref_)},enumerable:!0,configurable:!0}),t.prototype.on=function(t,e,n,r){function i(e){if(t!==C.STATE_CHANGED)throw"Expected one of the event types: ["+C.STATE_CHANGED+"]."}void 0===e&&(e=void 0),void 0===n&&(n=void 0),void 0===r&&(r=void 0);var o="Expected a function or an Object with one of `next`, `error`, `complete` properties.",a=ut(!0).validator,s=st(null,!0).validator;function u(t){try{return void a(t)}catch(e){}try{if(s(t),!(D(t.next)||D(t.error)||D(t.complete)))throw"";return}catch(e){throw o}}var c=[rt(i),st(u,!0),ut(!0),ut(!0)];et("on",c,arguments);var l=this;function h(t){return function(e,n,i){null!==t&&et("on",t,arguments);var o=new Tt(e,n,r);return l.addObserver_(o),function(){l.removeObserver_(o)}}}function f(t){if(null===t)throw o;u(t)}var d=[st(f),ut(!0),ut(!0)],p=!(D(e)||D(n)||D(r));return p?h(d):h(null)(e,n,r)},t.prototype.then=function(t,e){return this.promise_.then(t,e)},t.prototype.catch=function(t){return this.then(null,t)},t.prototype.addObserver_=function(t){this.observers_.push(t),this.notifyObserver_(t)},t.prototype.removeObserver_=function(t){var e,n;-1!==(n=(e=this.observers_).indexOf(t))&&e.splice(n,1)},t.prototype.notifyObservers_=function(){var t=this;this.finishPromise_(),Array.prototype.slice.call(this.observers_).forEach((function(e){t.notifyObserver_(e)}))},t.prototype.finishPromise_=function(){if(null!==this.resolve_){var t=!0;switch(T(this.state_)){case E.SUCCESS:It(this.resolve_.bind(null,this.snapshot))();break;case E.CANCELED:case E.ERROR:It(this.reject_.bind(null,this.error_))();break;default:t=!1}t&&(this.resolve_=null,this.reject_=null)}},t.prototype.notifyObserver_=function(t){switch(T(this.state_)){case E.RUNNING:case E.PAUSED:null!==t.next&&It(t.next.bind(t,this.snapshot))();break;case E.SUCCESS:null!==t.complete&&It(t.complete.bind(t))();break;case E.CANCELED:case E.ERROR:null!==t.error&&It(t.error.bind(t,this.error_))();break;default:null!==t.error&&It(t.error.bind(t,this.error_))()}},t.prototype.resume=function(){et("resume",[],arguments);var t="paused"===this.state_||"pausing"===this.state_;return t&&this.transition_("running"),t},t.prototype.pause=function(){et("pause",[],arguments);var t="running"===this.state_;return t&&this.transition_("pausing"),t},t.prototype.cancel=function(){et("cancel",[],arguments);var t="running"===this.state_||"pausing"===this.state_;return t&&this.transition_("canceling"),t},t}(),xt=function(){function t(t,e){this.authWrapper=t,this.location=e instanceof W?e:W.makeFromUrl(e)}return t.prototype.toString=function(){return et("toString",[],arguments),"gs://"+this.location.bucket+"/"+this.location.path},t.prototype.newRef=function(e,n){return new t(e,n)},t.prototype.mappings=function(){return function(){if(X)return X;var t=[];t.push(new Y("bucket")),t.push(new Y("generation")),t.push(new Y("metageneration")),t.push(new Y("name","fullPath",!0));var e=new Y("name");e.xform=function(t,e){return function(t){return!M(t)||t.length<2?t:H(t=t)}(e)},t.push(e);var n=new Y("size");return n.xform=function(t,e){return P(e)?+e:e},t.push(n),t.push(new Y("timeCreated")),t.push(new Y("updated")),t.push(new Y("md5Hash",null,!0)),t.push(new Y("cacheControl",null,!0)),t.push(new Y("contentDisposition",null,!0)),t.push(new Y("contentEncoding",null,!0)),t.push(new Y("contentLanguage",null,!0)),t.push(new Y("contentType",null,!0)),t.push(new Y("metadata","customMetadata",!0)),X=t}()},t.prototype.child=function(t){et("child",[rt()],arguments);var e=z(this.location.path,t),n=new W(this.location.bucket,e);return this.newRef(this.authWrapper,n)},Object.defineProperty(t.prototype,"parent",{get:function(){var t=function(t){if(0==t.length)return null;var e=t.lastIndexOf("/");return-1===e?"":t.slice(0,e)}(this.location.path);if(null===t)return null;var e=new W(this.location.bucket,t);return this.newRef(this.authWrapper,e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"root",{get:function(){var t=new W(this.location.bucket,"");return this.newRef(this.authWrapper,t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"bucket",{get:function(){return this.location.bucket},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"fullPath",{get:function(){return this.location.path},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return H(this.location.path)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"storage",{get:function(){return this.authWrapper.service()},enumerable:!0,configurable:!0}),t.prototype.put=function(t,e){return void 0===e&&(e=null),et("put",[it(),ot(!0)],arguments),this.throwIfRoot_("put"),new Ot(this,this.authWrapper,this.location,this.mappings(),new ht(t),e)},t.prototype.putString=function(t,e,n){void 0===e&&(e=y.RAW),et("putString",[rt(),rt(v,!0),ot(!0)],arguments),this.throwIfRoot_("putString");var r=b(e,t),i=O(n);return!P(i.contentType)&&P(r.contentType)&&(i.contentType=r.contentType),new Ot(this,this.authWrapper,this.location,this.mappings(),new ht(r.data,!0),i)},t.prototype.delete=function(){et("delete",[],arguments),this.throwIfRoot_("delete");var t=this;return this.authWrapper.getAuthToken().then((function(e){var n=_t(t.authWrapper,t.location);
1return t.authWrapper.makeRequest(n,e).getPromise()}))},t.prototype.getMetadata=function(){et("getMetadata",[],arguments),this.throwIfRoot_("getMetadata");var t=this;return this.authWrapper.getAuthToken().then((function(e){var n=gt(t.authWrapper,t.location,t.mappings());return t.authWrapper.makeRequest(n,e).getPromise()}))},t.prototype.updateMetadata=function(t){et("updateMetadata",[ot()],arguments),this.throwIfRoot_("updateMetadata");var e=this;return this.authWrapper.getAuthToken().then((function(n){var r=wt(e.authWrapper,e.location,t,e.mappings());return e.authWrapper.makeRequest(r,n).getPromise()}))},t.prototype.getDownloadURL=function(){et("getDownloadURL",[],arguments),this.throwIfRoot_("getDownloadURL");var t=this;return this.authWrapper.getAuthToken().then((function(e){var n=bt(t.authWrapper,t.location,t.mappings());return t.authWrapper.makeRequest(n,e).getPromise().then((function(t){if(null===t)throw h();return t}))}))},t.prototype.throwIfRoot_=function(t){if(""===this.location.path)throw function(t){return new a("invalid-root-operation","The operation '"+t+"' cannot be performed on a root reference, create a non-root reference using child, such as .child('file.png').")}(t)},t}(),At=function(){function t(t){this.promise_=function(t){return Promise.reject(t)}(t)}return t.prototype.getPromise=function(){return this.promise_},t.prototype.cancel=function(t){void 0===t&&(t=!1)},t}(),Pt=function(){function t(){this.map_={},this.id_=-9007199254740991}return t.prototype.addRequest=function(t){var e=this.id_;this.id_++,this.map_[e]=t;var n=this;function r(){delete n.map_[e]}t.getPromise().then(r,r)},t.prototype.clear=function(){I(this.map_,(function(t,e){e&&e.cancel(!0)})),this.map_={}},t}(),Dt=function(){function t(e,n,r,i,o){if(this.bucket_=null,this.deleted_=!1,this.app_=e,null!==this.app_){var a=this.app_.options;P(a)&&(this.bucket_=t.extractBucket_(a))}this.storageRefMaker_=n,this.requestMaker_=r,this.pool_=o,this.service_=i,this.maxOperationRetryTime_=12e4,this.maxUploadRetryTime_=6e4,this.requestMap_=new Pt}return t.extractBucket_=function(t){var e=t.storageBucket||null;return null==e?null:W.makeFromBucketSpec(e).bucket},t.prototype.getAuthToken=function(){return null!==this.app_&&P(this.app_.INTERNAL)&&P(this.app_.INTERNAL.getToken)?this.app_.INTERNAL.getToken().then((function(t){return null!==t?t.accessToken:null}),(function(t){return null})):A(null)},t.prototype.bucket=function(){if(this.deleted_)throw d();return this.bucket_},t.prototype.service=function(){return this.service_},t.prototype.makeStorageReference=function(t){return this.storageRefMaker_(this,t)},t.prototype.makeRequest=function(t,e){if(this.deleted_)return new At(d());var n=this.requestMaker_(t,e,this.pool_);return this.requestMap_.addRequest(n),n},t.prototype.deleteApp=function(){this.deleted_=!0,this.app_=null,this.requestMap_.clear()},t.prototype.maxUploadRetryTime=function(){return this.maxUploadRetryTime_},t.prototype.setMaxUploadRetryTime=function(t){this.maxUploadRetryTime_=t},t.prototype.maxOperationRetryTime=function(){return this.maxOperationRetryTime_},t.prototype.setMaxOperationRetryTime=function(t){this.maxOperationRetryTime_=t},t}(),Rt=function(){function t(t,e,n,r,i,o,a,s,u,c,l){this.pendingXhr_=null,this.backoffId_=null,this.resolve_=null,this.reject_=null,this.canceled_=!1,this.appDelete_=!1,this.url_=t,this.method_=e,this.headers_=n,this.body_=r,this.successCodes_=i.slice(),this.additionalRetryCodes_=o.slice(),this.callback_=a,this.errorCallback_=s,this.progressCallback_=c,this.timeout_=u,this.pool_=l;var h=this;this.promise_=x((function(t,e){h.resolve_=t,h.reject_=e,h.start_()}))}return t.prototype.start_=function(){var t=this;function e(e,n){var r,i=t.resolve_,o=t.reject_,s=n.xhr;if(n.wasSuccessCode)try{var l=t.callback_(s,s.getResponseText());D(l)?i(l):i()}catch(h){o(h)}else null!==s?((r=u()).setServerResponseProp(s.getResponseText()),o(t.errorCallback_?t.errorCallback_(s,r):r)):o(r=n.canceled?t.appDelete_?d():c():new a("retry-limit-exceeded","Max retry time for operation exceeded, please try again."))}this.canceled_?e(0,new Nt(!1,null,!0)):this.backoffId_=function(e,n,r){var i=1,o=null,a=!1,s=0;function u(){return 2===s}var c=!1;function l(){c||(c=!0,n.apply(null,arguments))}function h(e){o=setTimeout((function(){o=null,function(e,n){if(n)e(!1,new Nt(!1,null,!0));else{var r=t.pool_.createXhrIo();t.pendingXhr_=r,null!==t.progressCallback_&&r.addUploadProgressListener(i),r.send(t.url_,t.method_,t.body_,t.headers_).then((function(n){null!==t.progressCallback_&&n.removeUploadProgressListener(i),t.pendingXhr_=null;
1var r=(n=n).getErrorCode()===U.NO_ERROR,o=n.getStatus();if(r&&!t.isRetryStatusCode_(o)){var a=ft(t.successCodes_,o);e(!0,new Nt(a,n))}else{var s=n.getErrorCode()===U.ABORT;e(!1,new Nt(!1,null,s))}}))}function i(e){null!==t.progressCallback_&&t.progressCallback_(e.loaded,e.lengthComputable?e.total:-1)}}(f,u())}),e)}function f(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(!c)if(t)l.apply(null,arguments);else{var r,o=u()||a;o?l.apply(null,arguments):(i<64&&(i*=2),1===s?(s=2,r=0):r=1e3*(i+Math.random()),h(r))}}var d=!1;function p(t){d||(d=!0,c||(null!==o?(t||(s=2),clearTimeout(o),h(0)):t||(s=1)))}return h(0),setTimeout((function(){a=!0,p(!0)}),r),p}(0,e,this.timeout_)},t.prototype.getPromise=function(){return this.promise_},t.prototype.cancel=function(t){this.canceled_=!0,this.appDelete_=t||!1,null!==this.backoffId_&&(0,this.backoffId_)(!1),null!==this.pendingXhr_&&this.pendingXhr_.abort()},t.prototype.isRetryStatusCode_=function(t){var e=t>=500&&t<600,n=ft([408,429],t),r=ft(this.additionalRetryCodes_,t);return e||n||r},t}(),Nt=function(){return function(t,e,n){this.wasSuccessCode=t,this.xhr=e,this.canceled=!!n}}();function jt(t,e,n){var r=G(t.urlParams),o=t.url+r,a=O(t.headers);return function(t,e){null!==e&&e.length>0&&(t.Authorization="Firebase "+e)}(a,e),function(t){t["X-Firebase-Storage-Version"]="webjs/"+(void 0!==i.a?i.a.SDK_VERSION:"AppManager")}(a),new Rt(o,t.method,a,t.body,t.successCodes,t.additionalRetryCodes,t.handler,t.errorHandler,t.timeout,t.progressCallback,n)}var Mt=function(){function t(t,e,n){if(this.bucket_=null,this.authWrapper_=new Dt(t,(function(t,e){return new xt(t,e)}),jt,this,e),this.app_=t,null!=n)this.bucket_=W.makeFromBucketSpec(n);else{var r=this.authWrapper_.bucket();null!=r&&(this.bucket_=new W(r,""))}this.internals_=new Lt(this)}return t.prototype.ref=function(t){function e(t){if(/^[A-Za-z]+:\/\//.test(t))throw"Expected child path but got a URL, use refFromURL instead."}if(et("ref",[rt(e,!0)],arguments),null==this.bucket_)throw new Error("No Storage Bucket defined in Firebase Options.");var n=new xt(this.authWrapper_,this.bucket_);return null!=t?n.child(t):n},t.prototype.refFromURL=function(t){function e(t){if(!/^[A-Za-z]+:\/\//.test(t))throw"Expected full URL but got a child path, use ref instead.";try{W.makeFromUrl(t)}catch(e){throw"Expected valid full URL but got an invalid one."}}return et("refFromURL",[rt(e,!1)],arguments),new xt(this.authWrapper_,t)},Object.defineProperty(t.prototype,"maxUploadRetryTime",{get:function(){return this.authWrapper_.maxUploadRetryTime()},enumerable:!0,configurable:!0}),t.prototype.setMaxUploadRetryTime=function(t){et("setMaxUploadRetryTime",[at()],arguments),this.authWrapper_.setMaxUploadRetryTime(t)},Object.defineProperty(t.prototype,"maxOperationRetryTime",{get:function(){return this.authWrapper_.maxOperationRetryTime()},enumerable:!0,configurable:!0}),t.prototype.setMaxOperationRetryTime=function(t){et("setMaxOperationRetryTime",[at()],arguments),this.authWrapper_.setMaxOperationRetryTime(t)},Object.defineProperty(t.prototype,"app",{get:function(){return this.app_},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"INTERNAL",{get:function(){return this.internals_},enumerable:!0,configurable:!0}),t}(),Lt=function(){function t(t){this.service_=t}return t.prototype.delete=function(){return this.service_.authWrapper_.deleteApp(),A(void 0)},t}();function Ft(t,e,n){return new Mt(t,new q,n)}function Ut(t){t.INTERNAL.registerService("storage",Ft,{TaskState:E,TaskEvent:C,StringFormat:y,Storage:Mt,Reference:xt},void 0,!0)}Ut(i.a)},M1gn:function(t,e,n){var r=n("Zp05"),i=n("oxOc"),o=n("jZgK")("species");t.exports=function(t){var e;return i(t)&&("function"!=typeof(e=t.constructor)||e!==Array&&!i(e.prototype)||(e=void 0),r(e)&&null===(e=e[o])&&(e=void 0)),void 0===e?Array:e}},MGBS:function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n("mrSG"),i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.d(e,t),e.prototype.notifyNext=function(t,e,n,r,i){this.destination.next(e)},e.prototype.notifyError=function(t,e){this.destination.error(t)},e.prototype.notifyComplete=function(t){this.destination.complete()},e}(n("FFOo").a)},MGeu:function(t,e,n){"use strict";n("t6oF"),n.d(e,"a",(function(){return r}));var r=function(){return function(){}}()},McSo:function(t,e,n){"use strict";function r(t){return null!=t&&"object"==typeof t}n.d(e,"a",(function(){return r}))},NKHs:function(t,e,n){"use strict";var r=n("CcnG"),i=n("Ip0R"),o=n("mrSG"),a=n("h9Dq"),s=function(t){function e(e,n){var r=t.call(this,e,n)||this;
1return r.scheduler=e,r.work=n,r}return o.d(e,t),e.prototype.schedule=function(e,n){return void 0===n&&(n=0),n>0?t.prototype.schedule.call(this,e,n):(this.delay=n,this.state=e,this.scheduler.flush(this),this)},e.prototype.execute=function(e,n){return n>0||this.closed?t.prototype.execute.call(this,e,n):this._execute(e,n)},e.prototype.requestAsyncId=function(e,n,r){return void 0===r&&(r=0),null!==r&&r>0||null===r&&this.delay>0?t.prototype.requestAsyncId.call(this,e,n,r):e.flush(this)},e}(a.a),u=n("CS9Q"),c=new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.d(e,t),e}(u.a))(s),l=n("T1DM"),h=n("6blF"),f=n("xMyE"),d=1,p={},m=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r}return o.d(e,t),e.prototype.requestAsyncId=function(e,n,r){return void 0===r&&(r=0),null!==r&&r>0?t.prototype.requestAsyncId.call(this,e,n,r):(e.actions.push(this),e.scheduled||(e.scheduled=(i=e.flush.bind(e,null),o=d++,p[o]=i,Promise.resolve().then((function(){return function(t){var e=p[t];e&&e()}(o)})),o)));var i,o},e.prototype.recycleAsyncId=function(e,n,r){if(void 0===r&&(r=0),null!==r&&r>0||null===r&&this.delay>0)return t.prototype.recycleAsyncId.call(this,e,n,r);0===e.actions.length&&(delete p[n],e.scheduled=void 0)},e}(a.a),y=new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.d(e,t),e.prototype.flush=function(t){this.active=!0,this.scheduled=void 0;var e,n=this.actions,r=-1,i=n.length;t=t||n.shift();do{if(e=t.execute(t.state,t.delay))break}while(++r<i&&(t=n.shift()));if(this.active=!1,e){for(;++r<i&&(t=n.shift());)t.unsubscribe();throw e}},e}(u.a))(m),v=n("isby"),g=function(t){function e(e,n,r){void 0===n&&(n=0),void 0===r&&(r=y);var i,o=t.call(this)||this;return o.source=e,o.delayTime=n,o.scheduler=r,i=n,(Object(v.a)(i)||!(i-parseFloat(i)+1>=0)||n<0)&&(o.delayTime=0),r&&"function"==typeof r.schedule||(o.scheduler
1=y),o}return o.d(e,t),e.create=function(t,n,r){return void 0===n&&(n=0),void 0===r&&(r=y),new e(t,n,r)},e.dispatch=function(t){return this.add(t.source.subscribe(t.subscriber))},e.prototype._subscribe=function(t){return this.scheduler.schedule(e.dispatch,this.delayTime,{source:this.source,subscriber:t})},e}(h.a),b=function(){function t(t,e){this.scheduler=t,this.delay=e}return t.prototype.call=function(t,e){return new g(e,this.delay,this.scheduler).subscribe(t)},t}(),w=n("mZXl");n.d(e,"a",(function(){return _})),n.d(e,"b",(function(){return T})),n.d(e,"c",(function(){return k}));var _=new r.p("angularfire2.realtimeDatabaseURL");function S(){}var C=function(){function t(t,e){void 0===e&&(e=c),this.zone=t,this.delegate=e}return t.prototype.now=function(){return this.delegate.now()},t.prototype.schedule=function(t,e,n){var r=this.zone;return this.delegate.schedule((function(e){var n=this;r.runGuarded((function(){t.apply(n,[e])}))}),e,n)},t}(),E=function(){function t(t){this.zone=t,this.task=null}return t.prototype.call=function(t,e){var n=this.unscheduleTask.bind(this);return this.task=this.zone.run((function(){return Zone.current.scheduleMacroTask("firebaseZoneBlock",S,{},S,S)})),e.pipe(Object(f.a)(n,n,n)).subscribe(t).add(n)},t.prototype.unscheduleTask=function(){null!=this.task&&"scheduled"===this.task.state&&(this.task.invoke(),this.task=null)},t}(),T=function(){return function(t){this.ngZone=t,this.outsideAngular=t.runOutsideAngular((function(){return new C(Zone.current)})),this.insideAngular=t.run((function(){return new C(Zone.current,l.a)}))}}();function k(t,e){return function(n){return Object(i.q)(e)&&(n=n.lift(new E(t.ngZone))),n.pipe((r=t.outsideAngular,void 0===o&&(o=0),function(t){return t.lift(new b(r,o))}),Object(w.a)(t.insideAngular));var r,o}}},NPZs:function(t,e,n){n("s6PA"),t.exports=n("Autd").Array.find},NSPt:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,i,o,a,s,u,c,l,h,f,d,p,m=n("zVF4"),y=n("q/0M"),v=n("mAIw"),g=(r=n("wj3C"))&&"object"==typeof r&&"default"in r?r.default:r,b=function(){function t(t){this.domStorage_=t,this.prefix_="firebase:"}return t.prototype.set=function(t,e){null==e?this.domStorage_.removeItem(this.prefixedName_(t)):this.domStorage_.setItem(this.prefixedName_(t),m.stringify(e))},t.prototype.get=function(t){var e=this.domStorage_.getItem(this.prefixedName_(t));return null==e?null:m.jsonEval(e)},t.prototype.remove=function(t){this.domStorage_.removeItem(this.prefixedName_(t))},t.prototype.prefixedName_=function(t){return this.prefix_+t},t.prototype.toString=function(){return this.domStorage_.toString()},t}(),w=function(){function t(){this.cache_={},this.isInMemoryStorage=!0}return t.prototype.set=function(t,e){null==e?delete this.cache_[t]:this.cache_[t]=e},t.prototype.get=function(t){return m.contains(this.cache_,t)?this.cache_[t]:null},t.prototype.remove=function(t){delete this.cache_[t]},t}(),_=function(t){try{if("undefined"!=typeof window&&void 0!==window[t]){var e=window[t];return e.setItem("firebase:sentinel","cache"),e.removeItem("firebase:sentinel"),new b(e)}}catch(n){}return new w},S=_("localStorage"),C=_("sessionStorage"),E=new y.Logger("@firebase/database"),T=(i=1,function(){return i++}),k=function(t){var e=m.stringToByteArray(t),n=new m.Sha1;n.update(e);var r=n.digest();return m.base64.encodeByteArray(r)},I=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var n="",r=0;r<t.length;r++)Array.isArray(t[r])||t[r]&&"object"==typeof t[r]&&"number"==typeof t[r].length?n+=I.apply(null,t[r]):n+="object"==typeof t[r]?m.stringify(t[r]):t[r],n+=" ";return n},O=null,x=!0,A=function(t,e){m.assert(!e||!0===t||!1===t,"Can't turn on custom loggers persistently."),!0===t?(E.logLevel=y.LogLevel.VERBOSE,O=E.log.bind(E),e&&C.set("logging_enabled",!0)):"function"==typeof t?O=t:(O=null,C.remove("logging_enabled"))},P=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(!0===x&&(x=!1,null===O&&!0===C.get("logging_enabled")&&A(!0)),O){var n=I.apply(null,t);O(n)}},D=function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];P.apply(void 0,[t].concat(e))}},R=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n="FIREBASE INTERNAL ERROR: "+I.apply(void 0,t);E.error(n)},N=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n="FIREBASE FATAL ERROR: "+I.apply(void 0,t);throw E.error(n),new Error(n)},j=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n="FIREBASE WARNING: "+I.apply(void 0,t);E.warn(n)},M=function(t){return"number"==typeof t&&(t!=t||t==Number.POSITIVE_INFINITY||t==Number.NEGATIVE_INFINITY)},L="[MIN_NAME]",F="[MAX_NAME]",U=function(t,e){if(t===e)return 0;if(t===L||e===F)return-1;if(e===L||t===F)return 1;var n=K(t),r=K(e);return null!==n?null!==r?n-r==0?t.length-e.length:n-r:-1:null!==r?1:t<e?-1:1},V=function(t,e){return t===e?0:t<e?-1:1},q=function(t,e){if(e&&t in e)return e[t];throw new Error("Missing required key ("+t+") in object: "+m.stringify(e))},B=function(t){if("object"!=typeof t||null===t)return m.stringify(t);var e=[];for(var n in t)e.push(n);e.sort();for(var r="{",i=0;i<e.length;i++)0!==i&&(r+=","),r+=m.stringify(e[i]),r+=":",r+=B(t[e[i]]);return r+"}"},W=function(t,e){var n=t.length;if(n<=e)return[t];for(var r=[],i=0;i<n;i+=e)r.push(t.substring(i,i+e>n?n:i+e));return r},z=function(t,e){if(Array.isArray(t))for(var n=0;n<t.length;++n)e(n,t[n]);else m.forEach(t,(function(t,n){return e(n,t)}))},H=function(t){var e,n,r,i,o,a,s;for(m.assert(!M(t),"Invalid JSON number"),0===t?(n=0,r=0,e=1/t==-1/0?1:0):(e=t<0,(t=Math.abs(t))>=Math.pow(2,-1022)?(n=(i=Math.min(Math.floor(Math.log(t)/Math.LN2),1023))+1023,r=Math.round(t*Math.pow(2,52-i)-Math.pow(2,52))):(n=0,r=Math.round(t/Math.pow(2,-1074)))),a=[],o=52;o;o-=1)a.push(r%2?1:0),r=Math.floor(r/2);for(o=11;o;o-=1)a.push(n%2?1:0),n=Math.floor(n/2);a.push(e?1:0),a.reverse(),s=a.join("");var u="";for(o=0;o<64;o+=8){var c=parseInt(s.substr(o,8),2).toString(16);1===c.length&&(c="0"+c),u+=c}return u.toLowerCase()},$=new RegExp("^-?\\d{1,10}$"),K=function(t){if($.test(t)){var e=Number(t);if(e>=-2147483648&&e<=2147483647)return e}return null},G=function(t){try{t()}catch(e){setTimeout((function(){throw j("Exception was thrown by user callback.",e.stack||""),e}),Math.floor(0))}},Q=function(t,e){var n=setTimeout(t,e);return"object"==typeof n&&n.unref&&n.unref(),n},Y=function(){function t(t,e){if(void 0===e){this.pieces_=t.split("/");for(var n=0,r=0;r<this.pieces_.length;r++)this.pieces_[r].length>0&&(this.pieces_[n]=this.pieces_[r],n++);this.pieces_.length=n,this.pieceNum_=0}else this.pieces_=t,this.pieceNum_=e}return Object.defineProperty(t,"Empty",{get:function(){return new t("")},enumerable:!0,configurable:!0}),t.prototype.getFront=function(){return this.pieceNum_>=this.pieces_.length?null:this.pieces_[this.pieceNum_]},t.prototype.getLength=function(){return this.pieces_.length-this.pieceNum_},t.prototype.popFront=function(){var e=this.pieceNum_;return e<this.pieces_.length&&e++,new t(this.pieces_,e)},t.prototype.getBack=function(){return this.pieceNum_<this.pieces_.length?this.pieces_[this.pieces_.length-1]:null},t.prototype.toString=function(){for(var t="",e=this.pieceNum_;e<this.pieces_.length;e++)""!==this.pieces_[e]&&(t+="/"+this.pieces_[e]);return t||"/"},t.prototype.toUrlEncodedString=function(){for(var t="",e=this.pieceNum_;e<this.pieces_.length;e++)""!==this.pieces_[e]&&(t+="/"+encodeURIComponent(String(this.pieces_[e])));return t||"/"},t.prototype.slice=function(t){return void 0===t&&(t=0),this.pieces_.slice(this.pieceNum_+t)},t.prototype.parent=function(){if(this.pieceNum_>=this.pieces_.length)return null;for(var e=[],n=this.pieceNum_;n<this.pieces_.length-1;n++)e.push(this.pieces_[n]);return new t(e,0)},t.prototype.child=function(e){for(var n=[],r=this.pieceNum_;r<this.pieces_.length;r++)n.push(this.pieces_[r]);if(e instanceof t)for(r=e.pieceNum_;r<e.pieces_.length;r++)n.push(e.pieces_[r]);else{var i=e.split("/");for(r=0;r<i.length;r++)i[r].length>0&&n.push(i[r])}return new t(n,0)},t.prototype.isEmpty=function(){return this.pieceNum_>=this.pieces_.length},t.relativePath=function(e,n){var r=e.getFront(),i=n.getFront();if(null===r)return n;if(r===i)return t.relativePath(e.popFront(),n.popFront());
1throw new Error("INTERNAL ERROR: innerPath ("+n+") is not within outerPath ("+e+")")},t.comparePaths=function(t,e){for(var n=t.slice(),r=e.slice(),i=0;i<n.length&&i<r.length;i++){var o=U(n[i],r[i]);if(0!==o)return o}return n.length===r.length?0:n.length<r.length?-1:1},t.prototype.equals=function(t){if(this.getLength()!==t.getLength())return!1;for(var e=this.pieceNum_,n=t.pieceNum_;e<=this.pieces_.length;e++,n++)if(this.pieces_[e]!==t.pieces_[n])return!1;return!0},t.prototype.contains=function(t){var e=this.pieceNum_,n=t.pieceNum_;if(this.getLength()>t.getLength())return!1;for(;e<this.pieces_.length;){if(this.pieces_[e]!==t.pieces_[n])return!1;++e,++n}return!0},t}(),X=function(){function t(t,e){this.errorPrefix_=e,this.parts_=t.slice(),this.byteLength_=Math.max(1,this.parts_.length);for(var n=0;n<this.parts_.length;n++)this.byteLength_+=m.stringLength(this.parts_[n]);this.checkValid_()}return Object.defineProperty(t,"MAX_PATH_DEPTH",{get:function(){return 32},enumerable:!0,configurable:!0}),Object.defineProperty(t,"MAX_PATH_LENGTH_BYTES",{get:function(){return 768},enumerable:!0,configurable:!0}),t.prototype.push=function(t){this.parts_.length>0&&(this.byteLength_+=1),this.parts_.push(t),this.byteLength_+=m.stringLength(t),this.checkValid_()},t.prototype.pop=function(){var t=this.parts_.pop();this.byteLength_-=m.stringLength(t),this.parts_.length>0&&(this.byteLength_-=1)},t.prototype.checkValid_=function(){if(this.byteLength_>t.MAX_PATH_LENGTH_BYTES)throw new Error(this.errorPrefix_+"has a key path longer than "+t.MAX_PATH_LENGTH_BYTES+" bytes ("+this.byteLength_+").");if(this.parts_.length>t.MAX_PATH_DEPTH)throw new Error(this.errorPrefix_+"path specified exceeds the maximum depth that can be written ("+t.MAX_PATH_DEPTH+") or object contains a cycle "+this.toErrorString())},t.prototype.toErrorString=function(){return 0==this.parts_.length?"":"in property '"+this.parts_.join(".")+"'"},t}(),J=function(){function t(t,e,n,r,i){void 0===i&&(i=""),this.secure=e,this.namespace=n,this.webSocketOnly=r,this.persistenceKey=i,this.host=t.toLowerCase(),this.domain=this.host.substr(this.host.indexOf(".")+1),this.internalHost=S.get("host:"+t)||this.host}return t.prototype.needsQueryParam=function(){return this.host!==this.internalHost||this.isCustomHost()},t.prototype.isCacheableHost=function(){return"s-"===this.internalHost.substr(0,2)},t.prototype.isDemoHost=function(){return"firebaseio-demo.com"===this.domain},t.prototype.isCustomHost=function(){return"firebaseio.com"!==this.domain&&"firebaseio-demo.com"!==this.domain},t.prototype.updateHost=function(t){t!==this.internalHost&&(this.internalHost=t,this.isCacheableHost()&&S.set("host:"+this.host,this.internalHost))},t.prototype.connectionURL=function(t,e){var n;if(m.assert("string"==typeof t,"typeof type must == string"),m.assert("object"==typeof e,"typeof params must == object"),"websocket"===t)n=(this.secure?"wss://":"ws://")+this.internalHost+"/.ws?";else{if("long_polling"!==t)throw new Error("Unknown connection type: "+t);n=(this.secure?"https://":"http://")+this.internalHost+"/.lp?"}this.needsQueryParam()&&(e.ns=this.namespace);var r=[];return m.forEach(e,(function(t,e){r.push(t+"="+e)})),n+r.join("&")},t.prototype.toString=function(){var t=this.toURLString();return this.persistenceKey&&(t+="<"+this.persistenceKey+">"),t},t.prototype.toURLString=function(){return(this.secure?"https://":"http://")+this.host},t}(),Z=function(t){var e=tt(t),n=e.subdomain;return"firebase"===e.domain&&N(e.host+" is no longer supported. Please use <YOUR FIREBASE>.firebaseio.com instead"),n&&"undefined"!=n||"localhost"===e.domain||N("Cannot parse Firebase url. Please use https://<YOUR FIREBASE>.firebaseio.com"),e.secure||"undefined"!=typeof window&&window.location&&window.location.protocol&&-1!==window.location.protocol.indexOf("https:")&&j("Insecure Firebase access from a secure page. Please use https in calls to new Firebase()."),{repoInfo:new J(e.host,e.secure,n,"ws"===e.scheme||"wss"===e.scheme),path:new Y(e.pathString)}},tt=function(t){var e="",n="",r="",i="",o=!0,a="https",s=443;if("string"==typeof t){var u=t.indexOf("//");u>=0&&(a=t.substring(0,u-1),t=t.substring(u+2));var c=t.indexOf("/");-1===c&&(c=t.length);var l=t.indexOf("?");-1===l&&(l=t.length),e=t.substring(0,Math.min(c,l)),c<l&&(i=function(t){for(var e="",n=t.split("/"),r=0;r<n.length;r++)if(n[r].length>0){var i=n[r];try{i=decodeURIComponent(i.replace(/\+/g," "))}catch(o){}e+="/"+i}return e}(t.substring(c,l)));var h=function(t){var e={};"?"===t.charAt(0)&&(t=t.substring(1));for(var n=0,r=t.split("&");n<r.length;n++){var i=r[n];if(0!==i.length){var o=i.split("=");2===o.length?e[decodeURIComponent(o[0])]=decodeURIComponent(o[1]):j("Invalid query segment '"+i+"' in query '"+t+"'")}}return e}(t.substring(Math.min(t.length,l)));(u=e.indexOf(":"))>=0?(o="https"===a||"wss"===a,s=parseInt(e.substring(u+1),10)):u=t.length;var f=e.split(".");3===f.length?(n=f[1],r=f[0].toLowerCase()):2===f.length?n=f[0]:"localhost"===f[0].slice(0,u).toLowerCase()&&(n="localhost"),""===r&&"ns"in h&&(r=h.ns)}return{host:e,port:s,domain:n,subdomain:r,secure:o,scheme:a,pathString:i}},et=/[\[\].#$\/\u0000-\u001F\u007F]/,nt=/[\[\].#$\u0000-\u001F\u007F]/,rt=function(t){return"string"==typeof t&&0!==t.length&&!et.test(t)},it=function(t){return"string"==typeof t&&0!==t.length&&!nt.test(t)},ot=function(t){return null===t||"string"==typeof t||"number"==typeof t&&!M(t)||t&&"object"==typeof t&&m.contains(t,".sv")},at=function(t,e,n,r,i){i&&void 0===n||st(m.errorPrefix(t,e,i),n,r)},st=function(t,e,n){var r=n instanceof Y?new X(n,t):n;if(void 0===e)throw new Error(t+"contains undefined "+r.toErrorString());if("function"==typeof e)throw new Error(t+"contains a function "+r.toErrorString()+" with contents = "+e.toString());if(M(e))throw new Error(t+"contains "+e.toString()+" "+r.toErrorString());if("string"==typeof e&&e.length>10485760/3&&m.stringLength(e)>10485760)throw new Error(t+"contains a string greater than 10485760 utf8 bytes "+r.toErrorString()+" ('"+e.substring(0,50)+"...')");if(e&&"object"==typeof e){var i=!1,o=!1;if(m.forEach(e,(function(e,n){if(".value"===e)i=!0;else if(".priority"!==e&&".sv"!==e&&(o=!0,!rt(e)))throw new Error(t+" contains an invali
1d key ("+e+") "+r.toErrorString()+'.  Keys must be non-empty strings and can\'t contain ".", "#", "$", "/", "[", or "]"');r.push(e),st(t,n,r),r.pop()})),i&&o)throw new Error(t+' contains ".value" child '+r.toErrorString()+" in addition to actual children.")}},ut=function(t,e,n,r,i){if(!i||void 0!==n){var o=m.errorPrefix(t,e,i);if(!n||"object"!=typeof n||Array.isArray(n))throw new Error(o+" must be an object containing the children to replace.");var a=[];m.forEach(n,(function(t,e){var n=new Y(t);if(st(o,e,r.child(n)),".priority"===n.getBack()&&!ot(e))throw new Error(o+"contains an invalid value for '"+n.toString()+"', which must be a valid Firebase priority (a string, finite number, server value, or null).");a.push(n)})),function(t,e){var n,r;for(n=0;n<e.length;n++)for(var i=(r=e[n]).slice(),o=0;o<i.length;o++)if(".priority"===i[o]&&o===i.length-1);else if(!rt(i[o]))throw new Error(t+"contains an invalid key ("+i[o]+") in path "+r.toString()+'. Keys must be non-empty strings and can\'t contain ".", "#", "$", "/", "[", or "]"');e.sort(Y.comparePaths);var a=null;for(n=0;n<e.length;n++){if(r=e[n],null!==a&&a.contains(r))throw new Error(t+"contains a path "+a.toString()+" that is ancestor of another path "+r.toString());a=r}}(o,a)}},ct=function(t,e,n,r){if(!r||void 0!==n){if(M(n))throw new Error(m.errorPrefix(t,e,r)+"is "+n.toString()+", but must be a valid Firebase priority (a string, finite number, server value, or null).");if(!ot(n))throw new Error(m.errorPrefix(t,e,r)+"must be a valid Firebase priority (a string, finite number, server value, or null).")}},lt=function(t,e,n,r){if(!r||void 0!==n)switch(n){case"value":case"child_added":case"child_removed":case"child_changed":case"child_moved":break;default:throw new Error(m.errorPrefix(t,e,r)+'must be a valid event type = "value", "child_added", "child_removed", "child_changed", or "child_moved".')}},ht=function(t,e,n,r){if(!(r&&void 0===n||rt(n)))throw new Error(m.errorPrefix(t,e,r)+'was an invalid key = "'+n+'".  Firebase keys must be non-empty strings and can\'t contain ".", "#", "$", "/", "[", or "]").')},ft=function(t,e,n,r){if(!(r&&void 0===n||it(n)))throw new Error(m.errorPrefix(t,e,r)+'was an invalid path = "'+n+'". Paths must be non-empty strings and can\'t contain ".", "#", "$", "[", or "]"')},dt=function(t,e,n,r){n&&(n=n.replace(/^\/*\.info(\/|$)/,"/")),ft(t,e,n,r)},pt=function(t,e){if(".info"===e.getFront())throw new Error(t+" failed = Can't modify data under /.info/")},mt=function(t,e,n){var r=n.path.toString();if("string"!=typeof n.repoInfo.host||0===n.repoInfo.host.length||!rt(n.repoInfo.namespace)&&"localhost"!==n.repoInfo.host.split(":")[0]||0!==r.length&&!function(t){return t&&(t=t.replace(/^\/*\.info(\/|$)/,"/")),it(t)}(r))throw new Error(m.errorPrefix(t,e,!1)+'must be a valid firebase URL and the path can\'t contain ".", "#", "$", "[", or "]".')},yt=function(t,e,n,r){if((!r||void 0!==n)&&"boolean"!=typeof n)throw new Error(m.errorPrefix(t,e,r)+"must be a boolean.")},vt=function(){function t(t,e){this.repo_=t,this.path_=e}return t.prototype.cancel=function(t){m.validateArgCount("OnDisconnect.cancel",0,1,arguments.length),m.validateCallback("OnDisconnect.cancel",1,t,!0);var e=new m.Deferred;return this.repo_.onDisconnectCancel(this.path_,e.wrapCallback(t)),e.promise},t.prototype.remove=function(t){m.validateArgCount("OnDisconnect.remove",0,1,arguments.length),pt("OnDisconnect.remove",this.path_),m.validateCallback("OnDisconnect.remove",1,t,!0);var e=new m.Deferred;return this.repo_.onDisconnectSet(this.path_,null,e.wrapCallback(t)),e.promise},t.prototype.set=function(t,e){m.validateArgCount("OnDisconnect.set",1,2,arguments.length),pt("OnDisconnect.set",this.path_),at("OnDisconnect.set",1,t,this.path_,!1),m.validateCallback("OnDisconnect.set",2,e,!0);var n=new m.Deferred;return this.repo_.onDisconnectSet(this.path_,t,n.wrapCallback(e)),n.promise},t.prototype.setWithPriority=function(t,e,n){m.validateArgCount("OnDisconnect.setWithPriority",2,3,arguments.length),pt("OnDisconnect.setWithPriority",this.path_),at("OnDisconnect.setWithPriority",1,t,this.path_,!1),ct("OnDisconnect.setWithPriority",2,e,!1),m.validateCallback("OnDisconnect.setWithPriority",3,n,!0);var r=new m.Deferred;return this.repo_.onDisconnectSetWithPriority(this.path_,t,e,r.wrapCallback(n)),r.promise},t.prototype.update=function(t,e){if(m.validateArgCount("OnDisconnect.update",1,2,arguments.length),pt("OnDisconnect.update",this.path_),Array.isArray(t)){for(var n={},r=0;r<t.length;++r)n[""+r]=t[r];t=n,j("Passing an Array to firebase.database.onDisconnect().update() is deprecated. Use set() if you want to overwrite the existing data, or an Object with integer keys if you really do want to only update some of the children.")}ut("OnDisconnect.update",1,t,this.path_,!1),m.validateCallback("OnDisconnect.update",2,e,!0);var i=new m.Deferred;return this.repo_.onDisconnectUpdate(this.path_,t,i.wrapCallback(e)),i.promise},t}
1(),gt=function(){function t(t,e){this.committed=t,this.snapshot=e}return t.prototype.toJSON=function(){return m.validateArgCount("TransactionResult.toJSON",0,1,arguments.length),{committed:this.committed,snapshot:this.snapshot.toJSON()}},t}(),bt=(o="-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz",a=0,s=[],function(t){var e,n=t===a;a=t;var r=new Array(8);for(e=7;e>=0;e--)r[e]=o.charAt(t%64),t=Math.floor(t/64);m.assert(0===t,"Cannot push at time == 0");var i=r.join("");if(n){for(e=11;e>=0&&63===s[e];e--)s[e]=0;s[e]++}else for(e=0;e<12;e++)s[e]=Math.floor(64*Math.random());for(e=0;e<12;e++)i+=o.charAt(s[e]);return m.assert(20===i.length,"nextPushId: Length should be 20."),i}),wt=function(){function t(t,e){this.name=t,this.node=e}return t.Wrap=function(e,n){return new t(e,n)},t}(),_t=function(){function t(){}return t.prototype.getCompare=function(){return this.compare.bind(this)},t.prototype.indexedValueChanged=function(t,e){var n=new wt(L,t),r=new wt(L,e);return 0!==this.compare(n,r)},t.prototype.minPost=function(){return wt.MIN},t}(),St=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return v.__extends(e,t),Object.defineProperty(e,"__EMPTY_NODE",{get:function(){return u},set:function(t){u=t},enumerable:!0,configurable:!0}),e.prototype.compare=function(t,e){return U(t.name,e.name)},e.prototype.isDefinedOn=function(t){throw m.assertionError("KeyIndex.isDefinedOn not expected to be called.")},e.prototype.indexedValueChanged=function(t,e){return!1},e.prototype.minPost=function(){return wt.MIN},e.prototype.maxPost=function(){return new wt(F,u)},e.prototype.makePost=function(t,e){return m.assert("string"==typeof t,"KeyIndex indexValue must always be a string."),new wt(t,u)},e.prototype.toString=function(){return".key"},e}(_t),Ct=new St,Et=function(t){return"number"==typeof t?"number:"+H(t):"string:"+t},Tt=function(t){if(t.isLeafNode()){var e=t.val();m.assert("string"==typeof e||"number"==typeof e||"object"==typeof e&&m.contains(e,".sv"),"Priority must be a string or number.")}else m.assert(t===c||t.isEmpty(),"priority of unexpected type.");m.assert(t===c||t.getPriority().isEmpty(),"Priority nodes can't have a priority of their own.")},kt=function(){function t(e,n){void 0===n&&(n=t.__childrenNodeConstructor.EMPTY_NODE),this.value_=e,this.priorityNode_=n,this.lazyHash_=null,m.assert(null!=this.value_,"LeafNode shouldn't be created with null/undefined value."),Tt(this.priorityNode_)}return Object.defineProperty(t,"__childrenNodeConstructor",{get:function(){return l},set:function(t){l=t},enumerable:!0,configurable:!0}),t.prototype.isLeafNode=function(){return!0},t.prototype.getPriority=function(){return this.priorityNode_},t.prototype.updatePriority=function(e){return new t(this.value_,e)},t.prototype.getImmediateChild=function(e){return".priority"===e?this.priorityNode_:t.__childrenNodeConstructor.EMPTY_NODE},t.prototype.getChild=function(e){return e.isEmpty()?this:".priority"===e.getFront()?this.priorityNode_:t.__childrenNodeConstructor.EMPTY_NODE},t.prototype.hasChild=function(){return!1},t.prototype.getPredecessorChildName=function(t,e){return null},t.prototype.updateImmediateChild=function(e,n){return".priority"===e?this.updatePriority(n):n.isEmpty()&&".priority"!==e?this:t.__childrenNodeConstructor.EMPTY_NODE.updateImmediateChild(e,n).updatePriority(this.priorityNode_)},t.prototype.updateChild=function(e,n){var r=e.getFront();return null===r?n:n.isEmpty()&&".priority"!==r?this:(m.assert(".priority"!==r||1===e.getLength(),".priority must be the last token in a path"),this.updateImmediateChild(r,t.__childrenNodeConstructor.EMPTY_NODE.updateChild(e.popFront(),n)))},t.prototype.isEmpty=function(){return!1},t.prototype.numChildren=function(){return 0},t.prototype.forEachChild=function(t,e){return!1},t.prototype.val=function(t){return t&&!this.getPriority().isEmpty()?{".value":this.getValue(),".priority":this.getPriority().val()}:this.getValue()},t.prototype.hash=function(){if(null===this.lazyHash_){var t="";this.priorityNode_.isEmpty()||(t+="priority:"+Et(this.priorityNode_.val())+":");var e=typeof this.value_;t+=e+":",t+="number"===e?H(this.value_):this.value_,this.lazyHash_=k(t)}return this.lazyHash_},t.prototype.getValue=function(){return this.value_},t.prototype.compareTo=function(e){return e===t.__childrenNodeConstructor.EMPTY_NODE?1:e instanceof t.__childrenNodeConstructor?-1:(m.assert(e.isLeafNode(),"Unknown node type"),this.compareToLeafNode_(e))},t.prototype.compareToLeafNode_=function(e){var n=typeof e.value_,r=typeof this.value_,i=t.VALUE_TYPE_ORDER.indexOf(n),o=t.VALUE_TYPE_ORDER.indexOf(r);return m.assert(i>=0,"Unknown leaf type: "+n),m.assert(o>=0,"Unknown leaf type: "+r),i===o?"object"===r?0:this.value_<e.value_?-1:this.value_===e.value_?0:1:o-i},t.prototype.withIndex=function(){return this},t.prototype.isIndexed=function(){return!0},t.prototype.equals=function(t){return t===this||!!t.isLeafNode()&&this.value_===t.value_&&this.priorityNode_.equals(t.priorityNode_)},t.VALUE_TYPE_ORDER=["object","boolean","number","string"],t}(),It=new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return v.__extends(e,t),e.prototype.compare=function(t,e){var n=t.node.getPriority(),r=e.node.getPriority(),i=n.compareTo(r);return 0===i?U(t.name,e.name):i},e.prototype.isDefinedOn=function(t){return!t.getPriority().isEmpty()},e.prototype.indexedValueChanged=function(t,e){return!t.getPriority().equals(e.getPriority())},e.prototype.minPost=function(){return wt.MIN},e.prototype.maxPost=function(){return new wt(F,new kt("[PRIORITY-POST]",f))},e.prototype.makePost=function(t,e){var n=h(t);return new wt(e,new kt("[PRIORITY-POST]",n))},e.prototype.toString=function(){return".priority"},e}(_t)),Ot=function(){function t(t,e,n,r,i){void 0===i&&(i=null),this.isReverse_=r,this.resultGenerator_=i,this.nodeStack_=[];for(var o=1;!t.isEmpty();)if(t=t,o=e?n(t.key,e):1,r&&(o*=-1),o<0)t=this.isReverse_?t.left:t.right;else{if(0===o){this.nodeStack_.push(t);break}this.nodeStack_.push(t),t=this.isReverse_?t.right:t.left}}return t.prototype.getNext=function(){if(0===this.nodeStack_.length)return null;var t,e=this.nodeStack_.pop();if(t=this.resultGenerator_?this.resultGenerator_(e.key,e.value):{key:e.key,value:e.value},this.isReverse_)for(e=e.left;!e.isEmpty();)this.nodeStack_.push(e),e=e.right;else for(e=e.right;!e.isEmpty();)this.nodeStack_.push(e),e=e.left;return t},t.prototype.hasNext=function(){return this.nodeStack_.length>0},t.prototype.peek=function(){if(0===this.nodeStack_.length)return null;var t=this.nodeStack_[this.nodeStack_.length-1];return this.resultGenerator_?this.resultGenerator_(t.key,t.value):{key:t.key,value:t.value}},t}(),xt=function(){function t(e,n,r,i,o){this.key=e,this.value=n,this.color=null!=r?r:t.RED,this.left=null!=i?i:Pt.EMPTY_NODE,this.right=null!=o?o:Pt.EMPTY_NODE}return t.prototype.copy=function(e,n,r,i,o){return new t(null!=e?e:this.key,null!=n?n:this.value,
1null!=r?r:this.color,null!=i?i:this.left,null!=o?o:this.right)},t.prototype.count=function(){return this.left.count()+1+this.right.count()},t.prototype.isEmpty=function(){return!1},t.prototype.inorderTraversal=function(t){return this.left.inorderTraversal(t)||t(this.key,this.value)||this.right.inorderTraversal(t)},t.prototype.reverseTraversal=function(t){return this.right.reverseTraversal(t)||t(this.key,this.value)||this.left.reverseTraversal(t)},t.prototype.min_=function(){return this.left.isEmpty()?this:this.left.min_()},t.prototype.minKey=function(){return this.min_().key},t.prototype.maxKey=function(){return this.right.isEmpty()?this.key:this.right.maxKey()},t.prototype.insert=function(t,e,n){var r,i;return(i=(r=n(t,(i=this).key))<0?i.copy(null,null,null,i.left.insert(t,e,n),null):0===r?i.copy(null,e,null,null,null):i.copy(null,null,null,null,i.right.insert(t,e,n))).fixUp_()},t.prototype.removeMin_=function(){if(this.left.isEmpty())return Pt.EMPTY_NODE;var t=this;return t.left.isRed_()||t.left.left.isRed_()||(t=t.moveRedLeft_()),(t=t.copy(null,null,null,t.left.removeMin_(),null)).fixUp_()},t.prototype.remove=function(t,e){var n,r;if(e(t,(n=this).key)<0)n.left.isEmpty()||n.left.isRed_()||n.left.left.isRed_()||(n=n.moveRedLeft_()),n=n.copy(null,null,null,n.left.remove(t,e),null);else{if(n.left.isRed_()&&(n=n.rotateRight_()),n.right.isEmpty()||n.right.isRed_()||n.right.left.isRed_()||(n=n.moveRedRight_()),0===e(t,n.key)){if(n.right.isEmpty())return Pt.EMPTY_NODE;r=n.right.min_(),n=n.copy(r.key,r.value,null,null,n.right.removeMin_())}n=n.copy(null,null,null,null,n.right.remove(t,e))}return n.fixUp_()},t.prototype.isRed_=function(){return this.color},t.prototype.fixUp_=function(){var t=this;return t.right.isRed_()&&!t.left.isRed_()&&(t=t.rotateLeft_()),t.left.isRed_()&&t.left.left.isRed_()&&(t=t.rotateRight_()),t.left.isRed_()&&t.right.isRed_()&&(t=t.colorFlip_()),t},t.prototype.moveRedLeft_=function(){var t=this.colorFlip_();return t.right.left.isRed_()&&(t=(t=(t=t.copy(null,null,null,null,t.right.rotateRight_())).rotateLeft_()).colorFlip_()),t},t.prototype.moveRedRight_=function(){var t=this.colorFlip_();return t.left.left.isRed_()&&(t=(t=t.rotateRight_()).colorFlip_()),t},t.prototype.rotateLeft_=function(){var e=this.copy(null,null,t.RED,null,this.right.left);return this.right.copy(null,null,this.color,e,null)},t.prototype.rotateRight_=function(){var e=this.copy(null,null,t.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,e)},t.prototype.colorFlip_=function(){var t=this.left.copy(null,null,!this.left.color,null,null),e=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,t,e)},t.prototype.checkMaxDepth_=function(){var t=this.check_();return Math.pow(2,t)<=this.count()+1},t.prototype.check_=function(){var t;if(this.isRed_()&&this.left.isRed_())throw new Error("Red node has red child("+this.key+","+this.value+")");
1if(this.right.isRed_())throw new Error("Right child of ("+this.key+","+this.value+") is red");if((t=this.left.check_())!==this.right.check_())throw new Error("Black depths differ");return t+(this.isRed_()?0:1)},t.RED=!0,t.BLACK=!1,t}(),At=function(){function t(){}return t.prototype.copy=function(t,e,n,r,i){return this},t.prototype.insert=function(t,e,n){return new xt(t,e,null)},t.prototype.remove=function(t,e){return this},t.prototype.count=function(){return 0},t.prototype.isEmpty=function(){return!0},t.prototype.inorderTraversal=function(t){return!1},t.prototype.reverseTraversal=function(t){return!1},t.prototype.minKey=function(){return null},t.prototype.maxKey=function(){return null},t.prototype.check_=function(){return 0},t.prototype.isRed_=function(){return!1},t}(),Pt=function(){function t(e,n){void 0===n&&(n=t.EMPTY_NODE),this.comparator_=e,this.root_=n}return t.prototype.insert=function(e,n){return new t(this.comparator_,this.root_.insert(e,n,this.comparator_).copy(null,null,xt.BLACK,null,null))},t.prototype.remove=function(e){return new t(this.comparator_,this.root_.remove(e,this.comparator_).copy(null,null,xt.BLACK,null,null))},t.prototype.get=function(t){for(var e,n=this.root_;!n.isEmpty();){if(0===(e=this.comparator_(t,n.key)))return n.value;e<0?n=n.left:e>0&&(n=n.right)}return null},t.prototype.getPredecessorKey=function(t){for(var e,n=this.root_,r=null;!n.isEmpty();){if(0===(e=this.comparator_(t,n.key))){if(n.left.isEmpty())return r?r.key:null;for(n=n.left;!n.right.isEmpty();)n=n.right;return n.key}e<0?n=n.left:e>0&&(r=n,n=n.right)}throw new Error("Attempted to find predecessor key for a nonexistent key.  What gives?")},t.prototype.isEmpty=function(){return this.root_.isEmpty()},t.prototype.count=function(){return this.root_.count()},t.prototype.minKey=function(){return this.root_.minKey()},t.prototype.maxKey=function(){return this.root_.maxKey()},t.prototype.inorderTraversal=function(t){return this.root_.inorderTraversal(t)},t.prototype.reverseTraversal=function(t){return this.root_.reverseTraversal(t)},t.prototype.getIterator=function(t){return new Ot(this.root_,null,this.comparator_,!1,t)},t.prototype.getIteratorFrom=function(t,e){return new Ot(this.root_,t,this.comparator_,!1,e)},t.prototype.getReverseIteratorFrom=function(t,e){return new Ot(this.root_,t,this.comparator_,!0,e)},t.prototype.getReverseIterator=function(t){return new Ot(this.root_,null,this.comparator_,!0,t)},t.EMPTY_NODE=new At,t}(),Dt=Math.log(2),Rt=function(){function t(t){this.count=parseInt(Math.log(t+1)/Dt,10),this.current_=this.count-1;var e=parseInt(Array(this.count+1).join("1"),2);this.bits_=t+1&e}return t.prototype.nextBitIsOne=function(){var t=!(this.bits_&1<<this.current_);return this.current_--,t},t}(),Nt=function(t,e,n,r){t.sort(e);var i=function(e,r){var o,a,s=r-e;if(0==s)return null;if(1==s)return o=t[e],a=n?n(o):o,new xt(a,o.node,xt.BLACK,null,null);var u=parseInt(s/2,10)+e,c=i(e,u),l=i(u+1,r);return o=t[u],a=n?n(o):o,new xt(a,o.node,xt.BLACK,c,l)},o=function(e){for(var r=null,o=null,a=t.length,s=function(e,r){var o=a-e,s=a;a-=e;var c=i(o+1,s),l=t[o],h=n?n(l):l;u(new xt(h,l.node,r,null,c))},u=function(t){r?(r.left=t,r=t):(o=t,r=t)},c=0;c<e.count;++c){var l=e.nextBitIsOne(),h=Math.pow(2,e.count-(c+1));l?s(h,xt.BLACK):(s(h,xt.BLACK),s(h,xt.RED))}return o}(new Rt(t.length));return new Pt(r||e,o)},jt={},Mt=function(){function t(t,e){this.indexes_=t,this.indexSet_=e}return Object.defineProperty(t,"Default",{get:function(){return m.assert(jt&&It,"ChildrenNode.ts has not been loaded"),d=d||new t({".priority":jt},{".priority":It})},enumerable:!0,configurable:!0}),t.prototype.get=function(t){var e=m.safeGet(this.indexes_,t);if(!e)throw new Error("No index defined for "+t);return e===jt?null:e},t.prototype.hasIndex=function(t){return m.contains(this.indexSet_,t.toString())},t.prototype.addIndex=function(e,n){m.assert(e!==Ct,"KeyIndex always exists and isn't meant to be added to the IndexMap.");for(var r,i=[],o=!1,a=n.getIterator(wt.Wrap),s=a.getNext();s;)o=o||e.isDefinedOn(s.node),i.push(s),s=a.getNext();r=o?Nt(i,e.getCompare()):jt;var u=e.toString(),c=m.clone(this.indexSet_);c[u]=e;var l=m.clone(this.indexes_);return l[u]=r,new t(l,c)},t.prototype.addToIndexes=function(e,n){var r=this;return new t(m.map(this.indexes_,(function(t,i){var o=m.safeGet(r.indexSet_,i);if(m.assert(o,"Missing index implementation for "+i),t===jt){if(o.isDefinedOn(e.node)){for(var a=[],s=n.getIterator(wt.Wrap),u=s.getNext();u;)u.name!=e.name&&a.push(u),u=s.getNext();return a.push(e),Nt(a,o.getCompare())}return jt}var c=n.get(e.name),l=t;return c&&(l=l.remove(new wt(e.name,c))),l.insert(e,e.node)})),this.indexSet_)}
1,t.prototype.removeFromIndexes=function(e,n){return new t(m.map(this.indexes_,(function(t){if(t===jt)return t;var r=n.get(e.name);return r?t.remove(new wt(e.name,r)):t})),this.indexSet_)},t}();function Lt(t,e){return U(t.name,e.name)}function Ft(t,e){return U(t,e)}var Ut=function(){function t(t,e,n){this.children_=t,this.priorityNode_=e,this.indexMap_=n,this.lazyHash_=null,this.priorityNode_&&Tt(this.priorityNode_),this.children_.isEmpty()&&m.assert(!this.priorityNode_||this.priorityNode_.isEmpty(),"An empty node cannot have a priority")}return Object.defineProperty(t,"EMPTY_NODE",{get:function(){return p||(p=new t(new Pt(Ft),null,Mt.Default))},enumerable:!0,configurable:!0}),t.prototype.isLeafNode=function(){return!1},t.prototype.getPriority=function(){return this.priorityNode_||p},t.prototype.updatePriority=function(e){return this.children_.isEmpty()?this:new t(this.children_,e,this.indexMap_)},t.prototype.getImmediateChild=function(t){if(".priority"===t)return this.getPriority();var e=this.children_.get(t);return null===e?p:e},t.prototype.getChild=function(t){var e=t.getFront();return null===e?this:this.getImmediateChild(e).getChild(t.popFront())},t.prototype.hasChild=function(t){return null!==this.children_.get(t)},t.prototype.updateImmediateChild=function(e,n){if(m.assert(n,"We should always be passing snapshot nodes"),".priority"===e)return this.updatePriority(n);var r,i=new wt(e,n),o=void 0,a=void 0;return n.isEmpty()?(o=this.children_.remove(e),a=this.indexMap_.removeFromIndexes(i,this.children_)):(o=this.children_.insert(e,n),a=this.indexMap_.addToIndexes(i,this.children_)),r=o.isEmpty()?p:this.priorityNode_,new t(o,r,a)},t.prototype.updateChild=function(t,e){var n=t.getFront();if(null===n)return e;m.assert(".priority"!==t.getFront()||1===t.getLength(),".priority must be the last token in a path");var r=this.getImmediateChild(n).updateChild(t.popFront(),e);return this.updateImmediateChild(n,r)},t.prototype.isEmpty=function(){return this.children_.isEmpty()},t.prototype.numChildren=function(){return this.children_.count()},t.prototype.val=function(e){if(this.isEmpty())return null;var n={},r=0,i=0,o=!0;if(this.forEachChild(It,(function(a,s){n[a]=s.val(e),r++,o&&t.INTEGER_REGEXP_.test(a)?i=Math.max(i,Number(a)):o=!1})),!e&&o&&i<2*r){var a=[];for(var s in n)a[s]=n[s];return a}return e&&!this.getPriority().isEmpty()&&(n[".priority"]=this.getPriority().val()),n},t.prototype.hash=function(){if(null===this.lazyHash_){var t="";this.getPriority().isEmpty()||(t+="priority:"+Et(this.getPriority().val())+":"),this.forEachChild(It,(function(e,n){var r=n.hash();""!==r&&(t+=":"+e+":"+r)})),this.lazyHash_=""===t?"":k(t)}return this.lazyHash_},t.prototype.getPredecessorChildName=function(t,e,n){var r=this.resolveIndex_(n);if(r){var i=r.getPredecessorKey(new wt(t,e));return i?i.name:null}return this.children_.getPredecessorKey(t)},t.prototype.getFirstChildName=function(t){var e=this.resolveIndex_(t);if(e){var n=e.minKey();return n&&n.name}return this.children_.minKey()},t.prototype.getFirstChild=function(t){var e=this.getFirstChildName(t);return e?new wt(e,this.children_.get(e)):null},t.prototype.getLastChildName=function(t){var e=this.resolveIndex_(t);if(e){var n=e.maxKey();return n&&n.name}return this.children_.maxKey()},t.prototype.getLastChild=function(t){var e=this.getLastChildName(t);return e?new wt(e,this.children_.get(e)):null},t.prototype.forEachChild=function(t,e){var n=this.resolveIndex_(t);return n?n.inorderTraversal((function(t){return e(t.name,t.node)})):this.children_.inorderTraversal(e)},t.prototype.getIterator=function(t){return this.getIteratorFrom(t.minPost(),t)},t.prototype.getIteratorFrom=function(t,e){var n=this.resolveIndex_(e);if(n)return n.getIteratorFrom(t,(function(t){return t}));for(var r=this.children_.getIteratorFrom(t.name,wt.Wrap),i=r.peek();null!=i&&e.compare(i,t)<0;)r.getNext(),i=r.peek();return r},t.prototype.getReverseIterator=function(t){return this.getReverseIteratorFrom(t.maxPost(),t)},t.prototype.getReverseIteratorFrom=function(t,e){var n=this.resolveIndex_(e);if(n)return n.getReverseIteratorFrom(t,(function(t){return t}));for(var r=this.children_.getReverseIteratorFrom(t.name,wt.Wrap),i=r.peek();null!=i&&e.compare(i,t)>0;)r.getNext(),i=r.peek();return r},t.prototype.compareTo=function(t){return this.isEmpty()?t.isEmpty()?0:-1:t.isLeafNode()||t.isEmpty()?1:t===Vt?-1:0},t.prototype.withIndex=function(e){if(e===Ct||this.indexMap_.hasIndex(e))return this;var n=this.indexMap_.addIndex(e,this.children_);return new t(this.children_,this.priorityNode_,n)},t.prototype.isIndexed=function(t){return t===Ct||this.indexMap_.hasIndex(t)},t.prototype.equals=function(t){if(t===this)return!0;
1if(t.isLeafNode())return!1;var e=t;if(this.getPriority().equals(e.getPriority())){if(this.children_.count()===e.children_.count()){for(var n=this.getIterator(It),r=e.getIterator(It),i=n.getNext(),o=r.getNext();i&&o;){if(i.name!==o.name||!i.node.equals(o.node))return!1;i=n.getNext(),o=r.getNext()}return null===i&&null===o}return!1}return!1},t.prototype.resolveIndex_=function(t){return t===Ct?null:this.indexMap_.get(t.toString())},t.INTEGER_REGEXP_=/^(0|[1-9]\d*)$/,t}(),Vt=new(function(t){function e(){return t.call(this,new Pt(Ft),Ut.EMPTY_NODE,Mt.Default)||this}return v.__extends(e,t),e.prototype.compareTo=function(t){return t===this?0:1},e.prototype.equals=function(t){return t===this},e.prototype.getPriority=function(){return this},e.prototype.getImmediateChild=function(t){return Ut.EMPTY_NODE},e.prototype.isEmpty=function(){return!1},e}(Ut));function qt(t,e){if(void 0===e&&(e=null),null===t)return Ut.EMPTY_NODE;if("object"==typeof t&&".priority"in t&&(e=t[".priority"]),m.assert(null===e||"string"==typeof e||"number"==typeof e||"object"==typeof e&&".sv"in e,"Invalid priority type found: "+typeof e),"object"==typeof t&&".value"in t&&null!==t[".value"]&&(t=t[".value"]),"object"!=typeof t||".sv"in t)return new kt(t,qt(e));if(t instanceof Array){var n=Ut.EMPTY_NODE,r=t;return m.forEach(r,(function(t,e){if(m.contains(r,t)&&"."!==t.substring(0,1)){var i=qt(e);!i.isLeafNode()&&i.isEmpty()||(n=n.updateImmediateChild(t,i))}})),n.updatePriority(qt(e))}var i=[],o=!1,a=t;if(m.forEach(a,(function(t,e){if("string"!=typeof t||"."!==t.substring(0,1)){var n=qt(a[t]);n.isEmpty()||(o=o||!n.getPriority().isEmpty(),i.push(new wt(t,n)))}})),0==i.length)return Ut.EMPTY_NODE;var s=Nt(i,Lt,(function(t){return t.name}),Ft);if(o){var u=Nt(i,It.getCompare());return new Ut(s,qt(e),new Mt({".priority":u},{".priority":It}))}return new Ut(s,qt(e),Mt.Default)}Object.defineProperties(wt,{MIN:{value:new wt(L,Ut.EMPTY_NODE)},MAX:{value:new wt(F,Vt)}}),St.__EMPTY_NODE=Ut.EMPTY_NODE,kt.__childrenNodeConstructor=Ut,c=Vt,function(t){f=t}(Vt),function(t){h=t}(qt);var Bt,Wt,zt,Ht=new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return v.__extends(e,t),e.prototype.compare=function(t,e){var n=t.node.compareTo(e.node);return 0===n?U(t.name,e.name):n},e.prototype.isDefinedOn=function(t){return!0},e.prototype.indexedValueChanged=function(t,e){return!t.equals(e)},e.prototype.minPost=function(){return wt.MIN},e.prototype.maxPost=function(){return wt.MAX},e.prototype.makePost=function(t,e){var n=qt(t);return new wt(e,n)},e.prototype.toString=function(){return".value"},e}(_t)),$t=function(t){function e(e){var n=t.call(this)||this;return n.indexPath_=e,m.assert(!e.isEmpty()&&".priority"!==e.getFront(),"Can't create PathIndex with empty path or .priority key"),n}return v.__extends(e,t),e.prototype.extractChild=function(t){return t.getChild(this.indexPath_)},e.prototype.isDefinedOn=function(t){return!t.getChild(this.indexPath_).isEmpty()},e.prototype.compare=function(t,e){var n=this.extractChild(t.node),r=this.extractChild(e.node),i=n.compareTo(r);return 0===i?U(t.name,e.name):i},e.prototype.makePost=function(t,e){var n=qt(t),r=Ut.EMPTY_NODE.updateChild(this.indexPath_,n);return new wt(e,r)},e.prototype.maxPost=function(){var t=Ut.EMPTY_NODE.updateChild(this.indexPath_,Vt);return new wt(F,t)},e.prototype.toString=function(){return this.indexPath_.slice().join("/")},e}(_t),Kt=function(){function t(t,e,n){this.node_=t,this.ref_=e,this.index_=n}return t.prototype.val=function(){return m.validateArgCount("DataSnapshot.val",0,0,arguments.length),this.node_.val()},t.prototype.exportVal=function(){return m.validateArgCount("DataSnapshot.exportVal",0,0,arguments.length),this.node_.val(!0)},t.prototype.toJSON=function(){return m.validateArgCount("DataSnapshot.toJSON",0,1,arguments.length),this.exportVal()},t.prototype.exists=function(){return m.validateArgCount("DataSnapshot.exists",0,0,arguments.length),!this.node_.isEmpty()},t.prototype.child=function(e){m.validateArgCount("DataSnapshot.child",0,1,arguments.length),e=String(e),ft("DataSnapshot.child",1,e,!1);var n=new Y(e),r=this.ref_.child(n);return new t(this.node_.getChild(n),r,It)},t.prototype.hasChild=function(t){m.validateArgCount("DataSnapshot.hasChild",1,1,arguments.length),ft("DataSnapshot.hasChild",1,t,!1);var e=new Y(t);return!this.node_.getChild(e).isEmpty()},t.prototype.getPriority=function(){return m.validateArgCount("DataSnapshot.getPriority",0,0,arguments.length),this.node_.getPriority().val()},t.prototype.forEach=function(e){var n=this;if(m.validateArgCount("DataSnapshot.forEach",1,1,arguments.length),m.validateCallback("DataSnapshot.forEach",1,e,!1),this.node_.isLeafNode())return!1;var r=this.node_;return!!r.forEachChild(this.index_,(function(r,i){return e(new t(i,n.ref_.child(r),It))}))},t.prototype.hasChildren=function(){return m.validateArgCount("DataSnapshot.hasChildren",0,0,arguments.length),!this.node_.isLeafNode()&&!this.node_.isEmpty()},Object.defineProperty(t.prototype,"key",{get:function(){return this.ref_.getKey()},enumerable:!0,configurable:!0}),t.prototype.numChildren=function(){return m.validateArgCount("DataSnapshot.numChildren",0,0,arguments.length),this.node_.numChildren()},t.prototype.getRef=function(){return m.validateArgCount("DataSnapshot.ref",0,0,arguments.length),this.ref_},Object.defineProperty(t.prototype,"ref",{get:function(){return this.getRef()},enumerable:!0,configurable:!0}),t}(),Gt=function(){function t(t,e,n,r){this.eventType=t,this.eventRegistration=e,this.snapshot=n,this.prevName=r}return t.prototype.getPath=function(){var t=this.snapshot.getRef();return"value"===this.eventType?t.path:t.getParent().path},t.prototype.getEventType=function(){return this.eventType},t.prototype.getEventRunner=function(){return this.eventRegistration.getEventRunner(this)},t.prototype.toString=function(){return this.getPath().toString()+":"+this.eventType+":"+m.stringify(this.snapshot.exportVal())},t}(),Qt=function(){function t(t,e,n){this.eventRegistration=t,this.error=e,this.path=n}return t.prototype.getPath=function(){return this.path},t.prototype.getEventType=function(){return"cancel"},t.prototype.getEventRunner=function(){return this.eventRegistration.getEventRunner(this)},t.prototype.toString=function(){return this.path.toString()+":cancel"},t}(),Yt=function(){function t(t,e,n){this.callback_=t,this.cancelCallback_=e,this.context_=n}return t.prototype.respondsTo=function(t){return"value"===t},t.prototype.createEvent=function(t,e){var n=e.getQueryParams().getIndex();return new Gt("value",this,new Kt(t.snapshotNode,e.getRef(),n))},t.prototype.getEventRunner=function(t){var e=this.context_;if("cancel"===t.getEventType()){m.assert(this.cancelCallback_,"Raising a cancel event on a listener with no cancel callback");var n=this.cancelCallback_;return function(){n.call(e,t.error)}}var r=this.callback_;return function(){r.call(e,t.snapshot)}},t.prototype.createCancelEvent=function(t,e){return this.cancelCallback_?new Qt(this,t,e):null},t.prototype.matches=function(e){return e instanceof t&&(!e.callback_||!this.callback_||e.callback_===this.callback_&&e.context_===this.context_)},t.prototype.hasAnyCallback=function(){return null!==this.callback_},t}(),Xt=function(){function t(t,e,n){this.callbacks_=t,this.cancelCallback_=e,this.context_=n}return t.prototype.respondsTo=function(t){var e="children_added"===t?"child_added":t;
1return m.contains(this.callbacks_,e="children_removed"===e?"child_removed":e)},t.prototype.createCancelEvent=function(t,e){return this.cancelCallback_?new Qt(this,t,e):null},t.prototype.createEvent=function(t,e){m.assert(null!=t.childName,"Child events should have a childName.");var n=e.getRef().child(t.childName),r=e.getQueryParams().getIndex();return new Gt(t.type,this,new Kt(t.snapshotNode,n,r),t.prevName)},t.prototype.getEventRunner=function(t){var e=this.context_;if("cancel"===t.getEventType()){m.assert(this.cancelCallback_,"Raising a cancel event on a listener with no cancel callback");var n=this.cancelCallback_;return function(){n.call(e,t.error)}}var r=this.callbacks_[t.eventType];return function(){r.call(e,t.snapshot,t.prevName)}},t.prototype.matches=function(e){if(e instanceof t){if(!this.callbacks_||!e.callbacks_)return!0;if(this.context_===e.context_){var n=m.getCount(e.callbacks_);if(n===m.getCount(this.callbacks_)){if(1===n){var r=m.getAnyKey(e.callbacks_),i=m.getAnyKey(this.callbacks_);return!(i!==r||e.callbacks_[r]&&this.callbacks_[i]&&e.callbacks_[r]!==this.callbacks_[i])}return m.every(this.callbacks_,(function(t,n){return e.callbacks_[t]===n}))}}}return!1},t.prototype.hasAnyCallback=function(){return null!==this.callbacks_},t}(),Jt=function(){function t(t,e,n,r){this.repo=t,this.path=e,this.queryParams_=n,this.orderByCalled_=r}return Object.defineProperty(t,"__referenceConstructor",{get:function(){return m.assert(Bt,"Reference.ts has not been loaded"),Bt},set:function(t){Bt=t},enumerable:!0,configurable:!0}),t.validateQueryEndpoints_=function(t){var e=null,n=null;if(t.hasStart()&&(e=t.getIndexStartValue()),t.hasEnd()&&(n=t.getIndexEndValue()),t.getIndex()===Ct){var r="Query: When ordering by key, you may only pass one argument to startAt(), endAt(), or equalTo().",i="Query: When ordering by key, the argument passed to startAt(), endAt(),or equalTo() must be a string.";if(t.hasStart()){if(t.getIndexStartName()!=L)throw new Error(r);if("string"!=typeof e)throw new Error(i)}if(t.hasEnd()){if(t.getIndexEndName()!=F)throw new Error(r);if("string"!=typeof n)throw new Error(i)}}else if(t.getIndex()===It){if(null!=e&&!ot(e)||null!=n&&!ot(n))throw new Error("Query: When ordering by priority, the first argument passed to startAt(), endAt(), or equalTo() must be a valid priority value (null, a number, or a string).")}else if(m.assert(t.getIndex()instanceof $t||t.getIndex()===Ht,"unknown index type."),null!=e&&"object"==typeof e||null!=n&&"object"==typeof n)throw new Error("Query: First argument passed to startAt(), endAt(), or equalTo() cannot be an object.")},t.validateLimit_=function(t){if(t.hasStart()&&t.hasEnd()&&t.hasLimit()&&!t.hasAnchoredLimit())throw new Error("Query: Can't combine startAt(), endAt(), and limit(). Use limitToFirst() or limitToLast() instead.")},t.prototype.validateNoPreviousOrderByCall_=function(t){if(!0===this.orderByCalled_)throw new Error(t+": You can't combine multiple orderBy calls.")},t.prototype.getQueryParams=function(){return this.queryParams_},t.prototype.getRef=function(){return m.validateArgCount("Query.ref",0,0,arguments.length),new t.__referenceConstructor(this.repo,this.path)},t.prototype.on=function(e,n,r,i){m.validateArgCount("Query.on",2,4,arguments.length),lt("Query.on",1,e,!1),m.validateCallback("Query.on",2,n,!1);var o=t.getCancelAndContextArgs_("Query.on",r,i);if("value"===e)this.onValueEvent(n,o.cancel,o.context);else{var a={};a[e]=n,this.onChildEvent(a,o.cancel,o.context)}return n},t.prototype.onValueEvent=function(t,e,n){var r=new Yt(t,e||null,n||null);this.repo.addEventCallbackForQuery(this,r)},t.prototype.onChildEvent=function(t,e,n){var r=new Xt(t,e,n);this.repo.addEventCallbackForQuery(this,r)},t.prototype.off=function(t,e,n){m.validateArgCount("Query.off",0,3,arguments.length),lt("Query.off",1,t,!0),m.validateCallback("Query.off",2,e,!0),m.validateContextObject("Query.off",3,n,!0);var r=null,i=null;if("value"===t){var o=e||null;r=new Yt(o,null,n||null)}else t&&(e&&((i={})[t]=e),r=new Xt(i,null,n||null));this.repo.removeEventCallbackForQuery(this,r)},t.prototype.once=function(e,n,r,i){var o=this;m.validateArgCount("Query.once",1,4,arguments.length),lt("Query.once",1,e,!1),m.validateCallback("Query.once",2,n,!0);var a=t.getCancelAndContextArgs_("Query.once",r,i),s=!0,u=new m.Deferred;u.promise.catch((function(){}));var c=function(t){s&&(s=!1,o.off(e,c),n&&n.bind(a.context)(t),u.resolve(t))};return this.on(e,c,(function(t){o.off(e,c),a.cancel&&a.cancel.bind(a.context)(t),u.reject(t)})),u.promise},t.prototype.limitToFirst=function(e){if(m.validateArgCount("Query.limitToFirst",1,1,arguments.length),"number"!=typeof e||Math.floor(e)!==e||e<=0)throw new Error("Query.limitToFirst: First argument must be a positive integer.");if(this.queryParams_.hasLimit())throw new Error("Query.limitToFirst: Limit was already set 
1(by another call to limit, limitToFirst, or limitToLast).");return new t(this.repo,this.path,this.queryParams_.limitToFirst(e),this.orderByCalled_)},t.prototype.limitToLast=function(e){if(m.validateArgCount("Query.limitToLast",1,1,arguments.length),"number"!=typeof e||Math.floor(e)!==e||e<=0)throw new Error("Query.limitToLast: First argument must be a positive integer.");if(this.queryParams_.hasLimit())throw new Error("Query.limitToLast: Limit was already set (by another call to limit, limitToFirst, or limitToLast).");return new t(this.repo,this.path,this.queryParams_.limitToLast(e),this.orderByCalled_)},t.prototype.orderByChild=function(e){if(m.validateArgCount("Query.orderByChild",1,1,arguments.length),"$key"===e)throw new Error('Query.orderByChild: "$key" is invalid.  Use Query.orderByKey() instead.');if("$priority"===e)throw new Error('Query.orderByChild: "$priority" is invalid.  Use Query.orderByPriority() instead.');if("$value"===e)throw new Error('Query.orderByChild: "$value" is invalid.  Use Query.orderByValue() instead.');ft("Query.orderByChild",1,e,!1),this.validateNoPreviousOrderByCall_("Query.orderByChild");var n=new Y(e);if(n.isEmpty())throw new Error("Query.orderByChild: cannot pass in empty path.  Use Query.orderByValue() instead.");var r=new $t(n),i=this.queryParams_.orderBy(r);return t.validateQueryEndpoints_(i),new t(this.repo,this.path,i,!0)},t.prototype.orderByKey=function(){m.validateArgCount("Query.orderByKey",0,0,arguments.length),this.validateNoPreviousOrderByCall_("Query.orderByKey");var e=this.queryParams_.orderBy(Ct);return t.validateQueryEndpoints_(e),new t(this.repo,this.path,e,!0)},t.prototype.orderByPriority=function(){m.validateArgCount("Query.orderByPriority",0,0,arguments.length),this.validateNoPreviousOrderByCall_("Query.orderByPriority");var e=this.queryParams_.orderBy(It);return t.validateQueryEndpoints_(e),new t(this.repo,this.path,e,!0)},t.prototype.orderByValue=function(){m.validateArgCount("Query.orderByValue",0,0,arguments.length),this.validateNoPreviousOrderByCall_("Query.orderByValue");var e=this.queryParams_.orderBy(Ht);return t.validateQueryEndpoints_(e),new t(this.repo,this.path,e,!0)},t.prototype.startAt=function(e,n){void 0===e&&(e=null),m.validateArgCount("Query.startAt",0,2,arguments.length),at("Query.startAt",1,e,this.path,!0),ht("Query.startAt",2,n,!0);var r=this.queryParams_.startAt(e,n);if(t.validateLimit_(r),t.validateQueryEndpoints_(r),this.queryParams_.hasStart())throw new Error("Query.startAt: Starting point was already set (by another call to startAt or equalTo).");return void 0===e&&(e=null,n=null),new t(this.repo,this.path,r,this.orderByCalled_)},t.prototype.endAt=function(e,n){void 0===e&&(e=null),m.validateArgCount("Query.endAt",0,2,arguments.length),at("Query.endAt",1,e,this.path,!0),ht("Query.endAt",2,n,!0);var r=this.queryParams_.endAt(e,n);if(t.validateLimit_(r),t.validateQueryEndpoints_(r),this.queryParams_.hasEnd())throw new Error("Query.endAt: Ending point was already set (by another call to endAt or equalTo).");return new t(this.repo,this.path,r,this.orderByCalled_)},t.prototype.equalTo=function(t,e){if(m.validateArgCount("Query.equalTo",1,2,arguments.length),at("Query.equalTo",1,t,this.path,!1),ht("Query.equalTo",2,e,!0),this.queryParams_.hasStart())throw new Error("Query.equalTo: Starting point was already set (by another call to startAt or equalTo).");if(this.queryParams_.hasEnd())throw new Error("Query.equalTo: Ending point was already set (by another call to endAt or equalTo).");return this.startAt(t,e).endAt(t,e)},t.prototype.toString=function(){return m.validateArgCount("Query.toString",0,0,arguments.length),this.repo.toString()+this.path.toUrlEncodedString()},t.prototype.toJSON=function(){return m.validateArgCount("Query.toJSON",0,1,arguments.length),this.toString()},t.prototype.queryObject=function(){return this.queryParams_.getQueryObject()},t.prototype.queryIdentifier=function(){var t=this.queryObject(),e=B(t);return"{}"===e?"default":e},t.prototype.isEqual=function(e){if(m.validateArgCount("Query.isEqual",1,1,arguments.length),!(e instanceof t)){var n="Query.isEqual failed: First argument must be an instance of firebase.database.Query.";throw new Error(n)}
1var r=this.repo===e.repo,i=this.path.equals(e.path),o=this.queryIdentifier()===e.queryIdentifier();return r&&i&&o},t.getCancelAndContextArgs_=function(t,e,n){var r={cancel:null,context:null};if(e&&n)r.cancel=e,m.validateCallback(t,3,r.cancel,!0),r.context=n,m.validateContextObject(t,4,r.context,!0);else if(e)if("object"==typeof e&&null!==e)r.context=e;else{if("function"!=typeof e)throw new Error(m.errorPrefix(t,3,!0)+" must either be a cancel callback or a context object.");r.cancel=e}return r},Object.defineProperty(t.prototype,"ref",{get:function(){return this.getRef()},enumerable:!0,configurable:!0}),t}(),Zt=function(){function t(){this.set={}}return t.prototype.add=function(t,e){this.set[t]=null===e||e},t.prototype.contains=function(t){return m.contains(this.set,t)},t.prototype.get=function(t){return this.contains(t)?this.set[t]:void 0},t.prototype.remove=function(t){delete this.set[t]},t.prototype.clear=function(){this.set={}},t.prototype.isEmpty=function(){return m.isEmpty(this.set)},t.prototype.count=function(){return m.getCount(this.set)},t.prototype.each=function(t){m.forEach(this.set,(function(e,n){return t(e,n)}))},t.prototype.keys=function(){var t=[];return m.forEach(this.set,(function(e){t.push(e)})),t},t}(),te=function(){function t(){this.value_=null,this.children_=null}return t.prototype.find=function(t){if(null!=this.value_)return this.value_.getChild(t);if(t.isEmpty()||null==this.children_)return null;var e=t.getFront();return t=t.popFront(),this.children_.contains(e)?this.children_.get(e).find(t):null},t.prototype.remember=function(e,n){if(e.isEmpty())this.value_=n,this.children_=null;else if(null!==this.value_)this.value_=this.value_.updateChild(e,n);else{null==this.children_&&(this.children_=new Zt);var r=e.getFront();this.children_.contains(r)||this.children_.add(r,new t);var i=this.children_.get(r);e=e.popFront(),i.remember(e,n)}},t.prototype.forget=function(t){if(t.isEmpty())return this.value_=null,this.children_=null,!0;if(null!==this.value_){if(this.value_.isLeafNode())return!1;var e=this.value_;this.value_=null;var n=this;return e.forEachChild(It,(function(t,e){n.remember(new Y(t),e)})),this.forget(t)}if(null!==this.children_){var r=t.getFront();return t=t.popFront(),this.children_.contains(r)&&this.children_.get(r).forget(t)&&this.children_.remove(r),!!this.children_.isEmpty()&&(this.children_=null,!0)}return!0},t.prototype.forEachTree=function(t,e){null!==this.value_?e(t,this.value_):this.forEachChild((function(n,r){var i=new Y(t.toString()+"/"+n);r.forEachTree(i,e)}))},t.prototype.forEachChild=function(t){null!==this.children_&&this.children_.each((function(e,n){t(e,n)}))},t}(),ee=function(t,e){return t&&"object"==typeof t?(m.assert(".sv"in t,"Unexpected leaf node or priority contents"),e[t[".sv"]]):t},ne=function(t,e){var n,r=t.getPriority().val(),i=ee(r,e);if(t.isLeafNode()){var o=t,a=ee(o.getValue(),e);return a!==o.getValue()||i!==o.getPriority().val()?new kt(a,qt(i)):t}var s=t;return n=s,i!==s.getPriority().val()&&(n=n.updatePriority(new kt(i))),s.forEachChild(It,(function(t,r){var i=ne(r,e);i!==r&&(n=n.updateImmediateChild(t,i))})),n},re=function(t){return t[t.OVERWRITE=0]="OVERWRITE",t[t.MERGE=1]="MERGE",t[t.ACK_USER_WRITE=2]="ACK_USER_WRITE",t[t.LISTEN_COMPLETE=3]="LISTEN_COMPLETE",t}({}),ie=function(){function t(t,e,n,r){this.fromUser=t,this.fromServer=e,this.queryId=n,this.tagged=r,m.assert(!r||e,"Tagged queries must be from server.")}return t.User=new t(!0,!1,null,!1),t.Server=new t(!1,!0,null,!1),t.forServerTaggedQuery=function(e){return new t(!1,!0,e,!0)},t}(),oe=function(){function t(t,e,n){this.path=t,this.affectedTree=e,this.revert=n,this.type=re.ACK_USER_WRITE,this.source=ie.User}return t.prototype.operationForChild=function(e){if(this.path.isEmpty()){if(null!=this.affectedTree.value)return m.assert(this.affectedTree.children.isEmpty(),"affectedTree should not have overlapping affected paths."),this;var n=this.affectedTree.subtree(new Y(e));return new t(Y.Empty,n,this.revert)}return m.assert(this.path.getFront()===e,"operationForChild called for unrelated child."),new t(this.path.popFront(),this.affectedTree,this.revert)},t}(),ae=function(){function t(t,e){void 0===e&&(Wt||(Wt=new Pt(V)),e=Wt),this.value=t,this.children=e}return t.fromObject=function(e){var n=t.Empty;return m.forEach(e,(function(t,e){n=n.set(new Y(t),e)})),n},t.prototype.isEmpty=function(){return null===this.value&&this.children.isEmpty()},t.prototype.findRootMostMatchingPathAndValue=function(t,e){if(null!=this.value&&e(this.value))return{path:Y.Empty,value:this.value};if(t.isEmpty())return null;var n=t.getFront(),r=this.children.get(n);if(null!==r){var i=r.findRootMostMatchingPathAndValue(t.popFront(),e);return null!=i?{path:new Y(n).child(i.path),value:i.value}:null}return null},t.prototype.findRootMostValueAndPath=function(t){return this.findRootMostMatchingPathAndValue(t,(function(){return!0}))},t.prototype.subtree=function(e){if(e.isEmpty())return this;var n=e.getFront(),r=this.children.get(n);return null!==r?r.subtree(e.popFront()):t.Empty},t.prototype.set=function(e,n){if(e.isEmpty())return new t(n,this.children);var r=e.getFront(),i=(this.children.get(r)||t.Empty).set(e.popFront(),n),o=this.children.insert(r,i);return new t(this.value,o)},t.prototype.remove=function(e){if(e.isEmpty())return this.children.isEmpty()?t.Empty:new t(null,this.children);var n=e.getFront(),r=this.children.get(n);if(r){var i=r.remove(e.popFront()),o=void 0;return o=i.isEmpty()?this.children.remove(n):this.children.insert(n,i),null===this.value&&o.isEmpty()?t.Empty:new t(this.value,o)}return this},t.prototype.get=function(t){if(t.isEmpty())return this.value;var e=t.getFront(),n=this.children.get(e);return n?n.get(t.popFront()):null},t.prototype.setTree=function(e,n){if(e.isEmpty())return n;var r,i=e.getFront(),o=(this.children.get(i)||t.Empty).setTree(e.popFront(),n);return r=o.isEmpty()?this.children.remove(i):this.children.insert(i,o),new t(this.value,r)},t.prototype.fold=function(t){return this.fold_(Y.Empty,t)}
1,t.prototype.fold_=function(t,e){var n={};return this.children.inorderTraversal((function(r,i){n[r]=i.fold_(t.child(r),e)})),e(t,this.value,n)},t.prototype.findOnPath=function(t,e){return this.findOnPath_(t,Y.Empty,e)},t.prototype.findOnPath_=function(t,e,n){var r=!!this.value&&n(e,this.value);if(r)return r;if(t.isEmpty())return null;var i=t.getFront(),o=this.children.get(i);return o?o.findOnPath_(t.popFront(),e.child(i),n):null},t.prototype.foreachOnPath=function(t,e){return this.foreachOnPath_(t,Y.Empty,e)},t.prototype.foreachOnPath_=function(e,n,r){if(e.isEmpty())return this;this.value&&r(n,this.value);var i=e.getFront(),o=this.children.get(i);return o?o.foreachOnPath_(e.popFront(),n.child(i),r):t.Empty},t.prototype.foreach=function(t){this.foreach_(Y.Empty,t)},t.prototype.foreach_=function(t,e){this.children.inorderTraversal((function(n,r){r.foreach_(t.child(n),e)})),this.value&&e(t,this.value)},t.prototype.foreachChild=function(t){this.children.inorderTraversal((function(e,n){n.value&&t(e,n.value)}))},t.Empty=new t(null),t}(),se=function(){function t(t,e){this.source=t,this.path=e,this.type=re.LISTEN_COMPLETE}return t.prototype.operationForChild=function(e){return this.path.isEmpty()?new t(this.source,Y.Empty):new t(this.source,this.path.popFront())},t}(),ue=function(){function t(t,e,n){this.source=t,this.path=e,this.snap=n,this.type=re.OVERWRITE}return t.prototype.operationForChild=function(e){return this.path.isEmpty()?new t(this.source,Y.Empty,this.snap.getImmediateChild(e)):new t(this.source,this.path.popFront(),this.snap)},t}(),ce=function(){function t(t,e,n){this.source=t,this.path=e,this.children=n,this.type=re.MERGE}return t.prototype.operationForChild=function(e){if(this.path.isEmpty()){var n=this.children.subtree(new Y(e));return n.isEmpty()?null:n.value?new ue(this.source,Y.Empty,n.value):new t(this.source,Y.Empty,n)}return m.assert(this.path.getFront()===e,"Can't get a merge for a child not on the path of the operation"),new t(this.source,this.path.popFront(),this.children)},t.prototype.toString=function(){return"Operation("+this.path+": "+this.source.toString()+" merge: "+this.children.toString()+")"},t}(),le=function(){function t(t,e,n){this.node_=t,this.fullyInitialized_=e,this.filtered_=n}return t.prototype.isFullyInitialized=function(){return this.fullyInitialized_},t.prototype.isFiltered=function(){return this.filtered_},t.prototype.isCompleteForPath=function(t){if(t.isEmpty())return this.isFullyInitialized()&&!this.filtered_;var e=t.getFront();return this.isCompleteForChild(e)},t.prototype.isCompleteForChild=function(t){return this.isFullyInitialized()&&!this.filtered_||this.node_.hasChild(t)},t.prototype.getNode=function(){return this.node_},t}(),he=function(){function t(t,e){this.eventCache_=t,this.serverCache_=e}return t.prototype.updateEventSnap=function(e,n,r){return new t(new le(e,n,r),this.serverCache_)},t.prototype.updateServerSnap=function(e,n,r){return new t(this.eventCache_,new le(e,n,r))},t.prototype.getEventCache=function(){return this.eventCache_},t.prototype.getCompleteEventSnap=function(){return this.eventCache_.isFullyInitialized()?this.eventCache_.getNode():null},t.prototype.getServerCache=function(){return this.serverCache_},t.prototype.getCompleteServerSnap=function(){return this.serverCache_.isFullyInitialized()?this.serverCache_.getNode():null},t.Empty=new t(new le(Ut.EMPTY_NODE,!1,!1),new le(Ut.EMPTY_NODE,!1,!1)),t}(),fe=function(){function t(t,e,n,r,i){this.type=t,this.snapshotNode=e,this.childName=n,this.oldSnap=r,this.prevName=i}return t.valueChange=function(e){return new t(t.VALUE,e)},t.childAddedChange=function(e,n){return new t(t.CHILD_ADDED,n,e)},t.childRemovedChange=function(e,n){return new t(t.CHILD_REMOVED,n,e)},t.childChangedChange=function(e,n,r){return new t(t.CHILD_CHANGED,n,e,r)},t.childMovedChange=function(e,n){return new t(t.CHILD_MOVED,n,e)},t.CHILD_ADDED="child_added",t.CHILD_REMOVED="child_removed",t.CHILD_CHANGED="child_changed",t.CHILD_MOVED="child_moved",t.VALUE="value",t}(),de=function(){function t(t){this.index_=t}return t.prototype.updateChild=function(t,e,n,r,i,o){m.assert(t.isIndexed(this.index_),"A node must be indexed if only a child is updated");var a=t.getImmediateChild(e);return a.getChild(r).equals(n.getChild(r))&&a.isEmpty()==n.isEmpty()?t:(null!=o&&(n.isEmpty()?t.hasChild(e)?o.trackChildChange(fe.childRemovedChange(e,a)):m.assert(t.isLeafNode(),"A child remove without an old child only makes sense on a leaf node"):a.isEmpty()?o.trackChildChange(fe.childAddedChange(e,n)):o.trackChildChange(fe.childChangedChange(e,n,a))),t.isLeafNode()&&n.isEmpty()?t:t.updateImmediateChild(e,n).withIndex(this.index_))},t.prototype.updateFullNode=function(t,e,n){return null!=n&&(t.isLeafNode()||t.forEachChild(It,(function(t,r){e.hasChild(t)||n.trackChildChange(fe.childRemovedChange(t,r))})),e.isLeafNode()||e.forEachChild(It,(function(e,r){if(t.hasChild(e)){var i=t.getImmediateChild(e);i.equals(r)||n.trackChildChange(fe.childChangedChange(e,r,i))}else n.trackChildChange(fe.childAddedChange(e,r))}))),e.withIndex(this.index_)},t.prototype.updatePriority=function(t,e){return t.isEmpty()?Ut.EMPTY_NODE:t.updatePriority(e)},t.prototype.filtersNodes=function(){return!1},t.prototype.getIndexedFilter=function(){return this},t.prototype.getIndex=function(){return this.index_},t}(),pe=function(){function t(){this.changeMap_={}}return t.prototype.trackChildChange=function(t){var e=t.type,n=t.childName;m.assert(e==fe.CHILD_ADDED||e==fe.CHILD_CHANGED||e==fe.CHILD_REMOVED,"Only child changes supported for tracking"),m.assert(".priority"!==n,"Only non-priority child changes can be tracked.");var r=m.safeGet(this.changeMap_,n);if(r){var i=r.type;if(e==fe.CHILD_ADDED&&i==fe.CHILD_REMOVED)this.changeMap_[n]=fe.childChangedChange(n,t.snapshotNode,r.snapshotNode);else if(e==fe.CHILD_REMOVED&&i==fe.CHILD_ADDED)delete this.changeMap_[n];else if(e==fe.CHILD_REMOVED&&i==fe.CHILD_CHANGED)this.changeMap_[n]=fe.childRemovedChange(n,r.oldSnap);else if(e==fe.CHILD_CHANGED&&i==fe.CHILD_ADDED)this.changeMap_[n]=fe.childAddedChange(n,t.snapshotNode);else{if(e!=fe.CHILD_CHANGED||i!=fe.CHILD_CHANGED)throw m.assertionError("Illegal combination of changes: "+t+" occurred after "+r);this.changeMap_[n]=fe.childChangedChange(n,t.snapshotNode,r.oldSnap)}}else this.changeMap_[n]=t},t.prototype.getChanges=function(){return m.getValues(this.changeMap_)},t}(),me=new(function(){function t(){}return t.prototype.getCompleteChild=function(t){return null},t.prototype.getChildAfterChild=function(t,e,n){return null},t}()),ye=function(){function t(t,e,n){void 0===n&&(n=null),this.writes_=t,this.viewCache_=e,this.optCompleteServerCache_=n}return t.prototype.getCompleteChild=function(t){var e=this.viewCache_.getEventCache();if(e.isCompleteForChild(t))return e.getNode().getImmediateChild(t);var n=null!=this.optCompleteServerCache_?new le(this.optCompleteServerCache_,!0,!1):this.viewCache_.getServerCache();return this.writes_.calcCompleteChild(t,n)},t.prototype.getChildAfterChild=function(t,e,n){var r=null!=this.optCompleteServerCache_?this.optCompleteServerCache_:this.viewCache_.getCompleteServerSnap(),i=this.writes_.calcIndexedSlice(r,e,1,n,t);return 0===i.length?null:i[0]},t}(),ve=function(){return function(t,e){this.viewCache=t,this.changes=e}}(),ge=function(){function t(t){this.filter_=t}return t.prototype.assertIndexed=function(t){m.assert(t.getEventCache().getNode().isIndexed(this.filter_.getIndex()),"Event snap not indexed"),m.assert(t.getServerCache().getNode().isIndexed(this.filter_.getIndex()),"Server snap not indexed")},t.prototype.applyOperation=function(e,n,r,i){var o,a,s=new pe;if(n.type===re.OVERWRITE){var u=n;u.source.fromUser?o=this.applyUserOverwrite_(e,u.path,u.snap,r,i,s):(m.assert(u.source.fromServer,"Unknown source."),a=u.source.tagged||e.getServerCache().isFiltered()&&!u.path.isEmpty(),o=this.applyServerOverwrite_(e,u.path,u.snap,r,i,a,s))}else if(n.type===re.MERGE){var c=n;c.source.fromUser?o=this.applyUserMerge_(e,c.path,c.children,r,i,s):(m.assert(c.source.fromServer,"Unknown source."),a=c.source.tagged||e.getServerCache().isFiltered(),o=this.applyServerMerge_(e,c.path,c.children,r,i,a,s))}else if(n.type===re.ACK_USER_WRITE){var l=n;o=l.revert?this.revertUserWrite_(e,l.path,r,i,s):this.ackUserWrite_(e,l.path,l.affectedTree,r,i,s)}else{if(n.type!==re.LISTEN_COMPLETE)throw m.assertionError("Unknown operation type: "+n.type);o=this.listenComplete_(e,n.path,r,s)}var h=s.getChanges();return t.maybeAddValueEvent_(e,o,h),new ve(o,h)},t.maybeAddValueEvent_=function(t,e,n){var r=e.getEventCache();if(r.isFullyInitialized()){var i=r.getNode().isLeafNode()||r.getNode().isEmpty(),o=t.getCompleteEventSnap();(n.length>
10||!t.getEventCache().isFullyInitialized()||i&&!r.getNode().equals(o)||!r.getNode().getPriority().equals(o.getPriority()))&&n.push(fe.valueChange(e.getCompleteEventSnap()))}},t.prototype.generateEventCacheAfterServerEvent_=function(t,e,n,r,i){var o=t.getEventCache();if(null!=n.shadowingWrite(e))return t;var a=void 0,s=void 0;if(e.isEmpty())if(m.assert(t.getServerCache().isFullyInitialized(),"If change path is empty, we must have complete server data"),t.getServerCache().isFiltered()){var u=t.getCompleteServerSnap(),c=n.calcCompleteEventChildren(u instanceof Ut?u:Ut.EMPTY_NODE);a=this.filter_.updateFullNode(t.getEventCache().getNode(),c,i)}else{var l=n.calcCompleteEventCache(t.getCompleteServerSnap());a=this.filter_.updateFullNode(t.getEventCache().getNode(),l,i)}else{var h=e.getFront();if(".priority"==h){m.assert(1==e.getLength(),"Can't have a priority with additional path components");var f=o.getNode();s=t.getServerCache().getNode();var d=n.calcEventCacheAfterServerOverwrite(e,f,s);a=null!=d?this.filter_.updatePriority(f,d):o.getNode()}else{var p=e.popFront(),y=void 0;if(o.isCompleteForChild(h)){s=t.getServerCache().getNode();var v=n.calcEventCacheAfterServerOverwrite(e,o.getNode(),s);y=null!=v?o.getNode().getImmediateChild(h).updateChild(p,v):o.getNode().getImmediateChild(h)}else y=n.calcCompleteChild(h,t.getServerCache());a=null!=y?this.filter_.updateChild(o.getNode(),h,y,p,r,i):o.getNode()}}return t.updateEventSnap(a,o.isFullyInitialized()||e.isEmpty(),this.filter_.filtersNodes())},t.prototype.applyServerOverwrite_=function(t,e,n,r,i,o,a){var s,u=t.getServerCache(),c=o?this.filter_:this.filter_.getIndexedFilter();if(e.isEmpty())s=c.updateFullNode(u.getNode(),n,null);else if(c.filtersNodes()&&!u.isFiltered()){var l=u.getNode().updateChild(e,n);s=c.updateFullNode(u.getNode(),l,null)}else{var h=e.getFront();if(!u.isCompleteForPath(e)&&e.getLength()>1)return t;var f=e.popFront(),d=u.getNode().getImmediateChild(h).updateChild(f,n);s=".priority"==h?c.updatePriority(u.getNode(),d):c.updateChild(u.getNode(),h,d,f,me,null)}var p=t.updateServerSnap(s,u.isFullyInitialized()||e.isEmpty(),c.filtersNodes()),m=new ye(r,p,i);return this.generateEventCacheAfterServerEvent_(p,e,r,m,a)},t.prototype.applyUserOverwrite_=function(t,e,n,r,i,o){var a,s,u=t.getEventCache(),c=new ye(r,t,i);if(e.isEmpty())s=this.filter_.updateFullNode(t.getEventCache().getNode(),n,o),a=t.updateEventSnap(s,!0,this.filter_.filtersNodes());else{var l=e.getFront();if(".priority"===l)s=this.filter_.updatePriority(t.getEventCache().getNode(),n),a=t.updateEventSnap(s,u.isFullyInitialized(),u.isFiltered());else{var h=e.popFront(),f=u.getNode().getImmediateChild(l),d=void 0;if(h.isEmpty())d=n;else{var p=c.getCompleteChild(l);d=null!=p?".priority"===h.getBack()&&p.getChild(h.parent()).isEmpty()?p:p.updateChild(h,n):Ut.EMPTY_NODE}if(f.equals(d))a=t;else{var m=this.filter_.updateChild(u.getNode(),l,d,h,c,o);a=t.updateEventSnap(m,u.isFullyInitialized(),this.filter_.filtersNodes())}}}return a},t.cacheHasChild_=function(t,e){return t.getEventCache().isCompleteForChild(e)},t.prototype.applyUserMerge_=function(e,n,r,i,o,a){var s=this,u=e;return r.foreach((function(r,c){var l=n.child(r);t.cacheHasChild_(e,l.getFront())&&(u=s.applyUserOverwrite_(u,l,c,i,o,a))})),r.foreach((function(r,c){var l=n.child(r);t.cacheHasChild_(e,l.getFront())||(u=s.applyUserOverwrite_(u,l,c,i,o,a))})),u},t.prototype.applyMerge_=function(t,e){return e.foreach((function(e,n){t=t.updateChild(e,n)})),t},t.prototype.applyServerMerge_=function(t,e,n,r,i,o,a){var s=this;if(t.getServerCache().getNode().isEmpty()&&!t.getServerCache().isFullyInitialized())return t;var u,c=t;u=e.isEmpty()?n:ae.Empty.setTree(e,n);var l=t.getServerCache().getNode();return u.children.inorderTraversal((function(e,n){if(l.hasChild(e)){var u=t.getServerCache().getNode().getImmediateChild(e),h=s.applyMerge_(u,n);c=s.applyServerOverwrite_(c,new Y(e),h,r,i,o,a)}})),u.children.inorderTraversal((function(e,n){var u=!t.getServerCache().isCompleteForChild(e)&&null==n.value;if(!l.hasChild(e)&&!u){var h=t.getServerCache().getNode().getImmediateChild(e),f=s.applyMerge_(h,n);c=s.applyServerOverwrite_(c,new Y(e),f,r,i,o,a)}})),c},t.prototype.ackUserWrite_=function(t,e,n,r,i,o){if(null!=r.shadowingWrite(e))return t;var a=t.getServerCache().isFiltered(),s=t.getServerCache();if(null!=n.value){if(e.isEmpty()&&s.isFullyInitialized()||s.isCompleteForPath(e))return this.applyServerOverwrite_(t,e,s.getNode().getChild(e),r,i,a,o);if(e.isEmpty()){var u=ae.Empty;
1return s.getNode().forEachChild(Ct,(function(t,e){u=u.set(new Y(t),e)})),this.applyServerMerge_(t,e,u,r,i,a,o)}return t}var c=ae.Empty;return n.foreach((function(t,n){var r=e.child(t);s.isCompleteForPath(r)&&(c=c.set(t,s.getNode().getChild(r)))})),this.applyServerMerge_(t,e,c,r,i,a,o)},t.prototype.listenComplete_=function(t,e,n,r){var i=t.getServerCache(),o=t.updateServerSnap(i.getNode(),i.isFullyInitialized()||e.isEmpty(),i.isFiltered());return this.generateEventCacheAfterServerEvent_(o,e,n,me,r)},t.prototype.revertUserWrite_=function(t,e,n,r,i){var o;if(null!=n.shadowingWrite(e))return t;var a=new ye(n,t,r),s=t.getEventCache().getNode(),u=void 0;if(e.isEmpty()||".priority"===e.getFront()){var c=void 0;if(t.getServerCache().isFullyInitialized())c=n.calcCompleteEventCache(t.getCompleteServerSnap());else{var l=t.getServerCache().getNode();m.assert(l instanceof Ut,"serverChildren would be complete if leaf node"),c=n.calcCompleteEventChildren(l)}u=this.filter_.updateFullNode(s,c=c,i)}else{var h=e.getFront(),f=n.calcCompleteChild(h,t.getServerCache());null==f&&t.getServerCache().isCompleteForChild(h)&&(f=s.getImmediateChild(h)),(u=null!=f?this.filter_.updateChild(s,h,f,e.popFront(),a,i):t.getEventCache().getNode().hasChild(h)?this.filter_.updateChild(s,h,Ut.EMPTY_NODE,e.popFront(),a,i):s).isEmpty()&&t.getServerCache().isFullyInitialized()&&(o=n.calcCompleteEventCache(t.getCompleteServerSnap())).isLeafNode()&&(u=this.filter_.updateFullNode(u,o,i))}return o=t.getServerCache().isFullyInitialized()||null!=n.shadowingWrite(Y.Empty),t.updateEventSnap(u,o,this.filter_.filtersNodes())},t}(),be=function(){function t(t){this.query_=t,this.index_=this.query_.getQueryParams().getIndex()}return t.prototype.generateEventsForChanges=function(t,e,n){var r=this,i=[],o=[];return t.forEach((function(t){t.type===fe.CHILD_CHANGED&&r.index_.indexedValueChanged(t.oldSnap,t.snapshotNode)&&o.push(fe.childMovedChange(t.childName,t.snapshotNode))})),this.generateEventsForType_(i,fe.CHILD_REMOVED,t,n,e),this.generateEventsForType_(i,fe.CHILD_ADDED,t,n,e),this.generateEventsForType_(i,fe.CHILD_MOVED,o,n,e),this.generateEventsForType_(i,fe.CHILD_CHANGED,t,n,e),this.generateEventsForType_(i,fe.VALUE,t,n,e),i},t.prototype.generateEventsForType_=function(t,e,n,r,i){var o=this,a=n.filter((function(t){return t.type===e}));a.sort(this.compareChanges_.bind(this)),a.forEach((function(e){var n=o.materializeSingleChange_(e,i);r.forEach((function(r){r.respondsTo(e.type)&&t.push(r.createEvent(n,o.query_))}))}))},t.prototype.materializeSingleChange_=function(t,e){return"value"===t.type||"child_removed"===t.type||(t.prevName=e.getPredecessorChildName(t.childName,t.snapshotNode,this.index_)),t},t.prototype.compareChanges_=function(t,e){if(null==t.childName||null==e.childName)throw m.assertionError("Should only compare child_ events.");var n=new wt(t.childName,t.snapshotNode),r=new wt(e.childName,e.snapshotNode);return this.index_.compare(n,r)},t}(),we=function(){function t(t,e){this.query_=t,this.eventRegistrations_=[];var n=this.query_.getQueryParams(),r=new de(n.getIndex()),i=n.getNodeFilter();this.processor_=new ge(i);var o=e.getServerCache(),a=e.getEventCache(),s=r.updateFullNode(Ut.EMPTY_NODE,o.getNode(),null),u=i.updateFullNode(Ut.EMPTY_NODE,a.getNode(),null),c=new le(s,o.isFullyInitialized(),r.filtersNodes()),l=new le(u,a.isFullyInitialized(),i.filtersNodes());this.viewCache_=new he(l,c),this.eventGenerator_=new be(this.query_)}return t.prototype.getQuery=function(){return this.query_},t.prototype.getServerCache=function(){return this.viewCache_.getServerCache().getNode()},t.prototype.getCompleteServerCache=function(t){var e=this.viewCache_.getCompleteServerSnap();return e&&(this.query_.getQueryParams().loadsAllData()||!t.isEmpty()&&!e.getImmediateChild(t.getFront()).isEmpty())?e.getChild(t):null},t.prototype.isEmpty=function(){return 0===this.eventRegistrations_.length},t.prototype.addEventRegistration=function(t){this.eventRegistrations_.push(t)},t.prototype.removeEventRegistration=function(t,e){var n=[];if(e){m.assert(null==t,"A cancel should cancel all event registrations.");var r=this.query_.path;this.eventRegistrations_.forEach((function(t){var i=t.createCancelEvent(e=e,r);i&&n.push(i)}))}if(t){for(var i=[],o=0;o<this.eventRegistrations_.length;++o){var a=this.eventRegistrations_[o];if(a.matches(t)){if(t.hasAnyCallback()){i=i.concat(this.eventRegistrations_.slice(o+1));break}}else i.push(a)}this.eventRegistrations_=i}else this.eventRegistrations_=[];return n},t.prototype.applyOperation=function(t,e,n){t.type===re.MERGE&&null!==t.source.queryId&&(m.assert(this.viewCache_.getCompleteServerSnap(),"We should always have a full c
1ache before handling merges"),m.assert(this.viewCache_.getCompleteEventSnap(),"Missing event cache, even though we have a server cache"));var r=this.viewCache_,i=this.processor_.applyOperation(r,t,e,n);return this.processor_.assertIndexed(i.viewCache),m.assert(i.viewCache.getServerCache().isFullyInitialized()||!r.getServerCache().isFullyInitialized(),"Once a server snap is complete, it should never go back"),this.viewCache_=i.viewCache,this.generateEventsForChanges_(i.changes,i.viewCache.getEventCache().getNode(),null)},t.prototype.getInitialEvents=function(t){var e=this.viewCache_.getEventCache(),n=[];return e.getNode().isLeafNode()||e.getNode().forEachChild(It,(function(t,e){n.push(fe.childAddedChange(t,e))})),e.isFullyInitialized()&&n.push(fe.valueChange(e.getNode())),this.generateEventsForChanges_(n,e.getNode(),t)},t.prototype.generateEventsForChanges_=function(t,e,n){return this.eventGenerator_.generateEventsForChanges(t,e,n?[n]:this.eventRegistrations_)},t}(),_e=function(){function t(){this.views_={}}return Object.defineProperty(t,"__referenceConstructor",{get:function(){return m.assert(zt,"Reference.ts has not been loaded"),zt},set:function(t){m.assert(!zt,"__referenceConstructor has already been defined"),zt=t},enumerable:!0,configurable:!0}),t.prototype.isEmpty=function(){return m.isEmpty(this.views_)},t.prototype.applyOperation=function(t,e,n){var r=t.source.queryId;if(null!==r){var i=m.safeGet(this.views_,r);return m.assert(null!=i,"SyncTree gave us an op for an invalid query."),i.applyOperation(t,e,n)}var o=[];return m.forEach(this.views_,(function(r,i){o=o.concat(i.applyOperation(t,e,n))})),o},t.prototype.addEventRegistration=function(t,e,n,r,i){var o=t.queryIdentifier(),a=m.safeGet(this.views_,o);if(!a){var s=n.calcCompleteEventCache(i?r:null),u=!1;s?u=!0:r instanceof Ut?(s=n.calcCompleteEventChildren(r),u=!1):(s=Ut.EMPTY_NODE,u=!1);var c=new he(new le(s,u,!1),new le(r,i,!1));a=new we(t,c),this.views_[o]=a}return a.addEventRegistration(e),a.getInitialEvents(e)},t.prototype.removeEventRegistration=function(e,n,r){var i=e.queryIdentifier(),o=[],a=[],s=this.hasCompleteView();if("default"===i){var u=this;m.forEach(this.views_,(function(t,e){a=a.concat(e.removeEventRegistration(n,r)),e.isEmpty()&&(delete u.views_[t],e.getQuery().getQueryParams().loadsAllData()||o.push(e.getQuery()))}))}else{var c=m.safeGet(this.views_,i);c&&(a=a.concat(c.removeEventRegistration(n,r)),c.isEmpty()&&(delete this.views_[i],c.getQuery().getQueryParams().loadsAllData()||o.push(c.getQuery())))}return s&&!this.hasCompleteView()&&o.push(new t.__referenceConstructor(e.repo,e.path)),{removed:o,events:a}},t.prototype.getQueryViews=function(){var t=this;return Object.keys(this.views_).map((function(e){return t.views_[e]})).filter((function(t){return!t.getQuery().getQueryParams().loadsAllData()}))},t.prototype.getCompleteServerCache=function(t){var e=null;return m.forEach(this.views_,(function(n,r){e=e||r.getCompleteServerCache(t)})),e},t.prototype.viewForQuery=function(t){if(t.getQueryParams().loadsAllData())return this.getCompleteView();var e=t.queryIdentifier();return m.safeGet(this.views_,e)},t.prototype.viewExistsForQuery=function(t){return null!=this.viewForQuery(t)},t.prototype.hasCompleteView=function(){return null!=this.getCompleteView()},t.prototype.getCompleteView=function(){return m.findValue(this.views_,(function(t){return t.getQuery().getQueryParams().loadsAllData()}))||null},t}(),Se=function(){function t(t){this.writeTree_=t}return t.prototype.addWrite=function(e,n){if(e.isEmpty())return new t(new ae(n));var r=this.writeTree_.findRootMostValueAndPath(e);if(null!=r){var i=r.path,o=r.value,a=Y.relativePath(i,e);return o=o.updateChild(a,n),new t(this.writeTree_.set(i,o))}var s=new ae(n);return new t(this.writeTree_.setTree(e,s))},t.prototype.addWrites=function(t,e){var n=this;return m.forEach(e,(function(e,r){n=n.addWrite(t.child(e),r)})),n},t.prototype.removeWrite=function(e){return e.isEmpty()?t.Empty:new t(this.writeTree_.setTree(e,ae.Empty))},t.prototype.hasCompleteWrite=function(t){return null!=this.getCompleteNode(t)},t.prototype.getCompleteNode=function(t){var e=this.writeTree_.findRootMostValueAndPath(t);return null!=e?this.writeTree_.get(e.path).getChild(Y.relativePath(e.path,t)):null},t.prototype.getCompleteChildren=function(){var t=[],e=this.writeTree_.value;return null!=e?e.isLeafNode()||e.forEachChild(It,(function(e,n){t.push(new wt(e,n))}
1)):this.writeTree_.children.inorderTraversal((function(e,n){null!=n.value&&t.push(new wt(e,n.value))})),t},t.prototype.childCompoundWrite=function(e){if(e.isEmpty())return this;var n=this.getCompleteNode(e);return new t(null!=n?new ae(n):this.writeTree_.subtree(e))},t.prototype.isEmpty=function(){return this.writeTree_.isEmpty()},t.prototype.apply=function(e){return t.applySubtreeWrite_(Y.Empty,this.writeTree_,e)},t.Empty=new t(new ae(null)),t.applySubtreeWrite_=function(e,n,r){if(null!=n.value)return r.updateChild(e,n.value);var i=null;return n.children.inorderTraversal((function(n,o){".priority"===n?(m.assert(null!==o.value,"Priority writes must always be leaf nodes"),i=o.value):r=t.applySubtreeWrite_(e.child(n),o,r)})),r.getChild(e).isEmpty()||null===i||(r=r.updateChild(e.child(".priority"),i)),r},t}(),Ce=function(){function t(){this.visibleWrites_=Se.Empty,this.allWrites_=[],this.lastWriteId_=-1}return t.prototype.childWrites=function(t){return new Ee(t,this)},t.prototype.addOverwrite=function(t,e,n,r){m.assert(n>this.lastWriteId_,"Stacking an older write on top of newer ones"),void 0===r&&(r=!0),this.allWrites_.push({path:t,snap:e,writeId:n,visible:r}),r&&(this.visibleWrites_=this.visibleWrites_.addWrite(t,e)),this.lastWriteId_=n},t.prototype.addMerge=function(t,e,n){m.assert(n>this.lastWriteId_,"Stacking an older merge on top of newer ones"),this.allWrites_.push({path:t,children:e,writeId:n,visible:!0}),this.visibleWrites_=this.visibleWrites_.addWrites(t,e),this.lastWriteId_=n},t.prototype.getWrite=function(t){for(var e=0;e<this.allWrites_.length;e++){var n=this.allWrites_[e];if(n.writeId===t)return n}return null},t.prototype.removeWrite=function(t){var e=this,n=this.allWrites_.findIndex((function(e){return e.writeId===t}));m.assert(n>=0,"removeWrite called with nonexistent writeId.");var r=this.allWrites_[n];this.allWrites_.splice(n,1);for(var i=r.visible,o=!1,a=this.allWrites_.length-1;i&&a>=0;){var s=this.allWrites_[a];s.visible&&(a>=n&&this.recordContainsPath_(s,r.path)?i=!1:r.path.contains(s.path)&&(o=!0)),a--}return!!i&&(o?(this.resetTree_(),!0):(r.snap?this.visibleWrites_=this.visibleWrites_.removeWrite(r.path):m.forEach(r.children,(function(t){e.visibleWrites_=e.visibleWrites_.removeWrite(r.path.child(t))})),!0))},t.prototype.getCompleteWriteData=function(t){return this.visibleWrites_.getCompleteNode(t)},t.prototype.calcCompleteEventCache=function(e,n,r,i){if(r||i){var o=this.visibleWrites_.childCompoundWrite(e);return!i&&o.isEmpty()?n:i||null!=n||o.hasCompleteWrite(Y.Empty)?t.layerTree_(this.allWrites_,(function(t){return(t.visible||i)&&(!r||!~r.indexOf(t.writeId))&&(t.path.contains(e)||e.contains(t.path))}),e).apply(n||Ut.EMPTY_NODE):null}var a=this.visibleWrites_.getCompleteNode(e);if(null!=a)return a;var s=this.visibleWrites_.childCompoundWrite(e);return s.isEmpty()?n:null!=n||s.hasCompleteWrite(Y.Empty)?s.apply(n||Ut.EMPTY_NODE):null},t.prototype.calcCompleteEventChildren=function(t,e){var n=Ut.EMPTY_NODE,r=this.visibleWrites_.getCompleteNode(t);if(r)return r.isLeafNode()||r.forEachChild(It,(function(t,e){n=n.updateImmediateChild(t,e)})),n;if(e){var i=this.visibleWrites_.childCompoundWrite(t);return e.forEachChild(It,(function(t,e){var r=i.childCompoundWrite(new Y(t)).apply(e);n=n.updateImmediateChild(t,r)}
1)),i.getCompleteChildren().forEach((function(t){n=n.updateImmediateChild(t.name,t.node)})),n}return this.visibleWrites_.childCompoundWrite(t).getCompleteChildren().forEach((function(t){n=n.updateImmediateChild(t.name,t.node)})),n},t.prototype.calcEventCacheAfterServerOverwrite=function(t,e,n,r){m.assert(n||r,"Either existingEventSnap or existingServerSnap must exist");var i=t.child(e);if(this.visibleWrites_.hasCompleteWrite(i))return null;var o=this.visibleWrites_.childCompoundWrite(i);return o.isEmpty()?r.getChild(e):o.apply(r.getChild(e))},t.prototype.calcCompleteChild=function(t,e,n){var r=t.child(e),i=this.visibleWrites_.getCompleteNode(r);return null!=i?i:n.isCompleteForChild(e)?this.visibleWrites_.childCompoundWrite(r).apply(n.getNode().getImmediateChild(e)):null},t.prototype.shadowingWrite=function(t){return this.visibleWrites_.getCompleteNode(t)},t.prototype.calcIndexedSlice=function(t,e,n,r,i,o){var a,s=this.visibleWrites_.childCompoundWrite(t),u=s.getCompleteNode(Y.Empty);if(null!=u)a=u;else{if(null==e)return[];a=s.apply(e)}if((a=a.withIndex(o)).isEmpty()||a.isLeafNode())return[];for(var c=[],l=o.getCompare(),h=i?a.getReverseIteratorFrom(n,o):a.getIteratorFrom(n,o),f=h.getNext();f&&c.length<r;)0!==l(f,n)&&c.push(f),f=h.getNext();return c},t.prototype.recordContainsPath_=function(t,e){return t.snap?t.path.contains(e):!!m.findKey(t.children,(function(n,r){return t.path.child(r).contains(e)}))},t.prototype.resetTree_=function(){this.visibleWrites_=t.layerTree_(this.allWrites_,t.DefaultFilter_,Y.Empty),this.lastWriteId_=this.allWrites_.length>0?this.allWrites_[this.allWrites_.length-1].writeId:-1},t.DefaultFilter_=function(t){return t.visible},t.layerTree_=function(t,e,n){for(var r=Se.Empty,i=0;i<t.length;++i){var o=t[i];if(e(o)){var a=o.path,s=void 0;if(o.snap)n.contains(a)?(s=Y.relativePath(n,a),r=r.addWrite(s,o.snap)):a.contains(n)&&(s=Y.relativePath(a,n),r=r.addWrite(Y.Empty,o.snap.getChild(s)));else{if(!o.children)throw m.assertionError("WriteRecord should have .snap or .children");if(n.contains(a))s=Y.relativePath(n,a),r=r.addWrites(s,o.children);else if(a.contains(n))if((s=Y.relativePath(a,n)).isEmpty())r=r.addWrites(Y.Empty,o.children);else{var u=m.safeGet(o.children,s.getFront());if(u){var c=u.getChild(s.popFront());r=r.addWrite(Y.Empty,c)}}}}}return r},t}(),Ee=function(){function t(t,e){this.treePath_=t,this.writeTree_=e}return t.prototype.calcCompleteEventCache=function(t,e,n){return this.writeTree_.calcCompleteEventCache(this.treePath_,t,e,n)},t.prototype.calcCompleteEventChildren=function(t){return this.writeTree_.calcCompleteEventChildren(this.treePath_,t)},t.prototype.calcEventCacheAfterServerOverwrite=function(t,e,n){return this.writeTree_.calcEventCacheAfterServerOverwrite(this.treePath_,t,e,n)},t.prototype.shadowingWrite=function(t){return this.writeTree_.shadowingWrite(this.treePath_.child(t))},t.prototype.calcIndexedSlice=function(t,e,n,r,i){return this.writeTree_.calcIndexedSlice(this.treePath_,t,e,n,r,i)},t.prototype.calcCompleteChild=function(t,e){return this.writeTree_.calcCompleteChild(this.treePath_,t,e)},t.prototype.child=function(e){return new t(this.treePath_.child(e),this.writeTree_)},t}(),Te=function(){function t(t){this.listenProvider_=t,this.syncPointTree_=ae.Empty,this.pendingWriteTree_=new Ce,this.tagToQueryMap_={},this.queryToTagMap_={}}return t.prototype.applyUserOverwrite=function(t,e,n,r){return this.pendingWriteTree_.addOverwrite(t,e,n,r),r?this.applyOperationToSyncPoints_(new ue(ie.User,t,e)):[]},t.prototype.applyUserMerge=function(t,e,n){this.pendingWriteTree_.addMerge(t,e,n);var r=ae.fromObject(e);return this.applyOperationToSyncPoints_(new ce(ie.User,t,r))},t.prototype.ackUserWrite=function(t,e){void 0===e&&(e=!1);var n=this.pendingWriteTree_.getWrite(t);if(this.pendingWriteTree_.removeWrite(t)){var r=ae.Empty;return null!=n.snap?r=r.set(Y.Empty,!0):m.forEach(n.children,(function(t,e){r=r.set(new Y(t),e)})),this.applyOperationToSyncPoints_(new oe(n.path,r,e))}return[]},t.prototype.applyServerOverwrite=function(t,e){return this.applyOperationToSyncPoints_(new ue(ie.Server,t,e))},t.prototype.applyServerMerge=function(t,e){var n=ae.fromObject(e);return this.applyOperationToSyncPoints_(new ce(ie.Server,t,n))},t.prototype.applyListenComplete=function(t){return this.applyOperationToSyncPoints_(new se(ie.Server,t))},t.prototype.applyTaggedQueryOverwrite=function(e,n,r){var i=this.queryKeyForTag_(r);if(null!=i){var o=t.parseQueryKey_(i),a=o.path,s=o.queryId,u=Y.relativePath(a,e),c=new ue(ie.forServerTaggedQuery(s),u,n);return this.applyTaggedOperation_(a,c)}return[]},t.prototype.applyTaggedQueryMerge=function(e,n,r){var i=this.queryKeyForTag_(r);if(i){var o=t.parseQueryKey_(i),a=o.path,s=o.queryId,u=Y.relativePath(a,e),c=ae.fromObject(n),l=new ce(ie.forServerTaggedQuery(s),u,c);return this.applyTaggedOperation_(a,l)}return[]},t.prototype.applyTaggedListenComplete=function(e,n){var r=this.queryKeyForTag_(n);if(r){var i=t.parseQueryKey_(r),o=i.path,a=i.queryId,s=Y.relativePath(o,e),u=new se(ie.forServerTaggedQuery(a),s);return this.applyTaggedOperation_(o,u)}return[]},t.prototype.addEventRegistration=function(e,n){var r=e.path,i=null,o=!1;this.syncPointTree_.foreachOnPath(r,(function(t,e){var n=Y.relativePath(t,r);i=i||e.getCompleteServerCache(n),o=o||e.hasCompleteView()}));var a,s=this.syncPointTree_.get(r);s?(o=o||s.hasCompleteView(),i=i||s.getCompleteServerCache(Y.Empty)):(s=new _e,this.syncPointTree_=this.syncPointTree_.set(r,s)),null!=i?a=!0:(a=!1,i=Ut.EMPTY_NODE,this.syncPointTree_.subtree(r).foreachChild((function(t,e){var n=e.getCompleteServerCache(Y.Empty);n&&(i=i.updateImmediateChild(t,n))}
1)));var u=s.viewExistsForQuery(e);if(!u&&!e.getQueryParams().loadsAllData()){var c=t.makeQueryKey_(e);m.assert(!(c in this.queryToTagMap_),"View does not exist, but we have a tag");var l=t.getNextQueryTag_();this.queryToTagMap_[c]=l,this.tagToQueryMap_["_"+l]=c}var h=this.pendingWriteTree_.childWrites(r),f=s.addEventRegistration(e,n,h,i,a);if(!u&&!o){var d=s.viewForQuery(e);f=f.concat(this.setupListener_(e,d))}return f},t.prototype.removeEventRegistration=function(e,n,r){var i=this,o=e.path,a=this.syncPointTree_.get(o),s=[];if(a&&("default"===e.queryIdentifier()||a.viewExistsForQuery(e))){var u=a.removeEventRegistration(e,n,r);a.isEmpty()&&(this.syncPointTree_=this.syncPointTree_.remove(o));var c=u.removed;s=u.events;var l=-1!==c.findIndex((function(t){return t.getQueryParams().loadsAllData()})),h=this.syncPointTree_.findOnPath(o,(function(t,e){return e.hasCompleteView()}));if(l&&!h){var f=this.syncPointTree_.subtree(o);if(!f.isEmpty())for(var d=this.collectDistinctViewsForSubTree_(f),p=0;p<d.length;++p){var m=d[p],y=m.getQuery(),v=this.createListenerForView_(m);this.listenProvider_.startListening(t.queryForListening_(y),this.tagForQuery_(y),v.hashFn,v.onComplete)}}!h&&c.length>0&&!r&&(l?this.listenProvider_.stopListening(t.queryForListening_(e),null):c.forEach((function(e){var n=i.queryToTagMap_[t.makeQueryKey_(e)];i.listenProvider_.stopListening(t.queryForListening_(e),n)}))),this.removeTags_(c)}return s},t.prototype.calcCompleteEventCache=function(t,e){var n=this.pendingWriteTree_,r=this.syncPointTree_.findOnPath(t,(function(e,n){var r=Y.relativePath(e,t),i=n.getCompleteServerCache(r);if(i)return i}));return n.calcCompleteEventCache(t,r,e,!0)},t.prototype.collectDistinctViewsForSubTree_=function(t){return t.fold((function(t,e,n){if(e&&e.hasCompleteView())return[e.getCompleteView()];var r=[];return e&&(r=e.getQueryViews()),m.forEach(n,(function(t,e){r=r.concat(e)})),r}))},t.prototype.removeTags_=function(e){for(var n=0;n<e.length;++n){var r=e[n];if(!r.getQueryParams().loadsAllData()){var i=t.makeQueryKey_(r),o=this.queryToTagMap_[i];delete this.queryToTagMap_[i],delete this.tagToQueryMap_["_"+o]}}},t.queryForListening_=function(t){return t.getQueryParams().loadsAllData()&&
1!t.getQueryParams().isDefault()?t.getRef():t},t.prototype.setupListener_=function(e,n){var r=e.path,i=this.tagForQuery_(e),o=this.createListenerForView_(n),a=this.listenProvider_.startListening(t.queryForListening_(e),i,o.hashFn,o.onComplete),s=this.syncPointTree_.subtree(r);if(i)m.assert(!s.value.hasCompleteView(),"If we're adding a query, it shouldn't be shadowed");else for(var u=s.fold((function(t,e,n){if(!t.isEmpty()&&e&&e.hasCompleteView())return[e.getCompleteView().getQuery()];var r=[];return e&&(r=r.concat(e.getQueryViews().map((function(t){return t.getQuery()})))),m.forEach(n,(function(t,e){r=r.concat(e)})),r})),c=0;c<u.length;++c){var l=u[c];this.listenProvider_.stopListening(t.queryForListening_(l),this.tagForQuery_(l))}return a},t.prototype.createListenerForView_=function(t){var e=this,n=t.getQuery(),r=this.tagForQuery_(n);return{hashFn:function(){return(t.getServerCache()||Ut.EMPTY_NODE).hash()},onComplete:function(t){if("ok"===t)return r?e.applyTaggedListenComplete(n.path,r):e.applyListenComplete(n.path);var i=function(t,e){var n="Unknown Error";"too_big"===t?n="The data requested exceeds the maximum size that can be accessed with a single request.":"permission_denied"==t?n="Client doesn't have permission to access the desired data.":"unavailable"==t&&(n="The service is unavailable");var r=new Error(t+" at "+e.path.toString()+": "+n);return r.code=t.toUpperCase(),r}(t,n);return e.removeEventRegistration(n,null,i)}}},t.makeQueryKey_=function(t){return t.path.toString()+"$"+t.queryIdentifier()},t.parseQueryKey_=function(t){var e=t.indexOf("$");return m.assert(-1!==e&&e<t.length-1,"Bad queryKey."),{queryId:t.substr(e+1),path:new Y(t.substr(0,e))}},t.prototype.queryKeyForTag_=function(t){return this.tagToQueryMap_["_"+t]},t.prototype.tagForQuery_=function(e){var n=t.makeQueryKey_(e);return m.safeGet(this.queryToTagMap_,n)},t.getNextQueryTag_=function(){return t.nextQueryTag_++},t.prototype.applyTaggedOperation_=function(t,e){var n=this.syncPointTree_.get(t);m.assert(n,"Missing sync point for query tag that we're tracking");var r=this.pendingWriteTree_.childWrites(t);return n.applyOperation(e,r,null)},t.prototype.applyOperationToSyncPoints_=function(t){return this.applyOperationHelper_(t,this.syncPointTree_,null,this.pendingWriteTree_.childWrites(Y.Empty))},t.prototype.applyOperationHelper_=function(t,e,n,r){if(t.path.isEmpty())return this.applyOperationDescendantsHelper_(t,e,n,r);var i=e.get(Y.Empty);null==n&&null!=i&&(n=i.getCompleteServerCache(Y.Empty));var o=[],a=t.path.getFront(),s=t.operationForChild(a),u=e.children.get(a);if(u&&s){var c=n?n.getImmediateChild(a):null,l=r.child(a);o=o.concat(this.applyOperationHelper_(s,u,c,l))}return i&&(o=o.concat(i.applyOperation(t,r,n))),o},t.prototype.applyOperationDescendantsHelper_=function(t,e,n,r){var i=this,o=e.get(Y.Empty);null==n&&null!=o&&(n=o.getCompleteServerCache(Y.Empty));var a=[];return e.children.inorderTraversal((function(e,o){var s=n?n.getImmediateChild(e):null,u=r.child(e),c=t.operationForChild(e);c&&(a=a.concat(i.applyOperationDescendantsHelper_(c,o,s,u)))})),o&&(a=a.concat(o.applyOperation(t,r,n))),a},t.nextQueryTag_=1,t}(),ke=function(){function t(){this.rootNode_=Ut.EMPTY_NODE}return t.prototype.getNode=function(t){return this.rootNode_.getChild(t)},t.prototype.updateSnapshot=function(t,e){this.rootNode_=this.rootNode_.updateChild(t,e)},t}(),Ie=function(){function t(t){this.app_=t}return t.prototype.getToken=function(t){return this.app_.INTERNAL.getToken(t).then(null,(function(t){return t&&"auth/token-not-initialized"===t.code?(P("Got auth/token-not-initialized error.  Treating as null token."),null):Promise.reject(t)}))},t.prototype.addTokenChangeListener=function(t){this.app_.INTERNAL.addAuthTokenListener(t)},t.prototype.removeTokenChangeListener=function(t){this.app_.INTERNAL.removeAuthTokenListener(t)},t.prototype.notifyForInvalidToken=function(){var t='Provided authentication credentials for the app named "'+this.app_.name+'" are invalid. This usually indicates your app was not initialized correctly. ';j(t+="credential"in this.app_.options?'Make sure the "credential" property provided to initializeApp() is authorized to access the specified "databaseURL" and is from the correct project.':"serviceAccount"in this.app_.options?'Make sure the "serviceAccount" property provided to initializeApp() is authorized to access the specified "databaseURL" and is from the correct project.':'Make sure the "apiKey" and "databaseURL" properties provided to initializeApp() match the values provided for your app at https://console.firebase.google.com/.')},t}(),Oe=function(){function t(){this.counters_={}}return t.prototype.incrementCounter=function(t,e){void 0===e&&(e=1),m.contains(this.counters_,t)||(this.counters_[t]=0),this.counters_[t]+=e},t.prototype.get=function(){return m.deepCopy(this.counters_)},t}(),xe=function(){function t(){}return t.getCollection=function(t){var e=t.toString();return this.collections_[e]||(this.collections_[e]=new Oe),this.collections_[e]},t.getOrCreateReporter=function(t,e){var n=t.toString();return this.reporters_[n]||(this.reporters_[n]=e()),this.reporters_[n]},t.collections_={},t.reporters_={},t}(),Ae=function(){function t(t){this.collection_=t,this.last_=null}return t.prototype.get=function(){var t=this.collection_.get(),e=m.clone(t);return this.last_&&m.forEach(this.last_,(function(t,n){e[t]=e[t]-n})),this.last_=t,e},t}(),Pe=function(){function t(t,e){this.server_=e,this.statsToReport_={},this.statsListener_=new Ae(t);var n=1e4+2e4*Math.random();Q(this.reportStats_.bind(this),Math.floor(n))}return t.prototype.includeStat=function(t){this.statsToReport_[t]=!0},t.prototype.reportStats_=function(){var t=this,e=this.statsListener_.get(),n={},r=!1;m.forEach(e,(function(e,i){i>0&&m.contains(t.statsToReport_,e)&&(n[e]=i,r=!0)})),r&&this.server_.reportStats(n),Q(this.reportStats_.bind(this),Math.floor(2*Math.random()*3e5))},t}(),De=function(){function t(){this.eventLists_=[],this.recursionDepth_=0}return t.prototype.queueEvents=function(t){for(var e=null,n=0;n<t.length;n++){var r=t[n],i=r.getPath();null===e||i.equals(e.getPath())||(this.eventLists_.push(e),e=null),null===e&&(e=new Re(i)),e.add(r)}e&&this.eventLists_.push(e)},t.prototype.raiseEventsAtPath=function(t,e){this.queueEvents(e),this.raiseQueuedEventsMatchingPredicate_((function(e){return e.equals(t)}))},t.prototype.raiseEventsForChangedPath=function(t,e){this.queueEvents(e),this.raiseQueuedEventsMatchingPredicate_((function(e){return e.contains(t)||t.contains(e)}))},t.prototype.raiseQueuedEventsMatchingPredicate_=function(t){this.recursionDepth_++;for(var e=!0,n=0;n<this.eventLists_.length;n++){var r=this.eventLists_[n];r&&(t(r.getPath())?(this.eventLists_[n].raise(),this.eventLists_[n]=null):e=!1)}e&&(this.eventLists_=[]),this.recursionDepth_--},t}(),Re=function(){function t(t){this.path_=t,this.events_=[]}
1return t.prototype.add=function(t){this.events_.push(t)},t.prototype.raise=function(){for(var t=0;t<this.events_.length;t++){var e=this.events_[t];if(null!==e){this.events_[t]=null;var n=e.getEventRunner();O&&P("event: "+e.toString()),G(n)}}},t.prototype.getPath=function(){return this.path_},t}(),Ne=function(){function t(t){this.allowedEvents_=t,this.listeners_={},m.assert(Array.isArray(t)&&t.length>0,"Requires a non-empty array")}return t.prototype.trigger=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(Array.isArray(this.listeners_[t]))for(var r=this.listeners_[t].slice(),i=0;i<r.length;i++)r[i].callback.apply(r[i].context,e)},t.prototype.on=function(t,e,n){this.validateEventType_(t),this.listeners_[t]=this.listeners_[t]||[],this.listeners_[t].push({callback:e,context:n});var r=this.getInitialEvent(t);r&&e.apply(n,r)},t.prototype.off=function(t,e,n){this.validateEventType_(t);for(var r=this.listeners_[t]||[],i=0;i<r.length;i++)if(r[i].callback===e&&(!n||n===r[i].context))return void r.splice(i,1)},t.prototype.validateEventType_=function(t){m.assert(this.allowedEvents_.find((function(e){return e===t})),"Unknown event: "+t)},t}(),je=function(t){function e(){var e,n,r=t.call(this,["visible"])||this;return"undefined"!=typeof document&&void 0!==document.addEventListener&&(void 0!==document.hidden?(n="visibilitychange",e="hidden"):void 0!==document.mozHidden?(n="mozvisibilitychange",e="mozHidden"):void 0!==document.msHidden?(n="msvisibilitychange",e="msHidden"):void 0!==document.webkitHidden&&(n="webkitvisibilitychange",e="webkitHidden")),r.visible_=!0,n&&document.addEventListener(n,(function(){var t=!document[e];t!==r.visible_&&(r.visible_=t,r.trigger("visible",t))}),!1),r}return v.__extends(e,t),e.getInstance=function(){return new e},e.prototype.getInitialEvent=function(t){return m.assert("visible"===t,"Unknown event type: "+t),[this.visible_]},e}(Ne),Me=function(t){function e(){var e=t.call(this,["online"])||this;return e.online_=!0,"undefined"==typeof window||void 0===window.addEventListener||m.isMobileCordova()||(window.addEventListener("online",(function(){e.online_||(e.online_=!0,e.trigger("online",!0))}),!1),window.addEventListener("offline",(function(){e.online_&&(e.online_=!1,e.trigger("online",!1))}),!1)),e}return v.__extends(e,t),e.getInstance=function(){return new e},e.prototype.getInitialEvent=function(t){return m.assert("online"===t,"Unknown event type: "+t),[this.online_]},e.prototype.currentlyOnline=function(){return this.online_},e}(Ne),Le=function(){function t(t){this.onMessage_=t,this.pendingResponses=[],this.currentResponseNum=0,this.closeAfterResponse=-1,this.onClose=null}return t.prototype.closeAfter=function(t,e){this.closeAfterResponse=t,this.onClose=e,this.closeAfterResponse<this.currentResponseNum&&(this.onClose(),this.onClose=null)},t.prototype.handleResponse=function(t,e){var n=this;this.pendingResponses[t]=e;for(var r=function(){var t=i.pendingResponses[i.currentResponseNum];delete i.pendingResponses[i.currentResponseNum];for(var e=function(e){t[e]&&G((function(){n.onMessage_(t[e])}))},r=0;r<t.length;++r)e(r);if(i.currentResponseNum===i.closeAfterResponse)return i.onClose&&(i.onClose(),i.onClose=null),"break";i.currentResponseNum++},i=this;this.pendingResponses[this.currentResponseNum]&&"break"!==r(););},t}(),Fe=function(){function t(t,e,n,r){this.connId=t,this.repoInfo=e,this.transportSessionId=n,this.lastSessionId=r,this.bytesSent=0,this.bytesReceived=0,this.everConnected_=!1,this.log_=D(t),this.stats_=xe.getCollection(e),this.urlFn=function(t){return e.connectionURL("long_polling",t)}}return t.prototype.open=function(t,e){var n=this;this.curSegmentNum=0,this.onDisconnect_=e,this.myPacketOrderer=new Le(t),this.isClosed_=!1,this.connectTimeoutTimer_=setTimeout((function(){n.log_("Timed out trying to connect."),n.onClosed_(),n.connectTimeoutTimer_=null}),Math.floor(3e4)),function(t){if(m.isNodeSdk()||"complete"===document.readyState)t();else{var e=!1,n=function(){document.body?e||(e=!0,t()):setTimeout(n,Math.floor(10))};document.addEventListener?(document.addEventListener("DOMContentLoaded",n,!1),window.addEventListener("load",n,!1)):document.attachEvent&&(document.attachEvent("onreadystatechange",(function(){"complete"===document.readyState&&n()})),window.attachEvent("onload",n))}}((function(){if(!n.isClosed_){n.scriptTagHolder=new Ue((function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t[0],i=t[1],o=t[2];if(n.incrementIncomingBytes_(t),n.scriptTagHolder)if(n.connectTimeoutTimer_&&(clearTimeout(n.connectTimeoutTimer_),n.connectTimeoutTimer_=null),n.everConnected_=!0,"start"==r)n.id=i,n.password=o;else{if("close"!==r)throw new Error("Unrecognized command received: "+r);i?(n.scriptTagHolder.sendNewPolls=!1,n.myPacketOrderer.closeAfter(i,(function(){n.onClosed_()}))):n.onClosed_()}}),(function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t[0],i=t[1];n.incrementIncomingBytes_(t),n.myPacketOrderer.handleResponse(r,i)}),(function(){n.onClosed_()}),n.urlFn);var t={start:"t"};t.ser=Math.floor(1e8*Math.random()),n.scriptTagHolder.uniqueCallbackIdentifier&&(t.cb=n.scriptTagHolder.uniqueCallbackIdentifier),t.v="5",n.transportSessionId&&(t.s=n.transportSessionId),n.lastSessionId&&(t.ls=n.lastSessionId),!m.isNodeSdk()&&"undefined"!=typeof location&&location.href&&-1!==location.href.indexOf("firebaseio.com")&&(t.r="f");var e=n.urlFn(t);n.log_("Connecting via long-poll to "+e),n.scriptTagHolder.addTag(e,(function(){}))}}))},t.prototype.start=function(){this.scriptTagHolder.startLongPoll(this.id,this.password),this.addDisconnectPingFrame(this.id,this.password)},t.forceAllow=function(){t.forceAllow_=!0},t.forceDisallow=function(){t.forceDisallow_=!0},t.isAvailable=function(){return t.forceAllow_||!t.forceDisallow_&&"undefined"!=typeof document&&null!=document.createElement&&!("object"==typeof window&&window.chrome&&window.chrome.extension&&!/^chrome/.test(window.location.href))&&!("object"==typeof Windows&&"object"==typeof Windows.UI)&&!m.isNodeSdk()},t.prototype.markConnectionHealthy=function(){},t.prototype.shutdown_=function(){this.isClosed_=!0,this.scriptTagHolder&&(this.scriptTagHolder.close(),this.scriptTagHolder=null),this.myDisconnFrame&&(document.body.removeChild(this.myDisconnFrame),this.myDisconnFrame=null),this.connectTimeoutTimer_&&(clearTimeout(this.connectTimeoutTimer_),this.connectTimeoutTimer_=null)},t.prototype.onClosed_=function(){this.isClosed_||(this.log_("Longpoll is closing itself"),this.shutdown_(),this.onDisconnect_&&(this.onDisconnect_(this.everConnected_),this.onDisconnect_=null))},t.prototype.close=function(){this.isClosed_||(this.log_("Longpoll is being closed."),this.shutdown_())},t.prototype.send=function(t){var e=m.stringify(t);this.bytesSent+=e.length,this.stats_.incrementCounter("bytes_sent",e.length);for(var n=m.base64Encode(e),r=W(n,1840),i=0;i<r.length;i++)this.scriptTagHolder.enqueueSegment(this.curSegmentNum,r.length,r[i]),this.curSegmentNum++},t.prototype.addDisconnectPingFrame=function(t,e){if(!m.isNodeSdk()){this.myDisconnFrame=document.createElement("iframe");var n={dframe:"t"};n.id=t,n.pw=e,this.myDisconnFrame.src=this.urlFn(n),this.myDisconnFrame.style.display="none",document.body.appendChild(this.myDisconnFrame)}},t.prototype.incrementIncomingBytes_=function(t){var e=m.stringify(t).length;this.bytesReceived+=e,this.stats_.incrementCounter("bytes_received",e)},t}(),Ue=function(){function t(e,n,r,i){if(this.onDisconnect=r,this.urlFn=i,this.outstandingRequests=new Zt,this.pendingSegs=[],this.currentSerial=Math.floor(1e8*Math.random()),this.sendNewPolls=!0,m.isNodeSdk())this.commandCB=e,this.onMessageCB=n;else{this.uniqueCallbackIdentifier=T(),window["pLPCommand"+this.uniqueCallbackIdentifier]=e,window["pRTLPCB"+this.uniqueCallbackIdentifier]=n,this.myIFrame=t.createI
1Frame_();var o="";this.myIFrame.src&&"javascript:"===this.myIFrame.src.substr(0,"javascript:".length)&&(o='<script>document.domain="'+document.domain+'";<\/script>');var a="<html><body>"+o+"</body></html>";try{this.myIFrame.doc.open(),this.myIFrame.doc.write(a),this.myIFrame.doc.close()}catch(s){P("frame writing exception"),s.stack&&P(s.stack),P(s)}}}return t.createIFrame_=function(){var t=document.createElement("iframe");if(t.style.display="none",!document.body)throw"Document body has not initialized. Wait to initialize Firebase until after the document is ready.";document.body.appendChild(t);try{t.contentWindow.document||P("No IE domain setting required")}catch(n){var e=document.domain;t.src="javascript:void((function(){document.open();document.domain='"+e+"';document.close();})())"}return t.contentDocument?t.doc=t.contentDocument:t.contentWindow?t.doc=t.contentWindow.document:t.document&&(t.doc=t.document),t},t.prototype.close=function(){var e=this;if(this.alive=!1,this.myIFrame&&(this.myIFrame.doc.body.innerHTML="",setTimeout((function(){null!==e.myIFrame&&(document.body.removeChild(e.myIFrame),e.myIFrame=null)}),Math.floor(0))),m.isNodeSdk()&&this.myID){var n={disconn:"t"};n.id=this.myID,n.pw=this.myPW;var r=this.urlFn(n);t.nodeRestRequest(r)}var i=this.onDisconnect;i&&(this.onDisconnect=null,i())},t.prototype.startLongPoll=function(t,e){for(this.myID=t,this.myPW=e,this.alive=!0;this.newRequest_(););},t.prototype.newRequest_=function(){if(this.alive&&this.sendNewPolls&&this.outstandingRequests.count()<(this.pendingSegs.length>0?2:1)){this.currentSerial++;var t={};t.id=this.myID,t.pw=this.myPW,t.ser=this.currentSerial;for(var e=this.urlFn(t),n="",r=0;this.pendingSegs.length>0&&this.pendingSegs[0].d.length+30+n.length<=1870;){var i=this.pendingSegs.shift();n=n+"&seg"+r+"="+i.seg+"&ts"+r+"="+i.ts+"&d"+r+"="+i.d,r++}return this.addLongPollTag_(e+=n,this.currentSerial),!0}return!1},t.prototype.enqueueSegment=function(t,e,n){this.pendingSegs.push({seg:t,ts:e,d:n}),this.alive&&this.newRequest_()},t.prototype.addLongPollTag_=function(t,e){var n=this;this.outstandingRequests.add(e,1);var r=function(){n.outstandingRequests.remove(e),n.newRequest_()},i=setTimeout(r,Math.floor(25e3));this.addTag(t,(function(){clearTimeout(i),r()}))},t.prototype.addTag=function(t,e){var n=this;m.isNodeSdk()?this.doNodeLongPoll(t,e):setTimeout((function(){try{if(!n.sendNewPolls)return;var r=n.myIFrame.doc.createElement("script");r.type="text/javascript",r.async=!0,r.src=t,r.onload=r.onreadystatechange=function(){var t=r.readyState;t&&"loaded"!==t&&"complete"!==t||(r.onload=r.onreadystatechange=null,r.parentNode&&r.parentNode.removeChild(r),e())},r.onerror=function(){P("Long-poll script failed to load: "+t),n.sendNewPolls=!1,n.close()},n.myIFrame.doc.body.appendChild(r)}catch(i){}}),Math.floor(1))},t}(),Ve=null;"undefined"!=typeof MozWebSocket?Ve=MozWebSocket:"undefined"!=typeof WebSocket&&(Ve=WebSocket);var qe=function(){function t(e,n,r,i){this.connId=e,this.keepaliveTimer=null,this.frames=null,this.totalFrames=0,this.bytesSent=0,this.bytesReceived=0,this.log_=D(this.connId),this.stats_=xe.getCollection(n),this.connURL=t.connectionURL_(n,r,i)}return t.connectionURL_=function(t,e,n){var r={v:"5"};return!m.isNodeSdk()&&"undefined"!=typeof location&&location.href&&-1!==location.href.indexOf("firebaseio.com")&&(r.r="f"),e&&(r.s=e),n&&(r.ls=n),t.connectionURL("websocket",r)},t.prototype.open=function(t,e){var n=this;this.onDisconnect=e,this.onMessage=t,this.log_("Websocket connecting to "+this.connURL),this.everConnected_=!1,S.set("previous_websocket_failure",!0);try{if(m.isNodeSdk()){var r={headers:{"User-Agent":"Firebase/5/"+g.SDK_VERSION+"/"+process.platform+"/"+(m.CONSTANTS.NODE_ADMIN?"AdminNode":"Node")}},i=process.env,o=0==this.connURL.indexOf("wss://")?i.HTTPS_PROXY||i.https_proxy:i.HTTP_PROXY||i.http_proxy;o&&(r.proxy={origin:o}),this.mySock=new Ve(this.connURL,[],r)}else this.mySock=new Ve(this.connURL)}catch(s){this.log_("Error instantiating WebSocket.");var a=s.message||s.data;return a&&this.log_(a),void this.onClosed_()}this.mySock.onopen=function(){n.log_("Websocket connected."),n.everConnected_=!0}
1,this.mySock.onclose=function(){n.log_("Websocket connection was disconnected."),n.mySock=null,n.onClosed_()},this.mySock.onmessage=function(t){n.handleIncomingFrame(t)},this.mySock.onerror=function(t){n.log_("WebSocket error.  Closing connection.");var e=t.message||t.data;e&&n.log_(e),n.onClosed_()}},t.prototype.start=function(){},t.forceDisallow=function(){t.forceDisallow_=!0},t.isAvailable=function(){var e=!1;if("undefined"!=typeof navigator&&navigator.userAgent){var n=navigator.userAgent.match(/Android ([0-9]{0,}\.[0-9]{0,})/);n&&n.length>1&&parseFloat(n[1])<4.4&&(e=!0)}return!e&&null!==Ve&&!t.forceDisallow_},t.previouslyFailed=function(){return S.isInMemoryStorage||!0===S.get("previous_websocket_failure")},t.prototype.markConnectionHealthy=function(){S.remove("previous_websocket_failure")},t.prototype.appendFrame_=function(t){if(this.frames.push(t),this.frames.length==this.totalFrames){var e=this.frames.join("");this.frames=null;var n=m.jsonEval(e);this.onMessage(n)}},t.prototype.handleNewFrameCount_=function(t){this.totalFrames=t,this.frames=[]},t.prototype.extractFrameCount_=function(t){if(m.assert(null===this.frames,"We already have a frame buffer"),t.length<=6){var e=Number(t);if(!isNaN(e))return this.handleNewFrameCount_(e),null}return this.handleNewFrameCount_(1),t},t.prototype.handleIncomingFrame=function(t){if(null!==this.mySock){var e=t.data;if(this.bytesReceived+=e.length,this.stats_.incrementCounter("bytes_received",e.length),this.resetKeepAlive(),null!==this.frames)this.appendFrame_(e);else{var n=this.extractFrameCount_(e);null!==n&&this.appendFrame_(n)}}},t.prototype.send=function(t){this.resetKeepAlive();var e=m.stringify(t);this.bytesSent+=e.length,this.stats_.incrementCounter("bytes_sent",e.length);var n=W(e,16384);n.length>1&&this.sendString_(String(n.length));for(var r=0;r<n.length;r++)this.sendString_(n[r])},t.prototype.shutdown_=function(){this.isClosed_=!0,this.keepaliveTimer&&(clearInterval(this.keepaliveTimer),this.keepaliveTimer=null),this.mySock&&(this.mySock.close(),this.mySock=null)},t.prototype.onClosed_=function(){this.isClosed_||(this.log_("WebSocket is closing itself"),this.shutdown_(),this.onDisconnect&&(this.onDisconnect(this.everConnected_),this.onDisconnect=null))},t.prototype.close=function(){this.isClosed_||(this.log_("WebSocket is being closed"),this.shutdown_())},t.prototype.resetKeepAlive=function(){var t=this;clearInterval(this.keepaliveTimer),this.keepaliveTimer=setInterval((function(){t.mySock&&t.sendString_("0"),t.resetKeepAlive()}),Math.floor(45e3))},t.prototype.sendString_=function(t){try{this.mySock.send(t)}catch(e){this.log_("Exception thrown from WebSocket.send():",e.message||e.data,"Closing connection."),setTimeout(this.onClosed_.bind(this),0)}},t.responsesRequiredToBeHealthy=2,t.healthyTimeout=3e4,t}(),Be=function(){function t(t){this.initTransports_(t)}return Object.defineProperty(t,"ALL_TRANSPORTS",{get:function(){return[Fe,qe]},enumerable:!0,configurable:!0}),t.prototype.initTransports_=function(e){var n=qe&&qe.isAvailable(),r=n&&!qe.previouslyFailed();if(e.webSocketOnly&&(n||j("wss:// URL used, but browser isn't known to support websockets.  Trying anyway."),r=!0),r)this.transports_=[qe];else{var i=this.transports_=[];z(t.ALL_TRANSPORTS,(function(t,e){e&&e.isAvailable()&&i.push(e)}))}},t.prototype.initialTransport=function(){if(this.transports_.length>0)return this.transports_[0];throw new Error("No transports available")},t.prototype.upgradeTransport=function(){return this.transports_.length>1?this.transports_[1]:null},t}(),We=function(){function t(t,e,n,r,i,o,a){this.id=t,this.repoInfo_=e,this.onMessage_=n,this.onReady_=r,this.onDisconnect_=i,this.onKill_=o,this.lastSessionId=a,this.connectionCount=0,this.pendingDataMessages=[],this.state_=0,this.log_=D("c:"+this.id+":"),this.transportManager_=new Be(e),this.log_("Connection created"),this.start_()}return t.prototype.start_=function(){var t=this,e=this.transportManager_.initialTransport();this.conn_=new e(this.nextTransportId_(),this.repoInfo_,void 0,this.lastSessionId),this.primaryResponsesRequired_=e.responsesRequiredToBeHealthy||0;var n=this.connReceiver_(this.conn_),r=this.disconnReceiver_(this.conn_);this.tx_=this.conn_,this.rx_=this.conn_,this.secondaryConn_=null,this.isHealthy_=!1,setTimeout((function(){t.conn_&&t.conn_.open(n,r)}),Math.floor(0));var i=e.healthyTimeout||0;i>0&&(this.healthyTimeout_=Q((function(){t.healthyTimeout_=null,t.isHealthy_||(t.conn_&&t.conn_.bytesReceived>
1102400?(t.log_("Connection exceeded healthy timeout but has received "+t.conn_.bytesReceived+" bytes.  Marking connection healthy."),t.isHealthy_=!0,t.conn_.markConnectionHealthy()):t.conn_&&t.conn_.bytesSent>10240?t.log_("Connection exceeded healthy timeout but has sent "+t.conn_.bytesSent+" bytes.  Leaving connection alive."):(t.log_("Closing unhealthy connection after timeout."),t.close()))}),Math.floor(i)))},t.prototype.nextTransportId_=function(){return"c:"+this.id+":"+this.connectionCount++},t.prototype.disconnReceiver_=function(t){var e=this;return function(n){t===e.conn_?e.onConnectionLost_(n):t===e.secondaryConn_?(e.log_("Secondary connection lost."),e.onSecondaryConnectionLost_()):e.log_("closing an old connection")}},t.prototype.connReceiver_=function(t){var e=this;return function(n){2!=e.state_&&(t===e.rx_?e.onPrimaryMessageReceived_(n):t===e.secondaryConn_?e.onSecondaryMessageReceived_(n):e.log_("message on old connection"))}},t.prototype.sendRequest=function(t){this.sendData_({t:"d",d:t})},t.prototype.tryCleanupConnection=function(){this.tx_===this.secondaryConn_&&this.rx_===this.secondaryConn_&&(this.log_("cleaning up and promoting a connection: "+this.secondaryConn_.connId),this.conn_=this.secondaryConn_,this.secondaryConn_=null)},t.prototype.onSecondaryControl_=function(t){if("t"in t){var e=t.t;"a"===e?this.upgradeIfSecondaryHealthy_():"r"===e?(this.log_("Got a reset on secondary, closing it"),this.secondaryConn_.close(),this.tx_!==this.secondaryConn_&&this.rx_!==this.secondaryConn_||this.close()):"o"===e&&(this.log_("got pong on secondary."),this.secondaryResponsesRequired_--,this.upgradeIfSecondaryHealthy_())}},t.prototype.onSecondaryMessageReceived_=function(t){var e=q("t",t),n=q("d",t);if("c"==e)this.onSecondaryControl_(n);else{if("d"!=e)throw new Error("Unknown protocol layer: "+e);this.pendingDataMessages.push(n)}},t.prototype.upgradeIfSecondaryHealthy_=function(){this.secondaryResponsesRequired_<=0?(this.log_("Secondary connection is healthy."),this.isHealthy_=!0,this.secondaryConn_.markConnectionHealthy(),this.proceedWithUpgrade_()):(this.log_("sending ping on secondary."),this.secondaryConn_.send({t:"c",d:{t:"p",d:{}}}))},t.prototype.proceedWithUpgrade_=function(){this.secondaryConn_.start(),this.log_("sending client ack on secondary"),this.secondaryConn_.send({t:"c",d:{t:"a",d:{}}}),this.log_("Ending transmission on primary"),this.conn_.send({t:"c",d:{t:"n",d:{}}}),this.tx_=this.secondaryConn_,this.tryCleanupConnection()},t.prototype.onPrimaryMessageReceived_=function(t){var e=q("t",t),n=q("d",t);"c"==e?this.onControl_(n):"d"==e&&this.onDataMessage_(n)},t.prototype.onDataMessage_=function(t){this.onPrimaryResponse_(),this.onMessage_(t)},t.prototype.onPrimaryResponse_=function(){this.isHealthy_||(this.primaryResponsesRequired_--,this.primaryResponsesRequired_<=0&&(this.log_("Primary connection is healthy."),this.isHealthy_=!0,this.conn_.markConnectionHealthy()))},t.prototype.onControl_=function(t){var e=q("t",t);if("d"in t){var n=t.d;if("h"===e)this.onHandshake_(n);else if("n"===e){this.log_("recvd end transmission on primary"),this.rx_=this.secondaryConn_;for(var r=0;r<this.pendingDataMessages.length;++r)this.onDataMessage_(this.pendingDataMessages[r]);this.pendingDataMessages=[],this.tryCleanupConnection()}else"s"===e?this.onConnectionShutdown_(n):"r"===e?this.onReset_(n):"e"===e?R("Server Error: "+n):"o"===e?(this.log_("got pong on primary."),this.onPrimaryResponse_(),this.sendPingOnPrimaryIfNecessary_()):R("Unknown control packet command: "+e)}},t.prototype.onHandshake_=function(t){var e=t.ts,n=t.v,r=t.h;this.sessionId=t.s,this.repoInfo_.updateHost(r),0==this.state_&&(this.conn_.start(),this.onConnectionEstablished_(this.conn_,e),"5"!==n&&j("Protocol version mismatch detected"),this.tryStartUpgrade_())},t.prototype.tryStartUpgrade_=function(){var t=this.transportManager_.upgradeTransport();t&&this.startUpgrade_(t)},t.prototype.startUpgrade_=function(t){var e=this;this.secondaryConn_=new t(this.nextTransportId_(),this.repoInfo_,this.sessionId),this.secondaryResponsesRequired_=t.responsesRequiredToBeHealthy||0;var n=this.connReceiver_(this.secondaryConn_),r=this.disconnReceiver_(this.secondaryConn_);this.secondaryConn_.open(n,r),Q((function(){e.secondaryConn_&&(e.log_("Timed out trying to upgrade."),e.secondaryConn_.close())}),Math.floor(6e4))},t.prototype.onReset_=function(t){this.log_("Reset packet received.  New host: "+t),this.repoInfo_.updateHost(t),1===this.state_?this.close():(this.closeConnections_(),this.start_())},t.prototype.onConnectionEstablished_=function(t,e){var n=this;this.log_("Realtime connection established."),this.conn_=t,this.state_=1,this.onReady_&&(this.onReady_(e,this.sessionId),this.onReady_=null),0===this.primaryResponsesRequired_?(this.log_("Primary connection is healthy."),this.isHealthy_=!0):Q((function(){n.sendPingOnPrimaryIfNecessary_()}),Math.floor(5e3))},t.prototype.sendPingOnPrimaryIfNecessary_=function(){this.isHealthy_||1!==this.state_||(this.log_("sending ping on primary."),this.sendData_({t:"c",d:{t:"p",d:{}}}))},t.prototype.onSecondaryConnectionLost_=function(){var t=this.secondaryConn_;this.secondaryConn_=null,this.tx_!==t&&this.rx_!==t||this.close()},t.prototype.onConnectionLost_=function(t){this.conn_=null,t||0!==this.state_?1===this.state_&&this.log_("Realtime connection lost."):(this.log_("Realtime connection failed."),this.repoInfo_.isCacheableHost()&&(S.remove("host:"+this.repoInfo_.host),this.repoInfo_.internalHost=this.repoInfo_.host)),this.close()},t.prototype.onConnectionShutdown_=function(t){this.log_("Connection shutdown command received. Shutting down..."),this.onKill_&&(this.onKill_(t),this.onKill_=null),this.onDisconnect_=null,this.close()},t.prototype.sendData_=function(t){if(1!==this.state_)throw"Connection is not connected";this.tx_.send(t)},t.prototype.close=function(){2!==this.state_&&(this.log_("Closing realtime connection."),this.state_=2,this.closeConnections_(),this.onDisconnect_&&(this.onDisconnect_(),this.onDisconnect_=null))},t.prototype.closeConnections_=function(){this.log_("Shutting down all connections"),this.conn_&&(this.conn_.close(),this.conn_=null),this.secondaryConn_&&(this.secondaryConn_.close(),this.secondaryConn_=null),this.healthyTimeout_&&(clearTimeout(this.healthyTimeout_),this.healthyTimeout_=null)},t}(),ze=function(){function t(){}return t.prototype.put=function(t,e,n,r){},t.prototype.merge=function(t,e,n,r){},t.prototype.refreshAuthToken=function(t){},t.prototype.onDisconnectPut=function(t,e,n){},t.prototype.onDisconnectMerge=function(t,e,n){},t.prototype.onDisconnectCancel=function(t,e){},t.prototype.reportStats=function(t){},t}(),He=function(t){function e(n,r,i,o,a,s){var u=t.call(this)||this;if(u.repoInfo_=n,u.onDataUpdate_=r,u.onConnectStatus_=i,u.onServerInfoUpdate_=o,u.authTokenProvider_=a,u.authOverride_=s,u.id=e.nextPersistentConnectionId_++,u.log_=D("p:"+u.id+":"),u.interruptReasons_={},u.listens_={},u.outstandingPuts_=[],u.outstandingPutCount_=0,u.onDisconnectRequestQueue_=[],u.connected_=!1,u.reconnectDelay_=1e3,u.maxReconnectDelay_=3e5,u.securityDebugCallback_=null,u.lastSessionId=null,u.establishConnectionTimer_=null,u.visible_=!1,u.requestCBHash_={},u.requestNumber_=0,u.realtime_=null,u.authToken_=null,u.forceTokenRefresh_=!1,u.invali
1dAuthTokenCount_=0,u.firstConnection_=!0,u.lastConnectionAttemptTime_=null,u.lastConnectionEstablishedTime_=null,s&&!m.isNodeSdk())throw new Error("Auth override specified in options, but not supported on non Node.js platforms");return u.scheduleConnect_(0),je.getInstance().on("visible",u.onVisible_,u),-1===n.host.indexOf("fblocal")&&Me.getInstance().on("online",u.onOnline_,u),u}return v.__extends(e,t),e.prototype.sendRequest=function(t,e,n){var r=++this.requestNumber_,i={r:r,a:t,b:e};this.log_(m.stringify(i)),m.assert(this.connected_,"sendRequest call when we're not connected not allowed."),this.realtime_.sendRequest(i),n&&(this.requestCBHash_[r]=n)},e.prototype.listen=function(t,e,n,r){var i=t.queryIdentifier(),o=t.path.toString();this.log_("Listen called for "+o+" "+i),this.listens_[o]=this.listens_[o]||{},m.assert(t.getQueryParams().isDefault()||!t.getQueryParams().loadsAllData(),"listen() called for non-default but complete query"),m.assert(!this.listens_[o][i],"listen() called twice for same path/queryId.");var a={onComplete:r,hashFn:e,query:t,tag:n};this.listens_[o][i]=a,this.connected_&&this.sendListen_(a)},e.prototype.sendListen_=function(t){var n=this,r=t.query,i=r.path.toString(),o=r.queryIdentifier();this.log_("Listen on "+i+" for "+o);var a={p:i};t.tag&&(a.q=r.queryObject(),a.t=t.tag),a.h=t.hashFn(),this.sendRequest("q",a,(function(a){var s=a.d,u=a.s;e.warnOnListenWarnings_(s,r),(n.listens_[i]&&n.listens_[i][o])===t&&(n.log_("listen response",a),"ok"!==u&&n.removeListen_(i,o),t.onComplete&&t.onComplete(u,s))}))},e.warnOnListenWarnings_=function(t,e){if(t&&"object"==typeof t&&m.contains(t,"w")){var n=m.safeGet(t,"w");if(Array.isArray(n)&&~n.indexOf("no_index")){var r='".indexOn": "'+e.getQueryParams().getIndex().toString()+'"',i=e.path.toString();j("Using an unspecified index. Your data will be downloaded and filtered on the client. Consider adding "+r+" at "+i+" to your security rules for better performance.")}}},e.prototype.refreshAuthToken=function(t){this.authToken_=t,this.log_("Auth token refreshed"),this.authToken_?this.tryAuth():this.connected_&&this.sendRequest("unauth",{},(function(){})),this.reduceReconnectDelayIfAdminCredential_(t)},e.prototype.reduceReconnectDelayIfAdminCredential_=function(t){(t&&40===t.length||m.isAdmin(t))&&(this.log_("Admin auth credential detected.  Reducing max reconnect time."),this.maxReconnectDelay_=3e4)},e.prototype.tryAuth=function(){var t=this;if(this.connected_&&this.authToken_){var e=this.authToken_,n=m.isValidFormat(e)?"auth":"gauth",r={cred:e};null===this.authOverride_?r.noauth=!0:"object"==typeof this.authOverride_&&(r.authvar=this.authOverride_),this.sendRequest(n,r,(function(n){var r=n.s,i=n.d||"error";t.authToken_===e&&("ok"===r?t.invalidAuthTokenCount_=0:t.onAuthRevoked_(r,i))}))}},e.prototype.unlisten=function(t,e){var n=t.path.toString(),r=t.queryIdentifier();this.log_("Unlisten called for "+n+" "+r),m.assert(t.getQueryParams().isDefault()||!t.getQueryParams().loadsAllData(),"unlisten() called for non-default but complete query"),this.removeListen_(n,r)&&this.connected_&&this.sendUnlisten_(n,r,t.queryObject(),e)},e.prototype.sendUnlisten_=function(t,e,n,r){this.log_("Unlisten on "+t+" for "+e);var i={p:t};r&&(i.q=n,i.t=r),this.sendRequest("n",i)},e.prototype.onDisconnectPut=function(t,e,n){this.connected_?this.sendOnDisconnect_("o",t,e,n):this.onDisconnectRequestQueue_.push({pathString:t,action:"o",data:e,onComplete:n})},e.prototype.onDisconnectMerge=function(t,e,n){this.connected_?this.sendOnDisconnect_("om",t,e,n):this.onDisconnectRequestQueue_.push({pathString:t,action:"om",data:e,onComplete:n})},e.prototype.onDisconnectCancel=function(t,e){this.connected_?this.sendOnDisconnect_("oc",t,null,e):this.onDisconnectRequestQueue_.push({pathString:t,action:"oc",data:null,onComplete:e})},e.prototype.sendOnDisconnect_=function(t,e,n,r){var i={p:e,d:n};this.log_("onDisconnect "+t,i),this.sendRequest(t,i,(function(t){r&&setTimeout((function(){r(t.s,t.d)}),Math.floor(0))}))},e.prototype.put=function(t,e,n,r){this.putInternal("p",t,e,n,r)},e.prototype.merge=function(t,e,n,r){this.putInternal("m",t,e,n,r)},e.prototype.putInternal=function(t,e,n,r,i){var o={p:e,d:n};void 0!==i&&(o.h=i),this.outstandingPuts_.push({action:t,request:o,onComplete:r}),this.outstandingPutCount_++,this.connected_?this.sendPut_(this.outstandingPuts_.length-1):this.log_("Buffering put: "+e)},e.prototype.sendPut_=function(t){var e=this,n=this.outstandingPuts_[t].action,r=this.outstandingPuts_[t].request,i=this.outstandingPuts_[t].onComplete;this.outstandingPuts_[t].queued=this.connected_,this.sendRequest(n,r,(function(r){e.log_(n+" response",r),delete e.outstandingPuts_[t],e.outstandingPutCount_--,0===e.outstandingPutCount_&&(e.outstandingPuts_=[]),i&&i(r.s,r.d)}))},e.prototype.reportStats=function(t){var e=this;if(this.connected_){var n={c:t};this.log_("reportStats",n),this.sendRequest("s",n,(function(t){"ok"!==t.s&&e.log_("reportStats","Error sending stats: "+t.d)}))}},e.prototype.onDataMessage_=function(t){if("r"in t){this.log_("from server: "+m.stringify(t));var e=t.r,n=this.requestCBHash_[e];n&&(delete this.requestCBHash_[e],n(t.b))}else{if("error"in t)throw"A server-side error has occurred: "+t.error;"a"in t&&this.onDataPush_(t.a,t.b)}},e.prototype.onDataPush_=function(t,e){this.log_("handleServerMessage",t,e),"d"===t?this.onDataUpdate_(e.p,e.d,!1,e.t):"m"===t?this.onDataUpdate_(e.p,e.d,!0,e.t):"c"===t?this.onListenRevoked_(e.p,e.q):"ac"===t?this.onAuthRevoked_(e.s,e.d):"sd"===t?this.onSecurityDebugPacket_(e):R("Unrecognized action received from server: "+m.stringify(t)+"\nAre you using the latest client?")},e.prototype.onReady_=function(t,e){this.log_("connection ready"),this.connected_=!0,this.lastConnectionEstablishedTime_=(new Date).getTime(),this.handleTimestamp_(t),this.lastSessionId=e,this.firstConnection_&&this.sendConnectStats_(),this.restoreState_(),this.firstConnection_=!1,this.onConnectStatus_(!0)},e.prototype.scheduleConnect_=function(t){var e=this;m.assert(!this.realtime_,"Scheduling a connect when we're already connected/ing?"),this.establishConnectionTimer_&&clearTimeout(this.establishConnectionTimer_),this.establishConnectionTimer_=setTimeout((function(){e.establishConnectionTimer_=null,e.establishConnection_()}),Math.floor(t))},e.prototype.onVisible_=function(t){t&&!this.visible_&&this.reconnectDelay_===this.maxReconnectDelay_&&(this.log_("Window became visible.  Reducing delay."),this.reconnectDelay_=1e3,this.realtime_||this.scheduleConnect_(0)),this.visible_=t},e.prototype.onOnline_=function(t){t?(this.log_("Browser went online."),this.reconnectDelay_=1e3,this.realtime_||this.scheduleConnect_(0)):(this.log_("Browser went offline.  Killing connection."),this.realtime_&&this.realtime_.close())},e.prototype.onRealtimeDisconnect_=function(){if(this.log_("data client disconnected"),this.connected_=!1,this.realtime_=null,this.cancelSentTransactions_(),this.requestCBHash_={},this.shouldReconnect_()){this.visible_?this.lastConnectionEstablishedTime_&&((new Date).getTime()-this.lastConnectionEstablishedTime_>3e4&&(this.reconnectDelay_=1e3),this.lastConnectionEstablishedTime_=null):(this.log_("Window isn't visible.  Delaying reconnect."),this.reconnectDelay_=this.maxReconnectDelay_,this.lastConnectionAttemptTime_=(new Date).getTime());var t=(new Date).getTime()-this.lastConnectionAttemptTime_,e=Math.max(0,this.reconnectDelay_-t);
1e=Math.random()*e,this.log_("Trying to reconnect in "+e+"ms"),this.scheduleConnect_(e),this.reconnectDelay_=Math.min(this.maxReconnectDelay_,1.3*this.reconnectDelay_)}this.onConnectStatus_(!1)},e.prototype.establishConnection_=function(){if(this.shouldReconnect_()){this.log_("Making a connection attempt"),this.lastConnectionAttemptTime_=(new Date).getTime(),this.lastConnectionEstablishedTime_=null;var t=this.onDataMessage_.bind(this),n=this.onReady_.bind(this),r=this.onRealtimeDisconnect_.bind(this),i=this.id+":"+e.nextConnectionId_++,o=this,a=this.lastSessionId,s=!1,u=null,c=function(){u?u.close():(s=!0,r())};this.realtime_={close:c,sendRequest:function(t){m.assert(u,"sendRequest call when we're not connected not allowed."),u.sendRequest(t)}};var l=this.forceTokenRefresh_;this.forceTokenRefresh_=!1,this.authTokenProvider_.getToken(l).then((function(e){s?P("getToken() completed but was canceled"):(P("getToken() completed. Creating connection."),o.authToken_=e&&e.accessToken,u=new We(i,o.repoInfo_,t,n,r,(function(t){j(t+" ("+o.repoInfo_.toString()+")"),o.interrupt("server_kill")}),a))})).then(null,(function(t){o.log_("Failed to get token: "+t),s||(m.CONSTANTS.NODE_ADMIN&&j(t),c())}))}},e.prototype.interrupt=function(t){P("Interrupting connection for reason: "+t),this.interruptReasons_[t]=!0,this.realtime_?this.realtime_.close():(this.establishConnectionTimer_&&(clearTimeout(this.establishConnectionTimer_),this.establishConnectionTimer_=null),this.connected_&&this.onRealtimeDisconnect_())},e.prototype.resume=function(t){P("Resuming connection for reason: "+t),delete this.interruptReasons_[t],m.isEmpty(this.interruptReasons_)&&(this.reconnectDelay_=1e3,this.realtime_||this.scheduleConnect_(0))},e.prototype.handleTimestamp_=function(t){var e=t-(new Date).getTime();this.onServerInfoUpdate_({serverTimeOffset:e})},e.prototype.cancelSentTransactions_=function(){for(var t=0;t<this.outstandingPuts_.length;t++){var e=this.outstandingPuts_[t];e&&"h"in e.request&&e.queued&&(e.onComplete&&e.onComplete("disconnect"),delete this.outstandingPuts_[t],this.outstandingPutCount_--)}0===this.outstandingPutCount_&&(this.outstandingPuts_=[])},e.prototype.onListenRevoked_=function(t,e){var n;n=e?e.map((function(t){return B(t)})).join("$"):"default";var r=this.removeListen_(t,n);r&&r.onComplete&&r.onComplete("permission_denied")},e.prototype.removeListen_=function(t,e){var n,r=new Y(t).toString();return void 0!==this.listens_[r]?(n=this.listens_[r][e],delete this.listens_[r][e],0===m.getCount(this.listens_[r])&&delete this.listens_[r]):n=void 0,n},e.prototype.onAuthRevoked_=function(t,e){P("Auth token revoked: "+t+"/"+e),this.authToken_=null,this.forceTokenRefresh_=!0,this.realtime_.close(),"invalid_token"!==t&&"permission_denied"!==t||(this.invalidAuthTokenCount_++,this.invalidAuthTokenCount_>=3&&(this.reconnectDelay_=3e4,this.authTokenProvider_.notifyForInvalidToken()))},e.prototype.onSecurityDebugPacket_=function(t){this.securityDebugCallback_?this.securityDebugCallback_(t):"msg"in t&&console.log("FIREBASE: "+t.msg.replace("\n","\nFIREBASE: "))},e.prototype.restoreState_=function(){var t=this;this.tryAuth(),m.forEach(this.listens_,(function(e,n){m.forEach(n,(function(e,n){t.sendListen_(n)}))}));for(var e=0;e<this.outstandingPuts_.length;e++)this.outstandingPuts_[e]&&this.sendPut_(e);for(;this.onDisconnectRequestQueue_.length;){var n=this.onDisconnectRequestQueue_.shift();this.sendOnDisconnect_(n.action,n.pathString,n.data,n.onComplete)}},e.prototype.sendConnectStats_=function(){var t={},e="js";m.CONSTANTS.NODE_ADMIN?e="admin_node":m.CONSTANTS.NODE_CLIENT&&(e="node"),t["sdk."+e+"."+g.SDK_VERSION.replace(/\./g,"-")]=1,m.isMobileCordova()?t["framework.cordova"]=1:m.isReactNative()&&(t["framework.reactnative"]=1),this.reportStats(t)},e.prototype.shouldReconnect_=function(){var t=Me.getInstance().currentlyOnline();return m.isEmpty(this.interruptReasons_)&&t},e.nextPersistentConnectionId_=0,e.nextConnectionId_=0,e}(ze),$e=function(t){function e(e,n,r){var i=t.call(this)||this;return i.repoInfo_=e,i.onDataUpdate_=n,i.authTokenProvider_=r,i.log_=D("p:rest:"),i.listens_={},i}return v.__extends(e,t),e.prototype.reportStats=function(t){throw new Error("Method not implemented.")},e.getListenId_=function(t,e){return void 0!==e?"tag$"+e:(m.assert(t.getQueryParams().isDefault(),"should have a tag if it's not a default query."),t.path.toString())},e.prototype.listen=function(t,n,r,i){var o=this,a=t.path.toString();this.log_("Listen called for "+a+" "+t.queryIdentifier());var s=e.getListenId_(t,r),u={};this.listens_[s]=u;var c=t.getQueryParams().toRestQueryStringParameters();this.restRequest_(a+".json",c,(function(t,e){var n=e;404===t&&(n=null,t=null),null===t&&o.onDataUpdate_(a,n,!1,r),m.safeGet(o.listens_,s)===u&&i(t?401==t?"permission_denied":"rest_error:"+t:"ok",null)}))},e.prototype.unlisten=function(t,n){var r=e.getListenId_(t,n);delete this.listens_[r]},e.prototype.refreshAuthToken=function(t){},e.prototype.restRequest_=function(t,e,n){var r=this;void 0===e&&(e={}),e.format="export",this.authTokenProvider_.getToken(!1).then((function(i){var o=i&&i.accessToken;o&&(e.auth=o);var a=(r.repoInfo_.secure?"https://":"http://")+r.repoInfo_.host+t+"?ns="+r.repoInfo_.namespace+m.querystring(e);r.log_("Sending REST request for "+a);var s=new XMLHttpRequest;s.onreadystatechange=function(){if(n&&4===s.readyState){r.log_("REST Response for "+a+" received. status:",s.status,"response:",s.responseText);var t=null;if(s.status>=200&&s.status<300){try{t=m.jsonEval(s.responseText)}catch(e){j("Failed to parse JSON response for "+a+": "+s.responseText)}n(null,t)}else 401!==s.status&&404!==s.status&&j("Got unsuccessful REST response for "+a+" Status: "+s.status),n(s.status);n=null}},s.open("GET",a,!0),s.send()}))},e}(ze),Ke=function(){function t(t,e,n){var r=this;this.repoInfo_=t,this.app=n,this.dataUpdateCount=0,this.statsListener_=null,this.eventQueue_=new De,this.nextWriteId_=1,this.interceptServerDataCallback_=null,this.onDisconnect_=new te,this.persistentConnection_=null;var i=new Ie(n);if(this.stats_=xe.getCollection(t),e||("object"==typeof window&&window.navigator&&window.navigator.userAgent||"").search(/googlebot|google webmaster tools|bingbot|yahoo! slurp|baiduspider|yandexbot|duckduckbot/i)>=0)this.server_=new $e(this.repoInfo_,this.onDataUpdate_.bind(this),i),setTimeout(this.onConnectStatus_.bind(this,!0),0);else{var o=n.options.databaseAuthVariableOverride;
1if(null!=o){if("object"!=typeof o)throw new Error("Only objects are supported for option databaseAuthVariableOverride");try{m.stringify(o)}catch(a){throw new Error("Invalid authOverride provided: "+a)}}this.persistentConnection_=new He(this.repoInfo_,this.onDataUpdate_.bind(this),this.onConnectStatus_.bind(this),this.onServerInfoUpdate_.bind(this),i,o),this.server_=this.persistentConnection_}i.addTokenChangeListener((function(t){r.server_.refreshAuthToken(t)})),this.statsReporter_=xe.getOrCreateReporter(t,(function(){return new Pe(r.stats_,r.server_)})),this.transactions_init_(),this.infoData_=new ke,this.infoSyncTree_=new Te({startListening:function(t,e,n,i){var o=[],a=r.infoData_.getNode(t.path);return a.isEmpty()||(o=r.infoSyncTree_.applyServerOverwrite(t.path,a),setTimeout((function(){i("ok")}),0)),o},stopListening:function(){}}),this.updateInfo_("connected",!1),this.serverSyncTree_=new Te({startListening:function(t,e,n,i){return r.server_.listen(t,n,e,(function(e,n){var o=i(e,n);r.eventQueue_.raiseEventsForChangedPath(t.path,o)})),[]},stopListening:function(t,e){r.server_.unlisten(t,e)}})}return t.prototype.toString=function(){return(this.repoInfo_.secure?"https://":"http://")+this.repoInfo_.host},t.prototype.name=function(){return this.repoInfo_.namespace},t.prototype.serverTime=function(){var t=this.infoData_.getNode(new Y(".info/serverTimeOffset")).val()||0;return(new Date).getTime()+t},t.prototype.generateServerValues=function(){return(t=(t={timestamp:this.serverTime()})||{}).timestamp=t.timestamp||(new Date).getTime(),t;var t},t.prototype.onDataUpdate_=function(t,e,n,r){this.dataUpdateCount++;var i=new Y(t);e=this.interceptServerDataCallback_?this.interceptServerDataCallback_(t,e):e;var o=[];if(r)if(n){var a=m.map(e,(function(t){return qt(t)}));o=this.serverSyncTree_.applyTaggedQueryMerge(i,a,r)}else{var s=qt(e);o=this.serverSyncTree_.applyTaggedQueryOverwrite(i,s,r)}else if(n){var u=m.map(e,(function(t){return qt(t)}));o=this.serverSyncTree_.applyServerMerge(i,u)}else{var c=qt(e);o=this.serverSyncTree_.applyServerOverwrite(i,c)}var l=i;o.length>0&&(l=this.rerunTransactions_(i)),this.eventQueue_.raiseEventsForChangedPath(l,o)},t.prototype.interceptServerData_=function(t){this.interceptServerDataCallback_=t},t.prototype.onConnectStatus_=function(t){this.updateInfo_("connected",t),!1===t&&this.runOnDisconnectEvents_()},t.prototype.onServerInfoUpdate_=function(t){var e=this;z(t,(function(t,n){e.updateInfo_(n,t)}))},t.prototype.updateInfo_=function(t,e){var n=new Y("/.info/"+t),r=qt(e);this.infoData_.updateSnapshot(n,r);var i=this.infoSyncTree_.applyServerOverwrite(n,r);this.eventQueue_.raiseEventsForChangedPath(n,i)},t.prototype.getNextWriteId_=function(){return this.nextWriteId_++},t.prototype.setWithPriority=function(t,e,n,r){var i=this;this.log_("set",{path:t.toString(),value:e,priority:n});var o=this.generateServerValues(),a=qt(e,n),s=ne(a,o),u=this.getNextWriteId_(),c=this.serverSyncTree_.applyUserOverwrite(t,s,u,!0);this.eventQueue_.queueEvents(c),this.server_.put(t.toString(),a.val(!0),(function(e,n){var o="ok"===e;o||j("set at "+t+" failed: "+e);var a=i.serverSyncTree_.ackUserWrite(u,!o);i.eventQueue_.raiseEventsForChangedPath(t,a),i.callOnCompleteCallback(r,e,n)}));var l=this.abortTransactions_(t);this.rerunTransactions_(l),this.eventQueue_.raiseEventsForChangedPath(l,[])},t.prototype.update=function(t,e,n){var r=this;this.log_("update",{path:t.toString(),value:e});var i=!0,o=this.generateServerValues(),a={};if(m.forEach(e,(function(t,e){i=!1;var n=qt(e);a[t]=ne(n,o)})),i)P("update() called with empty data.  Don't do anything."),this.callOnCompleteCallback(n,"ok");else{var s=this.getNextWriteId_(),u=this.serverSyncTree_.applyUserMerge(t,a,s);this.eventQueue_.queueEvents(u),this.server_.merge(t.toString(),e,(function(e,i){var o="ok"===e;o||j("update at "+t+" failed: "+e);var a=r.serverSyncTree_.ackUserWrite(s,!o),u=a.length>0?r.rerunTransactions_(t):t;r.eventQueue_.raiseEventsForChangedPath(u,a),r.callOnCompleteCallback(n,e,i)})),m.forEach(e,(function(e){var n=r.abortTransactions_(t.child(e));r.rerunTransactions_(n)})),this.eventQueue_.raiseEventsForChangedPath(t,[])}},t.prototype.runOnDisconnectEvents_=function(){var t=this;this.log_("onDisconnectEvents");var e=this.generateServerValues(),n=function(t,e){var n=new te;return t.forEachTree(new Y(""),(function(t,r){n.remember(t,ne(r,e))})),n}(this.onDisconnect_,e),r=[];
1n.forEachTree(Y.Empty,(function(e,n){r=r.concat(t.serverSyncTree_.applyServerOverwrite(e,n));var i=t.abortTransactions_(e);t.rerunTransactions_(i)})),this.onDisconnect_=new te,this.eventQueue_.raiseEventsForChangedPath(Y.Empty,r)},t.prototype.onDisconnectCancel=function(t,e){var n=this;this.server_.onDisconnectCancel(t.toString(),(function(r,i){"ok"===r&&n.onDisconnect_.forget(t),n.callOnCompleteCallback(e,r,i)}))},t.prototype.onDisconnectSet=function(t,e,n){var r=this,i=qt(e);this.server_.onDisconnectPut(t.toString(),i.val(!0),(function(e,o){"ok"===e&&r.onDisconnect_.remember(t,i),r.callOnCompleteCallback(n,e,o)}))},t.prototype.onDisconnectSetWithPriority=function(t,e,n,r){var i=this,o=qt(e,n);this.server_.onDisconnectPut(t.toString(),o.val(!0),(function(e,n){"ok"===e&&i.onDisconnect_.remember(t,o),i.callOnCompleteCallback(r,e,n)}))},t.prototype.onDisconnectUpdate=function(t,e,n){var r=this;if(m.isEmpty(e))return P("onDisconnect().update() called with empty data.  Don't do anything."),void this.callOnCompleteCallback(n,"ok");this.server_.onDisconnectMerge(t.toString(),e,(function(i,o){"ok"===i&&m.forEach(e,(function(e,n){var i=qt(n);r.onDisconnect_.remember(t.child(e),i)})),r.callOnCompleteCallback(n,i,o)}))},t.prototype.addEventCallbackForQuery=function(t,e){var n;n=".info"===t.path.getFront()?this.infoSyncTree_.addEventRegistration(t,e):this.serverSyncTree_.addEventRegistration(t,e),this.eventQueue_.raiseEventsAtPath(t.path,n)},t.prototype.removeEventCallbackForQuery=function(t,e){var n;n=".info"===t.path.getFront()?this.infoSyncTree_.removeEventRegistration(t,e):this.serverSyncTree_.removeEventRegistration(t,e),this.eventQueue_.raiseEventsAtPath(t.path,n)},t.prototype.interrupt=function(){this.persistentConnection_&&this.persistentConnection_.interrupt("repo_interrupt")},t.prototype.resume=function(){this.persistentConnection_&&this.persistentConnection_.resume("repo_interrupt")},t.prototype.stats=function(t){if(void 0===t&&(t=!1),"undefined"!=typeof console){var e;t?(this.statsListener_||(this.statsListener_=new Ae(this.stats_)),e=this.statsListener_.get()):e=this.stats_.get();var n=Object.keys(e).reduce((function(t,e){return Math.max(e.length,t)}),0);m.forEach(e,(function(t,e){for(var r=t.length;r<n+2;r++)t+=" ";console.log(t+e)}))}},t.prototype.statsIncrementCounter=function(t){this.stats_.incrementCounter(t),this.statsReporter_.includeStat(t)},t.prototype.log_=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n="";this.persistentConnection_&&(n=this.persistentConnection_.id+":"),P.apply(void 0,[n].concat(t))},t.prototype.callOnCompleteCallback=function(t,e,n){t&&G((function(){if("ok"==e)t(null);else{var r=(e||"error").toUpperCase(),i=r;n&&(i+=": "+n);var o=new Error(i);o.code=r,t(o)}}))},Object.defineProperty(t.prototype,"database",{get:function(){return this.__database||(this.__database=new rn(this))},enumerable:!0,configurable:!0}),t}(),Ge=function(){function t(e){this.indexedFilter_=new de(e.getIndex()),this.index_=e.getIndex(),this.startPost_=t.getStartPost_(e),this.endPost_=t.getEndPost_(e)}return t.prototype.getStartPost=function(){return this.startPost_},t.prototype.getEndPost=function(){return this.endPost_},t.prototype.matches=function(t){return this.index_.compare(this.getStartPost(),t)<=0&&this.index_.compare(t,this.getEndPost())<=0},t.prototype.updateChild=function(t,e,n,r,i,o){return this.matches(new wt(e,n))||(n=Ut.EMPTY_NODE),this.indexedFilter_.updateChild(t,e,n,r,i,o)},t.prototype.updateFullNode=function(t,e,n){e.isLeafNode()&&(e=Ut.EMPTY_NODE);var r=e.withIndex(this.index_);r=r.updatePriority(Ut.EMPTY_NODE);var i=this;return e.forEachChild(It,(function(t,e){i.matches(new wt(t,e))||(r=r.updateImmediateChild(t,Ut.EMPTY_NODE))})),this.indexedFilter_.updateFullNode(t,r,n)},t.prototype.updatePriority=function(t,e){return t},t.prototype.filtersNodes=function(){return!0},t.prototype.getIndexedFilter=function(){return this.indexedFilter_},t.prototype.getIndex=function(){return this.index_},t.getStartPost_=function(t){if(t.hasStart()){var e=t.getIndexStartName();return t.getIndex().makePost(t.getIndexStartValue(),e)}return t.getIndex().minPost()},t.getEndPost_=function(t){if(t.hasEnd()){var e=t.getIndexEndName();return t.getIndex().makePost(t.getIndexEndValue(),e)}return t.getIndex().maxPost()},t}
1(),Qe=function(){function t(t){this.rangedFilter_=new Ge(t),this.index_=t.getIndex(),this.limit_=t.getLimit(),this.reverse_=!t.isViewFromLeft()}return t.prototype.updateChild=function(t,e,n,r,i,o){return this.rangedFilter_.matches(new wt(e,n))||(n=Ut.EMPTY_NODE),t.getImmediateChild(e).equals(n)?t:t.numChildren()<this.limit_?this.rangedFilter_.getIndexedFilter().updateChild(t,e,n,r,i,o):this.fullLimitUpdateChild_(t,e,n,i,o)},t.prototype.updateFullNode=function(t,e,n){var r;if(e.isLeafNode()||e.isEmpty())r=Ut.EMPTY_NODE.withIndex(this.index_);else if(2*this.limit_<e.numChildren()&&e.isIndexed(this.index_)){r=Ut.EMPTY_NODE.withIndex(this.index_);var i=void 0;i=this.reverse_?e.getReverseIteratorFrom(this.rangedFilter_.getEndPost(),this.index_):e.getIteratorFrom(this.rangedFilter_.getStartPost(),this.index_);for(var o=0;i.hasNext()&&o<this.limit_;){var a=i.getNext();if(!(this.reverse_?this.index_.compare(this.rangedFilter_.getStartPost(),a)<=0:this.index_.compare(a,this.rangedFilter_.getEndPost())<=0))break;r=r.updateImmediateChild(a.name,a.node),o++}}else{r=(r=e.withIndex(this.index_)).updatePriority(Ut.EMPTY_NODE);var s=void 0,u=void 0,c=void 0;if(i=void 0,this.reverse_){i=r.getReverseIterator(this.index_),s=this.rangedFilter_.getEndPost(),u=this.rangedFilter_.getStartPost();var l=this.index_.getCompare();c=function(t,e){return l(e,t)}}else i=r.getIterator(this.index_),s=this.rangedFilter_.getStartPost(),u=this.rangedFilter_.getEndPost(),c=this.index_.getCompare();o=0;for(var h=!1;i.hasNext();)a=i.getNext(),!h&&c(s,a)<=0&&(h=!0),h&&o<this.limit_&&c(a,u)<=0?o++:r=r.updateImmediateChild(a.name,Ut.EMPTY_NODE)}return this.rangedFilter_.getIndexedFilter().updateFullNode(t,r,n)},t.prototype.updatePriority=function(t,e){return t},t.prototype.filtersNodes=function(){return!0},t.prototype.getIndexedFilter=function(){return this.rangedFilter_.getIndexedFilter()},t.prototype.getIndex=function(){return this.index_},t.prototype.fullLimitUpdateChild_=function(t,e,n,r,i){var o;if(this.reverse_){var a=this.index_.getCompare();o=function(t,e){return a(e,t)}}else o=this.index_.getCompare();var s=t;m.assert(s.numChildren()==this.limit_,"");var u=new wt(e,n),c=this.reverse_?s.getFirstChild(this.index_):s.getLastChild(this.index_),l=this.rangedFilter_.matches(u);if(s.hasChild(e)){for(var h=s.getImmediateChild(e),f=r.getChildAfterChild(this.index_,c,this.reverse_);null!=f&&(f.name==e||s.hasChild(f.name));)f=r.getChildAfterChild(this.index_,f,this.reverse_);var d=null==f?1:o(f,u);if(l&&!n.isEmpty()&&d>=0)return null!=i&&i.trackChildChange(fe.childChangedChange(e,n,h)),s.updateImmediateChild(e,n);null!=i&&i.trackChildChange(fe.childRemovedChange(e,h));var p=s.updateImmediateChild(e,Ut.EMPTY_NODE);return null!=f&&this.rangedFilter_.matches(f)?(null!=i&&i.trackChildChange(fe.childAddedChange(f.name,f.node)),p.updateImmediateChild(f.name,f.node)):p}return n.isEmpty()?t:l&&o(c,u)>=0?(null!=i&&(i.trackChildChange(fe.childRemovedChange(c.name,c.node)),i.trackChildChange(fe.childAddedChange(e,n))),s.updateImmediateChild(e,n).updateImmediateChild(c.name,Ut.EMPTY_NODE)):t},t}(),Ye=function(){function t(){this.limitSet_=!1,this.startSet_=!1,this.startNameSet_=!1,this.endSet_=!1,this.endNameSet_=!1,this.limit_=0,this.viewFrom_="",this.indexStartValue_=null,this.indexStartName_="",this.indexEndValue_=null,this.indexEndName_="",this.index_=It}return t.prototype.hasStart=function(){return this.startSet_},t.prototype.isViewFromLeft=function(){return""===this.viewFrom_?this.startSet_:this.viewFrom_===t.WIRE_PROTOCOL_CONSTANTS_.VIEW_FROM_LEFT},t.prototype.getIndexStartValue=function(){return m.assert(this.startSet_,"Only valid if start has been set"),this.indexStartValue_},t.prototype.getIndexStartName=function(){return m.assert(this.startSet_,"Only valid if start has been set"),this.startNameSet_?this.indexStartName_:L},t.prototype.hasEnd=function(){return this.endSet_},t.prototype.getIndexEndValue=function(){return m.assert(this.endSet_,"Only valid if end has been set"),this.indexEndValue_},t.prototype.getIndexEndName=function(){return m.assert(this.endSet_,"Only valid if end has been set"),this.endNameSet_?this.indexEndName_:F},t.prototype.hasLimit=function(){return this.limitSet_},t.prototype.hasAnchoredLimit=function(){return this.limitSet_&&""!==this.viewFrom_},t.prototype.getLimit=function(){return m.assert(this.limitSet_,"Only valid if limit has been set"),this.limit_},t.prototype.getIndex=function(){return this.index_},t.prototype.copy_=function(){var e=new t;return e.limitSet_=this.limitSet_,e.limit_=this.limit_,e.startSet_=this.startSet_,e.indexStartValue_=this.indexStartValue_,e.startNameSet_=this.startNameSet_,e.indexStartName_=this.indexStartName_,e.endSet_=this.endSet_,e.indexEndValue_=this.indexEndValue_,e.endNameSet_=this.endNameSet_,e.indexEndName_=this.indexEndName_,e.index_=this.index_,e.viewFrom_=this.viewFrom_,e},t.prototype.limit=function(t){var e=this.copy_();return e.limitSet_=!0,e.limit_=t,e.viewFrom_="",e},t.prototype.limitToFirst=function(e){var n=this.copy_();return n.limitSet_=!0,n.limit_=e,n.viewFrom_=t.WIRE_PROTOCOL_CONSTANTS_.VIEW_FROM_LEFT,n},t.prototype.limitToLast=function(e){var n=this.copy_();return n.limitSet_=!0,n.limit_=e,n.viewFrom_=t.WIRE_PROTOCOL_CONSTANTS_.VIEW_FROM_RIGHT,n},t.prototype.startAt=function(t,e){var n=this.copy_();return n.startSet_=!0,void 0===t&&(t=null),n.indexStartValue_=t,null!=e?(n.startNameSet_=!0,n.indexStartName_=e):(n.startNameSet_=!1,n.indexStartName_=""),n},t.prototype.endAt=function(t,e){var n=this.copy_();return n.endSet_=!0,void 0===t&&(t=null),n.indexEndValue_=t,void 0!==e?(n.endNameSet_=!0,n.indexEndName_=e):(n.endNameSet_=!1,n.indexEndName_=""),n},t.prototype.orderBy=function(t){var e=this.copy_();return e.index_=t,e},t.prototype.getQueryObject=function(){var e=t.WIRE_PROTOCOL_CONSTANTS_,n={};
1if(this.startSet_&&(n[e.INDEX_START_VALUE]=this.indexStartValue_,this.startNameSet_&&(n[e.INDEX_START_NAME]=this.indexStartName_)),this.endSet_&&(n[e.INDEX_END_VALUE]=this.indexEndValue_,this.endNameSet_&&(n[e.INDEX_END_NAME]=this.indexEndName_)),this.limitSet_){n[e.LIMIT]=this.limit_;var r=this.viewFrom_;""===r&&(r=this.isViewFromLeft()?e.VIEW_FROM_LEFT:e.VIEW_FROM_RIGHT),n[e.VIEW_FROM]=r}return this.index_!==It&&(n[e.INDEX]=this.index_.toString()),n},t.prototype.loadsAllData=function(){return!(this.startSet_||this.endSet_||this.limitSet_)},t.prototype.isDefault=function(){return this.loadsAllData()&&this.index_==It},t.prototype.getNodeFilter=function(){return this.loadsAllData()?new de(this.getIndex()):this.hasLimit()?new Qe(this):new Ge(this)},t.prototype.toRestQueryStringParameters=function(){var e,n=t.REST_QUERY_CONSTANTS_,r={};return this.isDefault()||(this.index_===It?e=n.PRIORITY_INDEX:this.index_===Ht?e=n.VALUE_INDEX:this.index_===Ct?e=n.KEY_INDEX:(m.assert(this.index_ instanceof $t,"Unrecognized index type!"),e=this.index_.toString()),r[n.ORDER_BY]=m.stringify(e),this.startSet_&&(r[n.START_AT]=m.stringify(this.indexStartValue_),this.startNameSet_&&(r[n.START_AT]+=","+m.stringify(this.indexStartName_))),this.endSet_&&(r[n.END_AT]=m.stringify(this.indexEndValue_),this.endNameSet_&&(r[n.END_AT]+=","+m.stringify(this.indexEndName_))),this.limitSet_&&(this.isViewFromLeft()?r[n.LIMIT_TO_FIRST]=this.limit_:r[n.LIMIT_TO_LAST]=this.limit_)),r},t.WIRE_PROTOCOL_CONSTANTS_={INDEX_START_VALUE:"sp",INDEX_START_NAME:"sn",INDEX_END_VALUE:"ep",INDEX_END_NAME:"en",LIMIT:"l",VIEW_FROM:"vf",VIEW_FROM_LEFT:"l",VIEW_FROM_RIGHT:"r",INDEX:"i"},t.REST_QUERY_CONSTANTS_={ORDER_BY:"orderBy",PRIORITY_INDEX:"$priority",VALUE_INDEX:"$value",KEY_INDEX:"$key",START_AT:"startAt",END_AT:"endAt",LIMIT_TO_FIRST:"limitToFirst",LIMIT_TO_LAST:"limitToLast"},t.DEFAULT=new t,t}(),Xe=function(t){function e(e,n){if(!(e instanceof Ke))throw new Error("new Reference() no longer supported - use app.database().");return t.call(this,e,n,Ye.DEFAULT,!1)||this}return v.__extends(e,t),e.prototype.getKey=function(){return m.validateArgCount("Reference.key",0,0,arguments.length),this.path.isEmpty()?null:this.path.getBack()},e.prototype.child=function(t){return m.validateArgCount("Reference.child",1,1,arguments.length),"number"==typeof t?t=String(t):t instanceof Y||(null===this.path.getFront()?dt("Reference.child",1,t,!1):ft("Reference.child",1,t,!1)),new e(this.repo,this.path.child(t))},e.prototype.getParent=function(){m.validateArgCount("Reference.parent",0,0,arguments.length);var t=this.path.parent();return null===t?null:new e(this.repo,t)},e.prototype.getRoot=function(){m.validateArgCount("Reference.root",0,0,arguments.length);for(var t=this;null!==t.getParent();)t=t.getParent();return t},e.prototype.databaseProp=function(){return this.repo.database},e.prototype.set=function(t,e){m.validateArgCount("Reference.set",1,2,arguments.length),pt("Reference.set",this.path),at("Reference.set",1,t,this.path,!1),m.validateCallback("Reference.set",2,e,!0);var n=new m.Deferred;return this.repo.setWithPriority(this.path,t,null,n.wrapCallback(e)),n.promise},e.prototype.update=function(t,e){if(m.validateArgCount("Reference.update",1,2,arguments.length),pt("Reference.update",this.path),Array.isArray(t)){for(var n={},r=0;r<t.length;++r)n[""+r]=t[r];t=n,j("Passing an Array to Firebase.update() is deprecated. Use set() if you want to overwrite the existing data, or an Object with integer keys if you really do want to only update some of the children.")}ut("Reference.update",1,t,this.path,!1),m.validateCallback("Reference.update",2,e,!0);var i=new m.Deferred;return this.repo.update(this.path,t,i.wrapCallback(e)),i.promise},e.prototype.setWithPriority=function(t,e,n){if(m.validateArgCount("Reference.setWithPriority",2,3,arguments.length),pt("Reference.setWithPriority",this.path),at("Reference.setWithPriority",1,t,this.path,!1),ct("Reference.setWithPriority",2,e,!1),m.validateCallback("Reference.setWithPriority",3,n,!0),".length"===this.getKey()||".keys"===this.getKey())throw"Reference.setWithPriority failed: "+this.getKey()+" is a read-only object.";var r=new m.Deferred;return this.repo.setWithPriority(this.path,t,e,r.wrapCallback(n)),r.promise},e.prototype.remove=function(t){return m.validateArgCount("Reference.remove",0,1,arguments.length),pt("Reference.remove",this.path),m.validateCallback("Reference.remove",1,t,!0),this.set(null,t)},e.prototype.transaction=function(t,e,n){if(m.validateArgCount("Reference.transaction",1,3,arguments.length),pt("Reference.transaction",this.path),m.validateCallback("Reference.transaction",1,t,!1),m.validateCallback("Reference.transaction",2,e,!0),yt("Reference.transaction",3,n,!0),".length"===this.getKey()||".keys"===this.getKey())throw"Reference.transaction failed: "+this.getKey()+" is a read-only object.";void 0===n&&(n=!0);var r=new m.Deferred;"function"==typeof e&&r.promise.catch((function(){}));var i=function(t,n,i){t?r.reject(t):r.resolve(new gt(n,i)),"function"==typeof e&&e(t,n,i)};return this.repo.startTransaction(this.path,t,i,n),r.promise},e.prototype.setPriority=function(t,e){m.validateArgCount("Reference.setPriority",1,2,arguments.length),pt("Reference.setPriority",this.path),ct("Reference.setPriority",1,t,!1),m.validateCallback("Reference.setPriority",2,e,!0);var n=new m.Deferred;return this.repo.setWithPriority(this.path.child(".priority"),t,null,n.wrapCallback(e)),n.promise},e.prototype.push=function(t,e){m.validateArgCount("Reference.push",0,2,arguments.length),pt("Reference.push",this.path),at("Reference.push",1,t,this.path,!0),m.validateCallback("Reference.push",2,e,!0);var n,r=this.repo.serverTime(),i=bt(r),o=this.child(i),a=this.child(i);return n=null!=t?o.set(t,e).then((function(){return a})):Promise.resolve(a),o.then=n.then.bind(n),o.catch=n.then.bind(n,void 0),"function"==typeof e&&n.catch((function(){})),o},e.prototype.onDisconnect=function(){return pt("Reference.onDisconnect",this.path),new vt(this.repo,this.path)},Object.defineProperty(e.prototype,"database",{get:function(){return this.databaseProp()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"key",{get:function(){return this.getKey()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){return this.getParent()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"root",{get:function(){return this.getRoot()},enumerable:!0,configurable:!0}),e}(Jt);Jt.__referenceConstructor=Xe,_e.__referenceConstructor=Xe;var Je=function(){return function(){this.children={},this.childCount=0,this.value=null}}(),Ze=function(){function t(t,e,n){void 0===t&&(t=""),void 0===e&&(e=null),void 0===n&&(n=new Je),this.name_=t,this.parent_=e,this.node_=n}return t.prototype.subTree=function(e){for(var n,r=e instanceof Y?e:new Y(e),i=this;null!==(n=r.getFront());)i=new t(n,i,m.safeGet(i.node_.children,n)||new Je),r=r.popFront();return i},t.prototype.getValue=function(){return this.node_.value},t.prototype.setValue=function(t){m.assert(void 0!==t,"Cannot set value to undefined"),this.node_.value=t,this.updateParents_()},t.prototype.clear=function(){this.node_.value=null,this.node_.children={},this.node_.childCount=0,this.updateParents_()},t.prototype.hasChildren=function(){return this.node_.childCount>0},t.prototype.isEmpty=function(){return null===this.getValue()&&!this.hasChildren()},t.prototype.forEachChild=function(e){var n=this;m.forEach(this.node_.children,(function(r,i){e(new t(r,n,i))}))},t.prototype.forEachDescendant=function(t,e,n){e&&!n&&t(this),this.forEachChild((function(e){e.forEachDescendant(t,!0,n)})),e&&n&&t(this)},t.prototype.forEachAncestor=function(t,e){for(var n=e?this:this.parent();null!==n;){if(t(n))return!0;n=n.parent()}return!1},t.prototype.forEachImmediateDescendantWithValue=function(t){this.forEachChild((function(e){null!==e.getValue()?t(e):e.forEachImmediateDescendantWithValue(t)}))},t.prototype.path=function(){return new Y(null===this.parent_?this.name_:this.parent_.path()+"/"+this.name_)},t.prototype.name=function(){return this.name_},t.prototype.parent=function(){return this.parent_},t.prototype.updateParents_=function(){null!==this.parent_&&this.parent_.updateChild_(this.name_,this)},t.prototype.updateChild_=function(t,e){var n=e.isEmpty(),r=m.contains(this.node_.children,t);n&&r?(delete this.node_.children[t],this.node_.childCount--,this.updateParents_()):n||r||(this.node_.children[t]=e.node_,this.node_.childCount++,this.updateParents_())},t}(),tn=function(t){return t[t.RUN=0]="RUN",t[t.SENT=1]="SENT",t[t.COMPLETED=2]="COMPLETED",t[t.SENT_NEEDS_ABORT=3]="SENT_NEEDS_ABORT",t[t.NEEDS_ABORT=4]="NEEDS_ABORT",t}({});Ke.MAX_TRANSACTION_RETRIES_=25,Ke.prototype.transactions_init_=function(){this.transactionQueueTree_=new Ze},Ke.prototype.startTransaction=function(t,e,n,r){this.log_("transaction on "+t);var i=function(){},o=new Xe(this,t);o.on("value",i);var a={path:t,update:e,onComplete:n,status:null,order:T(),applyLocally:r,retryCount:0,unwatcher:function(){o.off("value",i)},abortReason:null,currentWriteId:null,currentInputSnapshot:null,currentOutputSnapshotRaw:null,currentOutputSnapshotResolved:null},s=this.getLatestState_(t);a.currentInputSnapshot=s;var u=a.update(s.val());if(void 0===u){if(a.unwatcher(),a.currentOutputSnapshotRaw=null,a.currentOutputSnapshotResolved=null,a.onComplete){var c=new Kt(a.currentInputSnapshot,new Xe(this,a.path),It);a.onComplete(null,!1,c)}}else{st("transaction failed: Data returned ",u,a.path),a.status=tn.RUN;var l=this.transactionQueueTree_.subTree(t),h=l.getValue()||[];h.push(a),l.setValue(h);var f=void 0;"object"==typeof u&&null!==u&&m.contains(u,".priority")?(f=m.safeGet(u,".priority"),m.assert(ot(f),"Invalid priority returned by transaction. Priority must be a valid string, finite number, server value, or null.")):f=(this.serverSyncTree_.calcCompleteEventCache(t)||Ut.EMPTY_NODE).getPriority().val(),f=f;var d=this.generateServerValues(),p=qt(u,f),y=ne(p,d);a.currentOutputSnapshotRaw=p,a.currentOutputSnapshotResolved=y,a.currentWriteId=this.getNextWriteId_();var v=this.serverSyncTree_.applyUserOverwrite(t,y,a.currentWriteId,a.applyLocally);this.eventQueue_.raiseEventsForChangedPath(t,v),this.sendReadyTransactions_()}},Ke.prototype.getLatestState_=function(t,e){return this.serverSyncTree_.calcCompleteEventCache(t,e)||Ut.EMPTY_NODE},Ke.prototype.sendReadyTransactions_=function(t){var e=this;if(void 0===t&&(t=this.transactionQueueTree_),t||this.pruneCompletedTransactionsBelowNode_(t),null!==t.getValue()){var n=this.buildTransactionQueue_(t);m.assert(n.length>0,"Sending zero length transaction queue"),n.every((function(t){return t.status===tn.RUN}))&&this.sendTransactionQueue_(t.path(),n)}else t.hasChildren()&&t.forEachChild((function(t){e.sendReadyTransactions_(t)}))},Ke.prototype.sendTransactionQueue_=function(t,e){for(var n=this,r=e.map((function(t){return t.currentWriteId})),i=this.getLatestState_(t,r),o=i,a=i.hash(),s=0;s<e.length;s++){var u=e[s];m.assert(u.status===tn.RUN,"tryToSendTransactionQueue_: items in queue should all be run."),u.status=tn.SENT,u.retryCount++;var c=Y.relativePath(t,u.path);o=o.updateChild(c,u.currentOutputSnapshotRaw)}var l=o.val(!0),h=t;this.server_.put(h.toString(),l,(function(r){n.log_("transaction put response",{path:h.toString(),status:r});var i=[];if("ok"===r){for(var o=[],a=0;a<e.length;
1a++){if(e[a].status=tn.COMPLETED,i=i.concat(n.serverSyncTree_.ackUserWrite(e[a].currentWriteId)),e[a].onComplete){var s=e[a].currentOutputSnapshotResolved,u=new Xe(n,e[a].path),c=new Kt(s,u,It);o.push(e[a].onComplete.bind(null,null,!0,c))}e[a].unwatcher()}for(n.pruneCompletedTransactionsBelowNode_(n.transactionQueueTree_.subTree(t)),n.sendReadyTransactions_(),n.eventQueue_.raiseEventsForChangedPath(t,i),a=0;a<o.length;a++)G(o[a])}else{if("datastale"===r)for(a=0;a<e.length;a++)e[a].status=e[a].status===tn.SENT_NEEDS_ABORT?tn.NEEDS_ABORT:tn.RUN;else for(j("transaction at "+h.toString()+" failed: "+r),a=0;a<e.length;a++)e[a].status=tn.NEEDS_ABORT,e[a].abortReason=r;n.rerunTransactions_(t)}}),a)},Ke.prototype.rerunTransactions_=function(t){var e=this.getAncestorTransactionNode_(t),n=e.path(),r=this.buildTransactionQueue_(e);return this.rerunTransactionQueue_(r,n),n},Ke.prototype.rerunTransactionQueue_=function(t,e){if(0!==t.length){for(var n=[],r=[],i=t.filter((function(t){return t.status===tn.RUN})).map((function(t){return t.currentWriteId})),o=0;o<t.length;o++){var a=t[o],s=Y.relativePath(e,a.path),u=!1,c=void 0;if(m.assert(null!==s,"rerunTransactionsUnderNode_: relativePath should not be null."),a.status===tn.NEEDS_ABORT)u=!0,c=a.abortReason,r=r.concat(this.serverSyncTree_.ackUserWrite(a.currentWriteId,!0));else if(a.status===tn.RUN)if(a.retryCount>=Ke.MAX_TRANSACTION_RETRIES_)u=!0,c="maxretry",r=r.concat(this.serverSyncTree_.ackUserWrite(a.currentWriteId,!0));else{var l=this.getLatestState_(a.path,i);a.currentInputSnapshot=l;var h=t[o].update(l.val());if(void 0!==h){st("transaction failed: Data returned ",h,a.path);var f=qt(h);"object"==typeof h&&null!=h&&m.contains(h,".priority")||(f=f.updatePriority(l.getPriority()));var d=a.currentWriteId,p=this.generateServerValues(),y=ne(f,p);a.currentOutputSnapshotRaw=f,a.currentOutputSnapshotResolved=y,a.currentWriteId=this.getNextWriteId_(),i.splice(i.indexOf(d),1),r=(r=r.concat(this.serverSyncTree_.applyUserOverwrite(a.path,y,a.currentWriteId,a.applyLocally))).concat(this.serverSyncTree_.ackUserWrite(d,!0))}else u=!0,c="nodata",r=r.concat(this.serverSyncTree_.ackUserWrite(a.currentWriteId,!0))}if(this.eventQueue_.raiseEventsForChangedPath(e,r),r=[],u&&(t[o].status=tn.COMPLETED,setTimeout(t[o].unwatcher,Math.floor(0)),t[o].onComplete))if("nodata"===c){var v=new Xe(this,t[o].path),g=new Kt(t[o].currentInputSnapshot,v,It);n.push(t[o].onComplete.bind(null,null,!1,g))}else n.push(t[o].onComplete.bind(null,new Error(c),!1,null))}for(this.pruneCompletedTransactionsBelowNode_(this.transactionQueueTree_),o=0;o<n.length;o++)G(n[o]);this.sendReadyTransactions_()}},Ke.prototype.getAncestorTransactionNode_=function(t){for(var e,n=this.transactionQueueTree_;null!==(e=t.getFront())&&null===n.getValue();)n=n.subTree(e),t=t.popFront();return n},Ke.prototype.buildTransactionQueue_=function(t){var e=[];return this.aggregateTransactionQueuesForNode_(t,e),e.sort((function(t,e){return t.order-e.order})),e},Ke.prototype.aggregateTransactionQueuesForNode_=function(t,e){var n=this,r=t.getValue();if(null!==r)for(var i=0;i<r.length;i++)e.push(r[i]);t.forEachChild((function(t){n.aggregateTransactionQueuesForNode_(t,e)}))},Ke.prototype.pruneCompletedTransactionsBelowNode_=function(t){var e=this,n=t.getValue();if(n){for(var r=0,i=0;i<n.length;i++)n[i].status!==tn.COMPLETED&&(n[r]=n[i],r++);n.length=r,t.setValue(n.length>0?n:null)}t.forEachChild((function(t){e.pruneCompletedTransactionsBelowNode_(t)}))},Ke.prototype.abortTransactions_=function(t){var e=this,n=this.getAncestorTransactionNode_(t).path(),r=this.transactionQueueTree_.subTree(t);return r.forEachAncestor((function(t){e.abortTransactionsOnNode_(t)})),this.abortTransactionsOnNode_(r),r.forEachDescendant((function(t){e.abortTransactionsOnNode_(t)})),n},Ke.prototype.abortTransactionsOnNode_=function(t){var e=t.getValue();if(null!==e){for(var n=[],r=[],i=-1,o=0;o<e.length;o++)e[o].status===tn.SENT_NEEDS_ABORT||(e[o].status===tn.SENT?(m.assert(i===o-1,"All SENT items should be at beginning of queue."),i=o,e[o].status=tn.SENT_NEEDS_ABORT,e[o].abortReason="set"):(m.assert(e[o].status===tn.RUN,"Unexpected transaction status in abort"),e[o].unwatcher(),r
1=r.concat(this.serverSyncTree_.ackUserWrite(e[o].currentWriteId,!0)),e[o].onComplete&&n.push(e[o].onComplete.bind(null,new Error("set"),!1,null))));for(-1===i?t.setValue(null):e.length=i+1,this.eventQueue_.raiseEventsForChangedPath(t.path(),r),o=0;o<n.length;o++)G(n[o])}};var en,nn=function(){function t(){this.repos_={},this.useRestClient_=!1}return t.getInstance=function(){return en||(en=new t),en},t.prototype.interrupt=function(){for(var t in this.repos_)for(var e in this.repos_[t])this.repos_[t][e].interrupt()},t.prototype.resume=function(){for(var t in this.repos_)for(var e in this.repos_[t])this.repos_[t][e].resume()},t.prototype.databaseFromApp=function(t,e){var n=e||t.options.databaseURL;void 0===n&&N("Can't determine Firebase Database URL.  Be sure to include databaseURL option when calling firebase.initializeApp().");var r=Z(n),i=r.repoInfo;return mt("Invalid Firebase Database URL",1,r),r.path.isEmpty()||N("Database URL must point to the root of a Firebase Database (not including a child path)."),this.createRepo(i,t).database},t.prototype.deleteRepo=function(t){var e=m.safeGet(this.repos_,t.app.name);e&&m.safeGet(e,t.repoInfo_.toURLString())===t||N("Database "+t.app.name+"("+t.repoInfo_+") has already been deleted."),t.interrupt(),delete e[t.repoInfo_.toURLString()]},t.prototype.createRepo=function(t,e){var n=m.safeGet(this.repos_,e.name);n||(this.repos_[e.name]=n={});var r=m.safeGet(n,t.toURLString());return r&&N("Database initialized multiple times. Please make sure the format of the database URL matches with each database() call."),r=new Ke(t,this.useRestClient_,e),n[t.toURLString()]=r,r},t.prototype.forceRestClient=function(t){this.useRestClient_=t},t}(),rn=function(){function t(t){this.repo_=t,t instanceof Ke||N("Don't call new Database() directly - please use firebase.database()."),this.root_=new Xe(t,Y.Empty),this.INTERNAL=new on(this)}return Object.defineProperty(t.prototype,"app",{get:function(){return this.repo_.app},enumerable:!0,configurable:!0}),t.prototype.ref=function(t){return this.checkDeleted_("ref"),m.validateArgCount("database.ref",0,1,arguments.length),t instanceof Xe?this.refFromURL(t.toString()):void 0!==t?this.root_.child(t):this.root_},t.prototype.refFromURL=function(t){var e="database.refFromURL";this.checkDeleted_(e),m.validateArgCount(e,1,1,arguments.length);var n=Z(t);mt(e,1,n);var r=n.repoInfo;return r.host!==this.repo_.repoInfo_.host&&N(e+": Host name does not match the current database: (found "+r.host+" but expected "+this.repo_.repoInfo_.host+")"),this.ref(n.path.toString())},t.prototype.checkDeleted_=function(t){null===this.repo_&&N("Cannot call "+t+" on a deleted database.")},t.prototype.goOffline=function(){m.validateArgCount("database.goOffline",0,0,arguments.length),this.checkDeleted_("goOffline"),this.repo_.interrupt()},t.prototype.goOnline=function(){m.validateArgCount("database.goOnline",0,0,arguments.length),this.checkDeleted_("goOnline"),this.repo_.resume()},t.ServerValue={TIMESTAMP:{".sv":"timestamp"}},t}(),on=function(){function t(t){this.database=t}return t.prototype.delete=function(){return v.__awaiter(this,void 0,void 0,(function(){return v.__generator(this,(function(t){return this.database.checkDeleted_("delete"),nn.getInstance().deleteRepo(this.database.repo_),this.database.repo_=null,this.database.root_=null,this.database.INTERNAL=null,this.database=null,[2]}))}))},t}(),an=Object.freeze({forceLongPolling:function(){qe.forceDisallow(),Fe.forceAllow()},forceWebSockets:function(){Fe.forceDisallow()},isWebSocketsAvailable:function(){return qe.isAvailable()},setSecurityDebugCallback:function(t,e){t.repo.persistentConnection_.securityDebugCallback_=e},stats:function(t,e){t.repo.stats(e)},statsIncrementCounter:function(t,e){t.repo.statsIncrementCounter(e)},dataUpdateCount:function(t){return t.repo.dataUpdateCount},interceptServerData:function(t,e){return t.repo.interceptServerData_(e)}}),sn=He;He.prototype.simpleListen=function(t,e){this.sendRequest("q",{p:t},e)},He.prototype.echo=function(t,e){this.sendRequest("echo",{d:t},e)};var un=Object.freeze({DataConnection:sn,RealTimeConnection:We,hijackHash:function(t){var e=He.prototype.put;return He.prototype.put=function(n,r,i,o){void 0!==o&&(o=t()),e.call(this,n,r,i,o)},function(){He.prototype.put=e}},ConnectionTarget:J,queryIdentifier:function(t){return t.queryIdentifier()},listens:function(t){return t.repo.persistentConnection_.listens_},forceRestClient:function(t){nn.getInstance().forceRestClient(t)}}),cn=rn.ServerValue;function ln(e){var n=e.INTERNAL.registerService("database",(function(t,e,n){return nn.getInstance().databaseFromApp(t,n)}),{Reference:Xe,Query:Jt,Database:rn,enableLogging:A,INTERNAL:an,ServerValue:cn,TEST_ACCESS:un},null,!0);m.isNodeSdk()&&(t.exports=n)}ln(g),e.registerDatabase=ln,e.Database=rn,e.Query=Jt,e.Reference=Xe,e.enableLogging=A,e.ServerValue=cn,e.DataSnapshot=Kt,e.OnDisconnect=vt},Oipj:function(t,e,n){"use strict";
1Object.defineProperty(e,"__esModule",{value:!0}),function(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}(n("CB3U"))},OwPH:function(t,e){t.exports=function(t,e){return{value:e,done:!!t}}},Oyqw:function(t,e,n){var r=n("U/+K")("meta"),i=n("Zp05"),o=n("g0Mr"),a=n("ytDL").f,s=0,u=Object.isExtensible||function(){return!0},c=!n("61rj")((function(){return u(Object.preventExtensions({}))})),l=function(t){a(t,r,{value:{i:"O"+ ++s,w:{}}})},h=t.exports={KEY:r,NEED:!1,fastKey:function(t,e){if(!i(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!o(t,r)){if(!u(t))return"F";if(!e)return"E";l(t)}return t[r].i},getWeak:function(t,e){if(!o(t,r)){if(!u(t))return!0;if(!e)return!1;l(t)}return t[r].w},onFreeze:function(t){return c&&h.NEED&&u(t)&&!o(t,r)&&l(t),t}}},PU8L:function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n("6blF");function i(t){var e=new r.a((function(e){e.next(t),e.complete()}));return e._isScalar=!0,e.value=t,e}},PfMj:function(t,e,n){var r=n("Zp05"),i=n("gYfK"),o=n("jZgK")("match");t.exports=function(t){var e;return r(t)&&(void 0!==(e=t[o])?!!e:"RegExp"==i(t))}},Phjn:function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n("psW0");function i(t,e){return Object(r.a)(t,e,1)}},QEVv:function(t,e,n){var r=n("gYfK"),i=n("jZgK")("toStringTag"),o="Arguments"==r(function(){return arguments}());t.exports=function(t){var e,n,a;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(n){}}(e=Object(t),i))?n:o?r(e):"Object"==(a=r(e))&&"function"==typeof e.callee?"Arguments":a}},"Qtk+":function(t,e){t.exports={}},"Rbo/":function(t,e,n){var r=n("ytDL"),i=n("UFGs"),o=n("9Aud");t.exports=n("lIov")?Object.defineProperties:function(t,e){i(t);for(var n,a=o(e),s=a.length,u=0;s>u;)r.f(t,n=a[u++],e[n]);return t}},S1nX:function(t,e,n){"use strict";var r=n("mrSG"),i=n("K9Ia"),o=n("6blF"),a=n("FFOo"),s=n("pugT");function u(){return function(t){return t.lift(new c(t))}}var c=function(){function t(t){this.connectable=t}return t.prototype.call=function(t,e){var n=this.connectable;n._refCount++;var r=new l(t,n),i=e.subscribe(r);return r.closed||(r.connection=n.connect()),i},t}(),l=function(t){function e(e,n){var r=t.call(this,e)||this;return r.connectable=n,r}return r.d(e,t),e.prototype._unsubscribe=function(){var t=this.connectable;if(t){this.connectable=null;var e=t._refCount;if(e<=0)this.connection=null;else if(t._refCount=e-1,e>1)this.connection=null;else{var n=this.connection,r=t._connection;this.connection=null,!r||n&&r!==n||r.unsubscribe()}}else this.connection=null},e}(a.a),h=function(t){function e(e,n){var r=t.call(this)||this;return r.source=e,r.subjectFactory=n,r._refCount=0,r._isComplete=!1,r}return r.d(e,t),e.prototype._subscribe=function(t){return this.getSubject().subscribe(t)},e.prototype.getSubject=function(){var t=this._subject;return t&&!t.isStopped||(this._subject=this.subjectFactory()),this._subject},e.prototype.connect=function(){var t=this._connection;return t||(this._isComplete=!1,(t=this._connection=new s.a).add(this.source.subscribe(new d(this.getSubject(),this))),t.closed?(this._connection=null,t=s.a.EMPTY):this._connection=t),t},e.prototype.refCount=function(){return u()(this)},e}(o.a).prototype,f={operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:h._subscribe},_isComplete:{value:h._isComplete,writable:!0},getSubject:{value:h.getSubject},connect:{value:h.connect},refCount:{value:h.refCount}},d=function(t){function e(e,n){var r=t.call(this,e)||this;return r.connectable=n,r}return r.d(e,t),e.prototype._error=function(e){this._unsubscribe(),t.prototype._error.call(this,e)},e.prototype._complete=function(){this.connectable._isComplete=!0,this._unsubscribe(),t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){var t=this.connectable;if(t){this.connectable=null;var e=t._connection;t._refCount=0,t._subject=null,t._connection=null,e&&e.unsubscribe()}},e}(i.b);function p(){return new i.a}function m(){return function(t){return u()((e=p,function(t){var n;n="function"==typeof e?e:function(){return e};var r=Object.create(t,f);return r.source=t,r.subjectFactory=n,r})(t));var e}}n.d(e,"a",(function(){return m}))},S5XQ:function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n("DKTb"),i=function(t){return function(e){return t.then((function(t){e.closed||(e.next(t),e.complete())}),(function(t){return e.error(t)})).then(null,r.a),e}}},T1DM:function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n("h9Dq"),i=new(n("CS9Q").a)(r.a)},TDVo:function(t,e,n){var r=n("qtiw"),i=n("GYIZ"),o=n("g0Mr"),a=n("U/+K")("src"),s=Function.toString,u=(""+s).split("toString");n("Autd").inspectSource=function(t){return s.call(t)},(t.exports=function(t,e,n,s){var c="function"==typeof n;c&&(o(n,"name")||i(n,"name",e)),t[e]!==n&&(c&&(o(n,a)||i(n,a,t[e]?""+t[e]:u.join(String(e)))
1),t===r?t[e]=n:s?t[e]?t[e]=n:i(t,e,n):(delete t[e],i(t,e,n)))})(Function.prototype,"toString",(function(){return"function"==typeof this&&this[a]||s.call(this)}))},"TGP+":function(t,e,n){n("FTyF"),t.exports=n("Autd").Object.assign},"Td+X":function(t,e,n){"use strict";var r=n("8L4g"),i=n("I1rR"),o=n("TDVo"),a=n("GYIZ"),s=n("Qtk+"),u=n("JiIP"),c=n("A+3H"),l=n("a5Eg"),h=n("jZgK")("iterator"),f=!([].keys&&"next"in[].keys()),d=function(){return this};t.exports=function(t,e,n,p,m,y,v){u(n,e,p);var g,b,w,_=function(t){if(!f&&t in T)return T[t];switch(t){case"keys":case"values":return function(){return new n(this,t)}}return function(){return new n(this,t)}},S=e+" Iterator",C="values"==m,E=!1,T=t.prototype,k=T[h]||T["@@iterator"]||m&&T[m],I=k||_(m),O=m?C?_("entries"):I:void 0,x="Array"==e&&T.entries||k;if(x&&(w=l(x.call(new t)))!==Object.prototype&&w.next&&(c(w,S,!0),r||"function"==typeof w[h]||a(w,h,d)),C&&k&&"values"!==k.name&&(E=!0,I=function(){return k.call(this)}),r&&!v||!f&&!E&&T[h]||a(T,h,I),s[e]=I,s[S]=d,m)if(g={values:C?I:_("values"),keys:y?I:_("keys"),entries:O},v)for(b in g)b in T||o(T,b,g[b]);else i(i.P+i.F*(f||E),e,g);return g}},"U/+K":function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+r).toString(36))}},U8mZ:function(t,e,n){"use strict";var r=n("dNFx"),i=n("OwPH"),o=n("Qtk+"),a=n("rSCU");t.exports=n("Td+X")(Array,"Array",(function(t,e){this._t=a(t),this._i=0,this._k=e}),(function(){var t=this._t,e=this._k,n=this._i++;return!t||n>=t.length?(this._t=void 0,i(1)):i(0,"keys"==e?n:"values"==e?t[n]:[n,t[n]])}),"values"),o.Arguments=o.Array,r("keys"),r("values"),r("entries")},UFGs:function(t,e,n){var r=n("Zp05");t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},UOZm:function(t,e){e.f={}.propertyIsEnumerable},UdJG:function(t,e,n){"use strict";n.d(e,"b",(function(){return f})),n.d(e,"a",(function(){return d}));var r=n("0/uQ"),i=n("htu+"),o=n("67Y/"),a=n("VnD/"),s=n("dC0D"),u=n("mZXl"),c=n("83ve"),l=n("D4gr"),h=function(){return(h=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function f(t){return t&&0!==t.length||(t=["added","removed","modified"]),t}var d=function(){function t(t,e,n){this.ref=t,this.query=e,this.afs=n}return t.prototype.stateChanges=function(t){return t&&0!==t.length?Object(c.c)(this.query,this.afs.schedulers.outsideAngular).pipe(this.afs.keepUnstableUntilFirst,Object(o.a)((function(e){return e.filter((function(e){return t.indexOf(e.type)>-1}))})),Object(a.a)((function(t){return t.length>0}))):Object(c.c)(this.query,this.afs.schedulers.outsideAngular).pipe(this.afs.keepUnstableUntilFirst)},t.prototype.auditTrail=function(t){return this.stateChanges(t).pipe(Object(s.a)((function(t,e){return t.concat(e)}),[]))},t.prototype.snapshotChanges=function(t){var e=f(t);return Object(c.d)(this.query,e,this.afs.schedulers.outsideAngular).pipe(this.afs.keepUnstableUntilFirst)},t.prototype.valueChanges=function(t){return void 0===t&&(t={}),Object(i.a)(this.query,this.afs.schedulers.outsideAngular).pipe(this.afs.keepUnstableUntilFirst,Object(o.a)((function(e){return e.payload.docs.map((function(e){var n;return t.idField?h({},e.data(),((n={})[t.idField]=e.id,n)):e.data()}))})))},t.prototype.get=function(t){return Object(r.a)(this.query.get(t)).pipe(Object(u.a)(this.afs.schedulers.insideAngular))},t.prototype.add=function(t){return this.ref.add(t)},t.prototype.doc=function(t){return new l.a(this.ref.doc(t),this.afs)},t}()},Uv6z:function(t,e){!function(t){"use strict";if(!t.fetch){var e="URLSearchParams"in t,n="Symbol"in t&&"iterator"in Symbol,r="FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),i="FormData"in t,o="ArrayBuffer"in t;if(o)var a=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],s=function(t){return t&&DataView.prototype.isPrototypeOf(t)},u=ArrayBuffer.isView||function(t){return t&&a.indexOf(Object.prototype.toString.call(t))>-1};p.prototype.append=function(t,e){t=h(t),e=f(e);var n=this.map[t];this.map[t]=n?n+","+e:e},p.prototype.delete=function(t){delete this.map[h(t)]},p.prototype.get=function(t){return t=h(t),this.has(t)?this.map[t]:null},p.prototype.has=function(t){return this.map.hasOwnProperty(h(t))},p.prototype.set=function(t,e){this.map[h(t)]=f(e)},p.prototype.forEach=function(t,e){for(var n in this.map)this.map.hasOwnProperty(n)&&t.call(e,this.map[n],n,this)},p.prototype.keys=function(){var t=[];return this.forEach((function(e,n){t.push(n)})),d(t)},p.prototype.values=function(){var t=[];return this.forEach((function(e){t.push(e)})),d(t)},p.prototype.entries=function(){var t=[];return this.forEach((function(e,n){t.push([n,e])})),d(t)},n&&(p.prototype[Symbol.iterator]=p.prototype.entries);
1var c=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];w.prototype.clone=function(){return new w(this,{body:this._bodyInit})},b.call(w.prototype),b.call(S.prototype),S.prototype.clone=function(){return new S(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new p(this.headers),url:this.url})},S.error=function(){var t=new S(null,{status:0,statusText:""});return t.type="error",t};var l=[301,302,303,307,308];S.redirect=function(t,e){if(-1===l.indexOf(e))throw new RangeError("Invalid status code");return new S(null,{status:e,headers:{location:t}})},t.Headers=p,t.Request=w,t.Response=S,t.fetch=function(t,e){return new Promise((function(n,i){var o=new w(t,e),a=new XMLHttpRequest;a.onload=function(){var t,e,r={status:a.status,statusText:a.statusText,headers:(t=a.getAllResponseHeaders()||"",e=new p,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(t){var n=t.split(":"),r=n.shift().trim();if(r){var i=n.join(":").trim();e.append(r,i)}})),e)};r.url="responseURL"in a?a.responseURL:r.headers.get("X-Request-URL"),n(new S("response"in a?a.response:a.responseText,r))},a.onerror=function(){i(new TypeError("Network request failed"))},a.ontimeout=function(){i(new TypeError("Network request failed"))},a.open(o.method,o.url,!0),"include"===o.credentials?a.withCredentials=!0:"omit"===o.credentials&&(a.withCredentials=!1),"responseType"in a&&r&&(a.responseType="blob"),o.headers.forEach((function(t,e){a.setRequestHeader(e,t)})),a.send(void 0===o._bodyInit?null:o._bodyInit)}))},t.fetch.polyfill=!0}function h(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function f(t){return"string"!=typeof t&&(t=String(t)),t}function d(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return n&&(e[Symbol.iterator]=function(){return e}),e}function p(t){this.map={},t instanceof p?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function m(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function y(t){return new Promise((function(e,n){t.onload=function(){e(t.result)},t.onerror=function(){n(t.error)}}))}function v(t){var e=new FileReader,n=y(e);return e.readAsArrayBuffer(t),n}function g(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function b(){return this.bodyUsed=!1,this._initBody=function(t){if(this._bodyInit=t,t)if("string"==typeof t)this._bodyText=t;else if(r&&Blob.prototype.isPrototypeOf(t))this._bodyBlob=t;else if(i&&FormData.prototype.isPrototypeOf(t))this._bodyFormData=t;else if(e&&URLSearchParams.prototype.isPrototypeOf(t))this._bodyText=t.toString();else if(o&&r&&s(t))this._bodyArrayBuffer=g(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer]);else{if(!o||!ArrayBuffer.prototype.isPrototypeOf(t)&&!u(t))throw new Error("unsupported BodyInit type");this._bodyArrayBuffer=g(t)}else this._bodyText="";this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):e&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},r&&(this.blob=function(){var t=m(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?m(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(v)}),this.text=function(){var t,e,n,r=m(this);if(r)return r;if(this._bodyBlob)return t=this._bodyBlob,n=y(e=new FileReader),e.readAsText(t),n;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),n=new Array(e.length),r=0;r<e.length;r++)n[r]=String.fromCharCode(e[r]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},i&&(this.formData=function(){return this.text().then(_)}),this.json=function(){return this.text().then(JSON.parse)},this}function w(t,e){var n,r,i=(e=e||{}).body;if(t instanceof w){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new p(t.headers)),this.method=t.method,this.mode=t.mode,i||null==t._bodyInit||(i=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"omit",!e.headers&&this.headers||(this.headers=new p(e.headers)),this.method=(r=(n=e.method||this.method||"GET").toUpperCase(),c.indexOf(r)>-1?r:n),this.mode=e.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function _(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var n=t.split("="),r=n.shift().replace(/\+/g," "),i=n.join("=").replace(/\+/g," ");e.append(decodeURIComponent(r),decodeURIComponent(i))}})),e}function S(t,e){e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new p(e.headers),this.url=e.url||"",this._initBody(t)}}("undefined"!=typeof self?self:this)},VPEh:function(t,e,n){n("6d8W"),t.exports=n("Autd").Array.findIndex},"VnD/":function(t,e,n){"use strict";n.d(e,"a",(function(){return o}
1));var r=n("mrSG"),i=n("FFOo");function o(t,e){return function(n){return n.lift(new a(t,e))}}var a=function(){function t(t,e){this.predicate=t,this.thisArg=e}return t.prototype.call=function(t,e){return e.subscribe(new s(t,this.predicate,this.thisArg))},t}(),s=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.predicate=n,i.thisArg=r,i.count=0,i}return r.d(e,t),e.prototype._next=function(t){var e;try{e=this.predicate.call(this.thisArg,t,this.count++)}catch(n){return void this.destination.error(n)}e&&this.destination.next(t)},e}(i.a)},VqlW:function(t,e,n){var r=n("sQ1z"),i=n("8ouO");t.exports=function(t){return function(e,n){var o,a,s=String(i(e)),u=r(n),c=s.length;return u<0||u>=c?t?"":void 0:(o=s.charCodeAt(u))<55296||o>56319||u+1===c||(a=s.charCodeAt(u+1))<56320||a>57343?t?s.charAt(u):o:t?s.slice(u,u+2):a-56320+(o-55296<<10)+65536}}},"W+Pj":function(t,e,n){n("KBN1"),t.exports=n("Autd").String.startsWith},Wcq6:function(t,e,n){"use strict";n("lcbw");var r,i=(r=n("wj3C"))&&"object"==typeof r&&"default"in r?r.default:r;t.exports=i},X8TH:function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n("fvl4"),i=(n("5x/H"),function(){function t(){}var e;return e=t,t.enablePersistence=function(t){return{ngModule:e,providers:[{provide:r.d,useValue:!0},{provide:r.g,useValue:t}]}},t}())},ZBkt:function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var r=n("6blF"),i=n("0/uQ"),o=n("F/XL"),a=n("15JJ"),s=n("NKHs"),u=n("hDTV"),c=function(){return function(t,e,n,c){var l=this,h=Object(s.c)(new s.b(c),n);this.auth=c.runOutsideAngular((function(){return Object(u.e)(t,c,e).auth()})),this.authState=new r.a((function(t){return c.runOutsideAngular((function(){return l.auth.onAuthStateChanged(t)}))})).pipe(h),this.user=new r.a((function(t){return c.runOutsideAngular((function(){return l.auth.onIdTokenChanged(t)}))})).pipe(h),this.idToken=this.user.pipe(Object(a.a)((function(t){return t?Object(i.a)(t.getIdToken()):Object(o.a)(null)}))),this.idTokenResult=this.user.pipe(Object(a.a)((function(t){return t?Object(i.a)(t.getIdTokenResult()):Object(o.a)(null)})))}}()},ZYCi:function(t,e,n){"use strict";var r=n("mrSG"),i=n("Ip0R"),o=n("CcnG"),a=n("F/XL"),s=n("0/uQ"),u=n("26FU"),c=n("6blF");function l(){return Error.call(this),this.message="no elements in sequence",this.name="EmptyError",this}l.prototype=Object.create(Error.prototype);var h=l,f=n("nkY7"),d=n("isby"),p=n("MGBS"),m=n("zotm"),y=n("IUTb"),v={};function g(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=null,r=null;return Object(f.a)(t[t.length-1])&&(r=t.pop()),"function"==typeof t[t.length-1]&&(n=t.pop()),1===t.length&&Object(d.a)(t[0])&&(t=t[0]),Object(y.a)(t,r).lift(new b(n))}var b=function(){function t(t){this.resultSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new w(t,this.resultSelector))},t}(),w=function(t){function e(e,n){var r=t.call(this,e)||this;return r.resultSelector=n,r.active=0,r.values=[],r.observables=[],r}return r.d(e,t),e.prototype._next=function(t){this.values.push(v),this.observables.push(t)},e.prototype._complete=function(){var t=this.observables,e=t.length;if(0===e)this.destination.complete();else{this.active=e,this.toRespond=e;for(var n=0;n<e;n++){var r=t[n];this.add(Object(m.a)(this,r,r,n))}}},e.prototype.notifyComplete=function(t){0==(this.active-=1)&&this.destination.complete()},e.prototype.notifyNext=function(t,e,n,r,i){var o=this.values,a=this.toRespond?o[n]===v?--this.toRespond:this.toRespond:0;o[n]=e,0===a&&(this.resultSelector?this._tryResultSelector(o):this.destination.next(o.slice()))},e.prototype._tryResultSelector=function(t){var e;try{e=this.resultSelector.apply(this,t)}catch(n){return void this.destination.error(n)}this.destination.next(e)},e}(p.a),_=n("G5J1");function S(t){return new c.a((function(e){var n;try{n=t()}catch(r){return void e.error(r)}return(n?Object(s.a)(n):Object(_.b)()).subscribe(e)}))}var C=n("K9Ia"),E=n("67Y/"),T=n("Zn8D");function k(){return Object(T.a)(1)}var I=n("VnD/"),O=n("FFOo");function x(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}x.prototype=Object.create(Error.prototype);var A=x;function P(t){return function(e){return 0===t?Object(_.b)():e.lift(new D(t))}}var D=function(){function t(t){if(this.total=t,this.total<0)throw new A}return t.prototype.call=function(t,e){return e.subscribe(new R(t,this.total))},t}(),R=function(t){function e(e,n){var r=t.call(this,e)||this;return r.total=n,r.ring=new Array,r.count=0,r}return r.d(e,t),e.prototype._next=function(t){var e=this.ring,n=this.total,r=this.count++;e.length<n?e.push(t):e[r%n]=t},e.prototype._complete=function(){var t=this.destination,e=this.count;if(e>0)for(var n=this.count>=this.total?this.total:this.count,r=this.ring,i=0;i<n;i++){var o=e++%n;t.next(r[o])}t.complete()},e}(O.a),N=n("xMyE"),j=function(t){return void 0===t&&(t=M),Object(N.a)({hasValue:!1,next:function(){this.hasValue=!0},complete:function(){if(!this.hasValue)throw t()}})};function M(){return new h}function L(t){return void 0===t&&(t=null),function(e){return e.lift(new F(t))}}var F=function(){function t(t){this.defaultValue=t}return t.prototype.call=function(t,e){return e.subscribe(new U(t,this.defaultValue))},t}(),U=function(t){function e(e,n){var r=t.call(this,e)||this;return r.defaultValue=n,r.isEmpty=!0,r}return r.d(e,t),e.prototype._next=function(t){this.isEmpty=!1,this.destination.next(t)},e.prototype._complete=function(){this.isEmpty&&this.destination.next(this.defaultValue),this.destination.complete()},e}(O.a),V=n("mChF");function q(t,e){var n=arguments.length>=2;return function(r){return r.pipe(t?Object(I.a)((function(e,n){return t(e,n,r)})):V.a,P(1),n?L(e):j((function(){return new h})))}}var B=n("rPjj");function W(t){return function(e){var n=new z(t),r=e.lift(n);return n.caught=r}}var z=function(){function t(t){this.selector=t}return t.prototype.call=function(t,e){return e.subscribe(new H(t,this.selector,this.caught))},t}(),H=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.selector=n,i.caught=r,i}return r.d(e,t),e.prototype.error=function(e){if(!this.isStopped){var n=void 0;try{n=this.selector(e,this.caught)}catch(i){return void t.prototype.error.call(this,i)}this._unsubscribeAndRecycle();var r=new B.a(this,void 0,void 0);this.add(r),Object(m.a)(this,n,void 0,void 0,r)}},e}(p.a);function $(t){return function(e){return 0===t?Object(_.b)():e.lift(new K(t))}}var K=function(){function t(t){if(this.total=t,this.total<0)throw new A}return t.prototype.call=function(t,e){return e.subscribe(new G(t,this.total))},t}(),G=function(t){function e(e,n){var r=t.call(this,e)||this;return r.total=n,r.count=0,r}return r.d(e,t),e.prototype._next=function(t){var e=this.total,n=++this.count;n<=e&&(this.destination.next(t),n===e&&(this.destination.complete(),this.unsubscribe()))},e}(O.a);function Q(t,e){var n=arguments.length>=2;return function(r){return r.pipe(t?Object(I.a)((function(e,n){return t(e,n,r)})):V.a,$(1),n?L(e):j((function(){return new h})))}}
1var Y=n("psW0"),X=function(){function t(t,e,n){this.predicate=t,this.thisArg=e,this.source=n}return t.prototype.call=function(t,e){return e.subscribe(new J(t,this.predicate,this.thisArg,this.source))},t}(),J=function(t){function e(e,n,r,i){var o=t.call(this,e)||this;return o.predicate=n,o.thisArg=r,o.source=i,o.index=0,o.thisArg=r||o,o}return r.d(e,t),e.prototype.notifyComplete=function(t){this.destination.next(t),this.destination.complete()},e.prototype._next=function(t){var e=!1;try{e=this.predicate.call(this.thisArg,t,this.index++,this.source)}catch(n){return void this.destination.error(n)}e||this.notifyComplete(!1)},e.prototype._complete=function(){this.notifyComplete(!0)},e}(O.a),Z=n("15JJ"),tt=n("PU8L");function et(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return 1===t.length||2===t.length&&Object(f.a)(t[1])?Object(s.a)(t[0]):k()(a.a.apply(void 0,t))}var nt=n("dC0D"),rt=n("Phjn"),it=n("y3By"),ot=n("pugT"),at=function(){function t(t){this.callback=t}return t.prototype.call=function(t,e){return e.subscribe(new st(t,this.callback))},t}(),st=function(t){function e(e,n){var r=t.call(this,e)||this;return r.add(new ot.a(n)),r}return r.d(e,t),e}(O.a),ut=n("ZYjt");n.d(e,"w",(function(){return qn})),n.d(e,"D",(function(){return Xn})),n.d(e,"y",(function(){return Hn})),n.d(e,"E",(function(){return Jn})),n.d(e,"F",(function(){return Zn})),n.d(e,"A",(function(){return Kn})),n.d(e,"z",(function(){return $n})),n.d(e,"C",(function(){return Yn})),n.d(e,"x",(function(){return Wn})),n.d(e,"B",(function(){return Qn})),n.d(e,"G",(function(){return Un})),n.d(e,"o",(function(){return On})),n.d(e,"p",(function(){return xn})),n.d(e,"r",(function(){return Rn})),n.d(e,"d",(function(){return ht})),n.d(e,"e",(function(){return lt})),n.d(e,"m",(function(){return gn})),n.d(e,"n",(function(){return In})),n.d(e,"l",(function(){return wn})),n.d(e,"j",(function(){return Vn})),n.d(e,"k",(function(){return tr})),n.d(e,"q",(function(){return zn})),n.d(e,"b",(function(){return Dn})),n.d(e,"f",(function(){return Ln})),n.d(e,"h",(function(){return Mn})),n.d(e,"i",(function(){return jn})),n.d(e,"s",(function(){return Fn})),n.d(e,"a",(function(){return ye})),n.d(e,"g",(function(){return It})),n.d(e,"t",(function(){return Sn})),n.d(e,"c",(function(){return Qt})),n.d(e,"u",(function(){return Gt})),n.d(e,"v",(function(){return kt}));var ct=function(){return function(t,e){this.id=t,this.url=e}}(),lt=function(t){function e(e,n,r,i){void 0===r&&(r="imperative"),void 0===i&&(i=null);var o=t.call(this,e,n)||this;return o.navigationTrigger=r,o.restoredState=i,o}return Object(r.d)(e,t),e.prototype.toString=function(){return"NavigationStart(id: "+this.id+", url: '"+this.url+"')"},e}(ct),ht=function(t){function e(e,n,r){var i=t.call(this,e,n)||this;return i.urlAfterRedirects=r,i}return Object(r.d)(e,t),e.prototype.toString=function(){return"NavigationEnd(id: "+this.id+", url: '"+this.url+"', urlAfterRedirects: '"+this.urlAfterRedirects+"')"},e}(ct),ft=function(t){function e(e,n,r){var i=t.call(this,e,n)||this;return i.reason=r,i}return Object(r.d)(e,t),e.prototype.toString=function(){return"NavigationCancel(id: "+this.id+", url: '"+this.url+"')"},e}(ct),dt=function(t){function e(e,n,r){var i=t.call(this,e,n)||this;return i.error=r,i}return Object(r.d)(e,t),e.prototype.toString=function(){return"NavigationError(id: "+this.id+", url: '"+this.url+"', error: "+this.error+")"},e}(ct),pt=function(t){function e(e,n,r,i){var o=t.call(this,e,n)||this;return o.urlAfterRedirects=r,o.state=i,o}return Object(r.d)(e,t),e.prototype.toString=function(){return"RoutesRecognized(id: "+this.id+", url: '"+this.url+"', urlAfterRedirects: '"+this.urlAfterRedirects+"', state: "+this.state+")"},e}(ct),mt=function(t){function e(e,n,r,i){var o=t.call(this,e,n)||this;return o.urlAfterRedirects=r,o.state=i,o}return Object(r.d)(e,t),e.prototype.toString=function(){return"GuardsCheckStart(id: "+this.id+", url: '"+this.url+"', urlAfterRedirects: '"+this.urlAfterRedirects+"', state: "+this.state+")"},e}(ct),yt=function(t){function e(e,n,r,i,o){var a=t.call(this,e,n)||this;return a.urlAfterRedirects=r,a.state=i,a.shouldActivate=o,a}return Object(r.d)(e,t),e.prototype.toString=function(){return"GuardsCheckEnd(id: "+this.id+", url: '"+this.url+"', urlAfterRedirects: '"+this.urlAfterRedirects+"', state: "+this.state+", shouldActivate: "+this.shouldActivate+")"},e}(ct),vt=function(t){function e(e,n,r,i){var o=t.call(this,e,n)||this;return o.urlAfterRedirects=r,o.state=i,o}
1return Object(r.d)(e,t),e.prototype.toString=function(){return"ResolveStart(id: "+this.id+", url: '"+this.url+"', urlAfterRedirects: '"+this.urlAfterRedirects+"', state: "+this.state+")"},e}(ct),gt=function(t){function e(e,n,r,i){var o=t.call(this,e,n)||this;return o.urlAfterRedirects=r,o.state=i,o}return Object(r.d)(e,t),e.prototype.toString=function(){return"ResolveEnd(id: "+this.id+", url: '"+this.url+"', urlAfterRedirects: '"+this.urlAfterRedirects+"', state: "+this.state+")"},e}(ct),bt=function(){function t(t){this.route=t}return t.prototype.toString=function(){return"RouteConfigLoadStart(path: "+this.route.path+")"},t}(),wt=function(){function t(t){this.route=t}return t.prototype.toString=function(){return"RouteConfigLoadEnd(path: "+this.route.path+")"},t}(),_t=function(){function t(t){this.snapshot=t}return t.prototype.toString=function(){return"ChildActivationStart(path: '"+(this.snapshot.routeConfig&&this.snapshot.routeConfig.path||"")+"')"},t}(),St=function(){function t(t){this.snapshot=t}return t.prototype.toString=function(){return"ChildActivationEnd(path: '"+(this.snapshot.routeConfig&&this.snapshot.routeConfig.path||"")+"')"},t}(),Ct=function(){function t(t){this.snapshot=t}return t.prototype.toString=function(){return"ActivationStart(path: '"+(this.snapshot.routeConfig&&this.snapshot.routeConfig.path||"")+"')"},t}(),Et=function(){function t(t){this.snapshot=t}return t.prototype.toString=function(){return"ActivationEnd(path: '"+(this.snapshot.routeConfig&&this.snapshot.routeConfig.path||"")+"')"},t}(),Tt=function(){function t(t,e,n){this.routerEvent=t,this.position=e,this.anchor=n}return t.prototype.toString=function(){return"Scroll(anchor: '"+this.anchor+"', position: '"+(this.position?this.position[0]+", "+this.position[1]:null)+"')"},t}(),kt=function(){return function(){}}(),It="primary",Ot=function(){function t(t){this.params=t||{}}return t.prototype.has=function(t){return this.params.hasOwnProperty(t)},t.prototype.get=function(t){if(this.has(t)){var e=this.params[t];return Array.isArray(e)?e[0]:e}return null},t.prototype.getAll=function(t){if(this.has(t)){var e=this.params[t];return Array.isArray(e)?e:[e]}return[]},Object.defineProperty(t.prototype,"keys",{get:function(){return Object.keys(this.params)},enumerable:!0,configurable:!0}),t}();function xt(t){return new Ot(t)}function At(t){var e=Error("NavigationCancelingError: "+t);return e.ngNavigationCancelingError=!0,e}function Pt(t,e,n){var r=n.path.split("/");if(r.length>t.length)return null;if("full"===n.pathMatch&&(e.hasChildren()||r.length<t.length))return null;for(var i={},o=0;o<r.length;o++){var a=r[o],s=t[o];if(a.startsWith(":"))i[a.substring(1)]=s;else if(a!==s.path)return null}return{consumed:t.slice(0,r.length),posParams:i}}var Dt=function(){return function(t,e){this.routes=t,this.module=e}}();function Rt(t,e){void 0===e&&(e="");for(var n=0;n<t.length;n++){var r=t[n];Nt(r,jt(e,r))}}function Nt(t,e){if(!t)throw new Error("\n      Invalid configuration of route '"+e+"': Encountered undefined route.\n      The reason might be an extra comma.\n\n      Example:\n      const routes: Routes = [\n        { path: '', redirectTo: '/dashboard', pathMatch: 'full' },\n        { path: 'dashboard',  component: DashboardComponent },, << two commas\n        { path: 'detail/:id', component: HeroDetailComponent }\n      ];\n    ");if(Array.isArray(t))throw new Error("Invalid configuration of route '"+e+"': Array cannot be specified");if(!t.component&&!t.children&&!t.loadChildren&&t.outlet&&t.outlet!==It)throw new Error("Invalid configuration of route '"+e+"': a componentless route without children or loadChildren cannot have a named outlet set");if(t.redirectTo&&t.children)throw new Error("Invalid configuration of route '"+e+"': redirectTo and children cannot be used together");if(t.redirectTo&&t.loadChildren)throw new Error("Invalid configuration of route '"+e+"': redirectTo and loadChildren cannot be used together");if(t.children&&t.loadChildren)throw new Error("Invalid configuration of route '"+e+"': children and loadChildren cannot be used together");if(t.redirectTo&&t.component)throw new Error("Invalid configuration of route '"+e+"': redirectTo and component cannot be used together");if(t.path&&t.matcher)throw new Error("Invalid configuration of route '"+e+"': path and matcher cannot be used together");if(void 0===t.redirectTo&&!t.component&&!t.children&&!t.loadChildren)throw new Error("Invalid configuration of route '"+e+"'. One of the following must be provided: component, redirectTo, children or loadChildren");if(void 0===t.path&&void 0===t.matcher)throw new Error("Invalid configuration of route '"+e+"': routes must have either a path or a matcher specified");if("string"==typeof t.path&&"/"===t.path.charAt(0))throw new Error("Invalid configuration of route '"+e+"': path cannot start with a slash");if(""===t.path&&void 0!==t.redirectTo&&void 0===t.pathMatch)throw new Error("Invalid configuration of route '{path: \""+e+'", redirectTo: "'+t.redirectTo+"\"}': please provide 'pathMatch'. The default value of 'pathMatch' is 'prefix', but often the intent is to use 'full'.");if(void 0!==t.pathMatch&&"full"!==t.pathMatch&&"prefix"!==t.pathMatch)throw new Error("Invalid configuration of route '"+e+"': pathMatch can only be set to 'prefix' or 'full'");t.children&&Rt(t.children,e)}function jt(t,e){return e?t||e.path?t&&!e.path?t+"/":!t&&e.path?e.path:t+"/"+e.path:"":t}function Mt(t){var e=t.children&&t.children.map(Mt),n=e?Object(r.a)({},t,{children:e}):Object(r.a)({},t);return!n.component&&(e||n.loadChildren)&&n.outlet&&n.outlet!==It&&(n.component=kt),n}function Lt(t,e){var n,r=Object.keys(t),i=Object.keys(e);if(r.length!=i.length)return!1;for(var o=0;o<r.length;o++)if(t[n=r[o]]!==e[n])return!1;return!0}function Ft(t){return Array.prototype.concat.apply([],t)}function Ut(t){return t.length>0?t[t.length-1]:null}function Vt(t,e){for(var n in t)t.hasOwnProperty(n)&&e(t[n],n)}function qt(t){return Object(o.sb)(t)?t:Object(o.tb)(t)?Object(s.a)(Prom
1ise.resolve(t)):Object(a.a)(t)}function Bt(t,e,n){return n?function(t,e){return Lt(t,e)}(t.queryParams,e.queryParams)&&function t(e,n){if(!$t(e.segments,n.segments))return!1;if(e.numberOfChildren!==n.numberOfChildren)return!1;for(var r in n.children){if(!e.children[r])return!1;if(!t(e.children[r],n.children[r]))return!1}return!0}(t.root,e.root):function(t,e){return Object.keys(e).length<=Object.keys(t).length&&Object.keys(e).every((function(n){return e[n]===t[n]}))}(t.queryParams,e.queryParams)&&function t(e,n){return function e(n,r,i){if(n.segments.length>i.length)return!!$t(a=n.segments.slice(0,i.length),i)&&!r.hasChildren();if(n.segments.length===i.length){if(!$t(n.segments,i))return!1;for(var o in r.children){if(!n.children[o])return!1;if(!t(n.children[o],r.children[o]))return!1}return!0}var a=i.slice(0,n.segments.length),s=i.slice(n.segments.length);return!!$t(n.segments,a)&&!!n.children[It]&&e(n.children[It],r,s)}(e,n,n.segments)}(t.root,e.root)}var Wt=function(){function t(t,e,n){this.root=t,this.queryParams=e,this.fragment=n}return Object.defineProperty(t.prototype,"queryParamMap",{get:function(){return this._queryParamMap||(this._queryParamMap=xt(this.queryParams)),this._queryParamMap},enumerable:!0,configurable:!0}),t.prototype.toString=function(){return Yt.serialize(this)},t}(),zt=function(){function t(t,e){var n=this;this.segments=t,this.children=e,this.parent=null,Vt(e,(function(t,e){return t.parent=n}))}return t.prototype.hasChildren=function(){return this.numberOfChildren>0},Object.defineProperty(t.prototype,"numberOfChildren",{get:function(){return Object.keys(this.children).length},enumerable:!0,configurable:!0}),t.prototype.toString=function(){return Xt(this)},t}(),Ht=function(){function t(t,e){this.path=t,this.parameters=e}return Object.defineProperty(t.prototype,"parameterMap",{get:function(){return this._parameterMap||(this._parameterMap=xt(this.parameters)),this._parameterMap},enumerable:!0,configurable:!0}),t.prototype.toString=function(){return re(this)},t}();function $t(t,e){return t.length===e.length&&t.every((function(t,n){return t.path===e[n].path}))}function Kt(t,e){var n=[];return Vt(t.children,(function(t,r){r===It&&(n=n.concat(e(t,r)))})),Vt(t.children,(function(t,r){r!==It&&(n=n.concat(e(t,r)))})),n}var Gt=function(){return function(){}}(),Qt=function(){function t(){}return t.prototype.parse=function(t){var e=new ue(t);return new Wt(e.parseRootSegment(),e.parseQueryParams(),e.parseFragment())},t.prototype.serialize=function(t){var e,n;return"/"+function t(e,n){if(!e.hasChildren())return Xt(e);if(n){var r=e.children[It]?t(e.children[It],!1):"",i=[];
1return Vt(e.children,(function(e,n){n!==It&&i.push(n+":"+t(e,!1))})),i.length>0?r+"("+i.join("//")+")":r}var o=Kt(e,(function(n,r){return r===It?[t(e.children[It],!1)]:[r+":"+t(n,!1)]}));return Xt(e)+"/("+o.join("//")+")"}(t.root,!0)+(e=t.queryParams,(n=Object.keys(e).map((function(t){var n=e[t];return Array.isArray(n)?n.map((function(e){return Zt(t)+"="+Zt(e)})).join("&"):Zt(t)+"="+Zt(n)}))).length?"?"+n.join("&"):"")+("string"==typeof t.fragment?"#"+encodeURI(t.fragment):"")},t}(),Yt=new Qt;function Xt(t){return t.segments.map((function(t){return re(t)})).join("/")}function Jt(t){return encodeURIComponent(t).replace(/%40/g,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",")}function Zt(t){return Jt(t).replace(/%3B/gi,";")}function te(t){return Jt(t).replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/%26/gi,"&")}function ee(t){return decodeURIComponent(t)}function ne(t){return ee(t.replace(/\+/g,"%20"))}function re(t){return""+te(t.path)+(e=t.parameters,Object.keys(e).map((function(t){return";"+te(t)+"="+te(e[t])})).join(""));var e}var ie=/^[^\/()?;=#]+/;function oe(t){var e=t.match(ie);return e?e[0]:""}var ae=/^[^=?&#]+/,se=/^[^?&#]+/,ue=function(){function t(t){this.url=t,this.remaining=t}return t.prototype.parseRootSegment=function(){return this.consumeOptional("/"),""===this.remaining||this.peekStartsWith("?")||this.peekStartsWith("#")?new zt([],{}):new zt([],this.parseChildren())},t.prototype.parseQueryParams=function(){var t={};if(this.consumeOptional("?"))do{this.parseQueryParam(t)}while(this.consumeOptional("&"));return t},t.prototype.parseFragment=function(){return this.consumeOptional("#")?decodeURIComponent(this.remaining):null},t.prototype.parseChildren=function(){if(""===this.remaining)return{};this.consumeOptional("/");var t=[];for(this.peekStartsWith("(")||t.push(this.parseSegment());this.peekStartsWith("/")&&!this.peekStartsWith("//")&&!this.peekStartsWith("/(");)this.capture("/"),t.push(this.parseSegment());var e={};this.peekStartsWith("/(")&&(this.capture("/"),e=this.parseParens(!0));var n={};return this.peekStartsWith("(")&&(n=this.parseParens(!1)),(t.length>0||Object.keys(e).length>0)&&(n[It]=new zt(t,e)),n},t.prototype.parseSegment=function(){var t=oe(this.remaining);if(""===t&&this.peekStartsWith(";"))throw new Error("Empty path url segment cannot have parameters: '"+this.remaining+"'.");return this.capture(t),new Ht(ee(t),this.parseMatrixParams())},t.prototype.parseMatrixParams=function(){for(var t={};this.consumeOptional(";");)this.parseParam(t);return t},t.prototype.parseParam=function(t){var e=oe(this.remaining);if(e){this.capture(e);var n="";if(this.consumeOptional("=")){var r=oe(this.remaining);r&&this.capture(n=r)}t[ee(e)]=ee(n)}},t.prototype.parseQueryParam=function(t){var e=function(t){var e=t.match(ae);return e?e[0]:""}(this.remaining);if(e){this.capture(e);var n="";if(this.consumeOptional("=")){var r=function(t){var e=t.match(se);return e?e[0]:""}(this.remaining);r&&this.capture(n=r)}var i=ne(e),o=ne(n);if(t.hasOwnProperty(i)){var a=t[i];Array.isArray(a)||(t[i]=a=[a]),a.push(o)}else t[i]=o}},t.prototype.parseParens=function(t){var e={};for(this.capture("(");!this.consumeOptional(")")&&this.remaining.length>0;){var n=oe(this.remaining),r=this.remaining[n.length];if("/"!==r&&")"!==r&&";"!==r)throw new Error("Cannot parse url '"+this.url+"'");var i=void 0;n.indexOf(":")>-1?(i=n.substr(0,n.indexOf(":")),this.capture(i),this.capture(":")):t&&(i=It);var o=this.parseChildren();e[i]=1===Object.keys(o).length?o[It]:new zt([],o),this.consumeOptional("//")}return e},t.prototype.peekStartsWith=function(t){return this.remaining.startsWith(t)},t.prototype.consumeOptional=function(t){return!!this.peekStartsWith(t)&&(this.remaining=this.remaining.substring(t.length),!0)},t.prototype.capture=function(t){if(!this.consumeOptional(t))throw new Error('Expected "'+t+'".')},t}(),ce=function(){function t(t){this._root=t}return Object.defineProperty(t.prototype,"root",{get:function(){return this._root.value},enumerable:!0,configurable:!0}),t.prototype.parent=function(t){var e=this.pathFromRoot(t);return e.length>1?e[e.length-2]:null},t.prototype.children=function(t){var e=le(t,this._root);return e?e.children.map((function(t){return t.value})):[]},t.prototype.firstChild=function(t){var e=le(t,this._root);return e&&e.children.length>0?e.children[0].value:null},t.prototype.siblings=function(t){var e=he(t,this._root);return e.length<2?[]:e[e.length-2].children.map((function(t){return t.value})).filter((function(e){return e!==t}))},t.prototype.pathFromRoot=function(t){return he(t,this._root).map((function(t){return t.value}))},t}();function le(t,e){var n,i;if(t===e.value)return e;try{for(var o=Object(r.k)(e.children),a=o.next();!a.done;a=o.next()){var s=le(t,a.value);if(s)return s}}catch(u){n={error:u}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}return null}function he(t,e){var n,i;if(t===e.value)return[e];try{for(var o=Object(r.k)(e.children),a=o.next();!a.done;a=o.next()){var s=he(t,a.value);if(s.length)return s.unshift(e),s}}catch(u){n={error:u}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}return[]}var fe=function(){function t(t,e){this.value=t,this.children=e}return t.prototype.toString=function(){return"TreeNode("+this.value+")"},t}();function de(t){var e={};
1return t&&t.children.forEach((function(t){return e[t.value.outlet]=t})),e}var pe=function(t){function e(e,n){var r=t.call(this,e)||this;return r.snapshot=n,we(r,e),r}return Object(r.d)(e,t),e.prototype.toString=function(){return this.snapshot.toString()},e}(ce);function me(t,e){var n=function(t,e){var n=new ge([],{},{},"",{},It,e,null,t.root,-1,{});return new be("",new fe(n,[]))}(t,e),r=new u.a([new Ht("",{})]),i=new u.a({}),o=new u.a({}),a=new u.a({}),s=new u.a(""),c=new ye(r,i,a,s,o,It,e,n.root);return c.snapshot=n.root,new pe(new fe(c,[]),n)}var ye=function(){function t(t,e,n,r,i,o,a,s){this.url=t,this.params=e,this.queryParams=n,this.fragment=r,this.data=i,this.outlet=o,this.component=a,this._futureSnapshot=s}return Object.defineProperty(t.prototype,"routeConfig",{get:function(){return this._futureSnapshot.routeConfig},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"root",{get:function(){return this._routerState.root},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){return this._routerState.parent(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"firstChild",{get:function(){return this._routerState.firstChild(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"children",{get:function(){return this._routerState.children(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"pathFromRoot",{get:function(){return this._routerState.pathFromRoot(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"paramMap",{get:function(){return this._paramMap||(this._paramMap=this.params.pipe(Object(E.a)((function(t){return xt(t)})))),this._paramMap},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"queryParamMap",{get:function(){return this._queryParamMap||(this._queryParamMap=this.queryParams.pipe(Object(E.a)((function(t){return xt(t)})))),this._queryParamMap},enumerable:!0,configurable:!0}),t.prototype.toString=function(){return this.snapshot?this.snapshot.toString():"Future("+this._futureSnapshot+")"},t}();function ve(t,e){void 0===e&&(e="emptyOnly");var n=t.pathFromRoot,i=0;if("always"!==e)for(i=n.length-1;i>=1;){var o=n[i],a=n[i-1];
1if(o.routeConfig&&""===o.routeConfig.path)i--;else{if(a.component)break;i--}}return function(t){return t.reduce((function(t,e){return{params:Object(r.a)({},t.params,e.params),data:Object(r.a)({},t.data,e.data),resolve:Object(r.a)({},t.resolve,e._resolvedData)}}),{params:{},data:{},resolve:{}})}(n.slice(i))}var ge=function(){function t(t,e,n,r,i,o,a,s,u,c,l){this.url=t,this.params=e,this.queryParams=n,this.fragment=r,this.data=i,this.outlet=o,this.component=a,this.routeConfig=s,this._urlSegment=u,this._lastPathIndex=c,this._resolve=l}return Object.defineProperty(t.prototype,"root",{get:function(){return this._routerState.root},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){return this._routerState.parent(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"firstChild",{get:function(){return this._routerState.firstChild(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"children",{get:function(){return this._routerState.children(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"pathFromRoot",{get:function(){return this._routerState.pathFromRoot(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"paramMap",{get:function(){return this._paramMap||(this._paramMap=xt(this.params)),this._paramMap},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"queryParamMap",{get:function(){return this._queryParamMap||(this._queryParamMap=xt(this.queryParams)),this._queryParamMap},enumerable:!0,configurable:!0}),t.prototype.toString=function(){return"Route(url:'"+this.url.map((function(t){return t.toString()})).join("/")+"', path:'"+(this.routeConfig?this.routeConfig.path:"")+"')"},t}(),be=function(t){function e(e,n){var r=t.call(this,n)||this;return r.url=e,we(r,n),r}return Object(r.d)(e,t),e.prototype.toString=function(){return _e(this._root)},e}(ce);function we(t,e){e.value._routerState=t,e.children.forEach((function(e){return we(t,e)}))}function _e(t){var e=t.children.length>0?" { "+t.children.map(_e).join(", ")+" } ":"";return""+t.value+e}function Se(t){if(t.snapshot){var e=t.snapshot,n=t._futureSnapshot;t.snapshot=n,Lt(e.queryParams,n.queryParams)||t.queryParams.next(n.queryParams),e.fragment!==n.fragment&&t.fragment.next(n.fragment),Lt(e.params,n.params)||t.params.next(n.params),function(t,e){if(t.length!==e.length)return!1;for(var n=0;n<t.length;++n)if(!Lt(t[n],e[n]))return!1;return!0}(e.url,n.url)||t.url.next(n.url),Lt(e.data,n.data)||t.data.next(n.data)}else t.snapshot=t._futureSnapshot,t.data.next(t._futureSnapshot.data)}function Ce(t,e){var n,r;return Lt(t.params,e.params)&&$t(n=t.url,r=e.url)&&n.every((function(t,e){return Lt(t.parameters,r[e].parameters)}))&&!(!t.parent!=!e.parent)&&(!t.parent||Ce(t.parent,e.parent))}function Ee(t){return"object"==typeof t&&null!=t&&!t.outlets&&!t.segmentPath}function Te(t,e,n,r,i){var o={};return r&&Vt(r,(function(t,e){o[e]=Array.isArray(t)?t.map((function(t){return""+t})):""+t})),new Wt(n.root===t?e:function t(e,n,r){var i={};return Vt(e.children,(function(e,o){i[o]=e===n?r:t(e,n,r)})),new zt(e.segments,i)}(n.root,t,e),o,i)}var ke=function(){function t(t,e,n){if(this.isAbsolute=t,this.numberOfDoubleDots=e,this.commands=n,t&&n.length>0&&Ee(n[0]))throw new Error("Root segment cannot have matrix parameters");var r=n.find((function(t){return"object"==typeof t&&null!=t&&t.outlets}));if(r&&r!==Ut(n))throw new Error("{outlets:{}} has to be the last command")}return t.prototype.toRoot=function(){return this.isAbsolute&&1===this.commands.length&&"/"==this.commands[0]},t}(),Ie=function(){return function(t,e,n){this.segmentGroup=t,this.processChildren=e,this.index=n}}();function Oe(t){return"object"==typeof t&&null!=t&&t.outlets?t.outlets[It]:""+t}function xe(t,e,n){if(t||(t=new zt([],{})),0===t.segments.length&&t.hasChildren())return Ae(t,e,n);var r=function(t,e,n){for(var r=0,i=e,o={match:!1,pathIndex:0,commandIndex:0};i<t.segments.length;){if(r>=n.length)return o;var a=t.segments[i],s=Oe(n[r]),u=r<n.length-1?n[r+1]:null;if(i>0&&void 0===s)break;if(s&&u&&"object"==typeof u&&void 0===u.outlets){if(!Ne(s,u,a))return o;r+=2}else{if(!Ne(s,{},a))return o;r++}i++}return{match:!0,pathIndex:i,commandIndex:r}}(t,e,n),i=n.slice(r.commandIndex);if(r.match&&r.pathIndex<t.segments.length){var o=new zt(t.segments.slice(0,r.pathIndex),{});return o.children[It]=new zt(t.segments.slice(r.pathIndex),t.children),Ae(o,0,i)}return r.match&&0===i.length?new zt(t.segments,{}):r.match&&!t.hasChildren()?Pe(t,e,n):r.match?Ae(t,0,i):Pe(t,e,n)}function Ae(t,e,n){if(0===n.length)return new zt(t.segments,{});var r=function(t){var e,n;return"object"!=typeof t[0]?((e={})[It]=t,e):void 0===t[0].outlets?((n={})[It]=t,n):t[0].outlets}(n),i={};return Vt(r,(function(n,r){null!==n&&(i[r]=xe(t.children[r],e,n))}
1)),Vt(t.children,(function(t,e){void 0===r[e]&&(i[e]=t)})),new zt(t.segments,i)}function Pe(t,e,n){for(var r=t.segments.slice(0,e),i=0;i<n.length;){if("object"==typeof n[i]&&void 0!==n[i].outlets){var o=De(n[i].outlets);return new zt(r,o)}if(0===i&&Ee(n[0]))r.push(new Ht(t.segments[e].path,n[0])),i++;else{var a=Oe(n[i]),s=i<n.length-1?n[i+1]:null;a&&s&&Ee(s)?(r.push(new Ht(a,Re(s))),i+=2):(r.push(new Ht(a,{})),i++)}}return new zt(r,{})}function De(t){var e={};return Vt(t,(function(t,n){null!==t&&(e[n]=Pe(new zt([],{}),0,t))})),e}function Re(t){var e={};return Vt(t,(function(t,n){return e[n]=""+t})),e}function Ne(t,e,n){return t==n.path&&Lt(e,n.parameters)}var je=function(){function t(t,e,n,r){this.routeReuseStrategy=t,this.futureState=e,this.currState=n,this.forwardEvent=r}return t.prototype.activate=function(t){var e=this.futureState._root,n=this.currState?this.currState._root:null;this.deactivateChildRoutes(e,n,t),Se(this.futureState.root),this.activateChildRoutes(e,n,t)},t.prototype.deactivateChildRoutes=function(t,e,n){var r=this,i=de(e);t.children.forEach((function(t){var e=t.value.outlet;r.deactivateRoutes(t,i[e],n),delete i[e]})),Vt(i,(function(t,e){r.deactivateRouteAndItsChildren(t,n)}))},t.prototype.deactivateRoutes=function(t,e,n){var r=t.value,i=e?e.value:null;if(r===i)if(r.component){var o=n.getContext(r.outlet);o&&this.deactivateChildRoutes(t,e,o.children)}else this.deactivateChildRoutes(t,e,n);else i&&this.deactivateRouteAndItsChildren(e,n)},t.prototype.deactivateRouteAndItsChildren=function(t,e){this.routeReuseStrategy.shouldDetach(t.value.snapshot)?this.detachAndStoreRouteSubtree(t,e):this.deactivateRouteAndOutlet(t,e)},t.prototype.detachAndStoreRouteSubtree=function(t,e){var n=e.getContext(t.value.outlet);if(n&&n.outlet){var r=n.outlet.detach(),i=n.children.onOutletDeactivated();this.routeReuseStrategy.store(t.value.snapshot,{componentRef:r,route:t,contexts:i})}},t.prototype.deactivateRouteAndOutlet=function(t,e){var n=this,r=e.getContext(t.value.outlet);if(r){var i=de(t),o=t.value.component?r.children:e;Vt(i,(function(t,e){return n.deactivateRouteAndItsChildren(t,o)})),r.outlet&&(r.outlet.deactivate(),r.children.onOutletDeactivated())}},t.prototype.activateChildRoutes=function(t,e,n){var r=this,i=de(e);t.children.forEach((function(t){r.activateRoutes(t,i[t.value.outlet],n),r.forwardEvent(new Et(t.value.snapshot))})),t.children.length&&this.forwardEvent(new St(t.value.snapshot))},t.prototype.activateRoutes=function(t,e,n){var r=t.value,i=e?e.value:null;if(Se(r),r===i)if(r.component){var o=n.getOrCreateContext(r.outlet);this.activateChildRoutes(t,e,o.children)}else this.activateChildRoutes(t,e,n);else if(r.component)if(o=n.getOrCreateContext(r.outlet),this.routeReuseStrategy.shouldAttach(r.snapshot)){var a=this.routeReuseStrategy.retrieve(r.snapshot);this.routeReuseStrategy.store(r.snapshot,null),o.children.onOutletReAttached(a.contexts),o.attachRef=a.componentRef,o.route=a.route.value,o.outlet&&o.outlet.attach(a.componentRef,a.route.value),Me(a.route)}else{var s=function(t){for(var e=t.parent;e;e=e.parent){var n=e.routeConfig;if(n&&n._loadedConfig)return n._loadedConfig;if(n&&n.component)return null}return null}(r.snapshot),u=s?s.module.componentFactoryResolver:null;o.attachRef=null,o.route=r,o.resolver=u,o.outlet&&o.outlet.activateWith(r,u),this.activateChildRoutes(t,null,o.children)}else this.activateChildRoutes(t,null,n)},t}();function Me(t){Se(t.value),t.children.forEach(Me)}function Le(t){return"function"==typeof t}function Fe(t){return t instanceof Wt}var Ue=function(){return function(t){this.segmentGroup=t||null}}(),Ve=function(){return function(t){this.urlTree=t}}();function qe(t){return new c.a((function(e){return e.error(new Ue(t))}))}function Be(t){return new c.a((function(e){return e.error(new Ve(t))}))}function We(t){return new c.a((function(e){return e.error(new Error("Only absolute redirects can have named outlets. redirectTo: '"+t+"'"))}))}var ze=function(){function t(t,e,n,r,i){this.configLoader=e,this.urlSerializer=n,this.urlTree=r,this.config=i,this.allowRedirects=!0,this.ngModule=t.get(o.x)}return t.prototype.apply=function(){var t=this;return this.expandSegmentGroup(this.ngModule,this.config,this.urlTree.root,It).pipe(Object(E.a)((function(e){return t.createUrlTree(e,t.urlTree.queryParams,t.urlTree.fragment)}))).pipe(W((function(e){if(e instanceof Ve)return t.allowRedirects=!1,t.match(e.urlTree);if(e instanceof Ue)throw t.noMatchError(e);throw e})))},t.prototype.match=function(t){var e=this;return this.expandSegmentGroup(this.ngModule,this.config,t.root,It).pipe(Object(E.a)((function(n){return e.createUrlTree(n,t.queryParams,t.fragment)}
1))).pipe(W((function(t){if(t instanceof Ue)throw e.noMatchError(t);throw t})))},t.prototype.noMatchError=function(t){return new Error("Cannot match any routes. URL Segment: '"+t.segmentGroup+"'")},t.prototype.createUrlTree=function(t,e,n){var r,i=t.segments.length>0?new zt([],((r={})[It]=t,r)):t;return new Wt(i,e,n)},t.prototype.expandSegmentGroup=function(t,e,n,r){return 0===n.segments.length&&n.hasChildren()?this.expandChildren(t,e,n).pipe(Object(E.a)((function(t){return new zt([],t)}))):this.expandSegment(t,n,e,n.segments,r,!0)},t.prototype.expandChildren=function(t,e,n){var r=this;return function(n,i){if(0===Object.keys(n).length)return Object(a.a)({});var o=[],s=[],u={};return Vt(n,(function(n,i){var a,c,l=(a=i,c=n,r.expandSegmentGroup(t,e,c,a)).pipe(Object(E.a)((function(t){return u[i]=t})));i===It?o.push(l):s.push(l)})),a.a.apply(null,o.concat(s)).pipe(k(),q(),Object(E.a)((function(){return u})))}(n.children)},t.prototype.expandSegment=function(t,e,n,i,o,s){var u=this;return a.a.apply(void 0,Object(r.i)(n)).pipe(Object(E.a)((function(r){return u.expandSegmentAgainstRoute(t,e,n,r,i,o,s).pipe(W((function(t){if(t instanceof Ue)return Object(a.a)(null);throw t})))})),k(),Q((function(t){return!!t})),W((function(t,n){if(t instanceof h||"EmptyError"===t.name){if(u.noLeftoversInUrl(e,i,o))return Object(a.a)(new zt([],{}));throw new Ue(e)}throw t})))},t.prototype.noLeftoversInUrl=function(t,e,n){return 0===e.length&&!t.children[n]},t.prototype.expandSegmentAgainstRoute=function(t,e,n,r,i,o,a){return Ge(r)!==o?qe(e):void 0===r.redirectTo?this.matchSegmentAgainstRoute(t,e,r,i):a&&this.allowRedirects?this.expandSegmentAgainstRouteUsingRedirect(t,e,n,r,i,o):qe(e)},t.prototype.expandSegmentAgainstRouteUsingRedirect=function(t,e,n,r,i,o){return"**"===r.path?this.expandWildCardWithParamsAgainstRouteUsingRedirect(t,n,r,o):this.expandRegularSegmentAgainstRouteUsingRedirect(t,e,n,r,i,o)},t.prototype.expandWildCardWithParamsAgainstRouteUsingRedirect=function(t,e,n,r){var i=this,o=this.applyRedirectCommands([],n.redirectTo,{});return n.redirectTo.startsWith("/")?Be(o):this.lineralizeSegments(n,o).pipe(Object(Y.a)((function(n){var o=new zt(n,{});return i.expandSegment(t,o,e,n,r,!1)})))},t.prototype.expandRegularSegmentAgainstRouteUsingRedirect=function(t,e,n,r,i,o){var a=this,s=He(e,r,i),u=s.consumedSegments,c=s.lastChild,l=s.positionalParamSegments;if(!s.matched)return qe(e);var h=this.applyRedirectCommands(u,r.redirectTo,l);return r.redirectTo.startsWith("/")?Be(h):this.lineralizeSegments(r,h).pipe(Object(Y.a)((function(r){return a.expandSegment(t,e,n,r.concat(i.slice(c)),o,!1)})))},t.prototype.matchSegmentAgainstRoute=function(t,e,n,i){var o=this;if("**"===n.path)return n.loadChildren?this.configLoader.load(t.injector,n).pipe(Object(E.a)((function(t){return n._loadedConfig=t,new zt(i,{})}))):Object(a.a)(new zt(i,{}));var s=He(e,n,i),u=s.consumedSegments,c=s.lastChild;if(!s.matched)return qe(e);var l=i.slice(c);return this.getChildConfig(t,n,i).pipe(Object(Y.a)((function(t){var n=t.module,i=t.routes,s=function(t,e,n,i){return n.length>0&&function(t,e,n){return n.some((function(n){return Ke(t,e,n)&&Ge(n)!==It}))}(t,n,i)?{segmentGroup:$e(new zt(e,function(t,e){var n,i,o={};o[It]=e;try{for(var a=Object(r.k)(t),s=a.next();!s.done;s=a.next()){var u=s.value;""===u.path&&Ge(u)!==It&&(o[Ge(u)]=new zt([],{}))}}catch(c){n={error:c}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}return o}(i,new zt(n,t.children)))),slicedSegments:[]}:0===n.length&&function(t,e,n){return n.some((function(n){return Ke(t,e,n)}))}(t,n,i)?{segmentGroup:$e(new zt(t.segments,function(t,e,n,i){var o,a,s={};try{for(var u=Object(r.k)(n),c=u.next();!c.done;c=u.next()){var l=c.value;Ke(t,e,l)&&!i[Ge(l)]&&(s[Ge(l)]=new zt([],{}))}}catch(h){o={error:h}}finally{try{c&&!c.done&&(a=u.return)&&a.call(u)}finally{if(o)throw o.error}}return Object(r.a)({},i,s)}(t,n,i,t.children))),slicedSegments:n}:{segmentGroup:t,slicedSegments:n}}(e,u,l,i),c=s.segmentGroup,h=s.slicedSegments;return 0===h.length&&c.hasChildren()?o.expandChildren(n,i,c).pipe(Object(E.a)((function(t){return new zt(u,t)}))):0===i.length&&0===h.length?Object(a.a)(new zt(u,{})):o.expandSegment(n,c,i,h,It,!0).pipe(Object(E.a)((function(t){return new zt(u.concat(t.segments),t.children)})))})))},t.prototype.getChildConfig=function(t,e,n){var r=this;return e.children?Object(a.a)(new Dt(e.children,t)):e.loadChildren?void 0!==e._loadedConfig?Object(a.a)(e._loadedConfig):function(t,e,n){var r,i=e.canLoad;return i&&0!==i.length?Object(s.a)(i).pipe(Object(E.a)((function(r){var i,o=t.get(r);if(function(t){return t&&Le(t.canLoad)}(o))i=o.canLoad(e,n);else{if(!Le(o))throw new Error("Invalid CanLoad guard");i=o(e,n)}return qt(i)}))).pipe(k(),(r=function(t){return!0===t},function(t){return t.lift(new X(r,void 0,t))})):Object(a.a)(!0)}(t.injector,e,n).pipe(Object(Y.a)((function(n){return n?r.configLoader.load(t.injector,e).pipe(Object(E.a)((function(t){return e._loadedConfig=t,t}))):function(t){return new c.a((function(e){return e.error(At("Cannot load children because the guard of the route \"path: '"+t.path+"'\" returned false"))}))}(e)}))):Object(a.a)(new Dt([],t))},t.prototype.lineralizeSegments=function(t,e){for(var n=[],r=e.root;;){if(n=n.concat(r.segments),0===r.numberOfChildren)return Object(a.a)(n);if(r.numberOfChildren>1||!r.children[It])return We(t.redirectTo);r=r.children[It]}},t.prototype.applyRedirectCommands=function(t,e,n){return this.applyRedirectCreatreUrlTree(e,this.urlSerializer.parse(e),t,n)},t.prototype.applyRedirectCreatreUrlTree=function(t,e,n,r){var i=this.createSegmentGroup(t,e.root,n,r);return new Wt(i,this.createQueryParams(e.queryParams,this.urlTree.queryParams),e.fragment)},t.prototype.createQueryParams=function(t,e){var n={};return Vt(t,(function(t,r){if("string"==typeof t&&t.startsWith(":")){var i=t.substring(1);n[r]=e[i]}else n[r]=t})),n},t.prototype.createSegmentGroup=function(t,e,n,r){var i=this,o=this.createSegments(t,e.segments,n,r),a={};return Vt(e.children,(function(e,o){a[o]=i.createSegmentGroup(t,e,n,r)})),new zt(o,a)},t.prototype.createSegments=function(t,e,n,r){var i=this;return e.map((function(e){return e.path.startsWith(":")?i.findPosParam(t,e,r):i.findOrReturn(e,n)}))},t.prototype.findPosParam=function(t,e,n){var r=n[e.path.substring(1)];if(!r)throw new Error("Cannot redirect to '"+t+"'. Cannot find '"+e.path+"'.");return r},t.prototype.findOrReturn=function(t,e){var n,i,o=0;try{for(var a=Object(r.k)(e),s=a.next();!s.done;s=a.next()){var u=s.value;if(u.path===t.path)return e.splice(o),u;o++}}catch(c){n={error:c}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}return t},t}();function He(t,e,n){if(""===e.path)return"full"===e.pathMatch&&(t.hasChildren()||n.length>0)?{matched:!1,consumedSegments:[],lastChild:0,positionalParamSegments:{}}:{matched:!0,consumedSegments:[],lastChild:0,positionalParamSegments:{}};var r=(e.matcher||Pt)(n,t,e);return r?{matched:!0,consumedSegments:r.consumed,lastChild:r.consumed.length,positionalParamSegments:r.posParams}:{matched:!1,consumedSegments:[],lastChild:0,positionalParamSegments:{}}}function $e(t){if(1===t.numberOfChildren&&t.children[It]){var e=t.children[It];return new zt(t.segments.concat(e.segments),e.children)}return t}function Ke(t,e,n){return(!(t.hasChildren()||e.length>0)||"full"!==n.pathMatch)&&""===n.path&&void 0!==n.redirectTo}function Ge(t){return t.outlet||It}var Qe=function(){return function(t){this.path=t,this.route=this.path[this.path.length-1]}}(),Ye=function(){return function(t,e){this.component=t,this.route=e}}();function Xe(t,e,n){var r=function(t){if(!t)return null;for(var e=t.parent;e;e=e.parent){var n=e.routeConfig;if(n&&n._loadedConfig)return n._loadedConfig}return null}(e);return(r?r.module.injector:n).get(t)}function Je(t,e,n,r,i){void 0===i&&(i={canDeactivateChecks:[],canActivateChecks:[]});var o=de(e);
1return t.children.forEach((function(t){!function(t,e,n,r,i){void 0===i&&(i={canDeactivateChecks:[],canActivateChecks:[]});var o=t.value,a=e?e.value:null,s=n?n.getContext(t.value.outlet):null;if(a&&o.routeConfig===a.routeConfig){var u=function(t,e,n){if("function"==typeof n)return n(t,e);switch(n){case"pathParamsChange":return!$t(t.url,e.url);case"pathParamsOrQueryParamsChange":return!$t(t.url,e.url)||!Lt(t.queryParams,e.queryParams);case"always":return!0;case"paramsOrQueryParamsChange":return!Ce(t,e)||!Lt(t.queryParams,e.queryParams);case"paramsChange":default:return!Ce(t,e)}}(a,o,o.routeConfig.runGuardsAndResolvers);u?i.canActivateChecks.push(new Qe(r)):(o.data=a.data,o._resolvedData=a._resolvedData),Je(t,e,o.component?s?s.children:null:n,r,i),u&&i.canDeactivateChecks.push(new Ye(s&&s.outlet&&s.outlet.component||null,a))}else a&&Ze(e,s,i),i.canActivateChecks.push(new Qe(r)),Je(t,null,o.component?s?s.children:null:n,r,i)}(t,o[t.value.outlet],n,r.concat([t.value]),i),delete o[t.value.outlet]})),Vt(o,(function(t,e){return Ze(t,n.getContext(e),i)})),i}function Ze(t,e,n){var r=de(t),i=t.value;Vt(r,(function(t,r){Ze(t,i.component?e?e.children.getContext(r):null:e,n)})),n.canDeactivateChecks.push(new Ye(i.component&&e&&e.outlet&&e.outlet.isActivated?e.outlet.component:null,i))}var tn=Symbol("INITIAL_VALUE");function en(){return Object(Z.a)((function(t){return g.apply(void 0,Object(r.i)(t.map((function(t){return t.pipe($(1),function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){var n=t[t.length-1];Object(f.a)(n)?t.pop():n=null;var r=t.length;return et(1!==r||n?r>0?Object(y.a)(t,n):Object(_.b)(n):Object(tt.a)(t[0]),e)}}(tn))})))).pipe(Object(nt.a)((function(t,e){var n=!1;return e.reduce((function(t,r,i){if(t!==tn)return t;if(r===tn&&(n=!0),!n){if(!1===r)return r;if(i===e.length-1||Fe(r))return r}return t}),t)}),tn),Object(I.a)((function(t){return t!==tn})),Object(E.a)((function(t){return Fe(t)?t:!0===t})),$(1))}))}function nn(t,e){return null!==t&&e&&e(new Ct(t)),Object(a.a)(!0)}function rn(t,e){return null!==t&&e&&e(new _t(t)),Object(a.a)(!0)}function on(t,e,n){var r=e.routeConfig?e.routeConfig.canActivate:null;if(!r||0===r.length)return Object(a.a)(!0);var i=r.map((function(r){return S((function(){var i,o=Xe(r,e,n);if(function(t){return t&&Le(t.canActivate)}(o))i=qt(o.canActivate(e,t));else{if(!Le(o))throw new Error("Invalid CanActivate guard");i=qt(o(e,t))}return i.pipe(Q())}))}));return Object(a.a)(i).pipe(en())}function an(t,e,n){var r=e[e.length-1],i=e.slice(0,e.length-1).reverse().map((function(t){return function(t){var e=t.routeConfig?t.routeConfig.canActivateChild:null;return e&&0!==e.length?{node:t,guards:e}:null}(t)})).filter((function(t){return null!==t})).map((function(e){return S((function(){var i=e.guards.map((function(i){var o,a=Xe(i,e.node,n);if(function(t){return t&&Le(t.canActivateChild)}(a))o=qt(a.canActivateChild(r,t));else{if(!Le(a))throw new Error("Invalid CanActivateChild guard");o=qt(a(r,t))}return o.pipe(Q())}));return Object(a.a)(i).pipe(en())}))}));return Object(a.a)(i).pipe(en())}var sn=function(){return function(){}}(),un=function(){function t(t,e,n,r,i,o){this.rootComponentType=t,this.config=e,this.urlTree=n,this.url=r,this.paramsInheritanceStrategy=i,this.relativeLinkResolution=o}return t.prototype.recognize=function(){try{var t=hn(this.urlTree.root,[],[],this.config,this.relativeLinkResolution).segmentGroup,e=this.processSegmentGroup(this.config,t,It),n=new ge([],Object.freeze({}),Object.freeze(Object(r.a)({},this.urlTree.queryParams)),this.urlTree.fragment,{},It,this.rootComponentType,null,this.urlTree.root,-1,{}),i=new fe(n,e),o=new be(this.url,i);return this.inheritParamsAndData(o._root),Object(a.a)(o)}catch(s){return new c.a((function(t){return t.error(s)}))}},t.prototype.inheritParamsAndData=function(t){var e=this,n=t.value,r=ve(n,this.paramsInheritanceStrategy);n.params=Object.freeze(r.params),n.data=Object.freeze(r.data),t.children.forEach((function(t){return e.inheritParamsAndData(t)}))},t.prototype.processSegmentGroup=function(t,e,n){return 0===e.segments.length&&e.hasChildren()?this.processChildren(t,e):this.processSegment(t,e,e.segments,n)},t.prototype.processChildren=function(t,e){var n,r=this,i=Kt(e,(function(e,n){return r.processSegmentGroup(t,e,n)}
1));return n={},i.forEach((function(t){var e=n[t.value.outlet];if(e){var r=e.url.map((function(t){return t.toString()})).join("/"),i=t.value.url.map((function(t){return t.toString()})).join("/");throw new Error("Two segments cannot have the same outlet name: '"+r+"' and '"+i+"'.")}n[t.value.outlet]=t.value})),function(t){t.sort((function(t,e){return t.value.outlet===It?-1:e.value.outlet===It?1:t.value.outlet.localeCompare(e.value.outlet)}))}(i),i},t.prototype.processSegment=function(t,e,n,i){var o,a;try{for(var s=Object(r.k)(t),u=s.next();!u.done;u=s.next()){var c=u.value;try{return this.processSegmentAgainstRoute(c,e,n,i)}catch(l){if(!(l instanceof sn))throw l}}}catch(h){o={error:h}}finally{try{u&&!u.done&&(a=s.return)&&a.call(s)}finally{if(o)throw o.error}}if(this.noLeftoversInUrl(e,n,i))return[];throw new sn},t.prototype.noLeftoversInUrl=function(t,e,n){return 0===e.length&&!t.children[n]},t.prototype.processSegmentAgainstRoute=function(t,e,n,i){if(t.redirectTo)throw new sn;if((t.outlet||It)!==i)throw new sn;var o,a=[],s=[];if("**"===t.path){var u=n.length>0?Ut(n).parameters:{};o=new ge(n,u,Object.freeze(Object(r.a)({},this.urlTree.queryParams)),this.urlTree.fragment,pn(t),i,t.component,t,cn(e),ln(e)+n.length,mn(t))}else{var c=function(t,e,n){if(""===e.path){if("full"===e.pathMatch&&(t.hasChildren()||n.length>0))throw new sn;return{consumedSegments:[],lastChild:0,parameters:{}}}var i=(e.matcher||Pt)(n,t,e);if(!i)throw new sn;var o={};Vt(i.posParams,(function(t,e){o[e]=t.path}));var a=i.consumed.length>0?Object(r.a)({},o,i.consumed[i.consumed.length-1].parameters):o;return{consumedSegments:i.consumed,lastChild:i.consumed.length,parameters:a}}(e,t,n);a=c.consumedSegments,s=n.slice(c.lastChild),o=new ge(a,c.parameters,Object.freeze(Object(r.a)({},this.urlTree.queryParams)),this.urlTree.fragment,pn(t),i,t.component,t,cn(e),ln(e)+a.length,mn(t))}var l=function(t){return t.children?t.children:t.loadChildren?t._loadedConfig.routes:[]}(t),h=hn(e,a,s,l,this.relativeLinkResolution),f=h.segmentGroup,d=h.slicedSegments;if(0===d.length&&f.hasChildren()){var p=this.processChildren(l,f);return[new fe(o,p)]}if(0===l.length&&0===d.length)return[new fe(o,[])];var m=this.processSegment(l,f,d,It);return[new fe(o,m)]},t}();function cn(t){for(var e=t;e._sourceSegment;)e=e._sourceSegment;return e}function ln(t){for(var e=t,n=e._segmentIndexShift?e._segmentIndexShift:0;e._sourceSegment;)n+=(e=e._sourceSegment)._segmentIndexShift?e._segmentIndexShift:0;return n-1}function hn(t,e,n,i,o){if(n.length>0&&function(t,e,n){return n.some((function(n){return fn(t,e,n)&&dn(n)!==It}))}(t,n,i)){var a=new zt(e,function(t,e,n,i){var o,a,s={};s[It]=i,i._sourceSegment=t,i._segmentIndexShift=e.length;try{for(var u=Object(r.k)(n),c=u.next();!c.done;c=u.next()){var l=c.value;if(""===l.path&&dn(l)!==It){var h=new zt([],{});h._sourceSegment=t,h._segmentIndexShift=e.length,s[dn(l)]=h}}}catch(f){o={error:f}}finally{try{c&&!c.done&&(a=u.return)&&a.call(u)}finally{if(o)throw o.error}}return s}(t,e,i,new zt(n,t.children)));return a._sourceSegment=t,a._segmentIndexShift=e.length,{segmentGroup:a,slicedSegments:[]}}if(0===n.length&&function(t,e,n){return n.some((function(n){return fn(t,e,n)}))}(t,n,i)){var s=new zt(t.segments,function(t,e,n,i,o,a){var s,u,c={};try{for(var l=Object(r.k)(i),h=l.next();!h.done;h=l.next()){var f=h.value;if(fn(t,n,f)&&!o[dn(f)]){var d=new zt([],{});d._sourceSegment=t,d._segmentIndexShift="legacy"===a?t.segments.length:e.length,c[dn(f)]=d}}}catch(p){s={error:p}}finally{try{h&&!h.done&&(u=l.return)&&u.call(l)}finally{if(s)throw s.error}}return Object(r.a)({},o,c)}(t,e,n,i,t.children,o));return s._sourceSegment=t,s._segmentIndexShift=e.length,{segmentGroup:s,slicedSegments:n}}var u=new zt(t.segments,t.children);return u._sourceSegment=t,u._segmentIndexShift=e.length,{segmentGroup:u,slicedSegments:n}}function fn(t,e,n){return(!(t.hasChildren()||e.length>0)||"full"!==n.pathMatch)&&""===n.path&&void 0===n.redirectTo}function dn(t){return t.outlet||It}function pn(t){return t.data||{}}function mn(t){return t.resolve||{}}function yn(t,e,n,r){var i=Xe(t,e,r);return qt(i.resolve?i.resolve(e,n):i(e,n))}function vn(t){return function(e){return e.pipe(Object(Z.a)((function(e){var n=t(e);return n?Object(s.a)(n).pipe(Object(E.a)((function(){return e}))):Object(s.a)([e])})))}}var gn=function(){return function(){}}(),bn=function(){function t(){}return t.prototype.shouldDetach=function(t){return!1},t.prototype.store=function(t,e){},t.prototype.shouldAttach=function(t){return!1},t.prototype.retrieve=function(t){return null},t.prototype.shouldReuseRoute=function(t,e){return t.routeConfig===e.routeConfig},t}(),wn=new o.p("ROUTES"),_n=function(){function t(t,e,n,r){this.loader=t,this.compiler=e,this.onLoadStartListener=n,this.onLoadEndListener=r}return t.prototype.load=function(t,e){var n=this;return this.onLoadStartListener&&this.onLoadStartListener(e),this.loadModuleFactory(e.loadChildren).pipe(Object(E.a)((function(r){n.onLoadEndListener&&n.onLoadEndListener(e);var i=r.create(t);return new Dt(Ft(i.injector.get(wn)).map(Mt),i)})))},t.prototype.loadModuleFactory=function(t){var e=this;return"string"==typeof t?Object(s.a)(this.loader.load(t)):qt(t()).pipe(Object(Y.a)((function(t){return t instanceof o.v?Ob
1ject(a.a)(t):Object(s.a)(e.compiler.compileModuleAsync(t))})))},t}(),Sn=function(){return function(){}}(),Cn=function(){function t(){}return t.prototype.shouldProcessUrl=function(t){return!0},t.prototype.extract=function(t){return t},t.prototype.merge=function(t,e){return t},t}();function En(t){throw t}function Tn(t,e,n){return e.parse("/")}function kn(t,e){return Object(a.a)(null)}var In=function(){function t(t,e,n,r,i,a,s,c){var l=this;this.rootComponentType=t,this.urlSerializer=e,this.rootContexts=n,this.location=r,this.config=c,this.lastSuccessfulNavigation=null,this.currentNavigation=null,this.navigationId=0,this.isNgZoneEnabled=!1,this.events=new C.a,this.errorHandler=En,this.malformedUriErrorHandler=Tn,this.navigated=!1,this.lastSuccessfulId=-1,this.hooks={beforePreactivation:kn,afterPreactivation:kn},this.urlHandlingStrategy=new Cn,this.routeReuseStrategy=new bn,this.onSameUrlNavigation="ignore",this.paramsInheritanceStrategy="emptyOnly",this.urlUpdateStrategy="deferred",this.relativeLinkResolution="legacy",this.ngModule=i.get(o.x),this.console=i.get(o.cb);var h=i.get(o.z);this.isNgZoneEnabled=h instanceof o.z,this.resetConfig(c),this.currentUrlTree=new Wt(new zt([],{}),{},null),this.rawUrlTree=this.currentUrlTree,this.browserUrlTree=this.currentUrlTree,this.configLoader=new _n(a,s,(function(t){return l.triggerEvent(new bt(t))}),(function(t){return l.triggerEvent(new wt(t))})),this.routerState=me(this.currentUrlTree,this.rootComponentType),this.transitions=new u.a({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()}return t.prototype.setupNavigations=function(t){var e=this,n=this.events;return t.pipe(Object(I.a)((function(t){return 0!==t.id})),Object(E.a)((function(t){return Object(r.a)({},t,{extractedUrl:e.urlHandlingStrategy.extract(t.rawUrl)})})),Object(Z.a)((function(t){var i,o,c,l,h=!1,f=!1;return Object(a.a)(t).pipe(Object(N.a)((function(t){e.currentNavigation={id:t.id,initialUrl:t.currentRawUrl,extractedUrl:t.extractedUrl,trigger:t.source,extras:t.extras,previousNavigation:e.lastSuccessfulNavigation?Object(r.a)({},e.lastSuccessfulNavigation,{previousNavigation:null}):null}})),Object(Z.a)((function(t){var i,o,s,u,c=!e.navigated||t.extractedUrl.toString()!==e.browserUrlTree.toString();if(("reload"===e.onSameUrlNavigation||c)&&e.urlHandlingStrategy.shouldProcessUrl(t.rawUrl))return Object(a.a)(t).pipe(Object(Z.a)((function(t){var r=e.transitions.getValue();return n.next(new lt(t.id,e.serializeUrl(t.extractedUrl),t.source,t.restoredState)),r!==e.transitions.getValue()?_.a:[t]})),Object(Z.a)((function(t){return Promise.resolve(t)})),(i=e.ngModule.injector,o=e.configLoader,s=e.urlSerializer,u=e.config,function(t){return t.pipe(Object(Z.a)((function(t){return function(t,e,n,r,i){return new ze(t,e,n,r,i).apply()}(i,o,s,t.extractedUrl,u).pipe(Object(E.a)((function(e){return Object(r.a)({},t,{urlAfterRedirects:e})})))})))}),Object(N.a)((function(t){e.currentNavigation=Object(r.a)({},e.currentNavigation,{finalUrl:t.urlAfterRedirects})})),function(t,n,i,o,a){return function(i){return i.pipe(Object(Y.a)((function(i){return function(t,e,n,r,i,o){return void 0===i&&(i="emptyOnly"),void 0===o&&(o="legacy"),new un(t,e,n,r,i,o).recognize()}(t,n,i.urlAfterRedirects,(s=i.urlAfterRedirects,e.serializeUrl(s)),o,a).pipe(Object(E.a)((function(t){return Object(r.a)({},i,{targetSnapshot:t})})));var s})))}}(e.rootComponentType,e.config,0,e.paramsInheritanceStrategy,e.relativeLinkResolution),Object(N.a)((function(t){"eager"===e.urlUpdateStrategy&&(t.extras.skipLocationChange||e.setBrowserUrl(t.urlAfterRedirects,!!t.extras.replaceUrl,t.id),e.browserUrlTree=t.urlAfterRedirects)})),Object(N.a)((function(t){var r=new pt(t.id,e.serializeUrl(t.extractedUrl),e.serializeUrl(t.urlAfterRedirects),t.targetSnapshot);n.next(r)})));if(c&&e.rawUrlTree&&e.urlHandlingStrategy.shouldProcessUrl(e.rawUrlTree)){var l=t.extractedUrl,h=t.source,f=t.restoredState,d=t.extras,p=new lt(t.id,e.serializeUrl(l),h,f);n.next(p);var m=me(l,e.rootComponentType).snapshot;return Object(a.a)(Object(r.a)({},t,{targetSnapshot:m,urlAfterRedirects:l,extras:Object(r.a)({},d,{skipLocationChange:!1,replaceUrl:!1})}
1))}return e.rawUrlTree=t.rawUrl,t.resolve(null),_.a})),vn((function(t){var n=t.extras;return e.hooks.beforePreactivation(t.targetSnapshot,{navigationId:t.id,appliedUrlTree:t.extractedUrl,rawUrlTree:t.rawUrl,skipLocationChange:!!n.skipLocationChange,replaceUrl:!!n.replaceUrl})})),Object(N.a)((function(t){var n=new mt(t.id,e.serializeUrl(t.extractedUrl),e.serializeUrl(t.urlAfterRedirects),t.targetSnapshot);e.triggerEvent(n)})),Object(E.a)((function(t){return Object(r.a)({},t,{guards:(n=t.targetSnapshot,i=t.currentSnapshot,o=e.rootContexts,a=n._root,Je(a,i?i._root:null,o,[a.value]))});var n,i,o,a})),function(t,e){return function(n){return n.pipe(Object(Y.a)((function(n){var i=n.targetSnapshot,o=n.currentSnapshot,u=n.guards,c=u.canActivateChecks,l=u.canDeactivateChecks;return 0===l.length&&0===c.length?Object(a.a)(Object(r.a)({},n,{guardsResult:!0})):function(t,e,n,r){return Object(s.a)(t).pipe(Object(Y.a)((function(t){return function(t,e,n,r,i){var o=e&&e.routeConfig?e.routeConfig.canDeactivate:null;if(!o||0===o.length)return Object(a.a)(!0);var s=o.map((function(o){var a,s=Xe(o,e,i);if(function(t){return t&&Le(t.canDeactivate)}(s))a=qt(s.canDeactivate(t,e,n,r));else{if(!Le(s))throw new Error("Invalid CanDeactivate guard");a=qt(s(t,e,n,r))}return a.pipe(Q())}));return Object(a.a)(s).pipe(en())}(t.component,t.route,n,e,r)})),Q((function(t){return!0!==t}),!0))}(l,i,o,t).pipe(Object(Y.a)((function(n){return n&&"boolean"==typeof n?function(t,e,n,r){return Object(s.a)(e).pipe(Object(rt.a)((function(e){return Object(s.a)([rn(e.route.parent,r),nn(e.route,r),an(t,e.path,n),on(t,e.route,n)]).pipe(k(),Q((function(t){return!0!==t}),!0))})),Q((function(t){return!0!==t}),!0))}(i,c,t,e):Object(a.a)(n)})),Object(E.a)((function(t){return Object(r.a)({},n,{guardsResult:t})})))})))}}(e.ngModule.injector,(function(t){return e.triggerEvent(t)})),Object(N.a)((function(t){if(Fe(t.guardsResult)){var n=At('Redirecting to "'+e.serializeUrl(t.guardsResult)+'"');throw n.url=t.guardsResult,n}})),Object(N.a)((function(t){var n=new yt(t.id,e.serializeUrl(t.extractedUrl),e.serializeUrl(t.urlAfterRedirects),t.targetSnapshot,!!t.guardsResult);e.triggerEvent(n)})),Object(I.a)((function(t){if(!t.guardsResult){e.resetUrlToCurrentUrlTree();var r=new ft(t.id,e.serializeUrl(t.extractedUrl),"");return n.next(r),t.resolve(!1),!1}return!0})),vn((function(t){if(t.guards.canActivateChecks.length)return Object(a.a)(t).pipe(Object(N.a)((function(t){var n=new vt(t.id,e.serializeUrl(t.extractedUrl),e.serializeUrl(t.urlAfterRedirects),t.targetSnapshot);e.triggerEvent(n)})),(n=e.paramsInheritanceStrategy,i=e.ngModule.injector,function(t){return t.pipe(Object(Y.a)((function(t){var e=t.targetSnapshot,o=t.guards.canActivateChecks;return o.length?Object(s.a)(o).pipe(Object(rt.a)((function(t){return function(t,e,n,i){return function(t,e,n,r){var i=Object.keys(t);if(0===i.length)return Object(a.a)({});if(1===i.length){var o=i[0];return yn(t[o],e,n,r).pipe(Object(E.a)((function(t){var e;return(e={})[o]=t,e})))}var u={};return Object(s.a)(i).pipe(Object(Y.a)((function(i){return yn(t[i],e,n,r).pipe(Object(E.a)((function(t){return u[i]=t,t})))}))).pipe(q(),Object(E.a)((function(){return u})))}(t._resolve,t,e,i).pipe(Object(E.a)((function(e){return t._resolvedData=e,t.data=Object(r.a)({},t.data,ve(t,n).resolve),null})))}(t.route,e,n,i)})),function(t,e){return arguments.length>=2?function(n){return Object(it.a)(Object(nt.a)(t,e),P(1),L(e))(n)}:function(e){return Object(it.a)(Object(nt.a)((function(e,n,r){return t(e,n,r+1)})),P(1))(e)}}((function(t,e){return t})),Object(E.a)((function(e){return t}))):Object(a.a)(t)})))}),Object(N.a)((function(t){var n=new gt(t.id,e.serializeUrl(t.extractedUrl),e.serializeUrl(t.urlAfterRedirects),t.targetSnapshot);e.triggerEvent(n)})));var n,i})),vn((function(t){var n=t.extras;return e.hooks.afterPreactivation(t.targetSnapshot,{navigationId:t.id,appliedUrlTree:t.extractedUrl,rawUrlTree:t.rawUrl,skipLocationChange:!!n.skipLocationChange,replaceUrl:!!n.replaceUrl})})),Object(E.a)((function(t){var n,i,o,a=(o=function t(e,n,i){if(i&&e.shouldReuseRoute(n.value,i.value.snapshot)){(l=i.value)._futureSnapshot=n.value;var o=function(e,n,i){return n.children.map((function(n){var o,a;try{for(var s=Object(r.k)(i.children),u=s.next();!u.done;u=s.next()){var c=u.value;if(e.shouldReuseRoute(c.value.snapshot,n.value))return t(e,n,c)}}catch(l){o={error:l}}finally{try{u&&!u.done&&(a=s.return)&&a.call(s)}finally{if(o)throw o.error}}return t(e,n)}))}(e,n,i);return new fe(l,o)}var a=e.retrieve(n.value);if(a){var s=a.route;return function t(e,n){if(e.value.routeConfig!==n.value.routeConfig)throw new Error("Cannot reattach ActivatedRouteSnapshot created from a different route");
1if(e.children.length!==n.children.length)throw new Error("Cannot reattach ActivatedRouteSnapshot with a different number of children");n.value._futureSnapshot=e.value;for(var r=0;r<e.children.length;++r)t(e.children[r],n.children[r])}(n,s),s}var c,l=new ye(new u.a((c=n.value).url),new u.a(c.params),new u.a(c.queryParams),new u.a(c.fragment),new u.a(c.data),c.outlet,c.component,c);return o=n.children.map((function(n){return t(e,n)})),new fe(l,o)}(e.routeReuseStrategy,(n=t.targetSnapshot)._root,(i=t.currentRouterState)?i._root:void 0),new pe(o,n));return Object(r.a)({},t,{targetRouterState:a})})),Object(N.a)((function(t){e.currentUrlTree=t.urlAfterRedirects,e.rawUrlTree=e.urlHandlingStrategy.merge(e.currentUrlTree,t.rawUrl),e.routerState=t.targetRouterState,"deferred"===e.urlUpdateStrategy&&(t.extras.skipLocationChange||e.setBrowserUrl(e.rawUrlTree,!!t.extras.replaceUrl,t.id,t.extras.state),e.browserUrlTree=t.urlAfterRedirects)})),(o=e.rootContexts,c=e.routeReuseStrategy,l=function(t){return e.triggerEvent(t)},Object(E.a)((function(t){return new je(c,t.targetRouterState,t.currentRouterState,l).activate(o),t}))),Object(N.a)({next:function(){h=!0},complete:function(){h=!0}}),(i=function(){if(!h&&!f){e.resetUrlToCurrentUrlTree();var r=new ft(t.id,e.serializeUrl(t.extractedUrl),"Navigation ID "+t.id+" is not equal to the current navigation id "+e.navigationId);n.next(r),t.resolve(!1)}e.currentNavigation=null},function(t){return t.lift(new at(i))}),W((function(r){if(f=!0,(s=r)&&s.ngNavigationCancelingError){var i=Fe(r.url);i||(e.navigated=!0,e.resetStateAndUrl(t.currentRouterState,t.currentUrlTree,t.rawUrl));var o=new ft(t.id,e.serializeUrl(t.extractedUrl),r.message);n.next(o),t.resolve(!1),i&&e.navigateByUrl(r.url)}else{e.resetStateAndUrl(t.currentRouterState,t.currentUrlTree,t.rawUrl);var a=new dt(t.id,e.serializeUrl(t.extractedUrl),r);n.next(a);try{t.resolve(e.errorHandler(r))}catch(u){t.reject(u)}}var s;return _.a})))}
1)))},t.prototype.resetRootComponentType=function(t){this.rootComponentType=t,this.routerState.root.component=this.rootComponentType},t.prototype.getTransition=function(){return this.transitions.value},t.prototype.setTransition=function(t){this.transitions.next(Object(r.a)({},this.getTransition(),t))},t.prototype.initialNavigation=function(){this.setUpLocationChangeListener(),0===this.navigationId&&this.navigateByUrl(this.location.path(!0),{replaceUrl:!0})},t.prototype.setUpLocationChangeListener=function(){var t=this;this.locationSubscription||(this.locationSubscription=this.location.subscribe((function(e){var n=t.parseUrl(e.url),r="popstate"===e.type?"popstate":"hashchange",i=e.state&&e.state.navigationId?e.state:null;setTimeout((function(){t.scheduleNavigation(n,r,i,{replaceUrl:!0})}),0)})))},Object.defineProperty(t.prototype,"url",{get:function(){return this.serializeUrl(this.currentUrlTree)},enumerable:!0,configurable:!0}),t.prototype.getCurrentNavigation=function(){return this.currentNavigation},t.prototype.triggerEvent=function(t){this.events.next(t)},t.prototype.resetConfig=function(t){Rt(t),this.config=t.map(Mt),this.navigated=!1,this.lastSuccessfulId=-1},t.prototype.ngOnDestroy=function(){this.dispose()},t.prototype.dispose=function(){this.locationSubscription&&(this.locationSubscription.unsubscribe(),this.locationSubscription=null)},t.prototype.createUrlTree=function(t,e){void 0===e&&(e={});var n=e.relativeTo,i=e.queryParams,a=e.fragment,s=e.preserveQueryParams,u=e.queryParamsHandling,c=e.preserveFragment;Object(o.X)()&&s&&console&&console.warn&&console.warn("preserveQueryParams is deprecated, use queryParamsHandling instead.");var l=n||this.routerState.root,h=c?this.currentUrlTree.fragment:a,f=null;if(u)switch(u){case"merge":f=Object(r.a)({},this.currentUrlTree.queryParams,i);break;case"preserve":f=this.currentUrlTree.queryParams;break;default:f=i||null}else f=s?this.currentUrlTree.queryParams:i||null;return null!==f&&(f=this.removeEmptyProps(f)),function(t,e,n,i,o){if(0===n.length)return Te(e.root,e.root,e,i,o);var a=function(t){if("string"==typeof t[0]&&1===t.length&&"/"===t[0])return new ke(!0,0,t);var e=0,n=!1,i=t.reduce((function(t,i,o){if("object"==typeof i&&null!=i){if(i.outlets){var a={};return Vt(i.outlets,(function(t,e){a[e]="string"==typeof t?t.split("/"):t})),Object(r.i)(t,[{outlets:a}])}if(i.segmentPath)return Object(r.i)(t,[i.segmentPath])}return"string"!=typeof i?Object(r.i)(t,[i]):0===o?(i.split("/").forEach((function(r,i){0==i&&"."===r||(0==i&&""===r?n=!0:".."===r?e++:""!=r&&t.push(r))})),t):Object(r.i)(t,[i])}),[]);return new ke(n,e,i)}(n);if(a.toRoot())return Te(e.root,new zt([],{}),e,i,o);var s=function(t,e,n){if(t.isAbsolute)return new Ie(e.root,!0,0);if(-1===n.snapshot._lastPathIndex)return new Ie(n.snapshot._urlSegment,!0,0);var r=Ee(t.commands[0])?0:1;return function(t,e,n){for(var r=t,i=e,o=n;o>i;){if(o-=i,!(r=r.parent))throw new Error("Invalid number of '../'");i=r.segments.length}return new Ie(r,!1,i-o)}(n.snapshot._urlSegment,n.snapshot._lastPathIndex+r,t.numberOfDoubleDots)}(a,e,t),u=s.processChildren?Ae(s.segmentGroup,s.index,a.commands):xe(s.segmentGroup,s.index,a.commands);return Te(s.segmentGroup,u,e,i,o)}(l,this.currentUrlTree,t,f,h)},t.prototype.navigateByUrl=function(t,e){void 0===e&&(e={skipLocationChange:!1}),Object(o.X)()&&this.isNgZoneEnabled&&!o.z.isInAngularZone()&&this.console.warn("Navigation triggered outside Angular zone, did you forget to call 'ngZone.run()'?");var n=Fe(t)?t:this.parseUrl(t),r=this.urlHandlingStrategy.merge(n,this.rawUrlTree);return this.scheduleNavigation(r,"imperative",null,e)},t.prototype.navigate=function(t,e){return void 0===e&&(e={skipLocationChange:!1}),function(t){for(var e=0;e<t.length;e++){var n=t[e];if(null==n)throw new Error("The requested path contains "+n+" segment at index "+e)}}(t),this.navigateByUrl(this.createUrlTree(t,e),e)},t.prototype.serializeUrl=function(t){return this.urlSerializer.serialize(t)},t.prototype.parseUrl=function(t){var e;try{e=this.urlSerializer.parse(t)}catch(n){e=this.malformedUriErrorHandler(n,this.urlSerializer,t)}return e},t.prototype.isActive=function(t,e){if(Fe(t))return Bt(this.currentUrlTree,t,e);var n=this.parseUrl(t);return Bt(this.currentUrlTree,n,e)},t.prototype.removeEmptyProps=function(t){return Object.keys(t).reduce((function(e,n){var r=t[n];
1return null!=r&&(e[n]=r),e}),{})},t.prototype.processNavigations=function(){var t=this;this.navigations.subscribe((function(e){t.navigated=!0,t.lastSuccessfulId=e.id,t.events.next(new ht(e.id,t.serializeUrl(e.extractedUrl),t.serializeUrl(t.currentUrlTree))),t.lastSuccessfulNavigation=t.currentNavigation,t.currentNavigation=null,e.resolve(!0)}),(function(e){t.console.warn("Unhandled Navigation Error: ")}))},t.prototype.scheduleNavigation=function(t,e,n,r){var i=this.getTransition();if(i&&"imperative"!==e&&"imperative"===i.source&&i.rawUrl.toString()===t.toString())return Promise.resolve(!0);if(i&&"hashchange"==e&&"popstate"===i.source&&i.rawUrl.toString()===t.toString())return Promise.resolve(!0);if(i&&"popstate"==e&&"hashchange"===i.source&&i.rawUrl.toString()===t.toString())return Promise.resolve(!0);var o=null,a=null,s=new Promise((function(t,e){o=t,a=e})),u=++this.navigationId;return this.setTransition({id:u,source:e,restoredState:n,currentUrlTree:this.currentUrlTree,currentRawUrl:this.rawUrlTree,rawUrl:t,extras:r,resolve:o,reject:a,promise:s,currentSnapshot:this.routerState.snapshot,currentRouterState:this.routerState}),s.catch((function(t){return Promise.reject(t)}))},t.prototype.setBrowserUrl=function(t,e,n,i){var o=this.urlSerializer.serialize(t);i=i||{},this.location.isCurrentPathEqualTo(o)||e?this.location.replaceState(o,"",Object(r.a)({},i,{navigationId:n})):this.location.go(o,"",Object(r.a)({},i,{navigationId:n}))},t.prototype.resetStateAndUrl=function(t,e,n){this.routerState=t,this.currentUrlTree=e,this.rawUrlTree=this.urlHandlingStrategy.merge(this.currentUrlTree,n),this.resetUrlToCurrentUrlTree()},t.prototype.resetUrlToCurrentUrlTree=function(){this.location.replaceState(this.urlSerializer.serialize(this.rawUrlTree),"",{navigationId:this.lastSuccessfulId})},t}(),On=function(){function t(t,e,n,r,i){this.router=t,this.route=e,this.commands=[],null==n&&r.setAttribute(i.nativeElement,"tabindex","0")}return Object.defineProperty(t.prototype,"routerLink",{set:function(t){this.commands=null!=t?Array.isArray(t)?t:[t]:[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"preserveQueryParams",{set:function(t){Object(o.X)()&&console&&console.warn&&console.warn("preserveQueryParams is deprecated!, use queryParamsHandling instead."),this.preserve=t},enumerable:!0,configurable:!0}),t.prototype.onClick=function(){var t={skipLocationChange:An(this.skipLocationChange),replaceUrl:An(this.replaceUrl)};return this.router.navigateByUrl(this.urlTree,t),!0},Object.defineProperty(t.prototype,"urlTree",{get:function(){return this.router.createUrlTree(this.commands,{relativeTo:this.route,queryParams:this.queryParams,fragment:this.fragment,preserveQueryParams:An(this.preserve),queryParamsHandling:this.queryParamsHandling,preserveFragment:An(this.preserveFragment)})},enumerable:!0,configurable:!0}),t}(),xn=function(){function t(t,e,n){var r=this;this.router=t,this.route=e,this.locationStrategy=n,this.commands=[],this.subscription=t.events.subscribe((function(t){t instanceof ht&&r.updateTargetUrlAndHref()}))}return Object.defineProperty(t.prototype,"routerLink",{set:function(t){this.commands=null!=t?Array.isArray(t)?t:[t]:[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"preserveQueryParams",{set:function(t){Object(o.X)()&&console&&console.warn&&console.warn("preserveQueryParams is deprecated, use queryParamsHandling instead."),this.preserve=t},enumerable:!0,configurable:!0}),t.prototype.ngOnChanges=function(t){this.updateTargetUrlAndHref()},t.prototype.ngOnDestroy=function(){this.subscription.unsubscribe()},t.prototype.onClick=function(t,e,n,r){if(0!==t||e||n||r)return!0;if("string"==typeof this.target&&"_self"!=this.target)return!0;var i={skipLocationChange:An(this.skipLocationChange),replaceUrl:An(this.replaceUrl),state:this.state};return this.router.navigateByUrl(this.urlTree,i),!1},t.prototype.updateTargetUrlAndHref=function(){this.href=this.locationStrategy.prepareExternalUrl(this.router.serializeUrl(this.urlTree))},Object.defineProperty(t.prototype,"urlTree",{get:function(){return this.router.createUrlTree(this.commands,{relativeTo:this.route,queryParams:this.queryParams,fragment:this.fragment,preserveQueryParams:An(this.preserve),queryParamsHandling:this.queryParamsHandling,preserveFragment:An(this.preserveFragment)})},enumerable:!0,configurable:!0}),Object(r.c)([Object(o.n)("attr.target"),Object(o.r)(),Object(r.f)("design:type",String)],t.prototype,"target",void 0),t}();function An(t){return""===t||!!t}var Pn=function(){return function(){this.outlet=null,this.route=null,this.resolver=null,this.children=new Dn,this.attachRef=null}}(),Dn=function(){function t(){this.contexts=new Map}return t.prototype.onChildOutletCreated=function(t,e){var n=this.getOrCreateContext(t);n.outlet=e,this.contexts.set(t,n)},t.prototype.onChildOutletDestroyed=function(t){var e=this.getContext(t);e&&(e.outlet=null)},t.prototype.onOutletDeactivated=function(){var t=this.contexts;return this.contexts=new Map,t},t.prototype.onOutletReAttached=function(t){this.contexts=t},t.prototype.getOrCreateContext=function(t){var e=this.getContext(t);return e||(e=new Pn,this.contexts.set(t,e)),e},t.prototype.getContext=function(t){return this.contexts.get(t)||null},t}(),Rn=function(){function t(t,e,n,r,i){this.parentContexts=t,this.location=e,this.resolver=n,this.changeDetector=i,this.activated=null,this._activatedRoute=null,this.activateEvents=new o.m,this.deactivateEvents=new o.m,this.name=r||It,t.onChildOutletCreated(this.name,this)}return t.prototype.ngOnDestroy=function(){this.parentContexts.onChildOutletDestroyed(this.name)},t.prototype.ngOnInit=function(){if(!this.activated){var t=this.parentContexts.getContext(this.name);t&&t.route&&(t.attachRef?this.attach(t.attachRef,t.route):this.activateWith(t.route,t.resolver||null))}},Object.defineProperty(t.prototype,"isActivated",{get:function(){return!!this.activated},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"component",{get:function(){if(!this.activated)throw new Error("Outlet is not activated");return this.activated.instance},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"activatedRoute",{get:function(){if(!this.activated)throw new Error("Outlet is not activated");return this._activatedRoute},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"activatedRouteData",{get:function(){return this._activatedRoute?this._activatedRoute.snapshot.data:{}},enumerable:!0,configurable:!0}),t.prototype.detach=function(){if(!this.activated)throw new Error("Outlet is not activated");this.location.detach();var t=this.activated;return this.activated=null,this._activatedRoute=null,t},t.prototype.attach=function(t,e){this.activated=t,this._activatedRoute=e,this.location.insert(t.hostView)},t.prototype.deactivate=function(){if(this.activated){var t=this.component;this.activated.destroy(),this.activated=null,this._activatedRoute=null,this.deactivateEvents.emit(t)}},t.prototype.activateWith=function(t,e){if(this.isActivated)throw new Error("Cannot activate an already activated outlet");this._activatedRoute=t;var n=(e=e||this.resolver).resolveComponentFactory(t._futureSnapshot.routeConfig.component),r=this.parentContexts.getOrCreateContext(this.name).children,i=new Nn(t,r,this.location.injector);this.activated=this.location.createComponent(n,this.location.length,i),this.changeDetector.markForCheck(),this.activateEvents.emit(this.activated.instance)},t}(),Nn=function(){function t(t,e,n){this.route=t,this.childContexts=e,this.parent=n}return t.prototype.get=function(t,e){return t===ye?this.route:t===Dn?this.childContexts:this.parent.get(t,e)},t}(),jn=function(){return function(){}}(),Mn=function(){function t(){}return t.prototype.preload=function(t,e){return e().pipe(W((function(){return Object(a.a)(null)})))},t}(),Ln=function(){function t(){}return t.prototype.preload=function(t,e){return Object(a.a)(null)},t}(),Fn=function(){function t(t,e,n,r,i){this.router=t,this.injector=r,this.preloadingStrategy=i,this.loader=new _n(e,n,(function(e){return t.triggerEvent(new bt(e))}),(function(e){return t.triggerEvent(new wt(e))}))}return t.prototype.setUpPreloading=function(){var t=this;this.subscription=this.router.events.pipe(Object(I.a)((function(t){return t instanceof ht})),Object(rt.a)((function(){return t.preload()}))).subscribe((function(){}))},t.prototype.preload=function(){var t=this.injector.get(o.x);return this.processRoutes(t,this.router.config)},t.prototype.ngOnDestroy=function(){this.subscription.unsubscribe()},t.prototype.processRoutes=function(t,e){var n,i,o=[];try{for(var a=Object(r.k)(e),u=a.next();!u.done;u=a.next()){var c=u.value;if(c.loadChildren&&!c.canLoad&&c._loadedConfig){var l=c._loadedConfig;o.push(this.processRoutes(l.module,l.routes))}else c.loadChildren&&!c.canLoad?o.push(this.preloadConfig(t,c)):c.children&&o.push(this.processRoutes(t,c.children))}}catch(h){n={error:h}}finally{try{u&&!u.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}return Object(s.a)(o).pipe(Object(T.a)(),Object(E.a)((function(t){})))},t.prototype.preloadConfig=function(t,e){var n=this;return this.preloadingStrategy.preload(e,(function(){return n.loader.load(t.injector,e).pipe(Object(Y.a)((function(t){return e._loadedConfig=t,n.processRoutes(t.module,t.routes)})))}))},t}(),Un=function(){function t(t,e,n){void 0===n&&(n={}),this.router=t,this.viewportScroller=e,this.options=n,this.lastId=0,this.lastSource="imperative",this.restoredId=0,this.store={},n.scrollPositionRestoration=n.scrollPositionRestoration||"disabled",n.anchorScrolling=n.anch
1orScrolling||"disabled"}return t.prototype.init=function(){"disabled"!==this.options.scrollPositionRestoration&&this.viewportScroller.setHistoryScrollRestoration("manual"),this.routerEventsSubscription=this.createScrollEvents(),this.scrollEventsSubscription=this.consumeScrollEvents()},t.prototype.createScrollEvents=function(){var t=this;return this.router.events.subscribe((function(e){e instanceof lt?(t.store[t.lastId]=t.viewportScroller.getScrollPosition(),t.lastSource=e.navigationTrigger,t.restoredId=e.restoredState?e.restoredState.navigationId:0):e instanceof ht&&(t.lastId=e.id,t.scheduleScrollEvent(e,t.router.parseUrl(e.urlAfterRedirects).fragment))}))},t.prototype.consumeScrollEvents=function(){var t=this;return this.router.events.subscribe((function(e){e instanceof Tt&&(e.position?"top"===t.options.scrollPositionRestoration?t.viewportScroller.scrollToPosition([0,0]):"enabled"===t.options.scrollPositionRestoration&&t.viewportScroller.scrollToPosition(e.position):e.anchor&&"enabled"===t.options.anchorScrolling?t.viewportScroller.scrollToAnchor(e.anchor):"disabled"!==t.options.scrollPositionRestoration&&t.viewportScroller.scrollToPosition([0,0]))}))},t.prototype.scheduleScrollEvent=function(t,e){this.router.triggerEvent(new Tt(t,"popstate"===this.lastSource?this.store[this.restoredId]:null,e))},t.prototype.ngOnDestroy=function(){this.routerEventsSubscription&&this.routerEventsSubscription.unsubscribe(),this.scrollEventsSubscription&&this.scrollEventsSubscription.unsubscribe()},t}(),Vn=new o.p("ROUTER_CONFIGURATION"),qn=new o.p("ROUTER_FORROOT_GUARD"),Bn=[i.f,{provide:Gt,useClass:Qt},{provide:In,useFactory:Qn,deps:[o.g,Gt,Dn,i.f,o.q,o.w,o.i,wn,Vn,[Sn,new o.A],[gn,new o.A]]},Dn,{provide:ye,useFactory:Yn,deps:[In]},{provide:o.w,useClass:o.I},Fn,Ln,Mn,{provide:Vn,useValue:{enableTracing:!1}}];function Wn(){return new o.y("Router",In)}var zn=function(){function t(t,e){}var e;return e=t,t.forRoot=function(t,n){return{ngModule:e,providers:[Bn,Gn(t),{provide:qn,useFactory:Kn,deps:[[In,new o.A,new o.H]]},{provide:Vn,useValue:n||{}},{provide:i.g,useFactory:$n,deps:[i.o,[new o.o(i.a),new o.A],Vn]},{provide:Un,useFactory:Hn,deps:[In,i.p,Vn]},{provide:jn,useExisting:n&&n.preloadingStrategy?n.preloadingStrategy:Ln},{provide:o.y,multi:!0,useFactory:Wn},[Xn,{provide:o.d,multi:!0,useFactory:Jn,deps:[Xn]},{provide:tr,useFactory:Zn,deps:[Xn]},{provide:o.b,multi:!0,useExisting:tr}]]}},t.forChild=function(t){return{ngModule:e,providers:[Gn(t)]}},t}();function Hn(t,e,n){return n.scrollOffset&&e.setOffset(n.scrollOffset),new Un(t,e,n)}function $n(t,e,n){return void 0===n&&(n={}),n.useHash?new i.d(t,e):new i.n(t,e)}function Kn(t){if(t)throw new Error("RouterModule.forRoot() called twice. Lazy loaded modules should use RouterModule.forChild() instead.");return"guarded"}function Gn(t){return[{provide:o.a,multi:!0,useValue:t},{provide:wn,multi:!0,useValue:t}]}function Qn(t,e,n,r,i,o,a,s,u,c,l){void 0===u&&(u={});var h=new In(null,e,n,r,i,o,a,Ft(s));if(c&&(h.urlHandlingStrategy=c),l&&(h.routeReuseStrategy=l),u.errorHandler&&(h.errorHandler=u.errorHandler),u.malformedUriErrorHandler&&(h.malformedUriErrorHandler=u.malformedUriErrorHandler),u.enableTracing){var f=Object(ut.r)();h.events.subscribe((function(t){f.logGroup("Router Event: "+t.constructor.name),f.log(t.toString()),f.log(t),f.logGroupEnd()}))}return u.onSameUrlNavigation&&(h.onSameUrlNavigation=u.onSameUrlNavigation),u.paramsInheritanceStrategy&&(h.paramsInheritanceStrategy=u.paramsInheritanceStrategy),u.urlUpdateStrategy&&(h.urlUpdateStrategy=u.urlUpdateStrategy),u.relativeLinkResolution&&(h.relativeLinkResolution=u.relativeLinkResolution),h}function Yn(t){return t.routerState.root}var Xn=function(){function t(t){this.injector=t,this.initNavigation=!1,this.resultOfPreactivationDone=new C.a}return t.prototype.appInitializer=function(){var t=this;return this.injector.get(i.e,Promise.resolve(null)).then((function(){var e=null,n=new Promise((function(t){return e=t})),r=t.injector.get(In),i=t.injector.get(Vn);if(t.isLegacyDisabled(i)||t.isLegacyEnabled(i))e(!0);else if("disabled"===i.initialNavigation)r.setUpLocationChangeListener(),e(!0);else{if("enabled"!==i.initialNavigation)throw new Error("Invalid initialNavigation options: '"+i.initialNavigation+"'");r.hooks.afterPreactivation=function(){return t.initNavigation?Object(a.a)(null):(t.initNavigation=!0,e(!0),t.resultOfPreactivationDone)},r.initialNavigation()}return n}))},t.prototype.bootstrapListener=function(t){var e=this.injector.get(Vn),n=this.injector.get(Fn),r=this.injector.get(Un),i=this.injector.get(In),a=this.injector.get(o.g);t===a.components[0]&&(this.isLegacyEnabled(e)?i.initialNavigation():this.isLegacyDisabled(e)&&i.setUpLocationChangeListener(),n.setUpPreloading(),r.init(),i.resetRootComponentType(a.componentTypes[0]),this.resultOfPreactivationDone.next(null),this.resultOfPreactivationDone.complete())},t.prototype.isLegacyEnabled=function(t){return"legacy_enabled"===t.initialNavigation||!0===t.initialNavigation||void 0===t.initialNavigation},t.prototype.isLegacyDisabled=function(t){return"legacy_disabled"===t.initialNavigation||!1===t.initialNavigation},t}();function Jn(t){return t.appInitializer.bind(t)}function Zn(t){return t.bootstrapListener.bind(t)}var tr=new o.p("Router Initializer")},ZYjt:function(t,e,n){"use strict";n.d(e,"p",(function(){return dt})),n.d(e,"q",(function(){return E})),n.d(e,"a",(function(){return pt})),n.d(e,"h",(function(){return ft})),n.d(e,"c",(function(){return T})),n.d(e,"d",(function(){return k})),n.d(e,"e",(function(){return Y})),n.d(e,"f",(function(){return X})),n.d(e,"g",(function(){return J})),n.d(e,"b",(function(){return rt})),n.d(e,"r",(function(){return s})),n.d(e,"j",(function(){return N})),n.d(e,"i",(function(){return G})),n.d(e,"m",(function(){return Z})),n.d(e,"n",(function(){return nt})),n.d(e,"l",(function(){return x})),n.d(e,"o",(function(){return O})),n.d(e,"k",(function(){return it}));var r=n("mrSG"),i=n("Ip0R"),o=n("CcnG"),a=null;function s(){return a}var u,c={class:"className",innerHtml:"innerHTML",readonly:"readOnly",tabindex:"tabIndex"},l={"\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"}
vendor: 9,641 bytes, line 1
1,h={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"};o.qb.Node&&(u=o.qb.Node.prototype.contains||function(t){return!!(16&this.compareDocumentPosition(t))});var f,d=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(r.d)(e,t),e.prototype.parse=function(t){throw new Error("parse not implemented")},e.makeCurrent=function(){var t;t=new e,a||(a=t)},e.prototype.hasProperty=function(t,e){return e in t},e.prototype.setProperty=function(t,e,n){t[e]=n},e.prototype.getProperty=function(t,e){return t[e]},e.prototype.invoke=function(t,e,n){var i;(i=t)[e].apply(i,Object(r.i)(n))},e.prototype.logError=function(t){window.console&&(console.error?console.error(t):console.log(t))},e.prototype.log=function(t){window.console&&window.console.log&&window.console.log(t)},e.prototype.logGroup=function(t){window.console&&window.console.group&&window.console.group(t)},e.prototype.logGroupEnd=function(){window.console&&window.console.groupEnd&&window.console.groupEnd()},Object.defineProperty(e.prototype,"attrToPropMap",{get:function(){return c},enumerable:!0,configurable:!0}),e.prototype.contains=function(t,e){return u.call(t,e)},e.prototype.querySelector=function(t,e){return t.querySelector(e)},e.prototype.querySelectorAll=function(t,e){return t.querySelectorAll(e)},e.prototype.on=function(t,e,n){t.addEventListener(e,n,!1)},e.prototype.onAndCancel=function(t,e,n){return t.addEventListener(e,n,!1),function(){t.removeEventListener(e,n,!1)}},e.prototype.dispatchEvent=function(t,e){t.dispatchEvent(e)},e.prototype.createMouseEvent=function(t){var e=this.getDefaultDocument().createEvent("MouseEvent");return e.initEvent(t,!0,!0),e},e.prototype.createEvent=function(t){var e=this.getDefaultDocument().createEvent("Event");return e.initEvent(t,!0,!0),e},e.prototype.preventDefault=function(t){t.preventDefault(),t.returnValue=!1},e.prototype.isPrevented=function(t){return t.defaultPrevented||null!=t.returnValue&&!t.returnValue},e.prototype.getInnerHTML=function(t){return t.innerHTML},e.prototype.getTemplateContent=function(t){return"content"in t&&this.isTemplateElement(t)?t.content:null},e.prototype.getOuterHTML=function(t){return t.outerHTML},e.prototype.nodeName=function(t){return t.nodeName},e.prototype.nodeValue=function(t){return t.nodeValue},e.prototype.type=function(t){return t.type},e.prototype.content=function(t){return this.hasProperty(t,"content")?t.content:t},e.prototype.firstChild=function(t){return t.firstChild},e.prototype.nextSibling=function(t){return t.nextSibling},e.prototype.parentElement=function(t){return t.parentNode},e.prototype.childNodes=function(t){return t.childNodes},e.prototype.childNodesAsList=function(t){for(var e=t.childNodes,n=new Array(e.length),r=0;r<e.length;r++)n[r]=e[r];return n},e.prototype.clearNodes=function(t){for(;t.firstChild;)t.removeChild(t.firstChild)},e.prototype.appendChild=function(t,e){t.appendChild(e)},e.prototype.removeChild=function(t,e){t.removeChild(e)},e.prototype.replaceChild=function(t,e,n){t.replaceChild(e,n)},e.prototype.remove=function(t){return t.parentNode&&t.parentNode.removeChild(t),t},e.prototype.insertBefore=function(t,e,n){t.insertBefore(n,e)},e.prototype.insertAllBefore=function(t,e,n){n.forEach((function(n){return t.insertBefore(n,e)}))},e.prototype.insertAfter=function(t,e,n){t.insertBefore(n,e.nextSibling)},e.prototype.setInnerHTML=function(t,e){t.innerHTML=e},e.prototype.getText=function(t){return t.textContent},e.prototype.setText=function(t,e){t.textContent=e},e.prototype.getValue=function(t){return t.value},e.prototype.setValue=function(t,e){t.value=e},e.prototype.getChecked=function(t){return t.checked},e.prototype.setChecked=function(t,e){t.checked=e},e.prototype.createComment=function(t){return this.getDefaultDocument().createComment(t)},e.prototype.createTemplate=function(t){var e=this.getDefaultDocument().createElement("template");return e.innerHTML=t,e},e.prototype.createElement=function(t,e){return(e=e||this.getDefaultDocument()).createElement(t)},e.prototype.createElementNS=function(t,e,n){return(n=n||this.getDefaultDocument()).createElementNS(t,e)},e.prototype.createTextNode=function(t,e){return(e=e||this.getDefaultDocument()).createTextNode(t)},e.prototype.createScriptTag=function(t,e,n){var r=(n=n||this.getDefaultDocument()).createElement("SCRIPT");return r.setAttribute(t,e),r},e.prototype.createStyleElement=function(t,e){var n=(e=e||this.getDefaultDocument()).createElement("style");return this.appendChild(n,this.createTextNode(t,e)),n},e.prototype.createShadowRoot=function(t){return t.createShadowRoot()},e.prototype.getShadowRoot=function(t){return t.shadowRoot},e.prototype.getHost=function(t){return t.host},e.prototype.clone=function(t){return t.cloneNode(!0)},e.prototype.getElementsByClassName=function(t,e){return t.getElementsByClassName(e)},e.prototype.getElementsByTagName=function(t,e){return t.getElementsByTagName(e)},e.prototype.classList=function(t){return Array.prototype.slice.call(t.classList,0)},e.prototype.addClass=function(t,e){t.classList.add(e)},e.prototype.removeClass=function(t,e){t.classList.remove(e)},e.prototype.hasClass=function(t,e){return t.classList.contains(e)},e.prototype.setStyle=function(t,e,n){t.style[e]=n},e.prototype.removeStyle=function(t,e){t.style[e]=""},e.prototype.getStyle=function(t,e){return t.style[e]},e.prototype.hasStyle=function(t,e,n){var r=this.getStyle(t,e)||"";return n?r==n:r.length>0},e.prototype.tagName=function(t){return t.tagName},e.prototype.attributeMap=function(t){for(var e=new Map,n=t.attributes,r=0;r<n.length;r++){var i=n.item(r);e.set(i.name,i.value)}return e},e.prototype.hasAttribute=function(t,e){return t.hasAttribute(e)},e.prototype.hasAttributeNS=function(t,e,n){return t.hasAttributeNS(e,n)},e.prototype.getAttribute=function(t,e){return t.getAttribute(e)},e.prototype.getAttributeNS=function(t,e,n){return t.getAttributeNS(e,n)},e.prototype.setAttribute=function(t,e,n){t.setAttribute(e,n)},e.prototype.setAttributeNS=function(t,e,n,r){t.setAttributeNS(e,n,r)},e.prototype.removeAttribute=function(t,e){t.removeAttribute(e)},e.prototype.removeAttributeNS=function(t,e,n){t.removeAttributeNS(e,n)},e.prototype.templateAwareRoot=function(t){return this.isTemplateElement(t)?this.content(t):t},e.prototype.createHtmlDocument=function(){return document.implementation.createHTMLDocument("fakeTitle")},e.prototype.getDefaultDocument=function(){return document},e.prototype.getBoundingClientRect=function(t){try{return t.getBoundingClientRect()}catch(e){return{top:0,bottom:0,left:0,right:0,width:0,height:0}}},e.prototype.getTitle=function(t){return t.title},e.prototype.setTitle=function(t,e){t.title=e||""},e.prototype.elementMatches=function(t,e){return!!this.isElementNode(t)&&(t.matches&&t.matches(e)||t.msMatchesSelector&&t.msMatchesSelector(e)||t.webkitMatchesSelector&&t.webkitMatchesSelector(e))},e.prototype.isTemplateElement=function(t){return this.isElementNode(t)&&"TEMPLATE"===t.nodeName},e.prototype.isTextNode=function(t){return t.nodeType===Node.TEXT_NODE},e.prototype.isCommentNode=function(t){return t.nodeType===Node.COMMENT_NODE},e.prototype.isElementNode=function(t){return t.nodeType===Node.ELEMENT_NODE},e.prototype.hasShadowRoot=function(t){return null!=t.shadowRoot&&t instanceof HTMLElement},e.prototype.isShadowRoot=function(t){return t instanceof DocumentFragment},e.prototype.importIntoDoc=function(t){return document.importNode(this.templateAwareRoot(t),!0)},e.prototype.adoptNode=function(t){return document.adoptNode(t)},e.prototype.getHref=function(t){return t.getAttribute("href")},e.prototype.getEventKey=function(t){var e=t.key;if(null==e){if(null==(e=t.keyIdentifier))return"Unidentified";e.startsWith("U+")&&(e=String.fromCharCode(parseInt(e.substring(2),16)),3===t.location&&h.hasOwnProperty(e)&&(e=h[e]))}return l[e]||e},e.prototype.getGlobalEventTarget=function(t,e){return"window"===e?window:"document"===e?t:"body"===e?t.body:null},e.prototype.getHistory=function(){return window.history},e.prototype.getLocation=function(){return window.location},e.prototype.getBaseHref=function(t){var e,n=p||(p=document.querySelector("base"))?p.getAttribute("href"):null;return null==n?null:(e=n,f||(f=document.createElement("a")),f.setAttribute("href",e),"/"===f.pathname.charAt(0)?f.pathname:"/"+f.pathname)},e.prototype.resetBaseElement=function(){p=null},e.prototype.getUserAgent=function(){return window.navigator.userAgent},e.prototype.setData=function(t,e,n){this.setAttribute(t,"data-"+e,n)},e.prototype.getData=function(t,e){return this.getAttribute(t,"data-"+e)},e.prototype.getComputedStyle=function(t){return getComputedStyle(t)},e.prototype.supportsWebAnimation=function(){return"function"==typeof Element.prototype.animate},e.prototype.performanceNow=function(){return window.performance&&window.performance.now?window.performance.now():(new Date).getTime()},e.prototype.supportsCookies=function(){return!0},e.prototype.getCookie=function(t){return Object(i.t)(document.cookie,t)},e.prototype.setCookie=function(t,e){document.cookie=encodeURIComponent(t)+"="+encodeURIComponent(e)},e}(function(t){function e(){var e=t.call(this)||this;e._animationPrefix=null,e._transitionEnd=null;try{var n=e.createElement("div",document);if(null!=e.getStyle(n,"animationName"))e._animationPrefix="";else for(var r=["Webkit","Moz","O","ms"],i=0;i<r.length;i++)if(null!=e.getStyle(n,r[i]+"AnimationName")){e._animationPrefix="-"+r[i].toLowerCase()+"-";break}var o={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};
1Object.keys(o).forEach((function(t){null!=e.getStyle(n,t)&&(e._transitionEnd=o[t])}))}catch(a){e._animationPrefix=null,e._transitionEnd=null}return e}return Object(r.d)(e,t),e.prototype.getDistributedNodes=function(t){return t.getDistributedNodes()},e.prototype.resolveAndSetHref=function(t,e,n){t.href=null==n?e:e+"/../"+n},e.prototype.supportsDOMEvents=function(){return!0},e.prototype.supportsNativeShadowDOM=function(){return"function"==typeof document.body.createShadowRoot},e.prototype.getAnimationPrefix=function(){return this._animationPrefix?this._animationPrefix:""},e.prototype.getTransitionEnd=function(){return this._transitionEnd?this._transitionEnd:""},e.prototype.supportsAnimation=function(){return null!=this._animationPrefix&&null!=this._transitionEnd},e}(function(){function t(){this.resourceLoaderType=null}return Object.defineProperty(t.prototype,"attrToPropMap",{get:function(){return this._attrToPropMap},set:function(t){this._attrToPropMap=t},enumerable:!0,configurable:!0}),t}())),p=null,m=i.c;function y(){return!!window.history.pushState}var v=function(t){function e(e){var n=t.call(this)||this;return n._doc=e,n._init(),n}return Object(r.d)(e,t),e.prototype._init=function(){this.location=s().getLocation(),this._history=s().getHistory()},e.prototype.getBaseHrefFromDOM=function(){return s().getBaseHref(this._doc)},e.prototype.onPopState=function(t){s().getGlobalEventTarget(this._doc,"window").addEventListener("popstate",t,!1)},e.prototype.onHashChange=function(t){s().getGlobalEventTarget(this._doc,"window").addEventListener("hashchange",t,!1)},Object.defineProperty(e.prototype,"pathname",{get:function(){return this.location.pathname},set:function(t){this.location.pathname=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"search",{get:function(){return this.location.search},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hash",{get:function(){return this.location.hash},enumerable:!0,configurable:!0}),e.prototype.pushState=function(t,e,n){y()?this._history.pushState(t,e,n):this.location.hash=n},e.prototype.replaceState=function(t,e,n){y()?this._history.replaceState(t,e,n):this.location.hash=n},e.prototype.forward=function(){this._history.forward()},e.prototype.back=function(){this._history.back()},Object(r.c)([Object(r.g)(0,Object(o.o)(m)),Object(r.f)("design:paramtypes",[Object])],e)}(i.o),g=new o.p("TRANSITION_ID"),b=[{provide:o.d,useFactory:function(t,e,n){return function(){n.get(o.e).donePromise.then((function(){var n=s();Array.prototype.slice.apply(n.querySelectorAll(e,"style[ng-transition]")).filter((function(e){return n.getAttribute(e,"ng-transition")===t})).forEach((function(t){return n.remove(t)}))}))}},deps:[g,m,o.q],multi:!0}],w=function(){function t(){}return t.init=function(){Object(o.Z)(new t)},t.prototype.addToWindow=function(t){o.qb.getAngularTestability=function(e,n){void 0===n&&(n=!0);var r=t.findTestabilityInTree(e,n);if(null==r)throw new Error("Could not find testability for element.");return r},o.qb.getAllAngularTestabilities=function(){return t.getAllTestabilities()},o.qb.getAllAngularRootElements=function(){return t.getAllRootElements()},o.qb.frameworkStabilizers||(o.qb.frameworkStabilizers=[]),o.qb.frameworkStabilizers.push((function(t){var e=o.qb.getAllAngularTestabilities(),n=e.length,r=!1,i=function(e){r=r||e,0==--n&&t(r)};e.forEach((function(t){t.whenStable(i)}))}))},t.prototype.findTestabilityInTree=function(t,e,n){if(null==e)return null;var r=t.getTestability(e);return null!=r?r:n?s().isShadowRoot(e)?this.findTestabilityInTree(t,s().getHost(e),!0):this.findTestabilityInTree(t,s().parentElement(e),!0):null},t}();function _(t,e){"undefined"!=typeof COMPILED&&COMPILED||((o.qb.ng=o.qb.ng||{})[t]=e)}var S={ApplicationRef:o.g,NgZone:o.z};function C(t){return Object(o.V)(t)}function E(t){return _("probe",C),_("coreTokens",Object(r.a)({},S,(t||[]).reduce((function(t,e){return t[e.name]=e.token,t}),{}))),function(){return C}}var T=new o.p("EventManagerPlugins"),k=function(){function t(t,e){var n=this;this._zone=e,this._eventNameToPlugin=new Map,t.forEach((function(t){return t.manager=n})),this._plugins=t.slice().reverse()}return t.prototype.addEventListener=function(t,e,n){return this._findPluginFor(e).addEventListener(t,e,n)},t.prototype.addGlobalEventListener=function(t,e,n){return this._findPluginFor(e).addGlobalEventListener(t,e,n)},t.prototype.getZone=function(){return this._zone},t.prototype._findPluginFor=function(t){var e=this._eventNameToPlugin.get(t);if(e)return e;for(var n=this._plugins,r=0;r<n.length;r++){var i=n[r];if(i.supports(t))return this._eventNameToPlugin.set(t,i),i}throw new Error("No event manager plugin found for event "+t)},t}(),I=function(){function t(t){this._doc=t}return t.prototype.addGlobalEventListener=function(t,e,n){var r=s().getGlobalEventTarget(this._doc,t);if(!r)throw new Error("Unsupported event target "+r+" for event "+e);return this.addEventListener(r,e,n)},t}(),O=function(){function t(){this._stylesSet=new Set}return t.prototype.addStyles=function(t){var e=this,n=new Set;t.forEach((function(t){e._stylesSet.has(t)||(e._stylesSet.add(t),n.add(t))})),this.onStylesAdded(n)},t.prototype.onStylesAdded=function(t){},t.prototype.getAllStyles=function(){return Array.from(this._stylesSet)},t}(),x=function(t){function e(e){var n=t.call(this)||this;return n._doc=e,n._hostNodes=new Set,n._styleNodes=new Set,n._hostNodes.add(e.head),n}return Object(r.d)(e,t),e.prototype._addStylesToHost=function(t,e){var n=this;t.forEach((function(t){var r=n._doc.createElement("style");r.textContent=t,n._styleNodes.add(e.appendChild(r))}))},e.prototype.addHost=function(t){this._addStylesToHost(this._stylesSet,t),this._hostNodes.add(t)},e.prototype.removeHost=function(t){this._hostNodes.delete(t)},e.prototype.onStylesAdded=function(t){var e=this;
1this._hostNodes.forEach((function(n){return e._addStylesToHost(t,n)}))},e.prototype.ngOnDestroy=function(){this._styleNodes.forEach((function(t){return s().remove(t)}))},e}(O),A={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/"},P=/%COMP%/g;function D(t,e,n){for(var r=0;r<e.length;r++){var i=e[r];Array.isArray(i)?D(t,i,n):(i=i.replace(P,t),n.push(i))}return n}function R(t){return function(e){!1===t(e)&&(e.preventDefault(),e.returnValue=!1)}}var N=function(){function t(t,e,n){this.eventManager=t,this.sharedStylesHost=e,this.appId=n,this.rendererByCompId=new Map,this.defaultRenderer=new j(t)}return t.prototype.createRenderer=function(t,e){if(!t||!e)return this.defaultRenderer;switch(e.encapsulation){case o.P.Emulated:var n=this.rendererByCompId.get(e.id);return n||(n=new U(this.eventManager,this.sharedStylesHost,e,this.appId),this.rendererByCompId.set(e.id,n)),n.applyToHost(t),n;case o.P.Native:case o.P.ShadowDom:return new V(this.eventManager,this.sharedStylesHost,t,e);default:if(!this.rendererByCompId.has(e.id)){var r=D(e.id,e.styles,[]);this.sharedStylesHost.addStyles(r),this.rendererByCompId.set(e.id,this.defaultRenderer)}return this.defaultRenderer}},t.prototype.begin=function(){},t.prototype.end=function(){},t}(),j=function(){function t(t){this.eventManager=t,this.data=Object.create(null)}return t.prototype.destroy=function(){},t.prototype.createElement=function(t,e){return e?document.createElementNS(A[e],t):document.createElement(t)},t.prototype.createComment=function(t){return document.createComment(t)},t.prototype.createText=function(t){return document.createTextNode(t)},t.prototype.appendChild=function(t,e){t.appendChild(e)},t.prototype.insertBefore=function(t,e,n){t&&t.insertBefore(e,n)},t.prototype.removeChild=function(t,e){t&&t.removeChild(e)},t.prototype.selectRootElement=function(t,e){var n="string"==typeof t?document.querySelector(t):t;if(!n)throw new Error('The selector "'+t+'" did not match any elements');return e||(n.textContent=""),n},t.prototype.parentNode=function(t){return t.parentNode},t.prototype.nextSibling=function(t){return t.nextSibling},t.prototype.setAttribute=function(t,e,n,r){if(r){e=r+":"+e;var i=A[r];i?t.setAttributeNS(i,e,n):t.setAttribute(e,n)}else t.setAttribute(e,n)},t.prototype.removeAttribute=function(t,e,n){if(n){var r=A[n];r?t.removeAttributeNS(r,e):t.removeAttribute(n+":"+e)}else t.removeAttribute(e)},t.prototype.addClass=function(t,e){t.classList.add(e)},t.prototype.removeClass=function(t,e){t.classList.remove(e)},t.prototype.setStyle=function(t,e,n,r){r&o.E.DashCase?t.style.setProperty(e,n,r&o.E.Important?"important":""):t.style[e]=n},t.prototype.removeStyle=function(t,e,n){n&o.E.DashCase?t.style.removeProperty(e):t.style[e]=""},t.prototype.setProperty=function(t,e,n){L(e,"property"),t[e]=n},t.prototype.setValue=function(t,e){t.nodeValue=e},t.prototype.listen=function(t,e,n){return L(e,"listener"),"string"==typeof t?this.eventManager.addGlobalEventListener(t,e,R(n)):this.eventManager.addEventListener(t,e,R(n))},t}(),M="@".charCodeAt(0);function L(t,e){if(t.charCodeAt(0)===M)throw new Error("Found the synthetic "+e+" "+t+'. Please include either "BrowserAnimationsModule" or "NoopAnimationsModule" in your application.')}var F,U=function(t){function e(e,n,r,i){var o=t.call(this,e)||this;o.component=r;var a=D(i+"-"+r.id,r.styles,[]);return n.addStyles(a),o.contentAttr="_ngcontent-%COMP%".replace(P,i+"-"+r.id),o.hostAttr=function(t){return"_nghost-%COMP%".replace(P,t)}(i+"-"+r.id),o}return Object(r.d)(e,t),e.prototype.applyToHost=function(e){t.prototype.setAttribute.call(this,e,this.hostAttr,"")},e.prototype.createElement=function(e,n){var r=t.prototype.createElement.call(this,e,n);return t.prototype.setAttribute.call(this,r,this.contentAttr,""),r},e}(j),V=function(t){function e(e,n,r,i){var a=t.call(this,e)||this;a.sharedStylesHost=n,a.hostEl=r,a.component=i,a.shadowRoot=i.encapsulation===o.P.ShadowDom?r.attachShadow({mode:"open"}):r.createShadowRoot(),a.sharedStylesHost.addHost(a.shadowRoot);for(var s=D(i.id,i.styles,[]),u=0;u<s.length;u++){var c=document.createElement("style");c.textContent=s[u],a.shadowRoot.appendChild(c)}return a}return Object(r.d)(e,t),e.prototype.nodeOrShadowRoot=function(t){return t===this.hostEl?this.shadowRoot:t},e.prototype.destroy=function(){this.sharedStylesHost.removeHost(this.shadowRoot)},e.prototype.appendChild=function(e,n){return t.prototype.appendChild.call(this,this.nodeOrShadowRoot(e),n)},e.prototype.insertBefore=function(e,n,r){return t.prototype.insertBefore.call(this,this.nodeOrShadowRoot(e),n,r)},e.prototype.removeChild=function(e,n){return t.prototype.removeChild.call(this,this.nodeOrShadowRoot(e),n)},e.prototype.parentNode=function(e){return this.nodeOrShadowRoot(t.prototype.parentNode.call(this,this.nodeOrShadowRoot(e)))},e}(j),q="undefined"!=typeof Zone&&Zone.__symbol__||function(t){return"__zone_symbol__"+t},B=q("addEventListener"),W=q("removeEventListener"),z={},H="__zone_symbol__propagationStopped";"undefined"!=typeof Zone&&Zone[q("BLACK_LISTED_EVENTS")]&&(F={});var $=function(t){return!!F&&F.hasOwnProperty(t)},K=function(t){var e=z[t.type];if(e){var n=this[e];if(n){var r=[t];if(1===n.length)return(a=n[0]).zone!==Zone.current?a.zone.run(a.handler,this,r):a.handler.apply(this,r);for(var i=n.slice(),o=0;o<i.length&&!0!==t[H];o++){var a;(a=i[o]).zone!==Zone.current?a.zone.run(a.handler,this,r):a.handler.apply(this,r)}}}},G=function(t){function e(e,n,r){var o=t.call(this,e)||this;return o.ngZone=n,r&&Object(i.q)(r)||o.patchEvent(),o}return Object(r.d)(e,t),e.prototype.patchEvent=function(){if("undefined"!=typeof Event&&Event&&Event.prototype&&!Event.prototype.__zone_symbol__stopImmediatePropagation){var t=Event.prototype.__zone_symbol__stopImmediatePropagation=Event.prototype.stopImmediatePropagation;Event.prototype.stopImmediatePropagation=function(){this&&(this[H]=!0),t&&t.apply(this,arguments)}}},e.prototype.supports=function(t){return!0},e.prototype.addEventListener=function(t,e,n){var r=this,i=n;if(!t[B]||o.z.isInAngularZone()&&!$(e))t.addEventListener(e,i,!1);else{var a=z[e];a||(a=z[e]=q("ANGULAR"+e+"FALSE"));var s=t[a],u=s&&s.length>0;s||(s=t[a]=[]);var c=$(e)?Zone.root:Zone.current;if(0===s.length)s.push({zone:c,handler:i});else{for(var l=!1,h=0;h<s.length;h++)if(s[h].handler===i){l=!0;break}l||s.push({zone:c,handler:i})}u||t[B](e,K,!1)}return function(){return r.removeEventListener(t,e,i)}},e.prototype.removeEventListener=function(t,e,n){var r=t[W];if(!r)return t.removeEventListener.apply(t,[e,n,!1]);var i=z[e],o=i&&t[i];if(!o)return t.removeEventListener.apply(t,[e,n,!1]);for(var a=!1,s=0;s<o.length;s++)if(o[s].handler===n){a=!0,o.splice(s,1);break}a?0===o.length&&r.apply(t,[e,K,!1]):t.removeEventListener.apply(t,[e,n,!1])},e}(I),Q={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}
1,Y=new o.p("HammerGestureConfig"),X=new o.p("HammerLoader"),J=function(){function t(){this.events=[],this.overrides={}}return t.prototype.buildHammer=function(t){var e=new Hammer(t,this.options);for(var n in e.get("pinch").set({enable:!0}),e.get("rotate").set({enable:!0}),this.overrides)e.get(n).set(this.overrides[n]);return e},t}(),Z=function(t){function e(e,n,r,i){var o=t.call(this,e)||this;return o._config=n,o.console=r,o.loader=i,o}return Object(r.d)(e,t),e.prototype.supports=function(t){return!(!Q.hasOwnProperty(t.toLowerCase())&&!this.isCustomEvent(t)||!window.Hammer&&!this.loader&&(this.console.warn('The "'+t+'" event cannot be bound because Hammer.JS is not loaded and no custom loader has been specified.'),1))},e.prototype.addEventListener=function(t,e,n){var r=this,i=this.manager.getZone();if(e=e.toLowerCase(),!window.Hammer&&this.loader){var o=!1,a=function(){o=!0};return this.loader().then((function(){if(!window.Hammer)return r.console.warn("The custom HAMMER_LOADER completed, but Hammer.JS is not present."),void(a=function(){});o||(a=r.addEventListener(t,e,n))})).catch((function(){r.console.warn('The "'+e+'" event cannot be bound because the custom Hammer.JS loader failed.'),a=function(){}})),function(){a()}}return i.runOutsideAngular((function(){var o=r._config.buildHammer(t),a=function(t){i.runGuarded((function(){n(t)}))};return o.on(e,a),function(){o.off(e,a),"function"==typeof o.destroy&&o.destroy()}}))},e.prototype.isCustomEvent=function(t){return this._config.events.indexOf(t)>-1},e}(I),tt=["alt","control","meta","shift"],et={alt:function(t){return t.altKey},control:function(t){return t.ctrlKey},meta:function(t){return t.metaKey},shift:function(t){return t.shiftKey}},nt=function(t){function e(e){return t.call(this,e)||this}var n;return Object(r.d)(e,t),n=e,e.prototype.supports=function(t){return null!=n.parseEventName(t)},e.prototype.addEventListener=function(t,e,r){var i=n.parseEventName(e),o=n.eventCallback(i.fullKey,r,this.manager.getZone());return this.manager.getZone().runOutsideAngular((function(){return s().onAndCancel(t,i.domEventName,o)}))},e.parseEventName=function(t){var e=t.toLowerCase().split("."),r=e.shift();if(0===e.length||"keydown"!==r&&"keyup"!==r)return null;var i=n._normalizeKey(e.pop()),o="";if(tt.forEach((function(t){var n=e.indexOf(t);n>-1&&(e.splice(n,1),o+=t+".")})),o+=i,0!=e.length||0===i.length)return null;var a={};return a.domEventName=r,a.fullKey=o,a},e.getEventFullKey=function(t){var e="",n=s().getEventKey(t);return" "===(n=n.toLowerCase())?n="space":"."===n&&(n="dot"),tt.forEach((function(r){r!=n&&(0,et[r])(t)&&(e+=r+".")})),e+=n},e.eventCallback=function(t,e,r){return function(i){n.getEventFullKey(i)===t&&r.runGuarded((function(){return e(i)}))}},e._normalizeKey=function(t){switch(t){case"esc":return"escape";default:return t}},e}(I),rt=function(){return function(){}}(),it=function(t){function e(e){var n=t.call(this)||this;return n._doc=e,n}return Object(r.d)(e,t),e.prototype.sanitize=function(t,e){if(null==e)return null;switch(t){case o.G.NONE:return e;case o.G.HTML:return e instanceof at?e.changingThisBreaksApplicationSecurity:(this.checkNotSafeValue(e,"HTML"),Object(o.db)(this._doc,String(e)));case o.G.STYLE:return e instanceof st?e.changingThisBreaksApplicationSecurity:(this.checkNotSafeValue(e,"Style"),Object(o.eb)(e));case o.G.SCRIPT:if(e instanceof ut)return e.changingThisBreaksApplicationSecurity;throw this.checkNotSafeValue(e,"Script"),new Error("unsafe value used in a script context");case o.G.URL:return e instanceof lt||e instanceof ct?e.changingThisBreaksApplicationSecurity:(this.checkNotSafeValue(e,"URL"),Object(o.fb)(String(e)));case o.G.RESOURCE_URL:if(e instanceof lt)return e.changingThisBreaksApplicationSecurity;throw this.checkNotSafeValue(e,"ResourceURL"),new Error("unsafe value used in a resource URL context (see http://g.co/ng/security#xss)");default:throw new Error("Unexpected SecurityContext "+t+" (see http://g.co/ng/security#xss)")}},e.prototype.checkNotSafeValue=function(t,e){if(t instanceof ot)throw new Error("Required a safe "+e+", got a "+t.getTypeName()+" (see http://g.co/ng/security#xss)")},e.prototype.bypassSecurityTrustHtml=function(t){return new at(t)},e.prototype.bypassSecurityTrustStyle=function(t){return new st(t)},e.prototype.bypassSecurityTrustScript=function(t){return new ut(t)},e.prototype.bypassSecurityTrustUrl=function(t){return new ct(t)},e.prototype.bypassSecurityTrustResourceUrl=function(t){return new lt(t)},e}(rt),ot=function(){function t(t){this.changingThisBreaksApplicationSecurity=t}return t.prototype.toString=function(){return"SafeValue must use [property]=binding: "+this.changingThisBreaksApplicationSecurity+" (see http://g.co/ng/security#xss)"},t}(),at=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(r.d)(e,t),e.prototype.getTypeName=function(){return"HTML"},e}(ot),st=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(r.d)(e,t),e.prototype.getTypeName=function(){return"Style"},e}(ot),ut=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(r.d)(e,t),e.prototype.getTypeName=function(){return"Script"},e}(ot),ct=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(r.d)(e,t),e.prototype.getTypeName=function(){return"URL"},e}(ot),lt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(r.d)(e,t),e.prototype.getTypeName=function(){return"ResourceURL"},e}(ot),ht=[{provide:o.B,useValue:i.r},{provide:o.C,useValue:function(){d.makeCurrent(),w.init()},multi:!0},{provide:i.o,useClass:v,deps:[m]},{provide:m,useFactory:function(){return document},deps:[]}],ft=Object(o.R)(o.Y,"browser",ht);function dt(){return new o.l}var pt=function(){function t(t){if(t)throw new Error("BrowserModule has already been loaded. If you need access to common directives such as NgIf and NgFor from a lazy loaded module, import CommonModule instead.")}var e;return e=t,t.withServerTransition=function(t){return{ngModule:e,providers:[{provide:o.c,useValue:t.appId},{provide:g,useExisting:o.c},b]}},t}();"undefined"!=typeof window&&window},"ZZ/e":function(t,e,n){"use strict";var r=n("mrSG"),i=n("CcnG"),o=n("Ip0R"),a=n("ZYCi"),s=n("ttJE"),u=(n("wSPg"),n("FX7f"),n("xoJo"),n("ocqh")),c=(n("BCwa"),n("CTpc")),l=n("K9Ia"),h=n("bne5"),f=n("26FU"),d=n("VnD/"),p=n("15JJ"),m=n("ad02"),y=n("ae0+");!function(){if(void 0!==window.Reflect&&void 0!==window.customElements){var t=HTMLElement;window.HTMLElement=function(){return Reflect.construct(t,[],this.constructor)},HTMLElement.prototype=t.prototype,HTMLElement.prototype.constructor=HTMLElement,Object.setPrototypeOf(HTMLElement,t)}}(),n.d(e,"a",(function(){return De})),n.d(e,"b",(function(){return se})),n.d(e,"c",(function(){return C})),n.d(e,"d",(function(){return re})),n.d(e,"e",(function(){return xe})),n.d(e,"f",(function(){return L})),n.d(e,"g",(function(){return F})),n.d(e,"h",(function(){return U})),n.d(e,"i",(function(){return V})),n.d(e,"j",(function(){return q})),n.d(e,"k",(function(){return B})),n.d(e,"l",(function(){return W})),n.d(e,"m",(function(){return z})),n.d(e,"n",(function(){return H})),n.d(e,"o",(function(){return $})),n.d(e,"p",(function(){return K})),n.d(e,"q",(function(){return G})),n.d(e,"r",(function(){return Q})),n.d(e,"s",(function(){return Y})),n.d(e,"t",(function(){return X})),n.d(e,"u",(function(){return J})),n.d(e,"v",(function(){return Z})),n.d(e,"w",(function(){return tt})),n.d(e,"x",(function(){return et})),n.d(e,"y",(function(){return nt})),n.d(e,"z",(function(){return rt})),n.d(e,"A",(function(){return it})),n.d(e,"B",(function(){return ot})),n.d(e,"C",(function(){return at})),n.d(e,"D",(function(){return st})),n.d(e,"E",(function(){return ut})),n.d(e,"F",(function(){return ct})),n.d(e,"G",(function(){return lt})),n.d(e,"H",(function(){return ht})),n.d(e,"I",(function(){return ft})),n.d(e,"J",(function(){return dt})),n.d(e,"K",(function(){return pt})),n.d(e,"L",(function(){return mt})),n.d(e,"M",(function(){return yt})),n.d(e,"N",(function(){return vt})),n.d(e,"O",(function(){return gt})),n.d(e,"P",(function(){return bt})),n.d(e,"Q",(function(){return wt})),n.d(e,"R",(function(){return _t})),n.d(e,"S",(function(){return St})),n.d(e,"T",(function(){return Ct})),n.d(e,"U",(function(){return Et})),n.d(e,"V",(function(){return Tt})),n.d(e,"W",(function(){return kt})),n.d(e,"X",(function(){return It})),n.d(e,"Y",(function(){return Ot})),n.d(e,"Z",(function(){return xt})),n.d(e,"ab",(function(){return At})),n.d(e,"bb",(function(){return Pt})),n.d(e,"cb",(function(){return Dt})),n.d(e,"db",(function(){return Rt})),n.d(e,"eb",(function(){return Nt})),n.d(e,"fb",(function(){return jt})),n.d(e,"gb",(function(){return Mt})),n.d(e,"hb",(function(){return Lt})),n.d(e,"ib",(function(){return Ce})),n.d(e,"jb",(function(){return Ft})),n.d(e,"kb",(function(){return Ut})),n.d(e,"lb",(function(){return Vt})),n.d(e,"mb",(function(){return qt})),n.d(e,"nb",(function(){return Bt})),n.d(e,"ob",(function(){return Wt})),n.d(e,"pb",(function(){return zt})),n.d(e,"qb",(function(){return Ht})),n.d(e,"rb",(function(){return $t})),n.d(e,"sb",(function(){return Kt})),n.d(e,"tb",(function(){return Gt})),n.d(e,"ub",(function(){return Qt})),n.d(e,"vb",(function(){return Yt})),n.d(e,"wb",(function(){return Te})),n.d(e,"xb",(function(){return Xt})),n.d(e,"yb",(function(){return Jt})),n.d(e,"zb",(function(){return Zt})),n.d(e,"Ab",(function(){return te})),n.d(e,"Bb",(function(){return ee})),n.d(e,"Cb",(function(){return ne})),n.d(e,"Db",(function(){return Ie})),n.d(e,"Eb",(function(){return Ue})),n.d(e,"Fb",(function(){return Me})),n.d(e,"Gb",(function(){return Re})),n.d(e,"Hb",(function(){return Ne})),n.d(e,"Ib",(function(){return A})),n.d(e,"Jb",(function(){return I})),n.d(e,"Kb",(function(){return je})),n.d(e,"Lb",(function(){return E})),n.d(e,"Mb",(function(){return ke})),n.d(e,"Nb",(function(){return T})),n.d(e,"Ob",(function(){return k})),n.d(e,"Pb",(function(){return ie})),n.d(e,"Qb",(function(){return Fe}));var v=function(t){return"function"==typeof __zone_symbol__requestAnimationFrame?__zone_symbol__requestAnimationFrame(t):"function"==typeof requestAnimationFrame?requestAnimationFrame(t):setTimeout(t)},g=function(){function t(t){this.el=t,this.onChange=function(){},this.onTouched=function(){}}return t.prototype.writeValue=function(t){this.el.nativeElement.value=this.lastValue=null==t?"":t,b(this.el)},t.prototype.handleChangeEvent=function(t,e){t===this.el.nativeElement&&(e!==this.lastValue&&(this.lastValue=e,this.onChange(e)),b(this.el))},t.prototype._handleBlurEvent=function(t){t===this.el.nativeElement&&(this.onTouched(),b(this.el))},t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.setDisabledState=function(t){this.el.nativeElement.disabled=t},t}(),b=function(t){v((function(){var e=t.nativeElement,n=w(e);_(e,n);var r=e.closest("ion-item");r&&_(r,n)}))},w=function(t){for(var e=t.classList,n=[],r=0;r<e.length;r++){var i=e.item(r);null!==i&&S(i,"ng-")&&n.push("ion-"+i.substr(3))}return n},_=function(t,e){var n=t.classList;["ion-valid","ion-invalid","ion-touched","ion-untouched","ion-dirty","ion-pristine"].forEach((function(t){return n.remove(t)})),e.forEach((function(t){return n.add(t)}))},S=function(t,e){return t.substr(0,e.length)===e},C=function(t){function e(e){return t.call(this,e)||this}return Object(r.d)(e,t),e.prototype.writeValue=function(t){this.el.nativeElement.checked=this.lastValue=null!=t&&t,b(this.el)},e.prototype._handleIonChange=function(t){this.handleChangeEvent(t,t.checked)},e}(g),E=function(t){function e(e){return t.call(this,e)||this}return Object(r.d)(e,t),e.prototype._handleIonSelect=function(t){this.handleChangeEvent(t,t.checked)},e}(g),T=function(t){function e(e){return t.call(this,e)||this}return Object(r.d)(e,t),e.prototype._handleChangeEvent=function(t){this.handleChangeEvent(t,t.value)},e}(g),k=function(t){function e(e){return t.call(this,e)||this}return Object(r.d)(e,t),e.prototype._handleInputEvent=function(t){this.handleChangeEvent(t,t.value)},e}(g),I=function(){function t(t,e){var n=this;this.doc=t,this.backButton=new l.a,this.pause=new l.a,this.resume=new l.a,this.resize=new l.a,e.run((function(){var r;n.win=t.defaultView,n.backButton.subscribeWithPriority=function(t,n){return this.subscribe((function(r){return r.register(t,(function(){return e.run(n)}))}))},x(n.pause,t,"pause"),x(n.resume,t,"resume"),x(n.backButton,t,"ionBackButton"),x(n.resize,n.win,"resize"),n._readyPromise=new Promise((function(t){r=t})),n.win&&n.win.cordova?t.addEventListener("deviceready",(function(){r("cordova")}),{once:!0}):r("dom")}))}return t.prototype.is=function(t){return Object(s.f)(this.win,t)},t.prototype.platforms=function(){return Object(s.e)(this.win)},t.prototype.ready=function(){return this._readyPromise},Object.defineProperty(t.prototype,"isRTL",{get:function(){return"rtl"===this.doc.dir},enumerable:!0,configurable:!0}),t.prototype.getQueryParam=function(t){return O(this.win.location.href,t)},t.prototype.isLandscape=function(){return!this.isPortrait()},t.prototype.isPortrait=function(){return this.win.matchMedia&&this.win.matchMedia("(orientation: portrait)").matches},t.prototype.testUserAgent=function(t){var e=this.win.navigator;return!!(e&&e.userAgent&&e.userAgent.indexOf(t)>=0)},t.prototype.url=function(){return this.win.location.href},t.prototype.width=function(){return this.win.innerWidth},t.prototype.height=function(){return this.win.innerHeight},t.ngInjectableDef=Object(i.S)({factory:function(){return new t(Object(i.W)(o.c),Object(i.W)(i.z))},token:t,providedIn:"root"}),t}(),O=function(t,e){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var n=new RegExp("[\\?&]"+e+"=([^&#]*)").exec(t);return n?decodeURIComponent(n[1].replace(/\+/g," ")):null},x=function(t,e,n){e&&e.addEventListener(n,(function(e){t.next(null!=e?e.detail
1:void 0)}))},A=function(){function t(t,e,n,r){var i=this;this.location=e,this.serializer=n,this.router=r,this.direction=D,this.animated=R,this.guessDirection="forward",this.lastNavId=-1,r&&r.events.subscribe((function(t){if(t instanceof a.e){var e=t.restoredState?t.restoredState.navigationId:t.id;i.guessDirection=e<i.lastNavId?"back":"forward",i.guessAnimation=t.restoredState?void 0:i.guessDirection,i.lastNavId="forward"===i.guessDirection?t.id:e}})),t.backButton.subscribeWithPriority(0,(function(){return i.pop()}))}return t.prototype.navigateForward=function(t,e){return void 0===e&&(e={}),this.setDirection("forward",e.animated,e.animationDirection),this.navigate(t,e)},t.prototype.navigateBack=function(t,e){return void 0===e&&(e={}),this.setDirection("back",e.animated,e.animationDirection),this.navigate(t,e)},t.prototype.navigateRoot=function(t,e){return void 0===e&&(e={}),this.setDirection("root",e.animated,e.animationDirection),this.navigate(t,e)},t.prototype.back=function(t){return void 0===t&&(t={animated:!0,animationDirection:"back"}),this.setDirection("back",t.animated,t.animationDirection),this.location.back()},t.prototype.pop=function(){return Object(r.b)(this,void 0,void 0,(function(){var t;return Object(r.e)(this,(function(e){switch(e.label){case 0:t=this.topOutlet,e.label=1;case 1:return t?[4,t.pop()]:[3,3];case 2:return e.sent()?[3,3]:(t=t.parentOutlet,[3,1]);case 3:return[2]}}
1))}))},t.prototype.setDirection=function(t,e,n){this.direction=t,this.animated=P(t,e,n)},t.prototype.setTopOutlet=function(t){this.topOutlet=t},t.prototype.consumeTransition=function(){var t,e="root";return"auto"===this.direction?(e=this.guessDirection,t=this.guessAnimation):(t=this.animated,e=this.direction),this.direction=D,this.animated=R,{direction:e,animation:t}},t.prototype.navigate=function(t,e){if(Array.isArray(t))return this.router.navigate(t,e);var n=this.serializer.parse(t.toString());return void 0!==e.queryParams&&(n.queryParams=Object(r.a)({},e.queryParams)),void 0!==e.fragment&&(n.fragment=e.fragment),this.router.navigateByUrl(n,e)},t.ngInjectableDef=Object(i.S)({factory:function(){return new t(Object(i.W)(I),Object(i.W)(o.f),Object(i.W)(a.u),Object(i.W)(a.n,8))},token:t,providedIn:"root"}),t}(),P=function(t,e,n){if(!1!==e)return void 0!==n?n:"forward"===t||"back"===t?t:"root"===t&&!0===e?"forward":void 0},D="auto",R=void 0,N=function(t,e){var n=t.prototype;e.forEach((function(t){Object.defineProperty(n,t,{get:function(){return this.el[t]},set:function(e){var n=this;this.z.runOutsideAngular((function(){return n.el[t]=e}))}})}))},j=function(t,e){var n=t.prototype;e.forEach((function(t){n[t]=function(){var e=this,n=arguments;return this.z.runOutsideAngular((function(){return e.el[t].apply(e.el,n)}))}}))},M=function(t,e,n){n.forEach((function(n){return t[n]=Object(h.a)(e,n)}))},L=function(){return function(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement}}(),F=function(){return function(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement}}(),U=function(){return function(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement}}();N(U,["color","defaultHref","disabled","icon","mode","text","type"]);var V=function(){return function(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement,M(this,this.el,["ionBackdropTap"])}}();N(V,["stopPropagation","tappable","visible"]);var q=function(){return function(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement}}();N(q,["color","mode"]);var B=function(){return function(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement,M(this,this.el,["ionFocus","ionBlur"])}}();N(B,["buttonType","color","disabled","download","expand","fill","href","mode","rel","routerDirection","shape","size","strong","target","type"]);var W=function(){return function(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement}}();N(W,["collapse"]);var z=function(){return function(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement}}();N(z,["button","color","disabled","download","href","mode","rel","routerDirection","target","type"]);var H=function(){return function(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement}}();N(H,["mode"]);var $=function(){return function(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement}}();N($,["color","mode","translucent"]);var K=function(){return function(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement}}();N(K,["color","mode"]);var G=function(){return function(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement}}();N(G,["color","mode"]);var Q=function(){return function(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement,M(this,this.el,["ionChange","ionFocus","ionBlur"])}}();N(Q,["checked","color","disabled","indeterminate","mode","name","value"]);var Y=function(){return function(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement}}();N(Y,["color","mode","outline"]);var X=function(){return function(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement}}();N(X,["offset","offsetLg","offsetMd","offsetSm","offsetXl","offsetXs","pull","pullLg","pullMd","pullSm","pullXl","pullXs","push","pushLg","pushMd","pushSm","pushXl","pushXs","size","sizeLg","sizeMd","sizeSm","sizeXl","sizeXs"]);var J=function(){return function(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement,M(this,this.el,["ionScrollStart","ionScroll","ionScrollEnd"])}}();j(J,["getScrollElement","scrollToTop","scrollToBottom","scrollByPoint","scrollToPoint"]),N(J,["color","forceOverscroll","fullscreen","scrollEvents","scrollX","scrollY"]);var Z=function(){return function(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement,M(this,this.el,["ionCancel","ionChange","ionFocus","ionBlur"])}}();j(Z,["open"]),N(Z,["cancelText","dayNames","dayShortNames","dayValues","disabled","displayFormat","doneText","hourValues","max","min","minuteValues","mode","monthNames","monthShortNames","monthValues","name","pickerFormat","pickerOptions","placeholder","readonly","value","yearValues"]);var tt=function(){return function(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement}}();j(tt,["close"]),N(tt,["activated","edge","horizontal","vertical"]);var et=function(){return function(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement,M(this,this.el,["ionFocus","ionBlur"])}}();N(et,["activated","color","disabled","download","href","mode","rel","routerDirection","show","size","target","translucent","type"]);var nt=function(){return function(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement}}();N(nt,["activated","side"]);var rt=function(){return function(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement}}();N(rt,["mode","translucent"]);var it=function(){return function(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement}}();N(it,["fixed"]);var ot=function(){return function(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement}}();N(ot,["collapse","mode","translucent"]);var at=function(){return function(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement}}();N(at,["ariaLabel","color","flipRtl","icon","ios","lazy","md","mode","name","size","src"]);var st=function(){return function(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement,M(this,this.el,["ionImgWillLoad","ionImgDidLoad","ionError"])}}();N(st,["alt","src"]);var ut=function(){return function(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement,M(this,this.el,["ionInfinite"])}}();j(ut,["complete"]),N(ut,["disabled","position","threshold"]);var ct=function(){return function(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement}}();N(ct,["loadingSpinner","loadingText"]);var lt=function(){return function(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement,M(this,this.el,["ionInput","ionChange","ionBlur","ionFocus"])}}();
1j(lt,["setFocus","getInputElement"]),N(lt,["accept","autocapitalize","autocomplete","autocorrect","autofocus","clearInput","clearOnEdit","color","debounce","disabled","inputmode","max","maxlength","min","minlength","mode","multiple","name","pattern","placeholder","readonly","required","size","spellcheck","step","type","value"]);var ht=function(){return function(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement}}();N(ht,["button","color","detail","detailIcon","disabled","download","href","lines","mode","rel","routerDirection","target","type"]);var ft=function(){return function(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement}}();N(ft,["color","mode","sticky"]);var dt=function(){return function(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement}}(),pt=function(){return function(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement}}();N(pt,["color","disabled","download","expandable","href","mode","rel","target","type"]);var mt=function(){return function(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement,M(this,this.el,["ionSwipe"])}}();N(mt,["side"]);var yt=function(){return function(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement,M(this,this.el,["ionDrag"])}}();j(yt,["getOpenAmount","getSlidingRatio","open","close","closeOpened"]),N(yt,["disabled"]);var vt=function(){return function(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement}}();N(vt,["color","mode","position"]);var gt=function(){return function(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement}}();j(gt,["closeSlidingItems"]),N(gt,["inset","lines","mode"]);var bt=function(){return function(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement}}();N(bt,["color","mode"]);var wt=function(){return function(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement,M(this,this.el,["ionWillOpen","ionWillClose","ionDidOpen","ionDidClose"])}}();j(wt,["isOpen","isActive","open","close","toggle","setOpen"]),N(wt,["contentId","disabled","maxEdgeStart","menuId","side","swipeGesture","type"]);var _t=function(){return function(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement}}();N(_t,["autoHide","color","disabled","menu","type"]);var St=function(){return function(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement}}();N(St,["autoHide","menu"]);var Ct=function(){return function(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement,M(this,this.el,["ionNavWillChange","ionNavDidChange"])}}();j(Ct,["push","insert","insertPages","pop","popTo","popToRoot","removeIndex","setRoot","setPages","getActive","getByIndex","canGoBack","getPrevious"]),N(Ct,["animated","animation","root","rootParams","swipeGesture"]);var Et=function(){return function(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement}}();N(Et,["component","componentProps","routerDirection"]);var Tt=function(){return function(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement}}(),kt=function(){return function(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement}}();N(kt,["component","componentProps"]);var It=function(){return function(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement}}();N(It,["component","componentProps"]);var Ot=function(){return function(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement}}();N(Ot,["color","mode"]);var xt=function(){return function(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement}}();N(xt,["buffer","color","mode","reversed","type","value"]);var At=function(){return function(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement,M(this,this.el,["ionSelect","ionFocus","ionBlur"])}}();N(At,["checked","color","disabled","mode","name","value"]);var Pt=function(){return function(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement,M(this,this.el,["ionChange"])}}();N(Pt,["allowEmptySelection","name","value"]);var Dt=function(){return function(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement,M(this,this.el,["ionChange","ionFocus","ionBlur"])}}();N(Dt,["color","debounce","disabled","dualKnobs","max","min","mode","name","pin","snaps","step","ticks","value"]);var Rt=function(){return function(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement,M(this,this.el,["ionRefresh","ionPull","ionStart"])}}();j(Rt,["complete","cancel","getProgress"]),N(Rt,["closeDuration","disabled","pullFactor","pullMax","pullMin","snapbackDuration"]);var Nt=function(){return function(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement}}();N(Nt,["pullingIcon","pullingText","refreshingSpinner","refreshingText"]);var jt=function(){return function(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement}}(),Mt=function(){return function(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement,M(this,this.el,["ionItemReorder"])}}();j(Mt,["complete"]),N(Mt,["disabled"]);var Lt=function(){return function(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement}}();j(Lt,["addRipple"]),N(Lt,["type"]);var Ft=function(){return function(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement}}(),Ut=function(){return function(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement,M(this,this.el,["ionInput","ionChange","ionCancel","ionClear","
1ionBlur","ionFocus"])}}();j(Ut,["setFocus","getInputElement"]),N(Ut,["animated","autocomplete","autocorrect","cancelButtonIcon","cancelButtonText","clearIcon","color","debounce","disabled","inputmode","mode","placeholder","searchIcon","showCancelButton","spellcheck","type","value"]);var Vt=function(){return function(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement,M(this,this.el,["ionChange"])}}();N(Vt,["color","disabled","mode","scrollable","value"]);var qt=function(){return function(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement,M(this,this.el,["ionSelect"])}}();N(qt,["checked","disabled","layout","mode","type","value"]);var Bt=function(){return function(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement,M(this,this.el,["ionChange","ionCancel","ionFocus","ionBlur"])}}();j(Bt,["open"]),N(Bt,["cancelText","compareWith","disabled","interface","interfaceOptions","mode","multiple","name","okText","placeholder","selectedText","value"]);var Wt=function(){return function(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement}}();N(Wt,["disabled","selected","value"]);var zt=function(){return function(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement}}();N(zt,["animated","width"]);var Ht=function(){return function(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement}}(),$t=function(){return function(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement,M(this,this.el,["ionSlidesDidLoad","ionSlideTap","ionSlideDoubleTap","ionSlideWillChange","ionSlideDidChange","ionSlideNextStart","ionSlidePrevStart","ionSlideNextEnd","ionSlidePrevEnd","ionSlideTransitionStart","ionSlideTransitionEnd","ionSlideDrag","ionSlideReachStart","ionSlideReachEnd","ionSlideTouchStart","ionSlideTouchEnd"])}}();j($t,["update","updateAutoHeight","slideTo","slideNext","slidePrev","getActiveIndex","getPreviousIndex","length","isEnd","isBeginning","startAutoplay","stopAutoplay","lockSwipeToNext","lockSwipeToPrev","lockSwipes","getSwiper"]),N($t,["mode","options","pager","scrollbar"]);var Kt=function(){return function(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement}}();N(Kt,["color","duration","name","paused"]);var Gt=function(){return function(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement,M(this,this.el,["ionSplitPaneVisible"])}}();N(Gt,["contentId","disabled","when"]);var Qt=function(){return function(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement}}();N(Qt,["color","mode","selectedTab","translucent"]);var Yt=function(){return function(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement}}();N(Yt,["disabled","download","href","layout","mode","rel","selected","tab","target"]);var Xt=function(){return function(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement}}();N(Xt,["color","mode"]);var Jt=function(){return function(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement,M(this,this.el,["ionChange","ionInput","ionBlur","ionFocus"])}}();j(Jt,["setFocus","getInputElement"]),N(Jt,["autoGrow","autocapitalize","autofocus","clearOnEdit","color","cols","debounce","disabled","maxlength","minlength","mode","name","placeholder","readonly","required","rows","spellcheck","value","wrap"]);var Zt=function(){return function(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement}}(),te=function(){return function(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement}}();N(te,["color","size"]);var ee=function(){return function(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement,M(this,this.el,["ionChange","ionFocus","ionBlur"])}}();N(ee,["checked","color","disabled","mode","name","value"]);var ne=function(){return function(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement}}();N(ne,["color","mode"]);var re=function(){function t(){}return t.prototype.get=function(t,e){var n=oe();return n?n.get(t,e):null},t.prototype.getBoolean=function(t,e){var n=oe();return!!n&&n.getBoolean(t,e)},t.prototype.getNumber=function(t,e){var n=oe();return n?n.getNumber(t,e):0},t.prototype.set=function(t,e){console.warn("[DEPRECATION][Config]: The Config.set() method is deprecated and will be removed in Ionic Framework 6.0. Please see https://ionicframework.com/docs/angular/config for alternatives.");var n=oe();n&&n.set(t,e)},t.ngInjectableDef=Object(i.S)({factory:function(){return new t},token:t,providedIn:"root"}),t}(),ie=new i.p("USERCONFIG"),oe=function(){if("undefined"!=typeof window){var t=window.Ionic;if(t&&t.config)return t.config}return null},ae=function(){function t(t){void 0===t&&(t={}),this.data=t}return t.prototype.get=function(t){return this.data[t]},t}(),se=function(){function t(t,e){this.zone=t,this.appRef=e}return t.prototype.create=function(t,e,n){return new ue(t,e,n,this.appRef,this.zone)},t}(),ue=function(){function t(t,e,n,r,i){this.resolver=t,this.injector=e,this.location=n,this.appRef=r,this.zone=i,this.elRefMap=new WeakMap,this.elEventsMap=new WeakMap}return t.prototype.attachViewToDom=function(t,e,n,r){var i=this;return this.zone.run((function(){return new Promise((function(o){o(ce(i.zone,i.resolver,i.injector,i.location,i.appRef,i.elRefMap,i.elEventsMap,t,e,n,r))}))}))},t.prototype.removeViewFromDom=function(t,e){var n=this;return this.zone.run((function(){return new Promise((function(t){var r=n.elRefMap.get(e);if(r){r.destroy(),n.elRefMap.delete(e);var i=n.elEventsMap.get(e);i&&(i(),n.elEventsMap.delete(e))}t()}))}))},t}
1(),ce=function(t,e,n,r,o,a,s,u,c,l,h){var f=e.resolveComponentFactory(c),d=i.q.create({providers:de(l),parent:n}),p=r?r.createComponent(f,r.length,d):f.create(d),m=p.instance,y=p.location.nativeElement;if(l&&Object.assign(m,l),h)for(var v=0,g=h;v<g.length;v++)y.classList.add(g[v]);var b=he(t,m,y);return u.appendChild(y),r||o.attachView(p.hostView),p.changeDetectorRef.reattach(),a.set(y,p),s.set(y,b),y},le=[u.a,u.b,u.c,u.d,u.e],he=function(t,e,n){return t.run((function(){var t=le.filter((function(t){return"function"==typeof e[t]})).map((function(t){var r=function(n){return e[t](n.detail)};return n.addEventListener(t,r),function(){return n.removeEventListener(t,r)}}));return function(){return t.forEach((function(t){return t()}))}}))},fe=new i.p("NavParamsToken"),de=function(t){return[{provide:fe,useValue:t},{provide:ae,useFactory:pe,deps:[fe]}]},pe=function(t){return new ae(t)},me=function(t,e){return(t=t.filter((function(t){return t.stackId!==e.stackId}))).push(e),t},ye=function(t,e){var n=t.createUrlTree(["."],{relativeTo:e});return t.serializeUrl(n)},ve=function(t,e){if(t)for(var n=ge(e),r=0;r<n.length;r++){if(r>=t.length)return n[r];if(n[r]!==t[r])return}},ge=function(t){return t.split("/").map((function(t){return t.trim()})).filter((function(t){return""!==t}))},be=function(t){t&&(t.ref.destroy(),t.unlistenEvents())},we=function(){function t(t,e,n,r,i,o){this.containerEl=e,this.router=n,this.navCtrl=r,this.zone=i,this.location=o,this.views=[],this.skipTransition=!1,this.nextId=0,this.tabsPrefix=void 0!==t?ge(t):void 0}return t.prototype.createView=function(t,e){var n=ye(this.router,e),r=t&&t.location&&t.location.nativeElement,i=he(this.zone,t.instance,r);return{id:this.nextId++,stackId:ve(this.tabsPrefix,n),unlistenEvents:i,element:r,ref:t,url:n}},t.prototype.getExistingView=function(t){var e=ye(this.router,t),n=this.views.find((function(t){return t.url===e}));return n&&n.ref.changeDetectorRef.reattach(),n},t.prototype.setActive=function(t){var e=this,n=this.navCtrl.consumeTransition(),r=n.direction,i=n.animation,o=this.activeView,a=function(t,e){return!e||t.stackId!==e.stackId}(t,o);a&&(r="back",i=void 0);var s,u=this.views.slice(),c=this.router;c.getCurrentNavigation?s=c.getCurrentNavigation():c.navigations&&c.navigations.value&&(s=c.navigations.value),s&&s.extras&&s.extras.replaceUrl&&this.views.length>0&&this.views.splice(-1,1);var l=this.views.includes(t),h=this.insertView(t,r);return l||t.ref.changeDetectorRef.detectChanges(),this.zone.runOutsideAngular((function(){return e.wait((function(){return o&&o.ref.changeDetectorRef.detach(),t.ref.changeDetectorRef.reattach(),e.transition(t,o,i,e.canGoBack(1),!1).then((function(){return _e(t,h,u,e.location)})).then((function(){return{enteringView:t,direction:r,animation:i,tabSwitch:a}}))}))}))},t.prototype.canGoBack=function(t,e){return void 0===e&&(e=this.getActiveStackId()),this.getStack(e).length>t},t.prototype.pop=function(t,e){var n=this;return void 0===e&&(e=this.getActiveStackId()),this.zone.run((function(){var r=n.getStack(e);if(r.length<=t)return Promise.resolve(!1);var i=r[r.length-t-1],o=i.url,a=i.savedData;if(a){var s=a.get("primary");s&&s.route&&s.route._routerState&&s.route._routerState.snapshot&&s.route._routerState.snapshot.url&&(o=s.route._routerState.snapshot.url)}return n.navCtrl.navigateBack(o,i.savedExtras).then((function(){return!0}))}))},t.prototype.startBackTransition=function(){var t=this,e=this.activeView;if(e){var n=this.getStack(e.stackId),r=n[n.length-2];return this.wait((function(){return t.transition(r,e,"back",t.canGoBack(2),!0)}))}return Promise.resolve()},t.prototype.endBackTransition=function(t){t?(this.skipTransition=!0,this.pop(1)):this.activeView&&Se(this.activeView,this.views,this.views,this.location)},t.prototype.getLastUrl=function(t){var e=this.getStack(t);return e.length>0?e[e.length-1]:void 0},t.prototype.getActiveStackId=function(){return this.activeView?this.activeView.stackId:void 0},t.prototype.destroy=function(){this.containerEl=void 0,this.views.forEach(be),this.activeView=void 0,this.views=[]},t.prototype.getStack=function(t){return this.views.filter((function(e){return e.stackId===t}))},t.prototype.insertView=function(t,e){return this.activeView=t,this.views=function(t,e,n){return"root"===n?me(t,e):"forward"===n?function(t,e){return t.indexOf(e)>=0?t=t.filter((function(t){return t.stackId!==e.stackId||t.id<=e.id})):t.push(e),t}(t,e):function(t,e){return t.indexOf(e)>=0?t.filter((function(t){return t.stackId!==e.stackId||t.id<=e.id}
1)):me(t,e)}(t,e)}(this.views,t,e),this.views.slice()},t.prototype.transition=function(t,e,n,r,i){if(this.skipTransition)return this.skipTransition=!1,Promise.resolve(!1);if(e===t)return Promise.resolve(!1);var o=t?t.element:void 0,a=e?e.element:void 0,s=this.containerEl;return o&&o!==a&&(o.classList.add("ion-page"),o.classList.add("ion-page-invisible"),o.parentElement!==s&&s.appendChild(o),s.commit)?s.commit(o,a,{deepWait:!0,duration:void 0===n?0:void 0,direction:n,showGoBack:r,progressAnimation:i}):Promise.resolve(!1)},t.prototype.wait=function(t){return Object(r.b)(this,void 0,void 0,(function(){return Object(r.e)(this,(function(e){switch(e.label){case 0:return void 0===this.runningTask?[3,2]:[4,this.runningTask];case 1:e.sent(),this.runningTask=void 0,e.label=2;case 2:return[2,this.runningTask=t()]}}))}))},t}(),_e=function(t,e,n,r){return"function"==typeof requestAnimationFrame?new Promise((function(i){requestAnimationFrame((function(){Se(t,e,n,r),i()}))})):Promise.resolve()},Se=function(t,e,n,r){n.filter((function(t){return!e.includes(t)})).forEach(be),e.forEach((function(e){var n=r.path().split("?")[0].split("#")[0];if(e!==t&&e.url!==n){var i=e.element;i.setAttribute("aria-hidden","true"),i.classList.add("ion-page-hidden"),e.ref.changeDetectorRef.detach()}}))},Ce=function(){function t(t,e,n,r,o,s,u,c,l,h,d,p,m){this.parentContexts=t,this.location=e,this.resolver=n,this.config=s,this.navCtrl=u,this.parentOutlet=m,this.activated=null,this.activatedView=null,this._activatedRoute=null,this.proxyMap=new WeakMap,this.currentActivatedRoute$=new f.a(null),this.stackEvents=new i.m,this.activateEvents=new i.m,this.deactivateEvents=new i.m,this.nativeEl=l.nativeElement,this.name=r||a.g,this.tabsPrefix="true"===o?ye(h,p):void 0,this.stackCtrl=new we(this.tabsPrefix,this.nativeEl,h,u,d,c),t.onChildOutletCreated(this.name,this)}return Object.defineProperty(t.prototype,"animated",{set:function(t){this.nativeEl.animated=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"swipeGesture",{set:function(t){var e=this;this._swipeGesture=t,this.nativeEl.swipeHandler=t?{canStart:function(){return e.stackCtrl.canGoBack(1)},onStart:function(){return e.stackCtrl.startBackTransition()},onEnd:function(t){return e.stackCtrl.endBackTransition(t)}}:void 0},enumerable:!0,configurable:!0}),t.prototype.ngOnDestroy=function(){this.stackCtrl.destroy()},t.prototype.getContext=function(){return this.parentContexts.getContext(this.name)},t.prototype.ngOnInit=function(){var t=this;if(!this.activated){var e=this.getContext();e&&e.route&&this.activateWith(e.route,e.resolver||null)}this.nativeEl.componentOnReady&&this.nativeEl.componentOnReady().then((function(){void 0===t._swipeGesture&&(t.swipeGesture=t.config.getBoolean("swipeBackEnabled","ios"===t.nativeEl.mode))}))},Object.defineProperty(t.prototype,"isActivated",{get:function(){return!!this.activated},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"component",{get:function(){if(!this.activated)throw new Error("Outlet is not activated");return this.activated.instance},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"activatedRoute",{get:function(){if(!this.activated)throw new Error("Outlet is not activated");return this._activatedRoute},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"activatedRouteData",{get:function(){return this._activatedRoute?this._activatedRoute.snapshot.data:{}},enumerable:!0,configurable:!0}),t.prototype.detach=function(){throw new Error("incompatible reuse strategy")},t.prototype.attach=function(t,e){throw new Error("incompatible reuse strategy")},t.prototype.deactivate=function(){if(this.activated){if(this.activatedView){this.activatedView.savedData=new Map(this.getContext().children.contexts),this.activatedView.savedExtras={};var t=this.getContext();if(t.route){var e=t.route.snapshot;this.activatedView.savedExtras.queryParams=e.queryParams,this.activatedView.savedExtras.fragment=e.fragment}}var n=this.component;this.activatedView=null,this.activated=null,this._activatedRoute=null,this.deactivateEvents.emit(n)}},t.prototype.activateWith=function(t,e){var n,r=this;if(this.isActivated)throw new Error("Cannot activate an already activated outlet");this._activatedRoute=t;var i=this.stackCtrl.getExistingView(t);if(i){n=this.activated=i.ref;var o=i.savedData;o&&(this.getContext().children.contexts=o),this.updateActivatedRouteProxy(n.instance,t)}else{var a=(e=e||this.resolver).resolveComponentFactory(t._futureSnapshot.routeConfig.component),s=this.parentContexts.getOrCreateContext(this.name).children,u=new f.a(null),c=this.createActivatedRouteProxy(u,t),l=new Ee(c,s,this.location.injector);n=this.activated=this.location.createComponent(a,this.location.length,l),u.next(n.instance),i=this.stackCtrl.createView(this.activated,t),this.proxyMap.set(n.instance,c),this.currentActivatedRoute$.next({component:n.instance,activatedRoute:t})}this.activatedView=i,this.stackCtrl.setActive(i).then((function(t){r.navCtrl.setTopOutlet(r),r.activateEvents.emit(n.instance),r.stackEvents.emit(t)}))},t.prototype.canGoBack=function(t,e){return void 0===t&&(t=1),this.stackCtrl.canGoBack(t,e)},t.prototype.pop=function(t,e){return void 0===t&&(t=1),this.stackCtrl.pop(t,e)},t.prototype.getLastUrl=function(t){var e=this.stackCtrl.getLastUrl(t);return e?e.url:void 0},t.prototype.getActiveStackId=function(){return this.stackCtrl.getActiveStackId()},t.prototype.createActivatedRouteProxy=function(t,e){var n=new a.a;return n._futureSnapshot=e._futureSnapshot,n._routerState=e._routerState,n.snapshot=e.snapshot,n.outlet=e.outlet,n.component=e.component,n._paramMap=this.proxyObservable(t,"paramMap"),n._queryParamMap=this.proxyObservable(t,"queryParamMap"),n.url=this.proxyObservable(t,"url"),n.params=this.proxyObservable(t,"params"),n.queryParams=this.proxyObservable(t,"queryParams"),n.fragment=this.proxyObservable(t,"fragment"),n.data=this.proxyObservable(t,"data"),n},t.prototype.proxyObservable=function(t,e){var n=this;return t.pipe(Object(d.a)((function(t){return!!t})),Object(p.a)((function(t){return n.currentActivatedRoute$.pipe(Object(d.a)((function(e){return null!==e&&e.component===t})),Object(p.a)((function(t){return t&&t.activatedRoute[e]})),Object(m.a)())})))},t.prototype.updateActivatedRouteProxy=function(t,e){var n=this.proxyMap.get(t);if(!n)throw new Error("Could not find activated route proxy for view");n._futureSnapshot=e._futureSnapshot,n._routerState=e._routerState,n.snapshot=e.snapshot,n.outlet=e.outlet,n.component=e.component,this.currentActivatedRoute$.next({component:t,activatedRoute:e})},t}(),Ee=function(){function t(t,e,n){this.route=t,this.childContexts=e,this.parent=n}return t.prototype.get=function(t,e){return t===a.a?this.route:t===a.b?this.childContexts:this.parent.get(t,e)},t}(),Te=function(){function t(t){this.navCtrl=t,this.ionTabsWillChange=new i.m,this.ionTabsDidChange=new i.m}return t.prototype.onPageSelected=function(t){var e=t.enteringView.stackId;t.tabSwitch&&void 0!==e&&(this.tabBar&&(this.tabBar.selectedTab=e),this.ionTabsWillChange.emit({tab:e}),this.ionTabsDidChange.emit({tab:e}))},t.prototype.select=function(t){var e=this.outlet.getActiveStackId()===t,n=this.outlet.tabsPrefix+"/"+t,r=e?n:this.outlet.getLastUrl(t)||n;return this.navCtrl.navigateRoot(r,{animated:!0,animationDirection:"back"})},t.prototype.getSelected=function(){return this.outlet.getActiveStackId()},t}(),ke=function(){function t(t,e,n,r,i){this.locationStrategy=t,this.navCtrl=e,this.elementRef=n,this.router=r,this.routerLink=i,this.routerDirection="forward"}return t.prototype.ngOnInit=function(){this.updateTargetUrlAndHref()},t.prototype.ngOnChanges=function(){this.updateTargetUrlAndHref()},t.prototype.ngOnDestroy=function(){this.subscription&&this.subscription.unsubscribe()},t.prototype.updateTargetUrlAndHref=function(){if(this.routerLink){var t=this.locationStrategy.prepareExternalUrl(this.router.serializeUrl(this.routerLink.urlTree));this.elementRef.nativeElement.href=t}},t.prototype.onClick=function(t){this.navCtrl.setDirection(this.routerDirection),t.preventDefault()},t}(),Ie=function(){function t(t,e,n){this.z=t,this.iterableDiffers=e,this.refMap=new WeakMap,this.el=n.nativeElement,this.el.nodeRender=this.nodeRender.bind(this)}return t.prototype.ngOnChanges=function(t){if(this.trackBy&&"items"in t){var e=t.items.currentValue;if(void 0===this.differ&&null!=e)try{this.differ=this.iterableDiffers.find(e).create(this.trackBy)}catch(n){throw new Error("Cannot find a differ supporting object '"+e+"'. VirtualScroll only supports binding to Iterables such as Arrays.")}}}
1,t.prototype.ngDoCheck=function(){null!==(void 0!==this.differ&&this.items?this.differ.diff(this.items):null)&&this.checkRange(0)},t.prototype.nodeRender=function(t,e,n){var r=this;return this.z.run((function(){var i;if(t){var o=(i=r.refMap.get(t)).context;o.$implicit=e.value,o.index=e.index}else i=r.itmTmp.viewContainer.createEmbeddedView(r.getComponent(e.type),{$implicit:e.value,index:n},n),t=Oe(i),r.refMap.set(t,i);return i.detectChanges(),t}))},t.prototype.getComponent=function(t){switch(t){case"item":return this.itmTmp.templateRef;case"header":return this.hdrTmp.templateRef;case"footer":return this.ftrTmp.templateRef}throw new Error("template for virtual item was not provided")},t}(),Oe=function(t){for(var e=t.rootNodes,n=0;n<e.length;n++)if(1===e[n].nodeType)return e[n];throw new Error("virtual element was not created")};N(Ie,["approxItemHeight","approxHeaderHeight","approxFooterHeight","headerFn","footerFn","items","itemHeight","headerHeight","footerHeight"]),j(Ie,["checkEnd","checkRange","positionForItem"]);var xe=function(){return function(t){var e=t.nativeElement,n=Array.from(e.attributes).map((function(t){return t.name})).filter((function(t){return Ae.includes(t)}));n.length>0&&console.warn("[DEPRECATED][CSS] Ionic CSS attributes are deprecated.\nReplace:\n'<"+e.tagName.toLowerCase()+" "+n.map((function(t){return""+t})).join(" ")+">'\n\nWith:\n'<"+e.tagName.toLowerCase()+' class="'+n.map((function(t){return"ion-"+t})).join(" ")+"\">'\n      ")}}(),Ae=["align-self-start","align-self-end","align-self-center","align-self-stretch","align-self-baseline","align-self-auto","wrap-reverse","justify-content-start","justify-content-center","justify-content-end","justify-content-around","justify-content-between","justify-content-evenly","align-items-start","align-items-center","align-items-end","align-items-stretch","align-items-baseline","float-left","float-right","float-start","float-end","float-sm-left","float-sm-right","float-sm-start","float-sm-end","float-md-left","float-md-right","float-md-start","float-md-end","float-lg-left","float-lg-right","float-lg-start","float-lg-end","float-xl-left","float-xl-right","float-xl-start","float-xl-end","text-center","text-justify","text-start","text-end","text-left","text-right","text-nowrap","text-wrap","text-sm-center","text-sm-justify","text-sm-start","text-sm-end","text-sm-left","text-sm-right","text-sm-nowrap","text-sm-wrap","text-md-center","text-md-justify","text-md-start","text-md-end","text-md-left","text-md-right","text-md-nowrap","text-md-wrap","text-lg-center","text-lg-justify","text-lg-start","text-lg-end","text-lg-left","text-lg-right","text-lg-nowrap","text-lg-wrap","text-xl-center","text-xl-justify","text-xl-start","text-xl-end","text-xl-left","text-xl-right","text-xl-nowrap","text-xl-wrap","text-uppercase","text-lowercase","text-capitalize","text-sm-uppercase","text-sm-lowercase","text-sm-capitalize","text-md-uppercase","text-md-lowercase","text-md-capitalize","text-lg-uppercase","text-lg-lowercase","text-lg-capitalize","text-xl-uppercase","text-xl-lowercase","text-xl-capitalize","no-padding","padding","padding-top","padding-bottom","padding-start","padding-end","padding-vertical","padding-horizontal","no-margin","margin","margin-top","margin-bottom","margin-start","margin-end","margin-vertical","margin-horizontal"],Pe=function(){function t(t){this.ctrl=t}return t.prototype.create=function(t){return this.ctrl.create(t||{})},t.prototype.dismiss=function(t,e,n){return this.ctrl.dismiss(t,e,n)},t.prototype.getTop=function(){return this.ctrl.getTop()},t}(),De=function(t){function e(){return t.call(this,c.b)||this}return Object(r.d)(e,t),e.ngInjectableDef=Object(i.S)({factory:function(){return new e},token:e,providedIn:"root"}),e}(Pe),Re=function(t){function e(){return t.call(this,c.m)||this}return Object(r.d)(e,t),e.ngInjectableDef=Object(i.S)({factory:function(){return new e},token:e,providedIn:"root"}),e}(Pe),Ne=function(t){function e(e,n,r){var i=t.call(this,c.n)||this;return i.angularDelegate=e,i.resolver=n,i.injector=r,i}return Object(r.d)(e,t),e.prototype.create=function(e){return t.prototype.create.call(this,Object(r.a)({},e,{delegate:this.angularDelegate.create(this.resolver,this.injector)}))},e}(Pe),je=function(t){function e(e,n,r){var i=t.call(this,c.d)||this;return i.angularDelegate=e,i.resolver=n,i.injector=r,i}return Object(r.d)(e,t),e.prototype.create=function(e){return t.prototype.create.call(this,Object(r.a)({},e,{delegate:this.angularDelegate.create(this.resolver,this.injector)}))},e}(Pe),Me=function(){function t(){}return t.prototype.shouldDetach=function(t){return!1},t.prototype.shouldAttach=function(t){return!1},t.prototype.store=function(t,e){},t.prototype.retrieve=function(t){return null},t.prototype.shouldReuseRoute=function(t,e){if(t.routeConfig!==e.routeConfig)return!1;var n=t.params,r=e.params,i=Object.keys(n),o=Object.keys(r);if(i.length!==o.length)return!1;for(var a=0,s=i;a<s.length;a++){var u=s[a];if(r[u]!==n[u])return!1}return!0},t}
1(),Le=!1,Fe=function(t,e,i){return function(){var o=e.defaultView;if(o){Le&&console.warn("Ionic Angular was already initialized. Make sure IonicModule.forRoot() is just called once."),Le=!0,(o.Ionic=o.Ionic||{}).config=Object(r.a)({},t,{_zoneGate:function(t){return i.run(t)}});var a="__zone_symbol__addEventListener"in e.body?"__zone_symbol__addEventListener":"addEventListener";return function(){var t=window,e=[];return t.customElements&&(!t.Element||t.Element.prototype.closest&&t.Element.prototype.matches&&t.Element.prototype.remove)||e.push(n.e(138).then(n.t.bind(null,"QdDj",7))),"function"==typeof Object.assign&&Object.entries&&Array.prototype.find&&Array.prototype.includes&&String.prototype.startsWith&&String.prototype.endsWith&&(!t.NodeList||t.NodeList.prototype.forEach)&&t.fetch&&function(){try{var t=new URL("b","http://a");return t.pathname="c%20d","http://a/c%20d"===t.href&&t.searchParams}catch(e){return!1}}()&&"undefined"!=typeof WeakMap||e.push(n.e(137).then(n.t.bind(null,"t6o4",7))),Promise.all(e)}().then((function(){return t={exclude:["ion-tabs","ion-tab"],syncQueue:!0,raf:v,jmp:function(t){return i.runOutsideAngular(t)},ael:function(t,e,n,r){t[a](e,n,r)},rel:function(t,e,n,r){t.removeEventListener(e,n,r)}},Object(y.b)().then((function(){Object(y.h)(),Object(y.c)(JSON.parse('[[{"ios":"ion-select_3-ios","md":"ion-select_3-md"},[[2,"ion-select-popover",{"header":[1],"subHeader":[1,"sub-header"],"message":[1],"options":[16]},[[0,"ionSelect","onSelect"]]],[1,"ion-select",{"disabled":[4],"cancelText":[1,"cancel-text"],"okText":[1,"ok-text"],"placeholder":[1],"name":[1],"selectedText":[1,"selected-text"],"multiple":[4],"interface":[1],"interfaceOptions":[8,"interface-options"],"compareWith":[1,"compare-with"],"value":[1032],"isExpanded":[32],"open":[64]}],[1,"ion-select-option",{"disabled":[4],"selected":[4],"value":[8]}]]],[{"ios":"ion-menu_4-ios","md":"ion-menu_4-md"},[[1,"ion-menu-button",{"color":[1],"disabled":[4],"menu":[1],"autoHide":[4,"auto-hide"],"type":[1],"visible":[32]},[[32,"ionMenuChange","visibilityChanged"],[32,"ionSplitPaneVisible","visibilityChanged"]]],[1,"ion-menu",{"contentId":[1,"content-id"],"menuId":[1,"menu-id"],"type":[1025],"disabled":[1028],"side":[513],"swipeGesture":[4,"swipe-gesture"],"maxEdgeStart":[2,"max-edge-start"],"isPaneVisible":[32],"isEndSide":[32],"isOpen":[64],"isActive":[64],"open":[64],"close":[64],"toggle":[64],"setOpen":[64]},[[32,"ionSplitPaneVisible","onSplitPaneChanged"],[2,"click","onBackdropClick"]]],[0,"ion-menu-controller",{"open":[64],"close":[64],"toggle":[64],"enable":[64],"swipeGesture":[64],"isOpen":[64],"isEnabled":[64],"get":[64],"getOpen":[64],"getMenus":[64],"isAnimating":[64],"registerAnimation":[64]}],[1,"ion-menu-toggle",{"menu":[1],"autoHide":[4,"auto-hide"],"visible":[32]},[[32,"ionMenuChange","visibilityChanged"],[32,"ionSplitPaneVisible","visibilityChanged"]]]]],[{"ios":"ion-action-sheet-ios","md":"ion-action-sheet-md"},[[2,"ion-action-sheet",{"overlayIndex":[2,"overlay-index"],"keyboardClose":[4,"keyboard-close"],"enterAnimation":[16],"leaveAnimation":[16],"buttons":[16],"cssClass":[1,"css-class"],"backdropDismiss":[4,"backdrop-dismiss"],"header":[1],"subHeader":[1,"sub-header"],"translucent":[4],"animated":[4],"present":[64],"dismiss":[64],"onDidDismiss":[64],"onWillDismiss":[64]}]]],[{"ios":"ion-fab_3-ios","md":"ion-fab_3-md"},[[1,"ion-fab-button",{"color":[1],"activated":[4],"disabled":[4],"download":[1],"href":[1],"rel":[1],"routerDirection":[1,"router-direction"],"target":[1],"show":[4],"translucent":[4],"type":[1],"size":[1]}],[1,"ion-fab",{"horizontal":[1],"vertical":[1],"edge":[4],"activated":[1028],"close":[64]}],[1,"ion-fab-list",{"activated":[4],"side":[1]}]]],[{"ios":"ion-refresher_2-ios","md":"ion-refresher_2-md"},[[0,"ion-refresher-content",{"pullingIcon":[1025,"pulling-icon"],"pullingText":[1,"pulling-text"],"refreshingSpinner":[1025,"refreshing-spinner"],"refreshingText":[1,"refreshing-text"]}],[0,"ion-refresher",{"pullMin":[2,"pull-min"],"pullMax":[2,"pull-max"],"closeDuration":[1,"close-duration"],"snapbackDuration":[1,"snapback-duration"],"pullFactor":[2,"pull-factor"],"disabled":[4],"state":[32],"complete":[64],"cancel":[64],"getProgress":[64]}]]],[{"ios":"ion-alert-ios","md":"ion-alert-md"},[[2,"ion-alert",{"overlayIndex":[2,"overlay-index"],"keyboardClose":[4,"keyboard-close"],"enterAnimation":[16],"leaveAnimation":[16],"cssClass":[1,"css-class"],"header":[1],"subHeader":[1,"sub-header"],"message":[1],"buttons":[16],"inputs":[1040],"backdropDismiss":[4,"backdrop-dismiss"],"translucent":[4],"animated":[4],"present":[64],"dismiss":[64],"onDidDismiss":[64],"onWillDismiss":[64]}]]],[{"ios":"ion-back-button-ios","md":"ion-back-button-md"},[[2,"ion-back-button",{"color":[1],"defaultHref":[1,"default-href"],"disabled":[516],"icon":[1],"text":[1],"type":[1]}]]],[{"ios":"ion-loading-ios","md":"ion-loading-md"},[[2,"ion-loading",{"overlayIndex":[2,"overlay-index"],"keyboardClose":[4,"keyboard-close"],"enterAnimation":[16],"leaveAnimation":[16],"message":[1],"cssClass":[1,"css-class"],"duration":[2],"backdropDismiss":[4,"backdrop-dismiss"],"showBackdrop":[4,"show-backdrop"],"spinner":[1025],"translucent":[4],"animated":[4],"present":[64],"dismiss":[64],"onDidDismiss":[64],"onWillDismiss":[64]}]]],[{"ios":"ion-toast-ios","md":"ion-toast-md"},[[1,"ion-toast",{"overlayIndex":[2,"overlay-index"],"color":[1],"enterAnimation":[16],"leaveAnimation":[16],"cssClass":[1,"css-class"],"duration":[2],"header":[1],"message":[1],"keyboardClose":[4,"keyboard-close"],"position":[1],"showCloseButton":[4,"show-close-button"],"closeButtonText":[1,"close-button-text"],"buttons":[16],"translucent":[4],"animated":[4],"present":[64],"dismiss":[64],"onDidDismiss":[64],"onWillDismiss":[64]}]]],[{"ios":"ion-card_5-ios","md":"ion-card_5-md"},[[6,"ion-card",{"color":[1],"button":[4],"type":[1],"disabled":[4],"download":[1],"href":[1],"rel":[1],"routerDirection":[1,"router-direction"],"target":[1]}],[0,"ion-card-content"],[1,"ion-card-header",{"color":[1],"translucent":[4]}],[1,"ion-card-subtitle",{"color":[1]}],[1,"ion-card-title",{"color":[1]}]]],[{"ios":"ion-item-option_3-ios","md":"ion-item-option_3-md"},[[1,"ion-item-option",{"color":[1],"disabled":[4],"download":[1],"expandable":[4],"href":[1],"rel":[1],"target":[1],"type":[1]}],[0,"ion-item-options",{"side":[1],"fireSwipeEvent":[64]}],[0,"ion-item-sliding",{"disabled":[4],"state":[32],"getOpenAmount":[64],"getSlidingRatio":[64],"open":[64],"close":[64],"closeOpened":[64]}]]],[{"ios":"ion-infinite-scroll_2-ios","md":"ion-infinite-scroll_2-md"},[[0,"ion-infinite-scroll-content",{"loadingSpinner":[1025,"loading-spinner"],"loadingText":[1,"loading-text"]}],[0,"ion-infinite-scroll",{"threshold":[1],"disabled":[4],"position":[1],"isLoading":[32],"complete":[64]}]]],[{"ios":"ion-reorder_2-ios","md":"ion-reorder_2-md"},[[1,"ion-reorder",null,[[2,"click","onClick"]]],[0,"ion-reorder-group",{"disabled":[4],"state":[32],"complete":[64]}]]],[{"ios":"ion-segment_2-ios","md":"ion-segment_2-md"},[[1,"ion-segment-button",{"checked":[1028],"disabled":[4],"layout":[1],"type":[1],"value":[1]}],[2,"ion-segment",{"color":[1],"disabled":[4],"scrollable":[4],"value":[1025]},[[0,"ionSelect","segmentClick"]]]]],[{"ios":"ion-tab-bar_2-ios","md":"ion-tab-bar_2-md"},[[1,"ion-tab-button",{"disabled":[4],"download":[1],"href":[1],"rel":[1],"layout":[1025],"selected":[1028],"tab":[1],"target":[1]},[[16,"ionTabBarChanged","onTabBarChanged"]]],[1,"ion-tab-bar",{"color":[1],"selectedTab":[1,"selected-tab"],"translucent":[4],"keyboardVisible":[32]},[[8,"keyboardWillHide","onKeyboardWillHide"],[8,"keyboardWillShow","onKeyboardWillShow"]]]]],[{"ios":"ion-chip-ios","md":"ion-chip-md"},[[1,"ion-chip",{"color":[1],"outline":[4]}]]],[{"ios":"ion-modal-ios","md":"ion-modal-md"},[[2,"ion-modal",{"overlayIndex":[2,"overlay-index"],"delegate":[16],"keyboardClose":[4,"keyboard-close"],"enterAnimation":[16],"leaveAnimation":[16],"component":[1],"componentProps":[16],"cssClass":[1,"css-class"],"backdropDismiss":[4,"backdrop-dismiss"],"showBackdrop":[4,"show-backdrop"],"animated":[4],"present":[64],"dismiss":[64],"onDidDismiss":[64],"onWillDismiss":[64]}
1]]],[{"ios":"ion-popover-ios","md":"ion-popover-md"},[[2,"ion-popover",{"delegate":[16],"overlayIndex":[2,"overlay-index"],"enterAnimation":[16],"leaveAnimation":[16],"component":[1],"componentProps":[16],"keyboardClose":[4,"keyboard-close"],"cssClass":[1,"css-class"],"backdropDismiss":[4,"backdrop-dismiss"],"event":[8],"showBackdrop":[4,"show-backdrop"],"translucent":[4],"animated":[4],"present":[64],"dismiss":[64],"onDidDismiss":[64],"onWillDismiss":[64]}]]],[{"ios":"ion-searchbar-ios","md":"ion-searchbar-md"},[[2,"ion-searchbar",{"color":[1],"animated":[4],"autocomplete":[1],"autocorrect":[1],"cancelButtonIcon":[1,"cancel-button-icon"],"cancelButtonText":[1,"cancel-button-text"],"clearIcon":[1,"clear-icon"],"debounce":[2],"disabled":[4],"inputmode":[1],"placeholder":[1],"searchIcon":[1,"search-icon"],"showCancelButton":[8,"show-cancel-button"],"spellcheck":[4],"type":[1],"value":[1025],"focused":[32],"noAnimate":[32],"setFocus":[64],"getInputElement":[64]}]]],["ion-action-sheet-controller_8",[[0,"ion-action-sheet-controller",{"create":[64],"dismiss":[64],"getTop":[64]}],[0,"ion-alert-controller",{"create":[64],"dismiss":[64],"getTop":[64]}],[1,"ion-anchor",{"color":[1],"href":[1],"rel":[1],"routerDirection":[1,"router-direction"]}],[0,"ion-loading-controller",{"create":[64],"dismiss":[64],"getTop":[64]}],[0,"ion-modal-controller",{"create":[64],"dismiss":[64],"getTop":[64]}],[0,"ion-picker-controller",{"create":[64],"dismiss":[64],"getTop":[64]}],[0,"ion-popover-controller",{"create":[64],"dismiss":[64],"getTop":[64]}],[0,"ion-toast-controller",{"create":[64],"dismiss":[64],"getTop":[64]}]]],[{"ios":"ion-app_8-ios","md":"ion-app_8-md"},[[0,"ion-app"],[2,"ion-buttons",{"collapse":[4]}],[1,"ion-content",{"color":[1],"fullscreen":[4],"forceOverscroll":[1028,"force-overscroll"],"scrollX":[4,"scroll-x"],"scrollY":[4,"scroll-y"],"scrollEvents":[4,"scroll-events"],"getScrollElement":[64],"scrollToTop":[64],"scrollToBottom":[64],"scrollByPoint":[64],"scrollToPoint":[64]},[[2,"click","onClick"]]],[0,"ion-footer",{"translucent":[4]}],[0,"ion-header",{"collapse":[1],"translucent":[4]}],[1,"ion-router-outlet",{"mode":[1025],"delegate":[16],"animated":[4],"animation":[16],"swipeHandler":[16],"commit":[64],"setRouteId":[64],"getRouteId":[64]}],[1,"ion-title",{"color":[1],"size":[1]}],[1,"ion-toolbar",{"color":[1]},[[0,"ionStyle","childrenStyle"]]]]],["ion-nav_5",[[1,"ion-nav",{"delegate":[16],"swipeGesture":[1028,"swipe-gesture"],"animated":[4],"animation":[16],"rootParams":[16],"root":[1],"push":[64],"insert":[64],"insertPages":[64],"pop":[64],"popTo":[64],"popToRoot":[64],"removeIndex":[64],"setRoot":[64],"setPages":[64],"setRouteId":[64],"getRouteId":[64],"getActive":[64],"getByIndex":[64],"canGoBack":[64],"getPrevious":[64]}],[0,"ion-nav-link",{"component":[1],"componentProps":[16],"routerDirection":[1,"router-direction"]}],[0,"ion-nav-pop"],[0,"ion-nav-push",{"component":[1],"componentProps":[16]}],[0,"ion-nav-set-root",{"component":[1],"componentProps":[16]}]]],["ion-route_4",[[0,"ion-route",{"url":[1],"component":[1],"componentProps":[16]}],[0,"ion-route-redirect",{"from":[1],"to":[1]}],[0,"ion-router",{"root":[1],"useHash":[4,"use-hash"],"push":[64],"back":[64],"printDebug":[64],"navChanged":[64]},[[8,"popstate","onPopState"],[4,"ionBackButton","onBackButton"]]],[1,"ion-router-link",{"color":[1],"href":[1],"rel":[1],"routerDirection":[1,"router-direction"],"target":[1]}]]],[{"ios":"ion-avatar_3-ios","md":"ion-avatar_3-md"},[[1,"ion-avatar"],[1,"ion-badge",{"color":[1]}],[1,"ion-thumbnail"]]],["ion-col_3",[[1,"ion-col",{"offset":[1],"offsetXs":[1,"offset-xs"],"offsetSm":[1,"offset-sm"],"offsetMd":[1,"offset-md"],"offsetLg":[1,"offset-lg"],"offsetXl":[1,"offset-xl"],"pull":[1],"pullXs":[1,"pull-xs"],"pullSm":[1,"pull-sm"],"pullMd":[1,"pull-md"],"pullLg":[1,"pull-lg"],"pullXl":[1,"pull-xl"],"push":[1],"pushXs":[1,"push-xs"],"pushSm":[1,"push-sm"],"pushMd":[1,"push-md"],"pushLg":[1,"push-lg"],"pushXl":[1,"push-xl"],"size":[1],"sizeXs":[1,"size-xs"],"sizeSm":[1,"size-sm"],"sizeMd":[1,"size-md"],"sizeLg":[1,"size-lg"],"sizeXl":[1,"size-xl"]}
1,[[9,"resize","onResize"]]],[1,"ion-grid",{"fixed":[4]}],[1,"ion-row"]]],[{"ios":"ion-slide_2-ios","md":"ion-slide_2-md"},[[0,"ion-slide"],[4,"ion-slides",{"options":[8],"pager":[4],"scrollbar":[4],"update":[64],"updateAutoHeight":[64],"slideTo":[64],"slideNext":[64],"slidePrev":[64],"getActiveIndex":[64],"getPreviousIndex":[64],"length":[64],"isEnd":[64],"isBeginning":[64],"startAutoplay":[64],"stopAutoplay":[64],"lockSwipeToNext":[64],"lockSwipeToPrev":[64],"lockSwipes":[64],"getSwiper":[64]}]]],["ion-tab_2",[[1,"ion-tab",{"active":[1028],"delegate":[16],"tab":[1],"component":[1],"setActive":[64]}],[1,"ion-tabs",{"useRouter":[1028,"use-router"],"selectedTab":[32],"select":[64],"getTab":[64],"getSelected":[64],"setRouteId":[64],"getRouteId":[64]}]]],[{"ios":"ion-checkbox-ios","md":"ion-checkbox-md"},[[1,"ion-checkbox",{"color":[1],"name":[1],"checked":[1028],"indeterminate":[1028],"disabled":[4],"value":[1]}]]],["ion-img",[[1,"ion-img",{"alt":[1],"src":[1],"loadSrc":[32],"loadError":[32]}]]],[{"ios":"ion-input-ios","md":"ion-input-md"},[[2,"ion-input",{"color":[1],"accept":[1],"autocapitalize":[1],"autocomplete":[
11],"autocorrect":[1],"autofocus":[4],"clearInput":[4,"clear-input"],"clearOnEdit":[4,"clear-on-edit"],"debounce":[2],"disabled":[4],"inputmode":[1],"max":[1],"maxlength":[2],"min":[1],"minlength":[2],"multiple":[4],"name":[1],"pattern":[1],"placeholder":[1],"readonly":[4],"required":[4],"spellcheck":[4],"step":[1],"size":[2],"type":[1],"value":[1025],"hasFocus":[32],"setFocus":[64],"getInputElement":[64]}]]],[{"ios":"ion-progress-bar-ios","md":"ion-progress-bar-md"},[[1,"ion-progress-bar",{"type":[1],"reversed":[4],"value":[2],"buffer":[2],"color":[1]}]]],[{"ios":"ion-range-ios","md":"ion-range-md"},[[1,"ion-range",{"color":[1],"debounce":[2],"name":[1],"dualKnobs":[4,"dual-knobs"],"min":[2],"max":[2],"pin":[4],"snaps":[4],"step":[2],"ticks":[4],"disabled":[4],"value":[1026],"ratioA":[32],"ratioB":[32],"pressedKnob":[32]}]]],[{"ios":"ion-split-pane-ios","md":"ion-split-pane-md"},[[0,"ion-split-pane",{"contentId":[1,"content-id"],"disabled":[4],"when":[8],"visible":[32]}]]],["ion-text",[[1,"ion-text",{"color":[1]}]]],[{"ios":"ion-textarea-ios","md":"ion-textarea-md"},[[2,"ion-textarea",{"color":[1],"autocapitalize":[1],"autofocus":[4],"clearOnEdit":[1028,"clear-on-edit"],"debounce":[2],"disabled":[4],"maxlength":[2],"minlength":[2],"name":[1],"placeholder":[1],"readonly":[4],"required":[4],"spellcheck":[4],"cols":[2],"rows":[2],"wrap":[1],"autoGrow":[4,"auto-grow"],"value":[1025],"hasFocus":[32],"setFocus":[64],"getInputElement":[64]}]]],[{"ios":"ion-toggle-ios","md":"ion-toggle-md"},[[1,"ion-toggle",{"color":[1],"name":[1],"checked":[1028],"disabled":[4],"value":[1],"activated":[32]}]]],["ion-virtual-scroll",[[0,"ion-virtual-scroll",{"approxItemHeight":[2,"approx-item-height"],"approxHeaderHeight":[2,"approx-header-height"],"approxFooterHeight":[2,"approx-footer-height"],"headerFn":[16],"footerFn":[16],"items":[16],"itemHeight":[16],"headerHeight":[16],"footerHeight":[16],"renderItem":[16],"renderHeader":[16],"renderFooter":[16],"nodeRender":[16],"domRender":[16],"totalHeight":[32],"positionForItem":[64],"checkRange":[64],"checkEnd":[64]},[[9,"resize","onResize"]]]]],[{"ios":"ion-datetime_3-ios","md":"ion-datetime_3-md"},[[2,"ion-picker",{"overlayIndex":[2,"overlay-index"],"keyboardClose":[4,"keyboard-close"],"enterAnimation":[16],"leaveAnimation":[16],"buttons":[16],"columns":[16],"cssClass":[1,"css-class"],"duration":[2],"showBackdrop":[4,"show-backdrop"],"backdropDismiss":[4,"backdrop-dismiss"],"animated":[4],"presented":[32],"present":[64],"dismiss":[64],"onDidDismiss":[64],"onWillDismiss":[64],"getColumn":[64]}],[1,"ion-datetime",{"name":[1],"disabled":[4],"readonly":[4],"min":[1025],"max":[1025],"displayFormat":[1,"display-format"],"pickerFormat":[1,"picker-format"],"cancelText":[1,"cancel-text"],"doneText":[1,"done-text"],"yearValues":[8,"year-values"],"monthValues":[8,"month-values"],"dayValues":[8,"day-values"],"hourValues":[8,"hour-values"],"minuteValues":[8,"minute-values"],"monthNames":[1,"month-names"],"monthShortNames":[1,"month-short-names"],"dayNames":[1,"day-names"],"dayShortNames":[1,"day-short-names"],"pickerOptions":[16],"placeholder":[1],"value":[1025],"isExpanded":[32],"open":[64]}],[0,"ion-picker-column",{"col":[16]}]]],[{"ios":"ion-radio_2-ios","md":"ion-radio_2-md"},[[1,"ion-radio",{"color":[1],"name":[1],"disabled":[4],"checked":[1028],"value":[1032]}],[0,"ion-radio-group",{"allowEmptySelection":[4,"allow-empty-selection"],"name":[1],"value":[1032]}]]],["ion-spinner",[[1,"ion-spinner",{"color":[1],"duration":[2],"name":[1],"paused":[4]}]]],[{"ios":"ion-backdrop-ios","md":"ion-backdrop-md"},[[1,"ion-backdrop",{"visible":[4],"tappable":[4],"stopPropagation":[4,"stop-propagation"]},[[2,"touchstart","onTouchStart"],[2,"click","onMouseDown"],[2,"mousedown","onMouseDown"]]]]],["ion-ripple-effect",[[1,"ion-ripple-effect",{"type":[1],"addRipple":[64]}]]],[{"ios":"ion-button_2-ios","md":"ion-button_2-md"},[[1,"ion-button",{"color":[1],"buttonType":[1025,"button-type"],"disabled":[516],"expand":[513],"fill":[1537],"routerDirection":[1,"router-direction"],"download":[1],"href":[1],"rel":[1],"shape":[513],"size":[513],"strong":[4],"target":[1],"type":[1]}],[1,"ion-icon",{"color":[1],"ariaLabel":[1537,"aria-label"],"ios":[1],"md":[1],"flipRtl":[4,"flip-rtl"],"name":[1],"src":[1],"icon":[8],"size":[1],"lazy":[4],"svgContent":[32],"isVisible":[32]}]]],[{"ios":"ion-item_8-ios","md":"ion-item_8-md"},[[1,"ion-item-divider",{"color":[1],"sticky":[4]}],[0,"ion-item-group"],[1,"ion-note",{"color":[1]}],[1,"ion-skeleton-text",{"animated":[4],"width":[1]}],[1,"ion-item",{"color":[1],"button":[4],"detail":[4],"detailIcon":[1,"detail-icon"],"disabled":[4],"download":[1],"href":[1],"rel":[1],"lines":[1],"routerDirection":[1,"router-direction"],"target":[1],"type":[1],"multipleInputs":[32]}
1,[[0,"ionStyle","itemStyle"]]],[2,"ion-label",{"color":[1],"position":[1],"noAnimate":[32]}],[0,"ion-list",{"lines":[1],"inset":[4],"closeSlidingItems":[64]}],[1,"ion-list-header",{"color":[1]}]]]]'),t)}));var t}))}}},Ue=function(){function t(){}return t.forRoot=function(e){return{ngModule:t,providers:[{provide:ie,useValue:e},{provide:i.d,useFactory:Fe,multi:!0,deps:[ie,o.c,i.z]}]}},t}()},ZhmJ:function(t,e,n){n("u00B")("observable")},Zn8D:function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n("psW0"),i=n("mChF");function o(t){return void 0===t&&(t=Number.POSITIVE_INFINITY),Object(r.a)(i.a,t)}},Zp05:function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},a5Eg:function(t,e,n){var r=n("g0Mr"),i=n("j/6h"),o=n("ifzb")("IE_PROTO"),a=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=i(t),r(t,o)?t[o]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?a:null}},ad02:function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r=n("mrSG"),i=n("FFOo"),o=n("Ehmk"),a=n("eihs");function s(t,e){return function(n){return n.lift(new u(t,e))}}var u=function(){function t(t,e){this.compare=t,this.keySelector=e}return t.prototype.call=function(t,e){return e.subscribe(new c(t,this.compare,this.keySelector))},t}(),c=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.keySelector=r,i.hasKey=!1,"function"==typeof n&&(i.compare=n),i}return r.d(e,t),e.prototype.compare=function(t,e){return t===e},e.prototype._next=function(t){var e=t;if(this.keySelector&&(e=Object(o.a)(this.keySelector)(t))===a.a)return this.destination.error(a.a.e);var n=!1;if(this.hasKey){if((n=Object(o.a)(this.compare)(this.key,e))===a.a)return this.destination.error(a.a.e)}else this.hasKey=!0;!1===Boolean(n)&&(this.key=e,this.destination.next(t))},e}(i.a)},"ae0+":function(t,e,n){"use strict";n.d(e,"a",(function(){return K})),n.d(e,"b",(function(){return U})),n.d(e,"c",(function(){return Ot})),n.d(e,"d",(function(){return Dt})),n.d(e,"e",(function(){return xt})),n.d(e,"f",(function(){return Pt})),n.d(e,"g",(function(){return j})),n.d(e,"h",(function(){return Rt})),n.d(e,"i",(function(){return H})),n.d(e,"j",(function(){return At})),n.d(e,"k",(function(){return Tt})),n.d(e,"l",(function(){return C})),n.d(e,"m",(function(){return M}));var r,i,o,a,s=n("mrSG"),u=n("ttJE"),c=0,l=!1,h=!1,f=!1,d=!1,p=!1,m=window,y=document,v={$flags$:0,$resourcesUrl$:"",jmp:function(t){return t()},raf:function(t){return requestAnimationFrame(t)},ael:function(t,e,n,r){return t.addEventListener(e,n,r)},rel:function(t,e,n,r){return t.removeEventListener(e,n,r)}},g=function(){return!!y.documentElement.attachShadow}(),b=function(){var t=!1;try{y.addEventListener("e",null,Object.defineProperty({},"passive",{get:function(){t=!0}}))}catch(e){}return t}(),w=function(){try{return new CSSStyleSheet,!0}catch(t){}return!1}(),_=new WeakMap,S=function(t){return _.get(t)},C=function(t,e){return _.set(e.$lazyInstance$=t,e)},E=function(t,e){return e in t},T=function(t){return console.error(t)},k=new Map,I=new Map,O=[],x=[],A=[],P=function(t,e){return function(n){t.push(n),l||(l=!0,e&&4&v.$flags$?N(R):v.raf(R))}},D=function(t,e){for(var n=0,r=0;n<t.length&&(r=performance.now())<e;)try{t[n++](r)}catch(i){T(i)}n===t.length?t.length=0:0!==n&&t.splice(0,n)},R=function(){c++,function(t){for(var e=0;e<t.length;e++)try{t[e](performance.now())}catch(n){T(n)}t.length=0}(O);var t=2==(6&v.$flags$)?performance.now()+10*Math.ceil(c*(1/22)):1/0;D(x,t),D(A,t),x.length>0&&(A.push.apply(A,x),x.length=0),(l=O.length+x.length+A.length>0)?v.raf(R):c=0},N=function(t){return Promise.resolve().then(t)},j=P(O,!1),M=P(x,!0),L={},F=function(t){return"object"==(t=typeof t)||"function"===t},U=function(){return m.CSS&&m.CSS.supports&&m.CSS.supports("color","var(--c)")?Promise.resolve():n.e(54).then(n.t.bind(null,"GhCX",7)).then((function(){if(v.$cssShim$=m.__stencil_cssshim,v.$cssShim$)return v.$cssShim$.initShim()}))},V="http://www.w3.org/1999/xlink",q=new WeakMap,B=function(t,e,n){var r=I.get(t);w&&n?(r=r||new CSSStyleSheet).replace(e):r=e,I.set(t,r)},W=function(t,e,n,r){var i=z(e.$tagName$,n),o=I.get(i);if(t=11===t.nodeType?t:y,o||(i=z(e.$tagName$),o=I.get(i)),o)if("string"==typeof o){var a=q.get(t=t.head||t),u=void 0;if(a||q.set(t,a=new Set),!a.has(i)){if(t.host&&(u=t.firstElementChild)&&"STYLE"===u.tagName)u.innerHTML=o;else{if(v.$cssShim$){var c=(u=v.$cssShim$.createHostStyle(r,i,o,!!(10&e.$flags$)))["s-sc"];c&&(i=c,a=null)}else(u=y.createElement("style")).setAttribute("data-styles",""),u.innerHTML=o;t.insertBefore(u,t.querySelector("link"))}a&&a.add(i)}}else t.adoptedStyleSheets.includes(o)||(t.adoptedStyleSheets=Object(s.j)(t.adoptedStyleSheets,[o]));return i},z=function(t,e){return"sc-"+(e?t+"-"+e:t)},H=function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];
1var i=null,o=null,a=null,s=!1,u=!1,c=[],l=function(e){for(var n=0;n<e.length;n++)i=e[n],Array.isArray(i)?l(i):null!=i&&"boolean"!=typeof i&&((s="function"!=typeof t&&!F(i))&&(i=String(i)),s&&u?c[c.length-1].$text$+=i:c.push(s?$(null,i):i),u=s)};if(l(n),e){e.key&&(o=e.key),e.name&&(a=e.name);var h=e.className||e.class;h&&(e.class="object"!=typeof h?h:Object.keys(h).filter((function(t){return h[t]})).join(" "))}if("function"==typeof t)return t(e,c,G);var f=$(t,null);return f.$attrs$=e,c.length>0&&(f.$children$=c),f.$key$=o,f.$name$=a,f},$=function(t,e){return{$flags$:0,$tag$:t,$text$:e,$elm$:null,$children$:null,$attrs$:null,$key$:null,$name$:null}},K={},G={forEach:function(t,e){return t.map(Q).forEach(e)},map:function(t,e){return t.map(Q).map(e).map(Y)}},Q=function(t){return{vattrs:t.$attrs$,vchildren:t.$children$,vkey:t.$key$,vname:t.$name$,vtag:t.$tag$,vtext:t.$text$}},Y=function(t){var e=$(t.vtag,t.vtext);return e.$attrs$=t.vattrs,e.$children$=t.vchildren,e.$key$=t.vkey,e.$name$=t.vname,e},X=function(t,e,n,r,i,o){if(n!==r){var a=E(t,e),s=e.toLowerCase();if("class"===e){var u=t.classList,c=Z(n),l=Z(r);u.remove.apply(u,c.filter((function(t){return t&&!l.includes(t)}))),u.add.apply(u,l.filter((function(t){return t&&!c.includes(t)})))}else if("style"===e){for(var h in n)r&&null!=r[h]||(h.includes("-")?t.style.removeProperty(h):t.style[h]="");for(var h in r)n&&r[h]===n[h]||(h.includes("-")?t.style.setProperty(h,r[h]):t.style[h]=r[h])}else if("key"===e);else if("ref"===e)r&&r(t);else if(a||"o"!==e[0]||"n"!==e[1]){var f=F(r);if((a||f&&null!==r)&&!i)try{if(t.tagName.includes("-"))t[e]=r;else{var d=null==r?"":r;null!=n&&t[e]==d||(t[e]=d)}}catch(y){}var p=!1;s!==(s=s.replace(/^xlink\:?/,""))&&(e=s,p=!0),null==r||!1===r?p?t.removeAttributeNS(V,e):t.removeAttribute(e):(!a||4&o||i)&&!f&&(r=!0===r?"":r,p?t.setAttributeNS(V,e,r):t.setAttribute(e,r))}else e="-"===e[2]?e.slice(3):E(m,s)?s.slice(2):s[2]+e.slice(3),n&&v.rel(t,e,n,!1),r&&v.ael(t,e,r,!1)}},J=/\s/,Z=function(t){return t?t.split(J):[]},tt=function(t,e,n,r){var i=11===e.$elm$.nodeType&&e.$elm$.host?e.$elm$.host:e.$elm$,o=t&&t.$attrs$||L,a=e.$attrs$||L;for(r in o)r in a||X(i,r,o[r],void 0,n,e.$flags$);for(r in a)X(i,r,o[r],a[r],n,e.$flags$)},et=function(t,e,n,a){var s,u,c,l=e.$children$[n],f=0;if(h||(d=!0,"slot"===l.$tag$&&(r&&a.classList.add(r+"-s"),l.$flags$|=l.$children$?2:1)),null!==l.$text$)s=l.$elm$=y.createTextNode(l.$text$);else if(1&l.$flags$)s=l.$elm$=y.createTextNode("");else{if(p||(p="svg"===l.$tag$),s=l.$elm$=y.createElementNS(p?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",2&l.$flags$?"slot-fb":l.$tag$),p&&"foreignObject"===l.$tag$&&(p=!1),tt(null,l,p),null!=r&&s["s-si"]!==r&&s.classList.add(s["s-si"]=r),l.$children$)for(f=0;f<l.$children$.length;++f)(u=et(t,l,f,s))&&s.appendChild(u);"svg"===l.$tag$?p=!1:"foreignObject"===s.tagName&&(p=!0)}return s["s-hn"]=o,3&l.$flags$&&(s["s-sr"]=!0,s["s-cr"]=i,s["s-sn"]=l.$name$||"",(c=t&&t.$children$&&t.$children$[n])&&c.$tag$===l.$tag$&&t.$elm$&&nt(t.$elm$,!1)),s},nt=function(t,e){v.$flags$|=1;for(var n=t.childNodes,r=n.length-1;r>=0;r--){var i=n[r];i["s-hn"]!==o&&i["s-ol"]&&(st(i).insertBefore(i,at(i)),i["s-ol"].remove(),i["s-ol"]=void 0,d=!0),e&&nt(i,e)}v.$flags$&=-2},rt=function(t,e,n,r,i,a){var s,u=t["s-cr"]&&t["s-cr"].parentNode||t;for(u.shadowRoot&&u.tagName===o&&(u=u.shadowRoot);i<=a;++i)r[i]&&(s=et(null,n,i,t))&&(r[i].$elm$=s,u.insertBefore(s,at(e)))},it=function(t,e,n,r,i){for(;e<=n;++e)(r=t[e])&&(i=r.$elm$,ft(r),f=!0,i["s-ol"]?i["s-ol"].remove():nt(i,!0),i.remove())},ot=function(t,e){return t.$tag$===e.$tag$&&("slot"===t.$tag$?t.$name$===e.$name$:t.$key$===e.$key$)},at=function(t){return t&&t["s-ol"]||t},st=function(t){return(t["s-ol"]?t["s-ol"]:t).parentNode},ut=function(t,e){var n,r=e.$elm$=t.$elm$,i=t.$children$,o=e.$children$;p=r&&r.parentNode&&void 0!==r.ownerSVGElement,p="svg"===e.$tag$||"foreignObject"!==e.$tag$&&p,null===e.$text$?("slot"===e.$tag$||tt(t,e,p),null!==i&&null!==o?function(t,e,n,r){for(var i,o,a=0,s=0,u=0,c=0,l=e.length-1,h=e[0],f=e[l],d=r.length-1,p=r[0],m=r[d];a<=l&&s<=d;)if(null==h)h=e[++a];else if(null==f)f=e[--l];else if(null==p)p=r[++s];else if(null==m)m=r[--d];else if(ot(h,p))ut(h,p),h=e[++a],p=r[++s];else if(ot(f,m))ut(f,m),f=e[--l],m=r[--d];else if(ot(h,m))"slot"!==h.$tag$&&"slot"!==m.$tag$||nt(h.$elm$.parentNode,!1),ut(h,m),t.insertBefore(h.$elm$,f.$elm$.nextSibling),h=e[++a],m=r[--d];else if(ot(f,p))"slot"!==h.$tag$&&"slot"!==m.$tag$||nt(f.$elm$.parentNode,!1),ut(f,p),t.insertBefore(f.$elm$,h.$elm$),f=e[--l],p=r[++s];else{for(u=-1,c=a;c<=l;++c)if(e[c]&&null!==e[c].$key$&&e[c].$key$===p.$key$){u=c;break}u>=0?((o=e[u]).$tag$!==p.$tag$?i=et(e&&e[s],n,u,t):(ut(o,p),e[u]=void 0,i=o.$elm$),p=r[++s]):(i=et(e&&e[s],n,s,t),p=r[++s]),i&&st(h.$elm$).insertBefore(i,at(h.$elm$))}a>l?rt(t,null==r[d+1]?null:r[d+1].$elm$,n,r,s,d):s>d&&it(e,a,l)}(r,i,e,o):null!==o?(null!==t.$text$&&(r.textContent=""),rt(r,null,e,o,0,o.length-1)):null!==i&&it(i,0,i.length-1)):(n=r["s-cr"])?n.parentNode.textContent=e.$text$:t.$text$!==e.$text$&&(r.data=e.$text$),p&&"svg"===e.$tag$&&(p=!1)},ct=function(t){var e,n,r,i,o,a,s=t.childNodes;for(n=0,r=s.length;n<r;n++)if(1===(e=s[n]).nodeType){if(e["s-sr"])for(o=e["s-sn"],e.hidden=!1,i=0;i<r;i++)if(s[i]["s-hn"]!==e["s-hn"])if(a=s[i].nodeType,""!==o){if(1===a&&o===s[i].getAttribute("slot")){e.hidden=!0;break}}else if(1===a||3===a&&""!==s[i].textContent.trim()){e.hidden=!0;break}ct(e)}},lt=[],ht=function(t){var e,n,r,i,o,a=t.childNodes,s=0,u=0,c=0;for(e=a.length;s<e;s++){if((n=a[s])["s-sr"]&&(r=n["s-cr"]))for(o=n["s-sn"],u=(i=r.parentNode.childNodes).length-1;u>=0;u--)(r=i[u])["s-cn"]||r["s-nr"]||r["s-hn"]===n["s-hn"]||((3===(c=r.nodeType)||8===c)&&""===o||1===c&&null===r.getAttribute("slot")&&""===o||1===c&&r.getAttribute("slot")===o)&&(lt.some((function(t){return t.$nodeToRelocate$===r}
1))||(f=!0,r["s-sn"]=o,lt.push({$slotRefNode$:n,$nodeToRelocate$:r})));1===n.nodeType&&ht(n)}},ft=function(t){t.$attrs$&&t.$attrs$.ref&&t.$attrs$.ref(null),t.$children$&&t.$children$.forEach(ft)},dt=function(t,e){e&&!t.$onRenderResolve$&&e["s-p"].push(new Promise((function(e){return t.$onRenderResolve$=e})))},pt=function(t,e,n,r){if(e.$flags$|=16,!(4&e.$flags$)){var i,o=e.$lazyInstance$,a=function(){return mt(t,e,n,o,r)},s=t["s-rc"];return dt(e,e.$ancestorComponent$),r&&(e.$flags$|=256,e.$queuedListeners$&&(e.$queuedListeners$.forEach((function(t){return gt(o,t[0],t[1])})),e.$queuedListeners$=null),i=gt(o,"componentWillLoad")),i=bt(i,(function(){return gt(o,"componentWillRender")})),s&&(s.forEach((function(t){return t()})),t["s-rc"]=void 0),bt(i,(function(){return M(a)}))}e.$flags$|=512},mt=function(t,e,n,a,s){s&&function(t,e,n){var r=W(g&&t.shadowRoot?t.shadowRoot:t.getRootNode(),e,n,t);10&e.$flags$&&(t["s-sc"]=r,t.classList.add(r+"-h"),2&e.$flags$&&t.classList.add(r+"-s"))}(t,n,e.$modeName$);try{!function(t,e,n,a){o=t.tagName;var s,u=e.$vnode$||$(null,null),c=(s=a)&&s.$tag$===K?a:H(null,null,a);if(n.$attrsToReflect$&&(c.$attrs$=c.$attrs$||{},n.$attrsToReflect$.forEach((function(e){return c.$attrs$[e[1]]=t[e[0]]}))),c.$tag$=null,c.$flags$|=4,e.$vnode$=c,c.$elm$=u.$elm$=t.shadowRoot||t,r=t["s-sc"],i=t["s-cr"],h=g&&0!=(1&n.$flags$),d=f=!1,ut(u,c),d){ht(c.$elm$);for(var l=0;l<lt.length;l++)(p=lt[l]).$nodeToRelocate$["s-ol"]||((w=y.createTextNode(""))["s-nr"]=p.$nodeToRelocate$,p.$nodeToRelocate$.parentNode.insertBefore(p.$nodeToRelocate$["s-ol"]=w,p.$nodeToRelocate$));for(v.$flags$|=1,l=0;l<lt.length;l++){for(var p,m=(p=lt[l]).$slotRefNode$.parentNode,b=p.$slotRefNode$.nextSibling,w=p.$nodeToRelocate$["s-ol"];w=w.previousSibling;){var _=w["s-nr"];if(_&&_["s-sn"]===p.$nodeToRelocate$["s-sn"]&&m===_.parentNode&&(!(_=_.nextSibling)||!_["s-nr"])){b=_;break}}(!b&&m!==p.$nodeToRelocate$.parentNode||p.$nodeToRelocate$.nextSibling!==b)&&p.$nodeToRelocate$!==b&&m.insertBefore(p.$nodeToRelocate$,b)}v.$flags$&=-2}f&&ct(c.$elm$),lt.length=0}(t,e,n,a.render&&a.render())}catch(l){T(l)}v.$cssShim$&&v.$cssShim$.updateHost(t),e.$flags$&=-17,e.$flags$|=2;var u=t["s-p"],c=function(){return yt(t,e,n)};0===u.length?c():(Promise.all(u).then(c),e.$flags$|=4,u.length=0)},yt=function(t,e,n){var r=e.$lazyInstance$,i=e.$ancestorComponent$;64&e.$flags$?gt(r,"componentDidUpdate"):(e.$flags$|=64,t.classList.add("hydrated"),gt(r,"componentDidLoad"),e.$onReadyResolve$(t),i||vt()),e.$onInstanceResolve$(t),e.$onRenderResolve$&&(e.$onRenderResolve$(),e.$onRenderResolve$=void 0),512&e.$flags$&&N((function(){return pt(t,e,n,!1)})),e.$flags$&=-517},vt=function(){y.documentElement.classList.add("hydrated"),v.$flags$|=2},gt=function(t,e,n){if(t&&t[e])try{return t[e](n)}catch(r){T(r)}},bt=function(t,e){return t&&t.then?t.then(e):e()},wt=function(t,e,n){if(e.$members$){t.watchers&&(e.$watchers$=t.watchers);var r=Object.entries(e.$members$),i=t.prototype;if(r.forEach((function(t){var r=t[0],o=t[1][0];31&o||2&n&&32&o?Object.defineProperty(i,r,{get:function(){return t=r,S(this).$instanceValues$.get(t);var t},set:function(t){!function(t,e,n,r){var i,o,a=S(t),s=a.$hostElement$,u=a.$instanceValues$.get(e),c=a.$flags$,l=a.$lazyInstance$;if(o=r.$members$[e][0],!((n=null==(i=n)||F(i)?i:4&o?"false"!==i&&(""===i||!!i):2&o?parseFloat(i):1&o?String(i):i)===u||8&c&&void 0!==u)&&(a.$instanceValues$.set(e,n),l)){if(r.$watchers$&&128&c){var h=r.$watchers$[e];h&&h.forEach((function(t){try{l[t](n,u,e)}catch(r){T(r)}}))}2==(18&c)&&pt(s,a,r,!1)}}(this,r,t,e)},configurable:!0,enumerable:!0}):1&n&&64&o&&Object.defineProperty(i,r,{value:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=S(this);return n.$onInstancePromise$.then((function(){var e;return(e=n.$lazyInstance$)[r].apply(e,t)}))}})})),1&n){var o=new Map;i.attributeChangedCallback=function(t,e,n){var r=this;v.jmp((function(){var e=o.get(t);r[e]=(null!==n||"boolean"!=typeof r[e])&&n}))},t.observedAttributes=r.filter((function(t){return 15&t[1][0]})).map((function(t){var n=t[0],r=t[1],i=r[1]||n;return o.set(i,n),512&r[0]&&e.$attrsToReflect$.push([n,i]),i}))}}return t},_t=function(t,e,n,r,i,o,a){var s,u,c,l;if(1===o.nodeType){for((s=o.getAttribute("c-id"))&&((u=s.split("."))[0]!==a&&"0"!==u[0]||(c={$flags$:0,$hostId$:u[0],$nodeId$:u[1],$depth$:u[2],$index$:u[3],$tag$:o.tagName.toLowerCase(),$elm$:o,$attrs$:null,$children$:null,$key$:null,$name$:null,$text$:null},e.push(c),o.removeAttribute("c-id"),t.$children$||(t.$children$=[]),t.$children$[c.$index$]=c,t=c,r&&"0"===c.$depth$&&(r[c.$index$]=c.$elm$))),l=o.childNodes.length-1;l>=0;l--)_t(t,e,n,r,i,o.childNodes[l],a);if(o.shadowRoot)for(l=o.shadowRoot.childNodes.length-1;l>=0;l--)_t(t,e,n,r,i,o.shadowRoot.childNodes[l],a)}else if(8===o.nodeType)(u=o.nodeValue.split("."))[1]!==a&&"0"!==u[1]||(c={$flags$:0,$hostId$:u[1],$nodeId$:u[2],$depth$:u[3],$index$:u[4],$elm$:o,$attrs$:null,$children$:null,$key$:null,$name$:null,$tag$:null,$text$:null},"t"===(s=u[0])?(c.$elm$=o.nextSibling,c.$elm$&&3===c.$elm$.nodeType&&(c.$text$=c.$elm$.textContent,e.push(c),o.remove(),t.$children$||(t.$children$=[]),t.$children$[c.$index$]=c,r&&"0"===c.$depth$&&(r[c.$index$]=c.$elm$))):c.$hostId$===a&&("s"===s?(c.$tag$="slot",o["s-sn"]=u[5]?c.$name$=u[5]:"",o["s-sr"]=!0,r&&(c.$elm$=y.createElement(c.$tag$),c.$name$&&c.$elm$.setAttribute("name",c.$name$),o.parentNode.insertBefore(c.$elm$,o),o.remove(),"0"===c.$depth$&&(r[c.$index$]=c.$elm$)),n.push(c),t.$children$||(t.$children$=[]),t.$children$[c.$index$]=c):"r"===s&&(r?o.remove():(i["s-cr"]=o,o["s-cn"]=!0))));else if(t&&"style"===t.$tag$){var h=$(null,o.textContent);h.$elm$=o,h.$index$="0",t.$children$=[h]}},St=function(t,e){if(1===t.nodeType){for(var n=0;n<t.childNodes.length;n++)St(t.childNodes[n],e);if(t.shadowRoot)for(n=0;n<t.shadowRoot.childNodes.length;n++)St(t.shadowRoot.childNodes[n],e)}
1else if(8===t.nodeType){var r=t.nodeValue.split(".");"o"===r[0]&&(e.set(r[1]+"."+r[2],t),t.nodeValue="",t["s-sd"]=""===r[3])}},Ct=[],Et=function(t){return Ct.push(t)},Tt=function(t){return S(t).$modeName$},kt=function(t){gt(t,"connectedCallback")},It=function(t){var e=t["s-cr"]=y.createComment("");e["s-cn"]=!0,t.insertBefore(e,t.firstChild)},Ot=function(t,e){void 0===e&&(e={});var r,i=[],o=e.exclude||[],a=y.head,u=m.customElements,c=a.querySelector("meta[charset]"),l=y.createElement("style");Object.assign(v,e),v.$resourcesUrl$=new URL(e.resourcesUrl||"./",y.baseURI).href,e.syncQueue&&(v.$flags$|=4),v.$flags$|=2;for(var h=y.querySelectorAll("style[s-id]"),f="",d=0;d<h.length;d++)f+=h[d].innerHTML;for(d=0;d<h.length;d++){var p=h[d];B(p.getAttribute("s-id"),f+p.innerHTML.replace(/\/\*!@([^\/]+)\*\/[^\{]+\{/g,"$1{"),!0)}t.forEach((function(t){return t[1].forEach((function(e){var a={$flags$:e[0],$tagName$:e[1],$members$:e[2],$listeners$:e[3]};a.$members$=e[2],a.$listeners$=e[3],a.$attrsToReflect$=[],a.$watchers$={},!g&&1&a.$flags$&&(a.$flags$|=8);var c=a.$tagName$,l=function(t){function e(e){var n,r,i=t.call(this,e)||this;return(r={$flags$:0,$hostElement$:n=e=i,$instanceValues$:new Map}).$onInstancePromise$=new Promise((function(t){return r.$onInstanceResolve$=t})),r.$onReadyPromise$=new Promise((function(t){return r.$onReadyResolve$=t})),n["s-p"]=[],n["s-rc"]=[],_.set(n,r),1&a.$flags$&&(g?e.attachShadow({mode:"open"}):"shadowRoot"in e||(e.shadowRoot=e)),i}return Object(s.d)(e,t),e.prototype.connectedCallback=function(){var t=this;r&&(clearTimeout(r),r=null),v.jmp((function(){return function(t,e){if(0==(1&v.$flags$)){var r=S(t);if(e.$listeners$&&(r.$rmListeners$=function(t,e,n){e.$queuedListeners$=e.$queuedListeners$||[];var r=n.map((function(n){var r=n[0],i=n[1],o=n[2],a=function(t,e){return 4&e?y:8&e?m:32&e?y.body:16&e?t.parentElement:t}(t,r),s=function(t,e){return function(n){256&t.$flags$?t.$lazyInstance$[e](n):t.$queuedListeners$.push([e,n])}}(e,o),u=function(t){return b?{passive:0!=(1&t),capture:0!=(2&t)}:0!=(2&t)}(r);return v.ael(a,i,s,u),function(){return v.rel(a,i,s,u)}}));return function(){return r.forEach((function(t){return t()}))}}(t,r,e.$listeners$)),!(1&r.$flags$)){var i;if(r.$flags$|=1,i=t.getAttribute("s-id")){if(g&&1&e.$flags$){var o=W(t.shadowRoot,e,t.getAttribute("s-mode"));t.classList.remove(o+"-h"),t.classList.remove(o+"-s")}!function(t,e,n,r){var i=t.shadowRoot,o=[],a=i?[]:null,s=r.$vnode$=$(e,null);v.$orgLocNodes$||St(y.body,v.$orgLocNodes$=new Map),t["s-id"]=n,t.removeAttribute("s-id"),_t(s,o,[],a,t,t,n),o.forEach((function(t){var n=t.$hostId$+"."+t.$nodeId$,r=v.$orgLocNodes$.get(n),o=t.$elm$;r&&(r["s-sd"]||"0"===t.$hostId$)&&r.parentNode.insertBefore(o,r.nextSibling),i||(o["s-hn"]=e,r&&(o["s-ol"]=r,o["s-ol"]["s-nr"]=o)),v.$orgLocNodes$.delete(n)})),i&&a.forEach((function(t){t&&i.appendChild(t)}))}(t,e.$tagName$,i,r)}i||(4&e.$flags$||8&e.$flags$)&&It(t);for(var a=t;a=a.parentNode||a.host;)if(1===a.nodeType&&a.hasAttribute("s-id")||a["s-p"]){dt(r,r.$ancestorComponent$=a);break}e.$members$&&Object.entries(e.$members$).forEach((function(e){var n=e[0];if(31&e[1][0]&&t.hasOwnProperty(n)){var r=t[n];delete t[n],t[n]=r}})),N((function(){return function(t,e,r,i,o){return Object(s.b)(void 0,void 0,void 0,(function(){var i,a,u,c;return Object(s.e)(this,(function(s){switch(s.label){case 0:return 0!=(32&e.$flags$)?[3,5]:(e.$flags$|=32,null==e.$modeName$&&(e.$modeName$="string"!=typeof r.$lazyBundleIds$?function(t){return Ct.map((function(e){return e(t)})).find((function(t){return!!t}))}(t):""),(o=function(t,e,r){var i=t.$tagName$.replace(/-/g,"_"),o="string"!=typeof t.$lazyBundleIds$?t.$lazyBundleIds$[e.$modeName$]:t.$lazyBundleIds$,a=k.get(o);return a?a[i]:n("Bf66")("./"+o+".entry.js").then((function(t){return k.set(o,t),t[i]}),T)}(r,e)).then?[4,o]:[3,2]);case 1:o=s.sent(),s.label=2;case 2:o.isProxied||(r.$watchers$=o.watchers,wt(o,r,2),o.isProxied=!0),e.$flags$|=8;try{new o(e)}catch(l){T(l)}return e.$flags$&=-9,e.$flags$|=128,kt(e.$lazyInstance$),i=z(r.$tagName$,e.$modeName$),I.has(i)||!o.style?[3,5]:("string"!=typeof(a=o.style)&&(a=a[e.$modeName$]),8&r.$flags$?[4,n.e(136).then(n.bind(null,"C/zs")).then((function(t){return t.scopeCss(a,i,!1)}))]:[3,4]);case 3:a=s.sent(),s.label=4;case 4:B(i,a,!!(1&r.$flags$)),s.label=5;case 5:return c=function(){return pt(t,e,r,!0)},(u=e.$ancestorComponent$)&&u["s-rc"]?u["s-rc"].push(c):c(),[2]}}))}))}(t,r,e)}))}kt(r.$lazyInstance$)}}(t,a)}))},e.prototype.disconnectedCallback=function(){var t=this;v.jmp((function(){return function(t){if(0==(1&v.$flags$)){var e=S(t),n=e.$lazyInstance$;e.$rmListeners$&&(e.$rmListeners$(),e.$rmListeners$=void 0),v.$cssShim$&&v.$cssShim$.removeHost(t),gt(n,"disconnectedCallback"),gt(n,"componentDidUnload")}}(t)}))},e.prototype["s-hmr"]=function(t){},e.prototype.forceUpdate=function(){!function(t,e){var n=S(t);2==(18&n.$flags$)&&pt(t,n,e,!1)}(this,a)},e.prototype.componentOnReady=function(){return S(this).$onReadyPromise$},e}(HTMLElement);a.$lazyBundleIds$=t[0],o.includes(c)||u.get(c)||(i.push(c),u.define(c,wt(l,a,1)))}))})),l.innerHTML=i+"{visibility:hidden}.hydrated{visibility:inherit}",l.setAttribute("data-styles",""),a.insertBefore(l,c?c.nextSibling:a.firstChild),v.jmp((function(){return r=setTimeout(vt,30)}))},xt=function(t,e,n){var r=Pt(t);return{emit:function(t){return r.dispatchEvent(new CustomEvent(e,{bubbles:!!(4&n),c
1omposed:!!(2&n),cancelable:!!(1&n),detail:t}))}}},At=function(t){var e=new URL(t,v.$resourcesUrl$);return e.origin!==m.location.origin?e.href:e.pathname},Pt=function(t){return S(t).$hostElement$},Dt=function(t){return t&&Tt(t)||a},Rt=function(){!function(){var t=document,e=window,n=e.Ionic=e.Ionic||{};Object(u.g)(e);var r=Object.assign(Object.assign(Object.assign(Object.assign({},Object(u.c)(e)),{persistConfig:!1}),n.config),Object(u.a)(e));u.b.reset(r),u.b.getBoolean("persistConfig")&&Object(u.d)(e,r),n.config=u.b,n.mode=a=u.b.get("mode",t.documentElement.getAttribute("mode")||(Object(u.f)(e,"ios")?"ios":"md")),u.b.set("mode",a),t.documentElement.setAttribute("mode",a),t.documentElement.classList.add(a),u.b.getBoolean("_testing")&&u.b.set("animated",!1),Et((function(t){return t.mode=t.mode||t.getAttribute("mode")||a}))}(),Et((function(t){return"ION-ICON"===t.tagName?t.mode||t.getAttribute("mode"):null}))}},"b/Kf":function(t,e,n){var r=n("rSCU"),i=n("c0bx"),o=n("jPdx");t.exports=function(t){return function(e,n,a){var s,u=r(e),c=i(u.length),l=o(a,c);if(t&&n!=n){for(;c>l;)if((s=u[l++])!=s)return!0}else for(;c>l;l++)if((t||l in u)&&u[l]===n)return t||l||0;return!t&&-1}}},bKVB:function(t,e,n){var r=n("UOZm"),i=n("xGvh"),o=n("rSCU"),a=n("IiNp"),s=n("g0Mr"),u=n("q098"),c=Object.getOwnPropertyDescriptor;e.f=n("lIov")?c:function(t,e){if(t=o(t),e=a(e,!0),u)try{return c(t,e)}catch(n){}if(s(t,e))return i(!r.f.call(t,e),t[e])}},bne5:function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r=n("6blF"),i=n("isby"),o=n("2Bdj"),a=n("67Y/");function s(t,e,n,u){return Object(o.a)(n)&&(u=n,n=void 0),u?s(t,e,n).pipe(Object(a.a)((function(t){return Object(i.a)(t)?u.apply(void 0,t):u(t)}))):new r.a((function(r){!function t(e,n,r,i,o){var a;if(function(t){return t&&"function"==typeof t.addEventListener&&"function"==typeof t.removeEventListener}(e)){var s=e;e.addEventListener(n,r,o),a=function(){return s.removeEventListener(n,r,o)}}else if(function(t){return t&&"function"==typeof t.on&&"function"==typeof t.off}(e)){var u=e;e.on(n,r),a=function(){return u.off(n,r)}}else if(function(t){return t&&"function"==typeof t.addListener&&"function"==typeof t.removeListener}(e)){var c=e;e.addListener(n,r),a=function(){return c.removeListener(n,r)}}else{if(!e||!e.length)throw new TypeError("Invalid event target");for(var l=0,h=e.length;l<h;l++)t(e[l],n,r,i,o)}i.add(a)}(t,e,(function(t){r.next(arguments.length>1?Array.prototype.slice.call(arguments):t)}),r,n)}))}},c0bx:function(t,e,n){var r=n("sQ1z"),i=Math.min;t.exports=function(t){return t>0?i(r(t),9007199254740991):0}},crnd:function(t,e,n){var r={"../confirm-join/confirm-join.module.ngfactory":["qfHD",3],"../hello/hello.module.ngfactory":["HL55",46],"../join2/join2.module.ngfactory":["TmGe",4],"./appl-bad-page/appl-bad-page.module.ngfactory":["49zK",15],"./appl-confirm-join2/appl-confirm-join2.module.ngfactory":["WVel",16],"./appl-confirm-join3/appl-confirm-join3.module.ngfactory":["lNgn",17],"./appl-confirm/appl-confirm.module.ngfactory":["qliL",18],"./appl-corp-confirm/appl-corp-confirm.module.ngfactory":["mVpt",19],"./appl-corp-credit-error/appl-corp-credit-error.module.ngfactory":["ovN6",20],"./appl-corp-end/appl-corp-end.module.ngfactory":["qxfz",21],"./appl-corp-inp/appl-corp-inp.module.ngfactory":["OjyL",22],"./appl-corpmember-auth/appl-corpmember-auth.module.ngfactory":["cl6r",23],"./appl-corpmember-confirm/appl-corpmember-confirm.module.ngfactory":["5CFP",24],"./appl-corpmember-end-user/appl-corpmember-end-user.module.ngfactory":["tejT",25],"./appl-corpmember-input/appl-corpmember-input.module.ngfactory":["PjUt",26],"./appl-corpmember-mail/appl-corpmember-mail.module.ngfactory":["XwX7",27],"./appl-credit-error/appl-credit-error.module.ngfactory":["bPQl",28],"./appl-endpayment/appl-endpayment.module.ngfactory":["xUJe",29],"./appl-index/appl-index.module.ngfactory":["pdLc",30],"./appl-join-mail/appl-join-mail.module.ngfactory":["I2zE",31],"./appl-leave-auth/appl-leave-auth.module.ngfactory":["xPaT",0,32],"./appl-leave-bad-page/appl-leave-bad-page.module.ngfactory":["k9lN",33],"./appl-leave-complete/appl-leave-complete.module.ngfactory":["MvDe",34],"./appl-leave-confirm/appl-leave-confirm.module.ngfactory":["gwUX",0,35],"./appl-leave-credit-error/appl-leave-credit-error.module.ngfactory":["SAFj",36],"./appl-leave-input/appl-leave-input.module.ngfactory":["xoNg",0,37],"./appl-leave-mail/appl-leave-mail.module.ngfactory":["E+BA",0,38],"./bad-param/bad-param.module.ngfactory":["yim9",39],"./confirm-join/confirm-join.module.ngfactory":["qfHD",3],"./confirm-join2/confirm-join2.module.ngfactory":["RO/O",40],"./corp-bad-param/corp-bad-param.module.ngfactory":["qa+X",41],"./credit-error/credit-error.module.ngfactory":["VqYh",42],"./end-add-user/end-add-user.module.ngfactory":["YiUA",43],"./end-leave-user/end-leave-user.module.ngfactory":["nHpa",44],"./endpayment2/endpayment2.module.ngfactory":["pska",45],"./join-mail/join-mail.module.ngfactory":["+RDT",47],"./join2/join2.module.ngfactory":["TmGe",4],"./mail-confirm/mail-confirm.module.ngfactory":["PR5W",48],"./maintenance/maintenance.module.ngfactory":["FWdF",49],"./secure-join/secure-join.module.ngfactory":["KWH7",50],"./selectshop/selectshop.module.ngfactory":["BEZ8",51],"./tabs/tabs.module.ngfactory":["pZl2",52],"./tokusho/tokusho.module.ngfactory":["hM8M",53]};function i(t){var e=r[t];return e?Promise.all(e.slice(1).map(n.e)).then((function(){return n(e[0])})):Promise.resolve().then((function(){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}))}i.keys=function(){return Object.keys(r)},i.id="crnd",t.exports=i},dC0D:function(t,e,n){"use strict";n.d(e,"a",(function(){return o}
1));var r=n("mrSG"),i=n("FFOo");function o(t,e){var n=!1;return arguments.length>=2&&(n=!0),function(r){return r.lift(new a(t,e,n))}}var a=function(){function t(t,e,n){void 0===n&&(n=!1),this.accumulator=t,this.seed=e,this.hasSeed=n}return t.prototype.call=function(t,e){return e.subscribe(new s(t,this.accumulator,this.seed,this.hasSeed))},t}(),s=function(t){function e(e,n,r,i){var o=t.call(this,e)||this;return o.accumulator=n,o._seed=r,o.hasSeed=i,o.index=0,o}return r.d(e,t),Object.defineProperty(e.prototype,"seed",{get:function(){return this._seed},set:function(t){this.hasSeed=!0,this._seed=t},enumerable:!0,configurable:!0}),e.prototype._next=function(t){if(this.hasSeed)return this._tryNext(t);this.seed=t,this.destination.next(t)},e.prototype._tryNext=function(t){var e,n=this.index++;try{e=this.accumulator(this.seed,t,n)}catch(r){this.destination.error(r)}this.seed=e,this.destination.next(e)},e}(i.a)},dNFx:function(t,e,n){var r=n("jZgK")("unscopables"),i=Array.prototype;null==i[r]&&n("GYIZ")(i,r,{}),t.exports=function(t){i[r][t]=!0}},eKN1:function(t,e,n){e.f=n("jZgK")},eihs:function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r={e:{}}},ezrC:function(t,e,n){var r=n("qtiw"),i=r["__core-js_shared__"]||(r["__core-js_shared__"]={});t.exports=function(t){return i[t]||(i[t]={})}},flRy:function(t,e,n){var r=n("PfMj"),i=n("8ouO");t.exports=function(t,e,n){if(r(e))throw TypeError("String#"+n+" doesn't accept regex!");return String(i(t))}},fvl4:function(t,e,n){"use strict";n.d(e,"d",(function(){return p})),n.d(e,"g",(function(){return m})),n.d(e,"e",(function(){return y})),n.d(e,"c",(function(){return v})),n.d(e,"f",(function(){return g})),n.d(e,"h",(function(){return b})),n.d(e,"b",(function(){return _})),n.d(e,"i",(function(){return S})),n.d(e,"a",(function(){return C}));var r=n("CcnG"),i=n("0/uQ"),o=n("F/XL"),a=n("D4gr"),s=n("UdJG"),u=n("9V49"),c=n("NKHs"),l=n("hDTV"),h=n("Ip0R"),f=n("Wcq6"),d=n.n(f),p=new r.p("angularfire2.enableFirestorePersistence"),m=new r.p("angularfire2.firestore.persistenceSettings"),y=new r.p("angularfire2.firestore.settings"),v=p,g=m,b=y,w=parseInt(d.a.SDK_VERSION.split(".")[0]),_=w<5||5==w&&parseInt(d.a.SDK_VERSION.split(".")[1])<8?{timestampsInSnapshots:!0}:{};function S(t,e){return void 0===e&&(e=function(t){return t}),{query:e(t),ref:t}}var C=function(){function t(t,e,n,r,a,s,u){var f=this;this.schedulers=new c.b(s),this.keepUnstableUntilFirst=Object(c.c)(this.schedulers,a),this.firestore=s.runOutsideAngular((function(){var n=Object(l.e)(t,s,e).firestore();return n.settings(r||_),n})),this.persistenceEnabled$=n&&!Object(h.q)(a)?s.runOutsideAngular((function(){try{return Object(i.a)(f.firestore.enablePersistence(u||void 0).then((function(){return!0}),(function(){return!1})))}catch(t){return Object(o.a)(!1)}})):Object(o.a)(!1)}return t.prototype.collection=function(t,e){var n=S("string"==typeof t?this.firestore.collection(t):t,e);return new s.a(n.ref,n.query,this)},t.prototype.collectionGroup=function(t,e){if(w<6)throw"collection group queries require Firebase JS SDK >= 6.0";var n=e||function(t){return t},r=this.firestore.collectionGroup(t);return new u.a(n(r),this)},t.prototype.doc=function(t){var e;return e="string"==typeof t?this.firestore.doc(t):t,new a.a(e,this)},t.prototype.createId=function(){return this.firestore.collection("_").doc().id},t}()},g0Mr:function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},gHGA:function(t,e,n){"use strict";n.r(e);var r=n("zVF4"),i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};function o(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var a=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t};function s(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(e){o(e)}}function s(t){try{u(r.throw(t))}catch(e){o(e)}}function u(t){t.done?i(t.value):new n((function(e){e(t.value)})).then(a,s)}u((r=r.apply(t,e||[])).next())}))}function u(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;
1function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=r[2&o[0]?"return":o[0]?"throw":"next"])&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[0,i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}var c=n("wj3C"),l=n.n(c);n.d(e,"registerMessaging",(function(){return D})),n.d(e,"isSupported",(function(){return R}));var h,f,d,p=((h={})["only-available-in-window"]="This method is available in a Window context.",h["only-available-in-sw"]="This method is available in a service worker context.",h["should-be-overriden"]="This method should be overriden by extended classes.",h["bad-sender-id"]="Please ensure that 'messagingSenderId' is set correctly in the options passed into firebase.initializeApp().",h["permission-default"]="The required permissions were not granted and dismissed instead.",h["permission-blocked"]="The required permissions were not granted and blocked instead.",h["unsupported-browser"]="This browser doesn't support the API's required to use the firebase SDK.",h["notifications-blocked"]="Notifications have been blocked.",h["failed-serviceworker-registration"]="We are unable to register the default service worker. {$browserErrorMessage}",h["sw-registration-expected"]="A service worker registration was the expected input.",h["get-subscription-failed"]="There was an error when trying to get any existing Push Subscriptions.",h["invalid-saved-token"]="Unable to access details of the saved token.",h["sw-reg-redundant"]="The service worker being used for push was made redundant.",h["token-subscribe-failed"]="A problem occured while subscribing the user to FCM: {$message}",h["token-subscribe-no-token"]="FCM returned no token when subscribing the user to push.",h["token-subscribe-no-push-set"]="FCM returned an invalid response when getting an FCM token.",h["token-unsubscribe-failed"]="A problem occured while unsubscribing the user from FCM: {$message}",h["token-update-failed"]="A problem occured while updating the user from FCM: {$message}",h["token-update-no-token"]="FCM returned no token when updating the user to push.",h["use-sw-before-get-token"]="The useServiceWorker() method may only be called once and must be called before calling getToken() to ensure your service worker is used.",h["invalid-delete-token"]="You must pass a valid token into deleteToken(), i.e. the token from getToken().",h["delete-token-not-found"]="The deletion attempt for token could not be performed as the token was not found.",h["delete-scope-not-found"]="The deletion attempt for service worker scope could not be performed as the scope was not found.",h["bg-handler-function-expected"]="The input to setBackgroundMessageHandler() must be a function.",h["no-window-client-to-msg"]="An attempt was made to message a non-existant window client.",h["unable-to-resubscribe"]="There was an error while re-subscribing the FCM token for push messaging. Will have to resubscribe the user on next visit. {$message}",h["no-fcm-token-for-resubscribe"]="Could not find an FCM token and as a result, unable to resubscribe. Will have to resubscribe the user on next visit.",h["failed-to-delete-token"]="Unable to delete the currently saved token.",h["no-sw-in-reg"]="Even though the service worker registration was successful, there was a problem accessing the service worker itself.",h["incorrect-gcm-sender-id"]="Please change your web app manifest's 'gcm_sender_id' value to '103953800507' to use Firebase messaging.",h["bad-scope"]="The service worker scope must be a string with at least one character.",h["bad-vapid-key"]="The public VAPID key is not a Uint8Array with 65 bytes.",h["bad-subscription"]="The subscription must be a valid PushSubscription.",h["bad-token"]="The FCM Token used for storage / lookup was not a valid token string.",h["bad-push-set"]="The FCM push set used for storage / lookup was not not a valid push set string.",h["failed-delete-vapid-key"]="The VAPID key could not be deleted.",h["invalid-public-vapid-key"]="The public VAPID key must be a string.",h["public-vapid-key-decryption-failed"]="The public VAPID key did not equal 65 bytes when decrypted.",h),m=new r.ErrorFactory("messaging","Messaging",p),y=new Uint8Array([4,51,148,247,223,161,235,177,220,3,162,94,21,113,219,72,211,46,237,237,178,52,219,183,71,58,12,143,196,204,225,111,60,140,132,223,171,182,102,62,242,12,212,139,254,227,249,118,47,20,28,99,8,106,111,45,177,26,149,176,206,55,192,156,110]),v="https://fcm.googleapis.com";function g(t,e){if(null==t||null==e)return!1;if(t===e)return!0;
1if(t.byteLength!==e.byteLength)return!1;for(var n=new DataView(t),r=new DataView(e),i=0;i<t.byteLength;i++)if(n.getUint8(i)!==r.getUint8(i))return!1;return!0}function b(t){return function(t){var e=new Uint8Array(t);return btoa(String.fromCharCode.apply(null,e))}(t).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}!function(t){t.TYPE_OF_MSG="firebase-messaging-msg-type",t.DATA="firebase-messaging-msg-data"}(f||(f={})),function(t){t.PUSH_MSG_RECEIVED="push-msg-received",t.NOTIFICATION_CLICKED="notification-clicked"}(d||(d={}));var w=function(){function t(){}return t.prototype.getToken=function(t,e,n){return s(this,void 0,void 0,(function(){var r,i,o,a,s,c,l;return u(this,(function(u){switch(u.label){case 0:r=b(e.getKey("p256dh")),i=b(e.getKey("auth")),o="authorized_entity="+t+"&endpoint="+e.endpoint+"&encryption_key="+r+"&encryption_auth="+i,g(n.buffer,y.buffer)||(a=b(n),o+="&application_pub_key="+a),(s=new Headers).append("Content-Type","application/x-www-form-urlencoded"),c={method:"POST",headers:s,body:o},u.label=1;case 1:return u.trys.push([1,4,,5]),[4,fetch(v+"/fcm/connect/subscribe",c)];case 2:return[4,u.sent().json()];case 3:return l=u.sent(),[3,5];case 4:throw u.sent(),m.create("token-subscribe-failed");case 5:if(l.error)throw m.create("token-subscribe-failed",{message:l.error.message});if(!l.token)throw m.create("token-subscribe-no-token");if(!l.pushSet)throw m.create("token-subscribe-no-push-set");return[2,{token:l.token,pushSet:l.pushSet}]}}))}))},t.prototype.updateToken=function(t,e,n,r,i){return s(this,void 0,void 0,(function(){var o,a,s,c,l,h,f;return u(this,(function(u){switch(u.label){case 0:o=b(r.getKey("p256dh")),a=b(r.getKey("auth")),s="push_set="+n+"&token="+e+"&authorized_entity="+t+"&endpoint="+r.endpoint+"&encryption_key="+o+"&encryption_auth="+a,g(i.buffer,y.buffer)||(c=b(i),s+="&application_pub_key="+c),(l=new Headers).append("Content-Type","application/x-www-form-urlencoded"),h={method:"POST",headers:l,body:s},u.label=1;case 1:return u.trys.push([1,4,,5]),[4,fetch(v+"/fcm/connect/subscribe",h)];case 2:return[4,u.sent().json()];case 3:return f=u.sent(),[3,5];case 4:throw u.sent(),m.create("token-update-failed");case 5:if(f.error)throw m.create("token-update-failed",{message:f.error.message});if(!f.token)throw m.create("token-update-no-token");return[2,f.token]}}))}))},t.prototype.deleteToken=function(t,e,n){return s(this,void 0,void 0,(function(){var r,i,o,a;return u(this,(function(s){switch(s.label){case 0:r="authorized_entity="+t+"&token="+e+"&pushSet="+n,(i=new Headers).append("Content-Type","application/x-www-form-urlencoded"),o={method:"POST",headers:i,body:r},s.label=1;case 1:return s.trys.push([1,4,,5]),[4,fetch(v+"/fcm/connect/unsubscribe",o)];case 2:return[4,s.sent().json()];case 3:if((a=s.sent()).error)throw m.create("token-unsubscribe-failed",{message:a.error.message});return[3,5];case 4:throw s.sent(),m.create("token-unsubscribe-failed");case 5:return[2]}}
1))}))},t}();function _(t){for(var e=(t+"=".repeat((4-t.length%4)%4)).replace(/\-/g,"+").replace(/_/g,"/"),n=atob(e),r=new Uint8Array(n.length),i=0;i<n.length;++i)r[i]=n.charCodeAt(i);return r}var S=function(){function t(){this.dbPromise=null}return t.prototype.get=function(t){return this.createTransaction((function(e){return e.get(t)}))},t.prototype.getIndex=function(t,e){return this.createTransaction((function(n){return n.index(t).get(e)}))},t.prototype.put=function(t){return this.createTransaction((function(e){return e.put(t)}),"readwrite")},t.prototype.delete=function(t){return this.createTransaction((function(e){return e.delete(t)}),"readwrite")},t.prototype.closeDatabase=function(){return s(this,void 0,void 0,(function(){return u(this,(function(t){switch(t.label){case 0:return this.dbPromise?[4,this.dbPromise]:[3,2];case 1:t.sent().close(),this.dbPromise=null,t.label=2;case 2:return[2]}}))}))},t.prototype.createTransaction=function(t,e){return void 0===e&&(e="readonly"),s(this,void 0,void 0,(function(){var n,r,i,o;return u(this,(function(a){switch(a.label){case 0:return[4,this.getDb()];case 1:return n=a.sent(),r=n.transaction(this.objectStoreName,e),i=r.objectStore(this.objectStoreName),[4,C(t(i))];case 2:return o=a.sent(),[2,new Promise((function(t,e){r.oncomplete=function(){t(o)},r.onerror=function(){e(r.error)}}))]}}))}))},t.prototype.getDb=function(){var t=this;return this.dbPromise||(this.dbPromise=new Promise((function(e,n){var r=indexedDB.open(t.dbName,t.dbVersion);r.onsuccess=function(){e(r.result)},r.onerror=function(){t.dbPromise=null,n(r.error)},r.onupgradeneeded=function(e){return t.onDbUpgrade(r,e)}}))),this.dbPromise},t}();function C(t){return new Promise((function(e,n){t.onsuccess=function(){e(t.result)},t.onerror=function(){n(t.error)}}))}var E=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.dbName="fcm_token_details_db",e.dbVersion=3,e.objectStoreName="fcm_token_object_Store",e}return o(e,t),e.prototype.onDbUpgrade=function(t,e){var n=t.result;switch(e.oldVersion){case 0:(r=n.createObjectStore(this.objectStoreName,{keyPath:"swScope"})).createIndex("fcmSenderId","fcmSenderId",{unique:!1}),r.createIndex("fcmToken","fcmToken",{unique:!0});case 1:!function(){var t=indexedDB.open("undefined");t.onerror=function(t){},t.onsuccess=function(e){!function(t){if(t.objectStoreNames.contains("fcm_token_object_Store")){var e=t.transaction("fcm_token_object_Store").objectStore("fcm_token_object_Store"),n=new w,r=e.openCursor();r.onerror=function(t){console.warn("Unable to cleanup old IDB.",t)},r.onsuccess=function(){var e=r.result;if(e){var i=e.value;n.deleteToken(i.fcmSenderId,i.fcmToken,i.fcmPushSet),e.continue()}else t.close(),indexedDB.deleteDatabase("undefined")}}}(t.result)}}();case 2:var r,i=(r=t.transaction.objectStore(this.objectStoreName)).openCursor();i.onsuccess=function(){var t=i.result;if(t){var e=t.value,n=a({},e);e.createTime||(n.createTime=Date.now()),"string"==typeof e.vapidKey&&(n.vapidKey=_(e.vapidKey)),"string"==typeof e.auth&&(n.auth=_(e.auth).buffer),"string"==typeof e.auth&&(n.p256dh=_(e.p256dh).buffer),t.update(n),t.continue()}}}},e.prototype.getTokenDetailsFromToken=function(t){return s(this,void 0,void 0,(function(){return u(this,(function(e){if(!t)throw m.create("bad-token");return T({fcmToken:t}),[2,this.getIndex("fcmToken",t)]}))}))},e.prototype.getTokenDetailsFromSWScope=function(t){return s(this,void 0,void 0,(function(){return u(this,(function(e){if(!t)throw m.create("bad-scope");return T({swScope:t}),[2,this.get(t)]}))}))},e.prototype.saveTokenDetails=function(t){return s(this,void 0,void 0,(function(){return u(this,(function(e){if(!t.swScope)throw m.create("bad-scope");if(!t.vapidKey)throw m.create("bad-vapid-key");if(!t.endpoint||!t.auth||!t.p256dh)throw m.create("bad-subscription");if(!t.fcmSenderId)throw m.create("bad-sender-id");if(!t.fcmToken)throw m.create("bad-token");if(!t.fcmPushSet)throw m.create("bad-push-set");return T(t),[2,this.put(t)]}))}))},e.prototype.deleteToken=function(t){return s(this,void 0,void 0,(function(){var e;return u(this,(function(n){switch(n.label){case 0:return"string"!=typeof t||0===t.length?[2,Promise.reject(m.create("invalid-delete-token"))]:[4,this.getTokenDetailsFromToken(t)];case 1:if(!(e=n.sent()))throw m.create("delete-token-not-found");return[4,this.delete(e.swScope)];case 2:return n.sent(),[2,e]}}))}))},e}(S);function T(t){if(t.fcmToken&&("string"!=typeof t.fcmToken||0===t.fcmToken.length))throw m.create("bad-token");if(t.swScope&&("string"!=typeof t.swScope||0===t.swScope.length))throw m.create("bad-scope");if(t.vapidKey&&(!(t.vapidKey instanceof Uint8Array)||65!==t.vapidKey.length))throw m.create("bad-va
1pid-key");if(t.endpoint&&("string"!=typeof t.endpoint||0===t.endpoint.length))throw m.create("bad-subscription");if(t.auth&&!(t.auth instanceof ArrayBuffer))throw m.create("bad-subscription");if(t.p256dh&&!(t.p256dh instanceof ArrayBuffer))throw m.create("bad-subscription");if(t.fcmSenderId&&("string"!=typeof t.fcmSenderId||0===t.fcmSenderId.length))throw m.create("bad-sender-id");if(t.fcmPushSet&&("string"!=typeof t.fcmPushSet||0===t.fcmPushSet.length))throw m.create("bad-push-set")}var k=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.dbName="fcm_vapid_details_db",e.dbVersion=1,e.objectStoreName="fcm_vapid_object_Store",e}return o(e,t),e.prototype.onDbUpgrade=function(t){t.result.createObjectStore(this.objectStoreName,{keyPath:"swScope"})},e.prototype.getVapidFromSWScope=function(t){return s(this,void 0,void 0,(function(){var e;return u(this,(function(n){switch(n.label){case 0:if("string"!=typeof t||0===t.length)throw m.create("bad-scope");return[4,this.get(t)];case 1:return[2,(e=n.sent())?e.vapidKey:void 0]}}))}))},e.prototype.saveVapidDetails=function(t,e){return s(this,void 0,void 0,(function(){return u(this,(function(n){if("string"!=typeof t||0===t.length)throw m.create("bad-scope");if(null===e||65!==e.length)throw m.create("bad-vapid-key");return[2,this.put({swScope:t,vapidKey:e})]}))}))},e.prototype.deleteVapidDetails=function(t){return s(this,void 0,void 0,(function(){var e;return u(this,(function(n){switch(n.label){case 0:return[4,this.getVapidFromSWScope(t)];case 1:if(!(e=n.sent()))throw m.create("delete-scope-not-found");return[4,this.delete(t)];case 2:return n.sent(),[2,e]}}))}))},e}(S),I=function(){function t(t){var e=this;if(!t.options.messagingSenderId||"string"!=typeof t.options.messagingSenderId)throw m.create("bad-sender-id");this.messagingSenderId=t.options.messagingSenderId,this.tokenDetailsModel=new E,this.vapidDetailsModel=new k,this.iidModel=new w,this.app=t,this.INTERNAL={delete:function(){return e.delete()}}}return t.prototype.getToken=function(){return s(this,void 0,void 0,(function(){var t,e,n,r,i;return u(this,(function(o){switch(o.label){case 0:if("denied"===(t=this.getNotificationPermission_()))throw m.create("notifications-blocked");return"granted"!==t?[2,null]:[4,this.getSWRegistration_()];case 1:return e=o.sent(),[4,this.getPublicVapidKey_()];case 2:return n=o.sent(),[4,this.getPushSubscription(e,n)];case 3:return r=o.sent(),[4,this.tokenDetailsModel.getTokenDetailsFromSWScope(e.scope)];case 4:return(i=o.sent())?[2,this.manageExistingToken(e,r,n,i)]:[2,this.getNewToken(e,r,n)]}}))}))},t.prototype.manageExistingToken=function(t,e,n,r){return s(this,void 0,void 0,(function(){return u(this,(function(i){switch(i.label){case 0:return function(t,e,n){if(!n.vapidKey||!g(e.buffer,n.vapidKey.buffer))return!1;var r=t.endpoint===n.endpoint,i=g(t.getKey("auth"),n.auth),o=g(t.getKey("p256dh"),n.p256dh);return r&&i&&o}(e,n,r)?Date.now()<r.createTime+6048e5?[2,r.fcmToken]:[2,this.updateToken(t,e,n,r)]:[4,this.deleteTokenFromDB(r.fcmToken)];case 1:return i.sent(),[2,this.getNewToken(t,e,n)]}}))}))},t.prototype.updateToken=function(t,e,n,r){return s(this,void 0,void 0,(function(){var i,o,a;return u(this,(function(s){switch(s.label){case 0:return s.trys.push([0,4,,6]),[4,this.iidModel.updateToken(this.messagingSenderId,r.fcmToken,r.fcmPushSet,e,n)];case 1:return i=s.sent(),o={swScope:t.scope,vapidKey:n,fcmSenderId:this.messagingSenderId,fcmToken:i,fcmPushSet:r.fcmPushSet,createTime:Date.now(),endpoint:e.endpoint,auth:e.getKey("auth"),p256dh:e.getKey("p256dh")},[4,this.tokenDetailsModel.saveTokenDetails(o)];case 2:return s.sent(),[4,this.vapidDetailsModel.saveVapidDetails(t.scope,n)];case 3:return s.sent(),[2,i];case 4:return a=s.sent(),[4,this.deleteToken(r.fcmToken)];case 5:throw s.sent(),a;case 6:return[2]}}
1))}))},t.prototype.getNewToken=function(t,e,n){return s(this,void 0,void 0,(function(){var r,i;return u(this,(function(o){switch(o.label){case 0:return[4,this.iidModel.getToken(this.messagingSenderId,e,n)];case 1:return r=o.sent(),i={swScope:t.scope,vapidKey:n,fcmSenderId:this.messagingSenderId,fcmToken:r.token,fcmPushSet:r.pushSet,createTime:Date.now(),endpoint:e.endpoint,auth:e.getKey("auth"),p256dh:e.getKey("p256dh")},[4,this.tokenDetailsModel.saveTokenDetails(i)];case 2:return o.sent(),[4,this.vapidDetailsModel.saveVapidDetails(t.scope,n)];case 3:return o.sent(),[2,r.token]}}))}))},t.prototype.deleteToken=function(t){return s(this,void 0,void 0,(function(){var e,n;return u(this,(function(r){switch(r.label){case 0:return[4,this.deleteTokenFromDB(t)];case 1:return r.sent(),[4,this.getSWRegistration_()];case 2:return(e=r.sent())?[4,e.pushManager.getSubscription()]:[3,4];case 3:if(n=r.sent())return[2,n.unsubscribe()];r.label=4;case 4:return[2,!0]}}))}))},t.prototype.deleteTokenFromDB=function(t){return s(this,void 0,void 0,(function(){var e;return u(this,(function(n){switch(n.label){case 0:return[4,this.tokenDetailsModel.deleteToken(t)];case 1:return e=n.sent(),[4,this.iidModel.deleteToken(e.fcmSenderId,e.fcmToken,e.fcmPushSet)];case 2:return n.sent(),[2]}}))}))},t.prototype.getPushSubscription=function(t,e){return t.pushManager.getSubscription().then((function(n){return n||t.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:e})}))},t.prototype.requestPermission=function(){throw m.create("only-available-in-window")},t.prototype.useServiceWorker=function(t){throw m.create("only-available-in-window")},t.prototype.usePublicVapidKey=function(t){throw m.create("only-available-in-window")},t.prototype.onMessage=function(t,e,n){throw m.create("only-available-in-window")},t.prototype.onTokenRefresh=function(t,e,n){throw m.create("only-available-in-window")},t.prototype.setBackgroundMessageHandler=function(t){throw m.create("only-available-in-sw")},t.prototype.delete=function(){return s(this,void 0,void 0,(function(){return u(this,(function(t){switch(t.label){case 0:return[4,Promise.all([this.tokenDetailsModel.closeDatabase(),this.vapidDetailsModel.closeDatabase()])];case 1:return t.sent(),[2]}}))}))},t.prototype.getNotificationPermission_=function(){return Notification.permission},t.prototype.getTokenDetailsModel=function(){return this.tokenDetailsModel},t.prototype.getVapidDetailsModel=function(){return this.vapidDetailsModel},t.prototype.getIidModel=function(){return this.iidModel},t}(),O=function(t){function e(e){var n=t.call(this,e)||this;return n.bgMessageHandler=null,self.addEventListener("push",(function(t){n.onPush(t)})),self.addEventListener("pushsubscriptionchange",(function(t){n.onSubChange(t)})),self.addEventListener("notificationclick",(function(t){n.onNotificationClick(t)})),n}return o(e,t),e.prototype.onPush=function(t){t.waitUntil(this.onPush_(t))},e.prototype.onSubChange=function(t){t.waitUntil(this.onSubChange_(t))},e.prototype.onNotificationClick=function(t){t.waitUntil(this.onNotificationClick_(t))},e.prototype.onPush_=function(t){return s(this,void 0,void 0,(function(){var e,n,r,i,o,a;return u(this,(function(s){switch(s.label){case 0:if(!t.data)return[2];try{e=t.data.json()}catch(u){return[2]}return[4,this.hasVisibleClients_()];case 1:return s.sent()?[2,this.sendMessageToWindowClients_(e)]:(n=this.getNotificationData_(e))?(r=n.title||"",[4,this.getSWRegistration_()]):[3,3];case 2:return i=s.sent(),o=n.actions,a=Notification.maxActions,o&&a&&o.length>a&&console.warn("This browser only supports "+a+" actions.The remaining actions will not be displayed."),[2,i.showNotification(r,n)];case 3:return this.bgMessageHandler?[4,this.bgMessageHandler(e)]:[3,5];case 4:return s.sent(),[2];case 5:return[2]}}
1))}))},e.prototype.onSubChange_=function(t){return s(this,void 0,void 0,(function(){var t,e,n,r;return u(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.getSWRegistration_()];case 1:return t=i.sent(),[3,3];case 2:throw e=i.sent(),m.create("unable-to-resubscribe",{message:e});case 3:return i.trys.push([3,5,,8]),[4,t.pushManager.getSubscription()];case 4:return i.sent(),[3,8];case 5:return n=i.sent(),[4,this.getTokenDetailsModel().getTokenDetailsFromSWScope(t.scope)];case 6:if(!(r=i.sent()))throw n;return[4,this.deleteToken(r.fcmToken)];case 7:throw i.sent(),n;case 8:return[2]}}))}))},e.prototype.onNotificationClick_=function(t){return s(this,void 0,void 0,(function(){var e,n,r,i;return u(this,(function(o){switch(o.label){case 0:return t.notification&&t.notification.data&&t.notification.data.FCM_MSG?t.action?[2]:(t.stopImmediatePropagation(),t.notification.close(),(e=t.notification.data.FCM_MSG).notification&&(n=e.fcmOptions&&e.fcmOptions.link||e.notification.click_action)?[4,this.getWindowClient_(n)]:[2]):[2];case 1:return(r=o.sent())?[3,3]:[4,self.clients.openWindow(n)];case 2:return r=o.sent(),[3,5];case 3:return[4,r.focus()];case 4:r=o.sent(),o.label=5;case 5:return r?(delete e.notification,delete e.fcmOptions,i=A(d.NOTIFICATION_CLICKED,e),[2,this.attemptToMessageClient_(r,i)]):[2]}}))}))},e.prototype.getNotificationData_=function(t){if(t&&"object"==typeof t.notification){var e,n=a({},t.notification);return n.data=a({},t.notification.data,((e={}).FCM_MSG=t,e)),n}},e.prototype.setBackgroundMessageHandler=function(t){if(!t||"function"!=typeof t)throw m.create("bg-handler-function-expected");this.bgMessageHandler=t},e.prototype.getWindowClient_=function(t){return s(this,void 0,void 0,(function(){var e,n,r,i;return u(this,(function(o){switch(o.label){case 0:return e=new URL(t,self.location.href).href,[4,x()];case 1:for(n=o.sent(),r=null,i=0;i<n.length;i++)if(new URL(n[i].url,self.location.href).href===e){r=n[i];break}return[2,r]}}))}))},e.prototype.attemptToMessageClient_=function(t,e){return s(this,void 0,void 0,(function(){return u(this,(function(n){if(!t)throw m.create("no-window-client-to-msg");return t.postMessage(e),[2]}))}))},e.prototype.hasVisibleClients_=function(){return s(this,void 0,void 0,(function(){return u(this,(function(t){switch(t.label){case 0:return[4,x()];case 1:return[2,t.sent().some((function(t){return"visible"===t.visibilityState}))]}}))}))},e.prototype.sendMessageToWindowClients_=function(t){return s(this,void 0,void 0,(function(){var e,n,r=this;return u(this,(function(i){switch(i.label){case 0:return[4,x()];case 1:return e=i.sent(),n=A(d.PUSH_MSG_RECEIVED,t),[4,Promise.all(e.map((function(t){return r.attemptToMessageClient_(t,n)})))];case 2:return i.sent(),[2]}}))}))},e.prototype.getSWRegistration_=function(){return s(this,void 0,void 0,(function(){return u(this,(function(t){return[2,self.registration]}))}))},e.prototype.getPublicVapidKey_=function(){return s(this,void 0,void 0,(function(){var t,e;return u(this,(function(n){switch(n.label){case 0:return[4,this.getSWRegistration_()];case 1:if(!(t=n.sent()))throw m.create("sw-registration-expected");return[4,this.getVapidDetailsModel().getVapidFromSWScope(t.scope)];case 2:return null==(e=n.sent())?[2,y]:[2,e]}}))}))},e}(I);function x(){return self.clients.matchAll({type:"window",includeUncontrolled:!0})}function A(t,e){return(n={})[f.TYPE_OF_MSG]=t,n[f.DATA]=e,n;var n}var P=function(t){function e(e){var n=t.call(this,e)||this;return n.registrationToUse=null,n.publicVapidKeyToUse=null,n.manifestCheckPromise=null,n.messageObserver=null,n.tokenRefreshObserver=null,n.onMessageInternal=Object(r.createSubscribe)((function(t){n.messageObserver=t})),n.onTokenRefreshInternal=Object(r.createSubscribe)((function(t){n.tokenRefreshObserver=t})),n.setupSWMessageListener_(),n}return o(e,t),e.prototype.getToken=function(){return s(this,void 0,void 0,(function(){return u(this,(function(e){switch(e.label){case 0:return this.manifestCheckPromise||(this.manifestCheckPromise=function(){return s(this,void 0,void 0,(function(){var t,e;return u(this,(function(n){switch(n.label){case 0:if(!(t=document.querySelector('link[rel="manifest"]')))return[2];n.label=1;case 1:return n.trys.push([1,4,,5]),[4,fetch(t.href)];case 2:return[4,n.sent().json()];case 3:return e=n.sent(),[3,5];case 4:return n.sent(),[2];case 5:if(!e||!e.gcm_sender_id)return[2];if("103953800507"!==e.gcm_sender_id)throw m.create("incorrect-gcm-sen
1der-id");return[2]}}))}))}()),[4,this.manifestCheckPromise];case 1:return e.sent(),[2,t.prototype.getToken.call(this)]}}))}))},e.prototype.requestPermission=function(){return s(this,void 0,void 0,(function(){var t;return u(this,(function(e){switch(e.label){case 0:return"granted"===this.getNotificationPermission_()?[2]:[4,Notification.requestPermission()];case 1:if("granted"===(t=e.sent()))return[2];throw m.create("denied"===t?"permission-blocked":"permission-default")}}))}))},e.prototype.useServiceWorker=function(t){if(!(t instanceof ServiceWorkerRegistration))throw m.create("sw-registration-expected");if(null!=this.registrationToUse)throw m.create("use-sw-before-get-token");this.registrationToUse=t},e.prototype.usePublicVapidKey=function(t){if("string"!=typeof t)throw m.create("invalid-public-vapid-key");if(null!=this.publicVapidKeyToUse)throw m.create("use-public-key-before-get-token");var e=_(t);if(65!==e.length)throw m.create("public-vapid-key-decryption-failed");this.publicVapidKeyToUse=e},e.prototype.onMessage=function(t,e,n){return"function"==typeof t?this.onMessageInternal(t,e,n):this.onMessageInternal(t)},e.prototype.onTokenRefresh=function(t,e,n){return"function"==typeof t?this.onTokenRefreshInternal(t,e,n):this.onTokenRefreshInternal(t)},e.prototype.waitForRegistrationToActivate_=function(t){var e=t.installing||t.waiting||t.active;return new Promise((function(n,r){if(e)if("activated"!==e.state)if("redundant"!==e.state){var i=function(){if("activated"===e.state)n(t);else{if("redundant"!==e.state)return;r(m.create("sw-reg-redundant"))}e.removeEventListener("statechange",i)};e.addEventListener("statechange",i)}else r(m.create("sw-reg-redundant"));else n(t);else r(m.create("no-sw-in-reg"))}))},e.prototype.getSWRegistration_=function(){var t=this;return this.registrationToUse?this.waitForRegistrationToActivate_(this.registrationToUse):(this.registrationToUse=null,navigator.serviceWorker.register("/firebase-messaging-sw.js",{scope:"/firebase-cloud-messaging-push-scope"}).catch((function(t){throw m.create("failed-serviceworker-registration",{browserErrorMessage:t.message})})).then((function(e){return t.waitForRegistrationToActivate_(e).then((function(){return t.registrationToUse=e,e.update(),e}))})))},e.prototype.getPublicVapidKey_=function(){return s(this,void 0,void 0,(function(){return u(this,(function(t){return this.publicVapidKeyToUse?[2,this.publicVapidKeyToUse]:[2,y]}))}))},e.prototype.setupSWMessageListener_=function(){var t=this;navigator.serviceWorker.addEventListener("message",(function(e){if(e.data&&e.data[f.TYPE_OF_MSG]){var n=e.data;switch(n[f.TYPE_OF_MSG]){case d.PUSH_MSG_RECEIVED:case d.NOTIFICATION_CLICKED:t.messageObserver&&t.messageObserver.next(n[f.DATA])}}}),!1)},e}(I);function D(t){t.INTERNAL.registerService("messaging",(function(t){if(!R())throw m.create("unsupported-browser");return self&&"ServiceWorkerGlobalScope"in self?new O(t):new P(t)}),{isSupported:R})}function R(){return self&&"ServiceWorkerGlobalScope"in self?"PushManager"in self&&"Notification"in self&&ServiceWorkerRegistration.prototype.hasOwnProperty("showNotification")&&PushSubscription.prototype.hasOwnProperty("getKey"):navigator.cookieEnabled&&"serviceWorker"in navigator&&"PushManager"in window&&"Notification"in window&&"fetch"in window&&ServiceWorkerRegistration.prototype.hasOwnProperty("showNotification")&&PushSubscription.prototype.hasOwnProperty("getKey")}D(l.a)},gIcY:function(t,e,n){"use strict";var r=n("mrSG"),i=n("CcnG"),o=n("6blF"),a=n("isby"),s=n("G5J1"),u=n("zotm"),c=n("MGBS"),l=n("67Y/"),h=function(t){function e(e,n){var r=t.call(this,e)||this;r.sources=n,r.completed=0,r.haveValues=0;var i=n.length;r.values=new Array(i);for(var o=0;o<i;o++){var a=n[o],s=Object(u.a)(r,a,null,o);s&&r.add(s)}return r}return r.d(e,t),e.prototype.notifyNext=function(t,e,n,r,i){this.values[n]=e,i._hasValue||(i._hasValue=!0,this.haveValues++)},e.prototype.notifyComplete=function(t){var e=this.destination,n=this.haveValues,r=this.values,i=r.length;t._hasValue?(this.completed++,this.completed===i&&(n===i&&e.next(r),e.complete())):e.complete()},e}(c.a),f=n("0/uQ"),d=n("ZYjt");n.d(e,"l",(function(){return ht})),n.d(e,"m",(function(){return lt})),n.d(e,"n",(function(){return A})),n.d(e,"o",(function(){return rt})),n.d(e,"a",(function(){return m})),n.d(e,"f",(function(){return S})),n.d(e,"g",(function(){return x})),n.d(e,"h",(function(){return K})),n.d(e,"i",(function(){return G})),n.d(e,"c",(function(){return ut})),n.d(e,"d",(function(){return it})),n.d(e,"b",(function(){return ct})),n.d(e,"k",(function(){return g})),n.d(e,"e",(function(){return ft})),n.d(e,"j",(function(){return dt}));var p=function(){function t(){}return Object.defineProperty(t.prototype,"value",{get:function(){return this.control?this.control.value:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"valid",{get:function(){return this.control?this.control.valid:null},enumerable:!0,configurable:!0}
1),Object.defineProperty(t.prototype,"invalid",{get:function(){return this.control?this.control.invalid:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"pending",{get:function(){return this.control?this.control.pending:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"disabled",{get:function(){return this.control?this.control.disabled:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"enabled",{get:function(){return this.control?this.control.enabled:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"errors",{get:function(){return this.control?this.control.errors:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"pristine",{get:function(){return this.control?this.control.pristine:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dirty",{get:function(){return this.control?this.control.dirty:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"touched",{get:function(){return this.control?this.control.touched:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"status",{get:function(){return this.control?this.control.status:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"untouched",{get:function(){return this.control?this.control.untouched:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"statusChanges",{get:function(){return this.control?this.control.statusChanges:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"valueChanges",{get:function(){return this.control?this.control.valueChanges:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"path",{get:function(){return null},enumerable:!0,configurable:!0}),t.prototype.reset=function(t){void 0===t&&(t=void 0),this.control&&this.control.reset(t)},t.prototype.hasError=function(t,e){return!!this.control&&this.control.hasError(t,e)},t.prototype.getError=function(t,e){return this.control?this.control.getError(t,e):null},t}(),m=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(r.d)(e,t),Object.defineProperty(e.prototype,"formDirective",{get:function(){return null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"path",{get:function(){return null},enumerable:!0,configurable:!0}),e}(p);function y(t){return null==t||0===t.length}var v=/^(?=.{1,254}$)(?=.{1,64}@)[-!#$%&'*+/0-9=?A-Z^_`a-z{|}~]+(\.[-!#$%&'*+/0-9=?A-Z^_`a-z{|}~]+)*@[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?(\.[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?)*$/,g=function(){function t(){}return t.min=function(t){return function(e){if(y(e.value)||y(t))return null;var n=parseFloat(e.value);return!isNaN(n)&&n<t?{min:{min:t,actual:e.value}}:null}},t.max=function(t){return function(e){if(y(e.value)||y(t))return null;var n=parseFloat(e.value);return!isNaN(n)&&n>t?{max:{max:t,actual:e.value}}:null}},t.required=function(t){return y(t.value)?{required:!0}:null},t.requiredTrue=function(t){return!0===t.value?null:{required:!0}},t.email=function(t){return y(t.value)||v.test(t.value)?null:{email:!0}},t.minLength=function(t){return function(e){if(y(e.value))return null;var n=e.value?e.value.length:0;return n<t?{minlength:{requiredLength:t,actualLength:n}}:null}},t.maxLength=function(t){return function(e){var n=e.value?e.value.length:0;return n>t?{maxlength:{requiredLength:t,actualLength:n}}:null}},t.pattern=function(e){return e?("string"==typeof e?(r="","^"!==e.charAt(0)&&(r+="^"),r+=e,"$"!==e.charAt(e.length-1)&&(r+="$"),n=new RegExp(r)):(r=e.toString(),n=e),function(t){if(y(t.value))return null;var e=t.value;return n.test(e)?null:{pattern:{requiredPattern:r,actualValue:e}}}):t.nullValidator;var n,r},t.nullValidator=function(t){return null},t.compose=function(t){if(!t)return null;var e=t.filter(b);return 0==e.length?null:function(t){return _(function(t,e){return e.map((function(e){return e(t)}))}(t,e))}},t.composeAsync=function(t){if(!t)return null;var e=t.filter(b);return 0==e.length?null:function(t){return function t(){for(var e,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return"function"==typeof n[n.length-1]&&(e=n.pop()),1===n.length&&Object(a.a)(n[0])&&(n=n[0]),0===n.length?s.a:e?t(n).pipe(Object(l.a)((function(t){return e.apply(void 0,t)}))):new o.a((function(t){return new h(t,n)}))}(function(t,e){return e.map((function(e){return e(t)}))}(t,e).map(w)).pipe(Object(l.a)(_))}},t}();function b(t){return null!=t}function w(t){var e=Object(i.tb)(t)?Object(f.a)(t):t;if(!Object(i.sb)(e))throw new Error("Expected validator to return Promise or Observable.");return e}function _(t){var e=t.reduce((function(t,e){return null!=e?Object(r.a)({},t,e):t}),{});return 0===Object.keys(e).length?null:e}var S=new i.p("NgValueAccessor"),C=function(){function t(t,e){this._renderer=t,this._elementRef=e,this.onChange=function(t){},this.onTouched=function(){}}return t.prototype.writeValue=function(t){this._renderer.setProperty(this._elementRef.nativeElement,"checked",t)},t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.setDisabledState=function(t){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",t)},t}(),E=function(){function t(t,e,n){var r;this._renderer=t,this._elementRef=e,this._compositionMode=n,this.onChange=function(t){},this.onTouched=function(){},this._composing=!1,null==this._compositionMode&&(this._compositionMode=(r=Object(d.r)()?Object(d.r)().getUserAgent():"",!/android (\d+)/.test(r.toLowerCase())))}return t.prototype.writeValue=function(t){this._renderer.setProperty(this._elementRef.nativeElement,"value",null==t?"":t)},t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.setDisabledState=function(t){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",t)},t.prototype._handleInput=function(t){(!this._compositionMode||this._compositionMode&&!this._composing)&&this.onChange(t)}
vendor: 4,392 bytes, line 1
1,t.prototype._compositionStart=function(){this._composing=!0},t.prototype._compositionEnd=function(t){this._composing=!1,this._compositionMode&&this.onChange(t)},t}();function T(t){return t.validate?function(e){return t.validate(e)}:t}function k(t){return t.validate?function(e){return t.validate(e)}:t}var I=function(){function t(t,e){this._renderer=t,this._elementRef=e,this.onChange=function(t){},this.onTouched=function(){}}return t.prototype.writeValue=function(t){this._renderer.setProperty(this._elementRef.nativeElement,"value",null==t?"":t)},t.prototype.registerOnChange=function(t){this.onChange=function(e){t(""==e?null:parseFloat(e))}},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.setDisabledState=function(t){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",t)},t}();function O(){throw new Error("unimplemented")}var x=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._parent=null,e.name=null,e.valueAccessor=null,e._rawValidators=[],e._rawAsyncValidators=[],e}return Object(r.d)(e,t),Object.defineProperty(e.prototype,"validator",{get:function(){return O()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"asyncValidator",{get:function(){return O()},enumerable:!0,configurable:!0}),e}(p),A=function(){function t(){this._accessors=[]}return t.prototype.add=function(t,e){this._accessors.push([t,e])},t.prototype.remove=function(t){for(var e=this._accessors.length-1;e>=0;--e)if(this._accessors[e][1]===t)return void this._accessors.splice(e,1)},t.prototype.select=function(t){var e=this;this._accessors.forEach((function(n){e._isSameGroup(n,t)&&n[1]!==t&&n[1].fireUncheck(t.value)}))},t.prototype._isSameGroup=function(t,e){return!!t[0].control&&t[0]._parent===e._control._parent&&t[1].name===e.name},t}(),P=function(){function t(t,e,n,r){this._renderer=t,this._elementRef=e,this._registry=n,this._injector=r,this.onChange=function(){},this.onTouched=function(){}}return t.prototype.ngOnInit=function(){this._control=this._injector.get(x),this._checkName(),this._registry.add(this._control,this)},t.prototype.ngOnDestroy=function(){this._registry.remove(this)},t.prototype.writeValue=function(t){this._state=t===this.value,this._renderer.setProperty(this._elementRef.nativeElement,"checked",this._state)},t.prototype.registerOnChange=function(t){var e=this;this._fn=t,this.onChange=function(){t(e.value),e._registry.select(e)}},t.prototype.fireUncheck=function(t){this.writeValue(t)},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.setDisabledState=function(t){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",t)},t.prototype._checkName=function(){this.name&&this.formControlName&&this.name!==this.formControlName&&this._throwNameError(),!this.name&&this.formControlName&&(this.name=this.formControlName)},t.prototype._throwNameError=function(){throw new Error('\n      If you define both a name and a formControlName attribute on your radio button, their values\n      must match. Ex: <input type="radio" formControlName="food" name="food">\n    ')},t}(),D=function(){function t(t,e){this._renderer=t,this._elementRef=e,this.onChange=function(t){},this.onTouched=function(){}}return t.prototype.writeValue=function(t){this._renderer.setProperty(this._elementRef.nativeElement,"value",parseFloat(t))},t.prototype.registerOnChange=function(t){this.onChange=function(e){t(""==e?null:parseFloat(e))}},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.setDisabledState=function(t){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",t)},t}(),R='\n    <div [formGroup]="myGroup">\n      <input formControlName="firstName">\n    </div>\n\n    In your class:\n\n    this.myGroup = new FormGroup({\n       firstName: new FormControl()\n    });',N='\n    <div [formGroup]="myGroup">\n       <div formGroupName="person">\n          <input formControlName="firstName">\n       </div>\n    </div>\n\n    In your class:\n\n    this.myGroup = new FormGroup({\n       person: new FormGroup({ firstName: new FormControl() })\n    });',j=function(){function t(){}return t.controlParentException=function(){throw new Error("formControlName must be used with a parent formGroup directive.  You'll want to add a formGroup\n       directive and pass it an existing FormGroup instance (you can create one in your class).\
1n\n      Example:\n\n      "+R)},t.ngModelGroupException=function(){throw new Error('formControlName cannot be used with an ngModelGroup parent. It is only compatible with parents\n       that also have a "form" prefix: formGroupName, formArrayName, or formGroup.\n\n       Option 1:  Update the parent to be formGroupName (reactive form strategy)\n\n        '+N+'\n\n        Option 2: Use ngModel instead of formControlName (template-driven strategy)\n\n        \n    <form>\n       <div ngModelGroup="person">\n          <input [(ngModel)]="person.name" name="firstName">\n       </div>\n    </form>')},t.missingFormException=function(){throw new Error("formGroup expects a FormGroup instance. Please pass one in.\n\n       Example:\n\n       "+R)},t.groupParentException=function(){throw new Error("formGroupName must be used with a parent formGroup directive.  You'll want to add a formGroup\n      directive and pass it an existing FormGroup instance (you can create one in your class).\n\n      Example:\n\n      "+N)},t.arrayParentException=function(){throw new Error('formArrayName must be used with a parent formGroup directive.  You\'ll want to add a formGroup\n       directive and pass it an existing FormGroup instance (you can create one in your class).\n\n        Example:\n\n        \n    <div [formGroup]="myGroup">\n      <div formArrayName="cities">\n        <div *ngFor="let city of cityArray.controls; index as i">\n          <input [formControlName]="i">\n        </div>\n      </div>\n    </div>\n\n    In your class:\n\n    this.cityArray = new FormArray([new FormControl(\'SF\')]);\n    this.myGroup = new FormGroup({\n      cities: this.cityArray\n    });')},t.disabledAttrWarning=function(){console.warn("\n      It looks like you're using the disabled attribute with a reactive form directive. If you set disabled to true\n      when you set up this control in your component class, the disabled attribute will actually be set in the DOM for\n      you. We recommend using this approach to avoid 'changed after checked' errors.\n       \n      Example: \n      form = new FormGroup({\n        first: new FormControl({value: 'Nancy', disabled: true}, Validators.required),\n        last: new FormControl('Drew', Validators.required)\n      });\n    ")},t.ngModelWarning=function(t){console.warn("\n    It looks like you're using ngModel on the same form field as "+t+". \n    Support for using the ngModel input property and ngModelChange event with \n    reactive form directives has been deprecated in Angular v6 and will be removed \n    in Angular v7.\n    \n    For more information on this, see our API docs here:\n    https://angular.io/api/forms/"+("formControl"
1===t?"FormControlDirective":"FormControlName")+"#use-with-ngmodel\n    ")},t}();function M(t,e){return Object(r.i)(e.path,[t])}function L(t,e){t||q(e,"Cannot find control with"),e.valueAccessor||q(e,"No value accessor for form control with"),t.validator=g.compose([t.validator,e.validator]),t.asyncValidator=g.composeAsync([t.asyncValidator,e.asyncValidator]),e.valueAccessor.writeValue(t.value),function(t,e){e.valueAccessor.registerOnChange((function(n){t._pendingValue=n,t._pendingChange=!0,t._pendingDirty=!0,"change"===t.updateOn&&F(t,e)}))}(t,e),function(t,e){t.registerOnChange((function(t,n){e.valueAccessor.writeValue(t),n&&e.viewToModelUpdate(t)}))}(t,e),function(t,e){e.valueAccessor.registerOnTouched((function(){t._pendingTouched=!0,"blur"===t.updateOn&&t._pendingChange&&F(t,e),"submit"!==t.updateOn&&t.markAsTouched()}))}(t,e),e.valueAccessor.setDisabledState&&t.registerOnDisabledChange((function(t){e.valueAccessor.setDisabledState(t)})),e._rawValidators.forEach((function(e){e.registerOnValidatorChange&&e.registerOnValidatorChange((function(){return t.updateValueAndValidity()}))})),e._rawAsyncValidators.forEach((function(e){e.registerOnValidatorChange&&e.registerOnValidatorChange((function(){return t.updateValueAndValidity()}))}))}function F(t,e){t._pendingDirty&&t.markAsDirty(),t.setValue(t._pendingValue,{emitModelToViewChange:!1}),e.viewToModelUpdate(t._pendingValue),t._pendingChange=!1}function U(t,e){null==t&&q(e,"Cannot find control with"),t.validator=g.compose([t.validator,e.validator]),t.asyncValidator=g.composeAsync([t.asyncValidator,e.asyncValidator])}function V(t){return q(t,"There is no FormControl instance attached to form control element with")}function q(t,e){var n;throw n=t.path.length>1?"path: '"+t.path.join(" -> ")+"'":t.path[0]?"name: '"+t.path+"'":"unspecified name attribute",new Error(e+" "+n)}function B(t){return null!=t?g.compose(t.map(T)):null}function W(t){return null!=t?g.composeAsync(t.map(k)):null}var z=[C,D,I,function(){function t(t,e){this._renderer=t,this._elementRef=e,this._optionMap=new Map,this._idCounter=0,this.onChange=function(t){},this.onTouched=function(){},this._compareWith=i.ub}return Object.defineProperty(t.prototype,"compareWith",{set:function(t){if("function"!=typeof t)throw new Error("compareWith must be a function, but received "+JSON.stringify(t));this._compareWith=t},enumerable:!0,configurable:!0}),t.prototype.writeValue=function(t){this.value=t;var e=this._getOptionId(t);null==e&&this._renderer.setProperty(this._elementRef.nativeElement,"selectedIndex",-1);var n=function(t,e){return null==t?""+e:(e&&"object"==typeof e&&(e="Object"),(t+": "+e).slice(0,50))}(e,t);this._renderer.setProperty(this._elementRef.nativeElement,"value",n)},t.prototype.registerOnChange=function(t){var e=this;this.onChange=function(n){e.value=e._getOptionValue(n),t(e.value)}},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.setDisabledState=function(t){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",t)},t.prototype._registerOption=function(){return(this._idCounter++).toString()},t.prototype._getOptionId=function(t){var e,n;try{for(var i=Object(r.k)(Array.from(this._optionMap.keys())),o=i.next();!o.done;o=i.next()){var a=o.value;if(this._compareWith(this._optionMap.get(a),t))return a}}catch(s){e={error:s}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return null},t.prototype._getOptionValue=function(t){var e=function(t){return t.split(":")[0]}(t);return this._optionMap.has(e)?this._optionMap.get(e):t},t}(),function(){function t(t,e){this._renderer=t,this._elementRef=e,this._optionMap=new Map,this._idCounter=0,this.onChange=function(t){},this.onTouched=function(){},this._compareWith=i.ub}return Object.defineProperty(t.prototype,"compareWith",{set:function(t){if("function"!=typeof t)throw new Error("compareWith must be a function, but received "+JSON.stringify(t));this._compareWith=t},enumerable:!0,configurable:!0}),t.prototype.writeValue=function(t){var e,n=this;if(this.value=t,Array.isArray(t)){var r=t.map((function(t){return n._getOptionId(t)}));e=function(t,e){t._setSelected(r.indexOf(e.toString())>-1)}}else e=function(t,e){t._setSelected(!1)};
vendor: 4,062 bytes, line 1
1this._optionMap.forEach(e)},t.prototype.registerOnChange=function(t){var e=this;this.onChange=function(n){var r=[];if(n.hasOwnProperty("selectedOptions"))for(var i=n.selectedOptions,o=0;o<i.length;o++){var a=i.item(o),s=e._getOptionValue(a.value);r.push(s)}else for(i=n.options,o=0;o<i.length;o++)(a=i.item(o)).selected&&(s=e._getOptionValue(a.value),r.push(s));e.value=r,t(r)}},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.setDisabledState=function(t){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",t)},t.prototype._registerOption=function(t){var e=(this._idCounter++).toString();return this._optionMap.set(e,t),e},t.prototype._getOptionId=function(t){var e,n;try{for(var i=Object(r.k)(Array.from(this._optionMap.keys())),o=i.next();!o.done;o=i.next()){var a=o.value;if(this._compareWith(this._optionMap.get(a)._value,t))return a}}catch(s){e={error:s}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return null},t.prototype._getOptionValue=function(t){var e=function(t){return t.split(":")[0]}(t);return this._optionMap.has(e)?this._optionMap.get(e)._value:t},t}(),P],H=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(r.d)(e,t),e.prototype.ngOnInit=function(){this._checkParentType(),this.formDirective.addFormGroup(this)},e.prototype.ngOnDestroy=function(){this.formDirective&&this.formDirective.removeFormGroup(this)},Object.defineProperty(e.prototype,"control",{get:function(){return this.formDirective.getFormGroup(this)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"path",{get:function(){return M(this.name,this._parent)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"formDirective",{get:function(){return this._parent?this._parent.formDirective:null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"validator",{get:function(){return B(this._validators)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"asyncValidator",{get:function(){return W(this._asyncValidators)},enumerable:!0,configurable:!0}),e.prototype._checkParentType=function(){},e}(m),$=function(){function t(t){this._cd=t}return Object.defineProperty(t.prototype,"ngClassUntouched",{get:function(){return!!this._cd.control&&this._cd.control.untouched},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ngClassTouched",{get:function(){return!!this._cd.control&&this._cd.control.touched},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ngClassPristine",{get:function(){return!!this._cd.control&&this._cd.control.pristine},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ngClassDirty",{get:function(){return!!this._cd.control&&this._cd.control.dirty},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ngClassValid",{get:function(){return!!this._cd.control&&this._cd.control.valid},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ngClassInvalid",{get:function(){return!!this._cd.control&&this._cd.control.invalid},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ngClassPending",{get:function(){return!!this._cd.control&&this._cd.control.pending},enumerable:!0,configurable:!0}),t}(),K=function(t){function e(e){return t.call(this,e)||this}return Object(r.d)(e,t),e}($),G=function(t){function e(e){return t.call(this,e)||this}return Object(r.d)(e,t),e}($);function Q(t){var e=X(t)?t.validators:t;return Array.isArray(e)?B(e):e||null}function Y(t,e){var n=X(e)?e.asyncValidators:t;return Array.isArray(n)?W(n):n||null}function X(t){return null!=t&&!Array.isArray(t)&&"object"==typeof t}var J=function(){function t(t,e){this.validator=t,this.asyncValidator=e,this._onCollectionChange=function(){},this.pristine=!0,this.touched=!1,this._onDisabledChange=[]}return Object.defineProperty(t.prototype,"parent",{get:function(){return this._parent},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"valid",{get:function(){return"VALID"===this.status},enumerable:!0,configurable:!0}
1),Object.defineProperty(t.prototype,"invalid",{get:function(){return"INVALID"===this.status},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"pending",{get:function(){return"PENDING"==this.status},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"disabled",{get:function(){return"DISABLED"===this.status},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"enabled",{get:function(){return"DISABLED"!==this.status},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dirty",{get:function(){return!this.pristine},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"untouched",{get:function(){return!this.touched},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"updateOn",{get:function(){return this._updateOn?this._updateOn:this.parent?this.parent.updateOn:"change"},enumerable:!0,configurable:!0}),t.prototype.setValidators=function(t){this.validator=Q(t)},t.prototype.setAsyncValidators=function(t){this.asyncValidator=Y(t)},t.prototype.clearValidators=function(){this.validator=null},t.prototype.clearAsyncValidators=function(){this.asyncValidator=null},t.prototype.markAsTouched=function(t){void 0===t&&(t={}),this.touched=!0,this._parent&&!t.onlySelf&&this._parent.markAsTouched(t)},t.prototype.markAsUntouched=function(t){void 0===t&&(t={}),this.touched=!1,this._pendingTouched=!1,this._forEachChild((function(t){t.markAsUntouched({onlySelf:!0})})),this._parent&&!t.onlySelf&&this._parent._updateTouched(t)},t.prototype.markAsDirty=function(t){void 0===t&&(t={}),this.pristine=!1,this._parent&&!t.onlySelf&&this._parent.markAsDirty(t)},t.prototype.markAsPristine=function(t){void 0===t&&(t={}),this.pristine=!0,this._pendingDirty=!1,this._forEachChild((function(t){t.markAsPristine({onlySelf:!0})})),this._parent&&!t.onlySelf&&this._parent._updatePristine(t)},t.prototype.markAsPending=function(t){void 0===t&&(t={}),this.status="PENDING",!1!==t.emitEvent&&this.statusChanges.emit(this.status),this._parent&&!t.onlySelf&&this._parent.markAsPending(t)},t.prototype.disable=function(t){void 0===t&&(t={}),this.status="DISABLED",this.errors=null,this._forEachChild((function(e){e.disable(Object(r.a)({},t,{onlySelf:!0}))})),this._updateValue(),!1!==t.emitEvent&&(this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._updateAncestors(t),this._onDisabledChange.forEach((function(t){return t(!0)}))},t.prototype.enable=function(t){void 0===t&&(t={}),this.status="VALID",this._forEachChild((function(e){e.enable(Object(r.a)({},t,{onlySelf:!0}))})),this.updateValueAndValidity({onlySelf:!0,emitEvent:t.emitEvent}),this._updateAncestors(t),this._onDisabledChange.forEach((function(t){return t(!1)}))},t.prototype._updateAncestors=function(t){this._parent&&!t.onlySelf&&(this._parent.updateValueAndValidity(t),this._parent._updatePristine(),this._parent._updateTouched())},t.prototype.setParent=function(t){this._parent=t},t.prototype.updateValueAndValidity=function(t){void 0===t&&(t={}),this._setInitialStatus(),this._updateValue(),this.enabled&&(this._cancelExistingSubscription(),this.errors=this._runValidator(),this.status=this._calculateStatus(),"VALID"!==this.status&&"PENDING"!==this.status||this._runAsyncValidator(t.emitEvent)),!1!==t.emitEvent&&(this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._parent&&!t.onlySelf&&this._parent.updateValueAndValidity(t)},t.prototype._updateTreeValidity=function(t){void 0===t&&(t={emitEvent:!0}),this._forEachChild((function(e){return e._updateTreeValidity(t)})),this.updateValueAndValidity({onlySelf:!0,emitEvent:t.emitEvent})},t.prototype._setInitialStatus=function(){this.status=this._allControlsDisabled()?"DISABLED":"VALID"},t.prototype._runValidator=function(){return this.validator?this.validator(this):null},t.prototype._runAsyncValidator=function(t){var e=this;if(this.asyncValidator){this.status="PENDING";var n=w(this.asyncValidator(this));this._asyncValidationSubscription=n.subscribe((function(n){return e.setErrors(n,{emitEvent:t})}))}},t.prototype._cancelExistingSubscription=function(){this._asyncValidationSubscription&&this._asyncValidationSubscription.unsubscribe()},t.prototype.setErrors=function(t,e){void 0===e&&(e={}),this.errors=t,this._updateControlsErrors(!1!==e.emitEvent)},t.prototype.get=function(t){return function(t,e,n){return null==e?null:(e instanceof Array||(e=e.split(".")),e instanceof Array&&0===e.length?null:e.reduce((function(t,e){return t instanceof tt?t.controls.hasOwnProperty(e)?t.controls[e]:null:t instanceof et&&t.at(e)||null}),t))}(this,t)},t.prototype.getError=function(t,e){var n=e?this.get(e):this;return n&&n.errors?n.errors[t]:null},t.prototype.hasError=function(t,e){return!!this.getError(t,e)},Object.defineProperty(t.prototype,"root",{get:function(){for(var t=this;t._parent;)t=t._parent;return t},enumerable:!0,configurable:!0}),t.prototype._updateControlsErrors=function(t){this.status=this._calculateStatus(),t&&this.statusChanges.emit(this.status),this._parent&&this._parent._updateControlsErrors(t)},t.prototype._initObservables=function(){this.valueChanges=new i.m,this.statusChanges=new i.m},t.prototype._calculateStatus=function(){return this._allControlsDisabled()?"DISABLED":this.errors?"INVALID":this._anyControlsHaveStatus("PENDING")?"PENDING":this._anyControlsHaveStatus("INVALID")?"INVALID":"VALID"},t.prototype._anyControlsHaveStatus=function(t){return this._anyControls((function(e){return e.status===t}))},t.prototype._anyControlsDirty=function(){return this._anyControls((function(t){return t.dirty}))},t.prototype._anyControlsTouched=function(){return this._anyControls((function(t){return t.touched}))},t.prototype._updatePristine=function(t){void 0===t&&(t={}),this.pristine=!this._anyControlsDirty(),this._parent&&!t.onlySelf&&this._parent._updatePristine(t)},t.prototype._updateTouched=function(t){void 0===t&&(t={}),this.touched=this._anyControlsTouched(),this._parent&&!t.onlySelf&&this._parent._updateTouched(t)},t.prototype._isBoxedValue=function(t){return"object"==typeof t&&null!==t&&2===Object.keys(t).length&&"value"in t&&"disabled"in t},t.prototype._registerOnCollectionChange=function(t){this._onCollectionChange=t},t.prototype._setUpdateStrategy=function(t){X(t)&&null!=t.updateOn&&(this._updateOn=t.updateOn)},t}(),Z=function(t){function e(e,n,r){void 0===e&&(e=null);var i=t.call(this,Q(n),Y(r,n))||this;return i._onChange=[],i._applyFormState(e),i._setUpdateStrategy(n),i.updateV
1alueAndValidity({onlySelf:!0,emitEvent:!1}),i._initObservables(),i}return Object(r.d)(e,t),e.prototype.setValue=function(t,e){var n=this;void 0===e&&(e={}),this.value=this._pendingValue=t,this._onChange.length&&!1!==e.emitModelToViewChange&&this._onChange.forEach((function(t){return t(n.value,!1!==e.emitViewToModelChange)})),this.updateValueAndValidity(e)},e.prototype.patchValue=function(t,e){void 0===e&&(e={}),this.setValue(t,e)},e.prototype.reset=function(t,e){void 0===t&&(t=null),void 0===e&&(e={}),this._applyFormState(t),this.markAsPristine(e),this.markAsUntouched(e),this.setValue(this.value,e),this._pendingChange=!1},e.prototype._updateValue=function(){},e.prototype._anyControls=function(t){return!1},e.prototype._allControlsDisabled=function(){return this.disabled},e.prototype.registerOnChange=function(t){this._onChange.push(t)},e.prototype._clearChangeFns=function(){this._onChange=[],this._onDisabledChange=[],this._onCollectionChange=function(){}},e.prototype.registerOnDisabledChange=function(t){this._onDisabledChange.push(t)},e.prototype._forEachChild=function(t){},e.prototype._syncPendingControls=function(){return!("submit"!==this.updateOn||(this._pendingDirty&&this.markAsDirty(),this._pendingTouched&&this.markAsTouched(),!this._pendingChange)||(this.setValue(this._pendingValue,{onlySelf:!0,emitModelToViewChange:!1}),0))},e.prototype._applyFormState=function(t){this._isBoxedValue(t)?(this.value=this._pendingValue=t.value,t.disabled?this.disable({onlySelf:!0,emitEvent:!1}):this.enable({onlySelf:!0,emitEvent:!1})):this.value=this._pendingValue=t},e}(J),tt=function(t){function e(e,n,r){var i=t.call(this,Q(n),Y(r,n))||this;return i.controls=e,i._initObservables(),i._setUpdateStrategy(n),i._setUpControls(),i.updateValueAndValidity({onlySelf:!0,emitEvent:!1}),i}return Object(r.d)(e,t),e.prototype.registerControl=function(t,e){return this.controls[t]?this.controls[t]:(this.controls[t]=e,e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange),e)},e.prototype.addControl=function(t,e){this.registerControl(t,e),this.updateValueAndValidity(),this._onCollectionChange()},e.prototype.removeControl=function(t){this.controls[t]&&this.controls[t]._registerOnCollectionChange((function(){})),delete this.controls[t],this.updateValueAndValidity(),this._onCollectionChange()},e.prototype.setControl=function(t,e){this.controls[t]&&this.controls[t]._registerOnCollectionChange((function(){})),delete this.controls[t],e&&this.registerControl(t,e),this.updateValueAndValidity(),this._onCollectionChange()},e.prototype.contains=function(t){return this.controls.hasOwnProperty(t)&&this.controls[t].enabled},e.prototype.setValue=function(t,e){var n=this;void 0===e&&(e={}),this._checkAllValuesPresent(t),Object.keys(t).forEach((function(r){n._throwIfControlMissing(r),n.controls[r].setValue(t[r],{onlySelf:!0,emitEvent:e.emitEvent})})),this.updateValueAndValidity(e)},e.prototype.patchValue=function(t,e){var n=this;void 0===e&&(e={}),Object.keys(t).forEach((function(r){n.controls[r]&&n.controls[r].patchValue(t[r],{onlySelf:!0,emitEvent:e.emitEvent})})),this.updateValueAndValidity(e)},e.prototype.reset=function(t,e){void 0===t&&(t={}),void 0===e&&(e={}),this._forEachChild((function(n,r){n.reset(t[r],{onlySelf:!0,emitEvent:e.emitEvent})})),this.updateValueAndValidity(e),this._updatePristine(e),this._updateTouched(e)},e.prototype.getRawValue=function(){return this._reduceChildren({},(function(t,e,n){return t[n]=e instanceof Z?e.value:e.getRawValue(),t}))},e.prototype._syncPendingControls=function(){var t=this._reduceChildren(!1,(function(t,e){return!!e._syncPendingControls()||t}));return t&&this.updateValueAndValidity({onlySelf:!0}),t},e.prototype._throwIfControlMissing=function(t){if(!Object.keys(this.controls).length)throw new Error("\n        There are no form controls registered with this group yet.  If you're using ngModel,\n        you may want to check next tick (e.g. use setTimeout).\n      ");if(!this.controls[t])throw new Error("Cannot find form control with name: "+t+".")},e.prototype._forEachChild=function(t){var e=this;
1Object.keys(this.controls).forEach((function(n){return t(e.controls[n],n)}))},e.prototype._setUpControls=function(){var t=this;this._forEachChild((function(e){e.setParent(t),e._registerOnCollectionChange(t._onCollectionChange)}))},e.prototype._updateValue=function(){this.value=this._reduceValue()},e.prototype._anyControls=function(t){var e=this,n=!1;return this._forEachChild((function(r,i){n=n||e.contains(i)&&t(r)})),n},e.prototype._reduceValue=function(){var t=this;return this._reduceChildren({},(function(e,n,r){return(n.enabled||t.disabled)&&(e[r]=n.value),e}))},e.prototype._reduceChildren=function(t,e){var n=t;return this._forEachChild((function(t,r){n=e(n,t,r)})),n},e.prototype._allControlsDisabled=function(){var t,e;try{for(var n=Object(r.k)(Object.keys(this.controls)),i=n.next();!i.done;i=n.next())if(this.controls[i.value].enabled)return!1}catch(o){t={error:o}}finally{try{i&&!i.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}return Object.keys(this.controls).length>0||this.disabled},e.prototype._checkAllValuesPresent=function(t){this._forEachChild((function(e,n){if(void 0===t[n])throw new Error("Mu
1st supply a value for form control with name: '"+n+"'.")}))},e}(J),et=function(t){function e(e,n,r){var i=t.call(this,Q(n),Y(r,n))||this;return i.controls=e,i._initObservables(),i._setUpdateStrategy(n),i._setUpControls(),i.updateValueAndValidity({onlySelf:!0,emitEvent:!1}),i}return Object(r.d)(e,t),e.prototype.at=function(t){return this.controls[t]},e.prototype.push=function(t){this.controls.push(t),this._registerControl(t),this.updateValueAndValidity(),this._onCollectionChange()},e.prototype.insert=function(t,e){this.controls.splice(t,0,e),this._registerControl(e),this.updateValueAndValidity()},e.prototype.removeAt=function(t){this.controls[t]&&this.controls[t]._registerOnCollectionChange((function(){})),this.controls.splice(t,1),this.updateValueAndValidity()},e.prototype.setControl=function(t,e){this.controls[t]&&this.controls[t]._registerOnCollectionChange((function(){})),this.controls.splice(t,1),e&&(this.controls.splice(t,0,e),this._registerControl(e)),this.updateValueAndValidity(),this._onCollectionChange()},Object.defineProperty(e.prototype,"length",{get:function(){return this.controls.length},enumerable:!0,configurable:!0}),e.prototype.setValue=function(t,e){var n=this;void 0===e&&(e={}),this._checkAllValuesPresent(t),t.forEach((function(t,r){n._throwIfControlMissing(r),n.at(r).setValue(t,{onlySelf:!0,emitEvent:e.emitEvent})})),this.updateValueAndValidity(e)},e.prototype.patchValue=function(t,e){var n=this;void 0===e&&(e={}),t.forEach((function(t,r){n.at(r)&&n.at(r).patchValue(t,{onlySelf:!0,emitEvent:e.emitEvent})})),this.updateValueAndValidity(e)},e.prototype.reset=function(t,e){void 0===t&&(t=[]),void 0===e&&(e={}),this._forEachChild((function(n,r){n.reset(t[r],{onlySelf:!0,emitEvent:e.emitEvent})})),this.updateValueAndValidity(e),this._updatePristine(e),this._updateTouched(e)},e.prototype.getRawValue=function(){return this.controls.map((function(t){return t instanceof Z?t.value:t.getRawValue()}))},e.prototype._syncPendingControls=function(){var t=this.controls.reduce((function(t,e){return!!e._syncPendingControls()||t}),!1);return t&&this.updateValueAndValidity({onlySelf:!0}),t},e.prototype._throwIfControlMissing=function(t){if(!this.controls.length)throw new Error("\n        There are no form controls registered with this array yet.  If you're using ngModel,\n        you may want to check next tick (e.g. use setTimeout).\n      ");if(!this.at(t))throw new Error("Cannot find form control at index "+t)},e.prototype._forEachChild=function(t){this.controls.forEach((function(e,n){t(e,n)}))},e.prototype._updateValue=function(){var t=this;this.value=this.controls.filter((function(e){return e.enabled||t.disabled})).map((function(t){return t.value}))},e.prototype._anyControls=function(t){return this.controls.some((function(e){return e.enabled&&t(e)}))},e.prototype._setUpControls=function(){var t=this;this._forEachChild((function(e){return t._registerControl(e)}))},e.prototype._checkAllValuesPresent=function(t){this._forEachChild((function(e,n){if(void 0===t[n])throw new Error("Mu
1st supply a value for form control at index: "+n+".")}))},e.prototype._allControlsDisabled=function(){var t,e;try{for(var n=Object(r.k)(this.controls),i=n.next();!i.done;i=n.next())if(i.value.enabled)return!1}catch(o){t={error:o}}finally{try{i&&!i.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}return this.controls.length>0||this.disabled},e.prototype._registerControl=function(t){t.setParent(this),t._registerOnCollectionChange(this._onCollectionChange)},e}(J),nt=new i.p("NgFormSelectorWarning"),rt=new i.p("NgModelWithFormControlWarning"),it=function(t){function e(e,n){var r=t.call(this)||this;return r._validators=e,r._asyncValidators=n,r.submitted=!1,r.directives=[],r.form=null,r.ngSubmit=new i.m,r}return Object(r.d)(e,t),e.prototype.ngOnChanges=function(t){this._checkFormPresent(),t.hasOwnProperty("form")&&(this._updateValidators(),this._updateDomValue(),this._updateRegistrations())},Object.defineProperty(e.prototype,"formDirective",{get:function(){return this},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"control",{get:function(){return this.form},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"path",{get:function(){return[]},enumerable:!0,configurable:!0}),e.prototype.addControl=function(t){var e=this.form.get(t.path);return L(e,t),e.updateValueAndValidity({emitEvent:!1}),this.directives.push(t),e},e.prototype.getControl=function(t){return this.form.get(t.path)},e.prototype.removeControl=function(t){var e,n;(n=(e=this.directives).indexOf(t))>-1&&e.splice(n,1)},e.prototype.addFormGroup=function(t){var e=this.form.get(t.path);U(e,t),e.updateValueAndValidity({emitEvent:!1})},e.prototype.removeFormGroup=function(t){},e.prototype.getFormGroup=function(t){return this.form.get(t.path)},e.prototype.addFormArray=function(t){var e=this.form.get(t.path);U(e,t),e.updateValueAndValidity({emitEvent:!1})},e.prototype.removeFormArray=function(t){},e.prototype.getFormArray=function(t){return this.form.get(t.path)},e.prototype.updateModel=function(t,e){this.form.get(t.path).setValue(e)},e.prototype.onSubmit=function(t){return this.submitted=!0,e=this.directives,this.form._syncPendingControls(),e.forEach((function(t){var e=t.control;"submit"===e.updateOn&&e._pendingChange&&(t.viewToModelUpdate(e._pendingValue),e._pendingChange=!1)})),this.ngSubmit.emit(t),!1;var e},e.prototype.onReset=function(){this.resetForm()},e.prototype.resetForm=function(t){void 0===t&&(t=void 0),this.form.reset(t),this.submitted=!1},e.prototype._updateDomValue=function(){var t=this;this.directives.forEach((function(e){var n=t.form.get(e.path);e.control!==n&&(function(t,e){e.valueAccessor.registerOnChange((function(){return V(e)})),e.valueAccessor.registerOnTouched((function(){return V(e)})),e._rawValidators.forEach((function(t){t.registerOnValidatorChange&&t.registerOnValidatorChange(null)})),e._rawAsyncValidators.forEach((function(t){t.registerOnValidatorChange&&t.registerOnValidatorChange(null)})),t&&t._clearChangeFns()}(e.control,e),n&&L(n,e),e.control=n)})),this.form._updateTreeValidity({emitEvent:!1})},e.prototype._updateRegistrations=function(){var t=this;this.form._registerOnCollectionChange((function(){return t._updateDomValue()})),this._oldForm&&this._oldForm._registerOnCollectionChange((function(){})),this._oldForm=this.form},e.prototype._updateValidators=function(){var t=B(this._validators);this.form.validator=g.compose([this.form.validator,t]);var e=W(this._asyncValidators);this.form.asyncValidator=g.composeAsync([this.form.asyncValidator,e])},e.prototype._checkFormPresent=function(){this.form||j.missingFormException()},e}(m),ot=function(t){function e(e,n,r){var i=t.call(this)||this;return i._parent=e,i._validators=n,i._asyncValidators=r,i}return Object(r.d)(e,t),e.prototype._checkParentType=function(){st(this._parent)&&j.groupParentException()},e}(H),at=function(t){function e(e,n,r){var i=t.call(this)||this;return i._parent=e,i._validators=n,i._asyncValidators=r,i}return Object(r.d)(e,t),e.prototype.ngOnInit=function(){this._checkParentType(),this.formDirective.addFormArray(this)},e.prototype.ngOnDestroy=function(){this.formDirective&&this.formDirective.removeFormArray(this)},Object.defineProperty(e.prototype,"control",{get:function(){return this.formDirective.getFormArray(this)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"formDirective",{get:function(){return this._parent?this._parent.formDirective:null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"path",{get:function(){return M(this.name,this._parent)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"validator",{get:function(){return B(this._val
1idators)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"asyncValidator",{get:function(){return W(this._asyncValidators)},enumerable:!0,configurable:!0}),e.prototype._checkParentType=function(){st(this._parent)&&j.arrayParentException()},e}(m);function st(t){return!(t instanceof ot||t instanceof it||t instanceof at)}var ut=function(t){function e(e,n,r,o,a){var s=t.call(this)||this;return s._ngModelWarningConfig=a,s._added=!1,s.update=new i.m,s._ngModelWarningSent=!1,s._parent=e,s._rawValidators=n||[],s._rawAsyncValidators=r||[],s.valueAccessor=function(t,e){if(!e)return null;Array.isArray(e)||q(t,"Value accessor was not provided as an array for form control with");var n=void 0,r=void 0,i=void 0;return e.forEach((function(e){var o;e.constructor===E?n=e:(o=e,z.some((function(t){return o.constructor===t}))?(r&&q(t,"More than one built-in value accessor matches form control with"),r=e):(i&&q(t,"More than one custom value accessor matches form control with"),i=e))})),i||r||n||(q(t,"No valid value accessor for form control with"),null)}(s,o),s}var n;return Object(r.d)(e,t),n=e,Object.defineProperty(e.prototype,"isDisabled",{set:function(t){j.disabledAttrWarning()},enumerable:!0,configurable:!0}),e.prototype.ngOnChanges=function(t){var e,r;this._added||this._setUpControl(),function(t,e){if(!t.hasOwnProperty("model"))return!1;var n=t.model;return!!n.isFirstChange()||!Object(i.ub)(e,n.currentValue)}(t,this.viewModel)&&("formControlName",e=n,this,r=this._ngModelWarningConfig,Object(i.X)()&&"never"!==r&&((null!==r&&"once"!==r||e._ngModelWarningSentOnce)&&("always"!==r||this._ngModelWarningSent)||(j.ngModelWarning("formControlName"),e._ngModelWarningSentOnce=!0,this._ngModelWarningSent=!0)),this.viewModel=this.model,this.formDirective.updateModel(this,this.model))},e.prototype.ngOnDestroy=function(){this.formDirective&&this.formDirective.removeControl(this)},e.prototype.viewToModelUpdate=function(t){this.viewModel=t,this.update.emit(t)},Object.defineProperty(e.prototype,"path",{get:function(){return M(this.name,this._parent)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"formDirective",{get:function(){return this._parent?this._parent.formDirective:null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"validator",{get:function(){return B(this._rawValidators)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"asyncValidator",{get:function(){return W(this._rawAsyncValidators)},enumerable:!0,configurable:!0}),e.prototype._checkParentType=function(){!(this._parent instanceof ot)&&this._parent instanceof H?j.ngModelGroupException():this._parent instanceof ot||this._parent instanceof it||this._parent instanceof at||j.controlParentException()},e.prototype._setUpControl=function(){this._checkParentType(),this.control=this.formDirective.addControl(this),this.control.disabled&&this.valueAccessor.setDisabledState&&this.valueAccessor.setDisabledState(!0),this._added=!0},e._ngModelWarningSentOnce=!1,e}(x),ct=function(){function t(){}return t.prototype.group=function(t,e){void 0===e&&(e=null);var n=this._reduceControls(t),r=null,i=null,o=void 0;return null!=e&&(function(t){return void 0!==t.asyncValidators||void 0!==t.validators||void 0!==t.updateOn}(e)?(r=null!=e.validators?e.validators:null,i=null!=e.asyncValidators?e.asyncValidators:null,o=null!=e.updateOn?e.updateOn:void 0):(r=null!=e.validator?e.validator:null,i=null!=e.asyncValidator?e.asyncValidator:null)),new tt(n,{asyncValidators:i,updateOn:o,validators:r})},t.prototype.control=function(t,e,n){return new Z(t,e,n)},t.prototype.array=function(t,e,n){var r=this,i=t.map((function(t){return r._createControl(t)}));return new et(i,e,n)},t.prototype._reduceControls=function(t){var e=this,n={};return Object.keys(t).forEach((function(r){n[r]=e._createControl(t[r])})),n},t.prototype._createControl=function(t){return t instanceof Z||t instanceof tt||t instanceof et?t:Array.isArray(t)?this.control(t[0],t.length>1?t[1]:null,t.length>2?t[2]:null):this.control(t)},t}(),lt=function(){return function(){}}(),ht=function(){return function(){}}
1(),ft=function(){function t(){}var e;return e=t,t.withConfig=function(t){return{ngModule:e,providers:[{provide:nt,useValue:t.warnOnDeprecatedNgFormSelector}]}},t}(),dt=function(){function t(){}var e;return e=t,t.withConfig=function(t){return{ngModule:e,providers:[{provide:rt,useValue:t.warnOnNgModelWithFormControl}]}},t}()},gRXz:function(t,e,n){"use strict";var r=n("sQ1z"),i=n("8ouO");t.exports=function(t){var e=String(i(this)),n="",o=r(t);if(o<0||o==1/0)throw RangeError("Count can't be negative");for(;o>0;(o>>>=1)&&(e+=e))1&o&&(n+=e);return n}},gYfK:function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},h9Dq:function(t,e,n){"use strict";var r=n("mrSG"),i=function(t){function e(e,n){return t.call(this)||this}return r.d(e,t),e.prototype.schedule=function(t,e){return void 0===e&&(e=0),this},e}(n("pugT").a);n.d(e,"a",(function(){return o}));var o=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r.pending=!1,r}return r.d(e,t),e.prototype.schedule=function(t,e){if(void 0===e&&(e=0),this.closed)return this;this.state=t;var n=this.id,r=this.scheduler;return null!=n&&(this.id=this.recycleAsyncId(r,n,e)),this.pending=!0,this.delay=e,this.id=this.id||this.requestAsyncId(r,this.id,e),this},e.prototype.requestAsyncId=function(t,e,n){return void 0===n&&(n=0),setInterval(t.flush.bind(t,this),n)},e.prototype.recycleAsyncId=function(t,e,n){if(void 0===n&&(n=0),null!==n&&this.delay===n&&!1===this.pending)return e;clearInterval(e)},e.prototype.execute=function(t,e){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var n=this._execute(t,e);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(t,e){var n=!1,r=void 0;try{this.work(t)}catch(i){n=!0,r=!!i&&i||new Error(i)}if(n)return this.unsubscribe(),r},e.prototype._unsubscribe=function(){var t=this.id,e=this.scheduler,n=e.actions,r=n.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==r&&n.splice(r,1),null!=t&&(this.id=this.recycleAsyncId(e,t,null)),this.delay=null},e}(i)},hDTV:function(t,e,n){"use strict";n.d(e,"d",(function(){return a})),n.d(e,"c",(function(){return s})),n.d(e,"b",(function(){return l})),n.d(e,"e",(function(){return f})),n.d(e,"a",(function(){return d}));var r=n("CcnG"),i=n("Wcq6"),o=n.n(i),a=new r.p("angularfire2.app.options"),s=new r.p("angularfire2.app.nameOrConfig"),u=a,c=s,l=function(){return function(){}}(),h=new r.N("5.4.2");function f(t,e,n){var r="object"==typeof n&&n||{};return r.name=r.name||"string"==typeof n&&n||"[DEFAULT]",o.a.apps.filter((function(t){return t&&t.name===r.name}))[0]||e.runOutsideAngular((function(){return o.a.initializeApp(t,r)}))}var d=function(){function t(t){o.a.registerVersion&&(o.a.registerVersion("angularfire",h.full,t.toString()),o.a.registerVersion("angular",r.M.full))}var e;return e=t,t.initializeApp=function(t,n){return{ngModule:e,providers:[{provide:u,useValue:t},{provide:c,useValue:n}]}},t}()},htOm:function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r=n("AytR"),i=n("xdv0"),o=n("CcnG"),a=n("t/Na"),s=function(){function t(t,e){this.userservice=t,this.httpclient=e,this.paymentUrl="https://gw.ccps.jp/payment.aspx",this.paymentBody=null,this.paymentSid=r.a.paymentId,this.paymentSvid="1",this.paymentPtype="3",this.paymentJob="CAPTURE",this.paymentRt="1",this.paymentsicd1="branch_membership_black_card",this.paymentsicd2="branch_anual_menbership",this.paymentsicd3="",this.paymentSucd="00001"}return t.prototype.processPayment=function(t){var e=this;return new Promise((function(t,n){e.paymentSod=e.userservice.shopCustomerNo+"/"+e.userservice.uid,e.paymentMail=e.userservice.email,e.paymentTel=e.userservice.tel1.replace(/-/g,""),"flagship"===e.userservice.shopid.shopid||"106"===e.userservice.shopid.shopid?e.paymentsicd1="Premium_Black_Membership":"nakameguro"===e.userservice.shopid.shopid?e.paymentsicd1="black"===e.userservice.memberrank?"Premium_Black_Membership":"gold"===e.userservice.memberrank?"Gold_Nakameguro_Membership":"Beginner_Nakameguro_Membership":"okinawa"===e.userservice.shopid.shopid?e.paymentsicd1="black"===e.userservice.memberrank?"Premium_Black_Membership":"gold"===e.userservice.memberrank?"Gold_Okinawa_Membership":"Beginner_Okinawa_Membership":"gi
1on"===e.userservice.shopid.shopid?"black"===e.userservice.memberrank?e.paymentsicd1="Premium_Black_Membership":"giongold"===e.userservice.memberrank&&(e.paymentsicd1="Gold_Gion_Membership"):e.paymentsicd1="black"===e.userservice.memberrank?"Premium_Black_Membership":"gold"===e.userservice.memberrank?"Gold_Membership":"Beginner_Membership",!0===e.userservice.cardkey&&(e.paymentsicd3="flagship_card_tax10"),e.paymentsicd2="anual_menbership3_tax10";var r="https://gw.ccps.jp/payment.aspx?sid="+e.paymentSid+"&svid="+e.paymentSvid;r=(r=(r=(r=(r=(r=(r=(r=(r=(r=r+"&ptype="+e.paymentPtype)+"&rt="+e.paymentRt)+"&sod="+e.paymentSod)+"&job="+e.paymentJob)+"&em="+e.paymentMail)+"&tn="+e.paymentTel)+"&sucd="+e.paymentSucd)+"&sicd1="+e.paymentsicd1)+"&sicd2="+e.paymentsicd2)+"&sicd3="+e.paymentsicd3,window.location.href=r,t(!0)}))},t.ngInjectableDef=o.S({factory:function(){return new t(o.W(i.a),o.W(a.c))},token:t,providedIn:"root"}),t}()},"htu+":function(t,e,n){"use strict";n.d(e,"c",(function(){return a})),n.d(e,"b",(function(){return s})),n.d(e,"a",(function(){return u}));var r=n("T1DM"),i=n("6blF"),o=n("67Y/");function a(t,e){return function(t,e){return void 0===e&&(e=r.a),new i.a((function(n){var r;return null!=e?e.schedule((function(){r=t.onSnapshot(n)})):r=t.onSnapshot(n),function(){null!=r&&r()}}))}(t,e)}function s(t,e){return a(t,e).pipe(Object(o.a)((function(t){return{payload:t,type:"value"}})))}function u(t,e){return a(t,e).pipe(Object(o.a)((function(t){return{payload:t,type:"query"}})))}},iLxQ:function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=!1,i={Promise:void 0,set useDeprecatedSynchronousErrorHandling(t){r=t},get useDeprecatedSynchronousErrorHandling(){return r}}},ifzb:function(t,e,n){var r=n("ezrC")("keys"),i=n("U/+K");t.exports=function(t){return r[t]||(r[t]=i(t))}},iqUP:function(t,e,n){"use strict";n("lcbw");var r,i=(r=n("wj3C"))&&"object"==typeof r&&"default"in r?r.default:r;n("t6oF"),n("NSPt"),n("6Joi"),n("ABqa"),n("gHGA"),n("LmZi"),console.warn("\nIt looks like you're using the development build of the Firebase JS SDK.\nWhen deploying Firebase apps to production, it is advisable to only import\nthe individual SDK components you intend to use.\n\nFor the module builds, these are available in the following manner\n(replace <PACKAGE> with the name of a component - i.e. auth, database, etc):\n\nCommonJS Modules:\nconst firebase = require('firebase/app');\nrequire('firebase/<PACKAGE>');\n\nES Modules:\nimport firebase from 'firebase/app';\nimport 'firebase/<PACKAGE>';\n\nTypescript:\nimport * as firebase from 'firebase/app';\nimport 'firebase/<PACKAGE>';\n"),t.exports=i},isby:function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=Array.isArray||function(t){return t&&"number"==typeof t.length}},"j/6h":function(t,e,n){var r=n("8ouO");t.exports=function(t){return Object(r(t))}},jPdx:function(t,e,n){var r=n("sQ1z"),i=Math.max,o=Math.min;t.exports=function(t,e){return(t=r(t))<0?i(t+e,0):o(t,e)}},jZgK:function(t,e,n){var r=n("ezrC")("wks"),i=n("U/+K"),o=n("qtiw").Symbol,a="function"==typeof o;(t.exports=function(t){return r[t]||(r[t]=a&&o[t]||(a?o:i)("Symbol."+t))}).store=r},kSm0:function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},lIov:function(t,e,n){t.exports=!n("61rj")((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},lcbw:function(t,e,n){"use strict";n.r(e),n("Uv6z"),n("pZxE"),n("NPZs"),n("VPEh"),n("TGP+"),n("W+Pj"),n("JilW"),n("AR9Z"),n("tmUU")},"lv+R":function(t,e){e.f=Object.getOwnPropertySymbols},mAIw:function(t,e,n){"use strict";n.r(e),n.d(e,"__extends",(function(){return i})),n.d(e,"__assign",(function(){return o})),n.d(e,"__rest",(function(){return a})),n.d(e,"__decorate",(function(){return s})),n.d(e,"__param",(function(){return u})),n.d(e,"__metadata",(function(){return c})),n.d(e,"__awaiter",(function(){return l})),n.d(e,"__generator",(function(){return h})),n.d(e,"__exportStar",(function(){return f})),n.d(e,"__values",(function(){return d})),n.d(e,"__read",(function(){return p})),n.d(e,"__spread",(function(){return m})),n.d(e,"__await",(function(){return y}
1)),n.d(e,"__asyncGenerator",(function(){return v})),n.d(e,"__asyncDelegator",(function(){return g})),n.d(e,"__asyncValues",(function(){return b})),n.d(e,"__makeTemplateObject",(function(){return w})),n.d(e,"__importStar",(function(){return _})),n.d(e,"__importDefault",(function(){return S}));var r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};function i(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var o=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t};function a(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&(n[r[i]]=t[r[i]])}return n}function s(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a}function u(t,e){return function(n,r){e(n,r,t)}}function c(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function l(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(e){o(e)}}function s(t){try{u(r.throw(t))}catch(e){o(e)}}function u(t){t.done?i(t.value):new n((function(e){e(t.value)})).then(a,s)}u((r=r.apply(t,e||[])).next())}))}function h(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=r[2&o[0]?"return":o[0]?"throw":"next"])&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[0,i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}function f(t,e){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}function d(t){var e="function"==typeof Symbol&&t[Symbol.iterator],n=0;return e?e.call(t):{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}}function p(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function m(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(p(arguments[e]));return t}function y(t){return this instanceof y?(this.v=t,this):new y(t)}function v(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(t,e||[]),o=[];return r={},a("next"),a("throw"),a("return"),r[Symbol.asyncIterator]=function(){return this},r;function a(t){i[t]&&(r[t]=function(e){return new Promise((function(n,r){o.push([t,e,n,r])>1||s(t,e)}))})}function s(t,e){try{(n=i[t](e)).value instanceof y?Promise.resolve(n.value.v).then(u,c):l(o[0][2],n)}catch(r){l(o[0][3],r)}var n}function u(t){s("next",t)}function c(t){s("throw",t)}function l(t,e){t(e),o.shift(),o.length&&s(o[0][0],o[0][1])}}function g(t){var e,n;return e={},r("next"),r("throw",(function(t){throw t})),r("return"),e[Symbol.iterator]=function(){return this},e;function r(r,i){t[r]&&(e[r]=function(e){return(n=!n)?{value:y(t[r](e)),done:"return"===r}:i?i(e):e})}}function b(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator];return e?e.call(t):d(t)}function w(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function _(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function S(t){return t&&t.__esModule?t:{default:t}}},mChF:function(t,e,n){"use strict";function r(t){return t}n.d(e,"a",(function(){return r}))},"mY8+":function(t,e,n){var r=n("6CFf"),i=n("H1Af"),o=n("j/6h"),a=n("c0bx"),s=n("sl9K");t.exports=function(t,e){var n=1==t,u=2==t,c=3==t,l=4==t,h=6==t,f=5==t||h,d=e||s;return function(e,s,p){for(var m,y,v=o(e),g=i(v),b=r(s,p,3),w=a(g.length),_=0,S=n?d(e,w):u?d(e,0):void 0;w>_;_++)if((f||_ in g)&&(y=b(m=g[_],_,v),t))if(n)S[_]=y;else if(y)switch(t){case 3:return!0;case 5:return m;case 6:return _;case 2:S.push(m)}else if(l)return!1;return h?-1:c||l?l:S}}},mZXl:function(t,e,n){"use strict";var r=n("mrSG"),i=n("FFOo"),o=n("G5J1"),a=n("F/XL"),s=n("6blF"),u=function(){function t(t,e,n){this.kind=t,this.value=e,this.error=n,this.hasValue="N"===t}return t.prototype.observe=function(t){switch(this.kind){case"N":return t.next&&t.next(this.value);case"E":return t.error&&t.error(this.error);case"C":return t.complete&&t.complete()}},t.prototype.do=function(t,e,n){switch(this.kind){case"N":return t&&t(this.value);case"E":return e&&e(this.error);case"C":return n&&n()}},t.prototype.accept=function(t,e,n){return t&&"function"==typeof t.next?this.observe(t):this.do(t,e,n)},t.prototype.toObservable=function(){var t;switch(this.kind){case"N":return Object(a.a)(this.value);case"E":return t=this.error,new s.a((function(e){return e.error(t)}));case"C":return Object(o.b)()}throw new Error("unexpected notification kind value")},t.createNext=function(e){return void 0!==e?new t("N",e):t.undefinedValueNotification},t.createError=function(e){return new t("E",void 0,e)},t.createComplete=function(){return t.completeNotification},t.completeNotification=new t("C"),t.undefinedValueNotification=new t("N",void 0),t}();function c(t,e){return void 0===e&&(e=0),function(n){return n.lift(new l(t,e))}}n.d(e,"a",(function(){return c}));var l=function(){function t(t,e){void 0===e&&(e=0),this.scheduler
1=t,this.delay=e}return t.prototype.call=function(t,e){return e.subscribe(new h(t,this.scheduler,this.delay))},t}(),h=function(t){function e(e,n,r){void 0===r&&(r=0);var i=t.call(this,e)||this;return i.scheduler=n,i.delay=r,i}return r.d(e,t),e.dispatch=function(t){t.notification.observe(t.destination),this.unsubscribe()},e.prototype.scheduleMessage=function(t){this.destination.add(this.scheduler.schedule(e.dispatch,this.delay,new f(t,this.destination)))},e.prototype._next=function(t){this.scheduleMessage(u.createNext(t))},e.prototype._error=function(t){this.scheduleMessage(u.createError(t)),this.unsubscribe()},e.prototype._complete=function(){this.scheduleMessage(u.createComplete()),this.unsubscribe()},e}(i.a),f=function(){return function(t,e){this.notification=t,this.destination=e}}()},mrSG:function(t,e,n){"use strict";n.d(e,"d",(function(){return i})),n.d(e,"a",(function(){return o})),n.d(e,"c",(function(){return a})),n.d(e,"g",(function(){return s})),n.d(e,"f",(function(){return u})),n.d(e,"b",(function(){return c})),n.d(e,"e",(function(){return l})),n.d(e,"k",(function(){return h})),n.d(e,"h",(function(){return f})),n.d(e,"i",(function(){return d})),n.d(e,"j",(function(){return p}));var r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function i(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var o=function(){return(o=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function a(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a}function s(t,e){return function(n,r){e(n,r,t)}}function u(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function c(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(e){o(e)}}function s(t){try{u(r.throw(t))}catch(e){o(e)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))}function l(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=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 a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}function h(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function f(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function d(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(f(arguments[e]));return t}function p(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),i=0;for(e=0;e<n;e++)for(var o=arguments[e],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r}},nkY7:function(t,e,n){"use strict";function r(t){return t&&"function"==typeof t.schedule}n.d(e,"a",(function(){return r}))},oBZk:function(t,e,n){"use strict";n.d(e,"r",(function(){return s})),n.d(e,"L",(function(){return u})),n.d(e,"a",(function(){return c})),n.d(e,"u",(function(){return l})),n.d(e,"b",(function(){return h})),n.d(e,"v",(function(){return f})),n.d(e,"c",(function(){return d})),n.d(e,"w",(function(){return p})),n.d(e,"d",(function(){return m})),n.d(e,"x",(function(){return y}
1)),n.d(e,"e",(function(){return v})),n.d(e,"y",(function(){return g})),n.d(e,"f",(function(){return b})),n.d(e,"z",(function(){return w})),n.d(e,"g",(function(){return _})),n.d(e,"A",(function(){return S})),n.d(e,"h",(function(){return C})),n.d(e,"B",(function(){return E})),n.d(e,"i",(function(){return T})),n.d(e,"C",(function(){return k})),n.d(e,"j",(function(){return I})),n.d(e,"D",(function(){return O})),n.d(e,"k",(function(){return x})),n.d(e,"E",(function(){return A})),n.d(e,"l",(function(){return P})),n.d(e,"F",(function(){return D})),n.d(e,"m",(function(){return R})),n.d(e,"G",(function(){return N})),n.d(e,"n",(function(){return j})),n.d(e,"I",(function(){return M})),n.d(e,"o",(function(){return L})),n.d(e,"H",(function(){return F})),n.d(e,"p",(function(){return U})),n.d(e,"J",(function(){return V})),n.d(e,"q",(function(){return q})),n.d(e,"K",(function(){return B})),n.d(e,"s",(function(){return W})),n.d(e,"M",(function(){return z})),n.d(e,"t",(function(){return H})),n.d(e,"N",(function(){return $}));var r=n("CcnG"),i=n("ZZ/e"),o=n("Ip0R"),a=n("ZYCi"),s=r.nb({encapsulation:0,styles:["[_nghost-%COMP%] {\n      display: flex;\n      position: absolute;\n      top: 0;\n      left: 0;\n      right: 0;\n      bottom: 0;\n\n      flex-direction: column;\n\n      width: 100%;\n      height: 100%;\n\n      contain: layout size style;\n      z-index: $z-index-page-container;\n    }\n    .tabs-inner[_ngcontent-%COMP%] {\n      position: relative;\n\n      flex: 1;\n\n      contain: layout size style;\n    }"],data:{}});function u(t){return r.Fb(0,[r.Cb(402653184,1,{outlet:0}),r.xb(null,0),(t()(),r.pb(2,0,null,null,2,"div",[["class","tabs-inner"]],null,null,null,null,null)),(t()(),r.pb(3,16777216,[["outlet",1]],null,1,"ion-router-outlet",[["tabs","true"]],null,[[null,"stackEvents"]],(function(t,e,n){var r=!0;return"stackEvents"===e&&(r=!1!==t.component.onPageSelected(n)&&r),r}),null,null)),r.ob(4,212992,[[1,4]],0,i.ib,[a.b,r.O,r.j,[8,null],[8,"true"],i.d,i.Ib,o.f,r.k,a.n,r.z,a.a,[3,i.ib]],null,{stackEvents:"stackEvents"}),r.xb(null,1)],(function(t,e){t(e,4,0)}),null)}var c=r.nb({encapsulation:2,styles:[],data:{}});function l(t){return r.Fb(2,[r.xb(null,0)],null,null)}var h=r.nb({encapsulation:2,styles:[],data:{}});function f(t){return r.Fb(2,[r.xb(null,0)],null,null)}var d=r.nb({encapsulation:2,styles:[],data:{}});function p(t){return r.Fb(2,[r.xb(null,0)],null,null)}var m=r.nb({encapsulation:2,styles:[],data:{}});function y(t){return r.Fb(2,[r.xb(null,0)],null,null)}var v=r.nb({encapsulation:2,styles:[],data:{}});function g(t){return r.Fb(2,[r.xb(null,0)],null,null)}var b=r.nb({encapsulation:2,styles:[],data:{}});function w(t){return r.Fb(2,[r.xb(null,0)],null,null)}var _=r.nb({encapsulation:2,styles:[],data:{}});function S(t){return r.Fb(2,[r.xb(null,0)],null,null)}var C=r.nb({encapsulation:2,styles:[],data:{}});function E(t){return r.Fb(2,[r.xb(null,0)],null,null)}var T=r.nb({encapsulation:2,styles:[],data:{}});function k(t){return r.Fb(2,[r.xb(null,0)],null,null)}var I=r.nb({encapsulation:2,styles:[],data:{}});function O(t){return r.Fb(2,[r.xb(null,0)],null,null)}var x=r.nb({encapsulation:2,styles:[],data:{}});function A(t){return r.Fb(2,[r.xb(null,0)],null,null)}var P=r.nb({encapsulation:2,styles:[],data:{}});function D(t){return r.Fb(2,[r.xb(null,0)],null,null)}var R=r.nb({encapsulation:2,styles:[],data:{}});function N(t){return r.Fb(2,[r.xb(null,0)],null,null)}var j=r.nb({encapsulation:2,styles:[],data:{}});function M(t){return r.Fb(2,[r.xb(null,0)],null,null)}var L=r.nb({encapsulation:2,styles:[],data:{}});function F(t){return r.Fb(2,[r.xb(null,0)],null,null)}var U=r.nb({encapsulation:2,styles:[],data:{}});function V(t){return r.Fb(2,[r.xb(null,0)],null,null)}var q=r.nb({encapsulation:2,styles:[],data:{}});function B(t){return r.Fb(2,[r.xb(null,0)],null,null)}var W=r.nb({encapsulation:2,styles:[],data:{}});function z(t){return r.Fb(2,[r.xb(null,0)],null,null)}var H=r.nb({encapsulation:2,styles:[],data:{}});function $(t){return r.Fb(2,[r.xb(null,0)],null,null)}},oQnE:function(t,e,n){"use strict";var r=n("VqlW")(!0);n("Td+X")(String,"String",(function(t){this._t=String(t),this._i=0}),(function(){var t,e=this._t,n=this._i;return n>=e.length?{value:void 0,done:!0}:(t=r(e,n),this._i+=t.length,{value:t,done:!1})}))},ocqh:function(t,e,n){"use strict";n.d(e,"a",(function(){return r})),n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return o}
1)),n.d(e,"d",(function(){return a})),n.d(e,"e",(function(){return s}));var r="ionViewWillEnter",i="ionViewDidEnter",o="ionViewWillLeave",a="ionViewDidLeave",s="ionViewWillUnload"},os0x:function(t,e,n){"use strict";n.r(e),n.d(e,"__extends",(function(){return i})),n.d(e,"__assign",(function(){return o})),n.d(e,"__rest",(function(){return a})),n.d(e,"__decorate",(function(){return s})),n.d(e,"__param",(function(){return u})),n.d(e,"__metadata",(function(){return c})),n.d(e,"__awaiter",(function(){return l})),n.d(e,"__generator",(function(){return h})),n.d(e,"__exportStar",(function(){return f})),n.d(e,"__values",(function(){return d})),n.d(e,"__read",(function(){return p})),n.d(e,"__spread",(function(){return m})),n.d(e,"__await",(function(){return y})),n.d(e,"__asyncGenerator",(function(){return v})),n.d(e,"__asyncDelegator",(function(){return g})),n.d(e,"__asyncValues",(function(){return b})),n.d(e,"__makeTemplateObject",(function(){return w})),n.d(e,"__importStar",(function(){return _})),n.d(e,"__importDefault",(function(){return S}));var r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};function i(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var o=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t};function a(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&(n[r[i]]=t[r[i]])}return n}function s(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a}function u(t,e){return function(n,r){e(n,r,t)}}function c(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function l(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(e){o(e)}}function s(t){try{u(r.throw(t))}catch(e){o(e)}}function u(t){t.done?i(t.value):new n((function(e){e(t.value)})).then(a,s)}u((r=r.apply(t,e||[])).next())}))}function h(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=r[2&o[0]?"return":o[0]?"throw":"next"])&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[0,i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}function f(t,e){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}function d(t){var e="function"==typeof Symbol&&t[Symbol.iterator],n=0;return e?e.call(t):{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}}function p(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function m(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(p(arguments[e]));return t}function y(t){return this instanceof y?(this.v=t,this):new y(t)}function v(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(t,e||[]),o=[];return r={},a("next"),a("throw"),a("return"),r[Symbol.asyncIterator]=function(){return this},r;function a(t){i[t]&&(r[t]=function(e){return new Promise((function(n,r){o.push([t,e,n,r])>1||s(t,e)}))})}function s(t,e){try{(n=i[t](e)).value instanceof y?Promise.resolve(n.value.v).then(u,c):l(o[0][2],n)}catch(r){l(o[0][3],r)}var n}function u(t){s("next",t)}function c(t){s("throw",t)}function l(t,e){t(e),o.shift(),o.length&&s(o[0][0],o[0][1])}}function g(t){var e,n;return e={},r("next"),r("throw",(function(t){throw t})),r("return"),e[Symbol.iterator]=function(){return this},e;function r(r,i){t[r]&&(e[r]=function(e){return(n=!n)?{value:y(t[r](e)),done:"return"===r}:i?i(e):e})}}function b(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator];return e?e.call(t):d(t)}function w(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function _(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function S(t){return t&&t.__esModule?t:{default:t}}},oxOc:function(t,e,n){var r=n("gYfK");t.exports=Array.isArray||function(t){return"Array"==r(t)}},p0ib:function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r=n("6blF"),i=n("nkY7"),o=n("Zn8D"),a=n("IUTb");function s(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Number.POSITIVE_INFINITY,s=null,u=t[t.length-1];return Object(i.a)(u)?(s=t.pop(),t.length>
11&&"number"==typeof t[t.length-1]&&(n=t.pop())):"number"==typeof u&&(n=t.pop()),null===s&&1===t.length&&t[0]instanceof r.a?t[0]:Object(o.a)(n)(Object(a.a)(t,s))}},pMnS:function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r=n("CcnG"),i=n("ZYCi"),o=r.nb({encapsulation:2,styles:[],data:{}});function a(t){return r.Fb(0,[(t()(),r.pb(0,16777216,null,null,1,"router-outlet",[],null,null,null,null,null)),r.ob(1,212992,null,0,i.r,[i.b,r.O,r.j,[8,null],r.h],null,null)],(function(t,e){t(e,1,0)}),null)}function s(t){return r.Fb(0,[(t()(),r.pb(0,0,null,null,1,"ng-component",[],null,null,null,a,o)),r.ob(1,49152,null,0,i.v,[],null,null)],null,null)}var u=r.lb("ng-component",i.v,s,{},{},[])},pZxE:function(t,e,n){"use strict";var r=setTimeout;function i(){}function o(t){if(!(this instanceof o))throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],h(t,this)}function a(t,e){for(;3===t._state;)t=t._value;0!==t._state?(t._handled=!0,o._immediateFn((function(){var n=1===t._state?e.onFulfilled:e.onRejected;if(null!==n){var r;try{r=n(t._value)}catch(i){return void u(e.promise,i)}s(e.promise,r)}else(1===t._state?s:u)(e.promise,t._value)}))):t._deferreds.push(e)}function s(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if(e instanceof o)return t._state=3,t._value=e,void c(t);if("function"==typeof n)return void h((r=n,i=e,function(){r.apply(i,arguments)}),t)}t._state=1,t._value=e,c(t)}catch(a){u(t,a)}var r,i}function u(t,e){t._state=2,t._value=e,c(t)}function c(t){2===t._state&&0===t._deferreds.length&&o._immediateFn((function(){t._handled||o._unhandledRejectionFn(t._value)}));for(var e=0,n=t._deferreds.length;e<n;e++)a(t,t._deferreds[e]);t._deferreds=null}function l(t,e,n){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=n}function h(t,e){var n=!1;try{t((function(t){n||(n=!0,s(e,t))}),(function(t){n||(n=!0,u(e,t))}))}catch(r){if(n)return;n=!0,u(e,r)}}o.prototype.catch=function(t){return this.then(null,t)},o.prototype.then=function(t,e){var n=new this.constructor(i);return a(this,new l(t,e,n)),n},o.prototype.finally=function(t){var e=this.constructor;return this.then((function(n){return e.resolve(t()).then((function(){return n}))}),(function(n){return e.resolve(t()).then((function(){return e.reject(n)}))}))},o.all=function(t){return new o((function(e,n){if(!t||void 0===t.length)throw new TypeError("Promise.all accepts an array");var r=Array.prototype.slice.call(t);if(0===r.length)return e([]);var i=r.length;function o(t,a){try{if(a&&("object"==typeof a||"function"==typeof a)){var s=a.then;if("function"==typeof s)return void s.call(a,(function(e){o(t,e)}),n)}r[t]=a,0==--i&&e(r)}catch(u){n(u)}}for(var a=0;a<r.length;a++)o(a,r[a])}))},o.resolve=function(t){return t&&"object"==typeof t&&t.constructor===o?t:new o((function(e){e(t)}))}
1,o.reject=function(t){return new o((function(e,n){n(t)}))},o.race=function(t){return new o((function(e,n){for(var r=0,i=t.length;r<i;r++)t[r].then(e,n)}))},o._immediateFn="function"==typeof setImmediate&&function(t){setImmediate(t)}||function(t){r(t,0)},o._unhandledRejectionFn=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)};var f=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw new Error("unable to locate global object")}();f.Promise||(f.Promise=o)},psW0:function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var r=n("mrSG"),i=n("zotm"),o=n("MGBS"),a=n("rPjj"),s=n("67Y/"),u=n("0/uQ");function c(t,e,n){return void 0===n&&(n=Number.POSITIVE_INFINITY),"function"==typeof e?function(r){return r.pipe(c((function(n,r){return Object(u.a)(t(n,r)).pipe(Object(s.a)((function(t,i){return e(n,t,r,i)})))}),n))}:("number"==typeof e&&(n=e),function(e){return e.lift(new l(t,n))})}var l=function(){function t(t,e){void 0===e&&(e=Number.POSITIVE_INFINITY),this.project=t,this.concurrent=e}return t.prototype.call=function(t,e){return e.subscribe(new h(t,this.project,this.concurrent))},t}(),h=function(t){function e(e,n,r){void 0===r&&(r=Number.POSITIVE_INFINITY);var i=t.call(this,e)||this;return i.project=n,i.concurrent=r,i.hasCompleted=!1,i.buffer=[],i.active=0,i.index=0,i}return r.d(e,t),e.prototype._next=function(t){this.active<this.concurrent?this._tryNext(t):this.buffer.push(t)},e.prototype._tryNext=function(t){var e,n=this.index++;try{e=this.project(t,n)}catch(r){return void this.destination.error(r)}this.active++,this._innerSub(e,t,n)},e.prototype._innerSub=function(t,e,n){var r=new a.a(this,void 0,void 0);this.destination.add(r),Object(i.a)(this,t,e,n,r)},e.prototype._complete=function(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&this.destination.complete(),this.unsubscribe()},e.prototype.notifyNext=function(t,e,n,r,i){this.destination.next(e)},e.prototype.notifyComplete=function(t){var e=this.buffer;this.remove(t),this.active--,e.length>0?this._next(e.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},e}(o.a)},pugT:function(t,e,n){"use strict";var r=n("isby"),i=n("McSo"),o=n("2Bdj"),a=n("Ehmk"),s=n("eihs");function u(t){return Error.call(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map((function(t,e){return e+1+") "+t.toString()})).join("\n  "):"",this.name="UnsubscriptionError",this.errors=t,this}u.prototype=Object.create(Error.prototype);var c=u;n.d(e,"a",(function(){return l}));var l=function(){function t(t){this.closed=!1,this._parent=null,this._parents=null,this._subscriptions=null,t&&(this._unsubscribe=t)}var e;return t.prototype.unsubscribe=function(){var t,e=!1;if(!this.closed){var n=this._parent,u=this._parents,l=this._unsubscribe,f=this._subscriptions;this.closed=!0,this._parent=null,this._parents=null,this._subscriptions=null;for(var d=-1,p=u?u.length:0;n;)n.remove(this),n=++d<p&&u[d]||null;if(Object(o.a)(l)&&Object(a.a)(l).call(this)===s.a&&(e=!0,t=t||(s.a.e instanceof c?h(s.a.e.errors):[s.a.e])),Object(r.a)(f))for(d=-1,p=f.length;++d<p;){var m=f[d];if(Object(i.a)(m)&&Object(a.a)(m.unsubscribe).call(m)===s.a){e=!0,t=t||[];var y=s.a.e;y instanceof c?t=t.concat(h(y.errors)):t.push(y)}}if(e)throw new c(t)}},t.prototype.add=function(e){if(!e||e===t.EMPTY)return t.EMPTY;if(e===this)return this;var n=e;switch(typeof e){case"function":n=new t(e);case"object":if(n.closed||"function"!=typeof n.unsubscribe)return n;if(this.closed)return n.unsubscribe(),n;if("function"!=typeof n._addParent){var r=n;(n=new t)._subscriptions=[r]}break;default:throw new Error("unrecognized teardown "+e+" added to Subscription.")}return(this._subscriptions||(this._subscriptions=[])).push(n),n._addParent(this),n},t.prototype.remove=function(t){var e=this._subscriptions;if(e){var n=e.indexOf(t);-1!==n&&e.splice(n,1)}},t.prototype._addParent=function(t){var e=this._parent,n=this._parents;e&&e!==t?n?-1===n.indexOf(t)&&n.push(t):this._parents=[t]:this._parent=t},t.EMPTY=((e=new t).closed=!0,e),t}();function h(t){return t.reduce((function(t,e){return t.concat(e instanceof c?e.errors:e)}),[])}},"q/0M":function(t,e,n){"use strict";n.r(e),n.d(e,"setLogLevel",(function(){return u})),n.d(e,"Logger",(function(){return s})),n.d(e,"LogLevel",(function(){return i}));var r=[],i=function(t){return t[t.DEBUG=0]="DEBUG",t[t.VERBOSE=1]="VERBOSE",t[t.INFO=2]="INFO",t[t.WARN=3]="WARN",t[t.ERROR=4]="ERROR",t[t.SILENT=5]="SILENT",t}({}),o=i.INFO,a=function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];if(!(e<t.logLevel)){var o=(new Date).toISOString();switch(e){case i.DEBUG:case i.VERBOSE:console.log.apply(console,["["+o+"]  "+t.name+":"].concat(n));break;case i.INFO:console.info.apply(console,["["+o+"]  "+t.name+":"].concat(n));break;case i.WARN:console.warn.apply(console,["["+o+"]  "+t.name+":"].concat(n));break;case i.ERROR:console.error.apply(console,["["+o+"]  "+t.name+":"].concat(n));break;default:throw new Error("Attempted to log a message with an invali
1d logType (value: "+e+")")}}},s=function(){function t(t){this.name=t,this._logLevel=o,this._logHandler=a,r.push(this)}return Object.defineProperty(t.prototype,"logLevel",{get:function(){return this._logLevel},set:function(t){if(!(t in i))throw new TypeError("Invalid value assigned to `logLevel`");this._logLevel=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"logHandler",{get:function(){return this._logHandler},set:function(t){if("function"!=typeof t)throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=t},enumerable:!0,configurable:!0}),t.prototype.debug=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._logHandler.apply(this,[this,i.DEBUG].concat(t))},t.prototype.log=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._logHandler.apply(this,[this,i.VERBOSE].concat(t))},t.prototype.info=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._logHandler.apply(this,[this,i.INFO].concat(t))},t.prototype.warn=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._logHandler.apply(this,[this,i.WARN].concat(t))},t.prototype.error=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._logHandler.apply(this,[this,i.ERROR].concat(t))},t}();function u(t){r.forEach((function(e){e.logLevel=t}))}},q098:function(t,e,n){t.exports=!n("lIov")&&!n("61rj")((function(){return 7!=Object.defineProperty(n("y6nS")("div"),"a",{get:function(){return 7}}).a}))},qtiw:function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},rJ5Q:function(t,e,n){"use strict";n.d(e,"a",(function(){return a})),n("CqG3");var r=n("iqUP"),i=n("CcnG"),o=n("fvl4"),a=function(){function t(t){this.afs=t,this.logCollection=this.afs.collection("errorLog")}return t.prototype.writeFireStoreErrorLog=function(t,e,n,i){this.initErrorDetail(),this.errorDetail.uid=t,this.errorDetail.errorString=e,this.errorDetail.insDt=r.firestore.FieldValue.serverTimestamp(),this.errorDetail.moduleName=n,this.errorDetail.placeId=i,this.logCollection.add(this.errorDetail)},t.prototype.initErrorDetail=function(){this.errorDetail.uid="",this.errorDetail.errorString="",this.errorDetail.insDt=null,this.errorDetail.moduleName="",this.errorDetail.placeId=""},t.ngInjectableDef=i.S({factory:function(){return new t(i.W(o.a))},token:t,providedIn:"root"}),t}()},rPjj:function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n("mrSG"),i=function(t){function e(e,n,r){var i=t.call(this)||this;return i.parent=e,i.outerValue=n,i.outerIndex=r,i.index=0,i}return r.d(e,t),e.prototype._next=function(t){this.parent.notifyNext(this.outerValue,t,this.outerIndex,this.index++,this)},e.prototype._error=function(t){this.parent.notifyError(t,this),this.unsubscribe()},e.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},e}(n("FFOo").a)},rSCU:function(t,e,n){var r=n("H1Af"),i=n("8ouO");t.exports=function(t){return r(i(t))}},s6PA:function(t,e,n){"use strict";var r=n("I1rR"),i=n("mY8+")(5),o=!0;"find"in[]&&Array(1).find((function(){o=!1})),r(r.P+r.F*o,"Array",{find:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}}),n("dNFx")("find")},sE5F:function(t,e,n){"use strict";n.d(e,"i",(function(){return S})),n.d(e,"h",(function(){return M})),n.d(e,"c",(function(){return E})),n.d(e,"a",(function(){return k})),n.d(e,"f",(function(){return T})),n.d(e,"b",(function(){return h})),n.d(e,"g",(function(){return l})),n.d(e,"d",(function(){return j})),n.d(e,"e",(function(){return L}));var r=n("mrSG"),i=(n("CcnG"),n("6blF")),o=(n("ZYjt"),function(t){return t[t.Get=0]="Get",t[t.Post=1]="Post",t[t.Put=2]="Put",t[t.Delete=3]="Delete",t[t.Options=4]="Options",t[t.Head=5]="Head",t[t.Patch=6]="Patch",t}({})),a=function(t){return t[t.Unsent=0]="Unsent",t[t.Open=1]="Open",t[t.HeadersReceived=2]="HeadersReceived",t[t.Loading=3]="Loading",t[t.Done=4]="Done",t[t.Cancelled=5]="Cancelled",t}({}),s=function(t){return t[t.Basic=0]="Basic",t[t.Cors=1]="Cors",t[t.Default=2]="Default",t[t.Error=3]="Error",t[t.Opaque=4]="Opaque",t}({}),u=function(t){return t[t.NONE=0]="NONE",t[t.JSON=1]="JSON",t[t.FORM=2]="FORM",t[t.FORM_DATA=3]="FORM_DATA",t[t.TEXT=4]="TEXT",t[t.BLOB=5]="BLOB",t[t.ARRAY_BUFFER=6]="ARRAY_BUFFER",t}({}),c=function(){function t(e){var n=this;this._headers=new Map,this._normalizedNames=new Map,e&&(e instanceof t?e.forEach((function(t,e){t.forEach((function(t){return n.append(e,t)}))})):Object.keys(e).forEach((function(t){var r=Array.isArray(e[t])?e[t]:[e[t]];n.delete(t),r.forEach((function(e){return n.append(t,e)}))}
1)))}return t.fromResponseHeaderString=function(e){var n=new t;return e.split("\n").forEach((function(t){var e=t.indexOf(":");if(e>0){var r=t.slice(0,e),i=t.slice(e+1).trim();n.set(r,i)}})),n},t.prototype.append=function(t,e){var n=this.getAll(t);null===n?this.set(t,e):n.push(e)},t.prototype.delete=function(t){var e=t.toLowerCase();this._normalizedNames.delete(e),this._headers.delete(e)},t.prototype.forEach=function(t){var e=this;this._headers.forEach((function(n,r){return t(n,e._normalizedNames.get(r),e._headers)}))},t.prototype.get=function(t){var e=this.getAll(t);return null===e?null:e.length>0?e[0]:null},t.prototype.has=function(t){return this._headers.has(t.toLowerCase())},t.prototype.keys=function(){return Array.from(this._normalizedNames.values())},t.prototype.set=function(t,e){Array.isArray(e)?e.length&&this._headers.set(t.toLowerCase(),[e.join(",")]):this._headers.set(t.toLowerCase(),[e]),this.mayBeSetNormalizedName(t)},t.prototype.values=function(){return Array.from(this._headers.values())},t.prototype.toJSON=function(){var t=this,e={};return this._headers.forEach((function(n,i){var o=[];n.forEach((function(t){return o.push.apply(o,Object(r.i)(t.split(",")))})),e[t._normalizedNames.get(i)]=o})),e},t.prototype.getAll=function(t){return this.has(t)&&this._headers.get(t.toLowerCase())||null},t.prototype.entries=function(){throw new Error('"entries" method is not implemented on Headers class')},t.prototype.mayBeSetNormalizedName=function(t){var e=t.toLowerCase();this._normalizedNames.has(e)||this._normalizedNames.set(e,t)},t}(),l=function(){function t(t){void 0===t&&(t={});var e=t.body,n=t.status,r=t.headers,i=t.statusText,o=t.type,a=t.url;this.body=null!=e?e:null,this.status=null!=n?n:null,this.headers=null!=r?r:null,this.statusText=null!=i?i:null,this.type=null!=o?o:null,this.url=null!=a?a:null}return t.prototype.merge=function(e){return new t({body:e&&null!=e.body?e.body:this.body,status:e&&null!=e.status?e.status:this.status,headers:e&&null!=e.headers?e.headers:this.headers,statusText:e&&null!=e.statusText?e.statusText:this.statusText,type:e&&null!=e.type?e.type:this.type,url:e&&null!=e.url?e.url:this.url})},t}(),h=function(t){function e(){return t.call(this,{status:200,statusText:"Ok",type:s.Default,headers:new c})||this}return Object(r.d)(e,t),e}(l),f=function(){return function(){}}();function d(t){if("string"!=typeof t)return t;switch(t.toUpperCase()){case"GET":return o.Get;case"POST":return o.Post;case"PUT":return o.Put;case"DELETE":return o.Delete;case"OPTIONS":return o.Options;case"HEAD":return o.Head;case"PATCH":return o.Patch}throw new Error('Invalid request method. The method "'+t+'" is not supported.')}var p=function(){function t(){}return t.prototype.encodeKey=function(t){return m(t)},t.prototype.encodeValue=function(t){return m(t)},t}();function m(t){return encodeURIComponent(t).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/gi,"$").replace(/%2C/gi,",").replace(/%3B/gi,";").replace(/%2B/gi,"+").replace(/%3D/gi,"=").replace(/%3F/gi,"?").replace(/%2F/gi,"/")}var y=function(){function t(t,e){void 0===t&&(t=""),void 0===e&&(e=new p),this.rawParams=t,this.queryEncoder=e,this.paramsMap=function(t){void 0===t&&(t="");var e=new Map;return t.length>0&&t.split("&").forEach((function(t){var n=t.indexOf("="),i=Object(r.h)(-1==n?[t,""]:[t.slice(0,n),t.slice(n+1)],2),o=i[0],a=i[1],s=e.get(o)||[];s.push(a),e.set(o,s)})),e}(t)}return t.prototype.clone=function(){var e=new t("",this.queryEncoder);return e.appendAll(this),e},t.prototype.has=function(t){return this.paramsMap.has(t)},t.prototype.get=function(t){var e=this.paramsMap.get(t);return Array.isArray(e)?e[0]:null},t.prototype.getAll=function(t){return this.paramsMap.get(t)||[]},t.prototype.set=function(t,e){if(null!=e){var n=this.paramsMap.get(t)||[];n.length=0,n.push(e),this.paramsMap.set(t,n)}else this.delete(t)},t.prototype.setAll=function(t){var e=this;t.paramsMap.forEach((function(t,n){var r=e.paramsMap.get(n)||[];r.length=0,r.push(t[0]),e.paramsMap.set(n,r)}))},t.prototype.append=function(t,e){if(null!=e){var n=this.paramsMap.get(t)||[];
1n.push(e),this.paramsMap.set(t,n)}},t.prototype.appendAll=function(t){var e=this;t.paramsMap.forEach((function(t,n){for(var r=e.paramsMap.get(n)||[],i=0;i<t.length;++i)r.push(t[i]);e.paramsMap.set(n,r)}))},t.prototype.replaceAll=function(t){var e=this;t.paramsMap.forEach((function(t,n){var r=e.paramsMap.get(n)||[];r.length=0;for(var i=0;i<t.length;++i)r.push(t[i]);e.paramsMap.set(n,r)}))},t.prototype.toString=function(){var t=this,e=[];return this.paramsMap.forEach((function(n,r){n.forEach((function(n){return e.push(t.queryEncoder.encodeKey(r)+"="+t.queryEncoder.encodeValue(n))}))})),e.join("&")},t.prototype.delete=function(t){this.paramsMap.delete(t)},t}(),v=function(){function t(){}return t.prototype.json=function(){return"string"==typeof this._body?JSON.parse(this._body):this._body instanceof ArrayBuffer?JSON.parse(this.text()):this._body},t.prototype.text=function(t){if(void 0===t&&(t="legacy"),this._body instanceof y)return this._body.toString();if(this._body instanceof ArrayBuffer)switch(t){case"legacy":return String.fromCharCode.apply(null,new Uint16Array(this._body));case"iso-8859":return String.fromCharCode.apply(null,new Uint8Array(this._body));default:throw new Error("Invalid value for encodingHint: "+t)}return null==this._body?"":"object"==typeof this._body?JSON.stringify(this._body,null,2):this._body.toString()},t.prototype.arrayBuffer=function(){return this._body instanceof ArrayBuffer?this._body:function(t){for(var e=new Uint16Array(t.length),n=0,r=t.length;n<r;n++)e[n]=t.charCodeAt(n);return e.buffer}(this.text())},t.prototype.blob=function(){if(this._body instanceof Blob)return this._body;if(this._body instanceof ArrayBuffer)return new Blob([this._body]);throw new Error("The request body isn't either a blob or an array buffer")},t}(),g=function(t){function e(e){var n=t.call(this)||this;return n._body=e.body,n.status=e.status,n.ok=n.status>=200&&n.status<=299,n.statusText=e.statusText,n.headers=e.headers,n.type=e.type,n.url=e.url,n}return Object(r.d)(e,t),e.prototype.toString=function(){return"Response with status: "+this.status+" "+this.statusText+" for URL: "+this.url},e}(v),b=0,w=null;function _(){var t="object"==typeof window?window:{};return null===w&&(w=t.__ng_jsonp__={}),w}var S=function(){function t(){}return t.prototype.build=function(t){var e=document.createElement("script");return e.src=t,e},t.prototype.nextRequestID=function(){return"__req"+b++},t.prototype.requestCallback=function(t){return"__ng_jsonp__."+t+".finished"},t.prototype.exposeConnection=function(t,e){_()[t]=e},t.prototype.removeConnection=function(t){_()[t]=null},t.prototype.send=function(t){document.body.appendChild(t)},t.prototype.cleanup=function(t){t.parentNode&&t.parentNode.removeChild(t)},t}(),C=function(){function t(t,e,n){var r=this;if(this._dom=e,this.baseResponseOptions=n,this._finished=!1,t.method!==o.Get)throw new TypeError("JSONP requests must use GET request method.");this.request=t,this.response=new i.a((function(i){r.readyState=a.Loading;var o=r._id=e.nextRequestID();e.exposeConnection(o,r);var u=e.requestCallback(r._id),c=t.url;c.indexOf("=JSONP_CALLBACK&")>-1?c=c.replace("=JSONP_CALLBACK&","="+u+"&"):c.lastIndexOf("=JSONP_CALLBACK")===c.length-"=JSONP_CALLBACK".length&&(c=c.substring(0,c.length-"=JSONP_CALLBACK".length)+"="+u);var h=r._script=e.build(c),f=function(t){if(r.readyState!==a.Cancelled){if(r.readyState=a.Done,e.cleanup(h),!r._finished){var o=new l({body:"JSONP injected script did not invoke callback.",type:s.Error,url:c});return n&&(o=n.merge(o)),void i.error(new g(o))}var u=new l({body:r._responseData,url:c});r.baseResponseOptions&&(u=r.baseResponseOptions.merge(u)),i.next(new g(u)),i.complete()}},d=function(t){if(r.readyState!==a.Cancelled){r.readyState=a.Done,e.cleanup(h);var o=new l({body:t.message,type:s.Error});n&&(o=n.merge(o)),i.error(new g(o))}};return h.addEventListener("load",f),h.addEventListener("error",d),e.send(h),function(){r.readyState=a.Cancelled,h.removeEventListener("load",f),h.removeEventListener("error",d),r._dom.cleanup(h)}}))}return t.prototype.finished=function(t){this._finished=!0,this._dom.removeConnection(this._id),this.readyState!==a.
1Cancelled&&(this._responseData=t)},t}(),E=function(t){function e(e,n){var r=t.call(this)||this;return r._browserJSONP=e,r._baseResponseOptions=n,r}return Object(r.d)(e,t),e.prototype.createConnection=function(t){return new C(t,this._browserJSONP,this._baseResponseOptions)},e}(f),T=function(){function t(t){void 0===t&&(t={});var e=t.method,n=t.headers,r=t.body,i=t.url,o=t.search,a=t.params,s=t.withCredentials,u=t.responseType;this.method=null!=e?d(e):null,this.headers=null!=n?n:null,this.body=null!=r?r:null,this.url=null!=i?i:null,this.params=this._mergeSearchParams(a||o),this.withCredentials=null!=s?s:null,this.responseType=null!=u?u:null}return Object.defineProperty(t.prototype,"search",{get:function(){return this.params},set:function(t){this.params=t},enumerable:!0,configurable:!0}),t.prototype.merge=function(e){return new t({method:e&&null!=e.method?e.method:this.method,headers:e&&null!=e.headers?e.headers:new c(this.headers),body:e&&null!=e.body?e.body:this.body,url:e&&null!=e.url?e.url:this.url,params:e&&this._mergeSearchParams(e.params||e.search),withCredentials:e&&null!=e.withCredentials?e.withCredentials:this.withCredentials,responseType:e&&null!=e.responseType?e.responseType:this.responseType})},t.prototype._mergeSearchParams=function(t){return t?t instanceof y?t.clone():"string"==typeof t?new y(t):this._parseParams(t):this.params},t.prototype._parseParams=function(t){var e=this;void 0===t&&(t={});var n=new y;return Object.keys(t).forEach((function(r){var i=t[r];Array.isArray(i)?i.forEach((function(t){return e._appendParam(r,t,n)})):e._appendParam(r,i,n)})),n},t.prototype._appendParam=function(t,e,n){"string"!=typeof e&&(e=JSON.stringify(e)),n.append(t,e)},t}(),k=function(t){function e(){return t.call(this,{method:o.Get,headers:new c})||this}return Object(r.d)(e,t),e}(T),I=function(t){function e(e){var n=t.call(this)||this,r=e.url;n.url=e.url;var i,o=e.params||e.search;if(o&&(i="object"!=typeof o||o instanceof y?o.toString():function(t){var e=new y;return Object.keys(t).forEach((function(n){var r=t[n];r&&Array.isArray(r)?r.forEach((function(t){return e.append(n,t.toString())})):e.append(n,r.toString())})),e}(o).toString()).length>0){var a="?";-1!=n.url.indexOf("?")&&(a="&"==n.url[n.url.length-1]?"":"&"),n.url=r+a+i}return n._body=e.body,n.method=d(e.method),n.headers=new c(e.headers),n.contentType=n.detectContentType(),n.withCredentials=e.withCredentials,n.responseType=e.responseType,n}return Object(r.d)(e,t),e.prototype.detectContentType=function(){switch(this.headers.get("content-type")){case"application/json":return u.JSON;case"application/x-www-form-urlencoded":return u.FORM;case"multipart/form-data":return u.FORM_DATA;case"text/plain":case"text/html":return u.TEXT;case"application/octet-stream":return this._body instanceof D?u.ARRAY_BUFFER:u.BLOB;default:return this.detectContentTypeFromBody()}},e.prototype.detectContentTypeFromBody=function(){return null==this._body?u.NONE:this._body instanceof y?u.FORM:this._body instanceof A?u.FORM_DATA:this._body instanceof P?u.BLOB:this._body instanceof D?u.ARRAY_BUFFER:this._body&&"object"==typeof this._body?u.JSON:u.TEXT},e.prototype.getBody=function(){switch(this.contentType){case u.JSON:case u.FORM:return this.text();case u.FORM_DATA:return this._body;case u.TEXT:return this.text();case u.BLOB:return this.blob();case u.ARRAY_BUFFER:return this.arrayBuffer();default:return null}},e}(v),O=function(){},x="object"==typeof window?window:O,A=x.FormData||O,P=x.Blob||O,D=x.ArrayBuffer||O;function R(t,e){return t.createConnection(e).response}function N(t,e,n,r){return t.merge(new T(e?{method:e.method||n,url:e.url||r,search:e.search,params:e.params,headers:e.headers,body:e.body,withCredentials:e.withCredentials,responseType:e.responseType}:{method:n,url:r}))}var j=function(t){function e(e,n){return t.call(this,e,n)||this}return Object(r.d)(e,t),e.prototype.request=function(t,e){if("string"==typeof t&&(t=new I(N(this._defaultOptions,e,o.Get,t))),!(t instanceof I))throw new Error("First argument must be a url string or Request instance.");if(t.method!==o.Get)throw new Error("JSONP requests must use GET request method.");return R(this._backend,t)},e}(function(){function t(t,e){this._backend=t,this._defaultOptions=e}return t.prototype.request=function(t,e){var n;if("string"==typeof t)n=R(this._backend,new I(N(this._defaultOptions,e,o.Get,t)));else{if(!(t instanceof I))throw new Error("First argument must be a url string or Request instance.");
1n=R(this._backend,t)}return n},t.prototype.get=function(t,e){return this.request(new I(N(this._defaultOptions,e,o.Get,t)))},t.prototype.post=function(t,e,n){return this.request(new I(N(this._defaultOptions.merge(new T({body:e})),n,o.Post,t)))},t.prototype.put=function(t,e,n){return this.request(new I(N(this._defaultOptions.merge(new T({body:e})),n,o.Put,t)))},t.prototype.delete=function(t,e){return this.request(new I(N(this._defaultOptions,e,o.Delete,t)))},t.prototype.patch=function(t,e,n){return this.request(new I(N(this._defaultOptions.merge(new T({body:e})),n,o.Patch,t)))},t.prototype.head=function(t,e){return this.request(new I(N(this._defaultOptions,e,o.Head,t)))},t.prototype.options=function(t,e){return this.request(new I(N(this._defaultOptions,e,o.Options,t)))},t}());function M(t,e){return new j(t,e)}var L=function(){return function(){}}()},sQ1z:function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},sl9K:function(t,e,n){var r=n("M1gn");t.exports=function(t,e){return new(r(t))(e)}},"t/Na":function(t,e,n){"use strict";n.d(e,"l",(function(){return R})),n.d(e,"o",(function(){return F})),n.d(e,"p",(function(){return U})),n.d(e,"m",(function(){return j})),n.d(e,"n",(function(){return M})),n.d(e,"b",(function(){return f})),n.d(e,"f",(function(){return h})),n.d(e,"c",(function(){return I})),n.d(e,"g",(function(){return d})),n.d(e,"a",(function(){return x})),n.d(e,"d",(function(){return B})),n.d(e,"e",(function(){return q})),n.d(e,"k",(function(){return V})),n.d(e,"h",(function(){return N})),n.d(e,"j",(function(){return D})),n.d(e,"i",(function(){return L}));var r=n("mrSG"),i=n("CcnG"),o=n("F/XL"),a=n("6blF"),s=n("Phjn"),u=n("VnD/"),c=n("67Y/"),l=n("Ip0R"),h=function(){return function(){}}(),f=function(){return function(){}}(),d=function(){function t(t){var e=this;this.normalizedNames=new Map,this.lazyUpdate=null,t?this.lazyInit="string"==typeof t?function(){e.headers=new Map,t.split("\n").forEach((function(t){var n=t.indexOf(":");if(n>0){var r=t.slice(0,n),i=r.toLowerCase(),o=t.slice(n+1).trim();e.maybeSetNormalizedName(r,i),e.headers.has(i)?e.headers.get(i).push(o):e.headers.set(i,[o])}}))}:function(){e.headers=new Map,Object.keys(t).forEach((function(n){var r=t[n],i=n.toLowerCase();"string"==typeof r&&(r=[r]),r.length>0&&(e.headers.set(i,r),e.maybeSetNormalizedName(n,i))}))}:this.headers=new Map}return t.prototype.has=function(t){return this.init(),this.headers.has(t.toLowerCase())},t.prototype.get=function(t){this.init();var e=this.headers.get(t.toLowerCase());return e&&e.length>0?e[0]:null},t.prototype.keys=function(){return this.init(),Array.from(this.normalizedNames.values())},t.prototype.getAll=function(t){return this.init(),this.headers.get(t.toLowerCase())||null},t.prototype.append=function(t,e){return this.clone({name:t,value:e,op:"a"})},t.prototype.set=function(t,e){return this.clone({name:t,value:e,op:"s"})},t.prototype.delete=function(t,e){return this.clone({name:t,value:e,op:"d"})},t.prototype.maybeSetNormalizedName=function(t,e){this.normalizedNames.has(e)||this.normalizedNames.set(e,t)},t.prototype.init=function(){var e=this;this.lazyInit&&(this.lazyInit instanceof t?this.copyFrom(this.lazyInit):this.lazyInit(),this.lazyInit=null,this.lazyUpdate&&(this.lazyUpdate.forEach((function(t){return e.applyUpdate(t)})),this.lazyUpdate=null))},t.prototype.copyFrom=function(t){var e=this;t.init(),Array.from(t.headers.keys()).forEach((function(n){e.headers.set(n,t.headers.get(n)),e.normalizedNames.set(n,t.normalizedNames.get(n))}))},t.prototype.clone=function(e){var n=new t;return n.lazyInit=this.lazyInit&&this.lazyInit instanceof t?this.lazyInit:this,n.lazyUpdate=(this.lazyUpdate||[]).concat([e]),n},t.prototype.applyUpdate=function(t){var e=t.name.toLowerCase();switch(t.op){case"a":case"s":var n=t.value;if("string"==typeof n&&(n=[n]),0===n.length)return;this.maybeSetNormalizedName(t.name,e);var i=("a"===t.op?this.headers.get(e):void 0)||[];i.push.apply(i,Object(r.i)(n)),this.headers.set(e,i);break;case"d":var o=t.value;if(o){var a=this.headers.get(e);if(!a)return;0===(a=a.filter((function(t){return-1===o.indexOf(t)}))).length?(this.headers.delete(e),this.normalizedNames.delete(e)):this.headers.set(e,a)}else this.headers.delete(e),this.normalizedNames.delete(e)}},t.prototype.forEach=function(t){var e=this;
vendor: 9,811 bytes, line 1
1this.init(),Array.from(this.normalizedNames.keys()).forEach((function(n){return t(e.normalizedNames.get(n),e.headers.get(n))}))},t}(),p=function(){function t(){}return t.prototype.encodeKey=function(t){return m(t)},t.prototype.encodeValue=function(t){return m(t)},t.prototype.decodeKey=function(t){return decodeURIComponent(t)},t.prototype.decodeValue=function(t){return decodeURIComponent(t)},t}();function m(t){return encodeURIComponent(t).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/gi,"$").replace(/%2C/gi,",").replace(/%3B/gi,";").replace(/%2B/gi,"+").replace(/%3D/gi,"=").replace(/%3F/gi,"?").replace(/%2F/gi,"/")}var y=function(){function t(t){void 0===t&&(t={});var e,n,i,o=this;if(this.updates=null,this.cloneFrom=null,this.encoder=t.encoder||new p,t.fromString){if(t.fromObject)throw new Error("Cannot specify both fromString and fromObject.");this.map=(e=t.fromString,n=this.encoder,i=new Map,e.length>0&&e.split("&").forEach((function(t){var e=t.indexOf("="),o=Object(r.h)(-1==e?[n.decodeKey(t),""]:[n.decodeKey(t.slice(0,e)),n.decodeValue(t.slice(e+1))],2),a=o[0],s=o[1],u=i.get(a)||[];u.push(s),i.set(a,u)})),i)}else t.fromObject?(this.map=new Map,Object.keys(t.fromObject).forEach((function(e){var n=t.fromObject[e];o.map.set(e,Array.isArray(n)?n:[n])}))):this.map=null}return t.prototype.has=function(t){return this.init(),this.map.has(t)},t.prototype.get=function(t){this.init();var e=this.map.get(t);return e?e[0]:null},t.prototype.getAll=function(t){return this.init(),this.map.get(t)||null},t.prototype.keys=function(){return this.init(),Array.from(this.map.keys())},t.prototype.append=function(t,e){return this.clone({param:t,value:e,op:"a"})},t.prototype.set=function(t,e){return this.clone({param:t,value:e,op:"s"})},t.prototype.delete=function(t,e){return this.clone({param:t,value:e,op:"d"})},t.prototype.toString=function(){var t=this;return this.init(),this.keys().map((function(e){var n=t.encoder.encodeKey(e);return t.map.get(e).map((function(e){return n+"="+t.encoder.encodeValue(e)})).join("&")})).join("&")},t.prototype.clone=function(e){var n=new t({encoder:this.encoder});return n.cloneFrom=this.cloneFrom||this,n.updates=(this.updates||[]).concat([e]),n},t.prototype.init=function(){var t=this;null===this.map&&(this.map=new Map),null!==this.cloneFrom&&(this.cloneFrom.init(),this.cloneFrom.keys().forEach((function(e){return t.map.set(e,t.cloneFrom.map.get(e))})),this.updates.forEach((function(e){switch(e.op){case"a":case"s":var n=("a"===e.op?t.map.get(e.param):void 0)||[];n.push(e.value),t.map.set(e.param,n);break;case"d":if(void 0===e.value){t.map.delete(e.param);break}var r=t.map.get(e.param)||[],i=r.indexOf(e.value);-1!==i&&r.splice(i,1),r.length>0?t.map.set(e.param,r):t.map.delete(e.param)}})),this.cloneFrom=this.updates=null)},t}();function v(t){return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer}function g(t){return"undefined"!=typeof Blob&&t instanceof Blob}function b(t){return"undefined"!=typeof FormData&&t instanceof FormData}var w=function(){function t(t,e,n,r){var i;if(this.url=e,this.body=null,this.reportProgress=!1,this.withCredentials=!1,this.responseType="json",this.method=t.toUpperCase(),function(t){switch(t){case"DELETE":case"GET":case"HEAD":case"OPTIONS":case"JSONP":return!1;default:return!0}}(this.method)||r?(this.body=void 0!==n?n:null,i=r):i=n,i&&(this.reportProgress=!!i.reportProgress,this.withCredentials=!!i.withCredentials,i.responseType&&(this.responseType=i.responseType),i.headers&&(this.headers=i.headers),i.params&&(this.params=i.params)),this.headers||(this.headers=new d),this.params){var o=this.params.toString();if(0===o.length)this.urlWithParams=e;else{var a=e.indexOf("?");this.urlWithParams=e+(-1===a?"?":a<e.length-1?"&":"")+o}}else this.params=new y,this.urlWithParams=e}return t.prototype.serializeBody=function(){return null===this.body?null:v(this.body)||g(this.body)||b(this.body)||"string"==typeof this.body?this.body:this.body instanceof y?this.body.toString():"object"==typeof this.body||"boolean"==typeof this.body||Array.isArray(this.body)?JSON.stringify(this.body):this.body.toString()},t.prototype.detectContentTypeHeader=function(){return null===this.body||b(this.body)?null:g(this.body)?this.body.type||null:v(this.body)?null:"string"==typeof this.body?"text/plain":this.body instanceof y?"application/x-www-form-urlencoded;charset=UTF-8":"object"==typeof this.body||"number"==typeof this.body||Array.isArray(this.body)?"application/json":null},t.prototype.clone=function(e){void 0===e&&(e={});var n=e.method||this.method,r=e.url||this.url,i=e.responseType||this.responseType,o=void 0!==e.body?e.body:this.body,a=void 0!==e.withCredentials?e.withCredentials:this.withCredentials,s=void 0!==e.reportProgress?e.reportProgress:this.reportProgress,u=e.headers||this.headers,c=e.params||this.params;return void 0!==e.setHeaders&&(u=Object.keys(e.setHeaders).reduce((function(t,n){return t.set(n,e.setHeaders[n])}),u)),e.setParams&&(c=Object.keys(e.setParams).reduce((function(t,n){return t.set(n,e.setParams[n])}),c)),new t(n,r,o,{params:c,headers:u,reportProgress:s,responseType:i,withCredentials:a})},t}(),_=function(t){return t[t.Sent=0]="Sent",t[t.UploadProgress=1]="UploadProgress",t[t.ResponseHeader=2]="ResponseHeader",t[t.DownloadProgress=3]="DownloadProgress",t[t.Response=4]="Response",t[t.User=5]="User",t}({}),S=function(){return function(t,e,n){void 0===e&&(e=200),void 0===n&&(n="OK"),this.headers=t.headers||new d,this.status=void 0!==t.status?t.status:e,this.statusText=t.statusText||n,this.url=t.url||null,this.ok=this.status>=200&&this.status<300}}(),C=function(t){function e(e){void 0===e&&(e={});var n=t.call(this,e)||this;return n.type=_.ResponseHeader,n}return Object(r.d)(e,t),e.prototype.clone=function(t){return void 0===t&&(t={}),new e({headers:t.headers||this.headers,status:void 0!==t.status?t.status:this.status,statusText:t.statusText||this.statusText,url:t.url||this.url||void 0})},e}(S),E=function(t){function e(e){void 0===e&&(e={});var n=t.call(this,e)||this;return n.type=_.Response,n.body=void 0!==e.body?e.body:null,n}return Object(r.d)(e,t),e.prototype.clone=function(t){return void 0===t&&(t={}),new e({body:void 0!==t.body?t.body:this.body,headers:t.headers||this.headers,status:void 0!==t.status?t.status:this.status,statusText:t.statusText||this.statusText,url:t.url||this.url||void 0})},e}(S),T=function(t){function e(e){var n=t.call(this,e,0,"Unknown Error")||this;return n.name="HttpErrorResponse",n.ok=!1,n.message=n.status>=200&&n.status<300?"Http failure during parsing for "+(e.url||"(unknown url)"):"Http failure response for "+(e.url||"(unknown url)")+": "+e.status+" "+e.statusText,n.error=e.error||null,n}return Object(r.d)(e,t),e}(S);function k(t,e){return{body:e,headers:t.headers,observe:t.observe,params:t.params,reportProgress:t.reportProgress,responseType:t.responseType,withCredentials:t.withCredentials}}var I=function(){function t(t){this.handler=t}return t.prototype.request=function(t,e,n){var r,i=this;if(void 0===n&&(n={}),t instanceof w)r=t;else{var a;a=n.headers instanceof d?n.headers:new d(n.headers);var l=void 0;n.params&&(l=n.params instanceof y?n.params:new y({fromObject:n.params})),r=new w(t,e,void 0!==n.body?n.body:null,{headers:a,params:l,reportProgress:n.reportProgress,responseType:n.responseType||"json",withCredentials:n.withCredentials})}var h=Object(o.a)(r).pipe(Object(s.a)((function(t){return i.handler.handle(t)})));if(t instanceof w||"events"===n.observe)return h;var f=h.pipe(Object(u.a)((function(t){return t instanceof E})));switch(n.observe||"body"){case"body":switch(r.responseType){case"arraybuffer":return f.pipe(Object(c.a)((function(t){if(null!==t.body&&!(t.body instanceof ArrayBuffer))throw new Error("Response is not an ArrayBuffer.");return t.body})));case"blob":return f.pipe(Object(c.a)((function(t){if(null!==t.body&&!(t.body instanceof Blob))throw new Error("Response is not a Blob.");return t.body})));case"text":return f.pipe(Object(c.a)((function(t){if(null!==t.body&&"string"!=typeof t.body)throw new Error("Response is not a string.");return t.body})));case"json":default:return f.pipe(Object(c.a)((function(t){return t.body})))}case"response":return f;default:throw new Error("Unreachable: unhandled observe type "+n.observe+"}")}},t.prototype.delete=function(t,e){return void 0===e&&(e={}),this.request("DELETE",t,e)},t.prototype.get=function(t,e){return void 0===e&&(e={}),this.request("GET",t,e)},t.prototype.head=function(t,e){return void 0===e&&(e={}),this.request("HEAD",t,e)},t.prototype.jsonp=function(t,e){return this.request("JSONP",t,{params:(new y).append(e,"JSONP_CALLBACK"),observe:"body",responseType:"json"})},t.prototype.options=function(t,e){return void 0===e&&(e={}),this.request("OPTIONS",t,e)},t.prototype.patch=function(t,e,n){return void 0===n&&(n={}),this.request("PATCH",t,k(n,e))},t.prototype.post=function(t,e,n){return void 0===n&&(n={}),this.request("POST",t,k(n,e))},t.prototype.put=function(t,e,n){return void 0===n&&(n={}),this.request("PUT",t,k(n,e))},t}(),O=function(){function t(t,e){this.next=t,this.interceptor=e}return t.prototype.handle=function(t){return this.interceptor.intercept(t,this.next)},t}(),x=new i.p("HTTP_INTERCEPTORS"),A=function(){function t(){}return t.prototype.intercept=function(t,e){return e.handle(t)},t}(),P=/^\)\]\}',?\n/,D=function(){return function(){}}(),R=function(){function t(){}return t.prototype.build=function(){return new XMLHttpRequest},t}(),N=function(){function t(t){this.xhrFactory=t}return t.prototype.handle=function(t){var e=this;if("JSONP"===t.method)throw new Error("Attempted to construct Jsonp request without JsonpClientModule installed.");return new a.a((function(n){var r=e.xhrFactory.build();if(r.open(t.method,t.urlWithParams),t.withCredentials&&(r.withCredentials=!0),t.headers.forEac
1h((function(t,e){return r.setRequestHeader(t,e.join(","))})),t.headers.has("Accept")||r.setRequestHeader("Accept","application/json, text/plain, */*"),!t.headers.has("Content-Type")){var i=t.detectContentTypeHeader();null!==i&&r.setRequestHeader("Content-Type",i)}if(t.responseType){var o=t.responseType.toLowerCase();r.responseType="json"!==o?o:"text"}var a=t.serializeBody(),s=null,u=function(){if(null!==s)return s;var e=1223===r.status?204:r.status,n=r.statusText||"OK",i=new d(r.getAllResponseHeaders()),o=function(t){return"responseURL"in t&&t.responseURL?t.responseURL:/^X-Request-URL:/m.test(t.getAllResponseHeaders())?t.getResponseHeader("X-Request-URL"):null}(r)||t.url;return s=new C({headers:i,status:e,statusText:n,url:o})},c=function(){var e=u(),i=e.headers,o=e.status,a=e.statusText,s=e.url,c=null;204!==o&&(c=void 0===r.response?r.responseText:r.response),0===o&&(o=c?200:0);var l=o>=200&&o<300;if("json"===t.responseType&&"string"==typeof c){var h=c;c=c.replace(P,"");try{c=""!==c?JSON.parse(c):null}catch(f){c=h,l&&(l=!1,c={error:f,text:c})}}l?(n.next(new E({body:c,headers:i,status:o,statusText:a,url:s||void 0})),n.complete()):n.error(new T({error:c,headers:i,status:o,statusText:a,url:s||void 0}))},l=function(t){var e=u().url,i=new T({error:t,status:r.status||0,statusText:r.statusText||"Unknown Error",url:e||void 0});n.error(i)},h=!1,f=function(e){h||(n.next(u()),h=!0);var i={type:_.DownloadProgress,loaded:e.loaded};e.lengthComputable&&(i.total=e.total),"text"===t.responseType&&r.responseText&&(i.partialText=r.responseText),n.next(i)},p=function(t){var e={type:_.UploadProgress,loaded:t.loaded};t.lengthComputable&&(e.total=t.total),n.next(e)};return r.addEventListener("load",c),r.addEventListener("error",l),t.reportProgress&&(r.addEventListener("progress",f),null!==a&&r.upload&&r.upload.addEventListener("progress",p)),r.send(a),n.next({type:_.Sent}),function(){r.removeEventListener("error",l),r.removeEventListener("load",c),t.reportProgress&&(r.removeEventListener("progress",f),null!==a&&r.upload&&r.upload.removeEventListener("progress",p)),r.abort()}}))},t}(),j=new i.p("XSRF_COOKIE_NAME"),M=new i.p("XSRF_HEADER_NAME"),L=function(){return function(){}}(),F=function(){function t(t,e,n){this.doc=t,this.platform=e,this.cookieName=n,this.lastCookieString="",this.lastToken=null,this.parseCount=0}return t.prototype.getToken=function(){if("server"===this.platform)return null;var t=this.doc.cookie||"";return t!==this.lastCookieString&&(this.parseCount++,this.lastToken=Object(l.t)(t,this.cookieName),this.lastCookieString=t),this.lastToken},t}(),U=function(){function t(t,e){this.tokenService=t,this.headerName=e}return t.prototype.intercept=function(t,e){var n=t.url.toLowerCase();if("GET"===t.method||"HEAD"===t.method||n.startsWith("http://")||n.startsWith("https://"))return e.handle(t);var r=this.tokenService.getToken();return null===r||t.headers.has(this.headerName)||(t=t.clone({headers:t.headers.set(this.headerName,r)})),e.handle(t)},t}(),V=function(){function t(t,e){this.backend=t,this.injector=e,this.chain=null}return t.prototype.handle=function(t){if(null===this.chain){var e=this.injector.get(x,[]);this.chain=e.reduceRight((function(t,e){return new O(t,e)}),this.backend)}return this.chain.handle(t)},t}(),q=function(){function t(){}var e;return e=t,t.disable=function(){return{ngModule:e,providers:[{provide:U,useClass:A}]}},t.withOptions=function(t){return void 0===t&&(t={}),{ngModule:e,providers:[t.cookieName?{provide:j,useValue:t.cookieName}:[],t.headerName?{provide:M,useValue:t.headerName}:[]]}},t}(),B=function(){return function(){}}()},t6oF:function(t,e,n){"use strict";n.r(e);var r=n("wj3C"),i=n.n(r);(function(){var t,e=e||{},n=this;function r(t){return"string"==typeof t}function o(t){return"boolean"==typeof t}function a(){}function s(t){var e=typeof t;if("object"==e){if(!t)return"null";if(t instanceof Array)return"array";if(t instanceof Object)return e;var n=Object.prototype.toString.call(t);if("[object Window]"==n)return"object";if("[object Array]"==n||"number"==typeof t.length&&void 0!==t.splice&&void 0!==t.propertyIsEnumerable&&!t.propertyIsEnumerable("splice"))return"array";if("[object Function]"==n||void 0!==t.call&&void 0!==t.propertyIsEnumerable&&!t.propertyIsEnumerable("call"))return"function"}else if("function"==e&&void 0===t.call)return"object";return e}function u(t){return null===t}function c(t){return"array"==s(t)}function l(t){var e=s(t);return"array"==e||"object"==e&&"number"==typeof t.length}function h(t){return"function"==s(t)}function f(t){var e=typeof t;return"object"==e&&null!=t||"function"==e}var d="closure_uid_"+(1e9*Math.random()>>>0),p=0;function m(t,e,n){return t.call.apply(t.bind,arguments)}function y(t,e,n){if(!t)throw Error();if(2<arguments.length){var r=Array.prototype.slice.call(arguments,2);return function(){var n=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(n,r),t.apply(e,n)}}return function(){return t.apply(e,arguments)}}function v(t,e,n){return(v=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?m:y).apply(null,arguments)}
1function g(t,e){var n=Array.prototype.slice.call(arguments,1);return function(){var e=n.slice();return e.push.apply(e,arguments),t.apply(this,e)}}var b=Date.now||function(){return+new Date};function w(t,e){function n(){}n.prototype=e.prototype,t.ob=e.prototype,t.prototype=new n,t.prototype.constructor=t,t.ed=function(t,n,r){for(var i=Array(arguments.length-2),o=2;o<arguments.length;o++)i[o-2]=arguments[o];return e.prototype[n].apply(t,i)}}function _(t){t.prototype.then=t.prototype.then,t.prototype.$goog_Thenable=!0}function S(t){if(!t)return!1;try{return!!t.$goog_Thenable}catch(e){return!1}}function C(t){if(Error.captureStackTrace)Error.captureStackTrace(this,C);else{var e=Error().stack;e&&(this.stack=e)}t&&(this.message=String(t))}function E(t,e){for(var n="",r=(t=t.split("%s")).length-1,i=0;i<r;i++)n+=t[i]+(i<e.length?e[i]:"%s");C.call(this,n+t[r])}function T(t,e){throw new E("Failure"+(t?": "+t:""),Array.prototype.slice.call(arguments,1))}function k(t,e){this.c=t,this.f=e,this.b=0,this.a=null}function I(t,e){t.f(e),100>t.b&&(t.b++,e.next=t.a,t.a=e)}function O(){this.b=this.a=null}w(C,Error),C.prototype.name="CustomError",w(E,C),E.prototype.name="AssertionError",k.prototype.get=function(){if(0<this.b){this.b--;var t=this.a;this.a=t.next,t.next=null}else t=this.c();return t};var x=new k((function(){return new P}),(function(t){t.reset()}));function A(){var t=dt,e=null;return t.a&&(e=t.a,t.a=t.a.next,t.a||(t.b=null),e.next=null),e}function P(){this.next=this.b=this.a=null}O.prototype.add=function(t,e){var n=x.get();n.set(t,e),this.b?this.b.next=n:this.a=n,this.b=n},P.prototype.set=function(t,e){this.a=t,this.b=e,this.next=null},P.prototype.reset=function(){this.next=this.b=this.a=null};var D=Array.prototype.indexOf?function(t,e){return Array.prototype.indexOf.call(t,e,void 0)}:function(t,e){if(r(t))return r(e)&&1==e.length?t.indexOf(e,0):-1;for(var n=0;n<t.length;n++)if(n in t&&t[n]===e)return n;return-1},R=Array.prototype.forEach?function(t,e,n){Array.prototype.forEach.call(t,e,n)}:function(t,e,n){for(var i=t.length,o=r(t)?t.split(""):t,a=0;a<i;a++)a in o&&e.call(n,o[a],a,t)},N=Array.prototype.map?function(t,e){return Array.prototype.map.call(t,e,void 0)}:function(t,e){for(var n=t.length,i=Array(n),o=r(t)?t.split(""):t,a=0;a<n;a++)a in o&&(i[a]=e.call(void 0,o[a],a,t));return i},j=Array.prototype.some?function(t,e){return Array.prototype.some.call(t,e,void 0)}:function(t,e){for(var n=t.length,i=r(t)?t.split(""):t,o=0;o<n;o++)if(o in i&&e.call(void 0,i[o],o,t))return!0;return!1};function M(t,e){return 0<=D(t,e)}function L(t,e){var n;return(n=0<=(e=D(t,e)))&&Array.prototype.splice.call(t,e,1),n}function F(t,e){!function(t,e){var n=t.length,i=r(t)?t.split(""):t;for(--n;0<=n;--n)n in i&&e.call(void 0,i[n],n,t)}(t,(function(n,r){e.call(void 0,n,r,t)&&Array.prototype.splice.call(t,r,1)}))}function U(t){return Array.prototype.concat.apply([],arguments)}function V(t){var e=t.length;if(0<e){for(var n=Array(e),r=0;r<e;r++)n[r]=t[r];return n}return[]}function q(t,e){for(var n=t.split("%s"),r="",i=Array.prototype.slice.call(arguments,1);i.length&&1<n.length;)r+=n.shift()+i.shift();return r+n.join("%s")}var B=String.prototype.trim?function(t){return t.trim()}:function(t){return/^[\s\xa0]*([\s\S]*?)[\s\xa0]*$/.exec(t)[1]};function W(t){return X.test(t)?(-1!=t.indexOf("&")&&(t=t.replace(H,"&amp;")),-1!=t.indexOf("<")&&(t=t.replace($,"&lt;")),-1!=t.indexOf(">")&&(t=t.replace(K,"&gt;")),-1!=t.indexOf('"')&&(t=t.replace(G,"&quot;")),-1!=t.indexOf("'")&&(t=t.replace(Q,"&#39;")),-1!=t.indexOf("\0")&&(t=t.replace(Y,"&#0;")),t):t}var z,H=/&/g,$=/</g,K=/>/g,G=/"/g,Q=/'/g,Y=/\x00/g,X=/[\x00&<>"']/;function J(t,e){return-1!=t.indexOf(e)}function Z(t,e){return t<e?-1:t>e?1:0}t:{var tt=n.navigator;if(tt){var et=tt.userAgent;if(et){z=et;break t}}z=""}function nt(t){return J(z,t)}function rt(t,e){for(var n in t)e.call(void 0,t[n],n,t)}function it(t){for(var e in t)return!1;return!0}function ot(t){var e,n={};for(e in t)n[e]=t[e];return n}var at,st,ut="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function ct(t,e){for(var n,r,i=1;i<arguments.length;i++){for(n in r=arguments[i])t[n]=r[n];for(var o=0;o<ut.length;
1o++)n=ut[o],Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}}function lt(t){n.setTimeout((function(){throw t}),0)}function ht(t,e){st||function(){if(n.Promise&&n.Promise.resolve){var t=n.Promise.resolve(void 0);st=function(){t.then(pt)}}else st=function(){var t=pt;!h(n.setImmediate)||n.Window&&n.Window.prototype&&!nt("Edge")&&n.Window.prototype.setImmediate==n.setImmediate?(at||(at=function(){var t=n.MessageChannel;if(void 0===t&&"undefined"!=typeof window&&window.postMessage&&window.addEventListener&&!nt("Presto")&&(t=function(){var t=document.createElement("IFRAME");t.style.display="none",t.src="",document.documentElement.appendChild(t);var e=t.contentWindow;(t=e.document).open(),t.write(""),t.close();var n="callImmediate"+Math.random(),r="file:"==e.location.protocol?"*":e.location.protocol+"//"+e.location.host;t=v((function(t){"*"!=r&&t.origin!=r||t.data!=n||this.port1.onmessage()}),this),e.addEventListener("message",t,!1),this.port1={},this.port2={postMessage:function(){e.postMessage(n,r)}}}),void 0!==t&&!nt("Trident")&&!nt("MSIE")){var e=new t,r={},i=r;return e.port1.onmessage=function(){if(void 0!==r.next){var t=(r=r.next).wb;r.wb=null,t()}},function(t){i.next={wb:t},i=i.next,e.port2.postMessage(0)}}return"undefined"!=typeof document&&"onreadystatechange"in document.createElement("SCRIPT")?function(t){var e=document.createElement("SCRIPT");e.onreadystatechange=function(){e.onreadystatechange=null,e.parentNode.removeChild(e),e=null,t(),t=null},document.documentElement.appendChild(e)}:function(t){n.setTimeout(t,0)}}()),at(t)):n.setImmediate(t)}}(),ft||(st(),ft=!0),dt.add(t,e)}var ft=!1,dt=new O;function pt(){for(var t;t=A();){try{t.a.call(t.b)}catch(e){lt(e)}I(x,t)}ft=!1}function mt(t,e){if(this.a=yt,this.i=void 0,this.f=this.b=this.c=null,this.g=this.h=!1,t!=a)try{var n=this;t.call(e,(function(t){Ot(n,vt,t)}),(function(t){if(!(t instanceof jt))try{if(t instanceof Error)throw t;throw Error("Promise rejected.")}catch(e){}Ot(n,gt,t)}))}catch(r){Ot(this,gt,r)}}var yt=0,vt=2,gt=3;function bt(){this.next=this.f=this.b=this.g=this.a=null,this.c=!1}bt.prototype.reset=function(){this.f=this.b=this.g=this.a=null,this.c=!1};var wt=new k((function(){return new bt}),(function(t){t.reset()}));function _t(t,e,n){var r=wt.get();return r.g=t,r.b=e,r.f=n,r}function St(t){if(t instanceof mt)return t;var e=new mt(a);return Ot(e,vt,t),e}
1function Ct(t){return new mt((function(e,n){n(t)}))}function Et(t,e,n){xt(t,e,n,null)||ht(g(e,t))}function Tt(t){return new mt((function(e){var n=t.length,r=[];if(n)for(var i=function(t,i,o){n--,r[t]=i?{Db:!0,value:o}:{Db:!1,reason:o},0==n&&e(r)},o=0;o<t.length;o++)Et(t[o],g(i,o,!0),g(i,o,!1));else e(r)}))}function kt(t,e){t.b||t.a!=vt&&t.a!=gt||At(t),t.f?t.f.next=e:t.b=e,t.f=e}function It(t,e,n,r){var i=_t(null,null,null);return i.a=new mt((function(t,o){i.g=e?function(n){try{var i=e.call(r,n);t(i)}catch(a){o(a)}}:t,i.b=n?function(e){try{var i=n.call(r,e);void 0===i&&e instanceof jt?o(e):t(i)}catch(a){o(a)}}:o})),i.a.c=t,kt(t,i),i.a}function Ot(t,e,n){t.a==yt&&(t===n&&(e=gt,n=new TypeError("Promise cannot resolve to itself")),t.a=1,xt(n,t.Nc,t.Oc,t)||(t.i=n,t.a=e,t.c=null,At(t),e!=gt||n instanceof jt||function(t,e){t.g=!0,ht((function(){t.g&&Nt.call(null,e)}))}(t,n)))}function xt(t,e,n,r){if(t instanceof mt)return kt(t,_t(e||a,n||null,r)),!0;if(S(t))return t.then(e,n,r),!0;if(f(t))try{var i=t.then;if(h(i))return function(t,e,n,r,i){function o(t){a||(a=!0,r.call(i,t))}var a=!1;try{e.call(t,(function(t){a||(a=!0,n.call(i,t))}),o)}catch(s){o(s)}}(t,i,e,n,r),!0}catch(o){return n.call(r,o),!0}return!1}function At(t){t.h||(t.h=!0,ht(t.Yb,t))}function Pt(t){var e=null;return t.b&&(t.b=(e=t.b).next,e.next=null),t.b||(t.f=null),e}function Dt(t,e,n,r){if(n==gt&&e.b&&!e.c)for(;t&&t.g;t=t.c)t.g=!1;if(e.a)e.a.c=null,Rt(e,n,r);else try{e.c?e.g.call(e.f):Rt(e,n,r)}catch(i){Nt.call(null,i)}I(wt,e)}function Rt(t,e,n){e==vt?t.g.call(t.f,n):t.b&&t.b.call(t.f,n)}mt.prototype.then=function(t,e,n){return It(this,h(t)?t:null,h(e)?e:null,n)},_(mt),(t=mt.prototype).ia=function(t,e){return(t=_t(t,t,e)).c=!0,kt(this,t),this},t.s=function(t,e){return It(this,null,t,e)},t.cancel=function(t){this.a==yt&&ht((function(){!function t(e,n){if(e.a==yt)if(e.c){var r=e.c;if(r.b){for(var i=0,o=null,a=null,s=r.b;s&&(s.c||(i++,s.a==e&&(o=s),!(o&&1<i)));s=s.next)o||(a=s);o&&(r.a==yt&&1==i?t(r,n):(a?((i=a).next==r.f&&(r.f=i),i.next=i.next.next):Pt(r),Dt(r,o,gt,n)))}e.c=null}else Ot(e,gt,n)}(this,new jt(t))}),this)},t.Nc=function(t){this.a=yt,Ot(this,vt,t)},t.Oc=function(t){this.a=yt,Ot(this,gt,t)},t.Yb=function(){for(var t;t=Pt(this);)Dt(this,t,this.a,this.i);this.h=!1};var Nt=lt;function jt(t){C.call(this,t)}function Mt(){0!=Lt&&(Ft[this[d]||(this[d]=++p)]=this),this.qa=this.qa,this.ja=this.ja}w(jt,C),jt.prototype.name="cancel";var Lt=0,Ft={};function Ut(t){if(!t.qa&&(t.qa=!0,t.va(),0!=Lt)){var e=t[d]||(t[d]=++p);if(0!=Lt&&t.ja&&0<t.ja.length)throw Error(t+" did not empty its onDisposeCallbacks queue. This probably means it overrode dispose() or disposeInternal() without calling the superclass' method.");delete Ft[e]}}function Vt(t){return Vt[" "](t),t}Mt.prototype.qa=!1,Mt.prototype.va=function(){if(this.ja)for(;this.ja.length;)this.ja.shift()()},Vt[" "]=a;var qt,Bt,Wt=nt("Opera"),zt=nt("Trident")||nt("MSIE"),Ht=nt("Edge"),$t=Ht||zt,Kt=nt("Gecko")&&!(J(z.toLowerCase(),"webkit")&&!nt("Edge"))&&!(nt("Trident")||nt("MSIE"))&&!nt("Edge"),Gt=J(z.toLowerCase(),"webkit")&&!nt("Edge");function Qt(){var t=n.document;return t?t.documentMode:void 0}t:{var Yt="",Xt=(Bt=z,Kt?/rv:([^\);]+)(\)|;)/.exec(Bt):Ht?/Edge\/([\d\.]+)/.exec(Bt):zt?/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(Bt):Gt?/WebKit\/(\S+)/.exec(Bt):Wt?/(?:Version)[ \/]?(\S+)/.exec(Bt):void 0);if(Xt&&(Yt=Xt?Xt[1]:""),zt){var Jt=Qt();if(null!=Jt&&Jt>parseFloat(Yt)){qt=String(Jt);break t}}qt=Yt}var Zt,te={};function ee(t){return function(t,e){var n=te;return Object.prototype.hasOwnProperty.call(n,t)?n[t]:n[t]=e()}(t,(function(){for(var e=0,n=B(String(qt)).split("."),r=B(String(t)).split("."),i=Math.max(n.length,r.length),o=0;0==e&&o<i;o++){var a=n[o]||"",s=r[o]||"";do{if(a=/(\d*)(\D*)(.*)/.exec(a)||["","","",""],s=/(\d*)(\D*)(.*)/.exec(s)||["","","",""],0==a[0].length&&0==s[0].length)break;e=Z(0==a[1].length?0:parseInt(a[1],10),0==s[1].length?0:parseInt(s[1],10))||Z(0==a[2].length,0==s[2].length)||Z(a[2],s[2]),a=a[3],s=s[3]}while(0==e)}return 0<=e}))}var ne=n.document;Zt=ne&&zt?Qt()||("CSS1Compat"==ne.compatMode?parseInt(qt,10):5):void 0;var re=Object.freeze||function(t){return t},ie=!zt||9<=Number(Zt),oe=zt&&!ee("9"),ae=function(){if(!n.addEventListener||!Object.defineProperty)return!1;var t=!1,e=Object.defineProperty({},"passive",{get:function(){t=!0}});return n.addEventListener("test",a,e),n.removeEventListener("test",a,e),t}();function se(t,e){this.type=t,this.b=this.target=e,this.Kb=!0}function ue(t,e){if(se.call(this,t?t.type:""),this.relatedTarget=this.b=this.target=null,this.button=this.screenY=this.screenX=this.clientY=this.clientX=0,this.key="",this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1,this.pointerId=0,this.pointerType="",this.a=null,t){var n=this.type=t.type,i=t.changedTouches?t.changedTouches[0]:null;if(this.target=t.target||t.srcElement,this.b=e,e=t.relatedTarget){if(Kt){t:{try{Vt(e.nodeName);var o=!0;break t}catch(a){}o=!1}o||(e=null)}}
1else"mouseover"==n?e=t.fromElement:"mouseout"==n&&(e=t.toElement);this.relatedTarget=e,null===i?(this.clientX=void 0!==t.clientX?t.clientX:t.pageX,this.clientY=void 0!==t.clientY?t.clientY:t.pageY,this.screenX=t.screenX||0,this.screenY=t.screenY||0):(this.clientX=void 0!==i.clientX?i.clientX:i.pageX,this.clientY=void 0!==i.clientY?i.clientY:i.pageY,this.screenX=i.screenX||0,this.screenY=i.screenY||0),this.button=t.button,this.key=t.key||"",this.ctrlKey=t.ctrlKey,this.altKey=t.altKey,this.shiftKey=t.shiftKey,this.metaKey=t.metaKey,this.pointerId=t.pointerId||0,this.pointerType=r(t.pointerType)?t.pointerType:ce[t.pointerType]||"",this.a=t,t.defaultPrevented&&this.preventDefault()}}se.prototype.preventDefault=function(){this.Kb=!1},w(ue,se);var ce=re({2:"touch",3:"pen",4:"mouse"});ue.prototype.preventDefault=function(){ue.ob.preventDefault.call(this);var t=this.a;if(t.preventDefault)t.preventDefault();else if(t.returnValue=!1,oe)try{(t.ctrlKey||112<=t.keyCode&&123>=t.keyCode)&&(t.keyCode=-1)}catch(e){}},ue.prototype.f=function(){return this.a};var le="closure_listenable_"+(1e6*Math.random()|0),he=0;function fe(t,e,n,r,i){this.listener=t,this.proxy=null,this.src=e,this.type=n,this.capture=!!r,this.La=i,this.key=++he,this.oa=this.Ia=!1}function de(t){t.oa=!0,t.listener=null,t.proxy=null,t.src=null,t.La=null}function pe(t){this.src=t,this.a={},this.b=0}function me(t,e){var n=e.type;n in t.a&&L(t.a[n],e)&&(de(e),0==t.a[n].length&&(delete t.a[n],t.b--))}function ye(t,e,n,r){for(var i=0;i<t.length;++i){var o=t[i];if(!o.oa&&o.listener==e&&o.capture==!!n&&o.La==r)return i}return-1}pe.prototype.add=function(t,e,n,r,i){var o=t.toString();(t=this.a[o])||(t=this.a[o]=[],this.b++);var a=ye(t,e,r,i);return-1<a?(e=t[a],n||(e.Ia=!1)):((e=new fe(e,this.src,o,!!r,i)).Ia=n,t.push(e)),e};var ve="closure_lm_"+(1e6*Math.random()|0),ge={};function be(t,e,n,r,i){if(r&&r.once)_e(t,e,n,r,i);else if(c(e))for(var o=0;o<e.length;o++)be(t,e[o],n,r,i);else n=Ae(n),t&&t[le]?De(t,e,n,f(r)?!!r.capture:!!r,i):we(t,e,n,!1,r,i)}function we(t,e,n,r,i,o){if(!e)throw Error("Invalid event type");var a=f(i)?!!i.capture:!!i,s=Oe(t);if(s||(t[ve]=s=new pe(t)),!(n=s.add(e,n,r,a,o)).proxy)if(r=function(){var t=Ie,e=ie?function(n){return t.call(e.src,e.listener,n)}:function(n){if(!(n=t.call(e.src,e.listener,n)))return n};return e}(),n.proxy=r,r.src=t,r.listener=n,t.addEventListener)ae||(i=a),void 0===i&&(i=!1),t.addEventListener(e.toString(),r,i);else if(t.attachEvent)t.attachEvent(Ee(e.toString()),r);else{if(!t.addListener||!t.removeListener)throw Error("addEventListener and attachEvent are unavailable.");t.addListener(r)}}function _e(t,e,n,r,i){if(c(e))for(var o=0;o<e.length;o++)_e(t,e[o],n,r,i);else n=Ae(n),t&&t[le]?Re(t,e,n,f(r)?!!r.capture:!!r,i):we(t,e,n,!0,r,i)}function Se(t,e,n,r,i){if(c(e))for(var o=0;o<e.length;o++)Se(t,e[o],n,r,i);else r=f(r)?!!r.capture:!!r,n=Ae(n),t&&t[le]?(t=t.l,(e=String(e).toString())in t.a&&-1<(n=ye(o=t.a[e],n,r,i))&&(de(o[n]),Array.prototype.splice.call(o,n,1),0==o.length&&(delete t.a[e],t.b--))):t&&(t=Oe(t))&&(e=t.a[e.toString()],t=-1,e&&(t=ye(e,n,r,i)),(n=-1<t?e[t]:null)&&Ce(n))}function Ce(t){if("number"!=typeof t&&t&&!t.oa){var e=t.src;if(e&&e[le])me(e.l,t);else{var n=t.type,r=t.proxy;e.removeEventListener?e.removeEventListener(n,r,t.capture):e.detachEvent?e.detachEvent(Ee(n),r):e.addListener&&e.removeListener&&e.removeListener(r),(n=Oe(e))?(me(n,t),0==n.b&&(n.src=null,e[ve]=null)):de(t)}}}function Ee(t){return t in ge?ge[t]:ge[t]="on"+t}function Te(t,e,n,r){var i=!0;if((t=Oe(t))&&(e=t.a[e.toString()]))for(e=e.concat(),t=0;t<e.length;t++){var o=e[t];o&&o.capture==n&&!o.oa&&(o=ke(o,r),i=i&&!1!==o)}return i}function ke(t,e){var n=t.listener,r=t.La||t.src;return t.Ia&&Ce(t),n.call(r,e)}function Ie(t,e){if(t.oa)return!0;if(!ie){if(!e)t:{e=["window","event"];for(var r=n,i=0;i<e.length;i++)if(null==(r=r[e[i]])){e=null;break t}e=r}if(e=new ue(i=e,this),r=!0,!(0>i.keyCode||null!=i.returnValue)){t:{var o=!1;if(0==i.keyCode)try{i.keyCode=-1;break t}catch(s){o=!0}(o||null==i.returnValue)&&(i.returnValue=!0)}for(i=[],o=e.b;o;o=o.parentNode)i.push(o);for(t=t.type,o=i.length-1;0<=o;o--){e.b=i[o];var a=Te(i[o],t,!0,e);r=r&&a}for(o=0;o<i.length;o++)e.b=i[o],a=Te(i[o],t,!1,e),r=r&&a}return r}return ke(t,new ue(e,this))}function Oe(t){return(t=t[ve])instanceof pe?t:null}var xe="__closure_events_fn_"+(1e9*Math.random()>>>0);function Ae(t){return h(t)?t:(t[xe]||(t[xe]=function(e){return t.handleEvent(e)}),t[xe])}function Pe(){Mt.call(this),this.l=new pe(this),this.Rb=this,this.Va=null}function De(t,e,n,r,i){t.l.add(String(e),n,!1,r,i)}function Re(t,e,n,r,i){t.l.add(String(e),n,!0,r,i)}function Ne(t,e,n,r){if(!(e=t.l.a[String(e)]))return!0;e=e.concat();for(var i=!0,o=0;o<e.length;++o){var a=e[o];if(a&&!a.oa&&a.capture==n){var s=a.listener,u=a.La||a.src;a.Ia&&me(t.l,a),i=!1!==s.call(u,r)&&i}}return i&&0!=r.Kb}function je(t,e,r){if(h(t))r&&(t=v(t,r));else{if(!t||"function"!=typeof t.handleEvent)throw Error("Invalid listener argument");t=v(t.handleEvent,t)}return 2147483647<Number(e)?-1:n.setTimeout(t,e||0)}function Me(t){var e=null;return new mt((function(n,r){-1==(e=je((function(){n(void 0)}),t))&&r(Error("Failed to schedule timer."))})).s((function(t){throw n.clearTimeout(e),t}))}function Le(t){if(t.S&&"function"==typeof t.S)return t.S();if(r(t))return t.split("");
1if(l(t)){for(var e=[],n=t.length,i=0;i<n;i++)e.push(t[i]);return e}for(i in e=[],n=0,t)e[n++]=t[i];return e}function Fe(t){if(t.U&&"function"==typeof t.U)return t.U();if(!t.S||"function"!=typeof t.S){if(l(t)||r(t)){var e=[];t=t.length;for(var n=0;n<t;n++)e.push(n);return e}for(var i in e=[],n=0,t)e[n++]=i;return e}}function Ue(t,e){this.b={},this.a=[],this.c=0;var n=arguments.length;if(1<n){if(n%2)throw Error("Uneven number of arguments");for(var r=0;r<n;r+=2)this.set(arguments[r],arguments[r+1])}else if(t)if(t instanceof Ue)for(n=t.U(),r=0;r<n.length;r++)this.set(n[r],t.get(n[r]));else for(r in t)this.set(r,t[r])}function Ve(t){if(t.c!=t.a.length){for(var e=0,n=0;e<t.a.length;){var r=t.a[e];qe(t.b,r)&&(t.a[n++]=r),e++}t.a.length=n}if(t.c!=t.a.length){var i={};for(n=e=0;e<t.a.length;)qe(i,r=t.a[e])||(t.a[n++]=r,i[r]=1),e++;t.a.length=n}}function qe(t,e){return Object.prototype.hasOwnProperty.call(t,e)}w(Pe,Mt),Pe.prototype[le]=!0,Pe.prototype.addEventListener=function(t,e,n,r){be(this,t,e,n,r)},Pe.prototype.removeEventListener=function(t,e,n,r){Se(this,t,e,n,r)},Pe.prototype.dispatchEvent=function(t){var e,n=this.Va;if(n)for(e=[];n;n=n.Va)e.push(n);n=this.Rb;var i=t.type||t;if(r(t))t=new se(t,n);else if(t instanceof se)t.target=t.target||n;else{var o=t;ct(t=new se(i,n),o)}if(o=!0,e)for(var a=e.length-1;0<=a;a--){var s=t.b=e[a];o=Ne(s,i,!0,t)&&o}if(o=Ne(s=t.b=n,i,!0,t)&&o,o=Ne(s,i,!1,t)&&o,e)for(a=0;a<e.length;a++)o=Ne(s=t.b=e[a],i,!1,t)&&o;return o},Pe.prototype.va=function(){if(Pe.ob.va.call(this),this.l){var t,e=this.l;for(t in e.a){for(var n=e.a[t],r=0;r<n.length;r++)de(n[r]);delete e.a[t],e.b--}}this.Va=null},(t=Ue.prototype).S=function(){Ve(this);for(var t=[],e=0;e<this.a.length;e++)t.push(this.b[this.a[e]]);return t},t.U=function(){return Ve(this),this.a.concat()},t.clear=function(){this.b={},this.c=this.a.length=0},t.get=function(t,e){return qe(this.b,t)?this.b[t]:e},t.set=function(t,e){qe(this.b,t)||(this.c++,this.a.push(t)),this.b[t]=e},t.forEach=function(t,e){for(var n=this.U(),r=0;r<n.length;r++){var i=n[r],o=this.get(i);t.call(e,o,i,this)}};var Be=/^(?:([^:/?#.]+):)?(?:\/\/(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\?([^#]*))?(?:#([\s\S]*))?$/;function We(t,e){if(this.b=this.l=this.c="",this.i=null,this.h=this.g="",this.f=!1,t instanceof We){this.f=void 0!==e?e:t.f,ze(this,t.c),this.l=t.l,this.b=t.b,He(this,t.i),this.g=t.g,e=t.a;var n=new an;n.c=e.c,e.a&&(n.a=new Ue(e.a),n.b=e.b),$e(this,n),this.h=t.h}else t&&(n=String(t).match(Be))?(this.f=!!e,ze(this,n[1]||"",!0),this.l=Xe(n[2]||""),this.b=Xe(n[3]||"",!0),He(this,n[4]),this.g=Xe(n[5]||"",!0),$e(this,n[6]||"",!0),this.h=Xe(n[7]||"")):(this.f=!!e,this.a=new an(null,this.f))}function ze(t,e,n){t.c=n?Xe(e,!0):e,t.c&&(t.c=t.c.replace(/:$/,""))}function He(t,e){if(e){if(e=Number(e),isNaN(e)||0>e)throw Error("Bad port number "+e);t.i=e}else t.i=null}function $e(t,e,n){e instanceof an?(t.a=e,function(t,e){e&&!t.f&&(sn(t),t.c=null,t.a.forEach((function(t,e){var n=e.toLowerCase();e!=n&&(cn(this,e),hn(this,n,t))}),t)),t.f=e}(t.a,t.f)):(n||(e=Je(e,rn)),t.a=new an(e,t.f))}function Ke(t,e,n){t.a.set(e,n)}function Ge(t,e){return t.a.get(e)}function Qe(t){return t instanceof We?new We(t):new We(t,void 0)}function Ye(t,e){var n=new We(null,void 0);return ze(n,"https"),t&&(n.b=t),e&&(n.g=e),n}function Xe(t,e){return t?e?decodeURI(t.replace(/%25/g,"%2525")):decodeURIComponent(t):""}function Je(t,e,n){return r(t)?(t=encodeURI(t).replace(e,Ze),n&&(t=t.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),t):null}function Ze(t){return"%"+((t=t.charCodeAt(0))>>4&15).toString(16)+(15&t).toString(16)}We.prototype.toString=function(){var t=[],e=this.c;e&&t.push(Je(e,tn,!0),":");var n=this.b;return(n||"file"==e)&&(t.push("//"),(e=this.l)&&t.push(Je(e,tn,!0),"@"),t.push(encodeURIComponent(String(n)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),null!=(n=this.i)&&t.push(":",String(n))),(n=this.g)&&(this.b&&"/"!=n.charAt(0)&&t.push("/"),t.push(Je(n,"/"==n.charAt(0)?nn:en,!0))),(n=this.a.toString())&&t.push("?",n),(n=this.h)&&t.push("#",Je(n,on)),t.join("")};var tn=/[#\/\?@]/g,en=/[#\?:]/g,nn=/[#\?]/g,rn=/[#\?@]/g,on=/#/g;function an(t,e){this.b=this.a=null,this.c=t||null,this.f=!!e}function sn(t){t.a||(t.a=new Ue,t.b=0,t.c&&function(t,e){if(t){t=t.split("&");for(var n=0;n<t.length;n++){var r=t[n].indexOf("="),i=null;if(0<=r){var o=t[n].substring(0,r);i=t[n].substring(r+1)}else o=t[n];e(o,i?decodeURIComponent(i.replace(/\+/g," ")):"")}}}(t.c,(function(e,n){t.add(decodeURIComponent(e.replace(/\+/g," ")),n)})))}function un(t){var e=Fe(t);
1if(void 0===e)throw Error("Keys are undefined");var n=new an(null,void 0);t=Le(t);for(var r=0;r<e.length;r++){var i=e[r],o=t[r];c(o)?hn(n,i,o):n.add(i,o)}return n}function cn(t,e){sn(t),e=fn(t,e),qe(t.a.b,e)&&(t.c=null,t.b-=t.a.get(e).length,qe((t=t.a).b,e)&&(delete t.b[e],t.c--,t.a.length>2*t.c&&Ve(t)))}function ln(t,e){return sn(t),e=fn(t,e),qe(t.a.b,e)}function hn(t,e,n){cn(t,e),0<n.length&&(t.c=null,t.a.set(fn(t,e),V(n)),t.b+=n.length)}function fn(t,e){return e=String(e),t.f&&(e=e.toLowerCase()),e}(t=an.prototype).add=function(t,e){sn(this),this.c=null,t=fn(this,t);var n=this.a.get(t);return n||this.a.set(t,n=[]),n.push(e),this.b+=1,this},t.clear=function(){this.a=this.c=null,this.b=0},t.forEach=function(t,e){sn(this),this.a.forEach((function(n,r){R(n,(function(n){t.call(e,n,r,this)}),this)}),this)},t.U=function(){sn(this);for(var t=this.a.S(),e=this.a.U(),n=[],r=0;r<e.length;r++)for(var i=t[r],o=0;o<i.length;o++)n.push(e[r]);return n},t.S=function(t){sn(this);var e=[];if(r(t))ln(this,t)&&(e=U(e,this.a.get(fn(this,t))));else{t=this.a.S();for(var n=0;n<t.length;n++)e=U(e,t[n])}return e},t.set=function(t,e){return sn(this),this.c=null,ln(this,t=fn(this,t))&&(this.b-=this.a.get(t).length),this.a.set(t,[e]),this.b+=1,this},t.get=function(t,e){return 0<(t=t?this.S(t):[]).length?String(t[0]):e},t.toString=function(){if(this.c)return this.c;if(!this.a)return"";for(var t=[],e=this.a.U(),n=0;n<e.length;n++){var r=e[n],i=encodeURIComponent(String(r));r=this.S(r);for(var o=0;o<r.length;o++){var a=i;""!==r[o]&&(a+="="+encodeURIComponent(String(r[o]))),t.push(a)}}return this.c=t.join("&")};var dn=!zt||9<=Number(Zt);function pn(){this.a="",this.b=yn}function mn(t){return t instanceof pn&&t.constructor===pn&&t.b===yn?t.a:(T("expected object of type Const, got '"+t+"'"),"type_error:Const")}pn.prototype.na=!0,pn.prototype.ma=function(){return this.a},pn.prototype.toString=function(){return"Const{"+this.a+"}"};var yn={};function vn(t){var e=new pn;return e.a=t,e}function gn(){this.a="",this.b=Cn}function bn(t){return t instanceof gn&&t.constructor===gn&&t.b===Cn?t.a:(T("expected object of type TrustedResourceUrl, got '"+t+"' of type "+s(t)),"type_error:TrustedResourceUrl")}function wn(t,e){var n=mn(t);if(!Sn.test(n))throw Error("Invalid TrustedResourceUrl format: "+n);return function(t){var e=new gn;return e.a=t,e}(t=n.replace(_n,(function(t,r){if(!Object.prototype.hasOwnProperty.call(e,r))throw Error('Found marker, "'+r+'", in format string, "'+n+'", but no valid label mapping found in args: '+JSON.stringify(e));return(t=e[r])instanceof pn?mn(t):encodeURIComponent(String(t))})))}vn(""),gn.prototype.na=!0,gn.prototype.ma=function(){return this.a},gn.prototype.toString=function(){return"TrustedResourceUrl{"+this.a+"}"};var _n=/%{(\w+)}/g,Sn=/^(?:https:)?\/\/[0-9a-z.:[\]-]+\/|^\/[^\/\\]|^about:blank#/i,Cn={};function En(){this.a="",this.b=On}function Tn(t){return t instanceof En&&t.constructor===En&&t.b===On?t.a:(T("expected object of type SafeUrl, got '"+t+"' of type "+s(t)),"type_error:SafeUrl")}En.prototype.na=!0,En.prototype.ma=function(){return this.a},En.prototype.toString=function(){return"SafeUrl{"+this.a+"}"};var kn=/^(?:(?:https?|mailto|ftp):|[^:/?#]*(?:[/?#]|$))/i;function In(t){return t instanceof En?t:(t=t.na?t.ma():String(t),kn.test(t)||(t="about:invalid#zClosurez"),xn(t))}var On={};function xn(t){var e=new En;return e.a=t,e}function An(){this.a="",this.b=Pn}xn("about:blank"),An.prototype.na=!0,An.prototype.ma=function(){return this.a},An.prototype.toString=function(){return"SafeHtml{"+this.a+"}"};var Pn={};function Dn(t){var e=new An;return e.a=t,e}function Rn(t){var e=document;return r(t)?e.getElementById(t):t}function Nn(t,e){rt(e,(function(e,n){e&&e.na&&(e=e.ma()),"style"==n?t.style.cssText=e:"class"==n?t.className=e:"for"==n?t.htmlFor=e:jn.hasOwnProperty(n)?t.setAttribute(jn[n],e):0==n.lastIndexOf("aria-",0)||0==n.lastIndexOf("data-",0)?t.setAttribute(n,e):t[n]=e}))}Dn("<!DOCTYPE html>"),Dn(""),Dn("<br>");var jn={cellpadding:"cellPadding",cellspacing:"cellSpacing",colspan:"colSpan",frameborder:"frameBorder",height:"height",maxlength:"maxLength",
1nonce:"nonce",role:"role",rowspan:"rowSpan",type:"type",usemap:"useMap",valign:"vAlign",width:"width"};function Mn(t,e,n){function i(n){n&&e.appendChild(r(n)?t.createTextNode(n):n)}for(var o=2;o<n.length;o++){var a=n[o];!l(a)||f(a)&&0<a.nodeType?i(a):R(Ln(a)?V(a):a,i)}}function Ln(t){if(t&&"number"==typeof t.length){if(f(t))return"function"==typeof t.item||"string"==typeof t.item;if(h(t))return"function"==typeof t.item}return!1}function Fn(t){var e=[];return function t(e,n,r){if(null==n)r.push("null");else{if("object"==typeof n){if(c(n)){var i=n;n=i.length,r.push("[");for(var o="",a=0;a<n;a++)r.push(o),t(e,i[a],r),o=",";return void r.push("]")}if(!(n instanceof String||n instanceof Number||n instanceof Boolean)){for(i in r.push("{"),o="",n)Object.prototype.hasOwnProperty.call(n,i)&&"function"!=typeof(a=n[i])&&(r.push(o),Bn(i,r),r.push(":"),t(e,a,r),o=",");return void r.push("}")}n=n.valueOf()}switch(typeof n){case"string":Bn(n,r);break;case"number":r.push(isFinite(n)&&!isNaN(n)?String(n):"null");break;case"boolean":r.push(String(n));break;case"function":r.push("null");break;default:throw Error("Unknown type: "+typeof n)}}}(new Un,t,e),e.join("")}function Un(){}var Vn={'"':'\\"',"\\":"\\\\","/":"\\/","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\u000b"},qn=/\uffff/.test("\uffff")?/[\\"\x00-\x1f\x7f-\uffff]/g:/[\\"\x00-\x1f\x7f-\xff]/g;function Bn(t,e){e.push('"',t.replace(qn,(function(t){var e=Vn[t];return e||(e="\\u"+(65536|t.charCodeAt(0)).toString(16).substr(1),Vn[t]=e),e})),'"')}function Wn(){var t=sr();return zt&&!!Zt&&11==Zt||/Edge\/\d+/.test(t)}function zn(){return n.window&&n.window.location.href||self&&self.location&&self.location.href||""}function Hn(t,e){e=e||n.window;var r="about:blank";t&&(r=Tn(In(t))),e.location.href=r}function $n(t){return!!((t=(t||sr()).toLowerCase()).match(/android/)||t.match(/webos/)||t.match(/iphone|ipad|ipod/)||t.match(/blackberry/)||t.match(/windows phone/)||t.match(/iemobile/))}function Kn(t){t=t||n.window;try{t.close()}catch(e){}}function Gn(t,e,n){var r=Math.floor(1e9*Math.random()).toString();e=e||500,n=n||600;var i=(window.screen.availHeight-n)/2,o=(window.screen.availWidth-e)/2;for(a in e={width:e,height:n,top:0<i?i:0,left:0<o?o:0,location:!0,resizable:!0,statusbar:!0,toolbar:!1},n=sr().toLowerCase(),r&&(e.target=r,J(n,"crios/")&&(e.target="_blank")),ir(sr())==rr&&(t=t||"http://localhost",e.scrollbars=!0),n=t||"",(t=e)||(t={}),r=window,e=n instanceof En?n:In(void 0!==n.href?n.href:String(n)),n=t.target||n.target,i=[],t)switch(a){case"width":case"height":case"top":case"left":i.push(a+"="+t[a]);break;case"target":case"noopener":case"noreferrer":break;default:i.push(a+"="+(t[a]?1:0))}var a=i.join(",");if((nt("iPhone")&&!nt("iPod")&&!nt("iPad")||nt("iPad")||nt("iPod"))&&r.navigator&&r.navigator.standalone&&n&&"_self"!=n?(a=r.document.createElement("A"),e instanceof En||e instanceof En||(e=e.na?e.ma():String(e),kn.test(e)||(e="about:invalid#zClosurez"),e=xn(e)),a.href=Tn(e),a.setAttribute("target",n),t.noreferrer&&a.setAttribute("rel","noreferrer"),(t=document.createEvent("MouseEvent")).initMouseEvent("click",!0,!0,r,1),a.dispatchEvent(t),a={}):t.noreferrer?(a=r.open("",n,a),t=Tn(e),a&&($t&&J(t,";")&&(t="'"+t.replace(/'/g,"%27")+"'"),a.opener=null,vn("b/12014412, meta tag with sanitized URL"),t=Dn(t='<meta name="referrer" content="no-referrer"><meta http-equiv="refresh" content="0; url='+W(t)+'">'),a.document.write(function(t){return t instanceof An&&t.constructor===An&&t.b===Pn?t.a:(T("expected object of type SafeHtml, got '"+t+"' of type "+s(t)),"type_error:SafeHtml")}(t)),a.document.close())):(a=r.open(Tn(e),n,a))&&t.noopener&&(a.opener=null),a)try{a.focus()}catch(u){}return a}var Qn=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,Yn=/^[^@]+@[^@]+$/;function Xn(){var t=null;return new mt((function(e){"complete"==n.document.readyState?e():(t=function(){e()},_e(window,"load",t))})).s((function(e){throw Se(window,"load",t),e}))}function Jn(t){return t=t||sr(),!("file:"!==fr()||!t.toLowerCase().match(/iphone|ipad|ipod|android/))}function Zn(){var t=n.window;try{return!(!t||t==t.top)}catch(e){return!1}}function tr(){return"object"!=typeof n.window&&"function"==typeof n.importScripts}function er(){return i.a.INTERNAL.hasOwnProperty("reactNative")?"ReactNative":i.a.INT
1ERNAL.hasOwnProperty("node")?"Node":tr()?"Worker":"Browser"}function nr(){var t=er();return"ReactNative"===t||"Node"===t}var rr="Firefox";function ir(t){var e=t.toLowerCase();return J(e,"opera/")||J(e,"opr/")||J(e,"opios/")?"Opera":J(e,"iemobile")?"IEMobile":J(e,"msie")||J(e,"trident/")?"IE":J(e,"edge/")?"Edge":J(e,"firefox/")?rr:J(e,"silk/")?"Silk":J(e,"blackberry")?"Blackberry":J(e,"webos")?"Webos":!J(e,"safari/")||J(e,"chrome/")||J(e,"crios/")||J(e,"android")?!J(e,"chrome/")&&!J(e,"crios/")||J(e,"edge/")?J(e,"android")?"Android":(t=t.match(/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/))&&2==t.length?t[1]:"Other":"Chrome":"Safari"}var or={Uc:"FirebaseCore-web",Wc:"FirebaseUI-web"};function ar(t,e){e=e||[];var n,r=[],i={};for(n in or)i[or[n]]=!0;for(n=0;n<e.length;n++)void 0!==i[e[n]]&&(delete i[e[n]],r.push(e[n]));return r.sort(),(e=r).length||(e=["FirebaseCore-web"]),"Browser"===(r=er())?r=ir(i=sr()):"Worker"===r&&(r=ir(i=sr())+"-"+r),r+"/JsCore/"+t+"/"+e.join(",")}function sr(){return n.navigator&&n.navigator.userAgent||""}function ur(t,e){t=t.split("."),e=e||n;for(var r=0;r<t.length&&"object"==typeof e&&null!=e;r++)e=e[t[r]];return r!=t.length&&(e=void 0),e}function cr(){try{var t=n.localStorage,e=vr();if(t)return t.setItem(e,"1"),t.removeItem(e),!Wn()||!!n.indexedDB}catch(r){return tr()&&!!n.indexedDB}return!1}function lr(){return(hr()||"chrome-extension:"===fr()||Jn())&&!nr()&&cr()&&!tr()}function hr(){return"http:"===fr()||"https:"===fr()}function fr(){return n.location&&n.location.protocol||null}function dr(t){return!$n(t=t||sr())&&ir(t)!=rr}function pr(t){return void 0===t?null:Fn(t)}function mr(t){var e,n={};for(e in t)t.hasOwnProperty(e)&&null!=t[e]&&(n[e]=t[e]);return n}function yr(t){if(null!==t)return JSON.parse(t)}function vr(t){return t||Math.floor(1e9*Math.random()).toString()}function gr(t){return"Safari"!=ir(t=t||sr())&&!t.toLowerCase().match(/iphone|ipad|ipod/)}function br(){var t=n.___jsl;if(t&&t.H)for(var e in t.H)if(t.H[e].r=t.H[e].r||[],t.H[e].L=t.H[e].L||[],t.H[e].r=t.H[e].L.concat(),t.CP)for(var r=0;r<t.CP.length;r++)t.CP[r]=null}function wr(t,e){if(t>e)throw Error("Short delay should be less than long delay!");this.a=t,this.c=e,t=sr(),e=er(),this.b=$n(t)||"ReactNative"===e}function _r(){var t=n.document;return!t||void 0===t.visibilityState||"visible"==t.visibilityState}function Sr(t){try{var e=new Date(parseInt(t,10));if(!isNaN(e.getTime())&&!/[^0-9]/.test(t))return e.toUTCString()}catch(n){}return null}function Cr(){return!(!ur("fireauth.oauthhelper",n)&&!ur("fireauth.iframe",n))}wr.prototype.get=function(){var t=n.navigator;return!t||"boolean"!=typeof t.onLine||!hr()&&"chrome-extension:"!==fr()&&void 0===t.connection||t.onLine?this.b?this.c:this.a:Math.min(5e3,this.a)};var Er,Tr={};function kr(t){Tr[t]||(Tr[t]=!0,"undefined"!=typeof console&&"function"==typeof console.warn&&console.warn(t))}try{var Ir={};Object.defineProperty(Ir,"abcd",{configurable:!0,enumerable:!0,value:1}),Object.defineProperty(Ir,"abcd",{configurable:!0,enumerable:!0,value:2}),Er=2==Ir.abcd}catch(Bt){Er=!1}function Or(t,e,n){Er?Object.defineProperty(t,e,{configurable:!0,enumerable:!0,value:n}):t[e]=n}function xr(t,e){if(e)for(var n in e)e.hasOwnProperty(n)&&Or(t,n,e[n])}function Ar(t){var e={};return xr(e,t),e}function Pr(t){var e=t;if("object"==typeof t&&null!=t)for(var n in e="length"in t?[]:{},t)Or(e,n,Pr(t[n]));return e}function Dr(t){var e={},n=t[Nr],r=t[jr];if(!(t=t[Mr])||t!=Rr&&!n)throw Error("Invalid provider user info!");e[Fr]=r||null,e[Lr]=n||null,Or(this,Vr,t),Or(this,Ur,Pr(e))}var Rr="EMAIL_SIGNIN",Nr="email",jr="newEmail",Mr="requestType",Lr="email",Fr="fromEmail",Ur="data",Vr="operation";function qr(t,e){this.code=Wr+t,this.message=e||zr[t]||""}function Br(t){var e=t&&t.code;return e?new qr(e.substring(Wr.length),t.message):null}w(qr,Error),qr.prototype.C=function(){return{code:this.code,message:this.message}},qr.prototype.toJSON=function(){return this.C()};var Wr="auth/",zr={"argument-error":"","app-not-authorized":"This app, identified by the domain where it's hosted, is not authorized to use Firebase Authentication with the provided API key. Review your key configuration in the Google API console.","app-not-installed":"The requested mobile application corresponding to the identifier (Android package name or iOS bundle ID) provided is not installed on this device.","captcha-check-failed":"The reCAPTCHA response token provided is either invalid, expired, already used or the domain associated with it does not match the list of whitelisted domains.","code-expired":"The SMS code has expired. Please re-send the verification code to try again.","cordova-not-ready":"Cordova framework is not ready.","cors-unsupported":"This browser is not supported.","credential-already-in-use":"This credential is already associated with a different user account.","custom-token-mismatch":"The custom token corresponds to a different audience.","requires-recent-login":"This operation is sensitive and requires recent authentication. Log in again before retrying this request.","dynamic-link-not-activated":"Please activate Dynamic Links in the Firebase Console and agree to the terms and conditions.","email-already-in-use":"The email address is already in use by another account.","expired-action-code":"The action code has expired. ","cancelled-popup-request":"This operation has been cancelled due to another conflicting popup being opened.","internal-error":"An internal error has occurred.","invali
1d-app-credential":"The phone verification request contains an invalid application verifier. The reCAPTCHA token response is either invalid or expired.","invalid-app-id":"The mobile app identifier is not registed for the current project.","invalid-user-token":"This user's credential isn't valid for this project. This can happen if the user's token has been tampered with, or if the user isn't for the project associated with this API key.","invalid-auth-event":"An internal error has occurred.","invalid-verification-code":"The SMS verification code used to create the phone auth credential is invalid. Please resend the verification code sms and be sure use the verification code provided by the user.","invalid-continue-uri":"The continue URL provided in the request is invalid.","invalid-cordova-configuration":"The following Cordova plugins must be installed to enable OAuth sign-in: cordova-plugin-buildinfo, cordova-universal-links-plugin, cordova-plugin-browsertab, cordova-plugin-inappbrowser and cordova-plugin-customurlscheme.","invalid-custom-token":"The custom token format is incorrect. Please check the documentation.","invalid-dynamic-link-domain":"The provided dynamic link domain is not configured or authorized for the current project.","invalid-email":"The email address is badly formatted.","invalid-api-key":"Your API key is invalid, please check you have copied it correctly.","invalid-cert-hash":"The SHA-1 certificate hash provided is invalid.","invalid-credential":"The supplied auth credential is malformed or has expired.","invalid-persistence-type":"The specified persistence type is invalid. It can only be local, session or none.","invali
1d-message-payload":"The email template corresponding to this action contains invalid characters in its message. Please fix by going to the Auth email templates section in the Firebase Console.","invalid-oauth-provider":"EmailAuthProvider is not supported for this operation. This operation only supports OAuth providers.","invalid-oauth-client-id":"The OAuth client ID provided is either invalid or does not match the specified API key.","unauthorized-domain":"This domain is not authorized for OAuth operations for your Firebase project. Edit the list of authorized domains from the Firebase console.","invalid-action-code":"The action code is invalid. This can happen if the code is malformed, expired, or has already been used.","wrong-password":"The password is invalid or the user does not have a password.","invalid-phone-number":"The format of the phone number provided is incorrect. Please enter the phone number in a format that can be parsed into E.164 format. E.164 phone numbers are written in the format [+][country code][subscriber number including area code].","invalid-provider-id":"The specified provider ID is invali
1d.","invalid-recipient-email":"The email corresponding to this action failed to send as the provided recipient email address is invalid.","invalid-sender":"The email template corresponding to this action contains an invalid sender email or name. Please fix by going to the Auth email templates section in the Firebase Console.","invalid-verification-id":"The verification ID used to create the phone auth credential is invalid.","missing-android-pkg-name":"An Android Package Name must be provided if the Android App is required to be installed.","auth-domain-config-required":"Be sure to include authDomain when calling firebase.initializeApp(), by following the instructions in the Firebase console.","missing-app-credential":"The phone verification request is missing an application verifier assertion. A reCAPTCHA response token needs to be provided.","missing-verification-code":"The phone auth credential was created with an empty SMS verification code.","missing-continue-uri":"A continue URL must be provided in the request.","missing-iframe-start":"An internal error has occurred.","missing-ios-bundle-id":"An iOS Bundle ID must be provided if an App Store ID is provided.","missing-or-invalid-nonce":"The OIDC ID token requires a valid unhashed nonce.","missing-phone-number":"To send verification codes, provide a phone number for the recipient.","missing-verification-id":"The phone auth credential was created with an empty verification ID.","app-deleted":"This instance of FirebaseApp has been deleted.","account-exists-with-different-credential":"An account already exists with the same email address but different sign-in credentials. Sign in using a provider associated with this email address.","network-request-failed":"A network error (such as timeout, interrupted connection or unreachable host) has occurred.","no-auth-event":"An internal error has occurred.","no-such-provider":"User was not linked to an account with the given provider.","null-user":"A null user object was provided as the argument for an operation which requires a non-null user object.","operation-not-allowed":"The given sign-in provider is disabled for this Firebase project. Enable it in the Firebase console, under the sign-in method tab of the Auth section.","operation-not-supported-in-this-environment":'This operation is not supported in the environment this application is running on. "location.protocol" must be http, https or chrome-extension and web storage must be enabled.',"popup-blocked":"Unable to establish a connection with the popup. It may have been blocked by the browser.","popup-closed-by-user":"The popup has been closed by the user before finalizing the operation.","provider-already-linked":"User can only be linked to one identity for the given provider.","quota-exceeded":"The project's quota for this operation has been exceeded.","redirect-cancelled-by-user":"The redirect operation has been cancelled by the user before finalizing.","redirect-operation-pending":"A redirect sign-in operation is already pending.","rejected-credential":"The request contains malformed or mismatching credentials.",timeout:"The operation has timed out.","user-token-expired":"The user's credential is no longer valid. The user must sign in again.","too-many-requests":"We have blocked all requests from this device due to unusual activity. Try again later.","unauthorized-continue-uri":"The domain of the continue URL is not whitelisted.  Please whitelist the domain in the Firebase console.","unsupported-persistence-type":"The current environment does not support the specified persistence type.","user-cancelled":"User did not grant your application the permissions it requested.","user-not-found":"There is no user record corresponding to this identifier. The user may have been deleted.","user-disabled":"The user account has been disabled by an administrator.","user-mismatch":"The supplied credentials do not correspond to the previously signed in user.","user-signed-out":"","weak-password":"The password must be 6 characters long or more.","web-storage-unsupported":"This browser is not supported or 3rd party cookies and data may be disabled."};function Hr(t){var e=t[Yr];if(void 0===e)throw new qr("missing-continue-uri");if("string"!=typeof e||"string"==typeof e&&!e.length)throw new qr("invalid-continue-uri");this.h=e,this.b=this.a=null,this.g=!1;var n=t[$r];if(n&&"object"==typeof n){e=n[Zr];var r=n[Xr];if(n=n[Jr],"string"==typeof e&&e.length){if(this.a=e,void 0!==r&&"boolean"!=typeof r)throw new qr("argument-error",Xr+" property must be a boolean when specified.");if(this.g=!!r,void 0!==n&&("string"!=typeof n||"string"==typeof n&&!n.length))throw new qr("argument-error",Jr+" property must be a non empty string when specified.");this.b=n||null}else{if(void 0!==e)throw new qr("argument-error",Zr+" property must be a non empty string when specified.");if(void 0!==r||void 0!==n)throw new qr("missing-android-pkg-name")}}else if(void 0!==n)throw new qr("argument-error",$r+" property must be a non null object when specified.");if(this.f=null,(e=t[Qr])&&"object"==typeof e){if("string"==typeof(e=e[ti])&&e.length)this.f=e;else if(void 0!==e)throw new qr("argument-error",ti+" property must be a non empty string when specified.")}else if(void 0!==e)throw new qr("argument-error",Qr+" property must be a non null object when specified.");if(void 0!==(e=t[Gr])&&"boolean"!=typeof e)throw new qr("argument-error",Gr+" property must be a boolean when specified.");if(this.c=!!e,void 0!==(t=t[Kr])&&("string"!=typeof t||"string"==typeof t&&!t.length))throw new qr("argument-error",Kr+" property must be a non empty string when specified.");this.i=t||null}var $r="android",Kr="dynamicLinkDomain",Gr="handleCodeInApp",Qr="iOS",Yr="url",Xr="installApp",Jr="minimumVersion",Zr="packageName",ti="bundleId";function ei(t){var e={};for(var n in e.continueUrl=t.h,e.canHandleCodeInApp=t.c,(e.androidPackageName=t.a)&&(e.androidMinimumVersion=t.b,e.androidInstallApp=t.g),e.iOSBundleId=t.f,e.dynamicLinkDomain=t.i,e)null===e[n]&&delete e[n];return e}var ni=null,ri=null;function ii(t){this.c=t.sub,b(),this.a=t.provider_id||t.firebase&&t.firebase.sign_in_provider||null,this.b=!!t.is_anonymous||"anonymous"==this.a}function oi(t){return(t=ai(t))&&t.sub&&t.iss&&t.aud&&t.exp?new ii(t):null}function ai(t){if(!t)return null;if(3!=(t=t.split(".")).length)return null;for(var e=(4-(t=t[1]).length%4)%4,n=0;n<e;n++)t+=".";try{return JSON.parse(function(t){var e="";return function(t,e){function n(e){for(;r<t.length;){var n=t.charAt(r++),i=ri[n];if(null!=i)return i;if(!/^[\s\xa0]*$/.test(n))throw Error("Unknown base64 encoding at char: "+n)}return e}!function(){if(!ni){ni={},ri={};for(var t=0;65>t;t++)ni[t]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
1+/=".charAt(t),ri[ni[t]]=t,62<=t&&(ri["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.".charAt(t)]=t)}}();for(var r=0;;){var i=n(-1),o=n(0),a=n(64),s=n(64);if(64===s&&-1===i)break;e(i<<2|o>>4),64!=a&&(e(o<<4&240|a>>2),64!=s&&e(a<<6&192|s))}}(t,(function(t){e+=String.fromCharCode(t)})),e}(t))}catch(r){}return null}ii.prototype.f=function(){return this.b};var si,ui={$c:{ab:"https://www.googleapis.com/identitytoolkit/v3/relyingparty/",ib:"https://securetoken.googleapis.com/v1/token",id:"p"},bd:{ab:"https://staging-www.sandbox.googleapis.com/identitytoolkit/v3/relyingparty/",ib:"https://staging-securetoken.sandbox.googleapis.com/v1/token",id:"s"},cd:{ab:"https://www-googleapis-test.sandbox.google.com/identitytoolkit/v3/relyingparty/",ib:"https://test-securetoken.sandbox.googleapis.com/v1/token",id:"t"}};function ci(t){for(var e in ui)if(ui[e].id===t)return{firebaseEndpoint:(t=ui[e]).ab,secureTokenEndpoint:t.ib};return null}si=ci("__EID__")?"__EID__":void 0;var li="oauth_consumer_key oauth_nonce oauth_signature oauth_signature_method oauth_timestamp oauth_token oauth_version".split(" "),hi=["client_id","response_type","scope","redirect_uri","state"],fi={Vc:{Ma:"locale",Ba:500,Aa:600,Na:"facebook.com",hb:hi},Xc:{Ma:null,Ba:500,Aa:620,Na:"github.com",hb:hi},Yc:{Ma:"hl",Ba:515,Aa:680,Na:"google.com",hb:hi},dd:{Ma:"lang",Ba:485,Aa:705,Na:"twitter.com",hb:li}};function di(t){for(var e in fi)if(fi[e].Na==t)return fi[e];return null}function pi(t){var e={};e["facebook.com"]=bi,e["google.com"]=_i,e["github.com"]=wi,e["twitter.com"]=Si;var n=t&&t[yi];try{if(n)return e[n]?new e[n](t):new gi(t);if(void 0!==t[mi])return new vi(t)}catch(r){}return null}var mi="idToken",yi="providerId";function vi(t){var e=t[yi];if(!e&&t[mi]){var n=oi(t[mi]);n&&n.a&&(e=n.a)}if(!e)throw Error("Invalid additional user info!");"anonymous"!=e&&"custom"!=e||(e=null),n=!1,void 0!==t.isNewUser?n=!!t.isNewUser:"identitytoolkit#SignupNewUserResponse"===t.kind&&(n=!0),Or(this,"providerId",e),Or(this,"isNewUser",n)}function gi(t){vi.call(this,t),Or(this,"profile",Pr((t=yr(t.rawUserInfo||"{}"))||{}))}function bi(t){if(gi.call(this,t),"facebook.com"!=this.providerId)throw Error("Invalid provider ID!")}function wi(t){if(gi.call(this,t),"github.com"!=this.providerId)throw Error("Invalid provider ID!");Or(this,"username",this.profile&&this.profile.login||null)}function _i(t){if(gi.call(this,t),"google.com"!=this.providerId)throw Error("Invalid provider ID!")}function Si(t){if(gi.call(this,t),"twitter.com"!=this.providerId)throw Error("Invalid provider ID!");Or(this,"username",t.screenName||null)}function Ci(t){this.a=Qe(t)}function Ei(t){var e=Qe(t),n=Ge(e,"link"),r=Ge(Qe(n),"link");return e=Ge(e,"deep_link_id"),Ge(Qe(e),"link")||e||r||n||t}function Ti(t,e){return t.then((function(t){if(t[oa]){var n=oi(t[oa]);if(!n||e!=n.c)throw new qr("user-mismatch");return t}throw new qr("user-mismatch")})).s((function(t){throw t&&t.code&&t.code==Wr+"user-not-found"?new qr("user-mismatch"):t}))}function ki(t,e){if(!e)throw new qr("internal-error","failed to construct a credential");this.a=e,Or(this,"providerId",t),Or(this,"signInMethod",t)}function Ii(t){return{pendingToken:t.a,requestUri:"http://localhost"}}function Oi(t,e,n){if(this.a=null,e.idToken||e.accessToken)e.idToken&&Or(this,"idToken",e.idToken),e.accessToken&&Or(this,"accessToken",e.accessToken),e.nonce&&!e.pendingToken&&Or(this,"nonce",e.nonce),e.pendingToken&&(this.a=e.pendingToken);else{if(!e.oauthToken||!e.oauthTokenSecret)throw new qr("internal-error","failed to construct a credential");Or(this,"accessToken",e.oauthToken),Or(this,"secret",e.oauthTokenSecret)}Or(this,"providerId",t),Or(this,"signInMethod",n)}function xi(t){var e={};return t.idToken&&(e.id_token=t.idToken),t.accessToken&&(e.access_token=t.accessToken),t.secret&&(e.oauth_token_secret=t.secret),e.providerId=t.providerId,t.nonce&&!t.a&&(e.nonce=t.nonce),e={postBody:un(e).toString(),requestUri:"http://localhost"},t.a&&(delete e.postBody,e.pendingToken=t.a),e}function Ai(t,e){this.Dc=e||[],xr(this,{providerId:t,isOAuthProvider:!0}),this.yb={},this.cb=(di(t)||{}).Ma||null,this.$a=null}function Pi(t){if("string"!=typeof t||0!=t.indexOf("saml."))throw new qr("argument-error",'SAML provider IDs must be prefixed with "saml."');Ai.call(this,t,[])}function Di(t){Ai.call(this,t,hi),this.a=[]}function Ri(){Di.call(this,"facebook.com")}function Ni(t){if(!t)throw new qr("argument-error","credential failed: expected 1 argument (the OAuth access token).");var e=t;return f(t)&&(e=t.accessToken),(new Ri).credential(null,e)}function ji(){Di.call(this,"github.com")}function Mi(t){if(!t)throw new qr("argument-error","credential failed: expected 1 argument (the OAuth access token).");var e=t;return f(t)&&(e=t.accessToken),(new ji).credential(null,e)}function Li(){Di.call(this,"google.com"),this.ua("profile")}function Fi(t,e){var n=t;return f(t)&&(n=t.idToken,e=t.accessToken),(new Li).credential(n,e)}function Ui(){Ai.call(this,"twitter.com",li)}function Vi(t,e){var n=t;if(f(n)||(n={oauthToken:t,oauthTokenSecret:e}),!n.oauthToken||!n.oauthTokenSecret)throw new qr("argument-error","credential failed: expected 2 arguments (the OAuth access token and secret).");return new Oi("twitter.com",n,"twitter.com")}function qi(t,e,n){this.a=t,this.c=e,Or(this,"providerId","password"),Or(this,"signInMethod",n===Bi.EMAIL_LINK_SIGN_IN_METHOD?Bi.EMAIL_LINK_SIGN_IN_METHOD:Bi.EMAIL_PASSWORD_SIGN_IN_METHOD)}function Bi(){xr(this,{providerId:"password",isOAuthProvider:!1})}function Wi(t,e){if(!(e=zi(e)))throw new qr("argument-error","Invalid email link!");return new qi(t,e,Bi.EMAIL_LINK_SIGN_IN_METHOD)}function zi(t){var e=Ge((t=new Ci(t=Ei(t))).a,"oobCode")||null;return"signIn"===(Ge(t.a,"mode")||null)&&e?e:null}function Hi(t){if(!(t.Ta&&t.Sa||t.Fa&&t.$))throw new qr("internal-error");this.a=t,Or(this,"providerId","phone"),Or(this,"signInMethod","phone")}function $i(t){return t.a.Fa&&t.a.$?{temporaryProof:t.a.Fa,phoneNumber:t.a.$}:{sessionInfo:t.a.Ta,code:t.a.Sa}}function Ki(t){try{this.a=t||i.a.auth()}catch(e){throw new qr("argument-error","Either an instance of firebase.auth.Auth must be passed as an argument to the firebase.auth.PhoneAuthProvider constructor, or the default firebase App instance must be initialized via firebase.initializeApp().")}xr(this,{providerId:"phone",isOAuthProvider:!1})}function Gi(t,e){if(!t)throw new qr("missing-verification-id");if(!e)throw new qr("missing-verification-code");return new Hi({Ta:t,Sa:e})}function Qi(t){if(t.temporaryProof&&t.phoneNumber)return new Hi({Fa:t.temporaryProof,$:t.phoneNumber});var e=t&&t.providerId;if(!e||"password"===e)return null;var n=t&&t.oauthAccessToken,r=t&&t.oauthTokenSecret,i=t&&t.nonce,o=t&&t.oauthIdToken,a=t&&t.pendingToken;try{switch(e){case"google.com":return Fi(o,n);case"facebook.com":return Ni(n);case"github.com":return Mi(n);case"twitter.com":return Vi(n,r);default:return n||r||o||a?a?0==e.indexOf("saml.")?new ki(e,a):new Oi(e,{pendingToken:a,idToken:t.oauthIdToken,accessToken:t.oauthAccessToken},e):new Di(e).credential(o,n,i):null}}catch(s){return null}}function Yi(t){if(!t.isOAuthProvider)throw new qr("invalid-oauth-provider")}function Xi(t,e,n,r,i,o){if(this.b=t,this.c=e||null,this.f=n||null,this.g=r||null,this.h=o||null,this.a=i||null,!this.f&&!this.a)throw new qr("invalid-auth-event");
1if(this.f&&this.a)throw new qr("invalid-auth-event");if(this.f&&!this.g)throw new qr("invalid-auth-event")}function Ji(t){return(t=t||{}).type?new Xi(t.type,t.eventId,t.urlResponse,t.sessionId,t.error&&Br(t.error),t.postBody):null}function Zi(){this.b=null,this.a=[]}w(gi,vi),w(bi,gi),w(wi,gi),w(_i,gi),w(Si,gi),ki.prototype.la=function(t){return Ca(t,Ii(this))},ki.prototype.b=function(t,e){var n=Ii(this);return n.idToken=e,Ea(t,n)},ki.prototype.f=function(t,e){return Ti(Ta(t,Ii(this)),e)},ki.prototype.C=function(){return{providerId:this.providerId,signInMethod:this.signInMethod,pendingToken:this.a}},Oi.prototype.la=function(t){return Ca(t,xi(this))},Oi.prototype.b=function(t,e){var n=xi(this);return n.idToken=e,Ea(t,n)},Oi.prototype.f=function(t,e){return Ti(Ta(t,xi(this)),e)},Oi.prototype.C=function(){var t={providerId:this.providerId,signInMethod:this.signInMethod};return this.idToken&&(t.oauthIdToken=this.idToken),this.accessToken&&(t.oauthAccessToken=this.accessToken),this.secret&&(t.oauthTokenSecret=this.secret),this.nonce&&(t.nonce=this.nonce),this.a&&(t.pendingToken=this.a),t},Ai.prototype.Da=function(t){return this.yb=ot(t),this},w(Pi,Ai),w(Di,Ai),Di.prototype.ua=function(t){return M(this.a,t)||this.a.push(t),this},Di.prototype.Eb=function(){return V(this.a)},Di.prototype.credential=function(t,e,n){if(!t&&!e)throw new qr("argument-error","credential failed: must provide the ID token and/or the access token.");return new Oi(this.providerId,{idToken:t||null,accessToken:e||null,nonce:n||null},this.providerId)},w(Ri,Di),Or(Ri,"PROVIDER_ID","facebook.com"),Or(Ri,"FACEBOOK_SIGN_IN_METHOD","facebook.com"),w(ji,Di),Or(ji,"PROVIDER_ID","github.com"),Or(ji,"GITHUB_SIGN_IN_METHOD","github.com"),w(Li,Di),Or(Li,"PROVIDER_ID","google.com"),Or(Li,"GOOGLE_SIGN_IN_METHOD","google.com"),w(Ui,Ai),Or(Ui,"PROVIDER_ID","twitter.com"),Or(Ui,"TWITTER_SIGN_IN_METHOD","twitter.com"),qi.prototype.la=function(t){return this.signInMethod==Bi.EMAIL_LINK_SIGN_IN_METHOD?ts(t,Ra,{email:this.a,oobCode:this.c}):ts(t,Ya,{email:this.a,password:this.c})},qi.prototype.b=function(t,e){return this.signInMethod==Bi.EMAIL_LINK_SIGN_IN_METHOD?ts(t,Na,{idToken:e,email:this.a,oobCode:this.c}):ts(t,za,{idToken:e,email:this.a,password:this.c})},qi.prototype.f=function(t,e){return Ti(this.la(t),e)},qi.prototype.C=function(){return{email:this.a,password:this.c,signInMethod:this.signInMethod}},xr(Bi,{PROVIDER_ID:"password"}),xr(Bi,{EMAIL_LINK_SIGN_IN_METHOD:"emailLink"}),xr(Bi,{EMAIL_PASSWORD_SIGN_IN_METHOD:"password"}),Hi.prototype.la=function(t){return t.Ua($i(this))},Hi.prototype.b=function(t,e){var n=$i(this);return n.idToken=e,ts(t,Ja,n)},Hi.prototype.f=function(t,e){var n=$i(this);return n.operation="REAUTH",Ti(t=ts(t,Za,n),e)},Hi.prototype.C=function(){var t={providerId:"phone"};return this.a.Ta&&(t.verificationId=this.a.Ta),this.a.Sa&&(t.verificationCode=this.a.Sa),this.a.Fa&&(t.temporaryProof=this.a.Fa),this.a.$&&(t.phoneNumber=this.a.$),t},Ki.prototype.Ua=function(t,e){var n=this.a.b;return St(e.verify()).then((function(i){if(!r(i))throw new qr("argument-error","An implementation of firebase.auth.ApplicationVerifier.prototype.verify() must return a firebase.Promise that resolves with a string.");switch(e.type){case"recaptcha":return function(t,e){return ts(t,Ba,e)}(n,{phoneNumber:t,recaptchaToken:i}).then((function(t){return"function"==typeof e.reset&&e.reset(),t}),(function(t){throw"function"==typeof e.reset&&e.reset(),t}));default:throw new qr("argument-error",'Only firebase.auth.ApplicationVerifiers with type="recaptcha" are currently supported.')}}))},xr(Ki,{PROVIDER_ID:"phone"}),xr(Ki,{PHONE_SIGN_IN_METHOD:"phone"}),Xi.prototype.C=function(){return{type:this.b,eventId:this.c,urlResponse:this.f,sessionId:this.g,postBody:this.h,error:this.a&&this.a.C()}};var to,eo=null;function no(t){var e="unauthorized-domain",n=void 0,r=Qe(t);t=r.b,"chrome-extension"==(r=r.c)?n=q("This chrome extension ID (chrome-extension://%s) is not authorized to run this operation. Add it to the OAuth redirect domains list in the Firebase console -> Auth section -> Sign in method tab.",t):"http"==r||"https"==r?n=q("This domain (%s) is not authorized to run this operation. Add it to the OAuth redirect domains list in the Firebase console -> Auth section -> Sign in method tab.",t):e="operation-not-supported-in-this-environment",qr.call(this,e,n)}function ro(t,e,n){qr.call(this,t,n),(t=e||{}).zb&&Or(this,"email",t.zb),t.$&&Or(this,"phoneNumber",t.$),t.credential&&Or(this,"credential",t.credential)}function io(t){if(t.code){var e=t.code||"";0==e.indexOf(Wr)&&(e=e.substring(Wr.length));var n={credential:Qi(t)};if(t.email)n.zb=t.email;else if(t.phoneNumber)n.$=t.phoneNumber;else if(!n.credential)return new qr(e,t.message||void 0);return new ro(e,n,t.message)}return null}function oo(){}function ao(){}function so(t){if(!t.f&&"undefined"==typeof XMLHttpRequest&&"undefined"!=typeof ActiveXObject){for(var e=["MSXML2.XMLHTTP.6.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"],n=0;n<e.length;n++){var r=e[n];try{return new ActiveXObject(r),t.f=r}catch(i){}}throw Error("Could not create ActiveXObject. ActiveX might be disabled, or MSXML might not be installed")}return t.f}function uo(){}function co(){this.a=new XDomainRequest,this.readyState=0,this.onreadystatechange=null,this.responseText="",this.status=-1,this.statusText="",this.a.onload=v(this.ec,this),this.a.onerror=v(this.Fb,this),this.a.onprogress=v(this.fc,this),this.a.ontimeout=v(this.ic,this)}function lo(t,e){t.readyState=e,t.onreadystatechange&&t.onreadystatechange()}function ho(t,e,n){this.reset(t,e,n,void 0,void 0)}function fo(t){this.f=t,this.b=this.c=this.a=null}function po(t,e){this.name=t,this.value=e}Zi.prototype.subscribe=function(t){var e=this;this.a.push(t),this.b||(this.b=function(t){for(var n=0;n<e.a.length;n++)e.a[n](t)},"function"==typeof(t=ur("universalLinks.subscribe",n))&&t(null,this.b))},Zi.prototype.unsubscribe=function(t){F(this.a,(function(e){return e==t}))},w(no,qr),w(ro,qr),ro.prototype.C=function(){var t={code:this.code,message:this.message};this.email&&(t.email=this.email),this.phoneNumber&&(t.phoneNumber=this.phoneNumber);var e=this.credential&&this.credential.C();return e&&ct(t,e),t},ro.prototype.toJSON=function(){return this.C()},oo.prototype.c=null,w(ao,oo),ao.prototype.a=function(){var t=so(this);return t?new ActiveXObject(t):new XMLHttpRequest},ao.prototype.b=function(){var t={};return so(this)&&(t[0]=!0,t[1]=!0),t},to=new ao,w(uo,oo),uo.prototype.a=function(){var t=new XMLHttpRequest;if("withCredentials"in t)return t;if("undefined"!=typeof XDomainRequest)return new co;throw Error("Unsupported browser")},uo.prototype.b=function(){return{}},(t=co.prototype).open=function(t,e,n){if(null!=n&&!n)throw Error("Only async requests are supported.");this.a.open(t,e)},t.send=function(t){if(t){if("string"!=typeof t)throw Error("Only string data is supported");this.a.send(t)}else this.a.send()},t.abort=function(){this.a.abort()},t.setRequestHeader=function(){},t.getResponseHeader=function(t){return"content-type"==t.toLowerCase()?this.a.contentType:""},t.ec=function(){this.status=200,this.responseText=this.a.responseText,lo(this,4)},t.Fb=function(){this.status=500,this.responseText="",lo(this,4)},t.ic=function(){this.Fb()},t.fc=function(){this.status=200,lo(this,1)},t.getAllResponseHeaders=function(){return"content-type: "+this.a.contentType},ho.prototype.a=null,ho.prototype.reset=function(t,e,n,r,i){r||b(),delete this.a},po.prototype.toString=function(){return this.name};var mo=new po("SEVERE",1e3),yo=new po("WARNING",900),vo=new po("CONFIG",700),go=new po("FINE",500);fo.prototype.log=function(t,e,n){if(t.value>=function t(e){return e.c?e.c:e.a?t(e.a):(T("Root logger has no level set."),null)}(this).value)for(h(e)&&(e=e()),t=new ho(t,String(e),this.f),n&&(t.a=n),n=this;n;)n=n.a};var bo={},wo=null;function _o(t){var e;if(wo||(wo=new fo(""),bo[""]=wo,wo.c=vo),!(e=bo[t])){e=new fo(t);var n=t.lastIndexOf("."),r=t.substr(n+1);(n=_o(t.substr(0,n))).b||(n.b={}),n.b[r]=e,e.a=n,bo[t]=e}return e}function So(t,e){t&&t.log(go,e,void 0)}function Co(t){this.f=t}function Eo(t){Pe.call(this),this.i=t,this.readyState=To,this.status=0,this.responseText=this.statusText="",this.onreadystatechange=null,this.g=new Headers,this.b=null,this.h="GET",this.c="",this.a=!1,this.f=_o("goog.net.FetchXmlHttp")}w(Co,oo),Co.prototype.a=function(){return new Eo(this.f)},Co.prototype.b=function(t){return function(){return t}}({}),w(Eo,Pe);var To=0;function ko(t){t.onreadystatechange&&t.onreadystatechange.call(t)}function Io(t){Pe.call(this),this.headers=new Ue,this.D=t||null,this.c=!1,this.w=this.a=null,this.h=this.N=this.m="",this.f=this.I=this.i=this.G=!1,this.g=0,this.u=null,this.o=Oo,this.v=this.O=!1}(t=Eo.prototype).open=function(t,e){if(this.readyState!=To)throw this.abort(),Error("Error reopening a connection");this.h=t,this.c=e,this.readyState=1,ko(this)},t.send=function(t){if(1!=this.readyState)throw this.abort(),Error("need to call open() first. ");this.a=!0;var e={headers:this.g,method:this.h,credentials:void 0,cache:void 0};
1t&&(e.body=t),this.i.fetch(new Request(this.c,e)).then(this.hc.bind(this),this.Gb.bind(this))},t.abort=function(){this.responseText="",this.g=new Headers,this.status=0,1<=this.readyState&&this.a&&4!=this.readyState&&(this.readyState=4,this.a=!1,ko(this)),this.readyState=To},t.hc=function(t){this.a&&(this.b||(this.b=t.headers,this.readyState=2,ko(this)),this.a&&(this.readyState=3,ko(this),this.a&&t.text().then(this.gc.bind(this,t),this.Gb.bind(this))))},t.gc=function(t,e){this.a&&(this.status=t.status,this.statusText=t.statusText,this.responseText=e,this.readyState=4,ko(this))},t.Gb=function(t){var e=this.f;e&&e.log(yo,"Failed to fetch url "+this.c,t instanceof Error?t:Error(t)),this.a&&(this.readyState=4,ko(this))},t.setRequestHeader=function(t,e){this.g.append(t,e)},t.getResponseHeader=function(t){return this.b?this.b.get(t.toLowerCase())||"":((t=this.f)&&t.log(yo,"Attempting to get response header but no headers have been received for url: "+this.c,void 0),"")},t.getAllResponseHeaders=function(){if(!this.b){var t=this.f;return t&&t.log(yo,"Attempting to get all response headers but no headers have been received for url: "+this.c,void 0),""}t=[];for(var e=this.b.entries(),n=e.next();!n.done;)t.push((n=n.value)[0]+": "+n[1]),n=e.next();return t.join("\r\n")},w(Io,Pe);var Oo="";Io.prototype.b=_o("goog.net.XhrIo");var xo=/^https?$/i,Ao=["POST","PUT"];function Po(t){return"content-type"==t.toLowerCase()}function Do(t,e){t.c=!1,t.a&&(t.f=!0,t.a.abort(),t.f=!1),t.h=e,Ro(t),jo(t)}function Ro(t){t.G||(t.G=!0,t.dispatchEvent("complete"),t.dispatchEvent("error"))}function No(t){if(t.c&&void 0!==e)if(t.w[1]&&4==Lo(t)&&2==Fo(t))So(t.b,Uo(t,"Local request error detected and ignored"));else if(t.i&&4==Lo(t))je(t.Jb,0,t);else if(t.dispatchEvent("readystatechange"),4==Lo(t)){So(t.b,Uo(t,"Request complete")),t.c=!1;try{var r,i=Fo(t);t:switch(i){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var o=!0;break t;default:o=!1}if(!(r=o)){var a;if(a=0===i){var s=String(t.m).match(Be)[1]||null;if(!s&&n.self&&n.self.location){var u=n.self.location.protocol;s=u.substr(0,u.length-1)}a=!xo.test(s?s.toLowerCase():"")}r=a}if(r)t.dispatchEvent("complete"),t.dispatchEvent("success");else{try{var c=2<Lo(t)?t.a.statusText:""}catch(l){So(t.b,"Can not get status: "+l.message),c=""}t.h=c+" ["+Fo(t)+"]",Ro(t)}}finally{jo(t)}}}function jo(t,e){if(t.a){Mo(t);var n=t.a,r=t.w[0]?a:null;t.a=null,t.w=null,e||t.dispatchEvent("ready");try{n.onreadystatechange=r}catch(i){(t=t.b)&&t.log(mo,"Problem encountered resetting onreadystatechange: "+i.message,void 0)}}}function Mo(t){t.a&&t.v&&(t.a.ontimeout=null),t.u&&(n.clearTimeout(t.u),t.u=null)}function Lo(t){return t.a?t.a.readyState:0}function Fo(t){try{return 2<Lo(t)?t.a.status:-1}catch(e){return-1}}function Uo(t,e){return e+" ["+t.N+" "+t.m+" "+Fo(t)+"]"}function Vo(t,e){this.g=[],this.v=t,this.u=e||null,this.f=this.a=!1,this.c=void 0,this.m=this.w=this.i=!1,this.h=0,this.b=null,this.l=0}function qo(t,e,n){t.a=!0,t.c=n,t.f=!e,Ho(t)}function Bo(t){if(t.a){if(!t.m)throw new $o(t);t.m=!1}}function Wo(t,e,n,r){t.g.push([e,n,r]),t.a&&Ho(t)}function zo(t){return j(t.g,(function(t){return h(t[1])}))}function Ho(t){if(t.h&&t.a&&zo(t)){var e=t.h,r=Qo[e];r&&(n.clearTimeout(r.a),delete Qo[e]),t.h=0}t.b&&(t.b.l--,delete t.b),e=t.c;for(var i=r=!1;t.g.length&&!t.i;){var o=t.g.shift(),a=o[0],s=o[1];if(o=o[2],a=t.f?s:a)try{var u=a.call(o||t.u,e);void 0!==u&&(t.f=t.f&&(u==e||u instanceof Error),t.c=e=u),(S(e)||"function"==typeof n.Promise&&e instanceof n.Promise)&&(i=!0,t.i=!0)}catch(c){e=c,t.f=!0,zo(t)||(r=!0)}}t.c=e,i&&(u=v(t.o,t,!0),i=v(t.o,t,!1),e instanceof Vo?(Wo(e,u,i),e.w=!0):e.then(u,i)),r&&(e=new Go(e),Qo[e.a]=e,t.h=e.a)}function $o(){C.call(this)}function Ko(){C.call(this)}function Go(t){this.a=n.setTimeout(v(this.c,this),0),this.b=t}(t=Io.prototype).Ga=function(){void 0!==e&&this.a&&(this.h="Timed out after "+this.g+"ms, aborting",So(this.b,Uo(this,this.h)),this.dispatchEvent("timeout"),this.abort(8))},t.abort=function(){this.a&&this.c&&(So(this.b,Uo(this,"Aborting")),this.c=!1,this.f=!0,this.a.abort(),this.f=!1,this.dispatchEvent("complete"),this.dispatchEvent("abort"),jo(this))},t.va=function(){this.a&&(this.c&&(this.c=!1,this.f=!0,this.a.abort(),this.f=!1),jo(this,!0)),Io.ob.va.call(this)},t.Jb=function(){this.qa||(this.I||this.i||this.f?No(this):this.wc())},t.wc=function(){No(this)},t.getResponse=function(){try{if(!this.a)return null;if("response"in this.a)return this.a.response;switch(this.o){case Oo:case"text":return this.a.responseText;case"arraybuffer":if("mozResponseArrayBuffer"in this.a)return this.a.mozResponseArrayBuffer}var t=this.b;return t&&t.log(mo,"Response type "+this.o+" is not supported on this browser",void 0),null}catch(e){return So(this.b,"Can not get response: "+e.message),null}},Vo.prototype.cancel=function(t){if(this.a)this.c instanceof Vo&&this.c.cancel();else{if(this.b){var e=this.b;delete this.b,t?e.cancel(t):(e.l--,0>=e.l&&e.cancel())}this.v?this.v.call(this.u,this):this.m=!0,this.a||(t=new Ko(this),Bo(this),qo(this,!1,t))}},Vo.prototype.o=function(t,e){this.i=!1,qo(this,t,e)},Vo.prototype.D=function(){Bo(this),qo(this,!0,null)},Vo.prototype.then=function(t,e,n){var r,i,o=new mt((function(t,e){r=t,i=e}));return Wo(this,r,(function(t){t instanceof Ko?o.cancel():i(t)})),o.then(t,e,n)},_(Vo),w($o,C),$o.prototype.message="Deferred has already fired",$o.prototype.name="AlreadyCalledError",w(Ko,C),Ko.prototype.message="Deferred was canceled",Ko.prototype.name="CanceledError",Go.prototype.c=function(){throw delete Qo[this.a],this.b};var Qo={};function Yo(t){var e={},n=e.document||document,r=bn(t),i=document.createElement("SCRIPT"),o={Lb:i,Ga:void 0},a=new Vo(Xo,o),s=null,u=null!=e.timeout?e.timeout:5e3;return 0<u&&(s=window.setTimeout((function(){Jo(i,!0);var t=new ea(ta,"Timeout reached for loading script "+r);Bo(a),qo(a,!1,t)}),u),o.Ga=s),i.onload=i.onreadystatechange=function(){i.readyState&&"loaded"!=i.readyState&&"complete"!=i.readyState||(Jo(i,e.fd||!1,s),a.D())},i.onerror=function(){Jo(i,!0,s);var t=new ea(Zo,"Error while loading script "+r);Bo(a),qo(a,!1,t)},ct(o=e.attributes||{}
1,{type:"text/javascript",charset:"UTF-8"}),Nn(i,o),i.src=bn(t),function(t){var e;return(e=(t||document).getElementsByTagName("HEAD"))&&0!=e.length?e[0]:t.documentElement}(n).appendChild(i),a}function Xo(){if(this&&this.Lb){var t=this.Lb;t&&"SCRIPT"==t.tagName&&Jo(t,!0,this.Ga)}}function Jo(t,e,r){null!=r&&n.clearTimeout(r),t.onload=a,t.onerror=a,t.onreadystatechange=a,e&&window.setTimeout((function(){t&&t.parentNode&&t.parentNode.removeChild(t)}),0)}var Zo=0,ta=1;function ea(t,e){var n="Jsloader error (code #"+t+")";e&&(n+=": "+e),C.call(this,n),this.code=t}function na(t){this.f=t}function ra(t,e,r){if(this.b=t,this.i=(t=e||{}).secureTokenEndpoint||"https://securetoken.googleapis.com/v1/token",this.l=t.secureTokenTimeout||aa,this.f=ot(t.secureTokenHeaders||sa),this.g=t.firebaseEndpoint||"https://www.googleapis.com/identitytoolkit/v3/relyingparty/",this.h=t.firebaseTimeout||ua,this.a=ot(t.firebaseHeaders||ca),r&&(this.a["X-Client-Version"]=r,this.f["X-Client-Version"]=r),r="Node"==er(),!(r=n.XMLHttpRequest||r&&i.a.INTERNAL.node&&i.a.INTERNAL.node.XMLHttpRequest)&&!tr())throw new qr("internal-error","The XMLHttpRequest compatibility library was not found.");this.c=void 0,this.c=tr()?new Co(self):nr()?new na(r):new uo}w(ea,C),w(na,oo),na.prototype.a=function(){return new this.f},na.prototype.b=function(){return{}};var ia,oa="idToken",aa=new wr(3e4,6e4),sa={"Content-Type":"application/x-www-form-urlencoded"},ua=new wr(3e4,6e4),ca={"Content-Type":"application/json"};function la(t,e){e?t.a["X-Firebase-Locale"]=e:delete t.a["X-Firebase-Locale"]}function ha(t,e){e?(t.a["X-Client-Version"]=e,t.f["X-Client-Version"]=e):(delete t.a["X-Client-Version"],delete t.f["X-Client-Version"])}function fa(t,e,r,i,o,a,s){(function(){var t=sr();return!((t="Chrome"!=ir(t)?null:(t=t.match(/\sChrome\/(\d+)/i))&&2==t.length?parseInt(t[1],10):null)&&30>t||zt&&Zt&&!(9<Zt))})()||tr()?t=v(t.o,t):(ia||(ia=new mt((function(t,e){!function(t,e){((window.gapi||{}).client||{}).request?t():(n[pa]=function(){((window.gapi||{}).client||{}).request?t():e(Error("CORS_UNSUPPORTED"))},function(t,e){Wo(t,null,e,void 0)}(Yo(wn(da,{onload:pa})),(function(){e(Error("CORS_UNSUPPORTED"))})))}(t,e)}))),t=v(t.m,t)),t(e,r,i,o,a,s)}
1ra.prototype.o=function(t,e,i,o,a,s){if(tr()&&(void 0===n.fetch||void 0===n.Headers||void 0===n.Request))throw new qr("operation-not-supported-in-this-environment","fetch, Headers and Request native APIs or equivalent Polyfills must be available to support HTTP requests from a Worker environment.");var u=new Io(this.c);if(s){u.g=Math.max(0,s);var c=setTimeout((function(){u.dispatchEvent("timeout")}),s)}De(u,"complete",(function(){c&&clearTimeout(c);var t=null;try{t=JSON.parse(function(t){try{return t.a?t.a.responseText:""}catch(e){return So(t.b,"Can not get responseText: "+e.message),""}}(this))||null}catch(n){t=null}e&&e(t)})),Re(u,"ready",(function(){c&&clearTimeout(c),Ut(this)})),Re(u,"timeout",(function(){c&&clearTimeout(c),Ut(this),e&&e(null)})),function(t,e,i,o,a){if(t.a)throw Error("[goog.net.XhrIo] Object is active with another request="+t.m+"; newUri="+e);i=i?i.toUpperCase():"GET",t.m=e,t.h="",t.N=i,t.G=!1,t.c=!0,t.a=t.D?t.D.a():to.a(),t.w=function(t){return t.c||(t.c=t.b())}(t.D?t.D:to),t.a.onreadystatechange=v(t.Jb,t);try{So(t.b,Uo(t,"Opening Xhr")),t.I=!0,t.a.open(i,String(e),!0),t.I=!1}catch(u){return So(t.b,Uo(t,"Error opening Xhr: "+u.message)),void Do(t,u)}e=o||"";var s=new Ue(t.headers);a&&function(t,e){if(t.forEach&&"function"==typeof t.forEach)t.forEach(e,void 0);else if(l(t)||r(t))R(t,e,void 0);else for(var n=Fe(t),i=Le(t),o=i.length,a=0;a<o;a++)e.call(void 0,i[a],n&&n[a],t)}(a,(function(t,e){s.set(e,t)})),a=function(t){t:{for(var e=Po,n=t.length,i=r(t)?t.split(""):t,o=0;o<n;o++)if(o in i&&e.call(void 0,i[o],o,t)){e=o;break t}e=-1}return 0>e?null:r(t)?t.charAt(e):t[e]}(s.U()),o=n.FormData&&e instanceof n.FormData,!M(Ao,i)||a||o||s.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8"),s.forEach((function(t,e){this.a.setRequestHeader(e,t)}),t),t.o&&(t.a.responseType=t.o),"withCredentials"in t.a&&t.a.withCredentials!==t.O&&(t.a.withCredentials=t.O);try{Mo(t),0<t.g&&(t.v=function(t){return zt&&ee(9)&&"number"==typeof t.timeout&&void 0!==t.ontimeout}(t.a),So(t.b,Uo(t,"Will abort after "+t.g+"ms if incomplete, xhr2 "+t.v)),t.v?(t.a.timeout=t.g,t.a.ontimeout=v(t.Ga,t)):t.u=je(t.Ga,t.g,t)),So(t.b,Uo(t,"Sending request")),t.i=!0,t.a.send(e),t.i=!1}catch(u){So(t.b,Uo(t,"Send error: "+u.message)),Do(t,u)}}(u,t,i,o,a)};var da=vn("https://apis.google.com/js/client.js?onload=%{onload}"),pa="__fcb"+Math.floor(1e6*Math.random()).toString();function ma(t){if(!r(t=t.email)||!Yn.test(t))throw new qr("invalid-email")}function ya(t){"email"in t&&ma(t)}function va(t){if(!t[oa])throw new qr("internal-error")}function ga(t){if(t.phoneNumber||t.temporaryProof){if(!t.phoneNumber||!t.temporaryProof)throw new qr("internal-error")}else{if(!t.sessionInfo)throw new qr("missing-verification-id");if(!t.code)throw new qr("missing-verification-code")}}ra.prototype.m=function(t,e,n,r,i){var o=this;ia.then((function(){window.gapi.client.setApiKey(o.b);var a=window.gapi.auth.getToken();window.gapi.auth.setToken(null),window.gapi.client.request({path:t,method:n,body:r,headers:i,authType:"none",callback:function(t){window.gapi.auth.setToken(a),e&&e(t)}})})).s((function(t){e&&e({error:{message:t&&t.message||"CORS_UNSUPPORTED"}})}))},ra.prototype.Qa=function(){return ts(this,Ha,{})},ra.prototype.pb=function(t,e){return ts(this,Wa,{idToken:t,email:e})},ra.prototype.qb=function(t,e){return ts(this,za,{idToken:t,password:e})};var ba={displayName:"DISPLAY_NAME",photoUrl:"PHOTO_URL"};function wa(t){if(!t.requestUri||!t.sessionId&&!t.postBody&&!t.pendingToken)throw new qr("internal-error")}function _a(t,e){return e.oauthIdToken&&e.providerId&&0==e.providerId.indexOf("oidc.")&&!e.pendingToken&&(t.sessionId?e.nonce=t.sessionId:t.postBody&&ln(t=new an(t.postBody),"nonce")&&(e.nonce=t.get("nonce"))),e}function Sa(t){var e=null;if(t.needConfirmation?(t.code="account-exists-with-different-credential",e=io(t)):"FEDERATED_USER_ID_ALREADY_LINKED"==t.errorMessage?(t.code="credential-already-in-use",e=io(t)):"EMAIL_EXISTS"==t.errorMessage?(t.code="email-already-in-use",e=io(t)):t.errorMessage&&(e=es(t.errorMessage)),e)throw e;if(!t[oa])throw new qr("internal-error")}function Ca(t,e){return e.returnIdpCredential=!0,ts(t,$a,e)}function Ea(t,e){return e.returnIdpCredential=!0,ts(t,Ga,e)}function Ta(t,e){return e.returnIdpCredential=!0,e.autoCreate=!1,ts(t,Ka,e)}function ka(t){if(!t.oobCode)throw new qr("invalid-action-code")}(t=ra.prototype).rb=function(t,e){var n={idToken:t},r=[];return rt(ba,(function(t,i){var o=e[i];null===o?r.push(t):i in e&&(n[i]=o)})),r.length&&(n.deleteAttribute=r),ts(this,Wa,n)},t.kb=function(t,e){return ct(t={requestType:"PASSWORD_RESET",email:t},e),ts(this,Fa,t)},t.lb=function(t,e){return ct(t={requestType:"EMAIL_SIGNIN",email:t},e),ts(this,Ma,t)},t.jb=function(t,e){return ct(t={requestType:"VERIFY_EMAIL",idToken:t},e),ts(this,La,t)},t.Ua=function(t){return ts(this,Xa,t)},t.Za=function(t,e){return ts(this,qa,{oobCode:t,newPassword:e})},t.Ja=function(t){return ts(this,Oa,{oobCode:t})},t.Wa=function(t){return ts(this,Ia,{oobCode:t})};var Ia={endpoint:"setAccountInfo",B:ka,da:"email"},Oa={endpoint:"resetPassword",B:ka,J:function(t){var e=t.requestType;if(!e||!t.email&&"EMAIL_SIGNIN"!=e)throw new qr("internal-error")}},xa={endpoint:"signupNewUser",B:function(t){if(ma(t),!t.password)throw new qr("weak-password")},J:va,R:!0},Aa={endpoint:"createAuthUri"},Pa={endpoint:"deleteAccount",T:["idToken"]},Da={endpoint:"setAccountInfo",T:["idToken","deleteProvider"],B:function(t){if(!c(t.deleteProvider))throw new qr("internal-error")}},Ra={endpoint:"emailLinkSignin",T:["email","oobCode"],B:ma,J:va,R:!0},Na={endpoint:"emailLinkSignin",T:["idToken","email","oobCode"],B:ma,J:va,R:!0},ja={endpoint:"getAccountInfo"},Ma={endpoint:"getOobConfirmationCode",T:["requestType"],B:function(t){if("EMAIL_SIGNIN"!=t.requestType)throw new qr("internal-error");ma(t)},da:"email"},La={endpoint:"getOobConfirmationCode",T:["idToken","requestType"],B:function(t){if("VERIFY_EMAIL"!=t.requestType)throw new qr("internal-error")},da:"email"},Fa={endpoint:"getOobConfirmationCode",T:["requestType"],B:function(t){if("PASSWORD_RESET"!=t.requestType)throw new qr("internal-error");ma(t)},da:"email"},Ua={ub:!0,endpoint:"getProjectConfig",Ib:"GET"},Va={ub:!0,endpoint:"getRecaptchaParam",Ib:"GET",J:function(t){if(!t.recaptchaSiteKey)throw new qr("internal-error")}},qa={endpoint:"resetPassword",B:ka,da:"email"},Ba={endpoint:"sendVerificationCode",T:["phoneNumber","recaptchaToken"],da:"sessionInfo"},Wa={endpoint:"setAccountInfo",T:["idToken"],B:ya,R:!0},za={endpoint:"setAccountInfo",T:["idToken"],B:function(t){if(ya(t),!t.password)throw new qr("weak-password")},J:va,R:!0},Ha={endpoint:"signupNewUser",J:va,R:!0},$a={endpoint:"verifyAssertion",B:wa,Oa:_a,J:Sa,R:!0},Ka={endpoint:"verifyAssertion",B:wa,Oa:_a,J:function(t){if(t.errorMessage&&"USER_NOT_FOUND"==t.errorMessage)throw new qr("user-not-found");if(t.errorMessage)throw es(t.errorMessage);if(!t[oa])throw new qr("internal-error")},R:!0},Ga={endpoint:"verifyAssertion",B:function(t){if(wa(t),!t.idToken)throw new qr("internal-error")},Oa:_a,J:Sa,R:!0},Qa={endpoint:"verifyCustomToken",B:function(t){if(!t.token)throw new qr("invalid-custom-token")},J:va,R:!0},Ya={endpoint:"verifyPassword",B:function(t){if(ma(t),!t.password)throw new qr("wrong-password")},J:va,R:!0},Xa={endpoint:"verifyPhoneNumber",B:ga,J:va},Ja={endpoint:"verifyPhoneNumber",B:function(t){if(!t.idToken)throw new qr("internal-error");ga(t)},J:function(t){if(t.temporaryProof)throw t.code="credential-already-in-use",io(t);va(t)}},Za={Xb:{USER_NOT_FOUND:"user-not-found"},endpoint:"verifyPhoneNumber",B:ga,J:va};function ts(t,e,n){if(!function(t,e){if(!e||!e.length)return!0;
1if(!t)return!1;for(var n=0;n<e.length;n++){var r=t[e[n]];if(null==r||""===r)return!1}return!0}(n,e.T))return Ct(new qr("internal-error"));var r,i=e.Ib||"POST";return St(n).then(e.B).then((function(){return e.R&&(n.returnSecureToken=!0),function(t,e,n,r,i,o){var a=Qe(t.g+e);Ke(a,"key",t.b),o&&Ke(a,"cb",b().toString());var s="GET"==n;if(s)for(var u in r)r.hasOwnProperty(u)&&Ke(a,u,r[u]);return new mt((function(e,o){fa(t,a.toString(),(function(t){t?t.error?o(ns(t,i||{})):e(t):o(new qr("network-request-failed"))}),n,s?void 0:Fn(mr(r)),t.a,t.h.get())}))}(t,e.endpoint,i,n,e.Xb,e.ub||!1)})).then((function(t){return r=t,e.Oa?e.Oa(n,r):r})).then(e.J).then((function(){if(!e.da)return r;if(!(e.da in r))throw new qr("internal-error");return r[e.da]}))}function es(t){return ns({error:{errors:[{message:t}],code:400,message:t}})}function ns(t,e){var n=(t.error&&t.error.errors&&t.error.errors[0]||{}).reason||"",r={keyInvalid:"invalid-api-key",ipRefererBlocked:"app-not-authorized"};if(n=r[n]?new qr(r[n]):null)return n;for(var i in n=t.error&&t.error.message||"",ct(r={INVALID_CUSTOM_TOKEN:"invalid-custom-token",CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVALID_IDENTIFIER:"invalid-email",MISSING_CONTINUE_URI:"internal-error",INVALID_EMAIL:"invalid-email",INVALID_PASSWORD:"wrong-password",USER_DISABLED:"user-disabled",MISSING_PASSWORD:"internal-error",EMAIL_EXISTS:"email-already-in-use",PASSWORD_LOGIN_DISABLED:"operation-not-allowed",INVALID_IDP_RESPONSE:"invalid-credential",INVALID_PENDING_TOKEN:"invalid-credential",FEDERATED_USER_ID_ALREADY_LINKED:"credential-already-in-use",MISSING_OR_INVALID_
1NONCE:"missing-or-invalid-nonce",INVALID_MESSAGE_PAYLOAD:"invalid-message-payload",INVALID_RECIPIENT_EMAIL:"invalid-recipient-email",INVALID_SENDER:"invalid-sender",EMAIL_NOT_FOUND:"user-not-found",RESET_PASSWORD_EXCEED_LIMIT:"too-many-requests",EXPIRED_OOB_CODE:"expired-action-code",INVALID_OOB_CODE:"invalid-action-code",MISSING_OOB_CODE:"internal-error",INVALID_PROVIDER_ID:"invalid-provider-id",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"requires-recent-login",INVALID_ID_TOKEN:"invalid-user-token",TOKEN_EXPIRED:"user-token-expired",USER_NOT_FOUND:"user-token-expired",CORS_UNSUPPORTED:"cors-unsupported",DYNAMIC_LINK_NOT_ACTIVATED:"dynamic-link-not-activated",INVALID_APP_ID:"invalid-app-id",TOO_MANY_ATTEMPTS_TRY_LATER:"too-many-requests",WEAK_PASSWORD:"weak-password",OPERATION_NOT_ALLOWED:"operation-not-allowed",USER_CANCELLED:"user-cancelled",CAPTCHA_CHECK_FAILED:"captcha-check-failed",INVALID_APP_CREDENTIAL:"invalid-app-credential",INVALID_CODE:"invalid-verification-code",INVALID_PHONE_NUMBER:"invalid-phone-number",INVALID_SESSION_INFO:"invalid-verification-id",INVALID_TEMPORARY_PROOF:"invalid-credential",MISSING_APP_CREDENTIAL:"missing-app-credential",MISSING_CODE:"missing-verification-code",MISSING_PHONE_NUMBER:"missing-phone-number",MISSING_SESSION_INFO:"missing-verification-id",QUOTA_EXCEEDED:"quota-exceeded",SESSION_EXPIRED:"code-expired",REJECTED_CREDENTIAL:"rejected-credential",INVALID_CONTINUE_URI:"invalid-continue-uri",MISSING_ANDROID_PACKAGE_NAME:"missing-android-pkg-name",MISSING_IOS_BUNDLE_ID:"missing-ios-bundle-id",UNAUTHORIZED_DOMAIN:"unauthorized-continue-uri",INVALID_DYNAMIC_LINK_DOMAIN:"invalid-dynamic-link-domain",INVALID_OAUTH_CLIENT_ID:"invalid-oauth-client-id",INVALID_CERT_HASH:"invalid-cert-hash"},e||{}),e=(e=n.match(/^[^\s]+\s*:\s*(.*)$/))&&1<e.length?e[1]:void 0,r)if(0===n.indexOf(i))return new qr(r[i],e);return!e&&t&&(e=pr(t)),new qr("internal-error",e)}function rs(t){this.b=t,this.a=null,this.fb=function(t){return(ss||(ss=new mt((function(t,e){function r(){br(),ur("gapi.load")("gapi.iframes",{callback:t,ontimeout:function(){br(),e(Error("Network Error"))},timeout:os.get()})}if(ur("gapi.iframes.Iframe"))t();else if(ur("gapi.load"))r();else{var i="__iframefcb"+Math.floor(1e6*Math.random()).toString();n[i]=function(){ur("gapi.load")?r():e(Error("Network Error"))},St(Yo(i=wn(is,{onload:i}))).s((function(){e(Error("Network Error"))}))}})).s((function(t){throw ss=null,t})))).then((function(){return new mt((function(e,n){ur("gapi.iframes.getContext")().open({where:document.body,url:t.b,messageHandlersFilter:ur("gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER"),attributes:{style:{position:"absolute",top:"-100px",width:"1px",height:"1px"}},dontclear:!0},(function(r){function i(){clearTimeout(o),e()}t.a=r,t.a.restyle({setHideOnLeave:!1});var o=setTimeout((function(){n(Error("Network Error"))}),as.get());r.ping(i).then(i,(function(){n(Error("Network Error"))}))}))}))}))}(this)}var is=vn("https://apis.google.com/js/api.js?onload=%{onload}"),os=new wr(3e4,6e4),as=new wr(5e3,15e3),ss=null;function us(t,e,n){this.i=t,this.g=e,this.h=n,this.f=null,this.a=Ye(this.i,"/__/auth/iframe"),Ke(this.a,"apiKey",this.g),Ke(this.a,"appName",this.h),this.b=null,this.c=[]}function cs(t,e,n,r,i){this.o=t,this.m=e,this.c=n,this.l=r,this.h=this.g=this.i=null,this.a=i,this.f=null}function ls(t){try{return i.a.app(t).auth().ya()}catch(e){return[]}}function hs(t,e,n,r,i){this.m=t,this.f=e,this.b=n,this.c=r||null,this.h=i||null,this.o=this.u=this.v=null,this.g=[],this.l=this.a=null}function fs(t){var e=zn();return function(t){return ts(t,Ua,{}).then((function(t){return t.authorizedDomains||[]}))}(t).then((function(t){t:{var n=Qe(e),r=n.c;n=n.b;for(var i=0;i<t.length;i++){var o=t[i],a=n,s=r;if(0==o.indexOf("chrome-extension://")?a=Qe(o).b==a&&"chrome-extension"==s:"http"!=s&&"https"!=s?a=!1:Qn.test(o)?a=a==o:(o=o.split(".").join("\\."),a=new RegExp("^(.+\\."+o+"|"+o+")$","i").test(a)),a){t=!0;break t}}t=!1}if(!t)throw new no(zn())}))}function ds(t){return t.l||(t.l=Xn().then((function(){if(!t.u){var e=t.c,n=t.h,r=ls(t.b),i=new us(t.m,t.f,t.b);i.f=e,i.b=n,i.c=V(r||[]),t.u=i.toString()}t.i=new rs(t.u),function(t){if(!t.i)throw Error("IfcHandler must be initialized!");!function(t,e){t.fb.then((function(){t.a.register("authEvent",e,ur("gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER"))}))}(t.i,(function(e){var n={};if(e&&e.authEvent){var r=!1;for(e=Ji(e.authEvent),n=0;n<t.g.length;n++)r=t.g[n](e)||r;return(n={}).status=r?"ACK":"ERROR",St(n)}return n.status="ERROR",St(n)}))}(t)}))),t.l}function ps(t){return t.o||(t.v=t.c?ar(t.c,ls(t.b)):null,t.o=new ra(t.f,ci(t.h),t.v)),t.o}function ms(t,e,n,r,i,o,a,s,u,c){return(t=new cs(t,e,n,r,i)).i=o,t.g=a,t.h=s,t.b=ot(u||null),t.f=c,t.toString()}function ys(t){if(this.a=t||i.a.INTERNAL.reactNative&&i.a.INTERNAL.reactNative.AsyncStorage,!this.a)throw new qr("internal-error","The React Native compatibility library was not found.");this.type="asyncStorage"}function vs(t){this.b=t,this.a={},this.c=v(this.f,this)}us.prototype.toString=function(){return this.f?Ke(this.a,"v",this.f):cn(this.a.a,"v"),this.b?Ke(this.a,"eid",this.b):cn(this.a.a,"eid"),this.c.length?Ke(this.a,"fw",this.c.join(",")):cn(this.a.a,"fw"),this.a.toString()},cs.prototype.toString=function(){var t=Ye(this.o,"/__/auth/handler");if(Ke(t,"apiKey",this.m),Ke(t,"appName",this.c),Ke(t,"authType",this.l),this.a.isOAuthProvider){var e=this.a;try{var n=i.a.app(this.c).auth().ea()}catch(u){n=null}for(var r in e.$a=n,Ke(t,"providerId",this.a.providerId),n=mr((e=this.a).yb))n[r]=n[r].toString();r=e.Dc,n=ot(n);for(var o=0;o<r.length;o++){var a=r[o];a in n&&delete n[a]}e.cb&&e.$a&&!n[e.cb]&&(n[e.cb]=e.$a),it(n)||Ke(t,"customParameters",pr(n))}if("function"==typeof this.a.Eb&&(e=this.a.Eb()).length&&Ke(t,"scopes",e.join(",")),this.i?Ke(t,"redirectUrl",this.i):cn(t.a,"redirectUrl"),this.g?Ke(t,"eventId",this.g):cn(t.a,"eventId"),this.h?Ke(t,"v",this.h):cn(t.a,"v"),this.b)for(var s in this.b)this.b.hasOwnProperty(s)&&!Ge(t,s)&&Ke(t,s,this.b[s]);return this.f?Ke(t,"eid",this.f):cn(t.a,"eid"),(s=ls(this.c)).length&&Ke(t,"fw",s.join(",")),t.toString()},(t=hs.prototype).Ea=function(t,e,n){var r=new qr("popup-closed-by-user"),i=new qr("web-storage-unsupported"),o=this,a=!1;return this.ga().then((function(){(function(t){var e={type:"webStorageSupport"};return ds(t).then((function(){return function(t,e){return t.fb.then((function(){return new mt((function(n){t.a.send(e.type,e,n,ur("gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER"))}))}))}(t.i,e)})).then((function(t){if(t&&t.length&&void 0!==t[0].webStorageSupport)return t[0].webStorageSupport;throw Error()}))})(o).then((function(n){n||(t&&Kn(t),e(i),a=!0)}))})).s((function(){})).then((function(){if(!a)return function(t){return new mt((function(e){return function n(){Me(2e3).then((function(){if(t&&!t.closed)return n();e()}
1))}()}))}(t)})).then((function(){if(!a)return Me(n).then((function(){e(r)}))}))},t.Mb=function(){var t=sr();return!dr(t)&&!gr(t)},t.Hb=function(){return!1},t.Cb=function(t,e,n,r,i,o,a){if(!t)return Ct(new qr("popup-blocked"));if(a&&!dr())return this.ga().s((function(e){Kn(t),i(e)})),r(),St();this.a||(this.a=fs(ps(this)));var s=this;return this.a.then((function(){var e=s.ga().s((function(e){throw Kn(t),i(e),e}));return r(),e})).then((function(){Yi(n),a||Hn(ms(s.m,s.f,s.b,e,n,null,o,s.c,void 0,s.h),t)})).s((function(t){throw"auth/network-request-failed"==t.code&&(s.a=null),t}))},t.Ca=function(t,e,n){this.a||(this.a=fs(ps(this)));var r=this;return this.a.then((function(){Yi(e),Hn(ms(r.m,r.f,r.b,t,e,zn(),n,r.c,void 0,r.h))})).s((function(t){throw"auth/network-request-failed"==t.code&&(r.a=null),t}))},t.ga=function(){var t=this;return ds(this).then((function(){return t.i.fb})).s((function(){throw t.a=null,new qr("network-request-failed")}))},t.Qb=function(){return!0},t.wa=function(t){this.g.push(t)},t.Ka=function(t){F(this.g,(function(e){return e==t}))},(t=ys.prototype).get=function(t){return St(this.a.getItem(t)).then((function(t){return t&&yr(t)}))},t.set=function(t,e){return St(this.a.setItem(t,pr(e)))},t.P=function(t){return St(this.a.removeItem(t))},t.Y=function(){},t.ca=function(){};var gs,bs=[];function ws(t){this.a=t}function _s(t){this.c=t,this.b=!1,this.a=[]}function Ss(t,e,n,r){var i,o,a,s,u=n||{},c=null;if(t.b)return Ct(Error("connection_unavailable"));var l=r?800:50,h="undefined"!=typeof MessageChannel?new MessageChannel:null;return new mt((function(n,r){h?(i=Math.floor(Math.random()*Math.pow(10,20)).toString(),h.port1.start(),a=setTimeout((function(){r(Error("unsupported_event"))}),l),t.a.push(c={messageChannel:h,onMessage:o=function(t){t.data.eventId===i&&("ack"===t.data.status?(clearTimeout(a),s=setTimeout((function(){r(Error("timeout"))}),3e3)):"done"===t.data.status?(clearTimeout(s),void 0!==t.data.response?n(t.data.response):r(Error("unknown_error"))):(clearTimeout(a),clearTimeout(s),r(Error("invalid_response"))))}}),h.port1.addEventListener("message",o),t.c.postMessage({eventType:e,eventId:i,data:u},[h.port2])):r(Error("connection_unavailable"))})).then((function(e){return Cs(t,c),e})).s((function(e){throw Cs(t,c),e}))}function Cs(t,e){if(e){var n=e.messageChannel;n&&(n.port1.removeEventListener("message",e.onMessage),n.port1.close()),F(t.a,(function(t){return t==e}))}}function Es(){if(!ks())throw new qr("web-storage-unsupported");this.c={},this.a=[],this.b=0,this.m=n.indexedDB,this.type="indexedDB",this.g=this.l=this.f=this.i=null,this.u=!1,this.h=null;var t=this;tr()&&self?(this.l=function(){var t=tr()?self:null;if(R(bs,(function(n){n.b==t&&(e=n)})),!e){var e=new vs(t);bs.push(e)}return e}(),this.l.subscribe("keyChanged",(function(e,n){return Ps(t).then((function(e){return 0<e.length&&R(t.a,(function(t){t(e)})),{keyProcessed:M(e,n.key)}}))})),this.l.subscribe("ping",(function(){return St(["keyChanged"])}))):function(){var t=n.navigator;return t&&t.serviceWorker?St().then((function(){return t.serviceWorker.ready})).then((function(t){return t.active||null})).s((function(){return null})):St(null)}().then((function(e){(t.h=e)&&(t.g=new _s(new ws(e)),Ss(t.g,"ping",null,!0).then((function(e){e[0].fulfilled&&M(e[0].value,"keyChanged")&&(t.u=!0)})).s((function(){})))}))}function Ts(t){return t.o||(t.o=function t(e){return new mt((function(n,r){var i=e.m.open("firebaseLocalStorageDb",1);i.onerror=function(t){try{t.preventDefault()}catch(e){}r(Error(t.target.error))},i.onupgradeneeded=function(t){t=t.target.result;try{t.createObjectStore("firebaseLocalStorage",{keyPath:"fbase_key"})}catch(e){r(e)}},i.onsuccess=function(i){(i=i.target.result).objectStoreNames.contains("firebaseLocalStorage")?n(i):function(t){return new mt((function(e,n){var r=t.m.deleteDatabase("firebaseLocalStorageDb");r.onsuccess=function(){e()},r.onerror=function(t){n(Error(t.target.error))}}))}(e).then((function(){return t(e)})).then((function(t){n(t)})).s((function(t){r(t)}))}}))}(t)),t.o}function ks(){try{return!!n.indexedDB}catch(Bt){return!1}}function Is(t){return t.objectStore("firebaseLocalStorage")}function Os(t,e){return t.transaction(["firebaseLocalStorage"],e?"readwrite":"readonly")}function xs(t){return new mt((function(e,n){t.onsuccess=function(t){t&&t.target?e(t.target.result):e()},t.onerror=function(t){n(t.target.error)}}))}function As(t,e){return t.g&&t.h&&function(){var t=n.navigator;return t&&t.serviceWorker&&t.serviceWorker.controller||null}()===t.h?Ss(t.g,"keyChanged",{key:e},t.u).then((function(){})).s((function(){})):St()}function Ps(t){return Ts(t).then((function(t){var e=Is(Os(t,!1));return e.getAll?xs(e.getAll()):new mt((function(t,n){var r=[],i=e.openCursor();i.onsuccess=function(e){(e=e.target.result)?(r.push(e.value),e.continue()):t(r)},i.onerror=function(t){n(t.target.error)}}))})).then((function(e){var n={},r=[];if(0==t.b){for(r=0;r<e.length;r++)n[e[r].fbase_key]=e[r].value;r=function t(e,n){var r,i=[];for(r in e)r in n?typeof e[r]!=typeof n[r]?i.push(r):"object"==typeof e[r]&&null!=e[r]&&null!=n[r]?0<t(e[r],n[r]).length&&i.push(r):e[r]!==n[r]&&i.push(r):i.push(r);for(r in n)r in e||i.push(r);return i}(t.c,n),t.c=n}return r}))}function Ds(t){t.i&&t.i.cancel("STOP_EVENT"),t.f&&(clearTimeout(t.f),t.f=null)}function Rs(t){var e=this,n=null;this.a=[],this.type="indexedDB",this.c=t,this.b=St().then((function(){if(ks()){var t=vr(),r="__sak"+t;return gs||(gs=new Es),(n=gs).set(r,t).then((function(){return n.get(r)})).then((function(e){if(e!==t)throw Error("indexedDB not supported!");return n.P(r)})).then((function(){return n})).s((function(){return e.c}))}return e.c})).then((function(t){return e.type=t.type,t.Y((function(t){R(e.a,(function(e){e(t)}))}
1)),t}))}function Ns(){this.a={},this.type="inMemory"}function js(){if(!function(){var t="Node"==er();if(!(t=Ms()||t&&i.a.INTERNAL.node&&i.a.INTERNAL.node.localStorage))return!1;try{return t.setItem("__sak","1"),t.removeItem("__sak"),!0}catch(e){return!1}}()){if("Node"==er())throw new qr("internal-error","The LocalStorage compatibility library was not found.");throw new qr("web-storage-unsupported")}this.a=Ms()||i.a.INTERNAL.node.localStorage,this.type="localStorage"}function Ms(){try{var t=n.localStorage,e=vr();return t&&(t.setItem(e,"1"),t.removeItem(e)),t}catch(r){return null}}function Ls(){this.type="nullStorage"}function Fs(){if(!function(){var t="Node"==er();if(!(t=Us()||t&&i.a.INTERNAL.node&&i.a.INTERNAL.node.sessionStorage))return!1;try{return t.setItem("__sak","1"),t.removeItem("__sak"),!0}catch(e){return!1}}()){if("Node"==er())throw new qr("internal-error","The SessionStorage compatibility library was not found.");throw new qr("web-storage-unsupported")}this.a=Us()||i.a.INTERNAL.node.sessionStorage,this.type="sessionStorage"}function Us(){try{var t=n.sessionStorage,e=vr();return t&&(t.setItem(e,"1"),t.removeItem(e)),t}catch(r){return null}}function Vs(){var t={};t.Browser=Ws,t.Node=zs,t.ReactNative=Hs,t.Worker=$s,this.a=t[er()]}vs.prototype.f=function(t){var e=t.data.eventType,n=t.data.eventId,r=this.a[e];if(r&&0<r.length){t.ports[0].postMessage({status:"ack",eventId:n,eventType:e,response:null});var i=[];R(r,(function(e){i.push(St().then((function(){return e(t.origin,t.data.data)})))})),Tt(i).then((function(r){var i=[];R(r,(function(t){i.push({fulfilled:t.Db,value:t.value,reason:t.reason?t.reason.message:void 0})})),R(i,(function(t){for(var e in t)void 0===t[e]&&delete t[e]})),t.ports[0].postMessage({status:"done",eventId:n,eventType:e,response:i})}))}},vs.prototype.subscribe=function(t,e){it(this.a)&&this.b.addEventListener("message",this.c),void 0===this.a[t]&&(this.a[t]=[]),this.a[t].push(e)},vs.prototype.unsubscribe=function(t,e){void 0!==this.a[t]&&e?(F(this.a[t],(function(t){return t==e})),0==this.a[t].length&&delete this.a[t]):e||delete this.a[t],it(this.a)&&this.b.removeEventListener("message",this.c)},ws.prototype.postMessage=function(t,e){this.a.postMessage(t,e)},_s.prototype.close=function(){for(;0<this.a.length;)Cs(this,this.a[0]);this.b=!0},(t=Es.prototype).set=function(t,e){var n,r=!1,i=this;return Ts(this).then((function(e){return xs((e=Is(Os(n=e,!0))).get(t))})).then((function(o){var a=Is(Os(n,!0));return o?(o.value=e,xs(a.put(o))):(i.b++,r=!0,(o={}).fbase_key=t,o.value=e,xs(a.add(o)))})).then((function(){return i.c[t]=e,As(i,t)})).ia((function(){r&&i.b--}))},t.get=function(t){return Ts(this).then((function(e){return xs(Is(Os(e,!1)).get(t))})).then((function(t){return t&&t.value}))},t.P=function(t){var e=!1,n=this;return Ts(this).then((function(r){return e=!0,n.b++,xs(Is(Os(r,!0)).delete(t))})).then((function(){return delete n.c[t],As(n,t)})).ia((function(){e&&n.b--}))},t.Y=function(t){0==this.a.length&&function(t){Ds(t),function e(){t.f=setTimeout((function(){t.i=Ps(t).then((function(e){0<e.length&&R(t.a,(function(t){t(e)}))})).then((function(){e()})).s((function(t){"STOP_EVENT"!=t.message&&e()}))}),800)}()}(this),this.a.push(t)},t.ca=function(t){F(this.a,(function(e){return e==t})),0==this.a.length&&Ds(this)},(t=Rs.prototype).get=function(t){return this.b.then((function(e){return e.get(t)}))},t.set=function(t,e){return this.b.then((function(n){return n.set(t,e)}))},t.P=function(t){return this.b.then((function(e){return e.P(t)}))},t.Y=function(t){this.a.push(t)},t.ca=function(t){F(this.a,(function(e){return e==t}))},(t=Ns.prototype).get=function(t){return St(this.a[t])},t.set=function(t,e){return this.a[t]=e,St()},t.P=function(t){return delete this.a[t],St()},t.Y=function(){},t.ca=function(){},(t=js.prototype).get=function(t){var e=this;return St().then((function(){return yr(e.a.getItem(t))}))},t.set=function(t,e){var n=this;return St().then((function(){var r=pr(e);null===r?n.P(t):n.a.setItem(t,r)}))},t.P=function(t){var e=this;return St().then((function(){e.a.removeItem(t)}))},t.Y=function(t){n.window&&be(n.window,"storage",t)},t.ca=function(t){n.window&&Se(n.window,"storage",t)},(t=Ls.prototype).get=function(){return St(null)},t.set=function(){return St()},t.P=function(){return St()},t.Y=function(){},t.ca=function(){},(t=Fs.prototype).get=function(t){var e=this;return St().then((function(){return yr(e.a.getItem(t))}))},t.set=function(t,e){var n=this;return St().then((function(){var r=pr(e);null===r?n.P(t):n.a.setItem(t,r)}))},t.P=function(t){var e=this;return St().then((function(){e.a.removeItem(t)}))},t.Y=function(){},t.ca=function(){};var qs,Bs,Ws={A:js,Ra:Fs},zs={A:js,Ra:Fs},Hs={A:ys,Ra:Ls},$s={A:js,Ra:Ls},Ks={Zc:"local",NONE:"none",ad:"session"};function Gs(){var t=!(gr(sr())||!Zn()),e=dr(),r=cr();this.o=t,this.h=e,this.l=r,this.a={},qs||(qs=new Vs),t=qs;try{this.g=!Wn()&&Cr()||!n.indexedDB?new t.a.A:new Rs(tr()?new Ns:new t.a.A)}catch(i){this.g=new Ns,this.h=!0}try{this.i=new t.a.Ra}catch(i){this.i=new Ns}this.m=new Ns,this.f=v(this.Pb,this),this.b={}}function Qs(){return Bs||(Bs=new Gs),Bs}function Ys(t,e){switch(e){case"session":return t.i;case"none":return t.m;default:return t.g}}function Xs(t,e){return"firebase:"+t.name+(e?":"+e:"")}function Js(t,e,n){return n=Xs(e,n),"local"==e.A&&(t.b[n]=null),Ys(t,e.A).P(n)}function Zs(t){t.c&&(clearInterval(t.c),t.c=null)}function tu(t){this.a=t,this.b=Qs()}(t=Gs.prototype).get=function(t,e){return Ys(this,t.A).get(Xs(t,e))},t.set=function(t,e,n){var r=Xs(t,n),i=this,o=Ys(this,t.A);return o.set(r,e).then((function(){return o.get(r)})).then((function(e){"local"==t.A&&(i.b[r]=e)}))},t.addListener=function(t,e,r){t=Xs(t,e),this.l&&(this.b[t]=n.localStorage.getItem(t)),it(this.a)&&(Ys(this,"local").Y(this.f),this.h||(Wn()||!Cr())&&n.indexedDB||!this.l||function(t){Zs(t),t.c=setInterval((function(){for(var e in t.a){var r=n.localStorage.getItem(e),i=t.b[e];r!=i&&(t.b[e]=r,r=new ue({type:"storage",key:e,target:window,oldValue:i,newValue:r,a:!0}),t.Pb(r))}}),1e3)}(this)),this.a[t]||(this.a[t]=[]),this.a[t].push(r)},t.removeListener=function(t,e,n){t=Xs(t,e),this.a[t]&&(F(this.a[t],(function(t){return t==n})),0==this.a[t].length&&delete this.a[t]),it(this.a)&&(Ys(this,"local").ca(this.f),Zs(this))},t.Pb=function(t){if(t&&t.f){var e=t.a.key;if(null==e)for(var r in this.a){var i=this.b[r];void 0===i&&(i=null);var o=n.localStorage.getItem(r);o!==i&&(this.b[r]=o,this.Xa(r))}else if(0==e.indexOf("firebase:")&&this.a[e]){if(void 0!==t.a.a?Ys(this,"local").ca(this.f):Zs(this),this.o)if(r=n.localStorage.getItem(e),(i=t.a.newValue)!==r)null!==i?n.localStorage.setItem(e,i):n.localStorage.removeItem(e);else if(this.b[e]===i&&void 0===t.a.a)return;var a=this;r=function(){void 0===t.a.a&&a.b[e]===n.localStorage.getItem(e)||(a.b[e]=n.localStorage.getItem(e),a.Xa(e))},zt&&Zt&&10==Zt&&n.localStorage.getItem(e)!==t.a.newValue&&t.a.newValue!==t.a.oldValue?setTimeout(r,10):r()}}else R(t,v(this.Xa,this))},t.Xa=function(t){this.a[t]&&R(this.a[t],(function(t){t()}))};var eu,nu={name:"authEvent",A:"local"};function ru(){this.a=Qs()}function iu(t,e){this.b=ou,this.f=n.Uint8Array?new Uint8Array(this.b):Array(this.b),this.g=this.c=0,this.a=[],this.i=t,this.h=e,this.l=n.Int32Array?new Int32Array(64):Array(64),void 0!==eu||(eu=n.Int32Array?new Int32Array(fu):fu),this.reset()}w(iu,(function(){this.b=-1}));for(var ou=64,au=ou-1,su=[],uu=0;uu<au;uu++)su[uu]=0;var cu=U(128,su);function lu(t){for(var e=t.f,n=t.l,r=0,i=0;i<e.length;)n[r++]=e[i]<<24|e[i+1]<<16|e[i+2]<<8|e[i+3],i=4*r;for(e=16;64>e;e++){var o=(0|n[e-16])+(((i=0|n[e-15])>>>7|i<<25)^(i>>>18|i<<14)^i>>>3)|0,a=(0|n[e-7])+(((r=0|n[e-2])>>>17|r<<15)^(r>>
1>19|r<<13)^r>>>10)|0;n[e]=o+a|0}r=0|t.a[0],i=0|t.a[1];var s=0|t.a[2],u=0|t.a[3],c=0|t.a[4],l=0|t.a[5],h=0|t.a[6];for(o=0|t.a[7],e=0;64>e;e++){var f=((r>>>2|r<<30)^(r>>>13|r<<19)^(r>>>22|r<<10))+(r&i^r&s^i&s)|0;a=(o=o+((c>>>6|c<<26)^(c>>>11|c<<21)^(c>>>25|c<<7))|0)+((a=(a=c&l^~c&h)+(0|eu[e])|0)+(0|n[e])|0)|0,o=h,h=l,l=c,c=u+a|0,u=s,s=i,i=r,r=a+f|0}t.a[0]=t.a[0]+r|0,t.a[1]=t.a[1]+i|0,t.a[2]=t.a[2]+s|0,t.a[3]=t.a[3]+u|0,t.a[4]=t.a[4]+c|0,t.a[5]=t.a[5]+l|0,t.a[6]=t.a[6]+h|0,t.a[7]=t.a[7]+o|0}function hu(t,e,n){void 0===n&&(n=e.length);var i=0,o=t.c;if(r(e))for(;i<n;)t.f[o++]=e.charCodeAt(i++),o==t.b&&(lu(t),o=0);else{if(!l(e))throw Error("message must be string or array");for(;i<n;){var a=e[i++];if(!("number"==typeof a&&0<=a&&255>=a&&a==(0|a)))throw Error("message must be a byte array");t.f[o++]=a,o==t.b&&(lu(t),o=0)}}t.c=o,t.g+=n}iu.prototype.reset=function(){this.g=this.c=0,this.a=n.Int32Array?new Int32Array(this.h):V(this.h)};var fu=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function du(){iu.call(this,8,pu)}w(du,iu);var pu=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225];function mu(t,e,n,r,i){this.m=t,this.i=e,this.l=n,this.o=r||null,this.u=i||null,this.h=e+":"+n,this.v=new ru,this.g=new tu(this.h),this.f=null,this.b=[],this.a=this.c=null}function yu(t){return new qr("invalid-cordova-configuration",t)}function vu(t,e){for(var n=0;n<t.b.length;n++)try{t.b[n](e)}catch(r){}}function gu(t){return t.f||(t.f=t.ga().then((function(){return new mt((function(e){t.wa((function n(r){return e(r),t.Ka(n),!1})),function(t){function e(e){i=!0,o&&o.cancel(),bu(t).then((function(n){var i=r;if(n&&e&&e.url){var o=null;-1!=(i=Ei(e.url)).indexOf("/__/auth/callback")&&(o=(o="object"==typeof(o=yr(Ge(o=Qe(i),"firebaseError")||null))?Br(o):null)?new Xi(n.b,n.c,null,null,o):new Xi(n.b,n.c,i,n.g)),i=o||r}vu(t,i)}))}var r=new Xi("unknown",null,null,null,new qr("no-auth-event")),i=!1,o=Me(500).then((function(){return bu(t).then((function(){i||vu(t,r)}))})),a=n.handleOpenURL;n.handleOpenURL=function(t){if(0==t.toLowerCase().indexOf(ur("BuildInfo.packageName",n).toLowerCase()+"://")&&e({url:t}),"function"==typeof a)try{a(t)}catch(r){console.error(r)}},eo||(eo=new Zi),eo.subscribe(e)}(t)}))}))),t.f}function bu(t){var e=null;return function(t){return t.b.get(nu,t.a).then((function(t){return Ji(t)}))}(t.g).then((function(n){return e=n,Js((n=t.g).b,nu,n.a)})).then((function(){return e}))}function wu(t){this.a=t,this.b=Qs()}(t=mu.prototype).ga=function(){return this.za?this.za:this.za=(Jn(void 0)?Xn().then((function(){return new mt((function(t,e){var r=n.document,i=setTimeout((function(){e(Error("Cordova framework is not ready."))}),1e3);r.addEventListener("deviceready",(function(){clearTimeout(i),t()}),!1)}))})):Ct(Error("Cordova must run in an Android or iOS file scheme."))).then((function(){if("function"!=typeof ur("universalLinks.subscribe",n))throw yu("cordova-universal-links-plugin-fix is not installed");if(void 0===ur("BuildInfo.packageName",n))throw yu("cordova-plugin-buildinfo is not installed");if("function"!=typeof ur("cordova.plugins.browsertab.openUrl",n))throw yu("cordova-plugin-browsertab is not installed");if("function"!=typeof ur("cordova.InAppBrowser.open",n))throw yu("cordova-plugin-inappbrowser is not installed")}),(function(){throw new qr("cordova-not-ready")}))},t.Ea=function(t,e){return e(new qr("operation-not-supported-in-this-environment")),St()},t.Cb=function(){return Ct(new qr("operation-not-supported-in-this-environment"))},t.Qb=function(){return!1},t.Mb=function(){return!0},t.Hb=function(){return!0},t.Ca=function(t,e,r){if(this.c)return Ct(new qr("redirect-operation-pending"));var i=this,o=n.document,a=null,s=null,u=null,c=null;return this.c=St().then((function(){return Yi(e),gu(i)})).then((function(){return function(t,e,r,i){var o=function(){for(var t=20,e=[];0<t;)e.push("1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".charAt(Math.floor(62*Math.random()))),t--;return e.join("")}(),a=new Xi(e,i,null,o,new qr("no-auth-event")),s=ur("BuildInfo.packageName",n);if("string"!=typeof s)throw new qr("invalid-cordova-configuration");var u=ur("BuildInfo.displayName",n),c={};if(sr().toLowerCase().match(/iphone|ipad|ipod/))c.ibi=s;else{if(!sr().toLowerCase().match(/android/))return Ct(new qr("operation-not-supported-in-this-environment"));c.apn=s}u&&(c.appDisplayName=u),o=function(t){var e=new du;hu(e,t),t=[];var n=8*e.g;hu(e,cu,56>e.c?56-e.c:e.b-(e.c-56));for(var r=63;56<=r;r--)e.f[r]=255&n,n/=256;for(lu(e),r=n=0;r<e.i;r++)for(var i=24;0<=i;i-=8)t[n++]=e.a[r]>>i&255;return function(t){return N(t,(function(t){return 1<(t=t.toString(16)).length?t:"0"+t})).join("")}(t)}(o),c.sessionId=o;var l=ms(t.m,t.i,t.l,e,r,null,i,t.o,c,t.u);return t.ga().then((function(){var e=t.h;return t.v.a.set(nu,a.C(),e)})).then((function(){var e=ur("cordova.plugins.browsertab.isAvailable",n);if("function"!=typeof e)throw new qr("invalid-cordova-configuration");var r=null;e((function(e){if(e){if("function"!=typeof(r=ur("cordova.plugins.browsertab.openUrl",n)))throw new qr("invalid-cordova-configuration");r(l)}else{if("function"!=typeof(r=ur("cordova.InAppBrowser.open",n)))throw new qr("invalid-cordova-configuration");e=!(!(e=sr()).match(/(iPad|iPhone|iPod).*OS 7_\d/i)&&!e.match(/(iPad|iPhone|iPod).*OS 8_\d/i)),t.a=r(l,e?"_blank":"_system","location=yes")}}))}))}(i,t,e,r)})).then((function(){return new mt((function(t,e){s=function(){var e=ur("cordova.plugins.browsertab.close",n);return t(),"function"==typeof e&&e(),i.a&&"function"==typeof i.a.close&&(i.a.close(),i.a=null),!1},i.wa(s),c=function(){_r()&&u()},o.addEventListener("resume",u=function(){a||(a=Me(2e3).then((function(){e(new qr("redirect-cancelled-by-user"))})))},!1),sr().toLowerCase().match(/android/)||o.addEventListener("visibilitychange",c,!1)})).s((function(t){return bu(i).then((function(){throw t}))}))})).ia((function(){u&&o.removeEventListener("resume",u,!1),c&&o.removeEventListener("visibilitychange",c,!1),a&&a.cancel(),s&&i.Ka(s),i.c=null}))},t.wa=function(t){this.b.push(t),gu(this).s((function(e){"auth/invalid-cordova-configuration"===e.code&&(e=new Xi("unknown",null,null,null,new qr("no-auth-event")),t(e))}))},t.Ka=function(t){F(this.b,(function(e){return e==t}))};var _u={name:"pendingRedirect",A:"session"};function Su(t){return Js(t.b,_u,t.a)}function Cu(t,e,n){this.u=t,this.l=e,this.m=n,this.h=[],this.f=!1,this.i=v(this.bb,this),this.b=new Ru,this.o=new Lu,this.g=new wu(this.l+":"+this.m),this.c={},this.c.unknown=this.b,this.c.signInViaRedirect=this.b,this.c.linkViaRedirect=this.b,this.c.reauthViaRedirect=this.b,this.c.signInViaPopup=this.o,this.c.linkViaPopup=this.o,this.c.reauthViaPopup=this.o,this.a=Eu(this.u,this.l,this.m,si)}function Eu(t,e,n,r){var o=i.a.SDK_VERSION||null;return Jn()?new mu(t,e,n,o,r):new hs(t,e,n,o,r)}
1function Tu(t){t.f||(t.f=!0,t.a.wa(t.i));var e=t.a;return t.a.ga().s((function(n){throw t.a==e&&t.reset(),n}))}function ku(t){t.a.Mb()&&Tu(t).s((function(e){var n=new Xi("unknown",null,null,null,new qr("operation-not-supported-in-this-environment"));Au(e)&&t.bb(n)})),t.a.Hb()||Nu(t.b)}(t=Cu.prototype).reset=function(){this.f=!1,this.a.Ka(this.i),this.a=Eu(this.u,this.l,this.m)},t.Ya=function(){this.b.Ya()},t.subscribe=function(t){if(M(this.h,t)||this.h.push(t),!this.f){var e=this;(function(t){return t.b.get(_u,t.a).then((function(t){return"pending"==t}))})(this.g).then((function(t){t?Su(e.g).then((function(){Tu(e).s((function(t){var n=new Xi("unknown",null,null,null,new qr("operation-not-supported-in-this-environment"));Au(t)&&e.bb(n)}))})):ku(e)})).s((function(){ku(e)}))}},t.unsubscribe=function(t){F(this.h,(function(e){return e==t}))},t.bb=function(t){if(!t)throw new qr("invalid-auth-event");for(var e=!1,n=0;n<this.h.length;n++){var r=this.h[n];if(r.vb(t.b,t.c)){(e=this.c[t.b])&&e.h(t,r),e=!0;break}}return Nu(this.b),e};var Iu=new wr(2e3,1e4),Ou=new wr(3e4,6e4);function xu(t,e,n,r,i,o){return t.a.Cb(e,n,r,(function(){t.f||(t.f=!0,t.a.wa(t.i))}),(function(){t.reset()}),i,o)}function Au(t){return!(!t||"auth/cordova-not-ready"!=t.code)}Cu.prototype.fa=function(){return this.b.fa()},Cu.prototype.Ca=function(t,e,n){var r,i=this;return function(t){return t.b.set(_u,"pending",t.a)}(this.g).then((function(){return i.a.Ca(t,e,n).s((function(t){if(Au(t))throw new qr("operation-not-supported-in-this-environment");return r=t,Su(i.g).then((function(){throw r}))})).then((function(){return i.a.Qb()?new mt((function(){})):Su(i.g).then((function(){return i.fa()})).then((function(){})).s((function(){}))}))}))},Cu.prototype.Ea=function(t,e,n,r){return this.a.Ea(n,(function(n){t.ha(e,null,n,r)}),Iu.get())};var Pu={};function Du(t,e,n){var r=e+":"+n;return Pu[r]||(Pu[r]=new Cu(t,e,n)),Pu[r]}function Ru(){this.b=null,this.f=[],this.c=[],this.a=null,this.i=this.g=!1}function Nu(t){t.g||(t.g=!0,Mu(t,!1,null,null))}function ju(t,e){if(t.b=function(){return St(e)},t.f.length)for(var n=0;n<t.f.length;n++)t.f[n](e)}function Mu(t,e,n,r){e?r?function(t,e){if(t.b=function(){return Ct(e)},t.c.length)for(var n=0;n<t.c.length;n++)t.c[n](e)}(t,r):ju(t,n):ju(t,{user:null}),t.f=[],t.c=[]}function Lu(){}function Fu(){this.sb=!1,Object.defineProperty(this,"appVerificationDisabled",{get:function(){return this.sb},set:function(t){this.sb=t},enumerable:!1})}function Uu(t,e){this.a=e,Or(this,"verificationId",t)}function Vu(t,e,n,r){return new Ki(t).Ua(e,n).then((function(t){return new Uu(t,r)}))}function qu(t){var e=ai(t);if(!(e&&e.exp&&e.auth_time&&e.iat))throw new qr("internal-error","An internal error occurred. The token obtained by Firebase appears to be malformed. Please retry the operation.");xr(this,{token:t,expirationTime:Sr(1e3*e.exp),authTime:Sr(1e3*e.auth_time),issuedAtTime:Sr(1e3*e.iat),signInProvider:e.firebase&&e.firebase.sign_in_provider?e.firebase.sign_in_provider:null,claims:e})}function Bu(t,e,n){if(this.h=t,this.i=e,this.g=n,this.c=3e4,this.f=96e4,this.b=null,this.a=this.c,this.f<this.c)throw Error("Proactive refresh lower bound greater than upper bound!")}function Wu(t){this.f=t,this.b=this.a=null,this.c=0}function zu(t,e){var n=e[oa],r=e.refreshToken;e=Hu(e.expiresIn),t.b=n,t.c=e,t.a=r}function Hu(t){return b()+1e3*parseInt(t,10)}function $u(t,e){this.a=t||null,this.b=e||null,xr(this,{lastSignInTime:Sr(e||null),creationTime:Sr(t||null)})}function Ku(t,e,n,r,i,o){xr(this,{uid:t,displayName:r||null,photoURL:i||null,email:n||null,phoneNumber:o||null,providerId:e})}function Gu(t,e){for(var n in se.call(this,t),e)this[n]=e[n]}function Qu(t,e,n){this.G=[],this.m=t.apiKey,this.o=t.appName,this.u=t.authDomain||null,t=i.a.SDK_VERSION?ar(i.a.SDK_VERSION):null,this.b=new ra(this.m,ci(si),t),this.h=new Wu(this.b),nc(this,e[oa]),zu(this.h,e),Or(this,"refreshToken",this.h.a),oc(this,n||{}),Pe.call(this),this.I=!1,this.u&&lr()&&(this.a=Du(this.u,this.m,this.o)),this.N=[],this.i=null,this.w=function(t){return new Bu((function(){return t.F(!0)}),(function(t){return!(!t||"auth/network-request-failed"!=t.code)}),(function(){var e=t.h.c-b()-3e5;return 0<e?e:0}))}(this),this.V=v(this.Ha,this);var r=this;this.ka=null,this.ta=function(t){r.pa(t.g)},this.X=null,this.O=[],this.sa=function(t){Xu(r,t.c)},this.W=null}function Yu(t,e){t.X&&Se(t.X,"languageCodeChanged",t.ta),(t.X=e)&&be(e,"languageCodeChanged",t.ta)}function Xu(t,e){t.O=e,ha(t.b,i.a.SDK_VERSION?ar(i.a.SDK_VERSION,t.O):null)}function Ju(t,e){t.W&&Se(t.W,"frameworkChanged",t.sa),(t.W=e)&&be(e,"frameworkChanged",t.sa)}function Zu(t){try{return i.a.app(t.o).auth()}catch(e){throw new qr("internal-error","No firebase.auth.Auth instance is available for the Firebase App '"+t.o+"'!")}}function tc(t){t.D||t.w.b||(t.w.start(),Se(t,"tokenChanged",t.V),be(t,"tokenChanged",t.V))}function ec(t){Se(t,"tokenChanged",t.V),t.w.stop()}function nc(t,e){t.ra=e,Or(t,"_lat",e)}function rc(t){for(var e=[],n=0;n<t.N.length;n++)e.push(t.N[n](t));return Tt(e).then((function(){return t}))}function ic(t){t.a&&!t.I&&(t.I=!0,t.a.subscribe(t))}function oc(t,e){xr(t,{uid:e.uid,displayName:e.displayName||null,photoURL:e.ph
1otoURL||null,email:e.email||null,emailVerified:e.emailVerified||!1,phoneNumber:e.phoneNumber||null,isAnonymous:e.isAnonymous||!1,metadata:new $u(e.createdAt,e.lastLoginAt),providerData:[]})}function ac(){}function sc(t){return St().then((function(){if(t.D)throw new qr("app-deleted")}))}function uc(t){return N(t.providerData,(function(t){return t.providerId}))}function cc(t,e){e&&(lc(t,e.providerId),t.providerData.push(e))}function lc(t,e){F(t.providerData,(function(t){return t.providerId==e}))}function hc(t,e,n){("uid"!=e||n)&&t.hasOwnProperty(e)&&Or(t,e,n)}function fc(t,e){t!=e&&(xr(t,{uid:e.uid,displayName:e.displayName,photoURL:e.photoURL,email:e.email,emailVerified:e.emailVerified,phoneNumber:e.phoneNumber,isAnonymous:e.isAnonymous,providerData:[]}),Or(t,"metadata",e.metadata?function(t){return new $u(t.a,t.b)}(e.metadata):new $u),R(e.providerData,(function(e){cc(t,e)})),function(t,e){t.b=e.b,t.a=e.a,t.c=e.c}(t.h,e.h),Or(t,"refreshToken",t.h.a))}function dc(t){return t.F().then((function(e){var n=t.isAnonymous;return function(t,e){return ts(t.b,ja,{idToken:e}).then(v(t.xc,t))}(t,e).then((function(){return n||hc(t,"isAnonymous",!1),e}))}))}function pc(t,e){e[oa]&&t.ra!=e[oa]&&(zu(t.h,e),t.dispatchEvent(new Gu("tokenChanged")),nc(t,e[oa]),hc(t,"refreshToken",t.h.a))}function mc(t,e){return dc(t).then((function(){if(M(uc(t),e))return rc(t).then((function(){throw new qr("provider-already-linked")}))}))}function yc(t,e,n){return Ar({user:t,credential:Qi(e),additionalUserInfo:e=pi(e),operationType:n})}function vc(t,e){return pc(t,e),t.reload().then((function(){return t}))}function gc(t,e,n,r,o){if(!lr())return Ct(new qr("operation-not-supported-in-this-environment"));if(t.i&&!o)return Ct(t.i);var a=di(n.providerId),s=vr(t.uid+":::"),u=null;(!dr()||Zn())&&t.u&&n.isOAuthProvider&&(u=ms(t.u,t.m,t.o,e,n,null,s,i.a.SDK_VERSION||null));var c=Gn(u,a&&a.Ba,a&&a.Aa);return r=r().then((function(){if(wc(t),!o)return t.F().then((function(){}))})).then((function(){return xu(t.a,c,e,n,s,!!u)})).then((function(){return new mt((function(n,r){t.ha(e,null,new qr("cancelled-popup-request"),t.g||null),t.f=n,t.v=r,t.g=s,t.c=t.a.Ea(t,e,c,s)}))})).then((function(t){return c&&Kn(c),t?Ar(t):null})).s((function(t){throw c&&Kn(c),t})),_c(t,r,o)}function bc(t,e,n,r,i){if(!lr())return Ct(new qr("operation-not-supported-in-this-environment"));if(t.i&&!i)return Ct(t.i);var o=null,a=vr(t.uid+":::");return r=r().then((function(){if(wc(t),!i)return t.F().then((function(){}))})).then((function(){return t.aa=a,rc(t)})).then((function(e){return t.ba&&(e=(e=t.ba).b.set(Ec,t.C(),e.a)),e})).then((function(){return t.a.Ca(e,n,a)})).s((function(e){if(o=e,t.ba)return Tc(t.ba);throw o})).then((function(){if(o)throw o})),_c(t,r,i)}function wc(t){if(!t.a||!t.I){if(t.a&&!t.I)throw new qr("internal-error");throw new qr("auth-domain-config-required")}}function _c(t,e,n){var r=function(t,e,n){return t.i&&!n?(e.cancel(),Ct(t.i)):e.s((function(e){throw!e||"auth/user-disabled"!=e.code&&"auth/user-token-expired"!=e.code||(t.i||t.dispatchEvent(new Gu("userInvalidated")),t.i=e),e}))}(t,e,n);return t.G.push(r),r.ia((function(){L(t.G,r)})),r}function Sc(t){if(!t.apiKey)return null;var e={apiKey:t.apiKey,authDomain:t.authDomain,appName:t.appName},n={};if(!(t.stsTokenManager&&t.stsTokenManager.accessToken&&t.stsTokenManager.expirationTime))return null;n[oa]=t.stsTokenManager.accessToken,n.refreshToken=t.stsTokenManager.refreshToken||null,n.expiresIn=(t.stsTokenManager.expirationTime-b())/1e3;var r=new Qu(e,n,t);return t.providerData&&R(t.providerData,(function(t){t&&cc(r,Ar(t))})),t.redirectEventId&&(r.aa=t.redirectEventId),r}function Cc(t){this.a=t,this.b=Qs()}Ru.prototype.reset=function(){this.b=null,this.a&&(this.a.cancel(),this.a=null)},Ru.prototype.h=function(t,e){if(t){this.reset(),this.g=!0;var n=t.b,r=t.c,i=t.a&&"auth/web-storage-unsupported"==t.a.code,o=t.a&&"auth/operation-not-supported-in-this-environment"==t.a.code;this.i=!(!i&&!o),"unknown"!=n||i||o?t.a?(Mu(this,!0,null,t.a),St()):e.xa(n,r)?function(t,e,n){n=n.xa(e.b,e.c);var r=e.f,i=e.g,o=e.h,a=!!e.b.match(/Redirect$/);n(r,i,o).then((function(e){Mu(t,a,e,null)})).s((function(e){Mu(t,a,null,e)}))}(this,t,e):Ct(new qr("invalid-auth-event")):(Mu(this,!1,null,null),St
1())}else Ct(new qr("invalid-auth-event"))},Ru.prototype.Ya=function(){this.g&&!this.i&&Mu(this,!1,null,null)},Ru.prototype.fa=function(){var t=this;return new mt((function(e,n){t.b?t.b().then(e,n):(t.f.push(e),t.c.push(n),function(t){var e=new qr("timeout");t.a&&t.a.cancel(),t.a=Me(Ou.get()).then((function(){t.b||(t.g=!0,Mu(t,!0,null,e))}))}(t))}))},Lu.prototype.h=function(t,e){if(t){var n=t.b,r=t.c;t.a?(e.ha(t.b,null,t.a,t.c),St()):e.xa(n,r)?function(t,e){var n=t.c,r=t.b;e.xa(r,n)(t.f,t.g,t.h).then((function(t){e.ha(r,t,null,n)})).s((function(t){e.ha(r,null,t,n)}))}(t,e):Ct(new qr("invalid-auth-event"))}else Ct(new qr("invalid-auth-event"))},Uu.prototype.confirm=function(t){return t=Gi(this.verificationId,t),this.a(t)},Bu.prototype.start=function(){this.a=this.c,function t(e,r){e.stop(),e.b=Me(function(t,e){return e?(t.a=t.c,t.g()):(e=t.a,t.a*=2,t.a>t.f&&(t.a=t.f),e)}(e,r)).then((function(){return function(){var t=n.document,e=null;return _r()||!t?St():new mt((function(n){e=function(){_r()&&(t.removeEventListener("visibilitychange",e,!1),n())},t.addEventListener("visibilitychange",e,!1)})).s((function(n){throw t.removeEventListener("visibilitychange",e,!1),n}))}()})).then((function(){return e.h()})).then((function(){t(e,!0)})).s((function(n){e.i(n)&&t(e,!1)}))}(this,!0)},Bu.prototype.stop=function(){this.b&&(this.b.cancel(),this.b=null)},Wu.prototype.C=function(){return{apiKey:this.f.b,refreshToken:this.a,accessToken:this.b,expirationTime:this.c}},Wu.prototype.getToken=function(t){return t=!!t,this.b&&!this.a?Ct(new qr("user-token-expired")):t||!this.b||b()>this.c-3e4?this.a?function(t,e){return function(t,e){return new mt((function(n,r){"refresh_token"==e.grant_type&&e.refresh_token||"authorization_code"==e.grant_type&&e.code?fa(t,t.i+"?key="+encodeURIComponent(t.b),(function(t){t?t.error?r(ns(t)):t.access_token&&t.refresh_token?n(t):r(new qr("internal-error")):r(new qr("network-request-failed"))}),"POST",un(e).toString(),t.f,t.l.get()):r(new qr("internal-error"))}))}(t.f,e).then((function(e){return t.b=e.access_token,t.c=Hu(e.expires_in),t.a=e.refresh_token,{accessToken:t.b,expirationTime:t.c,refreshToken:t.a}})).s((function(e){throw"auth/user-token-expired"==e.code&&(t.a=null),e}))}(this,{grant_type:"refresh_token",refresh_token:this.a}):St(null):St({accessToken:this.b,expirationTime:this.c,refreshToken:this.a})},$u.prototype.C=function(){return{lastLoginAt:this.b,createdAt:this.a}},w(Gu,se),w(Qu,Pe),Qu.prototype.pa=function(t){this.ka=t,la(this.b,t)},Qu.prototype.ea=function(){return this.ka},Qu.prototype.ya=function(){return V(this.O)},Qu.prototype.Ha=function(){this.w.b&&(this.w.stop(),this.w.start())},Or(Qu.prototype,"providerId","firebase"),(t=Qu.prototype).reload=function(){var t=this;return _c(this,sc(this).then((function(){return dc(t).then((function(){return rc(t)})).then(ac)})))},t.dc=function(t){return this.F(t).then((function(t){return new qu(t)}))},t.F=function(t){var e=this;return _c(this,sc(this).then((function(){return e.h.getToken(t)})).then((function(t){if(!t)throw new qr("internal-error");return t.accessToken!=e.ra&&(nc(e,t.accessToken),e.dispatchEvent(new Gu("tokenChanged"))),hc(e,"refreshToken",t.refreshToken),t.accessToken})))},t.xc=function(t){if(!(t=t.users)||!t.length)throw new qr("internal-error");oc(this,{uid:(t=t[0]).localId,displayName:t.displayName,photoURL:t.photoUrl,email:t.email,emailVerified:!!t.emailVerified,phoneNumber:t.phoneNumber,lastLoginAt:t.lastLoginAt,createdAt:t.createdAt});for(var e=function(t){return(t=t.providerUserInfo)&&t.length?N(t,(function(t){return new Ku(t.rawId,t.providerId,t.email,t.displayName,t.photoUrl,t.phoneNumber)})):[]}(t),n=0;n<e.length;n++)cc(this,e[n]);hc(this,"isAnonymous",!(this.email&&t.passwordHash||this.providerData&&this.providerData.length))},t.gb=function(t){var e=this,n=null;return _c(this,t.f(this.b,this.uid).then((function(t){return pc(e,t),n=yc(e,t,"reauthenticate"),e.i=null,e.reload()})).then((function(){return n})),!0)},t.yc=function(t){return kr("firebase.User.prototype.reauthenticateWithCredential is deprecated. Please use firebase.User.prototype.reauthenticateAndRetrieveDataWithCredential instead."),this.gb(t).then((function(){}))},t.eb=function(t){var e=this,n=null;return _c(this,mc(this,t.providerId).then((function(){return e.F()})).then((function(n){return t.b(e.b,n)})).then((function(t){return n=yc(e,t,"link"),vc(e,t)})).then((function(){return n})))},t.pc=function(t){return kr("firebase.User.prototype.linkWithCredential is deprecated. Please use firebase.User.prototype.linkAndRetrieveDataWithCredential instead."),this.eb(t).then((function(t){return t.user}))},t.qc=function(t,e){var n=this;return _c(this,mc(this,"phone").then((function(){return Vu(Zu(n),t,e,v(n.eb,n))})))},t.zc=function(t,e){var n=this;return _c(this,St().then((function(){return Vu(Zu(n),t,e,v(n.gb,n))})),!0)},t.pb=function(t){var e=this;return _c(this,this.F().then((function(n){return e.b.pb(n,t)})).then((function(t){return pc(e,t),e.reload()})))},t.Rc=function(t){var e=this;return _c(this,this.F().then((function(n){return t.b(e.b,n)})).then((function(t){return pc(e,t),e.reload()})))},t.qb=function(t){var e=this;return _c(this,this.F().then((function(n){return e.b.qb(n,t)})).then((function(t){return pc(e,t),e.reload()})))},t.rb=function(t){if(void 0===t.displayName&&void 0===t.photoURL)return sc(this);var e=this;return _c(this,this.F().then((function(n){return e.b.rb(n,{displayName:t.displayName,photoUrl:t.photoURL})}
1)).then((function(t){return pc(e,t),hc(e,"displayName",t.displayName||null),hc(e,"photoURL",t.photoUrl||null),R(e.providerData,(function(t){"password"===t.providerId&&(Or(t,"displayName",e.displayName),Or(t,"photoURL",e.photoURL))})),rc(e)})).then(ac))},t.Pc=function(t){var e=this;return _c(this,dc(this).then((function(n){return M(uc(e),t)?function(t,e,n){return ts(t,Da,{idToken:e,deleteProvider:n})}(e.b,n,[t]).then((function(t){var n={};return R(t.providerUserInfo||[],(function(t){n[t.providerId]=!0})),R(uc(e),(function(t){n[t]||lc(e,t)})),n[Ki.PROVIDER_ID]||Or(e,"phoneNumber",null),rc(e)})):rc(e).then((function(){throw new qr("no-such-provider")}))})))},t.delete=function(){var t=this;return _c(this,this.F().then((function(e){return ts(t.b,Pa,{idToken:e})})).then((function(){t.dispatchEvent(new Gu("userDeleted"))}))).then((function(){for(var e=0;e<t.G.length;e++)t.G[e].cancel("app-deleted");Yu(t,null),Ju(t,null),t.G=[],t.D=!0,ec(t),Or(t,"refreshToken",null),t.a&&t.a.unsubscribe(t)}))},t.vb=function(t,e){return!!("linkViaPopup"==t&&(this.g||null)==e&&this.f||"reauthViaPopup"==t&&(this.g||null)==e&&this.f||"linkViaRedirect"==t&&(this.aa||null)==e||"reauthViaRedirect"==t&&(this.aa||null)==e)},t.ha=function(t,e,n,r){"linkViaPopup"!=t&&"reauthViaPopup"!=t||r!=(this.g||null)||(n&&this.v?this.v(n):e&&!n&&this.f&&this.f(e),this.c&&(this.c.cancel(),this.c=null),delete this.f,delete this.v)},t.xa=function(t,e){return"linkViaPopup"==t&&e==(this.g||null)?v(this.Ab,this):"reauthViaPopup"==t&&e==(this.g||null)?v(this.Bb,this):"linkViaRedirect"==t&&(this.aa||null)==e?v(this.Ab,this):"reauthViaRedirect"==t&&(this.aa||null)==e?v(this.Bb,this):null},t.rc=function(t){var e=this;return gc(this,"linkViaPopup",t,(function(){return mc(e,t.providerId).then((function(){return rc(e)}))}),!1)},t.Ac=function(t){return gc(this,"reauthViaPopup",t,(function(){return St()}),!0)},t.sc=function(t){var e=this;return bc(this,"linkViaRedirect",t,(function(){return mc(e,t.providerId)}),!1)},t.Bc=function(t){return bc(this,"reauthViaRedirect",t,(function(){return St()}),!0)},t.Ab=function(t,e,n){var r=this;this.c&&(this.c.cancel(),this.c=null);var i=null;return _c(this,this.F().then((function(i){return Ea(r.b,{requestUri:t,postBody:n,sessionId:e,idToken:i})})).then((function(t){return i=yc(r,t,"link"),vc(r,t)})).then((function(){return i})))},t.Bb=function(t,e,n){var r=this;this.c&&(this.c.cancel(),this.c=null);var i=null;return _c(this,St().then((function(){return Ti(Ta(r.b,{requestUri:t,sessionId:e,postBody:n}),r.uid)})).then((function(t){return i=yc(r,t,"reauthenticate"),pc(r,t),r.i=null,r.reload()})).then((function(){return i})),!0)},t.jb=function(t){var e=this,n=null;return _c(this,this.F().then((function(e){return n=e,void 0===t||it(t)?{}:ei(new Hr(t))})).then((function(t){return e.b.jb(n,t)})).then((function(t){if(e.email!=t)return e.reload()})).then((function(){})))},t.toJSON=function(){return this.C()},t.C=function(){var t={uid:this.uid,displayName:this.displayName,photoURL:this.photoURL,email:this.email,emailVerified:this.emailVerified,phoneNumber:this.phoneNumber,isAnonymous:this.isAnonymous,providerData:[],apiKey:this.m,appName:this.o,authDomain:this.u,stsTokenManager:this.h.C(),redirectEventId:this.aa||null};return this.metadata&&ct(t,this.metadata.C()),R(this.providerData,(function(e){t.providerData.push(function(t){var e,n={};for(e in t)t.hasOwnProperty(e)&&(n[e]=t[e]);return n}(e))})),t};var Ec={name:"redirectUser",A:"session"};function Tc(t){return Js(t.b,Ec,t.a)}function kc(t){this.a=t,this.b=Qs(),this.c=null,this.f=function(t){var e=xc("local"),r=xc("session"),i=xc("none");return function(t,e,r){var i=Xs(e,r),o=Ys(t,e.A);return t.get(e,r).then((function(a){var s=null;try{s=yr(n.localStorage.getItem(i))}catch(u){}if(s&&!a)return n.localStorage.removeItem(i),t.set(e,s,r);s&&a&&"localStorage"!=o.type&&n.localStorage.removeItem(i)}))}(t.b,e,t.a).then((function(){return t.b.get(r,t.a)})).then((function(n){return n?r:t.b.get(i,t.a).then((function(n){return n?i:t.b.get(e,t.a).then((function(n){return n?e:t.b.get(Oc,t.a).then((function(t){return t?xc(t):e}))}))}))})).then((function(e){return t.c=e,Ic(t,e.A)})).s((function(){t.c||(t.c=e)}))}(this),this.b.addListener(xc("local"),this.a,v(this.g,this))}function Ic(t,e){var n,r=[];for(n in Ks)Ks[n]!==e&&r.push(Js(t.b,xc(Ks[n]),t.a));return r.push(Js(t.b,Oc,t.a)),function(t){return new mt((function(e,n){var r=t.length,i=[];if(r)for(var o=function(t,n){r--,i[t]=n,0==r&&e(i)},a=function(t){n(t)},s=0;s<t.length;s++)Et(t[s],g(o,s),a);else e(i)}))}(r)}kc.prototype.g=function(){var t=this,e=xc("local");Rc(this,(function(){return St().then((function(){return t.c&&"local"!=t.c.A?t.b.get(e,t.a):null})).then((function(n){if(n)return Ic(t,"local").then((function(){t.c=e}))}))}))};var Oc={name:"persistence",A:"session"};function xc(t){return{name:"authUser",A:t}}function Ac(t,e){return Rc(t,(function(){return t.b.set(t.c,e.C(),t.a)}))}function Pc(t){return Rc(t,(function(){return Js(t.b,t.c,t.a)}))}function Dc(t,e){return Rc(t,(function(){return t.b.get(t.c,t.a).then((function(t){return t&&e&&(t.authDomain=e),Sc(t||{})}))}))}function Rc(t,e){return t.f=t.f.then(e,e),t.f}function Nc(t){if(this.m=!1,Or(this,"settings",new Fu),Or(this,"app",t),!qc(this).options||!qc(this).options.apiKey)throw new qr("invalid-api-key");t=i.a.SDK_VERSION?ar(i.a.SDK_VERSION):null,this.b=new ra(qc(this).options&&qc(this).options.apiKey,ci(si),t),this.N=[],this.o=[],this.I=[],this.Tb=i.a.INT
1ERNAL.createSubscribe(v(this.mc,this)),this.O=void 0,this.Ub=i.a.INTERNAL.createSubscribe(v(this.nc,this)),Uc(this,null),this.h=new kc(qc(this).options.apiKey+":"+qc(this).name),this.w=new Cc(qc(this).options.apiKey+":"+qc(this).name),this.V=Hc(this,function(t){var e=qc(t).options.authDomain,n=function(t){var e=function(t,e){return t.b.get(Ec,t.a).then((function(t){return t&&e&&(t.authDomain=e),Sc(t||{})}))}(t.w,qc(t).options.authDomain).then((function(e){return(t.D=e)&&(e.ba=t.w),Tc(t.w)}));return Hc(t,e)}(t).then((function(){return Dc(t.h,e)})).then((function(e){return e?(e.ba=t.w,t.D&&(t.D.aa||null)==(e.aa||null)?e:e.reload().then((function(){return Ac(t.h,e).then((function(){return e}))})).s((function(n){return"auth/network-request-failed"==n.code?e:Pc(t.h)}))):null})).then((function(e){Uc(t,e||null)}));return Hc(t,n)}(this)),this.i=Hc(this,function(t){return t.V.then((function(){return t.fa()})).s((function(){})).then((function(){if(!t.m)return t.ka()})).s((function(){})).then((function(){if(!t.m){t.X=!0;var e=t.h;e.b.addListener(xc("local"),e.a,t.ka)}}))}(this)),this.X=!1,this.ka=v(this.Mc,this),this.Ha=v(this.Z,this),this.ra=v(this.bc,this),this.sa=v(this.jc,this),this.ta=v(this.kc,this),function(t){var e=qc(t).options.authDomain,n=qc(t).options.apiKey;e&&lr()&&(t.Sb=t.V.then((function(){if(!t.m){if(t.a=Du(e,n,qc(t).name),t.a.subscribe(t),Bc(t)&&ic(Bc(t)),t.D){ic(t.D);var r=t.D;r.pa(t.ea()),Yu(r,t),Xu(r=t.D,t.G),Ju(r,t),t.D=null}return t.a}})))}(this),this.INTERNAL={},this.INTERNAL.delete=v(this.delete,this),this.INTERNAL.logFramework=v(this.tc,this),this.u=0,Pe.call(this),function(t){Object.defineProperty(t,"lc",{get:function(){return this.ea()},set:function(t){this.pa(t)},enumerable:!1}),t.W=null}(this),this.G=[]}function jc(t){se.call(this,"languageCodeChanged"),this.g=t}function Mc(t){se.call(this,"frameworkChanged"),this.c=t}function Lc(t){return t.Sb||Ct(new qr("auth-domain-config-required"))}function Fc(t,e){var n={};return n.apiKey=qc(t).options.apiKey,n.authDomain=qc(t).options.authDomain,n.appName=qc(t).name,t.V.then((function(){return function(t,e,n,r){var i=new Qu(t,e);return n&&(i.ba=n),r&&Xu(i,r),i.reload().then((function(){return i}))}(n,e,t.w,t.ya())})).then((function(e){return Bc(t)&&e.uid==Bc(t).uid?(fc(Bc(t),e),t.Z(e)):(Uc(t,e),ic(e),t.Z(e))})).then((function(){zc(t)}))}function Uc(t,e){Bc(t)&&(function(t,e){F(t.N,(function(t){return t==e}))}(Bc(t),t.Ha),Se(Bc(t),"tokenChanged",t.ra),Se(Bc(t),"userDeleted",t.sa),Se(Bc(t),"userInvalidated",t.ta),ec(Bc(t))),e&&(e.N.push(t.Ha),be(e,"tokenChanged",t.ra),be(e,"userDeleted",t.sa),be(e,"userInvalidated",t.ta),0<t.u&&tc(e)),Or(t,"currentUser",e),e&&(e.pa(t.ea()),Yu(e,t),Xu(e,t.G),Ju(e,t))}function Vc(t,e){var n=null,r=null;return Hc(t,e.then((function(e){return n=Qi(e),r=pi(e),Fc(t,e)})).then((function(){return Ar({user:Bc(t),credential:n,additionalUserInfo:r,operationType:"signIn"})})))}function qc(t){return t.app}function Bc(t){return t.currentUser}function Wc(t){return Bc(t)&&Bc(t)._lat||null}function zc(t){if(t.X){for(var e=0;e<t.o.length;e++)t.o[e]&&t.o[e](Wc(t));if(t.O!==t.getUid()&&t.I.length)for(t.O=t.getUid(),e=0;e<t.I.length;e++)t.I[e]&&t.I[e](Wc(t))}}function Hc(t,e){return t.N.push(e),e.ia((function(){L(t.N,e)})),e}function $c(){}function Kc(){this.a={},this.b=1e12}kc.prototype.mb=function(t){var e=null,n=this;return function(t){var e=new qr("invalid-persistence-type"),n=new qr("unsupported-persistence-type");t:{for(r in Ks)if(Ks[r]==t){var r=!0;break t}r=!1}if(!r||"string"!=typeof t)throw e;switch(er()){case"ReactNative":if("session"===t)throw n;break;case"Node":if("none"!==t)throw n;break;default:if(!cr()&&"none"!==t)throw n}}(t),Rc(this,(function(){return t!=n.c.A?n.b.get(n.c,n.a).then((function(r){return e=r,Ic(n,t)})).then((function(){if(n.c=xc(t),e)return n.b.set(n.c,e,n.a)})):St()}))},w(Nc,Pe),w(jc,se),w(Mc,se),(t=Nc.prototype).mb=function(t){return Hc(this,t=this.h.mb(t))},t.pa=function(t){this.W===t||this.m||(this.W=t,la(this.b,this.W),this.dispatchEvent(new jc(this.ea())))},t.ea=function(){return this.W},t.Sc=function(){var t=n.navigator;this.pa(t&&(t.languages&&t.languages[0]||t.language||t.userLanguage)||null)},t.tc=function(t){this.G.push(t),ha(this.b,i.a.SDK_VERSION?ar(i.a.SDK_VERSION,this.G):null),this.dispatchEvent(new Mc(this.G))},t.ya=function(){return V(this.G)},t.toJSON=function(){return{apiKey:qc(this).options.apiKey,authDomain:qc(this).options.authDomain,appName:qc(this).name,currentUser:Bc(this)&&Bc(this).C()}},t.vb=function(t,e){switch(t){case"unknown":case"signInViaRedirect":return!0;case"signInViaPopup":return this.g==e&&!!this.f;default:return!1}},t.ha=function(t,e,n,r){"signInViaPopup"==t&&this.g==r&&(n&&this.v?this.v(n):e&&!n&&this.f&&this.f(e),this.c&&(this.c.cancel(),this.c=null),delete this.f,delete this.v)},t.xa=function(t,e){return"signInViaRedirect"==t||"signInViaPopup"==t&&this.g==e&&this.f?v(this.ac,this):null},t.ac=function(t,e,n){var r=this;t={requestUri:t,postBody:n,sessionId:e},this.c&&(this.c.cancel(),this.c=null);var i=null,o=null,a=Ca(r.b,t).then((function(t){return i=Qi(t),o=pi(t),t}));return Hc(this,t=r.V.then((function(){return a})).then((function(t){return Fc(r,t)})).then((function(){return Ar({user:Bc(r),credential:i,additionalUserInfo:o,operationType:"signIn"})})))},t.Kc=function(t){if(!lr())return Ct(new qr("operation-not-supported-in-this-environment"));var e=this,n=di(t.providerId),r=vr(),o=null;(!dr()||Zn())&&qc(this).options.authDomain&&t.isOAuthProvider&&(o=ms(qc(this).options.authDomain,qc(this).options.apiKey,qc(this).name,"signInViaPopup",t,null,r,i.a.SDK_VERSION||null));var a=Gn(o,n&&n.Ba,n&&n.Aa);return Hc(this,n=Lc(this).then((function(e){return xu(e,a,"signInViaPopup",t,r,!!o)}
1)).then((function(){return new mt((function(t,n){e.ha("signInViaPopup",null,new qr("cancelled-popup-request"),e.g),e.f=t,e.v=n,e.g=r,e.c=e.a.Ea(e,"signInViaPopup",a,r)}))})).then((function(t){return a&&Kn(a),t?Ar(t):null})).s((function(t){throw a&&Kn(a),t})))},t.Lc=function(t){if(!lr())return Ct(new qr("operation-not-supported-in-this-environment"));var e=this;return Hc(this,Lc(this).then((function(){return function(t){return Rc(t,(function(){return t.b.set(Oc,t.c.A,t.a)}))}(e.h)})).then((function(){return e.a.Ca("signInViaRedirect",t)})))},t.fa=function(){if(!lr())return Ct(new qr("operation-not-supported-in-this-environment"));var t=this;return Hc(this,Lc(this).then((function(){return t.a.fa()})).then((function(t){return t?Ar(t):null})))},t.Qc=function(t){if(!t)return Ct(new qr("null-user"));var e=this,n={};n.apiKey=qc(this).options.apiKey,n.authDomain=qc(this).options.authDomain,n.appName=qc(this).name;var r=function(t,e,n,r){e=e||{apiKey:t.m,authDomain:t.u,appName:t.o};var i=t.h,o={};return o[oa]=i.b,o.refreshToken=i.a,o.expiresIn=(i.c-b())/1e3,e=new Qu(e,o),n&&(e.ba=n),r&&Xu(e,r),fc(e,t),e}(t,n,e.w,e.ya());return Hc(this,this.i.then((function(){if(qc(e).options.apiKey!=t.m)return r.reload()})).then((function(){return Bc(e)&&t.uid==Bc(e).uid?(fc(Bc(e),t),e.Z(t)):(Uc(e,r),ic(r),e.Z(r))})).then((function(){zc(e)})))},t.nb=function(){var t=this;return Hc(this,this.i.then((function(){return Bc(t)?(Uc(t,null),Pc(t.h).then((function(){zc(t)}))):St()})))},t.Mc=function(){var t=this;return Dc(this.h,qc(this).options.authDomain).then((function(e){if(!t.m){var n;if(n=Bc(t)&&e){n=Bc(t).uid;var r=e.uid;n=null!=n&&""!==n&&null!=r&&""!==r&&n==r}if(n)return fc(Bc(t),e),Bc(t).F();(Bc(t)||e)&&(Uc(t,e),e&&(ic(e),e.ba=t.w),t.a&&t.a.subscribe(t),zc(t))}}))},t.Z=function(t){return Ac(this.h,t)},t.bc=function(){zc(this),this.Z(Bc(this))},t.jc=function(){this.nb()},t.kc=function(){this.nb()},t.mc=function(t){var e=this;this.addAuthTokenListener((function(){t.next(Bc(e))}))},t.nc=function(t){var e=this;!function(t,e){t.I.push(e),Hc(t,t.i.then((function(){!t.m&&M(t.I,e)&&t.O!==t.getUid()&&(t.O=t.getUid(),e(Wc(t)))})))}(this,(function(){t.next(Bc(e))}))},t.vc=function(t,e,n){var r=this;return this.X&&i.a.Promise.resolve().then((function(){h(t)?t(Bc(r)):h(t.next)&&t.next(Bc(r))})),this.Tb(t,e,n)},t.uc=function(t,e,n){var r=this;return this.X&&i.a.Promise.resolve().then((function(){r.O=r.getUid(),h(t)?t(Bc(r)):h(t.next)&&t.next(Bc(r))})),this.Ub(t,e,n)},t.cc=function(t){var e=this;return Hc(this,this.i.then((function(){return Bc(e)?Bc(e).F(t).then((function(t){return{accessToken:t}})):null})))},t.Nb=function(t){var e=this;return this.i.then((function(){return Vc(e,ts(e.b,Qa,{token:t}))})).then((function(t){var n=t.user;return hc(n,"isAnonymous",!1),e.Z(n),t}))},t.Ec=function(t){return kr("firebase.auth.Auth.prototype.signInAndRetrieveDataWithCustomToken is deprecated. Please use firebase.auth.Auth.prototype.signInWithCustomToken instead."),this.Nb(t)},t.Fc=function(t,e){return kr("firebase.auth.Auth.prototype.signInAndRetrieveDataWithEmailAndPassword is deprecated. Please use firebase.auth.Auth.prototype.signInWithEmailAndPassword instead."),this.Ob(t,e)},t.Ob=function(t,e){var n=this;return this.i.then((function(){return Vc(n,ts(n.b,Ya,{email:t,password:e}))}))},t.xb=function(t,e){var n=this;return this.i.then((function(){return Vc(n,ts(n.b,xa,{email:t,password:e}))}))},t.Wb=function(t,e){return kr("firebase.auth.Auth.prototype.createUserAndRetrieveDataWithEmailAndPassword is deprecated. Please use firebase.auth.Auth.prototype.createUserWithEmailAndPassword instead."),this.xb(t,e)},t.Hc=function(t){return kr("firebase.auth.Auth.prototype.signInWithCredential is deprecated. Please use firebase.auth.Auth.prototype.signInAndRetrieveDataWithCredential instead."),this.Pa(t).then((function(t){return t.user}))},t.Pa=function(t){var e=this;return this.i.then((function(){return Vc(e,t.la(e.b))}))},t.Qa=function(){var t=this;return this.i.then((function(){var e=Bc(t);if(e&&e.isAnonymous){var n=Ar({providerId:null,isNewUser:!1});return Ar({user:e,credential:null,additionalUserInfo:n,operationType:"signIn"})}return Vc(t,t.b.Qa()).then((function(e){var n=e.user;return hc(n,"isAnonymous",!0),t.Z(n),e}))}))},t.Gc=function(){return kr("firebase.auth.Auth.prototype.signInAnonymouslyAndRetrieveData is deprecated. Please use firebase.auth.Auth.prototype.signInAnonymously instead."),this.Qa()},t.getUid=function(){return Bc(this)&&Bc(this).uid||null},t.Vb=function(t){this.addAuthTokenListener(t),this.u++,0<this.u&&Bc(this)&&tc(Bc(this))},t.Cc=function(t){var e=this;R(this.o,(function(n){n==t&&e.u--})),0>this.u&&(this.u=0),0==this.u&&Bc(this)&&ec(Bc(this)),this.removeAuthTokenListener(t)},t.addAuthTokenListener=function(t){var e=this;this.o.push(t),Hc(this,this.i.then((function(){e.m||M(e.o,t)&&t(Wc(e))})))},t.removeAuthTokenListener=function(t){F(this.o,(function(e){return e==t}))},t.delete=function(){this.m=!0;for(var t=0;t<this.N.length;t++)this.N[t].cancel("app-deleted");return this.N=[],this.h&&(t=this.h).b.removeListener(xc("local"),t.a,this.ka),this.a&&(this.a.unsubscribe(this),this.a.Ya()),i.a.Promise.resolve()},t.Zb=function(t){return kr("firebase.auth.Auth.prototype.fetchProvi
1dersForEmail is deprecated. Please use firebase.auth.Auth.prototype.fetchSignInMethodsForEmail instead."),Hc(this,function(t,e){return ts(t,Aa,{identifier:e,continueUri:hr()?zn():"http://localhost"}).then((function(t){return t.allProviders||[]}))}(this.b,t))},t.$b=function(t){return Hc(this,function(t,e){return ts(t,Aa,{identifier:e,continueUri:hr()?zn():"http://localhost"}).then((function(t){return t.signinMethods||[]}))}(this.b,t))},t.oc=function(t){return!!zi(t)},t.lb=function(t,e){var n=this;return Hc(this,St().then((function(){var t=new Hr(e);if(!t.c)throw new qr("argument-error",Gr+" must be true when sending sign in link to email");return ei(t)})).then((function(e){return n.b.lb(t,e)})).then((function(){})))},t.Tc=function(t){return this.Ja(t).then((function(t){return t.data.email}))},t.Za=function(t,e){return Hc(this,this.b.Za(t,e).then((function(){})))},t.Ja=function(t){return Hc(this,this.b.Ja(t).then((function(t){return new Dr(t)})))},t.Wa=function(t){return Hc(this,this.b.Wa(t).then((function(){})))},t.kb=function(t,e){var n=this;return Hc(this,St().then((function(){return void 0===e||it(e)?{}:ei(new Hr(e))})).then((function(e){return n.b.kb(t,e)})).then((function(){})))},t.Jc=function(t,e){return Hc(this,Vu(this,t,e,v(this.Pa,this)))},t.Ic=function(t,e){var n=this;return Hc(this,St().then((function(){var r=Wi(t,e||zn());return n.Pa(r)})))},$c.prototype.render=function(){},$c.prototype.reset=function(){},$c.prototype.getResponse=function(){},$c.prototype.execute=function(){};var Gc=null;function Qc(t,e){return(e=Yc(e))&&t.a[e]||null}function Yc(t){return(t=void 0===t?1e12:t)?t.toString():null}function Xc(t,e){this.g=!1,this.c=e,this.a=this.b=null,this.h="invisible"!==this.c.size,this.f=Rn(t);var n=this;this.i=function(){n.execute()},this.h?this.execute():be(this.f,"click",this.i)}function Jc(t){if(t.g)throw Error("reCAPTCHA mock was already deleted!")}function Zc(){}Kc.prototype.render=function(t,e){return this.a[this.b.toString()]=new Xc(t,e),this.b++},Kc.prototype.reset=function(t){var e=Qc(this,t);t=Yc(t),e&&t&&(e.delete(),delete this.a[t])},Kc.prototype.getResponse=function(t){return(t=Qc(this,t))?t.getResponse():null},Kc.prototype.execute=function(t){(t=Qc(this,t))&&t.execute()},Xc.prototype.getResponse=function(){return Jc(this),this.b},Xc.prototype.execute=function(){Jc(this);var t=this;this.a||(this.a=setTimeout((function(){t.b=function(){for(var t=50,e=[];0<t;)e.push("1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".charAt(Math.floor(62*Math.random()))),t--;return e.join("")}();var e=t.c.callback,n=t.c["expired-callback"];if(e)try{e(t.b)}catch(r){}t.a=setTimeout((function(){if(t.a=null,t.b=null,n)try{n()}catch(r){}t.h&&t.execute()}),6e4)}),500))},Xc.prototype.delete=function(){Jc(this),this.g=!0,clearTimeout(this.a),this.a=null,Se(this.f,"click",this.i)},Zc.prototype.g=function(){return Gc||(Gc=new Kc),St(Gc)},Zc.prototype.c=function(){};var tl=null;function el(){this.b=n.grecaptcha?1/0:0,this.f=null,this.a="__rcb"+Math.floor(1e6*Math.random()).toString()}var nl=vn("https://www.google.com/recaptcha/api.js?onload=%{onload}&render=explicit&hl=%{hl}"),rl=new wr(3e4,6e4);el.prototype.g=function(t){var e=this;return new mt((function(r,i){var o=setTimeout((function(){i(new qr("network-request-failed"))}),rl.get());!n.grecaptcha||t!==e.f&&!e.b?(n[e.a]=function(){if(n.grecaptcha){e.f=t;var a=n.grecaptcha.render;n.grecaptcha.render=function(t,n){return t=a(t,n),e.b++,t},clearTimeout(o),r(n.grecaptcha)}else clearTimeout(o),i(new qr("internal-error"));delete n[e.a]},St(Yo(wn(nl,{onload:e.a,hl:t||""}))).s((function(){clearTimeout(o),i(new qr("internal-error","Unable to load external reCAPTCHA dependencies!"))}))):(clearTimeout(o),r(n.grecaptcha))}))},el.prototype.c=function(){this.b--};var il=null;
1function ol(t,e,r,i,o,a,s){if(Or(this,"type","recaptcha"),this.c=this.f=null,this.D=!1,this.m=e,this.g=null,s?(tl||(tl=new Zc),s=tl):(il||(il=new el),s=il),this.o=s,this.a=r||{theme:"light",type:"image"},this.h=[],this.a[ul])throw new qr("argument-error","sitekey should not be provided for reCAPTCHA as one is automatically provisioned for the current project.");if(this.i="invisible"===this.a[cl],!n.document)throw new qr("operation-not-supported-in-this-environment","RecaptchaVerifier is only supported in a browser HTTP/HTTPS environment with DOM support.");if(!Rn(e)||!this.i&&Rn(e).hasChildNodes())throw new qr("argument-error","reCAPTCHA container is either not found or already contains inner elements!");this.u=new ra(t,a||null,o||null),this.v=i||function(){return null};var u=this;this.l=[];var c=this.a[al];this.a[al]=function(t){if(ll(u,t),"function"==typeof c)c(t);else if("string"==typeof c){var e=ur(c,n);"function"==typeof e&&e(t)}};var l=this.a[sl];this.a[sl]=function(){if(ll(u,null),"function"==typeof l)l();else if("string"==typeof l){var t=ur(l,n);"function"==typeof t&&t()}}}var al="callback",sl="expired-callback",ul="sitekey",cl="size";function ll(t,e){for(var n=0;n<t.l.length;n++)try{t.l[n](e)}catch(r){}}function hl(t,e){return t.h.push(e),e.ia((function(){L(t.h,e)})),e}function fl(t){if(t.D)throw new qr("internal-error","RecaptchaVerifier instance has been destroyed.")}function dl(t,e,n){var r=!1;try{this.b=n||i.a.app()}catch(s){throw new qr("argument-error","No firebase.app.App instance is currently initialized.")}if(!this.b.options||!this.b.options.apiKey)throw new qr("invalid-api-key");n=this.b.options.apiKey;var o=this,a=null;try{a=this.b.auth().ya()}catch(s){}try{r=this.b.auth().settings.appVerificationDisabledForTesting}catch(s){}a=i.a.SDK_VERSION?ar(i.a.SDK_VERSION,a):null,ol.call(this,n,t,e,(function(){try{var t=o.b.auth().ea()}catch(e){t=null}return t}),a,ci(si),r)}function pl(t,e,n,r){t:{n=Array.prototype.slice.call(n);for(var i=0,o=!1,a=0;a<e.length;a++)if(e[a].optional)o=!0;else{if(o)throw new qr("internal-error","Argument validator encountered a required argument after an optional argument.");i++}if(o=e.length,n.length<i||o<n.length)r="Expected "+(i==o?1==i?"1 argument":i+" arguments":i+"-"+o+" arguments")+" but got "+n.length+".";else{for(i=0;i<n.length;i++)if(o=e[i].optional&&void 0===n[i],!e[i].M(n[i])&&!o){if(e=e[i],0>i||i>=ml.length)throw new qr("internal-error","Argument validator received an unsupported number of arguments.");n=ml[i],r=(r?"":n+" argument ")+(e.name?'"'+e.name+'" ':"")+"must be "+e.K+".";break t}r=null}}if(r)throw new qr("argument-error",t+" failed: "+r)}(t=ol.prototype).za=function(){var t=this;return this.f?this.f:this.f=hl(this,St().then((function(){if(hr()&&!tr())return Xn();throw new qr("operation-not-supported-in-this-environment","RecaptchaVerifier is only supported in a browser HTTP/HTTPS environment.")})).then((function(){return t.o.g(t.v())})).then((function(e){return t.g=e,ts(t.u,Va,{})})).then((function(e){t.a[ul]=e.recaptchaSiteKey})).s((function(e){throw t.f=null,e})))},t.render=function(){fl(this);var t=this;return hl(this,this.za().then((function(){if(null===t.c){var e=t.m;if(!t.i){var n=Rn(e);e=function(t,e,n){var i=arguments,o=document,a=String(i[0]),s=i[1];if(!dn&&s&&(s.name||s.type)){if(a=["<",a],s.name&&a.push(' name="',W(s.name),'"'),s.type){a.push(' type="',W(s.type),'"');var u={};ct(u,s),delete u.type,s=u}a.push(">"),a=a.join("")}return a=o.createElement(a),s&&(r(s)?a.className=s:c(s)?a.className=s.join(" "):Nn(a,s)),2<i.length&&Mn(o,a,i),a}("DIV"),n.appendChild(e)}t.c=t.g.render(e,t.a)}return t.c})))},t.verify=function(){fl(this);var t=this;return hl(this,this.render().then((function(e){return new mt((function(n){var r=t.g.getResponse(e);if(r)n(r);else{var i=function(e){e&&(function(t,e){F(t.l,(function(t){return t==e}))}(t,i),n(e))};t.l.push(i),t.i&&t.g.execute(t.c)}}))})))},t.reset=function(){fl(this),null!==this.c&&this.g.reset(this.c)},t.clear=function(){fl(this),this.D=!0,this.o.c();for(var t=0;t<this.h.length;t++)this.h[t].cancel("RecaptchaVerifier instance has been destroyed.");if(!this.i){t=Rn(this.m);for(var e;e=t.firstChild;)t.removeChild(e)}},w(dl,ol);var ml="First Second Third Fourth Fifth Sixth Seventh Eighth Ninth".split(" ");function yl(t,e){return{name:t||"",K:"a valid string",optional:!!e,M:r}}function vl(t,e){return{name:t||"",K:"a boolean",optional:!!e,M:o}}function gl(t,e){return{name:t||"",K:"a valid object",optional:!!e,M:f}}function bl(t,e){return{name:t||"",K:"a function",optional:!!e,M:
1h}}function wl(t,e){return{name:t||"",K:"null",optional:!!e,M:u}}function _l(t){return{name:t?t+"Credential":"credential",K:t?"a valid "+t+" credential":"a valid credential",optional:!1,M:function(e){return!!e&&!(!e.la||t&&e.providerId!==t)}}}function Sl(){return{name:"applicationVerifier",K:"an implementation of firebase.auth.ApplicationVerifier",optional:!1,M:function(t){return!!(t&&r(t.type)&&h(t.verify))}}}function Cl(t,e,n,r){return{name:n||"",K:t.K+" or "+e.K,optional:!!r,M:function(n){return t.M(n)||e.M(n)}}}function El(t,e){for(var n in e){var r=e[n].name;t[r]=Il(r,t[n],e[n].j)}}function Tl(t,e){for(var n in e){var r=e[n].name;r!==n&&Object.defineProperty(t,r,{get:g((function(t){return this[t]}),n),set:g((function(t,e,n,r){pl(t,[n],[r],!0),this[e]=r}),r,n,e[n].tb),enumerable:!0})}}function kl(t,e,n,r){t[e]=Il(e,n,r)}function Il(t,e,n){function r(){var t=Array.prototype.slice.call(arguments);return pl(o,n,t),e.apply(this,t)}if(!n)return e;var i,o=function(t){return(t=t.split("."))[t.length-1]}(t);for(i in e)r[i]=e[i];for(i in e.prototype)r.prototype[i]=e.prototype[i];return r}El(Nc.prototype,{Wa:{name:"applyActionCode",j:[yl("code")]},Ja:{name:"checkActionCode",j:[yl("code")]},Za:{name:"confirmPasswordReset",j:[yl("code"),yl("newPassword")]},xb:{name:"createUserWithEmailAndPassword",j:[yl("email"),yl("password")]},Wb:{name:"createUserAndRetrieveDataWithEmailAndPassword",j:[yl("email"),yl("password")]},Zb:{name:"fetchProvidersForEmail",j:[yl("email")]},$b:{name:"fetchSignInMethodsForEmail",j:[yl("email")]},fa:{name:"getRedirectResult",j:[]},oc:{name:"isSignInWithEmailLink",j:[yl("emailLink")]},uc:{name:"onAuthStateChanged",j:[Cl(gl(),bl(),"nextOrObserver"),bl("opt_error",!0),bl("opt_completed",!0)]},vc:{name:"onIdTokenChanged",j:[Cl(gl(),bl(),"nextOrObserver"),bl("opt_error",!0),bl("opt_completed",!0)]},kb:{name:"sendPasswordResetEmail",j:[yl("email"),Cl(gl("opt_actionCodeSettings",!0),wl(null,!0),"opt_actionCodeSettings",!0)]},lb:{name:"sendSignInLinkToEmail",j:[yl("email"),gl("actionCodeSettings")]},mb:{name:"setPersistence",j:[yl("persistence")]},Pa:{name:"signInAndRetrieveDataWithCredential",j:[_l()]},Qa:{name:"signInAnonymously",j:[]},Gc:{name:"signInAnonymouslyAndRetrieveData",j:[]},Hc:{name:"signInWithCredential",j:[_l()]},Nb:{name:"signInWithCustomToken",j:[yl("token")]},Ec:{name:"signInAndRetrieveDataWithCustomToken",j:[yl("token")]},Ob:{name:"signInWithEmailAndPassword",j:[yl("email"),yl("password")]},Ic:{name:"signInWithEmailLink",j:[yl("email"),yl("emailLink",!0)]},Fc:{name:"signInAndRetrieveDataWithEmailAndPassword",j:[yl("email"),yl("password")]},Jc:{name:"signInWithPhoneNumber",j:[yl("phoneNumber"),Sl()]},Kc:{name:"signInWithPopup",j:[{name:"authProvider",K:"a valid Auth provider",optional:!1,M:function(t){return!!(t&&t.providerId&&t.hasOwnProperty&&t.hasOwnProperty("isOAuthProvider"))}}]},Lc:{name:"signInWithRedirect",j:[{name:"authProvider",K:"a valid Auth provider",optional:!1,M:function(t){return!!(t&&t.providerId&&t.hasOwnProperty&&t.hasOwnProperty("isOAuthProvider"))}}]},Qc:{name:"updateCurrentUser",j:[Cl({name:"user",K:"an instance of Firebase User",optional:!1,M:function(t){return!!(t&&t instanceof Qu)}},wl(),"user")]},nb:{name:"signOut",j:[]},toJSON:{name:"toJSON",j:[yl(null,!0)]},Sc:{name:"useDeviceLanguage",j:[]},Tc:{name:"verifyPasswordResetCode",j:[yl("code")]}}),Tl(Nc.prototype,{lc:{name:"languageCode",tb:Cl(yl(),wl(),"languageCode")}}),(Nc.Persistence=Ks).LOCAL="local",Nc.Persistence.SESSION="session",Nc.Persistence.NONE="none",El(Qu.prototype,{delete:{name:"delete",j:[]},dc:{name:"getIdTokenResult",j:[vl("opt_forceRefresh",!0)]},F:{name:"getIdToken",j:[vl("opt_forceRefresh",!0)]},eb:{name:"linkAndRetrieveDataWithCredential",j:[_l()]},pc:{name:"linkWithCredential",j:[_l()]},qc:{name:"linkWithPhoneNumber",j:[yl("phoneNumber"),Sl()]},rc:{name:"linkWithPopup",j:[{name:"authProvider",K:"a valid Auth provider",optional:!1,M:function(t){return!!(t&&t.providerId&&t.hasOwnProperty&&t.hasOwnProperty("isOAuthProvider"))}}]},sc:{name:"linkWithRedirect",j:[{name:"authProvider",K:"a valid Auth provider",optional:!1,M:function(t){return!!(t&&t.providerId&&t.hasOwnProperty&&t.hasOwnProperty("isOAuthProvider"))}}]},gb:{name:"reauthenticateAndRetrieveDataWithCredential",j:[_l()]},yc:{name:"reauthenticateWithCredential",j:[_l()]}
1,zc:{name:"reauthenticateWithPhoneNumber",j:[yl("phoneNumber"),Sl()]},Ac:{name:"reauthenticateWithPopup",j:[{name:"authProvider",K:"a valid Auth provider",optional:!1,M:function(t){return!!(t&&t.providerId&&t.hasOwnProperty&&t.hasOwnProperty("isOAuthProvider"))}}]},Bc:{name:"reauthenticateWithRedirect",j:[{name:"authProvider",K:"a valid Auth provider",optional:!1,M:function(t){return!!(t&&t.providerId&&t.hasOwnProperty&&t.hasOwnProperty("isOAuthProvider"))}}]},reload:{name:"reload",j:[]},jb:{name:"sendEmailVerification",j:[Cl(gl("opt_actionCodeSettings",!0),wl(null,!0),"opt_actionCodeSettings",!0)]},toJSON:{name:"toJSON",j:[yl(null,!0)]},Pc:{name:"unlink",j:[yl("provider")]},pb:{name:"updateEmail",j:[yl("email")]},qb:{name:"updatePassword",j:[yl("password")]},Rc:{name:"updatePhoneNumber",j:[_l("phone")]},rb:{name:"updateProfile",j:[gl("profile")]}}),El(Kc.prototype,{execute:{name:"execute"},render:{name:"render"},reset:{name:"reset"},getResponse:{name:"getResponse"}}),El($c.prototype,{execute:{name:"execute"},render:{name:"render"},reset:{name:"reset"},getResponse:{name:"getResponse"}}),El(mt.prototype,{ia:{name:"finally"},s:{name:"catch"},then:{name:"then"}}),Tl(Fu.prototype,{appVerificationDisabled:{name:"appVerificationDisabledForTesting",tb:vl("appVerificationDisabledForTesting")}}),El(Uu.prototype,{confirm:{name:"confirm",j:[yl("verificationCode")]}}),kl(Bi,"credential",(function(t,e){return new qi(t,e)}),[yl("email"),yl("password")]),El(Ri.prototype,{ua:{name:"addScope",j:[yl("scope")]},Da:{name:"setCustomParameters",j:[gl("customOAuthParameters")]}}),kl(Ri,"credential",Ni,[Cl(yl(),gl(),"token")]),kl(Bi,"credentialWithLink",Wi,[yl("email"),yl("emailLink")]),El(ji.prototype,{ua:{name:"addScope",j:[yl("scope")]},Da:{name:"setCustomParameters",j:[gl("customOAuthParameters")]}}),kl(ji,"credential",Mi,[Cl(yl(),gl(),"token")]),El(Li.prototype,{ua:{name:"addScope",j:[yl("scope")]},Da:{name:"setCustomParameters",j:[gl("customOAuthParameters")]}}),kl(Li,"credential",Fi,[Cl(yl(),Cl(gl(),wl()),"idToken"),Cl(yl(),wl(),"accessToken",!0)]),El(Ui.prototype,{Da:{name:"setCustomParameters",j:[gl("customOAuthParameters")]}}),kl(Ui,"credential",Vi,[Cl(yl(),gl(),"token"),yl("secret",!0)]),El(Di.prototype,{ua:{name:"addScope",j:[yl("scope")]},credential:{name:"credential",j:[Cl(yl(),wl(),"idToken",!0),Cl(yl(),wl(),"accessToken",!0),Cl(yl(),wl(),"nonce",!0)]},Da:{name:"setCustomParameters",j:[gl("customOAuthParameters")]}}),kl(Ki,"credential",Gi,[yl("verificationId"),yl("verificationCode")]),El(Ki.prototype,{Ua:{name:"verifyPhoneNumber",j:[yl("phoneNumber"),Sl()]}}),El(qr.prototype,{toJSON:{name:"toJSON",j:[yl(null,!0)]}}),El(ro.prototype,{toJSON:{name:"toJSON",j:[yl(null,!0)]}}),El(no.prototype,{toJSON:{name:"toJSON",j:[yl(null,!0)]}}),El(dl.prototype,{clear:{name:"clear",j:[]},render:{name:"render",j:[]},verify:{name:"verify",j:[]}}),function(){if(void 0===i.a||!i.a.INTERNAL||!i.a.INTERNAL.registerService)throw Error("Cannot find the firebase namespace; be sure to include firebase-app.js before this library.");var t={Auth:Nc,Error:qr};kl(t,"EmailAuthProvider",Bi,[]),kl(t,"FacebookAuthProvider",Ri,[]),kl(t,"GithubAuthProvider",ji,[]),kl(t,"GoogleAuthProvider",Li,[]),kl(t,"TwitterAuthProvider",Ui,[]),kl(t,"OAuthProvider",Di,[yl("providerId")]),kl(t,"SAMLAuthProvider",Pi,[yl("providerId")]),kl(t,"PhoneAuthProvider",Ki,[{name:"auth",K:"an instance of Firebase Auth",optional:!0,M:function(t){return!!(t&&t instanceof Nc)}}]),kl(t,"RecaptchaVerifier",dl,[Cl(yl(),{name:"",K:"an HTML element",optional:!1,M:function(t){return!!(t&&t instanceof Element)}},"recaptchaContainer"),gl("recaptchaParameters",!0),{name:"app",K:"an instance of Firebase App",optional:!0,M:function(t){return!!(t&&t instanceof i.a.app.App)}}]),i.a.INTERNAL.registerService("auth",(function(t,e){return e({INTERNAL:{getUid:v((t=new Nc(t)).getUid,t),getToken:v(t.cc,t),addAuthTokenListener:v(t.Vb,t),removeAuthTokenListener:v(t.Cc,t)}}),t}),t,(function(t,e){if("create"===t)try{e.auth()}catch(n){}})),i.a.INTERNAL.extendNamespace({User:Qu})}()}).apply("undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},t7fG:function(t,e,n){"use strict";n.r(e),n.d(e,"__extends",(function(){return i})),n.d(e,"__assign",(function(){return o}
1)),n.d(e,"__rest",(function(){return a})),n.d(e,"__decorate",(function(){return s})),n.d(e,"__param",(function(){return u})),n.d(e,"__metadata",(function(){return c})),n.d(e,"__awaiter",(function(){return l})),n.d(e,"__generator",(function(){return h})),n.d(e,"__exportStar",(function(){return f})),n.d(e,"__values",(function(){return d})),n.d(e,"__read",(function(){return p})),n.d(e,"__spread",(function(){return m})),n.d(e,"__await",(function(){return y})),n.d(e,"__asyncGenerator",(function(){return v})),n.d(e,"__asyncDelegator",(function(){return g})),n.d(e,"__asyncValues",(function(){return b})),n.d(e,"__makeTemplateObject",(function(){return w})),n.d(e,"__importStar",(function(){return _})),n.d(e,"__importDefault",(function(){return S}));var r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};function i(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var o=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t};function a(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&(n[r[i]]=t[r[i]])}return n}function s(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a}function u(t,e){return function(n,r){e(n,r,t)}}function c(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function l(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(e){o(e)}}function s(t){try{u(r.throw(t))}catch(e){o(e)}}function u(t){t.done?i(t.value):new n((function(e){e(t.value)})).then(a,s)}u((r=r.apply(t,e||[])).next())}))}function h(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=r[2&o[0]?"return":o[0]?"throw":"next"])&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[0,i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}function f(t,e){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}function d(t){var e="function"==typeof Symbol&&t[Symbol.iterator],n=0;return e?e.call(t):{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}}function p(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function m(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(p(arguments[e]));return t}function y(t){return this instanceof y?(this.v=t,this):new y(t)}function v(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(t,e||[]),o=[];return r={},a("next"),a("throw"),a("return"),r[Symbol.asyncIterator]=function(){return this},r;function a(t){i[t]&&(r[t]=function(e){return new Promise((function(n,r){o.push([t,e,n,r])>1||s(t,e)}))})}function s(t,e){try{(n=i[t](e)).value instanceof y?Promise.resolve(n.value.v).then(u,c):l(o[0][2],n)}catch(r){l(o[0][3],r)}var n}function u(t){s("next",t)}function c(t){s("throw",t)}function l(t,e){t(e),o.shift(),o.length&&s(o[0][0],o[0][1])}}function g(t){var e,n;return e={},r("next"),r("throw",(function(t){throw t})),r("return"),e[Symbol.iterator]=function(){return this},e;function r(r,i){t[r]&&(e[r]=function(e){return(n=!n)?{value:y(t[r](e)),done:"return"===r}:i?i(e):e})}}function b(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator];return e?e.call(t):d(t)}function w(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function _(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function S(t){return t&&t.__esModule?t:{default:t}}},tLdg:function(t,e,n){var r=n("jZgK")("match");t.exports=function(t){var e=/./;try{"/./"[t](e)}catch(n){try{return e[r]=!1,!"/./"[t](e)}catch(i){}}return!0}},tct4:function(t,e,n){"use strict";n.r(e);var r=n("fvl4"),i=n("X8TH"),o=n("UdJG"),a=n("9V49"),s=n("D4gr"),u=n("83ve"),c=n("htu+");n.d(e,"EnablePersistenceToken",(function(){return r.d})),n.d(e,"PersistenceSettingsToken",(function(){return r.g})),n.d(e,"FirestoreSettingsToken",(function(){return r.e})),n.d(e,"ENABLE_PERSISTENCE",(function(){return r.c})),n.d(e,"PERSISTENCE_SETTINGS",(function(){return r.f})),n.d(e,"SETTINGS",(function(){return r.h})),n.d(e,"DefaultFirestoreSettings",(function(){return r.b})),n.d(e,"associateQuery",(function(){return r.i})),n.d(e,"AngularFirestore",(function(){return r.a})),n.d(e,"AngularFirestoreModule",(function(){return i.a})),n.d(e,"validateEventsArray",(function(){return o.b})),n.d(e,"AngularFirestoreCollection",(function(){return o.a})),n.d(e,"AngularFirestoreCollectionGroup",(function(){return a.a})),n.d(e,"AngularFirestoreDocument",(function(){return s.a})),n.d(e,"docChanges",(function(){return u.c})),n.d(e,"sortedChanges",(function(){return u.d})),n.d(e,"combineChanges",(function(){return u.b})),n.d(e,"combineChange",(function(){return u.a})),n.d(e,"fromRef",(function(){return c.c})),n.d(e,"fromDocRef",(function(){return c.b})),n.d(e,"fromCollectionRef",(function(){return c.a}))}
1,tmUU:function(t,e,n){n("oQnE"),n("zGGa"),t.exports=n("eKN1").f("iterator")},ttJE:function(t,e,n){"use strict";n.d(e,"a",(function(){return b})),n.d(e,"b",(function(){return y})),n.d(e,"c",(function(){return v})),n.d(e,"d",(function(){return g})),n.d(e,"e",(function(){return r})),n.d(e,"f",(function(){return i})),n.d(e,"g",(function(){return o}));var r=function(t){return o(t)},i=function(t,e){return"string"==typeof t&&(e=t,t=void 0),r(t).includes(e)},o=function(t){void 0===t&&(t=window),t.Ionic=t.Ionic||{};var e=t.Ionic.platforms;return null==e&&(e=t.Ionic.platforms=a(t)).forEach((function(e){return t.document.documentElement.classList.add("plt-"+e)})),e},a=function(t){return Object.keys(m).filter((function(e){return m[e](t)}))},s=function(t){return!!d(t,/iPad/i)||!(!d(t,/Macintosh/i)||!c(t))},u=function(t){return d(t,/android|sink/i)},c=function(t){return p(t,"(any-pointer:coarse)")},l=function(t){return h(t)||f(t)},h=function(t){return!!(t.cordova||t.phonegap||t.PhoneGap)},f=function(t){var e=t.Capacitor;return!(!e||!e.isNative)},d=function(t,e){return e.test(t.navigator.userAgent)},p=function(t,e){return t.matchMedia(e).matches},m={ipad:s,iphone:function(t){return d(t,/iPhone/i)},ios:function(t){return d(t,/iPhone|iPod/i)||s(t)},android:u,phablet:function(t){var e=t.innerWidth,n=t.innerHeight,r=Math.min(e,n),i=Math.max(e,n);return r>390&&r<520&&i>620&&i<800},tablet:function(t){var e=t.innerWidth,n=t.innerHeight,r=Math.min(e,n),i=Math.max(e,n);return s(t)||function(t){return u(t)&&!d(t,/mobile/i)}(t)||r>460&&r<820&&i>780&&i<1400},cordova:h,capacitor:f,electron:function(t){return d(t,/electron/i)},pwa:function(t){return!(!t.matchMedia("(display-mode: standalone)").matches&&!t.navigator.standalone)},mobile:c,mobileweb:function(t){return c(t)&&!l(t)},desktop:function(t){return!c(t)},hybrid:l},y=new(function(){function t(){this.m=new Map}return t.prototype.reset=function(t){this.m=new Map(Object.entries(t))},t.prototype.get=function(t,e){var n=this.m.get(t);return void 0!==n?n:e},t.prototype.getBoolean=function(t,e){void 0===e&&(e=!1);var n=this.m.get(t);return void 0===n?e:"string"==typeof n?"true"===n:!!n},t.prototype.getNumber=function(t,e){var n=parseFloat(this.m.get(t));return isNaN(n)?void 0!==e?e:NaN:n},t.prototype.set=function(t,e){this.m.set(t,e)},t}()),v=function(t){try{var e=t.sessionStorage.getItem(S);return null!==e?JSON.parse(e):{}}catch(n){return{}}},g=function(t,e){try{t.sessionStorage.setItem(S,JSON.stringify(e))}catch(n){return}},b=function(t){var e={};return t.location.search.slice(1).split("&").map((function(t){return t.split("=")})).map((function(t){var e=t[1];return[decodeURIComponent(t[0]),decodeURIComponent(e)]})).filter((function(t){return w(t[0],_)})).map((function(t){var e=t[1];return[t[0].slice(_.length),e]})).forEach((function(t){e[t[0]]=t[1]})),e},w=function(t,e){return t.substr(0,e.length)===e},_="ionic:",S="ionic-persist-config"},u00B:function(t,e,n){var r=n("qtiw"),i=n("Autd"),o=n("8L4g"),a=n("eKN1"),s=n("ytDL").f;t.exports=function(t){var e=i.Symbol||(i.Symbol=o?{}:r.Symbol||{});"_"==t.charAt(0)||t in e||s(e,t,{value:a.f(t)})}},u67D:function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n("En8+"),i=function(t){return function(e){for(var n=t[r.a]();;){var i=n.next();if(i.done){e.complete();break}if(e.next(i.value),e.closed)break}return"function"==typeof n.return&&e.add((function(){n.return&&n.return()})),e}}},v202:function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n("CcnG"),i=function(){function t(){this.states={},this.setState(!1)}return t.prototype.setState=function(t){return e=this,void 0,r=function(){return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=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 a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(e){return this.states.tab1Root=t,this.states.tab2Root=!t,this.states.tab3Root=!t,[2,!0]}))}
1,new((n=void 0)||(n=Promise))((function(t,i){function o(t){try{s(r.next(t))}catch(e){i(e)}}function a(t){try{s(r.throw(t))}catch(e){i(e)}}function s(e){e.done?t(e.value):new n((function(t){t(e.value)})).then(o,a)}s((r=r.apply(e,[])).next())}));var e,n,r},t.ngInjectableDef=r.S({factory:function(){return new t},token:t,providedIn:"root"}),t}()},wSPg:function(t,e,n){"use strict";n.d(e,"a",(function(){return s})),n.d(e,"b",(function(){return c})),n.d(e,"c",(function(){return u})),n.d(e,"d",(function(){return d})),n.d(e,"e",(function(){return p})),n.d(e,"f",(function(){return a})),n.d(e,"g",(function(){return o})),n.d(e,"h",(function(){return f})),n.d(e,"i",(function(){return l})),n.d(e,"j",(function(){return h})),n.d(e,"k",(function(){return i}));var r=n("mrSG"),i=function(t){return"function"==typeof __zone_symbol__requestAnimationFrame?__zone_symbol__requestAnimationFrame(t):"function"==typeof requestAnimationFrame?requestAnimationFrame(t):setTimeout(t)},o=function(t){return!!t.shadowRoot&&!!t.attachShadow},a=function(t){var e=t.closest("ion-item");return e?e.querySelector("ion-label"):null},s=function(t,e,n,r,i){if(t||o(e)){var a=e.querySelector("input.aux-input");a||((a=e.ownerDocument.createElement("input")).type="hidden",a.classList.add("aux-input"),e.appendChild(a)),a.disabled=i,a.name=n,a.value=r||""}},u=function(t,e,n){return Math.max(t,Math.min(e,n))},c=function(t,e){if(!t){var n="ASSERT: "+e;throw console.error(n),new Error(n)}},l=function(t){return t.timeStamp||Date.now()},h=function(t){if(t){var e=t.changedTouches;if(e&&e.length>0){var n=e[0];return{x:n.clientX,y:n.clientY}}if(void 0!==t.pageX)return{x:t.pageX,y:t.pageY}}return{x:0,y:0}},f=function(t){var e="rtl"===document.dir;switch(t){case"start":return e;case"end":return!e;default:throw new Error('"'+t+'" is not a valid value for [side]. Use "start" or "end" instead.')}},d=function(t,e){var n=t._original||t;return{_original:t,emit:p(n.emit.bind(n),e)}},p=function(t,e){var n;return void 0===e&&(e=0),function(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];clearTimeout(n),n=setTimeout.apply(void 0,Object(r.j)([t,e],i))}}},wj3C:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n("zVF4"),i=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o=[],a=function(){function t(t,e,n){this.firebase_=n,this.isDeleted_=!1,this.services_={},this.name_=e.name,this._automaticDataCollectionEnabled=e.automaticDataCollectionEnabled||!1,this.options_=r.deepCopy(t),this.INTERNAL={getUid:function(){return null},getToken:function(){return Promise.resolve(null)},addAuthTokenListener:function(t){o.push(t),setTimeout((function(){return t(null)}),0)},removeAuthTokenListener:function(t){o=o.filter((function(e){return e!==t}))}}}return Object.defineProperty(t.prototype,"automaticDataCollectionEnabled",{get:function(){return this.checkDestroyed_(),this._automaticDataCollectionEnabled},set:function(t){this.checkDestroyed_(),this._automaticDataCollectionEnabled=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return this.checkDestroyed_(),this.name_},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"options",{get:function(){return this.checkDestroyed_(),this.options_},enumerable:!0,configurable:!0}),t.prototype.delete=function(){var t=this;return new Promise((function(e){t.checkDestroyed_(),e()})).then((function(){t.firebase_.INTERNAL.removeApp(t.name_);var e=[];return Object.keys(t.services_).forEach((function(n){Object.keys(t.services_[n]).forEach((function(r){e.push(t.services_[n][r])}))})),Promise.all(e.map((function(t){return t.INTERNAL.delete()})))})).then((function(){t.isDeleted_=!0,t.services_={}}))},t.prototype._getService=function(t,e){if(void 0===e&&(e="[DEFAULT]"),this.checkDestroyed_(),this.services_[t]||(this.services_[t]={}),!this.services_[t][e]){var n="[DEFAULT]"!==e?e:void 0,r=this.firebase_.INTERNAL.factories[t](this,this.extendApp.bind(this),n);this.services_[t][e]=r}return this.services_[t][e]},t.prototype.extendApp=function(t){var e=this;r.deepExtend(this,t),t.INTERNAL&&t.INTERNAL.addAuthTokenListener&&(o.forEac
1h((function(t){e.INTERNAL.addAuthTokenListener(t)})),o=[])},t.prototype.checkDestroyed_=function(){this.isDeleted_&&s("app-deleted",{name:this.name_})},t}();function s(t,e){throw u.create(t,e)}a.prototype.name&&a.prototype.options||a.prototype.delete||console.log("dc");var u=new r.ErrorFactory("app","Firebase",{"no-app":"No Firebase App '{$name}' has been created - call Firebase App.initializeApp()","bad-app-name":"Illegal App name: '{$name}","duplicate-app":"Firebase App named '{$name}' already exists","app-deleted":"Firebase App named '{$name}' already deleted","duplicate-service":"Firebase service named '{$name}' already registered","sa-not-supported":"Initializing the Firebase SDK with a service account is only allowed in a Node.js environment. On client devices, you should instead initialize the SDK with an api key and auth domain","invalid-app-argument":"firebase.{$name}() takes either no argument or a Firebase App instance."}),c=function t(){var e={},n={},o={},u={__esModule:!0,initializeApp:function(t,n){void 0===n&&(n={}),"object"==typeof n&&null!==n||(n={name:n});var r=n;void 0===r.name&&(r.name="[DEFAULT]");var o=r.name;"string"==typeof o&&o||s("bad-app-name",{name:o+""}),i(e,o)&&s("duplicate-app",{name:o});var c=new a(t,r,u);return e[o]=c,h(c,"create"),c},app:c,apps:null,Promise:Promise,SDK_VERSION:"5.8.1",INTERNAL:{registerService:function(t,e,i,h,f){n[t]&&s("duplicate-service",{name:t}),n[t]=e,h&&(o[t]=h,l().forEach((function(t){h("create",t)})));var d=function(e){return void 0===e&&(e=c()),"function"!=typeof e[t]&&s("invalid-app-argument",{name:t}),e[t]()};return void 0!==i&&r.deepExtend(d,i),u[t]=d,a.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,f?e:[])},d},createFirebaseNamespace:t,extendNamespace:function(t){r.deepExtend(u,t)},createSubscribe:r.createSubscribe,ErrorFactory:r.ErrorFactory,removeApp:function(t){h(e[t],"delete"),delete e[t]},factories:n,useAsService:f,Promise:Promise,deepExtend:r.deepExtend}};function c(t){return i(e,t=t||"[DEFAULT]")||s("no-app",{name:t}),e[t]}function l(){return Object.keys(e).map((function(t){return e[t]}))}function h(t,e){Object.keys(n).forEach((function(n){var r=f(0,n);null!==r&&o[r]&&o[r](e,t)}))}function f(t,e){return"serverAuth"===e?null:e}return r.patchProperty(u,"default",u),Object.defineProperty(u,"apps",{get:l}),r.patchProperty(c,"App",a),u}();e.firebase=c,e.default=c},x7I3:function(t,e,n){"use strict";n.r(e),n.d(e,"createWebChannelTransport",(function(){return Dn})),n.d(e,"ErrorCode",(function(){return Rn})),n.d(e,"EventType",(function(){return Nn})),n.d(e,"WebChannel",(function(){return jn})),n.d(e,"XhrIoPool",(function(){return Mn}));var r,i="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},o=o||{},a=i;function s(t){return"string"==typeof t}function u(t,e){t=t.split("."),e=e||a;for(var n=0;n<t.length;n++)if(null==(e=e[t[n]]))return null;return e}function c(){}function l(t){var e=typeof t;if("object"==e){if(!t)return"null";if(t instanceof Array)return"array";if(t instanceof Object)return e;var n=Object.prototype.toString.call(t);if("[object Window]"==n)return"object";if("[object Array]"==n||"number"==typeof t.length&&void 0!==t.splice&&void 0!==t.propertyIsEnumerable&&!t.propertyIsEnumerable("splice"))return"array";if("[object Function]"==n||void 0!==t.call&&void 0!==t.propertyIsEnumerable&&!t.propertyIsEnumerable("call"))return"function"}else if("function"==e&&void 0===t.call)return"object";return e}function h(t){return"array"==l(t)}function f(t){var e=l(t);return"array"==e||"object"==e&&"number"==typeof t.length}function d(t){return"function"==l(t)}function p(t){var e=typeof t;return"object"==e&&null!=t||"function"==e}var m="closure_uid_"+(1e9*Math.random()>>>0),y=0;function v(t,e,n){return t.call.apply(t.bind,arguments)}function g(t,e,n){if(!t)throw Error();if(2<arguments.length){var r=Array.prototype.slice.call(arguments,2);return function(){var n=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(n,r),t.apply(e,n)}}return function(){return t.apply(e,arguments)}}function b(t,e,n){return(b=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?v:g).apply(null,arguments)}
1function w(t,e){var n=Array.prototype.slice.call(arguments,1);return function(){var e=n.slice();return e.push.apply(e,arguments),t.apply(this,e)}}var _=Date.now||function(){return+new Date};function S(t,e){function n(){}n.prototype=e.prototype,t.L=e.prototype,t.prototype=new n,t.prototype.constructor=t,t.mh=function(t,n,r){for(var i=Array(arguments.length-2),o=2;o<arguments.length;o++)i[o-2]=arguments[o];return e.prototype[n].apply(t,i)}}function C(t){if(Error.captureStackTrace)Error.captureStackTrace(this,C);else{var e=Error().stack;e&&(this.stack=e)}t&&(this.message=String(t))}function E(t,e){for(var n="",r=(t=t.split("%s")).length-1,i=0;i<r;i++)n+=t[i]+(i<e.length?e[i]:"%s");C.call(this,n+t[r])}function T(){0!=k&&(I[this[m]||(this[m]=++y)]=this),this.Ka=this.Ka,this.Qa=this.Qa}S(C,Error),C.prototype.name="CustomError",S(E,C),E.prototype.name="AssertionError";var k=0,I={};T.prototype.Ka=!1,T.prototype.bb=function(){if(!this.Ka&&(this.Ka=!0,this.F(),0!=k)){var t=this[m]||(this[m]=++y);if(0!=k&&this.Qa&&0<this.Qa.length)throw Error(this+" did not empty its onDisposeCallbacks queue. This probably means it overrode dispose() or disposeInternal() without calling the superclass' method.");delete I[t]}},T.prototype.F=function(){if(this.Qa)for(;this.Qa.length;)this.Qa.shift()()};var O=Array.prototype.indexOf?function(t,e){return Array.prototype.indexOf.call(t,e,void 0)}:function(t,e){if(s(t))return s(e)&&1==e.length?t.indexOf(e,0):-1;for(var n=0;n<t.length;n++)if(n in t&&t[n]===e)return n;return-1},x=Array.prototype.lastIndexOf?function(t,e){return Array.prototype.lastIndexOf.call(t,e,t.length-1)}:function(t,e){var n=t.length-1;if(0>n&&(n=Math.max(0,t.length+n)),s(t))return s(e)&&1==e.length?t.lastIndexOf(e,n):-1;for(;0<=n;n--)if(n in t&&t[n]===e)return n;return-1},A=Array.prototype.forEach?function(t,e,n){Array.prototype.forEach.call(t,e,n)}:function(t,e,n){for(var r=t.length,i=s(t)?t.split(""):t,o=0;o<r;o++)o in i&&e.call(n,i[o],o,t)},P=Array.prototype.some?function(t,e){return Array.prototype.some.call(t,e,void 0)}:function(t,e){for(var n=t.length,r=s(t)?t.split(""):t,i=0;i<n;i++)if(i in r&&e.call(void 0,r[i],i,t))return!0;return!1};function D(t){if(!h(t))for(var e=t.length-1;0<=e;e--)delete t[e];t.length=0}function R(t,e){var n;return(n=0<=(e=O(t,e)))&&Array.prototype.splice.call(t,e,1),n}function N(t){return Array.prototype.concat.apply([],arguments)}function j(t){var e=t.length;if(0<e){for(var n=Array(e),r=0;r<e;r++)n[r]=t[r];return n}return[]}function M(t){return/^[\s\xa0]*$/.test(t)}var L,F=String.prototype.trim?function(t){return t.trim()}:function(t){return/^[\s\xa0]*([\s\S]*?)[\s\xa0]*$/.exec(t)[1]};function U(t,e){return t<e?-1:t>e?1:0}t:{var V=a.navigator;if(V){var q=V.userAgent;if(q){L=q;break t}}L=""}function B(t){return-1!=L.indexOf(t)}function W(t,e,n){for(var r in t)e.call(n,t[r],r,t)}function z(t){var e,n=[],r=0;for(e in t)n[r++]=t[e];return n}function H(t){var e,n=[],r=0;for(e in t)n[r++]=e;return n}function $(t){var e,n={};for(e in t)n[e]=t[e];return n}var K="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function G(t,e){for(var n,r,i=1;i<arguments.length;i++){for(n in r=arguments[i])t[n]=r[n];for(var o=0;o<K.length;o++)n=K[o],Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}}function Q(t){return Q[" "](t),t}Q[" "]=c;var Y,X,J=B("Opera"),Z=B("Trident")||B("MSIE"),tt=B("Edge"),et=tt||Z,nt=B("Gecko")&&!(-1!=L.toLowerCase().indexOf("webkit")&&!B("Edge"))&&!(B("Trident")||B("MSIE"))&&!B("Edge"),rt=-1!=L.toLowerCase().indexOf("webkit")&&!B("Edge");function it(){var t=a.document;return t?t.documentMode:void 0}t:{var ot="",at=(X=L,nt?/rv:([^\);]+)(\)|;)/.exec(X):tt?/Edge\/([\d\.]+)/.exec(X):Z?/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(X):rt?/WebKit\/(\S+)/.exec(X):J?/(?:Version)[ \/]?(\S+)/.exec(X):void 0);if(at&&(ot=at?at[1]:""),Z){var st=it();if(null!=st&&st>parseFloat(ot)){Y=String(st);break t}}Y=ot}var ut,ct={};function lt(t){return function(t,e){var n=ct;return Object.prototype.hasOwnProperty.call(n,t)?n[t]:n[t]=e()}(t,(function(){for(var e=0,n=F(String(Y)).split("."),r=F(String(t)).split("."),i=Math.max(n.length,r.length),o=0;0==e&&o<i;o++){var a=n[o]||"",s=r[o]||"";do{if(a=/(\d*)(\D*)(.*)/.exec(a)||["","","",""],s=/(\d*)(\D*)(.*)/.exec(s)||["","","",""],0==a[0].length&&0==s[0].length)break;e=U(0==a[1].length?0:parseInt(a[1],10),0==s[1].length?0:parseInt(s[1],10))||U(0==a[2].length,0==s[2].length)||U(a[2],s[2]),a=a[3],s=s[3]}while(0==e)}return 0<=e}))}var ht=a.document;ut=ht&&Z?it()||("CSS1Compat"==ht.compatMode?parseInt(Y,10):5):void 0;var ft=Object.freeze||function(t){return t},dt=!Z||9<=Number(ut),pt=Z&&!lt("9"),mt=function(){if(!a.addEventListener||!Object.defineProperty)return!1;var t=!1,e=Object.defineProperty({},"passive",{get:function(){t=!0}});try{a.addEventListener("test",c,e),a.removeEventListener("test",c,e)}catch(n){}return t}();function yt(t,e){this.type=t,this.currentTarget=this.target=e,this.defaultPrevented=this.Ea=!1,this.Be=!0}function vt(t,e){yt.call(this,t?t.type:""),this.relatedTarget=this.currentTarget=this.target=null,this.button=this.screenY=this.screenX=this.clientY=this.clientX=this.offsetY=this.offsetX=0,this.key="",this.charCode=this.keyCode=0,this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1,this.state=null,this.pointerId=0,this.pointerType="",this.fb=null,t&&this.Kf(t,e)}yt.prototype.stopPropagation=function(){this.Ea=!0},yt.prototype.preventDefault=function(){this.defaultPrevented=!0,this.Be=!1},S(vt,yt);var gt=ft({2:"touch",3:"pen",4:"mouse"});vt.prototype.Kf=function(t,e){var n=this.type=t.type,r=t.changedTouches?t.changedTouches[0]:null;if(this.target=t.target||t.srcElement,this.currentTarget=e,e=t.relatedTarget){if(nt){t:{try{Q(e.nodeName);var i=!0;break t}catch(o){}i=!1}i||(e=null)}}
1else"mouseover"==n?e=t.fromElement:"mouseout"==n&&(e=t.toElement);this.relatedTarget=e,null===r?(this.offsetX=rt||void 0!==t.offsetX?t.offsetX:t.layerX,this.offsetY=rt||void 0!==t.offsetY?t.offsetY:t.layerY,this.clientX=void 0!==t.clientX?t.clientX:t.pageX,this.clientY=void 0!==t.clientY?t.clientY:t.pageY,this.screenX=t.screenX||0,this.screenY=t.screenY||0):(this.clientX=void 0!==r.clientX?r.clientX:r.pageX,this.clientY=void 0!==r.clientY?r.clientY:r.pageY,this.screenX=r.screenX||0,this.screenY=r.screenY||0),this.button=t.button,this.keyCode=t.keyCode||0,this.key=t.key||"",this.charCode=t.charCode||("keypress"==n?t.keyCode:0),this.ctrlKey=t.ctrlKey,this.altKey=t.altKey,this.shiftKey=t.shiftKey,this.metaKey=t.metaKey,this.pointerId=t.pointerId||0,this.pointerType=s(t.pointerType)?t.pointerType:gt[t.pointerType]||"",this.state=t.state,this.fb=t,t.defaultPrevented&&this.preventDefault()},vt.prototype.stopPropagation=function(){vt.L.stopPropagation.call(this),this.fb.stopPropagation?this.fb.stopPropagation():this.fb.cancelBubble=!0},vt.prototype.preventDefault=function(){vt.L.preventDefault.call(this);var t=this.fb;if(t.preventDefault)t.preventDefault();else if(t.returnValue=!1,pt)try{(t.ctrlKey||112<=t.keyCode&&123>=t.keyCode)&&(t.keyCode=-1)}catch(e){}};var bt="closure_listenable_"+(1e6*Math.random()|0);function wt(t){return!(!t||!t[bt])}var _t=0;function St(t,e,n,r,i){this.listener=t,this.proxy=null,this.src=e,this.type=n,this.capture=!!r,this.Ob=i,this.key=++_t,this.Sa=this.Eb=!1}function Ct(t){this.src=t,this.J={},this.xb=0}function Et(t,e,n,r){for(var i=0;i<t.length;++i){var o=t[i];if(!o.Sa&&o.listener==e&&o.capture==!!n&&o.Ob==r)return i}return-1}St.prototype.Vb=function(){this.Sa=!0,this.Ob=this.src=this.proxy=this.listener=null},(r=Ct.prototype).add=function(t,e,n,r,i){var o=t.toString();(t=this.J[o])||(t=this.J[o]=[],this.xb++);var a=Et(t,e,r,i);return-1<a?(e=t[a],n||(e.Eb=!1)):((e=new St(e,this.src,o,!!r,i)).Eb=n,t.push(e)),e},r.remove=function(t,e,n,r){if(!((t=t.toString())in this.J))return!1;var i=this.J[t];return-1<(e=Et(i,e,n,r))&&(i[e].Vb(),Array.prototype.splice.call(i,e,1),0==i.length&&(delete this.J[t],this.xb--),!0)},r.ye=function(t){var e=t.type;e in this.J&&R(this.J[e],t)&&(t.Vb(),0==this.J[e].length&&(delete this.J[e],this.xb--))},r.pb=function(t){var e;for(e in t=t&&t.toString(),this.J)if(!t||e==t){for(var n=this.J[e],r=0;r<n.length;r++)n[r].Vb();delete this.J[e],this.xb--}},r.jb=function(t,e,n,r){var i=-1;return(t=this.J[t.toString()])&&(i=Et(t,e,n,r)),-1<i?t[i]:null};var Tt="closure_lm_"+(1e6*Math.random()|0),kt={};function It(t,e,n,r,i){if(r&&r.once)return xt(t,e,n,r,i);if(h(e)){for(var o=0;o<e.length;o++)It(t,e[o],n,r,i);return null}return n=Lt(n),wt(t)?t.nb(e,n,p(r)?!!r.capture:!!r,i):Ot(t,e,n,!1,r,i)}function Ot(t,e,n,r,i,o){if(!e)throw Error("Invalid event type");var a=p(i)?!!i.capture:!!i,s=jt(t);if(s||(t[Tt]=s=new Ct(t)),(n=s.add(e,n,r,a,o)).proxy)return n;if(r=function(){var t=Nt,e=dt?function(n){return t.call(e.src,e.listener,n)}:function(n){if(!(n=t.call(e.src,e.listener,n)))return n};return e}(),n.proxy=r,r.src=t,r.listener=n,t.addEventListener)mt||(i=a),void 0===i&&(i=!1),t.addEventListener(e.toString(),r,i);else if(t.attachEvent)t.attachEvent(Pt(e.toString()),r);else{if(!t.addListener||!t.removeListener)throw Error("addEventListener and attachEvent are unavailable.");t.addListener(r)}return n}function xt(t,e,n,r,i){if(h(e)){for(var o=0;o<e.length;o++)xt(t,e[o],n,r,i);return null}return n=Lt(n),wt(t)?t.Oc(e,n,p(r)?!!r.capture:!!r,i):Ot(t,e,n,!0,r,i)}function At(t){if("number"!=typeof t&&t&&!t.Sa){var e=t.src;if(wt(e))e.Le(t);else{var n=t.type,r=t.proxy;e.removeEventListener?e.removeEventListener(n,r,t.capture):e.detachEvent?e.detachEvent(Pt(n),r):e.addListener&&e.removeListener&&e.removeListener(r),(n=jt(e))?(n.ye(t),0==n.xb&&(n.src=null,e[Tt]=null)):t.Vb()}}}function Pt(t){return t in kt?kt[t]:kt[t]="on"+t}function Dt(t,e,n,r){var i=!0;if((t=jt(t))&&(e=t.J[e.toString()]))for(e=e.concat(),t=0;t<e.length;t++){var o=e[t];o&&o.capture==n&&!o.Sa&&(o=Rt(o,r),i=i&&!1!==o)}return i}function Rt(t,e){var n=t.listener,r=t.Ob||t.src;return t.Eb&&At(t),n.call(r,e)}function Nt(t,e){if(t.Sa)return!0;
1if(!dt){var n=e||u("window.event");e=new vt(n,this);var r=!0;if(!(0>n.keyCode||null!=n.returnValue)){t:{var i=!1;if(0==n.keyCode)try{n.keyCode=-1;break t}catch(a){i=!0}(i||null==n.returnValue)&&(n.returnValue=!0)}for(n=[],i=e.currentTarget;i;i=i.parentNode)n.push(i);for(t=t.type,i=n.length-1;!e.Ea&&0<=i;i--){e.currentTarget=n[i];var o=Dt(n[i],t,!0,e);r=r&&o}for(i=0;!e.Ea&&i<n.length;i++)e.currentTarget=n[i],o=Dt(n[i],t,!1,e),r=r&&o}return r}return Rt(t,new vt(e,this))}function jt(t){return(t=t[Tt])instanceof Ct?t:null}var Mt="__closure_events_fn_"+(1e9*Math.random()>>>0);function Lt(t){return d(t)?t:(t[Mt]||(t[Mt]=function(e){return t.handleEvent(e)}),t[Mt])}function Ft(){T.call(this),this.ka=new Ct(this),this.Pe=this,this.Uc=null}S(Ft,T),Ft.prototype[bt]=!0,(r=Ft.prototype).addEventListener=function(t,e,n,r){It(this,t,e,n,r)},r.removeEventListener=function(t,e,n,r){!function t(e,n,r,i,o){if(h(n))for(var a=0;a<n.length;a++)t(e,n[a],r,i,o);else i=p(i)?!!i.capture:!!i,r=Lt(r),wt(e)?e.ed(n,r,i,o):e&&(e=jt(e))&&(n=e.jb(n,r,i,o))&&At(n)}(this,t,e,n,r)},r.dispatchEvent=function(t){var e,n=this.Uc;if(n)for(e=[];n;n=n.Uc)e.push(n);n=this.Pe;var r=t.type||t;if(s(t))t=new yt(t,n);else if(t instanceof yt)t.target=t.target||n;else{var i=t;G(t=new yt(r,n),i)}if(i=!0,e)for(var o=e.length-1;!t.Ea&&0<=o;o--){var a=t.currentTarget=e[o];i=a.Lb(r,!0,t)&&i}if(t.Ea||(i=(a=t.currentTarget=n).Lb(r,!0,t)&&i,t.Ea||(i=a.Lb(r,!1,t)&&i)),e)for(o=0;!t.Ea&&o<e.length;o++)i=(a=t.currentTarget=e[o]).Lb(r,!1,t)&&i;return i},r.F=function(){Ft.L.F.call(this),this.pg(),this.Uc=null},r.nb=function(t,e,n,r){return this.ka.add(String(t),e,!1,n,r)},r.Oc=function(t,e,n,r){return this.ka.add(String(t),e,!0,n,r)},r.ed=function(t,e,n,r){this.ka.remove(String(t),e,n,r)},r.Le=function(t){this.ka.ye(t)},r.pg=function(){this.ka&&this.ka.pb(void 0)},r.Lb=function(t,e,n){if(!(t=this.ka.J[String(t)]))return!0;t=t.concat();for(var r=!0,i=0;i<t.length;++i){var o=t[i];if(o&&!o.Sa&&o.capture==e){var a=o.listener,s=o.Ob||o.src;o.Eb&&this.Le(o),r=!1!==a.call(s,n)&&r}}return r&&0!=n.Be},r.jb=function(t,e,n,r){return this.ka.jb(String(t),e,n,r)};var Ut=a.JSON.stringify;function Vt(t,e){this.Sf=100,this.ef=t,this.ug=e,this.Zb=0,this.Pb=null}function qt(){this.lc=this.Va=null}Vt.prototype.get=function(){if(0<this.Zb){this.Zb--;var t=this.Pb;this.Pb=t.next,t.next=null}else t=this.ef();return t},Vt.prototype.put=function(t){this.ug(t),this.Zb<this.Sf&&(this.Zb++,t.next=this.Pb,this.Pb=t)};var Bt,Wt,zt=new Vt((function(){return new Ht}),(function(t){t.reset()}));function Ht(){this.next=this.scope=this.Gc=null}function $t(t){a.setTimeout((function(){throw t}),0)}qt.prototype.add=function(t,e){var n=this.Af();n.set(t,e),this.lc?this.lc.next=n:this.Va=n,this.lc=n},qt.prototype.remove=function(){var t=null;return this.Va&&(t=this.Va,this.Va=this.Va.next,this.Va||(this.lc=null),t.next=null),t},qt.prototype.wg=function(t){zt.put(t)},qt.prototype.Af=function(){return zt.get()},Ht.prototype.set=function(t,e){this.Gc=t,this.scope=e,this.next=null},Ht.prototype.reset=function(){this.next=this.scope=this.Gc=null};var Kt=!1,Gt=new qt;function Qt(){for(var t;t=Gt.remove();){try{t.Gc.call(t.scope)}catch(e){$t(e)}Gt.wg(t)}Kt=!1}function Yt(t,e){Ft.call(this),this.Na=t||1,this.wb=e||a,this.nd=b(this.Rg,this),this.ie=_()}function Xt(t,e,n){if(d(t))n&&(t=b(t,n));else{if(!t||"function"!=typeof t.handleEvent)throw Error("Invalid listener argument");t=b(t.handleEvent,t)}return 2147483647<Number(e)?-1:a.setTimeout(t,e||0)}function Jt(t,e,n){T.call(this),this.Uf=null!=n?b(t,n):t,this.Na=e,this.Xe=b(this.fg,this),this.qc=[]}function Zt(t){T.call(this),this.i=t,this.o={}}S(Yt,Ft),(r=Yt.prototype).enabled=!1,r.B=null,r.setInterval=function(t){this.Na=t,this.B&&this.enabled?(this.stop(),this.start()):this.B&&this.stop()},r.Rg=function(){if(this.enabled){var t=_()-this.ie;0<t&&t<.8*this.Na?this.B=this.wb.setTimeout(this.nd,this.Na-t):(this.B&&(this.wb.clearTimeout(this.B),this.B=null),this.ff(),this.enabled&&(this.stop(),this.start()))}},r.ff=function(){this.dispatchEvent("tick")},r.start=function(){this.enabled=!0,this.B||(this.B=this.wb.setTimeout(this.nd,this.Na),this.ie=_())},r.stop=function(){this.enabled=!1,this.B&&(this.wb.clearTimeout(this.B),this.B=null)},r.F=function(){Yt.L.F.call(this),this.stop(),delete this.wb},S(Jt,T),(r=Jt.prototype).Ta=!1,r.ob=0,r.B=null,r.mf=function(t){this.qc=arguments,this.B||this.ob?this.Ta=!0:this.Cc()},r.stop=function(){this.B&&(a.clearTimeout(this.B),this.B=null,this.Ta=!1,this.qc=[])},r.pause=function(){this.ob++},r.resume=function(){this.ob--,this.ob||!this.Ta||this.B||(this.Ta=!1,this.Cc())},r.F=function(){Jt.L.F.call(this),this.stop()},r.fg=function(){this.B=null,this.Ta&&!this.ob&&(this.Ta=!1,this.Cc())},r.Cc=function(){this.B=Xt(this.Xe,this.Na),this.Uf.apply(null,this.qc)},S(Zt,T);var te=[];function ee(t,e,n){this.reset(t,e,n,void 0,void 0)}function ne(t){this.pe=t,this.Zd=this.uc=this.mb=this.$b=null}function re(t,e){this.name=t,this.value=e}(r=Zt.prototype).nb=function(t,e,n,r){return this.Tf(t,e,n,r)},r.Tf=function(t,e,n,r){h(e)||(e&&(te[0]=e.toString()),e=te);for(var i=0;i<e.length;i++){var o=It(t,e[i],n||this.handleEvent,r||!1,this.i||this);if(!o)break;this.o[o.key]=o}return this},r.Oc=function(t,e,n,r){return this.je(t,e,n,r)},r.je=function(t,e,n,r,i){if(h(e))for(var o=0;o<e.length;o++)this.je(t,e[o],n,r,i);else{if(!(t=xt(t,e,n||this.handleEvent,r,i||this.i||this)))return this;this.o[t.key]=t}return this},r.ed=function(t,e,n,r,i){if(h(e))for(var o=0;o<e.length;o++)this.ed(t,e[o],n,r,i);else n=n||this.handleEvent,r=p(r)?!!r.capture:!!r,i=i||this.i||this,n=Lt(n),r=!!r,(e=wt(t)||t&&(t=jt(t))?t.jb(e,n,r,i):null)&&(At(e),delete this.o[e.key])},r.pb=function(){W(this.o,(function(t,e){this.o.hasOwnProperty(e)&&At(t)}),this),this.o={}},r.F=function(){Zt.L.F.call(this),this.pb()},r.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented")},ee.prototype.Md=null,ee.prototype.reset=function(t,e,n,r,i){this.mb=t,delete this.Md},ee.prototype.Bg=function(t){this.Md=t},ee.prototype.Ge=function(t){this.mb=t},re.prototype.toString=function(){return this.name};var ie=new re("SEVERE",1e3),oe=new re("WARNING",900),ae=new re("INFO",800),se=new re("CONFIG",700),ue=new re("FINE",500);(r=ne.prototype).getName=function(){return this.pe},r.getParent=function(){return this.$b},r.pf=function(){return this.uc||(this.uc={}),this.uc},r.Ge=function(t){this.mb=t},r.Qd=function(){return this.mb?this.mb:this.$b?this.$b.Qd():(function(t,e){throw new E("Failure"+(t?": "+t:""),Array.prototype.slice.call(arguments,1
1))}("Root logger has no level set."),null)},r.Pf=function(t){return t.value>=this.Qd().value},r.log=function(t,e,n){this.Pf(t)&&(d(e)&&(e=e()),this.gf(this.uf(t,e,n)))},r.uf=function(t,e,n){return t=new ee(t,String(e),this.pe),n&&t.Bg(n),t},r.ca=function(t,e){this.log(ie,t,e)},r.T=function(t,e){this.log(oe,t,e)},r.info=function(t,e){this.log(ae,t,e)},r.lf=function(t){this.log(ue,t,void 0)},r.gf=function(t){for(var e=this;e;)e.We(t),e=e.getParent()},r.We=function(t){if(this.Zd)for(var e,n=0;e=this.Zd[n];n++)e(t)},r.Fg=function(t){this.$b=t},r.Qe=function(t,e){this.pf()[t]=e};var ce={},le=null;function he(t){var e;if(le||(le=new ne(""),ce[""]=le,le.Ge(se)),!(e=ce[t])){e=new ne(t);var n=t.lastIndexOf("."),r=t.substr(n+1);(n=he(t.substr(0,n))).Qe(r,e),e.Fg(n),ce[t]=e}return e}function fe(t,e){t&&t.info(e,void 0)}function de(t,e){t&&t.lf(e)}function pe(){this.s=he("goog.labs.net.webChannel.WebChannelDebug"),this.Wc=!0}(r=pe.prototype).Id=function(){this.Wc=!1},r.Tg=function(t,e,n,r,i){var o=this;this.info((function(){return"XMLHTTP REQ ("+n+") [attempt "+r+"]: "+t+"\n"+e+"\n"+o.Xf(i)}))},r.Ug=function(t,e,n,r,i,o){this.info((function(){return"XMLHTTP RESP ("+n+") [ attempt "+r+"]: "+t+"\n"+e+"\n"+i+" "+o}))},r.Wa=function(t,e,n){var r=this;this.info((function(){return"XMLHTTP TEXT ("+t+"): "+r.ng(e)+(n?" "+n:"")}))},r.Sg=function(t){this.info((function(){return"TIMEOUT: "+t}))},r.debug=function(t){de(this.s,t)},r.cb=function(t,e){var n=this.s;n&&n.ca(e||"Exception",t)},r.info=function(t){fe(this.s,t)},r.T=function(t){var e=this.s;e&&e.T(t,void 0)},r.ca=function(t){var e=this.s;e&&e.ca(t,void 0)},r.ng=function(t){if(!this.Wc)return t;if(!t)return null;try{var e=JSON.parse(t);if(e)for(var n=0;n<e.length;n++)h(e[n])&&this.Wf(e[n]);return Ut(e)}catch(r){return this.debug("Exception parsing expected JS array - probably was not JS"),t}},r.Wf=function(t){if(!(2>t.length||(t=t[1],!h(t)||1>t.length))){var e=t[0];if("noop"!=e&&"stop"!=e&&"close"!=e)for(e=1;e<t.length;e++)t[e]=""}},r.Xf=function(t){if(!this.Wc)return t;if(!t)return null;var e="";t=t.split("&");for(var n=0;n<t.length;n++){var r=t[n].split("=");if(1<r.length){var i=r[0];r=r[1];var o=i.split("_");e=2<=o.length&&"type"==o[1]?e+(i+"=")+r+"&":e+(i+"=redacted&")}}return e};var me=new Ft;function ye(t){yt.call(this,"serverreachability",t)}function ve(t){me.dispatchEvent(new ye(me,t))}function ge(t,e){yt.call(this,"statevent",t),this.stat=e}function be(t){me.dispatchEvent(new ge(me,t))}function we(t,e,n){yt.call(this,"timingevent",t),this.size=e,this.rtt=n}function _e(t,e){if(!d(t))throw Error("Fn must not be null and must be a function");return a.setTimeout((function(){t()}),e)}S(ye,yt),S(ge,yt),S(we,yt);var Se={NO_ERROR:0,Vg:1,bh:2,ah:3,Yg:4,$g:5,dh:6,Ne:7,TIMEOUT:8,gh:9},Ce={Xg:"complete",kh:"success",Oe:"error",Ne:"abort",ih:"ready",jh:"readystatechange",TIMEOUT:"timeout",eh:"incrementaldata",hh:"progress",Zg:"downloadprogress",lh:"uploadprogress"};function Ee(){}function Te(){}Ee.prototype.pd=null,Ee.prototype.Vd=function(){return this.pd||(this.pd=this.Mf())};var ke,Ie={OPEN:"a",Wg:"b",Oe:"c",fh:"d"};function Oe(){yt.call(this,"d")}function xe(){yt.call(this,"c")}function Ae(){}function Pe(t,e,n,r,i){this.b=t,this.a=e,this.ra=n,this.R=r,this.Xc=i||1,this.Fc=new Zt(this),this.Ua=De,this.Vc=new Yt(t=et?125:void 0),this.A=null,this.S=!1,this.Da=this.pa=this.ua=this.ic=this.qb=this.hd=this.Ga=null,this.ba=[],this.h=null,this.Bb=0,this.I=this.Fa=null,this.w=-1,this.Za=!1,this.Ra=0,this.ac=null,this.lb=this.Ed=this.yc=!1}S(Oe,yt),S(xe,yt),S(Ae,Ee),Ae.prototype.Dd=function(){var t=this.Wd();return t?new ActiveXObject(t):new XMLHttpRequest},Ae.prototype.Mf=function(){var t={};return this.Wd()&&(t[0]=!0,t[1]=!0),t},Ae.prototype.Wd=function(){if(!this.be&&"undefined"==typeof XMLHttpRequest&&"undefined"!=typeof ActiveXObject){for(var t=["MSXML2.XMLHTTP.6.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"],e=0;e<t.length;e++){var n=t[e];try{return new ActiveXObject(n),this.be=n}catch(r){}}throw Error("Could not create ActiveXObject. ActiveX might be disabled, or MSXML might not be installed")}return this.be},ke=new Ae;var De=45e3,Re={},Ne={};function je(t){if(t.H&&"function"==typeof t.H)return t.H();if(s(t))return t.split("");
1if(f(t)){for(var e=[],n=t.length,r=0;r<n;r++)e.push(t[r]);return e}return z(t)}function Me(t,e,n){if(t.forEach&&"function"==typeof t.forEach)t.forEach(e,n);else if(f(t)||s(t))A(t,e,n);else{if(t.W&&"function"==typeof t.W)var r=t.W();else if(t.H&&"function"==typeof t.H)r=void 0;else if(f(t)||s(t)){r=[];for(var i=t.length,o=0;o<i;o++)r.push(o)}else r=H(t);o=(i=je(t)).length;for(var a=0;a<o;a++)e.call(n,i[a],r&&r[a],t)}}function Le(t,e){this.D={},this.o=[],this.j=0;var n=arguments.length;if(1<n){if(n%2)throw Error("Uneven number of arguments");for(var r=0;r<n;r+=2)this.set(arguments[r],arguments[r+1])}else t&&this.addAll(t)}function Fe(t,e){return Object.prototype.hasOwnProperty.call(t,e)}(r=Pe.prototype).ga=function(t){this.A=t},r.setTimeout=function(t){this.Ua=t},r.He=function(t){this.Ra=t},r.Gg=function(t){this.ba=t},r.la=function(){return this.ba},r.kd=function(t,e){this.ic=1,this.ua=t.clone().Ub(),this.Da=e,this.yc=!0,this.Ce(null)},r.jd=function(t,e,n){this.ic=1,this.ua=t.clone().Ub(),this.Da=null,this.yc=e,this.Ce(n)},r.Ce=function(t){this.qb=_(),this.eb(),this.pa=this.ua.clone(),this.pa.dc("t",this.Xc),this.Bb=0,this.h=this.b.Jb(this.b.fc()?t:null),0<this.Ra&&(this.ac=new Jt(b(this.Me,this,this.h),this.Ra)),this.Fc.nb(this.h,"readystatechange",this.mg),t=this.A?$(this.A):{},this.Da?(this.Fa||(this.Fa="POST"),t["Content-Type"]="application/x-www-form-urlencoded",this.h.send(this.pa,this.Fa,this.Da,t)):(this.Fa="GET",this.h.send(this.pa,this.Fa,null,t)),ve(1),this.a.Tg(this.Fa,this.pa,this.R,this.Xc,this.Da)},r.mg=function(t){t=t.target;var e=this.ac;e&&3==t.ma()?(this.a.debug("Throttling readystatechange."),e.mf()):this.Me(t)},r.Me=function(t){try{t==this.h?this.hg():this.a.T("Called back with an unexpected xmlhttp")}catch(n){if(this.a.debug("Failed call to OnXmlHttpReadyStateChanged_"),this.h&&this.h.ya()){var e=this;this.a.cb(n,(function(){return"ResponseText: "+e.h.ya()}))}else this.a.cb(n,"No response text")}},r.hg=function(){var t=this.h.ma(),e=this.h.Ud(),n=this.h.za();if(!(3>t||3==t&&!et&&!this.h.ya())){this.Za||4!=t||7==e||ve(8==e||0>=n?3:2),this.Fb();var r=this.h.za();if(this.w=r,!(e=this.h.ya())){var i=this;this.a.debug((function(){return"No response text for uri "+i.pa+" status "+r}))}if(this.S=200==r,this.a.Ug(this.Fa,this.pa,this.R,this.Xc,t,r),this.S){if(this.Ig()){if(!(n=this.sf()))return this.S=!1,this.I=3,be(12),this.a.T("XMLHTTP Missing X_HTTP_INITIAL_RESPONSE ("+this.R+")"),this.Ia(),void this.Kb();this.a.Wa(this.R,n,"Initial handshake response via X-HTTP-Initial-Response"),this.lb=!0,this.Yc(n)}this.yc?(this.Fd(t,e),et&&this.S&&3==t&&this.Ng()):(this.a.Wa(this.R,e,null),this.Yc(e)),4==t&&this.Ia(),this.S&&!this.Za&&(4==t?this.b.Tc(this):(this.S=!1,this.eb()))}else 400==r&&0<e.indexOf("Unknown SID")?(this.I=3,be(12),this.a.T("XMLHTTP Unknown SID ("+this.R+")")):(this.I=0,be(13),this.a.T("XMLHTTP Bad status "+r+" ("+this.R+")")),this.Ia(),this.Kb()}},r.Ig=function(){return this.Ed&&!this.lb},r.sf=function(){if(this.h){var t=this.h.kb("X-HTTP-Initial-Response");if(t&&!M(t))return t}return null},r.Ag=function(){this.Ed=!0},r.Fd=function(t,e){for(var n=!0;!this.Za&&this.Bb<e.length;){var r=this.vf(e);if(r==Ne){4==t&&(this.I=4,be(14),n=!1),this.a.Wa(this.R,null,"[Incomplete Response]");break}if(r==Re){this.I=4,be(15),this.a.Wa(this.R,e,"[Invalid Chunk]"),n=!1;break}this.a.Wa(this.R,r,null),this.Yc(r)}4==t&&0==e.length&&(this.I=1,be(16),n=!1),this.S=this.S&&n,n||(this.a.Wa(this.R,e,"[Invalid Chunked Response]"),this.Ia(),this.Kb())},r.kg=function(){if(this.h){var t=this.h.ma(),e=this.h.ya();this.Bb<e.length&&(this.Fb(),this.Fd(t,e),this.S&&4!=t&&this.eb())}},r.Ng=function(){this.Fc.nb(this.Vc,"tick",this.kg),this.Vc.start()},r.vf=function(t){var e=this.Bb,n=t.indexOf("\n",e);return-1==n?Ne:(e=Number(t.substring(e,n)),isNaN(e)?Re:(n+=1)+e>t.length?Ne:(t=t.substr(n,e),this.Bb=n+e,t))},r.yg=function(t){this.ic=2,this.ua=t.clone().Ub(),t=!1,a.navigator&&a.navigator.sendBeacon&&(t=a.navigator.sendBeacon(this.ua.toString(),"")),!t&&a.Image&&((new Image).src=this.ua,t=!0),t||(this.h=this.b.Jb(null),this.h.send(this.ua)),this.qb=_(),this.eb()},r.cancel=function(){this.Za=!0,this.Ia()},r.tg=function(t){t&&this.setTimeout(t),this.Ga&&(this.Fb(),this.eb())},r.eb=function(){this.hd=_()+this.Ua,this.Ke(this.Ua)},r.Ke=function(t){if(null!=this.Ga)throw Error("WatchDog timer not null");this.Ga=_e(b(this.gg,this),t)},r.Fb=function(){this.Ga&&(a.clearTimeout(this.Ga),this.Ga=null)},r.gg=function(){this.Ga=null;var t=_();0<=t-this.hd?this.Df():(this.a.T("WatchDog timer called too early"),this.Ke(this.hd-t))},r.Df=function(){this.S&&this.a.ca("Received watchdog timeout even though request loaded successfully"),this.a.Sg(this.pa),2!=this.ic&&(ve(3),be(17)),this.Ia(),this.I=2,this.Kb()},r.Kb=function(){this.b.de()||this.Za||this.b.Tc(this)},r.Ia=function(){this.Fb();var t=this.ac;t&&"function"==typeof t.bb&&t.bb(),this.ac=null,this.Vc.stop(),this.Fc.pb(),this.h&&(t=this.h,this.h=null,t.abort(),t.bb())},r.Hc=function(){return this.I},r.Yc=function(t){try{this.b.ue(this,t),ve(4)}catch(e){this.a.cb(e,"Error in httprequest callback")}},(r=Le.prototype).C=function(){return this.j},r.H=function(){this.wc();for(var t=[],e=0;e<this.o.length;e++)t.push(this.D[this.o[e]]);return t},r.W=function(){return this.wc(),this.o.concat()},r.va=function(t){return Fe(this.D,t)},r.X=function(){return 0==this.j},r.clear=function(){this.D={},this.j=this.o.length=0},r.remove=function(t){return!!Fe(this.D,t)&&(delete this.D[t],this.j--,this.o.length>2*this.j&&this.wc(),!0)},r.wc=function(){if(this.j!=this.o.length){for(var t=0,e=0;t<this.o.length;){var n=this.o[t];Fe(this.D,n)&&(this.o[e++]=n),t++}this.o.length=e}if(this.j!=this.o.length){var r={};for(e=t=0;t<this.o.length;)Fe(r,n=this.o[t])||(this.o[e++]=n,r[n]=1),t++;this.o.length=e}},r.get=function(t,e){return Fe(this.D,t)?this.D[t]:e},r.set=function(t,e){Fe(this.D,t)||(this.j++,this.o.push(t)),this.D[t]=e},r.addAll=function(t){if(t instanceof Le)for(var e=t.W(),n=0;n<e.length;n++)this.set(e[n],t.get(e[n]));else for(e in t)this.set(e,t[e])},r.forEach=function(t,e){for(var n=this.W(),r=0;r<n.length;r++){var i=n[r],o=this.get(i);t.call(e,o,i,this)}},r.clone=function(){return new Le(this)};var Ue=/^(?:([^:/?#.]+):)?(?:\/\/(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\?([^#]*))?(?:#([\s\S]*))?$/;function Ve(t,e){var n;this.xa=this.zb=this.qa="",this.Ca=null,this.ib=this.K="",this.O=this.Qf=!1,t instanceof Ve?(this.O=void 0!==e?e:t.O,this.tb(t.qa),this.cd(t.zb),this.rb(t.xa),this.sb(t.Ca),this.ec(t.K),this.bd(t.P.clone()),this.$c(t.ib)):t&&(n=String(t).match(Ue))?(this.O=!!e,this.tb(n[1]||"",!0),this.cd(n[2]||"",!0),this.rb(n[3]||"",!0),this.sb(n[4]),this.ec(n[5]||"",!0),this.bd(n[6]||"",!0),this.$c(n[7]||"",!0)):(this.O=!!e,this.P=new Qe(null,this.O))}function qe(t,e){return t?e?decodeURI(t.replace(/%25/g,"%2525")):decodeURIComponent(t):""}function Be(t,e,n){return s(t)?(t=encodeURI(t).replace(e,We),n&&(t=t.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),t):null}function We(t){return"%"+((t=t.charCodeAt(0))>>4&15).toString(16)+(15&t).toString(16)}(r=Ve.prototype).toString=function(){var t=[],e=this.qa;e&&t.push(Be(e,ze,!0),":");var n=this.xa;return(n||"file"==e)&&(t.push("//"),(e=this.zb)&&t.push(Be(e,ze,!0),"@"),t.push(encodeURIComponent(String(n)).replace(/%25([0-9a-fA-F]{2}
1)/g,"%$1")),null!=(n=this.Ca)&&t.push(":",String(n))),(n=this.K)&&(this.Ic()&&"/"!=n.charAt(0)&&t.push("/"),t.push(Be(n,"/"==n.charAt(0)?$e:He,!0))),(n=this.Rd())&&t.push("?",n),(n=this.ib)&&t.push("#",Be(n,Ge)),t.join("")},r.resolve=function(t){var e=this.clone(),n=t.Hf();n?e.tb(t.qa):n=t.If(),n?e.cd(t.zb):n=t.Ic(),n?e.rb(t.xa):n=t.Ff();var r=t.K;if(n)e.sb(t.Ca);else if(n=t.ae()){if("/"!=r.charAt(0))if(this.Ic()&&!this.ae())r="/"+r;else{var i=e.K.lastIndexOf("/");-1!=i&&(r=e.K.substr(0,i+1)+r)}if(".."==(i=r)||"."==i)r="";else if(-1!=i.indexOf("./")||-1!=i.indexOf("/.")){r=0==i.lastIndexOf("/",0),i=i.split("/");for(var o=[],a=0;a<i.length;){var s=i[a++];"."==s?r&&a==i.length&&o.push(""):".."==s?((1<o.length||1==o.length&&""!=o[0])&&o.pop(),r&&a==i.length&&o.push("")):(o.push(s),r=!0)}r=o.join("/")}else r=i}return n?e.ec(r):n=t.Gf(),n?e.bd(t.P.clone()):n=t.Ef(),n&&e.$c(t.ib),e},r.clone=function(){return new Ve(this)},r.tb=function(t,e){this.U(),(this.qa=e?qe(t,!0):t)&&(this.qa=this.qa.replace(/:$/,""))},r.Hf=function(){return!!this.qa},r.cd=function(t,e){this.U(),this.zb=e?qe(t):t},r.If=function(){return!!this.zb},r.rb=function(t,e){this.U(),this.xa=e?qe(t,!0):t},r.Ic=function(){return!!this.xa},r.sb=function(t){if(this.U(),t){if(t=Number(t),isNaN(t)||0>t)throw Error("Bad port number "+t);this.Ca=t}else this.Ca=null},r.Ff=function(){return null!=this.Ca},r.ec=function(t,e){this.U(),this.K=e?qe(t,!0):t},r.ae=function(){return!!this.K},r.Gf=function(){return""!==this.P.toString()},r.bd=function(t,e){this.U(),t instanceof Qe?(this.P=t,this.P.ad(this.O)):(e||(t=Be(t,Ke)),this.P=new Qe(t,this.O))},r.Rd=function(){return this.P.toString()},r.getQuery=function(){return this.Rd()},r.l=function(t,e){this.U(),this.P.set(t,e)},r.dc=function(t,e){this.U(),h(e)||(e=[String(e)]),this.P.Ie(t,e)},r.$c=function(t,e){this.U(),this.ib=e?qe(t):t},r.Ef=function(){return!!this.ib},r.Ub=function(){return this.U(),this.l("zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^_()).toString(36)),this},r.removeParameter=function(t){return this.U(),this.P.remove(t),this},r.U=function(){if(this.Qf)throw Error("Tried to modify a read-only Uri")},r.ad=function(t){this.O=t,this.P&&this.P.ad(t)};var ze=/[#\/\?@]/g,He=/[#\?:]/g,$e=/[#\?]/g,Ke=/[#\?@]/g,Ge=/#/g;function Qe(t,e){this.j=this.m=null,this.ja=t||null,this.O=!!e}function Ye(t,e){this.b=t,this.a=e,this.f=this.A=null,this.bc=!1,this.K=null,this.w=-1,this.Ad=this.na=null}function Xe(){this.od=this.$d=null}function Je(t){this.D=new Le,t&&this.addAll(t)}function Ze(t){var e=typeof t;return"object"==e&&t||"function"==e?"o"+(t[m]||(t[m]=++y)):e.substr(0,1)+t}function tn(t,e){this.Pc=t,this.map=e,this.context=null}function en(t){this.me=t||nn,t=a.PerformanceNavigationTiming?0<(t=a.performance.getEntriesByType("navigation")).length&&("hq"==t[0].nextHopProtocol||"h2"==t[0].nextHopProtocol):!!(a.vc&&a.vc.ke&&a.vc.ke()&&a.vc.ke().nh),this.Xb=t?this.me:1,this.v=null,1<this.Xb&&(this.v=new Je),this.f=null,this.ba=[]}(r=Qe.prototype).$=function(){if(!this.m&&(this.m=new Le,this.j=0,this.ja)){var t=this;!function(t,e){if(t){t=t.split("&");for(var n=0;n<t.length;n++){var r=t[n].indexOf("="),i=null;if(0<=r){var o=t[n].substring(0,r);i=t[n].substring(r+1)}else o=t[n];e(o,i?decodeURIComponent(i.replace(/\+/g," ")):"")}}}(this.ja,(function(e,n){t.add(decodeURIComponent(e.replace(/\+/g," ")),n)}))}},r.C=function(){return this.$(),this.j},r.add=function(t,e){this.$(),this.Oa(),t=this.Ma(t);var n=this.m.get(t);return n||this.m.set(t,n=[]),n.push(e),this.j+=1,this},r.remove=function(t){return this.$(),t=this.Ma(t),!!this.m.va(t)&&(this.Oa(),this.j-=this.m.get(t).length,this.m.remove(t))},r.clear=function(){this.Oa(),this.m=null,this.j=0},r.X=function(){return this.$(),0==this.j},r.va=function(t){return this.$(),t=this.Ma(t),this.m.va(t)},r.forEach=function(t,e){this.$(),this.m.forEach((function(n,r){A(n,(function(n){t.call(e,n,r,this)}),this)}),this)},r.W=function(){this.$();for(var t=this.m.H(),e=this.m.W(),n=[],r=0;r<e.length;r++)for(var i=t[r],o=0;o<i.length;o++)n.push(e[r]);return n},r.H=function(t){this.$();var e=[];
1if(s(t))this.va(t)&&(e=N(e,this.m.get(this.Ma(t))));else{t=this.m.H();for(var n=0;n<t.length;n++)e=N(e,t[n])}return e},r.set=function(t,e){return this.$(),this.Oa(),t=this.Ma(t),this.va(t)&&(this.j-=this.m.get(t).length),this.m.set(t,[e]),this.j+=1,this},r.get=function(t,e){return t&&0<(t=this.H(t)).length?String(t[0]):e},r.Ie=function(t,e){this.remove(t),0<e.length&&(this.Oa(),this.m.set(this.Ma(t),j(e)),this.j+=e.length)},r.toString=function(){if(this.ja)return this.ja;if(!this.m)return"";for(var t=[],e=this.m.W(),n=0;n<e.length;n++){var r=e[n],i=encodeURIComponent(String(r));r=this.H(r);for(var o=0;o<r.length;o++){var a=i;""!==r[o]&&(a+="="+encodeURIComponent(String(r[o]))),t.push(a)}}return this.ja=t.join("&")},r.Oa=function(){this.ja=null},r.clone=function(){var t=new Qe;return t.ja=this.ja,this.m&&(t.m=this.m.clone(),t.j=this.j),t},r.Ma=function(t){return t=String(t),this.O&&(t=t.toLowerCase()),t},r.ad=function(t){t&&!this.O&&(this.$(),this.Oa(),this.m.forEach((function(t,e){var n=e.toLowerCase();e!=n&&(this.remove(e),this.Ie(n,t))}),this)),this.O=t},r.extend=function(t){for(var e=0;e<arguments.length;e++)Me(arguments[e],(function(t,e){this.add(e,t)}),this)},S((function(){}),(function(){})),(r=Ye.prototype).g=null,r.ga=function(t){this.A=t},r.connect=function(t){this.K=t,t=this.b.Sd(this.K),be(3);var e=this.b.Ib.$d;null!=e?(this.na=this.b.$a(e[0]),this.g=1,this.xd()):(t.dc("MODE","init"),!this.b.ta&&this.b.aa&&t.dc("X-HTTP-Session-Id",this.b.aa),this.f=new Pe(this,this.a,void 0,void 0,void 0),this.f.ga(this.A),this.f.jd(t,!1,null),this.g=0)},r.xd=function(){this.a.debug("TestConnection: starting stage 2");var t=this.b.Ib.od;if(null!=t)this.a.debug((function(){return"Buffered"})),be(4),t?(be(10),this.b.ub(this,!1)):(be(11),this.b.ub(this,!0));else{this.f=new Pe(this,this.a,void 0,void 0,void 0),this.f.ga(this.A);var e=this.b.Pd(this.na,this.K);be(4),e.dc("TYPE","xmlhttp");var n=this.b.aa,r=this.b.Kc;n&&r&&e.l(n,r),this.f.jd(e,!1,this.na)}},r.Jb=function(t){return this.b.Jb(t)},r.abort=function(){this.f&&(this.f.cancel(),this.f=null),this.w=-1},r.de=function(){return!1},r.ue=function(t,e){if(this.w=t.w,0==this.g)if(this.a.debug("TestConnection: Got data for stage 1"),this.pc(t),e){try{var n=this.b.kc.zc(e)}catch(r){return this.a.cb(r),void this.b.dd(this)}this.na=this.b.$a(n[0])}else this.a.debug("TestConnection: Null responseText"),this.b.dd(this);else 1==this.g&&(this.bc?be(6):"11111"==e?(be(5),this.bc=!0,this.Ze()&&(this.w=200,this.f.cancel(),this.a.debug("Test connection succeeded; using streaming connection"),be(11),this.b.ub(this,!0))):(be(7),this.bc=!1))},r.Tc=function(){this.w=this.f.w,this.f.S?0==this.g?(this.g=1,this.a.debug("TestConnection: request complete for initial check"),this.xd()):1==this.g&&(this.a.debug("TestConnection: request complete for stage 2"),this.bc?(this.a.debug("Test connection succeeded; using streaming connection"),be(11),this.b.ub(this,!0)):(this.a.debug("Test connection failed; not using streaming"),be(10),this.b.ub(this,!1))):(this.a.debug("TestConnection: request failed, in state "+this.g),0==this.g?be(8):1==this.g&&be(9),this.b.dd(this))},r.pc=function(t){if(!this.b.ta&&(t=t.h)){var e=t.kb("X-Client-Wire-Protocol");this.Ad=e||null,this.b.aa&&((t=t.kb("X-HTTP-Session-Id"))?this.b.Fe(t):this.a.T("Missing X_HTTP_SESSION_ID in the handshake response"))}},r.fc=function(){return this.b.fc()},r.Ba=function(){return this.b.Ba()},r.Ze=function(){return!Z||10<=Number(ut)},(r=Je.prototype).C=function(){return this.D.C()},r.add=function(t){this.D.set(Ze(t),t)},r.addAll=function(t){for(var e=(t=je(t)).length,n=0;n<e;n++)this.add(t[n])},r.pb=function(t){for(var e=(t=je(t)).length,n=0;n<e;n++)this.remove(t[n])},r.remove=function(t){return this.D.remove(Ze(t))},r.clear=function(){this.D.clear()},r.X=function(){return this.D.X()},r.contains=function(t){return this.D.va(Ze(t))},r.H=function(){return this.D.H()},r.clone=function(){return new Je(this)};var nn=10;function rn(){this.xg=this.rg=void 0}function on(){this.jg=new rn}function an(t,e,n,r,i){try{t.debug(n),e.onload=null,e.onerror=null,e.onabort=null,e.ontimeout=null,i(r)}catch(o){t.cb(o)}}(r=en.prototype).ld=function(t){this.v||-1==t.indexOf("spdy")&&-1==t.indexOf("quic")&&-1==t.indexOf("h2")||(this.Xb=this.me,this.v=new Je,this.f&&(this.oc(this.f),this.f=null))},r.ee=function(){return!!this.f||!!this.v&&this.v.C()>=this.Xb},r.xf=function(){return this.f?1:this.v?this.v.C():0},r.Jc=function(t){return this.f?this.f==t:!!this.v&&this.v.contains(t)},r.oc=function(t){this.v?this.v.add(t):this.f=t},r.ze=function(t){this.f&&this.f==t?this.f=null:this.v&&this.v.contains(t)&&this.v.remove(t)},r.cancel=function(){this.ba=this.la(),this.f?(this.f.cancel(),this.f=null):this.v&&!this.v.X()&&(A(this.v.H(),(function(t){t.cancel()})),this.v.clear())},r.la=function(){if(null!=this.f)return this.ba.concat(this.f.la());if(null!=this.v&&!this.v.X()){var t=this.ba;return A(this.v.H(),(function(e){t=t.concat(e.la())})),t}return j(this.ba)},r.Re=function(t){this.ba=this.ba.concat(t)},r.$e=function(){this.ba.length=0},rn.prototype.stringify=function(t){return a.JSON.stringify(t,this.rg)},rn.prototype.parse=function(t){return a.JSON.parse(t,this.xg)},on.prototype.hf=function(t,e,n){var r=n||"";try{Me(t,(function(t,n){var i=t;p(t)&&(i=Ut(t)),e.push(r+n+"="+encodeURIComponent(i))}))}catch(i){throw e.push(r+"type="+encodeURIComponent("_badmap")),i}},on.prototype.jf=function(t,e,n){for(var r=-1;;){var i=["count="+e];-1==r?0<e?i.push("ofs="+(r=t[0].Pc)):r=0:i.push("ofs="+r);for(var o=!0,a=0;a<e;a++){var s=t[a].Pc,u=t[a].map;if(0>(s-=r))r=Math.max(0,t[a].Pc-100),o=!1;else try{this.hf(u,i,"req"+s+"_")}catch(c){n&&n(u)}}if(o)return i.join("&")}},on.prototype.zc=function(t){return this.jg.parse(t)};var sn=a.JSON.parse;function un(t){Ft.call(this),this.headers=new Le,this.Xa=t||null,this.ha=!1,this.mc=this.c=null,this.ge=this.Tb="",this.Pa=0,this.I="",this.Aa=this.Lc=this.Qb=this.Ec=!1,this.vb=0,this.hc=null,this.Ae=cn,this.jc=this.lg=this.Ab=!1}S(un,Ft);var cn="";un.prototype.s=he("goog.net.XhrIo");var ln=/^https?$/i,hn=["POST","PUT"];function fn(t){return"content-type"==t.toLowerCase()}function dn(t,e){return{type:e,lengthComputable:t.lengthComputable,loaded:t.loaded,total:t.total}}function pn(t,e,n){t:{for(r in n){var r=!1;break t}r=!0}if(r)return t;if(n=function(t){var e="";return W(t,(function(t,n){e+=n,e+=":",e+=t,e+="\r\n"})),e}(n),s(t)){if(e=encodeURIComponent(String(e)),e+=n=null!=n?"="+encodeURIComponent(String(n)):""){if(0>(n=t.indexOf("#"))&&(n=t.length),0>(r=t.indexOf("?"))||r>n){r=n;var i=""}else i=t.substring(r+1,n);
1n=(t=[t.substr(0,r),i,t.substr(n)])[1],t[1]=e?n?n+"&"+e:e:n,t=t[0]+(t[1]?"?"+t[1]:"")+t[2]}return t}return t.l(e,n),t}function mn(t){this.Bd=22,this.De=0,this.M=[],this.a=new pe,this.Ib=new Xe,this.na=this.md=this.hb=this.K=this.u=this.Kc=this.aa=this.gb=this.N=this.Rb=this.A=null,this.Te=!0,this.ag=this.Yb=0,this.kf=!!u("internalChannelParams.failFast",t),this.fd=this.Ja=this.wa=this.ia=this.ea=this.i=null,this.Se=!0,this.w=this.he=this.Sb=-1,this.rc=this.Ha=this.La=0,this.Ve=u("internalChannelParams.baseRetryDelayMs",t)||5e3,this.vg=u("internalChannelParams.retryDelaySeedMs",t)||1e4,this.nf=u("internalChannelParams.forwardChannelMaxRetries",t)||2,this.Od=u("internalChannelParams.forwardChannelRequestTimeoutMs",t)||2e4,this.Xa=t&&t.oh||void 0,this.Db=void 0,this.Ra=0,this.gc=t&&t.supportsCrossDomainXhr||!1,this.ra="",this.G=new en(t&&t.concurrentRequestLimit),this.kc=new on,this.ta=!t||void 0===t.backgroundChannelTest||t.backgroundChannelTest,(this.Nd=t&&t.fastHandshake||!1)&&!this.ta&&(this.a.T("Force backgroundChannelTest when fastHandshake is enabled."),this.ta=!0),t&&t.Id&&this.a.Id()}function yn(){}function vn(){if(Z&&!(10<=Number(ut)))throw Error("Environmental error: no available transport.")}function gn(t,e){Ft.call(this),this.b=new mn(e),this.yb=t,this.Qg=e&&e.testUrl?e.testUrl:function(t){for(var e=arguments[0],n=1;n<arguments.length;n++){var r,i=arguments[n];0==i.lastIndexOf("/",0)?e=i:((r=""==e)||(r=0<=(r=e.length-1)&&e.indexOf("/",r)==r),e=r?e+i:e+"/"+i)}return e}(this.yb,"test"),this.s=he("goog.labs.net.webChannel.WebChannelBaseTransport"),this.Rc=e&&e.messageUrlParams||null,t=e&&e.messageHeaders||null,e&&e.clientProtocolHeaderRequired&&(t?t["X-Client-Protocol"]="webchannel":t={"X-Client-Protocol":"webchannel"}),this.b.ga(t),t=e&&e.initMessageHeaders||null,e&&e.messageContentType&&(t?t["X-WebChannel-Content-Type"]=e.messageContentType:t={"X-WebChannel-Content-Type":e.messageContentType}),e&&e.zd&&(t?t["X-WebChannel-Client-Profile"]=e.zd:t={"X-WebChannel-Client-Profile":e.zd}),this.b.Eg(t),(t=e&&e.httpHeadersOverwriteParam)&&!M(t)&&this.b.Cg(t),this.Og=e&&e.supportsCrossDomainXhr||!1,this.zg=e&&e.sendRawJson||!1,(e=e&&e.httpSessionIdParam)&&!M(e)&&(this.b.Dg(e),null!==(t=this.Rc)&&e in t&&(e in(t=this.Rc)&&delete t[e],(t=this.s)&&t.T("Ignore httpSessionIdParam also specified with messageUrlParams: "+e,void 0))),this.vd=new _n(this)}function bn(t){Oe.call(this);var e=t.__sm__;if(e){t:{for(var n in e){t=n;break t}t=void 0}(this.ne=t)&&(t=this.ne,e=null!==e&&t in e?e[t]:void 0),this.data=e}else this.data=t}function wn(t){xe.call(this),this.status=1,this.errorCode=t}function _n(t){this.b=t}(r=un.prototype).Je=function(t){this.Ab=t},r.send=function(t,e,n,r){if(this.c)throw Error("[goog.net.XhrIo] Object is active with another request="+this.Tb+"; newUri="+t);e=e?e.toUpperCase():"GET",this.Tb=t,this.I="",this.Pa=0,this.ge=e,this.Ec=!1,this.ha=!0,this.c=this.df(),this.mc=this.Xa?this.Xa.Vd():ke.Vd(),this.c.onreadystatechange=b(this.te,this),this.lg&&"onprogress"in this.c&&(this.c.onprogress=b((function(t){this.re(t,!0)}),this),this.c.upload&&(this.c.upload.onprogress=b(this.re,this)));try{de(this.s,this.da("Opening Xhr")),this.Lc=!0,this.c.open(e,String(t),!0),this.Lc=!1}catch(o){return de(this.s,this.da("Error opening Xhr: "+o.message)),void this.Ld(o)}t=n||"";var i=this.headers.clone();r&&Me(r,(function(t,e){i.set(e,t)})),r=function(t){t:{for(var e=fn,n=t.length,r=s(t)?t.split(""):t,i=0;i<n;i++)if(i in r&&e.call(void 0,r[i],i,t)){e=i;break t}e=-1}return 0>e?null:s(t)?t.charAt(e):t[e]}(i.W()),n=a.FormData&&t instanceof a.FormData,!(0<=O(hn,e))||r||n||i.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8"),i.forEach((function(t,e){this.c.setRequestHeader(e,t)}),this),this.Ae&&(this.c.responseType=this.Ae),"withCredentials"in this.c&&this.c.withCredentials!==this.Ab&&(this.c.withCredentials=this.Ab);try{this.yd(),0<this.vb&&(this.jc=function(t){return Z&&lt(9)&&"number"==typeof t.timeout&&void 0!==t.ontimeout}(this.c),de(this.s,this.da("Will abort after "+this.vb+"ms if incomplete, xhr2 "+this.jc)),this.jc?(this.c.timeout=this.vb,this.c.ontimeout=b(this.Ua,this)):this.hc=Xt(this.Ua,this.vb,this)),de(this.s,this.da("Sending request")),this.Qb=!0,this.c.send(t),this.Qb=!1}catch(o){de(this.s,this.da("Send error: "+o.message)),this.Ld(o)}},r.df=function(){return this.Xa?this.Xa.Dd():ke.Dd()},r.Ua=function(){void 0!==o&&this.c&&(this.I="Timed out after "+this.vb+"ms, aborting",this.Pa=8,de(this.s,this.da(this.I)),this.dispatchEvent("timeout"),this.abort(8))},r.Ld=function(t){this.ha=!1,this.c&&(this.Aa=!0,this.c.abort(),this.Aa=!1),this.I=t,this.Pa=5,this.Jd(),this.Gb()},r.Jd=function(){this.Ec||(this.Ec=!0,this.dispatchEvent("complete"),this.dispatchEvent("error"))},r.abort=function(t){this.c&&this.ha&&(de(this.s,this.da("Aborting")),this.ha=!1,this.Aa=!0,this.c.abort(),this.Aa=!1,this.Pa=t||7,this.dispatchEvent("complete"),this.dispatchEvent("abort"),this.Gb())},r.F=function(){this.c&&(this.ha&&(this.ha=!1,this.Aa=!0,this.c.abort(),this.Aa=!1),this.Gb(!0)),un.L.F.call(this)},r.te=function(){this.Ka||(this.Lc||this.Qb||this.Aa?this.se():this.eg())},r.eg=function(){this.se()},r.se=function(){if(this.ha&&void 0!==o)if(this.mc[1]&&4==this.ma()&&2==this.za())de(this.s,this.da("Local request error detected and ignored"));else if(this.Qb&&4==this.ma())Xt(this.te,0,this);else if(this.dispatchEvent("readystatechange"),this.Mc()){de(this.s,this.da("Request complete")),this.ha=!1;try{this.Rf()?(this.dispatchEvent("complete"),this.dispatchEvent("success")):(this.Pa=6,this.I=this.Yd()+" ["+this.za()+"]",this.Jd())}finally{this.Gb()}}},r.re=function(t,e){this.dispatchEvent(dn(t,"progress")),this.dispatchEvent(dn(t,e?"downloadprogress":"uploadprogress"))},r.Gb=function(t){if(this.c){this.yd();var e=this.c,n=this.mc[0]?c:null;this.mc=this.c=null,t||this.dispatchEvent("ready");try{e.onreadystatechange=n}catch(r){(t=this.s)&&t.ca("Problem encountered resetting onreadystatechange: "+r.message,void 0)}}},r.yd=function(){this.c&&this.jc&&(this.c.ontimeout=null),this.hc&&(a.clearTimeout(this.hc),this.hc=null)},r.Ba=function(){return!!this.c},r.Mc=function(){return 4==this.ma()},r.Rf=function(){var t=this.za();t:switch(t){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var e=!0;break t;default:e=!1}return e||0===t&&!this.Of()},r.Of=function(){var t=String(this.Tb).match(Ue)[1]||null;return!t&&a.self&&a.self.location&&(t=(t=a.self.location.protocol).substr(0,t.length-1)),ln.test(t?t.toLowerCase():"")},r.ma=function(){return this.c?this.c.readyState:0},r.za=function(){try{return 2<this.ma()?this.c.status:-1}catch(X){return-1}},r.Yd=function(){try{return 2<this.ma()?this.c.statusText:""}catch(X){return de(this.s,"Can not get status: "+X.message),""}},r.ya=function(){try{return this.c?this.c.responseText:""}catch(X){return de(this.s,"Can not get responseText: "+X.message),""}},r.yf=function(t){if(this.c){var e=this.c.responseText;return t&&0==e.indexOf(t)&&(e=e.substring(t.length)),sn(e)}},r.getResponseHeader=function(t){if(this.c&&this.Mc())return null===(t=this.c.getResponseHeader(t))?void 0:t},r.getAllResponseHeaders=function(){return this.c&&this.Mc()&&this.c.getAllResponseHeaders()||""},r.kb=function(t){return this.c?this.c.getResponseHeader(t):null},r.Ud=function(){return this.Pa},r.Hc=function(){return s(this.I)?this.I:String(this.I)},r.da=function(t){return t+" ["+this.ge+" "+this.Tb+" "+this.za()+"]"},(r=mn.prototype).tc=8,r.g=1,r.connect=function(t,e,n,r,i){this.a.debug("connect()"),be(0),this.K=e,this.gb=n||{},r&&void 0!==i&&(this.gb.OSID=r,this.gb.OAID=i),this.ta&&(this.a.debug("connect() bypassed channel-test."),this.Ib.$d=[],this.Ib.od=!1),this.bf(t)},r.disconnect=function(){if(this.a.debug("disconnect()"),this.qd(),3==this.g){var t=this.Yb++,e=this.hb.clone();e.l("SID",this.ra),e.l("RID",t),e.l("TYPE","terminate"),this.Ya(e),new Pe(this,this.a,this.ra,t,void 0).yg(e)}this.qe()},r.bf=function(t){this.a.debug("connectTest_()"),this.Ja=new Ye(this,this.a),null===this.N&&this.Ja.ga(this.A);var e=t;this.N&&this.A&&(e=pn(t,this.N,this.A)),this.Ja.connect(e)},r.af=function(){this.a.debug("connectChannel_()"),this.hb=this.Sd(this.K),this.Dc()},r.qd=function(){this.Ja&&(this.Ja.abort(),this.Ja=null),this.u&&(this.u.cancel(),this.u=null),this.ia&&(a.clearTimeout(this.ia),this.ia=null),this.Hb(),this.G.cancel(),this.ea&&(a.clearTimeout(this.ea),this.ea=null)},r.ga=function(t){this.A=t},r.Eg=function(t){this.Rb=t},r.Cg=function(t){this.N=t},r.Dg=function(t){this.aa=t},r.Fe=function(t){this.Kc=t},r.He=function(t){this.Ra=t},r.Hg=function(){this.gc=!0},r.Ee=function(t){this.i=t},r.Nf=function(){return!this.fd},r.Zc=function(t){1e3==this.M.length&&this.a.ca((function(){return"Already have 1000 queued maps upon queueing "+Ut(t)})),this.M.push(new tn(this.ag++,t)),3==this.g&&this.Dc()},r.qf=function(){return this.kf?0:this.nf},r.de=function(){return 0==this.g},r.getState=function(){return this.g},r.Dc=function(){this.G.ee()||this.ea||(this.ea=_e(b(this.we,this),0),this.La=0)},r.Yf=function(t){return this.G.xf()>=this.G.Xb-(this.ea?1:0)?(this.a.ca("Unexpected retry request is scheduled."),!1):this.ea?(this.a.debug("Use the retry request that is already scheduled."),this.M=t.la().concat(this.M),!0):!(1==this.g||2==this.g||this.La>=this.qf()||(this.a.debug("Going to retry POST"),this.ea=_e(b(this.we,this,t),this.Xd(this.La)),this.La++,0))},r.we=function(t){this.ea=null,this.Mg(t)},r.Mg=function(t){this.a.debug("startForwardChannel_"),1==this.g?t?this.a.ca("Not supposed to retry the open"):(this.ig(),this.g=2):3==this.g&&(t?this.le(t):0==this.M.length?this.a.debug("startForwardChannel_ returned: nothing to send"):this.G.ee()?this.a.ca("startForwardChannel_ returned: connection already in progress"):(this.le(),this.a.debug("startForwardChannel_ finished, sent request")))},r.ig=function(){this.a.debug("open_()"),this.Yb=Math.floor(1e5*Math.random());var t=this.Yb++,e=new Pe(this,this.a,"",t,void 0),n=this.A;this.Rb&&(n?G(n=$(n),this.Rb):n=this.Rb),null===this.N&&e.ga(n);var r=this.Hd(e),i=this.hb.clone();i.l("RID",t),0<this.Bd&&i.l("CVER",this.Bd),this.ta&&this.aa&&i.l("X-HTTP-Session-Id",this.aa),this.Ya(i),this.N&&n&&pn(i,this.N,n),this.G.oc(e),this.Nd?(i.l("$req",r),i.l("SID","null"),e.Ag(),e.kd(i,null)):e.kd(i,r)},r.le=function(t){var e=t?t.R:this.Yb++,n=this.hb.clone();n.l("SID",this.ra),n.l("RID",e),n.l("AID",this.Sb),this.Ya(n),this.N&&this.A&&pn(n,this.N,this.A),e=new Pe(this,this.a,this.ra,e,this.La+1),null===this.N&&e.ga(this.A),t&&this.sg(t),t=this.Hd(e),e.setTimeout(
1Math.round(.5*this.Od)+Math.round(.5*this.Od*Math.random())),this.G.oc(e),e.kd(n,t)},r.Ya=function(t){this.i&&Me({},(function(e,n){t.l(n,e)}))},r.Hd=function(t){var e=Math.min(this.M.length,1e3),n=this.i?b(this.i.Ue,this.i,this):null;return n=this.kc.jf(this.M,e,n),t.Gg(this.M.splice(0,e)),n},r.sg=function(t){this.M=t.la().concat(this.M)},r.Kd=function(){if(!this.u&&!this.ia){this.rc=1;var t=this.ve;Wt||function(){if(a.Promise&&a.Promise.resolve){var t=a.Promise.resolve(void 0);Wt=function(){t.then(Qt)}}else Wt=function(){var t=Qt;!d(a.setImmediate)||a.Window&&a.Window.prototype&&!B("Edge")&&a.Window.prototype.setImmediate==a.setImmediate?(Bt||(Bt=function(){var t=a.MessageChannel;if(void 0===t&&"undefined"!=typeof window&&window.postMessage&&window.addEventListener&&!B("Presto")&&(t=function(){var t=document.createElement("IFRAME");t.style.display="none",t.src="",document.documentElement.appendChild(t);var e=t.contentWindow;(t=e.document).open(),t.write(""),t.close();var n="callImmediate"+Math.random(),r="file:"==e.location.protocol?"*":e.location.protocol+"//"+e.location.host;t=b((function(t){"*"!=r&&t.origin!=r||t.data!=n||this.port1.onmessage()}),this),e.addEventListener("message",t,!1),this.port1={},this.port2={postMessage:function(){e.postMessage(n,r)}}}),void 0!==t&&!B("Trident")&&!B("MSIE")){var e=new t,n={},r=n;return e.port1.onmessage=function(){if(void 0!==n.next){var t=(n=n.next).rd;n.rd=null,t()}},function(t){r.next={rd:t},r=r.next,e.port2.postMessage(0)}}return"undefined"!=typeof document&&"onreadystatechange"in document.createElement("SCRIPT")?function(t){var e=document.createElement("SCRIPT");e.onreadystatechange=function(){e.onreadystatechange=null,e.parentNode.removeChild(e),e=null,t(),t=null},document.documentElement.appendChild(e)}:function(t){a.setTimeout(t,0)}}()),Bt(t)):a.setImmediate(t)}}(),Kt||(Wt(),Kt=!0),Gt.add(t,this),this.Ha=0}},r.Qc=function(){return this.u||this.ia?(this.a.ca("Request already in progress"),!1):!(3<=this.Ha||(this.a.debug("Going to retry GET"),this.rc++,this.ia=_e(b(this.ve,this),this.Xd(this.Ha)),this.Ha++,0))},r.ve=function(){this.ia=null,this.Kg()},r.Kg=function(){this.a.debug("Creating new HttpRequest"),this.u=new Pe(this,this.a,this.ra,"rpc",this.rc),null===this.N&&this.u.ga(this.A),this.u.He(this.Ra);var t=this.md.clone();t.l("RID","rpc"),t.l("SID",this.ra),t.l("CI",this.fd?"0":"1"),t.l("AID",this.Sb),this.Ya(t),t.l("TYPE","xmlhttp"),this.N&&this.A&&pn(t,this.N,this.A),this.Db&&this.u.setTimeout(this.Db),this.u.jd(t,!0,this.na),this.a.debug("New Request created")},r.ub=function(t,e){this.a.debug("Test Connection Finished");var n=t.Ad;n&&this.G.ld(n),this.fd=this.Se&&e,this.w=t.w,this.af()},r.dd=function(t){this.a.debug("Test Connection Failed"),this.w=t.w,this.sa(2)},r.ue=function(t,e){if(0!=this.g&&(this.u==t||this.G.Jc(t)))if(this.w=t.w,!t.lb&&this.G.Jc(t)&&3==this.g){try{var n=this.kc.zc(e)}catch(r){n=null}h(n)&&3==n.length?this.Cf(n,t):(this.a.debug("Bad POST response data returned"),this.sa(11))}else(t.lb||this.u==t)&&this.Hb(),M(e)||(n=this.kc.zc(e),this.dg(n,t))},r.Cf=function(t,e){0==t[0]?this.Bf(e):(this.he=t[1],0<(e=this.he-this.Sb)&&(this.a.debug((t=t[2])+" bytes (in "+e+" arrays) are outstanding on the BackChannel"),this.Jg(t)&&!this.wa&&(this.wa=_e(b(this.bg,this),6e3))))},r.Bf=function(t){if(this.a.debug("Server claims our backchannel is missing."),this.ia)this.a.debug("But we are currently starting the request.");else{if(this.u){if(!(this.u.qb+3e3<t.qb))return;this.Hb(),this.u.cancel(),this.u=null}else this.a.T("We do not have a BackChannel established");this.Qc(),be(18)}},r.Jg=function(t){return 37500>t&&!this.Nf()&&0==this.Ha},r.$a=function(t){return this.Te?this.i?this.i.$a(t):t:null},r.bg=function(){null!=this.wa&&(this.wa=null,this.u.cancel(),this.u=null,this.Qc(),be(19))},r.Hb=function(){null!=this.wa&&(a.clearTimeout(this.wa),this.wa=null)},r.Tc=function(t){this.a.debug("Request complete");var e=null;if(this.u==t){this.Hb(),this.u=null;var n=2}else{if(!this.G.Jc(t))return;e=t.la(),this.G.ze(t),n=1}if(this.w=t.w,0!=this.g)if(t.S)1==n?(function(t,e,n){me.dispatchEvent(new we(me,t,e,n))}(t.Da?t.Da.length:0,_()-t.qb,this.La),this.Dc()):this.Kd();else{var r=t.Hc();if(3==r||0==r&&0<this.w)this.a.debug("Not retrying due to error type");else{var i=this;if(this.a.debug((function(){return"Maybe retrying, last error: "+function(t,e){switch(t){case 0:return"Non-200 return code ("+e+")";case 1:return"XMLHTTP failure (no data)";case 2:return"HttpConnection timeout";default:return"Unknown error"}}(r,i.w)})),1==n&&this.Yf(t)||2==n&&this.Qc())return;this.a.debug("Exceeded max number of retries")}switch(e&&0<e.length&&this.G.Re(e),this.a.debug("Error: HTTP request failed"),r){case 1:this.sa(5);break;case 4:this.sa(10);break;case 3:this.sa(6);break;default:this.sa(2)}}},r.Xd=function(t){var e=this.Ve+Math.floor(Math.random()*this.vg);return this.Ba()||(this.a.debug("Inactive channel"),e*=2),e*t}
1,r.pc=function(t){if(this.ta&&(t=t.h)){var e=t.kb("X-Client-Wire-Protocol");e&&this.G.ld(e),this.aa&&((t=t.kb("X-HTTP-Session-Id"))?(this.Fe(t),this.hb.l(this.aa,t)):this.a.T("Missing X_HTTP_SESSION_ID in the handshake response"))}},r.dg=function(t,e){for(var n=this.i&&this.i.sc?[]:null,r=0;r<t.length;r++){var i=t[r];if(this.Sb=i[0],i=i[1],2==this.g)if("c"==i[0]){this.ra=i[1],this.na=this.$a(i[2]);var o=i[3];null!=o&&(this.tc=o,this.a.info("VER="+this.tc)),null!=(o=i[4])&&(this.De=o,this.a.info("SVER="+this.De)),null!=(i=i[5])&&"number"==typeof i&&0<i&&(this.Db=i*=1.5,this.a.info("backChannelRequestTimeoutMs_="+i)),this.pc(e),this.g=3,this.i&&this.i.wd(),this.Lg(e)}else"stop"!=i[0]&&"close"!=i[0]||this.sa(7);else 3==this.g&&("stop"==i[0]||"close"==i[0]?(n&&0!=n.length&&(this.i.sc(this,n),n.length=0),"stop"==i[0]?this.sa(7):this.disconnect()):"noop"!=i[0]&&(n?n.push(i):this.i&&this.i.ud(i)),this.Ha=0)}n&&0!=n.length&&this.i.sc(this,n)},r.Lg=function(t){this.md=this.Pd(this.na,this.K),t.lb?(this.a.debug("Upgrade the handshake request to a backchannel."),this.G.ze(t),t.tg(this.Db),this.u=t):this.Kd()},r.sa=function(t){if(this.a.info("Error code "+t),2==t){var e=null;this.i&&(e=null);var n=b(this.Pg,this);e||(e=new Ve("//www.google.com/images/cleardot.gif"),a.location&&"http"==a.location.protocol||e.tb("https"),e.Ub()),function(t,e){var n=new pe;n.debug("TestLoadImage: loading "+t);var r=new Image;r.onload=w(an,n,r,"TestLoadImage: loaded",!0,e),r.onerror=w(an,n,r,"TestLoadImage: error",!1,e),r.onabort=w(an,n,r,"TestLoadImage: abort",!1,e),r.ontimeout=w(an,n,r,"TestLoadImage: timeout",!1,e),a.setTimeout((function(){r.ontimeout&&r.ontimeout()}),1e4),r.src=t}(e.toString(),n)}else be(2);this.cg(t)},r.Pg=function(t){t?(this.a.info("Successfully pinged google.com"),be(2)):(this.a.info("Failed to ping google.com"),be(1))},r.cg=function(t){this.a.debug("HttpChannel: error - "+t),this.g=0,this.i&&this.i.td(t),this.qe(),this.qd()},r.qe=function(){if(this.g=0,this.w=-1,this.i){var t=this.G.la();if(0!=t.length||0!=this.M.length){var e=this;this.a.debug((function(){return"Number of undelivered maps, pending: "+t.length+", outgoing: "+e.M.length})),this.G.$e(),j(this.M),this.M.length=0}this.i.sd()}},r.Sd=function(t){return t=this.Cd(null,t),this.a.debug("GetForwardChannelUri: "+t),t},r.Pd=function(t,e){return t=this.Cd(this.fc()?t:null,e),this.a.debug("GetBackChannelUri: "+t),t},r.Cd=function(t,e){var n=function(t){return t instanceof Ve?t.clone():new Ve(t,void 0)}(e);if(""!=n.xa)t&&n.rb(t+"."+n.xa),n.sb(n.Ca);else{var r=a.location;n=function(t,e,n,r){var i=new Ve(null,void 0);return t&&i.tb(t),e&&i.rb(e),n&&i.sb(n),r&&i.ec(r),i}(r.protocol,t?t+"."+r.hostname:r.hostname,+r.port,e)}return this.gb&&W(this.gb,(function(t,e){n.l(e,t)})),e=this.Kc,(t=this.aa)&&e&&n.l(t,e),n.l("VER",this.tc),this.Ya(n),n},r.Jb=function(t){if(t&&!this.gc)throw Error("Can't create secondary domain capable XhrIo object.");return(t=new un(this.Xa)).Je(this.gc),t},r.Ba=function(){return!!this.i&&this.i.Ba()},r.fc=function(){return this.gc},(r=yn.prototype).sc=null,r.wd=function(){},r.ud=function(){},r.td=function(){},r.sd=function(){},r.Ba=function(){return!0},r.Ue=function(){},r.$a=function(t){return t},vn.prototype.cf=function(t,e){return new gn(t,e)},S(gn,Ft),(r=gn.prototype).addEventListener=function(t,e,n,r){gn.L.addEventListener.call(this,t,e,n,r)},r.removeEventListener=function(t,e,n,r){gn.L.removeEventListener.call(this,t,e,n,r)},r.open=function(){this.b.Ee(this.vd),this.Og&&this.b.Hg(),this.b.connect(this.Qg,this.yb,this.Rc||void 0)},r.close=function(){this.b.disconnect()},r.send=function(t){if(s(t)){var e={};e.__data__=t,this.b.Zc(e)}else this.zg?((e={}).__data__=Ut(t),this.b.Zc(e)):this.b.Zc(t)},r.F=function(){this.b.Ee(null),delete this.vd,this.b.disconnect(),delete this.b,gn.L.F.call(this)},S(bn,Oe),S(wn,xe),S(_n,yn),_n.prototype.wd=function(){fe(this.b.s,"WebChannel opened on "+this.b.yb),this.b.dispatchEvent("a")},_n.prototype.ud=function(t){this.b.dispatchEvent(new bn(t))},_n.prototype.td=function(t){fe(this.b.s,"WebChannel aborted on "+this.b.yb+" due to channel error: "+t),this.b.dis
1patchEvent(new wn(t))},_n.prototype.sd=function(){fe(this.b.s,"WebChannel closed on "+this.b.yb),this.b.dispatchEvent("b")};var Sn=w((function(t,e){function n(){}n.prototype=t.prototype;var r=new n;return t.apply(r,Array.prototype.slice.call(arguments,1)),r}),vn);function Cn(){this.V=[],this.Z=[]}function En(t,e){if(T.call(this),this.oe=t||0,this.Wb=e||10,this.oe>this.Wb)throw Error(Tn);this.fa=new Cn,this.oa=new Je,this.Ac=0,this.Nc=null,this.Cb()}(r=Cn.prototype).Vf=function(){0==this.V.length&&(this.V=this.Z,this.V.reverse(),this.Z=[])},r.enqueue=function(t){this.Z.push(t)},r.ab=function(){return this.Vf(),this.V.pop()},r.C=function(){return this.V.length+this.Z.length},r.X=function(){return 0==this.V.length&&0==this.Z.length},r.clear=function(){this.V=[],this.Z=[]},r.contains=function(t){return 0<=O(this.V,t)||0<=O(this.Z,t)},r.remove=function(t){var e=this.V,n=x(e,t);return 0<=n?(Array.prototype.splice.call(e,n,1),e=!0):e=!1,e||R(this.Z,t)},r.H=function(){for(var t=[],e=this.V.length-1;0<=e;--e)t.push(this.V[e]);var n=this.Z.length;for(e=0;e<n;++e)t.push(this.Z[e]);return t},S(En,T);var Tn="[goog.structs.Pool] Min can not be greater than max";function kn(t,e){this.fe=t,this.gd=e}function In(t){this.Y=[],t&&this.Lf(t)}function On(){In.call(this)}function xn(t,e){this.Gd=void 0,this.cc=new On,En.call(this,t,e)}function An(t,e,n,r){this.Jf=t,this.Ab=!!r,xn.call(this,e,n)}(r=En.prototype).Mb=function(){var t=_();if(!(null!=this.Nc&&t-this.Nc<this.Ac)){var e=this.qg();return e&&(this.Nc=t,this.oa.add(e)),e}},r.og=function(t){return!!this.oa.remove(t)&&(this.nc(t),!0)},r.qg=function(){for(var t;0<this.Td()&&(t=this.fa.ab(),!this.Sc(t));)this.Cb();return!t&&this.C()<this.Wb&&(t=this.xc()),t},r.nc=function(t){this.oa.remove(t),this.Sc(t)&&this.C()<this.Wb?this.fa.enqueue(t):this.Bc(t)},r.Cb=function(){for(var t=this.fa;this.C()<this.oe;)t.enqueue(this.xc());for(;this.C()>this.Wb&&0<this.Td();)this.Bc(t.ab())},r.xc=function(){return{}},r.Bc=function(t){if("function"==typeof t.bb)t.bb();else for(var e in t)t[e]=null},r.Sc=function(t){return"function"!=typeof t.Ye||t.Ye()},r.contains=function(t){return this.fa.contains(t)||this.oa.contains(t)},r.C=function(){return this.fa.C()+this.oa.C()},r.rf=function(){return this.oa.C()},r.Td=function(){return this.fa.C()},r.X=function(){return this.fa.X()&&this.oa.X()},r.F=function(){if(En.L.F.call(this),0<this.rf())throw Error("[goog.structs.Pool] Objects not released");delete this.oa;for(var t=this.fa;!t.X();)this.Bc(t.ab());delete this.fa},kn.prototype.getKey=function(){return this.fe},kn.prototype.clone=function(){return new kn(this.fe,this.gd)},(r=In.prototype).ce=function(t,e){var n=this.Y;n.push(new kn(t,e)),this.$f(n.length-1)},r.Lf=function(t){if(t instanceof In){var e=t.W();if(t=t.H(),0>=this.C()){for(var n=this.Y,r=0;r<e.length;r++)n.push(new kn(e[r],t[r]));return}}else e=H(t),t=z(t);for(r=0;r<e.length;r++)this.ce(e[r],t[r])},r.remove=function(){var t=this.Y,e=t.length,n=t[0];if(!(0>=e))return 1==e?D(t):(t[0]=t.pop(),this.Zf()),n.gd},r.Zf=function(){for(var t=0,e=this.Y,n=e.length,r=e[t];t<n>>1;){var i=this.tf(t),o=this.zf(t);if(i=o<n&&e[o].getKey()<e[i].getKey()?o:i,e[i].getKey()>r.getKey())break;e[t]=e[i],t=i}e[t]=r},r.$f=function(t){for(var e=this.Y,n=e[t];0<t;){var r=this.wf(t);if(!(e[r].getKey()>n.getKey()))break;e[t]=e[r],t=r}e[t]=n},r.tf=function(t){return 2*t+1},r.zf=function(t){return 2*t+2},r.wf=function(t){return t-1>>1},r.H=function(){for(var t=this.Y,e=[],n=t.length,r=0;r<n;r++)e.push(t[r].gd);return e},r.W=function(){for(var t=this.Y,e=[],n=t.length,r=0;r<n;r++)e.push(t[r].getKey());return e},r.va=function(t){return P(this.Y,(function(e){return e.getKey()==t}))},r.clone=function(){return new In(this)},r.C=function(){return this.Y.length},r.X=function(){return 0==this.Y.length},r.clear=function(){D(this.Y)},S(On,In),On.prototype.enqueue=function(t,e){this.ce(t,e)},On.prototype.ab=function(){return this.remove()},S(xn,En),(r=xn.prototype).Mb=function(t,e){if(!t)return(t=xn.L.Mb.call(this))&&this.Ac&&(this.Gd=a.setTimeout(b(this.Nb,this),this.Ac)),t;this.cc.enqueue(void 0!==e?e:100,t),this.Nb()},r.Nb=function(){for(var t=this.cc;0<t.C();){var e=this.Mb();if(!e)break;t.ab().apply(this,[e])}},r.nc=function(t){xn.L.nc.call(this,t),this.Nb()},r.Cb=function(){xn.L.Cb.call(this),this.Nb()},r.F=function(){xn.L.F.call(this),a.clearTimeout(this.Gd),this.cc.clear(),this.cc=null},S(An,xn),An.prototype.xc=function(){var t=new un,e=this.Jf;return e&&e.forEach((function(e,n){t.headers.set(n,e)})),this.Ab&&t.Je(!0),t},An.prototype.Sc=function(t){return!t.Ka&&!t.Ba()},vn.prototype.createWebChannel=vn.prototype.cf,gn.prototype.send=gn.prototype.send,gn.prototype.open=gn.prototype.open,gn.prototype.close=gn.prototype.close,Se.NO_ERROR=0,Se.TIMEOUT=8,Se.HTTP_ERROR=6,Ce.COMPLETE="complete",Te.EventType=Ie,Ie.OPEN="a",Ie.CLOSE="b",Ie.ERROR="c",Ie.MESSAGE="d",Ft.prototype.listen=Ft.prototype.nb,An.prototype.getObject=An.prototype.Mb,An.prototype.releaseObject=An.prototype.og,un.prototype.listenOnce=un.prototype.Oc,un.prototype.getLastError=un.prototype.Hc,un.prototype.getLastErrorCode=un.prototype.Ud,un.prototype.getStatus=un.prototype.za,un.prototype.getStatusText=un.prototype.Yd,un.prototype.getResponseJson=un.prototype.yf,un.prototype.getResponseText=un.prototype.ya,un.prototype.getResponseText=un.prototype.ya,un.prototype.send=un.prototype.send;var Pn={createWebChannelTransport:Sn,ErrorCode:Se,EventType:Ce,WebChannel:Te,XhrIoPool:An},Dn=Pn.createWebChannelTransport,Rn=Pn.ErrorCode,Nn=Pn.EventType,jn=Pn.WebChannel,Mn=Pn.XhrIoPool;e.default=Pn},xGvh:function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},xMyE:function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r=n("mrSG"),i=n("FFOo"),o=n("+umK"),a=n("2Bdj");function s(t,e,n){return function(r){return r.lift(new u(t,e,n))}}var u=function(){function t(t,e,n){this.nextOrObserver=t,this.error=e,this.complete=n}return t.prototype.call=function(t,e){return e.subscribe(new c(t,this.nextOrObserver,this.error,this.complete))},t}(),c=function(t){function e(e,n,r,i){var s=t.call(this,e)||this;return s._tapNext=o.a,s._tapError=o.a,s._tapComplete=o.a,s._tapError=r||o.a,s._tapComplete=i||o.a,Object(a.a)(n)?(s._context=s,s._tapNext=n):n&&(s._context=n,s._tapNext=n.next||o.a,s._tapError=n.error||o.a,s._tapComplete=n.complete||o.a),s}return r.d(e,t),e.prototype._next=function(t){try{this._tapNext.call(this._context,t)}catch(e){return void this.destination.error(e)}this.destination.next(t)},e.prototype._error=function(t){try{this._tapError.call(this._context,t)}catch(t){return void this.destination.error(t)}this.destination.error(t)},e.prototype._complete=function(){try{this._tapComplete.call(this._context)}catch(t){return void this.destination.error(t)}return this.destination.complete()},e}(i.a)},xTla:function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r="function"==typeof Symbol&&Symbol.observable||"@@observable"},xXNJ:function(t,e,n){"use strict";n.d(e,"b",(function(){return r})),n.d(e,"c",(function(){return i})),n.d(e,"d",(function(){return o}
1)),n.d(e,"a",(function(){return a}));var r=function(){function t(){this.emailstr=""}return t.prototype.reset=function(){this.emailstr=""},t}(),i=function(){function t(){this.login=!1}return t.prototype.reset=function(){return this.login=!1,this},t}(),o=function(){function t(){this.shopid=""}return t.prototype.reset=function(){this.shopid=""},t}(),a=function(){function t(){this.login=!1,this.isEmailAuth=!1}return t.prototype.reset=function(){return this.login=!1,this.isEmailAuth=!1,this},t}()},xdv0:function(t,e,n){"use strict";n.d(e,"a",(function(){return p})),n("CqG3"),n("Oipj");var r=n("xXNJ"),i=n("K9Ia"),o=n("67Y/"),a=n("iqUP"),s=(n("5x/H"),n("AytR")),u=n("CcnG"),c=n("fvl4"),l=n("ZBkt"),h=n("ZYCi"),f=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(e){o(e)}}function s(t){try{u(r.throw(t))}catch(e){o(e)}}function u(t){t.done?i(t.value):new n((function(e){e(t.value)})).then(a,s)}u((r=r.apply(t,e||[])).next())}))},d=function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=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 a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},p=function(){function t(t,e,n){this.afs=t,this.afAuth=e,this.router=n,this.session=new r.c,this.sessionSubject=ne
1w i.a,this.sessionState=this.sessionSubject.asObservable(),this.applsession=new r.a,this.applsessionSubject=new i.a,this.applsessionState=this.applsessionSubject.asObservable(),this.shopid=new r.d,this.paymentUrl="https://gw.ccps.jp/payment.aspx",this.paymentBody=null,this.paymentSid=s.a.paymentId,this.paymentSvid="1",this.paymentPtype="8",this.paymentJob="CAPTURE",this.paymentRt="1",this.paymentsicd1="branch_membership_black_card",this.paymentsicd2="branch_anual_menbership",this.paymentsicd3="",this.paymentSucd="00001",this.newPaymentID=s.a.newPaymentID,this.newApplID=s.a.applid.join(""),this.baseUrl=s.a.baseUrl,this.itemsCollection=this.afs.collection("user"),this.resultCollection=this.afs.collection("creditResult"),this.tentativeitemsCollection=this.afs.collection("tentativeUser"),this.regularCollection=this.afs.collection("regularUser"),this.applCollection=this.afs.collection("ApplTentativeUser"),this.logCollection=this.afs.collection("logUser")}return t.prototype.login=function(){this.session.login=!0,this.sessionSubject.next(this.session),this.router.navigate(["/tabs/secure-join"])},t.prototype.logout=function(){var t=this;this.afAuth.auth.signOut().then((function(){t.sessionSubject.next(t.session.reset())})).then((function(){return alert("\u30ed\u30b0\u30a2\u30a6\u30c8\u3057\u307e\u3057\u305f\u3002")})).catch((function(t){console.log(t),alert("\u30ed\u30b0\u30a2\u30a6\u30c8\u306b\u5931\u6557\u3057\u307e\u3057\u305f\u3002\n"+t)}))},t.prototype.addUser2Fire=function(){var t=this;return new Promise((function(e,n){t.afAuth.auth.signInAnonymously().catch((function(t){n(t)})).then((function(){t.afAuth.auth.onAuthStateChanged((function(t){if(t)return console.log(t.uid),!0;n("user is logout")}))})).then((function(){return t.getCustomerNo()})).then((function(e){return t.shopCustomerNo=e})).then((function(){return t.uid=t.afs.createId()})).then((function(e){var n={memberrank:t.memberrank,memberrankname:t.memberrankname,adr1:t.adr1,birthday:t.birthday,cardkey:t.cardkey,cardkeyDspValue:t.cardkeyDspValue,cardname:t.cardname,email:t.email,introducer:t.introducer,job:t.job,position:t.position,sex:t.sexDspValue,tel1:t.tel1,userkana1:t.userkana1,username1:t.username1,zipcd:t.zipcd,shopcd:t.shopcd,shopname:t.shopname,memberFee:t.nvl(t.memberFee,""),insDt:a.firestore.FieldValue.serverTimestamp(),uid:t.uid,shopCustomerNo:t.shopCustomerNo,creditPid:null};return t.itemsCollection.doc(e).set(n)})).then((function(t){e()})).catch((function(t){n(t)}))}))},t.prototype.addUser2Fire20190327=function(){var t=this;return new Promise((function(e,n){t.afAuth.auth.signInAnonymously().catch((function(t){n(t)})).then((function(){return t.afAuth.auth.onAuthStateChanged((function(t){if(t)return console.log(t.uid),!0;n("user is logout")}))})).then((function(){return t.getTentativeNo()})).then((function(e){return t.TentativeNo=e})).then((function(){return t.uid=t.afs.createId()})).then((function(){return console.log("processPayment"),t.processPayment20190327()})).then((function(e){t.creditUrl=e;var n={memberrank:t.memberrank,memberrankname:t.memberrankname,cardkey:t.cardkey,cardkeyDspValue:t.cardkeyDspValue,email:t.email,tel1:t.tel1,shopcd:t.shopcd,shopname:t.shopname,insDt:a.firestore.FieldValue.serverTimestamp(),uid:t.uid,TentativeNo:t.TentativeNo,creditUrl:t.creditUrl,regularMember:!1};return t.tentativeitemsCollection.doc(t.uid).set(n)})).then((function(t){e()})).catch((function(t){n(t)}))}))},t.prototype.addApplUser2Fire=function(){var t=this;return new Promise((function(e,n){t.afAuth.authState.subscribe((function(r){console.log(r.uid),t.uid=r.uid,t.processApplPayment().then((function(e){t.creditUrl=e;var n={memberrank:t.memberrank,memberrankname:t.memberrankname,adr1:t.adr1,birthday:t.birthday,email:t.email,introducer:t.introducer,job:t.job,position:t.position,sex:t.sexDspValue,tel1:t.tel1,userkana1:t.userkana1,username1:t.username1,zipcd:t.zipcd,shopcd:t.shopcd,shopname:t.shopname,insDt:a.firestore.FieldValue.serverTimestamp(),uid:r.uid,creditPid:null,creditUrl:t.creditUrl,regularMember:!1,cancel:!1,cancelDt:null,applShopId:t.applShopId,applShopName:t.applShopName};return t.applCollection.doc(r.uid).set(n)})).then((function(t){e()})).catch((function(t){n(t)}))}))}))},t.prototype.signInAnonymous=function(){var t=this;return new Promise((function(e,n){t.afAuth.auth.currentUser?e():t.afAuth.auth.signInAnonymously().then((function(){e()})).catch((function(t){console.error(t),n()}))}))},t.prototype.signInAnonymous2=function(){var t=this;return new Promise((function(e,n){t.afAuth.auth.onAuthStateChanged((function(r){r?e():t.afAuth.auth.signInAnonymously().then((function(){e()})).catch((function(t){console.error(t),n()}))}))}))},t.prototype.usersignOut=function(){var t=this;return new Promise((function(e,n){t.afAuth.auth.signOut().then((function(){e()})).catch((function(){e()}))}))},t.prototype.addRegularUser2Fire=function(){var t=this;return new Promise((function(e,n){t.signInAnonymous().then((function(){return t.getCustomerNo()})).then((function(e){return t.shopCustomerNo=e})).then((function(){var e={memberrank:t.memberrank,memberrankname:t.memberrankname,adr1:t.adr1,birthday:t.birthday,cardkey:t.cardkey,cardkeyDspValue:t.cardkeyDspValue,cardname:t.cardname,email:t.email,introducer:t.introducer,job:t.job,position:t.position,sex:t.sexDspValue,tel1:t.tel1,userkana1:t.userkana1,username1:t.username1,zipcd:t.zipcd,shopcd:t.shopcd,shopname:t.shopname,memberFee:t.nvl(t.memberFee,""),insDt:a.firestore.FieldValue.serverTimestamp(),uid:t.uid,shopCustomerNo:t.shopCustomerNo,creditPid:t.creditPid,cancel:!1};return t.regularCollection.doc(t.uid).set(e)})).then((function(t){e()})).catch((function(t){n(t)}))}))},t.prototype.sendUserJoinMail=function(t){return f(this,void 0,void 0,(function(){var e;return d(this,(function(n){switch(n.label){case 0:return e="localhost"===(e=window.location.hostname)?"http://"+(e+=":8100"):"https://"+e,[4,this.afAuth.auth.sendSignInLinkToEmail(t.emailstr,{url:e+="/kumamember/appl-confirm-join2",handleCodeInApp:!0}).then((function(){window.localStorage.setItem("emailForSignIn",t.emailstr)})).catch((function(t){console.log(t)}))];case 1:return[2,n.sent()]}}))}))},t.prototype.checkAuthMailLogin=function(){var t=this;return new Promise((function(e,n){if(t.afAuth.auth.isSignInWithEmailLink(window.location.href)){var r=window.localStorage.getItem("emailForSignIn");r||n(),t.afAuth.auth.signInWithEmailLink(r,window.location.href).then((function(t){window.localStorage.removeItem("emailForSignIn"),e()})).catch((function(t){n()}))}else n()}))},t.prototype.checkLogin=function(){var t=this;this.afAuth.authState.subscribe((function(e){t.session.login=!!e,t.sessionSubject.next(t.session)}))},t.prototype.checkLoginState=function(){var t=this;return this.afAuth.authState.pipe(Object(o.a)((function(e){return t.session.login=!!e,t.session})))},t.prototype.checkEmailLoginState=function(){var t=this;return this.afAuth.authState.pipe(Object(o.a)((function(e){return e?(console.log(e),e.emailVerified?(t.applsession.login=!0,t.applsession.isEmailAuth=e.emailVerified):(t.applsession.login=!1,t.applsession.isEmailAuth=e.emailVerified)):(t.applsession.login=!1,t.applsession.isEmailAuth=e.emailVerified),t.applsession})))},t.prototype.isEmailLogin=function(){return f(this,void 0,void 0,(function(){return d(this,(function(t){return[2,this.checkEmailLoginState().toPromise().then((function(t){return t.isEmailAuth})).catch((function(t){return Promise.reject(!1)}))]}))}))},t.prototype.checkShopState=function(){return this.shopid},t.prototype.initClientUser=function(){this.adr1="",this.birthday="",this.cardkey=!1,this.cardkeyDspValue="",this.cardname="",this.introducer="",this.job="",this.memberrank="",this.memberrankname="",this.position="",this.sex="",this.tel1="",this.userkana1="",this.username1="",this.zipcd="",this.shopcd="",this.shopname="",this.memberFee="N",this.uid="",this.shopCustomerNo=""},t.prototype.initClientUser2=function(){var t=this;return new Promise((function(e,n){t.adr1="",t.birthday="",t.cardkey=!1,t.cardkeyDspValue="",t.cardname="",t.introducer="",t.job="",t.memberrank="",t.memberrankname="",t.position="",t.sex="",t.tel1="",t.userkana1="",t.username1="",t.zipcd="",t.shopcd="",t.shopname="",t.memberFee="N",t.uid="",t.shopCustomerNo="",e(!0)}))},t.prototype.getCustomerNo=function(){var t=this;return new Promise((function(e,n){var r=t.shopcd;"106"===t.shopcd&&(r="flagship");var i,o=t.afs.firestore.collection("membercount").doc(r);t.afs.firestore.runTransaction((function(t){return t.get(o).then((function(e){return e.exists||n("MemberCount does not exist!"),i=e.data().cnt+1,t.update(o,{cnt:i}),i})).catch((function(t){console.log(t)}))}
1)).then((function(n){var r="";"gion"===t.shopcd?r="GS/":"kitashinchi"===t.shopcd?r="KS/":"flagship"===t.shopcd?r="TR/":"nagoya"===t.shopcd?r="NS/":"hanare"===t.shopcd?r="HR/":"nakameguro"===t.shopcd?r="NM/":"okinawa"===t.shopcd?r="ON/":"106"===t.shopcd&&(r="TR/"),r+=t.zeroPadding(n,6),e(r)})).catch((function(t){console.log("snc error"),n(t)}))}))},t.prototype.getTentativeNo=function(){var t=this;return new Promise((function(e,n){var r,i=t.afs.firestore.collection("membercount").doc("tentative");t.afs.firestore.runTransaction((function(t){return t.get(i).then((function(e){return e.exists||n("MemberCount does not exist!"),r=e.data().cnt+1,t.update(i,{cnt:r}),r}))})).then((function(n){var r;r=t.zeroPadding(n,8),e(r)})).catch((function(t){console.log("snc error"),n(t)}))}))},t.prototype.zeroPadding=function(t,e){return("0000000000"+t).slice(-e)},t.prototype.setShopCd=function(t){var e;switch(t){case"flagship":case"gion":case"kitashinchi":case"nagoya":case"hanare":case"nakameguro":case"okinawa":case"appl":case"106":e=t}this.shopcd=e,this.shopid.shopid=e},t.prototype.setShopName=function(){var t;switch(this.shopcd){case"flagship":t="106";break;case"gion":t="\u4eac\u90fd\u7947\u5712\u767d\u5ddd";break;case"kitashinchi":t="\u5317\u65b0\u5730";break;case"nagoya":t="\u540d\u53e4\u5c4b";break;case"hanare":t="\u718a\u30ce\u82b1\u30ec";break;case"nakameguro":t="\u4e2d\u76ee\u9ed2";break;case"okinawa":t="\u6c96\u7e04";break;case"appl":t="\u30a2\u30d7\u30ea\u4f1a\u54e1";break;case"106":t="106"}this.shopname=t},t.prototype.setCreditResult=function(t,e,n){var r=this;return new Promise((function(i,o){0===t.length&&o("no parameter");var s=n.split("/");r.afAuth.auth.signInAnonymously().catch((function(t){o(t)})).then((function(){return r.afAuth.auth.onAuthStateChanged((function(t){if(t)return!0;o("user is logout")}))})).then((function(){var n={uid:s[2],shopCustomerNo:s[0]+"/"+s[1],result:t,pid:e,insDt:a.firestore.FieldValue.serverTimestamp()};return r.resultCollection.doc(s[2]).set(n)})).then((function(){i(!0)})).catch((function(t){o(t)}))}))},t.prototype.nvl=function(t,e){return null==t?e:t},t.prototype.processPayment20190327=function(){var t=this;return new Promise((function(e,n){t.paymentSod=t.TentativeNo+"/"+t.uid,t.paymentMail=t.email,t.paymentTel=t.tel1.replace(/-/g,""),t.paymentUid=t.uid,"flagship"===t.shopid.shopid||"106"===t.shopid.shopid?t.paymentsicd1="Premium_Black_Membership":"nakameguro"===t.shopid.shopid?t.paymentsicd1="black"===t.memberrank?"Premium_Black_Membership":"gold"===t.memberrank?"Gold_Nakameguro_Membership":"Beginner_Nakameguro_Membership":"okinawa"===t.shopid.shopid?t.paymentsicd1="black"===t.memberrank?"Premium_Black_Membership":"gold"===t.memberrank?"Gold_Okinawa_Membership":"Beginner_Okinawa_Membership":"gion"===t.shopid.shopid?"black"===t.memberrank?t.paymentsicd1="Premium_Black_Membership":"giongold"===t.memberrank&&(t.paymentsicd1="Gold_Gion_Membership"):t.paymentsicd1="black"===t.memberrank?"Premium_Black_Membership":"gold"===t.memberrank?"Gold_Membership":"Beginner_Membership",t.cardkey&&(t.paymentsicd3="flagship_card_tax10"),t.paymentsicd2="anual_menbership3_tax10",t.paymentPtype="appl"===t.shopid.shopid?"8":"3";var r="https://checkout.univapay.com/forms/"+t.newPaymentID+"?appId="+t.newApplID,i=t.paymentsicd1;null!=t.paymentsicd2&&""!==t.paymentsicd2&&(i=i+","+t.paymentsicd2),null!=t.paymentsicd3&&""!==t.paymentsicd3&&(i=i+","+t.paymentsicd3),r=r+"&productCodes="+i,e(r=(r=(r=(r=(r=(r=(r=(r=(r=(r+="&productQuantities=1")+"&emailAddress="+t.paymentMail)+"&phoneNumber="+t.paymentTel)+"&name="+t.username1)+"&nameKana="+t.userkana1)+"&sod="+t.paymentSod)+"&successRedirectUrl="+t.baseUrl+"kumamember/endpayment?result=1&pid=0000000&sod="+t.paymentSod)+"&failureRedirectUrl="+t.baseUrl+"kumamember/appl-leave-credit-error")+"&uid="+t.paymentUid)+"&shopid="+t.shopid.shopid)}))},t.prototype.getTentativeUser=function(t){return f(this,void 0,void 0,(function(){return d(this,(function(t){return[2]}))}))},t.prototype.processApplPayment=function(){var t=this;return new Promise((function(e,n){t.paymentSod=t.uid,t.paymentMail=t.email,t.paymentTel=t.tel1.replace(/-/g,""),t.paymentUid=t.uid,t.paymentsicd1="black"===t.memberrank?"Premium_Black_Membership":"gold"===t.memberrank?"Gold_Appl_Membership":"gi
1ongold"===t.memberrank?"Gold_Gion_Appl_Membership":"Beginner_Appl_Membership",t.paymentsicd2="anual_menbership3_tax10",t.paymentPtype="8";var r="https://checkout.univapay.com/forms/"+t.newPaymentID+"?appId="+t.newApplID,i=t.paymentsicd1;null!=t.paymentsicd2&&""!==t.paymentsicd2&&(i=i+","+t.paymentsicd2),null!=t.paymentsicd3&&""!==t.paymentsicd3&&(i=i+","+t.paymentsicd3),r=r+"&productCodes="+i,e(r=(r=(r=(r=(r=(r=(r=(r=(r+="&productQuantities=1")+"&emailAddress="+t.paymentMail)+"&phoneNumber="+t.paymentTel)+"&nameKana="+t.userkana1)+"&sod="+t.paymentSod)+"&successRedirectUrl="+t.baseUrl+"kumamember/endpayment?result=1&pid=0000000&sod="+t.paymentSod)+"&failureRedirectUrl="+t.baseUrl+"kumamember/appl-leave-credit-error")+"&uid="+t.paymentUid)+"&shopid="+t.shopid.shopid)}))},t.prototype.getAuthEmail=function(){var t=this;return new Promise((function(e,n){return t.afAuth.auth.onAuthStateChanged((function(t){return e(t.email)}))}))},t.prototype.getAuthUid=function(){var t=this;return new Promise((function(e,n){return t.afAuth.auth.onAuthStateChanged((function(t){return e(t.uid)}))}))},t.prototype.addUser2logFire=function(){var t=this;return new Promise((function(e,n){var r={memberrank:t.memberrank,memberrankname:t.memberrankname,adr1:t.adr1,birthday:t.birthday,cardkey:t.cardkey,cardkeyDspValue:t.cardkeyDspValue,cardname:t.cardname,email:t.nvl(t.email,""),introducer:t.introducer,job:t.job,position:t.position,sex:t.sexDspValue,tel1:t.tel1,userkana1:t.userkana1,username1:t.username1,zipcd:t.zipcd,shopcd:t.shopcd,shopname:t.shopname,memberFee:t.nvl(t.memberFee,""),insDt:a.firestore.FieldValue.serverTimestamp(),uid:t.uid,creditPid:t.nvl(t.creditPid,""),cancel:!1};t.logCollection.add(r).then((function(t){e()})).catch((function(t){n(t)}))}))},t.ngInjectableDef=u.S({factory:function(){return new t(u.W(c.a),u.W(l.a),u.W(h.n))},token:t,providedIn:"root"}),t}()},xoJo:function(t,e,n){"use strict";n.r(e),n.d(e,"GESTURE_CONTROLLER",(function(){return u})),n.d(e,"createGesture",(function(){return f}));var r,i=function(){function t(){this.gestureId=0,this.requestedStart=new Map,this.disabledGestures=new Map,this.disabledScroll=new Set}return t.prototype.createGesture=function(t){return new o(this,this.newID(),t.name,t.priority||0,!!t.disableScroll)},t.prototype.createBlocker=function(t){return void 0===t&&(t={}),new a(this,this.newID(),t.disable,!!t.disableScroll)},t.prototype.start=function(t,e,n){return this.canStart(t)?(this.requestedStart.set(e,n),!0):(this.requestedStart.delete(e),!1)},t.prototype.capture=function(t,e,n){if(!this.start(t,e,n))return!1;var r=this.requestedStart,i=-1e4;if(r.forEach((function(t){i=Math.max(i,t)})),i===n){this.capturedId=e,r.clear();var o=new CustomEvent("ionGestureCaptured",{detail:{gestureName:t}});return document.dispatchEvent(o),!0}return r.delete(e),!1},t.prototype.release=function(t){this.requestedStart.delete(t),this.capturedId===t&&(this.capturedId=void 0)},t.prototype.disableGesture=function(t,e){var n=this.disabledGestures.get(t);void 0===n&&(n=new Set,this.disabledGestures.set(t,n)),n.add(e)},t.prototype.enableGesture=function(t,e){var n=this.disabledGestures.get(t);void 0!==n&&n.delete(e)},t.prototype.disableScroll=function(t){this.disabledScroll.add(t),1===this.disabledScroll.size&&document.body.classList.add(s)},t.prototype.enableScroll=function(t){this.disabledScroll.delete(t),0===this.disabledScroll.size&&document.body.classList.remove(s)},t.prototype.canStart=function(t){return void 0===this.capturedId&&!this.isDisabled(t)},t.prototype.isCaptured=function(){return void 0!==this.capturedId},t.prototype.isScrollDisabled=function(){return this.disabledScroll.size>0},t.prototype.isDisabled=function(t){var e=this.disabledGestures.get(t);return!!(e&&e.size>0)},t.prototype.newID=function(){return this.gestureId++,this.gestureId},t}(),o=function(){function t(t,e,n,r,i){this.id=e,this.name=n,this.disableScroll=i,this.priority=1e6*r+e,this.ctrl=t}return t.prototype.canStart=function(){return!!this.ctrl&&this.ctrl.canStart(this.name)},t.prototype.start=function(){return!!this.ctrl&&this.ctrl.start(this.name,this.id,this.priority)},t.prototype.capture=function(){if(!this.ctrl)return!1;var t=this.ctrl.capture(this.name,this.id,this.priority);
1return t&&this.disableScroll&&this.ctrl.disableScroll(this.id),t},t.prototype.release=function(){this.ctrl&&(this.ctrl.release(this.id),this.disableScroll&&this.ctrl.enableScroll(this.id))},t.prototype.destroy=function(){this.release(),this.ctrl=void 0},t}(),a=function(){function t(t,e,n,r){this.id=e,this.disable=n,this.disableScroll=r,this.ctrl=t}return t.prototype.block=function(){if(this.ctrl){if(this.disable)for(var t=0,e=this.disable;t<e.length;t++)this.ctrl.disableGesture(e[t],this.id);this.disableScroll&&this.ctrl.disableScroll(this.id)}},t.prototype.unblock=function(){if(this.ctrl){if(this.disable)for(var t=0,e=this.disable;t<e.length;t++)this.ctrl.enableGesture(e[t],this.id);this.disableScroll&&this.ctrl.enableScroll(this.id)}},t.prototype.destroy=function(){this.unblock(),this.ctrl=void 0},t}(),s="backdrop-no-scroll",u=new i,c=function(t,e,n,r){var i,o,a=l(t)?{capture:!!r.capture,passive:!!r.passive}:!!r.capture;return t.__zone_symbol__addEventListener?(i="__zone_symbol__addEventListener",o="__zone_symbol__removeEventListener"):(i="addEventListener",o="removeEventListener"),t[i](e,n,a),function(){t[o](e,n,a)}},l=function(t){if(void 0===r)try{var e=Object.defineProperty({},"passive",{get:function(){r=!0}});t.addEventListener("optsTest",(function(){}),e)}catch(n){r=!1}return!!r},h=function(t){return t instanceof Document?t:t.ownerDocument},f=function(t){var e=!1,n=!1,r=!0,i=!1,o=Object.assign({disableScroll:!1,direction:"x",gesturePriority:0,passive:!0,maxAngle:40,threshold:10},t),a=o.canStart,s=o.onWillStart,l=o.onStart,f=o.onEnd,y=o.notCaptured,v=o.onMove,g=o.threshold,b={type:"pan",startX:0,startY:0,startTimeStamp:0,currentX:0,currentY:0,velocityX:0,velocityY:0,deltaX:0,deltaY:0,timeStamp:0,event:void 0,data:void 0},w=function(t,e,n){var r=n*(Math.PI/180),i="x"===t,o=Math.cos(r),a=e*e,s=0,u=0,c=!1,l=0;return{start:function(t,e){s=t,u=e,l=0,c=!0},detect:function(t,e){if(!c)return!1;var n=t-s,r=e-u,h=n*n+r*r;if(h<a)return!1;var f=Math.sqrt(h),d=(i?n:r)/f;return l=d>o?1:d<-o?-1:0,c=!1,!0},isGesture:function(){return 0!==l},getDirection:function(){return l}}}(o.direction,o.threshold,o.maxAngle),_=u.createGesture({name:t.gestureName,priority:t.gesturePriority,disableScroll:t.disableScroll}),S=function(){e&&(i=!1,v&&v(b))},C=function(){return!(_&&!_.capture()||(e=!0,r=!1,b.startX=b.currentX,b.startY=b.currentY,b.startTimeStamp=b.timeStamp,s?s(b).then(E):E(),0))},E=function(){l&&l(b),r=!0},T=function(){e=!1,n=!1,i=!1,r=!0,_.release()},k=function(t){var n=e,i=r;T(),i&&(d(b,t),n?f&&f(b):y&&y(b))},I=function(t,e,n,r,i){var o,a,s,u,l,f,d,p=0,m=function(r){p=Date.now()+2e3,e(r)&&(!a&&n&&(a=c(t,"touchmove",n,i)),s||(s=c(t,"touchend",v,i)),u||(u=c(t,"touchcancel",v,i)))},y=function(r){p>Date.now()||e(r)&&(!f&&n&&(f=c(h(t),"mousemove",n,i)),d||(d=c(h(t),"mouseup",g,i)))},v=function(t){b(),r&&r(t)},g=function(t){w(),r&&r(t)},b=function(){a&&a(),s&&s(),u&&u(),a=s=u=void 0},w=function(){f&&f(),d&&d(),f=d=void 0},_=function(){b(),w()},S=function(e){e?(o&&o(),l&&l(),o=l=void 0,_()):(o||(o=c(t,"touchstart",m,i)),l||(l=c(t,"mousedown",y,i)))};return{setDisabled:S,stop:_,destroy:function(){S(!0),r=n=e=void 0}}}(o.el,(function(t){var e=m(t);return!(n||!r)&&(p(t,b),b.startX=b.currentX,b.startY=b.currentY,b.startTimeStamp=b.timeStamp=e,b.velocityX=b.velocityY=b.deltaX=b.deltaY=0,b.event=t,(!a||!1!==a(b))&&(_.release(),!!_.start()&&(n=!0,0===g?C():(w.start(b.startX,b.startY),!0))))}),(function(t){e?!i&&r&&(i=!0,d(b,t),requestAnimationFrame(S)):(d(b,t),w.detect(b.currentX,b.currentY)&&(w.isGesture()&&C()||O()))}),k,{capture:!1}),O=function(){T(),I.stop(),y&&y(b)};return{setDisabled:function(t){t&&e&&k(void 0),I.setDisabled(t)},destroy:function(){_.destroy(),I.destroy()}}},d=function(t,e){if(e){var n=t.currentX,r=t.currentY,i=t.timeStamp;p(e,t);var o=t.currentX,a=t.currentY,s=(t.timeStamp=m(e))-i;if(s>0&&s<100){var u=(a-r)/s;t.velocityX=(o-n)/s*.7+.3*t.velocityX,t.velocityY=.7*u+.3*t.velocityY}t.deltaX=o-t.startX,t.deltaY=a-t.startY,t.event=e}},p=function(t,e){var n=0,r=0;if(t){var i=t.changedTouches;if(i&&i.length>0){var o=i[0];n=o.clientX,r=o.clientY}else void 0!==t.pageX&&(n=t.pageX,r=t.pageY)}e.currentX=n,e.currentY=r},m=function(t){return t.timeStamp||Date.now()}},xrBK:function(t,e,n){var r=n("UFGs"),i=n("Rbo/"),o=n("kSm0"),a=n("ifzb")("IE_PROTO"),s=function(){},u=function(){var t,e=n("y6nS")("iframe"),r=o.length;for(e.style.display="none",n("yI25").appendChild(e),e.src="javascript:",(t=e.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),u=t.F;r--;)delete u.prototype[o[r]];return u()};t.exports=Object.create||function(t,e){var n;return null!==t?(s.prototype=r(t),n=new s,s.prototype=null,n[a]=t):n=u(),void 0===e?n:i(n,e)}},y3By:function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return o}
1));var r=n("+umK");function i(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return o(t)}function o(t){return t?1===t.length?t[0]:function(e){return t.reduce((function(t,e){return e(t)}),e)}:r.a}},y6nS:function(t,e,n){var r=n("Zp05"),i=n("qtiw").document,o=r(i)&&r(i.createElement);t.exports=function(t){return o?i.createElement(t):{}}},yI25:function(t,e,n){var r=n("qtiw").document;t.exports=r&&r.documentElement},yLjp:function(t,e,n){n("u00B")("asyncIterator")},ytDL:function(t,e,n){var r=n("UFGs"),i=n("q098"),o=n("IiNp"),a=Object.defineProperty;e.f=n("lIov")?Object.defineProperty:function(t,e,n){if(r(t),e=o(e,!0),r(n),i)try{return a(t,e,n)}catch(s){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},zGGa:function(t,e,n){for(var r=n("U8mZ"),i=n("9Aud"),o=n("TDVo"),a=n("qtiw"),s=n("GYIZ"),u=n("Qtk+"),c=n("jZgK"),l=c("iterator"),h=c("toStringTag"),f=u.Array,d={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},p=i(d),m=0;m<p.length;m++){var y,v=p[m],g=d[v],b=a[v],w=b&&b.prototype;if(w&&(w[l]||s(w,l,f),w[h]||s(w,h,v),u[v]=f,g))for(y in r)w[y]||o(w,y,r[y],!0)}},zUnb:function(t,e,n){"use strict";n.r(e);var r=n("CcnG"),i=n("AytR"),o={},a=function(){return function(){}}(),s=n("xdv0"),u=n("v202"),c=n("ZZ/e"),l=n("fvl4"),h=function(){function t(t){this.db=t,this.isEnabled=!0}return t.prototype.initConfig=function(){var t=this;return new Promise((function(e,n){t.configures=t.db.collection("configure").doc("9xYT5MIFolXlQ33Bc1uj").valueChanges(),t.configures.subscribe((function(n){t.isEnabled=n.isEnabled,e()}),(function(t){console.log(t),n()}))}))},t.prototype.initShop=function(){var t=this;return new Promise((function(e,n){t.shopCollectionRef=t.db.collection("shopId"),t.shopIds=t.shopCollectionRef.valueChanges(),t.shopIds.subscribe((function(n){t.shops=n,e(t.shops)}))}))},t.ngInjectableDef=r.S({factory:function(){return new t(r.W(l.a))},token:t,providedIn:"root"}),t}(),f=n("ZYCi"),d=function(){function t(){}return t.prototype.useGA=function(){return void 0!==typeof gtag},t.prototype.sendPageView=function(t){this.useGA()&&(t.startsWith("/")||(t="/"+{url:t}),gtag("config",i.a.analytics.id,{page_path:t}))},t.prototype.sendEvent=function(t,e,n,r){this.useGA()&&gtag("event",t,{event_category:e,event_action:n,event_label:r})},t}(),p=n("VnD/"),m=function(){function t(t,e,n,r,i,o){this.platform=t,this.tabstate=e,this.userService=n,this.configservice=r,this.router=i,this.gaService=o}return t.prototype.ngOnInit=function(){var t=this;this.router.events.pipe(Object(p.a)((function(t){return t instanceof f.d}))).subscribe((function(e){t.gaService.sendPageView(e.url)})),this.initializeApp(),this.userService.checkLogin()},t.prototype.initializeApp=function(){var t=this;return new Promise((function(e,n){t.platform.ready().then((function(){return e=t,void 0,r=function(){return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=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 a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(t){switch(t.label){case 0:return[4,this.tabstate.setState(!1)];case 1:return t.sent(),[2]}}))}
1,new((n=void 0)||(n=Promise))((function(t,i){function o(t){try{s(r.next(t))}catch(e){i(e)}}function a(t){try{s(r.throw(t))}catch(e){i(e)}}function s(e){e.done?t(e.value):new n((function(t){t(e.value)})).then(o,a)}s((r=r.apply(e,[])).next())}));var e,n,r})).then((function(){return t.configservice.initConfig().then((function(){return t.configservice.initShop()})).catch((function(){console.log("DB Read Error"),n()}))})).then((function(){e(!0)}))}))},t}(),y=n("pMnS"),v=n("oBZk"),g=n("Ip0R"),b=r.nb({encapsulation:2,styles:[],data:{}});function w(t){return r.Fb(0,[(t()(),r.pb(0,0,null,null,3,"ion-app",[],null,null,null,v.u,v.a)),r.ob(1,49152,null,0,c.f,[r.h,r.k,r.z],null,null),(t()(),r.pb(2,16777216,null,0,1,"ion-router-outlet",[],null,null,null,null,null)),r.ob(3,212992,null,0,c.ib,[f.b,r.O,r.j,[8,null],[8,null],c.d,c.Ib,g.f,r.k,f.n,r.z,f.a,[3,c.ib]],null,null)],(function(t,e){t(e,3,0)}),null)}function _(t){return r.Fb(0,[(t()(),r.pb(0,0,null,null,1,"app-root",[],null,null,null,w,b)),r.ob(1,114688,null,0,m,[c.Jb,u.a,s.a,h,f.n,d],null,null)],(function(t,e){t(e,1,0)}),null)}var S=r.lb("app-root",m,_,{},{},[]),C=n("ZYjt"),E=n("gIcY"),T=n("hDTV"),k=n("NKHs");function I(t){return null==t}function O(t){return"function"==typeof t.set}function x(t,e){return O(e)?e:t.ref(e)}function A(t,e){if("string"==typeof t)return e.stringCase();if(O(t))return e.firebaseCase();if(function(t){return"function"==typeof t.exportVal}(t))return e.snapshotCase();throw new Error("Expects a string, snapshot, or reference. Got: "+typeof t)}var P=n("T1DM"),D=n("6blF"),R=n("67Y/"),N=n("S1nX");function j(t,e,n,r){return void 0===n&&(n="on"),void 0===r&&(r=P.a),new D.a((function(i){var o;return o=t[n](e,(function(t,e){r.schedule((function(){i.next({snapshot:t,prevKey:e})})),"once"==n&&r.schedule((function(){return i.complete()}))}),(function(t){r.schedule((function(){return i.error(t)}))})),"on"==n?{unsubscribe:function(){null!=o&&t.off(e,o)}}:{unsubscribe:function(){}}})).pipe(Object(R.a)((function(t){var n=t.snapshot,r=t.prevKey,i=null;return n.exists()&&(i=n.key),{type:e,payload:n,prevKey:r,key:i}})),Object(N.a)())}var M=n("F/XL"),L=n("p0ib"),F=n("15JJ"),U=n("dC0D"),V=n("ad02");function q(t,e){for(var n=t.length,r=0;r<n;r++)if(t[r].payload.key===e)return r;return-1}function B(t,e){var n=e.payload,r=e.prevKey,i=e.key,o=q(t,i),a=function(t,e){if(I(e))return 0;var n=q(t,e);return-1===n?t.length:n+1}(t,r);switch(e.type){case"value":if(e.payload&&e.payload.exists()){var s=null;e.payload.forEach((function(e){var n={payload:e,type:"value",prevKey:s,key:e.key};return s=e.key,t=t.concat([n]),!1}))}return t;case"child_added":if(o>-1){var u=t[o-1];(u&&u.key||null)!=r&&(t=t.filter((function(t){return t.payload.key!==n.key}))).splice(a,0,e)}else{if(null==r)return[e].concat(t);(t=t.slice()).splice(a,0,e)}return t;case"child_removed":return t.filter((function(t){return t.payload.key!==n.key}));case"child_changed":return t.map((function(t){return t.payload.key===i?e:t}));case"child_moved":if(o>-1){var c=t.splice(o,1)[0];return(t=t.slice()).splice(a,0,c),t}return t;default:return t}}function W(t){return(I(t)||0===t.length)&&(t=["child_added","child_removed","child_changed","child_moved"]),t}function z(t,e,n){return function(t,e,n){return j(t,"value","once",n).pipe(Object(F.a)((function(r){var i=[Object(M.a)(r)];return e.forEach((function(e){return i.push(j(t,e,"on",n))})),L.a.apply(void 0,i).pipe(Object(U.a)(B,[]))})),Object(V.a)())}(t,e=W(e),n)}function H(t,e,n){var r=(e=W(e)).map((function(e){return j(t,e,"on",n)}));return L.a.apply(void 0,r)}var $=n("mrSG"),K=n("MGBS"),G=n("zotm"),Q=function(){function t(t,e){this.observables=t,this.project=e}return t.prototype.call=function(t,e){return e.subscribe(new Y(t,this.observables,this.project))},t}(),Y=function(t){function e(e,n,r){var i=t.call(this,e)||this;i.observables=n,i.project=r,i.toRespond=[];var o=n.length;i.values=new Array(o);for(var a=0;a<o;a++)i.toRespond.push(a);for(a=0;a<o;a++){var s=n[a];i.add(Object(G.a)(i,s,s,a))}return i}return $.d(e,t),e.prototype.notifyNext=function(t,e,n,r,i){this.values[n]=e;var o=this.toRespond;if(o.length>0){var a=o.indexOf(n);-1!==a&&o.splice(a,1)}},e.prototype.notifyComplete=function(){},e.prototype._next=function(t){if(0===this.toRespond.length){var e=[t].concat(this.values);this.project?this._tryProject(e):this.destination.next(e)}},e.prototype._tryProject=function(t){var e;try{e=this.project.apply(this,t)}catch(n){return void this.destination.error(n)}this.destination.next(e)},e}(K.a),X=n("FFOo"),J=function(){function t(t){this.predicate=t}return t.prototype.call=function(t,e){return e.subscribe(new Z(t,this.predicate))},t}(),Z=function(t){function e(e,n){var r=t.call(this,e)||this;
1return r.predicate=n,r.skipping=!0,r.index=0,r}return $.d(e,t),e.prototype._next=function(t){var e=this.destination;this.skipping&&this.tryCallPredicate(t),this.skipping||e.next(t)},e.prototype.tryCallPredicate=function(t){try{var e=this.predicate(t,this.index++);this.skipping=Boolean(e)}catch(n){this.destination.error(n)}},e}(X.a);function tt(t,e){return function(n,r){return A(n,{stringCase:function(){return t.child(n)[e](r)},firebaseCase:function(){return n[e](r)},snapshotCase:function(){return n.ref[e](r)}})}}function et(t,e){return function(){return j(t,"value","on",e)}}var nt=function(){function t(t,e,n,r,i){this.schedulers=new k.b(i),this.keepUnstableUntilFirst=Object(k.c)(this.schedulers,r),this.database=i.runOutsideAngular((function(){return Object(T.e)(t,i,e).database(n||void 0)}))}return t.prototype.list=function(t,e){var n=x(this.database,t),r=n;return e&&(r=e(n)),function(t,e){var n,r=e.schedulers.outsideAngular;return{query:t,update:tt(t.ref,"update"),set:tt(t.ref,"set"),push:function(e){return t.ref.push(e)},remove:(n=t.ref,function(t){return t?A(t,{stringCase:function(){return n.child(t).remove()},firebaseCase:function(){return t.remove()},snapshotCase:function(){return t.ref.remove()}}):n.remove()}),snapshotChanges:function(n){return z(t,n,r).pipe(e.keepUnstableUntilFirst)},stateChanges:function(n){return H(t,n,r).pipe(e.keepUnstableUntilFirst)},auditTrail:function(n){return function(t,e,n){return function(t,e,n){return function(t,e){return j(t,"value","on",e).pipe(Object(R.a)((function(t){var e;return t.payload.forEach((function(t){return e=t.key,!1})),{data:t,lastKeyToLoad:e}})))}(t,n).pipe(function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){var n;return"function"==typeof t[t.length-1]&&(n=t.pop()),e.lift(new Q(t,n))}}(e),Object(R.a)((function(t){var e=t[1],n=t[0].lastKeyToLoad,r=e.map((function(t){return t.key}));return{actions:e,lastKeyToLoad:n,loadedKeys:r}})),(r=function(t){return-1===t.loadedKeys.indexOf(t.lastKeyToLoad)},function(t){return t.lift(new J(r))}),Object(R.a)((function(t){return t.actions})));var r}(t,H(t,e).pipe(Object(U.a)((function(t,e){return t.concat([e])}),[])),n)}(t,n,r).pipe(e.keepUnstableUntilFirst)},valueChanges:function(n){return z(t,n,r).pipe(e.keepUnstableUntilFirst,Object(R.a)((function(t){return t.map((function(t){return t.payload.val()}))})))}}}(r,this)},t.prototype.object=function(t){var e,n,r=x(this.database,t);return n=this,{query:e=r,snapshotChanges:function(){return et(e,n.schedulers.outsideAngular)().pipe(n.keepUnstableUntilFirst)},update:function(t){return e.ref.update(t)},set:function(t){return e.ref.set(t)},remove:function(){return e.ref.remove()},valueChanges:function(){return et(e,n.schedulers.outsideAngular)().pipe(n.keepUnstableUntilFirst,Object(R.a)((function(t){return t.payload.exists()?t.payload.val():null})))}}},t.prototype.createPushId=function(){return this.database.ref().push().key},t}(),rt=(n("NSPt"),function(){return function(){}}()),it=n("ZBkt"),ot=n("MGeu"),at=n("X8TH");function st(t){var e=function(t){return new D.a((function(e){return t.on("state_changed",(function(t){return e.next(t)}),(function(t){return e.error(t)}),(function(){return e.complete()})),function(){return t.cancel()}}))}(t);return{task:t,then:t.then.bind(t),catch:t.catch.bind(t),pause:t.pause.bind(t),cancel:t.cancel.bind(t),resume:t.resume.bind(t),snapshotChanges:function(){return e},percentageChanges:function(){return e.pipe(Object(R.a)((function(t){return t.bytesTransferred/t.totalBytes*100})))}}}var ut=n("0/uQ");function ct(t,e,n){return{getDownloadURL:function(){return Object(ut.a)(t.getDownloadURL(),e.outsideAngular).pipe(n)},getMetadata:function(){return Object(ut.a)(t.getMetadata()).pipe(n)},delete:function(){return Object(ut.a)(t.delete())},child:function(r){return ct(t.child(r),e,n)},updateMetatdata:function(e){return Object(ut.a)(t.updateMetadata(e))},updateMetadata:function(e){return Object(ut.a)(t.updateMetadata(e))},put:function(e,n){return st(t.put(e,n))},putString:function(e,n,r){return st(t.putString(e,n,r))}}}var lt=new r.p("angularfire2.storageBucket"),ht=function(){function t(t,e,n,r,i){this.schedulers=new k.b(i),this.keepUnstableUntilFirst=Object(k.c)(this.schedulers,r),this.storage=i.runOutsideAngular((function(){return Object(T.e)(t,i,e).storage(n||void 0)}))}return t.prototype.ref=function(t){return ct(this.storage.ref(t),this.schedulers,this.keepUnstableUntilFirst)},t.prototype.upload=function(t,e,n){return ct(this.storage.ref(t),this.schedulers,this.keepUnstableUntilFirst).put(e,n)},t}(),ft=(n("LmZi"),function(){return function(){}}()),dt=n("sE5F"),pt=n("t/Na"),mt=n("bne5"),yt={error:"cordova_not_available"},vt={error:"plugin_not_installed"};function gt(t){if("undefined"!=typeof window&&window.angular){var e=window.document,n=window.angular.element(e.querySelector("[ng-app]")||e.body).injector();if(n)return n.get("$q")((function(e,n){t(e,n)}));console.warn("Angular 1 was detected but $q couldn't be retrieved. This is usually when the app is not bootstrapped on the html or body tag. Falling back to native promises which w
1on't trigger an automatic digest when promises resolve.")}return function(){if(Promise)return new Promise((function(e,n){t(e,n)}));console.error("No Promise support or polyfill found. To enable Ionic Native support, please add the es6-promise polyfill before this script, or run with a library like Angular or on a recent browser.")}()}function bt(t,e,n,r){var i,o;void 0===r&&(r={});var a=gt((function(a,s){i=r.destruct?Et(t,e,n,r,(function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return a(t)}),(function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return s(t)})):Et(t,e,n,r,a,s),o=s}));return i&&i.error&&(a.catch((function(){})),"function"==typeof o&&o(i.error)),a}function wt(t,e,n,r){return void 0===r&&(r={}),gt((function(i,o){var a=Et(t,e,n,r);a?a.error?o(a.error):a.then&&a.then(i).catch(o):o({error:"unexpected_error"})}))}function _t(t,e,n,r){return void 0===r&&(r={}),new D.a((function(i){var o;return(o=r.destruct?Et(t,e,n,r,(function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return i.next(t)}),(function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return i.error(t)})):Et(t,e,n,r,i.next.bind(i),i.error.bind(i)))&&o.error&&(i.error(o.error),i.complete()),function(){try{if(r.clearFunction)return r.clearWithArgs?Et(t,r.clearFunction,n,r,i.next.bind(i),i.error.bind(i)):Et(t,r.clearFunction,[])}catch(o){console.warn("Unable to clear the previous observable watch for",t.constructor.getPluginName(),e),console.warn(o)}}}))}function St(t,e){return e="undefined"!=typeof window&&e?kt(window,e):e||("undefined"!=typeof window?window:{}),Object(mt.a)(e,t)}function Ct(t,e,n){var r,i,o;return"string"==typeof t?r=t:(r=t.constructor.getPluginRef(),n=t.constructor.getPluginName(),o=t.constructor.getPluginInstallName()),!(!(i=Tt(r))||e&&void 0===i[e])||("undefined"!=typeof window&&window.cordova?(function(t,e,n){n?console.warn("Native: tried calling "+t+"."+n+", but the "+t+" plugin is not installed."):console.warn("Native: tried accessing the "+t+" plugin but it's not installed."),e&&console.warn("Install the "+t+" plugin: 'ionic cordova plugin add "+e+"'")}(n,o,e),vt):(function(t,e){"undefined"==typeof process&&(e?console.warn("Native: tried calling "+t+"."+e+", but Cordova is not available. Make sure to include cordova.js or run in a device/simulator"):console.warn("Native: tried accessing the "+t+" plugin but Cordova is not available. Make sure to include cordova.js or run in a device/simulator"))}(n,e),yt))}function Et(t,e,n,r,i,o){void 0===r&&(r={}),n=function(t,e,n,r){if(void 0===e&&(e={}),e.sync)return t;if("reverse"===e.callbackOrder)t.unshift(r),t.unshift(n);else if("node"===e.callbackStyle)t.push((function(t,e){t?r(t):n(e)}));else if("object"===e.callbackStyle&&e.successName&&e.errorName){var i={};i[e.successName]=n,i[e.errorName]=r,t.push(i)}else if(void 0!==e.successIndex||void 0!==e.errorIndex){var o=function(){e.successIndex>t.length?t[e.successIndex]=n:t.splice(e.successIndex,0,n)},a=function(){e.errorIndex>t.length?t[e.errorIndex]=r:t.splice(e.errorIndex,0,r)};e.successIndex>e.errorIndex?(a(),o()):(o(),a())}else t.push(n),t.push(r);return t}(n,r,i,o);var a=Ct(t,e);if(!0===a){var s=Tt(t.constructor.getPluginRef());return s[e].apply(s,n)}return a}function Tt(t){return"undefined"!=typeof window?kt(window,t):null}function kt(t,e){for(var n=e.split("."),r=t,i=0;i<n.length;i++){if(!r)return null;r=r[n[i]]}return r}var It=function(){function t(){}return t.installed=function(){return!0===Ct(this.pluginRef)},t.getPlugin=function(){return"undefined"!=typeof window?function(t,e){for(var n=e.split("."),r=t,i=0;i<n.length;i++){if(!r)return null;r=r[n[i]]}return r}(window,this.pluginRef):null},t.getPluginName=function(){return this.pluginName},t.getPluginRef=function(){return this.pluginRef},t.getPluginInstallName=function(){return this.plugin},t.getSupportedPlatforms=function(){return this.platforms},t.pluginName="",t.pluginRef="",t.plugin="",t.repo="",t.platforms=[],t.install="",t}();function Ot(t,e,n,r){return function(t,e,n){return void 0===n&&(n={}),function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return n.sync?Et(t,e,r,n):n.observable?_t(t,e,r,n):n.eventObservable&&n.event?St(n.event,n.element):n.otherPromise?wt(t,e,r,n):bt(t,e,r,n)}}(t,e,n).apply(this,r)}!function(){if("undefined"==typeof process){var t="undefined"!=typeof window?window:{},e=Date.now(),n=!1;t.document.addEventListener("deviceready",(function(){console.log("Ionic Native: deviceready event fired after "+(Date.now()-e)+" ms"),n=!0})),setTimeout((function(){!n&&t.cordova&&console.warn("Ionic Native: deviceready did not fire within 5000ms. This can happen when plugins are in an inconsistent state. Try removing plugins from plugins/ and reinstalling them.")}),5e3)}}();var xt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object($.d)(e,t),e.prototype.overlaysWebView=function(t){return Ot(this,"overlaysWebView",{sync:!0},arguments)},e.prototype.styleDefault=function(){return Ot(this,"styleDefault",{sync:!0},arguments)},e.prototype.styleLightContent=function(){return Ot(this,"styleLightContent",{sync:!0},arguments)},e.prototype.styleBlackTranslucent=function(){return Ot(this,"styleBlackTranslucent",{sync:!0},arguments)},e.prototype.styleBlackOpaque=function(){return Ot(this,"styleBlackOpaque",{sync:!0},arguments)},e.prototype.backgroundColorByName=function(t){return Ot(this,"backgroundColorByName",{sync:!0},arguments)},e.prototype.backgroundColorByHexString=function(t){return Ot(this,"backgroundColorByHexString",{sync:!0},arguments)},e.prototype.hide=function(){return Ot(this,"hide",{sync:!0},arguments)},e.prototype.show=function(){return Ot(this,"show",{sync:!0},arguments)}
1,Object.defineProperty(e.prototype,"isVisible",{get:function(){return!0===Ct(this,"isVisible")?Tt(this.constructor.getPluginRef()).isVisible:null},set:function(t){!function(t,e,n){!0===Ct(t,"isVisible")&&(Tt(t.constructor.getPluginRef()).isVisible=n)}(this,0,t)},enumerable:!1,configurable:!0}),e.pluginName="StatusBar",e.plugin="cordova-plugin-statusbar",e.pluginRef="StatusBar",e.repo="https://github.com/apache/cordova-plugin-statusbar",e.platforms=["Android","iOS","Windows"],e}(It),At=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object($.d)(e,t),e.prototype.show=function(){return Ot(this,"show",{sync:!0},arguments)},e.prototype.hide=function(){return Ot(this,"hide",{sync:!0},arguments)},e.pluginName="SplashScreen",e.plugin="cordova-plugin-splashscreen",e.pluginRef="navigator.splashscreen",e.repo="https://github.com/apache/cordova-plugin-splashscreen",e.platforms=["Amazon Fire OS","Android","iOS","Windows"],e}(It),Pt=n("htOm"),Dt=n("Hh92"),Rt=n("JdN0"),Nt=n("rJ5Q"),jt=n("Ba8/"),Mt=n("8nGB"),Lt=function(){function t(t,e,n,r){this.router=t,this.activatedRoute=e,this.db=n,this.userservice=r}return t.prototype.canActivate=function(t,e){var n=t.queryParamMap.get("result"),r=t.queryParamMap.get("pid"),i=t.queryParamMap.get("sod"),o=t.queryParamMap.get("uid"),a=t.queryParamMap.get("shopid");return n?"appl"===a?(this.router.navigate(["/kumamember/appl-endpayment"],{queryParams:{result:n,pid:r,sod:i,uid:o,shopid:a},queryParamsHandling:"merge"}),!1):o?"2"===n?(this.userservice.uid=o,this.router.navigate(["/kumamember/credit-error"]),!1):"1"===n||(this.userservice.uid=o,this.router.navigate(["/kumamember/bad-param"]),!1):(this.router.navigate(["/kumamember/bad-param"]),!1):(this.router.navigate(["/kumamember/bad-param"]),!1)},t.ngInjectableDef=r.S({factory:function(){return new t(r.W(f.n),r.W(f.a),r.W(l.a),r.W(s.a))},token:t,providedIn:"root"}),t}(),Ft=function(){function t(t,e){this.router=t,this.configservice=e}return t.prototype.canActivate=function(t,e){return!0===this.configservice.isEnabled||(this.router.navigate(["/maintenance"]),!1)},t.ngInjectableDef=r.S({factory:function(){return new t(r.W(f.n),r.W(h))},token:t,providedIn:"root"}),t}(),Ut=function(){function t(t,e){this.router=t,this.userservice=e}return t.prototype.canActivate=function(t,e){var n=t.queryParamMap.get("result"),r=t.queryParamMap.get("uid"),i=t.queryParamMap.get("shopid");return n?"appl"!==i?(this.router.navigate(["/kumamember/bad-param"]),!1):r?"2"===n?(this.userservice.uid=r,this.router.navigate(["/kumamember/appl-credit-error"]),!1):"1"===n||(this.router.navigate(["/kumamember/bad-param"]),!1):(this.router.navigate(["/kumamember/bad-param"]),!1):(this.router.navigate(["/kumamember/bad-param"]),!1)},t.ngInjectableDef=r.S({factory:function(){return new t(r.W(f.n),r.W(s.a))},token:t,providedIn:"root"}),t}(),Vt=function(){function t(t,e){this.appluserService=t,this.router=e}return t.prototype.canActivate=function(t,e){var n=this;return this.appluserService.checkEmailLoginState().pipe(Object(R.a)((function(t){return t.login||n.router.navigate(["/kumamember/appl-bad-page"]),t.login})))},t.ngInjectableDef=r.S({factory:function(){return new t(r.W(Rt.a),r.W(f.n))},token:t,providedIn:"root"}),t}(),qt=n("Jds6"),Bt=function(){function t(t,e){this.router=t,this.userservice=e}return t.prototype.canActivate=function(t,e){var n=t.queryParamMap.get("result"),r=t.queryParamMap.get("uid");return t.queryParamMap.get("shopid"),"2"===n?(this.userservice.uid=r,this.router.navigate(["/kumamember/appl-corp-credit-error"]),!1):"1"===n||(this.router.navigate(["/kumamember/corp-bad-param"]),!1)},t.ngInjectableDef=r.S({factory:function(){return new t(r.W(f.n),r.W(qt.a))},token:t,providedIn:"root"}),t}(),Wt=function(){return function(){}}(),zt=r.mb(a,[m],(function(t){return r.vb([r.wb(512,r.j,r.bb,[[8,[y.a,S]],[3,r.j],r.x]),r.wb(5120,r.u,r.kb,[[3,r.u]]),r.wb(4608,g.k,g.j,[r.u,[2,g.s]]),r.wb(5120,r.c,r.hb,[]),r.wb(5120,r.s,r.ib,[]),r.wb(5120,r.t,r.jb,[]),r.wb(4608,C.b,C.k,[g.c]),r.wb(6144,r.F,null,[C.b]),r.wb(4608,C.e,C.g,[]),r.wb(5120,C.c,(function(t,e,n,r,i,o,a,s){return[new C.i(t,e,n),new C.n(r),new C.m(i,o,a,s)]}
1),[g.c,r.z,r.B,g.c,g.c,C.e,r.cb,[2,C.f]]),r.wb(4608,C.d,C.d,[C.c,r.z]),r.wb(135680,C.l,C.l,[g.c]),r.wb(4608,C.j,C.j,[C.d,C.l,r.c]),r.wb(6144,r.D,null,[C.j]),r.wb(6144,C.o,null,[C.l]),r.wb(4608,r.L,r.L,[r.z]),r.wb(4608,c.b,c.b,[r.z,r.g]),r.wb(4608,c.Hb,c.Hb,[c.b,r.j,r.q]),r.wb(4608,c.Kb,c.Kb,[c.b,r.j,r.q]),r.wb(5120,f.a,f.C,[f.n]),r.wb(4608,f.h,f.h,[]),r.wb(6144,f.i,null,[f.h]),r.wb(135680,f.s,f.s,[f.n,r.w,r.i,r.q,f.i]),r.wb(4608,f.f,f.f,[]),r.wb(5120,f.G,f.y,[f.n,g.p,f.j]),r.wb(5120,f.k,f.F,[f.D]),r.wb(5120,r.b,(function(t){return[t]}),[f.k]),r.wb(4608,E.n,E.n,[]),r.wb(4608,E.b,E.b,[]),r.wb(5120,T.b,T.e,[T.d,r.z,[2,T.c]]),r.wb(4608,nt,nt,[T.d,[2,T.c],[2,k.a],r.B,r.z]),r.wb(4608,it.a,it.a,[T.d,[2,T.c],r.B,r.z]),r.wb(4608,l.a,l.a,[T.d,[2,T.c],[2,l.d],[2,l.e],r.B,r.z,[2,l.g]]),r.wb(4608,ht,ht,[T.d,[2,T.c],[2,lt],r.B,r.z]),r.wb(4608,dt.i,dt.i,[]),r.wb(4608,dt.g,dt.b,[]),r.wb(4608,dt.c,dt.c,[dt.i,dt.g]),r.wb(4608,dt.f,dt.a,[]),r.wb(5120,dt.d,dt.h,[dt.c,dt.f]),r.wb(4608,pt.i,pt.o,[g.c,r.B,pt.m]),r.wb(4608,pt.p,pt.p,[pt.i,pt.n]),r.wb(5120,pt.a,(function(t){return[t]}),[pt.p]),r.wb(4608,pt.l,pt.l,[]),r.wb(6144,pt.j,null,[pt.l]),r.wb(4608,pt.h,pt.h,[pt.j]),r.wb(6144,pt.b,null,[pt.h]),r.wb(4608,pt.f,pt.k,[pt.b,r.q]),r.wb(4608,pt.c,pt.c,[pt.f]),r.wb(4608,xt,xt,[]),r.wb(4608,At,At,[]),r.wb(4608,s.a,s.a,[l.a,it.a,f.n]),r.wb(4608,Pt.a,Pt.a,[s.a,pt.c]),r.wb(4608,u.a,u.a,[]),r.wb(4608,Dt.a,Dt.a,[pt.c,dt.d]),r.wb(4608,Rt.a,Rt.a,[l.a,it.a]),r.wb(4608,h,h,[l.a]),r.wb(4608,d,d,[]),r.wb(4608,Nt.a,Nt.a,[l.a]),r.wb(4608,jt.a,jt.a,[]),r.wb(4608,Mt.a,Mt.a,[]),r.wb(1073742336,g.b,g.b,[]),r.wb(1024,r.l,C.p,[]),r.wb(1024,r.y,(function(){return[f.x()]}),[]),r.wb(512,f.D,f.D,[r.q]),r.wb(256,c.Pb,{scrollAssist:!0},[]),r.wb(1024,r.d,(function(t,e,n,r,i){return[C.q(t),f.E(e),c.Qb(n,r,i)]}),[[2,r.y],f.D,c.Pb,g.c,r.z]),r.wb(512,r.e,r.e,[[2,r.d]]),r.wb(131584,r.g,r.g,[r.z,r.cb,r.q,r.l,r.j,r.e]),r.wb(1073742336,r.f,r.f,[r.g]),r.wb(1073742336,C.a,C.a,[[3,C.a]]),r.wb(1073742336,c.Eb,c.Eb,[]),r.wb(1024,f.w,f.A,[[3,f.n]]),r.wb(512,f.u,f.c,[]),r.wb(512,f.b,f.b,[]),r.wb(256,f.j,{preloadingStrategy:f.h},[]),r.wb(1024,g.g,f.z,[g.o,[2,g.a],f.j]),r.wb(512,g.f,g.f,[g.g]),r.wb(512,r.i,r.i,[]),r.wb(512,r.w,r.I,[r.i,[2,r.J]]),r.wb(1024,f.l,(function(){return[[{path:"kumamember/endpayment",loadChildren:"./endpayment2/endpayment2.module#Endpayment2PageModule",canActivate:[Lt]},{path:"kumamember/tokusho",loadChildren:"./tokusho/tokusho.module#TokushoPageModule"},{path:"kumamember/bad-param",loadChildren:"./bad-param/bad-param.module#BadParamPageModule"},{path:"kumamember/credit-error",loadChildren:"./credit-error/credit-error.module#CreditErrorPageModule"},{path:"kumamember/end-add-user",loadChildren:"./end-add-user/end-add-user.module#EndAddUserPageModule"},{path:"kumamember",loadChildren:"./tabs/tabs.module#TabsPageModule"},{path:"confirm-join",loadChildren:"./confirm-join/confirm-join.module#ConfirmJoinPageModule"},{path:"join",loadChildren:"./tabs/tabs.module#TabsPageModule",canActivate:[Ft]},{path:"hello",loadChildren:"./tabs/tabs.module#TabsPageModule",canActivate:[Ft]},{path:"join-mail",loadChildren:"./join-mail/join-mail.module#JoinMailPageModule"},{path:"secure-join",loadChildren:"./secure-join/secure-join.module#SecureJoinPageModule"},{path:"mail-confirm",loadChildren:"./mail-confirm/mail-confirm.module#MailConfirmPageModule"},{path:"selectshop",loadChildren:"./selectshop/selectshop.module#SelectshopPageModule"},{path:"join2",loadChildren:"./join2/join2.module#Join2PageModule"},{path:"endpayment2",loadChildren:"./endpayment2/endpayment2.module#Endpayment2PageModule"},{path:"confirm-join2",loadChildren:"./confirm-join2/confirm-join2.module#ConfirmJoin2PageModule"},{path:"maintenance",loadChildren:"./maintenance/maintenance.module#MaintenancePageModule"},{path:"kumamember/appl-join-mail",loadChildren:"./appl-join-mail/appl-join-mail.module#ApplJoinMailPageModule"},{path:"kumamember/appl-bad-page",loadChildren:"./appl-bad-page/appl-bad-page.module#ApplBadPagePageModule"},{path:"kumamember/appl-confirm",loadChildren:"./appl-confirm/appl-confirm.module#ApplConfirmPageModule"},{path:"kumamember/appl-endpayment",loadChildren:"./appl-endpayment/appl-endpayment.module#ApplEndpaymentPageModule",canActivate:[Ut]},{path:"kumamember/appl-credit-error",loadChildren:"./appl-credit-error/appl-credit-error.module#ApplCreditErrorPageModule"},{path:"",loadChildren:"./tabs/tabs.module#TabsPageModule",canActivate:[Ft]},{path:"kumamember/appl-confirm-join2",loadChildren:"./appl-confirm-join2/appl-confirm-join2.module#ApplConfirmJoin2PageModule"},{path:"kumamember/appl-confirm-join3",loadChildren:"./appl-confirm-join3/appl-confirm-join3.module#ApplConfirmJoin3PageModule",canActivate:[Vt]},{path:"kumamember/appl-leave-mail",loadChildren:"./appl-leave-mail/appl-leave-mail.module#ApplLeaveMailPageModule"},{path:"kumamember/appl-leave-auth",loadChildren:"./appl-leave-auth/appl-leave-auth.module#ApplLeaveAuthPageModule"},{path:"kumamember/appl-leave-input",loadChildren:"./appl-leave-input/appl-leave-input.module#ApplLeaveInputPageModule",canActivate:[Vt]},{path:"kumamember/appl-leave-complete",loadChildren:"./appl-leave-complete/appl-leave-complete.module#ApplLeaveCompletePageModule"},{path:"kumamember/appl-leave-bad-page",loadChildren:"./appl-leave-bad-page/appl-leave-bad-page.module#ApplLeaveBadPagePageModule"},{path:"kumamember/appl-leave-confirm",loadChildren:"./appl-leave-confirm/appl-leave-confirm.module#ApplLeaveConfirmPageModule"},{path:"kumamember/appl-leave-credit-error",loadChildren:"./appl-leave-credit-error/appl-leave-credit-error.module#ApplLeaveCreditErrorPageModule"},{path:"kumamember/end-leave-user",loadChildren:"./end-leave-user/end-leave-user.module#EndLeaveUserPageModule"},{path:"kumamember/appl-corp-inp",loadChildren:"./appl-corp-inp/appl-corp-inp.module#ApplCorpInpPageModule"},{path:"kumamember/appl-corp-confirm",loadChildren:"./appl-corp-confirm/appl-corp-confirm.module#ApplCorpConfirmPageModule"},{path:"kumamember/appl-corp-end",loadChildren:"./appl-corp-end/appl-corp-end.module#ApplCorpEndPageModule",canActivate:[Bt]},{path:"kumamember/appl-corp-credit-error",loadChildren:"./appl-corp-credit-error/appl-corp-credit-error.module#ApplCorpCreditErrorPageModule"},{path:"kumamember/corp-bad-param",loadChildren:"./corp-bad-param/corp-bad-param.module#CorpBadParamPageModule"},{path:"kumamember/appl-corpmember-mail",loadChildren:"./appl-corpmember-mail/appl-corpmember-mail.module#ApplCorpmemberMailPageModule"}
1,{path:"kumamember/appl-corpmember-auth",loadChildren:"./appl-corpmember-auth/appl-corpmember-auth.module#ApplCorpmemberAuthPageModule"},{path:"kumamember/appl-corpmember-input",loadChildren:"./appl-corpmember-input/appl-corpmember-input.module#ApplCorpmemberInputPageModule"},{path:"kumamember/appl-corpmember-confirm",loadChildren:"./appl-corpmember-confirm/appl-corpmember-confirm.module#ApplCorpmemberConfirmPageModule"},{path:"kumamember/appl-corpmember-end-user",loadChildren:"./appl-corpmember-end-user/appl-corpmember-end-user.module#ApplCorpmemberEndUserPageModule"},{path:"kumamember/appl-index",loadChildren:"./appl-index/appl-index.module#ApplIndexPageModule"}]]}),[]),r.wb(512,f.m,c.Fb,[]),r.wb(1024,f.n,f.B,[r.g,f.u,f.b,g.f,r.q,r.w,r.i,f.l,f.j,[2,f.t],[2,f.m]]),r.wb(1073742336,f.q,f.q,[[2,f.w],[2,f.n]]),r.wb(1073742336,Wt,Wt,[]),r.wb(1073742336,E.l,E.l,[]),r.wb(1073742336,E.e,E.e,[]),r.wb(1073742336,E.j,E.j,[]),r.wb(1073742336,T.a,T.a,[r.B]),r.wb(1073742336,rt,rt,[]),r.wb(1073742336,ot.a,ot.a,[]),r.wb(1073742336,at.a,at.a,[]),r.wb(1073742336,ft,ft,[]),r.wb(1073742336,dt.e,dt.e,[]),r.wb(1073742336,pt.e,pt.e,[]),r.wb(1073742336,pt.d,pt.d,[]),r.wb(1073742336,a,a,[]),r.wb(256,r.ab,!0,[]),r.wb(256,T.d,{apiKey:"AIzaSyAADa0QhEakx5lHHR3ShUlxwBNWHL_o8Xw",authDomain:"kuma-member.firebaseapp.com",databaseURL:"https://kuma-member.firebaseio.com",projectId:"kuma-member",storageBucket:"kuma-member.appspot.com",messagingSenderId:"19816782538"},[]),r.wb(256,T.c,void 0,[]),r.wb(256,l.e,o,[]),r.wb(256,pt.m,"XSRF-TOKEN",[]),r.wb(256,pt.n,"X-XSRF-TOKEN",[])])}));i.a.production?(Object(r.T)(),window.console.log=function(){}
1,document.write('<script async src="https://www.googletagmanager.com/gtag/js?id='+i.a.analytics.id+"\"><\/script>\n  <script>\n    window.dataLayer = window.dataLayer || [];\n    function gtag(){dataLayer.push(arguments);}\n    gtag('js', new Date());\n  <\/script>")):document.write('<script async src="https://www.googletagmanager.com/gtag/js?id='+i.a.analytics.id+"\"><\/script>\n  <script>\n    window.dataLayer = window.dataLayer || [];\n    function gtag(){dataLayer.push(arguments);}\n    gtag('js', new Date());\n  <\/script>"),C.h().bootstrapModuleFactory(zt).catch((function(t){return console.log(t)}))},zVF4:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n("+7AZ"),i={NODE_CLIENT:!1,NODE_ADMIN:!1,SDK_VERSION:"${JSCORE_VERSION}"},o=function(t,e){if(!t)throw a(e)},a=function(t){return new Error("Firebase Database ("+i.SDK_VERSION+") INTERNAL ASSERT FAILED: "+t)},s=function(t){for(var e=[],n=0,r=0;r<t.length;r++){var i=t.charCodeAt(r);i<128?e[n++]=i:i<2048?(e[n++]=i>>6|192,e[n++]=63&i|128):55296==(64512&i)&&r+1<t.length&&56320==(64512&t.charCodeAt(r+1))?(i=65536+((1023&i)<<10)+(1023&t.charCodeAt(++r)),e[n++]=i>>18|240,e[n++]=i>>12&63|128,e[n++]=i>>6&63|128,e[n++]=63&i|128):(e[n++]=i>>12|224,e[n++]=i>>6&63|128,e[n++]=63&i|128)}return e},u={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:"function"==typeof atob,encodeByteArray:function(t,e){if(!Array.isArray(t))throw Error("encodeByteArray takes an array as a parameter");this.init_();for(var n=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[],i=0;i<t.length;i+=3){var o=t[i],a=i+1<t.length,s=a?t[i+1]:0,u=i+2<t.length,c=u?t[i+2]:0,l=(15&s)<<2|c>>6,h=63&c;u||(h=64,a||(l=64)),r.push(n[o>>2],n[(3&o)<<4|s>>4],n[l],n[h])}return r.join("")},encodeString:function(t,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(t):this.encodeByteArray(s(t),e)},decodeString:function(t,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(t):function(t){for(var e=[],n=0,r=0;n<t.length;){var i=t[n++];if(i<128)e[r++]=String.fromCharCode(i);else if(i>191&&i<224){var o=t[n++];e[r++]=String.fromCharCode((31&i)<<6|63&o)}else if(i>239&&i<365){var a=((7&i)<<18|(63&(o=t[n++]))<<12|(63&(s=t[n++]))<<6|63&t[n++])-65536;e[r++]=String.fromCharCode(55296+(a>>10)),e[r++]=String.fromCharCode(56320+(1023&a))}else{o=t[n++];var s=t[n++];e[r++]=String.fromCharCode((15&i)<<12|(63&o)<<6|63&s)}}return e.join("")}(this.decodeStringToByteArray(t,e))},decodeStringToByteArray:function(t,e){this.init_();for(var n=e?this.charToByteMapWebSafe_:this.charToByteMap_,r=[],i=0;i<t.length;){var o=n[t.charAt(i++)],a=i<t.length?n[t.charAt(i)]:0,s=++i<t.length?n[t.charAt(i)]:64,u=++i<t.length?n[t.charAt(i)]:64;if(++i,null==o||null==a||null==s||null==u)throw Error();r.push(o<<2|a>>4),64!=s&&(r.push(a<<4&240|s>>2),64!=u&&r.push(s<<6&192|u))}return r},init_:function(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(var t=0;t<this.ENCODED_VALS.length;t++)this.byteToCharMap_[t]=this.ENCODED_VALS.charAt(t),this.charToByteMap_[this.byteToCharMap_[t]]=t,this.byteToCharMapWebSafe_[t]=this.ENCODED_VALS_WEBSAFE.charAt(t),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[t]]=t,t>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(t)]=t,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(t)]=t)}}},c=function(t){try{return u.decodeString(t,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};function l(t,e){if(!(e instanceof Object))return e;switch(e.constructor){case Date:return new Date(e.getTime());case Object:void 0===t&&(t={});break;case Array:t=[];break;default:return e}for(var n in e)e.hasOwnProperty(n)&&(t[n]=l(t[n],e[n]));return t}var h=function(){function t(){var t=this;this.promise=new Promise((function(e,n){t.resolve=e,t.reject=n}))}return t.prototype.wrapCallback=function(t){var e=this;return function(n,r){n?e.reject(n):e.resolve(r),"function"==typeof t&&(e.promise.catch((function(){})),1===t.length?t(n):t(n,r))}},t}(),f=function(){return"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:""},d=Error.captureStackTrace,p=function(){return function(t,e){if(this.code=t,this.message=e,d)d(this,m.prototype.create);else try{throw Error.apply(this,arguments)}catch(n){this.name="FirebaseError",Object.defineProperty(this,"stack",{get:function(){return n.stack}})}}}();p.prototype=Object.create(Error.prototype),p.prototype.constructor=p,p.prototype.name="FirebaseError";var m=function(){function t(t,e,n){this.service=t,this.serviceName=e,this.errors=n,this.pattern=/\{\$([^}]+)}/g}return t.prototype.create=function(t,e){void 0===e&&(e={});var n,r=this.errors[t],i=this.service+"/"+t;n=void 0===r?"Error":r.replace(this.pattern,(function(t,n){var r=e[n];return void 0!==r?r.toString():"<"+n+"?>"}));var o=new p(i,n=this.serviceName+": "+n+" ("+i+").");for(var a in e)e.hasOwnProperty(a)&&"_"!==a.slice(-1)&&(o[a]=e[a]);return o},t}();function y(t){return JSON.parse(t)}var v=function(t){var e={},n={},r={},i="";try{var o=t.split(".");e=y(c(o[0])||""),n=y(c(o[1])||""),i=o[2],r=n.d||{},delete n.d}catch(a){}return{header:e,claims:n,data:r,signature:i}},g=function(t,e){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e(n,t[n])},b=function(t,e){return g(e,(function(e,n){t[e]=n})),t},w=function(t,e,n){for(var r in t)if(e.call(n,t[r],r,t))return r},_=function(t){function e(){var e=t.call(this)||this;e.chain_=[],e.buf_=[],e.W_=[],e.pad_=[],e.inbuf_=0,e.total_=0,e.blockSize=64,e.pad_[0]=128;for(var n=1;n<e.blockSize;
1++n)e.pad_[n]=0;return e.reset(),e}return r.__extends(e,t),e.prototype.reset=function(){this.chain_[0]=1732584193,this.chain_[1]=4023233417,this.chain_[2]=2562383102,this.chain_[3]=271733878,this.chain_[4]=3285377520,this.inbuf_=0,this.total_=0},e.prototype.compress_=function(t,e){e||(e=0);var n=this.W_;if("string"==typeof t)for(var r=0;r<16;r++)n[r]=t.charCodeAt(e)<<24|t.charCodeAt(e+1)<<16|t.charCodeAt(e+2)<<8|t.charCodeAt(e+3),e+=4;else for(r=0;r<16;r++)n[r]=t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3],e+=4;for(r=16;r<80;r++)n[r]=4294967295&((h=n[r-3]^n[r-8]^n[r-14]^n[r-16])<<1|h>>>31);var i,o,a=this.chain_[0],s=this.chain_[1],u=this.chain_[2],c=this.chain_[3],l=this.chain_[4];for(r=0;r<80;r++){r<40?r<20?(i=c^s&(u^c),o=1518500249):(i=s^u^c,o=1859775393):r<60?(i=s&u|c&(s|u),o=2400959708):(i=s^u^c,o=3395469782);var h=(a<<5|a>>>27)+i+l+o+n[r]&4294967295;l=c,c=u,u=4294967295&(s<<30|s>>>2),s=a,a=h}this.chain_[0]=this.chain_[0]+a&4294967295,this.chain_[1]=this.chain_[1]+s&4294967295,this.chain_[2]=this.chain_[2]+u&4294967295,this.chain_[3]=this.chain_[3]+c&4294967295,this.chain_[4]=this.chain_[4]+l&4294967295},e.prototype.update=function(t,e){if(null!=t){void 0===e&&(e=t.length);for(var n=e-this.blockSize,r=0,i=this.buf_,o=this.inbuf_;r<e;){if(0==o)for(;r<=n;)this.compress_(t,r),r+=this.blockSize;if("string"==typeof t){for(;r<e;)if(i[o]=t.charCodeAt(r),++r,++o==this.blockSize){this.compress_(i),o=0;break}}else for(;r<e;)if(i[o]=t[r],++r,++o==this.blockSize){this.compress_(i),o=0;break}}this.inbuf_=o,this.total_+=e}},e.prototype.digest=function(){var t=[],e=8*this.total_;this.update(this.pad_,this.inbuf_<56?56-this.inbuf_:this.blockSize-(this.inbuf_-56));for(var n=this.blockSize-1;n>=56;n--)this.buf_[n]=255&e,e/=256;this.compress_(this.buf_);var r=0;for(n=0;n<5;n++)for(var i=24;i>=0;i-=8)t[r]=this.chain_[n]>>i&255,++r;return t},e}(function(){return function(){this.blockSize=-1}}()),S=function(){function t(t,e){var n=this;this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=e,this.task.then((function(){t(n)})).catch((function(t){n.error(t)}))}return t.prototype.next=function(t){this.forEachObserver((function(e){e.next(t)}))},t.prototype.error=function(t){this.forEachObserver((function(e){e.error(t)})),this.close(t)},t.prototype.complete=function(){this.forEachObserver((function(t){t.complete()})),this.close()},t.prototype.subscribe=function(t,e,n){var r,i=this;if(void 0===t&&void 0===e&&void 0===n)throw new Error("Missing Observer.");void 0===(r=function(t,e){if("object"!=typeof t||null===t)return!1;for(var n=0,r=["next","error","complete"];n<r.length;n++){var i=r[n];if(i in t&&"function"==typeof t[i])return!0}return!1}(t)?t:{next:t,error:e,complete:n}).next&&(r.next=C),void 0===r.error&&(r.error=C),void 0===r.complete&&(r.complete=C);var o=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then((function(){try{i.finalError?r.error(i.finalError):r.complete()}catch(t){}})),this.observers.push(r),o},t.prototype.unsubscribeOne=function(t){void 0!==this.observers&&void 0!==this.observers[t]&&(delete this.observers[t],this.observerCount-=1,0===this.observerCount&&void 0!==this.onNoObservers&&this.onNoObservers(this))},t.prototype.forEachObserver=function(t){if(!this.finalized)for(var e=0;e<this.observers.length;e++)this.sendOne(e,t)},t.prototype.sendOne=function(t,e){var n=this;this.task.then((function(){if(void 0!==n.observers&&void 0!==n.observers[t])try{e(n.observers[t])}catch(r){"undefined"!=typeof console&&console.error&&console.error(r)}}))},t.prototype.close=function(t){var e=this;this.finalized||(this.finalized=!0,void 0!==t&&(this.finalError=t),this.task.then((function(){e.observers=void 0,e.onNoObservers=void 0})))},t}();function C(){}function E(t,e,n){var r="";switch(e){case 1:r=n?"first":"First";break;case 2:r=n?"second":"Second";break;case 3:r=n?"third":"Third";break;case 4:r=n?"fourth":"Fourth";break;default:throw new Error("errorPrefix called with argumentNumber > 4.  Need to update it?")}return t+" failed: "+r+" argument "}e.assert=o,e.assertionError=a,e.base64=u,e.base64Decode=c,e.base64Encode=function(t){var e=s(t);return u.encodeByteArray(e,!0)},e.CONSTANTS=i,e.deepCopy=function(t){return l(void 0,t)},e.deepExtend=l,e.patchProperty=function(t,e,n){t[e]=n},e.Deferred=h,e.getUA=f,e.isMobileCordova=function(){return"undefined"!=typeof window&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(f())},e.isNodeSdk=function(){return!0===i.NODE_CLIENT||!0===i.NODE_ADMIN},e.isReactNative=function(){return"object"==typeof navigator&&"ReactNative"===navigator.product},e.ErrorFactory=m,e.FirebaseError=p,e.patchCapture=function(t){var e=d;return d=t,e},e.jsonEval=y,e.stringify=function(t){return JSON.stringify(t)},e.decode=v,e.isAdmin=function(t){var e=v(t).claims;return"object"==typeof e&&!0===e.admin},e.issuedAtTime=function(t){var e=v(t).claims;return"object"==typeof e&&e.hasOwnProperty("iat")?e.iat:null},e.isValidFormat=function(t){var e=v(t).claims;return!!e&&"object"==typeof e&&e.hasOwnProperty("iat")}
1,e.isValidTimestamp=function(t){var e,n,r=v(t).claims,i=Math.floor((new Date).getTime()/1e3);return"object"==typeof r&&(r.hasOwnProperty("nbf")?e=r.nbf:r.hasOwnProperty("iat")&&(e=r.iat),n=r.hasOwnProperty("exp")?r.exp:e+86400),i&&e&&n&&i>=e&&i<=n},e.clone=function(t){return b({},t)},e.contains=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.every=function(t,e){for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&!e(n,t[n]))return!1;return!0},e.extend=b,e.findKey=w,e.findValue=function(t,e,n){var r=w(t,e,n);return r&&t[r]},e.forEach=g,e.getAnyKey=function(t){for(var e in t)return e},e.getCount=function(t){var e=0;for(var n in t)e++;return e},e.getValues=function(t){var e=[],n=0;for(var r in t)e[n++]=t[r];return e},e.isEmpty=function(t){for(var e in t)return!1;return!0},e.isNonNullObject=function(t){return"object"==typeof t&&null!==t},e.map=function(t,e,n){var r={};for(var i in t)r[i]=e.call(n,t[i],i,t);return r},e.safeGet=function(t,e){if(Object.prototype.hasOwnProperty.call(t,e))return t[e]},e.querystring=function(t){var e=[];return g(t,(function(t,n){Array.isArray(n)?n.forEach((function(n){e.push(encodeURIComponent(t)+"="+encodeURIComponent(n))})):e.push(encodeURIComponent(t)+"="+encodeURIComponent(n))})),e.length?"&"+e.join("&"):""},e.querystringDecode=function(t){var e={};return t.replace(/^\?/,"").split("&").forEach((function(t){if(t){var n=t.split("=");e[n[0]]=n[1]}})),e},e.Sha1=_,e.async=function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];Promise.resolve(!0).then((function(){t.apply(void 0,n)})).catch((function(t){e&&e(t)}))}},e.createSubscribe=function(t,e){var n=new S(t,e);return n.subscribe.bind(n)},e.errorPrefix=E,e.validateArgCount=function(t,e,n,r){var i;if(r<e?i="at least "+e:r>n&&(i=0===n?"none":"no more than "+n),i)throw new Error(t+" failed: Was called with "+r+(1===r?" argument.":" arguments.")+" Expects "+i+".")},e.validateCallback=function(t,e,n,r){if((!r||n)&&"function"!=typeof n)throw new Error(E(t,e,r)+"must be a valid function.")},e.validateContextObject=function(t,e,n,r){if((!r||n)&&("object"!=typeof n||null===n))throw new Error(E(t,e,r)+"must be a valid context object.")},e.validateNamespace=function(t,e,n,r){if((!r||n)&&"string"!=typeof n)throw new Error(E(t,e,r)+"must be a valid firebase namespace.")},e.stringLength=function(t){for(var e=0,n=0;n<t.length;n++){var r=t.charCodeAt(n);r<128?e++:r<2048?e+=2:r>=55296&&r<=56319?(e+=4,n++):e+=3}return e},e.stringToByteArray=function(t){for(var e=[],n=0,r=0;r<t.length;r++){var i=t.charCodeAt(r);if(i>=55296&&i<=56319){var a=i-55296;r++,o(r<t.length,"Surrogate pair missing trail surrogate."),i=65536+(a<<10)+(t.charCodeAt(r)-56320)}i<128?e[n++]=i:i<2048?(e[n++]=i>>6|192,e[n++]=63&i|128):i<65536?(e[n++]=i>>12|224,e[n++]=i>>6&63|128,e[n++]=63&i|128):(e[n++]=i>>18|240,e[n++]=i>>12&63|128,e[n++]=i>>6&63|128,e[n++]=63&i|128)}return e}},zotm:function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n("rPjj"),i=n("Fxb1");function o(t,e,n,o,a){if(void 0===a&&(a=new r.a(t,n,o)),!a.closed)return Object(i.a)(e)(a)}}},[[0,1]]]);

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.