firebase 9.13.0 → 9.14.0-20221109210852

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/app/dist/index.cjs.js +1 -1
  3. package/app/dist/index.esm.js +1 -1
  4. package/app/dist/index.mjs +1 -1
  5. package/compat/app/dist/index.cjs.js +1 -1
  6. package/compat/app/dist/index.esm.js +1 -1
  7. package/compat/app/dist/index.mjs +1 -1
  8. package/compat/dist/index.esm.js +2 -2
  9. package/compat/dist/index.node.cjs +2 -2
  10. package/compat/dist/index.rn.cjs.js +2 -2
  11. package/firebase-analytics.js +1 -1
  12. package/firebase-app-check-compat.js +2 -2
  13. package/firebase-app-check-compat.js.map +1 -1
  14. package/firebase-app-check.js +1 -1
  15. package/firebase-app-check.js.map +1 -1
  16. package/firebase-app-compat.js +2 -2
  17. package/firebase-app-compat.js.map +1 -1
  18. package/firebase-app.js +4 -4
  19. package/firebase-auth-cordova.js +1 -1
  20. package/firebase-auth-react-native.js +1 -1
  21. package/firebase-auth.js +1 -1
  22. package/firebase-compat.js +4 -4
  23. package/firebase-compat.js.map +1 -1
  24. package/firebase-database.js +1 -1
  25. package/firebase-firestore-compat.js +1 -1
  26. package/firebase-firestore-compat.js.map +1 -1
  27. package/firebase-firestore-lite.js +1 -1
  28. package/firebase-firestore-lite.js.map +1 -1
  29. package/firebase-firestore.js +1 -1
  30. package/firebase-firestore.js.map +1 -1
  31. package/firebase-functions.js +1 -1
  32. package/firebase-installations.js +1 -1
  33. package/firebase-messaging-compat.js +1 -1
  34. package/firebase-messaging-compat.js.map +1 -1
  35. package/firebase-messaging-sw.js +1 -1
  36. package/firebase-messaging.js +1 -1
  37. package/firebase-messaging.js.map +1 -1
  38. package/firebase-performance-compat.js +1 -1
  39. package/firebase-performance-compat.js.map +1 -1
  40. package/firebase-performance-standalone-compat.es2017.js +6 -6
  41. package/firebase-performance-standalone-compat.es2017.js.map +1 -1
  42. package/firebase-performance-standalone-compat.js +1 -1
  43. package/firebase-performance-standalone-compat.js.map +1 -1
  44. package/firebase-performance.js +1 -1
  45. package/firebase-performance.js.map +1 -1
  46. package/firebase-remote-config.js +1 -1
  47. package/firebase-storage-compat.js +1 -1
  48. package/firebase-storage-compat.js.map +1 -1
  49. package/firebase-storage.js +1 -1
  50. package/firebase-storage.js.map +1 -1
  51. package/package.json +13 -12
package/CHANGELOG.md CHANGED
@@ -1,5 +1,29 @@
1
1
  # firebase
2
2
 
3
+ ## 9.14.0-20221109210852
4
+
5
+ ### Minor Changes
6
+
7
+ - [`0c0c58f47`](https://github.com/firebase/firebase-js-sdk/commit/0c0c58f474024a628ac0b43aacb086af8f2e794c) [#6773](https://github.com/firebase/firebase-js-sdk/pull/6773) - Add missing package that should have been included in https://github.com/firebase/firebase-js-sdk/pull/6728
8
+
9
+ ### Patch Changes
10
+
11
+ - [`bf7cc8f69`](https://github.com/firebase/firebase-js-sdk/commit/bf7cc8f691f7a17730b071d3d9c27bd28a6e3980) [#6712](https://github.com/firebase/firebase-js-sdk/pull/6712) (fixes [#6613](https://github.com/firebase/firebase-js-sdk/issues/6613)) - Fix "missing index" error message to include the link to create the composite index.
12
+
13
+ - [`e2a90bf67`](https://github.com/firebase/firebase-js-sdk/commit/e2a90bf678eb6fa505f8b2f627e03cff622607b5) [#6729](https://github.com/firebase/firebase-js-sdk/pull/6729) - Fix transaction.set() failure without retry on "already-exists" error.
14
+
15
+ - Updated dependencies [[`3f1354f1f`](https://github.com/firebase/firebase-js-sdk/commit/3f1354f1f120f1fe4bcc11122a6e0b12fe3c6ac4), [`bf7cc8f69`](https://github.com/firebase/firebase-js-sdk/commit/bf7cc8f691f7a17730b071d3d9c27bd28a6e3980), [`8876b783f`](https://github.com/firebase/firebase-js-sdk/commit/8876b783f27ba8ba0ad0305db4812432efa17461), [`9e9ee7ba3`](https://github.com/firebase/firebase-js-sdk/commit/9e9ee7ba3383237e0b92ad8183dd0f12640f4f3a), [`457fc2eeb`](https://github.com/firebase/firebase-js-sdk/commit/457fc2eeb6922fd4eaa5e305cd10ee05e86293be), [`e2a90bf67`](https://github.com/firebase/firebase-js-sdk/commit/e2a90bf678eb6fa505f8b2f627e03cff622607b5)]:
16
+ - @firebase/performance@0.5.17-20221109210852
17
+ - @firebase/firestore@3.7.3-20221109210852
18
+ - @firebase/storage@0.9.14-20221109210852
19
+ - @firebase/messaging@0.11.0-20221109210852
20
+ - @firebase/app-check@0.5.17-20221109210852
21
+ - @firebase/performance-compat@0.1.17-20221109210852
22
+ - @firebase/firestore-compat@0.2.3-20221109210852
23
+ - @firebase/storage-compat@0.1.22-20221109210852
24
+ - @firebase/messaging-compat@0.1.21-20221109210852
25
+ - @firebase/app-check-compat@0.2.17-20221109210852
26
+
3
27
  ## 9.13.0
4
28
 
5
29
  ### Minor Changes
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var app = require('@firebase/app');
6
6
 
7
7
  var name = "firebase";
8
- var version = "9.13.0";
8
+ var version = "9.14.0-20221109210852";
9
9
 
10
10
  /**
11
11
  * @license
@@ -2,7 +2,7 @@ import { registerVersion } from '@firebase/app';
2
2
  export * from '@firebase/app';
3
3
 
4
4
  var name = "firebase";
5
- var version = "9.13.0";
5
+ var version = "9.14.0-20221109210852";
6
6
 
7
7
  /**
8
8
  * @license
@@ -2,7 +2,7 @@ import { registerVersion } from '@firebase/app';
2
2
  export * from '@firebase/app';
3
3
 
4
4
  var name = "firebase";
5
- var version = "9.13.0";
5
+ var version = "9.14.0-20221109210852";
6
6
 
7
7
  /**
8
8
  * @license
@@ -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.13.0";
10
+ var version = "9.14.0-20221109210852";
11
11
 
12
12
  /**
13
13
  * @license
@@ -2,7 +2,7 @@ import firebase from '@firebase/app-compat';
2
2
  export { default } from '@firebase/app-compat';
3
3
 
4
4
  var name = "firebase";
5
- var version = "9.13.0";
5
+ var version = "9.14.0-20221109210852";
6
6
 
7
7
  /**
8
8
  * @license
@@ -2,7 +2,7 @@ import firebase from '@firebase/app-compat';
2
2
  export { default } from '@firebase/app-compat';
3
3
 
4
4
  var name = "firebase";
5
- var version = "9.13.0";
5
+ var version = "9.14.0-20221109210852";
6
6
 
7
7
  /**
8
8
  * @license
@@ -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.13.0";
15
+ var version$1 = "9.14.0-20221109210852";
16
16
 
17
17
  /**
18
18
  * @license
@@ -33,7 +33,7 @@ var version$1 = "9.13.0";
33
33
  firebase.registerVersion(name$1, version$1, 'app-compat');
34
34
 
35
35
  var name = "firebase";
36
- var version = "9.13.0";
36
+ var version = "9.14.0-20221109210852";
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.13.0";
15
+ var version$1 = "9.14.0-20221109210852";
16
16
 
17
17
  /**
18
18
  * @license
@@ -33,7 +33,7 @@ var version$1 = "9.13.0";
33
33
  firebase__default["default"].registerVersion(name$1, version$1, 'app-compat');
34
34
 
35
35
  var name = "firebase";
36
- var version = "9.13.0";
36
+ var version = "9.14.0-20221109210852";
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.13.0";
13
+ var version$1 = "9.14.0-20221109210852";
14
14
 
15
15
  /**
16
16
  * @license
@@ -31,7 +31,7 @@ var version$1 = "9.13.0";
31
31
  firebase__default["default"].registerVersion(name$1, version$1, 'app-compat');
32
32
 
33
33
  var name = "firebase";
34
- var version = "9.13.0";
34
+ var version = "9.14.0-20221109210852";
35
35
 
36
36
  /**
37
37
  * @license
@@ -1,3 +1,3 @@
1
- import{registerVersion as e,_registerComponent as t,_getProvider as n,getApp as a}from"https://www.gstatic.com/firebasejs/9.13.0/firebase-app.js";var i;!function(e){e[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"}(i||(i={}));const r={debug:i.DEBUG,verbose:i.VERBOSE,info:i.INFO,warn:i.WARN,error:i.ERROR,silent:i.SILENT},o=i.INFO,s={[i.DEBUG]:"log",[i.VERBOSE]:"log",[i.INFO]:"info",[i.WARN]:"warn",[i.ERROR]:"error"},c=(e,t,...n)=>{if(t<e.logLevel)return;const a=(new Date).toISOString(),i=s[t];if(!i)throw new Error(`Attempted to log a message with an invalid logType (value: ${t})`);console[i](`[${a}] ${e.name}:`,...n)};function l(){const e="object"==typeof chrome?chrome.runtime:"object"==typeof browser?browser.runtime:void 0;return"object"==typeof e&&void 0!==e.id}function u(){return"object"==typeof indexedDB}function d(){return new Promise(((e,t)=>{try{let n=!0;const a="validate-browser-context-for-indexeddb-analytics-module",i=self.indexedDB.open(a);i.onsuccess=()=>{i.result.close(),n||self.indexedDB.deleteDatabase(a),e(!0)},i.onupgradeneeded=()=>{n=!1},i.onerror=()=>{var e;t((null===(e=i.error)||void 0===e?void 0:e.message)||"")}}catch(e){t(e)}}))}function f(){return!("undefined"==typeof navigator||!navigator.cookieEnabled)}class p extends Error{constructor(e,t,n){super(t),this.code=e,this.customData=n,this.name="FirebaseError",Object.setPrototypeOf(this,p.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,h.prototype.create)}}class h{constructor(e,t,n){this.service=e,this.serviceName=t,this.errors=n}create(e,...t){const n=t[0]||{},a=`${this.service}/${e}`,i=this.errors[e],r=i?function(e,t){return e.replace(g,((e,n)=>{const a=t[n];return null!=a?String(a):`<${n}?>`}))}(i,n):"Error",o=`${this.serviceName}: ${r} (${a}).`;return new p(a,o,n)}}const g=/\{\$([^}]+)}/g;function m(e,t){if(e===t)return!0;const n=Object.keys(e),a=Object.keys(t);for(const i of n){if(!a.includes(i))return!1;const n=e[i],r=t[i];if(w(n)&&w(r)){if(!m(n,r))return!1}else if(n!==r)return!1}for(const e of a)if(!n.includes(e))return!1;return!0}function w(e){return null!==e&&"object"==typeof e}function y(e,t=1e3,n=2){const a=t*Math.pow(n,e),i=Math.round(.5*a*(Math.random()-.5)*2);return Math.min(144e5,a+i)}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}}let b,E;const T=new WeakMap,D=new WeakMap,S=new WeakMap,k=new WeakMap,C=new WeakMap;let L={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return D.get(e);if("objectStoreNames"===t)return e.objectStoreNames||S.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return $(e[t])},set:(e,t,n)=>(e[t]=n,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function j(e){return e!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(E||(E=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(P(this),t),$(T.get(this))}:function(...t){return $(e.apply(P(this),t))}:function(t,...n){const a=e.call(P(this),t,...n);return S.set(a,t.sort?t.sort():[t]),$(a)}}function O(e){return"function"==typeof e?j(e):(e instanceof IDBTransaction&&function(e){if(D.has(e))return;const t=new Promise(((t,n)=>{const a=()=>{e.removeEventListener("complete",i),e.removeEventListener("error",r),e.removeEventListener("abort",r)},i=()=>{t(),a()},r=()=>{n(e.error||new DOMException("AbortError","AbortError")),a()};e.addEventListener("complete",i),e.addEventListener("error",r),e.addEventListener("abort",r)}));D.set(e,t)}(e),t=e,(b||(b=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])).some((e=>t instanceof e))?new Proxy(e,L):e);var t}function $(e){if(e instanceof IDBRequest)return function(e){const t=new Promise(((t,n)=>{const a=()=>{e.removeEventListener("success",i),e.removeEventListener("error",r)},i=()=>{t($(e.result)),a()},r=()=>{n(e.error),a()};e.addEventListener("success",i),e.addEventListener("error",r)}));return t.then((t=>{t instanceof IDBCursor&&T.set(t,e)})).catch((()=>{})),C.set(t,e),t}(e);if(k.has(e))return k.get(e);const t=O(e);return t!==e&&(k.set(e,t),C.set(t,e)),t}const P=e=>C.get(e);const M=["get","getKey","getAll","getAllKeys","count"],_=["put","add","delete","clear"],A=new Map;function B(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(A.get(t))return A.get(t);const n=t.replace(/FromIndex$/,""),a=t!==n,i=_.includes(n);if(!(n in(a?IDBIndex:IDBObjectStore).prototype)||!i&&!M.includes(n))return;const r=async function(e,...t){const r=this.transaction(e,i?"readwrite":"readonly");let o=r.store;return a&&(o=o.index(t.shift())),(await Promise.all([o[n](...t),i&&r.done]))[0]};return A.set(t,r),r}L=(e=>({...e,get:(t,n,a)=>B(t,n)||e.get(t,n,a),has:(t,n)=>!!B(t,n)||e.has(t,n)}))(L);const N="@firebase/installations",F=new h("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 x(e){return e instanceof p&&e.code.includes("request-failed")}function R({projectId:e}){return`https://firebaseinstallations.googleapis.com/v1/projects/${e}/installations`}function H(e){return{token:e.token,requestStatus:2,expiresIn:(t=e.expiresIn,Number(t.replace("s","000"))),creationTime:Date.now()};var t}async function q(e,t){const n=(await t.json()).error;return F.create("request-failed",{requestName:e,serverCode:n.code,serverMessage:n.message,serverStatus:n.status})}function z({apiKey:e}){return new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":e})}function V(e,{refreshToken:t}){const n=z(e);return n.append("Authorization",function(e){return`FIS_v2 ${e}`}(t)),n}async function K(e){const t=await e();return t.status>=500&&t.status<600?e():t}function W(e){return new Promise((t=>{setTimeout(t,e)}))}const G=/^[cdef][\w-]{21}$/;function U(){try{const e=new Uint8Array(17);(self.crypto||self.msCrypto).getRandomValues(e),e[0]=112+e[0]%16;const t=function(e){return(t=e,btoa(String.fromCharCode(...t)).replace(/\+/g,"-").replace(/\//g,"_")).substr(0,22);var t}(e);return G.test(t)?t:""}catch(e){return""}}function J(e){return`${e.appName}!${e.appId}`}const Y=new Map;function Z(e,t){const n=J(e);Q(n,t),function(e,t){const n=function(){!X&&"BroadcastChannel"in self&&(X=new BroadcastChannel("[Firebase] FID Change"),X.onmessage=e=>{Q(e.data.key,e.data.fid)});return X}();n&&n.postMessage({key:e,fid:t});0===Y.size&&X&&(X.close(),X=null)}(n,t)}function Q(e,t){const n=Y.get(e);if(n)for(const e of n)e(t)}let X=null;const ee="firebase-installations-store";let te=null;function ne(){return te||(te=function(e,t,{blocked:n,upgrade:a,blocking:i,terminated:r}={}){const o=indexedDB.open(e,t),s=$(o);return a&&o.addEventListener("upgradeneeded",(e=>{a($(o.result),e.oldVersion,e.newVersion,$(o.transaction))})),n&&o.addEventListener("blocked",(()=>n())),s.then((e=>{r&&e.addEventListener("close",(()=>r())),i&&e.addEventListener("versionchange",(()=>i()))})).catch((()=>{})),s}("firebase-installations-database",1,{upgrade:(e,t)=>{if(0===t)e.createObjectStore(ee)}})),te}async function ae(e,t){const n=J(e),a=(await ne()).transaction(ee,"readwrite"),i=a.objectStore(ee),r=await i.get(n);return await i.put(t,n),await a.done,r&&r.fid===t.fid||Z(e,t.fid),t}async function ie(e){const t=J(e),n=(await ne()).transaction(ee,"readwrite");await n.objectStore(ee).delete(t),await n.done}async function re(e,t){const n=J(e),a=(await ne()).transaction(ee,"readwrite"),i=a.objectStore(ee),r=await i.get(n),o=t(r);return void 0===o?await i.delete(n):await i.put(o,n),await a.done,!o||r&&r.fid===o.fid||Z(e,o.fid),o}async function oe(e){let t;const n=await re(e.appConfig,(n=>{const a=function(e){return le(e||{fid:U(),registrationStatus:0})}(n),i=function(e,t){if(0===t.registrationStatus){if(!navigator.onLine){return{installationEntry:t,registrationPromise:Promise.reject(F.create("app-offline"))}}const n={fid:t.fid,registrationStatus:1,registrationTime:Date.now()},a=async function(e,t){try{const n=await async function({appConfig:e,heartbeatServiceProvider:t},{fid:n}){const a=R(e),i=z(e),r=t.getImmediate({optional:!0});if(r){const e=await r.getHeartbeatsHeader();e&&i.append("x-firebase-client",e)}const o={fid:n,authVersion:"FIS_v2",appId:e.appId,sdkVersion:"w:0.5.16"},s={method:"POST",headers:i,body:JSON.stringify(o)},c=await K((()=>fetch(a,s)));if(c.ok){const e=await c.json();return{fid:e.fid||n,registrationStatus:2,refreshToken:e.refreshToken,authToken:H(e.authToken)}}throw await q("Create Installation",c)}(e,t);return ae(e.appConfig,n)}catch(n){throw x(n)&&409===n.customData.serverCode?await ie(e.appConfig):await ae(e.appConfig,{fid:t.fid,registrationStatus:0}),n}}(e,n);return{installationEntry:n,registrationPromise:a}}return 1===t.registrationStatus?{installationEntry:t,registrationPromise:se(e)}:{installationEntry:t}}(e,a);return t=i.registrationPromise,i.installationEntry}));return""===n.fid?{installationEntry:await t}:{installationEntry:n,registrationPromise:t}}async function se(e){let t=await ce(e.appConfig);for(;1===t.registrationStatus;)await W(100),t=await ce(e.appConfig);if(0===t.registrationStatus){const{installationEntry:t,registrationPromise:n}=await oe(e);return n||t}return t}function ce(e){return re(e,(e=>{if(!e)throw F.create("installation-not-found");return le(e)}))}function le(e){return 1===(t=e).registrationStatus&&t.registrationTime+1e4<Date.now()?{fid:e.fid,registrationStatus:0}:e;var t}async function ue({appConfig:e,heartbeatServiceProvider:t},n){const a=function(e,{fid:t}){return`${R(e)}/${t}/authTokens:generate`}(e,n),i=V(e,n),r=t.getImmediate({optional:!0});if(r){const e=await r.getHeartbeatsHeader();e&&i.append("x-firebase-client",e)}const o={installation:{sdkVersion:"w:0.5.16",appId:e.appId}},s={method:"POST",headers:i,body:JSON.stringify(o)},c=await K((()=>fetch(a,s)));if(c.ok){return H(await c.json())}throw await q("Generate Auth Token",c)}async function de(e,t=!1){let n;const a=await re(e.appConfig,(a=>{if(!pe(a))throw F.create("not-registered");const i=a.authToken;if(!t&&function(e){return 2===e.requestStatus&&!function(e){const t=Date.now();return t<e.creationTime||e.creationTime+e.expiresIn<t+36e5}(e)}(i))return a;if(1===i.requestStatus)return n=async function(e,t){let n=await fe(e.appConfig);for(;1===n.authToken.requestStatus;)await W(100),n=await fe(e.appConfig);const a=n.authToken;return 0===a.requestStatus?de(e,t):a}(e,t),a;{if(!navigator.onLine)throw F.create("app-offline");const t=function(e){const t={requestStatus:1,requestTime:Date.now()};return Object.assign(Object.assign({},e),{authToken:t})}(a);return n=async function(e,t){try{const n=await ue(e,t),a=Object.assign(Object.assign({},t),{authToken:n});return await ae(e.appConfig,a),n}catch(n){if(!x(n)||401!==n.customData.serverCode&&404!==n.customData.serverCode){const n=Object.assign(Object.assign({},t),{authToken:{requestStatus:0}});await ae(e.appConfig,n)}else await ie(e.appConfig);throw n}}(e,t),t}}));return n?await n:a.authToken}function fe(e){return re(e,(e=>{if(!pe(e))throw F.create("not-registered");const t=e.authToken;return 1===(n=t).requestStatus&&n.requestTime+1e4<Date.now()?Object.assign(Object.assign({},e),{authToken:{requestStatus:0}}):e;var n}))}function pe(e){return void 0!==e&&2===e.registrationStatus}async function he(e,t=!1){const n=e;await async function(e){const{registrationPromise:t}=await oe(e);t&&await t}(n);return(await de(n,t)).token}function ge(e){return F.create("missing-app-config-values",{valueName:e})}const me=e=>{const t=e.getProvider("app").getImmediate(),a=n(t,"installations").getImmediate();return{getId:()=>async function(e){const t=e,{installationEntry:n,registrationPromise:a}=await oe(t);return a?a.catch(console.error):de(t).catch(console.error),n.fid}(a),getToken:e=>he(a,e)}};t(new I("installations",(e=>{const t=e.getProvider("app").getImmediate(),a=function(e){if(!e||!e.options)throw ge("App Configuration");if(!e.name)throw ge("App Name");const t=["projectId","apiKey","appId"];for(const n of t)if(!e.options[n])throw ge(n);return{appName:e.name,projectId:e.options.projectId,apiKey:e.options.apiKey,appId:e.options.appId}}(t);return{app:t,appConfig:a,heartbeatServiceProvider:n(t,"heartbeat"),_delete:()=>Promise.resolve()}}),"PUBLIC")),t(new I("installations-internal",me,"PRIVATE")),e(N,"0.5.16"),e(N,"0.5.16","esm2017");const we="https://www.googletagmanager.com/gtag/js",ye=new class{constructor(e){this.name=e,this._logLevel=o,this._logHandler=c,this._userLogHandler=null}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in i))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,i.DEBUG,...e),this._logHandler(this,i.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,i.VERBOSE,...e),this._logHandler(this,i.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,i.INFO,...e),this._logHandler(this,i.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,i.WARN,...e),this._logHandler(this,i.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,i.ERROR,...e),this._logHandler(this,i.ERROR,...e)}}("@firebase/analytics");function ve(e){return Promise.all(e.map((e=>e.catch((e=>e)))))}function Ie(e,t,n,a){return async function(i,r,o){try{"event"===i?await async function(e,t,n,a,i){try{let r=[];if(i&&i.send_to){let e=i.send_to;Array.isArray(e)||(e=[e]);const a=await ve(n);for(const n of e){const e=a.find((e=>e.measurementId===n)),i=e&&t[e.appId];if(!i){r=[];break}r.push(i)}}0===r.length&&(r=Object.values(t)),await Promise.all(r),e("event",a,i||{})}catch(e){ye.error(e)}}(e,t,n,r,o):"config"===i?await async function(e,t,n,a,i,r){const o=a[i];try{if(o)await t[o];else{const e=(await ve(n)).find((e=>e.measurementId===i));e&&await t[e.appId]}}catch(e){ye.error(e)}e("config",i,r)}(e,t,n,a,r,o):"consent"===i?e("consent","update",o):e("set",r)}catch(e){ye.error(e)}}}const be=new h("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.'});const Ee=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]}};function Te(e){return new Headers({Accept:"application/json","x-goog-api-key":e})}async function De(e,t=Ee,n){const{appId:a,apiKey:i,measurementId:r}=e.options;if(!a)throw be.create("no-app-id");if(!i){if(r)return{measurementId:r,appId:a};throw be.create("no-api-key")}const o=t.getThrottleMetadata(a)||{backoffCount:0,throttleEndTimeMillis:Date.now()},s=new ke;return setTimeout((async()=>{s.abort()}),void 0!==n?n:6e4),Se({appId:a,apiKey:i,measurementId:r},o,s,t)}async function Se(e,{throttleEndTimeMillis:t,backoffCount:n},a,i=Ee){var r,o;const{appId:s,measurementId:c}=e;try{await function(e,t){return new Promise(((n,a)=>{const i=Math.max(t-Date.now(),0),r=setTimeout(n,i);e.addEventListener((()=>{clearTimeout(r),a(be.create("fetch-throttle",{throttleEndTimeMillis:t}))}))}))}(a,t)}catch(e){if(c)return ye.warn(`Timed out fetching this Firebase app's measurement ID from the server. Falling back to the measurement ID ${c} provided in the "measurementId" field in the local Firebase config. [${null===(r=e)||void 0===r?void 0:r.message}]`),{appId:s,measurementId:c};throw e}try{const t=await async function(e){var t;const{appId:n,apiKey:a}=e,i={method:"GET",headers:Te(a)},r="https://firebase.googleapis.com/v1alpha/projects/-/apps/{app-id}/webConfig".replace("{app-id}",n),o=await fetch(r,i);if(200!==o.status&&304!==o.status){let e="";try{const n=await o.json();(null===(t=n.error)||void 0===t?void 0:t.message)&&(e=n.error.message)}catch(e){}throw be.create("config-fetch-failed",{httpStatus:o.status,responseMessage:e})}return o.json()}(e);return i.deleteThrottleMetadata(s),t}catch(t){const r=t;if(!function(e){if(!(e instanceof p&&e.customData))return!1;const t=Number(e.customData.httpStatus);return 429===t||500===t||503===t||504===t}(r)){if(i.deleteThrottleMetadata(s),c)return ye.warn(`Failed to fetch this Firebase app's measurement ID from the server. Falling back to the measurement ID ${c} provided in the "measurementId" field in the local Firebase config. [${null==r?void 0:r.message}]`),{appId:s,measurementId:c};throw t}const l=503===Number(null===(o=null==r?void 0:r.customData)||void 0===o?void 0:o.httpStatus)?y(n,i.intervalMillis,30):y(n,i.intervalMillis),u={throttleEndTimeMillis:Date.now()+l,backoffCount:n+1};return i.setThrottleMetadata(s,u),ye.debug(`Calling attemptFetch again in ${l} millis`),Se(e,u,a,i)}}class ke{constructor(){this.listeners=[]}addEventListener(e){this.listeners.push(e)}abort(){this.listeners.forEach((e=>e()))}}let Ce,Le;function je(e){Le=e}function Oe(e){Ce=e}async function $e(e,t,n,a,i,r,o){var s;const c=De(e);c.then((t=>{n[t.measurementId]=t.appId,e.options.measurementId&&t.measurementId!==e.options.measurementId&&ye.warn(`The measurement ID in the local Firebase config (${e.options.measurementId}) does not match the measurement ID fetched from the server (${t.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=>ye.error(e))),t.push(c);const l=async function(){var e;if(!u())return ye.warn(be.create("indexeddb-unavailable",{errorInfo:"IndexedDB is not available in this environment."}).message),!1;try{await d()}catch(t){return ye.warn(be.create("indexeddb-unavailable",{errorInfo:null===(e=t)||void 0===e?void 0:e.toString()}).message),!1}return!0}().then((e=>e?a.getId():void 0)),[f,p]=await Promise.all([c,l]);(function(e){const t=window.document.getElementsByTagName("script");for(const n of Object.values(t))if(n.src&&n.src.includes(we)&&n.src.includes(e))return n;return null})(r)||function(e,t){const n=document.createElement("script");n.src=`${we}?l=${e}&id=${t}`,n.async=!0,document.head.appendChild(n)}(r,f.measurementId),Le&&(i("consent","default",Le),je(void 0)),i("js",new Date);const h=null!==(s=null==o?void 0:o.config)&&void 0!==s?s:{};return h.origin="firebase",h.update=!0,null!=p&&(h.firebase_id=p),i("config",f.measurementId,h),Ce&&(i("set",Ce),Oe(void 0)),f.measurementId}class Pe{constructor(e){this.app=e}_delete(){return delete Me[this.app.options.appId],Promise.resolve()}}let Me={},_e=[];const Ae={};let Be,Ne,Fe="dataLayer",xe="gtag",Re=!1;function He(e){if(Re)throw be.create("already-initialized");e.dataLayerName&&(Fe=e.dataLayerName),e.gtagName&&(xe=e.gtagName)}function qe(e,t,n){!function(){const e=[];if(l()&&e.push("This is a browser extension environment."),f()||e.push("Cookies are not available."),e.length>0){const t=e.map(((e,t)=>`(${t+1}) ${e}`)).join(" "),n=be.create("invalid-analytics-context",{errorInfo:t});ye.warn(n.message)}}();const a=e.options.appId;if(!a)throw be.create("no-app-id");if(!e.options.apiKey){if(!e.options.measurementId)throw be.create("no-api-key");ye.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!=Me[a])throw be.create("already-exists",{id:a});if(!Re){!function(e){let t=[];Array.isArray(window[e])?t=window[e]:window[e]=t}(Fe);const{wrappedGtag:e,gtagCore:t}=function(e,t,n,a,i){let r=function(...e){window[a].push(arguments)};return window[i]&&"function"==typeof window[i]&&(r=window[i]),window[i]=Ie(r,e,t,n),{gtagCore:r,wrappedGtag:window[i]}}(Me,_e,Ae,Fe,xe);Ne=e,Be=t,Re=!0}Me[a]=$e(e,_e,Ae,t,Be,Fe,n);return new Pe(e)}function ze(e=a()){e=v(e);const t=n(e,"analytics");return t.isInitialized()?t.getImmediate():Ve(e)}function Ve(e,t={}){const a=n(e,"analytics");if(a.isInitialized()){const e=a.getImmediate();if(m(t,a.getOptions()))return e;throw be.create("already-initialized")}return a.initialize({options:t})}async function Ke(){if(l())return!1;if(!f())return!1;if(!u())return!1;try{return await d()}catch(e){return!1}}function We(e,t,n){e=v(e),async function(e,t,n,a){if(a&&a.global)return e("set",{screen_name:n}),Promise.resolve();e("config",await t,{update:!0,screen_name:n})}(Ne,Me[e.app.options.appId],t,n).catch((e=>ye.error(e)))}function Ge(e,t,n){e=v(e),async function(e,t,n,a){if(a&&a.global)return e("set",{user_id:n}),Promise.resolve();e("config",await t,{update:!0,user_id:n})}(Ne,Me[e.app.options.appId],t,n).catch((e=>ye.error(e)))}function Ue(e,t,n){e=v(e),async function(e,t,n,a){if(a&&a.global){const t={};for(const e of Object.keys(n))t[`user_properties.${e}`]=n[e];return e("set",t),Promise.resolve()}e("config",await t,{update:!0,user_properties:n})}(Ne,Me[e.app.options.appId],t,n).catch((e=>ye.error(e)))}function Je(e,t){e=v(e),async function(e,t){const n=await e;window[`ga-disable-${n}`]=!t}(Me[e.app.options.appId],t).catch((e=>ye.error(e)))}function Ye(e){Ne?Ne("set",e):Oe(e)}function Ze(e,t,n,a){e=v(e),async function(e,t,n,a,i){if(i&&i.global)e("event",n,a);else{const i=await t;e("event",n,Object.assign(Object.assign({},a),{send_to:i}))}}(Ne,Me[e.app.options.appId],t,n,a).catch((e=>ye.error(e)))}function Qe(e){Ne?Ne("consent","update",e):je(e)}const Xe="@firebase/analytics";t(new I("analytics",((e,{options:t})=>qe(e.getProvider("app").getImmediate(),e.getProvider("installations-internal").getImmediate(),t)),"PUBLIC")),t(new I("analytics-internal",(function(e){try{const t=e.getProvider("analytics").getImmediate();return{logEvent:(e,n,a)=>Ze(t,e,n,a)}}catch(e){throw be.create("interop-component-reg-failed",{reason:e})}}),"PRIVATE")),e(Xe,"0.8.4"),e(Xe,"0.8.4","esm2017");export{ze as getAnalytics,Ve as initializeAnalytics,Ke as isSupported,Ze as logEvent,Je as setAnalyticsCollectionEnabled,Qe as setConsent,We as setCurrentScreen,Ye as setDefaultEventParameters,Ge as setUserId,Ue as setUserProperties,He as settings};
1
+ import{registerVersion as e,_registerComponent as t,_getProvider as n,getApp as a}from"https://www.gstatic.com/firebasejs/9.14.0-20221109210852/firebase-app.js";var i;!function(e){e[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"}(i||(i={}));const r={debug:i.DEBUG,verbose:i.VERBOSE,info:i.INFO,warn:i.WARN,error:i.ERROR,silent:i.SILENT},o=i.INFO,s={[i.DEBUG]:"log",[i.VERBOSE]:"log",[i.INFO]:"info",[i.WARN]:"warn",[i.ERROR]:"error"},c=(e,t,...n)=>{if(t<e.logLevel)return;const a=(new Date).toISOString(),i=s[t];if(!i)throw new Error(`Attempted to log a message with an invalid logType (value: ${t})`);console[i](`[${a}] ${e.name}:`,...n)};function l(){const e="object"==typeof chrome?chrome.runtime:"object"==typeof browser?browser.runtime:void 0;return"object"==typeof e&&void 0!==e.id}function u(){return"object"==typeof indexedDB}function d(){return new Promise(((e,t)=>{try{let n=!0;const a="validate-browser-context-for-indexeddb-analytics-module",i=self.indexedDB.open(a);i.onsuccess=()=>{i.result.close(),n||self.indexedDB.deleteDatabase(a),e(!0)},i.onupgradeneeded=()=>{n=!1},i.onerror=()=>{var e;t((null===(e=i.error)||void 0===e?void 0:e.message)||"")}}catch(e){t(e)}}))}function f(){return!("undefined"==typeof navigator||!navigator.cookieEnabled)}class p extends Error{constructor(e,t,n){super(t),this.code=e,this.customData=n,this.name="FirebaseError",Object.setPrototypeOf(this,p.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,h.prototype.create)}}class h{constructor(e,t,n){this.service=e,this.serviceName=t,this.errors=n}create(e,...t){const n=t[0]||{},a=`${this.service}/${e}`,i=this.errors[e],r=i?function(e,t){return e.replace(g,((e,n)=>{const a=t[n];return null!=a?String(a):`<${n}?>`}))}(i,n):"Error",o=`${this.serviceName}: ${r} (${a}).`;return new p(a,o,n)}}const g=/\{\$([^}]+)}/g;function m(e,t){if(e===t)return!0;const n=Object.keys(e),a=Object.keys(t);for(const i of n){if(!a.includes(i))return!1;const n=e[i],r=t[i];if(w(n)&&w(r)){if(!m(n,r))return!1}else if(n!==r)return!1}for(const e of a)if(!n.includes(e))return!1;return!0}function w(e){return null!==e&&"object"==typeof e}function y(e,t=1e3,n=2){const a=t*Math.pow(n,e),i=Math.round(.5*a*(Math.random()-.5)*2);return Math.min(144e5,a+i)}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}}let b,E;const T=new WeakMap,D=new WeakMap,S=new WeakMap,k=new WeakMap,C=new WeakMap;let L={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return D.get(e);if("objectStoreNames"===t)return e.objectStoreNames||S.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return $(e[t])},set:(e,t,n)=>(e[t]=n,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function j(e){return e!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(E||(E=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(P(this),t),$(T.get(this))}:function(...t){return $(e.apply(P(this),t))}:function(t,...n){const a=e.call(P(this),t,...n);return S.set(a,t.sort?t.sort():[t]),$(a)}}function O(e){return"function"==typeof e?j(e):(e instanceof IDBTransaction&&function(e){if(D.has(e))return;const t=new Promise(((t,n)=>{const a=()=>{e.removeEventListener("complete",i),e.removeEventListener("error",r),e.removeEventListener("abort",r)},i=()=>{t(),a()},r=()=>{n(e.error||new DOMException("AbortError","AbortError")),a()};e.addEventListener("complete",i),e.addEventListener("error",r),e.addEventListener("abort",r)}));D.set(e,t)}(e),t=e,(b||(b=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])).some((e=>t instanceof e))?new Proxy(e,L):e);var t}function $(e){if(e instanceof IDBRequest)return function(e){const t=new Promise(((t,n)=>{const a=()=>{e.removeEventListener("success",i),e.removeEventListener("error",r)},i=()=>{t($(e.result)),a()},r=()=>{n(e.error),a()};e.addEventListener("success",i),e.addEventListener("error",r)}));return t.then((t=>{t instanceof IDBCursor&&T.set(t,e)})).catch((()=>{})),C.set(t,e),t}(e);if(k.has(e))return k.get(e);const t=O(e);return t!==e&&(k.set(e,t),C.set(t,e)),t}const P=e=>C.get(e);const M=["get","getKey","getAll","getAllKeys","count"],_=["put","add","delete","clear"],A=new Map;function B(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(A.get(t))return A.get(t);const n=t.replace(/FromIndex$/,""),a=t!==n,i=_.includes(n);if(!(n in(a?IDBIndex:IDBObjectStore).prototype)||!i&&!M.includes(n))return;const r=async function(e,...t){const r=this.transaction(e,i?"readwrite":"readonly");let o=r.store;return a&&(o=o.index(t.shift())),(await Promise.all([o[n](...t),i&&r.done]))[0]};return A.set(t,r),r}L=(e=>({...e,get:(t,n,a)=>B(t,n)||e.get(t,n,a),has:(t,n)=>!!B(t,n)||e.has(t,n)}))(L);const N="@firebase/installations",F=new h("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 x(e){return e instanceof p&&e.code.includes("request-failed")}function R({projectId:e}){return`https://firebaseinstallations.googleapis.com/v1/projects/${e}/installations`}function H(e){return{token:e.token,requestStatus:2,expiresIn:(t=e.expiresIn,Number(t.replace("s","000"))),creationTime:Date.now()};var t}async function q(e,t){const n=(await t.json()).error;return F.create("request-failed",{requestName:e,serverCode:n.code,serverMessage:n.message,serverStatus:n.status})}function z({apiKey:e}){return new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":e})}function V(e,{refreshToken:t}){const n=z(e);return n.append("Authorization",function(e){return`FIS_v2 ${e}`}(t)),n}async function K(e){const t=await e();return t.status>=500&&t.status<600?e():t}function W(e){return new Promise((t=>{setTimeout(t,e)}))}const G=/^[cdef][\w-]{21}$/;function U(){try{const e=new Uint8Array(17);(self.crypto||self.msCrypto).getRandomValues(e),e[0]=112+e[0]%16;const t=function(e){return(t=e,btoa(String.fromCharCode(...t)).replace(/\+/g,"-").replace(/\//g,"_")).substr(0,22);var t}(e);return G.test(t)?t:""}catch(e){return""}}function J(e){return`${e.appName}!${e.appId}`}const Y=new Map;function Z(e,t){const n=J(e);Q(n,t),function(e,t){const n=function(){!X&&"BroadcastChannel"in self&&(X=new BroadcastChannel("[Firebase] FID Change"),X.onmessage=e=>{Q(e.data.key,e.data.fid)});return X}();n&&n.postMessage({key:e,fid:t});0===Y.size&&X&&(X.close(),X=null)}(n,t)}function Q(e,t){const n=Y.get(e);if(n)for(const e of n)e(t)}let X=null;const ee="firebase-installations-store";let te=null;function ne(){return te||(te=function(e,t,{blocked:n,upgrade:a,blocking:i,terminated:r}={}){const o=indexedDB.open(e,t),s=$(o);return a&&o.addEventListener("upgradeneeded",(e=>{a($(o.result),e.oldVersion,e.newVersion,$(o.transaction))})),n&&o.addEventListener("blocked",(()=>n())),s.then((e=>{r&&e.addEventListener("close",(()=>r())),i&&e.addEventListener("versionchange",(()=>i()))})).catch((()=>{})),s}("firebase-installations-database",1,{upgrade:(e,t)=>{if(0===t)e.createObjectStore(ee)}})),te}async function ae(e,t){const n=J(e),a=(await ne()).transaction(ee,"readwrite"),i=a.objectStore(ee),r=await i.get(n);return await i.put(t,n),await a.done,r&&r.fid===t.fid||Z(e,t.fid),t}async function ie(e){const t=J(e),n=(await ne()).transaction(ee,"readwrite");await n.objectStore(ee).delete(t),await n.done}async function re(e,t){const n=J(e),a=(await ne()).transaction(ee,"readwrite"),i=a.objectStore(ee),r=await i.get(n),o=t(r);return void 0===o?await i.delete(n):await i.put(o,n),await a.done,!o||r&&r.fid===o.fid||Z(e,o.fid),o}async function oe(e){let t;const n=await re(e.appConfig,(n=>{const a=function(e){return le(e||{fid:U(),registrationStatus:0})}(n),i=function(e,t){if(0===t.registrationStatus){if(!navigator.onLine){return{installationEntry:t,registrationPromise:Promise.reject(F.create("app-offline"))}}const n={fid:t.fid,registrationStatus:1,registrationTime:Date.now()},a=async function(e,t){try{const n=await async function({appConfig:e,heartbeatServiceProvider:t},{fid:n}){const a=R(e),i=z(e),r=t.getImmediate({optional:!0});if(r){const e=await r.getHeartbeatsHeader();e&&i.append("x-firebase-client",e)}const o={fid:n,authVersion:"FIS_v2",appId:e.appId,sdkVersion:"w:0.5.16"},s={method:"POST",headers:i,body:JSON.stringify(o)},c=await K((()=>fetch(a,s)));if(c.ok){const e=await c.json();return{fid:e.fid||n,registrationStatus:2,refreshToken:e.refreshToken,authToken:H(e.authToken)}}throw await q("Create Installation",c)}(e,t);return ae(e.appConfig,n)}catch(n){throw x(n)&&409===n.customData.serverCode?await ie(e.appConfig):await ae(e.appConfig,{fid:t.fid,registrationStatus:0}),n}}(e,n);return{installationEntry:n,registrationPromise:a}}return 1===t.registrationStatus?{installationEntry:t,registrationPromise:se(e)}:{installationEntry:t}}(e,a);return t=i.registrationPromise,i.installationEntry}));return""===n.fid?{installationEntry:await t}:{installationEntry:n,registrationPromise:t}}async function se(e){let t=await ce(e.appConfig);for(;1===t.registrationStatus;)await W(100),t=await ce(e.appConfig);if(0===t.registrationStatus){const{installationEntry:t,registrationPromise:n}=await oe(e);return n||t}return t}function ce(e){return re(e,(e=>{if(!e)throw F.create("installation-not-found");return le(e)}))}function le(e){return 1===(t=e).registrationStatus&&t.registrationTime+1e4<Date.now()?{fid:e.fid,registrationStatus:0}:e;var t}async function ue({appConfig:e,heartbeatServiceProvider:t},n){const a=function(e,{fid:t}){return`${R(e)}/${t}/authTokens:generate`}(e,n),i=V(e,n),r=t.getImmediate({optional:!0});if(r){const e=await r.getHeartbeatsHeader();e&&i.append("x-firebase-client",e)}const o={installation:{sdkVersion:"w:0.5.16",appId:e.appId}},s={method:"POST",headers:i,body:JSON.stringify(o)},c=await K((()=>fetch(a,s)));if(c.ok){return H(await c.json())}throw await q("Generate Auth Token",c)}async function de(e,t=!1){let n;const a=await re(e.appConfig,(a=>{if(!pe(a))throw F.create("not-registered");const i=a.authToken;if(!t&&function(e){return 2===e.requestStatus&&!function(e){const t=Date.now();return t<e.creationTime||e.creationTime+e.expiresIn<t+36e5}(e)}(i))return a;if(1===i.requestStatus)return n=async function(e,t){let n=await fe(e.appConfig);for(;1===n.authToken.requestStatus;)await W(100),n=await fe(e.appConfig);const a=n.authToken;return 0===a.requestStatus?de(e,t):a}(e,t),a;{if(!navigator.onLine)throw F.create("app-offline");const t=function(e){const t={requestStatus:1,requestTime:Date.now()};return Object.assign(Object.assign({},e),{authToken:t})}(a);return n=async function(e,t){try{const n=await ue(e,t),a=Object.assign(Object.assign({},t),{authToken:n});return await ae(e.appConfig,a),n}catch(n){if(!x(n)||401!==n.customData.serverCode&&404!==n.customData.serverCode){const n=Object.assign(Object.assign({},t),{authToken:{requestStatus:0}});await ae(e.appConfig,n)}else await ie(e.appConfig);throw n}}(e,t),t}}));return n?await n:a.authToken}function fe(e){return re(e,(e=>{if(!pe(e))throw F.create("not-registered");const t=e.authToken;return 1===(n=t).requestStatus&&n.requestTime+1e4<Date.now()?Object.assign(Object.assign({},e),{authToken:{requestStatus:0}}):e;var n}))}function pe(e){return void 0!==e&&2===e.registrationStatus}async function he(e,t=!1){const n=e;await async function(e){const{registrationPromise:t}=await oe(e);t&&await t}(n);return(await de(n,t)).token}function ge(e){return F.create("missing-app-config-values",{valueName:e})}const me=e=>{const t=e.getProvider("app").getImmediate(),a=n(t,"installations").getImmediate();return{getId:()=>async function(e){const t=e,{installationEntry:n,registrationPromise:a}=await oe(t);return a?a.catch(console.error):de(t).catch(console.error),n.fid}(a),getToken:e=>he(a,e)}};t(new I("installations",(e=>{const t=e.getProvider("app").getImmediate(),a=function(e){if(!e||!e.options)throw ge("App Configuration");if(!e.name)throw ge("App Name");const t=["projectId","apiKey","appId"];for(const n of t)if(!e.options[n])throw ge(n);return{appName:e.name,projectId:e.options.projectId,apiKey:e.options.apiKey,appId:e.options.appId}}(t);return{app:t,appConfig:a,heartbeatServiceProvider:n(t,"heartbeat"),_delete:()=>Promise.resolve()}}),"PUBLIC")),t(new I("installations-internal",me,"PRIVATE")),e(N,"0.5.16"),e(N,"0.5.16","esm2017");const we="https://www.googletagmanager.com/gtag/js",ye=new class{constructor(e){this.name=e,this._logLevel=o,this._logHandler=c,this._userLogHandler=null}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in i))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,i.DEBUG,...e),this._logHandler(this,i.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,i.VERBOSE,...e),this._logHandler(this,i.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,i.INFO,...e),this._logHandler(this,i.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,i.WARN,...e),this._logHandler(this,i.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,i.ERROR,...e),this._logHandler(this,i.ERROR,...e)}}("@firebase/analytics");function ve(e){return Promise.all(e.map((e=>e.catch((e=>e)))))}function Ie(e,t,n,a){return async function(i,r,o){try{"event"===i?await async function(e,t,n,a,i){try{let r=[];if(i&&i.send_to){let e=i.send_to;Array.isArray(e)||(e=[e]);const a=await ve(n);for(const n of e){const e=a.find((e=>e.measurementId===n)),i=e&&t[e.appId];if(!i){r=[];break}r.push(i)}}0===r.length&&(r=Object.values(t)),await Promise.all(r),e("event",a,i||{})}catch(e){ye.error(e)}}(e,t,n,r,o):"config"===i?await async function(e,t,n,a,i,r){const o=a[i];try{if(o)await t[o];else{const e=(await ve(n)).find((e=>e.measurementId===i));e&&await t[e.appId]}}catch(e){ye.error(e)}e("config",i,r)}(e,t,n,a,r,o):"consent"===i?e("consent","update",o):e("set",r)}catch(e){ye.error(e)}}}const be=new h("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.'});const Ee=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]}};function Te(e){return new Headers({Accept:"application/json","x-goog-api-key":e})}async function De(e,t=Ee,n){const{appId:a,apiKey:i,measurementId:r}=e.options;if(!a)throw be.create("no-app-id");if(!i){if(r)return{measurementId:r,appId:a};throw be.create("no-api-key")}const o=t.getThrottleMetadata(a)||{backoffCount:0,throttleEndTimeMillis:Date.now()},s=new ke;return setTimeout((async()=>{s.abort()}),void 0!==n?n:6e4),Se({appId:a,apiKey:i,measurementId:r},o,s,t)}async function Se(e,{throttleEndTimeMillis:t,backoffCount:n},a,i=Ee){var r,o;const{appId:s,measurementId:c}=e;try{await function(e,t){return new Promise(((n,a)=>{const i=Math.max(t-Date.now(),0),r=setTimeout(n,i);e.addEventListener((()=>{clearTimeout(r),a(be.create("fetch-throttle",{throttleEndTimeMillis:t}))}))}))}(a,t)}catch(e){if(c)return ye.warn(`Timed out fetching this Firebase app's measurement ID from the server. Falling back to the measurement ID ${c} provided in the "measurementId" field in the local Firebase config. [${null===(r=e)||void 0===r?void 0:r.message}]`),{appId:s,measurementId:c};throw e}try{const t=await async function(e){var t;const{appId:n,apiKey:a}=e,i={method:"GET",headers:Te(a)},r="https://firebase.googleapis.com/v1alpha/projects/-/apps/{app-id}/webConfig".replace("{app-id}",n),o=await fetch(r,i);if(200!==o.status&&304!==o.status){let e="";try{const n=await o.json();(null===(t=n.error)||void 0===t?void 0:t.message)&&(e=n.error.message)}catch(e){}throw be.create("config-fetch-failed",{httpStatus:o.status,responseMessage:e})}return o.json()}(e);return i.deleteThrottleMetadata(s),t}catch(t){const r=t;if(!function(e){if(!(e instanceof p&&e.customData))return!1;const t=Number(e.customData.httpStatus);return 429===t||500===t||503===t||504===t}(r)){if(i.deleteThrottleMetadata(s),c)return ye.warn(`Failed to fetch this Firebase app's measurement ID from the server. Falling back to the measurement ID ${c} provided in the "measurementId" field in the local Firebase config. [${null==r?void 0:r.message}]`),{appId:s,measurementId:c};throw t}const l=503===Number(null===(o=null==r?void 0:r.customData)||void 0===o?void 0:o.httpStatus)?y(n,i.intervalMillis,30):y(n,i.intervalMillis),u={throttleEndTimeMillis:Date.now()+l,backoffCount:n+1};return i.setThrottleMetadata(s,u),ye.debug(`Calling attemptFetch again in ${l} millis`),Se(e,u,a,i)}}class ke{constructor(){this.listeners=[]}addEventListener(e){this.listeners.push(e)}abort(){this.listeners.forEach((e=>e()))}}let Ce,Le;function je(e){Le=e}function Oe(e){Ce=e}async function $e(e,t,n,a,i,r,o){var s;const c=De(e);c.then((t=>{n[t.measurementId]=t.appId,e.options.measurementId&&t.measurementId!==e.options.measurementId&&ye.warn(`The measurement ID in the local Firebase config (${e.options.measurementId}) does not match the measurement ID fetched from the server (${t.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=>ye.error(e))),t.push(c);const l=async function(){var e;if(!u())return ye.warn(be.create("indexeddb-unavailable",{errorInfo:"IndexedDB is not available in this environment."}).message),!1;try{await d()}catch(t){return ye.warn(be.create("indexeddb-unavailable",{errorInfo:null===(e=t)||void 0===e?void 0:e.toString()}).message),!1}return!0}().then((e=>e?a.getId():void 0)),[f,p]=await Promise.all([c,l]);(function(e){const t=window.document.getElementsByTagName("script");for(const n of Object.values(t))if(n.src&&n.src.includes(we)&&n.src.includes(e))return n;return null})(r)||function(e,t){const n=document.createElement("script");n.src=`${we}?l=${e}&id=${t}`,n.async=!0,document.head.appendChild(n)}(r,f.measurementId),Le&&(i("consent","default",Le),je(void 0)),i("js",new Date);const h=null!==(s=null==o?void 0:o.config)&&void 0!==s?s:{};return h.origin="firebase",h.update=!0,null!=p&&(h.firebase_id=p),i("config",f.measurementId,h),Ce&&(i("set",Ce),Oe(void 0)),f.measurementId}class Pe{constructor(e){this.app=e}_delete(){return delete Me[this.app.options.appId],Promise.resolve()}}let Me={},_e=[];const Ae={};let Be,Ne,Fe="dataLayer",xe="gtag",Re=!1;function He(e){if(Re)throw be.create("already-initialized");e.dataLayerName&&(Fe=e.dataLayerName),e.gtagName&&(xe=e.gtagName)}function qe(e,t,n){!function(){const e=[];if(l()&&e.push("This is a browser extension environment."),f()||e.push("Cookies are not available."),e.length>0){const t=e.map(((e,t)=>`(${t+1}) ${e}`)).join(" "),n=be.create("invalid-analytics-context",{errorInfo:t});ye.warn(n.message)}}();const a=e.options.appId;if(!a)throw be.create("no-app-id");if(!e.options.apiKey){if(!e.options.measurementId)throw be.create("no-api-key");ye.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!=Me[a])throw be.create("already-exists",{id:a});if(!Re){!function(e){let t=[];Array.isArray(window[e])?t=window[e]:window[e]=t}(Fe);const{wrappedGtag:e,gtagCore:t}=function(e,t,n,a,i){let r=function(...e){window[a].push(arguments)};return window[i]&&"function"==typeof window[i]&&(r=window[i]),window[i]=Ie(r,e,t,n),{gtagCore:r,wrappedGtag:window[i]}}(Me,_e,Ae,Fe,xe);Ne=e,Be=t,Re=!0}Me[a]=$e(e,_e,Ae,t,Be,Fe,n);return new Pe(e)}function ze(e=a()){e=v(e);const t=n(e,"analytics");return t.isInitialized()?t.getImmediate():Ve(e)}function Ve(e,t={}){const a=n(e,"analytics");if(a.isInitialized()){const e=a.getImmediate();if(m(t,a.getOptions()))return e;throw be.create("already-initialized")}return a.initialize({options:t})}async function Ke(){if(l())return!1;if(!f())return!1;if(!u())return!1;try{return await d()}catch(e){return!1}}function We(e,t,n){e=v(e),async function(e,t,n,a){if(a&&a.global)return e("set",{screen_name:n}),Promise.resolve();e("config",await t,{update:!0,screen_name:n})}(Ne,Me[e.app.options.appId],t,n).catch((e=>ye.error(e)))}function Ge(e,t,n){e=v(e),async function(e,t,n,a){if(a&&a.global)return e("set",{user_id:n}),Promise.resolve();e("config",await t,{update:!0,user_id:n})}(Ne,Me[e.app.options.appId],t,n).catch((e=>ye.error(e)))}function Ue(e,t,n){e=v(e),async function(e,t,n,a){if(a&&a.global){const t={};for(const e of Object.keys(n))t[`user_properties.${e}`]=n[e];return e("set",t),Promise.resolve()}e("config",await t,{update:!0,user_properties:n})}(Ne,Me[e.app.options.appId],t,n).catch((e=>ye.error(e)))}function Je(e,t){e=v(e),async function(e,t){const n=await e;window[`ga-disable-${n}`]=!t}(Me[e.app.options.appId],t).catch((e=>ye.error(e)))}function Ye(e){Ne?Ne("set",e):Oe(e)}function Ze(e,t,n,a){e=v(e),async function(e,t,n,a,i){if(i&&i.global)e("event",n,a);else{const i=await t;e("event",n,Object.assign(Object.assign({},a),{send_to:i}))}}(Ne,Me[e.app.options.appId],t,n,a).catch((e=>ye.error(e)))}function Qe(e){Ne?Ne("consent","update",e):je(e)}const Xe="@firebase/analytics";t(new I("analytics",((e,{options:t})=>qe(e.getProvider("app").getImmediate(),e.getProvider("installations-internal").getImmediate(),t)),"PUBLIC")),t(new I("analytics-internal",(function(e){try{const t=e.getProvider("analytics").getImmediate();return{logEvent:(e,n,a)=>Ze(t,e,n,a)}}catch(e){throw be.create("interop-component-reg-failed",{reason:e})}}),"PRIVATE")),e(Xe,"0.8.4"),e(Xe,"0.8.4","esm2017");export{ze as getAnalytics,Ve as initializeAnalytics,Ke as isSupported,Ze as logEvent,Je as setAnalyticsCollectionEnabled,Qe as setConsent,We as setCurrentScreen,Ye as setDefaultEventParameters,Ge as setUserId,Ue as setUserProperties,He as settings};
2
2
 
3
3
  //# sourceMappingURL=firebase-analytics.js.map
@@ -1,4 +1,4 @@
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(Ae,Te){"use strict";try{!(function(){function e(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t,r,n=e(Ae);const a={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 n=e?this.byteToCharMapWebSafe_:this.byteToCharMap_;const a=[];for(let l=0;l<r.length;l+=3){var o=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)),a.push(n[o>>2],n[(3&o)<<4|s>>4],n[e],n[t])}return a.join("")},encodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(function(t){const r=[];let n=0;for(let a=0;a<t.length;a++){let e=t.charCodeAt(a);e<128?r[n++]=e:(e<2048?r[n++]=e>>6|192:(55296==(64512&e)&&a+1<t.length&&56320==(64512&t.charCodeAt(a+1))?(e=65536+((1023&e)<<10)+(1023&t.charCodeAt(++a)),r[n++]=e>>18|240,r[n++]=e>>12&63|128):r[n++]=e>>12|224,r[n++]=e>>6&63|128),r[n++]=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,n=0;for(;r<e.length;){var a,o,i=e[r++];i<128?t[n++]=String.fromCharCode(i):191<i&&i<224?(a=e[r++],t[n++]=String.fromCharCode((31&i)<<6|63&a)):239<i&&i<365?(o=((7&i)<<18|(63&e[r++])<<12|(63&e[r++])<<6|63&e[r++])-65536,t[n++]=String.fromCharCode(55296+(o>>10)),t[n++]=String.fromCharCode(56320+(1023&o))):(a=e[r++],o=e[r++],t[n++]=String.fromCharCode((15&i)<<12|(63&a)<<6|63&o))}return t.join("")}(this.decodeStringToByteArray(e,t))},decodeStringToByteArray(e,t){this.init_();var r=t?this.charToByteMapWebSafe_:this.charToByteMap_;const n=[];for(let c=0;c<e.length;){var a=r[e.charAt(c++)],o=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==a||null==o||null==i||null==s)throw Error();n.push(a<<2|o>>4),64!==i&&(n.push(o<<4&240|i>>2),64!==s&&n.push(i<<6&192|s))}return n},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 a.decodeString(e,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};function o(){return"object"==typeof indexedDB}class s{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))}}}class c extends Error{constructor(e,t,r){super(t),this.code=e,this.customData=r,this.name="FirebaseError",Object.setPrototypeOf(this,c.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,h.prototype.create)}}class h{constructor(e,t,r){this.service=e,this.serviceName=t,this.errors=r}create(e,...t){var n,r=t[0]||{},a=`${this.service}/${e}`,o=this.errors[e],o=o?(n=r,o.replace(l,(e,t)=>{var r=n[t];return null!=r?String(r):`<${t}?>`})):"Error",o=`${this.serviceName}: ${o} (${a}).`;return new c(a,o,r)}}const l=/\{\$([^}]+)}/g;function p(e){return JSON.parse(e)}function u(e){const t=function(e){let t={},r={},n={},a="";try{var o=e.split(".");t=p(i(o[0])||""),r=p(i(o[1])||""),a=o[2],n=r.d||{},delete r.d}catch(e){}return{header:t,claims:r,data:n,signature:a}}(e).claims;return"object"==typeof t&&t.hasOwnProperty("iat")?t.iat:null}function d(){return"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)})}const g=144e5,f=.5;class v{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 b={debug:t.DEBUG,verbose:t.VERBOSE,info:t.INFO,warn:t.WARN,error:t.ERROR,silent:t.SILENT},E=t.INFO,_={[t.DEBUG]:"log",[t.VERBOSE]:"log",[t.INFO]:"info",[t.WARN]:"warn",[t.ERROR]:"error"},w=(e,t,...r)=>{if(!(t<e.logLevel)){var n=(new Date).toISOString(),a=_[t];if(!a)throw new Error(`Attempted to log a message with an invalid logType (value: ${t})`);console[a](`[${n}] ${e.name}:`,...r)}};const m=new Map,k={activated:!1,tokenObservers:[]},y={initialized:!1,enabled:!1};function A(e){return m.get(e)||k}function T(e,t){m.set(e,t)}const C="https://content-firebaseappcheck.googleapis.com/v1",S="exchangeDebugToken",O={OFFSET_DURATION:3e5,RETRIAL_MIN_WAIT:3e4,RETRIAL_MAX_WAIT:96e4};class R{constructor(e,t,r,n,a){if(this.operation=e,this.retryPolicy=t,this.getWaitDuration=r,this.lowerBound=n,this.upperBound=a,this.pending=null,a<(this.nextErrorWaitInterval=n))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 s,t=this.getNextRun(e),await new Promise(e=>{setTimeout(e,t)}),this.pending.resolve(),await this.pending.promise,this.pending=new s,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 P=new h("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 I(e=!1){var t;return e?null===(t=self.grecaptcha)||void 0===t?void 0:t.enterprise:self.grecaptcha}function D(e){if(!A(e).activated)throw P.create("use-before-activation",{appName:e.name})}function x(e){var t=Math.round(e/1e3),r=Math.floor(t/86400),n=Math.floor((t-3600*r*24)/3600),a=Math.floor((t-3600*r*24-3600*n)/60),t=t-3600*r*24-3600*n-60*a;let o="";return r&&(o+=N(r)+"d:"),n&&(o+=N(n)+"h:"),o+=N(a)+"m:"+N(t)+"s",o}function N(e){return 0===e?"00":10<=e?e.toString():"0"+e}async function M({url:e,body:t},r){const n={"Content-Type":"application/json"},a=r.getImmediate({optional:!0});!a||(c=await a.getHeartbeatsHeader())&&(n["X-Firebase-Client"]=c);var o={method:"POST",body:JSON.stringify(t),headers:n};let i;try{i=await fetch(e,o)}catch(e){throw P.create("fetch-network-error",{originalErrorMessage:null===e||void 0===e?void 0:e.message})}if(200!==i.status)throw P.create("fetch-status-error",{httpStatus:i.status});let s;try{s=await i.json()}catch(e){throw P.create("fetch-parse-error",{originalErrorMessage:null===e||void 0===e?void 0:e.message})}var c=s.ttl.match(/^([\d.]+)(s)$/);if(!c||!c[2]||isNaN(Number(c[1])))throw P.create("fetch-parse-error",{originalErrorMessage:"ttl field (timeToLive) is not in standard Protobuf Duration "+`format: ${s.ttl}`});o=1e3*Number(c[1]),c=Date.now();return{token:s.token,expireTimeMillis:c+o,issuedAtTimeMillis:c}}const L="firebase-app-check-database",B=1,j="firebase-app-check-store",H="debug-token";let $=null;function W(){return $||($=new Promise((t,r)=>{try{const e=indexedDB.open(L,B);e.onsuccess=e=>{t(e.target.result)},e.onerror=e=>{var t;r(P.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(j,{keyPath:"compositeKey"})}}catch(e){r(P.create("storage-open",{originalErrorMessage:null===e||void 0===e?void 0:e.message}))}}),$)}async function F(e,t){const r=await W(),n=r.transaction(j,"readwrite"),a=n.objectStore(j),o=a.put({compositeKey:e,value:t});return new Promise((t,r)=>{o.onsuccess=e=>{t()},n.onerror=e=>{var t;r(P.create("storage-set",{originalErrorMessage:null===(t=e.target.error)||void 0===t?void 0:t.message}))}})}async function V(e){const t=await W(),a=t.transaction(j,"readonly"),r=a.objectStore(j),o=r.get(e);return new Promise((r,n)=>{o.onsuccess=e=>{var t=e.target.result;r(t?t.value:void 0)},a.onerror=e=>{var t;n(P.create("storage-get",{originalErrorMessage:null===(t=e.target.error)||void 0===t?void 0:t.message}))}})}function K(e){return`${e.options.appId}-${e.name}`}const z=new class{constructor(e){this.name=e,this._logLevel=E,this._logHandler=w,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?b[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 U(t){if(o()){let e=void 0;try{e=await V(K(t))}catch(e){z.warn(`Failed to read token from IndexedDB. Error: ${e}`)}return e}}function q(e,t){return o()?F(K(e),t).catch(e=>{z.warn(`Failed to write token to IndexedDB. Error: ${e}`)}):Promise.resolve()}async function G(){let e=void 0;try{e=await V(H)}catch(e){}if(e)return e;var t,r=d();return t=r,F(H,t).catch(e=>z.warn(`Failed to persist debug token to IndexedDB. Error: ${e}`)),r}function X(){return y.enabled}async function J(){var e=y;if(e.enabled&&e.token)return e.token.promise;throw Error(`
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(ye,Ae){"use strict";try{!(function(){function e(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t,r,o=e(ye);const n={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 n.decodeString(e,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};function a(){return"object"==typeof indexedDB}class s{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))}}}class c extends Error{constructor(e,t,r){super(t),this.code=e,this.customData=r,this.name="FirebaseError",Object.setPrototypeOf(this,c.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,h.prototype.create)}}class h{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 c(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}function d(){return"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)})}const g=144e5,f=.5;class v{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 E={debug:t.DEBUG,verbose:t.VERBOSE,info:t.INFO,warn:t.WARN,error:t.ERROR,silent:t.SILENT},_=t.INFO,w={[t.DEBUG]:"log",[t.VERBOSE]:"log",[t.INFO]:"info",[t.WARN]:"warn",[t.ERROR]:"error"},m=(e,t,...r)=>{if(!(t<e.logLevel)){var o=(new Date).toISOString(),n=w[t];if(!n)throw new Error(`Attempted to log a message with an invalid logType (value: ${t})`);console[n](`[${o}] ${e.name}:`,...r)}};const b=new Map,k={activated:!1,tokenObservers:[]},y={initialized:!1,enabled:!1};function A(e){return b.get(e)||Object.assign({},k)}const T="https://content-firebaseappcheck.googleapis.com/v1",C="exchangeDebugToken",S={OFFSET_DURATION:3e5,RETRIAL_MIN_WAIT:3e4,RETRIAL_MAX_WAIT:96e4};class R{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 s,t=this.getNextRun(e),await new Promise(e=>{setTimeout(e,t)}),this.pending.resolve(),await this.pending.promise,this.pending=new s,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 P=new h("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 I(e=!1){var t;return e?null===(t=self.grecaptcha)||void 0===t?void 0:t.enterprise:self.grecaptcha}function D(e){if(!A(e).activated)throw P.create("use-before-activation",{appName:e.name})}function O(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||(c=await n.getHeartbeatsHeader())&&(o["X-Firebase-Client"]=c);var a={method:"POST",body:JSON.stringify(t),headers:o};let i;try{i=await fetch(e,a)}catch(e){throw P.create("fetch-network-error",{originalErrorMessage:null===e||void 0===e?void 0:e.message})}if(200!==i.status)throw P.create("fetch-status-error",{httpStatus:i.status});let s;try{s=await i.json()}catch(e){throw P.create("fetch-parse-error",{originalErrorMessage:null===e||void 0===e?void 0:e.message})}var c=s.ttl.match(/^([\d.]+)(s)$/);if(!c||!c[2]||isNaN(Number(c[1])))throw P.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.token,expireTimeMillis:c+a,issuedAtTimeMillis:c}}const M="firebase-app-check-database",L=1,B="firebase-app-check-store",H="debug-token";let $=null;function j(){return $||($=new Promise((t,r)=>{try{const e=indexedDB.open(M,L);e.onsuccess=e=>{t(e.target.result)},e.onerror=e=>{var t;r(P.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(P.create("storage-open",{originalErrorMessage:null===e||void 0===e?void 0:e.message}))}}),$)}async function W(e,t){const r=await j(),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(P.create("storage-set",{originalErrorMessage:null===(t=e.target.error)||void 0===t?void 0:t.message}))}})}async function F(e){const t=await j(),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(P.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=_,this._logHandler=m,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?E[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(a()){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 a()?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(H)}catch(e){}if(e)return e;var t,r=d();return t=r,W(H,t).catch(e=>K.warn(`Failed to persist debug token to IndexedDB. Error: ${e}`)),r}function G(){return y.enabled}async function X(){var e=y;if(e.enabled&&e.token)return e.token.promise;throw Error(`
2
2
  Can't get debug token in production mode.
3
- `)}function Y(){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=y;if(t.initialized=!0,"string"==typeof e.FIREBASE_APPCHECK_DEBUG_TOKEN||!0===e.FIREBASE_APPCHECK_DEBUG_TOKEN){t.enabled=!0;const r=new s;t.token=r,"string"==typeof e.FIREBASE_APPCHECK_DEBUG_TOKEN?r.resolve(e.FIREBASE_APPCHECK_DEBUG_TOKEN):r.resolve(G())}}const Z={error:"UNKNOWN_ERROR"};async function Q(e,t=!1){var r=e.app;D(r);const n=A(r);let a=n.token,o=void 0;if(a&&!ae(a)&&(T(r,Object.assign(Object.assign({},n),{token:void 0})),a=void 0),a||(s=await n.cachedTokenPromise)&&(ae(s)?a=s:await q(r,void 0)),!t&&a&&ae(a))return{token:a.token};let i=!1;if(X()){n.exchangeTokenPromise||(n.exchangeTokenPromise=M(function(e,t){var{projectId:r,appId:n,apiKey:a}=e.options;return{url:`${C}/projects/${r}/apps/${n}:${S}?key=${a}`,body:{debug_token:t}}}(r,await J()),e.heartbeatServiceProvider).finally(()=>{n.exchangeTokenPromise=void 0}),i=!0);var s=await n.exchangeTokenPromise;return await q(r,s),T(r,Object.assign(Object.assign({},n),{token:s})),{token:s.token}}try{n.exchangeTokenPromise||(n.exchangeTokenPromise=n.provider.getToken().finally(()=>{n.exchangeTokenPromise=void 0}),i=!0),a=await n.exchangeTokenPromise}catch(e){"appCheck/throttled"===e.code?z.warn(e.message):z.error(e),o=e}let c;return a?o?c=ae(a)?{token:a.token,internalError:o}:oe(o):(c={token:a.token},T(r,Object.assign(Object.assign({},n),{token:a})),await q(r,a)):c=oe(o),i&&ne(r,c),c}function ee(e,t,r,n){var a=e["app"];const o=A(a);var i={next:r,error:n,type:t};if(T(a,Object.assign(Object.assign({},o),{tokenObservers:[...o.tokenObservers,i]})),o.token&&ae(o.token)){const s=o.token;Promise.resolve().then(()=>{r({token:s.token}),re(e)}).catch(()=>{})}o.cachedTokenPromise.then(()=>re(e))}function te(e,t){const r=A(e);var n=r.tokenObservers.filter(e=>e.next!==t);0===n.length&&r.tokenRefresher&&r.tokenRefresher.isRunning()&&r.tokenRefresher.stop(),T(e,Object.assign(Object.assign({},r),{tokenObservers:n}))}function re(e){var t=e["app"],r=A(t);let n=r.tokenRefresher;n||(n=function(r){const n=r["app"];return new R(async()=>{var e=A(n);let t;if(t=e.token?await Q(r,!0):await Q(r),t.error)throw t.error;if(t.internalError)throw t.internalError},()=>!0,()=>{var e=A(n);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},O.RETRIAL_MIN_WAIT,O.RETRIAL_MAX_WAIT)}(e),T(t,Object.assign(Object.assign({},r),{tokenRefresher:n}))),!n.isRunning()&&r.isTokenAutoRefreshEnabled&&n.start()}function ne(e,t){for(const r of A(e).tokenObservers)try{"EXTERNAL"===r.type&&null!=t.error?r.error(t.error):r.next(t)}catch(e){}}function ae(e){return 0<e.expireTimeMillis-Date.now()}function oe(e){return{token:(t=Z,a.encodeString(JSON.stringify(t),!1)),error:e};var t}class ie{constructor(e,t){this.app=e,this.heartbeatServiceProvider=t}_delete(){var e=A(this.app)["tokenObservers"];for(const t of e)te(this.app,t.next);return Promise.resolve()}}const se="https://www.google.com/recaptcha/api.js",ce="https://www.google.com/recaptcha/enterprise.js";function he(t,r){var e=A(t);const n=new s;T(t,Object.assign(Object.assign({},e),{reCAPTCHAState:{initialized:n}}));const a=ue(t);e=I(!1);return e?pe(t,r,e,a,n):function(e){const t=document.createElement("script");t.src=se,t.onload=e,document.head.appendChild(t)}(()=>{var e=I(!1);if(!e)throw new Error("no recaptcha");pe(t,r,e,a,n)}),n.promise}function le(t,r){var e=A(t);const n=new s;T(t,Object.assign(Object.assign({},e),{reCAPTCHAState:{initialized:n}}));const a=ue(t);e=I(!0);return e?pe(t,r,e,a,n):function(e){const t=document.createElement("script");t.src=ce,t.onload=e,document.head.appendChild(t)}(()=>{var e=I(!0);if(!e)throw new Error("no recaptcha");pe(t,r,e,a,n)}),n.promise}function pe(n,a,o,i,s){o.ready(()=>{var e,t,r;e=n,t=o.render(i,{sitekey:a,size:"invisible"}),r=A(e),T(e,Object.assign(Object.assign({},r),{reCAPTCHAState:Object.assign(Object.assign({},r.reCAPTCHAState),{widgetId:t})})),s.resolve(o)})}function ue(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 de(n){D(n);const a=await A(n).reCAPTCHAState.initialized.promise;return new Promise((e,t)=>{const r=A(n).reCAPTCHAState;a.ready(()=>{e(a.execute(r.widgetId,{action:"fire_app_check"}))})})}class ge{constructor(e){this._siteKey=e,this._throttleData=null}async getToken(){Ee(this._throttleData);var t=await de(this._app).catch(e=>{throw P.create("recaptcha-error")});let e;try{e=await M(function(e,t){var{projectId:r,appId:n,apiKey:a}=e.options;return{url:`${C}/projects/${r}/apps/${n}:exchangeRecaptchaV3Token?key=${a}`,body:{recaptcha_v3_token:t}}}(this._app,t),this._heartbeatServiceProvider)}catch(e){throw null!==(t=e.code)&&void 0!==t&&t.includes("fetch-status-error")?(this._throttleData=be(Number(null===(t=e.customData)||void 0===t?void 0:t.httpStatus),this._throttleData),P.create("throttled",{time:x(this._throttleData.allowRequestsAfter-Date.now()),httpStatus:this._throttleData.httpStatus})):e}return this._throttleData=null,e}initialize(e){this._app=e,this._heartbeatServiceProvider=Te._getProvider(e,"heartbeat"),he(e,this._siteKey).catch(()=>{})}isEqual(e){return e instanceof ge&&this._siteKey===e._siteKey}}class fe{constructor(e){this._siteKey=e,this._throttleData=null}async getToken(){Ee(this._throttleData);var t=await de(this._app).catch(e=>{throw P.create("recaptcha-error")});let e;try{e=await M(function(e,t){var{projectId:r,appId:n,apiKey:a}=e.options;return{url:`${C}/projects/${r}/apps/${n}:exchangeRecaptchaEnterpriseToken?key=${a}`,body:{recaptcha_enterprise_token:t}}}(this._app,t),this._heartbeatServiceProvider)}catch(e){throw null!==(t=e.code)&&void 0!==t&&t.includes("fetch-status-error")?(this._throttleData=be(Number(null===(t=e.customData)||void 0===t?void 0:t.httpStatus),this._throttleData),P.create("throttled",{time:x(this._throttleData.allowRequestsAfter-Date.now()),httpStatus:this._throttleData.httpStatus})):e}return this._throttleData=null,e}initialize(e){this._app=e,this._heartbeatServiceProvider=Te._getProvider(e,"heartbeat"),le(e,this._siteKey).catch(()=>{})}isEqual(e){return e instanceof fe&&this._siteKey===e._siteKey}}class ve{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 ve&&this._customProviderOptions.getToken.toString()===e._customProviderOptions.getToken.toString()}}function be(e,t){if(404===e||403===e)return{backoffCount:1,allowRequestsAfter:Date.now()+864e5,httpStatus:e};var r,n,a=t?t.backoffCount:0,n=(t=2,r=1e3*Math.pow(t,a),n=Math.round(f*r*(Math.random()-.5)*2),Math.min(g,r+n));return{backoffCount:a+1,allowRequestsAfter:Date.now()+n,httpStatus:e}}function Ee(e){if(e&&Date.now()-e.allowRequestsAfter<=0)throw P.create("throttled",{time:x(e.allowRequestsAfter-Date.now()),httpStatus:e.httpStatus})}function _e(e=Te.getApp(),t){var r;e=(r=e)&&r._delegate?r._delegate:r;const n=Te._getProvider(e,"app-check");if(y.initialized||Y(),X()&&J().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.`)),n.isInitialized()){var a=n.getImmediate();const o=n.getOptions();if(o.isTokenAutoRefreshEnabled===t.isTokenAutoRefreshEnabled&&o.provider.isEqual(t.provider))return a;throw P.create("already-initialized",{appName:e.name})}a=n.initialize({options:t});return function(t,e,r){const n=A(t),a=Object.assign(Object.assign({},n),{activated:!0});a.provider=e,a.cachedTokenPromise=U(t).then(e=>(e&&ae(e)&&(T(t,Object.assign(Object.assign({},A(t)),{token:e})),ne(t,{token:e.token})),e)),a.isTokenAutoRefreshEnabled=void 0===r?t.automaticDataCollectionEnabled:r,T(t,a),a.provider.initialize(t)}(e,t.provider,t.isTokenAutoRefreshEnabled),A(e).isTokenAutoRefreshEnabled&&ee(a,"INTERNAL",()=>{}),a}const we="app-check-internal";Te._registerComponent(new v("app-check",e=>{var t,r=e.getProvider("app").getImmediate(),n=e.getProvider("heartbeat");return t=r,e=n,new ie(t,e)},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((e,t,r)=>{e.getProvider(we).initialize()})),Te._registerComponent(new v(we,e=>{var t,r=e.getProvider("app-check").getImmediate();return t=r,{getToken:e=>Q(t,e),addTokenListener:e=>ee(t,"INTERNAL",e),removeTokenListener:e=>te(t.app,e)}},"PUBLIC").setInstantiationMode("EXPLICIT")),Te.registerVersion("@firebase/app-check","0.5.16");const me=new h("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 ke{constructor(e){this.app=e}activate(e,t){let r;r="string"==typeof e?new ge(e):e instanceof fe||e instanceof ge||e instanceof ve?e:new ve({getToken:e.getToken}),this._delegate=_e(this.app,{provider:r,isTokenAutoRefreshEnabled:t})}setTokenAutoRefreshEnabled(e){if(!this._delegate)throw me.create("use-before-activation",{appName:this.app.name});!function(e,t){var r=e.app;const n=A(r);n.tokenRefresher&&(!0===t?n.tokenRefresher.start():n.tokenRefresher.stop()),T(r,Object.assign(Object.assign({},n),{isTokenAutoRefreshEnabled:t}))}(this._delegate,e)}getToken(e){if(!this._delegate)throw me.create("use-before-activation",{appName:this.app.name});return async function(e,t){var r=await Q(e,t);if(r.error)throw r.error;return{token:r.token}}(this._delegate,e)}onTokenChanged(e,t,r){if(!this._delegate)throw me.create("use-before-activation",{appName:this.app.name});return function(e,t,r){let n=()=>{},a=()=>{};return n=null!=t.next?t.next.bind(t):t,null!=t.error?a=t.error.bind(t):r&&(a=r),ee(e,"EXTERNAL",n,a),()=>te(e.app,n)}(this._delegate,e,t)}}const ye=e=>{var t=e.getProvider("app-compat").getImmediate();return new ke(t)};n.default.INTERNAL.registerComponent(new v("appCheck-compat",ye,"PUBLIC").setServiceProps({ReCaptchaEnterpriseProvider:fe,ReCaptchaV3Provider:ge,CustomProvider:ve})),n.default.registerVersion("@firebase/app-check-compat","0.2.16")}).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=y;if(t.initialized=!0,"string"==typeof e.FIREBASE_APPCHECK_DEBUG_TOKEN||!0===e.FIREBASE_APPCHECK_DEBUG_TOKEN){t.enabled=!0;const r=new s;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;D(r);const o=A(r);let n=o.token,a=void 0;if(n&&!oe(n)&&(o.token=void 0,n=void 0),n||(s=await o.cachedTokenPromise)&&(oe(s)?n=s:await U(r,void 0)),!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.heartbeatServiceProvider).finally(()=>{o.exchangeTokenPromise=void 0}),i=!0);var s=await o.exchangeTokenPromise;return await U(r,s),{token:(o.token=s).token}}try{o.exchangeTokenPromise||(o.exchangeTokenPromise=o.provider.getToken().finally(()=>{o.exchangeTokenPromise=void 0}),i=!0),n=await A(r).exchangeTokenPromise}catch(e){"appCheck/throttled"===e.code?K.warn(e.message):K.error(e),a=e}let c;return n?a?c=oe(n)?{token:n.token,internalError:a}:ne(a):(c={token:n.token},o.token=n,await U(r,n)):c=ne(a),i&&re(r,c),c}function Q(e,t,r,o){var n=e["app"];const a=A(n);n={next:r,error:o,type:t};if(a.tokenObservers=[...a.tokenObservers,n],a.token&&oe(a.token)){const i=a.token;Promise.resolve().then(()=>{r({token:i.token}),te(e)}).catch(()=>{})}a.cachedTokenPromise.then(()=>te(e))}function ee(e,t){const r=A(e);var o=r.tokenObservers.filter(e=>e.next!==t);0===o.length&&r.tokenRefresher&&r.tokenRefresher.isRunning()&&r.tokenRefresher.stop(),r.tokenObservers=o}function te(e){var t=e["app"];const r=A(t);let o=r.tokenRefresher;o||(o=function(r){const o=r["app"];return new R(async()=>{var e=A(o);let t;if(t=e.token?await Z(r,!0):await Z(r),t.error)throw t.error;if(t.internalError)throw t.internalError},()=>!0,()=>{var e=A(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),r.tokenRefresher=o),!o.isRunning()&&r.isTokenAutoRefreshEnabled&&o.start()}function re(e,t){for(const r of A(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()}function ne(e){return{token:(t=Y,n.encodeString(JSON.stringify(t),!1)),error:e};var t}class ae{constructor(e,t){this.app=e,this.heartbeatServiceProvider=t}_delete(){var e=A(this.app)["tokenObservers"];for(const t of e)ee(this.app,t.next);return Promise.resolve()}}const ie="https://www.google.com/recaptcha/api.js",se="https://www.google.com/recaptcha/enterprise.js";function ce(t,r){const o=new s,e=A(t);e.reCAPTCHAState={initialized:o};const n=pe(t);var a=I(!1);return a?le(t,r,a,n,o):function(e){const t=document.createElement("script");t.src=ie,t.onload=e,document.head.appendChild(t)}(()=>{var e=I(!1);if(!e)throw new Error("no recaptcha");le(t,r,e,n,o)}),o.promise}function he(t,r){const o=new s,e=A(t);e.reCAPTCHAState={initialized:o};const n=pe(t);var a=I(!0);return a?le(t,r,a,n,o):function(e){const t=document.createElement("script");t.src=se,t.onload=e,document.head.appendChild(t)}(()=>{var e=I(!0);if(!e)throw new Error("no recaptcha");le(t,r,e,n,o)}),o.promise}function le(e,t,r,o,n){r.ready(()=>{!function(e,t,r,o){const n=r.render(o,{sitekey:t,size:"invisible"}),a=A(e);a.reCAPTCHAState=Object.assign(Object.assign({},a.reCAPTCHAState),{widgetId:n})}(e,t,r,o),n.resolve(r)})}function pe(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 ue(o){D(o);const n=await A(o).reCAPTCHAState.initialized.promise;return new Promise((e,t)=>{const r=A(o).reCAPTCHAState;n.ready(()=>{e(n.execute(r.widgetId,{action:"fire_app_check"}))})})}class de{constructor(e){this._siteKey=e,this._throttleData=null}async getToken(){Ee(this._throttleData);var t=await ue(this._app).catch(e=>{throw P.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}:exchangeRecaptchaV3Token?key=${n}`,body:{recaptcha_v3_token:t}}}(this._app,t),this._heartbeatServiceProvider)}catch(e){throw null!==(t=e.code)&&void 0!==t&&t.includes("fetch-status-error")?(this._throttleData=ve(Number(null===(t=e.customData)||void 0===t?void 0:t.httpStatus),this._throttleData),P.create("throttled",{time:O(this._throttleData.allowRequestsAfter-Date.now()),httpStatus:this._throttleData.httpStatus})):e}return this._throttleData=null,e}initialize(e){this._app=e,this._heartbeatServiceProvider=Ae._getProvider(e,"heartbeat"),ce(e,this._siteKey).catch(()=>{})}isEqual(e){return e instanceof de&&this._siteKey===e._siteKey}}class ge{constructor(e){this._siteKey=e,this._throttleData=null}async getToken(){Ee(this._throttleData);var t=await ue(this._app).catch(e=>{throw P.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._heartbeatServiceProvider)}catch(e){throw null!==(t=e.code)&&void 0!==t&&t.includes("fetch-status-error")?(this._throttleData=ve(Number(null===(t=e.customData)||void 0===t?void 0:t.httpStatus),this._throttleData),P.create("throttled",{time:O(this._throttleData.allowRequestsAfter-Date.now()),httpStatus:this._throttleData.httpStatus})):e}return this._throttleData=null,e}initialize(e){this._app=e,this._heartbeatServiceProvider=Ae._getProvider(e,"heartbeat"),he(e,this._siteKey).catch(()=>{})}isEqual(e){return e instanceof ge&&this._siteKey===e._siteKey}}class fe{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 fe&&this._customProviderOptions.getToken.toString()===e._customProviderOptions.getToken.toString()}}function ve(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(f*r*(Math.random()-.5)*2),Math.min(g,r+o));return{backoffCount:n+1,allowRequestsAfter:Date.now()+o,httpStatus:e}}function Ee(e){if(e&&Date.now()-e.allowRequestsAfter<=0)throw P.create("throttled",{time:O(e.allowRequestsAfter-Date.now()),httpStatus:e.httpStatus})}function _e(e=Ae.getApp(),t){var r;e=(r=e)&&r._delegate?r._delegate:r;const o=Ae._getProvider(e,"app-check");if(y.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 P.create("already-initialized",{appName:e.name})}n=o.initialize({options:t});return function(t,e,r){const o=function(e,t){return b.set(e,t),b.get(e)}(t,Object.assign({},k));o.activated=!0,o.provider=e,o.cachedTokenPromise=z(t).then(e=>(e&&oe(e)&&(o.token=e,re(t,{token:e.token})),e)),o.isTokenAutoRefreshEnabled=void 0===r?t.automaticDataCollectionEnabled:r,o.provider.initialize(t)}(e,t.provider,t.isTokenAutoRefreshEnabled),A(e).isTokenAutoRefreshEnabled&&Q(n,"INTERNAL",()=>{}),n}const we="app-check-internal";Ae._registerComponent(new v("app-check",e=>{var t,r=e.getProvider("app").getImmediate(),o=e.getProvider("heartbeat");return t=r,e=o,new ae(t,e)},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((e,t,r)=>{e.getProvider(we).initialize()})),Ae._registerComponent(new v(we,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")),Ae.registerVersion("@firebase/app-check","0.5.17-20221109210852");const me=new h("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 be{constructor(e){this.app=e}activate(e,t){let r;r="string"==typeof e?new de(e):e instanceof ge||e instanceof de||e instanceof fe?e:new fe({getToken:e.getToken}),this._delegate=_e(this.app,{provider:r,isTokenAutoRefreshEnabled:t})}setTokenAutoRefreshEnabled(e){if(!this._delegate)throw me.create("use-before-activation",{appName:this.app.name});!function(e,t){const r=A(e.app);r.tokenRefresher&&(!0===t?r.tokenRefresher.start():r.tokenRefresher.stop()),r.isTokenAutoRefreshEnabled=t}(this._delegate,e)}getToken(e){if(!this._delegate)throw me.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 me.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 ke=e=>{var t=e.getProvider("app-compat").getImmediate();return new be(t)};o.default.INTERNAL.registerComponent(new v("appCheck-compat",ke,"PUBLIC").setServiceProps({ReCaptchaEnterpriseProvider:ge,ReCaptchaV3Provider:de,CustomProvider:fe})),o.default.registerVersion("@firebase/app-check-compat","0.2.17-20221109210852")}).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