firebase 9.6.2 → 9.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/app/dist/index.cjs.js +1 -1
- package/app/dist/index.esm.js +1 -1
- package/app/dist/index.mjs +1 -1
- package/compat/app/dist/index.cjs.js +1 -1
- package/compat/app/dist/index.esm.js +1 -1
- package/compat/app/dist/index.mjs +1 -1
- package/compat/dist/index.esm.js +2 -2
- package/compat/dist/index.node.cjs +2 -2
- package/compat/dist/index.rn.cjs.js +2 -2
- package/firebase-analytics-compat.js.map +1 -1
- package/firebase-analytics.js +3 -3
- package/firebase-analytics.js.map +1 -1
- package/firebase-app-check-compat.js.map +1 -1
- package/firebase-app-check.js +4 -4
- package/firebase-app-check.js.map +1 -1
- package/firebase-app-compat.js +2 -2
- package/firebase-app-compat.js.map +1 -1
- package/firebase-app.js +9 -9
- package/firebase-app.js.map +1 -1
- package/firebase-auth-compat.js.map +1 -1
- package/firebase-auth.js +4 -4
- package/firebase-auth.js.map +1 -1
- package/firebase-compat.js +3 -3
- package/firebase-compat.js.map +1 -1
- package/firebase-database.js +4 -4
- package/firebase-firestore-compat.js +1 -1
- package/firebase-firestore-compat.js.map +1 -1
- package/firebase-firestore-lite.js +1141 -1141
- package/firebase-firestore-lite.js.map +1 -1
- package/firebase-firestore.js +874 -874
- package/firebase-firestore.js.map +1 -1
- package/firebase-functions-compat.js.map +1 -1
- package/firebase-functions.js +2 -2
- package/firebase-functions.js.map +1 -1
- package/firebase-messaging-compat.js +1 -1
- package/firebase-messaging-compat.js.map +1 -1
- package/firebase-messaging-sw.js +4 -4
- package/firebase-messaging-sw.js.map +1 -1
- package/firebase-messaging.js +3 -3
- package/firebase-messaging.js.map +1 -1
- package/firebase-performance-compat.js.map +1 -1
- package/firebase-performance-standalone-compat.es2017.js +5 -5
- package/firebase-performance-standalone-compat.es2017.js.map +1 -1
- package/firebase-performance-standalone-compat.js +1 -1
- package/firebase-performance-standalone-compat.js.map +1 -1
- package/firebase-performance.js +3 -3
- package/firebase-performance.js.map +1 -1
- package/firebase-remote-config-compat.js.map +1 -1
- package/firebase-remote-config.js +2 -2
- package/firebase-remote-config.js.map +1 -1
- package/firebase-storage-compat.js.map +1 -1
- package/firebase-storage.js +1 -1
- package/firebase-storage.js.map +1 -1
- package/package.json +7 -7
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!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 f=function(){return(f=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function l(e,a,s,c){return new(s=s||Promise)(function(n,t){function r(e){try{o(c.next(e))}catch(e){t(e)}}function i(e){try{o(c.throw(e))}catch(e){t(e)}}function o(e){var t;e.done?n(e.value):((t=e.value)instanceof s?t:new s(function(e){e(t)})).then(r,i)}o((c=c.apply(e,a||[])).next())})}function p(n,r){var i,o,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(t){return function(e){return function(t){if(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,o&&(a=2&t[0]?o.return:t[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,t[1])).done)return a;switch(o=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,o=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3])){s.label=t[1];break}if(6===t[0]&&s.label<a[1]){s.label=a[1],a=t;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(t);break}a[2]&&s.ops.pop(),s.trys.pop();continue}t=r.call(n,s)}catch(e){t=[6,e],o=0}finally{i=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([t,e])}}}function d(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&r>=e.length?void 0:e)&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function h(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||0<t--)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function a(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||((r=r||Array.prototype.slice.call(t,0,i))[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}function c(e,t){if(!(t instanceof Object))return t;switch(t.constructor){case Date:return new Date(t.getTime());case Object:void 0===e&&(e={});break;case Array:e=[];break;default:return t}for(var n in t)t.hasOwnProperty(n)&&"__proto__"!==n&&(e[n]=c(e[n],t[n]));return e}var i=(e.prototype.wrapCallback=function(n){var r=this;return function(e,t){e?r.reject(e):r.resolve(t),"function"==typeof n&&(r.promise.catch(function(){}),1===n.length?n(e):n(e,t))}},e);function e(){var n=this;this.reject=function(){},this.resolve=function(){},this.promise=new Promise(function(e,t){n.resolve=e,n.reject=t})}var o,s=(function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(u,o=Error),u);function u(e,t,n){var r=o.call(this,t)||this;return r.code=e,r.customData=n,r.name="FirebaseError",Object.setPrototypeOf(r,u.prototype),Error.captureStackTrace&&Error.captureStackTrace(r,m.prototype.create),r}var m=(t.prototype.create=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r,i=t[0]||{},o=this.service+"/"+e,a=this.errors[e],a=a?(r=i,a.replace(v,function(e,t){var n=r[t];return null!=n?String(n):"<"+t+"?>"})):"Error",a=this.serviceName+": "+a+" ("+o+").";return new s(o,a,i)},t);function t(e,t,n){this.service=e,this.serviceName=t,this.errors=n}var v=/\{\$([^}]+)}/g;function g(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function b(e,t){if(e===t)return 1;for(var n=Object.keys(e),r=Object.keys(t),i=0,o=n;i<o.length;i++){var a=o[i];if(!r.includes(a))return;var s=e[a],c=t[a];if(y(s)&&y(c)){if(!b(s,c))return}else if(s!==c)return}for(var u=0,l=r;u<l.length;u++){a=l[u];if(!n.includes(a))return}return 1}function y(e){return null!==e&&"object"==typeof e}function n(e,t){var n=new _(e,t);return n.subscribe.bind(n)}var _=(w.prototype.next=function(t){this.forEachObserver(function(e){e.next(t)})},w.prototype.error=function(t){this.forEachObserver(function(e){e.error(t)}),this.close(t)},w.prototype.complete=function(){this.forEachObserver(function(e){e.complete()}),this.close()},w.prototype.subscribe=function(e,t,n){var r,i=this;if(void 0===e&&void 0===t&&void 0===n)throw new Error("Missing Observer.");void 0===(r=function(e,t){if("object"!=typeof e||null===e)return!1;for(var n=0,r=t;n<r.length;n++){var i=r[n];if(i in e&&"function"==typeof e[i])return!0}return!1}(e,["next","error","complete"])?e:{next:e,error:t,complete:n}).next&&(r.next=I),void 0===r.error&&(r.error=I),void 0===r.complete&&(r.complete=I);var o=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(function(){try{i.finalError?r.error(i.finalError):r.complete()}catch(e){}}),this.observers.push(r),o},w.prototype.unsubscribeOne=function(e){void 0!==this.observers&&void 0!==this.observers[e]&&(delete this.observers[e],--this.observerCount,0===this.observerCount&&void 0!==this.onNoObservers&&this.onNoObservers(this))},w.prototype.forEachObserver=function(e){if(!this.finalized)for(var t=0;t<this.observers.length;t++)this.sendOne(t,e)},w.prototype.sendOne=function(e,t){var n=this;this.task.then(function(){if(void 0!==n.observers&&void 0!==n.observers[e])try{t(n.observers[e])}catch(e){"undefined"!=typeof console&&console.error&&console.error(e)}})},w.prototype.close=function(e){var t=this;this.finalized||(this.finalized=!0,void 0!==e&&(this.finalError=e),this.task.then(function(){t.observers=void 0,t.onNoObservers=void 0}))},w);function w(e,t){var n=this;this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=t,this.task.then(function(){e(n)}).catch(function(e){n.error(e)})}function I(){}var E=(S.prototype.setInstantiationMode=function(e){return this.instantiationMode=e,this},S.prototype.setMultipleInstances=function(e){return this.multipleInstances=e,this},S.prototype.setServiceProps=function(e){return this.serviceProps=e,this},S.prototype.setInstanceCreatedCallback=function(e){return this.onInstanceCreated=e,this},S);function S(e,t,n){this.name=e,this.instanceFactory=t,this.type=n,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}var T="[DEFAULT]",O=(C.prototype.get=function(e){var t=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(t)){var n=new i;if(this.instancesDeferred.set(t,n),this.isInitialized(t)||this.shouldAutoInitialize())try{var r=this.getOrInitializeService({instanceIdentifier:t});r&&n.resolve(r)}catch(e){}}return this.instancesDeferred.get(t).promise},C.prototype.getImmediate=function(e){var t=this.normalizeInstanceIdentifier(null==e?void 0:e.identifier),n=null!==(n=null==e?void 0:e.optional)&&void 0!==n&&n;if(!this.isInitialized(t)&&!this.shouldAutoInitialize()){if(n)return null;throw Error("Service "+this.name+" is not available")}try{return this.getOrInitializeService({instanceIdentifier:t})}catch(e){if(n)return null;throw e}},C.prototype.getComponent=function(){return this.component},C.prototype.setComponent=function(e){var t,n;if(e.name!==this.name)throw Error("Mismatching Component "+e.name+" for Provider "+this.name+".");if(this.component)throw Error("Component for "+this.name+" has already been provided");if(this.component=e,this.shouldAutoInitialize()){if("EAGER"===e.instantiationMode)try{this.getOrInitializeService({instanceIdentifier:T})}catch(e){}try{for(var r=d(this.instancesDeferred.entries()),i=r.next();!i.done;i=r.next()){var o=h(i.value,2),a=o[0],s=o[1],c=this.normalizeInstanceIdentifier(a);try{var u=this.getOrInitializeService({instanceIdentifier:c});s.resolve(u)}catch(e){}}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}}},C.prototype.clearInstance=function(e){this.instancesDeferred.delete(e=void 0===e?T:e),this.instancesOptions.delete(e),this.instances.delete(e)},C.prototype.delete=function(){return l(this,void 0,void 0,function(){var t;return p(this,function(e){switch(e.label){case 0:return t=Array.from(this.instances.values()),[4,Promise.all(a(a([],h(t.filter(function(e){return"INTERNAL"in e}).map(function(e){return e.INTERNAL.delete()}))),h(t.filter(function(e){return"_delete"in e}).map(function(e){return e._delete()}))))];case 1:return e.sent(),[2]}})})},C.prototype.isComponentSet=function(){return null!=this.component},C.prototype.isInitialized=function(e){return this.instances.has(e=void 0===e?T:e)},C.prototype.getOptions=function(e){return this.instancesOptions.get(e=void 0===e?T:e)||{}},C.prototype.initialize=function(e){var t,n,r=(e=void 0===e?{}:e).options,r=void 0===r?{}:r,i=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(i))throw Error(this.name+"("+i+") has already been initialized");if(!this.isComponentSet())throw Error("Component "+this.name+" has not been registered yet");var o=this.getOrInitializeService({instanceIdentifier:i,options:r});try{for(var a=d(this.instancesDeferred.entries()),s=a.next();!s.done;s=a.next()){var c=h(s.value,2),u=c[0],l=c[1];i===this.normalizeInstanceIdentifier(u)&&l.resolve(o)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return o},C.prototype.onInit=function(e,t){var n=this.normalizeInstanceIdentifier(t),r=null!==(i=this.onInitCallbacks.get(n))&&void 0!==i?i:new Set;r.add(e),this.onInitCallbacks.set(n,r);var i=this.instances.get(n);return i&&e(i,n),function(){r.delete(e)}},C.prototype.invokeOnInitCallbacks=function(e,t){var n,r,i=this.onInitCallbacks.get(t);if(i)try{for(var o=d(i),a=o.next();!a.done;a=o.next()){var s=a.value;try{s(e,t)}catch(e){}}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}},C.prototype.getOrInitializeService=function(e){var t=e.instanceIdentifier,n=e.options,r=void 0===n?{}:n,n=this.instances.get(t);if(!n&&this.component&&(n=this.component.instanceFactory(this.container,{instanceIdentifier:(e=t)===T?void 0:e,options:r}),this.instances.set(t,n),this.instancesOptions.set(t,r),this.invokeOnInitCallbacks(n,t),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,t,n)}catch(e){}return n||null},C.prototype.normalizeInstanceIdentifier=function(e){return void 0===e&&(e=T),!this.component||this.component.multipleInstances?e:T},C.prototype.shouldAutoInitialize=function(){return!!this.component&&"EXPLICIT"!==this.component.instantiationMode},C);function C(e,t){this.name=e,this.container=t,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}var N=(A.prototype.addComponent=function(e){var t=this.getProvider(e.name);if(t.isComponentSet())throw new Error("Component "+e.name+" has already been registered with "+this.name);t.setComponent(e)},A.prototype.addOrOverwriteComponent=function(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)},A.prototype.getProvider=function(e){if(this.providers.has(e))return this.providers.get(e);var t=new O(e,this);return this.providers.set(e,t),t},A.prototype.getProviders=function(){return Array.from(this.providers.values())},A);function A(e){this.name=e,this.providers=new Map}var P,k=[];(Pt=P=P||{})[Pt.DEBUG=0]="DEBUG",Pt[Pt.VERBOSE=1]="VERBOSE",Pt[Pt.INFO=2]="INFO",Pt[Pt.WARN=3]="WARN",Pt[Pt.ERROR=4]="ERROR",Pt[Pt.SILENT=5]="SILENT";function D(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];if(!(t<e.logLevel)){var i=(new Date).toISOString(),o=L[t];if(!o)throw new Error("Attempted to log a message with an invalid logType (value: "+t+")");console[o].apply(console,a(["["+i+"] "+e.name+":"],n))}}var j={debug:P.DEBUG,verbose:P.VERBOSE,info:P.INFO,warn:P.WARN,error:P.ERROR,silent:P.SILENT},R=P.INFO,L=((he={})[P.DEBUG]="log",he[P.VERBOSE]="log",he[P.INFO]="info",he[P.WARN]="warn",he[P.ERROR]="error",he),M=(Object.defineProperty(x.prototype,"logLevel",{get:function(){return this._logLevel},set:function(e){if(!(e in P))throw new TypeError('Invalid value "'+e+'" assigned to `logLevel`');this._logLevel=e},enumerable:!1,configurable:!0}),x.prototype.setLogLevel=function(e){this._logLevel="string"==typeof e?j[e]:e},Object.defineProperty(x.prototype,"logHandler",{get:function(){return this._logHandler},set:function(e){if("function"!=typeof e)throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"userLogHandler",{get:function(){return this._userLogHandler},set:function(e){this._userLogHandler=e},enumerable:!1,configurable:!0}),x.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._userLogHandler&&this._userLogHandler.apply(this,a([this,P.DEBUG],e)),this._logHandler.apply(this,a([this,P.DEBUG],e))},x.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._userLogHandler&&this._userLogHandler.apply(this,a([this,P.VERBOSE],e)),this._logHandler.apply(this,a([this,P.VERBOSE],e))},x.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._userLogHandler&&this._userLogHandler.apply(this,a([this,P.INFO],e)),this._logHandler.apply(this,a([this,P.INFO],e))},x.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._userLogHandler&&this._userLogHandler.apply(this,a([this,P.WARN],e)),this._logHandler.apply(this,a([this,P.WARN],e))},x.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._userLogHandler&&this._userLogHandler.apply(this,a([this,P.ERROR],e)),this._logHandler.apply(this,a([this,P.ERROR],e))},x);function x(e){this.name=e,this._logLevel=R,this._logHandler=D,this._userLogHandler=null,k.push(this)}function F(a,t){for(var e=0,n=k;e<n.length;e++)!function(e){var o=null;t&&t.level&&(o=j[t.level]),e.userLogHandler=null===a?null:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i=n.map(function(e){if(null==e)return null;if("string"==typeof e)return e;if("number"==typeof e||"boolean"==typeof e)return e.toString();if(e instanceof Error)return e.message;try{return JSON.stringify(e)}catch(e){return null}}).filter(function(e){return e}).join(" ");t>=(null!=o?o:e.logLevel)&&a({level:P[t].toLowerCase(),message:i,args:n,type:e.name})}}(n[e])}var B=(U.prototype.getPlatformInfoString=function(){return this.container.getProviders().map(function(e){if("VERSION"!==(null==(t=e.getComponent())?void 0:t.type))return null;var t,t=e.getImmediate();return t.library+"/"+t.version}).filter(function(e){return e}).join(" ")},U);function U(e){this.container=e}var z="@firebase/app",q="0.7.12",V=new M("@firebase/app"),H="[DEFAULT]",K=((Z={})[z]="fire-core",Z["@firebase/app-compat"]="fire-core-compat",Z["@firebase/analytics"]="fire-analytics",Z["@firebase/analytics-compat"]="fire-analytics-compat",Z["@firebase/app-check"]="fire-app-check",Z["@firebase/app-check-compat"]="fire-app-check-compat",Z["@firebase/auth"]="fire-auth",Z["@firebase/auth-compat"]="fire-auth-compat",Z["@firebase/database"]="fire-rtdb",Z["@firebase/database-compat"]="fire-rtdb-compat",Z["@firebase/functions"]="fire-fn",Z["@firebase/functions-compat"]="fire-fn-compat",Z["@firebase/installations"]="fire-iid",Z["@firebase/installations-compat"]="fire-iid-compat",Z["@firebase/messaging"]="fire-fcm",Z["@firebase/messaging-compat"]="fire-fcm-compat",Z["@firebase/performance"]="fire-perf",Z["@firebase/performance-compat"]="fire-perf-compat",Z["@firebase/remote-config"]="fire-rc",Z["@firebase/remote-config-compat"]="fire-rc-compat",Z["@firebase/storage"]="fire-gcs",Z["@firebase/storage-compat"]="fire-gcs-compat",Z["@firebase/firestore"]="fire-fst",Z["@firebase/firestore-compat"]="fire-fst-compat",Z["fire-js"]="fire-js",Z.firebase="fire-js-all",Z),$=new Map,W=new Map;function G(t,n){try{t.container.addComponent(n)}catch(e){V.debug("Component "+n.name+" failed to register with FirebaseApp "+t.name,e)}}function J(e,t){e.container.addOrOverwriteComponent(t)}function Y(e){var t,n,r=e.name;if(W.has(r))return V.debug("There were multiple attempts to register component "+r+"."),!1;W.set(r,e);try{for(var i=d($.values()),o=i.next();!o.done;o=i.next())G(o.value,e)}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return!0}function X(e,t){return e.container.getProvider(t)}var Z=((he={})["no-app"]="No Firebase App '{$appName}' has been created - call Firebase App.initializeApp()",he["bad-app-name"]="Illegal App name: '{$appName}",he["duplicate-app"]="Firebase App named '{$appName}' already exists with different options or config",he["app-deleted"]="Firebase App named '{$appName}' already deleted",he["invalid-app-argument"]="firebase.{$appName}() takes either no argument or a Firebase App instance.",he["invalid-log-argument"]="First argument to `onLog` must be null or a function.",he),Q=new m("app","Firebase",Z),ee=(Object.defineProperty(te.prototype,"automaticDataCollectionEnabled",{get:function(){return this.checkDestroyed(),this._automaticDataCollectionEnabled},set:function(e){this.checkDestroyed(),this._automaticDataCollectionEnabled=e},enumerable:!1,configurable:!0}),Object.defineProperty(te.prototype,"name",{get:function(){return this.checkDestroyed(),this._name},enumerable:!1,configurable:!0}),Object.defineProperty(te.prototype,"options",{get:function(){return this.checkDestroyed(),this._options},enumerable:!1,configurable:!0}),Object.defineProperty(te.prototype,"config",{get:function(){return this.checkDestroyed(),this._config},enumerable:!1,configurable:!0}),Object.defineProperty(te.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(te.prototype,"isDeleted",{get:function(){return this._isDeleted},set:function(e){this._isDeleted=e},enumerable:!1,configurable:!0}),te.prototype.checkDestroyed=function(){if(this.isDeleted)throw Q.create("app-deleted",{appName:this._name})},te);function te(e,t,n){var r=this;this._isDeleted=!1,this._options=f({},e),this._config=f({},t),this._name=t.name,this._automaticDataCollectionEnabled=t.automaticDataCollectionEnabled,this._container=n,this.container.addComponent(new E("app",function(){return r},"PUBLIC"))}var ne,re="9.6.2";function ie(e,t){var n,r,i=f({name:H,automaticDataCollectionEnabled:!1},t="object"!=typeof(t=void 0===t?{}:t)?{name:t}:t),o=i.name;if("string"!=typeof o||!o)throw Q.create("bad-app-name",{appName:String(o)});var a=$.get(o);if(a){if(b(e,a.options)&&b(i,a.config))return a;throw Q.create("duplicate-app",{appName:o})}var s=new N(o);try{for(var c=d(W.values()),u=c.next();!u.done;u=c.next()){var l=u.value;s.addComponent(l)}}catch(e){n={error:e}}finally{try{u&&!u.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}i=new ee(e,i,s);return $.set(o,i),i}function oe(n){return l(this,void 0,void 0,function(){var t;return p(this,function(e){switch(e.label){case 0:return(t=n.name,$.has(t))?($.delete(t),[4,Promise.all(n.container.getProviders().map(function(e){return e.delete()}))]):[3,2];case 1:e.sent(),n.isDeleted=!0,e.label=2;case 2:return[2]}})})}function ae(e,t,n){var r=null!==(a=K[e])&&void 0!==a?a:e;n&&(r+="-"+n);var i=r.match(/\s|\//),o=t.match(/\s|\//);if(i||o){var a=['Unable to register library "'+r+'" with version "'+t+'":'];return i&&a.push('library name "'+r+'" contains illegal characters (whitespace or "/")'),i&&o&&a.push("and"),o&&a.push('version name "'+t+'" contains illegal characters (whitespace or "/")'),void V.warn(a.join(" "))}Y(new E(r+"-version",function(){return{library:r,version:t}},"VERSION"))}function se(e,t){if(null!==e&&"function"!=typeof e)throw Q.create("invalid-log-argument");F(e,t)}function ce(e){var t;t=e,k.forEach(function(e){e.setLogLevel(t)})}ne="",Y(new E("platform-logger",function(e){return new B(e)},"PRIVATE")),ae(z,q,ne),ae(z,q,"esm5"),ae("fire-js","");var ue=Object.freeze({__proto__:null,SDK_VERSION:re,_DEFAULT_ENTRY_NAME:H,_addComponent:G,_addOrOverwriteComponent:J,_apps:$,_clearComponents:function(){W.clear()},_components:W,_getProvider:X,_registerComponent:Y,_removeServiceInstance:function(e,t,n){void 0===n&&(n=H),X(e,t).clearInstance(n)},deleteApp:oe,getApp:function(e){var t=$.get(e=void 0===e?H:e);if(!t)throw Q.create("no-app",{appName:e});return t},getApps:function(){return Array.from($.values())},initializeApp:ie,onLog:se,registerVersion:ae,setLogLevel:ce,FirebaseError:s}),le=(Object.defineProperty(fe.prototype,"automaticDataCollectionEnabled",{get:function(){return this._delegate.automaticDataCollectionEnabled},set:function(e){this._delegate.automaticDataCollectionEnabled=e},enumerable:!1,configurable:!0}),Object.defineProperty(fe.prototype,"name",{get:function(){return this._delegate.name},enumerable:!1,configurable:!0}),Object.defineProperty(fe.prototype,"options",{get:function(){return this._delegate.options},enumerable:!1,configurable:!0}),fe.prototype.delete=function(){var t=this;return new Promise(function(e){t._delegate.checkDestroyed(),e()}).then(function(){return t.firebase.INTERNAL.removeApp(t.name),oe(t._delegate)})},fe.prototype._getService=function(e,t){var n;void 0===t&&(t=H),this._delegate.checkDestroyed();var r=this._delegate.container.getProvider(e);return r.isInitialized()||"EXPLICIT"!==(null===(n=r.getComponent())||void 0===n?void 0:n.instantiationMode)||r.initialize(),r.getImmediate({identifier:t})},fe.prototype._removeServiceInstance=function(e,t){void 0===t&&(t=H),this._delegate.container.getProvider(e).clearInstance(t)},fe.prototype._addComponent=function(e){G(this._delegate,e)},fe.prototype._addOrOverwriteComponent=function(e){J(this._delegate,e)},fe.prototype.toJSON=function(){return{name:this.name,automaticDataCollectionEnabled:this.automaticDataCollectionEnabled,options:this.options}},fe);function fe(e,t){var n=this;this._delegate=e,this.firebase=t,G(e,new E("app-compat",function(){return n},"PUBLIC")),this.container=e.container}var Z=((he={})["no-app"]="No Firebase App '{$appName}' has been created - call Firebase App.initializeApp()",he["invalid-app-argument"]="firebase.{$appName}() takes either no argument or a Firebase App instance.",he),pe=new m("app-compat","Firebase",Z);function de(i){var o={},a={__esModule:!0,initializeApp:function(e,t){void 0===t&&(t={});var n=ie(e,t);if(g(o,n.name))return o[n.name];var r=new i(n,a);return o[n.name]=r},app:s,registerVersion:ae,setLogLevel:ce,onLog:se,apps:null,SDK_VERSION:re,INTERNAL:{registerComponent:function(n){var r=n.name,t=r.replace("-compat","");{var e;Y(n)&&"PUBLIC"===n.type&&(e=function(e){if("function"!=typeof(e=void 0===e?s():e)[t])throw pe.create("invalid-app-argument",{appName:r});return e[t]()},void 0!==n.serviceProps&&c(e,n.serviceProps),a[t]=e,i.prototype[t]=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this._getService.bind(this,r).apply(this,n.multipleInstances?e:[])})}return"PUBLIC"===n.type?a[t]:null},removeApp:function(e){delete o[e]},useAsService:function(e,t){return"serverAuth"!==t?t:null},modularAPIs:ue}};function s(e){if(!g(o,e=e||H))throw pe.create("no-app",{appName:e});return o[e]}return a.default=a,Object.defineProperty(a,"apps",{get:function(){return Object.keys(o).map(function(e){return o[e]})}}),s.App=i,a}var he=function e(){var t=de(le);return t.INTERNAL=f(f({},t.INTERNAL),{createFirebaseNamespace:e,extendNamespace:function(e){c(t,e)},createSubscribe:n,ErrorFactory:m,deepExtend:c}),t}(),Z=new M("@firebase/app-compat");"object"==typeof self&&self.self===self&&void 0!==self.firebase&&(Z.warn("\n Warning: Firebase is already defined in the global scope. Please make sure\n Firebase library is only loaded once.\n "),(Ne=self.firebase.SDK_VERSION)&&0<=Ne.indexOf("LITE")&&Z.warn("\n Warning: You are trying to load Firebase while using Firebase Performance standalone script.\n You should load Firebase Performance with this instance of Firebase to avoid loading duplicate code.\n "));var me=he;ae("@firebase/app-compat","0.1.13",void 0);function ve(n){return new Promise(function(e,t){n.onsuccess=function(){e(n.result)},n.onerror=function(){t(n.error)}})}function ge(n,r,i){var o,e=new Promise(function(e,t){ve(o=n[r].apply(n,i)).then(e,t)});return e.request=o,e}function be(e,n,t){t.forEach(function(t){Object.defineProperty(e.prototype,t,{get:function(){return this[n][t]},set:function(e){this[n][t]=e}})})}function ye(t,n,r,e){e.forEach(function(e){e in r.prototype&&(t.prototype[e]=function(){return ge(this[n],e,arguments)})})}function _e(t,n,r,e){e.forEach(function(e){e in r.prototype&&(t.prototype[e]=function(){return this[n][e].apply(this[n],arguments)})})}function we(e,r,t,n){n.forEach(function(n){n in t.prototype&&(e.prototype[n]=function(){return e=this[r],(t=ge(e,n,arguments)).then(function(e){if(e)return new Ee(e,t.request)});var e,t})})}function Ie(e){this._index=e}function Ee(e,t){this._cursor=e,this._request=t}function Se(e){this._store=e}function Te(n){this._tx=n,this.complete=new Promise(function(e,t){n.oncomplete=function(){e()},n.onerror=function(){t(n.error)},n.onabort=function(){t(n.error)}})}function Oe(e,t,n){this._db=e,this.oldVersion=t,this.transaction=new Te(n)}function Ce(e){this._db=e}me.registerVersion("firebase","9.6.2","app-compat"),be(Ie,"_index",["name","keyPath","multiEntry","unique"]),ye(Ie,"_index",IDBIndex,["get","getKey","getAll","getAllKeys","count"]),we(Ie,"_index",IDBIndex,["openCursor","openKeyCursor"]),be(Ee,"_cursor",["direction","key","primaryKey","value"]),ye(Ee,"_cursor",IDBCursor,["update","delete"]),["advance","continue","continuePrimaryKey"].forEach(function(n){n in IDBCursor.prototype&&(Ee.prototype[n]=function(){var t=this,e=arguments;return Promise.resolve().then(function(){return t._cursor[n].apply(t._cursor,e),ve(t._request).then(function(e){if(e)return new Ee(e,t._request)})})})}),Se.prototype.createIndex=function(){return new Ie(this._store.createIndex.apply(this._store,arguments))},Se.prototype.index=function(){return new Ie(this._store.index.apply(this._store,arguments))},be(Se,"_store",["name","keyPath","indexNames","autoIncrement"]),ye(Se,"_store",IDBObjectStore,["put","add","delete","clear","get","getAll","getKey","getAllKeys","count"]),we(Se,"_store",IDBObjectStore,["openCursor","openKeyCursor"]),_e(Se,"_store",IDBObjectStore,["deleteIndex"]),Te.prototype.objectStore=function(){return new Se(this._tx.objectStore.apply(this._tx,arguments))},be(Te,"_tx",["objectStoreNames","mode"]),_e(Te,"_tx",IDBTransaction,["abort"]),Oe.prototype.createObjectStore=function(){return new Se(this._db.createObjectStore.apply(this._db,arguments))},be(Oe,"_db",["name","version","objectStoreNames"]),_e(Oe,"_db",IDBDatabase,["deleteObjectStore","close"]),Ce.prototype.transaction=function(){return new Te(this._db.transaction.apply(this._db,arguments))},be(Ce,"_db",["name","version","objectStoreNames"]),_e(Ce,"_db",IDBDatabase,["close"]),["openCursor","openKeyCursor"].forEach(function(o){[Se,Ie].forEach(function(e){o in e.prototype&&(e.prototype[o.replace("open","iterate")]=function(){var e,t=(e=arguments,Array.prototype.slice.call(e)),n=t[t.length-1],r=this._store||this._index,i=r[o].apply(r,t.slice(0,-1));i.onsuccess=function(){n(i.result)}})})}),[Ie,Se].forEach(function(e){e.prototype.getAll||(e.prototype.getAll=function(e,n){var r=this,i=[];return new Promise(function(t){r.iterateCursor(e,function(e){e?(i.push(e.value),void 0===n||i.length!=n?e.continue():t(i)):t(i)})})})});var Ne="@firebase/installations",Z="0.5.5",Ae=1e4,Pe="w:"+Z,ke="FIS_v2",De="https://firebaseinstallations.googleapis.com/v1",je=36e5,he=((he={})["missing-app-config-values"]='Missing App configuration value: "{$valueName}"',he["not-registered"]="Firebase Installation is not registered.",he["installation-not-found"]="Firebase Installation not found.",he["request-failed"]='{$requestName} request failed with error "{$serverCode} {$serverStatus}: {$serverMessage}"',he["app-offline"]="Could not process request. Application offline.",he["delete-pending-registration"]="Can't delete installation while there is a pending registration request.",he),Re=new m("installations","Installations",he);function Le(e){return e instanceof s&&e.code.includes("request-failed")}function Me(e){var t=e.projectId;return De+"/projects/"+t+"/installations"}function xe(e){return{token:e.token,requestStatus:2,expiresIn:(e=e.expiresIn,Number(e.replace("s","000"))),creationTime:Date.now()}}function Fe(n,r){return l(this,void 0,void 0,function(){var t;return p(this,function(e){switch(e.label){case 0:return[4,r.json()];case 1:return t=e.sent(),t=t.error,[2,Re.create("request-failed",{requestName:n,serverCode:t.code,serverMessage:t.message,serverStatus:t.status})]}})})}function Be(e){var t=e.apiKey;return new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":t})}function Ue(e,t){var n=t.refreshToken,r=Be(e);return r.append("Authorization",ke+" "+n),r}function ze(n){return l(this,void 0,void 0,function(){var t;return p(this,function(e){switch(e.label){case 0:return[4,n()];case 1:return 500<=(t=e.sent()).status&&t.status<600?[2,n()]:[2,t]}})})}function qe(t){return new Promise(function(e){setTimeout(e,t)})}var Ve=/^[cdef][\w-]{21}$/,He="";function Ke(){try{var e=new Uint8Array(17);(self.crypto||self.msCrypto).getRandomValues(e),e[0]=112+e[0]%16;var t=function(e){return btoa(String.fromCharCode.apply(String,a([],h(e)))).replace(/\+/g,"-").replace(/\//g,"_")}(e).substr(0,22);return Ve.test(t)?t:He}catch(e){return He}}function $e(e){return e.appName+"!"+e.appId}var We=new Map;function Ge(e,t){var n=$e(e);Je(n,t),function(e,t){var n=function(){!Ye&&"BroadcastChannel"in self&&((Ye=new BroadcastChannel("[Firebase] FID Change")).onmessage=function(e){Je(e.data.key,e.data.fid)});return Ye}();n&&n.postMessage({key:e,fid:t});0===We.size&&Ye&&(Ye.close(),Ye=null)}(n,t)}function Je(e,t){var n,r,i=We.get(e);if(i)try{for(var o=d(i),a=o.next();!a.done;a=o.next())(0,a.value)(t)}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}var Ye=null;var Xe="firebase-installations-store",Ze=null;function Qe(){var t,e,n;return Ze||(t=function(e){0===e.oldVersion&&e.createObjectStore(Xe)},e=ge(indexedDB,"open",["firebase-installations-database",1]),(n=e.request)&&(n.onupgradeneeded=function(e){t&&t(new Oe(n.result,e.oldVersion,n.transaction))}),Ze=e.then(function(e){return new Ce(e)})),Ze}function et(o,a){return l(this,void 0,void 0,function(){var t,n,r,i;return p(this,function(e){switch(e.label){case 0:return t=$e(o),[4,Qe()];case 1:return r=e.sent(),n=r.transaction(Xe,"readwrite"),[4,(r=n.objectStore(Xe)).get(t)];case 2:return i=e.sent(),[4,r.put(a,t)];case 3:return e.sent(),[4,n.complete];case 4:return e.sent(),i&&i.fid===a.fid||Ge(o,a.fid),[2,a]}})})}function tt(r){return l(this,void 0,void 0,function(){var t,n;return p(this,function(e){switch(e.label){case 0:return t=$e(r),[4,Qe()];case 1:return n=e.sent(),[4,(n=n.transaction(Xe,"readwrite")).objectStore(Xe).delete(t)];case 2:return e.sent(),[4,n.complete];case 3:return e.sent(),[2]}})})}function nt(a,s){return l(this,void 0,void 0,function(){var t,n,r,i,o;return p(this,function(e){switch(e.label){case 0:return t=$e(a),[4,Qe()];case 1:return r=e.sent(),n=r.transaction(Xe,"readwrite"),[4,(r=n.objectStore(Xe)).get(t)];case 2:return i=e.sent(),void 0!==(o=s(i))?[3,4]:[4,r.delete(t)];case 3:return e.sent(),[3,6];case 4:return[4,r.put(o,t)];case 5:e.sent(),e.label=6;case 6:return[4,n.complete];case 7:return e.sent(),!o||i&&i.fid===o.fid||Ge(a,o.fid),[2,o]}})})}function rt(i){return l(this,void 0,void 0,function(){var n,t,r;return p(this,function(e){switch(e.label){case 0:return[4,nt(i,function(e){var t=ot(e||{fid:Ke(),registrationStatus:0}),t=function(e,t){{if(0!==t.registrationStatus)return 1===t.registrationStatus?{installationEntry:t,registrationPromise:function(i){return l(this,void 0,void 0,function(){var t,n,r;return p(this,function(e){switch(e.label){case 0:return[4,it(i)];case 1:t=e.sent(),e.label=2;case 2:return 1!==t.registrationStatus?[3,5]:[4,qe(100)];case 3:return e.sent(),[4,it(i)];case 4:return t=e.sent(),[3,2];case 5:return 0!==t.registrationStatus?[3,7]:[4,rt(i)];case 6:return r=e.sent(),n=r.installationEntry,(r=r.registrationPromise)?[2,r]:[2,n];case 7:return[2,t]}})})}(e)}:{installationEntry:t};if(!navigator.onLine){var n=Promise.reject(Re.create("app-offline"));return{installationEntry:t,registrationPromise:n}}var r={fid:t.fid,registrationStatus:1,registrationTime:Date.now()},n=function(r,i){return l(this,void 0,void 0,function(){var t,n;return p(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,7]),[4,function(a,e){var s=e.fid;return l(this,void 0,void 0,function(){var t,n,r,i,o;return p(this,function(e){switch(e.label){case 0:return t=Me(a),n=Be(a),o={fid:s,authVersion:ke,appId:a.appId,sdkVersion:Pe},r={method:"POST",headers:n,body:JSON.stringify(o)},[4,ze(function(){return fetch(t,r)})];case 1:return(i=e.sent()).ok?[4,i.json()]:[3,3];case 2:return o=e.sent(),[2,{fid:o.fid||s,registrationStatus:2,refreshToken:o.refreshToken,authToken:xe(o.authToken)}];case 3:return[4,Fe("Create Installation",i)];case 4:throw e.sent()}})})}(r,i)];case 1:return t=e.sent(),[2,et(r,t)];case 2:return Le(n=e.sent())&&409===n.customData.serverCode?[4,tt(r)]:[3,4];case 3:return e.sent(),[3,6];case 4:return[4,et(r,{fid:i.fid,registrationStatus:0})];case 5:e.sent(),e.label=6;case 6:throw n;case 7:return[2]}})})}(e,r);return{installationEntry:r,registrationPromise:n}}}(i,t);return n=t.registrationPromise,t.installationEntry})];case 1:return(t=e.sent()).fid!==He?[3,3]:(r={},[4,n]);case 2:return[2,(r.installationEntry=e.sent(),r)];case 3:return[2,{installationEntry:t,registrationPromise:n}]}})})}function it(e){return nt(e,function(e){if(!e)throw Re.create("installation-not-found");return ot(e)})}function ot(e){return 1===(t=e).registrationStatus&&t.registrationTime+Ae<Date.now()?{fid:e.fid,registrationStatus:0}:e;var t}function at(e,s){var c=e.appConfig,u=e.platformLoggerProvider;return l(this,void 0,void 0,function(){var n,r,i,o,a;return p(this,function(e){switch(e.label){case 0:return t=s.fid,n=Me(c)+"/"+t+"/authTokens:generate",r=Ue(c,s),(a=u.getImmediate({optional:!0}))&&r.append("x-firebase-client",a.getPlatformInfoString()),a={installation:{sdkVersion:Pe}},i={method:"POST",headers:r,body:JSON.stringify(a)},[4,ze(function(){return fetch(n,i)})];case 1:return(o=e.sent()).ok?[4,o.json()]:[3,3];case 2:return a=e.sent(),[2,xe(a)];case 3:return[4,Fe("Generate Auth Token",o)];case 4:throw e.sent()}var t})})}function st(i,o){return void 0===o&&(o=!1),l(this,void 0,void 0,function(){var r,t,n;return p(this,function(e){switch(e.label){case 0:return[4,nt(i.appConfig,function(e){if(!ut(e))throw Re.create("not-registered");var t,n=e.authToken;if(o||2!==(t=n).requestStatus||function(e){var t=Date.now();return t<e.creationTime||e.creationTime+e.expiresIn<t+je}(t)){if(1===n.requestStatus)return r=function(r,i){return l(this,void 0,void 0,function(){var t,n;return p(this,function(e){switch(e.label){case 0:return[4,ct(r.appConfig)];case 1:t=e.sent(),e.label=2;case 2:return 1!==t.authToken.requestStatus?[3,5]:[4,qe(100)];case 3:return e.sent(),[4,ct(r.appConfig)];case 4:return t=e.sent(),[3,2];case 5:return 0===(n=t.authToken).requestStatus?[2,st(r,i)]:[2,n]}})})}(i,o),e;if(!navigator.onLine)throw Re.create("app-offline");n=(t=e,n={requestStatus:1,requestTime:Date.now()},f(f({},t),{authToken:n}));return r=function(i,o){return l(this,void 0,void 0,function(){var t,n,r;return p(this,function(e){switch(e.label){case 0:return e.trys.push([0,3,,8]),[4,at(i,o)];case 1:return t=e.sent(),r=f(f({},o),{authToken:t}),[4,et(i.appConfig,r)];case 2:return e.sent(),[2,t];case 3:return!Le(n=e.sent())||401!==n.customData.serverCode&&404!==n.customData.serverCode?[3,5]:[4,tt(i.appConfig)];case 4:return e.sent(),[3,7];case 5:return r=f(f({},o),{authToken:{requestStatus:0}}),[4,et(i.appConfig,r)];case 6:e.sent(),e.label=7;case 7:throw n;case 8:return[2]}})})}(i,n),n}return e})];case 1:return t=e.sent(),r?[4,r]:[3,3];case 2:return n=e.sent(),[3,4];case 3:n=t.authToken,e.label=4;case 4:return[2,n]}})})}function ct(e){return nt(e,function(e){if(!ut(e))throw Re.create("not-registered");var t,n=e.authToken;return 1===(t=n).requestStatus&&t.requestTime+Ae<Date.now()?f(f({},e),{authToken:{requestStatus:0}}):e})}function ut(e){return void 0!==e&&2===e.registrationStatus}function lt(n,r){return void 0===r&&(r=!1),l(this,void 0,void 0,function(){var t;return p(this,function(e){switch(e.label){case 0:return[4,function(n){return l(this,void 0,void 0,function(){var t;return p(this,function(e){switch(e.label){case 0:return[4,rt(n)];case 1:return(t=e.sent().registrationPromise)?[4,t]:[3,3];case 2:e.sent(),e.label=3;case 3:return[2]}})})}((t=n).appConfig)];case 1:return e.sent(),[4,st(t,r)];case 2:return[2,e.sent().token]}})})}function ft(e){return Re.create("missing-app-config-values",{valueName:e})}function pt(e){var t=X(e.getProvider("app").getImmediate(),dt).getImmediate();return{getId:function(){return function(i){return l(this,void 0,void 0,function(){var t,n,r;return p(this,function(e){switch(e.label){case 0:return[4,rt((t=i).appConfig)];case 1:return n=e.sent(),r=n.installationEntry,(n.registrationPromise||st(t)).catch(console.error),[2,r.fid]}})})}(t)},getToken:function(e){return lt(t,e)}}}var dt="installations";Y(new E(dt,function(e){var t=e.getProvider("app").getImmediate();return{app:t,appConfig:function(e){var t,n;if(!e||!e.options)throw ft("App Configuration");if(!e.name)throw ft("App Name");try{for(var r=d(["projectId","apiKey","appId"]),i=r.next();!i.done;i=r.next()){var o=i.value;if(!e.options[o])throw ft(o)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}return{appName:e.name,projectId:e.options.projectId,apiKey:e.options.apiKey,appId:e.options.appId}}(t),platformLoggerProvider:X(t,"platform-logger"),_delete:function(){return Promise.resolve()}}},"PUBLIC")),Y(new E("installations-internal",pt,"PRIVATE")),ae(Ne,Z),ae(Ne,Z,"esm5");var ht,mt,vt="@firebase/performance",gt="0.5.5",bt=gt,yt="FB-PERF-TRACE-MEASURE",_t="@firebase/performance/config",wt="@firebase/performance/configexpire",Ne="Performance",Z=((Z={})["trace started"]="Trace {$traceName} was started before.",Z["trace stopped"]="Trace {$traceName} is not running.",Z["nonpositive trace startTime"]="Trace {$traceName} startTime should be positive.",Z["nonpositive trace duration"]="Trace {$traceName} duration should be positive.",Z["no window"]="Window is not available.",Z["no app id"]="App id is not available.",Z["no project id"]="Project id is not available.",Z["no api key"]="Api key is not available.",Z["invalid cc log"]="Attempted to queue invalid cc event",Z["FB not default"]="Performance can only start when Firebase app instance is the default one.",Z["RC response not ok"]="RC response is not ok",Z["invalid attribute name"]="Attribute name {$attributeName} is invalid.",Z["invalid attribute value"]="Attribute value {$attributeValue} is invalid.",Z["invalid custom metric name"]="Custom metric name {$customMetricName} is invalid",Z["invalid String merger input"]="Input for String merger is invalid, contact support team to resolve.",Z["already initialized"]="initializePerformance() has already been called with different options. To avoid this error, call initializePerformance() with the same options as when it was originally called, or call getPerformance() to return the already initialized instance.",Z),It=new m("performance",Ne,Z),Et=new M(Ne);Et.logLevel=P.INFO;var St,Tt,Ot=(Ct.prototype.getUrl=function(){return this.windowLocation.href.split("?")[0]},Ct.prototype.mark=function(e){this.performance&&this.performance.mark&&this.performance.mark(e)},Ct.prototype.measure=function(e,t,n){this.performance&&this.performance.measure&&this.performance.measure(e,t,n)},Ct.prototype.getEntriesByType=function(e){return this.performance&&this.performance.getEntriesByType?this.performance.getEntriesByType(e):[]},Ct.prototype.getEntriesByName=function(e){return this.performance&&this.performance.getEntriesByName?this.performance.getEntriesByName(e):[]},Ct.prototype.getTimeOrigin=function(){return this.performance&&(this.performance.timeOrigin||this.performance.timing.navigationStart)},Ct.prototype.requiredApisAvailable=function(){return fetch&&Promise&&"undefined"!=typeof navigator&&navigator.cookieEnabled?"object"==typeof indexedDB||(Et.info("IndexedDB is not supported by current browswer"),!1):(Et.info("Firebase Performance cannot start if browser does not support fetch and Promise or cookie is disabled."),!1)},Ct.prototype.setupObserver=function(e,i){this.PerformanceObserver&&new this.PerformanceObserver(function(e){for(var t=0,n=e.getEntries();t<n.length;t++){var r=n[t];i(r)}}).observe({entryTypes:[e]})},Ct.getInstance=function(){return ht=void 0===ht?new Ct(mt):ht},Ct);function Ct(e){if(!(this.window=e))throw It.create("no window");this.performance=e.performance,this.PerformanceObserver=e.PerformanceObserver,this.windowLocation=e.location,this.navigator=e.navigator,this.document=e.document,this.navigator&&this.navigator.cookieEnabled&&(this.localStorage=e.localStorage),e.perfMetrics&&e.perfMetrics.onFirstInputDelay&&(this.onFirstInputDelay=e.perfMetrics.onFirstInputDelay)}function Nt(e,t){var n=e.length-t.length;if(n<0||1<n)throw It.create("invalid String merger input");for(var r=[],i=0;i<e.length;i++)r.push(e.charAt(i)),t.length>i&&r.push(t.charAt(i));return r.join("")}var At,Pt,kt=(Dt.prototype.getFlTransportFullUrl=function(){return this.flTransportEndpointUrl.concat("?key=",this.transportKey)},Dt.getInstance=function(){return Tt=void 0===Tt?new Dt:Tt},Dt);function Dt(){this.instrumentationEnabled=!0,this.dataCollectionEnabled=!0,this.loggingEnabled=!1,this.tracesSamplingRate=1,this.networkRequestsSamplingRate=1,this.logEndPointUrl="https://firebaselogging.googleapis.com/v0cc/log?format=json_proto",this.flTransportEndpointUrl=Nt("hts/frbslgigp.ogepscmv/ieo/eaylg","tp:/ieaeogn-agolai.o/1frlglgc/o"),this.transportKey=Nt("AzSC8r6ReiGqFMyfvgow","Iayx0u-XT3vksVM-pIV"),this.logSource=462,this.logTraceAfterSampling=!1,this.logNetworkAfterSampling=!1,this.configTimeToLive=12}(Pt=At=At||{})[Pt.UNKNOWN=0]="UNKNOWN",Pt[Pt.VISIBLE=1]="VISIBLE",Pt[Pt.HIDDEN=2]="HIDDEN";var jt=["firebase_","google_","ga_"],Rt=new RegExp("^[a-zA-Z]\\w*$");function Lt(){switch(Ot.getInstance().document.visibilityState){case"visible":return At.VISIBLE;case"hidden":return At.HIDDEN;default:return At.UNKNOWN}}function Mt(e){var t=null===(t=e.options)||void 0===t?void 0:t.appId;if(!t)throw It.create("no app id");return t}var xt="0.0.1",Ft={loggingEnabled:!0},Bt="FIREBASE_INSTALLATIONS_AUTH";function Ut(e,t){var r,i,n=function(){var e=Ot.getInstance().localStorage;if(e){var t=e.getItem(wt);if(t&&function(e){return Number(e)>Date.now()}(t)){e=e.getItem(_t);if(e)try{return JSON.parse(e)}catch(e){return}}}}();return n?(qt(n),Promise.resolve()):(i=t,function(e){var t=e.getToken();return t.then(function(e){}),t}((r=e).installations).then(function(e){var t=function(e){var t=null===(t=e.options)||void 0===t?void 0:t.projectId;if(!t)throw It.create("no project id");return t}(r.app),n=function(e){var t=null===(t=e.options)||void 0===t?void 0:t.apiKey;if(!t)throw It.create("no api key");return t}(r.app),n=new Request("https://firebaseremoteconfig.googleapis.com/v1/projects/"+t+"/namespaces/fireperf:fetch?key="+n,{method:"POST",headers:{Authorization:Bt+" "+e},body:JSON.stringify({app_instance_id:i,app_instance_id_token:e,app_id:Mt(r.app),app_version:bt,sdk_version:xt})});return fetch(n).then(function(e){if(e.ok)return e.json();throw It.create("RC response not ok")})}).catch(function(){Et.info(zt)}).then(qt).then(function(e){var t;e=e,t=Ot.getInstance().localStorage,e&&t&&(t.setItem(_t,JSON.stringify(e)),t.setItem(wt,String(Date.now()+60*kt.getInstance().configTimeToLive*60*1e3)))},function(){}))}var zt="Could not fetch config, will use default configs";function qt(e){if(!e)return e;var t=kt.getInstance(),n=e.entries||{};return void 0!==n.fpr_enabled?t.loggingEnabled="true"===String(n.fpr_enabled):t.loggingEnabled=Ft.loggingEnabled,n.fpr_log_source&&(t.logSource=Number(n.fpr_log_source)),n.fpr_log_endpoint_url&&(t.logEndPointUrl=n.fpr_log_endpoint_url),n.fpr_log_transport_key&&(t.transportKey=n.fpr_log_transport_key),void 0!==n.fpr_vc_network_request_sampling_rate&&(t.networkRequestsSamplingRate=Number(n.fpr_vc_network_request_sampling_rate)),void 0!==n.fpr_vc_trace_sampling_rate&&(t.tracesSamplingRate=Number(n.fpr_vc_trace_sampling_rate)),t.logTraceAfterSampling=Vt(t.tracesSamplingRate),t.logNetworkAfterSampling=Vt(t.networkRequestsSamplingRate),e}function Vt(e){return Math.random()<=e}var Ht,Kt=1;function $t(e){var n;return Kt=2,Ht=Ht||(n=e,function(){var n=Ot.getInstance().document;return new Promise(function(e){var t;n&&"complete"!==n.readyState?(t=function(){"complete"===n.readyState&&(n.removeEventListener("readystatechange",t),e())},n.addEventListener("readystatechange",t)):e()})}().then(function(){return e=n.installations,(t=e.getId()).then(function(e){St=e}),t;var e,t}).then(function(e){return Ut(n,e)}).then(Wt,Wt))}function Wt(){Kt=3}var Gt,Jt=1e4,Yt=3,Xt=1e3,Zt=Yt,Qt=[],en=!1;function tn(e){setTimeout(function(){var e,t;if(0!==Zt)return Qt.length?(e=Qt.splice(0,Xt),t=e.map(function(e){return{source_extension_json_proto3:e.message,event_time_ms:String(e.eventTime)}}),void function(e,r){return function(e){var t=kt.getInstance().getFlTransportFullUrl();return fetch(t,{method:"POST",body:JSON.stringify(e)})}(e).then(function(e){return e.ok||Et.info("Call to Firebase backend failed."),e.json()}).then(function(e){var t=Number(e.nextRequestWaitMillis),n=Jt;isNaN(t)||(n=Math.max(t,n));t=e.logResponseDetails;Array.isArray(t)&&0<t.length&&"RETRY_REQUEST_LATER"===t[0].responseAction&&(Qt=a(a([],r),Qt),Et.info("Retry transport request later.")),Zt=Yt,tn(n)})}({request_time_ms:String(Date.now()),client_info:{client_type:1,js_client_info:{}},log_source:kt.getInstance().logSource,log_event:t},e).catch(function(){Qt=a(a([],e),Qt),Zt--,Et.info("Tries left: "+Zt+"."),tn(Jt)})):tn(Jt)},e)}function nn(n){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];!function(e){if(!e.eventTime||!e.message)throw It.create("invalid cc log");Qt=a(a([],Qt),[e])}({message:n.apply(void 0,e),eventTime:Date.now()})}}function rn(e,t){(Gt=Gt||nn(sn))(e,t)}function on(e){var t=kt.getInstance();!t.instrumentationEnabled&&e.isAuto||(t.dataCollectionEnabled||e.isAuto)&&Ot.getInstance().requiredApisAvailable()&&(e.isAuto&&Lt()!==At.VISIBLE||(3===Kt?an(e):$t(e.performanceController).then(function(){return an(e)},function(){return an(e)})))}function an(e){var t;!St||(t=kt.getInstance()).loggingEnabled&&t.logTraceAfterSampling&&setTimeout(function(){return rn(e,1)},0)}function sn(e,t){return 0===t?(n={url:e.url,http_method:e.httpMethod||0,http_response_code:200,response_payload_bytes:e.responsePayloadBytes,client_start_time_us:e.startTimeUs,time_to_response_initiated_us:e.timeToResponseInitiatedUs,time_to_response_completed_us:e.timeToResponseCompletedUs},n={application_info:cn(e.performanceController.app),network_request_metric:n},JSON.stringify(n)):function(e){var t={name:e.name,is_auto:e.isAuto,client_start_time_us:e.startTimeUs,duration_us:e.durationUs};0!==Object.keys(e.counters).length&&(t.counters=e.counters);var n=e.getAttributes();0!==Object.keys(n).length&&(t.custom_attributes=n);t={application_info:cn(e.performanceController.app),trace_metric:t};return JSON.stringify(t)}(e);var n}function cn(e){return{google_app_id:Mt(e),app_instance_id:St,web_app_info:{sdk_version:bt,page_url:Ot.getInstance().getUrl(),service_worker_status:"serviceWorker"in(t=Ot.getInstance().navigator)?t.serviceWorker.controller?2:3:1,visibility_state:Lt(),effective_connection_type:function(){var e=Ot.getInstance().navigator.connection;switch(e&&e.effectiveType){case"slow-2g":return 1;case"2g":return 2;case"3g":return 3;case"4g":return 4;default:return 0}}()},application_process_state:0};var t}var un=["_fp","_fcp","_fid"];var ln=(fn.prototype.start=function(){if(1!==this.state)throw It.create("trace started",{traceName:this.name});this.api.mark(this.traceStartMark),this.state=2},fn.prototype.stop=function(){if(2!==this.state)throw It.create("trace stopped",{traceName:this.name});this.state=3,this.api.mark(this.traceStopMark),this.api.measure(this.traceMeasure,this.traceStartMark,this.traceStopMark),this.calculateTraceMetrics(),on(this)},fn.prototype.record=function(e,t,n){if(e<=0)throw It.create("nonpositive trace startTime",{traceName:this.name});if(t<=0)throw It.create("nonpositive trace duration",{traceName:this.name});if(this.durationUs=Math.floor(1e3*t),this.startTimeUs=Math.floor(1e3*e),n&&n.attributes&&(this.customAttributes=f({},n.attributes)),n&&n.metrics)for(var r=0,i=Object.keys(n.metrics);r<i.length;r++){var o=i[r];isNaN(Number(n.metrics[o]))||(this.counters[o]=Number(Math.floor(n.metrics[o])))}on(this)},fn.prototype.incrementMetric=function(e,t){void 0===t&&(t=1),void 0===this.counters[e]?this.putMetric(e,t):this.putMetric(e,this.counters[e]+t)},fn.prototype.putMetric=function(e,t){if(r=e,i=this.name,0===r.length||100<r.length||!(i&&i.startsWith("_wt_")&&-1<un.indexOf(r))&&r.startsWith("_"))throw It.create("invalid custom metric name",{customMetricName:e});var n,r,i;this.counters[e]=(t=t,(n=Math.floor(t))<t&&Et.info("Metric value should be an Integer, setting the value as : "+n+"."),n)},fn.prototype.getMetric=function(e){return this.counters[e]||0},fn.prototype.putAttribute=function(e,t){var n,r,i=!(0===(n=e).length||40<n.length)&&(!jt.some(function(e){return n.startsWith(e)})&&!!n.match(Rt)),o=0!==(r=t).length&&r.length<=100;if(i&&o)this.customAttributes[e]=t;else{if(!i)throw It.create("invalid attribute name",{attributeName:e});if(!o)throw It.create("invalid attribute value",{attributeValue:t})}},fn.prototype.getAttribute=function(e){return this.customAttributes[e]},fn.prototype.removeAttribute=function(e){void 0!==this.customAttributes[e]&&delete this.customAttributes[e]},fn.prototype.getAttributes=function(){return f({},this.customAttributes)},fn.prototype.setStartTime=function(e){this.startTimeUs=e},fn.prototype.setDuration=function(e){this.durationUs=e},fn.prototype.calculateTraceMetrics=function(){var e=this.api.getEntriesByName(this.traceMeasure),e=e&&e[0];e&&(this.durationUs=Math.floor(1e3*e.duration),this.startTimeUs=Math.floor(1e3*(e.startTime+this.api.getTimeOrigin())))},fn.createOobTrace=function(e,t,n,r){var i,o=Ot.getInstance().getUrl();o&&(i=new fn(e,"_wt_"+o,!0),o=Math.floor(1e3*Ot.getInstance().getTimeOrigin()),i.setStartTime(o),t&&t[0]&&(i.setDuration(Math.floor(1e3*t[0].duration)),i.putMetric("domInteractive",Math.floor(1e3*t[0].domInteractive)),i.putMetric("domContentLoadedEventEnd",Math.floor(1e3*t[0].domContentLoadedEventEnd)),i.putMetric("loadEventEnd",Math.floor(1e3*t[0].loadEventEnd))),n&&((o=n.find(function(e){return"first-paint"===e.name}))&&o.startTime&&i.putMetric("_fp",Math.floor(1e3*o.startTime)),(o=n.find(function(e){return"first-contentful-paint"===e.name}))&&o.startTime&&i.putMetric("_fcp",Math.floor(1e3*o.startTime)),r&&i.putMetric("_fid",Math.floor(1e3*r))),on(i))},fn.createUserTimingTrace=function(e,t){on(new fn(e,t,!1,t))},fn);function fn(e,t,n,r){void 0===n&&(n=!1),this.performanceController=e,this.name=t,this.isAuto=n,this.state=1,this.customAttributes={},this.counters={},this.api=Ot.getInstance(),this.randomId=Math.floor(1e6*Math.random()),this.isAuto||(this.traceStartMark="FB-PERF-TRACE-START-"+this.randomId+"-"+this.name,this.traceStopMark="FB-PERF-TRACE-STOP-"+this.randomId+"-"+this.name,this.traceMeasure=r||yt+"-"+this.randomId+"-"+this.name,r&&this.calculateTraceMetrics())}function pn(e,t){var n,r,i,o,a=t;a&&void 0!==a.responseStart&&(i=Ot.getInstance().getTimeOrigin(),o=Math.floor(1e3*(a.startTime+i)),r=a.responseStart?Math.floor(1e3*(a.responseStart-a.startTime)):void 0,i=Math.floor(1e3*(a.responseEnd-a.startTime)),a={performanceController:e,url:a.name&&a.name.split("?")[0],responsePayloadBytes:a.transferSize,startTimeUs:o,timeToResponseInitiatedUs:r,timeToResponseCompletedUs:i},n=a,(o=kt.getInstance()).instrumentationEnabled&&(r=n.url,i=o.logEndPointUrl.split("?")[0],a=o.flTransportEndpointUrl.split("?")[0],r!==i&&r!==a&&o.loggingEnabled&&o.logNetworkAfterSampling&&setTimeout(function(){return rn(n,0)},0)))}var dn=5e3;function hn(e){St&&(setTimeout(function(){return function(t){var e=Ot.getInstance(),n=e.getEntriesByType("navigation"),r=e.getEntriesByType("paint");{var i;e.onFirstInputDelay?(i=setTimeout(function(){ln.createOobTrace(t,n,r),i=void 0},dn),e.onFirstInputDelay(function(e){i&&(clearTimeout(i),ln.createOobTrace(t,n,r,e))})):ln.createOobTrace(t,n,r)}}(e)},0),setTimeout(function(){return function(t){for(var e=Ot.getInstance(),n=e.getEntriesByType("resource"),r=0,i=n;r<i.length;r++){var o=i[r];pn(t,o)}e.setupObserver("resource",function(e){return pn(t,e)})}(e)},0),setTimeout(function(){return function(t){for(var e=Ot.getInstance(),n=e.getEntriesByType("measure"),r=0,i=n;r<i.length;r++){var o=i[r];mn(t,o)}e.setupObserver("measure",function(e){return mn(t,e)})}(e)},0))}function mn(e,t){var n=t.name;n.substring(0,yt.length)!==yt&&ln.createUserTimingTrace(e,n)}var vn=(gn.prototype._init=function(e){var t=this;this.initialized||(void 0!==(null==e?void 0:e.dataCollectionEnabled)&&(this.dataCollectionEnabled=e.dataCollectionEnabled),void 0!==(null==e?void 0:e.instrumentationEnabled)&&(this.instrumentationEnabled=e.instrumentationEnabled),Ot.getInstance().requiredApisAvailable()?new Promise(function(e,t){try{var n=!0,r="validate-browser-context-for-indexeddb-analytics-module",i=self.indexedDB.open(r);i.onsuccess=function(){i.result.close(),n||self.indexedDB.deleteDatabase(r),e(!0)},i.onupgradeneeded=function(){n=!1},i.onerror=function(){var e;t((null===(e=i.error)||void 0===e?void 0:e.message)||"")}}catch(e){t(e)}}).then(function(e){e&&(en||(tn(5500),en=!0),$t(t).then(function(){return hn(t)},function(){return hn(t)}),t.initialized=!0)}).catch(function(e){Et.info("Environment doesn't support IndexedDB: "+e)}):Et.info('Firebase Performance cannot start if the browser does not support "Fetch" and "Promise", or cookies are disabled.'))},Object.defineProperty(gn.prototype,"instrumentationEnabled",{get:function(){return kt.getInstance().instrumentationEnabled},set:function(e){kt.getInstance().instrumentationEnabled=e},enumerable:!1,configurable:!0}),Object.defineProperty(gn.prototype,"dataCollectionEnabled",{get:function(){return kt.getInstance().dataCollectionEnabled},set:function(e){kt.getInstance().dataCollectionEnabled=e},enumerable:!1,configurable:!0}),gn);function gn(e,t){this.app=e,this.installations=t,this.initialized=!1}var bn="[DEFAULT]";Y(new E("performance",function(e,t){var n=t.options,r=e.getProvider("app").getImmediate(),i=e.getProvider("installations-internal").getImmediate();if(r.name!==bn)throw It.create("FB not default");if("undefined"==typeof window)throw It.create("no window");mt=window;i=new vn(r,i);return i._init(n),i},"PUBLIC")),ae(vt,gt),ae(vt,gt,"esm5");var yn=(Object.defineProperty(_n.prototype,"instrumentationEnabled",{get:function(){return this._delegate.instrumentationEnabled},set:function(e){this._delegate.instrumentationEnabled=e},enumerable:!1,configurable:!0}),Object.defineProperty(_n.prototype,"dataCollectionEnabled",{get:function(){return this._delegate.dataCollectionEnabled},set:function(e){this._delegate.dataCollectionEnabled=e},enumerable:!1,configurable:!0}),_n.prototype.trace=function(e){return t=this._delegate,t=(n=t)&&n._delegate?n._delegate:n,new ln(t,e);var t,n},_n);function _n(e,t){this.app=e,this._delegate=t}var wn;function In(e){var t=e.getProvider("app-compat").getImmediate(),n=e.getProvider("performance").getImmediate();return new yn(t,n)}(wn=me).INTERNAL.registerComponent(new E("performance-compat",In,"PUBLIC")),wn.registerVersion("@firebase/performance-compat","0.1.5");return me.registerVersion("firebase","9.6.2","compat-lite"),me});
|
|
1
|
+
!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 f=function(){return(f=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function l(e,a,s,c){return new(s=s||Promise)(function(n,t){function r(e){try{o(c.next(e))}catch(e){t(e)}}function i(e){try{o(c.throw(e))}catch(e){t(e)}}function o(e){var t;e.done?n(e.value):((t=e.value)instanceof s?t:new s(function(e){e(t)})).then(r,i)}o((c=c.apply(e,a||[])).next())})}function p(n,r){var i,o,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(t){return function(e){return function(t){if(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,o&&(a=2&t[0]?o.return:t[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,t[1])).done)return a;switch(o=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,o=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3])){s.label=t[1];break}if(6===t[0]&&s.label<a[1]){s.label=a[1],a=t;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(t);break}a[2]&&s.ops.pop(),s.trys.pop();continue}t=r.call(n,s)}catch(e){t=[6,e],o=0}finally{i=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([t,e])}}}function d(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&r>=e.length?void 0:e)&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function h(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||0<t--)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function a(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||((r=r||Array.prototype.slice.call(t,0,i))[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}function c(e,t){if(!(t instanceof Object))return t;switch(t.constructor){case Date:return new Date(t.getTime());case Object:void 0===e&&(e={});break;case Array:e=[];break;default:return t}for(var n in t)t.hasOwnProperty(n)&&"__proto__"!==n&&(e[n]=c(e[n],t[n]));return e}var i=(e.prototype.wrapCallback=function(n){var r=this;return function(e,t){e?r.reject(e):r.resolve(t),"function"==typeof n&&(r.promise.catch(function(){}),1===n.length?n(e):n(e,t))}},e);function e(){var n=this;this.reject=function(){},this.resolve=function(){},this.promise=new Promise(function(e,t){n.resolve=e,n.reject=t})}var o,s=(function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(u,o=Error),u);function u(e,t,n){var r=o.call(this,t)||this;return r.code=e,r.customData=n,r.name="FirebaseError",Object.setPrototypeOf(r,u.prototype),Error.captureStackTrace&&Error.captureStackTrace(r,m.prototype.create),r}var m=(t.prototype.create=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r,i=t[0]||{},o=this.service+"/"+e,a=this.errors[e],a=a?(r=i,a.replace(v,function(e,t){var n=r[t];return null!=n?String(n):"<"+t+"?>"})):"Error",a=this.serviceName+": "+a+" ("+o+").";return new s(o,a,i)},t);function t(e,t,n){this.service=e,this.serviceName=t,this.errors=n}var v=/\{\$([^}]+)}/g;function g(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function b(e,t){if(e===t)return 1;for(var n=Object.keys(e),r=Object.keys(t),i=0,o=n;i<o.length;i++){var a=o[i];if(!r.includes(a))return;var s=e[a],c=t[a];if(y(s)&&y(c)){if(!b(s,c))return}else if(s!==c)return}for(var u=0,l=r;u<l.length;u++){a=l[u];if(!n.includes(a))return}return 1}function y(e){return null!==e&&"object"==typeof e}function n(e,t){var n=new _(e,t);return n.subscribe.bind(n)}var _=(w.prototype.next=function(t){this.forEachObserver(function(e){e.next(t)})},w.prototype.error=function(t){this.forEachObserver(function(e){e.error(t)}),this.close(t)},w.prototype.complete=function(){this.forEachObserver(function(e){e.complete()}),this.close()},w.prototype.subscribe=function(e,t,n){var r,i=this;if(void 0===e&&void 0===t&&void 0===n)throw new Error("Missing Observer.");void 0===(r=function(e,t){if("object"!=typeof e||null===e)return!1;for(var n=0,r=t;n<r.length;n++){var i=r[n];if(i in e&&"function"==typeof e[i])return!0}return!1}(e,["next","error","complete"])?e:{next:e,error:t,complete:n}).next&&(r.next=I),void 0===r.error&&(r.error=I),void 0===r.complete&&(r.complete=I);var o=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(function(){try{i.finalError?r.error(i.finalError):r.complete()}catch(e){}}),this.observers.push(r),o},w.prototype.unsubscribeOne=function(e){void 0!==this.observers&&void 0!==this.observers[e]&&(delete this.observers[e],--this.observerCount,0===this.observerCount&&void 0!==this.onNoObservers&&this.onNoObservers(this))},w.prototype.forEachObserver=function(e){if(!this.finalized)for(var t=0;t<this.observers.length;t++)this.sendOne(t,e)},w.prototype.sendOne=function(e,t){var n=this;this.task.then(function(){if(void 0!==n.observers&&void 0!==n.observers[e])try{t(n.observers[e])}catch(e){"undefined"!=typeof console&&console.error&&console.error(e)}})},w.prototype.close=function(e){var t=this;this.finalized||(this.finalized=!0,void 0!==e&&(this.finalError=e),this.task.then(function(){t.observers=void 0,t.onNoObservers=void 0}))},w);function w(e,t){var n=this;this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=t,this.task.then(function(){e(n)}).catch(function(e){n.error(e)})}function I(){}var E=(S.prototype.setInstantiationMode=function(e){return this.instantiationMode=e,this},S.prototype.setMultipleInstances=function(e){return this.multipleInstances=e,this},S.prototype.setServiceProps=function(e){return this.serviceProps=e,this},S.prototype.setInstanceCreatedCallback=function(e){return this.onInstanceCreated=e,this},S);function S(e,t,n){this.name=e,this.instanceFactory=t,this.type=n,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}var T="[DEFAULT]",O=(C.prototype.get=function(e){var t=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(t)){var n=new i;if(this.instancesDeferred.set(t,n),this.isInitialized(t)||this.shouldAutoInitialize())try{var r=this.getOrInitializeService({instanceIdentifier:t});r&&n.resolve(r)}catch(e){}}return this.instancesDeferred.get(t).promise},C.prototype.getImmediate=function(e){var t=this.normalizeInstanceIdentifier(null==e?void 0:e.identifier),n=null!==(n=null==e?void 0:e.optional)&&void 0!==n&&n;if(!this.isInitialized(t)&&!this.shouldAutoInitialize()){if(n)return null;throw Error("Service "+this.name+" is not available")}try{return this.getOrInitializeService({instanceIdentifier:t})}catch(e){if(n)return null;throw e}},C.prototype.getComponent=function(){return this.component},C.prototype.setComponent=function(e){var t,n;if(e.name!==this.name)throw Error("Mismatching Component "+e.name+" for Provider "+this.name+".");if(this.component)throw Error("Component for "+this.name+" has already been provided");if(this.component=e,this.shouldAutoInitialize()){if("EAGER"===e.instantiationMode)try{this.getOrInitializeService({instanceIdentifier:T})}catch(e){}try{for(var r=d(this.instancesDeferred.entries()),i=r.next();!i.done;i=r.next()){var o=h(i.value,2),a=o[0],s=o[1],c=this.normalizeInstanceIdentifier(a);try{var u=this.getOrInitializeService({instanceIdentifier:c});s.resolve(u)}catch(e){}}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}}},C.prototype.clearInstance=function(e){this.instancesDeferred.delete(e=void 0===e?T:e),this.instancesOptions.delete(e),this.instances.delete(e)},C.prototype.delete=function(){return l(this,void 0,void 0,function(){var t;return p(this,function(e){switch(e.label){case 0:return t=Array.from(this.instances.values()),[4,Promise.all(a(a([],h(t.filter(function(e){return"INTERNAL"in e}).map(function(e){return e.INTERNAL.delete()}))),h(t.filter(function(e){return"_delete"in e}).map(function(e){return e._delete()}))))];case 1:return e.sent(),[2]}})})},C.prototype.isComponentSet=function(){return null!=this.component},C.prototype.isInitialized=function(e){return this.instances.has(e=void 0===e?T:e)},C.prototype.getOptions=function(e){return this.instancesOptions.get(e=void 0===e?T:e)||{}},C.prototype.initialize=function(e){var t,n,r=(e=void 0===e?{}:e).options,r=void 0===r?{}:r,i=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(i))throw Error(this.name+"("+i+") has already been initialized");if(!this.isComponentSet())throw Error("Component "+this.name+" has not been registered yet");var o=this.getOrInitializeService({instanceIdentifier:i,options:r});try{for(var a=d(this.instancesDeferred.entries()),s=a.next();!s.done;s=a.next()){var c=h(s.value,2),u=c[0],l=c[1];i===this.normalizeInstanceIdentifier(u)&&l.resolve(o)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return o},C.prototype.onInit=function(e,t){var n=this.normalizeInstanceIdentifier(t),r=null!==(i=this.onInitCallbacks.get(n))&&void 0!==i?i:new Set;r.add(e),this.onInitCallbacks.set(n,r);var i=this.instances.get(n);return i&&e(i,n),function(){r.delete(e)}},C.prototype.invokeOnInitCallbacks=function(e,t){var n,r,i=this.onInitCallbacks.get(t);if(i)try{for(var o=d(i),a=o.next();!a.done;a=o.next()){var s=a.value;try{s(e,t)}catch(e){}}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}},C.prototype.getOrInitializeService=function(e){var t=e.instanceIdentifier,n=e.options,r=void 0===n?{}:n,n=this.instances.get(t);if(!n&&this.component&&(n=this.component.instanceFactory(this.container,{instanceIdentifier:(e=t)===T?void 0:e,options:r}),this.instances.set(t,n),this.instancesOptions.set(t,r),this.invokeOnInitCallbacks(n,t),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,t,n)}catch(e){}return n||null},C.prototype.normalizeInstanceIdentifier=function(e){return void 0===e&&(e=T),!this.component||this.component.multipleInstances?e:T},C.prototype.shouldAutoInitialize=function(){return!!this.component&&"EXPLICIT"!==this.component.instantiationMode},C);function C(e,t){this.name=e,this.container=t,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}var N=(A.prototype.addComponent=function(e){var t=this.getProvider(e.name);if(t.isComponentSet())throw new Error("Component "+e.name+" has already been registered with "+this.name);t.setComponent(e)},A.prototype.addOrOverwriteComponent=function(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)},A.prototype.getProvider=function(e){if(this.providers.has(e))return this.providers.get(e);var t=new O(e,this);return this.providers.set(e,t),t},A.prototype.getProviders=function(){return Array.from(this.providers.values())},A);function A(e){this.name=e,this.providers=new Map}var P,k=[];(Pt=P=P||{})[Pt.DEBUG=0]="DEBUG",Pt[Pt.VERBOSE=1]="VERBOSE",Pt[Pt.INFO=2]="INFO",Pt[Pt.WARN=3]="WARN",Pt[Pt.ERROR=4]="ERROR",Pt[Pt.SILENT=5]="SILENT";function D(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];if(!(t<e.logLevel)){var i=(new Date).toISOString(),o=L[t];if(!o)throw new Error("Attempted to log a message with an invalid logType (value: "+t+")");console[o].apply(console,a(["["+i+"] "+e.name+":"],n))}}var j={debug:P.DEBUG,verbose:P.VERBOSE,info:P.INFO,warn:P.WARN,error:P.ERROR,silent:P.SILENT},R=P.INFO,L=((he={})[P.DEBUG]="log",he[P.VERBOSE]="log",he[P.INFO]="info",he[P.WARN]="warn",he[P.ERROR]="error",he),M=(Object.defineProperty(x.prototype,"logLevel",{get:function(){return this._logLevel},set:function(e){if(!(e in P))throw new TypeError('Invalid value "'+e+'" assigned to `logLevel`');this._logLevel=e},enumerable:!1,configurable:!0}),x.prototype.setLogLevel=function(e){this._logLevel="string"==typeof e?j[e]:e},Object.defineProperty(x.prototype,"logHandler",{get:function(){return this._logHandler},set:function(e){if("function"!=typeof e)throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"userLogHandler",{get:function(){return this._userLogHandler},set:function(e){this._userLogHandler=e},enumerable:!1,configurable:!0}),x.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._userLogHandler&&this._userLogHandler.apply(this,a([this,P.DEBUG],e)),this._logHandler.apply(this,a([this,P.DEBUG],e))},x.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._userLogHandler&&this._userLogHandler.apply(this,a([this,P.VERBOSE],e)),this._logHandler.apply(this,a([this,P.VERBOSE],e))},x.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._userLogHandler&&this._userLogHandler.apply(this,a([this,P.INFO],e)),this._logHandler.apply(this,a([this,P.INFO],e))},x.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._userLogHandler&&this._userLogHandler.apply(this,a([this,P.WARN],e)),this._logHandler.apply(this,a([this,P.WARN],e))},x.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._userLogHandler&&this._userLogHandler.apply(this,a([this,P.ERROR],e)),this._logHandler.apply(this,a([this,P.ERROR],e))},x);function x(e){this.name=e,this._logLevel=R,this._logHandler=D,this._userLogHandler=null,k.push(this)}function F(a,t){for(var e=0,n=k;e<n.length;e++)!function(e){var o=null;t&&t.level&&(o=j[t.level]),e.userLogHandler=null===a?null:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i=n.map(function(e){if(null==e)return null;if("string"==typeof e)return e;if("number"==typeof e||"boolean"==typeof e)return e.toString();if(e instanceof Error)return e.message;try{return JSON.stringify(e)}catch(e){return null}}).filter(function(e){return e}).join(" ");t>=(null!=o?o:e.logLevel)&&a({level:P[t].toLowerCase(),message:i,args:n,type:e.name})}}(n[e])}var B=(U.prototype.getPlatformInfoString=function(){return this.container.getProviders().map(function(e){if("VERSION"!==(null==(t=e.getComponent())?void 0:t.type))return null;var t,t=e.getImmediate();return t.library+"/"+t.version}).filter(function(e){return e}).join(" ")},U);function U(e){this.container=e}var z="@firebase/app",q="0.7.13",V=new M("@firebase/app"),H="[DEFAULT]",K=((Z={})[z]="fire-core",Z["@firebase/app-compat"]="fire-core-compat",Z["@firebase/analytics"]="fire-analytics",Z["@firebase/analytics-compat"]="fire-analytics-compat",Z["@firebase/app-check"]="fire-app-check",Z["@firebase/app-check-compat"]="fire-app-check-compat",Z["@firebase/auth"]="fire-auth",Z["@firebase/auth-compat"]="fire-auth-compat",Z["@firebase/database"]="fire-rtdb",Z["@firebase/database-compat"]="fire-rtdb-compat",Z["@firebase/functions"]="fire-fn",Z["@firebase/functions-compat"]="fire-fn-compat",Z["@firebase/installations"]="fire-iid",Z["@firebase/installations-compat"]="fire-iid-compat",Z["@firebase/messaging"]="fire-fcm",Z["@firebase/messaging-compat"]="fire-fcm-compat",Z["@firebase/performance"]="fire-perf",Z["@firebase/performance-compat"]="fire-perf-compat",Z["@firebase/remote-config"]="fire-rc",Z["@firebase/remote-config-compat"]="fire-rc-compat",Z["@firebase/storage"]="fire-gcs",Z["@firebase/storage-compat"]="fire-gcs-compat",Z["@firebase/firestore"]="fire-fst",Z["@firebase/firestore-compat"]="fire-fst-compat",Z["fire-js"]="fire-js",Z.firebase="fire-js-all",Z),$=new Map,W=new Map;function G(t,n){try{t.container.addComponent(n)}catch(e){V.debug("Component "+n.name+" failed to register with FirebaseApp "+t.name,e)}}function J(e,t){e.container.addOrOverwriteComponent(t)}function Y(e){var t,n,r=e.name;if(W.has(r))return V.debug("There were multiple attempts to register component "+r+"."),!1;W.set(r,e);try{for(var i=d($.values()),o=i.next();!o.done;o=i.next())G(o.value,e)}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return!0}function X(e,t){return e.container.getProvider(t)}var Z=((he={})["no-app"]="No Firebase App '{$appName}' has been created - call Firebase App.initializeApp()",he["bad-app-name"]="Illegal App name: '{$appName}",he["duplicate-app"]="Firebase App named '{$appName}' already exists with different options or config",he["app-deleted"]="Firebase App named '{$appName}' already deleted",he["invalid-app-argument"]="firebase.{$appName}() takes either no argument or a Firebase App instance.",he["invalid-log-argument"]="First argument to `onLog` must be null or a function.",he),Q=new m("app","Firebase",Z),ee=(Object.defineProperty(te.prototype,"automaticDataCollectionEnabled",{get:function(){return this.checkDestroyed(),this._automaticDataCollectionEnabled},set:function(e){this.checkDestroyed(),this._automaticDataCollectionEnabled=e},enumerable:!1,configurable:!0}),Object.defineProperty(te.prototype,"name",{get:function(){return this.checkDestroyed(),this._name},enumerable:!1,configurable:!0}),Object.defineProperty(te.prototype,"options",{get:function(){return this.checkDestroyed(),this._options},enumerable:!1,configurable:!0}),Object.defineProperty(te.prototype,"config",{get:function(){return this.checkDestroyed(),this._config},enumerable:!1,configurable:!0}),Object.defineProperty(te.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(te.prototype,"isDeleted",{get:function(){return this._isDeleted},set:function(e){this._isDeleted=e},enumerable:!1,configurable:!0}),te.prototype.checkDestroyed=function(){if(this.isDeleted)throw Q.create("app-deleted",{appName:this._name})},te);function te(e,t,n){var r=this;this._isDeleted=!1,this._options=f({},e),this._config=f({},t),this._name=t.name,this._automaticDataCollectionEnabled=t.automaticDataCollectionEnabled,this._container=n,this.container.addComponent(new E("app",function(){return r},"PUBLIC"))}var ne,re="9.6.3";function ie(e,t){var n,r,i=f({name:H,automaticDataCollectionEnabled:!1},t="object"!=typeof(t=void 0===t?{}:t)?{name:t}:t),o=i.name;if("string"!=typeof o||!o)throw Q.create("bad-app-name",{appName:String(o)});var a=$.get(o);if(a){if(b(e,a.options)&&b(i,a.config))return a;throw Q.create("duplicate-app",{appName:o})}var s=new N(o);try{for(var c=d(W.values()),u=c.next();!u.done;u=c.next()){var l=u.value;s.addComponent(l)}}catch(e){n={error:e}}finally{try{u&&!u.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}i=new ee(e,i,s);return $.set(o,i),i}function oe(n){return l(this,void 0,void 0,function(){var t;return p(this,function(e){switch(e.label){case 0:return(t=n.name,$.has(t))?($.delete(t),[4,Promise.all(n.container.getProviders().map(function(e){return e.delete()}))]):[3,2];case 1:e.sent(),n.isDeleted=!0,e.label=2;case 2:return[2]}})})}function ae(e,t,n){var r=null!==(a=K[e])&&void 0!==a?a:e;n&&(r+="-"+n);var i=r.match(/\s|\//),o=t.match(/\s|\//);if(i||o){var a=['Unable to register library "'+r+'" with version "'+t+'":'];return i&&a.push('library name "'+r+'" contains illegal characters (whitespace or "/")'),i&&o&&a.push("and"),o&&a.push('version name "'+t+'" contains illegal characters (whitespace or "/")'),void V.warn(a.join(" "))}Y(new E(r+"-version",function(){return{library:r,version:t}},"VERSION"))}function se(e,t){if(null!==e&&"function"!=typeof e)throw Q.create("invalid-log-argument");F(e,t)}function ce(e){var t;t=e,k.forEach(function(e){e.setLogLevel(t)})}ne="",Y(new E("platform-logger",function(e){return new B(e)},"PRIVATE")),ae(z,q,ne),ae(z,q,"esm5"),ae("fire-js","");var ue=Object.freeze({__proto__:null,SDK_VERSION:re,_DEFAULT_ENTRY_NAME:H,_addComponent:G,_addOrOverwriteComponent:J,_apps:$,_clearComponents:function(){W.clear()},_components:W,_getProvider:X,_registerComponent:Y,_removeServiceInstance:function(e,t,n){void 0===n&&(n=H),X(e,t).clearInstance(n)},deleteApp:oe,getApp:function(e){var t=$.get(e=void 0===e?H:e);if(!t)throw Q.create("no-app",{appName:e});return t},getApps:function(){return Array.from($.values())},initializeApp:ie,onLog:se,registerVersion:ae,setLogLevel:ce,FirebaseError:s}),le=(Object.defineProperty(fe.prototype,"automaticDataCollectionEnabled",{get:function(){return this._delegate.automaticDataCollectionEnabled},set:function(e){this._delegate.automaticDataCollectionEnabled=e},enumerable:!1,configurable:!0}),Object.defineProperty(fe.prototype,"name",{get:function(){return this._delegate.name},enumerable:!1,configurable:!0}),Object.defineProperty(fe.prototype,"options",{get:function(){return this._delegate.options},enumerable:!1,configurable:!0}),fe.prototype.delete=function(){var t=this;return new Promise(function(e){t._delegate.checkDestroyed(),e()}).then(function(){return t.firebase.INTERNAL.removeApp(t.name),oe(t._delegate)})},fe.prototype._getService=function(e,t){var n;void 0===t&&(t=H),this._delegate.checkDestroyed();var r=this._delegate.container.getProvider(e);return r.isInitialized()||"EXPLICIT"!==(null===(n=r.getComponent())||void 0===n?void 0:n.instantiationMode)||r.initialize(),r.getImmediate({identifier:t})},fe.prototype._removeServiceInstance=function(e,t){void 0===t&&(t=H),this._delegate.container.getProvider(e).clearInstance(t)},fe.prototype._addComponent=function(e){G(this._delegate,e)},fe.prototype._addOrOverwriteComponent=function(e){J(this._delegate,e)},fe.prototype.toJSON=function(){return{name:this.name,automaticDataCollectionEnabled:this.automaticDataCollectionEnabled,options:this.options}},fe);function fe(e,t){var n=this;this._delegate=e,this.firebase=t,G(e,new E("app-compat",function(){return n},"PUBLIC")),this.container=e.container}var Z=((he={})["no-app"]="No Firebase App '{$appName}' has been created - call Firebase App.initializeApp()",he["invalid-app-argument"]="firebase.{$appName}() takes either no argument or a Firebase App instance.",he),pe=new m("app-compat","Firebase",Z);function de(i){var o={},a={__esModule:!0,initializeApp:function(e,t){void 0===t&&(t={});var n=ie(e,t);if(g(o,n.name))return o[n.name];var r=new i(n,a);return o[n.name]=r},app:s,registerVersion:ae,setLogLevel:ce,onLog:se,apps:null,SDK_VERSION:re,INTERNAL:{registerComponent:function(n){var r=n.name,t=r.replace("-compat","");{var e;Y(n)&&"PUBLIC"===n.type&&(e=function(e){if("function"!=typeof(e=void 0===e?s():e)[t])throw pe.create("invalid-app-argument",{appName:r});return e[t]()},void 0!==n.serviceProps&&c(e,n.serviceProps),a[t]=e,i.prototype[t]=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this._getService.bind(this,r).apply(this,n.multipleInstances?e:[])})}return"PUBLIC"===n.type?a[t]:null},removeApp:function(e){delete o[e]},useAsService:function(e,t){return"serverAuth"!==t?t:null},modularAPIs:ue}};function s(e){if(!g(o,e=e||H))throw pe.create("no-app",{appName:e});return o[e]}return a.default=a,Object.defineProperty(a,"apps",{get:function(){return Object.keys(o).map(function(e){return o[e]})}}),s.App=i,a}var he=function e(){var t=de(le);return t.INTERNAL=f(f({},t.INTERNAL),{createFirebaseNamespace:e,extendNamespace:function(e){c(t,e)},createSubscribe:n,ErrorFactory:m,deepExtend:c}),t}(),Z=new M("@firebase/app-compat");"object"==typeof self&&self.self===self&&void 0!==self.firebase&&(Z.warn("\n Warning: Firebase is already defined in the global scope. Please make sure\n Firebase library is only loaded once.\n "),(Ne=self.firebase.SDK_VERSION)&&0<=Ne.indexOf("LITE")&&Z.warn("\n Warning: You are trying to load Firebase while using Firebase Performance standalone script.\n You should load Firebase Performance with this instance of Firebase to avoid loading duplicate code.\n "));var me=he;ae("@firebase/app-compat","0.1.14",void 0);function ve(n){return new Promise(function(e,t){n.onsuccess=function(){e(n.result)},n.onerror=function(){t(n.error)}})}function ge(n,r,i){var o,e=new Promise(function(e,t){ve(o=n[r].apply(n,i)).then(e,t)});return e.request=o,e}function be(e,n,t){t.forEach(function(t){Object.defineProperty(e.prototype,t,{get:function(){return this[n][t]},set:function(e){this[n][t]=e}})})}function ye(t,n,r,e){e.forEach(function(e){e in r.prototype&&(t.prototype[e]=function(){return ge(this[n],e,arguments)})})}function _e(t,n,r,e){e.forEach(function(e){e in r.prototype&&(t.prototype[e]=function(){return this[n][e].apply(this[n],arguments)})})}function we(e,r,t,n){n.forEach(function(n){n in t.prototype&&(e.prototype[n]=function(){return e=this[r],(t=ge(e,n,arguments)).then(function(e){if(e)return new Ee(e,t.request)});var e,t})})}function Ie(e){this._index=e}function Ee(e,t){this._cursor=e,this._request=t}function Se(e){this._store=e}function Te(n){this._tx=n,this.complete=new Promise(function(e,t){n.oncomplete=function(){e()},n.onerror=function(){t(n.error)},n.onabort=function(){t(n.error)}})}function Oe(e,t,n){this._db=e,this.oldVersion=t,this.transaction=new Te(n)}function Ce(e){this._db=e}me.registerVersion("firebase","9.6.3","app-compat"),be(Ie,"_index",["name","keyPath","multiEntry","unique"]),ye(Ie,"_index",IDBIndex,["get","getKey","getAll","getAllKeys","count"]),we(Ie,"_index",IDBIndex,["openCursor","openKeyCursor"]),be(Ee,"_cursor",["direction","key","primaryKey","value"]),ye(Ee,"_cursor",IDBCursor,["update","delete"]),["advance","continue","continuePrimaryKey"].forEach(function(n){n in IDBCursor.prototype&&(Ee.prototype[n]=function(){var t=this,e=arguments;return Promise.resolve().then(function(){return t._cursor[n].apply(t._cursor,e),ve(t._request).then(function(e){if(e)return new Ee(e,t._request)})})})}),Se.prototype.createIndex=function(){return new Ie(this._store.createIndex.apply(this._store,arguments))},Se.prototype.index=function(){return new Ie(this._store.index.apply(this._store,arguments))},be(Se,"_store",["name","keyPath","indexNames","autoIncrement"]),ye(Se,"_store",IDBObjectStore,["put","add","delete","clear","get","getAll","getKey","getAllKeys","count"]),we(Se,"_store",IDBObjectStore,["openCursor","openKeyCursor"]),_e(Se,"_store",IDBObjectStore,["deleteIndex"]),Te.prototype.objectStore=function(){return new Se(this._tx.objectStore.apply(this._tx,arguments))},be(Te,"_tx",["objectStoreNames","mode"]),_e(Te,"_tx",IDBTransaction,["abort"]),Oe.prototype.createObjectStore=function(){return new Se(this._db.createObjectStore.apply(this._db,arguments))},be(Oe,"_db",["name","version","objectStoreNames"]),_e(Oe,"_db",IDBDatabase,["deleteObjectStore","close"]),Ce.prototype.transaction=function(){return new Te(this._db.transaction.apply(this._db,arguments))},be(Ce,"_db",["name","version","objectStoreNames"]),_e(Ce,"_db",IDBDatabase,["close"]),["openCursor","openKeyCursor"].forEach(function(o){[Se,Ie].forEach(function(e){o in e.prototype&&(e.prototype[o.replace("open","iterate")]=function(){var e,t=(e=arguments,Array.prototype.slice.call(e)),n=t[t.length-1],r=this._store||this._index,i=r[o].apply(r,t.slice(0,-1));i.onsuccess=function(){n(i.result)}})})}),[Ie,Se].forEach(function(e){e.prototype.getAll||(e.prototype.getAll=function(e,n){var r=this,i=[];return new Promise(function(t){r.iterateCursor(e,function(e){e?(i.push(e.value),void 0===n||i.length!=n?e.continue():t(i)):t(i)})})})});var Ne="@firebase/installations",Z="0.5.5",Ae=1e4,Pe="w:"+Z,ke="FIS_v2",De="https://firebaseinstallations.googleapis.com/v1",je=36e5,he=((he={})["missing-app-config-values"]='Missing App configuration value: "{$valueName}"',he["not-registered"]="Firebase Installation is not registered.",he["installation-not-found"]="Firebase Installation not found.",he["request-failed"]='{$requestName} request failed with error "{$serverCode} {$serverStatus}: {$serverMessage}"',he["app-offline"]="Could not process request. Application offline.",he["delete-pending-registration"]="Can't delete installation while there is a pending registration request.",he),Re=new m("installations","Installations",he);function Le(e){return e instanceof s&&e.code.includes("request-failed")}function Me(e){var t=e.projectId;return De+"/projects/"+t+"/installations"}function xe(e){return{token:e.token,requestStatus:2,expiresIn:(e=e.expiresIn,Number(e.replace("s","000"))),creationTime:Date.now()}}function Fe(n,r){return l(this,void 0,void 0,function(){var t;return p(this,function(e){switch(e.label){case 0:return[4,r.json()];case 1:return t=e.sent(),t=t.error,[2,Re.create("request-failed",{requestName:n,serverCode:t.code,serverMessage:t.message,serverStatus:t.status})]}})})}function Be(e){var t=e.apiKey;return new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":t})}function Ue(e,t){var n=t.refreshToken,r=Be(e);return r.append("Authorization",ke+" "+n),r}function ze(n){return l(this,void 0,void 0,function(){var t;return p(this,function(e){switch(e.label){case 0:return[4,n()];case 1:return 500<=(t=e.sent()).status&&t.status<600?[2,n()]:[2,t]}})})}function qe(t){return new Promise(function(e){setTimeout(e,t)})}var Ve=/^[cdef][\w-]{21}$/,He="";function Ke(){try{var e=new Uint8Array(17);(self.crypto||self.msCrypto).getRandomValues(e),e[0]=112+e[0]%16;var t=function(e){return btoa(String.fromCharCode.apply(String,a([],h(e)))).replace(/\+/g,"-").replace(/\//g,"_")}(e).substr(0,22);return Ve.test(t)?t:He}catch(e){return He}}function $e(e){return e.appName+"!"+e.appId}var We=new Map;function Ge(e,t){var n=$e(e);Je(n,t),function(e,t){var n=function(){!Ye&&"BroadcastChannel"in self&&((Ye=new BroadcastChannel("[Firebase] FID Change")).onmessage=function(e){Je(e.data.key,e.data.fid)});return Ye}();n&&n.postMessage({key:e,fid:t});0===We.size&&Ye&&(Ye.close(),Ye=null)}(n,t)}function Je(e,t){var n,r,i=We.get(e);if(i)try{for(var o=d(i),a=o.next();!a.done;a=o.next())(0,a.value)(t)}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}var Ye=null;var Xe="firebase-installations-store",Ze=null;function Qe(){var t,e,n;return Ze||(t=function(e){0===e.oldVersion&&e.createObjectStore(Xe)},e=ge(indexedDB,"open",["firebase-installations-database",1]),(n=e.request)&&(n.onupgradeneeded=function(e){t&&t(new Oe(n.result,e.oldVersion,n.transaction))}),Ze=e.then(function(e){return new Ce(e)})),Ze}function et(o,a){return l(this,void 0,void 0,function(){var t,n,r,i;return p(this,function(e){switch(e.label){case 0:return t=$e(o),[4,Qe()];case 1:return r=e.sent(),n=r.transaction(Xe,"readwrite"),[4,(r=n.objectStore(Xe)).get(t)];case 2:return i=e.sent(),[4,r.put(a,t)];case 3:return e.sent(),[4,n.complete];case 4:return e.sent(),i&&i.fid===a.fid||Ge(o,a.fid),[2,a]}})})}function tt(r){return l(this,void 0,void 0,function(){var t,n;return p(this,function(e){switch(e.label){case 0:return t=$e(r),[4,Qe()];case 1:return n=e.sent(),[4,(n=n.transaction(Xe,"readwrite")).objectStore(Xe).delete(t)];case 2:return e.sent(),[4,n.complete];case 3:return e.sent(),[2]}})})}function nt(a,s){return l(this,void 0,void 0,function(){var t,n,r,i,o;return p(this,function(e){switch(e.label){case 0:return t=$e(a),[4,Qe()];case 1:return r=e.sent(),n=r.transaction(Xe,"readwrite"),[4,(r=n.objectStore(Xe)).get(t)];case 2:return i=e.sent(),void 0!==(o=s(i))?[3,4]:[4,r.delete(t)];case 3:return e.sent(),[3,6];case 4:return[4,r.put(o,t)];case 5:e.sent(),e.label=6;case 6:return[4,n.complete];case 7:return e.sent(),!o||i&&i.fid===o.fid||Ge(a,o.fid),[2,o]}})})}function rt(i){return l(this,void 0,void 0,function(){var n,t,r;return p(this,function(e){switch(e.label){case 0:return[4,nt(i,function(e){var t=ot(e||{fid:Ke(),registrationStatus:0}),t=function(e,t){{if(0!==t.registrationStatus)return 1===t.registrationStatus?{installationEntry:t,registrationPromise:function(i){return l(this,void 0,void 0,function(){var t,n,r;return p(this,function(e){switch(e.label){case 0:return[4,it(i)];case 1:t=e.sent(),e.label=2;case 2:return 1!==t.registrationStatus?[3,5]:[4,qe(100)];case 3:return e.sent(),[4,it(i)];case 4:return t=e.sent(),[3,2];case 5:return 0!==t.registrationStatus?[3,7]:[4,rt(i)];case 6:return r=e.sent(),n=r.installationEntry,(r=r.registrationPromise)?[2,r]:[2,n];case 7:return[2,t]}})})}(e)}:{installationEntry:t};if(!navigator.onLine){var n=Promise.reject(Re.create("app-offline"));return{installationEntry:t,registrationPromise:n}}var r={fid:t.fid,registrationStatus:1,registrationTime:Date.now()},n=function(r,i){return l(this,void 0,void 0,function(){var t,n;return p(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,7]),[4,function(a,e){var s=e.fid;return l(this,void 0,void 0,function(){var t,n,r,i,o;return p(this,function(e){switch(e.label){case 0:return t=Me(a),n=Be(a),o={fid:s,authVersion:ke,appId:a.appId,sdkVersion:Pe},r={method:"POST",headers:n,body:JSON.stringify(o)},[4,ze(function(){return fetch(t,r)})];case 1:return(i=e.sent()).ok?[4,i.json()]:[3,3];case 2:return o=e.sent(),[2,{fid:o.fid||s,registrationStatus:2,refreshToken:o.refreshToken,authToken:xe(o.authToken)}];case 3:return[4,Fe("Create Installation",i)];case 4:throw e.sent()}})})}(r,i)];case 1:return t=e.sent(),[2,et(r,t)];case 2:return Le(n=e.sent())&&409===n.customData.serverCode?[4,tt(r)]:[3,4];case 3:return e.sent(),[3,6];case 4:return[4,et(r,{fid:i.fid,registrationStatus:0})];case 5:e.sent(),e.label=6;case 6:throw n;case 7:return[2]}})})}(e,r);return{installationEntry:r,registrationPromise:n}}}(i,t);return n=t.registrationPromise,t.installationEntry})];case 1:return(t=e.sent()).fid!==He?[3,3]:(r={},[4,n]);case 2:return[2,(r.installationEntry=e.sent(),r)];case 3:return[2,{installationEntry:t,registrationPromise:n}]}})})}function it(e){return nt(e,function(e){if(!e)throw Re.create("installation-not-found");return ot(e)})}function ot(e){return 1===(t=e).registrationStatus&&t.registrationTime+Ae<Date.now()?{fid:e.fid,registrationStatus:0}:e;var t}function at(e,s){var c=e.appConfig,u=e.platformLoggerProvider;return l(this,void 0,void 0,function(){var n,r,i,o,a;return p(this,function(e){switch(e.label){case 0:return t=s.fid,n=Me(c)+"/"+t+"/authTokens:generate",r=Ue(c,s),(a=u.getImmediate({optional:!0}))&&r.append("x-firebase-client",a.getPlatformInfoString()),a={installation:{sdkVersion:Pe}},i={method:"POST",headers:r,body:JSON.stringify(a)},[4,ze(function(){return fetch(n,i)})];case 1:return(o=e.sent()).ok?[4,o.json()]:[3,3];case 2:return a=e.sent(),[2,xe(a)];case 3:return[4,Fe("Generate Auth Token",o)];case 4:throw e.sent()}var t})})}function st(i,o){return void 0===o&&(o=!1),l(this,void 0,void 0,function(){var r,t,n;return p(this,function(e){switch(e.label){case 0:return[4,nt(i.appConfig,function(e){if(!ut(e))throw Re.create("not-registered");var t,n=e.authToken;if(o||2!==(t=n).requestStatus||function(e){var t=Date.now();return t<e.creationTime||e.creationTime+e.expiresIn<t+je}(t)){if(1===n.requestStatus)return r=function(r,i){return l(this,void 0,void 0,function(){var t,n;return p(this,function(e){switch(e.label){case 0:return[4,ct(r.appConfig)];case 1:t=e.sent(),e.label=2;case 2:return 1!==t.authToken.requestStatus?[3,5]:[4,qe(100)];case 3:return e.sent(),[4,ct(r.appConfig)];case 4:return t=e.sent(),[3,2];case 5:return 0===(n=t.authToken).requestStatus?[2,st(r,i)]:[2,n]}})})}(i,o),e;if(!navigator.onLine)throw Re.create("app-offline");n=(t=e,n={requestStatus:1,requestTime:Date.now()},f(f({},t),{authToken:n}));return r=function(i,o){return l(this,void 0,void 0,function(){var t,n,r;return p(this,function(e){switch(e.label){case 0:return e.trys.push([0,3,,8]),[4,at(i,o)];case 1:return t=e.sent(),r=f(f({},o),{authToken:t}),[4,et(i.appConfig,r)];case 2:return e.sent(),[2,t];case 3:return!Le(n=e.sent())||401!==n.customData.serverCode&&404!==n.customData.serverCode?[3,5]:[4,tt(i.appConfig)];case 4:return e.sent(),[3,7];case 5:return r=f(f({},o),{authToken:{requestStatus:0}}),[4,et(i.appConfig,r)];case 6:e.sent(),e.label=7;case 7:throw n;case 8:return[2]}})})}(i,n),n}return e})];case 1:return t=e.sent(),r?[4,r]:[3,3];case 2:return n=e.sent(),[3,4];case 3:n=t.authToken,e.label=4;case 4:return[2,n]}})})}function ct(e){return nt(e,function(e){if(!ut(e))throw Re.create("not-registered");var t,n=e.authToken;return 1===(t=n).requestStatus&&t.requestTime+Ae<Date.now()?f(f({},e),{authToken:{requestStatus:0}}):e})}function ut(e){return void 0!==e&&2===e.registrationStatus}function lt(n,r){return void 0===r&&(r=!1),l(this,void 0,void 0,function(){var t;return p(this,function(e){switch(e.label){case 0:return[4,function(n){return l(this,void 0,void 0,function(){var t;return p(this,function(e){switch(e.label){case 0:return[4,rt(n)];case 1:return(t=e.sent().registrationPromise)?[4,t]:[3,3];case 2:e.sent(),e.label=3;case 3:return[2]}})})}((t=n).appConfig)];case 1:return e.sent(),[4,st(t,r)];case 2:return[2,e.sent().token]}})})}function ft(e){return Re.create("missing-app-config-values",{valueName:e})}function pt(e){var t=X(e.getProvider("app").getImmediate(),dt).getImmediate();return{getId:function(){return function(i){return l(this,void 0,void 0,function(){var t,n,r;return p(this,function(e){switch(e.label){case 0:return[4,rt((t=i).appConfig)];case 1:return n=e.sent(),r=n.installationEntry,(n.registrationPromise||st(t)).catch(console.error),[2,r.fid]}})})}(t)},getToken:function(e){return lt(t,e)}}}var dt="installations";Y(new E(dt,function(e){var t=e.getProvider("app").getImmediate();return{app:t,appConfig:function(e){var t,n;if(!e||!e.options)throw ft("App Configuration");if(!e.name)throw ft("App Name");try{for(var r=d(["projectId","apiKey","appId"]),i=r.next();!i.done;i=r.next()){var o=i.value;if(!e.options[o])throw ft(o)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}return{appName:e.name,projectId:e.options.projectId,apiKey:e.options.apiKey,appId:e.options.appId}}(t),platformLoggerProvider:X(t,"platform-logger"),_delete:function(){return Promise.resolve()}}},"PUBLIC")),Y(new E("installations-internal",pt,"PRIVATE")),ae(Ne,Z),ae(Ne,Z,"esm5");var ht,mt,vt="@firebase/performance",gt="0.5.5",bt=gt,yt="FB-PERF-TRACE-MEASURE",_t="@firebase/performance/config",wt="@firebase/performance/configexpire",Ne="Performance",Z=((Z={})["trace started"]="Trace {$traceName} was started before.",Z["trace stopped"]="Trace {$traceName} is not running.",Z["nonpositive trace startTime"]="Trace {$traceName} startTime should be positive.",Z["nonpositive trace duration"]="Trace {$traceName} duration should be positive.",Z["no window"]="Window is not available.",Z["no app id"]="App id is not available.",Z["no project id"]="Project id is not available.",Z["no api key"]="Api key is not available.",Z["invalid cc log"]="Attempted to queue invalid cc event",Z["FB not default"]="Performance can only start when Firebase app instance is the default one.",Z["RC response not ok"]="RC response is not ok",Z["invalid attribute name"]="Attribute name {$attributeName} is invalid.",Z["invalid attribute value"]="Attribute value {$attributeValue} is invalid.",Z["invalid custom metric name"]="Custom metric name {$customMetricName} is invalid",Z["invalid String merger input"]="Input for String merger is invalid, contact support team to resolve.",Z["already initialized"]="initializePerformance() has already been called with different options. To avoid this error, call initializePerformance() with the same options as when it was originally called, or call getPerformance() to return the already initialized instance.",Z),It=new m("performance",Ne,Z),Et=new M(Ne);Et.logLevel=P.INFO;var St,Tt,Ot=(Ct.prototype.getUrl=function(){return this.windowLocation.href.split("?")[0]},Ct.prototype.mark=function(e){this.performance&&this.performance.mark&&this.performance.mark(e)},Ct.prototype.measure=function(e,t,n){this.performance&&this.performance.measure&&this.performance.measure(e,t,n)},Ct.prototype.getEntriesByType=function(e){return this.performance&&this.performance.getEntriesByType?this.performance.getEntriesByType(e):[]},Ct.prototype.getEntriesByName=function(e){return this.performance&&this.performance.getEntriesByName?this.performance.getEntriesByName(e):[]},Ct.prototype.getTimeOrigin=function(){return this.performance&&(this.performance.timeOrigin||this.performance.timing.navigationStart)},Ct.prototype.requiredApisAvailable=function(){return fetch&&Promise&&"undefined"!=typeof navigator&&navigator.cookieEnabled?"object"==typeof indexedDB||(Et.info("IndexedDB is not supported by current browswer"),!1):(Et.info("Firebase Performance cannot start if browser does not support fetch and Promise or cookie is disabled."),!1)},Ct.prototype.setupObserver=function(e,i){this.PerformanceObserver&&new this.PerformanceObserver(function(e){for(var t=0,n=e.getEntries();t<n.length;t++){var r=n[t];i(r)}}).observe({entryTypes:[e]})},Ct.getInstance=function(){return ht=void 0===ht?new Ct(mt):ht},Ct);function Ct(e){if(!(this.window=e))throw It.create("no window");this.performance=e.performance,this.PerformanceObserver=e.PerformanceObserver,this.windowLocation=e.location,this.navigator=e.navigator,this.document=e.document,this.navigator&&this.navigator.cookieEnabled&&(this.localStorage=e.localStorage),e.perfMetrics&&e.perfMetrics.onFirstInputDelay&&(this.onFirstInputDelay=e.perfMetrics.onFirstInputDelay)}function Nt(e,t){var n=e.length-t.length;if(n<0||1<n)throw It.create("invalid String merger input");for(var r=[],i=0;i<e.length;i++)r.push(e.charAt(i)),t.length>i&&r.push(t.charAt(i));return r.join("")}var At,Pt,kt=(Dt.prototype.getFlTransportFullUrl=function(){return this.flTransportEndpointUrl.concat("?key=",this.transportKey)},Dt.getInstance=function(){return Tt=void 0===Tt?new Dt:Tt},Dt);function Dt(){this.instrumentationEnabled=!0,this.dataCollectionEnabled=!0,this.loggingEnabled=!1,this.tracesSamplingRate=1,this.networkRequestsSamplingRate=1,this.logEndPointUrl="https://firebaselogging.googleapis.com/v0cc/log?format=json_proto",this.flTransportEndpointUrl=Nt("hts/frbslgigp.ogepscmv/ieo/eaylg","tp:/ieaeogn-agolai.o/1frlglgc/o"),this.transportKey=Nt("AzSC8r6ReiGqFMyfvgow","Iayx0u-XT3vksVM-pIV"),this.logSource=462,this.logTraceAfterSampling=!1,this.logNetworkAfterSampling=!1,this.configTimeToLive=12}(Pt=At=At||{})[Pt.UNKNOWN=0]="UNKNOWN",Pt[Pt.VISIBLE=1]="VISIBLE",Pt[Pt.HIDDEN=2]="HIDDEN";var jt=["firebase_","google_","ga_"],Rt=new RegExp("^[a-zA-Z]\\w*$");function Lt(){switch(Ot.getInstance().document.visibilityState){case"visible":return At.VISIBLE;case"hidden":return At.HIDDEN;default:return At.UNKNOWN}}function Mt(e){var t=null===(t=e.options)||void 0===t?void 0:t.appId;if(!t)throw It.create("no app id");return t}var xt="0.0.1",Ft={loggingEnabled:!0},Bt="FIREBASE_INSTALLATIONS_AUTH";function Ut(e,t){var r,i,n=function(){var e=Ot.getInstance().localStorage;if(e){var t=e.getItem(wt);if(t&&function(e){return Number(e)>Date.now()}(t)){e=e.getItem(_t);if(e)try{return JSON.parse(e)}catch(e){return}}}}();return n?(qt(n),Promise.resolve()):(i=t,function(e){var t=e.getToken();return t.then(function(e){}),t}((r=e).installations).then(function(e){var t=function(e){var t=null===(t=e.options)||void 0===t?void 0:t.projectId;if(!t)throw It.create("no project id");return t}(r.app),n=function(e){var t=null===(t=e.options)||void 0===t?void 0:t.apiKey;if(!t)throw It.create("no api key");return t}(r.app),n=new Request("https://firebaseremoteconfig.googleapis.com/v1/projects/"+t+"/namespaces/fireperf:fetch?key="+n,{method:"POST",headers:{Authorization:Bt+" "+e},body:JSON.stringify({app_instance_id:i,app_instance_id_token:e,app_id:Mt(r.app),app_version:bt,sdk_version:xt})});return fetch(n).then(function(e){if(e.ok)return e.json();throw It.create("RC response not ok")})}).catch(function(){Et.info(zt)}).then(qt).then(function(e){var t;e=e,t=Ot.getInstance().localStorage,e&&t&&(t.setItem(_t,JSON.stringify(e)),t.setItem(wt,String(Date.now()+60*kt.getInstance().configTimeToLive*60*1e3)))},function(){}))}var zt="Could not fetch config, will use default configs";function qt(e){if(!e)return e;var t=kt.getInstance(),n=e.entries||{};return void 0!==n.fpr_enabled?t.loggingEnabled="true"===String(n.fpr_enabled):t.loggingEnabled=Ft.loggingEnabled,n.fpr_log_source&&(t.logSource=Number(n.fpr_log_source)),n.fpr_log_endpoint_url&&(t.logEndPointUrl=n.fpr_log_endpoint_url),n.fpr_log_transport_key&&(t.transportKey=n.fpr_log_transport_key),void 0!==n.fpr_vc_network_request_sampling_rate&&(t.networkRequestsSamplingRate=Number(n.fpr_vc_network_request_sampling_rate)),void 0!==n.fpr_vc_trace_sampling_rate&&(t.tracesSamplingRate=Number(n.fpr_vc_trace_sampling_rate)),t.logTraceAfterSampling=Vt(t.tracesSamplingRate),t.logNetworkAfterSampling=Vt(t.networkRequestsSamplingRate),e}function Vt(e){return Math.random()<=e}var Ht,Kt=1;function $t(e){var n;return Kt=2,Ht=Ht||(n=e,function(){var n=Ot.getInstance().document;return new Promise(function(e){var t;n&&"complete"!==n.readyState?(t=function(){"complete"===n.readyState&&(n.removeEventListener("readystatechange",t),e())},n.addEventListener("readystatechange",t)):e()})}().then(function(){return e=n.installations,(t=e.getId()).then(function(e){St=e}),t;var e,t}).then(function(e){return Ut(n,e)}).then(Wt,Wt))}function Wt(){Kt=3}var Gt,Jt=1e4,Yt=3,Xt=1e3,Zt=Yt,Qt=[],en=!1;function tn(e){setTimeout(function(){var e,t;if(0!==Zt)return Qt.length?(e=Qt.splice(0,Xt),t=e.map(function(e){return{source_extension_json_proto3:e.message,event_time_ms:String(e.eventTime)}}),void function(e,r){return function(e){var t=kt.getInstance().getFlTransportFullUrl();return fetch(t,{method:"POST",body:JSON.stringify(e)})}(e).then(function(e){return e.ok||Et.info("Call to Firebase backend failed."),e.json()}).then(function(e){var t=Number(e.nextRequestWaitMillis),n=Jt;isNaN(t)||(n=Math.max(t,n));t=e.logResponseDetails;Array.isArray(t)&&0<t.length&&"RETRY_REQUEST_LATER"===t[0].responseAction&&(Qt=a(a([],r),Qt),Et.info("Retry transport request later.")),Zt=Yt,tn(n)})}({request_time_ms:String(Date.now()),client_info:{client_type:1,js_client_info:{}},log_source:kt.getInstance().logSource,log_event:t},e).catch(function(){Qt=a(a([],e),Qt),Zt--,Et.info("Tries left: "+Zt+"."),tn(Jt)})):tn(Jt)},e)}function nn(n){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];!function(e){if(!e.eventTime||!e.message)throw It.create("invalid cc log");Qt=a(a([],Qt),[e])}({message:n.apply(void 0,e),eventTime:Date.now()})}}function rn(e,t){(Gt=Gt||nn(sn))(e,t)}function on(e){var t=kt.getInstance();!t.instrumentationEnabled&&e.isAuto||(t.dataCollectionEnabled||e.isAuto)&&Ot.getInstance().requiredApisAvailable()&&(e.isAuto&&Lt()!==At.VISIBLE||(3===Kt?an(e):$t(e.performanceController).then(function(){return an(e)},function(){return an(e)})))}function an(e){var t;!St||(t=kt.getInstance()).loggingEnabled&&t.logTraceAfterSampling&&setTimeout(function(){return rn(e,1)},0)}function sn(e,t){return 0===t?(n={url:e.url,http_method:e.httpMethod||0,http_response_code:200,response_payload_bytes:e.responsePayloadBytes,client_start_time_us:e.startTimeUs,time_to_response_initiated_us:e.timeToResponseInitiatedUs,time_to_response_completed_us:e.timeToResponseCompletedUs},n={application_info:cn(e.performanceController.app),network_request_metric:n},JSON.stringify(n)):function(e){var t={name:e.name,is_auto:e.isAuto,client_start_time_us:e.startTimeUs,duration_us:e.durationUs};0!==Object.keys(e.counters).length&&(t.counters=e.counters);var n=e.getAttributes();0!==Object.keys(n).length&&(t.custom_attributes=n);t={application_info:cn(e.performanceController.app),trace_metric:t};return JSON.stringify(t)}(e);var n}function cn(e){return{google_app_id:Mt(e),app_instance_id:St,web_app_info:{sdk_version:bt,page_url:Ot.getInstance().getUrl(),service_worker_status:"serviceWorker"in(t=Ot.getInstance().navigator)?t.serviceWorker.controller?2:3:1,visibility_state:Lt(),effective_connection_type:function(){var e=Ot.getInstance().navigator.connection;switch(e&&e.effectiveType){case"slow-2g":return 1;case"2g":return 2;case"3g":return 3;case"4g":return 4;default:return 0}}()},application_process_state:0};var t}var un=["_fp","_fcp","_fid"];var ln=(fn.prototype.start=function(){if(1!==this.state)throw It.create("trace started",{traceName:this.name});this.api.mark(this.traceStartMark),this.state=2},fn.prototype.stop=function(){if(2!==this.state)throw It.create("trace stopped",{traceName:this.name});this.state=3,this.api.mark(this.traceStopMark),this.api.measure(this.traceMeasure,this.traceStartMark,this.traceStopMark),this.calculateTraceMetrics(),on(this)},fn.prototype.record=function(e,t,n){if(e<=0)throw It.create("nonpositive trace startTime",{traceName:this.name});if(t<=0)throw It.create("nonpositive trace duration",{traceName:this.name});if(this.durationUs=Math.floor(1e3*t),this.startTimeUs=Math.floor(1e3*e),n&&n.attributes&&(this.customAttributes=f({},n.attributes)),n&&n.metrics)for(var r=0,i=Object.keys(n.metrics);r<i.length;r++){var o=i[r];isNaN(Number(n.metrics[o]))||(this.counters[o]=Number(Math.floor(n.metrics[o])))}on(this)},fn.prototype.incrementMetric=function(e,t){void 0===t&&(t=1),void 0===this.counters[e]?this.putMetric(e,t):this.putMetric(e,this.counters[e]+t)},fn.prototype.putMetric=function(e,t){if(r=e,i=this.name,0===r.length||100<r.length||!(i&&i.startsWith("_wt_")&&-1<un.indexOf(r))&&r.startsWith("_"))throw It.create("invalid custom metric name",{customMetricName:e});var n,r,i;this.counters[e]=(t=t,(n=Math.floor(t))<t&&Et.info("Metric value should be an Integer, setting the value as : "+n+"."),n)},fn.prototype.getMetric=function(e){return this.counters[e]||0},fn.prototype.putAttribute=function(e,t){var n,r,i=!(0===(n=e).length||40<n.length)&&(!jt.some(function(e){return n.startsWith(e)})&&!!n.match(Rt)),o=0!==(r=t).length&&r.length<=100;if(i&&o)this.customAttributes[e]=t;else{if(!i)throw It.create("invalid attribute name",{attributeName:e});if(!o)throw It.create("invalid attribute value",{attributeValue:t})}},fn.prototype.getAttribute=function(e){return this.customAttributes[e]},fn.prototype.removeAttribute=function(e){void 0!==this.customAttributes[e]&&delete this.customAttributes[e]},fn.prototype.getAttributes=function(){return f({},this.customAttributes)},fn.prototype.setStartTime=function(e){this.startTimeUs=e},fn.prototype.setDuration=function(e){this.durationUs=e},fn.prototype.calculateTraceMetrics=function(){var e=this.api.getEntriesByName(this.traceMeasure),e=e&&e[0];e&&(this.durationUs=Math.floor(1e3*e.duration),this.startTimeUs=Math.floor(1e3*(e.startTime+this.api.getTimeOrigin())))},fn.createOobTrace=function(e,t,n,r){var i,o=Ot.getInstance().getUrl();o&&(i=new fn(e,"_wt_"+o,!0),o=Math.floor(1e3*Ot.getInstance().getTimeOrigin()),i.setStartTime(o),t&&t[0]&&(i.setDuration(Math.floor(1e3*t[0].duration)),i.putMetric("domInteractive",Math.floor(1e3*t[0].domInteractive)),i.putMetric("domContentLoadedEventEnd",Math.floor(1e3*t[0].domContentLoadedEventEnd)),i.putMetric("loadEventEnd",Math.floor(1e3*t[0].loadEventEnd))),n&&((o=n.find(function(e){return"first-paint"===e.name}))&&o.startTime&&i.putMetric("_fp",Math.floor(1e3*o.startTime)),(o=n.find(function(e){return"first-contentful-paint"===e.name}))&&o.startTime&&i.putMetric("_fcp",Math.floor(1e3*o.startTime)),r&&i.putMetric("_fid",Math.floor(1e3*r))),on(i))},fn.createUserTimingTrace=function(e,t){on(new fn(e,t,!1,t))},fn);function fn(e,t,n,r){void 0===n&&(n=!1),this.performanceController=e,this.name=t,this.isAuto=n,this.state=1,this.customAttributes={},this.counters={},this.api=Ot.getInstance(),this.randomId=Math.floor(1e6*Math.random()),this.isAuto||(this.traceStartMark="FB-PERF-TRACE-START-"+this.randomId+"-"+this.name,this.traceStopMark="FB-PERF-TRACE-STOP-"+this.randomId+"-"+this.name,this.traceMeasure=r||yt+"-"+this.randomId+"-"+this.name,r&&this.calculateTraceMetrics())}function pn(e,t){var n,r,i,o,a=t;a&&void 0!==a.responseStart&&(i=Ot.getInstance().getTimeOrigin(),o=Math.floor(1e3*(a.startTime+i)),r=a.responseStart?Math.floor(1e3*(a.responseStart-a.startTime)):void 0,i=Math.floor(1e3*(a.responseEnd-a.startTime)),a={performanceController:e,url:a.name&&a.name.split("?")[0],responsePayloadBytes:a.transferSize,startTimeUs:o,timeToResponseInitiatedUs:r,timeToResponseCompletedUs:i},n=a,(o=kt.getInstance()).instrumentationEnabled&&(r=n.url,i=o.logEndPointUrl.split("?")[0],a=o.flTransportEndpointUrl.split("?")[0],r!==i&&r!==a&&o.loggingEnabled&&o.logNetworkAfterSampling&&setTimeout(function(){return rn(n,0)},0)))}var dn=5e3;function hn(e){St&&(setTimeout(function(){return function(t){var e=Ot.getInstance(),n=e.getEntriesByType("navigation"),r=e.getEntriesByType("paint");{var i;e.onFirstInputDelay?(i=setTimeout(function(){ln.createOobTrace(t,n,r),i=void 0},dn),e.onFirstInputDelay(function(e){i&&(clearTimeout(i),ln.createOobTrace(t,n,r,e))})):ln.createOobTrace(t,n,r)}}(e)},0),setTimeout(function(){return function(t){for(var e=Ot.getInstance(),n=e.getEntriesByType("resource"),r=0,i=n;r<i.length;r++){var o=i[r];pn(t,o)}e.setupObserver("resource",function(e){return pn(t,e)})}(e)},0),setTimeout(function(){return function(t){for(var e=Ot.getInstance(),n=e.getEntriesByType("measure"),r=0,i=n;r<i.length;r++){var o=i[r];mn(t,o)}e.setupObserver("measure",function(e){return mn(t,e)})}(e)},0))}function mn(e,t){var n=t.name;n.substring(0,yt.length)!==yt&&ln.createUserTimingTrace(e,n)}var vn=(gn.prototype._init=function(e){var t=this;this.initialized||(void 0!==(null==e?void 0:e.dataCollectionEnabled)&&(this.dataCollectionEnabled=e.dataCollectionEnabled),void 0!==(null==e?void 0:e.instrumentationEnabled)&&(this.instrumentationEnabled=e.instrumentationEnabled),Ot.getInstance().requiredApisAvailable()?new Promise(function(e,t){try{var n=!0,r="validate-browser-context-for-indexeddb-analytics-module",i=self.indexedDB.open(r);i.onsuccess=function(){i.result.close(),n||self.indexedDB.deleteDatabase(r),e(!0)},i.onupgradeneeded=function(){n=!1},i.onerror=function(){var e;t((null===(e=i.error)||void 0===e?void 0:e.message)||"")}}catch(e){t(e)}}).then(function(e){e&&(en||(tn(5500),en=!0),$t(t).then(function(){return hn(t)},function(){return hn(t)}),t.initialized=!0)}).catch(function(e){Et.info("Environment doesn't support IndexedDB: "+e)}):Et.info('Firebase Performance cannot start if the browser does not support "Fetch" and "Promise", or cookies are disabled.'))},Object.defineProperty(gn.prototype,"instrumentationEnabled",{get:function(){return kt.getInstance().instrumentationEnabled},set:function(e){kt.getInstance().instrumentationEnabled=e},enumerable:!1,configurable:!0}),Object.defineProperty(gn.prototype,"dataCollectionEnabled",{get:function(){return kt.getInstance().dataCollectionEnabled},set:function(e){kt.getInstance().dataCollectionEnabled=e},enumerable:!1,configurable:!0}),gn);function gn(e,t){this.app=e,this.installations=t,this.initialized=!1}var bn="[DEFAULT]";Y(new E("performance",function(e,t){var n=t.options,r=e.getProvider("app").getImmediate(),i=e.getProvider("installations-internal").getImmediate();if(r.name!==bn)throw It.create("FB not default");if("undefined"==typeof window)throw It.create("no window");mt=window;i=new vn(r,i);return i._init(n),i},"PUBLIC")),ae(vt,gt),ae(vt,gt,"esm5");var yn=(Object.defineProperty(_n.prototype,"instrumentationEnabled",{get:function(){return this._delegate.instrumentationEnabled},set:function(e){this._delegate.instrumentationEnabled=e},enumerable:!1,configurable:!0}),Object.defineProperty(_n.prototype,"dataCollectionEnabled",{get:function(){return this._delegate.dataCollectionEnabled},set:function(e){this._delegate.dataCollectionEnabled=e},enumerable:!1,configurable:!0}),_n.prototype.trace=function(e){return t=this._delegate,t=(n=t)&&n._delegate?n._delegate:n,new ln(t,e);var t,n},_n);function _n(e,t){this.app=e,this._delegate=t}var wn;function In(e){var t=e.getProvider("app-compat").getImmediate(),n=e.getProvider("performance").getImmediate();return new yn(t,n)}(wn=me).INTERNAL.registerComponent(new E("performance-compat",In,"PUBLIC")),wn.registerVersion("@firebase/performance-compat","0.1.5");return me.registerVersion("firebase","9.6.3","compat-lite"),me});
|
|
2
2
|
//# sourceMappingURL=firebase-performance-standalone-compat.js.map
|