firebase 9.6.2-canary.044a8d7f9 → 9.6.2-canary.88d43ec00

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.
Files changed (44) hide show
  1. package/app/dist/index.cjs.js +1 -1
  2. package/app/dist/index.esm.js +1 -1
  3. package/app/dist/index.mjs +1 -1
  4. package/compat/app/dist/index.cjs.js +1 -1
  5. package/compat/app/dist/index.esm.js +1 -1
  6. package/compat/app/dist/index.mjs +1 -1
  7. package/compat/dist/index.esm.js +2 -2
  8. package/compat/dist/index.node.cjs +2 -2
  9. package/compat/dist/index.rn.cjs.js +2 -2
  10. package/firebase-analytics-compat.js +1 -1
  11. package/firebase-analytics.js +5 -5
  12. package/firebase-app-check-compat.js +1 -1
  13. package/firebase-app-check.js +5 -5
  14. package/firebase-app-compat.js +2 -2
  15. package/firebase-app.js +9 -9
  16. package/firebase-auth-compat.js +1 -1
  17. package/firebase-auth.js +3 -3
  18. package/firebase-compat.js +4 -4
  19. package/firebase-compat.js.map +1 -1
  20. package/firebase-database-compat.js +1 -1
  21. package/firebase-database.js +5 -5
  22. package/firebase-firestore-compat.js +1 -1
  23. package/firebase-firestore-compat.js.map +1 -1
  24. package/firebase-firestore-lite.js +129 -129
  25. package/firebase-firestore-lite.js.map +1 -1
  26. package/firebase-firestore.js +874 -874
  27. package/firebase-firestore.js.map +1 -1
  28. package/firebase-functions-compat.js +1 -1
  29. package/firebase-functions.js +3 -3
  30. package/firebase-messaging-compat.js +1 -1
  31. package/firebase-messaging-compat.js.map +1 -1
  32. package/firebase-messaging-sw.js +5 -5
  33. package/firebase-messaging-sw.js.map +1 -1
  34. package/firebase-messaging.js +4 -4
  35. package/firebase-messaging.js.map +1 -1
  36. package/firebase-performance-compat.js +1 -1
  37. package/firebase-performance-standalone-compat.es2017.js +7 -7
  38. package/firebase-performance-standalone-compat.js +1 -1
  39. package/firebase-performance.js +5 -5
  40. package/firebase-remote-config-compat.js +1 -1
  41. package/firebase-remote-config.js +4 -4
  42. package/firebase-storage-compat.js +1 -1
  43. package/firebase-storage.js +2 -2
  44. package/package.json +26 -26
@@ -1,2 +1,2 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(require("@firebase/app-compat"),require("@firebase/app")):"function"==typeof define&&define.amd?define(["@firebase/app-compat","@firebase/app"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).firebase,t.firebase.INTERNAL.modularAPIs)}(this,function(he,me){"use strict";try{!(function(){function t(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var e,n=t(he);class o extends Error{constructor(t,e,n){super(e),this.code=t,this.customData=n,this.name="FirebaseError",Object.setPrototypeOf(this,o.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,r.prototype.create)}}class r{constructor(t,e,n){this.service=t,this.serviceName=e,this.errors=n}create(t,...e){var r,n=e[0]||{},i=`${this.service}/${t}`,a=this.errors[t],a=a?(r=n,a.replace(s,(t,e)=>{var n=r[e];return null!=n?String(n):`<${e}?>`})):"Error",a=`${this.serviceName}: ${a} (${i}).`;return new o(i,a,n)}}const s=/\{\$([^}]+)}/g;class i{constructor(t,e,n){this.name=t,this.instanceFactory=e,this.type=n,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(t){return this.instantiationMode=t,this}setMultipleInstances(t){return this.multipleInstances=t,this}setServiceProps(t){return this.serviceProps=t,this}setInstanceCreatedCallback(t){return this.onInstanceCreated=t,this}}(bt=e=e||{})[bt.DEBUG=0]="DEBUG",bt[bt.VERBOSE=1]="VERBOSE",bt[bt.INFO=2]="INFO",bt[bt.WARN=3]="WARN",bt[bt.ERROR=4]="ERROR",bt[bt.SILENT=5]="SILENT";const a={debug:e.DEBUG,verbose:e.VERBOSE,info:e.INFO,warn:e.WARN,error:e.ERROR,silent:e.SILENT},c=e.INFO,u={[e.DEBUG]:"log",[e.VERBOSE]:"log",[e.INFO]:"info",[e.WARN]:"warn",[e.ERROR]:"error"},l=(t,e,...n)=>{if(!(e<t.logLevel)){var r=(new Date).toISOString(),i=u[e];if(!i)throw new Error(`Attempted to log a message with an invalid logType (value: ${e})`);console[i](`[${r}] ${t.name}:`,...n)}};function p(n){return new Promise(function(t,e){n.onsuccess=function(){t(n.result)},n.onerror=function(){e(n.error)}})}function f(n,r,i){var a,t=new Promise(function(t,e){p(a=n[r].apply(n,i)).then(t,e)});return t.request=a,t}function d(t,n,e){e.forEach(function(e){Object.defineProperty(t.prototype,e,{get:function(){return this[n][e]},set:function(t){this[n][e]=t}})})}function g(e,n,r,t){t.forEach(function(t){t in r.prototype&&(e.prototype[t]=function(){return f(this[n],t,arguments)})})}function h(e,n,r,t){t.forEach(function(t){t in r.prototype&&(e.prototype[t]=function(){return this[n][t].apply(this[n],arguments)})})}function m(t,r,e,n){n.forEach(function(n){n in e.prototype&&(t.prototype[n]=function(){return t=this[r],(e=f(t,n,arguments)).then(function(t){if(t)return new b(t,e.request)});var t,e})})}function v(t){this._index=t}function b(t,e){this._cursor=t,this._request=e}function _(t){this._store=t}function w(n){this._tx=n,this.complete=new Promise(function(t,e){n.oncomplete=function(){t()},n.onerror=function(){e(n.error)},n.onabort=function(){e(n.error)}})}function y(t,e,n){this._db=t,this.oldVersion=e,this.transaction=new w(n)}function E(t){this._db=t}d(v,"_index",["name","keyPath","multiEntry","unique"]),g(v,"_index",IDBIndex,["get","getKey","getAll","getAllKeys","count"]),m(v,"_index",IDBIndex,["openCursor","openKeyCursor"]),d(b,"_cursor",["direction","key","primaryKey","value"]),g(b,"_cursor",IDBCursor,["update","delete"]),["advance","continue","continuePrimaryKey"].forEach(function(n){n in IDBCursor.prototype&&(b.prototype[n]=function(){var e=this,t=arguments;return Promise.resolve().then(function(){return e._cursor[n].apply(e._cursor,t),p(e._request).then(function(t){if(t)return new b(t,e._request)})})})}),_.prototype.createIndex=function(){return new v(this._store.createIndex.apply(this._store,arguments))},_.prototype.index=function(){return new v(this._store.index.apply(this._store,arguments))},d(_,"_store",["name","keyPath","indexNames","autoIncrement"]),g(_,"_store",IDBObjectStore,["put","add","delete","clear","get","getAll","getKey","getAllKeys","count"]),m(_,"_store",IDBObjectStore,["openCursor","openKeyCursor"]),h(_,"_store",IDBObjectStore,["deleteIndex"]),w.prototype.objectStore=function(){return new _(this._tx.objectStore.apply(this._tx,arguments))},d(w,"_tx",["objectStoreNames","mode"]),h(w,"_tx",IDBTransaction,["abort"]),y.prototype.createObjectStore=function(){return new _(this._db.createObjectStore.apply(this._db,arguments))},d(y,"_db",["name","version","objectStoreNames"]),h(y,"_db",IDBDatabase,["deleteObjectStore","close"]),E.prototype.transaction=function(){return new w(this._db.transaction.apply(this._db,arguments))},d(E,"_db",["name","version","objectStoreNames"]),h(E,"_db",IDBDatabase,["close"]),["openCursor","openKeyCursor"].forEach(function(a){[_,v].forEach(function(t){a in t.prototype&&(t.prototype[a.replace("open","iterate")]=function(){var t,e=(t=arguments,Array.prototype.slice.call(t)),n=e[e.length-1],r=this._store||this._index,i=r[a].apply(r,e.slice(0,-1));i.onsuccess=function(){n(i.result)}})})}),[v,_].forEach(function(t){t.prototype.getAll||(t.prototype.getAll=function(t,n){var r=this,i=[];return new Promise(function(e){r.iterateCursor(t,function(t){t?(i.push(t.value),void 0===n||i.length!=n?t.continue():e(i)):e(i)})})})});var I="@firebase/installations",T="0.5.5-canary.044a8d7f9";const S=1e4,N=`w:${T}`,k="FIS_v2",A="https://firebaseinstallations.googleapis.com/v1",C=36e5;const O=new r("installations","Installations",{"missing-app-config-values":'Missing App configuration value: "{$valueName}"',"not-registered":"Firebase Installation is not registered.","installation-not-found":"Firebase Installation not found.","request-failed":'{$requestName} request failed with error "{$serverCode} {$serverStatus}: {$serverMessage}"',"app-offline":"Could not process request. Application offline.","delete-pending-registration":"Can't delete installation while there is a pending registration request."});function P(t){return t instanceof o&&t.code.includes("request-failed")}function R({projectId:t}){return`${A}/projects/${t}/installations`}function M(t){return{token:t.token,requestStatus:2,expiresIn:(t=t.expiresIn,Number(t.replace("s","000"))),creationTime:Date.now()}}async function j(t,e){var n=(await e.json()).error;return O.create("request-failed",{requestName:t,serverCode:n.code,serverMessage:n.message,serverStatus:n.status})}function B({apiKey:t}){return new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":t})}function D(t,{refreshToken:e}){const n=B(t);return n.append("Authorization",(e=e,`${k} ${e}`)),n}async function L(t){var e=await t();return 500<=e.status&&e.status<600?t():e}function $(e){return new Promise(t=>{setTimeout(t,e)})}const U=/^[cdef][\w-]{21}$/,q="";function x(){try{const e=new Uint8Array(17),n=self.crypto||self.msCrypto;n.getRandomValues(e),e[0]=112+e[0]%16;var t=function(t){const e=function(t){const e=btoa(String.fromCharCode(...t));return e.replace(/\+/g,"-").replace(/\//g,"_")}(t);return e.substr(0,22)}(e);return U.test(t)?t:q}catch(t){return q}}function F(t){return`${t.appName}!${t.appId}`}const H=new Map;function V(t,e){var n=F(t);K(n,e),function(t,e){const n=function(){!W&&"BroadcastChannel"in self&&(W=new BroadcastChannel("[Firebase] FID Change"),W.onmessage=t=>{K(t.data.key,t.data.fid)});return W}();n&&n.postMessage({key:t,fid:e});0===H.size&&W&&(W.close(),W=null)}(n,e)}function K(t,e){var n=H.get(t);if(n)for(const r of n)r(e)}let W=null;const z="firebase-installations-store";let G=null;function J(){var e,t,n;return G=G||(e=t=>{0===t.oldVersion&&t.createObjectStore(z)},t=f(indexedDB,"open",["firebase-installations-database",1]),(n=t.request)&&(n.onupgradeneeded=function(t){e&&e(new y(n.result,t.oldVersion,n.transaction))}),t.then(function(t){return new E(t)})),G}async function Y(t,e){var n=F(t);const r=await J(),i=r.transaction(z,"readwrite"),a=i.objectStore(z);var o=await a.get(n);return await a.put(e,n),await i.complete,o&&o.fid===e.fid||V(t,e.fid),e}async function Z(t){var e=F(t);const n=await J(),r=n.transaction(z,"readwrite");await r.objectStore(z).delete(e),await r.complete}async function Q(t,e){var n=F(t);const r=await J(),i=r.transaction(z,"readwrite"),a=i.objectStore(z);var o=await a.get(n),s=e(o);return void 0===s?await a.delete(n):await a.put(s,n),await i.complete,!s||o&&o.fid===s.fid||V(t,s.fid),s}async function X(n){let r;var t=await Q(n,t=>{var e=et(t||{fid:x(),registrationStatus:0}),e=function(t,e){{if(0!==e.registrationStatus)return 1===e.registrationStatus?{installationEntry:e,registrationPromise:async function(t){let e=await tt(t);for(;1===e.registrationStatus;)await $(100),e=await tt(t);if(0!==e.registrationStatus)return e;{var{installationEntry:n,registrationPromise:r}=await X(t);return r||n}}(t)}:{installationEntry:e};if(!navigator.onLine){var n=Promise.reject(O.create("app-offline"));return{installationEntry:e,registrationPromise:n}}var r={fid:e.fid,registrationStatus:1,registrationTime:Date.now()},n=async function(e,n){try{var t=await async function(t,{fid:e}){const n=R(t);var r=B(t),i={fid:e,authVersion:k,appId:t.appId,sdkVersion:N};const a={method:"POST",headers:r,body:JSON.stringify(i)},o=await L(()=>fetch(n,a));if(o.ok){i=await o.json();return{fid:i.fid||e,registrationStatus:2,refreshToken:i.refreshToken,authToken:M(i.authToken)}}throw await j("Create Installation",o)}(e,n);return Y(e,t)}catch(t){throw P(t)&&409===t.customData.serverCode?await Z(e):await Y(e,{fid:n.fid,registrationStatus:0}),t}}(t,r);return{installationEntry:r,registrationPromise:n}}}(n,e);return r=e.registrationPromise,e.installationEntry});return t.fid===q?{installationEntry:await r}:{installationEntry:t,registrationPromise:r}}function tt(t){return Q(t,t=>{if(!t)throw O.create("installation-not-found");return et(t)})}function et(t){return 1===(e=t).registrationStatus&&e.registrationTime+S<Date.now()?{fid:t.fid,registrationStatus:0}:t;var e}async function nt({appConfig:t,platformLoggerProvider:e},n){const r=([i,a]=[t,n["fid"]],`${R(i)}/${a}/authTokens:generate`);var i,a;const o=D(t,n),s=e.getImmediate({optional:!0});s&&o.append("x-firebase-client",s.getPlatformInfoString());var c={installation:{sdkVersion:N}};const u={method:"POST",headers:o,body:JSON.stringify(c)},l=await L(()=>fetch(r,u));if(l.ok)return M(await l.json());throw await j("Generate Auth Token",l)}async function rt(r,i=!1){let a;var t=await Q(r.appConfig,t=>{if(!at(t))throw O.create("not-registered");var e,n=t.authToken;if(i||2!==(e=n).requestStatus||function(t){var e=Date.now();return e<t.creationTime||t.creationTime+t.expiresIn<e+C}(e)){if(1===n.requestStatus)return a=async function(t,e){let n=await it(t.appConfig);for(;1===n.authToken.requestStatus;)await $(100),n=await it(t.appConfig);var r=n.authToken;return 0===r.requestStatus?rt(t,e):r}(r,i),t;if(!navigator.onLine)throw O.create("app-offline");n=(e=t,n={requestStatus:1,requestTime:Date.now()},Object.assign(Object.assign({},e),{authToken:n}));return a=async function(e,n){try{var r=await nt(e,n),t=Object.assign(Object.assign({},n),{authToken:r});return await Y(e.appConfig,t),r}catch(t){throw!P(t)||401!==t.customData.serverCode&&404!==t.customData.serverCode?(r=Object.assign(Object.assign({},n),{authToken:{requestStatus:0}}),await Y(e.appConfig,r)):await Z(e.appConfig),t}}(r,n),n}return t});return a?await a:t.authToken}function it(t){return Q(t,t=>{if(!at(t))throw O.create("not-registered");var e,n=t.authToken;return 1===(e=n).requestStatus&&e.requestTime+S<Date.now()?Object.assign(Object.assign({},t),{authToken:{requestStatus:0}}):t})}function at(t){return void 0!==t&&2===t.registrationStatus}async function ot(t,e=!1){var n,r=t;return t=r.appConfig,await((n=(await X(t)).registrationPromise)&&await n),(await rt(r,e)).token}function st(t){return O.create("missing-app-config-values",{valueName:t})}const ct="installations",ut=t=>{var e=t.getProvider("app").getImmediate();return{app:e,appConfig:function(t){if(!t||!t.options)throw st("App Configuration");if(!t.name)throw st("App Name");for(const e of["projectId","apiKey","appId"])if(!t.options[e])throw st(e);return{appName:t.name,projectId:t.options.projectId,apiKey:t.options.apiKey,appId:t.options.appId}}(e),platformLoggerProvider:me._getProvider(e,"platform-logger"),_delete:()=>Promise.resolve()}},lt=t=>{var e=t.getProvider("app").getImmediate();const n=me._getProvider(e,ct).getImmediate();return{getId:()=>async function(t){var e=t;const{installationEntry:n,registrationPromise:r}=await X(e.appConfig);return(r||rt(e)).catch(console.error),n.fid}(n),getToken:t=>ot(n,t)}};me._registerComponent(new i(ct,ut,"PUBLIC")),me._registerComponent(new i("installations-internal",lt,"PRIVATE")),me.registerVersion(I,T),me.registerVersion(I,T,"esm2017");const pt="@firebase/performance",ft="0.5.5-canary.044a8d7f9",dt=ft,gt="FB-PERF-TRACE-MEASURE",ht="@firebase/performance/config",mt="@firebase/performance/configexpire";var vt,bt,_t,T="Performance";const wt=new r("performance",T,{"trace started":"Trace {$traceName} was started before.","trace stopped":"Trace {$traceName} is not running.","nonpositive trace startTime":"Trace {$traceName} startTime should be positive.","nonpositive trace duration":"Trace {$traceName} duration should be positive.","no window":"Window is not available.","no app id":"App id is not available.","no project id":"Project id is not available.","no api key":"Api key is not available.","invalid cc log":"Attempted to queue invalid cc event","FB not default":"Performance can only start when Firebase app instance is the default one.","RC response not ok":"RC response is not ok","invalid attribute name":"Attribute name {$attributeName} is invalid.","invalid attribute value":"Attribute value {$attributeValue} is invalid.","invalid custom metric name":"Custom metric name {$customMetricName} is invalid","invalid String merger input":"Input for String merger is invalid, contact support team to resolve.","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."}),yt=new class{constructor(t){this.name=t,this._logLevel=c,this._logHandler=l,this._userLogHandler=null}get logLevel(){return this._logLevel}set logLevel(t){if(!(t in e))throw new TypeError(`Invalid value "${t}" assigned to \`logLevel\``);this._logLevel=t}setLogLevel(t){this._logLevel="string"==typeof t?a[t]:t}get logHandler(){return this._logHandler}set logHandler(t){if("function"!=typeof t)throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=t}get userLogHandler(){return this._userLogHandler}set userLogHandler(t){this._userLogHandler=t}debug(...t){this._userLogHandler&&this._userLogHandler(this,e.DEBUG,...t),this._logHandler(this,e.DEBUG,...t)}log(...t){this._userLogHandler&&this._userLogHandler(this,e.VERBOSE,...t),this._logHandler(this,e.VERBOSE,...t)}info(...t){this._userLogHandler&&this._userLogHandler(this,e.INFO,...t),this._logHandler(this,e.INFO,...t)}warn(...t){this._userLogHandler&&this._userLogHandler(this,e.WARN,...t),this._logHandler(this,e.WARN,...t)}error(...t){this._userLogHandler&&this._userLogHandler(this,e.ERROR,...t),this._logHandler(this,e.ERROR,...t)}}(T);yt.logLevel=e.INFO;let Et,It;class Tt{constructor(t){if(!(this.window=t))throw wt.create("no window");this.performance=t.performance,this.PerformanceObserver=t.PerformanceObserver,this.windowLocation=t.location,this.navigator=t.navigator,this.document=t.document,this.navigator&&this.navigator.cookieEnabled&&(this.localStorage=t.localStorage),t.perfMetrics&&t.perfMetrics.onFirstInputDelay&&(this.onFirstInputDelay=t.perfMetrics.onFirstInputDelay)}getUrl(){return this.windowLocation.href.split("?")[0]}mark(t){this.performance&&this.performance.mark&&this.performance.mark(t)}measure(t,e,n){this.performance&&this.performance.measure&&this.performance.measure(t,e,n)}getEntriesByType(t){return this.performance&&this.performance.getEntriesByType?this.performance.getEntriesByType(t):[]}getEntriesByName(t){return this.performance&&this.performance.getEntriesByName?this.performance.getEntriesByName(t):[]}getTimeOrigin(){return this.performance&&(this.performance.timeOrigin||this.performance.timing.navigationStart)}requiredApisAvailable(){return fetch&&Promise&&"undefined"!=typeof navigator&&navigator.cookieEnabled?"object"==typeof indexedDB||(yt.info("IndexedDB is not supported by current browswer"),!1):(yt.info("Firebase Performance cannot start if browser does not support fetch and Promise or cookie is disabled."),!1)}setupObserver(t,n){if(this.PerformanceObserver){const e=new this.PerformanceObserver(t=>{for(const e of t.getEntries())n(e)});e.observe({entryTypes:[t]})}}static getInstance(){return void 0===Et&&(Et=new Tt(It)),Et}}let St;function Nt(t,e){var n=t.length-e.length;if(n<0||1<n)throw wt.create("invalid String merger input");const r=[];for(let i=0;i<t.length;i++)r.push(t.charAt(i)),e.length>i&&r.push(e.charAt(i));return r.join("")}let kt;class At{constructor(){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}getFlTransportFullUrl(){return this.flTransportEndpointUrl.concat("?key=",this.transportKey)}static getInstance(){return void 0===kt&&(kt=new At),kt}}(bt=vt=vt||{})[bt.UNKNOWN=0]="UNKNOWN",bt[bt.VISIBLE=1]="VISIBLE",bt[bt.HIDDEN=2]="HIDDEN";const Ct=["firebase_","google_","ga_"],Ot=new RegExp("^[a-zA-Z]\\w*$");function Pt(){switch(Tt.getInstance().document.visibilityState){case"visible":return vt.VISIBLE;case"hidden":return vt.HIDDEN;default:return vt.UNKNOWN}}function Rt(t){var e=null===(e=t.options)||void 0===e?void 0:e.appId;if(!e)throw wt.create("no app id");return e}const Mt="0.0.1",jt={loggingEnabled:!0},Bt="FIREBASE_INSTALLATIONS_AUTH";function Dt(t,e){var r,i,n=function(){const t=Tt.getInstance().localStorage;if(t){var e=t.getItem(mt);if(e&&function(t){return Number(t)>Date.now()}(e)){e=t.getItem(ht);if(e)try{return JSON.parse(e)}catch(t){return}}}}();return n?($t(n),Promise.resolve()):(i=e,function(t){const e=t.getToken();return e.then(t=>{}),e}((r=t).installations).then(t=>{var e=function(t){var e=null===(e=t.options)||void 0===e?void 0:e.projectId;if(!e)throw wt.create("no project id");return e}(r.app),n=function(t){var e=null===(e=t.options)||void 0===e?void 0:e.apiKey;if(!e)throw wt.create("no api key");return e}(r.app),n=new Request(`https://firebaseremoteconfig.googleapis.com/v1/projects/${e}/namespaces/fireperf:fetch?key=${n}`,{method:"POST",headers:{Authorization:`${Bt} ${t}`},body:JSON.stringify({app_instance_id:i,app_instance_id_token:t,app_id:Rt(r.app),app_version:dt,sdk_version:Mt})});return fetch(n).then(t=>{if(t.ok)return t.json();throw wt.create("RC response not ok")})}).catch(()=>{yt.info(Lt)}).then($t).then(t=>function(t){const e=Tt.getInstance().localStorage;t&&e&&(e.setItem(ht,JSON.stringify(t)),e.setItem(mt,String(Date.now()+60*At.getInstance().configTimeToLive*60*1e3)))}(t),()=>{}))}const Lt="Could not fetch config, will use default configs";function $t(t){if(!t)return t;const e=At.getInstance();var n=t.entries||{};return void 0!==n.fpr_enabled?e.loggingEnabled="true"===String(n.fpr_enabled):e.loggingEnabled=jt.loggingEnabled,n.fpr_log_source&&(e.logSource=Number(n.fpr_log_source)),n.fpr_log_endpoint_url&&(e.logEndPointUrl=n.fpr_log_endpoint_url),n.fpr_log_transport_key&&(e.transportKey=n.fpr_log_transport_key),void 0!==n.fpr_vc_network_request_sampling_rate&&(e.networkRequestsSamplingRate=Number(n.fpr_vc_network_request_sampling_rate)),void 0!==n.fpr_vc_trace_sampling_rate&&(e.tracesSamplingRate=Number(n.fpr_vc_trace_sampling_rate)),e.logTraceAfterSampling=Ut(e.tracesSamplingRate),e.logNetworkAfterSampling=Ut(e.networkRequestsSamplingRate),t}function Ut(t){return Math.random()<=t}let qt=1,xt;function Ft(t){var e;return qt=2,xt=xt||(e=t,function(){const n=Tt.getInstance().document;return new Promise(t=>{if(n&&"complete"!==n.readyState){const e=()=>{"complete"===n.readyState&&(n.removeEventListener("readystatechange",e),t())};n.addEventListener("readystatechange",e)}else t()})}().then(()=>function(t){const e=t.getId();return e.then(t=>{St=t}),e}(e.installations)).then(t=>Dt(e,t)).then(()=>Ht(),()=>Ht())),xt}function Ht(){qt=3}const Vt=1e4,Kt=3,Wt=1e3;let zt=Kt,Gt=[],Jt=!1;function Yt(t){setTimeout(()=>{if(0!==zt)return Gt.length?void function(){const t=Gt.splice(0,Wt),e=t.map(t=>({source_extension_json_proto3:t.message,event_time_ms:String(t.eventTime)})),n={request_time_ms:String(Date.now()),client_info:{client_type:1,js_client_info:{}},log_source:At.getInstance().logSource,log_event:e};!function(t,r){return function(t){var e=At.getInstance().getFlTransportFullUrl();return fetch(e,{method:"POST",body:JSON.stringify(t)})}(t).then(t=>(t.ok||yt.info("Call to Firebase backend failed."),t.json())).then(t=>{var e=Number(t.nextRequestWaitMillis);let n=Vt;isNaN(e)||(n=Math.max(e,n));e=t.logResponseDetails;Array.isArray(e)&&0<e.length&&"RETRY_REQUEST_LATER"===e[0].responseAction&&(Gt=[...r,...Gt],yt.info("Retry transport request later.")),zt=Kt,Yt(n)})}(n,t).catch(()=>{Gt=[...t,...Gt],zt--,yt.info(`Tries left: ${zt}.`),Yt(Vt)})}():Yt(Vt)},t)}function Zt(e){return(...t)=>{!function(t){if(!t.eventTime||!t.message)throw wt.create("invalid cc log");Gt=[...Gt,t]}({message:e(...t),eventTime:Date.now()})}}let Qt;function Xt(t,e){Qt=Qt||Zt(ne),Qt(t,e)}function te(t){var e=At.getInstance();!e.instrumentationEnabled&&t.isAuto||(e.dataCollectionEnabled||t.isAuto)&&Tt.getInstance().requiredApisAvailable()&&(t.isAuto&&Pt()!==vt.VISIBLE||(3===qt?ee(t):Ft(t.performanceController).then(()=>ee(t),()=>ee(t))))}function ee(t){var e;!St||(e=At.getInstance()).loggingEnabled&&e.logTraceAfterSampling&&setTimeout(()=>Xt(t,1),0)}function ne(t,e){return 0===e?(n={url:t.url,http_method:t.httpMethod||0,http_response_code:200,response_payload_bytes:t.responsePayloadBytes,client_start_time_us:t.startTimeUs,time_to_response_initiated_us:t.timeToResponseInitiatedUs,time_to_response_completed_us:t.timeToResponseCompletedUs},n={application_info:re(t.performanceController.app),network_request_metric:n},JSON.stringify(n)):function(t){const e={name:t.name,is_auto:t.isAuto,client_start_time_us:t.startTimeUs,duration_us:t.durationUs};0!==Object.keys(t.counters).length&&(e.counters=t.counters);var n=t.getAttributes();0!==Object.keys(n).length&&(e.custom_attributes=n);n={application_info:re(t.performanceController.app),trace_metric:e};return JSON.stringify(n)}(t);var n}function re(t){return{google_app_id:Rt(t),app_instance_id:St,web_app_info:{sdk_version:dt,page_url:Tt.getInstance().getUrl(),service_worker_status:"serviceWorker"in(e=Tt.getInstance().navigator)?e.serviceWorker.controller?2:3:1,visibility_state:Pt(),effective_connection_type:function(){var t=Tt.getInstance().navigator.connection;switch(t&&t.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 e}const ie=["_fp","_fcp","_fid"];class ae{constructor(t,e,n=!1,r){this.performanceController=t,this.name=e,this.isAuto=n,this.state=1,this.customAttributes={},this.counters={},this.api=Tt.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||`${gt}-${this.randomId}-${this.name}`,r&&this.calculateTraceMetrics())}start(){if(1!==this.state)throw wt.create("trace started",{traceName:this.name});this.api.mark(this.traceStartMark),this.state=2}stop(){if(2!==this.state)throw wt.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(),te(this)}record(t,e,n){if(t<=0)throw wt.create("nonpositive trace startTime",{traceName:this.name});if(e<=0)throw wt.create("nonpositive trace duration",{traceName:this.name});if(this.durationUs=Math.floor(1e3*e),this.startTimeUs=Math.floor(1e3*t),n&&n.attributes&&(this.customAttributes=Object.assign({},n.attributes)),n&&n.metrics)for(const r of Object.keys(n.metrics))isNaN(Number(n.metrics[r]))||(this.counters[r]=Number(Math.floor(n.metrics[r])));te(this)}incrementMetric(t,e=1){void 0===this.counters[t]?this.putMetric(t,e):this.putMetric(t,this.counters[t]+e)}putMetric(t,e){if(r=t,i=this.name,0===r.length||100<r.length||!(i&&i.startsWith("_wt_")&&-1<ie.indexOf(r))&&r.startsWith("_"))throw wt.create("invalid custom metric name",{customMetricName:t});var n,r,i;this.counters[t]=(e=e,(n=Math.floor(e))<e&&yt.info(`Metric value should be an Integer, setting the value as : ${n}.`),n)}getMetric(t){return this.counters[t]||0}putAttribute(t,e){var n,r,i=!(0===(n=t).length||40<n.length)&&(!Ct.some(t=>n.startsWith(t))&&!!n.match(Ot)),a=0!==(r=e).length&&r.length<=100;if(i&&a)this.customAttributes[t]=e;else{if(!i)throw wt.create("invalid attribute name",{attributeName:t});if(!a)throw wt.create("invalid attribute value",{attributeValue:e})}}getAttribute(t){return this.customAttributes[t]}removeAttribute(t){void 0!==this.customAttributes[t]&&delete this.customAttributes[t]}getAttributes(){return Object.assign({},this.customAttributes)}setStartTime(t){this.startTimeUs=t}setDuration(t){this.durationUs=t}calculateTraceMetrics(){var t=this.api.getEntriesByName(this.traceMeasure),t=t&&t[0];t&&(this.durationUs=Math.floor(1e3*t.duration),this.startTimeUs=Math.floor(1e3*(t.startTime+this.api.getTimeOrigin())))}static createOobTrace(t,e,n,r){var i=Tt.getInstance().getUrl();if(i){const a=new ae(t,"_wt_"+i,!0);i=Math.floor(1e3*Tt.getInstance().getTimeOrigin());a.setStartTime(i),e&&e[0]&&(a.setDuration(Math.floor(1e3*e[0].duration)),a.putMetric("domInteractive",Math.floor(1e3*e[0].domInteractive)),a.putMetric("domContentLoadedEventEnd",Math.floor(1e3*e[0].domContentLoadedEventEnd)),a.putMetric("loadEventEnd",Math.floor(1e3*e[0].loadEventEnd)));n&&((i=n.find(t=>"first-paint"===t.name))&&i.startTime&&a.putMetric("_fp",Math.floor(1e3*i.startTime)),(i=n.find(t=>"first-contentful-paint"===t.name))&&i.startTime&&a.putMetric("_fcp",Math.floor(1e3*i.startTime)),r&&a.putMetric("_fid",Math.floor(1e3*r))),te(a)}}static createUserTimingTrace(t,e){te(new ae(t,e,!1,e))}}function oe(t,e){const n=e;var r,i,a;n&&void 0!==n.responseStart&&(a=Tt.getInstance().getTimeOrigin(),r=Math.floor(1e3*(n.startTime+a)),i=n.responseStart?Math.floor(1e3*(n.responseStart-n.startTime)):void 0,a=Math.floor(1e3*(n.responseEnd-n.startTime)),function(t){const e=At.getInstance();var n,r,i;e.instrumentationEnabled&&(n=t.url,r=e.logEndPointUrl.split("?")[0],i=e.flTransportEndpointUrl.split("?")[0],n!==r&&n!==i&&e.loggingEnabled&&e.logNetworkAfterSampling&&setTimeout(()=>Xt(t,0),0))}({performanceController:t,url:n.name&&n.name.split("?")[0],responsePayloadBytes:n.transferSize,startTimeUs:r,timeToResponseInitiatedUs:i,timeToResponseCompletedUs:a}))}const se=5e3;function ce(t){St&&(setTimeout(()=>function(n){const t=Tt.getInstance(),r=t.getEntriesByType("navigation"),i=t.getEntriesByType("paint");if(t.onFirstInputDelay){let e=setTimeout(()=>{ae.createOobTrace(n,r,i),e=void 0},se);t.onFirstInputDelay(t=>{e&&(clearTimeout(e),ae.createOobTrace(n,r,i,t))})}else ae.createOobTrace(n,r,i)}(t),0),setTimeout(()=>function(e){const t=Tt.getInstance(),n=t.getEntriesByType("resource");for(const r of n)oe(e,r);t.setupObserver("resource",t=>oe(e,t))}(t),0),setTimeout(()=>function(e){const t=Tt.getInstance(),n=t.getEntriesByType("measure");for(const r of n)ue(e,r);t.setupObserver("measure",t=>ue(e,t))}(t),0))}function ue(t,e){const n=e.name;n.substring(0,gt.length)!==gt&&ae.createUserTimingTrace(t,n)}class le{constructor(t,e){this.app=t,this.installations=e,this.initialized=!1}_init(t){this.initialized||(void 0!==(null==t?void 0:t.dataCollectionEnabled)&&(this.dataCollectionEnabled=t.dataCollectionEnabled),void 0!==(null==t?void 0:t.instrumentationEnabled)&&(this.instrumentationEnabled=t.instrumentationEnabled),Tt.getInstance().requiredApisAvailable()?new Promise((e,n)=>{try{let t=!0;const r="validate-browser-context-for-indexeddb-analytics-module",i=self.indexedDB.open(r);i.onsuccess=()=>{i.result.close(),t||self.indexedDB.deleteDatabase(r),e(!0)},i.onupgradeneeded=()=>{t=!1},i.onerror=()=>{var t;n((null===(t=i.error)||void 0===t?void 0:t.message)||"")}}catch(t){n(t)}}).then(t=>{t&&(Jt||(Yt(5500),Jt=!0),Ft(this).then(()=>ce(this),()=>ce(this)),this.initialized=!0)}).catch(t=>{yt.info(`Environment doesn't support IndexedDB: ${t}`)}):yt.info('Firebase Performance cannot start if the browser does not support "Fetch" and "Promise", or cookies are disabled.'))}set instrumentationEnabled(t){At.getInstance().instrumentationEnabled=t}get instrumentationEnabled(){return At.getInstance().instrumentationEnabled}set dataCollectionEnabled(t){At.getInstance().dataCollectionEnabled=t}get dataCollectionEnabled(){return At.getInstance().dataCollectionEnabled}}const pe="[DEFAULT]";const fe=(t,{options:e})=>{var n=t.getProvider("app").getImmediate(),r=t.getProvider("installations-internal").getImmediate();if(n.name!==pe)throw wt.create("FB not default");if("undefined"==typeof window)throw wt.create("no window");t=window,It=t;const i=new le(n,r);return i._init(e),i};me._registerComponent(new i("performance",fe,"PUBLIC")),me.registerVersion(pt,ft),me.registerVersion(pt,ft,"esm2017");class de{constructor(t,e){this.app=t,this._delegate=e}get instrumentationEnabled(){return this._delegate.instrumentationEnabled}set instrumentationEnabled(t){this._delegate.instrumentationEnabled=t}get dataCollectionEnabled(){return this._delegate.dataCollectionEnabled}set dataCollectionEnabled(t){this._delegate.dataCollectionEnabled=t}trace(t){return e=this._delegate,n=t,e=(t=e)&&t._delegate?t._delegate:t,new ae(e,n);var e,n}}function ge(t){var e=t.getProvider("app-compat").getImmediate(),n=t.getProvider("performance").getImmediate();return new de(e,n)}(_t=n.default).INTERNAL.registerComponent(new i("performance-compat",ge,"PUBLIC")),_t.registerVersion("@firebase/performance-compat","0.1.5-canary.044a8d7f9")}).apply(this,arguments)}catch(t){throw console.error(t),new Error("Cannot instantiate firebase-performance-compat.js - be sure to load firebase-app.js first.")}});
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(require("@firebase/app-compat"),require("@firebase/app")):"function"==typeof define&&define.amd?define(["@firebase/app-compat","@firebase/app"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).firebase,t.firebase.INTERNAL.modularAPIs)}(this,function(he,me){"use strict";try{!(function(){function t(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var e,n=t(he);class o extends Error{constructor(t,e,n){super(e),this.code=t,this.customData=n,this.name="FirebaseError",Object.setPrototypeOf(this,o.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,r.prototype.create)}}class r{constructor(t,e,n){this.service=t,this.serviceName=e,this.errors=n}create(t,...e){var r,n=e[0]||{},i=`${this.service}/${t}`,a=this.errors[t],a=a?(r=n,a.replace(s,(t,e)=>{var n=r[e];return null!=n?String(n):`<${e}?>`})):"Error",a=`${this.serviceName}: ${a} (${i}).`;return new o(i,a,n)}}const s=/\{\$([^}]+)}/g;class i{constructor(t,e,n){this.name=t,this.instanceFactory=e,this.type=n,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(t){return this.instantiationMode=t,this}setMultipleInstances(t){return this.multipleInstances=t,this}setServiceProps(t){return this.serviceProps=t,this}setInstanceCreatedCallback(t){return this.onInstanceCreated=t,this}}(bt=e=e||{})[bt.DEBUG=0]="DEBUG",bt[bt.VERBOSE=1]="VERBOSE",bt[bt.INFO=2]="INFO",bt[bt.WARN=3]="WARN",bt[bt.ERROR=4]="ERROR",bt[bt.SILENT=5]="SILENT";const a={debug:e.DEBUG,verbose:e.VERBOSE,info:e.INFO,warn:e.WARN,error:e.ERROR,silent:e.SILENT},c=e.INFO,u={[e.DEBUG]:"log",[e.VERBOSE]:"log",[e.INFO]:"info",[e.WARN]:"warn",[e.ERROR]:"error"},l=(t,e,...n)=>{if(!(e<t.logLevel)){var r=(new Date).toISOString(),i=u[e];if(!i)throw new Error(`Attempted to log a message with an invalid logType (value: ${e})`);console[i](`[${r}] ${t.name}:`,...n)}};function p(n){return new Promise(function(t,e){n.onsuccess=function(){t(n.result)},n.onerror=function(){e(n.error)}})}function f(n,r,i){var a,t=new Promise(function(t,e){p(a=n[r].apply(n,i)).then(t,e)});return t.request=a,t}function d(t,n,e){e.forEach(function(e){Object.defineProperty(t.prototype,e,{get:function(){return this[n][e]},set:function(t){this[n][e]=t}})})}function g(e,n,r,t){t.forEach(function(t){t in r.prototype&&(e.prototype[t]=function(){return f(this[n],t,arguments)})})}function h(e,n,r,t){t.forEach(function(t){t in r.prototype&&(e.prototype[t]=function(){return this[n][t].apply(this[n],arguments)})})}function m(t,r,e,n){n.forEach(function(n){n in e.prototype&&(t.prototype[n]=function(){return t=this[r],(e=f(t,n,arguments)).then(function(t){if(t)return new b(t,e.request)});var t,e})})}function v(t){this._index=t}function b(t,e){this._cursor=t,this._request=e}function _(t){this._store=t}function w(n){this._tx=n,this.complete=new Promise(function(t,e){n.oncomplete=function(){t()},n.onerror=function(){e(n.error)},n.onabort=function(){e(n.error)}})}function y(t,e,n){this._db=t,this.oldVersion=e,this.transaction=new w(n)}function E(t){this._db=t}d(v,"_index",["name","keyPath","multiEntry","unique"]),g(v,"_index",IDBIndex,["get","getKey","getAll","getAllKeys","count"]),m(v,"_index",IDBIndex,["openCursor","openKeyCursor"]),d(b,"_cursor",["direction","key","primaryKey","value"]),g(b,"_cursor",IDBCursor,["update","delete"]),["advance","continue","continuePrimaryKey"].forEach(function(n){n in IDBCursor.prototype&&(b.prototype[n]=function(){var e=this,t=arguments;return Promise.resolve().then(function(){return e._cursor[n].apply(e._cursor,t),p(e._request).then(function(t){if(t)return new b(t,e._request)})})})}),_.prototype.createIndex=function(){return new v(this._store.createIndex.apply(this._store,arguments))},_.prototype.index=function(){return new v(this._store.index.apply(this._store,arguments))},d(_,"_store",["name","keyPath","indexNames","autoIncrement"]),g(_,"_store",IDBObjectStore,["put","add","delete","clear","get","getAll","getKey","getAllKeys","count"]),m(_,"_store",IDBObjectStore,["openCursor","openKeyCursor"]),h(_,"_store",IDBObjectStore,["deleteIndex"]),w.prototype.objectStore=function(){return new _(this._tx.objectStore.apply(this._tx,arguments))},d(w,"_tx",["objectStoreNames","mode"]),h(w,"_tx",IDBTransaction,["abort"]),y.prototype.createObjectStore=function(){return new _(this._db.createObjectStore.apply(this._db,arguments))},d(y,"_db",["name","version","objectStoreNames"]),h(y,"_db",IDBDatabase,["deleteObjectStore","close"]),E.prototype.transaction=function(){return new w(this._db.transaction.apply(this._db,arguments))},d(E,"_db",["name","version","objectStoreNames"]),h(E,"_db",IDBDatabase,["close"]),["openCursor","openKeyCursor"].forEach(function(a){[_,v].forEach(function(t){a in t.prototype&&(t.prototype[a.replace("open","iterate")]=function(){var t,e=(t=arguments,Array.prototype.slice.call(t)),n=e[e.length-1],r=this._store||this._index,i=r[a].apply(r,e.slice(0,-1));i.onsuccess=function(){n(i.result)}})})}),[v,_].forEach(function(t){t.prototype.getAll||(t.prototype.getAll=function(t,n){var r=this,i=[];return new Promise(function(e){r.iterateCursor(t,function(t){t?(i.push(t.value),void 0===n||i.length!=n?t.continue():e(i)):e(i)})})})});var I="@firebase/installations",T="0.5.5-canary.88d43ec00";const S=1e4,N=`w:${T}`,k="FIS_v2",A="https://firebaseinstallations.googleapis.com/v1",C=36e5;const O=new r("installations","Installations",{"missing-app-config-values":'Missing App configuration value: "{$valueName}"',"not-registered":"Firebase Installation is not registered.","installation-not-found":"Firebase Installation not found.","request-failed":'{$requestName} request failed with error "{$serverCode} {$serverStatus}: {$serverMessage}"',"app-offline":"Could not process request. Application offline.","delete-pending-registration":"Can't delete installation while there is a pending registration request."});function P(t){return t instanceof o&&t.code.includes("request-failed")}function R({projectId:t}){return`${A}/projects/${t}/installations`}function M(t){return{token:t.token,requestStatus:2,expiresIn:(t=t.expiresIn,Number(t.replace("s","000"))),creationTime:Date.now()}}async function j(t,e){var n=(await e.json()).error;return O.create("request-failed",{requestName:t,serverCode:n.code,serverMessage:n.message,serverStatus:n.status})}function B({apiKey:t}){return new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":t})}function D(t,{refreshToken:e}){const n=B(t);return n.append("Authorization",(e=e,`${k} ${e}`)),n}async function L(t){var e=await t();return 500<=e.status&&e.status<600?t():e}function $(e){return new Promise(t=>{setTimeout(t,e)})}const U=/^[cdef][\w-]{21}$/,q="";function x(){try{const e=new Uint8Array(17),n=self.crypto||self.msCrypto;n.getRandomValues(e),e[0]=112+e[0]%16;var t=function(t){const e=function(t){const e=btoa(String.fromCharCode(...t));return e.replace(/\+/g,"-").replace(/\//g,"_")}(t);return e.substr(0,22)}(e);return U.test(t)?t:q}catch(t){return q}}function F(t){return`${t.appName}!${t.appId}`}const H=new Map;function V(t,e){var n=F(t);K(n,e),function(t,e){const n=function(){!W&&"BroadcastChannel"in self&&(W=new BroadcastChannel("[Firebase] FID Change"),W.onmessage=t=>{K(t.data.key,t.data.fid)});return W}();n&&n.postMessage({key:t,fid:e});0===H.size&&W&&(W.close(),W=null)}(n,e)}function K(t,e){var n=H.get(t);if(n)for(const r of n)r(e)}let W=null;const z="firebase-installations-store";let G=null;function J(){var e,t,n;return G=G||(e=t=>{0===t.oldVersion&&t.createObjectStore(z)},t=f(indexedDB,"open",["firebase-installations-database",1]),(n=t.request)&&(n.onupgradeneeded=function(t){e&&e(new y(n.result,t.oldVersion,n.transaction))}),t.then(function(t){return new E(t)})),G}async function Y(t,e){var n=F(t);const r=await J(),i=r.transaction(z,"readwrite"),a=i.objectStore(z);var o=await a.get(n);return await a.put(e,n),await i.complete,o&&o.fid===e.fid||V(t,e.fid),e}async function Z(t){var e=F(t);const n=await J(),r=n.transaction(z,"readwrite");await r.objectStore(z).delete(e),await r.complete}async function Q(t,e){var n=F(t);const r=await J(),i=r.transaction(z,"readwrite"),a=i.objectStore(z);var o=await a.get(n),s=e(o);return void 0===s?await a.delete(n):await a.put(s,n),await i.complete,!s||o&&o.fid===s.fid||V(t,s.fid),s}async function X(n){let r;var t=await Q(n,t=>{var e=et(t||{fid:x(),registrationStatus:0}),e=function(t,e){{if(0!==e.registrationStatus)return 1===e.registrationStatus?{installationEntry:e,registrationPromise:async function(t){let e=await tt(t);for(;1===e.registrationStatus;)await $(100),e=await tt(t);if(0!==e.registrationStatus)return e;{var{installationEntry:n,registrationPromise:r}=await X(t);return r||n}}(t)}:{installationEntry:e};if(!navigator.onLine){var n=Promise.reject(O.create("app-offline"));return{installationEntry:e,registrationPromise:n}}var r={fid:e.fid,registrationStatus:1,registrationTime:Date.now()},n=async function(e,n){try{var t=await async function(t,{fid:e}){const n=R(t);var r=B(t),i={fid:e,authVersion:k,appId:t.appId,sdkVersion:N};const a={method:"POST",headers:r,body:JSON.stringify(i)},o=await L(()=>fetch(n,a));if(o.ok){i=await o.json();return{fid:i.fid||e,registrationStatus:2,refreshToken:i.refreshToken,authToken:M(i.authToken)}}throw await j("Create Installation",o)}(e,n);return Y(e,t)}catch(t){throw P(t)&&409===t.customData.serverCode?await Z(e):await Y(e,{fid:n.fid,registrationStatus:0}),t}}(t,r);return{installationEntry:r,registrationPromise:n}}}(n,e);return r=e.registrationPromise,e.installationEntry});return t.fid===q?{installationEntry:await r}:{installationEntry:t,registrationPromise:r}}function tt(t){return Q(t,t=>{if(!t)throw O.create("installation-not-found");return et(t)})}function et(t){return 1===(e=t).registrationStatus&&e.registrationTime+S<Date.now()?{fid:t.fid,registrationStatus:0}:t;var e}async function nt({appConfig:t,platformLoggerProvider:e},n){const r=([i,a]=[t,n["fid"]],`${R(i)}/${a}/authTokens:generate`);var i,a;const o=D(t,n),s=e.getImmediate({optional:!0});s&&o.append("x-firebase-client",s.getPlatformInfoString());var c={installation:{sdkVersion:N}};const u={method:"POST",headers:o,body:JSON.stringify(c)},l=await L(()=>fetch(r,u));if(l.ok)return M(await l.json());throw await j("Generate Auth Token",l)}async function rt(r,i=!1){let a;var t=await Q(r.appConfig,t=>{if(!at(t))throw O.create("not-registered");var e,n=t.authToken;if(i||2!==(e=n).requestStatus||function(t){var e=Date.now();return e<t.creationTime||t.creationTime+t.expiresIn<e+C}(e)){if(1===n.requestStatus)return a=async function(t,e){let n=await it(t.appConfig);for(;1===n.authToken.requestStatus;)await $(100),n=await it(t.appConfig);var r=n.authToken;return 0===r.requestStatus?rt(t,e):r}(r,i),t;if(!navigator.onLine)throw O.create("app-offline");n=(e=t,n={requestStatus:1,requestTime:Date.now()},Object.assign(Object.assign({},e),{authToken:n}));return a=async function(e,n){try{var r=await nt(e,n),t=Object.assign(Object.assign({},n),{authToken:r});return await Y(e.appConfig,t),r}catch(t){throw!P(t)||401!==t.customData.serverCode&&404!==t.customData.serverCode?(r=Object.assign(Object.assign({},n),{authToken:{requestStatus:0}}),await Y(e.appConfig,r)):await Z(e.appConfig),t}}(r,n),n}return t});return a?await a:t.authToken}function it(t){return Q(t,t=>{if(!at(t))throw O.create("not-registered");var e,n=t.authToken;return 1===(e=n).requestStatus&&e.requestTime+S<Date.now()?Object.assign(Object.assign({},t),{authToken:{requestStatus:0}}):t})}function at(t){return void 0!==t&&2===t.registrationStatus}async function ot(t,e=!1){var n,r=t;return t=r.appConfig,await((n=(await X(t)).registrationPromise)&&await n),(await rt(r,e)).token}function st(t){return O.create("missing-app-config-values",{valueName:t})}const ct="installations",ut=t=>{var e=t.getProvider("app").getImmediate();return{app:e,appConfig:function(t){if(!t||!t.options)throw st("App Configuration");if(!t.name)throw st("App Name");for(const e of["projectId","apiKey","appId"])if(!t.options[e])throw st(e);return{appName:t.name,projectId:t.options.projectId,apiKey:t.options.apiKey,appId:t.options.appId}}(e),platformLoggerProvider:me._getProvider(e,"platform-logger"),_delete:()=>Promise.resolve()}},lt=t=>{var e=t.getProvider("app").getImmediate();const n=me._getProvider(e,ct).getImmediate();return{getId:()=>async function(t){var e=t;const{installationEntry:n,registrationPromise:r}=await X(e.appConfig);return(r||rt(e)).catch(console.error),n.fid}(n),getToken:t=>ot(n,t)}};me._registerComponent(new i(ct,ut,"PUBLIC")),me._registerComponent(new i("installations-internal",lt,"PRIVATE")),me.registerVersion(I,T),me.registerVersion(I,T,"esm2017");const pt="@firebase/performance",ft="0.5.5-canary.88d43ec00",dt=ft,gt="FB-PERF-TRACE-MEASURE",ht="@firebase/performance/config",mt="@firebase/performance/configexpire";var vt,bt,_t,T="Performance";const wt=new r("performance",T,{"trace started":"Trace {$traceName} was started before.","trace stopped":"Trace {$traceName} is not running.","nonpositive trace startTime":"Trace {$traceName} startTime should be positive.","nonpositive trace duration":"Trace {$traceName} duration should be positive.","no window":"Window is not available.","no app id":"App id is not available.","no project id":"Project id is not available.","no api key":"Api key is not available.","invalid cc log":"Attempted to queue invalid cc event","FB not default":"Performance can only start when Firebase app instance is the default one.","RC response not ok":"RC response is not ok","invalid attribute name":"Attribute name {$attributeName} is invalid.","invalid attribute value":"Attribute value {$attributeValue} is invalid.","invalid custom metric name":"Custom metric name {$customMetricName} is invalid","invalid String merger input":"Input for String merger is invalid, contact support team to resolve.","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."}),yt=new class{constructor(t){this.name=t,this._logLevel=c,this._logHandler=l,this._userLogHandler=null}get logLevel(){return this._logLevel}set logLevel(t){if(!(t in e))throw new TypeError(`Invalid value "${t}" assigned to \`logLevel\``);this._logLevel=t}setLogLevel(t){this._logLevel="string"==typeof t?a[t]:t}get logHandler(){return this._logHandler}set logHandler(t){if("function"!=typeof t)throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=t}get userLogHandler(){return this._userLogHandler}set userLogHandler(t){this._userLogHandler=t}debug(...t){this._userLogHandler&&this._userLogHandler(this,e.DEBUG,...t),this._logHandler(this,e.DEBUG,...t)}log(...t){this._userLogHandler&&this._userLogHandler(this,e.VERBOSE,...t),this._logHandler(this,e.VERBOSE,...t)}info(...t){this._userLogHandler&&this._userLogHandler(this,e.INFO,...t),this._logHandler(this,e.INFO,...t)}warn(...t){this._userLogHandler&&this._userLogHandler(this,e.WARN,...t),this._logHandler(this,e.WARN,...t)}error(...t){this._userLogHandler&&this._userLogHandler(this,e.ERROR,...t),this._logHandler(this,e.ERROR,...t)}}(T);yt.logLevel=e.INFO;let Et,It;class Tt{constructor(t){if(!(this.window=t))throw wt.create("no window");this.performance=t.performance,this.PerformanceObserver=t.PerformanceObserver,this.windowLocation=t.location,this.navigator=t.navigator,this.document=t.document,this.navigator&&this.navigator.cookieEnabled&&(this.localStorage=t.localStorage),t.perfMetrics&&t.perfMetrics.onFirstInputDelay&&(this.onFirstInputDelay=t.perfMetrics.onFirstInputDelay)}getUrl(){return this.windowLocation.href.split("?")[0]}mark(t){this.performance&&this.performance.mark&&this.performance.mark(t)}measure(t,e,n){this.performance&&this.performance.measure&&this.performance.measure(t,e,n)}getEntriesByType(t){return this.performance&&this.performance.getEntriesByType?this.performance.getEntriesByType(t):[]}getEntriesByName(t){return this.performance&&this.performance.getEntriesByName?this.performance.getEntriesByName(t):[]}getTimeOrigin(){return this.performance&&(this.performance.timeOrigin||this.performance.timing.navigationStart)}requiredApisAvailable(){return fetch&&Promise&&"undefined"!=typeof navigator&&navigator.cookieEnabled?"object"==typeof indexedDB||(yt.info("IndexedDB is not supported by current browswer"),!1):(yt.info("Firebase Performance cannot start if browser does not support fetch and Promise or cookie is disabled."),!1)}setupObserver(t,n){if(this.PerformanceObserver){const e=new this.PerformanceObserver(t=>{for(const e of t.getEntries())n(e)});e.observe({entryTypes:[t]})}}static getInstance(){return void 0===Et&&(Et=new Tt(It)),Et}}let St;function Nt(t,e){var n=t.length-e.length;if(n<0||1<n)throw wt.create("invalid String merger input");const r=[];for(let i=0;i<t.length;i++)r.push(t.charAt(i)),e.length>i&&r.push(e.charAt(i));return r.join("")}let kt;class At{constructor(){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}getFlTransportFullUrl(){return this.flTransportEndpointUrl.concat("?key=",this.transportKey)}static getInstance(){return void 0===kt&&(kt=new At),kt}}(bt=vt=vt||{})[bt.UNKNOWN=0]="UNKNOWN",bt[bt.VISIBLE=1]="VISIBLE",bt[bt.HIDDEN=2]="HIDDEN";const Ct=["firebase_","google_","ga_"],Ot=new RegExp("^[a-zA-Z]\\w*$");function Pt(){switch(Tt.getInstance().document.visibilityState){case"visible":return vt.VISIBLE;case"hidden":return vt.HIDDEN;default:return vt.UNKNOWN}}function Rt(t){var e=null===(e=t.options)||void 0===e?void 0:e.appId;if(!e)throw wt.create("no app id");return e}const Mt="0.0.1",jt={loggingEnabled:!0},Bt="FIREBASE_INSTALLATIONS_AUTH";function Dt(t,e){var r,i,n=function(){const t=Tt.getInstance().localStorage;if(t){var e=t.getItem(mt);if(e&&function(t){return Number(t)>Date.now()}(e)){e=t.getItem(ht);if(e)try{return JSON.parse(e)}catch(t){return}}}}();return n?($t(n),Promise.resolve()):(i=e,function(t){const e=t.getToken();return e.then(t=>{}),e}((r=t).installations).then(t=>{var e=function(t){var e=null===(e=t.options)||void 0===e?void 0:e.projectId;if(!e)throw wt.create("no project id");return e}(r.app),n=function(t){var e=null===(e=t.options)||void 0===e?void 0:e.apiKey;if(!e)throw wt.create("no api key");return e}(r.app),n=new Request(`https://firebaseremoteconfig.googleapis.com/v1/projects/${e}/namespaces/fireperf:fetch?key=${n}`,{method:"POST",headers:{Authorization:`${Bt} ${t}`},body:JSON.stringify({app_instance_id:i,app_instance_id_token:t,app_id:Rt(r.app),app_version:dt,sdk_version:Mt})});return fetch(n).then(t=>{if(t.ok)return t.json();throw wt.create("RC response not ok")})}).catch(()=>{yt.info(Lt)}).then($t).then(t=>function(t){const e=Tt.getInstance().localStorage;t&&e&&(e.setItem(ht,JSON.stringify(t)),e.setItem(mt,String(Date.now()+60*At.getInstance().configTimeToLive*60*1e3)))}(t),()=>{}))}const Lt="Could not fetch config, will use default configs";function $t(t){if(!t)return t;const e=At.getInstance();var n=t.entries||{};return void 0!==n.fpr_enabled?e.loggingEnabled="true"===String(n.fpr_enabled):e.loggingEnabled=jt.loggingEnabled,n.fpr_log_source&&(e.logSource=Number(n.fpr_log_source)),n.fpr_log_endpoint_url&&(e.logEndPointUrl=n.fpr_log_endpoint_url),n.fpr_log_transport_key&&(e.transportKey=n.fpr_log_transport_key),void 0!==n.fpr_vc_network_request_sampling_rate&&(e.networkRequestsSamplingRate=Number(n.fpr_vc_network_request_sampling_rate)),void 0!==n.fpr_vc_trace_sampling_rate&&(e.tracesSamplingRate=Number(n.fpr_vc_trace_sampling_rate)),e.logTraceAfterSampling=Ut(e.tracesSamplingRate),e.logNetworkAfterSampling=Ut(e.networkRequestsSamplingRate),t}function Ut(t){return Math.random()<=t}let qt=1,xt;function Ft(t){var e;return qt=2,xt=xt||(e=t,function(){const n=Tt.getInstance().document;return new Promise(t=>{if(n&&"complete"!==n.readyState){const e=()=>{"complete"===n.readyState&&(n.removeEventListener("readystatechange",e),t())};n.addEventListener("readystatechange",e)}else t()})}().then(()=>function(t){const e=t.getId();return e.then(t=>{St=t}),e}(e.installations)).then(t=>Dt(e,t)).then(()=>Ht(),()=>Ht())),xt}function Ht(){qt=3}const Vt=1e4,Kt=3,Wt=1e3;let zt=Kt,Gt=[],Jt=!1;function Yt(t){setTimeout(()=>{if(0!==zt)return Gt.length?void function(){const t=Gt.splice(0,Wt),e=t.map(t=>({source_extension_json_proto3:t.message,event_time_ms:String(t.eventTime)})),n={request_time_ms:String(Date.now()),client_info:{client_type:1,js_client_info:{}},log_source:At.getInstance().logSource,log_event:e};!function(t,r){return function(t){var e=At.getInstance().getFlTransportFullUrl();return fetch(e,{method:"POST",body:JSON.stringify(t)})}(t).then(t=>(t.ok||yt.info("Call to Firebase backend failed."),t.json())).then(t=>{var e=Number(t.nextRequestWaitMillis);let n=Vt;isNaN(e)||(n=Math.max(e,n));e=t.logResponseDetails;Array.isArray(e)&&0<e.length&&"RETRY_REQUEST_LATER"===e[0].responseAction&&(Gt=[...r,...Gt],yt.info("Retry transport request later.")),zt=Kt,Yt(n)})}(n,t).catch(()=>{Gt=[...t,...Gt],zt--,yt.info(`Tries left: ${zt}.`),Yt(Vt)})}():Yt(Vt)},t)}function Zt(e){return(...t)=>{!function(t){if(!t.eventTime||!t.message)throw wt.create("invalid cc log");Gt=[...Gt,t]}({message:e(...t),eventTime:Date.now()})}}let Qt;function Xt(t,e){Qt=Qt||Zt(ne),Qt(t,e)}function te(t){var e=At.getInstance();!e.instrumentationEnabled&&t.isAuto||(e.dataCollectionEnabled||t.isAuto)&&Tt.getInstance().requiredApisAvailable()&&(t.isAuto&&Pt()!==vt.VISIBLE||(3===qt?ee(t):Ft(t.performanceController).then(()=>ee(t),()=>ee(t))))}function ee(t){var e;!St||(e=At.getInstance()).loggingEnabled&&e.logTraceAfterSampling&&setTimeout(()=>Xt(t,1),0)}function ne(t,e){return 0===e?(n={url:t.url,http_method:t.httpMethod||0,http_response_code:200,response_payload_bytes:t.responsePayloadBytes,client_start_time_us:t.startTimeUs,time_to_response_initiated_us:t.timeToResponseInitiatedUs,time_to_response_completed_us:t.timeToResponseCompletedUs},n={application_info:re(t.performanceController.app),network_request_metric:n},JSON.stringify(n)):function(t){const e={name:t.name,is_auto:t.isAuto,client_start_time_us:t.startTimeUs,duration_us:t.durationUs};0!==Object.keys(t.counters).length&&(e.counters=t.counters);var n=t.getAttributes();0!==Object.keys(n).length&&(e.custom_attributes=n);n={application_info:re(t.performanceController.app),trace_metric:e};return JSON.stringify(n)}(t);var n}function re(t){return{google_app_id:Rt(t),app_instance_id:St,web_app_info:{sdk_version:dt,page_url:Tt.getInstance().getUrl(),service_worker_status:"serviceWorker"in(e=Tt.getInstance().navigator)?e.serviceWorker.controller?2:3:1,visibility_state:Pt(),effective_connection_type:function(){var t=Tt.getInstance().navigator.connection;switch(t&&t.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 e}const ie=["_fp","_fcp","_fid"];class ae{constructor(t,e,n=!1,r){this.performanceController=t,this.name=e,this.isAuto=n,this.state=1,this.customAttributes={},this.counters={},this.api=Tt.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||`${gt}-${this.randomId}-${this.name}`,r&&this.calculateTraceMetrics())}start(){if(1!==this.state)throw wt.create("trace started",{traceName:this.name});this.api.mark(this.traceStartMark),this.state=2}stop(){if(2!==this.state)throw wt.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(),te(this)}record(t,e,n){if(t<=0)throw wt.create("nonpositive trace startTime",{traceName:this.name});if(e<=0)throw wt.create("nonpositive trace duration",{traceName:this.name});if(this.durationUs=Math.floor(1e3*e),this.startTimeUs=Math.floor(1e3*t),n&&n.attributes&&(this.customAttributes=Object.assign({},n.attributes)),n&&n.metrics)for(const r of Object.keys(n.metrics))isNaN(Number(n.metrics[r]))||(this.counters[r]=Number(Math.floor(n.metrics[r])));te(this)}incrementMetric(t,e=1){void 0===this.counters[t]?this.putMetric(t,e):this.putMetric(t,this.counters[t]+e)}putMetric(t,e){if(r=t,i=this.name,0===r.length||100<r.length||!(i&&i.startsWith("_wt_")&&-1<ie.indexOf(r))&&r.startsWith("_"))throw wt.create("invalid custom metric name",{customMetricName:t});var n,r,i;this.counters[t]=(e=e,(n=Math.floor(e))<e&&yt.info(`Metric value should be an Integer, setting the value as : ${n}.`),n)}getMetric(t){return this.counters[t]||0}putAttribute(t,e){var n,r,i=!(0===(n=t).length||40<n.length)&&(!Ct.some(t=>n.startsWith(t))&&!!n.match(Ot)),a=0!==(r=e).length&&r.length<=100;if(i&&a)this.customAttributes[t]=e;else{if(!i)throw wt.create("invalid attribute name",{attributeName:t});if(!a)throw wt.create("invalid attribute value",{attributeValue:e})}}getAttribute(t){return this.customAttributes[t]}removeAttribute(t){void 0!==this.customAttributes[t]&&delete this.customAttributes[t]}getAttributes(){return Object.assign({},this.customAttributes)}setStartTime(t){this.startTimeUs=t}setDuration(t){this.durationUs=t}calculateTraceMetrics(){var t=this.api.getEntriesByName(this.traceMeasure),t=t&&t[0];t&&(this.durationUs=Math.floor(1e3*t.duration),this.startTimeUs=Math.floor(1e3*(t.startTime+this.api.getTimeOrigin())))}static createOobTrace(t,e,n,r){var i=Tt.getInstance().getUrl();if(i){const a=new ae(t,"_wt_"+i,!0);i=Math.floor(1e3*Tt.getInstance().getTimeOrigin());a.setStartTime(i),e&&e[0]&&(a.setDuration(Math.floor(1e3*e[0].duration)),a.putMetric("domInteractive",Math.floor(1e3*e[0].domInteractive)),a.putMetric("domContentLoadedEventEnd",Math.floor(1e3*e[0].domContentLoadedEventEnd)),a.putMetric("loadEventEnd",Math.floor(1e3*e[0].loadEventEnd)));n&&((i=n.find(t=>"first-paint"===t.name))&&i.startTime&&a.putMetric("_fp",Math.floor(1e3*i.startTime)),(i=n.find(t=>"first-contentful-paint"===t.name))&&i.startTime&&a.putMetric("_fcp",Math.floor(1e3*i.startTime)),r&&a.putMetric("_fid",Math.floor(1e3*r))),te(a)}}static createUserTimingTrace(t,e){te(new ae(t,e,!1,e))}}function oe(t,e){const n=e;var r,i,a;n&&void 0!==n.responseStart&&(a=Tt.getInstance().getTimeOrigin(),r=Math.floor(1e3*(n.startTime+a)),i=n.responseStart?Math.floor(1e3*(n.responseStart-n.startTime)):void 0,a=Math.floor(1e3*(n.responseEnd-n.startTime)),function(t){const e=At.getInstance();var n,r,i;e.instrumentationEnabled&&(n=t.url,r=e.logEndPointUrl.split("?")[0],i=e.flTransportEndpointUrl.split("?")[0],n!==r&&n!==i&&e.loggingEnabled&&e.logNetworkAfterSampling&&setTimeout(()=>Xt(t,0),0))}({performanceController:t,url:n.name&&n.name.split("?")[0],responsePayloadBytes:n.transferSize,startTimeUs:r,timeToResponseInitiatedUs:i,timeToResponseCompletedUs:a}))}const se=5e3;function ce(t){St&&(setTimeout(()=>function(n){const t=Tt.getInstance(),r=t.getEntriesByType("navigation"),i=t.getEntriesByType("paint");if(t.onFirstInputDelay){let e=setTimeout(()=>{ae.createOobTrace(n,r,i),e=void 0},se);t.onFirstInputDelay(t=>{e&&(clearTimeout(e),ae.createOobTrace(n,r,i,t))})}else ae.createOobTrace(n,r,i)}(t),0),setTimeout(()=>function(e){const t=Tt.getInstance(),n=t.getEntriesByType("resource");for(const r of n)oe(e,r);t.setupObserver("resource",t=>oe(e,t))}(t),0),setTimeout(()=>function(e){const t=Tt.getInstance(),n=t.getEntriesByType("measure");for(const r of n)ue(e,r);t.setupObserver("measure",t=>ue(e,t))}(t),0))}function ue(t,e){const n=e.name;n.substring(0,gt.length)!==gt&&ae.createUserTimingTrace(t,n)}class le{constructor(t,e){this.app=t,this.installations=e,this.initialized=!1}_init(t){this.initialized||(void 0!==(null==t?void 0:t.dataCollectionEnabled)&&(this.dataCollectionEnabled=t.dataCollectionEnabled),void 0!==(null==t?void 0:t.instrumentationEnabled)&&(this.instrumentationEnabled=t.instrumentationEnabled),Tt.getInstance().requiredApisAvailable()?new Promise((e,n)=>{try{let t=!0;const r="validate-browser-context-for-indexeddb-analytics-module",i=self.indexedDB.open(r);i.onsuccess=()=>{i.result.close(),t||self.indexedDB.deleteDatabase(r),e(!0)},i.onupgradeneeded=()=>{t=!1},i.onerror=()=>{var t;n((null===(t=i.error)||void 0===t?void 0:t.message)||"")}}catch(t){n(t)}}).then(t=>{t&&(Jt||(Yt(5500),Jt=!0),Ft(this).then(()=>ce(this),()=>ce(this)),this.initialized=!0)}).catch(t=>{yt.info(`Environment doesn't support IndexedDB: ${t}`)}):yt.info('Firebase Performance cannot start if the browser does not support "Fetch" and "Promise", or cookies are disabled.'))}set instrumentationEnabled(t){At.getInstance().instrumentationEnabled=t}get instrumentationEnabled(){return At.getInstance().instrumentationEnabled}set dataCollectionEnabled(t){At.getInstance().dataCollectionEnabled=t}get dataCollectionEnabled(){return At.getInstance().dataCollectionEnabled}}const pe="[DEFAULT]";const fe=(t,{options:e})=>{var n=t.getProvider("app").getImmediate(),r=t.getProvider("installations-internal").getImmediate();if(n.name!==pe)throw wt.create("FB not default");if("undefined"==typeof window)throw wt.create("no window");t=window,It=t;const i=new le(n,r);return i._init(e),i};me._registerComponent(new i("performance",fe,"PUBLIC")),me.registerVersion(pt,ft),me.registerVersion(pt,ft,"esm2017");class de{constructor(t,e){this.app=t,this._delegate=e}get instrumentationEnabled(){return this._delegate.instrumentationEnabled}set instrumentationEnabled(t){this._delegate.instrumentationEnabled=t}get dataCollectionEnabled(){return this._delegate.dataCollectionEnabled}set dataCollectionEnabled(t){this._delegate.dataCollectionEnabled=t}trace(t){return e=this._delegate,n=t,e=(t=e)&&t._delegate?t._delegate:t,new ae(e,n);var e,n}}function ge(t){var e=t.getProvider("app-compat").getImmediate(),n=t.getProvider("performance").getImmediate();return new de(e,n)}(_t=n.default).INTERNAL.registerComponent(new i("performance-compat",ge,"PUBLIC")),_t.registerVersion("@firebase/performance-compat","0.1.5-canary.88d43ec00")}).apply(this,arguments)}catch(t){throw console.error(t),new Error("Cannot instantiate firebase-performance-compat.js - be sure to load firebase-app.js first.")}});
2
2
  //# sourceMappingURL=firebase-performance-compat.js.map
@@ -144,7 +144,7 @@ class t{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Pr
144
144
  * See the License for the specific language governing permissions and
145
145
  * limitations under the License.
146
146
  */
147
- class y{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map((e=>{if(function(e){const t=e.getComponent();return"VERSION"===(null==t?void 0:t.type)}(e)){const t=e.getImmediate();return`${t.library}/${t.version}`}return null})).filter((e=>e)).join(" ")}}const _="@firebase/app",w="0.7.12-canary.044a8d7f9",I=new v("@firebase/app"),E="[DEFAULT]",T={[_]:"fire-core","@firebase/app-compat":"fire-core-compat","@firebase/analytics":"fire-analytics","@firebase/analytics-compat":"fire-analytics-compat","@firebase/app-check":"fire-app-check","@firebase/app-check-compat":"fire-app-check-compat","@firebase/auth":"fire-auth","@firebase/auth-compat":"fire-auth-compat","@firebase/database":"fire-rtdb","@firebase/database-compat":"fire-rtdb-compat","@firebase/functions":"fire-fn","@firebase/functions-compat":"fire-fn-compat","@firebase/installations":"fire-iid","@firebase/installations-compat":"fire-iid-compat","@firebase/messaging":"fire-fcm","@firebase/messaging-compat":"fire-fcm-compat","@firebase/performance":"fire-perf","@firebase/performance-compat":"fire-perf-compat","@firebase/remote-config":"fire-rc","@firebase/remote-config-compat":"fire-rc-compat","@firebase/storage":"fire-gcs","@firebase/storage-compat":"fire-gcs-compat","@firebase/firestore":"fire-fst","@firebase/firestore-compat":"fire-fst-compat","fire-js":"fire-js",firebase:"fire-js-all"},S=new Map,A=new Map;function C(e,t){try{e.container.addComponent(t)}catch(n){I.debug(`Component ${t.name} failed to register with FirebaseApp ${e.name}`,n)}}function N(e){const t=e.name;if(A.has(t))return I.debug(`There were multiple attempts to register component ${t}.`),!1;A.set(t,e);for(const t of S.values())C(t,e);return!0}function O(e,t){return e.container.getProvider(t)}
147
+ class y{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map((e=>{if(function(e){const t=e.getComponent();return"VERSION"===(null==t?void 0:t.type)}(e)){const t=e.getImmediate();return`${t.library}/${t.version}`}return null})).filter((e=>e)).join(" ")}}const _="@firebase/app",w="0.7.12-canary.88d43ec00",I=new v("@firebase/app"),E="[DEFAULT]",T={[_]:"fire-core","@firebase/app-compat":"fire-core-compat","@firebase/analytics":"fire-analytics","@firebase/analytics-compat":"fire-analytics-compat","@firebase/app-check":"fire-app-check","@firebase/app-check-compat":"fire-app-check-compat","@firebase/auth":"fire-auth","@firebase/auth-compat":"fire-auth-compat","@firebase/database":"fire-rtdb","@firebase/database-compat":"fire-rtdb-compat","@firebase/functions":"fire-fn","@firebase/functions-compat":"fire-fn-compat","@firebase/installations":"fire-iid","@firebase/installations-compat":"fire-iid-compat","@firebase/messaging":"fire-fcm","@firebase/messaging-compat":"fire-fcm-compat","@firebase/performance":"fire-perf","@firebase/performance-compat":"fire-perf-compat","@firebase/remote-config":"fire-rc","@firebase/remote-config-compat":"fire-rc-compat","@firebase/storage":"fire-gcs","@firebase/storage-compat":"fire-gcs-compat","@firebase/firestore":"fire-fst","@firebase/firestore-compat":"fire-fst-compat","fire-js":"fire-js",firebase:"fire-js-all"},S=new Map,A=new Map;function C(e,t){try{e.container.addComponent(t)}catch(n){I.debug(`Component ${t.name} failed to register with FirebaseApp ${e.name}`,n)}}function N(e){const t=e.name;if(A.has(t))return I.debug(`There were multiple attempts to register component ${t}.`),!1;A.set(t,e);for(const t of S.values())C(t,e);return!0}function O(e,t){return e.container.getProvider(t)}
148
148
  /**
149
149
  * @license
150
150
  * Copyright 2019 Google LLC
@@ -194,7 +194,7 @@ class D{constructor(e,t,n){this._isDeleted=!1,this._options=Object.assign({},e),
194
194
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
195
195
  * See the License for the specific language governing permissions and
196
196
  * limitations under the License.
197
- */const P="9.6.2-canary.044a8d7f9";function L(e,t={}){if("object"!=typeof t){t={name:t}}const n=Object.assign({name:E,automaticDataCollectionEnabled:!1},t),r=n.name;if("string"!=typeof r||!r)throw k.create("bad-app-name",{appName:String(r)});const i=S.get(r);if(i){if(a(e,i.options)&&a(n,i.config))return i;throw k.create("duplicate-app",{appName:r})}const o=new p(r);for(const e of A.values())o.addComponent(e);const s=new D(e,n,o);return S.set(r,s),s}async function R(e){const t=e.name;S.has(t)&&(S.delete(t),await Promise.all(e.container.getProviders().map((e=>e.delete()))),e.isDeleted=!0)}function j(e,t,n){var r;let i=null!==(r=T[e])&&void 0!==r?r:e;n&&(i+=`-${n}`);const o=i.match(/\s|\//),a=t.match(/\s|\//);if(o||a){const e=[`Unable to register library "${i}" with version "${t}":`];return o&&e.push(`library name "${i}" contains illegal characters (whitespace or "/")`),o&&a&&e.push("and"),a&&e.push(`version name "${t}" contains illegal characters (whitespace or "/")`),void I.warn(e.join(" "))}N(new c(`${i}-version`,(()=>({library:i,version:t})),"VERSION"))}function M(e,t){if(null!==e&&"function"!=typeof e)throw k.create("invalid-log-argument");!function(e,t){for(const n of f){let r=null;t&&t.level&&(r=h[t.level]),n.userLogHandler=null===e?null:(t,n,...i)=>{const o=i.map((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((e=>e)).join(" ");n>=(null!=r?r:t.logLevel)&&e({level:d[n].toLowerCase(),message:o,args:i,type:t.name})}}}(e,t)}function $(e){var t;t=e,f.forEach((e=>{e.setLogLevel(t)}))}
197
+ */const P="9.6.2-canary.88d43ec00";function L(e,t={}){if("object"!=typeof t){t={name:t}}const n=Object.assign({name:E,automaticDataCollectionEnabled:!1},t),r=n.name;if("string"!=typeof r||!r)throw k.create("bad-app-name",{appName:String(r)});const i=S.get(r);if(i){if(a(e,i.options)&&a(n,i.config))return i;throw k.create("duplicate-app",{appName:r})}const o=new p(r);for(const e of A.values())o.addComponent(e);const s=new D(e,n,o);return S.set(r,s),s}async function R(e){const t=e.name;S.has(t)&&(S.delete(t),await Promise.all(e.container.getProviders().map((e=>e.delete()))),e.isDeleted=!0)}function j(e,t,n){var r;let i=null!==(r=T[e])&&void 0!==r?r:e;n&&(i+=`-${n}`);const o=i.match(/\s|\//),a=t.match(/\s|\//);if(o||a){const e=[`Unable to register library "${i}" with version "${t}":`];return o&&e.push(`library name "${i}" contains illegal characters (whitespace or "/")`),o&&a&&e.push("and"),a&&e.push(`version name "${t}" contains illegal characters (whitespace or "/")`),void I.warn(e.join(" "))}N(new c(`${i}-version`,(()=>({library:i,version:t})),"VERSION"))}function M(e,t){if(null!==e&&"function"!=typeof e)throw k.create("invalid-log-argument");!function(e,t){for(const n of f){let r=null;t&&t.level&&(r=h[t.level]),n.userLogHandler=null===e?null:(t,n,...i)=>{const o=i.map((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((e=>e)).join(" ");n>=(null!=r?r:t.logLevel)&&e({level:d[n].toLowerCase(),message:o,args:i,type:t.name})}}}(e,t)}function $(e){var t;t=e,f.forEach((e=>{e.setLogLevel(t)}))}
198
198
  /**
199
199
  * @license
200
200
  * Copyright 2019 Google LLC
@@ -309,7 +309,7 @@ const z=function(){const e=q(U);e.SDK_VERSION=`${e.SDK_VERSION}_LITE`;const t=e.
309
309
  * See the License for the specific language governing permissions and
310
310
  * limitations under the License.
311
311
  */
312
- function(e){j("@firebase/app-compat","0.1.13-canary.044a8d7f9",e)}("lite");function V(e){return Array.prototype.slice.call(e)}function H(e){return new Promise((function(t,n){e.onsuccess=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function K(e,t,n){var r,i=new Promise((function(i,o){H(r=e[t].apply(e,n)).then(i,o)}));return i.request=r,i}function W(e,t,n){var r=K(e,t,n);return r.then((function(e){if(e)return new Q(e,r.request)}))}function G(e,t,n){n.forEach((function(n){Object.defineProperty(e.prototype,n,{get:function(){return this[t][n]},set:function(e){this[t][n]=e}})}))}function J(e,t,n,r){r.forEach((function(r){r in n.prototype&&(e.prototype[r]=function(){return K(this[t],r,arguments)})}))}function Y(e,t,n,r){r.forEach((function(r){r in n.prototype&&(e.prototype[r]=function(){return this[t][r].apply(this[t],arguments)})}))}function X(e,t,n,r){r.forEach((function(r){r in n.prototype&&(e.prototype[r]=function(){return W(this[t],r,arguments)})}))}function Z(e){this._index=e}function Q(e,t){this._cursor=e,this._request=t}function ee(e){this._store=e}function te(e){this._tx=e,this.complete=new Promise((function(t,n){e.oncomplete=function(){t()},e.onerror=function(){n(e.error)},e.onabort=function(){n(e.error)}}))}function ne(e,t,n){this._db=e,this.oldVersion=t,this.transaction=new te(n)}function re(e){this._db=e}
312
+ function(e){j("@firebase/app-compat","0.1.13-canary.88d43ec00",e)}("lite");function V(e){return Array.prototype.slice.call(e)}function H(e){return new Promise((function(t,n){e.onsuccess=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function K(e,t,n){var r,i=new Promise((function(i,o){H(r=e[t].apply(e,n)).then(i,o)}));return i.request=r,i}function W(e,t,n){var r=K(e,t,n);return r.then((function(e){if(e)return new Q(e,r.request)}))}function G(e,t,n){n.forEach((function(n){Object.defineProperty(e.prototype,n,{get:function(){return this[t][n]},set:function(e){this[t][n]=e}})}))}function J(e,t,n,r){r.forEach((function(r){r in n.prototype&&(e.prototype[r]=function(){return K(this[t],r,arguments)})}))}function Y(e,t,n,r){r.forEach((function(r){r in n.prototype&&(e.prototype[r]=function(){return this[t][r].apply(this[t],arguments)})}))}function X(e,t,n,r){r.forEach((function(r){r in n.prototype&&(e.prototype[r]=function(){return W(this[t],r,arguments)})}))}function Z(e){this._index=e}function Q(e,t){this._cursor=e,this._request=t}function ee(e){this._store=e}function te(e){this._tx=e,this.complete=new Promise((function(t,n){e.oncomplete=function(){t()},e.onerror=function(){n(e.error)},e.onabort=function(){n(e.error)}}))}function ne(e,t,n){this._db=e,this.oldVersion=t,this.transaction=new te(n)}function re(e){this._db=e}
313
313
  /**
314
314
  * @license
315
315
  * Copyright 2020 Google LLC
@@ -326,7 +326,7 @@ function(e){j("@firebase/app-compat","0.1.13-canary.044a8d7f9",e)}("lite");funct
326
326
  * See the License for the specific language governing permissions and
327
327
  * limitations under the License.
328
328
  */
329
- z.registerVersion("firebase","9.6.2-canary.044a8d7f9","app-compat"),G(Z,"_index",["name","keyPath","multiEntry","unique"]),J(Z,"_index",IDBIndex,["get","getKey","getAll","getAllKeys","count"]),X(Z,"_index",IDBIndex,["openCursor","openKeyCursor"]),G(Q,"_cursor",["direction","key","primaryKey","value"]),J(Q,"_cursor",IDBCursor,["update","delete"]),["advance","continue","continuePrimaryKey"].forEach((function(e){e in IDBCursor.prototype&&(Q.prototype[e]=function(){var t=this,n=arguments;return Promise.resolve().then((function(){return t._cursor[e].apply(t._cursor,n),H(t._request).then((function(e){if(e)return new Q(e,t._request)}))}))})})),ee.prototype.createIndex=function(){return new Z(this._store.createIndex.apply(this._store,arguments))},ee.prototype.index=function(){return new Z(this._store.index.apply(this._store,arguments))},G(ee,"_store",["name","keyPath","indexNames","autoIncrement"]),J(ee,"_store",IDBObjectStore,["put","add","delete","clear","get","getAll","getKey","getAllKeys","count"]),X(ee,"_store",IDBObjectStore,["openCursor","openKeyCursor"]),Y(ee,"_store",IDBObjectStore,["deleteIndex"]),te.prototype.objectStore=function(){return new ee(this._tx.objectStore.apply(this._tx,arguments))},G(te,"_tx",["objectStoreNames","mode"]),Y(te,"_tx",IDBTransaction,["abort"]),ne.prototype.createObjectStore=function(){return new ee(this._db.createObjectStore.apply(this._db,arguments))},G(ne,"_db",["name","version","objectStoreNames"]),Y(ne,"_db",IDBDatabase,["deleteObjectStore","close"]),re.prototype.transaction=function(){return new te(this._db.transaction.apply(this._db,arguments))},G(re,"_db",["name","version","objectStoreNames"]),Y(re,"_db",IDBDatabase,["close"]),["openCursor","openKeyCursor"].forEach((function(e){[ee,Z].forEach((function(t){e in t.prototype&&(t.prototype[e.replace("open","iterate")]=function(){var t=V(arguments),n=t[t.length-1],r=this._store||this._index,i=r[e].apply(r,t.slice(0,-1));i.onsuccess=function(){n(i.result)}})}))})),[Z,ee].forEach((function(e){e.prototype.getAll||(e.prototype.getAll=function(e,t){var n=this,r=[];return new Promise((function(i){n.iterateCursor(e,(function(e){e?(r.push(e.value),void 0===t||r.length!=t?e.continue():i(r)):i(r)}))}))})}));const ie="@firebase/installations",oe="0.5.5-canary.044a8d7f9",ae=1e4,se=`w:${oe}`,ce="FIS_v2",le=36e5,ue=new r("installations","Installations",{"missing-app-config-values":'Missing App configuration value: "{$valueName}"',"not-registered":"Firebase Installation is not registered.","installation-not-found":"Firebase Installation not found.","request-failed":'{$requestName} request failed with error "{$serverCode} {$serverStatus}: {$serverMessage}"',"app-offline":"Could not process request. Application offline.","delete-pending-registration":"Can't delete installation while there is a pending registration request."});function pe(e){return e instanceof n&&e.code.includes("request-failed")}
329
+ z.registerVersion("firebase","9.6.2-canary.88d43ec00","app-compat"),G(Z,"_index",["name","keyPath","multiEntry","unique"]),J(Z,"_index",IDBIndex,["get","getKey","getAll","getAllKeys","count"]),X(Z,"_index",IDBIndex,["openCursor","openKeyCursor"]),G(Q,"_cursor",["direction","key","primaryKey","value"]),J(Q,"_cursor",IDBCursor,["update","delete"]),["advance","continue","continuePrimaryKey"].forEach((function(e){e in IDBCursor.prototype&&(Q.prototype[e]=function(){var t=this,n=arguments;return Promise.resolve().then((function(){return t._cursor[e].apply(t._cursor,n),H(t._request).then((function(e){if(e)return new Q(e,t._request)}))}))})})),ee.prototype.createIndex=function(){return new Z(this._store.createIndex.apply(this._store,arguments))},ee.prototype.index=function(){return new Z(this._store.index.apply(this._store,arguments))},G(ee,"_store",["name","keyPath","indexNames","autoIncrement"]),J(ee,"_store",IDBObjectStore,["put","add","delete","clear","get","getAll","getKey","getAllKeys","count"]),X(ee,"_store",IDBObjectStore,["openCursor","openKeyCursor"]),Y(ee,"_store",IDBObjectStore,["deleteIndex"]),te.prototype.objectStore=function(){return new ee(this._tx.objectStore.apply(this._tx,arguments))},G(te,"_tx",["objectStoreNames","mode"]),Y(te,"_tx",IDBTransaction,["abort"]),ne.prototype.createObjectStore=function(){return new ee(this._db.createObjectStore.apply(this._db,arguments))},G(ne,"_db",["name","version","objectStoreNames"]),Y(ne,"_db",IDBDatabase,["deleteObjectStore","close"]),re.prototype.transaction=function(){return new te(this._db.transaction.apply(this._db,arguments))},G(re,"_db",["name","version","objectStoreNames"]),Y(re,"_db",IDBDatabase,["close"]),["openCursor","openKeyCursor"].forEach((function(e){[ee,Z].forEach((function(t){e in t.prototype&&(t.prototype[e.replace("open","iterate")]=function(){var t=V(arguments),n=t[t.length-1],r=this._store||this._index,i=r[e].apply(r,t.slice(0,-1));i.onsuccess=function(){n(i.result)}})}))})),[Z,ee].forEach((function(e){e.prototype.getAll||(e.prototype.getAll=function(e,t){var n=this,r=[];return new Promise((function(i){n.iterateCursor(e,(function(e){e?(r.push(e.value),void 0===t||r.length!=t?e.continue():i(r)):i(r)}))}))})}));const ie="@firebase/installations",oe="0.5.5-canary.88d43ec00",ae=1e4,se=`w:${oe}`,ce="FIS_v2",le=36e5,ue=new r("installations","Installations",{"missing-app-config-values":'Missing App configuration value: "{$valueName}"',"not-registered":"Firebase Installation is not registered.","installation-not-found":"Firebase Installation not found.","request-failed":'{$requestName} request failed with error "{$serverCode} {$serverStatus}: {$serverMessage}"',"app-offline":"Could not process request. Application offline.","delete-pending-registration":"Can't delete installation while there is a pending registration request."});function pe(e){return e instanceof n&&e.code.includes("request-failed")}
330
330
  /**
331
331
  * @license
332
332
  * Copyright 2019 Google LLC
@@ -570,7 +570,7 @@ async function Ue(e,t=!1){const n=e;await async function(e){const{registrationPr
570
570
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
571
571
  * See the License for the specific language governing permissions and
572
572
  * limitations under the License.
573
- */const qe="installations",ze=e=>{const t=O(e.getProvider("app").getImmediate(),qe).getImmediate();return{getId:()=>async function(e){const t=e,{installationEntry:n,registrationPromise:r}=await Pe(t.appConfig);return r?r.catch(console.error):$e(t).catch(console.error),n.fid}(t),getToken:e=>Ue(t,e)}};N(new c(qe,(e=>{const t=e.getProvider("app").getImmediate(),n=function(e){if(!e||!e.options)throw xe("App Configuration");if(!e.name)throw xe("App Name");const t=["projectId","apiKey","appId"];for(const n of t)if(!e.options[n])throw xe(n);return{appName:e.name,projectId:e.options.projectId,apiKey:e.options.apiKey,appId:e.options.appId}}(t);return{app:t,appConfig:n,platformLoggerProvider:O(t,"platform-logger"),_delete:()=>Promise.resolve()}}),"PUBLIC")),N(new c("installations-internal",ze,"PRIVATE")),j(ie,oe),j(ie,oe,"esm2017");const Ve="@firebase/performance",He="0.5.5-canary.044a8d7f9",Ke=He,We="FB-PERF-TRACE-MEASURE",Ge="_wt_",Je="_fcp",Ye="_fid",Xe="@firebase/performance/config",Ze="@firebase/performance/configexpire",Qe="Performance",et=new r("performance",Qe,{"trace started":"Trace {$traceName} was started before.","trace stopped":"Trace {$traceName} is not running.","nonpositive trace startTime":"Trace {$traceName} startTime should be positive.","nonpositive trace duration":"Trace {$traceName} duration should be positive.","no window":"Window is not available.","no app id":"App id is not available.","no project id":"Project id is not available.","no api key":"Api key is not available.","invalid cc log":"Attempted to queue invalid cc event","FB not default":"Performance can only start when Firebase app instance is the default one.","RC response not ok":"RC response is not ok","invalid attribute name":"Attribute name {$attributeName} is invalid.","invalid attribute value":"Attribute value {$attributeValue} is invalid.","invalid custom metric name":"Custom metric name {$customMetricName} is invalid","invalid String merger input":"Input for String merger is invalid, contact support team to resolve.","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."}),tt=new v(Qe);
573
+ */const qe="installations",ze=e=>{const t=O(e.getProvider("app").getImmediate(),qe).getImmediate();return{getId:()=>async function(e){const t=e,{installationEntry:n,registrationPromise:r}=await Pe(t.appConfig);return r?r.catch(console.error):$e(t).catch(console.error),n.fid}(t),getToken:e=>Ue(t,e)}};N(new c(qe,(e=>{const t=e.getProvider("app").getImmediate(),n=function(e){if(!e||!e.options)throw xe("App Configuration");if(!e.name)throw xe("App Name");const t=["projectId","apiKey","appId"];for(const n of t)if(!e.options[n])throw xe(n);return{appName:e.name,projectId:e.options.projectId,apiKey:e.options.apiKey,appId:e.options.appId}}(t);return{app:t,appConfig:n,platformLoggerProvider:O(t,"platform-logger"),_delete:()=>Promise.resolve()}}),"PUBLIC")),N(new c("installations-internal",ze,"PRIVATE")),j(ie,oe),j(ie,oe,"esm2017");const Ve="@firebase/performance",He="0.5.5-canary.88d43ec00",Ke=He,We="FB-PERF-TRACE-MEASURE",Ge="_wt_",Je="_fcp",Ye="_fid",Xe="@firebase/performance/config",Ze="@firebase/performance/configexpire",Qe="Performance",et=new r("performance",Qe,{"trace started":"Trace {$traceName} was started before.","trace stopped":"Trace {$traceName} is not running.","nonpositive trace startTime":"Trace {$traceName} startTime should be positive.","nonpositive trace duration":"Trace {$traceName} duration should be positive.","no window":"Window is not available.","no app id":"App id is not available.","no project id":"Project id is not available.","no api key":"Api key is not available.","invalid cc log":"Attempted to queue invalid cc event","FB not default":"Performance can only start when Firebase app instance is the default one.","RC response not ok":"RC response is not ok","invalid attribute name":"Attribute name {$attributeName} is invalid.","invalid attribute value":"Attribute value {$attributeValue} is invalid.","invalid custom metric name":"Custom metric name {$customMetricName} is invalid","invalid String merger input":"Input for String merger is invalid, contact support team to resolve.","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."}),tt=new v(Qe);
574
574
  /**
575
575
  * @license
576
576
  * Copyright 2020 Google LLC
@@ -849,7 +849,7 @@ class Kt{constructor(e,t){this.app=e,this._delegate=t}get instrumentationEnabled
849
849
  * See the License for the specific language governing permissions and
850
850
  * limitations under the License.
851
851
  */
852
- var Gt;(Gt=z).INTERNAL.registerComponent(new c("performance-compat",Wt,"PUBLIC")),Gt.registerVersion("@firebase/performance-compat","0.1.5-canary.044a8d7f9");
852
+ var Gt;(Gt=z).INTERNAL.registerComponent(new c("performance-compat",Wt,"PUBLIC")),Gt.registerVersion("@firebase/performance-compat","0.1.5-canary.88d43ec00");
853
853
  /**
854
854
  * @license
855
855
  * Copyright 2019 Google LLC
@@ -866,5 +866,5 @@ var Gt;(Gt=z).INTERNAL.registerComponent(new c("performance-compat",Wt,"PUBLIC")
866
866
  * See the License for the specific language governing permissions and
867
867
  * limitations under the License.
868
868
  */
869
- return z.registerVersion("firebase","9.6.2-canary.044a8d7f9","compat-lite"),z}));
869
+ return z.registerVersion("firebase","9.6.2-canary.88d43ec00","compat-lite"),z}));
870
870
  //# sourceMappingURL=firebase-performance-standalone-compat.es2017.js.map
@@ -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-canary.044a8d7f9",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-canary.044a8d7f9";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-canary.044a8d7f9",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-canary.044a8d7f9","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-canary.044a8d7f9",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-canary.044a8d7f9",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-canary.044a8d7f9");return me.registerVersion("firebase","9.6.2-canary.044a8d7f9","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.12-canary.88d43ec00",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-canary.88d43ec00";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-canary.88d43ec00",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-canary.88d43ec00","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-canary.88d43ec00",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-canary.88d43ec00",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-canary.88d43ec00");return me.registerVersion("firebase","9.6.2-canary.88d43ec00","compat-lite"),me});
2
2
  //# sourceMappingURL=firebase-performance-standalone-compat.js.map