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.
- package/app/dist/index.cjs.js +1 -1
- package/app/dist/index.esm.js +1 -1
- package/app/dist/index.mjs +1 -1
- package/compat/app/dist/index.cjs.js +1 -1
- package/compat/app/dist/index.esm.js +1 -1
- package/compat/app/dist/index.mjs +1 -1
- package/compat/dist/index.esm.js +2 -2
- package/compat/dist/index.node.cjs +2 -2
- package/compat/dist/index.rn.cjs.js +2 -2
- package/firebase-analytics-compat.js +1 -1
- package/firebase-analytics.js +5 -5
- package/firebase-app-check-compat.js +1 -1
- package/firebase-app-check.js +5 -5
- package/firebase-app-compat.js +2 -2
- package/firebase-app.js +9 -9
- package/firebase-auth-compat.js +1 -1
- package/firebase-auth.js +3 -3
- package/firebase-compat.js +4 -4
- package/firebase-compat.js.map +1 -1
- package/firebase-database-compat.js +1 -1
- package/firebase-database.js +5 -5
- package/firebase-firestore-compat.js +1 -1
- package/firebase-firestore-compat.js.map +1 -1
- package/firebase-firestore-lite.js +129 -129
- package/firebase-firestore-lite.js.map +1 -1
- package/firebase-firestore.js +874 -874
- package/firebase-firestore.js.map +1 -1
- package/firebase-functions-compat.js +1 -1
- package/firebase-functions.js +3 -3
- package/firebase-messaging-compat.js +1 -1
- package/firebase-messaging-compat.js.map +1 -1
- package/firebase-messaging-sw.js +5 -5
- package/firebase-messaging-sw.js.map +1 -1
- package/firebase-messaging.js +4 -4
- package/firebase-messaging.js.map +1 -1
- package/firebase-performance-compat.js +1 -1
- package/firebase-performance-standalone-compat.es2017.js +7 -7
- package/firebase-performance-standalone-compat.js +1 -1
- package/firebase-performance.js +5 -5
- package/firebase-remote-config-compat.js +1 -1
- package/firebase-remote-config.js +4 -4
- package/firebase-storage-compat.js +1 -1
- package/firebase-storage.js +2 -2
- package/package.json +26 -26
package/app/dist/index.cjs.js
CHANGED
package/app/dist/index.esm.js
CHANGED
package/app/dist/index.mjs
CHANGED
|
@@ -7,7 +7,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
7
7
|
var firebase__default = /*#__PURE__*/_interopDefaultLegacy(firebase);
|
|
8
8
|
|
|
9
9
|
var name = "firebase";
|
|
10
|
-
var version = "9.6.2-canary.
|
|
10
|
+
var version = "9.6.2-canary.88d43ec00";
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* @license
|
package/compat/dist/index.esm.js
CHANGED
|
@@ -12,7 +12,7 @@ import '@firebase/performance-compat';
|
|
|
12
12
|
import '@firebase/remote-config-compat';
|
|
13
13
|
|
|
14
14
|
var name$1 = "firebase";
|
|
15
|
-
var version$1 = "9.6.2-canary.
|
|
15
|
+
var version$1 = "9.6.2-canary.88d43ec00";
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* @license
|
|
@@ -33,7 +33,7 @@ var version$1 = "9.6.2-canary.044a8d7f9";
|
|
|
33
33
|
firebase.registerVersion(name$1, version$1, 'app-compat');
|
|
34
34
|
|
|
35
35
|
var name = "firebase";
|
|
36
|
-
var version = "9.6.2-canary.
|
|
36
|
+
var version = "9.6.2-canary.88d43ec00";
|
|
37
37
|
|
|
38
38
|
/**
|
|
39
39
|
* @license
|
|
@@ -12,7 +12,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
12
12
|
var firebase__default = /*#__PURE__*/_interopDefaultLegacy(firebase);
|
|
13
13
|
|
|
14
14
|
var name$1 = "firebase";
|
|
15
|
-
var version$1 = "9.6.2-canary.
|
|
15
|
+
var version$1 = "9.6.2-canary.88d43ec00";
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* @license
|
|
@@ -33,7 +33,7 @@ var version$1 = "9.6.2-canary.044a8d7f9";
|
|
|
33
33
|
firebase__default["default"].registerVersion(name$1, version$1, 'app-compat');
|
|
34
34
|
|
|
35
35
|
var name = "firebase";
|
|
36
|
-
var version = "9.6.2-canary.
|
|
36
|
+
var version = "9.6.2-canary.88d43ec00";
|
|
37
37
|
|
|
38
38
|
/**
|
|
39
39
|
* @license
|
|
@@ -10,7 +10,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
10
10
|
var firebase__default = /*#__PURE__*/_interopDefaultLegacy(firebase);
|
|
11
11
|
|
|
12
12
|
var name$1 = "firebase";
|
|
13
|
-
var version$1 = "9.6.2-canary.
|
|
13
|
+
var version$1 = "9.6.2-canary.88d43ec00";
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* @license
|
|
@@ -31,7 +31,7 @@ var version$1 = "9.6.2-canary.044a8d7f9";
|
|
|
31
31
|
firebase__default["default"].registerVersion(name$1, version$1, 'app-compat');
|
|
32
32
|
|
|
33
33
|
var name = "firebase";
|
|
34
|
-
var version = "9.6.2-canary.
|
|
34
|
+
var version = "9.6.2-canary.88d43ec00";
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
37
|
* @license
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("@firebase/app-compat"),require("@firebase/app")):"function"==typeof define&&define.amd?define(["@firebase/app-compat","@firebase/app"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).firebase,e.firebase.INTERNAL.modularAPIs)}(this,function(ct,ut){"use strict";try{!(function(){function e(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t,n=e(ct);(at=t=t||{})[at.DEBUG=0]="DEBUG",at[at.VERBOSE=1]="VERBOSE",at[at.INFO=2]="INFO",at[at.WARN=3]="WARN",at[at.ERROR=4]="ERROR",at[at.SILENT=5]="SILENT";const r={debug:t.DEBUG,verbose:t.VERBOSE,info:t.INFO,warn:t.WARN,error:t.ERROR,silent:t.SILENT},a=t.INFO,i={[t.DEBUG]:"log",[t.VERBOSE]:"log",[t.INFO]:"info",[t.WARN]:"warn",[t.ERROR]:"error"},o=(e,t,...n)=>{if(!(t<e.logLevel)){var r=(new Date).toISOString(),a=i[t];if(!a)throw new Error(`Attempted to log a message with an invalid logType (value: ${t})`);console[a](`[${r}] ${e.name}:`,...n)}};function s(){var e="object"==typeof chrome?chrome.runtime:"object"==typeof browser?browser.runtime:void 0;return"object"==typeof e&&void 0!==e.id}function p(){return"object"==typeof indexedDB}function f(){return new Promise((t,n)=>{try{let e=!0;const r="validate-browser-context-for-indexeddb-analytics-module",a=self.indexedDB.open(r);a.onsuccess=()=>{a.result.close(),e||self.indexedDB.deleteDatabase(r),t(!0)},a.onupgradeneeded=()=>{e=!1},a.onerror=()=>{var e;n((null===(e=a.error)||void 0===e?void 0:e.message)||"")}}catch(e){n(e)}})}function c(){return!("undefined"==typeof navigator||!navigator.cookieEnabled)}class u extends Error{constructor(e,t,n){super(t),this.code=e,this.customData=n,this.name="FirebaseError",Object.setPrototypeOf(this,u.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,l.prototype.create)}}class l{constructor(e,t,n){this.service=e,this.serviceName=t,this.errors=n}create(e,...t){var r,n=t[0]||{},a=`${this.service}/${e}`,i=this.errors[e],i=i?(r=n,i.replace(d,(e,t)=>{var n=r[t];return null!=n?String(n):`<${t}?>`})):"Error",i=`${this.serviceName}: ${i} (${a}).`;return new u(a,i,n)}}const d=/\{\$([^}]+)}/g,h=1e3,g=2,m=144e5,y=.5;function w(e,t=h,n=g){var r=t*Math.pow(n,e),a=Math.round(y*r*(Math.random()-.5)*2);return Math.min(m,r+a)}function v(e){return e&&e._delegate?e._delegate:e}class I{constructor(e,t,n){this.name=e,this.instanceFactory=t,this.type=n,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(e){return this.instantiationMode=e,this}setMultipleInstances(e){return this.multipleInstances=e,this}setServiceProps(e){return this.serviceProps=e,this}setInstanceCreatedCallback(e){return this.onInstanceCreated=e,this}}function _(n){return new Promise(function(e,t){n.onsuccess=function(){e(n.result)},n.onerror=function(){t(n.error)}})}function b(n,r,a){var i,e=new Promise(function(e,t){_(i=n[r].apply(n,a)).then(e,t)});return e.request=i,e}function E(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 T(t,n,r,e){e.forEach(function(e){e in r.prototype&&(t.prototype[e]=function(){return b(this[n],e,arguments)})})}function S(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 C(e,r,t,n){n.forEach(function(n){n in t.prototype&&(e.prototype[n]=function(){return e=this[r],(t=b(e,n,arguments)).then(function(e){if(e)return new P(e,t.request)});var e,t})})}function O(e){this._index=e}function P(e,t){this._cursor=e,this._request=t}function D(e){this._store=e}function A(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 N(e,t,n){this._db=e,this.oldVersion=t,this.transaction=new A(n)}function j(e){this._db=e}E(O,"_index",["name","keyPath","multiEntry","unique"]),T(O,"_index",IDBIndex,["get","getKey","getAll","getAllKeys","count"]),C(O,"_index",IDBIndex,["openCursor","openKeyCursor"]),E(P,"_cursor",["direction","key","primaryKey","value"]),T(P,"_cursor",IDBCursor,["update","delete"]),["advance","continue","continuePrimaryKey"].forEach(function(n){n in IDBCursor.prototype&&(P.prototype[n]=function(){var t=this,e=arguments;return Promise.resolve().then(function(){return t._cursor[n].apply(t._cursor,e),_(t._request).then(function(e){if(e)return new P(e,t._request)})})})}),D.prototype.createIndex=function(){return new O(this._store.createIndex.apply(this._store,arguments))},D.prototype.index=function(){return new O(this._store.index.apply(this._store,arguments))},E(D,"_store",["name","keyPath","indexNames","autoIncrement"]),T(D,"_store",IDBObjectStore,["put","add","delete","clear","get","getAll","getKey","getAllKeys","count"]),C(D,"_store",IDBObjectStore,["openCursor","openKeyCursor"]),S(D,"_store",IDBObjectStore,["deleteIndex"]),A.prototype.objectStore=function(){return new D(this._tx.objectStore.apply(this._tx,arguments))},E(A,"_tx",["objectStoreNames","mode"]),S(A,"_tx",IDBTransaction,["abort"]),N.prototype.createObjectStore=function(){return new D(this._db.createObjectStore.apply(this._db,arguments))},E(N,"_db",["name","version","objectStoreNames"]),S(N,"_db",IDBDatabase,["deleteObjectStore","close"]),j.prototype.transaction=function(){return new A(this._db.transaction.apply(this._db,arguments))},E(j,"_db",["name","version","objectStoreNames"]),S(j,"_db",IDBDatabase,["close"]),["openCursor","openKeyCursor"].forEach(function(i){[D,O].forEach(function(e){i in e.prototype&&(e.prototype[i.replace("open","iterate")]=function(){var e,t=(e=arguments,Array.prototype.slice.call(e)),n=t[t.length-1],r=this._store||this._index,a=r[i].apply(r,t.slice(0,-1));a.onsuccess=function(){n(a.result)}})})}),[O,D].forEach(function(e){e.prototype.getAll||(e.prototype.getAll=function(e,n){var r=this,a=[];return new Promise(function(t){r.iterateCursor(e,function(e){e?(a.push(e.value),void 0===n||a.length!=n?e.continue():t(a)):t(a)})})})});var k="@firebase/installations",L="0.5.5-canary.044a8d7f9";const R=1e4,x=`w:${L}`,$="FIS_v2",M="https://firebaseinstallations.googleapis.com/v1",F=36e5;const H=new l("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 B(e){return e instanceof u&&e.code.includes("request-failed")}function q({projectId:e}){return`${M}/projects/${e}/installations`}function V(e){return{token:e.token,requestStatus:2,expiresIn:(e=e.expiresIn,Number(e.replace("s","000"))),creationTime:Date.now()}}async function K(e,t){var n=(await t.json()).error;return H.create("request-failed",{requestName:e,serverCode:n.code,serverMessage:n.message,serverStatus:n.status})}function U({apiKey:e}){return new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":e})}function G(e,{refreshToken:t}){const n=U(e);return n.append("Authorization",(t=t,`${$} ${t}`)),n}async function W(e){var t=await e();return 500<=t.status&&t.status<600?e():t}function z(t){return new Promise(e=>{setTimeout(e,t)})}const J=/^[cdef][\w-]{21}$/,Y="";function X(){try{const t=new Uint8Array(17),n=self.crypto||self.msCrypto;n.getRandomValues(t),t[0]=112+t[0]%16;var e=function(e){const t=function(e){const t=btoa(String.fromCharCode(...e));return t.replace(/\+/g,"-").replace(/\//g,"_")}(e);return t.substr(0,22)}(t);return J.test(e)?e:Y}catch(e){return Y}}function Z(e){return`${e.appName}!${e.appId}`}const Q=new Map;function ee(e,t){var n=Z(e);te(n,t),function(e,t){const n=function(){!ne&&"BroadcastChannel"in self&&(ne=new BroadcastChannel("[Firebase] FID Change"),ne.onmessage=e=>{te(e.data.key,e.data.fid)});return ne}();n&&n.postMessage({key:e,fid:t});0===Q.size&&ne&&(ne.close(),ne=null)}(n,t)}function te(e,t){var n=Q.get(e);if(n)for(const r of n)r(t)}let ne=null;const re="firebase-installations-store";let ae=null;function ie(){var t,e,n;return ae=ae||(t=e=>{0===e.oldVersion&&e.createObjectStore(re)},e=b(indexedDB,"open",["firebase-installations-database",1]),(n=e.request)&&(n.onupgradeneeded=function(e){t&&t(new N(n.result,e.oldVersion,n.transaction))}),e.then(function(e){return new j(e)})),ae}async function oe(e,t){var n=Z(e);const r=await ie(),a=r.transaction(re,"readwrite"),i=a.objectStore(re);var o=await i.get(n);return await i.put(t,n),await a.complete,o&&o.fid===t.fid||ee(e,t.fid),t}async function se(e){var t=Z(e);const n=await ie(),r=n.transaction(re,"readwrite");await r.objectStore(re).delete(t),await r.complete}async function ce(e,t){var n=Z(e);const r=await ie(),a=r.transaction(re,"readwrite"),i=a.objectStore(re);var o=await i.get(n),s=t(o);return void 0===s?await i.delete(n):await i.put(s,n),await a.complete,!s||o&&o.fid===s.fid||ee(e,s.fid),s}async function ue(n){let r;var e=await ce(n,e=>{var t=de(e||{fid:X(),registrationStatus:0}),t=function(e,t){{if(0!==t.registrationStatus)return 1===t.registrationStatus?{installationEntry:t,registrationPromise:async function(e){let t=await le(e);for(;1===t.registrationStatus;)await z(100),t=await le(e);if(0!==t.registrationStatus)return t;{var{installationEntry:n,registrationPromise:r}=await ue(e);return r||n}}(e)}:{installationEntry:t};if(!navigator.onLine){var n=Promise.reject(H.create("app-offline"));return{installationEntry:t,registrationPromise:n}}var r={fid:t.fid,registrationStatus:1,registrationTime:Date.now()},n=async function(t,n){try{var e=await async function(e,{fid:t}){const n=q(e);var r=U(e),a={fid:t,authVersion:$,appId:e.appId,sdkVersion:x};const i={method:"POST",headers:r,body:JSON.stringify(a)},o=await W(()=>fetch(n,i));if(o.ok){a=await o.json();return{fid:a.fid||t,registrationStatus:2,refreshToken:a.refreshToken,authToken:V(a.authToken)}}throw await K("Create Installation",o)}(t,n);return oe(t,e)}catch(e){throw B(e)&&409===e.customData.serverCode?await se(t):await oe(t,{fid:n.fid,registrationStatus:0}),e}}(e,r);return{installationEntry:r,registrationPromise:n}}}(n,t);return r=t.registrationPromise,t.installationEntry});return e.fid===Y?{installationEntry:await r}:{installationEntry:e,registrationPromise:r}}function le(e){return ce(e,e=>{if(!e)throw H.create("installation-not-found");return de(e)})}function de(e){return 1===(t=e).registrationStatus&&t.registrationTime+R<Date.now()?{fid:e.fid,registrationStatus:0}:e;var t}async function pe({appConfig:e,platformLoggerProvider:t},n){const r=([a,i]=[e,n["fid"]],`${q(a)}/${i}/authTokens:generate`);var a,i;const o=G(e,n),s=t.getImmediate({optional:!0});s&&o.append("x-firebase-client",s.getPlatformInfoString());var c={installation:{sdkVersion:x}};const u={method:"POST",headers:o,body:JSON.stringify(c)},l=await W(()=>fetch(r,u));if(l.ok)return V(await l.json());throw await K("Generate Auth Token",l)}async function fe(r,a=!1){let i;var e=await ce(r.appConfig,e=>{if(!ge(e))throw H.create("not-registered");var t,n=e.authToken;if(a||2!==(t=n).requestStatus||function(e){var t=Date.now();return t<e.creationTime||e.creationTime+e.expiresIn<t+F}(t)){if(1===n.requestStatus)return i=async function(e,t){let n=await he(e.appConfig);for(;1===n.authToken.requestStatus;)await z(100),n=await he(e.appConfig);var r=n.authToken;return 0===r.requestStatus?fe(e,t):r}(r,a),e;if(!navigator.onLine)throw H.create("app-offline");n=(t=e,n={requestStatus:1,requestTime:Date.now()},Object.assign(Object.assign({},t),{authToken:n}));return i=async function(t,n){try{var r=await pe(t,n),e=Object.assign(Object.assign({},n),{authToken:r});return await oe(t.appConfig,e),r}catch(e){throw!B(e)||401!==e.customData.serverCode&&404!==e.customData.serverCode?(r=Object.assign(Object.assign({},n),{authToken:{requestStatus:0}}),await oe(t.appConfig,r)):await se(t.appConfig),e}}(r,n),n}return e});return i?await i:e.authToken}function he(e){return ce(e,e=>{if(!ge(e))throw H.create("not-registered");var t,n=e.authToken;return 1===(t=n).requestStatus&&t.requestTime+R<Date.now()?Object.assign(Object.assign({},e),{authToken:{requestStatus:0}}):e})}function ge(e){return void 0!==e&&2===e.registrationStatus}async function me(e,t=!1){var n,r=e;return e=r.appConfig,await((n=(await ue(e)).registrationPromise)&&await n),(await fe(r,t)).token}function ye(e){return H.create("missing-app-config-values",{valueName:e})}const we="installations",ve=e=>{var t=e.getProvider("app").getImmediate();return{app:t,appConfig:function(e){if(!e||!e.options)throw ye("App Configuration");if(!e.name)throw ye("App Name");for(const t of["projectId","apiKey","appId"])if(!e.options[t])throw ye(t);return{appName:e.name,projectId:e.options.projectId,apiKey:e.options.apiKey,appId:e.options.appId}}(t),platformLoggerProvider:ut._getProvider(t,"platform-logger"),_delete:()=>Promise.resolve()}},Ie=e=>{var t=e.getProvider("app").getImmediate();const n=ut._getProvider(t,we).getImmediate();return{getId:()=>async function(e){var t=e;const{installationEntry:n,registrationPromise:r}=await ue(t.appConfig);return(r||fe(t)).catch(console.error),n.fid}(n),getToken:e=>me(n,e)}};ut._registerComponent(new I(we,ve,"PUBLIC")),ut._registerComponent(new I("installations-internal",Ie,"PRIVATE")),ut.registerVersion(k,L),ut.registerVersion(k,L,"esm2017");const _e="analytics",be="firebase_id",Ee="origin",Te="https://firebase.googleapis.com/v1alpha/projects/-/apps/{app-id}/webConfig",Se="https://www.googletagmanager.com/gtag/js",Ce=new class{constructor(e){this.name=e,this._logLevel=a,this._logHandler=o,this._userLogHandler=null}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in t))throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel="string"==typeof e?r[e]:e}get logHandler(){return this._logHandler}set logHandler(e){if("function"!=typeof e)throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e}get userLogHandler(){return this._userLogHandler}set userLogHandler(e){this._userLogHandler=e}debug(...e){this._userLogHandler&&this._userLogHandler(this,t.DEBUG,...e),this._logHandler(this,t.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,t.VERBOSE,...e),this._logHandler(this,t.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,t.INFO,...e),this._logHandler(this,t.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,t.WARN,...e),this._logHandler(this,t.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,t.ERROR,...e),this._logHandler(this,t.ERROR,...e)}}("@firebase/analytics");function Oe(e){return Promise.all(e.map(e=>e.catch(e=>e)))}function Pe(r,a,i,o){return async function(e,t,n){try{"event"===e?await async function(e,n,r,a,i){try{let t=[];if(i&&i.send_to){let e=i.send_to;Array.isArray(e)||(e=[e]);const c=await Oe(r);for(const u of e){var o=c.find(e=>e.measurementId===u),s=o&&n[o.appId];if(!s){t=[];break}t.push(s)}}0===t.length&&(t=Object.values(n)),await Promise.all(t),e("event",a,i||{})}catch(e){Ce.error(e)}}(r,a,i,t,n):"config"===e?await async function(e,t,n,r,a,i){var o=r[a];try{if(o)await t[o];else{const c=await Oe(n);var s=c.find(e=>e.measurementId===a);s&&await t[s.appId]}}catch(e){Ce.error(e)}e("config",a,i)}(r,a,i,o,t,n):r("set",t)}catch(e){Ce.error(e)}}}const De=new l("analytics","Analytics",{"already-exists":"A Firebase Analytics instance with the appId {$id} already exists. Only one Firebase Analytics instance can be created for each appId.","already-initialized":"initializeAnalytics() cannot be called again with different options than those it was initially called with. It can be called again with the same options to return the existing instance, or getAnalytics() can be used to get a reference to the already-intialized instance.","already-initialized-settings":"Firebase Analytics has already been initialized.settings() must be called before initializing any Analytics instanceor it will have no effect.","interop-component-reg-failed":"Firebase Analytics Interop Component failed to instantiate: {$reason}","invalid-analytics-context":"Firebase Analytics is not supported in this environment. Wrap initialization of analytics in analytics.isSupported() to prevent initialization in unsupported environments. Details: {$errorInfo}","indexeddb-unavailable":"IndexedDB unavailable or restricted in this environment. Wrap initialization of analytics in analytics.isSupported() to prevent initialization in unsupported environments. Details: {$errorInfo}","fetch-throttle":"The config fetch request timed out while in an exponential backoff state. Unix timestamp in milliseconds when fetch request throttling ends: {$throttleEndTimeMillis}.","config-fetch-failed":"Dynamic config fetch failed: [{$httpStatus}] {$responseMessage}","no-api-key":'The "apiKey" field is empty in the local Firebase config. Firebase Analytics requires this field tocontain a valid API key.',"no-app-id":'The "appId" field is empty in the local Firebase config. Firebase Analytics requires this field tocontain a valid app ID.'}),Ae=30;const Ne=new class{constructor(e={},t=1e3){this.throttleMetadata=e,this.intervalMillis=t}getThrottleMetadata(e){return this.throttleMetadata[e]}setThrottleMetadata(e,t){this.throttleMetadata[e]=t}deleteThrottleMetadata(e){delete this.throttleMetadata[e]}};async function je(e){var t,{appId:n,apiKey:r}=e,r={method:"GET",headers:new Headers({Accept:"application/json","x-goog-api-key":r})},n=Te.replace("{app-id}",n);const a=await fetch(n,r);if(200===a.status||304===a.status)return a.json();{let e="";try{var i=await a.json();null!==(t=i.error)&&void 0!==t&&t.message&&(e=i.error.message)}catch(e){}throw De.create("config-fetch-failed",{httpStatus:a.status,responseMessage:e})}}async function ke(e,t=Ne,n){var{appId:r,apiKey:a,measurementId:i}=e.options;if(!r)throw De.create("no-app-id");if(!a){if(i)return{measurementId:i,appId:r};throw De.create("no-api-key")}var o=t.getThrottleMetadata(r)||{backoffCount:0,throttleEndTimeMillis:Date.now()};const s=new xe;return setTimeout(async()=>{s.abort()},void 0!==n?n:6e4),async function t(n,{throttleEndTimeMillis:e,backoffCount:r},a,i=Ne){const{appId:o,measurementId:s}=n;try{await Le(a,e)}catch(e){if(s)return Ce.warn("Timed out fetching this Firebase app's measurement ID from the server."+` Falling back to the measurement ID ${s}`+` provided in the "measurementId" field in the local Firebase config. [${e.message}]`),{appId:o,measurementId:s};throw e}try{const c=await je(n);return i.deleteThrottleMetadata(o),c}catch(e){if(!Re(e)){if(i.deleteThrottleMetadata(o),s)return Ce.warn("Failed to fetch this Firebase app's measurement ID from the server."+` Falling back to the measurement ID ${s}`+` provided in the "measurementId" field in the local Firebase config. [${e.message}]`),{appId:o,measurementId:s};throw e}const u=503===Number(e.customData.httpStatus)?w(r,i.intervalMillis,Ae):w(r,i.intervalMillis),l={throttleEndTimeMillis:Date.now()+u,backoffCount:r+1};return i.setThrottleMetadata(o,l),Ce.debug(`Calling attemptFetch again in ${u} millis`),t(n,l,a,i)}}({appId:r,apiKey:a,measurementId:i},o,s,t)}function Le(a,i){return new Promise((e,t)=>{var n=Math.max(i-Date.now(),0);const r=setTimeout(e,n);a.addEventListener(()=>{clearTimeout(r),t(De.create("fetch-throttle",{throttleEndTimeMillis:i}))})})}function Re(e){if(!(e instanceof u&&e.customData))return!1;var t=Number(e.customData.httpStatus);return 429===t||500===t||503===t||504===t}class xe{constructor(){this.listeners=[]}addEventListener(e){this.listeners.push(e)}abort(){this.listeners.forEach(e=>e())}}async function $e(t,e,n,r,a,i,o){const s=ke(t);s.then(e=>{n[e.measurementId]=e.appId,t.options.measurementId&&e.measurementId!==t.options.measurementId&&Ce.warn(`The measurement ID in the local Firebase config (${t.options.measurementId})`+` does not match the measurement ID fetched from the server (${e.measurementId}).`+" To ensure analytics events are always sent to the correct Analytics property, update the measurement ID field in the local config or remove it from the local config.")}).catch(e=>Ce.error(e)),e.push(s);var c=async function(){if(!p())return Ce.warn(De.create("indexeddb-unavailable",{errorInfo:"IndexedDB is not available in this environment."}).message),!1;try{await f()}catch(e){return Ce.warn(De.create("indexeddb-unavailable",{errorInfo:e}).message),!1}return!0}().then(e=>{if(e)return r.getId()}),[u,l]=await Promise.all([s,c]);!function(){var e=window.document.getElementsByTagName("script");for(const t of Object.values(e))if(t.src&&t.src.includes(Se))return t}()&&function(e,t){const n=document.createElement("script");n.src=`${Se}?l=${e}&id=${t}`,n.async=!0,document.head.appendChild(n)}(i,u.measurementId),a("js",new Date);const d=null!==(c=null==o?void 0:o.config)&&void 0!==c?c:{};return d[Ee]="firebase",d.update=!0,null!=l&&(d[be]=l),a("config",u.measurementId,d),u.measurementId}class Me{constructor(e){this.app=e}_delete(){return delete Fe[this.app.options.appId],Promise.resolve()}}let Fe={},He=[];const Be={};let qe="dataLayer",Ve="gtag",Ke,Ue,Ge=!1;function We(e){if(Ge)throw De.create("already-initialized");e.dataLayerName&&(qe=e.dataLayerName),e.gtagName&&(Ve=e.gtagName)}function ze(e,t,n){!function(){const e=[];var t;s()&&e.push("This is a browser extension environment."),c()||e.push("Cookies are not available."),0<e.length&&(t=e.map((e,t)=>`(${t+1}) ${e}`).join(" "),t=De.create("invalid-analytics-context",{errorInfo:t}),Ce.warn(t.message))}();var r,a,i=e.options.appId;if(!i)throw De.create("no-app-id");if(!e.options.apiKey){if(!e.options.measurementId)throw De.create("no-api-key");Ce.warn('The "apiKey" field is empty in the local Firebase config. This is needed to fetch the latest'+` measurement ID for this Firebase app. Falling back to the measurement ID ${e.options.measurementId}`+' provided in the "measurementId" field in the local Firebase config.')}if(null!=Fe[i])throw De.create("already-exists",{id:i});return Ge||(function(e){let t=[];Array.isArray(window[e])?t=window[e]:window[e]=t,t}(qe),{wrappedGtag:r,gtagCore:a}=function(e,t,n,r,a){let i=function(){window[r].push(arguments)};return window[a]&&"function"==typeof window[a]&&(i=window[a]),window[a]=Pe(i,e,t,n),{gtagCore:i,wrappedGtag:window[a]}}(Fe,He,Be,qe,Ve),Ue=r,Ke=a,Ge=!0),Fe[i]=$e(e,He,Be,t,Ke,qe,n),new Me(e)}async function Je(){if(s())return!1;if(!c())return!1;if(!p())return!1;try{return await f()}catch(e){return!1}}function Ye(e,t,n){e=v(e),async function(e,t,n,r){if(r&&r.global)return e("set",{screen_name:n}),Promise.resolve();e("config",await t,{update:!0,screen_name:n})}(Ue,Fe[e.app.options.appId],t,n).catch(e=>Ce.error(e))}function Xe(e,t,n){e=v(e),async function(e,t,n,r){if(r&&r.global)return e("set",{user_id:n}),Promise.resolve();e("config",await t,{update:!0,user_id:n})}(Ue,Fe[e.app.options.appId],t,n).catch(e=>Ce.error(e))}function Ze(e,t,n){e=v(e),async function(e,t,n,r){if(r&&r.global){const a={};for(const i of Object.keys(n))a[`user_properties.${i}`]=n[i];return e("set",a),Promise.resolve()}e("config",await t,{update:!0,user_properties:n})}(Ue,Fe[e.app.options.appId],t,n).catch(e=>Ce.error(e))}function Qe(e,t){e=v(e),async function(e,t){var n=await e;window[`ga-disable-${n}`]=!t}(Fe[e.app.options.appId],t).catch(e=>Ce.error(e))}function et(e,t,n,r){e=v(e),async function(e,t,n,r,a){var i;a&&a.global?e("event",n,r):(i=await t,e("event",n,Object.assign(Object.assign({},r),{send_to:i})))}(Ue,Fe[e.app.options.appId],t,n,r).catch(e=>Ce.error(e))}const tt="@firebase/analytics",nt="0.7.5-canary.044a8d7f9";ut._registerComponent(new I(_e,(e,{options:t})=>{return ze(e.getProvider("app").getImmediate(),e.getProvider("installations-internal").getImmediate(),t)},"PUBLIC")),ut._registerComponent(new I("analytics-internal",function(e){try{const r=e.getProvider(_e).getImmediate();return{logEvent:(e,t,n)=>et(r,e,t,n)}}catch(e){throw De.create("interop-component-reg-failed",{reason:e})}},"PRIVATE")),ut.registerVersion(tt,nt),ut.registerVersion(tt,nt,"esm2017");var rt,at,it;class ot{constructor(e,t){this.app=e,this._delegate=t}logEvent(e,t,n){et(this._delegate,e,t,n)}setCurrentScreen(e,t){Ye(this._delegate,e,t)}setUserId(e,t){Xe(this._delegate,e,t)}setUserProperties(e,t){Ze(this._delegate,e,t)}setAnalyticsCollectionEnabled(e){Qe(this._delegate,e)}}(at=rt=rt||{}).ADD_SHIPPING_INFO="add_shipping_info",at.ADD_PAYMENT_INFO="add_payment_info",at.ADD_TO_CART="add_to_cart",at.ADD_TO_WISHLIST="add_to_wishlist",at.BEGIN_CHECKOUT="begin_checkout",at.CHECKOUT_PROGRESS="checkout_progress",at.EXCEPTION="exception",at.GENERATE_LEAD="generate_lead",at.LOGIN="login",at.PAGE_VIEW="page_view",at.PURCHASE="purchase",at.REFUND="refund",at.REMOVE_FROM_CART="remove_from_cart",at.SCREEN_VIEW="screen_view",at.SEARCH="search",at.SELECT_CONTENT="select_content",at.SELECT_ITEM="select_item",at.SELECT_PROMOTION="select_promotion",at.SET_CHECKOUT_OPTION="set_checkout_option",at.SHARE="share",at.SIGN_UP="sign_up",at.TIMING_COMPLETE="timing_complete",at.VIEW_CART="view_cart",at.VIEW_ITEM="view_item",at.VIEW_ITEM_LIST="view_item_list",at.VIEW_PROMOTION="view_promotion",at.VIEW_SEARCH_RESULTS="view_search_results";const st=e=>{var t=e.getProvider("app-compat").getImmediate(),n=e.getProvider("analytics").getImmediate();return new ot(t,n)};it={Analytics:ot,settings:We,isSupported:Je,EventName:rt},n.default.INTERNAL.registerComponent(new I("analytics-compat",st,"PUBLIC").setServiceProps(it).setMultipleInstances(!0)),n.default.registerVersion("@firebase/analytics-compat","0.1.6-canary.044a8d7f9")}).apply(this,arguments)}catch(e){throw console.error(e),new Error("Cannot instantiate firebase-analytics-compat.js - be sure to load firebase-app.js first.")}});
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("@firebase/app-compat"),require("@firebase/app")):"function"==typeof define&&define.amd?define(["@firebase/app-compat","@firebase/app"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).firebase,e.firebase.INTERNAL.modularAPIs)}(this,function(ct,ut){"use strict";try{!(function(){function e(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t,n=e(ct);(at=t=t||{})[at.DEBUG=0]="DEBUG",at[at.VERBOSE=1]="VERBOSE",at[at.INFO=2]="INFO",at[at.WARN=3]="WARN",at[at.ERROR=4]="ERROR",at[at.SILENT=5]="SILENT";const r={debug:t.DEBUG,verbose:t.VERBOSE,info:t.INFO,warn:t.WARN,error:t.ERROR,silent:t.SILENT},a=t.INFO,i={[t.DEBUG]:"log",[t.VERBOSE]:"log",[t.INFO]:"info",[t.WARN]:"warn",[t.ERROR]:"error"},o=(e,t,...n)=>{if(!(t<e.logLevel)){var r=(new Date).toISOString(),a=i[t];if(!a)throw new Error(`Attempted to log a message with an invalid logType (value: ${t})`);console[a](`[${r}] ${e.name}:`,...n)}};function s(){var e="object"==typeof chrome?chrome.runtime:"object"==typeof browser?browser.runtime:void 0;return"object"==typeof e&&void 0!==e.id}function p(){return"object"==typeof indexedDB}function f(){return new Promise((t,n)=>{try{let e=!0;const r="validate-browser-context-for-indexeddb-analytics-module",a=self.indexedDB.open(r);a.onsuccess=()=>{a.result.close(),e||self.indexedDB.deleteDatabase(r),t(!0)},a.onupgradeneeded=()=>{e=!1},a.onerror=()=>{var e;n((null===(e=a.error)||void 0===e?void 0:e.message)||"")}}catch(e){n(e)}})}function c(){return!("undefined"==typeof navigator||!navigator.cookieEnabled)}class u extends Error{constructor(e,t,n){super(t),this.code=e,this.customData=n,this.name="FirebaseError",Object.setPrototypeOf(this,u.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,l.prototype.create)}}class l{constructor(e,t,n){this.service=e,this.serviceName=t,this.errors=n}create(e,...t){var r,n=t[0]||{},a=`${this.service}/${e}`,i=this.errors[e],i=i?(r=n,i.replace(d,(e,t)=>{var n=r[t];return null!=n?String(n):`<${t}?>`})):"Error",i=`${this.serviceName}: ${i} (${a}).`;return new u(a,i,n)}}const d=/\{\$([^}]+)}/g,h=1e3,g=2,m=144e5,y=.5;function w(e,t=h,n=g){var r=t*Math.pow(n,e),a=Math.round(y*r*(Math.random()-.5)*2);return Math.min(m,r+a)}function v(e){return e&&e._delegate?e._delegate:e}class I{constructor(e,t,n){this.name=e,this.instanceFactory=t,this.type=n,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(e){return this.instantiationMode=e,this}setMultipleInstances(e){return this.multipleInstances=e,this}setServiceProps(e){return this.serviceProps=e,this}setInstanceCreatedCallback(e){return this.onInstanceCreated=e,this}}function _(n){return new Promise(function(e,t){n.onsuccess=function(){e(n.result)},n.onerror=function(){t(n.error)}})}function b(n,r,a){var i,e=new Promise(function(e,t){_(i=n[r].apply(n,a)).then(e,t)});return e.request=i,e}function E(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 T(t,n,r,e){e.forEach(function(e){e in r.prototype&&(t.prototype[e]=function(){return b(this[n],e,arguments)})})}function S(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 C(e,r,t,n){n.forEach(function(n){n in t.prototype&&(e.prototype[n]=function(){return e=this[r],(t=b(e,n,arguments)).then(function(e){if(e)return new P(e,t.request)});var e,t})})}function O(e){this._index=e}function P(e,t){this._cursor=e,this._request=t}function D(e){this._store=e}function A(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 N(e,t,n){this._db=e,this.oldVersion=t,this.transaction=new A(n)}function j(e){this._db=e}E(O,"_index",["name","keyPath","multiEntry","unique"]),T(O,"_index",IDBIndex,["get","getKey","getAll","getAllKeys","count"]),C(O,"_index",IDBIndex,["openCursor","openKeyCursor"]),E(P,"_cursor",["direction","key","primaryKey","value"]),T(P,"_cursor",IDBCursor,["update","delete"]),["advance","continue","continuePrimaryKey"].forEach(function(n){n in IDBCursor.prototype&&(P.prototype[n]=function(){var t=this,e=arguments;return Promise.resolve().then(function(){return t._cursor[n].apply(t._cursor,e),_(t._request).then(function(e){if(e)return new P(e,t._request)})})})}),D.prototype.createIndex=function(){return new O(this._store.createIndex.apply(this._store,arguments))},D.prototype.index=function(){return new O(this._store.index.apply(this._store,arguments))},E(D,"_store",["name","keyPath","indexNames","autoIncrement"]),T(D,"_store",IDBObjectStore,["put","add","delete","clear","get","getAll","getKey","getAllKeys","count"]),C(D,"_store",IDBObjectStore,["openCursor","openKeyCursor"]),S(D,"_store",IDBObjectStore,["deleteIndex"]),A.prototype.objectStore=function(){return new D(this._tx.objectStore.apply(this._tx,arguments))},E(A,"_tx",["objectStoreNames","mode"]),S(A,"_tx",IDBTransaction,["abort"]),N.prototype.createObjectStore=function(){return new D(this._db.createObjectStore.apply(this._db,arguments))},E(N,"_db",["name","version","objectStoreNames"]),S(N,"_db",IDBDatabase,["deleteObjectStore","close"]),j.prototype.transaction=function(){return new A(this._db.transaction.apply(this._db,arguments))},E(j,"_db",["name","version","objectStoreNames"]),S(j,"_db",IDBDatabase,["close"]),["openCursor","openKeyCursor"].forEach(function(i){[D,O].forEach(function(e){i in e.prototype&&(e.prototype[i.replace("open","iterate")]=function(){var e,t=(e=arguments,Array.prototype.slice.call(e)),n=t[t.length-1],r=this._store||this._index,a=r[i].apply(r,t.slice(0,-1));a.onsuccess=function(){n(a.result)}})})}),[O,D].forEach(function(e){e.prototype.getAll||(e.prototype.getAll=function(e,n){var r=this,a=[];return new Promise(function(t){r.iterateCursor(e,function(e){e?(a.push(e.value),void 0===n||a.length!=n?e.continue():t(a)):t(a)})})})});var k="@firebase/installations",L="0.5.5-canary.88d43ec00";const R=1e4,x=`w:${L}`,$="FIS_v2",M="https://firebaseinstallations.googleapis.com/v1",F=36e5;const H=new l("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 B(e){return e instanceof u&&e.code.includes("request-failed")}function q({projectId:e}){return`${M}/projects/${e}/installations`}function V(e){return{token:e.token,requestStatus:2,expiresIn:(e=e.expiresIn,Number(e.replace("s","000"))),creationTime:Date.now()}}async function K(e,t){var n=(await t.json()).error;return H.create("request-failed",{requestName:e,serverCode:n.code,serverMessage:n.message,serverStatus:n.status})}function U({apiKey:e}){return new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":e})}function G(e,{refreshToken:t}){const n=U(e);return n.append("Authorization",(t=t,`${$} ${t}`)),n}async function W(e){var t=await e();return 500<=t.status&&t.status<600?e():t}function z(t){return new Promise(e=>{setTimeout(e,t)})}const J=/^[cdef][\w-]{21}$/,Y="";function X(){try{const t=new Uint8Array(17),n=self.crypto||self.msCrypto;n.getRandomValues(t),t[0]=112+t[0]%16;var e=function(e){const t=function(e){const t=btoa(String.fromCharCode(...e));return t.replace(/\+/g,"-").replace(/\//g,"_")}(e);return t.substr(0,22)}(t);return J.test(e)?e:Y}catch(e){return Y}}function Z(e){return`${e.appName}!${e.appId}`}const Q=new Map;function ee(e,t){var n=Z(e);te(n,t),function(e,t){const n=function(){!ne&&"BroadcastChannel"in self&&(ne=new BroadcastChannel("[Firebase] FID Change"),ne.onmessage=e=>{te(e.data.key,e.data.fid)});return ne}();n&&n.postMessage({key:e,fid:t});0===Q.size&&ne&&(ne.close(),ne=null)}(n,t)}function te(e,t){var n=Q.get(e);if(n)for(const r of n)r(t)}let ne=null;const re="firebase-installations-store";let ae=null;function ie(){var t,e,n;return ae=ae||(t=e=>{0===e.oldVersion&&e.createObjectStore(re)},e=b(indexedDB,"open",["firebase-installations-database",1]),(n=e.request)&&(n.onupgradeneeded=function(e){t&&t(new N(n.result,e.oldVersion,n.transaction))}),e.then(function(e){return new j(e)})),ae}async function oe(e,t){var n=Z(e);const r=await ie(),a=r.transaction(re,"readwrite"),i=a.objectStore(re);var o=await i.get(n);return await i.put(t,n),await a.complete,o&&o.fid===t.fid||ee(e,t.fid),t}async function se(e){var t=Z(e);const n=await ie(),r=n.transaction(re,"readwrite");await r.objectStore(re).delete(t),await r.complete}async function ce(e,t){var n=Z(e);const r=await ie(),a=r.transaction(re,"readwrite"),i=a.objectStore(re);var o=await i.get(n),s=t(o);return void 0===s?await i.delete(n):await i.put(s,n),await a.complete,!s||o&&o.fid===s.fid||ee(e,s.fid),s}async function ue(n){let r;var e=await ce(n,e=>{var t=de(e||{fid:X(),registrationStatus:0}),t=function(e,t){{if(0!==t.registrationStatus)return 1===t.registrationStatus?{installationEntry:t,registrationPromise:async function(e){let t=await le(e);for(;1===t.registrationStatus;)await z(100),t=await le(e);if(0!==t.registrationStatus)return t;{var{installationEntry:n,registrationPromise:r}=await ue(e);return r||n}}(e)}:{installationEntry:t};if(!navigator.onLine){var n=Promise.reject(H.create("app-offline"));return{installationEntry:t,registrationPromise:n}}var r={fid:t.fid,registrationStatus:1,registrationTime:Date.now()},n=async function(t,n){try{var e=await async function(e,{fid:t}){const n=q(e);var r=U(e),a={fid:t,authVersion:$,appId:e.appId,sdkVersion:x};const i={method:"POST",headers:r,body:JSON.stringify(a)},o=await W(()=>fetch(n,i));if(o.ok){a=await o.json();return{fid:a.fid||t,registrationStatus:2,refreshToken:a.refreshToken,authToken:V(a.authToken)}}throw await K("Create Installation",o)}(t,n);return oe(t,e)}catch(e){throw B(e)&&409===e.customData.serverCode?await se(t):await oe(t,{fid:n.fid,registrationStatus:0}),e}}(e,r);return{installationEntry:r,registrationPromise:n}}}(n,t);return r=t.registrationPromise,t.installationEntry});return e.fid===Y?{installationEntry:await r}:{installationEntry:e,registrationPromise:r}}function le(e){return ce(e,e=>{if(!e)throw H.create("installation-not-found");return de(e)})}function de(e){return 1===(t=e).registrationStatus&&t.registrationTime+R<Date.now()?{fid:e.fid,registrationStatus:0}:e;var t}async function pe({appConfig:e,platformLoggerProvider:t},n){const r=([a,i]=[e,n["fid"]],`${q(a)}/${i}/authTokens:generate`);var a,i;const o=G(e,n),s=t.getImmediate({optional:!0});s&&o.append("x-firebase-client",s.getPlatformInfoString());var c={installation:{sdkVersion:x}};const u={method:"POST",headers:o,body:JSON.stringify(c)},l=await W(()=>fetch(r,u));if(l.ok)return V(await l.json());throw await K("Generate Auth Token",l)}async function fe(r,a=!1){let i;var e=await ce(r.appConfig,e=>{if(!ge(e))throw H.create("not-registered");var t,n=e.authToken;if(a||2!==(t=n).requestStatus||function(e){var t=Date.now();return t<e.creationTime||e.creationTime+e.expiresIn<t+F}(t)){if(1===n.requestStatus)return i=async function(e,t){let n=await he(e.appConfig);for(;1===n.authToken.requestStatus;)await z(100),n=await he(e.appConfig);var r=n.authToken;return 0===r.requestStatus?fe(e,t):r}(r,a),e;if(!navigator.onLine)throw H.create("app-offline");n=(t=e,n={requestStatus:1,requestTime:Date.now()},Object.assign(Object.assign({},t),{authToken:n}));return i=async function(t,n){try{var r=await pe(t,n),e=Object.assign(Object.assign({},n),{authToken:r});return await oe(t.appConfig,e),r}catch(e){throw!B(e)||401!==e.customData.serverCode&&404!==e.customData.serverCode?(r=Object.assign(Object.assign({},n),{authToken:{requestStatus:0}}),await oe(t.appConfig,r)):await se(t.appConfig),e}}(r,n),n}return e});return i?await i:e.authToken}function he(e){return ce(e,e=>{if(!ge(e))throw H.create("not-registered");var t,n=e.authToken;return 1===(t=n).requestStatus&&t.requestTime+R<Date.now()?Object.assign(Object.assign({},e),{authToken:{requestStatus:0}}):e})}function ge(e){return void 0!==e&&2===e.registrationStatus}async function me(e,t=!1){var n,r=e;return e=r.appConfig,await((n=(await ue(e)).registrationPromise)&&await n),(await fe(r,t)).token}function ye(e){return H.create("missing-app-config-values",{valueName:e})}const we="installations",ve=e=>{var t=e.getProvider("app").getImmediate();return{app:t,appConfig:function(e){if(!e||!e.options)throw ye("App Configuration");if(!e.name)throw ye("App Name");for(const t of["projectId","apiKey","appId"])if(!e.options[t])throw ye(t);return{appName:e.name,projectId:e.options.projectId,apiKey:e.options.apiKey,appId:e.options.appId}}(t),platformLoggerProvider:ut._getProvider(t,"platform-logger"),_delete:()=>Promise.resolve()}},Ie=e=>{var t=e.getProvider("app").getImmediate();const n=ut._getProvider(t,we).getImmediate();return{getId:()=>async function(e){var t=e;const{installationEntry:n,registrationPromise:r}=await ue(t.appConfig);return(r||fe(t)).catch(console.error),n.fid}(n),getToken:e=>me(n,e)}};ut._registerComponent(new I(we,ve,"PUBLIC")),ut._registerComponent(new I("installations-internal",Ie,"PRIVATE")),ut.registerVersion(k,L),ut.registerVersion(k,L,"esm2017");const _e="analytics",be="firebase_id",Ee="origin",Te="https://firebase.googleapis.com/v1alpha/projects/-/apps/{app-id}/webConfig",Se="https://www.googletagmanager.com/gtag/js",Ce=new class{constructor(e){this.name=e,this._logLevel=a,this._logHandler=o,this._userLogHandler=null}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in t))throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel="string"==typeof e?r[e]:e}get logHandler(){return this._logHandler}set logHandler(e){if("function"!=typeof e)throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e}get userLogHandler(){return this._userLogHandler}set userLogHandler(e){this._userLogHandler=e}debug(...e){this._userLogHandler&&this._userLogHandler(this,t.DEBUG,...e),this._logHandler(this,t.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,t.VERBOSE,...e),this._logHandler(this,t.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,t.INFO,...e),this._logHandler(this,t.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,t.WARN,...e),this._logHandler(this,t.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,t.ERROR,...e),this._logHandler(this,t.ERROR,...e)}}("@firebase/analytics");function Oe(e){return Promise.all(e.map(e=>e.catch(e=>e)))}function Pe(r,a,i,o){return async function(e,t,n){try{"event"===e?await async function(e,n,r,a,i){try{let t=[];if(i&&i.send_to){let e=i.send_to;Array.isArray(e)||(e=[e]);const c=await Oe(r);for(const u of e){var o=c.find(e=>e.measurementId===u),s=o&&n[o.appId];if(!s){t=[];break}t.push(s)}}0===t.length&&(t=Object.values(n)),await Promise.all(t),e("event",a,i||{})}catch(e){Ce.error(e)}}(r,a,i,t,n):"config"===e?await async function(e,t,n,r,a,i){var o=r[a];try{if(o)await t[o];else{const c=await Oe(n);var s=c.find(e=>e.measurementId===a);s&&await t[s.appId]}}catch(e){Ce.error(e)}e("config",a,i)}(r,a,i,o,t,n):r("set",t)}catch(e){Ce.error(e)}}}const De=new l("analytics","Analytics",{"already-exists":"A Firebase Analytics instance with the appId {$id} already exists. Only one Firebase Analytics instance can be created for each appId.","already-initialized":"initializeAnalytics() cannot be called again with different options than those it was initially called with. It can be called again with the same options to return the existing instance, or getAnalytics() can be used to get a reference to the already-intialized instance.","already-initialized-settings":"Firebase Analytics has already been initialized.settings() must be called before initializing any Analytics instanceor it will have no effect.","interop-component-reg-failed":"Firebase Analytics Interop Component failed to instantiate: {$reason}","invalid-analytics-context":"Firebase Analytics is not supported in this environment. Wrap initialization of analytics in analytics.isSupported() to prevent initialization in unsupported environments. Details: {$errorInfo}","indexeddb-unavailable":"IndexedDB unavailable or restricted in this environment. Wrap initialization of analytics in analytics.isSupported() to prevent initialization in unsupported environments. Details: {$errorInfo}","fetch-throttle":"The config fetch request timed out while in an exponential backoff state. Unix timestamp in milliseconds when fetch request throttling ends: {$throttleEndTimeMillis}.","config-fetch-failed":"Dynamic config fetch failed: [{$httpStatus}] {$responseMessage}","no-api-key":'The "apiKey" field is empty in the local Firebase config. Firebase Analytics requires this field tocontain a valid API key.',"no-app-id":'The "appId" field is empty in the local Firebase config. Firebase Analytics requires this field tocontain a valid app ID.'}),Ae=30;const Ne=new class{constructor(e={},t=1e3){this.throttleMetadata=e,this.intervalMillis=t}getThrottleMetadata(e){return this.throttleMetadata[e]}setThrottleMetadata(e,t){this.throttleMetadata[e]=t}deleteThrottleMetadata(e){delete this.throttleMetadata[e]}};async function je(e){var t,{appId:n,apiKey:r}=e,r={method:"GET",headers:new Headers({Accept:"application/json","x-goog-api-key":r})},n=Te.replace("{app-id}",n);const a=await fetch(n,r);if(200===a.status||304===a.status)return a.json();{let e="";try{var i=await a.json();null!==(t=i.error)&&void 0!==t&&t.message&&(e=i.error.message)}catch(e){}throw De.create("config-fetch-failed",{httpStatus:a.status,responseMessage:e})}}async function ke(e,t=Ne,n){var{appId:r,apiKey:a,measurementId:i}=e.options;if(!r)throw De.create("no-app-id");if(!a){if(i)return{measurementId:i,appId:r};throw De.create("no-api-key")}var o=t.getThrottleMetadata(r)||{backoffCount:0,throttleEndTimeMillis:Date.now()};const s=new xe;return setTimeout(async()=>{s.abort()},void 0!==n?n:6e4),async function t(n,{throttleEndTimeMillis:e,backoffCount:r},a,i=Ne){const{appId:o,measurementId:s}=n;try{await Le(a,e)}catch(e){if(s)return Ce.warn("Timed out fetching this Firebase app's measurement ID from the server."+` Falling back to the measurement ID ${s}`+` provided in the "measurementId" field in the local Firebase config. [${e.message}]`),{appId:o,measurementId:s};throw e}try{const c=await je(n);return i.deleteThrottleMetadata(o),c}catch(e){if(!Re(e)){if(i.deleteThrottleMetadata(o),s)return Ce.warn("Failed to fetch this Firebase app's measurement ID from the server."+` Falling back to the measurement ID ${s}`+` provided in the "measurementId" field in the local Firebase config. [${e.message}]`),{appId:o,measurementId:s};throw e}const u=503===Number(e.customData.httpStatus)?w(r,i.intervalMillis,Ae):w(r,i.intervalMillis),l={throttleEndTimeMillis:Date.now()+u,backoffCount:r+1};return i.setThrottleMetadata(o,l),Ce.debug(`Calling attemptFetch again in ${u} millis`),t(n,l,a,i)}}({appId:r,apiKey:a,measurementId:i},o,s,t)}function Le(a,i){return new Promise((e,t)=>{var n=Math.max(i-Date.now(),0);const r=setTimeout(e,n);a.addEventListener(()=>{clearTimeout(r),t(De.create("fetch-throttle",{throttleEndTimeMillis:i}))})})}function Re(e){if(!(e instanceof u&&e.customData))return!1;var t=Number(e.customData.httpStatus);return 429===t||500===t||503===t||504===t}class xe{constructor(){this.listeners=[]}addEventListener(e){this.listeners.push(e)}abort(){this.listeners.forEach(e=>e())}}async function $e(t,e,n,r,a,i,o){const s=ke(t);s.then(e=>{n[e.measurementId]=e.appId,t.options.measurementId&&e.measurementId!==t.options.measurementId&&Ce.warn(`The measurement ID in the local Firebase config (${t.options.measurementId})`+` does not match the measurement ID fetched from the server (${e.measurementId}).`+" To ensure analytics events are always sent to the correct Analytics property, update the measurement ID field in the local config or remove it from the local config.")}).catch(e=>Ce.error(e)),e.push(s);var c=async function(){if(!p())return Ce.warn(De.create("indexeddb-unavailable",{errorInfo:"IndexedDB is not available in this environment."}).message),!1;try{await f()}catch(e){return Ce.warn(De.create("indexeddb-unavailable",{errorInfo:e}).message),!1}return!0}().then(e=>{if(e)return r.getId()}),[u,l]=await Promise.all([s,c]);!function(){var e=window.document.getElementsByTagName("script");for(const t of Object.values(e))if(t.src&&t.src.includes(Se))return t}()&&function(e,t){const n=document.createElement("script");n.src=`${Se}?l=${e}&id=${t}`,n.async=!0,document.head.appendChild(n)}(i,u.measurementId),a("js",new Date);const d=null!==(c=null==o?void 0:o.config)&&void 0!==c?c:{};return d[Ee]="firebase",d.update=!0,null!=l&&(d[be]=l),a("config",u.measurementId,d),u.measurementId}class Me{constructor(e){this.app=e}_delete(){return delete Fe[this.app.options.appId],Promise.resolve()}}let Fe={},He=[];const Be={};let qe="dataLayer",Ve="gtag",Ke,Ue,Ge=!1;function We(e){if(Ge)throw De.create("already-initialized");e.dataLayerName&&(qe=e.dataLayerName),e.gtagName&&(Ve=e.gtagName)}function ze(e,t,n){!function(){const e=[];var t;s()&&e.push("This is a browser extension environment."),c()||e.push("Cookies are not available."),0<e.length&&(t=e.map((e,t)=>`(${t+1}) ${e}`).join(" "),t=De.create("invalid-analytics-context",{errorInfo:t}),Ce.warn(t.message))}();var r,a,i=e.options.appId;if(!i)throw De.create("no-app-id");if(!e.options.apiKey){if(!e.options.measurementId)throw De.create("no-api-key");Ce.warn('The "apiKey" field is empty in the local Firebase config. This is needed to fetch the latest'+` measurement ID for this Firebase app. Falling back to the measurement ID ${e.options.measurementId}`+' provided in the "measurementId" field in the local Firebase config.')}if(null!=Fe[i])throw De.create("already-exists",{id:i});return Ge||(function(e){let t=[];Array.isArray(window[e])?t=window[e]:window[e]=t,t}(qe),{wrappedGtag:r,gtagCore:a}=function(e,t,n,r,a){let i=function(){window[r].push(arguments)};return window[a]&&"function"==typeof window[a]&&(i=window[a]),window[a]=Pe(i,e,t,n),{gtagCore:i,wrappedGtag:window[a]}}(Fe,He,Be,qe,Ve),Ue=r,Ke=a,Ge=!0),Fe[i]=$e(e,He,Be,t,Ke,qe,n),new Me(e)}async function Je(){if(s())return!1;if(!c())return!1;if(!p())return!1;try{return await f()}catch(e){return!1}}function Ye(e,t,n){e=v(e),async function(e,t,n,r){if(r&&r.global)return e("set",{screen_name:n}),Promise.resolve();e("config",await t,{update:!0,screen_name:n})}(Ue,Fe[e.app.options.appId],t,n).catch(e=>Ce.error(e))}function Xe(e,t,n){e=v(e),async function(e,t,n,r){if(r&&r.global)return e("set",{user_id:n}),Promise.resolve();e("config",await t,{update:!0,user_id:n})}(Ue,Fe[e.app.options.appId],t,n).catch(e=>Ce.error(e))}function Ze(e,t,n){e=v(e),async function(e,t,n,r){if(r&&r.global){const a={};for(const i of Object.keys(n))a[`user_properties.${i}`]=n[i];return e("set",a),Promise.resolve()}e("config",await t,{update:!0,user_properties:n})}(Ue,Fe[e.app.options.appId],t,n).catch(e=>Ce.error(e))}function Qe(e,t){e=v(e),async function(e,t){var n=await e;window[`ga-disable-${n}`]=!t}(Fe[e.app.options.appId],t).catch(e=>Ce.error(e))}function et(e,t,n,r){e=v(e),async function(e,t,n,r,a){var i;a&&a.global?e("event",n,r):(i=await t,e("event",n,Object.assign(Object.assign({},r),{send_to:i})))}(Ue,Fe[e.app.options.appId],t,n,r).catch(e=>Ce.error(e))}const tt="@firebase/analytics",nt="0.7.5-canary.88d43ec00";ut._registerComponent(new I(_e,(e,{options:t})=>{return ze(e.getProvider("app").getImmediate(),e.getProvider("installations-internal").getImmediate(),t)},"PUBLIC")),ut._registerComponent(new I("analytics-internal",function(e){try{const r=e.getProvider(_e).getImmediate();return{logEvent:(e,t,n)=>et(r,e,t,n)}}catch(e){throw De.create("interop-component-reg-failed",{reason:e})}},"PRIVATE")),ut.registerVersion(tt,nt),ut.registerVersion(tt,nt,"esm2017");var rt,at,it;class ot{constructor(e,t){this.app=e,this._delegate=t}logEvent(e,t,n){et(this._delegate,e,t,n)}setCurrentScreen(e,t){Ye(this._delegate,e,t)}setUserId(e,t){Xe(this._delegate,e,t)}setUserProperties(e,t){Ze(this._delegate,e,t)}setAnalyticsCollectionEnabled(e){Qe(this._delegate,e)}}(at=rt=rt||{}).ADD_SHIPPING_INFO="add_shipping_info",at.ADD_PAYMENT_INFO="add_payment_info",at.ADD_TO_CART="add_to_cart",at.ADD_TO_WISHLIST="add_to_wishlist",at.BEGIN_CHECKOUT="begin_checkout",at.CHECKOUT_PROGRESS="checkout_progress",at.EXCEPTION="exception",at.GENERATE_LEAD="generate_lead",at.LOGIN="login",at.PAGE_VIEW="page_view",at.PURCHASE="purchase",at.REFUND="refund",at.REMOVE_FROM_CART="remove_from_cart",at.SCREEN_VIEW="screen_view",at.SEARCH="search",at.SELECT_CONTENT="select_content",at.SELECT_ITEM="select_item",at.SELECT_PROMOTION="select_promotion",at.SET_CHECKOUT_OPTION="set_checkout_option",at.SHARE="share",at.SIGN_UP="sign_up",at.TIMING_COMPLETE="timing_complete",at.VIEW_CART="view_cart",at.VIEW_ITEM="view_item",at.VIEW_ITEM_LIST="view_item_list",at.VIEW_PROMOTION="view_promotion",at.VIEW_SEARCH_RESULTS="view_search_results";const st=e=>{var t=e.getProvider("app-compat").getImmediate(),n=e.getProvider("analytics").getImmediate();return new ot(t,n)};it={Analytics:ot,settings:We,isSupported:Je,EventName:rt},n.default.INTERNAL.registerComponent(new I("analytics-compat",st,"PUBLIC").setServiceProps(it).setMultipleInstances(!0)),n.default.registerVersion("@firebase/analytics-compat","0.1.6-canary.88d43ec00")}).apply(this,arguments)}catch(e){throw console.error(e),new Error("Cannot instantiate firebase-analytics-compat.js - be sure to load firebase-app.js first.")}});
|
|
2
2
|
//# sourceMappingURL=firebase-analytics-compat.js.map
|
package/firebase-analytics.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { registerVersion, _registerComponent, _getProvider, getApp } from 'https://www.gstatic.com/firebasejs/9.6.2-canary.
|
|
1
|
+
import { registerVersion, _registerComponent, _getProvider, getApp } from 'https://www.gstatic.com/firebasejs/9.6.2-canary.88d43ec00/firebase-app.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* @license
|
|
@@ -803,7 +803,7 @@ function openDb(name, version, upgradeCallback) {
|
|
|
803
803
|
}
|
|
804
804
|
|
|
805
805
|
const name$1 = "@firebase/installations";
|
|
806
|
-
const version$1 = "0.5.5-canary.
|
|
806
|
+
const version$1 = "0.5.5-canary.88d43ec00";
|
|
807
807
|
|
|
808
808
|
/**
|
|
809
809
|
* @license
|
|
@@ -2704,7 +2704,7 @@ async function setAnalyticsCollectionEnabled$1(initializationPromise, enabled) {
|
|
|
2704
2704
|
*
|
|
2705
2705
|
* @public
|
|
2706
2706
|
*
|
|
2707
|
-
* @param app - The {@link https://www.gstatic.com/firebasejs/9.6.2-canary.
|
|
2707
|
+
* @param app - The {@link https://www.gstatic.com/firebasejs/9.6.2-canary.88d43ec00/firebase-app.js#FirebaseApp} to use.
|
|
2708
2708
|
*/
|
|
2709
2709
|
function getAnalytics(app = getApp()) {
|
|
2710
2710
|
app = getModularInstance(app);
|
|
@@ -2720,7 +2720,7 @@ function getAnalytics(app = getApp()) {
|
|
|
2720
2720
|
*
|
|
2721
2721
|
* @public
|
|
2722
2722
|
*
|
|
2723
|
-
* @param app - The {@link https://www.gstatic.com/firebasejs/9.6.2-canary.
|
|
2723
|
+
* @param app - The {@link https://www.gstatic.com/firebasejs/9.6.2-canary.88d43ec00/firebase-app.js#FirebaseApp} to use.
|
|
2724
2724
|
*/
|
|
2725
2725
|
function initializeAnalytics(app, options = {}) {
|
|
2726
2726
|
// Dependencies
|
|
@@ -2829,7 +2829,7 @@ function logEvent(analyticsInstance, eventName, eventParams, options) {
|
|
|
2829
2829
|
}
|
|
2830
2830
|
|
|
2831
2831
|
const name = "@firebase/analytics";
|
|
2832
|
-
const version = "0.7.5-canary.
|
|
2832
|
+
const version = "0.7.5-canary.88d43ec00";
|
|
2833
2833
|
|
|
2834
2834
|
/**
|
|
2835
2835
|
* Firebase Analytics
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("@firebase/app-compat"),require("@firebase/app")):"function"==typeof define&&define.amd?define(["@firebase/app-compat","@firebase/app"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).firebase,e.firebase.INTERNAL.modularAPIs)}(this,function(ke,ye){"use strict";try{!(function(){function e(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t,r,o=e(ke);const h={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:"function"==typeof atob,encodeByteArray(r,e){if(!Array.isArray(r))throw Error("encodeByteArray takes an array as a parameter");this.init_();var o=e?this.byteToCharMapWebSafe_:this.byteToCharMap_;const n=[];for(let l=0;l<r.length;l+=3){var a=r[l],i=l+1<r.length,s=i?r[l+1]:0,c=l+2<r.length,h=c?r[l+2]:0;let e=(15&s)<<2|h>>6,t=63&h;c||(t=64,i||(e=64)),n.push(o[a>>2],o[(3&a)<<4|s>>4],o[e],o[t])}return n.join("")},encodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(function(t){const r=[];let o=0;for(let n=0;n<t.length;n++){let e=t.charCodeAt(n);e<128?r[o++]=e:(e<2048?r[o++]=e>>6|192:(55296==(64512&e)&&n+1<t.length&&56320==(64512&t.charCodeAt(n+1))?(e=65536+((1023&e)<<10)+(1023&t.charCodeAt(++n)),r[o++]=e>>18|240,r[o++]=e>>12&63|128):r[o++]=e>>12|224,r[o++]=e>>6&63|128),r[o++]=63&e|128)}return r}(e),t)},decodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):function(e){const t=[];let r=0,o=0;for(;r<e.length;){var n,a,i=e[r++];i<128?t[o++]=String.fromCharCode(i):191<i&&i<224?(n=e[r++],t[o++]=String.fromCharCode((31&i)<<6|63&n)):239<i&&i<365?(a=((7&i)<<18|(63&e[r++])<<12|(63&e[r++])<<6|63&e[r++])-65536,t[o++]=String.fromCharCode(55296+(a>>10)),t[o++]=String.fromCharCode(56320+(1023&a))):(n=e[r++],a=e[r++],t[o++]=String.fromCharCode((15&i)<<12|(63&n)<<6|63&a))}return t.join("")}(this.decodeStringToByteArray(e,t))},decodeStringToByteArray(e,t){this.init_();var r=t?this.charToByteMapWebSafe_:this.charToByteMap_;const o=[];for(let c=0;c<e.length;){var n=r[e.charAt(c++)],a=c<e.length?r[e.charAt(c)]:0;++c;var i=c<e.length?r[e.charAt(c)]:64;++c;var s=c<e.length?r[e.charAt(c)]:64;if(++c,null==n||null==a||null==i||null==s)throw Error();o.push(n<<2|a>>4),64!==i&&(o.push(a<<4&240|i>>2),64!==s&&o.push(i<<6&192|s))}return o},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let e=0;e<this.ENCODED_VALS.length;e++)this.byteToCharMap_[e]=this.ENCODED_VALS.charAt(e),this.charToByteMap_[this.byteToCharMap_[e]]=e,this.byteToCharMapWebSafe_[e]=this.ENCODED_VALS_WEBSAFE.charAt(e),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[e]]=e,e>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(e)]=e,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(e)]=e)}}},i=function(e){try{return h.decodeString(e,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};class a{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}wrapCallback(r){return(e,t)=>{e?this.reject(e):this.resolve(t),"function"==typeof r&&(this.promise.catch(()=>{}),1===r.length?r(e):r(e,t))}}}function n(){return"object"==typeof indexedDB}class s extends Error{constructor(e,t,r){super(t),this.code=e,this.customData=r,this.name="FirebaseError",Object.setPrototypeOf(this,s.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,c.prototype.create)}}class c{constructor(e,t,r){this.service=e,this.serviceName=t,this.errors=r}create(e,...t){var o,r=t[0]||{},n=`${this.service}/${e}`,a=this.errors[e],a=a?(o=r,a.replace(l,(e,t)=>{var r=o[t];return null!=r?String(r):`<${t}?>`})):"Error",a=`${this.serviceName}: ${a} (${n}).`;return new s(n,a,r)}}const l=/\{\$([^}]+)}/g;function p(e){return JSON.parse(e)}function u(e){const t=function(e){let t={},r={},o={},n="";try{var a=e.split(".");t=p(i(a[0])||""),r=p(i(a[1])||""),n=a[2],o=r.d||{},delete r.d}catch(e){}return{header:t,claims:r,data:o,signature:n}}(e).claims;return"object"==typeof t&&t.hasOwnProperty("iat")?t.iat:null}const d=144e5,g=.5;class f{constructor(e,t,r){this.name=e,this.instanceFactory=t,this.type=r,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(e){return this.instantiationMode=e,this}setMultipleInstances(e){return this.multipleInstances=e,this}setServiceProps(e){return this.serviceProps=e,this}setInstanceCreatedCallback(e){return this.onInstanceCreated=e,this}}(r=t=t||{})[r.DEBUG=0]="DEBUG",r[r.VERBOSE=1]="VERBOSE",r[r.INFO=2]="INFO",r[r.WARN=3]="WARN",r[r.ERROR=4]="ERROR",r[r.SILENT=5]="SILENT";const v={debug:t.DEBUG,verbose:t.VERBOSE,info:t.INFO,warn:t.WARN,error:t.ERROR,silent:t.SILENT},E=t.INFO,m={[t.DEBUG]:"log",[t.VERBOSE]:"log",[t.INFO]:"info",[t.WARN]:"warn",[t.ERROR]:"error"},b=(e,t,...r)=>{if(!(t<e.logLevel)){var o=(new Date).toISOString(),n=m[t];if(!n)throw new Error(`Attempted to log a message with an invalid logType (value: ${t})`);console[n](`[${o}] ${e.name}:`,...r)}};const _=new Map,w={activated:!1,tokenObservers:[]},k={initialized:!1,enabled:!1};function y(e){return _.get(e)||w}function A(e,t){_.set(e,t)}const T="https://content-firebaseappcheck.googleapis.com/v1beta",C="exchangeDebugToken",S={OFFSET_DURATION:3e5,RETRIAL_MIN_WAIT:3e4,RETRIAL_MAX_WAIT:96e4};class O{constructor(e,t,r,o,n){if(this.operation=e,this.retryPolicy=t,this.getWaitDuration=r,this.lowerBound=o,this.upperBound=n,this.pending=null,n<(this.nextErrorWaitInterval=o))throw new Error("Proactive refresh lower bound greater than upper bound!")}start(){this.nextErrorWaitInterval=this.lowerBound,this.process(!0).catch(()=>{})}stop(){this.pending&&(this.pending.reject("cancelled"),this.pending=null)}isRunning(){return!!this.pending}async process(e){this.stop();try{this.pending=new a,t=this.getNextRun(e),await new Promise(e=>{setTimeout(e,t)}),this.pending.resolve(),await this.pending.promise,this.pending=new a,await this.operation(),this.pending.resolve(),await this.pending.promise,this.process(!0).catch(()=>{})}catch(e){this.retryPolicy(e)?this.process(!1).catch(()=>{}):this.stop()}var t}getNextRun(e){if(e)return this.nextErrorWaitInterval=this.lowerBound,this.getWaitDuration();var t=this.nextErrorWaitInterval;return this.nextErrorWaitInterval*=2,this.nextErrorWaitInterval>this.upperBound&&(this.nextErrorWaitInterval=this.upperBound),t}}const R=new c("appCheck","AppCheck",{"already-initialized":"You have already called initializeAppCheck() for FirebaseApp {$appName} with different options. To avoid this error, call initializeAppCheck() with the same options as when it was originally called. This will return the already initialized instance.","use-before-activation":"App Check is being used before initializeAppCheck() is called for FirebaseApp {$appName}. Call initializeAppCheck() before instantiating other Firebase services.","fetch-network-error":"Fetch failed to connect to a network. Check Internet connection. Original error: {$originalErrorMessage}.","fetch-parse-error":"Fetch client could not parse response. Original error: {$originalErrorMessage}.","fetch-status-error":"Fetch server returned an HTTP error status. HTTP status: {$httpStatus}.","storage-open":"Error thrown when opening storage. Original error: {$originalErrorMessage}.","storage-get":"Error thrown when reading from storage. Original error: {$originalErrorMessage}.","storage-set":"Error thrown when writing to storage. Original error: {$originalErrorMessage}.","recaptcha-error":"ReCAPTCHA error.",throttled:"Requests throttled due to {$httpStatus} error. Attempts allowed again after {$time}"});function P(e=!1){var t;return e?null===(t=self.grecaptcha)||void 0===t?void 0:t.enterprise:self.grecaptcha}function I(e){if(!y(e).activated)throw R.create("use-before-activation",{appName:e.name})}function D(e){var t=Math.round(e/1e3),r=Math.floor(t/86400),o=Math.floor((t-3600*r*24)/3600),n=Math.floor((t-3600*r*24-3600*o)/60),t=t-3600*r*24-3600*o-60*n;let a="";return r&&(a+=x(r)+"d:"),o&&(a+=x(o)+"h:"),a+=x(n)+"m:"+x(t)+"s",a}function x(e){return 0===e?"00":10<=e?e.toString():"0"+e}async function N({url:e,body:t},r){const o={"Content-Type":"application/json"},n=r.getImmediate({optional:!0});n&&(o["X-Firebase-Client"]=n.getPlatformInfoString());var a={method:"POST",body:JSON.stringify(t),headers:o};let i;try{i=await fetch(e,a)}catch(e){throw R.create("fetch-network-error",{originalErrorMessage:e.message})}if(200!==i.status)throw R.create("fetch-status-error",{httpStatus:i.status});let s;try{s=await i.json()}catch(e){throw R.create("fetch-parse-error",{originalErrorMessage:e.message})}var c=s.ttl.match(/^([\d.]+)(s)$/);if(!c||!c[2]||isNaN(Number(c[1])))throw R.create("fetch-parse-error",{originalErrorMessage:"ttl field (timeToLive) is not in standard Protobuf Duration "+`format: ${s.ttl}`});a=1e3*Number(c[1]),c=Date.now();return{token:s.attestationToken,expireTimeMillis:c+a,issuedAtTimeMillis:c}}const L="firebase-app-check-database",M=1,B="firebase-app-check-store",j="debug-token";let $=null;function H(){return $||($=new Promise((t,r)=>{try{const e=indexedDB.open(L,M);e.onsuccess=e=>{t(e.target.result)},e.onerror=e=>{var t;r(R.create("storage-open",{originalErrorMessage:null===(t=e.target.error)||void 0===t?void 0:t.message}))},e.onupgradeneeded=e=>{const t=e.target.result;0===e.oldVersion&&t.createObjectStore(B,{keyPath:"compositeKey"})}}catch(e){r(R.create("storage-open",{originalErrorMessage:e.message}))}}),$)}async function W(e,t){const r=await H(),o=r.transaction(B,"readwrite"),n=o.objectStore(B),a=n.put({compositeKey:e,value:t});return new Promise((t,r)=>{a.onsuccess=e=>{t()},o.onerror=e=>{var t;r(R.create("storage-set",{originalErrorMessage:null===(t=e.target.error)||void 0===t?void 0:t.message}))}})}async function F(e){const t=await H(),n=t.transaction(B,"readonly"),r=n.objectStore(B),a=r.get(e);return new Promise((r,o)=>{a.onsuccess=e=>{var t=e.target.result;r(t?t.value:void 0)},n.onerror=e=>{var t;o(R.create("storage-get",{originalErrorMessage:null===(t=e.target.error)||void 0===t?void 0:t.message}))}})}function V(e){return`${e.options.appId}-${e.name}`}const K=new class{constructor(e){this.name=e,this._logLevel=E,this._logHandler=b,this._userLogHandler=null}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in t))throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel="string"==typeof e?v[e]:e}get logHandler(){return this._logHandler}set logHandler(e){if("function"!=typeof e)throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e}get userLogHandler(){return this._userLogHandler}set userLogHandler(e){this._userLogHandler=e}debug(...e){this._userLogHandler&&this._userLogHandler(this,t.DEBUG,...e),this._logHandler(this,t.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,t.VERBOSE,...e),this._logHandler(this,t.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,t.INFO,...e),this._logHandler(this,t.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,t.WARN,...e),this._logHandler(this,t.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,t.ERROR,...e),this._logHandler(this,t.ERROR,...e)}}("@firebase/app-check");async function z(t){if(n()){let e=void 0;try{e=await F(V(t))}catch(e){K.warn(`Failed to read token from IndexedDB. Error: ${e}`)}return e}}function U(e,t){return n()?W(V(e),t).catch(e=>{K.warn(`Failed to write token to IndexedDB. Error: ${e}`)}):Promise.resolve()}async function q(){let e=void 0;try{e=await F(j)}catch(e){}if(e)return e;var t,r="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=16*Math.random()|0,r="x"===e?t:3&t|8;return r.toString(16)});return t=r,W(j,t).catch(e=>K.warn(`Failed to persist debug token to IndexedDB. Error: ${e}`)),r}function G(){return k.enabled}async function X(){var e=k;if(e.enabled&&e.token)return e.token.promise;throw Error(`
|
|
2
2
|
Can't get debug token in production mode.
|
|
3
|
-
`)}function J(){var e=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw new Error("Unable to locate global object.")}();const t=k;if(t.initialized=!0,"string"==typeof e.FIREBASE_APPCHECK_DEBUG_TOKEN||!0===e.FIREBASE_APPCHECK_DEBUG_TOKEN){t.enabled=!0;const r=new a;t.token=r,"string"==typeof e.FIREBASE_APPCHECK_DEBUG_TOKEN?r.resolve(e.FIREBASE_APPCHECK_DEBUG_TOKEN):r.resolve(q())}}const Y={error:"UNKNOWN_ERROR"};async function Z(e,t=!1){var r=e.app;I(r);const o=y(r);let n=o.token,a=void 0;if(n||(s=await o.cachedTokenPromise)&&oe(s)&&(n=s),!t&&n&&oe(n))return{token:n.token};let i=!1;if(G()){o.exchangeTokenPromise||(o.exchangeTokenPromise=N(function(e,t){var{projectId:r,appId:o,apiKey:n}=e.options;return{url:`${T}/projects/${r}/apps/${o}:${C}?key=${n}`,body:{debug_token:t}}}(r,await X()),e.platformLoggerProvider).then(e=>(o.exchangeTokenPromise=void 0,e)),i=!0);var s=await o.exchangeTokenPromise;return await U(r,s),A(r,Object.assign(Object.assign({},o),{token:s})),{token:s.token}}try{o.exchangeTokenPromise||(o.exchangeTokenPromise=o.provider.getToken().then(e=>(o.exchangeTokenPromise=void 0,e)),i=!0),n=await o.exchangeTokenPromise}catch(e){"appCheck/throttled"===e.code?K.warn(e.message):K.error(e),a=e}let c;return n?(c={token:n.token},A(r,Object.assign(Object.assign({},o),{token:n})),await U(r,n)):c=(e=a,{token:function(e){return h.encodeString(JSON.stringify(e),!1)}(Y),error:e}),i&&re(r,c),c}function Q(e,t,r,o){var n=e["app"];const a=y(n);var i={next:r,error:o,type:t};if(A(n,Object.assign(Object.assign({},a),{tokenObservers:[...a.tokenObservers,i]})),a.token&&oe(a.token)){const s=a.token;Promise.resolve().then(()=>{r({token:s.token}),te(e)}).catch(()=>{})}a.cachedTokenPromise.then(()=>te(e))}function ee(e,t){const r=y(e);var o=r.tokenObservers.filter(e=>e.next!==t);0===o.length&&r.tokenRefresher&&r.tokenRefresher.isRunning()&&r.tokenRefresher.stop(),A(e,Object.assign(Object.assign({},r),{tokenObservers:o}))}function te(e){var t=e["app"],r=y(t);let o=r.tokenRefresher;o||(o=function(r){const o=r["app"];return new O(async()=>{var e=y(o);let t;if(t=e.token?await Z(r,!0):await Z(r),t.error)throw t.error},()=>!0,()=>{var e=y(o);if(e.token){var t=e.token.issuedAtTimeMillis+.5*(e.token.expireTimeMillis-e.token.issuedAtTimeMillis)+3e5,e=e.token.expireTimeMillis-3e5,t=Math.min(t,e);return Math.max(0,t-Date.now())}return 0},S.RETRIAL_MIN_WAIT,S.RETRIAL_MAX_WAIT)}(e),A(t,Object.assign(Object.assign({},r),{tokenRefresher:o}))),!o.isRunning()&&r.isTokenAutoRefreshEnabled&&o.start()}function re(e,t){for(const r of y(e).tokenObservers)try{"EXTERNAL"===r.type&&null!=t.error?r.error(t.error):r.next(t)}catch(e){}}function oe(e){return 0<e.expireTimeMillis-Date.now()}class ne{constructor(e,t){this.app=e,this.platformLoggerProvider=t}_delete(){var e=y(this.app)["tokenObservers"];for(const t of e)ee(this.app,t.next);return Promise.resolve()}}const ae="https://www.google.com/recaptcha/api.js",ie="https://www.google.com/recaptcha/enterprise.js";function se(t,r){var e=y(t);const o=new a;A(t,Object.assign(Object.assign({},e),{reCAPTCHAState:{initialized:o}}));const n=le(t);e=P(!1);return e?he(t,r,e,n,o):function(e){const t=document.createElement("script");t.src=ae,t.onload=e,document.head.appendChild(t)}(()=>{var e=P(!1);if(!e)throw new Error("no recaptcha");he(t,r,e,n,o)}),o.promise}function ce(t,r){var e=y(t);const o=new a;A(t,Object.assign(Object.assign({},e),{reCAPTCHAState:{initialized:o}}));const n=le(t);e=P(!0);return e?he(t,r,e,n,o):function(e){const t=document.createElement("script");t.src=ie,t.onload=e,document.head.appendChild(t)}(()=>{var e=P(!0);if(!e)throw new Error("no recaptcha");he(t,r,e,n,o)}),o.promise}function he(o,n,a,i,s){a.ready(()=>{var e,t,r;e=o,t=a.render(i,{sitekey:n,size:"invisible"}),r=y(e),A(e,Object.assign(Object.assign({},r),{reCAPTCHAState:Object.assign(Object.assign({},r.reCAPTCHAState),{widgetId:t})})),s.resolve(a)})}function le(e){var t=`fire_app_check_${e.name}`;const r=document.createElement("div");return r.id=t,r.style.display="none",document.body.appendChild(r),t}async function pe(o){I(o);const n=await y(o).reCAPTCHAState.initialized.promise;return new Promise((e,t)=>{const r=y(o).reCAPTCHAState;n.ready(()=>{e(n.execute(r.widgetId,{action:"fire_app_check"}))})})}class ue{constructor(e){this._siteKey=e,this._throttleData=null}async getToken(){ve(this._throttleData);var t=await pe(this._app).catch(e=>{throw R.create("recaptcha-error")});let e;try{e=await N(function(e,t){var{projectId:r,appId:o,apiKey:n}=e.options;return{url:`${T}/projects/${r}/apps/${o}:exchangeRecaptchaToken?key=${n}`,body:{recaptcha_token:t}}}(this._app,t),this._platformLoggerProvider)}catch(e){throw"fetch-status-error"===e.code?(this._throttleData=fe(Number(null===(t=e.customData)||void 0===t?void 0:t.httpStatus),this._throttleData),R.create("throttled",{time:D(this._throttleData.allowRequestsAfter-Date.now()),httpStatus:this._throttleData.httpStatus})):e}return this._throttleData=null,e}initialize(e){this._app=e,this._platformLoggerProvider=ye._getProvider(e,"platform-logger"),se(e,this._siteKey).catch(()=>{})}isEqual(e){return e instanceof ue&&this._siteKey===e._siteKey}}class de{constructor(e){this._siteKey=e,this._throttleData=null}async getToken(){ve(this._throttleData);var t=await pe(this._app).catch(e=>{throw R.create("recaptcha-error")});let e;try{e=await N(function(e,t){var{projectId:r,appId:o,apiKey:n}=e.options;return{url:`${T}/projects/${r}/apps/${o}:exchangeRecaptchaEnterpriseToken?key=${n}`,body:{recaptcha_enterprise_token:t}}}(this._app,t),this._platformLoggerProvider)}catch(e){throw"fetch-status-error"===e.code?(this._throttleData=fe(Number(null===(t=e.customData)||void 0===t?void 0:t.httpStatus),this._throttleData),R.create("throttled",{time:D(this._throttleData.allowRequestsAfter-Date.now()),httpStatus:this._throttleData.httpStatus})):e}return this._throttleData=null,e}initialize(e){this._app=e,this._platformLoggerProvider=ye._getProvider(e,"platform-logger"),ce(e,this._siteKey).catch(()=>{})}isEqual(e){return e instanceof de&&this._siteKey===e._siteKey}}class ge{constructor(e){this._customProviderOptions=e}async getToken(){var e=await this._customProviderOptions.getToken(),t=u(e.token),t=null!==t&&t<Date.now()&&0<t?1e3*t:Date.now();return Object.assign(Object.assign({},e),{issuedAtTimeMillis:t})}initialize(e){this._app=e}isEqual(e){return e instanceof ge&&this._customProviderOptions.getToken.toString()===e._customProviderOptions.getToken.toString()}}function fe(e,t){if(404===e||403===e)return{backoffCount:1,allowRequestsAfter:Date.now()+864e5,httpStatus:e};var r,o,n=t?t.backoffCount:0,o=(t=2,r=1e3*Math.pow(t,n),o=Math.round(g*r*(Math.random()-.5)*2),Math.min(d,r+o));return{backoffCount:n+1,allowRequestsAfter:Date.now()+o,httpStatus:e}}function ve(e){if(e&&Date.now()-e.allowRequestsAfter<=0)throw R.create("throttled",{time:D(e.allowRequestsAfter-Date.now()),httpStatus:e.httpStatus})}function Ee(e=ye.getApp(),t){var r;e=(r=e)&&r._delegate?r._delegate:r;const o=ye._getProvider(e,"app-check");if(k.initialized||J(),G()&&X().then(e=>console.log(`App Check debug token: ${e}. You will need to add it to your app's App Check settings in the Firebase console for it to work.`)),o.isInitialized()){var n=o.getImmediate();const a=o.getOptions();if(a.isTokenAutoRefreshEnabled===t.isTokenAutoRefreshEnabled&&a.provider.isEqual(t.provider))return n;throw R.create("already-initialized",{appName:e.name})}n=o.initialize({options:t});return function(t,e,r){const o=y(t),n=Object.assign(Object.assign({},o),{activated:!0});n.provider=e,n.cachedTokenPromise=z(t).then(e=>(e&&oe(e)&&(A(t,Object.assign(Object.assign({},y(t)),{token:e})),re(t,{token:e.token})),e)),n.isTokenAutoRefreshEnabled=void 0===r?t.automaticDataCollectionEnabled:r,A(t,n),n.provider.initialize(t)}(e,t.provider,t.isTokenAutoRefreshEnabled),y(e).isTokenAutoRefreshEnabled&&Q(n,"INTERNAL",()=>{}),n}const me="app-check-internal";ye._registerComponent(new f("app-check",e=>{var t,r=e.getProvider("app").getImmediate(),o=e.getProvider("platform-logger");return t=r,e=o,new ne(t,e)},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((e,t,r)=>{e.getProvider(me).initialize()})),ye._registerComponent(new f(me,e=>{var t,r=e.getProvider("app-check").getImmediate();return t=r,{getToken:e=>Z(t,e),addTokenListener:e=>Q(t,"INTERNAL",e),removeTokenListener:e=>ee(t.app,e)}},"PUBLIC").setInstantiationMode("EXPLICIT")),ye.registerVersion("@firebase/app-check","0.5.3-canary.044a8d7f9");const be=new c("appCheck","AppCheck",{"use-before-activation":"App Check is being used before activate() is called for FirebaseApp {$appName}. Call activate() before instantiating other Firebase services."});class _e{constructor(e){this.app=e}activate(e,t){let r;r="string"==typeof e?new ue(e):e instanceof de||e instanceof ue||e instanceof ge?e:new ge({getToken:e.getToken}),this._delegate=Ee(this.app,{provider:r,isTokenAutoRefreshEnabled:t})}setTokenAutoRefreshEnabled(e){if(!this._delegate)throw be.create("use-before-activation",{appName:this.app.name});!function(e,t){var r=e.app;const o=y(r);o.tokenRefresher&&(!0===t?o.tokenRefresher.start():o.tokenRefresher.stop()),A(r,Object.assign(Object.assign({},o),{isTokenAutoRefreshEnabled:t}))}(this._delegate,e)}getToken(e){if(!this._delegate)throw be.create("use-before-activation",{appName:this.app.name});return async function(e,t){var r=await Z(e,t);if(r.error)throw r.error;return{token:r.token}}(this._delegate,e)}onTokenChanged(e,t,r){if(!this._delegate)throw be.create("use-before-activation",{appName:this.app.name});return function(e,t,r){let o=()=>{},n=()=>{};return o=null!=t.next?t.next.bind(t):t,null!=t.error?n=t.error.bind(t):r&&(n=r),Q(e,"EXTERNAL",o,n),()=>ee(e.app,o)}(this._delegate,e,t)}}const we=e=>{var t=e.getProvider("app-compat").getImmediate();return new _e(t)};o.default.INTERNAL.registerComponent(new f("appCheck-compat",we,"PUBLIC").setServiceProps({ReCaptchaEnterpriseProvider:de,ReCaptchaV3Provider:ue,CustomProvider:ge})),o.default.registerVersion("@firebase/app-check-compat","0.2.3-canary.044a8d7f9")}).apply(this,arguments)}catch(e){throw console.error(e),new Error("Cannot instantiate firebase-app-check-compat.js - be sure to load firebase-app.js first.")}});
|
|
3
|
+
`)}function J(){var e=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw new Error("Unable to locate global object.")}();const t=k;if(t.initialized=!0,"string"==typeof e.FIREBASE_APPCHECK_DEBUG_TOKEN||!0===e.FIREBASE_APPCHECK_DEBUG_TOKEN){t.enabled=!0;const r=new a;t.token=r,"string"==typeof e.FIREBASE_APPCHECK_DEBUG_TOKEN?r.resolve(e.FIREBASE_APPCHECK_DEBUG_TOKEN):r.resolve(q())}}const Y={error:"UNKNOWN_ERROR"};async function Z(e,t=!1){var r=e.app;I(r);const o=y(r);let n=o.token,a=void 0;if(n||(s=await o.cachedTokenPromise)&&oe(s)&&(n=s),!t&&n&&oe(n))return{token:n.token};let i=!1;if(G()){o.exchangeTokenPromise||(o.exchangeTokenPromise=N(function(e,t){var{projectId:r,appId:o,apiKey:n}=e.options;return{url:`${T}/projects/${r}/apps/${o}:${C}?key=${n}`,body:{debug_token:t}}}(r,await X()),e.platformLoggerProvider).then(e=>(o.exchangeTokenPromise=void 0,e)),i=!0);var s=await o.exchangeTokenPromise;return await U(r,s),A(r,Object.assign(Object.assign({},o),{token:s})),{token:s.token}}try{o.exchangeTokenPromise||(o.exchangeTokenPromise=o.provider.getToken().then(e=>(o.exchangeTokenPromise=void 0,e)),i=!0),n=await o.exchangeTokenPromise}catch(e){"appCheck/throttled"===e.code?K.warn(e.message):K.error(e),a=e}let c;return n?(c={token:n.token},A(r,Object.assign(Object.assign({},o),{token:n})),await U(r,n)):c=(e=a,{token:function(e){return h.encodeString(JSON.stringify(e),!1)}(Y),error:e}),i&&re(r,c),c}function Q(e,t,r,o){var n=e["app"];const a=y(n);var i={next:r,error:o,type:t};if(A(n,Object.assign(Object.assign({},a),{tokenObservers:[...a.tokenObservers,i]})),a.token&&oe(a.token)){const s=a.token;Promise.resolve().then(()=>{r({token:s.token}),te(e)}).catch(()=>{})}a.cachedTokenPromise.then(()=>te(e))}function ee(e,t){const r=y(e);var o=r.tokenObservers.filter(e=>e.next!==t);0===o.length&&r.tokenRefresher&&r.tokenRefresher.isRunning()&&r.tokenRefresher.stop(),A(e,Object.assign(Object.assign({},r),{tokenObservers:o}))}function te(e){var t=e["app"],r=y(t);let o=r.tokenRefresher;o||(o=function(r){const o=r["app"];return new O(async()=>{var e=y(o);let t;if(t=e.token?await Z(r,!0):await Z(r),t.error)throw t.error},()=>!0,()=>{var e=y(o);if(e.token){var t=e.token.issuedAtTimeMillis+.5*(e.token.expireTimeMillis-e.token.issuedAtTimeMillis)+3e5,e=e.token.expireTimeMillis-3e5,t=Math.min(t,e);return Math.max(0,t-Date.now())}return 0},S.RETRIAL_MIN_WAIT,S.RETRIAL_MAX_WAIT)}(e),A(t,Object.assign(Object.assign({},r),{tokenRefresher:o}))),!o.isRunning()&&r.isTokenAutoRefreshEnabled&&o.start()}function re(e,t){for(const r of y(e).tokenObservers)try{"EXTERNAL"===r.type&&null!=t.error?r.error(t.error):r.next(t)}catch(e){}}function oe(e){return 0<e.expireTimeMillis-Date.now()}class ne{constructor(e,t){this.app=e,this.platformLoggerProvider=t}_delete(){var e=y(this.app)["tokenObservers"];for(const t of e)ee(this.app,t.next);return Promise.resolve()}}const ae="https://www.google.com/recaptcha/api.js",ie="https://www.google.com/recaptcha/enterprise.js";function se(t,r){var e=y(t);const o=new a;A(t,Object.assign(Object.assign({},e),{reCAPTCHAState:{initialized:o}}));const n=le(t);e=P(!1);return e?he(t,r,e,n,o):function(e){const t=document.createElement("script");t.src=ae,t.onload=e,document.head.appendChild(t)}(()=>{var e=P(!1);if(!e)throw new Error("no recaptcha");he(t,r,e,n,o)}),o.promise}function ce(t,r){var e=y(t);const o=new a;A(t,Object.assign(Object.assign({},e),{reCAPTCHAState:{initialized:o}}));const n=le(t);e=P(!0);return e?he(t,r,e,n,o):function(e){const t=document.createElement("script");t.src=ie,t.onload=e,document.head.appendChild(t)}(()=>{var e=P(!0);if(!e)throw new Error("no recaptcha");he(t,r,e,n,o)}),o.promise}function he(o,n,a,i,s){a.ready(()=>{var e,t,r;e=o,t=a.render(i,{sitekey:n,size:"invisible"}),r=y(e),A(e,Object.assign(Object.assign({},r),{reCAPTCHAState:Object.assign(Object.assign({},r.reCAPTCHAState),{widgetId:t})})),s.resolve(a)})}function le(e){var t=`fire_app_check_${e.name}`;const r=document.createElement("div");return r.id=t,r.style.display="none",document.body.appendChild(r),t}async function pe(o){I(o);const n=await y(o).reCAPTCHAState.initialized.promise;return new Promise((e,t)=>{const r=y(o).reCAPTCHAState;n.ready(()=>{e(n.execute(r.widgetId,{action:"fire_app_check"}))})})}class ue{constructor(e){this._siteKey=e,this._throttleData=null}async getToken(){ve(this._throttleData);var t=await pe(this._app).catch(e=>{throw R.create("recaptcha-error")});let e;try{e=await N(function(e,t){var{projectId:r,appId:o,apiKey:n}=e.options;return{url:`${T}/projects/${r}/apps/${o}:exchangeRecaptchaToken?key=${n}`,body:{recaptcha_token:t}}}(this._app,t),this._platformLoggerProvider)}catch(e){throw"fetch-status-error"===e.code?(this._throttleData=fe(Number(null===(t=e.customData)||void 0===t?void 0:t.httpStatus),this._throttleData),R.create("throttled",{time:D(this._throttleData.allowRequestsAfter-Date.now()),httpStatus:this._throttleData.httpStatus})):e}return this._throttleData=null,e}initialize(e){this._app=e,this._platformLoggerProvider=ye._getProvider(e,"platform-logger"),se(e,this._siteKey).catch(()=>{})}isEqual(e){return e instanceof ue&&this._siteKey===e._siteKey}}class de{constructor(e){this._siteKey=e,this._throttleData=null}async getToken(){ve(this._throttleData);var t=await pe(this._app).catch(e=>{throw R.create("recaptcha-error")});let e;try{e=await N(function(e,t){var{projectId:r,appId:o,apiKey:n}=e.options;return{url:`${T}/projects/${r}/apps/${o}:exchangeRecaptchaEnterpriseToken?key=${n}`,body:{recaptcha_enterprise_token:t}}}(this._app,t),this._platformLoggerProvider)}catch(e){throw"fetch-status-error"===e.code?(this._throttleData=fe(Number(null===(t=e.customData)||void 0===t?void 0:t.httpStatus),this._throttleData),R.create("throttled",{time:D(this._throttleData.allowRequestsAfter-Date.now()),httpStatus:this._throttleData.httpStatus})):e}return this._throttleData=null,e}initialize(e){this._app=e,this._platformLoggerProvider=ye._getProvider(e,"platform-logger"),ce(e,this._siteKey).catch(()=>{})}isEqual(e){return e instanceof de&&this._siteKey===e._siteKey}}class ge{constructor(e){this._customProviderOptions=e}async getToken(){var e=await this._customProviderOptions.getToken(),t=u(e.token),t=null!==t&&t<Date.now()&&0<t?1e3*t:Date.now();return Object.assign(Object.assign({},e),{issuedAtTimeMillis:t})}initialize(e){this._app=e}isEqual(e){return e instanceof ge&&this._customProviderOptions.getToken.toString()===e._customProviderOptions.getToken.toString()}}function fe(e,t){if(404===e||403===e)return{backoffCount:1,allowRequestsAfter:Date.now()+864e5,httpStatus:e};var r,o,n=t?t.backoffCount:0,o=(t=2,r=1e3*Math.pow(t,n),o=Math.round(g*r*(Math.random()-.5)*2),Math.min(d,r+o));return{backoffCount:n+1,allowRequestsAfter:Date.now()+o,httpStatus:e}}function ve(e){if(e&&Date.now()-e.allowRequestsAfter<=0)throw R.create("throttled",{time:D(e.allowRequestsAfter-Date.now()),httpStatus:e.httpStatus})}function Ee(e=ye.getApp(),t){var r;e=(r=e)&&r._delegate?r._delegate:r;const o=ye._getProvider(e,"app-check");if(k.initialized||J(),G()&&X().then(e=>console.log(`App Check debug token: ${e}. You will need to add it to your app's App Check settings in the Firebase console for it to work.`)),o.isInitialized()){var n=o.getImmediate();const a=o.getOptions();if(a.isTokenAutoRefreshEnabled===t.isTokenAutoRefreshEnabled&&a.provider.isEqual(t.provider))return n;throw R.create("already-initialized",{appName:e.name})}n=o.initialize({options:t});return function(t,e,r){const o=y(t),n=Object.assign(Object.assign({},o),{activated:!0});n.provider=e,n.cachedTokenPromise=z(t).then(e=>(e&&oe(e)&&(A(t,Object.assign(Object.assign({},y(t)),{token:e})),re(t,{token:e.token})),e)),n.isTokenAutoRefreshEnabled=void 0===r?t.automaticDataCollectionEnabled:r,A(t,n),n.provider.initialize(t)}(e,t.provider,t.isTokenAutoRefreshEnabled),y(e).isTokenAutoRefreshEnabled&&Q(n,"INTERNAL",()=>{}),n}const me="app-check-internal";ye._registerComponent(new f("app-check",e=>{var t,r=e.getProvider("app").getImmediate(),o=e.getProvider("platform-logger");return t=r,e=o,new ne(t,e)},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((e,t,r)=>{e.getProvider(me).initialize()})),ye._registerComponent(new f(me,e=>{var t,r=e.getProvider("app-check").getImmediate();return t=r,{getToken:e=>Z(t,e),addTokenListener:e=>Q(t,"INTERNAL",e),removeTokenListener:e=>ee(t.app,e)}},"PUBLIC").setInstantiationMode("EXPLICIT")),ye.registerVersion("@firebase/app-check","0.5.3-canary.88d43ec00");const be=new c("appCheck","AppCheck",{"use-before-activation":"App Check is being used before activate() is called for FirebaseApp {$appName}. Call activate() before instantiating other Firebase services."});class _e{constructor(e){this.app=e}activate(e,t){let r;r="string"==typeof e?new ue(e):e instanceof de||e instanceof ue||e instanceof ge?e:new ge({getToken:e.getToken}),this._delegate=Ee(this.app,{provider:r,isTokenAutoRefreshEnabled:t})}setTokenAutoRefreshEnabled(e){if(!this._delegate)throw be.create("use-before-activation",{appName:this.app.name});!function(e,t){var r=e.app;const o=y(r);o.tokenRefresher&&(!0===t?o.tokenRefresher.start():o.tokenRefresher.stop()),A(r,Object.assign(Object.assign({},o),{isTokenAutoRefreshEnabled:t}))}(this._delegate,e)}getToken(e){if(!this._delegate)throw be.create("use-before-activation",{appName:this.app.name});return async function(e,t){var r=await Z(e,t);if(r.error)throw r.error;return{token:r.token}}(this._delegate,e)}onTokenChanged(e,t,r){if(!this._delegate)throw be.create("use-before-activation",{appName:this.app.name});return function(e,t,r){let o=()=>{},n=()=>{};return o=null!=t.next?t.next.bind(t):t,null!=t.error?n=t.error.bind(t):r&&(n=r),Q(e,"EXTERNAL",o,n),()=>ee(e.app,o)}(this._delegate,e,t)}}const we=e=>{var t=e.getProvider("app-compat").getImmediate();return new _e(t)};o.default.INTERNAL.registerComponent(new f("appCheck-compat",we,"PUBLIC").setServiceProps({ReCaptchaEnterpriseProvider:de,ReCaptchaV3Provider:ue,CustomProvider:ge})),o.default.registerVersion("@firebase/app-check-compat","0.2.3-canary.88d43ec00")}).apply(this,arguments)}catch(e){throw console.error(e),new Error("Cannot instantiate firebase-app-check-compat.js - be sure to load firebase-app.js first.")}});
|
|
4
4
|
//# sourceMappingURL=firebase-app-check-compat.js.map
|
package/firebase-app-check.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _getProvider, getApp, _registerComponent, registerVersion } from 'https://www.gstatic.com/firebasejs/9.6.2-canary.
|
|
1
|
+
import { _getProvider, getApp, _registerComponent, registerVersion } from 'https://www.gstatic.com/firebasejs/9.6.2-canary.88d43ec00/firebase-app.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* @license
|
|
@@ -1381,7 +1381,7 @@ function computeKey(app) {
|
|
|
1381
1381
|
* See the License for the specific language governing permissions and
|
|
1382
1382
|
* limitations under the License.
|
|
1383
1383
|
*/
|
|
1384
|
-
const logger = new Logger('https://www.gstatic.com/firebasejs/9.6.2-canary.
|
|
1384
|
+
const logger = new Logger('https://www.gstatic.com/firebasejs/9.6.2-canary.88d43ec00/firebase-app.js-check');
|
|
1385
1385
|
|
|
1386
1386
|
/**
|
|
1387
1387
|
* @license
|
|
@@ -1817,8 +1817,8 @@ function internalFactory(appCheck) {
|
|
|
1817
1817
|
};
|
|
1818
1818
|
}
|
|
1819
1819
|
|
|
1820
|
-
const name = "https://www.gstatic.com/firebasejs/9.6.2-canary.
|
|
1821
|
-
const version = "0.5.3-canary.
|
|
1820
|
+
const name = "https://www.gstatic.com/firebasejs/9.6.2-canary.88d43ec00/firebase-app.js-check";
|
|
1821
|
+
const version = "0.5.3-canary.88d43ec00";
|
|
1822
1822
|
|
|
1823
1823
|
/**
|
|
1824
1824
|
* @license
|
|
@@ -2226,7 +2226,7 @@ function throwIfThrottled(throttleData) {
|
|
|
2226
2226
|
*/
|
|
2227
2227
|
/**
|
|
2228
2228
|
* Activate App Check for the given app. Can be called only once per app.
|
|
2229
|
-
* @param app - the {@link https://www.gstatic.com/firebasejs/9.6.2-canary.
|
|
2229
|
+
* @param app - the {@link https://www.gstatic.com/firebasejs/9.6.2-canary.88d43ec00/firebase-app.js#FirebaseApp} to activate App Check for
|
|
2230
2230
|
* @param options - App Check initialization options
|
|
2231
2231
|
* @public
|
|
2232
2232
|
*/
|
package/firebase-app-compat.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
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";function c(e,t){if(!(t instanceof Object))return t;switch(t.constructor){case Date:const i=t;return new Date(i.getTime());case Object:void 0===e&&(e={});break;case Array:e=[];break;default:return t}for(const r in t)t.hasOwnProperty(r)&&"__proto__"!==r&&(e[r]=c(e[r],t[r]));return e}class n{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}wrapCallback(i){return(e,t)=>{e?this.reject(e):this.resolve(t),"function"==typeof i&&(this.promise.catch(()=>{}),1===i.length?i(e):i(e,t))}}}class a extends Error{constructor(e,t,i){super(t),this.code=e,this.customData=i,this.name="FirebaseError",Object.setPrototypeOf(this,a.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,r.prototype.create)}}class r{constructor(e,t,i){this.service=e,this.serviceName=t,this.errors=i}create(e,...t){var r,i=t[0]||{},n=`${this.service}/${e}`,s=this.errors[e],s=s?(r=i,s.replace(o,(e,t)=>{var i=r[t];return null!=i?String(i):`<${t}?>`})):"Error",s=`${this.serviceName}: ${s} (${n}).`;return new a(n,s,i)}}const o=/\{\$([^}]+)}/g;function l(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function h(e,t){if(e===t)return 1;const i=Object.keys(e),r=Object.keys(t);for(const a of i){if(!r.includes(a))return;var n=e[a],s=t[a];if(p(n)&&p(s)){if(!h(n,s))return}else if(n!==s)return}for(const o of r)if(!i.includes(o))return;return 1}function p(e){return null!==e&&"object"==typeof e}function i(e,t){const i=new s(e,t);return i.subscribe.bind(i)}class s{constructor(e,t){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=t,this.task.then(()=>{e(this)}).catch(e=>{this.error(e)})}next(t){this.forEachObserver(e=>{e.next(t)})}error(t){this.forEachObserver(e=>{e.error(t)}),this.close(t)}complete(){this.forEachObserver(e=>{e.complete()}),this.close()}subscribe(e,t,i){let r;if(void 0===e&&void 0===t&&void 0===i)throw new Error("Missing Observer.");r=function(e,t){if("object"!=typeof e||null===e)return!1;for(const i of t)if(i in e&&"function"==typeof e[i])return!0;return!1}(e,["next","error","complete"])?e:{next:e,error:t,complete:i},void 0===r.next&&(r.next=f),void 0===r.error&&(r.error=f),void 0===r.complete&&(r.complete=f);var n=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?r.error(this.finalError):r.complete()}catch(e){}}),this.observers.push(r),n}unsubscribeOne(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))}forEachObserver(t){if(!this.finalized)for(let e=0;e<this.observers.length;e++)this.sendOne(e,t)}sendOne(e,t){this.task.then(()=>{if(void 0!==this.observers&&void 0!==this.observers[e])try{t(this.observers[e])}catch(e){"undefined"!=typeof console&&console.error&&console.error(e)}})}close(e){this.finalized||(this.finalized=!0,void 0!==e&&(this.finalError=e),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}}function f(){}class d{constructor(e,t,i){this.name=e,this.instanceFactory=t,this.type=i,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(e){return this.instantiationMode=e,this}setMultipleInstances(e){return this.multipleInstances=e,this}setServiceProps(e){return this.serviceProps=e,this}setInstanceCreatedCallback(e){return this.onInstanceCreated=e,this}}const u="[DEFAULT]";class m{constructor(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}get(e){var t=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(t)){const r=new n;if(this.instancesDeferred.set(t,r),this.isInitialized(t)||this.shouldAutoInitialize())try{var i=this.getOrInitializeService({instanceIdentifier:t});i&&r.resolve(i)}catch(e){}}return this.instancesDeferred.get(t).promise}getImmediate(e){var t=this.normalizeInstanceIdentifier(null==e?void 0:e.identifier),i=null!==(i=null==e?void 0:e.optional)&&void 0!==i&&i;if(!this.isInitialized(t)&&!this.shouldAutoInitialize()){if(i)return null;throw Error(`Service ${this.name} is not available`)}try{return this.getOrInitializeService({instanceIdentifier:t})}catch(e){if(i)return null;throw e}}getComponent(){return this.component}setComponent(e){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:u})}catch(e){}for(var[t,i]of this.instancesDeferred.entries()){t=this.normalizeInstanceIdentifier(t);try{var r=this.getOrInitializeService({instanceIdentifier:t});i.resolve(r)}catch(e){}}}}clearInstance(e=u){this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}async delete(){const e=Array.from(this.instances.values());await Promise.all([...e.filter(e=>"INTERNAL"in e).map(e=>e.INTERNAL.delete()),...e.filter(e=>"_delete"in e).map(e=>e._delete())])}isComponentSet(){return null!=this.component}isInitialized(e=u){return this.instances.has(e)}getOptions(e=u){return this.instancesOptions.get(e)||{}}initialize(e={}){var{options:t={}}=e,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 r,n,s=this.getOrInitializeService({instanceIdentifier:i,options:t});for([r,n]of this.instancesDeferred.entries())i===this.normalizeInstanceIdentifier(r)&&n.resolve(s);return s}onInit(e,t){var i=this.normalizeInstanceIdentifier(t);const r=null!==(n=this.onInitCallbacks.get(i))&&void 0!==n?n:new Set;r.add(e),this.onInitCallbacks.set(i,r);var n=this.instances.get(i);return n&&e(n,i),()=>{r.delete(e)}}invokeOnInitCallbacks(e,t){var i=this.onInitCallbacks.get(t);if(i)for(const r of i)try{r(e,t)}catch(e){}}getOrInitializeService({instanceIdentifier:e,options:t={}}){let i=this.instances.get(e);if(!i&&this.component&&(i=this.component.instanceFactory(this.container,{instanceIdentifier:(r=e)===u?void 0:r,options:t}),this.instances.set(e,i),this.instancesOptions.set(e,t),this.invokeOnInitCallbacks(i,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,i)}catch(e){}var r;return i||null}normalizeInstanceIdentifier(e=u){return!this.component||this.component.multipleInstances?e:u}shouldAutoInitialize(){return!!this.component&&"EXPLICIT"!==this.component.instantiationMode}}class g{constructor(e){this.name=e,this.providers=new Map}addComponent(e){const t=this.getProvider(e.name);if(t.isComponentSet())throw new Error(`Component ${e.name} has already been registered with ${this.name}`);t.setComponent(e)}addOrOverwriteComponent(e){const t=this.getProvider(e.name);t.isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)}getProvider(e){if(this.providers.has(e))return this.providers.get(e);var t=new m(e,this);return this.providers.set(e,t),t}getProviders(){return Array.from(this.providers.values())}}const v=[];var b,e;(e=b=b||{})[e.DEBUG=0]="DEBUG",e[e.VERBOSE=1]="VERBOSE",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR",e[e.SILENT=5]="SILENT";const I={debug:b.DEBUG,verbose:b.VERBOSE,info:b.INFO,warn:b.WARN,error:b.ERROR,silent:b.SILENT},t=b.INFO,y={[b.DEBUG]:"log",[b.VERBOSE]:"log",[b.INFO]:"info",[b.WARN]:"warn",[b.ERROR]:"error"},E=(e,t,...i)=>{if(!(t<e.logLevel)){var r=(new Date).toISOString(),n=y[t];if(!n)throw new Error(`Attempted to log a message with an invalid logType (value: ${t})`);console[n](`[${r}] ${e.name}:`,...i)}};class _{constructor(e){this.name=e,this._logLevel=t,this._logHandler=E,this._userLogHandler=null,v.push(this)}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in b))throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel="string"==typeof e?I[e]:e}get logHandler(){return this._logHandler}set logHandler(e){if("function"!=typeof e)throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e}get userLogHandler(){return this._userLogHandler}set userLogHandler(e){this._userLogHandler=e}debug(...e){this._userLogHandler&&this._userLogHandler(this,b.DEBUG,...e),this._logHandler(this,b.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,b.VERBOSE,...e),this._logHandler(this,b.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,b.INFO,...e),this._logHandler(this,b.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,b.WARN,...e),this._logHandler(this,b.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,b.ERROR,...e),this._logHandler(this,b.ERROR,...e)}}class O{constructor(e){this.container=e}getPlatformInfoString(){const e=this.container.getProviders();return e.map(e=>{if("VERSION"!==(null==(t=e.getComponent())?void 0:t.type))return null;var t,t=e.getImmediate();return`${t.library}/${t.version}`}).filter(e=>e).join(" ")}}const w="@firebase/app",C="0.7.12-canary.044a8d7f9",N=new _("@firebase/app");var L;const A="[DEFAULT]",D={"@firebase/app":"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,R=new Map;function $(t,i){try{t.container.addComponent(i)}catch(e){N.debug(`Component ${i.name} failed to register with FirebaseApp ${t.name}`,e)}}function k(e,t){e.container.addOrOverwriteComponent(t)}function P(e){var t=e.name;if(R.has(t))return N.debug(`There were multiple attempts to register component ${t}.`),!1;R.set(t,e);for(const i of S.values())$(i,e);return!0}function z(e,t){return e.container.getProvider(t)}const F=new r("app","Firebase",{"no-app":"No Firebase App '{$appName}' has been created - call Firebase App.initializeApp()","bad-app-name":"Illegal App name: '{$appName}","duplicate-app":"Firebase App named '{$appName}' already exists with different options or config","app-deleted":"Firebase App named '{$appName}' already deleted","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invalid-log-argument":"First argument to `onLog` must be null or a function."});class j{constructor(e,t,i){this._isDeleted=!1,this._options=Object.assign({},e),this._config=Object.assign({},t),this._name=t.name,this._automaticDataCollectionEnabled=t.automaticDataCollectionEnabled,this._container=i,this.container.addComponent(new d("app",()=>this,"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(e){this.checkDestroyed(),this._automaticDataCollectionEnabled=e}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(e){this._isDeleted=e}checkDestroyed(){if(this.isDeleted)throw F.create("app-deleted",{appName:this._name})}}const H="9.6.2-canary.044a8d7f9";function T(e,t={}){if("object"!=typeof t){const r=t;t={name:r}}var i=Object.assign({name:A,automaticDataCollectionEnabled:!1},t);const r=i.name;if("string"!=typeof r||!r)throw F.create("bad-app-name",{appName:String(r)});var n=S.get(r);if(n){if(h(e,n.options)&&h(i,n.config))return n;throw F.create("duplicate-app",{appName:r})}const s=new g(r);for(const a of R.values())s.addComponent(a);i=new j(e,i,s);return S.set(r,i),i}async function M(e){var t=e.name;S.has(t)&&(S.delete(t),await Promise.all(e.container.getProviders().map(e=>e.delete())),e.isDeleted=!0)}function B(e,t,i){let r=null!==(s=D[e])&&void 0!==s?s:e;i&&(r+=`-${i}`);var n=r.match(/\s|\//),s=t.match(/\s|\//);if(n||s){const a=[`Unable to register library "${r}" with version "${t}":`];return n&&a.push(`library name "${r}" contains illegal characters (whitespace or "/")`),n&&s&&a.push("and"),s&&a.push(`version name "${t}" contains illegal characters (whitespace or "/")`),void N.warn(a.join(" "))}P(new d(`${r}-version`,()=>({library:r,version:t}),"VERSION"))}function V(e,t){if(null!==e&&"function"!=typeof e)throw F.create("invalid-log-argument");!function(s,e){for(const t of v){let n=null;e&&e.level&&(n=I[e.level]),t.userLogHandler=null===s?null:(e,t,...i)=>{var r=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(" ");t>=(null!==n&&void 0!==n?n:e.logLevel)&&s({level:b[t].toLowerCase(),message:r,args:i,type:e.name})}}}(e,t)}function U(e){var t;t=e,v.forEach(e=>{e.setLogLevel(t)})}L="",P(new d("platform-logger",e=>new O(e),"PRIVATE")),B(w,C,L),B(w,C,"esm2017"),B("fire-js","");var x=Object.freeze({__proto__:null,SDK_VERSION:H,_DEFAULT_ENTRY_NAME:A,_addComponent:$,_addOrOverwriteComponent:k,_apps:S,_clearComponents:function(){R.clear()},_components:R,_getProvider:z,_registerComponent:P,_removeServiceInstance:function(e,t,i=A){z(e,t).clearInstance(i)},deleteApp:M,getApp:function(e=A){var t=S.get(e);if(!t)throw F.create("no-app",{appName:e});return t},getApps:function(){return Array.from(S.values())},initializeApp:T,onLog:V,registerVersion:B,setLogLevel:U,FirebaseError:a});class W{constructor(e,t){this._delegate=e,this.firebase=t,$(e,new d("app-compat",()=>this,"PUBLIC")),this.container=e.container}get automaticDataCollectionEnabled(){return this._delegate.automaticDataCollectionEnabled}set automaticDataCollectionEnabled(e){this._delegate.automaticDataCollectionEnabled=e}get name(){return this._delegate.name}get options(){return this._delegate.options}delete(){return new Promise(e=>{this._delegate.checkDestroyed(),e()}).then(()=>(this.firebase.INTERNAL.removeApp(this.name),M(this._delegate)))}_getService(e,t=A){var i;this._delegate.checkDestroyed();const r=this._delegate.container.getProvider(e);return r.isInitialized()||"EXPLICIT"!==(null===(i=r.getComponent())||void 0===i?void 0:i.instantiationMode)||r.initialize(),r.getImmediate({identifier:t})}_removeServiceInstance(e,t=A){this._delegate.container.getProvider(e).clearInstance(t)}_addComponent(e){$(this._delegate,e)}_addOrOverwriteComponent(e){k(this._delegate,e)}toJSON(){return{name:this.name,automaticDataCollectionEnabled:this.automaticDataCollectionEnabled,options:this.options}}}const G=new r("app-compat","Firebase",{"no-app":"No Firebase App '{$appName}' has been created - call Firebase App.initializeApp()","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance."});function Y(n){const s={},a={__esModule:!0,initializeApp:function(e,t={}){var i=T(e,t);if(l(s,i.name))return s[i.name];var r=new n(i,a);return s[i.name]=r},app:o,registerVersion:B,setLogLevel:U,onLog:V,apps:null,SDK_VERSION:H,INTERNAL:{registerComponent:function(i){const r=i.name,t=r.replace("-compat","");{var e;P(i)&&"PUBLIC"===i.type&&(e=(e=o())=>{if("function"!=typeof e[t])throw G.create("invalid-app-argument",{appName:r});return e[t]()},void 0!==i.serviceProps&&c(e,i.serviceProps),a[t]=e,n.prototype[t]=function(...e){const t=this._getService.bind(this,r);return t.apply(this,i.multipleInstances?e:[])})}return"PUBLIC"===i.type?a[t]:null},removeApp:function(e){delete s[e]},useAsService:function(e,t){if("serverAuth"===t)return null;var i=t;return i},modularAPIs:x}};function o(e){if(e=e||A,!l(s,e))throw G.create("no-app",{appName:e});return s[e]}return a.default=a,Object.defineProperty(a,"apps",{get:function(){return Object.keys(s).map(e=>s[e])}}),o.App=n,a}var K=function e(){const t=Y(W);return t.INTERNAL=Object.assign(Object.assign({},t.INTERNAL),{createFirebaseNamespace:e,extendNamespace:function(e){c(t,e)},createSubscribe:i,ErrorFactory:r,deepExtend:c}),t}();const J=new _("@firebase/app-compat");if("object"==typeof self&&self.self===self&&void 0!==self.firebase){J.warn(`
|
|
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";function c(e,t){if(!(t instanceof Object))return t;switch(t.constructor){case Date:const i=t;return new Date(i.getTime());case Object:void 0===e&&(e={});break;case Array:e=[];break;default:return t}for(const r in t)t.hasOwnProperty(r)&&"__proto__"!==r&&(e[r]=c(e[r],t[r]));return e}class n{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}wrapCallback(i){return(e,t)=>{e?this.reject(e):this.resolve(t),"function"==typeof i&&(this.promise.catch(()=>{}),1===i.length?i(e):i(e,t))}}}class a extends Error{constructor(e,t,i){super(t),this.code=e,this.customData=i,this.name="FirebaseError",Object.setPrototypeOf(this,a.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,r.prototype.create)}}class r{constructor(e,t,i){this.service=e,this.serviceName=t,this.errors=i}create(e,...t){var r,i=t[0]||{},n=`${this.service}/${e}`,s=this.errors[e],s=s?(r=i,s.replace(o,(e,t)=>{var i=r[t];return null!=i?String(i):`<${t}?>`})):"Error",s=`${this.serviceName}: ${s} (${n}).`;return new a(n,s,i)}}const o=/\{\$([^}]+)}/g;function l(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function h(e,t){if(e===t)return 1;const i=Object.keys(e),r=Object.keys(t);for(const a of i){if(!r.includes(a))return;var n=e[a],s=t[a];if(p(n)&&p(s)){if(!h(n,s))return}else if(n!==s)return}for(const o of r)if(!i.includes(o))return;return 1}function p(e){return null!==e&&"object"==typeof e}function i(e,t){const i=new s(e,t);return i.subscribe.bind(i)}class s{constructor(e,t){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=t,this.task.then(()=>{e(this)}).catch(e=>{this.error(e)})}next(t){this.forEachObserver(e=>{e.next(t)})}error(t){this.forEachObserver(e=>{e.error(t)}),this.close(t)}complete(){this.forEachObserver(e=>{e.complete()}),this.close()}subscribe(e,t,i){let r;if(void 0===e&&void 0===t&&void 0===i)throw new Error("Missing Observer.");r=function(e,t){if("object"!=typeof e||null===e)return!1;for(const i of t)if(i in e&&"function"==typeof e[i])return!0;return!1}(e,["next","error","complete"])?e:{next:e,error:t,complete:i},void 0===r.next&&(r.next=d),void 0===r.error&&(r.error=d),void 0===r.complete&&(r.complete=d);var n=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?r.error(this.finalError):r.complete()}catch(e){}}),this.observers.push(r),n}unsubscribeOne(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))}forEachObserver(t){if(!this.finalized)for(let e=0;e<this.observers.length;e++)this.sendOne(e,t)}sendOne(e,t){this.task.then(()=>{if(void 0!==this.observers&&void 0!==this.observers[e])try{t(this.observers[e])}catch(e){"undefined"!=typeof console&&console.error&&console.error(e)}})}close(e){this.finalized||(this.finalized=!0,void 0!==e&&(this.finalError=e),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}}function d(){}class f{constructor(e,t,i){this.name=e,this.instanceFactory=t,this.type=i,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(e){return this.instantiationMode=e,this}setMultipleInstances(e){return this.multipleInstances=e,this}setServiceProps(e){return this.serviceProps=e,this}setInstanceCreatedCallback(e){return this.onInstanceCreated=e,this}}const u="[DEFAULT]";class m{constructor(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}get(e){var t=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(t)){const r=new n;if(this.instancesDeferred.set(t,r),this.isInitialized(t)||this.shouldAutoInitialize())try{var i=this.getOrInitializeService({instanceIdentifier:t});i&&r.resolve(i)}catch(e){}}return this.instancesDeferred.get(t).promise}getImmediate(e){var t=this.normalizeInstanceIdentifier(null==e?void 0:e.identifier),i=null!==(i=null==e?void 0:e.optional)&&void 0!==i&&i;if(!this.isInitialized(t)&&!this.shouldAutoInitialize()){if(i)return null;throw Error(`Service ${this.name} is not available`)}try{return this.getOrInitializeService({instanceIdentifier:t})}catch(e){if(i)return null;throw e}}getComponent(){return this.component}setComponent(e){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:u})}catch(e){}for(var[t,i]of this.instancesDeferred.entries()){t=this.normalizeInstanceIdentifier(t);try{var r=this.getOrInitializeService({instanceIdentifier:t});i.resolve(r)}catch(e){}}}}clearInstance(e=u){this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}async delete(){const e=Array.from(this.instances.values());await Promise.all([...e.filter(e=>"INTERNAL"in e).map(e=>e.INTERNAL.delete()),...e.filter(e=>"_delete"in e).map(e=>e._delete())])}isComponentSet(){return null!=this.component}isInitialized(e=u){return this.instances.has(e)}getOptions(e=u){return this.instancesOptions.get(e)||{}}initialize(e={}){var{options:t={}}=e,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 r,n,s=this.getOrInitializeService({instanceIdentifier:i,options:t});for([r,n]of this.instancesDeferred.entries())i===this.normalizeInstanceIdentifier(r)&&n.resolve(s);return s}onInit(e,t){var i=this.normalizeInstanceIdentifier(t);const r=null!==(n=this.onInitCallbacks.get(i))&&void 0!==n?n:new Set;r.add(e),this.onInitCallbacks.set(i,r);var n=this.instances.get(i);return n&&e(n,i),()=>{r.delete(e)}}invokeOnInitCallbacks(e,t){var i=this.onInitCallbacks.get(t);if(i)for(const r of i)try{r(e,t)}catch(e){}}getOrInitializeService({instanceIdentifier:e,options:t={}}){let i=this.instances.get(e);if(!i&&this.component&&(i=this.component.instanceFactory(this.container,{instanceIdentifier:(r=e)===u?void 0:r,options:t}),this.instances.set(e,i),this.instancesOptions.set(e,t),this.invokeOnInitCallbacks(i,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,i)}catch(e){}var r;return i||null}normalizeInstanceIdentifier(e=u){return!this.component||this.component.multipleInstances?e:u}shouldAutoInitialize(){return!!this.component&&"EXPLICIT"!==this.component.instantiationMode}}class g{constructor(e){this.name=e,this.providers=new Map}addComponent(e){const t=this.getProvider(e.name);if(t.isComponentSet())throw new Error(`Component ${e.name} has already been registered with ${this.name}`);t.setComponent(e)}addOrOverwriteComponent(e){const t=this.getProvider(e.name);t.isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)}getProvider(e){if(this.providers.has(e))return this.providers.get(e);var t=new m(e,this);return this.providers.set(e,t),t}getProviders(){return Array.from(this.providers.values())}}const v=[];var b,e;(e=b=b||{})[e.DEBUG=0]="DEBUG",e[e.VERBOSE=1]="VERBOSE",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR",e[e.SILENT=5]="SILENT";const I={debug:b.DEBUG,verbose:b.VERBOSE,info:b.INFO,warn:b.WARN,error:b.ERROR,silent:b.SILENT},t=b.INFO,y={[b.DEBUG]:"log",[b.VERBOSE]:"log",[b.INFO]:"info",[b.WARN]:"warn",[b.ERROR]:"error"},E=(e,t,...i)=>{if(!(t<e.logLevel)){var r=(new Date).toISOString(),n=y[t];if(!n)throw new Error(`Attempted to log a message with an invalid logType (value: ${t})`);console[n](`[${r}] ${e.name}:`,...i)}};class _{constructor(e){this.name=e,this._logLevel=t,this._logHandler=E,this._userLogHandler=null,v.push(this)}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in b))throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel="string"==typeof e?I[e]:e}get logHandler(){return this._logHandler}set logHandler(e){if("function"!=typeof e)throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e}get userLogHandler(){return this._userLogHandler}set userLogHandler(e){this._userLogHandler=e}debug(...e){this._userLogHandler&&this._userLogHandler(this,b.DEBUG,...e),this._logHandler(this,b.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,b.VERBOSE,...e),this._logHandler(this,b.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,b.INFO,...e),this._logHandler(this,b.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,b.WARN,...e),this._logHandler(this,b.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,b.ERROR,...e),this._logHandler(this,b.ERROR,...e)}}class O{constructor(e){this.container=e}getPlatformInfoString(){const e=this.container.getProviders();return e.map(e=>{if("VERSION"!==(null==(t=e.getComponent())?void 0:t.type))return null;var t,t=e.getImmediate();return`${t.library}/${t.version}`}).filter(e=>e).join(" ")}}const w="@firebase/app",C="0.7.12-canary.88d43ec00",N=new _("@firebase/app");var L;const A="[DEFAULT]",D={"@firebase/app":"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,R=new Map;function $(t,i){try{t.container.addComponent(i)}catch(e){N.debug(`Component ${i.name} failed to register with FirebaseApp ${t.name}`,e)}}function k(e,t){e.container.addOrOverwriteComponent(t)}function P(e){var t=e.name;if(R.has(t))return N.debug(`There were multiple attempts to register component ${t}.`),!1;R.set(t,e);for(const i of S.values())$(i,e);return!0}function z(e,t){return e.container.getProvider(t)}const F=new r("app","Firebase",{"no-app":"No Firebase App '{$appName}' has been created - call Firebase App.initializeApp()","bad-app-name":"Illegal App name: '{$appName}","duplicate-app":"Firebase App named '{$appName}' already exists with different options or config","app-deleted":"Firebase App named '{$appName}' already deleted","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invalid-log-argument":"First argument to `onLog` must be null or a function."});class j{constructor(e,t,i){this._isDeleted=!1,this._options=Object.assign({},e),this._config=Object.assign({},t),this._name=t.name,this._automaticDataCollectionEnabled=t.automaticDataCollectionEnabled,this._container=i,this.container.addComponent(new f("app",()=>this,"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(e){this.checkDestroyed(),this._automaticDataCollectionEnabled=e}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(e){this._isDeleted=e}checkDestroyed(){if(this.isDeleted)throw F.create("app-deleted",{appName:this._name})}}const H="9.6.2-canary.88d43ec00";function T(e,t={}){if("object"!=typeof t){const r=t;t={name:r}}var i=Object.assign({name:A,automaticDataCollectionEnabled:!1},t);const r=i.name;if("string"!=typeof r||!r)throw F.create("bad-app-name",{appName:String(r)});var n=S.get(r);if(n){if(h(e,n.options)&&h(i,n.config))return n;throw F.create("duplicate-app",{appName:r})}const s=new g(r);for(const a of R.values())s.addComponent(a);i=new j(e,i,s);return S.set(r,i),i}async function M(e){var t=e.name;S.has(t)&&(S.delete(t),await Promise.all(e.container.getProviders().map(e=>e.delete())),e.isDeleted=!0)}function B(e,t,i){let r=null!==(s=D[e])&&void 0!==s?s:e;i&&(r+=`-${i}`);var n=r.match(/\s|\//),s=t.match(/\s|\//);if(n||s){const a=[`Unable to register library "${r}" with version "${t}":`];return n&&a.push(`library name "${r}" contains illegal characters (whitespace or "/")`),n&&s&&a.push("and"),s&&a.push(`version name "${t}" contains illegal characters (whitespace or "/")`),void N.warn(a.join(" "))}P(new f(`${r}-version`,()=>({library:r,version:t}),"VERSION"))}function V(e,t){if(null!==e&&"function"!=typeof e)throw F.create("invalid-log-argument");!function(s,e){for(const t of v){let n=null;e&&e.level&&(n=I[e.level]),t.userLogHandler=null===s?null:(e,t,...i)=>{var r=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(" ");t>=(null!==n&&void 0!==n?n:e.logLevel)&&s({level:b[t].toLowerCase(),message:r,args:i,type:e.name})}}}(e,t)}function U(e){var t;t=e,v.forEach(e=>{e.setLogLevel(t)})}L="",P(new f("platform-logger",e=>new O(e),"PRIVATE")),B(w,C,L),B(w,C,"esm2017"),B("fire-js","");var x=Object.freeze({__proto__:null,SDK_VERSION:H,_DEFAULT_ENTRY_NAME:A,_addComponent:$,_addOrOverwriteComponent:k,_apps:S,_clearComponents:function(){R.clear()},_components:R,_getProvider:z,_registerComponent:P,_removeServiceInstance:function(e,t,i=A){z(e,t).clearInstance(i)},deleteApp:M,getApp:function(e=A){var t=S.get(e);if(!t)throw F.create("no-app",{appName:e});return t},getApps:function(){return Array.from(S.values())},initializeApp:T,onLog:V,registerVersion:B,setLogLevel:U,FirebaseError:a});class W{constructor(e,t){this._delegate=e,this.firebase=t,$(e,new f("app-compat",()=>this,"PUBLIC")),this.container=e.container}get automaticDataCollectionEnabled(){return this._delegate.automaticDataCollectionEnabled}set automaticDataCollectionEnabled(e){this._delegate.automaticDataCollectionEnabled=e}get name(){return this._delegate.name}get options(){return this._delegate.options}delete(){return new Promise(e=>{this._delegate.checkDestroyed(),e()}).then(()=>(this.firebase.INTERNAL.removeApp(this.name),M(this._delegate)))}_getService(e,t=A){var i;this._delegate.checkDestroyed();const r=this._delegate.container.getProvider(e);return r.isInitialized()||"EXPLICIT"!==(null===(i=r.getComponent())||void 0===i?void 0:i.instantiationMode)||r.initialize(),r.getImmediate({identifier:t})}_removeServiceInstance(e,t=A){this._delegate.container.getProvider(e).clearInstance(t)}_addComponent(e){$(this._delegate,e)}_addOrOverwriteComponent(e){k(this._delegate,e)}toJSON(){return{name:this.name,automaticDataCollectionEnabled:this.automaticDataCollectionEnabled,options:this.options}}}const G=new r("app-compat","Firebase",{"no-app":"No Firebase App '{$appName}' has been created - call Firebase App.initializeApp()","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance."});function Y(n){const s={},a={__esModule:!0,initializeApp:function(e,t={}){var i=T(e,t);if(l(s,i.name))return s[i.name];var r=new n(i,a);return s[i.name]=r},app:o,registerVersion:B,setLogLevel:U,onLog:V,apps:null,SDK_VERSION:H,INTERNAL:{registerComponent:function(i){const r=i.name,t=r.replace("-compat","");{var e;P(i)&&"PUBLIC"===i.type&&(e=(e=o())=>{if("function"!=typeof e[t])throw G.create("invalid-app-argument",{appName:r});return e[t]()},void 0!==i.serviceProps&&c(e,i.serviceProps),a[t]=e,n.prototype[t]=function(...e){const t=this._getService.bind(this,r);return t.apply(this,i.multipleInstances?e:[])})}return"PUBLIC"===i.type?a[t]:null},removeApp:function(e){delete s[e]},useAsService:function(e,t){if("serverAuth"===t)return null;var i=t;return i},modularAPIs:x}};function o(e){if(e=e||A,!l(s,e))throw G.create("no-app",{appName:e});return s[e]}return a.default=a,Object.defineProperty(a,"apps",{get:function(){return Object.keys(s).map(e=>s[e])}}),o.App=n,a}var K=function e(){const t=Y(W);return t.INTERNAL=Object.assign(Object.assign({},t.INTERNAL),{createFirebaseNamespace:e,extendNamespace:function(e){c(t,e)},createSubscribe:i,ErrorFactory:r,deepExtend:c}),t}();const J=new _("@firebase/app-compat");if("object"==typeof self&&self.self===self&&void 0!==self.firebase){J.warn(`
|
|
2
2
|
Warning: Firebase is already defined in the global scope. Please make sure
|
|
3
3
|
Firebase library is only loaded once.
|
|
4
4
|
`);const Z=self.firebase.SDK_VERSION;Z&&0<=Z.indexOf("LITE")&&J.warn(`
|
|
5
5
|
Warning: You are trying to load Firebase while using Firebase Performance standalone script.
|
|
6
6
|
You should load Firebase Performance with this instance of Firebase to avoid loading duplicate code.
|
|
7
|
-
`)}const X=K;B("@firebase/app-compat","0.1.13-canary.
|
|
7
|
+
`)}const X=K;B("@firebase/app-compat","0.1.13-canary.88d43ec00",void 0);return X.registerVersion("firebase","9.6.2-canary.88d43ec00","app-compat-cdn"),X});
|
|
8
8
|
//# sourceMappingURL=firebase-app-compat.js.map
|
package/firebase-app.js
CHANGED
|
@@ -884,8 +884,8 @@ function isVersionServiceProvider(provider) {
|
|
|
884
884
|
return (component === null || component === void 0 ? void 0 : component.type) === "VERSION" /* VERSION */;
|
|
885
885
|
}
|
|
886
886
|
|
|
887
|
-
const name$o = "https://www.gstatic.com/firebasejs/9.6.2-canary.
|
|
888
|
-
const version$1 = "0.7.12-canary.
|
|
887
|
+
const name$o = "https://www.gstatic.com/firebasejs/9.6.2-canary.88d43ec00/firebase-app.js";
|
|
888
|
+
const version$1 = "0.7.12-canary.88d43ec00";
|
|
889
889
|
|
|
890
890
|
/**
|
|
891
891
|
* @license
|
|
@@ -903,17 +903,17 @@ const version$1 = "0.7.12-canary.044a8d7f9";
|
|
|
903
903
|
* See the License for the specific language governing permissions and
|
|
904
904
|
* limitations under the License.
|
|
905
905
|
*/
|
|
906
|
-
const logger = new Logger('https://www.gstatic.com/firebasejs/9.6.2-canary.
|
|
906
|
+
const logger = new Logger('https://www.gstatic.com/firebasejs/9.6.2-canary.88d43ec00/firebase-app.js');
|
|
907
907
|
|
|
908
|
-
const name$n = "https://www.gstatic.com/firebasejs/9.6.2-canary.
|
|
908
|
+
const name$n = "https://www.gstatic.com/firebasejs/9.6.2-canary.88d43ec00/firebase-app.js-compat";
|
|
909
909
|
|
|
910
910
|
const name$m = "@firebase/analytics-compat";
|
|
911
911
|
|
|
912
912
|
const name$l = "@firebase/analytics";
|
|
913
913
|
|
|
914
|
-
const name$k = "https://www.gstatic.com/firebasejs/9.6.2-canary.
|
|
914
|
+
const name$k = "https://www.gstatic.com/firebasejs/9.6.2-canary.88d43ec00/firebase-app.js-check-compat";
|
|
915
915
|
|
|
916
|
-
const name$j = "https://www.gstatic.com/firebasejs/9.6.2-canary.
|
|
916
|
+
const name$j = "https://www.gstatic.com/firebasejs/9.6.2-canary.88d43ec00/firebase-app.js-check";
|
|
917
917
|
|
|
918
918
|
const name$i = "@firebase/auth";
|
|
919
919
|
|
|
@@ -952,7 +952,7 @@ const name$2 = "@firebase/firestore";
|
|
|
952
952
|
const name$1 = "@firebase/firestore-compat";
|
|
953
953
|
|
|
954
954
|
const name$p = "firebase";
|
|
955
|
-
const version$2 = "9.6.2-canary.
|
|
955
|
+
const version$2 = "9.6.2-canary.88d43ec00";
|
|
956
956
|
|
|
957
957
|
/**
|
|
958
958
|
* @license
|
|
@@ -1253,7 +1253,7 @@ function initializeApp(options, rawConfig = {}) {
|
|
|
1253
1253
|
return newApp;
|
|
1254
1254
|
}
|
|
1255
1255
|
/**
|
|
1256
|
-
* Retrieves a {@link https://www.gstatic.com/firebasejs/9.6.2-canary.
|
|
1256
|
+
* Retrieves a {@link https://www.gstatic.com/firebasejs/9.6.2-canary.88d43ec00/firebase-app.js#FirebaseApp} instance.
|
|
1257
1257
|
*
|
|
1258
1258
|
* When called with no arguments, the default app is returned. When an app name
|
|
1259
1259
|
* is provided, the app corresponding to that name is returned.
|
|
@@ -1419,7 +1419,7 @@ function registerCoreComponents(variant) {
|
|
|
1419
1419
|
registerCoreComponents('');
|
|
1420
1420
|
|
|
1421
1421
|
var name = "firebase";
|
|
1422
|
-
var version = "9.6.2-canary.
|
|
1422
|
+
var version = "9.6.2-canary.88d43ec00";
|
|
1423
1423
|
|
|
1424
1424
|
/**
|
|
1425
1425
|
* @license
|