!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).firebase=t()}(this,function(){"use strict";var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};var i=function(){return(i=Object.assign||function(e){for(var t,n=1,r=arguments.length;na[0]&&t[1]"})):"Error",e=this.serviceName+": "+e+" ("+i+").";return new c(i,e,o)},h);function h(e,t,n){this.service=e,this.serviceName=t,this.errors=n}var d=/\{\$([^}]+)}/g;function v(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function m(e,t){t=new y(e,t);return t.subscribe.bind(t)}var y=(g.prototype.next=function(t){this.forEachObserver(function(e){e.next(t)})},g.prototype.error=function(t){this.forEachObserver(function(e){e.error(t)}),this.close(t)},g.prototype.complete=function(){this.forEachObserver(function(e){e.complete()}),this.close()},g.prototype.subscribe=function(e,t,n){var r,o=this;if(void 0===e&&void 0===t&&void 0===n)throw new Error("Missing Observer.");void 0===(r=function(e,t){if("object"!=typeof e||null===e)return!1;for(var n=0,r=t;n=e.length?void 0:e)&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(this.instancesDeferred.entries()),o=r.next();!o.done;o=r.next()){var i=u(o.value,2),a=i[0],s=i[1],c=this.normalizeInstanceIdentifier(a);try{var l=this.getOrInitializeService(c);s.resolve(l)}catch(e){}}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}},I.prototype.clearInstance=function(e){void 0===e&&(e=O),this.instancesDeferred.delete(e),this.instances.delete(e)},I.prototype.delete=function(){return e(this,void 0,void 0,function(){var t;return n(this,function(e){switch(e.label){case 0:return t=Array.from(this.instances.values()),[4,Promise.all(function(){for(var e=[],t=0;t=(null!=i?i:e.logLevel)&&a({level:R[t].toLowerCase(),message:o,args:n,type:e.name})}}(n[e])}var x=((x={})["no-app"]="No Firebase App '{$appName}' has been created - call Firebase App.initializeApp()",x["bad-app-name"]="Illegal App name: '{$appName}",x["duplicate-app"]="Firebase App named '{$appName}' already exists",x["app-deleted"]="Firebase App named '{$appName}' already deleted",x["invalid-app-argument"]="firebase.{$appName}() takes either no argument or a Firebase App instance.",x["invalid-log-argument"]="First argument to `onLog` must be null or a function.",x),z=new f("app","Firebase",x),B="@firebase/app",V="[DEFAULT]",U=((x={})[B]="fire-core",x["@firebase/analytics"]="fire-analytics",x["@firebase/auth"]="fire-auth",x["@firebase/database"]="fire-rtdb",x["@firebase/functions"]="fire-fn",x["@firebase/installations"]="fire-iid",x["@firebase/messaging"]="fire-fcm",x["@firebase/performance"]="fire-perf",x["@firebase/remote-config"]="fire-rc",x["@firebase/storage"]="fire-gcs",x["@firebase/firestore"]="fire-fst",x["fire-js"]="fire-js",x["firebase-wrapper"]="fire-js-all",x),M=new F("@firebase/app"),W=(Object.defineProperty(G.prototype,"automaticDataCollectionEnabled",{get:function(){return this.checkDestroyed_(),this.automaticDataCollectionEnabled_},set:function(e){this.checkDestroyed_(),this.automaticDataCollectionEnabled_=e},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"name",{get:function(){return this.checkDestroyed_(),this.name_},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"options",{get:function(){return this.checkDestroyed_(),this.options_},enumerable:!1,configurable:!0}),G.prototype.delete=function(){var t=this;return new Promise(function(e){t.checkDestroyed_(),e()}).then(function(){return t.firebase_.INTERNAL.removeApp(t.name_),Promise.all(t.container.getProviders().map(function(e){return e.delete()}))}).then(function(){t.isDeleted_=!0})},G.prototype._getService=function(e,t){return void 0===t&&(t=V),this.checkDestroyed_(),this.container.getProvider(e).getImmediate({identifier:t})},G.prototype._removeServiceInstance=function(e,t){void 0===t&&(t=V),this.container.getProvider(e).clearInstance(t)},G.prototype._addComponent=function(t){try{this.container.addComponent(t)}catch(e){M.debug("Component "+t.name+" failed to register with FirebaseApp "+this.name,e)}},G.prototype._addOrOverwriteComponent=function(e){this.container.addOrOverwriteComponent(e)},G.prototype.toJSON=function(){return{name:this.name,automaticDataCollectionEnabled:this.automaticDataCollectionEnabled,options:this.options}},G.prototype.checkDestroyed_=function(){if(this.isDeleted_)throw z.create("app-deleted",{appName:this.name_})},G);function G(e,t,n){var r=this;this.firebase_=n,this.isDeleted_=!1,this.name_=t.name,this.automaticDataCollectionEnabled_=t.automaticDataCollectionEnabled||!1,this.options_=p(void 0,e),this.container=new N(t.name),this._addComponent(new w("app",function(){return r},"PUBLIC")),this.firebase_.INTERNAL.components.forEach(function(e){return r._addComponent(e)})}W.prototype.name&&W.prototype.options||W.prototype.delete||console.log("dc");var $="8.2.9";function Y(a){var s={},c=new Map,l={__esModule:!0,initializeApp:function(e,t){void 0===t&&(t={});"object"==typeof t&&null!==t||(t={name:t});var n=t;void 0===n.name&&(n.name=V);t=n.name;if("string"!=typeof t||!t)throw z.create("bad-app-name",{appName:String(t)});if(v(s,t))throw z.create("duplicate-app",{appName:t});n=new a(e,n,l);return s[t]=n},app:u,registerVersion:function(e,t,n){var r=null!==(o=U[e])&&void 0!==o?o:e;n&&(r+="-"+n);var o=r.match(/\s|\//),e=t.match(/\s|\//);if(o||e){n=['Unable to register library "'+r+'" with version "'+t+'":'];return o&&n.push('library name "'+r+'" contains illegal characters (whitespace or "/")'),o&&e&&n.push("and"),e&&n.push('version name "'+t+'" contains illegal characters (whitespace or "/")'),void M.warn(n.join(" "))}i(new w(r+"-version",function(){return{library:r,version:t}},"VERSION"))},setLogLevel:T,onLog:function(e,t){if(null!==e&&"function"!=typeof e)throw z.create("invalid-log-argument");H(e,t)},apps:null,SDK_VERSION:$,INTERNAL:{registerComponent:i,removeApp:function(e){delete s[e]},components:c,useAsService:function(e,t){if("serverAuth"===t)return null;return t}}};function u(e){if(!v(s,e=e||V))throw z.create("no-app",{appName:e});return s[e]}function i(n){var e,r=n.name;if(c.has(r))return M.debug("There were multiple attempts to register component "+r+"."),"PUBLIC"===n.type?l[r]:null;c.set(r,n),"PUBLIC"===n.type&&(e=function(e){if("function"!=typeof(e=void 0===e?u():e)[r])throw z.create("invalid-app-argument",{appName:r});return e[r]()},void 0!==n.serviceProps&&p(e,n.serviceProps),l[r]=e,a.prototype[r]=function(){for(var e=[],t=0;t