1"use strict";(self["webpackChunkcm_web_app"]=self["webpackChunkcm_web_app"]||[]).push([[10655],{49998:function(t,e,n){var r,i,o=n(15215),a=n(51625),s=n(51134),u=n(32477),c=(r={},r["no-app"]="No Firebase App '{$appName}' has been created - call Firebase App.initializeApp()",r["bad-app-name"]="Illegal App name: '{$appName}",r["duplicate-app"]="Firebase App named '{$appName}' already exists",r["app-deleted"]="Firebase App named '{$appName}' already deleted",r["invalid-app-argument"]="firebase.{$appName}() takes either no argument or a Firebase App instance.",r["invalid-log-argument"]="First argument to `onLog` must be null or a function.",r),h=new a.FA("app","Firebase",c),l="@firebase/app",f="0.6.22",p="@firebase/analytics",d="@firebase/app-check",v="@firebase/auth",g="@firebase/database",m="@firebase/functions",y="@firebase/installations",b="@firebase/messaging",w="@firebase/performance",_="@firebase/remote-config",I="@firebase/storage",E="@firebase/firestore",T="firebase-wrapper",S="[DEFAULT]",A=(i={},i[l]="fire-core",i[p]="fire-analytics",i[d]="fire-app-check",i[v]="fire-auth",i[g]="fire-rtdb",i[m]="fire-fn",i[y]="fire-iid",i[b]="fire-fcm",i[w]="fire-perf",i[_]="fire-rc",i[I]="fire-gcs",i[E]="fire-fst",i["fire-js"]="fire-js",i[T]="fire-js-all",i),k=new u.Vy("@firebase/app"),N=function(){function t(t,e,n){var r=this;this.firebase_=n,this.isDeleted_=!1,this.name_=e.name,this.automaticDataCollectionEnabled_=e.automaticDataCollectionEnabled||!1,this.options_=(0,a.A4)(t),this.container=new s.h1(e.name),this._addComponent(new s.uA("app",(function(){return r}),"PUBLIC")),this.firebase_.INTERNAL.components.forEach((function(t){return r._addComponent(t)}))}return Object.defineProperty(t.prototype,"automaticDataCollectionEnabled",{get:function(){return this.checkDestroyed_(),this.automaticDataCollectionEnabled_},set:function(t){this.checkDestroyed_(),this.automaticDataCollectionEnabled_=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return this.checkDestroyed_(),this.name_},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"options",{get:function(){return this.checkDestroyed_(),this.options_},enumerable:!1,configurable:!0}),t.prototype.delete=function(){var t=this;return new Promise((function(e){t.checkDestroyed_(),e()})).then((function(){return t.firebase_.INTERNAL.removeApp(t.name_),Promise.all(t.container.getProviders().map((function(t){return t.delete()})))})).then((function(){t.isDeleted_=!0}))},t.prototype._getService=function(t,e){var n;void 0===e&&(e=S),this.checkDestroyed_();var r=this.container.getProvider(t);return r.isInitialized()||"EXPLICIT"!==(null===(n=r.getComponent())||void 0===n?void 0:n.instantiationMode)||r.initialize(),r.getImmediate({identifier:e})},t.prototype._removeServiceInstance=function(t,e){void 0===e&&(e=S),this.container.getProvider(t).clearInstance(e)},t.prototype._addComponent=function(t){try{this.container.addComponent(t)}catch(e){k.debug("Component "+t.name+" failed to register with FirebaseApp "+this.name,e)}},t.prototype._addOrOverwriteComponent=function(t){this.container.addOrOverwriteComponent(t)},t.prototype.toJSON=function(){return{name:this.name,automaticDataCollectionEnabled:this.automaticDataCollectionEnabled,options:this.options}},t.prototype.checkDestroyed_=function(){if(this.isDeleted_)throw h.create("app-deleted",{appName:this.name_})},t}();N.prototype.name&&N.prototype.options||N.prototype.delete||console.log("dc");var C="8.6.1"; 2/** 3 * @license 4 * Copyright 2019 Google LLC 5 * 6 * Licensed under the Apache License, Version 2.0 (the "License"); 7 * you may not use this file except in compliance with the License. 8 * You may obtain a copy of the License at 9 * 10 * http://www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, software 13 * distributed under the License is distributed on an "AS IS" BASIS, 14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 * See the License for the specific language governing permissions and 16 * limitations under the License. 17 */function R(t){var e={}
17,n=new Map,r={__esModule:!0,initializeApp:c,app:o,registerVersion:p,setLogLevel:u.He,onLog:d,apps:null,SDK_VERSION:C,INTERNAL:{registerComponent:f,removeApp:i,components:n,useAsService:v}};function i(t){delete e[t]}function o(t){if(t=t||S,!(0,a.gR)(e,t))throw h.create("no-app",{appName:t});return e[t]}function c(n,i){if(void 0===i&&(i={}),"object"!==typeof i||null===i){var o=i;i={name:o}}var s=i;void 0===s.name&&(s.name=S);var u=s.name;if("string"!==typeof u||!u)throw h.create("bad-app-name",{appName:String(u)});if((0,a.gR)(e,u))throw h.create("duplicate-app",{appName:u});var c=new t(n,s,r);return e[u]=c,c}function l(){return Object.keys(e).map((function(t){return e[t]}))}function f(i){var s=i.name;if(n.has(s))return k.debug("There were multiple attempts to register component "+s+"."),"PUBLIC"===i.type?r[s]:null;if(n.set(s,i),"PUBLIC"===i.type){var u=function(t){if(void 0===t&&(t=o()),"function"!==typeof t[s])throw h.create("invalid-app-argument",{appName:s});return t[s]()};void 0!==i.serviceProps&&(0,a.zw)(u,i.serviceProps),r[s]=u,t.prototype[s]=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this._getService.bind(this,s);return n.apply(this,i.multipleInstances?t:[])}}for(var c=0,l=Object.keys(e);c<l.length;c++){var f=l[c];e[f]._addComponent(i)}return"PUBLIC"===i.type?r[s]:null}function p(t,e,n){var r,i=null!==(r=A[t])&&void 0!==r?r:t;n&&(i+="-"+n);var o=i.match(/\s|\//),a=e.match(/\s|\//);if(o||a){var u=['Unable to register library "'+i+'" with version "'+e+'":'];return o&&u.push('library name "'+i+'" contains illegal characters (whitespace or "/")'),o&&a&&u.push("and"),a&&u.push('version name "'+e+'" contains illegal characters (whitespace or "/")'),void k.warn(u.join(" "))}f(new s.uA(i+"-version",(function(){return{library:i,version:e}}),"VERSION"))}function d(t,e){if(null!==t&&"function"!==typeof t)throw h.create("invalid-log-argument");(0,u.Ey)(t,e)}function v(t,e){if("serverAuth"===e)return null;var n=e;return n}return r["default"]=r,Object.defineProperty(r,"apps",{get:l}),o["App"]=t,r} 18/** 19 * @license 20 * Copyright 2019 Google LLC 21 * 22 * Licensed under the Apache License, Version 2.0 (the "License"); 23 * you may not use this file except in compliance with the License. 24 * You may obtain a copy of the License at 25 * 26 * http://www.apache.org/licenses/LICENSE-2.0 27 * 28 * Unless required by applicable law or agreed to in writing, software 29 * distributed under the License is distributed on an "AS IS" BASIS, 30 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 31 * See the License for the specific language governing permissions and 32 * limitations under the License. 33 */function O(){var t=R(N);function e(e){(0,a.zw)(t,e)}return t.INTERNAL=(0,o.Cl)((0,o.Cl)({},t.INTERNAL),{createFirebaseNamespace:O,extendNamespace:e,createSubscribe:a.tD,ErrorFactory:a.FA,deepExtend:a.zw}),t}var D=O(),P=function(){function t(t){this.container=t}return t.prototype.getPlatformInfoString=function(){var t=this.container.getProviders();return t.map((function(t){if(L(t)){var e=t.getImmediate();return e.library+"/"+e.version}return null})).filter((function(t){return t})).join(" ")},t}(); 34/** 35 * @license 36 * Copyright 2019 Google LLC 37 * 38 * Licensed under the Apache License, Version 2.0 (the "License"); 39 * you may not use this file except in compliance with the License. 40 * You may obtain a copy of the License at 41 * 42 * http://www.apache.org/licenses/LICENSE-2.0 43 * 44 * Unless required by applicable law or agreed to in writing, software 45 * distributed under the License is distributed on an "AS IS" BASIS, 46 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 47 * See the License for the specific language governing permissions and 48 * limitations under the License. 49 */function L(t){var e=t.getComponent();return"VERSION"===(null===e||void 0===e?void 0:e.type)} 50/** 51 * @license 52 * Copyright 2019 Google LLC 53 * 54 * Licensed under the Apache License, Version 2.0 (the "License"); 55 * you may not use this file except in compliance with the License. 56 * You may obtain a copy of the License at 57 * 58 * http://www.apache.org/licenses/LICENSE-2.0 59 * 60 * Unless required by applicable law or agreed to in writing, softw
60are 61 * distributed under the License is distributed on an "AS IS" BASIS, 62 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 63 * See the License for the specific language governing permissions and 64 * limitations under the License. 65 */function x(t,e){t.INTERNAL.registerComponent(new s.uA("platform-logger",(function(t){return new P(t)}),"PRIVATE")),t.registerVersion(l,f,e),t.registerVersion("fire-js","")} 66/** 67 * @license 68 * Copyright 2017 Google LLC 69 * 70 * Licensed under the Apache License, Version 2.0 (the "License"); 71 * you may not use this file except in compliance with the License. 72 * You may obtain a copy of the License at 73 * 74 * http://www.apache.org/licenses/LICENSE-2.0 75 * 76 * Unless required by applicable law or agreed to in writing, software 77 * distributed under the License is distributed on an "AS IS" BASIS, 78 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 79 * See the License for the specific language governing permissions and 80 * limitations under the License. 81 */if((0,a.Bd)()&&void 0!==self.firebase){k.warn("\n Warning: Firebase is already defined in the global scope. Please make sure\n Firebase library is only loaded once.\n ");var M=self.firebase.SDK_VERSION;M&&M.indexOf("LITE")>=0&&k.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 U=D.initializeApp;D.initializeApp=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return(0,a.Ll)()&&k.warn('\n Warning: This is a browser-targeted Firebase bundle but it appears it is being\n run in a Node environment. If running in a Node environment, make sure you\n are using the bundle specified by the "main" field in package.json.\n \n If you are using Webpack, you can specify "main" as the first item in\n "resolve.mainFields":\n https://webpack.js.org/configuration/resolve/#resolvemainfields\n \n If using Rollup, use the @rollup/plugin-node-resolve plugin and specify "main"\n as the first item in "mainFields", e.g. [\'main\', \'module\'].\n https://github.com/rollup/@rollup/plugin-node-resolve\n '),U.apply(void 0,t)};var F=D;x(F),e.A=F},51134:function(t,e,n){n.d(e,{h1:function(){return h},uA:function(){return o}});var r=n(15215),i=n(51625),o=function(){function t(t,e,n){this.name=t,this.instanceFactory=e,this.type=n,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}return t.prototype.setInstantiationMode=function(t){return this.instantiationMode=t,this},t.prototype.setMultipleInstances=function(t){return this.multipleInstances=t,this},t.prototype.setServiceProps=function(t){return this.serviceProps=t,this},t.prototype.setInstanceCreatedCallback=function(t){return this.onInstanceCreated=t,this},t}(),a="[DEFAULT]",s=function(){function t(t,e){this.name=t,this.container=e,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.onInitCallbacks=new Set}return t.prototype.get=function(t){void 0===t&&(t=a);var e=this.normalizeInstanceIdentifier(t);if(!this.instancesDeferred.has(e)){var n=new i.cY;if(this.instancesDeferred.set(e,n),this.isInitialized(e)||this.shouldAutoInitialize())try{var r=this.getOrInitializeService({instanceIdentifier:e});r&&n.resolve(r)}catch(o){}}return this.instancesDeferred.get(e).promise},t.prototype.getImmediate=function(t){var e=(0,r.Cl)({identifier:a,optional:!1},t),n=e.identifier,i=e.optional,o=this.normalizeInstanceIdentifier(n);if(!this.isInitialized(o)&&!this.shouldAutoInitialize()){if(i)return null;throw Error("Service "+this.name+" is not available")}try{return this.getOrInitializeService({instanceIdentifier:o})}catch(s){if(i)return null;throw s}},t.prototype.getComponent=function(){return this.component},t.prototype.setComponent=function(t){var e,n;if(t.name!==this.name)throw Error("Mismatching Component "+t.name+" for Provider "+this.name+".");if(this.component)throw Error("Component for "+this.name+" has already been provided");
81if(this.component=t,this.shouldAutoInitialize()){if(c(t))try{this.getOrInitializeService({instanceIdentifier:a})}catch(p){}try{for(var i=(0,r.Ju)(this.instancesDeferred.entries()),o=i.next();!o.done;o=i.next()){var s=(0,r.zs)(o.value,2),u=s[0],h=s[1],l=this.normalizeInstanceIdentifier(u);try{var f=this.getOrInitializeService({instanceIdentifier:l});h.resolve(f)}catch(p){}}}catch(d){e={error:d}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}}},t.prototype.clearInstance=function(t){void 0===t&&(t=a),this.instancesDeferred.delete(t),this.instances.delete(t)},t.prototype.delete=function(){return(0,r.sH)(this,void 0,void 0,(function(){var t;return(0,r.YH)(this,(function(e){switch(e.label){case 0:return t=Array.from(this.instances.values()),[4,Promise.all((0,r.fX)((0,r.fX)([],(0,r.zs)(t.filter((function(t){return"INTERNAL"in t})).map((function(t){return t.INTERNAL.delete()})))),(0,r.zs)(t.filter((function(t){return"_delete"in t})).map((function(t){return t._delete()})))))];case 1:return e.sent(),[2]}}))}))},t.prototype.isComponentSet=function(){return null!=this.component},t.prototype.isInitialized=function(t){return void 0===t&&(t=a),this.instances.has(t)},t.prototype.initialize=function(t){var e,n;void 0===t&&(t={});var i=t.instanceIdentifier,o=void 0===i?a:i,s=t.options,u=void 0===s?{}:s,c=this.normalizeInstanceIdentifier(o);if(this.isInitialized(c))throw Error(this.name+"("+c+") has already been initialized");if(!this.isComponentSet())throw Error("Component "+this.name+" has not been registered yet");var h=this.getOrInitializeService({instanceIdentifier:c,options:u});try{for(var l=(0,r.Ju)(this.instancesDeferred.entries()),f=l.next();!f.done;f=l.next()){var p=(0,r.zs)(f.value,2),d=p[0],v=p[1],g=this.normalizeInstanceIdentifier(d);c===g&&v.resolve(h)}}catch(m){e={error:m}}finally{try{f&&!f.done&&(n=l.return)&&n.call(l)}finally{if(e)throw e.error}}return this.invokeOnInitCallbacks(h,c),h},t.prototype.onInit=function(t){var e=this;return this.onInitCallbacks.add(t),function(){e.onInitCallbacks.delete(t)}},t.prototype.invokeOnInitCallbacks=function(t,e){var n,i;try{for(var o=(0,r.Ju)(this.onInitCallbacks),a=o.next();!a.done;a=o.next()){var s=a.value;try{s(t,e)}catch(u){}}}catch(c){n={error:c}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}},t.prototype.getOrInitializeService=function(t){var e=t.instanceIdentifier,n=t.options,r=void 0===n?{}:n,i=this.instances.get(e);if(!i&&this.component&&(i=this.component.instanceFactory(this.container,{instanceIdentifier:u(e),options:r}),this.instances.set(e,i),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,i)}catch(o){}return i||null},t.prototype.normalizeInstanceIdentifier=function(t){return this.component?this.component.multipleInstances?t:a:t},t.prototype.shouldAutoInitialize=function(){return!!this.component&&"EXPLICIT"!==this.component.instantiationMode},t}();function u(t){return t===a?void 0:t}function c(t){return"EAGER"===t.instantiationMode} 82/** 83 * @license 84 * Copyright 2019 Google LLC 85 * 86 * Licensed under the Apache License, Version 2.0 (the "License"); 87 * you may not use this file except in compliance with the License. 88 * You may obtain a copy of the License at 89 * 90 * http://www.apache.org/licenses/LICENSE-2.0 91 * 92 * Unless required by applicable law or agreed to in writing, software 93 * distributed under the License is distributed on an "AS IS" BASIS, 94 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 95 * See the License for the specific language governing permissions and 96 * limitations under the License. 97 */var h=function(){function t(t){this.name=t,this.providers=new Map}return t.prototype.addComponent=function(t){var e=this.getProvider(t.name);if(e.isComponentSet())throw new Error("Component "+t.name+" has already been registered with "+this.name);e.setComponent(t)},t.prototype.addOrOverwriteComponent=function(t){var e=this.getProvider(t.name);e.isComponentSet()&&this.providers.delete(t.name),this.addComponent(t)},t.prototype.getProvider=function(t){if(this.providers.has(t))return this.providers.get(t);var e=new s(t,this);return this.providers.set(t,e),e},t.prototype.getProviders=function(){return Array.from(this.providers.values())},t}()},32477:function(t,e,n){ 98/*! ***************************************************************************** 99Copyright (c) Microsoft Corporation. All rights reserved. 100Licensed under the Apache License, Version 2.0 (the "License");
100 you may not use 101this file except in compliance with the License. You may obtain a copy of the 102License at http://www.apache.org/licenses/LICENSE-2.0 103 104THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 105KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED 106WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, 107MERCHANTABLITY OR NON-INFRINGEMENT. 108 109See the Apache Version 2.0 License for specific language governing permissions 110and limitations under the License. 111***************************************************************************** */ 112function r(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),i=0;for(e=0;e<n;e++)for(var o=arguments[e],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r} 113/** 114 * @license 115 * Copyright 2017 Google LLC 116 * 117 * Licensed under the Apache License, Version 2.0 (the "License"); 118 * you may not use this file except in compliance with the License. 119 * You may obtain a copy of the License at 120 * 121 * http://www.apache.org/licenses/LICENSE-2.0 122 * 123 * Unless required by applicable law or agreed to in writing, software 124 * distributed under the License is distributed on an "AS IS" BASIS, 125 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 126 * See the License for the specific language governing permissions and 127 * limitations under the License. 128 */var i;n.d(e,{$b:function(){return o},Ey:function(){return p},He:function(){return f},Vy:function(){return l}});var o,a=[];(function(t){t[t["DEBUG"]=0]="DEBUG",t[t["VERBOSE"]=1]="VERBOSE",t[t["INFO"]=2]="INFO",t[t["WARN"]=3]="WARN",t[t["ERROR"]=4]="ERROR",t[t["SILENT"]=5]="SILENT"})(o||(o={}));var s={debug:o.DEBUG,verbose:o.VERBOSE,info:o.INFO,warn:o.WARN,error:o.ERROR,silent:o.SILENT},u=o.INFO,c=(i={},i[o.DEBUG]="log",i[o.VERBOSE]="log",i[o.INFO]="info",i[o.WARN]="warn",i[o.ERROR]="error",i),h=function(t,e){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];if(!(e<t.logLevel)){var o=(new Date).toISOString(),a=c[e];if(!a)throw new Error("Attempted to log a message with an invalid logType (value: "+e+")");console[a].apply(console,r(["["+o+"] "+t.name+":"],n))}},l=function(){function t(t){this.name=t,this._logLevel=u,this._logHandler=h,this._userLogHandler=null,a.push(this)}return Object.defineProperty(t.prototype,"logLevel",{get:function(){return this._logLevel},set:function(t){if(!(t in o))throw new TypeError('Invalid value "'+t+'" assigned to `logLevel`');this._logLevel=t},enumerable:!1,configurable:!0}),t.prototype.setLogLevel=function(t){this._logLevel="string"===typeof t?s[t]:t},Object.defineProperty(t.prototype,"logHandler",{get:function(){return this._logHandler},set:function(t){if("function"!==typeof t)throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"userLogHandler",{get:function(){return this._userLogHandler},set:function(t){this._userLogHandler=t},enumerable:!1,configurable:!0}),t.prototype.debug=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._userLogHandler&&this._userLogHandler.apply(this,r([this,o.DEBUG],t)),this._logHandler.apply(this,r([this,o.DEBUG],t))},t.prototype.log=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._userLogHandler&&this._userLogHandler.apply(this,r([this,o.VERBOSE],t)),this._logHandler.apply(this,r([this,o.VERBOSE],t))},t.prototype.info=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._userLogHandler&&this._userLogHandler.apply(this,r([this,o.INFO],t)),this._logHandler.apply(this,r([this,o.INFO],t))},t.prototype.warn=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._userLogHandler&&this._userLogHandler.apply(this,r([this,o.WARN],t)),this._logHandler.apply(this,r([this,o.WARN],t))},t.prototype.error=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._userLogHandler&&this._userLogHandler.apply(this,r([this,o.ERROR],t)),this._logHandler.apply(this,r([this,o.ERROR],t))},t}();function f(t){a.forEach((function(e){e.setLogLevel(t)}
128))}function p(t,e){for(var n=function(n){var r=null;e&&e.level&&(r=s[e.level]),n.userLogHandler=null===t?null:function(e,n){for(var i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];var s=i.map((function(t){if(null==t)return null;if("string"===typeof t)return t;if("number"===typeof t||"boolean"===typeof t)return t.toString();if(t instanceof Error)return t.message;try{return JSON.stringify(t)}catch(e){return null}})).filter((function(t){return t})).join(" ");n>=(null!==r&&void 0!==r?r:e.logLevel)&&t({level:o[n].toLowerCase(),message:s,args:i,type:e.name})}},r=0,i=a;r<i.length;r++){var u=i[r];n(u)}}},51625:function(t,e,n){n.d(e,{A4:function(){return s},Bd:function(){return v},FA:function(){return E},Fy:function(){return l},Ku:function(){return M},Ll:function(){return d},ZQ:function(){return f},b8:function(){return y},cY:function(){return h},g:function(){return I},gR:function(){return A},jZ:function(){return p},lT:function(){return b},lV:function(){return m},n4:function(){return w},p9:function(){return x},sr:function(){return g},tD:function(){return k},zw:function(){return u}});var r=n(15215),i=function(t){for(var e=[],n=0,r=0;r<t.length;r++){var i=t.charCodeAt(r);i<128?e[n++]=i:i<2048?(e[n++]=i>>6|192,e[n++]=63&i|128):55296===(64512&i)&&r+1<t.length&&56320===(64512&t.charCodeAt(r+1))?(i=65536+((1023&i)<<10)+(1023&t.charCodeAt(++r)),e[n++]=i>>18|240,e[n++]=i>>12&63|128,e[n++]=i>>6&63|128,e[n++]=63&i|128):(e[n++]=i>>12|224,e[n++]=i>>6&63|128,e[n++]=63&i|128)}return e},o=function(t){var e=[],n=0,r=0;while(n<t.length){var i=t[n++];if(i<128)e[r++]=String.fromCharCode(i);else if(i>191&&i<224){var o=t[n++];e[r++]=String.fromCharCode((31&i)<<6|63&o)}else if(i>239&&i<365){o=t[n++];var a=t[n++],s=t[n++],u=((7&i)<<18|(63&o)<<12|(63&a)<<6|63&s)-65536;e[r++]=String.fromCharCode(55296+(u>>10)),e[r++]=String.fromCharCode(56320+(1023&u))}else{o=t[n++],a=t[n++];e[r++]=String.fromCharCode((15&i)<<12|(63&o)<<6|63&a)}}return e.join("")},a={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:"function"===typeof atob,encodeByteArray:function(t,e){if(!Array.isArray(t))throw Error("encodeByteArray takes an array as a parameter");this.init_();for(var n=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[],i=0;i<t.length;i+=3){var o=t[i],a=i+1<t.length,s=a?t[i+1]:0,u=i+2<t.length,c=u?t[i+2]:0,h=o>>2,l=(3&o)<<4|s>>4,f=(15&s)<<2|c>>6,p=63&c;u||(p=64,a||(f=64)),r.push(n[h],n[l],n[f],n[p])}return r.join("")},encodeString:function(t,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(t):this.encodeByteArray(i(t),e)},decodeString:function(t,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(t):o(this.decodeStringToByteArray(t,e))},decodeStringToByteArray:function(t,e){this.init_();for(var n=e?this.charToByteMapWebSafe_:this.charToByteMap_,r=[],i=0;i<t.length;){var o=n[t.charAt(i++)],a=i<t.length,s=a?n[t.charAt(i)]:0;++i;var u=i<t.length,c=u?n[t.charAt(i)]:64;++i;var h=i<t.length,l=h?n[t.charAt(i)]:64;if(++i,null==o||null==s||null==c||null==l)throw Error();var f=o<<2|s>>4;if(r.push(f),64!==c){var p=s<<4&240|c>>2;if(r.push(p),64!==l){var d=c<<6&192|l;r.push(d)}}}return r},init_:function(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(var t=0;t<this.ENCODED_VALS.length;t++)this.byteToCharMap_[t]=this.ENCODED_VALS.charAt(t),this.charToByteMap_[this.byteToCharMap_[t]]=t,this.byteToCharMapWebSafe_[t]=this.ENCODED_VALS_WEBSAFE.charAt(t),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[t]]=t,t>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(t)]=t,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(t)]=t)}}}; 129/** 130 * @license 131 * Copyright 2017 Google LLC 132 * 133 * Licensed under the Apache License, Version 2.0 (the "License"); 134 * you may not use this file except in compliance with the License. 135 * You may obtain a copy of the License at 136 * 137 * http://www.apache.org/licenses/LICENSE-2.0 138 * 139 * Unless required by applicable law or agreed to in writing, softw
139are 140 * distributed under the License is distributed on an "AS IS" BASIS, 141 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 142 * See the License for the specific language governing permissions and 143 * limitations under the License. 144 */ 145/** 146 * @license 147 * Copyright 2017 Google LLC 148 * 149 * Licensed under the Apache License, Version 2.0 (the "License"); 150 * you may not use this file except in compliance with the License. 151 * You may obtain a copy of the License at 152 * 153 * http://www.apache.org/licenses/LICENSE-2.0 154 * 155 * Unless required by applicable law or agreed to in writing, software 156 * distributed under the License is distributed on an "AS IS" BASIS, 157 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 158 * See the License for the specific language governing permissions and 159 * limitations under the License. 160 */ 161function s(t){return u(void 0,t)}function u(t,e){if(!(e instanceof Object))return e;switch(e.constructor){case Date:var n=e;return new Date(n.getTime());case Object:void 0===t&&(t={});break;case Array:t=[];break;default:return e}for(var r in e)e.hasOwnProperty(r)&&c(r)&&(t[r]=u(t[r],e[r]));return t}function c(t){return"__proto__"!==t} 162/** 163 * @license 164 * Copyright 2017 Google LLC 165 * 166 * Licensed under the Apache License, Version 2.0 (the "License"); 167 * you may not use this file except in compliance with the License. 168 * You may obtain a copy of the License at 169 * 170 * http://www.apache.org/licenses/LICENSE-2.0 171 * 172 * Unless required by applicable law or agreed to in writing, software 173 * distributed under the License is distributed on an "AS IS" BASIS, 174 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 175 * See the License for the specific language governing permissions and 176 * limitations under the License. 177 */var h=function(){function t(){var t=this;this.reject=function(){},this.resolve=function(){},this.promise=new Promise((function(e,n){t.resolve=e,t.reject=n}))}return t.prototype.wrapCallback=function(t){var e=this;return function(n,r){n?e.reject(n):e.resolve(r),"function"===typeof t&&(e.promise.catch((function(){})),1===t.length?t(n):t(n,r))}},t}(); 178/** 179 * @license 180 * Copyright 2021 Google LLC 181 * 182 * Licensed under the Apache License, Version 2.0 (the "License"); 183 * you may not use this file except in compliance with the License. 184 * You may obtain a copy of the License at 185 * 186 * http://www.apache.org/licenses/LICENSE-2.0 187 * 188 * Unless required by applicable law or agreed to in writing, software 189 * distributed under the License is distributed on an "AS IS" BASIS, 190 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 191 * See the License for the specific language governing permissions and 192 * limitations under the License. 193 */function l(t,e){if(t.uid)throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');var n={alg:"none",type:"JWT"},i=e||"demo-project",o=t.iat||0,s=t.sub||t.user_id;if(!s)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");var u=(0,r.Cl)({iss:"https://securetoken.google.com/"+i,aud:i,iat:o,exp:o+3600,auth_time:o,sub:s,user_id:s,firebase:{sign_in_provider:"custom",identities:{}}},t),c="";return[a.encodeString(JSON.stringify(n),!1),a.encodeString(JSON.stringify(u),!1),c].join(".")} 194/** 195 * @license 196 * Copyright 2017 Google LLC 197 * 198 * Licensed under the Apache License, Version 2.0 (the "License"); 199 * you may not use this file except in compliance with the License. 200 * You may obtain a copy of the License at 201 * 202 * http://www.apache.org/licenses/LICENSE-2.0 203 * 204 * Unless required by applicable law or agreed to in writing, software 205 * distributed under the License is distributed on an "AS IS" BASIS, 206 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 207 * See the License for the specific language governing permissions and 208 * limitations under the License. 209 */function f(){return"undefined"!==typeof navigator&&"string"===typeof navigator["userAgent"]?navigator["userAgent"]:""}function p(){return"undefined"!==typeof window&&!!(window["cordova"]||window["ph
209onegap"]||window["PhoneGap"])&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(f())}function d(){try{return"[object process]"===Object.prototype.toString.call(n.g.process)}catch(t){return!1}}function v(){return"object"===typeof self&&self.self===self}function g(){var t="object"===typeof chrome?chrome.runtime:"object"===typeof browser?browser.runtime:void 0;return"object"===typeof t&&void 0!==t.id}function m(){return"object"===typeof navigator&&"ReactNative"===navigator["product"]}function y(){return f().indexOf("Electron/")>=0}function b(){var t=f();return t.indexOf("MSIE ")>=0||t.indexOf("Trident/")>=0}function w(){return f().indexOf("MSAppHost/")>=0} 210/** 211 * @license 212 * Copyright 2017 Google LLC 213 * 214 * Licensed under the Apache License, Version 2.0 (the "License"); 215 * you may not use this file except in compliance with the License. 216 * You may obtain a copy of the License at 217 * 218 * http://www.apache.org/licenses/LICENSE-2.0 219 * 220 * Unless required by applicable law or agreed to in writing, software 221 * distributed under the License is distributed on an "AS IS" BASIS, 222 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 223 * See the License for the specific language governing permissions and 224 * limitations under the License. 225 */ 226var _="FirebaseError",I=function(t){function e(n,r,i){var o=t.call(this,r)||this;return o.code=n,o.customData=i,o.name=_,Object.setPrototypeOf(o,e.prototype),Error.captureStackTrace&&Error.captureStackTrace(o,E.prototype.create),o}return(0,r.C6)(e,t),e}(Error),E=function(){function t(t,e,n){this.service=t,this.serviceName=e,this.errors=n}return t.prototype.create=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r=e[0]||{},i=this.service+"/"+t,o=this.errors[t],a=o?T(o,r):"Error",s=this.serviceName+": "+a+" ("+i+").",u=new I(i,s,r);return u},t}();function T(t,e){return t.replace(S,(function(t,n){var r=e[n];return null!=r?String(r):"<"+n+"?>"}))}var S=/\{\$([^}]+)}/g; 227/** 228 * @license 229 * Copyright 2017 Google LLC 230 * 231 * Licensed under the Apache License, Version 2.0 (the "License"); 232 * you may not use this file except in compliance with the License. 233 * You may obtain a copy of the License at 234 * 235 * http://www.apache.org/licenses/LICENSE-2.0 236 * 237 * Unless required by applicable law or agreed to in writing, software 238 * distributed under the License is distributed on an "AS IS" BASIS, 239 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 240 * See the License for the specific language governing permissions and 241 * limitations under the License. 242 */ 243/** 244 * @license 245 * Copyright 2017 Google LLC 246 * 247 * Licensed under the Apache License, Version 2.0 (the "License"); 248 * you may not use this file except in compliance with the License. 249 * You may obtain a copy of the License at 250 * 251 * http://www.apache.org/licenses/LICENSE-2.0 252 * 253 * Unless required by applicable law or agreed to in writing, software 254 * distributed under the License is distributed on an "AS IS" BASIS, 255 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 256 * See the License for the specific language governing permissions and 257 * limitations under the License. 258 */ 259function A(t,e){return Object.prototype.hasOwnProperty.call(t,e)} 260/** 261 * @license 262 * Copyright 2017 Google LLC 263 * 264 * Licensed under the Apache License, Version 2.0 (the "License"); 265 * you may not use this file except in compliance with the License. 266 * You may obtain a copy of the License at 267 * 268 * http://www.apache.org/licenses/LICENSE-2.0 269 * 270 * Unless required by applicable law or agreed to in writing, software 271 * distributed under the License is distributed on an "AS IS" BASIS, 272 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 273 * See the License for the specific language governing permissions and 274 * limitations under the License. 275 */ 276(function(){function t(){this.chain_=[],this.buf_=[],this.W_=[],this.pad_=[],this.inbuf_=0,this.total_=0,this.blockSize=64,this.pad_[0]=128;for(var t=1;t<this.blockSize;++t)this.pad_[t]=0;this.reset()}t.prototype.reset=function(){this.chain_[0]=1732584193,this.chain_[1]=4023233417,this.chain_[2]=2562383102,this.chain_[3]=271733878,this.chain_[4]=3285377520,this.inbuf_=0,this.total_=0},t.prototype.compress_=function(t,e){e||(e=0);var n=this.W_;if("string"===typeof t)for(var r=0;r<16;r++)n[r]=t.charCodeAt(e)<<24|t.charCodeAt(e+1)<<16|t.charCodeAt(e+2)<<8|t.charCodeAt(e+3),e+=4;else for(r=0;r<16;r++)n[r]=t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3],e+=4;for(r=16;r<80;r++){var i=n[r-3]^n[r-8]^n[r-14]^n[r-16];n[r]=4294967295&(i<<1|i>>>31)}var o,a,s=this.chain_[0],u=this.chain_[1],c=this.chain_[2],h=this.chain_[3],l=this.chain_[4];for(r=0;r<80;r++){r<40?r<20?(o=h^u&(c^h),a=1518500249):(o=u^c^h,a=1859775393):r<60?(o=u&c|h&(u|c),a=2400959708):(o=u^c^h,a=3395469782);i=(s<<5|s>>>27)+o+l+a+n[r]&4294967295;l=h,h=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]+h&4294967295,this.chain_[4]=this.chain_[4]+l&4294967295},t.prototype.update=function(t,e){if(null!=t){void 0===e&&(e=t.length);var n=e-this.blockSize,r=0,i=this.buf_,o=this.inbuf_;while(r<e){if(0===o)while(r<=n)this.compress_(t,r),r+=this.blockSize;if("string"===typeof t){while(r<e)if(i[o]=t.charCodeAt(r),++o,++r,o===this.blockSize){this.compress_(i),o=0;break}}else while(r<e)if(i[o]=t[r],++o,++r,o===this.blockSize){this.compress_(i),o=0;break}}this.inbuf_=o,this.total_+=e}},t.prototype.digest=function(){var t=[],e=8*this.total_;this.inbuf_<56?this.update(this.pad_,56-this.inbuf_):this.update(this.pad_,this.blockSize-(this.inbuf_-56));for(var n=this.blockSize-1;n>=56;n--)this.buf_[n]=255&e,e/=256;this.compress_(this.buf_);var r=0;for(n=0;n<5;n++)for(var i=24;i>=0;i-=8)t[r]=this.chain_[n]>>i&255,++r;return t}})();function k(t,e){var n=new N(t,e);return n.subscribe.bind(n)}var N=function(){function t(t,e){var n=this;this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Prom
276ise.resolve(),this.finalized=!1,this.onNoObservers=e,this.task.then((function(){t(n)})).catch((function(t){n.error(t)}))}return t.prototype.next=function(t){this.forEachObserver((function(e){e.next(t)}))},t.prototype.error=function(t){this.forEachObserver((function(e){e.error(t)})),this.close(t)},t.prototype.complete=function(){this.forEachObserver((function(t){t.complete()})),this.close()},t.prototype.subscribe=function(t,e,n){var r,i=this;if(void 0===t&&void 0===e&&void 0===n)throw new Error("Missing Observer.");r=C(t,["next","error","complete"])?t:{next:t,error:e,complete:n},void 0===r.next&&(r.next=R),void 0===r.error&&(r.error=R),void 0===r.complete&&(r.complete=R);var o=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then((function(){try{i.finalError?r.error(i.finalError):r.complete()}catch(t){}})),this.observers.push(r),o},t.prototype.unsubscribeOne=function(t){void 0!==this.observers&&void 0!==this.observers[t]&&(delete this.observers[t],this.observerCount-=1,0===this.observerCount&&void 0!==this.onNoObservers&&this.onNoObservers(this))},t.prototype.forEachObserver=function(t){if(!this.finalized)for(var e=0;e<this.observers.length;e++)this.sendOne(e,t)},t.prototype.sendOne=function(t,e){var n=this;this.task.then((function(){if(void 0!==n.observers&&void 0!==n.observers[t])try{e(n.observers[t])}catch(r){"undefined"!==typeof console&&console.error&&console.error(r)}}))},t.prototype.close=function(t){var e=this;this.finalized||(this.finalized=!0,void 0!==t&&(this.finalError=t),this.task.then((function(){e.observers=void 0,e.onNoObservers=void 0})))},t}();function C(t,e){if("object"!==typeof t||null===t)return!1;for(var n=0,r=e;n<r.length;n++){var i=r[n];if(i in t&&"function"===typeof t[i])return!0}return!1}function R(){} 277/** 278 * @license 279 * Copyright 2017 Google LLC 280 * 281 * Licensed under the Apache License, Version 2.0 (the "License"); 282 * you may not use this file except in compliance with the License. 283 * You may obtain a copy of the License at 284 * 285 * http://www.apache.org/licenses/LICENSE-2.0 286 * 287 * Unless required by applicable law or agreed to in writing, software 288 * distributed under the License is distributed on an "AS IS" BASIS, 289 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 290 * See the License for the specific language governing permissions and 291 * limitations under the License. 292 */ 293/** 294 * @license 295 * Copyright 2017 Google LLC 296 * 297 * Licensed under the Apache License, Version 2.0 (the "License"); 298 * you may not use this file except in compliance with the License. 299 * You may obtain a copy of the License at 300 * 301 * http://www.apache.org/licenses/LICENSE-2.0 302 * 303 * Unless required by applicable law or agreed to in writing, software 304 * distributed under the License is distributed on an "AS IS" BASIS, 305 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 306 * See the License for the specific language governing permissions and 307 * limitations under the License. 308 */ 309var O=1e3,D=2,P=144e5,L=.5;function x(t,e,n){void 0===e&&(e=O),void 0===n&&(n=D);var r=e*Math.pow(n,t),i=Math.round(L*r*(Math.random()-.5)*2);return Math.min(P,r+i)} 310/** 311 * @license 312 * Copyright 2020 Google LLC 313 * 314 * Licensed under the Apache License, Version 2.0 (the "License"); 315 * you may not use this file except in compliance with the License. 316 * You may obtain a copy of the License at 317 * 318 * http://www.apache.org/licenses/LICENSE-2.0 319 * 320 * Unless required by applicable law or agreed to in writing, software 321 * distributed under the License is distributed on an "AS IS" BASIS, 322 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 323 * See the License for the specific language governing permissions and 324 * limitations under the License. 325 */ 326/** 327 * @license 328 * Copyright 2021 Google LLC 329 * 330 * Licensed under the Apache License, Version 2.0 (the "License"); 331 * you may not use this file except in compliance with the License. 332 * You may obtain a copy of the License at 333 * 334 * http://www.apache.org/licenses/LICENSE-2.0 335 * 336 * Unless required by applicable law or agreed to in writing, softw
336are 337 * distributed under the License is distributed on an "AS IS" BASIS, 338 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 339 * See the License for the specific language governing permissions and 340 * limitations under the License. 341 */ 342function M(t){return t&&t._delegate?t._delegate:t}},50944:function(t,e,n){n.d(e,{A:function(){return r.A}});var r=n(49998),i="firebase",o="8.6.1"; 343/** 344 * @license 345 * Copyright 2018 Google LLC 346 * 347 * Licensed under the Apache License, Version 2.0 (the "License"); 348 * you may not use this file except in compliance with the License. 349 * You may obtain a copy of the License at 350 * 351 * http://www.apache.org/licenses/LICENSE-2.0 352 * 353 * Unless required by applicable law or agreed to in writing, software 354 * distributed under the License is distributed on an "AS IS" BASIS, 355 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 356 * See the License for the specific language governing permissions and 357 * limitations under the License. 358 */ 359r.A.registerVersion(i,o,"app")},30707:function(t,e,n){var r=n(49998);(function(){var t,e="function"==typeof Object.defineProperties?Object.defineProperty:function(t,e,n){t!=Array.prototype&&t!=Object.prototype&&(t[e]=n.value)};function i(t){t=["object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof n.g&&n.g,t];for(var e=0;e<t.length;++e){var r=t[e];if(r&&r.Math==Math)return r}return globalThis}var o=i(this);function a(t,n){if(n){var r=o;t=t.split(".");for(var i=0;i<t.length-1;i++){var a=t[i];a in r||(r[a]={}),r=r[a]}t=t[t.length-1],i=r[t],n=n(i),n!=i&&null!=n&&e(r,t,{configurable:!0,writable:!0,value:n})}}function s(t){var e=0;return function(){return e<t.length?{done:!1,value:t[e++]}:{done:!0}}}function u(t){var e="undefined"!=typeof Symbol&&Symbol.iterator&&t[Symbol.iterator];return e?e.call(t):{next:s(t)}}a("Promise",(function(t){function e(t){this.b=0,this.c=void 0,this.a=[];var e=this.f();try{t(e.resolve,e.reject)}catch(n){e.reject(n)}}function n(){this.a=null}function r(t){return t instanceof e?t:new e((function(e){e(t)}))}if(t)return t;n.prototype.b=function(t){if(null==this.a){this.a=[];var e=this;this.c((function(){e.g()}))}this.a.push(t)};var i=o.setTimeout;n.prototype.c=function(t){i(t,0)},n.prototype.g=function(){for(;this.a&&this.a.length;){var t=this.a;this.a=[];for(var e=0;e<t.length;++e){var n=t[e];t[e]=null;try{n()}catch(r){this.f(r)}}}this.a=null},n.prototype.f=function(t){this.c((function(){throw t}))},e.prototype.f=function(){function t(t){return function(r){n||(n=!0,t.call(e,r))}}var e=this,n=!1;return{resolve:t(this.m),reject:t(this.g)}},e.prototype.m=function(t){if(t===this)this.g(new TypeError("A Promise cannot resolve to itself"));else if(t instanceof e)this.s(t);else{t:switch(typeof t){case"object":var n=null!=t;break t;case"function":n=!0;break t;default:n=!1}n?this.v(t):this.h(t)}},e.prototype.v=function(t){var e=void 0;try{e=t.then}catch(n){return void this.g(n)}"function"==typeof e?this.u(e,t):this.h(t)},e.prototype.g=function(t){this.i(2,t)},e.prototype.h=function(t){this.i(1,t)},e.prototype.i=function(t,e){if(0!=this.b)throw Error("Cannot settle("+t+", "+e+"): Promise already settled in state"+this.b);this.b=t,this.c=e,this.l()},e.prototype.l=function(){if(null!=this.a){for(var t=0;t<this.a.length;++t)a.b(this.a[t]);this.a=null}};var a=new n;return e.prototype.s=function(t){var e=this.f();t.Qa(e.resolve,e.reject)},e.prototype.u=function(t,e){var n=this.f();try{t.call(e,n.resolve,n.reject)}catch(r){n.reject(r)}},e.prototype.then=function(t,n){function r(t,e){return"function"==typeof t?function(e){try{i(t(e))}catch(n){o(n)}}:e}var i,o,a=new e((function(t,e){i=t,o=e}));return this.Qa(r(t,i),r(n,o)),a},e.prototype.catch=function(t){return this.then(void 0,t)},e.prototype.Qa=function(t,e){function n(){switch(r.b){case 1:t(r.c);break;case 2:e(r.c);break;default:throw Error("Unexpected state: "+r.b)}}var r=this;null==this.a?a.b(n):this.a.push(n)}
359,e.resolve=r,e.reject=function(t){return new e((function(e,n){n(t)}))},e.race=function(t){return new e((function(e,n){for(var i=u(t),o=i.next();!o.done;o=i.next())r(o.value).Qa(e,n)}))},e.all=function(t){var n=u(t),i=n.next();return i.done?r([]):new e((function(t,e){function o(e){return function(n){a[e]=n,s--,0==s&&t(a)}}var a=[],s=0;do{a.push(void 0),s++,r(i.value).Qa(o(a.length-1),e),i=n.next()}while(!i.done)}))},e}));var c=c||{},h=this||self,l=/^[\w+/_-]+[=]{0,2}$/,f=null;function p(t){return(t=t.querySelector&&t.querySelector("script[nonce]"))&&(t=t.nonce||t.getAttribute("nonce"))&&l.test(t)?t:""}function d(){}function v(t){var e=typeof t;return"object"!=e?e:t?Array.isArray(t)?"array":e:"null"}function g(t){var e=v(t);return"array"==e||"object"==e&&"number"==typeof t.length}function m(t){return"function"==v(t)}function y(t){var e=typeof t;return"object"==e&&null!=t||"function"==e}function b(t){return Object.prototype.hasOwnProperty.call(t,w)&&t[w]||(t[w]=++_)}var w="closure_uid_"+(1e9*Math.random()>>>0),_=0;function I(t,e,n){return t.call.apply(t.bind,arguments)}function E(t,e,n){if(!t)throw Error();if(2<arguments.length){var r=Array.prototype.slice.call(arguments,2);return function(){var n=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(n,r),t.apply(e,n)}}return function(){return t.apply(e,arguments)}}function T(t,e,n){return T=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?I:E,T.apply(null,arguments)}function S(t,e){var n=Array.prototype.slice.call(arguments,1);return function(){var e=n.slice();return e.push.apply(e,arguments),t.apply(this,e)}}var A=Date.now;function k(t,e){function n(){}n.prototype=e.prototype,t.ab=e.prototype,t.prototype=new n,t.prototype.constructor=t}function N(t){return t}
359function C(t,e,n){this.code=D+t,this.message=e||P[t]||"",this.a=n||null}function R(t){var e=t&&t.code;return e?new C(e.substring(D.length),t.message,t.serverResponse):null}k(C,Error),C.prototype.w=function(){var t={code:this.code,message:this.message};return this.a&&(t.serverResponse=this.a),t},C.prototype.toJSON=function(){return this.w()};var O,D="auth/",P={"admin-restricted-operation":"This operation is restricted to administrators only.","argument-error":"","app-not-authorized":"This app, identified by the domain where it's hosted, is not authorized to use Firebase Authentication with the provided API key. Review your key configuration in the Google API console.","app-not-installed":"The requested mobile application corresponding to the identifier (Android package name or iOS bundle ID) provided is not installed on this device.","captcha-check-failed":"The reCAPTCHA response token provided is either invalid, expired, already used or the domain associated with it does not match the list of whitelisted domains.","code-expired":"The SMS code has expired. Please re-send the verification code to try again.","cordova-not-ready":"Cordova framework is not ready.","cors-unsupported":"This browser is not supported.","credential-already-in-use":"This credential is already associated with a different user account.","custom-token-mismatch":"The custom token corresponds to a different audience.","requires-recent-login":"This operation is sensitive and requires recent authentication. Log in again before retrying this request.","dynamic-link-not-activated":"Please activate Dynamic Links in the Firebase Console and agree to the terms and conditions.","email-change-needs-verification":"Multi-factor users must al
359ways have a verified email.","email-already-in-use":"The email address is already in use by another account.","expired-action-code":"The action code has expired. ","cancelled-popup-request":"This operation has been cancelled due to another conflicting popup being opened.","internal-error":"An internal error has occurred.","invalid-app-credential":"The phone verification request contains an invalid application verifier. The reCAPTCHA token response is either invalid or expired.","invalid-app-id":"The mobile app identifier is not registed for the current project.","invalid-user-token":"This user's credential isn't valid for this project. This can happen if the user's token has been tampered with, or if the user isn't for the project associated with this API key.","invalid-auth-event":"An internal error has occurred.","invalid-verification-code":"The SMS verification code used to create the phone auth credential is invalid. Please resend the verification code sms and be sure use the verification code provided by the user.","invalid-continue-uri":"The continue URL provided in the request is invalid.","invalid-cordova-configuration":"The following Cordova plugins must be installed to enable OAuth sign-in: cordova-plugin-buildinfo, cordova-universal-links-plugin, cordova-plugin-browsertab, cordova-plugin-inappbrowser and cordova-plugin-customurlscheme.","invalid-custom-token":"The custom token format is incorrect. Please check the documentation.","invalid-dynamic-link-domain":"The provided dynamic link domain is not configured or authorized for the current project.","invalid-email":"The email address is badly formatted.","invalid-api-key":"Your API key is invalid, please check you have copied it correctly.","invalid-cert-hash":"The SHA-1 certificate hash provided is invalid.","invalid-credential":"The supplied auth credential is malformed or has expired.","invalid-message-payload":"The email template corresponding to this action contains invalid characters in its message. Please fix by going to the Auth email templates section in the Firebase Console.","invalid-multi-factor-session":"The request does not contain a valid proof of first factor successful sign-in.","invalid-oauth-provider":"EmailAuthProvider is not supported for this operation. This operation only supports OAuth providers.","invalid-oauth-client-id":"The OAuth client ID provided is either invalid or does not match the specified API key.","unauthorized-domain":"This domain is not authorized for OAuth operations for your Firebase project. Edit the list of authorized domains from the Firebase console.","invalid-action-code":"The action code is invalid. This can happen if the code is malformed, expired, or has already been used.","wrong-password":"The password is invalid or the user does not have a password.","invalid-persistence-type":"The specified persistence type is invalid. It can only be local, session or none.","invali
359d-phone-number":"The format of the phone number provided is incorrect. Please enter the phone number in a format that can be parsed into E.164 format. E.164 phone numbers are written in the format [+][country code][subscriber number including area code].","invalid-provider-id":"The specified provider ID is invalid.","invalid-recipient-email":"The email corresponding to this action failed to send as the provided recipient email address is invalid.","invalid-sender":"The email template corresponding to this action contains an invalid sender email or name. Please fix by going to the Auth email templates section in the Firebase Console.","invalid-verification-id":"The verification ID used to create the phone auth credential is invalid.","invalid-tenant-id":"The Auth instance's tenant ID is invalid.","multi-factor-info-not-found":"The user does not have a second factor matching the identifier provided.","multi-factor-auth-required":"Proof of ownership of a second factor is required to complete sign-in.","missing-android-pkg-name":"An Android Package Name must be provided if the Android App is required to be installed.","auth-domain-config-required":"Be sure to include authDomain when calling firebase.initializeApp(), by following the instructions in the Firebase console.","missing-app-credential":"The phone verification request is missing an application verifier assertion. A reCAPTCHA response token needs to be provided.","missing-verification-code":"The phone auth credential was created with an empty SMS verification code.","missing-continue-uri":"A continue URL must be provided in the request.","missing-iframe-start":"An internal error has occurred.","missing-ios-bundle-id":"An iOS Bundle ID must be provided if an App Store ID is provided.","missing-multi-factor-info":"No second factor identifier is provided.","missing-multi-factor-session":"The request is missing proof of first factor successful sign-in.","missing-or-invalid-nonce":"The request does not contain a valid nonce. This can occur if the SHA-256 hash of the provided raw nonce does not match the hashed nonce in the ID token payload.","missing-phone-number":"To send verification codes, provide a phone number for the recipient.","missing-verification-id":"The phone auth credential was created with an empty verification ID.","app-deleted":"This instance of FirebaseApp has been deleted.","account-exists-with-different-credential":"An account already exists with the same email address but different sign-in credentials. Sign in using a provider associated with this email address.","network-request-failed":"A network error (such as timeout, interrupted connection or unreachable host) has occurred.","no-auth-event":"An internal error has occurred.","no-such-provider":"User was not linked to an account with the given provider.","null-user":"A null user object was provided as the argument for an operation which requires a non-null user object.","operation-not-allowed":"The given sign-in provider is disabled for this Firebase project. Enable it in the Firebase console, under the sign-in method tab of the Auth section.","operation-not-supported-in-this-environment":'This operation is not supported in the environment this application is running on. "location.protocol" must be http, https or chrome-extension and web storage must be enabled.',"popup-blocked":"Unable to establish a connection with the popup. It may have been blocked by the browser.","popup-closed-by-user":"The popup has been closed by the user before finalizing the operation.","provider-already-linked":"User can only be linked to one identity for the given provider.","quota-exceeded":"The project's quota for this operation has been exceeded.","redirect-cancelled-by-user":"The redirect operation has been cancelled by the user before finalizing.","redirect-operation-pending":"A redirect sign-in operation is already pending.","rejected-credential":"The request contains malformed or mismatching credentials.","second-factor-already-in-use":"The second factor is already enrolled on this account.","maximum-second-factor-count-exceeded":"The maximum allowed number of second factors on a user has been exceeded.","tenant-id-mismatch":"The provided tenant ID does not match the Auth instance's tenant ID",timeout:"The operation has timed out.","user-token-expired":"The user's credential is no longer valid. The user must sign in again.","too-many-requests":"We have blocked all requests from this device due to unusual activity. Try again later.","unauthorized-continue-uri":"The domain of the continue URL is not whitelisted. Please whitelist the domain in the Firebase console.","unsupported-first-factor":"Enrolling a second factor or signing in with a multi-factor account requires sign-in with a supported first factor.","unsupported-persistence-type":"The current environment does not support the specified persistence type.","unsupported-tenant-operation":"This operation is not supported in a multi-tenant context.","unverified-email":"The operation requires a verified email.","user-cancelled":"The user did not grant your application the permissions it requested.","user-not-found":"There is no user record corresponding to this identifier. The user may have been deleted.","user-disabled":"The user account has been disabled by an administrator.","user-mismatch":"The supplied credentials do not correspond to the previously signed in user.","user-signed-out":"","weak-password":"The password must be 6 characters long or more.","web-storage-unsupported":"This browser is not supported or 3rd party cookies and data may be disabled."},L={ld:{Ta:"https://staging-identitytoolkit.sandbox.googleapis.com/identitytoolkit/v3/relyingparty/",Za:"https://staging-securetoken.sandbox.googleapis.com/v1/token",Wa:"https://staging-identitytoolkit.sandbox.googleapis.com/v2/",id:"b"},sd:{Ta:"https://www.googleapis.com/identitytoolkit/v3/relyingparty/",Za:"https://securetoken.googleapis.com/v1/token",Wa:"https://identitytoolkit.googleapis.com/v2/",id:"p"},ud:{Ta:"https://staging-www.sandbox.googleapis.com/identitytoolkit/v3/relyingparty/",Za:"https://staging-securetoken.sandbox.googleapis.com/v1/token",Wa:"https://staging-identitytoolkit.sandbox.googleapis.com/v2/",id:"s"},vd:{Ta:"https://www-googleapis-test.sandbox.google.com/identitytoolkit/v3/relyingparty/",Za:"https://test-securetoken.sandbox.googleapis.com/v1/token",Wa:"https://test-identitytoolkit.sandbox.googleapis.com/v2/",id:"t"}};function x(t){for(var e in L)if(L[e].id===t)return t=L[e],{firebaseEndpoint:t.Ta,secureTokenEndpoint:t.Za,identityPlatformEndpoint:t.Wa};return null}function M(t){if(!t)return!1;
359try{return!!t.$goog_Thenable}catch(e){return!1}}function U(t){if(Error.captureStackTrace)Error.captureStackTrace(this,U);else{var e=Error().stack;e&&(this.stack=e)}t&&(this.message=String(t))}function F(t,e){t=t.split("%s");for(var n="",r=t.length-1,i=0;i<r;i++)n+=t[i]+(i<e.length?e[i]:"%s");U.call(this,n+t[r])}function V(t,e){throw new F("Failure"+(t?": "+t:""),Array.prototype.slice.call(arguments,1))}function H(t,e){this.c=t,this.f=e,this.b=0,this.a=null}function j(t,e){t.f(e),100>t.b&&(t.b++,e.next=t.a,t.a=e)}function q(){this.b=this.a=null}O=x("__EID__")?"__EID__":void 0,k(U,Error),U.prototype.name="CustomError",k(F,U),F.prototype.name="AssertionError",H.prototype.get=function(){if(0<this.b){this.b--;var t=this.a;this.a=t.next,t.next=null}else t=this.c();return t};var B=new H((function(){return new G}),(function(t){t.reset()}));function K(){var t=Oe,e=null;return t.a&&(e=t.a,t.a=t.a.next,t.a||(t.b=null),e.next=null),e}function G(){this.next=this.b=this.a=null}q.prototype.add=function(t,e){var n=B.get();n.set(t,e),this.b?this.b.next=n:this.a=n,this.b=n},G.prototype.set=function(t,e){this.a=t,this.b=e,this.next=null},G.prototype.reset=function(){this.next=this.b=this.a=null};var Y=Array.prototype.indexOf?function(t,e){return Array.prototype.indexOf.call(t,e,void 0)}:function(t,e){if("string"===typeof t)return"string"!==typeof e||1!=e.length?-1:t.indexOf(e,0);for(var n=0;n<t.length;n++)if(n in t&&t[n]===e)return n;return-1},z=Array.prototype.forEach?function(t,e,n){Array.prototype.forEach.call(t,e,n)}:function(t,e,n){for(var r=t.length,i="string"===typeof t?t.split(""):t,o=0;o<r;o++)o in i&&e.call(n,i[o],o,t)};function W(t,e){for(var n="string"===typeof t?t.split(""):t,r=t.length-1;0<=r;--r)r in n&&e.call(void 0,n[r],r,t)}var X=Array.prototype.filter?function(t,e){return Array.prototype.filter.call(t,e,void 0)}:function(t,e){for(var n=t.length,r=[],i=0,o="string"===typeof t?t.split(""):t,a=0;a<n;a++)if(a in o){var s=o[a];e.call(void 0,s,a,t)&&(r[i++]=s)}return r},Q=Array.prototype.map?function(t,e){return Array.prototype.map.call(t,e,void 0)}:function(t,e){for(var n=t.length,r=Array(n),i="string"===typeof t?t.split(""):t,o=0;o<n;o++)o in i&&(r[o]=e.call(void 0,i[o],o,t));return r},J=Array.prototype.some?function(t,e){return Array.prototype.some.call(t,e,void 0)}:function(t,e){for(var n=t.length,r="string"===typeof t?t.split(""):t,i=0;i<n;i++)if(i in r&&e.call(void 0,r[i],i,t))return!0;return!1};function $(t){t:{for(var e=os,n=t.length,r="string"===typeof t?t.split(""):t,i=0;i<n;i++)if(i in r&&e.call(void 0,r[i],i,t)){e=i;break t}e=-1}return 0>e?null:"string"===typeof t?t.charAt(e):t[e]}function Z(t,e){return 0<=Y(t,e)}function tt(t,e){var n;return e=Y(t,e),(n=0<=e)&&Array.prototype.splice.call(t,e,1),n}function et(t,e){W(t,(function(n,r){e.call(void 0,n,r,t)&&1==Array.prototype.splice.call(t,r,1).length&&0}))}function nt(t){return Array.prototype.concat.apply([],arguments)}function rt(t){var e=t.length;if(0<e){for(var n=Array(e),r=0;r<e;r++)n[r]=t[r];return n}return[]}var it,ot=String.prototype.trim?function(t){return t.trim()}:function(t){return/^[\s\xa0]*([\s\S]*?)[\s\xa0]*$/.exec(t)[1]},at=/&/g,st=/</g,ut=/>/g,ct=/"/g,ht=/'/g,lt=/\x00/g,ft=/[\x00&<>"']/;function pt(t,e){return-1!=t.indexOf(e)}function dt(t,e){return t<e?-1:t>e?1:0}t:{var vt=h.navigator;if(vt){var gt=vt.userAgent;if(gt){it=gt;break t}}it=""}function mt(t){return pt(it,t)}function yt(t,e){for(var n in t)e.call(void 0,t[n],n,t)}function bt(t){for(var e in t)return!1;return!0}function wt(t){var e,n={};for(e in t)n[e]=t[e];return n}var _t="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function It(t,e){for(var n,r,i=1;i<arguments.length;i++){for(n in r=arguments[i],r)t[n]=r[n];for(var o=0;o<_t.length;o++)n=_t[o],Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}}function Et(t,e){t:{try{var n=t&&t.ownerDocument,r=n&&(n.defaultView||n.parentWindow);if(r=r||h,r.Element&&r.Location){var i=r;break t}}catch(a){}i=null}if(i&&"undefined"!=typeof i[e]&&(!t||!(t instanceof i[e])&&(t instanceof i.Location||t instanceof i.Element))){if
359(y(t))try{var o=t.constructor.displayName||t.constructor.name||Object.prototype.toString.call(t)}catch(a){o="<object could not be stringified>"}else o=void 0===t?"undefined":null===t?"null":typeof t;V("Argument is not a %s (or a non-Element, non-Location mock); got: %s",e,o)}}function Tt(t,e){this.a=t===Nt&&e||"",this.b=kt}function St(t){return t instanceof Tt&&t.constructor===Tt&&t.b===kt?t.a:(V("expected object of type Const, got '"+t+"'"),"type_error:Const")}Tt.prototype.sa=!0,Tt.prototype.ra=function(){return this.a},Tt.prototype.toString=function(){return"Const{"+this.a+"}"};var At,kt={},Nt={};function Ct(){if(void 0===At){var t=null,e=h.trustedTypes;if(e&&e.createPolicy){try{t=e.createPolicy("goog#html",{createHTML:N,createScript:N,createScriptURL:N})}catch(n){h.console&&h.console.error(n.message)}At=t}else At=t}return At}function Rt(t,e){this.a=e===xt?t:""}function Ot(t){return t instanceof Rt&&t.constructor===Rt?t.a:(V("expected object of type TrustedResourceUrl, got '"+t+"' of type "+v(t)),"type_error:TrustedResourceUrl")}function Dt(t,e){var n=St(t);if(!Lt.test(n))throw Error("Invalid TrustedResourceUrl format: "+n);return t=n.replace(Pt,(function(t,r){if(!Object.prototype.hasOwnProperty.call(e,r))throw Error('Found marker, "'+r+'", in format string, "'+n+'", but no valid label mapping found in args: '+JSON.stringify(e));return t=e[r],t instanceof Tt?St(t):encodeURIComponent(String(t))})),Mt(t)}Rt.prototype.sa=!0,Rt.prototype.ra=function(){return this.a.toString()},Rt.prototype.toString=function(){return"TrustedResourceUrl{"+this.a+"}"};var Pt=/%{(\w+)}/g,Lt=/^((https:)?\/\/[0-9a-z.:[\]-]+\/|\/[^/\\]|[^:/\\%]+\/|[^:/\\%]*[?#]|about:blank#)/i,xt={};function Mt(t){var e=Ct();return t=e?e.createScriptURL(t):t,new Rt(t,xt)}function Ut(t,e){this.a=e===Kt?t:""}function Ft(t){return t instanceof Ut&&t.constructor===Ut?t.a:(V("expected object of type SafeUrl, got '"+t+"' of type "+v(t)),"type_error:SafeUrl")}Ut.prototype.sa=!0,Ut.prototype.ra=function(){return this.a.toString()},Ut.prototype.toString=function(){return"SafeUrl{"+this.a+"}"};var Vt=/^(?:audio\/(?:3gpp2|3gpp|aac|L16|midi|mp3|mp4|mpeg|oga|ogg|opus|x-m4a|x-matroska|x-wav|wav|webm)|font\/\w+|image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp|x-icon)|text\/csv|video\/(?:mpeg|mp4|ogg|webm|quicktime|x-matroska))(?:;\w+=(?:\w+|"[\w;,= ]+"))*$/i,Ht=/^data:(.*);base64,[a-z0-9+\/]+=*$/i,jt=/^(?:(?:https?|mailto|ftp):|[^:/?#]*(?:[/?#]|$))/i;function qt(t){if(t instanceof Ut)return t;if(t="object"==typeof t&&t.sa?t.ra():String(t),jt.test(t))t=new Ut(t,Kt);else{t=String(t),t=t.replace(/(%0A|%0D)/g,"");var e=t.match(Ht);t=e&&Vt.test(e[1])?new Ut(t,Kt):null}return t}function Bt(t){return t instanceof Ut?t:(t="object"==typeof t&&t.sa?t.ra():String(t),jt.test(t)||(t="about:invalid#zClosurez"),new Ut(t,Kt))}var Kt={},Gt=new Ut("about:invalid#zClosurez",Kt);function Yt(t,e,n){this.a=n===Wt?t:""}function zt(t){return t instanceof Yt&&t.constructor===Yt?t.a:(V("expected object of type SafeHtml, got '"+t+"' of type "+v(t)),"type_error:SafeHtml")}Yt.prototype.sa=!0,Yt.prototype.ra=function(){return this.a.toString()},Yt.prototype.toString=function(){return"SafeHtml{"+this.a+"}"};var Wt={};function Xt(t,e){Et(t,"HTMLScriptElement"),t.src=Ot(e),(e=t.ownerDocument&&t.ownerDocument.defaultView)&&e!=h?e=p(e.document):(null===f&&(f=p(h.document)),e=f),e&&t.setAttribute("nonce",e)}function Qt(t,e,n,r){return t=t instanceof Ut?t:Bt(t),e=e||h,n=n instanceof Tt?St(n):n||"",e.open(Ft(t),n,r,void 0)}function Jt(t,e){for(var n=t.split("%s"),r="",i=Array.prototype.slice.call(arguments,1);i.length&&1<n.length;)r+=n.shift()+i.shift();return r+n.join("%s")}function $t(t){return ft.test(t)&&(-1!=t.indexOf("&")&&(t=t.replace(at,"&")),-1!=t.indexOf("<")&&(t=t.replace(st,"<")),-1!=t.indexOf(">")&&(t=t.replace(ut,">")),-1!=t.indexOf('"')&&(t=t.replace(ct,""")),-1!=t.indexOf("'")&&(t=t.replace(ht,"'")),-1!=t.indexOf("\0")&&(t=t.replace(lt,"�"))),t}function Zt(t){return Zt[" "](t),t}function te(t,e){var n=pe;return Object.prototype.hasOwnProperty.call(n,t)?n[t]:n[t]=e(t)}Zt[" "]=d;var ee,ne=mt("Opera"),re=mt("Trident")||mt("MSIE"),ie=mt("Edge"),oe=ie||re,ae=mt("Gecko")&&!(pt(it.toLowerCase(),"webkit")&&!mt("Edge"))&&!(mt("Trident")||mt("MSIE"))&&!mt("Edge"),se=pt(it.toLowerCase(),"webkit")&&!mt("Edge");function ue(){var t=h.document;return t?t.documentMode:void 0}t:{var ce="",he=function(){var t=it;return ae?/rv:([^\);]+)(\)|;)/.exec(t):ie?/Edge\/([\d\.]+)/.exec(t):re?/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(t):se?/WebKit\/(\S+)/.exec(t):ne?/(?:Version)[ \/]?(\S+)/.exec(t):void 0}();if(he&&(ce=he?he[1]:""),re){var le=ue();if(null!=le&&le>parseFloat(ce)){ee=String(le);break t}}ee=ce}var fe,pe={};function de(t){return te(t,(function(){for(var e=0,n=ot(String(ee)).split("."),r=ot(String(t)).split("."),i=Math.max(n.length,r.length),o=0;0==e&&o<i;o++){var a=n[o]||"",s=r[o]||"";do{if(a=/(\d*)(\D*)(.*)/.exec(a)||["","","",""],s=/(\d*)(\D*)(.*)/.exec(s)||["","","",""],0==a[0].length&&0==s[0].length)break;e=dt(0==a[1].length?0:parseInt(a[1],10),0==s[1].length?0:parseInt(s[1],10))||dt(0==a[2].length,0==s[2].length)||dt(a[2],s[2]),a=a[3],s=s[3]}while(0==e)}return 0<=e}))}if(h.document&&re){var ve=ue();fe=ve||(parseInt(ee,10)||void 0)}else fe=void 0;var ge=fe;try{new self.OffscreenCanvas(0,0).getContext("2d")}catch(Zp){}var me=!re||9<=Number(ge);function ye(t){var e=document;return"string"===typeof t?e.getElementById(t):t}function be(t,e){yt(e,(function(e,n){e&&"object"==typeof e&&e.sa&&(e=e.ra()),"style"==n?t.style.cssText=e:"class"==n?t.className=e:"for"==n?t.htmlFor=e:Ie.hasOwnProperty(n)?t.setAttribute(Ie[
359n],e):0==n.lastIndexOf("aria-",0)||0==n.lastIndexOf("data-",0)?t.setAttribute(n,e):t[n]=e}))}var we,_e,Ie={cellpadding:"cellPadding",cellspacing:"cellSpacing",colspan:"colSpan",frameborder:"frameBorder",height:"height",maxlength:"maxLength",nonce:"nonce",role:"role",rowspan:"rowSpan",type:"type",usemap:"useMap",valign:"vAlign",width:"width"};function Ee(t,e,n){var r=arguments,i=document,o=String(r[0]),a=r[1];if(!me&&a&&(a.name||a.type)){if(o=["<",o],a.name&&o.push(' name="',$t(a.name),'"'),a.type){o.push(' type="',$t(a.type),'"');var s={};It(s,a),delete s.type,a=s}o.push(">"),o=o.join("")}return o=Se(i,o),a&&("string"===typeof a?o.className=a:Array.isArray(a)?o.className=a.join(" "):be(o,a)),2<r.length&&Te(i,o,r),o}function Te(t,e,n){function r(n){n&&e.appendChild("string"===typeof n?t.createTextNode(n):n)}for(var i=2;i<n.length;i++){var o=n[i];if(!g(o)||y(o)&&0<o.nodeType)r(o);else{t:{if(o&&"number"==typeof o.length){if(y(o)){var a="function"==typeof o.item||"string"==typeof o.item;break t}if(m(o)){a="function"==typeof o.item;break t}}a=!1}z(a?rt(o):o,r)}}}function Se(t,e){return e=String(e),"application/xhtml+xml"===t.contentType&&(e=e.toLowerCase()),t.createElement(e)}function Ae(t){h.setTimeout((function(){throw t}),0)}function ke(){var t=h.MessageChannel;if("undefined"===typeof t&&"undefined"!==typeof window&&window.postMessage&&window.addEventListener&&!mt("Presto")&&(t=function(){var t=Se(document,"IFRAME");t.style.display="none",document.documentElement.appendChild(t);var e=t.contentWindow;t=e.document,t.open(),t.close();var n="callImmediate"+Math.random(),r="file:"==e.location.protocol?"*":e.location.protocol+"//"+e.location.host;t=T((function(t){"*"!=r&&t.origin!=r||t.data!=n||this.port1.onmessage()}),this),e.addEventListener("message",t,!1),this.port1={},this.port2={postMessage:function(){e.postMessage(n,r)}}}),"undefined"!==typeof t&&!mt("Trident")&&!mt("MSIE")){var e=new t,n={},r=n;return e.port1.onmessage=function(){if(void 0!==n.next){n=n.next;var t=n.Gb;n.Gb=null,t()}},function(t){r.next={Gb:t},r=r.next,e.port2.postMessage(0)}}return function(t){h.setTimeout(t,0)}}function Ne(t,e){_e||Ce(),Re||(_e(),Re=!0),Oe.add(t,e)}function Ce(){if(h.Promise&&h.Promise.resolve){var t=h.Promise.resolve(void 0);_e=function(){t.then(De)}}else _e=function(){var t=De;!m(h.setImmediate)||h.Window&&h.Window.prototype&&!mt("Edge")&&h.Window.prototype.setImmediate==h.setImmediate?(we||(we=ke()),we(t)):h.setImmediate(t)}}var Re=!1,Oe=new q;function De(){for(var t;t=K();){try{t.a.call(t.b)}catch(e){Ae(e)}j(B,t)}Re=!1}function Pe(t,e){if(this.a=Le,this.i=void 0,this.f=this.b=this.c=null,this.g=this.h=!1,t!=d)try{var n=this;t.call(e,(function(t){We(n,xe,t)}),(function(t){if(!(t instanceof rn))try{if(t instanceof Error)throw t;throw Error("Promise rejected.")}catch(e){}We(n,Me,t)}))}catch(r){We(this,Me,r)}}var Le=0,xe=2,Me=3;function Ue(){this.next=this.f=this.b=this.g=this.a=null,this.c=!1}Ue.prototype.reset=function(){this.f=this.b=this.g=this.a=null,this.c=!1};var Fe=new H((function(){return new Ue}),(function(t){t.reset()}));function Ve(t,e,n){var r=Fe.get();return r.g=t,r.b=e,r.f=n,r}function He(t){if(t instanceof Pe)return t;var e=new Pe(d);return We(e,xe,t),e}
359function je(t){return new Pe((function(e,n){n(t)}))}function qe(t,e,n){Xe(t,e,n,null)||Ne(S(e,t))}function Be(t){return new Pe((function(e,n){var r=t.length,i=[];if(r)for(var o,a=function(t,n){r--,i[t]=n,0==r&&e(i)},s=function(t){n(t)},u=0;u<t.length;u++)o=t[u],qe(o,S(a,u),s);else e(i)}))}function Ke(t){return new Pe((function(e){var n=t.length,r=[];if(n)for(var i,o=function(t,i,o){n--,r[t]=i?{Pb:!0,value:o}:{Pb:!1,reason:o},0==n&&e(r)},a=0;a<t.length;a++)i=t[a],qe(i,S(o,a,!0),S(o,a,!1));else e(r)}))}function Ge(t,e){if(t.a==Le)if(t.c){var n=t.c;if(n.b){for(var r=0,i=null,o=null,a=n.b;a&&(a.c||(r++,a.a==t&&(i=a),!(i&&1<r)));a=a.next)i||(o=a);i&&(n.a==Le&&1==r?Ge(n,e):(o?(r=o,r.next==n.f&&(n.f=r),r.next=r.next.next):$e(n),Ze(n,i,Me,e)))}t.c=null}else We(t,Me,e)}function Ye(t,e){t.b||t.a!=xe&&t.a!=Me||Je(t),t.f?t.f.next=e:t.b=e,t.f=e}function ze(t,e,n,r){var i=Ve(null,null,null);return i.a=new Pe((function(t,o){i.g=e?function(n){try{var i=e.call(r,n);t(i)}catch(a){o(a)}}:t,i.b=n?function(e){try{var i=n.call(r,e);void 0===i&&e instanceof rn?o(e):t(i)}catch(a){o(a)}}:o})),i.a.c=t,Ye(t,i),i.a}function We(t,e,n){t.a==Le&&(t===n&&(e=Me,n=new TypeError("Promise cannot resolve to itself")),t.a=1,Xe(n,t.$c,t.ad,t)||(t.i=n,t.a=e,t.c=null,Je(t),e!=Me||n instanceof rn||en(t,n)))}function Xe(t,e,n,r){if(t instanceof Pe)return Ye(t,Ve(e||d,n||null,r)),!0;if(M(t))return t.then(e,n,r),!0;if(y(t))try{var i=t.then;if(m(i))return Qe(t,i,e,n,r),!0}catch(o){return n.call(r,o),!0}return!1}function Qe(t,e,n,r,i){function o(t){s||(s=!0,r.call(i,t))}function a(t){s||(s=!0,n.call(i,t))}var s=!1;try{e.call(t,a,o)}catch(u){o(u)}}function Je(t){t.h||(t.h=!0,Ne(t.gc,t))}function $e(t){var e=null;return t.b&&(e=t.b,t.b=e.next,e.next=null),t.b||(t.f=null),e}function Ze(t,e,n,r){if(n==Me&&e.b&&!e.c)for(;t&&t.g;t=t.c)t.g=!1;if(e.a)e.a.c=null,tn(e,n,r);else try{e.c?e.g.call(e.f):tn(e,n,r)}catch(i){nn.call(null,i)}j(Fe,e)}function tn(t,e,n){e==xe?t.g.call(t.f,n):t.b&&t.b.call(t.f,n)}function en(t,e){t.g=!0,Ne((function(){t.g&&nn.call(null,e)}))}Pe.prototype.then=function(t,e,n){return ze(this,m(t)?t:null,m(e)?e:null,n)},Pe.prototype.$goog_Thenable=!0,t=Pe.prototype,t.oa=function(t,e){return t=Ve(t,t,e),t.c=!0,Ye(this,t),this},t.o=function(t,e){return ze(this,null,t,e)},t.cancel=function(t){if(this.a==Le){var e=new rn(t);Ne((function(){Ge(this,e)}),this)}},t.$c=function(t){this.a=Le,We(this,xe,t)},t.ad=function(t){this.a=Le,We(this,Me,t)},t.gc=function(){for(var t;t=$e(this);)Ze(this,t,this.a,this.i);this.h=!1};var nn=Ae;function rn(t){U.call(this,t)}function on(){0!=an&&(sn[b(this)]=this),this.xa=this.xa,this.pa=this.pa}k(rn,U),rn.prototype.name="cancel";var an=0,sn={};function un(t){if(!t.xa&&(t.xa=!0,t.Da(),0!=an)){var e=b(t);if(0!=an&&t.pa&&0<t.pa.length)throw Error(t+" did not empty its onDisposeCallbacks queue. This probably means it overrode dispose() or disposeInternal() without calling the superclass' method.");delete sn[e]}}on.prototype.xa=!1,on.prototype.Da=function(){if(this.pa)for(;this.pa.length;)this.pa.shift()()};var cn=Object.freeze||function(t){return t},hn=!re||9<=Number(ge),ln=re&&!de("9"),fn=function(){if(!h.addEventListener||!Object.defineProperty)return!1;var t=!1,e=Object.defineProperty({},"passive",{get:function(){t=!0}});try{h.addEventListener("test",d,e),h.removeEventListener("test",d,e)}catch(n){}return t}();function pn(t,e){this.type=t,this.b=this.target=e,this.defaultPrevented=!1}function dn(t,e){if(pn.call(this,t?t.type:""),this.relatedTarget=this.b=this.target=null,this.button=this.screenY=this.screenX=this.clientY=this.clientX=0,this.key="",this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1,this.pointerId=0,this.pointerType="",this.a=null,t){var n=this.type=t.type,r=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:null;if(this.target=t.target||t.srcElement,this.b=e,e=t.relatedTarget){if(ae){t:{try{Zt(e.nodeName);var i=!0;break t}catch(o){}i=!1}i||(e=null)}}else"mouseover"==n?e=t.fromElement:"mouseout"==n&&(e=t.toElement);this.relatedTarget=e,r?(this.clientX=void 0!==r.clientX?r.clientX:r.pageX,this.clientY=void 0!==r.clientY?r.clientY:r.pageY,this.screenX=r.screenX||0,this.screenY=r.screenY||0):(this.clientX=void 0!==t.clientX?t.clientX:t.pageX,this.clientY=void 0!==t.clientY?t.clientY:t.pageY,this.screenX=t.screenX||0,this.screenY=t.screenY||0),this.button=t.button,this.key=t.key||"",this.ctrlKey=t.ctrlKey,this.altKey=t.altKey,this.shiftKey=t.shiftKey,this.metaKey=t.metaKey,this.pointerId=t.pointerId||0,this.pointerType="string"===typeof t.pointerType?t.pointerType:vn[t.pointerType]||"",this.a=t,t.defaultPrevented&&this.preventDefault()}}pn.prototype.preventDefault=function(){this.defaultPrevented=!0},k(dn,pn);var vn=cn({2:"touch",3:"pen",4:"mouse"});dn.prototype.preventDefault=function(){dn.ab.preventDefault.call(this);var t=this.a;if(t.preventDefault)t.preventDefault();else if(t.returnValue=!1,ln)try{(t.ctrlKey||112<=t.keyCode&&123>=t.keyCode)&&(t.keyCode=-1)}catch(e){}},dn.prototype.g=function(){return this.a};var gn="closure_listenable_"+(1e6*Math.random()|0),mn=0;function yn(t,e,n,r,i){this.listener=t,this.proxy=null,this.src=e,this.type=n,this.capture=!!r,this.Va=i,this.key=++mn,this.va=this.Pa=!1}function bn(t){t.va=!0,t.listener=null,t.proxy=null,t.src=null,t.Va=null}function wn(t){this.src=t,this.a={},this.b=0}function _n(t,e){var n=e.type;n in t.a&&tt(t.a[n],e)&&(bn(e),0==t.a[n].length&&(delete t.a[n],t.b--))}function In(t,e,n,r){for(var i=0;i<t.length;++i){var o=t[i];if(!o.va&&o.listener==e&&o.capture==!!n&&o.Va==r)return i}return-1}wn.prototype.add=function(t,e,n,r,i){var o=t.toString();t=this.a[o],t||(t=this.a[o]=[],this.b++);var a=In(t,e,r,i);return-1<a?(e=t[a],n||(e.Pa=!1)):(e=new yn(e,this.src,o,!!r,i),e.Pa=n,t.push(e)),e};var En="closure_lm_"+(1e6*Math.random()|0),Tn={};function Sn(t,e,n,r,i){if(r&&r.once)Nn(t,e,n,r,i);else if(Array.isArray(e))for(var o=0;o<e.length;o++)Sn(t,e[o],n,r,i);else n=Un(n),t&&t[gn]?Vn(t,e,n,y(r)?!!r.capture:!!r,i):An(t,e,n,!1,r,i)}function An(t,e,n,r,i,o){if(!e)throw Error("Invalid event type");var a=y(i)?!!i.capture:!!i,s=xn(t);if(s||(t[En]=s=new wn(t)),n=s.add(e,n,r,a,o),!n.proxy){if(r=kn(),n.proxy=r,r.src=t,r.listener=n,t.addEventListener)fn||(i=a),void 0===i&&(i=!1),t.addEventListener(e.toString(),r,i);else if(t.attachEvent)t.attachEvent(On(e.toString()),r);else{if(!t.addListener||!t.removeListener)throw Error("addEventListener and attachEvent are unavailable.");t.addListener(r)}0}}function kn(){var t=Ln,e=hn?function(n){return t.call(e.src,e.listener,n)}:function(n){if(n=t.call(e.src,e.listener,n),!n)return n};return e}function Nn(t,e,n,r,i){if(Array.isArray(e))for(var o=0;o<e.length;o++)Nn(t,e[o],n,r,i);else n=Un(n),t&&t[gn]?Hn(t,e,n,y(r)?!!r.capture:!!r,i):An(t,e,n,!0,r,i)}function Cn(t,e,n,r,i){if(Array.isArray(e))for(var o=0;o<e.length;o++)Cn(t,e[o],n,r,i);else r=y(r)?!!r.capture:!!r,n=Un(n),t&&t[gn]?(t=t.v,e=String(e).toString(),e in t.a&&(o=t.a[e],n=In(o,n,r,i),-1<n&&(bn(o[n]),Array.prototype.splice.call(o,n,1),0==o.length&&(delete t.a[e],t.b--)))):t&&(t=xn(t))&&(e=t.a[e.toString()],t=-1,e&&(t=In(e,n,r,i)),(n=-1<t?e[t]:null)&&Rn(n))}function Rn(t){if("number"!==typeof t&&t&&!t.va){var e=t.src;if(e&&e[gn])_n(e.v,t);else{var n=t.type,r=t.proxy;e.removeEventListener?e.removeEventListener(n,r,t.capture):e.detachEvent?e.detachEvent(On(n),r):e.addListener&&e.removeListener&&e.removeListener(r),(n=xn(e))?(_n(n,t),0==n.b&&(n.src=null,e[En]=null)):bn(t)}}}function On(t){return t in Tn?Tn[t]:Tn[t]="on"+t}function Dn(t,e,n,r){var i=!0;if((t=xn(t))&&(e=t.a[e.toString()]))for(e=e.concat(),t=0;t<e.length;t++){var o=e[t];o&&o.capture==n&&!o.va&&(o=Pn(o,r),i=i&&!1!==o)}return i}function Pn(t,e){var n=t.listener,r=t.Va||t.src;return t.Pa&&Rn(t),n.call(r,e)}function Ln(t,e){if(t.va)return!0;
359if(!hn){if(!e)t:{e=["window","event"];for(var n=h,r=0;r<e.length;r++)if(n=n[e[r]],null==n){e=null;break t}e=n}if(r=e,e=new dn(r,this),n=!0,!(0>r.keyCode||void 0!=r.returnValue)){t:{var i=!1;if(0==r.keyCode)try{r.keyCode=-1;break t}catch(a){i=!0}(i||void 0==r.returnValue)&&(r.returnValue=!0)}for(r=[],i=e.b;i;i=i.parentNode)r.push(i);for(t=t.type,i=r.length-1;0<=i;i--){e.b=r[i];var o=Dn(r[i],t,!0,e);n=n&&o}for(i=0;i<r.length;i++)e.b=r[i],o=Dn(r[i],t,!1,e),n=n&&o}return n}return Pn(t,new dn(e,this))}function xn(t){return t=t[En],t instanceof wn?t:null}var Mn="__closure_events_fn_"+(1e9*Math.random()>>>0);function Un(t){return m(t)?t:(t[Mn]||(t[Mn]=function(e){return t.handleEvent(e)}),t[Mn])}function Fn(){on.call(this),this.v=new wn(this),this.ac=this,this.gb=null}function Vn(t,e,n,r,i){t.v.add(String(e),n,!1,r,i)}function Hn(t,e,n,r,i){t.v.add(String(e),n,!0,r,i)}function jn(t,e,n,r){if(e=t.v.a[String(e)],!e)return!0;e=e.concat();for(var i=!0,o=0;o<e.length;++o){var a=e[o];if(a&&!a.va&&a.capture==n){var s=a.listener,u=a.Va||a.src;a.Pa&&_n(t.v,a),i=!1!==s.call(u,r)&&i}}return i&&!r.defaultPrevented}function qn(t,e,n){if(m(t))n&&(t=T(t,n));else{if(!t||"function"!=typeof t.handleEvent)throw Error("Invalid listener argument");t=T(t.handleEvent,t)}return 2147483647<Number(e)?-1:h.setTimeout(t,e||0)}function Bn(t){var e=null;return new Pe((function(n,r){e=qn((function(){n(void 0)}),t),-1==e&&r(Error("Failed to schedule timer."))})).o((function(t){throw h.clearTimeout(e),t}))}function Kn(t){if(t.W&&"function"==typeof t.W)return t.W();if("string"===typeof t)return t.split("");if(g(t)){for(var e=[],n=t.length,r=0;r<n;r++)e.push(t[r]);return e}for(r in e=[],n=0,t)e[n++]=t[r];return e}function Gn(t){if(t.Y&&"function"==typeof t.Y)return t.Y();if(!t.W||"function"!=typeof t.W){if(g(t)||"string"===typeof t){var e=[];t=t.length;for(var n=0;n<t;n++)e.push(n);return e}for(var r in e=[],n=0,t)e[n++]=r;return e}}function Yn(t,e){if(t.forEach&&"function"==typeof t.forEach)t.forEach(e,void 0);else if(g(t)||"string"===typeof t)z(t,e,void 0);else for(var n=Gn(t),r=Kn(t),i=r.length,o=0;o<i;o++)e.call(void 0,r[o],n&&n[o],t)}function zn(t,e){this.b={},this.a=[],this.c=0;var n=arguments.length;if(1<n){if(n%2)throw Error("Uneven number of arguments");for(var r=0;r<n;r+=2)this.set(arguments[r],arguments[r+1])}else if(t)if(t instanceof zn)for(n=t.Y(),r=0;r<n.length;r++)this.set(n[r],t.get(n[r]));else for(r in t)this.set(r,t[r])}function Wn(t){if(t.c!=t.a.length){for(var e=0,n=0;e<t.a.length;){var r=t.a[e];Xn(t.b,r)&&(t.a[n++]=r),e++}t.a.length=n}if(t.c!=t.a.length){var i={};for(n=e=0;e<t.a.length;)r=t.a[e],Xn(i,r)||(t.a[n++]=r,i[r]=1),e++;t.a.length=n}}function Xn(t,e){return Object.prototype.hasOwnProperty.call(t,e)}k(Fn,on),Fn.prototype[gn]=!0,Fn.prototype.addEventListener=function(t,e,n,r){Sn(this,t,e,n,r)},Fn.prototype.removeEventListener=function(t,e,n,r){Cn(this,t,e,n,r)},Fn.prototype.dispatchEvent=function(t){var e,n=this.gb;if(n)for(e=[];n;n=n.gb)e.push(n);n=this.ac;var r=t.type||t;if("string"===typeof t)t=new pn(t,n);else if(t instanceof pn)t.target=t.target||n;else{var i=t;t=new pn(r,n),It(t,i)}if(i=!0,e)for(var o=e.length-1;0<=o;o--){var a=t.b=e[o];i=jn(a,r,!0,t)&&i}if(a=t.b=n,i=jn(a,r,!0,t)&&i,i=jn(a,r,!1,t)&&i,e)for(o=0;o<e.length;o++)a=t.b=e[o],i=jn(a,r,!1,t)&&i;return i},Fn.prototype.Da=function(){if(Fn.ab.Da.call(this),this.v){var t,e=this.v;for(t in e.a){for(var n=e.a[t],r=0;r<n.length;r++)bn(n[r]);delete e.a[t],e.b--}}this.gb=null},t=zn.prototype,t.W=function(){Wn(this);for(var t=[],e=0;e<this.a.length;e++)t.push(this.b[this.a[e]]);return t},t.Y=function(){return Wn(this),this.a.concat()},t.clear=function(){this.b={},this.c=this.a.length=0},t.get=function(t,e){return Xn(this.b,t)?this.b[t]:e},t.set=function(t,e){Xn(this.b,t)||(this.c++,this.a.push(t)),this.b[t]=e},t.forEach=function(t,e){for(var n=this.Y(),r=0;r<n.length;r++){var i=n[r],o=this.get(i);t.call(e,o,i,this)}};var Qn=/^(?:([^:/?#.]+):)?(?:\/\/(?:([^\\/?#]*)@)?([^\\/?#]*?)(?::([0-9]+))?(?=[\\/?#]|$))?([^?#]+)?(?:\?([^#]*))?(?:#([\s\S]*))?$/;function Jn(t,e){if(t){t=t.split("&");for(var n=0;n<t.length;n++){var r=t[n].indexOf("="),i=null;if(0<=r){var o=t[n].substring(0,r);i=t[n].substring(r+1)}else o=t[n];e(o,i?decodeURIComponent(i.replace(/\+/g," ")):"")}}}function $n(t,e){var n;this.a=this.l=this.c="",this.g=null,this.h=this.f="",this.i=!1,t instanceof $n?(this.i=void 0!==e?e:t.i,Zn(this,t.c),this.l=t.l,this.a=t.a,tr(this,t.g),this.f=t.f,er(this,wr(t.b)),this.h=t.h):t&&(n=String(t).match(Qn))?(this.i=!!e,Zn(this,n[1]||"",!0),this.l=ar(n[2]||""),this.a=ar(n[3]||"",!0),tr(this,n[4]),this.f=ar(n[5]||"",!0),er(this,n[6]||"",!0),this.h=ar(n[7]||"")):(this.i=!!e,this.b=new dr(null,this.i))}function Zn(t,e,n){t.c=n?ar(e,!0):e,t.c&&(t.c=t.c.replace(/:$/,""))}function tr(t,e){if(e){if(e=Number(e),isNaN(e)||0>e)throw Error("Bad port number "+e);t.g=e}else t.g=null}function er(t,e,n){e instanceof dr?(t.b=e,Ir(t.b,t.i)):(n||(e=sr(e,fr)),t.b=new dr(e,t.i))}function nr(t,e,n){t.b.set(e,n)}function rr(t,e){return t.b.get(e)}function ir(t){return t instanceof $n?new $n(t):new $n(t,void 0)}function or(t,e,n,r){var i=new $n(null,void 0);return t&&Zn(i,t),e&&(i.a=e),n&&tr(i,n),r&&(i.f=r),i}function ar(t,e){return t?e?decodeURI(t.replace(/%25/g,"%2525")):decodeURIComponent(t):""}function sr(t,e,n){return"string"===typeof t?(t=encodeURI(t).replace(e,ur),n&&(t=t.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),t):null}function ur(t){return t=t.charCodeAt(0),"%"+(t>>4&15).toString(16)+(15&t).toString(16)}$n.prototype.toString=function(){var t=[],e=this.c;e&&t.push(sr(e,cr,!0),":");var n=this.a;return(n||"file"==e)&&(t.push("//"),(e=this.l)&&t.push(sr(e,cr,!0),"@"),t.push(encodeURIComponent(String(n)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),n=this.g,null!=n&&t.push(":",String(n))),(n=this.f)&&(this.a&&"/"!=n.charAt(0)&&t.push("/"),t.push(sr(n,"/"==n.charAt(0)?lr:hr,!0))),(n=this.b.toString())&&t.pu
359sh("?",n),(n=this.h)&&t.push("#",sr(n,pr)),t.join("")},$n.prototype.resolve=function(t){var e=new $n(this),n=!!t.c;n?Zn(e,t.c):n=!!t.l,n?e.l=t.l:n=!!t.a,n?e.a=t.a:n=null!=t.g;var r=t.f;if(n)tr(e,t.g);else if(n=!!t.f){if("/"!=r.charAt(0))if(this.a&&!this.f)r="/"+r;else{var i=e.f.lastIndexOf("/");-1!=i&&(r=e.f.substr(0,i+1)+r)}if(i=r,".."==i||"."==i)r="";else if(pt(i,"./")||pt(i,"/.")){r=0==i.lastIndexOf("/",0),i=i.split("/");for(var o=[],a=0;a<i.length;){var s=i[a++];"."==s?r&&a==i.length&&o.push(""):".."==s?((1<o.length||1==o.length&&""!=o[0])&&o.pop(),r&&a==i.length&&o.push("")):(o.push(s),r=!0)}r=o.join("/")}else r=i}return n?e.f=r:n=""!==t.b.toString(),n?er(e,wr(t.b)):n=!!t.h,n&&(e.h=t.h),e};var cr=/[#\/\?@]/g,hr=/[#\?:]/g,lr=/[#\?]/g,fr=/[#\?@]/g,pr=/#/g;function dr(t,e){this.b=this.a=null,this.c=t||null,this.f=!!e}function vr(t){t.a||(t.a=new zn,t.b=0,t.c&&Jn(t.c,(function(e,n){t.add(decodeURIComponent(e.replace(/\+/g," ")),n)})))}function gr(t){var e=Gn(t);if("undefined"==typeof e)throw Error("Keys are undefined");var n=new dr(null,void 0);t=Kn(t);for(var r=0;r<e.length;r++){var i=e[r],o=t[r];Array.isArray(o)?br(n,i,o):n.add(i,o)}return n}function mr(t,e){vr(t),e=_r(t,e),Xn(t.a.b,e)&&(t.c=null,t.b-=t.a.get(e).length,t=t.a,Xn(t.b,e)&&(delete t.b[e],t.c--,t.a.length>2*t.c&&Wn(t)))}function yr(t,e){return vr(t),e=_r(t,e),Xn(t.a.b,e)}function br(t,e,n){mr(t,e),0<n.length&&(t.c=null,t.a.set(_r(t,e),rt(n)),t.b+=n.length)}function wr(t){var e=new dr;return e.c=t.c,t.a&&(e.a=new zn(t.a),e.b=t.b),e}function _r(t,e){return e=String(e),t.f&&(e=e.toLowerCase()),e}function Ir(t,e){e&&!t.f&&(vr(t),t.c=null,t.a.forEach((function(t,e){var n=e.toLowerCase();e!=n&&(mr(this,e),br(this,n,t))}),t)),t.f=e}function Er(t){var e=[];return Sr(new Tr,t,e),e.join("")}function Tr(){}function Sr(t,e,n){if(null==e)n.push("null");else{if("object"==typeof e){if(Array.isArray(e)){var r=e;e=r.length,n.push("[");for(var i="",o=0;o<e;o++)n.push(i),Sr(t,r[o],n),i=",";return void n.push("]")}if(!(e instanceof String||e instanceof Number||e instanceof Boolean)){for(r in n.push("{"),i="",e)Object.prototype.hasOwnProperty.call(e,r)&&(o=e[r],"function"!=typeof o&&(n.push(i),Nr(r,n),n.push(":"),Sr(t,o,n),i=","));return void n.push("}")}e=e.valueOf()}switch(typeof e){case"string":Nr(e,n);break;case"number":n.push(isFinite(e)&&!isNaN(e)?String(e):"null");break;case"boolean":n.push(String(e));break;case"function":n.push("null");break;default:throw Error("Unknown type: "+typeof e)}}}t=dr.prototype,t.add=function(t,e){vr(this),this.c=null,t=_r(this,t);var n=this.a.get(t);return n||this.a.set(t,n=[]),n.push(e),this.b+=1,this},t.clear=function(){this.a=this.c=null,this.b=0},t.forEach=function(t,e){vr(this),this.a.forEach((function(n,r){z(n,(function(n){t.call(e,n,r,this)}),this)}),this)},t.Y=function(){vr(this);for(var t=this.a.W(),e=this.a.Y(),n=[],r=0;r<e.length;r++)for(var i=t[r],o=0;o<i.length;o++)n.push(e[r]);return n},t.W=function(t){vr(this);var e=[];if("string"===typeof t)yr(this,t)&&(e=nt(e,this.a.get(_r(this,t))));else{t=this.a.W();for(var n=0;n<t.length;n++)e=nt(e,t[n])}return e},t.set=function(t,e){return vr(this),this.c=null,t=_r(this,t),yr(this,t)&&(this.b-=this.a.get(t).length),this.a.set(t,[e]),this.b+=1,this},t.get=function(t,e){return t?(t=this.W(t),0<t.length?String(t[0]):e):e},t.toString=function(){if(this.c)return this.c;if(!this.a)return"";for(var t=[],e=this.a.Y(),n=0;n<e.length;n++){var r=e[n],i=encodeURIComponent(String(r));r=this.W(r);for(var o=0;o<r.length;o++){var a=i;""!==r[o]&&(a+="="+encodeURIComponent(String(r[o]))),t.push(a)}}return this.c=t.join("&")};var Ar={'"':'\\"',"\\":"\\\\","/":"\\/","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\u000b"},kr=/\uffff/.test("ï¿¿")?/[\\"\x00-\x1f\x7f-\uffff]/g:/[\\"\x00-\x1f\x7f-\xff]/g;function Nr(t,e){e.push('"',t.replace(kr,(function(t){var e=Ar[t];return e||(e="\\u"+(65536|t.charCodeAt(0)).toString(16).substr(1),Ar[t]=e),e})),'"')}function Cr(){var t=Zr();return re&&!!ge&&11==ge||/Edge\/\d+/.test(t)}function Rr(){return h.window&&h.window.location.href||self&&self.location&&self.location.href||""}function Or(t,e){e=e||h.window;var n="about:blank";t&&(n=Ft(qt(t)||Gt)),e.location.href=n}function Dr(t,e){var n,r=[];
359for(n in t)n in e?typeof t[n]!=typeof e[n]?r.push(n):"object"==typeof t[n]&&null!=t[n]&&null!=e[n]?0<Dr(t[n],e[n]).length&&r.push(n):t[n]!==e[n]&&r.push(n):r.push(n);for(n in e)n in t||r.push(n);return r}function Pr(){var t=Zr();return t=Qr(t)!=Xr?null:(t=t.match(/\sChrome\/(\d+)/i))&&2==t.length?parseInt(t[1],10):null,!(t&&30>t)&&(!re||!ge||9<ge)}function Lr(t){return t=(t||Zr()).toLowerCase(),!!(t.match(/android/)||t.match(/webos/)||t.match(/iphone|ipad|ipod/)||t.match(/blackberry/)||t.match(/windows phone/)||t.match(/iemobile/))}function xr(t){t=t||h.window;try{t.close()}catch(e){}}function Mr(t,e,n){var r=Math.floor(1e9*Math.random()).toString();e=e||500,n=n||600;var i=(window.screen.availHeight-n)/2,o=(window.screen.availWidth-e)/2;for(a in e={width:e,height:n,top:0<i?i:0,left:0<o?o:0,location:!0,resizable:!0,statusbar:!0,toolbar:!1},n=Zr().toLowerCase(),r&&(e.target=r,pt(n,"crios/")&&(e.target="_blank")),Qr(Zr())==Wr&&(t=t||"http://localhost",e.scrollbars=!0),n=t||"",(t=e)||(t={}),r=window,e=n instanceof Ut?n:qt("undefined"!=typeof n.href?n.href:String(n))||Gt,n=t.target||n.target,i=[],t)switch(a){case"width":case"height":case"top":case"left":i.push(a+"="+t[a]);break;case"target":case"noopener":case"noreferrer":break;default:i.push(a+"="+(t[a]?1:0))}var a=i.join(",");if((mt("iPhone")&&!mt("iPod")&&!mt("iPad")||mt("iPad")||mt("iPod"))&&r.navigator&&r.navigator.standalone&&n&&"_self"!=n?(a=Se(document,"A"),Et(a,"HTMLAnchorElement"),e=e instanceof Ut?e:Bt(e),a.href=Ft(e),a.setAttribute("target",n),t.noreferrer&&a.setAttribute("rel","noreferrer"),t=document.createEvent("MouseEvent"),t.initMouseEvent("click",!0,!0,r,1),a.dispatchEvent(t),a={}):t.noreferrer?(a=Qt("",r,n,a),t=Ft(e),a&&(oe&&pt(t,";")&&(t="'"+t.replace(/'/g,"%27")+"'"),a.opener=null,t='<meta name="referrer" content="no-referrer"><meta http-equiv="refresh" content="0; url='+$t(t)+'">',t=(r=Ct())?r.createHTML(t):t,t=new Yt(t,null,Wt),r=a.document)&&(r.write(zt(t)),r.close())):(a=Qt(e,r,n,a))&&t.noopener&&(a.opener=null),a)try{a.focus()}catch(s){}return a}function Ur(t){return new Pe((function(e){function n(){Bn(2e3).then((function(){if(t&&!t.closed)return n();e()}))}return n()}))}var Fr=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,Vr=/^[^@]+@[^@]+$/;function Hr(){var t=null;return new Pe((function(e){"complete"==h.document.readyState?e():(t=function(){e()},Nn(window,"load",t))})).o((function(e){throw Cn(window,"load",t),e}))}function jr(){return qr(void 0)?Hr().then((function(){return new Pe((function(t,e){var n=h.document,r=setTimeout((function(){e(Error("Cordova framework is not ready."))}),1e3);n.addEventListener("deviceready",(function(){clearTimeout(r),t()}),!1)}))})):je(Error("Cordova must run in an Android or iOS file scheme."))}function qr(t){return t=t||Zr(),!("file:"!==ii()&&"ionic:"!==ii()||!t.toLowerCase().match(/iphone|ipad|ipod|android/))}function Br(){var t=h.window;try{return!(!t||t==t.top)}catch(e){return!1}}function Kr(){return"undefined"!==typeof h.WorkerGlobalScope&&"function"===typeof h.importScripts}function Gr(){return r.A.INTERNAL.hasOwnProperty("reactNative")?"ReactNative":r.A.INTERNAL.hasOwnProperty("node")?"Node":Kr()?"Worker":"Browser"}function Yr(){var t=Gr();return"ReactNative"===t||"Node"===t}function zr(){for(var t=50,e=[];0<t;)e.push("1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".charAt(Math.floor(62*Math.random()))),t--;return e.join("")}var Wr="Firefox",Xr="Chrome";function Qr(t){var e=t.toLowerCase();return pt(e,"opera/")||pt(e,"opr/")||pt(e,"opios/")?"Opera":pt(e,"iemobile")?"IEMobile":pt(e,"msie")||pt(e,"trident/")?"IE":pt(e,"edge/")?"Edge":pt(e,"firefox/")?Wr:pt(e,"silk/")?"Silk":pt(e,"blackberry")?"Blackberry":pt(e,"webos")?"Webos":!pt(e,"safari/")||pt(e,"chrome/")||pt(e,"crios/")||pt(e,"android")?!pt(e,"chrome/")&&!pt(e,"crios/")||pt(e,"edge/")?pt(e,"android")?"Android":(t=t.match(/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/))&&2==t.length?t[1]:"Other":Xr:"Safari"}var Jr={md:"FirebaseCore-web",od:"FirebaseUI-web"};function $r(t,e){e=e||[];var n,r=[],i={};for(n in Jr)i[Jr[n]]=!0;for(n=0;n<e.length;n++)"undefined"!==typeof i[e[n]]&&(delete i[e[n]],r.push(e[n]));return r.sort(),e=r,e.length||(e=["FirebaseCore-web"]),r=Gr(),"Browser"===r?(i=Zr(),r=Qr(i)):"Worker"===r&&(i=Zr(),r=Qr(i)+"-"+r),r+"/JsCore/"+t+"/"+e.join(",")}function Zr(){return h.navigator&&h.navigator.userAgent||""}function ti(t,e){t=t.split("."),e=e||h;for(var n=0;n<t.length&&"object"==typeof e&&null!=e;n++)e=e[t[n]];return n!=t.length&&(e=void 0),e}function ei(){try{var t=h.localStorage,e=ci();if(t)return t.setItem(e,"1"),t.removeItem(e),!Cr()||!!h.indexedDB}catch(n){return Kr()&&!!h.indexedDB}return!1}function ni(){return(ri()||"chrome-extension:"===ii()||qr())&&!Yr()&&ei()&&!Kr()}function ri(){return"http:"===ii()||"https:"===ii()}function ii(){return h.location&&h.location.protocol||null}function oi(t){return t=t||Zr(),!Lr(t)&&Qr(t)!=Wr}function ai(t){return"undefined"===typeof t?null:Er(t)}function si(t){var e,n={};for(e in t)t.hasOwnProperty(e)&&null!==t[e]&&void 0!==t[e]&&(n[e]=t[e]);return n}function ui(t){if(null!==t)return JSON.parse(t)}function ci(t){return t||Math.floor(1e9*Math.random()).toString()}function hi(t){return t=t||Zr(),"Safari"!=Qr(t)&&!t.toLowerCase().match(/iphone|ipad|ipod/)}function li(){var t=h.___jsl;if(t&&t.H)for(var e in t.H)if(t.H[e].r=t.H[e].r||[],t.H[e].L=t.H[e].L||[],t.H[e].r=t.H[e].L.concat(),t.CP)for(var n=0;n<t.CP.length;n++)t.CP[n]=null}function fi(t,e){if(t>
359e)throw Error("Short delay should be less than long delay!");this.a=t,this.c=e,t=Zr(),e=Gr(),this.b=Lr(t)||"ReactNative"===e}function pi(){var t=h.document;return!t||"undefined"===typeof t.visibilityState||"visible"==t.visibilityState}function di(){var t=h.document,e=null;return pi()||!t?He():new Pe((function(n){e=function(){pi()&&(t.removeEventListener("visibilitychange",e,!1),n())},t.addEventListener("visibilitychange",e,!1)})).o((function(n){throw t.removeEventListener("visibilitychange",e,!1),n}))}function vi(t){try{var e=new Date(parseInt(t,10));if(!isNaN(e.getTime())&&!/[^0-9]/.test(t))return e.toUTCString()}catch(n){}return null}function gi(){return!(!ti("fireauth.oauthhelper",h)&&!ti("fireauth.iframe",h))}function mi(){var t=h.navigator;return t&&t.serviceWorker&&t.serviceWorker.controller||null}function yi(){var t=h.navigator;return t&&t.serviceWorker?He().then((function(){return t.serviceWorker.ready})).then((function(t){return t.active||null})).o((function(){return null})):He(null)}fi.prototype.get=function(){var t=h.navigator;return!t||"boolean"!==typeof t.onLine||!ri()&&"chrome-extension:"!==ii()&&"undefined"===typeof t.connection||t.onLine?this.b?this.c:this.a:Math.min(5e3,this.a)};var bi,wi={};function _i(t){wi[t]||(wi[t]=!0,"undefined"!==typeof console&&"function"===typeof console.warn&&console.warn(t))}try{var Ii={};Object.defineProperty(Ii,"abcd",{configurable:!0,enumerable:!0,value:1}),Object.defineProperty(Ii,"abcd",{configurable:!0,enumerable:!0,value:2}),bi=2==Ii.abcd}catch(Zp){bi=!1}function Ei(t,e,n){bi?Object.defineProperty(t,e,{configurable:!0,enumerable:!0,value:n}):t[e]=n}function Ti(t,e){if(e)for(var n in e)e.hasOwnProperty(n)&&Ei(t,n,e[n])}function Si(t){var e={};return Ti(e,t),e}function Ai(t){var e,n={};for(e in t)t.hasOwnProperty(e)&&(n[e]=t[e]);return n}function ki(t,e){if(!e||!e.length)return!0;if(!t)return!1;for(var n=0;n<e.length;n++){var r=t[e[n]];if(void 0===r||null===r||""===r)return!1}return!0}function Ni(t){var e=t;if("object"==typeof t&&null!=t)for(var n in e="length"in t?[]:{},t)Ei(e,n,Ni(t[n]));return e}function Ci(t){var e=t&&(t[Li]?"phone":null);if(!(e&&t&&t[Pi]))throw new C("internal-error","Internal assert: invalid MultiFactorInfo object");Ei(this,"uid",t[Pi]),Ei(this,"displayName",t[Oi]||null);var n=null;t[Di]&&(n=new Date(t[Di]).toUTCString()),Ei(this,"enrollmentTime",n),Ei(this,"factorId",e)}function Ri(t){try{var e=new xi(t)}catch(n){e=null}return e}Ci.prototype.w=function(){return{uid:this.uid,displayName:this.displayName,factorId:this.factorId,enrollmentTime:this.enrollmentTime}};var Oi="displayName",Di="enrolledAt",Pi="mfaEnrollmentId",Li="phoneInfo";function xi(t){Ci.call(this,t),Ei(this,"phoneNumber",t[Li])}function Mi(t){var e={},n=t[Hi],r=t[qi],i=t[Bi];if(t=Ri(t[ji]),!i||i!=Fi&&i!=Vi&&!n||i==Vi&&!r||i==Ui&&!t)throw Error("Invalid checkActionCode response!");i==Vi?(e[Gi]=n||null,e[zi]=n||null,e[Ki]=r):(e[Gi]=r||null,e[zi]=r||null,e[Ki]=n||null),e[Yi]=t||null,Ei(this,Xi,i),Ei(this,Wi,Ni(e))}k(xi,Ci),xi.prototype.w=function(){var t=xi.ab.w.call(this);return t.phoneNumber=this.phoneNumber,t};var Ui="REVERT_SECOND_FACTOR_ADDITION",Fi="EMAIL_SIGNIN",Vi="VERIFY_AND_CHANGE_EMAIL",Hi="email",ji="mfaInfo",qi="newEmail",Bi="requestType",Ki="email",Gi="fromEmail",Yi="multiFactorInfo",zi="previousEmail",Wi="data",Xi="operation";function Qi(t){t=ir(t);var e=rr(t,Ji)||null,n=rr(t,$i)||null,r=rr(t,eo)||null;if(r=r&&ro[r]||null,!e||!n||!r)throw new C("argument-error",Ji+", "+$i+"and "+eo+" are required in a valid action code URL.");Ti(this,{apiKey:e,operation:r,code:n,continueUrl:rr(t,Zi)||null,languageCode:rr(t,to)||null,tenantId:rr(t,no)||null})}var Ji="apiKey",$i="oobCode",Zi="continueUrl",to="languageCode",eo="mode",no="tenantId",ro={recoverEmail:"RECOVER_EMAIL",resetPassword:"PASSWORD_RESET",revertSecondFactorAddition:Ui,signIn:Fi,verifyAndChangeEmail:Vi,verifyEmail:"VERIFY_EMAIL"};function io(t){try{return new Qi(t)}catch(e){return null}}function oo(t){var e=t[ho];if("undefined"===typeof e)throw new C("missing-continue-uri");if("string"!==typeof e||"string"===typeof e&&!e.length)throw new C("invalid-continue-uri");this.h=e,this.b=this.a=null,this.g=!1;var n=t[ao];if(n&&"object"===typeof n){e=n[po];var r=n[lo];if(n=n[fo],"string"===typeof e&&e.length){if(this.a=e,"undefined"!==typeof r&&"boolean"!==typeof r)throw new C("argument-error",lo+" property must be a boolean when specified.");if(this.g=!!r,"undefined"!==typeof n&&("string"!==typeof n||"string"===typeof n&&!n.length))throw new C("argument-error",fo+" property must be a non empty string when specified.");this.b=n||null}else{if("undefined"!==typeof e)throw new C("argument-error",po+" property must be a non empty string when specified.");if("undefined"!==typeof r||"undefined"!==typeof n)throw new C("missing-android-pkg-name")}}else if("undefined"!==typeof n)throw new C("argument-error",ao+" property must be a non null object when specified.");if(this.f=null,(e=t[co])&&"object"===typeof e){if(e=e[vo],"string"===typeof e&&e.length)this.f=e;else if("undefined"!==typeof e)throw new C("argument-error",vo+" property must be a non empty string when specified.")}else if("undefined"!==typeof e)throw new C("argument-error",co+" property must be a non null object when specified.");if(e=t[uo],"undefined"!==typeof e&&"boolean"!==typeof e)throw new C("argument-error",uo+" property must be a boolean when specified.");if(this.c=!!e,t=t[so],"undefined"!==typeof t&&("string"!==typeof t||"string"===typeof t&&!t.length))throw new C("argument-error",so+" property must be a non empty string when specified.");this.i=t||null}var ao="android",so="dynamicLinkDomain",uo="handleCodeInApp",co="iOS",ho="url",lo="installApp",fo="minimumVersion",po="packageName",vo="bundleId";function go(t){var e={};for(var n in e.continueUrl=t.h,e.canHandleCodeInApp=t.c,(e.androidPackageName=t.a)&&(e.androidMinimumVersion=t.b,e.androidInstallApp=t.g),e.iOSBundleId=t.f,e.dynamicLinkDomain=t.i,e)null===e[n]&&delete e[n];return e}function mo(t){return Q(t,(function(t){return t=t.toString(16),1<t.length?t:"0"+t})).join("")}var yo=null;function bo(t){var e=[];return wo(t,(function(t){e.push(t)})),e}function wo(t,e){function n(e){for(;r<t.length;){var n=t.charAt(r++),i=yo[n];if(null!=i)return i;if(!/^[\s\xa0]*$/.test(n))throw Error("Unknown base64 encoding at char: "+n)}return e}_o();for(var r=0;;){var i=n(-1),o=n(0),a=n(64),s=n(64);if(64===s&&-1===i)break;e(i<<2|o>>4),64!=a&&(e(o<<4&240|a>>2),64!=s&&e(a<<6&192|s))}}function _o(){if(!yo){yo={};for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),e=["+/=","+/","-_=","-_.","-_"],n=0;5>n;n++)for(var r=t.concat(e[n].split("")),i=0;i<r.length;i++){var o=r[i];void 0===yo[o]&&(yo[o]=i)}}}function Io(t){var e=To(t);if(!(e&&e.sub&&e.iss&&e.aud&&e.exp))throw Error("Invalid JWT");this.h=t,this.a=e.exp,this.i=e.sub,t=Date.now()/1e3,this.g=e.iat||(t>this.a?this.a:t),this.b=e.provider_id||e.firebase&&e.firebase.sign_in_provider||null,this.f=e.firebase&&e.firebase.tenant||null,this.c=!!e.is_anonymous||"anonymous"==this.b}function Eo(t){try{return new Io(t)}catch(e){return null}}function To(t){if(!t)return null;
359if(t=t.split("."),3!=t.length)return null;t=t[1];for(var e=(4-t.length%4)%4,n=0;n<e;n++)t+=".";try{var r=bo(t);for(t=[],n=e=0;e<r.length;){var i=r[e++];if(128>i)t[n++]=String.fromCharCode(i);else if(191<i&&224>i){var o=r[e++];t[n++]=String.fromCharCode((31&i)<<6|63&o)}else if(239<i&&365>i){o=r[e++];var a=r[e++],s=r[e++],u=((7&i)<<18|(63&o)<<12|(63&a)<<6|63&s)-65536;t[n++]=String.fromCharCode(55296+(u>>10)),t[n++]=String.fromCharCode(56320+(1023&u))}else o=r[e++],a=r[e++],t[n++]=String.fromCharCode((15&i)<<12|(63&o)<<6|63&a)}return JSON.parse(t.join(""))}catch(c){}return null}Io.prototype.T=function(){return this.f},Io.prototype.l=function(){return this.c},Io.prototype.toString=function(){return this.h};var So="oauth_consumer_key oauth_nonce oauth_signature oauth_signature_method oauth_timestamp oauth_token oauth_version".split(" "),Ao=["client_id","response_type","scope","redirect_uri","state"],ko={nd:{Ja:"locale",ua:700,ta:600,fa:"facebook.com",Xa:Ao},pd:{Ja:null,ua:500,ta:750,fa:"github.com",Xa:Ao},qd:{Ja:"hl",ua:515,ta:680,fa:"google.com",Xa:Ao},wd:{Ja:"lang",ua:485,ta:705,fa:"twitter.com",Xa:So},kd:{Ja:"locale",ua:640,ta:600,fa:"apple.com",Xa:[]}};function No(t){for(var e in ko)if(ko[e].fa==t)return ko[e];return null}function Co(t){var e={};e["facebook.com"]=Lo,e["google.com"]=Mo,e["github.com"]=xo,e["twitter.com"]=Uo;var n=t&&t[Oo];try{if(n)return e[n]?new e[n](t):new Po(t);if("undefined"!==typeof t[Ro])return new Do(t)}catch(r){}return null}var Ro="idToken",Oo="providerId";function Do(t){var e=t[Oo];if(!e&&t[Ro]){var n=Eo(t[Ro]);n&&n.b&&(e=n.b)}if(!e)throw Error("Invalid additional user info!");"anonymous"!=e&&"custom"!=e||(e=null),n=!1,"undefined"!==typeof t.isNewUser?n=!!t.isNewUser:"identitytoolkit#SignupNewUserResponse"===t.kind&&(n=!0),Ei(this,"providerId",e),Ei(this,"isNewUser",n)}function Po(t){Do.call(this,t),t=ui(t.rawUserInfo||"{}"),Ei(this,"profile",Ni(t||{}))}function Lo(t){if(Po.call(this,t),"facebook.com"!=this.providerId)throw Error("Invalid provider ID!")}function xo(t){if(Po.call(this,t),"github.com"!=this.providerId)throw Error("Invalid provider ID!");Ei(this,"username",this.profile&&this.profile.login||null)}function Mo(t){if(Po.call(this,t),"google.com"!=this.providerId)throw Error("Invalid provider ID!")}function Uo(t){if(Po.call(this,t),"twitter.com"!=this.providerId)throw Error("Invalid provider ID!");Ei(this,"username",t.screenName||null)}function Fo(t){var e=ir(t),n=rr(e,"link"),r=rr(ir(n),"link");return e=rr(e,"deep_link_id"),rr(ir(e),"link")||e||r||n||t}function Vo(t,e){if(!t&&!e)throw new C("internal-error","Internal assert: no raw session string available");if(t&&e)throw new C("internal-error","Internal assert: unable to determine the session type");this.a=t||null,this.b=e||null,this.type=this.a?Ho:jo}k(Po,Do),k(Lo,Po),k(xo,Po),k(Mo,Po),k(Uo,Po);var Ho="enroll",jo="signin";function qo(){}function Bo(t,e){return t.then((function(t){if(t[Ms]){var n=Eo(t[Ms]);if(!n||e!=n.i)throw new C("user-mismatch");return t}throw new C("user-mismatch")})).o((function(t){throw t&&t.code&&t.code==D+"user-not-found"?new C("user-mismatch"):t}))}function Ko(t,e){if(!e)throw new C("internal-error","failed to construct a credential");this.a=e,Ei(this,"providerId",t),Ei(this,"signInMethod",t)}function Go(t){return{pendingToken:t.a,requestUri:"http://localhost"}}function Yo(t){if(t&&t.providerId&&t.signInMethod&&0==t.providerId.indexOf("saml.")&&t.pendingToken)try{return new Ko(t.providerId,t.pendingToken)}catch(e){}return null}function zo(t,e,n){if(this.a=null,e.idToken||e.accessToken)e.idToken&&Ei(this,"idToken",e.idToken),e.accessToken&&Ei(this,"accessToken",e.accessToken),e.nonce&&!e.pendingToken&&Ei(this,"nonce",e.nonce),e.pendingToken&&(this.a=e.pendingToken);else{if(!e.oauthToken||!e.oauthTokenSecret)throw new C("internal-error","failed to construct a credential");Ei(this,"accessToken",e.oauthToken),Ei(this,"secret",e.oauthTokenSecret)}Ei(this,"providerId",t),Ei(this,"signInMethod",n)}function Wo(t){var e={};return t.idToken&&(e.id_token=t.idToken),t.accessToken&&(e.access_token=t.accessToken),t.secret&&(e.oauth_token_secret=t.secret),e.providerId=t.providerId,t.nonce&&!t.a&&(e.nonce=t.nonce),e={postBody:gr(e).toString(),requestUri:"http://localhost"},t.a&&(delete e.postBody,e.pendingToken=t.a),e}function Xo(t){if(t&&t.providerId&&t.signInMethod){var e={idToken:t.oauthIdToken,accessToken:t.oauthTokenSecret?null:t.oauthAccessToken,oauthTokenSecret:t.oauthTokenSecret,oauthToken:t.oauthTokenSecret&&t.oauthAccessToken,nonce:t.nonce,pendingToken:t.pendingToken};try{return new zo(t.providerId,e,t.signInMethod)}catch(n){}}return null}function Qo(t,e){this.Qc=e||[],Ti(this,{providerId:t,isOAuthProvider:!0}),this.Ib={},this.pb=(No(t)||{}).Ja||null,this.ob=null}function Jo(t){if("string"!==typeof t||0!=t.indexOf("saml."))throw new C("argument-error",'SAML provider IDs must be prefixed with "saml."');Qo.call(this,t,[])}function $o(t){Qo.call(this,t,Ao),this.a=[]}function Zo(){$o.call(this,"facebook.com")}function ta(t){if(!t)throw new C("argument-error","credential failed: expected 1 argument (the OAuth access token).");var e=t;return y(t)&&(e=t.accessToken),(new Zo).credential({accessToken:e})}function ea(){$o.call(this,"github.com")}function na(t){if(!t)throw new C("argument-error","credential failed: expected 1 argument (the OAuth access token).");var e=t;return y(t)&&(e=t.accessToken),(new ea).credential({accessToken:e})}function ra(){$o.call(this,"google.com"),this.Ca("profile")}function ia(t,e){var n=t;return y(t)&&(n=t.idToken,e=t.accessToken),(new ra).credential({idToken:n,accessToken:e})}function oa(){Qo.call(this,"twitter.com",So)}function aa(t,e){var n=t;if(y(n)||(n={oauthToken:t,oauthTokenSecret:e}),!n.oauthToken||!n.oauthTokenSecret)throw new C("argument-error","credential failed: expected 2 arguments (the OAuth access token and secret).");return new zo("twitter.com",n,"twitter.com")}function sa(t,e,n){this.a=t,this.f=e,Ei(this,"providerId","password"),Ei(this,"signInMethod",n===ca.EMAIL_LINK_SIGN_IN_METHOD?ca.EMAIL_LINK_SIGN_IN_METHOD:ca.EMAIL_PASSWORD_SIGN_IN_METHOD)}function ua(t){return t&&t.email&&t.password?new sa(t.email,t.password,t.signInMethod):null}function ca(){Ti(this,{providerId:"password",isOAuthProvider:!1})}function ha(t,e){if(e=la(e),!e)throw new C("argument-error","Invalid email link!");return new sa(t,e.code,ca.EMAIL_LINK_SIGN_IN_METHOD)}function la(t){return t=Fo(t),(t=io(t))&&t.operation===Fi?t:null}function fa(t){if(!(t.eb&&t.cb||t.La&&t.ea))throw new C("internal-error");this.a=t,Ei(this,"providerId","phone"),this.fa="phone",Ei(this,"signInMethod","phone")}function pa(t){if(t&&"phone"===t.providerId&&(t.verificationId&&t.verificationCode||t.temporaryProof&&t.phoneNumber)){var e={};return z(["verificationId","verificationCode","temporaryProof","phoneNumber"],(function(n){t[n]&&(e[n]=t[n])})),new fa(e)}return null}function da(t){return t.a.La&&t.a.ea?{temporaryProof:t.a.La,phoneNumber:t.a.ea}:{sessionInfo:t.a.eb,code:t.a.cb}}function va(t){try{this.a=t||r.A.auth()}catch(e){throw new C("argument-error","Either an instance of firebase.auth.Auth must be passed as an argument to the firebase.auth.PhoneAuthProvider constructor, or the default firebase App instance must be initialized via firebase.initializeApp().")}Ti(this,{providerId:"phone",isOAuthProvider:!1})}function ga(t,e){if(!t)throw new C("missing-verification-id");if(!e)throw new C("missing-verification-code");return new fa({eb:t,cb:e})}function ma(t){if(t.temporaryProof&&t.phoneNumber)return new fa({La:t.temporaryProof,ea:t.phoneNumber});var e=t&&t.providerId;if(!e||"password"===e)return null;var n=t&&t.oauthAccessToken,r=t&&t.oauthTokenSecret,i=t&&t.nonce,o=t&&t.oauthIdToken,a=t&&t.pendingToken;try{switch(e){case"google.com":return ia(o,n);case"facebook.com":return ta(n);case"github.com":return na(n);case"twitter.com":return aa(n,r);default:return n||r||o||a?a?0==e.indexOf("saml.")?new Ko(e,a):new zo(e,{pendingToken:a,idToken:t.oauthIdToken,accessToken:t.oauthAccessToken},e):new $o(e).credential({idToken:o,accessToken:n,rawNonce:i}):null}}catch(s){return null}}function ya(t){if(!t.isOAuthProvider)throw new C("invalid-oauth-provider")}function ba(t,e,n,r,i,o,a){if(this.c=t,this.b=e||null,this.g=n||null,this.f=r||null,this.i=o||null,this.h=a||null,this.a=i||null,!this.g&&!this.a)throw new C("invalid-auth-event");
359if(this.g&&this.a)throw new C("invalid-auth-event");if(this.g&&!this.f)throw new C("invalid-auth-event")}function wa(t){return t=t||{},t.type?new ba(t.type,t.eventId,t.urlResponse,t.sessionId,t.error&&R(t.error),t.postBody,t.tenantId):null}function _a(){this.b=null,this.a=[]}Vo.prototype.Ha=function(){return this.a?He(this.a):He(this.b)},Vo.prototype.w=function(){return this.type==Ho?{multiFactorSession:{idToken:this.a}}:{multiFactorSession:{pendingCredential:this.b}}},qo.prototype.ka=function(){},qo.prototype.b=function(){},qo.prototype.c=function(){},qo.prototype.w=function(){},Ko.prototype.ka=function(t){return fu(t,Go(this))},Ko.prototype.b=function(t,e){var n=Go(this);return n.idToken=e,pu(t,n)},Ko.prototype.c=function(t,e){return Bo(du(t,Go(this)),e)},Ko.prototype.w=function(){return{providerId:this.providerId,signInMethod:this.signInMethod,pendingToken:this.a}},zo.prototype.ka=function(t){return fu(t,Wo(this))},zo.prototype.b=function(t,e){var n=Wo(this);return n.idToken=e,pu(t,n)},zo.prototype.c=function(t,e){var n=Wo(this);return Bo(du(t,n),e)},zo.prototype.w=function(){var t={providerId:this.providerId,sign
359InMethod:this.signInMethod};return this.idToken&&(t.oauthIdToken=this.idToken),this.accessToken&&(t.oauthAccessToken=this.accessToken),this.secret&&(t.oauthTokenSecret=this.secret),this.nonce&&(t.nonce=this.nonce),this.a&&(t.pendingToken=this.a),t},Qo.prototype.Ka=function(t){return this.Ib=wt(t),this},k(Jo,Qo),k($o,Qo),$o.prototype.Ca=function(t){return Z(this.a,t)||this.a.push(t),this},$o.prototype.Qb=function(){return rt(this.a)},$o.prototype.credential=function(t,e){var n;if(n=y(t)?{idToken:t.idToken||null,accessToken:t.accessToken||null,nonce:t.rawNonce||null}:{idToken:t||null,accessToken:e||null},!n.idToken&&!n.accessToken)throw new C("argument-error","credential failed: must provide the ID token and/or the access token.");return new zo(this.providerId,n,this.providerId)},k(Zo,$o),Ei(Zo,"PROVIDER_ID","facebook.com"),Ei(Zo,"FACEBOOK_SIGN_IN_METHOD","facebook.com"),k(ea,$o),Ei(ea,"PROVIDER_ID","github.com"),Ei(ea,"GITHUB_SIGN_IN_METHOD","github.com"),k(ra,$o),Ei(ra,"PROVIDER_ID","google.com"),Ei(ra,"GOOGLE_SIGN_IN_METHOD","google.com"),k(oa,Qo),Ei(oa,"PROVIDER_ID","twitter.com"),Ei(oa,"TWITTER_SIGN_IN_METHOD","twitter.com"),sa.prototype.ka=function(t){return this.signInMethod==ca.EMAIL_LINK_SIGN_IN_METHOD?Xu(t,Iu,{email:this.a,oobCode:this.f}):Xu(t,Ku,{email:this.a,password:this.f})},sa.prototype.b=function(t,e){return this.signInMethod==ca.EMAIL_LINK_SIGN_IN_METHOD?Xu(t,Eu,{idToken:e,email:this.a,oobCode:this.f}):Xu(t,Mu,{idToken:e,email:this.a,password:this.f})},sa.prototype.c=function(t,e){return Bo(this.ka(t),e)},sa.prototype.w=function(){return{email:this.a,password:this.f,signInMethod:this.signInMethod}},Ti(ca,{PROVIDER_ID:"password"}),Ti(ca,{EMAIL_LINK_SIGN_IN_METHOD:"emailLink"}),Ti(ca,{EMAIL_PASSWORD_SIGN_IN_METHOD:"password"}),fa.prototype.ka=function(t){return t.fb(da(this))},fa.prototype.b=function(t,e){var n=da(this);return n.idToken=e,Xu(t,Yu,n)},fa.prototype.c=function(t,e){var n=da(this);return n.operation="REAUTH",t=Xu(t,zu,n),Bo(t,e)},fa.prototype.w=function(){var t={providerId:"phone"};return this.a.eb&&(t.verificationId=this.a.eb),this.a.cb&&(t.verificationCode=this.a.cb),this.a.La&&(t.temporaryProof=this.a.La),this.a.ea&&(t.phoneNumber=this.a.ea),t},va.prototype.fb=function(t,e){var n=this.a.a;return He(e.verify()).then((function(r){if("string"!==typeof r)throw new C("argument-error","An implementation of firebase.auth.ApplicationVerifier.prototype.verify() must return a firebase.Promise that resolves with a string.");switch(e.type){case"recaptcha":var i,o=y(t)?t.session:null,a=y(t)?t.phoneNumber:t;return i=o&&o.type==Ho?o.Ha().then((function(t){return ou(n,{idToken:t,phoneEnrollmentInfo:{phoneNumber:a,recaptchaToken:r}})})):o&&o.type==jo?o.Ha().then((function(e){return su(n,{mfaPendingCredential:e,mfaEnrollmentId:t.multiFactorHint&&t.multiFactorHint.uid||t.multiFactorUid,phoneSignInInfo:{recaptchaToken:r}})})):iu(n,{phoneNumber:a,recaptchaToken:r}),i.then((function(t){return"function"===typeof e.reset&&e.reset(),t}),(function(t){throw"function"===typeof e.reset&&e.reset(),t}));default:throw new C("argument-error",'Only firebase.auth.ApplicationVerifiers with type="recaptcha" are currently supported.')}}))},Ti(va,{PROVIDER_ID:"phone"}),Ti(va,{PHONE_SIGN_IN_METHOD:"phone"}),ba.prototype.getUid=function(){var t=[];return t.push(this.c),this.b&&t.push(this.b),this.f&&t.push(this.f),this.h&&t.push(this.h),t.join("-")},ba.prototype.T=function(){return this.h},ba.prototype.w=function(){return{type:this.c,eventId:this.b,urlResponse:this.g,sessionId:this.f,postBody:this.i,tenantId:this.h,error:this.a&&this.a.w()}};var Ia,Ea=null;function Ta(t){var e=Ea;e.a.push(t),e.b||(e.b=function(t){for(var n=0;n<e.a.length;n++)e.a[n](t)},t=ti("universalLinks.subscribe",h),"function"===typeof t&&t(null,e.b))}function Sa(t){var e="unauthorized-domain",n=void 0,r=ir(t);t=r.a,r=r.c,"chrome-extension"==r?n=Jt("This chrome extension ID (chrome-extension://%s) is not authorized to run this operation. Add it to the OAuth redirect domains list in the Firebase console -> Auth section -> Sign in method tab.",t):"http"==r||"https"==r?n=Jt("This domain (%s) is not authorized to run this operation. Add it to the OAuth redirect domains list in the Firebase console -> Auth section -> Sign in method tab.",t):e="operation-not-supported-in-this-environment",C.call(this,e,n)}function Aa(t,e,n){C.call(this,t,n),t=e||{},t.Jb&&Ei(this,"email",t.Jb),t.ea&&Ei(this,"phoneNumber",t.ea),t.credential&&Ei(this,"credential",t.credential),t.Zb&&Ei(this,"tenantId",t.Zb)}function ka(t){if(t.code){var e=t.code||"";0==e.indexOf(D)&&(e=e.substring(D.length));var n={credential:ma(t),Zb:t.tenantId};if(t.email)n.Jb=t.email;else if(t.phoneNumber)n.ea=t.phoneNumber;else if(!n.credential)return new C(e,t.message||void 0);return new Aa(e,n,t.message)}return null}function Na(){}function Ca(t){return t.c||(t.c=t.b())}function Ra(){}function Oa(t){if(!t.f&&"undefined"==typeof XMLHttpRequest&&"undefined"!=typeof ActiveXObject){for(var e=["MSXML2.XMLHTTP.6.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"],n=0;n<e.length;n++){var r=e[n];try{return new ActiveXObject(r),t.f=r}catch(i){}}throw Error("Could not create ActiveXObject. ActiveX might be disabled, or MSXML might not be installed")}return t.f}function Da(){}function Pa(){this.a=new XDomainRequest,this.readyState=0,this.onreadystatechange=null,this.responseType=this.responseText=this.response="",this.status=-1,this.statusText="",this.a.onload=T(this.qc,this),this.a.onerror=T(this.Sb,this),this.a.onprogress=T(this.rc,this),this.a.ontimeout=T(this.vc,this)}function La(t,e){t.readyState=e,t.onreadystatechange&&t.onreadystatechange()}function xa(t,e,n){this.reset(t,e,n,void 0,void 0)}k(Sa,C),k(Aa,C),Aa.prototype.w=function(){var t={code:this.code,message:this.message};this.email&&(t.email=this.email),this.phoneNumber&&(t.phoneNumber=this.phoneNumber),this.tenantId&&(t.tenantId=this.tenantId);var e=this.credential&&this.credential.w();return e&&It(t,e),t},Aa.prototype.toJSON=function(){return this.w()},Na.prototype.c=null,k(Ra,Na),Ra.prototype.a=function(){var t=Oa(this);return t?new ActiveXObject(t):new XMLHttpRequest},Ra.prototype.b=function(){var t={};return Oa(this)&&(t[0]=!0,t[1]=!0),t},Ia=new Ra,k(Da,Na),Da.prototype.a=function(){var t=new XMLHttpRequest;if("withCredentials"in t)return t;if("undefined"!=typeof XDomainRequest)return new Pa;throw Error("Unsupported browser")},Da.prototype.b=function(){return{}},t=Pa.prototype,t.open=function(t,e,n){if(null!=n&&!n)throw Error("Only async requests are supported.");this.a.open(t,e)},t.send=function(t){if(t){if("string"!=typeof t)throw Error("Only string data is supported");this.a.send(t)}else this.a.send()},t.abort=function(){this.a.abort()},t.setRequestHeader=function(){},t.getResponseHeader=function(t){return"content-type"==t.toLowerCase()?this.a.contentType:""},t.qc=function(){this.status=200,this.response=this.responseText=this.a.responseText,La(this,4)},t.Sb=function(){this.status=500,this.response=this.responseText="",La(this,4)},t.vc=function(){this.Sb()},t.rc=function(){this.status=200,La(this,1)},t.getAllResponseHeaders=function(){return"content-type: "+this.a.contentType},xa.prototype.a=null;function Ma(t){this.f=t,this.b=this.c=this.a=null}function Ua(t,e){this.name=t,this.value=e}xa.prototype.reset=function(t,e,n,r,i){"number"==typeof i||0,r||A(),delete this.a},Ua.prototype.toString=function(){return this.name};var Fa=new Ua("SEVERE",1e3),Va=new Ua("WARNING",900),Ha=new Ua("CONFIG",700),ja=new Ua("FINE",500);function qa(t){return t.c?t.c:t.a?qa(t.a):(V("Root logger has no level set."),null)}Ma.prototype.log=function(t,e,n){if(t.value>=qa(this).value)for(m(e)&&(e=e()),t=new xa(t,String(e),this.f),n&&(t.a=n),n=this;n;)n=n.a};var Ba={},Ka=null;function Ga(t){var e;if(Ka||(Ka=new Ma(""),Ba[""]=Ka,Ka.c=Ha),!(e=Ba[t])){e=new Ma(t);var n=t.lastIndexOf("."),r=t.substr(n+1);n=Ga(t.substr(0,n)),n.b||(n.b={}),n.b[r]=e,e.a=n,Ba[t]=e}return e}function Ya(t,e){t&&t.log(ja,e,void 0)}function za(t){this.f=t}function Wa(t){Fn.call(this),this.u=t,this.h=void 0,this.readyState=Xa,this.status=0,this.responseType=this.responseText=this.response=this.statusText="",this.onreadystatechange=null,this.l=new Headers,this.b=null,this.s="GET",this.f="",this.a=!1,this.i=Ga("goog.net.FetchXmlHttp"),this.m=this.c=this.g=null}k(za,Na),za.prototype.a=function(){return new Wa(this.f)},za.prototype.b=function(t){return function(){return t}}({}),k(Wa,Fn);var Xa=0;function Qa(t){t.c.read().then(t.pc.bind(t)).catch(t.Ua.bind(t))}function Ja(t){t.readyState=4,t.g=null,t.c=null,t.m=null,$a(t)}function $a(t){t.onreadystatechange&&t.onreadystatechange.call(t)}
359function Za(t){Fn.call(this),this.headers=new zn,this.D=t||null,this.c=!1,this.C=this.a=null,this.h=this.R=this.l="",this.f=this.O=this.i=this.J=!1,this.g=0,this.s=null,this.m=ts,this.u=this.S=!1}t=Wa.prototype,t.open=function(t,e){if(this.readyState!=Xa)throw this.abort(),Error("Error reopening a connection");this.s=t,this.f=e,this.readyState=1,$a(this)},t.send=function(t){if(1!=this.readyState)throw this.abort(),Error("need to call open() first. ");this.a=!0;var e={headers:this.l,method:this.s,credentials:this.h,cache:void 0};t&&(e.body=t),this.u.fetch(new Request(this.f,e)).then(this.uc.bind(this),this.Ua.bind(this))},t.abort=function(){this.response=this.responseText="",this.l=new Headers,this.status=0,this.c&&this.c.cancel("Request was aborted."),1<=this.readyState&&this.a&&4!=this.readyState&&(this.a=!1,Ja(this)),this.readyState=Xa},t.uc=function(t){this.a&&(this.g=t,this.b||(this.status=this.g.status,this.statusText=this.g.statusText,this.b=t.headers,this.readyState=2,$a(this)),this.a&&(this.readyState=3,$a(this),this.a&&("arraybuffer"===this.responseType?t.arrayBuffer().then(this.sc.bind(this),this.Ua.bind(this)):"undefined"!==typeof h.ReadableStream&&"body"in t?(this.response=this.responseText="",this.c=t.body.getReader(),this.m=new TextDecoder,Qa(this)):t.text().then(this.tc.bind(this),this.Ua.bind(this)))))},t.pc=function(t){if(this.a){var e=this.m.decode(t.value?t.value:new Uint8Array(0),{stream:!t.done});e&&(this.response=this.responseText+=e),t.done?Ja(this):$a(this),3==this.readyState&&Qa(this)}},t.tc=function(t){this.a&&(this.response=this.responseText=t,Ja(this))},t.sc=function(t){this.a&&(this.response=t,Ja(this))},t.Ua=function(t){var e=this.i;e&&e.log(Va,"Failed to fetch url "+this.f,t instanceof Error?t:Error(t)),this.a&&Ja(this)},t.setRequestHeader=function(t,e){this.l.append(t,e)},t.getResponseHeader=function(t){return this.b?this.b.get(t.toLowerCase())||"":((t=this.i)&&t.log(Va,"Attempting to get response header but no headers have been received for url: "+this.f,void 0),"")},t.getAllResponseHeaders=function(){if(!this.b){var t=this.i;return t&&t.log(Va,"Attempting to get all response headers but no headers have been received for url: "+this.f,void 0),""}t=[];for(var e=this.b.entries(),n=e.next();!n.done;)n=n.value,t.push(n[0]+": "+n[1]),n=e.next();return t.join("\r\n")},Object.defineProperty(Wa.prototype,"withCredentials",{get:function(){return"include"===this.h},set:function(t){this.h=t?"include":"same-origin"}}),k(Za,Fn);var ts="";Za.prototype.b=Ga("goog.net.XhrIo");var es=/^https?$/i,ns=["POST","PUT"];function rs(t,e,n,r,i){if(t.a)throw Error("[goog.net.XhrIo] Object is active with another request="+t.l+"; newUri="+e);n=n?n.toUpperCase():"GET",t.l=e,t.h="",t.R=n,t.J=!1,t.c=!0,t.a=t.D?t.D.a():Ia.a(),t.C=t.D?Ca(t.D):Ca(Ia),t.a.onreadystatechange=T(t.Vb,t);try{Ya(t.b,ds(t,"Opening Xhr")),t.O=!0,t.a.open(n,String(e),!0),t.O=!1}catch(a){return Ya(t.b,ds(t,"Error opening Xhr: "+a.message)),void as(t,a)}e=r||"";var o=new zn(t.headers);i&&Yn(i,(function(t,e){o.set(e,t)})),i=$(o.Y()),r=h.FormData&&e instanceof h.FormData,!Z(ns,n)||i||r||o.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8"),o.forEach((function(t,e){this.a.setRequestHeader(e,t)}),t),t.m&&(t.a.responseType=t.m),"withCredentials"in t.a&&t.a.withCredentials!==t.S&&(t.a.withCredentials=t.S);try{hs(t),0<t.g&&(t.u=is(t.a),Ya(t.b,ds(t,"Will abort after "+t.g+"ms if incomplete, xhr2 "+t.u)),t.u?(t.a.timeout=t.g,t.a.ontimeout=T(t.Ma,t)):t.s=qn(t.Ma,t.g,t)),Ya(t.b,ds(t,"Sending request")),t.i=!0,t.a.send(e),t.i=!1}catch(a){Ya(t.b,ds(t,"Send error: "+a.message)),as(t,a)}}function is(t){return re&&de(9)&&"number"===typeof t.timeout&&void 0!==t.ontimeout}function os(t){return"content-type"==t.toLowerCase()}function as(t,e){t.c=!1,t.a&&(t.f=!0,t.a.abort(),t.f=!1),t.h=e,ss(t),cs(t)}function ss(t){t.J||(t.J=!0,t.dispatchEvent("complete"),t.dispatchEvent("error"))}function us(t){if(t.c&&"undefined"!=typeof c)if(t.C[1]&&4==ls(t)&&2==fs(t))Ya(t.b,ds(t,"Local request error detected and ignored"));else if(t.i&&4==ls(t))qn(t.Vb,0,t);else if(t.dispatchEvent("readystatechange"),4==ls(t)){Ya(t.b,ds(t,"Request complete")),t.c=!1;try{var e,n=fs(t);t:switch(n){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var r
359=!0;break t;default:r=!1}if(!(e=r)){var i;if(i=0===n){var o=String(t.l).match(Qn)[1]||null;if(!o&&h.self&&h.self.location){var a=h.self.location.protocol;o=a.substr(0,a.length-1)}i=!es.test(o?o.toLowerCase():"")}e=i}if(e)t.dispatchEvent("complete"),t.dispatchEvent("success");else{try{var s=2<ls(t)?t.a.statusText:""}catch(u){Ya(t.b,"Can not get status: "+u.message),s=""}t.h=s+" ["+fs(t)+"]",ss(t)}}finally{cs(t)}}}function cs(t,e){if(t.a){hs(t);var n=t.a,r=t.C[0]?d:null;t.a=null,t.C=null,e||t.dispatchEvent("ready");try{n.onreadystatechange=r}catch(i){(t=t.b)&&t.log(Fa,"Problem encountered resetting onreadystatechange: "+i.message,void 0)}}}function hs(t){t.a&&t.u&&(t.a.ontimeout=null),t.s&&(h.clearTimeout(t.s),t.s=null)}function ls(t){return t.a?t.a.readyState:0}function fs(t){try{return 2<ls(t)?t.a.status:-1}catch(e){return-1}}function ps(t){try{return t.a?t.a.responseText:""}catch(e){return Ya(t.b,"Can not get responseText: "+e.message),""}}function ds(t,e){return e+" ["+t.R+" "+t.l+" "+fs(t)+"]"}function vs(t){var e=Ns;this.g=[],this.u=e,this.s=t||null,this.f=this.a=!1,this.c=void 0,this.v=this.C=this.i=!1,this.h=0,this.b=null,this.l=0}function gs(t,e,n){t.a=!0,t.c=n,t.f=!e,_s(t)}function ms(t){if(t.a){if(!t.v)throw new Is(t);t.v=!1}}function ys(t,e){bs(t,null,e,void 0)}function bs(t,e,n,r){t.g.push([e,n,r]),t.a&&_s(t)}function ws(t){return J(t.g,(function(t){return m(t[1])}))}function _s(t){if(t.h&&t.a&&ws(t)){var e=t.h,n=Ss[e];n&&(h.clearTimeout(n.a),delete Ss[e]),t.h=0}t.b&&(t.b.l--,delete t.b),e=t.c;for(var r=n=!1;t.g.length&&!t.i;){var i=t.g.shift(),o=i[0],a=i[1];if(i=i[2],o=t.f?a:o)try{var s=o.call(i||t.s,e);void 0!==s&&(t.f=t.f&&(s==e||s instanceof Error),t.c=e=s),(M(e)||"function"===typeof h.Promise&&e instanceof h.Promise)&&(r=!0,t.i=!0)}catch(u){e=u,t.f=!0,ws(t)||(n=!0)}}t.c=e,r&&(s=T(t.m,t,!0),r=T(t.m,t,!1),e instanceof vs?(bs(e,s,r),e.C=!0):e.then(s,r)),n&&(e=new Ts(e),Ss[e.a]=e,t.h=e.a)}function Is(){U.call(this)}function Es(){U.call(this)}function Ts(t){this.a=h.setTimeout(T(this.c,this),0),this.b=t}t=Za.prototype,t.Ma=function(){"undefined"!=typeof c&&this.a&&(this.h="Timed out after "+this.g+"ms, aborting",Ya(this.b,ds(this,this.h)),this.dispatchEvent("timeout"),this.abort(8))},t.abort=function(){this.a&&this.c&&(Ya(this.b,ds(this,"Aborting")),this.c=!1,this.f=!0,this.a.abort(),this.f=!1,this.dispatchEvent("complete"),this.dispatchEvent("abort"),cs(this))},t.Da=function(){this.a&&(this.c&&(this.c=!1,this.f=!0,this.a.abort(),this.f=!1),cs(this,!0)),Za.ab.Da.call(this)},t.Vb=function(){this.xa||(this.O||this.i||this.f?us(this):this.Jc())},t.Jc=function(){us(this)},t.getResponse=function(){try{if(!this.a)return null;if("response"in this.a)return this.a.response;switch(this.m){case ts:case"text":return this.a.responseText;case"arraybuffer":if("mozResponseArrayBuffer"in this.a)return this.a.mozResponseArrayBuffer}var t=this.b;return t&&t.log(Fa,"Response type "+this.m+" is not supported on this browser",void 0),null}catch(e){return Ya(this.b,"Can not get response: "+e.message),null}},vs.prototype.cancel=function(t){if(this.a)this.c instanceof vs&&this.c.cancel();else{if(this.b){var e=this.b;delete this.b,t?e.cancel(t):(e.l--,0>=e.l&&e.cancel())}this.u?this.u.call(this.s,this):this.v=!0,this.a||(t=new Es(this),ms(this),gs(this,!1,t))}},vs.prototype.m=function(t,e){this.i=!1,gs(this,t,e)},vs.prototype.then=function(t,e,n){var r,i,o=new Pe((function(t,e){r=t,i=e}));return bs(this,r,(function(t){t instanceof Es?o.cancel():i(t)})),o.then(t,e,n)},vs.prototype.$goog_Thenable=!0,k(Is,U),Is.prototype.message="Deferred has already fired",Is.prototype.name="AlreadyCalledError",k(Es,U),Es.prototype.message="Deferred was canceled",Es.prototype.name="CanceledError",Ts.prototype.c=function(){throw delete Ss[this.a],this.b};var Ss={};function As(t){var e={},n=e.document||document,r=Ot(t).toString(),i=Se(document,"SCRIPT"),o={Wb:i,Ma:void 0},a=new vs(o),s=null,u=null!=e.timeout?e.timeout:5e3;return 0<u&&(s=window.setTimeout((function(){Cs(i,!0);var t=new Ds(Os,"Timeout reached for loading script "+r);ms(a),gs(a,!1,t)}),u),o.Ma=s),i.onload=i.onreadystatechange=function(){i.readyState&&"loaded"!=i.readyState&&"complete"!=i.readyState||(Cs(i,e.xd||!1,s),ms(a),gs(a,!0,null))},i.onerror=function(){Cs(i,!0,s);var t=new Ds(Rs,"Error while loading script "+r);ms(a),gs(a,!1,t)},o=e.attributes||{}
359,It(o,{type:"text/javascript",charset:"UTF-8"}),be(i,o),Xt(i,t),ks(n).appendChild(i),a}function ks(t){var e;return(e=(t||document).getElementsByTagName("HEAD"))&&0!=e.length?e[0]:t.documentElement}function Ns(){if(this&&this.Wb){var t=this.Wb;t&&"SCRIPT"==t.tagName&&Cs(t,!0,this.Ma)}}function Cs(t,e,n){null!=n&&h.clearTimeout(n),t.onload=d,t.onerror=d,t.onreadystatechange=d,e&&window.setTimeout((function(){t&&t.parentNode&&t.parentNode.removeChild(t)}),0)}var Rs=0,Os=1;function Ds(t,e){var n="Jsloader error (code #"+t+")";e&&(n+=": "+e),U.call(this,n),this.code=t}function Ps(t){this.f=t}function Ls(t,e,n){if(this.c=t,t=e||{},this.l=t.secureTokenEndpoint||"https://securetoken.googleapis.com/v1/token",this.m=t.secureTokenTimeout||Us,this.g=wt(t.secureTokenHeaders||Fs),this.h=t.firebaseEndpoint||"https://www.googleapis.com/identitytoolkit/v3/relyingparty/",this.i=t.identityPlatformEndpoint||"https://identitytoolkit.googleapis.com/v2/",this.v=t.firebaseTimeout||Vs,this.a=wt(t.firebaseHeaders||Hs),n&&(this.a["X-Client-Version"]=n,this.g["X-Client-Version"]=n),n="Node"==Gr(),n=h.XMLHttpRequest||n&&r.A.INTERNAL.node&&r.A.INTERNAL.node.XMLHttpRequest,!n&&!Kr())throw new C("internal-error","The XMLHttpRequest compatibility library was not found.");this.f=void 0,Kr()?this.f=new za(self):Yr()?this.f=new Ps(n):this.f=new Da,this.b=null}k(Ds,U),k(Ps,Na),Ps.prototype.a=function(){return new this.f},Ps.prototype.b=function(){return{}};var xs,Ms="idToken",Us=new fi(3e4,6e4),Fs={"Content-Type":"application/x-www-form-urlencoded"},Vs=new fi(3e4,6e4),Hs={"Content-Type":"application/json"};function js(t,e){e?t.a["X-Firebase-Locale"]=e:delete t.a["X-Firebase-Locale"]}function qs(t,e){e&&(t.l=Bs("https://securetoken.googleapis.com/v1/token",e),t.h=Bs("https://www.googleapis.com/identitytoolkit/v3/relyingparty/",e),t.i=Bs("https://identitytoolkit.googleapis.com/v2/",e))}function Bs(t,e){return t=ir(t),e=ir(e.url),t.f=t.a+t.f,Zn(t,e.c),t.a=e.a,tr(t,e.g),t.toString()}function Ks(t,e){e?(t.a["X-Client-Version"]=e,t.g["X-Client-Version"]=e):(delete t.a["X-Client-Version"],delete t.g["X-Client-Version"])}function Gs(t,e,n,r,i,o,a){Pr()||Kr()?t=T(t.u,t):(xs||(xs=new Pe((function(t,e){Ws(t,e)}))),t=T(t.s,t)),t(e,n,r,i,o,a)}Ls.prototype.T=function(){return this.b},Ls.prototype.u=function(t,e,n,r,i,o){if(Kr()&&("undefined"===typeof h.fetch||"undefined"===typeof h.Headers||"undefined"===typeof h.Request))throw new C("operation-not-supported-in-this-environment","fetch, Headers and Request native APIs or equivalent Polyfills must be available to support HTTP requests from a Worker environment.");var a=new Za(this.f);if(o){a.g=Math.max(0,o);var s=setTimeout((function(){a.dispatchEvent("timeout")}),o)}Vn(a,"complete",(function(){s&&clearTimeout(s);var t=null;try{t=JSON.parse(ps(this))||null}catch(n){t=null}e&&e(t)})),Hn(a,"ready",(function(){s&&clearTimeout(s),un(this)})),Hn(a,"timeout",(function(){s&&clearTimeout(s),un(this),e&&e(null)})),rs(a,t,n,r,i)};var Ys=new Tt(Nt,"https://apis.google.com/js/client.js?onload=%{onload}"),zs="__fcb"+Math.floor(1e6*Math.random()).toString();function Ws(t,e){if(((window.gapi||{}).client||{}).request)t();else{h[zs]=function(){((window.gapi||{}).client||{}).request?t():e(Error("CORS_UNSUPPORTED"))};var n=Dt(Ys,{onload:zs});ys(As(n),(function(){e(Error("CORS_UNSUPPORTED"))}))}}function Xs(t,e){return new Pe((function(n,r){"refresh_token"==e.grant_type&&e.refresh_token||"authorization_code"==e.grant_type&&e.code?Gs(t,t.l+"?key="+encodeURIComponent(t.c),(function(t){t?t.error?r(Ju(t)):t.access_token&&t.refresh_token?n(t):r(new C("internal-error")):r(new C("network-request-failed"))}),"POST",gr(e).toString(),t.g,t.m.get()):r(new C("internal-error"))}))}function Qs(t,e,n,r,i,o,a){var s=ir(e+n);nr(s,"key",t.c),a&&nr(s,"cb",Date.now().toString());var u="GET"==r;if(u)for(var c in i)i.hasOwnProperty(c)&&nr(s,c,i[c]);return new Pe((function(e,n){Gs(t,s.toString(),(function(t){t?t.error?n(Ju(t,o||{})):e(t):n(new C("network-request-failed"))}),r,u?void 0:Er(si(i)),t.a,t.v.get())}))}function Js(t){if(t=t.email,"string"!==typeof t||!Vr.test(t))throw new C("invalid-email")}function $s(t){"email"in t&&Js(t)}function Zs(t,e){return Xu(t,bu,{identifier:e,continueUri:ri()?Rr():"http://localhost"}).then((function(t){return t.signinMethods||[]}))}function tu(t){return Xu(t,Ou,{}).then((function(t){return t.authorizedDomains||[]}))}function eu(t){if(!t[Ms]){if(t.mfaPendingCredential)throw new C("multi-factor-auth-required",null,wt(t));throw new C("internal-error")}}function nu(t){if(t.phoneNumber||t.temporaryProof){if(!t.phoneNumber||!t.temporaryProof)throw new C("internal-error")}else{if(!t.sessionInfo)throw new C("missing-verification-id");if(!t.code)throw new C("missing-verification-code")}}Ls.prototype.s=function(t,e,n,r,i){var o=this;xs.then((function(){window.gapi.client.setApiKey(o.c);var a=window.gapi.auth.getToken();window.gapi.auth.setToken(null),window.gapi.client.request({path:t,method:n,body:r,headers:i,authType:"none",callback:function(t){window.gapi.auth.setToken(a),e&&e(t)}})})).o((function(t){e&&e({error:{message:t&&t.message||"CORS_UNSUPPORTED"}})}))},Ls.prototype.zb=function(){return Xu(this,Uu,{})},Ls.prototype.Bb=function(t,e){return Xu(this,xu,{idToken:t,email:e})},Ls.prototype.Cb=function(t,e){return Xu(this,Mu,{idToken:t,password:e})};var ru={displayName:"DISPLAY_NAME",photoUrl:"PHOTO_URL"};function iu(t,e){return Xu(t,Lu,e)}function ou(t,e){return Xu(t,Fu,e).then((function(t){return t.phoneSessionInfo.sessionInfo}))}function au(t){if(!t.phoneVerificationInfo)throw new C("internal-error");
359if(!t.phoneVerificationInfo.sessionInfo)throw new C("missing-verification-id");if(!t.phoneVerificationInfo.code)throw new C("missing-verification-code")}function su(t,e){return Xu(t,Vu,e).then((function(t){return t.phoneResponseInfo.sessionInfo}))}function uu(t,e,n){return Xu(t,_u,{idToken:e,deleteProvider:n})}function cu(t){if(!t.requestUri||!t.sessionId&&!t.postBody&&!t.pendingToken)throw new C("internal-error")}function hu(t,e){return e.oauthIdToken&&e.providerId&&0==e.providerId.indexOf("oidc.")&&!e.pendingToken&&(t.sessionId?e.nonce=t.sessionId:t.postBody&&(t=new dr(t.postBody),yr(t,"nonce")&&(e.nonce=t.get("nonce")))),e}function lu(t){var e=null;if(t.needConfirmation?(t.code="account-exists-with-different-credential",e=ka(t)):"FEDERATED_USER_ID_ALREADY_LINKED"==t.errorMessage?(t.code="credential-already-in-use",e=ka(t)):"EMAIL_EXISTS"==t.errorMessage?(t.code="email-already-in-use",e=ka(t)):t.errorMessage&&(e=Qu(t.errorMessage)),e)throw e;eu(t)}function fu(t,e){return e.returnIdpCredential=!0,Xu(t,Hu,e)}function pu(t,e){return e.returnIdpCredential=!0,Xu(t,qu,e)}function du(t,e){return e.returnIdpCredential=!0,e.autoCreate=!1,Xu(t,ju,e)}function vu(t){if(!t.oobCode)throw new C("invalid-action-code")}t=Ls.prototype,t.Db=function(t,e){var n={idToken:t},r=[];return yt(ru,(function(t,i){var o=e[i];null===o?r.push(t):i in e&&(n[i]=o)})),r.length&&(n.deleteAttribute=r),Xu(this,xu,n)},t.vb=function(t,e){return t={requestType:"PASSWORD_RESET",email:t},It(t,e),Xu(this,Ru,t)},t.wb=function(t,e){return t={requestType:"EMAIL_SIGNIN",email:t},It(t,e),Xu(this,ku,t)},t.ub=function(t,e){return t={requestType:"VERIFY_EMAIL",idToken:t},It(t,e),Xu(this,Nu,t)},t.Eb=function(t,e,n){return t={requestType:"VERIFY_AND_CHANGE_EMAIL",idToken:t,newEmail:e},It(t,n),Xu(this,Cu,t)},t.fb=function(t){return Xu(this,Gu,t)},t.nb=function(t,e){return Xu(this,Pu,{oobCode:t,newPassword:e})},t.Ra=function(t){return Xu(this,mu,{oobCode:t})},t.jb=function(t){return Xu(this,gu,{oobCode:t})};var gu={endpoint:"setAccountInfo",A:vu,Z:"email",B:!0},mu={endpoint:"resetPassword",A:vu,G:function(t){var e=t.requestType;if(!e||!t.email&&"EMAIL_SIGNIN"!=e&&"VERIFY_AND_CHANGE_EMAIL"!=e)throw new C("internal-error")},B:!0},yu={endpoint:"signupNewUser",A:function(t){if(Js(t),!t.password)throw new C("weak-password")},G:eu,V:!0,B:!0},bu={endpoint:"createAuthUri",B:!0},wu={endpoint:"deleteAccount",N:["idToken"]},_u={endpoint:"setAccountInfo",N:["idToken","deleteProvider"],A:function(t){if(!Array.isArray(t.deleteProvider))throw new C("internal-error")}},Iu={endpoint:"emailLinkSignin",N:["email","oobCode"],A:Js,G:eu,V:!0,B:!0},Eu={endpoint:"emailLinkSignin",N:["idToken","email","oobCode"],A:Js,G:eu,V:!0},Tu={endpoint:"accounts/mfaEnrollment:finalize",N:["idToken","phoneVerificationInfo"],A:au,G:eu,B:!0,Na:!0},Su={endpoint:"accounts/mfaSignIn:finalize",N:["mfaPendingCredential","phoneVerificationInfo"],A:au,G:eu,B:!0,Na:!0},Au={endpoint:"getAccountInfo"},ku={endpoint:"getOobConfirmationCode",N:["requestType"],A:function(t){if("EMAIL_SIGNIN"!=t.requestType)throw new C("internal-error");Js(t)},Z:"email",B:!0},Nu={endpoint:"getOobConfirmationCode",N:["idToken","requestType"],A:function(t){if("VERIFY_EMAIL"!=t.requestType)throw new C("internal-error")},Z:"email",B:!0},Cu={endpoint:"getOobConfirmationCode",N:["idToken","newEmail","requestType"],A:function(t){if("VERIFY_AND_CHANGE_EMAIL"!=t.requestType)throw new C("internal-error")},Z:"email",B:!0},Ru={endpoint:"getOobConfirmationCode",N:["requestType"],A:function(t){if("PASSWORD_RESET"!=t.requestType)throw new C("internal-error");Js(t)},Z:"email",B:!0},Ou={lb:!0,endpoint:"getProjectConfig",Ub:"GET"},Du={lb:!0,endpoint:"getRecaptchaParam",Ub:"GET",G:function(t){if(!t.recaptchaSiteKey)throw new C("internal-error")}},Pu={endpoint:"resetPassword",A:vu,Z:"email",B:!0},Lu={endpoint:"sendVerificationCode",N:["phoneNumber","recaptchaToken"],Z:"sessionInfo",B:!0},xu={endpoint:"setAccountInfo",N:["idToken"],A:$s,V:!0},Mu={endpoint:"setAccountInfo",N:["idToken"],A:function(t){if($s(t),!t.password)throw new C("weak-password")},G:eu,V:!0},Uu={endpoint:"signupNewUser",G:eu,V:!0,B:!0},Fu={endpoint:"accounts/mfaEnrollment:start",N:["idToken","phoneEnrollmentInfo"],A:function(t){if(!t.phone
359EnrollmentInfo)throw new C("internal-error");if(!t.phoneEnrollmentInfo.phoneNumber)throw new C("missing-phone-number");if(!t.phoneEnrollmentInfo.recaptchaToken)throw new C("missing-app-credential")},G:function(t){if(!t.phoneSessionInfo||!t.phoneSessionInfo.sessionInfo)throw new C("internal-error")},B:!0,Na:!0},Vu={endpoint:"accounts/mfaSignIn:start",N:["mfaPendingCredential","mfaEnrollmentId","phoneSignInInfo"],A:function(t){if(!t.phoneSignInInfo||!t.phoneSignInInfo.recaptchaToken)throw new C("missing-app-credential")},G:function(t){if(!t.phoneResponseInfo||!t.phoneResponseInfo.sessionInfo)throw new C("internal-error")},B:!0,Na:!0},Hu={endpoint:"verifyAssertion",A:cu,Ya:hu,G:lu,V:!0,B:!0},ju={endpoint:"verifyAssertion",A:cu,Ya:hu,G:function(t){if(t.errorMessage&&"USER_NOT_FOUND"==t.errorMessage)throw new C("user-not-found");if(t.errorMessage)throw Qu(t.errorMessage);eu(t)},V:!0,B:!0},qu={endpoint:"verifyAssertion",A:function(t){if(cu(t),!t.idToken)throw new C("internal-error")},Ya:hu,G:lu,V:!0},Bu={endpoint:"verifyCustomToken",A:function(t){if(!t.token)throw new C("invalid-custom-token")},G:eu,V:!0,B:!0},Ku={endpoint:"verifyPassword",A:function(t){if(Js(t),!t.password)throw new C("wrong-password")},G:eu,V:!0,B:!0},Gu={endpoint:"verifyPhoneNumber",A:nu,G:eu,B:!0},Yu={endpoint:"verifyPhoneNumber",A:function(t){if(!t.idToken)throw new C("internal-error");nu(t)},G:function(t){if(t.temporaryProof)throw t.code="credential-already-in-use",ka(t);eu(t)}},zu={Hb:{USER_NOT_FOUND:"user-not-found"},endpoint:"verifyPhoneNumber",A:nu,G:eu,B:!0},Wu={endpoint:"accounts/mfaEnrollment:withdraw",N:["idToken","mfaEnrollmentId"],G:function(t){if(!!t[Ms]^!!t.refreshToken)throw new C("internal-error")},B:!0,Na:!0};function Xu(t,e,n){if(!ki(n,e.N))return je(new C("internal-error"));var r,i=!!e.Na,o=e.Ub||"POST";return He(n).then(e.A).then((function(){return e.V&&(n.returnSecureToken=!0),e.B&&t.b&&"undefined"===typeof n.tenantId&&(n.tenantId=t.b),Qs(t,i?t.i:t.h,e.endpoint,o,n,e.Hb,e.lb||!1)})).then((function(t){return r=t,e.Ya?e.Ya(n,r):r})).then(e.G).then((function(){if(!e.Z)return r;if(!(e.Z in r))throw new C("internal-error");return r[e.Z]}))}function Qu(t){return Ju({error:{errors:[{message:t}],code:400,message:t}})}function Ju(t,e){var n=(t.error&&t.error.errors&&t.error.errors[0]||{}).reason||"",r={keyInvalid:"invalid-api-key",ipRefererBlocked:"app-not-authorized"};if(n=r[n]?new C(r[n]):null)return n;for(var i in n=t.error&&t.error.message||"",r={INVALID_CUSTOM_TOKEN:"invalid-custom-token",CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVALID_IDENTIFIER:"invalid-email",MISSING_CONTINUE_URI:"internal-error",INVALID_EMAIL:"invalid-email",INVALID_PASSWORD:"wrong-password",USER_DISABLED:"user-disabled",MISSING_PASSWORD:"internal-error",EMAIL_EXISTS:"email-already-in-use",PASSWORD_LOGIN_DISABLED:"operation-not-allowed",INVALID_IDP_RESPONSE:"invalid-credential",INVALID_PENDING_TOKEN:"invalid-credential",FEDERATED_USER_ID_ALREADY_LINKED:"credential-already-in-use",MISSING_OR_INVALID_
359NONCE:"missing-or-invalid-nonce",INVALID_MESSAGE_PAYLOAD:"invalid-message-payload",INVALID_RECIPIENT_EMAIL:"invalid-recipient-email",INVALID_SENDER:"invalid-sender",EMAIL_NOT_FOUND:"user-not-found",RESET_PASSWORD_EXCEED_LIMIT:"too-many-requests",EXPIRED_OOB_CODE:"expired-action-code",INVALID_OOB_CODE:"invalid-action-code",MISSING_OOB_CODE:"internal-error",INVALID_PROVIDER_ID:"invalid-provider-id",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"requires-recent-login",INVALID_ID_TOKEN:"invalid-user-token",TOKEN_EXPIRED:"user-token-expired",USER_NOT_FOUND:"user-token-expired",CORS_UNSUPPORTED:"cors-unsupported",DYNAMIC_LINK_NOT_ACTIVATED:"dynamic-link-not-activated",INVALID_APP_ID:"invalid-app-id",TOO_MANY_ATTEMPTS_TRY_LATER:"too-many-requests",WEAK_PASSWORD:"weak-password",OPERATION_NOT_ALLOWED:"operation-not-allowed",USER_CANCELLED:"user-cancelled",CAPTCHA_CHECK_FAILED:"captcha-check-failed",INVALID_APP_CREDENTIAL:"invalid-app-credential",INVALID_CODE:"invalid-verification-code",INVALID_PHONE_NUMBER:"invalid-phone-number",INVALID_SESSION_INFO:"invalid-verification-id",INVALID_TEMPORARY_PROOF:"invalid-credential",MISSING_APP_CREDENTIAL:"missing-app-credential",MISSING_CODE:"missing-verification-code",MISSING_PHONE_NUMBER:"missing-phone-number",MISSING_SESSION_INFO:"missing-verification-id",QUOTA_EXCEEDED:"quota-exceeded",SESSION_EXPIRED:"code-expired",REJECTED_CREDENTIAL:"rejected-credential",INVALID_CONTINUE_URI:"invalid-continue-uri",MISSING_ANDROID_PACKAGE_NAME:"missing-android-pkg-name",MISSING_IOS_BUNDLE_ID:"missing-ios-bundle-id",UNAUTHORIZED_DOMAIN:"unauthorized-continue-uri",INVALID_DYNAMIC_LINK_DOMAIN:"invalid-dynamic-link-domain",INVALID_OAUTH_CLIENT_ID:"invalid-oauth-client-id",INVALID_CERT_HASH:"invalid-cert-hash",UNSUPPORTED_TENANT_OPERATION:"unsupported-tenant-operation",INVALID_TENANT_ID:"invalid-tenant-id",TENANT_ID_MISMATCH:"tenant-id-mismatch",ADMIN_ONLY_OPERATION:"admin-restricted-operation",INVALID_MFA_PENDING_CREDENTIAL:"invalid-multi-factor-session",MFA_ENROLLMENT_NOT_FOUND:"multi-factor-info-not-found",MISSING_MFA_PENDING_CREDENTIAL:"missing-multi-factor-session",MISSING_MFA_ENROLLMENT_ID:"missing-multi-factor-info",EMAIL_CHANGE_NEEDS_VERIFICATION:"email-change-needs-verification",SECOND_FACTOR_EXISTS:"second-factor-already-in-use",SECOND_FACTOR_LIMIT_EXCEEDED:"maximum-second-factor-count-exceeded",UNSUPPORTED_FIRST_FACTOR:"unsupported-first-factor",UNVERIFIED_EMAIL:"unverified-email"},It(r,e||{}),e=(e=n.match(/^[^\s]+\s*:\s*([\s\S]*)$/))&&1<e.length?e[1]:void 0,r)if(0===n.indexOf(i))return new C(r[i],e);return!e&&t&&(e=ai(t)),new C("internal-error",e)}function $u(t){this.b=t,this.a=null,this.rb=Zu(this)}function Zu(t){return ac().then((function(){return new Pe((function(e,n){ti("gapi.iframes.getContext")().open({where:document.body,url:t.b,messageHandlersFilter:ti("gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER"),attributes:{style:{position:"absolute",top:"-100px",width:"1px",height:"1px"}},dontclear:!0},(function(r){function i(){clearTimeout(o),e()}t.a=r,t.a.restyle({setHideOnLeave:!1});var o=setTimeout((function(){n(Error("Network Error"))}),ic.get());r.ping(i).then(i,(function(){n(Error("Network Error"))}))}))}))}))}function tc(t,e){return t.rb.then((function(){return new Pe((function(n){t.a.send(e.type,e,n,ti("gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER"))}))}))}function ec(t,e){t.rb.then((function(){t.a.register("authEvent",e,ti("gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER"))}))}var nc=new Tt(Nt,"https://apis.google.com/js/api.js?onload=%{onload}"),rc=new fi(3e4,6e4),ic=new fi(5e3,15e3),oc=null;
359function ac(){return oc||(oc=new Pe((function(t,e){function n(){li(),ti("gapi.load")("gapi.iframes",{callback:t,ontimeout:function(){li(),e(Error("Network Error"))},timeout:rc.get()})}if(ti("gapi.iframes.Iframe"))t();else if(ti("gapi.load"))n();else{var r="__iframefcb"+Math.floor(1e6*Math.random()).toString();h[r]=function(){ti("gapi.load")?n():e(Error("Network Error"))},r=Dt(nc,{onload:r}),He(As(r)).o((function(){e(Error("Network Error"))}))}})).o((function(t){throw oc=null,t})))}function sc(t,e,n,r){this.l=t,this.h=e,this.i=n,this.g=r,this.f=null,this.g?(t=ir(this.g.url),t=or(t.c,t.a,t.g,"/emulator/auth/iframe")):t=or("https",this.l,null,"/__/auth/iframe"),this.a=t,nr(this.a,"apiKey",this.h),nr(this.a,"appName",this.i),this.b=null,this.c=[]}function uc(t,e,n,r,i,o){this.u=t,this.s=e,this.c=n,this.m=r,this.v=o,this.i=this.g=this.l=null,this.a=i,this.h=this.f=null}function cc(t){try{return r.A.app(t).auth().Ga()}catch(e){return[]}}function hc(t,e,n,r,i,o){this.s=t,this.g=e,this.b=n,this.f=o,this.c=r||null,this.i=i||null,this.l=this.u=this.C=null,this.h=[],this.m=this.a=null}function lc(t){var e=Rr();return tu(t).then((function(t){t:{var n=ir(e),r=n.c;n=n.a;for(var i=0;i<t.length;i++){var o=t[i],a=n,s=r;if(0==o.indexOf("chrome-extension://")?a=ir(o).a==a&&"chrome-extension"==s:"http"!=s&&"https"!=s?a=!1:Fr.test(o)?a=a==o:(o=o.split(".").join("\\."),a=new RegExp("^(.+\\."+o+"|"+o+")$","i").test(a)),a){t=!0;break t}}t=!1}if(!t)throw new Sa(Rr())}))}function fc(t){return t.m||(t.m=Hr().then((function(){if(!t.u){var e=t.c,n=t.i,r=cc(t.b),i=new sc(t.s,t.g,t.b,t.f);i.f=e,i.b=n,i.c=rt(r||[]),t.u=i.toString()}t.v=new $u(t.u),vc(t)}))),t.m}function pc(t){return t.l||(t.C=t.c?$r(t.c,cc(t.b)):null,t.l=new Ls(t.g,x(t.i),t.C),t.f&&qs(t.l,t.f)),t.l}function dc(t,e,n,r,i,o,a,s,u,c,h,l){return t=new uc(t,e,n,r,i,l),t.l=o,t.g=a,t.i=s,t.b=wt(u||null),t.f=c,t.yb(h).toString()}function vc(t){if(!t.v)throw Error("IfcHandler must be initialized!");ec(t.v,(function(e){var n={};if(e&&e.authEvent){var r=!1;for(e=wa(e.authEvent),n=0;n<t.h.length;n++)r=t.h[n](e)||r;return n={},n.status=r?"ACK":"ERROR",He(n)}return n.status="ERROR",He(n)}))}function gc(t){var e={type:"webStorageSupport"};return fc(t).then((function(){return tc(t.v,e)})).then((function(t){if(t&&t.length&&"undefined"!==typeof t[0].webStorageSupport)return t[0].webStorageSupport;throw Error()}))}function mc(t){if(this.a=t||r.A.INTERNAL.reactNative&&r.A.INTERNAL.reactNative.AsyncStorage,!this.a)throw new C("internal-error","The React Native compatibility library was not found.");this.type="asyncStorage"}function yc(t){this.b=t,this.a={},this.f=T(this.c,this)}sc.prototype.toString=function(){return this.f?nr(this.a,"v",this.f):mr(this.a.b,"v"),this.b?nr(this.a,"eid",this.b):mr(this.a.b,"eid"),this.c.length?nr(this.a,"fw",this.c.join(",")):mr(this.a.b,"fw"),this.a.toString()},uc.prototype.yb=function(t){return this.h=t,this},uc.prototype.toString=function(){if(this.v){var t=ir(this.v.url);t=or(t.c,t.a,t.g,"/emulator/auth/handler")}else t=or("https",this.u,null,"/__/auth/handler");if(nr(t,"apiKey",this.s),nr(t,"appName",this.c),nr(t,"authType",this.m),this.a.isOAuthProvider){var e=this.a;try{var n=r.A.app(this.c).auth().la()}catch(u){n=null}for(var i in e.ob=n,nr(t,"providerId",this.a.providerId),n=this.a,e=si(n.Ib),e)e[i]=e[i].toString();i=n.Qc,e=wt(e);for(var o=0;o<i.length;o++){var a=i[o];a in e&&delete e[a]}n.pb&&n.ob&&!e[n.pb]&&(e[n.pb]=n.ob),bt(e)||nr(t,"customParameters",ai(e))}if("function"===typeof this.a.Qb&&(n=this.a.Qb(),n.length&&nr(t,"scopes",n.join(","))),this.l?nr(t,"redirectUrl",this.l):mr(t.b,"redirectUrl"),this.g?nr(t,"eventId",this.g):mr(t.b,"eventId"),this.i?nr(t,"v",this.i):mr(t.b,"v"),this.b)for(var s in this.b)this.b.hasOwnProperty(s)&&!rr(t,s)&&nr(t,s,this.b[s]);return this.h?nr(t,"tid",this.h):mr(t.b,"tid"),this.f?nr(t,"eid",this.f):mr(t.b,"eid"),s=cc(this.c),s.length&&nr(t,"fw",s.join(",")),t.toString()},t=hc.prototype,t.Ob=function(t,e,n){var r=new C("popup-closed-by-user"),i=new C("web-storage-unsupported"),o=this,a=!1;return this.ma().then((function(){gc(o).then((function(n){n||(t&&xr(t),e(i),a=!0)}))})).o((function(){})).then((function(){if(!a)return Ur(t)})).then((function(){if(!a)return Bn(n).then((function(){e(r)}))}))},t.Xb=function(){var t=Zr();return!oi(t)&&!hi(t)},t.Tb=function(){return!1}
359,t.Mb=function(t,e,n,r,i,o,a,s){if(!t)return je(new C("popup-blocked"));if(a&&!oi())return this.ma().o((function(e){xr(t),i(e)})),r(),He();this.a||(this.a=lc(pc(this)));var u=this;return this.a.then((function(){var e=u.ma().o((function(e){throw xr(t),i(e),e}));return r(),e})).then((function(){if(ya(n),!a){var r=dc(u.s,u.g,u.b,e,n,null,o,u.c,void 0,u.i,s,u.f);Or(r,t)}})).o((function(t){throw"auth/network-request-failed"==t.code&&(u.a=null),t}))},t.Nb=function(t,e,n,r){this.a||(this.a=lc(pc(this)));var i=this;return this.a.then((function(){ya(e);var o=dc(i.s,i.g,i.b,t,e,Rr(),n,i.c,void 0,i.i,r,i.f);Or(o)})).o((function(t){throw"auth/network-request-failed"==t.code&&(i.a=null),t}))},t.ma=function(){var t=this;return fc(this).then((function(){return t.v.rb})).o((function(){throw t.a=null,new C("network-request-failed")}))},t.$b=function(){return!0},t.Ea=function(t){this.h.push(t)},t.Sa=function(t){et(this.h,(function(e){return e==t}))},t=mc.prototype,t.get=function(t){return He(this.a.getItem(t)).then((function(t){return t&&ui(t)}))},t.set=function(t,e){return He(this.a.setItem(t,ai(e)))},t.U=function(t){return He(this.a.removeItem(t))},t.ca=function(){},t.ia=function(){};var bc,wc=[];function _c(){var t=Kr()?self:null;if(z(wc,(function(n){n.b==t&&(e=n)})),!e){var e=new yc(t);wc.push(e)}return e}function Ic(t,e,n){bt(t.a)&&t.b.addEventListener("message",t.f),"undefined"===typeof t.a[e]&&(t.a[e]=[]),t.a[e].push(n)}function Ec(t){this.a=t}function Tc(t){this.c=t,this.b=!1,this.a=[]}function Sc(t,e,n,r){var i,o,a,s,u=n||{},c=null;if(t.b)return je(Error("connection_unavailable"));var h=r?800:50,l="undefined"!==typeof MessageChannel?new MessageChannel:null;return new Pe((function(n,r){l?(i=Math.floor(Math.random()*Math.pow(10,20)).toString(),l.port1.start(),a=setTimeout((function(){r(Error("unsupported_event"))}),h),o=function(t){t.data.eventId===i&&("ack"===t.data.status?(clearTimeout(a),s=setTimeout((function(){r(Error("timeout"))}),3e3)):"done"===t.data.status?(clearTimeout(s),"undefined"!==typeof t.data.response?n(t.data.response):r(Error("unknown_error"))):(clearTimeout(a),clearTimeout(s),r(Error("invalid_response"))))},c={messageChannel:l,onMessage:o},t.a.push(c),l.port1.addEventListener("message",o),t.c.postMessage({eventType:e,eventId:i,data:u},[l.port2])):r(Error("connection_unavailable"))})).then((function(e){return Ac(t,c),e})).o((function(e){throw Ac(t,c),e}))}function Ac(t,e){if(e){var n=e.messageChannel,r=e.onMessage;n&&(n.port1.removeEventListener("message",r),n.port1.close()),et(t.a,(function(t){return t==e}))}}function kc(){if(!Dc())throw new C("web-storage-unsupported");this.c={},this.a=[],this.b=0,this.m=h.indexedDB,this.type="indexedDB",this.g=this.v=this.f=this.l=null,this.s=!1,this.h=null;var t=this;Kr()&&self?(this.v=_c(),Ic(this.v,"keyChanged",(function(e,n){return Uc(t).then((function(e){return 0<e.length&&z(t.a,(function(t){t(e)})),{keyProcessed:Z(e,n.key)}}))})),Ic(this.v,"ping",(function(){return He(["keyChanged"])}))):yi().then((function(e){(t.h=e)&&(t.g=new Tc(new Ec(e)),Sc(t.g,"ping",null,!0).then((function(e){e[0].fulfilled&&Z(e[0].value,"keyChanged")&&(t.s=!0)})).o((function(){})))}))}function Nc(t){return new Pe((function(e,n){var r=t.m.deleteDatabase("firebaseLocalStorageDb");r.onsuccess=function(){e()},r.onerror=function(t){n(Error(t.target.error))}}))}function Cc(t){return new Pe((function(e,n){var r=t.m.open("firebaseLocalStorageDb",1);r.onerror=function(t){try{t.preventDefault()}catch(e){}n(Error(t.target.error))},r.onupgradeneeded=function(t){t=t.target.result;try{t.createObjectStore("firebaseLocalStorage",{keyPath:"fbase_key"})}catch(e){n(e)}},r.onsuccess=function(r){r=r.target.result,r.objectStoreNames.contains("firebaseLocalStorage")?e(r):Nc(t).then((function(){return Cc(t)})).then((function(t){e(t)})).o((function(t){n(t)}))}}))}function Rc(t){return t.i||(t.i=Cc(t)),t.i}function Oc(t,e){function n(i,o){Rc(t).then(e).then(i).o((function(e){if(!(3<++r))return Rc(t).then((function(e){return e.close(),t.i=void 0,n(i,o)})).o((function(t){o(t)}));o(e)}))}var r=0;return new Pe(n)}function Dc(){try{return!!h.indexedDB}catch(Zp){return!1}}function Pc(t){return t.objectStore("firebaseLocalStorage")}function Lc(t,e){return t.transaction(["firebaseLocalStorage"],e?"readwrite":"readonly")}function xc(t){return new Pe((function(e,n){t.onsuccess=function(t){t&&t.target?e(t.target.result):e()},t.onerror=function(t){n(t.target.error)}}))}function Mc(t,e){return t.g&&t.h&&mi()===t.h?Sc(t.g,"keyChanged",{key:e},t.s).then((function(){})).o((function(){})):He()}function Uc(t){return Rc(t).then((function(t){var e=Pc(Lc(t,!1));return e.getAll?xc(e.getAll()):new Pe((function(t,n){var r=[],i=e.openCursor();i.onsuccess=function(e){(e=e.target.result)?(r.push(e.value),e["continue"]()):t(r)},i.onerror=function(t){n(t.target.error)}}))})).then((function(e){var n={},r=[];if(0==t.b){for(r=0;r<e.length;r++)n[e[r].fbase_key]=e[r].value;r=Dr(t.c,n),t.c=n}return r}))}function Fc(t){function e(){t.f=setTimeout((function(){t.l=Uc(t).then((function(e){0<e.length&&z(t.a,(function(t){t(e)}))})).then((function(){e()})).o((function(t){"STOP_EVENT"!=t.message&&e()}))}),800)}Vc(t),e()}function Vc(t){t.l&&t.l.cancel("STOP_EVENT"),t.f&&(clearTimeout(t.f),t.f=null)}function Hc(t){var e=this,n=null;this.a=[],this.type="indexedDB",this.c=t,this.b=He().then((function(){if(Dc()){var t=ci(),r="__sak"+t;return bc||(bc=new kc),n=bc,n.set(r,t).then((function(){return n.get(r)})).then((function(e){if(e!==t)throw Error("indexedDB not supported!");return n.U(r)})).then((function(){return n})).o((function(){return e.c}))}return e.c})).then((function(t){return e.type=t.type,t.ca((function(t){z(e.a,(function(e){e(t)}))}
359)),t}))}function jc(){this.a={},this.type="inMemory"}function qc(){if(!Kc()){if("Node"==Gr())throw new C("internal-error","The LocalStorage compatibility library was not found.");throw new C("web-storage-unsupported")}this.a=Bc()||r.A.INTERNAL.node.localStorage,this.type="localStorage"}function Bc(){try{var t=h.localStorage,e=ci();return t&&(t.setItem(e,"1"),t.removeItem(e)),t}catch(n){return null}}function Kc(){var t="Node"==Gr();if(t=Bc()||t&&r.A.INTERNAL.node&&r.A.INTERNAL.node.localStorage,!t)return!1;try{return t.setItem("__sak","1"),t.removeItem("__sak"),!0}catch(e){return!1}}function Gc(){this.type="nullStorage"}function Yc(){if(!Wc()){if("Node"==Gr())throw new C("internal-error","The SessionStorage compatibility library was not found.");throw new C("web-storage-unsupported")}this.a=zc()||r.A.INTERNAL.node.sessionStorage,this.type="sessionStorage"}function zc(){try{var t=h.sessionStorage,e=ci();return t&&(t.setItem(e,"1"),t.removeItem(e)),t}catch(n){return null}}function Wc(){var t="Node"==Gr();if(t=zc()||t&&r.A.INTERNAL.node&&r.A.INTERNAL.node.sessionStorage,!t)return!1;try{return t.setItem("__sak","1"),t.removeItem("__sak"),!0}catch(e){return!1}}function Xc(){var t={};t.Browser=$c,t.Node=Zc,t.ReactNative=th,t.Worker=eh,this.a=t[Gr()]}yc.prototype.c=function(t){var e=t.data.eventType,n=t.data.eventId,r=this.a[e];if(r&&0<r.length){t.ports[0].postMessage({status:"ack",eventId:n,eventType:e,response:null});var i=[];z(r,(function(e){i.push(He().then((function(){return e(t.origin,t.data.data)})))})),Ke(i).then((function(r){var i=[];z(r,(function(t){i.push({fulfilled:t.Pb,value:t.value,reason:t.reason?t.reason.message:void 0})})),z(i,(function(t){for(var e in t)"undefined"===typeof t[e]&&delete t[e]})),t.ports[0].postMessage({status:"done",eventId:n,eventType:e,response:i})}))}},Ec.prototype.postMessage=function(t,e){this.a.postMessage(t,e)},Tc.prototype.close=function(){for(;0<this.a.length;)Ac(this,this.a[0]);this.b=!0},t=kc.prototype,t.set=function(t,e){var n=this,r=!1;return Oc(this,(function(e){return e=Pc(Lc(e,!0)),xc(e.get(t))})).then((function(i){return Oc(n,(function(o){if(o=Pc(Lc(o,!0)),i)return i.value=e,xc(o.put(i));n.b++,r=!0;var a={};return a.fbase_key=t,a.value=e,xc(o.add(a))}))})).then((function(){return n.c[t]=e,Mc(n,t)})).oa((function(){r&&n.b--}))},t.get=function(t){return Oc(this,(function(e){return xc(Pc(Lc(e,!1)).get(t))})).then((function(t){return t&&t.value}))},t.U=function(t){var e=this,n=!1;return Oc(this,(function(r){return n=!0,e.b++,xc(Pc(Lc(r,!0))["delete"](t))})).then((function(){return delete e.c[t],Mc(e,t)})).oa((function(){n&&e.b--}))},t.ca=function(t){0==this.a.length&&Fc(this),this.a.push(t)},t.ia=function(t){et(this.a,(function(e){return e==t})),0==this.a.length&&Vc(this)},t=Hc.prototype,t.get=function(t){return this.b.then((function(e){return e.get(t)}))},t.set=function(t,e){return this.b.then((function(n){return n.set(t,e)}))},t.U=function(t){return this.b.then((function(e){return e.U(t)}))},t.ca=function(t){this.a.push(t)},t.ia=function(t){et(this.a,(function(e){return e==t}))},t=jc.prototype,t.get=function(t){return He(this.a[t])},t.set=function(t,e){return this.a[t]=e,He()},t.U=function(t){return delete this.a[t],He()},t.ca=function(){},t.ia=function(){},t=qc.prototype,t.get=function(t){var e=this;return He().then((function(){var n=e.a.getItem(t);return ui(n)}))},t.set=function(t,e){var n=this;return He().then((function(){var r=ai(e);null===r?n.U(t):n.a.setItem(t,r)}))},t.U=function(t){var e=this;return He().then((function(){e.a.removeItem(t)}))},t.ca=function(t){h.window&&Sn(h.window,"storage",t)},t.ia=function(t){h.window&&Cn(h.window,"storage",t)},t=Gc.prototype,t.get=function(){return He(null)},t.set=function(){return He()},t.U=function(){return He()},t.ca=function(){},t.ia=function(){},t=Yc.prototype,t.get=function(t){var e=this;return He().then((function(){var n=e.a.getItem(t);return ui(n)}))},t.set=function(t,e){var n=this;return He().then((function(){var r=ai(e);null===r?n.U(t):n.a.setItem(t,r)}))},t.U=function(t){var e=this;return He().then((function(){e.a.removeItem(t)}))},t.ca=function(){},t.ia=function(){};var Qc,Jc,$c={F:qc,bb:Yc},Zc={F:qc,bb:Yc},th={F:mc,bb:Gc},eh={F:qc,bb:Gc},nh={rd:"local",NONE:"none",td:"session"};function rh(t){var e=new C("invalid-persistence-type"),n=new C("unsupported-persistence-type");t:{for(r in nh)if(nh[r]==t){var r=!0;break t}r=!1}if(!r||"string"!==typeof t)throw e;switch(Gr()){case"ReactNative":if("session"===t)throw n;break;case"Node":if("none"!==t)throw n;break;case"Worker":if("session"===t||!Dc()&&"none"!==t)throw n;break;default:if(!ei()&&"none"!==t)throw n}}function ih(){var t=!(hi(Zr())||!Br()),e=oi(),n=ei();this.m=t,this.h=e,this.l=n,this.a={},Qc||(Qc=new Xc),t=Qc;try{this.g=!Cr()&&gi()||!h.indexedDB?new t.a.F:new Hc(Kr()?new jc:new t.a.F)}catch(r){this.g=new jc,this.h=!0}try{this.i=new t.a.bb}catch(r){this.i=new jc}this.v=new jc,this.f=T(this.Yb,this),this.b={}}function oh(){return Jc||(Jc=new ih),Jc}function ah(t,e){switch(e){case"session":return t.i;case"none":return t.v;default:return t.g}}function sh(t,e){return"firebase:"+t.name+(e?":"+e:"")}function uh(t,e,n){var r=sh(e,n),i=ah(t,e.F);return t.get(e,n).then((function(o){var a=null;try{a=ui(h.localStorage.getItem(r))}catch(s){}if(a&&!o)return h.localStorage.removeItem(r),t.set(e,a,n);a&&o&&"localStorage"!=i.type&&h.localStorage.removeItem(r)}))}function ch(t,e,n){return n=sh(e,n),"local"==e.F&&(t.b[n]=null),ah(t,e.F).U(n)}function hh(t){lh(t),t.c=setInterval((function(){for(var e in t.a){var n=h.localStorage.getItem(e),r=t.b[e];n!=r&&(t.b[e]=n,n=new dn({type:"storage",key:e,target:window,oldValue:r,newValue:n,a:!0}),t.Yb(n))}}),1e3)}function lh(t){t.c&&(clearInterval(t.c),t.c=null)}function fh(t){this.a=t,this.b=oh()}t=ih.prototype,t.get=function(t,e){return ah(this,t.F).get(sh(t,e))},t.set=function(t,e,n){var r=sh(t,n),i=this,o=ah(this,t.F);return o.set(r,e).then((function(){return o.get(r)})).then((function(e){"local"==t.F&&(i.b[r]=e)}))},t.addListener=function(t,e,n){t=sh(t,e),this.l&&(this.b[t]=h.localStorage.getItem(t)),bt(this.a)&&(ah(this,"local").ca(this.f),this.h||(Cr()||!gi())&&h.indexedDB||!this.l||hh(this)),this.a[t]||(this.a[t]=[]),this.a[t].push(n)},t.removeListener=function(t,e,n){t=sh(t,e),this.a[t]&&(et(this.a[t],(function(t){return t==n})),0==this.a[t].length&&delete this.a[t]),bt(this.a)&&(ah(this,"local").ia(this.f),lh(this))},t.Yb=function(t){if(t&&t.g){var e=t.a.key;if(null==e)for(var n in this.a){var r=this.b[n];"undefined"===typeof r&&(r=null);var i=h.localStorage.getItem(n);i!==r&&(this.b[n]=i,this.mb(n))}else if(0==e.indexOf("firebase:")&&this.a[e]){if("undefined"!==typeof t.a.a?ah(this,"local").ia(this.f):lh(this),this.m)if(n=h.localStorage.getItem(e),r=t.a.newValue,r!==n)null!==r?h.localStorage.setItem(e,r):h.localStorage.removeItem(e);else if(this.b[e]===r&&"undefined"===typeof t.a.a)return;var o=this;n=function(){"undefined"===typeof t.a.a&&o.b[e]===h.localStorage.getItem(e)||(o.b[e]=h.localStorage.getItem(e),o.mb(e))},re&&ge&&10==ge&&h.localStorage.getItem(e)!==t.a.newValue&&t.a.newValue!==t.a.oldValue?setTimeout(n,10):n()}}else z(t,T(this.mb,this))},t.mb=function(t){this.a[t]&&z(this.a[t],(function(t){t()}))};var ph,dh={name:"authEvent",F:"local"};function vh(t){return t.b.get(dh,t.a).then((function(t){return wa(t)}))}function gh(){this.a=oh()}function mh(){this.b=-1}function yh(t,e){this.b=bh,this.f=h.Uint8Array?new Uint8Array(this.b):Array(this.b),this.g=this.c=0,this.a=[],this.i=t,this.h=e,this.l=h.Int32Array?new Int32Array(64):Array(64),void 0===ph&&(ph=h.Int32Array?new Int32Array(Ah):Ah),this.reset()}k(yh,mh);for(var bh=64,wh=bh-1,_h=[],Ih=0;Ih<wh;Ih++)_h[Ih]=0;var Eh=nt(128,_h);function Th(t){for(var e=t.f,n=t.l,r=0,i=0;i<e.length;)n[r++]=e[i]<<24|e[i+1]<<16|e[i+2]<<8|e[i+3],i=4*r;for(e=16;64>e;e++){i=0|n[e-15],r=0|n[e-2];var o=(0|n[e-16])+((i>>>7|i<<25)^(i>>>18|i<<14)^i>>>3)|0,a=(0|n[e-7])+((r>>>17|r<<15)^(r>>
359>19|r<<13)^r>>>10)|0;n[e]=o+a|0}r=0|t.a[0],i=0|t.a[1];var s=0|t.a[2],u=0|t.a[3],c=0|t.a[4],h=0|t.a[5],l=0|t.a[6];for(o=0|t.a[7],e=0;64>e;e++){var f=((r>>>2|r<<30)^(r>>>13|r<<19)^(r>>>22|r<<10))+(r&i^r&s^i&s)|0;a=c&h^~c&l,o=o+((c>>>6|c<<26)^(c>>>11|c<<21)^(c>>>25|c<<7))|0,a=a+(0|ph[e])|0,a=o+(a+(0|n[e])|0)|0,o=l,l=h,h=c,c=u+a|0,u=s,s=i,i=r,r=a+f|0}t.a[0]=t.a[0]+r|0,t.a[1]=t.a[1]+i|0,t.a[2]=t.a[2]+s|0,t.a[3]=t.a[3]+u|0,t.a[4]=t.a[4]+c|0,t.a[5]=t.a[5]+h|0,t.a[6]=t.a[6]+l|0,t.a[7]=t.a[7]+o|0}function Sh(t,e,n){void 0===n&&(n=e.length);var r=0,i=t.c;if("string"===typeof e)for(;r<n;)t.f[i++]=e.charCodeAt(r++),i==t.b&&(Th(t),i=0);else{if(!g(e))throw Error("message must be string or array");for(;r<n;){var o=e[r++];if(!("number"==typeof o&&0<=o&&255>=o&&o==(0|o)))throw Error("message must be a byte array");t.f[i++]=o,i==t.b&&(Th(t),i=0)}}t.c=i,t.g+=n}yh.prototype.reset=function(){this.g=this.c=0,this.a=h.Int32Array?new Int32Array(this.h):rt(this.h)};var Ah=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function kh(){yh.call(this,8,Nh)}k(kh,yh);var Nh=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225];function Ch(t,e,n,r,i,o){this.v=t,this.i=e,this.l=n,this.m=r||null,this.u=i||null,this.s=o,this.h=e+":"+n,this.C=new gh,this.g=new fh(this.h),this.f=null,this.b=[],this.a=this.c=null}function Rh(t){return new C("invalid-cordova-configuration",t)}function Oh(){for(var t=20,e=[];0<t;)e.push("1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".charAt(Math.floor(62*Math.random()))),t--;return e.join("")}function Dh(t){var e=new kh;Sh(e,t),t=[];var n=8*e.g;56>e.c?Sh(e,Eh,56-e.c):Sh(e,Eh,e.b-(e.c-56));for(var r=63;56<=r;r--)e.f[r]=255&n,n/=256;for(Th(e),r=n=0;r<e.i;r++)for(var i=24;0<=i;i-=8)t[n++]=e.a[r]>>i&255;return mo(t)}function Ph(t,e,n,r,i){var o=Oh(),a=new ba(e,r,null,o,new C("no-auth-event"),null,i),s=ti("BuildInfo.packageName",h);if("string"!==typeof s)throw new C("invalid-cordova-configuration");var u=ti("BuildInfo.displayName",h),c={};if(Zr().toLowerCase().match(/iphone|ipad|ipod/))c.ibi=s;
359else{if(!Zr().toLowerCase().match(/android/))return je(new C("operation-not-supported-in-this-environment"));c.apn=s}u&&(c.appDisplayName=u),o=Dh(o),c.sessionId=o;var l=dc(t.v,t.i,t.l,e,n,null,r,t.m,c,t.u,i,t.s);return t.ma().then((function(){var e=t.h;return t.C.a.set(dh,a.w(),e)})).then((function(){var e=ti("cordova.plugins.browsertab.isAvailable",h);if("function"!==typeof e)throw new C("invalid-cordova-configuration");var n=null;e((function(e){if(e){if(n=ti("cordova.plugins.browsertab.openUrl",h),"function"!==typeof n)throw new C("invalid-cordova-configuration");n(l)}else{if(n=ti("cordova.InAppBrowser.open",h),"function"!==typeof n)throw new C("invalid-cordova-configuration");e=Zr(),t.a=n(l,e.match(/(iPad|iPhone|iPod).*OS 7_\d/i)||e.match(/(iPad|iPhone|iPod).*OS 8_\d/i)?"_blank":"_system","location=yes")}}))}))}function Lh(t,e){for(var n=0;n<t.b.length;n++)try{t.b[n](e)}catch(r){}}function xh(t){return t.f||(t.f=t.ma().then((function(){return new Pe((function(e){function n(r){return e(r),t.Sa(n),!1}t.Ea(n),Uh(t)}))}))),t.f}function Mh(t){var e=null;return vh(t.g).then((function(n){return e=n,n=t.g,ch(n.b,dh,n.a)})).then((function(){return e}))}function Uh(t){function e(e){r=!0,i&&i.cancel(),Mh(t).then((function(r){var i=n;if(r&&e&&e.url){var o=null;i=Fo(e.url),-1!=i.indexOf("/__/auth/callback")&&(o=ir(i),o=ui(rr(o,"firebaseError")||null),o=(o="object"===typeof o?R(o):null)?new ba(r.c,r.b,null,null,o,null,r.T()):new ba(r.c,r.b,i,r.f,null,null,r.T())),i=o||n}Lh(t,i)}))}var n=new ba("unknown",null,null,null,new C("no-auth-event")),r=!1,i=Bn(500).then((function(){return Mh(t).then((function(){r||Lh(t,n)}))})),o=h.handleOpenURL;h.handleOpenURL=function(t){if(0==t.toLowerCase().indexOf(ti("BuildInfo.packageName",h).toLowerCase()+"://")&&e({url:t}),"function"===typeof o)try{o(t)}catch(n){console.error(n)}},Ea||(Ea=new _a),Ta(e)}function Fh(t){this.a=t,this.b=oh()}t=Ch.prototype,t.ma=function(){return this.Ia?this.Ia:this.Ia=jr().then((function(){if("function"!==typeof ti("universalLinks.subscribe",h))throw Rh("cordova-universal-links-plugin-fix is not installed");if("undefined"===typeof ti("BuildInfo.packageName",h))throw Rh("cordova-plugin-buildinfo is not installed");if("function"!==typeof ti("cordova.plugins.browsertab.openUrl",h))throw Rh("cordova-plugin-browsertab is not installed");if("function"!==typeof ti("cordova.InAppBrowser.open",h))throw Rh("cordova-plugin-inappbrowser is not installed")}),(function(){throw new C("cordova-not-ready")}))},t.Ob=function(t,e){return e(new C("operation-not-supported-in-this-environment")),He()},t.Mb=function(){return je(new C("operation-not-supported-in-this-environment"))},t.$b=function(){return!1},t.Xb=function(){return!0},t.Tb=function(){return!0},t.Nb=function(t,e,n,r){if(this.c)return je(new C("redirect-operation-pending"));var i=this,o=h.document,a=null,s=null,u=null,c=null;return this.c=He().then((function(){return ya(e),xh(i)})).then((function(){return Ph(i,t,e,n,r)})).then((function(){return new Pe((function(t,e){s=function(){var e=ti("cordova.plugins.browsertab.close",h);return t(),"function"===typeof e&&e(),i.a&&"function"===typeof i.a.close&&(i.a.close(),i.a=null),!1},i.Ea(s),u=function(){a||(a=Bn(2e3).then((function(){e(new C("redirect-cancelled-by-user"))})))},c=function(){pi()&&u()},o.addEventListener("resume",u,!1),Zr().toLowerCase().match(/android/)||o.addEventListener("visibilitychange",c,!1)})).o((function(t){return Mh(i).then((function(){throw t}))}))})).oa((function(){u&&o.removeEventListener("resume",u,!1),c&&o.removeEventListener("visibilitychange",c,!1),a&&a.cancel(),s&&i.Sa(s),i.c=null}))},t.Ea=function(t){this.b.push(t),xh(this).o((function(e){"auth/invalid-cordova-configuration"===e.code&&(e=new ba("unknown",null,null,null,new C("no-auth-event")),t(e))}))},t.Sa=function(t){et(this.b,(function(e){return e==t}))};var Vh={name:"pendingRedirect",F:"session"};function Hh(t){return t.b.set(Vh,"pending",t.a)}function jh(t){return ch(t.b,Vh,t.a)}function qh(t){return t.b.get(Vh,t.a).then((function(t){return"pending"==t}))}function Bh(t,e,n,r){this.i={},this.u=0,this.D=t,this.v=e,this.m=n,this.J=r,this.h=[],this.f=!1,this.l=T(this.s,this),this.b=new il,this.C=new fl,this.g=new Fh(nl(this.v,this.m)),this.c={},this.c.unknown=this.b,this.c.signInViaRedirect=this.b,this.c.linkViaRedirect=this.b,this.c.reauthViaRedirect=this.b,this.c.signInViaPopup=this.C,this.c.linkViaPopup=this.C,this.c.reauthViaPopup=this.C,this.a=Kh(this.D,this.v,this.m,O,this.J)}function Kh(t,e,n,i,o){var a=r.A.SDK_VERSION||null;return qr()?new Ch(t,e,n,a,i,o):new hc(t,e,n,a,i,o)}
359function Gh(t){t.f||(t.f=!0,t.a.Ea(t.l));var e=t.a;return t.a.ma().o((function(n){throw t.a==e&&t.reset(),n}))}function Yh(t){t.a.Xb()&&Gh(t).o((function(e){var n=new ba("unknown",null,null,null,new C("operation-not-supported-in-this-environment"));$h(e)&&t.s(n)})),t.a.Tb()||ol(t.b)}function zh(t,e){Z(t.h,e)||t.h.push(e),t.f||qh(t.g).then((function(e){e?jh(t.g).then((function(){Gh(t).o((function(e){var n=new ba("unknown",null,null,null,new C("operation-not-supported-in-this-environment"));$h(e)&&t.s(n)}))})):Yh(t)})).o((function(){Yh(t)}))}function Wh(t,e){et(t.h,(function(t){return t==e}))}Bh.prototype.reset=function(){this.f=!1,this.a.Sa(this.l),this.a=Kh(this.D,this.v,this.m,null,this.J),this.i={}},Bh.prototype.s=function(t){if(!t)throw new C("invalid-auth-event");if(6e5<=Date.now()-this.u&&(this.i={},this.u=0),t&&t.getUid()&&this.i.hasOwnProperty(t.getUid()))return!1;for(var e=!1,n=0;n<this.h.length;n++){var r=this.h[n];if(r.Fb(t.c,t.b)){(e=this.c[t.c])&&(e.h(t,r),t&&(t.f||t.b)&&(this.i[t.getUid()]=!0,this.u=Date.now())),e=!0;break}}return ol(this.b),e};var Xh=new fi(2e3,1e4),Qh=new fi(3e4,6e4);function Jh(t,e,n,r,i,o,a){return t.a.Mb(e,n,r,(function(){t.f||(t.f=!0,t.a.Ea(t.l))}),(function(){t.reset()}),i,o,a)}function $h(t){return!(!t||"auth/cordova-not-ready"!=t.code)}function Zh(t,e,n,r,i){var o;return Hh(t.g).then((function(){return t.a.Nb(e,n,r,i).o((function(e){if($h(e))throw new C("operation-not-supported-in-this-environment");return o=e,jh(t.g).then((function(){throw o}))})).then((function(){return t.a.$b()?new Pe((function(){})):jh(t.g).then((function(){return t.qa()})).then((function(){})).o((function(){}))}))}))}function tl(t,e,n,r,i){return t.a.Ob(r,(function(t){e.na(n,null,t,i)}),Xh.get())}Bh.prototype.qa=function(){return this.b.qa()};var el={};function nl(t,e,n){return t=t+":"+e,n&&(t=t+":"+n.url),t}function rl(t,e,n,r){var i=nl(e,n,r);return el[i]||(el[i]=new Bh(t,e,n,r)),el[i]}function il(){this.b=null,this.f=[],this.c=[],this.a=null,this.i=this.g=!1}function ol(t){t.g||(t.g=!0,hl(t,!1,null,null))}function al(t){t.g&&!t.i&&hl(t,!1,null,null)}function sl(t,e,n){n=n.Fa(e.c,e.b);var r=e.g,i=e.f,o=e.i,a=e.T(),s=!!e.c.match(/Redirect$/);n(r,i,a,o).then((function(e){hl(t,s,e,null)})).o((function(e){hl(t,s,null,e)}))}function ul(t,e){if(t.b=function(){return je(e)},t.c.length)for(var n=0;n<t.c.length;n++)t.c[n](e)}function cl(t,e){if(t.b=function(){return He(e)},t.f.length)for(var n=0;n<t.f.length;n++)t.f[n](e)}function hl(t,e,n,r){e?r?ul(t,r):cl(t,n):cl(t,{user:null}),t.f=[],t.c=[]}function ll(t){var e=new C("timeout");t.a&&t.a.cancel(),t.a=Bn(Qh.get()).then((function(){t.b||(t.g=!0,hl(t,!0,null,e))}))}function fl(){}function pl(t,e){var n=t.b,r=t.c;e.Fa(r,n)(t.g,t.f,t.T(),t.i).then((function(t){e.na(r,t,null,n)})).o((function(t){e.na(r,null,t,n)}))}function dl(){this.ib=!1,Object.defineProperty(this,"appVerificationDisabled",{get:function(){return this.ib},set:function(t){this.ib=t},enumerable:!1})}function vl(t,e){this.a=e,Ei(this,"verificationId",t)}function gl(t,e,n,r){return new va(t).fb(e,n).then((function(t){return new vl(t,r)}))}function ml(t){var e=To(t);if(!(e&&e.exp&&e.auth_time&&e.iat))throw new C("internal-error","An internal error occurred. The token obtained by Firebase appears to be malformed. Please retry the operation.");Ti(this,{token:t,expirationTime:vi(1e3*e.exp),authTime:vi(1e3*e.auth_time),issuedAtTime:vi(1e3*e.iat),signInProvider:e.firebase&&e.firebase.sign_in_provider?e.firebase.sign_in_provider:null,signInSecondFactor:e.firebase&&e.firebase.sign_in_second_factor?e.firebase.sign_in_second_factor:null,claims:e})}function yl(t,e,n){var r=e&&e[wl];if(!r)throw new C("argument-error","Internal assert: Invalid MultiFactorResolver");this.a=t,this.f=wt(e),this.g=n,this.c=new Vo(null,r),this.b=[];var i=this;z(e[bl]||[],(function(t){(t=Ri(t))&&i.b.push(t)})),Ei(this,"auth",this.a),Ei(this,"session",this.c),Ei(this,"hints",this.b)}il.prototype.reset=function(){this.b=null,this.a&&(this.a.cancel(),this.a=null)},il.prototype.h=function(t,e){if(t){this.reset(),this.g=!0;var n=t.c,r=t.b,i=t.a&&"auth/web-storage-unsupported"==t.a.code,o=t.a&&"auth/operation-not-supported-in-this-environment"==t.a.code;this.i=!(!i&&!o),"unknown"!=n||i||o?t.a?(hl(this,!0,null,t.a),He()):e.Fa(n,r)?
359sl(this,t,e):je(new C("invalid-auth-event")):(hl(this,!1,null,null),He())}else je(new C("invalid-auth-event"))},il.prototype.qa=function(){var t=this;return new Pe((function(e,n){t.b?t.b().then(e,n):(t.f.push(e),t.c.push(n),ll(t))}))},fl.prototype.h=function(t,e){if(t){var n=t.c,r=t.b;t.a?(e.na(t.c,null,t.a,t.b),He()):e.Fa(n,r)?pl(t,e):je(new C("invalid-auth-event"))}else je(new C("invalid-auth-event"))},vl.prototype.confirm=function(t){return t=ga(this.verificationId,t),this.a(t)};var bl="mfaInfo",wl="mfaPendingCredential";function _l(t,e,n,r){C.call(this,"multi-factor-auth-required",r,e),this.b=new yl(t,e,n),Ei(this,"resolver",this.b)}function Il(t,e,n){if(t&&y(t.serverResponse)&&"auth/multi-factor-auth-required"===t.code)try{return new _l(e,t.serverResponse,n,t.message)}catch(r){}return null}function El(){}function Tl(t,e,n,r){return n.Ha().then((function(n){return n={idToken:n},"undefined"!==typeof r&&(n.displayName=r),It(n,{phoneVerificationInfo:da(t.a)}),Xu(e,Tu,n)}))}function Sl(t,e,n){return n.Ha().then((function(n){return n={mfaPendingCredential:n},It(n,{phoneVerificationInfo:da(t.a)}),Xu(e,Su,n)}))}function Al(t){Ei(this,"factorId",t.fa),this.a=t}function kl(t){if(Al.call(this,t),this.a.fa!=va.PROVIDER_ID)throw new C("argument-error","firebase.auth.PhoneMultiFactorAssertion requires a valid firebase.auth.PhoneAuthCredential")}function Nl(t,e){for(var n in pn.call(this,t),e)this[n]=e[n]}function Cl(t,e){this.a=t,this.b=[],this.c=T(this.yc,this),Sn(this.a,"userReloaded",this.c);var n=[];e&&e.multiFactor&&e.multiFactor.enrolledFactors&&z(e.multiFactor.enrolledFactors,(function(t){var e=null,r={};if(t){t.uid&&(r[Pi]=t.uid),t.displayName&&(r[Oi]=t.displayName),t.enrollmentTime&&(r[Di]=new Date(t.enrollmentTime).toISOString()),t.phoneNumber&&(r[Li]=t.phoneNumber);try{e=new xi(r)}catch(i){}t=e}else t=null;t&&n.push(t)})),Ol(this,n)}function Rl(t){var e=[];return z(t.mfaInfo||[],(function(t){(t=Ri(t))&&e.push(t)})),e}function Ol(t,e){t.b=e,Ei(t,"enrolledFactors",e)}function Dl(t,e,n){if(this.h=t,this.i=e,this.g=n,this.c=3e4,this.f=96e4,this.b=null,this.a=this.c,this.f<this.c)throw Error("Proactive refresh lower bound greater than upper bound!")}function Pl(t,e){return e?(t.a=t.c,t.g()):(e=t.a,t.a*=2,t.a>t.f&&(t.a=t.f),e)}function Ll(t,e){t.stop(),t.b=Bn(Pl(t,e)).then((function(){return di()})).then((function(){return t.h()})).then((function(){Ll(t,!0)})).o((function(e){t.i(e)&&Ll(t,!1)}))}function xl(t){this.f=t,this.b=this.a=null,this.c=Date.now()}function Ml(t,e){"undefined"===typeof e&&(t.b?(e=t.b,e=e.a-e.g):e=0),t.c=Date.now()+1e3*e}function Ul(t,e){t.b=Eo(e[Ms]||""),t.a=e.refreshToken,e=e.expiresIn,Ml(t,"undefined"!==typeof e?Number(e):void 0)}function Fl(t,e){t.b=e.b,t.a=e.a,t.c=e.c}function Vl(t,e){return Xs(t.f,e).then((function(e){return t.b=Eo(e.access_token),t.a=e.refresh_token,Ml(t,e.expires_in),{accessToken:t.b.toString(),refreshToken:t.a}})).o((function(e){throw"auth/user-token-expired"==e.code&&(t.a=null),e}))}function Hl(t,e){this.a=t||null,this.b=e||null,Ti(this,{lastSignInTime:vi(e||null),creationTime:vi(t||null)})}function jl(t){return new Hl(t.a,t.b)}function ql(t,e,n,r,i,o){Ti(this,{uid:t,displayName:r||null,photoURL:i||null,email:n||null,phoneNumber:o||null,providerId:e})}function Bl(t,e,n){this.J=[],this.l=t.apiKey,this.m=t.appName,this.s=t.authDomain||null;var i=r.A.SDK_VERSION?$r(r.A.SDK_VERSION):null;this.a=new Ls(this.l,x(O),i),t.emulatorConfig&&qs(this.a,t.emulatorConfig),this.b=new xl(this.a),$l(this,e[Ms]),Ul(this.b,e),Ei(this,"refreshToken",this.b.a),nf(this,n||{}),Fn.call(this),this.R=!1,this.s&&ni()&&(this.i=rl(this.s,this.l,this.m)),this.S=[],this.h=null,this.u=Xl(this),this.aa=T(this.hb,this);var o=this;this.ya=null,this.Oa=function(t){o.wa(t.h)},this.ja=null,this.Aa=function(t){qs(o.a,t.c)},this.X=null,this.$=[],this.Ba=function(t){Yl(o,t.f)},this.ba=null,this.O=new Cl(this,n),Ei(this,"multiFactor",this.O)}function Kl(t,e){t.ja&&Cn(t.ja,"languageCodeChanged",t.Oa),(t.ja=e)&&Sn(e,"languageCodeChanged",t.Oa)}function Gl(t,e){t.X&&Cn(t.X,"emulatorConfigChanged",t.Aa),(t.X=e)&&Sn(e,"emulatorConfigChanged",t.Aa)}function Yl(t,e){t.$=e,Ks(t.a,r.A.SDK_VERSION?$r(r.A.SDK_VERSION,t.$):null)}function zl(t,e){t.ba&&Cn(t.ba,"frameworkChanged",t.Ba),(t.ba=e)&&Sn(e,"frameworkChanged",t.Ba)}function Wl(t){try{return r.A.app(t.m).auth()}catch(e){throw new C("internal-error","No firebase.auth.Auth instance is available for the Firebase App '"+t.m+"'!")}}function Xl(t){return new Dl((function(){return t.I(!0)}),(function(t){return!(!t||"auth/network-request-failed"!=t.code)}),(function(){var e=t.b.c-Date.now()-3e5;return 0<e?e:0}))}function Ql(t){t.D||t.u.b||(t.u.start(),Cn(t,"tokenChanged",t.aa),Sn(t,"tokenChanged",t.aa))}
359function Jl(t){Cn(t,"tokenChanged",t.aa),t.u.stop()}function $l(t,e){t.za=e,Ei(t,"_lat",e)}function Zl(t,e){et(t.S,(function(t){return t==e}))}function tf(t){for(var e=[],n=0;n<t.S.length;n++)e.push(t.S[n](t));return Ke(e).then((function(){return t}))}function ef(t){t.i&&!t.R&&(t.R=!0,zh(t.i,t))}function nf(t,e){Ti(t,{uid:e.uid,displayName:e.displayName||null,photoURL:e.photoURL||null,email:e.email||null,emailVerified:e.emailVerified||!1,phoneNumber:e.phoneNumber||null,isAnonymous:e.isAnonymous||!1,tenantId:e.tenantId||null,metadata:new Hl(e.createdAt,e.lastLoginAt),providerData:[]}),t.a.b=t.tenantId}function rf(){}function of(t){return He().then((function(){if(t.D)throw new C("app-deleted")}))}function af(t){return Q(t.providerData,(function(t){return t.providerId}))}function sf(t,e){e&&(uf(t,e.providerId),t.providerData.push(e))}function uf(t,e){et(t.providerData,(function(t){return t.providerId==e}))}function cf(t,e,n){("uid"!=e||n)&&t.hasOwnProperty(e)&&Ei(t,e,n)}function hf(t,e){t!=e&&(Ti(t,{uid:e.uid,displayName:e.displayName,photoURL:e.photoURL,email:e.email,emailVerified:e.emailVerified,phoneNumber:e.phoneNumber,isAnonymous:e.isAnonymous,tenantId:e.tenantId,providerData:[]}),e.metadata?Ei(t,"metadata",jl(e.metadata)):Ei(t,"metadata",new Hl),z(e.providerData,(function(e){sf(t,e)})),Fl(t.b,e.b),Ei(t,"refreshToken",t.b.a),Ol(t.O,e.O.b))}function lf(t){return t.I().then((function(e){var n=t.isAnonymous;return pf(t,e).then((function(){return n||cf(t,"isAnonymous",!1),e}))}))}function ff(t,e){e[Ms]&&t.za!=e[Ms]&&(Ul(t.b,e),t.dispatchEvent(new Nl("tokenChanged")),$l(t,e[Ms]),cf(t,"refreshToken",t.b.a))}function pf(t,e){return Xu(t.a,Au,{idToken:e}).then(T(t.Kc,t))}function df(t){return(t=t.providerUserInfo)&&t.length?Q(t,(function(t){return new ql(t.rawId,t.providerId,t.email,t.displayName,t.photoUrl,t.phoneNumber)})):[]}function vf(t,e){return lf(t).then((function(){if(Z(af(t),e))return tf(t).then((function(){throw new C("provider-already-linked")}))}))}function gf(t,e,n){var r=ma(e);return e=Co(e),Si({user:t,credential:r,additionalUserInfo:e,operationType:n})}function mf(t,e){return ff(t,e),t.reload().then((function(){return t}))}function yf(t,e,n,i,o){if(!ni())return je(new C("operation-not-supported-in-this-environment"));if(t.h&&!o)return je(t.h);var a=No(n.providerId),s=ci(t.uid+":::"),u=null;(!oi()||Br())&&t.s&&n.isOAuthProvider&&(u=dc(t.s,t.l,t.m,e,n,null,s,r.A.SDK_VERSION||null,null,null,t.tenantId));var c=Mr(u,a&&a.ua,a&&a.ta);return i=i().then((function(){if(wf(t),!o)return t.I().then((function(){}))})).then((function(){return Jh(t.i,c,e,n,s,!!u,t.tenantId)})).then((function(){return new Pe((function(n,r){t.na(e,null,new C("cancelled-popup-request"),t.g||null),t.f=n,t.C=r,t.g=s,t.c=tl(t.i,t,e,c,s)}))})).then((function(t){return c&&xr(c),t?Si(t):null})).o((function(t){throw c&&xr(c),t})),_f(t,i,o)}function bf(t,e,n,r,i){if(!ni())return je(new C("operation-not-supported-in-this-environment"));if(t.h&&!i)return je(t.h);var o=null,a=ci(t.uid+":::");return r=r().then((function(){if(wf(t),!i)return t.I().then((function(){}))})).then((function(){return t.ga=a,tf(t)})).then((function(e){return t.ha&&(e=t.ha,e=e.b.set(kf,t.w(),e.a)),e})).then((function(){return Zh(t.i,e,n,a,t.tenantId)})).o((function(e){if(o=e,t.ha)return Nf(t.ha);throw o})).then((function(){if(o)throw o})),_f(t,r,i)}function wf(t){if(!t.i||!t.R){if(t.i&&!t.R)throw new C("internal-error");throw new C("auth-domain-config-required")}}function _f(t,e,n){var r=If(t,e,n);return t.J.push(r),r.oa((function(){tt(t.J,r)})),r.o((function(e){var n=null;throw e&&"auth/multi-factor-auth-required"===e.code&&(n=Il(e.w(),Wl(t),T(t.jc,t))),n||e}))}function If(t,e,n){return t.h&&!n?(e.cancel(),je(t.h)):e.o((function(e){throw!e||"auth/user-disabled"!=e.code&&"auth/user-token-expired"!=e.code||(t.h||t.dispatchEvent(new Nl("userInvalidated")),t.h=e),e}))}function Ef(t){if(!t.apiKey)return null;var e={apiKey:t.apiKey,authDomain:t.authDomain,appName:t.appName,emulatorConfig:t.emulatorConfig},n={};if(!t.stsTokenManager||!t.stsTokenManager.accessToken)return null;n[Ms]=t.stsTokenManager.accessToken,n.refreshToken=t.stsTokenManager.refreshToken||null;var r=t.stsTokenManager.expirationTime;r&&(n.expiresIn=(r-Date.now())/1e3);var i=new Bl(e,n,t);return t.providerData&&z(t.providerData,(function(t){t&&sf(i,Si(t))})),t.redirectEventId&&(i.ga=t.redirectEventId),i}function Tf(t,e,n,r){var i=new Bl(t,e);return n&&(i.ha=n),r&&Yl(i,r),i.reload().then((function(){return i}))}function Sf(t,e,n,r){var i=t.b,o={};return o[Ms]=i.b&&i.b.toString(),o.refreshToken=i.a,e=new Bl(e||{apiKey:t.l,authDomain:t.s,appName:t.m},o),n&&(e.ha=n),r&&Yl(e,r),hf(e,t),e}function Af(t){this.a=t,this.b=oh()}yl.prototype.Rc=function(t){var e=this;return t.sb(this.a.a,this.c).then((function(t){var n=wt(e.f);return delete n[bl],delete n[wl],It(n,t),e.g(n)}))},k(_l,C),El.prototype.sb=function(t,e,n){return e.type==Ho?Tl(this,t,e,n):Sl(this,t,e)},k(Al,El),k(kl,Al),k(Nl,pn),t=Cl.prototype,t.yc=function(t){Ol(this,Rl(t.hd))},t.Rb=function(){return this.a.I().then((function(t){return new Vo(t,null)}))},t.fc=function(t,e){var n=this,r=this.a.a;return this.Rb().then((function(n){return t.sb(r,n,e)})).then((function(t){return ff(n.a,t),n.a.reload()}))},t.bd=function(t){var e=this,n="string"===typeof t?t:t.uid,r=this.a.a;return this.a.I().then((function(t){return Xu(r,Wu,{idToken:t,mfaEnrollmentId:n})})).then((function(t){var r=X(e.b,(function(t){return t.uid!=n}));return Ol(e,r),ff(e.a,t),e.a.reload().o((function(t){if("auth/user-token-expired"!=t.code)throw t}))}))},t.w=function(){return{multiFactor:{enrolledFactors:Q(this.b,(function(t){return t.w()}))}}},Dl.prototype.start=function(){this.a=this.c,Ll(this,!0)},Dl.prototype.stop=function(){this.b&&(this.b.cancel(),this.b=null)},xl.prototype.w=function(){return{apiKey:this.f.c,refreshToken:this.a,accessToken:this.b&&this.b.toString(),expirationTime:this.c}},xl.prototype.getToken=function(t){return t=!!t,this.b&&!this.a?je(new C("user-token-expired")):t||!this.b||Date.now()>this.c-3e4?this.a?Vl(this,{grant_type:"refresh_token",refresh_token:this.a}):He(null):He({accessToken:this.b.toString(),refreshToken:this.a})},Hl.prototype.w=function(){return{lastLoginAt:this.b,createdAt:this.a}},k(Bl,Fn),Bl.prototype.wa=function(t){this.ya=t,js(this.a,t)},Bl.prototype.la=function(){return this.ya},Bl.prototype.Ga=function(){return rt(this.$)},Bl.prototype.hb=function(){this.u.b&&(this.u.stop(),this.u.start())},Ei(Bl.prototype,"providerId","firebase"),t=Bl.prototype,t.reload=function(){var t=this;return _f(this,of(this).then((function(){return lf(t).then((function(){return tf(t)})).then(rf)})))},t.oc=function(t){return this.I(t).then((function(t){return new ml(t)}))},t.I=function(t){var e=this;return _f(this,of(this).then((function(){return e.b.getToken(t)})).then((function(t){if(!t)throw new C("internal-error");return t.accessToken!=e.za&&($l(e,t.accessToken),e.dispatchEvent(new Nl("tokenChanged"))),cf(e,"refreshToken",t.refreshToken),t.accessToken})))},t.Kc=function(t){if(t=t.users,!t||!t.length)throw new C("internal-error");t=t[0],nf(this,{uid:t.localId,displayName:t.displayName,photoURL:t.photoUrl,email:t.email,emailVerified:!!t.emailVerified,phoneNumber:t.phoneNumber,lastLoginAt:t.lastLoginAt,createdAt:t.createdAt,tenantId:t.tenantId});for(var e=df(t),n=0;n<e.length;n++)sf(this,e[n]);cf(this,"isAnonymous",!(this.email&&t.passwordHash)&&!(this.providerData&&this.providerData.length)),this.dispatchEvent(new Nl("userReloaded",{hd:t}))},t.Lc=function(t){return _i("firebase.User.prototype.reauthenticateAndRetrieveDataWithCredential is deprecated. Please use firebase.User.prototype.reauthenticateWithCredential instead."),this.tb(t)},t.tb=function(t){var e=this,n=null;return _f(this,t.c(this.a,this.uid).then((function(t){return ff(e,t),n=gf(e,t,"reauthenticate"),e.h=null,e.reload()})).then((function(){return n})),!0)},t.Cc=function(t){return _i("firebase.User.prototype.linkAndRetrieveDataWithCredential is deprecated. Please use firebase.User.prototype.linkWithCredential instead."),this.qb(t)},t.qb=function(t){var e=this,n=null;return _f(this,vf(this,t.providerId).then((function(){return e.I()})).then((function(n){return t.b(e.a,n)})).then((function(t){return n=gf(e,t,"link"),mf(e,t)})).then((function(){return n})))},t.Dc=function(t,e){var n=this;return _f(this,vf(this,"phone").then((function(){return gl(Wl(n),t,e,T(n.qb,n))})))},t.Mc=function(t,e){var n=this;return _f(this,He().then((function(){return gl(Wl(n),t,e,T(n.tb,n))})),!0)},t.Bb=function(t){var e=this;return _f(this,this.I().then((function(n){return e.a.Bb(n,t)})).then((function(t){return ff(e,t),e.reload()})))},t.ed=function(t){var e=this;return _f(this,this.I().then((function(n){return t.b(e.a,n)})).then((function(t){return ff(e,t),e.reload()})))},t.Cb=function(t){var e=this;return _f(this,this.I().then((function(n){return e.a.Cb(n,t)})).then((function(t){return ff(e,t),e.reload()})))},t.Db=function(t){if(void 0===t.displayName&&void 0===t.photoURL)return of(this);var e=this;return _f(this,this.I().then((function(n){return e.a.Db(n,{displayName:t.displayName,photoUrl:t.photoURL})}
359)).then((function(t){return ff(e,t),cf(e,"displayName",t.displayName||null),cf(e,"photoURL",t.photoUrl||null),z(e.providerData,(function(t){"password"===t.providerId&&(Ei(t,"displayName",e.displayName),Ei(t,"photoURL",e.photoURL))})),tf(e)})).then(rf))},t.cd=function(t){var e=this;return _f(this,lf(this).then((function(n){return Z(af(e),t)?uu(e.a,n,[t]).then((function(t){var n={};return z(t.providerUserInfo||[],(function(t){n[t.providerId]=!0})),z(af(e),(function(t){n[t]||uf(e,t)})),n[va.PROVIDER_ID]||Ei(e,"phoneNumber",null),tf(e)})):tf(e).then((function(){throw new C("no-such-provider")}))})))},t.delete=function(){var t=this;return _f(this,this.I().then((function(e){return Xu(t.a,wu,{idToken:e})})).then((function(){t.dispatchEvent(new Nl("userDeleted"))}))).then((function(){for(var e=0;e<t.J.length;e++)t.J[e].cancel("app-deleted");Kl(t,null),Gl(t,null),zl(t,null),t.J=[],t.D=!0,Jl(t),Ei(t,"refreshToken",null),t.i&&Wh(t.i,t)}))},t.Fb=function(t,e){return!!("linkViaPopup"==t&&(this.g||null)==e&&this.f||"reauthViaPopup"==t&&(this.g||null)==e&&this.f||"linkViaRedirect"==t&&(this.ga||null)==e||"reauthViaRedirect"==t&&(this.ga||null)==e)},t.na=function(t,e,n,r){"linkViaPopup"!=t&&"reauthViaPopup"!=t||r!=(this.g||null)||(n&&this.C?this.C(n):e&&!n&&this.f&&this.f(e),this.c&&(this.c.cancel(),this.c=null),delete this.f,delete this.C)},t.Fa=function(t,e){return"linkViaPopup"==t&&e==(this.g||null)?T(this.Kb,this):"reauthViaPopup"==t&&e==(this.g||null)?T(this.Lb,this):"linkViaRedirect"==t&&(this.ga||null)==e?T(this.Kb,this):"reauthViaRedirect"==t&&(this.ga||null)==e?T(this.Lb,this):null},t.Ec=function(t){var e=this;return yf(this,"linkViaPopup",t,(function(){return vf(e,t.providerId).then((function(){return tf(e)}))}),!1)},t.Nc=function(t){return yf(this,"reauthViaPopup",t,(function(){return He()}),!0)},t.Fc=function(t){var e=this;return bf(this,"linkViaRedirect",t,(function(){return vf(e,t.providerId)}),!1)},t.Oc=function(t){return bf(this,"reauthViaRedirect",t,(function(){return He()}),!0)},t.Kb=function(t,e,n,r){var i=this;this.c&&(this.c.cancel(),this.c=null);var o=null;return n=this.I().then((function(n){return pu(i.a,{requestUri:t,postBody:r,sessionId:e,idToken:n})})).then((function(t){return o=gf(i,t,"link"),mf(i,t)})).then((function(){return o})),_f(this,n)},t.Lb=function(t,e,n,r){var i=this;this.c&&(this.c.cancel(),this.c=null);var o=null,a=He().then((function(){return Bo(du(i.a,{requestUri:t,sessionId:e,postBody:r,tenantId:n}),i.uid)})).then((function(t){return o=gf(i,t,"reauthenticate"),ff(i,t),i.h=null,i.reload()})).then((function(){return o}));return _f(this,a,!0)},t.ub=function(t){var e=this,n=null;return _f(this,this.I().then((function(e){return n=e,"undefined"===typeof t||bt(t)?{}:go(new oo(t))})).then((function(t){return e.a.ub(n,t)})).then((function(t){if(e.email!=t)return e.reload()})).then((function(){})))},t.Eb=function(t,e){var n=this,r=null;return _f(this,this.I().then((function(t){return r=t,"undefined"===typeof e||bt(e)?{}:go(new oo(e))})).then((function(e){return n.a.Eb(r,t,e)})).then((function(t){if(n.email!=t)return n.reload()})).then((function(){})))},t.jc=function(t){var e=null,n=this;return t=Bo(He(t),n.uid).then((function(t){return e=gf(n,t,"reauthenticate"),ff(n,t),n.h=null,n.reload()})).then((function(){return e})),_f(this,t,!0)},t.toJSON=function(){return this.w()},t.w=function(){var t={uid:this.uid,displayName:this.displayName,photoURL:this.photoURL,email:this.email,emailVerified:this.emailVerified,phoneNumber:this.phoneNumber,isAnonymous:this.isAnonymous,tenantId:this.tenantId,providerData:[],apiKey:this.l,appName:this.m,authDomain:this.s,stsTokenManager:this.b.w(),redirectEventId:this.ga||null};return this.metadata&&It(t,this.metadata.w()),z(this.providerData,(function(e){t.providerData.push(Ai(e))})),It(t,this.O.w()),t};var kf={name:"redirectUser",F:"session"};function Nf(t){return ch(t.b,kf,t.a)}function Cf(t,e){return t.b.get(kf,t.a).then((function(t){return t&&e&&(t.authDomain=e),Ef(t||{})}))}function Rf(t){this.a=t,this.b=oh(),this.c=null,this.f=Df(this),this.b.addListener(Lf("local"),this.a,T(this.g,this))}function Of(t,e){var n,r=[];for(n in nh)nh[n]!==e&&r.push(ch(t.b,Lf(nh[n]),t.a));return r.push(ch(t.b,Pf,t.a)),Be(r)}function Df(t){var e=Lf("local"),n=Lf("session"),r=Lf("none");return uh(t.b,e,t.a).then((function(){return t.b.get(n,t.a)})).then((function(i){return i?n:t.b.get(r,t.a).then((function(n){return n?r:t.b.get(e,t.a).then((function(n){return n?e:t.b.get(Pf,t.a).then((function(t){return t?Lf(t):e}))}))}))})).then((function(e){return t.c=e,Of(t,e.F)})).o((function(){t.c||(t.c=e)}))}Rf.prototype.g=function(){var t=this,e=Lf("local");Vf(this,(function(){return He().then((function(){return t.c&&"local"!=t.c.F?t.b.get(e,t.a):null})).then((function(n){if(n)return Of(t,"local").then((function(){t.c=e}))}))}))};var Pf={name:"persistence",F:"session"};function Lf(t){return{name:"authUser",F:t}}function xf(t){return Vf(t,(function(){return t.b.set(Pf,t.c.F,t.a)}))}function Mf(t,e){return Vf(t,(function(){return t.b.set(t.c,e.w(),t.a)}))}function Uf(t){return Vf(t,(function(){return ch(t.b,t.c,t.a)}))}function Ff(t,e,n){return Vf(t,(function(){return t.b.get(t.c,t.a).then((function(t){return t&&e&&(t.authDomain=e),t&&n&&(t.emulatorConfig=n),Ef(t||{})}))}))}function Vf(t,e){return t.f=t.f.then(e,e),t.f}function Hf(t){if(this.l=!1,Ei(this,"settings",new dl),Ei(this,"app",t),!ep(this).options||!ep(this).options.apiKey)throw new C("invalid-api-key");t=r.A.SDK_VERSION?$r(r.A.SDK_VERSION):null,this.a=new Ls(ep(this).options&&ep(this).options.apiKey,x(O),t),this.R=[],this.s=[],this.O=[],this.hb=r.A.INTERNAL.createSubscribe(T(this.zc,this)),this.X=void 0,this.bc=r.A.INTERNAL.createSubscribe(T(this.Ac,this)),Qf(this,null),this.i=new Rf(ep(this).options.apiKey+":"+ep(this).name),this.D=new Af(ep(this).options.apiKey+":"+ep(this).name),this.$=ap(this,$f(this)),this.h=ap(this,Zf(this)),this.ba=!1,this.ja=T(this.Zc,this),this.Ba=T(this.da,this),this.ya=T(this.mc,this),this.za=T(this.wc,this),this.Aa=T(this.xc,this),this.b=null,zf(this),this.INTERNAL={},this.INTERNAL["delete"]=T(this.delete,this),this.INTERNAL.logFramework=T(this.Gc,this),this.u=0,Fn.call(this),Gf(this),this.J=[],this.P=null}function jf(t){pn.call(this,"languageCodeChanged"),this.h=t}function qf(t){pn.call(this,"emulatorConfigChanged"),this.c=t}function Bf(t){pn.call(this,"frameworkChanged"),this.f=t}function Kf(t){"undefined"!==typeof console&&"function"===typeof console.info&&console.info("WARNING: You are using the Auth Emulator, which is intended for local testing only. Do not use with production credentials."),h.document&&!t&&Hr().then((function(){var t=h.document.createElement("div");t.innerText="Running in emulator mode. Do not use with production credentials.",t.style.position="fixed",t.style.width="100%",t.style.backgroundColor="#ffffff",t.style.border=".1em solid #000000",t.style.color="#ff0000",t.style.bottom="0px",t.style.left="0px",t.style.margin="0px",t.style.zIndex=1e4,t.style.textAlign="center",t.classList.add("firebase-emulator-warning"),h.document.body.appendChild(t)}))}function Gf(t){Object.defineProperty(t,"lc",{get:function(){return this.la()},set:function(t){this.wa(t)},enumerable:!1}),t.aa=null,Object.defineProperty(t,"ti",{get:function(){return this.T()},set:function(t){this.yb(t)},enumerable:!1}),t.S=null,Object.defineProperty(t,"emulatorConfig",{get:function(){if(this.P){var t=ir(this.P.url);t=Si({protocol:t.c,host:t.a,port:t.g,options:Si({disableWarnings:this.P.ec})})}else t=null;return t},enumerable:!1})}function Yf(t){return t.Oa||je(new C("auth-domain-config-required"))}function zf(t){var e=ep(t).options.authDomain,n=ep(t).options.apiKey;e&&ni()&&(t.Oa=t.$.then((function(){if(!t.l){if(t.b=rl(e,n,ep(t).name,t.P),zh(t.b,t),np(t)&&ef(np(t)),t.m){ef(t.m);var r=t.m;r.wa(t.la()),Kl(r,t),r=t.m,Yl(r,t.J),zl(r,t),r=t.m,qs(r.a,t.P),Gl(r,t),t.m=null}return t.b}})))}function Wf(t){if(!ni())return je(new C("operation-not-supported-in-this-environment"));var e=Yf(t).then((function(){return t.b.qa()})).then((function(t){return t?Si(t):null}));return ap(t,e)}function Xf(t,e){var n={};return n.apiKey=ep(t).options.apiKey,n.authDomain=ep(t).options.authDomain,n.appName=ep(t).name,t.P&&(n.emulatorConfig=t.P),t.$.then((function(){return Tf(n,e,t.D,t.Ga())})).then((function(e){return np(t)&&e.uid==np(t).uid?(hf(np(t),e),t.da(e)):(Qf(t,e),ef(e),t.da(e))})).then((function(){ip(t)}))}function Qf(t,e){np(t)&&(Zl(np(t),t.Ba),Cn(np(t),"tokenChanged",t.ya),
359Cn(np(t),"userDeleted",t.za),Cn(np(t),"userInvalidated",t.Aa),Jl(np(t))),e&&(e.S.push(t.Ba),Sn(e,"tokenChanged",t.ya),Sn(e,"userDeleted",t.za),Sn(e,"userInvalidated",t.Aa),0<t.u&&Ql(e)),Ei(t,"currentUser",e),e&&(e.wa(t.la()),Kl(e,t),Yl(e,t.J),zl(e,t),qs(e.a,t.P),Gl(e,t))}function Jf(t){var e=Cf(t.D,ep(t).options.authDomain).then((function(e){return(t.m=e)&&(e.ha=t.D),Nf(t.D)}));return ap(t,e)}function $f(t){var e=ep(t).options.authDomain,n=Jf(t).then((function(){return Ff(t.i,e,t.P)})).then((function(e){return e?(e.ha=t.D,t.m&&(t.m.ga||null)==(e.ga||null)?e:e.reload().then((function(){return Mf(t.i,e).then((function(){return e}))})).o((function(n){return"auth/network-request-failed"==n.code?e:Uf(t.i)}))):null})).then((function(e){Qf(t,e||null)}));return ap(t,n)}function Zf(t){return t.$.then((function(){return Wf(t)})).o((function(){})).then((function(){if(!t.l)return t.ja()})).o((function(){})).then((function(){if(!t.l){t.ba=!0;var e=t.i;e.b.addListener(Lf("local"),e.a,t.ja)}}))}function tp(t,e){var n=null,r=null;return ap(t,e.then((function(e){return n=ma(e),r=Co(e),Xf(t,e)}),(function(e){var n=null;throw e&&"auth/multi-factor-auth-required"===e.code&&(n=Il(e.w(),t,T(t.kc,t))),n||e})).then((function(){return Si({user:np(t),credential:n,additionalUserInfo:r,operationType:"signIn"})})))}function ep(t){return t.app}function np(t){return t.currentUser}function rp(t){return np(t)&&np(t)._lat||null}function ip(t){if(t.ba){for(var e=0;e<t.s.length;e++)t.s[e]&&t.s[e](rp(t));if(t.X!==t.getUid()&&t.O.length)for(t.X=t.getUid(),e=0;e<t.O.length;e++)t.O[e]&&t.O[e](rp(t))}}function op(t,e){t.O.push(e),ap(t,t.h.then((function(){!t.l&&Z(t.O,e)&&t.X!==t.getUid()&&(t.X=t.getUid(),e(rp(t)))})))}function ap(t,e){return t.R.push(e),e.oa((function(){tt(t.R,e)})),e}function sp(){}function up(){this.a={},this.b=1e12}Rf.prototype.xb=function(t){var e=null,n=this;return rh(t),Vf(this,(function(){return t!=n.c.F?n.b.get(n.c,n.a).then((function(r){return e=r,Of(n,t)})).then((function(){if(n.c=Lf(t),e)return n.b.set(n.c,e,n.a)})):He()}))},k(Hf,Fn),k(jf,pn),k(qf,pn),k(Bf,pn),t=Hf.prototype,t.xb=function(t){return t=this.i.xb(t),ap(this,t)},t.wa=function(t){this.aa===t||this.l||(this.aa=t,js(this.a,this.aa),this.dispatchEvent(new jf(this.la())))},t.la=function(){return this.aa},t.fd=function(){var t=h.navigator;this.wa(t&&(t.languages&&t.languages[0]||t.language||t.userLanguage)||null)},t.gd=function(t,e){if(!this.P){if(!/^https?:\/\//.test(t))throw new C("argument-error","Emulator URL must start with a valid scheme (http:// or https://).");e=!!e&&!!e.disableWarnings,Kf(e),this.P={url:t,ec:e},this.settings.ib=!0,qs(this.a,this.P),this.dispatchEvent(new qf(this.P))}},t.Gc=function(t){this.J.push(t),Ks(this.a,r.A.SDK_VERSION?$r(r.A.SDK_VERSION,this.J):null),this.dispatchEvent(new Bf(this.J))},t.Ga=function(){return rt(this.J)},t.yb=function(t){this.S===t||this.l||(this.S=t,this.a.b=this.S)},t.T=function(){return this.S},t.toJSON=function(){return{apiKey:ep(this).options.apiKey,authDomain:ep(this).options.authDomain,appName:ep(this).name,currentUser:np(this)&&np(this).w()}},t.Fb=function(t,e){switch(t){case"unknown":case"signInViaRedirect":return!0;case"signInViaPopup":return this.g==e&&!!this.f;default:return!1}},t.na=function(t,e,n,r){"signInViaPopup"==t&&this.g==r&&(n&&this.C?this.C(n):e&&!n&&this.f&&this.f(e),this.c&&(this.c.cancel(),this.c=null),delete this.f,delete this.C)},t.Fa=function(t,e){return"signInViaRedirect"==t||"signInViaPopup"==t&&this.g==e&&this.f?T(this.ic,this):null},t.ic=function(t,e,n,r){var i=this,o={requestUri:t,postBody:r,sessionId:e,tenantId:n};return this.c&&(this.c.cancel(),this.c=null),i.$.then((function(){return tp(i,fu(i.a,o))}))},t.Xc=function(t){if(!ni())return je(new C("operation-not-supported-in-this-environment"));var e=this,n=No(t.providerId),i=ci(),o=null;(!oi()||Br())&&ep(this).options.authDomain&&t.isOAuthProvider&&(o=dc(ep(this).options.authDomain,ep(this).options.apiKey,ep(this).name,"signInViaPopup",t,null,i,r.A.SDK_VERSION||null,null,null,this.T(),this.P));var a=Mr(o,n&&n.ua,n&&n.ta);return n=Yf(this).then((function(n){return Jh(n,a,"signInViaPopup",t,i,!!o,e.T())})).then((function(){return new Pe((function(t,n){e.na("signInViaPopup",null,new C("cancelled-popup-request"),e.g),e.f=t,e.C=n,e.g=i,e.c=tl(e.b,e,"signInViaPopup",a,i)}))})).then((function(t){return a&&xr(a),t?Si(t):null})).o((function(t){throw a&&xr(a),t})),ap(this,n)},t.Yc=function(t){if(!ni())return je(new C("operation-not-supported-in-this-environment"));var e=this,n=Yf(this).then((function(){return xf(e.i)})).then((function(){return Zh(e.b,"signInViaRedirect",t,void 0,e.T())}));return ap(this,n)},t.qa=function(){var t=this;return Wf(this).then((function(e){return t.b&&al(t.b.b),e})).o((function(e){throw t.b&&al(t.b.b),e}))},t.dd=function(t){if(!t)return je(new C("null-user"));if(this.S!=t.tenantId)return je(new C("tenant-id-mismatch"));var e=this,n={};n.apiKey=ep(this).options.apiKey,n.authDomain=ep(this).options.authDomain,n.appName=ep(this).name;var r=Sf(t,n,e.D,e.Ga());return ap(this,this.h.then((function(){if(ep(e).options.apiKey!=t.l)return r.reload()})).then((function(){return np(e)&&t.uid==np(e).uid?(hf(np(e),t),e.da(t)):(Qf(e,r),ef(r),e.da(r))})).then((function(){ip(e)})))},t.Ab=function(){var t=this,e=this.h.then((function(){return t.b&&al(t.b.b),np(t)?(Qf(t,null),Uf(t.i).then((function(){ip(t)}))):He()}));return ap(this,e)},t.Zc=function(){var t=this;return Ff(this.i,ep(this).options.authDomain).then((function(e){if(!t.l){var n;if(n=np(t)&&e){n=np(t).uid;var r=e.uid;n=void 0!==n&&null!==n&&""!==n&&void 0!==r&&null!==r&&""!==r&&n==r}if(n)return hf(np(t),e),np(t).I();(np(t)||e)&&(Qf(t,e),e&&(ef(e),e.ha=t.D),t.b&&zh(t.b,t),ip(t))}}))},t.da=function(t){return Mf(this.i,t)},t.mc=function(){ip(this),this.da(np(this))},t.wc=function(){this.Ab()},t.xc=function(){this.Ab()},t.kc=function(t){var e=this;return this.h.then((function(){return tp(e,He(t))}))},t.zc=function(t){var e=this;this.addAuthTokenListener((function(){t.next(np(e))}))},t.Ac=function(t){var e=this;op(this,(function(){t.next(np(e))}))},t.Ic=function(t,e,n){var r=this;return this.ba&&Promise.resolve().then((function(){"function"===typeof t?t(np(r)):"function"===typeof t.next&&t.next(np(r))})),this.hb(t,e,n)},t.Hc=function(t,e,n){var r=this;return this.ba&&Promise.resolve().then((function(){r.X=r.getUid(),"function"===typeof t?t(np(r)):"function"===typeof t.next&&t.next(np(r))})),this.bc(t,e,n)},t.nc=function(t){var e=this,n=this.h.then((function(){return np(e)?np(e).I(t).then((function(t){return{accessToken:t}})):null}));return ap(this,n)},t.Tc=function(t){var e=this;return this.h.then((function(){return tp(e,Xu(e.a,Bu,{token:t}))})).then((function(t){var n=t.user;return cf(n,"isAnonymous",!1),e.da(n),t}))},t.Uc=function(t,e){var n=this;return this.h.then((function(){return tp(n,Xu(n.a,Ku,{email:t,password:e}))}))},t.dc=function(t,e){var n=this;return this.h.then((function(){return tp(n,Xu(n.a,yu,{email:t,password:e}))}))},t.$a=function(t){var e=this;return this.h.then((function(){return tp(e,t.ka(e.a))}))},t.Sc=function(t){return _i("firebase.auth.Auth.prototype.signInAndRetrieveDataWithCredential is deprecated. Please use firebase.auth.Auth.prototype.signInWithCredential instead."),this.$a(t)},t.zb=function(){var t=this;return this.h.then((function(){var e=np(t);if(e&&e.isAnonymous){var n=Si({providerId:null,isNewUser:!1});return Si({user:e,credential:null,additionalUserInfo:n,operationType:"signIn"})}return tp(t,t.a.zb()).then((function(e){var n=e.user;return cf(n,"isAnonymous",!0),t.da(n),e}))}))},t.getUid=function(){return np(this)&&np(this).uid||null},t.cc=function(t){this.addAuthTokenListener(t),this.u++,0<this.u&&np(this)&&Ql(np(this))},t.Pc=function(t){var e=this;z(this.s,(function(n){n==t&&e.u--})),0>this.u&&(this.u=0),0==this.u&&np(this)&&Jl(np(this)),this.removeAuthTokenListener(t)},t.addAuthTokenListener=function(t){var e=this;this.s.push(t),ap(this,this.h.then((function(){e.l||Z(e.s,t)&&t(rp(e))})))},t.removeAuthTokenListener=function(t){et(this.s,(function(e){return e==t}))},t.delete=function(){this.l=!0;for(var t=0;t<this.R.length;t++)this.R[t].cancel("app-deleted");return this.R=[],this.i&&(t=this.i,t.b.removeListener(Lf("local"),t.a,this.ja)),this.b&&(Wh(this.b,this),al(this.b.b)),Promise.resolve()},t.hc=function(t){return ap(this,Zs(this.a,t))},t.Bc=function(t){return!!la(t)},t.wb=function(t,e){var n=this;return ap(this,He().then((function(){var t=new oo(e);if(!t.c)throw new C("argument-error",uo+" must be true when sending sign in link to email");return go(t)})).then((function(e){return n.a.wb(t,e)})).then((function(){})))},t.jd=function(t){return this.Ra(t).then((function(t){return t.data.email}))},t.nb=function(t,e){return ap(this,this.a.nb(t,e).then((function(){})))},t.Ra=function(t){return ap(this,this.a.Ra(t).then((function(t){return new Mi(t)})))},t.jb=function(t){return ap(this,this.a.jb(t).then((function(){})))},t.vb=function(t,e){var n=this;return ap(this,He().then((function(){return"undefined"===typeof e||bt(e)?{}:go(new oo(e))})).then((function(e){return n.a.vb(t,e)})).then((function(){})))},t.Wc=function(t,e){return ap(this,gl(this,t,e,T(this.$a,this)))},t.Vc=function(t,e){var n=this;return ap(this,He().then((function(){var r=e||Rr(),i=ha(t,r);if(r=la(r),!r)throw new C("argument-error","Invalid email link!");if(r.tenantId!==n.T())throw new C("tenant-id-mismatch");return n.$a(i)})))},sp.prototype.render=function(){},sp.prototype.reset=function(){},sp.prototype.getResponse=function(){},sp.prototype.execute=function(){};var cp=null;function hp(t,e){return(e=lp(e))&&t.a[e]||null}function lp(t){return(t="undefined"===typeof t?1e12:t)?t.toString():null}function fp(t,e){this.g=!1,this.c=e,this.a=this.b=null,this.h="invisible"!==this.c.size,this.f=ye(t);var n=this;this.i=function(){n.execute()},this.h?this.execute():Sn(this.f,"click",this.i)}function pp(t){if(t.g)throw Error("reCAPTCHA mock was already deleted!")}function dp(){}function vp(){}up.prototype.render=function(t,e){return this.a[this.b.toString()]=new fp(t,e),this.b++},up.prototype.reset=function(t){var e=hp(this,t);t=lp(t),e&&t&&(e.delete(),delete this.a[t])},up.prototype.getResponse=function(t){return(t=hp(this,t))?t.getResponse():null},up.prototype.execute=function(t){(t=hp(this,t))&&t.execute()},fp.prototype.getResponse=function(){return pp(this),this.b},fp.prototype.execute=function(){pp(this);var t=this;this.a||(this.a=setTimeout((function(){t.b=zr();var e=t.c.callback,n=t.c["expired-callback"];if(e)try{e(t.b)}catch(r){}t.a=setTimeout((function(){if(t.a=null,t.b=null,n)try{n()}catch(r){}t.h&&t.execute()}),6e4)}),500))},fp.prototype.delete=function(){pp(this),this.g=!0,clearTimeout(this.a),this.a=null,Cn(this.f,"click",this.i)},Ei(dp,"FACTOR_ID","phone"),vp.prototype.g=function(){return cp||(cp=new up),He(cp)},vp.prototype.c=function(){};var gp=null;function mp(){this.b=h.grecaptcha?1/0:0,this.f=null,this.a="__rcb"+Math.floor(1e6*Math.random()).toString()}var yp=new Tt(Nt,"https://www.google.com/recaptcha/api.js?onload=%{onload}&render=explicit&hl=%{hl}"),bp=new fi(3e4,6e4);mp.prototype.g=function(t){var e=this;return new Pe((function(n,r){var i=setTimeout((function(){r(new C("network-request-failed"))}),bp.get());if(!h.grecaptcha||t!==e.f&&!e.b){h[e.a]=function(){if(h.grecaptcha){e.f=t;var o=h.grecaptcha.render;h.grecaptcha.render=function(t,n){return t=o(t,n),e.b++,t},clearTimeout(i),n(h.grecaptcha)}else clearTimeout(i),r(new C("internal-error"));delete h[e.a]};var o=Dt(yp,{onload:e.a,hl:t||""});He(As(o)).o((function(){clearTimeout(i),r(new C("internal-error","Unable to load external reCAPTCHA dependencies!"))}))}else clearTimeout(i),n(h.grecaptcha)}))},mp.prototype.c=function(){this.b--};var wp=null;function _p(t,e,n,r,i,o,a){if(Ei(this,"type","recaptcha"),this.c=this.f=null,this.D=!1,this.v=e,this.g=null,a?(gp||(gp=new vp),a=gp):(wp||(wp=new mp),a=wp),this.m=a,this.a=n||{theme:"light",type:"image"},this.h=[],this.a[Tp])throw new C("argument-error","sitekey should not be provided for reCAPTCHA as one is automatically provisioned for the current project.");if(this.i="invisible"===this.a[Sp],!h.document)throw new C("operation-not-supported-in-this-environment","RecaptchaVerifier is only supported in a browser HTTP/HTTPS environment with DOM support.");if(!ye(e)||!this.i&&ye(e).hasChildNodes())throw new C("argument-error","reCAPTCHA container is either not found or already contains inner elements!");this.s=new Ls(t,o||null,i||null),this.u=r||function(){return null};var s=this;this.l=[];var u=this.a[Ip];this.a[Ip]=function(t){if(Ap(s,t),"function"===typeof u)u(t);else if("string"===typeof u){var e=ti(u,h);"function"===typeof e&&e(t)}};var c=this.a[Ep];this.a[Ep]=function(){if(Ap(s,null),"function"===typeof c)c();else if("string"===typeof c){var t=ti(c,h);"function"===typeof t&&t()}}}var Ip="callback",Ep="expired-callback",Tp="sitekey",Sp="size";function Ap(t,e){for(var n=0;n<t.l.length;n++)try{t.l[n](e)}catch(r){}}function kp(t,e){et(t.l,(function(t){return t==e}))}function Np(t,e){return t.h.push(e),e.oa((function(){tt(t.h,e)})),e}function Cp(t){if(t.D)throw new C("internal-error","RecaptchaVerifier instance has been destroyed.")}function Rp(t,e,n){var i=!1;try{this.b=n||r.A.app()}catch(s){throw new C("argument-error","No firebase.app.App instance is currently initialized.")}if(!this.b.options||!this.b.options.apiKey)throw new C("invalid-api-key");n=this.b.options.apiKey;var o=this,a=null;try{a=this.b.auth().Ga()}catch(s){}try{i=this.b.auth().settings.appVerificationDisabledForTesting}catch(s){}
359a=r.A.SDK_VERSION?$r(r.A.SDK_VERSION,a):null,_p.call(this,n,t,e,(function(){try{var t=o.b.auth().la()}catch(e){t=null}return t}),a,x(O),i)}function Op(t,e,n,r){t:{n=Array.prototype.slice.call(n);for(var i=0,o=!1,a=0;a<e.length;a++)if(e[a].optional)o=!0;else{if(o)throw new C("internal-error","Argument validator encountered a required argument after an optional argument.");i++}if(o=e.length,n.length<i||o<n.length)r="Expected "+(i==o?1==i?"1 argument":i+" arguments":i+"-"+o+" arguments")+" but got "+n.length+".";else{for(i=0;i<n.length;i++)if(o=e[i].optional&&void 0===n[i],!e[i].M(n[i])&&!o){if(e=e[i],0>i||i>=Dp.length)throw new C("internal-error","Argument validator received an unsupported number of arguments.");n=Dp[i],r=(r?"":n+" argument ")+(e.name?'"'+e.name+'" ':"")+"must be "+e.K+".";break t}r=null}}if(r)throw new C("argument-error",t+" failed: "+r)}t=_p.prototype,t.Ia=function(){var t=this;return this.f?this.f:this.f=Np(this,He().then((function(){if(ri()&&!Kr())return Hr();throw new C("operation-not-supported-in-this-environment","RecaptchaVerifier is only supported in a browser HTTP/HTTPS environment.")})).then((function(){return t.m.g(t.u())})).then((function(e){return t.g=e,Xu(t.s,Du,{})})).then((function(e){t.a[Tp]=e.recaptchaSiteKey})).o((function(e){throw t.f=null,e})))},t.render=function(){Cp(this);var t=this;return Np(this,this.Ia().then((function(){if(null===t.c){var e=t.v;if(!t.i){var n=ye(e);e=Ee("DIV"),n.appendChild(e)}t.c=t.g.render(e,t.a)}return t.c})))},t.verify=function(){Cp(this);var t=this;return Np(this,this.render().then((function(e){return new Pe((function(n){var r=t.g.getResponse(e);if(r)n(r);else{var i=function(e){e&&(kp(t,i),n(e))};t.l.push(i),t.i&&t.g.execute(t.c)}}))})))},t.reset=function(){Cp(this),null!==this.c&&this.g.reset(this.c)},t.clear=function(){Cp(this),this.D=!0,this.m.c();for(var t=0;t<this.h.length;t++)this.h[t].cancel("RecaptchaVerifier instance has been destroyed.");if(!this.i){t=ye(this.v);for(var e;e=t.firstChild;)t.removeChild(e)}},k(Rp,_p);var Dp="First Second Third Fourth Fifth Sixth Seventh Eighth Ninth".split(" ");function Pp(t,e){return{name:t||"",K:"a valid string",optional:!!e,M:function(t){return"string"===typeof t}}}function Lp(t,e){return{name:t||"",K:"a boolean",optional:!!e,M:function(t){return"boolean"===typeof t}}}function xp(t,e){return{name:t||"",K:"a valid object",optional:!!e,M:y}}function Mp(t,e){return{name:t||"",K:"a function",optional:!!e,M:function(t){return"function"===typeof t}}}function Up(t,e){return{name:t||"",K:"null",optional:!!e,M:function(t){return null===t}}}function Fp(){return{name:"",K:"an HTML element",optional:!1,M:function(t){return!!(t&&t instanceof Element)}}}function Vp(){return{name:"auth",K:"an instance of Firebase Auth",optional:!0,M:function(t){return!!(t&&t instanceof Hf)}}}function Hp(){return{name:"app",K:"an instance of Firebase App",optional:!0,M:function(t){return!!(t&&t instanceof r.A.app.App)}}}function jp(t){return{name:t?t+"Credential":"credential",K:t?"a valid "+t+" credential":"a valid credential",optional:!1,M:function(e){if(!e)return!1;var n=!t||e.providerId===t;return!(!e.ka||!n)}}}function qp(){return{name:"multiFactorAssertion",K:"a valid multiFactorAssertion",optional:!1,M:function(t){return!!t&&!!t.sb}}}function Bp(){return{name:"authProvider",K:"a valid Auth provider",optional:!1,M:function(t){return!!(t&&t.providerId&&t.hasOwnProperty&&t.hasOwnProperty("isOAuthProvider"))}}}function Kp(t,e){return y(t)&&"string"===typeof t.type&&t.type===e&&"function"===typeof t.Ha}function Gp(t){return y(t)&&"string"===typeof t.uid}function Yp(){return{name:"applicationVerifier",K:"an implementation of firebase.auth.ApplicationVerifier",optional:!1,M:function(t){return!(!t||"string"!==typeof t.type||"function"!==typeof t.verify)}}}function zp(t,e,n,r){return{name:n||"",K:t.K+" or "+e.K,optional:!!r,M:function(n){return t.M(n)||e.M(n)}}}function Wp(t,e){for(var n in e){var r=e[n].name;t[r]=Jp(r,t[n],e[n].j)}}function Xp(t,e){for(var n in e){var r=e[n].name;r!==n&&Object.defineProperty(t,r,{get:S((function(t){return this[t]}
359),n),set:S((function(t,e,n,r){Op(t,[n],[r],!0),this[e]=r}),r,n,e[n].kb),enumerable:!0})}}function Qp(t,e,n,r){t[e]=Jp(e,n,r)}function Jp(t,e,n){function r(){var t=Array.prototype.slice.call(arguments);return Op(o,n,t),e.apply(this,t)}if(!n)return e;var i,o=$p(t);for(i in e)r[i]=e[i];for(i in e.prototype)r.prototype[i]=e.prototype[i];return r}function $p(t){return t=t.split("."),t[t.length-1]}Wp(Hf.prototype,{jb:{name:"applyActionCode",j:[Pp("code")]},Ra:{name:"checkActionCode",j:[Pp("code")]},nb:{name:"confirmPasswordReset",j:[Pp("code"),Pp("newPassword")]},dc:{name:"createUserWithEmailAndPassword",j:[Pp("email"),Pp("password")]},hc:{name:"fetchSignInMethodsForEmail",j:[Pp("email")]},qa:{name:"getRedirectResult",j:[]},Bc:{name:"isSignInWithEmailLink",j:[Pp("emailLink")]},Hc:{name:"onAuthStateChanged",j:[zp(xp(),Mp(),"nextOrObserver"),Mp("opt_error",!0),Mp("opt_completed",!0)]},Ic:{name:"onIdTokenChanged",j:[zp(xp(),Mp(),"nextOrObserver"),Mp("opt_error",!0),Mp("opt_completed",!0)]},vb:{name:"sendPasswordResetEmail",j:[Pp("email"),zp(xp("opt_actionCodeSettings",!0),Up(null,!0),"opt_actionCodeSettings",!0)]},wb:{name:"sendSignInLinkToEmail",j:[Pp("email"),xp("actionCodeSettings")]},xb:{name:"setPersistence",j:[Pp("persistence")]},Sc:{name:"signInAndRetrieveDataWithCredential",j:[jp()]},zb:{name:"signInAnonymously",j:[]},$a:{name:"signInWithCredential",j:[jp()]},Tc:{name:"signInWithCustomToken",j:[Pp("token")]},Uc:{name:"signInWithEmailAndPassword",j:[Pp("email"),Pp("password")]},Vc:{name:"signInWithEmailLink",j:[Pp("email"),Pp("emailLink",!0)]},Wc:{name:"signInWithPhoneNumber",j:[Pp("phoneNumber"),Yp()]},Xc:{name:"signInWithPopup",j:[Bp()]},Yc:{name:"signInWithRedirect",j:[Bp()]},dd:{name:"updateCurrentUser",j:[zp(function(t){return{name:"user",K:"an instance of Firebase User",optional:!!t,M:function(t){return!!(t&&t instanceof Bl)}}}(),Up(),"user")]},Ab:{name:"signOut",j:[]},toJSON:{name:"toJSON",j:[Pp(null,!0)]},fd:{name:"useDeviceLanguage",j:[]},gd:{name:"useEmulator",j:[Pp("url"),xp("options",!0)]},jd:{name:"verifyPasswordResetCode",j:[Pp("code")]}}),Xp(Hf.prototype,{lc:{name:"languageCode",kb:zp(Pp(),Up(),"languageCode")},ti:{name:"tenantId",kb:zp(Pp(),Up(),"tenantId")}}),Hf.Persistence=nh,Hf.Persistence.LOCAL="local",Hf.Persistence.SESSION="session",Hf.Persistence.NONE="none",Wp(Bl.prototype,{delete:{name:"delete",j:[]},oc:{name:"getIdTokenResult",j:[Lp("opt_forceRefresh",!0)]},I:{name:"getIdToken",j:[Lp("opt_forceRefresh",!0)]},Cc:{name:"linkAndRetrieveDataWithCredential",j:[jp()]},qb:{name:"linkWithCredential",j:[jp()]},Dc:{name:"linkWithPhoneNumber",j:[Pp("phoneNumber"),Yp()]},Ec:{name:"linkWithPopup",j:[Bp()]},Fc:{name:"linkWithRedirect",j:[Bp()]},Lc:{name:"reauthenticateAndRetrieveDataWithCredential",j:[jp()]},tb:{name:"reauthenticateWithCredential",j:[jp()]},Mc:{name:"reauthenticateWithPhoneNumber",j:[Pp("phoneNumber"),Yp()]},Nc:{name:"reauthenticateWithPopup",j:[Bp()]},Oc:{name:"reauthenticateWithRedirect",j:[Bp()]},reload:{name:"reload",j:[]},ub:{name:"sendEmailVerification",j:[zp(xp("opt_actionCodeSettings",!0),Up(null,!0),"opt_actionCodeSettings",!0)]},toJSON:{name:"toJSON",j:[Pp(null,!0)]},cd:{name:"unlink",j:[Pp("provider")]},Bb:{name:"updateEmail",j:[Pp("email")]},Cb:{name:"updatePassword",j:[Pp("password")]},ed:{name:"updatePhoneNumber",j:[jp("phone")]},Db:{name:"updateProfile",j:[xp("profile")]},Eb:{name:"verifyBeforeUpdateEmail",j:[Pp("email"),zp(xp("opt_actionCodeSettings",!0),Up(null,!0),"opt_actionCodeSettings",!0)]}}),Wp(up.prototype,{execute:{name:"execute"},render:{name:"render"},reset:{name:"reset"},getResponse:{name:"getResponse"}}),Wp(sp.prototype,{execute:{name:"execute"},render:{name:"render"},reset:{name:"reset"},getResponse:{name:"getResponse"}}),Wp(Pe.prototype,{oa:{name:"finally"},o:{name:"catch"},then:{name:"then"}}),Xp(dl.prototype,{appVerificationDisabled:{name:"appVerificationDisabledForTesting",kb:Lp("appVerificationDisabledForTesting")}}),Wp(vl.prototype,{confirm:{name:"confirm",j:[Pp("verificationCode")]}}),Qp(qo,"fromJSON",(function(t){t="string"===typeof t?JSON.parse(t):t;for(var e,n=[Xo,ua,pa,Yo],r=0;r<n.length;r++)if(e=n[r](t))return e;return null}),[zp(Pp(),xp(),"json")]),Qp(ca,"credential",(function(t,e){return new sa(t,e)}),[Pp("email"),Pp("password")]),Wp(sa.prototype,{w:{name:"toJSON",j:[Pp(null,!0)]}}),Wp(Zo.prototype,{Ca:{name:"addScope",j:[Pp("scope")]},Ka:{name:"setCustomParameters",j:[xp("customOAuthParameters")]}}),Qp(Zo,"credential",ta,[zp(Pp(),xp(),"token")]),Qp(ca,"credentialWithLink",ha,[Pp("email"),Pp("emailLink")]),Wp(ea.prototype,{Ca:{name:"addScope",j:[Pp("scope")]},Ka:{name:"setCustomParameters",j:[xp("customOAuthParameters")]}}),Qp(ea,"credential",na,[zp(Pp(),xp(),"token")]),Wp(ra.prototype,{Ca:{name:"addScope",j:[Pp("scope")]},Ka:{name:"setCustomParameters",j:[xp("customOAuthParameters")]}}),Qp(ra,"credential",ia,[zp(Pp(),zp(xp(),Up()),"idToken"),zp(Pp(),Up(),"accessToken",!0)]),Wp(oa.prototype,{Ka:{name:"setCustomParameters",j:[xp("customOAuthParameters")]}}),Qp(oa,"credential",aa,[zp(Pp(),xp(),"token"),Pp("secret",!0)]),Wp($o.prototype,{Ca:{name:"addScope",j:[Pp("scope")]},credential:{name:"credential",j:[zp(Pp(),zp(xp(),Up()),"optionsOrIdToken"),zp(Pp(),Up(),"accessToken",!0)]},Ka:{name:"setCustomParameters",j:[xp("customOAuthParameters")]}}),Wp(zo.prototype,{w:{name:"toJSON",j:[Pp(null,!0)]}}),Wp(Ko.prototype,{w:{name:"toJSON",j:[Pp(null,!0)]}}),Qp(va,"credential",ga,[Pp("verificationId"),Pp("verificationCode")]),Wp(va.prototype,{fb:{name:"verifyPhoneNumber",j:[zp(Pp(),function(t,e){return{name:t||"phoneInfoOptions",K:"valid phone info o
359ptions",optional:!!e,M:function(t){return!!t&&(t.session&&t.phoneNumber?Kp(t.session,Ho)&&"string"===typeof t.phoneNumber:t.session&&t.multiFactorHint?Kp(t.session,jo)&&Gp(t.multiFactorHint):t.session&&t.multiFactorUid?Kp(t.session,jo)&&"string"===typeof t.multiFactorUid:!!t.phoneNumber&&"string"===typeof t.phoneNumber)}}}(),"phoneInfoOptions"),Yp()]}}),Wp(fa.prototype,{w:{name:"toJSON",j:[Pp(null,!0)]}}),Wp(C.prototype,{toJSON:{name:"toJSON",j:[Pp(null,!0)]}}),Wp(Aa.prototype,{toJSON:{name:"toJSON",j:[Pp(null,!0)]}}),Wp(Sa.prototype,{toJSON:{name:"toJSON",j:[Pp(null,!0)]}}),Wp(_l.prototype,{toJSON:{name:"toJSON",j:[Pp(null,!0)]}}),Wp(yl.prototype,{Rc:{name:"resolveSignIn",j:[qp()]}}),Wp(Cl.prototype,{Rb:{name:"getSession",j:[]},fc:{name:"enroll",j:[qp(),Pp("displayName",!0)]},bd:{name:"unenroll",j:[zp({name:"multiFactorInfo",K:"a valid multiFactorInfo",optional:!1,M:Gp},Pp(),"multiFactorInfoIdentifier")]}}),Wp(Rp.prototype,{clear:{name:"clear",j:[]},render:{name:"render",j:[]},verify:{name:"verify",j:[]}}),Qp(Qi,"parseLink",io,[Pp("link")]),Qp(dp,"assertion",(function(t){return new kl(t)}),[jp("phone")]),function(){if("undefined"===typeof r.A||!r.A.INTERNAL||!r.A.INTERNAL.registerComponent)throw Error("Cannot find the firebase namespace; be sure to include firebase-app.js before this library.");var t={ActionCodeInfo:{Operation:{EMAIL_SIGNIN:Fi,PASSWORD_RESET:"PASSWORD_RESET",RECOVER_EMAIL:"RECOVER_EMAIL",REVERT_SECOND_FACTOR_ADDITION:Ui,VERIFY_AND_CHANGE_EMAIL:Vi,VERIFY_EMAIL:"VERIFY_EMAIL"}},Auth:Hf,AuthCredential:qo,Error:C};Qp(t,"EmailAuthProvider",ca,[]),Qp(t,"FacebookAuthProvider",Zo,[]),Qp(t,"GithubAuthProvider",ea,[]),Qp(t,"GoogleAuthProvider",ra,[]),Qp(t,"TwitterAuthProvider",oa,[]),Qp(t,"OAuthProvider",$o,[Pp("providerId")]),Qp(t,"SAMLAuthProvider",Jo,[Pp("providerId")]),Qp(t,"PhoneAuthProvider",va,[Vp()]),Qp(t,"RecaptchaVerifier",Rp,[zp(Pp(),Fp(),"recaptchaContainer"),xp("recaptchaParameters",!0),Hp()]),Qp(t,"ActionCodeURL",Qi,[]),Qp(t,"PhoneMultiFactorGenerator",dp,[]),r.A.INTERNAL.registerComponent({name:"auth",instanceFactory:function(t){return t=t.getProvider("app").getImmediate(),new Hf(t)},multipleInstances:!1,serviceProps:t,instantiationMode:"LAZY",type:"PUBLIC"}),r.A.INTERNAL.registerComponent({name:"auth-internal",instanceFactory:function(t){return t=t.getProvider("auth").getImmediate(),{getUid:T(t.getUid,t),getToken:T(t.nc,t),addAuthTokenListener:T(t.cc,t),removeAuthTokenListener:T(t.Pc,t)}},multipleInstances:!1,instantiationMode:"LAZY",type:"PRIVATE"}),r.A.registerVersion("@firebase/auth","0.16.5"),r.A.INTERNAL.extendNamespace({User:Bl})}()}).apply("undefined"!==typeof n.g?n.g:"undefined"!==typeof self?self:"undefined"!==typeof window?window:{})},39754:function(t,e,n){var r=n(49998),i=n(51625),o=n(32477),a=function(t,e){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},a(t,e)};function s(t,e){function n(){this.constructor=t}a(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function u(t){var e="function"===typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"===typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}var c,h="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window?window:"undefined"!==typeof n.g?n.g:"undefined"!==typeof self?self:{},l=l||{},f=h||self;function p(){}function d(t){var e=typeof t;return e="object"!=e?e:t?Array.isArray(t)?"array":e:"null","array"==e||"object"==e&&"number"==typeof t.length}function v(t){var e=typeof t;return"object"==e&&null!=t||"function"==e}function g(t){return Object.prototype.hasOwnProperty.call(t,m)&&t[m]||(t[m]=++y)}var m="closure_uid_"+(1e9*Math.random()>>>0),y=0;function b(t,e,n){return t.call.apply(t.bind,arguments)}function w(t,e,n){if(!t)throw Error();if(2<arguments.length){var r=Array.prototype.slice.call(arguments,2);return function(){var n=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(n,r),t.apply(e,n)}}return function(){return t.apply(e,arguments)}}function _(t,e,n){return _=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?b:w,_.a
359pply(null,arguments)}function I(t,e){var n=Array.prototype.slice.call(arguments,1);return function(){var e=n.slice();return e.push.apply(e,arguments),t.apply(this,e)}}function E(){return Date.now()}function T(t,e){function n(){}n.prototype=e.prototype,t.X=e.prototype,t.prototype=new n,t.prototype.constructor=t,t.Kb=function(t,n,r){for(var i=Array(arguments.length-2),o=2;o<arguments.length;o++)i[o-2]=arguments[o];return e.prototype[n].apply(t,i)}}function S(){this.j=this.j,this.i=this.i}var A=0;S.prototype.j=!1,S.prototype.ja=function(){if(!this.j&&(this.j=!0,this.G(),0!=A))g(this)},S.prototype.G=function(){if(this.i)for(;this.i.length;)this.i.shift()()};var k=Array.prototype.indexOf?function(t,e){return Array.prototype.indexOf.call(t,e,void 0)}:function(t,e){if("string"===typeof t)return"string"!==typeof e||1!=e.length?-1:t.indexOf(e,0);for(var n=0;n<t.length;n++)if(n in t&&t[n]===e)return n;return-1},N=Array.prototype.forEach?function(t,e,n){Array.prototype.forEach.call(t,e,n)}:function(t,e,n){for(var r=t.length,i="string"===typeof t?t.split(""):t,o=0;o<r;o++)o in i&&e.call(n,i[o],o,t)};function C(t){t:{for(var e=qn,n=t.length,r="string"===typeof t?t.split(""):t,i=0;i<n;i++)if(i in r&&e.call(void 0,r[i],i,t)){e=i;break t}e=-1}return 0>e?null:"string"===typeof t?t.charAt(e):t[e]}function R(t){return Array.prototype.concat.apply([],arguments)}function O(t){var e=t.length;if(0<e){for(var n=Array(e),r=0;r<e;r++)n[r]=t[r];return n}return[]}function D(t){return/^[\s\xa0]*$/.test(t)}var P,L=String.prototype.trim?function(t){return t.trim()}:function(t){return/^[\s\xa0]*([\s\S]*?)[\s\xa0]*$/.exec(t)[1]};function x(t,e){return-1!=t.indexOf(e)}function M(t,e){return t<e?-1:t>e?1:0}t:{var U=f.navigator;if(U){var F=U.userAgent;if(F){P=F;break t}}P=""}function V(t,e,n){for(var r in t)e.call(n,t[r],r,t)}function H(t){var e={};for(var n in t)e[n]=t[n];return e}var j="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function q(t,e){for(var n,r,i=1;i<arguments.length;i++){for(n in r=arguments[i],r)t[n]=r[n];for(var o=0;o<j.length;o++)n=j[o],Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}}function B(t){return B[" "](t),t}function K(t,e){var n=rt;return Object.prototype.hasOwnProperty.call(n,t)?n[t]:n[t]=e(t)}B[" "]=p;var G,Y=x(P,"Opera"),z=x(P,"Trident")||x(P,"MSIE"),W=x(P,"Edge"),X=W||z,Q=x(P,"Gecko")&&!(x(P.toLowerCase(),"webkit")&&!x(P,"Edge"))&&!(x(P,"Trident")||x(P,"MSIE"))&&!x(P,"Edge"),J=x(P.toLowerCase(),"webkit")&&!x(P,"Edge");function $(){var t=f.document;return t?t.documentMode:void 0}t:{var Z="",tt=function(){var t=P;return Q?/rv:([^\);]+)(\)|;)/.exec(t):W?/Edge\/([\d\.]+)/.exec(t):z?/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(t):J?/WebKit\/(\S+)/.exec(t):Y?/(?:Version)[ \/]?(\S+)/.exec(t):void 0}();if(tt&&(Z=tt?tt[1]:""),z){var et=$();if(null!=et&&et>parseFloat(Z)){G=String(et);break t}}G=Z}var nt,rt={};function it(t){return K(t,(function(){for(var e=0,n=L(String(G)).split("."),r=L(String(t)).split("."),i=Math.max(n.length,r.length),o=0;0==e&&o<i;o++){var a=n[o]||"",s=r[o]||"";do{if(a=/(\d*)(\D*)(.*)/.exec(a)||["","","",""],s=/(\d*)(\D*)(.*)/.exec(s)||["","","",""],0==a[0].length&&0==s[0].length)break;e=M(0==a[1].length?0:parseInt(a[1],10),0==s[1].length?0:parseInt(s[1],10))||M(0==a[2].length,0==s[2].length)||M(a[2],s[2]),a=a[3],s=s[3]}while(0==e)}return 0<=e}))}if(f.document&&z){var ot=$();nt=ot||(parseInt(G,10)||void 0)}else nt=void 0;var at=nt,st=!z||9<=Number(at),ut=z&&!it("9"),ct=function(){if(!f.addEventListener||!Object.defineProperty)return!1;var t=!1,e=Object.defineProperty({},"passive",{get:function(){t=!0}});try{f.addEventListener("test",p,e),f.removeEventListener("test",p,e)}catch(n){}return t}();function ht(t,e){this.type=t,this.a=this.target=e,this.defaultPrevented=!1}function lt(t,e){if(ht.call(this,t?t.type:""),this.relatedTarget=this.a=this.target=null,this.button=this.screenY=this.screenX=this.clientY=this.clientX=0,this.key="",this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1,this.pointerId=0,this.pointerType="",this.c=null,t){var n=this.type=t.type,r=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:null;if(this.target=t.target||t.srcElement,this.a=e,e=t.relatedTarget){if(Q){t:{try{B(e.nodeName);var i=!0;break t}catch(o){}i=!1}i||(e=null)}}
359else"mouseover"==n?e=t.fromElement:"mouseout"==n&&(e=t.toElement);this.relatedTarget=e,r?(this.clientX=void 0!==r.clientX?r.clientX:r.pageX,this.clientY=void 0!==r.clientY?r.clientY:r.pageY,this.screenX=r.screenX||0,this.screenY=r.screenY||0):(this.clientX=void 0!==t.clientX?t.clientX:t.pageX,this.clientY=void 0!==t.clientY?t.clientY:t.pageY,this.screenX=t.screenX||0,this.screenY=t.screenY||0),this.button=t.button,this.key=t.key||"",this.ctrlKey=t.ctrlKey,this.altKey=t.altKey,this.shiftKey=t.shiftKey,this.metaKey=t.metaKey,this.pointerId=t.pointerId||0,this.pointerType="string"===typeof t.pointerType?t.pointerType:ft[t.pointerType]||"",this.c=t,t.defaultPrevented&&this.b()}}ht.prototype.b=function(){this.defaultPrevented=!0},T(lt,ht);var ft={2:"touch",3:"pen",4:"mouse"};lt.prototype.b=function(){lt.X.b.call(this);var t=this.c;if(t.preventDefault)t.preventDefault();else if(t.returnValue=!1,ut)try{(t.ctrlKey||112<=t.keyCode&&123>=t.keyCode)&&(t.keyCode=-1)}catch(e){}};var pt="closure_listenable_"+(1e6*Math.random()|0),dt=0;function vt(t,e,n,r,i){this.listener=t,this.proxy=null,this.src=e,this.type=n,this.capture=!!r,this.ca=i,this.key=++dt,this.Y=this.Z=!1}function gt(t){t.Y=!0,t.listener=null,t.proxy=null,t.src=null,t.ca=null}function mt(t){this.src=t,this.a={},this.b=0}function yt(t,e){var n=e.type;if(n in t.a){var r,i=t.a[n],o=k(i,e);(r=0<=o)&&Array.prototype.splice.call(i,o,1),r&&(gt(e),0==t.a[n].length&&(delete t.a[n],t.b--))}}function bt(t,e,n,r){for(var i=0;i<t.length;++i){var o=t[i];if(!o.Y&&o.listener==e&&o.capture==!!n&&o.ca==r)return i}return-1}mt.prototype.add=function(t,e,n,r,i){var o=t.toString();t=this.a[o],t||(t=this.a[o]=[],this.b++);var a=bt(t,e,r,i);return-1<a?(e=t[a],n||(e.Z=!1)):(e=new vt(e,this.src,o,!!r,i),e.Z=n,t.push(e)),e};var wt="closure_lm_"+(1e6*Math.random()|0),_t={};function It(t,e,n,r,i){if(r&&r.once)return St(t,e,n,r,i);if(Array.isArray(e)){for(var o=0;o<e.length;o++)It(t,e[o],n,r,i);return null}return n=Pt(n),t&&t[pt]?t.va(e,n,v(r)?!!r.capture:!!r,i):Et(t,e,n,!1,r,i)}function Et(t,e,n,r,i,o){if(!e)throw Error("Invalid event type");var a=v(i)?!!i.capture:!!i;if(a&&!st)return null;var s=Ot(t);if(s||(t[wt]=s=new mt(t)),n=s.add(e,n,r,a,o),n.proxy)return n;if(r=Tt(),n.proxy=r,r.src=t,r.listener=n,t.addEventListener)ct||(i=a),void 0===i&&(i=!1),t.addEventListener(e.toString(),r,i);else if(t.attachEvent)t.attachEvent(Nt(e.toString()),r);else{if(!t.addListener||!t.removeListener)throw Error("addEventListener and attachEvent are unavailable.");t.addListener(r)}return n}function Tt(){var t=Rt,e=st?function(n){return t.call(e.src,e.listener,n)}:function(n){if(n=t.call(e.src,e.listener,n),!n)return n};return e}function St(t,e,n,r,i){if(Array.isArray(e)){for(var o=0;o<e.length;o++)St(t,e[o],n,r,i);return null}return n=Pt(n),t&&t[pt]?t.wa(e,n,v(r)?!!r.capture:!!r,i):Et(t,e,n,!0,r,i)}function At(t,e,n,r,i){if(Array.isArray(e))for(var o=0;o<e.length;o++)At(t,e[o],n,r,i);else r=v(r)?!!r.capture:!!r,n=Pt(n),t&&t[pt]?(t=t.c,e=String(e).toString(),e in t.a&&(o=t.a[e],n=bt(o,n,r,i),-1<n&&(gt(o[n]),Array.prototype.splice.call(o,n,1),0==o.length&&(delete t.a[e],t.b--)))):t&&(t=Ot(t))&&(e=t.a[e.toString()],t=-1,e&&(t=bt(e,n,r,i)),(n=-1<t?e[t]:null)&&kt(n))}function kt(t){if("number"!==typeof t&&t&&!t.Y){var e=t.src;if(e&&e[pt])yt(e.c,t);else{var n=t.type,r=t.proxy;e.removeEventListener?e.removeEventListener(n,r,t.capture):e.detachEvent?e.detachEvent(Nt(n),r):e.addListener&&e.removeListener&&e.removeListener(r),(n=Ot(e))?(yt(n,t),0==n.b&&(n.src=null,e[wt]=null)):gt(t)}}}function Nt(t){return t in _t?_t[t]:_t[t]="on"+t}function Ct(t,e){var n=t.listener,r=t.ca||t.src;return t.Z&&kt(t),n.call(r,e)}function Rt(t,e){if(t.Y)return!0;if(!st){if(!e)t:{e=["window","event"];for(var n=f,r=0;r<e.length;r++)if(n=n[e[r]],null==n){e=null;break t}e=n}return e=new lt(e,this),Ct(t,e)}return Ct(t,new lt(e,this))}function Ot(t){return t=t[wt],t instanceof mt?t:null}var Dt="__closure_events_fn_"+(1e9*Math.random()>>>0);function Pt(t){return"function"===typeof t?t:(t[Dt]||(t[Dt]=function(e){return t.handleEvent(e)}),t[Dt])}function Lt(){S.call(this),this.c=new mt(this),this.J=this,this.C=null}function xt(t,e){var n,r=t.C;if(r)for(n=[];r;r=r.C)n.push(r);if(t=t.J,r=e.type||e,"string"===typeof e)e=new ht(e,t);else if(e instanceof ht)e.target=e.target||t;else{var i=e;e=new ht(r,t),q(e,i)}if(i=!0,n)for(var o=n.length-1;0<=o;o--){var a=e.a=n[o];i=Mt(a,r,!0,e)&&i}
359if(a=e.a=t,i=Mt(a,r,!0,e)&&i,i=Mt(a,r,!1,e)&&i,n)for(o=0;o<n.length;o++)a=e.a=n[o],i=Mt(a,r,!1,e)&&i}function Mt(t,e,n,r){if(e=t.c.a[String(e)],!e)return!0;e=e.concat();for(var i=!0,o=0;o<e.length;++o){var a=e[o];if(a&&!a.Y&&a.capture==n){var s=a.listener,u=a.ca||a.src;a.Z&&yt(t.c,a),i=!1!==s.call(u,r)&&i}}return i&&!r.defaultPrevented}T(Lt,S),Lt.prototype[pt]=!0,c=Lt.prototype,c.addEventListener=function(t,e,n,r){It(this,t,e,n,r)},c.removeEventListener=function(t,e,n,r){At(this,t,e,n,r)},c.G=function(){if(Lt.X.G.call(this),this.c){var t,e=this.c;for(t in e.a){for(var n=e.a[t],r=0;r<n.length;r++)gt(n[r]);delete e.a[t],e.b--}}this.C=null},c.va=function(t,e,n,r){return this.c.add(String(t),e,!1,n,r)},c.wa=function(t,e,n,r){return this.c.add(String(t),e,!0,n,r)};var Ut=f.JSON.stringify;function Ft(){this.b=this.a=null}var Vt,Ht=new(function(){function t(t,e){this.c=t,this.f=e,this.b=0,this.a=null}return t.prototype.get=function(){var t;return 0<this.b?(this.b--,t=this.a,this.a=t.next,t.next=null):t=this.c(),t},t}())((function(){return new qt}),(function(t){t.reset()}));function jt(){var t=zt,e=null;return t.a&&(e=t.a,t.a=t.a.next,t.a||(t.b=null),e.next=null),e}function qt(){this.next=this.b=this.a=null}function Bt(t){f.setTimeout((function(){throw t}),0)}function Kt(t,e){Vt||Gt(),Yt||(Vt(),Yt=!0),zt.add(t,e)}function Gt(){var t=f.Promise.resolve(void 0);Vt=function(){t.then(Wt)}}Ft.prototype.add=function(t,e){var n=Ht.get();n.set(t,e),this.b?this.b.next=n:this.a=n,this.b=n},qt.prototype.set=function(t,e){this.a=t,this.b=e,this.next=null},qt.prototype.reset=function(){this.next=this.b=this.a=null};var Yt=!1,zt=new Ft;function Wt(){for(var t;t=jt();){try{t.a.call(t.b)}catch(n){Bt(n)}var e=Ht;e.f(t),100>e.b&&(e.b++,t.next=e.a,e.a=t)}Yt=!1}function Xt(t,e){Lt.call(this),this.b=t||1,this.a=e||f,this.f=_(this.Za,this),this.g=E()}function Qt(t){t.aa=!1,t.M&&(t.a.clearTimeout(t.M),t.M=null)}function Jt(t,e,n){if("function"===typeof t)n&&(t=_(t,n));else{if(!t||"function"!=typeof t.handleEvent)throw Error("Invalid listener argument");t=_(t.handleEvent,t)}return 2147483647<Number(e)?-1:f.setTimeout(t,e||0)}function $t(t){t.a=Jt((function(){t.a=null,t.c&&(t.c=!1,$t(t))}),t.h);var e=t.b;t.b=null,t.g.apply(null,e)}T(Xt,Lt),c=Xt.prototype,c.aa=!1,c.M=null,c.Za=function(){if(this.aa){var t=E()-this.g;0<t&&t<.8*this.b?this.M=this.a.setTimeout(this.f,this.b-t):(this.M&&(this.a.clearTimeout(this.M),this.M=null),xt(this,"tick"),this.aa&&(Qt(this),this.start()))}},c.start=function(){this.aa=!0,this.M||(this.M=this.a.setTimeout(this.f,this.b),this.g=E())},c.G=function(){Xt.X.G.call(this),Qt(this),delete this.a};var Zt=function(t){function e(e,n){var r=t.call(this)||this;return r.g=e,r.h=n,r.b=null,r.c=!1,r.a=null,r}return s(e,t),e.prototype.f=function(t){this.b=arguments,this.a?this.c=!0:$t(this)},e.prototype.G=function(){t.prototype.G.call(this),this.a&&(f.clearTimeout(this.a),this.a=null,this.c=!1,this.b=null)},e}(S);function te(t){S.call(this),this.b=t,this.a={}}T(te,S);var ee=[];function ne(t,e,n,r){Array.isArray(n)||(n&&(ee[0]=n.toString()),n=ee);for(var i=0;i<n.length;i++){var o=It(e,n[i],r||t.handleEvent,!1,t.b||t);if(!o)break;t.a[o.key]=o}}function re(t){V(t.a,(function(t,e){this.a.hasOwnProperty(e)&&kt(t)}),t),t.a={}}function ie(){this.a=!0}function oe(t,e,n,r,i,o){t.info((function(){if(t.a)if(o)for(var a="",s=o.split("&"),u=0;u<s.length;u++){var c=s[u].split("=");if(1<c.length){var h=c[0];c=c[1];var l=h.split("_");a=2<=l.length&&"type"==l[1]?a+(h+"=")+c+"&":a+(h+"=redacted&")}}else a=null;else a=o;return"XMLHTTP REQ ("+r+") [attempt "+i+"]: "+e+"\n"+n+"\n"+a}))}function ae(t,e,n,r,i,o,a){t.info((function(){return"XMLHTTP RESP ("+r+") [ attempt "+i+"]: "+e+"\n"+n+"\n"+o+" "+a}))}function se(t,e,n,r){t.info((function(){return"XMLHTTP TEXT ("+e+"): "+ce(t,n)+(r?" "+r:"")}))}function ue(t,e){t.info((function(){return"TIMEOUT: "+e}))}function ce(t,e){if(!t.a)return e;if(!e)return null;try{var n=JSON.parse(e);if(n)for(t=0;t<n.length;t++)if(Array.isArray(n[t])){var r=n[t];if(!(2>r.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;a<i.length;a++)i[a]=""}}}return Ut(n)}catch(s){return e}}te.prototype.G=function(){te.X.G.call(this),re(this)},te.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented")},ie.prototype.info=function(){};var he={},le=null;function fe(){return le=le||new Lt}function pe(t){ht.call(this,he.Fa,t)}
359function de(t){var e=fe();xt(e,new pe(e,t))}function ve(t,e){ht.call(this,he.STAT_EVENT,t),this.stat=e}function ge(t){var e=fe();xt(e,new ve(e,t))}function me(t){ht.call(this,he.Ga,t)}function ye(t,e){if("function"!==typeof t)throw Error("Fn must not be null and must be a function");return f.setTimeout((function(){t()}),e)}he.Fa="serverreachability",T(pe,ht),he.STAT_EVENT="statevent",T(ve,ht),he.Ga="timingevent",T(me,ht);var be={NO_ERROR:0,$a:1,nb:2,mb:3,hb:4,lb:5,ob:6,Da:7,TIMEOUT:8,rb:9},we={fb:"complete",Bb:"success",Ea:"error",Da:"abort",tb:"ready",ub:"readystatechange",TIMEOUT:"timeout",pb:"incrementaldata",sb:"progress",ib:"downloadprogress",Jb:"uploadprogress"};function _e(){}function Ie(t){var e;return(e=t.a)||(e=t.a={}),e}function Ee(){}_e.prototype.a=null;var Te,Se={OPEN:"a",eb:"b",Ea:"c",qb:"d"};function Ae(){ht.call(this,"d")}function ke(){ht.call(this,"c")}function Ne(){}function Ce(t,e,n,r){this.g=t,this.c=e,this.f=n,this.S=r||1,this.J=new te(this),this.P=Re,t=X?125:void 0,this.R=new Xt(t),this.B=null,this.b=!1,this.j=this.l=this.i=this.H=this.u=this.T=this.o=null,this.s=[],this.a=null,this.D=0,this.h=this.m=null,this.N=-1,this.A=!1,this.O=0,this.F=null,this.V=this.C=this.U=this.I=!1}T(Ae,ht),T(ke,ht),T(Ne,_e),Te=new Ne;var Re=45e3,Oe={},De={};function Pe(t,e,n){t.H=1,t.i=rn(Je(e)),t.j=n,t.I=!0,Le(t,null)}function Le(t,e){t.u=E(),Ue(t),t.l=Je(t.i);var n=t.l,r=t.S;Array.isArray(r)||(r=[String(r)]),bn(n.b,"t",r),t.D=0,t.a=yr(t.g,t.g.C?e:null),0<t.O&&(t.F=new Zt(_(t.Ca,t,t.a),t.O)),ne(t.J,t.a,"readystatechange",t.Xa),e=t.B?H(t.B):{},t.j?(t.m||(t.m="POST"),e["Content-Type"]="application/x-www-form-urlencoded",t.a.ba(t.l,t.m,t.j,e)):(t.m="GET",t.a.ba(t.l,t.m,null,e)),de(1),oe(t.c,t.m,t.l,t.f,t.S,t.j)}function xe(t,e,n){for(var r=!0;!t.A&&t.D<n.length;){var i=Me(t,n);if(i==De){4==e&&(t.h=4,ge(14),r=!1),se(t.c,t.f,null,"[Incomplete Response]");break}if(i==Oe){t.h=4,ge(15),se(t.c,t.f,n,"[Invalid Chunk]"),r=!1;break}se(t.c,t.f,i,null),qe(t,i)}4==e&&0==n.length&&(t.h=1,ge(16),r=!1),t.b=t.b&&r,r?0<n.length&&!t.V&&(t.V=!0,e=t.g,e.a==t&&e.U&&!e.F&&(e.c.info("Great, no buffering proxy detected. Bytes received: "+n.length),hr(e),e.F=!0,ge(11))):(se(t.c,t.f,n,"[Invalid Chunked Response]"),je(t),He(t))}function Me(t,e){var n=t.D,r=e.indexOf("\n",n);return-1==r?De:(n=Number(e.substring(n,r)),isNaN(n)?Oe:(r+=1,r+n>e.length?De:(e=e.substr(r,n),t.D=r+n,e)))}function Ue(t){t.T=E()+t.P,Fe(t,t.P)}function Fe(t,e){if(null!=t.o)throw Error("WatchDog timer not null");t.o=ye(_(t.Va,t),e)}function Ve(t){t.o&&(f.clearTimeout(t.o),t.o=null)}function He(t){0==t.g.v||t.A||pr(t.g,t)}function je(t){Ve(t);var e=t.F;e&&"function"==typeof e.ja&&e.ja(),t.F=null,Qt(t.R),re(t.J),t.a&&(e=t.a,t.a=null,e.abort(),e.ja())}function qe(t,e){try{var n=t.g;if(0!=n.v&&(n.a==t||kn(n.b,t)))if(n.I=t.N,!t.C&&kn(n.b,t)&&3==n.v){try{var r=n.ka.a.parse(e)}catch(sp){r=null}if(Array.isArray(r)&&3==r.length){var i=r;if(0==i[0]){t:if(!n.j){if(n.a){if(!(n.a.u+3e3<t.u))break t;fr(n),tr(n)}cr(n),ge(18)}}else n.oa=i[1],0<n.oa-n.P&&37500>i[2]&&n.H&&0==n.o&&!n.m&&(n.m=ye(_(n.Sa,n),6e3));if(1>=An(n.b)&&n.ea){try{n.ea()}catch(sp){}n.ea=void 0}}else vr(n,11)}else if((t.C||n.a==t)&&fr(n),!D(e))for(e=r=n.ka.a.parse(e),r=0;r<e.length;r++)if(i=e[r],n.P=i[0],i=i[1],2==n.v)if("c"==i[0]){n.J=i[1],n.ga=i[2];var o=i[3];null!=o&&(n.ha=o,n.c.info("VER="+n.ha));var a=i[4];null!=a&&(n.pa=a,n.c.info("SVER="+n.pa));var s=i[5];if(null!=s&&"number"===typeof s&&0<s){var u=1.5*s;n.D=u,n.c.info("backChannelRequestTimeoutMs_="+u)}u=n;var c=t.a;if(c){var h=c.a?c.a.getResponseHeader("X-Client-Wire-Protocol"):null;if(h){var l=u.b;!l.a&&(x(h,"spdy")||x(h,"quic")||x(h,"h2"))&&(l.f=l.g,l.a=new Set,l.b&&(Nn(l,l.b),l.b=null))}if(u.A){var f=c.a?c.a.getResponseHeader("X-HTTP-Session-Id"):null;f&&(u.na=f,nn(u.B,u.A,f))}}n.v=3,n.f&&n.f.ta(),n.U&&(n.N=E()-t.u,n.c.info("Handshake RTT: "+n.N+"ms")),u=n;var p=t;if(u.la=mr(u,u.C?u.ga:null,u.fa),p.C){Cn(u.b,p);var d=p,v=u.D;v&&d.setTimeout(v),d.o&&(Ve(d),Ue(d)),u.a=p}else ur(u);0<n.g.length&&rr(n)}else"stop"!=i[0]&&"close"!=i[0]||vr(n,7);else 3==n.v&&("stop"==i[0]||"close"==i[0]?"stop"==i[0]?vr(n,7):Zn(n):"noop"!=i[0]&&n.f&&n.f.sa(i),n.o=0);de(4)}catch(sp){}}function Be(t){if(t.K&&"function"==typeof t.K)return t.K();if("string"===typeof t)return t.split("");
359if(d(t)){for(var e=[],n=t.length,r=0;r<n;r++)e.push(t[r]);return e}for(r in e=[],n=0,t)e[n++]=t[r];return e}function Ke(t,e){if(t.forEach&&"function"==typeof t.forEach)t.forEach(e,void 0);else if(d(t)||"string"===typeof t)N(t,e,void 0);else{if(t.L&&"function"==typeof t.L)var n=t.L();else if(t.K&&"function"==typeof t.K)n=void 0;else if(d(t)||"string"===typeof t){n=[];for(var r=t.length,i=0;i<r;i++)n.push(i)}else for(i in n=[],r=0,t)n[r++]=i;r=Be(t),i=r.length;for(var o=0;o<i;o++)e.call(void 0,r[o],n&&n[o],t)}}function Ge(t,e){this.b={},this.a=[],this.c=0;var n=arguments.length;if(1<n){if(n%2)throw Error("Uneven number of arguments");for(var r=0;r<n;r+=2)this.set(arguments[r],arguments[r+1])}else if(t)if(t instanceof Ge)for(n=t.L(),r=0;r<n.length;r++)this.set(n[r],t.get(n[r]));else for(r in t)this.set(r,t[r])}function Ye(t){if(t.c!=t.a.length){for(var e=0,n=0;e<t.a.length;){var r=t.a[e];ze(t.b,r)&&(t.a[n++]=r),e++}t.a.length=n}if(t.c!=t.a.length){var i={};for(n=e=0;e<t.a.length;)r=t.a[e],ze(i,r)||(t.a[n++]=r,i[r]=1),e++;t.a.length=n}}function ze(t,e){return Object.prototype.hasOwnProperty.call(t,e)}c=Ce.prototype,c.setTimeout=function(t){this.P=t},c.Xa=function(t){t=t.target;var e=this.F;e&&3==Wn(t)?e.f():this.Ca(t)},c.Ca=function(t){try{if(t==this.a)t:{var e=Wn(this.a),n=this.a.ua(),r=this.a.W();if(!(3>e||3==e&&!X&&!this.a.$())){this.A||4!=e||7==n||de(8==n||0>=r?3:2),Ve(this);var i=this.a.W();this.N=i;var o=this.a.$();if(this.b=200==i,ae(this.c,this.m,this.l,this.f,this.S,e,i),this.b){if(this.U&&!this.C){e:{if(this.a){var a,s=this.a;if((a=s.a?s.a.getResponseHeader("X-HTTP-Initial-Response"):null)&&!D(a)){var u=a;break e}}u=null}if(!u){this.b=!1,this.h=3,ge(12),je(this),He(this);break t}se(this.c,this.f,u,"Initial handshake response via X-HTTP-Initial-Response"),this.C=!0,qe(this,u)}this.I?(xe(this,e,o),X&&this.b&&3==e&&(ne(this.J,this.R,"tick",this.Wa),this.R.start())):(se(this.c,this.f,o,null),qe(this,o)),4==e&&je(this),this.b&&!this.A&&(4==e?pr(this.g,this):(this.b=!1,Ue(this)))}else 400==i&&0<o.indexOf("Unknown SID")?(this.h=3,ge(12)):(this.h=0,ge(13)),je(this),He(this)}}}catch(c){}},c.Wa=function(){if(this.a){var t=Wn(this.a),e=this.a.$();this.D<e.length&&(Ve(this),xe(this,t,e),this.b&&4!=t&&Ue(this))}},c.cancel=function(){this.A=!0,je(this)},c.Va=function(){this.o=null;var t=E();0<=t-this.T?(ue(this.c,this.l),2!=this.H&&(de(3),ge(17)),je(this),this.h=2,He(this)):Fe(this,this.T-t)},c=Ge.prototype,c.K=function(){Ye(this);for(var t=[],e=0;e<this.a.length;e++)t.push(this.b[this.a[e]]);return t},c.L=function(){return Ye(this),this.a.concat()},c.get=function(t,e){return ze(this.b,t)?this.b[t]:e},c.set=function(t,e){ze(this.b,t)||(this.c++,this.a.push(t)),this.b[t]=e},c.forEach=function(t,e){for(var n=this.L(),r=0;r<n.length;r++){var i=n[r],o=this.get(i);t.call(e,o,i,this)}};var We=/^(?:([^:/?#.]+):)?(?:\/\/(?:([^\\/?#]*)@)?([^\\/?#]*?)(?::([0-9]+))?(?=[\\/?#]|$))?([^?#]+)?(?:\?([^#]*))?(?:#([\s\S]*))?$/;function Xe(t,e){if(t){t=t.split("&");for(var n=0;n<t.length;n++){var r=t[n].indexOf("="),i=null;if(0<=r){var o=t[n].substring(0,r);i=t[n].substring(r+1)}else o=t[n];e(o,i?decodeURIComponent(i.replace(/\+/g," ")):"")}}}function Qe(t,e){if(this.c=this.j=this.f="",this.h=null,this.i=this.g="",this.a=!1,t instanceof Qe){this.a=void 0!==e?e:t.a,$e(this,t.f),this.j=t.j,Ze(this,t.c),tn(this,t.h),this.g=t.g,e=t.b;var n=new vn;n.c=e.c,e.a&&(n.a=new Ge(e.a),n.b=e.b),en(this,n),this.i=t.i}else t&&(n=String(t).match(We))?(this.a=!!e,$e(this,n[1]||"",!0),this.j=sn(n[2]||""),Ze(this,n[3]||"",!0),tn(this,n[4]),this.g=sn(n[5]||"",!0),en(this,n[6]||"",!0),this.i=sn(n[7]||"")):(this.a=!!e,this.b=new vn(null,this.a))}function Je(t){return new Qe(t)}function $e(t,e,n){t.f=n?sn(e,!0):e,t.f&&(t.f=t.f.replace(/:$/,""))}function Ze(t,e,n){t.c=n?sn(e,!0):e}function tn(t,e){if(e){if(e=Number(e),isNaN(e)||0>e)throw Error("Bad port number "+e);t.h=e}else t.h=null}function en(t,e,n){e instanceof vn?(t.b=e,_n(t.b,t.a)):(n||(e=un(e,pn)),t.b=new vn(e,t.a))}function nn(t,e,n){t.b.set(e,n)}function rn(t){return nn(t,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^E()).toString(36)),t}function on(t){return t instanceof Qe?Je(t):new Qe(t,void 0)}function an(t,e,n,r){var i=new Qe(null,void 0);return t&&$e(i,t),e&&Ze(i,e),n&&tn(i,n),r&&(i.g=r),i}function sn(t,e){return t?e?decodeURI(t.replace(/%25/g,"%2525")):decodeURIComponent(t):""}function un(t,e,n){return"string"===typeof t?(t=encodeURI(t).replace(e,cn),n&&(t=t.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),t):null}function cn(t){return t=t.charCodeAt(0),"%"+(t>>4&15).toString(16)+(15&t).toString(16)}Qe.prototype.toString=function(){var t=[],e=this.f;e&&t.push(un(e,hn,!0),":");var n=this.c;
359return(n||"file"==e)&&(t.push("//"),(e=this.j)&&t.push(un(e,hn,!0),"@"),t.push(encodeURIComponent(String(n)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),n=this.h,null!=n&&t.push(":",String(n))),(n=this.g)&&(this.c&&"/"!=n.charAt(0)&&t.push("/"),t.push(un(n,"/"==n.charAt(0)?fn:ln,!0))),(n=this.b.toString())&&t.push("?",n),(n=this.i)&&t.push("#",un(n,dn)),t.join("")};var hn=/[#\/\?@]/g,ln=/[#\?:]/g,fn=/[#\?]/g,pn=/[#\?@]/g,dn=/#/g;function vn(t,e){this.b=this.a=null,this.c=t||null,this.f=!!e}function gn(t){t.a||(t.a=new Ge,t.b=0,t.c&&Xe(t.c,(function(e,n){t.add(decodeURIComponent(e.replace(/\+/g," ")),n)})))}function mn(t,e){gn(t),e=wn(t,e),ze(t.a.b,e)&&(t.c=null,t.b-=t.a.get(e).length,t=t.a,ze(t.b,e)&&(delete t.b[e],t.c--,t.a.length>2*t.c&&Ye(t)))}function yn(t,e){return gn(t),e=wn(t,e),ze(t.a.b,e)}function bn(t,e,n){mn(t,e),0<n.length&&(t.c=null,t.a.set(wn(t,e),O(n)),t.b+=n.length)}function wn(t,e){return e=String(e),t.f&&(e=e.toLowerCase()),e}function _n(t,e){e&&!t.f&&(gn(t),t.c=null,t.a.forEach((function(t,e){var n=e.toLowerCase();e!=n&&(mn(this,e),bn(this,n,t))}),t)),t.f=e}c=vn.prototype,c.add=function(t,e){gn(this),this.c=null,t=wn(this,t);var n=this.a.get(t);return n||this.a.set(t,n=[]),n.push(e),this.b+=1,this},c.forEach=function(t,e){gn(this),this.a.forEach((function(n,r){N(n,(function(n){t.call(e,n,r,this)}),this)}),this)},c.L=function(){gn(this);for(var t=this.a.K(),e=this.a.L(),n=[],r=0;r<e.length;r++)for(var i=t[r],o=0;o<i.length;o++)n.push(e[r]);return n},c.K=function(t){gn(this);var e=[];if("string"===typeof t)yn(this,t)&&(e=R(e,this.a.get(wn(this,t))));else{t=this.a.K();for(var n=0;n<t.length;n++)e=R(e,t[n])}return e},c.set=function(t,e){return gn(this),this.c=null,t=wn(this,t),yn(this,t)&&(this.b-=this.a.get(t).length),this.a.set(t,[e]),this.b+=1,this},c.get=function(t,e){return t?(t=this.K(t),0<t.length?String(t[0]):e):e},c.toString=function(){if(this.c)return this.c;if(!this.a)return"";for(var t=[],e=this.a.L(),n=0;n<e.length;n++){var r=e[n],i=encodeURIComponent(String(r));r=this.K(r);for(var o=0;o<r.length;o++){var a=i;""!==r[o]&&(a+="="+encodeURIComponent(String(r[o]))),t.push(a)}}return this.c=t.join("&")};var In=function(){function t(t,e){this.b=t,this.a=e}return t}();function En(t){this.g=t||Tn,f.PerformanceNavigationTiming?(t=f.performance.getEntriesByType("navigation"),t=0<t.length&&("hq"==t[0].nextHopProtocol||"h2"==t[0].nextHopProtocol)):t=!!(f.ia&&f.ia.ya&&f.ia.ya()&&f.ia.ya().Lb),this.f=t?this.g:1,this.a=null,1<this.f&&(this.a=new Set),this.b=null,this.c=[]}var Tn=10;function Sn(t){return!!t.b||!!t.a&&t.a.size>=t.f}function An(t){return t.b?1:t.a?t.a.size:0}function kn(t,e){return t.b?t.b==e:!!t.a&&t.a.has(e)}function Nn(t,e){t.a?t.a.add(e):t.b=e}function Cn(t,e){t.b&&t.b==e?t.b=null:t.a&&t.a.has(e)&&t.a.delete(e)}function Rn(t){var e,n;if(null!=t.b)return t.c.concat(t.b.s);if(null!=t.a&&0!==t.a.size){var r=t.c;try{for(var i=u(t.a.values()),o=i.next();!o.done;o=i.next()){var a=o.value;r=r.concat(a.s)}}catch(s){e={error:s}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return r}return O(t.c)}function On(){}function Dn(){this.a=new On}function Pn(t,e,n){var r=n||"";try{Ke(t,(function(t,n){var i=t;v(t)&&(i=Ut(t)),e.push(r+n+"="+encodeURIComponent(i))}))}catch(i){throw e.push(r+"type="+encodeURIComponent("_badmap")),i}}function Ln(t,e){var n=new ie;if(f.Image){var r=new Image;r.onload=I(xn,n,r,"TestLoadImage: loaded",!0,e),r.onerror=I(xn,n,r,"TestLoadImage: error",!1,e),r.onabort=I(xn,n,r,"TestLoadImage: abort",!1,e),r.ontimeout=I(xn,n,r,"TestLoadImage: timeout",!1,e),f.setTimeout((function(){r.ontimeout&&r.ontimeout()}),1e4),r.src=t}else e(!1)}function xn(t,e,n,r,i){try{e.onload=null,e.onerror=null,e.onabort=null,e.ontimeout=null,i(r)}catch(o){}}En.prototype.cancel=function(){var t,e;if(this.c=Rn(this),this.b)this.b.cancel(),this.b=null;else if(this.a&&0!==this.a.size){try{for(var n=u(this.a.values()),r=n.next();!r.done;r=n.next()){var i=r.value;i.cancel()}}catch(o){t={error:o}}finally{try{r&&!r.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}this.a.clear()}},On.prototype.stringify=function(t){return f.JSON.stringify(t,void 0)},On.prototype.parse=function(t){return f.JSON.parse(t,void 0)};var Mn=f.JSON.parse;function Un(t){Lt.call(this),this.headers=new Ge,this.H=t||null,this.b=!1,this.s=this.a=null,this.B="",this.h=0,this.f="",this.g=this.A=this.l=this.u=!1,this.o=0,this.m=null,this.I=Fn,this.D=this.F=!1}T(Un,Lt);var Fn="",Vn=/^https?$/i,Hn=["POST","PUT"];function jn(t){return z&&it(9)&&"number"===typeof t.timeout&&void 0!==t.ontimeout}function qn(t){return"content-type"==t.toLowerCase()}function Bn(t,e){t.b=!1,t.a&&(t.g=!0,t.a.abort(),t.g=!1),t.f=e,t.h=5,Kn(t),Yn(t)}function Kn(t){t.u||(t.u=!0,xt(t,"complete"),xt(t,"error"))}function Gn(t){if(t.b&&"undefined"!=typeof l&&(!t.s[1]||4!=Wn(t)||2!=t.W()))if(t.l&&4==Wn(t))Jt(t.za,0,t);else if(xt(t,"readystatechange"),4==Wn(t)){t.b=!1;try{var e,n=t.W();t:switch(n){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var r
359=!0;break t;default:r=!1}if(!(e=r)){var i;if(i=0===n){var o=String(t.B).match(We)[1]||null;if(!o&&f.self&&f.self.location){var a=f.self.location.protocol;o=a.substr(0,a.length-1)}i=!Vn.test(o?o.toLowerCase():"")}e=i}var s=e;if(s)xt(t,"complete"),xt(t,"success");else{t.h=6;try{var u=2<Wn(t)?t.a.statusText:""}catch(n){u=""}t.f=u+" ["+t.W()+"]",Kn(t)}}finally{Yn(t)}}}function Yn(t,e){if(t.a){zn(t);var n=t.a,r=t.s[0]?p:null;t.a=null,t.s=null,e||xt(t,"ready");try{n.onreadystatechange=r}catch(i){}}}function zn(t){t.a&&t.D&&(t.a.ontimeout=null),t.m&&(f.clearTimeout(t.m),t.m=null)}function Wn(t){return t.a?t.a.readyState:0}function Xn(t){var e="";return V(t,(function(t,n){e+=n,e+=":",e+=t,e+="\r\n"})),e}function Qn(t,e,n){t:{for(r in n){var r=!1;break t}r=!0}r||(n=Xn(n),"string"===typeof t?null!=n&&encodeURIComponent(String(n)):nn(t,e,n))}function Jn(t,e,n){return n&&n.internalChannelParams&&n.internalChannelParams[t]||e}function $n(t){this.pa=0,this.g=[],this.c=new ie,this.ga=this.la=this.B=this.fa=this.a=this.na=this.A=this.V=this.i=this.O=this.l=null,this.Oa=this.R=0,this.La=Jn("failFast",!1,t),this.H=this.m=this.j=this.h=this.f=null,this.S=!0,this.I=this.oa=this.P=-1,this.T=this.o=this.u=0,this.Ha=Jn("baseRetryDelayMs",5e3,t),this.Ra=Jn("retryDelaySeedMs",1e4,t),this.Ma=Jn("forwardChannelMaxRetries",2,t),this.ma=Jn("forwardChannelRequestTimeoutMs",2e4,t),this.Na=t&&t.g||void 0,this.D=void 0,this.C=t&&t.supportsCrossDomainXhr||!1,this.J="",this.b=new En(t&&t.concurrentRequestLimit),this.ka=new Dn,this.da=t&&t.fastHandshake||!1,this.Ia=t&&t.b||!1,t&&t.f&&(this.c.a=!1),t&&t.forceLongPolling&&(this.S=!1),this.U=!this.da&&this.S&&t&&t.detectBufferingProxy||!1,this.ea=void 0,this.N=0,this.F=!1,this.s=null,(this.Ka=t&&t.c||!1)&&this.c.info("Opt-in to enable Chrome Origin Trials.")}function Zn(t){if(er(t),3==t.v){var e=t.R++,n=Je(t.B);nn(n,"SID",t.J),nn(n,"RID",e),nn(n,"TYPE","terminate"),ar(t,n),e=new Ce(t,t.c,e,void 0),e.H=2,e.i=rn(Je(n)),n=!1,f.navigator&&f.navigator.sendBeacon&&(n=f.navigator.sendBeacon(e.i.toString(),"")),!n&&f.Image&&((new Image).src=e.i,n=!0),n||(e.a=yr(e.g,null),e.a.ba(e.i)),e.u=E(),Ue(e)}gr(t)}function tr(t){t.a&&(hr(t),t.a.cancel(),t.a=null)}function er(t){tr(t),t.j&&(f.clearTimeout(t.j),t.j=null),fr(t),t.b.cancel(),t.h&&("number"===typeof t.h&&f.clearTimeout(t.h),t.h=null)}function nr(t,e){t.g.push(new In(t.Oa++,e)),3==t.v&&rr(t)}function rr(t){Sn(t.b)||t.h||(t.h=!0,Kt(t.Ba,t),t.u=0)}function ir(t,e){return!(An(t.b)>=t.b.f-(t.h?1:0))&&(t.h?(t.g=e.s.concat(t.g),!0):!(1==t.v||2==t.v||t.u>=(t.La?0:t.Ma))&&(t.h=ye(_(t.Ba,t,e),dr(t,t.u)),t.u++,!0))}function or(t,e){var n;n=e?e.f:t.R++;var r=Je(t.B);nn(r,"SID",t.J),nn(r,"RID",n),nn(r,"AID",t.P),ar(t,r),t.i&&t.l&&Qn(r,t.i,t.l),n=new Ce(t,t.c,n,t.u+1),null===t.i&&(n.B=t.l),e&&(t.g=e.s.concat(t.g)),e=sr(t,n,1e3),n.setTimeout(Math.round(.5*t.ma)+Math.round(.5*t.ma*Math.random())),Nn(t.b,n),Pe(n,r,e)}function ar(t,e){t.f&&Ke({},(function(t,n){nn(e,n,t)}))}function sr(t,e,n){n=Math.min(t.g.length,n);var r=t.f?_(t.f.Ja,t.f,t):null;t:for(var i=t.g,o=-1;;){var a=["count="+n];-1==o?0<n?(o=i[0].b,a.push("ofs="+o)):o=0:a.push("ofs="+o);for(var s=!0,u=0;u<n;u++){var c=i[u].b,h=i[u].a;if(c-=o,0>c)o=Math.max(0,i[u].b-100),s=!1;else try{Pn(h,a,"req"+c+"_")}catch(Zr){r&&r(h)}}if(s){r=a.join("&");break t}}return t=t.g.splice(0,n),e.s=t,r}function ur(t){t.a||t.j||(t.T=1,Kt(t.Aa,t),t.o=0)}function cr(t){return!(t.a||t.j||3<=t.o)&&(t.T++,t.j=ye(_(t.Aa,t),dr(t,t.o)),t.o++,!0)}function hr(t){null!=t.s&&(f.clearTimeout(t.s),t.s=null)}function lr(t){t.a=new Ce(t,t.c,"rpc",t.T),null===t.i&&(t.a.B=t.l),t.a.O=0;var e=Je(t.la);nn(e,"RID","rpc"),nn(e,"SID",t.J),nn(e,"CI",t.H?"0":"1"),nn(e,"AID",t.P),ar(t,e),nn(e,"TYPE","xmlhttp"),t.i&&t.l&&Qn(e,t.i,t.l),t.D&&t.a.setTimeout(t.D);var n=t.a;t=t.ga,n.H=1,n.i=rn(Je(e)),n.j=null,n.I=!0,Le(n,t)}function fr(t){null!=t.m&&(f.clearTimeout(t.m),t.m=null)}function pr(t,e){var n=null;if(t.a==e){fr(t),hr(t),t.a=null;var r=2}else{if(!kn(t.b,e))return;n=e.s,Cn(t.b,e),r=1}if(t.I=e.N,0!=t.v)if(e.b)if(1==r){n=e.j?e.j.length:0,e=E()-e.u;var i=t.u;r=fe(),xt(r,new me(r,n,e,i)),rr(t)}else ur(t);else if(i=e.h,3==i||0==i&&0<t.I||!(1==r&&ir(t,e)||2==r&&cr(t)))switch(n&&0<n.length&&(e=t.b,e.c=e.c.concat(n)),i){case 1:vr(t,5);break;case 4:vr(t,10);break;case 3:vr(t,6);break;default:vr(t,2)}}function dr(t,e){var n=t.Ha+Math.floor(Math.random()*t.Ra);return t.f||(n*=2),n*e}function vr(t,e){if(t.c.info("Error code "+e),2==e){var n=null;t.f&&(n=null);var r=_(t.Ya,t);n||(n=new Qe("//www.google.com/images/cleardot.gif"),f.location&&"http"==f.location.protocol||$e(n,"https"),rn(n)),Ln(n.toString(),r)}else ge(2);t.v=0,t.f&&t.f.ra(e),gr(t),er(t)}function gr(t){t.v=0,t.I=-1,t.f&&(0==Rn(t.b).length&&0==t.g.length||(t.b.c.length=0,O(t.g),t.g.length=0),t.f.qa())}function mr(t,e,n){var r=on(n);if(""!=r.c)e&&Ze(r,e+"."+r.c),tn(r,r.h);else{var i=f.location;r=an(i.protocol,e?e+"."+i.hostname:i.hostname,+i.port,n)}return t.V&&V(t.V,(function(t,e){nn(r,e,t)})),e=t.A,n=t.na,e&&n&&nn(r,e,n),nn(r,"VER",t.ha),ar(t,r),r}function yr(t,e){if(e&&!t.C)throw Error("Can't create secondary domain capable XhrIo object.");return e=new Un(t.Na),e.F=t.C,e}function br(){}function wr(){if(z&&!(10<=Number(at)))throw Error("Environmental error: no available transport.")}function _r(t,e){Lt.call(this),this.a=new $n(e),this.o=t,this.b=e&&e.messageUrlParams||null,t=e&&e.messageHeaders||null,e&&e.clientProtocolHeaderRequired&&(t?t["X-Client-Protocol"]="webchannel":t={"X-Client-Protocol":"webchannel"}),this.a.l=t,t=e&&e.initMessageHeaders||null,e&&e.messageContentType&&(t?t["X-WebChannel-Content-Type"]=e.messageContentType:t={"X-WebChannel-Content-Type":e.messageContentType}),e&&e.a&&(t?t["X-WebChannel-Client-Profile"]=e.a:t={"X-WebChannel-Client-Profile":e.a}),this.a.O=t,(t=e&&e.httpHeadersOverwriteParam)&&!D(t)&&(this.a.i=t),this.m=e&&e.supportsCrossDomainXhr||!1,this.l=e&&e.sendRawJson||!1,(e=e&&e.httpSessionIdParam)&&!D(e)&&(this.a.A=e,t=this.b,null!==t&&e in t&&(t=this.b,e in t&&delete t[e])),this.f=new Tr(this)}function Ir(t){Ae.call(this);var e=t.__sm__;if(e){t:{for(var n in e){t=n;break t}t=void 0}(this.c=t)?(t=this.c,this.data=null!==e&&t in e?e[t]:void 0):this.data=e}else this.data=t}function Er(){ke.call(this),this.status=1}function Tr(t){this.a=t}c=Un.prototype,c.ba=function(t,e,n,r){if(this.a)throw Error("[goog.net.XhrIo] Object is active with another request="+this.B+"; newUri="+t);e=e?e.toUpperCase():"GET",this.B=t,this.f="",this.h=0,this.u=!1,this.b=!0,this.a=new XMLHttpRequest,this.s=this.H?Ie(this.H):Ie(Te),this.a.onreadystatechange=_(this.za,this);try{this.A=!0,this.a.open(e,String(t),!0),this.A=!1}catch(o){return void Bn(this,o)}t=n||"";var i=new Ge(this.headers);r&&Ke(r,(function(t,e){i.set(e,t)})),r=C(i.L()),n=f.FormData&&t instanceof f.FormData,!(0<=k(Hn,e))||r||n||i.set("Content-Type","application/x-www-form-urlencoded;
359charset=utf-8"),i.forEach((function(t,e){this.a.setRequestHeader(e,t)}),this),this.I&&(this.a.responseType=this.I),"withCredentials"in this.a&&this.a.withCredentials!==this.F&&(this.a.withCredentials=this.F);try{zn(this),0<this.o&&((this.D=jn(this.a))?(this.a.timeout=this.o,this.a.ontimeout=_(this.xa,this)):this.m=Jt(this.xa,this.o,this)),this.l=!0,this.a.send(t),this.l=!1}catch(o){Bn(this,o)}},c.xa=function(){"undefined"!=typeof l&&this.a&&(this.f="Timed out after "+this.o+"ms, aborting",this.h=8,xt(this,"timeout"),this.abort(8))},c.abort=function(t){this.a&&this.b&&(this.b=!1,this.g=!0,this.a.abort(),this.g=!1,this.h=t||7,xt(this,"complete"),xt(this,"abort"),Yn(this))},c.G=function(){this.a&&(this.b&&(this.b=!1,this.g=!0,this.a.abort(),this.g=!1),Yn(this,!0)),Un.X.G.call(this)},c.za=function(){this.j||(this.A||this.l||this.g?Gn(this):this.Ua())},c.Ua=function(){Gn(this)},c.W=function(){try{return 2<Wn(this)?this.a.status:-1}catch(t){return-1}},c.$=function(){try{return this.a?this.a.responseText:""}catch(t){return""}},c.Pa=function(t){if(this.a){var e=this.a.responseText;return t&&0==e.indexOf(t)&&(e=e.substring(t.length)),Mn(e)}},c.ua=function(){return this.h},c.Qa=function(){return"string"===typeof this.f?this.f:String(this.f)},c=$n.prototype,c.ha=8,c.v=1,c.Ba=function(t){if(this.h)if(this.h=null,1==this.v){if(!t){this.R=Math.floor(1e5*Math.random()),t=this.R++;var e,n=new Ce(this,this.c,t,void 0),r=this.l;if(this.O&&(r?(r=H(r),q(r,this.O)):r=this.O),null===this.i&&(n.B=r),this.da)t:{for(var i=e=0;i<this.g.length;i++){var o=this.g[i];if(o="__data__"in o.a&&(o=o.a.__data__,"string"===typeof o)?o.length:void 0,void 0===o)break;if(e+=o,4096<e){e=i;break t}if(4096===e||i===this.g.length-1){e=i+1;break t}}e=1e3}else e=1e3;e=sr(this,n,e),i=Je(this.B),nn(i,"RID",t),nn(i,"CVER",22),this.A&&nn(i,"X-HTTP-Session-Id",this.A),ar(this,i),this.i&&r&&Qn(i,this.i,r),Nn(this.b,n),this.Ia&&nn(i,"TYPE","init"),this.da?(nn(i,"$req",e),nn(i,"SID","null"),n.U=!0,Pe(n,i,null)):Pe(n,i,e),this.v=2}}else 3==this.v&&(t?or(this,t):0==this.g.length||Sn(this.b)||or(this))},c.Aa=function(){if(this.j=null,lr(this),this.U&&!(this.F||null==this.a||0>=this.N)){var t=2*this.N;this.c.info("BP detection timer enabled: "+t),this.s=ye(_(this.Ta,this),t)}},c.Ta=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.H=!1,this.F=!0,ge(10),tr(this),lr(this))},c.Sa=function(){null!=this.m&&(this.m=null,tr(this),cr(this),ge(19))},c.Ya=function(t){t?(this.c.info("Successfully pinged google.com"),ge(2)):(this.c.info("Failed to ping google.com"),ge(1))},c=br.prototype,c.ta=function(){},c.sa=function(){},c.ra=function(){},c.qa=function(){},c.Ja=function(){},wr.prototype.a=function(t,e){return new _r(t,e)},T(_r,Lt),_r.prototype.g=function(){this.a.f=this.f,this.m&&(this.a.C=!0);var t=this.a,e=this.o,n=this.b||void 0;ge(0),t.fa=e,t.V=n||{},t.H=t.S,t.B=mr(t,null,t.fa),rr(t)},_r.prototype.close=function(){Zn(this.a)},_r.prototype.h=function(t){if("string"===typeof t){var e={};e.__data__=t,nr(this.a,e)}else this.l?(e={},e.__data__=Ut(t),nr(this.a,e)):nr(this.a,t)},_r.prototype.G=function(){this.a.f=null,delete this.f,Zn(this.a),delete this.a,_r.X.G.call(this)},T(Ir,Ae),T(Er,ke),T(Tr,br),Tr.prototype.ta=function(){xt(this.a,"a")},Tr.prototype.sa=function(t){xt(this.a,new Ir(t))},Tr.prototype.ra=function(t){xt(this.a,new Er(t))},Tr.prototype.qa=function(){xt(this.a,"b")},wr.prototype.createWebChannel=wr.prototype.a,_r.prototype.send=_r.prototype.h,_r.prototype.open=_r.prototype.g,_r.prototype.close=_r.prototype.close,be.NO_ERROR=0,be.TIMEOUT=8,be.HTTP_ERROR=6,we.COMPLETE="complete",Ee.EventType=Se,Se.OPEN="a",Se.CLOSE="b",Se.ERROR="c",Se.MESSAGE="d",Lt.prototype.listen=Lt.prototype.va,Un.prototype.listenOnce=Un.prototype.wa,Un.prototype.getLastError=Un.prototype.Qa,Un.prototype.getLastErrorCode=Un.prototype.ua,Un.prototype.getStatus=Un.prototype.W,Un.prototype.getResponseJson=Un.prototype.Pa,Un.prototype.getResponseText=Un.prototype.$,Un.prototype.send=Un.prototype.ba;var Sr=function(){return new wr},Ar=function(){return fe()},kr=be,Nr=we,Cr=he,Rr={gb:0,jb:1,kb:2,Db:3,Ib:4,Fb:5,Gb:6,Eb:7,Cb:8,Hb:9,PROXY:10,NOPROXY:11,Ab:12,wb:13,xb:14,vb:15,yb:16,zb:17,bb:18,ab:19,cb:20},Or=Ee,Dr=Un,Pr=n(15215),Lr=n(65606),xr=function(){function t(t,e){var n=this;this.previousValue=t,e&&(e.sequenceNumberHandler=function(t){return n.t(t)},this.i=function(t){return e.writeSequenceNumber(t)})}return t.prototype.t=function(t){return this.previousValue=Math.max(t,this.previousValue),this.previousValue},t.prototype.next=function(){var t=++this.previousValue;return this.i&&this.i(t),t},t}();xr.o=-1; 360/** 361 * @license 362 * Copyright 2017 Google LLC 363 * 364 * Licensed under the Apache License, Version 2.0 (the "License");
365 * you may not use this file except in compliance with the License. 366 * You may obtain a copy of the License at 367 * 368 * http://www.apache.org/licenses/LICENSE-2.0 369 * 370 * Unless required by applicable law or agreed to in writing, software 371 * distributed under the License is distributed on an "AS IS" BASIS, 372 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 373 * See the License for the specific language governing permissions and 374 * limitations under the License. 375 */ 376var Mr={OK:"ok",CANCELLED:"cancelled",UNKNOWN:"unknown",INVALID_ARGUMENT:"invalid-argument",DEADLINE_EXCEEDED:"deadline-exceeded",NOT_FOUND:"not-found",ALREADY_EXISTS:"already-exists",PERMISSION_DENIED:"permission-denied",UNAUTHENTICATED:"unauthenticated",RESOURCE_EXHAUSTED:"resource-exhausted",FAILED_PRECONDITION:"failed-precondition",ABORTED:"aborted",OUT_OF_RANGE:"out-of-range",UNIMPLEMENTED:"unimplemented",INTERNAL:"internal",UNAVAILABLE:"unavailable",DATA_LOSS:"data-loss"},Ur=function(t){function e(e,n){var r=this;return(r=t.call(this,n)||this).code=e,r.message=n,r.name="FirebaseError",r.toString=function(){return r.name+": [code="+r.code+"]: "+r.message},r}return(0,Pr.C6)(e,t),e}(Error),Fr=new o.Vy("@firebase/firestore");function Vr(){return Fr.logLevel}function Hr(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(Fr.logLevel<=o.$b.DEBUG){var r=e.map(Br);Fr.debug.apply(Fr,(0,Pr.fX)(["Firestore (8.5.0): "+t],r))}}function jr(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(Fr.logLevel<=o.$b.ERROR){var r=e.map(Br);Fr.error.apply(Fr,(0,Pr.fX)(["Firestore (8.5.0): "+t],r))}}function qr(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(Fr.logLevel<=o.$b.WARN){var r=e.map(Br);Fr.warn.apply(Fr,(0,Pr.fX)(["Firestore (8.5.0): "+t],r))}}function Br(t){if("string"==typeof t)return t;try{return e=t,JSON.stringify(e)}catch(e){return t}var e} 377/** 378 * @license 379 * Copyright 2017 Google LLC 380 * 381 * Licensed under the Apache License, Version 2.0 (the "License"); 382 * you may not use this file except in compliance with the License. 383 * You may obtain a copy of the License at 384 * 385 * http://www.apache.org/licenses/LICENSE-2.0 386 * 387 * Unless required by applicable law or agreed to in writing, software 388 * distributed under the License is distributed on an "AS IS" BASIS, 389 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 390 * See the License for the specific language governing permissions and 391 * limitations under the License. 392 */function Kr(t){void 0===t&&(t="Unexpected state");var e="FIRESTORE (8.5.0) INTERNAL ASSERTION FAILED: "+t;throw jr(e),new Error(e)}function Gr(t,e){t||Kr()}function Yr(t,e){return t} 393/** 394 * @license 395 * Copyright 2020 Google LLC 396 * 397 * Licensed under the Apache License, Version 2.0 (the "License"); 398 * you may not use this file except in compliance with the License. 399 * You may obtain a copy of the License at 400 * 401 * http://www.apache.org/licenses/LICENSE-2.0 402 * 403 * Unless required by applicable law or agreed to in writing, software 404 * distributed under the License is distributed on an "AS IS" BASIS, 405 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 406 * See the License for the specific language governing permissions and 407 * limitations under the License. 408 */function zr(t){var e="undefined"!=typeof self&&(self.crypto||self.msCrypto),n=new Uint8Array(t);if(e&&"function"==typeof e.getRandomValues)e.getRandomValues(n);else for(var r=0;r<t;r++)n[r]=Math.floor(256*Math.random());return n} 409/** 410 * @license 411 * Copyright 2017 Google LLC 412 * 413 * Licensed under the Apache License, Version 2.0 (the "License"); 414 * you may not use this file except in compliance with the License. 415 * You may obtain a copy of the License at 416 * 417 * http://www.apache.org/licenses/LICENSE-2.0 418 * 419 * Unless required by applicable law or agreed to in writing, software 420 * distributed under the License is distributed on an "AS IS" BASIS, 421 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 422 * See the License for the specific language governing permissions and 423 * limitations under the License. 424 */var Wr=function(){function t(){}return t.u=function(){for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",e=Math.floor(256/t.length)*t.length,n="";n.length<20;)for(var r=zr(40),i=0;i<r.length;++i)n.length<20&&r[i]<e&&(n+=t.charAt(r[i]%t.length));return n},t}();function Xr(t,e){return t<e?-1:t>e?1:0}function Qr(t,e,n){return t.length===e.length&&t.every((function(t,r){return n(t,e[r])}))}function Jr(t){return t+"\0"} 425/** 426 * @license 427 * Copyright 2017 Google LLC 428 * 429 * Licensed under the Apache License, Version 2.0 (the "License");
430 * you may not use this file except in compliance with the License. 431 * You may obtain a copy of the License at 432 * 433 * http://www.apache.org/licenses/LICENSE-2.0 434 * 435 * Unless required by applicable law or agreed to in writing, software 436 * distributed under the License is distributed on an "AS IS" BASIS, 437 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 438 * See the License for the specific language governing permissions and 439 * limitations under the License. 440 */var $r=function(){function t(t,e){if(this.seconds=t,this.nanoseconds=e,e<0)throw new Ur(Mr.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+e);if(e>=1e9)throw new Ur(Mr.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+e);if(t<-62135596800)throw new Ur(Mr.INVALID_ARGUMENT,"Timestamp seconds out of range: "+t);if(t>=253402300800)throw new Ur(Mr.INVALID_ARGUMENT,"Timestamp seconds out of range: "+t)}return t.now=function(){return t.fromMillis(Date.now())},t.fromDate=function(e){return t.fromMillis(e.getTime())},t.fromMillis=function(e){var n=Math.floor(e/1e3);return new t(n,Math.floor(1e6*(e-1e3*n)))},t.prototype.toDate=function(){return new Date(this.toMillis())},t.prototype.toMillis=function(){return 1e3*this.seconds+this.nanoseconds/1e6},t.prototype._compareTo=function(t){return this.seconds===t.seconds?Xr(this.nanoseconds,t.nanoseconds):Xr(this.seconds,t.seconds)},t.prototype.isEqual=function(t){return t.seconds===this.seconds&&t.nanoseconds===this.nanoseconds},t.prototype.toString=function(){return"Timestamp(seconds="+this.seconds+", nanoseconds="+this.nanoseconds+")"},t.prototype.toJSON=function(){return{seconds:this.seconds,nanoseconds:this.nanoseconds}},t.prototype.valueOf=function(){var t=this.seconds- -62135596800;return String(t).padStart(12,"0")+"."+String(this.nanoseconds).padStart(9,"0")},t}(),Zr=function(){function t(t){this.timestamp=t}return t.fromTimestamp=function(e){return new t(e)},t.min=function(){return new t(new $r(0,0))},t.prototype.compareTo=function(t){return this.timestamp._compareTo(t.timestamp)},t.prototype.isEqual=function(t){return this.timestamp.isEqual(t.timestamp)},t.prototype.toMicroseconds=function(){return 1e6*this.timestamp.seconds+this.timestamp.nanoseconds/1e3},t.prototype.toString=function(){return"SnapshotVersion("+this.timestamp.toString()+")"},t.prototype.toTimestamp=function(){return this.timestamp},t}(); 441/** 442 * @license 443 * Copyright 2017 Google LLC 444 * 445 * Licensed under the Apache License, Version 2.0 (the "License"); 446 * you may not use this file except in compliance with the License. 447 * You may obtain a copy of the License at 448 * 449 * http://www.apache.org/licenses/LICENSE-2.0 450 * 451 * Unless required by applicable law or agreed to in writing, software 452 * distributed under the License is distributed on an "AS IS" BASIS, 453 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 454 * See the License for the specific language governing permissions and 455 * limitations under the License. 456 */ 457/** 458 * @license 459 * Copyright 2017 Google LLC 460 * 461 * Licensed under the Apache License, Version 2.0 (the "License"); 462 * you may not use this file except in compliance with the License. 463 * You may obtain a copy of the License at 464 * 465 * http://www.apache.org/licenses/LICENSE-2.0 466 * 467 * Unless required by applicable law or agreed to in writing, software 468 * distributed under the License is distributed on an "AS IS" BASIS, 469 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 470 * See the License for the specific language governing permissions and 471 * limitations under the License. 472 */function ti(t){var e=0;for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e++;return e}function ei(t,e){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e(n,t[n])}function ni(t){for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0} 473/** 474 * @license 475 * Copyright 2017 Google LLC 476 * 477 * Licensed under the Apache License, Version 2.0 (the "License"); 478 * you may not use this file except in compliance with the License. 479 * You may obtain a copy of the License at 480 * 481 * http://www.apache.org/licenses/LICENSE-2.0 482 * 483 * Unless required by applicable law or agreed to in writing, softw
483are 484 * distributed under the License is distributed on an "AS IS" BASIS, 485 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 486 * See the License for the specific language governing permissions and 487 * limitations under the License. 488 */var ri=function(){function t(t,e,n){void 0===e?e=0:e>t.length&&Kr(),void 0===n?n=t.length-e:n>t.length-e&&Kr(),this.segments=t,this.offset=e,this.len=n}return Object.defineProperty(t.prototype,"length",{get:function(){return this.len},enumerable:!1,configurable:!0}),t.prototype.isEqual=function(e){return 0===t.comparator(this,e)},t.prototype.child=function(e){var n=this.segments.slice(this.offset,this.limit());return e instanceof t?e.forEach((function(t){n.push(t)})):n.push(e),this.construct(n)},t.prototype.limit=function(){return this.offset+this.length},t.prototype.popFirst=function(t){return t=void 0===t?1:t,this.construct(this.segments,this.offset+t,this.length-t)},t.prototype.popLast=function(){return this.construct(this.segments,this.offset,this.length-1)},t.prototype.firstSegment=function(){return this.segments[this.offset]},t.prototype.lastSegment=function(){return this.get(this.length-1)},t.prototype.get=function(t){return this.segments[this.offset+t]},t.prototype.isEmpty=function(){return 0===this.length},t.prototype.isPrefixOf=function(t){if(t.length<this.length)return!1;for(var e=0;e<this.length;e++)if(this.get(e)!==t.get(e))return!1;return!0},t.prototype.isImmediateParentOf=function(t){if(this.length+1!==t.length)return!1;for(var e=0;e<this.length;e++)if(this.get(e)!==t.get(e))return!1;return!0},t.prototype.forEach=function(t){for(var e=this.offset,n=this.limit();e<n;e++)t(this.segments[e])},t.prototype.toArray=function(){return this.segments.slice(this.offset,this.limit())},t.comparator=function(t,e){for(var n=Math.min(t.length,e.length),r=0;r<n;r++){var i=t.get(r),o=e.get(r);if(i<o)return-1;if(i>o)return 1}return t.length<e.length?-1:t.length>e.length?1:0},t}(),ii=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Pr.C6)(e,t),e.prototype.construct=function(t,n,r){return new e(t,n,r)},e.prototype.canonicalString=function(){return this.toArray().join("/")},e.prototype.toString=function(){return this.canonicalString()},e.fromString=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var r=[],i=0,o=t;i<o.length;i++){var a=o[i];if(a.indexOf("//")>=0)throw new Ur(Mr.INVALID_ARGUMENT,"Invalid segment ("+a+"). Paths must not contain // in them.");r.push.apply(r,a.split("/").filter((function(t){return t.length>0})))}return new e(r)},e.emptyPath=function(){return new e([])},e}(ri),oi=/^[_a-zA-Z][_a-zA-Z0-9]*$/,ai=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Pr.C6)(e,t),e.prototype.construct=function(t,n,r){return new e(t,n,r)},e.isValidIdentifier=function(t){return oi.test(t)},e.prototype.canonicalString=function(){return this.toArray().map((function(t){return t=t.replace(/\\/g,"\\\\").replace(/`/g,"\\`"),e.isValidIdentifier(t)||(t="`"+t+"`"),t})).join(".")},e.prototype.toString=function(){return this.canonicalString()},e.prototype.isKeyField=function(){return 1===this.length&&"__name__"===this.get(0)},e.keyField=function(){return new e(["__name__"])},e.fromServerFormat=function(t){for(var n=[],r="",i=0,o=function(){if(0===r.length)throw new Ur(Mr.INVALID_ARGUMENT,"Invalid field path ("+t+"). Paths must not be empty, begin with '.', end with '.', or contain '..'");n.push(r),r=""},a=!1;i<t.length;){var s=t[i];if("\\"===s){if(i+1===t.length)throw new Ur(Mr.INVALID_ARGUMENT,"Path has trailing escape character: "+t);var u=t[i+1];if("\\"!==u&&"."!==u&&"`"!==u)throw new Ur(Mr.INVALID_ARGUMENT,"Path has invalid escape sequence: "+t);r+=u,i+=2}else"`"===s?(a=!a,i++):"."!==s||a?(r+=s,i++):(o(),i++)}if(o(),a)throw new Ur(Mr.INVALID_ARGUMENT,"Unterminated ` in path: "+t);return new e(n)},e.emptyPath=function(){return new e([])},e}(ri),si=function(){function t(t){this.fields=t,t.sort(ai.comparator)}return t.prototype.covers=function(t){for(var e=0,n=this.fields;e<n.length;e++)if(n[e].isPrefixOf(t))return!0;return!1},t.prototype.isEqual=function(t){return Qr(this.fields,t.fields,(function(t,e){return t.isEqual(e)}))},t}(),ui=function(){function t(t){this.binaryString=t}return t.fromBase64String=function(e){return new t(atob(e))},t.fromUint8Array=function(e){return new t(function(t){for(var e="",n=0;n<t.length;++n)e+=String.fromCharCode(t[n]);return e}(e))},t.prototype.toBase64=function(){return t=this.binaryString,btoa(t);var t},t.prototype.toUint8Array=function(){return function(t){for(var e=new Uint8Array(t.length),n=0;n<t.length;n++)e[n]=t.charCodeAt(n);return e}(this.binaryString)},t.prototype.approximateByteSize=function(){return 2*this.binaryString.length},t.prototype.compareTo=function(t){return Xr(this.binaryString,t.binaryString)},t.prototype.isEqual=function(t){return this.binaryString===t.binaryString},t}();ui.EMPTY_BYTE_STRING=new ui("");var ci=new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);function hi(t){if(Gr(!!t),"string"==typeof t){var e=0,n=ci.exec(t);if(Gr(!!n),n[1]){var r=n[1];r=(r+"000000000").substr(0,9),e=Number(r)}var i=new Date(t);return{seconds:Math.floor(i.getTime()/1e3),nanos:e}}return{seconds:li(t.seconds),nanos:li(t.nanos)}}function li(t){return"number"==typeof t?t:"string"==typeof t?Number(t):0}function fi(t){return"string"==typeof t?ui.fromBase64String(t):ui.fromUint8Array(t)} 489/** 490 * @license 491 * Copyright 2020 Google LLC 492 * 493 * Licensed under the Apache License, Version 2.0 (the "License");
494 * you may not use this file except in compliance with the License. 495 * You may obtain a copy of the License at 496 * 497 * http://www.apache.org/licenses/LICENSE-2.0 498 * 499 * Unless required by applicable law or agreed to in writing, software 500 * distributed under the License is distributed on an "AS IS" BASIS, 501 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 502 * See the License for the specific language governing permissions and 503 * limitations under the License. 504 */function pi(t){var e,n;return"server_timestamp"===(null===(n=((null===(e=null==t?void 0:t.mapValue)||void 0===e?void 0:e.fields)||{}).__type__)||void 0===n?void 0:n.stringValue)}function di(t){var e=t.mapValue.fields.__previous_value__;return pi(e)?di(e):e}function vi(t){var e=hi(t.mapValue.fields.__local_write_time__.timestampValue);return new $r(e.seconds,e.nanos)} 505/** 506 * @license 507 * Copyright 2017 Google LLC 508 * 509 * Licensed under the Apache License, Version 2.0 (the "License"); 510 * you may not use this file except in compliance with the License. 511 * You may obtain a copy of the License at 512 * 513 * http://www.apache.org/licenses/LICENSE-2.0 514 * 515 * Unless required by applicable law or agreed to in writing, software 516 * distributed under the License is distributed on an "AS IS" BASIS, 517 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 518 * See the License for the specific language governing permissions and 519 * limitations under the License. 520 */function gi(t){return null==t}function mi(t){return 0===t&&1/t==-1/0}function yi(t){return"number"==typeof t&&Number.isInteger(t)&&!mi(t)&&t<=Number.MAX_SAFE_INTEGER&&t>=Number.MIN_SAFE_INTEGER} 521/** 522 * @license 523 * Copyright 2017 Google LLC 524 * 525 * Licensed under the Apache License, Version 2.0 (the "License"); 526 * you may not use this file except in compliance with the License. 527 * You may obtain a copy of the License at 528 * 529 * http://www.apache.org/licenses/LICENSE-2.0 530 * 531 * Unless required by applicable law or agreed to in writing, software 532 * distributed under the License is distributed on an "AS IS" BASIS, 533 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 534 * See the License for the specific language governing permissions and 535 * limitations under the License. 536 */var bi=function(){function t(t){this.path=t}return t.fromPath=function(e){return new t(ii.fromString(e))},t.fromName=function(e){return new t(ii.fromString(e).popFirst(5))},t.prototype.hasCollectionId=function(t){return this.path.length>=2&&this.path.get(this.path.length-2)===t},t.prototype.isEqual=function(t){return null!==t&&0===ii.comparator(this.path,t.path)},t.prototype.toString=function(){return this.path.toString()},t.comparator=function(t,e){return ii.comparator(t.path,e.path)},t.isDocumentKey=function(t){return t.length%2==0},t.fromSegments=function(e){return new t(new ii(e.slice()))},t}(); 537/** 538 * @license 539 * Copyright 2020 Google LLC 540 * 541 * Licensed under the Apache License, Version 2.0 (the "License"); 542 * you may not use this file except in compliance with the License. 543 * You may obtain a copy of the License at 544 * 545 * http://www.apache.org/licenses/LICENSE-2.0 546 * 547 * Unless required by applicable law or agreed to in writing, software 548 * distributed under the License is distributed on an "AS IS" BASIS, 549 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 550 * See the License for the specific language governing permissions and 551 * limitations under the License. 552 */function wi(t){return"nullValue"in t?0:"booleanValue"in t?1:"integerValue"in t||"doubleValue"in t?2:"timestampValue"in t?3:"stringValue"in t?5:"bytesValue"in t?6:"referenceValue"in t?7:"geoPointValue"in t?8:"arrayValue"in t?9:"mapValue"in t?pi(t)?4:10:Kr()}function _i(t,e){var n=wi(t);if(n!==wi(e))return!1;switch(n){case 0:return!0;case 1:return t.booleanValue===e.booleanValue;case 4:return vi(t).isEqual(vi(e));case 3:return function(t,e){if("string"==typeof t.timestampValue&&"string"==typeof e.timestampValue&&t.timestampValue.length===e.timestampValue.length)return t.timestampValue===e.timestampValue;var n=hi(t.timestampValue),r=hi(e.timestampValue);return n.seconds===r.seconds&&n.nanos===r.nanos}(t,e);case 5:return t.stringValue===e.stringValue;case 6:return function(t,e){return fi(t.bytesValue).isEqual(fi(e.bytesValue))}(t,e);case 7:return t.referenceValue===e.referenceValue;case 8:return function(t,e){return li(t.geoPointValue.latitude)===li(e.geoPointValue.latitude)&&li(t.geoPointValue.longitude)===li(e.geoPointValue.longitude)}(t,e);case 2:return function(t,e){if("integerValue"in t&&"integerValue"in e)return li(t.integerValue)===li(e.integerValue);if("doubleValue"in t&&"doubleValue"in e){var n=li(t.doubleValue),r=li(e.doubleValue);return n===r?mi(n)===mi(r):isNaN(n)&&isNaN(r)}return!1}(t,e);case 9:return Qr(t.arrayValue.values||[],e.arrayValue.values||[],_i);case 10:return function(t,e){var n=t.mapValue.fields||{},r=e.mapValue.fields||{};if(ti(n)!==ti(r))return!1;for(var i in n)if(n.hasOwnProperty(i)&&(void 0===r[i]||!_i(n[i],r[i])))return!1;return!0}(t,e);default:return Kr()}}function Ii(t,e){return void 0!==(t.values||[]).find((function(t){return _i(t,e)}))}function Ei(t,e){var n=wi(t),r=wi(e);if(n!==r)return Xr(n,r);switch(n){case 0:return 0;case 1:return Xr(t.booleanValue,e.booleanValue);case 2:return function(t,e){var n=li(t.integerValue||t.doubleValue),r=li(e.integerValue||e.doubleValue);return n<r?-1:n>r?1:n===r?0:isNaN(n)?isNaN(r)?0:-1:1}(t,e);case 3:return Ti(t.timestampValue,e.timestampValue);case 4:return Ti(vi(t),vi(e));case 5:return Xr(t.stringValue,e.stringValue);case 6:return function(t,e){var n=fi(t),r=fi(e);return n.compareTo(r)}(t.bytesValue,e.bytesValue);case 7:return function(t,e){for(var n=t.split("/"),r=e.split("/"),i=0;i<n.length&&i<r.length;i++){var o=Xr(n[i],r[i]);if(0!==o)return o}return Xr(n.length,r.length)}(t.referenceValue,e.referenceValue);case 8:return function(t,e){var n=Xr(li(t.latitude),li(e.latitude));return 0!==n?n:Xr(li(t.longitude),li(e.longitude))}(t.geoPointValue,e.geoPointValue);case 9:return function(t,e){for(var n=t.values||[],r=e.values||[],i=0;i<n.length&&i<r.length;++i){var o=Ei(n[i],r[i]);if(o)return o}return Xr(n.length,r.length)}(t.arrayValue,e.arrayValue);case 10:return function(t,e){var n=t.fields||{},r=Object.keys(n),i=e.fields||{},o=Object.keys(i);r.sort(),o.sort();for(var a=0;a<r.length&&a<o.length;++a){var s=Xr(r[a],o[a]);if(0!==s)return s;var u=Ei(n[r[a]],i[o[a]]);if(0!==u)return u}return Xr(r.length,o.length)}(t.mapValue,e.mapValue);default:throw Kr()}}function Ti(t,e){if("string"==typeof t&&"string"==typeof e&&t.length===e.length)return Xr(t,e);var n=hi(t),r=hi(e),i=Xr(n.seconds,r.seconds);return 0!==i?i:Xr(n.nanos,r.nanos)}function Si(t){return Ai(t)}function Ai(t){return"nullValue"in t?"null":"booleanValue"in t?""+t.booleanValue:"integerValue"in t?""+t.integerValue:"doubleValue"in t?""+t.doubleValue:"timestampValue"in t?function(t){var e=hi(t);return"time("+e.seconds+","+e.nanos+")"}
552(t.timestampValue):"stringValue"in t?t.stringValue:"bytesValue"in t?fi(t.bytesValue).toBase64():"referenceValue"in t?(n=t.referenceValue,bi.fromName(n).toString()):"geoPointValue"in t?"geo("+(e=t.geoPointValue).latitude+","+e.longitude+")":"arrayValue"in t?function(t){for(var e="[",n=!0,r=0,i=t.values||[];r<i.length;r++)n?n=!1:e+=",",e+=Ai(i[r]);return e+"]"}(t.arrayValue):"mapValue"in t?function(t){for(var e="{",n=!0,r=0,i=Object.keys(t.fields||{}).sort();r<i.length;r++){var o=i[r];n?n=!1:e+=",",e+=o+":"+Ai(t.fields[o])}return e+"}"}(t.mapValue):Kr();var e,n}function ki(t,e){return{referenceValue:"projects/"+t.projectId+"/databases/"+t.database+"/documents/"+e.path.canonicalString()}}function Ni(t){return!!t&&"integerValue"in t}function Ci(t){return!!t&&"arrayValue"in t}function Ri(t){return!!t&&"nullValue"in t}function Oi(t){return!!t&&"doubleValue"in t&&isNaN(Number(t.doubleValue))}function Di(t){return!!t&&"mapValue"in t} 553/** 554 * @license 555 * Copyright 2017 Google LLC 556 * 557 * Licensed under the Apache License, Version 2.0 (the "License"); 558 * you may not use this file except in compliance with the License. 559 * You may obtain a copy of the License at 560 * 561 * http://www.apache.org/licenses/LICENSE-2.0 562 * 563 * Unless required by applicable law or agreed to in writing, software 564 * distributed under the License is distributed on an "AS IS" BASIS, 565 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 566 * See the License for the specific language governing permissions and 567 * limitations under the License. 568 */var Pi=function(){function t(t){this.overlayMap=new Map,this.partialValue=t}return t.empty=function(){return new t({mapValue:{}})},t.prototype.field=function(e){return t.extractNestedValue(this.buildProto(),e)},t.prototype.toProto=function(){return this.field(ai.emptyPath())},t.prototype.set=function(t,e){this.setOverlay(t,e)},t.prototype.setAll=function(t){var e=this;t.forEach((function(t,n){t?e.set(n,t):e.delete(n)}))},t.prototype.delete=function(t){this.setOverlay(t,null)},t.prototype.isEqual=function(t){return _i(this.buildProto(),t.buildProto())},t.prototype.setOverlay=function(t,e){for(var n=this.overlayMap,r=0;r<t.length-1;++r){var i=t.get(r),o=n.get(i);o instanceof Map?n=o:o&&10===wi(o)?(o=new Map(Object.entries(o.mapValue.fields||{})),n.set(i,o),n=o):(o=new Map,n.set(i,o),n=o)}n.set(t.lastSegment(),e)},t.prototype.applyOverlay=function(e,n){var r=this,i=!1,o=t.extractNestedValue(this.partialValue,e),a=Di(o)?Object.assign({},o.mapValue.fields):{};return n.forEach((function(t,n){if(t instanceof Map){var o=r.applyOverlay(e.child(n),t);null!=o&&(a[n]=o,i=!0)}else null!==t?(a[n]=t,i=!0):a.hasOwnProperty(n)&&(delete a[n],i=!0)})),i?{mapValue:{fields:a}}:null},t.prototype.buildProto=function(){var t=this.applyOverlay(ai.emptyPath(),this.overlayMap);return null!=t&&(this.partialValue=t,this.overlayMap.clear()),this.partialValue},t.extractNestedValue=function(t,e){if(e.isEmpty())return t;for(var n=t,r=0;r<e.length-1;++r){if(!n.mapValue.fields)return null;if(!Di(n=n.mapValue.fields[e.get(r)]))return null}return(n=(n.mapValue.fields||{})[e.lastSegment()])||null},t.prototype.clone=function(){return new t(this.buildProto())},t}();function Li(t){var e=[];return ei(t.fields||{},(function(t,n){var r=new ai([t]);if(Di(n)){var i=Li(n.mapValue).fields;if(0===i.length)e.push(r);else for(var o=0,a=i;o<a.length;o++){var s=a[o];e.push(r.child(s))}}else e.push(r)})),new si(e) 569/** 570 * @license 571 * Copyright 2017 Google LLC 572 * 573 * Licensed under the Apache License, Version 2.0 (the "License"); 574 * you may not use this file except in compliance with the License. 575 * You may obtain a copy of the License at 576 * 577 * http://www.apache.org/licenses/LICENSE-2.0 578 * 579 * Unless required by applicable law or agreed to in writing, software 580 * distributed under the License is distributed on an "AS IS" BASIS, 581 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 582 * See the License for the specific language governing permissions and 583 * limitations under the License. 584 */}var xi=function(){function t(t,e,n,r,i){this.key=t,this.documentType=e,this.version=n,this.data=r,this.documentState=i}return t.newInvalidDocument=function(e){return new t(e,0,Zr.min(),Pi.empty(),0)},t.newFoundDocument=function(e,n,r){return new t(e,1,n,r,0)},t.newNoDocument=function(e,n){return new t(e,2,n,Pi.empty(),0)},t.newUnknownDocument=function(e,n){return new t(e,3,n,Pi.empty(),2)},t.prototype.convertToFoundDocument=function(t,e){return this.version=t,this.documentType=1,this.data=e,this.documentState=0,this},t.prototype.convertToNoDocument=function(t){return this.version=t,this.documentType=2,this.data=Pi.empty(),this.documentState=0,this},t.prototype.convertToUnknownDocument=function(t){return this.version=t,this.documentType=3,this.data=Pi.empty(),this.documentState=2,this},t.prototype.setHasCommittedMutations=function(){return this.documentState=2,this},t.prototype.setHasLocalMutations=function(){return this.documentState=1,this},Object.defineProperty(t.prototype,"hasLocalMutations",{get:function(){return 1===this.documentState}
584,enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hasCommittedMutations",{get:function(){return 2===this.documentState},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hasPendingWrites",{get:function(){return this.hasLocalMutations||this.hasCommittedMutations},enumerable:!1,configurable:!0}),t.prototype.isValidDocument=function(){return 0!==this.documentType},t.prototype.isFoundDocument=function(){return 1===this.documentType},t.prototype.isNoDocument=function(){return 2===this.documentType},t.prototype.isUnknownDocument=function(){return 3===this.documentType},t.prototype.isEqual=function(e){return e instanceof t&&this.key.isEqual(e.key)&&this.version.isEqual(e.version)&&this.documentType===e.documentType&&this.documentState===e.documentState&&this.data.isEqual(e.data)},t.prototype.clone=function(){return new t(this.key,this.documentType,this.version,this.data.clone(),this.documentState)},t.prototype.toString=function(){return"Document("+this.key+", "+this.version+", "+JSON.stringify(this.data.toProto())+", {documentType: "+this.documentType+"}), {documentState: "+this.documentState+"})"},t}(),Mi=function(t,e,n,r,i,o,a){void 0===e&&(e=null),void 0===n&&(n=[]),void 0===r&&(r=[]),void 0===i&&(i=null),void 0===o&&(o=null),void 0===a&&(a=null),this.path=t,this.collectionGroup=e,this.orderBy=n,this.filters=r,this.limit=i,this.startAt=o,this.endAt=a,this.h=null}; 585/** 586 * @license 587 * Copyright 2019 Google LLC 588 * 589 * Licensed under the Apache License, Version 2.0 (the "License"); 590 * you may not use this file except in compliance with the License. 591 * You may obtain a copy of the License at 592 * 593 * http://www.apache.org/licenses/LICENSE-2.0 594 * 595 * Unless required by applicable law or agreed to in writing, software 596 * distributed under the License is distributed on an "AS IS" BASIS, 597 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 598 * See the License for the specific language governing permissions and 599 * limitations under the License. 600 */function Ui(t,e,n,r,i,o,a){return void 0===e&&(e=null),void 0===n&&(n=[]),void 0===r&&(r=[]),void 0===i&&(i=null),void 0===o&&(o=null),void 0===a&&(a=null),new Mi(t,e,n,r,i,o,a)}function Fi(t){var e=Yr(t);if(null===e.h){var n=e.path.canonicalString();null!==e.collectionGroup&&(n+="|cg:"+e.collectionGroup),n+="|f:",n+=e.filters.map((function(t){return function(t){return t.field.canonicalString()+t.op.toString()+Si(t.value)}(t)})).join(","),n+="|ob:",n+=e.orderBy.map((function(t){return function(t){return t.field.canonicalString()+t.dir}(t)})).join(","),gi(e.limit)||(n+="|l:",n+=e.limit),e.startAt&&(n+="|lb:",n+=Ji(e.startAt)),e.endAt&&(n+="|ub:",n+=Ji(e.endAt)),e.h=n}return e.h}function Vi(t,e){if(t.limit!==e.limit)return!1;if(t.orderBy.length!==e.orderBy.length)return!1;for(var n=0;n<t.orderBy.length;n++)if(!Zi(t.orderBy[n],e.orderBy[n]))return!1;if(t.filters.length!==e.filters.length)return!1;for(var r=0;r<t.filters.length;r++)if(i=t.filters[r],o=e.filters[r],i.op!==o.op||!i.field.isEqual(o.field)||!_i(i.value,o.value))return!1;var i,o;return t.collectionGroup===e.collectionGroup&&!!t.path.isEqual(e.path)&&!!eo(t.startAt,e.startAt)&&eo(t.endAt,e.endAt)}function Hi(t){return bi.isDocumentKey(t.path)&&null===t.collectionGroup&&0===t.filters.length}var ji=function(t){function e(e,n,r){var i=this;return(i=t.call(this)||this).field=e,i.op=n,i.value=r,i}return(0,Pr.C6)(e,t),e.create=function(t,n,r){return t.isKeyField()?"in"===n||"not-in"===n?this.l(t,n,r):new qi(t,n,r):"array-contains"===n?new Yi(t,r):"in"===n?new zi(t,r):"not-in"===n?new Wi(t,r):"array-contains-any"===n?new Xi(t,r):new e(t,n,r)},e.l=function(t,e,n){return"in"===e?new Bi(t,n):new Ki(t,n)},e.prototype.matches=function(t){var e=t.data.field(this.field);return"!="===this.op?null!==e&&this.m(Ei(e,this.value)):null!==e&&wi(this.value)===wi(e)&&this.m(Ei(e,this.value))},e.prototype.m=function(t){switch(this.op){case"<":return t<0;case"<=":return t<=0;case"==":return 0===t;case"!=":return 0!==t;case">":return t>0;case">=":return t>=0;default:return Kr()}},e.prototype.g=function(){return["<","<=",">",">=","!=","not-in"].indexOf(this.op)>=0},e}((function(){})),qi=function(t){function e(e,n,r){var i=this;return(i=t.call(this,e,n,r)||this).key=bi.fromName(r.referenceValue),i}return(0,Pr.C6)(e,t),e.prototype.matches=function(t){var e=bi.comparator(t.key,this.key);return this.m(e)},e}(ji),Bi=function(t){function e(e,n){var r=this;return(r=t.call(this,e,"in",n)||this).keys=Gi("in",n),r}return(0,Pr.C6)(e,t),e.prototype.matches=function(t){return this.keys.some((function(e){return e.isEqual(t.key)}))},e}(ji),Ki=function(t){function e(e,n){var r=this;return(r=t.call(this,e,"not-in",n)||this).keys=Gi("not-in",n),r}return(0,Pr.C6)(e,t),e.prototype.matches=function(t){return!this.keys.some((function(e){return e.isEqual(t.key)}))},e}(ji);function Gi(t,e){var n;return((null===(n=e.arrayValue)||void 0===n?void 0:n.values)||[]).map((function(t){return bi.fromName(t.referenceValue)}))}var Yi=function(t){function e(e,n){return t.call(this,e,"array-contains",n)||this}return(0,Pr.C6)(e,t),e.prototype.matches=function(t){var e=t.data.field(this.field);return Ci(e)&&Ii(e.arrayValue,this.value)},e}(ji),zi=function(t){function e(e,n){return t.call(this,e,"in",n)||this}return(0,Pr.C6)(e,t),e.prototype.matches=function(t){var e=t.data.field(this.field);return null!==e&&Ii(this.value.arrayValue,e)},e}(ji),Wi=function(t){function e(e,n){return t.call(this,e,"not-in",n)||this}return(0,Pr.C6)(e,t),e.prototype.matches=function(t){if(Ii(this.value.arrayValue,{nullValue:"NULL_VALUE"}))return!1;var e=t.data.field(this.field);return null!==e&&!Ii(this.value.arrayValue,e)},e}(ji),Xi=function(t){function e(e,n){return t.call(this,e,"array-contains-any",n)||this}return(0,Pr.C6)(e,t),e.prototype.matches=function(t){var e=this,n=t.data.field(this.field);
600return!(!Ci(n)||!n.arrayValue.values)&&n.arrayValue.values.some((function(t){return Ii(e.value.arrayValue,t)}))},e}(ji),Qi=function(t,e){this.position=t,this.before=e};function Ji(t){return(t.before?"b":"a")+":"+t.position.map((function(t){return Si(t)})).join(",")}var $i=function(t,e){void 0===e&&(e="asc"),this.field=t,this.dir=e};function Zi(t,e){return t.dir===e.dir&&t.field.isEqual(e.field)}function to(t,e,n){for(var r=0,i=0;i<t.position.length;i++){var o=e[i],a=t.position[i];if(r=o.field.isKeyField()?bi.comparator(bi.fromName(a.referenceValue),n.key):Ei(a,n.data.field(o.field)),"desc"===o.dir&&(r*=-1),0!==r)break}return t.before?r<=0:r<0}function eo(t,e){if(null===t)return null===e;if(null===e)return!1;if(t.before!==e.before||t.position.length!==e.position.length)return!1;for(var n=0;n<t.position.length;n++)if(!_i(t.position[n],e.position[n]))return!1;return!0} 601/** 602 * @license 603 * Copyright 2017 Google LLC 604 * 605 * Licensed under the Apache License, Version 2.0 (the "License"); 606 * you may not use this file except in compliance with the License. 607 * You may obtain a copy of the License at 608 * 609 * http://www.apache.org/licenses/LICENSE-2.0 610 * 611 * Unless required by applicable law or agreed to in writing, software 612 * distributed under the License is distributed on an "AS IS" BASIS, 613 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 614 * See the License for the specific language governing permissions and 615 * limitations under the License. 616 */var no=function(t,e,n,r,i,o,a,s){void 0===e&&(e=null),void 0===n&&(n=[]),void 0===r&&(r=[]),void 0===i&&(i=null),void 0===o&&(o="F"),void 0===a&&(a=null),void 0===s&&(s=null),this.path=t,this.collectionGroup=e,this.explicitOrderBy=n,this.filters=r,this.limit=i,this.limitType=o,this.startAt=a,this.endAt=s,this.p=null,this.T=null,this.startAt,this.endAt};function ro(t,e,n,r,i,o,a,s){return new no(t,e,n,r,i,o,a,s)}function io(t){return new no(t)}function oo(t){return!gi(t.limit)&&"F"===t.limitType}function ao(t){return!gi(t.limit)&&"L"===t.limitType}function so(t){return t.explicitOrderBy.length>0?t.explicitOrderBy[0].field:null}function uo(t){for(var e=0,n=t.filters;e<n.length;e++){var r=n[e];if(r.g())return r.field}return null}function co(t){return null!==t.collectionGroup}function ho(t){var e=Yr(t);if(null===e.p){e.p=[];var n=uo(e),r=so(e);if(null!==n&&null===r)n.isKeyField()||e.p.push(new $i(n)),e.p.push(new $i(ai.keyField(),"asc"));else{for(var i=!1,o=0,a=e.explicitOrderBy;o<a.length;o++){var s=a[o];e.p.push(s),s.field.isKeyField()&&(i=!0)}if(!i){var u=e.explicitOrderBy.length>0?e.explicitOrderBy[e.explicitOrderBy.length-1].dir:"asc";e.p.push(new $i(ai.keyField(),u))}}}return e.p}function lo(t){var e=Yr(t);if(!e.T)if("F"===e.limitType)e.T=Ui(e.path,e.collectionGroup,ho(e),e.filters,e.limit,e.startAt,e.endAt);else{for(var n=[],r=0,i=ho(e);r<i.length;r++){var o=i[r],a="desc"===o.dir?"asc":"desc";n.push(new $i(o.field,a))}var s=e.endAt?new Qi(e.endAt.position,!e.endAt.before):null,u=e.startAt?new Qi(e.startAt.position,!e.startAt.before):null;e.T=Ui(e.path,e.collectionGroup,n,e.filters,e.limit,s,u)}return e.T}function fo(t,e,n){return new no(t.path,t.collectionGroup,t.explicitOrderBy.slice(),t.filters.slice(),e,n,t.startAt,t.endAt)}function po(t,e){return Vi(lo(t),lo(e))&&t.limitType===e.limitType}function vo(t){return Fi(lo(t))+"|lt:"+t.limitType}function go(t){return"Query(target="+function(t){var e=t.path.canonicalString();return null!==t.collectionGroup&&(e+=" collectionGroup="+t.collectionGroup),t.filters.length>0&&(e+=", filters: ["+t.filters.map((function(t){return(e=t).field.canonicalString()+" "+e.op+" "+Si(e.value);var e})).join(", ")+"]"),gi(t.limit)||(e+=", limit: "+t.limit),t.orderBy.length>0&&(e+=", orderBy: ["+t.orderBy.map((function(t){return function(t){return t.field.canonicalString()+" ("+t.dir+")"}(t)})).join(", ")+"]"),t.startAt&&(e+=", startAt: "+Ji(t.startAt)),t.endAt&&(e+=", endAt: "+Ji(t.endAt)),"Target("+e+")"}(lo(t))+"; limitType="+t.limitType+")"}function mo(t,e){return e.isFoundDocument()&&function(t,e){var n=e.key.path;return null!==t.collectionGroup?e.key.hasCollectionId(t.collectionGroup)&&t.path.isPrefixOf(n):bi.isDocumentKey(t.path)?t.path.isEqual(n):t.path.isImmediateParentOf(n)}(t,e)&&function(t,e){for(var n=0,r=t.explicitOrderBy;n<r.length;n++){var i=r[n];if(!i.field.isKeyField()&&null===e.data.field(i.field))return!1}return!0}(t,e)&&function(t,e){for(var n=0,r=t.filters;n<r.length;n++)if(!r[n].matches(e))return!1;return!0}(t,e)&&function(t,e){return!(t.startAt&&!to(t.startAt,ho(t),e))&&(!t.endAt||!to(t.endAt,ho(t),e))}(t,e)}function yo(t){return function(e,n){for(var r=!1,i=0,o=ho(t);i<o.length;i++){var a=o[i],s=bo(a,e,n);if(0!==s)return s;r=r||a.field.isKeyField()}return 0}}function bo(t,e,n){var r=t.field.isKeyField()?bi.comparator(e.key,n.key):function(t,e,n){var r=e.data.field(t),i=n.data.field(t);return null!==r&&null!==i?Ei(r,i):Kr()}
616(t.field,e,n);switch(t.dir){case"asc":return r;case"desc":return-1*r;default:return Kr()}} 617/** 618 * @license 619 * Copyright 2020 Google LLC 620 * 621 * Licensed under the Apache License, Version 2.0 (the "License"); 622 * you may not use this file except in compliance with the License. 623 * You may obtain a copy of the License at 624 * 625 * http://www.apache.org/licenses/LICENSE-2.0 626 * 627 * Unless required by applicable law or agreed to in writing, software 628 * distributed under the License is distributed on an "AS IS" BASIS, 629 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 630 * See the License for the specific language governing permissions and 631 * limitations under the License. 632 */function wo(t,e){if(t.I){if(isNaN(e))return{doubleValue:"NaN"};if(e===1/0)return{doubleValue:"Infinity"};if(e===-1/0)return{doubleValue:"-Infinity"}}return{doubleValue:mi(e)?"-0":e}}function _o(t){return{integerValue:""+t}}function Io(t,e){return yi(e)?_o(e):wo(t,e)} 633/** 634 * @license 635 * Copyright 2018 Google LLC 636 * 637 * Licensed under the Apache License, Version 2.0 (the "License"); 638 * you may not use this file except in compliance with the License. 639 * You may obtain a copy of the License at 640 * 641 * http://www.apache.org/licenses/LICENSE-2.0 642 * 643 * Unless required by applicable law or agreed to in writing, software 644 * distributed under the License is distributed on an "AS IS" BASIS, 645 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 646 * See the License for the specific language governing permissions and 647 * limitations under the License. 648 */var Eo=function(){this._=void 0};function To(t,e,n){return t instanceof ko?function(t,e){var n={fields:{__type__:{stringValue:"server_timestamp"},__local_write_time__:{timestampValue:{seconds:t.seconds,nanos:t.nanoseconds}}}};return e&&(n.fields.__previous_value__=e),{mapValue:n}}(n,e):t instanceof No?Co(t,e):t instanceof Ro?Oo(t,e):function(t,e){var n=Ao(t,e),r=Po(n)+Po(t.A);return Ni(n)&&Ni(t.A)?_o(r):wo(t.R,r)}(t,e)}function So(t,e,n){return t instanceof No?Co(t,e):t instanceof Ro?Oo(t,e):n}function Ao(t,e){return t instanceof Do?Ni(n=e)||function(t){return!!t&&"doubleValue"in t}(n)?e:{integerValue:0}:null;var n}var ko=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Pr.C6)(e,t),e}(Eo),No=function(t){function e(e){var n=this;return(n=t.call(this)||this).elements=e,n}return(0,Pr.C6)(e,t),e}(Eo);function Co(t,e){for(var n=Lo(e),r=function(t){n.some((function(e){return _i(e,t)}))||n.push(t)},i=0,o=t.elements;i<o.length;i++)r(o[i]);return{arrayValue:{values:n}}}var Ro=function(t){function e(e){var n=this;return(n=t.call(this)||this).elements=e,n}return(0,Pr.C6)(e,t),e}(Eo);function Oo(t,e){for(var n=Lo(e),r=function(t){n=n.filter((function(e){return!_i(e,t)}))},i=0,o=t.elements;i<o.length;i++)r(o[i]);return{arrayValue:{values:n}}}var Do=function(t){function e(e,n){var r=this;return(r=t.call(this)||this).R=e,r.A=n,r}return(0,Pr.C6)(e,t),e}(Eo);function Po(t){return li(t.integerValue||t.doubleValue)}function Lo(t){return Ci(t)&&t.arrayValue.values?t.arrayValue.values.slice():[]} 649/** 650 * @license 651 * Copyright 2017 Google LLC 652 * 653 * Licensed under the Apache License, Version 2.0 (the "License"); 654 * you may not use this file except in compliance with the License. 655 * You may obtain a copy of the License at 656 * 657 * http://www.apache.org/licenses/LICENSE-2.0 658 * 659 * Unless required by applicable law or agreed to in writing, software 660 * distributed under the License is distributed on an "AS IS" BASIS, 661 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 662 * See the License for the specific language governing permissions and 663 * limitations under the License. 664 */var xo=function(t,e){this.field=t,this.transform=e},Mo=function(t,e){this.version=t,this.transformResults=e},Uo=function(){function t(t,e){this.updateTime=t,this.exists=e}return t.none=function(){return new t},t.exists=function(e){return new t(void 0,e)},t.updateTime=function(e){return new t(e)},Object.defineProperty(t.prototype,"isNone",{get:function(){return void 0===this.updateTime&&void 0===this.exists}
664,enumerable:!1,configurable:!0}),t.prototype.isEqual=function(t){return this.exists===t.exists&&(this.updateTime?!!t.updateTime&&this.updateTime.isEqual(t.updateTime):!t.updateTime)},t}();function Fo(t,e){return void 0!==t.updateTime?e.isFoundDocument()&&e.version.isEqual(t.updateTime):void 0===t.exists||t.exists===e.isFoundDocument()}var Vo=function(){};function Ho(t,e,n){t instanceof Go?function(t,e,n){var r=t.value.clone(),i=Wo(t.fieldTransforms,e,n.transformResults);r.setAll(i),e.convertToFoundDocument(n.version,r).setHasCommittedMutations()}(t,e,n):t instanceof Yo?function(t,e,n){if(Fo(t.precondition,e)){var r=Wo(t.fieldTransforms,e,n.transformResults),i=e.data;i.setAll(zo(t)),i.setAll(r),e.convertToFoundDocument(n.version,i).setHasCommittedMutations()}else e.convertToUnknownDocument(n.version)}(t,e,n):function(t,e,n){e.convertToNoDocument(n.version).setHasCommittedMutations()}(0,e,n)}function jo(t,e,n){t instanceof Go?function(t,e,n){if(Fo(t.precondition,e)){var r=t.value.clone(),i=Xo(t.fieldTransforms,n,e);r.setAll(i),e.convertToFoundDocument(Ko(e),r).setHasLocalMutations()}}(t,e,n):t instanceof Yo?function(t,e,n){if(Fo(t.precondition,e)){var r=Xo(t.fieldTransforms,n,e),i=e.data;i.setAll(zo(t)),i.setAll(r),e.convertToFoundDocument(Ko(e),i).setHasLocalMutations()}}(t,e,n):function(t,e){Fo(t.precondition,e)&&e.convertToNoDocument(Zr.min())}(t,e)}function qo(t,e){for(var n=null,r=0,i=t.fieldTransforms;r<i.length;r++){var o=i[r],a=e.data.field(o.field),s=Ao(o.transform,a||null);null!=s&&(null==n&&(n=Pi.empty()),n.set(o.field,s))}return n||null}function Bo(t,e){return t.type===e.type&&!!t.key.isEqual(e.key)&&!!t.precondition.isEqual(e.precondition)&&!!function(t,e){return void 0===t&&void 0===e||!(!t||!e)&&Qr(t,e,(function(t,e){return function(t,e){return t.field.isEqual(e.field)&&function(t,e){return t instanceof No&&e instanceof No||t instanceof Ro&&e instanceof Ro?Qr(t.elements,e.elements,_i):t instanceof Do&&e instanceof Do?_i(t.A,e.A):t instanceof ko&&e instanceof ko}(t.transform,e.transform)}(t,e)}))}(t.fieldTransforms,e.fieldTransforms)&&(0===t.type?t.value.isEqual(e.value):1!==t.type||t.data.isEqual(e.data)&&t.fieldMask.isEqual(e.fieldMask))}function Ko(t){return t.isFoundDocument()?t.version:Zr.min()}var Go=function(t){function e(e,n,r,i){void 0===i&&(i=[]);var o=this;return(o=t.call(this)||this).key=e,o.value=n,o.precondition=r,o.fieldTransforms=i,o.type=0,o}return(0,Pr.C6)(e,t),e}(Vo),Yo=function(t){function e(e,n,r,i,o){void 0===o&&(o=[]);var a=this;return(a=t.call(this)||this).key=e,a.data=n,a.fieldMask=r,a.precondition=i,a.fieldTransforms=o,a.type=1,a}return(0,Pr.C6)(e,t),e}(Vo);function zo(t){var e=new Map;return t.fieldMask.fields.forEach((function(n){if(!n.isEmpty()){var r=t.data.field(n);e.set(n,r)}})),e}function Wo(t,e,n){var r=new Map;Gr(t.length===n.length);for(var i=0;i<n.length;i++){var o=t[i],a=o.transform,s=e.data.field(o.field);r.set(o.field,So(a,s,n[i]))}return r}function Xo(t,e,n){for(var r=new Map,i=0,o=t;i<o.length;i++){var a=o[i],s=a.transform,u=n.data.field(a.field);r.set(a.field,To(s,u,e))}return r}var Qo,Jo,$o=function(t){function e(e,n){var r=this;return(r=t.call(this)||this).key=e,r.precondition=n,r.type=2,r.fieldTransforms=[],r}return(0,Pr.C6)(e,t),e}(Vo),Zo=function(t){function e(e,n){var r=this;return(r=t.call(this)||this).key=e,r.precondition=n,r.type=3,r.fieldTransforms=[],r}return(0,Pr.C6)(e,t),e}(Vo),ta=function(t){this.count=t};function ea(t){switch(t){case Mr.OK:return Kr();case Mr.CANCELLED:case Mr.UNKNOWN:case Mr.DEADLINE_EXCEEDED:case Mr.RESOURCE_EXHAUSTED:case Mr.INTERNAL:case Mr.UNAVAILABLE:case Mr.UNAUTHENTICATED:return!1;case Mr.INVALID_ARGUMENT:case Mr.NOT_FOUND:case Mr.ALREADY_EXISTS:case Mr.PERMISSION_DENIED:case Mr.FAILED_PRECONDITION:case Mr.ABORTED:case Mr.OUT_OF_RANGE:case Mr.UNIMPLEMENTED:case Mr.DATA_LOSS:return!0;default:return Kr()}}function na(t){if(void 0===t)return jr("GRPC error has no .code"),Mr.UNKNOWN;switch(t){case Qo.OK:return Mr.OK;case Qo.CANCELLED:return Mr.CANCELLED;case Qo.UNKNOWN:return Mr.UNKNOWN;case Qo.DEADLINE_EXCEEDED:return Mr.DEADLINE_EXCEEDED;case Qo.RESOURCE_EXHAUSTED:return Mr.RESOURCE_EXHAUSTED;case Qo.INTERNAL:return Mr.INTERNAL;case Qo.UNAVAILABLE:return Mr.UNAVAILABLE;case Qo.UNAUTHENTICATED:return Mr.UNAUTHENTICATED;case Qo.INVALID_ARGUMENT:return Mr.INVALID_ARGUMENT;case Qo.NOT_FOUND:return Mr.NOT_FOUND;case Qo.ALREADY_EXISTS:return Mr.ALREADY_EXISTS;case Qo.PERMISSION_DENIED:return Mr.PERMISSION_DENIED;case Qo.FAILED_PRECONDITION:return Mr.FAILED_PRECONDITION;case Qo.ABORTED:return Mr.ABORTED;case Qo.OUT_OF_RANGE:return Mr.OUT_OF_RANGE;
664case Qo.UNIMPLEMENTED:return Mr.UNIMPLEMENTED;case Qo.DATA_LOSS:return Mr.DATA_LOSS;default:return Kr()}}(Jo=Qo||(Qo={}))[Jo.OK=0]="OK",Jo[Jo.CANCELLED=1]="CANCELLED",Jo[Jo.UNKNOWN=2]="UNKNOWN",Jo[Jo.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",Jo[Jo.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",Jo[Jo.NOT_FOUND=5]="NOT_FOUND",Jo[Jo.ALREADY_EXISTS=6]="ALREADY_EXISTS",Jo[Jo.PERMISSION_DENIED=7]="PERMISSION_DENIED",Jo[Jo.UNAUTHENTICATED=16]="UNAUTHENTICATED",Jo[Jo.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",Jo[Jo.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",Jo[Jo.ABORTED=10]="ABORTED",Jo[Jo.OUT_OF_RANGE=11]="OUT_OF_RANGE",Jo[Jo.UNIMPLEMENTED=12]="UNIMPLEMENTED",Jo[Jo.INTERNAL=13]="INTERNAL",Jo[Jo.UNAVAILABLE=14]="UNAVAILABLE",Jo[Jo.DATA_LOSS=15]="DATA_LOSS"; 665/** 666 * @license 667 * Copyright 2017 Google LLC 668 * 669 * Licensed under the Apache License, Version 2.0 (the "License"); 670 * you may not use this file except in compliance with the License. 671 * You may obtain a copy of the License at 672 * 673 * http://www.apache.org/licenses/LICENSE-2.0 674 * 675 * Unless required by applicable law or agreed to in writing, software 676 * distributed under the License is distributed on an "AS IS" BASIS, 677 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 678 * See the License for the specific language governing permissions and 679 * limitations under the License. 680 */ 681var ra=function(){function t(t,e){this.comparator=t,this.root=e||oa.EMPTY}return t.prototype.insert=function(e,n){return new t(this.comparator,this.root.insert(e,n,this.comparator).copy(null,null,oa.BLACK,null,null))},t.prototype.remove=function(e){return new t(this.comparator,this.root.remove(e,this.comparator).copy(null,null,oa.BLACK,null,null))},t.prototype.get=function(t){for(var e=this.root;!e.isEmpty();){var n=this.comparator(t,e.key);if(0===n)return e.value;n<0?e=e.left:n>0&&(e=e.right)}return null},t.prototype.indexOf=function(t){for(var e=0,n=this.root;!n.isEmpty();){var r=this.comparator(t,n.key);if(0===r)return e+n.left.size;r<0?n=n.left:(e+=n.left.size+1,n=n.right)}return-1},t.prototype.isEmpty=function(){return this.root.isEmpty()},Object.defineProperty(t.prototype,"size",{get:function(){return this.root.size},enumerable:!1,configurable:!0}),t.prototype.minKey=function(){return this.root.minKey()},t.prototype.maxKey=function(){return this.root.maxKey()},t.prototype.inorderTraversal=function(t){return this.root.inorderTraversal(t)},t.prototype.forEach=function(t){this.inorderTraversal((function(e,n){return t(e,n),!1}))},t.prototype.toString=function(){var t=[];return this.inorderTraversal((function(e,n){return t.push(e+":"+n),!1})),"{"+t.join(", ")+"}"},t.prototype.reverseTraversal=function(t){return this.root.reverseTraversal(t)},t.prototype.getIterator=function(){return new ia(this.root,null,this.comparator,!1)},t.prototype.getIteratorFrom=function(t){return new ia(this.root,t,this.comparator,!1)},t.prototype.getReverseIterator=function(){return new ia(this.root,null,this.comparator,!0)},t.prototype.getReverseIteratorFrom=function(t){return new ia(this.root,t,this.comparator,!0)},t}(),ia=function(){function t(t,e,n,r){this.isReverse=r,this.nodeStack=[];for(var i=1;!t.isEmpty();)if(i=e?n(t.key,e):1,r&&(i*=-1),i<0)t=this.isReverse?t.left:t.right;else{if(0===i){this.nodeStack.push(t);break}this.nodeStack.push(t),t=this.isReverse?t.right:t.left}}return t.prototype.getNext=function(){var t=this.nodeStack.pop(),e={key:t.key,value:t.value};if(this.isReverse)for(t=t.left;!t.isEmpty();)this.nodeStack.push(t),t=t.right;else for(t=t.right;!t.isEmpty();)this.nodeStack.push(t),t=t.left;return e},t.prototype.hasNext=function(){return this.nodeStack.length>0},t.prototype.peek=function(){if(0===this.nodeStack.length)return null;var t=this.nodeStack[this.nodeStack.length-1];return{key:t.key,value:t.value}},t}(),oa=function(){function t(e,n,r,i,o){this.key=e,this.value=n,this.color=null!=r?r:t.RED,this.left=null!=i?i:t.EMPTY,this.right=null!=o?o:t.EMPTY,this.size=this.left.size+1+this.right.size}return t.prototype.copy=function(e,n,r,i,o){return new t(null!=e?e:this.key,null!=n?n:this.value,null!=r?r:this.color,null!=i?i:this.left,null!=o?o:this.right)},t.prototype.isEmpty=function(){return!1},t.prototype.inorderTraversal=function(t){return this.left.inorderTraversal(t)||t(this.key,this.value)||this.right.inorderTraversal(t)},t.prototype.reverseTraversal=function(t){return this.right.reverseTraversal(t)||t(this.key,this.value)||this.left.reverseTraversal(t)},t.prototype.min=function(){return this.left.isEmpty()?this:this.left.min()},t.prototype.minKey=function(){return this.min().key},t.prototype.maxKey=function(){return this.right.isEmpty()?this.key:this.right.maxKey()},t.prototype.insert=function(t,e,n){var r=this,i=n(t,r.key);return(r=i<0?r.copy(null,null,null,r.left.insert(t,e,n),null):0===i?r.copy(null,e,null,null,null):r.copy(null,null,null,null,r.right.insert(t,e,n))).fixUp()},t.prototype.removeMin=function(){if(this.left.isEmpty())return t.EMPTY;var e=this;return e.left.isRed()||e.left.left.isRed()||(e=e.moveRedLeft()),(e=e.copy(null,null,null,e.left.removeMin(),null)).fixUp()},t.prototype.remove=function(e,n){var r,i=this;if(n(e,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(e,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(e,i.key)){if(i.right.isEmpty())return t.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(e,n))}return i.fixUp()},t.prototype.isRed=function(){return this.color},t.prototype.fixUp=function(){var t=this;return t.right.isRed()&&!t.left.isRed()&&(t=t.rotateLeft()),t.left.isRed()&&t.left.left.isRed()&&(t=t.rotateRight()),t.left.isRed()&&t.right.isRed()&&(t=t.colorFlip()),t},t.prototype.moveRedLeft=function(){var t=this.colorFlip();return t.right.left.isRed()&&(t=(t=(t=t.copy(null,null,null,null,t.right.rotateRight())).rotateLeft()).colorFlip()),t},t.prototype.moveRedRight=function(){var t=this.colorFlip();return t.left.left.isRed()&&(t=(t=t.rotateRight()).colorFlip()),t},t.prototype.rotateLeft=function(){var e=this.copy(null,null,t.RED,null,this.right.left);return this.right.copy(null,null,this.color,e,null)},t.prototype.rotateRight=function(){var e=this.copy(null,null,t.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,e)},t.prototype.colorFlip=function(){var t=this.left.copy(null,null,!this.left.color,null,null),e=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,t,e)},t.prototype.checkMaxDepth=function(){var t=this.check();return Math.pow(2,t)<=this.size+1},t.prototype.check=function(){if(this.isRed()&&this.left.isRed())throw Kr();if(this.right.isRed())throw Kr();var t=this.left.check();if(t!==this.right.check())throw Kr();return t+(this.isRed()?0:1)},t}();
681oa.EMPTY=null,oa.RED=!0,oa.BLACK=!1,oa.EMPTY=new(function(){function t(){this.size=0}return Object.defineProperty(t.prototype,"key",{get:function(){throw Kr()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){throw Kr()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){throw Kr()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"left",{get:function(){throw Kr()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){throw Kr()},enumerable:!1,configurable:!0}),t.prototype.copy=function(t,e,n,r,i){return this},t.prototype.insert=function(t,e,n){return new oa(t,e)},t.prototype.remove=function(t,e){return this},t.prototype.isEmpty=function(){return!0},t.prototype.inorderTraversal=function(t){return!1},t.prototype.reverseTraversal=function(t){return!1},t.prototype.minKey=function(){return null},t.prototype.maxKey=function(){return null},t.prototype.isRed=function(){return!1},t.prototype.checkMaxDepth=function(){return!0},t.prototype.check=function(){return 0},t}()); 682/** 683 * @license 684 * Copyright 2017 Google LLC 685 * 686 * Licensed under the Apache License, Version 2.0 (the "License"); 687 * you may not use this file except in compliance with the License. 688 * You may obtain a copy of the License at 689 * 690 * http://www.apache.org/licenses/LICENSE-2.0 691 * 692 * Unless required by applicable law or agreed to in writing, software 693 * distributed under the License is distributed on an "AS IS" BASIS, 694 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 695 * See the License for the specific language governing permissions and 696 * limitations under the License. 697 */ 698var aa=function(){function t(t){this.comparator=t,this.data=new ra(this.comparator)}return t.prototype.has=function(t){return null!==this.data.get(t)},t.prototype.first=function(){return this.data.minKey()},t.prototype.last=function(){return this.data.maxKey()},Object.defineProperty(t.prototype,"size",{get:function(){return this.data.size},enumerable:!1,configurable:!0}),t.prototype.indexOf=function(t){return this.data.indexOf(t)},t.prototype.forEach=function(t){this.data.inorderTraversal((function(e,n){return t(e),!1}))},t.prototype.forEachInRange=function(t,e){for(var n=this.data.getIteratorFrom(t[0]);n.hasNext();){var r=n.getNext();if(this.comparator(r.key,t[1])>=0)return;e(r.key)}},t.prototype.forEachWhile=function(t,e){var n;for(n=void 0!==e?this.data.getIteratorFrom(e):this.data.getIterator();n.hasNext();)if(!t(n.getNext().key))return},t.prototype.firstAfterOrEqual=function(t){var e=this.data.getIteratorFrom(t);return e.hasNext()?e.getNext().key:null},t.prototype.getIterator=function(){return new sa(this.data.getIterator())},t.prototype.getIteratorFrom=function(t){return new sa(this.data.getIteratorFrom(t))},t.prototype.add=function(t){return this.copy(this.data.remove(t).insert(t,!0))},t.prototype.delete=function(t){return this.has(t)?this.copy(this.data.remove(t)):this},t.prototype.isEmpty=function(){return this.data.isEmpty()},t.prototype.unionWith=function(t){var e=this;return e.size<t.size&&(e=t,t=this),t.forEach((function(t){e=e.add(t)})),e},t.prototype.isEqual=function(e){if(!(e instanceof t))return!1;if(this.size!==e.size)return!1;for(var n=this.data.getIterator(),r=e.data.getIterator();n.hasNext();){var i=n.getNext().key,o=r.getNext().key;if(0!==this.comparator(i,o))return!1}return!0},t.prototype.toArray=function(){var t=[];return this.forEach((function(e){t.push(e)})),t},t.prototype.toString=function(){var t=[];return this.forEach((function(e){return t.push(e)})),"SortedSet("+t.toString()+")"},t.prototype.copy=function(e){var n=new t(this.comparator);return n.data=e,n},t}(),sa=function(){function t(t){this.iter=t}return t.prototype.getNext=function(){return this.iter.getNext().key},t.prototype.hasNext=function(){return this.iter.hasNext()},t}(),ua=new ra(bi.comparator);function ca(){return ua}var ha=new ra(bi.comparator);function la(){return ha}var fa=new ra(bi.comparator);function pa(){return fa}var da=new aa(bi.comparator);function va(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];
698for(var n=da,r=0,i=t;r<i.length;r++){var o=i[r];n=n.add(o)}return n}var ga=new aa(Xr);function ma(){return ga} 699/** 700 * @license 701 * Copyright 2017 Google LLC 702 * 703 * Licensed under the Apache License, Version 2.0 (the "License"); 704 * you may not use this file except in compliance with the License. 705 * You may obtain a copy of the License at 706 * 707 * http://www.apache.org/licenses/LICENSE-2.0 708 * 709 * Unless required by applicable law or agreed to in writing, software 710 * distributed under the License is distributed on an "AS IS" BASIS, 711 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 712 * See the License for the specific language governing permissions and 713 * limitations under the License. 714 */var ya=function(){function t(t,e,n,r,i){this.snapshotVersion=t,this.targetChanges=e,this.targetMismatches=n,this.documentUpdates=r,this.resolvedLimboDocuments=i}return t.createSynthesizedRemoteEventForCurrentChange=function(e,n){var r=new Map;return r.set(e,ba.createSynthesizedTargetChangeForCurrentChange(e,n)),new t(Zr.min(),r,ma(),ca(),va())},t}(),ba=function(){function t(t,e,n,r,i){this.resumeToken=t,this.current=e,this.addedDocuments=n,this.modifiedDocuments=r,this.removedDocuments=i}return t.createSynthesizedTargetChangeForCurrentChange=function(e,n){return new t(ui.EMPTY_BYTE_STRING,n,va(),va(),va())},t}(),wa=function(t,e,n,r){this.v=t,this.removedTargetIds=e,this.key=n,this.P=r},_a=function(t,e){this.targetId=t,this.V=e},Ia=function(t,e,n,r){void 0===n&&(n=ui.EMPTY_BYTE_STRING),void 0===r&&(r=null),this.state=t,this.targetIds=e,this.resumeToken=n,this.cause=r},Ea=function(){function t(){this.S=0,this.D=Aa(),this.C=ui.EMPTY_BYTE_STRING,this.N=!1,this.F=!0}return Object.defineProperty(t.prototype,"current",{get:function(){return this.N},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"resumeToken",{get:function(){return this.C},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"k",{get:function(){return 0!==this.S},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"O",{get:function(){return this.F},enumerable:!1,configurable:!0}),t.prototype.$=function(t){t.approximateByteSize()>0&&(this.F=!0,this.C=t)},t.prototype.M=function(){var t=va(),e=va(),n=va();return this.D.forEach((function(r,i){switch(i){case 0:t=t.add(r);break;case 2:e=e.add(r);break;case 1:n=n.add(r);break;default:Kr()}})),new ba(this.C,this.N,t,e,n)},t.prototype.L=function(){this.F=!1,this.D=Aa()},t.prototype.B=function(t,e){this.F=!0,this.D=this.D.insert(t,e)},t.prototype.q=function(t){this.F=!0,this.D=this.D.remove(t)},t.prototype.U=function(){this.S+=1},t.prototype.K=function(){this.S-=1},t.prototype.j=function(){this.F=!0,this.N=!0},t}(),Ta=function(){function t(t){this.W=t,this.G=new Map,this.H=ca(),this.J=Sa(),this.Y=new aa(Xr)}return t.prototype.X=function(t){for(var e=0,n=t.v;e<n.length;e++){var r=n[e];t.P&&t.P.isFoundDocument()?this.Z(r,t.P):this.tt(r,t.key,t.P)}for(var i=0,o=t.removedTargetIds;i<o.length;i++)r=o[i],this.tt(r,t.key,t.P)},t.prototype.et=function(t){var e=this;this.forEachTarget(t,(function(n){var r=e.nt(n);switch(t.state){case 0:e.st(n)&&r.$(t.resumeToken);break;case 1:r.K(),r.k||r.L(),r.$(t.resumeToken);break;case 2:r.K(),r.k||e.removeTarget(n);break;case 3:e.st(n)&&(r.j(),r.$(t.resumeToken));break;case 4:e.st(n)&&(e.it(n),r.$(t.resumeToken));break;default:Kr()}}))},t.prototype.forEachTarget=function(t,e){var n=this;t.targetIds.length>
7140?t.targetIds.forEach(e):this.G.forEach((function(t,r){n.st(r)&&e(r)}))},t.prototype.rt=function(t){var e=t.targetId,n=t.V.count,r=this.ot(e);if(r){var i=r.target;if(Hi(i))if(0===n){var o=new bi(i.path);this.tt(e,o,xi.newNoDocument(o,Zr.min()))}else Gr(1===n);else this.ct(e)!==n&&(this.it(e),this.Y=this.Y.add(e))}},t.prototype.ut=function(t){var e=this,n=new Map;this.G.forEach((function(r,i){var o=e.ot(i);if(o){if(r.current&&Hi(o.target)){var a=new bi(o.target.path);null!==e.H.get(a)||e.at(i,a)||e.tt(i,a,xi.newNoDocument(a,t))}r.O&&(n.set(i,r.M()),r.L())}}));var r=va();this.J.forEach((function(t,n){var i=!0;n.forEachWhile((function(t){var n=e.ot(t);return!n||2===n.purpose||(i=!1,!1)})),i&&(r=r.add(t))}));var i=new ya(t,n,this.Y,this.H,r);return this.H=ca(),this.J=Sa(),this.Y=new aa(Xr),i},t.prototype.Z=function(t,e){if(this.st(t)){var n=this.at(t,e.key)?2:0;this.nt(t).B(e.key,n),this.H=this.H.insert(e.key,e),this.J=this.J.insert(e.key,this.ht(e.key).add(t))}},t.prototype.tt=function(t,e,n){if(this.st(t)){var r=this.nt(t);this.at(t,e)?r.B(e,1):r.q(e),this.J=this.J.insert(e,this.ht(e).delete(t)),n&&(this.H=this.H.insert(e,n))}},t.prototype.removeTarget=function(t){this.G.delete(t)},t.prototype.ct=function(t){var e=this.nt(t).M();return this.W.getRemoteKeysForTarget(t).size+e.addedDocuments.size-e.removedDocuments.size},t.prototype.U=function(t){this.nt(t).U()},t.prototype.nt=function(t){var e=this.G.get(t);return e||(e=new Ea,this.G.set(t,e)),e},t.prototype.ht=function(t){var e=this.J.get(t);return e||(e=new aa(Xr),this.J=this.J.insert(t,e)),e},t.prototype.st=function(t){var e=null!==this.ot(t);return e||Hr("WatchChangeAggregator","Detected inactive target",t),e},t.prototype.ot=function(t){var e=this.G.get(t);return e&&e.k?null:this.W.lt(t)},t.prototype.it=function(t){var e=this;this.G.set(t,new Ea),this.W.getRemoteKeysForTarget(t).forEach((function(n){e.tt(t,n,null)}))},t.prototype.at=function(t,e){return this.W.getRemoteKeysForTarget(t).has(e)},t}();function Sa(){return new ra(bi.comparator)}function Aa(){return new ra(bi.comparator)} 715/** 716 * @license 717 * Copyright 2017 Google LLC 718 * 719 * Licensed under the Apache License, Version 2.0 (the "License"); 720 * you may not use this file except in compliance with the License. 721 * You may obtain a copy of the License at 722 * 723 * http://www.apache.org/licenses/LICENSE-2.0 724 * 725 * Unless required by applicable law or agreed to in writing, software 726 * distributed under the License is distributed on an "AS IS" BASIS, 727 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 728 * See the License for the specific language governing permissions and 729 * limitations under the License. 730 */var ka={asc:"ASCENDING",desc:"DESCENDING"},Na={"<":"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"},Ca=function(t,e){this.databaseId=t,this.I=e};function Ra(t,e){return t.I?new Date(1e3*e.seconds).toISOString().replace(/\.\d*/,"").replace("Z","")+"."+("000000000"+e.nanoseconds).slice(-9)+"Z":{seconds:""+e.seconds,nanos:e.nanoseconds}}function Oa(t,e){return t.I?e.toBase64():e.toUint8Array()}function Da(t,e){return Ra(t,e.toTimestamp())}function Pa(t){return Gr(!!t),Zr.fromTimestamp(function(t){var e=hi(t);return new $r(e.seconds,e.nanos)}(t))}function La(t,e){return function(t){return new ii(["projects",t.projectId,"databases",t.database])}(t).child("documents").child(e).canonicalString()}function xa(t){var e=ii.fromString(t);return Gr(os(e)),e}function Ma(t,e){return La(t.databaseId,e.path)}function Ua(t,e){var n=xa(e);if(n.get(1)!==t.databaseId.projectId)throw new Ur(Mr.INVALID_ARGUMENT,"Tried to deserialize key from different project: "+n.get(1)+" vs "+t.databaseId.projectId);if(n.get(3)!==t.databaseId.database)throw new Ur(Mr.INVALID_ARGUMENT,"Tried to deserialize key from different database: "+n.get(3)+" vs "+t.databaseId.database);return new bi(ja(n))}function Fa(t,e){return La(t.databaseId,e)}function Va(t){var e=xa(t);
730return 4===e.length?ii.emptyPath():ja(e)}function Ha(t){return new ii(["projects",t.databaseId.projectId,"databases",t.databaseId.database]).canonicalString()}function ja(t){return Gr(t.length>4&&"documents"===t.get(4)),t.popFirst(5)}function qa(t,e,n){return{name:Ma(t,e),fields:n.toProto().mapValue.fields}}function Ba(t,e,n){var r=Ua(t,e.name),i=Pa(e.updateTime),o=new Pi({mapValue:{fields:e.fields}}),a=xi.newFoundDocument(r,i,o);return n&&a.setHasCommittedMutations(),n?a.setHasCommittedMutations():a}function Ka(t,e){var n;if(e instanceof Go)n={update:qa(t,e.key,e.value)};else if(e instanceof $o)n={delete:Ma(t,e.key)};else if(e instanceof Yo)n={update:qa(t,e.key,e.data),updateMask:is(e.fieldMask)};else{if(!(e instanceof Zo))return Kr();n={verify:Ma(t,e.key)}}return e.fieldTransforms.length>0&&(n.updateTransforms=e.fieldTransforms.map((function(t){return function(t,e){var n=e.transform;if(n instanceof ko)return{fieldPath:e.field.canonicalString(),setToServerValue:"REQUEST_TIME"};if(n instanceof No)return{fieldPath:e.field.canonicalString(),appendMissingElements:{values:n.elements}};if(n instanceof Ro)return{fieldPath:e.field.canonicalString(),removeAllFromArray:{values:n.elements}};if(n instanceof Do)return{fieldPath:e.field.canonicalString(),increment:n.A};throw Kr()}(0,t)}))),e.precondition.isNone||(n.currentDocument=function(t,e){return void 0!==e.updateTime?{updateTime:Da(t,e.updateTime)}:void 0!==e.exists?{exists:e.exists}:Kr()}(t,e.precondition)),n}function Ga(t,e){var n=e.currentDocument?function(t){return void 0!==t.updateTime?Uo.updateTime(Pa(t.updateTime)):void 0!==t.exists?Uo.exists(t.exists):Uo.none()}(e.currentDocument):Uo.none(),r=e.updateTransforms?e.updateTransforms.map((function(e){return function(t,e){var n=null;if("setToServerValue"in e)Gr("REQUEST_TIME"===e.setToServerValue),n=new ko;else if("appendMissingElements"in e){var r=e.appendMissingElements.values||[];n=new No(r)}else if("removeAllFromArray"in e){var i=e.removeAllFromArray.values||[];n=new Ro(i)}else"increment"in e?n=new Do(t,e.increment):Kr();var o=ai.fromServerFormat(e.fieldPath);return new xo(o,n)}(t,e)})):[];if(e.update){e.update.name;var i=Ua(t,e.update.name),o=new Pi({mapValue:{fields:e.update.fields}});if(e.updateMask){var a=function(t){var e=t.fieldPaths||[];return new si(e.map((function(t){return ai.fromServerFormat(t)})))}(e.updateMask);return new Yo(i,o,a,n,r)}return new Go(i,o,n,r)}if(e.delete){var s=Ua(t,e.delete);return new $o(s,n)}if(e.verify){var u=Ua(t,e.verify);return new Zo(u,n)}return Kr()}function Ya(t,e){return{documents:[Fa(t,e.path)]}}function za(t,e){var n={structuredQuery:{}},r=e.path;null!==e.collectionGroup?(n.parent=Fa(t,r),n.structuredQuery.from=[{collectionId:e.collectionGroup,allDescendants:!0}]):(n.parent=Fa(t,r.popLast()),n.structuredQuery.from=[{collectionId:r.lastSegment()}]);var i=function(t){if(0!==t.length){var e=t.map((function(t){return function(t){if("=="===t.op){if(Oi(t.value))return{unaryFilter:{field:ts(t.field),op:"IS_NAN"}};if(Ri(t.value))return{unaryFilter:{field:ts(t.field),op:"IS_NULL"}}}else if("!="===t.op){if(Oi(t.value))return{unaryFilter:{field:ts(t.field),op:"IS_NOT_NAN"}};if(Ri(t.value))return{unaryFilter:{field:ts(t.field),op:"IS_NOT_NULL"}}}return{fieldFilter:{field:ts(t.field),op:Za(t.op),value:t.value}}}(t)}));return 1===e.length?e[0]:{compositeFilter:{op:"AND",filters:e}}}}(e.filters);i&&(n.structuredQuery.where=i);var o=function(t){if(0!==t.length)return t.map((function(t){return function(t){return{field:ts(t.field),direction:$a(t.dir)}}(t)}))}(e.orderBy);o&&(n.structuredQuery.orderBy=o);var a=function(t,e){return t.I||gi(e)?e:{value:e}}(t,e.limit);return null!==a&&(n.structuredQuery.limit=a),e.startAt&&(n.structuredQuery.startAt=Qa(e.startAt)),e.endAt&&(n.structuredQuery.endAt=Qa(e.endAt)),n}function Wa(t){var e=Va(t.parent),n=t.structuredQuery,r=n.from?n.from.length:0,i=null;if(r>0){Gr(1===r);var o=n.from[0];o.allDescendants?i=o.collectionId:e=e.child(o.collectionId)}var a=[];n.where&&(a=Xa(n.where));var s=[];n.orderBy&&(s=n.orderBy.map((function(t){return function(t){return new $i(es(t.field),function(t){switch(t){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}}(t.direction))}(t)})));var u=null;n.limit&&(u=function(t){var e;return gi(e="object"==typeof t?t.value:t)?null:e}(n.limit));var c=null;n.startAt&&(c=Ja(n.startAt));var h=null;return n.endAt&&(h=Ja(n.endAt)),ro(e,i,s,a,u,"F",c,h)}function Xa(t){return t?void 0!==t.unaryFilter?[rs(t)]:void 0!==t.fieldFilter?[ns(t)]:void 0!==t.compositeFilter?t.compositeFilter.filters.map((function(t){return Xa(t)})).reduce((function(t,e){return t.concat(e)})):Kr():[]}function Qa(t){return{before:t.before,values:t.position}}function Ja(t){var e=!!t.before,n=t.values||[];return new Qi(n,e)}function $a(t){return ka[t]}function Za(t){return Na[t]}function ts(t){return{fieldPath:t.canonicalString()}}function es(t){return ai.fromServerFormat(t.fieldPath)}function ns(t){return ji.create(es(t.fieldFilter.field),function(t){switch(t){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 Kr()}}(t.fieldFilter.op),t.fieldFilter.value)}function rs(t){switch(t.unaryFilter.op){case"IS_NAN":var e=es(t.unaryFilter.field);return ji.create(e,"==",{doubleValue:NaN});case"IS_NULL":var n=es(t.unaryFilter.field);return ji.create(n,"==",{nullValue:"NULL_VALUE"});
730case"IS_NOT_NAN":var r=es(t.unaryFilter.field);return ji.create(r,"!=",{doubleValue:NaN});case"IS_NOT_NULL":var i=es(t.unaryFilter.field);return ji.create(i,"!=",{nullValue:"NULL_VALUE"});case"OPERATOR_UNSPECIFIED":default:return Kr()}}function is(t){var e=[];return t.fields.forEach((function(t){return e.push(t.canonicalString())})),{fieldPaths:e}}function os(t){return t.length>=4&&"projects"===t.get(0)&&"databases"===t.get(2)} 731/** 732 * @license 733 * Copyright 2017 Google LLC 734 * 735 * Licensed under the Apache License, Version 2.0 (the "License"); 736 * you may not use this file except in compliance with the License. 737 * You may obtain a copy of the License at 738 * 739 * http://www.apache.org/licenses/LICENSE-2.0 740 * 741 * Unless required by applicable law or agreed to in writing, software 742 * distributed under the License is distributed on an "AS IS" BASIS, 743 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 744 * See the License for the specific language governing permissions and 745 * limitations under the License. 746 */function as(t){for(var e="",n=0;n<t.length;n++)e.length>0&&(e=us(e)),e=ss(t.get(n),e);return us(e)}function ss(t,e){for(var n=e,r=t.length,i=0;i<r;i++){var o=t.charAt(i);switch(o){case"\0":n+="��";break;case"�":n+="��";break;default:n+=o}}return n}function us(t){return t+"��"}function cs(t){var e=t.length;if(Gr(e>=2),2===e)return Gr("�"===t.charAt(0)&&"�"===t.charAt(1)),ii.emptyPath();for(var n=e-2,r=[],i="",o=0;o<e;){var a=t.indexOf("�",o);switch((a<0||a>n)&&Kr(),t.charAt(a+1)){case"�":var s=t.substring(o,a),u=void 0;0===i.length?u=s:(u=i+=s,i=""),r.push(u);break;case"�":i+=t.substring(o,a),i+="\0";break;case"�":i+=t.substring(o,a+1);break;default:Kr()}o=a+2}return new ii(r)} 747/** 748 * @license 749 * Copyright 2017 Google LLC 750 * 751 * Licensed under the Apache License, Version 2.0 (the "License"); 752 * you may not use this file except in compliance with the License. 753 * You may obtain a copy of the License at 754 * 755 * http://www.apache.org/licenses/LICENSE-2.0 756 * 757 * Unless required by applicable law or agreed to in writing, software 758 * distributed under the License is distributed on an "AS IS" BASIS, 759 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 760 * See the License for the specific language governing permissions and 761 * limitations under the License. 762 */var hs=function(t,e){this.seconds=t,this.nanoseconds=e},ls=function(t,e,n){this.ownerId=t,this.allowTabSynchronization=e,this.leaseTimestampMs=n};ls.store="owner",ls.key="owner";var fs=function(t,e,n){this.userId=t,this.lastAcknowledgedBatchId=e,this.lastStreamToken=n};fs.store="mutationQueues",fs.keyPath="userId";var ps=function(t,e,n,r,i){this.userId=t,this.batchId=e,this.localWriteTimeMs=n,this.baseMutations=r,this.mutations=i};ps.store="mutations",ps.keyPath="batchId",ps.userMutationsIndex="userMutationsIndex",ps.userMutationsKeyPath=["userId","batchId"];var ds=function(){function t(){}return t.prefixForUser=function(t){return[t]},t.prefixForPath=function(t,e){return[t,as(e)]},t.key=function(t,e,n){return[t,as(e),n]},t}();ds.store="documentMutations",ds.PLACEHOLDER=new ds;var vs=function(t,e){this.path=t,this.readTime=e},gs=function(t,e){this.path=t,this.version=e},ms=function(t,e,n,r,i,o){this.unknownDocument=t,this.noDocument=e,this.document=n,this.hasCommittedMutations=r,this.readTime=i,this.parentPath=o};ms.store="remoteDocuments",ms.readTimeIndex="readTimeIndex",ms.readTimeIndexPath="readTime",ms.collectionReadTimeIndex="collectionReadTimeIndex",ms.collectionReadTimeIndexPath=["parentPath","readTime"];var ys=function(t){this.byteSize=t};ys.store="remoteDocumentGlobal",ys.key="remoteDocumentGlobalKey";var bs=function(t,e,n,r,i,o,a){this.targetId=t,this.canonicalId=e,this.readTime=n,this.resumeToken=r,this.lastListenSequenceNumber=i,this.lastLimboFreeSnapshotVersion=o,this.query=a};bs.store="targets",bs.keyPath="targetId",bs.queryTargetsIndexName="queryTargetsIndex",bs.queryTargetsKeyPath=["canonicalId","targetId"];var ws=function(t,e,n){this.targetId=t,this.path=e,this.sequenceNumber=n};ws.store="targetDocuments",ws.keyPath=["targetId","path"],ws.documentTargetsIndex="documentTargetsIndex",ws.documentTargetsKeyPath=["path","targetId"];var _s=function(t,e,n,r){this.highestTargetId=t,this.highestListenSequenceNumber=e,this.lastRemoteSnapshotVersion=n,this.targetCount=r};_s.key="targetGlobalKey",_s.store="targetGlobal";var Is=function(t,e){this.collectionId=t,this.parent=e};Is.store="collectionParents",Is.keyPath=["collectionId","parent"];var Es=function(t,e,n,r){this.clientId=t,this.updateTimeMs=e,this.networkEnabled=n,this.inForeground=r};Es.store="clientMetadata",Es.keyPath="clientId";var Ts=function(t,e,n){this.bundleId=t,this.createTime=e,this.version=n};Ts.store="bundles",Ts.keyPath="bundleId";var Ss=function(t,e,n){this.name=t,this.readTime=e,this.bundledQuery=n};Ss.store="namedQueries",Ss.keyPath="name";var As=(0,Pr.fX)((0,Pr.fX)([],(0,Pr.fX)((0,Pr.fX)([],(0,Pr.fX)((0,Pr.fX)([],(0,Pr.fX)((0,Pr.fX)([],[fs.store,ps.store,ds.store,ms.store,bs.store,ls.store,_s.store,ws.store]),[Es.store])),[ys.store])),[Is.store])),[Ts.store,Ss.store]),ks="The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.",Ns=function(){function t(){this.onCommittedListeners=[]}return t.prototype.addOnCommittedListener=function(t){this.onCommittedListeners.push(t)},t.prototype.raiseOnCommittedEvent=function(){this.onCommittedListeners.forEac
762h((function(t){return t()}))},t}(),Cs=function(){var t=this;this.promise=new Promise((function(e,n){t.resolve=e,t.reject=n}))},Rs=function(){function t(t){var e=this;this.nextCallback=null,this.catchCallback=null,this.result=void 0,this.error=void 0,this.isDone=!1,this.callbackAttached=!1,t((function(t){e.isDone=!0,e.result=t,e.nextCallback&&e.nextCallback(t)}),(function(t){e.isDone=!0,e.error=t,e.catchCallback&&e.catchCallback(t)}))}return t.prototype.catch=function(t){return this.next(void 0,t)},t.prototype.next=function(e,n){var r=this;return this.callbackAttached&&Kr(),this.callbackAttached=!0,this.isDone?this.error?this.wrapFailure(n,this.error):this.wrapSuccess(e,this.result):new t((function(t,i){r.nextCallback=function(n){r.wrapSuccess(e,n).next(t,i)},r.catchCallback=function(e){r.wrapFailure(n,e).next(t,i)}}))},t.prototype.toPromise=function(){var t=this;return new Promise((function(e,n){t.next(e,n)}))},t.prototype.wrapUserFunction=function(e){try{var n=e();return n instanceof t?n:t.resolve(n)}catch(e){return t.reject(e)}},t.prototype.wrapSuccess=function(e,n){return e?this.wrapUserFunction((function(){return e(n)})):t.resolve(n)},t.prototype.wrapFailure=function(e,n){return e?this.wrapUserFunction((function(){return e(n)})):t.reject(n)},t.resolve=function(e){return new t((function(t,n){t(e)}))},t.reject=function(e){return new t((function(t,n){n(e)}))},t.waitFor=function(e){return new t((function(t,n){var r=0,i=0,o=!1;e.forEach((function(e){++r,e.next((function(){++i,o&&i===r&&t()}),(function(t){return n(t)}))})),o=!0,i===r&&t()}))},t.or=function(e){for(var n=t.resolve(!1),r=function(e){n=n.next((function(n){return n?t.resolve(n):e()}))},i=0,o=e;i<o.length;i++)r(o[i]);return n},t.forEach=function(t,e){var n=this,r=[];return t.forEach((function(t,i){r.push(e.call(n,t,i))})),this.waitFor(r)},t}(),Os=function(){function t(t,e){var n=this;this.action=t,this.transaction=e,this.aborted=!1,this.ft=new Cs,this.transaction.oncomplete=function(){n.ft.resolve()},this.transaction.onabort=function(){e.error?n.ft.reject(new Ls(t,e.error)):n.ft.resolve()},this.transaction.onerror=function(e){var r=Vs(e.target.error);n.ft.reject(new Ls(t,r))}}return t.open=function(e,n,r,i){try{return new t(n,e.transaction(i,r))}catch(e){throw new Ls(n,e)}},Object.defineProperty(t.prototype,"dt",{get:function(){return this.ft.promise},enumerable:!1,configurable:!0}),t.prototype.abort=function(t){t&&this.ft.reject(t),this.aborted||(Hr("SimpleDb","Aborting transaction:",t?t.message:"Client-initiated abort"),this.aborted=!0,this.transaction.abort())},t.prototype.store=function(t){var e=this.transaction.objectStore(t);return new Ms(e)},t}(),Ds=function(){function t(e,n,r){this.name=e,this.version=n,this.wt=r,12.2===t._t((0,i.ZQ)())&&jr("Firestore persistence suffers from a bug in iOS 12.2 Safari that may cause your app to stop working. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.")}return t.delete=function(t){return Hr("SimpleDb","Removing database:",t),Us(window.indexedDB.deleteDatabase(t)).toPromise()},t.yt=function(){if("undefined"==typeof indexedDB)return!1;if(t.gt())return!0;var e=(0,i.ZQ)(),n=t._t(e),r=0<n&&n<10,o=t.Et(e),a=0<o&&o<4.5;return!(e.indexOf("MSIE ")>0||e.indexOf("Trident/")>0||e.indexOf("Edge/")>0||r||a)},t.gt=function(){var t;return"undefined"!=typeof Lr&&"YES"===(null===(t={NODE_ENV:"production",VUE_APP_ENVIRONMENT:"production",VUE_APP_URL:"https://my.carbmanager.com",VUE_APP_IMGPROXY_BASE_URL:"https://images.carbmanager.com",VUE_APP_IMGPROXY_KEY:"9c387519858ff7d16338211e7152183aecd6444cb096e6bf4a5b2eccd9f6b39bfa4f25a3d18ee87d0a03160c1b78dc9664ad6ee1adb137023de60c3bcb54ba77",VUE_APP_IMGPROXY_SALT:"1e3494796f916d97f004d1682b6e1d3316970d65d918c3f6ec869f1351c25be5a88d28f5d3f0f357c48809e33e45a0515592abadb3acc804a083f62bf8fabe32",VUE_APP_LEGACY_FIREBASE_PROJECT_ID:"ncache-5793d",VUE_APP_FIREBASE_PROJECT_ID:"cm-prod-c42cc",VUE_APP_FIREBASE_API_KEY:"AIzaSyDva3kICCWqfvjfVm6JB4u42dt2en_WCXk",VUE_APP_FIREBASE_CUSTOM_AUTH_DOMAIN:"auth.carbmanager.com",VUE_APP_AUTH_FIREBASE_API_KEY:"AIzaSyCHuIKyY6UH0i0lNuKFMZlCQU3eOXrYqQM",VUE_APP_FIREBASE_AUTH_URL:"https://identitytoolkit.googleapis.com",VUE_APP_FIREBASE_APP_ID:"1:430233217236:web:a1d524a322ce3e48753341",VUE_APP_FIREBASE_MESSAGE_SENDER_ID:"430233217236",VUE_APP_CLOUD_FUNCTIONS_URL:"https://us-central1-cm-prod-c42cc.cloudfunctions.net",VUE_APP_CLOUD_FUNCTIONS_CDN_URL:"https://functions.carbmanager.com",VUE_APP_ALGOLIA_APP_ID:"BVGS90AOKU",VUE_APP_ALGOLIA_API_KEY:"83cde161da8f15c16a42c8a431de91e1",VUE_APP_ALGOLIA_INDEX:"prod_foods",VUE_APP_ALGOLIA_INDEX_GROUPS:"prod_groups",VUE_APP_ALGOLIA_INDEX_FOOD_QUERY_SUGGESTIONS:"prod_foods_query_suggestions_static",VUE_APP_FOOD_QUERY_SUGGESTIONS_ALGOLIA_API_KEY:"83cde161da8f15c16a42c8a431de91e1",VUE_APP_FITBIT_CLIENT_ID:"22CVZC",VUE_APP_WEB_GOOGLE_CLIENT_ID:"430233217236-lsag40cfvvoiu1057gf9eq6t8elv03tu.apps.googleusercontent.com",VUE_APP_ANDROID_GOOGLE_CLIENT_ID:"430233217236-r96lkmovnte6nj7d3dql6p47ld30j4vu.a
762pps.googleusercontent.com",VUE_APP_IOS_GOOGLE_CLIENT_ID:"430233217236-7lqtp3i2uh3ro3ud8hfu1cvvakjj9ncs.apps.googleusercontent.com",VUE_APP_SERVICE_WORKER:"enabled",VUE_APP_FASTSPRING_STOREFRONT:"carbmanager.onfastspring.com/popup-carbmanager",VUE_APP_FASTSPRING_STOREFRONT_WEB_CHECKOUT:"carbmanager.onfastspring.com/popup-web-checkout",VUE_APP_PRISMIC_REPOSITORY:"https://app.cms.carbmanager.com",VUE_APP_PRISMIC_CDN_URL:"https://images.prismic.io/",VUE_APP_PRISMIC_CDN_PROXY_URL:"https://assets.cms.carbmanager.com/",VUE_APP_DEV_LOGGING_ENABLED:"false",VUE_APP_EVENT_TRACKING_ENABLED:"true",VUE_APP_RUDDERSTACK_DATA_PLANE_URI:"https://data.carbmanager.com/",VUE_APP_RUDDERSTACK_JS_WRITE_KEY:"2p9lRfjC2OJHUWVoNV4faAYBmJf",VUE_APP_GOOGLE_PLAY_SUBSCRIPTION_URL:"https://play.google.com/store/account/subscriptions",VUE_APP_IOS_APP_STORE_SUBSCRIPTION_URL:"https://apps.apple.com/account/subscriptions",VUE_APP_HCAPTCHA_SITE_KEY:"f3cf07b6-fa8d-4dcd-b0f5-30075dd86de5",VUE_APP_GOOGLE_PLAY_APP_URL:"https://play.google.com/store/apps/details?id=com.wombatapps.carbmanager&hl=en_US",VUE_APP_IOS_APP_STORE_APP_URL:"https://apps.apple.com/us/app/carb-manager-keto-diet-app/id410089731",VUE_APP_INTERCOM_APP_ID:"qw9brbs8",VUE_APP_STORAGE_BUCKET_ID:"assets.carbmanager.com",VUE_APP_STORAGE_BUCKET_URL:"https://assets.carbmanager.com",VUE_APP_STATIC_STORAGE_BUCKET_ID:"assets.carbmanager.com",VUE_APP_STATIC_STORAGE_BUCKET_URL:"https://assets.carbmanager.com",VUE_APP_BUGSNAG_SRCMAP_UPLOAD_ENABLED:"true",VUE_APP_CM_RECIPE_WRITER_ID:"4gd2RhEZj3cFGSJX5nb8EC4NZ0D2",VUE_APP_KETO_MOJO_CLIENT_ID:"8xYpi15fRyG6cFsY7GKFO2pI",VUE_APP_KETO_MOJO_AUTHORIZE_URL:"https://auth.us.mymojohealth.com/oauth/authorize",VUE_APP_KETO_MOJO_PROMO_URL:"https://keto-mojo.com/bluetooth-app-connection/",VUE_APP_TYPEFORM_FOOD_VERIFICATION_URL:"https://carbmanager.typeform.com/verify-food",VUE_APP_ALLOWED_EMAIL_TO_DISABLE_FOOD_CACHE:"[email protected]",VUE_APP_PX_TO_REM_ENABLED:"true",VUE_APP_COOKIE_PRO_SCRIPT_ID:"34add76b-5c86-4b9b-91d4-1588de47988f",BASE_URL:"/",BUILD_COMMIT_HASH:"4294152"})||void 0===t?void 0:t.Tt)},t.It=function(t,e){return t.store(e)},t._t=function(t){var e=t.match(/i(?:phone|pad|pod) os ([\d_]+)/i),n=e?e[1].split("_").slice(0,2).join("."):"-1";return Number(n)},t.Et=function(t){var e=t.match(/Android ([\d.]+)/i),n=e?e[1].split(".").slice(0,2).join("."):"-1";return Number(n)},t.prototype.At=function(t){return(0,Pr.sH)(this,void 0,void 0,(function(){var e,n=this;return(0,Pr.YH)(this,(function(r){switch(r.label){case 0:return this.db?[3,2]:(Hr("SimpleDb","Opening database:",this.name),e=this,[4,new Promise((function(e,r){var i=indexedDB.open(n.name,n.version);i.onsuccess=function(t){var n=t.target.result;e(n)},i.onblocked=function(){r(new Ls(t,"Cannot upgrade IndexedDB schema while another tab is open. Close all tabs that access Firestore and reload this page to proceed."))},i.onerror=function(e){var n=e.target.error;"VersionError"===n.name?r(new Ur(Mr.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 Ls(t,n))},i.onupgradeneeded=function(t){Hr("SimpleDb",'Database "'+n.name+'" requires upgrade from version:',t.oldVersion);var e=t.target.result;n.wt.Rt(e,i.transaction,t.oldVersion,n.version).next((function(){Hr("SimpleDb","Database upgrade to version "+n.version+" complete")}))}}))]);case 1:e.db=r.sent(),r.label=2;case 2:return[2,(this.bt&&(this.db.onversionchange=function(t){return n.bt(t)}),this.db)]}}))}))},t.prototype.vt=function(t){this.bt=t,this.db&&(this.db.onversionchange=function(e){return t(e)})},t.prototype.runTransaction=function(t,e,n,r){return(0,Pr.sH)(this,void 0,void 0,(function(){var i,o,a,s,u;return(0,Pr.YH)(this,(function(c){switch(c.label){case 0:i="readonly"===e,o=0,a=function(){var e,a,u,c,h;return(0,Pr.YH)(this,(function(l){switch(l.label){case 0:++o,l.label=1;case 1:return l.trys.push([1,4,,5]),[4,s.At(t)];case 2:return s.db=l.sent(),e=Os.open(s.db,t,i?"readonly":"readwrite",n),a=r(e).catch((function(t){return e.abort(t),Rs.reject(t)})).toPromise(),u={},a.catch((function(){})),[4,e.dt];case 3:return[2,(u.value=(l.sent(),a),u)];case 4:return c=l.sent(),h="FirebaseError"!==c.name&&o<3,Hr("SimpleDb","Transaction failed with error:",c.message,"Retrying:",h),s.close(),h?[3,5]:[2,{value:Promise.reject(c)}];case 5:return[2]}}
762))},s=this,c.label=1;case 1:return[5,a()];case 2:if("object"==typeof(u=c.sent()))return[2,u.value];c.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}(),Ps=function(){function t(t){this.Pt=t,this.Vt=!1,this.St=null}return Object.defineProperty(t.prototype,"isDone",{get:function(){return this.Vt},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Dt",{get:function(){return this.St},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cursor",{set:function(t){this.Pt=t},enumerable:!1,configurable:!0}),t.prototype.done=function(){this.Vt=!0},t.prototype.Ct=function(t){this.St=t},t.prototype.delete=function(){return Us(this.Pt.delete())},t}(),Ls=function(t){function e(e,n){var r=this;return(r=t.call(this,Mr.UNAVAILABLE,"IndexedDB transaction '"+e+"' failed: "+n)||this).name="IndexedDbTransactionError",r}return(0,Pr.C6)(e,t),e}(Ur);function xs(t){return"IndexedDbTransactionError"===t.name}var Ms=function(){function t(t){this.store=t}return t.prototype.put=function(t,e){var n;return void 0!==e?(Hr("SimpleDb","PUT",this.store.name,t,e),n=this.store.put(e,t)):(Hr("SimpleDb","PUT",this.store.name,"<auto-key>",t),n=this.store.put(t)),Us(n)},t.prototype.add=function(t){return Hr("SimpleDb","ADD",this.store.name,t,t),Us(this.store.add(t))},t.prototype.get=function(t){var e=this;return Us(this.store.get(t)).next((function(n){return void 0===n&&(n=null),Hr("SimpleDb","GET",e.store.name,t,n),n}))},t.prototype.delete=function(t){return Hr("SimpleDb","DELETE",this.store.name,t),Us(this.store.delete(t))},t.prototype.count=function(){return Hr("SimpleDb","COUNT",this.store.name),Us(this.store.count())},t.prototype.Nt=function(t,e){var n=this.cursor(this.options(t,e)),r=[];return this.xt(n,(function(t,e){r.push(e)})).next((function(){return r}))},t.prototype.Ft=function(t,e){Hr("SimpleDb","DELETE ALL",this.store.name);var n=this.options(t,e);n.kt=!1;var r=this.cursor(n);return this.xt(r,(function(t,e,n){return n.delete()}))},t.prototype.Ot=function(t,e){var n;e?n=t:(n={},e=t);var r=this.cursor(n);return this.xt(r,e)},t.prototype.$t=function(t){var e=this.cursor({});return new Rs((function(n,r){e.onerror=function(t){var e=Vs(t.target.error);r(e)},e.onsuccess=function(e){var r=e.target.result;r?t(r.primaryKey,r.value).next((function(t){t?r.continue():n()})):n()}}))},t.prototype.xt=function(t,e){var n=[];return new Rs((function(r,i){t.onerror=function(t){i(t.target.error)},t.onsuccess=function(t){var i=t.target.result;if(i){var o=new Ps(i),a=e(i.primaryKey,i.value,o);if(a instanceof Rs){var s=a.catch((function(t){return o.done(),Rs.reject(t)}));n.push(s)}o.isDone?r():null===o.Dt?i.continue():i.continue(o.Dt)}else r()}})).next((function(){return Rs.waitFor(n)}))},t.prototype.options=function(t,e){var n;return void 0!==t&&("string"==typeof t?n=t:e=t),{index:n,range:e}},t.prototype.cursor=function(t){var e="next";if(t.reverse&&(e="prev"),t.index){var n=this.store.index(t.index);return t.kt?n.openKeyCursor(t.range,e):n.openCursor(t.range,e)}return this.store.openCursor(t.range,e)},t}();function Us(t){return new Rs((function(e,n){t.onsuccess=function(t){var n=t.target.result;e(n)},t.onerror=function(t){var e=Vs(t.target.error);n(e)}}))}var Fs=!1;function Vs(t){var e=Ds._t((0,i.ZQ)());if(e>=12.2&&e<13){var n="An internal error was encountered in the Indexed Database server";if(t.message.indexOf(n)>=0){var r=new Ur("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 Fs||(Fs=!0,setTimeout((function(){throw r}),0)),r}}return t} 763/** 764 * @license 765 * Copyright 2020 Google LLC 766 * 767 * Licensed under the Apache License, Version 2.0 (the "License"); 768 * you may not use this file except in compliance with the License. 769 * You may obtain a copy of the License at 770 * 771 * http://www.apache.org/licenses/LICENSE-2.0 772 * 773 * Unless required by applicable law or agreed to in writing, software 774 * distributed under the License is distributed on an "AS IS" BASIS, 775 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 776 * See the License for the specific language governing permissions and 777 * limitations under the License. 778 */var Hs=function(t){function e(e,n){var r=this;return(r=t.call(this)||this).Mt=e,r.currentSequenceNumber=n,r}return(0,Pr.C6)(e,t),e}(Ns);function js(t,e){var n=Yr(t);return Ds.It(n.Mt,e)} 779/** 780 * @license 781 * Copyright 2017 Google LLC 782 * 783 * Licensed under the Apache License, Version 2.0 (the "License");
784 * you may not use this file except in compliance with the License. 785 * You may obtain a copy of the License at 786 * 787 * http://www.apache.org/licenses/LICENSE-2.0 788 * 789 * Unless required by applicable law or agreed to in writing, software 790 * distributed under the License is distributed on an "AS IS" BASIS, 791 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 792 * See the License for the specific language governing permissions and 793 * limitations under the License. 794 */var qs=function(){function t(t,e,n,r){this.batchId=t,this.localWriteTime=e,this.baseMutations=n,this.mutations=r}return t.prototype.applyToRemoteDocument=function(t,e){for(var n=e.mutationResults,r=0;r<this.mutations.length;r++){var i=this.mutations[r];i.key.isEqual(t.key)&&Ho(i,t,n[r])}},t.prototype.applyToLocalView=function(t){for(var e=0,n=this.baseMutations;e<n.length;e++)(o=n[e]).key.isEqual(t.key)&&jo(o,t,this.localWriteTime);for(var r=0,i=this.mutations;r<i.length;r++){var o;(o=i[r]).key.isEqual(t.key)&&jo(o,t,this.localWriteTime)}},t.prototype.applyToLocalDocumentSet=function(t){var e=this;this.mutations.forEach((function(n){var r=t.get(n.key),i=r;e.applyToLocalView(i),r.isValidDocument()||i.convertToNoDocument(Zr.min())}))},t.prototype.keys=function(){return this.mutations.reduce((function(t,e){return t.add(e.key)}),va())},t.prototype.isEqual=function(t){return this.batchId===t.batchId&&Qr(this.mutations,t.mutations,(function(t,e){return Bo(t,e)}))&&Qr(this.baseMutations,t.baseMutations,(function(t,e){return Bo(t,e)}))},t}(),Bs=function(){function t(t,e,n,r){this.batch=t,this.commitVersion=e,this.mutationResults=n,this.docVersions=r}return t.from=function(e,n,r){Gr(e.mutations.length===r.length);for(var i=pa(),o=e.mutations,a=0;a<o.length;a++)i=i.insert(o[a].key,r[a].version);return new t(e,n,r,i)},t}(),Ks=function(){function t(t,e,n,r,i,o,a){void 0===i&&(i=Zr.min()),void 0===o&&(o=Zr.min()),void 0===a&&(a=ui.EMPTY_BYTE_STRING),this.target=t,this.targetId=e,this.purpose=n,this.sequenceNumber=r,this.snapshotVersion=i,this.lastLimboFreeSnapshotVersion=o,this.resumeToken=a}return t.prototype.withSequenceNumber=function(e){return new t(this.target,this.targetId,this.purpose,e,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken)},t.prototype.withResumeToken=function(e,n){return new t(this.target,this.targetId,this.purpose,this.sequenceNumber,n,this.lastLimboFreeSnapshotVersion,e)},t.prototype.withLastLimboFreeSnapshotVersion=function(e){return new t(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,e,this.resumeToken)},t}(),Gs=function(t){this.Lt=t};function Ys(t,e){if(e.document)return Ba(t.Lt,e.document,!!e.hasCommittedMutations);if(e.noDocument){var n=bi.fromSegments(e.noDocument.path),r=Js(e.noDocument.readTime),i=xi.newNoDocument(n,r);return e.hasCommittedMutations?i.setHasCommittedMutations():i}if(e.unknownDocument){var o=bi.fromSegments(e.unknownDocument.path);return r=Js(e.unknownDocument.version),xi.newUnknownDocument(o,r)}return Kr()}function zs(t,e,n){var r=Ws(n),i=e.key.path.popLast().toArray();if(e.isFoundDocument()){var o=function(t,e){return{name:Ma(t,e.key),fields:e.data.toProto().mapValue.fields,updateTime:Ra(t,e.version.toTimestamp())}}(t.Lt,e),a=e.hasCommittedMutations;return new ms(null,null,o,a,r,i)}if(e.isNoDocument()){var s=e.key.path.toArray(),u=Qs(e.version);return a=e.hasCommittedMutations,new ms(null,new vs(s,u),null,a,r,i)}if(e.isUnknownDocument()){var c=e.key.path.toArray(),h=Qs(e.version);return new ms(new gs(c,h),null,null,!0,r,i)}return Kr()}function Ws(t){var e=t.toTimestamp();return[e.seconds,e.nanoseconds]}function Xs(t){var e=new $r(t[0],t[1]);return Zr.fromTimestamp(e)}function Qs(t){var e=t.toTimestamp();return new hs(e.seconds,e.nanoseconds)}function Js(t){var e=new $r(t.seconds,t.nanoseconds);return Zr.fromTimestamp(e)}function $s(t,e){for(var n=(e.baseMutations||[]).map((function(e){return Ga(t.Lt,e)})),r=0;r<e.mutations.length-1;++r){var i=e.mutations[r];if(r+1<e.mutations.length&&void 0!==e.mutations[r+1].transform){var o=e.mutations[r+1];i.updateTransforms=o.transform.fieldTransforms,e.mutations.splice(r+1,1),++r}}var a=e.mutations.map((function(e){return Ga(t.Lt,e)})),s=$r.fromMillis(e.localWriteTimeMs);return new qs(e.batchId,s,n,a)}function Zs(t){var e,n,r=Js(t.readTime),i=void 0!==t.lastLimboFreeSnapshotVersion?Js(t.lastLimboFreeSnapshotVersion):Zr.min();return void 0!==t.query.documents?(Gr(1===(n=t.query).documents.length),e=lo(io(Va(n.documents[0])))):e=function(t){return lo(Wa(t))}(t.query),new Ks(e,t.targetId,0,t.lastListenSequenceNumber,r,i,ui.fromBase64String(t.resumeToken))}function tu(t,e){var n,r=Qs(e.snapshotVersion),i=Qs(e.lastLimboFreeSnapshotVersion);n=Hi(e.target)?Ya(t.Lt,e.target):za(t.Lt,e.target);var o=e.resumeToken.toBase64();return new bs(e.targetId,Fi(e.target),r,o,e.sequenceNumber,i,n)}function eu(t){var e=Wa({parent:t.parent,structuredQuery:t.structuredQuery});return"LAST"===t.limitType?fo(e,e.limit,"L"):e} 795/** 796 * @license 797 * Copyright 2020 Google LLC 798 * 799 * Licensed under the Apache License, Version 2.0 (the "License");
800 * you may not use this file except in compliance with the License. 801 * You may obtain a copy of the License at 802 * 803 * http://www.apache.org/licenses/LICENSE-2.0 804 * 805 * Unless required by applicable law or agreed to in writing, software 806 * distributed under the License is distributed on an "AS IS" BASIS, 807 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 808 * See the License for the specific language governing permissions and 809 * limitations under the License. 810 */var nu=function(){function t(){}return t.prototype.getBundleMetadata=function(t,e){return ru(t).get(e).next((function(t){if(t)return{id:(e=t).bundleId,createTime:Js(e.createTime),version:e.version};var e}))},t.prototype.saveBundleMetadata=function(t,e){return ru(t).put({bundleId:(n=e).id,createTime:Qs(Pa(n.createTime)),version:n.version});var n},t.prototype.getNamedQuery=function(t,e){return iu(t).get(e).next((function(t){if(t)return{name:(e=t).name,query:eu(e.bundledQuery),readTime:Js(e.readTime)};var e}))},t.prototype.saveNamedQuery=function(t,e){return iu(t).put(function(t){return{name:t.name,readTime:Qs(Pa(t.readTime)),bundledQuery:t.bundledQuery}}(e))},t}();function ru(t){return js(t,Ts.store)}function iu(t){return js(t,Ss.store)} 811/** 812 * @license 813 * Copyright 2019 Google LLC 814 * 815 * Licensed under the Apache License, Version 2.0 (the "License"); 816 * you may not use this file except in compliance with the License. 817 * You may obtain a copy of the License at 818 * 819 * http://www.apache.org/licenses/LICENSE-2.0 820 * 821 * Unless required by applicable law or agreed to in writing, software 822 * distributed under the License is distributed on an "AS IS" BASIS, 823 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 824 * See the License for the specific language governing permissions and 825 * limitations under the License. 826 */var ou=function(){function t(){this.Bt=new au}return t.prototype.addToCollectionParentIndex=function(t,e){return this.Bt.add(e),Rs.resolve()},t.prototype.getCollectionParents=function(t,e){return Rs.resolve(this.Bt.getEntries(e))},t}(),au=function(){function t(){this.index={}}return t.prototype.add=function(t){var e=t.lastSegment(),n=t.popLast(),r=this.index[e]||new aa(ii.comparator),i=!r.has(n);return this.index[e]=r.add(n),i},t.prototype.has=function(t){var e=t.lastSegment(),n=t.popLast(),r=this.index[e];return r&&r.has(n)},t.prototype.getEntries=function(t){return(this.index[t]||new aa(ii.comparator)).toArray()},t}(),su=function(){function t(){this.qt=new au}return t.prototype.addToCollectionParentIndex=function(t,e){var n=this;if(!this.qt.has(e)){var r=e.lastSegment(),i=e.popLast();t.addOnCommittedListener((function(){n.qt.add(e)}));var o={collectionId:r,parent:as(i)};return uu(t).put(o)}return Rs.resolve()},t.prototype.getCollectionParents=function(t,e){var n=[],r=IDBKeyRange.bound([e,""],[Jr(e),""],!1,!0);return uu(t).Nt(r).next((function(t){for(var r=0,i=t;r<i.length;r++){var o=i[r];if(o.collectionId!==e)break;n.push(cs(o.parent))}return n}))},t}();function uu(t){return js(t,Is.store)} 827/** 828 * @license 829 * Copyright 2018 Google LLC 830 * 831 * Licensed under the Apache License, Version 2.0 (the "License"); 832 * you may not use this file except in compliance with the License. 833 * You may obtain a copy of the License at 834 * 835 * http://www.apache.org/licenses/LICENSE-2.0 836 * 837 * Unless required by applicable law or agreed to in writing, software 838 * distributed under the License is distributed on an "AS IS" BASIS, 839 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 840 * See the License for the specific language governing permissions and 841 * limitations under the License. 842 */var cu={didRun:!1,sequenceNumbersCollected:0,targetsRemoved:0,documentsRemoved:0},hu=function(){function t(t,e,n){this.cacheSizeCollectionThreshold=t,this.percentileToCollect=e,this.maximumSequenceNumbersToCollect=n}return t.withCacheSize=function(e){return new t(e,t.DEFAULT_COLLECTION_PERCENTILE,t.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT)},t}(); 843/** 844 * @license 845 * Copyright 2020 Google LLC 846 * 847 * Licensed under the Apache License, Version 2.0 (the "License");
848 * you may not use this file except in compliance with the License. 849 * You may obtain a copy of the License at 850 * 851 * http://www.apache.org/licenses/LICENSE-2.0 852 * 853 * Unless required by applicable law or agreed to in writing, software 854 * distributed under the License is distributed on an "AS IS" BASIS, 855 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 856 * See the License for the specific language governing permissions and 857 * limitations under the License. 858 */function lu(t,e,n){var r=t.store(ps.store),i=t.store(ds.store),o=[],a=IDBKeyRange.only(n.batchId),s=0,u=r.Ot({range:a},(function(t,e,n){return s++,n.delete()}));o.push(u.next((function(){Gr(1===s)})));for(var c=[],h=0,l=n.mutations;h<l.length;h++){var f=l[h],p=ds.key(e,f.key.path,n.batchId);o.push(i.delete(p)),c.push(f.key)}return Rs.waitFor(o).next((function(){return c}))}function fu(t){if(!t)return 0;var e;if(t.document)e=t.document;else if(t.unknownDocument)e=t.unknownDocument;else{if(!t.noDocument)throw Kr();e=t.noDocument}return JSON.stringify(e).length} 859/** 860 * @license 861 * Copyright 2017 Google LLC 862 * 863 * Licensed under the Apache License, Version 2.0 (the "License"); 864 * you may not use this file except in compliance with the License. 865 * You may obtain a copy of the License at 866 * 867 * http://www.apache.org/licenses/LICENSE-2.0 868 * 869 * Unless required by applicable law or agreed to in writing, software 870 * distributed under the License is distributed on an "AS IS" BASIS, 871 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 872 * See the License for the specific language governing permissions and 873 * limitations under the License. 874 */hu.DEFAULT_COLLECTION_PERCENTILE=10,hu.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT=1e3,hu.DEFAULT=new hu(41943040,hu.DEFAULT_COLLECTION_PERCENTILE,hu.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT),hu.DISABLED=new hu(-1,0,0);var pu=function(){function t(t,e,n,r){this.userId=t,this.R=e,this.Ut=n,this.referenceDelegate=r,this.Qt={}}return t.Kt=function(e,n,r,i){return Gr(""!==e.uid),new t(e.isAuthenticated()?e.uid:"",n,r,i)},t.prototype.checkEmpty=function(t){var e=!0,n=IDBKeyRange.bound([this.userId,Number.NEGATIVE_INFINITY],[this.userId,Number.POSITIVE_INFINITY]);return vu(t).Ot({index:ps.userMutationsIndex,range:n},(function(t,n,r){e=!1,r.done()})).next((function(){return e}))},t.prototype.addMutationBatch=function(t,e,n,r){var i=this,o=gu(t),a=vu(t);return a.add({}).next((function(s){Gr("number"==typeof s);for(var u=new qs(s,e,n,r),c=function(t,e,n){var r=n.baseMutations.map((function(e){return Ka(t.Lt,e)})),i=n.mutations.map((function(e){return Ka(t.Lt,e)}));return new ps(e,n.batchId,n.localWriteTime.toMillis(),r,i)}(i.R,i.userId,u),h=[],l=new aa((function(t,e){return Xr(t.canonicalString(),e.canonicalString())})),f=0,p=r;f<p.length;f++){var d=p[f],v=ds.key(i.userId,d.key.path,s);l=l.add(d.key.path.popLast()),h.push(a.put(c)),h.push(o.put(v,ds.PLACEHOLDER))}return l.forEach((function(e){h.push(i.Ut.addToCollectionParentIndex(t,e))})),t.addOnCommittedListener((function(){i.Qt[s]=u.keys()})),Rs.waitFor(h).next((function(){return u}))}))},t.prototype.lookupMutationBatch=function(t,e){var n=this;return vu(t).get(e).next((function(t){return t?(Gr(t.userId===n.userId),$s(n.R,t)):null}))},t.prototype.jt=function(t,e){var n=this;return this.Qt[e]?Rs.resolve(this.Qt[e]):this.lookupMutationBatch(t,e).next((function(t){if(t){var r=t.keys();return n.Qt[e]=r,r}return null}))},t.prototype.getNextMutationBatchAfterBatchId=function(t,e){var n=this,r=e+1,i=IDBKeyRange.lowerBound([this.userId,r]),o=null;return vu(t).Ot({index:ps.userMutationsIndex,range:i},(function(t,e,i){e.userId===n.userId&&(Gr(e.batchId>=r),o=$s(n.R,e)),i.done()})).next((function(){return o}))},t.prototype.getHighestUnacknowledgedBatchId=function(t){var e=IDBKeyRange.upperBound([this.userId,Number.POSITIVE_INFINITY]),n=-1;return vu(t).Ot({index:ps.userMutationsIndex,range:e,reverse:!0},(function(t,e,r){n=e.batchId,r.done()})).next((function(){return n}))},t.prototype.getAllMutationBatches=function(t){var e=this,n=IDBKeyRange.bound([this.userId,-1],[this.userId,Number.POSITIVE_INFINITY]);
874return vu(t).Nt(ps.userMutationsIndex,n).next((function(t){return t.map((function(t){return $s(e.R,t)}))}))},t.prototype.getAllMutationBatchesAffectingDocumentKey=function(t,e){var n=this,r=ds.prefixForPath(this.userId,e.path),i=IDBKeyRange.lowerBound(r),o=[];return gu(t).Ot({range:i},(function(r,i,a){var s=r[0],u=r[1],c=r[2],h=cs(u);if(s===n.userId&&e.path.isEqual(h))return vu(t).get(c).next((function(t){if(!t)throw Kr();Gr(t.userId===n.userId),o.push($s(n.R,t))}));a.done()})).next((function(){return o}))},t.prototype.getAllMutationBatchesAffectingDocumentKeys=function(t,e){var n=this,r=new aa(Xr),i=[];return e.forEach((function(e){var o=ds.prefixForPath(n.userId,e.path),a=IDBKeyRange.lowerBound(o),s=gu(t).Ot({range:a},(function(t,i,o){var a=t[0],s=t[1],u=t[2],c=cs(s);a===n.userId&&e.path.isEqual(c)?r=r.add(u):o.done()}));i.push(s)})),Rs.waitFor(i).next((function(){return n.Wt(t,r)}))},t.prototype.getAllMutationBatchesAffectingQuery=function(t,e){var n=this,r=e.path,i=r.length+1,o=ds.prefixForPath(this.userId,r),a=IDBKeyRange.lowerBound(o),s=new aa(Xr);return gu(t).Ot({range:a},(function(t,e,o){var a=t[0],u=t[1],c=t[2],h=cs(u);a===n.userId&&r.isPrefixOf(h)?h.length===i&&(s=s.add(c)):o.done()})).next((function(){return n.Wt(t,s)}))},t.prototype.Wt=function(t,e){var n=this,r=[],i=[];return e.forEach((function(e){i.push(vu(t).get(e).next((function(t){if(null===t)throw Kr();Gr(t.userId===n.userId),r.push($s(n.R,t))})))})),Rs.waitFor(i).next((function(){return r}))},t.prototype.removeMutationBatch=function(t,e){var n=this;return lu(t.Mt,this.userId,e).next((function(r){return t.addOnCommittedListener((function(){n.Gt(e.batchId)})),Rs.forEach(r,(function(e){return n.referenceDelegate.markPotentiallyOrphaned(t,e)}))}))},t.prototype.Gt=function(t){delete this.Qt[t]},t.prototype.performConsistencyCheck=function(t){var e=this;return this.checkEmpty(t).next((function(n){if(!n)return Rs.resolve();var r=IDBKeyRange.lowerBound(ds.prefixForUser(e.userId)),i=[];return gu(t).Ot({range:r},(function(t,n,r){if(t[0]===e.userId){var o=cs(t[1]);i.push(o)}else r.done()})).next((function(){Gr(0===i.length)}))}))},t.prototype.containsKey=function(t,e){return du(t,this.userId,e)},t.prototype.zt=function(t){var e=this;return mu(t).get(this.userId).next((function(t){return t||new fs(e.userId,-1,"")}))},t}();function du(t,e,n){var r=ds.prefixForPath(e,n.path),i=r[1],o=IDBKeyRange.lowerBound(r),a=!1;return gu(t).Ot({range:o,kt:!0},(function(t,n,r){var o=t[0],s=t[1];t[2],o===e&&s===i&&(a=!0),r.done()})).next((function(){return a}))}function vu(t){return js(t,ps.store)}function gu(t){return js(t,ds.store)}function mu(t){return js(t,fs.store)} 875/** 876 * @license 877 * Copyright 2017 Google LLC 878 * 879 * Licensed under the Apache License, Version 2.0 (the "License"); 880 * you may not use this file except in compliance with the License. 881 * You may obtain a copy of the License at 882 * 883 * http://www.apache.org/licenses/LICENSE-2.0 884 * 885 * Unless required by applicable law or agreed to in writing, software 886 * distributed under the License is distributed on an "AS IS" BASIS, 887 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 888 * See the License for the specific language governing permissions and 889 * limitations under the License. 890 */var yu=function(){function t(t){this.Ht=t}return t.prototype.next=function(){return this.Ht+=2,this.Ht},t.Jt=function(){return new t(0)},t.Yt=function(){return new t(-1)},t}(),bu=function(){function t(t,e){this.referenceDelegate=t,this.R=e}return t.prototype.allocateTargetId=function(t){var e=this;return this.Xt(t).next((function(n){var r=new yu(n.highestTargetId);return n.highestTargetId=r.next(),e.Zt(t,n).next((function(){return n.highestTargetId}))}))},t.prototype.getLastRemoteSnapshotVersion=function(t){return this.Xt(t).next((function(t){return Zr.fromTimestamp(new $r(t.lastRemoteSnapshotVersion.seconds,t.lastRemoteSnapshotVersion.nanoseconds))}))},t.prototype.getHighestSequenceNumber=function(t){return this.Xt(t).next((function(t){return t.highestListenSequenceNumber}))},t.prototype.setTargetsMetadata=function(t,e,n){var r=this;
890return this.Xt(t).next((function(i){return i.highestListenSequenceNumber=e,n&&(i.lastRemoteSnapshotVersion=n.toTimestamp()),e>i.highestListenSequenceNumber&&(i.highestListenSequenceNumber=e),r.Zt(t,i)}))},t.prototype.addTargetData=function(t,e){var n=this;return this.te(t,e).next((function(){return n.Xt(t).next((function(r){return r.targetCount+=1,n.ee(e,r),n.Zt(t,r)}))}))},t.prototype.updateTargetData=function(t,e){return this.te(t,e)},t.prototype.removeTargetData=function(t,e){var n=this;return this.removeMatchingKeysForTargetId(t,e.targetId).next((function(){return wu(t).delete(e.targetId)})).next((function(){return n.Xt(t)})).next((function(e){return Gr(e.targetCount>0),e.targetCount-=1,n.Zt(t,e)}))},t.prototype.removeTargets=function(t,e,n){var r=this,i=0,o=[];return wu(t).Ot((function(a,s){var u=Zs(s);u.sequenceNumber<=e&&null===n.get(u.targetId)&&(i++,o.push(r.removeTargetData(t,u)))})).next((function(){return Rs.waitFor(o)})).next((function(){return i}))},t.prototype.forEachTarget=function(t,e){return wu(t).Ot((function(t,n){var r=Zs(n);e(r)}))},t.prototype.Xt=function(t){return _u(t).get(_s.key).next((function(t){return Gr(null!==t),t}))},t.prototype.Zt=function(t,e){return _u(t).put(_s.key,e)},t.prototype.te=function(t,e){return wu(t).put(tu(this.R,e))},t.prototype.ee=function(t,e){var n=!1;return t.targetId>e.highestTargetId&&(e.highestTargetId=t.targetId,n=!0),t.sequenceNumber>e.highestListenSequenceNumber&&(e.highestListenSequenceNumber=t.sequenceNumber,n=!0),n},t.prototype.getTargetCount=function(t){return this.Xt(t).next((function(t){return t.targetCount}))},t.prototype.getTargetData=function(t,e){var n=Fi(e),r=IDBKeyRange.bound([n,Number.NEGATIVE_INFINITY],[n,Number.POSITIVE_INFINITY]),i=null;return wu(t).Ot({range:r,index:bs.queryTargetsIndexName},(function(t,n,r){var o=Zs(n);Vi(e,o.target)&&(i=o,r.done())})).next((function(){return i}))},t.prototype.addMatchingKeys=function(t,e,n){var r=this,i=[],o=Iu(t);return e.forEach((function(e){var a=as(e.path);i.push(o.put(new ws(n,a))),i.push(r.referenceDelegate.addReference(t,n,e))})),Rs.waitFor(i)},t.prototype.removeMatchingKeys=function(t,e,n){var r=this,i=Iu(t);return Rs.forEach(e,(function(e){var o=as(e.path);return Rs.waitFor([i.delete([n,o]),r.referenceDelegate.removeReference(t,n,e)])}))},t.prototype.removeMatchingKeysForTargetId=function(t,e){var n=Iu(t),r=IDBKeyRange.bound([e],[e+1],!1,!0);return n.delete(r)},t.prototype.getMatchingKeysForTargetId=function(t,e){var n=IDBKeyRange.bound([e],[e+1],!1,!0),r=Iu(t),i=va();return r.Ot({range:n,kt:!0},(function(t,e,n){var r=cs(t[1]),o=new bi(r);i=i.add(o)})).next((function(){return i}))},t.prototype.containsKey=function(t,e){var n=as(e.path),r=IDBKeyRange.bound([n],[Jr(n)],!1,!0),i=0;return Iu(t).Ot({index:ws.documentTargetsIndex,kt:!0,range:r},(function(t,e,n){var r=t[0];t[1],0!==r&&(i++,n.done())})).next((function(){return i>0}))},t.prototype.lt=function(t,e){return wu(t).get(e).next((function(t){return t?Zs(t):null}))},t}(); 891/** 892 * @license 893 * Copyright 2017 Google LLC 894 * 895 * Licensed under the Apache License, Version 2.0 (the "License"); 896 * you may not use this file except in compliance with the License. 897 * You may obtain a copy of the License at 898 * 899 * http://www.apache.org/licenses/LICENSE-2.0 900 * 901 * Unless required by applicable law or agreed to in writing, software 902 * distributed under the License is distributed on an "AS IS" BASIS, 903 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 904 * See the License for the specific language governing permissions and 905 * limitations under the License. 906 */function wu(t){return js(t,bs.store)}function _u(t){return js(t,_s.store)}function Iu(t){return js(t,ws.store)} 907/** 908 * @license 909 * Copyright 2017 Google LLC 910 * 911 * Licensed under the Apache License, Version 2.0 (the "License"); 912 * you may not use this file except in compliance with the License. 913 * You may obtain a copy of the License at 914 * 915 * http://www.apache.org/licenses/LICENSE-2.0 916 * 917 * Unless required by applicable law or agreed to in writing, software 918 * distributed under the License is distributed on an "AS IS" BASIS, 919 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 920 * See the License for the specific language governing permissions and 921 * limitations under the License. 922 */function Eu(t){return(0,Pr.sH)(this,void 0,void 0,(function(){return(0,Pr.YH)(this,(function(e){if(t.code!==Mr.FAILED_PRECONDITION||t.message!==ks)throw t;return Hr("LocalStore","Unexpectedly lost primary lease"),[2]}))}
922))} 923/** 924 * @license 925 * Copyright 2020 Google LLC 926 * 927 * Licensed under the Apache License, Version 2.0 (the "License"); 928 * you may not use this file except in compliance with the License. 929 * You may obtain a copy of the License at 930 * 931 * http://www.apache.org/licenses/LICENSE-2.0 932 * 933 * Unless required by applicable law or agreed to in writing, software 934 * distributed under the License is distributed on an "AS IS" BASIS, 935 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 936 * See the License for the specific language governing permissions and 937 * limitations under the License. 938 */function Tu(t,e){var n=t[0],r=t[1],i=e[0],o=e[1],a=Xr(n,i);return 0===a?Xr(r,o):a}var Su=function(){function t(t){this.ne=t,this.buffer=new aa(Tu),this.se=0}return t.prototype.ie=function(){return++this.se},t.prototype.re=function(t){var e=[t,this.ie()];if(this.buffer.size<this.ne)this.buffer=this.buffer.add(e);else{var n=this.buffer.last();Tu(e,n)<0&&(this.buffer=this.buffer.delete(n).add(e))}},Object.defineProperty(t.prototype,"maxValue",{get:function(){return this.buffer.last()[0]},enumerable:!1,configurable:!0}),t}(),Au=function(){function t(t,e){this.garbageCollector=t,this.asyncQueue=e,this.oe=!1,this.ce=null}return t.prototype.start=function(t){-1!==this.garbageCollector.params.cacheSizeCollectionThreshold&&this.ue(t)},t.prototype.stop=function(){this.ce&&(this.ce.cancel(),this.ce=null)},Object.defineProperty(t.prototype,"started",{get:function(){return null!==this.ce},enumerable:!1,configurable:!0}),t.prototype.ue=function(t){var e=this,n=this.oe?3e5:6e4;Hr("LruGarbageCollector","Garbage collection scheduled in "+n+"ms"),this.ce=this.asyncQueue.enqueueAfterDelay("lru_garbage_collection",n,(function(){return(0,Pr.sH)(e,void 0,void 0,(function(){var e;return(0,Pr.YH)(this,(function(n){switch(n.label){case 0:this.ce=null,this.oe=!0,n.label=1;case 1:return n.trys.push([1,3,,7]),[4,t.collectGarbage(this.garbageCollector)];case 2:return n.sent(),[3,7];case 3:return xs(e=n.sent())?(Hr("LruGarbageCollector","Ignoring IndexedDB error during garbage collection: ",e),[3,6]):[3,4];case 4:return[4,Eu(e)];case 5:n.sent(),n.label=6;case 6:return[3,7];case 7:return[4,this.ue(t)];case 8:return n.sent(),[2]}}))}))}))},t}(),ku=function(){function t(t,e){this.ae=t,this.params=e}return t.prototype.calculateTargetCount=function(t,e){return this.ae.he(t).next((function(t){return Math.floor(e/100*t)}))},t.prototype.nthSequenceNumber=function(t,e){var n=this;if(0===e)return Rs.resolve(xr.o);var r=new Su(e);return this.ae.forEachTarget(t,(function(t){return r.re(t.sequenceNumber)})).next((function(){return n.ae.le(t,(function(t){return r.re(t)}))})).next((function(){return r.maxValue}))},t.prototype.removeTargets=function(t,e,n){return this.ae.removeTargets(t,e,n)},t.prototype.removeOrphanedDocuments=function(t,e){return this.ae.removeOrphanedDocuments(t,e)},t.prototype.collect=function(t,e){var n=this;return-1===this.params.cacheSizeCollectionThreshold?(Hr("LruGarbageCollector","Garbage collection skipped; disabled"),Rs.resolve(cu)):this.getCacheSize(t).next((function(r){return r<n.params.cacheSizeCollectionThreshold?(Hr("LruGarbageCollector","Garbage collection skipped; Cache size "+r+" is lower than threshold "+n.params.cacheSizeCollectionThreshold),cu):n.fe(t,e)}))},t.prototype.getCacheSize=function(t){return this.ae.getCacheSize(t)},t.prototype.fe=function(t,e){var n,r,i,a,s,u,c,h=this,l=Date.now();return this.calculateTargetCount(t,this.params.percentileToCollect).next((function(e){return e>h.params.maximumSequenceNumbersToCollect?(Hr("LruGarbageCollector","Capping sequence numbers to collect down to the maximum of "+h.params.maximumSequenceNumbersToCollect+" from "+e),r=h.params.maximumSequenceNumbersToCollect):r=e,a=Date.now(),h.nthSequenceNumber(t,r)})).next((function(r){return n=r,s=Date.now(),h.removeTargets(t,n,e)})).next((function(e){return i=e,u=Date.now(),h.removeOrphanedDocuments(t,n)})).next((function(t){return c=Date.now(),Vr()<=o.$b.DEBUG&&Hr("LruGarbageCollector","LRU Garbage Collection\n\tCounted targets in "+(a-l)+"ms\n\tDetermined least recently used "+r+" in "+(s-a)+"ms\n\tRemoved "+i+" targets in "+(u-s)+"ms\n\tRemoved "+t+" documents in "+(c-u)+"ms\nTotal Duration: "+(c-l)+"ms"),Rs.resolve({didRun:!0,sequenceNumbersCollected:r,targetsRemoved:i,documentsRemoved:t})}))},t}(),Nu=function(){function t(t,e){this.db=t,this.garbageCollector=function(t,e){return new ku(t,e)}(this,e)}return t.prototype.he=function(t){var e=this.de(t);return this.db.getTargetCache().getTargetCount(t).next((function(t){return e.next((function(e){return t+e}))}))},t.prototype.de=function(t){var e=0;return this.le(t,(function(t){e++})).next((function(){return e}))},t.prototype.forEachTarget=function(t,e){return this.db.getTargetCache().forEac
938hTarget(t,e)},t.prototype.le=function(t,e){return this.we(t,(function(t,n){return e(n)}))},t.prototype.addReference=function(t,e,n){return Cu(t,n)},t.prototype.removeReference=function(t,e,n){return Cu(t,n)},t.prototype.removeTargets=function(t,e,n){return this.db.getTargetCache().removeTargets(t,e,n)},t.prototype.markPotentiallyOrphaned=function(t,e){return Cu(t,e)},t.prototype._e=function(t,e){return function(t,e){var n=!1;return mu(t).$t((function(r){return du(t,r,e).next((function(t){return t&&(n=!0),Rs.resolve(!t)}))})).next((function(){return n}))}(t,e)},t.prototype.removeOrphanedDocuments=function(t,e){var n=this,r=this.db.getRemoteDocumentCache().newChangeBuffer(),i=[],o=0;return this.we(t,(function(a,s){if(s<=e){var u=n._e(t,a).next((function(e){if(!e)return o++,r.getEntry(t,a).next((function(){return r.removeEntry(a),Iu(t).delete([0,as(a.path)])}))}));i.push(u)}})).next((function(){return Rs.waitFor(i)})).next((function(){return r.apply(t)})).next((function(){return o}))},t.prototype.removeTarget=function(t,e){var n=e.withSequenceNumber(t.currentSequenceNumber);return this.db.getTargetCache().updateTargetData(t,n)},t.prototype.updateLimboDocument=function(t,e){return Cu(t,e)},t.prototype.we=function(t,e){var n,r=Iu(t),i=xr.o;return r.Ot({index:ws.documentTargetsIndex},(function(t,r){var o=t[0],a=(t[1],r.path),s=r.sequenceNumber;0===o?(i!==xr.o&&e(new bi(cs(n)),i),i=s,n=a):i=xr.o})).next((function(){i!==xr.o&&e(new bi(cs(n)),i)}))},t.prototype.getCacheSize=function(t){return this.db.getRemoteDocumentCache().getSize(t)},t}();function Cu(t,e){return Iu(t).put(function(t,e){return new ws(0,as(t.path),e)}(e,t.currentSequenceNumber))} 939/** 940 * @license 941 * Copyright 2017 Google LLC 942 * 943 * Licensed under the Apache License, Version 2.0 (the "License"); 944 * you may not use this file except in compliance with the License. 945 * You may obtain a copy of the License at 946 * 947 * http://www.apache.org/licenses/LICENSE-2.0 948 * 949 * Unless required by applicable law or agreed to in writing, software 950 * distributed under the License is distributed on an "AS IS" BASIS, 951 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 952 * See the License for the specific language governing permissions and 953 * limitations under the License. 954 */var Ru=function(){function t(t,e){this.mapKeyFn=t,this.equalsFn=e,this.inner={}}return t.prototype.get=function(t){var e=this.mapKeyFn(t),n=this.inner[e];if(void 0!==n)for(var r=0,i=n;r<i.length;r++){var o=i[r],a=o[0],s=o[1];if(this.equalsFn(a,t))return s}},t.prototype.has=function(t){return void 0!==this.get(t)},t.prototype.set=function(t,e){var n=this.mapKeyFn(t),r=this.inner[n];if(void 0!==r){for(var i=0;i<r.length;i++)if(this.equalsFn(r[i][0],t))return void(r[i]=[t,e]);r.push([t,e])}else this.inner[n]=[[t,e]]},t.prototype.delete=function(t){var e=this.mapKeyFn(t),n=this.inner[e];if(void 0===n)return!1;for(var r=0;r<n.length;r++)if(this.equalsFn(n[r][0],t))return 1===n.length?delete this.inner[e]:n.splice(r,1),!0;return!1},t.prototype.forEach=function(t){ei(this.inner,(function(e,n){for(var r=0,i=n;r<i.length;r++){var o=i[r],a=o[0],s=o[1];t(a,s)}}))},t.prototype.isEmpty=function(){return ni(this.inner)},t}(),Ou=function(){function t(){this.changes=new Ru((function(t){return t.toString()}),(function(t,e){return t.isEqual(e)})),this.changesApplied=!1}return t.prototype.getReadTime=function(t){var e=this.changes.get(t);return e?e.readTime:Zr.min()},t.prototype.addEntry=function(t,e){this.assertNotApplied(),this.changes.set(t.key,{document:t,readTime:e})},t.prototype.removeEntry=function(t,e){void 0===e&&(e=null),this.assertNotApplied(),this.changes.set(t,{document:xi.newInvalidDocument(t),readTime:e})},t.prototype.getEntry=function(t,e){this.assertNotApplied();var n=this.changes.get(e);return void 0!==n?Rs.resolve(n.document):this.getFromCache(t,e)},t.prototype.getEntries=function(t,e){return this.getAllFromCache(t,e)},t.prototype.apply=function(t){return this.assertNotApplied(),this.changesApplied=!0,this.applyChanges(t)},t.prototype.assertNotApplied=function(){},t}(),Du=function(){function t(t,e){this.R=t,this.Ut=e}return t.prototype.addEntry=function(t,e,n){return xu(t).put(Mu(e),n)},t.prototype.removeEntry=function(t,e){var n=xu(t),r=Mu(e);return n.delete(r)},t.prototype.updateMetadata=function(t,e){var n=this;return this.getMetadata(t).next((function(r){return r.byteSize+=e,n.me(t,r)}))},t.prototype.getEntry=function(t,e){var n=this;return xu(t).get(Mu(e)).next((function(t){return n.ye(e,t)}))},t.prototype.ge=function(t,e){var n=this;return xu(t).get(Mu(e)).next((function(t){return{document:n.ye(e,t),size:fu(t)}}))},t.prototype.getEntries=function(t,e){var n=this,r=ca();return this.pe(t,e,(function(t,e){var i=n.ye(t,e);r=r.insert(t,i)})).next((function(){return r}))},t.prototype.Ee=function(t,e){var n=this,r=ca(),i=new ra(bi.comparator);return this.pe(t,e,(function(t,e){var o=n.ye(t,e);r=r.insert(t,o),i=i.insert(t,fu(e))})).next((function(){return{documents:r,Te:i}}
954))},t.prototype.pe=function(t,e,n){if(e.isEmpty())return Rs.resolve();var r=IDBKeyRange.bound(e.first().path.toArray(),e.last().path.toArray()),i=e.getIterator(),o=i.getNext();return xu(t).Ot({range:r},(function(t,e,r){for(var a=bi.fromSegments(t);o&&bi.comparator(o,a)<0;)n(o,null),o=i.getNext();o&&o.isEqual(a)&&(n(o,e),o=i.hasNext()?i.getNext():null),o?r.Ct(o.path.toArray()):r.done()})).next((function(){for(;o;)n(o,null),o=i.hasNext()?i.getNext():null}))},t.prototype.getDocumentsMatchingQuery=function(t,e,n){var r=this,i=ca(),o=e.path.length+1,a={};if(n.isEqual(Zr.min())){var s=e.path.toArray();a.range=IDBKeyRange.lowerBound(s)}else{var u=e.path.toArray(),c=Ws(n);a.range=IDBKeyRange.lowerBound([u,c],!0),a.index=ms.collectionReadTimeIndex}return xu(t).Ot(a,(function(t,n,a){if(t.length===o){var s=Ys(r.R,n);e.path.isPrefixOf(s.key.path)?mo(e,s)&&(i=i.insert(s.key,s)):a.done()}})).next((function(){return i}))},t.prototype.newChangeBuffer=function(t){return new Pu(this,!!t&&t.trackRemovals)},t.prototype.getSize=function(t){return this.getMetadata(t).next((function(t){return t.byteSize}))},t.prototype.getMetadata=function(t){return Lu(t).get(ys.key).next((function(t){return Gr(!!t),t}))},t.prototype.me=function(t,e){return Lu(t).put(ys.key,e)},t.prototype.ye=function(t,e){if(e){var n=Ys(this.R,e);if(!n.isNoDocument()||!n.version.isEqual(Zr.min()))return n}return xi.newInvalidDocument(t)},t}(),Pu=function(t){function e(e,n){var r=this;return(r=t.call(this)||this).Ie=e,r.trackRemovals=n,r.Ae=new Ru((function(t){return t.toString()}),(function(t,e){return t.isEqual(e)})),r}return(0,Pr.C6)(e,t),e.prototype.applyChanges=function(t){var e=this,n=[],r=0,i=new aa((function(t,e){return Xr(t.canonicalString(),e.canonicalString())}));
954return this.changes.forEach((function(o,a){var s=e.Ae.get(o);if(a.document.isValidDocument()){var u=zs(e.Ie.R,a.document,e.getReadTime(o));i=i.add(o.path.popLast());var c=fu(u);r+=c-s,n.push(e.Ie.addEntry(t,o,u))}else if(r-=s,e.trackRemovals){var h=zs(e.Ie.R,xi.newNoDocument(o,Zr.min()),e.getReadTime(o));n.push(e.Ie.addEntry(t,o,h))}else n.push(e.Ie.removeEntry(t,o))})),i.forEach((function(r){n.push(e.Ie.Ut.addToCollectionParentIndex(t,r))})),n.push(this.Ie.updateMetadata(t,r)),Rs.waitFor(n)},e.prototype.getFromCache=function(t,e){var n=this;return this.Ie.ge(t,e).next((function(t){return n.Ae.set(e,t.size),t.document}))},e.prototype.getAllFromCache=function(t,e){var n=this;return this.Ie.Ee(t,e).next((function(t){var e=t.documents;return t.Te.forEach((function(t,e){n.Ae.set(t,e)})),e}))},e}(Ou); 955/** 956 * @license 957 * Copyright 2017 Google LLC 958 * 959 * Licensed under the Apache License, Version 2.0 (the "License"); 960 * you may not use this file except in compliance with the License. 961 * You may obtain a copy of the License at 962 * 963 * http://www.apache.org/licenses/LICENSE-2.0 964 * 965 * Unless required by applicable law or agreed to in writing, software 966 * distributed under the License is distributed on an "AS IS" BASIS, 967 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 968 * See the License for the specific language governing permissions and 969 * limitations under the License. 970 */function Lu(t){return js(t,ys.store)}function xu(t){return js(t,ms.store)}function Mu(t){return t.path.toArray()} 971/** 972 * @license 973 * Copyright 2020 Google LLC 974 * 975 * Licensed under the Apache License, Version 2.0 (the "License"); 976 * you may not use this file except in compliance with the License. 977 * You may obtain a copy of the License at 978 * 979 * http://www.apache.org/licenses/LICENSE-2.0 980 * 981 * Unless required by applicable law or agreed to in writing, software 982 * distributed under the License is distributed on an "AS IS" BASIS, 983 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 984 * See the License for the specific language governing permissions and 985 * limitations under the License. 986 */var Uu=function(){function t(t){this.R=t}return t.prototype.Rt=function(t,e,n,r){var i=this;Gr(n<r&&n>=0&&r<=11);var o=new Os("createOrUpgrade",e);n<1&&r>=1&&(function(t){t.createObjectStore(ls.store)}(t),function(t){t.createObjectStore(fs.store,{keyPath:fs.keyPath}),t.createObjectStore(ps.store,{keyPath:ps.keyPath,autoIncrement:!0}).createIndex(ps.userMutationsIndex,ps.userMutationsKeyPath,{unique:!0}),t.createObjectStore(ds.store)}(t),Fu(t),function(t){t.createObjectStore(ms.store)}(t));var a=Rs.resolve();return n<3&&r>=3&&(0!==n&&(function(t){t.deleteObjectStore(ws.store),t.deleteObjectStore(bs.store),t.deleteObjectStore(_s.store)}(t),Fu(t)),a=a.next((function(){return function(t){var e=t.store(_s.store),n=new _s(0,0,Zr.min().toTimestamp(),0);return e.put(_s.key,n)}(o)}))),n<4&&r>=4&&(0!==n&&(a=a.next((function(){return function(t,e){return e.store(ps.store).Nt().next((function(n){t.deleteObjectStore(ps.store),t.createObjectStore(ps.store,{keyPath:ps.keyPath,autoIncrement:!0}).createIndex(ps.userMutationsIndex,ps.userMutationsKeyPath,{unique:!0});var r=e.store(ps.store),i=n.map((function(t){return r.put(t)}));return Rs.waitFor(i)}))}(t,o)}))),a=a.next((function(){!function(t){t.createObjectStore(Es.store,{keyPath:Es.keyPath})}(t)}))),n<5&&r>=5&&(a=a.next((function(){return i.Re(o)}))),n<6&&r>=6&&(a=a.next((function(){return function(t){t.createObjectStore(ys.store)}(t),i.be(o)}
986))),n<7&&r>=7&&(a=a.next((function(){return i.ve(o)}))),n<8&&r>=8&&(a=a.next((function(){return i.Pe(t,o)}))),n<9&&r>=9&&(a=a.next((function(){!function(t){t.objectStoreNames.contains("remoteDocumentChanges")&&t.deleteObjectStore("remoteDocumentChanges")}(t),function(t){var e=t.objectStore(ms.store);e.createIndex(ms.readTimeIndex,ms.readTimeIndexPath,{unique:!1}),e.createIndex(ms.collectionReadTimeIndex,ms.collectionReadTimeIndexPath,{unique:!1})}(e)}))),n<10&&r>=10&&(a=a.next((function(){return i.Ve(o)}))),n<11&&r>=11&&(a=a.next((function(){!function(t){t.createObjectStore(Ts.store,{keyPath:Ts.keyPath})}(t),function(t){t.createObjectStore(Ss.store,{keyPath:Ss.keyPath})}(t)}))),a},t.prototype.be=function(t){var e=0;return t.store(ms.store).Ot((function(t,n){e+=fu(n)})).next((function(){var n=new ys(e);return t.store(ys.store).put(ys.key,n)}))},t.prototype.Re=function(t){var e=this,n=t.store(fs.store),r=t.store(ps.store);return n.Nt().next((function(n){return Rs.forEach(n,(function(n){var i=IDBKeyRange.bound([n.userId,-1],[n.userId,n.lastAcknowledgedBatchId]);return r.Nt(ps.userMutationsIndex,i).next((function(r){return Rs.forEach(r,(function(r){Gr(r.userId===n.userId);var i=$s(e.R,r);return lu(t,n.userId,i).next((function(){}))}))}))}))}))},t.prototype.ve=function(t){var e=t.store(ws.store),n=t.store(ms.store);return t.store(_s.store).get(_s.key).next((function(t){var r=[];return n.Ot((function(n,i){var o=new ii(n),a=function(t){return[0,as(t)]}(o);r.push(e.get(a).next((function(n){return n?Rs.resolve():function(n){return e.put(new ws(0,as(n),t.highestListenSequenceNumber))}(o)})))})).next((function(){return Rs.waitFor(r)}))}))},t.prototype.Pe=function(t,e){t.createObjectStore(Is.store,{keyPath:Is.keyPath});var n=e.store(Is.store),r=new au,i=function(t){if(r.add(t)){var e=t.lastSegment(),i=t.popLast();return n.put({collectionId:e,parent:as(i)})}};return e.store(ms.store).Ot({kt:!0},(function(t,e){var n=new ii(t);return i(n.popLast())})).next((function(){return e.store(ds.store).Ot({kt:!0},(function(t,e){t[0];var n=t[1],r=(t[2],cs(n));return i(r.popLast())}))}))},t.prototype.Ve=function(t){var e=this,n=t.store(bs.store);return n.Ot((function(t,r){var i=Zs(r),o=tu(e.R,i);return n.put(o)}))},t}();function Fu(t){t.createObjectStore(ws.store,{keyPath:ws.keyPath}).createIndex(ws.documentTargetsIndex,ws.documentTargetsKeyPath,{unique:!0}),t.createObjectStore(bs.store,{keyPath:bs.keyPath}).createIndex(bs.queryTargetsIndexName,bs.queryTargetsKeyPath,{unique:!0}),t.createObjectStore(_s.store)}var Vu="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.",Hu=function(){function t(e,n,r,i,o,a,s,u,c,h){if(this.allowTabSynchronization=e,this.persistenceKey=n,this.clientId=r,this.Se=o,this.window=a,this.document=s,this.De=c,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.Oe=null,this.$e=Number.NEGATIVE_INFINITY,this.Me=function(t){return Promise.resolve()},!t.yt())throw new Ur(Mr.UNIMPLEMENTED,"This platform is either missing IndexedDB or is known to have an incomplete implementation. Offline persistence has been disabled.");this.referenceDelegate=new Nu(this,i),this.Le=n+"main",this.R=new Gs(u),this.Be=new Ds(this.Le,11,new Uu(this.R)),this.qe=new bu(this.referenceDelegate,this.R),this.Ut=new su,this.Ue=function(t,e){return new Du(t,e)}(this.R,this.Ut),this.Qe=new nu,this.window&&this.window.localStorage?this.Ke=this.window.localStorage:(this.Ke=null,!1===h&&jr("IndexedDbPersistence","LocalStorage is unavailable. As a result, persistence may not work reliably. In particular enablePersistence() could fail immediately after refreshing the page."))}return t.prototype.start=function(){var t=this;return this.je().then((function(){if(!t.isPrimary&&!t.allowTabSynchronization)throw new Ur(Mr.FAILED_PRECONDITION,Vu);return t.We(),t.Ge(),t.ze(),t.runTransaction("getHighestListenSequenceNumber","readonly",(function(e){return t.qe.getHighestSequenceNumber(e)}))})).then((function(e){t.Ne=new xr(e,t.De)})).then((function(){t.xe=!0})).catch((function(e){return t.Be&&t.Be.close(),Promise.reject(e)}))},t.prototype.He=function(t){var e=this;return this.Me=function(n){return(0,Pr.sH)(e,void 0,void 0,(function(){return(0,Pr.YH)(this,(function(e){return this.started?[2,t(n)]:[2]}))}))},t(this.isPrimary)},t.prototype.setDatabaseDeletedListener=function(t){var e=this;this.Be.vt((function(n){return(0,Pr.sH)(e,void 0,void 0,(function(){return(0,Pr.YH)(this,(function(e){switch(e.label){case 0:return null===n.newVersion?[4,t()]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}}
986))}))}))},t.prototype.setNetworkEnabled=function(t){var e=this;this.networkEnabled!==t&&(this.networkEnabled=t,this.Se.enqueueAndForget((function(){return(0,Pr.sH)(e,void 0,void 0,(function(){return(0,Pr.YH)(this,(function(t){switch(t.label){case 0:return this.started?[4,this.je()]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}}))}))})))},t.prototype.je=function(){var t=this;return this.runTransaction("updateClientMetadataAndTryBecomePrimary","readwrite",(function(e){return qu(e).put(new Es(t.clientId,Date.now(),t.networkEnabled,t.inForeground)).next((function(){if(t.isPrimary)return t.Je(e).next((function(e){e||(t.isPrimary=!1,t.Se.enqueueRetryable((function(){return t.Me(!1)})))}))})).next((function(){return t.Ye(e)})).next((function(n){return t.isPrimary&&!n?t.Xe(e).next((function(){return!1})):!!n&&t.Ze(e).next((function(){return!0}))}))})).catch((function(e){if(xs(e))return Hr("IndexedDbPersistence","Failed to extend owner lease: ",e),t.isPrimary;if(!t.allowTabSynchronization)throw e;return Hr("IndexedDbPersistence","Releasing owner lease after error during lease refresh",e),!1})).then((function(e){t.isPrimary!==e&&t.Se.enqueueRetryable((function(){return t.Me(e)})),t.isPrimary=e}))},t.prototype.Je=function(t){var e=this;return ju(t).get(ls.key).next((function(t){return Rs.resolve(e.tn(t))}))},t.prototype.en=function(t){return qu(t).delete(this.clientId)},t.prototype.nn=function(){return(0,Pr.sH)(this,void 0,void 0,(function(){var t,e,n,r,i=this;return(0,Pr.YH)(this,(function(o){switch(o.label){case 0:return!this.isPrimary||this.sn(this.$e,18e5)?[3,2]:(this.$e=Date.now(),[4,this.runTransaction("maybeGarbageCollectMultiClientState","readwrite-primary",(function(t){var e=js(t,Es.store);return e.Nt().next((function(t){var n=i.rn(t,18e5),r=t.filter((function(t){return-1===n.indexOf(t)}));return Rs.forEach(r,(function(t){return e.delete(t.clientId)})).next((function(){return r}))}))})).catch((function(){return[]}))]);case 1:if(t=o.sent(),this.Ke)for(e=0,n=t;e<n.length;e++)r=n[e],this.Ke.removeItem(this.on(r.clientId));o.label=2;case 2:return[2]}}
986))}))},t.prototype.ze=function(){var t=this;this.Oe=this.Se.enqueueAfterDelay("client_metadata_refresh",4e3,(function(){return t.je().then((function(){return t.nn()})).then((function(){return t.ze()}))}))},t.prototype.tn=function(t){return!!t&&t.ownerId===this.clientId},t.prototype.Ye=function(t){var e=this;return this.Ce?Rs.resolve(!0):ju(t).get(ls.key).next((function(n){if(null!==n&&e.sn(n.leaseTimestampMs,5e3)&&!e.cn(n.ownerId)){if(e.tn(n)&&e.networkEnabled)return!0;if(!e.tn(n)){if(!n.allowTabSynchronization)throw new Ur(Mr.FAILED_PRECONDITION,Vu);return!1}}return!(!e.networkEnabled||!e.inForeground)||qu(t).Nt().next((function(t){return void 0===e.rn(t,5e3).find((function(t){if(e.clientId!==t.clientId){var n=!e.networkEnabled&&t.networkEnabled,r=!e.inForeground&&t.inForeground,i=e.networkEnabled===t.networkEnabled;if(n||r&&i)return!0}return!1}))}))})).next((function(t){return e.isPrimary!==t&&Hr("IndexedDbPersistence","Client "+(t?"is":"is not")+" eligible for a primary lease."),t}))},t.prototype.shutdown=function(){return(0,Pr.sH)(this,void 0,void 0,(function(){var t=this;return(0,Pr.YH)(this,(function(e){switch(e.label){case 0:return this.xe=!1,this.un(),this.Oe&&(this.Oe.cancel(),this.Oe=null),this.an(),this.hn(),[4,this.Be.runTransaction("shutdown","readwrite",[ls.store,Es.store],(function(e){var n=new Hs(e,xr.o);return t.Xe(n).next((function(){return t.en(n)}))}))];case 1:return e.sent(),this.Be.close(),this.ln(),[2]}}))}))},t.prototype.rn=function(t,e){var n=this;return t.filter((function(t){return n.sn(t.updateTimeMs,e)&&!n.cn(t.clientId)}))},t.prototype.fn=function(){var t=this;return this.runTransaction("getActiveClients","readonly",(function(e){return qu(e).Nt().next((function(e){return t.rn(e,18e5).map((function(t){return t.clientId}))}))}))},Object.defineProperty(t.prototype,"started",{get:function(){return this.xe},enumerable:!1,configurable:!0}),t.prototype.getMutationQueue=function(t){return pu.Kt(t,this.R,this.Ut,this.referenceDelegate)},t.prototype.getTargetCache=function(){return this.qe},t.prototype.getRemoteDocumentCache=function(){return this.Ue},t.prototype.getIndexManager=function(){return this.Ut},t.prototype.getBundleCache=function(){return this.Qe},t.prototype.runTransaction=function(t,e,n){var r=this;Hr("IndexedDbPersistence","Starting transaction:",t);var i,o="readonly"===e?"readonly":"readwrite";return this.Be.runTransaction(t,o,As,(function(o){return i=new Hs(o,r.Ne?r.Ne.next():xr.o),"readwrite-primary"===e?r.Je(i).next((function(t){return!!t||r.Ye(i)})).next((function(e){if(!e)throw jr("Failed to obtain primary lease for action '"+t+"'."),r.isPrimary=!1,r.Se.enqueueRetryable((function(){return r.Me(!1)})),new Ur(Mr.FAILED_PRECONDITION,ks);return n(i)})).next((function(t){return r.Ze(i).next((function(){return t}))})):r.dn(i).next((function(){return n(i)}))})).then((function(t){return i.raiseOnCommittedEvent(),t}))},t.prototype.dn=function(t){var e=this;return ju(t).get(ls.key).next((function(t){if(null!==t&&e.sn(t.leaseTimestampMs,5e3)&&!e.cn(t.ownerId)&&!e.tn(t)&&!(e.Ce||e.allowTabSynchronization&&t.allowTabSynchronization))throw new Ur(Mr.FAILED_PRECONDITION,Vu)}))},t.prototype.Ze=function(t){var e=new ls(this.clientId,this.allowTabSynchronization,Date.now());return ju(t).put(ls.key,e)},t.yt=function(){return Ds.yt()},t.prototype.Xe=function(t){var e=this,n=ju(t);return n.get(ls.key).next((function(t){return e.tn(t)?(Hr("IndexedDbPersistence","Releasing primary lease."),n.delete(ls.key)):Rs.resolve()}))},t.prototype.sn=function(t,e){var n=Date.now();return!(t<n-e||t>n&&(jr("Detected an update time that is in the future: "+t+" > "+n),1))},t.prototype.We=function(){var t=this;null!==this.document&&"function"==typeof this.document.addEventListener&&(this.ke=function(){t.Se.enqueueAndForget((function(){return t.inForeground="visible"===t.document.visibilityState,t.je()}))},this.document.addEventListener("visibilitychange",this.ke),this.inForeground="visible"===this.document.visibilityState)},t.prototype.an=function(){this.ke&&(this.document.removeEventListener("visibilitychange",this.ke),this.ke=null)},t.prototype.Ge=function(){var t,e=this;"function"==typeof(null===(t=this.window)||void 0===t?void 0:t.addEventListener)&&(this.Fe=function(){e.un(),e.Se.enqueueAndForget((function(){return e.shutdown()}))},this.window.addEventListener("unload",this.Fe))},t.prototype.hn=function(){this.Fe&&(this.window.removeEventListener("unload",this.Fe),this.Fe=null)},t.prototype.cn=function(t){var e;try{var n=null!==(null===(e=this.Ke)||void 0===e?void 0:e.getItem(this.on(t)));return Hr("IndexedDbPersistence","Client '"+t+"' "+(n?"is":"is not")+" zombied in LocalStorage"),n}catch(t){return jr("IndexedDbPersistence","Failed to get zombied client id.",t),!1}},t.prototype.un=function(){if(this.Ke)try{this.Ke.setItem(this.on(this.clientId),String(Date.now()))}catch(t){jr("Failed to set zombie client id.",t)}},t.prototype.ln=function(){if(this.Ke)try{this.Ke.removeItem(this.on(this.clientId))}catch(t){}},t.prototype.on=function(t){return"firestore_zombie_"+this.persistenceKey+"_"+t},t}();function ju(t){return js(t,ls.store)}function qu(t){return js(t,Es.store)}function Bu(t,e){var n=t.projectId;return t.isDefaultDatabase||(n+="."+t.database),"firestore/"+e+"/"+n+"/" 987/** 988 * @license 989 * Copyright 2020 Google LLC 990 * 991 * Licensed under the Apache License, Version 2.0 (the "License");
992 * you may not use this file except in compliance with the License. 993 * You may obtain a copy of the License at 994 * 995 * http://www.apache.org/licenses/LICENSE-2.0 996 * 997 * Unless required by applicable law or agreed to in writing, software 998 * distributed under the License is distributed on an "AS IS" BASIS, 999 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1000 * See the License for the specific language governing permissions and 1001 * limitations under the License. 1002 */}var Ku=function(t,e){this.progress=t,this.wn=e},Gu=function(){function t(t,e,n){this.Ue=t,this._n=e,this.Ut=n}return t.prototype.mn=function(t,e){var n=this;return this._n.getAllMutationBatchesAffectingDocumentKey(t,e).next((function(r){return n.yn(t,e,r)}))},t.prototype.yn=function(t,e,n){return this.Ue.getEntry(t,e).next((function(t){for(var e=0,r=n;e<r.length;e++)r[e].applyToLocalView(t);return t}))},t.prototype.gn=function(t,e){t.forEach((function(t,n){for(var r=0,i=e;r<i.length;r++)i[r].applyToLocalView(n)}))},t.prototype.pn=function(t,e){var n=this;return this.Ue.getEntries(t,e).next((function(e){return n.En(t,e).next((function(){return e}))}))},t.prototype.En=function(t,e){var n=this;return this._n.getAllMutationBatchesAffectingDocumentKeys(t,e).next((function(t){return n.gn(e,t)}))},t.prototype.getDocumentsMatchingQuery=function(t,e,n){return function(t){return bi.isDocumentKey(t.path)&&null===t.collectionGroup&&0===t.filters.length}(e)?this.Tn(t,e.path):co(e)?this.In(t,e,n):this.An(t,e,n)},t.prototype.Tn=function(t,e){return this.mn(t,new bi(e)).next((function(t){var e=la();return t.isFoundDocument()&&(e=e.insert(t.key,t)),e}))},t.prototype.In=function(t,e,n){var r=this,i=e.collectionGroup,o=la();return this.Ut.getCollectionParents(t,i).next((function(a){return Rs.forEach(a,(function(a){var s=function(t,e){return new no(e,null,t.explicitOrderBy.slice(),t.filters.slice(),t.limit,t.limitType,t.startAt,t.endAt)}(e,a.child(i));return r.An(t,s,n).next((function(t){t.forEach((function(t,e){o=o.insert(t,e)}))}))})).next((function(){return o}))}))},t.prototype.An=function(t,e,n){var r,i,o=this;return this.Ue.getDocumentsMatchingQuery(t,e,n).next((function(n){return r=n,o._n.getAllMutationBatchesAffectingQuery(t,e)})).next((function(e){return i=e,o.Rn(t,i,r).next((function(t){r=t;for(var e=0,n=i;e<n.length;e++)for(var o=n[e],a=0,s=o.mutations;a<s.length;a++){var u=s[a],c=u.key,h=r.get(c);null==h&&(h=xi.newInvalidDocument(c),r=r.insert(c,h)),jo(u,h,o.localWriteTime),h.isFoundDocument()||(r=r.remove(c))}}))})).next((function(){return r.forEach((function(t,n){mo(e,n)||(r=r.remove(t))})),r}))},t.prototype.Rn=function(t,e,n){for(var r=va(),i=0,o=e;i<o.length;i++)for(var a=0,s=o[i].mutations;a<s.length;a++){var u=s[a];u instanceof Yo&&null===n.get(u.key)&&(r=r.add(u.key))}var c=n;return this.Ue.getEntries(t,r).next((function(t){return t.forEach((function(t,e){e.isFoundDocument()&&(c=c.insert(t,e))})),c}))},t}(),Yu=function(){function t(t,e,n,r){this.targetId=t,this.fromCache=e,this.bn=n,this.vn=r}return t.Pn=function(e,n){for(var r=va(),i=va(),o=0,a=n.docChanges;o<a.length;o++){var s=a[o];switch(s.type){case 0:r=r.add(s.doc.key);break;case 1:i=i.add(s.doc.key)}}return new t(e,n.fromCache,r,i)},t}(),zu=function(){function t(){}return t.prototype.Vn=function(t){this.Sn=t},t.prototype.getDocumentsMatchingQuery=function(t,e,n,r){var i=this;return function(t){return 0===t.filters.length&&null===t.limit&&null==t.startAt&&null==t.endAt&&(0===t.explicitOrderBy.length||1===t.explicitOrderBy.length&&t.explicitOrderBy[0].field.isKeyField())}(e)||n.isEqual(Zr.min())?this.Dn(t,e):this.Sn.pn(t,r).next((function(a){var s=i.Cn(e,a);return(oo(e)||ao(e))&&i.Nn(e.limitType,s,r,n)?i.Dn(t,e):(Vr()<=o.$b.DEBUG&&Hr("QueryEngine","Re-using previous result from %s to execute query: %s",n.toString(),go(e)),i.Sn.getDocumentsMatchingQuery(t,e,n).next((function(t){return s.forEach((function(e){t=t.insert(e.key,e)})),t})))}))},t.prototype.Cn=function(t,e){var n=new aa(yo(t));return e.forEach((function(e,r){mo(t,r)&&(n=n.add(r))})),n},t.prototype.Nn=function(t,e,n,r){if(n.size!==e.size)return!0;var i="F"===t?e.last():e.first();return!!i&&(i.hasPendingWrites||i.version.compareTo(r)>0)},t.prototype.Dn=function(t,e){return Vr()<=o.$b.DEBUG&&Hr("QueryEngine","Using full collection scan to execute query:",go(e)),this.Sn.getDocumentsMatchingQuery(t,e,Zr.min())},t}(),Wu=function(){function t(t,e,n,r){this.persistence=t,this.xn=e,this.R=r,this.Fn=new ra(Xr),this.kn=new Ru((function(t){return Fi(t)}),Vi),this.On=Zr.min(),this._n=t.getMutationQueue(n),this.$n=t.getRemoteDocumentCache(),this.qe=t.getTargetCache(),this.Mn=new Gu(this.$n,this._n,this.persistence.getIndexManager()),this.Qe=t.getBundleCache(),this.xn.Vn(this.Mn)}return t.prototype.collectGarbage=function(t){var e=this;return this.persistence.runTransaction("Collect garbage","readwrite-primary",(function(n){return t.collect(n,e.Fn)}))},t}(); 1003/** 1004 * @license 1005 * Copyright 2017 Google LLC 1006 * 1007 * Licensed under the Apache License, Version 2.0 (the "License");
1008 * you may not use this file except in compliance with the License. 1009 * You may obtain a copy of the License at 1010 * 1011 * http://www.apache.org/licenses/LICENSE-2.0 1012 * 1013 * Unless required by applicable law or agreed to in writing, software 1014 * distributed under the License is distributed on an "AS IS" BASIS, 1015 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1016 * See the License for the specific language governing permissions and 1017 * limitations under the License. 1018 */function Xu(t,e,n,r){return new Wu(t,e,n,r)}function Qu(t,e){return(0,Pr.sH)(this,void 0,void 0,(function(){var n,r,i,o;return(0,Pr.YH)(this,(function(a){switch(a.label){case 0:return n=Yr(t),r=n._n,i=n.Mn,[4,n.persistence.runTransaction("Handle user change","readonly",(function(t){var o;return n._n.getAllMutationBatches(t).next((function(a){return o=a,r=n.persistence.getMutationQueue(e),i=new Gu(n.$n,r,n.persistence.getIndexManager()),r.getAllMutationBatches(t)})).next((function(e){for(var n=[],r=[],a=va(),s=0,u=o;s<u.length;s++){var c=u[s];n.push(c.batchId);for(var h=0,l=c.mutations;h<l.length;h++){var f=l[h];a=a.add(f.key)}}for(var p=0,d=e;p<d.length;p++){var v=d[p];r.push(v.batchId);for(var g=0,m=v.mutations;g<m.length;g++){var y=m[g];a=a.add(y.key)}}return i.pn(t,a).next((function(t){return{Ln:t,removedBatchIds:n,addedBatchIds:r}}))}))}))];case 1:return o=a.sent(),[2,(n._n=r,n.Mn=i,n.xn.Vn(n.Mn),o)]}}))}))}function Ju(t,e){var n=Yr(t);return n.persistence.runTransaction("Acknowledge batch","readwrite-primary",(function(t){var r=e.batch.keys(),i=n.$n.newChangeBuffer({trackRemovals:!0});return function(t,e,n,r){var i=n.batch,o=i.keys(),a=Rs.resolve();return o.forEach((function(t){a=a.next((function(){return r.getEntry(e,t)})).next((function(e){var o=n.docVersions.get(t);Gr(null!==o),e.version.compareTo(o)<0&&(i.applyToRemoteDocument(e,n),e.isValidDocument()&&r.addEntry(e,n.commitVersion))}))})),a.next((function(){return t._n.removeMutationBatch(e,i)}))}(n,t,e,i).next((function(){return i.apply(t)})).next((function(){return n._n.performConsistencyCheck(t)})).next((function(){return n.Mn.pn(t,r)}))}))}function $u(t){var e=Yr(t);return e.persistence.runTransaction("Get last remote snapshot version","readonly",(function(t){return e.qe.getLastRemoteSnapshotVersion(t)}))}function Zu(t,e){var n=Yr(t),r=e.snapshotVersion,i=n.Fn;return n.persistence.runTransaction("Apply remote event","readwrite-primary",(function(t){var o=n.$n.newChangeBuffer({trackRemovals:!0});i=n.Fn;var a=[];
1018e.targetChanges.forEach((function(e,o){var s=i.get(o);if(s){a.push(n.qe.removeMatchingKeys(t,e.removedDocuments,o).next((function(){return n.qe.addMatchingKeys(t,e.addedDocuments,o)})));var u=e.resumeToken;if(u.approximateByteSize()>0){var c=s.withResumeToken(u,r).withSequenceNumber(t.currentSequenceNumber);i=i.insert(o,c),function(t,e,n){return Gr(e.resumeToken.approximateByteSize()>0),0===t.resumeToken.approximateByteSize()||e.snapshotVersion.toMicroseconds()-t.snapshotVersion.toMicroseconds()>=3e8||n.addedDocuments.size+n.modifiedDocuments.size+n.removedDocuments.size>0}(s,c,e)&&a.push(n.qe.updateTargetData(t,c))}}}));var s=ca();if(e.documentUpdates.forEach((function(r,i){e.resolvedLimboDocuments.has(r)&&a.push(n.persistence.referenceDelegate.updateLimboDocument(t,r))})),a.push(tc(t,o,e.documentUpdates,r,void 0).next((function(t){s=t}))),!r.isEqual(Zr.min())){var u=n.qe.getLastRemoteSnapshotVersion(t).next((function(e){return n.qe.setTargetsMetadata(t,t.currentSequenceNumber,r)}));a.push(u)}return Rs.waitFor(a).next((function(){return o.apply(t)})).next((function(){return n.Mn.En(t,s)})).next((function(){return s}))})).then((function(t){return n.Fn=i,t}))}function tc(t,e,n,r,i){var o=va();return n.forEach((function(t){return o=o.add(t)})),e.getEntries(t,o).next((function(t){var o=ca();return n.forEach((function(n,a){var s=t.get(n),u=(null==i?void 0:i.get(n))||r;a.isNoDocument()&&a.version.isEqual(Zr.min())?(e.removeEntry(n,u),o=o.insert(n,a)):!s.isValidDocument()||a.version.compareTo(s.version)>0||0===a.version.compareTo(s.version)&&s.hasPendingWrites?(e.addEntry(a,u),o=o.insert(n,a)):Hr("LocalStore","Ignoring outdated watch update for ",n,". Current version:",s.version," Watch version:",a.version)})),o}))}function ec(t,e){var n=Yr(t);return n.persistence.runTransaction("Get next mutation batch","readonly",(function(t){return void 0===e&&(e=-1),n._n.getNextMutationBatchAfterBatchId(t,e)}))}function nc(t,e){var n=Yr(t);return n.persistence.runTransaction("Allocate target","readwrite",(function(t){var r;return n.qe.getTargetData(t,e).next((function(i){return i?(r=i,Rs.resolve(r)):n.qe.allocateTargetId(t).next((function(i){return r=new Ks(e,i,0,t.currentSequenceNumber),n.qe.addTargetData(t,r).next((function(){return r}))}))}))})).then((function(t){var r=n.Fn.get(t.targetId);return(null===r||t.snapshotVersion.compareTo(r.snapshotVersion)>0)&&(n.Fn=n.Fn.insert(t.targetId,t),n.kn.set(e,t.targetId)),t}))}function rc(t,e,n){return(0,Pr.sH)(this,void 0,void 0,(function(){var r,i,o,a;return(0,Pr.YH)(this,(function(s){switch(s.label){case 0:r=Yr(t),i=r.Fn.get(e),o=n?"readwrite":"readwrite-primary",s.label=1;case 1:return s.trys.push([1,4,,5]),n?[3,3]:[4,r.persistence.runTransaction("Release target",o,(function(t){return r.persistence.referenceDelegate.removeTarget(t,i)}))];case 2:s.sent(),s.label=3;case 3:return[3,5];case 4:if(!xs(a=s.sent()))throw a;return Hr("LocalStore","Failed to update sequence numbers for target "+e+": "+a),[3,5];case 5:return r.Fn=r.Fn.remove(e),r.kn.delete(i.target),[2]}}))}))}function ic(t,e,n){var r=Yr(t),i=Zr.min(),o=va();return r.persistence.runTransaction("Execute query","readonly",(function(t){return function(t,e,n){var r=Yr(t),i=r.kn.get(n);return void 0!==i?Rs.resolve(r.Fn.get(i)):r.qe.getTargetData(e,n)}(r,t,lo(e)).next((function(e){if(e)return i=e.lastLimboFreeSnapshotVersion,r.qe.getMatchingKeysForTargetId(t,e.targetId).next((function(t){o=t}))})).next((function(){return r.xn.getDocumentsMatchingQuery(t,e,n?i:Zr.min(),n?o:va())})).next((function(t){return{documents:t,Bn:o}}))}))}function oc(t,e){var n=Yr(t),r=Yr(n.qe),i=n.Fn.get(e);return i?Promise.resolve(i.target):n.persistence.runTransaction("Get target data","readonly",(function(t){return r.lt(t,e).next((function(t){return t?t.target:null}))}))}function ac(t){var e=Yr(t);return e.persistence.runTransaction("Get new document changes","readonly",(function(t){return function(t,e,n){var r=Yr(t),i=ca(),o=Ws(n),a=xu(e),s=IDBKeyRange.lowerBound(o,!0);return a.Ot({index:ms.readTimeIndex,range:s},(function(t,e){var n=Ys(r.R,e);i=i.insert(n.key,n),o=e.readTime})).next((function(){return{wn:i,readTime:Xs(o)}}))}(e.$n,t,e.On)}
1018)).then((function(t){var n=t.wn,r=t.readTime;return e.On=r,n}))}function sc(t){return(0,Pr.sH)(this,void 0,void 0,(function(){var e;return(0,Pr.YH)(this,(function(n){return[2,(e=Yr(t)).persistence.runTransaction("Synchronize last document change read time","readonly",(function(t){return function(t){var e=xu(t),n=Zr.min();return e.Ot({index:ms.readTimeIndex,reverse:!0},(function(t,e,r){e.readTime&&(n=Xs(e.readTime)),r.done()})).next((function(){return n}))}(t)})).then((function(t){e.On=t}))]}))}))}function uc(t,e,n,r){return(0,Pr.sH)(this,void 0,void 0,(function(){var i,o,a,s,u,c,h,l,f,p;return(0,Pr.YH)(this,(function(d){switch(d.label){case 0:for(i=Yr(t),o=va(),a=ca(),s=pa(),u=0,c=n;u<c.length;u++)h=c[u],l=e.qn(h.metadata.name),h.document&&(o=o.add(l)),a=a.insert(l,e.Un(h)),s=s.insert(l,e.Qn(h.metadata.readTime));return f=i.$n.newChangeBuffer({trackRemovals:!0}),[4,nc(i,function(t){return lo(io(ii.fromString("__bundle__/docs/"+t)))}(r))];case 1:return p=d.sent(),[2,i.persistence.runTransaction("Apply bundle documents","readwrite",(function(t){return tc(t,f,a,Zr.min(),s).next((function(e){return f.apply(t),e})).next((function(e){return i.qe.removeMatchingKeysForTargetId(t,p.targetId).next((function(){return i.qe.addMatchingKeys(t,o,p.targetId)})).next((function(){return i.Mn.En(t,e)})).next((function(){return e}))}))}))]}}))}))}function cc(t,e,n){return void 0===n&&(n=va()),(0,Pr.sH)(this,void 0,void 0,(function(){var r,i;return(0,Pr.YH)(this,(function(o){switch(o.label){case 0:return[4,nc(t,lo(eu(e.bundledQuery)))];case 1:return r=o.sent(),[2,(i=Yr(t)).persistence.runTransaction("Save named query","readwrite",(function(t){var o=Pa(e.readTime);if(r.snapshotVersion.compareTo(o)>=0)return i.Qe.saveNamedQuery(t,e);var a=r.withResumeToken(ui.EMPTY_BYTE_STRING,o);return i.Fn=i.Fn.insert(a.targetId,a),i.qe.updateTargetData(t,a).next((function(){return i.qe.removeMatchingKeysForTargetId(t,r.targetId)})).next((function(){return i.qe.addMatchingKeys(t,n,r.targetId)})).next((function(){return i.Qe.saveNamedQuery(t,e)}))}))]}}))})) 1019/** 1020 * @license 1021 * Copyright 2020 Google LLC 1022 * 1023 * Licensed under the Apache License, Version 2.0 (the "License"); 1024 * you may not use this file except in compliance with the License. 1025 * You may obtain a copy of the License at 1026 * 1027 * http://www.apache.org/licenses/LICENSE-2.0 1028 * 1029 * Unless required by applicable law or agreed to in writing, software 1030 * distributed under the License is distributed on an "AS IS" BASIS, 1031 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1032 * See the License for the specific language governing permissions and 1033 * limitations under the License. 1034 */}var hc=function(){function t(t){this.R=t,this.Kn=new Map,this.jn=new Map}return t.prototype.getBundleMetadata=function(t,e){return Rs.resolve(this.Kn.get(e))},t.prototype.saveBundleMetadata=function(t,e){var n;return this.Kn.set(e.id,{id:(n=e).id,version:n.version,createTime:Pa(n.createTime)}),Rs.resolve()},t.prototype.getNamedQuery=function(t,e){return Rs.resolve(this.jn.get(e))},t.prototype.saveNamedQuery=function(t,e){return this.jn.set(e.name,function(t){return{name:t.name,query:eu(t.bundledQuery),readTime:Pa(t.readTime)}}(e)),Rs.resolve()},t}(),lc=function(){function t(){this.Wn=new aa(fc.Gn),this.zn=new aa(fc.Hn)}return t.prototype.isEmpty=function(){return this.Wn.isEmpty()},t.prototype.addReference=function(t,e){var n=new fc(t,e);this.Wn=this.Wn.add(n),this.zn=this.zn.add(n)},t.prototype.Jn=function(t,e){var n=this;t.forEach((function(t){return n.addReference(t,e)}))},t.prototype.removeReference=function(t,e){this.Yn(new fc(t,e))},t.prototype.Xn=function(t,e){var n=this;t.forEach((function(t){return n.removeReference(t,e)}))},t.prototype.Zn=function(t){var e=this,n=new bi(new ii([])),r=new fc(n,t),i=new fc(n,t+1),o=[];return this.zn.forEachInRange([r,i],(function(t){e.Yn(t),o.push(t.key)})),o},t.prototype.ts=function(){var t=this;this.Wn.forEach((function(e){return t.Yn(e)}))},t.prototype.Yn=function(t){this.Wn=this.Wn.delete(t),this.zn=this.zn.delete(t)},t.prototype.es=function(t){var e=new bi(new ii([])),n=new fc(e,t),r=new fc(e,t+1),i=va();
1034return this.zn.forEachInRange([n,r],(function(t){i=i.add(t.key)})),i},t.prototype.containsKey=function(t){var e=new fc(t,0),n=this.Wn.firstAfterOrEqual(e);return null!==n&&t.isEqual(n.key)},t}(),fc=function(){function t(t,e){this.key=t,this.ns=e}return t.Gn=function(t,e){return bi.comparator(t.key,e.key)||Xr(t.ns,e.ns)},t.Hn=function(t,e){return Xr(t.ns,e.ns)||bi.comparator(t.key,e.key)},t}(),pc=function(){function t(t,e){this.Ut=t,this.referenceDelegate=e,this._n=[],this.ss=1,this.rs=new aa(fc.Gn)}return t.prototype.checkEmpty=function(t){return Rs.resolve(0===this._n.length)},t.prototype.addMutationBatch=function(t,e,n,r){var i=this.ss;this.ss++,this._n.length>0&&this._n[this._n.length-1];var o=new qs(i,e,n,r);this._n.push(o);for(var a=0,s=r;a<s.length;a++){var u=s[a];this.rs=this.rs.add(new fc(u.key,i)),this.Ut.addToCollectionParentIndex(t,u.key.path.popLast())}return Rs.resolve(o)},t.prototype.lookupMutationBatch=function(t,e){return Rs.resolve(this.os(e))},t.prototype.getNextMutationBatchAfterBatchId=function(t,e){var n=e+1,r=this.cs(n),i=r<0?0:r;return Rs.resolve(this._n.length>i?this._n[i]:null)},t.prototype.getHighestUnacknowledgedBatchId=function(){return Rs.resolve(0===this._n.length?-1:this.ss-1)},t.prototype.getAllMutationBatches=function(t){return Rs.resolve(this._n.slice())},t.prototype.getAllMutationBatchesAffectingDocumentKey=function(t,e){var n=this,r=new fc(e,0),i=new fc(e,Number.POSITIVE_INFINITY),o=[];return this.rs.forEachInRange([r,i],(function(t){var e=n.os(t.ns);o.push(e)})),Rs.resolve(o)},t.prototype.getAllMutationBatchesAffectingDocumentKeys=function(t,e){var n=this,r=new aa(Xr);return e.forEach((function(t){var e=new fc(t,0),i=new fc(t,Number.POSITIVE_INFINITY);n.rs.forEachInRange([e,i],(function(t){r=r.add(t.ns)}))})),Rs.resolve(this.us(r))},t.prototype.getAllMutationBatchesAffectingQuery=function(t,e){var n=e.path,r=n.length+1,i=n;bi.isDocumentKey(i)||(i=i.child(""));var o=new fc(new bi(i),0),a=new aa(Xr);return this.rs.forEachWhile((function(t){var e=t.key.path;return!!n.isPrefixOf(e)&&(e.length===r&&(a=a.add(t.ns)),!0)}),o),Rs.resolve(this.us(a))},t.prototype.us=function(t){var e=this,n=[];return t.forEach((function(t){var r=e.os(t);null!==r&&n.push(r)})),n},t.prototype.removeMutationBatch=function(t,e){var n=this;Gr(0===this.hs(e.batchId,"removed")),this._n.shift();var r=this.rs;return Rs.forEach(e.mutations,(function(i){var o=new fc(i.key,e.batchId);return r=r.delete(o),n.referenceDelegate.markPotentiallyOrphaned(t,i.key)})).next((function(){n.rs=r}))},t.prototype.Gt=function(t){},t.prototype.containsKey=function(t,e){var n=new fc(e,0),r=this.rs.firstAfterOrEqual(n);return Rs.resolve(e.isEqual(r&&r.key))},t.prototype.performConsistencyCheck=function(t){return this._n.length,Rs.resolve()},t.prototype.hs=function(t,e){return this.cs(t)},t.prototype.cs=function(t){return 0===this._n.length?0:t-this._n[0].batchId},t.prototype.os=function(t){var e=this.cs(t);return e<0||e>=this._n.length?null:this._n[e]},t}(),dc=function(){function t(t,e){this.Ut=t,this.ls=e,this.docs=new ra(bi.comparator),this.size=0}return t.prototype.addEntry=function(t,e,n){var r=e.key,i=this.docs.get(r),o=i?i.size:0,a=this.ls(e);return this.docs=this.docs.insert(r,{document:e.clone(),size:a,readTime:n}),this.size+=a-o,this.Ut.addToCollectionParentIndex(t,r.path.popLast())},t.prototype.removeEntry=function(t){var e=this.docs.get(t);e&&(this.docs=this.docs.remove(t),this.size-=e.size)},t.prototype.getEntry=function(t,e){var n=this.docs.get(e);return Rs.resolve(n?n.document.clone():xi.newInvalidDocument(e))},t.prototype.getEntries=function(t,e){var n=this,r=ca();return e.forEach((function(t){var e=n.docs.get(t);r=r.insert(t,e?e.document.clone():xi.newInvalidDocument(t))})),Rs.resolve(r)},t.prototype.getDocumentsMatchingQuery=function(t,e,n){for(var r=ca(),i=new bi(e.path.child("")),o=this.docs.getIteratorFrom(i);o.hasNext();){var a=o.getNext(),s=a.key,u=a.value,c=u.document,h=u.readTime;if(!e.path.isPrefixOf(s.path))break;h.compareTo(n)<=0||mo(e,c)&&(r=r.insert(c.key,c.clone()))}return Rs.resolve(r)},t.prototype.fs=function(t,e){return Rs.forEach(this.docs,(function(t){return e(t)}))},t.prototype.newChangeBuffer=function(t){return new vc(this)},t.prototype.getSize=function(t){return Rs.resolve(this.size)},t}(),vc=function(t){function e(e){var n=this;return(n=t.call(this)||this).Ie=e,n}return(0,Pr.C6)(e,t),e.prototype.applyChanges=function(t){var e=this,n=[];
1034return this.changes.forEach((function(r,i){i.document.isValidDocument()?n.push(e.Ie.addEntry(t,i.document,e.getReadTime(r))):e.Ie.removeEntry(r)})),Rs.waitFor(n)},e.prototype.getFromCache=function(t,e){return this.Ie.getEntry(t,e)},e.prototype.getAllFromCache=function(t,e){return this.Ie.getEntries(t,e)},e}(Ou),gc=function(){function t(t){this.persistence=t,this.ds=new Ru((function(t){return Fi(t)}),Vi),this.lastRemoteSnapshotVersion=Zr.min(),this.highestTargetId=0,this.ws=0,this._s=new lc,this.targetCount=0,this.ys=yu.Jt()}return t.prototype.forEachTarget=function(t,e){return this.ds.forEach((function(t,n){return e(n)})),Rs.resolve()},t.prototype.getLastRemoteSnapshotVersion=function(t){return Rs.resolve(this.lastRemoteSnapshotVersion)},t.prototype.getHighestSequenceNumber=function(t){return Rs.resolve(this.ws)},t.prototype.allocateTargetId=function(t){return this.highestTargetId=this.ys.next(),Rs.resolve(this.highestTargetId)},t.prototype.setTargetsMetadata=function(t,e,n){return n&&(this.lastRemoteSnapshotVersion=n),e>this.ws&&(this.ws=e),Rs.resolve()},t.prototype.te=function(t){this.ds.set(t.target,t);var e=t.targetId;e>this.highestTargetId&&(this.ys=new yu(e),this.highestTargetId=e),t.sequenceNumber>this.ws&&(this.ws=t.sequenceNumber)},t.prototype.addTargetData=function(t,e){return this.te(e),this.targetCount+=1,Rs.resolve()},t.prototype.updateTargetData=function(t,e){return this.te(e),Rs.resolve()},t.prototype.removeTargetData=function(t,e){return this.ds.delete(e.target),this._s.Zn(e.targetId),this.targetCount-=1,Rs.resolve()},t.prototype.removeTargets=function(t,e,n){var r=this,i=0,o=[];return this.ds.forEach((function(a,s){s.sequenceNumber<=e&&null===n.get(s.targetId)&&(r.ds.delete(a),o.push(r.removeMatchingKeysForTargetId(t,s.targetId)),i++)})),Rs.waitFor(o).next((function(){return i}))},t.prototype.getTargetCount=function(t){return Rs.resolve(this.targetCount)},t.prototype.getTargetData=function(t,e){var n=this.ds.get(e)||null;return Rs.resolve(n)},t.prototype.addMatchingKeys=function(t,e,n){return this._s.Jn(e,n),Rs.resolve()},t.prototype.removeMatchingKeys=function(t,e,n){this._s.Xn(e,n);var r=this.persistence.referenceDelegate,i=[];return r&&e.forEach((function(e){i.push(r.markPotentiallyOrphaned(t,e))})),Rs.waitFor(i)},t.prototype.removeMatchingKeysForTargetId=function(t,e){return this._s.Zn(e),Rs.resolve()},t.prototype.getMatchingKeysForTargetId=function(t,e){var n=this._s.es(e);return Rs.resolve(n)},t.prototype.containsKey=function(t,e){return Rs.resolve(this._s.containsKey(e))},t}(),mc=function(){function t(t,e){var n=this;this.gs={},this.Ne=new xr(0),this.xe=!1,this.xe=!0,this.referenceDelegate=t(this),this.qe=new gc(this),this.Ut=new ou,this.Ue=function(t){return new dc(t,(function(t){return n.referenceDelegate.ps(t)}))}(this.Ut),this.R=new Gs(e),this.Qe=new hc(this.R)}return t.prototype.start=function(){return Promise.resolve()},t.prototype.shutdown=function(){return this.xe=!1,Promise.resolve()},Object.defineProperty(t.prototype,"started",{get:function(){return this.xe},enumerable:!1,configurable:!0}),t.prototype.setDatabaseDeletedListener=function(){},t.prototype.setNetworkEnabled=function(){},t.prototype.getIndexManager=function(){return this.Ut},t.prototype.getMutationQueue=function(t){var e=this.gs[t.toKey()];return e||(e=new pc(this.Ut,this.referenceDelegate),this.gs[t.toKey()]=e),e},t.prototype.getTargetCache=function(){return this.qe},t.prototype.getRemoteDocumentCache=function(){return this.Ue},t.prototype.getBundleCache=function(){return this.Qe},t.prototype.runTransaction=function(t,e,n){var r=this;Hr("MemoryPersistence","Starting transaction:",t);var i=new yc(this.Ne.next());return this.referenceDelegate.Es(),n(i).next((function(t){return r.referenceDelegate.Ts(i).next((function(){return t}))})).toPromise().then((function(t){return i.raiseOnCommittedEvent(),t}))},t.prototype.Is=function(t,e){return Rs.or(Object.values(this.gs).map((function(n){return function(){return n.containsKey(t,e)}})))},t}(),yc=function(t){function e(e){var n=this;return(n=t.call(this)||this).currentSequenceNumber=e,n}return(0,Pr.C6)(e,t),e}(Ns),bc=function(){function t(t){this.persistence=t,this.As=new lc,this.Rs=null}return t.bs=function(e){return new t(e)},Object.defineProperty(t.prototype,"vs",{get:function(){if(this.Rs)return this.Rs;throw Kr()}
1034,enumerable:!1,configurable:!0}),t.prototype.addReference=function(t,e,n){return this.As.addReference(n,e),this.vs.delete(n.toString()),Rs.resolve()},t.prototype.removeReference=function(t,e,n){return this.As.removeReference(n,e),this.vs.add(n.toString()),Rs.resolve()},t.prototype.markPotentiallyOrphaned=function(t,e){return this.vs.add(e.toString()),Rs.resolve()},t.prototype.removeTarget=function(t,e){var n=this;this.As.Zn(e.targetId).forEach((function(t){return n.vs.add(t.toString())}));var r=this.persistence.getTargetCache();return r.getMatchingKeysForTargetId(t,e.targetId).next((function(t){t.forEach((function(t){return n.vs.add(t.toString())}))})).next((function(){return r.removeTargetData(t,e)}))},t.prototype.Es=function(){this.Rs=new Set},t.prototype.Ts=function(t){var e=this,n=this.persistence.getRemoteDocumentCache().newChangeBuffer();return Rs.forEach(this.vs,(function(r){var i=bi.fromPath(r);return e.Ps(t,i).next((function(t){t||n.removeEntry(i)}))})).next((function(){return e.Rs=null,n.apply(t)}))},t.prototype.updateLimboDocument=function(t,e){var n=this;return this.Ps(t,e).next((function(t){t?n.vs.delete(e.toString()):n.vs.add(e.toString())}))},t.prototype.ps=function(t){return 0},t.prototype.Ps=function(t,e){var n=this;return Rs.or([function(){return Rs.resolve(n.As.containsKey(e))},function(){return n.persistence.getTargetCache().containsKey(t,e)},function(){return n.persistence.Is(t,e)}])},t}(),wc=function(){function t(t){this.uid=t}return t.prototype.isAuthenticated=function(){return null!=this.uid},t.prototype.toKey=function(){return this.isAuthenticated()?"uid:"+this.uid:"anonymous-user"},t.prototype.isEqual=function(t){return t.uid===this.uid},t}(); 1035/** 1036 * @license 1037 * Copyright 2017 Google LLC 1038 * 1039 * Licensed under the Apache License, Version 2.0 (the "License"); 1040 * you may not use this file except in compliance with the License. 1041 * You may obtain a copy of the License at 1042 * 1043 * http://www.apache.org/licenses/LICENSE-2.0 1044 * 1045 * Unless required by applicable law or agreed to in writing, software 1046 * distributed under the License is distributed on an "AS IS" BASIS, 1047 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1048 * See the License for the specific language governing permissions and 1049 * limitations under the License. 1050 */function _c(t,e){return"firestore_clients_"+t+"_"+e}function Ic(t,e,n){var r="firestore_mutations_"+t+"_"+n;return e.isAuthenticated()&&(r+="_"+e.uid),r}function Ec(t,e){return"firestore_targets_"+t+"_"+e}wc.UNAUTHENTICATED=new wc(null),wc.GOOGLE_CREDENTIALS=new wc("google-credentials-uid"),wc.FIRST_PARTY=new wc("first-party-uid");var Tc=function(){function t(t,e,n,r){this.user=t,this.batchId=e,this.state=n,this.error=r}return t.Vs=function(e,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 Ur(o.error.code,o.error.message)),a?new t(e,n,o.state,i):(jr("SharedClientState","Failed to parse mutation state for ID '"+n+"': "+r),null)},t.prototype.Ss=function(){var t={state:this.state,updateTimeMs:Date.now()};return this.error&&(t.error={code:this.error.code,message:this.error.message}),JSON.stringify(t)},t}(),Sc=function(){function t(t,e,n){this.targetId=t,this.state=e,this.error=n}return t.Vs=function(e,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 Ur(i.error.code,i.error.message)),o?new t(e,i.state,r):(jr("SharedClientState","Failed to parse target state for ID '"+e+"': "+n),null)},t.prototype.Ss=function(){var t={state:this.state,updateTimeMs:Date.now()};return this.error&&(t.error={code:this.error.code,message:this.error.message}),JSON.stringify(t)},t}(),Ac=function(){function t(t,e){this.clientId=t,this.activeTargetIds=e}return t.Vs=function(e,n){for(var r=JSON.parse(n),i="object"==typeof r&&r.activeTargetIds instanceof Array,o=ma(),a=0;i&&a<r.activeTargetIds.length;++a)i=yi(r.activeTargetIds[a]),o=o.add(r.activeTargetIds[a]);
1050return i?new t(e,o):(jr("SharedClientState","Failed to parse client data for instance '"+e+"': "+n),null)},t}(),kc=function(){function t(t,e){this.clientId=t,this.onlineState=e}return t.Vs=function(e){var n=JSON.parse(e);return"object"==typeof n&&-1!==["Unknown","Online","Offline"].indexOf(n.onlineState)&&"string"==typeof n.clientId?new t(n.clientId,n.onlineState):(jr("SharedClientState","Failed to parse online state: "+e),null)},t}(),Nc=function(){function t(){this.activeTargetIds=ma()}return t.prototype.Ds=function(t){this.activeTargetIds=this.activeTargetIds.add(t)},t.prototype.Cs=function(t){this.activeTargetIds=this.activeTargetIds.delete(t)},t.prototype.Ss=function(){var t={activeTargetIds:this.activeTargetIds.toArray(),updateTimeMs:Date.now()};return JSON.stringify(t)},t}(),Cc=function(){function t(t,e,n,r,i){this.window=t,this.Se=e,this.persistenceKey=n,this.Ns=r,this.syncEngine=null,this.onlineStateHandler=null,this.sequenceNumberHandler=null,this.xs=this.Fs.bind(this),this.ks=new ra(Xr),this.started=!1,this.Os=[];var o=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");this.storage=this.window.localStorage,this.currentUser=i,this.$s=_c(this.persistenceKey,this.Ns),this.Ms=function(t){return"firestore_sequence_number_"+t}(this.persistenceKey),this.ks=this.ks.insert(this.Ns,new Nc),this.Ls=new RegExp("^firestore_clients_"+o+"_([^_]*)$"),this.Bs=new RegExp("^firestore_mutations_"+o+"_(\\d+)(?:_(.*))?$"),this.qs=new RegExp("^firestore_targets_"+o+"_(\\d+)$"),this.Us=function(t){return"firestore_online_state_"+t}(this.persistenceKey),this.Qs=function(t){return"firestore_bundle_loaded_"+t}(this.persistenceKey),this.window.addEventListener("storage",this.xs)}return t.yt=function(t){return!(!t||!t.localStorage)},t.prototype.start=function(){return(0,Pr.sH)(this,void 0,void 0,(function(){var t,e,n,r,i,o,a,s,u,c,h,l=this;return(0,Pr.YH)(this,(function(f){switch(f.label){case 0:return[4,this.syncEngine.fn()];case 1:for(t=f.sent(),e=0,n=t;e<n.length;e++)(r=n[e])!==this.Ns&&(i=this.getItem(_c(this.persistenceKey,r)))&&(o=Ac.Vs(r,i))&&(this.ks=this.ks.insert(o.clientId,o));for(this.Ks(),(a=this.storage.getItem(this.Us))&&(s=this.js(a))&&this.Ws(s),u=0,c=this.Os;u<c.length;u++)h=c[u],this.Fs(h);return this.Os=[],this.window.addEventListener("unload",(function(){return l.shutdown()})),this.started=!0,[2]}}))}))},t.prototype.writeSequenceNumber=function(t){this.setItem(this.Ms,JSON.stringify(t))},t.prototype.getAllActiveQueryTargets=function(){return this.Gs(this.ks)},t.prototype.isActiveQueryTarget=function(t){var e=!1;return this.ks.forEach((function(n,r){r.activeTargetIds.has(t)&&(e=!0)})),e},t.prototype.addPendingMutation=function(t){this.zs(t,"pending")},t.prototype.updateMutationState=function(t,e,n){this.zs(t,e,n),this.Hs(t)},t.prototype.addLocalQueryTarget=function(t){var e="not-current";if(this.isActiveQueryTarget(t)){var n=this.storage.getItem(Ec(this.persistenceKey,t));if(n){var r=Sc.Vs(t,n);r&&(e=r.state)}}return this.Js.Ds(t),this.Ks(),e},t.prototype.removeLocalQueryTarget=function(t){this.Js.Cs(t),this.Ks()},t.prototype.isLocalQueryTarget=function(t){return this.Js.activeTargetIds.has(t)},t.prototype.clearQueryState=function(t){this.removeItem(Ec(this.persistenceKey,t))},t.prototype.updateQueryState=function(t,e,n){this.Ys(t,e,n)},t.prototype.handleUserChange=function(t,e,n){var r=this;e.forEach((function(t){r.Hs(t)})),this.currentUser=t,n.forEach((function(t){r.addPendingMutation(t)}))},t.prototype.setOnlineState=function(t){this.Xs(t)},t.prototype.notifyBundleLoaded=function(){this.Zs()},t.prototype.shutdown=function(){this.started&&(this.window.removeEventListener("storage",this.xs),this.removeItem(this.$s),this.started=!1)},t.prototype.getItem=function(t){var e=this.storage.getItem(t);return Hr("SharedClientState","READ",t,e),e},t.prototype.setItem=function(t,e){Hr("SharedClientState","SET",t,e),this.storage.setItem(t,e)},t.prototype.removeItem=function(t){Hr("SharedClientState","REMOVE",t),this.storage.removeItem(t)},t.prototype.Fs=function(t){var e=this,n=t;if(n.storageArea===this.storage){if(Hr("SharedClientState","EVENT",n.key,n.newValue),n.key===this.$s)return void jr("Received WebStorage notification for local change. Another client might have garbage-collected our state");this.Se.enqueueRetryable((function(){return(0,Pr.sH)(e,void 0,void 0,(function(){var t,e,r,i,o,a;return(0,Pr.YH)(this,(function(s){if(this.started){if(null!==n.key)if(this.Ls.test(n.key)){if(null==n.newValue)return t=this.ti(n.key),[2,this.ei(t,null)];if(e=this.ni(n.key,n.newValue))return[2,this.ei(e.clientId,e)]}else if(this.Bs.test(n.key)){if(null!==n.newValue&&(r=this.si(n.key,n.newValue)))return[2,this.ii(r)]}else if(this.qs.test(n.key)){if(null!==n.newValue&&(i=this.ri(n.key,n.newValue)))return[2,this.oi(i)]}else if(n.key===this.Us){if(null!==n.newValue&&(o=this.js(n.newValue)))return[2,this.Ws(o)]}else if(n.key===this.Ms)(a=function(t){var e=xr.o;if(null!=t)try{var n=JSON.parse(t);Gr("number"==typeof n),e=n}
1050catch(t){jr("SharedClientState","Failed to read sequence number from WebStorage",t)}return e}(n.newValue))!==xr.o&&this.sequenceNumberHandler(a);else if(n.key===this.Qs)return[2,this.syncEngine.ci()]}else this.Os.push(n);return[2]}))}))}))}},Object.defineProperty(t.prototype,"Js",{get:function(){return this.ks.get(this.Ns)},enumerable:!1,configurable:!0}),t.prototype.Ks=function(){this.setItem(this.$s,this.Js.Ss())},t.prototype.zs=function(t,e,n){var r=new Tc(this.currentUser,t,e,n),i=Ic(this.persistenceKey,this.currentUser,t);this.setItem(i,r.Ss())},t.prototype.Hs=function(t){var e=Ic(this.persistenceKey,this.currentUser,t);this.removeItem(e)},t.prototype.Xs=function(t){var e={clientId:this.Ns,onlineState:t};this.storage.setItem(this.Us,JSON.stringify(e))},t.prototype.Ys=function(t,e,n){var r=Ec(this.persistenceKey,t),i=new Sc(t,e,n);this.setItem(r,i.Ss())},t.prototype.Zs=function(){this.setItem(this.Qs,"value-not-used")},t.prototype.ti=function(t){var e=this.Ls.exec(t);return e?e[1]:null},t.prototype.ni=function(t,e){var n=this.ti(t);return Ac.Vs(n,e)},t.prototype.si=function(t,e){var n=this.Bs.exec(t),r=Number(n[1]),i=void 0!==n[2]?n[2]:null;return Tc.Vs(new wc(i),r,e)},t.prototype.ri=function(t,e){var n=this.qs.exec(t),r=Number(n[1]);return Sc.Vs(r,e)},t.prototype.js=function(t){return kc.Vs(t)},t.prototype.ii=function(t){return(0,Pr.sH)(this,void 0,void 0,(function(){return(0,Pr.YH)(this,(function(e){return t.user.uid===this.currentUser.uid?[2,this.syncEngine.ui(t.batchId,t.state,t.error)]:(Hr("SharedClientState","Ignoring mutation for non-active user "+t.user.uid),[2])}))}))},t.prototype.oi=function(t){return this.syncEngine.ai(t.targetId,t.state,t.error)},t.prototype.ei=function(t,e){var n=this,r=e?this.ks.insert(t,e):this.ks.remove(t),i=this.Gs(this.ks),o=this.Gs(r),a=[],s=[];return o.forEach((function(t){i.has(t)||a.push(t)})),i.forEach((function(t){o.has(t)||s.push(t)})),this.syncEngine.hi(a,s).then((function(){n.ks=r}))},t.prototype.Ws=function(t){this.ks.get(t.clientId)&&this.onlineStateHandler(t.onlineState)},t.prototype.Gs=function(t){var e=ma();return t.forEach((function(t,n){e=e.unionWith(n.activeTargetIds)})),e},t}(),Rc=function(){function t(){this.li=new Nc,this.fi={},this.onlineStateHandler=null,this.sequenceNumberHandler=null}return t.prototype.addPendingMutation=function(t){},t.prototype.updateMutationState=function(t,e,n){},t.prototype.addLocalQueryTarget=function(t){return this.li.Ds(t),this.fi[t]||"not-current"},t.prototype.updateQueryState=function(t,e,n){this.fi[t]=e},t.prototype.removeLocalQueryTarget=function(t){this.li.Cs(t)},t.prototype.isLocalQueryTarget=function(t){return this.li.activeTargetIds.has(t)},t.prototype.clearQueryState=function(t){delete this.fi[t]},t.prototype.getAllActiveQueryTargets=function(){return this.li.activeTargetIds},t.prototype.isActiveQueryTarget=function(t){return this.li.activeTargetIds.has(t)},t.prototype.start=function(){return this.li=new Nc,Promise.resolve()},t.prototype.handleUserChange=function(t,e,n){},t.prototype.setOnlineState=function(t){},t.prototype.shutdown=function(){},t.prototype.writeSequenceNumber=function(t){},t.prototype.notifyBundleLoaded=function(){},t}(),Oc=function(){function t(){}return t.prototype.di=function(t){},t.prototype.shutdown=function(){},t}(),Dc=function(){function t(){var t=this;this.wi=function(){return t._i()},this.mi=function(){return t.yi()},this.gi=[],this.pi()}return t.prototype.di=function(t){this.gi.push(t)},t.prototype.shutdown=function(){window.removeEventListener("online",this.wi),window.removeEventListener("offline",this.mi)},t.prototype.pi=function(){window.addEventListener("online",this.wi),window.addEventListener("offline",this.mi)},t.prototype._i=function(){Hr("ConnectivityMonitor","Network connectivity changed: AVAILABLE");for(var t=0,e=this.gi;t<e.length;t++)(0,e[t])(0)},t.prototype.yi=function(){Hr("ConnectivityMonitor","Network connectivity changed: UNAVAILABLE");for(var t=0,e=this.gi;t<e.length;t++)(0,e[t])(1)},t.yt=function(){return"undefined"!=typeof window&&void 0!==window.addEventListener&&void 0!==window.removeEventListener},t}(),Pc={BatchGetDocuments:"batchGet",Commit:"commit",RunQuery:"runQuery"},Lc=function(){function t(t){this.Ei=t.Ei,this.Ti=t.Ti}return t.prototype.Ii=function(t){this.Ai=t},t.prototype.Ri=function(t){this.bi=t},t.prototype.onMessage=function(t){this.vi=t},t.prototype.close=function(){this.Ti()},t.prototype.send=function(t){this.Ei(t)},t.prototype.Pi=function(){this.Ai()},t.prototype.Vi=function(t){this.bi(t)},t.prototype.Si=function(t){this.vi(t)},t}(),xc=function(t){function e(e){var n=this;return(n=t.call(this,e)||this).forceLongPolling=e.forceLongPolling,n.autoDetectLongPolling=e.autoDetectLongPolling,n}return(0,Pr.C6)(e,t),e.prototype.ki=function(t,e,n,r){return new Promise((function(i,o){var a=new Dr;
1050a.listenOnce(Nr.COMPLETE,(function(){try{switch(a.getLastErrorCode()){case kr.NO_ERROR:var e=a.getResponseJson();Hr("Connection","XHR received:",JSON.stringify(e)),i(e);break;case kr.TIMEOUT:Hr("Connection",'RPC "'+t+'" timed out'),o(new Ur(Mr.DEADLINE_EXCEEDED,"Request time out"));break;case kr.HTTP_ERROR:var n=a.getStatus();if(Hr("Connection",'RPC "'+t+'" failed with status:',n,"response text:",a.getResponseText()),n>0){var r=a.getResponseJson().error;if(r&&r.status&&r.message){var s=function(t){var e=t.toLowerCase().replace(/_/g,"-");return Object.values(Mr).indexOf(e)>=0?e:Mr.UNKNOWN}(r.status);o(new Ur(s,r.message))}else o(new Ur(Mr.UNKNOWN,"Server responded with status "+a.getStatus()))}else o(new Ur(Mr.UNAVAILABLE,"Connection failed."));break;default:Kr()}}finally{Hr("Connection",'RPC "'+t+'" completed.')}}));var s=JSON.stringify(r);a.send(e,"POST",s,n,15)}))},e.prototype.$i=function(t,e){var n=[this.Di,"/","google.firestore.v1.Firestore","/",t,"/channel"],r=Sr(),o=Ar(),a={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.Fi(a.initMessageHeaders,e),(0,i.jZ)()||(0,i.lV)()||(0,i.b8)()||(0,i.lT)()||(0,i.n4)()||(0,i.sr)()||(a.httpHeadersOverwriteParam="$httpHeaders");var s=n.join("");Hr("Connection","Creating WebChannel: "+s,a);var u=r.createWebChannel(s,a),c=!1,h=!1,l=new Lc({Ei:function(t){h?Hr("Connection","Not sending because WebChannel is closed:",t):(c||(Hr("Connection","Opening WebChannel transport."),u.open(),c=!0),Hr("Connection","WebChannel sending:",t),u.send(t))},Ti:function(){return u.close()}}),f=function(t,e,n){t.listen(e,(function(t){try{n(t)}catch(t){setTimeout((function(){throw t}),0)}}))};return f(u,Or.EventType.OPEN,(function(){h||Hr("Connection","WebChannel transport opened.")})),f(u,Or.EventType.CLOSE,(function(){h||(h=!0,Hr("Connection","WebChannel transport closed"),l.Vi())})),f(u,Or.EventType.ERROR,(function(t){h||(h=!0,qr("Connection","WebChannel transport errored:",t),l.Vi(new Ur(Mr.UNAVAILABLE,"The operation could not be completed")))})),f(u,Or.EventType.MESSAGE,(function(t){var e;if(!h){var n=t.data[0];Gr(!!n);var r=n,i=r.error||(null===(e=r[0])||void 0===e?void 0:e.error);if(i){Hr("Connection","WebChannel received error:",i);var o=i.status,a=function(t){var e=Qo[t];if(void 0!==e)return na(e)}(o),s=i.message;void 0===a&&(a=Mr.INTERNAL,s="Unknown error status: "+o+" with message "+i.message),h=!0,l.Vi(new Ur(a,s)),u.close()}else Hr("Connection","WebChannel received:",n),l.Si(n)}})),f(o,Cr.STAT_EVENT,(function(t){t.stat===Rr.PROXY?Hr("Connection","Detected buffering proxy"):t.stat===Rr.NOPROXY&&Hr("Connection","Detected no buffering proxy")})),setTimeout((function(){l.Pi()}),0),l},e}(function(){function t(t){this.databaseInfo=t,this.databaseId=t.databaseId;var e=t.ssl?"https":"http";this.Di=e+"://"+t.host,this.Ci="projects/"+this.databaseId.projectId+"/databases/"+this.databaseId.database+"/documents"}return t.prototype.Ni=function(t,e,n,r){var i=this.xi(t,e);Hr("RestConnection","Sending: ",i,n);var o={};return this.Fi(o,r),this.ki(t,i,o,n).then((function(t){return Hr("RestConnection","Received: ",t),t}),(function(e){throw qr("RestConnection",t+" failed with error: ",e,"url: ",i,"request:",n),e}))},t.prototype.Oi=function(t,e,n,r){return this.Ni(t,e,n,r)},t.prototype.Fi=function(t,e){if(t["X-Goog-Api-Client"]="gl-js/ fire/8.5.0",t["Content-Type"]="text/plain",this.databaseInfo.appId&&(t["X-Firebase-GMPID"]=this.databaseInfo.appId),e)for(var n in e.authHeaders)e.authHeaders.hasOwnProperty(n)&&(t[n]=e.authHeaders[n])},t.prototype.xi=function(t,e){var n=Pc[t];return this.Di+"/v1/"+e+":"+n},t}()); 1051/** 1052 * @license 1053 * Copyright 2020 Google LLC 1054 * 1055 * Licensed under the Apache License, Version 2.0 (the "License"); 1056 * you may not use this file except in compliance with the License. 1057 * You may obtain a copy of the License at 1058 * 1059 * http://www.apache.org/licenses/LICENSE-2.0 1060 * 1061 * Unless required by applicable law or agreed to in writing, softw
1061are 1062 * distributed under the License is distributed on an "AS IS" BASIS, 1063 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1064 * See the License for the specific language governing permissions and 1065 * limitations under the License. 1066 */ 1067/** 1068 * @license 1069 * Copyright 2020 Google LLC 1070 * 1071 * Licensed under the Apache License, Version 2.0 (the "License"); 1072 * you may not use this file except in compliance with the License. 1073 * You may obtain a copy of the License at 1074 * 1075 * http://www.apache.org/licenses/LICENSE-2.0 1076 * 1077 * Unless required by applicable law or agreed to in writing, software 1078 * distributed under the License is distributed on an "AS IS" BASIS, 1079 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1080 * See the License for the specific language governing permissions and 1081 * limitations under the License. 1082 */function Mc(){return"undefined"!=typeof window?window:null}function Uc(){return"undefined"!=typeof document?document:null} 1083/** 1084 * @license 1085 * Copyright 2020 Google LLC 1086 * 1087 * Licensed under the Apache License, Version 2.0 (the "License"); 1088 * you may not use this file except in compliance with the License. 1089 * You may obtain a copy of the License at 1090 * 1091 * http://www.apache.org/licenses/LICENSE-2.0 1092 * 1093 * Unless required by applicable law or agreed to in writing, software 1094 * distributed under the License is distributed on an "AS IS" BASIS, 1095 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1096 * See the License for the specific language governing permissions and 1097 * limitations under the License. 1098 */function Fc(t){return new Ca(t,!0)}var Vc=function(){function t(t,e,n,r,i){void 0===n&&(n=1e3),void 0===r&&(r=1.5),void 0===i&&(i=6e4),this.Se=t,this.timerId=e,this.Mi=n,this.Li=r,this.Bi=i,this.qi=0,this.Ui=null,this.Qi=Date.now(),this.reset()}return t.prototype.reset=function(){this.qi=0},t.prototype.Ki=function(){this.qi=this.Bi},t.prototype.ji=function(t){var e=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&&Hr("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 e.Qi=Date.now(),t()})),this.qi*=this.Li,this.qi<this.Mi&&(this.qi=this.Mi),this.qi>this.Bi&&(this.qi=this.Bi)},t.prototype.Gi=function(){null!==this.Ui&&(this.Ui.skipDelay(),this.Ui=null)},t.prototype.cancel=function(){null!==this.Ui&&(this.Ui.cancel(),this.Ui=null)},t.prototype.Wi=function(){return(Math.random()-.5)*this.qi},t}(),Hc=function(){function t(t,e,n,r,i,o){this.Se=t,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 Vc(t,e)}return t.prototype.tr=function(){return 1===this.state||2===this.state||4===this.state},t.prototype.er=function(){return 2===this.state},t.prototype.start=function(){3!==this.state?this.auth():this.nr()},t.prototype.stop=function(){return(0,Pr.sH)(this,void 0,void 0,(function(){return(0,Pr.YH)(this,(function(t){switch(t.label){case 0:return this.tr()?[4,this.close(0)]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}}
1098))}))},t.prototype.sr=function(){this.state=0,this.Zi.reset()},t.prototype.ir=function(){var t=this;this.er()&&null===this.Xi&&(this.Xi=this.Se.enqueueAfterDelay(this.zi,6e4,(function(){return t.rr()})))},t.prototype.cr=function(t){this.ur(),this.stream.send(t)},t.prototype.rr=function(){return(0,Pr.sH)(this,void 0,void 0,(function(){return(0,Pr.YH)(this,(function(t){return this.er()?[2,this.close(0)]:[2]}))}))},t.prototype.ur=function(){this.Xi&&(this.Xi.cancel(),this.Xi=null)},t.prototype.close=function(t,e){return(0,Pr.sH)(this,void 0,void 0,(function(){return(0,Pr.YH)(this,(function(n){switch(n.label){case 0:return this.ur(),this.Zi.cancel(),this.Yi++,3!==t?this.Zi.reset():e&&e.code===Mr.RESOURCE_EXHAUSTED?(jr(e.toString()),jr("Using maximum backoff delay to prevent overloading the backend."),this.Zi.Ki()):e&&e.code===Mr.UNAUTHENTICATED&&this.Ji.invalidateToken(),null!==this.stream&&(this.ar(),this.stream.close(),this.stream=null),this.state=t,[4,this.listener.Ri(e)];case 1:return n.sent(),[2]}}))}))},t.prototype.ar=function(){},t.prototype.auth=function(){var t=this;this.state=1;var e=this.hr(this.Yi),n=this.Yi;this.Ji.getToken().then((function(e){t.Yi===n&&t.lr(e)}),(function(n){e((function(){var e=new Ur(Mr.UNKNOWN,"Fetching auth token failed: "+n.message);return t.dr(e)}))}))},t.prototype.lr=function(t){var e=this,n=this.hr(this.Yi);this.stream=this.wr(t),this.stream.Ii((function(){n((function(){return e.state=2,e.listener.Ii()}))})),this.stream.Ri((function(t){n((function(){return e.dr(t)}))})),this.stream.onMessage((function(t){n((function(){return e.onMessage(t)}))}))},t.prototype.nr=function(){var t=this;this.state=4,this.Zi.ji((function(){return(0,Pr.sH)(t,void 0,void 0,(function(){return(0,Pr.YH)(this,(function(t){return this.state=0,this.start(),[2]}))}))}))},t.prototype.dr=function(t){return Hr("PersistentStream","close with error: "+t),this.stream=null,this.close(3,t)},t.prototype.hr=function(t){var e=this;return function(n){e.Se.enqueueAndForget((function(){return e.Yi===t?n():(Hr("PersistentStream","stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve())}))}},t}(),jc=function(t){function e(e,n,r,i,o){var a=this;return(a=t.call(this,e,"listen_stream_connection_backoff","listen_stream_idle",n,r,o)||this).R=i,a}return(0,Pr.C6)(e,t),e.prototype.wr=function(t){return this.Hi.$i("Listen",t)},e.prototype.onMessage=function(t){this.Zi.reset();var e=function(t,e){var n;if("targetChange"in e){e.targetChange;var r=function(t){return"NO_CHANGE"===t?0:"ADD"===t?1:"REMOVE"===t?2:"CURRENT"===t?3:"RESET"===t?4:Kr()}(e.targetChange.targetChangeType||"NO_CHANGE"),i=e.targetChange.targetIds||[],o=function(t,e){return t.I?(Gr(void 0===e||"string"==typeof e),ui.fromBase64String(e||"")):(Gr(void 0===e||e instanceof Uint8Array),ui.fromUint8Array(e||new Uint8Array))}(t,e.targetChange.resumeToken),a=(s=e.targetChange.cause)&&function(t){var e=void 0===t.code?Mr.UNKNOWN:na(t.code);return new Ur(e,t.message||"")}(s);n=new Ia(r,i,o,a||null)}else if("documentChange"in e){e.documentChange,(r=e.documentChange).document,r.document.name,r.document.updateTime,i=Ua(t,r.document.name),o=Pa(r.document.updateTime);var s=new Pi({mapValue:{fields:r.document.fields}}),u=(a=xi.newFoundDocument(i,o,s),r.targetIds||[]),c=r.removedTargetIds||[];n=new wa(u,c,a.key,a)}else if("documentDelete"in e)e.documentDelete,(r=e.documentDelete).document,i=Ua(t,r.document),o=r.readTime?Pa(r.readTime):Zr.min(),s=xi.newNoDocument(i,o),a=r.removedTargetIds||[],n=new wa([],a,s.key,s);else if("documentRemove"in e)e.documentRemove,(r=e.documentRemove).document,i=Ua(t,r.document),o=r.removedTargetIds||[],n=new wa([],o,i,null);else{if(!("filter"in e))return Kr();e.filter;var h=e.filter;h.targetId,r=h.count||0,i=new ta(r),o=h.targetId,n=new _a(o,i)}return n}(this.R,t),n=function(t){if(!("targetChange"in t))return Zr.min();var e=t.targetChange;return e.targetIds&&e.targetIds.length?Zr.min():e.readTime?Pa(e.readTime):Zr.min()}(t);return this.listener._r(e,n)},e.prototype.mr=function(t){var e={};e.database=Ha(this.R),e.addTarget=function(t,e){var n,r=e.target;return(n=Hi(r)?{documents:Ya(t,r)}:{query:za(t,r)}).targetId=e.targetId,e.resumeToken.approximateByteSize()>0?n.resumeToken=Oa(t,e.resumeToken):e.snapshotVersion.compareTo(Zr.min())>0&&(n.readTime=Ra(t,e.snapshotVersion.toTimestamp())),n}(this.R,t);var n=function(t,e){var n=function(t,e){switch(e){case 0:return null;case 1:return"existence-filter-mismatch";case 2:return"limbo-document";default:return Kr()}}(0,e.purpose);return null==n?null:{"goog-listen-tags":n}}(this.R,t);n&&(e.labels=n),this.cr(e)},e.prototype.yr=function(t){var e={};e.database=Ha(this.R),e.removeTarget=t,this.cr(e)},e}(Hc),qc=function(t){function e(e,n,r,i,o){var a=this;return(a=t.call(this,e,"write_stream_connection_backoff","write_stream_idle",n,r,o)||this).R=i,a.gr=!1,a}return(0,Pr.C6)(e,t),Object.defineProperty(e.prototype,"pr",{get:function(){return this.gr}
1098,enumerable:!1,configurable:!0}),e.prototype.start=function(){this.gr=!1,this.lastStreamToken=void 0,t.prototype.start.call(this)},e.prototype.ar=function(){this.gr&&this.Er([])},e.prototype.wr=function(t){return this.Hi.$i("Write",t)},e.prototype.onMessage=function(t){if(Gr(!!t.streamToken),this.lastStreamToken=t.streamToken,this.gr){this.Zi.reset();var e=function(t,e){return t&&t.length>0?(Gr(void 0!==e),t.map((function(t){return function(t,e){var n=t.updateTime?Pa(t.updateTime):Pa(e);return n.isEqual(Zr.min())&&(n=Pa(e)),new Mo(n,t.transformResults||[])}(t,e)}))):[]}(t.writeResults,t.commitTime),n=Pa(t.commitTime);return this.listener.Tr(n,e)}return Gr(!t.writeResults||0===t.writeResults.length),this.gr=!0,this.listener.Ir()},e.prototype.Ar=function(){var t={};t.database=Ha(this.R),this.cr(t)},e.prototype.Er=function(t){var e=this,n={streamToken:this.lastStreamToken,writes:t.map((function(t){return Ka(e.R,t)}))};this.cr(n)},e}(Hc),Bc=function(t){function e(e,n,r){var i=this;return(i=t.call(this)||this).credentials=e,i.Hi=n,i.R=r,i.Rr=!1,i}return(0,Pr.C6)(e,t),e.prototype.br=function(){if(this.Rr)throw new Ur(Mr.FAILED_PRECONDITION,"The client has already been terminated.")},e.prototype.Ni=function(t,e,n){var r=this;return this.br(),this.credentials.getToken().then((function(i){return r.Hi.Ni(t,e,n,i)})).catch((function(t){throw"FirebaseError"===t.name?(t.code===Mr.UNAUTHENTICATED&&r.credentials.invalidateToken(),t):new Ur(Mr.UNKNOWN,t.toString())}))},e.prototype.Oi=function(t,e,n){var r=this;return this.br(),this.credentials.getToken().then((function(i){return r.Hi.Oi(t,e,n,i)})).catch((function(t){throw"FirebaseError"===t.name?(t.code===Mr.UNAUTHENTICATED&&r.credentials.invalidateToken(),t):new Ur(Mr.UNKNOWN,t.toString())}))},e.prototype.terminate=function(){this.Rr=!0},e}((function(){})),Kc=function(){function t(t,e){this.asyncQueue=t,this.onlineStateHandler=e,this.state="Unknown",this.vr=0,this.Pr=null,this.Vr=!0}return t.prototype.Sr=function(){var t=this;0===this.vr&&(this.Dr("Unknown"),this.Pr=this.asyncQueue.enqueueAfterDelay("online_state_timeout",1e4,(function(){return t.Pr=null,t.Cr("Backend didn't respond within 10 seconds."),t.Dr("Offline"),Promise.resolve()})))},t.prototype.Nr=function(t){"Online"===this.state?this.Dr("Unknown"):(this.vr++,this.vr>=1&&(this.Fr(),this.Cr("Connection failed 1 times. Most recent error: "+t.toString()),this.Dr("Offline")))},t.prototype.set=function(t){this.Fr(),this.vr=0,"Online"===t&&(this.Vr=!1),this.Dr(t)},t.prototype.Dr=function(t){t!==this.state&&(this.state=t,this.onlineStateHandler(t))},t.prototype.Cr=function(t){var e="Could not reach Cloud Firestore backend. "+t+"\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?(jr(e),this.Vr=!1):Hr("OnlineStateTracker",e)},t.prototype.Fr=function(){null!==this.Pr&&(this.Pr.cancel(),this.Pr=null)},t}(),Gc=function(t,e,n,r,i){var o=this;this.localStore=t,this.datastore=e,this.asyncQueue=n,this.remoteSyncer={},this.kr=[],this.Or=new Map,this.$r=new Set,this.Mr=[],this.Lr=i,this.Lr.di((function(t){n.enqueueAndForget((function(){return(0,Pr.sH)(o,void 0,void 0,(function(){return(0,Pr.YH)(this,(function(t){switch(t.label){case 0:return th(this)?(Hr("RemoteStore","Restarting streams for network reachability change."),[4,function(t){return(0,Pr.sH)(this,void 0,void 0,(function(){var e;return(0,Pr.YH)(this,(function(n){switch(n.label){case 0:return(e=Yr(t)).$r.add(4),[4,zc(e)];case 1:return n.sent(),e.Br.set("Unknown"),e.$r.delete(4),[4,Yc(e)];case 2:return n.sent(),[2]}}))}))}(this)]):[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}}
1098))}))}))})),this.Br=new Kc(n,r)}; 1099/** 1100 * @license 1101 * Copyright 2017 Google LLC 1102 * 1103 * Licensed under the Apache License, Version 2.0 (the "License"); 1104 * you may not use this file except in compliance with the License. 1105 * You may obtain a copy of the License at 1106 * 1107 * http://www.apache.org/licenses/LICENSE-2.0 1108 * 1109 * Unless required by applicable law or agreed to in writing, software 1110 * distributed under the License is distributed on an "AS IS" BASIS, 1111 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1112 * See the License for the specific language governing permissions and 1113 * limitations under the License. 1114 */function Yc(t){return(0,Pr.sH)(this,void 0,void 0,(function(){var e,n;return(0,Pr.YH)(this,(function(r){switch(r.label){case 0:if(!th(t))return[3,4];e=0,n=t.Mr,r.label=1;case 1:return e<n.length?[4,(0,n[e])(!0)]:[3,4];case 2:r.sent(),r.label=3;case 3:return e++,[3,1];case 4:return[2]}}))}))}function zc(t){return(0,Pr.sH)(this,void 0,void 0,(function(){var e,n;return(0,Pr.YH)(this,(function(r){switch(r.label){case 0:e=0,n=t.Mr,r.label=1;case 1:return e<n.length?[4,(0,n[e])(!1)]:[3,4];case 2:r.sent(),r.label=3;case 3:return e++,[3,1];case 4:return[2]}}
1114))}))}function Wc(t,e){var n=Yr(t);n.Or.has(e.targetId)||(n.Or.set(e.targetId,e),Zc(n)?$c(n):vh(n).er()&&Qc(n,e))}function Xc(t,e){var n=Yr(t),r=vh(n);n.Or.delete(e),r.er()&&Jc(n,e),0===n.Or.size&&(r.er()?r.ir():th(n)&&n.Br.set("Unknown"))}function Qc(t,e){t.qr.U(e.targetId),vh(t).mr(e)}function Jc(t,e){t.qr.U(e),vh(t).yr(e)}function $c(t){t.qr=new Ta({getRemoteKeysForTarget:function(e){return t.remoteSyncer.getRemoteKeysForTarget(e)},lt:function(e){return t.Or.get(e)||null}}),vh(t).start(),t.Br.Sr()}function Zc(t){return th(t)&&!vh(t).tr()&&t.Or.size>0}function th(t){return 0===Yr(t).$r.size}function eh(t){t.qr=void 0}function nh(t){return(0,Pr.sH)(this,void 0,void 0,(function(){return(0,Pr.YH)(this,(function(e){return t.Or.forEach((function(e,n){Qc(t,e)})),[2]}))}))}function rh(t,e){return(0,Pr.sH)(this,void 0,void 0,(function(){return(0,Pr.YH)(this,(function(n){return eh(t),Zc(t)?(t.Br.Nr(e),$c(t)):t.Br.set("Unknown"),[2]}))}))}function ih(t,e,n){return(0,Pr.sH)(this,void 0,void 0,(function(){var r,i,o;return(0,Pr.YH)(this,(function(a){switch(a.label){case 0:if(t.Br.set("Online"),!(e instanceof Ia&&2===e.state&&e.cause))return[3,6];a.label=1;case 1:return a.trys.push([1,3,,5]),[4,function(t,e){return(0,Pr.sH)(this,void 0,void 0,(function(){var n,r,i,o;return(0,Pr.YH)(this,(function(a){switch(a.label){case 0:n=e.cause,r=0,i=e.targetIds,a.label=1;case 1:return r<i.length?(o=i[r],t.Or.has(o)?[4,t.remoteSyncer.rejectListen(o,n)]:[3,3]):[3,5];case 2:a.sent(),t.Or.delete(o),t.qr.removeTarget(o),a.label=3;case 3:a.label=4;case 4:return r++,[3,1];case 5:return[2]}}
1114))}))}(t,e)];case 2:return a.sent(),[3,5];case 3:return r=a.sent(),Hr("RemoteStore","Failed to remove targets %s: %s ",e.targetIds.join(","),r),[4,oh(t,r)];case 4:return a.sent(),[3,5];case 5:return[3,13];case 6:if(e instanceof wa?t.qr.X(e):e instanceof _a?t.qr.rt(e):t.qr.et(e),n.isEqual(Zr.min()))return[3,13];a.label=7;case 7:return a.trys.push([7,11,,13]),[4,$u(t.localStore)];case 8:return i=a.sent(),n.compareTo(i)>=0?[4,function(t,e){var n=t.qr.ut(e);return n.targetChanges.forEach((function(n,r){if(n.resumeToken.approximateByteSize()>0){var i=t.Or.get(r);i&&t.Or.set(r,i.withResumeToken(n.resumeToken,e))}})),n.targetMismatches.forEach((function(e){var n=t.Or.get(e);if(n){t.Or.set(e,n.withResumeToken(ui.EMPTY_BYTE_STRING,n.snapshotVersion)),Jc(t,e);var r=new Ks(n.target,e,1,n.sequenceNumber);Qc(t,r)}})),t.remoteSyncer.applyRemoteEvent(n)}(t,n)]:[3,10];case 9:a.sent(),a.label=10;case 10:return[3,13];case 11:return Hr("RemoteStore","Failed to raise snapshot:",o=a.sent()),[4,oh(t,o)];case 12:return a.sent(),[3,13];case 13:return[2]}}
1114))}))}function oh(t,e,n){return(0,Pr.sH)(this,void 0,void 0,(function(){var r=this;return(0,Pr.YH)(this,(function(i){switch(i.label){case 0:if(!xs(e))throw e;return t.$r.add(1),[4,zc(t)];case 1:return i.sent(),t.Br.set("Offline"),n||(n=function(){return $u(t.localStore)}),t.asyncQueue.enqueueRetryable((function(){return(0,Pr.sH)(r,void 0,void 0,(function(){return(0,Pr.YH)(this,(function(e){switch(e.label){case 0:return Hr("RemoteStore","Retrying IndexedDB access"),[4,n()];case 1:return e.sent(),t.$r.delete(1),[4,Yc(t)];case 2:return e.sent(),[2]}}))}))})),[2]}}))}))}function ah(t,e){return e().catch((function(n){return oh(t,n,e)}))}function sh(t){return(0,Pr.sH)(this,void 0,void 0,(function(){var e,n,r,i,o;return(0,Pr.YH)(this,(function(a){switch(a.label){case 0:e=Yr(t),n=gh(e),r=e.kr.length>0?e.kr[e.kr.length-1].batchId:-1,a.label=1;case 1:if(!function(t){return th(t)&&t.kr.length<10}(e))return[3,7];a.label=2;case 2:return a.trys.push([2,4,,6]),[4,ec(e.localStore,r)];case 3:return null===(i=a.sent())?(0===e.kr.length&&n.ir(),[3,7]):(r=i.batchId,function(t,e){t.kr.push(e);var n=gh(t);n.er()&&n.pr&&n.Er(e.mutations)}(e,i),[3,6]);case 4:return o=a.sent(),[4,oh(e,o)];case 5:return a.sent(),[3,6];case 6:return[3,1];case 7:return uh(e)&&ch(e),[2]}}))}))}function uh(t){return th(t)&&!gh(t).tr()&&t.kr.length>0}function ch(t){gh(t).start()}function hh(t){return(0,Pr.sH)(this,void 0,void 0,(function(){return(0,Pr.YH)(this,(function(e){return gh(t).Ar(),[2]}))}))}function lh(t){return(0,Pr.sH)(this,void 0,void 0,(function(){var e,n,r,i;return(0,Pr.YH)(this,(function(o){for(e=gh(t),n=0,r=t.kr;n<r.length;n++)i=r[n],e.Er(i.mutations);return[2]}))}))}function fh(t,e,n){return(0,Pr.sH)(this,void 0,void 0,(function(){var r,i;return(0,Pr.YH)(this,(function(o){switch(o.label){case 0:return r=t.kr.shift(),i=Bs.from(r,e,n),[4,ah(t,(function(){return t.remoteSyncer.applySuccessfulWrite(i)}))];case 1:return o.sent(),[4,sh(t)];case 2:return o.sent(),[2]}}))}))}function ph(t,e){return(0,Pr.sH)(this,void 0,void 0,(function(){return(0,Pr.YH)(this,(function(n){switch(n.label){case 0:return e&&gh(t).pr?[4,function(t,e){return(0,Pr.sH)(this,void 0,void 0,(function(){var n,r;return(0,Pr.YH)(this,(function(i){switch(i.label){case 0:return ea(r=e.code)&&r!==Mr.ABORTED?(n=t.kr.shift(),gh(t).sr(),[4,ah(t,(function(){return t.remoteSyncer.rejectFailedWrite(n.batchId,e)}))]):[3,3];case 1:return i.sent(),[4,sh(t)];case 2:i.sent(),i.label=3;case 3:return[2]}}
1114))}))}(t,e)]:[3,2];case 1:n.sent(),n.label=2;case 2:return uh(t)&&ch(t),[2]}}))}))}function dh(t,e){return(0,Pr.sH)(this,void 0,void 0,(function(){var n;return(0,Pr.YH)(this,(function(r){switch(r.label){case 0:return n=Yr(t),e?(n.$r.delete(2),[4,Yc(n)]):[3,2];case 1:return r.sent(),[3,5];case 2:return e?[3,4]:(n.$r.add(2),[4,zc(n)]);case 3:r.sent(),n.Br.set("Unknown"),r.label=4;case 4:r.label=5;case 5:return[2]}}))}))}function vh(t){var e=this;return t.Ur||(t.Ur=function(t,e,n){var r=Yr(t);return r.br(),new jc(e,r.Hi,r.credentials,r.R,n)}(t.datastore,t.asyncQueue,{Ii:nh.bind(null,t),Ri:rh.bind(null,t),_r:ih.bind(null,t)}),t.Mr.push((function(n){return(0,Pr.sH)(e,void 0,void 0,(function(){return(0,Pr.YH)(this,(function(e){switch(e.label){case 0:return n?(t.Ur.sr(),Zc(t)?$c(t):t.Br.set("Unknown"),[3,3]):[3,1];case 1:return[4,t.Ur.stop()];case 2:e.sent(),eh(t),e.label=3;case 3:return[2]}}))}))}))),t.Ur}function gh(t){var e=this;return t.Qr||(t.Qr=function(t,e,n){var r=Yr(t);return r.br(),new qc(e,r.Hi,r.credentials,r.R,n)}(t.datastore,t.asyncQueue,{Ii:hh.bind(null,t),Ri:ph.bind(null,t),Ir:lh.bind(null,t),Tr:fh.bind(null,t)}),t.Mr.push((function(n){return(0,Pr.sH)(e,void 0,void 0,(function(){return(0,Pr.YH)(this,(function(e){switch(e.label){case 0:return n?(t.Qr.sr(),[4,sh(t)]):[3,2];case 1:return e.sent(),[3,4];case 2:return[4,t.Qr.stop()];case 3:e.sent(),t.kr.length>0&&(Hr("RemoteStore","Stopping write stream with "+t.kr.length+" pending writes"),t.kr=[]),e.label=4;case 4:return[2]}}
1114))}))}))),t.Qr 1115/** 1116 * @license 1117 * Copyright 2017 Google LLC 1118 * 1119 * Licensed under the Apache License, Version 2.0 (the "License"); 1120 * you may not use this file except in compliance with the License. 1121 * You may obtain a copy of the License at 1122 * 1123 * http://www.apache.org/licenses/LICENSE-2.0 1124 * 1125 * Unless required by applicable law or agreed to in writing, software 1126 * distributed under the License is distributed on an "AS IS" BASIS, 1127 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1128 * See the License for the specific language governing permissions and 1129 * limitations under the License. 1130 */}var mh=function(){function t(t,e,n,r,i){this.asyncQueue=t,this.timerId=e,this.targetTimeMs=n,this.op=r,this.removalCallback=i,this.deferred=new Cs,this.then=this.deferred.promise.then.bind(this.deferred.promise),this.deferred.promise.catch((function(t){}))}return t.createAndSchedule=function(e,n,r,i,o){var a=new t(e,n,Date.now()+r,i,o);return a.start(r),a},t.prototype.start=function(t){var e=this;this.timerHandle=setTimeout((function(){return e.handleDelayElapsed()}),t)},t.prototype.skipDelay=function(){return this.handleDelayElapsed()},t.prototype.cancel=function(t){null!==this.timerHandle&&(this.clearTimeout(),this.deferred.reject(new Ur(Mr.CANCELLED,"Operation cancelled"+(t?": "+t:"")))
1130)},t.prototype.handleDelayElapsed=function(){var t=this;this.asyncQueue.enqueueAndForget((function(){return null!==t.timerHandle?(t.clearTimeout(),t.op().then((function(e){return t.deferred.resolve(e)}))):Promise.resolve()}))},t.prototype.clearTimeout=function(){null!==this.timerHandle&&(this.removalCallback(this),clearTimeout(this.timerHandle),this.timerHandle=null)},t}();function yh(t,e){if(jr("AsyncQueue",e+": "+t),xs(t))return new Ur(Mr.UNAVAILABLE,e+": "+t);throw t} 1131/** 1132 * @license 1133 * Copyright 2017 Google LLC 1134 * 1135 * Licensed under the Apache License, Version 2.0 (the "License"); 1136 * you may not use this file except in compliance with the License. 1137 * You may obtain a copy of the License at 1138 * 1139 * http://www.apache.org/licenses/LICENSE-2.0 1140 * 1141 * Unless required by applicable law or agreed to in writing, software 1142 * distributed under the License is distributed on an "AS IS" BASIS, 1143 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1144 * See the License for the specific language governing permissions and 1145 * limitations under the License. 1146 */var bh=function(){function t(t){this.comparator=t?function(e,n){return t(e,n)||bi.comparator(e.key,n.key)}:function(t,e){return bi.comparator(t.key,e.key)},this.keyedMap=la(),this.sortedSet=new ra(this.comparator)}return t.emptySet=function(e){return new t(e.comparator)},t.prototype.has=function(t){return null!=this.keyedMap.get(t)},t.prototype.get=function(t){return this.keyedMap.get(t)},t.prototype.first=function(){return this.sortedSet.minKey()},t.prototype.last=function(){return this.sortedSet.maxKey()},t.prototype.isEmpty=function(){return this.sortedSet.isEmpty()},t.prototype.indexOf=function(t){var e=this.keyedMap.get(t);return e?this.sortedSet.indexOf(e):-1},Object.defineProperty(t.prototype,"size",{get:function(){return this.sortedSet.size},enumerable:!1,configurable:!0}),t.prototype.forEach=function(t){this.sortedSet.inorderTraversal((function(e,n){return t(e),!1}))},t.prototype.add=function(t){var e=this.delete(t.key);return e.copy(e.keyedMap.insert(t.key,t),e.sortedSet.insert(t,null))},t.prototype.delete=function(t){var e=this.get(t);return e?this.copy(this.keyedMap.remove(t),this.sortedSet.remove(e)):this},t.prototype.isEqual=function(e){if(!(e instanceof t))return!1;if(this.size!==e.size)return!1;for(var n=this.sortedSet.getIterator(),r=e.sortedSet.getIterator();n.hasNext();){var i=n.getNext().key,o=r.getNext().key;if(!i.isEqual(o))return!1}return!0},t.prototype.toString=function(){var t=[];return this.forEach((function(e){t.push(e.toString())})),0===t.length?"DocumentSet ()":"DocumentSet (\n "+t.join(" \n")+"\n)"},t.prototype.copy=function(e,n){var r=new t;return r.comparator=this.comparator,r.keyedMap=e,r.sortedSet=n,r},t}(),wh=function(){function t(){this.Kr=new ra(bi.comparator)}return t.prototype.track=function(t){var e=t.doc.key,n=this.Kr.get(e);n?0!==t.type&&3===n.type?this.Kr=this.Kr.insert(e,t):3===t.type&&1!==n.type?this.Kr=this.Kr.insert(e,{type:n.type,doc:t.doc}):2===t.type&&2===n.type?this.Kr=this.Kr.insert(e,{type:2,doc:t.doc}):2===t.type&&0===n.type?this.Kr=this.Kr.insert(e,{type:0,doc:t.doc}):1===t.type&&0===n.type?this.Kr=this.Kr.remove(e):1===t.type&&2===n.type?this.Kr=this.Kr.insert(e,{type:1,doc:n.doc}):0===t.type&&1===n.type?this.Kr=this.Kr.insert(e,{type:2,doc:t.doc}):Kr():this.Kr=this.Kr.insert(e,t)},t.prototype.jr=function(){var t=[];return this.Kr.inorderTraversal((function(e,n){t.push(n)})),t},t}(),_h=function(){function t(t,e,n,r,i,o,a,s){this.query=t,this.docs=e,this.oldDocs=n,this.docChanges=r,this.mutatedKeys=i,this.fromCache=o,this.syncStateChanged=a,this.excludesMetadataChanges=s}return t.fromInitialDocuments=function(e,n,r,i){var o=[];return n.forEach((function(t){o.push({type:0,doc:t})})),new t(e,n,bh.emptySet(n),o,r,i,!0,!1)},Object.defineProperty(t.prototype,"hasPendingWrites",{get:function(){return!this.mutatedKeys.isEmpty()},enumerable:!1,configurable:!0}),t.prototype.isEqual=function(t){if(!(this.fromCache===t.fromCache&&this.syncStateChanged===t.syncStateChanged&&this.mutatedKeys.isEqual(t.mutatedKeys)&&po(this.query,t.query)&&this.docs.isEqual(t.docs)&&this.oldDocs.isEqual(t.oldDocs)))return!1;var e=this.docChanges,n=t.docChanges;if(e.length!==n.length)return!1;for(var r=0;r<e.length;r++)if(e[r].type!==n[r].type||!e[r].doc.isEqual(n[r].doc))return!1;return!0},t}(),Ih=function(){this.Wr=void 0,this.listeners=[]},Eh=function(){this.queries=new Ru((function(t){return vo(t)}),po),this.onlineState="Unknown",this.Gr=new Set}; 1147/** 1148 * @license 1149 * Copyright 2017 Google LLC 1150 * 1151 * Licensed under the Apache License, Version 2.0 (the "License");
1152 * you may not use this file except in compliance with the License. 1153 * You may obtain a copy of the License at 1154 * 1155 * http://www.apache.org/licenses/LICENSE-2.0 1156 * 1157 * Unless required by applicable law or agreed to in writing, software 1158 * distributed under the License is distributed on an "AS IS" BASIS, 1159 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1160 * See the License for the specific language governing permissions and 1161 * limitations under the License. 1162 */function Th(t,e){return(0,Pr.sH)(this,void 0,void 0,(function(){var n,r,i,o,a,s,u;return(0,Pr.YH)(this,(function(c){switch(c.label){case 0:if(n=Yr(t),r=e.query,i=!1,(o=n.queries.get(r))||(i=!0,o=new Ih),!i)return[3,4];c.label=1;case 1:return c.trys.push([1,3,,4]),a=o,[4,n.onListen(r)];case 2:return a.Wr=c.sent(),[3,4];case 3:return s=c.sent(),u=yh(s,"Initialization of query '"+go(e.query)+"' failed"),[2,void e.onError(u)];case 4:return n.queries.set(r,o),o.listeners.push(e),e.zr(n.onlineState),o.Wr&&e.Hr(o.Wr)&&Nh(n),[2]}}))}))}function Sh(t,e){return(0,Pr.sH)(this,void 0,void 0,(function(){var n,r,i,o,a;return(0,Pr.YH)(this,(function(s){return n=Yr(t),r=e.query,i=!1,(o=n.queries.get(r))&&(a=o.listeners.indexOf(e))>=0&&(o.listeners.splice(a,1),i=0===o.listeners.length),i?[2,(n.queries.delete(r),n.onUnlisten(r))]:[2]}))}))}function Ah(t,e){for(var n=Yr(t),r=!1,i=0,o=e;i<o.length;i++){var a=o[i],s=a.query,u=n.queries.get(s);if(u){for(var c=0,h=u.listeners;c<h.length;c++)h[c].Hr(a)&&(r=!0);u.Wr=a}}r&&Nh(n)}function kh(t,e,n){var r=Yr(t),i=r.queries.get(e);if(i)for(var o=0,a=i.listeners;o<a.length;o++)a[o].onError(n);r.queries.delete(e)}function Nh(t){t.Gr.forEach((function(t){t.next()}))}var Ch=function(){function t(t,e,n){this.query=t,this.Jr=e,this.Yr=!1,this.Xr=null,this.onlineState="Unknown",this.options=n||{}}return t.prototype.Hr=function(t){if(!this.options.includeMetadataChanges){for(var e=[],n=0,r=t.docChanges;n<r.length;n++){var i=r[n];3!==i.type&&e.push(i)}t=new _h(t.query,t.docs,t.oldDocs,e,t.mutatedKeys,t.fromCache,t.syncStateChanged,!0)}var o=!1;return this.Yr?this.Zr(t)&&(this.Jr.next(t),o=!0):this.eo(t,this.onlineState)&&(this.no(t),o=!0),this.Xr=t,o},t.prototype.onError=function(t){this.Jr.error(t)},t.prototype.zr=function(t){this.onlineState=t;var e=!1;return this.Xr&&!this.Yr&&this.eo(this.Xr,t)&&(this.no(this.Xr),e=!0),e},t.prototype.eo=function(t,e){if(!t.fromCache)return!0;var n="Offline"!==e;return!(this.options.so&&n||t.docs.isEmpty()&&"Offline"!==e)},t.prototype.Zr=function(t){if(t.docChanges.length>0)return!0;var e=this.Xr&&this.Xr.hasPendingWrites!==t.hasPendingWrites;return!(!t.syncStateChanged&&!e)&&!0===this.options.includeMetadataChanges},t.prototype.no=function(t){t=_h.fromInitialDocuments(t.query,t.docs,t.mutatedKeys,t.fromCache),this.Yr=!0,this.Jr.next(t)},t}(),Rh=function(){function t(t,e){this.payload=t,this.byteLength=e}return t.prototype.io=function(){return"metadata"in this.payload},t}(),Oh=function(){function t(t){this.R=t}return t.prototype.qn=function(t){return Ua(this.R,t)},t.prototype.Un=function(t){return t.metadata.exists?Ba(this.R,t.document,!1):xi.newNoDocument(this.qn(t.metadata.name),this.Qn(t.metadata.readTime))},t.prototype.Qn=function(t){return Pa(t)},t}(); 1163/** 1164 * @license 1165 * Copyright 2020 Google LLC 1166 * 1167 * Licensed under the Apache License, Version 2.0 (the "License"); 1168 * you may not use this file except in compliance with the License. 1169 * You may obtain a copy of the License at 1170 * 1171 * http://www.apache.org/licenses/LICENSE-2.0 1172 * 1173 * Unless required by applicable law or agreed to in writing, software 1174 * distributed under the License is distributed on an "AS IS" BASIS, 1175 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1176 * See the License for the specific language governing permissions and 1177 * limitations under the License. 1178 */(function(){function t(t,e,n){this.ro=t,this.localStore=e,this.R=n,this.queries=[],this.documents=[],this.progress=Dh(t)}t.prototype.oo=function(t){this.progress.bytesLoaded+=t.byteLength;var e=this.progress.documentsLoaded;return t.payload.namedQuery?this.queries.push(t.payload.namedQuery):t.payload.documentMetadata?(this.documents.push({metadata:t.payload.documentMetadata}),t.payload.documentMetadata.exists||++e):t.payload.document&&(this.documents[this.documents.length-1].document=t.payload.document,++e),e!==this.progress.documentsLoaded?(this.progress.documentsLoaded=e,Object.assign({},this.progress)):null},t.prototype.co=function(t){for(var e=new Map,n=new Oh(this.R),r=0,i=t;r<i.length;r++){var o=i[r];if(o.metadata.queries)for(var a=n.qn(o.metadata.name),s=0,u=o.metadata.queries;s<u.length;s++){var c=u[s],h=(e.get(c)||va()).add(a);e.set(c,h)}}return e},t.prototype.complete=function(){return(0,Pr.sH)(this,void 0,void 0,(function(){var t,e,n,r,i;return(0,Pr.YH)(this,(function(o){switch(o.label){case 0:return[4,uc(this.localStore,new Oh(this.R),this.documents,this.ro.id)];case 1:t=o.sent(),e=this.co(this.documents),n=0,r=this.queries,o.label=2;case 2:return n<r.length?(i=r[n],[4,cc(this.localStore,i,e.get(i.name))]):[3,5];case 3:o.sent(),o.label=4;case 4:return n++,[3,2];case 5:return[2,(this.progress.taskState="Success",new Ku(Object.assign({},this.progress),t))]}}))}))}})();function Dh(t){return{taskState:"Running",documentsLoaded:0,bytesLoaded:0,totalDocuments:t.totalDocuments,totalBytes:t.totalBytes}} 1179/** 1180 * @license 1181 * Copyright 2017 Google LLC 1182 * 1183 * Licensed under the Apache License, Version 2.0 (the "License");
1184 * you may not use this file except in compliance with the License. 1185 * You may obtain a copy of the License at 1186 * 1187 * http://www.apache.org/licenses/LICENSE-2.0 1188 * 1189 * Unless required by applicable law or agreed to in writing, software 1190 * distributed under the License is distributed on an "AS IS" BASIS, 1191 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1192 * See the License for the specific language governing permissions and 1193 * limitations under the License. 1194 */var Ph=function(t){this.key=t},Lh=function(t){this.key=t},xh=function(){function t(t,e){this.query=t,this.uo=e,this.ao=null,this.current=!1,this.ho=va(),this.mutatedKeys=va(),this.lo=yo(t),this.fo=new bh(this.lo)}return Object.defineProperty(t.prototype,"wo",{get:function(){return this.uo},enumerable:!1,configurable:!0}),t.prototype._o=function(t,e){var n=this,r=e?e.mo:new wh,i=e?e.fo:this.fo,o=e?e.mutatedKeys:this.mutatedKeys,a=i,s=!1,u=oo(this.query)&&i.size===this.query.limit?i.last():null,c=ao(this.query)&&i.size===this.query.limit?i.first():null;if(t.inorderTraversal((function(t,e){var h=i.get(t),l=mo(n.query,e)?e:null,f=!!h&&n.mutatedKeys.has(h.key),p=!!l&&(l.hasLocalMutations||n.mutatedKeys.has(l.key)&&l.hasCommittedMutations),d=!1;h&&l?h.data.isEqual(l.data)?f!==p&&(r.track({type:3,doc:l}),d=!0):n.yo(h,l)||(r.track({type:2,doc:l}),d=!0,(u&&n.lo(l,u)>0||c&&n.lo(l,c)<0)&&(s=!0)):!h&&l?(r.track({type:0,doc:l}),d=!0):h&&!l&&(r.track({type:1,doc:h}),d=!0,(u||c)&&(s=!0)),d&&(l?(a=a.add(l),o=p?o.add(t):o.delete(t)):(a=a.delete(t),o=o.delete(t)))})),oo(this.query)||ao(this.query))for(;a.size>this.query.limit;){var h=oo(this.query)?a.last():a.first();a=a.delete(h.key),o=o.delete(h.key),r.track({type:1,doc:h})}return{fo:a,mo:r,Nn:s,mutatedKeys:o}},t.prototype.yo=function(t,e){return t.hasLocalMutations&&e.hasCommittedMutations&&!e.hasLocalMutations},t.prototype.applyChanges=function(t,e,n){var r=this,i=this.fo;this.fo=t.fo,this.mutatedKeys=t.mutatedKeys;var o=t.mo.jr();o.sort((function(t,e){return function(t,e){var n=function(t){switch(t){case 0:return 1;case 2:case 3:return 2;case 1:return 0;default:return Kr()}};return n(t)-n(e)}(t.type,e.type)||r.lo(t.doc,e.doc)})),this.po(n);var a=e?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 _h(this.query,t.fo,i,o,t.mutatedKeys,0===s,u,!1),To:a}:{To:a}},t.prototype.zr=function(t){return this.current&&"Offline"===t?(this.current=!1,this.applyChanges({fo:this.fo,mo:new wh,mutatedKeys:this.mutatedKeys,Nn:!1},!1)):{To:[]}},t.prototype.Io=function(t){return!this.uo.has(t)&&!!this.fo.has(t)&&!this.fo.get(t).hasLocalMutations},t.prototype.po=function(t){var e=this;t&&(t.addedDocuments.forEach((function(t){return e.uo=e.uo.add(t)})),t.modifiedDocuments.forEach((function(t){})),t.removedDocuments.forEach((function(t){return e.uo=e.uo.delete(t)})),this.current=t.current)},t.prototype.Eo=function(){var t=this;if(!this.current)return[];var e=this.ho;this.ho=va(),this.fo.forEach((function(e){t.Io(e.key)&&(t.ho=t.ho.add(e.key))}));var n=[];return e.forEach((function(e){t.ho.has(e)||n.push(new Lh(e))})),this.ho.forEach((function(t){e.has(t)||n.push(new Ph(t))})),n},t.prototype.Ao=function(t){this.uo=t.Bn,this.ho=va();var e=this._o(t.documents);return this.applyChanges(e,!0)},t.prototype.Ro=function(){return _h.fromInitialDocuments(this.query,this.fo,this.mutatedKeys,0===this.ao)},t}(),Mh=function(t,e,n){this.query=t,this.targetId=e,this.view=n},Uh=function(t){this.key=t,this.bo=!1},Fh=function(){function t(t,e,n,r,i,o){this.localStore=t,this.remoteStore=e,this.eventManager=n,this.sharedClientState=r,this.currentUser=i,this.maxConcurrentLimboResolutions=o,this.vo={},this.Po=new Ru((function(t){return vo(t)}),po),this.Vo=new Map,this.So=new Set,this.Do=new ra(bi.comparator),this.Co=new Map,this.No=new lc,this.xo={},this.Fo=new Map,this.ko=yu.Yt(),this.onlineState="Unknown",this.Oo=void 0}return Object.defineProperty(t.prototype,"isPrimaryClient",{get:function(){return!0===this.Oo},enumerable:!1,configurable:!0}),t}();function Vh(t,e){return(0,Pr.sH)(this,void 0,void 0,(function(){var n,r,i,o,a,s;return(0,Pr.YH)(this,(function(u){switch(u.label){case 0:return n=dl(t),(o=n.Po.get(e))?(r=o.targetId,n.sharedCl
1194ientState.addLocalQueryTarget(r),i=o.view.Ro(),[3,4]):[3,1];case 1:return[4,nc(n.localStore,lo(e))];case 2:return a=u.sent(),s=n.sharedClientState.addLocalQueryTarget(a.targetId),r=a.targetId,[4,Hh(n,e,r,"current"===s)];case 3:i=u.sent(),n.isPrimaryClient&&Wc(n.remoteStore,a),u.label=4;case 4:return[2,i]}}))}))}function Hh(t,e,n,r){return(0,Pr.sH)(this,void 0,void 0,(function(){var i,o,a,s,u,c;return(0,Pr.YH)(this,(function(h){switch(h.label){case 0:return t.$o=function(e,n,r){return function(t,e,n,r){return(0,Pr.sH)(this,void 0,void 0,(function(){var i,o,a;return(0,Pr.YH)(this,(function(s){switch(s.label){case 0:return i=e.view._o(n),i.Nn?[4,ic(t.localStore,e.query,!1).then((function(t){var n=t.documents;return e.view._o(n,i)}))]:[3,2];case 1:i=s.sent(),s.label=2;case 2:return o=r&&r.targetChanges.get(e.targetId),a=e.view.applyChanges(i,t.isPrimaryClient,o),[2,(Zh(t,e.targetId,a.To),a.snapshot)]}}))}))}(t,e,n,r)},[4,ic(t.localStore,e,!0)];case 1:return i=h.sent(),o=new xh(e,i.Bn),a=o._o(i.documents),s=ba.createSynthesizedTargetChangeForCurrentChange(n,r&&"Offline"!==t.onlineState),u=o.applyChanges(a,t.isPrimaryClient,s),Zh(t,n,u.To),c=new Mh(e,n,o),[2,(t.Po.set(e,c),t.Vo.has(n)?t.Vo.get(n).push(e):t.Vo.set(n,[e]),u.snapshot)]}}))}))}function jh(t,e){return(0,Pr.sH)(this,void 0,void 0,(function(){var n,r,i;return(0,Pr.YH)(this,(function(o){switch(o.label){case 0:return n=Yr(t),r=n.Po.get(e),(i=n.Vo.get(r.targetId)).length>1?[2,(n.Vo.set(r.targetId,i.filter((function(t){return!po(t,e)}))),void n.Po.delete(e))]:n.isPrimaryClient?(n.sharedClientState.removeLocalQueryTarget(r.targetId),n.sharedClientState.isActiveQueryTarget(r.targetId)?[3,2]:[4,rc(n.localStore,r.targetId,!1).then((function(){n.sharedClientState.clearQueryState(r.targetId),Xc(n.remoteStore,r.targetId),Jh(n,r.targetId)})).catch(Eu)]):[3,3];case 1:o.sent(),o.label=2;case 2:return[3,5];case 3:return Jh(n,r.targetId),[4,rc(n.localStore,r.targetId,!0)];case 4:o.sent(),o.label=5;case 5:return[2]}}
1194))}))}function qh(t,e,n){return(0,Pr.sH)(this,void 0,void 0,(function(){var r,i,o,a;return(0,Pr.YH)(this,(function(s){switch(s.label){case 0:r=vl(t),s.label=1;case 1:return s.trys.push([1,5,,6]),[4,function(t,e){var n,r=Yr(t),i=$r.now(),o=e.reduce((function(t,e){return t.add(e.key)}),va());return r.persistence.runTransaction("Locally write mutations","readwrite",(function(t){return r.Mn.pn(t,o).next((function(o){n=o;for(var a=[],s=0,u=e;s<u.length;s++){var c=u[s],h=qo(c,n.get(c.key));null!=h&&a.push(new Yo(c.key,h,Li(h.toProto().mapValue),Uo.exists(!0)))}return r._n.addMutationBatch(t,i,a,e)}))})).then((function(t){return t.applyToLocalDocumentSet(n),{batchId:t.batchId,changes:n}}))}(r.localStore,e)];case 2:return i=s.sent(),r.sharedClientState.addPendingMutation(i.batchId),function(t,e,n){var r=t.xo[t.currentUser.toKey()];r||(r=new ra(Xr)),r=r.insert(e,n),t.xo[t.currentUser.toKey()]=r}(r,i.batchId,n),[4,nl(r,i.changes)];case 3:return s.sent(),[4,sh(r.remoteStore)];case 4:return s.sent(),[3,6];case 5:return o=s.sent(),a=yh(o,"Failed to persist write"),n.reject(a),[3,6];case 6:return[2]}}
1194))}))}function Bh(t,e){return(0,Pr.sH)(this,void 0,void 0,(function(){var n,r;return(0,Pr.YH)(this,(function(i){switch(i.label){case 0:n=Yr(t),i.label=1;case 1:return i.trys.push([1,4,,6]),[4,Zu(n.localStore,e)];case 2:return r=i.sent(),e.targetChanges.forEach((function(t,e){var r=n.Co.get(e);r&&(Gr(t.addedDocuments.size+t.modifiedDocuments.size+t.removedDocuments.size<=1),t.addedDocuments.size>0?r.bo=!0:t.modifiedDocuments.size>0?Gr(r.bo):t.removedDocuments.size>0&&(Gr(r.bo),r.bo=!1))})),[4,nl(n,r,e)];case 3:return i.sent(),[3,6];case 4:return[4,Eu(i.sent())];case 5:return i.sent(),[3,6];case 6:return[2]}}))}))}function Kh(t,e,n){var r=Yr(t);if(r.isPrimaryClient&&0===n||!r.isPrimaryClient&&1===n){var i=[];r.Po.forEach((function(t,n){var r=n.view.zr(e);r.snapshot&&i.push(r.snapshot)})),function(t,e){var n=Yr(t);n.onlineState=e;var r=!1;n.queries.forEach((function(t,n){for(var i=0,o=n.listeners;i<o.length;i++)o[i].zr(e)&&(r=!0)})),r&&Nh(n)}(r.eventManager,e),i.length&&r.vo._r(i),r.onlineState=e,r.isPrimaryClient&&r.sharedCl
1194ientState.setOnlineState(e)}}function Gh(t,e,n){return(0,Pr.sH)(this,void 0,void 0,(function(){var r,i,o,a,s,u;return(0,Pr.YH)(this,(function(c){switch(c.label){case 0:return(r=Yr(t)).sharedClientState.updateQueryState(e,"rejected",n),i=r.Co.get(e),(o=i&&i.key)?(a=(a=new ra(bi.comparator)).insert(o,xi.newNoDocument(o,Zr.min())),s=va().add(o),u=new ya(Zr.min(),new Map,new aa(Xr),a,s),[4,Bh(r,u)]):[3,2];case 1:return c.sent(),r.Do=r.Do.remove(o),r.Co.delete(e),el(r),[3,4];case 2:return[4,rc(r.localStore,e,!1).then((function(){return Jh(r,e,n)})).catch(Eu)];case 3:c.sent(),c.label=4;case 4:return[2]}}))}))}function Yh(t,e){return(0,Pr.sH)(this,void 0,void 0,(function(){var n,r,i;return(0,Pr.YH)(this,(function(o){switch(o.label){case 0:n=Yr(t),r=e.batch.batchId,o.label=1;case 1:return o.trys.push([1,4,,6]),[4,Ju(n.localStore,e)];case 2:return i=o.sent(),Qh(n,r,null),Xh(n,r),n.sharedClientState.updateMutationState(r,"acknowledged"),[4,nl(n,i)];case 3:return o.sent(),[3,6];case 4:return[4,Eu(o.sent())];case 5:return o.sent(),[3,6];case 6:return[2]}}
1194))}))}function zh(t,e,n){return(0,Pr.sH)(this,void 0,void 0,(function(){var r,i;return(0,Pr.YH)(this,(function(o){switch(o.label){case 0:r=Yr(t),o.label=1;case 1:return o.trys.push([1,4,,6]),[4,function(t,e){var n=Yr(t);return n.persistence.runTransaction("Reject batch","readwrite-primary",(function(t){var r;return n._n.lookupMutationBatch(t,e).next((function(e){return Gr(null!==e),r=e.keys(),n._n.removeMutationBatch(t,e)})).next((function(){return n._n.performConsistencyCheck(t)})).next((function(){return n.Mn.pn(t,r)}))}))}(r.localStore,e)];case 2:return i=o.sent(),Qh(r,e,n),Xh(r,e),r.sharedClientState.updateMutationState(e,"rejected",n),[4,nl(r,i)];case 3:return o.sent(),[3,6];case 4:return[4,Eu(o.sent())];case 5:return o.sent(),[3,6];case 6:return[2]}}))}))}function Wh(t,e){return(0,Pr.sH)(this,void 0,void 0,(function(){var n,r,i,o,a;return(0,Pr.YH)(this,(function(s){switch(s.label){case 0:th((n=Yr(t)).remoteStore)||Hr("SyncEngine","The network is disabled. The task returned by 'awaitPendingWrites()' will not complete until the network is enabled."),s.label=1;case 1:return s.trys.push([1,3,,4]),[4,function(t){var e=Yr(t);return e.persistence.runTransaction("Get highest unacknowledged batch id","readonly",(function(t){return e._n.getHighestUnacknowledgedBatchId(t)}))}(n.localStore)];case 2:return-1===(r=s.sent())?[2,void e.resolve()]:((i=n.Fo.get(r)||[]).push(e),n.Fo.set(r,i),[3,4]);case 3:return o=s.sent(),a=yh(o,"Initialization of waitForPendingWrites() operation failed"),e.reject(a),[3,4];case 4:return[2]}}
1194))}))}function Xh(t,e){(t.Fo.get(e)||[]).forEach((function(t){t.resolve()})),t.Fo.delete(e)}function Qh(t,e,n){var r=Yr(t),i=r.xo[r.currentUser.toKey()];if(i){var o=i.get(e);o&&(n?o.reject(n):o.resolve(),i=i.remove(e)),r.xo[r.currentUser.toKey()]=i}}function Jh(t,e,n){void 0===n&&(n=null),t.sharedClientState.removeLocalQueryTarget(e);for(var r=0,i=t.Vo.get(e);r<i.length;r++){var o=i[r];t.Po.delete(o),n&&t.vo.Mo(o,n)}t.Vo.delete(e),t.isPrimaryClient&&t.No.Zn(e).forEach((function(e){t.No.containsKey(e)||$h(t,e)}))}function $h(t,e){t.So.delete(e.path.canonicalString());var n=t.Do.get(e);null!==n&&(Xc(t.remoteStore,n),t.Do=t.Do.remove(e),t.Co.delete(n),el(t))}function Zh(t,e,n){for(var r=0,i=n;r<i.length;r++){var o=i[r];o instanceof Ph?(t.No.addReference(o.key,e),tl(t,o)):o instanceof Lh?(Hr("SyncEngine","Document no longer in limbo: "+o.key),t.No.removeReference(o.key,e),t.No.containsKey(o.key)||$h(t,o.key)):Kr()}}function tl(t,e){var n=e.key,r=n.path.canonicalString();t.Do.get(n)||t.So.has(r)||(Hr("SyncEngine","New document in limbo: "+n),t.So.add(r),el(t))}function el(t){for(;t.So.size>0&&t.Do.size<t.maxConcurrentLimboResolutions;){var e=t.So.values().next().value;t.So.delete(e);var n=new bi(ii.fromString(e)),r=t.ko.next();t.Co.set(r,new Uh(n)),t.Do=t.Do.insert(n,r),Wc(t.remoteStore,new Ks(lo(io(n.path)),r,2,xr.o))}}function nl(t,e,n){return(0,Pr.sH)(this,void 0,void 0,(function(){var r,i,o,a;return(0,Pr.YH)(this,(function(s){switch(s.label){case 0:return r=Yr(t),i=[],o=[],a=[],r.Po.isEmpty()?[3,3]:(r.Po.forEach((function(t,s){a.push(r.$o(s,e,n).then((function(t){if(t){r.isPrimaryClient&&r.sharedCl
1194ientState.updateQueryState(s.targetId,t.fromCache?"not-current":"current"),i.push(t);var e=Yu.Pn(s.targetId,t);o.push(e)}})))})),[4,Promise.all(a)]);case 1:return s.sent(),r.vo._r(i),[4,function(t,e){return(0,Pr.sH)(this,void 0,void 0,(function(){var n,r,i,o,a,s,u,c,h;return(0,Pr.YH)(this,(function(l){switch(l.label){case 0:n=Yr(t),l.label=1;case 1:return l.trys.push([1,3,,4]),[4,n.persistence.runTransaction("notifyLocalViewChanges","readwrite",(function(t){return Rs.forEach(e,(function(e){return Rs.forEach(e.bn,(function(r){return n.persistence.referenceDelegate.addReference(t,e.targetId,r)})).next((function(){return Rs.forEach(e.vn,(function(r){return n.persistence.referenceDelegate.removeReference(t,e.targetId,r)}))}))}))}))];case 2:return l.sent(),[3,4];case 3:if(!xs(r=l.sent()))throw r;return Hr("LocalStore","Failed to update sequence numbers: "+r),[3,4];case 4:for(i=0,o=e;i<o.length;i++)a=o[i],s=a.targetId,a.fromCache||(u=n.Fn.get(s),c=u.snapshotVersion,h=u.withLastLimboFreeSnapshotVersion(c),n.Fn=n.Fn.insert(s,h));return[2]}}))}))}(r.localStore,o)];case 2:s.sent(),s.label=3;case 3:return[2]}}
1194))}))}function rl(t,e){return(0,Pr.sH)(this,void 0,void 0,(function(){var n,r;return(0,Pr.YH)(this,(function(i){switch(i.label){case 0:return(n=Yr(t)).currentUser.isEqual(e)?[3,3]:(Hr("SyncEngine","User change. New user:",e.toKey()),[4,Qu(n.localStore,e)]);case 1:return r=i.sent(),n.currentUser=e,function(t){t.Fo.forEach((function(t){t.forEach((function(t){t.reject(new Ur(Mr.CANCELLED,"'waitForPendingWrites' promise is rejected due to a user change."))}))})),t.Fo.clear()}(n),n.sharedClientState.handleUserChange(e,r.removedBatchIds,r.addedBatchIds),[4,nl(n,r.Ln)];case 2:i.sent(),i.label=3;case 3:return[2]}}))}))}function il(t,e){var n=Yr(t),r=n.Co.get(e);if(r&&r.bo)return va().add(r.key);var i=va(),o=n.Vo.get(e);if(!o)return i;for(var a=0,s=o;a<s.length;a++){var u=s[a],c=n.Po.get(u);i=i.unionWith(c.view.wo)}return i}function ol(t,e){return(0,Pr.sH)(this,void 0,void 0,(function(){var n,r,i;return(0,Pr.YH)(this,(function(o){switch(o.label){case 0:return[4,ic((n=Yr(t)).localStore,e.query,!0)];case 1:return r=o.sent(),i=e.view.Ao(r),[2,(n.isPrimaryClient&&Zh(n,e.targetId,i.To),i)]}}))}))}function al(t){return(0,Pr.sH)(this,void 0,void 0,(function(){var e;return(0,Pr.YH)(this,(function(n){return[2,ac((e=Yr(t)).localStore).then((function(t){return nl(e,t)}))]}))}))}function sl(t,e,n,r){return(0,Pr.sH)(this,void 0,void 0,(function(){var i,o;return(0,Pr.YH)(this,(function(a){switch(a.label){case 0:return[4,function(t,e){var n=Yr(t),r=Yr(n._n);return n.persistence.runTransaction("Lookup mutation documents","readonly",(function(t){return r.jt(t,e).next((function(e){return e?n.Mn.pn(t,e):Rs.resolve(null)}))}))}((i=Yr(t)).localStore,e)];case 1:return null===(o=a.sent())?[3,6]:"pending"!==n?[3,3]:[4,sh(i.remoteStore)];case 2:return a.sent(),[3,4];case 3:"acknowledged"===n||"rejected"===n?(Qh(i,e,r||null),Xh(i,e),function(t,e){Yr(Yr(t)._n).Gt(e)}(i.localStore,e)):Kr(),a.label=4;case 4:return[4,nl(i,o)];case 5:return a.sent(),[3,7];case 6:Hr("SyncEngine","Cannot apply mutation batch with id: "+e),a.label=7;case 7:return[2]}}
1194))}))}function ul(t,e){return(0,Pr.sH)(this,void 0,void 0,(function(){var n,r,i,o,a,s,u,c;return(0,Pr.YH)(this,(function(h){switch(h.label){case 0:return dl(n=Yr(t)),vl(n),!0!==e||!0===n.Oo?[3,3]:(r=n.sharedClientState.getAllActiveQueryTargets(),[4,cl(n,r.toArray())]);case 1:return i=h.sent(),n.Oo=!0,[4,dh(n.remoteStore,!0)];case 2:for(h.sent(),o=0,a=i;o<a.length;o++)s=a[o],Wc(n.remoteStore,s);return[3,7];case 3:return!1!==e||!1===n.Oo?[3,7]:(u=[],c=Promise.resolve(),n.Vo.forEach((function(t,e){n.sharedClientState.isLocalQueryTarget(e)?u.push(e):c=c.then((function(){return Jh(n,e),rc(n.localStore,e,!0)})),Xc(n.remoteStore,e)})),[4,c]);case 4:return h.sent(),[4,cl(n,u)];case 5:return h.sent(),function(t){var e=Yr(t);e.Co.forEach((function(t,n){Xc(e.remoteStore,n)})),e.No.ts(),e.Co=new Map,e.Do=new ra(bi.comparator)}(n),n.Oo=!1,[4,dh(n.remoteStore,!1)];case 6:h.sent(),h.label=7;case 7:return[2]}}))}))}function cl(t,e,n){return(0,Pr.sH)(this,void 0,void 0,(function(){var n,r,i,o,a,s,u,c,h,l,f,p,d,v;return(0,Pr.YH)(this,(function(g){switch(g.label){case 0:n=Yr(t),r=[],i=[],o=0,a=e,g.label=1;case 1:return o<a.length?(s=a[o],u=void 0,(c=n.Vo.get(s))&&0!==c.length?[4,nc(n.localStore,lo(c[0]))]:[3,7]):[3,13];case 2:u=g.sent(),h=0,l=c,g.label=3;case 3:return h<l.length?(f=l[h],p=n.Po.get(f),[4,ol(n,p)]):[3,6];case 4:(d=g.sent()).snapshot&&i.push(d.snapshot),g.label=5;case 5:return h++,[3,3];case 6:return[3,11];case 7:return[4,oc(n.localStore,s)];case 8:return v=g.sent(),[4,nc(n.localStore,v)];case 9:return u=g.sent(),[4,Hh(n,hl(v),s,!1)];case 10:g.sent(),g.label=11;case 11:r.push(u),g.label=12;case 12:return o++,[3,1];case 13:return[2,(n.vo._r(i),r)]}}))}))}function hl(t){return ro(t.path,t.collectionGroup,t.orderBy,t.filters,t.limit,"F",t.startAt,t.endAt)}function ll(t){var e=Yr(t);return Yr(Yr(e.localStore).persistence).fn()}function fl(t,e,n,r){return(0,Pr.sH)(this,void 0,void 0,(function(){var i,o,a;return(0,Pr.YH)(this,(function(s){switch(s.label){case 0:return(i=Yr(t)).Oo?(Hr("SyncEngine","Ignoring unexpected query state notification."),[3,8]):[3,1];case 1:if(!i.Vo.has(e))return[3,8];switch(n){case"current":case"not-current":return[3,2];case"rejected":return[3,5]}return[3,7];case 2:return[4,ac(i.localStore)];case 3:return o=s.sent(),a=ya.createSynthesizedRemoteEventForCurrentChange(e,"current"===n),[4,nl(i,o,a)];case 4:return s.sent(),[3,8];case 5:return[4,rc(i.localStore,e,!0)];case 6:return s.sent(),Jh(i,e,r),[3,8];case 7:Kr(),s.label=8;case 8:return[2]}}
1194))}))}function pl(t,e,n){return(0,Pr.sH)(this,void 0,void 0,(function(){var r,i,o,a,s,u,c,h,l,f;return(0,Pr.YH)(this,(function(p){switch(p.label){case 0:if(!(r=dl(t)).Oo)return[3,10];i=0,o=e,p.label=1;case 1:return i<o.length?(a=o[i],r.Vo.has(a)?(Hr("SyncEngine","Adding an already active target "+a),[3,5]):[4,oc(r.localStore,a)]):[3,6];case 2:return s=p.sent(),[4,nc(r.localStore,s)];case 3:return u=p.sent(),[4,Hh(r,hl(s),u.targetId,!1)];case 4:p.sent(),Wc(r.remoteStore,u),p.label=5;case 5:return i++,[3,1];case 6:c=function(t){return(0,Pr.YH)(this,(function(e){switch(e.label){case 0:return r.Vo.has(t)?[4,rc(r.localStore,t,!1).then((function(){Xc(r.remoteStore,t),Jh(r,t)})).catch(Eu)]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}}))},h=0,l=n,p.label=7;case 7:return h<l.length?(f=l[h],[5,c(f)]):[3,10];case 8:p.sent(),p.label=9;case 9:return h++,[3,7];case 10:return[2]}}))}))}function dl(t){var e=Yr(t);return e.remoteStore.remoteSyncer.applyRemoteEvent=Bh.bind(null,e),e.remoteStore.remoteSyncer.getRemoteKeysForTarget=il.bind(null,e),e.remoteStore.remoteSyncer.rejectListen=Gh.bind(null,e),e.vo._r=Ah.bind(null,e.eventManager),e.vo.Mo=kh.bind(null,e.eventManager),e}function vl(t){var e=Yr(t);return e.remoteStore.remoteSyncer.applySuccessfulWrite=Yh.bind(null,e),e.remoteStore.remoteSyncer.rejectFailedWrite=zh.bind(null,e),e}var gl=function(){function t(){this.synchronizeTabs=!1}return t.prototype.initialize=function(t){return(0,Pr.sH)(this,void 0,void 0,(function(){return(0,Pr.YH)(this,(function(e){switch(e.label){case 0:return this.R=Fc(t.databaseInfo.databaseId),this.sharedClientState=this.Bo(t),this.persistence=this.qo(t),[4,this.persistence.start()];case 1:return e.sent(),this.gcScheduler=this.Uo(t),this.localStore=this.Qo(t),[2]}}))}))},t.prototype.Uo=function(t){return null},t.prototype.Qo=function(t){return Xu(this.persistence,new zu,t.initialUser,this.R)},t.prototype.qo=function(t){return new mc(bc.bs,this.R)},t.prototype.Bo=function(t){return new Rc},t.prototype.terminate=function(){return(0,Pr.sH)(this,void 0,void 0,(function(){return(0,Pr.YH)(this,(function(t){switch(t.label){case 0:return this.gcScheduler&&this.gcScheduler.stop(),[4,this.sharedClientState.shutdown()];case 1:return t.sent(),[4,this.persistence.shutdown()];case 2:return t.sent(),[2]}}))}))},t}(),ml=function(t){function e(e,n,r){var i=this;return(i=t.call(this)||this).Ko=e,i.cacheSizeBytes=n,i.forceOwnership=r,i.synchronizeTabs=!1,i}return(0,Pr.C6)(e,t),e.prototype.initialize=function(e){return(0,Pr.sH)(this,void 0,void 0,(function(){return(0,Pr.YH)(this,(function(n){switch(n.label){case 0:return[4,t.prototype.initialize.call(this,e)];case 1:return n.sent(),[4,sc(this.localStore)];case 2:return n.sent(),[4,this.Ko.initialize(this,e)];case 3:return n.sent(),[4,vl(this.Ko.syncEngine)];case 4:return n.sent(),[4,sh(this.Ko.remoteStore)];case 5:return n.sent(),[2]}}))}))},e.prototype.Qo=function(t){return Xu(this.persistence,new zu,t.initialUser,this.R)},e.prototype.Uo=function(t){var e=this.persistence.referenceDelegate.garbageCollector;return new Au(e,t.asyncQueue)},e.prototype.qo=function(t){var e=Bu(t.databaseInfo.databaseId,t.databaseInfo.persistenceKey),n=void 0!==this.cacheSizeBytes?hu.withCacheSize(this.cacheSizeBytes):hu.DEFAULT;return new Hu(this.synchronizeTabs,e,t.clientId,n,t.asyncQueue,Mc(),Uc(),this.R,this.sharedClientState,!!this.forceOwnership)},e.prototype.Bo=function(t){return new Rc},e}(gl),yl=function(t){function e(e,n){var r=this;return(r=t.call(this,e,n,!1)||this).Ko=e,r.cacheSizeBytes=n,r.synchronizeTabs=!0,r}return(0,Pr.C6)(e,t),e.prototype.initialize=function(e){return(0,Pr.sH)(this,void 0,void 0,(function(){var n,r=this;return(0,Pr.YH)(this,(function(i){switch(i.label){case 0:return[4,t.prototype.initialize.call(this,e)];case 1:return i.sent(),n=this.Ko.syncEngine,this.sharedClientState instanceof Cc?(this.sharedClientState.syncEngine={ui:sl.bind(null,n),ai:fl.bind(null,n),hi:pl.bind(null,n),fn:ll.bind(null,n),ci:al.bind(null,n)},[4,this.sharedClientState.start()]):[3,3];case 2:i.sent(),i.label=3;case 3:return[4,this.persistence.He((function(t){return(0,Pr.sH)(r,void 0,void 0,(function(){return(0,Pr.YH)(this,(function(e){switch(e.label){case 0:return[4,ul(this.Ko.syncEngine,t)];case 1:return e.sent(),this.gcScheduler&&(t&&!this.gcScheduler.started?this.gcScheduler.start(this.localStore):t||this.gcScheduler.stop()),[2]}}))}))}))];case 4:return i.sent(),[2]}}))}))},e.prototype.Bo=function(t){var e=Mc();
1194if(!Cc.yt(e))throw new Ur(Mr.UNIMPLEMENTED,"IndexedDB persistence is only available on platforms that support LocalStorage.");var n=Bu(t.databaseInfo.databaseId,t.databaseInfo.persistenceKey);return new Cc(e,t.asyncQueue,n,t.clientId,t.initialUser)},e}(ml),bl=function(){function t(){}return t.prototype.initialize=function(t,e){return(0,Pr.sH)(this,void 0,void 0,(function(){var n=this;return(0,Pr.YH)(this,(function(r){switch(r.label){case 0:return this.localStore?[3,2]:(this.localStore=t.localStore,this.sharedClientState=t.sharedClientState,this.datastore=this.createDatastore(e),this.remoteStore=this.createRemoteStore(e),this.eventManager=this.createEventManager(e),this.syncEngine=this.createSyncEngine(e,!t.synchronizeTabs),this.sharedClientState.onlineStateHandler=function(t){return Kh(n.syncEngine,t,1)},this.remoteStore.remoteSyncer.handleCredentialChange=rl.bind(null,this.syncEngine),[4,dh(this.remoteStore,this.syncEngine.isPrimaryClient)]);case 1:r.sent(),r.label=2;case 2:return[2]}}))}))},t.prototype.createEventManager=function(t){return new Eh},t.prototype.createDatastore=function(t){var e,n=Fc(t.databaseInfo.databaseId),r=(e=t.databaseInfo,new xc(e));return function(t,e,n){return new Bc(t,e,n)}(t.credentials,r,n)},t.prototype.createRemoteStore=function(t){var e,n,r,i,o,a=this;return e=this.localStore,n=this.datastore,r=t.asyncQueue,i=function(t){return Kh(a.syncEngine,t,0)},o=Dc.yt()?new Dc:new Oc,new Gc(e,n,r,i,o)},t.prototype.createSyncEngine=function(t,e){return function(t,e,n,r,i,o,a){var s=new Fh(t,e,n,r,i,o);return a&&(s.Oo=!0),s}(this.localStore,this.remoteStore,this.eventManager,this.sharedClientState,t.initialUser,t.maxConcurrentLimboResolutions,e)},t.prototype.terminate=function(){return function(t){return(0,Pr.sH)(this,void 0,void 0,(function(){var e;return(0,Pr.YH)(this,(function(n){switch(n.label){case 0:return e=Yr(t),Hr("RemoteStore","RemoteStore shutting down."),e.$r.add(5),[4,zc(e)];case 1:return n.sent(),e.Lr.shutdown(),e.Br.set("Unknown"),[2]}}))}))}(this.remoteStore)},t}(); 1195/** 1196 * @license 1197 * Copyright 2020 Google LLC 1198 * 1199 * Licensed under the Apache License, Version 2.0 (the "License"); 1200 * you may not use this file except in compliance with the License. 1201 * You may obtain a copy of the License at 1202 * 1203 * http://www.apache.org/licenses/LICENSE-2.0 1204 * 1205 * Unless required by applicable law or agreed to in writing, software 1206 * distributed under the License is distributed on an "AS IS" BASIS, 1207 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1208 * See the License for the specific language governing permissions and 1209 * limitations under the License. 1210 */ 1211/** 1212 * @license 1213 * Copyright 2020 Google LLC 1214 * 1215 * Licensed under the Apache License, Version 2.0 (the "License"); 1216 * you may not use this file except in compliance with the License. 1217 * You may obtain a copy of the License at 1218 * 1219 * http://www.apache.org/licenses/LICENSE-2.0 1220 * 1221 * Unless required by applicable law or agreed to in writing, software 1222 * distributed under the License is distributed on an "AS IS" BASIS, 1223 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1224 * See the License for the specific language governing permissions and 1225 * limitations under the License. 1226 */ 1227/** 1228 * @license 1229 * Copyright 2017 Google LLC 1230 * 1231 * Licensed under the Apache License, Version 2.0 (the "License"); 1232 * you may not use this file except in compliance with the License. 1233 * You may obtain a copy of the License at 1234 * 1235 * http://www.apache.org/licenses/LICENSE-2.0 1236 * 1237 * Unless required by applicable law or agreed to in writing, software 1238 * distributed under the License is distributed on an "AS IS" BASIS, 1239 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1240 * See the License for the specific language governing permissions and 1241 * limitations under the License. 1242 */ 1243var wl=function(){function t(t){this.observer=t,this.muted=!1}return t.prototype.next=function(t){this.observer.next&&this.jo(this.observer.next,t)},t.prototype.error=function(t){this.observer.error?this.jo(this.observer.error,t):console.error("Uncaught Error in snapshot listener:",t)},t.prototype.Wo=function(){this.muted=!0}
1243,t.prototype.jo=function(t,e){var n=this;this.muted||setTimeout((function(){n.muted||t(e)}),0)},t}(),_l=(function(){function t(t,e){var n=this;this.Go=t,this.R=e,this.metadata=new Cs,this.buffer=new Uint8Array,this.zo=new TextDecoder("utf-8"),this.Ho().then((function(t){t&&t.io()?n.metadata.resolve(t.payload.metadata):n.metadata.reject(new Error("The first element of the bundle is not a metadata, it is\n "+JSON.stringify(null==t?void 0:t.payload)))}),(function(t){return n.metadata.reject(t)}))}t.prototype.close=function(){return this.Go.cancel()},t.prototype.getMetadata=function(){return(0,Pr.sH)(this,void 0,void 0,(function(){return(0,Pr.YH)(this,(function(t){return[2,this.metadata.promise]}))}))},t.prototype.Lo=function(){return(0,Pr.sH)(this,void 0,void 0,(function(){return(0,Pr.YH)(this,(function(t){switch(t.label){case 0:return[4,this.getMetadata()];case 1:return[2,(t.sent(),this.Ho())]}}))}))},t.prototype.Ho=function(){return(0,Pr.sH)(this,void 0,void 0,(function(){var t,e,n,r;return(0,Pr.YH)(this,(function(i){switch(i.label){case 0:return[4,this.Jo()];case 1:return null===(t=i.sent())?[2,null]:(e=this.zo.decode(t),n=Number(e),isNaN(n)&&this.Yo("length string ("+e+") is not valid number"),[4,this.Xo(n)]);case 2:return r=i.sent(),[2,new Rh(JSON.parse(r),t.length+n)]}}))}))},t.prototype.Zo=function(){return this.buffer.findIndex((function(t){return t==="{".charCodeAt(0)}))},t.prototype.Jo=function(){return(0,Pr.sH)(this,void 0,void 0,(function(){var t,e;return(0,Pr.YH)(this,(function(n){switch(n.label){case 0:return this.Zo()<0?[4,this.tc()]:[3,3];case 1:if(n.sent())return[3,3];n.label=2;case 2:return[3,0];case 3:return 0===this.buffer.length?[2,null]:((t=this.Zo())<0&&this.Yo("Reached the end of bundle when a length string is expected."),e=this.buffer.slice(0,t),[2,(this.buffer=this.buffer.slice(t),e)])}}))}))},t.prototype.Xo=function(t){return(0,Pr.sH)(this,void 0,void 0,(function(){var e;return(0,Pr.YH)(this,(function(n){switch(n.label){case 0:return this.buffer.length<t?[4,this.tc()]:[3,3];case 1:n.sent()&&this.Yo("Reached the end of bundle when more is expected."),n.label=2;case 2:return[3,0];case 3:return e=this.zo.decode(this.buffer.slice(0,t)),[2,(this.buffer=this.buffer.slice(t),e)]}}))}))},t.prototype.Yo=function(t){throw this.Go.cancel(),new Error("Invalid bundle format: "+t)},t.prototype.tc=function(){return(0,Pr.sH)(this,void 0,void 0,(function(){var t,e;return(0,Pr.YH)(this,(function(n){switch(n.label){case 0:return[4,this.Go.read()];case 1:return(t=n.sent()).done||((e=new Uint8Array(this.buffer.length+t.value.length)).set(this.buffer),e.set(t.value,this.buffer.length),this.buffer=e),[2,t.done]}}))}))}}(),function(){function t(t){this.datastore=t,this.readVersions=new Map,this.mutations=[],this.committed=!1,this.lastWriteError=null,this.writtenDocs=new Set}return t.prototype.lookup=function(t){return(0,Pr.sH)(this,void 0,void 0,(function(){var e,n=this;return(0,Pr.YH)(this,(function(r){switch(r.label){case 0:if(this.ensureCommitNotCalled(),this.mutations.length>0)throw new Ur(Mr.INVALID_ARGUMENT,"Firestore transactions require all reads to be executed before all writes.");return[4,function(t,e){return(0,Pr.sH)(this,void 0,void 0,(function(){var n,r,i,o,a,s;return(0,Pr.YH)(this,(function(u){switch(u.label){case 0:return n=Yr(t),r=Ha(n.R)+"/documents",i={documents:e.map((function(t){return Ma(n.R,t)}))},[4,n.Oi("BatchGetDocuments",r,i)];case 1:return o=u.sent(),a=new Map,o.forEach((function(t){var e=function(t,e){return"found"in e?function(t,e){Gr(!!e.found),e.found.name,e.found.updateTime;var n=Ua(t,e.found.name),r=Pa(e.found.updateTime),i=new Pi({mapValue:{fields:e.found.fields}});return xi.newFoundDocument(n,r,i)}(t,e):"missing"in e?function(t,e){Gr(!!e.missing),Gr(!!e.readTime);var n=Ua(t,e.missing),r=Pa(e.readTime);return xi.newNoDocument(n,r)}(t,e):Kr()}(n.R,t);a.set(e.key.toString(),e)})),s=[],[2,(e.forEach((function(t){var e=a.get(t.toString());Gr(!!e),s.push(e)})),s)]}}))}))}(this.datastore,t)];case 1:return[2,((e=r.sent()).forEach((function(t){return n.recordVersion(t)})),e)]}}))}))},t.prototype.set=function(t,e){this.write(e.toMutation(t,this.prec
1243ondition(t))),this.writtenDocs.add(t.toString())},t.prototype.update=function(t,e){try{this.write(e.toMutation(t,this.preconditionForUpdate(t)))}catch(t){this.lastWriteError=t}this.writtenDocs.add(t.toString())},t.prototype.delete=function(t){this.write(new $o(t,this.precondition(t))),this.writtenDocs.add(t.toString())},t.prototype.commit=function(){return(0,Pr.sH)(this,void 0,void 0,(function(){var t,e=this;return(0,Pr.YH)(this,(function(n){switch(n.label){case 0:if(this.ensureCommitNotCalled(),this.lastWriteError)throw this.lastWriteError;return t=this.readVersions,this.mutations.forEach((function(e){t.delete(e.key.toString())})),t.forEach((function(t,n){var r=bi.fromPath(n);e.mutations.push(new Zo(r,e.precondition(r)))})),[4,function(t,e){return(0,Pr.sH)(this,void 0,void 0,(function(){var n,r,i;return(0,Pr.YH)(this,(function(o){switch(o.label){case 0:return n=Yr(t),r=Ha(n.R)+"/documents",i={writes:e.map((function(t){return Ka(n.R,t)}))},[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]}}))}))},t.prototype.recordVersion=function(t){var e;if(t.isFoundDocument())e=t.version;else{if(!t.isNoDocument())throw Kr();e=Zr.min()}var n=this.readVersions.get(t.key.toString());if(n){if(!e.isEqual(n))throw new Ur(Mr.ABORTED,"Document version changed between two reads.")}else this.readVersions.set(t.key.toString(),e)},t.prototype.precondition=function(t){var e=this.readVersions.get(t.toString());return!this.writtenDocs.has(t.toString())&&e?Uo.updateTime(e):Uo.none()},t.prototype.preconditionForUpdate=function(t){var e=this.readVersions.get(t.toString());if(!this.writtenDocs.has(t.toString())&&e){if(e.isEqual(Zr.min()))throw new Ur(Mr.INVALID_ARGUMENT,"Can't update a document that doesn't exist.");return Uo.updateTime(e)}return Uo.exists(!0)},t.prototype.write=function(t){this.ensureCommitNotCalled(),this.mutations.push(t)},t.prototype.ensureCommitNotCalled=function(){},t}()),Il=function(){function t(t,e,n,r){this.asyncQueue=t,this.datastore=e,this.updateFunction=n,this.deferred=r,this.ec=5,this.Zi=new Vc(this.asyncQueue,"transaction_retry")}return t.prototype.run=function(){this.nc()},t.prototype.nc=function(){var t=this;this.Zi.ji((function(){return(0,Pr.sH)(t,void 0,void 0,(function(){var t,e,n=this;return(0,Pr.YH)(this,(function(r){return t=new _l(this.datastore),(e=this.sc(t))&&e.then((function(e){n.asyncQueue.enqueueAndForget((function(){return t.commit().then((function(){n.deferred.resolve(e)})).catch((function(t){n.ic(t)}))}))})).catch((function(t){n.ic(t)})),[2]}))}))}))},t.prototype.sc=function(t){try{var e=this.updateFunction(t);return!gi(e)&&e.catch&&e.then?e:(this.deferred.reject(Error("Transaction callback must return a Promise")),null)}catch(t){return this.deferred.reject(t),null}},t.prototype.ic=function(t){var e=this;this.ec>0&&this.rc(t)?(this.ec-=1,this.asyncQueue.enqueueAndForget((function(){return e.nc(),Promise.resolve()}))):this.deferred.reject(t)},t.prototype.rc=function(t){if("FirebaseError"===t.name){var e=t.code;return"aborted"===e||"failed-precondition"===e||!ea(e)}return!1},t}(),El=function(){function t(t,e,n){var r=this;this.credentials=t,this.asyncQueue=e,this.databaseInfo=n,this.user=wc.UNAUTHENTICATED,this.clientId=Wr.u(),this.credentialListener=function(){},this.receivedInitialUser=new Cs,this.credentials.setChangeListener((function(t){Hr("FirestoreClient","Received user=",t.uid),r.user=t,r.credentialListener(t),r.receivedInitialUser.resolve()}))}return t.prototype.getConfiguration=function(){return(0,Pr.sH)(this,void 0,void 0,(function(){return(0,Pr.YH)(this,(function(t){switch(t.label){case 0:return[4,this.receivedInitialUser.promise];case 1:return[2,(t.sent(),{asyncQueue:this.asyncQueue,databaseInfo:this.databaseInfo,clientId:this.clientId,credentials:this.credentials,initialUser:this.user,maxConcurrentLimboResolutions:100})]}}))}))},t.prototype.setCredentialChangeListener=function(t){var e=this;this.credentialListener=t,this.receivedInitialUser.promise.then((function(){return e.credentialListener(e.user)}))},t.prototype.verifyNotTerminated=function(){if(this.asyncQueue.isShuttingDown)throw new Ur(Mr.FAILED_PRECONDITION,"The client has already been terminated.")},t.prototype.terminate=function(){var t=this;this.asyncQueue.enterRestrictedMode();var e=new Cs;return this.asyncQueue.enqueueAndForgetEvenWhileRestricted((function(){return(0,Pr.sH)(t,void 0,void 0,(function(){var t,n;return(0,Pr.YH)(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(),e.resolve(),[3,6];case 5:return t=r.sent(),n=yh(t,"Failed to shutdown persistence"),e.reject(n),[3,6];case 6:return[2]}}
1243))}))})),e.promise},t}(); 1244/** 1245 * @license 1246 * Copyright 2020 Google LLC 1247 * 1248 * Licensed under the Apache License, Version 2.0 (the "License"); 1249 * you may not use this file except in compliance with the License. 1250 * You may obtain a copy of the License at 1251 * 1252 * http://www.apache.org/licenses/LICENSE-2.0 1253 * 1254 * Unless required by applicable law or agreed to in writing, software 1255 * distributed under the License is distributed on an "AS IS" BASIS, 1256 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1257 * See the License for the specific language governing permissions and 1258 * limitations under the License. 1259 */function Tl(t,e){return(0,Pr.sH)(this,void 0,void 0,(function(){var n,r,i=this;return(0,Pr.YH)(this,(function(o){switch(o.label){case 0:return t.asyncQueue.verifyOperationInProgress(),Hr("FirestoreClient","Initializing OfflineComponentProvider"),[4,t.getConfiguration()];case 1:return n=o.sent(),[4,e.initialize(n)];case 2:return o.sent(),r=n.initialUser,t.setCredentialChangeListener((function(n){r.isEqual(n)||(r=n,t.asyncQueue.enqueueRetryable((function(){return(0,Pr.sH)(i,void 0,void 0,(function(){return(0,Pr.YH)(this,(function(t){switch(t.label){case 0:return[4,Qu(e.localStore,n)];case 1:return t.sent(),[2]}}))}))})))})),e.persistence.setDatabaseDeletedListener((function(){return t.terminate()})),t.offlineComponents=e,[2]}}))}))}function Sl(t,e){return(0,Pr.sH)(this,void 0,void 0,(function(){var n,r;return(0,Pr.YH)(this,(function(i){switch(i.label){case 0:return t.asyncQueue.verifyOperationInProgress(),[4,Al(t)];case 1:return n=i.sent(),Hr("FirestoreClient","Initializing OnlineComponentProvider"),[4,t.getConfiguration()];case 2:return r=i.sent(),[4,e.initialize(n,r)];case 3:return i.sent(),t.setCredentialChangeListener((function(n){return t.asyncQueue.enqueueRetryable((function(){return function(t,e){return(0,Pr.sH)(this,void 0,void 0,(function(){var n,r;return(0,Pr.YH)(this,(function(i){switch(i.label){case 0:return(n=Yr(t)).asyncQueue.verifyOperationInProgress(),Hr("RemoteStore","RemoteStore received new credentials"),r=th(n),n.$r.add(3),[4,zc(n)];case 1:return i.sent(),r&&n.Br.set("Unknown"),[4,n.remoteSyncer.handleCredentialChange(e)];case 2:return i.sent(),n.$r.delete(3),[4,Yc(n)];case 3:return i.sent(),[2]}}))}))}(e.remoteStore,n)}))})),t.onlineComponents=e,[2]}}))}))}function Al(t){return(0,Pr.sH)(this,void 0,void 0,(function(){return(0,Pr.YH)(this,(function(e){switch(e.label){case 0:return t.offlineComponents?[3,2]:(Hr("FirestoreClient","Using default OfflineComponentProvider"),[4,Tl(t,new gl)]);case 1:e.sent(),e.label=2;case 2:return[2,t.offlineComponents]}}))}))}function kl(t){return(0,Pr.sH)(this,void 0,void 0,(function(){return(0,Pr.YH)(this,(function(e){switch(e.label){case 0:return t.onlineComponents?[3,2]:(Hr("FirestoreClient","Using default OnlineComponentProvider"),[4,Sl(t,new bl)]);case 1:e.sent(),e.label=2;case 2:return[2,t.onlineComponents]}}))}))}function Nl(t){return Al(t).then((function(t){return t.persistence}))}function Cl(t){return Al(t).then((function(t){return t.localStore}))}function Rl(t){return kl(t).then((function(t){return t.remoteStore}))}function Ol(t){return kl(t).then((function(t){return t.syncEngine}))}function Dl(t){return(0,Pr.sH)(this,void 0,void 0,(function(){var e,n;return(0,Pr.YH)(this,(function(r){switch(r.label){case 0:return[4,kl(t)];case 1:return e=r.sent(),[2,((n=e.eventManager).onListen=Vh.bind(null,e.syncEngine),n.onUnlisten=jh.bind(null,e.syncEngine),n)]}}))}))}function Pl(t,e,n){var r=this;void 0===n&&(n={});var i=new Cs;return t.asyncQueue.enqueueAndForget((function(){return(0,Pr.sH)(r,void 0,void 0,(function(){var r;return(0,Pr.YH)(this,(function(o){switch(o.label){case 0:return r=function(t,e,n,r,i){var o=new wl({next:function(o){e.enqueueAndForget((function(){return Sh(t,a)}));var s=o.docs.has(n);!s&&o.fromCache?i.reject(new Ur(Mr.UNAVAILABLE,"Failed to get document because the client is offline.")):s&&o.fromCache&&r&&"server"===r.source?i.reject(new Ur(Mr.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(t){return i.reject(t)}}),a=new Ch(io(n.path),o,{includeMetadataChanges:!0,so:!0});return Th(t,a)},[4,Dl(t)];case 1:return[2,r.apply(void 0,[o.sent(),t.asyncQueue,e,n,i])]}}))}))})),i.promise}function Ll(t,e,n){var r=this;void 0===n&&(n={});var i=new Cs;return t.asyncQueue.enqueueAndForget((function(){return(0,Pr.sH)(r,void 0,void 0,(function(){var r;return(0,Pr.YH)(this,(function(o){switch(o.label){case 0:return r=function(t,e,n,r,i){var o=new wl({next:function(n){e.enqueueAndForget((function(){return Sh(t,a)}
1259)),n.fromCache&&"server"===r.source?i.reject(new Ur(Mr.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(t){return i.reject(t)}}),a=new Ch(n,o,{includeMetadataChanges:!0,so:!0});return Th(t,a)},[4,Dl(t)];case 1:return[2,r.apply(void 0,[o.sent(),t.asyncQueue,e,n,i])]}}))}))})),i.promise}var xl=function(t,e,n,r,i,o,a){this.databaseId=t,this.appId=e,this.persistenceKey=n,this.host=r,this.ssl=i,this.forceLongPolling=o,this.autoDetectLongPolling=a},Ml=function(){function t(t,e){this.projectId=t,this.database=e||"(default)"}return Object.defineProperty(t.prototype,"isDefaultDatabase",{get:function(){return"(default)"===this.database},enumerable:!1,configurable:!0}),t.prototype.isEqual=function(e){return e instanceof t&&e.projectId===this.projectId&&e.database===this.database},t}(),Ul=new Map,Fl=function(t,e){this.user=e,this.type="OAuth",this.authHeaders={},this.authHeaders.Authorization="Bearer "+t},Vl=function(){function t(){this.changeListener=null}return t.prototype.getToken=function(){return Promise.resolve(null)},t.prototype.invalidateToken=function(){},t.prototype.setChangeListener=function(t){this.changeListener=t,t(wc.UNAUTHENTICATED)},t.prototype.removeChangeListener=function(){this.changeListener=null},t}(),Hl=function(){function t(t){this.token=t,this.changeListener=null}return t.prototype.getToken=function(){return Promise.resolve(this.token)},t.prototype.invalidateToken=function(){},t.prototype.setChangeListener=function(t){this.changeListener=t,t(this.token.user)},t.prototype.removeChangeListener=function(){this.changeListener=null},t}(),jl=function(){function t(t){var e=this;this.oc=null,this.currentUser=wc.UNAUTHENTICATED,this.receivedInitialUser=!1,this.cc=0,this.changeListener=null,this.forceRefresh=!1,this.oc=function(){e.cc++,e.currentUser=e.uc(),e.receivedInitialUser=!0,e.changeListener&&e.changeListener(e.currentUser)},this.cc=0,this.auth=t.getImmediate({optional:!0}),this.auth?this.auth.addAuthTokenListener(this.oc):(this.oc(null),t.get().then((function(t){e.auth=t,e.oc&&e.auth.addAuthTokenListener(e.oc)}),(function(){})))}return t.prototype.getToken=function(){var t=this,e=this.cc,n=this.forceRefresh;return this.forceRefresh=!1,this.auth?this.auth.getToken(n).then((function(n){return t.cc!==e?(Hr("FirebaseCredentialsProvider","getToken aborted due to token change."),t.getToken()):n?(Gr("string"==typeof n.accessToken),new Fl(n.accessToken,t.currentUser)):null})):Promise.resolve(null)},t.prototype.invalidateToken=function(){this.forceRefresh=!0},t.prototype.setChangeListener=function(t){this.changeListener=t,this.receivedInitialUser&&t(this.currentUser)},t.prototype.removeChangeListener=function(){this.auth&&this.auth.removeAuthTokenListener(this.oc),this.oc=null,this.changeListener=null},t.prototype.uc=function(){var t=this.auth&&this.auth.getUid();return Gr(null===t||"string"==typeof t),new wc(t)},t}(),ql=function(){function t(t,e,n){this.ac=t,this.hc=e,this.lc=n,this.type="FirstParty",this.user=wc.FIRST_PARTY}return Object.defineProperty(t.prototype,"authHeaders",{get:function(){var t={"X-Goog-AuthUser":this.hc},e=this.ac.auth.getAuthHeaderValueForFirstParty([]);return e&&(t.Authorization=e),this.lc&&(t["X-Goog-Iam-Authorization-Token"]=this.lc),t},enumerable:!1,configurable:!0}),t}(),Bl=function(){function t(t,e,n){this.ac=t,this.hc=e,this.lc=n}return t.prototype.getToken=function(){return Promise.resolve(new ql(this.ac,this.hc,this.lc))},t.prototype.setChangeListener=function(t){t(wc.FIRST_PARTY)},t.prototype.removeChangeListener=function(){},t.prototype.invalidateToken=function(){},t}(); 1260/** 1261 * @license 1262 * Copyright 2017 Google LLC 1263 * 1264 * Licensed under the Apache License, Version 2.0 (the "License"); 1265 * you may not use this file except in compliance with the License. 1266 * You may obtain a copy of the License at 1267 * 1268 * http://www.apache.org/licenses/LICENSE-2.0 1269 * 1270 * Unless required by applicable law or agreed to in writing, software 1271 * distributed under the License is distributed on an "AS IS" BASIS, 1272 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1273 * See the License for the specific language governing permissions and 1274 * limitations under the License. 1275 */function Kl(t,e,n){if(!n)throw new Ur(Mr.INVALID_ARGUMENT,"Function "+t+"() cannot be called with an empty "+e+".")}function Gl(t,e){if(void 0===e)return{merge:!1};if(void 0!==e.mergeFields&&void 0!==e.merge)throw new Ur(Mr.INVALID_ARGUMENT,"Invalid options passed to function "+t+'(): You cannot specify both "merge" and "mergeFields".');return e}function Yl(t,e,n,r){if(!0===e&&!0===r)throw new Ur(Mr.INVALID_ARGUMENT,t+" and "+n+" cannot be used together.")}function zl(t){if(!bi.isDocumentKey(t))throw new Ur(Mr.INVALID_ARGUMENT,"Invalid document reference. Document references must have an even number of segments, but "+t+" has "+t.length+".")}function Wl(t){if(bi.isDocumentKey(t))throw new Ur(Mr.INVALID_ARGUMENT,"Invalid collection reference. Collection references must have an odd number of segments, but "+t+" has "+t.length+".")}function Xl(t){if(void 0===t)return"undefined";if(null===t)return"null";if("string"==typeof t)return t.length>20&&(t=t.substring(0,20)+"..."),JSON.stringify(t);if("number"==typeof t||"boolean"==typeof t)return""+t;if("object"==typeof t){if(t instanceof Array)return"an array";var e=function(t){if(t.constructor){var e=/function\s+([^\s(]+)\s*\(/.exec(t.constructor.toString());if(e&&e.length>1)return e[1]}return null}(t);return e?"a custom "+e+" object":"an object"}return"function"==typeof t?"a function":Kr()}function Ql(t,e){if("_delegate"in t&&(t=t._delegate),!(t instanceof e)){if(e.name===t.constructor.name)throw new Ur(Mr.INVALID_ARGUMENT,"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");var n=Xl(t);throw new Ur(Mr.INVALID_ARGUMENT,"Expected type '"+e.name+"', but it was: "+n)}return t}function Jl(t,e){if(e<=0)throw new Ur(Mr.INVALID_ARGUMENT,"Function "+t+"() requires a positive number, but it was: "+e+".")} 1276/** 1277 * @license 1278 * Copyright 2020 Google LLC 1279 * 1280 * Licensed under the Apache License, Version 2.0 (the "License");
1281 * you may not use this file except in compliance with the License. 1282 * You may obtain a copy of the License at 1283 * 1284 * http://www.apache.org/licenses/LICENSE-2.0 1285 * 1286 * Unless required by applicable law or agreed to in writing, software 1287 * distributed under the License is distributed on an "AS IS" BASIS, 1288 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1289 * See the License for the specific language governing permissions and 1290 * limitations under the License. 1291 */var $l=function(){function t(t){var e;if(void 0===t.host){if(void 0!==t.ssl)throw new Ur(Mr.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host="firestore.googleapis.com",this.ssl=!0}else this.host=t.host,this.ssl=null===(e=t.ssl)||void 0===e||e;if(this.credentials=t.credentials,this.ignoreUndefinedProperties=!!t.ignoreUndefinedProperties,void 0===t.cacheSizeBytes)this.cacheSizeBytes=41943040;else{if(-1!==t.cacheSizeBytes&&t.cacheSizeBytes<1048576)throw new Ur(Mr.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");this.cacheSizeBytes=t.cacheSizeBytes}this.experimentalForceLongPolling=!!t.experimentalForceLongPolling,this.experimentalAutoDetectLongPolling=!!t.experimentalAutoDetectLongPolling,Yl("experimentalForceLongPolling",t.experimentalForceLongPolling,"experimentalAutoDetectLongPolling",t.experimentalAutoDetectLongPolling)}return t.prototype.isEqual=function(t){return this.host===t.host&&this.ssl===t.ssl&&this.credentials===t.credentials&&this.cacheSizeBytes===t.cacheSizeBytes&&this.experimentalForceLongPolling===t.experimentalForceLongPolling&&this.experimentalAutoDetectLongPolling===t.experimentalAutoDetectLongPolling&&this.ignoreUndefinedProperties===t.ignoreUndefinedProperties},t}(),Zl=function(){function t(t,e){this.type="firestore-lite",this._persistenceKey="(lite)",this._settings=new $l({}),this._settingsFrozen=!1,t instanceof Ml?(this._databaseId=t,this._credentials=new Vl):(this._app=t,this._databaseId=function(t){if(!Object.prototype.hasOwnProperty.apply(t.options,["projectId"]))throw new Ur(Mr.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');return new Ml(t.options.projectId)}(t),this._credentials=new jl(e))}return Object.defineProperty(t.prototype,"app",{get:function(){if(!this._app)throw new Ur(Mr.FAILED_PRECONDITION,"Firestore was not initialized using the Firebase SDK. 'app' is not available");return this._app},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_initialized",{get:function(){return this._settingsFrozen},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_terminated",{get:function(){return void 0!==this._terminateTask},enumerable:!1,configurable:!0}),t.prototype._setSettings=function(t){if(this._settingsFrozen)throw new Ur(Mr.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 $l(t),void 0!==t.credentials&&(this._credentials=function(t){if(!t)return new Vl;switch(t.type){case"gapi":var e=t.client;return Gr(!("object"!=typeof e||null===e||!e.auth||!e.auth.getAuthHeaderValueForFirstParty)),new Bl(e,t.sessionIndex||"0",t.iamToken||null);case"provider":return t.client;default:throw new Ur(Mr.INVALID_ARGUMENT,"makeCredentialsProvider failed due to invalid credential type")}}(t.credentials))},t.prototype._getSettings=function(){return this._settings},t.prototype._freezeSettings=function(){return this._settingsFrozen=!0,this._settings},t.prototype._delete=function(){return this._terminateTask||(this._terminateTask=this._terminate()),this._terminateTask},t.prototype.toJSON=function(){return{app:this._app,databaseId:this._databaseId,settings:this._settings}},t.prototype._terminate=function(){return t=this,(e=Ul.get(t))&&(Hr("ComponentProvider","Removing Datastore"),Ul.delete(t),e.terminate()),Promise.resolve();var t,e},t}(),tf=function(){function t(t,e,n){this.converter=e,this._key=n,this.type="document",this.firestore=t}return Object.defineProperty(t.prototype,"_path",{get:function(){return this._key.path}
1291,enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"id",{get:function(){return this._key.path.lastSegment()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"path",{get:function(){return this._key.path.canonicalString()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){return new nf(this.firestore,this.converter,this._key.path.popLast())},enumerable:!1,configurable:!0}),t.prototype.withConverter=function(e){return new t(this.firestore,e,this._key)},t}(),ef=function(){function t(t,e,n){this.converter=e,this._query=n,this.type="query",this.firestore=t}return t.prototype.withConverter=function(e){return new t(this.firestore,e,this._query)},t}(),nf=function(t){function e(e,n,r){var i=this;return(i=t.call(this,e,n,io(r))||this)._path=r,i.type="collection",i}return(0,Pr.C6)(e,t),Object.defineProperty(e.prototype,"id",{get:function(){return this._query.path.lastSegment()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"path",{get:function(){return this._query.path.canonicalString()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){var t=this._path.popLast();return t.isEmpty()?null:new tf(this.firestore,null,new bi(t))},enumerable:!1,configurable:!0}),e.prototype.withConverter=function(t){return new e(this.firestore,t,this._path)},e}(ef); 1292/** 1293 * @license 1294 * Copyright 2020 Google LLC 1295 * 1296 * Licensed under the Apache License, Version 2.0 (the "License"); 1297 * you may not use this file except in compliance with the License. 1298 * You may obtain a copy of the License at 1299 * 1300 * http://www.apache.org/licenses/LICENSE-2.0 1301 * 1302 * Unless required by applicable law or agreed to in writing, software 1303 * distributed under the License is distributed on an "AS IS" BASIS, 1304 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1305 * See the License for the specific language governing permissions and 1306 * limitations under the License. 1307 */function rf(t,e){for(var n,r=[],o=2;o<arguments.length;o++)r[o-2]=arguments[o];if(t=(0,i.Ku)(t),Kl("collection","path",e),t instanceof Zl)return Wl(n=ii.fromString.apply(ii,(0,Pr.fX)([e],r))),new nf(t,null,n);if(!(t instanceof tf||t instanceof nf))throw new Ur(Mr.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");return Wl(n=ii.fromString.apply(ii,(0,Pr.fX)([t.path],r)).child(ii.fromString(e))),new nf(t.firestore,null,n)}function of(t,e){for(var n,r=[],o=2;o<arguments.length;o++)r[o-2]=arguments[o];if(t=(0,i.Ku)(t),1===arguments.length&&(e=Wr.u()),Kl("doc","path",e),t instanceof Zl)return zl(n=ii.fromString.apply(ii,(0,Pr.fX)([e],r))),new tf(t,null,new bi(n));if(!(t instanceof tf||t instanceof nf))throw new Ur(Mr.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");return zl(n=t._path.child(ii.fromString.apply(ii,(0,Pr.fX)([e],r)))),new tf(t.firestore,t instanceof nf?t.converter:null,new bi(n))}function af(t,e){return t=(0,i.Ku)(t),e=(0,i.Ku)(e),(t instanceof tf||t instanceof nf)&&(e instanceof tf||e instanceof nf)&&t.firestore===e.firestore&&t.path===e.path&&t.converter===e.converter}function sf(t,e){return t=(0,i.Ku)(t),e=(0,i.Ku)(e),t instanceof ef&&e instanceof ef&&t.firestore===e.firestore&&po(t._query,e._query)&&t.converter===e.converter 1308/** 1309 * @license 1310 * Copyright 2020 Google LLC 1311 * 1312 * Licensed under the Apache License, Version 2.0 (the "License"); 1313 * you may not use this file except in compliance with the License. 1314 * You may obtain a copy of the License at 1315 * 1316 * http://www.apache.org/licenses/LICENSE-2.0 1317 * 1318 * Unless required by applicable law or agreed to in writing, software 1319 * distributed under the License is distributed on an "AS IS" BASIS, 1320 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1321 * See the License for the specific language governing permissions and 1322 * limitations under the License. 1323 */}var uf=function(){function t(){var t=this;this.fc=Promise.resolve(),this.dc=[],this.wc=!1,this._c=[],this.mc=null,this.yc=!1,this.gc=[],this.Zi=new Vc(this,"async_queue_retry"),this.Ec=function(){var e=Uc();e&&Hr("AsyncQueue","Visibility state changed to "+e.visibilityState),t.Zi.Gi()};var e=Uc();e&&"function"==typeof e.addEventListener&&e.addEventListener("visibilitychange",this.Ec)}return Object.defineProperty(t.prototype,"isShuttingDown",{get:function(){return this.wc}
1323,enumerable:!1,configurable:!0}),t.prototype.enqueueAndForget=function(t){this.enqueue(t)},t.prototype.enqueueAndForgetEvenWhileRestricted=function(t){this.Tc(),this.Ic(t)},t.prototype.enterRestrictedMode=function(){if(!this.wc){this.wc=!0;var t=Uc();t&&"function"==typeof t.removeEventListener&&t.removeEventListener("visibilitychange",this.Ec)}},t.prototype.enqueue=function(t){return this.Tc(),this.wc?new Promise((function(t){})):this.Ic(t)},t.prototype.enqueueRetryable=function(t){var e=this;this.enqueueAndForget((function(){return e.dc.push(t),e.Ac()}))},t.prototype.Ac=function(){return(0,Pr.sH)(this,void 0,void 0,(function(){var t,e=this;return(0,Pr.YH)(this,(function(n){switch(n.label){case 0:if(0===this.dc.length)return[3,5];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this.dc[0]()];case 2:return n.sent(),this.dc.shift(),this.Zi.reset(),[3,4];case 3:if(!xs(t=n.sent()))throw t;return Hr("AsyncQueue","Operation failed with retryable error: "+t),[3,4];case 4:this.dc.length>0&&this.Zi.ji((function(){return e.Ac()})),n.label=5;case 5:return[2]}}
1323))}))},t.prototype.Ic=function(t){var e=this,n=this.fc.then((function(){return e.yc=!0,t().catch((function(t){throw e.mc=t,e.yc=!1,jr("INTERNAL UNHANDLED ERROR: ",function(t){var e=t.message||"";return t.stack&&(e=t.stack.includes(t.message)?t.stack:t.message+"\n"+t.stack),e}(t)),t})).then((function(t){return e.yc=!1,t}))}));return this.fc=n,n},t.prototype.enqueueAfterDelay=function(t,e,n){var r=this;this.Tc(),this.gc.indexOf(t)>-1&&(e=0);var i=mh.createAndSchedule(this,t,e,n,(function(t){return r.Rc(t)}));return this._c.push(i),i},t.prototype.Tc=function(){this.mc&&Kr()},t.prototype.verifyOperationInProgress=function(){},t.prototype.bc=function(){return(0,Pr.sH)(this,void 0,void 0,(function(){var t;return(0,Pr.YH)(this,(function(e){switch(e.label){case 0:return[4,t=this.fc];case 1:e.sent(),e.label=2;case 2:if(t!==this.fc)return[3,0];e.label=3;case 3:return[2]}}))}))},t.prototype.vc=function(t){for(var e=0,n=this._c;e<n.length;e++)if(n[e].timerId===t)return!0;return!1},t.prototype.Pc=function(t){var e=this;return this.bc().then((function(){e._c.sort((function(t,e){return t.targetTimeMs-e.targetTimeMs}));for(var n=0,r=e._c;n<r.length;n++){var i=r[n];if(i.skipDelay(),"all"!==t&&i.timerId===t)break}return e.bc()}))},t.prototype.Vc=function(t){this.gc.push(t)},t.prototype.Rc=function(t){var e=this._c.indexOf(t);this._c.splice(e,1)},t}();function cf(t){return function(t){if("object"!=typeof t||null===t)return!1;for(var e=t,n=0,r=["next","error","complete"];n<r.length;n++){var i=r[n];if(i in e&&"function"==typeof e[i])return!0}return!1}(t)}(function(){function t(){this._progressObserver={},this._taskCompletionResolver=new Cs,this._lastProgress={taskState:"Running",totalBytes:0,totalDocuments:0,bytesLoaded:0,documentsLoaded:0}}t.prototype.onProgress=function(t,e,n){this._progressObserver={next:t,error:e,complete:n}},t.prototype.catch=function(t){return this._taskCompletionResolver.promise.catch(t)},t.prototype.then=function(t,e){return this._taskCompletionResolver.promise.then(t,e)},t.prototype._completeWith=function(t){this._updateProgress(t),this._progressObserver.complete&&this._progressObserver.complete(),this._taskCompletionResolver.resolve(t)},t.prototype._failWith=function(t){this._lastProgress.taskState="Error",this._progressObserver.next&&this._progressObserver.next(this._lastProgress),this._progressObserver.error&&this._progressObserver.error(t),this._taskCompletionResolver.reject(t)},t.prototype._updateProgress=function(t){this._lastProgress=t,this._progressObserver.next&&this._progressObserver.next(t)}})(); 1324/** 1325 * @license 1326 * Copyright 2020 Google LLC 1327 * 1328 * Licensed under the Apache License, Version 2.0 (the "License"); 1329 * you may not use this file except in compliance with the License. 1330 * You may obtain a copy of the License at 1331 * 1332 * http://www.apache.org/licenses/LICENSE-2.0 1333 * 1334 * Unless required by applicable law or agreed to in writing, software 1335 * distributed under the License is distributed on an "AS IS" BASIS, 1336 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1337 * See the License for the specific language governing permissions and 1338 * limitations under the License. 1339 */var hf=-1,lf=function(t){function e(e,n){var r=this;return(r=t.call(this,e,n)||this).type="firestore",r._queue=new uf,r._persistenceKey="name"in e?e.name:"[DEFAULT]",r}return(0,Pr.C6)(e,t),e.prototype._terminate=function(){return this._firestoreClient||pf(this),this._firestoreClient.terminate()},e}(Zl);function ff(t){return t._firestoreClient||pf(t),t._firestoreClient.verifyNotTerminated(),t._firestoreClient}function pf(t){var e,n=t._freezeSettings(),r=function(t,e,n,r){return new xl(t,e,n,r.host,r.ssl,r.experimentalForceLongPolling,r.experimentalAutoDetectLongPolling)}(t._databaseId,(null===(e=t._app)||void 0===e?void 0:e.options.appId)||"",t._persistenceKey,n);t._firestoreClient=new El(t._credentials,t._queue,r)}function df(t,e,n){var r=this,i=new Cs;return t.asyncQueue.enqueue((function(){return(0,Pr.sH)(r,void 0,void 0,(function(){var r;return(0,Pr.YH)(this,(function(o){switch(o.label){case 0:return o.trys.push([0,3,,4]),[4,Tl(t,n)];case 1:return o.sent(),[4,Sl(t,e)];case 2:return o.sent(),i.resolve(),[3,4];case 3:if(!function(t){return"FirebaseError"===t.name?t.code===Mr.FAILED_PRECONDITION||t.code===Mr.UNIMPLEMENT
1339ED:!("undefined"!=typeof DOMException&&t instanceof DOMException)||22===t.code||20===t.code||11===t.code}(r=o.sent()))throw r;return console.warn("Error enabling offline persistence. Falling back to persistence disabled: "+r),i.reject(r),[3,4];case 4:return[2]}}))}))})).then((function(){return i.promise}))}function vf(t){if(t._initialized||t._terminated)throw new Ur(Mr.FAILED_PRECONDITION,"Firestore has already been started and persistence can no longer be enabled. You can only enable persistence before calling any other methods on a Firestore object.")} 1340/** 1341 * @license 1342 * Copyright 2020 Google LLC 1343 * 1344 * Licensed under the Apache License, Version 2.0 (the "License"); 1345 * you may not use this file except in compliance with the License. 1346 * You may obtain a copy of the License at 1347 * 1348 * http://www.apache.org/licenses/LICENSE-2.0 1349 * 1350 * Unless required by applicable law or agreed to in writing, software 1351 * distributed under the License is distributed on an "AS IS" BASIS, 1352 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1353 * See the License for the specific language governing permissions and 1354 * limitations under the License. 1355 */var gf=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var n=0;n<t.length;++n)if(0===t[n].length)throw new Ur(Mr.INVALID_ARGUMENT,"Invalid field name at argument $(i + 1). Field names must not be empty.");this._internalPath=new ai(t)}return t.prototype.isEqual=function(t){return this._internalPath.isEqual(t._internalPath)},t}(),mf=function(){function t(t){this._byteString=t}return t.fromBase64String=function(e){try{return new t(ui.fromBase64String(e))}catch(e){throw new Ur(Mr.INVALID_ARGUMENT,"Failed to construct data from Base64 string: "+e)}},t.fromUint8Array=function(e){return new t(ui.fromUint8Array(e))},t.prototype.toBase64=function(){return this._byteString.toBase64()},t.prototype.toUint8Array=function(){return this._byteString.toUint8Array()},t.prototype.toString=function(){return"Bytes(base64: "+this.toBase64()+")"},t.prototype.isEqual=function(t){return this._byteString.isEqual(t._byteString)},t}(),yf=function(t){this._methodName=t},bf=function(){function t(t,e){if(!isFinite(t)||t<-90||t>90)throw new Ur(Mr.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+t);if(!isFinite(e)||e<-180||e>180)throw new Ur(Mr.INVALID_ARGUMENT,"Longitude must be a number between -180 and 180, but was: "+e);this._lat=t,this._long=e}return Object.defineProperty(t.prototype,"latitude",{get:function(){return this._lat},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"longitude",{get:function(){return this._long},enumerable:!1,configurable:!0}),t.prototype.isEqual=function(t){return this._lat===t._lat&&this._long===t._long},t.prototype.toJSON=function(){return{latitude:this._lat,longitude:this._long}},t.prototype._compareTo=function(t){return Xr(this._lat,t._lat)||Xr(this._long,t._long)},t}(),wf=/^__.*__$/,_f=function(){function t(t,e,n){this.data=t,this.fieldMask=e,this.fieldTransforms=n}return t.prototype.toMutation=function(t,e){return null!==this.fieldMask?new Yo(t,this.data,this.fieldMask,e,this.fieldTransforms):new Go(t,this.data,e,this.fieldTransforms)},t}(),If=function(){function t(t,e,n){this.data=t,this.fieldMask=e,this.fieldTransforms=n}return t.prototype.toMutation=function(t,e){return new Yo(t,this.data,this.fieldMask,e,this.fieldTransforms)},t}(); 1356/** 1357 * @license 1358 * Copyright 2020 Google LLC 1359 * 1360 * Licensed under the Apache License, Version 2.0 (the "License"); 1361 * you may not use this file except in compliance with the License. 1362 * You may obtain a copy of the License at 1363 * 1364 * http://www.apache.org/licenses/LICENSE-2.0 1365 * 1366 * Unless required by applicable law or agreed to in writing, software 1367 * distributed under the License is distributed on an "AS IS" BASIS, 1368 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1369 * See the License for the specific language governing permissions and 1370 * limitations under the License. 1371 */function Ef(t){switch(t){case 0:case 2:case 1:return!0;case 3:case 4:return!1;default:throw Kr()}}var Tf=function(){function t(t,e,n,r,i,o){this.settings=t,this.databaseId=e,this.R=n,this.ignoreUndefinedProperties=r,void 0===i&&this.Sc(),this.fieldTransforms=i||[],this.fieldMask=o||[]}return Object.defineProperty(t.prototype,"path",{get:function(){return this.settings.path}
1371,enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Dc",{get:function(){return this.settings.Dc},enumerable:!1,configurable:!0}),t.prototype.Cc=function(e){return new t(Object.assign(Object.assign({},this.settings),e),this.databaseId,this.R,this.ignoreUndefinedProperties,this.fieldTransforms,this.fieldMask)},t.prototype.Nc=function(t){var e,n=null===(e=this.path)||void 0===e?void 0:e.child(t),r=this.Cc({path:n,xc:!1});return r.Fc(t),r},t.prototype.kc=function(t){var e,n=null===(e=this.path)||void 0===e?void 0:e.child(t),r=this.Cc({path:n,xc:!1});return r.Sc(),r},t.prototype.Oc=function(t){return this.Cc({path:void 0,xc:!0})},t.prototype.$c=function(t){return Kf(t,this.settings.methodName,this.settings.Mc||!1,this.path,this.settings.Lc)},t.prototype.contains=function(t){return void 0!==this.fieldMask.find((function(e){return t.isPrefixOf(e)}))||void 0!==this.fieldTransforms.find((function(e){return t.isPrefixOf(e.field)}))},t.prototype.Sc=function(){if(this.path)for(var t=0;t<this.path.length;t++)this.Fc(this.path.get(t))},t.prototype.Fc=function(t){if(0===t.length)throw this.$c("Document fields must not be empty");if(Ef(this.Dc)&&wf.test(t))throw this.$c('Document fields cannot begin and end with "__"')},t}(),Sf=function(){function t(t,e,n){this.databaseId=t,this.ignoreUndefinedProperties=e,this.R=n||Fc(t)}return t.prototype.Bc=function(t,e,n,r){return void 0===r&&(r=!1),new Tf({Dc:t,methodName:e,Lc:n,path:ai.emptyPath(),xc:!1,Mc:r},this.databaseId,this.R,this.ignoreUndefinedProperties)},t}();function Af(t){var e=t._freezeSettings(),n=Fc(t._databaseId);return new Sf(t._databaseId,!!e.ignoreUndefinedProperties,n)}function kf(t,e,n,r,i,o){void 0===o&&(o={});var a=t.Bc(o.merge||o.mergeFields?2:0,e,n,i);Hf("Data must be an object, but it was:",a,r);var s,u,c=Ff(r,a);if(o.merge)s=new si(a.fieldMask),u=a.fieldTransforms;else if(o.mergeFields){for(var h=[],l=0,f=o.mergeFields;l<f.length;l++){var p=jf(e,f[l],n);if(!a.contains(p))throw new Ur(Mr.INVALID_ARGUMENT,"Field '"+p+"' is specified in your field mask but missing from your input data.");Gf(h,p)||h.push(p)}s=new si(h),u=a.fieldTransforms.filter((function(t){return s.covers(t.field)}))}else s=null,u=a.fieldTransforms;return new _f(new Pi(c),s,u)}var Nf=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Pr.C6)(e,t),e.prototype._toFieldTransform=function(t){if(2!==t.Dc)throw 1===t.Dc?t.$c(this._methodName+"() can only appear at the top level of your update data"):t.$c(this._methodName+"() cannot be used with set() unless you pass {merge:true}");return t.fieldMask.push(t.path),null},e.prototype.isEqual=function(t){return t instanceof e},e}(yf);function Cf(t,e,n){return new Tf({Dc:3,Lc:e.settings.Lc,methodName:t._methodName,xc:n},e.databaseId,e.R,e.ignoreUndefinedProperties)}var Rf=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Pr.C6)(e,t),e.prototype._toFieldTransform=function(t){return new xo(t.path,new ko)},e.prototype.isEqual=function(t){return t instanceof e},e}(yf),Of=function(t){function e(e,n){var r=this;return(r=t.call(this,e)||this).qc=n,r}return(0,Pr.C6)(e,t),e.prototype._toFieldTransform=function(t){var e=Cf(this,t,!0),n=this.qc.map((function(t){return Uf(t,e)})),r=new No(n);return new xo(t.path,r)},e.prototype.isEqual=function(t){return this===t},e}(yf),Df=function(t){function e(e,n){var r=this;return(r=t.call(this,e)||this).qc=n,r}return(0,Pr.C6)(e,t),e.prototype._toFieldTransform=function(t){var e=Cf(this,t,!0),n=this.qc.map((function(t){return Uf(t,e)})),r=new Ro(n);return new xo(t.path,r)},e.prototype.isEqual=function(t){return this===t},e}(yf),Pf=function(t){function e(e,n){var r=this;return(r=t.call(this,e)||this).Uc=n,r}return(0,Pr.C6)(e,t),e.prototype._toFieldTransform=function(t){var e=new Do(t.R,Io(t.R,this.Uc));return new xo(t.path,e)},e.prototype.isEqual=function(t){return this===t},e}(yf);function Lf(t,e,n,r){var o=t.Bc(1,e,n);Hf("Data must be an object, but it was:",o,r);var a=[],s=Pi.empty();ei(r,(function(t,r){var u=Bf(e,t,n);r=(0,i.Ku)(r);var c=o.kc(u);if(r instanceof Nf)a.push(u);else{var h=Uf(r,c);null!=h&&(a.push(u),s.set(u,h))}}));var u=new si(a);return new If(s,u,o.fieldTransforms)}function xf(t,e,n,r,o,a){var s=t.Bc(1,e,n),u=[jf(e,r,n)],c=[o];if(a.length%2!=0)throw new Ur(Mr.INVALID_ARGUMENT,"Function "+e+"() needs to be called with an even number of arguments that alternate between field names and values.");for(var h=0;h<a.length;h+=2)u.push(jf(e,a[h])),c.push(a[h+1]);for(var l=[],f=Pi.empty(),p=u.length-1;p>=0;--p)if(!Gf(l,u[p])){var d=u[p],v=c[p];v=(0,i.Ku)(v);var g=s.kc(d);if(v instanceof Nf)l.push(d);else{var m=Uf(v,g);null!=m&&(l.push(d),f.set(d,m))}}var y=new si(l);return new If(f,y,s.fieldTransforms)}function Mf(t,e,n,r){return void 0===r&&(r=!1),Uf(n,t.Bc(r?4:3,e))}function Uf(t,e){if(Vf(t=(0,i.Ku)(t)))return Hf("Unsupported field value:",e,t),Ff(t,e);if(t instanceof yf)return function(t,e){if(!Ef(e.Dc))throw e.$c(t._methodName+"() can only be used with update(
1371) and set()");if(!e.path)throw e.$c(t._methodName+"() is not currently supported inside arrays");var n=t._toFieldTransform(e);n&&e.fieldTransforms.push(n)}(t,e),null;if(void 0===t&&e.ignoreUndefinedProperties)return null;if(e.path&&e.fieldMask.push(e.path),t instanceof Array){if(e.settings.xc&&4!==e.Dc)throw e.$c("Nested arrays are not supported");return function(t,e){for(var n=[],r=0,i=0,o=t;i<o.length;i++){var a=Uf(o[i],e.Oc(r));null==a&&(a={nullValue:"NULL_VALUE"}),n.push(a),r++}return{arrayValue:{values:n}}}(t,e)}return function(t,e){if(null===(t=(0,i.Ku)(t)))return{nullValue:"NULL_VALUE"};if("number"==typeof t)return Io(e.R,t);if("boolean"==typeof t)return{booleanValue:t};if("string"==typeof t)return{stringValue:t};if(t instanceof Date){var n=$r.fromDate(t);return{timestampValue:Ra(e.R,n)}}if(t instanceof $r)return n=new $r(t.seconds,1e3*Math.floor(t.nanoseconds/1e3)),{timestampValue:Ra(e.R,n)};if(t instanceof bf)return{geoPointValue:{latitude:t.latitude,longitude:t.longitude}};if(t instanceof mf)return{bytesValue:Oa(e.R,t._byteString)};if(t instanceof tf){n=e.databaseId;var r=t.firestore._databaseId;if(!r.isEqual(n))throw e.$c("Document reference is for database "+r.projectId+"/"+r.database+" but should be for database "+n.projectId+"/"+n.database);return{referenceValue:La(t.firestore._databaseId||e.databaseId,t._key.path)}}throw e.$c("Unsupported field value: "+Xl(t))}(t,e)}function Ff(t,e){var n={};return ni(t)?e.path&&e.path.length>0&&e.fieldMask.push(e.path):ei(t,(function(t,r){var i=Uf(r,e.Nc(t));null!=i&&(n[t]=i)})),{mapValue:{fields:n}}}function Vf(t){return!("object"!=typeof t||null===t||t instanceof Array||t instanceof Date||t instanceof $r||t instanceof bf||t instanceof mf||t instanceof tf||t instanceof yf)}function Hf(t,e,n){if(!Vf(n)||!function(t){return"object"==typeof t&&null!==t&&(Object.getPrototypeOf(t)===Object.prototype||null===Object.getPrototypeOf(t))}(n)){var r=Xl(n);throw"an object"===r?e.$c(t+" a custom object"):e.$c(t+" "+r)}}function jf(t,e,n){if((e=(0,i.Ku)(e))instanceof gf)return e._internalPath;if("string"==typeof e)return Bf(t,e);throw Kf("Field path arguments must be of type string or FieldPath.",t,!1,void 0,n)}var qf=new RegExp("[~\\*/\\[\\]]");function Bf(t,e,n){if(e.search(qf)>=0)throw Kf("Invalid field path ("+e+"). Paths must not contain '~', '*', '/', '[', or ']'",t,!1,void 0,n);try{return(new(gf.bind.apply(gf,(0,Pr.fX)([void 0],e.split(".")))))._internalPath}catch(T){throw Kf("Invalid field path ("+e+"). Paths must not be empty, begin with '.', end with '.', or contain '..'",t,!1,void 0,n)}}function Kf(t,e,n,r,i){var o=r&&!r.isEmpty(),a=void 0!==i,s="Function "+e+"() called with invalid data";n&&(s+=" (via `toFirestore()`)");var u="";return(o||a)&&(u+=" (found",o&&(u+=" in field "+r),a&&(u+=" in document "+i),u+=")"),new Ur(Mr.INVALID_ARGUMENT,(s+=". ")+t+u)}function Gf(t,e){return t.some((function(t){return t.isEqual(e)}))} 1372/** 1373 * @license 1374 * Copyright 2020 Google LLC 1375 * 1376 * Licensed under the Apache License, Version 2.0 (the "License"); 1377 * you may not use this file except in compliance with the License. 1378 * You may obtain a copy of the License at 1379 * 1380 * http://www.apache.org/licenses/LICENSE-2.0 1381 * 1382 * Unless required by applicable law or agreed to in writing, software 1383 * distributed under the License is distributed on an "AS IS" BASIS, 1384 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1385 * See the License for the specific language governing permissions and 1386 * limitations under the License. 1387 */var Yf=function(){function t(t,e,n,r,i){this._firestore=t,this._userDataWriter=e,this._key=n,this._document=r,this._converter=i}return Object.defineProperty(t.prototype,"id",{get:function(){return this._key.path.lastSegment()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ref",{get:function(){return new tf(this._firestore,this._converter,this._key)},enumerable:!1,configurable:!0}),t.prototype.exists=function(){return null!==this._document},t.prototype.data=function(){if(this._document){if(this._converter){var t=new zf(this._firestore,this._userDataWriter,this._key,this._document,null);return this._converter.fromFirestore(t)}return this._userDataWriter.convertValue(this._document.data.toProto())}},t.prototype.get=function(t){if(this._document){var e=this._document.data.field(Wf("DocumentSnapshot.get",t));if(null!==e)return this._userDataWriter.convertValue(e)}},t}(),zf=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Pr.C6)(e,t),e.prototype.data=function(){return t.prototype.data.call(this)},e}(Yf);function Wf(t,e){return"string"==typeof e?Bf(t,e):e instanceof gf?e._internalPath:e._delegate._internalPath} 1388/** 1389 * @license 1390 * Copyright 2020 Google LLC 1391 * 1392 * Licensed under the Apache License, Version 2.0 (the "License");
1393 * you may not use this file except in compliance with the License. 1394 * You may obtain a copy of the License at 1395 * 1396 * http://www.apache.org/licenses/LICENSE-2.0 1397 * 1398 * Unless required by applicable law or agreed to in writing, software 1399 * distributed under the License is distributed on an "AS IS" BASIS, 1400 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1401 * See the License for the specific language governing permissions and 1402 * limitations under the License. 1403 */var Xf=function(){function t(t,e){this.hasPendingWrites=t,this.fromCache=e}return t.prototype.isEqual=function(t){return this.hasPendingWrites===t.hasPendingWrites&&this.fromCache===t.fromCache},t}(),Qf=function(t){function e(e,n,r,i,o,a){var s=this;return(s=t.call(this,e,n,r,i,a)||this)._firestore=e,s._firestoreImpl=e,s.metadata=o,s}return(0,Pr.C6)(e,t),e.prototype.exists=function(){return t.prototype.exists.call(this)},e.prototype.data=function(t){if(void 0===t&&(t={}),this._document){if(this._converter){var e=new Jf(this._firestore,this._userDataWriter,this._key,this._document,this.metadata,null);return this._converter.fromFirestore(e,t)}return this._userDataWriter.convertValue(this._document.data.toProto(),t.serverTimestamps)}},e.prototype.get=function(t,e){if(void 0===e&&(e={}),this._document){var n=this._document.data.field(Wf("DocumentSnapshot.get",t));if(null!==n)return this._userDataWriter.convertValue(n,e.serverTimestamps)}},e}(Yf),Jf=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Pr.C6)(e,t),e.prototype.data=function(e){return void 0===e&&(e={}),t.prototype.data.call(this,e)},e}(Qf),$f=function(){function t(t,e,n,r){this._firestore=t,this._userDataWriter=e,this._snapshot=r,this.metadata=new Xf(r.hasPendingWrites,r.fromCache),this.query=n}return Object.defineProperty(t.prototype,"docs",{get:function(){var t=[];return this.forEach((function(e){return t.push(e)})),t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return this._snapshot.docs.size},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"empty",{get:function(){return 0===this.size},enumerable:!1,configurable:!0}),t.prototype.forEach=function(t,e){var n=this;this._snapshot.docs.forEach((function(r){t.call(e,new Jf(n._firestore,n._userDataWriter,r.key,r,new Xf(n._snapshot.mutatedKeys.has(r.key),n._snapshot.fromCache),n.query.converter))}))},t.prototype.docChanges=function(t){void 0===t&&(t={});var e=!!t.includeMetadataChanges;if(e&&this._snapshot.excludesMetadataChanges)throw new Ur(Mr.INVALID_ARGUMENT,"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");return this._cachedChanges&&this._cachedChangesIncludeMetadataChanges===e||(this._cachedChanges=function(t,e){if(t._snapshot.oldDocs.isEmpty()){var n=0;return t._snapshot.docChanges.map((function(e){var r=new Jf(t._firestore,t._userDataWriter,e.doc.key,e.doc,new Xf(t._snapshot.mutatedKeys.has(e.doc.key),t._snapshot.fromCache),t.query.converter);return e.doc,{type:"added",doc:r,oldIndex:-1,newIndex:n++}}))}var r=t._snapshot.oldDocs;return t._snapshot.docChanges.filter((function(t){return e||3!==t.type})).map((function(e){var n=new Jf(t._firestore,t._userDataWriter,e.doc.key,e.doc,new Xf(t._snapshot.mutatedKeys.has(e.doc.key),t._snapshot.fromCache),t.query.converter),i=-1,o=-1;return 0!==e.type&&(i=r.indexOf(e.doc.key),r=r.delete(e.doc.key)),1!==e.type&&(o=(r=r.add(e.doc)).indexOf(e.doc.key)),{type:Zf(e.type),doc:n,oldIndex:i,newIndex:o}}))}(this,e),this._cachedChangesIncludeMetadataChanges=e),this._cachedChanges},t}();function Zf(t){switch(t){case 0:return"added";case 2:case 3:return"modified";case 1:return"removed";default:return Kr()}}function tp(t,e){return t instanceof Qf&&e instanceof Qf?t._firestore===e._firestore&&t._key.isEqual(e._key)&&(null===t._document?null===e._document:t._document.isEqual(e._document))&&t._converter===e._converter:t instanceof $f&&e instanceof $f&&t._firestore===e._firestore&&sf(t.query,e.query)&&t.metadata.isEqual(e.metadata)&&t._snapshot.isEqual(e._snapshot)} 1404/** 1405 * @license 1406 * Copyright 2020 Google LLC 1407 * 1408 * Licensed under the Apache License, Version 2.0 (the "License");
1409 * you may not use this file except in compliance with the License. 1410 * You may obtain a copy of the License at 1411 * 1412 * http://www.apache.org/licenses/LICENSE-2.0 1413 * 1414 * Unless required by applicable law or agreed to in writing, software 1415 * distributed under the License is distributed on an "AS IS" BASIS, 1416 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1417 * See the License for the specific language governing permissions and 1418 * limitations under the License. 1419 */function ep(t){if(ao(t)&&0===t.explicitOrderBy.length)throw new Ur(Mr.UNIMPLEMENTED,"limitToLast() queries require specifying at least one orderBy() clause")}var np=function(){};function rp(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0,i=e;r<i.length;r++){var o=i[r];t=o._apply(t)}return t}var ip=function(t){function e(e,n,r){var i=this;return(i=t.call(this)||this).Qc=e,i.Kc=n,i.jc=r,i.type="where",i}return(0,Pr.C6)(e,t),e.prototype._apply=function(t){var e=Af(t.firestore),n=function(t,e,n,r,i,o,a){var s;if(i.isKeyField()){if("array-contains"===o||"array-contains-any"===o)throw new Ur(Mr.INVALID_ARGUMENT,"Invalid Query. You can't perform '"+o+"' queries on FieldPath.documentId().");if("in"===o||"not-in"===o){lp(a,o);for(var u=[],c=0,h=a;c<h.length;c++){var l=h[c];u.push(hp(r,t,l))}s={arrayValue:{values:u}}}else s=hp(r,t,a)}else"in"!==o&&"not-in"!==o&&"array-contains-any"!==o||lp(a,o),s=Mf(n,"where",a,"in"===o||"not-in"===o);var f=ji.create(i,o,s);return function(t,e){if(e.g()){var n=uo(t);if(null!==n&&!n.isEqual(e.field))throw new Ur(Mr.INVALID_ARGUMENT,"Invalid query. All where filters with an inequality (<, <=, !=, not-in, >, or >=) must be on the same field. But you have inequality filters on '"+n.toString()+"' and '"+e.field.toString()+"'");var r=so(t);null!==r&&fp(t,e.field,r)}var i=function(t,e){for(var n=0,r=t.filters;n<r.length;n++){var i=r[n];if(e.indexOf(i.op)>=0)return i.op}return null}(t,function(t){switch(t){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[]}}(e.op));if(null!==i)throw i===e.op?new Ur(Mr.INVALID_ARGUMENT,"Invalid query. You cannot use more than one '"+e.op.toString()+"' filter."):new Ur(Mr.INVALID_ARGUMENT,"Invalid query. You cannot use '"+e.op.toString()+"' filters with '"+i.toString()+"' filters.")}(t,f),f}(t._query,0,e,t.firestore._databaseId,this.Qc,this.Kc,this.jc);return new ef(t.firestore,t.converter,function(t,e){var n=t.filters.concat([e]);return new no(t.path,t.collectionGroup,t.explicitOrderBy.slice(),n,t.limit,t.limitType,t.startAt,t.endAt)}(t._query,n))},e}(np),op=function(t){function e(e,n){var r=this;return(r=t.call(this)||this).Qc=e,r.Wc=n,r.type="orderBy",r}return(0,Pr.C6)(e,t),e.prototype._apply=function(t){var e=function(t,e,n){if(null!==t.startAt)throw new Ur(Mr.INVALID_ARGUMENT,"Invalid query. You must not call startAt() or startAfter() before calling orderBy().");if(null!==t.endAt)throw new Ur(Mr.INVALID_ARGUMENT,"Invalid query. You must not call endAt() or endBefore() before calling orderBy().");var r=new $i(e,n);return function(t,e){if(null===so(t)){var n=uo(t);null!==n&&fp(t,n,e.field)}}(t,r),r}(t._query,this.Qc,this.Wc);return new ef(t.firestore,t.converter,function(t,e){var n=t.explicitOrderBy.concat([e]);return new no(t.path,t.collectionGroup,n,t.filters.slice(),t.limit,t.limitType,t.startAt,t.endAt)}(t._query,e))},e}(np),ap=function(t){function e(e,n,r){var i=this;return(i=t.call(this)||this).type=e,i.Gc=n,i.zc=r,i}return(0,Pr.C6)(e,t),e.prototype._apply=function(t){return new ef(t.firestore,t.converter,fo(t._query,this.Gc,this.zc))},e}(np),sp=function(t){function e(e,n,r){var i=this;return(i=t.call(this)||this).type=e,i.Hc=n,i.Jc=r,i}return(0,Pr.C6)(e,t),e.prototype._apply=function(t){var e=cp(t,this.type,this.Hc,this.Jc);return new ef(t.firestore,t.converter,function(t,e){return new no(t.path,t.collectionGroup,t.explicitOrderBy.slice(),t.filters.slice(),t.limit,t.limitType,e,t.endAt)}(t._query,e))},e}(np),up=function(t){function e(e,n,r){var i=this;return(i=t.call(this)||this).type=e,i.Hc=n,i.Jc=r,i}return(0,Pr.C6)(e,t),e.prototype._apply=function(t){var e=cp(t,this.type,this.Hc,this.Jc);return new ef(t.firestore,t.converter,function(t,e){return new no(t.path,t.collectionGroup,t.explicitOrderBy.slice(),t.filters.slice(),t.limit,t.limitType,t.startAt,e)}(t._query,e))},e}(np);function cp(t,e,n,r){if(n[0]=(0,i.Ku)(n[0]),n[0]instanceof Yf)return function(t,e,n,r,i){if(!r)throw new Ur(Mr.NOT_FOUND,"Can't use a DocumentSnapshot that doesn't exist for "+n+"().");for(var o=[],a=0,s=ho(t);a<s.length;a++){var u=s[a];if(u.field.isKeyField())o.push(ki(e,r.key));else{var c=r.data.field(u.field);if(pi(c))throw new Ur(Mr.INVALID_ARGUMENT,'Invalid query. You are trying to start or end a query using a document for which the field "'+u.field+'" is an uncommitted server timestamp. (Since the value of this field is unknown, you cannot start/end a query with it.)');if(null===c){var h=u.field.canonicalString();throw new Ur(Mr.INVALID_ARGUMENT,"Invalid query. You are trying to start or end a query using a document for which the field '"+h+"' (used as the orderBy) does not exist.")}o.push(c)}}return new Qi(o,i)}(t._query,t.firestore._databaseId,e,n[0]._document,r);var o=Af(t.firestore);return function(t,e,n,r,i,o){var a=t.explicitOrderBy;if(i.length>a.length)throw new Ur(Mr.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=[],u=0;u<i.length;u++){var c=i[u];
1419if(a[u].field.isKeyField()){if("string"!=typeof c)throw new Ur(Mr.INVALID_ARGUMENT,"Invalid query. Expected a string for document ID in "+r+"(), but got a "+typeof c);if(!co(t)&&-1!==c.indexOf("/"))throw new Ur(Mr.INVALID_ARGUMENT,"Invalid query. When querying a collection and ordering by FieldPath.documentId(), the value passed to "+r+"() must be a plain document ID, but '"+c+"' contains a slash.");var h=t.path.child(ii.fromString(c));if(!bi.isDocumentKey(h))throw new Ur(Mr.INVALID_ARGUMENT,"Invalid query. When querying a collection group and ordering by FieldPath.documentId(), the value passed to "+r+"() must result in a valid document path, but '"+h+"' is not because it contains an odd number of segments.");var l=new bi(h);s.push(ki(e,l))}else{var f=Mf(n,r,c);s.push(f)}}return new Qi(s,o)}(t._query,t.firestore._databaseId,o,e,n,r)}function hp(t,e,n){if("string"==typeof(n=(0,i.Ku)(n))){if(""===n)throw new Ur(Mr.INVALID_ARGUMENT,"Invalid query. When querying with FieldPath.documentId(), you must provide a valid document ID, but it was an empty string.");if(!co(e)&&-1!==n.indexOf("/"))throw new Ur(Mr.INVALID_ARGUMENT,"Invalid query. When querying a collection by FieldPath.documentId(), you must provide a plain document ID, but '"+n+"' contains a '/' character.");var r=e.path.child(ii.fromString(n));if(!bi.isDocumentKey(r))throw new Ur(Mr.INVALID_ARGUMENT,"Invalid query. When querying a collection group by FieldPath.documentId(), the value provided must result in a valid document path, but '"+r+"' is not because it has an odd number of segments ("+r.length+").");return ki(t,new bi(r))}if(n instanceof tf)return ki(t,n._key);throw new Ur(Mr.INVALID_ARGUMENT,"Invalid query. When querying with FieldPath.documentId(), you must provide a valid string or a DocumentReference, but it was: "+Xl(n)+".")}function lp(t,e){if(!Array.isArray(t)||0===t.length)throw new Ur(Mr.INVALID_ARGUMENT,"Invalid Query. A non-empty array is required for '"+e.toString()+"' filters.");if(t.length>10)throw new Ur(Mr.INVALID_ARGUMENT,"Invalid Query. '"+e.toString()+"' filters support a maximum of 10 elements in the value array.")}function fp(t,e,n){if(!n.isEqual(e))throw new Ur(Mr.INVALID_ARGUMENT,"Invalid query. You have a where filter with an inequality (<, <=, !=, not-in, >, or >=) on field '"+e.toString()+"' and so you must also use '"+e.toString()+"' as your first argument to orderBy(), but your first orderBy() is on field '"+n.toString()+"' instead.")} 1420/** 1421 * @license 1422 * Copyright 2020 Google LLC 1423 * 1424 * Licensed under the Apache License, Version 2.0 (the "License"); 1425 * you may not use this file except in compliance with the License. 1426 * You may obtain a copy of the License at 1427 * 1428 * http://www.apache.org/licenses/LICENSE-2.0 1429 * 1430 * Unless required by applicable law or agreed to in writing, software 1431 * distributed under the License is distributed on an "AS IS" BASIS, 1432 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1433 * See the License for the specific language governing permissions and 1434 * limitations under the License. 1435 */var pp=function(){function t(){}return t.prototype.convertValue=function(t,e){switch(void 0===e&&(e="none"),wi(t)){case 0:return null;case 1:return t.booleanValue;case 2:return li(t.integerValue||t.doubleValue);case 3:return this.convertTimestamp(t.timestampValue);case 4:return this.convertServerTimestamp(t,e);case 5:return t.stringValue;case 6:return this.convertBytes(fi(t.bytesValue));case 7:return this.convertReference(t.referenceValue);case 8:return this.convertGeoPoint(t.geoPointValue);case 9:return this.convertArray(t.arrayValue,e);case 10:return this.convertObject(t.mapValue,e);default:throw Kr()}},t.prototype.convertObject=function(t,e){var n=this,r={};return ei(t.fields||{},(function(t,i){r[t]=n.convertValue(i,e)})),r},t.prototype.convertGeoPoint=function(t){return new bf(li(t.latitude),li(t.longitude))},t.prototype.convertArray=function(t,e){var n=this;return(t.values||[]).map((function(t){return n.convertValue(t,e)}))},t.prototype.convertServerTimestamp=function(t,e){switch(e){case"previous":var n=di(t);return null==n?null:this.convertValue(n,e);case"estimate":return this.convertTimestamp(vi(t));default:return null}},t.prototype.convertTimestamp=function(t){var e=hi(t);return new $r(e.seconds,e.nanos)},t.prototype.convertDocumentKey=function(t,e){var n=ii.fromString(t);Gr(os(n));var r=new Ml(n.get(1),n.get(3)),i=new bi(n.popFirst(5));return r.isEqual(e)||jr("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 ("+e.projectId+"/"+e.database+") instead."),i},t}(); 1436/** 1437 * @license 1438 * Copyright 2020 Google LLC 1439 * 1440 * Licensed under the Apache License, Version 2.0 (the "License");
1441 * you may not use this file except in compliance with the License. 1442 * You may obtain a copy of the License at 1443 * 1444 * http://www.apache.org/licenses/LICENSE-2.0 1445 * 1446 * Unless required by applicable law or agreed to in writing, software 1447 * distributed under the License is distributed on an "AS IS" BASIS, 1448 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1449 * See the License for the specific language governing permissions and 1450 * limitations under the License. 1451 */function dp(t,e,n){return t?n&&(n.merge||n.mergeFields)?t.toFirestore(e,n):t.toFirestore(e):e}var vp=function(t){function e(e){var n=this;return(n=t.call(this)||this).firestore=e,n}return(0,Pr.C6)(e,t),e.prototype.convertBytes=function(t){return new mf(t)},e.prototype.convertReference=function(t){var e=this.convertDocumentKey(t,this.firestore._databaseId);return new tf(this.firestore,null,e)},e}(pp),gp=function(){function t(t,e){this._firestore=t,this._commitHandler=e,this._mutations=[],this._committed=!1,this._dataReader=Af(t)}return t.prototype.set=function(t,e,n){this._verifyNotCommitted();var r=mp(t,this._firestore),i=dp(r.converter,e,n),o=kf(this._dataReader,"WriteBatch.set",r._key,i,null!==r.converter,n);return this._mutations.push(o.toMutation(r._key,Uo.none())),this},t.prototype.update=function(t,e,n){for(var r=[],o=3;o<arguments.length;o++)r[o-3]=arguments[o];this._verifyNotCommitted();var a,s=mp(t,this._firestore);return a="string"==typeof(e=(0,i.Ku)(e))||e instanceof gf?xf(this._dataReader,"WriteBatch.update",s._key,e,n,r):Lf(this._dataReader,"WriteBatch.update",s._key,e),this._mutations.push(a.toMutation(s._key,Uo.exists(!0))),this},t.prototype.delete=function(t){this._verifyNotCommitted();var e=mp(t,this._firestore);return this._mutations=this._mutations.concat(new $o(e._key,Uo.none())),this},t.prototype.commit=function(){return this._verifyNotCommitted(),this._committed=!0,this._mutations.length>0?this._commitHandler(this._mutations):Promise.resolve()},t.prototype._verifyNotCommitted=function(){if(this._committed)throw new Ur(Mr.FAILED_PRECONDITION,"A write batch can no longer be used after commit() has been called.")},t}(); 1452/** 1453 * @license 1454 * Copyright 2020 Google LLC 1455 * 1456 * Licensed under the Apache License, Version 2.0 (the "License"); 1457 * you may not use this file except in compliance with the License. 1458 * You may obtain a copy of the License at 1459 * 1460 * http://www.apache.org/licenses/LICENSE-2.0 1461 * 1462 * Unless required by applicable law or agreed to in writing, software 1463 * distributed under the License is distributed on an "AS IS" BASIS, 1464 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1465 * See the License for the specific language governing permissions and 1466 * limitations under the License. 1467 */function mp(t,e){if((t=(0,i.Ku)(t)).firestore!==e)throw new Ur(Mr.INVALID_ARGUMENT,"Provided document reference is from a different Firestore instance.");return t} 1468/** 1469 * @license 1470 * Copyright 2020 Google LLC 1471 * 1472 * Licensed under the Apache License, Version 2.0 (the "License"); 1473 * you may not use this file except in compliance with the License. 1474 * You may obtain a copy of the License at 1475 * 1476 * http://www.apache.org/licenses/LICENSE-2.0 1477 * 1478 * Unless required by applicable law or agreed to in writing, software 1479 * distributed under the License is distributed on an "AS IS" BASIS, 1480 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1481 * See the License for the specific language governing permissions and 1482 * limitations under the License. 1483 */var yp=function(t){function e(e){var n=this;return(n=t.call(this)||this).firestore=e,n}return(0,Pr.C6)(e,t),e.prototype.convertBytes=function(t){return new mf(t)},e.prototype.convertReference=function(t){var e=this.convertDocumentKey(t,this.firestore._databaseId);return new tf(this.firestore,null,e)},e}(pp);function bp(t,e,n){for(var r=[],o=3;o<arguments.length;o++)r[o-3]=arguments[o];t=Ql(t,tf);var a=Ql(t.firestore,lf),s=Af(a);return _p(a,[("string"==typeof(e=(0,i.Ku)(e))||e instanceof gf?xf(s,"updateDoc",t._key,e,n,r):Lf(s,"updateDoc",t._key,e)).toMutation(t._key,Uo.exists(!0))])}function wp(t){for(var e,n,r,o=[],a=1;a<arguments.length;a++)o[a-1]=arguments[a];t=(0,i.Ku)(t);var s={includeMetadataChanges:!1},u=0;"object"!=typeof o[u]||cf(o[u])||(s=o[u],u++);var c,h,l,f={includeMetadataChanges:s.includeMetadataChanges};if(cf(o[u])){var p=o[u];
1483o[u]=null===(e=p.next)||void 0===e?void 0:e.bind(p),o[u+1]=null===(n=p.error)||void 0===n?void 0:n.bind(p),o[u+2]=null===(r=p.complete)||void 0===r?void 0:r.bind(p)}if(t instanceof tf)h=Ql(t.firestore,lf),l=io(t._key.path),c={next:function(e){o[u]&&o[u](Ip(h,t,e))},error:o[u+1],complete:o[u+2]};else{var d=Ql(t,ef);h=Ql(d.firestore,lf),l=d._query;var v=new yp(h);c={next:function(t){o[u]&&o[u](new $f(h,v,d,t))},error:o[u+1],complete:o[u+2]},ep(t._query)}return function(t,e,n,r){var i=this,o=new wl(r),a=new Ch(e,o,n);return t.asyncQueue.enqueueAndForget((function(){return(0,Pr.sH)(i,void 0,void 0,(function(){var e;return(0,Pr.YH)(this,(function(n){switch(n.label){case 0:return e=Th,[4,Dl(t)];case 1:return[2,e.apply(void 0,[n.sent(),a])]}}))}))})),function(){o.Wo(),t.asyncQueue.enqueueAndForget((function(){return(0,Pr.sH)(i,void 0,void 0,(function(){var e;return(0,Pr.YH)(this,(function(n){switch(n.label){case 0:return e=Sh,[4,Dl(t)];case 1:return[2,e.apply(void 0,[n.sent(),a])]}}))}))}))}}(ff(h),l,f,c)}function _p(t,e){return function(t,e){var n=this,r=new Cs;return t.asyncQueue.enqueueAndForget((function(){return(0,Pr.sH)(n,void 0,void 0,(function(){var n;return(0,Pr.YH)(this,(function(i){switch(i.label){case 0:return n=qh,[4,Ol(t)];case 1:return[2,n.apply(void 0,[i.sent(),e,r])]}}))}))})),r.promise}(ff(t),e)}function Ip(t,e,n){var r=n.docs.get(e._key),i=new yp(t);return new Qf(t,i,e._key,r,new Xf(n.hasPendingWrites,n.fromCache),e.converter)} 1484/** 1485 * @license 1486 * Copyright 2020 Google LLC 1487 * 1488 * Licensed under the Apache License, Version 2.0 (the "License"); 1489 * you may not use this file except in compliance with the License. 1490 * You may obtain a copy of the License at 1491 * 1492 * http://www.apache.org/licenses/LICENSE-2.0 1493 * 1494 * Unless required by applicable law or agreed to in writing, software 1495 * distributed under the License is distributed on an "AS IS" BASIS, 1496 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1497 * See the License for the specific language governing permissions and 1498 * limitations under the License. 1499 */var Ep=function(t){function e(e,n){var r=this;return(r=t.call(this,e,n)||this)._firestore=e,r}return(0,Pr.C6)(e,t),e.prototype.get=function(e){var n=this,r=mp(e,this._firestore),i=new yp(this._firestore);return t.prototype.get.call(this,e).then((function(t){return new Qf(n._firestore,i,r._key,t._document,new Xf(!1,!1),r.converter)}))},e}(function(){function t(t,e){this._firestore=t,this._transaction=e,this._dataReader=Af(t)}return t.prototype.get=function(t){var e=this,n=mp(t,this._firestore),r=new vp(this._firestore);return this._transaction.lookup([n._key]).then((function(t){if(!t||1!==t.length)return Kr();var i=t[0];if(i.isFoundDocument())return new Yf(e._firestore,r,i.key,i,n.converter);if(i.isNoDocument())return new Yf(e._firestore,r,n._key,null,n.converter);throw Kr()}))},t.prototype.set=function(t,e,n){var r=mp(t,this._firestore),i=dp(r.converter,e,n),o=kf(this._dataReader,"Transaction.set",r._key,i,null!==r.converter,n);return this._transaction.set(r._key,o),this},t.prototype.update=function(t,e,n){for(var r=[],o=3;o<arguments.length;o++)r[o-3]=arguments[o];var a,s=mp(t,this._firestore);return a="string"==typeof(e=(0,i.Ku)(e))||e instanceof gf?xf(this._dataReader,"Transaction.update",s._key,e,n,r):Lf(this._dataReader,"Transaction.update",s._key,e),this._transaction.update(s._key,a),this},t.prototype.delete=function(t){var e=mp(t,this._firestore);return this._transaction.delete(e._key),this},t}()); 1500/** 1501 * @license 1502 * Copyright 2017 Google LLC 1503 * 1504 * Licensed under the Apache License, Version 2.0 (the "License"); 1505 * you may not use this file except in compliance with the License. 1506 * You may obtain a copy of the License at 1507 * 1508 * http://www.apache.org/licenses/LICENSE-2.0 1509 * 1510 * Unless required by applicable law or agreed to in writing, software 1511 * distributed under the License is distributed on an "AS IS" BASIS, 1512 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1513 * See the License for the specific language governing permissions and 1514 * limitations under the License. 1515 */function Tp(){if("undefined"==typeof Uint8Array)throw new Ur(Mr.UNIMPLEMENT
1515ED,"Uint8Arrays are not available in this environment.")}function Sp(){if("undefined"==typeof atob)throw new Ur(Mr.UNIMPLEMENTED,"Blobs are unavailable in Firestore in this environment.")}var Ap=function(){function t(t){this._delegate=t}return t.fromBase64String=function(e){return Sp(),new t(mf.fromBase64String(e))},t.fromUint8Array=function(e){return Tp(),new t(mf.fromUint8Array(e))},t.prototype.toBase64=function(){return Sp(),this._delegate.toBase64()},t.prototype.toUint8Array=function(){return Tp(),this._delegate.toUint8Array()},t.prototype.isEqual=function(t){return this._delegate.isEqual(t._delegate)},t.prototype.toString=function(){return"Blob(base64: "+this.toBase64()+")"},t}(),kp=function(){function t(){}return t.prototype.enableIndexedDbPersistence=function(t,e){return function(t,e){vf(t=Ql(t,lf));var n=ff(t),r=t._freezeSettings(),i=new bl;return df(n,i,new ml(i,r.cacheSizeBytes,null==e?void 0:e.forceOwnership))}(t._delegate,{forceOwnership:e})},t.prototype.enableMultiTabIndexedDbPersistence=function(t){return function(t){vf(t=Ql(t,lf));var e=ff(t),n=t._freezeSettings(),r=new bl;return df(e,r,new yl(r,n.cacheSizeBytes))}(t._delegate)},t.prototype.clearIndexedDbPersistence=function(t){return function(t){var e=this;if(t._initialized&&!t._terminated)throw new Ur(Mr.FAILED_PRECONDITION,"Persistence can only be cleared before a Firestore instance is initialized or after it is terminated.");var n=new Cs;return t._queue.enqueueAndForgetEvenWhileRestricted((function(){return(0,Pr.sH)(e,void 0,void 0,(function(){var e;return(0,Pr.YH)(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,function(t){return(0,Pr.sH)(this,void 0,void 0,(function(){var e;return(0,Pr.YH)(this,(function(n){switch(n.label){case 0:return Ds.yt()?(e=t+"main",[4,Ds.delete(e)]):[2,Promise.resolve()];case 1:return n.sent(),[2]}}))}))}(Bu(t._databaseId,t._persistenceKey))];case 1:return r.sent(),n.resolve(),[3,3];case 2:return e=r.sent(),n.reject(e),[3,3];case 3:return[2]}}
1515))}))})),n.promise}(t._delegate)},t}(),Np=function(){function t(t,e,n){var r=this;this._delegate=e,this.Yc=n,this.INTERNAL={delete:function(){return r.terminate()}},t instanceof Ml||(this.Xc=t)}return Object.defineProperty(t.prototype,"_databaseId",{get:function(){return this._delegate._databaseId},enumerable:!1,configurable:!0}),t.prototype.settings=function(t){t.merge&&delete(t=Object.assign(Object.assign({},this._delegate._getSettings()),t)).merge,this._delegate._setSettings(t)},t.prototype.useEmulator=function(t,e,n){void 0===n&&(n={}),function(t,e,n,r){void 0===r&&(r={});var o=(t=Ql(t,Zl))._getSettings();if("firestore.googleapis.com"!==o.host&&o.host!==e&&qr("Host has been set in both settings() and useEmulator(), emulator host will be used"),t._setSettings(Object.assign(Object.assign({},o),{host:e+":"+n,ssl:!1})),r.mockUserToken){var a=(0,i.Fy)(r.mockUserToken),s=r.mockUserToken.sub||r.mockUserToken.user_id;if(!s)throw new Ur(Mr.INVALID_ARGUMENT,"mockUserToken must contain 'sub' or 'user_id' field!");t._credentials=new Hl(new Fl(a,new wc(s)))}}(this._delegate,t,e,n)},t.prototype.enableNetwork=function(){return function(t){var e=this;return t.asyncQueue.enqueue((function(){return(0,Pr.sH)(e,void 0,void 0,(function(){var e,n;return(0,Pr.YH)(this,(function(r){switch(r.label){case 0:return[4,Nl(t)];case 1:return e=r.sent(),[4,Rl(t)];case 2:return n=r.sent(),[2,(e.setNetworkEnabled(!0),function(t){var e=Yr(t);return e.$r.delete(0),Yc(e)}(n))]}}))}))}))}(ff(Ql(this._delegate,lf)))},t.prototype.disableNetwork=function(){return function(t){var e=this;return t.asyncQueue.enqueue((function(){return(0,Pr.sH)(e,void 0,void 0,(function(){var e,n;return(0,Pr.YH)(this,(function(r){switch(r.label){case 0:return[4,Nl(t)];case 1:return e=r.sent(),[4,Rl(t)];case 2:return n=r.sent(),[2,(e.setNetworkEnabled(!1),function(t){return(0,Pr.sH)(this,void 0,void 0,(function(){var e;return(0,Pr.YH)(this,(function(n){switch(n.label){case 0:return(e=Yr(t)).$r.add(0),[4,zc(e)];case 1:return n.sent(),e.Br.set("Offline"),[2]}}))}))}(n))]}}))}))}))}(ff(Ql(this._delegate,lf)))},t.prototype.enablePersistence=function(t){var e=!1,n=!1;return t&&Yl("synchronizeTabs",e=!!t.synchronizeTabs,"experimentalForceOwningTab",n=!!t.experimentalForceOwningTab),e?this.Yc.enableMultiTabIndexedDbPersistence(this):this.Yc.enableIndexedDbPersistence(this,n)},t.prototype.clearPersistence=function(){return this.Yc.clearIndexedDbPersistence(this)},t.prototype.terminate=function(){return this.Xc&&(this.Xc._removeServiceInstance("firestore"),this.Xc._removeServiceInstance("firestore-exp")),this._delegate._delete()},t.prototype.waitForPendingWrites=function(){return function(t){var e=this,n=new Cs;return t.asyncQueue.enqueueAndForget((function(){return(0,Pr.sH)(e,void 0,void 0,(function(){var e;return(0,Pr.YH)(this,(function(r){switch(r.label){case 0:return e=Wh,[4,Ol(t)];case 1:return[2,e.apply(void 0,[r.sent(),n])]}}))}))})),n.promise}(ff(Ql(this._delegate,lf)))},t.prototype.onSnapshotsInSync=function(t){return function(t,e){return function(t,e){var n=this,r=new wl(e);return t.asyncQueue.enqueueAndForget((function(){return(0,Pr.sH)(n,void 0,void 0,(function(){var e;return(0,Pr.YH)(this,(function(n){switch(n.label){case 0:return e=function(t,e){Yr(t).Gr.add(e),e.next()},[4,Dl(t)];case 1:return[2,e.apply(void 0,[n.sent(),r])]}}))}))})),function(){r.Wo(),t.asyncQueue.enqueueAndForget((function(){return(0,Pr.sH)(n,void 0,void 0,(function(){var e;return(0,Pr.YH)(this,(function(n){switch(n.label){case 0:return e=function(t,e){Yr(t).Gr.delete(e)},[4,Dl(t)];case 1:return[2,e.apply(void 0,[n.sent(),r])]}}))}))}))}}(ff(t=Ql(t,lf)),cf(e)?e:{next:e})}(this._delegate,t)},Object.defineProperty(t.prototype,"app",{get:function(){if(!this.Xc)throw new Ur(Mr.FAILED_PRECONDITION,"Firestore was not initialized using the Firebase SDK. 'app' is not available");return this.Xc},enumerable:!1,configurable:!0}),t.prototype.collection=function(t){try{return new Bp(this,rf(this._delegate,t))}catch(t){throw xp(t,"collection()","Firestore.collection()")}},t.prototype.doc=function(t){try{return new Lp(this,of(this._delegate,t))}catch(t){throw xp(t,"doc()","Firestore.doc()")}},t.prototype.collectionGroup=function(t){try{return new Hp(this,function(t,e){if(t=Ql(t,Zl),Kl("collectionGroup","collection id",e),e.indexOf("/")>=0)throw new Ur(Mr.INVALID_ARGUMENT,"Invalid collection ID '"+e+"' passed to function collectionGroup(). Collection IDs must not contain '/'.");return new ef(t,null,function(t){return new no(ii.emptyPath(),t)}(e))}(this._delegate,t))}catch(t){throw xp(t,"collectionGroup()","Firestore.collectionGroup()")}},t.prototype.runTransaction=function(t){var e=this;return function(t,e){return function(t,e){var n=this,r=new Cs;return t.asyncQueue.enqueueAndForget((function(){return(0,Pr.sH)(n,void 0,void 0,(function(){var n;return(0,Pr.YH)(this,(function(i){switch(i.label){case 0:return[4,function(t){return kl(t).then((function(t){return t.datastore}))}(t)];case 1:return n=i.sent(),new Il(t.asyncQueue,n,e,r).run(),[2]}}))}))})),r.promise}(ff(t),(function(n){return e(new Ep(t,n))}
1515))}(this._delegate,(function(n){return t(new Op(e,n))}))},t.prototype.batch=function(){var t=this;return ff(this._delegate),new Dp(new gp(this._delegate,(function(e){return _p(t._delegate,e)})))},t.prototype.loadBundle=function(t){throw new Ur(Mr.FAILED_PRECONDITION,'"loadBundle()" does not exist, have you imported "firebase/firestore/bundle"?')},t.prototype.namedQuery=function(t){throw new Ur(Mr.FAILED_PRECONDITION,'"namedQuery()" does not exist, have you imported "firebase/firestore/bundle"?')},t}(),Cp=function(t){function e(e){var n=this;return(n=t.call(this)||this).firestore=e,n}return(0,Pr.C6)(e,t),e.prototype.convertBytes=function(t){return new Ap(new mf(t))},e.prototype.convertReference=function(t){var e=this.convertDocumentKey(t,this.firestore._databaseId);return Lp.Zc(e,this.firestore,null)},e}(pp);function Rp(t){var e;e=t,Fr.setLogLevel(e)}var Op=function(){function t(t,e){this._firestore=t,this._delegate=e,this._userDataWriter=new Cp(t)}return t.prototype.get=function(t){var e=this,n=Kp(t);return this._delegate.get(n).then((function(t){return new Fp(e._firestore,new Qf(e._firestore._delegate,e._userDataWriter,t._key,t._document,t.metadata,n.converter))}))},t.prototype.set=function(t,e,n){var r=Kp(t);return n?(Gl("Transaction.set",n),this._delegate.set(r,e,n)):this._delegate.set(r,e),this},t.prototype.update=function(t,e,n){for(var r,i=[],o=3;o<arguments.length;o++)i[o-3]=arguments[o];var a=Kp(t);return 2===arguments.length?this._delegate.update(a,e):(r=this._delegate).update.apply(r,(0,Pr.fX)([a,e,n],i)),this},t.prototype.delete=function(t){var e=Kp(t);return this._delegate.delete(e),this},t}(),Dp=function(){function t(t){this._delegate=t}return t.prototype.set=function(t,e,n){var r=Kp(t);return n?(Gl("WriteBatch.set",n),this._delegate.set(r,e,n)):this._delegate.set(r,e),this},t.prototype.update=function(t,e,n){for(var r,i=[],o=3;o<arguments.length;o++)i[o-3]=arguments[o];var a=Kp(t);return 2===arguments.length?this._delegate.update(a,e):(r=this._delegate).update.apply(r,(0,Pr.fX)([a,e,n],i)),this},t.prototype.delete=function(t){var e=Kp(t);return this._delegate.delete(e),this},t.prototype.commit=function(){return this._delegate.commit()},t}(),Pp=function(){function t(t,e,n){this._firestore=t,this._userDataWriter=e,this._delegate=n}return t.prototype.fromFirestore=function(t,e){var n=new Jf(this._firestore._delegate,this._userDataWriter,t._key,t._document,t.metadata,null);return this._delegate.fromFirestore(new Vp(this._firestore,n),null!=e?e:{})},t.prototype.toFirestore=function(t,e){return e?this._delegate.toFirestore(t,e):this._delegate.toFirestore(t)},t.tu=function(e,n){var r=t.eu,i=r.get(e);i||(i=new WeakMap,r.set(e,i));var o=i.get(n);return o||(o=new t(e,new Cp(e),n),i.set(n,o)),o},t}();Pp.eu=new WeakMap;var Lp=function(){function t(t,e){this.firestore=t,this._delegate=e,this._userDataWriter=new Cp(t)}return t.nu=function(e,n,r){if(e.length%2!=0)throw new Ur(Mr.INVALID_ARGUMENT,"Invalid document reference. Document references must have an even number of segments, but "+e.canonicalString()+" has "+e.length);return new t(n,new tf(n._delegate,r,new bi(e)))},t.Zc=function(e,n,r){return new t(n,new tf(n._delegate,r,e))},Object.defineProperty(t.prototype,"id",{get:function(){return this._delegate.id},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){return new Bp(this.firestore,this._delegate.parent)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"path",{get:function(){return this._delegate.path},enumerable:!1,configurable:!0}),t.prototype.collection=function(t){try{return new Bp(this.firestore,rf(this._delegate,t))}catch(t){throw xp(t,"collection()","DocumentReference.collection()")}},t.prototype.isEqual=function(t){return(t=(0,i.Ku)(t))instanceof tf&&af(this._delegate,t)},t.prototype.set=function(t,e){e=Gl("DocumentReference.set",e);try{return function(t,e,n){t=Ql(t,tf);var r=Ql(t.firestore,lf),i=dp(t.converter,e,n);return _p(r,[kf(Af(r),"setDoc",t._key,i,null!==t.converter,n).toMutation(t._key,Uo.none())])}(this._delegate,t,e)}
1515catch(t){throw xp(t,"setDoc()","DocumentReference.set()")}},t.prototype.update=function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];try{return 1===arguments.length?bp(this._delegate,t):bp.apply(void 0,(0,Pr.fX)([this._delegate,t,e],n))}catch(t){throw xp(t,"updateDoc()","DocumentReference.update()")}},t.prototype.delete=function(){return _p(Ql((t=this._delegate).firestore,lf),[new $o(t._key,Uo.none())]);var t},t.prototype.onSnapshot=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=Mp(e),i=Up(e,(function(e){return new Fp(t.firestore,new Qf(t.firestore._delegate,t._userDataWriter,e._key,e._document,e.metadata,t._delegate.converter))}));return wp(this._delegate,r,i)},t.prototype.get=function(t){var e=this;return("cache"===(null==t?void 0:t.source)?function(t){t=Ql(t,tf);var e=Ql(t.firestore,lf),n=ff(e),r=new yp(e);return function(t,e){var n=this,r=new Cs;return t.asyncQueue.enqueueAndForget((function(){return(0,Pr.sH)(n,void 0,void 0,(function(){var n;return(0,Pr.YH)(this,(function(i){switch(i.label){case 0:return n=function(t,e,n){return(0,Pr.sH)(this,void 0,void 0,(function(){var r,i;return(0,Pr.YH)(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,function(t,e){var n=Yr(t);return n.persistence.runTransaction("read document","readonly",(function(t){return n.Mn.mn(t,e)}))}(t,e)];case 1:return(i=o.sent()).isFoundDocument()?n.resolve(i):i.isNoDocument()?n.resolve(null):n.reject(new Ur(Mr.UNAVAILABLE,"Failed to get document from cache. (However, this document may exist on the server. Run again without setting 'source' in the GetOptions to attempt to retrieve the document from the server.)")),[3,3];case 2:return r=o.sent(),i=yh(r,"Failed to get document '"+e+" from cache"),n.reject(i),[3,3];case 3:return[2]}}
1515))}))},[4,Cl(t)];case 1:return[2,n.apply(void 0,[i.sent(),e,r])]}}))}))})),r.promise}(n,t._key).then((function(n){return new Qf(e,r,t._key,n,new Xf(null!==n&&n.hasLocalMutations,!0),t.converter)}))}(this._delegate):"server"===(null==t?void 0:t.source)?function(t){t=Ql(t,tf);var e=Ql(t.firestore,lf);return Pl(ff(e),t._key,{source:"server"}).then((function(n){return Ip(e,t,n)}))}(this._delegate):function(t){t=Ql(t,tf);var e=Ql(t.firestore,lf);return Pl(ff(e),t._key).then((function(n){return Ip(e,t,n)}))}(this._delegate)).then((function(t){return new Fp(e.firestore,new Qf(e.firestore._delegate,e._userDataWriter,t._key,t._document,t.metadata,e._delegate.converter))}))},t.prototype.withConverter=function(e){return new t(this.firestore,e?this._delegate.withConverter(Pp.tu(this.firestore,e)):this._delegate.withConverter(null))},t}();function xp(t,e,n){return t.message=t.message.replace(e,n),t}function Mp(t){for(var e=0,n=t;e<n.length;e++){var r=n[e];if("object"==typeof r&&!cf(r))return r}return{}}function Up(t,e){var n,r,i;return{next:function(t){i.next&&i.next(e(t))},error:null===(n=(i=cf(t[0])?t[0]:cf(t[1])?t[1]:"function"==typeof t[0]?{next:t[0],error:t[1],complete:t[2]}:{next:t[1],error:t[2],complete:t[3]}).error)||void 0===n?void 0:n.bind(i),complete:null===(r=i.complete)||void 0===r?void 0:r.bind(i)}}var Fp=function(){function t(t,e){this._firestore=t,this._delegate=e}return Object.defineProperty(t.prototype,"ref",{get:function(){return new Lp(this._firestore,this._delegate.ref)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"id",{get:function(){return this._delegate.id},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"metadata",{get:function(){return this._delegate.metadata},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"exists",{get:function(){return this._delegate.exists()},enumerable:!1,configurable:!0}),t.prototype.data=function(t){return this._delegate.data(t)},t.prototype.get=function(t,e){return this._delegate.get(t,e)},t.prototype.isEqual=function(t){return tp(this._delegate,t._delegate)},t}(),Vp=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Pr.C6)(e,t),e.prototype.data=function(t){return this._delegate.data(t)},e}(Fp),Hp=function(){function t(t,e){this.firestore=t,this._delegate=e,this._userDataWriter=new Cp(t)}return t.prototype.where=function(e,n,r){try{return new t(this.firestore,rp(this._delegate,function(t,e,n){var r=e,i=Wf("where",t);return new ip(i,r,n)}(e,n,r)))}catch(e){throw xp(e,/(orderBy|where)\(\)/,"Query.$1()")}},t.prototype.orderBy=function(e,n){try{return new t(this.firestore,rp(this._delegate,function(t,e){void 0===e&&(e="asc");var n=e,r=Wf("orderBy",t);return new op(r,n)}(e,n)))}catch(e){throw xp(e,/(orderBy|where)\(\)/,"Query.$1()")}},t.prototype.limit=function(e){try{return new t(this.firestore,rp(this._delegate,function(t){return Jl("limit",t),new ap("limit",t,"F")}(e)))}catch(e){throw xp(e,"limit()","Query.limit()")}},t.prototype.limitToLast=function(e){try{return new t(this.firestore,rp(this._delegate,function(t){return Jl("limitToLast",t),new ap("limitToLast",t,"L")}(e)))}catch(e){throw xp(e,"limitToLast()","Query.limitToLast()")}},t.prototype.startAt=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];try{return new t(this.firestore,rp(this._delegate,function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new sp("startAt",t,!0)}.apply(void 0,e)))}catch(e){throw xp(e,"startAt()","Query.startAt()")}},t.prototype.startAfter=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];try{return new t(this.firestore,rp(this._delegate,function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new sp("startAfter",t,!1)}.apply(void 0,e)))}catch(e){throw xp(e,"startAfter()","Query.startAfter()")}},t.prototype.endBefore=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];try{return new t(this.firestore,rp(this._delegate,function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new up("endBefore",t,!0)}.apply(void 0,e)))}catch(e){throw xp(e,"endBefore()","Query.endBefore()")}},t.prototype.endAt=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];try{return new t(this.firestore,rp(this._delegate,function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new up("endAt",t,!1)}.apply(void 0,e)))}catch(e){throw xp(e,"endAt()","Query.endAt()")}},t.prototype.isEqual=function(t){return sf(this._delegate,t._delegate)},t.prototype.get=function(t){var e=this;
1515return("cache"===(null==t?void 0:t.source)?function(t){t=Ql(t,ef);var e=Ql(t.firestore,lf),n=ff(e),r=new yp(e);return function(t,e){var n=this,r=new Cs;return t.asyncQueue.enqueueAndForget((function(){return(0,Pr.sH)(n,void 0,void 0,(function(){var n;return(0,Pr.YH)(this,(function(i){switch(i.label){case 0:return n=function(t,e,n){return(0,Pr.sH)(this,void 0,void 0,(function(){var r,i,o,a,s;return(0,Pr.YH)(this,(function(u){switch(u.label){case 0:return u.trys.push([0,2,,3]),[4,ic(t,e,!0)];case 1:return s=u.sent(),r=new xh(e,s.Bn),i=r._o(s.documents),o=r.applyChanges(i,!1),n.resolve(o.snapshot),[3,3];case 2:return a=u.sent(),s=yh(a,"Failed to execute query '"+e+" against cache"),n.reject(s),[3,3];case 3:return[2]}}))}))},[4,Cl(t)];case 1:return[2,n.apply(void 0,[i.sent(),e,r])]}}))}))})),r.promise}(n,t._query).then((function(n){return new $f(e,r,t,n)}))}(this._delegate):"server"===(null==t?void 0:t.source)?function(t){t=Ql(t,ef);var e=Ql(t.firestore,lf),n=ff(e),r=new yp(e);return Ll(n,t._query,{source:"server"}).then((function(n){return new $f(e,r,t,n)}))}(this._delegate):function(t){t=Ql(t,ef);var e=Ql(t.firestore,lf),n=ff(e),r=new yp(e);return ep(t._query),Ll(n,t._query).then((function(n){return new $f(e,r,t,n)}))}(this._delegate)).then((function(t){return new qp(e.firestore,new $f(e.firestore._delegate,e._userDataWriter,e._delegate,t._snapshot))}))},t.prototype.onSnapshot=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=Mp(e),i=Up(e,(function(e){return new qp(t.firestore,new $f(t.firestore._delegate,t._userDataWriter,t._delegate,e._snapshot))}));return wp(this._delegate,r,i)},t.prototype.withConverter=function(e){return new t(this.firestore,e?this._delegate.withConverter(Pp.tu(this.firestore,e)):this._delegate.withConverter(null))},t}(),jp=function(){function t(t,e){this._firestore=t,this._delegate=e}return Object.defineProperty(t.prototype,"type",{get:function(){return this._delegate.type},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"doc",{get:function(){return new Vp(this._firestore,this._delegate.doc)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"oldIndex",{get:function(){return this._delegate.oldIndex},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"newIndex",{get:function(){return this._delegate.newIndex},enumerable:!1,configurable:!0}),t}(),qp=function(){function t(t,e){this._firestore=t,this._delegate=e}return Object.defineProperty(t.prototype,"query",{get:function(){return new Hp(this._firestore,this._delegate.query)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"metadata",{get:function(){return this._delegate.metadata},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return this._delegate.size},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"empty",{get:function(){return this._delegate.empty},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"docs",{get:function(){var t=this;return this._delegate.docs.map((function(e){return new Vp(t._firestore,e)}))},enumerable:!1,configurable:!0}),t.prototype.docChanges=function(t){var e=this;return this._delegate.docChanges(t).map((function(t){return new jp(e._firestore,t)}))},t.prototype.forEach=function(t,e){var n=this;this._delegate.forEach((function(r){t.call(e,new Vp(n._firestore,r))}))},t.prototype.isEqual=function(t){return tp(this._delegate,t._delegate)},t}(),Bp=function(t){function e(e,n){var r=this;return(r=t.call(this,e,n)||this).firestore=e,r._delegate=n,r}return(0,Pr.C6)(e,t),Object.defineProperty(e.prototype,"id",{get:function(){return this._delegate.id},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"path",{get:function(){return this._delegate.path},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){var t=this._delegate.parent;return t?new Lp(this.firestore,t):null},enumerable:!1,configurable:!0}),e.prototype.doc=function(t){try{return new Lp(this.firestore,void 0===t?of(this._delegate):of(this._delegate,t))}catch(t){throw xp(t,"doc()","CollectionReference.doc()")}},e.prototype.add=function(t){var e=this;return function(t,e){var n=Ql(t.firestore,lf),r=of(t),i=dp(t.converter,e);return _p(n,[kf(Af(t.firestore),"addDoc",r._key,i,null!==t.converter,{}).toMutation(r._key,Uo.exists(!1))]).then((function(){return r}))}(this._delegate,t).then((function(t){return new Lp(e.firestore,t)}))},e.prototype.isEqual=function(t){return af(this._delegate,t._delegate)},e.prototype.withConverter=function(t){return new e(this.firestore,t?this._delegate.withConverter(Pp.tu(this.firestore,t)):this._delegate.withConverter(null))},e}(Hp);function Kp(t){return Ql(t,tf)} 1516/** 1517 * @license 1518 * Copyright 2017 Google LLC 1519 * 1520 * Licensed under the Apache License, Version 2.0 (the "License");
1521 * you may not use this file except in compliance with the License. 1522 * You may obtain a copy of the License at 1523 * 1524 * http://www.apache.org/licenses/LICENSE-2.0 1525 * 1526 * Unless required by applicable law or agreed to in writing, software 1527 * distributed under the License is distributed on an "AS IS" BASIS, 1528 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1529 * See the License for the specific language governing permissions and 1530 * limitations under the License. 1531 */var Gp=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._delegate=new(gf.bind.apply(gf,(0,Pr.fX)([void 0],t)))}return t.documentId=function(){return new t(ai.keyField().canonicalString())},t.prototype.isEqual=function(t){return(t=(0,i.Ku)(t))instanceof gf&&this._delegate._internalPath.isEqual(t._internalPath)},t}(),Yp=function(){function t(t){this._delegate=t}return t.serverTimestamp=function(){var e=new Rf("serverTimestamp");return e._methodName="FieldValue.serverTimestamp",new t(e)},t.delete=function(){var e=new Nf("deleteField");return e._methodName="FieldValue.delete",new t(e)},t.arrayUnion=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new Of("arrayUnion",t)}.apply(void 0,e);return r._methodName="FieldValue.arrayUnion",new t(r)},t.arrayRemove=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new Df("arrayRemove",t)}.apply(void 0,e);return r._methodName="FieldValue.arrayRemove",new t(r)},t.increment=function(e){var n=function(t){return new Pf("increment",t)}(e);return n._methodName="FieldValue.increment",new t(n)},t.prototype.isEqual=function(t){return this._delegate.isEqual(t._delegate)},t}(); 1532/** 1533 * @license 1534 * Copyright 2017 Google LLC 1535 * 1536 * Licensed under the Apache License, Version 2.0 (the "License"); 1537 * you may not use this file except in compliance with the License. 1538 * You may obtain a copy of the License at 1539 * 1540 * http://www.apache.org/licenses/LICENSE-2.0 1541 * 1542 * Unless required by applicable law or agreed to in writing, software 1543 * distributed under the License is distributed on an "AS IS" BASIS, 1544 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1545 * See the License for the specific language governing permissions and 1546 * limitations under the License. 1547 */ 1548/** 1549 * @license 1550 * Copyright 2020 Google LLC 1551 * 1552 * Licensed under the Apache License, Version 2.0 (the "License"); 1553 * you may not use this file except in compliance with the License. 1554 * You may obtain a copy of the License at 1555 * 1556 * http://www.apache.org/licenses/LICENSE-2.0 1557 * 1558 * Unless required by applicable law or agreed to in writing, software 1559 * distributed under the License is distributed on an "AS IS" BASIS, 1560 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1561 * See the License for the specific language governing permissions and 1562 * limitations under the License. 1563 */var zp=n(51134),Wp={Firestore:Np,GeoPoint:bf,Timestamp:$r,Blob:Ap,Transaction:Op,WriteBatch:Dp,DocumentReference:Lp,DocumentSnapshot:Fp,Query:Hp,QueryDocumentSnapshot:Vp,QuerySnapshot:qp,CollectionReference:Bp,FieldPath:Gp,FieldValue:Yp,setLogLevel:Rp,CACHE_SIZE_UNLIMITED:hf}; 1564/** 1565 * @license 1566 * Copyright 2017 Google LLC 1567 * 1568 * Licensed under the Apache License, Version 2.0 (the "License"); 1569 * you may not use this file except in compliance with the License. 1570 * You may obtain a copy of the License at 1571 * 1572 * http://www.apache.org/licenses/LICENSE-2.0 1573 * 1574 * Unless required by applicable law or agreed to in writing, software 1575 * distributed under the License is distributed on an "AS IS" BASIS, 1576 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1577 * See the License for the specific language governing permissions and 1578 * limitations under the License. 1579 */ 1580function Xp(t){!function(t,e){t.INTERNAL.registerComponent(new zp.uA("firestore",(function(t){var n=t.getProvider("app").getImmediate();return e(n,t.getProvider("auth-internal"))}),"PUBLIC").setServiceProps(Object.assign({},Wp)))}(t,(function(t,e){return new Np(t,new lf(t,e),new kp)})),t.registerVersion("@firebase/firestore","2.3.0")}Xp(r.A)},75597:function(t,e,n){var r=n(49998),i=n(15215),o=n(51134),a={OK:"ok",CANCELLED:"cancelled",UNKNOWN:"unknown",INVALID_ARGUMENT:"invalid-argument",DEADLINE_EXCEEDED:"deadline-exceeded",NOT_FOUND:"not-found",ALREADY_EXISTS:"already-exists",PERMISSION_DENIED:"permission-denied",UNAUTHENTICATED:"unauthenticated",RESOURCE_EXHAUSTED:"resource-exhausted",FAILED_PRECONDITION:"failed-precondition",ABORTED:"aborted",OUT_OF_RANGE:"out-of-range",UNIMPLEMENT
1580ED:"unimplemented",INTERNAL:"internal",UNAVAILABLE:"unavailable",DATA_LOSS:"data-loss"},s=function(t){function e(n,r,i){var o=t.call(this,r)||this;return Object.setPrototypeOf(o,e.prototype),o.code=n,o.details=i,o}return(0,i.C6)(e,t),e}(Error);function u(t){if(t>=200&&t<300)return"ok";switch(t){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"}function c(t,e,n){var r=u(t),i=r,o=void 0;try{var c=e&&e.error;if(c){var h=c.status;if("string"===typeof h){if(!a[h])return new s("internal","internal");r=a[h],i=h}var l=c.message;"string"===typeof l&&(i=l),o=c.details,void 0!==o&&(o=n.decode(o))}}catch(f){}return"ok"===r?null:new s(r,i,o)}var h=function(){function t(t,e){var n=this;this.auth=null,this.messaging=null,this.auth=t.getImmediate({optional:!0}),this.messaging=e.getImmediate({optional:!0}),this.auth||t.get().then((function(t){return n.auth=t}),(function(){})),this.messaging||e.get().then((function(t){return n.messaging=t}),(function(){}))}return t.prototype.getAuthToken=function(){return(0,i.sH)(this,void 0,void 0,(function(){var t;return(0,i.YH)(this,(function(e){switch(e.label){case 0:if(!this.auth)return[2,void 0];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.auth.getToken()];case 2:return t=e.sent(),t?[2,t.accessToken]:[2,void 0];case 3:return e.sent(),[2,void 0];case 4:return[2]}}
1580))}))},t.prototype.getInstanceIdToken=function(){return(0,i.sH)(this,void 0,void 0,(function(){return(0,i.YH)(this,(function(t){if(!this.messaging||!("Notification"in self)||"granted"!==Notification.permission)return[2,void 0];try{return[2,this.messaging.getToken()]}catch(e){return[2,void 0]}return[2]}))}))},t.prototype.getContext=function(){return(0,i.sH)(this,void 0,void 0,(function(){var t,e;return(0,i.YH)(this,(function(n){switch(n.label){case 0:return[4,this.getAuthToken()];case 1:return t=n.sent(),[4,this.getInstanceIdToken()];case 2:return e=n.sent(),[2,{authToken:t,instanceIdToken:e}]}}))}))},t}(),l="type.googleapis.com/google.protobuf.Int64Value",f="type.googleapis.com/google.protobuf.UInt64Value"; 1581/** 1582 * @license 1583 * Copyright 2017 Google LLC 1584 * 1585 * Licensed under the Apache License, Version 2.0 (the "License"); 1586 * you may not use this file except in compliance with the License. 1587 * You may obtain a copy of the License at 1588 * 1589 * http://www.apache.org/licenses/LICENSE-2.0 1590 * 1591 * Unless required by applicable law or agreed to in writing, software 1592 * distributed under the License is distributed on an "AS IS" BASIS, 1593 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1594 * See the License for the specific language governing permissions and 1595 * limitations under the License. 1596 */function p(t,e){var n={};for(var r in t)t.hasOwnProperty(r)&&(n[r]=e(t[r]));return n}var d=function(){function t(){}return t.prototype.encode=function(t){var e=this;if(null==t)return null;if(t instanceof Number&&(t=t.valueOf()),"number"===typeof t&&isFinite(t))return t;if(!0===t||!1===t)return t;if("[object String]"===Object.prototype.toString.call(t))return t;if(Array.isArray(t))return t.map((function(t){return e.encode(t)}));if("function"===typeof t||"object"===typeof t)return p(t,(function(t){return e.encode(t)}));throw new Error("Data cannot be encoded in JSON: "+t)},t.prototype.decode=function(t){var e=this;if(null==t)return t;if(t["@type"])switch(t["@type"]){case l:case f:var n=Number(t["value"]);if(isNaN(n))throw new Error("Data cannot be decoded from JSON: "+t);return n;default:throw new Error("Data cannot be decoded from JSON: "+t)}return Array.isArray(t)?t.map((function(t){return e.decode(t)})):"function"===typeof t||"object"===typeof t?p(t,(function(t){return e.decode(t)})):t},t}(); 1597/** 1598 * @license 1599 * Copyright 2017 Google LLC 1600 * 1601 * Licensed under the Apache License, Version 2.0 (the "License"); 1602 * you may not use this file except in compliance with the License. 1603 * You may obtain a copy of the License at 1604 * 1605 * http://www.apache.org/licenses/LICENSE-2.0 1606 * 1607 * Unless required by applicable law or agreed to in writing, software 1608 * distributed under the License is distributed on an "AS IS" BASIS, 1609 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1610 * See the License for the specific language governing permissions and 1611 * limitations under the License. 1612 */function v(t){var e,n=new Promise((function(n,r){e=setTimeout((function(){r(new s("deadline-exceeded","deadline-exceeded"))}),t)}));return{timer:e,promise:n}}var g=function(){function t(t,e,n,r,i,o){var a=this;void 0===i&&(i="us-central1"),this.app_=t,this.appCheckProvider=r,this.fetchImpl=o,this.serializer=new d,this.emulatorOrigin=null,this.INTERNAL={delete:function(){return Promise.resolve(a.deleteService())}},this.contextProvider=new h(e,n),this.cancelAllRequests=new Promise((function(t){a.deleteService=function(){return t()}}));try{var s=new URL(i);this.customDomain=s.origin,this.region="us-central1"}catch(u){this.customDomain=null,this.region=i}}return Object.defineProperty(t.prototype,"app",{get:function(){return this.app_},enumerable:!1,configurable:!0}),t.prototype._url=function(t){var e=this.app_.options.projectId;if(null!==this.emulatorOrigin){var n=this.emulatorOrigin;return n+"/"+e+"/"+this.region+"/"+t}return null!==this.customDomain?this.customDomain+"/"+t:"https://"+this.region+"-"+e+".cloudfunctions.net/"+t},t.prototype.useEmulator=function(t,e){this.emulatorOrigin="http://"+t+":"+e},t.prototype.useFunctionsEmulator=function(t){this.emulatorOrigin=t},t.prototype.httpsCallable=function(t,e){var n=this;return function(r){return n.call(t,r,e||{})}},t.prototype.postJSON=function(t,e,n){return(0,i.sH)(this,void 0,void 0,(function(){var r,o,a;return(0,i.YH)(this,(function(i){switch(i.label){case 0:return n["Content-Type"]="application/json",[4,this.getAppCheckToken()];case 1:r=i.sent(),null!==r&&(n["X-Firebase-AppCheck"]=r),i.label=2;case 2:return i.trys.push([2,4,,5]),[4,this.fetchImpl(t,{method:"POST",body:JSON.stringify(e),headers:n})];case 3:return o=i.sent(),[3,5];case 4:return i.sent(),[2,{status:0,json:null}];case 5:a=null,i.label=6;case 6:return i.trys.push([6,8,,9]),[4,o.json()];case 7:return a=i.sent(),[3,9];case 8:return i.sent(),[3,9];case 9:return[2,{status:o.status,json:a}]}}))}))},t.prototype.getAppCheckToken=function(){return(0,i.sH)(this,void 0,void 0,(function(){var t,e;return(0,i.YH)(this,(function(n){switch(n.label){case 0:return t=this.appCheckProvider.getImmediate({optional:!0}),t?[4,t.getToken()]:[3,2];case 1:return e=n.sent(),[2,e.token];case 2:return[2,null]}}))}))},t.prototype.call=function(t,e,n){return(0,i.sH)(this,void 0,void 0,(function(){var r,o,a,u,h,l,f,p,d,g,y,b;return(0,i.YH)(this,(function(i){switch(i.label){case 0:return r=this._url(t),e=this.serializer.encode(e),o={data:e},a={},[4,this.contextProvider.getContext()];case 1:return u=i.sent(),u.authToken&&(a["Authorization"]="Bearer "+u.authToken),u.instanceIdToken&&(a["Firebase-Instance-ID-Token"]=u.instanceIdToken),h=n.timeout||7e4,l=v(h),f=l.timer,p=l.promise,[4,Promise.race([m(f,this.postJSON(r,o,a)),p,m(f,this.cancelAllRequests)])];case 2:if(d=i.sent(),!d)throw new s("cancelled","Firebase Functions instance was deleted.");
1612if(g=c(d.status,d.json,this.serializer),g)throw g;if(!d.json)throw new s("internal","Response is not valid JSON object.");if(y=d.json.data,"undefined"===typeof y&&(y=d.json.result),"undefined"===typeof y)throw new s("internal","Response is missing data field.");return b=this.serializer.decode(y),[2,{data:b}]}}))}))},t}();function m(t,e){return(0,i.sH)(this,void 0,void 0,(function(){var n;return(0,i.YH)(this,(function(r){switch(r.label){case 0:return[4,e];case 1:return n=r.sent(),clearTimeout(t),[2,n]}}))}))} 1613/** 1614 * @license 1615 * Copyright 2019 Google LLC 1616 * 1617 * Licensed under the Apache License, Version 2.0 (the "License"); 1618 * you may not use this file except in compliance with the License. 1619 * You may obtain a copy of the License at 1620 * 1621 * http://www.apache.org/licenses/LICENSE-2.0 1622 * 1623 * Unless required by applicable law or agreed to in writing, software 1624 * distributed under the License is distributed on an "AS IS" BASIS, 1625 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1626 * See the License for the specific language governing permissions and 1627 * limitations under the License. 1628 */var y="functions";function b(t,e){var n={Functions:g};function r(t,n){var r=n.instanceIdentifier,i=t.getProvider("app").getImmediate(),o=t.getProvider("auth-internal"),a=t.getProvider("app-check-internal"),s=t.getProvider("messaging");return new g(i,o,s,a,r,e)}t.INTERNAL.registerComponent(new o.uA(y,r,"PUBLIC").setServiceProps(n).setMultipleInstances(!0))}var w="@firebase/functions",_="0.6.8"; 1629/** 1630 * @license 1631 * Copyright 2017 Google LLC 1632 * 1633 * Licensed under the Apache License, Version 2.0 (the "License"); 1634 * you may not use this file except in compliance with the License. 1635 * You may obtain a copy of the License at 1636 * 1637 * http://www.apache.org/licenses/LICENSE-2.0 1638 * 1639 * Unless required by applicable law or agreed to in writing, software 1640 * distributed under the License is distributed on an "AS IS" BASIS, 1641 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1642 * See the License for the specific language governing permissions and 1643 * limitations under the License. 1644 */ 1645b(r.A,fetch.bind(self)),r.A.registerVersion(w,_)},54370:function(t,e,n){var r,i=n(49998),o=n(51134),a=n(15215),s=n(51625),u=n(91588),c="@firebase/installations",h="0.4.26",l=1e4,f="w:"+h,p="FIS_v2",d="https://firebaseinstallations.googleapis.com/v1",v=36e5,g="installations",m="Installations",y=(r={},r["missing-app-config-values"]='Missing App configuration value: "{$valueName}"',r["not-registered"]="Firebase Installation is not registered.",r["installation-not-found"]="Firebase Installation not found.",r["request-failed"]='{$requestName} request failed with error "{$serverCode} {$serverStatus}: {$serverMessage}"',r["app-offline"]="Could not process request. Application offline.",r["delete-pending-registration"]="Can't delete installation while there is a pending registration request.",r),b=new s.FA(g,m,y);function w(t){return t instanceof s.g&&t.code.includes("request-failed")} 1646/** 1647 * @license 1648 * Copyright 2019 Google LLC 1649 * 1650 * Licensed under the Apache License, Version 2.0 (the "License"); 1651 * you may not use this file except in compliance with the License. 1652 * You may obtain a copy of the License at 1653 * 1654 * http://www.apache.org/licenses/LICENSE-2.0 1655 * 1656 * Unless required by applicable law or agreed to in writing, software 1657 * distributed under the License is distributed on an "AS IS" BASIS, 1658 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1659 * See the License for the specific language governing permissions and 1660 * limitations under the License. 1661 */function _(t){var e=t.projectId;return d+"/projects/"+e+"/installations"}function I(t){return{token:t.token,requestStatus:2,expiresIn:k(t.expiresIn),creationTime:Date.now()}}function E(t,e){return(0,a.sH)(this,void 0,void 0,(function(){var n,r;return(0,a.YH)(this,(function(i){switch(i.label){case 0:return[4,e.json()];case 1:return n=i.sent(),r=n.error,[2,b.create("request-failed",{requestName:t,serverCode:r.code,serverMessage:r.message,serverStatus:r.status})]}}))}))}function T(t){var e=t.apiKey;return new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":e})}function S(t,e){var n=e.refreshToken,r=T(t);return r.append("Authorization",N(n)),r}function A(t){return(0,a.sH)(this,void 0,void 0,(function(){var e;return(0,a.YH)(this,(function(n){switch(n.label){case 0:return[4,t()];case 1:return e=n.sent(),e.status>=500&&e.status<600?[2,t()]:[2,e]}}))}))}function k(t){return Number(t.replace("s","000"))}function N(t){return p+" "+t} 1662/** 1663 * @license 1664 * Copyright 2019 Google LLC 1665 * 1666 * Licensed under the Apache License, Version 2.0 (the "License");
1667 * you may not use this file except in compliance with the License. 1668 * You may obtain a copy of the License at 1669 * 1670 * http://www.apache.org/licenses/LICENSE-2.0 1671 * 1672 * Unless required by applicable law or agreed to in writing, software 1673 * distributed under the License is distributed on an "AS IS" BASIS, 1674 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1675 * See the License for the specific language governing permissions and 1676 * limitations under the License. 1677 */function C(t,e){var n=e.fid;return(0,a.sH)(this,void 0,void 0,(function(){var e,r,i,o,s,u,c;return(0,a.YH)(this,(function(a){switch(a.label){case 0:return e=_(t),r=T(t),i={fid:n,authVersion:p,appId:t.appId,sdkVersion:f},o={method:"POST",headers:r,body:JSON.stringify(i)},[4,A((function(){return fetch(e,o)}))];case 1:return s=a.sent(),s.ok?[4,s.json()]:[3,3];case 2:return u=a.sent(),c={fid:u.fid||n,registrationStatus:2,refreshToken:u.refreshToken,authToken:I(u.authToken)},[2,c];case 3:return[4,E("Create Installation",s)];case 4:throw a.sent()}}))}))} 1678/** 1679 * @license 1680 * Copyright 2020 Google LLC 1681 * 1682 * Licensed under the Apache License, Version 2.0 (the "License"); 1683 * you may not use this file except in compliance with the License. 1684 * You may obtain a copy of the License at 1685 * 1686 * http://www.apache.org/licenses/LICENSE-2.0 1687 * 1688 * Unless required by applicable law or agreed to in writing, software 1689 * distributed under the License is distributed on an "AS IS" BASIS, 1690 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1691 * See the License for the specific language governing permissions and 1692 * limitations under the License. 1693 */function R(t){return new Promise((function(e){setTimeout(e,t)}))} 1694/** 1695 * @license 1696 * Copyright 2019 Google LLC 1697 * 1698 * Licensed under the Apache License, Version 2.0 (the "License"); 1699 * you may not use this file except in compliance with the License. 1700 * You may obtain a copy of the License at 1701 * 1702 * http://www.apache.org/licenses/LICENSE-2.0 1703 * 1704 * Unless required by applicable law or agreed to in writing, software 1705 * distributed under the License is distributed on an "AS IS" BASIS, 1706 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1707 * See the License for the specific language governing permissions and 1708 * limitations under the License. 1709 */function O(t){var e=btoa(String.fromCharCode.apply(String,(0,a.fX)([],(0,a.zs)(t))));return e.replace(/\+/g,"-").replace(/\//g,"_")} 1710/** 1711 * @license 1712 * Copyright 2019 Google LLC 1713 * 1714 * Licensed under the Apache License, Version 2.0 (the "License"); 1715 * you may not use this file except in compliance with the License. 1716 * You may obtain a copy of the License at 1717 * 1718 * http://www.apache.org/licenses/LICENSE-2.0 1719 * 1720 * Unless required by applicable law or agreed to in writing, software 1721 * distributed under the License is distributed on an "AS IS" BASIS, 1722 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1723 * See the License for the specific language governing permissions and 1724 * limitations under the License. 1725 */var D=/^[cdef][\w-]{21}$/,P="";function L(){try{var t=new Uint8Array(17),e=self.crypto||self.msCrypto;e.getRandomValues(t),t[0]=112+t[0]%16;var n=x(t);return D.test(n)?n:P}catch(r){return P}}function x(t){var e=O(t);return e.substr(0,22)} 1726/** 1727 * @license 1728 * Copyright 2019 Google LLC 1729 * 1730 * Licensed under the Apache License, Version 2.0 (the "License"); 1731 * you may not use this file except in compliance with the License. 1732 * You may obtain a copy of the License at 1733 * 1734 * http://www.apache.org/licenses/LICENSE-2.0 1735 * 1736 * Unless required by applicable law or agreed to in writing, software 1737 * distributed under the License is distributed on an "AS IS" BASIS, 1738 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1739 * See the License for the specific language governing permissions and 1740 * limitations under the License. 1741 */function M(t){return t.appName+"!"+t.appId} 1742/** 1743 * @license 1744 * Copyright 2019 Google LLC 1745 * 1746 * Licensed under the Apache License, Version 2.0 (the "License"); 1747 * you may not use this file except in compliance with the License. 1748 * You may obtain a copy of the License at 1749 * 1750 * http://www.apache.org/licenses/LICENSE-2.0 1751 * 1752 * Unless required by applicable law or agreed to in writing, softw
1752are 1753 * distributed under the License is distributed on an "AS IS" BASIS, 1754 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1755 * See the License for the specific language governing permissions and 1756 * limitations under the License. 1757 */var U=new Map;function F(t,e){var n=M(t);j(n,e),q(n,e)}function V(t,e){K();var n=M(t),r=U.get(n);r||(r=new Set,U.set(n,r)),r.add(e)}function H(t,e){var n=M(t),r=U.get(n);r&&(r.delete(e),0===r.size&&U.delete(n),G())}function j(t,e){var n,r,i=U.get(t);if(i)try{for(var o=(0,a.Ju)(i),s=o.next();!s.done;s=o.next()){var u=s.value;u(e)}}catch(c){n={error:c}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}function q(t,e){var n=K();n&&n.postMessage({key:t,fid:e}),G()}var B=null;function K(){return!B&&"BroadcastChannel"in self&&(B=new BroadcastChannel("[Firebase] FID Change"),B.onmessage=function(t){j(t.data.key,t.data.fid)}),B}function G(){0===U.size&&B&&(B.close(),B=null)} 1758/** 1759 * @license 1760 * Copyright 2019 Google LLC 1761 * 1762 * Licensed under the Apache License, Version 2.0 (the "License"); 1763 * you may not use this file except in compliance with the License. 1764 * You may obtain a copy of the License at 1765 * 1766 * http://www.apache.org/licenses/LICENSE-2.0 1767 * 1768 * Unless required by applicable law or agreed to in writing, software 1769 * distributed under the License is distributed on an "AS IS" BASIS, 1770 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1771 * See the License for the specific language governing permissions and 1772 * limitations under the License. 1773 */var Y="firebase-installations-database",z=1,W="firebase-installations-store",X=null;function Q(){return X||(X=(0,u.openDb)(Y,z,(function(t){switch(t.oldVersion){case 0:t.createObjectStore(W)}}))),X}function J(t,e){return(0,a.sH)(this,void 0,void 0,(function(){var n,r,i,o,s;return(0,a.YH)(this,(function(a){switch(a.label){case 0:return n=M(t),[4,Q()];case 1:return r=a.sent(),i=r.transaction(W,"readwrite"),o=i.objectStore(W),[4,o.get(n)];case 2:return s=a.sent(),[4,o.put(e,n)];case 3:return a.sent(),[4,i.complete];case 4:return a.sent(),s&&s.fid===e.fid||F(t,e.fid),[2,e]}}))}))}function $(t){return(0,a.sH)(this,void 0,void 0,(function(){var e,n,r;return(0,a.YH)(this,(function(i){switch(i.label){case 0:return e=M(t),[4,Q()];case 1:return n=i.sent(),r=n.transaction(W,"readwrite"),[4,r.objectStore(W).delete(e)];case 2:return i.sent(),[4,r.complete];case 3:return i.sent(),[2]}}))}))}function Z(t,e){return(0,a.sH)(this,void 0,void 0,(function(){var n,r,i,o,s,u;return(0,a.YH)(this,(function(a){switch(a.label){case 0:return n=M(t),[4,Q()];case 1:return r=a.sent(),i=r.transaction(W,"readwrite"),o=i.objectStore(W),[4,o.get(n)];case 2:return s=a.sent(),u=e(s),void 0!==u?[3,4]:[4,o.delete(n)];case 3:return a.sent(),[3,6];case 4:return[4,o.put(u,n)];case 5:a.sent(),a.label=6;case 6:return[4,i.complete];case 7:return a.sent(),!u||s&&s.fid===u.fid||F(t,u.fid),[2,u]}}))}))} 1774/** 1775 * @license 1776 * Copyright 2019 Google LLC 1777 * 1778 * Licensed under the Apache License, Version 2.0 (the "License"); 1779 * you may not use this file except in compliance with the License. 1780 * You may obtain a copy of the License at 1781 * 1782 * http://www.apache.org/licenses/LICENSE-2.0 1783 * 1784 * Unless required by applicable law or agreed to in writing, software 1785 * distributed under the License is distributed on an "AS IS" BASIS, 1786 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1787 * See the License for the specific language governing permissions and 1788 * limitations under the License. 1789 */function tt(t){return(0,a.sH)(this,void 0,void 0,(function(){var e,n,r;return(0,a.YH)(this,(function(i){switch(i.label){case 0:return[4,Z(t,(function(n){var r=et(n),i=nt(t,r);return e=i.registrationPromise,i.installationEntry}))];case 1:return n=i.sent(),n.fid!==P?[3,3]:(r={},[4,e]);case 2:return[2,(r.installationEntry=i.sent(),r)];case 3:return[2,{installationEntry:n,registrationPromise:e}]}}))}))}function et(t){var e=t||{fid:L(),registrationStatus:0};return at(e)}function nt(t,e){if(0===e.registrationStatus){if(!navigator.onLine){var n=Promise.reject(b.create("app-offline"));return{installationEntry:e,registrationPromise:n}}var r={fid:e.fid,registrationStatus:1,registrationTime:Date.now()},i=rt(t,r);return{installationEntry:r,registrationPromise:i}}return 1===e.registrationStatus?{installationEntry:e,registrationPromise:it(t)}:{installationEntry:e}}function rt(t,e){return(0,a.sH)(this,void 0,void 0,(function(){var n,r;return(0,a.YH)(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,7]),[4,C(t,e)];case 1:return n=i.sent(),[2,J(t,n)];case 2:return r=i.sent(),w(r)&&409===r.customData.serverCode?[4,$(t)]:[3,4];case 3:return i.sent(),[3,6];case 4:return[4,J(t,{fid:e.fid,registrationStatus:0})];case 5:i.sent(),i.label=6;case 6:throw r;case 7:return[2]}}
1789))}))}function it(t){return(0,a.sH)(this,void 0,void 0,(function(){var e,n,r,i;return(0,a.YH)(this,(function(o){switch(o.label){case 0:return[4,ot(t)];case 1:e=o.sent(),o.label=2;case 2:return 1!==e.registrationStatus?[3,5]:[4,R(100)];case 3:return o.sent(),[4,ot(t)];case 4:return e=o.sent(),[3,2];case 5:return 0!==e.registrationStatus?[3,7]:[4,tt(t)];case 6:return n=o.sent(),r=n.installationEntry,i=n.registrationPromise,i?[2,i]:[2,r];case 7:return[2,e]}}))}))}function ot(t){return Z(t,(function(t){if(!t)throw b.create("installation-not-found");return at(t)}))}function at(t){return st(t)?{fid:t.fid,registrationStatus:0}:t}function st(t){return 1===t.registrationStatus&&t.registrationTime+l<Date.now()} 1790/** 1791 * @license 1792 * Copyright 2019 Google LLC 1793 * 1794 * Licensed under the Apache License, Version 2.0 (the "License"); 1795 * you may not use this file except in compliance with the License. 1796 * You may obtain a copy of the License at 1797 * 1798 * http://www.apache.org/licenses/LICENSE-2.0 1799 * 1800 * Unless required by applicable law or agreed to in writing, software 1801 * distributed under the License is distributed on an "AS IS" BASIS, 1802 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1803 * See the License for the specific language governing permissions and 1804 * limitations under the License. 1805 */function ut(t,e){var n=t.appConfig,r=t.platformLoggerProvider;return(0,a.sH)(this,void 0,void 0,(function(){var t,i,o,s,u,c,h,l;return(0,a.YH)(this,(function(a){switch(a.label){case 0:return t=ct(n,e),i=S(n,e),o=r.getImmediate({optional:!0}),o&&i.append("x-firebase-client",o.getPlatformInfoString()),s={installation:{sdkVersion:f}},u={method:"POST",headers:i,body:JSON.stringify(s)},[4,A((function(){return fetch(t,u)}))];case 1:return c=a.sent(),c.ok?[4,c.json()]:[3,3];case 2:return h=a.sent(),l=I(h),[2,l];case 3:return[4,E("Generate Auth Token",c)];case 4:throw a.sent()}}))}))}function ct(t,e){var n=e.fid;return _(t)+"/"+n+"/authTokens:generate"} 1806/** 1807 * @license 1808 * Copyright 2019 Google LLC 1809 * 1810 * Licensed under the Apache License, Version 2.0 (the "License"); 1811 * you may not use this file except in compliance with the License. 1812 * You may obtain a copy of the License at 1813 * 1814 * http://www.apache.org/licenses/LICENSE-2.0 1815 * 1816 * Unless required by applicable law or agreed to in writing, software 1817 * distributed under the License is distributed on an "AS IS" BASIS, 1818 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1819 * See the License for the specific language governing permissions and 1820 * limitations under the License. 1821 */function ht(t,e){return void 0===e&&(e=!1),(0,a.sH)(this,void 0,void 0,(function(){var n,r,i,o;return(0,a.YH)(this,(function(a){switch(a.label){case 0:return[4,Z(t.appConfig,(function(r){if(!dt(r))throw b.create("not-registered");var i=r.authToken;if(!e&&vt(i))return r;if(1===i.requestStatus)return n=lt(t,e),r;if(!navigator.onLine)throw b.create("app-offline");var o=mt(r);return n=pt(t,o),o}))];case 1:return r=a.sent(),n?[4,n]:[3,3];case 2:return o=a.sent(),[3,4];case 3:o=r.authToken,a.label=4;case 4:return i=o,[2,i]}}))}))}function lt(t,e){return(0,a.sH)(this,void 0,void 0,(function(){var n,r;return(0,a.YH)(this,(function(i){switch(i.label){case 0:return[4,ft(t.appConfig)];case 1:n=i.sent(),i.label=2;case 2:return 1!==n.authToken.requestStatus?[3,5]:[4,R(100)];case 3:return i.sent(),[4,ft(t.appConfig)];case 4:return n=i.sent(),[3,2];case 5:return r=n.authToken,0===r.requestStatus?[2,ht(t,e)]:[2,r]}}))}))}function ft(t){return Z(t,(function(t){if(!dt(t))throw b.create("not-registered");var e=t.authToken;return yt(e)?(0,a.Cl)((0,a.Cl)({},t),{authToken:{requestStatus:0}}):t}))}function pt(t,e){return(0,a.sH)(this,void 0,void 0,(function(){var n,r,i;return(0,a.YH)(this,(function(o){switch(o.label){case 0:return o.trys.push([0,3,,8]),[4,ut(t,e)];case 1:return n=o.sent(),i=(0,a.Cl)((0,a.Cl)({},e),{authToken:n}),[4,J(t.appConfig,i)];case 2:return o.sent(),[2,n];case 3:return r=o.sent(),!w(r)||401!==r.customData.serverCode&&404!==r.customData.serverCode?[3,5]:[4,$(t.appConfig)];case 4:return o.sent(),[3,7];case 5:return i=(0,a.Cl)((0,a.Cl)({},e),{authToken:{requestStatus:0}}),[4,J(t.appConfig,i)];case 6:o.sent(),o.label=7;case 7:throw r;case 8:return[2]}}
1821))}))}function dt(t){return void 0!==t&&2===t.registrationStatus}function vt(t){return 2===t.requestStatus&&!gt(t)}function gt(t){var e=Date.now();return e<t.creationTime||t.creationTime+t.expiresIn<e+v}function mt(t){var e={requestStatus:1,requestTime:Date.now()};return(0,a.Cl)((0,a.Cl)({},t),{authToken:e})}function yt(t){return 1===t.requestStatus&&t.requestTime+l<Date.now()} 1822/** 1823 * @license 1824 * Copyright 2019 Google LLC 1825 * 1826 * Licensed under the Apache License, Version 2.0 (the "License"); 1827 * you may not use this file except in compliance with the License. 1828 * You may obtain a copy of the License at 1829 * 1830 * http://www.apache.org/licenses/LICENSE-2.0 1831 * 1832 * Unless required by applicable law or agreed to in writing, software 1833 * distributed under the License is distributed on an "AS IS" BASIS, 1834 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1835 * See the License for the specific language governing permissions and 1836 * limitations under the License. 1837 */function bt(t){return(0,a.sH)(this,void 0,void 0,(function(){var e,n,r;return(0,a.YH)(this,(function(i){switch(i.label){case 0:return[4,tt(t.appConfig)];case 1:return e=i.sent(),n=e.installationEntry,r=e.registrationPromise,r?r.catch(console.error):ht(t).catch(console.error),[2,n.fid]}}))}))} 1838/** 1839 * @license 1840 * Copyright 2019 Google LLC 1841 * 1842 * Licensed under the Apache License, Version 2.0 (the "License"); 1843 * you may not use this file except in compliance with the License. 1844 * You may obtain a copy of the License at 1845 * 1846 * http://www.apache.org/licenses/LICENSE-2.0 1847 * 1848 * Unless required by applicable law or agreed to in writing, software 1849 * distributed under the License is distributed on an "AS IS" BASIS, 1850 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1851 * See the License for the specific language governing permissions and 1852 * limitations under the License. 1853 */function wt(t,e){return void 0===e&&(e=!1),(0,a.sH)(this,void 0,void 0,(function(){var n;return(0,a.YH)(this,(function(r){switch(r.label){case 0:return[4,_t(t.appConfig)];case 1:return r.sent(),[4,ht(t,e)];case 2:return n=r.sent(),[2,n.token]}}))}))}function _t(t){return(0,a.sH)(this,void 0,void 0,(function(){var e;return(0,a.YH)(this,(function(n){switch(n.label){case 0:return[4,tt(t)];case 1:return e=n.sent().registrationPromise,e?[4,e]:[3,3];case 2:n.sent(),n.label=3;case 3:return[2]}}
1853))}))} 1854/** 1855 * @license 1856 * Copyright 2019 Google LLC 1857 * 1858 * Licensed under the Apache License, Version 2.0 (the "License"); 1859 * you may not use this file except in compliance with the License. 1860 * You may obtain a copy of the License at 1861 * 1862 * http://www.apache.org/licenses/LICENSE-2.0 1863 * 1864 * Unless required by applicable law or agreed to in writing, software 1865 * distributed under the License is distributed on an "AS IS" BASIS, 1866 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1867 * See the License for the specific language governing permissions and 1868 * limitations under the License. 1869 */function It(t,e){return(0,a.sH)(this,void 0,void 0,(function(){var n,r,i,o;return(0,a.YH)(this,(function(a){switch(a.label){case 0:return n=Et(t,e),r=S(t,e),i={method:"DELETE",headers:r},[4,A((function(){return fetch(n,i)}))];case 1:return o=a.sent(),o.ok?[3,3]:[4,E("Delete Installation",o)];case 2:throw a.sent();case 3:return[2]}}))}))}function Et(t,e){var n=e.fid;return _(t)+"/"+n} 1870/** 1871 * @license 1872 * Copyright 2019 Google LLC 1873 * 1874 * Licensed under the Apache License, Version 2.0 (the "License"); 1875 * you may not use this file except in compliance with the License. 1876 * You may obtain a copy of the License at 1877 * 1878 * http://www.apache.org/licenses/LICENSE-2.0 1879 * 1880 * Unless required by applicable law or agreed to in writing, software 1881 * distributed under the License is distributed on an "AS IS" BASIS, 1882 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1883 * See the License for the specific language governing permissions and 1884 * limitations under the License. 1885 */function Tt(t){return(0,a.sH)(this,void 0,void 0,(function(){var e,n;return(0,a.YH)(this,(function(r){switch(r.label){case 0:return e=t.appConfig,[4,Z(e,(function(t){if(!t||0!==t.registrationStatus)return t}))];case 1:if(n=r.sent(),!n)return[3,6];if(1!==n.registrationStatus)return[3,2];throw b.create("delete-pending-registration");case 2:if(2!==n.registrationStatus)return[3,6];if(navigator.onLine)return[3,3];throw b.create("app-offline");case 3:return[4,It(e,n)];case 4:return r.sent(),[4,$(e)];case 5:r.sent(),r.label=6;case 6:return[2]}}
1885))}))} 1886/** 1887 * @license 1888 * Copyright 2019 Google LLC 1889 * 1890 * Licensed under the Apache License, Version 2.0 (the "License"); 1891 * you may not use this file except in compliance with the License. 1892 * You may obtain a copy of the License at 1893 * 1894 * http://www.apache.org/licenses/LICENSE-2.0 1895 * 1896 * Unless required by applicable law or agreed to in writing, software 1897 * distributed under the License is distributed on an "AS IS" BASIS, 1898 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1899 * See the License for the specific language governing permissions and 1900 * limitations under the License. 1901 */function St(t,e){var n=t.appConfig;return V(n,e),function(){H(n,e)}} 1902/** 1903 * @license 1904 * Copyright 2019 Google LLC 1905 * 1906 * Licensed under the Apache License, Version 2.0 (the "License"); 1907 * you may not use this file except in compliance with the License. 1908 * You may obtain a copy of the License at 1909 * 1910 * http://www.apache.org/licenses/LICENSE-2.0 1911 * 1912 * Unless required by applicable law or agreed to in writing, software 1913 * distributed under the License is distributed on an "AS IS" BASIS, 1914 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1915 * See the License for the specific language governing permissions and 1916 * limitations under the License. 1917 */function At(t){var e,n;if(!t||!t.options)throw kt("App Configuration");if(!t.name)throw kt("App Name");var r=["projectId","apiKey","appId"];try{for(var i=(0,a.Ju)(r),o=i.next();!o.done;o=i.next()){var s=o.value;if(!t.options[s])throw kt(s)}}catch(u){e={error:u}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return{appName:t.name,projectId:t.options.projectId,apiKey:t.options.apiKey,appId:t.options.appId}}function kt(t){return b.create("missing-app-config-values",{valueName:t})} 1918/** 1919 * @license 1920 * Copyright 2019 Google LLC 1921 * 1922 * Licensed under the Apache License, Version 2.0 (the "License"); 1923 * you may not use this file except in compliance with the License. 1924 * You may obtain a copy of the License at 1925 * 1926 * http://www.apache.org/licenses/LICENSE-2.0 1927 * 1928 * Unless required by applicable law or agreed to in writing, software 1929 * distributed under the License is distributed on an "AS IS" BASIS, 1930 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1931 * See the License for the specific language governing permissions and 1932 * limitations under the License. 1933 */function Nt(t){var e="installations";t.INTERNAL.registerComponent(new o.uA(e,(function(t){var e=t.getProvider("app").getImmediate(),n=At(e),r=t.getProvider("platform-logger"),i={appConfig:n,platformLoggerProvider:r},o={app:e,getId:function(){return bt(i)},getToken:function(t){return wt(i,t)},delete:function(){return Tt(i)},onIdChange:function(t){return St(i,t)}};return o}
1933),"PUBLIC")),t.registerVersion(c,h)}Nt(i.A);var Ct,Rt=n(32477),Ot=function(){function t(t,e,n,r){this.client=t,this.storage=e,this.storageCache=n,this.logger=r}return t.prototype.isCachedDataFresh=function(t,e){if(!e)return this.logger.debug("Config fetch cache check. Cache unpopulated."),!1;var n=Date.now()-e,r=n<=t;return this.logger.debug("Config fetch cache check. Cache age millis: "+n+". Cache max age millis (minimumFetchIntervalMillis setting): "+t+". Is cache hit: "+r+"."),r},t.prototype.fetch=function(t){return(0,a.sH)(this,void 0,void 0,(function(){var e,n,r,i,o;return(0,a.YH)(this,(function(a){switch(a.label){case 0:return[4,Promise.all([this.storage.getLastSuccessfulFetchTimestampMillis(),this.storage.getLastSuccessfulFetchResponse()])];case 1:return e=a.sent(),n=e[0],r=e[1],r&&this.isCachedDataFresh(t.cacheMaxAgeMillis,n)?[2,r]:(t.eTag=r&&r.eTag,[4,this.client.fetch(t)]);case 2:return i=a.sent(),o=[this.storageCache.setLastSuccessfulFetchTimestampMillis(Date.now())],200===i.status&&o.push(this.storage.setLastSuccessfulFetchResponse(i)),[4,Promise.all(o)];case 3:return a.sent(),[2,i]}}))}))},t}(),Dt=(Ct={},Ct["registration-window"]="Undefined window object. This SDK only supports usage in a browser environment.",Ct["registration-project-id"]="Undefined project identifier. Check Firebase app initialization.",Ct["registration-api-key"]="Undefined API key. Check Firebase app initialization.",Ct["registration-app-id"]="Undefined app identifier. Check Firebase app initialization.",Ct["storage-open"]="Error thrown when opening storage. Original error: {$originalErrorMessage}.",Ct["storage-get"]="Error thrown when reading from storage. Original error: {$originalErrorMessage}.",Ct["storage-set"]="Error thrown when writing to storage. Original error: {$originalErrorMessage}.",Ct["storage-delete"]="Error thrown when deleting from storage. Original error: {$originalErrorMessage}.",Ct["fetch-client-network"]="Fetch client failed to connect to a network. Check Internet connection. Original error: {$originalErrorMessage}.",Ct["fetch-timeout"]='The config fetch request timed out. Configure timeout using "fetchTimeoutMillis" SDK setting.',Ct["fetch-throttle"]='The config fetch request timed out while in an exponential backoff state. Configure timeout using "fetchTimeoutMillis" SDK setting. Unix timestamp in milliseconds when fetch request throttling ends: {$throttleEndTimeMillis}.',Ct["fetch-client-parse"]="Fetch client could not parse response. Original error: {$originalErrorMessage}.",Ct["fetch-status"]="Fetch server returned an HTTP error status. HTTP status: {$httpStatus}.",Ct),Pt=new s.FA("remoteconfig","Remote Config",Dt);function Lt(t,e){return t instanceof s.g&&-1!==t.code.indexOf(e)} 1934/** 1935 * @license 1936 * Copyright 2019 Google LLC 1937 * 1938 * Licensed under the Apache License, Version 2.0 (the "License"); 1939 * you may not use this file except in compliance with the License. 1940 * You may obtain a copy of the License at 1941 * 1942 * http://www.apache.org/licenses/LICENSE-2.0 1943 * 1944 * Unless required by applicable law or agreed to in writing, software 1945 * distributed under the License is distributed on an "AS IS" BASIS, 1946 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1947 * See the License for the specific language governing permissions and 1948 * limitations under the License. 1949 */function xt(t){return void 0===t&&(t=navigator),t.languages&&t.languages[0]||t.language} 1950/** 1951 * @license 1952 * Copyright 2019 Google LLC 1953 * 1954 * Licensed under the Apache License, Version 2.0 (the "License"); 1955 * you may not use this file except in compliance with the License. 1956 * You may obtain a copy of the License at 1957 * 1958 * http://www.apache.org/licenses/LICENSE-2.0 1959 * 1960 * Unless required by applicable law or agreed to in writing, software 1961 * distributed under the License is distributed on an "AS IS" BASIS, 1962 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1963 * See the License for the specific language governing permissions and 1964 * limitations under the License. 1965 */var Mt=function(){function t(t,e,n,r,i,o){this.firebaseInstallations=t,this.sdkVersion=e,this.namespace=n,this.projectId=r,this.apiKey=i,this.appId=o}return t.prototype.fetch=function(t){return(0,a.sH)(this,void 0,void 0,(function(){var e,n,r,i,o,s,u,c,h,l,f,p,d,v,g,m,y,b,w;return(0,a.YH)(this,(function(a){switch(a.label){case 0:return[4,Promise.all([this.firebaseInstallations.getId(),this.firebaseInstallations.getToken()])];case 1:e=a.sent(),n=e[0],r=e[1],i=window.FIREBASE_REMOTE_CONFIG_URL_BASE||"https://firebaseremoteconfig.googleapis.com",o=i+"/v1/projects/"+this.projectId+"/namespaces/"+this.namespace+":fetch?ke
1965y="+this.apiKey,s={"Content-Type":"application/json","Content-Encoding":"gzip","If-None-Match":t.eTag||"*"},u={sdk_version:this.sdkVersion,app_instance_id:n,app_instance_id_token:r,app_id:this.appId,language_code:xt()},c={method:"POST",headers:s,body:JSON.stringify(u)},h=fetch(o,c),l=new Promise((function(e,n){t.signal.addEventListener((function(){var t=new Error("The operation was aborted.");t.name="AbortError",n(t)}))})),a.label=2;case 2:return a.trys.push([2,5,,6]),[4,Promise.race([h,l])];case 3:return a.sent(),[4,h];case 4:return f=a.sent(),[3,6];case 5:throw p=a.sent(),d="fetch-client-network","AbortError"===p.name&&(d="fetch-timeout"),Pt.create(d,{originalErrorMessage:p.message});case 6:if(v=f.status,g=f.headers.get("ETag")||void 0,200!==f.status)return[3,11];b=void 0,a.label=7;case 7:return a.trys.push([7,9,,10]),[4,f.json()];case 8:return b=a.sent(),[3,10];case 9:throw w=a.sent(),Pt.create("fetch-client-parse",{originalErrorMessage:w.message});case 10:m=b["entries"],y=b["state"],a.label=11;case 11:if("INSTANCE_STATE_UNSPECIFIED"===y?v=500:"NO_CHANGE"===y?v=304:"NO_TEMPLATE"!==y&&"EMPTY_CONFIG"!==y||(m={}),304!==v&&200!==v)throw Pt.create("fetch-status",{httpStatus:v});return[2,{status:v,eTag:g,config:m}]}}))}))},t}(),Ut=function(){function t(){this.listeners=[]}return t.prototype.addEventListener=function(t){this.listeners.push(t)},t.prototype.abort=function(){this.listeners.forEach((function(t){return t()}))},t}(),Ft=!1,Vt="",Ht=0,jt=["1","true","t","yes","y","on"],qt=function(){function t(t,e){void 0===e&&(e=Vt),this._source=t,this._value=e}return t.prototype.asString=function(){return this._value},t.prototype.asBoolean=function(){return"static"===this._source?Ft:jt.indexOf(this._value.toLowerCase())>=0},t.prototype.asNumber=function(){if("static"===this._source)return Ht;var t=Number(this._value);return isNaN(t)&&(t=Ht),t},t.prototype.getSource=function(){return this._source},t}(),Bt=6e4,Kt=432e5,Gt=function(){function t(t,e,n,r,i){this.app=t,this._client=e,this._storageCache=n,this._storage=r,this._logger=i,this._isInitializationComplete=!1,this.settings={fetchTimeoutMillis:Bt,minimumFetchIntervalMillis:Kt},this.defaultConfig={}}return t.prototype.setLogLevel=function(t){switch(t){case"debug":this._logger.logLevel=Rt.$b.DEBUG;break;case"silent":this._logger.logLevel=Rt.$b.SILENT;break;default:this._logger.logLevel=Rt.$b.ERROR}},Object.defineProperty(t.prototype,"fetchTimeMillis",{get:function(){return this._storageCache.getLastSuccessfulFetchTimestampMillis()||-1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastFetchStatus",{get:function(){return this._storageCache.getLastFetchStatus()||"no-fetch-yet"},enumerable:!1,configurable:!0}),t.prototype.activate=function(){return(0,a.sH)(this,void 0,void 0,(function(){var t,e,n;return(0,a.YH)(this,(function(r){switch(r.label){case 0:return[4,Promise.all([this._storage.getLastSuccessfulFetchResponse(),this._storage.getActiveConfigEtag()])];case 1:return t=r.sent(),e=t[0],n=t[1],e&&e.config&&e.eTag&&e.eTag!==n?[4,Promise.all([this._storageCache.setActiveConfig(e.config),this._storage.setActiveConfigEtag(e.eTag)])]:[2,!1];case 2:return r.sent(),[2,!0]}}))}))},t.prototype.ensureInitialized=function(){var t=this;return this._initializePromise||(this._initializePromise=this._storageCache.loadFromStorage().then((function(){t._isInitializationComplete=!0}))),this._initializePromise},t.prototype.fetch=function(){return(0,a.sH)(this,void 0,void 0,(function(){var t,e,n,r=this;return(0,a.YH)(this,(function(i){switch(i.label){case 0:t=new Ut,setTimeout((function(){return(0,a.sH)(r,void 0,void 0,(function(){return(0,a.YH)(this,(function(e){return t.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:t})];case 2:return i.sent(),[4,this._storageCache.setLastFetchStatus("success")];case 3:return i.sent(),[3,6];case 4:return e=i.sent(),n=Lt(e,"fetch-throttle")?"throttle":"failure",[4,this._storageCache.setLastFetchStatus(n)];case 5:throw i.sent(),e;case 6:return[2]}}
1965))}))},t.prototype.fetchAndActivate=function(){return(0,a.sH)(this,void 0,void 0,(function(){return(0,a.YH)(this,(function(t){switch(t.label){case 0:return[4,this.fetch()];case 1:return t.sent(),[2,this.activate()]}}))}))},t.prototype.getAll=function(){var t=this;return Yt(this._storageCache.getActiveConfig(),this.defaultConfig).reduce((function(e,n){return e[n]=t.getValue(n),e}),{})},t.prototype.getBoolean=function(t){return this.getValue(t).asBoolean()},t.prototype.getNumber=function(t){return this.getValue(t).asNumber()},t.prototype.getString=function(t){return this.getValue(t).asString()},t.prototype.getValue=function(t){this._isInitializationComplete||this._logger.debug('A value was requested for key "'+t+'" before SDK initialization completed. Await on ensureInitialized if the intent was to get a previously activated value.');var e=this._storageCache.getActiveConfig();return e&&void 0!==e[t]?new qt("remote",e[t]):this.defaultConfig&&void 0!==this.defaultConfig[t]?new qt("default",String(this.defaultConfig[t])):(this._logger.debug('Returning static value for key "'+t+'". Define a default or remote value if this is unintentional.'),new qt("static"))},t}(); 1966/** 1967 * @license 1968 * Copyright 2019 Google LLC 1969 * 1970 * Licensed under the Apache License, Version 2.0 (the "License"); 1971 * you may not use this file except in compliance with the License. 1972 * You may obtain a copy of the License at 1973 * 1974 * http://www.apache.org/licenses/LICENSE-2.0 1975 * 1976 * Unless required by applicable law or agreed to in writing, software 1977 * distributed under the License is distributed on an "AS IS" BASIS, 1978 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1979 * See the License for the specific language governing permissions and 1980 * limitations under the License. 1981 */function Yt(t,e){return void 0===t&&(t={}),void 0===e&&(e={}),Object.keys((0,a.Cl)((0,a.Cl)({},t),e))} 1982/** 1983 * @license 1984 * Copyright 2019 Google LLC 1985 * 1986 * Licensed under the Apache License, Version 2.0 (the "License"); 1987 * you may not use this file except in compliance with the License. 1988 * You may obtain a copy of the License at 1989 * 1990 * http://www.apache.org/licenses/LICENSE-2.0 1991 * 1992 * Unless required by applicable law or agreed to in writing, software 1993 * distributed under the License is distributed on an "AS IS" BASIS, 1994 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1995 * See the License for the specific language governing permissions and 1996 * limitations under the License. 1997 */function zt(t,e){var n=t.target.error||void 0;return Pt.create(e,{originalErrorMessage:n&&n.message})}var Wt="app_namespace_store",Xt="firebase_remote_config",Qt=1;function Jt(){return new Promise((function(t,e){var n=indexedDB.open(Xt,Qt);n.onerror=function(t){e(zt(t,"storage-open"))},n.onsuccess=function(e){t(e.target.result)},n.onupgradeneeded=function(t){var e=t.target.result;switch(t.oldVersion){case 0:e.createObjectStore(Wt,{keyPath:"compositeKey"})}}}))}var $t=function(){function t(t,e,n,r){void 0===r&&(r=Jt()),this.appId=t,this.appName=e,this.namespace=n,this.openDbPromise=r}return t.prototype.getLastFetchStatus=function(){return this.get("last_fetch_status")},t.prototype.setLastFetchStatus=function(t){return this.set("last_fetch_status",t)},t.prototype.getLastSuccessfulFetchTimestampMillis=function(){return this.get("last_successful_fetch_timestamp_millis")},t.prototype.setLastSuccessfulFetchTimestampMillis=function(t){return this.set("last_successful_fetch_timestamp_millis",t)},t.prototype.getLastSuccessfulFetchResponse=function(){return this.get("last_successful_fetch_response")},t.prototype.setLastSuccessfulFetchResponse=function(t){return this.set("last_successful_fetch_response",t)},t.prototype.getActiveConfig=function(){return this.get("active_config")},t.prototype.setActiveConfig=function(t){return this.set("active_config",t)},t.prototype.getActiveConfigEtag=function(){return this.get("active_config_etag")},t.prototype.setActiveConfigEtag=function(t){return this.set("active_config_etag",t)},t.prototype.getThrottleMetadata=function(){return this.get("throttle_metadata")},t.prototype.setThrottleMetadata=function(t){return this.set("throttle_metadata",t)},t.prototype.deleteThrottleMetadata=function(){return this.delete("throttle_metadata")},t.prototype.get=function(t){return(0,a.sH)(this,void 0,void 0,(function(){var e,n=this;return(0,a.YH)(this,(function(r){switch(r.label){case 0:return[4,this.openDbPromise];case 1:return e=r.sent(),[2,new Promise((function(r,i){var o=e.transaction([Wt],"readonly"),a=o.objectStore(Wt),s=n.createCompositeKey(t);try{var u=a.get(s);u.onerror=function(t){i(zt(t,"storage-get"))},u.onsuccess=function(t){var e=t.target.result;r(e?e.value:void 0)}}catch(c){i(Pt.create("storage-get",{originalErrorMessage:c&&c.message}))}}))]}}))}))},t.prototype.set=function(t,e){return(0,a.sH)(this,void 0,void 0,(function(){var n,r=this;return(0,a.YH)(this,(function(i){switch(i.label){case 0:return[4,this.openDbPromise];case 1:return n=i.sent(),[2,new Promise((function(i,o){var a=n.transaction([Wt],"readwrite"),s=a.objectStore(Wt),u=r.createCompositeKey(t);try{var c=s.put({compositeKey:u,value:e});c.onerror=function(t){o(zt(t,"storage-set"))},c.onsuccess=function(){i()}}catch(h){o(Pt.create("storage-set",{originalErrorMessage:h&&h.message}))}}))]}}))}))},t.prototype.delete=function(t){return(0,a.sH)(this,void 0,void 0,(function(){var e,n=this;return(0,a.YH)(this,(function(r){switch(r.label){case 0:return[4,this.openDbPromise];case 1:return e=r.sent(),[2,new Promise((function(r,i){var o=e.transaction([Wt],"readwrite"),a=o.objectStore(Wt),s=n.createCompositeKey(t);try{var u=a.delete(s);u.onerror=function(t){i(zt(t,"storage-delete"))},u.onsuccess=function(){r()}}catch(c){i(Pt.create("storage-delete",{originalErrorMessage:c&&c.message}))}}))]}}))}))},t.prototype.createCompositeKey=function(t){return[this.appId,this.appName,this.namespace,t].join()},t}(),Zt=function(){function t(t){this.storage=t}return t.prototype.getLastFetchStatus=function(){return this.lastFetchStatus},t.prototype.getLastSuccessfulFetchTimestampMillis=function(){return this.lastSuccessfulFetchTimestampMillis},t.prototype.getActiveConfig=function(){return this.activeConfig},t.prototype.loadFromStorage=function(){return(0,a.sH)(this,void 0,void 0,(function(){var t,e,n,r,i,o;return(0,a.YH)(this,(function(a){switch(a.label){case 0:return t=this.storage.getLastFetchStatus(),e=this.storage.getLastSuccessfulFetchTimestampMillis(),n=this.storage.getActiveConfig(),[4,t];case 1:return r=a.sent(),r&&(this.lastFetchStatus=r),[4,e];case 2:return i=a.sent(),i&&(this.lastSuccessfulFetchTimestampMillis=i),[4,n];case 3:return o=a.sent(),o&&(this.activeConfig=o),[2]}}))}))},t.prototype.setLastFetchStatus=function(t){return this.lastFetchStatus=t,this.storage.setLastFetchStatus(t)},t.prototype.setLastSuccessfulFetchTimestampMillis=function(t){return this.lastSuccessfulFetchTimestampMillis=t,this.storage.setLastSuccessfulFetchTimestampMillis(t)},t.prototype.setActiveConfig=function(t){return this.activeConfig=t,this.storage.setActiveConfig(t)},t}(); 1998/** 1999 * @license 2000 * Copyright 2019 Google LLC 2001 * 2002 * Licensed under the Apache License, Version 2.0 (the "License");
2003 * you may not use this file except in compliance with the License. 2004 * You may obtain a copy of the License at 2005 * 2006 * http://www.apache.org/licenses/LICENSE-2.0 2007 * 2008 * Unless required by applicable law or agreed to in writing, software 2009 * distributed under the License is distributed on an "AS IS" BASIS, 2010 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2011 * See the License for the specific language governing permissions and 2012 * limitations under the License. 2013 */ 2014/** 2015 * @license 2016 * Copyright 2019 Google LLC 2017 * 2018 * Licensed under the Apache License, Version 2.0 (the "License"); 2019 * you may not use this file except in compliance with the License. 2020 * You may obtain a copy of the License at 2021 * 2022 * http://www.apache.org/licenses/LICENSE-2.0 2023 * 2024 * Unless required by applicable law or agreed to in writing, software 2025 * distributed under the License is distributed on an "AS IS" BASIS, 2026 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2027 * See the License for the specific language governing permissions and 2028 * limitations under the License. 2029 */ 2030function te(t,e){return new Promise((function(n,r){var i=Math.max(e-Date.now(),0),o=setTimeout(n,i);t.addEventListener((function(){clearTimeout(o),r(Pt.create("fetch-throttle",{throttleEndTimeMillis:e}))}))}))}function ee(t){if(!(t instanceof s.g)||!t.customData)return!1;var e=Number(t.customData["httpStatus"]);return 429===e||500===e||503===e||504===e}var ne=function(){function t(t,e){this.client=t,this.storage=e}return t.prototype.fetch=function(t){return(0,a.sH)(this,void 0,void 0,(function(){var e;return(0,a.YH)(this,(function(n){switch(n.label){case 0:return[4,this.storage.getThrottleMetadata()];case 1:return e=n.sent()||{backoffCount:0,throttleEndTimeMillis:Date.now()},[2,this.attemptFetch(t,e)]}}))}))},t.prototype.attemptFetch=function(t,e){var n=e.throttleEndTimeMillis,r=e.backoffCount;return(0,a.sH)(this,void 0,void 0,(function(){var e,i,o;return(0,a.YH)(this,(function(a){switch(a.label){case 0:return[4,te(t.signal,n)];case 1:a.sent(),a.label=2;case 2:return a.trys.push([2,5,,7]),[4,this.client.fetch(t)];case 3:return e=a.sent(),[4,this.storage.deleteThrottleMetadata()];case 4:return a.sent(),[2,e];case 5:if(i=a.sent(),!ee(i))throw i;return o={throttleEndTimeMillis:Date.now()+(0,s.p9)(r),backoffCount:r+1},[4,this.storage.setThrottleMetadata(o)];case 6:return a.sent(),[2,this.attemptFetch(t,o)];case 7:return[2]}}
2030))}))},t}(),re="@firebase/remote-config",ie="0.1.37"; 2031/** 2032 * @license 2033 * Copyright 2019 Google LLC 2034 * 2035 * Licensed under the Apache License, Version 2.0 (the "License"); 2036 * you may not use this file except in compliance with the License. 2037 * You may obtain a copy of the License at 2038 * 2039 * http://www.apache.org/licenses/LICENSE-2.0 2040 * 2041 * Unless required by applicable law or agreed to in writing, software 2042 * distributed under the License is distributed on an "AS IS" BASIS, 2043 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2044 * See the License for the specific language governing permissions and 2045 * limitations under the License. 2046 */ 2047function oe(t){function e(e,n){var r=n.instanceIdentifier,i=e.getProvider("app").getImmediate(),o=e.getProvider("installations").getImmediate();if("undefined"===typeof window)throw Pt.create("registration-window");var a=i.options,s=a.projectId,u=a.apiKey,c=a.appId;if(!s)throw Pt.create("registration-project-id");if(!u)throw Pt.create("registration-api-key");if(!c)throw Pt.create("registration-app-id");r=r||"firebase";var h=new $t(c,i.name,r),l=new Zt(h),f=new Rt.Vy(re);f.logLevel=Rt.$b.ERROR;var p=new Mt(o,t.SDK_VERSION,r,s,u,c),d=new ne(p,h),v=new Ot(d,h,l,f),g=new Gt(i,v,l,h,f);return g.ensureInitialized(),g}t.INTERNAL.registerComponent(new o.uA("remoteConfig",e,"PUBLIC").setMultipleInstances(!0)),t.registerVersion(re,ie)}oe(i.A)},50813:function(t,e,n){var r=n(49998),i=n(15215),o=n(51625),a=n(51134),s="firebasestorage.googleapis.com",u="storageBucket",c=12e4,h=6e5,l=function(t){function e(n,r){var i=t.call(this,f(n),"Firebase Storage: "+r+" ("+f(n)+")")||this;return i.customData={serverResponse:null},i._baseMessage=i.message,Object.setPrototypeOf(i,e.prototype),i}return(0,i.C6)(e,t),e.prototype._codeEquals=function(t){return f(t)===this.code},Object.defineProperty(e.prototype,"serverResponse",{get:function(){return this.customData.serverResponse},set:function(t){this.customData.serverResponse=t,this.customData.serverResponse?this.message=this._baseMessage+"\n"+this.customData.serverResponse:this.message=this._baseMessage},enumerable:!1,configurable:!0}),e}(o.g);function f(t){return"storage/"+t}function p(){var t="An unknown error occurred, please check the error payload for server response.";return new l("unknown",t)}function d(t){return new l("object-not-found","Object '"+t+"' does not exist.")}function v(t){return new l("quota-exceeded","Quota for bucket '"+t+"' exceeded, please view quota on https://firebase.google.com/pricing/.")}function g(){var t="User is not authenticated, please authenticate using Firebase Authentication and try again.";return new l("unauthenticated",t)}function m(){return new l("unauthorized-app","This app does not have permission to access Firebase Storage on this project.")}function y(t){return new l("unauthorized","User does not have permission to access '"+t+"'.")}function b(){return new l("retry-limit-exceeded","Max retry time for operation exceeded, please try again.")}function w(){return new l("canceled","User canceled the upload/download.")}function _(t){return new l("invalid-url","Invalid URL '"+t+"'.")}function I(t){return new l("invalid-default-bucket","Invalid default bucket '"+t+"'.")}function E(){return new l("no-default-bucket","No default bucket found. Did you set the '"+u+"' property when initializing the app?")}function T(){return new l("cannot-slice-blob","Cannot slice blob for upload. Please retry the upload.")}function S(){return new l("server-file-wrong-size","Server recorded incorrect upload file size, please retry the upload.")}function A(){return new l("no-download-url","The given file does not have any download URLs.")}function k(t){return new l("invalid-argument",t)}function N(){return new l("app-deleted","The Firebase app was deleted.")}function C(t){return new l("invalid-root-operation","The operation '"+t+"' cannot be performed on a root reference, create a non-root reference using child, such as .child('file.png').")}function R(t,e){return new l("invalid-format","String does not match format '"+t+"': "+e)}function O(t){throw new l("internal-error","Internal error: "+t)} 2048/** 2049 * @license 2050 * Copyright 2017 Google LLC 2051 * 2052 * Licensed under the Apache License, Version 2.0 (the "License");
2053 * you may not use this file except in compliance with the License. 2054 * You may obtain a copy of the License at 2055 * 2056 * http://www.apache.org/licenses/LICENSE-2.0 2057 * 2058 * Unless required by applicable law or agreed to in writing, software 2059 * distributed under the License is distributed on an "AS IS" BASIS, 2060 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2061 * See the License for the specific language governing permissions and 2062 * limitations under the License. 2063 */var D={RAW:"raw",BASE64:"base64",BASE64URL:"base64url",DATA_URL:"data_url"},P=function(){function t(t,e){this.data=t,this.contentType=e||null}return t}();function L(t,e){switch(t){case D.RAW:return new P(x(e));case D.BASE64:case D.BASE64URL:return new P(U(t,e));case D.DATA_URL:return new P(V(e),H(e))}throw p()}function x(t){for(var e=[],n=0;n<t.length;n++){var r=t.charCodeAt(n);if(r<=127)e.push(r);else if(r<=2047)e.push(192|r>>6,128|63&r);else if(55296===(64512&r)){var i=n<t.length-1&&56320===(64512&t.charCodeAt(n+1));if(i){var o=r,a=t.charCodeAt(++n);r=65536|(1023&o)<<10|1023&a,e.push(240|r>>18,128|r>>12&63,128|r>>6&63,128|63&r)}else e.push(239,191,189)}else 56320===(64512&r)?e.push(239,191,189):e.push(224|r>>12,128|r>>6&63,128|63&r)}return new Uint8Array(e)}function M(t){var e;try{e=decodeURIComponent(t)}catch(n){throw R(D.DATA_URL,"Malformed data URL.")}return x(e)}function U(t,e){switch(t){case D.BASE64:var n=-1!==e.indexOf("-"),r=-1!==e.indexOf("_");if(n||r){var i=n?"-":"_";throw R(t,"Invalid character '"+i+"' found: is it base64url encoded?")}break;case D.BASE64URL:var o=-1!==e.indexOf("+"),a=-1!==e.indexOf("/");if(o||a){i=o?"+":"/";throw R(t,"Invalid character '"+i+"' found: is it base64 encoded?")}e=e.replace(/-/g,"+").replace(/_/g,"/");break}var s;try{s=atob(e)}catch(h){throw R(t,"Invalid character found")}for(var u=new Uint8Array(s.length),c=0;c<s.length;c++)u[c]=s.charCodeAt(c);return u}var F=function(){function t(t){this.base64=!1,this.contentType=null;var e=t.match(/^data:([^,]+)?,/);if(null===e)throw R(D.DATA_URL,"Must be formatted 'data:[<mediatype>][;base64],<data>");var n=e[1]||null;null!=n&&(this.base64=j(n,";base64"),this.contentType=this.base64?n.substring(0,n.length-7):n),this.rest=t.substring(t.indexOf(",")+1)}return t}();function V(t){var e=new F(t);return e.base64?U(D.BASE64,e.rest):M(e.rest)}function H(t){var e=new F(t);return e.contentType}function j(t,e){var n=t.length>=e.length;return!!n&&t.substring(t.length-e.length)===e} 2064/** 2065 * @license 2066 * Copyright 2017 Google LLC 2067 * 2068 * Licensed under the Apache License, Version 2.0 (the "License"); 2069 * you may not use this file except in compliance with the License. 2070 * You may obtain a copy of the License at 2071 * 2072 * http://www.apache.org/licenses/LICENSE-2.0 2073 * 2074 * Unless required by applicable law or agreed to in writing, software 2075 * distributed under the License is distributed on an "AS IS" BASIS, 2076 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2077 * See the License for the specific language governing permissions and 2078 * limitations under the License. 2079 */var q,B={STATE_CHANGED:"state_changed"},K={RUNNING:"running",PAUSED:"paused",SUCCESS:"success",CANCELED:"canceled",ERROR:"error"};function G(t){switch(t){case"running":case"pausing":case"canceling":return K.RUNNING;case"paused":return K.PAUSED;case"success":return K.SUCCESS;case"canceled":return K.CANCELED;case"error":return K.ERROR;default:return K.ERROR}} 2080/** 2081 * @license 2082 * Copyright 2017 Google LLC 2083 * 2084 * Licensed under the Apache License, Version 2.0 (the "License"); 2085 * you may not use this file except in compliance with the License. 2086 * You may obtain a copy of the License at 2087 * 2088 * http://www.apache.org/licenses/LICENSE-2.0 2089 * 2090 * Unless required by applicable law or agreed to in writing, software 2091 * distributed under the License is distributed on an "AS IS" BASIS, 2092 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2093 * See the License for the specific language governing permissions and 2094 * limitations under the License.
2095 */(function(t){t[t["NO_ERROR"]=0]="NO_ERROR",t[t["NETWORK_ERROR"]=1]="NETWORK_ERROR",t[t["ABORT"]=2]="ABORT"})(q||(q={})); 2096/** 2097 * @license 2098 * Copyright 2017 Google LLC 2099 * 2100 * Licensed under the Apache License, Version 2.0 (the "License"); 2101 * you may not use this file except in compliance with the License. 2102 * You may obtain a copy of the License at 2103 * 2104 * http://www.apache.org/licenses/LICENSE-2.0 2105 * 2106 * Unless required by applicable law or agreed to in writing, software 2107 * distributed under the License is distributed on an "AS IS" BASIS, 2108 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2109 * See the License for the specific language governing permissions and 2110 * limitations under the License. 2111 */ 2112var Y=function(){function t(){var t=this;this.sent_=!1,this.xhr_=new XMLHttpRequest,this.errorCode_=q.NO_ERROR,this.sendPromise_=new Promise((function(e){t.xhr_.addEventListener("abort",(function(){t.errorCode_=q.ABORT,e(t)})),t.xhr_.addEventListener("error",(function(){t.errorCode_=q.NETWORK_ERROR,e(t)})),t.xhr_.addEventListener("load",(function(){e(t)}))}))}return t.prototype.send=function(t,e,n,r){if(this.sent_)throw O("cannot .send() more than once");if(this.sent_=!0,this.xhr_.open(e,t,!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_},t.prototype.getErrorCode=function(){if(!this.sent_)throw O("cannot .getErrorCode() before sending");return this.errorCode_},t.prototype.getStatus=function(){if(!this.sent_)throw O("cannot .getStatus() before sending");try{return this.xhr_.status}catch(t){return-1}},t.prototype.getResponseText=function(){if(!this.sent_)throw O("cannot .getResponseText() before sending");return this.xhr_.responseText},t.prototype.abort=function(){this.xhr_.abort()},t.prototype.getResponseHeader=function(t){return this.xhr_.getResponseHeader(t)},t.prototype.addUploadProgressListener=function(t){null!=this.xhr_.upload&&this.xhr_.upload.addEventListener("progress",t)},t.prototype.removeUploadProgressListener=function(t){null!=this.xhr_.upload&&this.xhr_.upload.removeEventListener("progress",t)},t}(),z=function(){function t(){}return t.prototype.createXhrIo=function(){return new Y},t}(),W=function(){function t(t,e){this.bucket=t,this.path_=e}return Object.defineProperty(t.prototype,"path",{get:function(){return this.path_},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isRoot",{get:function(){return 0===this.path.length},enumerable:!1,configurable:!0}),t.prototype.fullServerUrl=function(){var t=encodeURIComponent;return"/b/"+t(this.bucket)+"/o/"+t(this.path)},t.prototype.bucketOnlyServerUrl=function(){var t=encodeURIComponent;return"/b/"+t(this.bucket)+"/o"},t.makeFromBucketSpec=function(e,n){var r;try{r=t.makeFromUrl(e,n)}catch(i){return new t(e,"")}if(""===r.path)return r;throw I(e)},t.makeFromUrl=function(e,n){var r=null,i="([A-Za-z0-9.\\-_]+)";function o(t){"/"===t.path.charAt(t.path.length-1)&&(t.path_=t.path_.slice(0,-1))}var a="(/(.*))?$",u=new RegExp("^gs://"+i+a,"i"),c={bucket:1,path:3};function h(t){t.path_=decodeURIComponent(t.path)}for(var l="v[A-Za-z0-9_]+",f=n.replace(/[.]/g,"\\."),p="(/([^?#]*).*)?$",d=new RegExp("^https?://"+f+"/"+l+"/b/"+i+"/o"+p,"i"),v={bucket:1,path:3},g=n===s?"(?:storage.googleapis.com|storage.cloud.google.com)":n,m="([^?#]*)",y=new RegExp("^https?://"+g+"/"+i+"/"+m,"i"),b={bucket:1,path:2},w=[{regex:u,indices:c,postModify:o},{regex:d,indices:v,postModify:h},{regex:y,indices:b,postModify:h}],I=0;I<w.length;I++){var E=w[I],T=E.regex.exec(e);if(T){var S=T[E.indices.bucket],A=T[E.indices.path];A||(A=""),r=new t(S,A),E.postModify(r);break}}if(null==r)throw _(e);return r},t}(),X=function(){function t(t){this.promise_=Promise.reject(t)}return t.prototype.getPromise=function(){return this.promise_},t.prototype.cancel=function(t){},t}(); 2113/** 2114 * @license 2115 * Copyright 2017 Google LLC 2116 * 2117 * Licensed under the Apache License, Version 2.0 (the "License"); 2118 * you may not use this file except in compliance with the License. 2119 * You may obtain a copy of the License at 2120 * 2121 * http://www.apache.org/licenses/LICENSE-2.0 2122 * 2123 * Unless required by applicable law or agreed to in writing, softw
2123are 2124 * distributed under the License is distributed on an "AS IS" BASIS, 2125 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2126 * See the License for the specific language governing permissions and 2127 * limitations under the License. 2128 */ 2129/** 2130 * @license 2131 * Copyright 2017 Google LLC 2132 * 2133 * Licensed under the Apache License, Version 2.0 (the "License"); 2134 * you may not use this file except in compliance with the License. 2135 * You may obtain a copy of the License at 2136 * 2137 * http://www.apache.org/licenses/LICENSE-2.0 2138 * 2139 * Unless required by applicable law or agreed to in writing, software 2140 * distributed under the License is distributed on an "AS IS" BASIS, 2141 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2142 * See the License for the specific language governing permissions and 2143 * limitations under the License. 2144 */ 2145function Q(t,e,n){var r=1,o=null,a=!1,s=0;function u(){return 2===s}var c=!1;function h(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];c||(c=!0,e.apply(null,t))}function l(e){o=setTimeout((function(){o=null,t(f,u())}),e)}function f(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(!c)if(t)h.call.apply(h,(0,i.fX)([null,t],e));else{var o,f=u()||a;if(f)h.call.apply(h,(0,i.fX)([null,t],e));else r<64&&(r*=2),1===s?(s=2,o=0):o=1e3*(r+Math.random()),l(o)}}var p=!1;function d(t){p||(p=!0,c||(null!==o?(t||(s=2),clearTimeout(o),l(0)):t||(s=1)))}return l(0),setTimeout((function(){a=!0,d(!0)}),n),d}function J(t){t(!1)} 2146/** 2147 * @license 2148 * Copyright 2017 Google LLC 2149 * 2150 * Licensed under the Apache License, Version 2.0 (the "License"); 2151 * you may not use this file except in compliance with the License. 2152 * You may obtain a copy of the License at 2153 * 2154 * http://www.apache.org/licenses/LICENSE-2.0 2155 * 2156 * Unless required by applicable law or agreed to in writing, software 2157 * distributed under the License is distributed on an "AS IS" BASIS, 2158 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2159 * See the License for the specific language governing permissions and 2160 * limitations under the License. 2161 */function $(t){return void 0!==t}function Z(t){return"function"===typeof t}function tt(t){return"object"===typeof t&&!Array.isArray(t)}function et(t){return"string"===typeof t||t instanceof String}function nt(t){return rt()&&t instanceof Blob}function rt(){return"undefined"!==typeof Blob}function it(t,e,n,r){if(r<e)throw k("Invalid value for '"+t+"'. Expected "+e+" or greater.");if(r>n)throw k("Invalid value for '"+t+"'. Expected "+n+" or less.")} 2162/** 2163 * @license 2164 * Copyright 2017 Google LLC 2165 * 2166 * Licensed under the Apache License, Version 2.0 (the "License"); 2167 * you may not use this file except in compliance with the License. 2168 * You may obtain a copy of the License at 2169 * 2170 * http://www.apache.org/licenses/LICENSE-2.0 2171 * 2172 * Unless required by applicable law or agreed to in writing, software 2173 * distributed under the License is distributed on an "AS IS" BASIS, 2174 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2175 * See the License for the specific language governing permissions and 2176 * limitations under the License. 2177 */function ot(t,e){var n=e.match(/^(\w+):\/\/.+/),r=null===n||void 0===n?void 0:n[1],i=e;return null==r&&(i="https://"+e),i+"/v0"+t}function at(t){var e=encodeURIComponent,n="?";for(var r in t)if(t.hasOwnProperty(r)){var i=e(r)+"="+e(t[r]);n=n+i+"&"}return n=n.slice(0,-1),n} 2178/** 2179 * @license 2180 * Copyright 2017 Google LLC 2181 * 2182 * Licensed under the Apache License, Version 2.0 (the "License"); 2183 * you may not use this file except in compliance with the License. 2184 * You may obtain a copy of the License at 2185 * 2186 * http://www.apache.org/licenses/LICENSE-2.0 2187 * 2188 * Unless required by applicable law or agreed to in writing, software 2189 * distributed under the License is distributed on an "AS IS" BASIS, 2190 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2191 * See the License for the specific language governing permissions and 2192 * limitations under the License. 2193 */var st=function(){function t(t,e,n,r,i,o,a,s,u,c,h){var l=this;this.pendingXhr_=null,this.backoffId_=null,this.canceled_=!1,this.appDelete_=!1,this.url_=t,this.method_=e,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_=h,this.promise_=new Promise((function(t,e){l.resolve_=t,l.reject_=e,l.start_()}
2193))}return t.prototype.start_=function(){var t=this;function e(e,n){if(n)e(!1,new ut(!1,null,!0));else{var r=t.pool_.createXhrIo();t.pendingXhr_=r,null!==t.progressCallback_&&r.addUploadProgressListener(i),r.send(t.url_,t.method_,t.body_,t.headers_).then((function(n){null!==t.progressCallback_&&n.removeUploadProgressListener(i),t.pendingXhr_=null;var r=n.getErrorCode()===q.NO_ERROR,o=n.getStatus();if(r&&!t.isRetryStatusCode_(o)){var a=-1!==t.successCodes_.indexOf(o);e(!0,new ut(a,n))}else{var s=n.getErrorCode()===q.ABORT;e(!1,new ut(!1,null,s))}}))}function i(e){var n=e.loaded,r=e.lengthComputable?e.total:-1;null!==t.progressCallback_&&t.progressCallback_(n,r)}}function n(e,n){var r=t.resolve_,i=t.reject_,o=n.xhr;if(n.wasSuccessCode)try{var a=t.callback_(o,o.getResponseText());$(a)?r(a):r()}catch(u){i(u)}else if(null!==o){var s=p();s.serverResponse=o.getResponseText(),t.errorCallback_?i(t.errorCallback_(o,s)):i(s)}else if(n.canceled){s=t.appDelete_?N():w();i(s)}else{s=b();i(s)}}this.canceled_?n(!1,new ut(!1,null,!0)):this.backoffId_=Q(e,n,this.timeout_)},t.prototype.getPromise=function(){return this.promise_},t.prototype.cancel=function(t){this.canceled_=!0,this.appDelete_=t||!1,null!==this.backoffId_&&J(this.backoffId_),null!==this.pendingXhr_&&this.pendingXhr_.abort()},t.prototype.isRetryStatusCode_=function(t){var e=t>=500&&t<600,n=[408,429],r=-1!==n.indexOf(t),i=-1!==this.additionalRetryCodes_.indexOf(t);return e||r||i},t}(),ut=function(){function t(t,e,n){this.wasSuccessCode=t,this.xhr=e,this.canceled=!!n}return t}();function ct(t,e){null!==e&&e.length>0&&(t["Authorization"]="Firebase "+e)}function ht(t,e){t["X-Firebase-Storage-Version"]="webjs/"+(null!==e&&void 0!==e?e:"AppManager")}function lt(t,e){e&&(t["X-Firebase-GMPID"]=e)}function ft(t,e){null!==e&&(t["X-Firebase-AppCheck"]=e)}function pt(t,e,n,r,i,o){var a=at(t.urlParams),s=t.url+a,u=Object.assign({},t.headers);return lt(u,e),ct(u,n),ht(u,o),ft(u,r),new st(s,t.method,u,t.body,t.successCodes,t.additionalRetryCodes,t.handler,t.errorHandler,t.timeout,t.progressCallback,i)} 2194/** 2195 * @license 2196 * Copyright 2017 Google LLC 2197 * 2198 * Licensed under the Apache License, Version 2.0 (the "License"); 2199 * you may not use this file except in compliance with the License. 2200 * You may obtain a copy of the License at 2201 * 2202 * http://www.apache.org/licenses/LICENSE-2.0 2203 * 2204 * Unless required by applicable law or agreed to in writing, software 2205 * distributed under the License is distributed on an "AS IS" BASIS, 2206 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2207 * See the License for the specific language governing permissions and 2208 * limitations under the License. 2209 */function dt(){return"undefined"!==typeof BlobBuilder?BlobBuilder:"undefined"!==typeof WebKitBlobBuilder?WebKitBlobBuilder:void 0}function vt(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=dt();if(void 0!==n){for(var r=new n,i=0;i<t.length;i++)r.append(t[i]);return r.getBlob()}if(rt())return new Blob(t);throw new l("unsupported-environment","This browser doesn't seem to support creating Blobs")}function gt(t,e,n){return t.webkitSlice?t.webkitSlice(e,n):t.mozSlice?t.mozSlice(e,n):t.slice?t.slice(e,n):null} 2210/** 2211 * @license 2212 * Copyright 2017 Google LLC 2213 * 2214 * Licensed under the Apache License, Version 2.0 (the "License"); 2215 * you may not use this file except in compliance with the License. 2216 * You may obtain a copy of the License at 2217 * 2218 * http://www.apache.org/licenses/LICENSE-2.0 2219 * 2220 * Unless required by applicable law or agreed to in writing, software 2221 * distributed under the License is distributed on an "AS IS" BASIS, 2222 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2223 * See the License for the specific language governing permissions and 2224 * limitations under the License. 2225 */var mt=function(){function t(t,e){var n=0,r="";nt(t)?(this.data_=t,n=t.size,r=t.type):t instanceof ArrayBuffer?(e?this.data_=new Uint8Array(t):(this.data_=new Uint8Array(t.byteLength),this.data_.set(new Uint8Array(t))),n=this.data_.length):t instanceof Uint8Array&&(e?this.data_=t:(this.data_=new Uint8Array(t.length),this.data_.set(t)),n=t.length),this.size_=n,this.type_=r}return t.prototype.size=function(){return this.size_},t.prototype.type=function(){return this.type_},t.prototype.slice=function(e,n){if(nt(this.data_)){var r=this.data_,i=gt(r,e,n);return null===i?null:new t(i)}var o=new Uint8Array(this.data_.buffer,e,n-e);return new t(o,!0)},t.getBlob=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(rt()){var r=e.map((function(e){return e instanceof t?e.data_:e}));return new t(vt.apply(null,r))}var i=e.map((function(t){return et(t)?L(D.RAW,t).data:t.data_})),o=0;
2225i.forEach((function(t){o+=t.byteLength}));var a=new Uint8Array(o),s=0;return i.forEach((function(t){for(var e=0;e<t.length;e++)a[s++]=t[e]})),new t(a,!0)},t.prototype.uploadData=function(){return this.data_},t}(); 2226/** 2227 * @license 2228 * Copyright 2017 Google LLC 2229 * 2230 * Licensed under the Apache License, Version 2.0 (the "License"); 2231 * you may not use this file except in compliance with the License. 2232 * You may obtain a copy of the License at 2233 * 2234 * http://www.apache.org/licenses/LICENSE-2.0 2235 * 2236 * Unless required by applicable law or agreed to in writing, software 2237 * distributed under the License is distributed on an "AS IS" BASIS, 2238 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2239 * See the License for the specific language governing permissions and 2240 * limitations under the License. 2241 */function yt(t){var e;try{e=JSON.parse(t)}catch(n){return null}return tt(e)?e:null} 2242/** 2243 * @license 2244 * Copyright 2017 Google LLC 2245 * 2246 * Licensed under the Apache License, Version 2.0 (the "License"); 2247 * you may not use this file except in compliance with the License. 2248 * You may obtain a copy of the License at 2249 * 2250 * http://www.apache.org/licenses/LICENSE-2.0 2251 * 2252 * Unless required by applicable law or agreed to in writing, software 2253 * distributed under the License is distributed on an "AS IS" BASIS, 2254 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2255 * See the License for the specific language governing permissions and 2256 * limitations under the License. 2257 */function bt(t){if(0===t.length)return null;var e=t.lastIndexOf("/");if(-1===e)return"";var n=t.slice(0,e);return n}function wt(t,e){var n=e.split("/").filter((function(t){return t.length>0})).join("/");return 0===t.length?n:t+"/"+n}function _t(t){var e=t.lastIndexOf("/",t.length-2);return-1===e?t:t.slice(e+1)} 2258/** 2259 * @license 2260 * Copyright 2017 Google LLC 2261 * 2262 * Licensed under the Apache License, Version 2.0 (the "License"); 2263 * you may not use this file except in compliance with the License. 2264 * You may obtain a copy of the License at 2265 * 2266 * http://www.apache.org/licenses/LICENSE-2.0 2267 * 2268 * Unless required by applicable law or agreed to in writing, software 2269 * distributed under the License is distributed on an "AS IS" BASIS, 2270 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2271 * See the License for the specific language governing permissions and 2272 * limitations under the License. 2273 */function It(t,e){return e}var Et=function(){function t(t,e,n,r){this.server=t,this.local=e||t,this.writable=!!n,this.xform=r||It}return t}(),Tt=null;function St(t){return!et(t)||t.length<2?t:_t(t)}function At(){if(Tt)return Tt;var t=[];function e(t,e){return St(e)}t.push(new Et("bucket")),t.push(new Et("generation")),t.push(new Et("metageneration")),t.push(new Et("name","fullPath",!0));var n=new Et("name");function r(t,e){return void 0!==e?Number(e):e}n.xform=e,t.push(n);var i=new Et("size");return i.xform=r,t.push(i),t.push(new Et("timeCreated")),t.push(new Et("updated")),t.push(new Et("md5Hash",null,!0)),t.push(new Et("cacheControl",null,!0)),t.push(new Et("contentDisposition",null,!0)),t.push(new Et("contentEncoding",null,!0)),t.push(new Et("contentLanguage",null,!0)),t.push(new Et("contentType",null,!0)),t.push(new Et("metadata","customMetadata",!0)),Tt=t,Tt}function kt(t,e){function n(){var n=t["bucket"],r=t["fullPath"],i=new W(n,r);return e._makeStorageReference(i)}Object.defineProperty(t,"ref",{get:n})}function Nt(t,e,n){for(var r={type:"file"},i=n.length,o=0;o<i;o++){var a=n[o];r[a.local]=a.xform(r,e[a.server])}return kt(r,t),r}function Ct(t,e,n){var r=yt(e);if(null===r)return null;var i=r;return Nt(t,i,n)}function Rt(t,e,n){var r=yt(e);if(null===r)return null;if(!et(r["downloadTokens"]))return null;var i=r["downloadTokens"];if(0===i.length)return null;var o=encodeURIComponent,a=i.split(","),s=a.map((function(e){var r=t["bucket"],i=t["fullPath"],a="/b/"+o(r)+"/o/"+o(i),s=ot(a,n),u=at({alt:"media",token:e});return s+u}));return s[0]}function Ot(t,e){for(var n={},r=e.length,i=0;i<r;i++){var o=e[i];o.writable&&(n[o.server]=t[o.local])}return JSON.stringify(n)} 2274/** 2275 * @license 2276 * Copyright 2019 Google LLC 2277 * 2278 * Licensed under the Apache License, Version 2.0 (the "License");
2279 * you may not use this file except in compliance with the License. 2280 * You may obtain a copy of the License at 2281 * 2282 * http://www.apache.org/licenses/LICENSE-2.0 2283 * 2284 * Unless required by applicable law or agreed to in writing, software 2285 * distributed under the License is distributed on an "AS IS" BASIS, 2286 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2287 * See the License for the specific language governing permissions and 2288 * limitations under the License. 2289 */var Dt="prefixes",Pt="items";function Lt(t,e,n){var r={prefixes:[],items:[],nextPageToken:n["nextPageToken"]};if(n[Dt])for(var i=0,o=n[Dt];i<o.length;i++){var a=o[i],s=a.replace(/\/$/,""),u=t._makeStorageReference(new W(e,s));r.prefixes.push(u)}if(n[Pt])for(var c=0,h=n[Pt];c<h.length;c++){var l=h[c];u=t._makeStorageReference(new W(e,l["name"]));r.items.push(u)}return r}function xt(t,e,n){var r=yt(n);if(null===r)return null;var i=r;return Lt(t,e,i)}var Mt=function(){function t(t,e,n,r){this.url=t,this.method=e,this.handler=n,this.timeout=r,this.urlParams={},this.headers={},this.body=null,this.errorHandler=null,this.progressCallback=null,this.successCodes=[200],this.additionalRetryCodes=[]}return t}(); 2290/** 2291 * @license 2292 * Copyright 2017 Google LLC 2293 * 2294 * Licensed under the Apache License, Version 2.0 (the "License"); 2295 * you may not use this file except in compliance with the License. 2296 * You may obtain a copy of the License at 2297 * 2298 * http://www.apache.org/licenses/LICENSE-2.0 2299 * 2300 * Unless required by applicable law or agreed to in writing, software 2301 * distributed under the License is distributed on an "AS IS" BASIS, 2302 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2303 * See the License for the specific language governing permissions and 2304 * limitations under the License. 2305 */function Ut(t){if(!t)throw p()}function Ft(t,e){function n(n,r){var i=Ct(t,r,e);return Ut(null!==i),i}return n}function Vt(t,e){function n(n,r){var i=xt(t,e,r);return Ut(null!==i),i}return n}function Ht(t,e){function n(n,r){var i=Ct(t,r,e);return Ut(null!==i),Rt(i,r,t.host)}return n}function jt(t){function e(e,n){var r;return r=401===e.getStatus()?e.getResponseText().includes("Firebase App Check token is invalid")?m():g():402===e.getStatus()?v(t.bucket):403===e.getStatus()?y(t.path):n,r.serverResponse=n.serverResponse,r}return e}function qt(t){var e=jt(t);function n(n,r){var i=e(n,r);return 404===n.getStatus()&&(i=d(t.path)),i.serverResponse=r.serverResponse,i}return n}function Bt(t,e,n){var r=e.fullServerUrl(),i=ot(r,t.host),o="GET",a=t.maxOperationRetryTime,s=new Mt(i,o,Ft(t,n),a);return s.errorHandler=qt(e),s}function Kt(t,e,n,r,i){var o={};e.isRoot?o["prefix"]="":o["prefix"]=e.path+"/",n&&n.length>0&&(o["delimiter"]=n),r&&(o["pageToken"]=r),i&&(o["maxResults"]=i);var a=e.bucketOnlyServerUrl(),s=ot(a,t.host),u="GET",c=t.maxOperationRetryTime,h=new Mt(s,u,Vt(t,e.bucket),c);return h.urlParams=o,h.errorHandler=jt(e),h}function Gt(t,e,n){var r=e.fullServerUrl(),i=ot(r,t.host),o="GET",a=t.maxOperationRetryTime,s=new Mt(i,o,Ht(t,n),a);return s.errorHandler=qt(e),s}function Yt(t,e,n,r){var i=e.fullServerUrl(),o=ot(i,t.host),a="PATCH",s=Ot(n,r),u={"Content-Type":"application/json; charset=utf-8"},c=t.maxOperationRetryTime,h=new Mt(o,a,Ft(t,r),c);return h.headers=u,h.body=s,h.errorHandler=qt(e),h}function zt(t,e){var n=e.fullServerUrl(),r=ot(n,t.host),i="DELETE",o=t.maxOperationRetryTime;function a(t,e){}var s=new Mt(r,i,a,o);return s.successCodes=[200,204],s.errorHandler=qt(e),s}function Wt(t,e){return t&&t["contentType"]||e&&e.type()||"application/octet-stream"}function Xt(t,e,n){var r=Object.assign({},n);return r["fullPath"]=t.path,r["size"]=e.size(),r["contentType"]||(r["contentType"]=Wt(null,e)),r}function Qt(t,e,n,r,i){var o=e.bucketOnlyServerUrl(),a={"X-Goog-Upload-Protocol":"multipart"};function s(){for(var t="",e=0;e<2;e++)t+=Math.random().toString().slice(2);return t}var u=s();a["Content-Type"]="multipart/related; boundary="+u;var c=Xt(e,r,i),h=Ot(c,n),l="--"+u+"\r\nContent-Type: application/json; charset=utf-8\r\n\r\n"+h+"\r\n--"+u+"\r\nContent-Type: "+c["contentType"]+"\r\n\r\n",f="\r\n--"+u+"--",p=mt.getBlob(l,r,f);if(null===p)throw T();var d={name:c["fullPath"]},v=ot(o,t.host),g="POST",m=t.maxUploadRetryTime,y=new Mt(v,g,Ft(t,n),m);
2305return y.urlParams=d,y.headers=a,y.body=p.uploadData(),y.errorHandler=jt(e),y}var Jt=function(){function t(t,e,n,r){this.current=t,this.total=e,this.finalized=!!n,this.metadata=r||null}return t}();function $t(t,e){var n=null;try{n=t.getResponseHeader("X-Goog-Upload-Status")}catch(i){Ut(!1)}var r=e||["active"];return Ut(!!n&&-1!==r.indexOf(n)),n}function Zt(t,e,n,r,i){var o=e.bucketOnlyServerUrl(),a=Xt(e,r,i),s={name:a["fullPath"]},u=ot(o,t.host),c="POST",h={"X-Goog-Upload-Protocol":"resumable","X-Goog-Upload-Command":"start","X-Goog-Upload-Header-Content-Length":r.size(),"X-Goog-Upload-Header-Content-Type":a["contentType"],"Content-Type":"application/json; charset=utf-8"},l=Ot(a,n),f=t.maxUploadRetryTime;function p(t){var e;$t(t);try{e=t.getResponseHeader("X-Goog-Upload-URL")}catch(n){Ut(!1)}return Ut(et(e)),e}var d=new Mt(u,c,p,f);return d.urlParams=s,d.headers=h,d.body=l,d.errorHandler=jt(e),d}function te(t,e,n,r){var i={"X-Goog-Upload-Command":"query"};function o(t){var e=$t(t,["active","final"]),n=null;try{n=t.getResponseHeader("X-Goog-Upload-Size-Received")}catch(o){Ut(!1)}n||Ut(!1);var i=Number(n);return Ut(!isNaN(i)),new Jt(i,r.size(),"final"===e)}var a="POST",s=t.maxUploadRetryTime,u=new Mt(n,a,o,s);return u.headers=i,u.errorHandler=jt(e),u}var ee=262144;function ne(t,e,n,r,i,o,a,s){var u=new Jt(0,0);if(a?(u.current=a.current,u.total=a.total):(u.current=0,u.total=r.size()),r.size()!==u.total)throw S();var c=u.total-u.current,h=c;i>0&&(h=Math.min(h,i));var l=u.current,f=l+h,p=h===c?"upload, finalize":"upload",d={"X-Goog-Upload-Command":p,"X-Goog-Upload-Offset":u.current},v=r.slice(l,f);if(null===v)throw T();function g(t,n){var i,a=$t(t,["active","final"]),s=u.current+h,c=r.size();return i="final"===a?Ft(e,o)(t,n):null,new Jt(s,c,"final"===a,i)}var m="POST",y=e.maxUploadRetryTime,b=new Mt(n,m,g,y);return b.headers=d,b.body=v.uploadData(),b.progressCallback=s||null,b.errorHandler=jt(t),b} 2306/** 2307 * @license 2308 * Copyright 2017 Google LLC 2309 * 2310 * Licensed under the Apache License, Version 2.0 (the "License"); 2311 * you may not use this file except in compliance with the License. 2312 * You may obtain a copy of the License at 2313 * 2314 * http://www.apache.org/licenses/LICENSE-2.0 2315 * 2316 * Unless required by applicable law or agreed to in writing, software 2317 * distributed under the License is distributed on an "AS IS" BASIS, 2318 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2319 * See the License for the specific language governing permissions and 2320 * limitations under the License. 2321 */var re=function(){function t(t,e,n){var r=Z(t)||null!=e||null!=n;if(r)this.next=t,this.error=e,this.complete=n;else{var i=t;this.next=i.next,this.error=i.error,this.complete=i.complete}}return t}(); 2322/** 2323 * @license 2324 * Copyright 2017 Google LLC 2325 * 2326 * Licensed under the Apache License, Version 2.0 (the "License"); 2327 * you may not use this file except in compliance with the License. 2328 * You may obtain a copy of the License at 2329 * 2330 * http://www.apache.org/licenses/LICENSE-2.0 2331 * 2332 * Unless required by applicable law or agreed to in writing, software 2333 * distributed under the License is distributed on an "AS IS" BASIS, 2334 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2335 * See the License for the specific language governing permissions and 2336 * limitations under the License. 2337 */function ie(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];Promise.resolve().then((function(){return t.apply(void 0,e)}))}} 2338/** 2339 * @license 2340 * Copyright 2017 Google LLC 2341 * 2342 * Licensed under the Apache License, Version 2.0 (the "License"); 2343 * you may not use this file except in compliance with the License. 2344 * You may obtain a copy of the License at 2345 * 2346 * http://www.apache.org/licenses/LICENSE-2.0 2347 * 2348 * Unless required by applicable law or agreed to in writing, software 2349 * distributed under the License is distributed on an "AS IS" BASIS, 2350 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2351 * See the License for the specific language governing permissions and 2352 * limitations under the License. 2353 */var oe=function(){function t(t,e,n){var r=this;void 0===n&&(n=null),this._transferred=0,this._needToFetchStatus=!1,this._needToFetchMetadata=!1,this._observers=[],this._error=void 0,this._uploadUrl=void 0,this._request=void 0,this._chunkMultiplier=1,this._resolve=void 0,this._reject=void 0,this._ref=t,this._blob=e,this._metadata=n,this._mappings=At(),this._resumable=this._shouldDoResumable(this._blob),this._state="running",this._errorHandler=function(t){r._request=void 0,r._chunkMultiplier=1,t._codeEquals("canceled")?(r._needToFetchStatus=!0,r.completeTransitions_()):(r._error=t,r._transition("error"))},this._metadataErrorHandler=function(t){r._request=void 0,t._codeEquals("canceled")?r.completeTransitions_():(r._error=t,r._transition("error"))},this._promise=new Promise((function(t,e){r._resolve=t,r._reject=e,r._start()})),this._promise.then(null,(function(){}))}return t.prototype._makeProgressCallback=function(){var t=this,e=this._transferred;return function(n){return t._updateProgress(e+n)}},t.prototype._shouldDoResumable=function(t){return t.size()>262144},t.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())},t.prototype._resolveToken=function(t){var e=this;Promise.all([this._ref.storage._getAuthToken(),this._ref.storage._getAppCheckToken()]).then((function(n){var r=n[0],i=n[1];switch(e._state){case"running":t(r,i);break;case"canceling":e._transition("canceled");break;case"pausing":e._transition("paused");break}}
2353))},t.prototype._createResumable=function(){var t=this;this._resolveToken((function(e,n){var r=Zt(t._ref.storage,t._ref._location,t._mappings,t._blob,t._metadata),i=t._ref.storage._makeRequest(r,e,n);t._request=i,i.getPromise().then((function(e){t._request=void 0,t._uploadUrl=e,t._needToFetchStatus=!1,t.completeTransitions_()}),t._errorHandler)}))},t.prototype._fetchStatus=function(){var t=this,e=this._uploadUrl;this._resolveToken((function(n,r){var i=te(t._ref.storage,t._ref._location,e,t._blob),o=t._ref.storage._makeRequest(i,n,r);t._request=o,o.getPromise().then((function(e){t._request=void 0,t._updateProgress(e.current),t._needToFetchStatus=!1,e.finalized&&(t._needToFetchMetadata=!0),t.completeTransitions_()}),t._errorHandler)}))},t.prototype._continueUpload=function(){var t=this,e=ee*this._chunkMultiplier,n=new Jt(this._transferred,this._blob.size()),r=this._uploadUrl;this._resolveToken((function(i,o){var a;try{a=ne(t._ref._location,t._ref.storage,r,t._blob,e,t._mappings,n,t._makeProgressCallback())}catch(u){return t._error=u,void t._transition("error")}var s=t._ref.storage._makeRequest(a,i,o);t._request=s,s.getPromise().then((function(e){t._increaseMultiplier(),t._request=void 0,t._updateProgress(e.current),e.finalized?(t._metadata=e.metadata,t._transition("success")):t.completeTransitions_()}),t._errorHandler)}))},t.prototype._increaseMultiplier=function(){var t=ee*this._chunkMultiplier;t<33554432&&(this._chunkMultiplier*=2)},t.prototype._fetchMetadata=function(){var t=this;this._resolveToken((function(e,n){var r=Bt(t._ref.storage,t._ref._location,t._mappings),i=t._ref.storage._makeRequest(r,e,n);t._request=i,i.getPromise().then((function(e){t._request=void 0,t._metadata=e,t._transition("success")}),t._metadataErrorHandler)}))},t.prototype._oneShotUpload=function(){var t=this;this._resolveToken((function(e,n){var r=Qt(t._ref.storage,t._ref._location,t._mappings,t._blob,t._metadata),i=t._ref.storage._makeRequest(r,e,n);t._request=i,i.getPromise().then((function(e){t._request=void 0,t._metadata=e,t._updateProgress(t._blob.size()),t._transition("success")}),t._errorHandler)}))},t.prototype._updateProgress=function(t){var e=this._transferred;this._transferred=t,this._transferred!==e&&this._notifyObservers()},t.prototype._transition=function(t){if(this._state!==t)switch(t){case"canceling":this._state=t,void 0!==this._request&&this._request.cancel();break;case"pausing":this._state=t,void 0!==this._request&&this._request.cancel();break;case"running":var e="paused"===this._state;this._state=t,e&&(this._notifyObservers(),this._start());break;case"paused":this._state=t,this._notifyObservers();break;case"canceled":this._error=w(),this._state=t,this._notifyObservers();break;case"error":this._state=t,this._notifyObservers();break;case"success":this._state=t,this._notifyObservers();break}},t.prototype.completeTransitions_=function(){switch(this._state){case"pausing":this._transition("paused");break;case"canceling":this._transition("canceled");break;case"running":this._start();break}},Object.defineProperty(t.prototype,"snapshot",{get:function(){var t=G(this._state);return{bytesTransferred:this._transferred,totalBytes:this._blob.size(),state:t,metadata:this._metadata,task:this,ref:this._ref}},enumerable:!1,configurable:!0}),t.prototype.on=function(t,e,n,r){var i=this,o=new re(e,n,r);return this._addObserver(o),function(){i._removeObserver(o)}},t.prototype.then=function(t,e){return this._promise.then(t,e)},t.prototype.catch=function(t){return this.then(null,t)},t.prototype._addObserver=function(t){this._observers.push(t),this._notifyObserver(t)},t.prototype._removeObserver=function(t){var e=this._observers.indexOf(t);-1!==e&&this._observers.splice(e,1)},t.prototype._notifyObservers=function(){var t=this;this._finishPromise();var e=this._observers.slice();e.forEach((function(e){t._notifyObserver(e)}))},t.prototype._finishPromise=function(){if(void 0!==this._resolve){var t=!0;switch(G(this._state)){case K.SUCCESS:ie(this._resolve.bind(null,this.snapshot))();break;case K.CANCELED:case K.ERROR:var e=this._reject;ie(e.bind(null,this._error))();break;default:t=!1;break}t&&(this._resolve=void 0,this._reject=void 0)}}
2353,t.prototype._notifyObserver=function(t){var e=G(this._state);switch(e){case K.RUNNING:case K.PAUSED:t.next&&ie(t.next.bind(t,this.snapshot))();break;case K.SUCCESS:t.complete&&ie(t.complete.bind(t))();break;case K.CANCELED:case K.ERROR:t.error&&ie(t.error.bind(t,this._error))();break;default:t.error&&ie(t.error.bind(t,this._error))()}},t.prototype.resume=function(){var t="paused"===this._state||"pausing"===this._state;return t&&this._transition("running"),t},t.prototype.pause=function(){var t="running"===this._state;return t&&this._transition("pausing"),t},t.prototype.cancel=function(){var t="running"===this._state||"pausing"===this._state;return t&&this._transition("canceling"),t},t}(),ae=function(){function t(t,e){this._service=t,this._location=e instanceof W?e:W.makeFromUrl(e,t.host)}return t.prototype.toString=function(){return"gs://"+this._location.bucket+"/"+this._location.path},t.prototype._newRef=function(e,n){return new t(e,n)},Object.defineProperty(t.prototype,"root",{get:function(){var t=new W(this._location.bucket,"");return this._newRef(this._service,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bucket",{get:function(){return this._location.bucket},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fullPath",{get:function(){return this._location.path},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return _t(this._location.path)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"storage",{get:function(){return this._service},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){var e=bt(this._location.path);if(null===e)return null;var n=new W(this._location.bucket,e);return new t(this._service,n)},enumerable:!1,configurable:!0}),t.prototype._throwIfRoot=function(t){if(""===this._location.path)throw C(t)},t}(); 2354/** 2355 * @license 2356 * Copyright 2019 Google LLC 2357 * 2358 * Licensed under the Apache License, Version 2.0 (the "License"); 2359 * you may not use this file except in compliance with the License. 2360 * You may obtain a copy of the License at 2361 * 2362 * http://www.apache.org/licenses/LICENSE-2.0 2363 * 2364 * Unless required by applicable law or agreed to in writing, software 2365 * distributed under the License is distributed on an "AS IS" BASIS, 2366 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2367 * See the License for the specific language governing permissions and 2368 * limitations under the License. 2369 */function se(t,e,n){return t._throwIfRoot("uploadBytesResumable"),new oe(t,new mt(e),n)}function ue(t){var e={prefixes:[],items:[]};return ce(t,e).then((function(){return e}))}function ce(t,e,n){return(0,i.sH)(this,void 0,void 0,(function(){var r,o,a,s;return(0,i.YH)(this,(function(i){switch(i.label){case 0:return r={pageToken:n},[4,he(t,r)];case 1:return o=i.sent(),(a=e.prefixes).push.apply(a,o.prefixes),(s=e.items).push.apply(s,o.items),null==o.nextPageToken?[3,3]:[4,ce(t,e,o.nextPageToken)];case 2:i.sent(),i.label=3;case 3:return[2]}}
2369))}))}function he(t,e){return(0,i.sH)(this,void 0,void 0,(function(){var n,r;return(0,i.YH)(this,(function(i){switch(i.label){case 0:return null!=e&&"number"===typeof e.maxResults&&it("options.maxResults",1,1e3,e.maxResults),n=e||{},r=Kt(t.storage,t._location,"/",n.pageToken,n.maxResults),[4,t.storage.makeRequestWithTokens(r)];case 1:return[2,i.sent().getPromise()]}}))}))}function le(t){return(0,i.sH)(this,void 0,void 0,(function(){var e;return(0,i.YH)(this,(function(n){switch(n.label){case 0:return t._throwIfRoot("getMetadata"),e=Bt(t.storage,t._location,At()),[4,t.storage.makeRequestWithTokens(e)];case 1:return[2,n.sent().getPromise()]}}))}))}function fe(t,e){return(0,i.sH)(this,void 0,void 0,(function(){var n;return(0,i.YH)(this,(function(r){switch(r.label){case 0:return t._throwIfRoot("updateMetadata"),n=Yt(t.storage,t._location,e,At()),[4,t.storage.makeRequestWithTokens(n)];case 1:return[2,r.sent().getPromise()]}}))}))}function pe(t){return(0,i.sH)(this,void 0,void 0,(function(){var e;return(0,i.YH)(this,(function(n){switch(n.label){case 0:return t._throwIfRoot("getDownloadURL"),e=Gt(t.storage,t._location,At()),[4,t.storage.makeRequestWithTokens(e)];case 1:return[2,n.sent().getPromise().then((function(t){if(null===t)throw A();return t}))]}}))}))}function de(t){return(0,i.sH)(this,void 0,void 0,(function(){var e;return(0,i.YH)(this,(function(n){switch(n.label){case 0:return t._throwIfRoot("deleteObject"),e=zt(t.storage,t._location),[4,t.storage.makeRequestWithTokens(e)];case 1:return[2,n.sent().getPromise()]}}))}))}function ve(t,e){var n=wt(t._location.path,e),r=new W(t._location.bucket,n);return new ae(t.storage,r)} 2370/** 2371 * @license 2372 * Copyright 2017 Google LLC 2373 * 2374 * Licensed under the Apache License, Version 2.0 (the "License"); 2375 * you may not use this file except in compliance with the License. 2376 * You may obtain a copy of the License at 2377 * 2378 * http://www.apache.org/licenses/LICENSE-2.0 2379 * 2380 * Unless required by applicable law or agreed to in writing, software 2381 * distributed under the License is distributed on an "AS IS" BASIS, 2382 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2383 * See the License for the specific language governing permissions and 2384 * limitations under the License. 2385 */function ge(t){return/^[A-Za-z]+:\/\//.test(t)}function me(t,e){return new ae(t,e)}function ye(t,e){if(t instanceof Ie){var n=t;if(null==n._bucket)throw E();var r=new ae(n,n._bucket);return null!=e?ye(r,e):r}if(void 0!==e){if(e.includes(".."))throw k('`path` param cannot contain ".."');return ve(t,e)}return t}function be(t,e){if(e&&ge(e)){if(t instanceof Ie)return me(t,e);throw k("To use ref(service, url), the first argument must be a Storage instance.")}return ye(t,e)}function we(t,e){var n=null===e||void 0===e?void 0:e[u];return null==n?null:W.makeFromBucketSpec(n,t)}function _e(t,e,n){t.host="http://"+e+":"+n}var Ie=function(){function t(t,e,n,r,i,o){this.app=t,this._authProvider=e,this._appCheckProvider=n,this._pool=r,this._url=i,this._firebaseVersion=o,this._bucket=null,this._host=s,this._appId=null,this._deleted=!1,this._maxOperationRetryTime=c,this._maxUploadRetryTime=h,this._requests=new Set,this._bucket=null!=i?W.makeFromBucketSpec(i,this._host):we(this._host,this.app.options)}return Object.defineProperty(t.prototype,"host",{get:function(){return this._host},set:function(t){this._host=t,null!=this._url?this._bucket=W.makeFromBucketSpec(this._url,t):this._bucket=we(t,this.app.options)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxUploadRetryTime",{get:function(){return this._maxUploadRetryTime},set:function(t){it("time",0,Number.POSITIVE_INFINITY,t),this._maxUploadRetryTime=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxOperationRetryTime",{get:function(){return this._maxOperationRetryTime},set:function(t){it("time",0,Number.POSITIVE_INFINITY,t),this._maxOperationRetryTime=t},enumerable:!1,configurable:!0}),t.prototype._getAuthToken=function(){return(0,i.sH)(this,void 0,void 0,(function(){var t,e;return(0,i.YH)(this,(function(n){switch(n.label){case 0:return t=this._authProvider.getImmediate({optional:!0}),t?[4,t.getToken()]:[3,2];case 1:if(e=n.sent(),null!==e)return[2,e.accessToken];n.label=2;case 2:return[2,null]}}))}))},t.prototype._getAppCheckToken=function(){return(0,i.sH)(this,void 0,void 0,(function(){var t,e;return(0,i.YH)(this,(function(n){switch(n.label){case 0:return t=this._appCheckProvider.getImmediate({optional:!0}),t?[4,t.getToken()]:[3,2];case 1:return e=n.sent(),[2,e.token];case 2:return[2,null]}}))}))},t.prototype._delete=function(){return this._deleted=!0,this._requests.forEac
2385h((function(t){return t.cancel()})),this._requests.clear(),Promise.resolve()},t.prototype._makeStorageReference=function(t){return new ae(this,t)},t.prototype._makeRequest=function(t,e,n){var r=this;if(this._deleted)return new X(N());var i=pt(t,this._appId,e,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},t.prototype.makeRequestWithTokens=function(t){return(0,i.sH)(this,void 0,void 0,(function(){var e,n,r;return(0,i.YH)(this,(function(i){switch(i.label){case 0:return[4,Promise.all([this._getAuthToken(),this._getAppCheckToken()])];case 1:return e=i.sent(),n=e[0],r=e[1],[2,this._makeRequest(t,n,r)]}}))}))},t}(); 2386/** 2387 * @license 2388 * Copyright 2020 Google LLC 2389 * 2390 * Licensed under the Apache License, Version 2.0 (the "License"); 2391 * you may not use this file except in compliance with the License. 2392 * You may obtain a copy of the License at 2393 * 2394 * http://www.apache.org/licenses/LICENSE-2.0 2395 * 2396 * Unless required by applicable law or agreed to in writing, software 2397 * distributed under the License is distributed on an "AS IS" BASIS, 2398 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2399 * See the License for the specific language governing permissions and 2400 * limitations under the License. 2401 */function Ee(t,e,n){return t=(0,o.Ku)(t),se(t,e,n)}function Te(t){return t=(0,o.Ku)(t),le(t)}function Se(t,e){return t=(0,o.Ku)(t),fe(t,e)}function Ae(t,e){return t=(0,o.Ku)(t),he(t,e)}function ke(t){return t=(0,o.Ku)(t),ue(t)}function Ne(t){return t=(0,o.Ku)(t),pe(t)}function Ce(t){return t=(0,o.Ku)(t),de(t)}function Re(t,e){return t=(0,o.Ku)(t),be(t,e)}function Oe(t,e){return ve(t,e)} 2402/** 2403 * @license 2404 * Copyright 2020 Google LLC 2405 * 2406 * Licensed under the Apache License, Version 2.0 (the "License"); 2407 * you may not use this file except in compliance with the License. 2408 * You may obtain a copy of the License at 2409 * 2410 * http://www.apache.org/licenses/LICENSE-2.0 2411 * 2412 * Unless required by applicable law or agreed to in writing, software 2413 * distributed under the License is distributed on an "AS IS" BASIS, 2414 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2415 * See the License for the specific language governing permissions and 2416 * limitations under the License. 2417 */var De=function(){function t(t,e,n){this._delegate=t,this.task=e,this.ref=n}return Object.defineProperty(t.prototype,"bytesTransferred",{get:function(){return this._delegate.bytesTransferred},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"metadata",{get:function(){return this._delegate.metadata},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"state",{get:function(){return this._delegate.state},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"totalBytes",{get:function(){return this._delegate.totalBytes},enumerable:!1,configurable:!0}),t}(),Pe=function(){function t(t,e){this._delegate=t,this._ref=e,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(t.prototype,"snapshot",{get:function(){return new De(this._delegate.snapshot,this,this._ref)},enumerable:!1,configurable:!0}),t.prototype.then=function(t,e){var n=this;return this._delegate.then((function(e){if(t)return t(new De(e,n,n._ref))}),e)},t.prototype.on=function(t,e,n,r){var i=this,o=void 0;return e&&(o="function"===typeof e?function(t){return e(new De(t,i,i._ref))}:{next:e.next?function(t){return e.next(new De(t,i,i._ref))}:void 0,complete:e.complete||void 0,error:e.error||void 0}),this._delegate.on(t,o,n||void 0,r||void 0)},t}(),Le=function(){function t(t,e){this._delegate=t,this._service=e}return Object.defineProperty(t.prototype,"prefixes",{get:function(){var t=this;return this._delegate.prefixes.map((function(e){return new xe(e,t._service)}))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"items",{get:function(){var t=this;return this._delegate.items.map((function(e){return new xe(e,t._service)}))}
2417,enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nextPageToken",{get:function(){return this._delegate.nextPageToken||null},enumerable:!1,configurable:!0}),t}(),xe=function(){function t(t,e){this._delegate=t,this.storage=e}return Object.defineProperty(t.prototype,"name",{get:function(){return this._delegate.name},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bucket",{get:function(){return this._delegate.bucket},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fullPath",{get:function(){return this._delegate.fullPath},enumerable:!1,configurable:!0}),t.prototype.toString=function(){return this._delegate.toString()},t.prototype.child=function(e){var n=Oe(this._delegate,e);return new t(n,this.storage)},Object.defineProperty(t.prototype,"root",{get:function(){return new t(this._delegate.root,this.storage)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){var e=this._delegate.parent;return null==e?null:new t(e,this.storage)},enumerable:!1,configurable:!0}),t.prototype.put=function(t,e){return this._throwIfRoot("put"),new Pe(Ee(this._delegate,t,e),this)},t.prototype.putString=function(t,e,n){void 0===e&&(e=D.RAW),this._throwIfRoot("putString");var r=L(e,t),o=(0,i.Cl)({},n);return null==o["contentType"]&&null!=r.contentType&&(o["contentType"]=r.contentType),new Pe(new oe(this._delegate,new mt(r.data,!0),o),this)},t.prototype.listAll=function(){var t=this;return ke(this._delegate).then((function(e){return new Le(e,t.storage)}))},t.prototype.list=function(t){var e=this;return Ae(this._delegate,t||void 0).then((function(t){return new Le(t,e.storage)}))},t.prototype.getMetadata=function(){return Te(this._delegate)},t.prototype.updateMetadata=function(t){return Se(this._delegate,t)},t.prototype.getDownloadURL=function(){return Ne(this._delegate)},t.prototype.delete=function(){return this._throwIfRoot("delete"),Ce(this._delegate)},t.prototype._throwIfRoot=function(t){if(""===this._delegate._location.path)throw C(t)},t}(),Me=function(){function t(t,e){var n=this;this.app=t,this._delegate=e,this.INTERNAL={delete:function(){return n._delegate._delete()}}}return Object.defineProperty(t.prototype,"maxOperationRetryTime",{get:function(){return this._delegate.maxOperationRetryTime},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxUploadRetryTime",{get:function(){return this._delegate.maxUploadRetryTime},enumerable:!1,configurable:!0}),t.prototype.ref=function(t){if(ge(t))throw k("ref() expected a child path but got a URL, use refFromURL instead.");return new xe(Re(this._delegate,t),this)},t.prototype.refFromURL=function(t){if(!ge(t))throw k("refFromURL() expected a full URL but got a child path, use ref() instead.");try{W.makeFromUrl(t,this._delegate.host)}catch(e){throw k("refFromUrl() expected a valid full URL but got an invalid one.")}return new xe(Re(this._delegate,t),this)},t.prototype.setMaxUploadRetryTime=function(t){this._delegate.maxUploadRetryTime=t},t.prototype.setMaxOperationRetryTime=function(t){this._delegate.maxOperationRetryTime=t},t.prototype.useEmulator=function(t,e){_e(this._delegate,t,e)},t}(),Ue="@firebase/storage",Fe="0.5.2",Ve="storage"; 2418/** 2419 * @license 2420 * Copyright 2020 Google LLC 2421 * 2422 * Licensed under the Apache License, Version 2.0 (the "License"); 2423 * you may not use this file except in compliance with the License. 2424 * You may obtain a copy of the License at 2425 * 2426 * http://www.apache.org/licenses/LICENSE-2.0 2427 * 2428 * Unless required by applicable law or agreed to in writing, software 2429 * distributed under the License is distributed on an "AS IS" BASIS, 2430 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2431 * See the License for the specific language governing permissions and 2432 * limitations under the License. 2433 */function He(t,e){var n=e.instanceIdentifier,i=t.getProvider("app").getImmediate(),o=t.getProvider("auth-internal"),a=t.getProvider("app-check-internal"),s=new Me(i,new Ie(i,o,a,new z,n,r.A.SDK_VERSION));return s}function je(t){var e={TaskState:K,TaskEvent:B,StringFormat:D,Storage:Ie,Reference:xe};t.INTERNAL.registerComponent(new a.uA(Ve,He,"PUBLIC").setServiceProps(e).setMultipleInstances(!0)),t.registerVersion(Ue,Fe)}je(r.A)}}]); 2434//# sourceMappingURL=npm.firebase.8598a47e.v13_4_4.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.