function getFirebaseToken(){messaging.getToken().then(n=>{n?(cookie_manager.set_cookie("notify_token",n,3650),cookie_manager.set_cookie("subscribe_site","1",3650),apiRecallAfterSubscribe!==undefined&&apiRecallAfterSubscribe!==null&&$.ajax({url:apiRecallAfterSubscribe,xhrFields:{withCredentials:!0},method:"POST",success:function(n){console.log(n)}})):requestPermission()}).catch(n=>{console.log("An error occurred while retrieving token. ",n)})}function requestPermission(){var n=cookie_manager.get_cookie("subscribe_site");(n===null||n===undefined||n==="")&&$(".notifycation-container").animate({top:"0px"},1e3)}var firebaseConfig,subscribe;!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(n=n||self).firebase=t()}(this,function(){"use strict";function at(n,t,i,r){return new(i=i||Promise)(function(u,f){function o(n){try{e(r.next(n))}catch(n){f(n)}}function s(n){try{e(r.throw(n))}catch(n){f(n)}}function e(n){var t;n.done?u(n.value):((t=n.value)instanceof i?t:new i(function(n){n(t)})).then(o,s)}e((r=r.apply(n,t||[])).next())})}function ii(n,t){function o(e){return function(o){return function(e){if(f)throw new TypeError("Generator is already executing.");for(;r;)try{if(f=1,u&&(i=2&e[0]?u.return:e[0]?u.throw||((i=u.return)&&i.call(u),0):u.next)&&!(i=i.call(u,e[1])).done)return i;switch(u=0,i&&(e=[2&e[0],i.value]),e[0]){case 0:case 1:i=e;break;case 4:return r.label++,{value:e[1],done:!1};case 5:r.label++;u=e[1];e=[0];continue;case 7:e=r.ops.pop();r.trys.pop();continue;default:if(!(i=0<(i=r.trys).length&&i[i.length-1])&&(6===e[0]||2===e[0])){r=0;continue}if(3===e[0]&&(!i||e[1]>i[0]&&e[1]<i[3])){r.label=e[1];break}if(6===e[0]&&r.label<i[1]){r.label=i[1];i=e;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(e);break}i[2]&&r.ops.pop();r.trys.pop();continue}e=t.call(n,r)}catch(o){e=[6,o];u=0}finally{f=i=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}([e,o])}}var f,u,i,e,r={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return e={next:o(0),"throw":o(1),"return":o(2)},"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e}function tt(n){var t="function"==typeof Symbol&&Symbol.iterator,i=t&&n[t],r=0;if(i)return i.call(n);if(n&&"number"==typeof n.length)return{next:function(){return n&&r>=n.length&&(n=void 0),{value:n&&n[r++],done:!n}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.");}function ri(n,t){var i="function"==typeof Symbol&&n[Symbol.iterator],r,f,u,e;if(!i)return n;u=i.call(n);e=[];try{for(;(void 0===t||0<t--)&&!(r=u.next()).done;)e.push(r.value)}catch(n){f={error:n}}finally{try{r&&!r.done&&(i=u.return)&&i.call(u)}finally{if(f)throw f.error;}}return e}function v(n,t){if(!(t instanceof Object))return t;switch(t.constructor){case Date:return new Date(t.getTime());case Object:void 0===n&&(n={});break;case Array:n=[];break;default:return t}for(var i in t)t.hasOwnProperty(i)&&(n[i]=v(n[i],t[i]));return n}function vt(){var n=this;this.reject=function(){};this.resolve=function(){};this.promise=new Promise(function(t,i){n.resolve=t;n.reject=i})}function yt(){this.constructor=rt}function ut(n,t){var i=it.call(this,t)||this;return i.code=n,i.name="FirebaseError",Object.setPrototypeOf(i,ut.prototype),Error.captureStackTrace&&Error.captureStackTrace(i,ft.prototype.create),i}function pt(n,t,i){this.service=n;this.serviceName=t;this.errors=i}function wt(n,t){return Object.prototype.hasOwnProperty.call(n,t)}function oi(n,t){var i=new si(n,t);return i.subscribe.bind(i)}function e(n,t){var i=this;this.observers=[];this.unsubscribes=[];this.observerCount=0;this.task=Promise.resolve();this.finalized=!1;this.onNoObservers=t;this.task.then(function(){n(i)}).catch(function(n){i.error(n)})}function et(){}function b(n,t,i){this.name=n;this.instanceFactory=t;this.type=i;this.multipleInstances=!1;this.serviceProps={};this.instantiationMode="LAZY"}function u(n,t){this.name=n;this.container=t;this.component=null;this.instances=new Map;this.instancesDeferred=new Map}function y(n){this.name=n;this.providers=new Map}function r(){for(var t,i,u=0,n=0,f=arguments.length;n<f;n++)u+=arguments[n].length;for(t=Array(u),i=0,n=0;n<f;n++)for(var e=arguments[n],r=0,o=e.length;r<o;r++,i++)t[i]=e[r];return t}function li(n,t){for(var e,f,u=[],i=2;i<arguments.length;i++)u[i-2]=arguments[i];if(!(t<n.logLevel)){if(e=(new Date).toISOString(),f=vi[t],!f)throw new Error("Attempted to log a message with an invalid logType (value: "+t+")");console[f].apply(console,r(["["+e+"]  "+n.name+":"],u))}}function o(n){this.name=n;this._logLevel=ai;this._logHandler=li;this._userLogHandler=null;st.push(this)}function pi(n){var t="string"==typeof n?bt[n]:n;st.forEach(function(n){n.logLevel=t})}function f(n,t,i){var f,e,s=this,u,r,o;this.firebase_=i;this.isDeleted_=!1;this.name_=t.name;this.automaticDataCollectionEnabled_=t.automaticDataCollectionEnabled||!1;this.options_=v(void 0,n);this.container=new ci(t.name);this._addComponent(new ot("app",function(){return s},"PUBLIC"));try{for(u=tt(this.firebase_.INTERNAL.components.values()),r=u.next();!r.done;r=u.next())o=r.value,this._addComponent(o)}catch(n){f={error:n}}finally{try{r&&!r.done&&(e=u.return)&&e.call(u)}finally{if(f)throw f.error;}}}function ki(t){function f(n){if(!wt(i,n=n||k))throw l.create("no-app",{appName:n});return i[n]}function e(n){var h,c,e=n.name,y,s,o,p;if(u.has(e))return a.debug("There were multiple attempts to register component "+e+"."),"PUBLIC"===n.type?r[e]:null;(u.set(e,n),"PUBLIC"===n.type)&&(y=function(n){if(void 0===n&&(n=f()),"function"!=typeof n[e])throw l.create("invalid-app-argument",{appName:e});return n[e]()},void 0!==n.serviceProps&&v(y,n.serviceProps),r[e]=y,t.prototype[e]=function(){for(var i=[],t=0;t<arguments.length;t++)i[t]=arguments[t];return this._getService.bind(this,e).apply(this,n.multipleInstances?i:[])});try{for(s=tt(Object.keys(i)),o=s.next();!o.done;o=s.next())p=o.value,i[p]._addComponent(n)}catch(c){h={error:c}}finally{try{o&&!o.done&&(c=s.return)&&c.call(s)}finally{if(h)throw h.error;}}return"PUBLIC"===n.type?r[e]:null}var i={},u=new Map,r={__esModule:!0,initializeApp:function(n,u){var e,f,o;if(void 0===u&&(u={}),("object"!=typeof u||null===u)&&(u={name:u}),e=u,void 0===e.name&&(e.name=k),f=e.name,"string"!=typeof f||!f)throw l.create("bad-app-name",{appName:String(f)});if(wt(i,f))throw l.create("duplicate-app",{appName:f});return o=new t(n,e,r),i[f]=o},app:f,registerVersion:function(n,t,i){var s,r=null!==(s=bi[n])&&void 0!==s?s:n,f,o,u;if(i&&(r+="-"+i),f=r.match(/\s|\//),o=t.match(/\s|\//),f||o)return u=['Unable to register library "'+r+'" with version "'+t+'":'],f&&u.push('library name "'+r+'" contains illegal characters (whitespace or "/")'),f&&o&&u.push("and"),o&&u.push('version name "'+t+'" contains illegal characters (whitespace or "/")'),void a.warn(u.join(" "));e(new ot(r+"-version",function(){return{library:r,version:t}},"VERSION"))},setLogLevel:pi,onLog:function(t,i){if(null!==t&&"function"!=typeof t)throw l.create("invalid-log-argument",{appName:name});!function(t,i){for(var f=function(r){var u=null;i&&i.level&&(u=bt[i.level]);r.userLogHandler=null===t?null:function(i,r){for(var o,e=[],f=2;f<arguments.length;f++)e[f-2]=arguments[f];o=e.map(function(n){if(null==n)return null;if("string"==typeof n)return n;if("number"==typeof n||"boolean"==typeof n)return n.toString();if(n instanceof Error)return n.message;try{return JSON.stringify(n)}catch(n){return null}}).filter(function(n){return n}).join(" ");r>=(null!=u?u:i.logLevel)&&t({level:n[r].toLowerCase(),message:o,args:e,type:i.name})}},r=0,u=st;r<u.length;r++)f(u[r])}(t,i)},apps:null,SDK_VERSION:dt,INTERNAL:{registerComponent:e,removeApp:function(n){delete i[n]},components:u,useAsService:function(n,t){return"serverAuth"!==t?t:null}}};return r.default=r,Object.defineProperty(r,"apps",{get:function(){return Object.keys(i).map(function(n){return i[n]})}}),f.App=t,r}function ni(n){this.container=n}var lt=function(n,t){return(lt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])})(n,t)},p=function(){return(p=Object.assign||function(n){for(var r,i,t=1,u=arguments.length;t<u;t++)for(i in r=arguments[t])Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i]);return n}).apply(this,arguments)},ui=(vt.prototype.wrapCallback=function(n){var t=this;return function(i,r){i?t.reject(i):t.resolve(r);"function"==typeof n&&(t.promise.catch(function(){}),1===n.length?n(i):n(i,r))}},vt),it,rt,w,fi=(it=Error,lt(rt=ut,w=it),rt.prototype=null===w?Object.create(w):(yt.prototype=w.prototype,new yt),ut),ft=(pt.prototype.create=function(n){for(var t,r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];for(var o,u=r[0]||{},s=this.service+"/"+n,h=this.errors[n],l=h?(o=u,h.replace(ei,function(n,t){var i=o[t];return null!=i?i.toString():"<"+t+"?>"})):"Error",a=this.serviceName+": "+l+" ("+s+").",f=new fi(s,a),e=0,c=Object.keys(u);e<c.length;e++)t=c[e],"_"!==t.slice(-1)&&(t in f&&console.warn('Overwriting FirebaseError base field "'+t+'" can cause unexpected behavior.'),f[t]=u[t]);return f},pt),ei=/\{\$([^}]+)}/g,si=(e.prototype.next=function(n){this.forEachObserver(function(t){t.next(n)})},e.prototype.error=function(n){this.forEachObserver(function(t){t.error(n)});this.close(n)},e.prototype.complete=function(){this.forEachObserver(function(n){n.complete()});this.close()},e.prototype.subscribe=function(n,t,i){var r,u=this,f;if(void 0===n&&void 0===t&&void 0===i)throw new Error("Missing Observer.");return void 0===(r=function(n,t){var i,r,u;if("object"==typeof n&&null!==n)for(i=0,r=t;i<r.length;i++)if(u=r[i],u in n&&"function"==typeof n[u])return 1}(n,["next","error","complete"])?n:{next:n,error:t,complete:i}).next&&(r.next=et),void 0===r.error&&(r.error=et),void 0===r.complete&&(r.complete=et),f=this.unsubscribeOne.bind(this,this.observers.length),this.finalized&&this.task.then(function(){try{u.finalError?r.error(u.finalError):r.complete()}catch(n){}}),this.observers.push(r),f},e.prototype.unsubscribeOne=function(n){void 0!==this.observers&&void 0!==this.observers[n]&&(delete this.observers[n],--this.observerCount,0===this.observerCount&&void 0!==this.onNoObservers&&this.onNoObservers(this))},e.prototype.forEachObserver=function(n){if(!this.finalized)for(var t=0;t<this.observers.length;t++)this.sendOne(t,n)},e.prototype.sendOne=function(n,t){var i=this;this.task.then(function(){if(void 0!==i.observers&&void 0!==i.observers[n])try{t(i.observers[n])}catch(n){"undefined"!=typeof console&&console.error&&console.error(n)}})},e.prototype.close=function(n){var t=this;this.finalized||(this.finalized=!0,void 0!==n&&(this.finalError=n),this.task.then(function(){t.observers=void 0;t.onNoObservers=void 0}))},e),ot=(b.prototype.setInstantiationMode=function(n){return this.instantiationMode=n,this},b.prototype.setMultipleInstances=function(n){return this.multipleInstances=n,this},b.prototype.setServiceProps=function(n){return this.serviceProps=n,this},b),h="[DEFAULT]",hi=(u.prototype.get=function(n){var t,i,r;if(void 0===n&&(n=h),t=this.normalizeInstanceIdentifier(n),!this.instancesDeferred.has(t)){i=new ui;this.instancesDeferred.set(t,i);try{r=this.getOrInitializeService(t);r&&i.resolve(r)}catch(n){}}return this.instancesDeferred.get(t).promise},u.prototype.getImmediate=function(n){var i=p({identifier:h,optional:!1},n),u=i.identifier,r=i.optional,f=this.normalizeInstanceIdentifier(u),t;try{if(t=this.getOrInitializeService(f),t)return t;if(r)return null;throw Error("Service "+this.name+" is not available");}catch(n){if(r)return null;throw n;}},u.prototype.getComponent=function(){return this.component},u.prototype.setComponent=function(n){var r,u,i,t,e;if(n.name!==this.name)throw Error("Mismatching Component "+n.name+" for Provider "+this.name+".");if(this.component)throw Error("Component for "+this.name+" has already been provided");if("EAGER"===(this.component=n).instantiationMode)try{this.getOrInitializeService(h)}catch(n){}try{for(i=tt(this.instancesDeferred.entries()),t=i.next();!t.done;t=i.next()){var f=ri(t.value,2),o=f[0],s=f[1],c=this.normalizeInstanceIdentifier(o);try{e=this.getOrInitializeService(c);s.resolve(e)}catch(n){}}}catch(n){r={error:n}}finally{try{t&&!t.done&&(u=i.return)&&u.call(i)}finally{if(r)throw r.error;}}},u.prototype.clearInstance=function(n){void 0===n&&(n=h);this.instancesDeferred.delete(n);this.instances.delete(n)},u.prototype.delete=function(){return at(this,void 0,void 0,function(){var n;return ii(this,function(t){switch(t.label){case 0:return n=Array.from(this.instances.values()),[4,Promise.all(n.filter(function(n){return"INTERNAL"in n}).map(function(n){return n.INTERNAL.delete()}))];case 1:return t.sent(),[2]}})})},u.prototype.isComponentSet=function(){return null!=this.component},u.prototype.getOrInitializeService=function(n){var i,t=this.instances.get(n);return!t&&this.component&&(t=this.component.instanceFactory(this.container,(i=n)===h?void 0:i),this.instances.set(n,t)),t||null},u.prototype.normalizeInstanceIdentifier=function(n){return!this.component||this.component.multipleInstances?n:h},u),c,ci=(y.prototype.addComponent=function(n){var t=this.getProvider(n.name);if(t.isComponentSet())throw new Error("Component "+n.name+" has already been registered with "+this.name);t.setComponent(n)},y.prototype.addOrOverwriteComponent=function(n){this.getProvider(n.name).isComponentSet()&&this.providers.delete(n.name);this.addComponent(n)},y.prototype.getProvider=function(n){if(this.providers.has(n))return this.providers.get(n);var t=new hi(n,this);return this.providers.set(n,t),t},y.prototype.getProviders=function(){return Array.from(this.providers.values())},y),n,i,st=[],dt,g,gt,ht,ti,ct,di,nt;(i=n=n||{})[i.DEBUG=0]="DEBUG";i[i.VERBOSE=1]="VERBOSE";i[i.INFO=2]="INFO";i[i.WARN=3]="WARN";i[i.ERROR=4]="ERROR";i[i.SILENT=5]="SILENT";var s,bt={debug:n.DEBUG,verbose:n.VERBOSE,info:n.INFO,warn:n.WARN,error:n.ERROR,silent:n.SILENT},ai=n.INFO,vi=((c={})[n.DEBUG]="log",c[n.VERBOSE]="log",c[n.INFO]="info",c[n.WARN]="warn",c[n.ERROR]="error",c),yi=(Object.defineProperty(o.prototype,"logLevel",{get:function(){return this._logLevel},set:function(t){if(!(t in n))throw new TypeError("Invalid value assigned to `logLevel`");this._logLevel=t},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"logHandler",{get:function(){return this._logHandler},set:function(n){if("function"!=typeof n)throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=n},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"userLogHandler",{get:function(){return this._userLogHandler},set:function(n){this._userLogHandler=n},enumerable:!0,configurable:!0}),o.prototype.debug=function(){for(var i=[],t=0;t<arguments.length;t++)i[t]=arguments[t];this._userLogHandler&&this._userLogHandler.apply(this,r([this,n.DEBUG],i));this._logHandler.apply(this,r([this,n.DEBUG],i))},o.prototype.log=function(){for(var i=[],t=0;t<arguments.length;t++)i[t]=arguments[t];this._userLogHandler&&this._userLogHandler.apply(this,r([this,n.VERBOSE],i));this._logHandler.apply(this,r([this,n.VERBOSE],i))},o.prototype.info=function(){for(var i=[],t=0;t<arguments.length;t++)i[t]=arguments[t];this._userLogHandler&&this._userLogHandler.apply(this,r([this,n.INFO],i));this._logHandler.apply(this,r([this,n.INFO],i))},o.prototype.warn=function(){for(var i=[],t=0;t<arguments.length;t++)i[t]=arguments[t];this._userLogHandler&&this._userLogHandler.apply(this,r([this,n.WARN],i));this._logHandler.apply(this,r([this,n.WARN],i))},o.prototype.error=function(){for(var i=[],t=0;t<arguments.length;t++)i[t]=arguments[t];this._userLogHandler&&this._userLogHandler.apply(this,r([this,n.ERROR],i));this._logHandler.apply(this,r([this,n.ERROR],i))},o);var t,wi=((s={})["no-app"]="No Firebase App '{$appName}' has been created - call Firebase App.initializeApp()",s["bad-app-name"]="Illegal App name: '{$appName}",s["duplicate-app"]="Firebase App named '{$appName}' already exists",s["app-deleted"]="Firebase App named '{$appName}' already deleted",s["invalid-app-argument"]="firebase.{$appName}() takes either no argument or a Firebase App instance.",s["invalid-log-argument"]="First argument to `onLog` must be null or a function.",s),l=new ft("app","Firebase",wi),kt="@firebase/app",k="[DEFAULT]",bi=((t={})[kt]="fire-core",t["@firebase/analytics"]="fire-analytics",t["@firebase/auth"]="fire-auth",t["@firebase/database"]="fire-rtdb",t["@firebase/functions"]="fire-fn",t["@firebase/installations"]="fire-iid",t["@firebase/messaging"]="fire-fcm",t["@firebase/performance"]="fire-perf",t["@firebase/remote-config"]="fire-rc",t["@firebase/storage"]="fire-gcs",t["@firebase/firestore"]="fire-fst",t["fire-js"]="fire-js",t["firebase-wrapper"]="fire-js-all",t),a=new yi("@firebase/app"),d=(Object.defineProperty(f.prototype,"automaticDataCollectionEnabled",{get:function(){return this.checkDestroyed_(),this.automaticDataCollectionEnabled_},set:function(n){this.checkDestroyed_();this.automaticDataCollectionEnabled_=n},enumerable:!0,configurable:!0}),Object.defineProperty(f.prototype,"name",{get:function(){return this.checkDestroyed_(),this.name_},enumerable:!0,configurable:!0}),Object.defineProperty(f.prototype,"options",{get:function(){return this.checkDestroyed_(),this.options_},enumerable:!0,configurable:!0}),f.prototype.delete=function(){var n=this;return new Promise(function(t){n.checkDestroyed_();t()}).then(function(){return n.firebase_.INTERNAL.removeApp(n.name_),Promise.all(n.container.getProviders().map(function(n){return n.delete()}))}).then(function(){n.isDeleted_=!0})},f.prototype._getService=function(n,t){return void 0===t&&(t=k),this.checkDestroyed_(),this.container.getProvider(n).getImmediate({identifier:t})},f.prototype._removeServiceInstance=function(n,t){void 0===t&&(t=k);this.container.getProvider(n).clearInstance(t)},f.prototype._addComponent=function(n){try{this.container.addComponent(n)}catch(t){a.debug("Component "+n.name+" failed to register with FirebaseApp "+this.name,t)}},f.prototype._addOrOverwriteComponent=function(n){this.container.addOrOverwriteComponent(n)},f.prototype.checkDestroyed_=function(){if(this.isDeleted_)throw l.create("app-deleted",{appName:this.name_});},f);return d.prototype.name&&d.prototype.options||d.prototype.delete||console.log("dc"),dt="7.14.4",g=function at(){var n=ki(d);return n.INTERNAL=p(p({},n.INTERNAL),{createFirebaseNamespace:at,extendNamespace:function(t){v(n,t)},createSubscribe:oi,ErrorFactory:ft,deepExtend:v}),n}(),gt=(ni.prototype.getPlatformInfoString=function(){return this.container.getProviders().map(function(n){if("VERSION"!==(null==(t=n.getComponent())?void 0:t.type))return null;var t,i=n.getImmediate();return i.library+"/"+i.version}).filter(function(n){return n}).join(" ")},ni),"object"==typeof self&&self.self===self&&void 0!==self.firebase&&(a.warn("\n    Warning: Firebase is already defined in the global scope. Please make sure\n    Firebase library is only loaded once.\n  "),ht=self.firebase.SDK_VERSION,ht&&0<=ht.indexOf("LITE")&&a.warn("\n    Warning: You are trying to load Firebase while using Firebase Performance standalone script.\n    You should load Firebase Performance with this instance of Firebase to avoid loading duplicate code.\n    ")),ti=g.initializeApp,g.initializeApp=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return function(){try{return"[object process]"===Object.prototype.toString.call(global.process)}catch(n){return}}()&&a.warn('\n      Warning: This is a browser-targeted Firebase bundle but it appears it is being\n      run in a Node environment.  If running in a Node environment, make sure you\n      are using the bundle specified by the "main" field in package.json.\n      \n      If you are using Webpack, you can specify "main" as the first item in\n      "resolve.mainFields":\n      https://webpack.js.org/configuration/resolve/#resolvemainfields\n      \n      If using Rollup, use the rollup-plugin-node-resolve plugin and specify "main"\n      as the first item in "mainFields", e.g. [\'main\', \'module\'].\n      https://github.com/rollup/rollup-plugin-node-resolve\n      '),ti.apply(void 0,t)},nt=g,(ct=nt).INTERNAL.registerComponent(new ot("platform-logger",function(n){return new gt(n)},"PRIVATE")),ct.registerVersion(kt,"0.6.3",di),ct.registerVersion("fire-js",""),nt.registerVersion("firebase","7.14.4","app"),nt});!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("@firebase/app")):"function"==typeof define&&define.amd?define(["@firebase/app"],t):t((n=n||self).firebase)}(this,function(n){"use strict";try{(function(){function t(n,t,i,r){return new(i=i||Promise)(function(u,f){function o(n){try{e(r.next(n))}catch(n){f(n)}}function s(n){try{e(r.throw(n))}catch(n){f(n)}}function e(n){var t;n.done?u(n.value):((t=n.value)instanceof i?t:new i(function(n){n(t)})).then(o,s)}e((r=r.apply(n,t||[])).next())})}function i(n,t){function o(e){return function(o){return function(e){if(f)throw new TypeError("Generator is already executing.");for(;r;)try{if(f=1,u&&(i=2&e[0]?u.return:e[0]?u.throw||((i=u.return)&&i.call(u),0):u.next)&&!(i=i.call(u,e[1])).done)return i;switch(u=0,i&&(e=[2&e[0],i.value]),e[0]){case 0:case 1:i=e;break;case 4:return r.label++,{value:e[1],done:!1};case 5:r.label++;u=e[1];e=[0];continue;case 7:e=r.ops.pop();r.trys.pop();continue;default:if(!(i=0<(i=r.trys).length&&i[i.length-1])&&(6===e[0]||2===e[0])){r=0;continue}if(3===e[0]&&(!i||e[1]>i[0]&&e[1]<i[3])){r.label=e[1];break}if(6===e[0]&&r.label<i[1]){r.label=i[1];i=e;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(e);break}i[2]&&r.ops.pop();r.trys.pop();continue}e=t.call(n,r)}catch(o){e=[6,o];u=0}finally{f=i=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}([e,o])}}var f,u,i,e,r={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return e={next:o(0),"throw":o(1),"return":o(2)},"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e}function g(n){var t="function"==typeof Symbol&&Symbol.iterator,i=t&&n[t],r=0;if(i)return i.call(n);if(n&&"number"==typeof n.length)return{next:function(){return n&&r>=n.length&&(n=void 0),{value:n&&n[r++],done:!n}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.");}function du(n,t){var i="function"==typeof Symbol&&n[Symbol.iterator],r,f,u,e;if(!i)return n;u=i.call(n);e=[];try{for(;(void 0===t||0<t--)&&!(r=u.next()).done;)e.push(r.value)}catch(n){f={error:n}}finally{try{r&&!r.done&&(i=u.return)&&i.call(u)}finally{if(f)throw f.error;}}return e}function di(){for(var n=[],t=0;t<arguments.length;t++)n=n.concat(du(arguments[t]));return n}function gi(){this.constructor=bt}function dt(n,t){var i=wt.call(this,t)||this;return i.code=n,i.name="FirebaseError",Object.setPrototypeOf(i,dt.prototype),Error.captureStackTrace&&Error.captureStackTrace(i,ft.prototype.create),i}function nr(n,t,i){this.service=n;this.serviceName=t;this.errors=i}function et(n,t,i){this.name=n;this.instanceFactory=t;this.type=i;this.multipleInstances=!1;this.serviceProps={};this.instantiationMode="LAZY"}function ir(n){return new Promise(function(t,i){n.onsuccess=function(){t(n.result)};n.onerror=function(){i(n.error)}})}function ot(n,t,i){var r,u=new Promise(function(u,f){ir(r=n[t].apply(n,i)).then(u,f)});return u.request=r,u}function b(n,t,i){i.forEach(function(i){Object.defineProperty(n.prototype,i,{get:function(){return this[t][i]},set:function(n){this[t][i]=n}})})}function ni(n,t,i,r){r.forEach(function(r){r in i.prototype&&(n.prototype[r]=function(){return ot(this[t],r,arguments)})})}function st(n,t,i,r){r.forEach(function(r){r in i.prototype&&(n.prototype[r]=function(){return this[t][r].apply(this[t],arguments)})})}function rr(n,t,i,r){r.forEach(function(r){r in i.prototype&&(n.prototype[r]=function(){return n=this[t],(i=ot(n,r,arguments)).then(function(n){if(n)return new nt(n,i.request)});var n,i})})}function c(n){this._index=n}function nt(n,t){this._cursor=n;this._request=t}function s(n){this._store=n}function tt(n){this._tx=n;this.complete=new Promise(function(t,i){n.oncomplete=function(){t()};n.onerror=function(){i(n.error)};n.onabort=function(){i(n.error)}})}function ht(n,t,i){this._db=n;this.oldVersion=t;this.transaction=new tt(i)}function ct(n){this._db=n}function ti(n,t,i){var u=ot(indexedDB,"open",[n,t]),r=u.request;return r&&(r.onupgradeneeded=function(n){i&&i(new ht(r.result,n.oldVersion,r.transaction))}),u.then(function(n){return new ct(n)})}function ii(n){return ot(indexedDB,"deleteDatabase",[n])}function sr(n){return n instanceof kt&&n.code.includes("request-failed")}function ri(n){var t=n.projectId;return gu+"/projects/"+t+"/installations"}function hr(n){return{token:n.token,requestStatus:2,expiresIn:(t=n.expiresIn,Number(t.replace("s","000"))),creationTime:Date.now()};var t}function ui(n,r){return t(this,void 0,void 0,function(){var u,t;return i(this,function(i){switch(i.label){case 0:return[4,r.json()];case 1:return u=i.sent(),t=u.error,[2,h.create("request-failed",{requestName:n,serverCode:t.code,serverMessage:t.message,serverStatus:t.status})]}})})}function cr(n){var t=n.apiKey;return new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":t})}function lr(n,t){var r=t.refreshToken,i=cr(n);return i.append("Authorization",or+" "+r),i}function fi(n){return t(this,void 0,void 0,function(){var t;return i(this,function(i){switch(i.label){case 0:return[4,n()];case 1:return 500<=(t=i.sent()).status&&t.status<600?[2,n()]:[2,t]}})})}function ar(n){return new Promise(function(t){setTimeout(t,n)})}function rf(){var n,t;try{return n=new Uint8Array(17),(self.crypto||self.msCrypto).getRandomValues(n),n[0]=112+n[0]%16,t=function(n){return btoa(String.fromCharCode.apply(String,di(n))).replace(/\+/g,"-").replace(/\//g,"_")}(n).substr(0,22),vr.test(t)?t:lt}catch(n){return lt}}function k(n){return n.appName+"!"+n.appId}function yr(n,t){var i=k(n);pr(i,t),function(n,t){var i=wr();i&&i.postMessage({key:n,fid:t});br()}(i,t)}function pr(n,t){var u,f,e=a.get(n),r,i;if(e)try{for(r=g(e),i=r.next();!i.done;i=r.next())i.value(t)}catch(n){u={error:n}}finally{try{i&&!i.done&&(f=r.return)&&f.call(r)}finally{if(u)throw u.error;}}}function wr(){return!v&&"BroadcastChannel"in self&&((v=new BroadcastChannel("[Firebase] FID Change")).onmessage=function(n){pr(n.data.key,n.data.fid)}),v}function br(){0===a.size&&v&&(v.close(),v=null)}function ei(){return dr=dr||ti(uf,ff,function(n){switch(n.oldVersion){case 0:n.createObjectStore(y)}})}function at(n,r){return t(this,void 0,void 0,function(){var t,e,u,o,f;return i(this,function(i){switch(i.label){case 0:return t=k(n),[4,ei()];case 1:return e=i.sent(),u=e.transaction(y,"readwrite"),[4,(o=u.objectStore(y)).get(t)];case 2:return f=i.sent(),[4,o.put(r,t)];case 3:return i.sent(),[4,u.complete];case 4:return i.sent(),f&&f.fid===r.fid||yr(n,r.fid),[2,r]}})})}function oi(n){return t(this,void 0,void 0,function(){var t,r,u;return i(this,function(i){switch(i.label){case 0:return t=k(n),[4,ei()];case 1:return r=i.sent(),[4,(u=r.transaction(y,"readwrite")).objectStore(y).delete(t)];case 2:return i.sent(),[4,u.complete];case 3:return i.sent(),[2]}})})}function it(n,r){return t(this,void 0,void 0,function(){var u,s,e,o,f,t;return i(this,function(i){switch(i.label){case 0:return u=k(n),[4,ei()];case 1:return s=i.sent(),e=s.transaction(y,"readwrite"),[4,(o=e.objectStore(y)).get(u)];case 2:return f=i.sent(),void 0!==(t=r(f))?[3,4]:[4,o.delete(u)];case 3:return i.sent(),[3,6];case 4:return[4,o.put(t,u)];case 5:i.sent();i.label=6;case 6:return[4,e.complete];case 7:return i.sent(),!t||f&&f.fid===t.fid||yr(n,t.fid),[2,t]}})})}function si(n){return t(this,void 0,void 0,function(){var r,f,u;return i(this,function(e){switch(e.label){case 0:return[4,it(n,function(u){var e=nu(u||{fid:rf(),registrationStatus:0}),f=function(n,r){var f,u,e;return 0!==r.registrationStatus?1===r.registrationStatus?{installationEntry:r,registrationPromise:function(n){return t(this,void 0,void 0,function(){var t,r,u,f;return i(this,function(i){switch(i.label){case 0:return[4,gr(n)];case 1:t=i.sent();i.label=2;case 2:return 1!==t.registrationStatus?[3,5]:[4,ar(100)];case 3:return i.sent(),[4,gr(n)];case 4:return t=i.sent(),[3,2];case 5:return 0!==t.registrationStatus?[3,7]:[4,si(n)];case 6:return r=i.sent(),u=r.installationEntry,(f=r.registrationPromise)?[2,f]:[2,u];case 7:return[2,t]}})})}(n)}:{installationEntry:r}:navigator.onLine?(u={fid:r.fid,registrationStatus:1,registrationTime:Date.now()},e=function(n,r){return t(this,void 0,void 0,function(){var f,u;return i(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,7]),[4,function(n,r){var u=r.fid;return t(this,void 0,void 0,function(){var f,e,o,s,r,t;return i(this,function(i){switch(i.label){case 0:return f=ri(n),e=cr(n),o={fid:u,authVersion:or,appId:n.appId,sdkVersion:er},s={method:"POST",headers:e,body:JSON.stringify(o)},[4,fi(function(){return fetch(f,s)})];case 1:return(r=i.sent()).ok?[4,r.json()]:[3,3];case 2:return t=i.sent(),[2,{fid:t.fid||u,registrationStatus:2,refreshToken:t.refreshToken,authToken:hr(t.authToken)}];case 3:return[4,ui("Create Installation",r)];case 4:throw i.sent();}})})}(n,r)];case 1:return f=e.sent(),[2,at(n,f)];case 2:return sr(u=e.sent())&&409===u.serverCode?[4,oi(n)]:[3,4];case 3:return e.sent(),[3,6];case 4:return[4,at(n,{fid:r.fid,registrationStatus:0})];case 5:e.sent();e.label=6;case 6:throw u;case 7:return[2]}})})}(n,u),{installationEntry:u,registrationPromise:e}):(f=Promise.reject(h.create("app-offline")),{installationEntry:r,registrationPromise:f})}(n,e);return r=f.registrationPromise,f.installationEntry})];case 1:return(f=e.sent()).fid!==lt?[3,3]:(u={},[4,r]);case 2:return[2,(u.installationEntry=e.sent(),u)];case 3:return[2,{installationEntry:f,registrationPromise:r}]}})})}function gr(n){return it(n,function(n){if(!n)throw h.create("installation-not-found");return nu(n)})}function nu(n){return 1===(t=n).registrationStatus&&t.registrationTime+fr<Date.now()?{fid:n.fid,registrationStatus:0}:n;var t}function ef(n,r){var u=n.appConfig,f=n.platformLoggerProvider;return t(this,void 0,void 0,function(){var e,n,o,s,h,t,c;return i(this,function(i){switch(i.label){case 0:return l=u,a=r.fid,e=ri(l)+"/"+a+"/authTokens:generate",n=lr(u,r),(o=f.getImmediate({optional:!0}))&&n.append("x-firebase-client",o.getPlatformInfoString()),s={installation:{sdkVersion:er}},h={method:"POST",headers:n,body:JSON.stringify(s)},[4,fi(function(){return fetch(e,h)})];case 1:return(t=i.sent()).ok?[4,t.json()]:[3,3];case 2:return c=i.sent(),[2,hr(c)];case 3:return[4,ui("Generate Auth Token",t)];case 4:throw i.sent();}var l,a})})}function hi(n,r){return void 0===r&&(r=!1),t(this,void 0,void 0,function(){var u,o,e;return i(this,function(s){switch(s.label){case 0:return[4,it(n.appConfig,function(e){var c,l,a,o,s;if(!iu(e))throw h.create("not-registered");if(o=e.authToken,r||2!==(a=o).requestStatus||function(n){var t=Date.now();return t<n.creationTime||n.creationTime+n.expiresIn<t+nf}(a)){if(1===o.requestStatus)return u=function(n,r){return t(this,void 0,void 0,function(){var t,u;return i(this,function(i){switch(i.label){case 0:return[4,tu(n.appConfig)];case 1:t=i.sent();i.label=2;case 2:return 1!==t.authToken.requestStatus?[3,5]:[4,ar(100)];case 3:return i.sent(),[4,tu(n.appConfig)];case 4:return t=i.sent(),[3,2];case 5:return 0===(u=t.authToken).requestStatus?[2,hi(n,r)]:[2,u]}})})}(n,r),e;if(!navigator.onLine)throw h.create("app-offline");return s=(c=e,l={requestStatus:1,requestTime:Date.now()},f(f({},c),{authToken:l})),u=function(n,r){return t(this,void 0,void 0,function(){var e,t,u;return i(this,function(i){switch(i.label){case 0:return i.trys.push([0,3,,8]),[4,ef(n,r)];case 1:return e=i.sent(),u=f(f({},r),{authToken:e}),[4,at(n.appConfig,u)];case 2:return i.sent(),[2,e];case 3:return!sr(t=i.sent())||401!==t.serverCode&&404!==t.serverCode?[3,5]:[4,oi(n.appConfig)];case 4:return i.sent(),[3,7];case 5:return u=f(f({},r),{authToken:{requestStatus:0}}),[4,at(n.appConfig,u)];case 6:i.sent();i.label=7;case 7:throw t;case 8:return[2]}})})}(n,s),s}return e})];case 1:return o=s.sent(),u?[4,u]:[3,3];case 2:return e=s.sent(),[3,4];case 3:e=o.authToken;s.label=4;case 4:return[2,e]}})})}function tu(n){return it(n,function(n){if(!iu(n))throw h.create("not-registered");var t,i=n.authToken;return 1===(t=i).requestStatus&&t.requestTime+fr<Date.now()?f(f({},n),{authToken:{requestStatus:0}}):n})}function iu(n){return void 0!==n&&2===n.registrationStatus}function of(n,r){return void 0===r&&(r=!1),t(this,void 0,void 0,function(){return i(this,function(u){switch(u.label){case 0:return[4,function(n){return t(this,void 0,void 0,function(){var t;return i(this,function(i){switch(i.label){case 0:return[4,si(n)];case 1:return(t=i.sent().registrationPromise)?[4,t]:[3,3];case 2:i.sent();i.label=3;case 3:return[2]}})})}(n.appConfig)];case 1:return u.sent(),[4,hi(n,r)];case 2:return[2,u.sent().token]}})})}function sf(n,r){return t(this,void 0,void 0,function(){var t,u,f,e;return i(this,function(i){switch(i.label){case 0:return o=n,s=r.fid,t=ri(o)+"/"+s,u=lr(n,r),f={method:"DELETE",headers:u},[4,fi(function(){return fetch(t,f)})];case 1:return(e=i.sent()).ok?[3,3]:[4,ui("Delete Installation",e)];case 2:throw i.sent();case 3:return[2]}var o,s})})}function hf(n,t){var i=n.appConfig;return function(n,t){wr();var r=k(n),i=a.get(r);i||(i=new Set,a.set(r,i));i.add(t)}(i,t),function(){var u,n,r;u=t;n=k(i);(r=a.get(n))&&(r.delete(u),0===r.size&&a.delete(n),br())}}function ci(n){return h.create("missing-app-config-values",{valueName:n})}function li(n){return r.create("missing-app-config-values",{valueName:n})}function d(n){var t=new Uint8Array(n);return btoa(String.fromCharCode.apply(String,di(t))).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function lf(n){return t(this,void 0,void 0,function(){var u,r,f=this;return i(this,function(e){switch(e.label){case 0:return"databases"in indexedDB?[4,indexedDB.databases()]:[3,2];case 1:if(u=e.sent(),!u.map(function(n){return n.name}).includes(ai))return[2,null];e.label=2;case 2:return r=null,[4,ti(ai,cf,function(u){return t(f,void 0,void 0,function(){var o,f,t,e;return i(this,function(i){switch(i.label){case 0:return u.oldVersion<2?[2]:u.objectStoreNames.contains(uu)?[4,(o=u.transaction.objectStore(uu)).index("fcmSenderId").get(n)]:[2];case 1:return f=i.sent(),[4,o.clear()];case 2:if(i.sent(),!f)return[2];if(2===u.oldVersion){if(!(t=f).auth||!t.p256dh||!t.endpoint)return[2];r={token:t.fcmToken,createTime:null!==(e=t.createTime)&&void 0!==e?e:Date.now(),subscriptionOptions:{auth:t.auth,p256dh:t.p256dh,endpoint:t.endpoint,swScope:t.swScope,vapidKey:"string"==typeof t.vapidKey?t.vapidKey:d(t.vapidKey)}}}else(3===u.oldVersion||4===u.oldVersion)&&(r={token:(t=f).fcmToken,createTime:t.createTime,subscriptionOptions:{auth:d(t.auth),p256dh:d(t.p256dh),endpoint:t.endpoint,swScope:t.swScope,vapidKey:d(t.vapidKey)}});return[2]}})})})];case 3:return e.sent().close(),[4,ii(ai)];case 4:return e.sent(),[4,ii("fcm_vapid_details_db")];case 5:return e.sent(),[4,ii("undefined")];case 6:return e.sent(),[2,function(n){if(n&&n.subscriptionOptions){var t=n.subscriptionOptions;return"number"==typeof n.createTime&&0<n.createTime&&"string"==typeof n.token&&0<n.token.length&&"string"==typeof t.auth&&0<t.auth.length&&"string"==typeof t.p256dh&&0<t.p256dh.length&&"string"==typeof t.endpoint&&0<t.endpoint.length&&"string"==typeof t.swScope&&0<t.swScope.length&&"string"==typeof t.vapidKey&&0<t.vapidKey.length}}(r)?r:null]}})})}function vi(){return fu=fu||ti(af,vf,function(n){switch(n.oldVersion){case 0:n.createObjectStore(p)}})}function vt(n){return t(this,void 0,void 0,function(){var r,u,t;return i(this,function(i){switch(i.label){case 0:return r=pi(n),[4,vi()];case 1:return[4,i.sent().transaction(p).objectStore(p).get(r)];case 2:return(u=i.sent())?[2,u]:[3,3];case 3:return[4,lf(n.appConfig.senderId)];case 4:return(t=i.sent())?[4,yi(n,t)]:[3,6];case 5:return i.sent(),[2,t];case 6:return[2]}})})}function yi(n,r){return t(this,void 0,void 0,function(){var t,u,f;return i(this,function(i){switch(i.label){case 0:return t=pi(n),[4,vi()];case 1:return u=i.sent(),[4,(f=u.transaction(p,"readwrite")).objectStore(p).put(r,t)];case 2:return i.sent(),[4,f.complete];case 3:return i.sent(),[2,r]}})})}function pi(n){return n.appConfig.appId}function su(n,u){return t(this,void 0,void 0,function(){var t,f,e,o,s;return i(this,function(i){switch(i.label){case 0:return[4,bi(n)];case 1:t=i.sent();f={method:"DELETE",headers:t};i.label=2;case 2:return i.trys.push([2,5,,6]),[4,fetch(wi(n.appConfig)+"/"+u,f)];case 3:return[4,i.sent().json()];case 4:if((e=i.sent()).error)throw o=e.error.message,r.create("token-unsubscribe-failed",{errorInfo:o});return[3,6];case 5:throw s=i.sent(),r.create("token-unsubscribe-failed",{errorInfo:s});case 6:return[2]}})})}function wi(n){var t=n.projectId;return yf+"/projects/"+t+"/registrations"}function bi(n){var r=n.appConfig,u=n.installations;return t(this,void 0,void 0,function(){var n;return i(this,function(t){switch(t.label){case 0:return[4,u.getToken()];case 1:return n=t.sent(),[2,new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":r.apiKey,"x-goog-firebase-installations-auth":"FIS "+n})]}})})}function hu(n){var r=n.p256dh,u=n.auth,f=n.endpoint,t=n.vapidKey,i={web:{endpoint:f,auth:u,p256dh:r}};return t!==yt&&(i.web.applicationPubKey=t),i}function ki(n,u,e){return t(this,void 0,void 0,function(){var h,o,s,c;return i(this,function(l){switch(l.label){case 0:if("granted"!==Notification.permission)throw r.create("permission-blocked");return[4,function(n,r){return t(this,void 0,void 0,function(){var t;return i(this,function(i){switch(i.label){case 0:return[4,n.pushManager.getSubscription()];case 1:return(t=i.sent())?[2,t]:[2,n.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:function(n){for(var u=(n+"=".repeat((4-n.length%4)%4)).replace(/\-/g,"+").replace(/_/g,"/"),i=atob(u),r=new Uint8Array(i.length),t=0;t<i.length;++t)r[t]=i.charCodeAt(t);return r}(r)})]}})})}(u,e)];case 1:return h=l.sent(),[4,vt(n)];case 2:return o=l.sent(),s={vapidKey:e,swScope:u.scope,endpoint:h.endpoint,auth:d(h.getKey("auth")),p256dh:d(h.getKey("p256dh"))},o?[3,3]:[2,lu(n,s)];case 3:if(a=o.subscriptionOptions,y=(v=s).vapidKey===a.vapidKey,p=v.endpoint===a.endpoint,w=v.auth===a.auth,b=v.p256dh===a.p256dh,y&&p&&w&&b)return[3,8];l.label=4;case 4:return l.trys.push([4,6,,7]),[4,su(n,o.token)];case 5:return l.sent(),[3,7];case 6:return c=l.sent(),console.warn(c),[3,7];case 7:return[2,lu(n,s)];case 8:return Date.now()>=o.createTime+6048e5?[2,function(n,u,e){return t(this,void 0,void 0,function(){var o,s,h;return i(this,function(c){switch(c.label){case 0:return c.trys.push([0,3,,5]),[4,function(n,u){return t(this,void 0,void 0,function(){var f,e,o,t,s,h;return i(this,function(i){switch(i.label){case 0:return[4,bi(n)];case 1:f=i.sent();e=hu(u.subscriptionOptions);o={method:"PATCH",headers:f,body:JSON.stringify(e)};i.label=2;case 2:return i.trys.push([2,5,,6]),[4,fetch(wi(n.appConfig)+"/"+u.token,o)];case 3:return[4,i.sent().json()];case 4:return t=i.sent(),[3,6];case 5:throw s=i.sent(),r.create("token-update-failed",{errorInfo:s});case 6:if(t.error)throw h=t.error.message,r.create("token-update-failed",{errorInfo:h});if(!t.token)throw r.create("token-update-no-token");return[2,t.token]}})})}(u,n)];case 1:return o=c.sent(),s=f({token:o,createTime:Date.now()},n),[4,yi(u,s)];case 2:return c.sent(),[2,o];case 3:return h=c.sent(),[4,rt(u,e)];case 4:throw c.sent(),h;case 5:return[2]}})})}({token:o.token,createTime:Date.now(),subscriptionOptions:s},n,u)]:[2,o.token];case 9:return[2]}var a,v,y,p,w,b})})}function rt(n,r){return t(this,void 0,void 0,function(){var u,f;return i(this,function(e){switch(e.label){case 0:return[4,vt(n)];case 1:return(u=e.sent())?[4,su(n,u.token)]:[3,4];case 2:return e.sent(),[4,function(n){return t(this,void 0,void 0,function(){var t,r,u;return i(this,function(i){switch(i.label){case 0:return t=pi(n),[4,vi()];case 1:return r=i.sent(),[4,(u=r.transaction(p,"readwrite")).objectStore(p).delete(t)];case 2:return i.sent(),[4,u.complete];case 3:return i.sent(),[2]}})})}(n)];case 3:e.sent();e.label=4;case 4:return[4,r.pushManager.getSubscription()];case 5:return(f=e.sent())?[2,f.unsubscribe()]:[2,!0]}})})}function lu(n,u){return t(this,void 0,void 0,function(){var e,f;return i(this,function(o){switch(o.label){case 0:return[4,function(n,u){return t(this,void 0,void 0,function(){var f,e,o,t,s,h;return i(this,function(i){switch(i.label){case 0:return[4,bi(n)];case 1:f=i.sent();e=hu(u);o={method:"POST",headers:f,body:JSON.stringify(e)};i.label=2;case 2:return i.trys.push([2,5,,6]),[4,fetch(wi(n.appConfig),o)];case 3:return[4,i.sent().json()];case 4:return t=i.sent(),[3,6];case 5:throw s=i.sent(),r.create("token-subscribe-failed",{errorInfo:s});case 6:if(t.error)throw h=t.error.message,r.create("token-subscribe-failed",{errorInfo:h});if(!t.token)throw r.create("token-subscribe-no-token");return[2,t.token]}})})}(n,u)];case 1:return e=o.sent(),f={token:e,createTime:Date.now(),subscriptionOptions:u},[4,yi(n,f)];case 2:return o.sent(),[2,f.token]}})})}function au(n){return"object"==typeof n&&n&&ou in n}function e(n){var t=this;this.firebaseDependencies=n;this.vapidKey=null;this.onMessageCallback=null;navigator.serviceWorker.addEventListener("message",function(n){return t.messageEventListener(n)})}function o(n){var t=this;this.firebaseDependencies=n;this.vapidKey=null;this.bgMessageHandler=null;self.addEventListener("push",function(n){n.waitUntil(t.onPush(n))});self.addEventListener("pushsubscriptionchange",function(n){n.waitUntil(t.onSubChange(n))});self.addEventListener("notificationclick",function(n){n.waitUntil(t.onNotificationClick(n))})}function pu(){return self.clients.matchAll({type:"window",includeUncontrolled:!0})}function wu(n,t){return{firebaseMessaging:{type:n,payload:t}}}function ku(){return self&&"ServiceWorkerGlobalScope"in self?"indexedDB"in self&&null!==indexedDB&&"PushManager"in self&&"Notification"in self&&ServiceWorkerRegistration.prototype.hasOwnProperty("showNotification")&&PushSubscription.prototype.hasOwnProperty("getKey"):"indexedDB"in window&&null!==indexedDB&&navigator.cookieEnabled&&"serviceWorker"in navigator&&"PushManager"in window&&"Notification"in window&&"fetch"in window&&ServiceWorkerRegistration.prototype.hasOwnProperty("showNotification")&&PushSubscription.prototype.hasOwnProperty("getKey")}var pt,f,wt,bt,ut,kt,ft,tr,gt,vr,lt,a,v,ru,r,w,cu,vu,yu,bu;n=n&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n;pt=function(n,t){return(pt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])})(n,t)};f=function(){return(f=Object.assign||function(n){for(var r,i,t=1,u=arguments.length;t<u;t++)for(i in r=arguments[t])Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i]);return n}).apply(this,arguments)};kt=(wt=Error,pt(bt=dt,ut=wt),bt.prototype=null===ut?Object.create(ut):(gi.prototype=ut.prototype,new gi),dt);ft=(nr.prototype.create=function(n){for(var t,r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];for(var o,u=r[0]||{},s=this.service+"/"+n,h=this.errors[n],l=h?(o=u,h.replace(tr,function(n,t){var i=o[t];return null!=i?i.toString():"<"+t+"?>"})):"Error",a=this.serviceName+": "+l+" ("+s+").",f=new kt(s,a),e=0,c=Object.keys(u);e<c.length;e++)t=c[e],"_"!==t.slice(-1)&&(t in f&&console.warn('Overwriting FirebaseError base field "'+t+'" can cause unexpected behavior.'),f[t]=u[t]);return f},nr);tr=/\{\$([^}]+)}/g;gt=(et.prototype.setInstantiationMode=function(n){return this.instantiationMode=n,this},et.prototype.setMultipleInstances=function(n){return this.multipleInstances=n,this},et.prototype.setServiceProps=function(n){return this.serviceProps=n,this},et);b(c,"_index",["name","keyPath","multiEntry","unique"]);ni(c,"_index",IDBIndex,["get","getKey","getAll","getAllKeys","count"]);rr(c,"_index",IDBIndex,["openCursor","openKeyCursor"]);b(nt,"_cursor",["direction","key","primaryKey","value"]);ni(nt,"_cursor",IDBCursor,["update","delete"]);["advance","continue","continuePrimaryKey"].forEach(function(n){n in IDBCursor.prototype&&(nt.prototype[n]=function(){var t=this,i=arguments;return Promise.resolve().then(function(){return t._cursor[n].apply(t._cursor,i),ir(t._request).then(function(n){if(n)return new nt(n,t._request)})})})});s.prototype.createIndex=function(){return new c(this._store.createIndex.apply(this._store,arguments))};s.prototype.index=function(){return new c(this._store.index.apply(this._store,arguments))};b(s,"_store",["name","keyPath","indexNames","autoIncrement"]);ni(s,"_store",IDBObjectStore,["put","add","delete","clear","get","getAll","getKey","getAllKeys","count"]);rr(s,"_store",IDBObjectStore,["openCursor","openKeyCursor"]);st(s,"_store",IDBObjectStore,["deleteIndex"]);tt.prototype.objectStore=function(){return new s(this._tx.objectStore.apply(this._tx,arguments))};b(tt,"_tx",["objectStoreNames","mode"]);st(tt,"_tx",IDBTransaction,["abort"]);ht.prototype.createObjectStore=function(){return new s(this._db.createObjectStore.apply(this._db,arguments))};b(ht,"_db",["name","version","objectStoreNames"]);st(ht,"_db",IDBDatabase,["deleteObjectStore","close"]);ct.prototype.transaction=function(){return new tt(this._db.transaction.apply(this._db,arguments))};b(ct,"_db",["name","version","objectStoreNames"]);st(ct,"_db",IDBDatabase,["close"]);["openCursor","openKeyCursor"].forEach(function(n){[s,c].forEach(function(t){n in t.prototype&&(t.prototype[n.replace("open","iterate")]=function(){var i,t=(i=arguments,Array.prototype.slice.call(i)),f=t[t.length-1],r=this._store||this._index,u=r[n].apply(r,t.slice(0,-1));u.onsuccess=function(){f(u.result)}})})});[c,s].forEach(function(n){n.prototype.getAll||(n.prototype.getAll=function(n,t){var r=this,i=[];return new Promise(function(u){r.iterateCursor(n,function(n){n?(i.push(n.value),void 0===t||i.length!=t?n.continue():u(i)):u(i)})})})});var l,ur="0.4.9",fr=1e4,er="w:"+ur,or="FIS_v2",gu="https://firebaseinstallations.googleapis.com/v1",nf=36e5,tf=((l={})["missing-app-config-values"]='Missing App configuration value: "{$valueName}"',l["not-registered"]="Firebase Installation is not registered.",l["installation-not-found"]="Firebase Installation not found.",l["request-failed"]='{$requestName} request failed with error "{$serverCode} {$serverStatus}: {$serverMessage}"',l["app-offline"]="Could not process request. Application offline.",l["delete-pending-registration"]="Can't delete installation while there is a pending registration request.",l),h=new ft("installations","Installations",tf);vr=/^[cdef][\w-]{21}$/;lt="";a=new Map;v=null;var kr,u,uf="firebase-installations-database",ff=1,y="firebase-installations-store",dr=null;(kr=n).INTERNAL.registerComponent(new gt("installations",function(n){var u=n.getProvider("app").getImmediate(),r={appConfig:function(n){var r,f,i,t,u;if(!n||!n.options)throw ci("App Configuration");if(!n.name)throw ci("App Name");try{for(i=g(["projectId","apiKey","appId"]),t=i.next();!t.done;t=i.next())if(u=t.value,!n.options[u])throw ci(u);}catch(n){r={error:n}}finally{try{t&&!t.done&&(f=i.return)&&f.call(i)}finally{if(r)throw r.error;}}return{appName:n.name,projectId:n.options.projectId,apiKey:n.options.apiKey,appId:n.options.appId}}(u),platformLoggerProvider:n.getProvider("platform-logger")};return{app:u,getId:function(){return function(n){return t(this,void 0,void 0,function(){var t,r,u;return i(this,function(i){switch(i.label){case 0:return[4,si(n.appConfig)];case 1:return t=i.sent(),r=t.installationEntry,(u=t.registrationPromise)?u.catch(console.error):hi(n).catch(console.error),[2,r.fid]}})})}(r)},getToken:function(n){return of(r,n)},"delete":function(){return function(n){return t(this,void 0,void 0,function(){var r,t;return i(this,function(i){switch(i.label){case 0:return[4,it(r=n.appConfig,function(n){if(!n||0!==n.registrationStatus)return n})];case 1:if(!(t=i.sent()))return[3,6];if(1!==t.registrationStatus)return[3,2];throw h.create("delete-pending-registration");case 2:if(2!==t.registrationStatus)return[3,6];if(navigator.onLine)return[3,3];throw h.create("app-offline");case 3:return[4,sf(r,t)];case 4:return i.sent(),[4,oi(r)];case 5:i.sent();i.label=6;case 6:return[2]}})})}(r)},onIdChange:function(n){return hf(r,n)}}},"PUBLIC"));kr.registerVersion("@firebase/installations",ur);ru=((u={})["missing-app-config-values"]='Missing App configuration value: "{$valueName}"',u["only-available-in-window"]="This method is available in a Window context.",u["only-available-in-sw"]="This method is available in a service worker context.",u["permission-default"]="The notification permission was not granted and dismissed instead.",u["permission-blocked"]="The notification permission was not granted and blocked instead.",u["unsupported-browser"]="This browser doesn't support the API's required to use the firebase SDK.",u["failed-service-worker-registration"]="We are unable to register the default service worker. {$browserErrorMessage}",u["token-subscribe-failed"]="A problem occured while subscribing the user to FCM: {$errorInfo}",u["token-subscribe-no-token"]="FCM returned no token when subscribing the user to push.",u["token-unsubscribe-failed"]="A problem occured while unsubscribing the user from FCM: {$errorInfo}",u["token-update-failed"]="A problem occured while updating the user from FCM: {$errorInfo}",u["token-update-no-token"]="FCM returned no token when updating the user to push.",u["use-sw-after-get-token"]="The useServiceWorker() method may only be called once and must be called before calling getToken() to ensure your service worker is used.",u["invalid-sw-registration"]="The input to useServiceWorker() must be a ServiceWorkerRegistration.",u["invalid-bg-handler"]="The input to setBackgroundMessageHandler() must be a function.",u["invalid-vapid-key"]="The public VAPID key must be a string.",u["use-vapid-key-after-get-token"]="The usePublicVapidKey() method may only be called once and must be called before calling getToken() to ensure your VAPID key is used.",u);r=new ft("messaging","Messaging",ru);var ai="fcm_token_details_db",cf=5,uu="fcm_token_object_Store";var af="firebase-messaging-database",vf=1,p="firebase-messaging-store",fu=null;var yt="BDOU99-h67HcA6JeFXHbSNMu7e2yNNu3RzoMj8TM4W88jITfq7ZmPvIM1Iv-4_l2LxQcYwhqby2xGpWwzjfAnG4",yf="https://fcmregistrations.googleapis.com/v1",eu="FCM_MSG",ou="google.c.a.c_id";(cu=w=w||{}).PUSH_RECEIVED="push-received";cu.NOTIFICATION_CLICKED="notification-clicked";vu=(Object.defineProperty(e.prototype,"app",{get:function(){return this.firebaseDependencies.app},enumerable:!0,configurable:!0}),e.prototype.getToken=function(){return t(this,void 0,void 0,function(){var n;return i(this,function(t){switch(t.label){case 0:return this.vapidKey||(this.vapidKey=yt),[4,this.getServiceWorkerRegistration()];case 1:return n=t.sent(),"default"!==Notification.permission?[3,3]:[4,Notification.requestPermission()];case 2:t.sent();t.label=3;case 3:if("granted"!==Notification.permission)throw r.create("permission-blocked");return[2,ki(this.firebaseDependencies,n,this.vapidKey)]}})})},e.prototype.deleteToken=function(){return t(this,void 0,void 0,function(){var n;return i(this,function(t){switch(t.label){case 0:return[4,this.getServiceWorkerRegistration()];case 1:return n=t.sent(),[2,rt(this.firebaseDependencies,n)]}})})},e.prototype.requestPermission=function(){return t(this,void 0,void 0,function(){var n;return i(this,function(t){switch(t.label){case 0:return"granted"===Notification.permission?[2]:[4,Notification.requestPermission()];case 1:if("granted"===(n=t.sent()))return[2];throw"denied"===n?r.create("permission-blocked"):r.create("permission-default");}})})},e.prototype.usePublicVapidKey=function(n){if(null!==this.vapidKey)throw r.create("use-vapid-key-after-get-token");if("string"!=typeof n||0===n.length)throw r.create("invalid-vapid-key");this.vapidKey=n},e.prototype.useServiceWorker=function(n){if(!(n instanceof ServiceWorkerRegistration))throw r.create("invalid-sw-registration");if(this.swRegistration)throw r.create("use-sw-after-get-token");this.swRegistration=n},e.prototype.onMessage=function(n){var t=this;return this.onMessageCallback="function"==typeof n?n:n.next,function(){t.onMessageCallback=null}},e.prototype.setBackgroundMessageHandler=function(){throw r.create("only-available-in-sw");},e.prototype.onTokenRefresh=function(){return function(){}},e.prototype.getServiceWorkerRegistration=function(){return t(this,void 0,void 0,function(){var n,t;return i(this,function(i){switch(i.label){case 0:if(this.swRegistration)return[3,4];i.label=1;case 1:return i.trys.push([1,3,,4]),n=this,[4,navigator.serviceWorker.register("/firebase-messaging-sw.js",{scope:"/firebase-cloud-messaging-push-scope"})];case 2:return n.swRegistration=i.sent(),this.swRegistration.update().catch(function(){}),[3,4];case 3:throw t=i.sent(),r.create("failed-service-worker-registration",{browserErrorMessage:t.message});case 4:return[2,this.swRegistration]}})})},e.prototype.messageEventListener=function(n){var r;return t(this,void 0,void 0,function(){var t,u,f,e;return i(this,function(i){switch(i.label){case 0:return null!==(r=n.data)&&void 0!==r&&r.firebaseMessaging?(t=n.data.firebaseMessaging,u=t.type,f=t.payload,this.onMessageCallback&&u===w.PUSH_RECEIVED&&this.onMessageCallback(f),au(e=f.data)&&"1"===e["google.c.a.e"]?[4,this.logEvent(u,e)]:[3,2]):[2];case 1:i.sent();i.label=2;case 2:return[2]}})})},e.prototype.logEvent=function(n,r){return t(this,void 0,void 0,function(){var t;return i(this,function(i){switch(i.label){case 0:return t=function(n){switch(n){case w.NOTIFICATION_CLICKED:return"notification_open";case w.PUSH_RECEIVED:return"notification_foreground";default:throw new Error;}}(n),[4,this.firebaseDependencies.analyticsProvider.get()];case 1:return i.sent().logEvent(t,{message_id:r[ou],message_name:r["google.c.a.c_l"],message_time:r["google.c.a.ts"],message_device_time:Math.floor(Date.now()/1e3)}),[2]}})})},e);yu=(Object.defineProperty(o.prototype,"app",{get:function(){return this.firebaseDependencies.app},enumerable:!0,configurable:!0}),o.prototype.setBackgroundMessageHandler=function(n){if(!n||"function"!=typeof n)throw r.create("invalid-bg-handler");this.bgMessageHandler=n},o.prototype.getToken=function(){var n,r;return t(this,void 0,void 0,function(){var t;return i(this,function(i){switch(i.label){case 0:return this.vapidKey?[3,2]:[4,vt(this.firebaseDependencies)];case 1:t=i.sent();this.vapidKey=null!==(r=null===(n=null==t?void 0:t.subscriptionOptions)||void 0===n?void 0:n.vapidKey)&&void 0!==r?r:yt;i.label=2;case 2:return[2,ki(this.firebaseDependencies,self.registration,this.vapidKey)]}})})},o.prototype.deleteToken=function(){return rt(this.firebaseDependencies,self.registration)},o.prototype.requestPermission=function(){throw r.create("only-available-in-window");},o.prototype.usePublicVapidKey=function(n){if(null!==this.vapidKey)throw r.create("use-vapid-key-after-get-token");if("string"!=typeof n||0===n.length)throw r.create("invalid-vapid-key");this.vapidKey=n},o.prototype.useServiceWorker=function(){throw r.create("only-available-in-window");},o.prototype.onMessage=function(){throw r.create("only-available-in-window");},o.prototype.onTokenRefresh=function(){throw r.create("only-available-in-window");},o.prototype.onPush=function(n){return t(this,void 0,void 0,function(){var t,r,u;return i(this,function(i){switch(i.label){case 0:return(t=function(n){var t=n.data;if(!t)return null;try{return t.json()}catch(n){return null}}(n))?[4,pu()]:[2];case 1:return(r=i.sent()).some(function(n){return"visible"===n.visibilityState&&!n.url.startsWith("chrome-extension://")})?[2,function(n,t){var u,f,e=wu(w.PUSH_RECEIVED,t),r,i;try{for(r=g(n),i=r.next();!i.done;i=r.next())i.value.postMessage(e)}catch(n){u={error:n}}finally{try{i&&!i.done&&(f=r.return)&&f.call(r)}finally{if(u)throw u.error;}}}(r,t)]:(u=function(n){var i,t;if(n&&"object"==typeof n.notification)return t=f({},n.notification),t.data=f(f({},n.notification.data),((i={})[eu]=n,i)),t}(t))?[4,function(n){var t,u=null!==(t=n.title)&&void 0!==t?t:"",r=n.actions,i=Notification.maxActions;return r&&i&&r.length>i&&console.warn("This browser only supports "+i+" actions. The remaining actions will not be displayed."),self.registration.showNotification(u,n)}(u)]:[3,3];case 2:return i.sent(),[3,5];case 3:return this.bgMessageHandler?[4,this.bgMessageHandler(t)]:[3,5];case 4:i.sent();i.label=5;case 5:return[2]}})})},o.prototype.onSubChange=function(n){var r,u;return t(this,void 0,void 0,function(){var t;return i(this,function(i){switch(i.label){case 0:return n.newSubscription?[3,2]:[4,rt(this.firebaseDependencies,self.registration)];case 1:return i.sent(),[2];case 2:return[4,vt(this.firebaseDependencies)];case 3:return t=i.sent(),[4,rt(this.firebaseDependencies,self.registration)];case 4:return i.sent(),[4,ki(this.firebaseDependencies,self.registration,null!==(u=null===(r=null==t?void 0:t.subscriptionOptions)||void 0===r?void 0:r.vapidKey)&&void 0!==u?u:yt)];case 5:return i.sent(),[2]}})})},o.prototype.onNotificationClick=function(n){var r,u;return t(this,void 0,void 0,function(){var e,o,f,s;return i(this,function(h){switch(h.label){case 0:return!(e=null===(u=null===(r=n.notification)||void 0===r?void 0:r.data)||void 0===u?void 0:u[eu])||n.action?[2]:(n.stopImmediatePropagation(),n.notification.close(),(o=function(n){var t,i,r,u=null!==(i=null===(t=n.fcmOptions)||void 0===t?void 0:t.link)&&void 0!==i?i:null===(r=n.notification)||void 0===r?void 0:r.click_action;return u||(au(n.data)?self.location.origin:null)}(e))?[4,function(n){return t(this,void 0,void 0,function(){var e,o,r,t,u,f,s;return i(this,function(i){switch(i.label){case 0:return e=new URL(n,self.location.href),[4,pu()];case 1:o=i.sent();try{for(r=g(o),t=r.next();!t.done;t=r.next())if(u=t.value,new URL(u.url,self.location.href).host===e.host)return[2,u]}catch(i){f={error:i}}finally{try{t&&!t.done&&(s=r.return)&&s.call(r)}finally{if(f)throw f.error;}}return[2,null]}})})}(o)]:[2]);case 1:return(f=h.sent())?[3,4]:[4,self.clients.openWindow(o)];case 2:return f=h.sent(),[4,(c=3e3,new Promise(function(n){setTimeout(n,c)}))];case 3:return h.sent(),[3,6];case 4:return[4,f.focus()];case 5:f=h.sent();h.label=6;case 6:return f?(s=wu(w.NOTIFICATION_CLICKED,e),[2,f.postMessage(s)]):[2]}var c})})},o);bu={isSupported:ku};n.INTERNAL.registerComponent(new gt("messaging",function(n){var t=n.getProvider("app").getImmediate(),i={app:t,appConfig:function(n){var u,e,t,r,i,f;if(!n||!n.options)throw li("App Configuration Object");if(!n.name)throw li("App Name");t=n.options;try{for(r=g(["projectId","apiKey","appId","messagingSenderId"]),i=r.next();!i.done;i=r.next())if(f=i.value,!t[f])throw li(f);}catch(n){u={error:n}}finally{try{i&&!i.done&&(e=r.return)&&e.call(r)}finally{if(u)throw u.error;}}return{appName:n.name,projectId:t.projectId,apiKey:t.apiKey,appId:t.appId,senderId:t.messagingSenderId}}(t),installations:n.getProvider("installations").getImmediate(),analyticsProvider:n.getProvider("analytics-internal")};if(!ku())throw r.create("unsupported-browser");return new(self&&"ServiceWorkerGlobalScope"in self?yu:vu)(i)},"PUBLIC").setServiceProps(bu))}).apply(this,arguments)}catch(t){throw console.error(t),new Error("Cannot instantiate firebase-messaging.js - be sure to load firebase-app.js first.");}});!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("@firebase/app")):"function"==typeof define&&define.amd?define(["@firebase/app"],t):t((n=n||self).firebase)}(this,function(n){"use strict";try{(function(){function r(n,t,i,r){return new(i=i||Promise)(function(u,f){function o(n){try{e(r.next(n))}catch(n){f(n)}}function s(n){try{e(r.throw(n))}catch(n){f(n)}}function e(n){var t;n.done?u(n.value):((t=n.value)instanceof i?t:new i(function(n){n(t)})).then(o,s)}e((r=r.apply(n,t||[])).next())})}function u(n,t){function o(e){return function(o){return function(e){if(f)throw new TypeError("Generator is already executing.");for(;r;)try{if(f=1,u&&(i=2&e[0]?u.return:e[0]?u.throw||((i=u.return)&&i.call(u),0):u.next)&&!(i=i.call(u,e[1])).done)return i;switch(u=0,i&&(e=[2&e[0],i.value]),e[0]){case 0:case 1:i=e;break;case 4:return r.label++,{value:e[1],done:!1};case 5:r.label++;u=e[1];e=[0];continue;case 7:e=r.ops.pop();r.trys.pop();continue;default:if(!(i=0<(i=r.trys).length&&i[i.length-1])&&(6===e[0]||2===e[0])){r=0;continue}if(3===e[0]&&(!i||e[1]>i[0]&&e[1]<i[3])){r.label=e[1];break}if(6===e[0]&&r.label<i[1]){r.label=i[1];i=e;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(e);break}i[2]&&r.ops.pop();r.trys.pop();continue}e=t.call(n,r)}catch(o){e=[6,o];u=0}finally{f=i=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}([e,o])}}var f,u,i,e,r={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return e={next:o(0),"throw":o(1),"return":o(2)},"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e}function ki(n){var t="function"==typeof Symbol&&Symbol.iterator,i=t&&n[t],r=0;if(i)return i.call(n);if(n&&"number"==typeof n.length)return{next:function(){return n&&r>=n.length&&(n=void 0),{value:n&&n[r++],done:!n}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.");}function uu(n,t){var i="function"==typeof Symbol&&n[Symbol.iterator],r,f,u,e;if(!i)return n;u=i.call(n);e=[];try{for(;(void 0===t||0<t--)&&!(r=u.next()).done;)e.push(r.value)}catch(n){f={error:n}}finally{try{r&&!r.done&&(i=u.return)&&i.call(u)}finally{if(f)throw f.error;}}return e}function di(){this.constructor=bt}function dt(n,t){var i=wt.call(this,t)||this;return i.code=n,i.name="FirebaseError",Object.setPrototypeOf(i,dt.prototype),Error.captureStackTrace&&Error.captureStackTrace(i,ft.prototype.create),i}function gi(n,t,i){this.service=n;this.serviceName=t;this.errors=i}function ot(n,t,i){this.name=n;this.instanceFactory=t;this.type=i;this.multipleInstances=!1;this.serviceProps={};this.instantiationMode="LAZY"}function tr(n){return new Promise(function(t,i){n.onsuccess=function(){t(n.result)};n.onerror=function(){i(n.error)}})}function gt(n,t,i){var r,u=new Promise(function(u,f){tr(r=n[t].apply(n,i)).then(u,f)});return u.request=r,u}function b(n,t,i){i.forEach(function(i){Object.defineProperty(n.prototype,i,{get:function(){return this[t][i]},set:function(n){this[t][i]=n}})})}function ni(n,t,i,r){r.forEach(function(r){r in i.prototype&&(n.prototype[r]=function(){return gt(this[t],r,arguments)})})}function st(n,t,i,r){r.forEach(function(r){r in i.prototype&&(n.prototype[r]=function(){return this[t][r].apply(this[t],arguments)})})}function ir(n,t,i,r){r.forEach(function(r){r in i.prototype&&(n.prototype[r]=function(){return n=this[t],(i=gt(n,r,arguments)).then(function(n){if(n)return new g(n,i.request)});var n,i})})}function a(n){this._index=n}function g(n,t){this._cursor=n;this._request=t}function h(n){this._store=n}function nt(n){this._tx=n;this.complete=new Promise(function(t,i){n.oncomplete=function(){t()};n.onerror=function(){i(n.error)};n.onabort=function(){i(n.error)}})}function ht(n,t,i){this._db=n;this.oldVersion=t;this.transaction=new nt(i)}function ct(n){this._db=n}function or(n){return n instanceof kt&&n.code.includes("request-failed")}function ti(n){var t=n.projectId;return fu+"/projects/"+t+"/installations"}function sr(n){return{token:n.token,requestStatus:2,expiresIn:(t=n.expiresIn,Number(t.replace("s","000"))),creationTime:Date.now()};var t}function ii(n,t){return r(this,void 0,void 0,function(){var r,i;return u(this,function(u){switch(u.label){case 0:return[4,t.json()];case 1:return r=u.sent(),i=r.error,[2,c.create("request-failed",{requestName:n,serverCode:i.code,serverMessage:i.message,serverStatus:i.status})]}})})}function hr(n){var t=n.apiKey;return new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":t})}function cr(n,t){var r=t.refreshToken,i=hr(n);return i.append("Authorization",er+" "+r),i}function ri(n){return r(this,void 0,void 0,function(){var t;return u(this,function(i){switch(i.label){case 0:return[4,n()];case 1:return 500<=(t=i.sent()).status&&t.status<600?[2,n()]:[2,t]}})})}function lr(n){return new Promise(function(t){setTimeout(t,n)})}function su(n){return btoa(String.fromCharCode.apply(String,function(){for(var n=[],t=0;t<arguments.length;t++)n=n.concat(uu(arguments[t]));return n}(n))).replace(/\+/g,"-").replace(/\//g,"_")}function hu(){var n,t;try{return n=new Uint8Array(17),(self.crypto||self.msCrypto).getRandomValues(n),n[0]=112+n[0]%16,t=su(n).substr(0,22),ar.test(t)?t:lt}catch(n){return lt}}function k(n){return n.appName+"!"+n.appId}function vr(n,t){var i=k(n);yr(i,t),function(n,t){var i=pr();i&&i.postMessage({key:n,fid:t});wr()}(i,t)}function yr(n,t){var u,f,e=y.get(n),r,i;if(e)try{for(r=ki(e),i=r.next();!i.done;i=r.next())i.value(t)}catch(n){u={error:n}}finally{try{i&&!i.done&&(f=r.return)&&f.call(r)}finally{if(u)throw u.error;}}}function pr(){return!p&&"BroadcastChannel"in self&&((p=new BroadcastChannel("[Firebase] FID Change")).onmessage=function(n){yr(n.data.key,n.data.fid)}),p}function wr(){0===y.size&&p&&(p.close(),p=null)}function fi(){var t,i,n;return ui||(t=function(n){switch(n.oldVersion){case 0:n.createObjectStore(w)}},i=gt(indexedDB,"open",[cu,lu]),(n=i.request)&&(n.onupgradeneeded=function(i){t&&t(new ht(n.result,i.oldVersion,n.transaction))}),ui=i.then(function(n){return new ct(n)})),ui}function at(n,t){return r(this,void 0,void 0,function(){var i,e,r,o,f;return u(this,function(u){switch(u.label){case 0:return i=k(n),[4,fi()];case 1:return e=u.sent(),r=e.transaction(w,"readwrite"),[4,(o=r.objectStore(w)).get(i)];case 2:return f=u.sent(),[4,o.put(t,i)];case 3:return u.sent(),[4,r.complete];case 4:return u.sent(),f&&f.fid===t.fid||vr(n,t.fid),[2,t]}})})}function ei(n){return r(this,void 0,void 0,function(){var t,i,r;return u(this,function(u){switch(u.label){case 0:return t=k(n),[4,fi()];case 1:return i=u.sent(),[4,(r=i.transaction(w,"readwrite")).objectStore(w).delete(t)];case 2:return u.sent(),[4,r.complete];case 3:return u.sent(),[2]}})})}function tt(n,t){return r(this,void 0,void 0,function(){var r,s,e,o,f,i;return u(this,function(u){switch(u.label){case 0:return r=k(n),[4,fi()];case 1:return s=u.sent(),e=s.transaction(w,"readwrite"),[4,(o=e.objectStore(w)).get(r)];case 2:return f=u.sent(),void 0!==(i=t(f))?[3,4]:[4,o.delete(r)];case 3:return u.sent(),[3,6];case 4:return[4,o.put(i,r)];case 5:u.sent();u.label=6;case 6:return[4,e.complete];case 7:return u.sent(),!i||f&&f.fid===i.fid||vr(n,i.fid),[2,i]}})})}function oi(n){return r(this,void 0,void 0,function(){var t,f,i;return u(this,function(e){switch(e.label){case 0:return[4,tt(n,function(i){var e=dr(i||{fid:hu(),registrationStatus:0}),f=function(n,t){var f,i,e;return 0!==t.registrationStatus?1===t.registrationStatus?{installationEntry:t,registrationPromise:function(n){return r(this,void 0,void 0,function(){var t,i,r,f;return u(this,function(u){switch(u.label){case 0:return[4,kr(n)];case 1:t=u.sent();u.label=2;case 2:return 1!==t.registrationStatus?[3,5]:[4,lr(100)];case 3:return u.sent(),[4,kr(n)];case 4:return t=u.sent(),[3,2];case 5:return 0!==t.registrationStatus?[3,7]:[4,oi(n)];case 6:return i=u.sent(),r=i.installationEntry,(f=i.registrationPromise)?[2,f]:[2,r];case 7:return[2,t]}})})}(n)}:{installationEntry:t}:navigator.onLine?(i={fid:t.fid,registrationStatus:1,registrationTime:Date.now()},e=function(n,t){return r(this,void 0,void 0,function(){var f,i;return u(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,7]),[4,function(n,t){var i=t.fid;return r(this,void 0,void 0,function(){var f,e,o,s,r,t;return u(this,function(u){switch(u.label){case 0:return f=ti(n),e=hr(n),o={fid:i,authVersion:er,appId:n.appId,sdkVersion:fr},s={method:"POST",headers:e,body:JSON.stringify(o)},[4,ri(function(){return fetch(f,s)})];case 1:return(r=u.sent()).ok?[4,r.json()]:[3,3];case 2:return t=u.sent(),[2,{fid:t.fid||i,registrationStatus:2,refreshToken:t.refreshToken,authToken:sr(t.authToken)}];case 3:return[4,ii("Create Installation",r)];case 4:throw u.sent();}})})}(n,t)];case 1:return f=e.sent(),[2,at(n,f)];case 2:return or(i=e.sent())&&409===i.serverCode?[4,ei(n)]:[3,4];case 3:return e.sent(),[3,6];case 4:return[4,at(n,{fid:t.fid,registrationStatus:0})];case 5:e.sent();e.label=6;case 6:throw i;case 7:return[2]}})})}(n,i),{installationEntry:i,registrationPromise:e}):(f=Promise.reject(c.create("app-offline")),{installationEntry:t,registrationPromise:f})}(n,e);return t=f.registrationPromise,f.installationEntry})];case 1:return(f=e.sent()).fid!==lt?[3,3]:(i={},[4,t]);case 2:return[2,(i.installationEntry=e.sent(),i)];case 3:return[2,{installationEntry:f,registrationPromise:t}]}})})}function kr(n){return tt(n,function(n){if(!n)throw c.create("installation-not-found");return dr(n)})}function dr(n){return 1===(t=n).registrationStatus&&t.registrationTime+ur<Date.now()?{fid:n.fid,registrationStatus:0}:n;var t}function au(n,t){var i=n.appConfig,f=n.platformLoggerProvider;return r(this,void 0,void 0,function(){var e,n,o,s,h,r,c;return u(this,function(u){switch(u.label){case 0:return l=i,a=t.fid,e=ti(l)+"/"+a+"/authTokens:generate",n=cr(i,t),(o=f.getImmediate({optional:!0}))&&n.append("x-firebase-client",o.getPlatformInfoString()),s={installation:{sdkVersion:fr}},h={method:"POST",headers:n,body:JSON.stringify(s)},[4,ri(function(){return fetch(e,h)})];case 1:return(r=u.sent()).ok?[4,r.json()]:[3,3];case 2:return c=u.sent(),[2,sr(c)];case 3:return[4,ii("Generate Auth Token",r)];case 4:throw u.sent();}var l,a})})}function si(n,t){return void 0===t&&(t=!1),r(this,void 0,void 0,function(){var i,o,f;return u(this,function(s){switch(s.label){case 0:return[4,tt(n.appConfig,function(f){var h,l,a,o,s;if(!nu(f))throw c.create("not-registered");if(o=f.authToken,t||2!==(a=o).requestStatus||function(n){var t=Date.now();return t<n.creationTime||n.creationTime+n.expiresIn<t+eu}(a)){if(1===o.requestStatus)return i=function(n,t){return r(this,void 0,void 0,function(){var i,r;return u(this,function(u){switch(u.label){case 0:return[4,gr(n.appConfig)];case 1:i=u.sent();u.label=2;case 2:return 1!==i.authToken.requestStatus?[3,5]:[4,lr(100)];case 3:return u.sent(),[4,gr(n.appConfig)];case 4:return i=u.sent(),[3,2];case 5:return 0===(r=i.authToken).requestStatus?[2,si(n,t)]:[2,r]}})})}(n,t),f;if(!navigator.onLine)throw c.create("app-offline");return s=(h=f,l={requestStatus:1,requestTime:Date.now()},e(e({},h),{authToken:l})),i=function(n,t){return r(this,void 0,void 0,function(){var f,i,r;return u(this,function(u){switch(u.label){case 0:return u.trys.push([0,3,,8]),[4,au(n,t)];case 1:return f=u.sent(),r=e(e({},t),{authToken:f}),[4,at(n.appConfig,r)];case 2:return u.sent(),[2,f];case 3:return!or(i=u.sent())||401!==i.serverCode&&404!==i.serverCode?[3,5]:[4,ei(n.appConfig)];case 4:return u.sent(),[3,7];case 5:return r=e(e({},t),{authToken:{requestStatus:0}}),[4,at(n.appConfig,r)];case 6:u.sent();u.label=7;case 7:throw i;case 8:return[2]}})})}(n,s),s}return f})];case 1:return o=s.sent(),i?[4,i]:[3,3];case 2:return f=s.sent(),[3,4];case 3:f=o.authToken;s.label=4;case 4:return[2,f]}})})}function gr(n){return tt(n,function(n){if(!nu(n))throw c.create("not-registered");var t,i=n.authToken;return 1===(t=i).requestStatus&&t.requestTime+ur<Date.now()?e(e({},n),{authToken:{requestStatus:0}}):n})}function nu(n){return void 0!==n&&2===n.registrationStatus}function vu(n,t){return void 0===t&&(t=!1),r(this,void 0,void 0,function(){return u(this,function(i){switch(i.label){case 0:return[4,function(n){return r(this,void 0,void 0,function(){var t;return u(this,function(i){switch(i.label){case 0:return[4,oi(n)];case 1:return(t=i.sent().registrationPromise)?[4,t]:[3,3];case 2:i.sent();i.label=3;case 3:return[2]}})})}(n.appConfig)];case 1:return i.sent(),[4,si(n,t)];case 2:return[2,i.sent().token]}})})}function yu(n,t){return r(this,void 0,void 0,function(){var i,r,f,e;return u(this,function(u){switch(u.label){case 0:return o=n,s=t.fid,i=ti(o)+"/"+s,r=cr(n,t),f={method:"DELETE",headers:r},[4,ri(function(){return fetch(i,f)})];case 1:return(e=u.sent()).ok?[3,3]:[4,ii("Delete Installation",e)];case 2:throw u.sent();case 3:return[2]}var o,s})})}function pu(n,t){var i=n.appConfig;return function(n,t){pr();var r=k(n),i=y.get(r);i||(i=new Set,y.set(r,i));i.add(t)}(i,t),function(){var u,n,r;u=t;n=k(i);(r=y.get(n))&&(r.delete(u),0===r.size&&y.delete(n),wr())}}function hi(n){return c.create("missing-app-config-values",{valueName:n})}function s(){for(var t,i,u=0,n=0,f=arguments.length;n<f;n++)u+=arguments[n].length;for(t=Array(u),i=0,n=0;n<f;n++)for(var e=arguments[n],r=0,o=e.length;r<o;r++,i++)t[i]=e[r];return t}function wu(n,t){for(var f,u,r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];if(!(t<n.logLevel)){if(f=(new Date).toISOString(),u=ku[t],!u)throw new Error("Attempted to log a message with an invalid logType (value: "+t+")");console[u].apply(console,s(["["+f+"]  "+n.name+":"],r))}}function l(n){this.name=n;this._logLevel=bu;this._logHandler=wu;this._userLogHandler=null}function tf(n,t,i){var r,u,e=function(){for(var i=[],n=0;n<arguments.length;n++)i[n]=arguments[n];window[t].push(arguments)};return window[i]&&"function"==typeof window[i]&&(e=window[i]),window[i]=(r=e,u=n,function(n,t,i){var e,o,s,c,v,l,h,a,y;if(n===f.EVENT){if(e=[],i&&i.send_to)for(o=i.send_to,Array.isArray(o)||(o=[o]),s=0,c=o;s<c.length;s++){if(v=c[s],l=u[v],!l){e=[];break}e.push(l)}if(0===e.length)for(h=0,a=Object.values(u);h<a.length;h++)y=a[h],e.push(y);Promise.all(e).then(function(){return r(f.EVENT,t,i||{})}).catch(function(n){return vi.error(n)})}else n===f.CONFIG?(u[t]||Promise.resolve()).then(function(){r(f.CONFIG,t,i)}).catch(function(n){return vi.error(n)}):r(f.SET,t)}),{gtagCore:e,wrappedGtag:window[i]}}function uf(n){if(pi)throw vt.create("already-initialized");n.dataLayerName&&(yt=n.dataLayerName);n.gtagName&&(ru=n.gtagName)}function ff(n,t){var o,s,c,h,i=n.options[ai];if(!i)throw vt.create("no-ga-id");if(null!=yi[i])throw vt.create("already-exists",{id:i});if(!pi){(function(){for(var n,r=window.document.getElementsByTagName("script"),t=0,i=Object.values(r);t<i.length;t++)if(n=i[t],n.src&&n.src.includes(tu))return n})()||(c=yt,(h=document.createElement("script")).src=tu+"?l="+c,h.async=!0,document.head.appendChild(h));o=yt;s=[];Array.isArray(window[o])?s=window[o]:window[o]=s;var l=tf(yi,yt,ru),a=l.wrappedGtag,v=l.gtagCore;rt=a;iu=v;pi=!0}return yi[i]=function(n,t,i){return r(this,void 0,void 0,function(){var e,r;return u(this,function(u){switch(u.label){case 0:return[4,t.getId()];case 1:return e=u.sent(),i("js",new Date),i(f.CONFIG,n.options[ai],((r={})[gu]=e,r[nf]="firebase",r.update=!0,r)),[2]}})})}(n,t,iu),{app:n,logEvent:function(n,t,r){return o=rt,s=i,h=n,u=(c=t)||{},(l=r)&&l.global||(u=e(e({},c),{send_to:s})),void o(f.EVENT,h,u||{});var o,s,h,c,l,u},setCurrentScreen:function(n,t){return r=rt,e=i,u=n,void((o=t)&&o.global?r(f.SET,{screen_name:u}):r(f.CONFIG,e,{update:!0,screen_name:u}));var r,e,u,o},setUserId:function(n,t){return r=rt,e=i,u=n,void((o=t)&&o.global?r(f.SET,{user_id:u}):r(f.CONFIG,e,{update:!0,user_id:u}));var r,e,u,o},setUserProperties:function(n,t){return function(n,t,i,r){var e;if(r&&r.global){for(var o={},u=0,s=Object.keys(i);u<s.length;u++)e=s[u],o["user_properties."+e]=i[e];n(f.SET,o)}else n(f.CONFIG,t,{update:!0,user_properties:i})}(rt,i,n,t)},setAnalyticsCollectionEnabled:function(n){return t=n,void(window["ga-disable-"+i]=!t);var t}}}var pt,e,wt,bt,ut,kt,ft,nr,et,ar,lt,y,p,it,vi,wi,bi;n=n&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n;pt=function(n,t){return(pt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])})(n,t)};e=function(){return(e=Object.assign||function(n){for(var r,i,t=1,u=arguments.length;t<u;t++)for(i in r=arguments[t])Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i]);return n}).apply(this,arguments)};kt=(wt=Error,pt(bt=dt,ut=wt),bt.prototype=null===ut?Object.create(ut):(di.prototype=ut.prototype,new di),dt);ft=(gi.prototype.create=function(n){for(var t,r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];for(var o,u=r[0]||{},s=this.service+"/"+n,h=this.errors[n],l=h?(o=u,h.replace(nr,function(n,t){var i=o[t];return null!=i?i.toString():"<"+t+"?>"})):"Error",a=this.serviceName+": "+l+" ("+s+").",f=new kt(s,a),e=0,c=Object.keys(u);e<c.length;e++)t=c[e],"_"!==t.slice(-1)&&(t in f&&console.warn('Overwriting FirebaseError base field "'+t+'" can cause unexpected behavior.'),f[t]=u[t]);return f},gi);nr=/\{\$([^}]+)}/g;et=(ot.prototype.setInstantiationMode=function(n){return this.instantiationMode=n,this},ot.prototype.setMultipleInstances=function(n){return this.multipleInstances=n,this},ot.prototype.setServiceProps=function(n){return this.serviceProps=n,this},ot);b(a,"_index",["name","keyPath","multiEntry","unique"]);ni(a,"_index",IDBIndex,["get","getKey","getAll","getAllKeys","count"]);ir(a,"_index",IDBIndex,["openCursor","openKeyCursor"]);b(g,"_cursor",["direction","key","primaryKey","value"]);ni(g,"_cursor",IDBCursor,["update","delete"]);["advance","continue","continuePrimaryKey"].forEach(function(n){n in IDBCursor.prototype&&(g.prototype[n]=function(){var t=this,i=arguments;return Promise.resolve().then(function(){return t._cursor[n].apply(t._cursor,i),tr(t._request).then(function(n){if(n)return new g(n,t._request)})})})});h.prototype.createIndex=function(){return new a(this._store.createIndex.apply(this._store,arguments))};h.prototype.index=function(){return new a(this._store.index.apply(this._store,arguments))};b(h,"_store",["name","keyPath","indexNames","autoIncrement"]);ni(h,"_store",IDBObjectStore,["put","add","delete","clear","get","getAll","getKey","getAllKeys","count"]);ir(h,"_store",IDBObjectStore,["openCursor","openKeyCursor"]);st(h,"_store",IDBObjectStore,["deleteIndex"]);nt.prototype.objectStore=function(){return new h(this._tx.objectStore.apply(this._tx,arguments))};b(nt,"_tx",["objectStoreNames","mode"]);st(nt,"_tx",IDBTransaction,["abort"]);ht.prototype.createObjectStore=function(){return new h(this._db.createObjectStore.apply(this._db,arguments))};b(ht,"_db",["name","version","objectStoreNames"]);st(ht,"_db",IDBDatabase,["deleteObjectStore","close"]);ct.prototype.transaction=function(){return new nt(this._db.transaction.apply(this._db,arguments))};b(ct,"_db",["name","version","objectStoreNames"]);st(ct,"_db",IDBDatabase,["close"]);["openCursor","openKeyCursor"].forEach(function(n){[h,a].forEach(function(t){n in t.prototype&&(t.prototype[n.replace("open","iterate")]=function(){var i,t=(i=arguments,Array.prototype.slice.call(i)),f=t[t.length-1],r=this._store||this._index,u=r[n].apply(r,t.slice(0,-1));u.onsuccess=function(){f(u.result)}})})});[a,h].forEach(function(n){n.prototype.getAll||(n.prototype.getAll=function(n,t){var r=this,i=[];return new Promise(function(u){r.iterateCursor(n,function(n){n?(i.push(n.value),void 0===t||i.length!=t?n.continue():u(i)):u(i)})})})});var v,rr="0.4.9",ur=1e4,fr="w:"+rr,er="FIS_v2",fu="https://firebaseinstallations.googleapis.com/v1",eu=36e5,ou=((v={})["missing-app-config-values"]='Missing App configuration value: "{$valueName}"',v["not-registered"]="Firebase Installation is not registered.",v["installation-not-found"]="Firebase Installation not found.",v["request-failed"]='{$requestName} request failed with error "{$serverCode} {$serverStatus}: {$serverMessage}"',v["app-offline"]="Could not process request. Application offline.",v["delete-pending-registration"]="Can't delete installation while there is a pending registration request.",v),c=new ft("installations","Installations",ou);ar=/^[cdef][\w-]{21}$/;lt="";y=new Map;p=null;var br,d,i,o,cu="firebase-installations-database",lu=1,w="firebase-installations-store",ui=null;(br=n).INTERNAL.registerComponent(new et("installations",function(n){var i=n.getProvider("app").getImmediate(),t={appConfig:function(n){var r,f,i,t,u;if(!n||!n.options)throw hi("App Configuration");if(!n.name)throw hi("App Name");try{for(i=ki(["projectId","apiKey","appId"]),t=i.next();!t.done;t=i.next())if(u=t.value,!n.options[u])throw hi(u);}catch(n){r={error:n}}finally{try{t&&!t.done&&(f=i.return)&&f.call(i)}finally{if(r)throw r.error;}}return{appName:n.name,projectId:n.options.projectId,apiKey:n.options.apiKey,appId:n.options.appId}}(i),platformLoggerProvider:n.getProvider("platform-logger")};return{app:i,getId:function(){return function(n){return r(this,void 0,void 0,function(){var t,i,r;return u(this,function(u){switch(u.label){case 0:return[4,oi(n.appConfig)];case 1:return t=u.sent(),i=t.installationEntry,(r=t.registrationPromise)?r.catch(console.error):si(n).catch(console.error),[2,i.fid]}})})}(t)},getToken:function(n){return vu(t,n)},"delete":function(){return function(n){return r(this,void 0,void 0,function(){var i,t;return u(this,function(r){switch(r.label){case 0:return[4,tt(i=n.appConfig,function(n){if(!n||0!==n.registrationStatus)return n})];case 1:if(!(t=r.sent()))return[3,6];if(1!==t.registrationStatus)return[3,2];throw c.create("delete-pending-registration");case 2:if(2!==t.registrationStatus)return[3,6];if(navigator.onLine)return[3,3];throw c.create("app-offline");case 3:return[4,yu(i,t)];case 4:return r.sent(),[4,ei(i)];case 5:r.sent();r.label=6;case 6:return[2]}})})}(t)},onIdChange:function(n){return pu(t,n)}}},"PUBLIC"));br.registerVersion("@firebase/installations",rr);(o=i=i||{})[o.DEBUG=0]="DEBUG";o[o.VERBOSE=1]="VERBOSE";o[o.INFO=2]="INFO";o[o.WARN=3]="WARN";o[o.ERROR=4]="ERROR";o[o.SILENT=5]="SILENT";i.DEBUG;i.VERBOSE;i.INFO;i.WARN;i.ERROR;i.SILENT;var bu=i.INFO,ku=((d={})[i.DEBUG]="log",d[i.VERBOSE]="log",d[i.INFO]="info",d[i.WARN]="warn",d[i.ERROR]="error",d),du=(Object.defineProperty(l.prototype,"logLevel",{get:function(){return this._logLevel},set:function(n){if(!(n in i))throw new TypeError("Invalid value assigned to `logLevel`");this._logLevel=n},enumerable:!0,configurable:!0}),Object.defineProperty(l.prototype,"logHandler",{get:function(){return this._logHandler},set:function(n){if("function"!=typeof n)throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=n},enumerable:!0,configurable:!0}),Object.defineProperty(l.prototype,"userLogHandler",{get:function(){return this._userLogHandler},set:function(n){this._userLogHandler=n},enumerable:!0,configurable:!0}),l.prototype.debug=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this._userLogHandler&&this._userLogHandler.apply(this,s([this,i.DEBUG],t));this._logHandler.apply(this,s([this,i.DEBUG],t))},l.prototype.log=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this._userLogHandler&&this._userLogHandler.apply(this,s([this,i.VERBOSE],t));this._logHandler.apply(this,s([this,i.VERBOSE],t))},l.prototype.info=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this._userLogHandler&&this._userLogHandler.apply(this,s([this,i.INFO],t));this._logHandler.apply(this,s([this,i.INFO],t))},l.prototype.warn=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this._userLogHandler&&this._userLogHandler.apply(this,s([this,i.WARN],t));this._logHandler.apply(this,s([this,i.WARN],t))},l.prototype.error=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this._userLogHandler&&this._userLogHandler.apply(this,s([this,i.ERROR],t));this._logHandler.apply(this,s([this,i.ERROR],t))},l);var f,ci,li,t,ai="measurementId",gu="firebase_id",nf="origin",tu="https://www.googletagmanager.com/gtag/js";(ci=f=f||{}).EVENT="event";ci.SET="set";ci.CONFIG="config";(t=li=li||{}).ADD_SHIPPING_INFO="add_shipping_info";t.ADD_PAYMENT_INFO="add_payment_info";t.ADD_TO_CART="add_to_cart";t.ADD_TO_WISHLIST="add_to_wishlist";t.BEGIN_CHECKOUT="begin_checkout";t.CHECKOUT_PROGRESS="checkout_progress";t.EXCEPTION="exception";t.GENERATE_LEAD="generate_lead";t.LOGIN="login";t.PAGE_VIEW="page_view";t.PURCHASE="purchase";t.REFUND="refund";t.REMOVE_FROM_CART="remove_from_cart";t.SCREEN_VIEW="screen_view";t.SEARCH="search";t.SELECT_CONTENT="select_content";t.SELECT_ITEM="select_item";t.SELECT_PROMOTION="select_promotion";t.SET_CHECKOUT_OPTION="set_checkout_option";t.SHARE="share";t.SIGN_UP="sign_up";t.TIMING_COMPLETE="timing_complete";t.VIEW_CART="view_cart";t.VIEW_ITEM="view_item";t.VIEW_ITEM_LIST="view_item_list";t.VIEW_PROMOTION="view_promotion";t.VIEW_SEARCH_RESULTS="view_search_results";vi=new du("@firebase/analytics");var iu,rt,rf=((it={})["no-ga-id"]='"'+ai+'" field is empty in Firebase config. Firebase Analytics requires this field to contain a valid measurement ID.',it["already-exists"]="A Firebase Analytics instance with the measurement ID ${id}  already exists. Only one Firebase Analytics instance can be created for each measurement ID.",it["already-initialized"]="Firebase Analytics has already been initialized.settings() must be called before initializing any Analytics instanceor it will have no effect.",it["interop-component-reg-failed"]="Firebase Analytics Interop Component failed to instantiate",it),vt=new ft("analytics","Analytics",rf),yi={},yt="dataLayer",ru="gtag",pi=!1;bi="analytics";(wi=n).INTERNAL.registerComponent(new et(bi,function(n){return ff(n.getProvider("app").getImmediate(),n.getProvider("installations").getImmediate())},"PUBLIC").setServiceProps({settings:uf,EventName:li}));wi.INTERNAL.registerComponent(new et("analytics-internal",function(n){try{return{logEvent:n.getProvider(bi).getImmediate().logEvent}}catch(n){throw vt.create("interop-component-reg-failed",{reason:n});}},"PRIVATE"));wi.registerVersion("@firebase/analytics","0.3.4")}).apply(this,arguments)}catch(t){throw console.error(t),new Error("Cannot instantiate firebase-analytics.js - be sure to load firebase-app.js first.");}});!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("@firebase/app")):"function"==typeof define&&define.amd?define(["@firebase/app"],t):t((n=n||self).firebase)}(this,function(n){"use strict";try{(function(){n=n&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n,function(){function uk(n){var t,i,r="undefined"!=typeof Symbol&&Symbol.iterator&&n[Symbol.iterator];return r?r.call(n):{next:(t=n,i=0,function(){return i<t.length?{done:!1,value:t[i++]}:{done:!0}})}}function ei(){}function lu(n){var t=typeof n,i;if("object"==t){if(!n)return"null";if(n instanceof Array)return"array";if(n instanceof Object)return t;if(i=Object.prototype.toString.call(n),"[object Window]"==i)return"object";if("[object Array]"==i||"number"==typeof n.length&&void 0!==n.splice&&void 0!==n.propertyIsEnumerable&&!n.propertyIsEnumerable("splice"))return"array";if("[object Function]"==i||void 0!==n.call&&void 0!==n.propertyIsEnumerable&&!n.propertyIsEnumerable("call"))return"function"}else if("function"==t&&void 0===n.call)return"object";return t}function te(n){var t=lu(n);return"array"==t||"object"==t&&"number"==typeof n.length}function et(n){return"function"==lu(n)}function tt(n){var t=typeof n;return"object"==t&&null!=n||"function"==t}function det(n){return n.call.apply(n.bind,arguments)}function get(n,t){if(!n)throw Error();if(2<arguments.length){var i=Array.prototype.slice.call(arguments,2);return function(){var r=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(r,i),n.apply(t,r)}}return function(){return n.apply(t,arguments)}}function o(){return(o=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?det:get).apply(null,arguments)}function au(n){var t=Array.prototype.slice.call(arguments,1);return function(){var i=t.slice();return i.push.apply(i,arguments),n.apply(this,i)}}function h(n,t){function i(){}i.prototype=t.prototype;n.Za=t.prototype;n.prototype=new i;n.prototype.constructor=n}function i(n,t,i){this.code=re+n;this.message=t||not[n]||"";this.a=i||null}function ek(n){var t=n&&n.code;return t?new i(t.substring(re.length),n.message,n.serverResponse):null}function ue(n){for(var t in rl)if(rl[t].id===n)return{firebaseEndpoint:(n=rl[t]).Ra,secureTokenEndpoint:n.Xa,identityPlatformEndpoint:n.Ua};return null}function ok(n){if(n)try{return n.$goog_Thenable}catch(n){return}}function lt(n){if(Error.captureStackTrace)Error.captureStackTrace(this,lt);else{var t=Error().stack;t&&(this.stack=t)}n&&(this.message=String(n))}function ul(n,t){for(var r="",u=(n=n.split("%s")).length-1,i=0;i<u;i++)r+=n[i]+(i<t.length?t[i]:"%s");lt.call(this,r+n[u])}function yu(n){throw new ul("Failure"+(n?": "+n:""),Array.prototype.slice.call(arguments,1));}function fl(n,t){this.c=n;this.f=t;this.b=0;this.a=null}function sk(n,t){n.f(t);n.b<100&&(n.b++,t.next=n.a,n.a=t)}function hk(){this.b=this.a=null}function ol(){this.next=this.b=this.a=null}function pi(n,t){return 0<=ck(n,t)}function go(n,t){var i;return(i=0<=(t=ck(n,t)))&&Array.prototype.splice.call(n,t,1),i}function dt(n,t){!function(n,t){for(var r="string"==typeof n?n.split(""):n,i=n.length-1;0<=i;--i)i in r&&t.call(void 0,r[i],i,n)}(n,function(i,r){t.call(void 0,i,r,n)&&1==Array.prototype.splice.call(n,r,1).length&&0})}function sl(){return Array.prototype.concat.apply([],arguments)}function cr(n){var i=n.length,r,t;if(0<i){for(r=Array(i),t=0;t<i;t++)r[t]=n[t];return r}return[]}function v(n,t){return-1!=n.indexOf(t)}function hl(n,t){return n<t?-1:t<n?1:0}function it(n){return v(pu,n)}function ak(n,t){for(var i in n)t.call(void 0,n[i],i,n)}function lr(n){for(var t in n)return;return 1}function tr(n){var t,i={};for(t in n)i[t]=n[t];return i}function ht(n){for(var t,i,u,r=1;r<arguments.length;r++){for(t in i=arguments[r])n[t]=i[t];for(u=0;u<al.length;u++)t=al[u],Object.prototype.hasOwnProperty.call(i,t)&&(n[t]=i[t])}}function vl(n,t){var f,u,i,e;n:{try{if(f=n&&n.ownerDocument,u=f&&(f.defaultView||f.parentWindow),(u=u||r).Element&&u.Location){i=u;break n}}catch(n){}i=null}if(i&&void 0!==i[t]&&(!n||!(n instanceof i[t])&&(n instanceof i.Location||n instanceof i.Element))){if(tt(n))try{e=n.constructor.displayName||n.constructor.name||Object.prototype.toString.call(n)}catch(n){e="<object could not be stringified>"}else e=void 0===n?"undefined":null===n?"null":typeof n;yu("Argument is not a %s (or a non-Element, non-Location mock); got: %s",t,e)}}function oi(n,t){this.a=n===fe&&t||"";this.b=vk}function yl(n){return n instanceof oi&&n.constructor===oi&&n.b===vk?n.a:(yu("expected object of type Const, got '"+n+"'"),"type_error:Const")}function ar(n,t){this.a=n===bl&&t||"";this.b=yk}function pl(n){return n instanceof ar&&n.constructor===ar&&n.b===yk?n.a:(yu("expected object of type TrustedResourceUrl, got '"+n+"' of type "+lu(n)),"type_error:TrustedResourceUrl")}function wl(n,t){var i=yl(n);if(!aot.test(i))throw Error("Invalid TrustedResourceUrl format: "+i);return n=i.replace(lot,function(n,r){if(!Object.prototype.hasOwnProperty.call(t,r))throw Error('Found marker, "'+r+'", in format string, "'+i+'", but no valid label mapping found in args: '+JSON.stringify(t));return(n=t[r])instanceof oi?yl(n):encodeURIComponent(String(n))}),new ar(bl,n)}function gt(n,t){this.a=n===ts&&t||"";this.b=dl}function ns(n){return n instanceof gt&&n.constructor===gt&&n.b===dl?n.a:(yu("expected object of type SafeUrl, got '"+n+"' of type "+lu(n)),"type_error:SafeUrl")}function pk(n){return n instanceof gt?n:(n="object"==typeof n&&n.ra?n.qa():String(n),kl.test(n)||(n="about:invalid#zClosurez"),new gt(ts,n))}function wu(){this.a="";this.b=gl}function wk(n){return n instanceof wu&&n.constructor===wu&&n.b===gl?n.a:(yu("expected object of type SafeHtml, got '"+n+"' of type "+lu(n)),"type_error:SafeHtml")}function is(n){var t=new wu;return t.a=n,t}function kk(n){for(var t=n.split("%s"),i="",r=Array.prototype.slice.call(arguments,1);r.length&&1<t.length;)i+=t.shift()+r.shift();return i+t.join("%s")}function na(n){return hot.test(n)&&(-1!=n.indexOf("&")&&(n=n.replace(rot,"&amp;")),-1!=n.indexOf("<")&&(n=n.replace(uot,"&lt;")),-1!=n.indexOf(">")&&(n=n.replace(fot,"&gt;")),-1!=n.indexOf('"')&&(n=n.replace(eot,"&quot;")),-1!=n.indexOf("'")&&(n=n.replace(oot,"&#39;")),-1!=n.indexOf("\0")&&(n=n.replace(sot,"&#0;"))),n}function ta(n){return ta[" "](n),n}function nd(){var n=r.document;if(n)return n.documentMode}function id(n){return t=n,r=function(){for(var t,i,r=0,f=lk(String(ia)).split("."),e=lk(String(n)).split("."),o=Math.max(f.length,e.length),u=0;0==r&&u<o;u++){t=f[u]||"";i=e[u]||"";do{if(t=/(\d*)(\D*)(.*)/.exec(t)||["","","",""],i=/(\d*)(\D*)(.*)/.exec(i)||["","","",""],0==t[0].length&&0==i[0].length)break;r=hl(0==t[1].length?0:parseInt(t[1],10),0==i[1].length?0:parseInt(i[1],10))||hl(0==t[2].length,0==i[2].length)||hl(t[2],i[2]);t=t[3];i=i[3]}while(0==r)}return 0<=r},i=td,Object.prototype.hasOwnProperty.call(i,t)?i[t]:i[t]=r(t);var t,r,i}function ee(n){var t=document;return"string"==typeof n?t.getElementById(n):n}function ud(n,t){ak(t,function(t,i){t&&"object"==typeof t&&t.ra&&(t=t.qa());"style"==i?n.style.cssText=t:"class"==i?n.className=t:"for"==i?n.htmlFor=t:ra.hasOwnProperty(i)?n.setAttribute(ra[i],t):0==i.lastIndexOf("aria-",0)||0==i.lastIndexOf("data-",0)?n.setAttribute(i,t):n[i]=t})}function wot(){var i=arguments,u=document,t=String(i[0]),n=i[1],r;return!rd&&n&&(n.name||n.type)&&((t=["<",t],n.name&&t.push(' name="',na(n.name),'"'),n.type)&&(t.push(' type="',na(n.type),'"'),r={},ht(r,n),delete r.type,n=r),t.push(">"),t=t.join("")),t=os(u,t),n&&("string"==typeof n?t.className=n:Array.isArray(n)?t.className=n.join(" "):ud(t,n)),2<i.length&&function(n,t,i){function f(i){i&&t.appendChild("string"==typeof i?n.createTextNode(i):i)}for(var r,u=2;u<i.length;u++)r=i[u],!te(r)||tt(r)&&0<r.nodeType?f(r):w(bot(r)?cr(r):r,f)}(u,t,i),t}function os(n,t){return t=String(t),"application/xhtml+xml"===n.contentType&&(t=t.toLowerCase()),n.createElement(t)}function bot(n){if(n&&"number"==typeof n.length){if(tt(n))return"function"==typeof n.item||"string"==typeof n.item;if(et(n))return"function"==typeof n.item}}function ed(n){r.setTimeout(function(){throw n;},0)}function kot(){var t=r.MessageChannel;if(void 0===t&&"undefined"!=typeof window&&window.postMessage&&window.addEventListener&&!it("Presto")&&(t=function(){var r,f,n=os(document,"IFRAME"),t,u,i;n.style.display="none";r=n;f=new ar(bl,yl(cot));vl(r,"HTMLIFrameElement");r.src=pl(f).toString();document.documentElement.appendChild(n);t=n.contentWindow;(n=t.document).open();n.write(wk(bk));n.close();u="callImmediate"+Math.random();i="file:"==t.location.protocol?"*":t.location.protocol+"//"+t.location.host;n=o(function(n){"*"!=i&&n.origin!=i||n.data!=u||this.port1.onmessage()},this);t.addEventListener("message",n,!1);this.port1={};this.port2={postMessage:function(){t.postMessage(u,i)}}}),void 0===t||it("Trident")||it("MSIE"))return function(n){r.setTimeout(n,0)};var u=new t,n={},i=n;return u.port1.onmessage=function(){if(void 0!==n.next){var t=(n=n.next).Db;n.Db=null;t()}},function(n){i.next={Db:n};i=i.next;u.port2.postMessage(0)}}function ss(n,t){es||function(){if(r.Promise&&r.Promise.resolve){var n=r.Promise.resolve(void 0);es=function(){n.then(od)}}else es=function(){var n=od;!et(r.setImmediate)||r.Window&&r.Window.prototype&&!it("Edge")&&r.Window.prototype.setImmediate==r.setImmediate?(fd=fd||kot())(n):r.setImmediate(n)}}();hs||(es(),hs=!0);ua.add(n,t)}function od(){for(var t,n,i;i=n=void 0,i=null,(n=ua).a&&(i=n.a,n.a=n.a.next,n.a||(n.b=null),i.next=null),t=i;){try{t.a.call(t.b)}catch(t){ed(t)}sk(el,t)}hs=!1}function c(n,t){if(this.a=vr,this.i=void 0,this.f=this.b=this.c=null,this.g=this.h=!1,n!=ei)try{var i=this;n.call(t,function(n){yr(i,oe,n)},function(n){if(!(n instanceof ku))try{if(n instanceof Error)throw n;throw Error("Promise rejected.");}catch(n){}yr(i,bi,n)})}catch(n){yr(this,bi,n)}}function sd(){this.next=this.f=this.b=this.g=this.a=null;this.c=!1}function ea(n,t,i){var r=fa.get();return r.g=n,r.b=t,r.f=i,r}function e(n){if(n instanceof c)return n;var t=new c(ei);return yr(t,oe,n),t}function y(n){return new c(function(t,i){i(n)})}function hd(n,t,i){ad(n,t,i,null)||ss(au(t,n))}function cd(n){return new c(function(t){var r=n.length,u=[],f,i;if(r)for(f=function(n,i,f){r--;u[n]=i?{Mb:!0,value:f}:{Mb:!1,reason:f};0==r&&t(u)},i=0;i<n.length;i++)hd(n[i],au(f,i,!0),au(f,i,!1));else t(u)})}function oa(n,t){n.b||n.a!=oe&&n.a!=bi||vd(n);n.f?n.f.next=t:n.b=t;n.f=t}function ld(n,t,i,r){var u=ea(null,null,null);return u.a=new c(function(n,f){u.g=t?function(i){try{var u=t.call(r,i);n(u)}catch(i){f(i)}}:n;u.b=i?function(t){try{var u=i.call(r,t);void 0===u&&t instanceof ku?f(t):n(u)}catch(t){f(t)}}:f}),oa(u.a.c=n,u),u.a}function yr(n,t,i){var r,u;n.a==vr&&(n===i&&(t=bi,i=new TypeError("Promise cannot resolve to itself")),n.a=1,ad(i,n.Yc,n.Zc,n)||(n.i=i,n.a=t,n.c=null,vd(n),t!=bi||i instanceof ku||(u=i,(r=n).g=!0,ss(function(){r.g&&sa.call(null,u)}))))}function ad(n,t,i,r){if(n instanceof c)return oa(n,ea(t||ei,i||null,r)),1;if(ok(n))return n.then(t,i,r),1;if(tt(n))try{var u=n.then;if(et(u))return function(n,t,i,r,u){function e(n){f||(f=!0,r.call(u,n))}var f=!1;try{t.call(n,function(n){f||(f=!0,i.call(u,n))},e)}catch(n){e(n)}}(n,u,t,i,r),1}catch(n){return i.call(r,n),1}}function vd(n){n.h||(n.h=!0,ss(n.ec,n))}function yd(n){var t=null;return n.b&&(t=n.b,n.b=t.next,t.next=null),n.b||(n.f=null),t}function pd(n,t,i,r){if(i==bi&&t.b&&!t.c)for(;n&&n.g;n=n.c)n.g=!1;if(t.a)t.a.c=null,wd(t,i,r);else try{t.c?t.g.call(t.f):wd(t,i,r)}catch(n){sa.call(null,n)}sk(fa,t)}function wd(n,t,i){t==oe?n.g.call(n.f,i):n.b&&n.b.call(n.f,i)}function ku(n){lt.call(this,n)}function cs(){this.wa=this.wa;this.na=this.na}function kd(n){n.wa||(n.wa=!0,n.Ba(),0==bd)||(t=n,Object.prototype.hasOwnProperty.call(t,bo)&&t[bo]||(t[bo]=++fk));var t}function yt(n,t){this.type=n;this.b=this.target=t;this.defaultPrevented=!1}function pr(n,t){var r,i,u;if(yt.call(this,n?n.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,n){if(r=this.type=n.type,i=n.changedTouches&&n.changedTouches.length?n.changedTouches[0]:null,this.target=n.target||n.srcElement,this.b=t,t=n.relatedTarget){if(gk){n:{try{ta(t.nodeName);u=!0;break n}catch(n){}u=!1}u||(t=null)}}else"mouseover"==r?t=n.fromElement:"mouseout"==r&&(t=n.toElement);this.relatedTarget=t;i?(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.clientX=void 0!==n.clientX?n.clientX:n.pageX,this.clientY=void 0!==n.clientY?n.clientY:n.pageY,this.screenX=n.screenX||0,this.screenY=n.screenY||0);this.button=n.button;this.key=n.key||"";this.ctrlKey=n.ctrlKey;this.altKey=n.altKey;this.shiftKey=n.shiftKey;this.metaKey=n.metaKey;this.pointerId=n.pointerId||0;this.pointerType="string"==typeof n.pointerType?n.pointerType:gd[n.pointerType]||"";(this.a=n).defaultPrevented&&this.preventDefault()}}function tst(n,t,i,r,u){this.listener=n;this.proxy=null;this.src=t;this.type=i;this.capture=!!r;this.Ta=u;this.key=++ng;this.ua=this.Na=!1}function ls(n){n.ua=!0;n.listener=null;n.proxy=null;n.src=null;n.Ta=null}function as(n){this.src=n;this.a={};this.b=0}function ha(n,t){var i=t.type;i in n.a&&go(n.a[i],t)&&(ls(t),0==n.a[i].length&&(delete n.a[i],n.b--))}function ca(n,t,i,r){for(var f,u=0;u<n.length;++u)if(f=n[u],!f.ua&&f.listener==t&&f.capture==!!i&&f.Ta==r)return u;return-1}function ti(n,t,i,r,u){if(r&&r.once)la(n,t,i,r,u);else if(Array.isArray(t))for(var f=0;f<t.length;f++)ti(n,t[f],i,r,u);else i=aa(i),n&&n[du]?eg(n,t,i,tt(r)?!!r.capture:!!r,u):tg(n,t,i,!1,r,u)}function tg(n,t,i,r,u,f){if(!t)throw Error("Invalid event type");var o,e,h=tt(u)?!!u.capture:!!u,s=ps(n);if(s||(n[vs]=s=new as(n)),!(i=s.add(t,i,r,h,f)).proxy)if(o=ist,r=e=dd?function(n){return o.call(e.src,e.listener,n)}:function(n){if(!(n=o.call(e.src,e.listener,n)))return n},(i.proxy=r).src=n,r.listener=i,n.addEventListener)nst||(u=h),void 0===u&&(u=!1),n.addEventListener(t.toString(),r,u);else if(n.attachEvent)n.attachEvent(rg(t.toString()),r);else{if(!n.addListener||!n.removeListener)throw Error("addEventListener and attachEvent are unavailable.");n.addListener(r)}}function la(n,t,i,r,u){if(Array.isArray(t))for(var f=0;f<t.length;f++)la(n,t[f],i,r,u);else i=aa(i),n&&n[du]?va(n,t,i,tt(r)?!!r.capture:!!r,u):tg(n,t,i,!0,r,u)}function pt(n,t,i,r,u){if(Array.isArray(t))for(var f=0;f<t.length;f++)pt(n,t[f],i,r,u);else r=tt(r)?!!r.capture:!!r,i=aa(i),n&&n[du]?(n=n.u,(t=String(t).toString())in n.a&&-1<(i=ca(f=n.a[t],i,r,u))&&(ls(f[i]),Array.prototype.splice.call(f,i,1),0==f.length&&(delete n.a[t],n.b--))):(n=n&&ps(n))&&(t=n.a[t.toString()],n=-1,t&&(n=ca(t,i,r,u)),(i=-1<n?t[n]:null)&&ig(i))}function ig(n){var t,i,r;"number"!=typeof n&&n&&!n.ua&&(t=n.src,t&&t[du]?ha(t.u,n):(i=n.type,r=n.proxy,t.removeEventListener?t.removeEventListener(i,r,n.capture):t.detachEvent?t.detachEvent(rg(i),r):t.addListener&&t.removeListener&&t.removeListener(r),(i=ps(t))?(ha(i,n),0==i.b&&(i.src=null,t[vs]=null)):ls(n)))}function rg(n){return n in ys?ys[n]:ys[n]="on"+n}function ug(n,t,i,r){var f=!0,u;if((n=ps(n))&&(t=n.a[t.toString()]))for(t=t.concat(),n=0;n<t.length;n++)u=t[n],u&&u.capture==i&&!u.ua&&(u=fg(u,r),f=f&&!1!==u);return f}function fg(n,t){var i=n.listener,r=n.Ta||n.src;return n.Na&&ig(n),i.call(r,t)}function ist(n,t){var f,i,u,e;if(n.ua)return!0;if(dd)return fg(n,new pr(t,this));if(!t)n:{for(t=["window","event"],f=r,i=0;i<t.length;i++)if(null==(f=f[t[i]])){t=null;break n}t=f}if(t=new pr(i=t,this),f=!0,!(i.keyCode<0||null!=i.returnValue)){n:{if(u=!1,0==i.keyCode)try{i.keyCode=-1;break n}catch(n){u=!0}(u||null==i.returnValue)&&(i.returnValue=!0)}for(i=[],u=t.b;u;u=u.parentNode)i.push(u);for(n=n.type,u=i.length-1;0<=u;u--)t.b=i[u],e=ug(i[u],n,!0,t),f=f&&e;for(u=0;u<i.length;u++)t.b=i[u],e=ug(i[u],n,!1,t),f=f&&e}return f}function ps(n){return(n=n[vs])instanceof as?n:null}function aa(n){return et(n)?n:(n[ws]||(n[ws]=function(t){return n.handleEvent(t)}),n[ws])}function ot(){cs.call(this);this.u=new as(this);(this.Yb=this).eb=null}function eg(n,t,i,r,u){n.u.add(String(t),i,!1,r,u)}function va(n,t,i,r,u){n.u.add(String(t),i,!0,r,u)}function bs(n,t,i,r){var f,e,u,o,s;if(!(t=n.u.a[String(t)]))return!0;for(t=t.concat(),f=!0,e=0;e<t.length;++e)u=t[e],u&&!u.ua&&u.capture==i&&(o=u.listener,s=u.Ta||u.src,u.Na&&ha(n.u,u),f=!1!==o.call(s,r)&&f);return f&&!r.defaultPrevented}function ya(n,t,i){if(et(n))i&&(n=o(n,i));else{if(!n||"function"!=typeof n.handleEvent)throw Error("Invalid listener argument");n=o(n.handleEvent,n)}return 2147483647<Number(t)?-1:r.setTimeout(n,t||0)}function gu(n){var t=null;return new c(function(i,r){-1==(t=ya(function(){i(void 0)},n))&&r(Error("Failed to schedule timer."))}).o(function(n){throw r.clearTimeout(t),n;})}function og(n){if(n.V&&"function"==typeof n.V)return n.V();if("string"==typeof n)return n.split("");if(te(n)){for(var t=[],r=n.length,i=0;i<r;i++)t.push(n[i]);return t}for(i in t=[],r=0,n)t[r++]=n[i];return t}function sg(n){var t,i,r;if(n.X&&"function"==typeof n.X)return n.X();if(!n.V||"function"!=typeof n.V){if(te(n)||"string"==typeof n){for(t=[],n=n.length,i=0;i<n;i++)t.push(i);return t}for(r in t=[],i=0,n)t[i++]=r;return t}}function nf(n){var i,t;if(this.b={},this.a=[],this.c=0,i=arguments.length,1<i){if(i%2)throw Error("Uneven number of arguments");for(t=0;t<i;t+=2)this.set(arguments[t],arguments[t+1])}else if(n)if(n instanceof nf)for(i=n.X(),t=0;t<i.length;t++)this.set(i[t],n.get(i[t]));else for(t in n)this.set(t,n[t])}function pa(n){var t,i,r,u;if(n.c!=n.a.length){for(t=0,i=0;t<n.a.length;)r=n.a[t],wr(n.b,r)&&(n.a[i++]=r),t++;n.a.length=i}if(n.c!=n.a.length){for(u={},i=t=0;t<n.a.length;)wr(u,r=n.a[t])||(u[n.a[i++]=r]=1),t++;n.a.length=i}}function wr(n,t){return Object.prototype.hasOwnProperty.call(n,t)}function ir(n,t){var i;this.b=this.i=this.f="";this.l=null;this.g=this.c="";this.h=!1;n instanceof ir?(this.h=void 0!==t?t:n.h,ks(this,n.f),this.i=n.i,this.b=n.b,ba(this,n.l),this.c=n.c,ka(this,vg(n.a)),this.g=n.g):n&&(i=String(n).match(wa))?(this.h=!!t,ks(this,i[1]||"",!0),this.i=se(i[2]||""),this.b=se(i[3]||"",!0),ba(this,i[4]),this.c=se(i[5]||"",!0),ka(this,i[6]||"",!0),this.g=se(i[7]||"")):(this.h=!!t,this.a=new br(null,this.h))}function ks(n,t,i){n.f=i?se(t,!0):t;n.f&&(n.f=n.f.replace(/:$/,""))}function ba(n,t){if(t){if(t=Number(t),isNaN(t)||t<0)throw Error("Bad port number "+t);n.l=t}else n.l=null}function ka(n,t,i){var r,u;t instanceof br?(n.a=t,r=n.a,(u=n.h)&&!r.f&&(rr(r),r.c=null,r.a.forEach(function(n,t){var i=t.toLowerCase();t!=i&&(si(this,t),ag(this,i,n))},r)),r.f=u):(i||(t=he(t,est)),n.a=new br(t,n.h))}function d(n,t,i){n.a.set(t,i)}function wt(n,t){return n.a.get(t)}function ki(n){return n instanceof ir?new ir(n):new ir(n,void 0)}function hg(n,t){var i=new ir(null,void 0);return ks(i,"https"),n&&(i.b=n),t&&(i.c=t),i}function se(n,t){return n?t?decodeURI(n.replace(/%25/g,"%2525")):decodeURIComponent(n):""}function he(n,t,i){return"string"==typeof n?(n=encodeURI(n).replace(t,rst),i&&(n=n.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),n):null}function rst(n){return"%"+((n=n.charCodeAt(0))>>4&15).toString(16)+(15&n).toString(16)}function br(n,t){this.b=this.a=null;this.c=n||null;this.f=!!t}function rr(n){n.a||(n.a=new nf,n.b=0,n.c&&function(n,t){var i,r,u,f;if(n)for(n=n.split("&"),i=0;i<n.length;i++)r=n[i].indexOf("="),u=null,0<=r?(f=n[i].substring(0,r),u=n[i].substring(r+1)):f=n[i],t(f,u?decodeURIComponent(u.replace(/\+/g," ")):"")}(n.c,function(t,i){n.add(decodeURIComponent(t.replace(/\+/g," ")),i)}))}function lg(n){var u=sg(n),i,t,f,r;if(void 0===u)throw Error("Keys are undefined");for(i=new br(null,void 0),n=og(n),t=0;t<u.length;t++)f=u[t],r=n[t],Array.isArray(r)?ag(i,f,r):i.add(f,r);return i}function si(n,t){rr(n);t=tf(n,t);wr(n.a.b,t)&&(n.c=null,n.b-=n.a.get(t).length,wr((n=n.a).b,t)&&(delete n.b[t],n.c--,n.a.length>2*n.c&&pa(n)))}function da(n,t){return rr(n),t=tf(n,t),wr(n.a.b,t)}function ag(n,t,i){si(n,t);0<i.length&&(n.c=null,n.a.set(tf(n,t),cr(i)),n.b+=i.length)}function vg(n){var t=new br;return t.c=n.c,n.a&&(t.a=new nf(n.a),t.b=n.b),t}function tf(n,t){return t=String(t),n.f&&(t=t.toLowerCase()),t}function yg(n){var t=[];return function n(t,i,r){var u,f,e;if(null==i)r.push("null");else{if("object"==typeof i){if(Array.isArray(i)){for(u=i,i=u.length,r.push("["),f="",e=0;e<i;e++)r.push(f),n(t,u[e],r),f=",";return void r.push("]")}if(!(i instanceof String||i instanceof Number||i instanceof Boolean)){for(u in r.push("{"),f="",i)Object.prototype.hasOwnProperty.call(i,u)&&"function"!=typeof(e=i[u])&&(r.push(f),wg(u,r),r.push(":"),n(t,e,r),f=",");return void r.push("}")}i=i.valueOf()}switch(typeof i){case"string":wg(i,r);break;case"number":r.push(isFinite(i)&&!isNaN(i)?String(i):"null");break;case"boolean":r.push(String(i));break;case"function":r.push("null");break;default:throw Error("Unknown type: "+typeof i);}}}(new sst,n,t),t.join("")}function sst(){}function wg(n,t){t.push('"',n.replace(pg,function(n){var t=ga[n];return t||(t="\\u"+(65536|n.charCodeAt(0)).toString(16).substr(1),ga[n]=t),t}),'"')}function nv(){var n=ft();return ni&&wi&&11==wi||/Edge\/\d+/.test(n)}function ce(){return r.window&&r.window.location.href||self&&self.location&&self.location.href||""}function bg(n,t){t=t||r.window;var i="about:blank";n&&(i=ns(pk(n)));t.location.href=i}function kg(n){return!!((n=(n||ft()).toLowerCase()).match(/android/)||n.match(/webos/)||n.match(/iphone|ipad|ipod/)||n.match(/blackberry/)||n.match(/windows phone/)||n.match(/iemobile/))}function kr(n){n=n||r.window;try{n.close()}catch(n){}}function dg(n,t,i){var u=Math.floor(1e9*Math.random()).toString(),f,e,r;t=t||500;i=i||600;f=(window.screen.availHeight-i)/2;e=(window.screen.availWidth-t)/2;for(r in t={width:t,height:i,top:0<f?f:0,left:0<e?e:0,location:!0,resizable:!0,statusbar:!0,toolbar:!1},i=ft().toLowerCase(),u&&(t.target=u,v(i,"crios/")&&(t.target="_blank")),rf(ft())==ds&&(n=n||"http://localhost",t.scrollbars=!0),i=n||"",(n=t)||(n={}),u=window,t=i instanceof gt?i:pk(void 0!==i.href?i.href:String(i)),i=n.target||i.target,f=[],n)switch(r){case"width":case"height":case"top":case"left":f.push(r+"="+n[r]);break;case"target":case"noopener":case"noreferrer":break;default:f.push(r+"="+(n[r]?1:0))}if(r=f.join(","),(it("iPhone")&&!it("iPod")&&!it("iPad")||it("iPad")||it("iPod"))&&u.navigator&&u.navigator.standalone&&i&&"_self"!=i?(vl(r=os(document,"A"),"HTMLAnchorElement"),t instanceof gt||t instanceof gt||(t="object"==typeof t&&t.ra?t.qa():String(t),kl.test(t)||(t="about:invalid#zClosurez"),t=new gt(ts,t)),r.href=ns(t),r.setAttribute("target",i),n.noreferrer&&r.setAttribute("rel","noreferrer"),(n=document.createEvent("MouseEvent")).initMouseEvent("click",!0,!0,u,1),r.dispatchEvent(n),r={}):n.noreferrer?(r=u.open("",i,r),n=ns(t),r&&(yot&&v(n,";")&&(n="'"+n.replace(/'/g,"%27")+"'"),r.opener=null,n=is('<meta name="referrer" content="no-referrer"><meta http-equiv="refresh" content="0; url='+na(n)+'">'),u=r.document)&&(u.write(wk(n)),u.close())):(r=u.open(ns(t),i,r))&&n.noopener&&(r.opener=null),r)try{r.focus()}catch(n){}return r}function tv(){var n=null;return new c(function(t){"complete"==r.document.readyState?t():(n=function(){t()},la(window,"load",n))}).o(function(t){throw pt(window,"load",n),t;})}function iv(n){return n=n||ft(),!("file:"!==ff()&&"ionic:"!==ff()||!n.toLowerCase().match(/iphone|ipad|ipod|android/))}function rv(){var n=r.window;try{return n&&n!=n.top}catch(n){return}}function ii(){return void 0!==r.WorkerGlobalScope&&"function"==typeof r.importScripts}function hi(){return n.INTERNAL.hasOwnProperty("reactNative")?"ReactNative":n.INTERNAL.hasOwnProperty("node")?"Node":ii()?"Worker":"Browser"}function tn(){var n=hi();return"ReactNative"===n||"Node"===n}function rf(n){var t=n.toLowerCase();return v(t,"opera/")||v(t,"opr/")||v(t,"opios/")?"Opera":v(t,"iemobile")?"IEMobile":v(t,"msie")||v(t,"trident/")?"IE":v(t,"edge/")?"Edge":v(t,"firefox/")?ds:v(t,"silk/")?"Silk":v(t,"blackberry")?"Blackberry":v(t,"webos")?"Webos":!v(t,"safari/")||v(t,"chrome/")||v(t,"crios/")||v(t,"android")?!v(t,"chrome/")&&!v(t,"crios/")||v(t,"edge/")?v(t,"android")?"Android":(n=n.match(/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/))&&2==n.length?n[1]:"Other":uv:"Safari"}function uf(n,t){t=t||[];var r,i=[],u={};for(r in fv)u[fv[r]]=!0;for(r=0;r<t.length;r++)void 0!==u[t[r]]&&(delete u[t[r]],i.push(t[r]));return i.sort(),(t=i).length||(t=["FirebaseCore-web"]),"Browser"===(i=hi())?i=rf(u=ft()):"Worker"===i&&(i=rf(u=ft())+"-"+i),i+"/JsCore/"+n+"/"+t.join(",")}function ft(){return r.navigator&&r.navigator.userAgent||""}function p(n,t){n=n.split(".");t=t||r;for(var i=0;i<n.length&&"object"==typeof t&&null!=t;i++)t=t[n[i]];return i!=n.length&&(t=void 0),t}function ev(){try{var n=r.localStorage,t=gr();if(n)return n.setItem(t,"1"),n.removeItem(t),!nv()||!!r.indexedDB}catch(n){return ii()&&!!r.indexedDB}return!1}function dr(){return(gs()||"chrome-extension:"===ff()||iv())&&!tn()&&ev()&&!ii()}function gs(){return"http:"===ff()||"https:"===ff()}function ff(){return r.location&&r.location.protocol||null}function le(n){return!kg(n=n||ft())&&rf(n)!=ds}function ae(n){return void 0===n?null:yg(n)}function rn(n){var t,i={};for(t in n)n.hasOwnProperty(t)&&null!==n[t]&&void 0!==n[t]&&(i[t]=n[t]);return i}function ef(n){if(null!==n)return JSON.parse(n)}function gr(n){return n||Math.floor(1e9*Math.random()).toString()}function un(n){return"Safari"!=rf(n=n||ft())&&!n.toLowerCase().match(/iphone|ipad|ipod/)}function fn(){var n=r.___jsl,t,i;if(n&&n.H)for(t in n.H)if(n.H[t].r=n.H[t].r||[],n.H[t].L=n.H[t].L||[],n.H[t].r=n.H[t].L.concat(),n.CP)for(i=0;i<n.CP.length;i++)n.CP[i]=null}function ur(n,t){if(t<n)throw Error("Short delay should be less than long delay!");this.a=n;this.c=t;n=ft();t=hi();this.b=kg(n)||"ReactNative"===t}function ov(){var n=r.document;return!n||void 0===n.visibilityState||"visible"==n.visibilityState}function ve(n){try{var t=new Date(parseInt(n,10));if(!isNaN(t.getTime())&&!/[^0-9]/.test(n))return t.toUTCString()}catch(n){}return null}function en(){return p("fireauth.oauthhelper",r)||p("fireauth.iframe",r)}function cv(n){hv[n]||(hv[n]=!0,"undefined"!=typeof console&&"function"==typeof console.warn&&console.warn(n))}function u(n,t,i){sv?Object.defineProperty(n,t,{configurable:!0,enumerable:!0,value:i}):n[t]=i}function st(n,t){if(t)for(var i in t)t.hasOwnProperty(i)&&u(n,i,t[i])}function fr(n){var t={};return st(t,n),t}function lv(n){var t=n,i;if("object"==typeof n&&null!=n)for(i in t="length"in n?[]:{},n)u(t,i,lv(n[i]));return t}function av(n){var r=n&&(n[wv]?"phone":null),t;if(!(r&&n&&n[pv]))throw new i("internal-error","Internal assert: invalid MultiFactorInfo object");u(this,"uid",n[pv]);u(this,"displayName",n[on]||null);t=null;n[yv]&&(t=new Date(n[yv]).toUTCString());u(this,"enrollmentTime",t);u(this,"factorId",r)}function vv(n){try{var t=new ye(n)}catch(n){t=null}return t}function ye(n){av.call(this,n);u(this,"phoneNumber",n[wv])}function hst(n){var t={},r=n[cst],f=n[ast],i=n[vst];if(n=vv(n[lst]),!i||i!=th&&i!=pe&&!r||i==pe&&!f||i==bv&&!n)throw Error("Invalid checkActionCode response!");i==pe?(t[hn]=r||null,t[cn]=r||null,t[sn]=f):(t[hn]=f||null,t[cn]=f||null,t[sn]=r||null);t[yst]=n||null;u(this,wst,i);u(this,pst,lv(t))}function kv(n){var r=wt(n=ki(n),ln)||null,u=wt(n,an)||null,t=wt(n,vn)||null;if(t=t&&gst[t]||null,!r||!u||!t)throw new i("argument-error",ln+", "+an+"and "+vn+" are required in a valid action code URL.");st(this,{apiKey:r,operation:t,code:u,continueUrl:wt(n,bst)||null,languageCode:wt(n,kst)||null,tenantId:wt(n,dst)||null})}function yn(n){try{return new kv(n)}catch(n){return null}}function ih(n){var t=n[nht],r,u;if(void 0===t)throw new i("missing-continue-uri");if("string"!=typeof t||"string"==typeof t&&!t.length)throw new i("invalid-continue-uri");if(this.h=t,this.b=this.a=null,this.g=!1,r=n[pn],r&&"object"==typeof r)if(t=r[gn],u=r[kn],r=r[dn],"string"==typeof t&&t.length){if(this.a=t,void 0!==u&&"boolean"!=typeof u)throw new i("argument-error",kn+" property must be a boolean when specified.");if(this.g=!!u,void 0!==r&&("string"!=typeof r||"string"==typeof r&&!r.length))throw new i("argument-error",dn+" property must be a non empty string when specified.");this.b=r||null}else{if(void 0!==t)throw new i("argument-error",gn+" property must be a non empty string when specified.");if(void 0!==u||void 0!==r)throw new i("missing-android-pkg-name");}else if(void 0!==r)throw new i("argument-error",pn+" property must be a non null object when specified.");if(this.f=null,(t=n[bn])&&"object"==typeof t){if("string"==typeof(t=t[ntt])&&t.length)this.f=t;else if(void 0!==t)throw new i("argument-error",ntt+" property must be a non empty string when specified.");}else if(void 0!==t)throw new i("argument-error",bn+" property must be a non null object when specified.");if(void 0!==(t=n[dv])&&"boolean"!=typeof t)throw new i("argument-error",dv+" property must be a boolean when specified.");if(this.c=!!t,void 0!==(n=n[wn])&&("string"!=typeof n||"string"==typeof n&&!n.length))throw new i("argument-error",wn+" property must be a non empty string when specified.");this.i=n||null}function rh(n){var t={};for(var i in t.continueUrl=n.h,t.canHandleCodeInApp=n.c,(t.androidPackageName=n.a)&&(t.androidMinimumVersion=n.b,t.androidInstallApp=n.g),t.iOSBundleId=n.f,t.dynamicLinkDomain=n.i,t)null===t[i]&&delete t[i];return t}function tht(n){var t="";return function(n,t){function i(t){for(;r<n.length;){var i=n.charAt(r++),u=of[i];if(null!=u)return u;if(!/^[\s\xa0]*$/.test(i))throw Error("Unknown base64 encoding at char: "+i);}return t}var r;for(!function(){var i,n,r;if(!of){of={};for(var u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),f=["+/=","+/","-_=","-_.","-_"],t=0;t<5;t++)for(i=u.concat(f[t].split("")),n=0;n<i.length;n++)r=i[n],void 0===of[r]&&(of[r]=n)}}(),r=0;;){var e=i(-1),o=i(0),u=i(64),f=i(64);if(64===f&&-1===e)break;t(e<<2|o>>4);64!=u&&(t(o<<4&240|u>>2),64!=f&&t(u<<6&192|f))}}(n,function(n){t+=String.fromCharCode(n)}),t}function uh(n){var t=ttt(n);if(!(t&&t.sub&&t.iss&&t.aud&&t.exp))throw Error("Invalid JWT");this.g=n;this.c=t.exp;this.h=t.sub;this.a=t.provider_id||t.firebase&&t.firebase.sign_in_provider||null;this.f=t.firebase&&t.firebase.tenant||null;this.b=!!t.is_anonymous||"anonymous"==this.a}function fh(n){try{return new uh(n)}catch(n){return null}}function ttt(n){if(!n||3!=(n=n.split(".")).length)return null;for(var i=(4-(n=n[1]).length%4)%4,t=0;t<i;t++)n+=".";try{return JSON.parse(tht(n))}catch(n){}return null}function ny(n){for(var t in gv)if(gv[t].ea==n)return gv[t];return null}function rtt(n){var t={},i;t["facebook.com"]=utt;t["google.com"]=ett;t["github.com"]=ftt;t["twitter.com"]=ott;i=n&&n[ty];try{if(i)return t[i]?new t[i](n):new ci(n);if(void 0!==n[oh])return new iy(n)}catch(n){}return null}function iy(n){var i=n[ty],t;if(!i&&n[oh]&&(t=fh(n[oh]),t&&t.a&&(i=t.a)),!i)throw Error("Invalid additional user info!");"anonymous"!=i&&"custom"!=i||(i=null);t=!1;void 0!==n.isNewUser?t=!!n.isNewUser:"identitytoolkit#SignupNewUserResponse"===n.kind&&(t=!0);u(this,"providerId",i);u(this,"isNewUser",t)}function ci(n){iy.call(this,n);u(this,"profile",lv((n=ef(n.rawUserInfo||"{}"))||{}))}function utt(n){if(ci.call(this,n),"facebook.com"!=this.providerId)throw Error("Invalid provider ID!");}function ftt(n){if(ci.call(this,n),"github.com"!=this.providerId)throw Error("Invalid provider ID!");u(this,"username",this.profile&&this.profile.login||null)}function ett(n){if(ci.call(this,n),"google.com"!=this.providerId)throw Error("Invalid provider ID!");}function ott(n){if(ci.call(this,n),"twitter.com"!=this.providerId)throw Error("Invalid provider ID!");u(this,"username",n.screenName||null)}function stt(n){var t=ki(n),i=wt(t,"link"),r=wt(ki(i),"link");return t=wt(t,"deep_link_id"),wt(ki(t),"link")||t||r||i||n}function sh(n,t){if(!n&&!t)throw new i("internal-error","Internal assert: no raw session string available");if(n&&t)throw new i("internal-error","Internal assert: unable to determine the session type");this.a=n||null;this.b=t||null;this.type=this.a?sf:we}function hf(){}function cf(n,t){return n.then(function(n){if(n[fi]){var r=fh(n[fi]);if(!r||t!=r.h)throw new i("user-mismatch");return n}throw new i("user-mismatch");}).o(function(n){throw n&&n.code&&n.code==re+"user-not-found"?new i("user-mismatch"):n;})}function nu(n,t){if(!t)throw new i("internal-error","failed to construct a credential");this.a=t;u(this,"providerId",n);u(this,"signInMethod",n)}function ry(n){return{pendingToken:n.a,requestUri:"http://localhost"}}function iht(n){if(n&&n.providerId&&n.signInMethod&&0==n.providerId.indexOf("saml.")&&n.pendingToken)try{return new nu(n.providerId,n.pendingToken)}catch(n){}return null}function di(n,t,r){if(this.a=null,t.idToken||t.accessToken)t.idToken&&u(this,"idToken",t.idToken),t.accessToken&&u(this,"accessToken",t.accessToken),t.nonce&&!t.pendingToken&&u(this,"nonce",t.nonce),t.pendingToken&&(this.a=t.pendingToken);else{if(!t.oauthToken||!t.oauthTokenSecret)throw new i("internal-error","failed to construct a credential");u(this,"accessToken",t.oauthToken);u(this,"secret",t.oauthTokenSecret)}u(this,"providerId",n);u(this,"signInMethod",r)}function uy(n){var t={};return n.idToken&&(t.id_token=n.idToken),n.accessToken&&(t.access_token=n.accessToken),n.secret&&(t.oauth_token_secret=n.secret),t.providerId=n.providerId,n.nonce&&!n.a&&(t.nonce=n.nonce),t={postBody:lg(t).toString(),requestUri:"http://localhost"},n.a&&(delete t.postBody,t.pendingToken=n.a),t}function rht(n){if(n&&n.providerId&&n.signInMethod){var t={idToken:n.oauthIdToken,accessToken:n.oauthTokenSecret?null:n.oauthAccessToken,oauthTokenSecret:n.oauthTokenSecret,oauthToken:n.oauthTokenSecret&&n.oauthAccessToken,nonce:n.nonce,pendingToken:n.pendingToken};try{return new di(n.providerId,t,n.signInMethod)}catch(n){}}return null}function tu(n,t){this.Oc=t||[];st(this,{providerId:n,isOAuthProvider:!0});this.Fb={};this.lb=(ny(n)||{}).Ha||null;this.kb=null}function htt(n){if("string"!=typeof n||0!=n.indexOf("saml."))throw new i("argument-error",'SAML provider IDs must be prefixed with "saml."');tu.call(this,n,[])}function at(n){tu.call(this,n,eh);this.a=[]}function iu(){at.call(this,"facebook.com")}function ctt(n){if(!n)throw new i("argument-error","credential failed: expected 1 argument (the OAuth access token).");var t=n;return tt(n)&&(t=n.accessToken),(new iu).credential({accessToken:t})}function ru(){at.call(this,"github.com")}function ltt(n){if(!n)throw new i("argument-error","credential failed: expected 1 argument (the OAuth access token).");var t=n;return tt(n)&&(t=n.accessToken),(new ru).credential({accessToken:t})}function uu(){at.call(this,"google.com");this.Aa("profile")}function att(n,t){var i=n;return tt(n)&&(i=n.idToken,t=n.accessToken),(new uu).credential({idToken:i,accessToken:t})}function lf(){tu.call(this,"twitter.com",itt)}function vtt(n,t){var r=n;if(tt(r)||(r={oauthToken:n,oauthTokenSecret:t}),!r.oauthToken||!r.oauthTokenSecret)throw new i("argument-error","credential failed: expected 2 arguments (the OAuth access token and secret).");return new di("twitter.com",r,"twitter.com")}function er(n,t,i){this.a=n;this.f=t;u(this,"providerId","password");u(this,"signInMethod",i===bt.EMAIL_LINK_SIGN_IN_METHOD?bt.EMAIL_LINK_SIGN_IN_METHOD:bt.EMAIL_PASSWORD_SIGN_IN_METHOD)}function uht(n){return n&&n.email&&n.password?new er(n.email,n.password,n.signInMethod):null}function bt(){st(this,{providerId:"password",isOAuthProvider:!1})}function ytt(n,t){if(!(t=fy(t)))throw new i("argument-error","Invalid email link!");return new er(n,t.code,bt.EMAIL_LINK_SIGN_IN_METHOD)}function fy(n){return(n=yn(n=stt(n)))&&n.operation===th?n:null}function or(n){if(!(n.bb&&n.ab||n.Ja&&n.da))throw new i("internal-error");this.a=n;u(this,"providerId","phone");this.ea="phone";u(this,"signInMethod","phone")}function fht(n){if(n&&"phone"===n.providerId&&(n.verificationId&&n.verificationCode||n.temporaryProof&&n.phoneNumber)){var t={};return w(["verificationId","verificationCode","temporaryProof","phoneNumber"],function(i){n[i]&&(t[i]=n[i])}),new or(t)}return null}function be(n){return n.a.Ja&&n.a.da?{temporaryProof:n.a.Ja,phoneNumber:n.a.da}:{sessionInfo:n.a.bb,code:n.a.ab}}function gi(t){try{this.a=t||n.auth()}catch(t){throw new i("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().");}st(this,{providerId:"phone",isOAuthProvider:!1})}function ptt(n,t){if(!n)throw new i("missing-verification-id");if(!t)throw new i("missing-verification-code");return new or({bb:n,ab:t})}function ey(n){var t;if(n.temporaryProof&&n.phoneNumber)return new or({Ja:n.temporaryProof,da:n.phoneNumber});if(t=n&&n.providerId,!t||"password"===t)return null;var i=n&&n.oauthAccessToken,f=n&&n.oauthTokenSecret,e=n&&n.nonce,u=n&&n.oauthIdToken,r=n&&n.pendingToken;try{switch(t){case"google.com":return att(u,i);case"facebook.com":return ctt(i);case"github.com":return ltt(i);case"twitter.com":return vtt(i,f);default:return i||f||u||r?r?0==t.indexOf("saml.")?new nu(t,r):new di(t,{pendingToken:r,idToken:n.oauthIdToken,accessToken:n.oauthAccessToken},t):new at(t).credential({idToken:u,accessToken:i,rawNonce:e}):null}}catch(n){return null}}function oy(n){if(!n.isOAuthProvider)throw new i("invalid-oauth-provider");}function ri(n,t,r,u,f,e,o){if(this.c=n,this.b=t||null,this.g=r||null,this.f=u||null,this.i=e||null,this.h=o||null,this.a=f||null,!this.g&&!this.a)throw new i("invalid-auth-event");if(this.g&&this.a)throw new i("invalid-auth-event");if(this.g&&!this.f)throw new i("invalid-auth-event");}function wtt(n){return(n=n||{}).type?new ri(n.type,n.eventId,n.urlResponse,n.sessionId,n.error&&ek(n.error),n.postBody,n.tenantId):null}function eht(){this.b=null;this.a=[]}function hy(n){var u="unauthorized-domain",r=void 0,t=ki(n);n=t.b;"chrome-extension"==(t=t.f)?r=kk("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.",n):"http"==t||"https"==t?r=kk("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.",n):u="operation-not-supported-in-this-environment";i.call(this,u,r)}function ke(n,t,r){i.call(this,n,r);(n=t||{}).Gb&&u(this,"email",n.Gb);n.da&&u(this,"phoneNumber",n.da);n.credential&&u(this,"credential",n.credential);n.Wb&&u(this,"tenantId",n.Wb)}function ch(n){var t,r;if(n.code){if(t=n.code||"",0==t.indexOf(re)&&(t=t.substring(re.length)),r={credential:ey(n),Wb:n.tenantId},n.email)r.Gb=n.email;else if(n.phoneNumber)r.da=n.phoneNumber;else if(!r.credential)return new i(t,n.message||void 0);return new ke(t,r,n.message)}return null}function de(){}function btt(n){return n.c||(n.c=n.b())}function lh(){}function ktt(n){var i,t,r;if(n.f||"undefined"!=typeof XMLHttpRequest||"undefined"==typeof ActiveXObject)return n.f;for(i=["MSXML2.XMLHTTP.6.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"],t=0;t<i.length;t++){r=i[t];try{return new ActiveXObject(r),n.f=r}catch(n){}}throw Error("Could not create ActiveXObject. ActiveX might be disabled, or MSXML might not be installed");}function ah(){}function dtt(){this.a=new XDomainRequest;this.readyState=0;this.onreadystatechange=null;this.responseType=this.responseText=this.response="";this.status=-1;this.statusText="";this.a.onload=o(this.oc,this);this.a.onerror=o(this.Pb,this);this.a.onprogress=o(this.pc,this);this.a.ontimeout=o(this.tc,this)}function cy(n,t){n.readyState=t;n.onreadystatechange&&n.onreadystatechange()}function ly(n,t,i){this.reset(n,t,i,void 0,void 0)}function ay(n){this.f=n;this.b=this.c=this.a=null}function ge(n,t){this.name=n;this.value=t}function yy(n){var i,t,r;return(yh||(yh=new ay(""),(vh[""]=yh).c=oht),i=vh[n])||(i=new ay(n),t=n.lastIndexOf("."),r=n.substr(t+1),(t=yy(n.substr(0,t))).b||(t.b={}),(t.b[r]=i).a=t,vh[n]=i),i}function kt(n,t){n&&n.log(sht,t,void 0)}function ph(n){this.f=n}function py(n){ot.call(this);this.s=n;this.readyState=wh;this.status=0;this.responseType=this.responseText=this.response=this.statusText="";this.onreadystatechange=null;this.i=new Headers;this.b=null;this.m="GET";this.g="";this.a=!1;this.h=yy("goog.net.FetchXmlHttp");this.l=this.c=this.f=null}function tit(n){n.c.read().then(n.nc.bind(n)).catch(n.Sa.bind(n))}function no(n,t){t&&n.f&&(n.status=n.f.status,n.statusText=n.f.statusText);n.readyState=4;n.f=null;n.c=null;n.l=null;to(n)}function to(n){n.onreadystatechange&&n.onreadystatechange.call(n)}function io(n){ot.call(this);this.headers=new nf;this.D=n||null;this.c=!1;this.B=this.a=null;this.h=this.P=this.l="";this.f=this.O=this.i=this.N=!1;this.g=0;this.s=null;this.m=wy;this.w=this.R=!1}function hht(n,t,i,u,f){if(n.a)throw Error("[goog.net.XhrIo] Object is active with another request="+n.l+"; newUri="+t);i=i?i.toUpperCase():"GET";n.l=t;n.h="";n.P=i;n.N=!1;n.c=!0;n.a=n.D?n.D.a():sy.a();n.B=n.D?btt(n.D):btt(sy);n.a.onreadystatechange=o(n.Sb,n);try{kt(n.b,nr(n,"Opening Xhr"));n.O=!0;n.a.open(i,String(t),!0);n.O=!1}catch(t){return kt(n.b,nr(n,"Error opening Xhr: "+t.message)),void uit(n,t)}t=u||"";var s,e=new nf(n.headers);f&&function(n,t){if(n.forEach&&"function"==typeof n.forEach)n.forEach(t,void 0);else if(te(n)||"string"==typeof n)w(n,t,void 0);else for(var r=sg(n),u=og(n),f=u.length,i=0;i<f;i++)t.call(void 0,u[i],r&&r[i],n)}(f,function(n,t){e.set(t,n)});f=function(n){n:{for(var t=cht,u=n.length,r="string"==typeof n?n.split(""):n,i=0;i<u;i++)if(i in r&&t.call(void 0,r[i],i,n)){t=i;break n}t=-1}return t<0?null:"string"==typeof n?n.charAt(t):n[t]}(e.X());u=r.FormData&&t instanceof r.FormData;!pi(rit,i)||f||u||e.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");e.forEach(function(n,t){this.a.setRequestHeader(t,n)},n);n.m&&(n.a.responseType=n.m);"withCredentials"in n.a&&n.a.withCredentials!==n.R&&(n.a.withCredentials=n.R);try{oit(n);0<n.g&&(n.w=(s=n.a,ni&&id(9)&&"number"==typeof s.timeout&&void 0!==s.ontimeout),kt(n.b,nr(n,"Will abort after "+n.g+"ms if incomplete, xhr2 "+n.w)),n.w?(n.a.timeout=n.g,n.a.ontimeout=o(n.Ka,n)):n.s=ya(n.Ka,n.g,n));kt(n.b,nr(n,"Sending request"));n.i=!0;n.a.send(t);n.i=!1}catch(t){kt(n.b,nr(n,"Send error: "+t.message));uit(n,t)}}function cht(n){return"content-type"==n.toLowerCase()}function uit(n,t){n.c=!1;n.a&&(n.f=!0,n.a.abort(),n.f=!1);n.h=t;fit(n);bh(n)}function fit(n){n.N||(n.N=!0,n.dispatchEvent("complete"),n.dispatchEvent("error"))}function eit(n){var i,u,f,e,t,o,s;if(n.c&&void 0!==tl)if(n.B[1]&&4==ro(n)&&2==kh(n))kt(n.b,nr(n,"Local request error detected and ignored"));else if(n.i&&4==ro(n))ya(n.Sb,0,n);else if(n.dispatchEvent("readystatechange"),4==ro(n)){kt(n.b,nr(n,"Request complete"));n.c=!1;try{u=kh(n);n:switch(u){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:f=!0;break n;default:f=!1}if((i=f)||((e=0===u)&&(t=String(n.l).match(wa)[1]||null,!t&&r.self&&r.self.location&&(o=r.self.location.protocol,t=o.substr(0,o.length-1)),e=!iit.test(t?t.toLowerCase():"")),i=e),i)n.dispatchEvent("complete"),n.dispatchEvent("success");else{try{s=2<ro(n)?n.a.statusText:""}catch(i){kt(n.b,"Can not get status: "+i.message);s=""}n.h=s+" ["+kh(n)+"]";fit(n)}}finally{bh(n)}}}function bh(n,t){if(n.a){oit(n);var i=n.a,r=n.B[0]?ei:null;n.a=null;n.B=null;t||n.dispatchEvent("ready");try{i.onreadystatechange=r}catch(t){(n=n.b)&&n.log(gtt,"Problem encountered resetting onreadystatechange: "+t.message,void 0)}}}function oit(n){n.a&&n.w&&(n.a.ontimeout=null);n.s&&(r.clearTimeout(n.s),n.s=null)}function ro(n){return n.a?n.a.readyState:0}function kh(n){try{return 2<ro(n)?n.a.status:-1}catch(n){return-1}}function nr(n,t){return t+" ["+n.P+" "+n.l+" "+kh(n)+"]"}function fu(n){var t=lht;this.g=[];this.w=t;this.s=n||null;this.f=this.a=!1;this.c=void 0;this.u=this.B=this.i=!1;this.h=0;this.b=null;this.l=0}function uo(n,t,i){n.a=!0;n.c=i;n.f=!t;hit(n)}function dh(n){if(n.a){if(!n.u)throw new gh;n.u=!1}}function by(n,t,i,r){n.g.push([t,i,r]);n.a&&hit(n)}function sit(n){return iot(n.g,function(n){return et(n[1])})}function hit(n){var t,f,u,i;for(n.h&&n.a&&sit(n)&&(t=n.h,f=eo[t],f&&(r.clearTimeout(f.a),delete eo[t]),n.h=0),n.b&&(n.b.l--,delete n.b),t=n.c,u=f=!1;n.g.length&&!n.i;){var e=n.g.shift(),s=e[0],h=e[1];if(e=e[2],s=n.f?h:s)try{i=s.call(e||n.s,t);void 0!==i&&(n.f=n.f&&(i==t||i instanceof Error),n.c=t=i);(ok(t)||"function"==typeof r.Promise&&t instanceof r.Promise)&&(u=!0,n.i=!0)}catch(u){t=u;n.f=!0;sit(n)||(f=!0)}}n.c=t;u&&(i=o(n.m,n,!0),u=o(n.m,n,!1),t instanceof fu?(by(t,i,u),t.B=!0):t.then(i,u));f&&(t=new cit(t),eo[t.a]=t,n.h=t.a)}function gh(){lt.call(this)}function fo(){lt.call(this)}function cit(n){this.a=r.setTimeout(o(this.c,this),0);this.b=n}function ky(n){var f,o,i,h,s,l=document,c=pl(n).toString(),t=os(document,"SCRIPT"),e={Tb:t,Ka:void 0},u=new fu(e);return f=window.setTimeout(function(){nc(t,!0);var n=new dy(ait,"Timeout reached for loading script "+c);dh(u);uo(u,!1,n)},5e3),e.Ka=f,t.onload=t.onreadystatechange=function(){t.readyState&&"loaded"!=t.readyState&&"complete"!=t.readyState||(nc(t,!1,f),dh(u),uo(u,!0,null))},t.onerror=function(){nc(t,!0,f);var n=new dy(lit,"Error while loading script "+c);dh(u);uo(u,!1,n)},ht(e={},{type:"text/javascript",charset:"UTF-8"}),ud(t,e),i=n,vl(o=t,"HTMLScriptElement"),o.src=pl(i),null===il&&(il=(i=(i=r.document).querySelector&&i.querySelector("script[nonce]"))&&(i=i.nonce||i.getAttribute("nonce"))&&ket.test(i)?i:""),(i=il)&&o.setAttribute("nonce",i),((s=((h=l)||document).getElementsByTagName("HEAD"))&&0!=s.length?s[0]:h.documentElement).appendChild(t),u}function lht(){if(this&&this.Tb){var n=this.Tb;n&&"SCRIPT"==n.tagName&&nc(n,!0,this.Ka)}}function nc(n,t,i){null!=i&&r.clearTimeout(i);n.onload=ei;n.onerror=ei;n.onreadystatechange=ei;t&&window.setTimeout(function(){n&&n.parentNode&&n.parentNode.removeChild(n)},0)}function dy(n,t){var i="Jsloader error (code #"+n+")";t&&(i+=": "+t);lt.call(this,i);this.code=n}function tc(n){this.f=n}function ui(t,u,f){if(this.c=t,t=u||{},this.u=t.secureTokenEndpoint||"https://securetoken.googleapis.com/v1/token",this.m=t.secureTokenTimeout||aht,this.g=tr(t.secureTokenHeaders||vht),this.h=t.firebaseEndpoint||"https://www.googleapis.com/identitytoolkit/v3/relyingparty/",this.l=t.identityPlatformEndpoint||"https://identitytoolkit.googleapis.com/v2/",this.i=t.firebaseTimeout||yht,this.a=tr(t.firebaseHeaders||pht),f&&(this.a["X-Client-Version"]=f,this.g["X-Client-Version"]=f),f="Node"==hi(),!(f=r.XMLHttpRequest||f&&n.INTERNAL.node&&n.INTERNAL.node.XMLHttpRequest)&&!ii())throw new i("internal-error","The XMLHttpRequest compatibility library was not found.");this.f=void 0;this.f=ii()?new ph(self):tn()?new tc(f):new ah;this.b=null}function vit(n,t){t?n.a["X-Firebase-Locale"]=t:delete n.a["X-Firebase-Locale"]}function yit(n,t){t?(n.a["X-Client-Version"]=t,n.g["X-Client-Version"]=t):(delete n.a["X-Client-Version"],delete n.g["X-Client-Version"])}function pit(n,t,i,u,f,e,s){var h;(n=!((h=rf(h=ft())==uv&&(h=h.match(/\sChrome\/(\d+)/i))&&2==h.length?parseInt(h[1],10):null)&&h<30||ni&&wi&&!(9<wi))||ii()?o(n.w,n):(gy=gy||new c(function(n,t){!function(n,t){((window.gapi||{}).client||{}).request?n():(r[np]=function(){((window.gapi||{}).client||{}).request?n():t(Error("CORS_UNSUPPORTED"))},function(n,t){by(n,null,t,void 0)}(ky(wl(wit,{onload:np})),function(){t(Error("CORS_UNSUPPORTED"))}))}(n,t)}),o(n.s,n)))(t,i,u,f,e,s)}function wht(n,t,r,u,f,e,o){var s=ki(t+r),l,h;if(d(s,"key",n.c),o&&d(s,"cb",vu().toString()),l="GET"==u,l)for(h in f)f.hasOwnProperty(h)&&d(s,h,f[h]);return new c(function(t,r){pit(n,s.toString(),function(n){n?n.error?r(sp(n,e||{})):t(n):r(new i("network-request-failed"))},u,l?void 0:yg(rn(f)),n.a,n.i.get())})}function eu(n){if("string"!=typeof(n=n.email)||!nn.test(n))throw new i("invalid-email");}function bit(n){"email"in n&&eu(n)}function ct(n){if(!n[fi]){if(n.mfaPendingCredential)throw new i("multi-factor-auth-required",null,tr(n));throw new i("internal-error");}}function tp(n){if(n.phoneNumber||n.temporaryProof){if(!n.phoneNumber||!n.temporaryProof)throw new i("internal-error");}else{if(!n.sessionInfo)throw new i("missing-verification-id");if(!n.code)throw new i("missing-verification-code");}}function dit(n){if(!n.phoneVerificationInfo)throw new i("internal-error");if(!n.phoneVerificationInfo.sessionInfo)throw new i("missing-verification-id");if(!n.phoneVerificationInfo.code)throw new i("missing-verification-code");}function ip(n){if(!n.requestUri||!n.sessionId&&!n.postBody&&!n.pendingToken)throw new i("internal-error");}function rp(n,t){return t.oauthIdToken&&t.providerId&&0==t.providerId.indexOf("oidc.")&&!t.pendingToken&&(n.sessionId?t.nonce=n.sessionId:n.postBody&&da(n=new br(n.postBody),"nonce")&&(t.nonce=n.get("nonce"))),t}function git(n){var t=null;if(n.needConfirmation?(n.code="account-exists-with-different-credential",t=ch(n)):"FEDERATED_USER_ID_ALREADY_LINKED"==n.errorMessage?(n.code="credential-already-in-use",t=ch(n)):"EMAIL_EXISTS"==n.errorMessage?(n.code="email-already-in-use",t=ch(n)):n.errorMessage&&(t=rrt(n.errorMessage)),t)throw t;ct(n)}function up(n,t){return t.returnIdpCredential=!0,l(n,kct,t)}function fp(n,t){return t.returnIdpCredential=!0,l(n,gct,t)}function ep(n,t){return t.returnIdpCredential=!0,t.autoCreate=!1,l(n,dct,t)}function op(n){if(!n.oobCode)throw new i("invalid-action-code");}function l(n,t,r){if(!function(n,t){var i,r;if(!t||!t.length)return 1;if(n){for(i=0;i<t.length;i++)if(r=n[t[i]],null==r||""===r)return;return 1}}(r,t.M))return y(new i("internal-error"));var u,f=!!t.La,o=t.Rb||"POST";return e(r).then(t.A).then(function(){return t.U&&(r.returnSecureToken=!0),t.C&&n.b&&void 0===r.tenantId&&(r.tenantId=n.b),wht(n,f?n.l:n.h,t.endpoint,o,r,t.Eb,t.hb||!1)}).then(function(n){return u=n,t.Wa?t.Wa(r,u):u}).then(t.G).then(function(){if(!t.Y)return u;if(!(t.Y in u))throw new i("internal-error");return u[t.Y]})}function rrt(n){return sp({error:{errors:[{message:n}],code:400,message:n}})}function sp(n,t){var r=(n.error&&n.error.errors&&n.error.errors[0]||{}).reason||"",u={keyInvalid:"invalid-api-key",ipRefererBlocked:"app-not-authorized"},f;if(r=u[r]?new i(u[r]):null)return r;for(f in r=n.error&&n.error.message||"",ht(u={INVALID_CUSTOM_TOKEN:"invalid-custom-token",CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVALID_IDENTIFIER:"invalid-email",MISSING_CONTINUE_URI:"internal-error",INVALID_EMAIL:"invalid-email",INVALID_PASSWORD:"wrong-password",USER_DISABLED:"user-disabled",MISSING_PASSWORD:"internal-error",EMAIL_EXISTS:"email-already-in-use",PASSWORD_LOGIN_DISABLED:"operation-not-allowed",INVALID_IDP_RESPONSE:"invalid-credential",INVALID_PENDING_TOKEN:"invalid-credential",FEDERATED_USER_ID_ALREADY_LINKED:"credential-already-in-use",MISSING_OR_INVALID_NONCE:"missing-or-invalid-nonce",INVALID_MESSAGE_PAYLOAD:"invalid-message-payload",INVALID_RECIPIENT_EMAIL:"invalid-recipient-email",INVALID_SENDER:"invalid-sender",EMAIL_NOT_FOUND:"user-not-found",RESET_PASSWORD_EXCEED_LIMIT:"too-many-requests",EXPIRED_OOB_CODE:"expired-action-code",INVALID_OOB_CODE:"invalid-action-code",MISSING_OOB_CODE:"internal-error",INVALID_PROVIDER_ID:"invalid-provider-id",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"requires-recent-login",INVALID_ID_TOKEN:"invalid-user-token",TOKEN_EXPIRED:"user-token-expired",USER_NOT_FOUND:"user-token-expired",CORS_UNSUPPORTED:"cors-unsupported",DYNAMIC_LINK_NOT_ACTIVATED:"dynamic-link-not-activated",INVALID_APP_ID:"invalid-app-id",TOO_MANY_ATTEMPTS_TRY_LATER:"too-many-requests",WEAK_PASSWORD:"weak-password",OPERATION_NOT_ALLOWED:"operation-not-allowed",USER_CANCELLED:"user-cancelled",CAPTCHA_CHECK_FAILED:"captcha-check-failed",INVALID_APP_CREDENTIAL:"invalid-app-credential",INVALID_CODE:"invalid-verification-code",INVALID_PHONE_NUMBER:"invalid-phone-number",INVALID_SESSION_INFO:"invalid-verification-id",INVALID_TEMPORARY_PROOF:"invalid-credential",MISSING_APP_CREDENTIAL:"missing-app-credential",MISSING_CODE:"missing-verification-code",MISSING_PHONE_NUMBER:"missing-phone-number",MISSING_SESSION_INFO:"missing-verification-id",QUOTA_EXCEEDED:"quota-exceeded",SESSION_EXPIRED:"code-expired",REJECTED_CREDENTIAL:"rejected-credential",INVALID_CONTINUE_URI:"invalid-continue-uri",MISSING_ANDROID_PACKAGE_NAME:"missing-android-pkg-name",MISSING_IOS_BUNDLE_ID:"missing-ios-bundle-id",UNAUTHORIZED_DOMAIN:"unauthorized-continue-uri",INVALID_DYNAMIC_LINK_DOMAIN:"invalid-dynamic-link-domain",INVALID_OAUTH_CLIENT_ID:"invalid-oauth-client-id",INVALID_CERT_HASH:"invalid-cert-hash",UNSUPPORTED_TENANT_OPERATION:"unsupported-tenant-operation",INVALID_TENANT_ID:"invalid-tenant-id",TENANT_ID_MISMATCH:"tenant-id-mismatch",ADMIN_ONLY_OPERATION:"admin-restricted-operation",INVALID_MFA_PENDING_CREDENTIAL:"invalid-multi-factor-session",MFA_ENROLLMENT_NOT_FOUND:"multi-factor-info-not-found",MISSING_MFA_PENDING_CREDENTIAL:"missing-multi-factor-session",MISSING_MFA_ENROLLMENT_ID:"missing-multi-factor-info",EMAIL_CHANGE_NEEDS_VERIFICATION:"email-change-needs-verification",SECOND_FACTOR_EXISTS:"second-factor-already-in-use",SECOND_FACTOR_LIMIT_EXCEEDED:"maximum-second-factor-count-exceeded",UNSUPPORTED_FIRST_FACTOR:"unsupported-first-factor",UNVERIFIED_EMAIL:"unverified-email"},t||{}),t=(t=r.match(/^[^\s]+\s*:\s*([\s\S]*)$/))&&1<t.length?t[1]:void 0,u)if(0===r.indexOf(f))return new i(u[f],t);return!t&&n&&(t=ae(n)),new i("internal-error",t)}function flt(n){var t;this.b=n;this.a=null;this.nb=(t=this,(hp=hp||new c(function(n,t){function u(){fn();p("gapi.load")("gapi.iframes",{callback:n,ontimeout:function(){fn();t(Error("Network Error"))},timeout:olt.get()})}if(p("gapi.iframes.Iframe"))n();else if(p("gapi.load"))u();else{var i="__iframefcb"+Math.floor(1e6*Math.random()).toString();r[i]=function(){p("gapi.load")?u():t(Error("Network Error"))};e(ky(i=wl(elt,{onload:i}))).o(function(){t(Error("Network Error"))})}}).o(function(n){throw hp=null,n;})).then(function(){return new c(function(n,i){p("gapi.iframes.getContext")().open({where:document.body,url:t.b,messageHandlersFilter:p("gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER"),attributes:{style:{position:"absolute",top:"-100px",width:"1px",height:"1px"}},dontclear:!0},function(r){function u(){clearTimeout(f);n()}t.a=r;t.a.restyle({setHideOnLeave:!1});var f=setTimeout(function(){i(Error("Network Error"))},slt.get());r.ping(u).then(u,function(){i(Error("Network Error"))})})})}))}function urt(n,t,i){this.i=n;this.g=t;this.h=i;this.f=null;this.a=hg(this.i,"/__/auth/iframe");d(this.a,"apiKey",this.g);d(this.a,"appName",this.h);this.b=null;this.c=[]}function cp(n,t,i,r,u){this.s=n;this.m=t;this.c=i;this.u=r;this.i=this.g=this.l=null;this.a=u;this.h=this.f=null}function lp(t){try{return n.app(t).auth().Ea()}catch(t){return[]}}function frt(n,t,i,r,u){this.u=n;this.f=t;this.b=i;this.c=r||null;this.h=u||null;this.m=this.s=this.w=null;this.g=[];this.l=this.a=null}function ert(n){var t=ce();return l(n,lct,{}).then(function(n){return n.authorizedDomains||[]}).then(function(n){var r,o,u;n:{for(r=ki(t),o=r.f,r=r.b,u=0;u<n.length;u++){var i=n[u],f=r,e=o;if(f=0==i.indexOf("chrome-extension://")?ki(i).b==f&&"chrome-extension"==e:("http"==e||"https"==e)&&(gg.test(i)?f==i:(i=i.split(".").join("\\."),new RegExp("^(.+\\."+i+"|"+i+")$","i").test(f)))){n=!0;break n}}n=!1}if(!n)throw new hy(ce());})}function ort(n){return n.l||(n.l=tv().then(function(){if(!n.s){var i=n.c,r=n.h,u=lp(n.b),t=new urt(n.u,n.f,n.b);t.f=i;t.b=r;t.c=cr(u||[]);n.s=t.toString()}n.i=new flt(n.s),function(n){if(!n.i)throw Error("IfcHandler must be initialized!");!function(n,t){n.nb.then(function(){n.a.register("authEvent",t,p("gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER"))})}(n.i,function(t){var i={},r;if(t&&t.authEvent){for(r=!1,t=wtt(t.authEvent),i=0;i<n.g.length;i++)r=n.g[i](t)||r;return(i={}).status=r?"ACK":"ERROR",e(i)}return i.status="ERROR",e(i)})}(n)})),n.l}function srt(n){return n.m||(n.w=n.c?uf(n.c,lp(n.b)):null,n.m=new ui(n.f,ue(n.h),n.w)),n.m}function oo(n,t,i,r,u,f,e,o,s,h,c){return(n=new cp(n,t,i,r,u)).l=f,n.g=e,n.i=o,n.b=tr(s||null),n.f=h,n.ub(c).toString()}function hrt(t){if(this.a=t||n.INTERNAL.reactNative&&n.INTERNAL.reactNative.AsyncStorage,!this.a)throw new i("internal-error","The React Native compatibility library was not found.");this.type="asyncStorage"}function crt(n){this.b=n;this.a={};this.f=o(this.c,this)}function lrt(n,t,i){lr(n.a)&&n.b.addEventListener("message",n.f);void 0===n.a[t]&&(n.a[t]=[]);n.a[t].push(i)}function art(n){this.a=n}function vrt(n){this.c=n;this.b=!1;this.a=[]}function yrt(n,t,i,r){var e,h,o,s,a=i||{},f=null,l,u;return n.b?y(Error("connection_unavailable")):(l=r?800:50,u="undefined"!=typeof MessageChannel?new MessageChannel:null,new c(function(i,r){u?(e=Math.floor(Math.random()*Math.pow(10,20)).toString(),u.port1.start(),o=setTimeout(function(){r(Error("unsupported_event"))},l),f={messageChannel:u,onMessage:h=function(n){n.data.eventId===e&&("ack"===n.data.status?(clearTimeout(o),s=setTimeout(function(){r(Error("timeout"))},3e3)):"done"===n.data.status?(clearTimeout(s),void 0!==n.data.response?i(n.data.response):r(Error("unknown_error"))):(clearTimeout(o),clearTimeout(s),r(Error("invalid_response"))))}},n.a.push(f),u.port1.addEventListener("message",h),n.c.postMessage({eventType:t,eventId:e,data:a},[u.port2])):r(Error("connection_unavailable"))}).then(function(t){return yp(n,f),t}).o(function(t){throw yp(n,f),t;}))}function yp(n,t){if(t){var i=t.messageChannel,r=t.onMessage;i&&(i.port1.removeEventListener("message",r),i.port1.close());dt(n.a,function(n){return n==t})}}function prt(){if(!pp())throw new i("web-storage-unsupported");this.c={};this.a=[];this.b=0;this.u=r.indexedDB;this.type="indexedDB";this.g=this.l=this.f=this.i=null;this.s=!1;this.h=null;var t,n=this;ii()&&self?(this.l=function(){var t=ii()?self:null,n;return(w(vp,function(i){i.b==t&&(n=i)}),n)||(n=new crt(t),vp.push(n)),n}(),lrt(this.l,"keyChanged",function(t,i){return krt(n).then(function(t){return 0<t.length&&w(n.a,function(n){n(t)}),{keyProcessed:pi(t,i.key)}})}),lrt(this.l,"ping",function(){return e(["keyChanged"])})):((t=r.navigator)&&t.serviceWorker?e().then(function(){return t.serviceWorker.ready}).then(function(n){return n.active||null}).o(function(){return null}):e(null)).then(function(t){(n.h=t)&&(n.g=new vrt(new art(t)),yrt(n.g,"ping",null,!0).then(function(t){t[0].fulfilled&&pi(t[0].value,"keyChanged")&&(n.s=!0)}).o(function(){}))})}function wrt(n){return new c(function(t,i){var r=n.u.open("firebaseLocalStorageDb",1);r.onerror=function(n){try{n.preventDefault()}catch(n){}i(Error(n.target.error))};r.onupgradeneeded=function(n){n=n.target.result;try{n.createObjectStore("firebaseLocalStorage",{keyPath:"fbase_key"})}catch(n){i(n)}};r.onsuccess=function(r){var u;(r=r.target.result).objectStoreNames.contains("firebaseLocalStorage")?t(r):(u=n,new c(function(n,t){var i=u.u.deleteDatabase("firebaseLocalStorageDb");i.onsuccess=function(){n()};i.onerror=function(n){t(Error(n.target.error))}}).then(function(){return wrt(n)}).then(function(n){t(n)}).o(function(n){i(n)}))}})}function ic(n){return n.m||(n.m=wrt(n)),n.m}function pp(){try{return r.indexedDB}catch(n){return}}function so(n){return n.objectStore("firebaseLocalStorage")}function ho(n,t){return n.transaction(["firebaseLocalStorage"],t?"readwrite":"readonly")}function af(n){return new c(function(t,i){n.onsuccess=function(n){n&&n.target?t(n.target.result):t()};n.onerror=function(n){i(n.target.error)}})}function brt(n,t){return n.g&&n.h&&((i=r.navigator)&&i.serviceWorker&&i.serviceWorker.controller||null)===n.h?yrt(n.g,"keyChanged",{key:t},n.s).then(function(){}).o(function(){}):e();var i}function krt(n){return ic(n).then(function(n){var t=so(ho(n,!1));return t.getAll?af(t.getAll()):new c(function(n,i){var r=[],u=t.openCursor();u.onsuccess=function(t){(t=t.target.result)?(r.push(t.value),t.continue()):n(r)};u.onerror=function(n){i(n.target.error)}})}).then(function(t){var r={},i=[];if(0==n.b){for(i=0;i<t.length;i++)r[t[i].fbase_key]=t[i].value;i=function t(n,i){var r,u=[];for(r in n)r in i&&typeof n[r]==typeof i[r]?"object"==typeof n[r]&&null!=n[r]&&null!=i[r]?0<t(n[r],i[r]).length&&u.push(r):n[r]!==i[r]&&u.push(r):u.push(r);for(r in i)r in n||u.push(r);return u}(n.c,r);n.c=r}return i})}function drt(n){n.i&&n.i.cancel("STOP_EVENT");n.f&&(clearTimeout(n.f),n.f=null)}function grt(n){var t=this,i=null;this.a=[];this.type="indexedDB";this.c=n;this.b=e().then(function(){if(pp()){var n=gr(),r="__sak"+n;return ap=ap||new prt,(i=ap).set(r,n).then(function(){return i.get(r)}).then(function(t){if(t!==n)throw Error("indexedDB not supported!");return i.T(r)}).then(function(){return i}).o(function(){return t.c})}return t.c}).then(function(n){return t.type=n.type,n.ba(function(n){w(t.a,function(t){t(n)})}),n})}function co(){this.a={};this.type="inMemory"}function rc(){if(!function(){var t="Node"==hi();if(t=nut()||t&&n.INTERNAL.node&&n.INTERNAL.node.localStorage)try{return t.setItem("__sak","1"),t.removeItem("__sak"),1}catch(t){return}}()){if("Node"==hi())throw new i("internal-error","The LocalStorage compatibility library was not found.");throw new i("web-storage-unsupported");}this.a=nut()||n.INTERNAL.node.localStorage;this.type="localStorage"}function nut(){try{var n=r.localStorage,t=gr();return n&&(n.setItem(t,"1"),n.removeItem(t)),n}catch(n){return null}}function wp(){this.type="nullStorage"}function bp(){if(!function(){var t="Node"==hi();if(t=tut()||t&&n.INTERNAL.node&&n.INTERNAL.node.sessionStorage)try{return t.setItem("__sak","1"),t.removeItem("__sak"),1}catch(t){return}}()){if("Node"==hi())throw new i("internal-error","The SessionStorage compatibility library was not found.");throw new i("web-storage-unsupported");}this.a=tut()||n.INTERNAL.node.sessionStorage;this.type="sessionStorage"}function tut(){try{var n=r.sessionStorage,t=gr();return n&&(n.setItem(t,"1"),n.removeItem(t)),n}catch(n){return null}}function hlt(){var n={};n.Browser=clt;n.Node=llt;n.ReactNative=alt;n.Worker=vlt;this.a=n[hi()]}function uut(){var n=!(un(ft())||!rv()),t=le(),i=ev();this.m=n;this.h=t;this.l=i;this.a={};n=iut=iut||new hlt;try{this.g=!nv()&&en()||!r.indexedDB?new n.a.F:new grt(ii()?new co:new n.a.F)}catch(n){this.g=new co;this.h=!0}try{this.i=new n.a.$a}catch(n){this.i=new co}this.u=new co;this.f=o(this.Vb,this);this.b={}}function lo(){return rut=rut||new uut}function ou(n,t){switch(t){case"session":return n.i;case"none":return n.u;default:return n.g}}function yf(n,t){return"firebase:"+n.name+(t?":"+t:"")}function pf(n,t,i){return i=yf(t,i),"local"==t.F&&(n.b[i]=null),ou(n,t.F).T(i)}function kp(n){n.c&&(clearInterval(n.c),n.c=null)}function ylt(n){this.a=n;this.b=lo()}function plt(){this.a=lo()}function fc(n,t){this.b=fut;this.f=r.Uint8Array?new Uint8Array(this.b):Array(this.b);this.g=this.c=0;this.a=[];this.i=n;this.h=t;this.l=r.Int32Array?new Int32Array(64):Array(64);void 0===dp&&(dp=r.Int32Array?new Int32Array(rw):rw);this.reset()}function tw(n){for(var e,o,a,i=n.f,f=n.l,t=0,r=0;r<i.length;)f[t++]=i[r]<<24|i[r+1]<<16|i[r+2]<<8|i[r+3],r=4*t;for(i=16;i<64;i++)r=0|f[i-15],t=0|f[i-2],e=(0|f[i-16])+((r>>>7|r<<25)^(r>>>18|r<<14)^r>>>3)|0,o=(0|f[i-7])+((t>>>17|t<<15)^(t>>>19|t<<13)^t>>>10)|0,f[i]=e+o|0;t=0|n.a[0];r=0|n.a[1];var s=0|n.a[2],l=0|n.a[3],u=0|n.a[4],h=0|n.a[5],c=0|n.a[6];for(e=0|n.a[7],i=0;i<64;i++)a=((t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10))+(t&r^t&s^r&s)|0,o=(e=e+((u>>>6|u<<26)^(u>>>11|u<<21)^(u>>>25|u<<7))|0)+((o=(o=u&h^~u&c)+(0|dp[i])|0)+(0|f[i])|0)|0,e=c,c=h,h=u,u=l+o|0,l=s,s=r,r=t,t=o+a|0;n.a[0]=n.a[0]+t|0;n.a[1]=n.a[1]+r|0;n.a[2]=n.a[2]+s|0;n.a[3]=n.a[3]+l|0;n.a[4]=n.a[4]+u|0;n.a[5]=n.a[5]+h|0;n.a[6]=n.a[6]+c|0;n.a[7]=n.a[7]+e|0}function iw(n,t,i){var f,r,u;if(void 0===i&&(i=t.length),f=0,r=n.c,"string"==typeof t)for(;f<i;)n.f[r++]=t.charCodeAt(f++),r==n.b&&(tw(n),r=0);else{if(!te(t))throw Error("message must be string or array");for(;f<i;){if(u=t[f++],!("number"==typeof u&&0<=u&&u<=255&&u==(0|u)))throw Error("message must be a byte array");n.f[r++]=u;r==n.b&&(tw(n),r=0)}}n.c=r;n.g+=i}function out(){fc.call(this,8,sut)}function hut(n,t,i,r,u){this.u=n;this.i=t;this.l=i;this.m=r||null;this.s=u||null;this.h=t+":"+i;this.w=new plt;this.g=new ylt(this.h);this.f=null;this.b=[];this.a=this.c=null}function ec(n){return new i("invalid-cordova-configuration",n)}function blt(n){var t=new out,r,i,u;for(iw(t,n),n=[],r=8*t.g,t.c<56?iw(t,nw,56-t.c):iw(t,nw,t.b-(t.c-56)),i=63;56<=i;i--)t.f[i]=255&r,r/=256;for(tw(t),i=r=0;i<t.i;i++)for(u=24;0<=u;u-=8)n[r++]=t.a[i]>>u&255;return ko(n,function(n){return 1<(n=n.toString(16)).length?n:"0"+n}).join("")}function cut(n,t){for(var i=0;i<n.b.length;i++)try{n.b[i](t)}catch(n){}}function lut(n){return n.f||(n.f=n.ka().then(function(){return new c(function(t){function h(n){e=!0;o&&o.cancel();uw(u).then(function(t){var r=f,i;t&&n&&n.url&&(i=null,-1!=(r=stt(n.url)).indexOf("/__/auth/callback")&&(i=(i="object"==typeof(i=ef(wt(i=ki(r),"firebaseError")||null))?ek(i):null)?new ri(t.c,t.b,null,null,i,null,t.S()):new ri(t.c,t.b,r,t.f,null,null,t.S())),r=i||f);cut(u,r)})}var u,f,e,o,s;n.Ca(function e(i){return t(i),n.Qa(e),!1});u=n;f=new ri("unknown",null,null,null,new i("no-auth-event"));e=!1;o=gu(500).then(function(){return uw(u).then(function(){e||cut(u,f)})});s=r.handleOpenURL;r.handleOpenURL=function(n){if(0==n.toLowerCase().indexOf(p("BuildInfo.packageName",r).toLowerCase()+"://")&&h({url:n}),"function"==typeof s)try{s(n)}catch(n){console.error(n)}};hh=hh||new eht,function(n){var t=hh;t.a.push(n);t.b||(t.b=function(n){for(var i=0;i<t.a.length;i++)t.a[i](n)},"function"==typeof(n=p("universalLinks.subscribe",r))&&n(null,t.b))}(h)})})),n.f}function uw(n){var t,i=null;return(t=n.g).b.get(uc,t.a).then(function(n){return wtt(n)}).then(function(t){return i=t,pf((t=n.g).b,uc,t.a)}).then(function(){return i})}function klt(n){this.a=n;this.b=lo()}function fw(n){return pf(n.b,oc,n.a)}function sc(n,t,i){this.i={};this.w=0;this.D=n;this.u=t;this.m=i;this.h=[];this.f=!1;this.l=o(this.s,this);this.b=new cc;this.B=new rft;this.g=new klt(this.u+":"+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.B;this.c.linkViaPopup=this.B;this.c.reauthViaPopup=this.B;this.a=aut(this.D,this.u,this.m,ie)}function aut(t,i,r,u){var f=n.SDK_VERSION||null;return new(iv()?hut:frt)(t,i,r,f,u)}function vut(n){n.f||(n.f=!0,n.a.Ca(n.l));var t=n.a;return n.a.ka().o(function(i){throw n.a==t&&n.reset(),i;})}function yut(n){n.a.Ub()&&vut(n).o(function(t){var r=new ri("unknown",null,null,null,new i("operation-not-supported-in-this-environment"));ow(t)&&n.s(r)});n.a.Qb()||tft(n.b)}function ew(n,t){var r;pi(n.h,t)||n.h.push(t);n.f||(r=n.g).b.get(oc,r.a).then(function(n){return"pending"==n}).then(function(t){t?fw(n.g).then(function(){vut(n).o(function(t){var r=new ri("unknown",null,null,null,new i("operation-not-supported-in-this-environment"));ow(t)&&n.s(r)})}):yut(n)}).o(function(){yut(n)})}function put(n,t){dt(n.h,function(n){return n==t})}function kut(n,t,i,r,u,f,e){return n.a.Jb(t,i,r,function(){n.f||(n.f=!0,n.a.Ca(n.l))},function(){n.reset()},u,f,e)}function ow(n){return!(!n||"auth/cordova-not-ready"!=n.code)}function dut(n,t,r,u,f){var e,o;return(o=n.g).b.set(oc,"pending",o.a).then(function(){return n.a.Kb(t,r,u,f).o(function(t){if(ow(t))throw new i("operation-not-supported-in-this-environment");return e=t,fw(n.g).then(function(){throw e;})}).then(function(){return n.a.Xb()?new c(function(){}):fw(n.g).then(function(){return n.pa()}).then(function(){}).o(function(){})})})}function gut(n,t,i,r,u){return n.a.Lb(r,function(n){t.la(i,null,n,u)},wut.get())}function nft(n,t,i){var r=t+":"+i;return hc[r]||(hc[r]=new sc(n,t,i)),hc[r]}function cc(){this.b=null;this.f=[];this.c=[];this.a=null;this.i=this.g=!1}function tft(n){n.g||(n.g=!0,su(n,!1,null,null))}function lc(n){n.g&&!n.i&&su(n,!1,null,null)}function ift(n,t){if(n.b=function(){return e(t)},n.f.length)for(var i=0;i<n.f.length;i++)n.f[i](t)}function su(n,t,i,r){t?r?function(n,t){if(n.b=function(){return y(t)},n.c.length)for(var i=0;i<n.c.length;i++)n.c[i](t)}(n,r):ift(n,i):ift(n,{user:null});n.f=[];n.c=[]}function rft(){}function uft(){this.Bb=!1;Object.defineProperty(this,"appVerificationDisabled",{get:function(){return this.Bb},set:function(n){this.Bb=n},enumerable:!1})}function sw(n,t){this.a=t;u(this,"verificationId",n)}function hw(n,t,i,r){return new gi(n).cb(t,i).then(function(n){return new sw(n,r)})}function dlt(n){var t=ttt(n);if(!(t&&t.exp&&t.auth_time&&t.iat))throw new i("internal-error","An internal error occurred. The token obtained by Firebase appears to be malformed. Please retry the operation.");st(this,{token:n,expirationTime:ve(1e3*t.exp),authTime:ve(1e3*t.auth_time),issuedAtTime:ve(1e3*t.iat),signInProvider:t.firebase&&t.firebase.sign_in_provider?t.firebase.sign_in_provider:null,signInSecondFactor:t.firebase&&t.firebase.sign_in_second_factor?t.firebase.sign_in_second_factor:null,claims:t})}function cw(n,t,r){var f=t&&t[aw],e;if(!f)throw new i("argument-error","Internal assert: Invalid MultiFactorResolver");this.a=n;this.f=tr(t);this.g=r;this.c=new sh(null,f);this.b=[];e=this;w(t[lw]||[],function(n){(n=vv(n))&&e.b.push(n)});u(this,"auth",this.a);u(this,"session",this.c);u(this,"hints",this.b)}function vw(n,t,r,f){i.call(this,"multi-factor-auth-required",f,t);this.b=new cw(n,t,r);u(this,"resolver",this.b)}function fft(n,t,i){if(n&&tt(n.serverResponse)&&"auth/multi-factor-auth-required"===n.code)try{return new vw(t,n.serverResponse,i,n.message)}catch(n){}return null}function eft(){}function yw(n){u(this,"factorId",n.ea);this.a=n}function oft(n){if(yw.call(this,n),this.a.ea!=gi.PROVIDER_ID)throw new i("argument-error","firebase.auth.PhoneMultiFactorAssertion requires a valid firebase.auth.PhoneAuthCredential");}function wf(n,t){for(var i in yt.call(this,n),t)this[i]=t[i]}function pw(n,t){this.a=n;this.b=[];this.c=o(this.wc,this);ti(this.a,"userReloaded",this.c);var i=[];t&&t.multiFactor&&t.multiFactor.enrolledFactors&&w(t.multiFactor.enrolledFactors,function(n){var r=null,t={};if(n){n.uid&&(t[pv]=n.uid);n.displayName&&(t[on]=n.displayName);n.enrollmentTime&&(t[yv]=new Date(n.enrollmentTime).toISOString());n.phoneNumber&&(t[wv]=n.phoneNumber);try{r=new ye(t)}catch(n){}n=r}else n=null;n&&i.push(n)});ac(this,i)}function ac(n,t){n.b=t;u(n,"enrolledFactors",t)}function ww(n,t,i){if(this.h=n,this.i=t,this.g=i,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 glt(n,t){return t?(n.a=n.c,n.g()):(t=n.a,n.a*=2,n.a>n.f&&(n.a=n.f),t)}function bw(n){this.c=n;this.b=this.a=null}function kw(n){return n.b&&1e3*n.b.c||0}function sft(n,t){var i=t.refreshToken;n.b=fh(t[fi]||"");n.a=i}function nat(n,t){return r=n.c,u=t,new c(function(n,t){"refresh_token"==u.grant_type&&u.refresh_token||"authorization_code"==u.grant_type&&u.code?pit(r,r.u+"?key="+encodeURIComponent(r.c),function(r){r?r.error?t(sp(r)):r.access_token&&r.refresh_token?n(r):t(new i("internal-error")):t(new i("network-request-failed"))},"POST",lg(u).toString(),r.g,r.m.get()):t(new i("internal-error"))}).then(function(t){return n.b=fh(t.access_token),n.a=t.refresh_token,{accessToken:n.b.toString(),refreshToken:n.a}}).o(function(t){throw"auth/user-token-expired"==t.code&&(n.a=null),t;});var r,u}function vc(n,t){this.a=n||null;this.b=t||null;st(this,{lastSignInTime:ve(t||null),creationTime:ve(n||null)})}function tat(n,t,i,r,u,f){st(this,{uid:n,displayName:r||null,photoURL:u||null,email:i||null,phoneNumber:f||null,providerId:t})}function vt(t,i,r){var f,e;this.N=[];this.l=t.apiKey;this.m=t.appName;this.s=t.authDomain||null;t=n.SDK_VERSION?uf(n.SDK_VERSION):null;this.a=new ui(this.l,ue(ie),t);this.b=new bw(this.a);ib(this,i[fi]);sft(this.b,i);u(this,"refreshToken",this.b.a);cft(this,r||{});ot.call(this);this.P=!1;this.s&&dr()&&(this.i=nft(this.s,this.l,this.m));this.R=[];this.h=null;this.B=(f=this,new ww(function(){return f.I(!0)},function(n){return!(!n||"auth/network-request-failed"!=n.code)},function(){var n=kw(f.b)-vu()-3e5;return 0<n?n:0}));this.Z=o(this.Ma,this);e=this;this.oa=null;this.za=function(n){e.va(n.g)};this.aa=null;this.W=[];this.ya=function(n){ao(e,n.c)};this.$=null;this.O=new pw(this,r);u(this,"multiFactor",this.O)}function dw(n,t){n.aa&&pt(n.aa,"languageCodeChanged",n.za);(n.aa=t)&&ti(t,"languageCodeChanged",n.za)}function ao(t,i){t.W=i;yit(t.a,n.SDK_VERSION?uf(n.SDK_VERSION,t.W):null)}function gw(n,t){n.$&&pt(n.$,"frameworkChanged",n.ya);(n.$=t)&&ti(t,"frameworkChanged",n.ya)}function nb(t){try{return n.app(t.m).auth()}catch(r){throw new i("internal-error","No firebase.auth.Auth instance is available for the Firebase App '"+t.m+"'!");}}function hft(n){n.D||n.B.b||(n.B.start(),pt(n,"tokenChanged",n.Z),ti(n,"tokenChanged",n.Z))}function tb(n){pt(n,"tokenChanged",n.Z);n.B.stop()}function ib(n,t){n.xa=t;u(n,"_lat",t)}function hu(n){for(var i=[],t=0;t<n.R.length;t++)i.push(n.R[t](n));return cd(i).then(function(){return n})}function vo(n){n.i&&!n.P&&(n.P=!0,ew(n.i,n))}function cft(n,t){st(n,{uid:t.uid,displayName:t.displayName||null,photoURL:t.photoURL||null,email:t.email||null,emailVerified:t.emailVerified||!1,phoneNumber:t.phoneNumber||null,isAnonymous:t.isAnonymous||!1,tenantId:t.tenantId||null,metadata:new vc(t.createdAt,t.lastLoginAt),providerData:[]});n.a.b=n.tenantId}function lft(){}function rb(n){return e().then(function(){if(n.D)throw new i("app-deleted");})}function ub(n){return ko(n.providerData,function(n){return n.providerId})}function fb(n,t){t&&(aft(n,t.providerId),n.providerData.push(t))}function aft(n,t){dt(n.providerData,function(n){return n.providerId==t})}function sr(n,t,i){("uid"!=t||i)&&n.hasOwnProperty(t)&&u(n,t,i)}function yc(n,t){var i,r,f;n!=t&&(st(n,{uid:t.uid,displayName:t.displayName,photoURL:t.photoURL,email:t.email,emailVerified:t.emailVerified,phoneNumber:t.phoneNumber,isAnonymous:t.isAnonymous,tenantId:t.tenantId,providerData:[]}),t.metadata?u(n,"metadata",new vc((f=t.metadata).a,f.b)):u(n,"metadata",new vc),w(t.providerData,function(t){fb(n,t)}),i=n.b,r=t.b,i.b=r.b,i.a=r.a,u(n,"refreshToken",n.b.a),ac(n.O,t.O.b))}function eb(n){return n.I().then(function(t){var i,r,u=n.isAnonymous;return r=t,l((i=n).a,ect,{idToken:r}).then(o(i.Ic,i)).then(function(){return u||sr(n,"isAnonymous",!1),t})})}function li(n,t){t[fi]&&n.xa!=t[fi]&&(sft(n.b,t),n.dispatchEvent(new wf("tokenChanged")),ib(n,t[fi]),sr(n,"refreshToken",n.b.a))}function pc(n,t){return eb(n).then(function(){if(pi(ub(n),t))return hu(n).then(function(){throw new i("provider-already-linked");})})}function yo(n,t,i){return fr({user:n,credential:ey(t),additionalUserInfo:t=rtt(t),operationType:i})}function vft(n,t){return li(n,t),n.reload().then(function(){return n})}function yft(t,r,u,f,e){var o;if(!dr())return y(new i("operation-not-supported-in-this-environment"));if(t.h&&!e)return y(t.h);var s=ny(u.providerId),h=gr(t.uid+":::"),l=null;return(!le()||rv())&&t.s&&u.isOAuthProvider&&(l=oo(t.s,t.l,t.m,r,u,null,h,n.SDK_VERSION||null,null,null,t.tenantId)),o=dg(l,s&&s.ta,s&&s.sa),f=f().then(function(){if(wft(t),!e)return t.I().then(function(){})}).then(function(){return kut(t.i,o,r,u,h,!!l,t.tenantId)}).then(function(){return new c(function(n,u){t.la(r,null,new i("cancelled-popup-request"),t.g||null);t.f=n;t.w=u;t.g=h;t.c=gut(t.i,t,r,o,h)})}).then(function(n){return o&&kr(o),n?fr(n):null}).o(function(n){throw o&&kr(o),n;}),rt(t,f,e)}function pft(n,t,r,u,f){if(!dr())return y(new i("operation-not-supported-in-this-environment"));if(n.h&&!f)return y(n.h);var e=null,o=gr(n.uid+":::");return u=u().then(function(){if(wft(n),!f)return n.I().then(function(){})}).then(function(){return n.fa=o,hu(n)}).then(function(t){return n.ga&&(t=(t=n.ga).b.set(wc,n.v(),t.a)),t}).then(function(){return dut(n.i,t,r,o,n.tenantId)}).o(function(t){if(e=t,n.ga)return kft(n.ga);throw e;}).then(function(){if(e)throw e;}),rt(n,u,f)}function wft(n){if(!n.i||!n.P){if(n.i&&!n.P)throw new i("internal-error");throw new i("auth-domain-config-required");}}function rt(n,t,i){var r,f,e,u=(f=t,e=i,(r=n).h&&!e?(f.cancel(),y(r.h)):f.o(function(n){throw!n||"auth/user-disabled"!=n.code&&"auth/user-token-expired"!=n.code||(r.h||r.dispatchEvent(new wf("userInvalidated")),r.h=n),n;}));return n.N.push(u),u.ma(function(){go(n.N,u)}),u.o(function(t){var i=null;throw t&&"auth/multi-factor-auth-required"===t.code&&(i=fft(t.v(),nb(n),o(n.hc,n))),i||t;})}function bft(n){var r,t,i;return n.apiKey?(r={apiKey:n.apiKey,authDomain:n.authDomain,appName:n.appName},t={},!n.stsTokenManager||!n.stsTokenManager.accessToken)?null:(t[fi]=n.stsTokenManager.accessToken,t.refreshToken=n.stsTokenManager.refreshToken||null,i=new vt(r,t,n),n.providerData&&w(n.providerData,function(n){n&&fb(i,fr(n))}),n.redirectEventId&&(i.fa=n.redirectEventId),i):null}function iat(n){this.a=n;this.b=lo()}function kft(n){return pf(n.b,wc,n.a)}function ob(n){var t,i,u,f;this.a=n;this.b=lo();this.c=null;this.f=(i=ai("local"),u=ai("session"),f=ai("none"),function(n,t,i){var u=yf(t,i),f=ou(n,t.F);return n.get(t,i).then(function(e){var o=null;try{o=ef(r.localStorage.getItem(u))}catch(e){}if(o&&!e)return r.localStorage.removeItem(u),n.set(t,o,i);o&&e&&"localStorage"!=f.type&&r.localStorage.removeItem(u)})}((t=this).b,i,t.a).then(function(){return t.b.get(u,t.a)}).then(function(n){return n?u:t.b.get(f,t.a).then(function(n){return n?f:t.b.get(i,t.a).then(function(n){return n?i:t.b.get(bc,t.a).then(function(n){return n?ai(n):i})})})}).then(function(n){return t.c=n,sb(t,n.F)}).o(function(){t.c||(t.c=i)}));this.b.addListener(ai("local"),this.a,o(this.g,this))}function sb(n,t){var r,i,u=[];for(r in vf)vf[r]!==t&&u.push(pf(n.b,ai(vf[r]),n.a));return u.push(pf(n.b,bc,n.a)),i=u,new c(function(n,t){var u=i.length,f=[];if(u)for(var e=function(t,i){u--;f[t]=i;0==u&&n(f)},o=function(n){t(n)},r=0;r<i.length;r++)hd(i[r],au(e,r),o);else n(f)})}function ai(n){return{name:"authUser",F:n}}function dft(n,t){return bf(n,function(){return n.b.set(n.c,t.v(),n.a)})}function gft(n){return bf(n,function(){return pf(n.b,n.c,n.a)})}function net(n,t){return bf(n,function(){return n.b.get(n.c,n.a).then(function(n){return n&&t&&(n.authDomain=t),bft(n||{})})})}function bf(n,t){return n.f=n.f.then(t,t),n.f}function vi(t){if(this.l=!1,u(this,"settings",new uft),u(this,"app",t),!a(this).options||!a(this).options.apiKey)throw new i("invalid-api-key");var f,l,v,e,r,c,y,h;t=n.SDK_VERSION?uf(n.SDK_VERSION):null;this.b=new ui(a(this).options&&a(this).options.apiKey,ue(ie),t);this.P=[];this.m=[];this.O=[];this.$b=n.INTERNAL.createSubscribe(o(this.xc,this));this.W=void 0;this.ac=n.INTERNAL.createSubscribe(o(this.yc,this));kf(this,null);this.i=new ob(a(this).options.apiKey+":"+a(this).name);this.B=new iat(a(this).options.apiKey+":"+a(this).name);this.Z=k(this,(l=a(f=this).options.authDomain,v=function(n){var t=function(n,t){return n.b.get(wc,n.a).then(function(n){return n&&t&&(n.authDomain=t),bft(n||{})})}(n.B,a(n).options.authDomain).then(function(t){return(n.D=t)&&(t.ga=n.B),kft(n.B)});return k(n,t)}(f).then(function(){return net(f.i,l)}).then(function(n){return n?(n.ga=f.B,f.D&&(f.D.fa||null)==(n.fa||null)?n:n.reload().then(function(){return dft(f.i,n).then(function(){return n})}).o(function(t){return"auth/network-request-failed"==t.code?n:gft(f.i)})):null}).then(function(n){kf(f,n||null)}),k(f,v)));this.h=k(this,(e=this).Z.then(function(){return ret(e)}).o(function(){}).then(function(){if(!e.l)return e.oa()}).o(function(){}).then(function(){if(!e.l){e.aa=!0;var n=e.i;n.b.addListener(ai("local"),n.a,e.oa)}}));this.aa=!1;this.oa=o(this.Xc,this);this.Ma=o(this.ca,this);this.xa=o(this.jc,this);this.ya=o(this.uc,this);this.za=o(this.vc,this);this.a=null;c=a(r=this).options.authDomain;y=a(r).options.apiKey;c&&dr()&&(r.Zb=r.Z.then(function(){if(!r.l){if(r.a=nft(c,y,a(r).name),ew(r.a,r),s(r)&&vo(s(r)),r.D){vo(r.D);var n=r.D;n.va(r.ja());dw(n,r);ao(n=r.D,r.N);gw(n,r);r.D=null}return r.a}}));this.INTERNAL={};this.INTERNAL.delete=o(this.delete,this);this.INTERNAL.logFramework=o(this.Ec,this);this.s=0;ot.call(this);h=this;Object.defineProperty(h,"lc",{get:function(){return this.ja()},set:function(n){this.va(n)},enumerable:!1});h.$=null;Object.defineProperty(h,"ti",{get:function(){return this.S()},set:function(n){this.ub(n)},enumerable:!1});h.R=null;this.N=[]}function tet(n){yt.call(this,"languageCodeChanged");this.g=n}function iet(n){yt.call(this,"frameworkChanged");this.c=n}function hb(n){return n.Zb||y(new i("auth-domain-config-required"))}function ret(n){if(!dr())return y(new i("operation-not-supported-in-this-environment"));var t=hb(n).then(function(){return n.a.pa()}).then(function(n){return n?fr(n):null});return k(n,t)}function rat(n,t){var i={};return i.apiKey=a(n).options.apiKey,i.authDomain=a(n).options.authDomain,i.appName=a(n).name,n.Z.then(function(){return e=i,o=t,u=n.B,f=n.Ea(),r=new vt(e,o),u&&(r.ga=u),f&&ao(r,f),r.reload().then(function(){return r});var e,o,u,f,r}).then(function(t){return s(n)&&t.uid==s(n).uid?yc(s(n),t):(kf(n,t),vo(t)),n.ca(t)}).then(function(){po(n)})}function kf(n,t){var i,r;s(n)&&(i=s(n),r=n.Ma,dt(i.R,function(n){return n==r}),pt(s(n),"tokenChanged",n.xa),pt(s(n),"userDeleted",n.ya),pt(s(n),"userInvalidated",n.za),tb(s(n)));t&&(t.R.push(n.Ma),ti(t,"tokenChanged",n.xa),ti(t,"userDeleted",n.ya),ti(t,"userInvalidated",n.za),0<n.s&&hft(t));u(n,"currentUser",t);t&&(t.va(n.ja()),dw(t,n),ao(t,n.N),gw(t,n))}function cu(n,t){var i=null,r=null;return k(n,t.then(function(t){return i=ey(t),r=rtt(t),rat(n,t)},function(t){var i=null;throw t&&"auth/multi-factor-auth-required"===t.code&&(i=fft(t.v(),n,o(n.ic,n))),i||t;}).then(function(){return fr({user:s(n),credential:i,additionalUserInfo:r,operationType:"signIn"})}))}function a(n){return n.app}function s(n){return n.currentUser}function kc(n){return s(n)&&s(n)._lat||null}function po(n){if(n.aa){for(var t=0;t<n.m.length;t++)n.m[t]&&n.m[t](kc(n));if(n.W!==n.getUid()&&n.O.length)for(n.W=n.getUid(),t=0;t<n.O.length;t++)n.O[t]&&n.O[t](kc(n))}}function k(n,t){return n.P.push(t),t.ma(function(){go(n.P,t)}),t}function wo(){}function df(){this.a={};this.b=1e12}function lb(n,t){return(t=uet(t))&&n.a[t]||null}function uet(n){return(n=void 0===n?1e12:n)?n.toString():null}function dc(n,t){this.g=!1;this.c=t;this.a=this.b=null;this.h="invisible"!==this.c.size;this.f=ee(n);var i=this;this.i=function(){i.execute()};this.h?this.execute():ti(this.f,"click",this.i)}function ab(n){if(n.g)throw Error("reCAPTCHA mock was already deleted!");}function vb(){}function yb(){}function wb(){this.b=r.grecaptcha?1/0:0;this.f=null;this.a="__rcb"+Math.floor(1e6*Math.random()).toString()}function kb(n,t,f,e,o,s,h){var a,c,l;if(u(this,"type","recaptcha"),this.c=this.f=null,this.D=!1,this.u=t,this.g=null,h=h?pb=pb||new yb:bb=bb||new wb,this.m=h,this.a=f||{theme:"light",type:"image"},this.h=[],this.a[het])throw new i("argument-error","sitekey should not be provided for reCAPTCHA as one is automatically provisioned for the current project.");if(this.i="invisible"===this.a[uat],!r.document)throw new i("operation-not-supported-in-this-environment","RecaptchaVerifier is only supported in a browser HTTP/HTTPS environment with DOM support.");if(!ee(t)||!this.i&&ee(t).hasChildNodes())throw new i("argument-error","reCAPTCHA container is either not found or already contains inner elements!");this.s=new ui(n,s||null,o||null);this.w=e||function(){return null};a=this;this.l=[];c=this.a[oet];this.a[oet]=function(n){if(cet(a,n),"function"==typeof c)c(n);else if("string"==typeof c){var t=p(c,r);"function"==typeof t&&t(n)}};l=this.a[set];this.a[set]=function(){if(cet(a,null),"function"==typeof l)l();else if("string"==typeof l){var n=p(l,r);"function"==typeof n&&n()}}}function cet(n,t){for(var i=0;i<n.l.length;i++)try{n.l[i](t)}catch(n){}}function db(n,t){return n.h.push(t),t.ma(function(){go(n.h,t)}),t}function gc(n){if(n.D)throw new i("internal-error","RecaptchaVerifier instance has been destroyed.");}function gb(t,r,u){var e=!1,o,f;try{this.b=u||n.app()}catch(t){throw new i("argument-error","No firebase.app.App instance is currently initialized.");}if(!this.b.options||!this.b.options.apiKey)throw new i("invalid-api-key");u=this.b.options.apiKey;o=this;f=null;try{f=this.b.auth().Ea()}catch(t){}try{e=this.b.auth().settings.appVerificationDisabledForTesting}catch(t){}f=n.SDK_VERSION?uf(n.SDK_VERSION,f):null;kb.call(this,u,t,r,function(){try{var n=o.b.auth().ja()}catch(t){n=null}return n},f,ue(ie),e)}function aet(n,t,r,u){n:{r=Array.prototype.slice.call(r);for(var f=0,e=!1,o=0;o<t.length;o++)if(t[o].optional)e=!0;else{if(e)throw new i("internal-error","Argument validator encountered a required argument after an optional argument.");f++}if(e=t.length,r.length<f||e<r.length)u="Expected "+(f==e?1==f?"1 argument":f+" arguments":f+"-"+e+" arguments")+" but got "+r.length+".";else{for(f=0;f<r.length;f++)if(e=t[f].optional&&void 0===r[f],!t[f].K(r[f])&&!e){if(t=t[f],f<0||f>=nk.length)throw new i("internal-error","Argument validator received an unsupported number of arguments.");r=nk[f];u=(u?"":r+" argument ")+(t.name?'"'+t.name+'" ':"")+"must be "+t.J+".";break n}u=null}}if(u)throw new i("argument-error",n+" failed: "+u);}function f(n,t){return{name:n||"",J:"a valid string",optional:!!t,K:function(n){return"string"==typeof n}}}function tk(n,t){return{name:n||"",J:"a boolean",optional:!!t,K:function(n){return"boolean"==typeof n}}}function ut(n,t){return{name:n||"",J:"a valid object",optional:!!t,K:tt}}function gf(n,t){return{name:n||"",J:"a function",optional:!!t,K:et}}function yi(n,t){return{name:n||"",J:"null",optional:!!t,K:function(n){return null===n}}}function hr(n){return{name:n?n+"Credential":"credential",J:n?"a valid "+n+" credential":"a valid credential",optional:!1,K:function(t){if(!t)return!1;var i=!n||t.providerId===n;return!(!t.ia||!i)}}}function vet(){return{name:"multiFactorAssertion",J:"a valid multiFactorAssertion",optional:!1,K:function(n){return!!n&&!!n.ob}}}function ne(){return{name:"authProvider",J:"a valid Auth provider",optional:!1,K:function(n){return!!(n&&n.providerId&&n.hasOwnProperty&&n.hasOwnProperty("isOAuthProvider"))}}}function ik(n,t){return tt(n)&&"string"==typeof n.type&&n.type===t&&et(n.Fa)}function yet(n){return tt(n)&&"string"==typeof n.uid}function nl(){return{name:"applicationVerifier",J:"an implementation of firebase.auth.ApplicationVerifier",optional:!1,K:function(n){return!(!n||"string"!=typeof n.type||!et(n.verify))}}}function g(n,t,i,r){return{name:i||"",J:n.J+" or "+t.J,optional:!!r,K:function(i){return n.K(i)||t.K(i)}}}function b(n,t){var i,r;for(i in t)r=t[i].name,n[r]=wet(r,n[i],t[i].j)}function pet(n,t){var i,r;for(i in t)r=t[i].name,r!==i&&Object.defineProperty(n,r,{get:au(function(n){return this[n]},i),set:au(function(n,t,i,r){aet(n,[i],[r],!0);this[t]=r},r,i,t[i].gb),enumerable:!0})}function nt(n,t,i,r){n[t]=wet(t,i,r)}function wet(n,t,i){function u(){var n=Array.prototype.slice.call(arguments);return aet(e,i,n),t.apply(this,n)}if(!i)return t;var r,f,e=(f=(f=n).split("."))[f.length-1];for(r in t)u[r]=t[r];for(r in t.prototype)u.prototype[r]=t.prototype[r];return u}var t,bet="function"==typeof Object.defineProperties?Object.defineProperty:function(n,t,i){n!=Array.prototype&&n!=Object.prototype&&(n[t]=i.value)},rk=function(n){var t,i;for(n=["object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global,n],t=0;t<n.length;++t)if(i=n[t],i&&i.Math==Math)return i;return globalThis}(this),bo,fk,vu,el,cl,ll,al,kl,dl,ts,gl,bk,rs,us,fs,wi,td,rd,fd,es,ra,hs,ua,fa,sa,bd,gd,du,ng,vs,ys,ws,wa,ga,pg,gg,nn,ds,uv,fv,sv,hv,nh,of,oh,ty,sf,we,sy,hh,nit,vh,yh,wh,wy,iit,rit,eo,lit,ait,wit,np,kit,ap,vp,dp,uc,nw,rw,sut,oc,wut,but,hc,lw,aw,wc,bc,cb,pb,fet,eet,bb,nk;!function(n,t){var i,r,u;if(t){for(i=rk,n=n.split("."),r=0;r<n.length-1;r++)u=n[r],u in i||(i[u]={}),i=i[u];(t=t(r=i[n=n[n.length-1]]))!=r&&null!=t&&bet(i,n,{configurable:!0,writable:!0,value:t})}}("Promise",function(n){function t(n){this.b=0;this.c=void 0;this.a=[];var t=this.f();try{n(t.resolve,t.reject)}catch(n){t.reject(n)}}function i(){this.a=null}function r(n){return n instanceof t?n:new t(function(t){t(n)})}var f,u;return n?n:(i.prototype.b=function(n){if(null==this.a){this.a=[];var t=this;this.c(function(){t.g()})}this.a.push(n)},f=rk.setTimeout,i.prototype.c=function(n){f(n,0)},i.prototype.g=function(){for(var n,t,i;this.a&&this.a.length;)for(n=this.a,this.a=[],t=0;t<n.length;++t){i=n[t];n[t]=null;try{i()}catch(n){this.f(n)}}this.a=null},i.prototype.f=function(n){this.c(function(){throw n;})},t.prototype.f=function(){function n(n){return function(r){t||(t=!0,n.call(i,r))}}var i=this,t=!1;return{resolve:n(this.m),reject:n(this.g)}},t.prototype.m=function(n){if(n===this)this.g(new TypeError("A Promise cannot resolve to itself"));else if(n instanceof t)this.s(n);else{n:switch(typeof n){case"object":var i=null!=n;break n;case"function":i=!0;break n;default:i=!1}i?this.u(n):this.h(n)}},t.prototype.u=function(n){var t=void 0;try{t=n.then}catch(n){return void this.g(n)}"function"==typeof t?this.w(t,n):this.h(n)},t.prototype.g=function(n){this.i(2,n)},t.prototype.h=function(n){this.i(1,n)},t.prototype.i=function(n,t){if(0!=this.b)throw Error("Cannot settle("+n+", "+t+"): Promise already settled in state"+this.b);this.b=n;this.c=t;this.l()},t.prototype.l=function(){if(null!=this.a){for(var n=0;n<this.a.length;++n)u.b(this.a[n]);this.a=null}},u=new i,t.prototype.s=function(n){var t=this.f();n.Oa(t.resolve,t.reject)},t.prototype.w=function(n,t){var i=this.f();try{n.call(t,i.resolve,i.reject)}catch(n){i.reject(n)}},t.prototype.then=function(n,i){function f(n,t){return"function"==typeof n?function(t){try{r(n(t))}catch(t){u(t)}}:t}var r,u,e=new t(function(n,t){r=n;u=t});return this.Oa(f(n,r),f(i,u)),e},t.prototype.catch=function(n){return this.then(void 0,n)},t.prototype.Oa=function(n,t){function r(){switch(i.b){case 1:n(i.c);break;case 2:t(i.c);break;default:throw Error("Unexpected state: "+i.b);}}var i=this;null==this.a?u.b(r):this.a.push(r)},t.resolve=r,t.reject=function(n){return new t(function(t,i){i(n)})},t.race=function(n){return new t(function(t,i){for(var f=uk(n),u=f.next();!u.done;u=f.next())r(u.value).Oa(t,i)})},t.all=function(n){var u=uk(n),i=u.next();return i.done?r([]):new t(function(n,t){function o(t){return function(i){f[t]=i;0==--e&&n(f)}}for(var f=[],e=0;f.push(void 0),e++,r(i.value).Oa(o(f.length-1),t),!(i=u.next()).done;);})},t)});var tl=tl||{},r=this||self,ket=/^[\w+/_-]+[=]{0,2}$/,il=null;bo="closure_uid_"+(1e9*Math.random()>>>0);fk=0;vu=Date.now||function(){return+new Date};h(i,Error);i.prototype.v=function(){var n={code:this.code,message:this.message};return this.a&&(n.serverResponse=this.a),n};i.prototype.toJSON=function(){return this.v()};var ie,re="auth/",not={"admin-restricted-operation":"This operation is restricted to administrators only.","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-change-needs-verification":"Multi-factor users must always have a verified email.","email-already-in-use":"The email address is already in use by another account.","expired-action-code":"The action code has expired. ","cancelled-popup-request":"This operation has been cancelled due to another conflicting popup being opened.","internal-error":"An internal error has occurred.","invalid-app-credential":"The phone verification request contains an invalid application verifier. The reCAPTCHA token response is either invalid or expired.","invalid-app-id":"The mobile app identifier is not registed for the current project.","invalid-user-token":"This user's credential isn't valid for this project. This can happen if the user's token has been tampered with, or if the user isn't for the project associated with this API key.","invalid-auth-event":"An internal error has occurred.","invalid-verification-code":"The SMS verification code used to create the phone auth credential is invalid. Please resend the verification code sms and be sure use the verification code provided by the user.","invalid-continue-uri":"The continue URL provided in the request is invalid.","invalid-cordova-configuration":"The following Cordova plugins must be installed to enable OAuth sign-in: cordova-plugin-buildinfo, cordova-universal-links-plugin, cordova-plugin-browsertab, cordova-plugin-inappbrowser and cordova-plugin-customurlscheme.","invalid-custom-token":"The custom token format is incorrect. Please check the documentation.","invalid-dynamic-link-domain":"The provided dynamic link domain is not configured or authorized for the current project.","invalid-email":"The email address is badly formatted.","invalid-api-key":"Your API key is invalid, please check you have copied it correctly.","invalid-cert-hash":"The SHA-1 certificate hash provided is invalid.","invalid-credential":"The supplied auth credential is malformed or has expired.","invalid-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-multi-factor-session":"The request does not contain a valid proof of first factor successful sign-in.","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-persistence-type":"The specified persistence type is invalid. It can only be local, session or none.","invalid-phone-number":"The format of the phone number provided is incorrect. Please enter the phone number in a format that can be parsed into E.164 format. E.164 phone numbers are written in the format [+][country code][subscriber number including area code].","invalid-provider-id":"The specified provider ID is invalid.","invalid-recipient-email":"The email corresponding to this action failed to send as the provided recipient email address is invalid.","invalid-sender":"The email template corresponding to this action contains an invalid sender email or name. Please fix by going to the Auth email templates section in the Firebase Console.","invalid-verification-id":"The verification ID used to create the phone auth credential is invalid.","invalid-tenant-id":"The Auth instance's tenant ID is invalid.","multi-factor-info-not-found":"The user does not have a second factor matching the identifier provided.","multi-factor-auth-required":"Proof of ownership of a second factor is required to complete sign-in.","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-multi-factor-info":"No second factor identifier is provided.","missing-multi-factor-session":"The request is missing proof of first factor successful sign-in.","missing-or-invalid-nonce":"The request does not contain a valid nonce. This can occur if the SHA-256 hash of the provided raw nonce does not match the hashed nonce in the ID token payload.","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.","second-factor-already-in-use":"The second factor is already enrolled on this account.","maximum-second-factor-count-exceeded":"The maximum allowed number of second factors on a user has been exceeded.","tenant-id-mismatch":"The provided tenant ID does not match the Auth instance's tenant ID",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-first-factor":"Enrolling a second factor or signing in with a multi-factor account requires sign-in with a supported first factor.","unsupported-persistence-type":"The current environment does not support the specified persistence type.","unsupported-tenant-operation":"This operation is not supported in a multi-tenant context.","unverified-email":"The operation requires a verified email.","user-cancelled":"The 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."},rl={hd:{Ra:"https://staging-identitytoolkit.sandbox.googleapis.com/identitytoolkit/v3/relyingparty/",Xa:"https://staging-securetoken.sandbox.googleapis.com/v1/token",Ua:"https://staging-identitytoolkit.sandbox.googleapis.com/v2/",id:"b"},pd:{Ra:"https://www.googleapis.com/identitytoolkit/v3/relyingparty/",Xa:"https://securetoken.googleapis.com/v1/token",Ua:"https://identitytoolkit.googleapis.com/v2/",id:"p"},rd:{Ra:"https://staging-www.sandbox.googleapis.com/identitytoolkit/v3/relyingparty/",Xa:"https://staging-securetoken.sandbox.googleapis.com/v1/token",Ua:"https://staging-identitytoolkit.sandbox.googleapis.com/v2/",id:"s"},sd:{Ra:"https://www-googleapis-test.sandbox.google.com/identitytoolkit/v3/relyingparty/",Xa:"https://test-securetoken.sandbox.googleapis.com/v1/token",Ua:"https://test-identitytoolkit.sandbox.googleapis.com/v2/",id:"t"}};ie=ue("__EID__")?"__EID__":void 0;h(lt,Error);lt.prototype.name="CustomError";h(ul,lt);ul.prototype.name="AssertionError";fl.prototype.get=function(){if(0<this.b){this.b--;var n=this.a;this.a=n.next;n.next=null}else n=this.c();return n};el=new fl(function(){return new ol},function(n){n.reset()});hk.prototype.add=function(n,t){var i=el.get();i.set(n,t);this.b?this.b.next=i:this.a=i;this.b=i};ol.prototype.set=function(n,t){this.a=n;this.b=t;this.next=null};ol.prototype.reset=function(){this.next=this.b=this.a=null};var ck=Array.prototype.indexOf?function(n,t){return Array.prototype.indexOf.call(n,t,void 0)}:function(n,t){if("string"==typeof n)return"string"!=typeof t||1!=t.length?-1:n.indexOf(t,0);for(var i=0;i<n.length;i++)if(i in n&&n[i]===t)return i;return-1},w=Array.prototype.forEach?function(n,t,i){Array.prototype.forEach.call(n,t,i)}:function(n,t,i){for(var f=n.length,u="string"==typeof n?n.split(""):n,r=0;r<f;r++)r in u&&t.call(i,u[r],r,n)},tot=Array.prototype.filter?function(n,t){return Array.prototype.filter.call(n,t,void 0)}:function(n,t){for(var r,e=n.length,u=[],o=0,f="string"==typeof n?n.split(""):n,i=0;i<e;i++)i in f&&(r=f[i],t.call(void 0,r,i,n)&&(u[o++]=r));return u},ko=Array.prototype.map?function(n,t){return Array.prototype.map.call(n,t,void 0)}:function(n,t){for(var r=n.length,u=Array(r),f="string"==typeof n?n.split(""):n,i=0;i<r;i++)i in f&&(u[i]=t.call(void 0,f[i],i,n));return u},iot=Array.prototype.some?function(n,t){return Array.prototype.some.call(n,t,void 0)}:function(n,t){for(var u=n.length,r="string"==typeof n?n.split(""):n,i=0;i<u;i++)if(i in r&&t.call(void 0,r[i],i,n))return!0;return!1};var pu,lk=String.prototype.trim?function(n){return n.trim()}:function(n){return/^[\s\xa0]*([\s\S]*?)[\s\xa0]*$/.exec(n)[1]},rot=/&/g,uot=/</g,fot=/>/g,eot=/"/g,oot=/'/g,sot=/\x00/g,hot=/[\x00&<>"']/;n:{if(cl=r.navigator,cl&&(ll=cl.userAgent,ll)){pu=ll;break n}pu=""}al="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");oi.prototype.ra=!0;oi.prototype.qa=function(){return this.a};oi.prototype.toString=function(){return"Const{"+this.a+"}"};var vk={},fe={},cot=new oi(fe,"");ar.prototype.ra=!0;ar.prototype.qa=function(){return this.a.toString()};ar.prototype.toString=function(){return"TrustedResourceUrl{"+this.a+"}"};var lot=/%{(\w+)}/g,aot=/^((https:)?\/\/[0-9a-z.:[\]-]+\/|\/[^/\\]|[^:/\\%]+\/|[^:/\\%]*[?#]|about:blank#)/i,yk={},bl={};gt.prototype.ra=!0;gt.prototype.qa=function(){return this.a.toString()};gt.prototype.toString=function(){return"SafeUrl{"+this.a+"}"};kl=/^(?:(?:https?|mailto|ftp):|[^:/?#]*(?:[/?#]|$))/i;dl={};ts={};wu.prototype.ra=!0;wu.prototype.qa=function(){return this.a.toString()};wu.prototype.toString=function(){return"SafeHtml{"+this.a+"}"};gl={};is("<!DOCTYPE html>");bk=is("");is("<br>");ta[" "]=ei;var ia,bu,vot=it("Opera"),ni=it("Trident")||it("MSIE"),dk=it("Edge"),yot=dk||ni,gk=it("Gecko")&&!(v(pu.toLowerCase(),"webkit")&&!it("Edge"))&&!(it("Trident")||it("MSIE"))&&!it("Edge"),pot=v(pu.toLowerCase(),"webkit")&&!it("Edge");n:{if(rs="",us=(bu=pu,gk?/rv:([^\);]+)(\)|;)/.exec(bu):dk?/Edge\/([\d\.]+)/.exec(bu):ni?/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(bu):pot?/WebKit\/(\S+)/.exec(bu):vot?/(?:Version)[ \/]?(\S+)/.exec(bu):void 0),(us&&(rs=us?us[1]:""),ni)&&(fs=nd(),null!=fs&&fs>parseFloat(rs))){ia=String(fs);break n}ia=rs}td={};wi=r.document&&ni?nd():void 0;try{new self.OffscreenCanvas(0,0).getContext("2d")}catch(t){}rd=!ni||9<=Number(wi);ra={cellpadding:"cellPadding",cellspacing:"cellSpacing",colspan:"colSpan",frameborder:"frameBorder",height:"height",maxlength:"maxLength",nonce:"nonce",role:"role",rowspan:"rowSpan",type:"type",usemap:"useMap",valign:"vAlign",width:"width"};hs=!1;ua=new hk;var vr=0,oe=2,bi=3;sd.prototype.reset=function(){this.f=this.b=this.g=this.a=null;this.c=!1};fa=new fl(function(){return new sd},function(n){n.reset()});c.prototype.then=function(n,t,i){return ld(this,et(n)?n:null,et(t)?t:null,i)};c.prototype.$goog_Thenable=!0;(t=c.prototype).ma=function(n,t){return(n=ea(n,n,t)).c=!0,oa(this,n),this};t.o=function(n,t){return ld(this,null,n,t)};t.cancel=function(n){if(this.a==vr){var t=new ku(n);ss(function(){!function n(t,i){var r;if(t.a==vr)if(t.c){if(r=t.c,r.b){for(var u=0,e=null,o=null,f=r.b;f&&(f.c||(u++,f.a==t&&(e=f),!(e&&1<u)));f=f.next)e||(o=f);e&&(r.a==vr&&1==u?n(r,i):(o?((u=o).next==r.f&&(r.f=u),u.next=u.next.next):yd(r),pd(r,e,bi,i)))}t.c=null}else yr(t,bi,i)}(this,t)},this)}};t.Yc=function(n){this.a=vr;yr(this,oe,n)};t.Zc=function(n){this.a=vr;yr(this,bi,n)};t.ec=function(){for(var n;n=yd(this);)pd(this,n,this.a,this.i);this.h=!1};sa=ed;h(ku,lt);bd=0;cs.prototype.wa=!(ku.prototype.name="cancel");cs.prototype.Ba=function(){if(this.na)for(;this.na.length;)this.na.shift()()};var dot=Object.freeze||function(n){return n},dd=!ni||9<=Number(wi),got=ni&&!id("9"),nst=function(){if(!r.addEventListener||!Object.defineProperty)return!1;var n=!1,t=Object.defineProperty({},"passive",{get:function(){n=!0}});try{r.addEventListener("test",ei,t);r.removeEventListener("test",ei,t)}catch(n){}return n}();yt.prototype.preventDefault=function(){this.defaultPrevented=!0};h(pr,yt);gd=dot({2:"touch",3:"pen",4:"mouse"});pr.prototype.preventDefault=function(){pr.Za.preventDefault.call(this);var n=this.a;if(n.preventDefault)n.preventDefault();else if(n.returnValue=!1,got)try{(n.ctrlKey||112<=n.keyCode&&n.keyCode<=123)&&(n.keyCode=-1)}catch(n){}};pr.prototype.f=function(){return this.a};du="closure_listenable_"+(1e6*Math.random()|0);ng=0;as.prototype.add=function(n,t,i,r,u){var f=n.toString(),e;return(n=this.a[f])||(n=this.a[f]=[],this.b++),e=ca(n,t,r,u),-1<e?(t=n[e],i||(t.Na=!1)):((t=new tst(t,this.src,f,!!r,u)).Na=i,n.push(t)),t};vs="closure_lm_"+(1e6*Math.random()|0);ys={};ws="__closure_events_fn_"+(1e9*Math.random()>>>0);h(ot,cs);ot.prototype[du]=!0;ot.prototype.addEventListener=function(n,t,i,r){ti(this,n,t,i,r)};ot.prototype.removeEventListener=function(n,t,i,r){pt(this,n,t,i,r)};ot.prototype.dispatchEvent=function(n){var r,i=this.eb,f,t,u,e;if(i)for(r=[];i;i=i.eb)r.push(i);if(i=this.Yb,f=n.type||n,"string"==typeof n?n=new yt(n,i):n instanceof yt?n.target=n.target||i:(t=n,ht(n=new yt(f,i),t)),t=!0,r)for(u=r.length-1;0<=u;u--)e=n.b=r[u],t=bs(e,f,!0,n)&&t;if(t=bs(e=n.b=i,f,!0,n)&&t,t=bs(e,f,!1,n)&&t,r)for(u=0;u<r.length;u++)t=bs(e=n.b=r[u],f,!1,n)&&t;return t};ot.prototype.Ba=function(){var i,n,r,t;if(ot.Za.Ba.call(this),this.u){n=this.u;for(i in n.a){for(r=n.a[i],t=0;t<r.length;t++)ls(r[t]);delete n.a[i];n.b--}}this.eb=null};(t=nf.prototype).V=function(){pa(this);for(var t=[],n=0;n<this.a.length;n++)t.push(this.b[this.a[n]]);return t};t.X=function(){return pa(this),this.a.concat()};t.clear=function(){this.b={};this.c=this.a.length=0};t.get=function(n,t){return wr(this.b,n)?this.b[n]:t};t.set=function(n,t){wr(this.b,n)||(this.c++,this.a.push(n));this.b[n]=t};t.forEach=function(n,t){for(var u,f,r=this.X(),i=0;i<r.length;i++)u=r[i],f=this.get(u),n.call(t,f,u,this)};wa=/^(?:([^:/?#.]+):)?(?:\/\/(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/\\#?]|$))?([^?#]+)?(?:\?([^#]*))?(?:#([\s\S]*))?$/;ir.prototype.toString=function(){var t=[],i=this.f,n;return i&&t.push(he(i,cg,!0),":"),n=this.b,!n&&"file"!=i||(t.push("//"),(i=this.i)&&t.push(he(i,cg,!0),"@"),t.push(encodeURIComponent(String(n)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),null!=(n=this.l)&&t.push(":",String(n))),(n=this.c)&&(this.b&&"/"!=n.charAt(0)&&t.push("/"),t.push(he(n,"/"==n.charAt(0)?fst:ust,!0))),(n=this.a.toString())&&t.push("?",n),(n=this.g)&&t.push("#",he(n,ost)),t.join("")};ir.prototype.resolve=function(n){var u=new ir(this),r=!!n.f,t,i,f,e,o;if(r?ks(u,n.f):r=!!n.i,r?u.i=n.i:r=!!n.b,r?u.b=n.b:r=null!=n.l,t=n.c,r)ba(u,n.l);else if(r=!!n.c)if("/"!=t.charAt(0)&&(this.b&&!this.c?t="/"+t:(i=u.c.lastIndexOf("/"),-1!=i&&(t=u.c.substr(0,i+1)+t))),".."==(i=t)||"."==i)t="";else if(v(i,"./")||v(i,"/.")){for(t=0==i.lastIndexOf("/",0),i=i.split("/"),f=[],e=0;e<i.length;)o=i[e++],"."==o?t&&e==i.length&&f.push(""):".."==o?((1<f.length||1==f.length&&""!=f[0])&&f.pop(),t&&e==i.length&&f.push("")):(f.push(o),t=!0);t=f.join("/")}else t=i;return r?u.c=t:r=""!==n.a.toString(),r?ka(u,vg(n.a)):r=!!n.g,r&&(u.g=n.g),u};var cg=/[#\/\?@]/g,ust=/[#\?:]/g,fst=/[#\?]/g,est=/[#\?@]/g,ost=/#/g;(t=br.prototype).add=function(n,t){rr(this);this.c=null;n=tf(this,n);var i=this.a.get(n);return i||this.a.set(n,i=[]),i.push(t),this.b+=1,this};t.clear=function(){this.a=this.c=null;this.b=0};t.forEach=function(n,t){rr(this);this.a.forEach(function(i,r){w(i,function(i){n.call(t,i,r,this)},this)},this)};t.X=function(){var u,t;rr(this);for(var f=this.a.V(),i=this.a.X(),r=[],n=0;n<i.length;n++)for(u=f[n],t=0;t<u.length;t++)r.push(i[n]);return r};t.V=function(n){var t,i;if(rr(this),t=[],"string"==typeof n)da(this,n)&&(t=sl(t,this.a.get(tf(this,n))));else for(n=this.a.V(),i=0;i<n.length;i++)t=sl(t,n[i]);return t};t.set=function(n,t){return rr(this),this.c=null,da(this,n=tf(this,n))&&(this.b-=this.a.get(n).length),this.a.set(n,[t]),this.b+=1,this};t.get=function(n,t){return n&&0<(n=this.V(n)).length?String(n[0]):t};t.toString=function(){var n,e,t,r;if(this.c)return this.c;if(!this.a)return"";for(var u=[],f=this.a.X(),i=0;i<f.length;i++)for(n=f[i],e=encodeURIComponent(String(n)),n=this.V(n),t=0;t<n.length;t++)r=e,""!==n[t]&&(r+="="+encodeURIComponent(String(n[t]))),u.push(r);return this.c=u.join("&")};ga={'"':'\\"',"\\":"\\\\","/":"\\/","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\u000b"};pg=/\uffff/.test("￿")?/[\\"\x00-\x1f\x7f-\uffff]/g:/[\\"\x00-\x1f\x7f-\xff]/g;gg=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/;nn=/^[^@]+@[^@]+$/;ds="Firefox";uv="Chrome";fv={jd:"FirebaseCore-web",ld:"FirebaseUI-web"};ur.prototype.get=function(){var n=r.navigator;return!n||"boolean"!=typeof n.onLine||!gs()&&"chrome-extension:"!==ff()&&void 0===n.connection||n.onLine?this.b?this.c:this.a:Math.min(5e3,this.a)};hv={};try{nh={};Object.defineProperty(nh,"abcd",{configurable:!0,enumerable:!0,value:1});Object.defineProperty(nh,"abcd",{configurable:!0,enumerable:!0,value:2});sv=2==nh.abcd}catch(t){sv=!1}av.prototype.v=function(){return{uid:this.uid,displayName:this.displayName,factorId:this.factorId,enrollmentTime:this.enrollmentTime}};var on="displayName",yv="enrolledAt",pv="mfaEnrollmentId",wv="phoneInfo";h(ye,av);ye.prototype.v=function(){var n=ye.Za.v.call(this);return n.phoneNumber=this.phoneNumber,n};var bv="REVERT_SECOND_FACTOR_ADDITION",th="EMAIL_SIGNIN",pe="VERIFY_AND_CHANGE_EMAIL",cst="email",lst="mfaInfo",ast="newEmail",vst="requestType",sn="email",hn="fromEmail",yst="multiFactorInfo",cn="previousEmail",pst="data",wst="operation";var ln="apiKey",an="oobCode",bst="continueUrl",kst="languageCode",vn="mode",dst="tenantId",gst={recoverEmail:"RECOVER_EMAIL",resetPassword:"PASSWORD_RESET",revertSecondFactorAddition:bv,signIn:th,verifyAndChangeEmail:pe,verifyEmail:"VERIFY_EMAIL"};var pn="android",wn="dynamicLinkDomain",dv="handleCodeInApp",bn="iOS",nht="url",kn="installApp",dn="minimumVersion",gn="packageName",ntt="bundleId";of=null;uh.prototype.S=function(){return this.f};uh.prototype.i=function(){return this.b};uh.prototype.toString=function(){return this.g};var itt="oauth_consumer_key oauth_nonce oauth_signature oauth_signature_method oauth_timestamp oauth_token oauth_version".split(" "),eh=["client_id","response_type","scope","redirect_uri","state"],gv={kd:{Ha:"locale",ta:700,sa:600,ea:"facebook.com",Va:eh},md:{Ha:null,ta:500,sa:750,ea:"github.com",Va:eh},nd:{Ha:"hl",ta:515,sa:680,ea:"google.com",Va:eh},td:{Ha:"lang",ta:485,sa:705,ea:"twitter.com",Va:itt},gd:{Ha:"locale",ta:640,sa:600,ea:"apple.com",Va:[]}};oh="idToken";ty="providerId";h(ci,iy);h(utt,ci);h(ftt,ci);h(ett,ci);h(ott,ci);sf="enroll";we="signin";sh.prototype.Fa=function(){return this.a?e(this.a):e(this.b)};sh.prototype.v=function(){return this.type==sf?{multiFactorSession:{idToken:this.a}}:{multiFactorSession:{pendingCredential:this.b}}};hf.prototype.ia=function(){};hf.prototype.b=function(){};hf.prototype.c=function(){};hf.prototype.v=function(){};nu.prototype.ia=function(n){return up(n,ry(this))};nu.prototype.b=function(n,t){var i=ry(this);return i.idToken=t,fp(n,i)};nu.prototype.c=function(n,t){return cf(ep(n,ry(this)),t)};nu.prototype.v=function(){return{providerId:this.providerId,signInMethod:this.signInMethod,pendingToken:this.a}};di.prototype.ia=function(n){return up(n,uy(this))};di.prototype.b=function(n,t){var i=uy(this);return i.idToken=t,fp(n,i)};di.prototype.c=function(n,t){return cf(ep(n,uy(this)),t)};di.prototype.v=function(){var n={providerId:this.providerId,signInMethod:this.signInMethod};return this.idToken&&(n.oauthIdToken=this.idToken),this.accessToken&&(n.oauthAccessToken=this.accessToken),this.secret&&(n.oauthTokenSecret=this.secret),this.nonce&&(n.nonce=this.nonce),this.a&&(n.pendingToken=this.a),n};tu.prototype.Ia=function(n){return this.Fb=tr(n),this};h(htt,tu);h(at,tu);at.prototype.Aa=function(n){return pi(this.a,n)||this.a.push(n),this};at.prototype.Nb=function(){return cr(this.a)};at.prototype.credential=function(n,t){var r;if(!(r=tt(n)?{idToken:n.idToken||null,accessToken:n.accessToken||null,nonce:n.rawNonce||null}:{idToken:n||null,accessToken:t||null}).idToken&&!r.accessToken)throw new i("argument-error","credential failed: must provide the ID token and/or the access token.");return new di(this.providerId,r,this.providerId)};h(iu,at);u(iu,"PROVIDER_ID","facebook.com");u(iu,"FACEBOOK_SIGN_IN_METHOD","facebook.com");h(ru,at);u(ru,"PROVIDER_ID","github.com");u(ru,"GITHUB_SIGN_IN_METHOD","github.com");h(uu,at);u(uu,"PROVIDER_ID","google.com");u(uu,"GOOGLE_SIGN_IN_METHOD","google.com");h(lf,tu);u(lf,"PROVIDER_ID","twitter.com");u(lf,"TWITTER_SIGN_IN_METHOD","twitter.com");er.prototype.ia=function(n){return this.signInMethod==bt.EMAIL_LINK_SIGN_IN_METHOD?l(n,ict,{email:this.a,oobCode:this.f}):l(n,irt,{email:this.a,password:this.f})};er.prototype.b=function(n,t){return this.signInMethod==bt.EMAIL_LINK_SIGN_IN_METHOD?l(n,rct,{idToken:t,email:this.a,oobCode:this.f}):l(n,trt,{idToken:t,email:this.a,password:this.f})};er.prototype.c=function(n,t){return cf(this.ia(n),t)};er.prototype.v=function(){return{email:this.a,password:this.f,signInMethod:this.signInMethod}};st(bt,{PROVIDER_ID:"password"});st(bt,{EMAIL_LINK_SIGN_IN_METHOD:"emailLink"});st(bt,{EMAIL_PASSWORD_SIGN_IN_METHOD:"password"});or.prototype.ia=function(n){return n.cb(be(this))};or.prototype.b=function(n,t){var i=be(this);return i.idToken=t,l(n,ilt,i)};or.prototype.c=function(n,t){var i=be(this);return i.operation="REAUTH",cf(n=l(n,rlt,i),t)};or.prototype.v=function(){var n={providerId:"phone"};return this.a.bb&&(n.verificationId=this.a.bb),this.a.ab&&(n.verificationCode=this.a.ab),this.a.Ja&&(n.temporaryProof=this.a.Ja),this.a.da&&(n.phoneNumber=this.a.da),n};gi.prototype.cb=function(n,t){var r=this.a.b;return e(t.verify()).then(function(u){if("string"!=typeof u)throw new i("argument-error","An implementation of firebase.auth.ApplicationVerifier.prototype.verify() must return a firebase.Promise that resolves with a string.");switch(t.type){case"recaptcha":var f=tt(n)?n.session:null,e=tt(n)?n.phoneNumber:n;return(f&&f.type==sf?f.Fa().then(function(n){return l(r,wct,{idToken:n,phoneEnrollmentInfo:{phoneNumber:e,recaptchaToken:u}}).then(function(n){return n.phoneSessionInfo.sessionInfo})}):f&&f.type==we?f.Fa().then(function(t){return i=r,f={mfaPendingCredential:t,mfaEnrollmentId:n.multiFactorHint&&n.multiFactorHint.uid||n.multiFactorUid,phoneSignInInfo:{recaptchaToken:u}},l(i,bct,f).then(function(n){return n.phoneResponseInfo.sessionInfo});var i,f}):l(r,yct,{phoneNumber:e,recaptchaToken:u})).then(function(n){return"function"==typeof t.reset&&t.reset(),n},function(n){throw"function"==typeof t.reset&&t.reset(),n;});default:throw new i("argument-error",'Only firebase.auth.ApplicationVerifiers with type="recaptcha" are currently supported.');}})};st(gi,{PROVIDER_ID:"phone"});st(gi,{PHONE_SIGN_IN_METHOD:"phone"});ri.prototype.getUid=function(){var n=[];return n.push(this.c),this.b&&n.push(this.b),this.f&&n.push(this.f),this.h&&n.push(this.h),n.join("-")};ri.prototype.S=function(){return this.h};ri.prototype.v=function(){return{type:this.c,eventId:this.b,urlResponse:this.g,sessionId:this.f,postBody:this.i,tenantId:this.h,error:this.a&&this.a.v()}};hh=null;h(hy,i);h(ke,i);ke.prototype.v=function(){var n={code:this.code,message:this.message},t;return this.email&&(n.email=this.email),this.phoneNumber&&(n.phoneNumber=this.phoneNumber),this.tenantId&&(n.tenantId=this.tenantId),t=this.credential&&this.credential.v(),t&&ht(n,t),n};ke.prototype.toJSON=function(){return this.v()};de.prototype.c=null;h(lh,de);lh.prototype.a=function(){var n=ktt(this);return n?new ActiveXObject(n):new XMLHttpRequest};lh.prototype.b=function(){var n={};return ktt(this)&&(n[0]=!0,n[1]=!0),n};sy=new lh;h(ah,de);ah.prototype.a=function(){var n=new XMLHttpRequest;if("withCredentials"in n)return n;if("undefined"!=typeof XDomainRequest)return new dtt;throw Error("Unsupported browser");};ah.prototype.b=function(){return{}};(t=dtt.prototype).open=function(n,t,i){if(null!=i&&!i)throw Error("Only async requests are supported.");this.a.open(n,t)};t.send=function(n){if(n){if("string"!=typeof n)throw Error("Only string data is supported");this.a.send(n)}else this.a.send()};t.abort=function(){this.a.abort()};t.setRequestHeader=function(){};t.getResponseHeader=function(n){return"content-type"==n.toLowerCase()?this.a.contentType:""};t.oc=function(){this.status=200;this.response=this.responseText=this.a.responseText;cy(this,4)};t.Pb=function(){this.status=500;this.response=this.responseText="";cy(this,4)};t.tc=function(){this.Pb()};t.pc=function(){this.status=200;cy(this,1)};t.getAllResponseHeaders=function(){return"content-type: "+this.a.contentType};ly.prototype.a=null;ly.prototype.reset=function(){delete this.a};ge.prototype.toString=function(){return this.name};var gtt=new ge("SEVERE",1e3),vy=new ge("WARNING",900),oht=new ge("CONFIG",700),sht=new ge("FINE",500);ay.prototype.log=function(n,t,i){if(n.value>=function n(t){return t.c?t.c:t.a?n(t.a):(yu("Root logger has no level set."),null)}(this).value)for(et(t)&&(t=t()),n=new ly(n,String(t),this.f),i&&(n.a=i),i=this;i;)i=i.a};vh={};yh=null;h(ph,de);ph.prototype.a=function(){return new py(this.f)};ph.prototype.b=(nit={},function(){return nit});h(py,ot);wh=0;(t=py.prototype).open=function(n,t){if(this.readyState!=wh)throw this.abort(),Error("Error reopening a connection");this.m=n;this.g=t;this.readyState=1;to(this)};t.send=function(n){if(1!=this.readyState)throw this.abort(),Error("need to call open() first. ");this.a=!0;var t={headers:this.i,method:this.m,credentials:void 0,cache:void 0};n&&(t.body=n);this.s.fetch(new Request(this.g,t)).then(this.sc.bind(this),this.Sa.bind(this))};t.abort=function(){this.response=this.responseText="";this.i=new Headers;this.status=0;this.c&&this.c.cancel("Request was aborted.");1<=this.readyState&&this.a&&4!=this.readyState&&(this.a=!1,no(this,!1));this.readyState=wh};t.sc=function(n){this.a&&(this.f=n,this.b||(this.b=n.headers,this.readyState=2,to(this)),this.a&&(this.readyState=3,to(this),this.a&&("arraybuffer"===this.responseType?n.arrayBuffer().then(this.qc.bind(this),this.Sa.bind(this)):void 0!==r.ReadableStream&&"body"in n?(this.response=this.responseText="",this.c=n.body.getReader(),this.l=new TextDecoder,tit(this)):n.text().then(this.rc.bind(this),this.Sa.bind(this)))))};t.nc=function(n){if(this.a){var t=this.l.decode(n.value?n.value:new Uint8Array(0),{stream:!n.done});t&&(this.response=this.responseText+=t);n.done?no(this,!0):to(this);3==this.readyState&&tit(this)}};t.rc=function(n){this.a&&(this.response=this.responseText=n,no(this,!0))};t.qc=function(n){this.a&&(this.response=n,no(this,!0))};t.Sa=function(n){var t=this.h;t&&t.log(vy,"Failed to fetch url "+this.g,n instanceof Error?n:Error(n));this.a&&no(this,!0)};t.setRequestHeader=function(n,t){this.i.append(n,t)};t.getResponseHeader=function(n){return this.b?this.b.get(n.toLowerCase())||"":((n=this.h)&&n.log(vy,"Attempting to get response header but no headers have been received for url: "+this.g,void 0),"")};t.getAllResponseHeaders=function(){var t,i,n;if(!this.b)return t=this.h,t&&t.log(vy,"Attempting to get all response headers but no headers have been received for url: "+this.g,void 0),"";for(t=[],i=this.b.entries(),n=i.next();!n.done;)n=n.value,t.push(n[0]+": "+n[1]),n=i.next();return t.join("\r\n")};h(io,ot);wy="";io.prototype.b=yy("goog.net.XhrIo");iit=/^https?$/i;rit=["POST","PUT"];(t=io.prototype).Ka=function(){void 0!==tl&&this.a&&(this.h="Timed out after "+this.g+"ms, aborting",kt(this.b,nr(this,this.h)),this.dispatchEvent("timeout"),this.abort(8))};t.abort=function(){this.a&&this.c&&(kt(this.b,nr(this,"Aborting")),this.c=!1,this.f=!0,this.a.abort(),this.f=!1,this.dispatchEvent("complete"),this.dispatchEvent("abort"),bh(this))};t.Ba=function(){this.a&&(this.c&&(this.c=!1,this.f=!0,this.a.abort(),this.f=!1),bh(this,!0));io.Za.Ba.call(this)};t.Sb=function(){this.wa||(this.O||this.i||this.f?eit(this):this.Hc())};t.Hc=function(){eit(this)};t.getResponse=function(){try{if(!this.a)return null;if("response"in this.a)return this.a.response;switch(this.m){case wy:case"text":return this.a.responseText;case"arraybuffer":if("mozResponseArrayBuffer"in this.a)return this.a.mozResponseArrayBuffer}var n=this.b;return n&&n.log(gtt,"Response type "+this.m+" is not supported on this browser",void 0),null}catch(n){return kt(this.b,"Can not get response: "+n.message),null}};fu.prototype.cancel=function(n){if(this.a)this.c instanceof fu&&this.c.cancel();else{if(this.b){var t=this.b;delete this.b;n?t.cancel(n):(t.l--,t.l<=0&&t.cancel())}this.w?this.w.call(this.s,this):this.u=!0;this.a||(n=new fo,dh(this),uo(this,!1,n))}};fu.prototype.m=function(n,t){this.i=!1;uo(this,n,t)};fu.prototype.then=function(n,t,i){var r,u,f=new c(function(n,t){r=n;u=t});return by(this,r,function(n){n instanceof fo?f.cancel():u(n)}),f.then(n,t,i)};fu.prototype.$goog_Thenable=!0;h(gh,lt);gh.prototype.message="Deferred has already fired";gh.prototype.name="AlreadyCalledError";h(fo,lt);fo.prototype.message="Deferred was canceled";fo.prototype.name="CanceledError";cit.prototype.c=function(){throw delete eo[this.a],this.b;};eo={};lit=0;ait=1;h(dy,lt);h(tc,de);tc.prototype.a=function(){return new this.f};tc.prototype.b=function(){return{}};var gy,fi="idToken",aht=new ur(3e4,6e4),vht={"Content-Type":"application/x-www-form-urlencoded"},yht=new ur(3e4,6e4),pht={"Content-Type":"application/json"};ui.prototype.S=function(){return this.b};ui.prototype.w=function(n,t,u,f,e,o){var s,h;if(ii()&&(void 0===r.fetch||void 0===r.Headers||void 0===r.Request))throw new i("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.");s=new io(this.f);o&&(s.g=Math.max(0,o),h=setTimeout(function(){s.dispatchEvent("timeout")},o));eg(s,"complete",function(){h&&clearTimeout(h);var n=null;try{n=JSON.parse(function(n){try{return n.a?n.a.responseText:""}catch(t){return kt(n.b,"Can not get responseText: "+t.message),""}}(this))||null}catch(i){n=null}t&&t(n)});va(s,"ready",function(){h&&clearTimeout(h);kd(this)});va(s,"timeout",function(){h&&clearTimeout(h);kd(this);t&&t(null)});hht(s,n,u,f,e)};wit=new oi(fe,"https://apis.google.com/js/client.js?onload=%{onload}");np="__fcb"+Math.floor(1e6*Math.random()).toString();ui.prototype.s=function(n,t,i,r,u){var f=this;gy.then(function(){window.gapi.client.setApiKey(f.c);var e=window.gapi.auth.getToken();window.gapi.auth.setToken(null);window.gapi.client.request({path:n,method:i,body:r,headers:u,authType:"none",callback:function(n){window.gapi.auth.setToken(e);t&&t(n)}})}).o(function(n){t&&t({error:{message:n&&n.message||"CORS_UNSUPPORTED"}})})};ui.prototype.vb=function(){return l(this,pct,{})};ui.prototype.xb=function(n,t){return l(this,nrt,{idToken:n,email:t})};ui.prototype.yb=function(n,t){return l(this,trt,{idToken:n,password:t})};kit={displayName:"DISPLAY_NAME",photoUrl:"PHOTO_URL"};(t=ui.prototype).zb=function(n,t){var i={idToken:n},r=[];return ak(kit,function(n,u){var f=t[u];null===f?r.push(n):u in t&&(i[u]=f)}),r.length&&(i.deleteAttribute=r),l(this,nrt,i)};t.rb=function(n,t){return ht(n={requestType:"PASSWORD_RESET",email:n},t),l(this,cct,n)};t.sb=function(n,t){return ht(n={requestType:"EMAIL_SIGNIN",email:n},t),l(this,oct,n)};t.qb=function(n,t){return ht(n={requestType:"VERIFY_EMAIL",idToken:n},t),l(this,sct,n)};t.Ab=function(n,t,i){return ht(n={requestType:"VERIFY_AND_CHANGE_EMAIL",idToken:n,newEmail:t},i),l(this,hct,n)};t.cb=function(n){return l(this,tlt,n)};t.jb=function(n,t){return l(this,vct,{oobCode:n,newPassword:t})};t.Pa=function(n){return l(this,kht,{oobCode:n})};t.fb=function(n){return l(this,bht,{oobCode:n})};var bht={endpoint:"setAccountInfo",A:op,Y:"email",C:!0},kht={endpoint:"resetPassword",A:op,G:function(n){var t=n.requestType;if(!t||!n.email&&"EMAIL_SIGNIN"!=t&&"VERIFY_AND_CHANGE_EMAIL"!=t)throw new i("internal-error");},C:!0},dht={endpoint:"signupNewUser",A:function(n){if(eu(n),!n.password)throw new i("weak-password");},G:ct,U:!0,C:!0},ght={endpoint:"createAuthUri",C:!0},nct={endpoint:"deleteAccount",M:["idToken"]},tct={endpoint:"setAccountInfo",M:["idToken","deleteProvider"],A:function(n){if("array"!=lu(n.deleteProvider))throw new i("internal-error");}},ict={endpoint:"emailLinkSignin",M:["email","oobCode"],A:eu,G:ct,U:!0,C:!0},rct={endpoint:"emailLinkSignin",M:["idToken","email","oobCode"],A:eu,G:ct,U:!0},uct={endpoint:"accounts/mfaEnrollment:finalize",M:["idToken","phoneVerificationInfo"],A:dit,G:ct,C:!0,La:!0},fct={endpoint:"accounts/mfaSignIn:finalize",M:["mfaPendingCredential","phoneVerificationInfo"],A:dit,G:ct,C:!0,La:!0},ect={endpoint:"getAccountInfo"},oct={endpoint:"getOobConfirmationCode",M:["requestType"],A:function(n){if("EMAIL_SIGNIN"!=n.requestType)throw new i("internal-error");eu(n)},Y:"email",C:!0},sct={endpoint:"getOobConfirmationCode",M:["idToken","requestType"],A:function(n){if("VERIFY_EMAIL"!=n.requestType)throw new i("internal-error");},Y:"email",C:!0},hct={endpoint:"getOobConfirmationCode",M:["idToken","newEmail","requestType"],A:function(n){if("VERIFY_AND_CHANGE_EMAIL"!=n.requestType)throw new i("internal-error");},Y:"email",C:!0},cct={endpoint:"getOobConfirmationCode",M:["requestType"],A:function(n){if("PASSWORD_RESET"!=n.requestType)throw new i("internal-error");eu(n)},Y:"email",C:!0},lct={hb:!0,endpoint:"getProjectConfig",Rb:"GET"},act={hb:!0,endpoint:"getRecaptchaParam",Rb:"GET",G:function(n){if(!n.recaptchaSiteKey)throw new i("internal-error");}},vct={endpoint:"resetPassword",A:op,Y:"email",C:!0},yct={endpoint:"sendVerificationCode",M:["phoneNumber","recaptchaToken"],Y:"sessionInfo",C:!0},nrt={endpoint:"setAccountInfo",M:["idToken"],A:bit,U:!0},trt={endpoint:"setAccountInfo",M:["idToken"],A:function(n){if(bit(n),!n.password)throw new i("weak-password");},G:ct,U:!0},pct={endpoint:"signupNewUser",G:ct,U:!0,C:!0},wct={endpoint:"accounts/mfaEnrollment:start",M:["idToken","phoneEnrollmentInfo"],A:function(n){if(!n.phoneEnrollmentInfo)throw new i("internal-error");if(!n.phoneEnrollmentInfo.phoneNumber)throw new i("missing-phone-number");if(!n.phoneEnrollmentInfo.recaptchaToken)throw new i("missing-app-credential");},G:function(n){if(!n.phoneSessionInfo||!n.phoneSessionInfo.sessionInfo)throw new i("internal-error");},C:!0,La:!0},bct={endpoint:"accounts/mfaSignIn:start",M:["mfaPendingCredential","mfaEnrollmentId","phoneSignInInfo"],A:function(n){if(!n.phoneSignInInfo||!n.phoneSignInInfo.recaptchaToken)throw new i("missing-app-credential");},G:function(n){if(!n.phoneResponseInfo||!n.phoneResponseInfo.sessionInfo)throw new i("internal-error");},C:!0,La:!0},kct={endpoint:"verifyAssertion",A:ip,Wa:rp,G:git,U:!0,C:!0},dct={endpoint:"verifyAssertion",A:ip,Wa:rp,G:function(n){if(n.errorMessage&&"USER_NOT_FOUND"==n.errorMessage)throw new i("user-not-found");if(n.errorMessage)throw rrt(n.errorMessage);ct(n)},U:!0,C:!0},gct={endpoint:"verifyAssertion",A:function(n){if(ip(n),!n.idToken)throw new i("internal-error");},Wa:rp,G:git,U:!0},nlt={endpoint:"verifyCustomToken",A:function(n){if(!n.token)throw new i("invalid-custom-token");},G:ct,U:!0,C:!0},irt={endpoint:"verifyPassword",A:function(n){if(eu(n),!n.password)throw new i("wrong-password");},G:ct,U:!0,C:!0},tlt={endpoint:"verifyPhoneNumber",A:tp,G:ct,C:!0},ilt={endpoint:"verifyPhoneNumber",A:function(n){if(!n.idToken)throw new i("internal-error");tp(n)},G:function(n){if(n.temporaryProof)throw n.code="credential-already-in-use",ch(n);ct(n)}},rlt={Eb:{USER_NOT_FOUND:"user-not-found"},endpoint:"verifyPhoneNumber",A:tp,G:ct,C:!0},ult={endpoint:"accounts/mfaEnrollment:withdraw",M:["idToken","mfaEnrollmentId"],G:function(n){if(!!n[fi]^!!n.refreshToken)throw new i("internal-error");},C:!0,La:!0};var elt=new oi(fe,"https://apis.google.com/js/api.js?onload=%{onload}"),olt=new ur(3e4,6e4),slt=new ur(5e3,15e3),hp=null;urt.prototype.toString=function(){return this.f?d(this.a,"v",this.f):si(this.a.a,"v"),this.b?d(this.a,"eid",this.b):si(this.a.a,"eid"),this.c.length?d(this.a,"fw",this.c.join(",")):si(this.a.a,"fw"),this.a.toString()};cp.prototype.ub=function(n){return this.h=n,this};cp.prototype.toString=function(){var t=hg(this.s,"/__/auth/handler"),r,i,f,e,o,u;if(d(t,"apiKey",this.m),d(t,"appName",this.c),d(t,"authType",this.u),this.a.isOAuthProvider){r=this.a;try{i=n.app(this.c).auth().ja()}catch(t){i=null}for(f in r.kb=i,d(t,"providerId",this.a.providerId),i=rn((r=this.a).Fb))i[f]=i[f].toString();for(f=r.Oc,i=tr(i),e=0;e<f.length;e++)o=f[e],o in i&&delete i[o];r.lb&&r.kb&&!i[r.lb]&&(i[r.lb]=r.kb);lr(i)||d(t,"customParameters",ae(i))}if("function"==typeof this.a.Nb&&(r=this.a.Nb()).length&&d(t,"scopes",r.join(",")),this.l?d(t,"redirectUrl",this.l):si(t.a,"redirectUrl"),this.g?d(t,"eventId",this.g):si(t.a,"eventId"),this.i?d(t,"v",this.i):si(t.a,"v"),this.b)for(u in this.b)this.b.hasOwnProperty(u)&&!wt(t,u)&&d(t,u,this.b[u]);return this.h?d(t,"tid",this.h):si(t.a,"tid"),this.f?d(t,"eid",this.f):si(t.a,"eid"),(u=lp(this.c)).length&&d(t,"fw",u.join(",")),t.toString()};(t=frt.prototype).Lb=function(n,t,r){var f=new i("popup-closed-by-user"),e=new i("web-storage-unsupported"),o=this,u=!1;return this.ka().then(function(){var i,r;r={type:"webStorageSupport"};ort(i=o).then(function(){return n=i.i,t=r,n.nb.then(function(){return new c(function(i){n.a.send(t.type,t,i,p("gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER"))})});var n,t}).then(function(n){if(n&&n.length&&void 0!==n[0].webStorageSupport)return n[0].webStorageSupport;throw Error();}).then(function(i){i||(n&&kr(n),t(e),u=!0)})}).o(function(){}).then(function(){if(!u)return t=n,new c(function(n){return function i(){gu(2e3).then(function(){if(t&&!t.closed)return i();n()})}()});var t}).then(function(){if(!u)return gu(r).then(function(){t(f)})})};t.Ub=function(){var n=ft();return!le(n)&&!un(n)};t.Qb=function(){return!1};t.Jb=function(n,t,r,u,f,o,s,h){if(!n)return y(new i("popup-blocked"));if(s&&!le())return this.ka().o(function(t){kr(n);f(t)}),u(),e();this.a||(this.a=ert(srt(this)));var c=this;return this.a.then(function(){var t=c.ka().o(function(t){throw kr(n),f(t),t;});return u(),t}).then(function(){oy(r);s||bg(oo(c.u,c.f,c.b,t,r,null,o,c.c,void 0,c.h,h),n)}).o(function(n){throw"auth/network-request-failed"==n.code&&(c.a=null),n;})};t.Kb=function(n,t,i,r){this.a||(this.a=ert(srt(this)));var u=this;return this.a.then(function(){oy(t);bg(oo(u.u,u.f,u.b,n,t,ce(),i,u.c,void 0,u.h,r))}).o(function(n){throw"auth/network-request-failed"==n.code&&(u.a=null),n;})};t.ka=function(){var n=this;return ort(this).then(function(){return n.i.nb}).o(function(){throw n.a=null,new i("network-request-failed");})};t.Xb=function(){return!0};t.Ca=function(n){this.g.push(n)};t.Qa=function(n){dt(this.g,function(t){return t==n})};(t=hrt.prototype).get=function(n){return e(this.a.getItem(n)).then(function(n){return n&&ef(n)})};t.set=function(n,t){return e(this.a.setItem(n,ae(t)))};t.T=function(n){return e(this.a.removeItem(n))};t.ba=function(){};t.ha=function(){};vp=[];crt.prototype.c=function(n){var t=n.data.eventType,u=n.data.eventId,i=this.a[t],r;i&&0<i.length&&(n.ports[0].postMessage({status:"ack",eventId:u,eventType:t,response:null}),r=[],w(i,function(t){r.push(e().then(function(){return t(n.origin,n.data.data)}))}),cd(r).then(function(i){var r=[];w(i,function(n){r.push({fulfilled:n.Mb,value:n.value,reason:n.reason?n.reason.message:void 0})});w(r,function(n){for(var t in n)void 0===n[t]&&delete n[t]});n.ports[0].postMessage({status:"done",eventId:u,eventType:t,response:r})}))};art.prototype.postMessage=function(n,t){this.a.postMessage(n,t)};vrt.prototype.close=function(){for(;0<this.a.length;)yp(this,this.a[0]);this.b=!0};(t=prt.prototype).set=function(n,t){var r,u=!1,i=this;return ic(this).then(function(t){return af((t=so(ho(r=t,!0))).get(n))}).then(function(f){var e=so(ho(r,!0));return f?(f.value=t,af(e.put(f))):(i.b++,u=!0,(f={}).fbase_key=n,f.value=t,af(e.add(f)))}).then(function(){return i.c[n]=t,brt(i,n)}).ma(function(){u&&i.b--})};t.get=function(n){return ic(this).then(function(t){return af(so(ho(t,!1)).get(n))}).then(function(n){return n&&n.value})};t.T=function(n){var i=!1,t=this;return ic(this).then(function(r){return i=!0,t.b++,af(so(ho(r,!0)).delete(n))}).then(function(){return delete t.c[n],brt(t,n)}).ma(function(){i&&t.b--})};t.ba=function(n){var t;0==this.a.length&&(drt(t=this),function i(){t.f=setTimeout(function(){t.i=krt(t).then(function(n){0<n.length&&w(t.a,function(t){t(n)})}).then(function(){i()}).o(function(n){"STOP_EVENT"!=n.message&&i()})},800)}());this.a.push(n)};t.ha=function(n){dt(this.a,function(t){return t==n});0==this.a.length&&drt(this)};(t=grt.prototype).get=function(n){return this.b.then(function(t){return t.get(n)})};t.set=function(n,t){return this.b.then(function(i){return i.set(n,t)})};t.T=function(n){return this.b.then(function(t){return t.T(n)})};t.ba=function(n){this.a.push(n)};t.ha=function(n){dt(this.a,function(t){return t==n})};(t=co.prototype).get=function(n){return e(this.a[n])};t.set=function(n,t){return this.a[n]=t,e()};t.T=function(n){return delete this.a[n],e()};t.ba=function(){};t.ha=function(){};(t=rc.prototype).get=function(n){var t=this;return e().then(function(){return ef(t.a.getItem(n))})};t.set=function(n,t){var i=this;return e().then(function(){var r=ae(t);null===r?i.T(n):i.a.setItem(n,r)})};t.T=function(n){var t=this;return e().then(function(){t.a.removeItem(n)})};t.ba=function(n){r.window&&ti(r.window,"storage",n)};t.ha=function(n){r.window&&pt(r.window,"storage",n)};(t=wp.prototype).get=function(){return e(null)};t.set=function(){return e()};t.T=function(){return e()};t.ba=function(){};t.ha=function(){};(t=bp.prototype).get=function(n){var t=this;return e().then(function(){return ef(t.a.getItem(n))})};t.set=function(n,t){var i=this;return e().then(function(){var r=ae(t);null===r?i.T(n):i.a.setItem(n,r)})};t.T=function(n){var t=this;return e().then(function(){t.a.removeItem(n)})};t.ba=function(){};t.ha=function(){};var iut,rut,clt={F:rc,$a:bp},llt={F:rc,$a:bp},alt={F:hrt,$a:wp},vlt={F:rc,$a:wp},vf={od:"local",NONE:"none",qd:"session"};(t=uut.prototype).get=function(n,t){return ou(this,n.F).get(yf(n,t))};t.set=function(n,t,i){var r=yf(n,i),f=this,u=ou(this,n.F);return u.set(r,t).then(function(){return u.get(r)}).then(function(t){"local"==n.F&&(f.b[r]=t)})};t.addListener=function(n,t,i){var u;n=yf(n,t);this.l&&(this.b[n]=r.localStorage.getItem(n));lr(this.a)&&(ou(this,"local").ba(this.f),this.h||(nv()||!en())&&r.indexedDB||!this.l||(kp(u=this),u.c=setInterval(function(){var t,n,i;for(t in u.a)n=r.localStorage.getItem(t),i=u.b[t],n!=i&&(u.b[t]=n,n=new pr({type:"storage",key:t,target:window,oldValue:i,newValue:n,a:!0}),u.Vb(n))},1e3)));this.a[n]||(this.a[n]=[]);this.a[n].push(i)};t.removeListener=function(n,t,i){n=yf(n,t);this.a[n]&&(dt(this.a[n],function(n){return n==i}),0==this.a[n].length&&delete this.a[n]);lr(this.a)&&(ou(this,"local").ha(this.f),kp(this))};t.Vb=function(n){var t,i,u,e,f;if(n&&n.f){if(t=n.a.key,null==t)for(i in this.a)u=this.b[i],void 0===u&&(u=null),e=r.localStorage.getItem(i),e!==u&&(this.b[i]=e,this.ib(i));else if(0==t.indexOf("firebase:")&&this.a[t]){if(void 0!==n.a.a?ou(this,"local").ha(this.f):kp(this),this.m)if(i=r.localStorage.getItem(t),(u=n.a.newValue)!==i)null!==u?r.localStorage.setItem(t,u):r.localStorage.removeItem(t);else if(this.b[t]===u&&void 0===n.a.a)return;f=this;i=function(){void 0===n.a.a&&f.b[t]===r.localStorage.getItem(t)||(f.b[t]=r.localStorage.getItem(t),f.ib(t))};ni&&wi&&10==wi&&r.localStorage.getItem(t)!==n.a.newValue&&n.a.newValue!==n.a.oldValue?setTimeout(i,10):i()}}else w(n,o(this.ib,this))};t.ib=function(n){this.a[n]&&w(this.a[n],function(n){n()})};uc={name:"authEvent",F:"local"};h(fc,function(){this.b=-1});for(var fut=64,wlt=fut-1,eut=[],gp=0;gp<wlt;gp++)eut[gp]=0;nw=sl(128,eut);fc.prototype.reset=function(){this.g=this.c=0;this.a=r.Int32Array?new Int32Array(this.h):cr(this.h)};rw=[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];h(out,fc);sut=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225];(t=hut.prototype).ka=function(){return this.Ga?this.Ga:this.Ga=(iv(void 0)?tv().then(function(){return new c(function(n,t){var i=r.document,u=setTimeout(function(){t(Error("Cordova framework is not ready."))},1e3);i.addEventListener("deviceready",function(){clearTimeout(u);n()},!1)})}):y(Error("Cordova must run in an Android or iOS file scheme."))).then(function(){if("function"!=typeof p("universalLinks.subscribe",r))throw ec("cordova-universal-links-plugin-fix is not installed");if(void 0===p("BuildInfo.packageName",r))throw ec("cordova-plugin-buildinfo is not installed");if("function"!=typeof p("cordova.plugins.browsertab.openUrl",r))throw ec("cordova-plugin-browsertab is not installed");if("function"!=typeof p("cordova.InAppBrowser.open",r))throw ec("cordova-plugin-inappbrowser is not installed");},function(){throw new i("cordova-not-ready");})};t.Lb=function(n,t){return t(new i("operation-not-supported-in-this-environment")),e()};t.Jb=function(){return y(new i("operation-not-supported-in-this-environment"))};t.Xb=function(){return!1};t.Ub=function(){return!0};t.Qb=function(){return!0};t.Kb=function(n,t,u,f){if(this.c)return y(new i("redirect-operation-pending"));var o=this,h=r.document,l=null,a=null,s=null,v=null;return this.c=e().then(function(){return oy(t),lut(o)}).then(function(){return function(n,t,u,f,e){var s=function(){for(var n=20,t=[];0<n;)t.push("1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".charAt(Math.floor(62*Math.random()))),n--;return t.join("")}(),a=new ri(t,f,null,s,new i("no-auth-event"),null,e),h=p("BuildInfo.packageName",r),c,o,l;if("string"!=typeof h)throw new i("invalid-cordova-configuration");if(c=p("BuildInfo.displayName",r),o={},ft().toLowerCase().match(/iphone|ipad|ipod/))o.ibi=h;else{if(!ft().toLowerCase().match(/android/))return y(new i("operation-not-supported-in-this-environment"));o.apn=h}return c&&(o.appDisplayName=c),s=blt(s),o.sessionId=s,l=oo(n.u,n.i,n.l,t,u,null,f,n.m,o,n.s,e),n.ka().then(function(){var t=n.h;return n.w.a.set(uc,a.v(),t)}).then(function(){var u=p("cordova.plugins.browsertab.isAvailable",r),t;if("function"!=typeof u)throw new i("invalid-cordova-configuration");t=null;u(function(u){if(u){if("function"!=typeof(t=p("cordova.plugins.browsertab.openUrl",r)))throw new i("invalid-cordova-configuration");t(l)}else{if("function"!=typeof(t=p("cordova.InAppBrowser.open",r)))throw new i("invalid-cordova-configuration");u=ft();n.a=t(l,u.match(/(iPad|iPhone|iPod).*OS 7_\d/i)||u.match(/(iPad|iPhone|iPod).*OS 8_\d/i)?"_blank":"_system","location=yes")}})})}(o,n,t,u,f)}).then(function(){return new c(function(n,t){a=function(){var t=p("cordova.plugins.browsertab.close",r);return n(),"function"==typeof t&&t(),o.a&&"function"==typeof o.a.close&&(o.a.close(),o.a=null),!1};o.Ca(a);s=function(){l=l||gu(2e3).then(function(){t(new i("redirect-cancelled-by-user"))})};v=function(){ov()&&s()};h.addEventListener("resume",s,!1);ft().toLowerCase().match(/android/)||h.addEventListener("visibilitychange",v,!1)}).o(function(n){return uw(o).then(function(){throw n;})})}).ma(function(){s&&h.removeEventListener("resume",s,!1);v&&h.removeEventListener("visibilitychange",v,!1);l&&l.cancel();a&&o.Qa(a);o.c=null})};t.Ca=function(n){this.b.push(n);lut(this).o(function(t){"auth/invalid-cordova-configuration"===t.code&&(t=new ri("unknown",null,null,null,new i("no-auth-event")),n(t))})};t.Qa=function(n){dt(this.b,function(t){return t==n})};oc={name:"pendingRedirect",F:"session"};sc.prototype.reset=function(){this.f=!1;this.a.Qa(this.l);this.a=aut(this.D,this.u,this.m);this.i={}};sc.prototype.s=function(n){var t,r,u;if(!n)throw new i("invalid-auth-event");if(6e5<=vu()-this.w&&(this.i={},this.w=0),n&&n.getUid()&&this.i.hasOwnProperty(n.getUid()))return!1;for(t=!1,r=0;r<this.h.length;r++)if(u=this.h[r],u.Cb(n.c,n.b)){(t=this.c[n.c])&&(t.h(n,u),n&&(n.f||n.b)&&(this.i[n.getUid()]=!0,this.w=vu()));t=!0;break}return tft(this.b),t};wut=new ur(2e3,1e4);but=new ur(3e4,6e4);sc.prototype.pa=function(){return this.b.pa()};hc={};cc.prototype.reset=function(){this.b=null;this.a&&(this.a.cancel(),this.a=null)};cc.prototype.h=function(n,t){if(n){this.reset();this.g=!0;var r=n.c,o=n.b,u=n.a&&"auth/web-storage-unsupported"==n.a.code,f=n.a&&"auth/operation-not-supported-in-this-environment"==n.a.code;this.i=!(!u&&!f);"unknown"!=r||u||f?n.a?(su(this,!0,null,n.a),e()):t.Da(r,o)?function(n,t,i){i=i.Da(t.c,t.b);var u=t.g,f=t.f,e=t.i,o=t.S(),r=!!t.c.match(/Redirect$/);i(u,f,o,e).then(function(t){su(n,r,t,null)}).o(function(t){su(n,r,null,t)})}(this,n,t):y(new i("invalid-auth-event")):(su(this,!1,null,null),e())}else y(new i("invalid-auth-event"))};cc.prototype.pa=function(){var n=this;return new c(function(t,r){var u,f;n.b?n.b().then(t,r):(n.f.push(t),n.c.push(r),u=n,f=new i("timeout"),u.a&&u.a.cancel(),u.a=gu(but.get()).then(function(){u.b||(u.g=!0,su(u,!0,null,f))}))})};rft.prototype.h=function(n,t){var s,h,r,u,f,o;n?(s=n.c,h=n.b,n.a?(t.la(n.c,null,n.a,n.b),e()):t.Da(s,h)?(u=t,f=(r=n).b,o=r.c,u.Da(o,f)(r.g,r.f,r.S(),r.i).then(function(n){u.la(o,n,null,f)}).o(function(n){u.la(o,null,n,f)})):y(new i("invalid-auth-event"))):y(new i("invalid-auth-event"))};sw.prototype.confirm=function(n){return n=ptt(this.verificationId,n),this.a(n)};lw="mfaInfo";aw="mfaPendingCredential";cw.prototype.Pc=function(n){var t=this;return n.ob(this.a.b,this.c).then(function(n){var i=tr(t.f);return delete i[lw],delete i[aw],ht(i,n),t.g(i)})};h(vw,i);eft.prototype.ob=function(n,t,i){return t.type==sf?(e=this,o=n,r=i,t.Fa().then(function(n){return n={idToken:n},void 0!==r&&(n.displayName=r),ht(n,{phoneVerificationInfo:be(e.a)}),l(o,uct,n)})):(u=this,f=n,t.Fa().then(function(n){return ht(n={mfaPendingCredential:n},{phoneVerificationInfo:be(u.a)}),l(f,fct,n)}));var u,f,e,o,r};h(yw,eft);h(oft,yw);h(wf,yt);(t=pw.prototype).wc=function(n){var i,t;ac(this,(i=n.ed,t=[],w(i.mfaInfo||[],function(n){(n=vv(n))&&t.push(n)}),t))};t.Ob=function(){return this.a.I().then(function(n){return new sh(n,null)})};t.dc=function(n,t){var i=this,r=this.a.a;return this.Ob().then(function(i){return n.ob(r,i,t)}).then(function(n){return li(i.a,n),i.a.reload()})};t.$c=function(n){var t=this,i="string"==typeof n?n:n.uid,r=this.a.a;return this.a.I().then(function(n){return l(r,ult,{idToken:n,mfaEnrollmentId:i})}).then(function(n){var r=tot(t.b,function(n){return n.uid!=i});return ac(t,r),li(t.a,n),t.a.reload().o(function(n){if("auth/user-token-expired"!=n.code)throw n;})})};t.v=function(){return{multiFactor:{enrolledFactors:ko(this.b,function(n){return n.v()})}}};ww.prototype.start=function(){this.a=this.c,function n(t,i){t.stop();t.b=gu(glt(t,i)).then(function(){return n=r.document,t=null,ov()||!n?e():new c(function(i){t=function(){ov()&&(n.removeEventListener("visibilitychange",t,!1),i())};n.addEventListener("visibilitychange",t,!1)}).o(function(i){throw n.removeEventListener("visibilitychange",t,!1),i;});var n,t}).then(function(){return t.h()}).then(function(){n(t,!0)}).o(function(i){t.i(i)&&n(t,!1)})}(this,!0)};ww.prototype.stop=function(){this.b&&(this.b.cancel(),this.b=null)};bw.prototype.v=function(){return{apiKey:this.c.c,refreshToken:this.a,accessToken:this.b&&this.b.toString(),expirationTime:kw(this)}};bw.prototype.getToken=function(n){return n=!!n,this.b&&!this.a?y(new i("user-token-expired")):n||!this.b||vu()>kw(this)-3e4?this.a?nat(this,{grant_type:"refresh_token",refresh_token:this.a}):e(null):e({accessToken:this.b.toString(),refreshToken:this.a})};vc.prototype.v=function(){return{lastLoginAt:this.b,createdAt:this.a}};h(vt,ot);vt.prototype.va=function(n){this.oa=n;vit(this.a,n)};vt.prototype.ja=function(){return this.oa};vt.prototype.Ea=function(){return cr(this.W)};vt.prototype.Ma=function(){this.B.b&&(this.B.stop(),this.B.start())};u(vt.prototype,"providerId","firebase");(t=vt.prototype).reload=function(){var n=this;return rt(this,rb(this).then(function(){return eb(n).then(function(){return hu(n)}).then(lft)}))};t.mc=function(n){return this.I(n).then(function(n){return new dlt(n)})};t.I=function(n){var t=this;return rt(this,rb(this).then(function(){return t.b.getToken(n)}).then(function(n){if(!n)throw new i("internal-error");return n.accessToken!=t.xa&&(ib(t,n.accessToken),t.dispatchEvent(new wf("tokenChanged"))),sr(t,"refreshToken",n.refreshToken),n.accessToken}))};t.Ic=function(n){var u,t,r;if(!(n=n.users)||!n.length)throw new i("internal-error");for(cft(this,{uid:(n=n[0]).localId,displayName:n.displayName,photoURL:n.photoUrl,email:n.email,emailVerified:!!n.emailVerified,phoneNumber:n.phoneNumber,lastLoginAt:n.lastLoginAt,createdAt:n.createdAt,tenantId:n.tenantId}),u=(r=(r=n).providerUserInfo)&&r.length?ko(r,function(n){return new tat(n.rawId,n.providerId,n.email,n.displayName,n.photoUrl,n.phoneNumber)}):[],t=0;t<u.length;t++)fb(this,u[t]);sr(this,"isAnonymous",!(this.email&&n.passwordHash||this.providerData&&this.providerData.length));this.dispatchEvent(new wf("userReloaded",{ed:n}))};t.Jc=function(n){return cv("firebase.User.prototype.reauthenticateAndRetrieveDataWithCredential is deprecated. Please use firebase.User.prototype.reauthenticateWithCredential instead."),this.pb(n)};t.pb=function(n){var t=this,i=null;return rt(this,n.c(this.a,this.uid).then(function(n){return li(t,n),i=yo(t,n,"reauthenticate"),t.h=null,t.reload()}).then(function(){return i}),!0)};t.Ac=function(n){return cv("firebase.User.prototype.linkAndRetrieveDataWithCredential is deprecated. Please use firebase.User.prototype.linkWithCredential instead."),this.mb(n)};t.mb=function(n){var t=this,i=null;return rt(this,pc(this,n.providerId).then(function(){return t.I()}).then(function(i){return n.b(t.a,i)}).then(function(n){return i=yo(t,n,"link"),vft(t,n)}).then(function(){return i}))};t.Bc=function(n,t){var i=this;return rt(this,pc(this,"phone").then(function(){return hw(nb(i),n,t,o(i.mb,i))}))};t.Kc=function(n,t){var i=this;return rt(this,e().then(function(){return hw(nb(i),n,t,o(i.pb,i))}),!0)};t.xb=function(n){var t=this;return rt(this,this.I().then(function(i){return t.a.xb(i,n)}).then(function(n){return li(t,n),t.reload()}))};t.cd=function(n){var t=this;return rt(this,this.I().then(function(i){return n.b(t.a,i)}).then(function(n){return li(t,n),t.reload()}))};t.yb=function(n){var t=this;return rt(this,this.I().then(function(i){return t.a.yb(i,n)}).then(function(n){return li(t,n),t.reload()}))};t.zb=function(n){if(void 0===n.displayName&&void 0===n.photoURL)return rb(this);var t=this;return rt(this,this.I().then(function(i){return t.a.zb(i,{displayName:n.displayName,photoUrl:n.photoURL})}).then(function(n){return li(t,n),sr(t,"displayName",n.displayName||null),sr(t,"photoURL",n.photoUrl||null),w(t.providerData,function(n){"password"===n.providerId&&(u(n,"displayName",t.displayName),u(n,"photoURL",t.photoURL))}),hu(t)}).then(lft))};t.ad=function(n){var t=this;return rt(this,eb(this).then(function(r){return pi(ub(t),n)?l(t.a,tct,{idToken:r,deleteProvider:[n]}).then(function(n){var i={};return w(n.providerUserInfo||[],function(n){i[n.providerId]=!0}),w(ub(t),function(n){i[n]||aft(t,n)}),i[gi.PROVIDER_ID]||u(t,"phoneNumber",null),hu(t)}):hu(t).then(function(){throw new i("no-such-provider");})}))};t.delete=function(){var n=this;return rt(this,this.I().then(function(t){return l(n.a,nct,{idToken:t})}).then(function(){n.dispatchEvent(new wf("userDeleted"))})).then(function(){for(var t=0;t<n.N.length;t++)n.N[t].cancel("app-deleted");dw(n,null);gw(n,null);n.N=[];n.D=!0;tb(n);u(n,"refreshToken",null);n.i&&put(n.i,n)})};t.Cb=function(n,t){return!!("linkViaPopup"==n&&(this.g||null)==t&&this.f||"reauthViaPopup"==n&&(this.g||null)==t&&this.f||"linkViaRedirect"==n&&(this.fa||null)==t||"reauthViaRedirect"==n&&(this.fa||null)==t)};t.la=function(n,t,i,r){"linkViaPopup"!=n&&"reauthViaPopup"!=n||r!=(this.g||null)||(i&&this.w?this.w(i):t&&!i&&this.f&&this.f(t),this.c&&(this.c.cancel(),this.c=null),delete this.f,delete this.w)};t.Da=function(n,t){return"linkViaPopup"==n&&t==(this.g||null)?o(this.Hb,this):"reauthViaPopup"==n&&t==(this.g||null)?o(this.Ib,this):"linkViaRedirect"==n&&(this.fa||null)==t?o(this.Hb,this):"reauthViaRedirect"==n&&(this.fa||null)==t?o(this.Ib,this):null};t.Cc=function(n){var t=this;return yft(this,"linkViaPopup",n,function(){return pc(t,n.providerId).then(function(){return hu(t)})},!1)};t.Lc=function(n){return yft(this,"reauthViaPopup",n,function(){return e()},!0)};t.Dc=function(n){var t=this;return pft(this,"linkViaRedirect",n,function(){return pc(t,n.providerId)},!1)};t.Mc=function(n){return pft(this,"reauthViaRedirect",n,function(){return e()},!0)};t.Hb=function(n,t,i,r){var u=this,f;return this.c&&(this.c.cancel(),this.c=null),f=null,i=this.I().then(function(i){return fp(u.a,{requestUri:n,postBody:r,sessionId:t,idToken:i})}).then(function(n){return f=yo(u,n,"link"),vft(u,n)}).then(function(){return f}),rt(this,i)};t.Ib=function(n,t,i,r){var u=this,f;return this.c&&(this.c.cancel(),this.c=null),f=null,rt(this,e().then(function(){return cf(ep(u.a,{requestUri:n,sessionId:t,postBody:r,tenantId:i}),u.uid)}).then(function(n){return f=yo(u,n,"reauthenticate"),li(u,n),u.h=null,u.reload()}).then(function(){return f}),!0)};t.qb=function(n){var t=this,i=null;return rt(this,this.I().then(function(t){return i=t,void 0===n||lr(n)?{}:rh(new ih(n))}).then(function(n){return t.a.qb(i,n)}).then(function(n){if(t.email!=n)return t.reload()}).then(function(){}))};t.Ab=function(n,t){var i=this,r=null;return rt(this,this.I().then(function(n){return r=n,void 0===t||lr(t)?{}:rh(new ih(t))}).then(function(t){return i.a.Ab(r,n,t)}).then(function(n){if(i.email!=n)return i.reload()}).then(function(){}))};t.hc=function(n){var i=null,t=this;return rt(this,n=cf(e(n),t.uid).then(function(n){return i=yo(t,n,"reauthenticate"),li(t,n),t.h=null,t.reload()}).then(function(){return i}),!0)};t.toJSON=function(){return this.v()};t.v=function(){var n={uid:this.uid,displayName:this.displayName,photoURL:this.photoURL,email:this.email,emailVerified:this.emailVerified,phoneNumber:this.phoneNumber,isAnonymous:this.isAnonymous,tenantId:this.tenantId,providerData:[],apiKey:this.l,appName:this.m,authDomain:this.s,stsTokenManager:this.b.v(),redirectEventId:this.fa||null};return this.metadata&&ht(n,this.metadata.v()),w(this.providerData,function(t){n.providerData.push(function(n){var t,i={};for(t in n)n.hasOwnProperty(t)&&(i[t]=n[t]);return i}(t))}),ht(n,this.O.v()),n};wc={name:"redirectUser",F:"session"};ob.prototype.g=function(){var n=this,t=ai("local");bf(this,function(){return e().then(function(){return n.c&&"local"!=n.c.F?n.b.get(t,n.a):null}).then(function(i){if(i)return sb(n,"local").then(function(){n.c=t})})})};bc={name:"persistence",F:"session"};ob.prototype.tb=function(n){var r=null,t=this;return function(n){var u=new i("invalid-persistence-type"),r=new i("unsupported-persistence-type"),t;n:{for(t in vf)if(vf[t]==n){t=!0;break n}t=!1}if(!t||"string"!=typeof n)throw u;switch(hi()){case"ReactNative":if("session"===n)throw r;break;case"Node":if("none"!==n)throw r;break;case"Worker":if("session"===n||!pp()&&"none"!==n)throw r;break;default:if(!ev()&&"none"!==n)throw r;}}(n),bf(this,function(){return n!=t.c.F?t.b.get(t.c,t.a).then(function(i){return r=i,sb(t,n)}).then(function(){if(t.c=ai(n),r)return t.b.set(t.c,r,t.a)}):e()})};h(vi,ot);h(tet,yt);h(iet,yt);(t=vi.prototype).tb=function(n){return n=this.i.tb(n),k(this,n)};t.va=function(n){this.$===n||this.l||(this.$=n,vit(this.b,this.$),this.dispatchEvent(new tet(this.ja())))};t.ja=function(){return this.$};t.dd=function(){var n=r.navigator;this.va(n&&(n.languages&&n.languages[0]||n.language||n.userLanguage)||null)};t.Ec=function(t){this.N.push(t);yit(this.b,n.SDK_VERSION?uf(n.SDK_VERSION,this.N):null);this.dispatchEvent(new iet(this.N))};t.Ea=function(){return cr(this.N)};t.ub=function(n){this.R===n||this.l||(this.R=n,this.b.b=this.R)};t.S=function(){return this.R};t.toJSON=function(){return{apiKey:a(this).options.apiKey,authDomain:a(this).options.authDomain,appName:a(this).name,currentUser:s(this)&&s(this).v()}};t.Cb=function(n,t){switch(n){case"unknown":case"signInViaRedirect":return!0;case"signInViaPopup":return this.g==t&&!!this.f;default:return!1}};t.la=function(n,t,i,r){"signInViaPopup"==n&&this.g==r&&(i&&this.w?this.w(i):t&&!i&&this.f&&this.f(t),this.c&&(this.c.cancel(),this.c=null),delete this.f,delete this.w)};t.Da=function(n,t){return"signInViaRedirect"==n||"signInViaPopup"==n&&this.g==t&&this.f?o(this.gc,this):null};t.gc=function(n,t,i,r){var u=this,f={requestUri:n,postBody:r,sessionId:t,tenantId:i};return this.c&&(this.c.cancel(),this.c=null),u.Z.then(function(){return cu(u,up(u.b,f))})};t.Vc=function(t){var u;if(!dr())return y(new i("operation-not-supported-in-this-environment"));var r=this,f=ny(t.providerId),e=gr(),o=null;return(!le()||rv())&&a(this).options.authDomain&&t.isOAuthProvider&&(o=oo(a(this).options.authDomain,a(this).options.apiKey,a(this).name,"signInViaPopup",t,null,e,n.SDK_VERSION||null,null,null,this.S())),u=dg(o,f&&f.ta,f&&f.sa),k(this,f=hb(this).then(function(n){return kut(n,u,"signInViaPopup",t,e,!!o,r.S())}).then(function(){return new c(function(n,t){r.la("signInViaPopup",null,new i("cancelled-popup-request"),r.g);r.f=n;r.w=t;r.g=e;r.c=gut(r.a,r,"signInViaPopup",u,e)})}).then(function(n){return u&&kr(u),n?fr(n):null}).o(function(n){throw u&&kr(u),n;}))};t.Wc=function(n){if(!dr())return y(new i("operation-not-supported-in-this-environment"));var t=this;return k(this,hb(this).then(function(){return bf(n=t.i,function(){return n.b.set(bc,n.c.F,n.a)});var n}).then(function(){return dut(t.a,"signInViaRedirect",n,void 0,t.S())}))};t.pa=function(){var n=this;return ret(this).then(function(t){return n.a&&lc(n.a.b),t}).o(function(t){throw n.a&&lc(n.a.b),t;})};t.bd=function(n){var t,f,u,r,h,c,o,l,e;return n?this.R!=n.tenantId?y(new i("tenant-id-mismatch")):(t=this,f={},f.apiKey=a(this).options.apiKey,f.authDomain=a(this).options.authDomain,f.appName=a(this).name,e=(u=n,r=f,h=t.B,c=t.Ea(),o=u.b,(l={})[fi]=o.b&&o.b.toString(),l.refreshToken=o.a,r=new vt(r||{apiKey:u.l,authDomain:u.s,appName:u.m},l),h&&(r.ga=h),c&&ao(r,c),yc(r,u),r),k(this,this.h.then(function(){if(a(t).options.apiKey!=n.l)return e.reload()}).then(function(){return s(t)&&n.uid==s(t).uid?(yc(s(t),n),t.ca(n)):(kf(t,e),vo(e),t.ca(e))}).then(function(){po(t)}))):y(new i("null-user"))};t.wb=function(){var n=this,t=this.h.then(function(){return n.a&&lc(n.a.b),s(n)?(kf(n,null),gft(n.i).then(function(){po(n)})):e()});return k(this,t)};t.Xc=function(){var n=this;return net(this.i,a(this).options.authDomain).then(function(t){var i,r;if(!n.l){if((i=s(n)&&t)&&(i=s(n).uid,r=t.uid,i=null!=i&&""!==i&&null!=r&&""!==r&&i==r),i)return yc(s(n),t),s(n).I();(s(n)||t)&&(kf(n,t),t&&(vo(t),t.ga=n.B),n.a&&ew(n.a,n),po(n))}})};t.ca=function(n){return dft(this.i,n)};t.jc=function(){po(this);this.ca(s(this))};t.uc=function(){this.wb()};t.vc=function(){this.wb()};t.ic=function(n){var t=this;return this.h.then(function(){return cu(t,e(n))})};t.xc=function(n){var t=this;this.addAuthTokenListener(function(){n.next(s(t))})};t.yc=function(n){var t,i,r=this;i=function(){n.next(s(r))};(t=this).O.push(i);k(t,t.h.then(function(){!t.l&&pi(t.O,i)&&t.W!==t.getUid()&&(t.W=t.getUid(),i(kc(t)))}))};t.Gc=function(n,t,i){var r=this;return this.aa&&Promise.resolve().then(function(){et(n)?n(s(r)):et(n.next)&&n.next(s(r))}),this.$b(n,t,i)};t.Fc=function(n,t,i){var r=this;return this.aa&&Promise.resolve().then(function(){r.W=r.getUid();et(n)?n(s(r)):et(n.next)&&n.next(s(r))}),this.ac(n,t,i)};t.kc=function(n){var t=this,i=this.h.then(function(){return s(t)?s(t).I(n).then(function(n){return{accessToken:n}}):null});return k(this,i)};t.Rc=function(n){var t=this;return this.h.then(function(){return cu(t,l(t.b,nlt,{token:n}))}).then(function(n){var i=n.user;return sr(i,"isAnonymous",!1),t.ca(i),n})};t.Sc=function(n,t){var i=this;return this.h.then(function(){return cu(i,l(i.b,irt,{email:n,password:t}))})};t.cc=function(n,t){var i=this;return this.h.then(function(){return cu(i,l(i.b,dht,{email:n,password:t}))})};t.Ya=function(n){var t=this;return this.h.then(function(){return cu(t,n.ia(t.b))})};t.Qc=function(n){return cv("firebase.auth.Auth.prototype.signInAndRetrieveDataWithCredential is deprecated. Please use firebase.auth.Auth.prototype.signInWithCredential instead."),this.Ya(n)};t.vb=function(){var n=this;return this.h.then(function(){var t=s(n),i;return t&&t.isAnonymous?(i=fr({providerId:null,isNewUser:!1}),fr({user:t,credential:null,additionalUserInfo:i,operationType:"signIn"})):cu(n,n.b.vb()).then(function(t){var i=t.user;return sr(i,"isAnonymous",!0),n.ca(i),t})})};t.getUid=function(){return s(this)&&s(this).uid||null};t.bc=function(n){this.addAuthTokenListener(n);this.s++;0<this.s&&s(this)&&hft(s(this))};t.Nc=function(n){var t=this;w(this.m,function(i){i==n&&t.s--});this.s<0&&(this.s=0);0==this.s&&s(this)&&tb(s(this));this.removeAuthTokenListener(n)};t.addAuthTokenListener=function(n){var t=this;this.m.push(n);k(this,this.h.then(function(){t.l||pi(t.m,n)&&n(kc(t))}))};t.removeAuthTokenListener=function(n){dt(this.m,function(t){return t==n})};t.delete=function(){this.l=!0;for(var n=0;n<this.P.length;n++)this.P[n].cancel("app-deleted");return this.P=[],this.i&&(n=this.i).b.removeListener(ai("local"),n.a,this.oa),this.a&&(put(this.a,this),lc(this.a.b)),Promise.resolve()};t.fc=function(n){return k(this,l(this.b,ght,{identifier:n,continueUri:gs()?ce():"http://localhost"}).then(function(n){return n.signinMethods||[]}))};t.zc=function(n){return!!fy(n)};t.sb=function(n,t){var r=this;return k(this,e().then(function(){var n=new ih(t);if(!n.c)throw new i("argument-error",dv+" must be true when sending sign in link to email");return rh(n)}).then(function(t){return r.b.sb(n,t)}).then(function(){}))};t.fd=function(n){return this.Pa(n).then(function(n){return n.data.email})};t.jb=function(n,t){return k(this,this.b.jb(n,t).then(function(){}))};t.Pa=function(n){return k(this,this.b.Pa(n).then(function(n){return new hst(n)}))};t.fb=function(n){return k(this,this.b.fb(n).then(function(){}))};t.rb=function(n,t){var i=this;return k(this,e().then(function(){return void 0===t||lr(t)?{}:rh(new ih(t))}).then(function(t){return i.b.rb(n,t)}).then(function(){}))};t.Uc=function(n,t){return k(this,hw(this,n,t,o(this.Ya,this)))};t.Tc=function(n,t){var r=this;return k(this,e().then(function(){var u=t||ce(),f=ytt(n,u);if(!(u=fy(u)))throw new i("argument-error","Invalid email link!");if(u.tenantId!==r.S())throw new i("tenant-id-mismatch");return r.Ya(f)}))};wo.prototype.render=function(){};wo.prototype.reset=function(){};wo.prototype.getResponse=function(){};wo.prototype.execute=function(){};cb=null;df.prototype.render=function(n,t){return this.a[this.b.toString()]=new dc(n,t),this.b++};df.prototype.reset=function(n){var t=lb(this,n);n=uet(n);t&&n&&(t.delete(),delete this.a[n])};df.prototype.getResponse=function(n){return(n=lb(this,n))?n.getResponse():null};df.prototype.execute=function(n){(n=lb(this,n))&&n.execute()};dc.prototype.getResponse=function(){return ab(this),this.b};dc.prototype.execute=function(){ab(this);var n=this;this.a||(this.a=setTimeout(function(){n.b=function(){for(var n=50,t=[];0<n;)t.push("1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".charAt(Math.floor(62*Math.random()))),n--;return t.join("")}();var t=n.c.callback,i=n.c["expired-callback"];if(t)try{t(n.b)}catch(t){}n.a=setTimeout(function(){if(n.a=null,n.b=null,i)try{i()}catch(t){}n.h&&n.execute()},6e4)},500))};dc.prototype.delete=function(){ab(this);this.g=!0;clearTimeout(this.a);this.a=null;pt(this.f,"click",this.i)};u(vb,"FACTOR_ID","phone");yb.prototype.g=function(){return e(cb=cb||new df)};yb.prototype.c=function(){};pb=null;fet=new oi(fe,"https://www.google.com/recaptcha/api.js?onload=%{onload}&render=explicit&hl=%{hl}");eet=new ur(3e4,6e4);wb.prototype.g=function(n){var t=this;return new c(function(u,f){var o=setTimeout(function(){f(new i("network-request-failed"))},eet.get());!r.grecaptcha||n!==t.f&&!t.b?(r[t.a]=function(){if(r.grecaptcha){t.f=n;var e=r.grecaptcha.render;r.grecaptcha.render=function(n,i){return n=e(n,i),t.b++,n};clearTimeout(o);u(r.grecaptcha)}else clearTimeout(o),f(new i("internal-error"));delete r[t.a]},e(ky(wl(fet,{onload:t.a,hl:n||""}))).o(function(){clearTimeout(o);f(new i("internal-error","Unable to load external reCAPTCHA dependencies!"))})):(clearTimeout(o),u(r.grecaptcha))})};wb.prototype.c=function(){this.b--};bb=null;var oet="callback",set="expired-callback",het="sitekey",uat="size";(t=kb.prototype).Ga=function(){var n=this;return this.f?this.f:this.f=db(this,e().then(function(){if(gs()&&!ii())return tv();throw new i("operation-not-supported-in-this-environment","RecaptchaVerifier is only supported in a browser HTTP/HTTPS environment.");}).then(function(){return n.m.g(n.w())}).then(function(t){return n.g=t,l(n.s,act,{})}).then(function(t){n.a[het]=t.recaptchaSiteKey}).o(function(t){throw n.f=null,t;}))};t.render=function(){gc(this);var n=this;return db(this,this.Ga().then(function(){var t,i;return null===n.c&&(t=n.u,n.i||(i=ee(t),t=wot("DIV"),i.appendChild(t)),n.c=n.g.render(t,n.a)),n.c}))};t.verify=function(){gc(this);var n=this;return db(this,this.render().then(function(t){return new c(function(i){var u=n.g.getResponse(t),r;u?i(u):(r=function(t){var u;t&&(u=r,dt(n.l,function(n){return n==u}),i(t))},n.l.push(r),n.i&&n.g.execute(n.c))})}))};t.reset=function(){gc(this);null!==this.c&&this.g.reset(this.c)};t.clear=function(){var n,t;for(gc(this),this.D=!0,this.m.c(),n=0;n<this.h.length;n++)this.h[n].cancel("RecaptchaVerifier instance has been destroyed.");if(!this.i)for(n=ee(this.u);t=n.firstChild;)n.removeChild(t)};h(gb,kb);nk="First Second Third Fourth Fifth Sixth Seventh Eighth Ninth".split(" ");b(vi.prototype,{fb:{name:"applyActionCode",j:[f("code")]},Pa:{name:"checkActionCode",j:[f("code")]},jb:{name:"confirmPasswordReset",j:[f("code"),f("newPassword")]},cc:{name:"createUserWithEmailAndPassword",j:[f("email"),f("password")]},fc:{name:"fetchSignInMethodsForEmail",j:[f("email")]},pa:{name:"getRedirectResult",j:[]},zc:{name:"isSignInWithEmailLink",j:[f("emailLink")]},Fc:{name:"onAuthStateChanged",j:[g(ut(),gf(),"nextOrObserver"),gf("opt_error",!0),gf("opt_completed",!0)]},Gc:{name:"onIdTokenChanged",j:[g(ut(),gf(),"nextOrObserver"),gf("opt_error",!0),gf("opt_completed",!0)]},rb:{name:"sendPasswordResetEmail",j:[f("email"),g(ut("opt_actionCodeSettings",!0),yi(null,!0),"opt_actionCodeSettings",!0)]},sb:{name:"sendSignInLinkToEmail",j:[f("email"),ut("actionCodeSettings")]},tb:{name:"setPersistence",j:[f("persistence")]},Qc:{name:"signInAndRetrieveDataWithCredential",j:[hr()]},vb:{name:"signInAnonymously",j:[]},Ya:{name:"signInWithCredential",j:[hr()]},Rc:{name:"signInWithCustomToken",j:[f("token")]},Sc:{name:"signInWithEmailAndPassword",j:[f("email"),f("password")]},Tc:{name:"signInWithEmailLink",j:[f("email"),f("emailLink",!0)]},Uc:{name:"signInWithPhoneNumber",j:[f("phoneNumber"),nl()]},Vc:{name:"signInWithPopup",j:[ne()]},Wc:{name:"signInWithRedirect",j:[ne()]},bd:{name:"updateCurrentUser",j:[g({name:"user",J:"an instance of Firebase User",optional:!1,K:function(n){return!!(n&&n instanceof vt)}},yi(),"user")]},wb:{name:"signOut",j:[]},toJSON:{name:"toJSON",j:[f(null,!0)]},dd:{name:"useDeviceLanguage",j:[]},fd:{name:"verifyPasswordResetCode",j:[f("code")]}});pet(vi.prototype,{lc:{name:"languageCode",gb:g(f(),yi(),"languageCode")},ti:{name:"tenantId",gb:g(f(),yi(),"tenantId")}});(vi.Persistence=vf).LOCAL="local";vi.Persistence.SESSION="session";vi.Persistence.NONE="none";b(vt.prototype,{"delete":{name:"delete",j:[]},mc:{name:"getIdTokenResult",j:[tk("opt_forceRefresh",!0)]},I:{name:"getIdToken",j:[tk("opt_forceRefresh",!0)]},Ac:{name:"linkAndRetrieveDataWithCredential",j:[hr()]},mb:{name:"linkWithCredential",j:[hr()]},Bc:{name:"linkWithPhoneNumber",j:[f("phoneNumber"),nl()]},Cc:{name:"linkWithPopup",j:[ne()]},Dc:{name:"linkWithRedirect",j:[ne()]},Jc:{name:"reauthenticateAndRetrieveDataWithCredential",j:[hr()]},pb:{name:"reauthenticateWithCredential",j:[hr()]},Kc:{name:"reauthenticateWithPhoneNumber",j:[f("phoneNumber"),nl()]},Lc:{name:"reauthenticateWithPopup",j:[ne()]},Mc:{name:"reauthenticateWithRedirect",j:[ne()]},reload:{name:"reload",j:[]},qb:{name:"sendEmailVerification",j:[g(ut("opt_actionCodeSettings",!0),yi(null,!0),"opt_actionCodeSettings",!0)]},toJSON:{name:"toJSON",j:[f(null,!0)]},ad:{name:"unlink",j:[f("provider")]},xb:{name:"updateEmail",j:[f("email")]},yb:{name:"updatePassword",j:[f("password")]},cd:{name:"updatePhoneNumber",j:[hr("phone")]},zb:{name:"updateProfile",j:[ut("profile")]},Ab:{name:"verifyBeforeUpdateEmail",j:[f("email"),g(ut("opt_actionCodeSettings",!0),yi(null,!0),"opt_actionCodeSettings",!0)]}});b(df.prototype,{execute:{name:"execute"},render:{name:"render"},reset:{name:"reset"},getResponse:{name:"getResponse"}});b(wo.prototype,{execute:{name:"execute"},render:{name:"render"},reset:{name:"reset"},getResponse:{name:"getResponse"}});b(c.prototype,{ma:{name:"finally"},o:{name:"catch"},then:{name:"then"}});pet(uft.prototype,{appVerificationDisabled:{name:"appVerificationDisabledForTesting",gb:tk("appVerificationDisabledForTesting")}});b(sw.prototype,{confirm:{name:"confirm",j:[f("verificationCode")]}});nt(hf,"fromJSON",function(n){n="string"==typeof n?JSON.parse(n):n;for(var i,r=[rht,uht,fht,iht],t=0;t<r.length;t++)if(i=r[t](n))return i;return null},[g(f(),ut(),"json")]);nt(bt,"credential",function(n,t){return new er(n,t)},[f("email"),f("password")]);b(er.prototype,{v:{name:"toJSON",j:[f(null,!0)]}});b(iu.prototype,{Aa:{name:"addScope",j:[f("scope")]},Ia:{name:"setCustomParameters",j:[ut("customOAuthParameters")]}});nt(iu,"credential",ctt,[g(f(),ut(),"token")]);nt(bt,"credentialWithLink",ytt,[f("email"),f("emailLink")]);b(ru.prototype,{Aa:{name:"addScope",j:[f("scope")]},Ia:{name:"setCustomParameters",j:[ut("customOAuthParameters")]}});nt(ru,"credential",ltt,[g(f(),ut(),"token")]);b(uu.prototype,{Aa:{name:"addScope",j:[f("scope")]},Ia:{name:"setCustomParameters",j:[ut("customOAuthParameters")]}});nt(uu,"credential",att,[g(f(),g(ut(),yi()),"idToken"),g(f(),yi(),"accessToken",!0)]);b(lf.prototype,{Ia:{name:"setCustomParameters",j:[ut("customOAuthParameters")]}});nt(lf,"credential",vtt,[g(f(),ut(),"token"),f("secret",!0)]);b(at.prototype,{Aa:{name:"addScope",j:[f("scope")]},credential:{name:"credential",j:[g(f(),g(ut(),yi()),"optionsOrIdToken"),g(f(),yi(),"accessToken",!0)]},Ia:{name:"setCustomParameters",j:[ut("customOAuthParameters")]}});b(di.prototype,{v:{name:"toJSON",j:[f(null,!0)]}});b(nu.prototype,{v:{name:"toJSON",j:[f(null,!0)]}});nt(gi,"credential",ptt,[f("verificationId"),f("verificationCode")]);b(gi.prototype,{cb:{name:"verifyPhoneNumber",j:[g(f(),{name:"phoneInfoOptions",J:"valid phone info options",optional:!1,K:function(n){return!!n&&(n.session&&n.phoneNumber?ik(n.session,sf)&&"string"==typeof n.phoneNumber:n.session&&n.multiFactorHint?ik(n.session,we)&&yet(n.multiFactorHint):n.session&&n.multiFactorUid?ik(n.session,we)&&"string"==typeof n.multiFactorUid:!!n.phoneNumber&&"string"==typeof n.phoneNumber)}},"phoneInfoOptions"),nl()]}});b(or.prototype,{v:{name:"toJSON",j:[f(null,!0)]}});b(i.prototype,{toJSON:{name:"toJSON",j:[f(null,!0)]}});b(ke.prototype,{toJSON:{name:"toJSON",j:[f(null,!0)]}});b(hy.prototype,{toJSON:{name:"toJSON",j:[f(null,!0)]}});b(vw.prototype,{toJSON:{name:"toJSON",j:[f(null,!0)]}});b(cw.prototype,{Pc:{name:"resolveSignIn",j:[vet()]}});b(pw.prototype,{Ob:{name:"getSession",j:[]},dc:{name:"enroll",j:[vet(),f("displayName",!0)]},$c:{name:"unenroll",j:[g({name:"multiFactorInfo",J:"a valid multiFactorInfo",optional:!1,K:yet},f(),"multiFactorInfoIdentifier")]}});b(gb.prototype,{clear:{name:"clear",j:[]},render:{name:"render",j:[]},verify:{name:"verify",j:[]}});nt(kv,"parseLink",yn,[f("link")]);nt(vb,"assertion",function(n){return new oft(n)},[hr("phone")]),function(){if(void 0===n||!n.INTERNAL||!n.INTERNAL.registerComponent)throw Error("Cannot find the firebase namespace; be sure to include firebase-app.js before this library.");var t={ActionCodeInfo:{Operation:{EMAIL_SIGNIN:th,PASSWORD_RESET:"PASSWORD_RESET",RECOVER_EMAIL:"RECOVER_EMAIL",REVERT_SECOND_FACTOR_ADDITION:bv,VERIFY_AND_CHANGE_EMAIL:pe,VERIFY_EMAIL:"VERIFY_EMAIL"}},Auth:vi,AuthCredential:hf,Error:i};nt(t,"EmailAuthProvider",bt,[]);nt(t,"FacebookAuthProvider",iu,[]);nt(t,"GithubAuthProvider",ru,[]);nt(t,"GoogleAuthProvider",uu,[]);nt(t,"TwitterAuthProvider",lf,[]);nt(t,"OAuthProvider",at,[f("providerId")]);nt(t,"SAMLAuthProvider",htt,[f("providerId")]);nt(t,"PhoneAuthProvider",gi,[{name:"auth",J:"an instance of Firebase Auth",optional:!0,K:function(n){return!!(n&&n instanceof vi)}}]);nt(t,"RecaptchaVerifier",gb,[g(f(),{name:"",J:"an HTML element",optional:!1,K:function(n){return!!(n&&n instanceof Element)}},"recaptchaContainer"),ut("recaptchaParameters",!0),{name:"app",J:"an instance of Firebase App",optional:!0,K:function(t){return!!(t&&t instanceof n.app.App)}}]);nt(t,"ActionCodeURL",kv,[]);nt(t,"PhoneMultiFactorGenerator",vb,[]);n.INTERNAL.registerComponent({name:"auth",instanceFactory:function(n){return new vi(n=n.getProvider("app").getImmediate())},multipleInstances:!1,serviceProps:t,instantiationMode:"LAZY",type:"PUBLIC"});n.INTERNAL.registerComponent({name:"auth-internal",instanceFactory:function(n){return{getUid:o((n=n.getProvider("auth").getImmediate()).getUid,n),getToken:o(n.kc,n),addAuthTokenListener:o(n.bc,n),removeAuthTokenListener:o(n.Nc,n)}},multipleInstances:!1,instantiationMode:"LAZY",type:"PRIVATE"});n.registerVersion("@firebase/auth","0.14.5");n.INTERNAL.extendNamespace({User:vt})}()}.apply("undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})}).apply(this,arguments)}catch(t){throw console.error(t),new Error("Cannot instantiate firebase-auth.js - be sure to load firebase-app.js first.");}});!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("@firebase/app")):"function"==typeof define&&define.amd?define(["@firebase/app"],t):t((n=n||self).firebase)}(this,function(n){"use strict";try{(function(){function k(n,t){function i(){this.constructor=n}sw(n,t);n.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}function f(n,t,i,r){return new(i=i||Promise)(function(u,f){function o(n){try{e(r.next(n))}catch(n){f(n)}}function s(n){try{e(r.throw(n))}catch(n){f(n)}}function e(n){var t;n.done?u(n.value):((t=n.value)instanceof i?t:new i(function(n){n(t)})).then(o,s)}e((r=r.apply(n,t||[])).next())})}function u(n,t){function o(e){return function(o){return function(e){if(f)throw new TypeError("Generator is already executing.");for(;r;)try{if(f=1,u&&(i=2&e[0]?u.return:e[0]?u.throw||((i=u.return)&&i.call(u),0):u.next)&&!(i=i.call(u,e[1])).done)return i;switch(u=0,i&&(e=[2&e[0],i.value]),e[0]){case 0:case 1:i=e;break;case 4:return r.label++,{value:e[1],done:!1};case 5:r.label++;u=e[1];e=[0];continue;case 7:e=r.ops.pop();r.trys.pop();continue;default:if(!(i=0<(i=r.trys).length&&i[i.length-1])&&(6===e[0]||2===e[0])){r=0;continue}if(3===e[0]&&(!i||e[1]>i[0]&&e[1]<i[3])){r.label=e[1];break}if(6===e[0]&&r.label<i[1]){r.label=i[1];i=e;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(e);break}i[2]&&r.ops.pop();r.trys.pop();continue}e=t.call(n,r)}catch(o){e=[6,o];u=0}finally{f=i=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}([e,o])}}var f,u,i,e,r={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return e={next:o(0),"throw":o(1),"return":o(2)},"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e}function ih(){for(var t,i,u=0,n=0,f=arguments.length;n<f;n++)u+=arguments[n].length;for(t=Array(u),i=0,n=0;n<f;n++)for(var e=arguments[n],r=0,o=e.length;r<o;r++,i++)t[i]=e[r];return t}function cu(){for(var t,i,u=0,n=0,f=arguments.length;n<f;n++)u+=arguments[n].length;for(t=Array(u),i=0,n=0;n<f;n++)for(var e=arguments[n],r=0,o=e.length;r<o;r++,i++)t[i]=e[r];return t}function hct(n,t){for(var f,u,r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];if(!(t<n.logLevel)){if(f=(new Date).toISOString(),u=lct[t],!u)throw new Error("Attempted to log a message with an invalid logType (value: "+t+")");console[u].apply(console,cu(["["+f+"]  "+n.name+":"],r))}}function bf(n){this.name=n;this._logLevel=cct;this._logHandler=hct;this._userLogHandler=null}function ao(){return"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:""}function hw(n,t){var i=dn.call(this,t)||this;return i.code=n,i.name="FirebaseError",Object.setPrototypeOf(i,hw.prototype),Error.captureStackTrace&&Error.captureStackTrace(i,ntt.prototype.create),i}function ttt(n,t,i){this.service=n;this.serviceName=t;this.errors=i}function ka(n,t,i){this.name=n;this.instanceFactory=t;this.type=i;this.multipleInstances=!1;this.serviceProps={};this.instantiationMode="LAZY"}function utt(n){var t="function"==typeof Symbol&&Symbol.iterator,i=t&&n[t],r=0;if(i)return i.call(n);if(n&&"number"==typeof n.length)return{next:function(){return n&&r>=n.length&&(n=void 0),{value:n&&n[r++],done:!n}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.");}function da(){}function ga(n){var t=typeof n,i;if("object"==t){if(!n)return"null";if(n instanceof Array)return"array";if(n instanceof Object)return t;if(i=Object.prototype.toString.call(n),"[object Window]"==i)return"object";if("[object Array]"==i||"number"==typeof n.length&&void 0!==n.splice&&void 0!==n.propertyIsEnumerable&&!n.propertyIsEnumerable("splice"))return"array";if("[object Function]"==i||void 0!==n.call&&void 0!==n.propertyIsEnumerable&&!n.propertyIsEnumerable("call"))return"function"}else if("function"==t&&void 0===n.call)return"object";return t}function lw(n){var t=ga(n);return"array"==t||"object"==t&&"number"==typeof n.length}function pc(n){var t=typeof n;return"object"==t&&null!=n||"function"==t}function yct(n){return n.call.apply(n.bind,arguments)}function pct(n,t){if(!n)throw Error();if(2<arguments.length){var i=Array.prototype.slice.call(arguments,2);return function(){var r=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(r,i),n.apply(t,r)}}return function(){return n.apply(t,arguments)}}function ur(){return(ur=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?yct:pct).apply(null,arguments)}function tv(n){var t=Array.prototype.slice.call(arguments,1);return function(){var i=t.slice();return i.push.apply(i,arguments),n.apply(this,i)}}function gi(n,t){function i(){}i.prototype=t.prototype;n.M=t.prototype;n.prototype=new i;n.prototype.constructor=n}function kf(){this.j=this.j;this.i=this.i}function ett(){return Array.prototype.concat.apply([],arguments)}function yw(n){var i=n.length,r,t;if(0<i){for(r=Array(i),t=0;t<i;t++)r[t]=n[t];return r}return[]}function iv(n){return/^[\s\xa0]*$/.test(n)}function er(n,t){return-1!=n.indexOf(t)}function ww(n,t){return n<t?-1:t<n?1:0}function dw(n,t,i){for(var r in n)t.call(i,n[r],r,n)}function ott(n){var t={};for(var i in n)t[i]=n[i];return t}function stt(n){for(var t,i,u,r=1;r<arguments.length;r++){for(t in i=arguments[r])n[t]=i[t];for(u=0;u<gw.length;u++)t=gw[u],Object.prototype.hasOwnProperty.call(i,t)&&(n[t]=i[t])}}function nb(n){return nb[" "](n),n}function ltt(){var n=a.document;if(n)return n.documentMode}function vtt(n){return t=n,r=function(){for(var t,i,r=0,f=pw(String(rv)).split("."),e=pw(String(n)).split("."),o=Math.max(f.length,e.length),u=0;0==r&&u<o;u++){t=f[u]||"";i=e[u]||"";do{if(t=/(\d*)(\D*)(.*)/.exec(t)||["","","",""],i=/(\d*)(\D*)(.*)/.exec(i)||["","","",""],0==t[0].length&&0==i[0].length)break;r=ww(0==t[1].length?0:parseInt(t[1],10),0==i[1].length?0:parseInt(i[1],10))||ww(0==t[2].length,0==i[2].length)||ww(t[2],i[2]);t=t[3];i=i[3]}while(0==r)}return 0<=r},i=att,Object.prototype.hasOwnProperty.call(i,t)?i[t]:i[t]=r(t);var t,r,i}function nr(n,t){this.type=n;this.a=this.target=t;this.defaultPrevented=!1}function wc(n,t){var r,i,u;if(nr.call(this,n?n.type:""),this.relatedTarget=this.a=this.target=null,this.button=this.screenY=this.screenX=this.clientY=this.clientX=0,this.key="",this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1,this.pointerId=0,this.pointerType="",this.c=null,n){if(r=this.type=n.type,i=n.changedTouches&&n.changedTouches.length?n.changedTouches[0]:null,this.target=n.target||n.srcElement,this.a=t,t=n.relatedTarget){if(ctt){n:{try{nb(t.nodeName);u=!0;break n}catch(n){}u=!1}u||(t=null)}}else"mouseover"==r?t=n.fromElement:"mouseout"==r&&(t=n.toElement);this.relatedTarget=t;i?(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.clientX=void 0!==n.clientX?n.clientX:n.pageX,this.clientY=void 0!==n.clientY?n.clientY:n.pageY,this.screenX=n.screenX||0,this.screenY=n.screenY||0);this.button=n.button;this.key=n.key||"";this.ctrlKey=n.ctrlKey;this.altKey=n.altKey;this.shiftKey=n.shiftKey;this.metaKey=n.metaKey;this.pointerId=n.pointerId||0;this.pointerType="string"==typeof n.pointerType?n.pointerType:wtt[n.pointerType]||"";(this.c=n).defaultPrevented&&this.b()}}function gct(n,t,i,r,u){this.listener=n;this.proxy=null;this.src=t;this.type=i;this.capture=!!r;this.aa=u;this.key=++btt;this.V=this.X=!1}function ov(n){n.V=!0;n.listener=null;n.proxy=null;n.src=null;n.aa=null}function sv(n){this.src=n;this.a={};this.b=0}function ub(n,t){var i=t.type,f,r,u;i in n.a&&(r=n.a[i],u=aw(r,t),(f=0<=u)&&Array.prototype.splice.call(r,u,1),f&&(ov(t),0==n.a[i].length&&(delete n.a[i],n.b--)))}function fb(n,t,i,r){for(var f,u=0;u<n.length;++u)if(f=n[u],!f.V&&f.listener==t&&f.capture==!!i&&f.aa==r)return u;return-1}function eb(n,t,i,r,u){if(r&&r.once)return function n(t,i,r,u,f){if(Array.isArray(i)){for(var e=0;e<i.length;e++)n(t,i[e],r,u,f);return null}return r=hb(r),t&&t[uh]?t.sa(i,r,pc(u)?!!u.capture:!!u,f):ktt(t,i,r,!0,u,f)}(n,t,i,r,u);if(Array.isArray(t)){for(var f=0;f<t.length;f++)eb(n,t[f],i,r,u);return null}return i=hb(i),n&&n[uh]?n.ra(t,i,pc(r)?!!r.capture:!!r,u):ktt(n,t,i,!1,r,u)}function ktt(n,t,i,r,u,f){var o,h,e,s;if(!t)throw Error("Invalid event type");if(o=pc(u)?!!u.capture:!!u,o&&!rb)return null;if(s=sb(n),s||(n[hv]=s=new sv(n)),(i=s.add(t,i,r,o,f)).proxy)return i;if(h=nlt,r=e=rb?function(n){return h.call(e.src,e.listener,n)}:function(n){if(!(n=h.call(e.src,e.listener,n)))return n},(i.proxy=r).src=n,r.listener=i,n.addEventListener)dct||(u=o),void 0===u&&(u=!1),n.addEventListener(t.toString(),r,u);else if(n.attachEvent)n.attachEvent(dtt(t.toString()),r);else{if(!n.addListener||!n.removeListener)throw Error("addEventListener and attachEvent are unavailable.");n.addListener(r)}return i}function ob(n){var t,i,r;"number"!=typeof n&&n&&!n.V&&(t=n.src,t&&t[uh]?ub(t.c,n):(i=n.type,r=n.proxy,t.removeEventListener?t.removeEventListener(i,r,n.capture):t.detachEvent?t.detachEvent(dtt(i),r):t.addListener&&t.removeListener&&t.removeListener(r),(i=sb(t))?(ub(i,n),0==i.b&&(i.src=null,t[hv]=null)):ov(n)))}function dtt(n){return n in cv?cv[n]:cv[n]="on"+n}function gtt(n,t){var i=n.listener,r=n.aa||n.src;return n.X&&ob(n),i.call(r,t)}function nlt(n,t){if(n.V)return!0;if(rb)return gtt(n,new wc(t,this));if(!t)n:{t=["window","event"];for(var i=a,r=0;r<t.length;r++)if(null==(i=i[t[r]])){t=null;break n}t=i}return gtt(n,t=new wc(t,this))}function sb(n){return(n=n[hv])instanceof sv?n:null}function hb(n){return"function"==ga(n)?n:(n[lv]||(n[lv]=function(t){return n.handleEvent(t)}),n[lv])}function pr(){kf.call(this);this.c=new sv(this);(this.J=this).A=null}function av(n,t,i,r){var f,e,u,o,s;if(!(t=n.c.a[String(t)]))return!0;for(t=t.concat(),f=!0,e=0;e<t.length;++e)u=t[e],u&&!u.V&&u.capture==i&&(o=u.listener,s=u.aa||u.src,u.X&&ub(n.c,u),f=!1!==o.call(s,r)&&f);return f&&!r.defaultPrevented}function nit(){this.b=this.a=null}function tit(n,t,i){this.f=i;this.c=n;this.g=t;this.b=0;this.a=null}function vb(){this.next=this.b=this.a=null}function tlt(n){a.setTimeout(function(){throw n;},0)}function iit(n,t){var i;lb||(i=a.Promise.resolve(void 0),lb=function(){i.then(ilt)});vv||(lb(),vv=!0);yb.add(n,t)}function ilt(){for(var n,t,i,r;r=i=void 0,r=null,(i=yb).a&&(r=i.a,i.a=i.a.next,i.a||(i.b=null),r.next=null),n=r;){try{n.a.call(n.b)}catch(n){tlt(n)}t=ab;t.g(n);t.b<t.f&&(t.b++,n.next=t.a,t.a=n)}vv=!1}function yv(n,t){pr.call(this);this.b=n||1;this.a=t||a;this.f=ur(this.Ua,this);this.g=ff()}function pb(n){n.Z=!1;n.L&&(n.a.clearTimeout(n.L),n.L=null)}function wb(n,t,i){if("function"==ga(n))i&&(n=ur(n,i));else{if(!n||"function"!=typeof n.handleEvent)throw Error("Invalid listener argument");n=ur(n.handleEvent,n)}return 2147483647<Number(t)?-1:a.setTimeout(n,t||0)}function pv(n,t,i){kf.call(this);this.f=null!=i?ur(n,i):n;this.c=t;this.b=ur(this.Pa,this);this.a=[]}function rit(n){n.T=wb(n.b,n.c);n.f.apply(null,n.a)}function bc(n){kf.call(this);this.b=n;this.a={}}function uit(n,t,i,r){var u,f;for(Array.isArray(i)||(i&&(bb[0]=i.toString()),i=bb),u=0;u<i.length;u++){if(f=eb(t,i[u],r||n.handleEvent,!1,n.b||n),!f)break;n.a[f.key]=f}}function fit(n){dw(n.a,function(n,t){this.a.hasOwnProperty(t)&&ob(n)},n);n.a={}}function rlt(){}function db(){return kb=kb||new pr}function eit(n){nr.call(this,"serverreachability",n)}function wv(){var n=db();n.dispatchEvent(new eit(n))}function oit(n){nr.call(this,"statevent",n)}function uu(){var n=db();n.dispatchEvent(new oit(n))}function sit(n){nr.call(this,"timingevent",n)}function bv(n,t){if("function"!=ga(n))throw Error("Fn must not be null and must be a function");return a.setTimeout(function(){n()},t)}function hit(){}function cit(n){var t;return(t=n.a)||(t=n.a={}),t}function lit(){}function nk(){nr.call(this,"d")}function tk(){nr.call(this,"c")}function vit(){}function gc(n,t,i){this.g=n;this.W=t;this.U=i||1;this.G=new bc(this);this.N=ult;n=tb?125:void 0;this.O=new yv(n);this.m=null;this.b=!1;this.j=this.A=this.f=this.B=this.s=this.P=this.h=null;this.i=[];this.a=null;this.w=0;this.c=this.v=null;this.H=-1;this.l=!1;this.J=0;this.D=null;this.o=this.R=this.F=!1}function rk(n,t,i){n.B=1;n.f=iy(df(t));n.j=i;n.F=!0;pit(n,null)}function pit(n,t){n.s=ff();nl(n);n.A=df(n.f);var r=n.A,i=n.U;Array.isArray(i)||(i=[String(i)]);trt(r.b,"t",i);n.w=0;n.a=tut(n.g,n.g.w?t:null);0<n.J&&(n.D=new pv(ur(n.ya,n,n.a),n.J));uit(n.G,n.a,"readystatechange",n.Sa);t=n.m?ott(n.m):{};n.j?(n.v||(n.v="POST"),t["Content-Type"]="application/x-www-form-urlencoded",n.a.$(n.A,n.v,n.j,t)):(n.v="GET",n.a.$(n.A,n.v,null,t));wv(1)}function wit(n,t,i){for(var u,r=!0;!n.l&&n.w<i.length;){if(u=flt(n,i),u==ik){4==t&&(n.c=4,uu(14),r=!1);break}if(u==yit){n.c=4;uu(15);r=!1;break}uk(n,u)}4==t&&0==i.length&&(n.c=1,uu(16),r=!1);n.b=n.b&&r;r||(fh(n),dv(n))}function flt(n,t){var i=n.w,r=t.indexOf("\n",i);return-1==r?ik:(i=Number(t.substring(i,r)),isNaN(i)?yit:(r+=1)+i>t.length?ik:(t=t.substr(r,i),n.w=r+i,t))}function nl(n){n.P=ff()+n.N;bit(n,n.N)}function bit(n,t){if(null!=n.h)throw Error("WatchDog timer not null");n.h=bv(ur(n.Qa,n),t)}function kv(n){n.h&&(a.clearTimeout(n.h),n.h=null)}function dv(n){0==n.g.u||n.l||krt(n.g,n)}function fh(n){kv(n);var t=n.D;t&&"function"==typeof t.da&&t.da();n.D=null;pb(n.O);fit(n.G);n.a&&(t=n.a,n.a=null,t.abort(),t.da())}function uk(n,t){var i,f,r,v,s,u,o,h,e,a,c,l,y;try{if(i=n.g,0!=i.u&&(i.a==n||sk(i.b,n)))if(i.A=n.H,!n.o&&sk(i.b,n)&&3==i.u){try{f=i.ja.a.parse(t)}catch(n){f=null}if(Array.isArray(f)&&3==f.length){if(r=f,0==r[0]){n:if(!i.i){if(i.a){if(!(i.a.s+3e3<n.s))break n;ey(i);i.a.cancel();i.a=null}yk(i);uu(18)}}else i.ia=r[1],0<i.ia-i.G&&r[2]<37500&&i.U&&0==i.m&&!i.l&&(i.l=bv(ur(i.Na,i),6e3));if(frt(i.b)<=1&&i.O){try{i.O()}catch(n){}i.O=void 0}}else po(i,11)}else if(!n.o&&i.a!=n||ey(i),!iv(t))for(t=f=i.ja.a.parse(t),f=0;f<t.length;f++)(r=t[f],i.G=r[0],r=r[1],2==i.u)?"c"==r[0]?(i.B=r[1],i.R=r[2],v=r[3],null!=v&&(i.oa=v),s=r[5],null!=s&&"number"==typeof s&&0<s&&(i.D=1.5*s),u=i,o=n.a,o&&(h=o.a?o.a.getResponseHeader("X-Client-Wire-Protocol"):null,h&&(e=u.b,!e.a&&(er(h,"spdy")||er(h,"quic")||er(h,"h2"))&&(e.f=e.g,e.a=new Set,e.b&&(hk(e,e.b),e.b=null))),u.s&&(a=o.a?o.a.getResponseHeader("X-HTTP-Session-Id"):null,a&&(u.ha=a,ct(u.v,u.s,a)))),i.u=3,i.c&&i.c.na(),c=n,((u=i).ea=nut(u,u.w?u.R:null,u.P),c.o)?(ert(u.b,c),l=c,y=u.D,y&&l.setTimeout(y),l.h&&(kv(l),nl(l)),u.a=c):brt(u),0<i.f.length&&fy(i)):"stop"!=r[0]&&"close"!=r[0]||po(i,7):3==i.u&&("stop"==r[0]||"close"==r[0]?"stop"==r[0]?po(i,7):ak(i):"noop"!=r[0]&&i.c&&i.c.ma(r),i.m=0);wv(4)}catch(n){}}function fk(n,t){var i,u,r,f;if(n.forEach&&"function"==typeof n.forEach)n.forEach(t,void 0);else if(lw(n)||"string"==typeof n)vw(n,t,void 0);else{if(n.K&&"function"==typeof n.K)i=n.K();else if(n.I&&"function"==typeof n.I)i=void 0;else if(lw(n)||"string"==typeof n)for(i=[],u=n.length,r=0;r<u;r++)i.push(r);else for(r in i=[],u=0,n)i[u++]=r;for(r=(u=function(n){if(n.I&&"function"==typeof n.I)return n.I();if("string"==typeof n)return n.split("");if(lw(n)){for(var t=[],r=n.length,i=0;i<r;i++)t.push(n[i]);return t}for(i in t=[],r=0,n)t[r++]=n[i];return t}(n)).length,f=0;f<r;f++)t.call(void 0,u[f],i&&i[f],n)}}function eh(n){var i,t;if(this.b={},this.a=[],this.c=0,i=arguments.length,1<i){if(i%2)throw Error("Uneven number of arguments");for(t=0;t<i;t+=2)this.set(arguments[t],arguments[t+1])}else if(n)if(n instanceof eh)for(i=n.K(),t=0;t<i.length;t++)this.set(i[t],n.get(i[t]));else for(t in n)this.set(t,n[t])}function ek(n){var t,i,r,u;if(n.c!=n.a.length){for(t=0,i=0;t<n.a.length;)r=n.a[t],vo(n.b,r)&&(n.a[i++]=r),t++;n.a.length=i}if(n.c!=n.a.length){for(u={},i=t=0;t<n.a.length;)vo(u,r=n.a[t])||(u[n.a[i++]=r]=1),t++;n.a.length=i}}function vo(n,t){return Object.prototype.hasOwnProperty.call(n,t)}function yo(n,t){if(this.c=this.j=this.f="",this.h=null,this.i=this.g="",this.a=!1,n instanceof yo){this.a=void 0!==t?t:n.a;gv(this,n.f);this.j=n.j;ny(this,n.c);ty(this,n.h);this.g=n.g;t=n.b;var i=new rl;i.c=t.c;t.a&&(i.a=new eh(t.a),i.b=t.b);kit(this,i);this.i=n.i}else n&&(i=String(n).match(ok))?(this.a=!!t,gv(this,i[1]||"",!0),this.j=tl(i[2]||""),ny(this,i[3]||"",!0),ty(this,i[4]),this.g=tl(i[5]||"",!0),kit(this,i[6]||"",!0),this.i=tl(i[7]||"")):(this.a=!!t,this.b=new rl(null,this.a))}function df(n){return new yo(n)}function gv(n,t,i){n.f=i?tl(t,!0):t;n.f&&(n.f=n.f.replace(/:$/,""))}function ny(n,t,i){n.c=i?tl(t,!0):t}function ty(n,t){if(t){if(t=Number(t),isNaN(t)||t<0)throw Error("Bad port number "+t);n.h=t}else n.h=null}function kit(n,t,i){var r,u;t instanceof rl?(n.b=t,r=n.b,(u=n.a)&&!r.f&&(ke(r),r.c=null,r.a.forEach(function(n,t){var i=t.toLowerCase();t!=i&&(git(this,t),trt(this,i,n))},r)),r.f=u):(i||(t=il(t,hlt)),n.b=new rl(t,n.a))}function ct(n,t,i){n.b.set(t,i)}function iy(n){return ct(n,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^ff()).toString(36)),n}function tl(n,t){return n?t?decodeURI(n.replace(/%25/g,"%2525")):decodeURIComponent(n):""}function il(n,t,i){return"string"==typeof n?(n=encodeURI(n).replace(t,elt),i&&(n=n.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),n):null}function elt(n){return"%"+((n=n.charCodeAt(0))>>4&15).toString(16)+(15&n).toString(16)}function rl(n,t){this.b=this.a=null;this.c=n||null;this.f=!!t}function ke(n){n.a||(n.a=new eh,n.b=0,n.c&&function(n,t){var i,r,u,f;if(n)for(n=n.split("&"),i=0;i<n.length;i++)r=n[i].indexOf("="),u=null,0<=r?(f=n[i].substring(0,r),u=n[i].substring(r+1)):f=n[i],t(f,u?decodeURIComponent(u.replace(/\+/g," ")):"")}(n.c,function(t,i){n.add(decodeURIComponent(t.replace(/\+/g," ")),i)}))}function git(n,t){ke(n);t=oh(n,t);vo(n.a.b,t)&&(n.c=null,n.b-=n.a.get(t).length,vo((n=n.a).b,t)&&(delete n.b[t],n.c--,n.a.length>2*n.c&&ek(n)))}function nrt(n,t){return ke(n),t=oh(n,t),vo(n.a.b,t)}function trt(n,t,i){git(n,t);0<i.length&&(n.c=null,n.a.set(oh(n,t),yw(i)),n.b+=i.length)}function oh(n,t){return t=String(t),n.f&&(t=t.toLowerCase()),t}function llt(n,t){this.b=n;this.a=t}function irt(n){this.g=n||rrt;n=a.PerformanceNavigationTiming?0<(n=a.performance.getEntriesByType("navigation")).length&&("hq"==n[0].nextHopProtocol||"h2"==n[0].nextHopProtocol):!!(a.ca&&a.ca.ua&&a.ca.ua()&&a.ca.ua().mb);this.f=n?this.g:1;this.a=null;1<this.f&&(this.a=new Set);this.b=null;this.c=[]}function urt(n){return n.b||n.a&&n.a.size>=n.f}function frt(n){return n.b?1:n.a?n.a.size:0}function sk(n,t){return n.b?n.b==t:n.a&&n.a.has(t)}function hk(n,t){n.a?n.a.add(t):n.b=t}function ert(n,t){n.b&&n.b==t?n.b=null:n.a&&n.a.has(t)&&n.a.delete(t)}function ort(n){var u,f,r,i,t,e;if(null!=n.b)return n.c.concat(n.b.i);if(null==n.a||0===n.a.size)return yw(n.c);r=n.c;try{for(i=utt(n.a.values()),t=i.next();!t.done;t=i.next())e=t.value,r=r.concat(e.i)}catch(n){u={error:n}}finally{try{t&&!t.done&&(f=i.return)&&f.call(i)}finally{if(u)throw u.error;}}return r}function ck(){}function alt(){this.a=new ck}function vlt(n,t,i){var r=i||"";try{fk(n,function(n,i){var u=n;pc(n)&&(u=cb(n));t.push(r+i+"="+encodeURIComponent(u))})}catch(n){throw t.push(r+"type="+encodeURIComponent("_badmap")),n;}}function ry(n,t,i,r,u){try{t.onload=null;t.onerror=null;t.onabort=null;t.ontimeout=null;u(r)}catch(n){}}function ui(n){pr.call(this);this.headers=new eh;this.G=n||null;this.b=!1;this.s=this.a=null;this.D="";this.h=0;this.f="";this.g=this.w=this.l=this.v=!1;this.o=0;this.m=null;this.H=ylt;this.B=this.F=!1}function blt(n){return"content-type"==n.toLowerCase()}function hrt(n,t){n.b=!1;n.a&&(n.g=!0,n.a.abort(),n.g=!1);n.f=t;n.h=5;crt(n);uy(n)}function crt(n){n.v||(n.v=!0,n.dispatchEvent("complete"),n.dispatchEvent("error"))}function lrt(n){var i,r,u,f,t,e,o;if(n.b&&void 0!==cw&&(!n.s[1]||4!=de(n)||2!=n.S()))if(n.l&&4==de(n))wb(n.va,0,n);else if(n.dispatchEvent("readystatechange"),4==de(n)){n.b=!1;try{r=n.S();n:switch(r){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:u=!0;break n;default:u=!1}if((i=u)||((f=0===r)&&(t=String(n.D).match(ok)[1]||null,!t&&a.self&&a.self.location&&(e=a.self.location.protocol,t=e.substr(0,e.length-1)),f=!plt.test(t?t.toLowerCase():"")),i=f),i)n.dispatchEvent("complete"),n.dispatchEvent("success");else{n.h=6;try{o=2<de(n)?n.a.statusText:""}catch(n){o=""}n.f=o+" ["+n.S()+"]";crt(n)}}finally{uy(n)}}}function uy(n,t){if(n.a){art(n);var i=n.a,r=n.s[0]?da:null;n.a=null;n.s=null;t||n.dispatchEvent("ready");try{i.onreadystatechange=r}catch(n){}}}function art(n){n.a&&n.B&&(n.a.ontimeout=null);n.m&&(a.clearTimeout(n.m),n.m=null)}function de(n){return n.a?n.a.readyState:0}function lk(n,t,i){var u,r;n:{for(u in i){u=!1;break n}u=!0}u||(r="",dw(i,function(n,t){r+=t;r+=":";r+=n;r+="\r\n"}),i=r,"string"==typeof n?null!=i&&encodeURIComponent(String(i)):ct(n,t,i))}function ul(n,t,i){return i&&i.internalChannelParams&&i.internalChannelParams[n]||t}function vrt(n){this.f=[];this.R=this.ea=this.v=this.P=this.a=this.ha=this.s=this.N=this.h=this.F=this.j=null;this.Fa=this.H=0;this.Ca=ul("failFast",!1,n);this.U=this.l=this.i=this.g=this.c=null;this.W=!0;this.A=this.ia=this.G=-1;this.J=this.m=this.o=0;this.Ba=ul("baseRetryDelayMs",5e3,n);this.Ga=ul("retryDelaySeedMs",1e4,n);this.Da=ul("forwardChannelMaxRetries",2,n);this.ga=ul("forwardChannelRequestTimeoutMs",2e4,n);this.Ea=n&&n.nb||void 0;this.D=void 0;this.w=n&&n.supportsCrossDomainXhr||!1;this.B="";this.b=new irt(n&&n.concurrentRequestLimit);this.ja=new alt;this.fa=n&&n.fastHandshake||!1;n&&n.forceLongPolling&&(this.W=!1);this.O=void 0}function ak(n){if(yrt(n),3==n.u){var t=n.H++,i=df(n.v);ct(i,"SID",n.B);ct(i,"RID",t);ct(i,"TYPE","terminate");fl(n,i);(t=new gc(n,t,void 0)).B=2;t.f=iy(df(i));i=!1;a.navigator&&a.navigator.sendBeacon&&(i=a.navigator.sendBeacon(t.f.toString(),""));!i&&a.Image&&((new Image).src=t.f,i=!0);i||(t.a=tut(t.g,null),t.a.$(t.f));t.s=ff();nl(t)}grt(n)}function yrt(n){n.a&&(n.a.cancel(),n.a=null);n.i&&(a.clearTimeout(n.i),n.i=null);ey(n);n.b.cancel();n.g&&("number"==typeof n.g&&a.clearTimeout(n.g),n.g=null)}function vk(n,t){n.f.push(new llt(n.Fa++,t));3==n.u&&fy(n)}function fy(n){urt(n.b)||n.g||(n.g=!0,iit(n.xa,n),n.o=0)}function prt(n,t){var i,r;i=t?t.W:n.H++;r=df(n.v);ct(r,"SID",n.B);ct(r,"RID",i);ct(r,"AID",n.G);fl(n,r);n.h&&n.j&&lk(r,n.h,n.j);i=new gc(n,i,n.o+1);null===n.h&&(i.m=n.j);t&&(n.f=t.i.concat(n.f));t=wrt(n,i,1e3);i.setTimeout(Math.round(.5*n.ga)+Math.round(.5*n.ga*Math.random()));hk(n.b,i);rk(i,r,t)}function fl(n,t){n.c&&fk({},function(n,i){ct(t,i,n)})}function wrt(n,t,i){var f,e,r,o,s,u,h,c;i=Math.min(n.f.length,i);f=n.c?ur(n.c.Ha,n.c,n):null;n:for(e=n.f,r=-1;;){for(o=["count="+i],-1==r?0<i?(r=e[0].b,o.push("ofs="+r)):r=0:o.push("ofs="+r),s=!0,u=0;u<i;u++)if(h=e[u].b,c=e[u].a,(h-=r)<0)r=Math.max(0,e[u].b-100),s=!1;else try{vlt(c,o,"req"+h+"_")}catch(n){f&&f(c)}if(s){f=o.join("&");break n}}return n=n.f.splice(0,i),t.i=n,f}function brt(n){n.a||n.i||(n.J=1,iit(n.wa,n),n.m=0)}function yk(n){return!(n.a||n.i||3<=n.m)&&(n.J++,n.i=bv(ur(n.wa,n),drt(n,n.m)),n.m++,1)}function ey(n){null!=n.l&&(a.clearTimeout(n.l),n.l=null)}function krt(n,t){var r=null,i,u;if(n.a==t)ey(n),n.a=null,i=2;else{if(!sk(n.b,t))return;r=t.i;ert(n.b,t);i=1}if(n.A=t.H,0!=n.u)if(t.b)1==i?(r=t.j?t.j.length:0,t=ff()-t.s,u=n.o,(i=db()).dispatchEvent(new sit(i)),fy(n)):brt(n);else if(3==(u=t.c)||0==u&&0<n.A||!(1==i&&function(n,t){if(!(frt(n.b)>=n.b.f-(n.g?1:0))){if(n.g)return n.f=t.i.concat(n.f),1;if(!(1==n.u||2==n.u||n.o>=(n.Ca?0:n.Da)))return n.g=bv(ur(n.xa,n,t),drt(n,n.o)),n.o++,1}}(n,t)||2==i&&yk(n)))switch(r&&0<r.length&&(t=n.b,t.c=t.c.concat(r)),u){case 1:po(n,5);break;case 4:po(n,10);break;case 3:po(n,6);break;default:po(n,2)}}function drt(n,t){var i=n.Ba+Math.floor(Math.random()*n.Ga);return n.c||(i*=2),i*t}function po(n,t){var i,r;2==t?(i=null,n.c&&(i=null),r=ur(n.Ta,n),i||(i=new yo("//www.google.com/images/cleardot.gif"),a.location&&"http"==a.location.protocol||gv(i,"https"),iy(i)),function(n,t){var r=new rlt,i;a.Image?(i=new Image,i.onload=tv(ry,r,i,"TestLoadImage: loaded",!0,t),i.onerror=tv(ry,r,i,"TestLoadImage: error",!1,t),i.onabort=tv(ry,r,i,"TestLoadImage: abort",!1,t),i.ontimeout=tv(ry,r,i,"TestLoadImage: timeout",!1,t),a.setTimeout(function(){i.ontimeout&&i.ontimeout()},1e4),i.src=n):t(!1)}(i.toString(),r)):uu(2);n.u=0;n.c&&n.c.la(t);grt(n);yrt(n)}function grt(n){n.u=0;n.A=-1;n.c&&(0==ort(n.b).length&&0==n.f.length||(n.b.c.length=0,yw(n.f),n.f.length=0),n.c.ka())}function nut(n,t,i){var e,o,s,h,c,u,r=(e=i)instanceof yo?df(e):new yo(e,void 0),f;return""!=r.c?(t&&ny(r,t+"."+r.c),ty(r,r.h)):(f=a.location,o=f.protocol,s=t?t+"."+f.hostname:f.hostname,h=+f.port,c=i,u=new yo(null,void 0),o&&gv(u,o),s&&ny(u,s),h&&ty(u,h),c&&(u.g=c),r=u),n.N&&dw(n.N,function(n,t){ct(r,t,n)}),t=n.s,i=n.ha,t&&i&&ct(r,t,i),ct(r,"VER",n.oa),fl(n,r),r}function tut(n,t){if(t&&!n.w)throw Error("Can't create secondary domain capable XhrIo object.");return(t=new ui(n.Ea)).F=n.w,t}function iut(){}function oy(){if(be&&!(10<=Number(ptt)))throw Error("Environmental error: no available transport.");}function fu(n,t){pr.call(this);this.a=new vrt(t);this.l=n;this.b=t&&t.messageUrlParams||null;n=t&&t.messageHeaders||null;t&&t.clientProtocolHeaderRequired&&(n?n["X-Client-Protocol"]="webchannel":n={"X-Client-Protocol":"webchannel"});this.a.j=n;n=t&&t.initMessageHeaders||null;t&&t.messageContentType&&(n?n["X-WebChannel-Content-Type"]=t.messageContentType:n={"X-WebChannel-Content-Type":t.messageContentType});t&&t.pa&&(n?n["X-WebChannel-Client-Profile"]=t.pa:n={"X-WebChannel-Client-Profile":t.pa});this.a.F=n;(n=t&&t.httpHeadersOverwriteParam)&&!iv(n)&&(this.a.h=n);this.h=t&&t.supportsCrossDomainXhr||!1;this.g=t&&t.sendRawJson||!1;(t=t&&t.httpSessionIdParam)&&!iv(t)&&(this.a.s=t,null!==(n=this.b)&&t in n&&t in(n=this.b)&&delete n[t]);this.f=new sh(this)}function rut(n){var t,i;if(nk.call(this),t=n.__sm__,t){n:{for(i in t){n=i;break n}n=void 0}(this.c=n)?(n=this.c,this.data=null!==t&&n in t?t[n]:void 0):this.data=t}else this.data=n}function uut(){tk.call(this);this.status=1}function sh(n){this.a=n}function cy(n){this.uid=n}function nat(n,t){this.user=t;this.type="OAuth";this.o={};this.o.Authorization="Bearer "+n}function ge(){return null!==wk&&wk.apply(this,arguments)||this}function si(n,t,i){void 0===t?t=0:t>n.length&&o();void 0===i?i=n.length-t:i>n.length-t&&o();this.segments=n;this.offset=t;this.F=i}function ef(n){this.timestamp=n}function wr(n,r){if(this.seconds=n,(this.nanoseconds=r)<0)throw new i(t.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+r);if(1e9<=r)throw new i(t.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+r);if(n<-62135596800)throw new i(t.INVALID_ARGUMENT,"Timestamp seconds out of range: "+n);if(253402300800<=n)throw new i(t.INVALID_ARGUMENT,"Timestamp seconds out of range: "+n);}function ol(n,t){this.P=n;this.V=t}function sut(n,t){this.P=n;this.V=t;this.type="FirstParty";this.user=eu.h}function hh(n){var t=this;this.I=null;this.currentUser=eu.UNAUTHENTICATED;this.R=!1;this.A=0;this.u=null;this.forceRefresh=!1;this.I=function(){t.A++;t.currentUser=t.m();t.R=!0;t.u&&t.u(t.currentUser)};this.A=0;this.auth=n.getImmediate({optional:!0});this.auth?this.auth.addAuthTokenListener(this.I):(this.I(null),n.get().then(function(n){t.auth=n;t.I&&t.auth.addAuthTokenListener(t.I)},function(){}))}function sl(){this.u=null}function hut(n,t){var i=this;return(i=fut.call(this,t)||this).code=n,i.message=t,i.name="FirebaseError",i.toString=function(){return i.name+": [code="+i.code+"]: "+i.message},i}function br(){return null!==bk&&bk.apply(this,arguments)||this}function of(n){this.path=n}function lut(n){var t=0;for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&t++;return t}function ch(n,t){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&t(i,n[i])}function aut(n){for(var t in n)if(Object.prototype.hasOwnProperty.call(n,t))return!1;return!0}function sf(n){this.it=n}function wo(n){return null==n}function ly(n){return-0===n&&1/n==-1/0}function vut(n){return"number"==typeof n&&Number.isInteger(n)&&!ly(n)&&n<=Number.MAX_SAFE_INTEGER&&n>=Number.MIN_SAFE_INTEGER}function kk(n){var t,i;return"server_timestamp"===(null===(i=((null===(t=null==n?void 0:n.mapValue)||void 0===t?void 0:t.fields)||{}).__type__)||void 0===i?void 0:i.stringValue)}function hl(n){var t=to(n.mapValue.fields.__local_write_time__.timestampValue);return new ar(t.seconds,t.nanos)}function no(n){return"nullValue"in n?0:"booleanValue"in n?1:"integerValue"in n||"doubleValue"in n?2:"timestampValue"in n?3:"stringValue"in n?5:"bytesValue"in n?6:"referenceValue"in n?7:"geoPointValue"in n?8:"arrayValue"in n?9:"mapValue"in n?kk(n)?4:10:o()}function lu(n,t){var r,i,u,f=no(n);if(f!==no(t))return!1;switch(f){case 0:return!0;case 1:return n.booleanValue===t.booleanValue;case 4:return hl(n).isEqual(hl(t));case 3:return function(t){if("string"==typeof n.timestampValue&&"string"==typeof t.timestampValue&&n.timestampValue.length===t.timestampValue.length)return n.timestampValue===t.timestampValue;var i=to(n.timestampValue),r=to(t.timestampValue);return i.seconds===r.seconds&&i.nanos===r.nanos}(t);case 5:return n.stringValue===t.stringValue;case 6:return u=t,lh(n.bytesValue).isEqual(lh(u.bytesValue));case 7:return n.referenceValue===t.referenceValue;case 8:return i=t,ni((r=n).geoPointValue.latitude)===ni(i.geoPointValue.latitude)&&ni(r.geoPointValue.longitude)===ni(i.geoPointValue.longitude);case 2:return function(n,t){if("integerValue"in n&&"integerValue"in t)return ni(n.integerValue)===ni(t.integerValue);if("doubleValue"in n&&"doubleValue"in t){var i=ni(n.doubleValue),r=ni(t.doubleValue);return i===r?ly(i)===ly(r):isNaN(i)&&isNaN(r)}return!1}(n,t);case 9:return ss(n.arrayValue.values||[],t.arrayValue.values||[],lu);case 10:return function(t){var r=n.mapValue.fields||{},u=t.mapValue.fields||{},i;if(lut(r)!==lut(u))return!1;for(i in r)if(r.hasOwnProperty(i)&&(void 0===u[i]||!lu(r[i],u[i])))return!1;return!0}(t);default:return o()}}function dk(n,t){return void 0!==(n.values||[]).find(function(n){return lu(n,t)})}function cl(n,t){var u,f,h,c,l,a,v,e,i,r,s=no(n),y=no(t);if(s!==y)return p(s,y);switch(s){case 0:return 0;case 1:return p(n.booleanValue,t.booleanValue);case 2:return e=t,i=ni(n.integerValue||n.doubleValue),r=ni(e.integerValue||e.doubleValue),i<r?-1:r<i?1:i===r?0:isNaN(i)?isNaN(r)?0:-1:1;case 3:return put(n.timestampValue,t.timestampValue);case 4:return put(hl(n),hl(t));case 5:return p(n.stringValue,t.stringValue);case 6:return c=n.bytesValue,l=t.bytesValue,a=lh(c),v=lh(l),a.S(v);case 7:return function(n,t){for(var f,r=n.split("/"),u=t.split("/"),i=0;i<r.length&&i<u.length;i++)if(f=p(r[i],u[i]),0!==f)return f;return p(r.length,u.length)}(n.referenceValue,t.referenceValue);case 8:return u=n.geoPointValue,f=t.geoPointValue,0!==(h=p(ni(u.latitude),ni(f.latitude)))?h:p(ni(u.longitude),ni(f.longitude));case 9:return function(n,t){for(var f,r=n.values||[],u=t.values||[],i=0;i<r.length&&i<u.length;++i)if(f=cl(r[i],u[i]),f)return f;return p(r.length,u.length)}(n.arrayValue,t.arrayValue);case 10:return function(n,t){var o=n.fields||{},r=Object.keys(o),s=t.fields||{},u=Object.keys(s),i,f,e;for(r.sort(),u.sort(),i=0;i<r.length&&i<u.length;++i){if(f=p(r[i],u[i]),0!==f)return f;if(e=cl(o[r[i]],s[u[i]]),0!==e)return e}return p(r.length,u.length)}(n.mapValue,t.mapValue);default:throw o();}}function put(n,t){if("string"==typeof n&&"string"==typeof t&&n.length===t.length)return p(n,t);var i=to(n),r=to(t),u=p(i.seconds,r.seconds);return 0!==u?u:p(i.nanos,r.nanos)}function gk(n){return function t(n){return"nullValue"in n?"null":"booleanValue"in n?""+n.booleanValue:"integerValue"in n?""+n.integerValue:"doubleValue"in n?""+n.doubleValue:"timestampValue"in n?"time("+(i=to(n.timestampValue)).seconds+","+i.nanos+")":"stringValue"in n?n.stringValue:"bytesValue"in n?lh(n.bytesValue).toBase64():"referenceValue"in n?(u=n.referenceValue,l.Z(u).toString()):"geoPointValue"in n?"geo("+(r=n.geoPointValue).latitude+","+r.longitude+")":"arrayValue"in n?function(){for(var i="[",u=!0,r=0,f=n.arrayValue.values||[];r<f.length;r++)u?u=!1:i+=",",i+=t(f[r]);return i+"]"}():"mapValue"in n?function(n){for(var u,i="{",f=!0,r=0,e=Object.keys(n.fields||{}).sort();r<e.length;r++)u=e[r],f?f=!1:i+=",",i+=u+":"+t(n.fields[u]);return i+"}"}(n.mapValue):o();var i,r,u}(n)}function to(n){var r,t,i,u;return(c(!!n),"string"!=typeof n)?{seconds:ni(n.seconds),nanos:ni(n.nanos)}:(r=0,t=yut.exec(n),(c(!!t),t[1])&&(i=t[1],i=(i+"000000000").substr(0,9),r=Number(i)),u=new Date(n),{seconds:Math.floor(u.getTime()/1e3),nanos:r})}function ni(n){return"number"==typeof n?n:"string"==typeof n?Number(n):0}function lh(n){return"string"==typeof n?gt.fromBase64String(n):gt.fromUint8Array(n)}function ay(n,t){return{referenceValue:"projects/"+n.projectId+"/databases/"+n.database+"/documents/"+t.path.j()}}function nd(n){return n&&"integerValue"in n}function td(n){return!!n&&"arrayValue"in n}function wut(n){return n&&"nullValue"in n}function but(n){return n&&"doubleValue"in n&&isNaN(Number(n.doubleValue))}function id(n){return n&&"mapValue"in n}function vh(){}function bo(n,t){this.serializer=n;this.ct=t}function ko(n){this.elements=n}function go(n){this.elements=n}function kut(n){return td(n)&&n.arrayValue.values?n.arrayValue.values.slice():[]}function uat(n,t){this.version=n;this.transformResults=t}function wh(n){void 0===n&&(n=gf.empty());this.Ct=n;this.Ft=new Map}function yl(n){this.proto=n}function ts(n,t){var i=this;return(i=dut.call(this)||this).key=n,i.Rt=t,i.type=4,i}function is(n,t){var i=this;return(i=gut.call(this)||this).key=n,i.Rt=t,i.type=3,i}function au(n,t){var i=this;return(i=nft.call(this)||this).key=n,i.fieldTransforms=t,i.type=2,i.Rt=tr.exists(!0),i}function ne(n,t,i,r){var u=this;return(u=tft.call(this)||this).key=n,u.data=t,u.Vt=i,u.Rt=r,u.type=1,u}function rs(n,t,i){var r=this;return(r=ift.call(this)||this).key=n,r.value=t,r.Rt=i,r.type=0,r}function sd(){}function hf(n,t){this.updateTime=n;this.exists=t}function rft(n,t){this.field=n;this.transform=t}function hd(n){(this.fields=n).sort(vr.N)}function uft(n){var t=[];return ch(n.fields||{},function(n,i){var u=new vr([n]),f,r,e,o;if(id(i))if(f=uft(i.mapValue).fields,0===f.length)t.push(u);else for(r=0,e=f;r<e.length;r++)o=e[r],t.push(u.child(o));else t.push(u)}),new yh(t)}function cd(n,t){this.key=n;this.version=t}function fat(n){this.count=n}function fs(n,t,i,r,u,f,e){void 0===u&&(u=g.min());void 0===f&&(f=g.min());void 0===e&&(e=gt.ht);this.target=n;this.targetId=t;this.Te=i;this.sequenceNumber=r;this.Ee=u;this.lastLimboFreeSnapshotVersion=f;this.resumeToken=e}function wl(n,t){this.field=n;void 0===t&&(t="asc");this.dir=t;this.fe=n.Y()}function wy(n,t){this.position=n;this.before=t}function ad(n,t){return fft.call(this,n,"array-contains-any",t)||this}function vd(n,t){return eft.call(this,n,"in",t)||this}function yd(n,t){return oft.call(this,n,"array-contains",t)||this}function pd(n,t){var i=this;return(i=sft.call(this,n,"in",t)||this).keys=(t.arrayValue.values||[]).map(function(n){return l.Z(n.referenceValue)}),i}function wd(n,t,i){var r=this;return(r=hft.call(this,n,t,i)||this).key=l.Z(i.referenceValue),r}function dr(n,t,i){var r=this;return(r=cft.call(this)||this).field=n,r.op=t,r.value=i,r}function w(n,t,i,r,u,f,e,o){void 0===t&&(t=null);void 0===i&&(i=[]);void 0===r&&(r=[]);void 0===u&&(u=null);void 0===f&&(f="F");void 0===e&&(e=null);void 0===o&&(o=null);this.path=n;this.collectionGroup=t;this.xt=i;this.filters=r;this.limit=u;this.Bt=f;this.startAt=e;this.endAt=o;this.qt=null;this.Ut=null;this.startAt&&this.Qt(this.startAt);this.endAt&&this.Qt(this.endAt)}function bl(n,t,i,r,u,f,e){void 0===t&&(t=null);void 0===i&&(i=[]);void 0===r&&(r=[]);void 0===u&&(u=null);void 0===f&&(f=null);void 0===e&&(e=null);this.path=n;this.collectionGroup=t;this.orderBy=i;this.filters=r;this.limit=u;this.startAt=f;this.endAt=e;this.Lt=null}function kh(){return null!==ld&&ld.apply(this,arguments)||this}function dh(n,t,i){var r=this;return(r=lft.call(this,n,t)||this).hasCommittedMutations=!(!i||!i.hasCommittedMutations),r}function te(n,t,i,r){var u=this;return(u=aft.call(this,n,t)||this).$t=i,u.At=!!r.At,u.hasCommittedMutations=!!r.hasCommittedMutations,u}function bd(n){switch(n){case t.OK:return o();case t.CANCELLED:case t.UNKNOWN:case t.DEADLINE_EXCEEDED:case t.RESOURCE_EXHAUSTED:case t.INTERNAL:case t.UNAVAILABLE:case t.UNAUTHENTICATED:return;case t.INVALID_ARGUMENT:case t.NOT_FOUND:case t.ALREADY_EXISTS:case t.PERMISSION_DENIED:case t.FAILED_PRECONDITION:case t.ABORTED:case t.OUT_OF_RANGE:case t.UNIMPLEMENTED:case t.DATA_LOSS:return 1;default:return o()}}function yft(n){if(void 0===n)return lt("GRPC error has no .code"),t.UNKNOWN;switch(n){case ti.OK:return t.OK;case ti.CANCELLED:return t.CANCELLED;case ti.UNKNOWN:return t.UNKNOWN;case ti.DEADLINE_EXCEEDED:return t.DEADLINE_EXCEEDED;case ti.RESOURCE_EXHAUSTED:return t.RESOURCE_EXHAUSTED;case ti.INTERNAL:return t.INTERNAL;case ti.UNAVAILABLE:return t.UNAVAILABLE;case ti.UNAUTHENTICATED:return t.UNAUTHENTICATED;case ti.INVALID_ARGUMENT:return t.INVALID_ARGUMENT;case ti.NOT_FOUND:return t.NOT_FOUND;case ti.ALREADY_EXISTS:return t.ALREADY_EXISTS;case ti.PERMISSION_DENIED:return t.PERMISSION_DENIED;case ti.FAILED_PRECONDITION:return t.FAILED_PRECONDITION;case ti.ABORTED:return t.ABORTED;case ti.OUT_OF_RANGE:return t.OUT_OF_RANGE;case ti.UNIMPLEMENTED:return t.UNIMPLEMENTED;case ti.DATA_LOSS:return t.DATA_LOSS;default:return o()}}function ut(n,t,i,r,u){this.key=n;this.value=t;this.color=null!=i?i:ut.RED;this.left=null!=r?r:ut.EMPTY;this.right=null!=u?u:ut.EMPTY;this.size=this.left.size+1+this.right.size}function ky(n,t,i,r){this.Ce=r;this.Fe=[];for(var u=1;!n.B();)if(u=t?i(n.key,t):1,r&&(u*=-1),u<0)n=this.Ce?n.left:n.right;else{if(0===u){this.Fe.push(n);break}this.Fe.push(n);n=this.Ce?n.right:n.left}}function fi(n,t){this.N=n;this.root=t||io.EMPTY}function pi(){this.size=0}function kd(n){this.Ye=n}function yt(n){this.N=n;this.data=new ir(this.N)}function es(){return lat}function dy(){return es()}function kl(){return wft}function kft(){return bft}function ft(){for(var f,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var i=dft,r=0,u=t;r<u.length;r++)f=u[r],i=i.add(f);return i}function gy(){return gft}function np(n,t,i,r){this.ws=n;this.removedTargetIds=t;this.key=i;this.Rs=r}function net(n,t){this.targetId=n;this.As=t}function tet(n,t,i,r){void 0===i&&(i=gt.ht);void 0===r&&(r=null);this.state=n;this.targetIds=t;this.resumeToken=i;this.cause=r}function wi(n){this.Ms=n;this.Ls=new Map;this.Os=es();this.xs=fet();this.Bs=new ei(p)}function gr(){this.ms=0;this.Ps=eet();this.Vs=gt.ht;this.gs=!1;this.ps=!0}function ng(n,t,i,r,u){this.resumeToken=n;this.fs=t;this.Ts=i;this.Es=r;this.Is=u}function tg(n,t,i,r,u){this.Ee=n;this.as=t;this.us=i;this.cs=r;this._s=u}function dl(n,t,i,r,u,f,e,o){this.query=n;this.docs=t;this.ss=i;this.docChanges=r;this.ns=u;this.fromCache=f;this.rs=e;this.hs=o}function ig(){this.ts=new ir(l.N)}function ci(n){this.N=n?function(t,i){return n(t,i)||l.N(t.key,i.key)}:function(n,t){return l.N(n.key,t.key)};this.Je=kl();this.Xe=new ir(this.N)}function fet(){return new ir(l.N)}function eet(){return new ir(l.N)}function s(n,t){this.ii=n;this.options=t}function oet(n){return 4<=n.length&&"projects"===n.get(0)&&"databases"===n.get(2)}function os(){}function ip(){return ie.logLevel}function rg(n){ie.logLevel=n}function e(n){for(var r,i=[],t=1;t<arguments.length;t++)i[t-1]=arguments[t];ie.logLevel<=d.DEBUG&&(r=i.map(set),ie.debug.apply(ie,ih(["Firestore ("+hy+"): "+n],r)))}function lt(n){for(var r,i=[],t=1;t<arguments.length;t++)i[t-1]=arguments[t];ie.logLevel<=d.ERROR&&(r=i.map(set),ie.error.apply(ie,ih(["Firestore ("+hy+"): "+n],r)))}function set(n){if("string"==typeof n)return n;var t=vu.nt();try{return t.un(n)}catch(t){return n}}function o(n){void 0===n&&(n="Unexpected state");var t="FIRESTORE ("+hy+") INTERNAL ASSERTION FAILED: "+n;throw lt(t),new Error(t);}function c(n){n||o()}function rp(n){return n}function het(){}function p(n,t){return n<t?-1:t<n?1:0}function ss(n,t,i){return n.length===t.length&&n.every(function(n,r){return i(n,t[r])})}function cet(n){return n+"\0"}function wat(n,t,i,r,u){this.ii=n;this.persistenceKey=t;this.host=i;this.ssl=r;this.forceLongPolling=u}function og(n,t){var i=this;this.previousValue=n;t&&(t.ur=function(n){return i.cr(n)},this._r=function(n){return t.lr(n)})}function sg(n,t,i,r){this.targetId=n;this.fromCache=t;this.hr=i;this.or=r}function pu(n,t,i){this.Qn=n;this.Wn=t;this.jn=i}function hg(){this.Bn=[]}function ro(){this.Dn=new gh(function(n){return n.toString()});this.Cn=!1}function at(n){var t=this;this.An=null;this.mn=null;this.result=void 0;this.error=void 0;this.Pn=!1;this.Vn=!1;n(function(n){t.Pn=!0;t.result=n;t.An&&t.An(n)},function(n){t.Pn=!0;t.error=n;t.mn&&t.mn(n)})}function cg(n,t,i,r,u){this.batch=n;this.wn=t;this.En=i;this.streamToken=r;this.Rn=u}function nc(n,t,i,r){this.batchId=n;this.Tn=t;this.baseMutations=i;this.mutations=r}function hs(n){this.dn=n;this.fn={}}function gl(n,t){this.projectId=n;this.database=t||"(default)"}function re(){var n=this;this.promise=new Promise(function(t,i){n.resolve=t;n.reject=i})}function bi(){var t=this,n;this.Mr=Promise.resolve();this.Lr=Promise.resolve();this.Or=!1;this.xr=[];this.Br=null;this.qr=!1;this.Ur=[];this.Qr=new lg(this,"async_queue_retry");this.Wr=function(){t.jr("async_queue_retry")};n=vu.nt().window;n&&"function"==typeof n.addEventListener&&n.addEventListener("visibilitychange",this.Wr)}function uo(n,t,i,r,u){this.br=n;this.Er=t;this.vr=i;this.op=r;this.Sr=u;this.Dr=new re;this.then=this.Dr.promise.then.bind(this.Dr.promise);this.catch=this.Dr.promise.catch.bind(this.Dr.promise);this.Dr.promise.catch(function(){})}function tc(n,t,i,r,u){void 0===i&&(i=1e3);void 0===r&&(r=1.5);void 0===u&&(u=6e4);this.Tr=n;this.Er=t;this.Ir=i;this.wr=r;this.Rr=u;this.Ar=0;this.mr=null;this.Pr=Date.now();this.reset()}function wet(n,t){var r=n[0],u=n[1],f=t[0],e=t[1],i=p(r,f);return 0===i?p(u,e):i}function na(n,t,i){this.dh=n;this.fh=t;this.Th=i}function up(n){this.nh=n;this.buffer=new ei(wet);this.rh=0}function fo(n,t){this.Dh=n;this.yh=t}function ta(n,t){this.Vh=n;this.br=t;this.gh=!1;this.ph=null}function wu(n){for(var t="",i=0;i<n.length;i++)0<t.length&&(t=get(t)),t=tvt(n.get(i),t);return get(t)}function tvt(n,t){for(var u,i=t,f=n.length,r=0;r<f;r++){u=n.charAt(r);switch(u){case"\0":i+="\x01\x10";break;case"\x01":i+="\x01\x11";break;default:i+=u}}return i}function get(n){return n+"\x01\x01"}function ue(n){var u=n.length,t,e,f;if(c(2<=u),2===u)return c("\x01"===n.charAt(0)&&"\x01"===n.charAt(1)),ot.G;for(var h=u-2,s=[],i="",r=0;r<u;){t=n.indexOf("\x01",r);switch((t<0||h<t)&&o(),n.charAt(t+1)){case"\x01":e=n.substring(r,t);f=void 0;0===i.length?f=e:(f=i+=e,i="");s.push(f);break;case"\x10":i+=n.substring(r,t);i+="\0";break;case"\x11":i+=n.substring(r,t+1);break;default:o()}r=t+2}return new ot(s)}function nu(n){this.store=n}function rc(n){var t=this;this.transaction=n;this.aborted=!1;this.to=new re;this.transaction.oncomplete=function(){t.to.resolve()};this.transaction.onabort=function(){n.error?t.to.reject(new tot(n.error)):t.to.resolve()};this.transaction.onerror=function(n){var i=vg(n.target.error);t.to.reject(new tot(i))}}function rot(n){var i=this;return(i=not.call(this,t.UNAVAILABLE,"IndexedDB transaction failed: "+n)||this).name="IndexedDbTransactionError",i}function cs(n){this.Hh=n;this.Yh=!1;this.Jh=null}function rr(n){this.db=n;12.2===rr.Bh(ao())&&lt("Firestore persistence suffers from a bug in iOS 12.2 Safari that may cause your app to stop working. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.")}function ls(n){return new r(function(t,i){n.onsuccess=function(n){var i=n.target.result;t(i)};n.onerror=function(n){var t=vg(n.target.error);i(t)}})}function vg(n){var u=ic.Bh(ao()),t,r;return 12.2<=u&&u<13&&(t="An internal error was encountered in the Indexed Database server",0<=n.message.indexOf(t))?(r=new i("internal","IOS_INDEXEDDB_BUG1: IndexedDb has thrown '"+t+"'. This is likely due to an unavoidable bug in iOS. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround."),ag||(ag=!0,setTimeout(function(){throw r;},0)),r):n}function pt(n,t,i,r){this.userId=n;this.serializer=t;this.jn=i;this.oo=r;this.ao={}}function fot(n,t,i){var r=ki.prefixForPath(t,i.path),f=r[1],e=IDBKeyRange.lowerBound(r),u=!1;return uc(n).ro({range:e,no:!0},function(n,i,r){var e=n[0],o=n[1];n[2];e===t&&o===f&&(u=!0);r.done()}).next(function(){return u})}function eot(n,t,i){var a=n.store(et.store),v=n.store(ki.store),u=[],y=IDBKeyRange.only(i.batchId),o=0,p=a.ro({range:y},function(n,t,i){return o++,i.delete()}),e,l;u.push(p.next(function(){c(1===o)}));for(var s=[],f=0,h=i.mutations;f<h.length;f++)e=h[f],l=ki.key(t,e.key.path,i.batchId),u.push(v.delete(l)),s.push(e.key);return r.vn(u).next(function(){return s})}function eo(n){return sr.Kh(n,et.store)}function uc(n){return sr.Kh(n,ki.store)}function fp(n){return sr.Kh(n,fe.store)}function wt(n,t){this.oo=n;this.serializer=t}function fc(n){this.Fo=n}function ec(n){return sr.Kh(n,or.store)}function sot(n){return ic.Kh(n,yr.store).get(yr.key).next(function(n){return c(null!==n),n})}function yg(n){return sot(n).next(function(n){return n.highestListenSequenceNumber})}function oo(n){return sr.Kh(n,ai.store)}function li(n,t){this.serializer=n;this.jn=t}function cot(n){return sr.Kh(n,bu.store)}function so(n){return sr.Kh(n,vt.store)}function ep(n){return n.path.W()}function op(n){var t;if(n.document)t=n.document;else if(n.unknownDocument)t=n.unknownDocument;else{if(!n.noDocument)throw o();t=n.noDocument}return JSON.stringify(t).length}function ra(n,t){var i=this;return(i=hot.call(this)||this).Aa=n,i.wa=t,i.ma=new gh(function(n){return n.toString()}),i}function uvt(n,t){this.seconds=n;this.nanoseconds=t}function as(n){this.serializer=n}function hp(){this.index={}}function bg(){this.Va=new wg}function cp(){}function ovt(n,t){this.path=n;this.readTime=t}function svt(n,t){this.path=n;this.version=t}function lot(n){n.createObjectStore(ai.store,{keyPath:ai.keyPath}).createIndex(ai.documentTargetsIndex,ai.documentTargetsKeyPath,{unique:!0});n.createObjectStore(or.store,{keyPath:or.keyPath}).createIndex(or.queryTargetsIndexName,or.queryTargetsKeyPath,{unique:!0});n.createObjectStore(yr.store)}function dg(){this.ga=new wg}function vot(n){return sr.Kh(n,ho.store)}function v(n,r,u,f,e,o,s,h){if(this.allowTabSynchronization=n,this.persistenceKey=r,this.clientId=u,this.Tr=o,this.Sa=h,this.Da=!1,this.isPrimary=!1,this.networkEnabled=!0,this.Ca=null,this.inForeground=!1,this.Fa=null,this.Na=null,this.ka=Number.NEGATIVE_INFINITY,this.$a=function(){return Promise.resolve()},!v.Uh())throw new i(t.UNIMPLEMENTED,"This platform is either missing IndexedDB or is known to have an incomplete implementation. Offline persistence has been disabled.");if(this.oo=new kot(this,e),this.Ma=r+v.La,this.serializer=new hvt(s),this.document=f.document,this.Oa=new oot(this.oo,this.serializer),this.jn=new aot,this.Qn=new pg(this.serializer,this.jn),!f.window||!f.window.localStorage)throw new i(t.UNIMPLEMENTED,"IndexedDB persistence is only available on platforms that support LocalStorage.");this.window=f.window;this.xa=this.window.localStorage}function bot(n,t){var i=this;return(i=yot.call(this)||this).bo=n,i.va=t,i}function du(n){this.pa=n}function ua(n){return n.store(tu.store)}function lp(n){return n.store(ku.store)}function hr(n,t){this.db=n;this.Vh=new det(this,t)}function ap(n,t){return oo(n).put((i=t,r=n.va,new ai(0,wu(i.path),r)));var i,r}function bt(n,t,i){this.persistence=n;this.Pu=t;this.Vu=new ir(p);this.gu=new gh(function(n){return n.canonicalId()});this.pu=g.min();this.Wn=n.lu(i);this.yu=n.fu();this.Oa=n.du();this.bu=new pet(this.yu,this.Wn,this.persistence.Tu());this.Pu.vu(this.bu)}function cf(n,t,i){var r=this;return(r=dot.call(this,n,t,i)||this).persistence=n,r.Wn=n.lu(i),r.yu=n.fu(),r.Oa=n.du(),r}function ee(n){return f(this,void 0,void 0,function(){return u(this,function(){if(n.code!==t.FAILED_PRECONDITION||n.message!==vet)throw n;return e("LocalStore","Unexpectedly lost primary lease"),[2]})})}function gg(n,t){this.key=n;this.hc=t}function gu(){this.Yu=new ei(oi.Ju);this.Xu=new ei(oi.Zu)}function nst(n,r){if(0!==r.length)throw new i(t.INVALID_ARGUMENT,"Function "+n+"() does not support arguments, but was called with "+sc(r.length,"argument")+".");}function ht(n,r,u){if(r.length!==u)throw new i(t.INVALID_ARGUMENT,"Function "+n+"() requires "+sc(u,"argument")+", but was called with "+sc(r.length,"argument")+".");}function oe(n,r,u){if(r.length<u)throw new i(t.INVALID_ARGUMENT,"Function "+n+"() requires at least "+sc(u,"argument")+", but was called with "+sc(r.length,"argument")+".");}function ou(n,r,u,f){if(r.length<u||r.length>f)throw new i(t.INVALID_ARGUMENT,"Function "+n+"() requires between "+u+" and "+f+" arguments, but was called with "+sc(r.length,"argument")+".");}function kt(n,t,i,r){rst(n,t,fa(i)+" argument",r)}function oc(n,t,i,r){void 0!==r&&kt(n,t,i,r)}function tst(n,t,i,r){rst(n,t,i+" option",r)}function se(n,t,i,r){void 0!==r&&tst(n,t,i,r)}function ist(n,r,u,f,e){void 0!==f&&function(n,r,u){for(var o,c,s=[],f=0,h=e;f<h.length;f++){if(o=h[f],o===u)return;s.push(lf(o))}c=lf(u);throw new i(t.INVALID_ARGUMENT,"Invalid value "+c+" provided to function "+n+'() for option "'+r+'". Acceptable values: '+s.join(", "));}(n,u,f)}function rst(n,r,u,f){if(!("object"===r?ust(f):"non-empty string"===r?"string"==typeof f&&""!==f:typeof f===r)){var e=lf(f);throw new i(t.INVALID_ARGUMENT,"Function "+n+"() requires its "+u+" to be of type "+r+", but it was: "+e);}}function ust(n){return"object"==typeof n&&null!==n&&(Object.getPrototypeOf(n)===Object.prototype||null===Object.getPrototypeOf(n))}function lf(n){if(void 0===n)return"undefined";if(null===n)return"null";if("string"==typeof n)return 20<n.length&&(n=n.substring(0,20)+"..."),JSON.stringify(n);if("number"==typeof n||"boolean"==typeof n)return""+n;if("object"!=typeof n)return"function"==typeof n?"a function":o();if(n instanceof Array)return"an array";var t=function(){if(n.constructor){var t=/function\s+([^\s(]+)\s*\(/.exec(n.constructor.toString());if(t&&1<t.length)return t[1]}return null}();return t?"a custom "+t+" object":"an object"}function fst(n,r,u){if(void 0===u)throw new i(t.INVALID_ARGUMENT,"Function "+n+"() requires a valid "+fa(r)+" argument, but it was undefined.");}function vs(n,r,u){ch(r,function(r){if(u.indexOf(r)<0)throw new i(t.INVALID_ARGUMENT,"Unknown option '"+r+"' passed to function "+n+"(). Available options: "+u.join(", "));})}function ys(n,r,u,f){var e=lf(f);return new i(t.INVALID_ARGUMENT,"Function "+n+"() requires its "+fa(u)+" argument to be a "+r+", but it was: "+e)}function est(n,r,u){if(u<=0)throw new i(t.INVALID_ARGUMENT,'Function "'+n+'()" requires its '+fa(r)+" argument to be a positive number, but it was: "+u+".");}function fa(n){switch(n){case 1:return"first";case 2:return"second";case 3:return"third";default:return n+"th"}}function sc(n,t){return n+" "+t+(1===n?"":"s")}function ost(){if("undefined"==typeof Uint8Array)throw new i(t.UNIMPLEMENTED,"Uint8Arrays are not available in this environment.");}function nn(){if(!vu.nt().oc)throw new i(t.UNIMPLEMENTED,"Blobs are unavailable in Firestore in this environment.");}function oa(){for(var r,n=[],u=0;u<arguments.length;u++)n[u]=arguments[u];for(!function(){if(!(n instanceof Array)||n.length<1)throw new i(t.INVALID_ARGUMENT,"Function FieldPath() requires its fieldNames argument to be an array with at least 1 element.");}(),r=0;r<n.length;++r)if(kt("FieldPath","string",r,n[r]),0===n[r].length)throw new i(t.INVALID_ARGUMENT,"Invalid field name at argument $(i + 1). Field names must not be empty.");this.uc=new vr(n)}function he(n){nn();this.ac=n}function pst(n,t,i){this.data=n;this.Vt=t;this.fieldTransforms=i}function wst(n,t,i){this.data=n;this.Vt=t;this.fieldTransforms=i}function sa(n,r){if(ht("GeoPoint",arguments,2),kt("GeoPoint","number",1,n),kt("GeoPoint","number",2,r),!isFinite(n)||n<-90||90<n)throw new i(t.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+n);if(!isFinite(r)||r<-180||180<r)throw new i(t.INVALID_ARGUMENT,"Longitude must be a number between -180 and 180, but was: "+r);this.Ic=n;this.wc=r}function wp(n){var t=this;return(t=sst.call(this,"FieldValue.increment")||this).Ec=n,t}function bp(n){var t=this;return(t=hst.call(this,"FieldValue.arrayRemove")||this).fc=n,t}function kp(n){var t=this;return(t=cst.call(this,"FieldValue.arrayUnion")||this).fc=n,t}function ha(){return lst.call(this,"FieldValue.serverTimestamp")||this}function ca(){return ast.call(this,"FieldValue.delete")||this}function bst(n){switch(n){case 0:case 2:case 1:return 1;case 3:case 4:return;default:throw o();}}function ws(n,t){this.ii=n;this.serializer=t||vu.nt().yc(n)}function hu(n,t,i,r,u){this.settings=n;this.ii=t;this.serializer=i;void 0===r&&this.Ac();this.fieldTransforms=r||[];this.Vt=u||[]}function co(n,t){if(dst(n))return dp("Unsupported field value:",t,n),rn(n,t);if(n instanceof ps)return function(n,t){if(!bst(t.lc))throw t.dc(n._c+"() can only be used with update() and set()");if(null===t.path)throw t.dc(n._c+"() is not currently supported inside arrays");var i=n.Di(t);i&&t.fieldTransforms.push(i)}(n,t),null;if(t.path&&t.Vt.push(t.path),n instanceof Array){if(t.settings.Tc&&4!==t.lc)throw t.dc("Nested arrays are not supported");return function(t){for(var i,u=[],f=0,r=0,e=n;r<e.length;r++)i=co(e[r],t.pc(f)),null==i&&(i={nullValue:"NULL_VALUE"}),u.push(i),f++;return{arrayValue:{values:u}}}(t)}return function(n,t){var u,f,i,r;if(null===n)return{nullValue:"NULL_VALUE"};if("number"==typeof n)return t.serializer.ai(n);if("boolean"==typeof n)return{booleanValue:n};if("string"==typeof n)return{stringValue:n};if(n instanceof Date)return u=ar.fromDate(n),{timestampValue:t.serializer.C(u)};if(n instanceof ar)return f=new ar(n.seconds,1e3*Math.floor(n.nanoseconds/1e3)),{timestampValue:t.serializer.C(f)};if(n instanceof pp)return{geoPointValue:{latitude:n.latitude,longitude:n.longitude}};if(n instanceof ea)return{bytesValue:t.serializer.ui(n)};if(n instanceof yf){if(i=t.ii,r=n.firestore.Nc,!r.isEqual(i))throw t.dc("Document reference is for database "+r.projectId+"/"+r.database+" but should be for database "+i.projectId+"/"+i.database);return{referenceValue:t.serializer._i(n.kc.path,n.firestore.Nc)}}throw t.dc("Unsupported field value: "+lf(n));}(n,t)}function rn(n,t){var i={};return aut(n)?t.path&&0<t.path.length&&t.Vt.push(t.path):ch(n,function(n,r){var u=co(r,t.Pc(n));null!=u&&(i[n]=u)}),{mapValue:{fields:i}}}function dst(n){return!("object"!=typeof n||null===n||n instanceof Array||n instanceof Date||n instanceof ar||n instanceof pp||n instanceof ea||n instanceof yf||n instanceof ps)}function dp(n,t,i){if(!dst(i)||!ust(i)){var r=lf(i);throw"an object"===r?t.dc(n+" a custom object"):t.dc(n+" "+r);}}function aa(n,r){if(r instanceof su)return r.uc;if("string"==typeof r)return un(n,r);throw new i(t.INVALID_ARGUMENT,"Function "+n+"() called with invalid data. Field path arguments must be of type string or FieldPath.");}function un(n,r){try{return function(n){if(0<=n.search(cvt))throw new i(t.INVALID_ARGUMENT,"Invalid field path ("+n+"). Paths must not contain '~', '*', '/', '[', or ']'");try{return new(su.bind.apply(su,ih([void 0],n.split("."))))}catch(r){throw new i(t.INVALID_ARGUMENT,"Invalid field path ("+n+"). Paths must not be empty, begin with '.', end with '.', or contain '..'");}}(r).uc}catch(r){var u=r instanceof Error?r.message:r.toString();throw new i(t.INVALID_ARGUMENT,"Function "+n+"() called with invalid data. "+u);}}function gst(n,t){return n.some(function(n){return n.isEqual(t)})}function y(n,t,i,r,o){var c,l,a,s,v,y,p,h,w=this;this.F_=n;this.f_=t;this.br=i;this.N_=[];this.k_=new Map;this.M_=null;this.networkEnabled=!1;this.isPrimary=!1;this.L_=!1;this.O_=o;this.O_.x_(function(){i.$r(function(){return f(w,void 0,void 0,function(){return u(this,function(n){switch(n.label){case 0:return this.B_()?(e("RemoteStore","Restarting streams for network reachability change."),[4,this.q_()]):[3,2];case 1:n.sent();n.label=2;case 2:return[2]}})})})});this.U_=new gvt(i,r);this.Q_=(v=this.f_,y=i,p={t_:this.W_.bind(this),Hc:this.j_.bind(this),s_:this.K_.bind(this)},h=rp(v),new wvt(y,h.Mc,h.credentials,h.serializer,p));this.G_=(c=this.f_,l=i,a={t_:this.z_.bind(this),Hc:this.H_.bind(this),u_:this.Y_.bind(this),a_:this.a_.bind(this)},s=rp(c),new bvt(l,s.Mc,s.credentials,s.serializer,a))}function bs(n,t){this.br=n;this.V_=t;this.state="Unknown";this.g_=0;this.p_=null;this.y_=!0}function nf(n){this.f_=n;this.T_=kft();this.mutations=[];this.E_=!1;this.I_=null;this.w_=new Set}function gp(n,t,i){var r=this;return(r=nht.call(this)||this).Mc=n,r.credentials=t,r.serializer=i,r}function ce(n,t,i,r,u){var f=this;return(f=fn.call(this,n,"write_stream_connection_backoff","write_stream_idle",t,i,u)||this).serializer=r,f.r_=!1,f.lastStreamToken=gt.ht,f}function hc(n,t,i,r,u){var f=this;return(f=tht.call(this,n,"listen_stream_connection_backoff","listen_stream_idle",t,i,u)||this).serializer=r,f}function di(n,t,i,r,u,f){this.Tr=n;this.$c=i;this.Mc=r;this.Lc=u;this.listener=f;this.state=0;this.Oc=0;this.xc=null;this.stream=null;this.Qr=new lg(n,t)}function rht(n,t){return"firestore_clients_"+n+"_"+t}function uht(n,t,i){var r="firestore_mutations_"+n+"_"+i;return t.t()&&(r+="_"+t.uid),r}function en(n,t){return"firestore_targets_"+n+"_"+t}function fht(n){this.key=n}function eht(n){this.key=n}function tyt(n,t,i){this.query=n;this.targetId=t;this.view=i}function iyt(n){this.key=n;this.Bd=!1}function ryt(){this.Pf=void 0;this.Vf=[]}function af(n,t){this.jn=n;this.Kf=t;this.docs=new ir(l.N);this.size=0}function dt(n,t){this.jn=n;this.oo=t;this.Wn=[];this.Bf=1;this.lastStreamToken=gt.ht;this.qf=new ei(oi.Ju)}function lc(){}function ks(n,t,i){this.query=n;this.Df=t;this.Cf=!1;this.Ff=null;this.onlineState="Unknown";this.options=i||{}}function le(n){this.hl=n;this.gf=new gh(function(n){return n.canonicalId()});this.onlineState="Unknown";this.pf=new Set;this.hl.subscribe(this)}function cr(n,t,i,r,u){var f=this;return(f=cc.call(this,n,t,i,r,u)||this).F_=n,f.isPrimary=void 0,f}function rt(n,t,i,r,u){this.F_=n;this.Nd=t;this.qd=i;this.currentUser=r;this.Ud=u;this.Qd=null;this.Wd=new gh(function(n){return n.canonicalId()});this.jd=new Map;this.Kd=[];this.Gd=new ir(l.N);this.zd=new Map;this.Hd=new yp;this.Yd={};this.Jd=new Map;this.Xd=ia.ko();this.onlineState="Unknown"}function ac(n,t,i,r){this.br=n;this.Nd=t;this.updateFunction=i;this.Dr=r;this.kd=5;this.Qr=new lg(this.br,"transaction_retry")}function tf(n,t){this.query=n;this.Id=t;this.wd=null;this.fs=!1;this.Rd=ft();this.ns=ft();this.Ad=new iet(n.se.bind(n))}function lr(){this.Td=new sn;this.Ed={};this.hl=null;this.V_=null;this.ur=null}function b(n,r,u,f,e){if(this.Tr=n,this.platform=r,this.persistenceKey=u,this.bl=f,this.hl=null,this.V_=null,this.ur=null,this.vl=this.Sl.bind(this),this.Dl=new ir(p),this.vh=!1,this.Cl=[],!b.Uh(this.platform))throw new i(t.UNIMPLEMENTED,"LocalStorage is not available on this platform.");var o=u.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");this.storage=this.platform.window.localStorage;this.currentUser=e;this.Fl=rht(this.persistenceKey,this.bl);this.Nl="firestore_sequence_number_"+this.persistenceKey;this.Dl=this.Dl.Ae(this.bl,new sn);this.kl=new RegExp("^firestore_clients_"+o+"_([^_]*)$");this.$l=new RegExp("^firestore_mutations_"+o+"_(\\d+)(?:_(.*))?$");this.Ml=new RegExp("^firestore_targets_"+o+"_(\\d+)$");this.Ll="firestore_online_state_"+this.persistenceKey;this.platform.window.addEventListener("storage",this.vl)}function nw(){this.activeTargetIds=gy()}function cn(n,t){this.clientId=n;this.onlineState=t}function ln(n,t){this.clientId=n;this.activeTargetIds=t}function tw(n,t,i){this.targetId=n;this.state=t;this.error=i}function iw(n,t,i,r){this.user=n;this.batchId=t;this.state=i;this.error=r}function va(n){var t=this;return(t=oht.call(this)||this).Aa=n,t}function ya(n){this.observer=n;this.muted=!1}function ri(n,t,i,r){this.platform=n;this.RT=t;this.credentials=i;this.br=r;this.clientId=ug.cn()}function ae(){return null!==rw&&rw.apply(this,arguments)||this}function vf(){}function iu(n){this.persistence=n;this.iT=new yp;this.nT=null}function wht(n){var t=this;return(t=pht.call(this)||this).va=n,t}function rf(n){var t=this;this.Xf={};this.ja=new yu(0);this.Da=!1;this.Da=!0;this.oo=n(this);this.Oa=new cyt(this);this.jn=new fvt;this.Qn=new yht(this.jn,function(n){return t.oo.Zf(n)})}function vi(n){this.persistence=n;this.zf=new gh(function(n){return n.canonicalId()});this.lastRemoteSnapshotVersion=g.min();this.highestTargetId=0;this.Hf=0;this.Yf=new yp;this.targetCount=0;this.Jf=ia.No()}function pa(n){return function(){var i;if("object"==typeof n&&null!==n)for(var r=n,t=0,u=["next","error","complete"];t<u.length;t++)if(i=u[t],i in r&&"function"==typeof r[i])return 1}()}function ve(n,r,u){var f=this;if(((f=bht.call(this,us.Wt(n),r,u)||this).SE=n).length%2!=1)throw new i(t.INVALID_ARGUMENT,"Invalid collection reference. Collection references must have an odd number of segments, but "+n.j()+" has "+n.length);return f}function pf(n,t,i,r){this.iE=n;this.gE=t;this.pE=i;this.rE=r;this.yE=null;this.bE=null;this.metadata=new ict(i.hasPendingWrites,i.fromCache)}function tt(n,t,i){this.fE=n;this.firestore=t;this.rE=i}function pn(){return null!==fw&&fw.apply(this,arguments)||this}function ye(n,t,i,r,u,f){this.iE=n;this.kc=t;this._E=i;this.lE=r;this.dE=u;this.rE=f}function rct(n,t){this.hasPendingWrites=n;this.fromCache=t}function yi(n,t,i){this.kc=n;this.firestore=t;this.rE=i;this.QT=this.firestore.UT()}function vc(n){this.iE=n;this.hE=[];this.oE=!1}function ba(n,t){this.iE=n;this.nE=t}function st(n,r,e){var h=this,o,s;if(void 0===e&&(e=new uw),this.BT=null,this.qT=new gat,this.INTERNAL={"delete":function(){return f(h,void 0,void 0,function(){return u(this,function(n){switch(n.label){case 0:return this.UT(),[4,this.QT.terminate()];case 1:return n.sent(),[2]}})})}},"object"==typeof n.options)o=n,this.BT=o,this.Nc=st.WT(o),this.jT=o.name,this.KT=new tat(r);else{if(s=n,!s.projectId)throw new i(t.INVALID_ARGUMENT,"Must provide projectId");this.Nc=new fg(s.projectId,s.database);this.jT="[DEFAULT]";this.KT=new eut}this.GT=e;this.zT=new ght({});this.HT=new kst(this.Nc)}function uct(n){var r,u;if(void 0===n.host){if(void 0!==n.ssl)throw new i(t.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host="firestore.googleapis.com";this.ssl=!0}else tst("settings","non-empty string","host",n.host),this.host=n.host,se("settings","boolean","ssl",n.ssl),this.ssl=null===(r=n.ssl)||void 0===r||r;if(vs("settings",n,["host","ssl","credentials","timestampsInSnapshots","cacheSizeBytes","experimentalForceLongPolling"]),se("settings","object","credentials",n.credentials),this.credentials=n.credentials,se("settings","boolean","timestampsInSnapshots",n.timestampsInSnapshots),!0===n.timestampsInSnapshots?lt("The setting 'timestampsInSnapshots: true' is no longer required and should be removed."):!1===n.timestampsInSnapshots&&lt("Support for 'timestampsInSnapshots: false' will be removed soon. You must update your code to handle Timestamp objects."),this.timestampsInSnapshots=null===(u=n.timestampsInSnapshots)||void 0===u||u,se("settings","number","cacheSizeBytes",n.cacheSizeBytes),void 0===n.cacheSizeBytes)this.cacheSizeBytes=ii.mh;else{if(n.cacheSizeBytes!==dht&&n.cacheSizeBytes<ii.Ah)throw new i(t.INVALID_ARGUMENT,"cacheSizeBytes must be at least "+ii.Ah);this.cacheSizeBytes=n.cacheSizeBytes}se("settings","boolean","experimentalForceLongPolling",n.experimentalForceLongPolling);this.forceLongPolling=void 0!==n.experimentalForceLongPolling&&n.experimentalForceLongPolling}function lo(n,t,i,r){this.firestore=n;this.timestampsInSnapshots=t;this.FT=i;this.converter=r}function wn(n,r){if(void 0===r)return{merge:!1};if(vs(n,r,["merge","mergeFields"]),se(n,"boolean","merge",r.merge),u=n,void 0!==(f=r.mergeFields)&&function(n,r,u,f){if(!(u instanceof Array))throw new i(t.INVALID_ARGUMENT,"Function "+n+"() requires its "+r+" option to be an array, but it was: "+lf(u));for(var e=0;e<u.length;++e)if(!f(u[e]))throw new i(t.INVALID_ARGUMENT,"Function "+n+"() requires all "+r+" elements to be a string or a FieldPath, but the value at index "+e+" was: "+lf(u[e]));}(u,"mergeFields",f,function(n){return"string"==typeof n||n instanceof su}),void 0!==r.mergeFields&&void 0!==r.merge)throw new i(t.INVALID_ARGUMENT,"Invalid options passed to function "+n+'(): You cannot specify both "merge" and "mergeFields".');var u,f;return r}function fct(n,t){return void 0===t?{}:(vs(n,t,["serverTimestamps"]),ist(n,0,"serverTimestamps",t.serverTimestamps,["estimate","previous","none"]),t)}function ect(n,t){oc(n,"object",1,t);t&&(vs(n,t,["source"]),ist(n,0,"source",t.source,["default","server","cache"]))}function pe(n,r,u){if(r instanceof yf){if(r.firestore!==u)throw new i(t.INVALID_ARGUMENT,"Provided document reference is from a different Firestore instance.");return r}throw ys(n,"DocumentReference",1,r);}function bn(n,t,i){var r;return n?(r=n.toFirestore(t),i="toFirestore() in "+i):r=t,[r,i]}function uf(n,r){function u(){var n="This constructor is private.";throw r&&(n+=" ",n+=r),new i(t.INVALID_ARGUMENT,n);}return u.prototype=n.prototype,Object.assign(u,n),u}function yc(n){this.ii=n.ii;var t=n.ssl?"https":"http";this.WE=t+"://"+n.host;this.forceLongPolling=n.forceLongPolling}function we(n){this.ME=n.ME;this.LE=n.LE}function gs(){var n=this;this.DE=function(){return n.CE()};this.FE=function(){return n.NE()};this.kE=[];this.$E()}function kn(){}function nh(){}function wf(){this.oc="undefined"!=typeof atob}var th,d,ru,sw,dn,gn,ntt,itt,rtt,nv,ftt,ff,aw,vw,fr,pw,bw,kw,gw,uv,fv,ev,ib,att,ytt,wtt,uh,btt,hv,cv,lv,cb,lb,ab,vv,yb,bb,kb,kc,gb,ait,dc,ok,rrt,srt,bk,cut,vr,l,gt,yut,ah,wft,bft,dft,gft,vu,ie,ug,ket,det,ag,uot,ia,oot,hot,pg,fe,et,ki,vt,bu,or,ai,yr,ho,ku,kg,aot,kot,vp,dot,got,yp,oi,ea,su,la,kst;n=n&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n;sw=function(n,t){return(sw=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])})(n,t)};(ru=d=d||{})[ru.DEBUG=0]="DEBUG";ru[ru.VERBOSE=1]="VERBOSE";ru[ru.INFO=2]="INFO";ru[ru.WARN=3]="WARN";ru[ru.ERROR=4]="ERROR";ru[ru.SILENT=5]="SILENT";d.DEBUG;d.VERBOSE;d.INFO;d.WARN;d.ERROR;d.SILENT;var cct=d.INFO,lct=((th={})[d.DEBUG]="log",th[d.VERBOSE]="log",th[d.INFO]="info",th[d.WARN]="warn",th[d.ERROR]="error",th),act=(Object.defineProperty(bf.prototype,"logLevel",{get:function(){return this._logLevel},set:function(n){if(!(n in d))throw new TypeError("Invalid value assigned to `logLevel`");this._logLevel=n},enumerable:!0,configurable:!0}),Object.defineProperty(bf.prototype,"logHandler",{get:function(){return this._logHandler},set:function(n){if("function"!=typeof n)throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=n},enumerable:!0,configurable:!0}),Object.defineProperty(bf.prototype,"userLogHandler",{get:function(){return this._userLogHandler},set:function(n){this._userLogHandler=n},enumerable:!0,configurable:!0}),bf.prototype.debug=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this._userLogHandler&&this._userLogHandler.apply(this,cu([this,d.DEBUG],t));this._logHandler.apply(this,cu([this,d.DEBUG],t))},bf.prototype.log=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this._userLogHandler&&this._userLogHandler.apply(this,cu([this,d.VERBOSE],t));this._logHandler.apply(this,cu([this,d.VERBOSE],t))},bf.prototype.info=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this._userLogHandler&&this._userLogHandler.apply(this,cu([this,d.INFO],t));this._logHandler.apply(this,cu([this,d.INFO],t))},bf.prototype.warn=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this._userLogHandler&&this._userLogHandler.apply(this,cu([this,d.WARN],t));this._logHandler.apply(this,cu([this,d.WARN],t))},bf.prototype.error=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this._userLogHandler&&this._userLogHandler.apply(this,cu([this,d.ERROR],t));this._logHandler.apply(this,cu([this,d.ERROR],t))},bf);gn=(k(hw,dn=Error),hw);ntt=(ttt.prototype.create=function(n){for(var t,r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];for(var o,u=r[0]||{},s=this.service+"/"+n,h=this.errors[n],l=h?(o=u,h.replace(itt,function(n,t){var i=o[t];return null!=i?i.toString():"<"+t+"?>"})):"Error",a=this.serviceName+": "+l+" ("+s+").",f=new gn(s,a),e=0,c=Object.keys(u);e<c.length;e++)t=c[e],"_"!==t.slice(-1)&&(t in f&&console.warn('Overwriting FirebaseError base field "'+t+'" can cause unexpected behavior.'),f[t]=u[t]);return f},ttt);itt=/\{\$([^}]+)}/g;rtt=(ka.prototype.setInstantiationMode=function(n){return this.instantiationMode=n,this},ka.prototype.setMultipleInstances=function(n){return this.multipleInstances=n,this},ka.prototype.setServiceProps=function(n){return this.serviceProps=n,this},ka);var h,vct="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},cw=cw||{},a=vct||self;nv="closure_uid_"+(1e9*Math.random()>>>0);ftt=0;ff=Date.now||function(){return+new Date};kf.prototype.j=!1;kf.prototype.da=function(){!this.j&&(this.j=!0,this.C(),0)&&(n=this,Object.prototype.hasOwnProperty.call(n,nv)&&n[nv]||(n[nv]=++ftt));var n};kf.prototype.C=function(){if(this.i)for(;this.i.length;)this.i.shift()()};aw=Array.prototype.indexOf?function(n,t){return Array.prototype.indexOf.call(n,t,void 0)}:function(n,t){if("string"==typeof n)return"string"!=typeof t||1!=t.length?-1:n.indexOf(t,0);for(var i=0;i<n.length;i++)if(i in n&&n[i]===t)return i;return-1};vw=Array.prototype.forEach?function(n,t,i){Array.prototype.forEach.call(n,t,i)}:function(n,t,i){for(var f=n.length,u="string"==typeof n?n.split(""):n,r=0;r<f;r++)r in u&&t.call(i,u[r],r,n)};pw=String.prototype.trim?function(n){return n.trim()}:function(n){return/^[\s\xa0]*([\s\S]*?)[\s\xa0]*$/.exec(n)[1]};n:{if(bw=a.navigator,bw&&(kw=bw.userAgent,kw)){fr=kw;break n}fr=""}gw="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");nb[" "]=da;var rv,rh,wct=er(fr,"Opera"),be=er(fr,"Trident")||er(fr,"MSIE"),htt=er(fr,"Edge"),tb=htt||be,ctt=er(fr,"Gecko")&&!(er(fr.toLowerCase(),"webkit")&&!er(fr,"Edge"))&&!(er(fr,"Trident")||er(fr,"MSIE"))&&!er(fr,"Edge"),bct=er(fr.toLowerCase(),"webkit")&&!er(fr,"Edge");n:{if(uv="",fv=(rh=fr,ctt?/rv:([^\);]+)(\)|;)/.exec(rh):htt?/Edge\/([\d\.]+)/.exec(rh):be?/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(rh):bct?/WebKit\/(\S+)/.exec(rh):wct?/(?:Version)[ \/]?(\S+)/.exec(rh):void 0),(fv&&(uv=fv?fv[1]:""),be)&&(ev=ltt(),null!=ev&&ev>parseFloat(uv))){rv=String(ev);break n}rv=uv}att={};a.document&&be?(ytt=ltt(),ib=ytt||parseInt(rv,10)||void 0):ib=void 0;var ptt=ib,rb=!be||9<=Number(ptt),kct=be&&!vtt("9"),dct=function(){if(!a.addEventListener||!Object.defineProperty)return!1;var n=!1,t=Object.defineProperty({},"passive",{get:function(){n=!0}});try{a.addEventListener("test",da,t);a.removeEventListener("test",da,t)}catch(n){}return n}();nr.prototype.b=function(){this.defaultPrevented=!0};gi(wc,nr);wtt={2:"touch",3:"pen",4:"mouse"};wc.prototype.b=function(){wc.M.b.call(this);var n=this.c;if(n.preventDefault)n.preventDefault();else if(n.returnValue=!1,kct)try{(n.ctrlKey||112<=n.keyCode&&n.keyCode<=123)&&(n.keyCode=-1)}catch(n){}};uh="closure_listenable_"+(1e6*Math.random()|0);btt=0;sv.prototype.add=function(n,t,i,r,u){var f=n.toString(),e;return(n=this.a[f])||(n=this.a[f]=[],this.b++),e=fb(n,t,r,u),-1<e?(t=n[e],i||(t.X=!1)):((t=new gct(t,this.src,f,!!r,u)).X=i,n.push(t)),t};hv="closure_lm_"+(1e6*Math.random()|0);cv={};lv="__closure_events_fn_"+(1e9*Math.random()>>>0);gi(pr,kf);pr.prototype[uh]=!0;(h=pr.prototype).addEventListener=function(n,t,i,r){eb(this,n,t,i,r)};h.removeEventListener=function(n,t,i,r){!function n(t,i,r,u,f){if(Array.isArray(i))for(var e=0;e<i.length;e++)n(t,i[e],r,u,f);else u=pc(u)?!!u.capture:!!u,r=hb(r),t&&t[uh]?(t=t.c,(i=String(i).toString())in t.a&&-1<(r=fb(e=t.a[i],r,u,f))&&(ov(e[r]),Array.prototype.splice.call(e,r,1),0==e.length&&(delete t.a[i],t.b--))):(t=t&&sb(t))&&(i=t.a[i.toString()],t=-1,i&&(t=fb(i,r,u,f)),(r=-1<t?i[t]:null)&&ob(r))}(this,n,t,i,r)};h.dispatchEvent=function(n){var r,i=this.A,f,t,u,e;if(i)for(r=[];i;i=i.A)r.push(i);if(i=this.J,f=n.type||n,"string"==typeof n?n=new nr(n,i):n instanceof nr?n.target=n.target||i:(t=n,stt(n=new nr(f,i),t)),t=!0,r)for(u=r.length-1;0<=u;u--)e=n.a=r[u],t=av(e,f,!0,n)&&t;if(t=av(e=n.a=i,f,!0,n)&&t,t=av(e,f,!1,n)&&t,r)for(u=0;u<r.length;u++)t=av(e=n.a=r[u],f,!1,n)&&t;return t};h.C=function(){var i,n,r,t;if(pr.M.C.call(this),this.c){n=this.c;for(i in n.a){for(r=n.a[i],t=0;t<r.length;t++)ov(r[t]);delete n.a[i];n.b--}}this.A=null};h.ra=function(n,t,i,r){return this.c.add(String(n),t,!1,i,r)};h.sa=function(n,t,i,r){return this.c.add(String(n),t,!0,i,r)};cb=a.JSON.stringify;ab=(tit.prototype.get=function(){var n;return 0<this.b?(this.b--,n=this.a,this.a=n.next,n.next=null):n=this.c(),n},new tit(function(){return new vb},function(n){n.reset()},100));nit.prototype.add=function(n,t){var i=ab.get();i.set(n,t);this.b?this.b.next=i:this.a=i;this.b=i};vb.prototype.set=function(n,t){this.a=n;this.b=t;this.next=null};vv=!(vb.prototype.reset=function(){this.next=this.b=this.a=null});yb=new nit;gi(yv,pr);(h=yv.prototype).Z=!1;h.L=null;h.Ua=function(){if(this.Z){var n=ff()-this.g;0<n&&n<.8*this.b?this.L=this.a.setTimeout(this.f,this.b-n):(this.L&&(this.a.clearTimeout(this.L),this.L=null),this.dispatchEvent("tick"),this.Z&&(pb(this),this.start()))}};h.start=function(){this.Z=!0;this.L||(this.L=this.a.setTimeout(this.f,this.b),this.g=ff())};h.C=function(){yv.M.C.call(this);pb(this);delete this.a};gi(pv,kf);(h=pv.prototype).ba=!1;h.T=null;h.Ia=function(){this.a=arguments;this.T?this.ba=!0:rit(this)};h.C=function(){pv.M.C.call(this);this.T&&(a.clearTimeout(this.T),this.T=null,this.ba=!1,this.a=[])};h.Pa=function(){this.T=null;this.ba&&(this.ba=!1,rit(this))};gi(bc,kf);bb=[];bc.prototype.C=function(){bc.M.C.call(this);fit(this)};bc.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented");};kb=null;gi(eit,nr);gi(oit,nr);gi(sit,nr);kc={NO_ERROR:0,Va:1,bb:2,ab:3,Ya:4,$a:5,cb:6,za:7,TIMEOUT:8,gb:9};gb={Xa:"complete",kb:"success",Aa:"error",za:"abort",ib:"ready",jb:"readystatechange",TIMEOUT:"timeout",eb:"incrementaldata",hb:"progress",Za:"downloadprogress",lb:"uploadprogress"};hit.prototype.a=null;dc={OPEN:"a",Wa:"b",Aa:"c",fb:"d"};gi(nk,nr);gi(tk,nr);gi(vit,hit);ait=new vit;var ult=45e3,yit={},ik={};(h=gc.prototype).setTimeout=function(n){this.N=n};h.Sa=function(n){n=n.target;var t=this.D;t&&3==de(n)?t.Ia():this.ya(n)};h.ya=function(n){var i,r,f,e,u;try{if(n==this.a)n:{var t=de(this.a),o=this.a.qa(),s=this.a.S();if(!(t<3||3==t&&!tb&&!this.a.Y()))if(this.l||4!=t||7==o||wv(8==o||s<=0?3:2),kv(this),i=this.a.S(),this.H=i,r=this.a.Y(),this.b=200==i){if(this.R&&!this.o){t:{if(this.a&&(e=this.a,(f=e.a?e.a.getResponseHeader("X-HTTP-Initial-Response"):null)&&!iv(f))){u=f;break t}u=null}if(!u){this.b=!1;this.c=3;uu(12);fh(this);dv(this);break n}this.o=!0;uk(this,u)}this.F?(wit(this,t,r),tb&&this.b&&3==t&&(uit(this.G,this.O,"tick",this.Ra),this.O.start())):uk(this,r);4==t&&fh(this);this.b&&!this.l&&(4==t?krt(this.g,this):(this.b=!1,nl(this)))}else 400==i&&0<r.indexOf("Unknown SID")?(this.c=3,uu(12)):(this.c=0,uu(13)),fh(this),dv(this)}}catch(n){}};h.Ra=function(){if(this.a){var n=de(this.a),t=this.a.Y();this.w<t.length&&(kv(this),wit(this,n,t),this.b&&4!=n&&nl(this))}};h.cancel=function(){this.l=!0;fh(this)};h.Qa=function(){this.h=null;var n=ff();0<=n-this.P?(2!=this.B&&(wv(3),uu(17)),fh(this),this.c=2,dv(this)):bit(this,this.P-n)};(h=eh.prototype).I=function(){ek(this);for(var t=[],n=0;n<this.a.length;n++)t.push(this.b[this.a[n]]);return t};h.K=function(){return ek(this),this.a.concat()};h.get=function(n,t){return vo(this.b,n)?this.b[n]:t};h.set=function(n,t){vo(this.b,n)||(this.c++,this.a.push(n));this.b[n]=t};h.forEach=function(n,t){for(var u,f,r=this.K(),i=0;i<r.length;i++)u=r[i],f=this.get(u),n.call(t,f,u,this)};ok=/^(?:([^:/?#.]+):)?(?:\/\/(?:([^\\/?#]*)@)?([^\\/?#]*?)(?::([0-9]+))?(?=[\\/?#]|$))?([^?#]+)?(?:\?([^#]*))?(?:#([\s\S]*))?$/;yo.prototype.toString=function(){var t=[],i=this.f,n;return i&&t.push(il(i,dit,!0),":"),n=this.c,!n&&"file"!=i||(t.push("//"),(i=this.j)&&t.push(il(i,dit,!0),"@"),t.push(encodeURIComponent(String(n)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),null!=(n=this.h)&&t.push(":",String(n))),(n=this.g)&&(this.c&&"/"!=n.charAt(0)&&t.push("/"),t.push(il(n,"/"==n.charAt(0)?slt:olt,!0))),(n=this.b.toString())&&t.push("?",n),(n=this.i)&&t.push("#",il(n,clt)),t.join("")};var dit=/[#\/\?@]/g,olt=/[#\?:]/g,slt=/[#\?]/g,hlt=/[#\?@]/g,clt=/#/g;(h=rl.prototype).add=function(n,t){ke(this);this.c=null;n=oh(this,n);var i=this.a.get(n);return i||this.a.set(n,i=[]),i.push(t),this.b+=1,this};h.forEach=function(n,t){ke(this);this.a.forEach(function(i,r){vw(i,function(i){n.call(t,i,r,this)},this)},this)};h.K=function(){var u,t;ke(this);for(var f=this.a.I(),i=this.a.K(),r=[],n=0;n<i.length;n++)for(u=f[n],t=0;t<u.length;t++)r.push(i[n]);return r};h.I=function(n){var t,i;if(ke(this),t=[],"string"==typeof n)nrt(this,n)&&(t=ett(t,this.a.get(oh(this,n))));else for(n=this.a.I(),i=0;i<n.length;i++)t=ett(t,n[i]);return t};h.set=function(n,t){return ke(this),this.c=null,nrt(this,n=oh(this,n))&&(this.b-=this.a.get(n).length),this.a.set(n,[t]),this.b+=1,this};h.get=function(n,t){return n&&0<(n=this.I(n)).length?String(n[0]):t};h.toString=function(){var n,e,t,r;if(this.c)return this.c;if(!this.a)return"";for(var u=[],f=this.a.K(),i=0;i<f.length;i++)for(n=f[i],e=encodeURIComponent(String(n)),n=this.I(n),t=0;t<n.length;t++)r=e,""!==n[t]&&(r+="="+encodeURIComponent(String(n[t]))),u.push(r);return this.c=u.join("&")};rrt=10;irt.prototype.cancel=function(){var i,r,t,n;if(this.c=ort(this),this.b)this.b.cancel(),this.b=null;else if(this.a&&0!==this.a.size){try{for(t=utt(this.a.values()),n=t.next();!n.done;n=t.next())n.value.cancel()}catch(r){i={error:r}}finally{try{n&&!n.done&&(r=t.return)&&r.call(t)}finally{if(i)throw i.error;}}this.a.clear()}};ck.prototype.stringify=function(n){return a.JSON.stringify(n,void 0)};ck.prototype.parse=function(n){return a.JSON.parse(n,void 0)};srt=a.JSON.parse;gi(ui,pr);var ylt="",plt=/^https?$/i,wlt=["POST","PUT"];(h=ui.prototype).$=function(n,t,i,r){if(this.a)throw Error("[goog.net.XhrIo] Object is active with another request="+this.D+"; newUri="+n);t=t?t.toUpperCase():"GET";this.D=n;this.f="";this.h=0;this.v=!1;this.b=!0;this.a=new XMLHttpRequest;this.s=this.G?cit(this.G):cit(ait);this.a.onreadystatechange=ur(this.va,this);try{this.w=!0;this.a.open(t,String(n),!0);this.w=!1}catch(n){return void hrt(this,n)}n=i||"";var f,u=new eh(this.headers);r&&fk(r,function(n,t){u.set(t,n)});r=function(n){n:{for(var t=blt,u=n.length,r="string"==typeof n?n.split(""):n,i=0;i<u;i++)if(i in r&&t.call(void 0,r[i],i,n)){t=i;break n}t=-1}return t<0?null:"string"==typeof n?n.charAt(t):n[t]}(u.K());i=a.FormData&&n instanceof a.FormData;0<=aw(wlt,t)&&!r&&!i&&u.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");u.forEach(function(n,t){this.a.setRequestHeader(t,n)},this);this.H&&(this.a.responseType=this.H);"withCredentials"in this.a&&this.a.withCredentials!==this.F&&(this.a.withCredentials=this.F);try{art(this);0<this.o&&((this.B=(f=this.a,be&&vtt(9)&&"number"==typeof f.timeout&&void 0!==f.ontimeout))?(this.a.timeout=this.o,this.a.ontimeout=ur(this.ta,this)):this.m=wb(this.ta,this.o,this));this.l=!0;this.a.send(n);this.l=!1}catch(n){hrt(this,n)}};h.ta=function(){void 0!==cw&&this.a&&(this.f="Timed out after "+this.o+"ms, aborting",this.h=8,this.dispatchEvent("timeout"),this.abort(8))};h.abort=function(n){this.a&&this.b&&(this.b=!1,this.g=!0,this.a.abort(),this.g=!1,this.h=n||7,this.dispatchEvent("complete"),this.dispatchEvent("abort"),uy(this))};h.C=function(){this.a&&(this.b&&(this.b=!1,this.g=!0,this.a.abort(),this.g=!1),uy(this,!0));ui.M.C.call(this)};h.va=function(){this.j||(this.w||this.l||this.g?lrt(this):this.Oa())};h.Oa=function(){lrt(this)};h.S=function(){try{return 2<de(this)?this.a.status:-1}catch(n){return-1}};h.Y=function(){try{return this.a?this.a.responseText:""}catch(n){return""}};h.Ja=function(n){if(this.a){var t=this.a.responseText;return n&&0==t.indexOf(n)&&(t=t.substring(n.length)),srt(t)}};h.qa=function(){return this.h};h.Ma=function(){return"string"==typeof this.f?this.f:String(this.f)};(h=vrt.prototype).oa=8;h.u=1;h.xa=function(n){var i,f,r,t,u;if(this.g)if(this.g=null,1==this.u){if(!n){if(this.H=Math.floor(1e5*Math.random()),n=this.H++,f=new gc(this,n,void 0),r=this.j,this.F&&(r?stt(r=ott(r),this.F):r=this.F),null===this.h&&(f.m=r),this.fa)n:{for(t=i=0;t<this.f.length;t++){if(u=this.f[t],u="__data__"in u.a&&"string"==typeof(u=u.a.__data__)?u.length:void 0,void 0===u)break;if(4096<(i+=u)){i=t;break n}if(4096===i||t===this.f.length-1){i=t+1;break n}}i=1e3}else i=1e3;i=wrt(this,f,i);ct(t=df(this.v),"RID",n);ct(t,"CVER",22);this.s&&ct(t,"X-HTTP-Session-Id",this.s);fl(this,t);this.h&&r&&lk(t,this.h,r);hk(this.b,f);this.fa?(ct(t,"$req",i),ct(t,"SID","null"),f.R=!0,rk(f,t,null)):rk(f,t,i);this.u=2}}else 3==this.u&&(n?prt(this,n):0==this.f.length||urt(this.b)||prt(this))};h.wa=function(){var n,t,i;this.i=null;this.a=new gc(this,"rpc",this.J);null===this.h&&(this.a.m=this.j);this.a.J=0;n=df(this.ea);ct(n,"RID","rpc");ct(n,"SID",this.B);ct(n,"CI",this.U?"0":"1");ct(n,"AID",this.G);fl(this,n);ct(n,"TYPE","xmlhttp");this.h&&this.j&&lk(n,this.h,this.j);this.D&&this.a.setTimeout(this.D);t=this.a;i=this.R;t.B=1;t.f=iy(df(n));t.j=null;t.F=!0;pit(t,i)};h.Na=function(){null!=this.l&&(this.l=null,this.a.cancel(),this.a=null,yk(this),uu(19))};h.Ta=function(n){uu(n?2:1)};(h=iut.prototype).na=function(){};h.ma=function(){};h.la=function(){};h.ka=function(){};h.Ha=function(){};oy.prototype.a=function(n,t){return new fu(n,t)};gi(fu,pr);(h=fu.prototype).addEventListener=function(n,t,i,r){fu.M.addEventListener.call(this,n,t,i,r)};h.removeEventListener=function(n,t,i,r){fu.M.removeEventListener.call(this,n,t,i,r)};h.Ka=function(){this.a.c=this.f;this.h&&(this.a.w=!0);var n=this.a,t=this.l,i=this.b||void 0;uu(0);n.P=t;n.N=i||{};n.U=n.W;n.v=nut(n,null,n.P);fy(n)};h.close=function(){ak(this.a)};h.La=function(n){if("string"==typeof n){var t={};t.__data__=n;vk(this.a,t)}else this.g?((t={}).__data__=cb(n),vk(this.a,t)):vk(this.a,n)};h.C=function(){this.a.c=null;delete this.f;ak(this.a);delete this.a;fu.M.C.call(this)};gi(rut,nk);gi(uut,tk);gi(sh,iut);sh.prototype.na=function(){this.a.dispatchEvent("a")};sh.prototype.ma=function(n){this.a.dispatchEvent(new rut(n))};sh.prototype.la=function(){this.a.dispatchEvent(new uut)};sh.prototype.ka=function(){this.a.dispatchEvent("b")};oy.prototype.createWebChannel=oy.prototype.a;fu.prototype.send=fu.prototype.La;fu.prototype.open=fu.prototype.Ka;fu.prototype.close=fu.prototype.close;kc.NO_ERROR=0;kc.TIMEOUT=8;kc.HTTP_ERROR=6;gb.COMPLETE="complete";(lit.EventType=dc).OPEN="a";dc.CLOSE="b";dc.ERROR="c";dc.MESSAGE="d";pr.prototype.listen=pr.prototype.ra;ui.prototype.listenOnce=ui.prototype.sa;ui.prototype.getLastError=ui.prototype.Ma;ui.prototype.getLastErrorCode=ui.prototype.qa;ui.prototype.getStatus=ui.prototype.S;ui.prototype.getResponseJson=ui.prototype.Ja;ui.prototype.getResponseText=ui.prototype.Y;ui.prototype.send=ui.prototype.$;var el={createWebChannelTransport:function(){return new oy},ErrorCode:kc,EventType:gb,WebChannel:lit,XhrIo:ui},klt=el.createWebChannelTransport,pk=el.ErrorCode,dlt=el.EventType,sy=el.WebChannel,glt=el.XhrIo,hy=n.SDK_VERSION,eu=(cy.prototype.t=function(){return null!=this.uid},cy.prototype.s=function(){return this.t()?"uid:"+this.uid:"anonymous-user"},cy.prototype.isEqual=function(n){return n.uid===this.uid},cy);eu.UNAUTHENTICATED=new eu(null);eu.i=new eu("google-credentials-uid");eu.h=new eu("first-party-uid");var wk,fut,t={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"},i=(k(hut,fut=Error),hut),eut=(sl.prototype.getToken=function(){return Promise.resolve(null)},sl.prototype._=function(){},sl.prototype.l=function(n){(this.u=n)(eu.UNAUTHENTICATED)},sl.prototype.T=function(){this.u=null},sl),tat=(hh.prototype.getToken=function(){var n=this,r=this.A,u=this.forceRefresh;return this.forceRefresh=!1,this.auth?this.auth.getToken(u).then(function(u){if(n.A!==r)throw new i(t.ABORTED,"getToken aborted due to token change.");return u?(c("string"==typeof u.accessToken),new nat(u.accessToken,n.currentUser)):null}):Promise.resolve(null)},hh.prototype._=function(){this.forceRefresh=!0},hh.prototype.l=function(n){this.u=n;this.R&&n(this.currentUser)},hh.prototype.T=function(){this.auth&&this.auth.removeAuthTokenListener(this.I);this.I=null;this.u=null},hh.prototype.m=function(){var n=this.auth&&this.auth.getUid();return c(null===n||"string"==typeof n),new eu(n)},hh),iat=(Object.defineProperty(sut.prototype,"o",{get:function(){var n={"X-Goog-AuthUser":this.V},t=this.P.auth.g([]);return t&&(n.Authorization=t),n},enumerable:!0,configurable:!0}),sut),rat=(ol.prototype.getToken=function(){return Promise.resolve(new iat(this.P,this.V))},ol.prototype.l=function(n){n(eu.h)},ol.prototype.T=function(){},ol.prototype._=function(){},ol),ar=(wr.now=function(){return wr.fromMillis(Date.now())},wr.fromDate=function(n){return wr.fromMillis(n.getTime())},wr.fromMillis=function(n){var t=Math.floor(n/1e3);return new wr(t,1e6*(n-1e3*t))},wr.prototype.toDate=function(){return new Date(this.toMillis())},wr.prototype.toMillis=function(){return 1e3*this.seconds+this.nanoseconds/1e6},wr.prototype.p=function(n){return this.seconds===n.seconds?p(this.nanoseconds,n.nanoseconds):p(this.seconds,n.seconds)},wr.prototype.isEqual=function(n){return n.seconds===this.seconds&&n.nanoseconds===this.nanoseconds},wr.prototype.toString=function(){return"Timestamp(seconds="+this.seconds+", nanoseconds="+this.nanoseconds+")"},wr.prototype.valueOf=function(){var n=this.seconds- -62135596800;return String(n).padStart(12,"0")+"."+String(this.nanoseconds).padStart(9,"0")},wr),g=(ef.v=function(n){return new ef(n)},ef.min=function(){return new ef(new ar(0,0))},ef.prototype.S=function(n){return this.timestamp.p(n.timestamp)},ef.prototype.isEqual=function(n){return this.timestamp.isEqual(n.timestamp)},ef.prototype.D=function(){return 1e6*this.timestamp.seconds+this.timestamp.nanoseconds/1e3},ef.prototype.toString=function(){return"SnapshotVersion("+this.timestamp.toString()+")"},ef.prototype.C=function(){return this.timestamp},ef),out=(Object.defineProperty(si.prototype,"length",{get:function(){return this.F},enumerable:!0,configurable:!0}),si.prototype.isEqual=function(n){return 0===si.N(this,n)},si.prototype.child=function(n){var t=this.segments.slice(this.offset,this.limit());return n instanceof si?n.forEach(function(n){t.push(n)}):t.push(n),this.k(t)},si.prototype.limit=function(){return this.offset+this.length},si.prototype.$=function(n){return n=void 0===n?1:n,this.k(this.segments,this.offset+n,this.length-n)},si.prototype.M=function(){return this.k(this.segments,this.offset,this.length-1)},si.prototype.L=function(){return this.segments[this.offset]},si.prototype.O=function(){return this.get(this.length-1)},si.prototype.get=function(n){return this.segments[this.offset+n]},si.prototype.B=function(){return 0===this.length},si.prototype.q=function(n){if(n.length<this.length)return!1;for(var t=0;t<this.length;t++)if(this.get(t)!==n.get(t))return!1;return!0},si.prototype.U=function(n){if(this.length+1!==n.length)return!1;for(var t=0;t<this.length;t++)if(this.get(t)!==n.get(t))return!1;return!0},si.prototype.forEach=function(n){for(var t=this.offset,i=this.limit();t<i;t++)n(this.segments[t])},si.prototype.W=function(){return this.segments.slice(this.offset,this.limit())},si.N=function(n,t){for(var r,u,f=Math.min(n.length,t.length),i=0;i<f;i++){if(r=n.get(i),u=t.get(i),r<u)return-1;if(u<r)return 1}return n.length<t.length?-1:n.length>t.length?1:0},si),ot=(k(ge,wk=out),ge.prototype.k=function(n,t,i){return new ge(n,t,i)},ge.prototype.j=function(){return this.W().join("/")},ge.prototype.toString=function(){return this.j()},ge.K=function(n){if(0<=n.indexOf("//"))throw new i(t.INVALID_ARGUMENT,"Invalid path ("+n+"). Paths must not contain // in them.");return new ge(n.split("/").filter(function(n){return 0<n.length}))},ge);ot.G=new ot([]);cut=/^[_a-zA-Z][_a-zA-Z0-9]*$/;vr=(k(br,bk=out),br.prototype.k=function(n,t,i){return new br(n,t,i)},br.H=function(n){return cut.test(n)},br.prototype.j=function(){return this.W().map(function(n){return n=n.replace("\\","\\\\").replace("`","\\`"),br.H(n)||(n="`"+n+"`"),n}).join(".")},br.prototype.toString=function(){return this.j()},br.prototype.Y=function(){return 1===this.length&&"__name__"===this.get(0)},br.J=function(){return new br(["__name__"])},br.X=function(n){for(var f,e,s=[],u="",r=0,h=function(){if(0===u.length)throw new i(t.INVALID_ARGUMENT,"Invalid field path ("+n+"). Paths must not be empty, begin with '.', end with '.', or contain '..'");s.push(u);u=""},o=!1;r<n.length;)if(f=n[r],"\\"===f){if(r+1===n.length)throw new i(t.INVALID_ARGUMENT,"Path has trailing escape character: "+n);if(e=n[r+1],"\\"!==e&&"."!==e&&"`"!==e)throw new i(t.INVALID_ARGUMENT,"Path has invalid escape sequence: "+n);u+=e;r+=2}else"`"===f?o=!o:"."!==f||o?u+=f:h(),r++;if(h(),o)throw new i(t.INVALID_ARGUMENT,"Unterminated ` in path: "+n);return new br(s)},br);vr.G=new vr([]);l=(of.Z=function(n){return new of(ot.K(n).$(5))},of.prototype.tt=function(n){return 2<=this.path.length&&this.path.get(this.path.length-2)===n},of.prototype.isEqual=function(n){return null!==n&&0===ot.N(this.path,n.path)},of.prototype.toString=function(){return this.path.toString()},of.N=function(n,t){return ot.N(n.path,t.path)},of.et=function(n){return n.length%2==0},of.st=function(n){return new of(new ot(n.slice()))},of);l.EMPTY=new l(new ot([]));gt=(sf.fromBase64String=function(n){return new sf(vu.nt().atob(n))},sf.fromUint8Array=function(n){return new sf(function(n){for(var i="",t=0;t<n.length;++t)i+=String.fromCharCode(n[t]);return i}(n))},sf.prototype.toBase64=function(){return vu.nt().btoa(this.it)},sf.prototype.toUint8Array=function(){return function(n){for(var i=new Uint8Array(n.length),t=0;t<n.length;t++)i[t]=n.charCodeAt(t);return i}(this.it)},sf.prototype.rt=function(){return 2*this.it.length},sf.prototype.S=function(n){return p(this.it,n.it)},sf.prototype.isEqual=function(n){return this.it===n.it},sf);gt.ht=new gt("");yut=new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);ah=(vh.prototype.ot=function(n,t){return i={fields:{__type__:{stringValue:"server_timestamp"},__local_write_time__:{timestampValue:{seconds:t.seconds,nanos:t.nanoseconds}}}},n&&(i.fields.__previous_value__=n),{mapValue:i};var i},vh.prototype.at=function(n,t){return t},vh.prototype.ut=function(){return null},vh.prototype.isEqual=function(n){return n instanceof vh},vh);ah.instance=new ah;var rd=(go.prototype.ot=function(n){return this.apply(n)},go.prototype.at=function(n){return this.apply(n)},go.prototype.apply=function(n){for(var t=kut(n),u=function(n){t.some(function(t){return lu(t,n)})||t.push(n)},i=0,r=this.elements;i<r.length;i++)u(r[i]);return{arrayValue:{values:t}}},go.prototype.ut=function(){return null},go.prototype.isEqual=function(n){return n instanceof go&&ss(this.elements,n.elements,lu)},go),ud=(ko.prototype.ot=function(n){return this.apply(n)},ko.prototype.at=function(n){return this.apply(n)},ko.prototype.apply=function(n){for(var t=kut(n),u=function(n){t=t.filter(function(t){return!lu(t,n)})},i=0,r=this.elements;i<r.length;i++)u(r[i]);return{arrayValue:{values:t}}},ko.prototype.ut=function(){return null},ko.prototype.isEqual=function(n){return n instanceof ko&&ss(this.elements,n.elements,lu)},ko),fd=(bo.prototype.ot=function(n){var t=this.ut(n),i=this.asNumber(t)+this.asNumber(this.ct);return nd(t)&&nd(this.ct)?this.serializer._t(i):this.serializer.lt(i)},bo.prototype.at=function(n,t){return t},bo.prototype.ut=function(n){return nd(t=n)||t&&"doubleValue"in t?n:{integerValue:0};var t},bo.prototype.isEqual=function(n){return n instanceof bo&&lu(this.ct,n.ct)},bo.prototype.asNumber=function(n){return ni(n.integerValue||n.doubleValue)},bo);var dut,gut,nft,tft,ift,yh=(hd.prototype.dt=function(n){for(var t=0,i=this.fields;t<i.length;t++)if(i[t].q(n))return!0;return!1},hd.prototype.isEqual=function(n){return ss(this.fields,n.fields,function(n,t){return n.isEqual(t)})},hd),ll=(rft.prototype.isEqual=function(n){return this.field.isEqual(n.field)&&this.transform.isEqual(n.transform)},rft),tr=(hf.ft=function(){return new hf},hf.exists=function(n){return new hf(void 0,n)},hf.updateTime=function(n){return new hf(n)},Object.defineProperty(hf.prototype,"Tt",{get:function(){return void 0===this.updateTime&&void 0===this.exists},enumerable:!0,configurable:!0}),hf.prototype.Et=function(n){return void 0!==this.updateTime?n instanceof it&&n.version.isEqual(this.updateTime):void 0===this.exists||this.exists===n instanceof it},hf.prototype.isEqual=function(n){return this.exists===n.exists&&(this.updateTime?!!n.updateTime&&this.updateTime.isEqual(n.updateTime):!n.updateTime)},hf),ns=(sd.prototype.It=function(){},sd.wt=function(n){return n instanceof it?n.version:g.min()},sd),ed=(k(rs,ift=ns),rs.prototype.at=function(n,t){this.It(n);var i=t.version;return new it(this.key,i,this.value,{hasCommittedMutations:!0})},rs.prototype.ot=function(n){if(this.It(n),!this.Rt.Et(n))return n;var t=ns.wt(n);return new it(this.key,t,this.value,{At:!0})},rs.prototype.Pt=function(){return null},rs.prototype.isEqual=function(n){return n instanceof rs&&this.key.isEqual(n.key)&&this.value.isEqual(n.value)&&this.Rt.isEqual(n.Rt)},rs),ph=(k(ne,tft=ns),ne.prototype.at=function(n,t){if(this.It(n),!this.Rt.Et(n))return new yy(this.key,t.version);var i=this.gt(n);return new it(this.key,t.version,i,{hasCommittedMutations:!0})},ne.prototype.ot=function(n){if(this.It(n),!this.Rt.Et(n))return n;var t=ns.wt(n),i=this.gt(n);return new it(this.key,t,i,{At:!0})},ne.prototype.Pt=function(){return null},ne.prototype.isEqual=function(n){return n instanceof ne&&this.key.isEqual(n.key)&&this.Vt.isEqual(n.Vt)&&this.Rt.isEqual(n.Rt)},ne.prototype.gt=function(n){var t;return t=n instanceof it?n.data():gf.empty(),this.pt(t)},ne.prototype.pt=function(n){var i=this,t=new vl(n);return this.Vt.fields.forEach(function(n){if(!n.B()){var r=i.data.field(n);null!==r?t.set(n,r):t.delete(n)}}),t.yt()},ne),vy=(k(au,nft=ns),au.prototype.at=function(n,t){if(this.It(n),c(null!=t.transformResults),!this.Rt.Et(n))return new yy(this.key,t.version);var i=this.bt(n),r=this.vt(n,t.transformResults),u=t.version,f=this.St(i.data(),r);return new it(this.key,u,f,{hasCommittedMutations:!0})},au.prototype.ot=function(n,t,i){if(this.It(n),!this.Rt.Et(n))return n;var r=this.bt(n),u=this.Dt(i,n,t),f=this.St(r.data(),u);return new it(this.key,r.version,f,{At:!0})},au.prototype.Pt=function(n){for(var t=null,r=0,f=this.fieldTransforms;r<f.length;r++){var i=f[r],e=n instanceof it?n.field(i.field):void 0,u=i.transform.ut(e||null);null!=u&&(t=null==t?(new vl).set(i.field,u):t.set(i.field,u))}return t?t.yt():null},au.prototype.isEqual=function(n){return n instanceof au&&this.key.isEqual(n.key)&&ss(this.fieldTransforms,n.fieldTransforms,function(n,t){return n.isEqual(t)})&&this.Rt.isEqual(n.Rt)},au.prototype.bt=function(n){return n},au.prototype.vt=function(n,t){var r=[],i;for(c(this.fieldTransforms.length===t.length),i=0;i<t.length;i++){var u=this.fieldTransforms[i],e=u.transform,f=null;n instanceof it&&(f=n.field(u.field));r.push(e.at(f,t[i]))}return r},au.prototype.Dt=function(n,t,i){for(var e=[],u=0,o=this.fieldTransforms;u<o.length;u++){var f=o[u],s=f.transform,r=null;t instanceof it&&(r=t.field(f.field));null===r&&i instanceof it&&(r=i.field(f.field));e.push(s.ot(r,n))}return e},au.prototype.St=function(n,t){for(var u,r=new vl(n),i=0;i<this.fieldTransforms.length;i++)u=this.fieldTransforms[i].field,r.set(u,t[i]);return r.yt()},au),al=(k(is,gut=ns),is.prototype.at=function(n,t){return this.It(n),new hi(this.key,t.version,{hasCommittedMutations:!0})},is.prototype.ot=function(n){return this.It(n),this.Rt.Et(n)?new hi(this.key,g.min()):n},is.prototype.Pt=function(){return null},is.prototype.isEqual=function(n){return n instanceof is&&this.key.isEqual(n.key)&&this.Rt.isEqual(n.Rt)},is),od=(k(ts,dut=ns),ts.prototype.at=function(){o()},ts.prototype.ot=function(){o()},ts.prototype.Pt=function(){o()},ts.prototype.isEqual=function(n){return n instanceof ts&&this.key.isEqual(n.key)&&this.Rt.isEqual(n.Rt)},ts),gf=(yl.empty=function(){return new yl({mapValue:{}})},yl.prototype.field=function(n){if(n.B())return this.proto;for(var t=this.proto,i=0;i<n.length-1;++i)if(!t.mapValue.fields||!id(t=t.mapValue.fields[n.get(i)]))return null;return(t=(t.mapValue.fields||{})[n.O()])||null},yl.prototype.isEqual=function(n){return lu(this.proto,n.proto)},yl),vl=(wh.prototype.set=function(n,t){return this.Nt(n,t),this},wh.prototype.delete=function(n){return this.Nt(n,null),this},wh.prototype.Nt=function(n,t){for(var f,i,r=this.Ft,u=0;u<n.length-1;++u)f=n.get(u),i=r.get(f),i instanceof Map||(i=i&&10===no(i)?new Map(Object.entries(i.mapValue.fields||{})):new Map,r.set(f,i)),r=i;r.set(n.O(),t)},wh.prototype.yt=function(){var n=this.kt(vr.G,this.Ft);return null!=n?new gf(n):this.Ct},wh.prototype.kt=function(n,t){var f=this,r=!1,u=this.Ct.field(n),i=id(u)?Object.assign({},u.mapValue.fields):{};return t.forEach(function(t,u){if(t instanceof Map){var e=f.kt(n.child(u),t);null!=e&&(i[u]=e,r=!0)}else null!==t?(i[u]=t,r=!0):i.hasOwnProperty(u)&&(delete i[u],r=!0)}),r?{mapValue:{fields:i}}:null},wh);var ti,nt,fft,eft,oft,sft,hft,cft,ld,lft,aft,it=(k(te,aft=cd),te.prototype.field=function(n){return this.$t.field(n)},te.prototype.data=function(){return this.$t},te.prototype.Mt=function(){return this.$t.proto},te.prototype.isEqual=function(n){return n instanceof te&&this.key.isEqual(n.key)&&this.version.isEqual(n.version)&&this.At===n.At&&this.hasCommittedMutations===n.hasCommittedMutations&&this.$t.isEqual(n.$t)},te.prototype.toString=function(){return"Document("+this.key+", "+this.version+", "+this.$t.toString()+", {hasLocalMutations: "+this.At+"}), {hasCommittedMutations: "+this.hasCommittedMutations+"})"},Object.defineProperty(te.prototype,"hasPendingWrites",{get:function(){return this.At||this.hasCommittedMutations},enumerable:!0,configurable:!0}),te),hi=(k(dh,lft=cd),dh.prototype.toString=function(){return"NoDocument("+this.key+", "+this.version+")"},Object.defineProperty(dh.prototype,"hasPendingWrites",{get:function(){return this.hasCommittedMutations},enumerable:!0,configurable:!0}),dh.prototype.isEqual=function(n){return n instanceof dh&&n.hasCommittedMutations===this.hasCommittedMutations&&n.version.isEqual(this.version)&&n.key.isEqual(this.key)},dh),yy=(k(kh,ld=cd),kh.prototype.toString=function(){return"UnknownDocument("+this.key+", "+this.version+")"},Object.defineProperty(kh.prototype,"hasPendingWrites",{get:function(){return!0},enumerable:!0,configurable:!0}),kh.prototype.isEqual=function(n){return n instanceof kh&&n.version.isEqual(this.version)&&n.key.isEqual(this.key)},kh),vft=(bl.prototype.canonicalId=function(){if(null===this.Lt){var n=this.path.j();null!==this.collectionGroup&&(n+="|cg:"+this.collectionGroup);n+="|f:";n+=this.filters.map(function(n){return n.canonicalId()}).join(",");n+="|ob:";n+=this.orderBy.map(function(n){return n.canonicalId()}).join(",");wo(this.limit)||(n+="|l:",n+=this.limit);this.startAt&&(n+="|lb:",n+=this.startAt.canonicalId());this.endAt&&(n+="|ub:",n+=this.endAt.canonicalId());this.Lt=n}return this.Lt},bl.prototype.toString=function(){var n=this.path.j();return null!==this.collectionGroup&&(n+=" collectionGroup="+this.collectionGroup),0<this.filters.length&&(n+=", filters: ["+this.filters.join(", ")+"]"),wo(this.limit)||(n+=", limit: "+this.limit),0<this.orderBy.length&&(n+=", orderBy: ["+this.orderBy.join(", ")+"]"),this.startAt&&(n+=", startAt: "+this.startAt.canonicalId()),this.endAt&&(n+=", endAt: "+this.endAt.canonicalId()),"Target("+n+")"},bl.prototype.isEqual=function(n){var t,i;if(this.limit!==n.limit||this.orderBy.length!==n.orderBy.length)return!1;for(t=0;t<this.orderBy.length;t++)if(!this.orderBy[t].isEqual(n.orderBy[t]))return!1;if(this.filters.length!==n.filters.length)return!1;for(i=0;i<this.filters.length;i++)if(!this.filters[i].isEqual(n.filters[i]))return!1;return this.collectionGroup===n.collectionGroup&&!!this.path.isEqual(n.path)&&!!(null!==this.startAt?this.startAt.isEqual(n.startAt):null===n.startAt)&&(null!==this.endAt?this.endAt.isEqual(n.endAt):null===n.endAt)},bl.prototype.Ot=function(){return l.et(this.path)&&null===this.collectionGroup&&0===this.filters.length},bl),us=(w.Wt=function(n){return new w(n)},Object.defineProperty(w.prototype,"orderBy",{get:function(){var n,r,i,e;if(null===this.qt)if(this.qt=[],n=this.jt(),r=this.Kt(),null!==n&&null===r)n.Y()||this.qt.push(new bh(n)),this.qt.push(new bh(vr.J(),"asc"));else{for(var u=!1,t=0,f=this.xt;t<f.length;t++)i=f[t],this.qt.push(i),i.field.Y()&&(u=!0);u||(e=0<this.xt.length?this.xt[this.xt.length-1].dir:"asc",this.qt.push(new bh(vr.J(),e)))}return this.qt},enumerable:!0,configurable:!0}),w.prototype.Gt=function(n){var t=this.filters.concat([n]);return new w(this.path,this.collectionGroup,this.xt.slice(),t,this.limit,this.Bt,this.startAt,this.endAt)},w.prototype.zt=function(n){var t=this.xt.concat([n]);return new w(this.path,this.collectionGroup,t,this.filters.slice(),this.limit,this.Bt,this.startAt,this.endAt)},w.prototype.Ht=function(n){return new w(this.path,this.collectionGroup,this.xt.slice(),this.filters.slice(),n,"F",this.startAt,this.endAt)},w.prototype.Yt=function(n){return new w(this.path,this.collectionGroup,this.xt.slice(),this.filters.slice(),n,"L",this.startAt,this.endAt)},w.prototype.Jt=function(n){return new w(this.path,this.collectionGroup,this.xt.slice(),this.filters.slice(),this.limit,this.Bt,n,this.endAt)},w.prototype.Xt=function(n){return new w(this.path,this.collectionGroup,this.xt.slice(),this.filters.slice(),this.limit,this.Bt,this.startAt,n)},w.prototype.Zt=function(n){return new w(n,null,this.xt.slice(),this.filters.slice(),this.limit,this.Bt,this.startAt,this.endAt)},w.prototype.te=function(){return 0===this.filters.length&&null===this.limit&&null==this.startAt&&null==this.endAt&&(0===this.xt.length||1===this.xt.length&&this.xt[0].field.Y())},w.prototype.canonicalId=function(){return this.ee().canonicalId()+"|lt:"+this.Bt},w.prototype.toString=function(){return"Query(target="+this.ee().toString()+"; limitType="+this.Bt+")"},w.prototype.isEqual=function(n){return this.ee().isEqual(n.ee())&&this.Bt===n.Bt},w.prototype.se=function(n,t){for(var r,u,f=!1,i=0,e=this.orderBy;i<e.length;i++){if(r=e[i],u=r.compare(n,t),0!==u)return u;f=f||r.field.Y()}return 0},w.prototype.matches=function(n){return this.ie(n)&&this.ne(n)&&this.re(n)&&this.he(n)},w.prototype.oe=function(){return!wo(this.limit)&&"F"===this.Bt},w.prototype.ae=function(){return!wo(this.limit)&&"L"===this.Bt},w.prototype.Kt=function(){return 0<this.xt.length?this.xt[0].field:null},w.prototype.jt=function(){for(var t,n=0,i=this.filters;n<i.length;n++)if(t=i[n],t instanceof kr&&t.ue())return t.field;return null},w.prototype.ce=function(n){for(var i,t=0,r=this.filters;t<r.length;t++)if(i=r[t],i instanceof kr&&0<=n.indexOf(i.op))return i.op;return null},w.prototype.Ot=function(){return this.ee().Ot()},w.prototype._e=function(){return null!==this.collectionGroup},w.prototype.ee=function(){var t,u,f,e;if(!this.Ut)if("F"===this.Bt)this.Ut=new vft(this.path,this.collectionGroup,this.orderBy,this.filters,this.limit,this.startAt,this.endAt);else{for(var i=[],n=0,r=this.orderBy;n<r.length;n++)t=r[n],u="desc"===t.dir?"asc":"desc",i.push(new bh(t.field,u));f=this.endAt?new pl(this.endAt.position,!this.endAt.before):null;e=this.startAt?new pl(this.startAt.position,!this.startAt.before):null;this.Ut=new vft(this.path,this.collectionGroup,i,this.filters,this.limit,f,e)}return this.Ut},w.prototype.ie=function(n){var t=n.key.path;return null!==this.collectionGroup?n.key.tt(this.collectionGroup)&&this.path.q(t):l.et(this.path)?this.path.isEqual(t):this.path.U(t)},w.prototype.ne=function(n){for(var r,t=0,i=this.xt;t<i.length;t++)if(r=i[t],!r.field.Y()&&null===n.field(r.field))return!1;return!0},w.prototype.re=function(n){for(var t=0,i=this.filters;t<i.length;t++)if(!i[t].matches(n))return!1;return!0},w.prototype.he=function(n){return!(this.startAt&&!this.startAt.le(this.orderBy,n)||this.endAt&&this.endAt.le(this.orderBy,n))},w.prototype.Qt=function(){},w),kr=(k(dr,cft=function(){}),dr.create=function(n,r,u){if(n.Y())return"in"===r?new oat(n,u):new eat(n,r,u);if(wut(u)){if("=="!==r)throw new i(t.INVALID_ARGUMENT,"Invalid query. Null supports only equality comparisons.");return new dr(n,r,u)}if(but(u)){if("=="!==r)throw new i(t.INVALID_ARGUMENT,"Invalid query. NaN supports only equality comparisons.");return new dr(n,r,u)}return"array-contains"===r?new sat(n,u):"in"===r?new hat(n,u):"array-contains-any"===r?new cat(n,u):new dr(n,r,u)},dr.prototype.matches=function(n){var t=n.field(this.field);return null!==t&&no(this.value)===no(t)&&this.de(cl(t,this.value))},dr.prototype.de=function(n){switch(this.op){case"<":return n<0;case"<=":return n<=0;case"==":return 0===n;case">":return 0<n;case">=":return 0<=n;default:return o()}},dr.prototype.ue=function(){return 0<=["<","<=",">",">="].indexOf(this.op)},dr.prototype.canonicalId=function(){return this.field.j()+this.op.toString()+gk(this.value)},dr.prototype.isEqual=function(n){return n instanceof dr&&this.op===n.op&&this.field.isEqual(n.field)&&lu(this.value,n.value)},dr.prototype.toString=function(){return this.field.j()+" "+this.op+" "+gk(this.value)},dr),eat=(k(wd,hft=kr),wd.prototype.matches=function(n){var t=l.N(n.key,this.key);return this.de(t)},wd),oat=(k(pd,sft=kr),pd.prototype.matches=function(n){return this.keys.some(function(t){return t.isEqual(n.key)})},pd),sat=(k(yd,oft=kr),yd.prototype.matches=function(n){var t=n.field(this.field);return td(t)&&dk(t.arrayValue,this.value)},yd),hat=(k(vd,eft=kr),vd.prototype.matches=function(n){var t=n.field(this.field);return null!==t&&dk(this.value.arrayValue,t)},vd),cat=(k(ad,fft=kr),ad.prototype.matches=function(n){var i=this,t=n.field(this.field);return!(!td(t)||!t.arrayValue.values)&&t.arrayValue.values.some(function(n){return dk(i.value.arrayValue,n)})},ad),pl=(wy.prototype.canonicalId=function(){return(this.before?"b":"a")+":"+this.position.map(function(n){return gk(n)}).join(",")},wy.prototype.le=function(n,t){for(var u,f,i=0,r=0;r<this.position.length;r++)if(u=n[r],f=this.position[r],i=u.field.Y()?l.N(l.Z(f.referenceValue),t.key):cl(f,t.field(u.field)),"desc"===u.dir&&(i*=-1),0!==i)break;return this.before?i<=0:i<0},wy.prototype.isEqual=function(n){if(null===n||this.before!==n.before||this.position.length!==n.position.length)return!1;for(var t=0;t<this.position.length;t++)if(!lu(this.position[t],n.position[t]))return!1;return!0},wy),bh=(wl.prototype.compare=function(n,t){var i,f,r,u,e=this.fe?l.N(n.key,t.key):(i=this.field,f=t,r=n.field(i),u=f.field(i),null!==r&&null!==u?cl(r,u):o());switch(this.dir){case"asc":return e;case"desc":return-1*e;default:return o()}},wl.prototype.canonicalId=function(){return this.field.j()+this.dir.toString()},wl.prototype.toString=function(){return this.field.j()+" ("+this.dir+")"},wl.prototype.isEqual=function(n){return this.dir===n.dir&&this.field.isEqual(n.field)},wl),py=(fs.prototype.Ie=function(n){return new fs(this.target,this.targetId,this.Te,n,this.Ee,this.lastLimboFreeSnapshotVersion,this.resumeToken)},fs.prototype.we=function(n,t){return new fs(this.target,this.targetId,this.Te,this.sequenceNumber,t,this.lastLimboFreeSnapshotVersion,n)},fs.prototype.Re=function(n){return new fs(this.target,this.targetId,this.Te,this.sequenceNumber,this.Ee,n,this.resumeToken)},fs);(nt=ti=ti||{})[nt.OK=0]="OK";nt[nt.CANCELLED=1]="CANCELLED";nt[nt.UNKNOWN=2]="UNKNOWN";nt[nt.INVALID_ARGUMENT=3]="INVALID_ARGUMENT";nt[nt.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED";nt[nt.NOT_FOUND=5]="NOT_FOUND";nt[nt.ALREADY_EXISTS=6]="ALREADY_EXISTS";nt[nt.PERMISSION_DENIED=7]="PERMISSION_DENIED";nt[nt.UNAUTHENTICATED=16]="UNAUTHENTICATED";nt[nt.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED";nt[nt.FAILED_PRECONDITION=9]="FAILED_PRECONDITION";nt[nt.ABORTED=10]="ABORTED";nt[nt.OUT_OF_RANGE=11]="OUT_OF_RANGE";nt[nt.UNIMPLEMENTED=12]="UNIMPLEMENTED";nt[nt.INTERNAL=13]="INTERNAL";nt[nt.UNAVAILABLE=14]="UNAVAILABLE";nt[nt.DATA_LOSS=15]="DATA_LOSS";var ir=(fi.prototype.Ae=function(n,t){return new fi(this.N,this.root.Ae(n,t,this.N).me(null,null,io.Pe,null,null))},fi.prototype.remove=function(n){return new fi(this.N,this.root.remove(n,this.N).me(null,null,io.Pe,null,null))},fi.prototype.get=function(n){for(var i,t=this.root;!t.B();){if(i=this.N(n,t.key),0===i)return t.value;i<0?t=t.left:0<i&&(t=t.right)}return null},fi.prototype.indexOf=function(n){for(var r,i=0,t=this.root;!t.B();){if(r=this.N(n,t.key),0===r)return i+t.left.size;t=r<0?t.left:(i+=t.left.size+1,t.right)}return-1},fi.prototype.B=function(){return this.root.B()},Object.defineProperty(fi.prototype,"size",{get:function(){return this.root.size},enumerable:!0,configurable:!0}),fi.prototype.Ve=function(){return this.root.Ve()},fi.prototype.ge=function(){return this.root.ge()},fi.prototype.pe=function(n){return this.root.pe(n)},fi.prototype.forEach=function(n){this.pe(function(t,i){return n(t,i),!1})},fi.prototype.toString=function(){var n=[];return this.pe(function(t,i){return n.push(t+":"+i),!1}),"{"+n.join(", ")+"}"},fi.prototype.ye=function(n){return this.root.ye(n)},fi.prototype.be=function(){return new by(this.root,null,this.N,!1)},fi.prototype.ve=function(n){return new by(this.root,n,this.N,!1)},fi.prototype.Se=function(){return new by(this.root,null,this.N,!0)},fi.prototype.De=function(n){return new by(this.root,n,this.N,!0)},fi),by=(ky.prototype.Ne=function(){var n=this.Fe.pop(),t={key:n.key,value:n.value};if(this.Ce)for(n=n.left;!n.B();)this.Fe.push(n),n=n.right;else for(n=n.right;!n.B();)this.Fe.push(n),n=n.left;return t},ky.prototype.ke=function(){return 0<this.Fe.length},ky.prototype.$e=function(){if(0===this.Fe.length)return null;var n=this.Fe[this.Fe.length-1];return{key:n.key,value:n.value}},ky),io=(ut.prototype.me=function(n,t,i,r,u){return new ut(null!=n?n:this.key,null!=t?t:this.value,null!=i?i:this.color,null!=r?r:this.left,null!=u?u:this.right)},ut.prototype.B=function(){return!1},ut.prototype.pe=function(n){return this.left.pe(n)||n(this.key,this.value)||this.right.pe(n)},ut.prototype.ye=function(n){return this.right.ye(n)||n(this.key,this.value)||this.left.ye(n)},ut.prototype.min=function(){return this.left.B()?this:this.left.min()},ut.prototype.Ve=function(){return this.min().key},ut.prototype.ge=function(){return this.right.B()?this.key:this.right.ge()},ut.prototype.Ae=function(n,t,i){var r=this,u=i(n,r.key);return(r=u<0?r.me(null,null,null,r.left.Ae(n,t,i),null):0===u?r.me(null,t,null,null,null):r.me(null,null,null,null,r.right.Ae(n,t,i))).Me()},ut.prototype.Le=function(){if(this.left.B())return ut.EMPTY;var n=this;return n.left.Oe()||n.left.left.Oe()||(n=n.xe()),(n=n.me(null,null,null,n.left.Le(),null)).Me()},ut.prototype.remove=function(n,t){var r,i=this;if(t(n,i.key)<0)i.left.B()||i.left.Oe()||i.left.left.Oe()||(i=i.xe()),i=i.me(null,null,null,i.left.remove(n,t),null);else{if(i.left.Oe()&&(i=i.Be()),i.right.B()||i.right.Oe()||i.right.left.Oe()||(i=i.qe()),0===t(n,i.key)){if(i.right.B())return ut.EMPTY;r=i.right.min();i=i.me(r.key,r.value,null,null,i.right.Le())}i=i.me(null,null,null,null,i.right.remove(n,t))}return i.Me()},ut.prototype.Oe=function(){return this.color},ut.prototype.Me=function(){var n=this;return n.right.Oe()&&!n.left.Oe()&&(n=n.Ue()),n.left.Oe()&&n.left.left.Oe()&&(n=n.Be()),n.left.Oe()&&n.right.Oe()&&(n=n.Qe()),n},ut.prototype.xe=function(){var n=this.Qe();return n.right.left.Oe()&&(n=(n=(n=n.me(null,null,null,null,n.right.Be())).Ue()).Qe()),n},ut.prototype.qe=function(){var n=this.Qe();return n.left.left.Oe()&&(n=(n=n.Be()).Qe()),n},ut.prototype.Ue=function(){var n=this.me(null,null,ut.RED,null,this.right.left);return this.right.me(null,null,this.color,n,null)},ut.prototype.Be=function(){var n=this.me(null,null,ut.RED,this.left.right,null);return this.left.me(null,null,this.color,null,n)},ut.prototype.Qe=function(){var n=this.left.me(null,null,!this.left.color,null,null),t=this.right.me(null,null,!this.right.color,null,null);return this.me(null,null,!this.color,n,t)},ut.prototype.We=function(){var n=this.je();return Math.pow(2,n)<=this.size+1},ut.prototype.je=function(){if(this.Oe()&&this.left.Oe())throw o();if(this.right.Oe())throw o();var n=this.left.je();if(n!==this.right.je())throw o();return n+(this.Oe()?0:1)},ut);io.EMPTY=null;io.RED=!0;io.Pe=!1;io.EMPTY=(Object.defineProperty(pi.prototype,"key",{get:function(){throw o();},enumerable:!0,configurable:!0}),Object.defineProperty(pi.prototype,"value",{get:function(){throw o();},enumerable:!0,configurable:!0}),Object.defineProperty(pi.prototype,"color",{get:function(){throw o();},enumerable:!0,configurable:!0}),Object.defineProperty(pi.prototype,"left",{get:function(){throw o();},enumerable:!0,configurable:!0}),Object.defineProperty(pi.prototype,"right",{get:function(){throw o();},enumerable:!0,configurable:!0}),pi.prototype.me=function(){return this},pi.prototype.Ae=function(n,t){return new io(n,t)},pi.prototype.remove=function(){return this},pi.prototype.B=function(){return!0},pi.prototype.pe=function(){return!1},pi.prototype.ye=function(){return!1},pi.prototype.Ve=function(){return null},pi.prototype.ge=function(){return null},pi.prototype.Oe=function(){return!1},pi.prototype.We=function(){return!0},pi.prototype.je=function(){return 0},new pi);var ei=(yt.prototype.has=function(n){return null!==this.data.get(n)},yt.prototype.first=function(){return this.data.Ve()},yt.prototype.last=function(){return this.data.ge()},Object.defineProperty(yt.prototype,"size",{get:function(){return this.data.size},enumerable:!0,configurable:!0}),yt.prototype.indexOf=function(n){return this.data.indexOf(n)},yt.prototype.forEach=function(n){this.data.pe(function(t){return n(t),!1})},yt.prototype.Ke=function(n,t){for(var r,i=this.data.ve(n[0]);i.ke();){if(r=i.Ne(),0<=this.N(r.key,n[1]))return;t(r.key)}},yt.prototype.Ge=function(n,t){for(var i=void 0!==t?this.data.ve(t):this.data.be();i.ke();)if(!n(i.Ne().key))return},yt.prototype.ze=function(n){var t=this.data.ve(n);return t.ke()?t.Ne().key:null},yt.prototype.be=function(){return new pft(this.data.be())},yt.prototype.ve=function(n){return new pft(this.data.ve(n))},yt.prototype.add=function(n){return this.me(this.data.remove(n).Ae(n,!0))},yt.prototype.delete=function(n){return this.has(n)?this.me(this.data.remove(n)):this},yt.prototype.B=function(){return this.data.B()},yt.prototype.He=function(n){var t=this;return t.size<n.size&&(t=n,n=this),n.forEach(function(n){t=t.add(n)}),t},yt.prototype.isEqual=function(n){var t,i,r,u;if(!(n instanceof yt)||this.size!==n.size)return!1;for(t=this.data.be(),i=n.data.be();t.ke();)if(r=t.Ne().key,u=i.Ne().key,0!==this.N(r,u))return!1;return!0},yt.prototype.W=function(){var n=[];return this.forEach(function(t){n.push(t)}),n},yt.prototype.toString=function(){var n=[];return this.forEach(function(t){return n.push(t)}),"SortedSet("+n.toString()+")"},yt.prototype.me=function(n){var t=new yt(this.N);return t.data=n,t},yt),pft=(kd.prototype.Ne=function(){return this.Ye.Ne().key},kd.prototype.ke=function(){return this.Ye.ke()},kd),lat=new ir(l.N);wft=new ir(l.N);bft=new ir(l.N);dft=new ei(l.N);gft=new ei(p);var iet=(ci.Ze=function(n){return new ci(n.N)},ci.prototype.has=function(n){return null!=this.Je.get(n)},ci.prototype.get=function(n){return this.Je.get(n)},ci.prototype.first=function(){return this.Xe.Ve()},ci.prototype.last=function(){return this.Xe.ge()},ci.prototype.B=function(){return this.Xe.B()},ci.prototype.indexOf=function(n){var t=this.Je.get(n);return t?this.Xe.indexOf(t):-1},Object.defineProperty(ci.prototype,"size",{get:function(){return this.Xe.size},enumerable:!0,configurable:!0}),ci.prototype.forEach=function(n){this.Xe.pe(function(t){return n(t),!1})},ci.prototype.add=function(n){var t=this.delete(n.key);return t.me(t.Je.Ae(n.key,n),t.Xe.Ae(n,null))},ci.prototype.delete=function(n){var t=this.get(n);return t?this.me(this.Je.remove(n),this.Xe.remove(t)):this},ci.prototype.isEqual=function(n){var t,i,r,u;if(!(n instanceof ci)||this.size!==n.size)return!1;for(t=this.Xe.be(),i=n.Xe.be();t.ke();)if(r=t.Ne().key,u=i.Ne().key,!r.isEqual(u))return!1;return!0},ci.prototype.toString=function(){var n=[];return this.forEach(function(t){n.push(t.toString())}),0===n.length?"DocumentSet ()":"DocumentSet (\n  "+n.join("  \n")+"\n)"},ci.prototype.me=function(n,t){var i=new ci;return i.N=this.N,i.Je=n,i.Xe=t,i},ci),ret=(ig.prototype.track=function(n){var i=n.doc.key,t=this.ts.get(i);!t||0!==n.type&&3===t.type?this.ts=this.ts.Ae(i,n):3===n.type&&1!==t.type?this.ts=this.ts.Ae(i,{type:t.type,doc:n.doc}):2===n.type&&2===t.type?this.ts=this.ts.Ae(i,{type:2,doc:n.doc}):2===n.type&&0===t.type?this.ts=this.ts.Ae(i,{type:0,doc:n.doc}):1===n.type&&0===t.type?this.ts=this.ts.remove(i):1===n.type&&2===t.type?this.ts=this.ts.Ae(i,{type:1,doc:t.doc}):0===n.type&&1===t.type?this.ts=this.ts.Ae(i,{type:2,doc:n.doc}):o()},ig.prototype.es=function(){var n=[];return this.ts.pe(function(t,i){n.push(i)}),n},ig),tp=(dl.os=function(n,t,i,r){var u=[];return t.forEach(function(n){u.push({type:0,doc:n})}),new dl(n,t,iet.Ze(t),u,i,r,!0,!1)},Object.defineProperty(dl.prototype,"hasPendingWrites",{get:function(){return!this.ns.B()},enumerable:!0,configurable:!0}),dl.prototype.isEqual=function(n){var i,r,t;if(!(this.fromCache===n.fromCache&&this.rs===n.rs&&this.ns.isEqual(n.ns)&&this.query.isEqual(n.query)&&this.docs.isEqual(n.docs)&&this.ss.isEqual(n.ss))||(i=this.docChanges,r=n.docChanges,i.length!==r.length))return!1;for(t=0;t<i.length;t++)if(i[t].type!==r[t].type||!i[t].doc.isEqual(r[t].doc))return!1;return!0},dl),dd=(tg.ls=function(n,t){var i=new Map;return i.set(n,gd.ds(n,t)),new tg(g.min(),i,gy(),es(),ft())},tg),gd=(ng.ds=function(n,t){return new ng(gt.ht,t,ft(),ft(),ft())},ng),uet=(Object.defineProperty(gr.prototype,"fs",{get:function(){return this.gs},enumerable:!0,configurable:!0}),Object.defineProperty(gr.prototype,"resumeToken",{get:function(){return this.Vs},enumerable:!0,configurable:!0}),Object.defineProperty(gr.prototype,"ys",{get:function(){return 0!==this.ms},enumerable:!0,configurable:!0}),Object.defineProperty(gr.prototype,"bs",{get:function(){return this.ps},enumerable:!0,configurable:!0}),gr.prototype.vs=function(n){0<n.rt()&&(this.ps=!0,this.Vs=n)},gr.prototype.Ss=function(){var n=ft(),t=ft(),i=ft();return this.Ps.forEach(function(r,u){switch(u){case 0:n=n.add(r);break;case 2:t=t.add(r);break;case 1:i=i.add(r);break;default:o()}}),new gd(this.Vs,this.gs,n,t,i)},gr.prototype.Ds=function(){this.ps=!1;this.Ps=eet()},gr.prototype.Cs=function(n,t){this.ps=!0;this.Ps=this.Ps.Ae(n,t)},gr.prototype.Fs=function(n){this.ps=!0;this.Ps=this.Ps.remove(n)},gr.prototype.Ns=function(){this.ms+=1},gr.prototype.ks=function(){--this.ms},gr.prototype.$s=function(){this.ps=!0;this.gs=!0},gr),aat=(wi.prototype.qs=function(n){for(var u,i,f,e,t=0,r=n.ws;t<r.length;t++)u=r[t],n.Rs instanceof it?this.Us(u,n.Rs):n.Rs instanceof hi&&this.Qs(u,n.key,n.Rs);for(i=0,f=n.removedTargetIds;i<f.length;i++)e=f[i],this.Qs(e,n.key,n.Rs)},wi.prototype.Ws=function(n){var t=this;this.js(n,function(i){var r=t.Ks(i);switch(n.state){case 0:t.Gs(i)&&r.vs(n.resumeToken);break;case 1:r.ks();r.ys||r.Ds();r.vs(n.resumeToken);break;case 2:r.ks();r.ys||t.removeTarget(i);break;case 3:t.Gs(i)&&(r.$s(),r.vs(n.resumeToken));break;case 4:t.Gs(i)&&(t.zs(i),r.vs(n.resumeToken));break;default:o()}})},wi.prototype.js=function(n,t){var i=this;0<n.targetIds.length?n.targetIds.forEach(t):this.Ls.forEach(function(n,r){i.Gs(r)&&t(r)})},wi.prototype.Hs=function(n){var t=n.targetId,i=n.As.count,f=this.Ys(t),r,u;f&&(r=f.target,r.Ot()?0===i?(u=new l(r.path),this.Qs(t,u,new hi(u,g.min()))):c(1===i):this.Js(t)!==i&&(this.zs(t),this.Bs=this.Bs.add(t)))},wi.prototype.Xs=function(n){var t=this,r=new Map,i,u;return this.Ls.forEach(function(i,u){var e=t.Ys(u),f;e&&(i.fs&&e.target.Ot()&&(f=new l(e.target.path),null!==t.Os.get(f)||t.Zs(u,f)||t.Qs(u,f,new hi(f,n))),i.bs&&(r.set(u,i.Ss()),i.Ds()))}),i=ft(),this.xs.forEach(function(n,r){var u=!0;r.Ge(function(n){var i=t.Ys(n);return!i||2===i.Te||(u=!1)});u&&(i=i.add(n))}),u=new dd(n,r,this.Bs,this.Os,i),this.Os=es(),this.xs=fet(),this.Bs=new ei(p),u},wi.prototype.Us=function(n,t){if(this.Gs(n)){var i=this.Zs(n,t.key)?2:0;this.Ks(n).Cs(t.key,i);this.Os=this.Os.Ae(t.key,t);this.xs=this.xs.Ae(t.key,this.ti(t.key).add(n))}},wi.prototype.Qs=function(n,t,i){if(this.Gs(n)){var r=this.Ks(n);this.Zs(n,t)?r.Cs(t,1):r.Fs(t);this.xs=this.xs.Ae(t,this.ti(t).delete(n));i&&(this.Os=this.Os.Ae(t,i))}},wi.prototype.removeTarget=function(n){this.Ls.delete(n)},wi.prototype.Js=function(n){var t=this.Ks(n).Ss();return this.Ms.ei(n).size+t.Ts.size-t.Is.size},wi.prototype.Ns=function(n){this.Ks(n).Ns()},wi.prototype.Ks=function(n){var t=this.Ls.get(n);return t||(t=new uet,this.Ls.set(n,t)),t},wi.prototype.ti=function(n){var t=this.xs.get(n);return t||(t=new ei(p),this.xs=this.xs.Ae(n,t)),t},wi.prototype.Gs=function(n){var t=null!==this.Ys(n);return t||e("WatchChangeAggregator","Detected inactive target",n),t},wi.prototype.Ys=function(n){var t=this.Ls.get(n);return t&&t.ys?null:this.Ms.si(n)},wi.prototype.zs=function(n){var t=this;this.Ls.set(n,new uet);this.Ms.ei(n).forEach(function(i){t.Qs(n,i,null)})},wi.prototype.Zs=function(n,t){return this.Ms.ei(n).has(t)},wi);var vat={asc:"ASCENDING",desc:"DESCENDING"},yat={"<":"LESS_THAN","<=":"LESS_THAN_OR_EQUAL",">":"GREATER_THAN",">=":"GREATER_THAN_OR_EQUAL","==":"EQUAL","array-contains":"ARRAY_CONTAINS","in":"IN","array-contains-any":"ARRAY_CONTAINS_ANY"},pat=(s.prototype.ni=function(n){var r=void 0===n.code?t.UNKNOWN:yft(n.code);return new i(r,n.message||"")},s.prototype.ri=function(n){return this.options.hi||wo(n)?n:{value:n}},s.prototype.oi=function(n){var t;return wo(t="object"==typeof n?n.value:n)?null:t},s.prototype._t=function(n){return{integerValue:""+n}},s.prototype.lt=function(n){if(this.options.hi){if(isNaN(n))return{doubleValue:"NaN"};if(n===1/0)return{doubleValue:"Infinity"};if(n===-1/0)return{doubleValue:"-Infinity"}}return{doubleValue:ly(n)?"-0":n}},s.prototype.ai=function(n){return vut(n)?this._t(n):this.lt(n)},s.prototype.C=function(n){return this.options.hi?new Date(1e3*n.seconds).toISOString().replace(/\.\d*/,"").replace("Z","")+"."+("000000000"+n.nanoseconds).slice(-9)+"Z":{seconds:""+n.seconds,nanos:n.nanoseconds}},s.prototype.v=function(n){var t=to(n);return new ar(t.seconds,t.nanos)},s.prototype.ui=function(n){return this.options.hi?n.toBase64():n.toUint8Array()},s.prototype.ci=function(n){return this.options.hi?(c(void 0===n||"string"==typeof n),gt.fromBase64String(n||"")):(c(void 0===n||n instanceof Uint8Array),gt.fromUint8Array(n||new Uint8Array))},s.prototype.toVersion=function(n){return this.C(n.C())},s.prototype.fromVersion=function(n){return c(!!n),g.v(this.v(n))},s.prototype._i=function(n,t){return this.li(t||this.ii).child("documents").child(n).j()},s.prototype.di=function(n){var t=ot.K(n);return c(oet(t)),t},s.prototype.fi=function(n){return this._i(n.path)},s.prototype.Z=function(n){var t=this.di(n);return c(t.get(1)===this.ii.projectId),c(!t.get(3)&&!this.ii.database||t.get(3)===this.ii.database),new l(this.Ti(t))},s.prototype.Ei=function(n){return this._i(n)},s.prototype.Ii=function(n){var t=this.di(n);return 4===t.length?ot.G:this.Ti(t)},Object.defineProperty(s.prototype,"wi",{get:function(){return new ot(["projects",this.ii.projectId,"databases",this.ii.database]).j()},enumerable:!0,configurable:!0}),s.prototype.li=function(n){return new ot(["projects",n.projectId,"databases",n.database])},s.prototype.Ti=function(n){return c(4<n.length&&"documents"===n.get(4)),n.$(5)},s.prototype.Ri=function(n,t){return{name:this.fi(n),fields:t.proto.mapValue.fields}},s.prototype.Ai=function(n){return{name:this.fi(n.key),fields:n.Mt().mapValue.fields,updateTime:this.C(n.version.C())}},s.prototype.mi=function(n,t){var i=this.Z(n.name),r=this.fromVersion(n.updateTime),u=new gf({mapValue:{fields:n.fields}});return new it(i,r,u,{hasCommittedMutations:!!t})},s.prototype.Pi=function(n){c(!!n.found);n.found.name;n.found.updateTime;var t=this.Z(n.found.name),i=this.fromVersion(n.found.updateTime),r=new gf({mapValue:{fields:n.found.fields}});return new it(t,i,r,{})},s.prototype.Vi=function(n){c(!!n.missing);c(!!n.readTime);var t=this.Z(n.missing),i=this.fromVersion(n.readTime);return new hi(t,i)},s.prototype.gi=function(n){return"found"in n?this.Pi(n):"missing"in n?this.Vi(n):o()},s.prototype.pi=function(n){var i,t,r,u,c,l,f;if("targetChange"in n){n.targetChange;var a=this.yi(n.targetChange.targetChangeType||"NO_CHANGE"),v=n.targetChange.targetIds||[],y=this.ci(n.targetChange.resumeToken),e=n.targetChange.cause,p=e&&this.ni(e);i=new tet(a,v,y,p||null)}else if("documentChange"in n){n.documentChange;t=n.documentChange;t.document;t.document.name;t.document.updateTime;var w=this.Z(t.document.name),b=this.fromVersion(t.document.updateTime),k=new gf({mapValue:{fields:t.document.fields}}),s=new it(w,b,k,{}),d=t.targetIds||[],nt=t.removedTargetIds||[];i=new np(d,nt,s.key,s)}else if("documentDelete"in n){n.documentDelete;r=n.documentDelete;r.document;var tt=this.Z(r.document),rt=r.readTime?this.fromVersion(r.readTime):g.min(),h=new hi(tt,rt),ut=r.removedTargetIds||[];i=new np([],ut,h.key,h)}else if("documentRemove"in n)n.documentRemove,u=n.documentRemove,u.document,c=this.Z(u.document),l=u.removedTargetIds||[],i=new np([],l,c,null);else{if(!("filter"in n))return o();n.filter;f=n.filter;f.targetId;var ft=f.count||0,et=new fat(ft),ot=f.targetId;i=new net(ot,et)}return i},s.prototype.yi=function(n){return"NO_CHANGE"===n?0:"ADD"===n?1:"REMOVE"===n?2:"CURRENT"===n?3:"RESET"===n?4:o()},s.prototype.bi=function(n){if(!("targetChange"in n))return g.min();var t=n.targetChange;return t.targetIds&&t.targetIds.length||!t.readTime?g.min():this.fromVersion(t.readTime)},s.prototype.vi=function(n){var t,i=this;if(n instanceof ed)t={update:this.Ri(n.key,n.value)};else if(n instanceof al)t={"delete":this.fi(n.key)};else if(n instanceof ph)t={update:this.Ri(n.key,n.data),updateMask:this.Si(n.Vt)};else if(n instanceof vy)t={transform:{document:this.fi(n.key),fieldTransforms:n.fieldTransforms.map(function(n){return i.Di(n)})}};else{if(!(n instanceof od))return o();t={verify:this.fi(n.key)}}return n.Rt.Tt||(t.currentDocument=this.Ci(n.Rt)),t},s.prototype.Fi=function(n){var l=this,t=n.currentDocument?this.Ni(n.currentDocument):tr.ft(),i,r,u,f,e,s,h;return n.update?(n.update.name,i=this.Z(n.update.name),r=new gf({mapValue:{fields:n.update.fields}}),n.updateMask)?(u=this.ki(n.updateMask),new ph(i,r,u,t)):new ed(i,r,t):n.delete?(f=this.Z(n.delete),new al(f,t)):n.transform?(e=this.Z(n.transform.document),s=n.transform.fieldTransforms.map(function(n){return l.$i(n)}),c(!0===t.exists),new vy(e,s)):n.verify?(h=this.Z(n.verify),new od(h,t)):o()},s.prototype.Ci=function(n){return void 0!==n.updateTime?{updateTime:this.toVersion(n.updateTime)}:void 0!==n.exists?{exists:n.exists}:o()},s.prototype.Ni=function(n){return void 0!==n.updateTime?tr.updateTime(this.fromVersion(n.updateTime)):void 0!==n.exists?tr.exists(n.exists):tr.ft()},s.prototype.Mi=function(n,t){var i=n.updateTime?this.fromVersion(n.updateTime):this.fromVersion(t),r;return i.isEqual(g.min())&&(i=this.fromVersion(t)),r=null,n.transformResults&&0<n.transformResults.length&&(r=n.transformResults),new uat(i,r)},s.prototype.Li=function(n,t){var i=this;return n&&0<n.length?(c(void 0!==t),n.map(function(n){return i.Mi(n,t)})):[]},s.prototype.Di=function(n){var t=n.transform;if(t instanceof ah)return{fieldPath:n.field.j(),setToServerValue:"REQUEST_TIME"};if(t instanceof rd)return{fieldPath:n.field.j(),appendMissingElements:{values:t.elements}};if(t instanceof ud)return{fieldPath:n.field.j(),removeAllFromArray:{values:t.elements}};if(t instanceof fd)return{fieldPath:n.field.j(),increment:t.ct};throw o();},s.prototype.$i=function(n){var t=null,i,r,u;return"setToServerValue"in n?(c("REQUEST_TIME"===n.setToServerValue),t=ah.instance):"appendMissingElements"in n?(i=n.appendMissingElements.values||[],t=new rd(i)):"removeAllFromArray"in n?(r=n.removeAllFromArray.values||[],t=new ud(r)):"increment"in n?t=new fd(this,n.increment):o(),u=vr.X(n.fieldPath),new ll(u,t)},s.prototype.Oi=function(n){return{documents:[this.Ei(n.path)]}},s.prototype.xi=function(n){c(1===n.documents.length);var t=n.documents[0];return us.Wt(this.Ii(t)).ee()},s.prototype.Bi=function(n){var t={structuredQuery:{}},i=n.path,r,u,f;return null!==n.collectionGroup?(t.parent=this.Ei(i),t.structuredQuery.from=[{collectionId:n.collectionGroup,allDescendants:!0}]):(t.parent=this.Ei(i.M()),t.structuredQuery.from=[{collectionId:i.O()}]),r=this.qi(n.filters),r&&(t.structuredQuery.where=r),u=this.Ui(n.orderBy),u&&(t.structuredQuery.orderBy=u),f=this.ri(n.limit),null!==f&&(t.structuredQuery.limit=f),n.startAt&&(t.structuredQuery.startAt=this.Qi(n.startAt)),n.endAt&&(t.structuredQuery.endAt=this.Qi(n.endAt)),t},s.prototype.Wi=function(n){var r=this.Ii(n.parent),t=n.structuredQuery,h=t.from?t.from.length:0,l=null,i,u,f,e,o,s;return 0<h&&(c(1===h),i=t.from[0],i.allDescendants?l=i.collectionId:r=r.child(i.collectionId)),u=[],t.where&&(u=this.ji(t.where)),f=[],t.orderBy&&(f=this.Ki(t.orderBy)),e=null,t.limit&&(e=this.oi(t.limit)),o=null,t.startAt&&(o=this.Gi(t.startAt)),s=null,t.endAt&&(s=this.Gi(t.endAt)),new us(r,l,f,u,e,"F",o,s).ee()},s.prototype.zi=function(n){var t=this.Hi(n.Te);return null==t?null:{"goog-listen-tags":t}},s.prototype.Hi=function(n){switch(n){case 0:return null;case 1:return"existence-filter-mismatch";case 2:return"limbo-document";default:return o()}},s.prototype.ee=function(n){var t,i=n.target;return(t=i.Ot()?{documents:this.Oi(i)}:{query:this.Bi(i)}).targetId=n.targetId,0<n.resumeToken.rt()&&(t.resumeToken=this.ui(n.resumeToken)),t},s.prototype.qi=function(n){var i=this,t;if(0!==n.length)return t=n.map(function(n){return n instanceof kr?i.Yi(n):o()}),1===t.length?t[0]:{compositeFilter:{op:"AND",filters:t}}},s.prototype.ji=function(n){var t=this;return n?void 0!==n.unaryFilter?[this.Ji(n)]:void 0!==n.fieldFilter?[this.Xi(n)]:void 0!==n.compositeFilter?n.compositeFilter.filters.map(function(n){return t.ji(n)}).reduce(function(n,t){return n.concat(t)}):o():[]},s.prototype.Ui=function(n){var t=this;if(0!==n.length)return n.map(function(n){return t.Zi(n)})},s.prototype.Ki=function(n){var t=this;return n.map(function(n){return t.tn(n)})},s.prototype.Qi=function(n){return{before:n.before,values:n.position}},s.prototype.Gi=function(n){var t=!!n.before,i=n.values||[];return new pl(i,t)},s.prototype.en=function(n){return vat[n]},s.prototype.sn=function(n){switch(n){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}},s.prototype.nn=function(n){return yat[n]},s.prototype.rn=function(n){switch(n){case"EQUAL":return"==";case"GREATER_THAN":return">";case"GREATER_THAN_OR_EQUAL":return">=";case"LESS_THAN":return"<";case"LESS_THAN_OR_EQUAL":return"<=";case"ARRAY_CONTAINS":return"array-contains";case"IN":return"in";case"ARRAY_CONTAINS_ANY":return"array-contains-any";case"OPERATOR_UNSPECIFIED":default:return o()}},s.prototype.hn=function(n){return{fieldPath:n.j()}},s.prototype.on=function(n){return vr.X(n.fieldPath)},s.prototype.Zi=function(n){return{field:this.hn(n.field),direction:this.en(n.dir)}},s.prototype.tn=function(n){return new bh(this.on(n.field),this.sn(n.direction))},s.prototype.Xi=function(n){return kr.create(this.on(n.fieldFilter.field),this.rn(n.fieldFilter.op),n.fieldFilter.value)},s.prototype.Yi=function(n){if("=="===n.op){if(but(n.value))return{unaryFilter:{field:this.hn(n.field),op:"IS_NAN"}};if(wut(n.value))return{unaryFilter:{field:this.hn(n.field),op:"IS_NULL"}}}return{fieldFilter:{field:this.hn(n.field),op:this.nn(n.op),value:n.value}}},s.prototype.Ji=function(n){var t,i;switch(n.unaryFilter.op){case"IS_NAN":return t=this.on(n.unaryFilter.field),kr.create(t,"==",{doubleValue:NaN});case"IS_NULL":return i=this.on(n.unaryFilter.field),kr.create(i,"==",{nullValue:"NULL_VALUE"});case"OPERATOR_UNSPECIFIED":default:return o()}},s.prototype.Si=function(n){var t=[];return n.fields.forEach(function(n){return t.push(n.j())}),{fieldPaths:t}},s.prototype.ki=function(n){var t=n.fieldPaths||[];return new yh(t.map(function(n){return vr.X(n)}))},s);vu=(os.an=function(n){os.platform&&o();os.platform=n},os.nt=function(){return os.platform||o(),os.platform},os);ie=new act("@firebase/firestore");ug=(het.cn=function(){for(var r,n,t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",u=Math.floor(256/t.length)*t.length,i="";i.length<20;)for(r=vu.nt()._n(40),n=0;n<r.length;++n)i.length<20&&r[n]<u&&(i+=t.charAt(r[n]%t.length));return i},het);var fg=(Object.defineProperty(gl.prototype,"ln",{get:function(){return"(default)"===this.database},enumerable:!0,configurable:!0}),gl.prototype.isEqual=function(n){return n instanceof gl&&n.projectId===this.projectId&&n.database===this.database},gl.prototype.S=function(n){return p(this.projectId,n.projectId)||p(this.database,n.database)},gl),gh=(hs.prototype.get=function(n){var f=this.dn(n),r=this.fn[f],t,i;if(void 0!==r)for(t=0,i=r;t<i.length;t++){var u=i[t],e=u[0],o=u[1];if(e.isEqual(n))return o}},hs.prototype.has=function(n){return void 0!==this.get(n)},hs.prototype.set=function(n,t){var u=this.dn(n),i=this.fn[u],r;if(void 0!==i){for(r=0;r<i.length;r++)if(i[r][0].isEqual(n))return void(i[r]=[n,t]);i.push([n,t])}else this.fn[u]=[[n,t]]},hs.prototype.delete=function(n){var r=this.dn(n),t=this.fn[r],i;if(void 0===t)return!1;for(i=0;i<t.length;i++)if(t[i][0].isEqual(n))return 1===t.length?delete this.fn[r]:t.splice(i,1),!0;return!1},hs.prototype.forEach=function(n){ch(this.fn,function(t,i){for(var r=0,u=i;r<u.length;r++){var f=u[r],e=f[0],o=f[1];n(e,o)}})},hs.prototype.B=function(){return aut(this.fn)},hs),eg=(nc.prototype.at=function(n,t,i){for(var u,e,f=i.En,r=0;r<this.mutations.length;r++)u=this.mutations[r],u.key.isEqual(n)&&(e=f[r],t=u.at(t,e));return t},nc.prototype.ot=function(n,t){for(var u,e,i=0,r=this.baseMutations;i<r.length;i++)u=r[i],u.key.isEqual(n)&&(t=u.ot(t,t,this.Tn));for(var s=t,f=0,o=this.mutations;f<o.length;f++)e=o[f],e.key.isEqual(n)&&(t=e.ot(t,s,this.Tn));return t},nc.prototype.In=function(n){var i=this,t=n;return this.mutations.forEach(function(r){var u=i.ot(r.key,n.get(r.key));u&&(t=t.Ae(r.key,u))}),t},nc.prototype.keys=function(){return this.mutations.reduce(function(n,t){return n.add(t.key)},ft())},nc.prototype.isEqual=function(n){return this.batchId===n.batchId&&ss(this.mutations,n.mutations,function(n,t){return n.isEqual(t)})&&ss(this.baseMutations,n.baseMutations,function(n,t){return n.isEqual(t)})},nc),bat=(cg.from=function(n,t,i,r){c(n.mutations.length===i.length);for(var f=kft(),e=n.mutations,u=0;u<e.length;u++)f=f.Ae(e[u].key,i[u].version);return new cg(n,t,i,r,f)},cg),r=(at.prototype.catch=function(n){return this.next(void 0,n)},at.prototype.next=function(n,t){var i=this;return this.Vn&&o(),this.Vn=!0,this.Pn?this.error?this.gn(t,this.error):this.pn(n,this.result):new at(function(r,u){i.An=function(t){i.pn(n,t).next(r,u)};i.mn=function(n){i.gn(t,n).next(r,u)}})},at.prototype.yn=function(){var n=this;return new Promise(function(t,i){n.next(t,i)})},at.prototype.bn=function(n){try{var t=n();return t instanceof at?t:at.resolve(t)}catch(n){return at.reject(n)}},at.prototype.pn=function(n,t){return n?this.bn(function(){return n(t)}):at.resolve(t)},at.prototype.gn=function(n,t){return n?this.bn(function(){return n(t)}):at.reject(t)},at.resolve=function(n){return new at(function(t){t(n)})},at.reject=function(n){return new at(function(t,i){i(n)})},at.vn=function(n){return new at(function(t,i){var r=0,u=0,f=!1;n.forEach(function(n){++r;n.next(function(){++u;f&&u===r&&t()},function(n){return i(n)})});f=!0;u===r&&t()})},at.Sn=function(n){for(var t=at.resolve(!1),u=function(n){t=t.next(function(t){return t?at.resolve(t):n()})},i=0,r=n;i<r.length;i++)u(r[i]);return t},at.forEach=function(n,t){var r=this,i=[];return n.forEach(function(n,u){i.push(t.call(r,n,u))}),this.vn(i)},at),aet=(Object.defineProperty(ro.prototype,"readTime",{get:function(){return this.Fn},set:function(n){this.Fn=n},enumerable:!0,configurable:!0}),ro.prototype.Nn=function(n,t){this.kn();this.readTime=t;this.Dn.set(n.key,n)},ro.prototype.$n=function(n,t){this.kn();t&&(this.readTime=t);this.Dn.set(n,null)},ro.prototype.Mn=function(n,t){this.kn();var i=this.Dn.get(t);return void 0!==i?r.resolve(i):this.Ln(n,t)},ro.prototype.getEntries=function(n,t){return this.On(n,t)},ro.prototype.apply=function(n){return this.kn(),this.Cn=!0,this.xn(n)},ro.prototype.kn=function(){},ro),vet="The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.",yet=(hg.prototype.qn=function(n){this.Bn.push(n)},hg.prototype.Un=function(){this.Bn.forEach(function(n){return n()})},hg),pet=(pu.prototype.Kn=function(n,t){var i=this;return this.Wn.Gn(n,t).next(function(r){return i.zn(n,t,r)})},pu.prototype.zn=function(n,t,i){return this.Qn.Mn(n,t).next(function(n){for(var r=0,u=i;r<u.length;r++)n=u[r].ot(t,n);return n})},pu.prototype.Hn=function(n,t,i){var r=dy();return t.forEach(function(n,t){for(var u=0,f=i;u<f.length;u++)t=f[u].ot(n,t);r=r.Ae(n,t)}),r},pu.prototype.Yn=function(n,t){var i=this;return this.Qn.getEntries(n,t).next(function(t){return i.Jn(n,t)})},pu.prototype.Jn=function(n,t){var i=this;return this.Wn.Xn(n,t).next(function(r){var f=i.Hn(n,t,r),u=es();return f.forEach(function(n,t){t=t||new hi(n,g.min());u=u.Ae(n,t)}),u})},pu.prototype.Zn=function(n,t,i){return t.Ot()?this.tr(n,t.path):t._e()?this.er(n,t,i):this.sr(n,t,i)},pu.prototype.tr=function(n,t){return this.Kn(n,new l(t)).next(function(n){var t=kl();return n instanceof it&&(t=t.Ae(n.key,n)),t})},pu.prototype.er=function(n,t,i){var e=this,f=t.collectionGroup,u=kl();return this.jn.ir(n,f).next(function(o){return r.forEach(o,function(r){var o=t.Zt(r.child(f));return e.sr(n,o,i).next(function(n){n.forEach(function(n,t){u=u.Ae(n,t)})})}).next(function(){return u})})},pu.prototype.sr=function(n,t,i){var r,u,f=this;return this.Qn.Zn(n,t,i).next(function(i){return r=i,f.Wn.nr(n,t)}).next(function(t){return u=t,f.rr(n,u,r).next(function(n){var t,i;for(r=n,t=0,i=u;t<i.length;t++)for(var o=i[t],f=0,s=o.mutations;f<s.length;f++){var h=s[f],e=h.key,c=r.get(e),l=h.ot(c,c,o.Tn);r=l instanceof it?r.Ae(e,l):r.remove(e)}})}).next(function(){return r.forEach(function(n,i){t.matches(i)||(r=r.remove(n))}),r})},pu.prototype.rr=function(n,t,i){for(var r,s,u,f,e=ft(),o=0,h=t;o<h.length;o++)for(r=0,s=h[o].mutations;r<s.length;r++)u=s[r],u instanceof ph&&null===i.get(u.key)&&(e=e.add(u.key));return f=i,this.Qn.getEntries(n,e).next(function(n){return n.forEach(function(n,t){null!==t&&t instanceof it&&(f=f.Ae(n,t))}),f})},pu),kat=(sg.ar=function(n,t){for(var i,r=ft(),u=ft(),f=0,e=t.docChanges;f<e.length;f++){i=e[f];switch(i.type){case 0:r=r.add(i.doc.key);break;case 1:u=u.add(i.doc.key)}}return new sg(n,t.fromCache,r,u)},sg),yu=(og.prototype.cr=function(n){return this.previousValue=Math.max(n,this.previousValue),this.previousValue},og.prototype.next=function(){var n=++this.previousValue;return this._r&&this._r(n),n},og);yu.dr=-1;var lg=(tc.prototype.reset=function(){this.Ar=0},tc.prototype.Vr=function(){this.Ar=this.Rr},tc.prototype.gr=function(n){var u=this;this.cancel();var i=Math.floor(this.Ar+this.pr()),r=Math.max(0,Date.now()-this.Pr),t=Math.max(0,i-r);0<t&&e("ExponentialBackoff","Backing off for "+t+" ms (base delay: "+this.Ar+" ms, delay with jitter: "+i+" ms, last attempt: "+r+" ms ago)");this.mr=this.Tr.yr(this.Er,t,function(){return u.Pr=Date.now(),n()});this.Ar*=this.wr;this.Ar<this.Ir&&(this.Ar=this.Ir);this.Ar>this.Rr&&(this.Ar=this.Rr)},tc.prototype.cancel=function(){null!==this.mr&&(this.mr.cancel(),this.mr=null)},tc.prototype.pr=function(){return(Math.random()-.5)*this.Ar},tc),dat=(uo.Cr=function(n,t,i,r,u){var f=new uo(n,t,Date.now()+i,r,u);return f.start(i),f},uo.prototype.start=function(n){var t=this;this.Fr=setTimeout(function(){return t.Nr()},n)},uo.prototype.kr=function(){return this.Nr()},uo.prototype.cancel=function(n){null!==this.Fr&&(this.clearTimeout(),this.Dr.reject(new i(t.CANCELLED,"Operation cancelled"+(n?": "+n:""))))},uo.prototype.Nr=function(){var n=this;this.br.$r(function(){return null!==n.Fr?(n.clearTimeout(),n.op().then(function(t){return n.Dr.resolve(t)})):Promise.resolve()})},uo.prototype.clearTimeout=function(){null!==this.Fr&&(this.Sr(this),clearTimeout(this.Fr),this.Fr=null)},uo),gat=(Object.defineProperty(bi.prototype,"Kr",{get:function(){return this.Or},enumerable:!0,configurable:!0}),bi.prototype.$r=function(n){this.enqueue(n)},bi.prototype.Gr=function(n){this.zr();this.Hr(n)},bi.prototype.Yr=function(n){return this.zr(),this.Hr(n)},bi.prototype.Jr=function(n){return f(this,void 0,void 0,function(){var t;return u(this,function(i){switch(i.label){case 0:return this.zr(),this.Or?[3,2]:(this.Or=!0,(t=vu.nt().window)&&t.removeEventListener("visibilitychange",this.Wr),[4,this.Yr(n)]);case 1:i.sent();i.label=2;case 2:return[2]}})})},bi.prototype.enqueue=function(n){return this.zr(),this.Or?new Promise(function(){}):this.Hr(n)},bi.prototype.Xr=function(n){var t=this;this.zr();this.Or||(this.Lr=this.Lr.then(function(){var i=new re,r=function(){return f(t,void 0,void 0,function(){var t;return u(this,function(u){switch(u.label){case 0:return u.trys.push([0,2,,3]),[4,n()];case 1:return u.sent(),i.resolve(),this.Qr.reset(),[3,3];case 2:if("IndexedDbTransactionError"!==(t=u.sent()).name)throw i.resolve(),t;return e("AsyncQueue","Operation failed with retryable error: "+t),this.Qr.gr(r),[3,3];case 3:return[2]}})})};return t.$r(r),i.promise}))},bi.prototype.Hr=function(n){var t=this,i=this.Mr.then(function(){return t.qr=!0,n().catch(function(n){throw t.Br=n,t.qr=!1,lt("INTERNAL UNHANDLED ERROR: ",n.stack||n.message||""),n;}).then(function(n){return t.qr=!1,n})});return this.Mr=i},bi.prototype.yr=function(n,t,i){var u=this,r;return this.zr(),-1<this.Ur.indexOf(n)&&(t=0),r=dat.Cr(this,n,t,i,function(n){return u.Zr(n)}),this.xr.push(r),r},bi.prototype.zr=function(){this.Br&&o()},bi.prototype.th=function(){},bi.prototype.eh=function(){return f(this,void 0,void 0,function(){var n;return u(this,function(t){switch(t.label){case 0:return[4,n=this.Mr];case 1:t.sent();t.label=2;case 2:if(n!==this.Mr)return[3,0];t.label=3;case 3:return[2]}})})},bi.prototype.sh=function(n){for(var t=0,i=this.xr;t<i.length;t++)if(i[t].Er===n)return!0;return!1},bi.prototype.jr=function(n){var t=this;return this.eh().then(function(){var i,r,u;for(t.xr.sort(function(n,t){return n.vr-t.vr}),i=0,r=t.xr;i<r.length;i++)if(u=r[i],u.kr(),"all"!==n&&u.Er===n)break;return t.eh()})},bi.prototype.ih=function(n){this.Ur.push(n)},bi.prototype.Zr=function(n){var t=this.xr.indexOf(n);this.xr.splice(t,1)},bi);var nvt=(up.prototype.hh=function(){return++this.rh},up.prototype.oh=function(n){var t=[n,this.hh()],i;this.buffer.size<this.nh?this.buffer=this.buffer.add(t):(i=this.buffer.last(),wet(t,i)<0&&(this.buffer=this.buffer.delete(i).add(t)))},Object.defineProperty(up.prototype,"maxValue",{get:function(){return this.buffer.last()[0]},enumerable:!0,configurable:!0}),up),bet={ah:!1,uh:0,_h:0,lh:0},ii=(na.Eh=function(n){return new na(n,na.Ih,na.wh)},na);ii.Rh=-1;ii.Ah=1048576;ii.mh=41943040;ii.Ih=10;ii.wh=1e3;ii.Ph=new ii(ii.mh,ii.Ih,ii.wh);ii.DISABLED=new ii(ii.Rh,0,0);ket=(ta.prototype.start=function(n){this.Vh.yh.dh!==ii.Rh&&this.bh(n)},ta.prototype.stop=function(){this.ph&&(this.ph.cancel(),this.ph=null)},Object.defineProperty(ta.prototype,"vh",{get:function(){return null!==this.ph},enumerable:!0,configurable:!0}),ta.prototype.bh=function(n){var i=this,t=this.gh?3e5:6e4;e("LruGarbageCollector","Garbage collection scheduled in "+t+"ms");this.ph=this.br.yr("lru_garbage_collection",t,function(){return f(i,void 0,void 0,function(){var t;return u(this,function(i){switch(i.label){case 0:this.ph=null;this.gh=!0;i.label=1;case 1:return i.trys.push([1,3,,7]),[4,n.Sh(this.Vh)];case 2:return i.sent(),[3,7];case 3:return"IndexedDbTransactionError"!==(t=i.sent()).name?[3,4]:(e("LruGarbageCollector","Ignoring IndexedDB error during garbage collection: ",t),[3,6]);case 4:return[4,ee(t)];case 5:i.sent();i.label=6;case 6:return[3,7];case 7:return[4,this.bh(n)];case 8:return i.sent(),[2]}})})})},ta);det=(fo.prototype.Ch=function(n,t){return this.Dh.Fh(n).next(function(n){return Math.floor(t/100*n)})},fo.prototype.Nh=function(n,t){var u=this,i;return 0===t?r.resolve(yu.dr):(i=new nvt(t),this.Dh.js(n,function(n){return i.oh(n.sequenceNumber)}).next(function(){return u.Dh.kh(n,function(n){return i.oh(n)})}).next(function(){return i.maxValue}))},fo.prototype.$h=function(n,t,i){return this.Dh.$h(n,t,i)},fo.prototype.Mh=function(n,t){return this.Dh.Mh(n,t)},fo.prototype.Lh=function(n,t){var i=this;return this.yh.dh===ii.Rh?(e("LruGarbageCollector","Garbage collection skipped; disabled"),r.resolve(bet)):this.Oh(n).next(function(r){return r<i.yh.dh?(e("LruGarbageCollector","Garbage collection skipped; Cache size "+r+" is lower than threshold "+i.yh.dh),bet):i.xh(n,t)})},fo.prototype.Oh=function(n){return this.Dh.Oh(n)},fo.prototype.xh=function(n,t){var f,u,o,s,h,c,l,i=this,a=Date.now();return this.Ch(n,this.yh.fh).next(function(t){return u=t>i.yh.Th?(e("LruGarbageCollector","Capping sequence numbers to collect down to the maximum of "+i.yh.Th+" from "+t),i.yh.Th):t,s=Date.now(),i.Nh(n,u)}).next(function(r){return f=r,h=Date.now(),i.$h(n,f,t)}).next(function(t){return o=t,c=Date.now(),i.Mh(n,f)}).next(function(n){return l=Date.now(),ip()<=d.DEBUG&&e("LruGarbageCollector","LRU Garbage Collection\n\tCounted targets in "+(s-a)+"ms\n\tDetermined least recently used "+u+" in "+(h-s)+"ms\n\tRemoved "+o+" targets in "+(c-h)+"ms\n\tRemoved "+n+" documents in "+(l-c)+"ms\nTotal Duration: "+(l-a)+"ms"),r.resolve({ah:!0,uh:u,_h:o,lh:n})})},fo);var not,ic=(rr.qh=function(n,u,f){return e("SimpleDb","Opening database:",n),new r(function(r,o){var s=window.indexedDB.open(n,u);s.onsuccess=function(n){var t=n.target.result;r(new rr(t))};s.onblocked=function(){o(new i(t.FAILED_PRECONDITION,"Cannot upgrade IndexedDB schema while another tab is open. Close all tabs that access Firestore and reload this page to proceed."))};s.onerror=function(n){var r=n.target.error;"VersionError"===r.name?o(new i(t.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.")):o(r)};s.onupgradeneeded=function(t){e("SimpleDb",'Database "'+n+'" requires upgrade from version:',t.oldVersion);var i=t.target.result;f.createOrUpgrade(i,s.transaction,t.oldVersion,sp).next(function(){e("SimpleDb","Database upgrade to version "+sp+" complete")})}}).yn()},rr.delete=function(n){return e("SimpleDb","Removing database:",n),ls(window.indexedDB.deleteDatabase(n)).yn()},rr.Uh=function(){if("undefined"==typeof window||null==window.indexedDB)return!1;if(rr.Qh())return!0;if(void 0===window.navigator)return!1;var n=ao(),t=rr.Bh(n),r=0<t&&t<10,i=rr.Wh(n),u=0<i&&i<4.5;return!(0<n.indexOf("MSIE ")||0<n.indexOf("Trident/")||0<n.indexOf("Edge/")||r||u)},rr.Qh=function(){var n;return"undefined"!=typeof __PRIVATE_process&&"YES"===(null===(n=__PRIVATE_process.__PRIVATE_env)||void 0===n?void 0:n.jh)},rr.Kh=function(n,t){return n.store(t)},rr.Bh=function(n){var t=n.match(/i(?:phone|pad|pod) os ([\d_]+)/i),i=t?t[1].split("_").slice(0,2).join("."):"-1";return Number(i)},rr.Wh=function(n){var t=n.match(/Android ([\d.]+)/i),i=t?t[1].split(".").slice(0,2).join("."):"-1";return Number(i)},rr.prototype.Gh=function(n){this.db.onversionchange=function(t){return n(t)}},rr.prototype.runTransaction=function(n,t,i){return f(this,void 0,void 0,function(){var o,f,s,h,c;return u(this,function(l){switch(l.label){case 0:o="readonly"===n;f=0;s=function(){var n,c,l,s,a;return u(this,function(u){switch(u.label){case 0:++f;n=iot.open(h.db,o?"readonly":"readwrite",t);u.label=1;case 1:return u.trys.push([1,3,,4]),c=i(n).catch(function(t){return n.abort(t),r.reject(t)}).yn(),l={},c.catch(function(){}),[4,n.zh];case 2:return[2,(l.value=(u.sent(),c),l)];case 3:return s=u.sent(),a="FirebaseError"!==s.name&&f<3,e("SimpleDb","Transaction failed with error: %s. Retrying: %s.",s.message,a),a?[3,4]:[2,{value:Promise.reject(s)}];case 4:return[2]}})};h=this;l.label=1;case 1:return[5,s()];case 2:if("object"==typeof(c=l.sent()))return[2,c.value];l.label=3;case 3:return[3,1];case 4:return[2]}})})},rr.prototype.close=function(){this.db.close()},rr),ivt=(Object.defineProperty(cs.prototype,"Pn",{get:function(){return this.Yh},enumerable:!0,configurable:!0}),Object.defineProperty(cs.prototype,"Xh",{get:function(){return this.Jh},enumerable:!0,configurable:!0}),Object.defineProperty(cs.prototype,"cursor",{set:function(n){this.Hh=n},enumerable:!0,configurable:!0}),cs.prototype.done=function(){this.Yh=!0},cs.prototype.Zh=function(n){this.Jh=n},cs.prototype.delete=function(){return ls(this.Hh.delete())},cs),tot=(k(rot,not=i),rot),iot=(rc.open=function(n,t,i){return new rc(n.transaction(i,t))},Object.defineProperty(rc.prototype,"zh",{get:function(){return this.to.promise},enumerable:!0,configurable:!0}),rc.prototype.abort=function(n){n&&this.to.reject(n);this.aborted||(e("SimpleDb","Aborting transaction:",n?n.message:"Client-initiated abort"),this.aborted=!0,this.transaction.abort())},rc.prototype.store=function(n){var t=this.transaction.objectStore(n);return new rvt(t)},rc),rvt=(nu.prototype.put=function(n,t){return ls(void 0!==t?(e("SimpleDb","PUT",this.store.name,n,t),this.store.put(t,n)):(e("SimpleDb","PUT",this.store.name,"<auto-key>",n),this.store.put(n)))},nu.prototype.add=function(n){return e("SimpleDb","ADD",this.store.name,n,n),ls(this.store.add(n))},nu.prototype.get=function(n){var t=this;return ls(this.store.get(n)).next(function(i){return void 0===i&&(i=null),e("SimpleDb","GET",t.store.name,n,i),i})},nu.prototype.delete=function(n){return e("SimpleDb","DELETE",this.store.name,n),ls(this.store.delete(n))},nu.prototype.count=function(){return e("SimpleDb","COUNT",this.store.name),ls(this.store.count())},nu.prototype.eo=function(n,t){var r=this.cursor(this.options(n,t)),i=[];return this.so(r,function(n,t){i.push(t)}).next(function(){return i})},nu.prototype.io=function(n,t){var i,r;return e("SimpleDb","DELETE ALL",this.store.name),i=this.options(n,t),i.no=!1,r=this.cursor(i),this.so(r,function(n,t,i){return i.delete()})},nu.prototype.ro=function(n,t){var i,r;return t?i=n:(i={},t=n),r=this.cursor(i),this.so(r,t)},nu.prototype.ho=function(n){var t=this.cursor({});return new r(function(i,r){t.onerror=function(n){var t=vg(n.target.error);r(t)};t.onsuccess=function(t){var r=t.target.result;r?n(r.primaryKey,r.value).next(function(n){n?r.continue():i()}):i()}})},nu.prototype.so=function(n,t){var i=[];return new r(function(u,f){n.onerror=function(n){f(n.target.error)};n.onsuccess=function(n){var f=n.target.result,e,o,s;f?(e=new ivt(f),o=t(f.primaryKey,f.value,e),o instanceof r&&(s=o.catch(function(n){return e.done(),r.reject(n)}),i.push(s)),e.Pn?u():null===e.Xh?f.continue():f.continue(e.Xh)):u()}}).next(function(){return r.vn(i)})},nu.prototype.options=function(n,t){var i=void 0;return void 0!==n&&("string"==typeof n?i=n:t=n),{index:i,range:t}},nu.prototype.cursor=function(n){var t="next",i;return(n.reverse&&(t="prev"),n.index)?(i=this.store.index(n.index),n.no?i.openKeyCursor(n.range,t):i.openCursor(n.range,t)):this.store.openCursor(n.range,t)},nu);ag=!1;uot=(pt.uo=function(n,t,i,r){return c(""!==n.uid),new pt(n.t()?n.uid:"",t,i,r)},pt.prototype.co=function(n){var t=!0,i=IDBKeyRange.bound([this.userId,Number.NEGATIVE_INFINITY],[this.userId,Number.POSITIVE_INFINITY]);return eo(n).ro({index:et.userMutationsIndex,range:i},function(n,i,r){t=!1;r.done()}).next(function(){return t})},pt.prototype._o=function(n,t,i){return this.lo(n).next(function(t){return t.lastStreamToken=i.toBase64(),fp(n).put(t)})},pt.prototype.do=function(n){return this.lo(n).next(function(n){return gt.fromBase64String(n.lastStreamToken)})},pt.prototype.fo=function(n,t){return this.lo(n).next(function(i){return i.lastStreamToken=t.toBase64(),fp(n).put(i)})},pt.prototype.To=function(n,t,i,u){var f=this,o=uc(n),e=eo(n);return e.add({}).next(function(s){var y,b;c("number"==typeof s);for(var l=new eg(s,t,i,u),k=f.serializer.Eo(f.userId,l),h=[],a=new ei(function(n,t){return p(n.j(),t.j())}),v=0,w=u;v<w.length;v++)y=w[v],b=ki.key(f.userId,y.key.path,s),a=a.add(y.key.path.M()),h.push(e.put(k)),h.push(o.put(b,ki.PLACEHOLDER));return a.forEach(function(t){h.push(f.jn.Io(n,t))}),n.qn(function(){f.ao[s]=l.keys()}),r.vn(h).next(function(){return l})})},pt.prototype.wo=function(n,t){var i=this;return eo(n).get(t).next(function(n){return n?(c(n.userId===i.userId),i.serializer.Ro(n)):null})},pt.prototype.Ao=function(n,t){var i=this;return this.ao[t]?r.resolve(this.ao[t]):this.wo(n,t).next(function(n){if(n){var r=n.keys();return i.ao[t]=r}return null})},pt.prototype.mo=function(n,t){var i=this,r=t+1,f=IDBKeyRange.lowerBound([this.userId,r]),u=null;return eo(n).ro({index:et.userMutationsIndex,range:f},function(n,t,f){t.userId===i.userId&&(c(t.batchId>=r),u=i.serializer.Ro(t));f.done()}).next(function(){return u})},pt.prototype.Po=function(n){var i=IDBKeyRange.upperBound([this.userId,Number.POSITIVE_INFINITY]),t=-1;return eo(n).ro({index:et.userMutationsIndex,range:i,reverse:!0},function(n,i,r){t=i.batchId;r.done()}).next(function(){return t})},pt.prototype.Vo=function(n){var t=this,i=IDBKeyRange.bound([this.userId,-1],[this.userId,Number.POSITIVE_INFINITY]);return eo(n).eo(et.userMutationsIndex,i).next(function(n){return n.map(function(n){return t.serializer.Ro(n)})})},pt.prototype.Gn=function(n,t){var i=this,u=ki.prefixForPath(this.userId,t.path),f=IDBKeyRange.lowerBound(u),r=[];return uc(n).ro({range:f},function(u,f,e){var s=u[0],h=u[1],l=u[2],a=ue(h);if(s===i.userId&&t.path.isEqual(a))return eo(n).get(l).next(function(n){if(!n)throw o();c(n.userId===i.userId);r.push(i.serializer.Ro(n))});e.done()}).next(function(){return r})},pt.prototype.Xn=function(n,t){var i=this,u=new ei(p),f=[];return t.forEach(function(t){var r=ki.prefixForPath(i.userId,t.path),e=IDBKeyRange.lowerBound(r),o=uc(n).ro({range:e},function(n,r,f){var e=n[0],o=n[1],s=n[2],h=ue(o);e===i.userId&&t.path.isEqual(h)?u=u.add(s):f.done()});f.push(o)}),r.vn(f).next(function(){return i.po(n,u)})},pt.prototype.nr=function(n,t){var u=this,i=t.path,f=i.length+1,e=ki.prefixForPath(this.userId,i),o=IDBKeyRange.lowerBound(e),r=new ei(p);return uc(n).ro({range:o},function(n,t,e){var s=n[0],h=n[1],c=n[2],o=ue(h);s===u.userId&&i.q(o)?o.length===f&&(r=r.add(c)):e.done()}).next(function(){return u.po(n,r)})},pt.prototype.po=function(n,t){var i=this,u=[],f=[];return t.forEach(function(t){f.push(eo(n).get(t).next(function(n){if(null===n)throw o();c(n.userId===i.userId);u.push(i.serializer.Ro(n))}))}),r.vn(f).next(function(){return u})},pt.prototype.yo=function(n,t){var i=this;return eot(n.bo,this.userId,t).next(function(u){return n.qn(function(){i.vo(t.batchId)}),r.forEach(u,function(t){return i.oo.So(n,t)})})},pt.prototype.vo=function(n){delete this.ao[n]},pt.prototype.Do=function(n){var t=this;return this.co(n).next(function(i){if(!i)return r.resolve();var f=IDBKeyRange.lowerBound(ki.prefixForUser(t.userId)),u=[];return uc(n).ro({range:f},function(n,i,r){if(n[0]===t.userId){var f=ue(n[1]);u.push(f)}else r.done()}).next(function(){c(0===u.length)})})},pt.prototype.Co=function(n,t){return fot(n,this.userId,t)},pt.prototype.lo=function(n){var t=this;return fp(n).get(this.userId).next(function(n){return n||new fe(t.userId,-1,"")})},pt);ia=(fc.prototype.next=function(){return this.Fo+=2,this.Fo},fc.No=function(){return new fc(0)},fc.ko=function(){return new fc(-1)},fc);oot=(wt.prototype.$o=function(n){var t=this;return this.Mo(n).next(function(i){var r=new ia(i.highestTargetId);return i.highestTargetId=r.next(),t.Lo(n,i).next(function(){return i.highestTargetId})})},wt.prototype.Oo=function(n){return this.Mo(n).next(function(n){return g.v(new ar(n.lastRemoteSnapshotVersion.seconds,n.lastRemoteSnapshotVersion.nanoseconds))})},wt.prototype.xo=function(n){return yg(n.bo)},wt.prototype.Bo=function(n,t,i){var r=this;return this.Mo(n).next(function(u){return u.highestListenSequenceNumber=t,i&&(u.lastRemoteSnapshotVersion=i.C()),t>u.highestListenSequenceNumber&&(u.highestListenSequenceNumber=t),r.Lo(n,u)})},wt.prototype.qo=function(n,t){var i=this;return this.Uo(n,t).next(function(){return i.Mo(n).next(function(r){return r.targetCount+=1,i.Qo(t,r),i.Lo(n,r)})})},wt.prototype.Wo=function(n,t){return this.Uo(n,t)},wt.prototype.jo=function(n,t){var i=this;return this.Ko(n,t.targetId).next(function(){return ec(n).delete(t.targetId)}).next(function(){return i.Mo(n)}).next(function(t){return c(0<t.targetCount),--t.targetCount,i.Lo(n,t)})},wt.prototype.$h=function(n,t,i){var u=this,f=0,e=[];return ec(n).ro(function(r,o){var s=u.serializer.Go(o);s.sequenceNumber<=t&&null===i.get(s.targetId)&&(f++,e.push(u.jo(n,s)))}).next(function(){return r.vn(e)}).next(function(){return f})},wt.prototype.js=function(n,t){var i=this;return ec(n).ro(function(n,r){var u=i.serializer.Go(r);t(u)})},wt.prototype.Mo=function(n){return sot(n.bo)},wt.prototype.Lo=function(n,t){return sr.Kh(n,yr.store).put(yr.key,t)},wt.prototype.Uo=function(n,t){return ec(n).put(this.serializer.zo(t))},wt.prototype.Qo=function(n,t){var i=!1;return n.targetId>t.highestTargetId&&(t.highestTargetId=n.targetId,i=!0),n.sequenceNumber>t.highestListenSequenceNumber&&(t.highestListenSequenceNumber=n.sequenceNumber,i=!0),i},wt.prototype.Ho=function(n){return this.Mo(n).next(function(n){return n.targetCount})},wt.prototype.Yo=function(n,t){var u=this,i=t.canonicalId(),f=IDBKeyRange.bound([i,Number.NEGATIVE_INFINITY],[i,Number.POSITIVE_INFINITY]),r=null;return ec(n).ro({range:f,index:or.queryTargetsIndexName},function(n,i,f){var e=u.serializer.Go(i);t.isEqual(e.target)&&(r=e,f.done())}).next(function(){return r})},wt.prototype.Jo=function(n,t,i){var f=this,u=[],e=oo(n);return t.forEach(function(t){var r=wu(t.path);u.push(e.put(new ai(i,r)));u.push(f.oo.Xo(n,i,t))}),r.vn(u)},wt.prototype.Zo=function(n,t,i){var u=this,f=oo(n);return r.forEach(t,function(t){var e=wu(t.path);return r.vn([f.delete([i,e]),u.oo.ta(n,i,t)])})},wt.prototype.Ko=function(n,t){var i=oo(n),r=IDBKeyRange.bound([t],[t+1],!1,!0);return i.delete(r)},wt.prototype.ea=function(n,t){var r=IDBKeyRange.bound([t],[t+1],!1,!0),u=oo(n),i=ft();return u.ro({range:r,no:!0},function(n){var t=ue(n[1]),r=new l(t);i=i.add(r)}).next(function(){return i})},wt.prototype.Co=function(n,t){var i=wu(t.path),u=IDBKeyRange.bound([i],[cet(i)],!1,!0),r=0;return oo(n).ro({index:ai.documentTargetsIndex,no:!0,range:u},function(n,t,i){var u=n[0];n[1];0!==u&&(r++,i.done())}).next(function(){return 0<r})},wt.prototype.si=function(n,t){var i=this;return ec(n).get(t).next(function(n){return n?i.serializer.Go(n):null})},wt);pg=(li.prototype.Nn=function(n,t,i){return so(n).put(ep(t),i)},li.prototype.$n=function(n,t){var i=so(n),r=ep(t);return i.delete(r)},li.prototype.updateMetadata=function(n,t){var i=this;return this.getMetadata(n).next(function(r){return r.byteSize+=t,i.sa(n,r)})},li.prototype.Mn=function(n,t){var i=this;return so(n).get(ep(t)).next(function(n){return i.ia(n)})},li.prototype.na=function(n,t){var i=this;return so(n).get(ep(t)).next(function(n){var t=i.ia(n);return t?{ra:t,size:op(n)}:null})},li.prototype.getEntries=function(n,t){var r=this,i=dy();return this.ha(n,t,function(n,t){var u=r.ia(t);i=i.Ae(n,u)}).next(function(){return i})},li.prototype.oa=function(n,t){var u=this,i=dy(),r=new ir(l.N);return this.ha(n,t,function(n,t){var f=u.ia(t);r=f?(i=i.Ae(n,f),r.Ae(n,op(t))):(i=i.Ae(n,null),r.Ae(n,0))}).next(function(){return{aa:i,ua:r}})},li.prototype.ha=function(n,t,i){if(t.B())return r.resolve();var e=IDBKeyRange.bound(t.first().path.W(),t.last().path.W()),f=t.be(),u=f.Ne();return so(n).ro({range:e},function(n,t,r){for(var e=l.st(n);u&&l.N(u,e)<0;)i(u,null),u=f.Ne();u&&u.isEqual(e)&&(i(u,t),u=f.ke()?f.Ne():null);u?r.Zh(u.path.W()):r.done()}).next(function(){for(;u;)i(u,null),u=f.ke()?f.Ne():null})},li.prototype.Zn=function(n,t,i){var s=this,u=kl(),h=t.path.length+1,r={},f,e,o;return i.isEqual(g.min())?(f=t.path.W(),r.range=IDBKeyRange.lowerBound(f)):(e=t.path.W(),o=this.serializer.ca(i),r.range=IDBKeyRange.lowerBound([e,o],!0),r.index=vt.collectionReadTimeIndex),so(n).ro(r,function(n,i,r){if(n.length===h){var f=s.serializer._a(i);t.path.q(f.key.path)?f instanceof it&&t.matches(f)&&(u=u.Ae(f.key,f)):r.done()}}).next(function(){return u})},li.prototype.la=function(n,t){var u=this,i=es(),r=this.serializer.ca(t),f=so(n),e=IDBKeyRange.lowerBound(r,!0);return f.ro({index:vt.readTimeIndex,range:e},function(n,t){var f=u.serializer._a(t);i=i.Ae(f.key,f);r=t.readTime}).next(function(){return{da:i,readTime:u.serializer.fa(r)}})},li.prototype.Ta=function(n){var i=this,r=so(n),t=g.min();return r.ro({index:vt.readTimeIndex,reverse:!0},function(n,r,u){r.readTime&&(t=i.serializer.fa(r.readTime));u.done()}).next(function(){return t})},li.prototype.Ea=function(n){return new li.Ia(this,!!n&&n.wa)},li.prototype.Ra=function(n){return this.getMetadata(n).next(function(n){return n.byteSize})},li.prototype.getMetadata=function(n){return cot(n).get(bu.key).next(function(n){return c(!!n),n})},li.prototype.sa=function(n,t){return cot(n).put(bu.key,t)},li.prototype.ia=function(n){if(n){var t=this.serializer._a(n);return t instanceof hi&&t.version.isEqual(g.min())?null:t}return null},li);pg.Ia=(k(ra,hot=aet),ra.prototype.xn=function(n){var t=this,i=[],u=0,f=new ei(function(n,t){return p(n.j(),t.j())});return this.Dn.forEach(function(r,e){var s=t.ma.get(r),o,h,c;e?(o=t.Aa.serializer.Pa(e,t.readTime),f=f.add(r.path.M()),h=op(o),u+=h-s,i.push(t.Aa.Nn(n,r,o))):(u-=s,t.wa)?(c=t.Aa.serializer.Pa(new hi(r,g.min()),t.readTime),i.push(t.Aa.Nn(n,r,c))):i.push(t.Aa.$n(n,r))}),f.forEach(function(r){i.push(t.Aa.jn.Io(n,r))}),i.push(this.Aa.updateMetadata(n,u)),r.vn(i)},ra.prototype.Ln=function(n,t){var i=this;return this.Aa.na(n,t).next(function(n){return null===n?(i.ma.set(t,0),null):(i.ma.set(t,n.size),n.ra)})},ra.prototype.On=function(n,t){var i=this;return this.Aa.oa(n,t).next(function(n){var t=n.aa;return n.ua.forEach(function(n,t){i.ma.set(n,t)}),t})},ra);var fvt=(bg.prototype.Io=function(n,t){return this.Va.add(t),r.resolve()},bg.prototype.ir=function(n,t){return r.resolve(this.Va.getEntries(t))},bg),wg=(hp.prototype.add=function(n){var t=n.O(),i=n.M(),r=this.index[t]||new ei(ot.N),u=!r.has(i);return this.index[t]=r.add(i),u},hp.prototype.has=function(n){var i=n.O(),r=n.M(),t=this.index[i];return t&&t.has(r)},hp.prototype.getEntries=function(n){return(this.index[n]||new ei(ot.N)).W()},hp),sp=10,evt=(as.prototype.createOrUpgrade=function(n,t,i,u){var o=this,s,e,h,f;return c(i<u&&0<=i&&u<=sp),e=new iot(t),i<1&&1<=u&&(n.createObjectStore(tu.store),(s=n).createObjectStore(fe.store,{keyPath:fe.keyPath}),s.createObjectStore(et.store,{keyPath:et.keyPath,autoIncrement:!0}).createIndex(et.userMutationsIndex,et.userMutationsKeyPath,{unique:!0}),s.createObjectStore(ki.store),lot(n),n.createObjectStore(vt.store)),f=r.resolve(),i<3&&3<=u&&(0!==i&&((h=n).deleteObjectStore(ai.store),h.deleteObjectStore(or.store),h.deleteObjectStore(yr.store),lot(n)),f=f.next(function(){return n=e.store(yr.store),t=new yr(0,0,g.min().C(),0),n.put(yr.key,t);var n,t})),i<4&&4<=u&&(0!==i&&(f=f.next(function(){return t=n,(i=e).store(et.store).eo().next(function(n){t.deleteObjectStore(et.store);t.createObjectStore(et.store,{keyPath:et.keyPath,autoIncrement:!0}).createIndex(et.userMutationsIndex,et.userMutationsKeyPath,{unique:!0});var u=i.store(et.store),f=n.map(function(n){return u.put(n)});return r.vn(f)});var t,i})),f=f.next(function(){n.createObjectStore(ku.store,{keyPath:ku.keyPath})})),i<5&&5<=u&&(f=f.next(function(){return o.removeAcknowledgedMutations(e)})),i<6&&6<=u&&(f=f.next(function(){return n.createObjectStore(bu.store),o.addDocumentGlobal(e)})),i<7&&7<=u&&(f=f.next(function(){return o.ensureSequenceNumbers(e)})),i<8&&8<=u&&(f=f.next(function(){return o.createCollectionParentIndex(n,e)})),i<9&&9<=u&&(f=f.next(function(){var i,r;(r=n).objectStoreNames.contains("remoteDocumentChanges")&&r.deleteObjectStore("remoteDocumentChanges");(i=t.objectStore(vt.store)).createIndex(vt.readTimeIndex,vt.readTimeIndexPath,{unique:!1});i.createIndex(vt.collectionReadTimeIndex,vt.collectionReadTimeIndexPath,{unique:!1})})),i<10&&10<=u&&(f=f.next(function(){return o.rewriteCanonicalIds(e)})),f},as.prototype.addDocumentGlobal=function(n){var t=0;return n.store(vt.store).ro(function(n,i){t+=op(i)}).next(function(){var i=new bu(t);return n.store(bu.store).put(bu.key,i)})},as.prototype.removeAcknowledgedMutations=function(n){var t=this,i=n.store(fe.store),u=n.store(et.store);return i.eo().next(function(i){return r.forEach(i,function(i){var f=IDBKeyRange.bound([i.userId,-1],[i.userId,i.lastAcknowledgedBatchId]);return u.eo(et.userMutationsIndex,f).next(function(u){return r.forEach(u,function(r){c(r.userId===i.userId);var u=t.serializer.Ro(r);return eot(n,i.userId,u).next(function(){})})})})})},as.prototype.ensureSequenceNumbers=function(n){var t=n.store(ai.store),i=n.store(vt.store);return yg(n).next(function(n){var u=[];return i.ro(function(i){var f=new ot(i),e=[0,wu(f)];u.push(t.get(e).next(function(i){return i?r.resolve():(u=f,t.put(new ai(0,wu(u),n)));var u}))}).next(function(){return r.vn(u)})})},as.prototype.createCollectionParentIndex=function(n,t){function i(n){if(u.add(n)){var t=n.O(),i=n.M();return r.put({collectionId:t,parent:wu(i)})}}n.createObjectStore(ho.store,{keyPath:ho.keyPath});var r=t.store(ho.store),u=new wg;return t.store(vt.store).ro({no:!0},function(n){var t=new ot(n);return i(t.M())}).next(function(){return t.store(ki.store).ro({no:!0},function(n){n[0];var t=n[1],r=(n[2],ue(t));return i(r.M())})})},as.prototype.rewriteCanonicalIds=function(n){var t=this,i=n.store(or.store);return i.ro(function(n,r){var u=t.serializer.Go(r),f=t.serializer.zo(u);return i.put(f)})},as),tu=function(n,t,i){this.ownerId=n;this.allowTabSynchronization=t;this.leaseTimestampMs=i};tu.store="owner";tu.key="owner";fe=function(n,t,i){this.userId=n;this.lastAcknowledgedBatchId=t;this.lastStreamToken=i};fe.store="mutationQueues";fe.keyPath="userId";et=function(n,t,i,r,u){this.userId=n;this.batchId=t;this.localWriteTimeMs=i;this.baseMutations=r;this.mutations=u};et.store="mutations";et.keyPath="batchId";et.userMutationsIndex="userMutationsIndex";et.userMutationsKeyPath=["userId","batchId"];ki=(cp.prefixForUser=function(n){return[n]},cp.prefixForPath=function(n,t){return[n,wu(t)]},cp.key=function(n,t,i){return[n,wu(t),i]},cp);ki.store="documentMutations";ki.PLACEHOLDER=new ki;vt=function(n,t,i,r,u,f){this.unknownDocument=n;this.noDocument=t;this.document=i;this.hasCommittedMutations=r;this.readTime=u;this.parentPath=f};vt.store="remoteDocuments";vt.readTimeIndex="readTimeIndex";vt.readTimeIndexPath="readTime";vt.collectionReadTimeIndex="collectionReadTimeIndex";vt.collectionReadTimeIndexPath=["parentPath","readTime"];bu=function(n){this.byteSize=n};bu.store="remoteDocumentGlobal";bu.key="remoteDocumentGlobalKey";or=function(n,t,i,r,u,f,e){this.targetId=n;this.canonicalId=t;this.readTime=i;this.resumeToken=r;this.lastListenSequenceNumber=u;this.lastLimboFreeSnapshotVersion=f;this.query=e};or.store="targets";or.keyPath="targetId";or.queryTargetsIndexName="queryTargetsIndex";or.queryTargetsKeyPath=["canonicalId","targetId"];ai=function(n,t,i){this.targetId=n;this.path=t;this.sequenceNumber=i};ai.store="targetDocuments";ai.keyPath=["targetId","path"];ai.documentTargetsIndex="documentTargetsIndex";ai.documentTargetsKeyPath=["path","targetId"];yr=function(n,t,i,r){this.highestTargetId=n;this.highestListenSequenceNumber=t;this.lastRemoteSnapshotVersion=i;this.targetCount=r};yr.key="targetGlobalKey";yr.store="targetGlobal";ho=function(n,t){this.collectionId=n;this.parent=t};ho.store="collectionParents";ho.keyPath=["collectionId","parent"];ku=function(n,t,i,r){this.clientId=n;this.updateTimeMs=t;this.networkEnabled=i;this.inForeground=r};ku.store="clientMetadata";ku.keyPath="clientId";kg=ih(ih(ih([fe.store,et.store,ki.store,vt.store,or.store,tu.store,yr.store,ai.store],[ku.store]),[bu.store]),[ho.store]);aot=(dg.prototype.Io=function(n,t){var e=this,i,u,f;return this.ga.has(t)?r.resolve():(i=t.O(),u=t.M(),n.qn(function(){e.ga.add(t)}),f={collectionId:i,parent:wu(u)},vot(n).put(f))},dg.prototype.ir=function(n,t){var i=[],r=IDBKeyRange.bound([t,""],[cet(t),""],!1,!0);return vot(n).eo(r).next(function(n){for(var f,r=0,u=n;r<u.length;r++){if(f=u[r],f.collectionId!==t)break;i.push(ue(f.parent))}return i})},dg);var yot,hvt=(du.prototype._a=function(n){var t,i,r,u;return n.document?this.pa.mi(n.document,!!n.hasCommittedMutations):n.noDocument?(t=l.st(n.noDocument.path),i=this.ya(n.noDocument.readTime),new hi(t,i,{hasCommittedMutations:!!n.hasCommittedMutations})):n.unknownDocument?(r=l.st(n.unknownDocument.path),u=this.ya(n.unknownDocument.version),new yy(r,u)):o()},du.prototype.Pa=function(n,t){var i=this.ca(t),r=n.key.path.M().W(),u,f,e,s;if(n instanceof it)return u=this.pa.Ai(n),f=n.hasCommittedMutations,new vt(null,null,u,f,i,r);if(n instanceof hi){var h=n.key.path.W(),c=this.ba(n.version),l=n.hasCommittedMutations;return new vt(null,new ovt(h,c),null,l,i,r)}return n instanceof yy?(e=n.key.path.W(),s=this.ba(n.version),new vt(new svt(e,s),null,null,!0,i,r)):o()},du.prototype.ca=function(n){var t=n.C();return[t.seconds,t.nanoseconds]},du.prototype.fa=function(n){var t=new ar(n[0],n[1]);return g.v(t)},du.prototype.ba=function(n){var t=n.C();return new uvt(t.seconds,t.nanoseconds)},du.prototype.ya=function(n){var t=new ar(n.seconds,n.nanoseconds);return g.v(t)},du.prototype.Eo=function(n,t){var i=this,r=t.baseMutations.map(function(n){return i.pa.vi(n)}),u=t.mutations.map(function(n){return i.pa.vi(n)});return new et(n,t.batchId,t.Tn.toMillis(),r,u)},du.prototype.Ro=function(n){var t=this,i=(n.baseMutations||[]).map(function(n){return t.pa.Fi(n)}),r=n.mutations.map(function(n){return t.pa.Fi(n)}),u=ar.fromMillis(n.localWriteTimeMs);return new eg(n.batchId,u,i,r)},du.prototype.Go=function(n){var t,i=this.ya(n.readTime),r=void 0!==n.lastLimboFreeSnapshotVersion?this.ya(n.lastLimboFreeSnapshotVersion):g.min();return t=void 0!==n.query.documents?this.pa.xi(n.query):this.pa.Wi(n.query),new py(t,n.targetId,0,n.lastListenSequenceNumber,i,r,gt.fromBase64String(n.resumeToken))},du.prototype.zo=function(n){var t,r=this.ba(n.Ee),u=this.ba(n.lastLimboFreeSnapshotVersion),i;return t=n.target.Ot()?this.pa.Oi(n.target):this.pa.Bi(n.target),i=n.resumeToken.toBase64(),new or(n.targetId,n.target.canonicalId(),r,i,n.sequenceNumber,u,t)},du),pot="Another tab has exclusive access to the persistence layer. To allow shared access, make sure to invoke `enablePersistence()` with `synchronizeTabs:true` in all tabs.",wot=(k(bot,yot=yet),bot),sr=(v.Kh=function(n,t){if(n instanceof wot)return ic.Kh(n.bo,t);throw o();},v.prototype.start=function(){var n=this;return ic.qh(this.Ma,sp,new evt(this.serializer)).then(function(t){return n.Ba=t,n.qa()}).then(function(){return n.Ua(),n.Qa(),n.Wa(),n.Ba.runTransaction("readonly",[yr.store],function(n){return yg(n)})}).then(function(t){n.ja=new yu(t,n.Sa)}).then(function(){n.Da=!0}).catch(function(t){return n.Ba&&n.Ba.close(),Promise.reject(t)})},v.prototype.Ka=function(n){var t=this;return this.$a=function(i){return f(t,void 0,void 0,function(){return u(this,function(){return this.vh?[2,n(i)]:[2]})})},n(this.isPrimary)},v.prototype.Ga=function(n){var t=this;this.Ba.Gh(function(i){return f(t,void 0,void 0,function(){return u(this,function(t){switch(t.label){case 0:return null===i.newVersion?[4,n()]:[3,2];case 1:t.sent();t.label=2;case 2:return[2]}})})})},v.prototype.za=function(n){var t=this;this.networkEnabled!==n&&(this.networkEnabled=n,this.Tr.$r(function(){return f(t,void 0,void 0,function(){return u(this,function(n){switch(n.label){case 0:return this.vh?[4,this.qa()]:[3,2];case 1:n.sent();n.label=2;case 2:return[2]}})})}))},v.prototype.qa=function(){var n=this;return this.Ba.runTransaction("readwrite",kg,function(t){return lp(t).put(new ku(n.clientId,Date.now(),n.networkEnabled,n.inForeground)).next(function(){if(n.isPrimary)return n.Ha(t).next(function(t){t||(n.isPrimary=!1,n.Tr.$r(function(){return n.$a(!1)}))})}).next(function(){return n.Ya(t)}).next(function(i){return n.isPrimary&&!i?n.Ja(t).next(function(){return!1}):!!i&&n.Xa(t).next(function(){return!0})})}).catch(function(t){if(!n.allowTabSynchronization)throw t;return e("IndexedDbPersistence","Releasing owner lease after error during lease refresh",t),!1}).then(function(t){n.isPrimary!==t&&n.Tr.$r(function(){return n.$a(t)});n.isPrimary=t})},v.prototype.Ha=function(n){var t=this;return ua(n).get(tu.key).next(function(n){return r.resolve(t.Za(n))})},v.prototype.tu=function(n){return lp(n).delete(this.clientId)},v.prototype.eu=function(){return f(this,void 0,void 0,function(){var n=this;return u(this,function(t){switch(t.label){case 0:return!this.isPrimary||this.su(this.ka,18e5)?[3,2]:(this.ka=Date.now(),[4,this.runTransaction("maybeGarbageCollectMultiClientState","readwrite-primary",function(t){var i=v.Kh(t,ku.store);return i.eo().next(function(t){var f=n.iu(t,18e5),u=t.filter(function(n){return-1===f.indexOf(n)});return r.forEach(u,function(n){return i.delete(n.clientId)}).next(function(){return u})})}).catch(function(){return[]})]);case 1:t.sent().forEach(function(t){n.window.localStorage.removeItem(n.nu(t.clientId))});t.label=2;case 2:return[2]}})})},v.prototype.Wa=function(){var n=this;this.Na=this.Tr.yr("client_metadata_refresh",4e3,function(){return n.qa().then(function(){return n.eu()}).then(function(){return n.Wa()})})},v.prototype.Za=function(n){return!!n&&n.ownerId===this.clientId},v.prototype.Ya=function(n){var r=this;return ua(n).get(tu.key).next(function(u){if(null!==u&&r.su(u.leaseTimestampMs,5e3)&&!r.ru(u.ownerId)){if(r.Za(u)&&r.networkEnabled)return!0;if(!r.Za(u)){if(!u.allowTabSynchronization)throw new i(t.FAILED_PRECONDITION,pot);return!1}}return!(!r.networkEnabled||!r.inForeground)||lp(n).eo().next(function(n){return void 0===r.iu(n,5e3).find(function(n){if(r.clientId!==n.clientId){var t=!r.networkEnabled&&n.networkEnabled,i=!r.inForeground&&n.inForeground,u=r.networkEnabled===n.networkEnabled;if(t||i&&u)return!0}return!1})})}).next(function(n){return r.isPrimary!==n&&e("IndexedDbPersistence","Client "+(n?"is":"is not")+" eligible for a primary lease."),n})},v.prototype.hu=function(){return f(this,void 0,void 0,function(){var n=this;return u(this,function(t){switch(t.label){case 0:return this.Da=!1,this.ou(),this.Na&&(this.Na.cancel(),this.Na=null),this.au(),this.uu(),[4,this.Ba.runTransaction("readwrite",[tu.store,ku.store],function(t){return n.Ja(t).next(function(){return n.tu(t)})})];case 1:return t.sent(),this.Ba.close(),this.cu(),[2]}})})},v.prototype.iu=function(n,t){var i=this;return n.filter(function(n){return i.su(n.updateTimeMs,t)&&!i.ru(n.clientId)})},v.prototype._u=function(){var n=this;return this.Ba.runTransaction("readonly",[ku.store],function(t){return lp(t).eo().next(function(t){return n.iu(t,18e5).map(function(n){return n.clientId})})})},v.clearPersistence=function(n){return f(this,void 0,void 0,function(){var t;return u(this,function(i){switch(i.label){case 0:return v.Uh()?(t=n+v.La,[4,ic.delete(t)]):[2,Promise.resolve()];case 1:return i.sent(),[2]}})})},Object.defineProperty(v.prototype,"vh",{get:function(){return this.Da},enumerable:!0,configurable:!0}),v.prototype.lu=function(n){return uot.uo(n,this.serializer,this.jn,this.oo)},v.prototype.du=function(){return this.Oa},v.prototype.fu=function(){return this.Qn},v.prototype.Tu=function(){return this.jn},v.prototype.runTransaction=function(n,r,u){var f=this,o,s;return e("IndexedDbPersistence","Starting transaction:",n),s="readonly"===r?"readonly":"readwrite",this.Ba.runTransaction(s,kg,function(e){return o=new wot(e,f.ja.next()),"readwrite-primary"===r?f.Ha(e).next(function(n){return!!n||f.Ya(e)}).next(function(r){if(!r)throw lt("Failed to obtain primary lease for action '"+n+"'."),f.isPrimary=!1,f.Tr.$r(function(){return f.$a(!1)}),new i(t.FAILED_PRECONDITION,vet);return u(o)}).next(function(n){return f.Xa(e).next(function(){return n})}):f.Eu(e).next(function(){return u(o)})}).then(function(n){return o.Un(),n})},v.prototype.Eu=function(n){var r=this;return ua(n).get(tu.key).next(function(n){if(null!==n&&r.su(n.leaseTimestampMs,5e3)&&!r.ru(n.ownerId)&&!r.Za(n)&&!n.allowTabSynchronization)throw new i(t.FAILED_PRECONDITION,pot);})},v.prototype.Xa=function(n){var t=new tu(this.clientId,this.allowTabSynchronization,Date.now());return ua(n).put(tu.key,t)},v.Uh=function(){return ic.Uh()},v.Iu=function(n){var t=n.ii.projectId;return n.ii.ln||(t+="."+n.ii.database),"firestore/"+n.persistenceKey+"/"+t+"/"},v.prototype.Ja=function(n){var i=this,t=ua(n);return t.get(tu.key).next(function(n){return i.Za(n)?(e("IndexedDbPersistence","Releasing primary lease."),t.delete(tu.key)):r.resolve()})},v.prototype.su=function(n,t){var i=Date.now();return!(n<i-t||i<n&&(lt("Detected an update time that is in the future: "+n+" > "+i),1))},v.prototype.Ua=function(){var n=this;null!==this.document&&"function"==typeof this.document.addEventListener&&(this.Fa=function(){n.Tr.$r(function(){return n.inForeground="visible"===n.document.visibilityState,n.qa()})},this.document.addEventListener("visibilitychange",this.Fa),this.inForeground="visible"===this.document.visibilityState)},v.prototype.au=function(){this.Fa&&(this.document.removeEventListener("visibilitychange",this.Fa),this.Fa=null)},v.prototype.Qa=function(){var n=this;"function"==typeof this.window.addEventListener&&(this.Ca=function(){n.ou();n.Tr.$r(function(){return n.hu()})},this.window.addEventListener("unload",this.Ca))},v.prototype.uu=function(){this.Ca&&(this.window.removeEventListener("unload",this.Ca),this.Ca=null)},v.prototype.ru=function(n){try{var t=null!==this.xa.getItem(this.nu(n));return e("IndexedDbPersistence","Client '"+n+"' "+(t?"is":"is not")+" zombied in LocalStorage"),t}catch(n){return lt("IndexedDbPersistence","Failed to get zombied client id.",n),!1}},v.prototype.ou=function(){try{this.xa.setItem(this.nu(this.clientId),String(Date.now()))}catch(n){lt("Failed to set zombie client id.",n)}},v.prototype.cu=function(){try{this.xa.removeItem(this.nu(this.clientId))}catch(n){}},v.prototype.nu=function(n){return"firestore_zombie_"+this.persistenceKey+"_"+n},v);sr.La="main";kot=(hr.prototype.Fh=function(n){var t=this.wu(n);return this.db.du().Ho(n).next(function(n){return t.next(function(t){return n+t})})},hr.prototype.wu=function(n){var t=0;return this.kh(n,function(){t++}).next(function(){return t})},hr.prototype.js=function(n,t){return this.db.du().js(n,t)},hr.prototype.kh=function(n,t){return this.Ru(n,function(n,i){return t(i)})},hr.prototype.Xo=function(n,t,i){return ap(n,i)},hr.prototype.ta=function(n,t,i){return ap(n,i)},hr.prototype.$h=function(n,t,i){return this.db.du().$h(n,t,i)},hr.prototype.So=function(n,t){return ap(n,t)},hr.prototype.Au=function(n,t){return f=t,i=!1,fp(u=n).ho(function(n){return fot(u,n,f).next(function(n){return n&&(i=!0),r.resolve(!n)})}).next(function(){return i});var u,f,i},hr.prototype.Mh=function(n,t){var e=this,i=this.db.fu().Ea(),u=[],f=0;return this.Ru(n,function(r,o){if(o<=t){var s=e.Au(n,r).next(function(t){if(!t)return f++,i.Mn(n,r).next(function(){return i.$n(r),oo(n).delete([0,wu(r.path)])})});u.push(s)}}).next(function(){return r.vn(u)}).next(function(){return i.apply(n)}).next(function(){return f})},hr.prototype.removeTarget=function(n,t){var i=t.Ie(n.va);return this.db.du().Wo(n,i)},hr.prototype.mu=function(n,t){return ap(n,t)},hr.prototype.Ru=function(n,t){var r,u=oo(n),i=yu.dr;return u.ro({index:ai.documentTargetsIndex},function(n,u){var f=n[0],e=(n[1],u.path),o=u.sequenceNumber;0===f?(i!==yu.dr&&t(new l(ue(r)),i),i=o,r=e):i=yu.dr}).next(function(){i!==yu.dr&&t(new l(ue(r)),i)})},hr.prototype.Oh=function(n){return this.db.fu().Ra(n)},hr);vp=(bt.prototype.start=function(){return Promise.resolve()},bt.prototype.Su=function(n){return f(this,void 0,void 0,function(){var t,i,f,r=this;return u(this,function(u){switch(u.label){case 0:return t=this.Wn,i=this.bu,[4,this.persistence.runTransaction("Handle user change","readonly",function(u){var f;return r.Wn.Vo(u).next(function(e){return f=e,t=r.persistence.lu(n),i=new pet(r.yu,t,r.persistence.Tu()),t.Vo(u)}).next(function(n){for(var h,r,c,b,e,l,a,o,v,k,y=[],p=[],t=ft(),s=0,w=f;s<w.length;s++)for(h=w[s],y.push(h.batchId),r=0,c=h.mutations;r<c.length;r++)b=c[r],t=t.add(b.key);for(e=0,l=n;e<l.length;e++)for(a=l[e],p.push(a.batchId),o=0,v=a.mutations;o<v.length;o++)k=v[o],t=t.add(k.key);return i.Yn(u,t).next(function(n){return{Du:n,Cu:y,Fu:p}})})})];case 1:return f=u.sent(),[2,(this.Wn=t,this.bu=i,this.Pu.vu(this.bu),f)]}})})},bt.prototype.Nu=function(n){var t,i=this,r=ar.now(),u=n.reduce(function(n,t){return n.add(t.key)},ft());return this.persistence.runTransaction("Locally write mutations","readwrite",function(f){return i.bu.Yn(f,u).next(function(u){var e,o;t=u;for(var h=[],s=0,c=n;s<c.length;s++)e=c[s],o=e.Pt(t.get(e.key)),null!=o&&h.push(new ph(e.key,o,uft(o.proto.mapValue),tr.exists(!0)));return i.Wn.To(f,r,h,n)})}).then(function(n){var i=n.In(t);return{batchId:n.batchId,Dn:i}})},bt.prototype._o=function(n){var t=this;return this.persistence.runTransaction("Acknowledge batch","readwrite-primary",function(i){var u=n.batch.keys(),r=t.yu.Ea({wa:!0});return t.Wn._o(i,n.batch,n.streamToken).next(function(){return t.ku(i,n,r)}).next(function(){return r.apply(i)}).next(function(){return t.Wn.Do(i)}).next(function(){return t.bu.Yn(i,u)})})},bt.prototype.$u=function(n){var t=this;return this.persistence.runTransaction("Reject batch","readwrite-primary",function(i){var r;return t.Wn.wo(i,n).next(function(n){return c(null!==n),r=n.keys(),t.Wn.yo(i,n)}).next(function(){return t.Wn.Do(i)}).next(function(){return t.bu.Yn(i,r)})})},bt.prototype.Po=function(){var n=this;return this.persistence.runTransaction("Get highest unacknowledged batch id","readonly",function(t){return n.Wn.Po(t)})},bt.prototype.do=function(){var n=this;return this.persistence.runTransaction("Get last stream token","readonly",function(t){return n.Wn.do(t)})},bt.prototype.fo=function(n){var t=this;return this.persistence.runTransaction("Set last stream token","readwrite-primary",function(i){return t.Wn.fo(i,n)})},bt.prototype.Oo=function(){var n=this;return this.persistence.runTransaction("Get last remote snapshot version","readonly",function(t){return n.Oa.Oo(t)})},bt.prototype.Mu=function(n){var t=this,i=n.Ee,u=this.Vu;return this.persistence.runTransaction("Apply remote event","readwrite-primary",function(f){var h=t.yu.Ea({wa:!0}),o,s,c,l;return u=t.Vu,o=[],n.as.forEach(function(n,r){var s=u.get(r),h,e;s&&(o.push(t.Oa.Zo(f,n.Is,r).next(function(){return t.Oa.Jo(f,n.Ts,r)})),h=n.resumeToken,0<h.rt()&&(e=s.we(h,i).Ie(f.va),u=u.Ae(r,e),bt.Lu(s,e,n)&&o.push(t.Oa.Wo(f,e))))}),s=es(),c=ft(),(n.cs.forEach(function(n){c=c.add(n)}),o.push(h.getEntries(f,c).next(function(r){n.cs.forEach(function(u,c){var l=r.get(u);c instanceof hi&&c.version.isEqual(g.min())?(h.$n(u,i),s=s.Ae(u,c)):null==l||0<c.version.S(l.version)||0===c.version.S(l.version)&&l.hasPendingWrites?(h.Nn(c,i),s=s.Ae(u,c)):e("LocalStore","Ignoring outdated watch update for ",u,". Current version:",l.version," Watch version:",c.version);n._s.has(u)&&o.push(t.persistence.oo.mu(f,u))})})),i.isEqual(g.min()))||(l=t.Oa.Oo(f).next(function(){return t.Oa.Bo(f,f.va,i)}),o.push(l)),r.vn(o).next(function(){return h.apply(f)}).next(function(){return t.bu.Jn(f,s)})}).then(function(n){return t.Vu=u,n})},bt.Lu=function(n,t,i){return c(0<t.resumeToken.rt()),0===n.resumeToken.rt()||t.Ee.D()-n.Ee.D()>=this.Ou||0<i.Ts.size+i.Es.size+i.Is.size},bt.prototype.xu=function(n){var t=this;return this.persistence.runTransaction("notifyLocalViewChanges","readwrite",function(i){return r.forEach(n,function(n){return r.forEach(n.hr,function(r){return t.persistence.oo.Xo(i,n.targetId,r)}).next(function(){return r.forEach(n.or,function(r){return t.persistence.oo.ta(i,n.targetId,r)})})})}).then(function(){for(var u,f,i=0,r=n;i<r.length;i++)if(u=r[i],f=u.targetId,!u.fromCache){var e=t.Vu.get(f),o=e.Ee,s=e.Re(o);t.Vu=t.Vu.Ae(f,s)}})},bt.prototype.Bu=function(n){var t=this;return this.persistence.runTransaction("Get next mutation batch","readonly",function(i){return void 0===n&&(n=-1),t.Wn.mo(i,n)})},bt.prototype.qu=function(n){var t=this;return this.persistence.runTransaction("read document","readonly",function(i){return t.bu.Kn(i,n)})},bt.prototype.Uu=function(n){var t=this;return this.persistence.runTransaction("Allocate target","readwrite",function(i){var u;return t.Oa.Yo(i,n).next(function(f){return f?(u=f,r.resolve(u)):t.Oa.$o(i).next(function(r){return u=new py(n,r,0,i.va),t.Oa.qo(i,u).next(function(){return u})})})}).then(function(i){return null===t.Vu.get(i.targetId)&&(t.Vu=t.Vu.Ae(i.targetId,i),t.gu.set(n,i.targetId)),i})},bt.prototype.Yo=function(n,t){var i=this.gu.get(t);return void 0!==i?r.resolve(this.Vu.get(i)):this.Oa.Yo(n,t)},bt.prototype.Qu=function(n,t){var i=this,u=this.Vu.get(n),f=t?"readwrite":"readwrite-primary";return this.persistence.runTransaction("Release target",f,function(n){return t?r.resolve():i.persistence.oo.removeTarget(n,u)}).then(function(){i.Vu=i.Vu.remove(n);i.gu.delete(u.target)})},bt.prototype.Wu=function(n,t){var i=this,u=g.min(),r=ft();return this.persistence.runTransaction("Execute query","readonly",function(f){return i.Yo(f,n.ee()).next(function(n){if(n)return u=n.lastLimboFreeSnapshotVersion,i.Oa.ea(f,n.targetId).next(function(n){r=n})}).next(function(){return i.Pu.Zn(f,n,t?u:g.min(),t?r:ft())}).next(function(n){return{documents:n,ju:r}})})},bt.prototype.ku=function(n,t,i){var e=this,u=t.batch,o=u.keys(),f=r.resolve();return o.forEach(function(r){f=f.next(function(){return i.Mn(n,r)}).next(function(n){var f=n,e=t.Rn.get(r);c(null!==e);(!f||f.version.S(e)<0)&&(f=u.at(r,f,t))&&i.Nn(f,t.wn)})}),f.next(function(){return e.Wn.yo(n,u)})},bt.prototype.Sh=function(n){var t=this;return this.persistence.runTransaction("Collect garbage","readwrite-primary",function(i){return n.Lh(i,t.Vu)})},bt);vp.Ou=3e8;got=(k(cf,dot=vp),cf.prototype.start=function(){return this.Ku()},cf.prototype.Gu=function(n){var t=this;return this.persistence.runTransaction("Lookup mutation documents","readonly",function(i){return t.Wn.Ao(i,n).next(function(n){return n?t.bu.Yn(i,n):r.resolve(null)})})},cf.prototype.zu=function(n){this.Wn.vo(n)},cf.prototype.za=function(n){this.persistence.za(n)},cf.prototype._u=function(){return this.persistence._u()},cf.prototype.Hu=function(n){var i=this,t=this.Vu.get(n);return t?Promise.resolve(t.target):this.persistence.runTransaction("Get target data","readonly",function(t){return i.Oa.si(t,n).next(function(n){return n?n.target:null})})},cf.prototype.la=function(){var n=this;return this.persistence.runTransaction("Get new document changes","readonly",function(t){return n.yu.la(t,n.pu)}).then(function(t){var i=t.da,r=t.readTime;return n.pu=r,i})},cf.prototype.Ku=function(){return f(this,void 0,void 0,function(){var n,t=this;return u(this,function(i){switch(i.label){case 0:return[4,(n=this).persistence.runTransaction("Synchronize last document change read time","readonly",function(n){return t.yu.Ta(n)})];case 1:return n.pu=i.sent(),[2]}})})},cf);yp=(gu.prototype.B=function(){return this.Yu.B()},gu.prototype.Xo=function(n,t){var i=new oi(n,t);this.Yu=this.Yu.add(i);this.Xu=this.Xu.add(i)},gu.prototype.tc=function(n,t){var i=this;n.forEach(function(n){return i.Xo(n,t)})},gu.prototype.ta=function(n,t){this.ec(new oi(n,t))},gu.prototype.sc=function(n,t){var i=this;n.forEach(function(n){return i.ta(n,t)})},gu.prototype.ic=function(n){var r=this,t=l.EMPTY,u=new oi(t,n),f=new oi(t,n+1),i=[];return this.Xu.Ke([u,f],function(n){r.ec(n);i.push(n.key)}),i},gu.prototype.nc=function(){var n=this;this.Yu.forEach(function(t){return n.ec(t)})},gu.prototype.ec=function(n){this.Yu=this.Yu.delete(n);this.Xu=this.Xu.delete(n)},gu.prototype.rc=function(n){var i=l.EMPTY,r=new oi(i,n),u=new oi(i,n+1),t=ft();return this.Xu.Ke([r,u],function(n){t=t.add(n.key)}),t},gu.prototype.Co=function(n){var i=new oi(n,0),t=this.Yu.ze(i);return null!==t&&n.isEqual(t.key)},gu);oi=(gg.Ju=function(n,t){return l.N(n.key,t.key)||p(n.hc,t.hc)},gg.Zu=function(n,t){return p(n.hc,t.hc)||l.N(n.key,t.key)},gg);ea=(he.fromBase64String=function(n){ht("Blob.fromBase64String",arguments,1);kt("Blob.fromBase64String","string",1,n);nn();try{return new he(gt.fromBase64String(n))}catch(n){throw new i(t.INVALID_ARGUMENT,"Failed to construct Blob from Base64 string: "+n);}},he.fromUint8Array=function(n){if(ht("Blob.fromUint8Array",arguments,1),ost(),!(n instanceof Uint8Array))throw ys("Blob.fromUint8Array","Uint8Array",1,n);return new he(gt.fromUint8Array(n))},he.prototype.toBase64=function(){return ht("Blob.toBase64",arguments,0),nn(),this.ac.toBase64()},he.prototype.toUint8Array=function(){return ht("Blob.toUint8Array",arguments,0),ost(),this.ac.toUint8Array()},he.prototype.toString=function(){return"Blob(base64: "+this.toBase64()+")"},he.prototype.isEqual=function(n){return this.ac.isEqual(n.ac)},he);su=(oa.documentId=function(){return oa.cc},oa.prototype.isEqual=function(n){if(!(n instanceof oa))throw ys("isEqual","FieldPath",1,n);return this.uc.isEqual(n.uc)},oa);su.cc=new su(vr.J().j());var sst,hst,cst,lst,ast,cvt=new RegExp("[~\\*/\\[\\]]"),ps=function(n){this._c=n},tn=(k(ca,ast=ps),ca.prototype.Di=function(n){if(2!==n.lc)throw 1===n.lc?n.dc("FieldValue.delete() can only appear at the top level of your update data"):n.dc("FieldValue.delete() cannot be used with set() unless you pass {merge:true}");return n.Vt.push(n.path),null},ca.prototype.isEqual=function(n){return n instanceof ca},ca),lvt=(k(ha,lst=ps),ha.prototype.Di=function(n){return new ll(n.path,ah.instance)},ha.prototype.isEqual=function(n){return n instanceof ha},ha),avt=(k(kp,cst=ps),kp.prototype.Di=function(n){var t=new la({lc:3,methodName:this._c,Tc:!0},n.ii,n.serializer),i=this.fc.map(function(n){return co(n,t)}),r=new rd(i);return new ll(n.path,r)},kp.prototype.isEqual=function(n){return this===n},kp),vvt=(k(bp,hst=ps),bp.prototype.Di=function(n){var t=new la({lc:3,methodName:this._c,Tc:!0},n.ii,n.serializer),i=this.fc.map(function(n){return co(n,t)}),r=new ud(i);return new ll(n.path,r)},bp.prototype.isEqual=function(n){return this===n},bp),yvt=(k(wp,sst=ps),wp.prototype.Di=function(n){var t=new la({lc:3,methodName:this._c},n.ii,n.serializer),i=co(this.Ec,t),r=new fd(n.serializer,i);return new ll(n.path,r)},wp.prototype.isEqual=function(n){return this===n},wp),pp=(Object.defineProperty(sa.prototype,"latitude",{get:function(){return this.Ic},enumerable:!0,configurable:!0}),Object.defineProperty(sa.prototype,"longitude",{get:function(){return this.wc},enumerable:!0,configurable:!0}),sa.prototype.isEqual=function(n){return this.Ic===n.Ic&&this.wc===n.wc},sa.prototype.p=function(n){return p(this.Ic,n.Ic)||p(this.wc,n.wc)},sa),pvt=/^__.*__$/,vst=(wst.prototype.Rc=function(n,t){var i=[];return null!==this.Vt?i.push(new ph(n,this.data,this.Vt,t)):i.push(new ed(n,this.data,t)),0<this.fieldTransforms.length&&i.push(new vy(n,this.fieldTransforms)),i},wst),yst=(pst.prototype.Rc=function(n,t){var i=[new ph(n,this.data,this.Vt,t)];return 0<this.fieldTransforms.length&&i.push(new vy(n,this.fieldTransforms)),i},pst);la=(Object.defineProperty(hu.prototype,"path",{get:function(){return this.settings.path},enumerable:!0,configurable:!0}),Object.defineProperty(hu.prototype,"lc",{get:function(){return this.settings.lc},enumerable:!0,configurable:!0}),hu.prototype.mc=function(n){return new hu(Object.assign(Object.assign({},this.settings),n),this.ii,this.serializer,this.fieldTransforms,this.Vt)},hu.prototype.Pc=function(n){var t,r=null===(t=this.path)||void 0===t?void 0:t.child(n),i=this.mc({path:r,Tc:!1});return i.Vc(n),i},hu.prototype.gc=function(n){var t,r=null===(t=this.path)||void 0===t?void 0:t.child(n),i=this.mc({path:r,Tc:!1});return i.Ac(),i},hu.prototype.pc=function(){return this.mc({path:void 0,Tc:!0})},hu.prototype.dc=function(n){var r=!this.path||this.path.B()?"":" (found in field "+this.path.toString()+")";return new i(t.INVALID_ARGUMENT,"Function "+this.settings.methodName+"() called with invalid data. "+n+r)},hu.prototype.contains=function(n){return void 0!==this.Vt.find(function(t){return n.q(t)})||void 0!==this.fieldTransforms.find(function(t){return n.q(t.field)})},hu.prototype.Ac=function(){if(this.path)for(var n=0;n<this.path.length;n++)this.Vc(this.path.get(n))},hu.prototype.Vc=function(n){if(0===n.length)throw this.dc("Document fields must not be empty");if(bst(this.lc)&&pvt.test(n))throw this.dc('Document fields cannot begin and end with "__"');},hu);kst=(ws.prototype.bc=function(n,t){var i=this.vc(0,n),r;return dp("Data must be an object, but it was:",i,t),r=rn(t,i),new vst(new gf(r),null,i.fieldTransforms)},ws.prototype.Sc=function(n,r,u){var e=this.vc(2,n),h,c,v,s,f;if(dp("Data must be an object, but it was:",e,r),v=rn(r,e),u){for(var l=[],a=0,y=u;a<y.length;a++){if(s=y[a],f=void 0,s instanceof su)f=s.uc;else{if("string"!=typeof s)throw o();f=un(n,s)}if(!e.contains(f))throw new i(t.INVALID_ARGUMENT,"Field '"+f+"' is specified in your field mask but missing from your input data.");gst(l,f)||l.push(f)}h=new yh(l);c=e.fieldTransforms.filter(function(n){return h.dt(n.field)})}else h=new yh(e.Vt),c=e.fieldTransforms;return new vst(new gf(v),h,c)},ws.prototype.Dc=function(n,t){var r=this.vc(1,n),i,u,f;return dp("Data must be an object, but it was:",r,t),i=[],u=new vl,ch(t,function(t,f){var e=un(n,t),s=r.gc(e),o;f instanceof tn?i.push(e):(o=co(f,s),null!=o&&(i.push(e),u.set(e,o)))}),f=new yh(i),new yst(u.yt(),f,r.fieldTransforms)},ws.prototype.Cc=function(n,r,u,f){var a=this.vc(1,n),s=[aa(n,r)],v=[u],e,l,w;if(f.length%2!=0)throw new i(t.INVALID_ARGUMENT,"Function "+n+"() needs to be called with an even number of arguments that alternate between field names and values.");for(e=0;e<f.length;e+=2)s.push(aa(n,f[e])),v.push(f[e+1]);for(var h=[],y=new vl,o=s.length-1;0<=o;--o)if(!gst(h,s[o])){var c=s[o],p=v[o],b=a.gc(c);p instanceof tn?h.push(c):(l=co(p,b),null!=l&&(h.push(c),y.set(c,l)))}return w=new yh(h),new yst(y.yt(),w,a.fieldTransforms)},ws.prototype.vc=function(n,t){return new la({lc:n,methodName:t,path:vr.G,Tc:!1},this.ii,this.serializer)},ws.prototype.Fc=function(n,t,i){return void 0===i&&(i=!1),co(t,this.vc(i?4:3,n))},ws);var nht,fn,tht,iht=(di.prototype.Bc=function(){return 1===this.state||2===this.state||4===this.state},di.prototype.qc=function(){return 2===this.state},di.prototype.start=function(){3!==this.state?this.auth():this.Uc()},di.prototype.stop=function(){return f(this,void 0,void 0,function(){return u(this,function(n){switch(n.label){case 0:return this.Bc()?[4,this.close(0)]:[3,2];case 1:n.sent();n.label=2;case 2:return[2]}})})},di.prototype.Qc=function(){this.state=0;this.Qr.reset()},di.prototype.Wc=function(){var n=this;this.qc()&&null===this.xc&&(this.xc=this.Tr.yr(this.$c,6e4,function(){return n.jc()}))},di.prototype.Kc=function(n){this.Gc();this.stream.send(n)},di.prototype.jc=function(){return f(this,void 0,void 0,function(){return u(this,function(){return this.qc()?[2,this.close(0)]:[2]})})},di.prototype.Gc=function(){this.xc&&(this.xc.cancel(),this.xc=null)},di.prototype.close=function(n,i){return f(this,void 0,void 0,function(){return u(this,function(r){switch(r.label){case 0:return this.Gc(),this.Qr.cancel(),this.Oc++,3!==n?this.Qr.reset():i&&i.code===t.RESOURCE_EXHAUSTED?(lt(i.toString()),lt("Using maximum backoff delay to prevent overloading the backend."),this.Qr.Vr()):i&&i.code===t.UNAUTHENTICATED&&this.Lc._(),null!==this.stream&&(this.zc(),this.stream.close(),this.stream=null),this.state=n,[4,this.listener.Hc(i)];case 1:return r.sent(),[2]}})})},di.prototype.zc=function(){},di.prototype.auth=function(){var n=this,r,u;this.state=1;r=this.Yc(this.Oc);u=this.Oc;this.Lc.getToken().then(function(t){n.Oc===u&&n.Jc(t)},function(u){r(function(){var r=new i(t.UNKNOWN,"Fetching auth token failed: "+u.message);return n.Xc(r)})})},di.prototype.Jc=function(n){var t=this,i=this.Yc(this.Oc);this.stream=this.Zc(n);this.stream.t_(function(){i(function(){return t.state=2,t.listener.t_()})});this.stream.Hc(function(n){i(function(){return t.Xc(n)})});this.stream.onMessage(function(n){i(function(){return t.onMessage(n)})})},di.prototype.Uc=function(){var n=this;this.state=4;this.Qr.gr(function(){return f(n,void 0,void 0,function(){return u(this,function(){return this.state=0,this.start(),[2]})})})},di.prototype.Xc=function(n){return e("PersistentStream","close with error: "+n),this.stream=null,this.close(3,n)},di.prototype.Yc=function(n){var t=this;return function(i){t.Tr.$r(function(){return t.Oc===n?i():(e("PersistentStream","stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve())})}},di),wvt=(k(hc,tht=iht),hc.prototype.Zc=function(n){return this.Mc.e_("Listen",n)},hc.prototype.onMessage=function(n){this.Qr.reset();var t=this.serializer.pi(n),i=this.serializer.bi(n);return this.listener.s_(t,i)},hc.prototype.i_=function(n){var t={},i;t.database=this.serializer.wi;t.addTarget=this.serializer.ee(n);i=this.serializer.zi(n);i&&(t.labels=i);this.Kc(t)},hc.prototype.n_=function(n){var t={};t.database=this.serializer.wi;t.removeTarget=n;this.Kc(t)},hc),bvt=(k(ce,fn=iht),Object.defineProperty(ce.prototype,"h_",{get:function(){return this.r_},enumerable:!0,configurable:!0}),ce.prototype.start=function(){this.r_=!1;fn.prototype.start.call(this)},ce.prototype.zc=function(){this.r_&&this.o_([])},ce.prototype.Zc=function(n){return this.Mc.e_("Write",n)},ce.prototype.onMessage=function(n){if(c(!!n.streamToken),this.lastStreamToken=this.serializer.ci(n.streamToken),this.r_){this.Qr.reset();var t=this.serializer.Li(n.writeResults,n.commitTime),i=this.serializer.fromVersion(n.commitTime);return this.listener.a_(i,t)}return c(!n.writeResults||0===n.writeResults.length),this.r_=!0,this.listener.u_()},ce.prototype.c_=function(){var n={};n.database=this.serializer.wi;this.Kc(n)},ce.prototype.o_=function(n){var t=this,i={streamToken:this.serializer.ui(this.lastStreamToken),writes:n.map(function(n){return t.serializer.vi(n)})};this.Kc(i)},ce),kvt=(k(gp,nht=function(){this.__=void 0}),gp.prototype.l_=function(n,i){var r=this;return this.credentials.getToken().then(function(t){return r.Mc.l_(n,i,t)}).catch(function(n){throw n.code===t.UNAUTHENTICATED&&r.credentials._(),n;})},gp.prototype.d_=function(n,i){var r=this;return this.credentials.getToken().then(function(t){return r.Mc.d_(n,i,t)}).catch(function(n){throw n.code===t.UNAUTHENTICATED&&r.credentials._(),n;})},gp),dvt=(nf.prototype.R_=function(n){return f(this,void 0,void 0,function(){var r,e=this;return u(this,function(s){switch(s.label){case 0:if(this.A_(),0<this.mutations.length)throw new i(t.INVALID_ARGUMENT,"Firestore transactions require all reads to be executed before all writes.");return[4,function(n,t){return f(this,void 0,void 0,function(){var i,e,o,r,f;return u(this,function(u){switch(u.label){case 0:return i=rp(n),e={database:i.serializer.wi,documents:t.map(function(n){return i.serializer.fi(n)})},[4,i.d_("BatchGetDocuments",e)];case 1:return o=u.sent(),r=new Map,o.forEach(function(n){var t=i.serializer.gi(n);r.set(t.key.toString(),t)}),f=[],[2,(t.forEach(function(n){var t=r.get(n.toString());c(!!t);f.push(t)}),f)]}})})}(this.f_,n)];case 1:return[2,((r=s.sent()).forEach(function(n){n instanceof hi||n instanceof it?e.m_(n):o()}),r)]}})})},nf.prototype.set=function(n,t){this.write(t.Rc(n,this.Rt(n)));this.w_.add(n)},nf.prototype.update=function(n,t){try{this.write(t.Rc(n,this.P_(n)))}catch(n){this.I_=n}this.w_.add(n)},nf.prototype.delete=function(n){this.write([new al(n,this.Rt(n))]);this.w_.add(n)},nf.prototype.commit=function(){return f(this,void 0,void 0,function(){var n,t=this;return u(this,function(i){switch(i.label){case 0:if(this.A_(),this.I_)throw this.I_;return n=this.T_,this.mutations.forEach(function(t){n=n.remove(t.key)}),n.forEach(function(n){t.mutations.push(new od(n,t.Rt(n)))}),[4,function(n,t){return f(this,void 0,void 0,function(){var i,f,r;return u(this,function(u){switch(u.label){case 0:return i=rp(n),f={database:i.serializer.wi,writes:t.map(function(n){return i.serializer.vi(n)})},[4,i.l_("Commit",f)];case 1:return r=u.sent(),[2,i.serializer.Li(r.writeResults,r.commitTime)]}})})}(this.f_,this.mutations)];case 1:return i.sent(),this.E_=!0,[2]}})})},nf.prototype.m_=function(n){var r,u;if(n instanceof it)r=n.version;else{if(!(n instanceof hi))throw o();r=g.min()}if(u=this.T_.get(n.key),null!==u){if(!r.isEqual(u))throw new i(t.ABORTED,"Document version changed between two reads.");}else this.T_=this.T_.Ae(n.key,r)},nf.prototype.Rt=function(n){var t=this.T_.get(n);return!this.w_.has(n)&&t?tr.updateTime(t):tr.ft()},nf.prototype.P_=function(n){var r=this.T_.get(n);if(this.w_.has(n)||!r)return tr.exists(!0);if(r.isEqual(g.min()))throw new i(t.INVALID_ARGUMENT,"Can't update a document that doesn't exist.");return tr.updateTime(r)},nf.prototype.write=function(n){this.A_();this.mutations=this.mutations.concat(n)},nf.prototype.A_=function(){},nf),gvt=(bs.prototype.b_=function(){var n=this;0===this.g_&&(this.v_("Unknown"),this.p_=this.br.yr("online_state_timeout",1e4,function(){return n.p_=null,n.S_("Backend didn't respond within 10 seconds."),n.v_("Offline"),Promise.resolve()}))},bs.prototype.D_=function(n){"Online"===this.state?this.v_("Unknown"):(this.g_++,1<=this.g_&&(this.C_(),this.S_("Connection failed 1 times. Most recent error: "+n.toString()),this.v_("Offline")))},bs.prototype.set=function(n){this.C_();this.g_=0;"Online"===n&&(this.y_=!1);this.v_(n)},bs.prototype.v_=function(n){n!==this.state&&(this.state=n,this.V_(n))},bs.prototype.S_=function(n){var t="Could not reach Cloud Firestore backend. "+n+"\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.y_?(lt(t),this.y_=!1):e("OnlineStateTracker",t)},bs.prototype.C_=function(){null!==this.p_&&(this.p_.cancel(),this.p_=null)},bs),nyt=(y.prototype.start=function(){return this.enableNetwork()},y.prototype.enableNetwork=function(){return this.networkEnabled=!0,this.J_()},y.prototype.J_=function(){return f(this,void 0,void 0,function(){var n;return u(this,function(t){switch(t.label){case 0:return this.B_()?(n=this.G_,[4,this.F_.do()]):[3,3];case 1:return n.lastStreamToken=t.sent(),this.X_()?this.Z_():this.U_.set("Unknown"),[4,this.tl()];case 2:t.sent();t.label=3;case 3:return[2]}})})},y.prototype.disableNetwork=function(){return f(this,void 0,void 0,function(){return u(this,function(n){switch(n.label){case 0:return this.networkEnabled=!1,[4,this.el()];case 1:return n.sent(),this.U_.set("Offline"),[2]}})})},y.prototype.el=function(){return f(this,void 0,void 0,function(){return u(this,function(n){switch(n.label){case 0:return[4,this.G_.stop()];case 1:return n.sent(),[4,this.Q_.stop()];case 2:return n.sent(),0<this.N_.length&&(e("RemoteStore","Stopping write stream with "+this.N_.length+" pending writes"),this.N_=[]),this.sl(),[2]}})})},y.prototype.hu=function(){return f(this,void 0,void 0,function(){return u(this,function(n){switch(n.label){case 0:return e("RemoteStore","RemoteStore shutting down."),this.networkEnabled=!1,[4,this.el()];case 1:return n.sent(),this.O_.hu(),this.U_.set("Unknown"),[2]}})})},y.prototype.listen=function(n){this.k_.has(n.targetId)||(this.k_.set(n.targetId,n),this.X_()?this.Z_():this.Q_.qc()&&this.il(n))},y.prototype.nl=function(n){this.k_.delete(n);this.Q_.qc()&&this.rl(n);0===this.k_.size&&(this.Q_.qc()?this.Q_.Wc():this.B_()&&this.U_.set("Unknown"))},y.prototype.si=function(n){return this.k_.get(n)||null},y.prototype.ei=function(n){return this.hl.ei(n)},y.prototype.il=function(n){this.M_.Ns(n.targetId);this.Q_.i_(n)},y.prototype.rl=function(n){this.M_.Ns(n);this.Q_.n_(n)},y.prototype.Z_=function(){this.M_=new aat(this);this.Q_.start();this.U_.b_()},y.prototype.X_=function(){return this.B_()&&!this.Q_.Bc()&&0<this.k_.size},y.prototype.B_=function(){return!this.L_&&this.isPrimary&&this.networkEnabled},y.prototype.sl=function(){this.M_=null},y.prototype.W_=function(){return f(this,void 0,void 0,function(){var n=this;return u(this,function(){return this.k_.forEach(function(t){n.il(t)}),[2]})})},y.prototype.j_=function(n){return f(this,void 0,void 0,function(){return u(this,function(){return this.sl(),this.X_()?(this.U_.D_(n),this.Z_()):this.U_.set("Unknown"),[2]})})},y.prototype.K_=function(n,t){return f(this,void 0,void 0,function(){var i,r,f;return u(this,function(u){switch(u.label){case 0:if(this.U_.set("Online"),!(n instanceof tet&&2===n.state&&n.cause))return[3,6];u.label=1;case 1:return u.trys.push([1,3,,5]),[4,this.ol(n)];case 2:return u.sent(),[3,5];case 3:return i=u.sent(),e("RemoteStore","Failed to remove targets %s: %s ",n.targetIds.join(","),i),[4,this.al(i)];case 4:return u.sent(),[3,5];case 5:return[3,13];case 6:if(n instanceof np?this.M_.qs(n):n instanceof net?this.M_.Hs(n):this.M_.Ws(n),t.isEqual(g.min()))return[3,13];u.label=7;case 7:return u.trys.push([7,11,,13]),[4,this.F_.Oo()];case 8:return r=u.sent(),0<=t.S(r)?[4,this.ul(t)]:[3,10];case 9:u.sent();u.label=10;case 10:return[3,13];case 11:return e("RemoteStore","Failed to raise snapshot:",f=u.sent()),[4,this.al(f)];case 12:return u.sent(),[3,13];case 13:return[2]}})})},y.prototype.al=function(n){return f(this,void 0,void 0,function(){var t=this;return u(this,function(i){switch(i.label){case 0:if("IndexedDbTransactionError"!==n.name)throw n;return this.L_=!0,[4,this.el()];case 1:return i.sent(),this.U_.set("Offline"),this.br.Xr(function(){return f(t,void 0,void 0,function(){return u(this,function(n){switch(n.label){case 0:return e("RemoteStore","Retrying IndexedDB access"),[4,this.F_.Oo()];case 1:return n.sent(),this.L_=!1,[4,this.J_()];case 2:return n.sent(),[2]}})})}),[2]}})})},y.prototype.ul=function(n){var t=this,i=this.M_.Xs(n);return i.as.forEach(function(i,r){if(0<i.resumeToken.rt()){var u=t.k_.get(r);u&&t.k_.set(r,u.we(i.resumeToken,n))}}),i.us.forEach(function(n){var i=t.k_.get(n),r;i&&(t.k_.set(n,i.we(gt.ht,i.Ee)),t.rl(n),r=new py(i.target,n,1,i.sequenceNumber),t.il(r))}),this.hl.Mu(i)},y.prototype.ol=function(n){return f(this,void 0,void 0,function(){var f,i,r,t;return u(this,function(u){switch(u.label){case 0:f=n.cause;i=0;r=n.targetIds;u.label=1;case 1:return i<r.length?(t=r[i],this.k_.has(t)?[4,this.hl.cl(t,f)]:[3,3]):[3,5];case 2:u.sent();this.k_.delete(t);this.M_.removeTarget(t);u.label=3;case 3:u.label=4;case 4:return i++,[3,1];case 5:return[2]}})})},y.prototype.tl=function(){return f(this,void 0,void 0,function(){var n,t;return u(this,function(i){switch(i.label){case 0:return this._l()?(n=0<this.N_.length?this.N_[this.N_.length-1].batchId:-1,[4,this.F_.Bu(n)]):[3,5];case 1:return null!==(t=i.sent())?[3,2]:(0===this.N_.length&&this.G_.Wc(),[3,4]);case 2:return this.ll(t),[4,this.tl()];case 3:i.sent();i.label=4;case 4:i.label=5;case 5:return this.dl()&&this.fl(),[2]}})})},y.prototype._l=function(){return this.B_()&&this.N_.length<10},y.prototype.Tl=function(){return this.N_.length},y.prototype.ll=function(n){this.N_.push(n);this.G_.qc()&&this.G_.h_&&this.G_.o_(n.mutations)},y.prototype.dl=function(){return this.B_()&&!this.G_.Bc()&&0<this.N_.length},y.prototype.fl=function(){this.G_.start()},y.prototype.z_=function(){return f(this,void 0,void 0,function(){return u(this,function(){return this.G_.c_(),[2]})})},y.prototype.Y_=function(){var n=this;return this.F_.fo(this.G_.lastStreamToken).then(function(){for(var r,t=0,i=n.N_;t<i.length;t++)r=i[t],n.G_.o_(r.mutations)}).catch(ee)},y.prototype.a_=function(n,t){var i=this,r=this.N_.shift(),u=bat.from(r,n,t,this.G_.lastStreamToken);return this.hl.El(u).then(function(){return i.tl()})},y.prototype.H_=function(n){return f(this,void 0,void 0,function(){return u(this,function(t){switch(t.label){case 0:return n&&0<this.N_.length?this.G_.h_?[4,this.Il(n)]:[3,2]:[3,5];case 1:return t.sent(),[3,4];case 2:return[4,this.wl(n)];case 3:t.sent();t.label=4;case 4:this.dl()&&this.fl();t.label=5;case 5:return[2]}})})},y.prototype.wl=function(n){return f(this,void 0,void 0,function(){return u(this,function(){return bd(n.code)?[2,(e("RemoteStore","RemoteStore error before completed handshake; resetting stream token: ",this.G_.lastStreamToken),this.G_.lastStreamToken=gt.ht,this.F_.fo(gt.ht).catch(ee))]:[2]})})},y.prototype.Il=function(n){return f(this,void 0,void 0,function(){var i,r,f=this;return u(this,function(){return bd(r=n.code)&&r!==t.ABORTED?(i=this.N_.shift(),[2,(this.G_.Qc(),this.hl.Rl(i.batchId,n).then(function(){return f.tl()}))]):[2]})})},y.prototype.Al=function(){return new dvt(this.f_)},y.prototype.q_=function(){return f(this,void 0,void 0,function(){return u(this,function(n){switch(n.label){case 0:return this.networkEnabled=!1,[4,this.el()];case 1:return n.sent(),this.U_.set("Unknown"),[4,this.enableNetwork()];case 2:return n.sent(),[2]}})})},y.prototype.ml=function(){return f(this,void 0,void 0,function(){return u(this,function(n){switch(n.label){case 0:return this.B_()?(e("RemoteStore","RemoteStore restarting streams for new credential"),[4,this.q_()]):[3,2];case 1:n.sent();n.label=2;case 2:return[2]}})})},y.prototype.Pl=function(n){return f(this,void 0,void 0,function(){return u(this,function(t){switch(t.label){case 0:return(this.isPrimary=n)&&this.networkEnabled?[4,this.enableNetwork()]:[3,2];case 1:return t.sent(),[3,5];case 2:return n?[3,4]:[4,this.el()];case 3:t.sent();this.U_.set("Unknown");t.label=4;case 4:t.label=5;case 5:return[2]}})})},y);var cc,oht,sht=(iw.Vl=function(n,t,r){var u=JSON.parse(r),f="object"==typeof u&&-1!==["pending","acknowledged","rejected"].indexOf(u.state)&&(void 0===u.error||"object"==typeof u.error),e=void 0;return f&&u.error&&(f="string"==typeof u.error.message&&"string"==typeof u.error.code)&&(e=new i(u.error.code,u.error.message)),f?new iw(n,t,u.state,e):(lt("SharedClientState","Failed to parse mutation state for ID '"+t+"': "+r),null)},iw.prototype.gl=function(){var n={state:this.state,updateTimeMs:Date.now()};return this.error&&(n.error={code:this.error.code,message:this.error.message}),JSON.stringify(n)},iw),on=(tw.Vl=function(n,t){var r=JSON.parse(t),u="object"==typeof r&&-1!==["not-current","current","rejected"].indexOf(r.state)&&(void 0===r.error||"object"==typeof r.error),f=void 0;return u&&r.error&&(u="string"==typeof r.error.message&&"string"==typeof r.error.code)&&(f=new i(r.error.code,r.error.message)),u?new tw(n,r.state,f):(lt("SharedClientState","Failed to parse target state for ID '"+n+"': "+t),null)},tw.prototype.gl=function(){var n={state:this.state,updateTimeMs:Date.now()};return this.error&&(n.error={code:this.error.code,message:this.error.message}),JSON.stringify(n)},tw),hht=(ln.Vl=function(n,t){for(var i=JSON.parse(t),u="object"==typeof i&&i.activeTargetIds instanceof Array,f=gy(),r=0;u&&r<i.activeTargetIds.length;++r)u=vut(i.activeTargetIds[r]),f=f.add(i.activeTargetIds[r]);return u?new ln(n,f):(lt("SharedClientState","Failed to parse client data for instance '"+n+"': "+t),null)},ln),uyt=(cn.Vl=function(n){var t=JSON.parse(n);return"object"==typeof t&&-1!==["Unknown","Online","Offline"].indexOf(t.onlineState)&&"string"==typeof t.clientId?new cn(t.clientId,t.onlineState):(lt("SharedClientState","Failed to parse online state: "+n),null)},cn),sn=(nw.prototype.pl=function(n){this.activeTargetIds=this.activeTargetIds.add(n)},nw.prototype.yl=function(n){this.activeTargetIds=this.activeTargetIds.delete(n)},nw.prototype.gl=function(){var n={activeTargetIds:this.activeTargetIds.W(),updateTimeMs:Date.now()};return JSON.stringify(n)},nw),hn=(b.Uh=function(n){return!(!n.window||null==n.window.localStorage)},b.prototype.start=function(){return f(this,void 0,void 0,function(){var o,n,i,r,s,f,h,c,t,e,l,a=this;return u(this,function(u){switch(u.label){case 0:return[4,this.hl._u()];case 1:for(o=u.sent(),n=0,i=o;n<i.length;n++)(r=i[n])!==this.bl&&(s=this.getItem(rht(this.persistenceKey,r)))&&(f=hht.Vl(r,s))&&(this.Dl=this.Dl.Ae(f.clientId,f));for(this.Ol(),(h=this.storage.getItem(this.Ll))&&(c=this.xl(h))&&this.Bl(c),t=0,e=this.Cl;t<e.length;t++)l=e[t],this.Sl(l);return this.Cl=[],this.platform.window.addEventListener("unload",function(){return a.hu()}),this.vh=!0,[2]}})})},b.prototype.lr=function(n){this.setItem(this.Nl,JSON.stringify(n))},b.prototype.ql=function(){return this.Ul(this.Dl)},b.prototype.Ql=function(n){var t=!1;return this.Dl.forEach(function(i,r){r.activeTargetIds.has(n)&&(t=!0)}),t},b.prototype.Wl=function(n){this.jl(n,"pending")},b.prototype.Kl=function(n,t,i){this.jl(n,t,i);this.Gl(n)},b.prototype.zl=function(n){var r="not-current",t,i;return this.Ql(n)&&(t=this.storage.getItem(en(this.persistenceKey,n)),t&&(i=on.Vl(n,t),i&&(r=i.state))),this.Hl.pl(n),this.Ol(),r},b.prototype.Yl=function(n){this.Hl.yl(n);this.Ol()},b.prototype.Jl=function(n){return this.Hl.activeTargetIds.has(n)},b.prototype.Xl=function(n){this.removeItem(en(this.persistenceKey,n))},b.prototype.Zl=function(n,t,i){this.td(n,t,i)},b.prototype.Su=function(n,t,i){var r=this;t.forEach(function(n){r.Gl(n)});this.currentUser=n;i.forEach(function(n){r.Wl(n)})},b.prototype.ed=function(n){this.sd(n)},b.prototype.hu=function(){this.vh&&(this.platform.window.removeEventListener("storage",this.vl),this.removeItem(this.Fl),this.vh=!1)},b.prototype.getItem=function(n){var t=this.storage.getItem(n);return e("SharedClientState","READ",n,t),t},b.prototype.setItem=function(n,t){e("SharedClientState","SET",n,t);this.storage.setItem(n,t)},b.prototype.removeItem=function(n){e("SharedClientState","REMOVE",n);this.storage.removeItem(n)},b.prototype.Sl=function(n){var t=this;if(n.storageArea===this.storage){if(e("SharedClientState","EVENT",n.key,n.newValue),n.key===this.Fl)return void lt("Received WebStorage notification for local change. Another client might have garbage-collected our state");this.Tr.Xr(function(){return f(t,void 0,void 0,function(){var i,t,r,f,e,o;return u(this,function(){if(this.vh){if(null!==n.key)if(this.kl.test(n.key)){if(null==n.newValue)return i=this.nd(n.key),[2,this.rd(i,null)];if(t=this.hd(n.key,n.newValue))return[2,this.rd(t.clientId,t)]}else if(this.$l.test(n.key)){if(null!==n.newValue&&(r=this.od(n.key,n.newValue)))return[2,this.ad(r)]}else if(this.Ml.test(n.key)){if(null!==n.newValue&&(f=this.ud(n.key,n.newValue)))return[2,this._d(f)]}else if(n.key===this.Ll){if(null!==n.newValue&&(e=this.xl(n.newValue)))return[2,this.Bl(e)]}else n.key===this.Nl&&(o=function(n){var i=yu.dr,t;if(null!=n)try{t=JSON.parse(n);c("number"==typeof t);i=t}catch(n){lt("SharedClientState","Failed to read sequence number from WebStorage",n)}return i}(n.newValue))!==yu.dr&&this.ur(o)}else this.Cl.push(n);return[2]})})})}},Object.defineProperty(b.prototype,"Hl",{get:function(){return this.Dl.get(this.bl)},enumerable:!0,configurable:!0}),b.prototype.Ol=function(){this.setItem(this.Fl,this.Hl.gl())},b.prototype.jl=function(n,t,i){var r=new sht(this.currentUser,n,t,i),u=uht(this.persistenceKey,this.currentUser,n);this.setItem(u,r.gl())},b.prototype.Gl=function(n){var t=uht(this.persistenceKey,this.currentUser,n);this.removeItem(t)},b.prototype.sd=function(n){var t={clientId:this.bl,onlineState:n};this.storage.setItem(this.Ll,JSON.stringify(t))},b.prototype.td=function(n,t,i){var r=en(this.persistenceKey,n),u=new on(n,t,i);this.setItem(r,u.gl())},b.prototype.nd=function(n){var t=this.kl.exec(n);return t?t[1]:null},b.prototype.hd=function(n,t){var i=this.nd(n);return hht.Vl(i,t)},b.prototype.od=function(n,t){var i=this.$l.exec(n),r=Number(i[1]),u=void 0!==i[2]?i[2]:null;return sht.Vl(new eu(u),r,t)},b.prototype.ud=function(n,t){var i=this.Ml.exec(n),r=Number(i[1]);return on.Vl(r,t)},b.prototype.xl=function(n){return uyt.Vl(n)},b.prototype.ad=function(n){return f(this,void 0,void 0,function(){return u(this,function(){return n.user.uid===this.currentUser.uid?[2,this.hl.ld(n.batchId,n.state,n.error)]:(e("SharedClientState","Ignoring mutation for non-active user "+n.user.uid),[2])})})},b.prototype._d=function(n){return this.hl.dd(n.targetId,n.state,n.error)},b.prototype.rd=function(n,t){var o=this,i=t?this.Dl.Ae(n,t):this.Dl.remove(n),r=this.Ul(this.Dl),u=this.Ul(i),f=[],e=[];return u.forEach(function(n){r.has(n)||f.push(n)}),r.forEach(function(n){u.has(n)||e.push(n)}),this.hl.fd(f,e).then(function(){o.Dl=i})},b.prototype.Bl=function(n){this.Dl.get(n.clientId)&&this.V_(n.onlineState)},b.prototype.Ul=function(n){var t=gy();return n.forEach(function(n,i){t=t.He(i.activeTargetIds)}),t},b),cht=(lr.prototype.Wl=function(){},lr.prototype.Kl=function(){},lr.prototype.zl=function(n){return this.Td.pl(n),this.Ed[n]||"not-current"},lr.prototype.Zl=function(n,t){this.Ed[n]=t},lr.prototype.Yl=function(n){this.Td.yl(n)},lr.prototype.Jl=function(n){return this.Td.activeTargetIds.has(n)},lr.prototype.Xl=function(n){delete this.Ed[n]},lr.prototype.ql=function(){return this.Td.activeTargetIds},lr.prototype.Ql=function(n){return this.Td.activeTargetIds.has(n)},lr.prototype.start=function(){return this.Td=new sn,Promise.resolve()},lr.prototype.Su=function(){},lr.prototype.ed=function(){},lr.prototype.hu=function(){},lr.prototype.lr=function(){},lr),lht=(Object.defineProperty(tf.prototype,"md",{get:function(){return this.Id},enumerable:!0,configurable:!0}),tf.prototype.Pd=function(n,t){var u=this,f=t?t.Vd:new ret,e=t?t.Ad:this.Ad,r=t?t.ns:this.ns,i=e,s=!1,h=this.query.oe()&&e.size===this.query.limit?e.last():null,c=this.query.ae()&&e.size===this.query.limit?e.first():null,o;if(n.pe(function(n,t){var l=e.get(n),o=t instanceof it?t:null;o=o&&(u.query.matches(o)?o:null);var y=!!l&&u.ns.has(l.key),v=!!o&&(o.At||u.ns.has(o.key)&&o.hasCommittedMutations),a=!1;l&&o?l.data().isEqual(o.data())?y!==v&&(f.track({type:3,doc:o}),a=!0):u.gd(l,o)||(f.track({type:2,doc:o}),a=!0,(h&&0<u.query.se(o,h)||c&&u.query.se(o,c)<0)&&(s=!0)):!l&&o?(f.track({type:0,doc:o}),a=!0):l&&!o&&(f.track({type:1,doc:l}),a=!0,(h||c)&&(s=!0));a&&(r=o?(i=i.add(o),v?r.add(n):r.delete(n)):(i=i.delete(n),r.delete(n)))}),this.query.oe()||this.query.ae())for(;i.size>this.query.limit;)o=this.query.oe()?i.last():i.first(),i=i.delete(o.key),r=r.delete(o.key),f.track({type:1,doc:o});return{Ad:i,Vd:f,pd:s,ns:r}},tf.prototype.gd=function(n,t){return n.At&&t.hasCommittedMutations&&!t.At},tf.prototype.xn=function(n,t,i){var s=this,h=this.Ad,r;this.Ad=n.Ad;this.ns=n.ns;r=n.Vd.es();r.sort(function(n,t){function i(n){switch(n){case 0:return 1;case 2:case 3:return 2;case 1:return 0;default:return o()}}return r=n.type,u=t.type,i(r)-i(u)||s.query.se(n.doc,t.doc);var r,u});this.yd(i);var f=t?this.bd():[],u=0===this.Rd.size&&this.fs?1:0,e=u!==this.wd;return this.wd=u,0!==r.length||e?{snapshot:new tp(this.query,n.Ad,h,r,n.ns,0==u,e,!1),vd:f}:{vd:f}},tf.prototype.Sd=function(n){return this.fs&&"Offline"===n?(this.fs=!1,this.xn({Ad:this.Ad,Vd:new ret,ns:this.ns,pd:!1},!1)):{vd:[]}},tf.prototype.Dd=function(n){return!this.Id.has(n)&&!!this.Ad.has(n)&&!this.Ad.get(n).At},tf.prototype.yd=function(n){var t=this;n&&(n.Ts.forEach(function(n){return t.Id=t.Id.add(n)}),n.Es.forEach(function(){}),n.Is.forEach(function(n){return t.Id=t.Id.delete(n)}),this.fs=n.fs)},tf.prototype.bd=function(){var n=this,i,t;return this.fs?(i=this.Rd,this.Rd=ft(),this.Ad.forEach(function(t){n.Dd(t.key)&&(n.Rd=n.Rd.add(t.key))}),t=[],i.forEach(function(i){n.Rd.has(i)||t.push(new eht(i))}),this.Rd.forEach(function(n){i.has(n)||t.push(new fht(n))}),t):[]},tf.prototype.Cd=function(n){this.Id=n.ju;this.Rd=ft();var t=this.Pd(n.documents);return this.xn(t,!0)},tf.prototype.Fd=function(){return tp.os(this.query,this.Ad,this.ns,0===this.wd)},tf),fyt=(ac.prototype.$d=function(){this.Md()},ac.prototype.Md=function(){var n=this;this.Qr.gr(function(){return f(n,void 0,void 0,function(){var t,i,n=this;return u(this,function(){return t=this.Nd.Al(),(i=this.Ld(t))&&i.then(function(i){n.br.$r(function(){return t.commit().then(function(){n.Dr.resolve(i)}).catch(function(t){n.Od(t)})})}).catch(function(t){n.Od(t)}),[2]})})})},ac.prototype.Ld=function(n){try{var t=this.updateFunction(n);return!wo(t)&&t.catch&&t.then?t:(this.Dr.reject(Error("Transaction callback must return a Promise")),null)}catch(n){return this.Dr.reject(n),null}},ac.prototype.Od=function(n){var t=this;0<this.kd&&this.xd(n)?(--this.kd,this.br.$r(function(){return t.Md(),Promise.resolve()})):this.Dr.reject(n)},ac.prototype.xd=function(n){if("FirebaseError"!==n.name)return!1;var t=n.code;return"aborted"===t||"failed-precondition"===t||!bd(t)},ac),aht=(Object.defineProperty(rt.prototype,"Zd",{get:function(){return!0},enumerable:!0,configurable:!0}),rt.prototype.subscribe=function(n){this.Qd=n},rt.prototype.listen=function(n){return f(this,void 0,void 0,function(){var t,r,f,i,e;return u(this,function(u){switch(u.label){case 0:return this.tf("listen()"),(f=this.Wd.get(n))?(t=f.targetId,this.qd.zl(t),r=f.view.Fd(),[3,4]):[3,1];case 1:return[4,this.F_.Uu(n.ee())];case 2:return i=u.sent(),e=this.qd.zl(i.targetId),t=i.targetId,[4,this.ef(n,t,"current"===e)];case 3:r=u.sent();this.Zd&&this.Nd.listen(i);u.label=4;case 4:return[2,r]}})})},rt.prototype.ef=function(n,t,i){return f(this,void 0,void 0,function(){var f,r,o,s,e,h;return u(this,function(u){switch(u.label){case 0:return[4,this.F_.Wu(n,!0)];case 1:return f=u.sent(),r=new lht(n,f.ju),o=r.Pd(f.documents),s=gd.ds(t,i&&"Offline"!==this.onlineState),e=r.xn(o,this.Zd,s),this.sf(t,e.vd),h=new tyt(n,t,r),[2,(this.Wd.set(n,h),this.jd.has(t)?this.jd.get(t).push(n):this.jd.set(t,[n]),e.snapshot)]}})})},rt.prototype.nl=function(n){return f(this,void 0,void 0,function(){var t,r,i=this;return u(this,function(u){switch(u.label){case 0:return this.tf("unlisten()"),t=this.Wd.get(n),1<(r=this.jd.get(t.targetId)).length?[2,(this.jd.set(t.targetId,r.filter(function(t){return!t.isEqual(n)})),void this.Wd.delete(n))]:this.Zd?(this.qd.Yl(t.targetId),this.qd.Ql(t.targetId)?[3,2]:[4,this.F_.Qu(t.targetId,!1).then(function(){i.qd.Xl(t.targetId);i.Nd.nl(t.targetId);i.if(t.targetId)}).catch(ee)]):[3,3];case 1:u.sent();u.label=2;case 2:return[3,5];case 3:return this.if(t.targetId),[4,this.F_.Qu(t.targetId,!0)];case 4:u.sent();u.label=5;case 5:return[2]}})})},rt.prototype.write=function(n,r){return f(this,void 0,void 0,function(){var f,e;return u(this,function(u){switch(u.label){case 0:this.tf("write()");u.label=1;case 1:return u.trys.push([1,3,,4]),[4,this.F_.Nu(n)];case 2:return f=u.sent(),[3,4];case 3:if("IndexedDbTransactionError"===(e=u.sent()).name)return[2,(lt("SyncEngine","Dropping write that cannot be persisted: "+e),void r.reject(new i(t.UNAVAILABLE,"Failed to persist write: "+e)))];throw e;case 4:return this.qd.Wl(f.batchId),this.nf(f.batchId,r),[4,this.rf(f.Dn)];case 5:return u.sent(),[4,this.Nd.tl()];case 6:return u.sent(),[2]}})})},rt.prototype.runTransaction=function(n,t,i){new fyt(n,this.Nd,t,i).$d()},rt.prototype.Mu=function(n){return f(this,void 0,void 0,function(){var t,i=this;return u(this,function(r){switch(r.label){case 0:this.tf("applyRemoteEvent()");r.label=1;case 1:return r.trys.push([1,4,,6]),[4,this.F_.Mu(n)];case 2:return t=r.sent(),n.as.forEach(function(n,t){var r=i.zd.get(t);r&&(c(n.Ts.size+n.Es.size+n.Is.size<=1),0<n.Ts.size?r.Bd=!0:0<n.Es.size?c(r.Bd):0<n.Is.size&&(c(r.Bd),r.Bd=!1))}),[4,this.rf(t,n)];case 3:return r.sent(),[3,6];case 4:return[4,ee(r.sent())];case 5:return r.sent(),[3,6];case 6:return[2]}})})},rt.prototype.Sd=function(n){this.tf("applyOnlineStateChange()");var t=[];this.Wd.forEach(function(i,r){var u=r.view.Sd(n);u.snapshot&&t.push(u.snapshot)});this.Qd.hf(n);this.Qd.s_(t);this.onlineState=n},rt.prototype.cl=function(n,t){return f(this,void 0,void 0,function(){var r,i,f,e,o,s=this;return u(this,function(u){switch(u.label){case 0:return this.tf("rejectListens()"),this.qd.Zl(n,"rejected",t),r=this.zd.get(n),(i=r&&r.key)?(this.Gd=this.Gd.remove(i),this.zd.delete(n),this.af(),f=(f=new ir(l.N)).Ae(i,new hi(i,g.min())),e=ft().add(i),o=new dd(g.min(),new Map,new ei(p),f,e),[2,this.Mu(o)]):[4,this.F_.Qu(n,!1).then(function(){return s.if(n,t)}).catch(ee)];case 1:return u.sent(),[2]}})})},rt.prototype.El=function(n){return f(this,void 0,void 0,function(){var t,i;return u(this,function(r){switch(r.label){case 0:this.tf("applySuccessfulWrite()");t=n.batch.batchId;this.uf(t,null);this.cf(t);r.label=1;case 1:return r.trys.push([1,4,,6]),[4,this.F_._o(n)];case 2:return i=r.sent(),this.qd.Kl(t,"acknowledged"),[4,this.rf(i)];case 3:return r.sent(),[3,6];case 4:return[4,ee(r.sent())];case 5:return r.sent(),[3,6];case 6:return[2]}})})},rt.prototype.Rl=function(n,t){return f(this,void 0,void 0,function(){var i;return u(this,function(r){switch(r.label){case 0:this.tf("rejectFailedWrite()");this.uf(n,t);this.cf(n);r.label=1;case 1:return r.trys.push([1,4,,6]),[4,this.F_.$u(n)];case 2:return i=r.sent(),this.qd.Kl(n,"rejected",t),[4,this.rf(i)];case 3:return r.sent(),[3,6];case 4:return[4,ee(r.sent())];case 5:return r.sent(),[3,6];case 6:return[2]}})})},rt.prototype._f=function(n){return f(this,void 0,void 0,function(){var t,i;return u(this,function(r){switch(r.label){case 0:return this.Nd.B_()||e("SyncEngine","The network is disabled. The task returned by 'awaitPendingWrites()' will not complete until the network is enabled."),[4,this.F_.Po()];case 1:return-1===(t=r.sent())?[2,void n.resolve()]:((i=this.Jd.get(t)||[]).push(n),this.Jd.set(t,i),[2])}})})},rt.prototype.cf=function(n){(this.Jd.get(n)||[]).forEach(function(n){n.resolve()});this.Jd.delete(n)},rt.prototype.lf=function(n){this.Jd.forEach(function(r){r.forEach(function(r){r.reject(new i(t.CANCELLED,n))})});this.Jd.clear()},rt.prototype.nf=function(n,t){var i=this.Yd[this.currentUser.s()];i=(i=i||new ir(p)).Ae(n,t);this.Yd[this.currentUser.s()]=i},rt.prototype.uf=function(n,t){var i=this.Yd[this.currentUser.s()],r;i&&(r=i.get(n),r&&(t?r.reject(t):r.resolve(),i=i.remove(n)),this.Yd[this.currentUser.s()]=i)},rt.prototype.if=function(n,t){var f=this,i,r,u;for(void 0===t&&(t=null),this.qd.Yl(n),i=0,r=this.jd.get(n);i<r.length;i++)u=r[i],this.Wd.delete(u),t&&this.Qd.df(u,t);this.jd.delete(n);this.Zd&&this.Hd.ic(n).forEach(function(n){f.Hd.Co(n)||f.ff(n)})},rt.prototype.ff=function(n){var t=this.Gd.get(n);null!==t&&(this.Nd.nl(t),this.Gd=this.Gd.remove(n),this.zd.delete(t),this.af())},rt.prototype.sf=function(n,t){for(var i,r=0,u=t;r<u.length;r++)i=u[r],i instanceof fht?(this.Hd.Xo(i.key,n),this.Tf(i)):i instanceof eht?(e("SyncEngine","Document no longer in limbo: "+i.key),this.Hd.ta(i.key,n),this.Hd.Co(i.key)||this.ff(i.key)):o()},rt.prototype.Tf=function(n){var t=n.key;this.Gd.get(t)||(e("SyncEngine","New document in limbo: "+t),this.Kd.push(t),this.af())},rt.prototype.af=function(){for(;0<this.Kd.length&&this.Gd.size<this.Ud;){var n=this.Kd.shift(),t=this.Xd.next();this.zd.set(t,new iyt(n));this.Gd=this.Gd.Ae(n,t);this.Nd.listen(new py(us.Wt(n.path).ee(),t,2,yu.dr))}},rt.prototype.Ef=function(){return this.Gd},rt.prototype.If=function(){return this.Kd},rt.prototype.rf=function(n,t){return f(this,void 0,void 0,function(){var r,f,e,i=this;return u(this,function(u){switch(u.label){case 0:return r=[],f=[],e=[],this.Wd.forEach(function(u,o){e.push(Promise.resolve().then(function(){var t=o.view.Pd(n);return t.pd?i.F_.Wu(o.query,!1).then(function(n){var i=n.documents;return o.view.Pd(i,t)}):t}).then(function(n){var s=t&&t.as.get(o.targetId),u=o.view.xn(n,i.Zd,s),e;(i.sf(o.targetId,u.vd),u.snapshot)&&(i.Zd&&i.qd.Zl(o.targetId,u.snapshot.fromCache?"not-current":"current"),r.push(u.snapshot),e=kat.ar(o.targetId,u.snapshot),f.push(e))}))}),[4,Promise.all(e)];case 1:return u.sent(),this.Qd.s_(r),[4,this.F_.xu(f)];case 2:return u.sent(),[2]}})})},rt.prototype.tf=function(){},rt.prototype.ml=function(n){return f(this,void 0,void 0,function(){var i,t;return u(this,function(r){switch(r.label){case 0:return i=!this.currentUser.isEqual(n),this.currentUser=n,i?(this.lf("'waitForPendingWrites' promise is rejected due to a user change."),[4,this.F_.Su(n)]):[3,3];case 1:return t=r.sent(),this.qd.Su(n,t.Cu,t.Fu),[4,this.rf(t.Du)];case 2:r.sent();r.label=3;case 3:return[4,this.Nd.ml()];case 4:return r.sent(),[2]}})})},rt.prototype.enableNetwork=function(){return this.Nd.enableNetwork()},rt.prototype.disableNetwork=function(){return this.Nd.disableNetwork()},rt.prototype.ei=function(n){var r=this.zd.get(n),t,u,i,f,e,o;if(r&&r.Bd)return ft().add(r.key);if(t=ft(),u=this.jd.get(n),!u)return t;for(i=0,f=u;i<f.length;i++)e=f[i],o=this.Wd.get(e),t=t.He(o.view.md);return t},rt),eyt=(k(cr,cc=aht),Object.defineProperty(cr.prototype,"Zd",{get:function(){return!0===this.isPrimary},enumerable:!0,configurable:!0}),cr.prototype.enableNetwork=function(){return this.F_.za(!0),cc.prototype.enableNetwork.call(this)},cr.prototype.disableNetwork=function(){return this.F_.za(!1),cc.prototype.disableNetwork.call(this)},cr.prototype.wf=function(n){return f(this,void 0,void 0,function(){var i,t;return u(this,function(r){switch(r.label){case 0:return[4,this.F_.Wu(n.query,!0)];case 1:return i=r.sent(),t=n.view.Cd(i),[2,(this.isPrimary&&this.sf(n.targetId,t.vd),t)]}})})},cr.prototype.Sd=function(n,t){this.Zd&&0===t&&(cc.prototype.Sd.call(this,n,t),this.qd.ed(n));this.Zd||1!==t||cc.prototype.Sd.call(this,n,t)},cr.prototype.ld=function(n,t,i){return f(this,void 0,void 0,function(){var r;return u(this,function(u){switch(u.label){case 0:return this.tf("applyBatchState()"),[4,this.F_.Gu(n)];case 1:return null===(r=u.sent())?[3,6]:"pending"!==t?[3,3]:[4,this.Nd.tl()];case 2:return u.sent(),[3,4];case 3:"acknowledged"===t||"rejected"===t?(this.uf(n,i||null),this.F_.zu(n)):o();u.label=4;case 4:return[4,this.rf(r)];case 5:return u.sent(),[3,7];case 6:e("SyncEngine","Cannot apply mutation batch with id: "+n);u.label=7;case 7:return[2]}})})},cr.prototype.Pl=function(n){return f(this,void 0,void 0,function(){var o,s,t,f,h,e,i,r=this;return u(this,function(u){switch(u.label){case 0:return!0!==n||!0===this.isPrimary?[3,3]:(this.isPrimary=!0,[4,this.Nd.Pl(!0)]);case 1:return u.sent(),o=this.qd.ql(),[4,this.Rf(o.W())];case 2:for(s=u.sent(),t=0,f=s;t<f.length;t++)h=f[t],this.Nd.listen(h);return[3,7];case 3:return!1!==n||!1===this.isPrimary?[3,7]:(this.isPrimary=!1,e=[],i=Promise.resolve(),this.jd.forEach(function(n,t){r.qd.Jl(t)?e.push(t):i=i.then(function(){return r.if(t),r.F_.Qu(t,!0)});r.Nd.nl(t)}),[4,i]);case 4:return u.sent(),[4,this.Rf(e)];case 5:return u.sent(),this.Af(),[4,this.Nd.Pl(!1)];case 6:u.sent();u.label=7;case 7:return[2]}})})},cr.prototype.Af=function(){var n=this;this.zd.forEach(function(t,i){n.Nd.nl(i)});this.Hd.nc();this.zd=new Map;this.Gd=new ir(l.N)},cr.prototype.Rf=function(n){return f(this,void 0,void 0,function(){var o,s,i,h,t,r,f,e,c,a,v,y,l;return u(this,function(u){switch(u.label){case 0:o=[];s=[];i=0;h=n;u.label=1;case 1:return i<h.length?(t=h[i],r=void 0,(f=this.jd.get(t))&&0!==f.length?[4,this.F_.Qu(t,!0)]:[3,8]):[3,14];case 2:return u.sent(),[4,this.F_.Uu(f[0].ee())];case 3:r=u.sent();e=0;c=f;u.label=4;case 4:return e<c.length?(a=c[e],v=this.Wd.get(a),[4,this.wf(v)]):[3,7];case 5:(y=u.sent()).snapshot&&s.push(y.snapshot);u.label=6;case 6:return e++,[3,4];case 7:return[3,12];case 8:return[4,this.F_.Hu(t)];case 9:return l=u.sent(),[4,this.F_.Uu(l)];case 10:return r=u.sent(),[4,this.ef(this.mf(l),t,!1)];case 11:u.sent();u.label=12;case 12:o.push(r);u.label=13;case 13:return i++,[3,1];case 14:return[2,(this.Qd.s_(s),o)]}})})},cr.prototype.mf=function(n){return new us(n.path,n.collectionGroup,n.orderBy,n.filters,n.limit,"F",n.startAt,n.endAt)},cr.prototype._u=function(){return this.F_._u()},cr.prototype.dd=function(n,t,i){return f(this,void 0,void 0,function(){var r,f;return u(this,function(u){switch(u.label){case 0:return this.isPrimary?(e("SyncEngine","Ignoring unexpected query state notification."),[3,8]):[3,1];case 1:if(!this.jd.has(n))return[3,8];switch(t){case"current":case"not-current":return[3,2];case"rejected":return[3,5]}return[3,7];case 2:return[4,this.F_.la()];case 3:return r=u.sent(),f=dd.ls(n,"current"===t),[4,this.rf(r,f)];case 4:return u.sent(),[3,8];case 5:return[4,this.F_.Qu(n,!0)];case 6:return u.sent(),this.if(n,i),[3,8];case 7:o();u.label=8;case 8:return[2]}})})},cr.prototype.fd=function(n,t){return f(this,void 0,void 0,function(){var i,o,r,s,h,a,c,f,l,v,y=this;return u(this,function(p){switch(p.label){case 0:if(!this.isPrimary)return[3,10];i=0;o=n;p.label=1;case 1:return i<o.length?(r=o[i],this.jd.has(r)?(e("SyncEngine","Adding an already active target "+r),[3,5]):[4,this.F_.Hu(r)]):[3,6];case 2:return s=p.sent(),[4,this.F_.Uu(s)];case 3:return h=p.sent(),[4,this.ef(this.mf(s),h.targetId,!1)];case 4:p.sent();this.Nd.listen(h);p.label=5;case 5:return i++,[3,1];case 6:a=function(n){return u(this,function(t){switch(t.label){case 0:return c.jd.has(n)?[4,c.F_.Qu(n,!1).then(function(){y.Nd.nl(n);y.if(n)}).catch(ee)]:[3,2];case 1:t.sent();t.label=2;case 2:return[2]}})};c=this;f=0;l=t;p.label=7;case 7:return f<l.length?(v=l[f],[5,a(v)]):[3,10];case 8:p.sent();p.label=9;case 9:return f++,[3,7];case 10:return[2]}})})},cr),oyt=(le.prototype.listen=function(n){return f(this,void 0,void 0,function(){var f,o,r,s,e,h;return u(this,function(u){switch(u.label){case 0:if(f=n.query,o=!1,(r=this.gf.get(f))||(o=!0,r=new ryt),!o)return[3,4];u.label=1;case 1:return u.trys.push([1,3,,4]),s=r,[4,this.hl.listen(f)];case 2:return s.Pf=u.sent(),[3,4];case 3:if(e=u.sent(),lt("EventManager",h="Initialization of query '"+f+"' failed: "+e),"IndexedDbTransactionError"!==e.name)throw e;return[2,void n.onError(new i(t.UNAVAILABLE,h))];case 4:return this.gf.set(f,r),r.Vf.push(n),n.Sd(this.onlineState),r.Pf&&n.yf(r.Pf)&&this.bf(),[2]}})})},le.prototype.nl=function(n){return f(this,void 0,void 0,function(){var t,r,i,f;return u(this,function(){return t=n.query,r=!1,(i=this.gf.get(t))&&0<=(f=i.Vf.indexOf(n))&&(i.Vf.splice(f,1),r=0===i.Vf.length),r?[2,(this.gf.delete(t),this.hl.nl(t))]:[2]})})},le.prototype.s_=function(n){for(var t,f,e=!1,i=0,o=n;i<o.length;i++){var r=o[i],s=r.query,u=this.gf.get(s);if(u){for(t=0,f=u.Vf;t<f.length;t++)f[t].yf(r)&&(e=!0);u.Pf=r}}e&&this.bf()},le.prototype.df=function(n,t){var u=this.gf.get(n),i,r;if(u)for(i=0,r=u.Vf;i<r.length;i++)r[i].onError(t);this.gf.delete(n)},le.prototype.hf=function(n){this.onlineState=n;var t=!1;this.gf.forEach(function(i,r){for(var u=0,f=r.Vf;u<f.length;u++)f[u].Sd(n)&&(t=!0)});t&&this.bf()},le.prototype.vf=function(n){this.pf.add(n);n.next()},le.prototype.Sf=function(n){this.pf.delete(n)},le.prototype.bf=function(){this.pf.forEach(function(n){n.next()})},le),syt=(ks.prototype.yf=function(n){var r,t;if(!this.options.includeMetadataChanges){for(var u=[],i=0,f=n.docChanges;i<f.length;i++)r=f[i],3!==r.type&&u.push(r);n=new tp(n.query,n.docs,n.ss,u,n.ns,n.fromCache,n.rs,!0)}return t=!1,this.Cf?this.Nf(n)&&(this.Df.next(n),t=!0):this.kf(n,this.onlineState)&&(this.$f(n),t=!0),this.Ff=n,t},ks.prototype.onError=function(n){this.Df.error(n)},ks.prototype.Sd=function(n){this.onlineState=n;var t=!1;return this.Ff&&!this.Cf&&this.kf(this.Ff,n)&&(this.$f(this.Ff),t=!0),t},ks.prototype.kf=function(n,t){if(!n.fromCache)return!0;var i="Offline"!==t;return!(this.options.Mf&&i||n.docs.B()&&"Offline"!==t)},ks.prototype.Nf=function(n){if(0<n.docChanges.length)return!0;var t=this.Ff&&this.Ff.hasPendingWrites!==n.hasPendingWrites;return!(!n.rs&&!t)&&!0===this.options.includeMetadataChanges},ks.prototype.$f=function(n){n=tp.os(n.query,n.docs,n.ns,n.fromCache);this.Cf=!0;this.Df.next(n)},ks),vht=(lc.prototype.vu=function(n){this.Lf=n},lc.prototype.Zn=function(n,t,i,r){var u=this;return t.te()||i.isEqual(g.min())?this.Of(n,t):this.Lf.Yn(n,r).next(function(f){var o=u.xf(t,f);return(t.oe()||t.ae())&&u.pd(t.Bt,o,r,i)?u.Of(n,t):(ip()<=d.DEBUG&&e("IndexFreeQueryEngine","Re-using previous result from %s to execute query: %s",i.toString(),t.toString()),u.Lf.Zn(n,t,i).next(function(n){return o.forEach(function(t){n=n.Ae(t.key,t)}),n}))})},lc.prototype.xf=function(n,t){var i=new ei(function(t,i){return n.se(t,i)});return t.forEach(function(t,r){r instanceof it&&n.matches(r)&&(i=i.add(r))}),i},lc.prototype.pd=function(n,t,i,r){if(i.size!==t.size)return!0;var u="F"===n?t.last():t.first();return!!u&&(u.hasPendingWrites||0<u.version.S(r))},lc.prototype.Of=function(n,t){return ip()<=d.DEBUG&&e("IndexFreeQueryEngine","Using full collection scan to execute query: %s",t.toString()),this.Lf.Zn(n,t,g.min())},lc),hyt=(dt.prototype.co=function(){return r.resolve(0===this.Wn.length)},dt.prototype._o=function(n,t,i){var f=t.batchId,u=this.Uf(f,"acknowledged");return c(0===u),this.Wn[u],this.lastStreamToken=i,r.resolve()},dt.prototype.do=function(){return r.resolve(this.lastStreamToken)},dt.prototype.fo=function(n,t){return this.lastStreamToken=t,r.resolve()},dt.prototype.To=function(n,t,i,u){var h=this.Bf,e,f,o,s;for(this.Bf++,0<this.Wn.length&&this.Wn[this.Wn.length-1],e=new eg(h,t,i,u),this.Wn.push(e),f=0,o=u;f<o.length;f++)s=o[f],this.qf=this.qf.add(new oi(s.key,h)),this.jn.Io(n,s.key.path.M());return r.resolve(e)},dt.prototype.wo=function(n,t){return r.resolve(this.Qf(t))},dt.prototype.mo=function(n,t){var f=t+1,i=this.Wf(f),u=i<0?0:i;return r.resolve(this.Wn.length>u?this.Wn[u]:null)},dt.prototype.Po=function(){return r.resolve(0===this.Wn.length?-1:this.Bf-1)},dt.prototype.Vo=function(){return r.resolve(this.Wn.slice())},dt.prototype.Gn=function(n,t){var u=this,f=new oi(t,0),e=new oi(t,Number.POSITIVE_INFINITY),i=[];return this.qf.Ke([f,e],function(n){var t=u.Qf(n.hc);i.push(t)}),r.resolve(i)},dt.prototype.Xn=function(n,t){var u=this,i=new ei(p);return t.forEach(function(n){var t=new oi(n,0),r=new oi(n,Number.POSITIVE_INFINITY);u.qf.Ke([t,r],function(n){i=i.add(n.hc)})}),r.resolve(this.jf(i))},dt.prototype.nr=function(n,t){var f=t.path,o=f.length+1,i=f,e,u;return l.et(i)||(i=i.child("")),e=new oi(new l(i),0),u=new ei(p),this.qf.Ge(function(n){var t=n.key.path;return!!f.q(t)&&(t.length===o&&(u=u.add(n.hc)),!0)},e),r.resolve(this.jf(u))},dt.prototype.jf=function(n){var i=this,t=[];return n.forEach(function(n){var r=i.Qf(n);null!==r&&t.push(r)}),t},dt.prototype.yo=function(n,t){var u=this,i;return c(0===this.Uf(t.batchId,"removed")),this.Wn.shift(),i=this.qf,r.forEach(t.mutations,function(r){var f=new oi(r.key,t.batchId);return i=i.delete(f),u.oo.So(n,r.key)}).next(function(){u.qf=i})},dt.prototype.vo=function(){},dt.prototype.Co=function(n,t){var u=new oi(t,0),i=this.qf.ze(u);return r.resolve(t.isEqual(i&&i.key))},dt.prototype.Do=function(){return this.Wn.length,r.resolve()},dt.prototype.Uf=function(n){return this.Wf(n)},dt.prototype.Wf=function(n){return 0===this.Wn.length?0:n-this.Wn[0].batchId},dt.prototype.Qf=function(n){var t=this.Wf(n);return t<0||t>=this.Wn.length?null:this.Wn[t]},dt),yht=(af.prototype.Nn=function(n,t,i){var r=t.key,u=this.docs.get(r),e=u?u.size:0,f=this.Kf(t);return this.docs=this.docs.Ae(r,{ra:t,size:f,readTime:i}),this.size+=f-e,this.jn.Io(n,r.path.M())},af.prototype.$n=function(n){var t=this.docs.get(n);t&&(this.docs=this.docs.remove(n),this.size-=t.size)},af.prototype.Mn=function(n,t){var i=this.docs.get(t);return r.resolve(i?i.ra:null)},af.prototype.getEntries=function(n,t){var u=this,i=dy();return t.forEach(function(n){var t=u.docs.get(n);i=i.Ae(n,t?t.ra:null)}),r.resolve(i)},af.prototype.Zn=function(n,t,i){for(var f=kl(),h=new l(t.path.child("")),e=this.docs.ve(h);e.ke();){var o=e.Ne(),c=o.key,s=o.value,u=s.ra,a=s.readTime;if(!t.path.q(c.path))break;a.S(i)<=0||u instanceof it&&t.matches(u)&&(f=f.Ae(u.key,u))}return r.resolve(f)},af.prototype.Gf=function(n,t){return r.forEach(this.docs,function(n){return t(n)})},af.prototype.Ea=function(){return new af.Ia(this)},af.prototype.Ra=function(){return r.resolve(this.size)},af);yht.Ia=(k(va,oht=aet),va.prototype.xn=function(n){var t=this,i=[];return this.Dn.forEach(function(r,u){u?i.push(t.Aa.Nn(n,u,t.readTime)):t.Aa.$n(r)}),r.vn(i)},va.prototype.Ln=function(n,t){return this.Aa.Mn(n,t)},va.prototype.On=function(n,t){return this.Aa.getEntries(n,t)},va);var rw,pht,cyt=(vi.prototype.js=function(n,t){return this.zf.forEach(function(n,i){return t(i)}),r.resolve()},vi.prototype.Oo=function(){return r.resolve(this.lastRemoteSnapshotVersion)},vi.prototype.xo=function(){return r.resolve(this.Hf)},vi.prototype.$o=function(){return this.highestTargetId=this.Jf.next(),r.resolve(this.highestTargetId)},vi.prototype.Bo=function(n,t,i){return i&&(this.lastRemoteSnapshotVersion=i),t>this.Hf&&(this.Hf=t),r.resolve()},vi.prototype.Uo=function(n){this.zf.set(n.target,n);var t=n.targetId;t>this.highestTargetId&&(this.Jf=new ia(t),this.highestTargetId=t);n.sequenceNumber>this.Hf&&(this.Hf=n.sequenceNumber)},vi.prototype.qo=function(n,t){return this.Uo(t),this.targetCount+=1,r.resolve()},vi.prototype.Wo=function(n,t){return this.Uo(t),r.resolve()},vi.prototype.jo=function(n,t){return this.zf.delete(t.target),this.Yf.ic(t.targetId),--this.targetCount,r.resolve()},vi.prototype.$h=function(n,t,i){var u=this,f=0,e=[];return this.zf.forEach(function(r,o){o.sequenceNumber<=t&&null===i.get(o.targetId)&&(u.zf.delete(r),e.push(u.Ko(n,o.targetId)),f++)}),r.vn(e).next(function(){return f})},vi.prototype.Ho=function(){return r.resolve(this.targetCount)},vi.prototype.Yo=function(n,t){var i=this.zf.get(t)||null;return r.resolve(i)},vi.prototype.Jo=function(n,t,i){return this.Yf.tc(t,i),r.resolve()},vi.prototype.Zo=function(n,t,i){this.Yf.sc(t,i);var u=this.persistence.oo,f=[];return u&&t.forEach(function(t){f.push(u.So(n,t))}),r.vn(f)},vi.prototype.Ko=function(n,t){return this.Yf.ic(t),r.resolve()},vi.prototype.ea=function(n,t){var i=this.Yf.rc(t);return r.resolve(i)},vi.prototype.Co=function(n,t){return r.resolve(this.Yf.Co(t))},vi),lyt=(rf.prototype.start=function(){return Promise.resolve()},rf.prototype.hu=function(){return this.Da=!1,Promise.resolve()},Object.defineProperty(rf.prototype,"vh",{get:function(){return this.Da},enumerable:!0,configurable:!0}),rf.prototype.Ga=function(){},rf.prototype.Tu=function(){return this.jn},rf.prototype.lu=function(n){var t=this.Xf[n.s()];return t||(t=new hyt(this.jn,this.oo),this.Xf[n.s()]=t),t},rf.prototype.du=function(){return this.Oa},rf.prototype.fu=function(){return this.Qn},rf.prototype.runTransaction=function(n,t,i){var u=this,r;return e("MemoryPersistence","Starting transaction:",n),r=new ayt(this.ja.next()),this.oo.tT(),i(r).next(function(n){return u.oo.eT(r).next(function(){return n})}).yn().then(function(n){return r.Un(),n})},rf.prototype.sT=function(n,t){return r.Sn(Object.values(this.Xf).map(function(i){return function(){return i.Co(n,t)}}))},rf),ayt=(k(wht,pht=yet),wht),vyt=(iu.rT=function(n){return new iu(n)},Object.defineProperty(iu.prototype,"hT",{get:function(){if(this.nT)return this.nT;throw o();},enumerable:!0,configurable:!0}),iu.prototype.Xo=function(n,t,i){return this.iT.Xo(i,t),this.hT.delete(i),r.resolve()},iu.prototype.ta=function(n,t,i){return this.iT.ta(i,t),this.hT.add(i),r.resolve()},iu.prototype.So=function(n,t){return this.hT.add(t),r.resolve()},iu.prototype.removeTarget=function(n,t){var r=this,i;return this.iT.ic(t.targetId).forEach(function(n){return r.hT.add(n)}),i=this.persistence.du(),i.ea(n,t.targetId).next(function(n){n.forEach(function(n){return r.hT.add(n)})}).next(function(){return i.jo(n,t)})},iu.prototype.tT=function(){this.nT=new Set},iu.prototype.eT=function(n){var t=this,i=this.persistence.fu().Ea();return r.forEach(this.hT,function(r){return t.oT(n,r).next(function(n){n||i.$n(r)})}).next(function(){return t.nT=null,i.apply(n)})},iu.prototype.mu=function(n,t){var i=this;return this.oT(n,t).next(function(n){n?i.hT.delete(t):i.hT.add(t)})},iu.prototype.Zf=function(){return 0},iu.prototype.oT=function(n,t){var i=this;return r.Sn([function(){return r.resolve(i.iT.Co(t))},function(){return i.persistence.du().Co(n,t)},function(){return i.persistence.sT(n,t)}])},iu),uw=(vf.prototype.initialize=function(n){return f(this,void 0,void 0,function(){var t=this;return u(this,function(i){switch(i.label){case 0:return this.qd=this.aT(n),this.persistence=this.uT(n),[4,this.persistence.start()];case 1:return i.sent(),this.cT=this._T(n),this.F_=this.lT(n),this.Nd=this.dT(n),this.hl=this.fT(n),this.TT=this.ET(n),this.qd.V_=function(n){return t.hl.Sd(n,1)},this.Nd.hl=this.hl,[4,this.F_.start()];case 2:return i.sent(),[4,this.qd.start()];case 3:return i.sent(),[4,this.Nd.start()];case 4:return i.sent(),[4,this.Nd.Pl(this.hl.Zd)];case 5:return i.sent(),[2]}})})},vf.prototype.ET=function(){return new oyt(this.hl)},vf.prototype._T=function(){return null},vf.prototype.lT=function(n){return new vp(this.persistence,new vht,n.IT)},vf.prototype.uT=function(){return new lyt(vyt.rT)},vf.prototype.dT=function(n){var t=this;return new nyt(this.F_,n.f_,n.br,function(n){return t.hl.Sd(n,0)},n.platform.wT())},vf.prototype.aT=function(){return new cht},vf.prototype.fT=function(n){return new aht(this.F_,this.Nd,this.qd,n.IT,n.Ud)},vf.prototype.clearPersistence=function(){throw new i(t.FAILED_PRECONDITION,"You are using the memory-only build of Firestore. Persistence support is only available via the @firebase/firestore bundle or the firebase-firestore.js build.");},vf),yyt=(k(ae,rw=uw),ae.prototype.initialize=function(n){return f(this,void 0,void 0,function(){var t=this;return u(this,function(i){switch(i.label){case 0:return[4,rw.prototype.initialize.call(this,n)];case 1:return i.sent(),[4,this.persistence.Ka(function(n){return f(t,void 0,void 0,function(){return u(this,function(t){switch(t.label){case 0:return[4,this.hl.Pl(n)];case 1:return t.sent(),this.cT&&(n&&!this.cT.vh?this.cT.start(this.F_):n||this.cT.stop()),[2]}})})})];case 2:return i.sent(),[2]}})})},ae.prototype.lT=function(n){return new got(this.persistence,new vht,n.IT)},ae.prototype.fT=function(n){var t=new eyt(this.F_,this.Nd,this.qd,n.IT,n.Ud);return this.qd instanceof hn&&(this.qd.hl=t),t},ae.prototype._T=function(n){var t=this.persistence.oo.Vh;return new ket(t,n.br)},ae.prototype.uT=function(n){var t=sr.Iu(n.RT),i=n.platform.yc(n.RT.ii);return new sr(n.AT.synchronizeTabs,t,n.clientId,n.platform,ii.Eh(n.AT.cacheSizeBytes),n.br,i,this.qd)},ae.prototype.aT=function(n){if(n.AT.mT&&n.AT.synchronizeTabs){if(!hn.Uh(n.platform))throw new i(t.UNIMPLEMENTED,"IndexedDB persistence is only available on platforms that support LocalStorage.");var r=sr.Iu(n.RT);return new hn(n.br,n.platform,r,n.clientId,n.IT)}return new cht},ae.prototype.clearPersistence=function(n){var t=sr.Iu(n);return sr.clearPersistence(t)},ae),pyt=(ri.prototype.start=function(n,t){var i=this;this.PT();var r=new re,u=new re,f=!1;return this.credentials.l(function(o){if(!f)return f=!0,e("FirestoreClient","Initializing. user=",o.uid),i.VT(n,t,o,u).then(r.resolve,r.reject);i.br.$r(function(){return i.ml(o)})}),this.br.$r(function(){return r.promise}),u.promise},ri.prototype.enableNetwork=function(){var n=this;return this.PT(),this.br.enqueue(function(){return n.hl.enableNetwork()})},ri.prototype.VT=function(n,t,i,r){return f(this,void 0,void 0,function(){var o,s,h,e,c=this;return u(this,function(l){switch(l.label){case 0:return l.trys.push([0,3,,4]),[4,this.platform.gT(this.RT)];case 1:return o=l.sent(),s=this.platform.yc(this.RT.ii),a=o,v=this.credentials,h=new kvt(a,v,s),[4,n.initialize({br:this.br,RT:this.RT,platform:this.platform,f_:h,clientId:this.clientId,IT:i,Ud:100,AT:t})];case 2:return l.sent(),this.persistence=n.persistence,this.qd=n.qd,this.F_=n.F_,this.Nd=n.Nd,this.hl=n.hl,this.cT=n.cT,this.pT=n.TT,this.persistence.Ga(function(){return f(c,void 0,void 0,function(){return u(this,function(n){switch(n.label){case 0:return[4,this.terminate()];case 1:return n.sent(),[2]}})})}),r.resolve(),[3,4];case 3:if(e=l.sent(),r.reject(e),!this.yT(e))throw e;return[2,(console.warn("Error enabling offline persistence. Falling back to persistence disabled: "+e),this.VT(new uw,{mT:!1},i,r))];case 4:return[2]}var a,v})})},ri.prototype.yT=function(n){return"FirebaseError"===n.name?n.code===t.FAILED_PRECONDITION||n.code===t.UNIMPLEMENTED:!("undefined"!=typeof DOMException&&n instanceof DOMException)||22===n.code||20===n.code||11===n.code},ri.prototype.PT=function(){if(this.br.Kr)throw new i(t.FAILED_PRECONDITION,"The client has already been terminated.");},ri.prototype.ml=function(n){return this.br.th(),e("FirestoreClient","Credential Changed. Current user: "+n.uid),this.hl.ml(n)},ri.prototype.disableNetwork=function(){var n=this;return this.PT(),this.br.enqueue(function(){return n.hl.disableNetwork()})},ri.prototype.terminate=function(){var n=this;return this.br.Jr(function(){return f(n,void 0,void 0,function(){return u(this,function(n){switch(n.label){case 0:return this.cT&&this.cT.stop(),[4,this.Nd.hu()];case 1:return n.sent(),[4,this.qd.hu()];case 2:return n.sent(),[4,this.persistence.hu()];case 3:return n.sent(),this.credentials.T(),[2]}})})})},ri.prototype.waitForPendingWrites=function(){var t=this,n;return this.PT(),n=new re,this.br.$r(function(){return t.hl._f(n)}),n.promise},ri.prototype.listen=function(n,t,i){var u=this,r;return this.PT(),r=new syt(n,t,i),this.br.$r(function(){return u.pT.listen(r)}),r},ri.prototype.nl=function(n){var t=this;this.bT||this.br.$r(function(){return t.pT.nl(n)})},ri.prototype.vT=function(n){var r=this;return this.PT(),this.br.enqueue(function(){return r.F_.qu(n)}).then(function(n){if(n instanceof it)return n;if(n instanceof hi)return null;throw new i(t.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.)");})},ri.prototype.ST=function(n){var t=this;return this.PT(),this.br.enqueue(function(){return f(t,void 0,void 0,function(){var t,i,r;return u(this,function(u){switch(u.label){case 0:return[4,this.F_.Wu(n,!0)];case 1:return t=u.sent(),i=new lht(n,t.ju),r=i.Pd(t.documents),[2,i.xn(r,!1).snapshot]}})})})},ri.prototype.write=function(n){var i=this,t;return this.PT(),t=new re,this.br.$r(function(){return i.hl.write(n,t)}),t.promise},ri.prototype.ii=function(){return this.RT.ii},ri.prototype.vf=function(n){var t=this;this.PT();this.br.$r(function(){return t.pT.vf(n),Promise.resolve()})},ri.prototype.Sf=function(n){this.bT||this.pT.Sf(n)},Object.defineProperty(ri.prototype,"bT",{get:function(){return this.br.Kr},enumerable:!0,configurable:!0}),ri.prototype.transaction=function(n){var i=this,t;return this.PT(),t=new re,this.br.$r(function(){return i.hl.runTransaction(i.br,n,t),Promise.resolve()}),t.promise},ri),an=(ya.prototype.next=function(n){this.DT(this.observer.next,n)},ya.prototype.error=function(n){this.DT(this.observer.error,n)},ya.prototype.CT=function(){this.muted=!0},ya.prototype.DT=function(n,t){var i=this;this.muted||setTimeout(function(){i.muted||n(t)},0)},ya);var bht,fw,kht=(lo.prototype.NT=function(n){switch(no(n)){case 0:return null;case 1:return n.booleanValue;case 2:return ni(n.integerValue||n.doubleValue);case 3:return this.kT(n.timestampValue);case 4:return this.$T(n);case 5:return n.stringValue;case 6:return new ea(lh(n.bytesValue));case 7:return this.MT(n.referenceValue);case 8:return this.LT(n.geoPointValue);case 9:return this.OT(n.arrayValue);case 10:return this.xT(n.mapValue);default:throw o();}},lo.prototype.xT=function(n){var i=this,t={};return ch(n.fields||{},function(n,r){t[n]=i.NT(r)}),t},lo.prototype.LT=function(n){return new pp(ni(n.latitude),ni(n.longitude))},lo.prototype.OT=function(n){var t=this;return(n.values||[]).map(function(n){return t.NT(n)})},lo.prototype.$T=function(n){switch(this.FT){case"previous":var t=function n(t){var i=t.mapValue.fields.__previous_value__;return kk(i)?n(i):i}(n);return null==t?null:this.NT(t);case"estimate":return this.kT(hl(n));default:return null}},lo.prototype.kT=function(n){var t=to(n),i=new ar(t.seconds,t.nanos);return this.timestampsInSnapshots?i:i.toDate()},lo.prototype.MT=function(n){var t=ot.K(n),i,r;return c(oet(t)),i=new fg(t.get(1),t.get(3)),r=new l(t.$(5)),i.isEqual(this.firestore.Nc)||lt("Document "+r+" contains a document reference within a different database ("+i.projectId+"/"+i.database+") which is not supported. It will be treated as a reference in the current database ("+this.firestore.Nc.projectId+"/"+this.firestore.Nc.database+") instead."),new yf(r,this.firestore,this.converter)},lo),dht=ii.Rh,ght=(uct.prototype.isEqual=function(n){return this.host===n.host&&this.ssl===n.ssl&&this.timestampsInSnapshots===n.timestampsInSnapshots&&this.credentials===n.credentials&&this.cacheSizeBytes===n.cacheSizeBytes&&this.forceLongPolling===n.forceLongPolling},uct),vn=(st.prototype.settings=function(n){ht("Firestore.settings",arguments,1);kt("Firestore.settings","object",1,n);var r=new ght(n);if(this.QT&&!this.zT.isEqual(r))throw new i(t.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.");void 0!==(this.zT=r).credentials&&(this.KT=function(n){if(!n)return new eut;switch(n.type){case"gapi":var r=n.YT;return c(!("object"!=typeof r||null===r||!r.auth||!r.auth.getAuthHeaderValueForFirstParty)),new rat(r,n.V||"0");case"provider":return n.YT;default:throw new i(t.INVALID_ARGUMENT,"makeCredentialsProvider failed due to invalid credential type");}}(r.credentials))},st.prototype.enableNetwork=function(){return this.UT(),this.QT.enableNetwork()},st.prototype.disableNetwork=function(){return this.UT(),this.QT.disableNetwork()},st.prototype.enablePersistence=function(n){var r,u,f;if(this.QT)throw new i(t.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 f=!1,n&&(void 0!==n.experimentalTabSynchronization&&lt("The 'experimentalTabSynchronization' setting will be removed. Use 'synchronizeTabs' instead."),f=null!==(u=null!==(r=n.synchronizeTabs)&&void 0!==r?r:n.experimentalTabSynchronization)&&void 0!==u&&u),this.JT(this.GT,{mT:!0,cacheSizeBytes:this.zT.cacheSizeBytes,synchronizeTabs:f})},st.prototype.clearPersistence=function(){return f(this,void 0,void 0,function(){var n,r=this;return u(this,function(){if(void 0!==this.QT&&!this.QT.bT)throw new i(t.FAILED_PRECONDITION,"Persistence cannot be cleared after this Firestore instance is initialized.");return n=new re,[2,(this.qT.Gr(function(){return f(r,void 0,void 0,function(){var t,i;return u(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),t=this.XT(),[4,this.GT.clearPersistence(t)];case 1:return r.sent(),n.resolve(),[3,3];case 2:return i=r.sent(),n.reject(i),[3,3];case 3:return[2]}})})}),n.promise)]})})},st.prototype.terminate=function(){return this.app._removeServiceInstance("firestore"),this.INTERNAL.delete()},Object.defineProperty(st.prototype,"ZT",{get:function(){return this.UT(),this.QT.bT},enumerable:!0,configurable:!0}),st.prototype.waitForPendingWrites=function(){return this.UT(),this.QT.waitForPendingWrites()},st.prototype.onSnapshotsInSync=function(n){if(this.UT(),pa(n))return this.tE(n);kt("Firestore.onSnapshotsInSync","function",1,n);var t={next:n};return this.tE(t)},st.prototype.tE=function(n){var i=this,t=new an({next:function(){n.next&&n.next()},error:function(){throw o();}});return this.QT.vf(t),function(){t.CT();i.QT.Sf(t)}},st.prototype.UT=function(){return this.QT||this.JT(new uw,{mT:!1}),this.QT},st.prototype.XT=function(){return new wat(this.Nc,this.jT,this.zT.host,this.zT.ssl,this.zT.forceLongPolling)},st.prototype.JT=function(n,t){var i=this.XT();return this.QT=new pyt(vu.nt(),i,this.KT,this.qT),this.QT.start(n,t)},st.WT=function(n){if(u=n.options,!Object.prototype.hasOwnProperty.call(u,"projectId"))throw new i(t.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');var u,r=n.options.projectId;if(!r||"string"!=typeof r)throw new i(t.INVALID_ARGUMENT,"projectId must be a string in FirebaseApp.options");return new fg(r)},Object.defineProperty(st.prototype,"app",{get:function(){if(!this.BT)throw new i(t.FAILED_PRECONDITION,"Firestore was not initialized using the Firebase SDK. 'app' is not available");return this.BT},enumerable:!0,configurable:!0}),st.prototype.collection=function(n){return ht("Firestore.collection",arguments,1),kt("Firestore.collection","non-empty string",1,n),this.UT(),new ow(ot.K(n),this)},st.prototype.doc=function(n){return ht("Firestore.doc",arguments,1),kt("Firestore.doc","non-empty string",1,n),this.UT(),yf.eE(ot.K(n),this)},st.prototype.collectionGroup=function(n){if(ht("Firestore.collectionGroup",arguments,1),kt("Firestore.collectionGroup","non-empty string",1,n),0<=n.indexOf("/"))throw new i(t.INVALID_ARGUMENT,"Invalid collection ID '"+n+"' passed to function Firestore.collectionGroup(). Collection IDs must not contain '/'.");return this.UT(),new ew(new us(ot.G,n),this)},st.prototype.runTransaction=function(n){var t=this;return ht("Firestore.runTransaction",arguments,1),kt("Firestore.runTransaction","function",1,n),this.UT().transaction(function(i){return n(new nct(t,i))})},st.prototype.batch=function(){return this.UT(),new tct(this)},Object.defineProperty(st,"logLevel",{get:function(){switch(ip()){case d.DEBUG:return"debug";case d.SILENT:return"silent";default:return"error"}},enumerable:!0,configurable:!0}),st.setLogLevel=function(n){switch(ht("Firestore.setLogLevel",arguments,1),kt("Firestore.setLogLevel","non-empty string",1,n),n){case"debug":rg(d.DEBUG);break;case"error":rg(d.ERROR);break;case"silent":rg(d.SILENT);break;default:throw new i(t.INVALID_ARGUMENT,"Invalid log level: "+n);}},st.prototype.sE=function(){return this.zT.timestampsInSnapshots},st),nct=(ba.prototype.get=function(n){var i=this,t;return ht("Transaction.get",arguments,1),t=pe("Transaction.get",n,this.iE),this.nE.R_([t.kc]).then(function(n){if(!n||1!==n.length)return o();var r=n[0];if(r instanceof hi)return new ds(i.iE,t.kc,null,!1,!1,t.rE);if(r instanceof it)return new ds(i.iE,t.kc,r,!1,!1,t.rE);throw o();})},ba.prototype.set=function(n,t,i){var r;ou("Transaction.set",arguments,2,3);r=pe("Transaction.set",n,this.iE);i=wn("Transaction.set",i);var u=bn(r.rE,t,"Transaction.set"),f=u[0],e=u[1],o=i.merge||i.mergeFields?this.iE.HT.Sc(e,f,i.mergeFields):this.iE.HT.bc(e,f);return this.nE.set(r.kc,o),this},ba.prototype.update=function(n,t,i){for(var u,f,e=[],r=3;r<arguments.length;r++)e[r-3]=arguments[r];return f="string"==typeof t||t instanceof su?(oe("Transaction.update",arguments,3),u=pe("Transaction.update",n,this.iE),this.iE.HT.Cc("Transaction.update",t,i,e)):(ht("Transaction.update",arguments,2),u=pe("Transaction.update",n,this.iE),this.iE.HT.Dc("Transaction.update",t)),this.nE.update(u.kc,f),this},ba.prototype.delete=function(n){ht("Transaction.delete",arguments,1);var t=pe("Transaction.delete",n,this.iE);return this.nE.delete(t.kc),this},ba),tct=(vc.prototype.set=function(n,t,i){var r;ou("WriteBatch.set",arguments,2,3);this.aE();r=pe("WriteBatch.set",n,this.iE);i=wn("WriteBatch.set",i);var u=bn(r.rE,t,"WriteBatch.set"),f=u[0],e=u[1],o=i.merge||i.mergeFields?this.iE.HT.Sc(e,f,i.mergeFields):this.iE.HT.bc(e,f);return this.hE=this.hE.concat(o.Rc(r.kc,tr.ft())),this},vc.prototype.update=function(n,t,i){for(var u,f,e=[],r=3;r<arguments.length;r++)e[r-3]=arguments[r];return this.aE(),f="string"==typeof t||t instanceof su?(oe("WriteBatch.update",arguments,3),u=pe("WriteBatch.update",n,this.iE),this.iE.HT.Cc("WriteBatch.update",t,i,e)):(ht("WriteBatch.update",arguments,2),u=pe("WriteBatch.update",n,this.iE),this.iE.HT.Dc("WriteBatch.update",t)),this.hE=this.hE.concat(f.Rc(u.kc,tr.exists(!0))),this},vc.prototype.delete=function(n){ht("WriteBatch.delete",arguments,1);this.aE();var t=pe("WriteBatch.delete",n,this.iE);return this.hE=this.hE.concat(new al(t.kc,tr.ft())),this},vc.prototype.commit=function(){return this.aE(),this.oE=!0,0<this.hE.length?this.iE.UT().write(this.hE):Promise.resolve()},vc.prototype.aE=function(){if(this.oE)throw new i(t.FAILED_PRECONDITION,"A write batch can no longer be used after commit() has been called.");},vc),yf=(yi.eE=function(n,r,u){if(n.length%2!=0)throw new i(t.INVALID_ARGUMENT,"Invalid document reference. Document references must have an even number of segments, but "+n.j()+" has "+n.length);return new yi(new l(n),r,u)},Object.defineProperty(yi.prototype,"id",{get:function(){return this.kc.path.O()},enumerable:!0,configurable:!0}),Object.defineProperty(yi.prototype,"parent",{get:function(){return new ow(this.kc.path.M(),this.firestore,this.rE)},enumerable:!0,configurable:!0}),Object.defineProperty(yi.prototype,"path",{get:function(){return this.kc.path.j()},enumerable:!0,configurable:!0}),yi.prototype.collection=function(n){if(ht("DocumentReference.collection",arguments,1),kt("DocumentReference.collection","non-empty string",1,n),!n)throw new i(t.INVALID_ARGUMENT,"Must provide a non-empty collection name to collection()");var r=ot.K(n);return new ow(this.kc.path.child(r),this.firestore)},yi.prototype.isEqual=function(n){if(!(n instanceof yi))throw ys("isEqual","DocumentReference",1,n);return this.firestore===n.firestore&&this.kc.isEqual(n.kc)&&this.rE===n.rE},yi.prototype.set=function(n,t){ou("DocumentReference.set",arguments,1,2);t=wn("DocumentReference.set",t);var i=bn(this.rE,n,"DocumentReference.set"),r=i[0],u=i[1],f=t.merge||t.mergeFields?this.firestore.HT.Sc(u,r,t.mergeFields):this.firestore.HT.bc(u,r);return this.QT.write(f.Rc(this.kc,tr.ft()))},yi.prototype.update=function(n,t){for(var r,u=[],i=2;i<arguments.length;i++)u[i-2]=arguments[i];return r="string"==typeof n||n instanceof su?(oe("DocumentReference.update",arguments,2),this.firestore.HT.Cc("DocumentReference.update",n,t,u)):(ht("DocumentReference.update",arguments,1),this.firestore.HT.Dc("DocumentReference.update",n)),this.QT.write(r.Rc(this.kc,tr.exists(!0)))},yi.prototype.delete=function(){return ht("DocumentReference.delete",arguments,0),this.QT.write([new al(this.kc,tr.ft())])},yi.prototype.onSnapshot=function(){for(var u,r,n,f,t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return ou("DocumentReference.onSnapshot",arguments,1,4),r={includeMetadataChanges:!1},n=0,"object"!=typeof t[n]||pa(t[n])||(vs("DocumentReference.onSnapshot",r=t[n],["includeMetadataChanges"]),se("DocumentReference.onSnapshot","boolean","includeMetadataChanges",r.includeMetadataChanges),n++),f={includeMetadataChanges:r.includeMetadataChanges},u=pa(t[n])?t[n]:(kt("DocumentReference.onSnapshot","function",n,t[n]),oc("DocumentReference.onSnapshot","function",n+1,t[n+1]),oc("DocumentReference.onSnapshot","function",n+2,t[n+2]),{next:t[n],error:t[n+1],complete:t[n+2]}),this.uE(f,u)},yi.prototype.uE=function(n,t){var i=this,u=function(n){console.error("Uncaught Error in onSnapshot:",n)},r,f;return t.error&&(u=t.error.bind(t)),r=new an({next:function(n){if(t.next){var r=n.docs.get(i.kc);t.next(new ds(i.firestore,i.kc,r,n.fromCache,n.hasPendingWrites,i.rE))}},error:u}),f=this.QT.listen(us.Wt(this.kc.path),r,n),function(){r.CT();i.QT.nl(f)}},yi.prototype.get=function(n){var t=this;return ou("DocumentReference.get",arguments,0,1),ect("DocumentReference.get",n),new Promise(function(i,r){n&&"cache"===n.source?t.firestore.UT().vT(t.kc).then(function(n){i(new ds(t.firestore,t.kc,n,!0,n instanceof it&&n.At,t.rE))},r):t.cE(i,r,n)})},yi.prototype.cE=function(n,r,u){var f=this.uE({includeMetadataChanges:!0,Mf:!0},{next:function(e){f();!e.exists&&e.metadata.fromCache?r(new i(t.UNAVAILABLE,"Failed to get document because the client is offline.")):e.exists&&e.metadata.fromCache&&u&&"server"===u.source?r(new i(t.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.)')):n(e)},error:r})},yi.prototype.withConverter=function(n){return new yi(this.kc,this.firestore,n)},yi),ict=(rct.prototype.isEqual=function(n){return this.hasPendingWrites===n.hasPendingWrites&&this.fromCache===n.fromCache},rct),ds=(ye.prototype.data=function(n){if(ou("DocumentSnapshot.data",arguments,0,1),n=fct("DocumentSnapshot.data",n),this._E){if(this.rE){var t=new wa(this.iE,this.kc,this._E,this.lE,this.dE);return this.rE.fromFirestore(t,n)}return new kht(this.iE,this.iE.sE(),n.serverTimestamps,void 0).NT(this._E.Mt())}},ye.prototype.get=function(n,t){if(ou("DocumentSnapshot.get",arguments,1,2),t=fct("DocumentSnapshot.get",t),this._E){var i=this._E.data().field(aa("DocumentSnapshot.get",n));if(null!==i)return new kht(this.iE,this.iE.sE(),t.serverTimestamps,this.rE).NT(i)}},Object.defineProperty(ye.prototype,"id",{get:function(){return this.kc.path.O()},enumerable:!0,configurable:!0}),Object.defineProperty(ye.prototype,"ref",{get:function(){return new yf(this.kc,this.iE,this.rE)},enumerable:!0,configurable:!0}),Object.defineProperty(ye.prototype,"exists",{get:function(){return null!==this._E},enumerable:!0,configurable:!0}),Object.defineProperty(ye.prototype,"metadata",{get:function(){return new ict(this.dE,this.lE)},enumerable:!0,configurable:!0}),ye.prototype.isEqual=function(n){if(!(n instanceof ye))throw ys("isEqual","DocumentSnapshot",1,n);return this.iE===n.iE&&this.lE===n.lE&&this.kc.isEqual(n.kc)&&(null===this._E?null===n._E:this._E.isEqual(n._E))&&this.rE===n.rE},ye),wa=(k(pn,fw=ds),pn.prototype.data=function(n){return fw.prototype.data.call(this,n)},pn),ew=(tt.prototype.where=function(n,r,u){var e,f,o,a,h;if(ht("Query.where",arguments,3),fst("Query.where",3,u),f=function(n,r){if(!n.some(function(n){return n===r}))throw new i(t.INVALID_ARGUMENT,"Invalid value "+lf(r)+" provided to function Query.where() for its "+fa(2)+" argument. Acceptable values: "+n.join(", "));return r}(["<","<=","==",">=",">","array-contains","in","array-contains-any"],r),o=aa("Query.where",n),o.Y()){if("array-contains"===f||"array-contains-any"===f)throw new i(t.INVALID_ARGUMENT,"Invalid Query. You can't perform '"+f+"' queries on FieldPath.documentId().");if("in"===f){this.TE(u,f);for(var c=[],s=0,l=u;s<l.length;s++)a=l[s],c.push(this.EE(a));e={arrayValue:{values:c}}}else e=this.EE(u)}else"in"!==f&&"array-contains-any"!==f||this.TE(u,f),e=this.firestore.HT.Fc("Query.where",u,"in"===f);return h=kr.create(o,f,e),this.IE(h),new tt(this.fE.Gt(h),this.firestore,this.rE)},tt.prototype.orderBy=function(n,r){var u,e,f;if(ou("Query.orderBy",arguments,1,2),oc("Query.orderBy","non-empty string",2,r),void 0===r||"asc"===r)u="asc";else{if("desc"!==r)throw new i(t.INVALID_ARGUMENT,"Function Query.orderBy() has unknown direction '"+r+"', expected 'asc' or 'desc'.");u="desc"}if(null!==this.fE.startAt)throw new i(t.INVALID_ARGUMENT,"Invalid query. You must not call Query.startAt() or Query.startAfter() before calling Query.orderBy().");if(null!==this.fE.endAt)throw new i(t.INVALID_ARGUMENT,"Invalid query. You must not call Query.endAt() or Query.endBefore() before calling Query.orderBy().");return e=aa("Query.orderBy",n),f=new bh(e,u),this.wE(f),new tt(this.fE.zt(f),this.firestore,this.rE)},tt.prototype.limit=function(n){return ht("Query.limit",arguments,1),kt("Query.limit","number",1,n),est("Query.limit",1,n),new tt(this.fE.Ht(n),this.firestore,this.rE)},tt.prototype.limitToLast=function(n){return ht("Query.limitToLast",arguments,1),kt("Query.limitToLast","number",1,n),est("Query.limitToLast",1,n),new tt(this.fE.Yt(n),this.firestore,this.rE)},tt.prototype.startAt=function(n){for(var r,i=[],t=1;t<arguments.length;t++)i[t-1]=arguments[t];return oe("Query.startAt",arguments,1),r=this.RE("Query.startAt",n,i,!0),new tt(this.fE.Jt(r),this.firestore,this.rE)},tt.prototype.startAfter=function(n){for(var r,i=[],t=1;t<arguments.length;t++)i[t-1]=arguments[t];return oe("Query.startAfter",arguments,1),r=this.RE("Query.startAfter",n,i,!1),new tt(this.fE.Jt(r),this.firestore,this.rE)},tt.prototype.endBefore=function(n){for(var r,i=[],t=1;t<arguments.length;t++)i[t-1]=arguments[t];return oe("Query.endBefore",arguments,1),r=this.RE("Query.endBefore",n,i,!0),new tt(this.fE.Xt(r),this.firestore,this.rE)},tt.prototype.endAt=function(n){for(var r,i=[],t=1;t<arguments.length;t++)i[t-1]=arguments[t];return oe("Query.endAt",arguments,1),r=this.RE("Query.endAt",n,i,!1),new tt(this.fE.Xt(r),this.firestore,this.rE)},tt.prototype.isEqual=function(n){if(!(n instanceof tt))throw ys("isEqual","Query",1,n);return this.firestore===n.firestore&&this.fE.isEqual(n.fE)},tt.prototype.withConverter=function(n){return new tt(this.fE,this.firestore,n)},tt.prototype.RE=function(n,r,u,f){var e,o;if(fst(n,1,r),r instanceof ds){if(0<u.length)throw new i(t.INVALID_ARGUMENT,"Too many arguments provided to "+n+"().");if(e=r,!e.exists)throw new i(t.NOT_FOUND,"Can't use a DocumentSnapshot that doesn't exist for "+n+"().");return this.AE(e._E,f)}return o=[r].concat(u),this.mE(n,o,f)},tt.prototype.AE=function(n,r){for(var u,f,h,e=[],o=0,s=this.fE.orderBy;o<s.length;o++)if(u=s[o],u.field.Y())e.push(ay(this.firestore.Nc,n.key));else{if(f=n.field(u.field),kk(f))throw new i(t.INVALID_ARGUMENT,'Invalid query. You are trying to start or end a query using a document for which the field "'+u.field+'" is an uncommitted server timestamp. (Since the value of this field is unknown, you cannot start/end a query with it.)');if(null===f){h=u.field.j();throw new i(t.INVALID_ARGUMENT,"Invalid query. You are trying to start or end a query using a document for which the field '"+h+"' (used as the orderBy) does not exist.");}e.push(f)}return new pl(e,r)},tt.prototype.mE=function(n,r,u){var h=this.fE.xt,o,e,f,s,c,a;if(r.length>h.length)throw new i(t.INVALID_ARGUMENT,"Too many arguments provided to "+n+"(). The number of arguments must be less than or equal to the number of Query.orderBy() clauses");for(o=[],e=0;e<r.length;e++)if(f=r[e],h[e].field.Y()){if("string"!=typeof f)throw new i(t.INVALID_ARGUMENT,"Invalid query. Expected a string for document ID in "+n+"(), but got a "+typeof f);if(!this.fE._e()&&-1!==f.indexOf("/"))throw new i(t.INVALID_ARGUMENT,"Invalid query. When querying a collection and ordering by FieldPath.documentId(), the value passed to "+n+"() must be a plain document ID, but '"+f+"' contains a slash.");if(s=this.fE.path.child(ot.K(f)),!l.et(s))throw new i(t.INVALID_ARGUMENT,"Invalid query. When querying a collection group and ordering by FieldPath.documentId(), the value passed to "+n+"() must result in a valid document path, but '"+s+"' is not because it contains an odd number of segments.");c=new l(s);o.push(ay(this.firestore.Nc,c))}else a=this.firestore.HT.Fc(n,f),o.push(a);return new pl(o,u)},tt.prototype.onSnapshot=function(){for(var u,r,n,t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return ou("Query.onSnapshot",arguments,1,4),r={},n=0,"object"!=typeof t[n]||pa(t[n])||(vs("Query.onSnapshot",r=t[n],["includeMetadataChanges"]),se("Query.onSnapshot","boolean","includeMetadataChanges",r.includeMetadataChanges),n++),u=pa(t[n])?t[n]:(kt("Query.onSnapshot","function",n,t[n]),oc("Query.onSnapshot","function",n+1,t[n+1]),oc("Query.onSnapshot","function",n+2,t[n+2]),{next:t[n],error:t[n+1],complete:t[n+2]}),this.PE(this.fE),this.uE(r,u)},tt.prototype.uE=function(n,t){var i=this,r=function(n){console.error("Uncaught Error in onSnapshot:",n)};t.error&&(r=t.error.bind(t));var u=new an({next:function(n){t.next&&t.next(new yn(i.firestore,i.fE,n,i.rE))},error:r}),f=this.firestore.UT(),e=f.listen(this.fE,u,n);return function(){u.CT();f.nl(e)}},tt.prototype.PE=function(n){if(n.ae()&&0===n.xt.length)throw new i(t.UNIMPLEMENTED,"limitToLast() queries require specifying at least one orderBy() clause");},tt.prototype.get=function(n){var t=this;return ou("Query.get",arguments,0,1),ect("Query.get",n),this.PE(this.fE),new Promise(function(i,r){n&&"cache"===n.source?t.firestore.UT().ST(t.fE).then(function(n){i(new yn(t.firestore,t.fE,n,t.rE))},r):t.cE(i,r,n)})},tt.prototype.cE=function(n,r,u){var f=this.uE({includeMetadataChanges:!0,Mf:!0},{next:function(e){f();e.metadata.fromCache&&u&&"server"===u.source?r(new i(t.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.)')):n(e)},error:r})},tt.prototype.EE=function(n){var r,u;if("string"==typeof n){if(""===n)throw new i(t.INVALID_ARGUMENT,"Invalid query. When querying with FieldPath.documentId(), you must provide a valid document ID, but it was an empty string.");if(!this.fE._e()&&-1!==n.indexOf("/"))throw new i(t.INVALID_ARGUMENT,"Invalid query. When querying a collection by FieldPath.documentId(), you must provide a plain document ID, but '"+n+"' contains a '/' character.");if(r=this.fE.path.child(ot.K(n)),!l.et(r))throw new i(t.INVALID_ARGUMENT,"Invalid query. When querying a collection group by FieldPath.documentId(), the value provided must result in a valid document path, but '"+r+"' is not because it has an odd number of segments ("+r.length+").");return ay(this.firestore.Nc,new l(r))}if(n instanceof yf)return u=n,ay(this.firestore.Nc,u.kc);throw new i(t.INVALID_ARGUMENT,"Invalid query. When querying with FieldPath.documentId(), you must provide a valid string or a DocumentReference, but it was: "+lf(n)+".");},tt.prototype.TE=function(n,r){if(!Array.isArray(n)||0===n.length)throw new i(t.INVALID_ARGUMENT,"Invalid Query. A non-empty array is required for '"+r.toString()+"' filters.");if(10<n.length)throw new i(t.INVALID_ARGUMENT,"Invalid Query. '"+r.toString()+"' filters support a maximum of 10 elements in the value array.");if(0<=n.indexOf(null))throw new i(t.INVALID_ARGUMENT,"Invalid Query. '"+r.toString()+"' filters cannot contain 'null' in the value array.");if(0<n.filter(function(n){return Number.isNaN(n)}).length)throw new i(t.INVALID_ARGUMENT,"Invalid Query. '"+r.toString()+"' filters cannot contain 'NaN' in the value array.");},tt.prototype.IE=function(n){var u,f,r;if(n instanceof kr){var e=["array-contains","array-contains-any"],o=["in","array-contains-any"],s=0<=e.indexOf(n.op),h=0<=o.indexOf(n.op);if(n.ue()){if(u=this.fE.jt(),null!==u&&!u.isEqual(n.field))throw new i(t.INVALID_ARGUMENT,"Invalid query. All where filters with an inequality (<, <=, >, or >=) must be on the same field. But you have inequality filters on '"+u.toString()+"' and '"+n.field.toString()+"'");f=this.fE.Kt();null!==f&&this.VE(n.field,f)}else if((h||s)&&(r=null,h&&(r=this.fE.ce(o)),null===r&&s&&(r=this.fE.ce(e)),null!=r))throw r===n.op?new i(t.INVALID_ARGUMENT,"Invalid query. You cannot use more than one '"+n.op.toString()+"' filter."):new i(t.INVALID_ARGUMENT,"Invalid query. You cannot use '"+n.op.toString()+"' filters with '"+r.toString()+"' filters.");}},tt.prototype.wE=function(n){if(null===this.fE.Kt()){var t=this.fE.jt();null!==t&&this.VE(t,n.field)}},tt.prototype.VE=function(n,r){if(!r.isEqual(n))throw new i(t.INVALID_ARGUMENT,"Invalid query. You have a where filter with an inequality (<, <=, >, or >=) on field '"+n.toString()+"' and so you must also use '"+n.toString()+"' as your first Query.orderBy(), but your first Query.orderBy() is on field '"+r.toString()+"' instead.");},tt),yn=(Object.defineProperty(pf.prototype,"docs",{get:function(){var n=[];return this.forEach(function(t){return n.push(t)}),n},enumerable:!0,configurable:!0}),Object.defineProperty(pf.prototype,"empty",{get:function(){return this.pE.docs.B()},enumerable:!0,configurable:!0}),Object.defineProperty(pf.prototype,"size",{get:function(){return this.pE.docs.size},enumerable:!0,configurable:!0}),pf.prototype.forEach=function(n,t){var i=this;ou("QuerySnapshot.forEach",arguments,1,2);kt("QuerySnapshot.forEach","function",1,n);this.pE.docs.forEach(function(r){n.call(t,i.vE(r))})},Object.defineProperty(pf.prototype,"query",{get:function(){return new ew(this.gE,this.iE,this.rE)},enumerable:!0,configurable:!0}),pf.prototype.docChanges=function(n){n&&(vs("QuerySnapshot.docChanges",n,["includeMetadataChanges"]),se("QuerySnapshot.docChanges","boolean","includeMetadataChanges",n.includeMetadataChanges));var r=!(!n||!n.includeMetadataChanges);if(r&&this.pE.hs)throw new i(t.INVALID_ARGUMENT,"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");return this.yE&&this.bE===r||(this.yE=function(n,t,i,r){var f,u;return i.ss.B()?(f=0,i.docChanges.map(function(t){var u=new wa(n,t.doc.key,t.doc,i.fromCache,i.ns.has(t.doc.key),r);return t.doc,{type:"added",doc:u,oldIndex:-1,newIndex:f++}})):(u=i.ss,i.docChanges.filter(function(n){return t||3!==n.type}).map(function(t){var s=new wa(n,t.doc.key,t.doc,i.fromCache,i.ns.has(t.doc.key),r),f=-1,e=-1;return 0!==t.type&&(f=u.indexOf(t.doc.key),u=u.delete(t.doc.key)),1!==t.type&&(e=(u=u.add(t.doc)).indexOf(t.doc.key)),{type:function(n){switch(n){case 0:return"added";case 2:case 3:return"modified";case 1:return"removed";default:return o()}}(t.type),doc:s,oldIndex:f,newIndex:e}}))}(this.iE,r,this.pE,this.rE),this.bE=r),this.yE},pf.prototype.isEqual=function(n){if(!(n instanceof pf))throw ys("isEqual","QuerySnapshot",1,n);return this.iE===n.iE&&this.gE.isEqual(n.gE)&&this.pE.isEqual(n.pE)&&this.rE===n.rE},pf.prototype.vE=function(n){return new wa(this.iE,n.key,n,this.metadata.fromCache,this.pE.ns.has(n.key),this.rE)},pf),ow=(k(ve,bht=ew),Object.defineProperty(ve.prototype,"id",{get:function(){return this.fE.path.O()},enumerable:!0,configurable:!0}),Object.defineProperty(ve.prototype,"parent",{get:function(){var n=this.fE.path.M();return n.B()?null:new yf(new l(n),this.firestore)},enumerable:!0,configurable:!0}),Object.defineProperty(ve.prototype,"path",{get:function(){return this.fE.path.j()},enumerable:!0,configurable:!0}),ve.prototype.doc=function(n){if(ou("CollectionReference.doc",arguments,0,1),0===arguments.length&&(n=ug.cn()),kt("CollectionReference.doc","non-empty string",1,n),""===n)throw new i(t.INVALID_ARGUMENT,"Document path must be a non-empty string");var r=ot.K(n);return yf.eE(this.fE.path.child(r),this.firestore,this.rE)},ve.prototype.add=function(n){ht("CollectionReference.add",arguments,1);kt("CollectionReference.add","object",1,this.rE?this.rE.toFirestore(n):n);var t=this.doc();return t.set(n).then(function(){return t})},ve.prototype.withConverter=function(n){return new ve(this.SE,this.firestore,n)},ve);var oct,wyt=uf(vn,"Use firebase.firestore() instead."),byt=uf(nct,"Use firebase.firestore().runTransaction() instead."),kyt=uf(tct,"Use firebase.firestore().batch() instead."),dyt=uf(yf,"Use firebase.firestore().doc() instead."),gyt=uf(ds),npt=uf(wa),tpt=uf(ew),ipt=uf(yn),rpt=uf(ow,"Use firebase.firestore().collection() instead."),upt=uf((nh.delete=function(){return nst("FieldValue.delete",arguments),new tn},nh.serverTimestamp=function(){return nst("FieldValue.serverTimestamp",arguments),new lvt},nh.arrayUnion=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return oe("FieldValue.arrayUnion",arguments,1),new avt(t)},nh.arrayRemove=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return oe("FieldValue.arrayRemove",arguments,1),new vvt(t)},nh.increment=function(n){return kt("FieldValue.increment","number",1,n),ht("FieldValue.increment",arguments,1),new yvt(n)},nh.prototype.isEqual=function(n){return this===n},nh),"Use FieldValue.<field>() instead."),fpt=uf(ea,"Use Blob.fromUint8Array() or Blob.fromBase64String() instead."),ept={Firestore:wyt,GeoPoint:pp,Timestamp:ar,Blob:fpt,Transaction:byt,WriteBatch:kyt,DocumentReference:dyt,DocumentSnapshot:gyt,Query:tpt,QueryDocumentSnapshot:npt,QuerySnapshot:ipt,CollectionReference:rpt,FieldPath:su,FieldValue:upt,setLogLevel:vn.setLogLevel,CACHE_SIZE_UNLIMITED:dht},opt=(kn.prototype.x_=function(){},kn.prototype.hu=function(){},kn),sct=(gs.prototype.x_=function(n){this.kE.push(n)},gs.prototype.hu=function(){window.removeEventListener("online",this.DE);window.removeEventListener("offline",this.FE)},gs.prototype.$E=function(){window.addEventListener("online",this.DE);window.addEventListener("offline",this.FE)},gs.prototype.CE=function(){e("ConnectivityMonitor","Network connectivity changed: AVAILABLE");for(var n=0,t=this.kE;n<t.length;n++)t[n](0)},gs.prototype.NE=function(){e("ConnectivityMonitor","Network connectivity changed: UNAVAILABLE");for(var n=0,t=this.kE;n<t.length;n++)t[n](1)},gs.Uh=function(){return"undefined"!=typeof window&&void 0!==window.addEventListener&&void 0!==window.removeEventListener},gs),spt=(we.prototype.t_=function(n){this.OE=n},we.prototype.Hc=function(n){this.xE=n},we.prototype.onMessage=function(n){this.BE=n},we.prototype.close=function(){this.LE()},we.prototype.send=function(n){this.ME(n)},we.prototype.qE=function(){this.OE()},we.prototype.UE=function(n){this.xE(n)},we.prototype.QE=function(n){this.BE(n)},we),hpt={BatchGetDocuments:"batchGet",Commit:"commit"},cpt="gl-js/ fire/"+hy,lpt=(yc.prototype.jE=function(n,t){if(t)for(var i in t.o)t.o.hasOwnProperty(i)&&(n[i]=t.o[i]);n["X-Goog-Api-Client"]=cpt},yc.prototype.l_=function(n,r,u){var s=this,f=this.KE(n);return new Promise(function(h,c){var l=new glt,a,v,y;l.listenOnce(dlt.COMPLETE,function(){var u,f,r,a,s;try{switch(l.getLastErrorCode()){case pk.NO_ERROR:u=l.getResponseJson();e("Connection","XHR received:",JSON.stringify(u));h(u);break;case pk.TIMEOUT:e("Connection",'RPC "'+n+'" timed out');c(new i(t.DEADLINE_EXCEEDED,"Request time out"));break;case pk.HTTP_ERROR:f=l.getStatus();(e("Connection",'RPC "'+n+'" failed with status:',f,"response text:",l.getResponseText()),0<f)?(r=l.getResponseJson().error,r&&r.status&&r.message?(a=(s=r.status.toLowerCase().replace("_","-"),0<=Object.values(t).indexOf(s)?s:t.UNKNOWN),c(new i(a,r.message))):c(new i(t.UNKNOWN,"Server responded with status "+l.getStatus()))):(e("Connection",'RPC "'+n+'" failed'),c(new i(t.UNAVAILABLE,"Connection failed.")));break;default:o()}}finally{e("Connection",'RPC "'+n+'" completed.')}});a=Object.assign({},r);delete a.database;v=JSON.stringify(a);e("Connection","XHR sending: ",f+" "+v);y={"Content-Type":"text/plain"};s.jE(y,u);l.send(f,"POST",v,y,15)})},yc.prototype.d_=function(n,t,i){return this.l_(n,t,i)},yc.prototype.e_=function(n,r){function h(n,t){o.listen(n,function(n){try{t(n)}catch(n){setTimeout(function(){throw n;},0)}})}var a,v,p=[this.WE,"/","google.firestore.v1.Firestore","/",n,"/channel"],w=klt(),s={httpSessionIdParam:"gsessionid",initMessageHeaders:{},messageUrlParams:{database:"projects/"+this.ii.projectId+"/databases/"+this.ii.database},sendRawJson:!0,supportsCrossDomainXhr:!0,internalChannelParams:{forwardChannelRequestTimeoutMs:6e5},forceLongPolling:this.forceLongPolling},l;this.jE(s.initMessageHeaders,r);"undefined"!=typeof window&&(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(ao())||"object"==typeof navigator&&"ReactNative"===navigator.product||0<=ao().indexOf("Electron/")||0<=(v=ao()).indexOf("MSIE ")||0<=v.indexOf("Trident/")||0<=ao().indexOf("MSAppHost/")||"object"==typeof(a="object"==typeof chrome?chrome.runtime:"object"==typeof browser?browser.runtime:void 0)&&void 0!==a.id||(s.httpHeadersOverwriteParam="$httpHeaders");l=p.join("");e("Connection","Creating WebChannel: "+l+" "+s);var o=w.createWebChannel(l,s),y=!1,u=!1,f=new spt({ME:function(n){u?e("Connection","Not sending because WebChannel is closed:",n):(y||(e("Connection","Opening WebChannel transport."),o.open(),y=!0),e("Connection","WebChannel sending:",n),o.send(n))},LE:function(){return o.close()}});return h(sy.EventType.OPEN,function(){u||e("Connection","WebChannel transport opened.")}),h(sy.EventType.CLOSE,function(){u||(u=!0,e("Connection","WebChannel transport closed"),f.UE())}),h(sy.EventType.ERROR,function(n){u||(u=!0,e("Connection","WebChannel transport errored:",n),f.UE(new i(t.UNAVAILABLE,"The operation could not be completed")))}),h(sy.EventType.MESSAGE,function(n){var h,r,s;if(!u)if(r=n.data[0],c(!!r),s=r.error||(null===(h=r[0])||void 0===h?void 0:h.error),s){e("Connection","WebChannel received error:",s);var a=s.status,l=function(){var n=ti[a];if(void 0!==n)return yft(n)}(),v=s.message;void 0===l&&(l=t.INTERNAL,v="Unknown error status: "+a+" with message "+s.message);u=!0;f.UE(new i(l,v));o.close()}else e("Connection","WebChannel received:",r),f.QE(r)}),setTimeout(function(){f.qE()},0),f},yc.prototype.KE=function(n){var t=hpt[n];return this.WE+"/v1/projects/"+this.ii.projectId+"/databases/"+this.ii.database+"/documents:"+t},yc);vu.an((Object.defineProperty(wf.prototype,"document",{get:function(){return"undefined"!=typeof document?document:null},enumerable:!0,configurable:!0}),Object.defineProperty(wf.prototype,"window",{get:function(){return"undefined"!=typeof window?window:null},enumerable:!0,configurable:!0}),wf.prototype.gT=function(n){return Promise.resolve(new lpt(n))},wf.prototype.wT=function(){return new(sct.Uh()?sct:opt)},wf.prototype.yc=function(n){return new pat(n,{hi:!0})},wf.prototype.un=function(n){return JSON.stringify(n)},wf.prototype.atob=function(n){return atob(n)},wf.prototype.btoa=function(n){return btoa(n)},wf.prototype._n=function(n){var r="undefined"!=typeof self&&(self.crypto||self.msCrypto),i=new Uint8Array(n),t;if(r)r.getRandomValues(i);else for(t=0;t<n;t++)i[t]=Math.floor(256*Math.random());return i},new wf));(oct=n).INTERNAL.registerComponent(new rtt("firestore",function(n){return t=n.getProvider("app").getImmediate(),i=n.getProvider("auth-internal"),new vn(t,i,new yyt);var t,i},"PUBLIC").setServiceProps(Object.assign({},ept)));oct.registerVersion("@firebase/firestore","1.14.4")}).apply(this,arguments)}catch(t){throw console.error(t),new Error("Cannot instantiate firebase-firestore.js - be sure to load firebase-app.js first.");}});firebaseConfig={apiKey:"AIzaSyBiWMv__leyyn_wP2ErRX3W5AyvLivQAEo",authDomain:"indianauto-ee90c.firebaseapp.com",databaseURL:"https://indianauto-ee90c.firebaseio.com",projectId:"indianauto-ee90c",storageBucket:"indianauto-ee90c.appspot.com",messagingSenderId:"373323466333",appId:"1:373323466333:web:603bdfe1acbe0348a6afb4",measurementId:"G-V8YT4202QZ"};firebase.initializeApp(firebaseConfig);firebase.analytics().logEvent("notification_received");const messaging=firebase.messaging();messaging.usePublicVapidKey("BP9BQOHLTVsVNzghg5lPZ1FEE-8soVTGkxYKBd2-qkZkaNOqlVuizF62fNh4V7auJ7yl_UAZ-SnFvuo77uVjmQg");messaging.onTokenRefresh(()=>{messaging.getToken().then(()=>{getFirebaseToken()}).catch(n=>{console.log("Unable to retrieve refreshed token ",n)})});messaging.onMessage(()=>{});subscribe=cookie_manager.get_cookie("subscribe_site");subscribe===null||subscribe===undefined||subscribe===""?setTimeout(function(){$("#hdIsMobile").length>0?$(".notifycation-container").animate({bottom:"0px"},1e3):$(".notifycation-container").animate({top:"0px"},1e3);$(".notifycation-container #btnMayBeLate").click(function(){cookie_manager.set_cookie("subscribe_site","1",30);$(".notifycation-container").remove()});$(".notifycation-container #btnSubscribe").click(function(n){n.preventDefault();window.Notification?Notification.requestPermission().then(n=>{n==="granted"?messaging.getToken().then(n=>{n?(cookie_manager.set_cookie("notify_token",n,3650),cookie_manager.set_cookie("subscribe_site","1",3650),apiRecallAfterSubscribe!==undefined&&apiRecallAfterSubscribe!==null&&$.ajax({url:apiRecallAfterSubscribe,xhrFields:{withCredentials:!0},method:"POST",success:function(n){console.log(n)}})):requestPermission(),console.log("currentToken: "),console.log(n)}).catch(n=>{console.log("An error occurred while retrieving token. ",n)}):cookie_manager.set_cookie("subscribe_site","1",30)}):(alert("Your browser not supprot notify"),cookie_manager.set_cookie("subscribe_site","1",30));$(".notifycation-container").remove()})},3e4):$(".notifycation-container").remove();