diff --git a/asset-manifest.json b/asset-manifest.json index 9c74f92..7928b3b 100644 --- a/asset-manifest.json +++ b/asset-manifest.json @@ -1,20 +1,19 @@ { "files": { "main.css": "/static/css/main.0b0a4f1f.chunk.css", - "main.js": "/static/js/main.aa1723da.chunk.js", - "main.js.map": "/static/js/main.aa1723da.chunk.js.map", + "main.js": "/static/js/main.9086a501.chunk.js", + "main.js.map": "/static/js/main.9086a501.chunk.js.map", "runtime-main.js": "/static/js/runtime-main.cea588d5.js", "runtime-main.js.map": "/static/js/runtime-main.cea588d5.js.map", - "static/js/2.a5613496.chunk.js": "/static/js/2.a5613496.chunk.js", - "static/js/2.a5613496.chunk.js.map": "/static/js/2.a5613496.chunk.js.map", + "static/js/2.fdc420f7.chunk.js": "/static/js/2.fdc420f7.chunk.js", + "static/js/2.fdc420f7.chunk.js.map": "/static/js/2.fdc420f7.chunk.js.map", "index.html": "/index.html", - "precache-manifest.d1e2c732dd20b96a1fcdb26742fc6a95.js": "/precache-manifest.d1e2c732dd20b96a1fcdb26742fc6a95.js", + "precache-manifest.f574a4df8dc159be0637ebb5a5744d1f.js": "/precache-manifest.f574a4df8dc159be0637ebb5a5744d1f.js", "service-worker.js": "/service-worker.js", "static/css/main.0b0a4f1f.chunk.css.map": "/static/css/main.0b0a4f1f.chunk.css.map", - "static/js/2.a5613496.chunk.js.LICENSE.txt": "/static/js/2.a5613496.chunk.js.LICENSE.txt", + "static/js/2.fdc420f7.chunk.js.LICENSE.txt": "/static/js/2.fdc420f7.chunk.js.LICENSE.txt", "static/media/beijing1.jpg": "/static/media/beijing1.be0eb5f0.jpg", "static/media/beijing2.jpg": "/static/media/beijing2.e677d45e.jpg", - "static/media/beijing3.jpg": "/static/media/beijing3.6e64c83c.jpg", "static/media/githubLogo3.png": "/static/media/githubLogo3.b1520b04.png", "static/media/hongkong1.jpg": "/static/media/hongkong1.019780a3.jpg", "static/media/hongkong2.jpg": "/static/media/hongkong2.f79ba7e9.jpg", @@ -26,8 +25,8 @@ }, "entrypoints": [ "static/js/runtime-main.cea588d5.js", - "static/js/2.a5613496.chunk.js", + "static/js/2.fdc420f7.chunk.js", "static/css/main.0b0a4f1f.chunk.css", - "static/js/main.aa1723da.chunk.js" + "static/js/main.9086a501.chunk.js" ] } \ No newline at end of file diff --git a/client/src/firebaseConfig.js b/client/src/firebaseConfig.js new file mode 100644 index 0000000..003de0e --- /dev/null +++ b/client/src/firebaseConfig.js @@ -0,0 +1,17 @@ +import firebase from 'firebase'; + +const firebaseKeys = { + apiKey: "AIzaSyBMS2qXIAq9Pyzzk_2HsWDT2yfuo-X44rw", + authDomain: "firestore-5209c.firebaseapp.com", + projectId: "firestore-5209c", + storageBucket: "firestore-5209c.appspot.com", + messagingSenderId: "722361634028", + appId: "1:722361634028:web:da61bcfeaf0e3ac80fe9c9" + }; + + const firebaseApp = firebase.initializeApp(firebaseKeys); + const db = firebase.firestore(firebaseApp); + + + + export default db; \ No newline at end of file diff --git a/index.html b/index.html index 5bfb53d..f68354c 100644 --- a/index.html +++ b/index.html @@ -1 +1 @@ -Otto Kafka
\ No newline at end of file +Otto Kafka
\ No newline at end of file diff --git a/precache-manifest.f574a4df8dc159be0637ebb5a5744d1f.js b/precache-manifest.f574a4df8dc159be0637ebb5a5744d1f.js new file mode 100644 index 0000000..ef8b906 --- /dev/null +++ b/precache-manifest.f574a4df8dc159be0637ebb5a5744d1f.js @@ -0,0 +1,66 @@ +self.__precacheManifest = (self.__precacheManifest || []).concat([ + { + "revision": "7c30e184c0216438e9fa12f6adaf250d", + "url": "/index.html" + }, + { + "revision": "ac69147e28d6177fbf8e", + "url": "/static/css/main.0b0a4f1f.chunk.css" + }, + { + "revision": "5a7e3c78600673d6f69f", + "url": "/static/js/2.fdc420f7.chunk.js" + }, + { + "revision": "f7ae08f9ed3baacb039509795966faad", + "url": "/static/js/2.fdc420f7.chunk.js.LICENSE.txt" + }, + { + "revision": "ac69147e28d6177fbf8e", + "url": "/static/js/main.9086a501.chunk.js" + }, + { + "revision": "5d93c6b2d15332364552", + "url": "/static/js/runtime-main.cea588d5.js" + }, + { + "revision": "be0eb5f0ca8b1a00e6835a64d4088023", + "url": "/static/media/beijing1.be0eb5f0.jpg" + }, + { + "revision": "e677d45ef6565297c59d9575c3e0870a", + "url": "/static/media/beijing2.e677d45e.jpg" + }, + { + "revision": "b1520b0446ac440eb32910bc8882f3f6", + "url": "/static/media/githubLogo3.b1520b04.png" + }, + { + "revision": "019780a3b3c26fe65a91dc8b58493147", + "url": "/static/media/hongkong1.019780a3.jpg" + }, + { + "revision": "f79ba7e9b20b53604b024db4289bac38", + "url": "/static/media/hongkong2.f79ba7e9.jpg" + }, + { + "revision": "51d7aacccbc075351052928511aedcc3", + "url": "/static/media/hongkong3.51d7aacc.jpg" + }, + { + "revision": "b02ef8e17ec0825ca75bb798dc5241cc", + "url": "/static/media/medium.b02ef8e1.png" + }, + { + "revision": "6ebe1e3ebabdfcacb6be7d73731625e8", + "url": "/static/media/otto.6ebe1e3e.jpg" + }, + { + "revision": "72fab47b0de349011d890ecff8a3faeb", + "url": "/static/media/shanghai1.72fab47b.jpg" + }, + { + "revision": "af0866b4362738f3a8f4757a05826916", + "url": "/static/media/shanghai2.af0866b4.jpg" + } +]); \ No newline at end of file diff --git a/service-worker.js b/service-worker.js index d2c89c5..acdfc7f 100644 --- a/service-worker.js +++ b/service-worker.js @@ -14,7 +14,7 @@ importScripts("https://storage.googleapis.com/workbox-cdn/releases/4.3.1/workbox-sw.js"); importScripts( - "/precache-manifest.d1e2c732dd20b96a1fcdb26742fc6a95.js" + "/precache-manifest.f574a4df8dc159be0637ebb5a5744d1f.js" ); self.addEventListener('message', (event) => { diff --git a/static/js/2.fdc420f7.chunk.js b/static/js/2.fdc420f7.chunk.js new file mode 100644 index 0000000..3fa16f8 --- /dev/null +++ b/static/js/2.fdc420f7.chunk.js @@ -0,0 +1,3 @@ +/*! For license information please see 2.fdc420f7.chunk.js.LICENSE.txt */ +(this.webpackJsonpclient=this.webpackJsonpclient||[]).push([[2],[function(e,t,n){"use strict";n.r(t),function(e){n.d(t,"CONSTANTS",(function(){return i})),n.d(t,"Deferred",(function(){return d})),n.d(t,"ErrorFactory",(function(){return P})),n.d(t,"FirebaseError",(function(){return N})),n.d(t,"MAX_VALUE_MILLIS",(function(){return ae})),n.d(t,"RANDOM_FACTOR",(function(){return se})),n.d(t,"Sha1",(function(){return Q})),n.d(t,"areCookiesEnabled",(function(){return O})),n.d(t,"assert",(function(){return o})),n.d(t,"assertionError",(function(){return a})),n.d(t,"async",(function(){return X})),n.d(t,"base64",(function(){return u})),n.d(t,"base64Decode",(function(){return l})),n.d(t,"base64Encode",(function(){return c})),n.d(t,"calculateBackoffMillis",(function(){return ue})),n.d(t,"contains",(function(){return V})),n.d(t,"createMockUserToken",(function(){return p})),n.d(t,"createSubscribe",(function(){return $})),n.d(t,"decode",(function(){return L})),n.d(t,"deepCopy",(function(){return f})),n.d(t,"deepExtend",(function(){return h})),n.d(t,"errorPrefix",(function(){return ee})),n.d(t,"extractQuerystring",(function(){return G})),n.d(t,"getGlobal",(function(){return x})),n.d(t,"getModularInstance",(function(){return le})),n.d(t,"getUA",(function(){return v})),n.d(t,"isAdmin",(function(){return q})),n.d(t,"isBrowser",(function(){return m})),n.d(t,"isBrowserExtension",(function(){return b})),n.d(t,"isElectron",(function(){return _})),n.d(t,"isEmpty",(function(){return K})),n.d(t,"isIE",(function(){return E})),n.d(t,"isIndexedDBAvailable",(function(){return k})),n.d(t,"isMobileCordova",(function(){return y})),n.d(t,"isNode",(function(){return g})),n.d(t,"isNodeSdk",(function(){return I})),n.d(t,"isReactNative",(function(){return w})),n.d(t,"isSafari",(function(){return S})),n.d(t,"isUWP",(function(){return T})),n.d(t,"isValidFormat",(function(){return U})),n.d(t,"isValidTimestamp",(function(){return M})),n.d(t,"issuedAtTime",(function(){return F})),n.d(t,"jsonEval",(function(){return D})),n.d(t,"map",(function(){return z})),n.d(t,"ordinal",(function(){return ce})),n.d(t,"querystring",(function(){return W})),n.d(t,"querystringDecode",(function(){return H})),n.d(t,"safeGet",(function(){return B})),n.d(t,"stringLength",(function(){return oe})),n.d(t,"stringToByteArray",(function(){return ie})),n.d(t,"stringify",(function(){return j})),n.d(t,"validateArgCount",(function(){return Z})),n.d(t,"validateCallback",(function(){return ne})),n.d(t,"validateContextObject",(function(){return re})),n.d(t,"validateIndexedDBOpenable",(function(){return C})),n.d(t,"validateNamespace",(function(){return te}));var r=n(33),i={NODE_CLIENT:!1,NODE_ADMIN:!1,SDK_VERSION:"${JSCORE_VERSION}"},o=function(e,t){if(!e)throw a(t)},a=function(e){return new Error("Firebase Database ("+i.SDK_VERSION+") INTERNAL ASSERT FAILED: "+e)},s=function(e){for(var t=[],n=0,r=0;r>6|192,t[n++]=63&i|128):55296===(64512&i)&&r+1>18|240,t[n++]=i>>12&63|128,t[n++]=i>>6&63|128,t[n++]=63&i|128):(t[n++]=i>>12|224,t[n++]=i>>6&63|128,t[n++]=63&i|128)}return t},u={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:function(e,t){if(!Array.isArray(e))throw Error("encodeByteArray takes an array as a parameter");this.init_();for(var n=t?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[],i=0;i>2,f=(3&o)<<4|s>>4,h=(15&s)<<2|c>>6,d=63&c;u||(d=64,a||(h=64)),r.push(n[l],n[f],n[h],n[d])}return r.join("")},encodeString:function(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(s(e),t)},decodeString:function(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):function(e){for(var t=[],n=0,r=0;n191&&i<224){var o=e[n++];t[r++]=String.fromCharCode((31&i)<<6|63&o)}else if(i>239&&i<365){var a=((7&i)<<18|(63&(o=e[n++]))<<12|(63&(s=e[n++]))<<6|63&e[n++])-65536;t[r++]=String.fromCharCode(55296+(a>>10)),t[r++]=String.fromCharCode(56320+(1023&a))}else{o=e[n++];var s=e[n++];t[r++]=String.fromCharCode((15&i)<<12|(63&o)<<6|63&s)}}return t.join("")}(this.decodeStringToByteArray(e,t))},decodeStringToByteArray:function(e,t){this.init_();for(var n=t?this.charToByteMapWebSafe_:this.charToByteMap_,r=[],i=0;i>4;if(r.push(c),64!==s){var l=a<<4&240|s>>2;if(r.push(l),64!==u){var f=s<<6&192|u;r.push(f)}}}return r},init_:function(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(var e=0;e=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(e)]=e,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(e)]=e)}}},c=function(e){var t=s(e);return u.encodeByteArray(t,!0)},l=function(e){try{return u.decodeString(e,!0)}catch(t){console.error("base64Decode failed: ",t)}return null};function f(e){return h(void 0,e)}function h(e,t){if(!(t instanceof Object))return t;switch(t.constructor){case Date:return new Date(t.getTime());case Object:void 0===e&&(e={});break;case Array:e=[];break;default:return t}for(var n in t)t.hasOwnProperty(n)&&"__proto__"!==n&&(e[n]=h(e[n],t[n]));return e}var d=function(){function e(){var e=this;this.reject=function(){},this.resolve=function(){},this.promise=new Promise((function(t,n){e.resolve=t,e.reject=n}))}return e.prototype.wrapCallback=function(e){var t=this;return function(n,r){n?t.reject(n):t.resolve(r),"function"===typeof e&&(t.promise.catch((function(){})),1===e.length?e(n):e(n,r))}},e}();function p(e,t){if(e.uid)throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');var n=t||"demo-project",i=e.iat||0,o=e.sub||e.user_id;if(!o)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");var a=Object(r.a)({iss:"https://securetoken.google.com/"+n,aud:n,iat:i,exp:i+3600,auth_time:i,sub:o,user_id:o,firebase:{sign_in_provider:"custom",identities:{}}},e);return[u.encodeString(JSON.stringify({alg:"none",type:"JWT"}),!1),u.encodeString(JSON.stringify(a),!1),""].join(".")}function v(){return"undefined"!==typeof navigator&&"string"===typeof navigator.userAgent?navigator.userAgent:""}function y(){return"undefined"!==typeof window&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(v())}function g(){try{return"[object process]"===Object.prototype.toString.call(e.process)}catch(t){return!1}}function m(){return"object"===typeof self&&self.self===self}function b(){var e="object"===typeof chrome?chrome.runtime:"object"===typeof browser?browser.runtime:void 0;return"object"===typeof e&&void 0!==e.id}function w(){return"object"===typeof navigator&&"ReactNative"===navigator.product}function _(){return v().indexOf("Electron/")>=0}function E(){var e=v();return e.indexOf("MSIE ")>=0||e.indexOf("Trident/")>=0}function T(){return v().indexOf("MSAppHost/")>=0}function I(){return!0===i.NODE_CLIENT||!0===i.NODE_ADMIN}function S(){return!g()&&navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome")}function k(){return"indexedDB"in self&&null!=indexedDB}function C(){return new Promise((function(e,t){try{var n=!0,r="validate-browser-context-for-indexeddb-analytics-module",i=self.indexedDB.open(r);i.onsuccess=function(){i.result.close(),n||self.indexedDB.deleteDatabase(r),e(!0)},i.onupgradeneeded=function(){n=!1},i.onerror=function(){var e;t((null===(e=i.error)||void 0===e?void 0:e.message)||"")}}catch(o){t(o)}}))}function O(){return!(!navigator||!navigator.cookieEnabled)}function x(){if("undefined"!==typeof self)return self;if("undefined"!==typeof window)return window;if("undefined"!==typeof e)return e;throw new Error("Unable to locate global object.")}var N=function(e){function t(n,r,i){var o=e.call(this,r)||this;return o.code=n,o.customData=i,o.name="FirebaseError",Object.setPrototypeOf(o,t.prototype),Error.captureStackTrace&&Error.captureStackTrace(o,P.prototype.create),o}return Object(r.b)(t,e),t}(Error),P=function(){function e(e,t,n){this.service=e,this.serviceName=t,this.errors=n}return e.prototype.create=function(e){for(var t=[],n=1;n"}))}var R=/\{\$([^}]+)}/g;function D(e){return JSON.parse(e)}function j(e){return JSON.stringify(e)}var L=function(e){var t={},n={},r={},i="";try{var o=e.split(".");t=D(l(o[0])||""),n=D(l(o[1])||""),i=o[2],r=n.d||{},delete n.d}catch(a){}return{header:t,claims:n,data:r,signature:i}},M=function(e){var t=L(e).claims,n=Math.floor((new Date).getTime()/1e3),r=0,i=0;return"object"===typeof t&&(t.hasOwnProperty("nbf")?r=t.nbf:t.hasOwnProperty("iat")&&(r=t.iat),i=t.hasOwnProperty("exp")?t.exp:r+86400),!!n&&!!r&&!!i&&n>=r&&n<=i},F=function(e){var t=L(e).claims;return"object"===typeof t&&t.hasOwnProperty("iat")?t.iat:null},U=function(e){var t=L(e).claims;return!!t&&"object"===typeof t&&t.hasOwnProperty("iat")},q=function(e){var t=L(e).claims;return"object"===typeof t&&!0===t.admin};function V(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function B(e,t){return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0}function K(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}function z(e,t,n){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=t.call(n,e[i],i,e));return r}function W(e){for(var t=[],n=function(e,n){Array.isArray(n)?n.forEach((function(n){t.push(encodeURIComponent(e)+"="+encodeURIComponent(n))})):t.push(encodeURIComponent(e)+"="+encodeURIComponent(n))},r=0,i=Object.entries(e);r0?n:void 0)}var Q=function(){function e(){this.chain_=[],this.buf_=[],this.W_=[],this.pad_=[],this.inbuf_=0,this.total_=0,this.blockSize=64,this.pad_[0]=128;for(var e=1;e>>31)}var o,a,s=this.chain_[0],u=this.chain_[1],c=this.chain_[2],l=this.chain_[3],f=this.chain_[4];for(r=0;r<80;r++){r<40?r<20?(o=l^u&(c^l),a=1518500249):(o=u^c^l,a=1859775393):r<60?(o=u&c|l&(u|c),a=2400959708):(o=u^c^l,a=3395469782);i=(s<<5|s>>>27)+o+f+a+n[r]&4294967295;f=l,l=c,c=4294967295&(u<<30|u>>>2),u=s,s=i}this.chain_[0]=this.chain_[0]+s&4294967295,this.chain_[1]=this.chain_[1]+u&4294967295,this.chain_[2]=this.chain_[2]+c&4294967295,this.chain_[3]=this.chain_[3]+l&4294967295,this.chain_[4]=this.chain_[4]+f&4294967295},e.prototype.update=function(e,t){if(null!=e){void 0===t&&(t=e.length);for(var n=t-this.blockSize,r=0,i=this.buf_,o=this.inbuf_;r=56;n--)this.buf_[n]=255&t,t/=256;this.compress_(this.buf_);var r=0;for(n=0;n<5;n++)for(var i=24;i>=0;i-=8)e[r]=this.chain_[n]>>i&255,++r;return e},e}();function $(e,t){var n=new Y(e,t);return n.subscribe.bind(n)}var Y=function(){function e(e,t){var n=this;this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=t,this.task.then((function(){e(n)})).catch((function(e){n.error(e)}))}return e.prototype.next=function(e){this.forEachObserver((function(t){t.next(e)}))},e.prototype.error=function(e){this.forEachObserver((function(t){t.error(e)})),this.close(e)},e.prototype.complete=function(){this.forEachObserver((function(e){e.complete()})),this.close()},e.prototype.subscribe=function(e,t,n){var r,i=this;if(void 0===e&&void 0===t&&void 0===n)throw new Error("Missing Observer.");void 0===(r=function(e,t){if("object"!==typeof e||null===e)return!1;for(var n=0,r=t;nn&&(i=0===n?"none":"no more than "+n),i)throw new Error(e+" failed: Was called with "+r+(1===r?" argument.":" arguments.")+" Expects "+i+".")};function ee(e,t){return e+" failed: "+t+" argument "}function te(e,t,n){if((!n||t)&&"string"!==typeof t)throw new Error(ee(e,"namespace")+"must be a valid firebase namespace.")}function ne(e,t,n,r){if((!r||n)&&"function"!==typeof n)throw new Error(ee(e,t)+"must be a valid function.")}function re(e,t,n,r){if((!r||n)&&("object"!==typeof n||null===n))throw new Error(ee(e,t)+"must be a valid context object.")}var ie=function(e){for(var t=[],n=0,r=0;r=55296&&i<=56319){var a=i-55296;r++,o(r>6|192,t[n++]=63&i|128):i<65536?(t[n++]=i>>12|224,t[n++]=i>>6&63|128,t[n++]=63&i|128):(t[n++]=i>>18|240,t[n++]=i>>12&63|128,t[n++]=i>>6&63|128,t[n++]=63&i|128)}return t},oe=function(e){for(var t=0,n=0;n=55296&&r<=56319?(t+=4,n++):t+=3}return t},ae=144e5,se=.5;function ue(e,t,n){void 0===t&&(t=1e3),void 0===n&&(n=2);var r=t*Math.pow(n,e),i=Math.round(se*r*(Math.random()-.5)*2);return Math.min(ae,r+i)}function ce(e){return Number.isFinite(e)?e+function(e){var t=(e=Math.abs(e))%100;if(t>=10&&t<=20)return"th";var n=e%10;if(1===n)return"st";if(2===n)return"nd";if(3===n)return"rd";return"th"}(e):""+e}function le(e){return e&&e._delegate?e._delegate:e}}.call(this,n(22))},function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"a",(function(){return o})),n.d(t,"c",(function(){return a})),n.d(t,"d",(function(){return s}));var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function i(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function o(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(t){o(t)}}function s(e){try{u(r.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}function a(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"===typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=0&&h.warn("\n Warning: You are trying to load Firebase while using Firebase Performance standalone script.\n You should load Firebase Performance with this instance of Firebase to avoid loading duplicate code.\n ")}var g=p.initializeApp;p.initializeApp=function(){for(var e=[],t=0;t0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function c(e,t){var n="function"===typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function l(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i=(null!==r&&void 0!==r?r:t.logLevel)&&e({level:o[n].toLowerCase(),message:s,args:i,type:t.name})}},r=0,i=a;r0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function a(e,t){var n="function"===typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function s(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;it?1:0}function E(e,t,n){return e.length===t.length&&e.every((function(e,r){return n(e,t[r])}))}function T(e){return e+"\0"}var I=function(){function e(e,t){if(this.seconds=e,this.nanoseconds=t,t<0)throw new c(u.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+t);if(t>=1e9)throw new c(u.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+t);if(e<-62135596800)throw new c(u.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e);if(e>=253402300800)throw new c(u.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e)}return e.now=function(){return e.fromMillis(Date.now())},e.fromDate=function(t){return e.fromMillis(t.getTime())},e.fromMillis=function(t){var n=Math.floor(t/1e3);return new e(n,Math.floor(1e6*(t-1e3*n)))},e.prototype.toDate=function(){return new Date(this.toMillis())},e.prototype.toMillis=function(){return 1e3*this.seconds+this.nanoseconds/1e6},e.prototype._compareTo=function(e){return this.seconds===e.seconds?_(this.nanoseconds,e.nanoseconds):_(this.seconds,e.seconds)},e.prototype.isEqual=function(e){return e.seconds===this.seconds&&e.nanoseconds===this.nanoseconds},e.prototype.toString=function(){return"Timestamp(seconds="+this.seconds+", nanoseconds="+this.nanoseconds+")"},e.prototype.toJSON=function(){return{seconds:this.seconds,nanoseconds:this.nanoseconds}},e.prototype.valueOf=function(){var e=this.seconds- -62135596800;return String(e).padStart(12,"0")+"."+String(this.nanoseconds).padStart(9,"0")},e}(),S=function(){function e(e){this.timestamp=e}return e.fromTimestamp=function(t){return new e(t)},e.min=function(){return new e(new I(0,0))},e.prototype.compareTo=function(e){return this.timestamp._compareTo(e.timestamp)},e.prototype.isEqual=function(e){return this.timestamp.isEqual(e.timestamp)},e.prototype.toMicroseconds=function(){return 1e6*this.timestamp.seconds+this.timestamp.nanoseconds/1e3},e.prototype.toString=function(){return"SnapshotVersion("+this.timestamp.toString()+")"},e.prototype.toTimestamp=function(){return this.timestamp},e}();function k(e){var t=0;for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}function C(e,t){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t(n,e[n])}function O(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}var x=function(){function e(e,t,n){void 0===t?t=0:t>e.length&&y(),void 0===n?n=e.length-t:n>e.length-t&&y(),this.segments=e,this.offset=t,this.len=n}return Object.defineProperty(e.prototype,"length",{get:function(){return this.len},enumerable:!1,configurable:!0}),e.prototype.isEqual=function(t){return 0===e.comparator(this,t)},e.prototype.child=function(t){var n=this.segments.slice(this.offset,this.limit());return t instanceof e?t.forEach((function(e){n.push(e)})):n.push(t),this.construct(n)},e.prototype.limit=function(){return this.offset+this.length},e.prototype.popFirst=function(e){return e=void 0===e?1:e,this.construct(this.segments,this.offset+e,this.length-e)},e.prototype.popLast=function(){return this.construct(this.segments,this.offset,this.length-1)},e.prototype.firstSegment=function(){return this.segments[this.offset]},e.prototype.lastSegment=function(){return this.get(this.length-1)},e.prototype.get=function(e){return this.segments[this.offset+e]},e.prototype.isEmpty=function(){return 0===this.length},e.prototype.isPrefixOf=function(e){if(e.lengtho)return 1}return e.lengtht.length?1:0},e}(),N=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(a.b)(t,e),t.prototype.construct=function(e,n,r){return new t(e,n,r)},t.prototype.canonicalString=function(){return this.toArray().join("/")},t.prototype.toString=function(){return this.canonicalString()},t.fromString=function(){for(var e=[],n=0;n=0)throw new c(u.INVALID_ARGUMENT,"Invalid segment ("+a+"). Paths must not contain // in them.");r.push.apply(r,a.split("/").filter((function(e){return e.length>0})))}return new t(r)},t.emptyPath=function(){return new t([])},t}(x),P=/^[_a-zA-Z][_a-zA-Z0-9]*$/,A=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(a.b)(t,e),t.prototype.construct=function(e,n,r){return new t(e,n,r)},t.isValidIdentifier=function(e){return P.test(e)},t.prototype.canonicalString=function(){return this.toArray().map((function(e){return e=e.replace(/\\/g,"\\\\").replace(/`/g,"\\`"),t.isValidIdentifier(e)||(e="`"+e+"`"),e})).join(".")},t.prototype.toString=function(){return this.canonicalString()},t.prototype.isKeyField=function(){return 1===this.length&&"__name__"===this.get(0)},t.keyField=function(){return new t(["__name__"])},t.fromServerFormat=function(e){for(var n=[],r="",i=0,o=function(){if(0===r.length)throw new c(u.INVALID_ARGUMENT,"Invalid field path ("+e+"). Paths must not be empty, begin with '.', end with '.', or contain '..'");n.push(r),r=""},a=!1;i=Number.MIN_SAFE_INTEGER}var z=function(){function e(e){this.path=e}return e.fromPath=function(t){return new e(N.fromString(t))},e.fromName=function(t){return new e(N.fromString(t).popFirst(5))},e.prototype.hasCollectionId=function(e){return this.path.length>=2&&this.path.get(this.path.length-2)===e},e.prototype.isEqual=function(e){return null!==e&&0===N.comparator(this.path,e.path)},e.prototype.toString=function(){return this.path.toString()},e.comparator=function(e,t){return N.comparator(e.path,t.path)},e.isDocumentKey=function(e){return e.length%2==0},e.fromSegments=function(t){return new e(new N(t.slice()))},e}();function W(e){return"nullValue"in e?0:"booleanValue"in e?1:"integerValue"in e||"doubleValue"in e?2:"timestampValue"in e?3:"stringValue"in e?5:"bytesValue"in e?6:"referenceValue"in e?7:"geoPointValue"in e?8:"arrayValue"in e?9:"mapValue"in e?U(e)?4:10:y()}function H(e,t){var n=W(e);if(n!==W(t))return!1;switch(n){case 0:return!0;case 1:return e.booleanValue===t.booleanValue;case 4:return q(e).isEqual(q(t));case 3:return function(e,t){if("string"==typeof e.timestampValue&&"string"==typeof t.timestampValue&&e.timestampValue.length===t.timestampValue.length)return e.timestampValue===t.timestampValue;var n=L(e.timestampValue),r=L(t.timestampValue);return n.seconds===r.seconds&&n.nanos===r.nanos}(e,t);case 5:return e.stringValue===t.stringValue;case 6:return function(e,t){return F(e.bytesValue).isEqual(F(t.bytesValue))}(e,t);case 7:return e.referenceValue===t.referenceValue;case 8:return function(e,t){return M(e.geoPointValue.latitude)===M(t.geoPointValue.latitude)&&M(e.geoPointValue.longitude)===M(t.geoPointValue.longitude)}(e,t);case 2:return function(e,t){if("integerValue"in e&&"integerValue"in t)return M(e.integerValue)===M(t.integerValue);if("doubleValue"in e&&"doubleValue"in t){var n=M(e.doubleValue),r=M(t.doubleValue);return n===r?B(n)===B(r):isNaN(n)&&isNaN(r)}return!1}(e,t);case 9:return E(e.arrayValue.values||[],t.arrayValue.values||[],H);case 10:return function(e,t){var n=e.mapValue.fields||{},r=t.mapValue.fields||{};if(k(n)!==k(r))return!1;for(var i in n)if(n.hasOwnProperty(i)&&(void 0===r[i]||!H(n[i],r[i])))return!1;return!0}(e,t);default:return y()}}function G(e,t){return void 0!==(e.values||[]).find((function(e){return H(e,t)}))}function Q(e,t){var n=W(e),r=W(t);if(n!==r)return _(n,r);switch(n){case 0:return 0;case 1:return _(e.booleanValue,t.booleanValue);case 2:return function(e,t){var n=M(e.integerValue||e.doubleValue),r=M(t.integerValue||t.doubleValue);return nr?1:n===r?0:isNaN(n)?isNaN(r)?0:-1:1}(e,t);case 3:return $(e.timestampValue,t.timestampValue);case 4:return $(q(e),q(t));case 5:return _(e.stringValue,t.stringValue);case 6:return function(e,t){var n=F(e),r=F(t);return n.compareTo(r)}(e.bytesValue,t.bytesValue);case 7:return function(e,t){for(var n=e.split("/"),r=t.split("/"),i=0;i":return e>0;case">=":return e>=0;default:return y()}},t.prototype.g=function(){return["<","<=",">",">=","!=","not-in"].indexOf(this.op)>=0},t}((function(){})),de=function(e){function t(t,n,r){var i=this;return(i=e.call(this,t,n,r)||this).key=z.fromName(r.referenceValue),i}return Object(a.b)(t,e),t.prototype.matches=function(e){var t=z.comparator(e.key,this.key);return this.m(t)},t}(he),pe=function(e){function t(t,n){var r=this;return(r=e.call(this,t,"in",n)||this).keys=ye("in",n),r}return Object(a.b)(t,e),t.prototype.matches=function(e){return this.keys.some((function(t){return t.isEqual(e.key)}))},t}(he),ve=function(e){function t(t,n){var r=this;return(r=e.call(this,t,"not-in",n)||this).keys=ye("not-in",n),r}return Object(a.b)(t,e),t.prototype.matches=function(e){return!this.keys.some((function(t){return t.isEqual(e.key)}))},t}(he);function ye(e,t){var n;return((null===(n=t.arrayValue)||void 0===n?void 0:n.values)||[]).map((function(e){return z.fromName(e.referenceValue)}))}var ge=function(e){function t(t,n){return e.call(this,t,"array-contains",n)||this}return Object(a.b)(t,e),t.prototype.matches=function(e){var t=e.data.field(this.field);return Z(t)&&G(t.arrayValue,this.value)},t}(he),me=function(e){function t(t,n){return e.call(this,t,"in",n)||this}return Object(a.b)(t,e),t.prototype.matches=function(e){var t=e.data.field(this.field);return null!==t&&G(this.value.arrayValue,t)},t}(he),be=function(e){function t(t,n){return e.call(this,t,"not-in",n)||this}return Object(a.b)(t,e),t.prototype.matches=function(e){if(G(this.value.arrayValue,{nullValue:"NULL_VALUE"}))return!1;var t=e.data.field(this.field);return null!==t&&!G(this.value.arrayValue,t)},t}(he),we=function(e){function t(t,n){return e.call(this,t,"array-contains-any",n)||this}return Object(a.b)(t,e),t.prototype.matches=function(e){var t=this,n=e.data.field(this.field);return!(!Z(n)||!n.arrayValue.values)&&n.arrayValue.values.some((function(e){return G(t.value.arrayValue,e)}))},t}(he),_e=function(e,t){this.position=e,this.before=t};function Ee(e){return(e.before?"b":"a")+":"+e.position.map((function(e){return Y(e)})).join(",")}var Te=function(e,t){void 0===t&&(t="asc"),this.field=e,this.dir=t};function Ie(e,t){return e.dir===t.dir&&e.field.isEqual(t.field)}function Se(e,t,n){for(var r=0,i=0;i0?e.explicitOrderBy[0].field:null}function Re(e){for(var t=0,n=e.filters;t0?t.explicitOrderBy[t.explicitOrderBy.length-1].dir:"asc";t.p.push(new Te(A.keyField(),u))}}}return t.p}function Le(e){var t=m(e);if(!t.T)if("F"===t.limitType)t.T=ue(t.path,t.collectionGroup,je(t),t.filters,t.limit,t.startAt,t.endAt);else{for(var n=[],r=0,i=je(t);r0&&(t+=", orderBy: ["+e.orderBy.map((function(e){return function(e){return e.field.canonicalString()+" ("+e.dir+")"}(e)})).join(", ")+"]"),e.startAt&&(t+=", startAt: "+Ee(e.startAt)),e.endAt&&(t+=", endAt: "+Ee(e.endAt)),"Target("+t+")"}(Le(e))+"; limitType="+e.limitType+")"}function Ve(e,t){return t.isFoundDocument()&&function(e,t){var n=t.key.path;return null!==e.collectionGroup?t.key.hasCollectionId(e.collectionGroup)&&e.path.isPrefixOf(n):z.isDocumentKey(e.path)?e.path.isEqual(n):e.path.isImmediateParentOf(n)}(e,t)&&function(e,t){for(var n=0,r=e.explicitOrderBy;n0&&(t=t.right)}return null},e.prototype.indexOf=function(e){for(var t=0,n=this.root;!n.isEmpty();){var r=this.comparator(e,n.key);if(0===r)return t+n.left.size;r<0?n=n.left:(t+=n.left.size+1,n=n.right)}return-1},e.prototype.isEmpty=function(){return this.root.isEmpty()},Object.defineProperty(e.prototype,"size",{get:function(){return this.root.size},enumerable:!1,configurable:!0}),e.prototype.minKey=function(){return this.root.minKey()},e.prototype.maxKey=function(){return this.root.maxKey()},e.prototype.inorderTraversal=function(e){return this.root.inorderTraversal(e)},e.prototype.forEach=function(e){this.inorderTraversal((function(t,n){return e(t,n),!1}))},e.prototype.toString=function(){var e=[];return this.inorderTraversal((function(t,n){return e.push(t+":"+n),!1})),"{"+e.join(", ")+"}"},e.prototype.reverseTraversal=function(e){return this.root.reverseTraversal(e)},e.prototype.getIterator=function(){return new Ot(this.root,null,this.comparator,!1)},e.prototype.getIteratorFrom=function(e){return new Ot(this.root,e,this.comparator,!1)},e.prototype.getReverseIterator=function(){return new Ot(this.root,null,this.comparator,!0)},e.prototype.getReverseIteratorFrom=function(e){return new Ot(this.root,e,this.comparator,!0)},e}(),Ot=function(){function e(e,t,n,r){this.isReverse=r,this.nodeStack=[];for(var i=1;!e.isEmpty();)if(i=t?n(e.key,t):1,r&&(i*=-1),i<0)e=this.isReverse?e.left:e.right;else{if(0===i){this.nodeStack.push(e);break}this.nodeStack.push(e),e=this.isReverse?e.right:e.left}}return e.prototype.getNext=function(){var e=this.nodeStack.pop(),t={key:e.key,value:e.value};if(this.isReverse)for(e=e.left;!e.isEmpty();)this.nodeStack.push(e),e=e.right;else for(e=e.right;!e.isEmpty();)this.nodeStack.push(e),e=e.left;return t},e.prototype.hasNext=function(){return this.nodeStack.length>0},e.prototype.peek=function(){if(0===this.nodeStack.length)return null;var e=this.nodeStack[this.nodeStack.length-1];return{key:e.key,value:e.value}},e}(),xt=function(){function e(t,n,r,i,o){this.key=t,this.value=n,this.color=null!=r?r:e.RED,this.left=null!=i?i:e.EMPTY,this.right=null!=o?o:e.EMPTY,this.size=this.left.size+1+this.right.size}return e.prototype.copy=function(t,n,r,i,o){return new e(null!=t?t:this.key,null!=n?n:this.value,null!=r?r:this.color,null!=i?i:this.left,null!=o?o:this.right)},e.prototype.isEmpty=function(){return!1},e.prototype.inorderTraversal=function(e){return this.left.inorderTraversal(e)||e(this.key,this.value)||this.right.inorderTraversal(e)},e.prototype.reverseTraversal=function(e){return this.right.reverseTraversal(e)||e(this.key,this.value)||this.left.reverseTraversal(e)},e.prototype.min=function(){return this.left.isEmpty()?this:this.left.min()},e.prototype.minKey=function(){return this.min().key},e.prototype.maxKey=function(){return this.right.isEmpty()?this.key:this.right.maxKey()},e.prototype.insert=function(e,t,n){var r=this,i=n(e,r.key);return(r=i<0?r.copy(null,null,null,r.left.insert(e,t,n),null):0===i?r.copy(null,t,null,null,null):r.copy(null,null,null,null,r.right.insert(e,t,n))).fixUp()},e.prototype.removeMin=function(){if(this.left.isEmpty())return e.EMPTY;var t=this;return t.left.isRed()||t.left.left.isRed()||(t=t.moveRedLeft()),(t=t.copy(null,null,null,t.left.removeMin(),null)).fixUp()},e.prototype.remove=function(t,n){var r,i=this;if(n(t,i.key)<0)i.left.isEmpty()||i.left.isRed()||i.left.left.isRed()||(i=i.moveRedLeft()),i=i.copy(null,null,null,i.left.remove(t,n),null);else{if(i.left.isRed()&&(i=i.rotateRight()),i.right.isEmpty()||i.right.isRed()||i.right.left.isRed()||(i=i.moveRedRight()),0===n(t,i.key)){if(i.right.isEmpty())return e.EMPTY;r=i.right.min(),i=i.copy(r.key,r.value,null,null,i.right.removeMin())}i=i.copy(null,null,null,null,i.right.remove(t,n))}return i.fixUp()},e.prototype.isRed=function(){return this.color},e.prototype.fixUp=function(){var e=this;return e.right.isRed()&&!e.left.isRed()&&(e=e.rotateLeft()),e.left.isRed()&&e.left.left.isRed()&&(e=e.rotateRight()),e.left.isRed()&&e.right.isRed()&&(e=e.colorFlip()),e},e.prototype.moveRedLeft=function(){var e=this.colorFlip();return e.right.left.isRed()&&(e=(e=(e=e.copy(null,null,null,null,e.right.rotateRight())).rotateLeft()).colorFlip()),e},e.prototype.moveRedRight=function(){var e=this.colorFlip();return e.left.left.isRed()&&(e=(e=e.rotateRight()).colorFlip()),e},e.prototype.rotateLeft=function(){var t=this.copy(null,null,e.RED,null,this.right.left);return this.right.copy(null,null,this.color,t,null)},e.prototype.rotateRight=function(){var t=this.copy(null,null,e.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,t)},e.prototype.colorFlip=function(){var e=this.left.copy(null,null,!this.left.color,null,null),t=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,e,t)},e.prototype.checkMaxDepth=function(){var e=this.check();return Math.pow(2,e)<=this.size+1},e.prototype.check=function(){if(this.isRed()&&this.left.isRed())throw y();if(this.right.isRed())throw y();var e=this.left.check();if(e!==this.right.check())throw y();return e+(this.isRed()?0:1)},e}();xt.EMPTY=null,xt.RED=!0,xt.BLACK=!1,xt.EMPTY=new(function(){function e(){this.size=0}return Object.defineProperty(e.prototype,"key",{get:function(){throw y()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){throw y()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"color",{get:function(){throw y()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"left",{get:function(){throw y()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"right",{get:function(){throw y()},enumerable:!1,configurable:!0}),e.prototype.copy=function(e,t,n,r,i){return this},e.prototype.insert=function(e,t,n){return new xt(e,t)},e.prototype.remove=function(e,t){return this},e.prototype.isEmpty=function(){return!0},e.prototype.inorderTraversal=function(e){return!1},e.prototype.reverseTraversal=function(e){return!1},e.prototype.minKey=function(){return null},e.prototype.maxKey=function(){return null},e.prototype.isRed=function(){return!1},e.prototype.checkMaxDepth=function(){return!0},e.prototype.check=function(){return 0},e}());var Nt=function(){function e(e){this.comparator=e,this.data=new Ct(this.comparator)}return e.prototype.has=function(e){return null!==this.data.get(e)},e.prototype.first=function(){return this.data.minKey()},e.prototype.last=function(){return this.data.maxKey()},Object.defineProperty(e.prototype,"size",{get:function(){return this.data.size},enumerable:!1,configurable:!0}),e.prototype.indexOf=function(e){return this.data.indexOf(e)},e.prototype.forEach=function(e){this.data.inorderTraversal((function(t,n){return e(t),!1}))},e.prototype.forEachInRange=function(e,t){for(var n=this.data.getIteratorFrom(e[0]);n.hasNext();){var r=n.getNext();if(this.comparator(r.key,e[1])>=0)return;t(r.key)}},e.prototype.forEachWhile=function(e,t){var n;for(n=void 0!==t?this.data.getIteratorFrom(t):this.data.getIterator();n.hasNext();)if(!e(n.getNext().key))return},e.prototype.firstAfterOrEqual=function(e){var t=this.data.getIteratorFrom(e);return t.hasNext()?t.getNext().key:null},e.prototype.getIterator=function(){return new Pt(this.data.getIterator())},e.prototype.getIteratorFrom=function(e){return new Pt(this.data.getIteratorFrom(e))},e.prototype.add=function(e){return this.copy(this.data.remove(e).insert(e,!0))},e.prototype.delete=function(e){return this.has(e)?this.copy(this.data.remove(e)):this},e.prototype.isEmpty=function(){return this.data.isEmpty()},e.prototype.unionWith=function(e){var t=this;return t.size0&&(this.F=!0,this.C=e)},e.prototype.M=function(){var e=Ut(),t=Ut(),n=Ut();return this.D.forEach((function(r,i){switch(i){case 0:e=e.add(r);break;case 2:t=t.add(r);break;case 1:n=n.add(r);break;default:y()}})),new Kt(this.C,this.N,e,t,n)},e.prototype.L=function(){this.F=!1,this.D=Yt()},e.prototype.B=function(e,t){this.F=!0,this.D=this.D.insert(e,t)},e.prototype.q=function(e){this.F=!0,this.D=this.D.remove(e)},e.prototype.U=function(){this.S+=1},e.prototype.K=function(){this.S-=1},e.prototype.j=function(){this.F=!0,this.N=!0},e}(),Qt=function(){function e(e){this.W=e,this.G=new Map,this.H=Rt(),this.J=$t(),this.Y=new Nt(_)}return e.prototype.X=function(e){for(var t=0,n=e.v;t0?e.targetIds.forEach(t):this.G.forEach((function(e,r){n.st(r)&&t(r)}))},e.prototype.rt=function(e){var t=e.targetId,n=e.V.count,r=this.ot(t);if(r){var i=r.target;if(fe(i))if(0===n){var o=new z(i.path);this.tt(t,o,ae.newNoDocument(o,S.min()))}else g(1===n);else this.ct(t)!==n&&(this.it(t),this.Y=this.Y.add(t))}},e.prototype.ut=function(e){var t=this,n=new Map;this.G.forEach((function(r,i){var o=t.ot(i);if(o){if(r.current&&fe(o.target)){var a=new z(o.target.path);null!==t.H.get(a)||t.at(i,a)||t.tt(i,a,ae.newNoDocument(a,e))}r.$&&(n.set(i,r.M()),r.L())}}));var r=Ut();this.J.forEach((function(e,n){var i=!0;n.forEachWhile((function(e){var n=t.ot(e);return!n||2===n.purpose||(i=!1,!1)})),i&&(r=r.add(e))}));var i=new Bt(e,n,this.Y,this.H,r);return this.H=Rt(),this.J=$t(),this.Y=new Nt(_),i},e.prototype.Z=function(e,t){if(this.st(e)){var n=this.at(e,t.key)?2:0;this.nt(e).B(t.key,n),this.H=this.H.insert(t.key,t),this.J=this.J.insert(t.key,this.ht(t.key).add(e))}},e.prototype.tt=function(e,t,n){if(this.st(e)){var r=this.nt(e);this.at(e,t)?r.B(t,1):r.q(t),this.J=this.J.insert(t,this.ht(t).delete(e)),n&&(this.H=this.H.insert(t,n))}},e.prototype.removeTarget=function(e){this.G.delete(e)},e.prototype.ct=function(e){var t=this.nt(e).M();return this.W.getRemoteKeysForTarget(e).size+t.addedDocuments.size-t.removedDocuments.size},e.prototype.U=function(e){this.nt(e).U()},e.prototype.nt=function(e){var t=this.G.get(e);return t||(t=new Gt,this.G.set(e,t)),t},e.prototype.ht=function(e){var t=this.J.get(e);return t||(t=new Nt(_),this.J=this.J.insert(e,t)),t},e.prototype.st=function(e){var t=null!==this.ot(e);return t||h("WatchChangeAggregator","Detected inactive target",e),t},e.prototype.ot=function(e){var t=this.G.get(e);return t&&t.k?null:this.W.lt(e)},e.prototype.it=function(e){var t=this;this.G.set(e,new Gt),this.W.getRemoteKeysForTarget(e).forEach((function(n){t.tt(e,n,null)}))},e.prototype.at=function(e,t){return this.W.getRemoteKeysForTarget(e).has(t)},e}();function $t(){return new Ct(z.comparator)}function Yt(){return new Ct(z.comparator)}var Xt={asc:"ASCENDING",desc:"DESCENDING"},Jt={"<":"LESS_THAN","<=":"LESS_THAN_OR_EQUAL",">":"GREATER_THAN",">=":"GREATER_THAN_OR_EQUAL","==":"EQUAL","!=":"NOT_EQUAL","array-contains":"ARRAY_CONTAINS",in:"IN","not-in":"NOT_IN","array-contains-any":"ARRAY_CONTAINS_ANY"},Zt=function(e,t){this.databaseId=e,this.I=t};function en(e,t){return e.I?new Date(1e3*t.seconds).toISOString().replace(/\.\d*/,"").replace("Z","")+"."+("000000000"+t.nanoseconds).slice(-9)+"Z":{seconds:""+t.seconds,nanos:t.nanoseconds}}function tn(e,t){return e.I?t.toBase64():t.toUint8Array()}function nn(e,t){return en(e,t.toTimestamp())}function rn(e){return g(!!e),S.fromTimestamp(function(e){var t=L(e);return new I(t.seconds,t.nanos)}(e))}function on(e,t){return function(e){return new N(["projects",e.projectId,"databases",e.database])}(e).child("documents").child(t).canonicalString()}function an(e){var t=N.fromString(e);return g(xn(t)),t}function sn(e,t){return on(e.databaseId,t.path)}function un(e,t){var n=an(t);if(n.get(1)!==e.databaseId.projectId)throw new c(u.INVALID_ARGUMENT,"Tried to deserialize key from different project: "+n.get(1)+" vs "+e.databaseId.projectId);if(n.get(3)!==e.databaseId.database)throw new c(u.INVALID_ARGUMENT,"Tried to deserialize key from different database: "+n.get(3)+" vs "+e.databaseId.database);return new z(hn(n))}function cn(e,t){return on(e.databaseId,t)}function ln(e){var t=an(e);return 4===t.length?N.emptyPath():hn(t)}function fn(e){return new N(["projects",e.databaseId.projectId,"databases",e.databaseId.database]).canonicalString()}function hn(e){return g(e.length>4&&"documents"===e.get(4)),e.popFirst(5)}function dn(e,t,n){return{name:sn(e,t),fields:n.value.mapValue.fields}}function pn(e,t,n){var r=un(e,t.name),i=rn(t.updateTime),o=new ie({mapValue:{fields:t.fields}}),a=ae.newFoundDocument(r,i,o);return n&&a.setHasCommittedMutations(),n?a.setHasCommittedMutations():a}function vn(e,t){var n;if(t instanceof vt)n={update:dn(e,t.key,t.value)};else if(t instanceof Et)n={delete:sn(e,t.key)};else if(t instanceof yt)n={update:dn(e,t.key,t.data),updateMask:On(t.fieldMask)};else{if(!(t instanceof Tt))return y();n={verify:sn(e,t.key)}}return t.fieldTransforms.length>0&&(n.updateTransforms=t.fieldTransforms.map((function(e){return function(e,t){var n=t.transform;if(n instanceof Xe)return{fieldPath:t.field.canonicalString(),setToServerValue:"REQUEST_TIME"};if(n instanceof Je)return{fieldPath:t.field.canonicalString(),appendMissingElements:{values:n.elements}};if(n instanceof et)return{fieldPath:t.field.canonicalString(),removeAllFromArray:{values:n.elements}};if(n instanceof nt)return{fieldPath:t.field.canonicalString(),increment:n.A};throw y()}(0,e)}))),t.precondition.isNone||(n.currentDocument=function(e,t){return void 0!==t.updateTime?{updateTime:nn(e,t.updateTime)}:void 0!==t.exists?{exists:t.exists}:y()}(e,t.precondition)),n}function yn(e,t){var n=t.currentDocument?function(e){return void 0!==e.updateTime?st.updateTime(rn(e.updateTime)):void 0!==e.exists?st.exists(e.exists):st.none()}(t.currentDocument):st.none(),r=t.updateTransforms?t.updateTransforms.map((function(t){return function(e,t){var n=null;if("setToServerValue"in t)g("REQUEST_TIME"===t.setToServerValue),n=new Xe;else if("appendMissingElements"in t){var r=t.appendMissingElements.values||[];n=new Je(r)}else if("removeAllFromArray"in t){var i=t.removeAllFromArray.values||[];n=new et(i)}else"increment"in t?n=new nt(e,t.increment):y();var o=A.fromServerFormat(t.fieldPath);return new ot(o,n)}(e,t)})):[];if(t.update){t.update.name;var i=un(e,t.update.name),o=new ie({mapValue:{fields:t.update.fields}});if(t.updateMask){var a=function(e){var t=e.fieldPaths||[];return new R(t.map((function(e){return A.fromServerFormat(e)})))}(t.updateMask);return new yt(i,o,a,n,r)}return new vt(i,o,n,r)}if(t.delete){var s=un(e,t.delete);return new Et(s,n)}if(t.verify){var u=un(e,t.verify);return new Tt(u,n)}return y()}function gn(e,t){return{documents:[cn(e,t.path)]}}function mn(e,t){var n={structuredQuery:{}},r=t.path;null!==t.collectionGroup?(n.parent=cn(e,r),n.structuredQuery.from=[{collectionId:t.collectionGroup,allDescendants:!0}]):(n.parent=cn(e,r.popLast()),n.structuredQuery.from=[{collectionId:r.lastSegment()}]);var i=function(e){if(0!==e.length){var t=e.map((function(e){return function(e){if("=="===e.op){if(te(e.value))return{unaryFilter:{field:In(e.field),op:"IS_NAN"}};if(ee(e.value))return{unaryFilter:{field:In(e.field),op:"IS_NULL"}}}else if("!="===e.op){if(te(e.value))return{unaryFilter:{field:In(e.field),op:"IS_NOT_NAN"}};if(ee(e.value))return{unaryFilter:{field:In(e.field),op:"IS_NOT_NULL"}}}return{fieldFilter:{field:In(e.field),op:Tn(e.op),value:e.value}}}(e)}));return 1===t.length?t[0]:{compositeFilter:{op:"AND",filters:t}}}}(t.filters);i&&(n.structuredQuery.where=i);var o=function(e){if(0!==e.length)return e.map((function(e){return function(e){return{field:In(e.field),direction:En(e.dir)}}(e)}))}(t.orderBy);o&&(n.structuredQuery.orderBy=o);var a=function(e,t){return e.I||V(t)?t:{value:t}}(e,t.limit);return null!==a&&(n.structuredQuery.limit=a),t.startAt&&(n.structuredQuery.startAt=wn(t.startAt)),t.endAt&&(n.structuredQuery.endAt=wn(t.endAt)),n}function bn(e){var t=ln(e.parent),n=e.structuredQuery,r=n.from?n.from.length:0,i=null;if(r>0){g(1===r);var o=n.from[0];o.allDescendants?i=o.collectionId:t=t.child(o.collectionId)}var a=[];n.where&&(a=function e(t){return t?void 0!==t.unaryFilter?[Cn(t)]:void 0!==t.fieldFilter?[kn(t)]:void 0!==t.compositeFilter?t.compositeFilter.filters.map((function(t){return e(t)})).reduce((function(e,t){return e.concat(t)})):y():[]}(n.where));var s=[];n.orderBy&&(s=n.orderBy.map((function(e){return function(e){return new Te(Sn(e.field),function(e){switch(e){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}}(e.direction))}(e)})));var u=null;n.limit&&(u=function(e){var t;return V(t="object"==typeof e?e.value:e)?null:t}(n.limit));var c=null;n.startAt&&(c=_n(n.startAt));var l=null;return n.endAt&&(l=_n(n.endAt)),Oe(t,i,s,a,u,"F",c,l)}function wn(e){return{before:e.before,values:e.position}}function _n(e){var t=!!e.before,n=e.values||[];return new _e(n,t)}function En(e){return Xt[e]}function Tn(e){return Jt[e]}function In(e){return{fieldPath:e.canonicalString()}}function Sn(e){return A.fromServerFormat(e.fieldPath)}function kn(e){return he.create(Sn(e.fieldFilter.field),function(e){switch(e){case"EQUAL":return"==";case"NOT_EQUAL":return"!=";case"GREATER_THAN":return">";case"GREATER_THAN_OR_EQUAL":return">=";case"LESS_THAN":return"<";case"LESS_THAN_OR_EQUAL":return"<=";case"ARRAY_CONTAINS":return"array-contains";case"IN":return"in";case"NOT_IN":return"not-in";case"ARRAY_CONTAINS_ANY":return"array-contains-any";case"OPERATOR_UNSPECIFIED":default:return y()}}(e.fieldFilter.op),e.fieldFilter.value)}function Cn(e){switch(e.unaryFilter.op){case"IS_NAN":var t=Sn(e.unaryFilter.field);return he.create(t,"==",{doubleValue:NaN});case"IS_NULL":var n=Sn(e.unaryFilter.field);return he.create(n,"==",{nullValue:"NULL_VALUE"});case"IS_NOT_NAN":var r=Sn(e.unaryFilter.field);return he.create(r,"!=",{doubleValue:NaN});case"IS_NOT_NULL":var i=Sn(e.unaryFilter.field);return he.create(i,"!=",{nullValue:"NULL_VALUE"});case"OPERATOR_UNSPECIFIED":default:return y()}}function On(e){var t=[];return e.fields.forEach((function(e){return t.push(e.canonicalString())})),{fieldPaths:t}}function xn(e){return e.length>=4&&"projects"===e.get(0)&&"databases"===e.get(2)}function Nn(e){for(var t="",n=0;n0&&(t=An(t)),t=Pn(e.get(n),t);return An(t)}function Pn(e,t){for(var n=t,r=e.length,i=0;i=2),2===t)return g("\x01"===e.charAt(0)&&"\x01"===e.charAt(1)),N.emptyPath();for(var n=t-2,r=[],i="",o=0;on)&&y(),e.charAt(a+1)){case"\x01":var s=e.substring(o,a),u=void 0;0===i.length?u=s:(u=i+=s,i=""),r.push(u);break;case"\x10":i+=e.substring(o,a),i+="\0";break;case"\x11":i+=e.substring(o,a+1);break;default:y()}o=a+2}return new N(r)}var Dn=function(e,t){this.seconds=e,this.nanoseconds=t},jn=function(e,t,n){this.ownerId=e,this.allowTabSynchronization=t,this.leaseTimestampMs=n};jn.store="owner",jn.key="owner";var Ln=function(e,t,n){this.userId=e,this.lastAcknowledgedBatchId=t,this.lastStreamToken=n};Ln.store="mutationQueues",Ln.keyPath="userId";var Mn=function(e,t,n,r,i){this.userId=e,this.batchId=t,this.localWriteTimeMs=n,this.baseMutations=r,this.mutations=i};Mn.store="mutations",Mn.keyPath="batchId",Mn.userMutationsIndex="userMutationsIndex",Mn.userMutationsKeyPath=["userId","batchId"];var Fn=function(){function e(){}return e.prefixForUser=function(e){return[e]},e.prefixForPath=function(e,t){return[e,Nn(t)]},e.key=function(e,t,n){return[e,Nn(t),n]},e}();Fn.store="documentMutations",Fn.PLACEHOLDER=new Fn;var Un=function(e,t){this.path=e,this.readTime=t},qn=function(e,t){this.path=e,this.version=t},Vn=function(e,t,n,r,i,o){this.unknownDocument=e,this.noDocument=t,this.document=n,this.hasCommittedMutations=r,this.readTime=i,this.parentPath=o};Vn.store="remoteDocuments",Vn.readTimeIndex="readTimeIndex",Vn.readTimeIndexPath="readTime",Vn.collectionReadTimeIndex="collectionReadTimeIndex",Vn.collectionReadTimeIndexPath=["parentPath","readTime"];var Bn=function(e){this.byteSize=e};Bn.store="remoteDocumentGlobal",Bn.key="remoteDocumentGlobalKey";var Kn=function(e,t,n,r,i,o,a){this.targetId=e,this.canonicalId=t,this.readTime=n,this.resumeToken=r,this.lastListenSequenceNumber=i,this.lastLimboFreeSnapshotVersion=o,this.query=a};Kn.store="targets",Kn.keyPath="targetId",Kn.queryTargetsIndexName="queryTargetsIndex",Kn.queryTargetsKeyPath=["canonicalId","targetId"];var zn=function(e,t,n){this.targetId=e,this.path=t,this.sequenceNumber=n};zn.store="targetDocuments",zn.keyPath=["targetId","path"],zn.documentTargetsIndex="documentTargetsIndex",zn.documentTargetsKeyPath=["path","targetId"];var Wn=function(e,t,n,r){this.highestTargetId=e,this.highestListenSequenceNumber=t,this.lastRemoteSnapshotVersion=n,this.targetCount=r};Wn.key="targetGlobalKey",Wn.store="targetGlobal";var Hn=function(e,t){this.collectionId=e,this.parent=t};Hn.store="collectionParents",Hn.keyPath=["collectionId","parent"];var Gn=function(e,t,n,r){this.clientId=e,this.updateTimeMs=t,this.networkEnabled=n,this.inForeground=r};Gn.store="clientMetadata",Gn.keyPath="clientId";var Qn=function(e,t,n){this.bundleId=e,this.createTime=t,this.version=n};Qn.store="bundles",Qn.keyPath="bundleId";var $n=function(e,t,n){this.name=e,this.readTime=t,this.bundledQuery=n};$n.store="namedQueries",$n.keyPath="name";var Yn=Object(a.d)(Object(a.d)([],Object(a.d)(Object(a.d)([],Object(a.d)(Object(a.d)([],Object(a.d)(Object(a.d)([],[Ln.store,Mn.store,Fn.store,Vn.store,Kn.store,jn.store,Wn.store,zn.store]),[Gn.store])),[Bn.store])),[Hn.store])),[Qn.store,$n.store]),Xn="The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.",Jn=function(){function e(){this.onCommittedListeners=[]}return e.prototype.addOnCommittedListener=function(e){this.onCommittedListeners.push(e)},e.prototype.raiseOnCommittedEvent=function(){this.onCommittedListeners.forEach((function(e){return e()}))},e}(),Zn=function(){var e=this;this.promise=new Promise((function(t,n){e.resolve=t,e.reject=n}))},er=function(){function e(e){var t=this;this.nextCallback=null,this.catchCallback=null,this.result=void 0,this.error=void 0,this.isDone=!1,this.callbackAttached=!1,e((function(e){t.isDone=!0,t.result=e,t.nextCallback&&t.nextCallback(e)}),(function(e){t.isDone=!0,t.error=e,t.catchCallback&&t.catchCallback(e)}))}return e.prototype.catch=function(e){return this.next(void 0,e)},e.prototype.next=function(t,n){var r=this;return this.callbackAttached&&y(),this.callbackAttached=!0,this.isDone?this.error?this.wrapFailure(n,this.error):this.wrapSuccess(t,this.result):new e((function(e,i){r.nextCallback=function(n){r.wrapSuccess(t,n).next(e,i)},r.catchCallback=function(t){r.wrapFailure(n,t).next(e,i)}}))},e.prototype.toPromise=function(){var e=this;return new Promise((function(t,n){e.next(t,n)}))},e.prototype.wrapUserFunction=function(t){try{var n=t();return n instanceof e?n:e.resolve(n)}catch(t){return e.reject(t)}},e.prototype.wrapSuccess=function(t,n){return t?this.wrapUserFunction((function(){return t(n)})):e.resolve(n)},e.prototype.wrapFailure=function(t,n){return t?this.wrapUserFunction((function(){return t(n)})):e.reject(n)},e.resolve=function(t){return new e((function(e,n){e(t)}))},e.reject=function(t){return new e((function(e,n){n(t)}))},e.waitFor=function(t){return new e((function(e,n){var r=0,i=0,o=!1;t.forEach((function(t){++r,t.next((function(){++i,o&&i===r&&e()}),(function(e){return n(e)}))})),o=!0,i===r&&e()}))},e.or=function(t){for(var n=e.resolve(!1),r=function(t){n=n.next((function(n){return n?e.resolve(n):t()}))},i=0,o=t;i0||e.indexOf("Trident/")>0||e.indexOf("Edge/")>0||i||a)},t.gt=function(){var t;return"undefined"!=typeof e&&"YES"===(null===(t=Object({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0}))||void 0===t?void 0:t.Tt)},t.It=function(e,t){return e.store(t)},t._t=function(e){var t=e.match(/i(?:phone|pad|pod) os ([\d_]+)/i),n=t?t[1].split("_").slice(0,2).join("."):"-1";return Number(n)},t.Et=function(e){var t=e.match(/Android ([\d.]+)/i),n=t?t[1].split(".").slice(0,2).join("."):"-1";return Number(n)},t.prototype.At=function(e){return Object(a.a)(this,void 0,void 0,(function(){var t,n=this;return Object(a.c)(this,(function(r){switch(r.label){case 0:return this.db?[3,2]:(h("SimpleDb","Opening database:",this.name),t=this,[4,new Promise((function(t,r){var i=indexedDB.open(n.name,n.version);i.onsuccess=function(e){var n=e.target.result;t(n)},i.onblocked=function(){r(new ir(e,"Cannot upgrade IndexedDB schema while another tab is open. Close all tabs that access Firestore and reload this page to proceed."))},i.onerror=function(t){var n=t.target.error;"VersionError"===n.name?r(new c(u.FAILED_PRECONDITION,"A newer version of the Firestore SDK was previously used and so the persisted data is not compatible with the version of the SDK you are now using. The SDK will operate with persistence disabled. If you need persistence, please re-upgrade to a newer version of the SDK or else clear the persisted IndexedDB data for your app to start fresh.")):r(new ir(e,n))},i.onupgradeneeded=function(e){h("SimpleDb",'Database "'+n.name+'" requires upgrade from version:',e.oldVersion);var t=e.target.result;n.wt.Rt(t,i.transaction,e.oldVersion,n.version).next((function(){h("SimpleDb","Database upgrade to version "+n.version+" complete")}))}}))]);case 1:t.db=r.sent(),r.label=2;case 2:return[2,(this.bt&&(this.db.onversionchange=function(e){return n.bt(e)}),this.db)]}}))}))},t.prototype.vt=function(e){this.bt=e,this.db&&(this.db.onversionchange=function(t){return e(t)})},t.prototype.runTransaction=function(e,t,n,r){return Object(a.a)(this,void 0,void 0,(function(){var i,o,s,u,c;return Object(a.c)(this,(function(l){switch(l.label){case 0:i="readonly"===t,o=0,s=function(){var t,s,c,l,f;return Object(a.c)(this,(function(a){switch(a.label){case 0:++o,a.label=1;case 1:return a.trys.push([1,4,,5]),[4,u.At(e)];case 2:return u.db=a.sent(),t=tr.open(u.db,e,i?"readonly":"readwrite",n),s=r(t).catch((function(e){return t.abort(e),er.reject(e)})).toPromise(),c={},s.catch((function(){})),[4,t.dt];case 3:return[2,(c.value=(a.sent(),s),c)];case 4:return l=a.sent(),f="FirebaseError"!==l.name&&o<3,h("SimpleDb","Transaction failed with error:",l.message,"Retrying:",f),u.close(),f?[3,5]:[2,{value:Promise.reject(l)}];case 5:return[2]}}))},u=this,l.label=1;case 1:return[5,s()];case 2:if("object"==typeof(c=l.sent()))return[2,c.value];l.label=3;case 3:return[3,1];case 4:return[2]}}))}))},t.prototype.close=function(){this.db&&this.db.close(),this.db=void 0},t}(),rr=function(){function e(e){this.Pt=e,this.Vt=!1,this.St=null}return Object.defineProperty(e.prototype,"isDone",{get:function(){return this.Vt},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Dt",{get:function(){return this.St},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"cursor",{set:function(e){this.Pt=e},enumerable:!1,configurable:!0}),e.prototype.done=function(){this.Vt=!0},e.prototype.Ct=function(e){this.St=e},e.prototype.delete=function(){return sr(this.Pt.delete())},e}(),ir=function(e){function t(t,n){var r=this;return(r=e.call(this,u.UNAVAILABLE,"IndexedDB transaction '"+t+"' failed: "+n)||this).name="IndexedDbTransactionError",r}return Object(a.b)(t,e),t}(c);function or(e){return"IndexedDbTransactionError"===e.name}var ar=function(){function e(e){this.store=e}return e.prototype.put=function(e,t){var n;return void 0!==t?(h("SimpleDb","PUT",this.store.name,e,t),n=this.store.put(t,e)):(h("SimpleDb","PUT",this.store.name,"",e),n=this.store.put(e)),sr(n)},e.prototype.add=function(e){return h("SimpleDb","ADD",this.store.name,e,e),sr(this.store.add(e))},e.prototype.get=function(e){var t=this;return sr(this.store.get(e)).next((function(n){return void 0===n&&(n=null),h("SimpleDb","GET",t.store.name,e,n),n}))},e.prototype.delete=function(e){return h("SimpleDb","DELETE",this.store.name,e),sr(this.store.delete(e))},e.prototype.count=function(){return h("SimpleDb","COUNT",this.store.name),sr(this.store.count())},e.prototype.Nt=function(e,t){var n=this.cursor(this.options(e,t)),r=[];return this.xt(n,(function(e,t){r.push(t)})).next((function(){return r}))},e.prototype.Ft=function(e,t){h("SimpleDb","DELETE ALL",this.store.name);var n=this.options(e,t);n.kt=!1;var r=this.cursor(n);return this.xt(r,(function(e,t,n){return n.delete()}))},e.prototype.$t=function(e,t){var n;t?n=e:(n={},t=e);var r=this.cursor(n);return this.xt(r,t)},e.prototype.Ot=function(e){var t=this.cursor({});return new er((function(n,r){t.onerror=function(e){var t=cr(e.target.error);r(t)},t.onsuccess=function(t){var r=t.target.result;r?e(r.primaryKey,r.value).next((function(e){e?r.continue():n()})):n()}}))},e.prototype.xt=function(e,t){var n=[];return new er((function(r,i){e.onerror=function(e){i(e.target.error)},e.onsuccess=function(e){var i=e.target.result;if(i){var o=new rr(i),a=t(i.primaryKey,i.value,o);if(a instanceof er){var s=a.catch((function(e){return o.done(),er.reject(e)}));n.push(s)}o.isDone?r():null===o.Dt?i.continue():i.continue(o.Dt)}else r()}})).next((function(){return er.waitFor(n)}))},e.prototype.options=function(e,t){var n;return void 0!==e&&("string"==typeof e?n=e:t=e),{index:n,range:t}},e.prototype.cursor=function(e){var t="next";if(e.reverse&&(t="prev"),e.index){var n=this.store.index(e.index);return e.kt?n.openKeyCursor(e.range,t):n.openCursor(e.range,t)}return this.store.openCursor(e.range,t)},e}();function sr(e){return new er((function(t,n){e.onsuccess=function(e){var n=e.target.result;t(n)},e.onerror=function(e){var t=cr(e.target.error);n(t)}}))}var ur=!1;function cr(e){var t=nr._t(Object(r.getUA)());if(t>=12.2&&t<13){var n="An internal error was encountered in the Indexed Database server";if(e.message.indexOf(n)>=0){var i=new c("internal","IOS_INDEXEDDB_BUG1: IndexedDb has thrown '"+n+"'. This is likely due to an unavoidable bug in iOS. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.");return ur||(ur=!0,setTimeout((function(){throw i}),0)),i}}return e}var lr=function(e){function t(t,n){var r=this;return(r=e.call(this)||this).Mt=t,r.currentSequenceNumber=n,r}return Object(a.b)(t,e),t}(Jn);function fr(e,t){var n=m(e);return nr.It(n.Mt,t)}var hr=function(){function e(e,t,n,r){this.batchId=e,this.localWriteTime=t,this.baseMutations=n,this.mutations=r}return e.prototype.applyToRemoteDocument=function(e,t){for(var n=t.mutationResults,r=0;r=r),o=Er(n.R,t)),i.done()})).next((function(){return o}))},e.prototype.getHighestUnacknowledgedBatchId=function(e){var t=IDBKeyRange.upperBound([this.userId,Number.POSITIVE_INFINITY]),n=-1;return Ur(e).$t({index:Mn.userMutationsIndex,range:t,reverse:!0},(function(e,t,r){n=t.batchId,r.done()})).next((function(){return n}))},e.prototype.getAllMutationBatches=function(e){var t=this,n=IDBKeyRange.bound([this.userId,-1],[this.userId,Number.POSITIVE_INFINITY]);return Ur(e).Nt(Mn.userMutationsIndex,n).next((function(e){return e.map((function(e){return Er(t.R,e)}))}))},e.prototype.getAllMutationBatchesAffectingDocumentKey=function(e,t){var n=this,r=Fn.prefixForPath(this.userId,t.path),i=IDBKeyRange.lowerBound(r),o=[];return qr(e).$t({range:i},(function(r,i,a){var s=r[0],u=r[1],c=r[2],l=Rn(u);if(s===n.userId&&t.path.isEqual(l))return Ur(e).get(c).next((function(e){if(!e)throw y();g(e.userId===n.userId),o.push(Er(n.R,e))}));a.done()})).next((function(){return o}))},e.prototype.getAllMutationBatchesAffectingDocumentKeys=function(e,t){var n=this,r=new Nt(_),i=[];return t.forEach((function(t){var o=Fn.prefixForPath(n.userId,t.path),a=IDBKeyRange.lowerBound(o),s=qr(e).$t({range:a},(function(e,i,o){var a=e[0],s=e[1],u=e[2],c=Rn(s);a===n.userId&&t.path.isEqual(c)?r=r.add(u):o.done()}));i.push(s)})),er.waitFor(i).next((function(){return n.Wt(e,r)}))},e.prototype.getAllMutationBatchesAffectingQuery=function(e,t){var n=this,r=t.path,i=r.length+1,o=Fn.prefixForPath(this.userId,r),a=IDBKeyRange.lowerBound(o),s=new Nt(_);return qr(e).$t({range:a},(function(e,t,o){var a=e[0],u=e[1],c=e[2],l=Rn(u);a===n.userId&&r.isPrefixOf(l)?l.length===i&&(s=s.add(c)):o.done()})).next((function(){return n.Wt(e,s)}))},e.prototype.Wt=function(e,t){var n=this,r=[],i=[];return t.forEach((function(t){i.push(Ur(e).get(t).next((function(e){if(null===e)throw y();g(e.userId===n.userId),r.push(Er(n.R,e))})))})),er.waitFor(i).next((function(){return r}))},e.prototype.removeMutationBatch=function(e,t){var n=this;return jr(e.Mt,this.userId,t).next((function(r){return e.addOnCommittedListener((function(){n.Gt(t.batchId)})),er.forEach(r,(function(t){return n.referenceDelegate.markPotentiallyOrphaned(e,t)}))}))},e.prototype.Gt=function(e){delete this.Qt[e]},e.prototype.performConsistencyCheck=function(e){var t=this;return this.checkEmpty(e).next((function(n){if(!n)return er.resolve();var r=IDBKeyRange.lowerBound(Fn.prefixForUser(t.userId)),i=[];return qr(e).$t({range:r},(function(e,n,r){if(e[0]===t.userId){var o=Rn(e[1]);i.push(o)}else r.done()})).next((function(){g(0===i.length)}))}))},e.prototype.containsKey=function(e,t){return Fr(e,this.userId,t)},e.prototype.zt=function(e){var t=this;return Vr(e).get(this.userId).next((function(e){return e||new Ln(t.userId,-1,"")}))},e}();function Fr(e,t,n){var r=Fn.prefixForPath(t,n.path),i=r[1],o=IDBKeyRange.lowerBound(r),a=!1;return qr(e).$t({range:o,kt:!0},(function(e,n,r){var o=e[0],s=e[1];e[2],o===t&&s===i&&(a=!0),r.done()})).next((function(){return a}))}function Ur(e){return fr(e,Mn.store)}function qr(e){return fr(e,Fn.store)}function Vr(e){return fr(e,Ln.store)}var Br=function(){function e(e){this.Ht=e}return e.prototype.next=function(){return this.Ht+=2,this.Ht},e.Jt=function(){return new e(0)},e.Yt=function(){return new e(-1)},e}(),Kr=function(){function e(e,t){this.referenceDelegate=e,this.R=t}return e.prototype.allocateTargetId=function(e){var t=this;return this.Xt(e).next((function(n){var r=new Br(n.highestTargetId);return n.highestTargetId=r.next(),t.Zt(e,n).next((function(){return n.highestTargetId}))}))},e.prototype.getLastRemoteSnapshotVersion=function(e){return this.Xt(e).next((function(e){return S.fromTimestamp(new I(e.lastRemoteSnapshotVersion.seconds,e.lastRemoteSnapshotVersion.nanoseconds))}))},e.prototype.getHighestSequenceNumber=function(e){return this.Xt(e).next((function(e){return e.highestListenSequenceNumber}))},e.prototype.setTargetsMetadata=function(e,t,n){var r=this;return this.Xt(e).next((function(i){return i.highestListenSequenceNumber=t,n&&(i.lastRemoteSnapshotVersion=n.toTimestamp()),t>i.highestListenSequenceNumber&&(i.highestListenSequenceNumber=t),r.Zt(e,i)}))},e.prototype.addTargetData=function(e,t){var n=this;return this.te(e,t).next((function(){return n.Xt(e).next((function(r){return r.targetCount+=1,n.ee(t,r),n.Zt(e,r)}))}))},e.prototype.updateTargetData=function(e,t){return this.te(e,t)},e.prototype.removeTargetData=function(e,t){var n=this;return this.removeMatchingKeysForTargetId(e,t.targetId).next((function(){return zr(e).delete(t.targetId)})).next((function(){return n.Xt(e)})).next((function(t){return g(t.targetCount>0),t.targetCount-=1,n.Zt(e,t)}))},e.prototype.removeTargets=function(e,t,n){var r=this,i=0,o=[];return zr(e).$t((function(a,s){var u=Tr(s);u.sequenceNumber<=t&&null===n.get(u.targetId)&&(i++,o.push(r.removeTargetData(e,u)))})).next((function(){return er.waitFor(o)})).next((function(){return i}))},e.prototype.forEachTarget=function(e,t){return zr(e).$t((function(e,n){var r=Tr(n);t(r)}))},e.prototype.Xt=function(e){return Wr(e).get(Wn.key).next((function(e){return g(null!==e),e}))},e.prototype.Zt=function(e,t){return Wr(e).put(Wn.key,t)},e.prototype.te=function(e,t){return zr(e).put(Ir(this.R,t))},e.prototype.ee=function(e,t){var n=!1;return e.targetId>t.highestTargetId&&(t.highestTargetId=e.targetId,n=!0),e.sequenceNumber>t.highestListenSequenceNumber&&(t.highestListenSequenceNumber=e.sequenceNumber,n=!0),n},e.prototype.getTargetCount=function(e){return this.Xt(e).next((function(e){return e.targetCount}))},e.prototype.getTargetData=function(e,t){var n=ce(t),r=IDBKeyRange.bound([n,Number.NEGATIVE_INFINITY],[n,Number.POSITIVE_INFINITY]),i=null;return zr(e).$t({range:r,index:Kn.queryTargetsIndexName},(function(e,n,r){var o=Tr(n);le(t,o.target)&&(i=o,r.done())})).next((function(){return i}))},e.prototype.addMatchingKeys=function(e,t,n){var r=this,i=[],o=Hr(e);return t.forEach((function(t){var a=Nn(t.path);i.push(o.put(new zn(n,a))),i.push(r.referenceDelegate.addReference(e,n,t))})),er.waitFor(i)},e.prototype.removeMatchingKeys=function(e,t,n){var r=this,i=Hr(e);return er.forEach(t,(function(t){var o=Nn(t.path);return er.waitFor([i.delete([n,o]),r.referenceDelegate.removeReference(e,n,t)])}))},e.prototype.removeMatchingKeysForTargetId=function(e,t){var n=Hr(e),r=IDBKeyRange.bound([t],[t+1],!1,!0);return n.delete(r)},e.prototype.getMatchingKeysForTargetId=function(e,t){var n=IDBKeyRange.bound([t],[t+1],!1,!0),r=Hr(e),i=Ut();return r.$t({range:n,kt:!0},(function(e,t,n){var r=Rn(e[1]),o=new z(r);i=i.add(o)})).next((function(){return i}))},e.prototype.containsKey=function(e,t){var n=Nn(t.path),r=IDBKeyRange.bound([n],[T(n)],!1,!0),i=0;return Hr(e).$t({index:zn.documentTargetsIndex,kt:!0,range:r},(function(e,t,n){var r=e[0];e[1],0!==r&&(i++,n.done())})).next((function(){return i>0}))},e.prototype.lt=function(e,t){return zr(e).get(t).next((function(e){return e?Tr(e):null}))},e}();function zr(e){return fr(e,Kn.store)}function Wr(e){return fr(e,Wn.store)}function Hr(e){return fr(e,zn.store)}function Gr(e){return Object(a.a)(this,void 0,void 0,(function(){return Object(a.c)(this,(function(t){if(e.code!==u.FAILED_PRECONDITION||e.message!==Xn)throw e;return h("LocalStore","Unexpectedly lost primary lease"),[2]}))}))}function Qr(e,t){var n=e[0],r=e[1],i=t[0],o=t[1],a=_(n,i);return 0===a?_(r,o):a}var $r=function(){function e(e){this.ne=e,this.buffer=new Nt(Qr),this.se=0}return e.prototype.ie=function(){return++this.se},e.prototype.re=function(e){var t=[e,this.ie()];if(this.buffer.sizel.params.maximumSequenceNumbersToCollect?(h("LruGarbageCollector","Capping sequence numbers to collect down to the maximum of "+l.params.maximumSequenceNumbersToCollect+" from "+t),r=l.params.maximumSequenceNumbersToCollect):r=t,a=Date.now(),l.nthSequenceNumber(e,r)})).next((function(r){return n=r,s=Date.now(),l.removeTargets(e,n,t)})).next((function(t){return o=t,u=Date.now(),l.removeOrphanedDocuments(e,n)})).next((function(e){return c=Date.now(),f()<=i.LogLevel.DEBUG&&h("LruGarbageCollector","LRU Garbage Collection\n\tCounted targets in "+(a-d)+"ms\n\tDetermined least recently used "+r+" in "+(s-a)+"ms\n\tRemoved "+o+" targets in "+(u-s)+"ms\n\tRemoved "+e+" documents in "+(c-u)+"ms\nTotal Duration: "+(c-d)+"ms"),er.resolve({didRun:!0,sequenceNumbersCollected:r,targetsRemoved:o,documentsRemoved:e})}))},e}(),Jr=function(){function e(e,t){this.db=e,this.garbageCollector=function(e,t){return new Xr(e,t)}(this,t)}return e.prototype.he=function(e){var t=this.de(e);return this.db.getTargetCache().getTargetCount(e).next((function(e){return t.next((function(t){return e+t}))}))},e.prototype.de=function(e){var t=0;return this.le(e,(function(e){t++})).next((function(){return t}))},e.prototype.forEachTarget=function(e,t){return this.db.getTargetCache().forEachTarget(e,t)},e.prototype.le=function(e,t){return this.we(e,(function(e,n){return t(n)}))},e.prototype.addReference=function(e,t,n){return Zr(e,n)},e.prototype.removeReference=function(e,t,n){return Zr(e,n)},e.prototype.removeTargets=function(e,t,n){return this.db.getTargetCache().removeTargets(e,t,n)},e.prototype.markPotentiallyOrphaned=function(e,t){return Zr(e,t)},e.prototype._e=function(e,t){return function(e,t){var n=!1;return Vr(e).Ot((function(r){return Fr(e,r,t).next((function(e){return e&&(n=!0),er.resolve(!e)}))})).next((function(){return n}))}(e,t)},e.prototype.removeOrphanedDocuments=function(e,t){var n=this,r=this.db.getRemoteDocumentCache().newChangeBuffer(),i=[],o=0;return this.we(e,(function(a,s){if(s<=t){var u=n._e(e,a).next((function(t){if(!t)return o++,r.getEntry(e,a).next((function(){return r.removeEntry(a),Hr(e).delete([0,Nn(a.path)])}))}));i.push(u)}})).next((function(){return er.waitFor(i)})).next((function(){return r.apply(e)})).next((function(){return o}))},e.prototype.removeTarget=function(e,t){var n=t.withSequenceNumber(e.currentSequenceNumber);return this.db.getTargetCache().updateTargetData(e,n)},e.prototype.updateLimboDocument=function(e,t){return Zr(e,t)},e.prototype.we=function(e,t){var n,r=Hr(e),i=s.o;return r.$t({index:zn.documentTargetsIndex},(function(e,r){var o=e[0],a=(e[1],r.path),u=r.sequenceNumber;0===o?(i!==s.o&&t(new z(Rn(n)),i),i=u,n=a):i=s.o})).next((function(){i!==s.o&&t(new z(Rn(n)),i)}))},e.prototype.getCacheSize=function(e){return this.db.getRemoteDocumentCache().getSize(e)},e}();function Zr(e,t){return Hr(e).put(function(e,t){return new zn(0,Nn(e.path),t)}(t,e.currentSequenceNumber))}var ei=function(){function e(e,t){this.mapKeyFn=e,this.equalsFn=t,this.inner={}}return e.prototype.get=function(e){var t=this.mapKeyFn(e),n=this.inner[t];if(void 0!==n)for(var r=0,i=n;r=0&&r<=11);var o=new tr("createOrUpgrade",t);n<1&&r>=1&&(function(e){e.createObjectStore(jn.store)}(e),function(e){e.createObjectStore(Ln.store,{keyPath:Ln.keyPath}),e.createObjectStore(Mn.store,{keyPath:Mn.keyPath,autoIncrement:!0}).createIndex(Mn.userMutationsIndex,Mn.userMutationsKeyPath,{unique:!0}),e.createObjectStore(Fn.store)}(e),ui(e),function(e){e.createObjectStore(Vn.store)}(e));var a=er.resolve();return n<3&&r>=3&&(0!==n&&(function(e){e.deleteObjectStore(zn.store),e.deleteObjectStore(Kn.store),e.deleteObjectStore(Wn.store)}(e),ui(e)),a=a.next((function(){return function(e){var t=e.store(Wn.store),n=new Wn(0,0,S.min().toTimestamp(),0);return t.put(Wn.key,n)}(o)}))),n<4&&r>=4&&(0!==n&&(a=a.next((function(){return function(e,t){return t.store(Mn.store).Nt().next((function(n){e.deleteObjectStore(Mn.store),e.createObjectStore(Mn.store,{keyPath:Mn.keyPath,autoIncrement:!0}).createIndex(Mn.userMutationsIndex,Mn.userMutationsKeyPath,{unique:!0});var r=t.store(Mn.store),i=n.map((function(e){return r.put(e)}));return er.waitFor(i)}))}(e,o)}))),a=a.next((function(){!function(e){e.createObjectStore(Gn.store,{keyPath:Gn.keyPath})}(e)}))),n<5&&r>=5&&(a=a.next((function(){return i.Re(o)}))),n<6&&r>=6&&(a=a.next((function(){return function(e){e.createObjectStore(Bn.store)}(e),i.be(o)}))),n<7&&r>=7&&(a=a.next((function(){return i.ve(o)}))),n<8&&r>=8&&(a=a.next((function(){return i.Pe(e,o)}))),n<9&&r>=9&&(a=a.next((function(){!function(e){e.objectStoreNames.contains("remoteDocumentChanges")&&e.deleteObjectStore("remoteDocumentChanges")}(e),function(e){var t=e.objectStore(Vn.store);t.createIndex(Vn.readTimeIndex,Vn.readTimeIndexPath,{unique:!1}),t.createIndex(Vn.collectionReadTimeIndex,Vn.collectionReadTimeIndexPath,{unique:!1})}(t)}))),n<10&&r>=10&&(a=a.next((function(){return i.Ve(o)}))),n<11&&r>=11&&(a=a.next((function(){!function(e){e.createObjectStore(Qn.store,{keyPath:Qn.keyPath})}(e),function(e){e.createObjectStore($n.store,{keyPath:$n.keyPath})}(e)}))),a},e.prototype.be=function(e){var t=0;return e.store(Vn.store).$t((function(e,n){t+=Lr(n)})).next((function(){var n=new Bn(t);return e.store(Bn.store).put(Bn.key,n)}))},e.prototype.Re=function(e){var t=this,n=e.store(Ln.store),r=e.store(Mn.store);return n.Nt().next((function(n){return er.forEach(n,(function(n){var i=IDBKeyRange.bound([n.userId,-1],[n.userId,n.lastAcknowledgedBatchId]);return r.Nt(Mn.userMutationsIndex,i).next((function(r){return er.forEach(r,(function(r){g(r.userId===n.userId);var i=Er(t.R,r);return jr(e,n.userId,i).next((function(){}))}))}))}))}))},e.prototype.ve=function(e){var t=e.store(zn.store),n=e.store(Vn.store);return e.store(Wn.store).get(Wn.key).next((function(e){var r=[];return n.$t((function(n,i){var o=new N(n),a=function(e){return[0,Nn(e)]}(o);r.push(t.get(a).next((function(n){return n?er.resolve():function(n){return t.put(new zn(0,Nn(n),e.highestListenSequenceNumber))}(o)})))})).next((function(){return er.waitFor(r)}))}))},e.prototype.Pe=function(e,t){e.createObjectStore(Hn.store,{keyPath:Hn.keyPath});var n=t.store(Hn.store),r=new Nr,i=function(e){if(r.add(e)){var t=e.lastSegment(),i=e.popLast();return n.put({collectionId:t,parent:Nn(i)})}};return t.store(Vn.store).$t({kt:!0},(function(e,t){var n=new N(e);return i(n.popLast())})).next((function(){return t.store(Fn.store).$t({kt:!0},(function(e,t){e[0];var n=e[1],r=(e[2],Rn(n));return i(r.popLast())}))}))},e.prototype.Ve=function(e){var t=this,n=e.store(Kn.store);return n.$t((function(e,r){var i=Tr(r),o=Ir(t.R,i);return n.put(o)}))},e}();function ui(e){e.createObjectStore(zn.store,{keyPath:zn.keyPath}).createIndex(zn.documentTargetsIndex,zn.documentTargetsKeyPath,{unique:!0}),e.createObjectStore(Kn.store,{keyPath:Kn.keyPath}).createIndex(Kn.queryTargetsIndexName,Kn.queryTargetsKeyPath,{unique:!0}),e.createObjectStore(Wn.store)}var ci="Failed to obtain exclusive access to the persistence layer. To allow shared access, multi-tab synchronization has to be enabled in all tabs. If you are using `experimentalForceOwningTab:true`, make sure that only one tab has persistence enabled at any given time.",li=function(){function e(t,n,r,i,o,a,s,l,f,h){if(this.allowTabSynchronization=t,this.persistenceKey=n,this.clientId=r,this.Se=o,this.window=a,this.document=s,this.De=f,this.Ce=h,this.Ne=null,this.xe=!1,this.isPrimary=!1,this.networkEnabled=!0,this.Fe=null,this.inForeground=!1,this.ke=null,this.$e=null,this.Oe=Number.NEGATIVE_INFINITY,this.Me=function(e){return Promise.resolve()},!e.yt())throw new c(u.UNIMPLEMENTED,"This platform is either missing IndexedDB or is known to have an incomplete implementation. Offline persistence has been disabled.");this.referenceDelegate=new Jr(this,i),this.Le=n+"main",this.R=new vr(l),this.Be=new nr(this.Le,11,new si(this.R)),this.qe=new Kr(this.referenceDelegate,this.R),this.Ut=new Pr,this.Ue=function(e,t){return new ni(e,t)}(this.R,this.Ut),this.Qe=new kr,this.window&&this.window.localStorage?this.Ke=this.window.localStorage:(this.Ke=null,!1===h&&d("IndexedDbPersistence","LocalStorage is unavailable. As a result, persistence may not work reliably. In particular enablePersistence() could fail immediately after refreshing the page."))}return e.prototype.start=function(){var e=this;return this.je().then((function(){if(!e.isPrimary&&!e.allowTabSynchronization)throw new c(u.FAILED_PRECONDITION,ci);return e.We(),e.Ge(),e.ze(),e.runTransaction("getHighestListenSequenceNumber","readonly",(function(t){return e.qe.getHighestSequenceNumber(t)}))})).then((function(t){e.Ne=new s(t,e.De)})).then((function(){e.xe=!0})).catch((function(t){return e.Be&&e.Be.close(),Promise.reject(t)}))},e.prototype.He=function(e){var t=this;return this.Me=function(n){return Object(a.a)(t,void 0,void 0,(function(){return Object(a.c)(this,(function(t){return this.started?[2,e(n)]:[2]}))}))},e(this.isPrimary)},e.prototype.setDatabaseDeletedListener=function(e){var t=this;this.Be.vt((function(n){return Object(a.a)(t,void 0,void 0,(function(){return Object(a.c)(this,(function(t){switch(t.label){case 0:return null===n.newVersion?[4,e()]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}}))}))}))},e.prototype.setNetworkEnabled=function(e){var t=this;this.networkEnabled!==e&&(this.networkEnabled=e,this.Se.enqueueAndForget((function(){return Object(a.a)(t,void 0,void 0,(function(){return Object(a.c)(this,(function(e){switch(e.label){case 0:return this.started?[4,this.je()]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))})))},e.prototype.je=function(){var e=this;return this.runTransaction("updateClientMetadataAndTryBecomePrimary","readwrite",(function(t){return hi(t).put(new Gn(e.clientId,Date.now(),e.networkEnabled,e.inForeground)).next((function(){if(e.isPrimary)return e.Je(t).next((function(t){t||(e.isPrimary=!1,e.Se.enqueueRetryable((function(){return e.Me(!1)})))}))})).next((function(){return e.Ye(t)})).next((function(n){return e.isPrimary&&!n?e.Xe(t).next((function(){return!1})):!!n&&e.Ze(t).next((function(){return!0}))}))})).catch((function(t){if(or(t))return h("IndexedDbPersistence","Failed to extend owner lease: ",t),e.isPrimary;if(!e.allowTabSynchronization)throw t;return h("IndexedDbPersistence","Releasing owner lease after error during lease refresh",t),!1})).then((function(t){e.isPrimary!==t&&e.Se.enqueueRetryable((function(){return e.Me(t)})),e.isPrimary=t}))},e.prototype.Je=function(e){var t=this;return fi(e).get(jn.key).next((function(e){return er.resolve(t.tn(e))}))},e.prototype.en=function(e){return hi(e).delete(this.clientId)},e.prototype.nn=function(){return Object(a.a)(this,void 0,void 0,(function(){var e,t,n,r,i=this;return Object(a.c)(this,(function(o){switch(o.label){case 0:return!this.isPrimary||this.sn(this.Oe,18e5)?[3,2]:(this.Oe=Date.now(),[4,this.runTransaction("maybeGarbageCollectMultiClientState","readwrite-primary",(function(e){var t=fr(e,Gn.store);return t.Nt().next((function(e){var n=i.rn(e,18e5),r=e.filter((function(e){return-1===n.indexOf(e)}));return er.forEach(r,(function(e){return t.delete(e.clientId)})).next((function(){return r}))}))})).catch((function(){return[]}))]);case 1:if(e=o.sent(),this.Ke)for(t=0,n=e;tn&&(d("Detected an update time that is in the future: "+e+" > "+n),1))},e.prototype.We=function(){var e=this;null!==this.document&&"function"==typeof this.document.addEventListener&&(this.ke=function(){e.Se.enqueueAndForget((function(){return e.inForeground="visible"===e.document.visibilityState,e.je()}))},this.document.addEventListener("visibilitychange",this.ke),this.inForeground="visible"===this.document.visibilityState)},e.prototype.an=function(){this.ke&&(this.document.removeEventListener("visibilitychange",this.ke),this.ke=null)},e.prototype.Ge=function(){var e,t=this;"function"==typeof(null===(e=this.window)||void 0===e?void 0:e.addEventListener)&&(this.Fe=function(){t.un(),t.Se.enqueueAndForget((function(){return t.shutdown()}))},this.window.addEventListener("pagehide",this.Fe))},e.prototype.hn=function(){this.Fe&&(this.window.removeEventListener("pagehide",this.Fe),this.Fe=null)},e.prototype.cn=function(e){var t;try{var n=null!==(null===(t=this.Ke)||void 0===t?void 0:t.getItem(this.on(e)));return h("IndexedDbPersistence","Client '"+e+"' "+(n?"is":"is not")+" zombied in LocalStorage"),n}catch(e){return d("IndexedDbPersistence","Failed to get zombied client id.",e),!1}},e.prototype.un=function(){if(this.Ke)try{this.Ke.setItem(this.on(this.clientId),String(Date.now()))}catch(e){d("Failed to set zombie client id.",e)}},e.prototype.ln=function(){if(this.Ke)try{this.Ke.removeItem(this.on(this.clientId))}catch(e){}},e.prototype.on=function(e){return"firestore_zombie_"+this.persistenceKey+"_"+e},e}();function fi(e){return fr(e,jn.store)}function hi(e){return fr(e,Gn.store)}function di(e,t){var n=e.projectId;return e.isDefaultDatabase||(n+="."+e.database),"firestore/"+t+"/"+n+"/"}var pi=function(e,t){this.progress=e,this.wn=t},vi=function(){function e(e,t,n){this.Ue=e,this._n=t,this.Ut=n}return e.prototype.mn=function(e,t){var n=this;return this._n.getAllMutationBatchesAffectingDocumentKey(e,t).next((function(r){return n.yn(e,t,r)}))},e.prototype.yn=function(e,t,n){return this.Ue.getEntry(e,t).next((function(e){for(var t=0,r=n;t0)},e.prototype.Dn=function(e,t){return f()<=i.LogLevel.DEBUG&&h("QueryEngine","Using full collection scan to execute query:",qe(t)),this.Sn.getDocumentsMatchingQuery(e,t,S.min())},e}(),mi=function(){function e(e,t,n,r){this.persistence=e,this.xn=t,this.R=r,this.Fn=new Ct(_),this.kn=new ei((function(e){return ce(e)}),le),this.$n=S.min(),this._n=e.getMutationQueue(n),this.On=e.getRemoteDocumentCache(),this.qe=e.getTargetCache(),this.Mn=new vi(this.On,this._n,this.persistence.getIndexManager()),this.Qe=e.getBundleCache(),this.xn.Vn(this.Mn)}return e.prototype.collectGarbage=function(e){var t=this;return this.persistence.runTransaction("Collect garbage","readwrite-primary",(function(n){return e.collect(n,t.Fn)}))},e}();function bi(e,t,n,r){return new mi(e,t,n,r)}function wi(e,t){return Object(a.a)(this,void 0,void 0,(function(){var n,r,i,o;return Object(a.c)(this,(function(a){switch(a.label){case 0:return n=m(e),r=n._n,i=n.Mn,[4,n.persistence.runTransaction("Handle user change","readonly",(function(e){var o;return n._n.getAllMutationBatches(e).next((function(a){return o=a,r=n.persistence.getMutationQueue(t),i=new vi(n.On,r,n.persistence.getIndexManager()),r.getAllMutationBatches(e)})).next((function(t){for(var n=[],r=[],a=Ut(),s=0,u=o;s0){var c=s.withResumeToken(u,r).withSequenceNumber(e.currentSequenceNumber);i=i.insert(o,c),function(e,t,n){return g(t.resumeToken.approximateByteSize()>0),0===e.resumeToken.approximateByteSize()||t.snapshotVersion.toMicroseconds()-e.snapshotVersion.toMicroseconds()>=3e8||n.addedDocuments.size+n.modifiedDocuments.size+n.removedDocuments.size>0}(s,c,t)&&a.push(n.qe.updateTargetData(e,c))}}}));var s=Rt();if(t.documentUpdates.forEach((function(r,i){t.resolvedLimboDocuments.has(r)&&a.push(n.persistence.referenceDelegate.updateLimboDocument(e,r))})),a.push(Ii(e,o,t.documentUpdates,r,void 0).next((function(e){s=e}))),!r.isEqual(S.min())){var u=n.qe.getLastRemoteSnapshotVersion(e).next((function(t){return n.qe.setTargetsMetadata(e,e.currentSequenceNumber,r)}));a.push(u)}return er.waitFor(a).next((function(){return o.apply(e)})).next((function(){return n.Mn.En(e,s)})).next((function(){return s}))})).then((function(e){return n.Fn=i,e}))}function Ii(e,t,n,r,i){var o=Ut();return n.forEach((function(e){return o=o.add(e)})),t.getEntries(e,o).next((function(e){var o=Rt();return n.forEach((function(n,a){var s=e.get(n),u=(null==i?void 0:i.get(n))||r;a.isNoDocument()&&a.version.isEqual(S.min())?(t.removeEntry(n,u),o=o.insert(n,a)):!s.isValidDocument()||a.version.compareTo(s.version)>0||0===a.version.compareTo(s.version)&&s.hasPendingWrites?(t.addEntry(a,u),o=o.insert(n,a)):h("LocalStore","Ignoring outdated watch update for ",n,". Current version:",s.version," Watch version:",a.version)})),o}))}function Si(e,t){var n=m(e);return n.persistence.runTransaction("Get next mutation batch","readonly",(function(e){return void 0===t&&(t=-1),n._n.getNextMutationBatchAfterBatchId(e,t)}))}function ki(e,t){var n=m(e);return n.persistence.runTransaction("Allocate target","readwrite",(function(e){var r;return n.qe.getTargetData(e,t).next((function(i){return i?(r=i,er.resolve(r)):n.qe.allocateTargetId(e).next((function(i){return r=new pr(t,i,0,e.currentSequenceNumber),n.qe.addTargetData(e,r).next((function(){return r}))}))}))})).then((function(e){var r=n.Fn.get(e.targetId);return(null===r||e.snapshotVersion.compareTo(r.snapshotVersion)>0)&&(n.Fn=n.Fn.insert(e.targetId,e),n.kn.set(t,e.targetId)),e}))}function Ci(e,t,n){return Object(a.a)(this,void 0,void 0,(function(){var r,i,o,s;return Object(a.c)(this,(function(a){switch(a.label){case 0:r=m(e),i=r.Fn.get(t),o=n?"readwrite":"readwrite-primary",a.label=1;case 1:return a.trys.push([1,4,,5]),n?[3,3]:[4,r.persistence.runTransaction("Release target",o,(function(e){return r.persistence.referenceDelegate.removeTarget(e,i)}))];case 2:a.sent(),a.label=3;case 3:return[3,5];case 4:if(!or(s=a.sent()))throw s;return h("LocalStore","Failed to update sequence numbers for target "+t+": "+s),[3,5];case 5:return r.Fn=r.Fn.remove(t),r.kn.delete(i.target),[2]}}))}))}function Oi(e,t,n){var r=m(e),i=S.min(),o=Ut();return r.persistence.runTransaction("Execute query","readonly",(function(e){return function(e,t,n){var r=m(e),i=r.kn.get(n);return void 0!==i?er.resolve(r.Fn.get(i)):r.qe.getTargetData(t,n)}(r,e,Le(t)).next((function(t){if(t)return i=t.lastLimboFreeSnapshotVersion,r.qe.getMatchingKeysForTargetId(e,t.targetId).next((function(e){o=e}))})).next((function(){return r.xn.getDocumentsMatchingQuery(e,t,n?i:S.min(),n?o:Ut())})).next((function(e){return{documents:e,Bn:o}}))}))}function xi(e,t){var n=m(e),r=m(n.qe),i=n.Fn.get(t);return i?Promise.resolve(i.target):n.persistence.runTransaction("Get target data","readonly",(function(e){return r.lt(e,t).next((function(e){return e?e.target:null}))}))}function Ni(e){var t=m(e);return t.persistence.runTransaction("Get new document changes","readonly",(function(e){return function(e,t,n){var r=m(e),i=Rt(),o=mr(n),a=oi(t),s=IDBKeyRange.lowerBound(o,!0);return a.$t({index:Vn.readTimeIndex,range:s},(function(e,t){var n=yr(r.R,t);i=i.insert(n.key,n),o=t.readTime})).next((function(){return{wn:i,readTime:br(o)}}))}(t.On,e,t.$n)})).then((function(e){var n=e.wn,r=e.readTime;return t.$n=r,n}))}function Pi(e){return Object(a.a)(this,void 0,void 0,(function(){var t;return Object(a.c)(this,(function(n){return[2,(t=m(e)).persistence.runTransaction("Synchronize last document change read time","readonly",(function(e){return function(e){var t=oi(e),n=S.min();return t.$t({index:Vn.readTimeIndex,reverse:!0},(function(e,t,r){t.readTime&&(n=br(t.readTime)),r.done()})).next((function(){return n}))}(e)})).then((function(e){t.$n=e}))]}))}))}function Ai(e,t,n,r){return Object(a.a)(this,void 0,void 0,(function(){var i,o,s,u,c,l,f,h,d,p;return Object(a.c)(this,(function(a){switch(a.label){case 0:for(i=m(e),o=Ut(),s=Rt(),u=Mt(),c=0,l=n;c=0)return i.Qe.saveNamedQuery(e,t);var a=r.withResumeToken(D.EMPTY_BYTE_STRING,o);return i.Fn=i.Fn.insert(a.targetId,a),i.qe.updateTargetData(e,a).next((function(){return i.qe.removeMatchingKeysForTargetId(e,r.targetId)})).next((function(){return i.qe.addMatchingKeys(e,n,r.targetId)})).next((function(){return i.Qe.saveNamedQuery(e,t)}))}))]}}))}))}var Di=function(){function e(e){this.R=e,this.Kn=new Map,this.jn=new Map}return e.prototype.getBundleMetadata=function(e,t){return er.resolve(this.Kn.get(t))},e.prototype.saveBundleMetadata=function(e,t){var n;return this.Kn.set(t.id,{id:(n=t).id,version:n.version,createTime:rn(n.createTime)}),er.resolve()},e.prototype.getNamedQuery=function(e,t){return er.resolve(this.jn.get(t))},e.prototype.saveNamedQuery=function(e,t){return this.jn.set(t.name,function(e){return{name:e.name,query:Sr(e.bundledQuery),readTime:rn(e.readTime)}}(t)),er.resolve()},e}(),ji=function(){function e(){this.Wn=new Nt(Li.Gn),this.zn=new Nt(Li.Hn)}return e.prototype.isEmpty=function(){return this.Wn.isEmpty()},e.prototype.addReference=function(e,t){var n=new Li(e,t);this.Wn=this.Wn.add(n),this.zn=this.zn.add(n)},e.prototype.Jn=function(e,t){var n=this;e.forEach((function(e){return n.addReference(e,t)}))},e.prototype.removeReference=function(e,t){this.Yn(new Li(e,t))},e.prototype.Xn=function(e,t){var n=this;e.forEach((function(e){return n.removeReference(e,t)}))},e.prototype.Zn=function(e){var t=this,n=new z(new N([])),r=new Li(n,e),i=new Li(n,e+1),o=[];return this.zn.forEachInRange([r,i],(function(e){t.Yn(e),o.push(e.key)})),o},e.prototype.ts=function(){var e=this;this.Wn.forEach((function(t){return e.Yn(t)}))},e.prototype.Yn=function(e){this.Wn=this.Wn.delete(e),this.zn=this.zn.delete(e)},e.prototype.es=function(e){var t=new z(new N([])),n=new Li(t,e),r=new Li(t,e+1),i=Ut();return this.zn.forEachInRange([n,r],(function(e){i=i.add(e.key)})),i},e.prototype.containsKey=function(e){var t=new Li(e,0),n=this.Wn.firstAfterOrEqual(t);return null!==n&&e.isEqual(n.key)},e}(),Li=function(){function e(e,t){this.key=e,this.ns=t}return e.Gn=function(e,t){return z.comparator(e.key,t.key)||_(e.ns,t.ns)},e.Hn=function(e,t){return _(e.ns,t.ns)||z.comparator(e.key,t.key)},e}(),Mi=function(){function e(e,t){this.Ut=e,this.referenceDelegate=t,this._n=[],this.ss=1,this.rs=new Nt(Li.Gn)}return e.prototype.checkEmpty=function(e){return er.resolve(0===this._n.length)},e.prototype.addMutationBatch=function(e,t,n,r){var i=this.ss;this.ss++,this._n.length>0&&this._n[this._n.length-1];var o=new hr(i,t,n,r);this._n.push(o);for(var a=0,s=r;ai?this._n[i]:null)},e.prototype.getHighestUnacknowledgedBatchId=function(){return er.resolve(0===this._n.length?-1:this.ss-1)},e.prototype.getAllMutationBatches=function(e){return er.resolve(this._n.slice())},e.prototype.getAllMutationBatchesAffectingDocumentKey=function(e,t){var n=this,r=new Li(t,0),i=new Li(t,Number.POSITIVE_INFINITY),o=[];return this.rs.forEachInRange([r,i],(function(e){var t=n.os(e.ns);o.push(t)})),er.resolve(o)},e.prototype.getAllMutationBatchesAffectingDocumentKeys=function(e,t){var n=this,r=new Nt(_);return t.forEach((function(e){var t=new Li(e,0),i=new Li(e,Number.POSITIVE_INFINITY);n.rs.forEachInRange([t,i],(function(e){r=r.add(e.ns)}))})),er.resolve(this.us(r))},e.prototype.getAllMutationBatchesAffectingQuery=function(e,t){var n=t.path,r=n.length+1,i=n;z.isDocumentKey(i)||(i=i.child(""));var o=new Li(new z(i),0),a=new Nt(_);return this.rs.forEachWhile((function(e){var t=e.key.path;return!!n.isPrefixOf(t)&&(t.length===r&&(a=a.add(e.ns)),!0)}),o),er.resolve(this.us(a))},e.prototype.us=function(e){var t=this,n=[];return e.forEach((function(e){var r=t.os(e);null!==r&&n.push(r)})),n},e.prototype.removeMutationBatch=function(e,t){var n=this;g(0===this.hs(t.batchId,"removed")),this._n.shift();var r=this.rs;return er.forEach(t.mutations,(function(i){var o=new Li(i.key,t.batchId);return r=r.delete(o),n.referenceDelegate.markPotentiallyOrphaned(e,i.key)})).next((function(){n.rs=r}))},e.prototype.Gt=function(e){},e.prototype.containsKey=function(e,t){var n=new Li(t,0),r=this.rs.firstAfterOrEqual(n);return er.resolve(t.isEqual(r&&r.key))},e.prototype.performConsistencyCheck=function(e){return this._n.length,er.resolve()},e.prototype.hs=function(e,t){return this.cs(e)},e.prototype.cs=function(e){return 0===this._n.length?0:e-this._n[0].batchId},e.prototype.os=function(e){var t=this.cs(e);return t<0||t>=this._n.length?null:this._n[t]},e}(),Fi=function(){function e(e,t){this.Ut=e,this.ls=t,this.docs=new Ct(z.comparator),this.size=0}return e.prototype.addEntry=function(e,t,n){var r=t.key,i=this.docs.get(r),o=i?i.size:0,a=this.ls(t);return this.docs=this.docs.insert(r,{document:t.clone(),size:a,readTime:n}),this.size+=a-o,this.Ut.addToCollectionParentIndex(e,r.path.popLast())},e.prototype.removeEntry=function(e){var t=this.docs.get(e);t&&(this.docs=this.docs.remove(e),this.size-=t.size)},e.prototype.getEntry=function(e,t){var n=this.docs.get(t);return er.resolve(n?n.document.clone():ae.newInvalidDocument(t))},e.prototype.getEntries=function(e,t){var n=this,r=Rt();return t.forEach((function(e){var t=n.docs.get(e);r=r.insert(e,t?t.document.clone():ae.newInvalidDocument(e))})),er.resolve(r)},e.prototype.getDocumentsMatchingQuery=function(e,t,n){for(var r=Rt(),i=new z(t.path.child("")),o=this.docs.getIteratorFrom(i);o.hasNext();){var a=o.getNext(),s=a.key,u=a.value,c=u.document,l=u.readTime;if(!t.path.isPrefixOf(s.path))break;l.compareTo(n)<=0||Ve(t,c)&&(r=r.insert(c.key,c.clone()))}return er.resolve(r)},e.prototype.fs=function(e,t){return er.forEach(this.docs,(function(e){return t(e)}))},e.prototype.newChangeBuffer=function(e){return new Ui(this)},e.prototype.getSize=function(e){return er.resolve(this.size)},e}(),Ui=function(e){function t(t){var n=this;return(n=e.call(this)||this).Ie=t,n}return Object(a.b)(t,e),t.prototype.applyChanges=function(e){var t=this,n=[];return this.changes.forEach((function(r,i){i.document.isValidDocument()?n.push(t.Ie.addEntry(e,i.document,t.getReadTime(r))):t.Ie.removeEntry(r)})),er.waitFor(n)},t.prototype.getFromCache=function(e,t){return this.Ie.getEntry(e,t)},t.prototype.getAllFromCache=function(e,t){return this.Ie.getEntries(e,t)},t}(ti),qi=function(){function e(e){this.persistence=e,this.ds=new ei((function(e){return ce(e)}),le),this.lastRemoteSnapshotVersion=S.min(),this.highestTargetId=0,this.ws=0,this._s=new ji,this.targetCount=0,this.ys=Br.Jt()}return e.prototype.forEachTarget=function(e,t){return this.ds.forEach((function(e,n){return t(n)})),er.resolve()},e.prototype.getLastRemoteSnapshotVersion=function(e){return er.resolve(this.lastRemoteSnapshotVersion)},e.prototype.getHighestSequenceNumber=function(e){return er.resolve(this.ws)},e.prototype.allocateTargetId=function(e){return this.highestTargetId=this.ys.next(),er.resolve(this.highestTargetId)},e.prototype.setTargetsMetadata=function(e,t,n){return n&&(this.lastRemoteSnapshotVersion=n),t>this.ws&&(this.ws=t),er.resolve()},e.prototype.te=function(e){this.ds.set(e.target,e);var t=e.targetId;t>this.highestTargetId&&(this.ys=new Br(t),this.highestTargetId=t),e.sequenceNumber>this.ws&&(this.ws=e.sequenceNumber)},e.prototype.addTargetData=function(e,t){return this.te(t),this.targetCount+=1,er.resolve()},e.prototype.updateTargetData=function(e,t){return this.te(t),er.resolve()},e.prototype.removeTargetData=function(e,t){return this.ds.delete(t.target),this._s.Zn(t.targetId),this.targetCount-=1,er.resolve()},e.prototype.removeTargets=function(e,t,n){var r=this,i=0,o=[];return this.ds.forEach((function(a,s){s.sequenceNumber<=t&&null===n.get(s.targetId)&&(r.ds.delete(a),o.push(r.removeMatchingKeysForTargetId(e,s.targetId)),i++)})),er.waitFor(o).next((function(){return i}))},e.prototype.getTargetCount=function(e){return er.resolve(this.targetCount)},e.prototype.getTargetData=function(e,t){var n=this.ds.get(t)||null;return er.resolve(n)},e.prototype.addMatchingKeys=function(e,t,n){return this._s.Jn(t,n),er.resolve()},e.prototype.removeMatchingKeys=function(e,t,n){this._s.Xn(t,n);var r=this.persistence.referenceDelegate,i=[];return r&&t.forEach((function(t){i.push(r.markPotentiallyOrphaned(e,t))})),er.waitFor(i)},e.prototype.removeMatchingKeysForTargetId=function(e,t){return this._s.Zn(t),er.resolve()},e.prototype.getMatchingKeysForTargetId=function(e,t){var n=this._s.es(t);return er.resolve(n)},e.prototype.containsKey=function(e,t){return er.resolve(this._s.containsKey(t))},e}(),Vi=function(){function e(e,t){var n=this;this.gs={},this.Ne=new s(0),this.xe=!1,this.xe=!0,this.referenceDelegate=e(this),this.qe=new qi(this),this.Ut=new xr,this.Ue=function(e,t){return new Fi(e,(function(e){return n.referenceDelegate.ps(e)}))}(this.Ut),this.R=new vr(t),this.Qe=new Di(this.R)}return e.prototype.start=function(){return Promise.resolve()},e.prototype.shutdown=function(){return this.xe=!1,Promise.resolve()},Object.defineProperty(e.prototype,"started",{get:function(){return this.xe},enumerable:!1,configurable:!0}),e.prototype.setDatabaseDeletedListener=function(){},e.prototype.setNetworkEnabled=function(){},e.prototype.getIndexManager=function(){return this.Ut},e.prototype.getMutationQueue=function(e){var t=this.gs[e.toKey()];return t||(t=new Mi(this.Ut,this.referenceDelegate),this.gs[e.toKey()]=t),t},e.prototype.getTargetCache=function(){return this.qe},e.prototype.getRemoteDocumentCache=function(){return this.Ue},e.prototype.getBundleCache=function(){return this.Qe},e.prototype.runTransaction=function(e,t,n){var r=this;h("MemoryPersistence","Starting transaction:",e);var i=new Bi(this.Ne.next());return this.referenceDelegate.Es(),n(i).next((function(e){return r.referenceDelegate.Ts(i).next((function(){return e}))})).toPromise().then((function(e){return i.raiseOnCommittedEvent(),e}))},e.prototype.Is=function(e,t){return er.or(Object.values(this.gs).map((function(n){return function(){return n.containsKey(e,t)}})))},e}(),Bi=function(e){function t(t){var n=this;return(n=e.call(this)||this).currentSequenceNumber=t,n}return Object(a.b)(t,e),t}(Jn),Ki=function(){function e(e){this.persistence=e,this.As=new ji,this.Rs=null}return e.bs=function(t){return new e(t)},Object.defineProperty(e.prototype,"vs",{get:function(){if(this.Rs)return this.Rs;throw y()},enumerable:!1,configurable:!0}),e.prototype.addReference=function(e,t,n){return this.As.addReference(n,t),this.vs.delete(n.toString()),er.resolve()},e.prototype.removeReference=function(e,t,n){return this.As.removeReference(n,t),this.vs.add(n.toString()),er.resolve()},e.prototype.markPotentiallyOrphaned=function(e,t){return this.vs.add(t.toString()),er.resolve()},e.prototype.removeTarget=function(e,t){var n=this;this.As.Zn(t.targetId).forEach((function(e){return n.vs.add(e.toString())}));var r=this.persistence.getTargetCache();return r.getMatchingKeysForTargetId(e,t.targetId).next((function(e){e.forEach((function(e){return n.vs.add(e.toString())}))})).next((function(){return r.removeTargetData(e,t)}))},e.prototype.Es=function(){this.Rs=new Set},e.prototype.Ts=function(e){var t=this,n=this.persistence.getRemoteDocumentCache().newChangeBuffer();return er.forEach(this.vs,(function(r){var i=z.fromPath(r);return t.Ps(e,i).next((function(e){e||n.removeEntry(i)}))})).next((function(){return t.Rs=null,n.apply(e)}))},e.prototype.updateLimboDocument=function(e,t){var n=this;return this.Ps(e,t).next((function(e){e?n.vs.delete(t.toString()):n.vs.add(t.toString())}))},e.prototype.ps=function(e){return 0},e.prototype.Ps=function(e,t){var n=this;return er.or([function(){return er.resolve(n.As.containsKey(t))},function(){return n.persistence.getTargetCache().containsKey(e,t)},function(){return n.persistence.Is(e,t)}])},e}(),zi=function(){function e(e){this.uid=e}return e.prototype.isAuthenticated=function(){return null!=this.uid},e.prototype.toKey=function(){return this.isAuthenticated()?"uid:"+this.uid:"anonymous-user"},e.prototype.isEqual=function(e){return e.uid===this.uid},e}();function Wi(e,t){return"firestore_clients_"+e+"_"+t}function Hi(e,t,n){var r="firestore_mutations_"+e+"_"+n;return t.isAuthenticated()&&(r+="_"+t.uid),r}function Gi(e,t){return"firestore_targets_"+e+"_"+t}zi.UNAUTHENTICATED=new zi(null),zi.GOOGLE_CREDENTIALS=new zi("google-credentials-uid"),zi.FIRST_PARTY=new zi("first-party-uid");var Qi=function(){function e(e,t,n,r){this.user=e,this.batchId=t,this.state=n,this.error=r}return e.Vs=function(t,n,r){var i,o=JSON.parse(r),a="object"==typeof o&&-1!==["pending","acknowledged","rejected"].indexOf(o.state)&&(void 0===o.error||"object"==typeof o.error);return a&&o.error&&(a="string"==typeof o.error.message&&"string"==typeof o.error.code)&&(i=new c(o.error.code,o.error.message)),a?new e(t,n,o.state,i):(d("SharedClientState","Failed to parse mutation state for ID '"+n+"': "+r),null)},e.prototype.Ss=function(){var e={state:this.state,updateTimeMs:Date.now()};return this.error&&(e.error={code:this.error.code,message:this.error.message}),JSON.stringify(e)},e}(),$i=function(){function e(e,t,n){this.targetId=e,this.state=t,this.error=n}return e.Vs=function(t,n){var r,i=JSON.parse(n),o="object"==typeof i&&-1!==["not-current","current","rejected"].indexOf(i.state)&&(void 0===i.error||"object"==typeof i.error);return o&&i.error&&(o="string"==typeof i.error.message&&"string"==typeof i.error.code)&&(r=new c(i.error.code,i.error.message)),o?new e(t,i.state,r):(d("SharedClientState","Failed to parse target state for ID '"+t+"': "+n),null)},e.prototype.Ss=function(){var e={state:this.state,updateTimeMs:Date.now()};return this.error&&(e.error={code:this.error.code,message:this.error.message}),JSON.stringify(e)},e}(),Yi=function(){function e(e,t){this.clientId=e,this.activeTargetIds=t}return e.Vs=function(t,n){for(var r=JSON.parse(n),i="object"==typeof r&&r.activeTargetIds instanceof Array,o=Vt(),a=0;i&&a0){var r=s.getResponseJson().error;if(r&&r.status&&r.message){var l=function(e){var t=e.toLowerCase().replace(/_/g,"-");return Object.values(u).indexOf(t)>=0?t:u.UNKNOWN}(r.status);a(new c(l,r.message))}else a(new c(u.UNKNOWN,"Server responded with status "+s.getStatus()))}else a(new c(u.UNAVAILABLE,"Connection failed."));break;default:y()}}finally{h("Connection",'RPC "'+e+'" completed.')}}));var l=JSON.stringify(r);s.send(t,"POST",l,n,15)}))},t.prototype.Oi=function(e,t){var n=[this.Di,"/","google.firestore.v1.Firestore","/",e,"/channel"],i=Object(o.h)(),a=Object(o.i)(),s={httpSessionIdParam:"gsessionid",initMessageHeaders:{},messageUrlParams:{database:"projects/"+this.databaseId.projectId+"/databases/"+this.databaseId.database},sendRawJson:!0,supportsCrossDomainXhr:!0,internalChannelParams:{forwardChannelRequestTimeoutMs:6e5},forceLongPolling:this.forceLongPolling,detectBufferingProxy:this.autoDetectLongPolling};this.useFetchStreams&&(s.xmlHttpFactory=new o.d({})),this.Fi(s.initMessageHeaders,t),Object(r.isMobileCordova)()||Object(r.isReactNative)()||Object(r.isElectron)()||Object(r.isIE)()||Object(r.isUWP)()||Object(r.isBrowserExtension)()||(s.httpHeadersOverwriteParam="$httpHeaders");var l=n.join("");h("Connection","Creating WebChannel: "+l,s);var f=i.createWebChannel(l,s),d=!1,v=!1,y=new io({Ei:function(e){v?h("Connection","Not sending because WebChannel is closed:",e):(d||(h("Connection","Opening WebChannel transport."),f.open(),d=!0),h("Connection","WebChannel sending:",e),f.send(e))},Ti:function(){return f.close()}}),m=function(e,t,n){e.listen(t,(function(e){try{n(e)}catch(e){setTimeout((function(){throw e}),0)}}))};return m(f,o.f.EventType.OPEN,(function(){v||h("Connection","WebChannel transport opened.")})),m(f,o.f.EventType.CLOSE,(function(){v||(v=!0,h("Connection","WebChannel transport closed"),y.Vi())})),m(f,o.f.EventType.ERROR,(function(e){v||(v=!0,p("Connection","WebChannel transport errored:",e),y.Vi(new c(u.UNAVAILABLE,"The operation could not be completed")))})),m(f,o.f.EventType.MESSAGE,(function(e){var t;if(!v){var n=e.data[0];g(!!n);var r=n,i=r.error||(null===(t=r[0])||void 0===t?void 0:t.error);if(i){h("Connection","WebChannel received error:",i);var o=i.status,a=function(e){var t=wt[e];if(void 0!==t)return kt(t)}(o),s=i.message;void 0===a&&(a=u.INTERNAL,s="Unknown error status: "+o+" with message "+i.message),v=!0,y.Vi(new c(a,s)),f.close()}else h("Connection","WebChannel received:",n),y.Si(n)}})),m(a,o.b.STAT_EVENT,(function(e){e.stat===o.e.PROXY?h("Connection","Detected buffering proxy"):e.stat===o.e.NOPROXY&&h("Connection","Detected no buffering proxy")})),setTimeout((function(){y.Pi()}),0),y},t}(function(){function e(e){this.databaseInfo=e,this.databaseId=e.databaseId;var t=e.ssl?"https":"http";this.Di=t+"://"+e.host,this.Ci="projects/"+this.databaseId.projectId+"/databases/"+this.databaseId.database+"/documents"}return e.prototype.Ni=function(e,t,n,r){var i=this.xi(e,t);h("RestConnection","Sending: ",i,n);var o={};return this.Fi(o,r),this.ki(e,i,o,n).then((function(e){return h("RestConnection","Received: ",e),e}),(function(t){throw p("RestConnection",e+" failed with error: ",t,"url: ",i,"request:",n),t}))},e.prototype.$i=function(e,t,n,r){return this.Ni(e,t,n,r)},e.prototype.Fi=function(e,t){if(e["X-Goog-Api-Client"]="gl-js/ fire/8.6.8",e["Content-Type"]="text/plain",this.databaseInfo.appId&&(e["X-Firebase-GMPID"]=this.databaseInfo.appId),t)for(var n in t.authHeaders)t.authHeaders.hasOwnProperty(n)&&(e[n]=t.authHeaders[n])},e.prototype.xi=function(e,t){var n=ro[e];return this.Di+"/v1/"+t+":"+n},e}());function ao(){return"undefined"!=typeof window?window:null}function so(){return"undefined"!=typeof document?document:null}function uo(e){return new Zt(e,!0)}var co=function(){function e(e,t,n,r,i){void 0===n&&(n=1e3),void 0===r&&(r=1.5),void 0===i&&(i=6e4),this.Se=e,this.timerId=t,this.Mi=n,this.Li=r,this.Bi=i,this.qi=0,this.Ui=null,this.Qi=Date.now(),this.reset()}return e.prototype.reset=function(){this.qi=0},e.prototype.Ki=function(){this.qi=this.Bi},e.prototype.ji=function(e){var t=this;this.cancel();var n=Math.floor(this.qi+this.Wi()),r=Math.max(0,Date.now()-this.Qi),i=Math.max(0,n-r);i>0&&h("ExponentialBackoff","Backing off for "+i+" ms (base delay: "+this.qi+" ms, delay with jitter: "+n+" ms, last attempt: "+r+" ms ago)"),this.Ui=this.Se.enqueueAfterDelay(this.timerId,i,(function(){return t.Qi=Date.now(),e()})),this.qi*=this.Li,this.qithis.Bi&&(this.qi=this.Bi)},e.prototype.Gi=function(){null!==this.Ui&&(this.Ui.skipDelay(),this.Ui=null)},e.prototype.cancel=function(){null!==this.Ui&&(this.Ui.cancel(),this.Ui=null)},e.prototype.Wi=function(){return(Math.random()-.5)*this.qi},e}(),lo=function(){function e(e,t,n,r,i,o){this.Se=e,this.zi=n,this.Hi=r,this.Ji=i,this.listener=o,this.state=0,this.Yi=0,this.Xi=null,this.stream=null,this.Zi=new co(e,t)}return e.prototype.tr=function(){return 1===this.state||2===this.state||4===this.state},e.prototype.er=function(){return 2===this.state},e.prototype.start=function(){3!==this.state?this.auth():this.nr()},e.prototype.stop=function(){return Object(a.a)(this,void 0,void 0,(function(){return Object(a.c)(this,(function(e){switch(e.label){case 0:return this.tr()?[4,this.close(0)]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))},e.prototype.sr=function(){this.state=0,this.Zi.reset()},e.prototype.ir=function(){var e=this;this.er()&&null===this.Xi&&(this.Xi=this.Se.enqueueAfterDelay(this.zi,6e4,(function(){return e.rr()})))},e.prototype.cr=function(e){this.ur(),this.stream.send(e)},e.prototype.rr=function(){return Object(a.a)(this,void 0,void 0,(function(){return Object(a.c)(this,(function(e){return this.er()?[2,this.close(0)]:[2]}))}))},e.prototype.ur=function(){this.Xi&&(this.Xi.cancel(),this.Xi=null)},e.prototype.close=function(e,t){return Object(a.a)(this,void 0,void 0,(function(){return Object(a.c)(this,(function(n){switch(n.label){case 0:return this.ur(),this.Zi.cancel(),this.Yi++,3!==e?this.Zi.reset():t&&t.code===u.RESOURCE_EXHAUSTED?(d(t.toString()),d("Using maximum backoff delay to prevent overloading the backend."),this.Zi.Ki()):t&&t.code===u.UNAUTHENTICATED&&this.Ji.invalidateToken(),null!==this.stream&&(this.ar(),this.stream.close(),this.stream=null),this.state=e,[4,this.listener.Ri(t)];case 1:return n.sent(),[2]}}))}))},e.prototype.ar=function(){},e.prototype.auth=function(){var e=this;this.state=1;var t=this.hr(this.Yi),n=this.Yi;this.Ji.getToken().then((function(t){e.Yi===n&&e.lr(t)}),(function(n){t((function(){var t=new c(u.UNKNOWN,"Fetching auth token failed: "+n.message);return e.dr(t)}))}))},e.prototype.lr=function(e){var t=this,n=this.hr(this.Yi);this.stream=this.wr(e),this.stream.Ii((function(){n((function(){return t.state=2,t.listener.Ii()}))})),this.stream.Ri((function(e){n((function(){return t.dr(e)}))})),this.stream.onMessage((function(e){n((function(){return t.onMessage(e)}))}))},e.prototype.nr=function(){var e=this;this.state=4,this.Zi.ji((function(){return Object(a.a)(e,void 0,void 0,(function(){return Object(a.c)(this,(function(e){return this.state=0,this.start(),[2]}))}))}))},e.prototype.dr=function(e){return h("PersistentStream","close with error: "+e),this.stream=null,this.close(3,e)},e.prototype.hr=function(e){var t=this;return function(n){t.Se.enqueueAndForget((function(){return t.Yi===e?n():(h("PersistentStream","stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve())}))}},e}(),fo=function(e){function t(t,n,r,i,o){var a=this;return(a=e.call(this,t,"listen_stream_connection_backoff","listen_stream_idle",n,r,o)||this).R=i,a}return Object(a.b)(t,e),t.prototype.wr=function(e){return this.Hi.Oi("Listen",e)},t.prototype.onMessage=function(e){this.Zi.reset();var t=function(e,t){var n;if("targetChange"in t){t.targetChange;var r=function(e){return"NO_CHANGE"===e?0:"ADD"===e?1:"REMOVE"===e?2:"CURRENT"===e?3:"RESET"===e?4:y()}(t.targetChange.targetChangeType||"NO_CHANGE"),i=t.targetChange.targetIds||[],o=function(e,t){return e.I?(g(void 0===t||"string"==typeof t),D.fromBase64String(t||"")):(g(void 0===t||t instanceof Uint8Array),D.fromUint8Array(t||new Uint8Array))}(e,t.targetChange.resumeToken),a=(s=t.targetChange.cause)&&function(e){var t=void 0===e.code?u.UNKNOWN:kt(e.code);return new c(t,e.message||"")}(s);n=new Ht(r,i,o,a||null)}else if("documentChange"in t){t.documentChange,(r=t.documentChange).document,r.document.name,r.document.updateTime,i=un(e,r.document.name),o=rn(r.document.updateTime);var s=new ie({mapValue:{fields:r.document.fields}}),l=(a=ae.newFoundDocument(i,o,s),r.targetIds||[]),f=r.removedTargetIds||[];n=new zt(l,f,a.key,a)}else if("documentDelete"in t)t.documentDelete,(r=t.documentDelete).document,i=un(e,r.document),o=r.readTime?rn(r.readTime):S.min(),s=ae.newNoDocument(i,o),a=r.removedTargetIds||[],n=new zt([],a,s.key,s);else if("documentRemove"in t)t.documentRemove,(r=t.documentRemove).document,i=un(e,r.document),o=r.removedTargetIds||[],n=new zt([],o,i,null);else{if(!("filter"in t))return y();t.filter;var h=t.filter;h.targetId,r=h.count||0,i=new It(r),o=h.targetId,n=new Wt(o,i)}return n}(this.R,e),n=function(e){if(!("targetChange"in e))return S.min();var t=e.targetChange;return t.targetIds&&t.targetIds.length?S.min():t.readTime?rn(t.readTime):S.min()}(e);return this.listener._r(t,n)},t.prototype.mr=function(e){var t={};t.database=fn(this.R),t.addTarget=function(e,t){var n,r=t.target;return(n=fe(r)?{documents:gn(e,r)}:{query:mn(e,r)}).targetId=t.targetId,t.resumeToken.approximateByteSize()>0?n.resumeToken=tn(e,t.resumeToken):t.snapshotVersion.compareTo(S.min())>0&&(n.readTime=en(e,t.snapshotVersion.toTimestamp())),n}(this.R,e);var n=function(e,t){var n=function(e,t){switch(t){case 0:return null;case 1:return"existence-filter-mismatch";case 2:return"limbo-document";default:return y()}}(0,t.purpose);return null==n?null:{"goog-listen-tags":n}}(this.R,e);n&&(t.labels=n),this.cr(t)},t.prototype.yr=function(e){var t={};t.database=fn(this.R),t.removeTarget=e,this.cr(t)},t}(lo),ho=function(e){function t(t,n,r,i,o){var a=this;return(a=e.call(this,t,"write_stream_connection_backoff","write_stream_idle",n,r,o)||this).R=i,a.gr=!1,a}return Object(a.b)(t,e),Object.defineProperty(t.prototype,"pr",{get:function(){return this.gr},enumerable:!1,configurable:!0}),t.prototype.start=function(){this.gr=!1,this.lastStreamToken=void 0,e.prototype.start.call(this)},t.prototype.ar=function(){this.gr&&this.Er([])},t.prototype.wr=function(e){return this.Hi.Oi("Write",e)},t.prototype.onMessage=function(e){if(g(!!e.streamToken),this.lastStreamToken=e.streamToken,this.gr){this.Zi.reset();var t=function(e,t){return e&&e.length>0?(g(void 0!==t),e.map((function(e){return function(e,t){var n=e.updateTime?rn(e.updateTime):rn(t);return n.isEqual(S.min())&&(n=rn(t)),new at(n,e.transformResults||[])}(e,t)}))):[]}(e.writeResults,e.commitTime),n=rn(e.commitTime);return this.listener.Tr(n,t)}return g(!e.writeResults||0===e.writeResults.length),this.gr=!0,this.listener.Ir()},t.prototype.Ar=function(){var e={};e.database=fn(this.R),this.cr(e)},t.prototype.Er=function(e){var t=this,n={streamToken:this.lastStreamToken,writes:e.map((function(e){return vn(t.R,e)}))};this.cr(n)},t}(lo),po=function(e){function t(t,n,r){var i=this;return(i=e.call(this)||this).credentials=t,i.Hi=n,i.R=r,i.Rr=!1,i}return Object(a.b)(t,e),t.prototype.br=function(){if(this.Rr)throw new c(u.FAILED_PRECONDITION,"The client has already been terminated.")},t.prototype.Ni=function(e,t,n){var r=this;return this.br(),this.credentials.getToken().then((function(i){return r.Hi.Ni(e,t,n,i)})).catch((function(e){throw"FirebaseError"===e.name?(e.code===u.UNAUTHENTICATED&&r.credentials.invalidateToken(),e):new c(u.UNKNOWN,e.toString())}))},t.prototype.$i=function(e,t,n){var r=this;return this.br(),this.credentials.getToken().then((function(i){return r.Hi.$i(e,t,n,i)})).catch((function(e){throw"FirebaseError"===e.name?(e.code===u.UNAUTHENTICATED&&r.credentials.invalidateToken(),e):new c(u.UNKNOWN,e.toString())}))},t.prototype.terminate=function(){this.Rr=!0},t}((function(){})),vo=function(){function e(e,t){this.asyncQueue=e,this.onlineStateHandler=t,this.state="Unknown",this.vr=0,this.Pr=null,this.Vr=!0}return e.prototype.Sr=function(){var e=this;0===this.vr&&(this.Dr("Unknown"),this.Pr=this.asyncQueue.enqueueAfterDelay("online_state_timeout",1e4,(function(){return e.Pr=null,e.Cr("Backend didn't respond within 10 seconds."),e.Dr("Offline"),Promise.resolve()})))},e.prototype.Nr=function(e){"Online"===this.state?this.Dr("Unknown"):(this.vr++,this.vr>=1&&(this.Fr(),this.Cr("Connection failed 1 times. Most recent error: "+e.toString()),this.Dr("Offline")))},e.prototype.set=function(e){this.Fr(),this.vr=0,"Online"===e&&(this.Vr=!1),this.Dr(e)},e.prototype.Dr=function(e){e!==this.state&&(this.state=e,this.onlineStateHandler(e))},e.prototype.Cr=function(e){var t="Could not reach Cloud Firestore backend. "+e+"\nThis typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.";this.Vr?(d(t),this.Vr=!1):h("OnlineStateTracker",t)},e.prototype.Fr=function(){null!==this.Pr&&(this.Pr.cancel(),this.Pr=null)},e}(),yo=function(e,t,n,r,i){var o=this;this.localStore=e,this.datastore=t,this.asyncQueue=n,this.remoteSyncer={},this.kr=[],this.$r=new Map,this.Or=new Set,this.Mr=[],this.Lr=i,this.Lr.di((function(e){n.enqueueAndForget((function(){return Object(a.a)(o,void 0,void 0,(function(){return Object(a.c)(this,(function(e){switch(e.label){case 0:return So(this)?(h("RemoteStore","Restarting streams for network reachability change."),[4,function(e){return Object(a.a)(this,void 0,void 0,(function(){var t;return Object(a.c)(this,(function(n){switch(n.label){case 0:return(t=m(e)).Or.add(4),[4,mo(t)];case 1:return n.sent(),t.Br.set("Unknown"),t.Or.delete(4),[4,go(t)];case 2:return n.sent(),[2]}}))}))}(this)]):[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))}))})),this.Br=new vo(n,r)};function go(e){return Object(a.a)(this,void 0,void 0,(function(){var t,n;return Object(a.c)(this,(function(r){switch(r.label){case 0:if(!So(e))return[3,4];t=0,n=e.Mr,r.label=1;case 1:return t0}function So(e){return 0===m(e).Or.size}function ko(e){e.qr=void 0}function Co(e){return Object(a.a)(this,void 0,void 0,(function(){return Object(a.c)(this,(function(t){return e.$r.forEach((function(t,n){_o(e,t)})),[2]}))}))}function Oo(e,t){return Object(a.a)(this,void 0,void 0,(function(){return Object(a.c)(this,(function(n){return ko(e),Io(e)?(e.Br.Nr(t),To(e)):e.Br.set("Unknown"),[2]}))}))}function xo(e,t,n){return Object(a.a)(this,void 0,void 0,(function(){var r,i,o;return Object(a.c)(this,(function(s){switch(s.label){case 0:if(e.Br.set("Online"),!(t instanceof Ht&&2===t.state&&t.cause))return[3,6];s.label=1;case 1:return s.trys.push([1,3,,5]),[4,function(e,t){return Object(a.a)(this,void 0,void 0,(function(){var n,r,i,o;return Object(a.c)(this,(function(a){switch(a.label){case 0:n=t.cause,r=0,i=t.targetIds,a.label=1;case 1:return r=0?[4,function(e,t){var n=e.qr.ut(t);return n.targetChanges.forEach((function(n,r){if(n.resumeToken.approximateByteSize()>0){var i=e.$r.get(r);i&&e.$r.set(r,i.withResumeToken(n.resumeToken,t))}})),n.targetMismatches.forEach((function(t){var n=e.$r.get(t);if(n){e.$r.set(t,n.withResumeToken(D.EMPTY_BYTE_STRING,n.snapshotVersion)),Eo(e,t);var r=new pr(n.target,t,1,n.sequenceNumber);_o(e,r)}})),e.remoteSyncer.applyRemoteEvent(n)}(e,n)]:[3,10];case 9:s.sent(),s.label=10;case 10:return[3,13];case 11:return h("RemoteStore","Failed to raise snapshot:",o=s.sent()),[4,No(e,o)];case 12:return s.sent(),[3,13];case 13:return[2]}}))}))}function No(e,t,n){return Object(a.a)(this,void 0,void 0,(function(){var r=this;return Object(a.c)(this,(function(i){switch(i.label){case 0:if(!or(t))throw t;return e.Or.add(1),[4,mo(e)];case 1:return i.sent(),e.Br.set("Offline"),n||(n=function(){return Ei(e.localStore)}),e.asyncQueue.enqueueRetryable((function(){return Object(a.a)(r,void 0,void 0,(function(){return Object(a.c)(this,(function(t){switch(t.label){case 0:return h("RemoteStore","Retrying IndexedDB access"),[4,n()];case 1:return t.sent(),e.Or.delete(1),[4,go(e)];case 2:return t.sent(),[2]}}))}))})),[2]}}))}))}function Po(e,t){return t().catch((function(n){return No(e,n,t)}))}function Ao(e){return Object(a.a)(this,void 0,void 0,(function(){var t,n,r,i,o;return Object(a.c)(this,(function(a){switch(a.label){case 0:t=m(e),n=Vo(t),r=t.kr.length>0?t.kr[t.kr.length-1].batchId:-1,a.label=1;case 1:if(!function(e){return So(e)&&e.kr.length<10}(t))return[3,7];a.label=2;case 2:return a.trys.push([2,4,,6]),[4,Si(t.localStore,r)];case 3:return null===(i=a.sent())?(0===t.kr.length&&n.ir(),[3,7]):(r=i.batchId,function(e,t){e.kr.push(t);var n=Vo(e);n.er()&&n.pr&&n.Er(t.mutations)}(t,i),[3,6]);case 4:return o=a.sent(),[4,No(t,o)];case 5:return a.sent(),[3,6];case 6:return[3,1];case 7:return Ro(t)&&Do(t),[2]}}))}))}function Ro(e){return So(e)&&!Vo(e).tr()&&e.kr.length>0}function Do(e){Vo(e).start()}function jo(e){return Object(a.a)(this,void 0,void 0,(function(){return Object(a.c)(this,(function(t){return Vo(e).Ar(),[2]}))}))}function Lo(e){return Object(a.a)(this,void 0,void 0,(function(){var t,n,r,i;return Object(a.c)(this,(function(o){for(t=Vo(e),n=0,r=e.kr;n0&&(h("RemoteStore","Stopping write stream with "+e.kr.length+" pending writes"),e.kr=[]),t.label=4;case 4:return[2]}}))}))}))),e.Qr}var Bo=function(){function e(e,t,n,r,i){this.asyncQueue=e,this.timerId=t,this.targetTimeMs=n,this.op=r,this.removalCallback=i,this.deferred=new Zn,this.then=this.deferred.promise.then.bind(this.deferred.promise),this.deferred.promise.catch((function(e){}))}return e.createAndSchedule=function(t,n,r,i,o){var a=new e(t,n,Date.now()+r,i,o);return a.start(r),a},e.prototype.start=function(e){var t=this;this.timerHandle=setTimeout((function(){return t.handleDelayElapsed()}),e)},e.prototype.skipDelay=function(){return this.handleDelayElapsed()},e.prototype.cancel=function(e){null!==this.timerHandle&&(this.clearTimeout(),this.deferred.reject(new c(u.CANCELLED,"Operation cancelled"+(e?": "+e:""))))},e.prototype.handleDelayElapsed=function(){var e=this;this.asyncQueue.enqueueAndForget((function(){return null!==e.timerHandle?(e.clearTimeout(),e.op().then((function(t){return e.deferred.resolve(t)}))):Promise.resolve()}))},e.prototype.clearTimeout=function(){null!==this.timerHandle&&(this.removalCallback(this),clearTimeout(this.timerHandle),this.timerHandle=null)},e}();function Ko(e,t){if(d("AsyncQueue",t+": "+e),or(e))return new c(u.UNAVAILABLE,t+": "+e);throw e}var zo=function(){function e(e){this.comparator=e?function(t,n){return e(t,n)||z.comparator(t.key,n.key)}:function(e,t){return z.comparator(e.key,t.key)},this.keyedMap=jt(),this.sortedSet=new Ct(this.comparator)}return e.emptySet=function(t){return new e(t.comparator)},e.prototype.has=function(e){return null!=this.keyedMap.get(e)},e.prototype.get=function(e){return this.keyedMap.get(e)},e.prototype.first=function(){return this.sortedSet.minKey()},e.prototype.last=function(){return this.sortedSet.maxKey()},e.prototype.isEmpty=function(){return this.sortedSet.isEmpty()},e.prototype.indexOf=function(e){var t=this.keyedMap.get(e);return t?this.sortedSet.indexOf(t):-1},Object.defineProperty(e.prototype,"size",{get:function(){return this.sortedSet.size},enumerable:!1,configurable:!0}),e.prototype.forEach=function(e){this.sortedSet.inorderTraversal((function(t,n){return e(t),!1}))},e.prototype.add=function(e){var t=this.delete(e.key);return t.copy(t.keyedMap.insert(e.key,e),t.sortedSet.insert(e,null))},e.prototype.delete=function(e){var t=this.get(e);return t?this.copy(this.keyedMap.remove(e),this.sortedSet.remove(t)):this},e.prototype.isEqual=function(t){if(!(t instanceof e))return!1;if(this.size!==t.size)return!1;for(var n=this.sortedSet.getIterator(),r=t.sortedSet.getIterator();n.hasNext();){var i=n.getNext().key,o=r.getNext().key;if(!i.isEqual(o))return!1}return!0},e.prototype.toString=function(){var e=[];return this.forEach((function(t){e.push(t.toString())})),0===e.length?"DocumentSet ()":"DocumentSet (\n "+e.join(" \n")+"\n)"},e.prototype.copy=function(t,n){var r=new e;return r.comparator=this.comparator,r.keyedMap=t,r.sortedSet=n,r},e}(),Wo=function(){function e(){this.Kr=new Ct(z.comparator)}return e.prototype.track=function(e){var t=e.doc.key,n=this.Kr.get(t);n?0!==e.type&&3===n.type?this.Kr=this.Kr.insert(t,e):3===e.type&&1!==n.type?this.Kr=this.Kr.insert(t,{type:n.type,doc:e.doc}):2===e.type&&2===n.type?this.Kr=this.Kr.insert(t,{type:2,doc:e.doc}):2===e.type&&0===n.type?this.Kr=this.Kr.insert(t,{type:0,doc:e.doc}):1===e.type&&0===n.type?this.Kr=this.Kr.remove(t):1===e.type&&2===n.type?this.Kr=this.Kr.insert(t,{type:1,doc:n.doc}):0===e.type&&1===n.type?this.Kr=this.Kr.insert(t,{type:2,doc:e.doc}):y():this.Kr=this.Kr.insert(t,e)},e.prototype.jr=function(){var e=[];return this.Kr.inorderTraversal((function(t,n){e.push(n)})),e},e}(),Ho=function(){function e(e,t,n,r,i,o,a,s){this.query=e,this.docs=t,this.oldDocs=n,this.docChanges=r,this.mutatedKeys=i,this.fromCache=o,this.syncStateChanged=a,this.excludesMetadataChanges=s}return e.fromInitialDocuments=function(t,n,r,i){var o=[];return n.forEach((function(e){o.push({type:0,doc:e})})),new e(t,n,zo.emptySet(n),o,r,i,!0,!1)},Object.defineProperty(e.prototype,"hasPendingWrites",{get:function(){return!this.mutatedKeys.isEmpty()},enumerable:!1,configurable:!0}),e.prototype.isEqual=function(e){if(!(this.fromCache===e.fromCache&&this.syncStateChanged===e.syncStateChanged&&this.mutatedKeys.isEqual(e.mutatedKeys)&&Fe(this.query,e.query)&&this.docs.isEqual(e.docs)&&this.oldDocs.isEqual(e.oldDocs)))return!1;var t=this.docChanges,n=e.docChanges;if(t.length!==n.length)return!1;for(var r=0;r=0&&(o.listeners.splice(s,1),i=0===o.listeners.length),i?[2,(n.queries.delete(r),n.onUnlisten(r))]:[2]}))}))}function Xo(e,t){for(var n=m(e),r=!1,i=0,o=t;i0)return!0;var t=this.Xr&&this.Xr.hasPendingWrites!==e.hasPendingWrites;return!(!e.syncStateChanged&&!t)&&!0===this.options.includeMetadataChanges},e.prototype.no=function(e){e=Ho.fromInitialDocuments(e.query,e.docs,e.mutatedKeys,e.fromCache),this.Yr=!0,this.Jr.next(e)},e}(),ta=function(){function e(e,t){this.payload=e,this.byteLength=t}return e.prototype.io=function(){return"metadata"in this.payload},e}(),na=function(){function e(e){this.R=e}return e.prototype.qn=function(e){return un(this.R,e)},e.prototype.Un=function(e){return e.metadata.exists?pn(this.R,e.document,!1):ae.newNoDocument(this.qn(e.metadata.name),this.Qn(e.metadata.readTime))},e.prototype.Qn=function(e){return rn(e)},e}(),ra=function(){function e(e,t,n){this.ro=e,this.localStore=t,this.R=n,this.queries=[],this.documents=[],this.progress=ia(e)}return e.prototype.oo=function(e){this.progress.bytesLoaded+=e.byteLength;var t=this.progress.documentsLoaded;return e.payload.namedQuery?this.queries.push(e.payload.namedQuery):e.payload.documentMetadata?(this.documents.push({metadata:e.payload.documentMetadata}),e.payload.documentMetadata.exists||++t):e.payload.document&&(this.documents[this.documents.length-1].document=e.payload.document,++t),t!==this.progress.documentsLoaded?(this.progress.documentsLoaded=t,Object.assign({},this.progress)):null},e.prototype.co=function(e){for(var t=new Map,n=new na(this.R),r=0,i=e;r0||c&&n.lo(f,c)<0)&&(s=!0)):!l&&f?(r.track({type:0,doc:f}),p=!0):l&&!f&&(r.track({type:1,doc:l}),p=!0,(u||c)&&(s=!0)),p&&(f?(a=a.add(f),o=d?o.add(e):o.delete(e)):(a=a.delete(e),o=o.delete(e)))})),Ne(this.query)||Pe(this.query))for(;a.size>this.query.limit;){var l=Ne(this.query)?a.last():a.first();a=a.delete(l.key),o=o.delete(l.key),r.track({type:1,doc:l})}return{fo:a,mo:r,Nn:s,mutatedKeys:o}},e.prototype.yo=function(e,t){return e.hasLocalMutations&&t.hasCommittedMutations&&!t.hasLocalMutations},e.prototype.applyChanges=function(e,t,n){var r=this,i=this.fo;this.fo=e.fo,this.mutatedKeys=e.mutatedKeys;var o=e.mo.jr();o.sort((function(e,t){return function(e,t){var n=function(e){switch(e){case 0:return 1;case 2:case 3:return 2;case 1:return 0;default:return y()}};return n(e)-n(t)}(e.type,t.type)||r.lo(e.doc,t.doc)})),this.po(n);var a=t?this.Eo():[],s=0===this.ho.size&&this.current?1:0,u=s!==this.ao;return this.ao=s,0!==o.length||u?{snapshot:new Ho(this.query,e.fo,i,o,e.mutatedKeys,0===s,u,!1),To:a}:{To:a}},e.prototype.zr=function(e){return this.current&&"Offline"===e?(this.current=!1,this.applyChanges({fo:this.fo,mo:new Wo,mutatedKeys:this.mutatedKeys,Nn:!1},!1)):{To:[]}},e.prototype.Io=function(e){return!this.uo.has(e)&&!!this.fo.has(e)&&!this.fo.get(e).hasLocalMutations},e.prototype.po=function(e){var t=this;e&&(e.addedDocuments.forEach((function(e){return t.uo=t.uo.add(e)})),e.modifiedDocuments.forEach((function(e){})),e.removedDocuments.forEach((function(e){return t.uo=t.uo.delete(e)})),this.current=e.current)},e.prototype.Eo=function(){var e=this;if(!this.current)return[];var t=this.ho;this.ho=Ut(),this.fo.forEach((function(t){e.Io(t.key)&&(e.ho=e.ho.add(t.key))}));var n=[];return t.forEach((function(t){e.ho.has(t)||n.push(new aa(t))})),this.ho.forEach((function(e){t.has(e)||n.push(new oa(e))})),n},e.prototype.Ao=function(e){this.uo=e.Bn,this.ho=Ut();var t=this._o(e.documents);return this.applyChanges(t,!0)},e.prototype.Ro=function(){return Ho.fromInitialDocuments(this.query,this.fo,this.mutatedKeys,0===this.ao)},e}(),ua=function(e,t,n){this.query=e,this.targetId=t,this.view=n},ca=function(e){this.key=e,this.bo=!1},la=function(){function e(e,t,n,r,i,o){this.localStore=e,this.remoteStore=t,this.eventManager=n,this.sharedClientState=r,this.currentUser=i,this.maxConcurrentLimboResolutions=o,this.vo={},this.Po=new ei((function(e){return Ue(e)}),Fe),this.Vo=new Map,this.So=new Set,this.Do=new Ct(z.comparator),this.Co=new Map,this.No=new ji,this.xo={},this.Fo=new Map,this.ko=Br.Yt(),this.onlineState="Unknown",this.$o=void 0}return Object.defineProperty(e.prototype,"isPrimaryClient",{get:function(){return!0===this.$o},enumerable:!1,configurable:!0}),e}();function fa(e,t){return Object(a.a)(this,void 0,void 0,(function(){var n,r,i,o,s,u;return Object(a.c)(this,(function(a){switch(a.label){case 0:return n=qa(e),(o=n.Po.get(t))?(r=o.targetId,n.sharedClientState.addLocalQueryTarget(r),i=o.view.Ro(),[3,4]):[3,1];case 1:return[4,ki(n.localStore,Le(t))];case 2:return s=a.sent(),u=n.sharedClientState.addLocalQueryTarget(s.targetId),r=s.targetId,[4,ha(n,t,r,"current"===u)];case 3:i=a.sent(),n.isPrimaryClient&&bo(n.remoteStore,s),a.label=4;case 4:return[2,i]}}))}))}function ha(e,t,n,r){return Object(a.a)(this,void 0,void 0,(function(){var i,o,s,u,c,l;return Object(a.c)(this,(function(f){switch(f.label){case 0:return e.Oo=function(t,n,r){return function(e,t,n,r){return Object(a.a)(this,void 0,void 0,(function(){var i,o,s;return Object(a.c)(this,(function(a){switch(a.label){case 0:return(i=t.view._o(n)).Nn?[4,Oi(e.localStore,t.query,!1).then((function(e){var n=e.documents;return t.view._o(n,i)}))]:[3,2];case 1:i=a.sent(),a.label=2;case 2:return o=r&&r.targetChanges.get(t.targetId),s=t.view.applyChanges(i,e.isPrimaryClient,o),[2,(Sa(e,t.targetId,s.To),s.snapshot)]}}))}))}(e,t,n,r)},[4,Oi(e.localStore,t,!0)];case 1:return i=f.sent(),o=new sa(t,i.Bn),s=o._o(i.documents),u=Kt.createSynthesizedTargetChangeForCurrentChange(n,r&&"Offline"!==e.onlineState),c=o.applyChanges(s,e.isPrimaryClient,u),Sa(e,n,c.To),l=new ua(t,n,o),[2,(e.Po.set(t,l),e.Vo.has(n)?e.Vo.get(n).push(t):e.Vo.set(n,[t]),c.snapshot)]}}))}))}function da(e,t){return Object(a.a)(this,void 0,void 0,(function(){var n,r,i;return Object(a.c)(this,(function(o){switch(o.label){case 0:return n=m(e),r=n.Po.get(t),(i=n.Vo.get(r.targetId)).length>1?[2,(n.Vo.set(r.targetId,i.filter((function(e){return!Fe(e,t)}))),void n.Po.delete(t))]:n.isPrimaryClient?(n.sharedClientState.removeLocalQueryTarget(r.targetId),n.sharedClientState.isActiveQueryTarget(r.targetId)?[3,2]:[4,Ci(n.localStore,r.targetId,!1).then((function(){n.sharedClientState.clearQueryState(r.targetId),wo(n.remoteStore,r.targetId),Ta(n,r.targetId)})).catch(Gr)]):[3,3];case 1:o.sent(),o.label=2;case 2:return[3,5];case 3:return Ta(n,r.targetId),[4,Ci(n.localStore,r.targetId,!0)];case 4:o.sent(),o.label=5;case 5:return[2]}}))}))}function pa(e,t,n){return Object(a.a)(this,void 0,void 0,(function(){var r,i,o,s;return Object(a.c)(this,(function(a){switch(a.label){case 0:r=Va(e),a.label=1;case 1:return a.trys.push([1,5,,6]),[4,function(e,t){var n,r=m(e),i=I.now(),o=t.reduce((function(e,t){return e.add(t.key)}),Ut());return r.persistence.runTransaction("Locally write mutations","readwrite",(function(e){return r.Mn.pn(e,o).next((function(o){n=o;for(var a=[],s=0,u=t;s0?r.bo=!0:e.modifiedDocuments.size>0?g(r.bo):e.removedDocuments.size>0&&(g(r.bo),r.bo=!1))})),[4,Oa(n,r,t)];case 3:return i.sent(),[3,6];case 4:return[4,Gr(i.sent())];case 5:return i.sent(),[3,6];case 6:return[2]}}))}))}function ya(e,t,n){var r=m(e);if(r.isPrimaryClient&&0===n||!r.isPrimaryClient&&1===n){var i=[];r.Po.forEach((function(e,n){var r=n.view.zr(t);r.snapshot&&i.push(r.snapshot)})),function(e,t){var n=m(e);n.onlineState=t;var r=!1;n.queries.forEach((function(e,n){for(var i=0,o=n.listeners;i0&&e.Do.size=0}))}(e.localStore,r)];case 2:return a.sent()?[4,t.close()]:[3,4];case 3:return[2,(a.sent(),void n._completeWith(function(e){return{taskState:"Success",documentsLoaded:e.totalDocuments,bytesLoaded:e.totalBytes,totalDocuments:e.totalDocuments,totalBytes:e.totalBytes}}(r)))];case 4:return n._updateProgress(ia(r)),i=new ra(r,e.localStore,t.R),[4,t.Lo()];case 5:o=a.sent(),a.label=6;case 6:return o?[4,i.oo(o)]:[3,10];case 7:return(s=a.sent())&&n._updateProgress(s),[4,t.Lo()];case 8:o=a.sent(),a.label=9;case 9:return[3,6];case 10:return[4,i.complete()];case 11:return u=a.sent(),[4,Oa(e,u.wn,void 0)];case 12:return a.sent(),[4,function(e,t){var n=m(e);return n.persistence.runTransaction("Save bundle","readwrite",(function(e){return n.Qe.saveBundleMetadata(e,t)}))}(e.localStore,r)];case 13:return a.sent(),n._completeWith(u.progress),[3,15];case 14:return p("SyncEngine","Loading bundle failed with "+(c=a.sent())),n._failWith(c),[3,15];case 15:return[2]}}))}))})(r,t,n).then((function(){r.sharedClientState.notifyBundleLoaded()}))}var Ka=function(){function e(){this.synchronizeTabs=!1}return e.prototype.initialize=function(e){return Object(a.a)(this,void 0,void 0,(function(){return Object(a.c)(this,(function(t){switch(t.label){case 0:return this.R=uo(e.databaseInfo.databaseId),this.sharedClientState=this.Bo(e),this.persistence=this.qo(e),[4,this.persistence.start()];case 1:return t.sent(),this.gcScheduler=this.Uo(e),this.localStore=this.Qo(e),[2]}}))}))},e.prototype.Uo=function(e){return null},e.prototype.Qo=function(e){return bi(this.persistence,new gi,e.initialUser,this.R)},e.prototype.qo=function(e){return new Vi(Ki.bs,this.R)},e.prototype.Bo=function(e){return new eo},e.prototype.terminate=function(){return Object(a.a)(this,void 0,void 0,(function(){return Object(a.c)(this,(function(e){switch(e.label){case 0:return this.gcScheduler&&this.gcScheduler.stop(),[4,this.sharedClientState.shutdown()];case 1:return e.sent(),[4,this.persistence.shutdown()];case 2:return e.sent(),[2]}}))}))},e}(),za=function(e){function t(t,n,r){var i=this;return(i=e.call(this)||this).Ko=t,i.cacheSizeBytes=n,i.forceOwnership=r,i.synchronizeTabs=!1,i}return Object(a.b)(t,e),t.prototype.initialize=function(t){return Object(a.a)(this,void 0,void 0,(function(){return Object(a.c)(this,(function(n){switch(n.label){case 0:return[4,e.prototype.initialize.call(this,t)];case 1:return n.sent(),[4,Pi(this.localStore)];case 2:return n.sent(),[4,this.Ko.initialize(this,t)];case 3:return n.sent(),[4,Va(this.Ko.syncEngine)];case 4:return n.sent(),[4,Ao(this.Ko.remoteStore)];case 5:return n.sent(),[2]}}))}))},t.prototype.Qo=function(e){return bi(this.persistence,new gi,e.initialUser,this.R)},t.prototype.Uo=function(e){var t=this.persistence.referenceDelegate.garbageCollector;return new Yr(t,e.asyncQueue)},t.prototype.qo=function(e){var t=di(e.databaseInfo.databaseId,e.databaseInfo.persistenceKey),n=void 0!==this.cacheSizeBytes?Dr.withCacheSize(this.cacheSizeBytes):Dr.DEFAULT;return new li(this.synchronizeTabs,t,e.clientId,n,e.asyncQueue,ao(),so(),this.R,this.sharedClientState,!!this.forceOwnership)},t.prototype.Bo=function(e){return new eo},t}(Ka),Wa=function(e){function t(t,n){var r=this;return(r=e.call(this,t,n,!1)||this).Ko=t,r.cacheSizeBytes=n,r.synchronizeTabs=!0,r}return Object(a.b)(t,e),t.prototype.initialize=function(t){return Object(a.a)(this,void 0,void 0,(function(){var n,r=this;return Object(a.c)(this,(function(i){switch(i.label){case 0:return[4,e.prototype.initialize.call(this,t)];case 1:return i.sent(),n=this.Ko.syncEngine,this.sharedClientState instanceof Zi?(this.sharedClientState.syncEngine={ui:Ra.bind(null,n),ai:Fa.bind(null,n),hi:Ua.bind(null,n),fn:Ma.bind(null,n),ci:Aa.bind(null,n)},[4,this.sharedClientState.start()]):[3,3];case 2:i.sent(),i.label=3;case 3:return[4,this.persistence.He((function(e){return Object(a.a)(r,void 0,void 0,(function(){return Object(a.c)(this,(function(t){switch(t.label){case 0:return[4,Da(this.Ko.syncEngine,e)];case 1:return t.sent(),this.gcScheduler&&(e&&!this.gcScheduler.started?this.gcScheduler.start(this.localStore):e||this.gcScheduler.stop()),[2]}}))}))}))];case 4:return i.sent(),[2]}}))}))},t.prototype.Bo=function(e){var t=ao();if(!Zi.yt(t))throw new c(u.UNIMPLEMENTED,"IndexedDB persistence is only available on platforms that support LocalStorage.");var n=di(e.databaseInfo.databaseId,e.databaseInfo.persistenceKey);return new Zi(t,e.asyncQueue,n,e.clientId,e.initialUser)},t}(za),Ha=function(){function e(){}return e.prototype.initialize=function(e,t){return Object(a.a)(this,void 0,void 0,(function(){var n=this;return Object(a.c)(this,(function(r){switch(r.label){case 0:return this.localStore?[3,2]:(this.localStore=e.localStore,this.sharedClientState=e.sharedClientState,this.datastore=this.createDatastore(t),this.remoteStore=this.createRemoteStore(t),this.eventManager=this.createEventManager(t),this.syncEngine=this.createSyncEngine(t,!e.synchronizeTabs),this.sharedClientState.onlineStateHandler=function(e){return ya(n.syncEngine,e,1)},this.remoteStore.remoteSyncer.handleCredentialChange=xa.bind(null,this.syncEngine),[4,Uo(this.remoteStore,this.syncEngine.isPrimaryClient)]);case 1:r.sent(),r.label=2;case 2:return[2]}}))}))},e.prototype.createEventManager=function(e){return new Qo},e.prototype.createDatastore=function(e){var t,n=uo(e.databaseInfo.databaseId),r=(t=e.databaseInfo,new oo(t));return function(e,t,n){return new po(e,t,n)}(e.credentials,r,n)},e.prototype.createRemoteStore=function(e){var t,n,r,i,o,a=this;return t=this.localStore,n=this.datastore,r=e.asyncQueue,i=function(e){return ya(a.syncEngine,e,0)},o=no.yt()?new no:new to,new yo(t,n,r,i,o)},e.prototype.createSyncEngine=function(e,t){return function(e,t,n,r,i,o,a){var s=new la(e,t,n,r,i,o);return a&&(s.$o=!0),s}(this.localStore,this.remoteStore,this.eventManager,this.sharedClientState,e.initialUser,e.maxConcurrentLimboResolutions,t)},e.prototype.terminate=function(){return function(e){return Object(a.a)(this,void 0,void 0,(function(){var t;return Object(a.c)(this,(function(n){switch(n.label){case 0:return t=m(e),h("RemoteStore","RemoteStore shutting down."),t.Or.add(5),[4,mo(t)];case 1:return n.sent(),t.Lr.shutdown(),t.Br.set("Unknown"),[2]}}))}))}(this.remoteStore)},e}();function Ga(e,t){void 0===t&&(t=10240);var n=0;return{read:function(){return Object(a.a)(this,void 0,void 0,(function(){var r;return Object(a.c)(this,(function(i){return n0)throw new c(u.INVALID_ARGUMENT,"Firestore transactions require all reads to be executed before all writes.");return[4,function(e,t){return Object(a.a)(this,void 0,void 0,(function(){var n,r,i,o,s,u;return Object(a.c)(this,(function(a){switch(a.label){case 0:return n=m(e),r=fn(n.R)+"/documents",i={documents:t.map((function(e){return sn(n.R,e)}))},[4,n.$i("BatchGetDocuments",r,i)];case 1:return o=a.sent(),s=new Map,o.forEach((function(e){var t=function(e,t){return"found"in t?function(e,t){g(!!t.found),t.found.name,t.found.updateTime;var n=un(e,t.found.name),r=rn(t.found.updateTime),i=new ie({mapValue:{fields:t.found.fields}});return ae.newFoundDocument(n,r,i)}(e,t):"missing"in t?function(e,t){g(!!t.missing),g(!!t.readTime);var n=un(e,t.missing),r=rn(t.readTime);return ae.newNoDocument(n,r)}(e,t):y()}(n.R,e);s.set(t.key.toString(),t)})),u=[],[2,(t.forEach((function(e){var t=s.get(e.toString());g(!!t),u.push(t)})),u)]}}))}))}(this.datastore,e)];case 1:return[2,((t=r.sent()).forEach((function(e){return n.recordVersion(e)})),t)]}}))}))},e.prototype.set=function(e,t){this.write(t.toMutation(e,this.precondition(e))),this.writtenDocs.add(e.toString())},e.prototype.update=function(e,t){try{this.write(t.toMutation(e,this.preconditionForUpdate(e)))}catch(e){this.lastWriteError=e}this.writtenDocs.add(e.toString())},e.prototype.delete=function(e){this.write(new Et(e,this.precondition(e))),this.writtenDocs.add(e.toString())},e.prototype.commit=function(){return Object(a.a)(this,void 0,void 0,(function(){var e,t=this;return Object(a.c)(this,(function(n){switch(n.label){case 0:if(this.ensureCommitNotCalled(),this.lastWriteError)throw this.lastWriteError;return e=this.readVersions,this.mutations.forEach((function(t){e.delete(t.key.toString())})),e.forEach((function(e,n){var r=z.fromPath(n);t.mutations.push(new Tt(r,t.precondition(r)))})),[4,function(e,t){return Object(a.a)(this,void 0,void 0,(function(){var n,r,i;return Object(a.c)(this,(function(o){switch(o.label){case 0:return n=m(e),r=fn(n.R)+"/documents",i={writes:t.map((function(e){return vn(n.R,e)}))},[4,n.Ni("Commit",r,i)];case 1:return o.sent(),[2]}}))}))}(this.datastore,this.mutations)];case 1:return n.sent(),this.committed=!0,[2]}}))}))},e.prototype.recordVersion=function(e){var t;if(e.isFoundDocument())t=e.version;else{if(!e.isNoDocument())throw y();t=S.min()}var n=this.readVersions.get(e.key.toString());if(n){if(!t.isEqual(n))throw new c(u.ABORTED,"Document version changed between two reads.")}else this.readVersions.set(e.key.toString(),t)},e.prototype.precondition=function(e){var t=this.readVersions.get(e.toString());return!this.writtenDocs.has(e.toString())&&t?st.updateTime(t):st.none()},e.prototype.preconditionForUpdate=function(e){var t=this.readVersions.get(e.toString());if(!this.writtenDocs.has(e.toString())&&t){if(t.isEqual(S.min()))throw new c(u.INVALID_ARGUMENT,"Can't update a document that doesn't exist.");return st.updateTime(t)}return st.exists(!0)},e.prototype.write=function(e){this.ensureCommitNotCalled(),this.mutations.push(e)},e.prototype.ensureCommitNotCalled=function(){},e}(),Xa=function(){function e(e,t,n,r){this.asyncQueue=e,this.datastore=t,this.updateFunction=n,this.deferred=r,this.ec=5,this.Zi=new co(this.asyncQueue,"transaction_retry")}return e.prototype.run=function(){this.nc()},e.prototype.nc=function(){var e=this;this.Zi.ji((function(){return Object(a.a)(e,void 0,void 0,(function(){var e,t,n=this;return Object(a.c)(this,(function(r){return e=new Ya(this.datastore),(t=this.sc(e))&&t.then((function(t){n.asyncQueue.enqueueAndForget((function(){return e.commit().then((function(){n.deferred.resolve(t)})).catch((function(e){n.ic(e)}))}))})).catch((function(e){n.ic(e)})),[2]}))}))}))},e.prototype.sc=function(e){try{var t=this.updateFunction(e);return!V(t)&&t.catch&&t.then?t:(this.deferred.reject(Error("Transaction callback must return a Promise")),null)}catch(e){return this.deferred.reject(e),null}},e.prototype.ic=function(e){var t=this;this.ec>0&&this.rc(e)?(this.ec-=1,this.asyncQueue.enqueueAndForget((function(){return t.nc(),Promise.resolve()}))):this.deferred.reject(e)},e.prototype.rc=function(e){if("FirebaseError"===e.name){var t=e.code;return"aborted"===t||"failed-precondition"===t||!St(t)}return!1},e}(),Ja=function(){function e(e,t,n){var r=this;this.credentials=e,this.asyncQueue=t,this.databaseInfo=n,this.user=zi.UNAUTHENTICATED,this.clientId=w.u(),this.credentialListener=function(){return Promise.resolve()},this.credentials.setChangeListener(t,(function(e){return Object(a.a)(r,void 0,void 0,(function(){return Object(a.c)(this,(function(t){switch(t.label){case 0:return h("FirestoreClient","Received user=",e.uid),[4,this.credentialListener(e)];case 1:return t.sent(),this.user=e,[2]}}))}))}))}return e.prototype.getConfiguration=function(){return Object(a.a)(this,void 0,void 0,(function(){return Object(a.c)(this,(function(e){return[2,{asyncQueue:this.asyncQueue,databaseInfo:this.databaseInfo,clientId:this.clientId,credentials:this.credentials,initialUser:this.user,maxConcurrentLimboResolutions:100}]}))}))},e.prototype.setCredentialChangeListener=function(e){this.credentialListener=e},e.prototype.verifyNotTerminated=function(){if(this.asyncQueue.isShuttingDown)throw new c(u.FAILED_PRECONDITION,"The client has already been terminated.")},e.prototype.terminate=function(){var e=this;this.asyncQueue.enterRestrictedMode();var t=new Zn;return this.asyncQueue.enqueueAndForgetEvenWhileRestricted((function(){return Object(a.a)(e,void 0,void 0,(function(){var e,n;return Object(a.c)(this,(function(r){switch(r.label){case 0:return r.trys.push([0,5,,6]),this.onlineComponents?[4,this.onlineComponents.terminate()]:[3,2];case 1:r.sent(),r.label=2;case 2:return this.offlineComponents?[4,this.offlineComponents.terminate()]:[3,4];case 3:r.sent(),r.label=4;case 4:return this.credentials.removeChangeListener(),t.resolve(),[3,6];case 5:return e=r.sent(),n=Ko(e,"Failed to shutdown persistence"),t.reject(n),[3,6];case 6:return[2]}}))}))})),t.promise},e}();function Za(e,t){return Object(a.a)(this,void 0,void 0,(function(){var n,r,i=this;return Object(a.c)(this,(function(o){switch(o.label){case 0:return e.asyncQueue.verifyOperationInProgress(),h("FirestoreClient","Initializing OfflineComponentProvider"),[4,e.getConfiguration()];case 1:return n=o.sent(),[4,t.initialize(n)];case 2:return o.sent(),r=n.initialUser,e.setCredentialChangeListener((function(e){return Object(a.a)(i,void 0,void 0,(function(){return Object(a.c)(this,(function(n){switch(n.label){case 0:return r.isEqual(e)?[3,2]:[4,wi(t.localStore,e)];case 1:n.sent(),r=e,n.label=2;case 2:return[2]}}))}))})),t.persistence.setDatabaseDeletedListener((function(){return e.terminate()})),e.offlineComponents=t,[2]}}))}))}function es(e,t){return Object(a.a)(this,void 0,void 0,(function(){var n,r;return Object(a.c)(this,(function(i){switch(i.label){case 0:return e.asyncQueue.verifyOperationInProgress(),[4,ts(e)];case 1:return n=i.sent(),h("FirestoreClient","Initializing OnlineComponentProvider"),[4,e.getConfiguration()];case 2:return r=i.sent(),[4,t.initialize(n,r)];case 3:return i.sent(),e.setCredentialChangeListener((function(e){return function(e,t){return Object(a.a)(this,void 0,void 0,(function(){var n,r;return Object(a.c)(this,(function(i){switch(i.label){case 0:return(n=m(e)).asyncQueue.verifyOperationInProgress(),h("RemoteStore","RemoteStore received new credentials"),r=So(n),n.Or.add(3),[4,mo(n)];case 1:return i.sent(),r&&n.Br.set("Unknown"),[4,n.remoteSyncer.handleCredentialChange(t)];case 2:return i.sent(),n.Or.delete(3),[4,go(n)];case 3:return i.sent(),[2]}}))}))}(t.remoteStore,e)})),e.onlineComponents=t,[2]}}))}))}function ts(e){return Object(a.a)(this,void 0,void 0,(function(){return Object(a.c)(this,(function(t){switch(t.label){case 0:return e.offlineComponents?[3,2]:(h("FirestoreClient","Using default OfflineComponentProvider"),[4,Za(e,new Ka)]);case 1:t.sent(),t.label=2;case 2:return[2,e.offlineComponents]}}))}))}function ns(e){return Object(a.a)(this,void 0,void 0,(function(){return Object(a.c)(this,(function(t){switch(t.label){case 0:return e.onlineComponents?[3,2]:(h("FirestoreClient","Using default OnlineComponentProvider"),[4,es(e,new Ha)]);case 1:t.sent(),t.label=2;case 2:return[2,e.onlineComponents]}}))}))}function rs(e){return ts(e).then((function(e){return e.persistence}))}function is(e){return ts(e).then((function(e){return e.localStore}))}function os(e){return ns(e).then((function(e){return e.remoteStore}))}function as(e){return ns(e).then((function(e){return e.syncEngine}))}function ss(e){return Object(a.a)(this,void 0,void 0,(function(){var t,n;return Object(a.c)(this,(function(r){switch(r.label){case 0:return[4,ns(e)];case 1:return t=r.sent(),[2,((n=t.eventManager).onListen=fa.bind(null,t.syncEngine),n.onUnlisten=da.bind(null,t.syncEngine),n)]}}))}))}function us(e,t,n){var r=this;void 0===n&&(n={});var i=new Zn;return e.asyncQueue.enqueueAndForget((function(){return Object(a.a)(r,void 0,void 0,(function(){var r;return Object(a.c)(this,(function(o){switch(o.label){case 0:return r=function(e,t,n,r,i){var o=new Qa({next:function(o){t.enqueueAndForget((function(){return Yo(e,a)}));var s=o.docs.has(n);!s&&o.fromCache?i.reject(new c(u.UNAVAILABLE,"Failed to get document because the client is offline.")):s&&o.fromCache&&r&&"server"===r.source?i.reject(new c(u.UNAVAILABLE,'Failed to get document from server. (However, this document does exist in the local cache. Run again without setting source to "server" to retrieve the cached document.)')):i.resolve(o)},error:function(e){return i.reject(e)}}),a=new ea(xe(n.path),o,{includeMetadataChanges:!0,so:!0});return $o(e,a)},[4,ss(e)];case 1:return[2,r.apply(void 0,[o.sent(),e.asyncQueue,t,n,i])]}}))}))})),i.promise}function cs(e,t,n){var r=this;void 0===n&&(n={});var i=new Zn;return e.asyncQueue.enqueueAndForget((function(){return Object(a.a)(r,void 0,void 0,(function(){var r;return Object(a.c)(this,(function(o){switch(o.label){case 0:return r=function(e,t,n,r,i){var o=new Qa({next:function(n){t.enqueueAndForget((function(){return Yo(e,a)})),n.fromCache&&"server"===r.source?i.reject(new c(u.UNAVAILABLE,'Failed to get documents from server. (However, these documents may exist in the local cache. Run again without setting source to "server" to retrieve the cached documents.)')):i.resolve(n)},error:function(e){return i.reject(e)}}),a=new ea(n,o,{includeMetadataChanges:!0,so:!0});return $o(e,a)},[4,ss(e)];case 1:return[2,r.apply(void 0,[o.sent(),e.asyncQueue,t,n,i])]}}))}))})),i.promise}var ls=function(e,t,n,r,i,o,a,s){this.databaseId=e,this.appId=t,this.persistenceKey=n,this.host=r,this.ssl=i,this.forceLongPolling=o,this.autoDetectLongPolling=a,this.useFetchStreams=s},fs=function(){function e(e,t){this.projectId=e,this.database=t||"(default)"}return Object.defineProperty(e.prototype,"isDefaultDatabase",{get:function(){return"(default)"===this.database},enumerable:!1,configurable:!0}),e.prototype.isEqual=function(t){return t instanceof e&&t.projectId===this.projectId&&t.database===this.database},e}(),hs=new Map,ds=function(e,t){this.user=t,this.type="OAuth",this.authHeaders={},this.authHeaders.Authorization="Bearer "+e},ps=function(){function e(){this.changeListener=null}return e.prototype.getToken=function(){return Promise.resolve(null)},e.prototype.invalidateToken=function(){},e.prototype.setChangeListener=function(e,t){this.changeListener=t,e.enqueueRetryable((function(){return t(zi.UNAUTHENTICATED)}))},e.prototype.removeChangeListener=function(){this.changeListener=null},e}(),vs=function(){function e(e){this.token=e,this.changeListener=null}return e.prototype.getToken=function(){return Promise.resolve(this.token)},e.prototype.invalidateToken=function(){},e.prototype.setChangeListener=function(e,t){var n=this;this.changeListener=t,e.enqueueRetryable((function(){return t(n.token.user)}))},e.prototype.removeChangeListener=function(){this.changeListener=null},e}(),ys=function(){function e(e){var t=this;this.currentUser=zi.UNAUTHENTICATED,this.oc=new Zn,this.cc=0,this.forceRefresh=!1,this.auth=null,this.asyncQueue=null,this.uc=function(){t.cc++,t.currentUser=t.ac(),t.oc.resolve(),t.changeListener&&t.asyncQueue.enqueueRetryable((function(){return t.changeListener(t.currentUser)}))};var n=function(e){h("FirebaseCredentialsProvider","Auth detected"),t.auth=e,t.auth.addAuthTokenListener(t.uc)};e.onInit((function(e){return n(e)})),setTimeout((function(){if(!t.auth){var r=e.getImmediate({optional:!0});r?n(r):(h("FirebaseCredentialsProvider","Auth not yet detected"),t.oc.resolve())}}),0)}return e.prototype.getToken=function(){var e=this,t=this.cc,n=this.forceRefresh;return this.forceRefresh=!1,this.auth?this.auth.getToken(n).then((function(n){return e.cc!==t?(h("FirebaseCredentialsProvider","getToken aborted due to token change."),e.getToken()):n?(g("string"==typeof n.accessToken),new ds(n.accessToken,e.currentUser)):null})):Promise.resolve(null)},e.prototype.invalidateToken=function(){this.forceRefresh=!0},e.prototype.setChangeListener=function(e,t){var n=this;this.asyncQueue=e,this.asyncQueue.enqueueRetryable((function(){return Object(a.a)(n,void 0,void 0,(function(){return Object(a.c)(this,(function(e){switch(e.label){case 0:return[4,this.oc.promise];case 1:return e.sent(),[4,t(this.currentUser)];case 2:return e.sent(),this.changeListener=t,[2]}}))}))}))},e.prototype.removeChangeListener=function(){this.auth&&this.auth.removeAuthTokenListener(this.uc),this.changeListener=function(){return Promise.resolve()}},e.prototype.ac=function(){var e=this.auth&&this.auth.getUid();return g(null===e||"string"==typeof e),new zi(e)},e}(),gs=function(){function e(e,t,n){this.hc=e,this.lc=t,this.fc=n,this.type="FirstParty",this.user=zi.FIRST_PARTY}return Object.defineProperty(e.prototype,"authHeaders",{get:function(){var e={"X-Goog-AuthUser":this.lc},t=this.hc.auth.getAuthHeaderValueForFirstParty([]);return t&&(e.Authorization=t),this.fc&&(e["X-Goog-Iam-Authorization-Token"]=this.fc),e},enumerable:!1,configurable:!0}),e}(),ms=function(){function e(e,t,n){this.hc=e,this.lc=t,this.fc=n}return e.prototype.getToken=function(){return Promise.resolve(new gs(this.hc,this.lc,this.fc))},e.prototype.setChangeListener=function(e,t){e.enqueueRetryable((function(){return t(zi.FIRST_PARTY)}))},e.prototype.removeChangeListener=function(){},e.prototype.invalidateToken=function(){},e}();function bs(e,t,n){if(!n)throw new c(u.INVALID_ARGUMENT,"Function "+e+"() cannot be called with an empty "+t+".")}function ws(e,t){if(void 0===t)return{merge:!1};if(void 0!==t.mergeFields&&void 0!==t.merge)throw new c(u.INVALID_ARGUMENT,"Invalid options passed to function "+e+'(): You cannot specify both "merge" and "mergeFields".');return t}function _s(e,t,n,r){if(!0===t&&!0===r)throw new c(u.INVALID_ARGUMENT,e+" and "+n+" cannot be used together.")}function Es(e){if(!z.isDocumentKey(e))throw new c(u.INVALID_ARGUMENT,"Invalid document reference. Document references must have an even number of segments, but "+e+" has "+e.length+".")}function Ts(e){if(z.isDocumentKey(e))throw new c(u.INVALID_ARGUMENT,"Invalid collection reference. Collection references must have an odd number of segments, but "+e+" has "+e.length+".")}function Is(e){if(void 0===e)return"undefined";if(null===e)return"null";if("string"==typeof e)return e.length>20&&(e=e.substring(0,20)+"..."),JSON.stringify(e);if("number"==typeof e||"boolean"==typeof e)return""+e;if("object"==typeof e){if(e instanceof Array)return"an array";var t=function(e){if(e.constructor){var t=/function\s+([^\s(]+)\s*\(/.exec(e.constructor.toString());if(t&&t.length>1)return t[1]}return null}(e);return t?"a custom "+t+" object":"an object"}return"function"==typeof e?"a function":y()}function Ss(e,t){if("_delegate"in e&&(e=e._delegate),!(e instanceof t)){if(t.name===e.constructor.name)throw new c(u.INVALID_ARGUMENT,"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");var n=Is(e);throw new c(u.INVALID_ARGUMENT,"Expected type '"+t.name+"', but it was: "+n)}return e}function ks(e,t){if(t<=0)throw new c(u.INVALID_ARGUMENT,"Function "+e+"() requires a positive number, but it was: "+t+".")}var Cs=function(){function e(e){var t;if(void 0===e.host){if(void 0!==e.ssl)throw new c(u.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host="firestore.googleapis.com",this.ssl=!0}else this.host=e.host,this.ssl=null===(t=e.ssl)||void 0===t||t;if(this.credentials=e.credentials,this.ignoreUndefinedProperties=!!e.ignoreUndefinedProperties,void 0===e.cacheSizeBytes)this.cacheSizeBytes=41943040;else{if(-1!==e.cacheSizeBytes&&e.cacheSizeBytes<1048576)throw new c(u.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");this.cacheSizeBytes=e.cacheSizeBytes}this.experimentalForceLongPolling=!!e.experimentalForceLongPolling,this.experimentalAutoDetectLongPolling=!!e.experimentalAutoDetectLongPolling,this.useFetchStreams=!!e.useFetchStreams,_s("experimentalForceLongPolling",e.experimentalForceLongPolling,"experimentalAutoDetectLongPolling",e.experimentalAutoDetectLongPolling)}return e.prototype.isEqual=function(e){return this.host===e.host&&this.ssl===e.ssl&&this.credentials===e.credentials&&this.cacheSizeBytes===e.cacheSizeBytes&&this.experimentalForceLongPolling===e.experimentalForceLongPolling&&this.experimentalAutoDetectLongPolling===e.experimentalAutoDetectLongPolling&&this.ignoreUndefinedProperties===e.ignoreUndefinedProperties&&this.useFetchStreams===e.useFetchStreams},e}(),Os=function(){function e(e,t){this.type="firestore-lite",this._persistenceKey="(lite)",this._settings=new Cs({}),this._settingsFrozen=!1,e instanceof fs?(this._databaseId=e,this._credentials=new ps):(this._app=e,this._databaseId=function(e){if(!Object.prototype.hasOwnProperty.apply(e.options,["projectId"]))throw new c(u.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');return new fs(e.options.projectId)}(e),this._credentials=new ys(t))}return Object.defineProperty(e.prototype,"app",{get:function(){if(!this._app)throw new c(u.FAILED_PRECONDITION,"Firestore was not initialized using the Firebase SDK. 'app' is not available");return this._app},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"_initialized",{get:function(){return this._settingsFrozen},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"_terminated",{get:function(){return void 0!==this._terminateTask},enumerable:!1,configurable:!0}),e.prototype._setSettings=function(e){if(this._settingsFrozen)throw new c(u.FAILED_PRECONDITION,"Firestore has already been started and its settings can no longer be changed. You can only modify settings before calling any other methods on a Firestore object.");this._settings=new Cs(e),void 0!==e.credentials&&(this._credentials=function(e){if(!e)return new ps;switch(e.type){case"gapi":var t=e.client;return g(!("object"!=typeof t||null===t||!t.auth||!t.auth.getAuthHeaderValueForFirstParty)),new ms(t,e.sessionIndex||"0",e.iamToken||null);case"provider":return e.client;default:throw new c(u.INVALID_ARGUMENT,"makeCredentialsProvider failed due to invalid credential type")}}(e.credentials))},e.prototype._getSettings=function(){return this._settings},e.prototype._freezeSettings=function(){return this._settingsFrozen=!0,this._settings},e.prototype._delete=function(){return this._terminateTask||(this._terminateTask=this._terminate()),this._terminateTask},e.prototype.toJSON=function(){return{app:this._app,databaseId:this._databaseId,settings:this._settings}},e.prototype._terminate=function(){return this,(e=hs.get(this))&&(h("ComponentProvider","Removing Datastore"),hs.delete(this),e.terminate()),Promise.resolve();var e},e}(),xs=function(){function e(e,t,n){this.converter=t,this._key=n,this.type="document",this.firestore=e}return Object.defineProperty(e.prototype,"_path",{get:function(){return this._key.path},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"id",{get:function(){return this._key.path.lastSegment()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"path",{get:function(){return this._key.path.canonicalString()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){return new Ps(this.firestore,this.converter,this._key.path.popLast())},enumerable:!1,configurable:!0}),e.prototype.withConverter=function(t){return new e(this.firestore,t,this._key)},e}(),Ns=function(){function e(e,t,n){this.converter=t,this._query=n,this.type="query",this.firestore=e}return e.prototype.withConverter=function(t){return new e(this.firestore,t,this._query)},e}(),Ps=function(e){function t(t,n,r){var i=this;return(i=e.call(this,t,n,xe(r))||this)._path=r,i.type="collection",i}return Object(a.b)(t,e),Object.defineProperty(t.prototype,"id",{get:function(){return this._query.path.lastSegment()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"path",{get:function(){return this._query.path.canonicalString()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){var e=this._path.popLast();return e.isEmpty()?null:new xs(this.firestore,null,new z(e))},enumerable:!1,configurable:!0}),t.prototype.withConverter=function(e){return new t(this.firestore,e,this._path)},t}(Ns);function As(e,t){for(var n,i=[],o=2;o0&&this.Zi.ji((function(){return t.Rc()})),n.label=5;case 5:return[2]}}))}))},e.prototype.Ac=function(e){var t=this,n=this.dc.then((function(){return t.gc=!0,e().catch((function(e){throw t.yc=e,t.gc=!1,d("INTERNAL UNHANDLED ERROR: ",function(e){var t=e.message||"";return e.stack&&(t=e.stack.includes(e.message)?e.stack:e.message+"\n"+e.stack),t}(e)),e})).then((function(e){return t.gc=!1,e}))}));return this.dc=n,n},e.prototype.enqueueAfterDelay=function(e,t,n){var r=this;this.Ic(),this.Ec.indexOf(e)>-1&&(t=0);var i=Bo.createAndSchedule(this,e,t,n,(function(e){return r.bc(e)}));return this.mc.push(i),i},e.prototype.Ic=function(){this.yc&&y()},e.prototype.verifyOperationInProgress=function(){},e.prototype.vc=function(){return Object(a.a)(this,void 0,void 0,(function(){var e;return Object(a.c)(this,(function(t){switch(t.label){case 0:return[4,e=this.dc];case 1:t.sent(),t.label=2;case 2:if(e!==this.dc)return[3,0];t.label=3;case 3:return[2]}}))}))},e.prototype.Pc=function(e){for(var t=0,n=this.mc;t90)throw new c(u.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+e);if(!isFinite(t)||t<-180||t>180)throw new c(u.INVALID_ARGUMENT,"Longitude must be a number between -180 and 180, but was: "+t);this._lat=e,this._long=t}return Object.defineProperty(e.prototype,"latitude",{get:function(){return this._lat},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"longitude",{get:function(){return this._long},enumerable:!1,configurable:!0}),e.prototype.isEqual=function(e){return this._lat===e._lat&&this._long===e._long},e.prototype.toJSON=function(){return{latitude:this._lat,longitude:this._long}},e.prototype._compareTo=function(e){return _(this._lat,e._lat)||_(this._long,e._long)},e}(),$s=/^__.*__$/,Ys=function(){function e(e,t,n){this.data=e,this.fieldMask=t,this.fieldTransforms=n}return e.prototype.toMutation=function(e,t){return null!==this.fieldMask?new yt(e,this.data,this.fieldMask,t,this.fieldTransforms):new vt(e,this.data,t,this.fieldTransforms)},e}(),Xs=function(){function e(e,t,n){this.data=e,this.fieldMask=t,this.fieldTransforms=n}return e.prototype.toMutation=function(e,t){return new yt(e,this.data,this.fieldMask,t,this.fieldTransforms)},e}();function Js(e){switch(e){case 0:case 2:case 1:return!0;case 3:case 4:return!1;default:throw y()}}var Zs=function(){function e(e,t,n,r,i,o){this.settings=e,this.databaseId=t,this.R=n,this.ignoreUndefinedProperties=r,void 0===i&&this.Dc(),this.fieldTransforms=i||[],this.fieldMask=o||[]}return Object.defineProperty(e.prototype,"path",{get:function(){return this.settings.path},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Cc",{get:function(){return this.settings.Cc},enumerable:!1,configurable:!0}),e.prototype.Nc=function(t){return new e(Object.assign(Object.assign({},this.settings),t),this.databaseId,this.R,this.ignoreUndefinedProperties,this.fieldTransforms,this.fieldMask)},e.prototype.xc=function(e){var t,n=null===(t=this.path)||void 0===t?void 0:t.child(e),r=this.Nc({path:n,Fc:!1});return r.kc(e),r},e.prototype.$c=function(e){var t,n=null===(t=this.path)||void 0===t?void 0:t.child(e),r=this.Nc({path:n,Fc:!1});return r.Dc(),r},e.prototype.Oc=function(e){return this.Nc({path:void 0,Fc:!0})},e.prototype.Mc=function(e){return bu(e,this.settings.methodName,this.settings.Lc||!1,this.path,this.settings.Bc)},e.prototype.contains=function(e){return void 0!==this.fieldMask.find((function(t){return e.isPrefixOf(t)}))||void 0!==this.fieldTransforms.find((function(t){return e.isPrefixOf(t.field)}))},e.prototype.Dc=function(){if(this.path)for(var e=0;e=0;--v)if(!wu(d,l[v])){var y=l[v],g=f[v];g=Object(r.getModularInstance)(g);var m=s.$c(y);if(g instanceof ru)d.push(y);else{var b=hu(g,m);null!=b&&(d.push(y),p.set(y,b))}}var w=new R(d);return new Xs(p,w,s.fieldTransforms)}function fu(e,t,n,r){return void 0===r&&(r=!1),hu(n,e.qc(r?4:3,t))}function hu(e,t){if(pu(e=Object(r.getModularInstance)(e)))return vu("Unsupported field value:",t,e),du(e,t);if(e instanceof Gs)return function(e,t){if(!Js(t.Cc))throw t.Mc(e._methodName+"() can only be used with update() and set()");if(!t.path)throw t.Mc(e._methodName+"() is not currently supported inside arrays");var n=e._toFieldTransform(t);n&&t.fieldTransforms.push(n)}(e,t),null;if(void 0===e&&t.ignoreUndefinedProperties)return null;if(t.path&&t.fieldMask.push(t.path),e instanceof Array){if(t.settings.Fc&&4!==t.Cc)throw t.Mc("Nested arrays are not supported");return function(e,t){for(var n=[],r=0,i=0,o=e;i0&&t.fieldMask.push(t.path):C(e,(function(e,r){var i=hu(r,t.xc(e));null!=i&&(n[e]=i)})),{mapValue:{fields:n}}}function pu(e){return!("object"!=typeof e||null===e||e instanceof Array||e instanceof Date||e instanceof I||e instanceof Qs||e instanceof Hs||e instanceof xs||e instanceof Gs)}function vu(e,t,n){if(!pu(n)||!function(e){return"object"==typeof e&&null!==e&&(Object.getPrototypeOf(e)===Object.prototype||null===Object.getPrototypeOf(e))}(n)){var r=Is(n);throw"an object"===r?t.Mc(e+" a custom object"):t.Mc(e+" "+r)}}function yu(e,t,n){if((t=Object(r.getModularInstance)(t))instanceof Ws)return t._internalPath;if("string"==typeof t)return mu(e,t);throw bu("Field path arguments must be of type string or FieldPath.",e,!1,void 0,n)}var gu=new RegExp("[~\\*/\\[\\]]");function mu(e,t,n){if(t.search(gu)>=0)throw bu("Invalid field path ("+t+"). Paths must not contain '~', '*', '/', '[', or ']'",e,!1,void 0,n);try{return(new(Ws.bind.apply(Ws,Object(a.d)([void 0],t.split(".")))))._internalPath}catch(r){throw bu("Invalid field path ("+t+"). Paths must not be empty, begin with '.', end with '.', or contain '..'",e,!1,void 0,n)}}function bu(e,t,n,r,i){var o=r&&!r.isEmpty(),a=void 0!==i,s="Function "+t+"() called with invalid data";n&&(s+=" (via `toFirestore()`)");var l="";return(o||a)&&(l+=" (found",o&&(l+=" in field "+r),a&&(l+=" in document "+i),l+=")"),new c(u.INVALID_ARGUMENT,(s+=". ")+e+l)}function wu(e,t){return e.some((function(e){return e.isEqual(t)}))}var _u=function(){function e(e,t,n,r,i){this._firestore=e,this._userDataWriter=t,this._key=n,this._document=r,this._converter=i}return Object.defineProperty(e.prototype,"id",{get:function(){return this._key.path.lastSegment()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ref",{get:function(){return new xs(this._firestore,this._converter,this._key)},enumerable:!1,configurable:!0}),e.prototype.exists=function(){return null!==this._document},e.prototype.data=function(){if(this._document){if(this._converter){var e=new Eu(this._firestore,this._userDataWriter,this._key,this._document,null);return this._converter.fromFirestore(e)}return this._userDataWriter.convertValue(this._document.data.value)}},e.prototype.get=function(e){if(this._document){var t=this._document.data.field(Tu("DocumentSnapshot.get",e));if(null!==t)return this._userDataWriter.convertValue(t)}},e}(),Eu=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(a.b)(t,e),t.prototype.data=function(){return e.prototype.data.call(this)},t}(_u);function Tu(e,t){return"string"==typeof t?mu(e,t):t instanceof Ws?t._internalPath:t._delegate._internalPath}var Iu=function(){function e(e,t){this.hasPendingWrites=e,this.fromCache=t}return e.prototype.isEqual=function(e){return this.hasPendingWrites===e.hasPendingWrites&&this.fromCache===e.fromCache},e}(),Su=function(e){function t(t,n,r,i,o,a){var s=this;return(s=e.call(this,t,n,r,i,a)||this)._firestore=t,s._firestoreImpl=t,s.metadata=o,s}return Object(a.b)(t,e),t.prototype.exists=function(){return e.prototype.exists.call(this)},t.prototype.data=function(e){if(void 0===e&&(e={}),this._document){if(this._converter){var t=new ku(this._firestore,this._userDataWriter,this._key,this._document,this.metadata,null);return this._converter.fromFirestore(t,e)}return this._userDataWriter.convertValue(this._document.data.value,e.serverTimestamps)}},t.prototype.get=function(e,t){if(void 0===t&&(t={}),this._document){var n=this._document.data.field(Tu("DocumentSnapshot.get",e));if(null!==n)return this._userDataWriter.convertValue(n,t.serverTimestamps)}},t}(_u),ku=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(a.b)(t,e),t.prototype.data=function(t){return void 0===t&&(t={}),e.prototype.data.call(this,t)},t}(Su),Cu=function(){function e(e,t,n,r){this._firestore=e,this._userDataWriter=t,this._snapshot=r,this.metadata=new Iu(r.hasPendingWrites,r.fromCache),this.query=n}return Object.defineProperty(e.prototype,"docs",{get:function(){var e=[];return this.forEach((function(t){return e.push(t)})),e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return this._snapshot.docs.size},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"empty",{get:function(){return 0===this.size},enumerable:!1,configurable:!0}),e.prototype.forEach=function(e,t){var n=this;this._snapshot.docs.forEach((function(r){e.call(t,new ku(n._firestore,n._userDataWriter,r.key,r,new Iu(n._snapshot.mutatedKeys.has(r.key),n._snapshot.fromCache),n.query.converter))}))},e.prototype.docChanges=function(e){void 0===e&&(e={});var t=!!e.includeMetadataChanges;if(t&&this._snapshot.excludesMetadataChanges)throw new c(u.INVALID_ARGUMENT,"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");return this._cachedChanges&&this._cachedChangesIncludeMetadataChanges===t||(this._cachedChanges=function(e,t){if(e._snapshot.oldDocs.isEmpty()){var n=0;return e._snapshot.docChanges.map((function(t){var r=new ku(e._firestore,e._userDataWriter,t.doc.key,t.doc,new Iu(e._snapshot.mutatedKeys.has(t.doc.key),e._snapshot.fromCache),e.query.converter);return t.doc,{type:"added",doc:r,oldIndex:-1,newIndex:n++}}))}var r=e._snapshot.oldDocs;return e._snapshot.docChanges.filter((function(e){return t||3!==e.type})).map((function(t){var n=new ku(e._firestore,e._userDataWriter,t.doc.key,t.doc,new Iu(e._snapshot.mutatedKeys.has(t.doc.key),e._snapshot.fromCache),e.query.converter),i=-1,o=-1;return 0!==t.type&&(i=r.indexOf(t.doc.key),r=r.delete(t.doc.key)),1!==t.type&&(o=(r=r.add(t.doc)).indexOf(t.doc.key)),{type:Ou(t.type),doc:n,oldIndex:i,newIndex:o}}))}(this,t),this._cachedChangesIncludeMetadataChanges=t),this._cachedChanges},e}();function Ou(e){switch(e){case 0:return"added";case 2:case 3:return"modified";case 1:return"removed";default:return y()}}function xu(e,t){return e instanceof Su&&t instanceof Su?e._firestore===t._firestore&&e._key.isEqual(t._key)&&(null===e._document?null===t._document:e._document.isEqual(t._document))&&e._converter===t._converter:e instanceof Cu&&t instanceof Cu&&e._firestore===t._firestore&&js(e.query,t.query)&&e.metadata.isEqual(t.metadata)&&e._snapshot.isEqual(t._snapshot)}function Nu(e){if(Pe(e)&&0===e.explicitOrderBy.length)throw new c(u.UNIMPLEMENTED,"limitToLast() queries require specifying at least one orderBy() clause")}var Pu=function(){};function Au(e){for(var t=[],n=1;n, or >=) must be on the same field. But you have inequality filters on '"+n.toString()+"' and '"+t.field.toString()+"'");var r=Ae(e);null!==r&&Vu(e,t.field,r)}var i=function(e,t){for(var n=0,r=e.filters;n=0)return i.op}return null}(e,function(e){switch(e){case"!=":return["!=","not-in"];case"array-contains":return["array-contains","array-contains-any","not-in"];case"in":return["array-contains-any","in","not-in"];case"array-contains-any":return["array-contains","array-contains-any","in","not-in"];case"not-in":return["array-contains","array-contains-any","in","not-in","!="];default:return[]}}(t.op));if(null!==i)throw i===t.op?new c(u.INVALID_ARGUMENT,"Invalid query. You cannot use more than one '"+t.op.toString()+"' filter."):new c(u.INVALID_ARGUMENT,"Invalid query. You cannot use '"+t.op.toString()+"' filters with '"+i.toString()+"' filters.")}(e,p),p}(e._query,0,t,e.firestore._databaseId,this.Kc,this.jc,this.Wc);return new Ns(e.firestore,e.converter,function(e,t){var n=e.filters.concat([t]);return new Ce(e.path,e.collectionGroup,e.explicitOrderBy.slice(),n,e.limit,e.limitType,e.startAt,e.endAt)}(e._query,n))},t}(Pu),Du=function(e){function t(t,n){var r=this;return(r=e.call(this)||this).Kc=t,r.Gc=n,r.type="orderBy",r}return Object(a.b)(t,e),t.prototype._apply=function(e){var t=function(e,t,n){if(null!==e.startAt)throw new c(u.INVALID_ARGUMENT,"Invalid query. You must not call startAt() or startAfter() before calling orderBy().");if(null!==e.endAt)throw new c(u.INVALID_ARGUMENT,"Invalid query. You must not call endAt() or endBefore() before calling orderBy().");var r=new Te(t,n);return function(e,t){if(null===Ae(e)){var n=Re(e);null!==n&&Vu(e,n,t.field)}}(e,r),r}(e._query,this.Kc,this.Gc);return new Ns(e.firestore,e.converter,function(e,t){var n=e.explicitOrderBy.concat([t]);return new Ce(e.path,e.collectionGroup,n,e.filters.slice(),e.limit,e.limitType,e.startAt,e.endAt)}(e._query,t))},t}(Pu),ju=function(e){function t(t,n,r){var i=this;return(i=e.call(this)||this).type=t,i.zc=n,i.Hc=r,i}return Object(a.b)(t,e),t.prototype._apply=function(e){return new Ns(e.firestore,e.converter,Me(e._query,this.zc,this.Hc))},t}(Pu),Lu=function(e){function t(t,n,r){var i=this;return(i=e.call(this)||this).type=t,i.Jc=n,i.Yc=r,i}return Object(a.b)(t,e),t.prototype._apply=function(e){var t=Fu(e,this.type,this.Jc,this.Yc);return new Ns(e.firestore,e.converter,function(e,t){return new Ce(e.path,e.collectionGroup,e.explicitOrderBy.slice(),e.filters.slice(),e.limit,e.limitType,t,e.endAt)}(e._query,t))},t}(Pu),Mu=function(e){function t(t,n,r){var i=this;return(i=e.call(this)||this).type=t,i.Jc=n,i.Yc=r,i}return Object(a.b)(t,e),t.prototype._apply=function(e){var t=Fu(e,this.type,this.Jc,this.Yc);return new Ns(e.firestore,e.converter,function(e,t){return new Ce(e.path,e.collectionGroup,e.explicitOrderBy.slice(),e.filters.slice(),e.limit,e.limitType,e.startAt,t)}(e._query,t))},t}(Pu);function Fu(e,t,n,i){if(n[0]=Object(r.getModularInstance)(n[0]),n[0]instanceof _u)return function(e,t,n,r,i){if(!r)throw new c(u.NOT_FOUND,"Can't use a DocumentSnapshot that doesn't exist for "+n+"().");for(var o=[],a=0,s=je(e);aa.length)throw new c(u.INVALID_ARGUMENT,"Too many arguments provided to "+r+"(). The number of arguments must be less than or equal to the number of orderBy() clauses");for(var s=[],l=0;l10)throw new c(u.INVALID_ARGUMENT,"Invalid Query. '"+t.toString()+"' filters support a maximum of 10 elements in the value array.")}function Vu(e,t,n){if(!n.isEqual(t))throw new c(u.INVALID_ARGUMENT,"Invalid query. You have a where filter with an inequality (<, <=, !=, not-in, >, or >=) on field '"+t.toString()+"' and so you must also use '"+t.toString()+"' as your first argument to orderBy(), but your first orderBy() is on field '"+n.toString()+"' instead.")}var Bu=function(){function e(){}return e.prototype.convertValue=function(e,t){switch(void 0===t&&(t="none"),W(e)){case 0:return null;case 1:return e.booleanValue;case 2:return M(e.integerValue||e.doubleValue);case 3:return this.convertTimestamp(e.timestampValue);case 4:return this.convertServerTimestamp(e,t);case 5:return e.stringValue;case 6:return this.convertBytes(F(e.bytesValue));case 7:return this.convertReference(e.referenceValue);case 8:return this.convertGeoPoint(e.geoPointValue);case 9:return this.convertArray(e.arrayValue,t);case 10:return this.convertObject(e.mapValue,t);default:throw y()}},e.prototype.convertObject=function(e,t){var n=this,r={};return C(e.fields,(function(e,i){r[e]=n.convertValue(i,t)})),r},e.prototype.convertGeoPoint=function(e){return new Qs(M(e.latitude),M(e.longitude))},e.prototype.convertArray=function(e,t){var n=this;return(e.values||[]).map((function(e){return n.convertValue(e,t)}))},e.prototype.convertServerTimestamp=function(e,t){switch(t){case"previous":var n=function e(t){var n=t.mapValue.fields.__previous_value__;return U(n)?e(n):n}(e);return null==n?null:this.convertValue(n,t);case"estimate":return this.convertTimestamp(q(e));default:return null}},e.prototype.convertTimestamp=function(e){var t=L(e);return new I(t.seconds,t.nanos)},e.prototype.convertDocumentKey=function(e,t){var n=N.fromString(e);g(xn(n));var r=new fs(n.get(1),n.get(3)),i=new z(n.popFirst(5));return r.isEqual(t)||d("Document "+i+" contains a document reference within a different database ("+r.projectId+"/"+r.database+") which is not supported. It will be treated as a reference in the current database ("+t.projectId+"/"+t.database+") instead."),i},e}();function Ku(e,t,n){return e?n&&(n.merge||n.mergeFields)?e.toFirestore(t,n):e.toFirestore(t):t}var zu=function(e){function t(t){var n=this;return(n=e.call(this)||this).firestore=t,n}return Object(a.b)(t,e),t.prototype.convertBytes=function(e){return new Hs(e)},t.prototype.convertReference=function(e){var t=this.convertDocumentKey(e,this.firestore._databaseId);return new xs(this.firestore,null,t)},t}(Bu),Wu=function(){function e(e,t){this._firestore=e,this._commitHandler=t,this._mutations=[],this._committed=!1,this._dataReader=tu(e)}return e.prototype.set=function(e,t,n){this._verifyNotCommitted();var r=Hu(e,this._firestore),i=Ku(r.converter,t,n),o=nu(this._dataReader,"WriteBatch.set",r._key,i,null!==r.converter,n);return this._mutations.push(o.toMutation(r._key,st.none())),this},e.prototype.update=function(e,t,n){for(var i=[],o=3;o0?this._commitHandler(this._mutations):Promise.resolve()},e.prototype._verifyNotCommitted=function(){if(this._committed)throw new c(u.FAILED_PRECONDITION,"A write batch can no longer be used after commit() has been called.")},e}();function Hu(e,t){if((e=Object(r.getModularInstance)(e)).firestore!==t)throw new c(u.INVALID_ARGUMENT,"Provided document reference is from a different Firestore instance.");return e}var Gu=function(e){function t(t){var n=this;return(n=e.call(this)||this).firestore=t,n}return Object(a.b)(t,e),t.prototype.convertBytes=function(e){return new Hs(e)},t.prototype.convertReference=function(e){var t=this.convertDocumentKey(e,this.firestore._databaseId);return new xs(this.firestore,null,t)},t}(Bu);function Qu(e,t,n){for(var i=[],o=3;o=0)throw new c(u.INVALID_ARGUMENT,"Invalid collection ID '"+t+"' passed to function collectionGroup(). Collection IDs must not contain '/'.");return new Ns(e,null,function(e){return new Ce(N.emptyPath(),e)}(t))}(this._delegate,e))}catch(e){throw lc(e,"collectionGroup()","Firestore.collectionGroup()")}},e.prototype.runTransaction=function(e){var t=this;return function(e,t){return function(e,t){var n=this,r=new Zn;return e.asyncQueue.enqueueAndForget((function(){return Object(a.a)(n,void 0,void 0,(function(){var n;return Object(a.c)(this,(function(i){switch(i.label){case 0:return[4,function(e){return ns(e).then((function(e){return e.datastore}))}(e)];case 1:return n=i.sent(),new Xa(e.asyncQueue,n,t,r).run(),[2]}}))}))})),r.promise}(Vs(e),(function(n){return t(new Ju(e,n))}))}(this._delegate,(function(n){return e(new ac(t,n))}))},e.prototype.batch=function(){var e=this;return Vs(this._delegate),new sc(new Wu(this._delegate,(function(t){return Yu(e._delegate,t)})))},e.prototype.loadBundle=function(e){throw new c(u.FAILED_PRECONDITION,'"loadBundle()" does not exist, have you imported "firebase/firestore/bundle"?')},e.prototype.namedQuery=function(e){throw new c(u.FAILED_PRECONDITION,'"namedQuery()" does not exist, have you imported "firebase/firestore/bundle"?')},e}(),ic=function(e){function t(t){var n=this;return(n=e.call(this)||this).firestore=t,n}return Object(a.b)(t,e),t.prototype.convertBytes=function(e){return new tc(new Hs(e))},t.prototype.convertReference=function(e){var t=this.convertDocumentKey(e,this.firestore._databaseId);return cc.tu(t,this.firestore,null)},t}(Bu);function oc(e){var t;t=e,l.setLogLevel(t)}var ac=function(){function e(e,t){this._firestore=e,this._delegate=t,this._userDataWriter=new ic(e)}return e.prototype.get=function(e){var t=this,n=bc(e);return this._delegate.get(n).then((function(e){return new dc(t._firestore,new Su(t._firestore._delegate,t._userDataWriter,e._key,e._document,e.metadata,n.converter))}))},e.prototype.set=function(e,t,n){var r=bc(e);return n?(ws("Transaction.set",n),this._delegate.set(r,t,n)):this._delegate.set(r,t),this},e.prototype.update=function(e,t,n){for(var r,i=[],o=3;o=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}var o,a="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window?window:"undefined"!==typeof e?e:"undefined"!==typeof self?self:{},s=s||{},u=a||self;function c(){}function l(e){var t=typeof e;return"array"==(t="object"!=t?t:e?Array.isArray(e)?"array":t:"null")||"object"==t&&"number"==typeof e.length}function f(e){var t=typeof e;return"object"==t&&null!=e||"function"==t}var h="closure_uid_"+(1e9*Math.random()>>>0),d=0;function p(e,t,n){return e.call.apply(e.bind,arguments)}function v(e,t,n){if(!e)throw Error();if(2t?1:0}e:{var N=u.navigator;if(N){var P=N.userAgent;if(P){k=P;break e}}k=""}function A(e,t,n){for(var r in e)t.call(n,e[r],r,e)}function R(e){var t={};for(var n in e)t[n]=e[n];return t}var D="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function j(e,t){for(var n,r,i=1;iparseFloat(W)){M=String(G);break e}}M=W}var Q,$={};function Y(e){return function(e,t){var n=$;return Object.prototype.hasOwnProperty.call(n,e)?n[e]:n[e]=t(e)}(e,(function(){for(var t=0,n=C(String(M)).split("."),r=C(String(e)).split("."),i=Math.max(n.length,r.length),o=0;0==t&&o=e.keyCode)&&(e.keyCode=-1)}catch(t){}};var oe="closure_listenable_"+(1e6*Math.random()|0),ae=0;function se(e,t,n,r,i){this.listener=e,this.proxy=null,this.src=t,this.type=n,this.capture=!!r,this.da=i,this.key=++ae,this.Y=this.Z=!1}function ue(e){e.Y=!0,e.listener=null,e.proxy=null,e.src=null,e.da=null}function ce(e){this.src=e,this.a={},this.b=0}function le(e,t){var n=t.type;if(n in e.a){var r,i=e.a[n],o=_(i,t);(r=0<=o)&&Array.prototype.splice.call(i,o,1),r&&(ue(t),0==e.a[n].length&&(delete e.a[n],e.b--))}}function fe(e,t,n,r){for(var i=0;i>>0);function Ee(e){return"function"===typeof e?e:(e[_e]||(e[_e]=function(t){return e.handleEvent(t)}),e[_e])}function Te(){w.call(this),this.c=new ce(this),this.J=this,this.D=null}function Ie(e,t){var n,r=e.D;if(r)for(n=[];r;r=r.D)n.push(r);if(e=e.J,r=t.type||t,"string"===typeof t)t=new ne(t,e);else if(t instanceof ne)t.target=t.target||e;else{var i=t;j(t=new ne(r,e),i)}if(i=!0,n)for(var o=n.length-1;0<=o;o--){var a=t.a=n[o];i=Se(a,r,!0,t)&&i}if(i=Se(a=t.a=e,r,!0,t)&&i,i=Se(a,r,!1,t)&&i,n)for(o=0;ot.b&&(t.b++,e.next=t.a,t.a=e)}De=!1}function Me(e,t){Te.call(this),this.b=e||1,this.a=t||u,this.f=y(this.eb,this),this.g=m()}function Fe(e){e.aa=!1,e.M&&(e.a.clearTimeout(e.M),e.M=null)}function Ue(e,t,n){if("function"===typeof e)n&&(e=y(e,n));else{if(!e||"function"!=typeof e.handleEvent)throw Error("Invalid listener argument");e=y(e.handleEvent,e)}return 2147483647r.length)){var i=r[1];if(Array.isArray(i)&&!(1>i.length)){var o=i[0];if("noop"!=o&&"stop"!=o&&"close"!=o)for(var a=1;at.length?yt:(t=t.substr(r,n),e.D=r+n,t))}function _t(e){e.T=m()+e.P,Et(e,e.P)}function Et(e,t){if(null!=e.o)throw Error("WatchDog timer not null");e.o=nt(y(e.$a,e),t)}function Tt(e){e.o&&(u.clearTimeout(e.o),e.o=null)}function It(e){0==e.g.v||e.A||Kn(e.g,e)}function St(e){Tt(e);var t=e.F;t&&"function"==typeof t.ka&&t.ka(),e.F=null,Fe(e.R),We(e.J),e.a&&(t=e.a,e.a=null,t.abort(),t.ka())}function kt(e,t){try{var n=e.g;if(0!=n.v&&(n.a==e||an(n.b,e)))if(n.I=e.N,!e.C&&an(n.b,e)&&3==n.v){try{var r=n.la.a.parse(t)}catch(g){r=null}if(Array.isArray(r)&&3==r.length){var i=r;if(0==i[0]){e:if(!n.j){if(n.a){if(!(n.a.u+3e3i[2]&&n.G&&0==n.o&&!n.m&&(n.m=nt(y(n.Xa,n),6e3));if(1>=on(n.b)&&n.fa){try{n.fa()}catch(g){}n.fa=void 0}}else Wn(n,11)}else if((e.C||n.a==e)&&Bn(n),!S(t))for(t=r=n.la.a.parse(t),r=0;rt||3==t&&!V&&!this.a.$())){this.A||4!=t||7==n||Je(8==n||0>=r?3:2),Tt(this);var i=this.a.W();this.N=i;var o=this.a.$();if(this.b=200==i,function(e,t,n,r,i,o,a){e.info((function(){return"XMLHTTP RESP ("+r+") [ attempt "+i+"]: "+t+"\n"+n+"\n"+o+" "+a}))}(this.c,this.m,this.l,this.f,this.S,t,i),this.b){if(this.U&&!this.C){t:{if(this.a){var a,s=this.a;if((a=s.a?s.a.getResponseHeader("X-HTTP-Initial-Response"):null)&&!S(a)){var u=a;break t}}u=null}if(!u){this.b=!1,this.h=3,et(12),St(this),It(this);break e}Ge(this.c,this.f,u,"Initial handshake response via X-HTTP-Initial-Response"),this.C=!0,kt(this,u)}this.I?(bt(this,t,o),V&&this.b&&3==t&&(ze(this.J,this.R,"tick",this.ab),this.R.start())):(Ge(this.c,this.f,o,null),kt(this,o)),4==t&&St(this),this.b&&!this.A&&(4==t?Kn(this.g,this):(this.b=!1,_t(this)))}else 400==i&&0t)throw Error("Bad port number "+t);e.h=t}else e.h=null}function Mt(e,t,n){t instanceof Qt?(e.b=t,function(e,t){t&&!e.f&&($t(e),e.c=null,e.a.forEach((function(e,t){var n=t.toLowerCase();t!=n&&(Yt(this,t),Jt(this,n,e))}),e)),e.f=t}(e.b,e.a)):(n||(t=Vt(t,Ht)),e.b=new Qt(t,e.a))}function Ft(e,t,n){e.b.set(t,n)}function Ut(e){return Ft(e,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^m()).toString(36)),e}function qt(e,t){return e?t?decodeURI(e.replace(/%25/g,"%2525")):decodeURIComponent(e):""}function Vt(e,t,n){return"string"===typeof e?(e=encodeURI(e).replace(t,Bt),n&&(e=e.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),e):null}function Bt(e){return"%"+((e=e.charCodeAt(0))>>4&15).toString(16)+(15&e).toString(16)}At.prototype.toString=function(){var e=[],t=this.f;t&&e.push(Vt(t,Kt,!0),":");var n=this.c;return(n||"file"==t)&&(e.push("//"),(t=this.j)&&e.push(Vt(t,Kt,!0),"@"),e.push(encodeURIComponent(String(n)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),null!=(n=this.h)&&e.push(":",String(n))),(n=this.g)&&(this.c&&"/"!=n.charAt(0)&&e.push("/"),e.push(Vt(n,"/"==n.charAt(0)?Wt:zt,!0))),(n=this.b.toString())&&e.push("?",n),(n=this.i)&&e.push("#",Vt(n,Gt)),e.join("")};var Kt=/[#\/\?@]/g,zt=/[#\?:]/g,Wt=/[#\?]/g,Ht=/[#\?@]/g,Gt=/#/g;function Qt(e,t){this.b=this.a=null,this.c=e||null,this.f=!!t}function $t(e){e.a||(e.a=new Ot,e.b=0,e.c&&function(e,t){if(e){e=e.split("&");for(var n=0;n2*e.c&&xt(e)))}function Xt(e,t){return $t(e),t=Zt(e,t),Nt(e.a.b,t)}function Jt(e,t,n){Yt(e,t),0=e.f}function on(e){return e.b?1:e.a?e.a.size:0}function an(e,t){return e.b?e.b==t:!!e.a&&e.a.has(t)}function sn(e,t){e.a?e.a.add(t):e.b=t}function un(e,t){e.b&&e.b==t?e.b=null:e.a&&e.a.has(t)&&e.a.delete(t)}function cn(e){var t,n;if(null!=e.b)return e.c.concat(e.b.s);if(null!=e.a&&0!==e.a.size){var r=e.c;try{for(var o=i(e.a.values()),a=o.next();!a.done;a=o.next()){var s=a.value;r=r.concat(s.s)}}catch(u){t={error:u}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return r}return I(e.c)}function ln(){}function fn(){this.a=new ln}function hn(e,t,n){var r=n||"";try{Ct(e,(function(e,n){var i=e;f(e)&&(i=ke(e)),t.push(r+n+"="+encodeURIComponent(i))}))}catch(i){throw t.push(r+"type="+encodeURIComponent("_badmap")),i}}function dn(e,t,n,r,i){try{t.onload=null,t.onerror=null,t.onabort=null,t.ontimeout=null,i(r)}catch(o){}}tn.prototype.cancel=function(){var e,t;if(this.c=cn(this),this.b)this.b.cancel(),this.b=null;else if(this.a&&0!==this.a.size){try{for(var n=i(this.a.values()),r=n.next();!r.done;r=n.next()){r.value.cancel()}}catch(o){e={error:o}}finally{try{r&&!r.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}this.a.clear()}},ln.prototype.stringify=function(e){return u.JSON.stringify(e,void 0)},ln.prototype.parse=function(e){return u.JSON.parse(e,void 0)};var pn=u.JSON.parse;function vn(e){Te.call(this),this.headers=new Ot,this.l=e||null,this.b=!1,this.u=this.a=null,this.C="",this.h=0,this.f="",this.g=this.B=this.m=this.A=!1,this.s=0,this.o=null,this.I=gn,this.F=this.G=!1}b(vn,Te);var yn,gn="",mn=/^https?$/i,bn=["POST","PUT"];function wn(e){return"content-type"==e.toLowerCase()}function _n(e,t){e.b=!1,e.a&&(e.g=!0,e.a.abort(),e.g=!1),e.f=t,e.h=5,En(e),In(e)}function En(e){e.A||(e.A=!0,Ie(e,"complete"),Ie(e,"error"))}function Tn(e){if(e.b&&"undefined"!=typeof s&&(!e.u[1]||4!=kn(e)||2!=e.W()))if(e.m&&4==kn(e))Ue(e.Aa,0,e);else if(Ie(e,"readystatechange"),4==kn(e)){e.b=!1;try{var t,n=e.W();e:switch(n){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var r=!0;break e;default:r=!1}if(!(t=r)){var i;if(i=0===n){var o=String(e.C).match(Pt)[1]||null;if(!o&&u.self&&u.self.location){var a=u.self.location.protocol;o=a.substr(0,a.length-1)}i=!mn.test(o?o.toLowerCase():"")}t=i}if(t)Ie(e,"complete"),Ie(e,"success");else{e.h=6;try{var c=2(c-=o))o=Math.max(0,i[u].b-100),s=!1;else try{hn(l,a,"req"+c+"_")}catch(f){r&&r(l)}}if(s){r=a.join("&");break e}}return e=e.g.splice(0,n),t.s=e,r}function Fn(e){e.a||e.j||(e.T=1,Re(e.Ba,e),e.o=0)}function Un(e){return!(e.a||e.j||3<=e.o)&&(e.T++,e.j=nt(y(e.Ba,e),zn(e,e.o)),e.o++,!0)}function qn(e){null!=e.s&&(u.clearTimeout(e.s),e.s=null)}function Vn(e){e.a=new dt(e,e.c,"rpc",e.T),null===e.i&&(e.a.B=e.l),e.a.O=0;var t=Rt(e.ma);Ft(t,"RID","rpc"),Ft(t,"SID",e.J),Ft(t,"CI",e.G?"0":"1"),Ft(t,"AID",e.P),Ln(e,t),Ft(t,"TYPE","xmlhttp"),e.i&&e.l&&Cn(t,e.i,e.l),e.D&&e.a.setTimeout(e.D);var n=e.a;e=e.ha,n.G=1,n.i=Ut(Rt(t)),n.j=null,n.I=!0,mt(n,e)}function Bn(e){null!=e.m&&(u.clearTimeout(e.m),e.m=null)}function Kn(e,t){var n=null;if(e.a==t){Bn(e),qn(e),e.a=null;var r=2}else{if(!an(e.b,t))return;n=t.s,un(e.b,t),r=1}if(e.I=t.N,0!=e.v)if(t.b)if(1==r){n=t.j?t.j.length:0,t=m()-t.u;var i=e.u;Ie(r=Ye(),new tt(r,n,t,i)),Dn(e)}else Fn(e);else if(3==(i=t.h)||0==i&&0=e.b.f-(e.h?1:0))&&(e.h?(e.g=t.s.concat(e.g),!0):!(1==e.v||2==e.v||e.u>=(e.Ma?0:e.Na))&&(e.h=nt(y(e.Ca,e,t),zn(e,e.u)),e.u++,!0))}(e,t)||2==r&&Un(e)))switch(n&&0t?null:"string"===typeof e?e.charAt(t):e[t]}(i.L()),n=u.FormData&&e instanceof u.FormData,!(0<=_(bn,t))||r||n||i.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8"),i.forEach((function(e,t){this.a.setRequestHeader(t,e)}),this),this.I&&(this.a.responseType=this.I),"withCredentials"in this.a&&this.a.withCredentials!==this.G&&(this.a.withCredentials=this.G);try{Sn(this),0=this.N)){var e=2*this.N;this.c.info("BP detection timer enabled: "+e),this.s=nt(y(this.Ya,this),e)}},o.Ya=function(){this.s&&(this.s=null,this.c.info("BP detection timeout reached."),this.c.info("Buffering proxy detected and switch to long-polling!"),this.G=!1,this.F=!0,et(10),Pn(this),Vn(this))},o.Xa=function(){null!=this.m&&(this.m=null,Pn(this),Un(this),et(19))},o.cb=function(e){e?(this.c.info("Successfully pinged google.com"),et(2)):(this.c.info("Failed to ping google.com"),et(1))},(o=$n.prototype).ua=function(){},o.ta=function(){},o.sa=function(){},o.ra=function(){},o.Ka=function(){},Yn.prototype.a=function(e,t){return new Xn(e,t)},b(Xn,Te),Xn.prototype.h=function(){this.a.f=this.f,this.o&&(this.a.C=!0);var e=this.a,t=this.g,n=this.b||void 0;et(0),e.ga=t,e.V=n||{},e.G=e.S,e.B=Gn(e,null,e.ga),Dn(e)},Xn.prototype.close=function(){Nn(this.a)},Xn.prototype.l=function(e){if("string"===typeof e){var t={};t.__data__=e,Rn(this.a,t)}else this.m?((t={}).__data__=ke(e),Rn(this.a,t)):Rn(this.a,e)},Xn.prototype.H=function(){this.a.f=null,delete this.f,Nn(this.a),delete this.a,Xn.X.H.call(this)},b(Jn,lt),b(Zn,ft),b(er,$n),er.prototype.ua=function(){Ie(this.a,"a")},er.prototype.ta=function(e){Ie(this.a,new Jn(e))},er.prototype.sa=function(e){Ie(this.a,new Zn(e))},er.prototype.ra=function(){Ie(this.a,"b")},b(tr,ot),tr.prototype.a=function(){return new nr(this.f)},tr.prototype.c=(yn={},function(){return yn}),b(nr,Te);var rr=0;function ir(e){e.f.read().then(e.Ta.bind(e)).catch(e.ca.bind(e))}function or(e){e.readyState=4,e.g=null,e.f=null,e.m=null,ar(e)}function ar(e){e.onreadystatechange&&e.onreadystatechange.call(e)}(o=nr.prototype).open=function(e,t){if(this.readyState!=rr)throw this.abort(),Error("Error reopening a connection");this.s=e,this.o=t,this.readyState=1,ar(this)},o.send=function(e){if(1!=this.readyState)throw this.abort(),Error("need to call open() first. ");this.a=!0;var t={headers:this.l,method:this.s,credentials:this.h,cache:void 0};e&&(t.body=e),this.u.fetch(new Request(this.o,t)).then(this.Wa.bind(this),this.ca.bind(this))},o.abort=function(){this.responseText="",this.l=new Headers,this.status=0,this.f&&this.f.cancel("Request was aborted."),1<=this.readyState&&this.a&&4!=this.readyState&&(this.a=!1,or(this)),this.readyState=rr},o.Wa=function(e){this.a&&(this.g=e,this.b||(this.status=this.g.status,this.statusText=this.g.statusText,this.b=e.headers,this.readyState=2,ar(this)),this.a&&(this.readyState=3,ar(this),this.a&&("arraybuffer"===this.responseType?e.arrayBuffer().then(this.Ua.bind(this),this.ca.bind(this)):"undefined"!==typeof u.ReadableStream&&"body"in e?(this.responseText="",this.f=e.body.getReader(),this.m=new TextDecoder,ir(this)):e.text().then(this.Va.bind(this),this.ca.bind(this)))))},o.Ta=function(e){if(this.a){var t=this.m.decode(e.value?e.value:new Uint8Array(0),{stream:!e.done});t&&(this.responseText+=t),e.done?or(this):ar(this),3==this.readyState&&ir(this)}},o.Va=function(e){this.a&&(this.responseText=e,or(this))},o.Ua=function(){this.a&&or(this)},o.ca=function(){this.a&&or(this)},o.setRequestHeader=function(e,t){this.l.append(e,t)},o.getResponseHeader=function(e){return this.b&&this.b.get(e.toLowerCase())||""},o.getAllResponseHeaders=function(){if(!this.b)return"";for(var e=[],t=this.b.entries(),n=t.next();!n.done;)n=n.value,e.push(n[0]+": "+n[1]),n=t.next();return e.join("\r\n")},Object.defineProperty(nr.prototype,"withCredentials",{get:function(){return"include"===this.h},set:function(e){this.h=e?"include":"same-origin"}}),Yn.prototype.createWebChannel=Yn.prototype.a,Xn.prototype.send=Xn.prototype.l,Xn.prototype.open=Xn.prototype.h,Xn.prototype.close=Xn.prototype.close,rt.NO_ERROR=0,rt.TIMEOUT=8,rt.HTTP_ERROR=6,it.COMPLETE="complete",st.EventType=ct,ct.OPEN="a",ct.CLOSE="b",ct.ERROR="c",ct.MESSAGE="d",Te.prototype.listen=Te.prototype.wa,vn.prototype.listenOnce=vn.prototype.xa,vn.prototype.getLastError=vn.prototype.Ra,vn.prototype.getLastErrorCode=vn.prototype.va,vn.prototype.getStatus=vn.prototype.W,vn.prototype.getResponseJson=vn.prototype.Qa,vn.prototype.getResponseText=vn.prototype.$,vn.prototype.send=vn.prototype.ba;var sr=function(){return new Yn},ur=function(){return Ye()},cr=rt,lr=it,fr=Qe,hr={lb:0,ob:1,pb:2,Ib:3,Nb:4,Kb:5,Lb:6,Jb:7,Hb:8,Mb:9,PROXY:10,NOPROXY:11,Fb:12,Bb:13,Cb:14,Ab:15,Db:16,Eb:17,hb:18,gb:19,ib:20},dr=tr,pr=st,vr=vn}).call(this,n(22))},function(e,t,n){"use strict";function r(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r=0||(i[n]=e[n]);return i}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";var r=n(40),i=Object.prototype.toString;function o(e){return"[object Array]"===i.call(e)}function a(e){return"undefined"===typeof e}function s(e){return null!==e&&"object"===typeof e}function u(e){return"[object Function]"===i.call(e)}function c(e,t){if(null!==e&&"undefined"!==typeof e)if("object"!==typeof e&&(e=[e]),o(e))for(var n=0,r=e.length;n=0;r--){var i=t[r](e);if(i)return i}return function(t,r){throw new Error("Invalid value of type "+typeof e+" for "+n+" argument when connecting component "+r.wrappedComponentName+".")}}function U(e,t){return e===t}function q(e){var t=void 0===e?{}:e,n=t.connectHOC,r=void 0===n?I:n,i=t.mapStateToPropsFactories,o=void 0===i?A:i,a=t.mapDispatchToPropsFactories,s=void 0===a?P:a,u=t.mergePropsFactories,c=void 0===u?D:u,l=t.selectorFactory,d=void 0===l?M:l;return function(e,t,n,i){void 0===i&&(i={});var a=i,u=a.pure,l=void 0===u||u,p=a.areStatesEqual,v=void 0===p?U:p,y=a.areOwnPropsEqual,g=void 0===y?k:y,m=a.areStatePropsEqual,b=void 0===m?k:m,w=a.areMergedPropsEqual,_=void 0===w?k:w,E=Object(h.a)(a,["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"]),T=F(e,o,"mapStateToProps"),I=F(t,s,"mapDispatchToProps"),S=F(n,c,"mergeProps");return r(d,Object(f.a)({methodName:"connect",getDisplayName:function(e){return"Connect("+e+")"},shouldHandleStateChanges:Boolean(e),initMapStateToProps:T,initMapDispatchToProps:I,initMergeProps:S,pure:l,areStatesEqual:v,areOwnPropsEqual:g,areStatePropsEqual:b,areMergedPropsEqual:_},E))}}var V=q();var B,K=n(25);n.d(t,"a",(function(){return l})),n.d(t,"b",(function(){return V})),B=K.unstable_batchedUpdates,a=B},function(e,t,n){"use strict";var r=n(7);function i(e){return"/"===e.charAt(0)}function o(e,t){for(var n=t,r=n+1,i=e.length;r=0;h--){var d=a[h];"."===d?o(a,h):".."===d?(o(a,h),f++):f&&(o(a,h),f--)}if(!c)for(;f--;f)a.unshift("..");!c||""===a[0]||a[0]&&i(a[0])||a.unshift("");var p=a.join("/");return n&&"/"!==p.substr(-1)&&(p+="/"),p};function s(e){return e.valueOf?e.valueOf():Object.prototype.valueOf.call(e)}var u=function e(t,n){if(t===n)return!0;if(null==t||null==n)return!1;if(Array.isArray(t))return Array.isArray(n)&&t.length===n.length&&t.every((function(t,r){return e(t,n[r])}));if("object"===typeof t||"object"===typeof n){var r=s(t),i=s(n);return r!==t||i!==n?e(r,i):Object.keys(Object.assign({},t,n)).every((function(r){return e(t[r],n[r])}))}return!1},c=n(12);function l(e){return"/"===e.charAt(0)?e:"/"+e}function f(e){return"/"===e.charAt(0)?e.substr(1):e}function h(e,t){return function(e,t){return 0===e.toLowerCase().indexOf(t.toLowerCase())&&-1!=="/?#".indexOf(e.charAt(t.length))}(e,t)?e.substr(t.length):e}function d(e){return"/"===e.charAt(e.length-1)?e.slice(0,-1):e}function p(e){var t=e.pathname,n=e.search,r=e.hash,i=t||"/";return n&&"?"!==n&&(i+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(i+="#"===r.charAt(0)?r:"#"+r),i}function v(e,t,n,i){var o;"string"===typeof e?(o=function(e){var t=e||"/",n="",r="",i=t.indexOf("#");-1!==i&&(r=t.substr(i),t=t.substr(0,i));var o=t.indexOf("?");return-1!==o&&(n=t.substr(o),t=t.substr(0,o)),{pathname:t,search:"?"===n?"":n,hash:"#"===r?"":r}}(e)).state=t:(void 0===(o=Object(r.a)({},e)).pathname&&(o.pathname=""),o.search?"?"!==o.search.charAt(0)&&(o.search="?"+o.search):o.search="",o.hash?"#"!==o.hash.charAt(0)&&(o.hash="#"+o.hash):o.hash="",void 0!==t&&void 0===o.state&&(o.state=t));try{o.pathname=decodeURI(o.pathname)}catch(s){throw s instanceof URIError?new URIError('Pathname "'+o.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):s}return n&&(o.key=n),i?o.pathname?"/"!==o.pathname.charAt(0)&&(o.pathname=a(o.pathname,i.pathname)):o.pathname=i.pathname:o.pathname||(o.pathname="/"),o}function y(e,t){return e.pathname===t.pathname&&e.search===t.search&&e.hash===t.hash&&e.key===t.key&&u(e.state,t.state)}function g(){var e=null;var t=[];return{setPrompt:function(t){return e=t,function(){e===t&&(e=null)}},confirmTransitionTo:function(t,n,r,i){if(null!=e){var o="function"===typeof e?e(t,n):e;"string"===typeof o?"function"===typeof r?r(o,i):i(!0):i(!1!==o)}else i(!0)},appendListener:function(e){var n=!0;function r(){n&&e.apply(void 0,arguments)}return t.push(r),function(){n=!1,t=t.filter((function(e){return e!==r}))}},notifyListeners:function(){for(var e=arguments.length,n=new Array(e),r=0;rt?n.splice(t,n.length-t,r):n.push(r),f({action:"PUSH",location:r,index:t,entries:n})}}))},replace:function(e,t){var r=v(e,t,h(),w.location);l.confirmTransitionTo(r,"REPLACE",n,(function(e){e&&(w.entries[w.index]=r,f({action:"REPLACE",location:r}))}))},go:b,goBack:function(){b(-1)},goForward:function(){b(1)},canGo:function(e){var t=w.index+e;return t>=0&&t1)for(var n=1;n0&&o[o.length-1])&&(6===a[0]||2===a[0])){s=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]=200&&e<300)return"ok";switch(e){case 0:return"internal";case 400:return"invalid-argument";case 401:return"unauthenticated";case 403:return"permission-denied";case 404:return"not-found";case 409:return"aborted";case 429:return"resource-exhausted";case 499:return"cancelled";case 500:return"internal";case 501:return"unimplemented";case 503:return"unavailable";case 504:return"deadline-exceeded"}return"unknown"}(e),o=i,a=void 0;try{var s=t&&t.error;if(s){var u=s.status;if("string"===typeof u){if(!p[u])return new v("internal","internal");i=p[u],o=u}var c=s.message;"string"===typeof c&&(o=c),void 0!==(a=s.details)&&(a=n.decode(a))}}catch(r){}return"ok"===i?null:new v(i,o,a)}(h.status,h.json,this.serializer))throw y;if(!h.json)throw new v("internal","Response is not valid JSON object.");if("undefined"===typeof(g=h.json.data)&&(g=h.json.result),"undefined"===typeof g)throw new v("internal","Response is missing data field.");return[2,{data:this.serializer.decode(g)}]}}))}))},e}();function w(e,t){return h(this,void 0,void 0,(function(){var n;return d(this,(function(r){switch(r.label){case 0:return[4,t];case 1:return n=r.sent(),clearTimeout(e),[2,n]}}))}))}!function(e,t){var n={Functions:b};e.INTERNAL.registerComponent(new c.Component("functions",(function(e,n){var r=n.instanceIdentifier,i=e.getProvider("app").getImmediate(),o=e.getProvider("auth-internal"),a=e.getProvider("app-check-internal"),s=e.getProvider("messaging");return new b(i,o,s,a,r,t)}),"PUBLIC").setServiceProps(n).setMultipleInstances(!0))}(o.default,fetch.bind(self)),o.default.registerVersion("@firebase/functions","0.6.12");var _=function(){return(_=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&o[o.length-1])&&(6===a[0]||2===a[0])){s=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function S(e,t){var n="function"===typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}Object.create;var k,C=n(19),O=((k={})["missing-app-config-values"]='Missing App configuration value: "{$valueName}"',k["not-registered"]="Firebase Installation is not registered.",k["installation-not-found"]="Firebase Installation not found.",k["request-failed"]='{$requestName} request failed with error "{$serverCode} {$serverStatus}: {$serverMessage}"',k["app-offline"]="Could not process request. Application offline.",k["delete-pending-registration"]="Can't delete installation while there is a pending registration request.",k),x=new a.ErrorFactory("installations","Installations",O);function N(e){return e instanceof a.FirebaseError&&e.code.includes("request-failed")}function P(e){return"https://firebaseinstallations.googleapis.com/v1/projects/"+e.projectId+"/installations"}function A(e){return{token:e.token,requestStatus:2,expiresIn:(t=e.expiresIn,Number(t.replace("s","000"))),creationTime:Date.now()};var t}function R(e,t){return E(this,void 0,void 0,(function(){var n,r;return T(this,(function(i){switch(i.label){case 0:return[4,t.json()];case 1:return n=i.sent(),r=n.error,[2,x.create("request-failed",{requestName:e,serverCode:r.code,serverMessage:r.message,serverStatus:r.status})]}}))}))}function D(e){var t=e.apiKey;return new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":t})}function j(e,t){var n=t.refreshToken,r=D(e);return r.append("Authorization",function(e){return"FIS_v2 "+e}(n)),r}function L(e){return E(this,void 0,void 0,(function(){var t;return T(this,(function(n){switch(n.label){case 0:return[4,e()];case 1:return(t=n.sent()).status>=500&&t.status<600?[2,e()]:[2,t]}}))}))}function M(e,t){var n=t.fid;return E(this,void 0,void 0,(function(){var t,r,i,o,a,s;return T(this,(function(u){switch(u.label){case 0:return t=P(e),r=D(e),i={fid:n,authVersion:"FIS_v2",appId:e.appId,sdkVersion:"w:0.4.29"},o={method:"POST",headers:r,body:JSON.stringify(i)},[4,L((function(){return fetch(t,o)}))];case 1:return(a=u.sent()).ok?[4,a.json()]:[3,3];case 2:return s=u.sent(),[2,{fid:s.fid||n,registrationStatus:2,refreshToken:s.refreshToken,authToken:A(s.authToken)}];case 3:return[4,R("Create Installation",a)];case 4:throw u.sent()}}))}))}function F(e){return new Promise((function(t){setTimeout(t,e)}))}function U(e){return btoa(String.fromCharCode.apply(String,function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i0&&o[o.length-1])&&(6===a[0]||2===a[0])){s=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function me(e,t){var n="function"===typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}var be;Object.create;var we,_e=((be={})["missing-app-config-values"]='Missing App configuration value: "{$valueName}"',be["only-available-in-window"]="This method is available in a Window context.",be["only-available-in-sw"]="This method is available in a service worker context.",be["permission-default"]="The notification permission was not granted and dismissed instead.",be["permission-blocked"]="The notification permission was not granted and blocked instead.",be["unsupported-browser"]="This browser doesn't support the API's required to use the firebase SDK.",be["failed-service-worker-registration"]="We are unable to register the default service worker. {$browserErrorMessage}",be["token-subscribe-failed"]="A problem occurred while subscribing the user to FCM: {$errorInfo}",be["token-subscribe-no-token"]="FCM returned no token when subscribing the user to push.",be["token-unsubscribe-failed"]="A problem occurred while unsubscribing the user from FCM: {$errorInfo}",be["token-update-failed"]="A problem occurred while updating the user from FCM: {$errorInfo}",be["token-update-no-token"]="FCM returned no token when updating the user to push.",be["use-sw-after-get-token"]="The useServiceWorker() method may only be called once and must be called before calling getToken() to ensure your service worker is used.",be["invalid-sw-registration"]="The input to useServiceWorker() must be a ServiceWorkerRegistration.",be["invalid-bg-handler"]="The input to setBackgroundMessageHandler() must be a function.",be["invalid-vapid-key"]="The public VAPID key must be a string.",be["use-vapid-key-after-get-token"]="The usePublicVapidKey() method may only be called once and must be called before calling getToken() to ensure your VAPID key is used.",be),Ee=new a.ErrorFactory("messaging","Messaging",_e),Te="BDOU99-h67HcA6JeFXHbSNMu7e2yNNu3RzoMj8TM4W88jITfq7ZmPvIM1Iv-4_l2LxQcYwhqby2xGpWwzjfAnG4";function Ie(e){var t=new Uint8Array(e);return btoa(String.fromCharCode.apply(String,function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i0&&"string"===typeof e.token&&e.token.length>0&&"string"===typeof t.auth&&t.auth.length>0&&"string"===typeof t.p256dh&&t.p256dh.length>0&&"string"===typeof t.endpoint&&t.endpoint.length>0&&"string"===typeof t.swScope&&t.swScope.length>0&&"string"===typeof t.vapidKey&&t.vapidKey.length>0}var Oe=null;function xe(){return Oe||(Oe=Object(C.openDb)("firebase-messaging-database",1,(function(e){switch(e.oldVersion){case 0:e.createObjectStore("firebase-messaging-store")}}))),Oe}function Ne(e){return ve(this,void 0,void 0,(function(){var t,n,r;return ye(this,(function(i){switch(i.label){case 0:return t=Re(e),[4,xe()];case 1:return[4,i.sent().transaction("firebase-messaging-store").objectStore("firebase-messaging-store").get(t)];case 2:return(n=i.sent())?[2,n]:[3,3];case 3:return[4,ke(e.appConfig.senderId)];case 4:return(r=i.sent())?[4,Pe(e,r)]:[3,6];case 5:return i.sent(),[2,r];case 6:return[2]}}))}))}function Pe(e,t){return ve(this,void 0,void 0,(function(){var n,r,i;return ye(this,(function(o){switch(o.label){case 0:return n=Re(e),[4,xe()];case 1:return r=o.sent(),[4,(i=r.transaction("firebase-messaging-store","readwrite")).objectStore("firebase-messaging-store").put(t,n)];case 2:return o.sent(),[4,i.complete];case 3:return o.sent(),[2,t]}}))}))}function Ae(e){return ve(this,void 0,void 0,(function(){var t,n,r;return ye(this,(function(i){switch(i.label){case 0:return t=Re(e),[4,xe()];case 1:return n=i.sent(),[4,(r=n.transaction("firebase-messaging-store","readwrite")).objectStore("firebase-messaging-store").delete(t)];case 2:return i.sent(),[4,r.complete];case 3:return i.sent(),[2]}}))}))}function Re(e){return e.appConfig.appId}function De(e,t){return ve(this,void 0,void 0,(function(){var n,r,i,o,a,s;return ye(this,(function(u){switch(u.label){case 0:return[4,Fe(e)];case 1:n=u.sent(),r=Ue(t),i={method:"POST",headers:n,body:JSON.stringify(r)},u.label=2;case 2:return u.trys.push([2,5,,6]),[4,fetch(Me(e.appConfig),i)];case 3:return[4,u.sent().json()];case 4:return o=u.sent(),[3,6];case 5:throw a=u.sent(),Ee.create("token-subscribe-failed",{errorInfo:a});case 6:if(o.error)throw s=o.error.message,Ee.create("token-subscribe-failed",{errorInfo:s});if(!o.token)throw Ee.create("token-subscribe-no-token");return[2,o.token]}}))}))}function je(e,t){return ve(this,void 0,void 0,(function(){var n,r,i,o,a,s;return ye(this,(function(u){switch(u.label){case 0:return[4,Fe(e)];case 1:n=u.sent(),r=Ue(t.subscriptionOptions),i={method:"PATCH",headers:n,body:JSON.stringify(r)},u.label=2;case 2:return u.trys.push([2,5,,6]),[4,fetch(Me(e.appConfig)+"/"+t.token,i)];case 3:return[4,u.sent().json()];case 4:return o=u.sent(),[3,6];case 5:throw a=u.sent(),Ee.create("token-update-failed",{errorInfo:a});case 6:if(o.error)throw s=o.error.message,Ee.create("token-update-failed",{errorInfo:s});if(!o.token)throw Ee.create("token-update-no-token");return[2,o.token]}}))}))}function Le(e,t){return ve(this,void 0,void 0,(function(){var n,r,i,o,a;return ye(this,(function(s){switch(s.label){case 0:return[4,Fe(e)];case 1:n=s.sent(),r={method:"DELETE",headers:n},s.label=2;case 2:return s.trys.push([2,5,,6]),[4,fetch(Me(e.appConfig)+"/"+t,r)];case 3:return[4,s.sent().json()];case 4:if((i=s.sent()).error)throw o=i.error.message,Ee.create("token-unsubscribe-failed",{errorInfo:o});return[3,6];case 5:throw a=s.sent(),Ee.create("token-unsubscribe-failed",{errorInfo:a});case 6:return[2]}}))}))}function Me(e){return"https://fcmregistrations.googleapis.com/v1/projects/"+e.projectId+"/registrations"}function Fe(e){var t=e.appConfig,n=e.installations;return ve(this,void 0,void 0,(function(){var e;return ye(this,(function(r){switch(r.label){case 0:return[4,n.getToken()];case 1:return e=r.sent(),[2,new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":t.apiKey,"x-goog-firebase-installations-auth":"FIS "+e})]}}))}))}function Ue(e){var t=e.p256dh,n=e.auth,r=e.endpoint,i=e.vapidKey,o={web:{endpoint:r,auth:n,p256dh:t}};return i!==Te&&(o.web.applicationPubKey=i),o}function qe(e,t,n){return ve(this,void 0,void 0,(function(){var r,i,o,a;return ye(this,(function(s){switch(s.label){case 0:if("granted"!==Notification.permission)throw Ee.create("permission-blocked");return[4,ze(t,n)];case 1:return r=s.sent(),[4,Ne(e)];case 2:return i=s.sent(),o={vapidKey:n,swScope:t.scope,endpoint:r.endpoint,auth:Ie(r.getKey("auth")),p256dh:Ie(r.getKey("p256dh"))},i?[3,3]:[2,Ke(e,o)];case 3:if(function(e,t){var n=t.vapidKey===e.vapidKey,r=t.endpoint===e.endpoint,i=t.auth===e.auth,o=t.p256dh===e.p256dh;return n&&r&&i&&o}(i.subscriptionOptions,o))return[3,8];s.label=4;case 4:return s.trys.push([4,6,,7]),[4,Le(e,i.token)];case 5:return s.sent(),[3,7];case 6:return a=s.sent(),console.warn(a),[3,7];case 7:return[2,Ke(e,o)];case 8:return Date.now()>=i.createTime+6048e5?[2,Be({token:i.token,createTime:Date.now(),subscriptionOptions:o},e,t)]:[2,i.token];case 9:return[2]}}))}))}function Ve(e,t){return ve(this,void 0,void 0,(function(){var n,r;return ye(this,(function(i){switch(i.label){case 0:return[4,Ne(e)];case 1:return(n=i.sent())?[4,Le(e,n.token)]:[3,4];case 2:return i.sent(),[4,Ae(e)];case 3:i.sent(),i.label=4;case 4:return[4,t.pushManager.getSubscription()];case 5:return(r=i.sent())?[2,r.unsubscribe()]:[2,!0]}}))}))}function Be(e,t,n){return ve(this,void 0,void 0,(function(){var r,i,o;return ye(this,(function(a){switch(a.label){case 0:return a.trys.push([0,3,,5]),[4,je(t,e)];case 1:return r=a.sent(),i=pe(pe({},e),{token:r,createTime:Date.now()}),[4,Pe(t,i)];case 2:return a.sent(),[2,r];case 3:return o=a.sent(),[4,Ve(t,n)];case 4:throw a.sent(),o;case 5:return[2]}}))}))}function Ke(e,t){return ve(this,void 0,void 0,(function(){var n,r;return ye(this,(function(i){switch(i.label){case 0:return[4,De(e,t)];case 1:return n=i.sent(),r={token:n,createTime:Date.now(),subscriptionOptions:t},[4,Pe(e,r)];case 2:return i.sent(),[2,r.token]}}))}))}function ze(e,t){return ve(this,void 0,void 0,(function(){var n;return ye(this,(function(r){switch(r.label){case 0:return[4,e.pushManager.getSubscription()];case 1:return(n=r.sent())?[2,n]:[2,e.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:Se(t)})]}}))}))}function We(e){return"object"===typeof e&&!!e&&"google.c.a.c_id"in e}function He(e){return new Promise((function(t){setTimeout(t,e)}))}var Ge=function(){function e(e){var t=this;this.firebaseDependencies=e,this.isOnBackgroundMessageUsed=null,this.vapidKey=null,this.bgMessageHandler=null,self.addEventListener("push",(function(e){e.waitUntil(t.onPush(e))})),self.addEventListener("pushsubscriptionchange",(function(e){e.waitUntil(t.onSubChange(e))})),self.addEventListener("notificationclick",(function(e){e.waitUntil(t.onNotificationClick(e))}))}return Object.defineProperty(e.prototype,"app",{get:function(){return this.firebaseDependencies.app},enumerable:!1,configurable:!0}),e.prototype.setBackgroundMessageHandler=function(e){if(this.isOnBackgroundMessageUsed=!1,!e||"function"!==typeof e)throw Ee.create("invalid-bg-handler");this.bgMessageHandler=e},e.prototype.onBackgroundMessage=function(e){var t=this;return this.isOnBackgroundMessageUsed=!0,this.bgMessageHandler=e,function(){t.bgMessageHandler=null}},e.prototype.getToken=function(){var e,t;return ve(this,void 0,void 0,(function(){var n;return ye(this,(function(r){switch(r.label){case 0:return this.vapidKey?[3,2]:[4,Ne(this.firebaseDependencies)];case 1:n=r.sent(),this.vapidKey=null!==(t=null===(e=null===n||void 0===n?void 0:n.subscriptionOptions)||void 0===e?void 0:e.vapidKey)&&void 0!==t?t:Te,r.label=2;case 2:return[2,qe(this.firebaseDependencies,self.registration,this.vapidKey)]}}))}))},e.prototype.deleteToken=function(){return Ve(this.firebaseDependencies,self.registration)},e.prototype.requestPermission=function(){throw Ee.create("only-available-in-window")},e.prototype.usePublicVapidKey=function(e){if(null!==this.vapidKey)throw Ee.create("use-vapid-key-after-get-token");if("string"!==typeof e||0===e.length)throw Ee.create("invalid-vapid-key");this.vapidKey=e},e.prototype.useServiceWorker=function(){throw Ee.create("only-available-in-window")},e.prototype.onMessage=function(){throw Ee.create("only-available-in-window")},e.prototype.onTokenRefresh=function(){throw Ee.create("only-available-in-window")},e.prototype.onPush=function(e){return ve(this,void 0,void 0,(function(){var t,n,r,i;return ye(this,(function(o){switch(o.label){case 0:return(t=function(e){var t=e.data;if(!t)return null;try{return t.json()}catch(n){return null}}(e))?[4,Xe()]:(console.debug("FirebaseMessaging: failed to get parsed MessagePayload from the PushEvent. Skip handling the push."),[2]);case 1:return function(e){return e.some((function(e){return"visible"===e.visibilityState&&!e.url.startsWith("chrome-extension://")}))}(n=o.sent())?[2,Ye(n,t)]:(r=!1,t.notification?[4,Je(Qe(t))]:[3,3]);case 2:o.sent(),r=!0,o.label=3;case 3:return!0===r&&!1===this.isOnBackgroundMessageUsed?[2]:(this.bgMessageHandler&&(i=function(e){var t={from:e.from,collapseKey:e.collapse_key};return function(e,t){if(!t.notification)return;e.notification={};var n=t.notification.title;n&&(e.notification.title=n);var r=t.notification.body;r&&(e.notification.body=r);var i=t.notification.image;i&&(e.notification.image=i)}(t,e),function(e,t){if(!t.data)return;e.data=t.data}(t,e),function(e,t){if(!t.fcmOptions)return;e.fcmOptions={};var n=t.fcmOptions.link;n&&(e.fcmOptions.link=n);var r=t.fcmOptions.analytics_label;r&&(e.fcmOptions.analyticsLabel=r)}(t,e),t}(t),"function"===typeof this.bgMessageHandler?this.bgMessageHandler(i):this.bgMessageHandler.next(i)),[4,He(1e3)]);case 4:return o.sent(),[2]}}))}))},e.prototype.onSubChange=function(e){var t,n;return ve(this,void 0,void 0,(function(){var r;return ye(this,(function(i){switch(i.label){case 0:return e.newSubscription?[3,2]:[4,Ve(this.firebaseDependencies,self.registration)];case 1:return i.sent(),[2];case 2:return[4,Ne(this.firebaseDependencies)];case 3:return r=i.sent(),[4,Ve(this.firebaseDependencies,self.registration)];case 4:return i.sent(),[4,qe(this.firebaseDependencies,self.registration,null!==(n=null===(t=null===r||void 0===r?void 0:r.subscriptionOptions)||void 0===t?void 0:t.vapidKey)&&void 0!==n?n:Te)];case 5:return i.sent(),[2]}}))}))},e.prototype.onNotificationClick=function(e){var t,n;return ve(this,void 0,void 0,(function(){var r,i,o,a,s;return ye(this,(function(u){switch(u.label){case 0:return(r=null===(n=null===(t=e.notification)||void 0===t?void 0:t.data)||void 0===n?void 0:n.FCM_MSG)?e.action?[2]:(e.stopImmediatePropagation(),e.notification.close(),(i=function(e){var t,n,r,i=null!==(n=null===(t=e.fcmOptions)||void 0===t?void 0:t.link)&&void 0!==n?n:null===(r=e.notification)||void 0===r?void 0:r.click_action;if(i)return i;return We(e.data)?self.location.origin:null}(r))?(o=new URL(i,self.location.href),a=new URL(self.location.origin),o.host!==a.host?[2]:[4,$e(o)]):[2]):[2];case 1:return(s=u.sent())?[3,4]:[4,self.clients.openWindow(i)];case 2:return s=u.sent(),[4,He(3e3)];case 3:return u.sent(),[3,6];case 4:return[4,s.focus()];case 5:s=u.sent(),u.label=6;case 6:return s?(r.messageType=we.NOTIFICATION_CLICKED,r.isFirebaseMessaging=!0,[2,s.postMessage(r)]):[2]}}))}))},e}();function Qe(e){var t,n=pe({},e.notification);return n.data=((t={}).FCM_MSG=e,t),n}function $e(e){return ve(this,void 0,void 0,(function(){var t,n,r,i,o,a,s;return ye(this,(function(u){switch(u.label){case 0:return[4,Xe()];case 1:t=u.sent();try{for(n=ge(t),r=n.next();!r.done;r=n.next())if(i=r.value,o=new URL(i.url,self.location.href),e.host===o.host)return[2,i]}catch(c){a={error:c}}finally{try{r&&!r.done&&(s=n.return)&&s.call(n)}finally{if(a)throw a.error}}return[2,null]}}))}))}function Ye(e,t){var n,r;t.isFirebaseMessaging=!0,t.messageType=we.PUSH_RECEIVED;try{for(var i=ge(e),o=i.next();!o.done;o=i.next()){o.value.postMessage(t)}}catch(a){n={error:a}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}}function Xe(){return self.clients.matchAll({type:"window",includeUncontrolled:!0})}function Je(e){var t,n=e.actions,r=Notification.maxActions;return n&&r&&n.length>r&&console.warn("This browser only supports "+r+" actions. The remaining actions will not be displayed."),self.registration.showNotification(null!==(t=e.title)&&void 0!==t?t:"",e)}var Ze=function(){function e(e){var t=this;this.firebaseDependencies=e,this.vapidKey=null,this.onMessageCallback=null,navigator.serviceWorker.addEventListener("message",(function(e){return t.messageEventListener(e)}))}return Object.defineProperty(e.prototype,"app",{get:function(){return this.firebaseDependencies.app},enumerable:!1,configurable:!0}),e.prototype.messageEventListener=function(e){return ve(this,void 0,void 0,(function(){var t,n;return ye(this,(function(r){switch(r.label){case 0:return(t=e.data).isFirebaseMessaging?(this.onMessageCallback&&t.messageType===we.PUSH_RECEIVED&&("function"===typeof this.onMessageCallback?this.onMessageCallback(function(e){return delete e.messageType,delete e.isFirebaseMessaging,e}(Object.assign({},t))):this.onMessageCallback.next(Object.assign({},t))),We(n=t.data)&&"1"===n["google.c.a.e"]?[4,this.logEvent(t.messageType,n)]:[3,2]):[2];case 1:r.sent(),r.label=2;case 2:return[2]}}))}))},e.prototype.getVapidKey=function(){return this.vapidKey},e.prototype.getSwReg=function(){return this.swRegistration},e.prototype.getToken=function(e){return ve(this,void 0,void 0,(function(){return ye(this,(function(t){switch(t.label){case 0:return"default"!==Notification.permission?[3,2]:[4,Notification.requestPermission()];case 1:t.sent(),t.label=2;case 2:if("granted"!==Notification.permission)throw Ee.create("permission-blocked");return[4,this.updateVapidKey(null===e||void 0===e?void 0:e.vapidKey)];case 3:return t.sent(),[4,this.updateSwReg(null===e||void 0===e?void 0:e.serviceWorkerRegistration)];case 4:return t.sent(),[2,qe(this.firebaseDependencies,this.swRegistration,this.vapidKey)]}}))}))},e.prototype.updateVapidKey=function(e){return ve(this,void 0,void 0,(function(){return ye(this,(function(t){return e?this.vapidKey=e:this.vapidKey||(this.vapidKey=Te),[2]}))}))},e.prototype.updateSwReg=function(e){return ve(this,void 0,void 0,(function(){return ye(this,(function(t){switch(t.label){case 0:return e||this.swRegistration?[3,2]:[4,this.registerDefaultSw()];case 1:t.sent(),t.label=2;case 2:if(!e&&this.swRegistration)return[2];if(!(e instanceof ServiceWorkerRegistration))throw Ee.create("invalid-sw-registration");return this.swRegistration=e,[2]}}))}))},e.prototype.registerDefaultSw=function(){return ve(this,void 0,void 0,(function(){var e,t;return ye(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),e=this,[4,navigator.serviceWorker.register("/firebase-messaging-sw.js",{scope:"/firebase-cloud-messaging-push-scope"})];case 1:return e.swRegistration=n.sent(),this.swRegistration.update().catch((function(){})),[3,3];case 2:throw t=n.sent(),Ee.create("failed-service-worker-registration",{browserErrorMessage:t.message});case 3:return[2]}}))}))},e.prototype.deleteToken=function(){return ve(this,void 0,void 0,(function(){return ye(this,(function(e){switch(e.label){case 0:return this.swRegistration?[3,2]:[4,this.registerDefaultSw()];case 1:e.sent(),e.label=2;case 2:return[2,Ve(this.firebaseDependencies,this.swRegistration)]}}))}))},e.prototype.requestPermission=function(){return ve(this,void 0,void 0,(function(){var e;return ye(this,(function(t){switch(t.label){case 0:return"granted"===Notification.permission?[2]:[4,Notification.requestPermission()];case 1:if("granted"===(e=t.sent()))return[2];throw"denied"===e?Ee.create("permission-blocked"):Ee.create("permission-default")}}))}))},e.prototype.usePublicVapidKey=function(e){if(null!==this.vapidKey)throw Ee.create("use-vapid-key-after-get-token");if("string"!==typeof e||0===e.length)throw Ee.create("invalid-vapid-key");this.vapidKey=e},e.prototype.useServiceWorker=function(e){if(!(e instanceof ServiceWorkerRegistration))throw Ee.create("invalid-sw-registration");if(this.swRegistration)throw Ee.create("use-sw-after-get-token");this.swRegistration=e},e.prototype.onMessage=function(e){var t=this;return this.onMessageCallback=e,function(){t.onMessageCallback=null}},e.prototype.setBackgroundMessageHandler=function(){throw Ee.create("only-available-in-sw")},e.prototype.onBackgroundMessage=function(){throw Ee.create("only-available-in-sw")},e.prototype.onTokenRefresh=function(){return function(){}},e.prototype.logEvent=function(e,t){return ve(this,void 0,void 0,(function(){var n;return ye(this,(function(r){switch(r.label){case 0:return n=function(e){switch(e){case we.NOTIFICATION_CLICKED:return"notification_open";case we.PUSH_RECEIVED:return"notification_foreground";default:throw new Error}}(e),[4,this.firebaseDependencies.analyticsProvider.get()];case 1:return r.sent().logEvent(n,{message_id:t["google.c.a.c_id"],message_name:t["google.c.a.c_l"],message_time:t["google.c.a.ts"],message_device_time:Math.floor(Date.now()/1e3)}),[2]}}))}))},e}();function et(e){return Ee.create("missing-app-config-values",{valueName:e})}var tt={isSupported:nt};function nt(){return self&&"ServiceWorkerGlobalScope"in self?"indexedDB"in self&&null!==indexedDB&&"PushManager"in self&&"Notification"in self&&ServiceWorkerRegistration.prototype.hasOwnProperty("showNotification")&&PushSubscription.prototype.hasOwnProperty("getKey"):"indexedDB"in window&&null!==indexedDB&&navigator.cookieEnabled&&"serviceWorker"in navigator&&"PushManager"in window&&"Notification"in window&&"fetch"in window&&ServiceWorkerRegistration.prototype.hasOwnProperty("showNotification")&&PushSubscription.prototype.hasOwnProperty("getKey")}o.default.INTERNAL.registerComponent(new c.Component("messaging",(function(e){var t=e.getProvider("app").getImmediate(),n={app:t,appConfig:function(e){var t,n;if(!e||!e.options)throw et("App Configuration Object");if(!e.name)throw et("App Name");var r=e.options;try{for(var i=ge(["projectId","apiKey","appId","messagingSenderId"]),o=i.next();!o.done;o=i.next()){var a=o.value;if(!r[a])throw et(a)}}catch(s){t={error:s}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return{appName:e.name,projectId:r.projectId,apiKey:r.apiKey,appId:r.appId,senderId:r.messagingSenderId}}(t),installations:e.getProvider("installations").getImmediate(),analyticsProvider:e.getProvider("analytics-internal")};if(!nt())throw Ee.create("unsupported-browser");return self&&"ServiceWorkerGlobalScope"in self?new Ge(n):new Ze(n)}),"PUBLIC").setServiceProps(tt));var rt=function(e,t){return(rt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};var it=function(){return(it=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&o[o.length-1])&&(6===a[0]||2===a[0])){s=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]>6,128|63&r);else if(55296===(64512&r))if(n>18,128|r>>12&63,128|r>>6&63,128|63&r);else t.push(239,191,189);else 56320===(64512&r)?t.push(239,191,189):t.push(224|r>>12,128|r>>6&63,128|63&r)}return new Uint8Array(t)}function Et(e,t){switch(e){case mt.BASE64:var n=-1!==t.indexOf("-"),i=-1!==t.indexOf("_");if(n||i)throw yt(e,"Invalid character '"+(n?"-":"_")+"' found: is it base64url encoded?");break;case mt.BASE64URL:var o=-1!==t.indexOf("+"),a=-1!==t.indexOf("/");if(o||a)throw yt(e,"Invalid character '"+(o?"+":"/")+"' found: is it base64 encoded?");t=t.replace(/-/g,"+").replace(/_/g,"/")}var s;try{s=atob(t)}catch(r){throw yt(e,"Invalid character found")}for(var u=new Uint8Array(s.length),c=0;c][;base64],");var n=t[1]||null;null!=n&&(this.base64=(r=n,i=";base64",r.length>=i.length&&r.substring(r.length-i.length)===i),this.contentType=this.base64?n.substring(0,n.length-";base64".length):n),this.rest=e.substring(e.indexOf(",")+1);var r,i};var It,St={STATE_CHANGED:"state_changed"},kt={RUNNING:"running",PAUSED:"paused",SUCCESS:"success",CANCELED:"canceled",ERROR:"error"};function Ct(e){switch(e){case"running":case"pausing":case"canceling":return kt.RUNNING;case"paused":return kt.PAUSED;case"success":return kt.SUCCESS;case"canceled":return kt.CANCELED;case"error":default:return kt.ERROR}}!function(e){e[e.NO_ERROR=0]="NO_ERROR",e[e.NETWORK_ERROR=1]="NETWORK_ERROR",e[e.ABORT=2]="ABORT"}(It||(It={}));var Ot=function(){function e(){var e=this;this.sent_=!1,this.xhr_=new XMLHttpRequest,this.errorCode_=It.NO_ERROR,this.sendPromise_=new Promise((function(t){e.xhr_.addEventListener("abort",(function(){e.errorCode_=It.ABORT,t(e)})),e.xhr_.addEventListener("error",(function(){e.errorCode_=It.NETWORK_ERROR,t(e)})),e.xhr_.addEventListener("load",(function(){t(e)}))}))}return e.prototype.send=function(e,t,n,r){if(this.sent_)throw gt("cannot .send() more than once");if(this.sent_=!0,this.xhr_.open(t,e,!0),void 0!==r)for(var i in r)r.hasOwnProperty(i)&&this.xhr_.setRequestHeader(i,r[i].toString());return void 0!==n?this.xhr_.send(n):this.xhr_.send(),this.sendPromise_},e.prototype.getErrorCode=function(){if(!this.sent_)throw gt("cannot .getErrorCode() before sending");return this.errorCode_},e.prototype.getStatus=function(){if(!this.sent_)throw gt("cannot .getStatus() before sending");try{return this.xhr_.status}catch(r){return-1}},e.prototype.getResponseText=function(){if(!this.sent_)throw gt("cannot .getResponseText() before sending");return this.xhr_.responseText},e.prototype.abort=function(){this.xhr_.abort()},e.prototype.getResponseHeader=function(e){return this.xhr_.getResponseHeader(e)},e.prototype.addUploadProgressListener=function(e){null!=this.xhr_.upload&&this.xhr_.upload.addEventListener("progress",e)},e.prototype.removeUploadProgressListener=function(e){null!=this.xhr_.upload&&this.xhr_.upload.removeEventListener("progress",e)},e}(),xt=function(){function e(){}return e.prototype.createXhrIo=function(){return new Ot},e}(),Nt=function(){function e(e,t){this.bucket=e,this.path_=t}return Object.defineProperty(e.prototype,"path",{get:function(){return this.path_},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isRoot",{get:function(){return 0===this.path.length},enumerable:!1,configurable:!0}),e.prototype.fullServerUrl=function(){var e=encodeURIComponent;return"/b/"+e(this.bucket)+"/o/"+e(this.path)},e.prototype.bucketOnlyServerUrl=function(){return"/b/"+encodeURIComponent(this.bucket)+"/o"},e.makeFromBucketSpec=function(t,n){var i;try{i=e.makeFromUrl(t,n)}catch(r){return new e(t,"")}if(""===i.path)return i;throw new ut("invalid-default-bucket","Invalid default bucket '"+t+"'.")},e.makeFromUrl=function(t,n){var r=null;var i=new RegExp("^gs://([A-Za-z0-9.\\-_]+)(/(.*))?$","i");function o(e){e.path_=decodeURIComponent(e.path)}for(var a=n.replace(/[.]/g,"\\."),s=[{regex:i,indices:{bucket:1,path:3},postModify:function(e){"/"===e.path.charAt(e.path.length-1)&&(e.path_=e.path_.slice(0,-1))}},{regex:new RegExp("^https?://"+a+"/v[A-Za-z0-9_]+/b/([A-Za-z0-9.\\-_]+)/o(/([^?#]*).*)?$","i"),indices:{bucket:1,path:3},postModify:o},{regex:new RegExp("^https?://"+("firebasestorage.googleapis.com"===n?"(?:storage.googleapis.com|storage.cloud.google.com)":n)+"/([A-Za-z0-9.\\-_]+)/([^?#]*)","i"),indices:{bucket:1,path:2},postModify:o}],u=0;un)throw dt("Invalid value for '"+e+"'. Expected "+n+" or less.")}function Lt(e,t){var n=t.match(/^(\w+):\/\/.+/),r=t;return null==(null===n||void 0===n?void 0:n[1])&&(r="https://"+t),r+"/v0"+e}function Mt(e){var t=encodeURIComponent,n="?";for(var r in e){if(e.hasOwnProperty(r))n=n+(t(r)+"="+t(e[r]))+"&"}return n=n.slice(0,-1)}var Ft=function(){function e(e,t,n,r,i,o,a,s,u,c,l){var f=this;this.pendingXhr_=null,this.backoffId_=null,this.canceled_=!1,this.appDelete_=!1,this.url_=e,this.method_=t,this.headers_=n,this.body_=r,this.successCodes_=i.slice(),this.additionalRetryCodes_=o.slice(),this.callback_=a,this.errorCallback_=s,this.progressCallback_=c,this.timeout_=u,this.pool_=l,this.promise_=new Promise((function(e,t){f.resolve_=e,f.reject_=t,f.start_()}))}return e.prototype.start_=function(){var e=this;function t(t,n){var i,o=e.resolve_,a=e.reject_,s=n.xhr;if(n.wasSuccessCode)try{var u=e.callback_(s,s.getResponseText());void 0!==u?o(u):o()}catch(r){a(r)}else null!==s?((i=lt()).serverResponse=s.getResponseText(),e.errorCallback_?a(e.errorCallback_(s,i)):a(i)):n.canceled?a(i=e.appDelete_?pt():ft()):a(i=new ut("retry-limit-exceeded","Max retry time for operation exceeded, please try again."))}this.canceled_?t(0,new Ut(!1,null,!0)):this.backoffId_=function(e,t,n){var r=1,i=null,o=!1,a=0;function s(){return 2===a}var u=!1;function c(){for(var e=[],n=0;n=500&&e<600,n=-1!==[408,429].indexOf(e),r=-1!==this.additionalRetryCodes_.indexOf(e);return t||n||r},e}(),Ut=function(e,t,n){this.wasSuccessCode=e,this.xhr=t,this.canceled=!!n};function qt(){return"undefined"!==typeof BlobBuilder?BlobBuilder:"undefined"!==typeof WebKitBlobBuilder?WebKitBlobBuilder:void 0}function Vt(){for(var e=[],t=0;t0&&(o.delimiter=n),r&&(o.pageToken=r),i&&(o.maxResults=i);var a=Lt(t.bucketOnlyServerUrl(),e.host),s=e.maxOperationRetryTime,u=new Zt(a,"GET",function(e,t){return function(n,r){var i=Jt(e,t,r);return en(null!==i),i}}(e,t.bucket),s);return u.urlParams=o,u.errorHandler=rn(t),u}function un(e,t,n){var r=Object.assign({},n);return r.fullPath=e.path,r.size=t.size(),r.contentType||(r.contentType=function(e,t){return e&&e.contentType||t&&t.type()||"application/octet-stream"}(null,t)),r}var cn=function(e,t,n,r){this.current=e,this.total=t,this.finalized=!!n,this.metadata=r||null};function ln(e,t){var n=null;try{n=e.getResponseHeader("X-Goog-Upload-Status")}catch(r){en(!1)}return en(!!n&&-1!==(t||["active"]).indexOf(n)),n}function fn(e,t,n,r,i,o,a,s){var u=new cn(0,0);if(a?(u.current=a.current,u.total=a.total):(u.current=0,u.total=r.size()),r.size()!==u.total)throw new ut("server-file-wrong-size","Server recorded incorrect upload file size, please retry the upload.");var c=u.total-u.current,l=c;i>0&&(l=Math.min(l,i));var f=u.current,h=f+l,d={"X-Goog-Upload-Command":l===c?"upload, finalize":"upload","X-Goog-Upload-Offset":u.current},p=r.slice(f,h);if(null===p)throw ht();var v=t.maxUploadRetryTime,y=new Zt(n,"POST",(function(e,n){var i,a=ln(e,["active","final"]),s=u.current+l,c=r.size();return i="final"===a?tn(t,o)(e,n):null,new cn(s,c,"final"===a,i)}),v);return y.headers=d,y.body=p.uploadData(),y.progressCallback=s||null,y.errorHandler=rn(e),y}var hn=function(e,t,n){if("function"===typeof e||null!=t||null!=n)this.next=e,this.error=t,this.complete=n;else{var r=e;this.next=r.next,this.error=r.error,this.complete=r.complete}};function dn(e){return function(){for(var t=[],n=0;n262144},e.prototype._start=function(){"running"===this._state&&void 0===this._request&&(this._resumable?void 0===this._uploadUrl?this._createResumable():this._needToFetchStatus?this._fetchStatus():this._needToFetchMetadata?this._fetchMetadata():this._continueUpload():this._oneShotUpload())},e.prototype._resolveToken=function(e){var t=this;Promise.all([this._ref.storage._getAuthToken(),this._ref.storage._getAppCheckToken()]).then((function(n){var r=n[0],i=n[1];switch(t._state){case"running":e(r,i);break;case"canceling":t._transition("canceled");break;case"pausing":t._transition("paused")}}))},e.prototype._createResumable=function(){var e=this;this._resolveToken((function(t,n){var i=function(e,t,n,i,o){var a=t.bucketOnlyServerUrl(),s=un(t,i,o),u={name:s.fullPath},c=Lt(a,e.host),l={"X-Goog-Upload-Protocol":"resumable","X-Goog-Upload-Command":"start","X-Goog-Upload-Header-Content-Length":i.size(),"X-Goog-Upload-Header-Content-Type":s.contentType,"Content-Type":"application/json; charset=utf-8"},f=Xt(s,n),h=e.maxUploadRetryTime,d=new Zt(c,"POST",(function(e){var t;ln(e);try{t=e.getResponseHeader("X-Goog-Upload-URL")}catch(r){en(!1)}return en(At(t)),t}),h);return d.urlParams=u,d.headers=l,d.body=f,d.errorHandler=rn(t),d}(e._ref.storage,e._ref._location,e._mappings,e._blob,e._metadata),o=e._ref.storage._makeRequest(i,t,n);e._request=o,o.getPromise().then((function(t){e._request=void 0,e._uploadUrl=t,e._needToFetchStatus=!1,e.completeTransitions_()}),e._errorHandler)}))},e.prototype._fetchStatus=function(){var e=this,t=this._uploadUrl;this._resolveToken((function(n,i){var o=function(e,t,n,i){var o=e.maxUploadRetryTime,a=new Zt(n,"POST",(function(e){var t=ln(e,["active","final"]),n=null;try{n=e.getResponseHeader("X-Goog-Upload-Size-Received")}catch(r){en(!1)}n||en(!1);var o=Number(n);return en(!isNaN(o)),new cn(o,i.size(),"final"===t)}),o);return a.headers={"X-Goog-Upload-Command":"query"},a.errorHandler=rn(t),a}(e._ref.storage,e._ref._location,t,e._blob),a=e._ref.storage._makeRequest(o,n,i);e._request=a,a.getPromise().then((function(t){t=t,e._request=void 0,e._updateProgress(t.current),e._needToFetchStatus=!1,t.finalized&&(e._needToFetchMetadata=!0),e.completeTransitions_()}),e._errorHandler)}))},e.prototype._continueUpload=function(){var e=this,t=262144*this._chunkMultiplier,n=new cn(this._transferred,this._blob.size()),i=this._uploadUrl;this._resolveToken((function(o,a){var s;try{s=fn(e._ref._location,e._ref.storage,i,e._blob,t,e._mappings,n,e._makeProgressCallback())}catch(r){return e._error=r,void e._transition("error")}var u=e._ref.storage._makeRequest(s,o,a);e._request=u,u.getPromise().then((function(t){e._increaseMultiplier(),e._request=void 0,e._updateProgress(t.current),t.finalized?(e._metadata=t.metadata,e._transition("success")):e.completeTransitions_()}),e._errorHandler)}))},e.prototype._increaseMultiplier=function(){262144*this._chunkMultiplier<33554432&&(this._chunkMultiplier*=2)},e.prototype._fetchMetadata=function(){var e=this;this._resolveToken((function(t,n){var r=an(e._ref.storage,e._ref._location,e._mappings),i=e._ref.storage._makeRequest(r,t,n);e._request=i,i.getPromise().then((function(t){e._request=void 0,e._metadata=t,e._transition("success")}),e._metadataErrorHandler)}))},e.prototype._oneShotUpload=function(){var e=this;this._resolveToken((function(t,n){var r=function(e,t,n,r,i){var o=t.bucketOnlyServerUrl(),a={"X-Goog-Upload-Protocol":"multipart"},s=function(){for(var e="",t=0;t<2;t++)e+=Math.random().toString().slice(2);return e}();a["Content-Type"]="multipart/related; boundary="+s;var u=un(t,r,i),c="--"+s+"\r\nContent-Type: application/json; charset=utf-8\r\n\r\n"+Xt(u,n)+"\r\n--"+s+"\r\nContent-Type: "+u.contentType+"\r\n\r\n",l="\r\n--"+s+"--",f=Bt.getBlob(c,r,l);if(null===f)throw ht();var h={name:u.fullPath},d=Lt(o,e.host),p=e.maxUploadRetryTime,v=new Zt(d,"POST",tn(e,n),p);return v.urlParams=h,v.headers=a,v.body=f.uploadData(),v.errorHandler=rn(t),v}(e._ref.storage,e._ref._location,e._mappings,e._blob,e._metadata),i=e._ref.storage._makeRequest(r,t,n);e._request=i,i.getPromise().then((function(t){e._request=void 0,e._metadata=t,e._updateProgress(e._blob.size()),e._transition("success")}),e._errorHandler)}))},e.prototype._updateProgress=function(e){var t=this._transferred;this._transferred=e,this._transferred!==t&&this._notifyObservers()},e.prototype._transition=function(e){if(this._state!==e)switch(e){case"canceling":case"pausing":this._state=e,void 0!==this._request&&this._request.cancel();break;case"running":var t="paused"===this._state;this._state=e,t&&(this._notifyObservers(),this._start());break;case"paused":this._state=e,this._notifyObservers();break;case"canceled":this._error=ft(),this._state=e,this._notifyObservers();break;case"error":case"success":this._state=e,this._notifyObservers()}},e.prototype.completeTransitions_=function(){switch(this._state){case"pausing":this._transition("paused");break;case"canceling":this._transition("canceled");break;case"running":this._start()}},Object.defineProperty(e.prototype,"snapshot",{get:function(){var e=Ct(this._state);return{bytesTransferred:this._transferred,totalBytes:this._blob.size(),state:e,metadata:this._metadata,task:this,ref:this._ref}},enumerable:!1,configurable:!0}),e.prototype.on=function(e,t,n,r){var i=this,o=new hn(t,n,r);return this._addObserver(o),function(){i._removeObserver(o)}},e.prototype.then=function(e,t){return this._promise.then(e,t)},e.prototype.catch=function(e){return this.then(null,e)},e.prototype._addObserver=function(e){this._observers.push(e),this._notifyObserver(e)},e.prototype._removeObserver=function(e){var t=this._observers.indexOf(e);-1!==t&&this._observers.splice(t,1)},e.prototype._notifyObservers=function(){var e=this;this._finishPromise(),this._observers.slice().forEach((function(t){e._notifyObserver(t)}))},e.prototype._finishPromise=function(){if(void 0!==this._resolve){var e=!0;switch(Ct(this._state)){case kt.SUCCESS:dn(this._resolve.bind(null,this.snapshot))();break;case kt.CANCELED:case kt.ERROR:dn(this._reject.bind(null,this._error))();break;default:e=!1}e&&(this._resolve=void 0,this._reject=void 0)}},e.prototype._notifyObserver=function(e){switch(Ct(this._state)){case kt.RUNNING:case kt.PAUSED:e.next&&dn(e.next.bind(e,this.snapshot))();break;case kt.SUCCESS:e.complete&&dn(e.complete.bind(e))();break;case kt.CANCELED:case kt.ERROR:e.error&&dn(e.error.bind(e,this._error))();break;default:e.error&&dn(e.error.bind(e,this._error))()}},e.prototype.resume=function(){var e="paused"===this._state||"pausing"===this._state;return e&&this._transition("running"),e},e.prototype.pause=function(){var e="running"===this._state;return e&&this._transition("pausing"),e},e.prototype.cancel=function(){var e="running"===this._state||"pausing"===this._state;return e&&this._transition("canceling"),e},e}(),vn=function(){function e(e,t){this._service=e,this._location=t instanceof Nt?t:Nt.makeFromUrl(t,e.host)}return e.prototype.toString=function(){return"gs://"+this._location.bucket+"/"+this._location.path},e.prototype._newRef=function(t,n){return new e(t,n)},Object.defineProperty(e.prototype,"root",{get:function(){var e=new Nt(this._location.bucket,"");return this._newRef(this._service,e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"bucket",{get:function(){return this._location.bucket},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fullPath",{get:function(){return this._location.path},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"name",{get:function(){return zt(this._location.path)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"storage",{get:function(){return this._service},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){var t=function(e){if(0===e.length)return null;var t=e.lastIndexOf("/");return-1===t?"":e.slice(0,t)}(this._location.path);if(null===t)return null;var n=new Nt(this._location.bucket,t);return new e(this._service,n)},enumerable:!1,configurable:!0}),e.prototype._throwIfRoot=function(e){if(""===this._location.path)throw vt(e)},e}();function yn(e){var t={prefixes:[],items:[]};return function e(t,n,r){return ot(this,void 0,void 0,(function(){var i,o,a;return at(this,(function(s){switch(s.label){case 0:return[4,gn(t,{pageToken:r})];case 1:return i=s.sent(),(o=n.prefixes).push.apply(o,i.prefixes),(a=n.items).push.apply(a,i.items),null==i.nextPageToken?[3,3]:[4,e(t,n,i.nextPageToken)];case 2:s.sent(),s.label=3;case 3:return[2]}}))}))}(e,t).then((function(){return t}))}function gn(e,t){return ot(this,void 0,void 0,(function(){var n,r;return at(this,(function(i){switch(i.label){case 0:return null!=t&&"number"===typeof t.maxResults&&jt("options.maxResults",1,1e3,t.maxResults),n=t||{},r=sn(e.storage,e._location,"/",n.pageToken,n.maxResults),[4,e.storage.makeRequestWithTokens(r)];case 1:return[2,i.sent().getPromise()]}}))}))}function mn(e,t){return ot(this,void 0,void 0,(function(){var n;return at(this,(function(r){switch(r.label){case 0:return e._throwIfRoot("updateMetadata"),n=function(e,t,n,r){var i=Lt(t.fullServerUrl(),e.host),o=Xt(n,r),a=e.maxOperationRetryTime,s=new Zt(i,"PATCH",tn(e,r),a);return s.headers={"Content-Type":"application/json; charset=utf-8"},s.body=o,s.errorHandler=on(t),s}(e.storage,e._location,t,Qt()),[4,e.storage.makeRequestWithTokens(n)];case 1:return[2,r.sent().getPromise()]}}))}))}function bn(e){return ot(this,void 0,void 0,(function(){var t;return at(this,(function(n){switch(n.label){case 0:return e._throwIfRoot("getDownloadURL"),t=function(e,t,n){var r=Lt(t.fullServerUrl(),e.host),i=e.maxOperationRetryTime,o=new Zt(r,"GET",nn(e,n),i);return o.errorHandler=on(t),o}(e.storage,e._location,Qt()),[4,e.storage.makeRequestWithTokens(t)];case 1:return[2,n.sent().getPromise().then((function(e){if(null===e)throw new ut("no-download-url","The given file does not have any download URLs.");return e}))]}}))}))}function wn(e){return ot(this,void 0,void 0,(function(){var t;return at(this,(function(n){switch(n.label){case 0:return e._throwIfRoot("deleteObject"),t=function(e,t){var n=Lt(t.fullServerUrl(),e.host),r=e.maxOperationRetryTime,i=new Zt(n,"DELETE",(function(e,t){}),r);return i.successCodes=[200,204],i.errorHandler=on(t),i}(e.storage,e._location),[4,e.storage.makeRequestWithTokens(t)];case 1:return[2,n.sent().getPromise()]}}))}))}function _n(e,t){var n=function(e,t){var n=t.split("/").filter((function(e){return e.length>0})).join("/");return 0===e.length?n:e+"/"+n}(e._location.path,t),r=new Nt(e._location.bucket,n);return new vn(e.storage,r)}function En(e){return/^[A-Za-z]+:\/\//.test(e)}function Tn(e,t){if(e instanceof kn){var n=e;if(null==n._bucket)throw new ut("no-default-bucket","No default bucket found. Did you set the 'storageBucket' property when initializing the app?");var r=new vn(n,n._bucket);return null!=t?Tn(r,t):r}if(void 0!==t){if(t.includes(".."))throw dt('`path` param cannot contain ".."');return _n(e,t)}return e}function In(e,t){if(t&&En(t)){if(e instanceof kn)return new vn(e,t);throw dt("To use ref(service, url), the first argument must be a Storage instance.")}return Tn(e,t)}function Sn(e,t){var n=null===t||void 0===t?void 0:t.storageBucket;return null==n?null:Nt.makeFromBucketSpec(n,e)}var kn=function(){function e(e,t,n,r,i,o){this.app=e,this._authProvider=t,this._appCheckProvider=n,this._pool=r,this._url=i,this._firebaseVersion=o,this._bucket=null,this._host="firebasestorage.googleapis.com",this._appId=null,this._deleted=!1,this._maxOperationRetryTime=12e4,this._maxUploadRetryTime=6e5,this._requests=new Set,this._bucket=null!=i?Nt.makeFromBucketSpec(i,this._host):Sn(this._host,this.app.options)}return Object.defineProperty(e.prototype,"host",{get:function(){return this._host},set:function(e){this._host=e,null!=this._url?this._bucket=Nt.makeFromBucketSpec(this._url,e):this._bucket=Sn(e,this.app.options)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxUploadRetryTime",{get:function(){return this._maxUploadRetryTime},set:function(e){jt("time",0,Number.POSITIVE_INFINITY,e),this._maxUploadRetryTime=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxOperationRetryTime",{get:function(){return this._maxOperationRetryTime},set:function(e){jt("time",0,Number.POSITIVE_INFINITY,e),this._maxOperationRetryTime=e},enumerable:!1,configurable:!0}),e.prototype._getAuthToken=function(){return ot(this,void 0,void 0,(function(){var e,t;return at(this,(function(n){switch(n.label){case 0:return(e=this._authProvider.getImmediate({optional:!0}))?[4,e.getToken()]:[3,2];case 1:if(null!==(t=n.sent()))return[2,t.accessToken];n.label=2;case 2:return[2,null]}}))}))},e.prototype._getAppCheckToken=function(){return ot(this,void 0,void 0,(function(){var e;return at(this,(function(t){switch(t.label){case 0:return(e=this._appCheckProvider.getImmediate({optional:!0}))?[4,e.getToken()]:[3,2];case 1:return[2,t.sent().token];case 2:return[2,null]}}))}))},e.prototype._delete=function(){return this._deleted=!0,this._requests.forEach((function(e){return e.cancel()})),this._requests.clear(),Promise.resolve()},e.prototype._makeStorageReference=function(e){return new vn(this,e)},e.prototype._makeRequest=function(e,t,n){var r=this;if(this._deleted)return new Pt(pt());var i=function(e,t,n,r,i,o){var a=Mt(e.urlParams),s=e.url+a,u=Object.assign({},e.headers);return function(e,t){t&&(e["X-Firebase-GMPID"]=t)}(u,t),function(e,t){null!==t&&t.length>0&&(e.Authorization="Firebase "+t)}(u,n),function(e,t){e["X-Firebase-Storage-Version"]="webjs/"+(null!==t&&void 0!==t?t:"AppManager")}(u,o),function(e,t){null!==t&&(e["X-Firebase-AppCheck"]=t)}(u,r),new Ft(s,e.method,u,e.body,e.successCodes,e.additionalRetryCodes,e.handler,e.errorHandler,e.timeout,e.progressCallback,i)}(e,this._appId,t,n,this._pool,this._firebaseVersion);return this._requests.add(i),i.getPromise().then((function(){return r._requests.delete(i)}),(function(){return r._requests.delete(i)})),i},e.prototype.makeRequestWithTokens=function(e){return ot(this,void 0,void 0,(function(){var t,n,r;return at(this,(function(i){switch(i.label){case 0:return[4,Promise.all([this._getAuthToken(),this._getAppCheckToken()])];case 1:return t=i.sent(),n=t[0],r=t[1],[2,this._makeRequest(e,n,r)]}}))}))},e}();function Cn(e,t,n){return function(e,t,n){return e._throwIfRoot("uploadBytesResumable"),new pn(e,new Bt(t),n)}(e=Object(a.getModularInstance)(e),t,n)}function On(e){return function(e){return ot(this,void 0,void 0,(function(){var t;return at(this,(function(n){switch(n.label){case 0:return e._throwIfRoot("getMetadata"),t=an(e.storage,e._location,Qt()),[4,e.storage.makeRequestWithTokens(t)];case 1:return[2,n.sent().getPromise()]}}))}))}(e=Object(a.getModularInstance)(e))}function xn(e,t){return In(e=Object(a.getModularInstance)(e),t)}var Nn=function(){function e(e,t,n){this._delegate=e,this.task=t,this.ref=n}return Object.defineProperty(e.prototype,"bytesTransferred",{get:function(){return this._delegate.bytesTransferred},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"metadata",{get:function(){return this._delegate.metadata},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return this._delegate.state},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"totalBytes",{get:function(){return this._delegate.totalBytes},enumerable:!1,configurable:!0}),e}(),Pn=function(){function e(e,t){this._delegate=e,this._ref=t,this.cancel=this._delegate.cancel.bind(this._delegate),this.catch=this._delegate.catch.bind(this._delegate),this.pause=this._delegate.pause.bind(this._delegate),this.resume=this._delegate.resume.bind(this._delegate)}return Object.defineProperty(e.prototype,"snapshot",{get:function(){return new Nn(this._delegate.snapshot,this,this._ref)},enumerable:!1,configurable:!0}),e.prototype.then=function(e,t){var n=this;return this._delegate.then((function(t){if(e)return e(new Nn(t,n,n._ref))}),t)},e.prototype.on=function(e,t,n,r){var i=this,o=void 0;return t&&(o="function"===typeof t?function(e){return t(new Nn(e,i,i._ref))}:{next:t.next?function(e){return t.next(new Nn(e,i,i._ref))}:void 0,complete:t.complete||void 0,error:t.error||void 0}),this._delegate.on(e,o,n||void 0,r||void 0)},e}(),An=function(){function e(e,t){this._delegate=e,this._service=t}return Object.defineProperty(e.prototype,"prefixes",{get:function(){var e=this;return this._delegate.prefixes.map((function(t){return new Rn(t,e._service)}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"items",{get:function(){var e=this;return this._delegate.items.map((function(t){return new Rn(t,e._service)}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nextPageToken",{get:function(){return this._delegate.nextPageToken||null},enumerable:!1,configurable:!0}),e}(),Rn=function(){function e(e,t){this._delegate=e,this.storage=t}return Object.defineProperty(e.prototype,"name",{get:function(){return this._delegate.name},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"bucket",{get:function(){return this._delegate.bucket},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fullPath",{get:function(){return this._delegate.fullPath},enumerable:!1,configurable:!0}),e.prototype.toString=function(){return this._delegate.toString()},e.prototype.child=function(t){return new e(function(e,t){return _n(e,t)}(this._delegate,t),this.storage)},Object.defineProperty(e.prototype,"root",{get:function(){return new e(this._delegate.root,this.storage)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){var t=this._delegate.parent;return null==t?null:new e(t,this.storage)},enumerable:!1,configurable:!0}),e.prototype.put=function(e,t){return this._throwIfRoot("put"),new Pn(Cn(this._delegate,e,t),this)},e.prototype.putString=function(e,t,n){void 0===t&&(t=mt.RAW),this._throwIfRoot("putString");var r=wt(t,e),i=it({},n);return null==i.contentType&&null!=r.contentType&&(i.contentType=r.contentType),new Pn(new pn(this._delegate,new Bt(r.data,!0),i),this)},e.prototype.listAll=function(){var e,t=this;return(e=this._delegate,yn(e=Object(a.getModularInstance)(e))).then((function(e){return new An(e,t.storage)}))},e.prototype.list=function(e){var t=this;return function(e,t){return gn(e=Object(a.getModularInstance)(e),t)}(this._delegate,e||void 0).then((function(e){return new An(e,t.storage)}))},e.prototype.getMetadata=function(){return On(this._delegate)},e.prototype.updateMetadata=function(e){return function(e,t){return mn(e=Object(a.getModularInstance)(e),t)}(this._delegate,e)},e.prototype.getDownloadURL=function(){return e=this._delegate,bn(e=Object(a.getModularInstance)(e));var e},e.prototype.delete=function(){return this._throwIfRoot("delete"),e=this._delegate,wn(e=Object(a.getModularInstance)(e));var e},e.prototype._throwIfRoot=function(e){if(""===this._delegate._location.path)throw vt(e)},e}(),Dn=function(){function e(e,t){var n=this;this.app=e,this._delegate=t,this.INTERNAL={delete:function(){return n._delegate._delete()}}}return Object.defineProperty(e.prototype,"maxOperationRetryTime",{get:function(){return this._delegate.maxOperationRetryTime},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxUploadRetryTime",{get:function(){return this._delegate.maxUploadRetryTime},enumerable:!1,configurable:!0}),e.prototype.ref=function(e){if(En(e))throw dt("ref() expected a child path but got a URL, use refFromURL instead.");return new Rn(xn(this._delegate,e),this)},e.prototype.refFromURL=function(e){if(!En(e))throw dt("refFromURL() expected a full URL but got a child path, use ref() instead.");try{Nt.makeFromUrl(e,this._delegate.host)}catch(r){throw dt("refFromUrl() expected a valid full URL but got an invalid one.")}return new Rn(xn(this._delegate,e),this)},e.prototype.setMaxUploadRetryTime=function(e){this._delegate.maxUploadRetryTime=e},e.prototype.setMaxOperationRetryTime=function(e){this._delegate.maxOperationRetryTime=e},e.prototype.useEmulator=function(e,t){!function(e,t,n){e.host="http://"+t+":"+n}(this._delegate,e,t)},e}();function jn(e,t){var n=t.instanceIdentifier,r=e.getProvider("app").getImmediate(),i=e.getProvider("auth-internal"),a=e.getProvider("app-check-internal");return new Dn(r,new kn(r,i,a,new xt,n,o.default.SDK_VERSION))}!function(e){var t={TaskState:kt,TaskEvent:St,StringFormat:mt,Storage:kn,Reference:Rn};e.INTERNAL.registerComponent(new c.Component("storage",jn,"PUBLIC").setServiceProps(t).setMultipleInstances(!0)),e.registerVersion("@firebase/storage","0.5.5")}(o.default);var Ln=function(){return(Ln=Object.assign||function(e){for(var t,n=1,r=arguments.length;n1)throw Bn.create("invalid String merger input");for(var r=[],i=0;ii&&r.push(t.charAt(i));return r.join("")}var Gn,Qn,$n=function(){function e(){this.instrumentationEnabled=!0,this.dataCollectionEnabled=!0,this.loggingEnabled=!1,this.tracesSamplingRate=1,this.networkRequestsSamplingRate=1,this.logEndPointUrl="https://firebaselogging.googleapis.com/v0cc/log?format=json_proto",this.flTransportEndpointUrl=Hn("hts/frbslgigp.ogepscmv/ieo/eaylg","tp:/ieaeogn-agolai.o/1frlglgc/o"),this.transportKey=Hn("AzSC8r6ReiGqFMyfvgow","Iayx0u-XT3vksVM-pIV"),this.logSource=462,this.logTraceAfterSampling=!1,this.logNetworkAfterSampling=!1,this.configTimeToLive=12}return e.prototype.getAppId=function(){var e=this.firebaseAppInstance&&this.firebaseAppInstance.options&&this.firebaseAppInstance.options.appId;if(!e)throw Bn.create("no app id");return e},e.prototype.getProjectId=function(){var e=this.firebaseAppInstance&&this.firebaseAppInstance.options&&this.firebaseAppInstance.options.projectId;if(!e)throw Bn.create("no project id");return e},e.prototype.getApiKey=function(){var e=this.firebaseAppInstance&&this.firebaseAppInstance.options&&this.firebaseAppInstance.options.apiKey;if(!e)throw Bn.create("no api key");return e},e.prototype.getFlTransportFullUrl=function(){return this.flTransportEndpointUrl.concat("?key=",this.transportKey)},e.getInstance=function(){return void 0===zn&&(zn=new e),zn},e}();function Yn(){return Gn}!function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.VISIBLE=1]="VISIBLE",e[e.HIDDEN=2]="HIDDEN"}(Qn||(Qn={}));var Xn=["firebase_","google_","ga_"],Jn=new RegExp("^[a-zA-Z]\\w*$");function Zn(){var e=Wn.getInstance().navigator;return"serviceWorker"in e?e.serviceWorker.controller?2:3:1}function er(){switch(Wn.getInstance().document.visibilityState){case"visible":return Qn.VISIBLE;case"hidden":return Qn.HIDDEN;default:return Qn.UNKNOWN}}function tr(){var e=Wn.getInstance().navigator.connection;switch(e&&e.effectiveType){case"slow-2g":return 1;case"2g":return 2;case"3g":return 3;case"4g":return 4;default:return 0}}var nr=!0;function rr(e){var t=function(){var e=Wn.getInstance().localStorage;if(!e)return;var t=e.getItem("@firebase/performance/configexpire");if(!t||(n=t,!(Number(n)>Date.now())))return;var n;var r=e.getItem("@firebase/performance/config");if(!r)return;try{return JSON.parse(r)}catch(i){return}}();return t?(ir(t),Promise.resolve()):function(e){return function(){var e=$n.getInstance().installationsService.getToken();return e.then((function(e){})),e}().then((function(t){var n="https://firebaseremoteconfig.googleapis.com/v1/projects/"+$n.getInstance().getProjectId()+"/namespaces/fireperf:fetch?key="+$n.getInstance().getApiKey(),r=new Request(n,{method:"POST",headers:{Authorization:"FIREBASE_INSTALLATIONS_AUTH "+t},body:JSON.stringify({app_instance_id:e,app_instance_id_token:t,app_id:$n.getInstance().getAppId(),app_version:"0.4.15",sdk_version:"0.0.1"})});return fetch(r).then((function(e){if(e.ok)return e.json();throw Bn.create("RC response not ok")}))})).catch((function(){Kn.info("Could not fetch config, will use default configs")}))}(e).then(ir).then((function(e){return function(e){var t=Wn.getInstance().localStorage;if(!e||!t)return;t.setItem("@firebase/performance/config",JSON.stringify(e)),t.setItem("@firebase/performance/configexpire",String(Date.now()+60*$n.getInstance().configTimeToLive*60*1e3))}(e)}),(function(){}))}function ir(e){if(!e)return e;var t=$n.getInstance(),n=e.entries||{};return void 0!==n.fpr_enabled?t.loggingEnabled="true"===String(n.fpr_enabled):t.loggingEnabled=nr,n.fpr_log_source&&(t.logSource=Number(n.fpr_log_source)),n.fpr_log_endpoint_url&&(t.logEndPointUrl=n.fpr_log_endpoint_url),n.fpr_log_transport_key&&(t.transportKey=n.fpr_log_transport_key),void 0!==n.fpr_vc_network_request_sampling_rate&&(t.networkRequestsSamplingRate=Number(n.fpr_vc_network_request_sampling_rate)),void 0!==n.fpr_vc_trace_sampling_rate&&(t.tracesSamplingRate=Number(n.fpr_vc_trace_sampling_rate)),t.logTraceAfterSampling=or(t.tracesSamplingRate),t.logNetworkAfterSampling=or(t.networkRequestsSamplingRate),e}function or(e){return Math.random()<=e}var ar,sr=1;function ur(){return sr=2,ar=ar||function(){var e=Wn.getInstance().document;return new Promise((function(t){e&&"complete"!==e.readyState?e.addEventListener("readystatechange",(function n(){"complete"===e.readyState&&(e.removeEventListener("readystatechange",n),t())})):t()}))}().then((function(){return function(){var e=$n.getInstance().installationsService.getId();return e.then((function(e){Gn=e})),e}()})).then((function(e){return rr(e)})).then((function(){return cr()}),(function(){return cr()}))}function cr(){sr=3}var lr,fr=3,hr=[],dr=!1;function pr(e){setTimeout((function(){if(0!==fr)return hr.length?void function(){var e=hr.splice(0,1e3),t=e.map((function(e){return{source_extension_json_proto3:e.message,event_time_ms:String(e.eventTime)}}));(function(e,t){return function(e){var t=$n.getInstance().getFlTransportFullUrl();return fetch(t,{method:"POST",body:JSON.stringify(e)})}(e).then((function(e){return e.ok||Kn.info("Call to Firebase backend failed."),e.json()})).then((function(e){var n=Number(e.nextRequestWaitMillis),r=1e4;isNaN(n)||(r=Math.max(n,r));var i=e.logResponseDetails;Array.isArray(i)&&i.length>0&&"RETRY_REQUEST_LATER"===i[0].responseAction&&(hr=Mn(Mn([],t),hr),Kn.info("Retry transport request later.")),fr=3,pr(r)}))})({request_time_ms:String(Date.now()),client_info:{client_type:1,js_client_info:{}},log_source:$n.getInstance().logSource,log_event:t},e).catch((function(){hr=Mn(Mn([],e),hr),fr--,Kn.info("Tries left: "+fr+"."),pr(1e4)}))}():pr(1e4)}),e)}function vr(e){if(!e.eventTime||!e.message)throw Bn.create("invalid cc log");hr=Mn(Mn([],hr),[e])}function yr(e,t){lr||(lr=function(e){return function(){for(var t=[],n=0;n100||!(r&&r.startsWith("_wt_")&&_r.indexOf(n)>-1)&&n.startsWith("_"))throw Bn.create("invalid custom metric name",{customMetricName:e});var n,r;this.counters[e]=function(e){var t=Math.floor(e);return t40)&&!Xn.some((function(e){return n.startsWith(e)}))&&!!n.match(Jn),i=function(e){return 0!==e.length&&e.length<=100}(t);if(r&&i)this.customAttributes[e]=t;else{if(!r)throw Bn.create("invalid attribute name",{attributeName:e});if(!i)throw Bn.create("invalid attribute value",{attributeValue:t})}},e.prototype.getAttribute=function(e){return this.customAttributes[e]},e.prototype.removeAttribute=function(e){void 0!==this.customAttributes[e]&&delete this.customAttributes[e]},e.prototype.getAttributes=function(){return Ln({},this.customAttributes)},e.prototype.setStartTime=function(e){this.startTimeUs=e},e.prototype.setDuration=function(e){this.durationUs=e},e.prototype.calculateTraceMetrics=function(){var e=this.api.getEntriesByName(this.traceMeasure),t=e&&e[0];t&&(this.durationUs=Math.floor(1e3*t.duration),this.startTimeUs=Math.floor(1e3*(t.startTime+this.api.getTimeOrigin())))},e.createOobTrace=function(t,n,r){var i=Wn.getInstance().getUrl();if(i){var o=new e("_wt_"+i,!0),a=Math.floor(1e3*Wn.getInstance().getTimeOrigin());o.setStartTime(a),t&&t[0]&&(o.setDuration(Math.floor(1e3*t[0].duration)),o.putMetric("domInteractive",Math.floor(1e3*t[0].domInteractive)),o.putMetric("domContentLoadedEventEnd",Math.floor(1e3*t[0].domContentLoadedEventEnd)),o.putMetric("loadEventEnd",Math.floor(1e3*t[0].loadEventEnd)));if(n){var s=n.find((function(e){return"first-paint"===e.name}));s&&s.startTime&&o.putMetric("_fp",Math.floor(1e3*s.startTime));var u=n.find((function(e){return"first-contentful-paint"===e.name}));u&&u.startTime&&o.putMetric("_fcp",Math.floor(1e3*u.startTime)),r&&o.putMetric("_fid",Math.floor(1e3*r))}gr(o)}},e.createUserTimingTrace=function(t){gr(new e(t,!1,t))},e}();function Tr(e){var t=e;if(t&&void 0!==t.responseStart){var n=Wn.getInstance().getTimeOrigin(),r=Math.floor(1e3*(t.startTime+n)),i=t.responseStart?Math.floor(1e3*(t.responseStart-t.startTime)):void 0,o=Math.floor(1e3*(t.responseEnd-t.startTime));!function(e){var t=$n.getInstance();if(t.instrumentationEnabled){var n=e.url,r=t.logEndPointUrl.split("?")[0],i=t.flTransportEndpointUrl.split("?")[0];n!==r&&n!==i&&t.loggingEnabled&&t.logNetworkAfterSampling&&setTimeout((function(){return yr(e,0)}),0)}}({url:t.name&&t.name.split("?")[0],responsePayloadBytes:t.transferSize,startTimeUs:r,timeToResponseInitiatedUs:i,timeToResponseCompletedUs:o})}}function Ir(){Yn()&&(setTimeout((function(){return function(){var e=Wn.getInstance(),t=e.getEntriesByType("navigation"),n=e.getEntriesByType("paint");if(e.onFirstInputDelay){var r=setTimeout((function(){Er.createOobTrace(t,n),r=void 0}),5e3);e.onFirstInputDelay((function(e){r&&(clearTimeout(r),Er.createOobTrace(t,n,e))}))}else Er.createOobTrace(t,n)}()}),0),setTimeout((function(){return function(){for(var e=Wn.getInstance(),t=e.getEntriesByType("resource"),n=0,r=t;n0&&o[o.length-1])&&(6===a[0]||2===a[0])){s=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]0){var t=e.map((function(e,t){return"("+(t+1)+") "+e})).join(" "),n=Ur.create("invalid-analytics-context",{errorInfo:t});Dr.warn(n.message)}}();var n=e.options.appId;if(!n)throw Ur.create("no-app-id");if(!e.options.apiKey){if(!e.options.measurementId)throw Ur.create("no-api-key");Dr.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!=$r[n])throw Ur.create("already-exists",{id:n});if(!ei){!function(e){var t=[];Array.isArray(window[e])?t=window[e]:window[e]=t}(Jr);var r=Mr($r,Yr,Xr,Jr,Zr),i=r.wrappedGtag,o=r.gtagCore;Qr=i,Gr=o,ei=!0}return $r[n]=Hr(e,Yr,Xr,t,Gr,Jr),{app:e,logEvent:function(e,t,r){(function(e,t,n,r,i){return Or(this,void 0,void 0,(function(){var o,a;return xr(this,(function(s){switch(s.label){case 0:return i&&i.global?(e(Nr.EVENT,n,r),[2]):[3,1];case 1:return[4,t];case 2:o=s.sent(),a=Cr(Cr({},r),{send_to:o}),e(Nr.EVENT,n,a),s.label=3;case 3:return[2]}}))}))})(Qr,$r[n],e,t,r).catch((function(e){return Dr.error(e)}))},setCurrentScreen:function(e,t){(function(e,t,n,r){return Or(this,void 0,void 0,(function(){var i;return xr(this,(function(o){switch(o.label){case 0:return r&&r.global?(e(Nr.SET,{screen_name:n}),[2,Promise.resolve()]):[3,1];case 1:return[4,t];case 2:i=o.sent(),e(Nr.CONFIG,i,{update:!0,screen_name:n}),o.label=3;case 3:return[2]}}))}))})(Qr,$r[n],e,t).catch((function(e){return Dr.error(e)}))},setUserId:function(e,t){(function(e,t,n,r){return Or(this,void 0,void 0,(function(){var i;return xr(this,(function(o){switch(o.label){case 0:return r&&r.global?(e(Nr.SET,{user_id:n}),[2,Promise.resolve()]):[3,1];case 1:return[4,t];case 2:i=o.sent(),e(Nr.CONFIG,i,{update:!0,user_id:n}),o.label=3;case 3:return[2]}}))}))})(Qr,$r[n],e,t).catch((function(e){return Dr.error(e)}))},setUserProperties:function(e,t){(function(e,t,n,r){return Or(this,void 0,void 0,(function(){var i,o,a,s,u;return xr(this,(function(c){switch(c.label){case 0:if(!r||!r.global)return[3,1];for(i={},o=0,a=Object.keys(n);o0&&o[o.length-1])&&(6===a[0]||2===a[0])){s=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]=0},e.prototype.asNumber=function(){if("static"===this._source)return 0;var e=Number(this._value);return isNaN(e)&&(e=0),e},e.prototype.getSource=function(){return this._source},e}(),vi=function(){function e(e,t,n,r,i){this.app=e,this._client=t,this._storageCache=n,this._storage=r,this._logger=i,this._isInitializationComplete=!1,this.settings={fetchTimeoutMillis:6e4,minimumFetchIntervalMillis:432e5},this.defaultConfig={}}return e.prototype.setLogLevel=function(e){switch(e){case"debug":this._logger.logLevel=s.LogLevel.DEBUG;break;case"silent":this._logger.logLevel=s.LogLevel.SILENT;break;default:this._logger.logLevel=s.LogLevel.ERROR}},Object.defineProperty(e.prototype,"fetchTimeMillis",{get:function(){return this._storageCache.getLastSuccessfulFetchTimestampMillis()||-1},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastFetchStatus",{get:function(){return this._storageCache.getLastFetchStatus()||"no-fetch-yet"},enumerable:!1,configurable:!0}),e.prototype.activate=function(){return oi(this,void 0,void 0,(function(){var e,t,n;return ai(this,(function(r){switch(r.label){case 0:return[4,Promise.all([this._storage.getLastSuccessfulFetchResponse(),this._storage.getActiveConfigEtag()])];case 1:return e=r.sent(),t=e[0],n=e[1],t&&t.config&&t.eTag&&t.eTag!==n?[4,Promise.all([this._storageCache.setActiveConfig(t.config),this._storage.setActiveConfigEtag(t.eTag)])]:[2,!1];case 2:return r.sent(),[2,!0]}}))}))},e.prototype.ensureInitialized=function(){var e=this;return this._initializePromise||(this._initializePromise=this._storageCache.loadFromStorage().then((function(){e._isInitializationComplete=!0}))),this._initializePromise},e.prototype.fetch=function(){return oi(this,void 0,void 0,(function(){var e,t,n,r=this;return ai(this,(function(i){switch(i.label){case 0:e=new hi,setTimeout((function(){return oi(r,void 0,void 0,(function(){return ai(this,(function(t){return e.abort(),[2]}))}))}),this.settings.fetchTimeoutMillis),i.label=1;case 1:return i.trys.push([1,4,,6]),[4,this._client.fetch({cacheMaxAgeMillis:this.settings.minimumFetchIntervalMillis,signal:e})];case 2:return i.sent(),[4,this._storageCache.setLastFetchStatus("success")];case 3:return i.sent(),[3,6];case 4:return t=i.sent(),n=function(e,t){return e instanceof a.FirebaseError&&-1!==e.code.indexOf(t)}(t,"fetch-throttle")?"throttle":"failure",[4,this._storageCache.setLastFetchStatus(n)];case 5:throw i.sent(),t;case 6:return[2]}}))}))},e.prototype.fetchAndActivate=function(){return oi(this,void 0,void 0,(function(){return ai(this,(function(e){switch(e.label){case 0:return[4,this.fetch()];case 1:return e.sent(),[2,this.activate()]}}))}))},e.prototype.getAll=function(){var e=this;return function(e,t){void 0===e&&(e={});void 0===t&&(t={});return Object.keys(ii(ii({},e),t))}(this._storageCache.getActiveConfig(),this.defaultConfig).reduce((function(t,n){return t[n]=e.getValue(n),t}),{})},e.prototype.getBoolean=function(e){return this.getValue(e).asBoolean()},e.prototype.getNumber=function(e){return this.getValue(e).asNumber()},e.prototype.getString=function(e){return this.getValue(e).asString()},e.prototype.getValue=function(e){this._isInitializationComplete||this._logger.debug('A value was requested for key "'+e+'" before SDK initialization completed. Await on ensureInitialized if the intent was to get a previously activated value.');var t=this._storageCache.getActiveConfig();return t&&void 0!==t[e]?new pi("remote",t[e]):this.defaultConfig&&void 0!==this.defaultConfig[e]?new pi("default",String(this.defaultConfig[e])):(this._logger.debug('Returning static value for key "'+e+'". Define a default or remote value if this is unintentional.'),new pi("static"))},e}();function yi(e,t){var n=e.target.error||void 0;return li.create(t,{originalErrorMessage:n&&n.message})}var gi=function(){function e(e,t,n,r){void 0===r&&(r=new Promise((function(e,t){var n=indexedDB.open("firebase_remote_config",1);n.onerror=function(e){t(yi(e,"storage-open"))},n.onsuccess=function(t){e(t.target.result)},n.onupgradeneeded=function(e){var t=e.target.result;switch(e.oldVersion){case 0:t.createObjectStore("app_namespace_store",{keyPath:"compositeKey"})}}}))),this.appId=e,this.appName=t,this.namespace=n,this.openDbPromise=r}return e.prototype.getLastFetchStatus=function(){return this.get("last_fetch_status")},e.prototype.setLastFetchStatus=function(e){return this.set("last_fetch_status",e)},e.prototype.getLastSuccessfulFetchTimestampMillis=function(){return this.get("last_successful_fetch_timestamp_millis")},e.prototype.setLastSuccessfulFetchTimestampMillis=function(e){return this.set("last_successful_fetch_timestamp_millis",e)},e.prototype.getLastSuccessfulFetchResponse=function(){return this.get("last_successful_fetch_response")},e.prototype.setLastSuccessfulFetchResponse=function(e){return this.set("last_successful_fetch_response",e)},e.prototype.getActiveConfig=function(){return this.get("active_config")},e.prototype.setActiveConfig=function(e){return this.set("active_config",e)},e.prototype.getActiveConfigEtag=function(){return this.get("active_config_etag")},e.prototype.setActiveConfigEtag=function(e){return this.set("active_config_etag",e)},e.prototype.getThrottleMetadata=function(){return this.get("throttle_metadata")},e.prototype.setThrottleMetadata=function(e){return this.set("throttle_metadata",e)},e.prototype.deleteThrottleMetadata=function(){return this.delete("throttle_metadata")},e.prototype.get=function(e){return oi(this,void 0,void 0,(function(){var t,n=this;return ai(this,(function(i){switch(i.label){case 0:return[4,this.openDbPromise];case 1:return t=i.sent(),[2,new Promise((function(i,o){var a=t.transaction(["app_namespace_store"],"readonly").objectStore("app_namespace_store"),s=n.createCompositeKey(e);try{var u=a.get(s);u.onerror=function(e){o(yi(e,"storage-get"))},u.onsuccess=function(e){var t=e.target.result;i(t?t.value:void 0)}}catch(r){o(li.create("storage-get",{originalErrorMessage:r&&r.message}))}}))]}}))}))},e.prototype.set=function(e,t){return oi(this,void 0,void 0,(function(){var n,i=this;return ai(this,(function(o){switch(o.label){case 0:return[4,this.openDbPromise];case 1:return n=o.sent(),[2,new Promise((function(o,a){var s=n.transaction(["app_namespace_store"],"readwrite").objectStore("app_namespace_store"),u=i.createCompositeKey(e);try{var c=s.put({compositeKey:u,value:t});c.onerror=function(e){a(yi(e,"storage-set"))},c.onsuccess=function(){o()}}catch(r){a(li.create("storage-set",{originalErrorMessage:r&&r.message}))}}))]}}))}))},e.prototype.delete=function(e){return oi(this,void 0,void 0,(function(){var t,n=this;return ai(this,(function(i){switch(i.label){case 0:return[4,this.openDbPromise];case 1:return t=i.sent(),[2,new Promise((function(i,o){var a=t.transaction(["app_namespace_store"],"readwrite").objectStore("app_namespace_store"),s=n.createCompositeKey(e);try{var u=a.delete(s);u.onerror=function(e){o(yi(e,"storage-delete"))},u.onsuccess=function(){i()}}catch(r){o(li.create("storage-delete",{originalErrorMessage:r&&r.message}))}}))]}}))}))},e.prototype.createCompositeKey=function(e){return[this.appId,this.appName,this.namespace,e].join()},e}(),mi=function(){function e(e){this.storage=e}return e.prototype.getLastFetchStatus=function(){return this.lastFetchStatus},e.prototype.getLastSuccessfulFetchTimestampMillis=function(){return this.lastSuccessfulFetchTimestampMillis},e.prototype.getActiveConfig=function(){return this.activeConfig},e.prototype.loadFromStorage=function(){return oi(this,void 0,void 0,(function(){var e,t,n,r,i,o;return ai(this,(function(a){switch(a.label){case 0:return e=this.storage.getLastFetchStatus(),t=this.storage.getLastSuccessfulFetchTimestampMillis(),n=this.storage.getActiveConfig(),[4,e];case 1:return(r=a.sent())&&(this.lastFetchStatus=r),[4,t];case 2:return(i=a.sent())&&(this.lastSuccessfulFetchTimestampMillis=i),[4,n];case 3:return(o=a.sent())&&(this.activeConfig=o),[2]}}))}))},e.prototype.setLastFetchStatus=function(e){return this.lastFetchStatus=e,this.storage.setLastFetchStatus(e)},e.prototype.setLastSuccessfulFetchTimestampMillis=function(e){return this.lastSuccessfulFetchTimestampMillis=e,this.storage.setLastSuccessfulFetchTimestampMillis(e)},e.prototype.setActiveConfig=function(e){return this.activeConfig=e,this.storage.setActiveConfig(e)},e}();function bi(e,t){return new Promise((function(n,r){var i=Math.max(t-Date.now(),0),o=setTimeout(n,i);e.addEventListener((function(){clearTimeout(o),r(li.create("fetch-throttle",{throttleEndTimeMillis:t}))}))}))}var wi,_i=function(){function e(e,t){this.client=e,this.storage=t}return e.prototype.fetch=function(e){return oi(this,void 0,void 0,(function(){var t;return ai(this,(function(n){switch(n.label){case 0:return[4,this.storage.getThrottleMetadata()];case 1:return t=n.sent()||{backoffCount:0,throttleEndTimeMillis:Date.now()},[2,this.attemptFetch(e,t)]}}))}))},e.prototype.attemptFetch=function(e,t){var n=t.throttleEndTimeMillis,r=t.backoffCount;return oi(this,void 0,void 0,(function(){var t,i,o;return ai(this,(function(s){switch(s.label){case 0:return[4,bi(e.signal,n)];case 1:s.sent(),s.label=2;case 2:return s.trys.push([2,5,,7]),[4,this.client.fetch(e)];case 3:return t=s.sent(),[4,this.storage.deleteThrottleMetadata()];case 4:return s.sent(),[2,t];case 5:if(!function(e){if(!(e instanceof a.FirebaseError)||!e.customData)return!1;var t=Number(e.customData.httpStatus);return 429===t||500===t||503===t||504===t}(i=s.sent()))throw i;return o={throttleEndTimeMillis:Date.now()+Object(a.calculateBackoffMillis)(r),backoffCount:r+1},[4,this.storage.setThrottleMetadata(o)];case 6:return s.sent(),[2,this.attemptFetch(e,o)];case 7:return[2]}}))}))},e}();(wi=o.default).INTERNAL.registerComponent(new c.Component("remoteConfig",(function(e,t){var n=t.instanceIdentifier,r=e.getProvider("app").getImmediate(),i=e.getProvider("installations").getImmediate();if("undefined"===typeof window)throw li.create("registration-window");var o=r.options,a=o.projectId,u=o.apiKey,c=o.appId;if(!a)throw li.create("registration-project-id");if(!u)throw li.create("registration-api-key");if(!c)throw li.create("registration-app-id");n=n||"firebase";var l=new gi(c,r.name,n),f=new mi(l),h=new s.Logger("@firebase/remote-config");h.logLevel=s.LogLevel.ERROR;var d=new fi(i,wi.SDK_VERSION,n,a,u,c),p=new _i(d,l),v=new ui(p,l,f,h),y=new vi(r,v,f,l,h);return y.ensureInitialized(),y}),"PUBLIC").setMultipleInstances(!0)),wi.registerVersion("@firebase/remote-config","0.1.40");n(92);n.d(t,"a",(function(){return o.default}));o.default.registerVersion("firebase","8.6.8","app"),o.default.SDK_VERSION="8.6.8";console.warn("\nIt looks like you're using the development build of the Firebase JS SDK.\nWhen deploying Firebase apps to production, it is advisable to only import\nthe individual SDK components you intend to use.\n\nFor the module builds, these are available in the following manner\n(replace with the name of a component - i.e. auth, database, etc):\n\nCommonJS Modules:\nconst firebase = require('firebase/app');\nrequire('firebase/');\n\nES Modules:\nimport firebase from 'firebase/app';\nimport 'firebase/';\n\nTypescript:\nimport firebase from 'firebase/app';\nimport 'firebase/';\n"),o.default.registerVersion("firebase","8.6.8")},function(e,t,n){"use strict";var r=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;function a(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(i){return!1}}()?Object.assign:function(e,t){for(var n,s,u=a(e),c=1;c=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};r.forEach(["delete","get","head"],(function(e){s.headers[e]={}})),r.forEach(["post","put","patch"],(function(e){s.headers[e]=r.merge(o)})),e.exports=s}).call(this,n(31))},function(e,t,n){"use strict";var r=n(11),i=n(80),o=n(41),a=n(82),s=n(85),u=n(86),c=n(45);e.exports=function(e){return new Promise((function(t,l){var f=e.data,h=e.headers;r.isFormData(f)&&delete h["Content-Type"];var d=new XMLHttpRequest;if(e.auth){var p=e.auth.username||"",v=e.auth.password||"";h.Authorization="Basic "+btoa(p+":"+v)}var y=a(e.baseURL,e.url);if(d.open(e.method.toUpperCase(),o(y,e.params,e.paramsSerializer),!0),d.timeout=e.timeout,d.onreadystatechange=function(){if(d&&4===d.readyState&&(0!==d.status||d.responseURL&&0===d.responseURL.indexOf("file:"))){var n="getAllResponseHeaders"in d?s(d.getAllResponseHeaders()):null,r={data:e.responseType&&"text"!==e.responseType?d.response:d.responseText,status:d.status,statusText:d.statusText,headers:n,config:e,request:d};i(t,l,r),d=null}},d.onabort=function(){d&&(l(c("Request aborted",e,"ECONNABORTED",d)),d=null)},d.onerror=function(){l(c("Network Error",e,null,d)),d=null},d.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),l(c(t,e,"ECONNABORTED",d)),d=null},r.isStandardBrowserEnv()){var g=n(87),m=(e.withCredentials||u(y))&&e.xsrfCookieName?g.read(e.xsrfCookieName):void 0;m&&(h[e.xsrfHeaderName]=m)}if("setRequestHeader"in d&&r.forEach(h,(function(e,t){"undefined"===typeof f&&"content-type"===t.toLowerCase()?delete h[t]:d.setRequestHeader(t,e)})),r.isUndefined(e.withCredentials)||(d.withCredentials=!!e.withCredentials),e.responseType)try{d.responseType=e.responseType}catch(b){if("json"!==e.responseType)throw b}"function"===typeof e.onDownloadProgress&&d.addEventListener("progress",e.onDownloadProgress),"function"===typeof e.onUploadProgress&&d.upload&&d.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){d&&(d.abort(),l(e),d=null)})),void 0===f&&(f=null),d.send(f)}))}},function(e,t,n){"use strict";var r=n(81);e.exports=function(e,t,n,i,o){var a=new Error(e);return r(a,t,n,i,o)}},function(e,t,n){"use strict";var r=n(11);e.exports=function(e,t){t=t||{};var n={},i=["url","method","params","data"],o=["headers","auth","proxy"],a=["baseURL","url","transformRequest","transformResponse","paramsSerializer","timeout","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","maxContentLength","validateStatus","maxRedirects","httpAgent","httpsAgent","cancelToken","socketPath"];r.forEach(i,(function(e){"undefined"!==typeof t[e]&&(n[e]=t[e])})),r.forEach(o,(function(i){r.isObject(t[i])?n[i]=r.deepMerge(e[i],t[i]):"undefined"!==typeof t[i]?n[i]=t[i]:r.isObject(e[i])?n[i]=r.deepMerge(e[i]):"undefined"!==typeof e[i]&&(n[i]=e[i])})),r.forEach(a,(function(r){"undefined"!==typeof t[r]?n[r]=t[r]:"undefined"!==typeof e[r]&&(n[r]=e[r])}));var s=i.concat(o).concat(a),u=Object.keys(t).filter((function(e){return-1===s.indexOf(e)}));return r.forEach(u,(function(r){"undefined"!==typeof t[r]?n[r]=t[r]:"undefined"!==typeof e[r]&&(n[r]=e[r])})),n}},function(e,t,n){"use strict";function r(e){this.message=e}r.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},r.prototype.__CANCEL__=!0,e.exports=r},function(e,t,n){"use strict";function r(e){var t,n=e.Symbol;return"function"===typeof n?n.observable?t=n.observable:(t=n("observable"),n.observable=t):t="@@observable",t}n.d(t,"a",(function(){return r}))},,,function(e,t,n){"use strict";(function(t){var n="__global_unique_id__";e.exports=function(){return t[n]=(t[n]||0)+1}}).call(this,n(22))},,,function(e,t,n){"use strict";var r=n(17).compose;t.__esModule=!0,t.composeWithDevTools="undefined"!==typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"===typeof arguments[0]?r:r.apply(null,arguments)},t.devToolsEnhancer="undefined"!==typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}}},function(e,t,n){"use strict";function r(e){return function(t){var n=t.dispatch,r=t.getState;return function(t){return function(i){return"function"===typeof i?i(n,r,e):t(i)}}}}var i=r();i.withExtraArgument=r,t.a=i},,,,,,,,,,,function(e,t,n){"use strict";var r=n(38),i="function"===typeof Symbol&&Symbol.for,o=i?Symbol.for("react.element"):60103,a=i?Symbol.for("react.portal"):60106,s=i?Symbol.for("react.fragment"):60107,u=i?Symbol.for("react.strict_mode"):60108,c=i?Symbol.for("react.profiler"):60114,l=i?Symbol.for("react.provider"):60109,f=i?Symbol.for("react.context"):60110,h=i?Symbol.for("react.forward_ref"):60112,d=i?Symbol.for("react.suspense"):60113;i&&Symbol.for("react.suspense_list");var p=i?Symbol.for("react.memo"):60115,v=i?Symbol.for("react.lazy"):60116;i&&Symbol.for("react.fundamental"),i&&Symbol.for("react.responder"),i&&Symbol.for("react.scope");var y="function"===typeof Symbol&&Symbol.iterator;function g(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;nP.length&&P.push(e)}function D(e,t,n){return null==e?0:function e(t,n,r,i){var s=typeof t;"undefined"!==s&&"boolean"!==s||(t=null);var u=!1;if(null===t)u=!0;else switch(s){case"string":case"number":u=!0;break;case"object":switch(t.$$typeof){case o:case a:u=!0}}if(u)return r(i,t,""===n?"."+j(t,0):n),1;if(u=0,n=""===n?".":n+":",Array.isArray(t))for(var c=0;c