1// Define the path as a JavaScript variable 2try { 3 var firebaseServiceWorkerPath = $('#Firebase_Configuration_Config').data('firebase-service-worker-file'); 4 var firebaseServiceWorkerScope = $('#Firebase_Configuration_Config').data('firebase-service-worker-scope'); 5} catch(e) { 6 var firebaseServiceWorkerPath = "./firebase-messaging-sw.js"; 7 var firebaseServiceWorkerScope = "./firebase-cloud-messaging-push-scope"; 8} 9 10! function (t, e) { 11 "object" == typeof exports && "undefined" != typeof module ? module.exports = e() : "function" == typeof define && define.amd ? define(e) : (t = "undefined" != typeof globalThis ? globalThis : t || self).firebase = e() 12}(this, function () { 13 "use strict"; 14 ! function (t) { 15 var e, n, s, r, i, o, a, u, c, h; 16 17 function l(t) { 18 if ("string" != typeof t && (t = String(t)), /[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(t)) throw new TypeError("Invalid character in header field name"); 19 return t.toLowerCase() 20 } 21 22 function f(t) { 23 return t = "string" != typeof t ? String(t) : t 24 } 25 26 function p(e) { 27 var t = { 28 next: function () { 29 var t = e.shift(); 30 return { 31 done: void 0 === t, 32 value: t 33 } 34 } 35 }; 36 return n && (t[Symbol.iterator] = function () { 37 return t 38 }), t 39 } 40 41 function d(e) { 42 this.map = {}, e instanceof d ? e.forEach(function (t, e) { 43 this.append(e, t) 44 }, this) : Array.isArray(e) ? e.forEach(function (t) { 45 this.append(t[0], t[1]) 46 }, this) : e && Object.getOwnPropertyNames(e).forEach(function (t) { 47 this.append(t, e[t]) 48 }, this) 49 } 50 51 function v(t) { 52 if (t.bodyUsed) return Promise.reject(new TypeError("Already read")); 53 t.bodyUsed = !0 54 } 55 56 function g(n) { 57 return new Promise(function (t, e) { 58 n.onload = function () { 59 t(n.result) 60 }, n.onerror = function () { 61 e(n.error) 62 } 63 }) 64 } 65 66 function y(t) { 67 var e = new FileReader, 68 n = g(e); 69 return e.readAsArrayBuffer(t), n 70 } 71 72 function m(t) { 73 if (t.slice) return t.slice(0); 74 var e = new Uint8Array(t.byteLength); 75 return e.set(new Uint8Array(t)), e.buffer 76 } 77 78 function b() { 79 return this.bodyUsed = !1, this._initBody = function (t) { 80 if (this._bodyInit = t) 81 if ("string" == typeof t) this._bodyText = t; 82 else if (s && Blob.prototype.isPrototypeOf(t)) this._bodyBlob = t; 83 else if (r && FormData.prototype.isPrototypeOf(t)) this._bodyFormData = t; 84 else if (e && URLSearchParams.prototype.isPrototypeOf(t)) this._bodyText = t.toString(); 85 else if (i && s && a(t)) this._bodyArrayBuffer = m(t.buffer), this._bodyInit = new Blob([this._bodyArrayBuffer]); 86 else { 87 if (!i || !ArrayBuffer.prototype.isPrototypeOf(t) && !u(t)) throw new Error("unsupported BodyInit type"); 88 this._bodyArrayBuffer = m(t) 89 } else this._bodyText = ""; 90 this.headers.get("content-type") || ("string" == typeof t ? this.headers.set("content-type", "text/plain;charset=UTF-8") : this._bodyBlob && this._bodyBlob.type ? this.headers.set("content-type", this._bodyBlob.type) : e && URLSearchParams.prototype.isPrototypeOf(t) && this.headers.set("content-type", "application/x-www-form-urlencoded;charset=UTF-8")) 91 }, s && (this.blob = function () { 92 var t = v(this); 93 if (t) return t; 94 if (this._bodyBlob) return Promise.resolve(this._bodyBlob); 95 if (this._bodyArrayBuffer) return Promise.resolve(new Blob([this._bodyArrayBuffer])); 96 if (this._bodyFormData) throw new Error("could not read FormData body as blob"); 97 return Promise.resolve(new Blob([this._bodyText])) 98 }, this.arrayBuffer = function () { 99 return this._bodyArrayBuffer ? v(this) || Promise.resolve(this._bodyArrayBuffer) : this.blob().then(y) 100 }), this.text = function () { 101 var t, e, n = v(this); 102 if (n) return n; 103 if (this._bodyBlob) return t = this._bodyBlob, e = new FileReader, n = g(e), e.readAsText(t), n; 104 if (this._bodyArrayBuffer) return Promise.resolve(function (t) { 105 for (var e = new Uint8Array(t), n = new Array(e.length), r = 0; r < e.length; r++) n[r] = String.fromCharCode(e[r]); 106 return n.join("") 107 }(this._bodyArrayBuffer)); 108 if (this._bodyFormData) throw new Error("could not read FormData body as text"); 109 return Promise.resolve(this._bodyText) 110 }, r && (this.formData = function () { 111 return this.text().then(_) 112 }), this.json = function () { 113 return this.text().then(JSON.parse) 114 }, this 115 } 116 117 function w(t, e) { 118 var n, r = (e = e || {}).body; 119 if (t instanceof w) { 120 if (t.bodyUsed) throw new TypeError("Already read"); 121 this.url = t.url, this.credentials = t.credentials, e.headers || (this.headers = new d(t.headers)), this.method = t.method, this.mode = t.mode, r || null == t._bodyInit || (r = t._bodyInit, t.bodyUsed = !0) 122 } else this.url = String(t); 123 if (this.credentials = e.credentials || this.credentials || "omit", !e.headers && this.headers || (this.headers = new d(e.headers)), this.method = (n = e.method || this.method || "GET", t = n.toUpperCase(), -1 < c.indexOf(t) ? t : n), this.mode = e.mode || this.mode || null, this.referrer = null, ("GET" === this.method || "HEAD" === this.method) && r) throw new TypeError("Body not allowed for GET or HEAD requests"); 124 this._initBody(r) 125 } 126 127 function _(t) { 128 var n = new FormData; 129 return t.trim().split("&").forEach(function (t) { 130 var e; 131 t && (t = (e = t.split("=")).shift().replace(/\+/g, " "), e = e.join("=").replace(/\+/g, " "), n.append(decodeURIComponent(t), decodeURIComponent(e))) 132 }), n 133 } 134 135 function I(t, e) { 136 e = e || {}, this.type = "default", this.status = void 0 === e.status ? 200 : e.status, this.ok = 200 <= this.status && this.status < 300, this.statusText = "statusText" in e ? e.statusText : "OK", this.headers = new d(e.headers), this.url = e.url || "", this._initBody(t) 137 } 138 t.fetch || (e = "URLSearchParams" in t, n = "Symbol" in t && "iterator" in Symbol, s = "FileReader" in t && "Blob" in t && function () { 139 try { 140 return new Blob, !0 141 } catch (t) { 142 return !1 143 } 144 }(), r = "FormData" in t, (i = "ArrayBuffer" in t) && (o = ["[object Int8Array]", "[object Uint8Array]", "[object Uint8ClampedArray]", "[object Int16Array]", "[object Uint16Array]", "[object Int32Array]", "[object Uint32Array]", "[object Float32Array]", "[object Float64Array
144]"], a = function (t) { 145 return t && DataView.prototype.isPrototypeOf(t) 146 }, u = ArrayBuffer.isView || function (t) { 147 return t && -1 < o.indexOf(Object.prototype.toString.call(t)) 148 }), d.prototype.append = function (t, e) { 149 t = l(t), e = f(e); 150 var n = this.map[t]; 151 this.map[t] = n ? n + "," + e : e 152 }, d.prototype.delete = function (t) { 153 delete this.map[l(t)] 154 }, d.prototype.get = function (t) { 155 return t = l(t), this.has(t) ? this.map[t] : null 156 }, d.prototype.has = function (t) { 157 return this.map.hasOwnProperty(l(t)) 158 }, d.prototype.set = function (t, e) { 159 this.map[l(t)] = f(e) 160 }, d.prototype.forEach = function (t, e) { 161 for (var n in this.map) this.map.hasOwnProperty(n) && t.call(e, this.map[n], n, this) 162 }, d.prototype.keys = function () { 163 var n = []; 164 return this.forEach(function (t, e) { 165 n.push(e) 166 }), p(n) 167 }, d.prototype.values = function () { 168 var e = []; 169 return this.forEach(function (t) { 170 e.push(t) 171 }), p(e) 172 }, d.prototype.entries = function () { 173 var n = []; 174 return this.forEach(function (t, e) { 175 n.push([e, t]) 176 }), p(n) 177 }, n && (d.prototype[Symbol.iterator] = d.prototype.entries), c = ["DELETE", "GET", "HEAD", "OPTIONS", "POST", "PUT"], w.prototype.clone = function () { 178 return new w(this, { 179 body: this._bodyInit 180 }) 181 }, b.call(w.prototype), b.call(I.prototype), I.prototype.clone = function () { 182 return new I(this._bodyInit, { 183 status: this.status, 184 statusText: this.statusText, 185 headers: new d(this.headers), 186 url: this.url 187 }) 188 }, I.error = function () { 189 var t = new I(null, { 190 status: 0, 191 statusText: "" 192 }); 193 return t.type = "error", t 194 }, h = [301, 302, 303, 307, 308], I.redirect = function (t, e) { 195 if (-1 === h.indexOf(e)) throw new RangeError("Invalid status code"); 196 return new I(null, { 197 status: e, 198 headers: { 199 location: t 200 } 201 }) 202 }, t.Headers = d, t.Request = w, t.Response = I, t.fetch = function (n, o) { 203 return new Promise(function (r, t) { 204 var e = new w(n, o), 205 i = new XMLHttpRequest; 206 i.onload = function () { 207 var n, t = { 208 status: i.status, 209 statusText: i.statusText, 210 headers: (e = i.getAllResponseHeaders() || "", n = new d, e.replace(/\r?\n[\t ]+/g, " ").split(/\r?\n/).forEach(function (t) { 211 var e = t.split(":"), 212 t = e.shift().trim(); 213 t && (e = e.join(":").trim(), n.append(t, e)) 214 }), n) 215 }; 216 t.url = "responseURL" in i ? i.responseURL : t.headers.get("X-Request-URL"); 217 var e = "response" in i ? i.response : i.responseText; 218 r(new I(e, t)) 219 }, i.onerror = function () { 220 t(new TypeError("Network request failed")) 221 }, i.ontimeout = function () { 222 t(new TypeError("Network request failed")) 223 }, i.open(e.method, e.url, !0), "include" === e.credentials ? i.withCredentials = !0 : "omit" === e.credentials && (i.withCredentials = !1), "responseType" in i && s && (i.responseType = "blob"), e.headers.forEach(function (t, e) { 224 i.setRequestHeader(e, t) 225 }), i.send(void 0 === e._bodyInit ? null : e._bodyInit) 226 }) 227 }, t.fetch.polyfill = !0) 228 }("undefined" != typeof self ? self : void 0); 229 var t = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : {}; 230 231 function e(t) { 232 var e = { 233 exports: {} 234 }; 235 return t(e, e.exports), e.exports 236 } 237 238 function g(t) { 239 try { 240 return !!t() 241 } catch (t) { 242 return !0 243 } 244 } 245 246 function v(t, e) { 247 return { 248 enumerable: !(1 & t), 249 configurable: !(2 & t), 250 writable: !(4 & t), 251 value: e 252 } 253 } 254 255 function r(t) { 256 return d.call(t).slice(8, -1) 257 } 258 259 function s(t) { 260 if (null == t) throw TypeError("Can't call method on " + t); 261 return t 262 } 263 264 function u(t) { 265 return _(s(t)) 266 } 267 268 function y(t) { 269 return "object" == typeof t ? null !== t : "function" == typeof t 270 } 271 272 function i(t, e) { 273 if (!y(t)) return t; 274 var n, r; 275 if (e && "function" == typeof (n = t.toString) && !y(r = n.call(t))) return r; 276 if ("function" == typeof (n = t.valueOf) && !y(r = n.call(t))) return r; 277 if (!e && "function" == typeof (n = t.toString) && !y(r = n.call(t))) return r; 278 throw TypeError("Can't convert object to primitive value") 279 } 280 281 function c(t, e) { 282 return I.call(t, e) 283 } 284 285 function n(t) { 286 return E ? T.createElement(t) : {} 287 } 288 289 function m(t) { 290 if (!y(t)) throw TypeError(String(t) + " is not an object"); 291 return t 292 } 293 294 function h(e, n) { 295 try { 296 R(b, e, n) 297 } catch (t) { 298 b[e] = n 299 } 300 return n 301 } 302 var o = function (t) { 303 return t && t.Math == Math && t 304 }, 305 b = o("object" == typeof globalThis && globalThis) || o("object" == typeof window && window) || o("object" == typeof self && self) || o("object" == typeof t && t) || function () { 306 return this 307 }() || Function("return this")(), 308 f = !g(function () { 309 return 7 != Object.defineProperty({}, 1, { 310 get: function () { 311 return 7 312 } 313 })[1] 314 }), 315 a = {}.propertyIsEnumerable, 316 l = Object.getOwnPropertyDescriptor, 317 p = { 318 f: l && !a.call({ 319 1: 2 320 }, 1) ? function (t) { 321 t = l(this, t); 322 return !!t && t.enumerable 323 } : a 324 }, 325 d = {}.toString, 326 w = "".split, 327 _ = g(function () { 328 return !Object("z").propertyIsEnumerable(0) 329 }) ? function (t) { 330 return "String" == r(t) ? w.call(t, "") : Object(t) 331 } : Object, 332 I = {}.hasOwnProperty, 333 T = b.document, 334 E = y(T) && y(T.createElement), 335 S = !f && !g(function () { 336 return 7 != Object.defineProperty(n("div"), "a", { 337 get: function () { 338 return 7 339 } 340 }).a 341 }), 342 C = Object.getOwnPropertyDescriptor, 343 N = { 344 f: f ? C : function (t, e) { 345 if (t = u(t), e = i(e, !0), S) try { 346 return C(t, e) 347 } catch (t) {} 348 if (c(t, e)) return v(!p.f.call(t, e), t[e]) 349 } 350 }, 351 A = Object.defineProperty, 352 k = { 353 f: f ? A : function (t, e, n) { 354 if (m(t), e = i(e, !0), m(n), S) try { 355 return A(t, e, n) 356 } catch (t) {} 357 if ("get" in n || "set" in n) throw TypeError("Accessors not supported"); 358 return "value" in n && (t[e] = n.value), t 359 } 360 }, 361 R = f ? function (t, e, n) { 362 return k.f(t, e, v(1, n)) 363 } : function (t, e, n) { 364 return t[e] = n, t 365 }, 366 P = "__core-js_shared__", 367 O = b[P] || h(P, {}), 368 D = Function.toString; 369 "function" != typeof O.inspectSource && (O.inspectSource = function (t) { 370 return D.call(t) 371 }); 372 373 function x(t) { 374 return "Symbol(" + String(void 0 === t ? "" : t) + ")_" + (++Q + Y).toString(36) 375 } 376 var L, M, F, U, j, q, V, B, K = O.inspectSource, 377 W = b.WeakMap, 378 H = "function" == typeof W && /native code/.test(K(W)), 379 G = !1, 380 z = e(function (t) { 381 (t.exports = function (t, e) { 382 return O[t] || (O[t] = void 0 !== e ? e : {}) 383 })("versions", []).push({ 384 version: "3.8.1", 385 mode: "global", 386 copyright: "© 2020 Denis Pushkarev (zloirock.ru)" 387 }) 388 }), 389 Q = 0, 390 Y = Math.random(), 391 X = z("keys"), 392 J = function (t) { 393 return X[t] || (X[t] = x(t)) 394 }, 395 $ = {}, 396 Z = b.WeakMap; 397 V = H ? (L = O.state || (O.state = new Z), M = L.get, F = L.has, U = L.set, j = function (t, e) { 398 return e.facade = t, U.call(L, t, e), e 399 }, q = function (t) { 400 return M.call(L, t) || {} 401 }, function (t) { 402 return F.call(L, t) 403 }) : (B = J("state"), $[B] = !0, j = function (t, e) { 404 return e.facade = t, R(t, B, e), e 405 }, q = function (t) { 406 return c(t, B) ? t[B] : {} 407 }, function (t) { 408 return c(t, B) 409 }); 410 411 function tt(t) { 412 return "function" == typeof t ? t : void 0 413 } 414 415 function et(t, e) { 416 return arguments.length < 2 ? tt(pt[t]) || tt(b[t]) : pt[t] && pt[t][e] || b[t] && b[t][e] 417 } 418 419 function nt(t) { 420 return isNaN(t = +t) ? 0 : (0 < t ? vt : dt)(t) 421 } 422 423 function rt(t) { 424 return 0 < t ? gt(nt(t), 9007199254740991) : 0 425 } 426 427 function it(t, e) { 428 var n, r = u(t), 429 i = 0, 430 o = []; 431 for (n in r) !c($, n) && c(r, n) && o.push(n); 432 for (; e.length > i;
432) c(r, n = e[i++]) && (~wt(o, n) || o.push(n)); 433 return o 434 } 435 436 function ot(t, e) { 437 for (var n = St(e), r = k.f, i = N.f, o = 0; o < n.length; o++) { 438 var s = n[o]; 439 c(t, s) || r(t, s, i(e, s)) 440 } 441 } 442 443 function st(t, e) { 444 var n, r, i, o = t.target, 445 s = t.global, 446 a = t.stat, 447 u = s ? b : a ? b[o] || h(o, {}) : (b[o] || {}).prototype; 448 if (u) 449 for (n in e) { 450 if (r = e[n], i = t.noTargetGet ? (i = Ot(u, n)) && i.value : u[n], !Pt(s ? n : o + (a ? "." : "#") + n, t.forced) && void 0 !== i) { 451 if (typeof r == typeof i) continue; 452 ot(r, i) 453 }(t.sham || i && i.sham) && R(r, "sham", !0), ft(u, n, r, t) 454 } 455 } 456 457 function at(t) { 458 return Object(s(t)) 459 } 460 461 function ut() {} 462 463 function ct(t) { 464 return "<script>" + t + "</" + Vt + ">" 465 } 466 var ht, lt = { 467 set: j, 468 get: q, 469 has: V, 470 enforce: function (t) { 471 return V(t) ? q(t) : j(t, {}) 472 }, 473 getterFor: function (n) { 474 return function (t) { 475 var e; 476 if (!y(t) || (e = q(t)).type !== n) throw TypeError("Incompatible receiver, " + n + " required"); 477 return e 478 } 479 } 480 }, 481 ft = e(function (t) { 482 var e = lt.get, 483 a = lt.enforce, 484 u = String(String).split("String"); 485 (t.exports = function (t, e, n, r) { 486 var i = !!r && !!r.unsafe, 487 o = !!r && !!r.enumerable, 488 s = !!r && !!r.noTargetGet; 489 "function" == typeof n && ("string" != typeof e || c(n, "name") || R(n, "name", e), (r = a(n)).source || (r.source = u.join("string" == typeof e ? e : ""))), t !== b ? (i ? !s && t[e] && (o = !0) : delete t[e], o ? t[e] = n : R(t, e, n)) : o ? t[e] = n : h(e, n) 490 })(Function.prototype, "toString", function () { 491 return "function" == typeof this && e(this).source || K(this) 492 }) 493 }), 494 pt = b, 495 dt = Math.ceil, 496 vt = Math.floor, 497 gt = Math.min, 498 yt = Math.max, 499 mt = Math.min, 500 bt = function (a) { 501 return function (t, e, n) { 502 var r, i = u(t), 503 o = rt(i.length), 504 s = function (t, e) { 505 t = nt(t); 506 return t < 0 ? yt(t + e, 0) : mt(t, e) 507 }(n, o); 508 if (a && e != e) { 509 for (; s < o;) 510 if ((r = i[s++]) != r) return !0 511 } else 512 for (; s < o; s++) 513 if ((a || s in i) && i[s] === e) return a || s || 0; 514 return !a && -1 515 } 516 }, 517 wt = { 518 includes: bt(!0), 519 indexOf: bt(!1) 520 }.indexOf, 521 _t = ["constructor", "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable", "toLocaleString", "toString", "valueOf"], 522 It = _t.concat("length", "prototype"), 523 Tt = { 524 f: Object.getOwnPropertyNames || function (t) { 525 return it(t, It) 526 } 527 }, 528 Et = { 529 f: Object.getOwnPropertySymbols 530 }, 531 St = et("Reflect", "ownKeys") || function (t) { 532 var e = Tt.f(m(t)), 533 n = Et.f; 534 return n ? e.concat(n(t)) : e 535 }, 536 Ct = /#|\.prototype\./, 537 o = function (t, e) { 538 t = At[Nt(t)]; 539 return t == Rt || t != kt && ("function" == typeof e ? g(e) : !!e) 540 }, 541 Nt = o.normalize = function (t) { 542 return String(t).replace(Ct, ".").toLowerCase() 543 }, 544 At = o.data = {}, 545 kt = o.NATIVE = "N", 546 Rt = o.POLYFILL = "P", 547 Pt = o, 548 Ot = N.f, 549 t = !g(function () { 550 function t() {} 551 return t.prototype.constructor = null, Object.getPrototypeOf(new t) !== t.prototype 552 }), 553 Dt = J("IE_PROTO"), 554 xt = Object.prototype, 555 Lt = t ? Object.getPrototypeOf : function (t) { 556 return t = at(t), c(t, Dt) ? t[Dt] : "function" == typeof t.constructor && t instanceof t.constructor ? t.constructor.prototype : t instanceof Object ? xt : null 557 }, 558 Mt = Object.setPrototypeOf || ("__proto__" in {} ? function () { 559 var n, r = !1, 560 t = {}; 561 try { 562 (n = Object.getOwnPropertyDescriptor(Object.prototype, "__proto__").set).call(t, []), r = t instanceof Array 563 } catch (t) {} 564 return function (t, e) { 565 return m(t), 566 function (t) { 567 if (!y(t) && null !== t) throw TypeError("Can't set " + String(t) + " as a prototype") 568 }(e), r ? n.call(t, e) : t.__proto__ = e, t 569 } 570 }() : void 0), 571 Ft = Object.keys || function (t) { 572 return it(t, _t) 573 }, 574 Ut = f ? Object.defineProperties : function (t, e) { 575 m(t); 576 for (var n, r = Ft(e), i = r.length, o = 0; o < i;) k.f(t, n = r[o++], e[n]); 577 return t 578 }, 579 jt = et("document", "documentElement"), 580 qt = "prototype", 581 Vt = "script", 582 Bt = J("IE_PROTO"), 583 Kt = function () { 584 try { 585 ht = document.domain && new ActiveXObject("htmlfile") 586 } catch (t) {} 587 var t; 588 Kt = ht ? function (t) { 589 t.write(ct("")), t.close(); 590 var e = t.parentWindow.Object; 591 return t = null, e 592 }(ht) : ((t = n("iframe")).style.display = "none", jt.appendChild(t), t.src = String("javascript:"), (t = t.contentWindow.document).open(), t.write(ct("document.F=Object")), t.close(), t.F); 593 for (var e = _t.length; e--;) delete Kt[qt][_t[e]]; 594 return Kt() 595 }; 596 $[Bt] = !0; 597 598 function Wt(t) { 599 return c(Xt, t) || (Yt && c(Jt, t) ? Xt[t] = Jt[t] : Xt[t] = $t("Symbol." + t)), Xt[t] 600 } 601 602 function Ht(t) { 603 return void 0 !== t && (Zt.Array === t || ee[te] === t) 604 } 605 606 function Gt(t) { 607 if ("function" != typeof t) throw TypeError(String(t) + " is not a function"); 608 return t 609 } 610 611 function zt(r, i, t) { 612 if (Gt(r), void 0 === i) return r; 613 switch (t) { 614 case 0: 615 return function () { 616 return r.call(i) 617 }; 618 case 1: 619 return function (t) { 620 return r.call(i, t) 621 }; 622 case 2: 623 return function (t, e) { 624 return r.call(i, t, e) 625 }; 626 case 3: 627 return function (t, e, n) { 628 return r.call(i, t, e, n) 629 } 630 } 631 return function () { 632 return r.apply(i, arguments) 633 } 634 } 635 var Qt = Object.create || function (t, e) { 636 var n; 637 return null !== t ? (ut[qt] = m(t), n = new ut, ut[qt] = null, n[Bt] = t)
637: n = Kt(), void 0 === e ? n : Ut(n, e) 638 }, 639 Yt = !!Object.getOwnPropertySymbols && !g(function () { 640 return !String(Symbol()) 641 }), 642 a = Yt && !Symbol.sham && "symbol" == typeof Symbol.iterator, 643 Xt = z("wks"), 644 Jt = b.Symbol, 645 $t = a ? Jt : Jt && Jt.withoutSetter || x, 646 Zt = {}, 647 te = Wt("iterator"), 648 ee = Array.prototype, 649 P = {}; 650 P[Wt("toStringTag")] = "z"; 651 652 function ne(t) { 653 if (null != t) return t[ce] || t["@@iterator"] || Zt[ue(t)] 654 } 655 656 function re(t) { 657 var e = t.return; 658 return void 0 !== e && m(e.call(t)).value 659 } 660 661 function ie(t, e) { 662 this.stopped = t, this.result = e 663 } 664 665 function oe(t, e, n) { 666 function r(t) { 667 return o && re(o), new ie(!0, t) 668 } 669 670 function i(t) { 671 return f ? (m(t), d ? v(t[0], t[1], r) : v(t[0], t[1])) : d ? v(t, r) : v(t) 672 } 673 var o, s, a, u, c, h, l = n && n.that, 674 f = !(!n || !n.AS_ENTRIES), 675 p = !(!n || !n.IS_ITERATOR), 676 d = !(!n || !n.INTERRUPTED), 677 v = zt(e, l, 1 + f + d); 678 if (p) o = t; 679 else { 680 if ("function" != typeof (p = ne(t))) throw TypeError("Target is not iterable"); 681 if (Ht(p)) { 682 for (s = 0, a = rt(t.length); s < a; s++) 683 if ((u = i(t[s])) && u instanceof ie) return u; 684 return new ie(!1) 685 } 686 o = p.call(t) 687 } 688 for (c = o.next; !(h = c.call(o)).done;) { 689 try { 690 u = i(h.value) 691 } catch (t) { 692 throw re(o), t 693 } 694 if ("object" == typeof u && u && u instanceof ie) return u 695 } 696 return new ie(!1) 697 } 698 var W = "[object z]" === String(P), 699 se = Wt("toStringTag"), 700 ae = "Arguments" == r(function () { 701 return arguments 702 }()), 703 ue = W ? r : function (t) { 704 var e; 705 return void 0 === t ? "Undefined" : null === t ? "Null" : "string" == typeof (t = function (t, e) { 706 try { 707 return t[e] 708 } catch (t) {} 709 }(e = Object(t), se)) ? t : ae ? r(e) : "Object" == (t = r(e)) && "function" == typeof e.callee ? "Arguments" : t 710 }, 711 ce = Wt("iterator"), 712 he = function (t, e) { 713 var n = this; 714 if (!(n instanceof he)) return new he(t, e); 715 Mt && (n = Mt(new Error(void 0), Lt(n))), void 0 !== e && R(n, "message", String(e)); 716 e = []; 717 return oe(t, e.push, { 718 that: e 719 }), R(n, "errors", e), n 720 }; 721 he.prototype = Qt(Error.prototype, { 722 constructor: v(5, he), 723 message: v(5, ""), 724 name: v(5, "AggregateError") 725 }), st({ 726 global: !0 727 }, { 728 AggregateError: he 729 }); 730 H = W ? {}.toString : function () { 731 return "[object " + ue(this) + "]" 732 }; 733 W || ft(Object.prototype, "toString", H, { 734 unsafe: !0 735 }); 736 737 function le(t, e, n) { 738 for (var r in e) ft(t, r, e[r], n); 739 return t 740 } 741 742 function fe(t, e, n) { 743 t && !c(t = n ? t : t.prototype, ye) && ge(t, ye, { 744 configurable: !0, 745 value: e 746 }) 747 } 748 749 function pe(t) { 750 var e = et(t), 751 t = k.f; 752 f && e && !e[me] && t(e, me, { 753 configurable: !0, 754 get: function () { 755 return this 756 } 757 }) 758 } 759 760 function de(t, e, n) { 761 if (!(t instanceof e)) throw TypeError("Incorrect " + (n ? n + " " : "") + "invocation"); 762 return t 763 } 764 var ve = b.Promise, 765 ge = k.f, 766 ye = Wt("toStringTag"), 767 me = Wt("species"), 768 be = Wt("iterator"), 769 we = !1; 770 try { 771 var _e = 0, 772 Ie = { 773 next: function () { 774 return { 775 done: !!_e++ 776 } 777 }, 778 return: function () { 779 we = !0 780 } 781 }; 782 Ie[be] = function () { 783 return this 784 }, Array.from(Ie, function () { 785 throw 2 786 }) 787 } catch (Fs) {} 788 789 function Te(t, e) { 790 if (!e && !we) return !1; 791 var n = !1; 792 try { 793 var r = {}; 794 r[be] = function () { 795 return { 796 next: function () { 797 return { 798 done: n = !0 799 } 800 } 801 } 802 }, t(r) 803 } catch (t) {} 804 return n 805 } 806 807 function Ee(t, e) { 808 var n; 809 return void 0 === (t = m(t).constructor) || null == (n = m(t)[Ae]) ? e : Gt(n) 810 } 811 812 function Se(t) { 813 var e; 814 xe.hasOwnProperty(t) && (e = xe[t], delete xe[t], e()) 815 } 816 817 function Ce(t) { 818 return function () { 819 Se(t) 820 } 821 } 822 var Ne, Ae = Wt("species"), 823 Z = et("navigator", "userAgent") || "", 824 bt = /(iphone|ipod|ipad).*applewebkit/i.test(Z), 825 ke = "process" == r(b.process), 826 Re = b.location, 827 o = b.setImmediate, 828 t = b.clearImmediate, 829 Pe = b.process, 830 P = b.MessageChannel, 831 Oe = b.Dispatch, 832 De = 0, 833 xe = {}, 834 Le = "onreadystatechange", 835 W = function (t) { 836 Se(t.data) 837 }, 838 H = function (t) { 839 b.postMessage(t + "", Re.protocol + "//" + Re.host) 840 }; 841 o && t || (o = function (t) { 842 for (var e = [], n = 1; n < arguments.length;) e.push(arguments[n++]); 843 return xe[++De] = function () { 844 ("function" == typeof t ? t : Function(t)).apply(void 0, e) 845 }, Ne(De), De 846 }, t = function (t) { 847 delete xe[t] 848 }, ke ? Ne = function (t) { 849 Pe.nextTick(Ce(t)) 850 } : Oe && Oe.now ? Ne = function (t) { 851 Oe.now(Ce(t)) 852 } : P && !bt ? (We = (P = new P).port2, P.port1.onmessage = W, Ne = zt(We.postMessage, We, 1)) : b.addEventListener && "function" == typeof postMessage && !b.importScripts && Re && "file:" !== Re.protocol && !g(H) ? (Ne = H, b.addEventListener("message", W, !1)) : Ne = Le in n("script") ? function (t) { 853 jt.appendChild(n("script"))[Le] = function () { 854 jt.removeChild(this), Se(t) 855 } 856 } : function (t) { 857 setTimeout(Ce(t), 0) 858 }); 859 var Me, Fe, Ue, je, qe, Ve, Be, Ke, We = { 860 set: o, 861 clear: t 862 }, 863 H = N.f, 864 He = We.set, 865 W = b.MutationObserver || b.WebKitMutationObserver, 866 o = b.document, 867 Ge = b.process, 868 t = b.Promise, 869 H = H(b, "queueMicrotask"), 870 H = H && H.value; 871 H || (Me = function () { 872 var t, e; 873 for (ke && (t = Ge.domain) && t.exit(); Fe;) { 874 e = Fe.fn, Fe = Fe.next; 875 try { 876 e() 877 } catch (t) { 878 throw Fe ? je() : Ue = void 0, t 879 } 880 } 881 Ue = void 0, t && t.enter() 882 }, je = !bt && !ke && W && o ? (qe = !0, Ve = o.createTextNode(""), new W(Me).observe(Ve, { 883 characterData: !0 884 }), function () { 885 Ve.data = qe = !qe 886 }) : t && t.resolve ? (Be = t.resolve(void 0), Ke = Be.then, function () { 887 Ke.call(Be, Me) 888 }) : ke ? function () { 889 Ge.nextTick(Me) 890 } : function () { 891 He.call(b, Me) 892 }); 893 894 function ze(t) { 895 var n, r; 896 this.promise = new t(function (t, e) { 897 if (void 0 !== n || void 0 !== r) throw TypeError("Bad Promise constructor"); 898 n = t, r = e 899 }), this.resolve = Gt(n), this.reject = Gt(r) 900 } 901 902 function Qe(t, e) { 903 return m(t), y(e) && e.constructor === t ? e : ((0, (t = Je.f(t)).resolve)(e), t.promise) 904 } 905 906 function Ye(t) { 907 try { 908 return { 909 error: !1, 910 value: t() 911 } 912 } catch (t) { 913 return { 914 error: !0, 915 value: t 916 } 917 } 918 } 919 var Xe = H || function (t) { 920 t = { 921 fn: t, 922 next: void 0 923 }; 924 Ue && (Ue.next = t), Fe || (Fe = t, je()), Ue = t 925 }, 926 Je = { 927 f: function (t) { 928 return new ze(t) 929 } 930 }, 931 H = b.process, 932 H = H && H.versions, 933 H = H && H.v8; 934 H ? Pn = (Sn = H.split("."))[0] + Sn[1] : Z && (!(Sn = Z.match(/Edge\/(\d+)/)) || 74 <= Sn[1]) && (Sn = Z.match(/Chrome\/(\d+)/)) && (Pn = Sn[1]); 935 936 function $e(t) { 937 var e; 938 return !(!y(t) || "function" != typeof (e = t.then)) && e 939 } 940 941 function Ze(l, f) { 942 var p; 943 l.notified || (l.notified = !0, p = l.reactions, Xe(function () { 944 for (var t = l.value, e = 1 == l.state, n = 0; p.length > n;) { 945 var r, i, o, s = p[n++], 946 a = e ? s.ok : s.fail, 947 u = s.resolve, 948 c = s.reject, 949 h = s.domain; 950 try { 951 a ? (e || (2 === l.rejection && An(l), l.rejection = 1), !0 === a ? r = t : (h && h.enter(), r = a(t), h && (h.exit(), o = !0)), r === s.promise ? c(gn("Promise-chain cycle")) : (i = $e(r)) ? i.call(r, u, c) : u(r)) : c(t) 952 } catch (t) { 953 h && !o && h.exit(), c(t) 954 } 955 } 956 l.reactions = [], l.notified = !1, f && !l.rejection && Cn(l) 957 })) 958 } 959 960 function tn(t, e, n) { 961 var r, i; 962 In ? ((r = yn.createEvent("Event")).promise = e, r.reason = n, r.initEvent(t, !1, !0), b.dispatchEvent(r)) : r = { 963 promise: e, 964 reason: n 965 }, !Tn && (i = b["on" + t]) ? i(r) : t === En && function (t, e) { 966 var n = b.console; 967 n && n.error && (1 === arguments.length ? n.error(t) : n.error(t, e)) 968 }("Unhandled promise rejection", n) 969 } 970 971 function en(e, n, r) { 972 return function (t) { 973 e(n, t, r) 974 } 975 } 976 977 function nn(t, e, n) { 978 t.done || (t.done = !0, (t = n ? n : t).value = e, t.state = 2, Ze(t, !0)) 979 } 980 var rn, on, sn, an, un = Pn && +Pn, 981 cn = We.set, 982 hn = Wt("species"), 983 ln = "Promise", 984 fn = lt.get, 985 pn = lt.set, 986 dn = lt.getterFor(ln), 987 vn = ve, 988 gn = b.TypeError, 989 yn = b.document, 990 mn = b.process, 991 bn = et("fetch"), 992 wn = Je.f, 993 _n = wn, 994 In = !!(yn && yn.createEvent && b.dispatchEvent), 995 Tn = "function" == typeof PromiseRejectionEvent, 996 En = "unhandledrejection", 997 Z = Pt(ln, function () { 998 if (!(K(vn) !== String(vn))) { 999 if (66 === un) return !0; 1000 if (!ke && !Tn) return !0 1001 } 1002 if (51 <= un && /native code/.test(vn)) return !1; 1003 1004 function t(t) { 1005 t(function () {}, function () {}) 1006 } 1007 var e = vn.resolve(1); 1008 return (e.constructor = {})[hn] = t, !(e.then(function () {}) instanceof t) 1009 }), 1010 Sn = Z || !Te(function (t) { 1011 vn.all(t).catch(function () {}) 1012 }), 1013 Cn = function (i) { 1014 cn.call(b, function () { 1015 var t, e = i.facade, 1016 n = i.value, 1017 r = Nn(i); 1018 if (r && (t = Ye(function () { 1019 ke ? mn.emit("unhandledRejection", n, e) : tn(En, e, n) 1020 }), i.rejection = ke || Nn(i) ? 2 : 1, t.error)) throw t.value 1021 }) 1022 }, 1023 Nn = function (t) { 1024 return 1 !== t.rejection && !t.parent 1025 }, 1026 An = function (e) { 1027 cn.call(b, function () { 1028 var t = e.facade; 1029 ke ? mn.emit("rejectionHandled", t) : tn("rejectionhandled", t, e.value) 1030 }) 1031 }, 1032 kn = function (n, t, e) { 1033 if (!n.done) { 1034 n.done = !0, e && (n = e); 1035 try { 1036 if (n.facade === t) throw gn("Promise can't be resolved
vendor: 5,126 bytes, lines 1036-1201
1036itself"); 1037 var r = $e(t); 1038 r ? Xe(function () { 1039 var e = { 1040 done: !1 1041 }; 1042 try { 1043 r.call(t, en(kn, e, n), en(nn, e, n)) 1044 } catch (t) { 1045 nn(e, t, n) 1046 } 1047 }) : (n.value = t, n.state = 1, Ze(n, !1)) 1048 } catch (t) { 1049 nn({ 1050 done: !1 1051 }, t, n) 1052 } 1053 } 1054 }; 1055 Z && (vn = function (t) { 1056 de(this, vn, ln), Gt(t), rn.call(this); 1057 var e = fn(this); 1058 try { 1059 t(en(kn, e), en(nn, e)) 1060 } catch (t) { 1061 nn(e, t) 1062 } 1063 }, (rn = function (t) { 1064 pn(this, { 1065 type: ln, 1066 done: !1, 1067 notified: !1, 1068 parent: !1, 1069 reactions: [], 1070 rejection: !1, 1071 state: 0, 1072 value: void 0 1073 }) 1074 }).prototype = le(vn.prototype, { 1075 then: function (t, e) { 1076 var n = dn(this), 1077 r = wn(Ee(this, vn)); 1078 return r.ok = "function" != typeof t || t, r.fail = "function" == typeof e && e, r.domain = ke ? mn.domain : void 0, n.parent = !0, n.reactions.push(r), 0 != n.state && Ze(n, !1), r.promise 1079 }, 1080 catch: function (t) { 1081 return this.then(void 0, t) 1082 } 1083 }), on = function () { 1084 var t = new rn, 1085 e = fn(t); 1086 this.promise = t, this.resolve = en(kn, e), this.reject = en(nn, e) 1087 }, Je.f = wn = function (t) { 1088 return t === vn || t === sn ? new on : _n(t) 1089 }, "function" == typeof ve && (an = ve.prototype.then, ft(ve.prototype, "then", function (t, e) { 1090 var n = this; 1091 return new vn(function (t, e) { 1092 an.call(n, t, e) 1093 }).then(t, e) 1094 }, { 1095 unsafe: !0 1096 }), "function" == typeof bn && st({ 1097 global: !0, 1098 enumerable: !0, 1099 forced: !0 1100 }, { 1101 fetch: function (t) { 1102 return Qe(vn, bn.apply(b, arguments)) 1103 } 1104 }))), st({ 1105 global: !0, 1106 wrap: !0, 1107 forced: Z 1108 }, { 1109 Promise: vn 1110 }), fe(vn, ln, !1), pe(ln), sn = et(ln), st({ 1111 target: ln, 1112 stat: !0, 1113 forced: Z 1114 }, { 1115 reject: function (t) { 1116 var e = wn(this); 1117 return e.reject.call(void 0, t), e.promise 1118 } 1119 }), st({ 1120 target: ln, 1121 stat: !0, 1122 forced: Z 1123 }, { 1124 resolve: function (t) { 1125 return Qe(this, t) 1126 } 1127 }), st({ 1128 target: ln, 1129 stat: !0, 1130 forced: Sn 1131 }, { 1132 all: function (t) { 1133 var a = this, 1134 e = wn(a), 1135 u = e.resolve, 1136 c = e.reject, 1137 n = Ye(function () { 1138 var r = Gt(a.resolve), 1139 i = [], 1140 o = 0, 1141 s = 1; 1142 oe(t, function (t) { 1143 var e = o++, 1144 n = !1; 1145 i.push(void 0), s++, r.call(a, t).then(function (t) { 1146 n || (n = !0, i[e] = t, --s || u(i)) 1147 }, c) 1148 }), --s || u(i) 1149 }); 1150 return n.error && c(n.value), e.promise 1151 }, 1152 race: function (t) { 1153 var n = this, 1154 r = wn(n), 1155 i = r.reject, 1156 e = Ye(function () { 1157 var e = Gt(n.resolve); 1158 oe(t, function (t) { 1159 e.call(n, t).then(r.resolve, i) 1160 }) 1161 }); 1162 return e.error && i(e.value), r.promise 1163 } 1164 }), st({ 1165 target: "Promise", 1166 stat: !0 1167 }, { 1168 allSettled: function (t) { 1169 var a = this, 1170 e = Je.f(a), 1171 u = e.resolve, 1172 n = e.reject, 1173 r = Ye(function () { 1174 var r = Gt(a.resolve), 1175 i = [], 1176 o = 0, 1177 s = 1; 1178 oe(t, function (t) { 1179 var e = o++, 1180 n = !1; 1181 i.push(void 0), s++, r.call(a, t).then(function (t) { 1182 n || (n = !0, i[e] = { 1183 status: "fulfilled", 1184 value: t 1185 }, --s || u(i)) 1186 }, function (t) { 1187 n || (n = !0, i[e] = { 1188 status: "rejected", 1189 reason: t 1190 }, --s || u(i)) 1191 }) 1192 }), --s || u(i) 1193 }); 1194 return r.error && n(r.value), e.promise 1195 } 1196 }); 1197 var Rn = "No one promise resolved"; 1198 st({ 1199 target: "Promise", 1200 stat: !0 1201 }, {
1202 any: function (t) { 1203 var u = this, 1204 e = Je.f(u), 1205 c = e.resolve, 1206 h = e.reject, 1207 n = Ye(function () { 1208 var r = Gt(u.resolve), 1209 i = [], 1210 o = 0, 1211 s = 1, 1212 a = !1; 1213 oe(t, function (t) { 1214 var e = o++, 1215 n = !1; 1216 i.push(void 0), s++, r.call(u, t).then(function (t) { 1217 n || a || (a = !0, c(t)) 1218 }, function (t) { 1219 n || a || (n = !0, i[e] = t, --s || h(new(et("AggregateError"))(i, Rn))) 1220 }) 1221 }), --s || h(new(et("AggregateError"))(i, Rn)) 1222 }); 1223 return n.error && h(n.value), e.promise 1224 } 1225 }); 1226 var Pn = !!ve && g(function () { 1227 ve.prototype.finally.call({ 1228 then: function () {} 1229 }, function () {}) 1230 }); 1231 st({ 1232 target: "Promise", 1233 proto: !0, 1234 real: !0, 1235 forced: Pn 1236 }, { 1237 finally: function (e) { 1238 var n = Ee(this, et("Promise")), 1239 t = "function" == typeof e; 1240 return this.then(t ? function (t) { 1241 return Qe(n, e()).then(function () { 1242 return t 1243 }) 1244 } : e, t ? function (t) { 1245 return Qe(n, e()).then(function () { 1246 throw t 1247 }) 1248 } : e) 1249 } 1250 }), "function" != typeof ve || ve.prototype.finally || ft(ve.prototype, "finally", et("Promise").prototype.finally); 1251 We = function (o) { 1252 return function (t, e) { 1253 var n, r = String(s(t)), 1254 i = nt(e), 1255 t = r.length; 1256 return i < 0 || t <= i ? o ? "" : void 0 : (e = r.charCodeAt(i)) < 55296 || 56319 < e || i + 1 === t || (n = r.charCodeAt(i + 1)) < 56320 || 57343 < n ? o ? r.charAt(i) : e : o ? r.slice(i, i + 2) : n - 56320 + (e - 55296 << 10) + 65536 1257 } 1258 }, Z = { 1259 codeAt: We(!1), 1260 charAt: We(!0) 1261 }, Sn = Wt("iterator"), Pn = !1; 1262 [].keys && ("next" in (Qn = [].keys()) ? (lr = Lt(Lt(Qn))) !== Object.prototype && (dr = lr) : Pn = !0), c(dr = null == dr ? {} : dr, Sn) || R(dr, Sn, function () { 1263 return this 1264 }); 1265 1266 function On() { 1267 return this 1268 } 1269 1270 function Dn() { 1271 return this 1272 } 1273 1274 function xn(t, e, n, r, i, o, s) { 1275 function a(t) { 1276 if (t === i && d) return d; 1277 if (!Fn && t in f) return f[t]; 1278 switch (t) { 1279 case "keys": 1280 case jn: 1281 case qn: 1282 return function () { 1283 return new n(this, t) 1284 } 1285 } 1286 return function () { 1287 return new n(this) 1288 } 1289 }! function (t, e, n) { 1290 e += " Iterator"; 1291 t.prototype = Qt(Ln, { 1292 next: v(1, n) 1293 }), fe(t, e, !1), Zt[e] = On 1294 }(n, e, r); 1295 var u, c, h = e + " Iterator", 1296 l = !1, 1297 f = t.prototype, 1298 p = f[Un] || f["@@iterator"] || i && f[i], 1299 d = !Fn && p || a(i); 1300 if ((r = "Array" == e && f.entries || p) && (t = Lt(r.call(new t)), Mn !== Object.prototype && t.next && (Lt(t) !== Mn && (Mt ? Mt(t, Mn) : "function" != typeof t[Un] && R(t, Un, Dn)), fe(t, h, !0))), i == jn && p && p.name !== jn && (l = !0, d = function () { 1301 return p.call(this) 1302 }), f[Un] !== d && R(f, Un, d), Zt[e] = d, i) 1303 if (u = { 1304 values: a(jn), 1305 keys: o ? d : a("keys"), 1306 entries: a(qn) 1307 }, s) 1308 for (c in u) !Fn && !l && c in f || ft(f, c, u[c]); 1309 else st({ 1310 target: e, 1311 proto: !0, 1312 forced: Fn || l 1313 }, u); 1314 return u 1315 } 1316 var We = { 1317 IteratorPrototype: dr, 1318 BUGGY_SAFARI_ITERATORS: Pn 1319 }, 1320 Ln = We.IteratorPrototype, 1321 Mn = We.IteratorPrototype,
1322 Fn = We.BUGGY_SAFARI_ITERATORS, 1323 Un = Wt("iterator"), 1324 jn = "values", 1325 qn = "entries", 1326 Vn = Z.charAt, 1327 Bn = "String Iterator", 1328 Kn = lt.set, 1329 Wn = lt.getterFor(Bn); 1330 xn(String, "String", function (t) { 1331 Kn(this, { 1332 type: Bn, 1333 string: String(t), 1334 index: 0 1335 }) 1336 }, function () { 1337 var t = Wn(this), 1338 e = t.string, 1339 n = t.index; 1340 return n >= e.length ? { 1341 value: void 0, 1342 done: !0 1343 } : (n = Vn(e, n), t.index += n.length, { 1344 value: n, 1345 done: !1 1346 }) 1347 }); 1348 var Hn = { 1349 CSSRuleList: 0, 1350 CSSStyleDeclaration: 0, 1351 CSSValueList: 0, 1352 ClientRectList: 0, 1353 DOMRectList: 0, 1354 DOMStringList: 0, 1355 DOMTokenList: 1, 1356 DataTransferItemList: 0, 1357 FileList: 0, 1358 HTMLAllCollection: 0, 1359 HTMLCollection: 0, 1360 HTMLFormElement: 0, 1361 HTMLSelectElement: 0, 1362 MediaList: 0, 1363 MimeTypeArray: 0, 1364 NamedNodeMap: 0, 1365 NodeList: 1, 1366 PaintRequestList: 0, 1367 Plugin: 0, 1368 PluginArray: 0, 1369 SVGLengthList: 0, 1370 SVGNumberList: 0, 1371 SVGPathSegList: 0, 1372 SVGPointList: 0, 1373 SVGStringList: 0, 1374 SVGTransformList: 0, 1375 SourceBufferList: 0, 1376 StyleSheetList: 0, 1377 TextTrackCueList: 0, 1378 TextTrackList: 0, 1379 TouchList: 0 1380 }, 1381 Gn = Wt("unscopables"), 1382 zn = Array.prototype; 1383 null == zn[Gn] && k.f(zn, Gn, { 1384 configurable: !0, 1385 value: Qt(null) 1386 }); 1387 var Qn = function (t) { 1388 zn[Gn][t] = !0 1389 }, 1390 Yn = "Array Iterator", 1391 Xn = lt.set, 1392 Jn = lt.getterFor(Yn), 1393 $n = xn(Array, "Array", function (t, e) { 1394 Xn(this, { 1395 type: Yn, 1396 target: u(t), 1397 index: 0, 1398 kind: e 1399 }) 1400 }, function () { 1401 var t = Jn(this), 1402 e = t.target, 1403 n = t.kind, 1404 r = t.index++; 1405 return !e || r >= e.length ? { 1406 value: t.target = void 0, 1407 done: !0 1408 } : "keys" == n ? { 1409 value: r, 1410 done: !1 1411 } : "values" == n ? { 1412 value: e[r], 1413 done: !1 1414 } : { 1415 value: [r, e[r]], 1416 done: !1 1417 } 1418 }, "values"); 1419 Zt.Arguments = Zt.Array, Qn("keys"), Qn("values"), Qn("entries"); 1420 var Zn, tr = Wt("iterator"), 1421 er = Wt("toStringTag"), 1422 nr = $n.values; 1423 for (Zn in Hn) { 1424 var rr = b[Zn], 1425 ir = rr && rr.prototype; 1426 if (ir) { 1427 if (ir[tr] !== nr) try { 1428 R(ir, tr, nr) 1429 } catch (Fs) { 1430 ir[tr] = nr 1431 } 1432 if (ir[er] || R(ir, er, Zn), Hn[Zn]) 1433 for (var or in $n) 1434 if (ir[or] !== $n[or]) try { 1435 R(ir, or, $n[or]) 1436 } catch (Fs) { 1437 ir[or] = $n[or] 1438 } 1439 } 1440 } 1441 pt.Promise; 1442 st({ 1443 target: "Promise", 1444 stat: !0 1445 }, { 1446 try: function (t) { 1447 var e = Je.f(this), 1448 t = Ye(t); 1449 return (t.error ? e.reject : e.resolve)(t.value), e.promise 1450 } 1451 }); 1452 1453 function sr(t, e) { 1454 var n; 1455 return new(void 0 === (n = ur(t) && ("function" == typeof (n = t.constructor) && (n === Array || ur(n.prototype)) || y(n) && null === (n = n[cr])) ? void 0 : n) ? Array : n)(0 === e ? 0 : e) 1456 } 1457 1458 function ar(t) { 1459 throw t 1460 } 1461 var ur = Array.isArray || function (t) { 1462 return "Array" == r(t) 1463 }, 1464 cr = Wt("species"), 1465 hr = [].push, 1466 lr = function (f) { 1467 var p = 1 == f, 1468 d = 2 == f, 1469 v = 3 == f, 1470 g = 4 == f, 1471 y = 6 == f, 1472 m = 7 == f, 1473 b = 5 == f || y; 1474 return function (t, e, n, r) { 1475 for (var i, o, s = at(t), a = _(s), u = zt(e, n, 3), c = rt(a.length), h = 0, r = r || sr, l = p ? r(t, c) : d || m ? r(t, 0) : void 0; h < c; h++) 1476 if ((b || h in a) && (o = u(i = a[h], h, s), f)) 1477 if (p) l[h] = o; 1478 else if (o) switch (f) { 1479 case 3: 1480 return !0; 1481 case 5: 1482 return i; 1483 case 6: 1484 return h; 1485 case 2: 1486 hr.call(l, i) 1487 } else switch (f) { 1488 case 4: 1489 return !1; 1490 case 7: 1491 hr.call(l, i) 1492 } 1493 return y ? -1 : v || g ? g : l 1494 } 1495 }, 1496 Sn = {
1497 forEach: lr(0), 1498 map: lr(1), 1499 filter: lr(2), 1500 some: lr(3), 1501 every: lr(4), 1502 find: lr(5), 1503 findIndex: lr(6), 1504 filterOut: lr(7) 1505 }, 1506 fr = Object.defineProperty, 1507 pr = {}, 1508 dr = function (t, e) { 1509 if (c(pr, t)) return pr[t]; 1510 var n = [][t], 1511 r = !!c(e = e || {}, "ACCESSORS") && e.ACCESSORS, 1512 i = c(e, 0) ? e[0] : ar, 1513 o = c(e, 1) ? e[1] : void 0; 1514 return pr[t] = !!n && !g(function () { 1515 if (r && !f) return 1; 1516 var t = { 1517 length: -1 1518 }; 1519 r ? fr(t, 1, { 1520 enumerable: !0, 1521 get: ar 1522 }) : t[1] = 1, n.call(t, i, o) 1523 }) 1524 }, 1525 vr = Sn.find, 1526 Pn = "find", 1527 gr = !0, 1528 We = dr(Pn); 1529 Pn in [] && Array(1)[Pn](function () { 1530 gr = !1 1531 }), st({ 1532 target: "Array", 1533 proto: !0, 1534 forced: gr || !We 1535 }, { 1536 find: function (t) { 1537 return vr(this, t, 1 < arguments.length ? arguments[1] : void 0) 1538 } 1539 }), Qn(Pn); 1540 var yr = Function.call, 1541 Z = function (t, e, n) { 1542 return zt(yr, b[t].prototype[e], n) 1543 }, 1544 mr = (Z("Array", "find"), Sn.findIndex), 1545 lr = "findIndex", 1546 br = !0, 1547 We = dr(lr); 1548 lr in [] && Array(1)[lr](function () { 1549 br = !1 1550 }), st({ 1551 target: "Array", 1552 proto: !0, 1553 forced: br || !We 1554 }, { 1555 findIndex: function (t) { 1556 return mr(this, t, 1 < arguments.length ? arguments[1] : void 0) 1557 } 1558 }), Qn(lr); 1559 1560 function wr(t, e, n) { 1561 (e = i(e)) in t ? k.f(t, e, v(0, n)) : t[e] = n 1562 } 1563 Z("Array", "findIndex"); 1564 Pn = !Te(function (t) { 1565 Array.from(t) 1566 }); 1567 st({ 1568 target: "Array", 1569 stat: !0, 1570 forced: Pn 1571 }, { 1572 from: function (t) { 1573 var e, n, r, i, o, s, a = at(t), 1574 u = "function" == typeof this ? this : Array, 1575 c = arguments.length, 1576 h = 1 < c ? arguments[1] : void 0, 1577 l = void 0 !== h, 1578 t = ne(a), 1579 f = 0; 1580 if (l && (h = zt(h, 2 < c ? arguments[2] : void 0, 2)), null == t || u == Array && Ht(t)) 1581 for (n = new u(e = rt(a.length)); f < e; f++) s = l ? h(a[f], f) : a[f], wr(n, f, s); 1582 else 1583 for (o = (i = t.call(a)).next, n = new u; !(r = o.call(i)).done; f++) s = l ? function (e, t, n, r) { 1584 try { 1585 return r ? t(m(n)[0], n[1]) : t(n) 1586 } catch (t) { 1587 throw re(e), t 1588 } 1589 }(i, h, [r.value, f], !0) : r.value, wr(n, f, s); 1590 return n.length = f, n 1591 } 1592 }); 1593 pt.Array.from; 1594 var _r, Ir, Tr = Sn.some, 1595 We = !!(Ir = []["some"]) && g(function () { 1596 Ir.call(null, _r || function () { 1597 throw 1 1598 }, 1) 1599 }), 1600 Qn = dr("some"); 1601 st({ 1602 target: "Array", 1603 proto: !0, 1604 forced: !We || !Qn 1605 }, { 1606 some: function (t) { 1607 return Tr(this, t, 1 < arguments.length ? arguments[1] : void 0) 1608 } 1609 }); 1610 Z("Array", "some"); 1611 1612 function Er(t) { 1613 return !!y(t) && (t = ue(t), c(Or, t) || c(Dr, t)) 1614 } 1615 var Sr, lr = "undefined" != typeof ArrayBuffer && "undefined" != typeof DataView, 1616 Pn = k.f, 1617 Cr = b.Int8Array, 1618 Nr = Cr && Cr.prototype, 1619 dr = b.Uint8ClampedArray, 1620 We = dr && dr.prototype, 1621 Ar = Cr && Lt(Cr), 1622 kr = Nr && Lt(Nr), 1623 Qn = Object.prototype, 1624 dr = (Qn.isPrototypeOf, Wt("toStringTag")), 1625 Rr = x("TYPED_ARRAY_TAG"), 1626 Pr = lr && !!Mt && "Opera" !== ue(b.opera), 1627 lr = !1, 1628 Or = { 1629 Int8Array: 1, 1630 Uint8Array: 1, 1631 Uint8ClampedArray: 1, 1632 Int16Array: 2, 1633 Uint16Array: 2, 1634 Int32Array: 4, 1635 Uint32Array: 4, 1636 Float32Array: 4, 1637 Float64Array: 8 1638 }, 1639 Dr = { 1640 BigInt64Array: 8, 1641 BigUint64Array: 8 1642 }; 1643 for (Sr in Or) b[Sr] || (Pr = !1);
1644 if ((!Pr || "function" != typeof Ar || Ar === Function.prototype) && (Ar = function () { 1645 throw TypeError("Incorrect invocation") 1646 }, Pr)) 1647 for (Sr in Or) b[Sr] && Mt(b[Sr], Ar); 1648 if ((!Pr || !kr || kr === Qn) && (kr = Ar.prototype, Pr)) 1649 for (Sr in Or) b[Sr] && Mt(b[Sr].prototype, kr); 1650 if (Pr && Lt(We) !== kr && Mt(We, kr), f && !c(kr, dr)) 1651 for (Sr in lr = !0, Pn(kr, dr, { 1652 get: function () { 1653 return y(this) ? this[Rr] : void 0 1654 } 1655 }), Or) b[Sr] && R(b[Sr], Rr, Sr); 1656 var We = function (t) { 1657 if (Er(t)) return t; 1658 throw TypeError("Target is not a typed array") 1659 }, 1660 Pn = function (t, e, n) { 1661 if (f) { 1662 if (n) 1663 for (var r in Or) { 1664 r = b[r]; 1665 r && c(r.prototype, t) && delete r.prototype[t] 1666 } 1667 kr[t] && !n || ft(kr, t, !n && Pr && Nr[t] || e) 1668 } 1669 }, 1670 dr = Wt("iterator"), 1671 lr = b.Uint8Array, 1672 xr = $n.values, 1673 Lr = $n.keys, 1674 Mr = $n.entries, 1675 Fr = We, 1676 We = Pn, 1677 Pn = lr && lr.prototype[dr], 1678 lr = !!Pn && ("values" == Pn.name || null == Pn.name), 1679 Pn = function () { 1680 return xr.call(Fr(this)) 1681 }; 1682 We("entries", function () { 1683 return Mr.call(Fr(this)) 1684 }), We("keys", function () { 1685 return Lr.call(Fr(this)) 1686 }), We("values", Pn, !lr), We(dr, Pn, !lr); 1687 var Ur = Object.assign, 1688 jr = Object.defineProperty, 1689 Pn = !Ur || g(function () { 1690 if (f && 1 !== Ur({ 1691 b: 1 1692 }, Ur(jr({}, "a", { 1693 enumerable: !0, 1694 get: function () { 1695 jr(this, "b", { 1696 value: 3, 1697 enumerable: !1 1698 }) 1699 } 1700 }), { 1701 b: 2 1702 })).b) return 1; 1703 var t = {}, 1704 e = {}, 1705 n = Symbol(), 1706 r = "abcdefghijklmnopqrst"; 1707 return t[n] = 7, r.split("").forEach(function (t) { 1708 e[t] = t 1709 }), 7 != Ur({}, t)[n] || Ft(Ur({}, e)).join("") != r 1710 }) ? function (t, e) { 1711 for (var n = at(t), r = arguments.length, i = 1, o = Et.f, s = p.f; i < r;) 1712 for (var a, u = _(arguments[i++]), c = o ? Ft(u).concat(o(u)) : Ft(u), h = c.length, l = 0; l < h;) a = c[l++], f && !s.call(u, a) || (n[a] = u[a]); 1713 return n 1714 } : Ur; 1715 st({ 1716 target: "Object", 1717 stat: !0, 1718 forced: Object.assign !== Pn 1719 }, { 1720 assign: Pn 1721 }); 1722 pt.Object.assign; 1723 var qr = p.f, 1724 lr = function (a) { 1725 return function (t) { 1726 for (var e, n = u(t), r = Ft(n), i = r.length, o = 0, s = []; o < i;) e = r[o++], f && !qr.call(n, e) || s.push(a ? [e, n[e]] : n[e]); 1727 return s 1728 } 1729 }, 1730 Pn = { 1731 entries: lr(!0), 1732 values: lr(!1) 1733 }, 1734 Vr = Pn.entries; 1735 st({ 1736 target: "Object", 1737 stat: !0 1738 }, { 1739 entries: function (t) { 1740 return Vr(t) 1741 } 1742 }); 1743 pt.Object.entries; 1744 var Br = Pn.values; 1745 st({ 1746 target: "Object", 1747 stat: !0 1748 }, { 1749 values: function (t) { 1750 return Br(t) 1751 } 1752 }); 1753 pt.Object.values; 1754 1755 function Kr(t) { 1756 if (y(e = t) && (void 0 !== (n = e[Wr]) ? !!n : "RegExp" == r(e))) throw TypeError("The method doesn't accept regular expressions"); 1757 var e, n; 1758 return t 1759 } 1760 var Wr = Wt("match"), 1761 Hr = Wt("match"), 1762 lr = function (e) { 1763 var n = /./; 1764 try { 1765 "/./" [e](n) 1766 } catch (t) { 1767 try { 1768 return n[Hr] = !1, "/./" [e](n) 1769 } catch (t) {} 1770 } 1771 return !1 1772 }; 1773 st({ 1774 target: "String", 1775 proto: !0, 1776 forced: !lr("includes") 1777 }, {
1778 includes: function (t) { 1779 return !!~String(s(this)).indexOf(Kr(t), 1 < arguments.length ? arguments[1] : void 0) 1780 } 1781 }); 1782 Z("String", "includes"); 1783 var Gr, Pn = N.f, 1784 zr = "".startsWith, 1785 Qr = Math.min, 1786 lr = lr("startsWith"), 1787 Gr = !(lr || (!(Gr = Pn(String.prototype, "startsWith")) || Gr.writable)); 1788 st({ 1789 target: "String", 1790 proto: !0, 1791 forced: !Gr && !lr 1792 }, { 1793 startsWith: function (t) { 1794 var e = String(s(this)); 1795 Kr(t); 1796 var n = rt(Qr(1 < arguments.length ? arguments[1] : void 0, e.length)), 1797 t = String(t); 1798 return zr ? zr.call(e, t, n) : e.slice(n, n + t.length) === t 1799 } 1800 }); 1801 Z("String", "startsWith"); 1802 st({ 1803 target: "String", 1804 proto: !0 1805 }, { 1806 repeat: "".repeat || function (t) { 1807 var e = String(s(this)), 1808 n = "", 1809 r = nt(t); 1810 if (r < 0 || r == 1 / 0) throw RangeError("Wrong number of repetitions"); 1811 for (; 0 < r; 1812 (r >>>= 1) && (e += e)) 1 & r && (n += e); 1813 return n 1814 } 1815 }); 1816 Z("String", "repeat"); 1817 var Yr, Xr = Wt("species"), 1818 Jr = Wt("isConcatSpreadable"), 1819 $r = 9007199254740991, 1820 Zr = "Maximum allowed index exceeded", 1821 lr = 51 <= un || !g(function () { 1822 var t = []; 1823 return t[Jr] = !1, t.concat()[0] !== t 1824 }), 1825 Z = (Yr = "concat", 51 <= un || !g(function () { 1826 var t = []; 1827 return (t.constructor = {})[Xr] = function () { 1828 return { 1829 foo: 1 1830 } 1831 }, 1 !== t[Yr](Boolean).foo 1832 })); 1833 st({ 1834 target: "Array", 1835 proto: !0, 1836 forced: !lr || !Z 1837 }, { 1838 concat: function (t) { 1839 for (var e, n, r, i = at(this), o = sr(i, 0), s = 0, a = -1, u = arguments.length; a < u; a++) 1840 if (function (t) { 1841 if (!y(t)) return !1; 1842 var e = t[Jr]; 1843 return void 0 !== e ? !!e : ur(t) 1844 }(r = -1 === a ? i : arguments[a])) { 1845 if (n = rt(r.length), $r < s + n) throw TypeError(Zr); 1846 for (e = 0; e < n; e++, s++) e in r && wr(o, s, r[e]) 1847 } else { 1848 if ($r <= s) throw TypeError(Zr); 1849 wr(o, s++, r) 1850 } return o.length = s, o 1851 } 1852 }); 1853 1854 function ti(t) { 1855 var e = pt.Symbol || (pt.Symbol = {}); 1856 c(e, t) || ai(e, t, { 1857 value: si.f(t) 1858 }) 1859 } 1860 1861 function ei(t, e) { 1862 var n = _i[t] = Qt(vi[li]); 1863 return fi(n, { 1864 type: hi, 1865 tag: t, 1866 description: e 1867 }), f || (n.description = e), n 1868 } 1869 1870 function ni(e, t) { 1871 m(e); 1872 var n = u(t), 1873 t = Ft(n).concat(Ri(n)); 1874 return ui(t, function (t) { 1875 f && !ki.call(n, t) || Ai(e, t, n[t]) 1876 }), e 1877 } 1878 var ri = Tt.f, 1879 ii = {}.toString, 1880 oi = "object" == typeof window && window && Object.getOwnPropertyNames ? Object.getOwnPropertyNames(window) : [], 1881 Z = { 1882 f: function (t) { 1883 return oi && "[object Window]" == ii.call(t) ? function (t) { 1884 try { 1885 return ri(t) 1886 } catch (t) { 1887 return oi.slice() 1888 } 1889 }(t) : ri(u(t)) 1890 } 1891 }, 1892 si = { 1893 f: Wt 1894 }, 1895 ai = k.f, 1896 ui = Sn.forEach, 1897 ci = J("hidden"), 1898 hi = "Symbol", 1899 li = "prototype", 1900 Sn = Wt("toPrimitive"), 1901 fi = lt.set, 1902 pi = lt.getterFor(hi), 1903 di = Object[li], 1904 vi = b.Symbol, 1905 gi = et("JSON", "stringify"), 1906 yi = N.f, 1907 mi = k.f, 1908 bi = Z.f, 1909 wi = p.f, 1910 _i = z("symbols"), 1911 Ii = z("op-symbols"), 1912 Ti = z("string-to-symbol-registry"), 1913 Ei = z("symbol-to-string-registry"), 1914 J = z("wks"), 1915 z = b.QObject,
vendor: 4,167 bytes, lines 1916-2048
1916 Si = !z || !z[li] || !z[li].findChild, 1917 Ci = f && g(function () { 1918 return 7 != Qt(mi({}, "a", { 1919 get: function () { 1920 return mi(this, "a", { 1921 value: 7 1922 }).a 1923 } 1924 })).a 1925 }) ? function (t, e, n) { 1926 var r = yi(di, e); 1927 r && delete di[e], mi(t, e, n), r && t !== di && mi(di, e, r) 1928 } : mi, 1929 Ni = a ? function (t) { 1930 return "symbol" == typeof t 1931 } : function (t) { 1932 return Object(t) instanceof vi 1933 }, 1934 Ai = function (t, e, n) { 1935 t === di && Ai(Ii, e, n), m(t); 1936 e = i(e, !0); 1937 return m(n), c(_i, e) ? (n.enumerable ? (c(t, ci) && t[ci][e] && (t[ci][e] = !1), n = Qt(n, { 1938 enumerable: v(0, !1) 1939 })) : (c(t, ci) || mi(t, ci, v(1, {})), t[ci][e] = !0), Ci(t, e, n)) : mi(t, e, n) 1940 }, 1941 ki = function (t) { 1942 var e = i(t, !0), 1943 t = wi.call(this, e); 1944 return !(this === di && c(_i, e) && !c(Ii, e)) && (!(t || !c(this, e) || !c(_i, e) || c(this, ci) && this[ci][e]) || t) 1945 }, 1946 z = function (t, e) { 1947 var n = u(t), 1948 t = i(e, !0); 1949 if (n !== di || !c(_i, t) || c(Ii, t)) { 1950 e = yi(n, t); 1951 return !e || !c(_i, t) || c(n, ci) && n[ci][t] || (e.enumerable = !0), e 1952 } 1953 }, 1954 a = function (t) { 1955 var t = bi(u(t)), 1956 e = []; 1957 return ui(t, function (t) { 1958 c(_i, t) || c($, t) || e.push(t) 1959 }), e 1960 }, 1961 Ri = function (t) { 1962 var e = t === di, 1963 t = bi(e ? Ii : u(t)), 1964 n = []; 1965 return ui(t, function (t) { 1966 !c(_i, t) || e && !c(di, t) || n.push(_i[t]) 1967 }), n 1968 }; 1969 Yt || (ft((vi = function () { 1970 if (this instanceof vi) throw TypeError("Symbol is not a constructor"); 1971 var t = arguments.length && void 0 !== arguments[0] ? String(arguments[0]) : void 0, 1972 e = x(t), 1973 n = function (t) { 1974 this === di && n.call(Ii, t), c(this, ci) && c(this[ci], e) && (this[ci][e] = !1), Ci(this, e, v(1, t)) 1975 }; 1976 return f && Si && Ci(di, e, { 1977 configurable: !0, 1978 set: n 1979 }), ei(e, t) 1980 })[li], "toString", function () { 1981 return pi(this).tag 1982 }), ft(vi, "withoutSetter", function (t) { 1983 return ei(x(t), t) 1984 }), p.f = ki, k.f = Ai, N.f = z, Tt.f = Z.f = a, Et.f = Ri, si.f = function (t) { 1985 return ei(Wt(t), t) 1986 }, f && (mi(vi[li], "description", { 1987 configurable: !0, 1988 get: function () { 1989 return pi(this).description 1990 } 1991 }), ft(di, "propertyIsEnumerable", ki, { 1992 unsafe: !0 1993 }))), st({ 1994 global: !0, 1995 wrap: !0, 1996 forced: !Yt, 1997 sham: !Yt 1998 }, { 1999 Symbol: vi 2000 }), ui(Ft(J), function (t) { 2001 ti(t) 2002 }), st({ 2003 target: hi, 2004 stat: !0, 2005 forced: !Yt 2006 }, { 2007 for: function (t) { 2008 var e = String(t); 2009 if (c(Ti, e)) return Ti[e]; 2010 t = vi(e); 2011 return Ti[e] = t, Ei[t] = e, t 2012 }, 2013 keyFor: function (t) { 2014 if (!Ni(t)) throw TypeError(t + " is not a symbol"); 2015 if (c(Ei, t)) return Ei[t] 2016 }, 2017 useSetter: function () { 2018 Si = !0 2019 }, 2020 useSimple: function () { 2021 Si = !1 2022 } 2023 }), st({ 2024 target: "Object", 2025 stat: !0, 2026 forced: !Yt, 2027 sham: !f 2028 }, { 2029 create: function (t, e) { 2030 return void 0 === e ? Qt(t) : ni(Qt(t), e) 2031 }, 2032 defineProperty: Ai, 2033 defineProperties: ni, 2034 getOwnPropertyDescriptor: z 2035 }), st({ 2036 target: "Object", 2037 stat: !0, 2038 forced: !Yt 2039 }, { 2040 getOwnPropertyNames: a, 2041 getOwnPropertySymbols: Ri 2042 }), st({ 2043 target: "Object", 2044 stat: !0, 2045 forced: g(function () { 2046 Et.f(1) 2047 }) 2048 }, {
2049 getOwnPropertySymbols: function (t) { 2050 return Et.f(at(t)) 2051 } 2052 }), gi && (Ki = !Yt || g(function () { 2053 var t = vi(); 2054 return "[null]" != gi([t]) || "{}" != gi({ 2055 a: t 2056 }) || "{}" != gi(Object(t)) 2057 }), st({ 2058 target: "JSON", 2059 stat: !0, 2060 forced: Ki 2061 }, { 2062 stringify: function (t, e, n) { 2063 for (var r, i = [t], o = 1; o < arguments.length;) i.push(arguments[o++]); 2064 if ((y(r = e) || void 0 !== t) && !Ni(t)) return ur(e) || (e = function (t, e) { 2065 if ("function" == typeof r && (e = r.call(this, t, e)), !Ni(e)) return e 2066 }), i[1] = e, gi.apply(null, i) 2067 } 2068 })), vi[li][Sn] || R(vi[li], Sn, vi[li].valueOf), fe(vi, hi), $[ci] = !0, ti("asyncIterator"); 2069 var Pi, Oi, Di, xi, Li, z = k.f, 2070 Mi = b.Symbol; 2071 !f || "function" != typeof Mi || "description" in Mi.prototype && void 0 === Mi().description || (Pi = {}, ot(Oi = function () { 2072 var t = arguments.length < 1 || void 0 === arguments[0] ? void 0 : String(arguments[0]), 2073 e = this instanceof Oi ? new Mi(t) : void 0 === t ? Mi() : Mi(t); 2074 return "" === t && (Pi[e] = !0), e 2075 }, Mi), (Gi = Oi.prototype = Mi.prototype).constructor = Oi, Di = Gi.toString, xi = "Symbol(test)" == String(Mi("test")), Li = /^Symbol\((.*)\)[^)]+$/, z(Gi, "description", { 2076 configurable: !0, 2077 get: function () { 2078 var t = y(this) ? this.valueOf() : this, 2079 e = Di.call(t); 2080 if (c(Pi, t)) return ""; 2081 e = xi ? e.slice(7, -1) : e.replace(Li, "$1"); 2082 return "" === e ? void 0 : e 2083 } 2084 }), st({ 2085 global: !0, 2086 forced: !0 2087 }, { 2088 Symbol: Oi 2089 })), ti("hasInstance"), ti("isConcatSpreadable"), ti("iterator"), ti("match"), ti("matchAll"), ti("replace"), ti("search"), ti("species"), ti("split"), ti("toPrimitive"), ti("toStringTag"), ti("unscopables"), fe(b.JSON, "JSON", !0), fe(Math, "Math", !0), st({ 2090 global: !0 2091 }, { 2092 Reflect: {} 2093 }), fe(b.Reflect, "Reflect", !0); 2094 pt.Symbol; 2095 ti("asyncDispose"), ti("dispose"), ti("observable"), ti("patternMatch"), ti("replaceAll"); 2096 si.f("iterator"); 2097 var Fi = !g(function () { 2098 return Object.isExtensible(Object.preventExtensions({})) 2099 }), 2100 Ui = e(function (t) { 2101 function n(t) { 2102 e(t, r, { 2103 value: { 2104 objectID: "O" + ++i, 2105 weakData: {} 2106 } 2107 }) 2108 } 2109 var e = k.f, 2110 r = x("meta"), 2111 i = 0, 2112 o = Object.isExtensible || function () { 2113 return !0 2114 }, 2115 s = t.exports = { 2116 REQUIRED: !1, 2117 fastKey: function (t, e) { 2118 if (!y(t)) return "symbol" == typeof t ? t : ("string" == typeof t ? "S" : "P") + t; 2119 if (!c(t, r)) { 2120 if (!o(t)) return "F"; 2121 if (!e) return "E"; 2122 n(t) 2123 } 2124 return t[r].objectID 2125 }, 2126 getWeakData: function (t, e) { 2127 if (!c(t, r)) { 2128 if (!o(t)) return !0; 2129 if (!e) return !1; 2130 n(t) 2131 } 2132 return t[r].weakData 2133 }, 2134 onFreeze: function (t) { 2135 return Fi && s.REQUIRED && o(t) && !c(t, r) && n(t), t 2136 } 2137 }; 2138 $[r] = !0 2139 }), 2140 a = function (s, t, e) { 2141 function n(t) { 2142 var n = p[t]; 2143 ft(p, t, "add" == t ? function (t) { 2144 return n.call(this, 0 === t ? 0 : t), this 2145 } : "delete" == t ? function (t) { 2146 return !(h && !y(t)) && n.call(this, 0 === t ? 0 : t) 2147 } : "get" == t ? function (t) { 2148 return h && !y(t) ? void 0 : n.call(this, 0 === t ? 0 : t) 2149 } : "has" == t ? function (t) { 2150 return !(h && !y(t)) && n.call(this, 0 === t ? 0 : t) 2151 } : function (t, e) { 2152 return n.call(this, 0 === t ? 0 : t, e), this 2153 }) 2154 } 2155 var r, i, o, a, u, c = -1 !== s.indexOf("Map"), 2156 h = -1 !== s.indexOf("Weak"),
2157 l = c ? "set" : "add", 2158 f = b[s], 2159 p = f && f.prototype, 2160 d = f, 2161 v = {}; 2162 return Pt(s, "function" != typeof f || !(h || p.forEach && !g(function () { 2163 (new f).entries().next() 2164 }))) ? (d = e.getConstructor(t, s, c, l), Ui.REQUIRED = !0) : Pt(s, !0) && (i = (r = new d)[l](h ? {} : -0, 1) != r, o = g(function () { 2165 r.has(1) 2166 }), a = Te(function (t) { 2167 new f(t) 2168 }), u = !h && g(function () { 2169 for (var t = new f, e = 5; e--;) t[l](e, e); 2170 return !t.has(-0) 2171 }), a || (((d = t(function (t, e) { 2172 de(t, d, s); 2173 var n, r, i, o, n = (n = new f, r = t, t = d, Mt && "function" == typeof (i = r.constructor) && i !== t && y(o = i.prototype) && o !== t.prototype && Mt(n, o), n); 2174 return null != e && oe(e, n[l], { 2175 that: n, 2176 AS_ENTRIES: c 2177 }), n 2178 })).prototype = p).constructor = d), (o || u) && (n("delete"), n("has"), c && n("get")), (u || i) && n(l), h && p.clear && delete p.clear), v[s] = d, st({ 2179 global: !0, 2180 forced: d != f 2181 }, v), fe(d, s), h || e.setStrong(d, s, c), d 2182 }, 2183 ji = k.f, 2184 qi = Ui.fastKey, 2185 Vi = lt.set, 2186 Bi = lt.getterFor, 2187 Ki = { 2188 getConstructor: function (t, n, r, i) { 2189 function o(t, e, n) { 2190 var r, i = a(t), 2191 o = u(t, e); 2192 return o ? o.value = n : (i.last = o = { 2193 index: r = qi(e, !0), 2194 key: e, 2195 value: n, 2196 previous: n = i.last, 2197 next: void 0, 2198 removed: !1 2199 }, i.first || (i.first = o), n && (n.next = o), f ? i.size++ : t.size++, "F" !== r && (i.index[r] = o)), t 2200 } 2201 var s = t(function (t, e) { 2202 de(t, s, n), Vi(t, { 2203 type: n, 2204 index: Qt(null), 2205 first: void 0, 2206 last: void 0, 2207 size: 0 2208 }), f || (t.size = 0), null != e && oe(e, t[i], { 2209 that: t, 2210 AS_ENTRIES: r 2211 }) 2212 }), 2213 a = Bi(n), 2214 u = function (t, e) { 2215 var n, r = a(t), 2216 t = qi(e); 2217 if ("F" !== t) return r.index[t]; 2218 for (n = r.first; n; n = n.next) 2219 if (n.key == e) return n 2220 }; 2221 return le(s.prototype, { 2222 clear: function () { 2223 for (var t = a(this), e = t.index, n = t.first; n;) n.removed = !0, n.previous && (n.previous = n.previous.next = void 0), delete e[n.index], n = n.next; 2224 t.first = t.last = void 0, f ? t.size = 0 : this.size = 0 2225 }, 2226 delete: function (t) { 2227 var e, n = a(this), 2228 r = u(this, t); 2229 return r && (e = r.next, t = r.previous, delete n.index[r.index], r.removed = !0, t && (t.next = e), e && (e.previous = t), n.first == r && (n.first = e), n.last == r && (n.last = t), f ? n.size-- : this.size--), !!r 2230 }, 2231 forEach: function (t) { 2232 for (var e, n = a(this), r = zt(t, 1 < arguments.length ? arguments[1] : void 0, 3); e = e ? e.next : n.first;) 2233 for (r(e.value, e.key, this); e && e.removed;) e = e.previous 2234 }, 2235 has: function (t) { 2236 return !!u(this, t) 2237 } 2238 }), le(s.prototype, r ? { 2239 get: function (t) { 2240 t = u(this, t); 2241 return t && t.value 2242 }, 2243 set: function (t, e) { 2244 return o(this, 0 === t ? 0 : t, e) 2245 } 2246 } : { 2247 add: function (t) { 2248 return o(this, t = 0 === t ? 0 : t, t) 2249 } 2250 }), f && ji(s.prototype, "size", { 2251 get: function () { 2252 return a(this).size 2253 } 2254 }), s 2255 }, 2256 setStrong: function (t, e, n) { 2257 var r = e + " Iterator", 2258 i = Bi(e), 2259 o = Bi(r); 2260 xn(t, e, function (t, e) { 2261 Vi(this, { 2262 type: r, 2263 target: t, 2264 state: i(t), 2265 kind: e, 2266 last: void 0 2267 }) 2268 }, function () { 2269 for (var t = o(this), e = t.kind, n = t.last; n && n.removed;) n = n.previous; 2270 return t.target && (t.last = n = n ? n.next : t.state.first) ? "keys" == e ? { 2271 value: n.key, 2272 done: !1 2273 } : "values" == e ? { 2274 value: n.value, 2275 done: !1 2276 } : { 2277 value: [n.key, n.value], 2278 done: !1 2279 } : { 2280 value: t.target = void 0, 2281 done: !0 2282 } 2283 }, n ? "entries" : "values", !n, !0), pe(e) 2284 } 2285 }, 2286 Sn = (a("Map", function (t) { 2287 return function () { 2288 return t(this, arguments.length ? arguments[0] : void 0) 2289 } 2290 }, Ki), pt.Map, function (t) { 2291 var e, n, r, i, o = arguments.length, 2292 s = 1 < o ? arguments[1] : void 0; 2293 return Gt(this), (e = void 0 !== s) && Gt(s), null == t ? new this : (n = [], e ? (r = 0, i = zt(s, 2 < o ? arguments[2] : void 0, 2), oe(t, function (t) { 2294 n.push(i(t, r++)) 2295 })) : oe(t, n.push, { 2296 that: n 2297 }), new this(n)) 2298 });
2299 st({ 2300 target: "Map", 2301 stat: !0 2302 }, { 2303 from: Sn 2304 }); 2305 z = function () { 2306 for (var t = arguments.length, e = new Array(t); t--;) e[t] = arguments[t]; 2307 return new this(e) 2308 }; 2309 st({ 2310 target: "Map", 2311 stat: !0 2312 }, { 2313 of: z 2314 }); 2315 2316 function Wi() { 2317 for (var t, e = m(this), n = Gt(e.delete), r = !0, i = 0, o = arguments.length; i < o; i++) t = n.call(e, arguments[i]), r = r && t; 2318 return !!r 2319 } 2320 st({ 2321 target: "Map", 2322 proto: !0, 2323 real: !0, 2324 forced: G 2325 }, { 2326 deleteAll: function () { 2327 return Wi.apply(this, arguments) 2328 } 2329 }); 2330 st({ 2331 target: "Map", 2332 proto: !0, 2333 real: !0, 2334 forced: G 2335 }, { 2336 emplace: function (t, e) { 2337 var n = m(this), 2338 e = n.has(t) && "update" in e ? e.update(n.get(t), t, n) : e.insert(t, n); 2339 return n.set(t, e), e 2340 } 2341 }); 2342 2343 function Hi(t) { 2344 return Map.prototype.entries.call(t) 2345 } 2346 st({ 2347 target: "Map", 2348 proto: !0, 2349 real: !0, 2350 forced: G 2351 }, { 2352 every: function (t) { 2353 var r = m(this), 2354 e = Hi(r), 2355 i = zt(t, 1 < arguments.length ? arguments[1] : void 0, 3); 2356 return !oe(e, function (t, e, n) { 2357 if (!i(e, t, r)) return n() 2358 }, { 2359 AS_ENTRIES: !0, 2360 IS_ITERATOR: !0, 2361 INTERRUPTED: !0 2362 }).stopped 2363 } 2364 }), st({ 2365 target: "Map", 2366 proto: !0, 2367 real: !0, 2368 forced: G 2369 }, { 2370 filter: function (t) { 2371 var n = m(this), 2372 e = Hi(n), 2373 r = zt(t, 1 < arguments.length ? arguments[1] : void 0, 3), 2374 i = new(Ee(n, et("Map"))), 2375 o = Gt(i.set); 2376 return oe(e, function (t, e) { 2377 r(e, t, n) && o.call(i, t, e) 2378 }, { 2379 AS_ENTRIES: !0, 2380 IS_ITERATOR: !0 2381 }), i 2382 } 2383 }), st({ 2384 target: "Map", 2385 proto: !0, 2386 real: !0, 2387 forced: G 2388 }, { 2389 find: function (t) { 2390 var r = m(this), 2391 e = Hi(r), 2392 i = zt(t, 1 < arguments.length ? arguments[1] : void 0, 3); 2393 return oe(e, function (t, e, n) { 2394 if (i(e, t, r)) return n(e) 2395 }, { 2396 AS_ENTRIES: !0, 2397 IS_ITERATOR: !0, 2398 INTERRUPTED: !0 2399 }).result 2400 } 2401 }), st({ 2402 target: "Map", 2403 proto: !0, 2404 real: !0, 2405 forced: G 2406 }, { 2407 findKey: function (t) { 2408 var r = m(this), 2409 e = Hi(r), 2410 i = zt(t, 1 < arguments.length ? arguments[1] : void 0, 3); 2411 return oe(e, function (t, e, n) { 2412 if (i(e, t, r)) return n(t) 2413 }, { 2414 AS_ENTRIES: !0, 2415 IS_ITERATOR: !0, 2416 INTERRUPTED: !0 2417 }).result 2418 } 2419 }), st({ 2420 target: "Map", 2421 stat: !0 2422 }, { 2423 groupBy: function (t, n) { 2424 var r = new this; 2425 Gt(n); 2426 var i = Gt(r.has), 2427 o = Gt(r.get), 2428 s = Gt(r.set); 2429 return oe(t, function (t) { 2430 var e = n(t); 2431 i.call(r, e) ? o.call(r, e).push(t) : s.call(r, e, [t]) 2432 }), r 2433 } 2434 }); 2435 st({ 2436 target: "Map", 2437 proto: !0, 2438 real: !0, 2439 forced: G 2440 }, { 2441 includes: function (i) { 2442 return oe(Hi(m(this)), function (t, e, n) { 2443 if ((r = e) === (e = i) || r != r && e != e) return n(); 2444 var r 2445 }, { 2446 AS_ENTRIES: !0, 2447 IS_ITERATOR: !0, 2448 INTERRUPTED: !0 2449 }).stopped 2450 } 2451 }), st({ 2452 target: "Map", 2453 stat: !0 2454 }, { 2455 keyBy: function (t, e) { 2456 var n = new this; 2457 Gt(e); 2458 var r = Gt(n.set); 2459 return oe(t, function (t) { 2460 r.call(n, e(t), t) 2461 }), n 2462 } 2463 }), st({ 2464 target: "Map", 2465 proto: !0, 2466 real: !0, 2467 forced: G 2468 }, {
2469 keyOf: function (r) { 2470 return oe(Hi(m(this)), function (t, e, n) { 2471 if (e === r) return n(t) 2472 }, { 2473 AS_ENTRIES: !0, 2474 IS_ITERATOR: !0, 2475 INTERRUPTED: !0 2476 }).result 2477 } 2478 }), st({ 2479 target: "Map", 2480 proto: !0, 2481 real: !0, 2482 forced: G 2483 }, { 2484 mapKeys: function (t) { 2485 var n = m(this), 2486 e = Hi(n), 2487 r = zt(t, 1 < arguments.length ? arguments[1] : void 0, 3), 2488 i = new(Ee(n, et("Map"))), 2489 o = Gt(i.set); 2490 return oe(e, function (t, e) { 2491 o.call(i, r(e, t, n), e) 2492 }, { 2493 AS_ENTRIES: !0, 2494 IS_ITERATOR: !0 2495 }), i 2496 } 2497 }), st({ 2498 target: "Map", 2499 proto: !0, 2500 real: !0, 2501 forced: G 2502 }, { 2503 mapValues: function (t) { 2504 var n = m(this), 2505 e = Hi(n), 2506 r = zt(t, 1 < arguments.length ? arguments[1] : void 0, 3), 2507 i = new(Ee(n, et("Map"))), 2508 o = Gt(i.set); 2509 return oe(e, function (t, e) { 2510 o.call(i, t, r(e, t, n)) 2511 }, { 2512 AS_ENTRIES: !0, 2513 IS_ITERATOR: !0 2514 }), i 2515 } 2516 }), st({ 2517 target: "Map", 2518 proto: !0, 2519 real: !0, 2520 forced: G 2521 }, { 2522 merge: function (t) { 2523 for (var e = m(this), n = Gt(e.set), r = 0; r < arguments.length;) oe(arguments[r++], n, { 2524 that: e, 2525 AS_ENTRIES: !0 2526 }); 2527 return e 2528 } 2529 }), st({ 2530 target: "Map", 2531 proto: !0, 2532 real: !0, 2533 forced: G 2534 }, { 2535 reduce: function (n) { 2536 var r = m(this), 2537 t = Hi(r), 2538 i = arguments.length < 2, 2539 o = i ? void 0 : arguments[1]; 2540 if (Gt(n), oe(t, function (t, e) { 2541 o = i ? (i = !1, e) : n(o, e, t, r) 2542 }, { 2543 AS_ENTRIES: !0, 2544 IS_ITERATOR: !0 2545 }), i) throw TypeError("Reduce of empty map with no initial value"); 2546 return o 2547 } 2548 }), st({ 2549 target: "Map", 2550 proto: !0, 2551 real: !0, 2552 forced: G 2553 }, { 2554 some: function (t) { 2555 var r = m(this), 2556 e = Hi(r), 2557 i = zt(t, 1 < arguments.length ? arguments[1] : void 0, 3); 2558 return oe(e, function (t, e, n) { 2559 if (i(e, t, r)) return n() 2560 }, { 2561 AS_ENTRIES: !0, 2562 IS_ITERATOR: !0, 2563 INTERRUPTED: !0 2564 }).stopped 2565 } 2566 }), st({ 2567 target: "Map", 2568 proto: !0, 2569 real: !0, 2570 forced: G 2571 }, { 2572 update: function (t, e) { 2573 var n = m(this), 2574 r = arguments.length; 2575 Gt(e); 2576 var i = n.has(t); 2577 if (!i && r < 3) throw TypeError("Updating absent value"); 2578 r = i ? n.get(t) : Gt(2 < r ? arguments[2] : void 0)(t, n); 2579 return n.set(t, e(r, t, n)), n 2580 } 2581 }); 2582 var Gi = function (t, e) { 2583 var n, r = m(this), 2584 i = 2 < arguments.length ? arguments[2] : void 0; 2585 if ("function" != typeof e && "function" != typeof i) throw TypeError("At least one callback required"); 2586 return r.has(t) ? (n = r.get(t), "function" == typeof e && (n = e(n), r.set(t, n))) : "function" == typeof i && (n = i(), r.set(t, n)), n 2587 }; 2588 st({ 2589 target: "Map", 2590 proto: !0, 2591 real: !0, 2592 forced: G 2593 }, { 2594 upsert: Gi 2595 }), st({ 2596 target: "Map", 2597 proto: !0, 2598 real: !0, 2599 forced: G 2600 }, { 2601 updateOrInsert: Gi 2602 }); 2603 a("Set", function (t) { 2604 return function () { 2605 return t(this, arguments.length ? arguments[0] : void 0) 2606 } 2607 }, Ki), pt.Set; 2608 st({ 2609 target: "Set", 2610 stat: !0 2611 }, { 2612 from: Sn 2613 }), st({ 2614 target: "Set", 2615 stat: !0 2616 }, {
2617 of: z 2618 }); 2619 st({ 2620 target: "Set", 2621 proto: !0, 2622 real: !0, 2623 forced: G 2624 }, { 2625 addAll: function () { 2626 return function () { 2627 for (var t = m(this), e = Gt(t.add), n = 0, r = arguments.length; n < r; n++) e.call(t, arguments[n]); 2628 return t 2629 }.apply(this, arguments) 2630 } 2631 }), st({ 2632 target: "Set", 2633 proto: !0, 2634 real: !0, 2635 forced: G 2636 }, { 2637 deleteAll: function () { 2638 return Wi.apply(this, arguments) 2639 } 2640 }); 2641 2642 function zi(t) { 2643 return Set.prototype.values.call(t) 2644 } 2645 st({ 2646 target: "Set", 2647 proto: !0, 2648 real: !0, 2649 forced: G 2650 }, { 2651 every: function (t) { 2652 var n = m(this), 2653 e = zi(n), 2654 r = zt(t, 1 < arguments.length ? arguments[1] : void 0, 3); 2655 return !oe(e, function (t, e) { 2656 if (!r(t, t, n)) return e() 2657 }, { 2658 IS_ITERATOR: !0, 2659 INTERRUPTED: !0 2660 }).stopped 2661 } 2662 }), st({ 2663 target: "Set", 2664 proto: !0, 2665 real: !0, 2666 forced: G 2667 }, { 2668 difference: function (t) { 2669 var e = m(this), 2670 n = new(Ee(e, et("Set")))(e), 2671 r = Gt(n.delete); 2672 return oe(t, function (t) { 2673 r.call(n, t) 2674 }), n 2675 } 2676 }), st({ 2677 target: "Set", 2678 proto: !0, 2679 real: !0, 2680 forced: G 2681 }, { 2682 filter: function (t) { 2683 var e = m(this), 2684 n = zi(e), 2685 r = zt(t, 1 < arguments.length ? arguments[1] : void 0, 3), 2686 i = new(Ee(e, et("Set"))), 2687 o = Gt(i.add); 2688 return oe(n, function (t) { 2689 r(t, t, e) && o.call(i, t) 2690 }, { 2691 IS_ITERATOR: !0 2692 }), i 2693 } 2694 }), st({ 2695 target: "Set", 2696 proto: !0, 2697 real: !0, 2698 forced: G 2699 }, { 2700 find: function (t) { 2701 var n = m(this), 2702 e = zi(n), 2703 r = zt(t, 1 < arguments.length ? arguments[1] : void 0, 3); 2704 return oe(e, function (t, e) { 2705 if (r(t, t, n)) return e(t) 2706 }, { 2707 IS_ITERATOR: !0, 2708 INTERRUPTED: !0 2709 }).result 2710 } 2711 }), st({ 2712 target: "Set", 2713 proto: !0, 2714 real: !0, 2715 forced: G 2716 }, { 2717 intersection: function (t) { 2718 var e = m(this), 2719 n = new(Ee(e, et("Set"))), 2720 r = Gt(e.has), 2721 i = Gt(n.add); 2722 return oe(t, function (t) { 2723 r.call(e, t) && i.call(n, t) 2724 }), n 2725 } 2726 }), st({ 2727 target: "Set", 2728 proto: !0, 2729 real: !0, 2730 forced: G 2731 }, { 2732 isDisjointFrom: function (t) { 2733 var n = m(this), 2734 r = Gt(n.has); 2735 return !oe(t, function (t, e) { 2736 if (!0 === r.call(n, t)) return e() 2737 }, { 2738 INTERRUPTED: !0 2739 }).stopped 2740 } 2741 }), st({ 2742 target: "Set", 2743 proto: !0, 2744 real: !0, 2745 forced: G 2746 }, { 2747 isSubsetOf: function (t) { 2748 var e = function (t) { 2749 var e = ne(t); 2750 if ("function" != typeof e) throw TypeError(String(t) + " is not iterable"); 2751 return m(e.call(t)) 2752 }(this), 2753 n = m(t), 2754 r = n.has; 2755 return "function" != typeof r && (n = new(et("Set"))(t), r = Gt(n.has)), !oe(e, function (t, e) { 2756 if (!1 === r.call(n, t)) return e() 2757 }, { 2758 IS_ITERATOR: !0, 2759 INTERRUPTED: !0 2760 }).stopped 2761 } 2762 }), st({ 2763 target: "Set", 2764 proto: !0, 2765 real: !0, 2766 forced: G 2767 }, { 2768 isSupersetOf: function (t) { 2769 var n = m(this), 2770 r = Gt(n.has); 2771 return !oe(t, function (t, e) { 2772 if (!1 === r.call(n, t)) return e() 2773 }, { 2774 INTERRUPTED: !0 2775 }).stopped 2776 } 2777 }), st({ 2778 target: "Set", 2779 proto: !0, 2780 real: !0, 2781 forced: G 2782 }, {
2783 join: function (t) { 2784 var e = m(this), 2785 n = zi(e), 2786 e = void 0 === t ? "," : String(t), 2787 t = []; 2788 return oe(n, t.push, { 2789 that: t, 2790 IS_ITERATOR: !0 2791 }), t.join(e) 2792 } 2793 }), st({ 2794 target: "Set", 2795 proto: !0, 2796 real: !0, 2797 forced: G 2798 }, { 2799 map: function (t) { 2800 var e = m(this), 2801 n = zi(e), 2802 r = zt(t, 1 < arguments.length ? arguments[1] : void 0, 3), 2803 i = new(Ee(e, et("Set"))), 2804 o = Gt(i.add); 2805 return oe(n, function (t) { 2806 o.call(i, r(t, t, e)) 2807 }, { 2808 IS_ITERATOR: !0 2809 }), i 2810 } 2811 }), st({ 2812 target: "Set", 2813 proto: !0, 2814 real: !0, 2815 forced: G 2816 }, { 2817 reduce: function (e) { 2818 var n = m(this), 2819 t = zi(n), 2820 r = arguments.length < 2, 2821 i = r ? void 0 : arguments[1]; 2822 if (Gt(e), oe(t, function (t) { 2823 i = r ? (r = !1, t) : e(i, t, t, n) 2824 }, { 2825 IS_ITERATOR: !0 2826 }), r) throw TypeError("Reduce of empty set with no initial value"); 2827 return i 2828 } 2829 }), st({ 2830 target: "Set", 2831 proto: !0, 2832 real: !0, 2833 forced: G 2834 }, { 2835 some: function (t) { 2836 var n = m(this), 2837 e = zi(n), 2838 r = zt(t, 1 < arguments.length ? arguments[1] : void 0, 3); 2839 return oe(e, function (t, e) { 2840 if (r(t, t, n)) return e() 2841 }, { 2842 IS_ITERATOR: !0, 2843 INTERRUPTED: !0 2844 }).stopped 2845 } 2846 }), st({ 2847 target: "Set", 2848 proto: !0, 2849 real: !0, 2850 forced: G 2851 }, { 2852 symmetricDifference: function (t) { 2853 var e = m(this), 2854 n = new(Ee(e, et("Set")))(e), 2855 r = Gt(n.delete), 2856 i = Gt(n.add); 2857 return oe(t, function (t) { 2858 r.call(n, t) || i.call(n, t) 2859 }), n 2860 } 2861 }), st({ 2862 target: "Set", 2863 proto: !0, 2864 real: !0, 2865 forced: G 2866 }, { 2867 union: function (t) { 2868 var e = m(this), 2869 e = new(Ee(e, et("Set")))(e); 2870 return oe(t, Gt(e.add), { 2871 that: e 2872 }), e 2873 } 2874 }); 2875 var Qi = Math.floor; 2876 st({ 2877 target: "Number", 2878 stat: !0 2879 }, { 2880 isInteger: function (t) { 2881 return !y(t) && isFinite(t) && Qi(t) === t 2882 } 2883 }); 2884 pt.Number.isInteger; 2885 st({ 2886 target: "Number", 2887 stat: !0 2888 }, { 2889 isNaN: function (t) { 2890 return t != t 2891 } 2892 }); 2893 pt.Number.isNaN; 2894 var Yi = function (t, e) { 2895 return (Yi = Object.setPrototypeOf || { 2896 __proto__: [] 2897 } 2898 instanceof Array && function (t, e) { 2899 t.__proto__ = e 2900 } || function (t, e) { 2901 for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]) 2902 })(t, e) 2903 }; 2904 2905 function Xi(t, e) { 2906 if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null"); 2907 2908 function n() { 2909 this.constructor = t 2910 } 2911 Yi(t, e), t.prototype = null === e ? Object.create(e) : (n.prototype = e.prototype, new n) 2912 } 2913 var Ji = function () { 2914 return (Ji = Object.assign || function (t) { 2915 for (var e, n = 1, r = arguments.length; n < r; n++) 2916 for (var i in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]); 2917 return t 2918 }).apply(this, arguments) 2919 }; 2920 2921 function $i(t, s, a, u) { 2922 return new(a = a || Promise)(function (n, e) { 2923 function r(t) { 2924 try { 2925 o(u.next(t)) 2926 } catch (t) { 2927 e(t) 2928 } 2929 } 2930 2931 function i(t) { 2932 try { 2933 o(u.throw(t)) 2934 } catch (t) { 2935 e(t) 2936 } 2937 } 2938 2939 function o(t) { 2940 var e; 2941 t.done ? n(t.value) : ((e = t.value) instanceof a ? e : new a(function (t) { 2942 t(e) 2943 })).then(r, i) 2944 } 2945 o((u = u.apply(t, s || [])).next()) 2946 }) 2947 } 2948 2949 function Zi(n, r) { 2950 var i, o, s, a = { 2951 label: 0, 2952 sent: function () { 2953 if (1 & s[0]) throw s[1]; 2954 return s[1] 2955 }, 2956 trys: [], 2957 ops: [] 2958 }, 2959 t = { 2960 next: e(0), 2961 throw: e(1), 2962 return: e(2) 2963 }; 2964 return "function" == typeof Symbol && (t[Symbol.iterator] = function () { 2965 return this 2966 }), t; 2967 2968 function e(e) { 2969 return function (t) { 2970 return function (e) { 2971 if (i) throw new TypeError("Generator is already executing."); 2972 for (; a;) try { 2973 if (i = 1, o && (s = 2 & e[0] ? o.return : e[0] ? o.throw || ((s = o.return) && s.call(o), 0
2973) : o.next) && !(s = s.call(o, e[1])).done) return s; 2974 switch (o = 0, (e = s ? [2 & e[0], s.value] : e)[0]) { 2975 case 0: 2976 case 1: 2977 s = e; 2978 break; 2979 case 4: 2980 return a.label++, { 2981 value: e[1], 2982 done: !1 2983 }; 2984 case 5: 2985 a.label++, o = e[1], e = [0]; 2986 continue; 2987 case 7: 2988 e = a.ops.pop(), a.trys.pop(); 2989 continue; 2990 default: 2991 if (!(s = 0 < (s = a.trys).length && s[s.length - 1]) && (6 === e[0] || 2 === e[0])) { 2992 a = 0; 2993 continue 2994 } 2995 if (3 === e[0] && (!s || e[1] > s[0] && e[1] < s[3])) { 2996 a.label = e[1]; 2997 break 2998 } 2999 if (6 === e[0] && a.label < s[1]) { 3000 a.label = s[1], s = e; 3001 break 3002 } 3003 if (s && a.label < s[2]) { 3004 a.label = s[2], a.ops.push(e); 3005 break 3006 } 3007 s[2] && a.ops.pop(), a.trys.pop(); 3008 continue 3009 } 3010 e = r.call(n, a) 3011 } catch (t) { 3012 e = [6, t], o = 0 3013 } finally { 3014 i = s = 0 3015 } 3016 if (5 & e[0]) throw e[1]; 3017 return { 3018 value: e[0] ? e[1] : void 0, 3019 done: !0 3020 } 3021 }([e, t]) 3022 } 3023 } 3024 } 3025 3026 function to(t) { 3027 var e = "function" == typeof Symbol && Symbol.iterator, 3028 n = e && t[e], 3029 r = 0; 3030 if (n) return n.call(t); 3031 if (t && "number" == typeof t.length) return { 3032 next: function () { 3033 return { 3034 value: (t = t && r >= t.length ? void 0 : t) && t[r++], 3035 done: !t 3036 } 3037 } 3038 }; 3039 throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.") 3040 } 3041 3042 function eo(t, e) { 3043 var n = "function" == typeof Symbol && t[Symbol.iterator]; 3044 if (!n) return t; 3045 var r, i, o = n.call(t), 3046 s = []; 3047 try { 3048 for (; 3049 (void 0 === e || 0 < e--) && !(r = o.next()).done;) s.push(r.value) 3050 } catch (t) { 3051 i = { 3052 error: t 3053 } 3054 } finally { 3055 try { 3056 r && !r.done && (n = o.return) && n.call(o) 3057 } finally { 3058 if (i) throw i.error 3059 } 3060 } 3061 return s 3062 } 3063 3064 function no(t, e) { 3065 for (var n = 0, r = e.length, i = t.length; n < r; n++, i++) t[i] = e[n]; 3066 return t 3067 } 3068 3069 function ro(t) { 3070 for (var e = [], n = 0, r = 0; r < t.length; r++) { 3071 var i = t.charCodeAt(r); 3072 i < 128 ? e[n++] = i : (i < 2048 ? e[n++] = i >> 6 | 192 : (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 >> 12 | 224, e[n++] = i >> 6 & 63 | 128), e[n++] = 63 & i | 128) 3073 } 3074 return e 3075 } 3076 3077 function io(t) { 3078 try { 3079 return uo.decodeString(t, !0) 3080 } catch (t) { 3081 console.error("base64Decode failed: ", t) 3082 } 3083 return null 3084 } 3085 var oo = { 3086 NODE_CLIENT: !1, 3087 NODE_ADMIN: !1, 3088 SDK_VERSION: "${JSCORE_VERSION}" 3089 }, 3090 so = function (t, e) { 3091 if (!t) throw ao(e) 3092 }, 3093 ao = function (t) { 3094 return new Error("Firebase Database (" + oo.SDK_VERSION + ") INTERNAL ASSERT FAILED: " + t) 3095 }, 3096 uo = { 3097 byteToCharMap_: null, 3098 charToByteMap_: null, 3099 byteToCharMapWebSafe_: null, 3100 charToByteMapWebSafe_: null, 3101 ENCODED_VALS_BASE: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", 3102 get ENCODED_VALS() { 3103 return this.ENCODED_VALS_BASE + "+/=" 3104 }, 3105 get ENCODED_VALS_WEBSAFE() { 3106 return this.ENCODED_VALS_BASE + "-_." 3107 }, 3108 HAS_NATIVE_SUPPORT: "function" == typeof atob, 3109 encodeByteArray: function (t, e) { 3110 if (!Array.isArray(t)) throw Error("encodeByteArray takes an array as a parameter"); 3111 this.init_(); 3112 for (var n = e ? this.byteToCharMapWebSafe_ : this.byteToCharMap_, r = [], i = 0; i < t.length; i += 3) { 3113 var o = t[i], 3114 s = i + 1 < t.length, 3115 a = s ? t[i + 1] : 0, 3116 u = i + 2 < t.length, 3117 c = u ? t[i + 2] : 0, 3118 h = o >> 2, 3119 o = (3 & o) << 4 | a >> 4, 3120 a = (15 & a) << 2 | c >> 6, 3121 c = 63 & c; 3122 u || (c = 64, s || (a = 64)), r.push(n[h], n[o], n[a], n[c]) 3123 } 3124 return r.join("") 3125 }, 3126 encodeString: function (t, e) { 3127 return this.HAS_NATIVE_SUPPORT && !e ? btoa(t) : this.encodeByteArray(ro(t), e) 3128 }, 3129 decodeString: function (t, e) { 3130 return this.HAS_NATIVE_SUPPORT && !e ? atob(t) : function (t) { 3131 for (var e = [], n = 0, r = 0; n < t.length;) { 3132 var i, o, s, a = t[n++]; 3133 a < 128 ? e[r++] = String.fromCharCode(a) : 191 < a && a < 224 ? (o = t[n++], e[r++] = String.fromCharCode((31 & a) << 6 | 63 & o)) : 239 < a && a < 365 ? (i = ((7 & a) << 18 | (63 & (o = t[n++])) << 12 | (63 & (s = t[n++])) << 6 | 63 & t[n++]) - 65536, e[r++] = String.fromCharCode(55296 + (i >> 10)), e[r++] = String.fromCharCode(56320 + (1023 & i))) : (o = t[n++], s = t[n++], e[r++] = String.fromCharCode((1
31335 & a) << 12 | (63 & o) << 6 | 63 & s)) 3134 } 3135 return e.join("") 3136 }(this.decodeStringToByteArray(t, e)) 3137 }, 3138 decodeStringToByteArray: function (t, e) { 3139 this.init_(); 3140 for (var n = e ? this.charToByteMapWebSafe_ : this.charToByteMap_, r = [], i = 0; i < t.length;) { 3141 var o = n[t.charAt(i++)], 3142 s = i < t.length ? n[t.charAt(i)] : 0, 3143 a = ++i < t.length ? n[t.charAt(i)] : 64, 3144 u = ++i < t.length ? n[t.charAt(i)] : 64; 3145 if (++i, null == o || null == s || null == a || null == u) throw Error(); 3146 o = o << 2 | s >> 4; 3147 r.push(o), 64 !== a && (s = s << 4 & 240 | a >> 2, r.push(s), 64 !== u && (u = a << 6 & 192 | u, r.push(u))) 3148 } 3149 return r 3150 }, 3151 init_: function () { 3152 if (!this.byteToCharMap_) { 3153 this.byteToCharMap_ = {}, this.charToByteMap_ = {}, this.byteToCharMapWebSafe_ = {}, this.charToByteMapWebSafe_ = {}; 3154 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) >= this.ENCODED_VALS_BASE.length && (this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(t)] = t, this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(t)] = t) 3155 } 3156 } 3157 }; 3158 3159 function co(t) { 3160 return ho(void 0, t) 3161 } 3162 3163 function ho(t, e) { 3164 if (!(e instanceof Object)) return e; 3165 switch (e.constructor) { 3166 case Date: 3167 return new Date(e.getTime()); 3168 case Object: 3169 void 0 === t && (t = {}); 3170 break; 3171 case Array: 3172 t = []; 3173 break; 3174 default: 3175 return e 3176 } 3177 for (var n in e) e.hasOwnProperty(n) && "__proto__" !== n && (t[n] = ho(t[n], e[n])); 3178 return t 3179 } 3180 var lo = (fo.prototype.wrapCallback = function (n) { 3181 var r = this; 3182 return function (t, e) { 3183 t ? r.reject(t) : r.resolve(e), "function" == typeof n && (r.promise.catch(function () {}), 1 === n.length ? n(t) : n(t, e)) 3184 } 3185 }, fo); 3186 3187 function fo() { 3188 var n = this; 3189 this.reject = function () {}, this.resolve = function () {}, this.promise = new Promise(function (t, e) { 3190 n.resolve = t, n.reject = e 3191 }) 3192 } 3193 3194 function po() { 3195 return "undefined" != typeof navigator && "string" == typeof navigator.userAgent ? navigator.userAgent : "" 3196 } 3197 3198 function vo() { 3199 return "undefined" != typeof window && (window.cordova || window.phonegap || window.PhoneGap) && /ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(po()) 3200 } 3201 3202 function go() { 3203 var t = "object" == typeof chrome ? chrome.runtime : "object" == typeof browser ? browser.runtime : void 0; 3204 return "object" == typeof t && void 0 !== t.id 3205 } 3206 3207 function yo() { 3208 return "object" == typeof navigator && "ReactNative" === navigator.product 3209 } 3210 3211 function mo() { 3212 return !0 === oo.NODE_ADMIN 3213 } 3214 3215 function bo() { 3216 return "indexedDB" in self && null != indexedDB 3217 } 3218 3219 function wo() { 3220 return new Promise(function (t, e) { 3221 try { 3222 var n = !0, 3223 r = "validate-browser-context-for-indexeddb-analytics-module", 3224 i = window.indexedDB.open(r); 3225 i.onsuccess = function () { 3226 i.result.close(), n || window.indexedDB.deleteDatabase(r), t(!0) 3227 }, i.onupgradeneeded = function () { 3228 n = !1 3229 }, i.onerror = function () { 3230 var t; 3231 e((null === (t = i.error) || void 0 === t ? void 0 : t.message) || "") 3232 } 3233 } catch (t) { 3234 e(t) 3235 } 3236 }) 3237 } 3238 3239 function _o() { 3240 return !(!navigator || !navigator.cookieEnabled) 3241 } 3242 var Io, To = "FirebaseError", 3243 Eo = (Xi(So, Io = Error), So); 3244 3245 function So(t, e, n) { 3246 e = Io.call(this, e) || this; 3247 return e.code = t, e.customData = n, e.name = To, Object.setPrototypeOf(e, So.prototype), Error.captureStackTrace && Error.captureStackTrace(e, Co.prototype.create), e 3248 } 3249 var Co = (No.prototype.create = function (t) { 3250 for (var e = [], n = 1; n < arguments.length; n++) e[n - 1] = arguments[n]; 3251 var r, i = e[0] || {},
3252 o = this.service + "/" + t, 3253 t = this.errors[t], 3254 t = t ? (r = i, t.replace(Ao, function (t, e) { 3255 var n = r[e]; 3256 return null != n ? String(n) : "<" + e + "?>" 3257 })) : "Error", 3258 t = this.serviceName + ": " + t + " (" + o + ")."; 3259 return new Eo(o, t, i) 3260 }, No); 3261 3262 function No(t, e, n) { 3263 this.service = t, this.serviceName = e, this.errors = n 3264 } 3265 var Ao = /\{\$([^}]+)}/g; 3266 3267 function ko(t) { 3268 return JSON.parse(t) 3269 } 3270 3271 function Ro(t) { 3272 return JSON.stringify(t) 3273 } 3274 3275 function Po(t) { 3276 var e = {}, 3277 n = {}, 3278 r = {}, 3279 i = ""; 3280 try { 3281 var o = t.split("."), 3282 e = ko(io(o[0]) || ""), 3283 n = ko(io(o[1]) || ""), 3284 i = o[2], 3285 r = n.d || {}; 3286 delete n.d 3287 } catch (t) {} 3288 return { 3289 header: e, 3290 claims: n, 3291 data: r, 3292 signature: i 3293 } 3294 } 3295 3296 function Oo(t, e) { 3297 return Object.prototype.hasOwnProperty.call(t, e) 3298 } 3299 3300 function Do(t, e) { 3301 if (Object.prototype.hasOwnProperty.call(t, e)) return t[e] 3302 } 3303 3304 function xo(t) { 3305 for (var e in t) 3306 if (Object.prototype.hasOwnProperty.call(t, e)) return !1; 3307 return !0 3308 } 3309 3310 function Lo(t, e, n) { 3311 var r, i = {}; 3312 for (r in t) Object.prototype.hasOwnProperty.call(t, r) && (i[r] = e.call(n, t[r], r, t)); 3313 return i 3314 } 3315 3316 function Mo(t) { 3317 for (var n = [], e = 0, r = Object.entries(t); e < r.length; e++) { 3318 var i = r[e]; 3319 ! function (e, t) { 3320 Array.isArray(t) ? t.forEach(function (t) { 3321 n.push(encodeURIComponent(e) + "=" + encodeURIComponent(t)) 3322 }) : n.push(encodeURIComponent(e) + "=" + encodeURIComponent(t)) 3323 }(i[0], i[1]) 3324 } 3325 return n.length ? "&" + n.join("&") : "" 3326 } 3327 var Fo = (Uo.prototype.reset = function () { 3328 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 3329 }, Uo.prototype.compress_ = function (t, e) { 3330 e = e || 0; 3331 var n = this.W_; 3332 if ("string" == typeof t) 3333 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; 3334 else 3335 for (r = 0; r < 16; r++) n[r] = t[e] << 24 | t[e + 1] << 16 | t[e + 2] << 8 | t[e + 3], e += 4; 3336 for (r = 16; r < 80; r++) { 3337 var i = n[r - 3] ^ n[r - 8] ^ n[r - 14] ^ n[r - 16]; 3338 n[r] = 4294967295 & (i << 1 | i >>> 31) 3339 } 3340 for (var o, s = this.chain_[0], a = this.chain_[1], u = this.chain_[2], c = this.chain_[3], h = this.chain_[4], r = 0; r < 80; r++) var l = r < 40 ? r < 20 ? (o = c ^ a & (u ^ c), 1518500249) : (o = a ^ u ^ c, 1859775393) : r < 60 ? (o = a & u | c & (a | u), 2400959708) : (o = a ^ u ^ c, 3395469782), 3341 i = (s << 5 | s >>> 27) + o + h + l + n[r] & 4294967295, 3342 h = c, 3343 c = u, 3344 u = 4294967295 & (a << 30 | a >>> 2), 3345 a = s, 3346 s = i; 3347 this.chain_[0] = this.chain_[0] + s & 4294967295, this.chain_[1] = this.chain_[1] + a & 4294967295, this.chain_[2] = this.chain_[2] + u & 4294967295, this.chain_[3] = this.chain_[3] + c & 4294967295, this.chain_[4] = this.chain_[4] + h & 4294967295 3348 }, Uo.prototype.update = function (t, e) { 3349 if (null != t) { 3350 for (var n = (e = void 0 === e ? t.length : e) - this.blockSize, r = 0, i = this.buf_, o = this.inbuf_; r < e;) { 3351 if (0 === o) 3352 for (; r <= n;) this.compress_(t, r), r += this.blockSize; 3353 if ("string" == typeof t) { 3354 for (; r < e;) 3355 if (i[o] = t.charCodeAt(r), ++r, ++o === this.blockSize) { 3356 this.compress_(i), o = 0; 3357 break 3358 } 3359 } else 3360 for (; r < e;) 3361 if (i[o] = t[r], ++r, ++o === this.blockSize) { 3362 this.compress_(i), o = 0; 3363 break 3364 } 3365 } 3366 this.inbuf_ = o, this.total_ += e 3367 } 3368 }, Uo.prototype.digest = function () { 3369 var t = [], 3370 e = 8 * this.total_; 3371 this.inbuf_ < 56 ? this.update(this.pad_, 56 - this.inbuf_) : this.update(this.pad_, this.blockSize - (this.inbuf_ - 56)); 3372 for (var n = this.blockSize - 1; 56 <= n; n--) this.buf_[n] = 255 & e, e /= 256; 3373 this.compress_(this.buf_); 3374 for (var r = 0, n = 0; n < 5; n++) 3375 for (var i = 24; 0 <= i; i -= 8) t[r] = this.chain_[n] >> i & 255, ++r; 3376 return t 3377 }, Uo); 3378 3379 function Uo() { 3380 this.chain_ = [], this.buf_ = [], this.W_ = [], this.pad_ = [], this.inbuf_ = 0, this.total_ = 0, this.blockSize = 64, this.pad_[0] = 128; 3381 for (var t = 1; t < this.blockSize; ++t) this.pad_[t] = 0; 3382 this.reset() 3383 } 3384 3385 function jo(t, e) { 3386 e = new qo(t, e); 3387 return e.subscribe.bind(e) 3388 } 3389 var qo = (Vo.prototype.next = function (e) { 3390 this.forEachObserver(function (t) { 3391 t.next(e) 3392 }) 3393 }, Vo.prototype.error = function (e) { 3394 this.forEachObserver(function (t) { 3395 t.error(e) 3396 }), this.close(e) 3397 }, Vo.prototype.complete = function () { 3398 this.forEachObserver(function (t) { 3399 t.complete() 3400 }), this.close() 3401 }, Vo.prototype.subscribe = function (t, e, n) { 3402 var r, i = this; 3403 if (void 0 === t && void 0 === e && void 0 === n) throw new Error("Missing Observer."); 3404 void 0 === (r = function (t, e) { 3405 if ("object" != typeof t || null === t) return !1; 3406 for (var n = 0, r = e; n < r.length; n++) { 3407 var i = r[n]; 3408 if (i in t && "function" == typeof t[i]) return !0 3409 } 3410 return !1 3411 }(t, ["next", "error", "complete"]) ? t : { 3412 next: t, 3413 error: e, 3414 complete: n 3415 }).next && (r.next = Bo), void 0 === r.error && (r.error = Bo), void 0 === r.complete && (r.complete = Bo); 3416 n = this.unsubscribeOne.bind(this, this.observers.length); 3417 return this.finalized && this.task.then(function () { 3418 try { 3419 i.finalError ? r.error(i.finalError) : r.complete() 3420 } catch (t) {} 3421 }), this.observers.push(r), n 3422 }, Vo.prototype.unsubscribeOne = function (t) { 3423 void 0 !== this.observers && void 0 !== this.observers[t] && (delete this.observers[t], --this.observerCount, 0 === this.observerCount && void 0 !== this.onNoObservers && this.onNoObservers(this)) 3424 }, Vo.prototype.forEachObserver = function (t) { 3425 if (!this.finalized) 3426 for (var e = 0; e < this.observers.length; e++) this.sendOne(e, t) 3427 }, Vo.prototype.sendOne = function (t, e) { 3428 var n = this; 3429 this.task.then(function () { 3430 if (void 0 !== n.observers && void 0 !== n.observers[t]) try { 3431 e(n.observers[t]) 3432 } catch (t) { 3433 "undefined" != typeof console && console.error && console.error(t) 3434 } 3435 }) 3436 }, Vo.prototype.close = function (t) { 3437 var e = this; 3438 this.finalized || (this.finalized = !0, void 0 !== t && (this.finalError = t), this.task.then(function () { 3439 e.observers = void 0, e.onNoObservers = void 0 3440 })) 3441 }, Vo); 3442 3443 function Vo(t, e) { 3444 var n = this; 3445 this.observers = [], this.unsubscribes = [], this.observerCount = 0, this.task = Promise.resolve(), this.finalized = !1, this.onNoObservers = e, this.task.then(function () { 3446 t(n) 3447 }).catch(function (t) { 3448 n.error(t) 3449 }) 3450 } 3451 3452 function Bo() {} 3453 3454 function Ko(t, e, n, r) { 3455 var i; 3456 if (r < e ? i = "at least " + e : n < r && (i = 0 === n ? "none" : "no more than " + n), i) throw new Error(t + " failed: Was called with " + r + (1 === r ? " argument." : " arguments.") + " Expects " + i + ".") 3457 } 3458 3459 function Wo(t, e, n) { 3460 var r = ""; 3461 switch (e) { 3462 case 1:
3463 r = n ? "first" : "First"; 3464 break; 3465 case 2: 3466 r = n ? "second" : "Second"; 3467 break; 3468 case 3: 3469 r = n ? "third" : "Third"; 3470 break; 3471 case 4: 3472 r = n ? "fourth" : "Fourth"; 3473 break; 3474 default: 3475 throw new Error("errorPrefix called with argumentNumber > 4. Need to update it?") 3476 } 3477 t += " failed: "; 3478 return t += r + " argument " 3479 } 3480 3481 function Ho(t, e, n, r) { 3482 if ((!r || n) && "function" != typeof n) throw new Error(Wo(t, e, r) + "must be a valid function.") 3483 } 3484 3485 function Go(t, e, n, r) { 3486 if ((!r || n) && ("object" != typeof n || null === n)) throw new Error(Wo(t, e, r) + "must be a valid context object.") 3487 } 3488 3489 function zo(t) { 3490 for (var e = 0, n = 0; n < t.length; n++) { 3491 var r = t.charCodeAt(n); 3492 r < 128 ? e++ : r < 2048 ? e += 2 : 55296 <= r && r <= 56319 ? (e += 4, n++) : e += 3 3493 } 3494 return e 3495 } 3496 var Qo = 1e3, 3497 Yo = 2, 3498 Xo = 144e5, 3499 Jo = .5; 3500 3501 function $o(t, e, n) { 3502 void 0 === n && (n = Yo); 3503 n = (e = void 0 === e ? Qo : e) * Math.pow(n, t), t = Math.round(Jo * n * (Math.random() - .5) * 2); 3504 return Math.min(Xo, n + t) 3505 } 3506 3507 function Zo(t) { 3508 return t && t._delegate ? t._delegate : t 3509 } 3510 var ts = (es.prototype.setInstantiationMode = function (t) { 3511 return this.instantiationMode = t, this 3512 }, es.prototype.setMultipleInstances = function (t) { 3513 return this.multipleInstances = t, this 3514 }, es.prototype.setServiceProps = function (t) { 3515 return this.serviceProps = t, this 3516 }, es); 3517 3518 function es(t, e, n) { 3519 this.name = t, this.instanceFactory = e, this.type = n, this.multipleInstances = !1, this.serviceProps = {}, this.instantiationMode = "LAZY" 3520 } 3521 var ns = "[DEFAULT]", 3522 rs = (is.prototype.get = function (t) { 3523 void 0 === t && (t = ns); 3524 var e = this.normalizeInstanceIdentifier(t); 3525 if (!this.instancesDeferred.has(e)) { 3526 var n = new lo; 3527 this.instancesDeferred.set(e, n); 3528 try { 3529 var r = this.getOrInitializeService({ 3530 instanceIdentifier: e 3531 }); 3532 r && n.resolve(r) 3533 } catch (t) {} 3534 } 3535 return this.instancesDeferred.get(e).promise 3536 }, is.prototype.getImmediate = function (t) { 3537 var e = Ji({ 3538 identifier: ns, 3539 optional: !1 3540 }, t), 3541 t = e.identifier, 3542 n = e.optional, 3543 r = this.normalizeInstanceIdentifier(t); 3544 try { 3545 var i = this.getOrInitializeService({ 3546 instanceIdentifier: r 3547 }); 3548 if (i) return i; 3549 if (n) return null; 3550 throw Error("Service " + this.name + " is not available") 3551 } catch (t) { 3552 if (n) return null; 3553 throw t 3554 } 3555 }, is.prototype.getComponent = function () { 3556 return this.component 3557 }, is.prototype.setComponent = function (t) { 3558 var e, n; 3559 if (t.name !== this.name) throw Error("Mismatching Component " + t.name + " for Provider " + this.name + "."); 3560 if (this.component) throw Error("Component for " + this.name + " has already been provided"); 3561 if ("EAGER" === (this.component = t).instantiationMode) try { 3562 this.getOrInitializeService({ 3563 instanceIdentifier: ns 3564 }) 3565 } catch (t) {} 3566 try { 3567 for (var r = to(this.instancesDeferred.entries()), i = r.next(); !i.done; i = r.next()) { 3568 var o = eo(i.value, 2), 3569 s = o[0], 3570 a = o[1], 3571 u = this.normalizeInstanceIdentifier(s); 3572 try { 3573 var c = this.getOrInitializeService({ 3574 instanceIdentifier: u 3575 }); 3576 a.resolve(c) 3577 } catch (t) {} 3578 } 3579 } catch (t) { 3580 e = { 3581 error: t 3582 } 3583 } finally { 3584 try { 3585 i && !i.done && (n = r.return) && n.call(r) 3586 } finally { 3587 if (e) throw e.error 3588 } 3589 } 3590 }, is.prototype.clearInstance = function (t) { 3591 void 0 === t && (t = ns), this.instancesDeferred.delete(t), this.instances.delete(t) 3592 }, is.prototype.delete = function () { 3593 return $i(this, void 0, void 0, function () { 3594 var e; 3595 return Zi(this, function (t) { 3596 switch (t.label) { 3597 case 0: 3598 return e = Array.from(this.instances.values()), [4, Promise.all(no(no([], eo(e.f
3598ilter(function (t) { 3599 return "INTERNAL" in t 3600 }).map(function (t) { 3601 return t.INTERNAL.delete() 3602 }))), eo(e.filter(function (t) { 3603 return "_delete" in t 3604 }).map(function (t) { 3605 return t._delete() 3606 }))))]; 3607 case 1: 3608 return t.sent(), [2] 3609 } 3610 }) 3611 }) 3612 }, is.prototype.isComponentSet = function () { 3613 return null != this.component 3614 }, is.prototype.isInitialized = function (t) { 3615 return void 0 === t && (t = ns), this.instances.has(t) 3616 }, is.prototype.initialize = function (t) { 3617 var e = (t = void 0 === t ? {} : t).instanceIdentifier, 3618 e = void 0 === e ? ns : e, 3619 t = t.options, 3620 t = void 0 === t ? {} : t, 3621 e = this.normalizeInstanceIdentifier(e); 3622 if (this.isInitialized(e)) throw Error(this.name + "(" + e + ") has already been initialized"); 3623 if (!this.isComponentSet()) throw Error("Component " + this.name + " has not been registered yet"); 3624 return this.getOrInitializeService({ 3625 instanceIdentifier: e, 3626 options: t 3627 }) 3628 }, is.prototype.getOrInitializeService = function (t) { 3629 var e = t.instanceIdentifier, 3630 n = t.options, 3631 r = void 0 === n ? {} : n, 3632 t = this.instances.get(e); 3633 return !t && this.component && (t = this.component.instanceFactory(this.container, { 3634 instanceIdentifier: (n = e) === ns ? void 0 : n, 3635 options: r 3636 }), this.instances.set(e, t)), t || null 3637 }, is.prototype.normalizeInstanceIdentifier = function (t) { 3638 return !this.component || this.component.multipleInstances ? t : ns 3639 }, is); 3640 3641 function is(t, e) { 3642 this.name = t, this.container = e, this.component = null, this.instances = new Map, this.instancesDeferred = new Map 3643 } 3644 var os = (ss.prototype.addComponent = function (t) { 3645 var e = this.getProvider(t.name); 3646 if (e.isComponentSet()) throw new Error("Component " + t.name + " has already been registered with " + this.name); 3647 e.setComponent(t) 3648 }, ss.prototype.addOrOverwriteComponent = function (t) { 3649 this.getProvider(t.name).isComponentSet() && this.providers.delete(t.name), this.addComponent(t) 3650 }, ss.prototype.getProvider = function (t) { 3651 if (this.providers.has(t)) return this.providers.get(t); 3652 var e = new rs(t, this); 3653 return this.providers.set(t, e), e 3654 }, ss.prototype.getProviders = function () { 3655 return Array.from(this.providers.values()) 3656 }, ss); 3657 3658 function ss(t) { 3659 this.name = t, this.providers = new Map 3660 } 3661 var as, us = []; 3662 (Sn = as = as || {})[Sn.DEBUG = 0] = "DEBUG", Sn[Sn.VERBOSE = 1] = "VERBOSE", Sn[Sn.INFO = 2] = "INFO", Sn[Sn.WARN = 3] = "WARN", Sn[Sn.ERROR = 4] = "ERROR", Sn[Sn.SILENT = 5] = "SILENT"; 3663 3664 function cs(t, e) { 3665 for (var n = [], r = 2; r < arguments.length; r++) n[r - 2] = arguments[r]; 3666 if (!(e < t.logLevel)) { 3667 var i = (new Date).toISOString(), 3668 o = fs[e]; 3669 if (!o) throw new Error("Attempted to log a message with an invalid logType (value: " + e + ")"); 3670 console[o].apply(console, no(["[" + i + "] " + t.name + ":"], n)) 3671 } 3672 } 3673 var hs = { 3674 debug: as.DEBUG, 3675 verbose: as.VERBOSE, 3676 info: as.INFO, 3677 warn: as.WARN, 3678 error: as.ERROR, 3679 silent: as.SILENT 3680 }, 3681 ls = as.INFO, 3682 fs = ((z = {})[as.DEBUG] = "log", z[as.VERBOSE] = "log", z[as.INFO] = "info", z[as.WARN] = "warn", z[as.ERROR] = "error", z), 3683 ps = (Object.defineProperty(ds.prototype, "logLevel", { 3684 get: function () { 3685 return this._logLevel 3686 }, 3687 set: function (t) { 3688 if (!(t in as)) throw new TypeError('Invalid value "' + t + '" assigned to `logLevel`'); 3689 this._logLevel = t 3690 }, 3691 enumerable: !1, 3692 configurable: !0 3693 }), ds.prototype.setLogLevel = function (t) { 3694 this._logLevel = "string" == typeof t ? hs[t] : t 3695 }, Object.defineProperty(ds.prototype, "logHandler", { 3696 get: function () { 3697 return this._logHandler 3698 }, 3699 set: function (t) { 3700 if ("function" != typeof t) throw new TypeError("Value assigned to `logHandler` must be a function"); 3701 this._logHandler = t 3702 }, 3703 enumerable: !1, 3704 configurable: !0 3705 }), Object.defineProperty(ds.prototype, "userLogHandler", { 3706 get: function () { 3707 return this._userLogHandler 3708 }, 3709 set: function (t) { 3710 this._userLogHandler = t 3711 }, 3712 enumerable: !1, 3713 configurable: !0 3714 }), ds.prototype.debug = function () { 3715 for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e]; 3716 this._userLogHandler && this._userLogHandler.apply(this, no([this, as.DEBUG], t)), this._logHandler.apply(this, no([this, as.DEBUG], t)) 3717 }, ds.prototype.log = function () { 3718 for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e]; 3719 this._userLogHandler && this._userLogHandler.apply(this, no([this, as.VERBOSE], t)), this._logHandler.apply(this, no([this, as.VERBOSE], t)) 3720 }, ds.prototype.info = function () { 3721 for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e]; 3722 this._userLogHandler && this._userLogHandler.apply(this, no([this, as.INFO], t)), this._logHandler.apply(this, no([this, as.INFO], t)) 3723 }, ds.prototype.warn = function () { 3724 for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e]; 3725 this._userLogHandler && this._userLogHandler.apply(this, no([this, as.WARN], t)), this._logHandler.apply(this, no([this, as.WARN], t)) 3726 }, ds.prototype.error = function () { 3727 for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e]; 3728 this._userLogHandler && this._userLogHandler.apply(this, no([this, as.ERROR], t)), this._logHandler.apply(this, no([this, as.ERROR], t)) 3729 }, ds); 3730 3731 function ds(t) { 3732 this.name = t, this._logLevel = ls, this._logHandler = cs, this._userLogHandler = null, us.push(this) 3733 } 3734 3735 function vs(e) {
3736 us.forEach(function (t) { 3737 t.setLogLevel(e) 3738 }) 3739 } 3740 3741 function gs(s, e) { 3742 for (var t = 0, n = us; t < n.length; t++) ! function (t) { 3743 var o = null; 3744 e && e.level && (o = hs[e.level]), t.userLogHandler = null === s ? null : function (t, e) { 3745 for (var n = [], r = 2; r < arguments.length; r++) n[r - 2] = arguments[r]; 3746 var i = n.map(function (t) { 3747 if (null == t) return null; 3748 if ("string" == typeof t) return t; 3749 if ("number" == typeof t || "boolean" == typeof t) return t.toString(); 3750 if (t instanceof Error) return t.message; 3751 try { 3752 return JSON.stringify(t) 3753 } catch (t) { 3754 return null 3755 } 3756 }).filter(function (t) { 3757 return t 3758 }).join(" "); 3759 e >= (null != o ? o : t.logLevel) && s({ 3760 level: as[e].toLowerCase(), 3761 message: i, 3762 args: n, 3763 type: t.name 3764 }) 3765 } 3766 }(n[t]) 3767 } 3768 var Sn = ((G = {})["no-app"] = "No Firebase App '{$appName}' has been created - call Firebase App.initializeApp()", G["bad-app-name"] = "Illegal App name: '{$appName}", G["duplicate-app"] = "Firebase App named '{$appName}' already exists", G["app-deleted"] = "Firebase App named '{$appName}' already deleted", G["invalid-app-argument"] = "firebase.{$appName}() takes either no argument or a Firebase App instance.", G["invalid-log-argument"] = "First argument to `onLog` must be null or a function.", G), 3769 ys = new Co("app", "Firebase", Sn), 3770 ms = "@firebase/app", 3771 bs = "[DEFAULT]", 3772 ws = ((z = {})[ms] = "fire-core", z["@firebase/analytics"] = "fire-analytics", z["@firebase/auth"] = "fire-auth", z["@firebase/database"] = "fire-rtdb", z["@firebase/functions"] = "fire-fn", z["@firebase/installations"]
3772= "fire-iid", z["@firebase/messaging"] = "fire-fcm", z["@firebase/performance"] = "fire-perf", z["@firebase/remote-config"] = "fire-rc", z["@firebase/storage"] = "fire-gcs", z["@firebase/firestore"] = "fire-fst", z["fire-js"] = "fire-js", z["firebase-wrapper"] = "fire-js-all", z), 3773 _s = new ps("@firebase/app"), 3774 Is = (Object.defineProperty(Ts.prototype, "automaticDataCollectionEnabled", { 3775 get: function () { 3776 return this.checkDestroyed_(), this.automaticDataCollectionEnabled_ 3777 }, 3778 set: function (t) { 3779 this.checkDestroyed_(), this.automaticDataCollectionEnabled_ = t 3780 }, 3781 enumerable: !1, 3782 configurable: !0 3783 }), Object.defineProperty(Ts.prototype, "name", { 3784 get: function () { 3785 return this.checkDestroyed_(), this.name_ 3786 }, 3787 enumerable: !1, 3788 configurable: !0 3789 }), Object.defineProperty(Ts.prototype, "options", { 3790 get: function () { 3791 return this.checkDestroyed_(), this.options_ 3792 }, 3793 enumerable: !1, 3794 configurable: !0 3795 }), Ts.prototype.delete = function () { 3796 var e = this; 3797 return new Promise(function (t) { 3798 e.checkDestroyed_(), t() 3799 }).then(function () { 3800 return e.firebase_.INTERNAL.removeApp(e.name_), Promise.all(e.container.getProviders().map(function (t) { 3801 return t.delete() 3802 })) 3803 }).then(function () { 3804 e.isDeleted_ = !0 3805 }) 3806 }, Ts.prototype._getService = function (t, e) { 3807 return void 0 === e && (e = bs), this.checkDestroyed_(), this.container.getProvider(t).getImmediate({ 3808 identifier: e 3809 }) 3810 }, Ts.prototype._removeServiceInstance = function (t, e) { 3811 void 0 === e && (e = bs), this.container.getProvider(t).clearInstance(e) 3812 }, Ts.prototype._addComponent = function (e) { 3813 try { 3814 this.container.addComponent(e) 3815 } catch (t) { 3816 _s.debug("Component " + e.name + " failed to register with FirebaseApp " + this.name, t) 3817 } 3818 }, Ts.prototype._addOrOverwriteComponent = function (t) { 3819 this.container.addOrOverwriteComponent(t) 3820 }, Ts.prototype.toJSON = function () { 3821 return { 3822 name: this.name, 3823 automaticDataCollectionEnabled: this.automaticDataCollectionEnabled, 3824 options: this.options 3825 } 3826 }, Ts.prototype.checkDestroyed_ = function () { 3827 if (this.isDeleted_) throw ys.create("app-deleted", { 3828 appName: this.name_ 3829 }) 3830 }, Ts); 3831 3832 function Ts(t, e, n) { 3833 var r = this; 3834 this.firebase_ = n, this.isDeleted_ = !1, this.name_ = e.name, this.automaticDataCollectionEnabled_ = e.automaticDataCollectionEnabled || !1, this.options_ = co(t), this.container = new os(e.name), this._addComponent(new ts("app", function () { 3835 return r 3836 }, "PUBLIC")), this.firebase_.INTERNAL.components.forEach(function (t) { 3837 return r._addComponent(t) 3838 }) 3839 } 3840 Is.prototype.name && Is.prototype.options || Is.prototype.delete || console.log("dc"); 3841 var Es = "8.3.2"; 3842 3843 function Ss(s) { 3844 var a = {}, 3845 u = new Map, 3846 c = { 3847 __esModule: !0, 3848 initializeApp: function (t, e) { 3849 void 0 === e && (e = {}); 3850 "object" == typeof e && null !== e || (e = { 3851 name: e 3852 }); 3853 var n = e; 3854 void 0 === n.name && (n.name = bs); 3855 e = n.name; 3856 if ("string" != typeof e || !e) throw ys.create("bad-app-name", { 3857 appName: String(e) 3858 }); 3859 if (Oo(a, e)) throw ys.create("duplicate-app", { 3860 appName: e 3861 });
3862 n = new s(t, n, c); 3863 return a[e] = n 3864 }, 3865 app: h, 3866 registerVersion: function (t, e, n) { 3867 var r = null !== (i = ws[t]) && void 0 !== i ? i : t; 3868 n && (r += "-" + n); 3869 var i = r.match(/\s|\//), 3870 t = e.match(/\s|\//); 3871 if (i || t) { 3872 n = ['Unable to register library "' + r + '" with version "' + e + '":']; 3873 return i && n.push('library name "' + r + '" contains illegal characters (whitespace or "/")'), i && t && n.push("and"), t && n.push('version name "' + e + '" contains illegal characters (whitespace or "/")'), void _s.warn(n.join(" ")) 3874 } 3875 o(new ts(r + "-version", function () { 3876 return { 3877 library: r, 3878 version: e 3879 } 3880 }, "VERSION")) 3881 }, 3882 setLogLevel: vs, 3883 onLog: function (t, e) { 3884 if (null !== t && "function" != typeof t) throw ys.create("invalid-log-argument"); 3885 gs(t, e) 3886 }, 3887 apps: null, 3888 SDK_VERSION: Es, 3889 INTERNAL: { 3890 registerComponent: o, 3891 removeApp: function (t) { 3892 delete a[t] 3893 }, 3894 components: u, 3895 useAsService: function (t, e) { 3896 if ("serverAuth" === e) return null; 3897 return e 3898 } 3899 } 3900 }; 3901 3902 function h(t) { 3903 if (!Oo(a, t = t || bs)) throw ys.create("no-app", { 3904 appName: t 3905 }); 3906 return a[t] 3907 } 3908 3909 function o(n) { 3910 var t, r = n.name; 3911 if (u.has(r)) return _s.debug("There were multiple attempts to register component " + r + "."), "PUBLIC" === n.type ? c[r] : null; 3912 u.set(r, n), "PUBLIC" === n.type && (t = function (t) { 3913 if ("function" != typeof (t = void 0 === t ? h() : t)[r]) throw ys.create("invalid-app-argument", { 3914 appName: r 3915 }); 3916 return t[r]() 3917 }, void 0 !== n.serviceProps && ho(t, n.serviceProps), c[r] = t, s.prototype[r] = function () { 3918 for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e]; 3919 return this._getService.bind(this, r).apply(this, n.multipleInstances ? t : []) 3920 }); 3921 for (var e = 0, i = Object.keys(a); e < i.length; e++) { 3922 var o = i[e]; 3923 a[o]._addComponent(n) 3924 } 3925 return "PUBLIC" === n.type ? c[r] : null 3926 } 3927 return c.default = c, Object.defineProperty(c, "apps", { 3928 get: function () { 3929 return Object.keys(a).map(function (t) { 3930 return a[t] 3931 }) 3932 } 3933 }), h.App = s, c 3934 } 3935 var G = function t() { 3936 var e = Ss(Is); 3937 return e.INTERNAL = Ji(Ji({}, e.INTERNAL), { 3938 createFirebaseNamespace: t, 3939 extendNamespace: function (t) { 3940 ho(e, t) 3941 }, 3942 createSubscribe: jo, 3943 ErrorFactory: Co, 3944 deepExtend: ho 3945 }), e 3946 }(), 3947 Cs = (Ns.prototype.getPlatformInfoString = function () { 3948 return this.container.getProviders().map(function (t) { 3949 if (function (t) { 3950 t = t.getComponent(); 3951 return "VERSION" === (null == t ? void 0 : t.type) 3952 }(t)) { 3953 t = t.getImmediate(); 3954 return t.library + "/" + t.version 3955 } 3956 return null 3957 }).filter(function (t) { 3958 return t 3959 }).join(" ") 3960 }, Ns); 3961 3962 function Ns(t) { 3963 this.container = t 3964 } 3965 "object" == typeof self && self.self === self && void 0 !== self.firebase && (_s.warn("\n Warning: Firebase is already defined in the global scope. Please make sure\n Firebase library is only loaded once.\n "), (Ga = self.firebase.SDK_VERSION) && 0 <= Ga.indexOf("LITE") && _s.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 ")); 3966 var As = G.initializeApp; 3967 G.initializeApp = function () { 3968 for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e]; 3969 return function () { 3970 try { 3971 return "[object process]" === Object.prototype.toString.call(global.process) 3972 } catch (t) { 3973 return 3974 } 3975 }() && _s.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 '), As.apply(void 0, t) 3976 }; 3977 var ks, Rs, Xl = G;
3978 (ks = Xl).INTERNAL.registerComponent(new ts("platform-logger", function (t) { 3979 return new Cs(t) 3980 }, "PRIVATE")), ks.registerVersion(ms, "0.6.18", Rs), ks.registerVersion("fire-js", ""); 3981 Xl.registerVersion("firebase", "8.3.2", "app"); 3982 ! function () { 3983 var t, o = "function" == typeof Object.defineProperties ? Object.defineProperty : function (t, e, n) { 3984 t != Array.prototype && t != Object.prototype && (t[e] = n.value) 3985 }; 3986 var u = function (t) { 3987 t = ["object" == typeof window && window, "object" == typeof self && self, "object" == typeof global && global, t]; 3988 for (var e = 0; e < t.length; ++e) { 3989 var n = t[e]; 3990 if (n && n.Math == Math) return n 3991 } 3992 return globalThis 3993 }(this); 3994 3995 function c(t) { 3996 var e, n, r = "undefined" != typeof Symbol && Symbol.iterator && t[Symbol.iterator]; 3997 return r ? r.call(t) : { 3998 next: (e = t, n = 0, function () { 3999 return n < e.length ? { 4000 done: !1, 4001 value: e[n++] 4002 } : { 4003 done: !0 4004 } 4005 }) 4006 } 4007 }! function (t, e) { 4008 if (e) { 4009 var n = u; 4010 t = t.split("."); 4011 for (var r = 0; r < t.length - 1; r++) { 4012 var i = t[r]; 4013 i in n || (n[i] = {}), n = n[i] 4014 }(e = e(r = n[t = t[t.length - 1]])) != r && null != e && o(n, t, { 4015 configurable: !0, 4016 writable: !0, 4017 value: e 4018 }) 4019 } 4020 }("Promise", function (t) { 4021 function s(t) { 4022 this.b = 0, this.c = void 0, this.a = []; 4023 var e = this.f(); 4024 try { 4025 t(e.resolve, e.reject) 4026 } catch (t) { 4027 e.reject(t) 4028 } 4029 } 4030 4031 function e() { 4032 this.a = null 4033 } 4034 4035 function a(e) { 4036 return e instanceof s ? e : new s(function (t) { 4037 t(e) 4038 }) 4039 } 4040 if (t) return t; 4041 e.prototype.b = function (t) { 4042 var e; 4043 null == this.a && (this.a = [], (e = this).c(function () { 4044 e.g() 4045 })), this.a.push(t) 4046 }; 4047 var n = u.setTimeout; 4048 e.prototype.c = function (t) { 4049 n(t, 0) 4050 }, e.prototype.g = function () { 4051 for (; this.a && this.a.length;) { 4052 var t = this.a; 4053 this.a = []; 4054 for (var e = 0; e < t.length; ++e) { 4055 var n = t[e]; 4056 t[e] = null; 4057 try { 4058 n() 4059 } catch (t) { 4060 this.f(t) 4061 } 4062 } 4063 } 4064 this.a = null 4065 }, e.prototype.f = function (t) { 4066 this.c(function () { 4067 throw t 4068 }) 4069 }, s.prototype.f = function () { 4070 function t(e) { 4071 return function (t) { 4072 r || (r = !0, e.call(n, t)) 4073 } 4074 } 4075 var n = this, 4076 r = !1; 4077 return { 4078 resolve: t(this.m), 4079 reject: t(this.g) 4080 } 4081 }, s.prototype.m = function (t) { 4082 if (t === this) this.g(new TypeError("A Promise cannot resolve to itself")); 4083 else if (t instanceof s) this.s(t); 4084 else { 4085 t: switch (typeof t) { 4086 case "object": 4087 var e = null != t; 4088 break t; 4089 case "function": 4090 e = !0; 4091 break t; 4092 default: 4093 e = !1 4094 } 4095 e ? this.v(t) : this.h(t) 4096 } 4097 }, s.prototype.v = function (t) { 4098 var e = void 0; 4099 try { 4100 e = t.then 4101 } catch (t) { 4102 return void this.g(t) 4103 } 4104 "function" == typeof e ? this.u(e, t) : this.h(t) 4105 }, s.prototype.g = function (t) { 4106 this.i(2, t) 4107 }, s.prototype.h = function (t) { 4108 this.i(1, t) 4109 }, s.prototype.i = function (t, e) { 4110 if (0 != this.b) throw Error("Cannot settle(" + t + ", " + e + "): Promise already settled in state" + this.b); 4111 this.b = t, this.c = e, this.l() 4112 }, s.prototype.l = function () { 4113 if (null != this.a) { 4114 for (var t = 0; t < this.a.length; ++t) i.b(this.a[t]); 4115 this.a = null 4116 } 4117 }; 4118 var i = new e; 4119 return s.prototype.s = function (t) { 4120 var e = this.f(); 4121 t.Qa(e.resolve, e.reject) 4122 }, s.prototype.u = function (t, e) { 4123 var n = this.f(); 4124 try { 4125 t.call(e, n.resolve, n.reject) 4126 } catch (t) { 4127 n.reject(t) 4128 } 4129 }, s.prototype.then = function (t, e) { 4130 function n(e, t) { 4131 return "function" == typeof e ? function (t) { 4132 try { 4133 r(e(t)) 4134 } catch (t) { 4135 i(t) 4136 } 4137 } : t 4138 } 4139 var r, i, o = new s(function (t, e) { 4140 r = t, i = e 4141 }); 4142 return this.Qa(n(t, r), n(e, i)), o 4143 }, s.prototype.catch = function (t) { 4144 return this.then(void 0, t) 4145 }, s.prototype.Qa = function (t, e) { 4146 function n() { 4147 switch (r.b) { 4148 case 1: 4149 t(r.c); 4150 break; 4151 case 2: 4152 e(r.c); 4153 break; 4154 default: 4155 throw Error("Unexpected state: " + r.b) 4156 } 4157 } 4158 var r = this; 4159 null == this.a ? i.b(n) : this.a.push(n) 4160 }, s.resolve = a, s.reject = function (n) { 4161 return new s(function (t, e) { 4162 e(n) 4163 }) 4164 }, s.race = function (i) { 4165 return new s(function (t, e) { 4166 for (var n = c(i), r = n.next(); !r.done; r = n.next()) a(r.value).Qa(t, e) 4167 }) 4168 }, s.all = function (t) { 4169 var e = c(t), 4170 o = e.next(); 4171 return o.done ? a([]) : new s(function (n, t) { 4172 for (var r = [], i = 0; r.push(void 0), i++, a(o.value).Qa(function (e) { 4173 return function (t) { 4174 r[e] = t, 0 == --i && n(r) 4175 } 4176 }(r.length - 1), t), o = e.next(), !o.done;); 4177 }) 4178 }, s 4179 }); 4180 var h = h || {}, 4181 l = this || self, 4182 e = /^[\w+/_-]+[=]{0,2}$/, 4183 a = null; 4184 4185 function f(t) { 4186 return (t = t.querySelector && t.querySelector("script[n
4186once]")) && (t = t.nonce || t.getAttribute("nonce")) && e.test(t) ? t : "" 4187 } 4188 4189 function s() {} 4190 4191 function p(t) { 4192 var e = typeof t; 4193 return "object" != e ? e : t ? Array.isArray(t) ? "array" : e : "null" 4194 } 4195 4196 function d(t) { 4197 var e = p(t); 4198 return "array" == e || "object" == e && "number" == typeof t.length 4199 } 4200 4201 function v(t) { 4202 return "function" == p(t) 4203 } 4204 4205 function g(t) { 4206 var e = typeof t; 4207 return "object" == e && null != t || "function" == e 4208 } 4209 var n = "closure_uid_" + (1e9 * Math.random() >>> 0), 4210 r = 0; 4211 4212 function i(t, e, n) { 4213 return t.call.apply(t.bind, arguments) 4214 } 4215 4216 function y(e, n, t) { 4217 if (!e) throw Error(); 4218 if (2 < arguments.length) { 4219 var r = Array.prototype.slice.call(arguments, 2); 4220 return function () { 4221 var t = Array.prototype.slice.call(arguments); 4222 return Array.prototype.unshift.apply(t, r), e.apply(n, t) 4223 } 4224 } 4225 return function () { 4226 return e.apply(n, arguments) 4227 } 4228 } 4229 4230 function m(t, e, n) { 4231 return (m = Function.prototype.bind && -1 != Function.prototype.bind.toString().indexOf("native code") ? i : y).apply(null, arguments) 4232 } 4233 4234 function b(e) { 4235 var n = Array.prototype.slice.call(arguments, 1); 4236 return function () { 4237 var t = n.slice(); 4238 return t.push.apply(t, arguments), e.apply(this, t) 4239 } 4240 } 4241 4242 function w(t, e) { 4243 function n() {} 4244 n.prototype = e.prototype, t.ab = e.prototype, t.prototype = new n, t.prototype.constructor = t 4245 } 4246 4247 function _(t) { 4248 return t 4249 } 4250 4251 function I(t, e, n) { 4252 this.code = S + t, this.message = e || C[t] || "", this.a = n || null 4253 } 4254 4255 function T(t) { 4256 var e = t && t.code; 4257 return e ? new I(e.substring(S.length), t.message, t.serverResponse) : null 4258 } 4259 w(I, Error), I.prototype.w = function () { 4260 var t = { 4261 code: this.code, 4262 message: this.message 4263 }; 4264 return this.a && (t.serverResponse = this.a), t 4265 }, I.prototype.toJSON = function () { 4266 return this.w() 4267 }; 4268 var E, S = "auth/", 4269 C = { 4270 "admin-restricted-operation": "This operation is restricted to administrators only.", 4271 "argument-error": "", 4272 "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.", 4273 "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.", 4274 "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.", 4275 "code-expired": "The SMS code has expired. Please re-send the verification code to try again.", 4276 "cordova-not-ready": "Cordova framework is not ready.", 4277 "cors-unsupported": "This browser is not supported.", 4278 "credential-already-in-use": "This credential is already associated with a different user account.", 4279 "custom-token-mismatch": "The custom token corresponds to a different audience.", 4280 "requires-recent-login": "This operation is sensitive and requires recent authentication. Log in again before retrying this request.", 4281 "dynamic-link-not-activated": "Please activate Dynamic Links in the Firebase Console and agree to the terms and conditions.", 4282 "email-change-needs-verification": "Multi-factor users must al
4282ways have a verified email.", 4283 "email-already-in-use": "The email address is already in use by another account.", 4284 "expired-action-code": "The action code has expired. ", 4285 "cancelled-popup-request": "This operation has been cancelled due to another conflicting popup being opened.", 4286 "internal-error": "An internal error has occurred.", 4287 "invalid-app-credential": "The phone verification request contains an invalid application verifier. The reCAPTCHA token response is either invalid or expired.", 4288 "invalid-app-id": "The mobile app identifier is not registed for the current project.", 4289 "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.", 4290 "invalid-auth-event": "An internal error has occurred.", 4291 "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.", 4292 "invalid-continue-uri": "The continue URL provided in the request is invalid.", 4293 "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.", 4294 "invalid-custom-token": "The custom token format is incorrect. Please check the documentation.", 4295 "invalid-dynamic-link-domain": "The provided dynamic link domain is not configured or authorized for the current project.", 4296 "invalid-email": "The email address is badly formatted.", 4297 "invalid-api-key": "Your API key is invalid, please check you have copied it correctly.", 4298 "invalid-cert-hash": "The SHA-1 certificate hash provided is invalid.", 4299 "invalid-credential": "The supplied auth credential is malformed or has expired.", 4300 "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.", 4301 "invalid-multi-factor-session": "The request does not contain a valid proof of first factor successful sign-in.", 4302 "invalid-oauth-provider": "EmailAuthProvider is not supported for this operation. This operation only supports OAuth providers.", 4303 "invalid-oauth-client-id": "The OAuth client ID provided is either invalid or does not match the specified API key.", 4304 "unauthorized-domain": "This domain is not authorized for OAuth operations for your Firebase project. Edit the list of authorized domains from the Firebase console.", 4305 "invalid-action-code": "The action code is invalid. This can happen if the code is malformed, expired, or has already been used.", 4306 "wrong-password": "The password is invalid or the user does not have a password.", 4307 "invalid-persistence-type": "The specified persistence type is invalid. It can only be local, session or none.", 4308 "invalid-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].", 4309 "invalid-provider-id": "The specified provider ID is invali
4309d.", 4310 "invalid-recipient-email": "The email corresponding to this action failed to send as the provided recipient email address is invalid.", 4311 "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.", 4312 "invalid-verification-id": "The verification ID used to create the phone auth credential is invalid.", 4313 "invalid-tenant-id": "The Auth instance's tenant ID is invalid.", 4314 "multi-factor-info-not-found": "The user does not have a second factor matching the identifier provided.", 4315 "multi-factor-auth-required": "Proof of ownership of a second factor is required to complete sign-in.", 4316 "missing-android-pkg-name": "An Android Package Name must be provided if the Android App is required to be installed.", 4317 "auth-domain-config-required": "Be sure to include authDomain when calling firebase.initializeApp(), by following the instructions in the Firebase console.", 4318 "missing-app-credential": "The phone verification request is missing an application verifier assertion. A reCAPTCHA response token needs to be provided.", 4319 "missing-verification-code": "The phone auth credential was created with an empty SMS verification code.", 4320 "missing-continue-uri": "A continue URL must be provided in the request.", 4321 "missing-iframe-start": "An internal error has occurred.", 4322 "missing-ios-bundle-id": "An iOS Bundle ID must be provided if an App Store ID is provided.", 4323 "missing-multi-factor-info": "No second factor identifier is provided.", 4324 "missing-multi-factor-session": "The request is missing proof of first factor successful sign-in.", 4325 "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.", 4326 "missing-phone-number": "To send verification codes, provide a phone number for the recipient.", 4327 "missing-verification-id": "The phone auth credential was created with an empty verification ID.", 4328 "app-deleted": "This instance of FirebaseApp has been deleted.", 4329 "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.", 4330 "network-request-failed": "A network error (such as timeout, interrupted connection or unreachable host) has occurred.", 4331 "no-auth-event": "An internal error has occurred.", 4332 "no-such-provider": "User was not linked to an account with the given provider.", 4333 "null-user": "A null user object was provided as the argument for an operation which requires a non-null user object.", 4334 "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.", 4335 "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.', 4336 "popup-blocked": "Unable to establish a connection with the popup. It may have been blocked by the browser.", 4337 "popup-closed-by-user": "The popup has been closed by the user before finalizing the operation.", 4338 "provider-already-linked": "User can only be linked to one identity for the given provider.", 4339 "quota-exceeded": "The project's quota for this operation has been exceeded.", 4340 "redirect-cancelled-by-user": "The redirect operation has been cancelled by the user before finalizing.", 4341 "redirect-operation-pending": "A redirect sign-in operation is already pending.", 4342 "rejected-credential": "The request contains malformed or mismatching credentials.", 4343 "second-factor-already-in-use": "The second factor is already enrolled on this account.", 4344 "maximum-second-factor-count-exceeded": "The maximum allowed number of second factors on a user has been exceeded.", 4345 "tenant-id-mismatch": "The provided tenant ID does not match the Auth instance's tenant ID", 4346 timeout: "The operation has timed out.", 4347 "user-token-expired": "The user's credential is no longer valid. The user must sign in again.", 4348 "too-many-requests": "We have blocked all requests from this device due to unusual activity. Try again later.", 4349 "unauthorized-continue-uri": "The domain of the continue URL is not whitelisted. Please whitelist the domain in the Firebase console.", 4350 "unsupported-first-factor": "Enrolling a second factor or signing in with a multi-factor account requires sign-in with a supported first factor.", 4351 "unsupported-persistence-type": "The current environment does not support the specified persistence type.", 4352 "unsupported-tenant-operation": "This operation is not supported in a multi-tenant context.", 4353 "unverified-email": "The operation requires a verified email.", 4354 "user-cancelled": "The user did not grant your application the permissions it requested.", 4355 "user-not-found": "There is no user record corresponding to this identifier. The user may have been deleted.", 4356 "user-disabled": "The user account has been disabled by an administrator.", 4357 "user-mismatch": "The supplied credentials do not correspond to the previously signed in user.", 4358 "user-signed-out": "", 4359 "weak-password": "The password must be 6 characters long or more.", 4360 "web-storage-unsupported": "This browser is not supported or 3rd party cookies and data may be disabled." 4361 }, 4362 N = { 4363 ld: { 4364 Ta: "https://staging-identitytoolkit.sandbox.googleapis.com/identitytoolkit/v3/relyingparty/", 4365 Za: "https://staging-securetoken.sandbox.googleapis.com/v1/token", 4366 Wa: "https://staging-identitytoolkit.sandbox.googleapis.com/v2/", 4367 id: "b" 4368 }, 4369 sd: { 4370 Ta: "https://www.googleapis.com/identitytoolkit/v3/relyingparty/", 4371 Za: "https://securetoken.googleapis.com/v1/token", 4372 Wa: "https://identitytoolkit.googleapis.com/v2/", 4373 id: "p" 4374 }, 4375 ud: { 4376 Ta: "https://staging-www.sandbox.googleapis.com/identitytoolkit/v3/relyingparty/", 4377 Za: "https://staging-securetoken.sandbox.googleapis.com/v1/token", 4378 Wa: "https://staging-identitytoolkit.sandbox.googleapis.com/v2/", 4379 id: "s" 4380 }, 4381 vd: { 4382 Ta: "https://www-googleapis-test.sandbox.google.com/identitytoolkit/v3/relyingparty/", 4383 Za: "https://test-securetoken.sandbox.googleapis.com/v1/token", 4384 Wa: "https://test-identitytoolkit.sandbox.googleapis.com/v2/", 4385 id: "t" 4386 } 4387 }; 4388 4389 function A(t) { 4390 for (var e in N) 4391 if (N[e].id === t) return t = N[e], { 4392 firebaseEndpoint: t.Ta, 4393 secureTokenEndpoint: t.Za, 4394 identityPlatformEndpoint: t.Wa 4395 }; 4396 return null 4397 } 4398 4399 function k(t) { 4400 if (t) try {
4401 return t.$goog_Thenable 4402 } catch (t) { 4403 return 4404 } 4405 } 4406 4407 function R(t) { 4408 var e; 4409 Error.captureStackTrace ? Error.captureStackTrace(this, R) : (e = Error().stack) && (this.stack = e), t && (this.message = String(t)) 4410 } 4411 4412 function P(t, e) { 4413 for (var n = "", r = (t = t.split("%s")).length - 1, i = 0; i < r; i++) n += t[i] + (i < e.length ? e[i] : "%s"); 4414 R.call(this, n + t[r]) 4415 } 4416 4417 function O(t) { 4418 throw new P("Failure" + (t ? ": " + t : ""), Array.prototype.slice.call(arguments, 1)) 4419 } 4420 4421 function D(t, e) { 4422 this.c = t, this.f = e, this.b = 0, this.a = null 4423 } 4424 4425 function x(t, e) { 4426 t.f(e), t.b < 100 && (t.b++, e.next = t.a, t.a = e) 4427 } 4428 4429 function L() { 4430 this.b = this.a = null 4431 } 4432 E = A("__EID__") ? "__EID__" : void 0, w(R, Error), R.prototype.name = "CustomError", w(P, R), P.prototype.name = "AssertionError", D.prototype.get = function () { 4433 var t; 4434 return 0 < this.b ? (this.b--, t = this.a, this.a = t.next, t.next = null) : t = this.c(), t 4435 }; 4436 var M = new D(function () { 4437 return new F 4438 }, function (t) { 4439 t.reset() 4440 }); 4441 4442 function F() { 4443 this.next = this.b = this.a = null 4444 } 4445 L.prototype.add = function (t, e) { 4446 var n = M.get(); 4447 n.set(t, e), this.b ? this.b.next = n : this.a = n, this.b = n 4448 }, F.prototype.set = function (t, e) { 4449 this.a = t, this.b = e, this.next = null 4450 }, F.prototype.reset = function () { 4451 this.next = this.b = this.a = null 4452 }; 4453 var U = Array.prototype.indexOf ? function (t, e) { 4454 return Array.prototype.indexOf.call(t, e, void 0) 4455 } : function (t, e) { 4456 if ("string" == typeof t) return "string" != typeof e || 1 != e.length ? -1 : t.indexOf(e, 0); 4457 for (var n = 0; n < t.length; n++) 4458 if (n in t && t[n] === e) return n; 4459 return -1 4460 }, 4461 j = Array.prototype.forEach ? function (t, e, n) { 4462 Array.prototype.forEach.call(t, e, n) 4463 } : function (t, e, n) { 4464 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) 4465 }; 4466 var q = Array.prototype.filter ? function (t, e) { 4467 return Array.prototype.filter.call(t, e, void 0) 4468 } : function (t, e) { 4469 for (var n, r = t.length, i = [], o = 0, s = "string" == typeof t ? t.split("") : t, a = 0; a < r; a++) a in s && (n = s[a], e.call(void 0, n, a, t) && (i[o++] = n)); 4470 return i 4471 }, 4472 V = Array.prototype.map ? function (t, e) { 4473 return Array.prototype.map.call(t, e, void 0) 4474 } : function (t, e) { 4475 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)); 4476 return r 4477 }, 4478 B = Array.prototype.some ? function (t, e) { 4479 return Array.prototype.some.call(t, e, void 0) 4480 } : function (t, e) { 4481 for (var n = t.length, r = "string" == typeof t ? t.split("") : t, i = 0; i < n; i++) 4482 if (i in r && e.call(void 0, r[i], i, t)) return !0; 4483 return !1 4484 }; 4485 4486 function K(t, e) { 4487 return 0 <= U(t, e) 4488 } 4489 4490 function W(t, e) { 4491 var n; 4492 return (n = 0 <= (e = U(t, e))) && Array.prototype.splice.call(t, e, 1), n 4493 } 4494 4495 function H(n, r) { 4496 ! function (t, e) { 4497 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) 4498 }(n, function (t, e) { 4499 r.call(void 0, t, e, n) && 1 == Array.prototype.splice.call(n, e, 1).length && 0 4500 }) 4501 } 4502 4503 function G() { 4504 return Array.prototype.concat.apply([], arguments) 4505 } 4506 4507 function z(t) { 4508 var e = t.length; 4509 if (0 < e) { 4510 for (var n = Array(e), r = 0; r < e; r++) n[r] = t[r]; 4511 return n 4512 } 4513 return [] 4514 } 4515 var Q, Y = String.prototype.trim ? function (t) { 4516 return t.trim() 4517 } : function (t) { 4518 return /^[\s\xa0]*([\s\S]*?)[\s\xa0]*$/.exec(t)[1] 4519 }, 4520 X = /&/g, 4521 J = /</g, 4522 $ = />/g, 4523 Z = /"/g, 4524 tt = /'/g, 4525 et = /\x00/g, 4526 nt = /[\x00&<>"']/; 4527 4528 function rt(t, e) { 4529 return -1 != t.indexOf(e) 4530 } 4531 4532 function it(t, e) { 4533 return t < e ? -1 : e < t ? 1 : 0 4534 } 4535 t: { 4536 var ot = l.navigator; 4537 if (ot) { 4538 ot = ot.userAgent; 4539 if (ot) { 4540 Q = ot; 4541 break t 4542 } 4543 } 4544 Q = "" 4545 } 4546 4547 function st(t) { 4548 return rt(Q, t) 4549 } 4550 4551 function at(t, e) { 4552 for (var n in t) e.call(void 0, t[n], n, t) 4553 } 4554 4555 function ut(t) { 4556 for (var e in t) return; 4557 return 1 4558 } 4559 4560 function ct(t) { 4561 var e, n = {};
4562 for (e in t) n[e] = t[e]; 4563 return n 4564 } 4565 var ht = "constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "); 4566 4567 function lt(t) { 4568 for (var e, n, r = 1; r < arguments.length; r++) { 4569 for (e in n = arguments[r]) t[e] = n[e]; 4570 for (var i = 0; i < ht.length; i++) e = ht[i], Object.prototype.hasOwnProperty.call(n, e) && (t[e] = n[e]) 4571 } 4572 } 4573 4574 function ft(t, e) { 4575 t: { 4576 try { 4577 var n = t && t.ownerDocument, 4578 n = n && (n.defaultView || n.parentWindow); 4579 if ((n = n || l).Element && n.Location) { 4580 var r = n; 4581 break t 4582 } 4583 } catch (t) {} 4584 r = null 4585 } 4586 if (r && void 0 !== r[e] && (!t || !(t instanceof r[e]) && (t instanceof r.Location || t instanceof r.Element))) { 4587 if (g(t)) try { 4588 var i = t.constructor.displayName || t.constructor.name || Object.prototype.toString.call(t) 4589 } catch (t) { 4590 i = "<object could not be stringified>" 4591 } else i = void 0 === t ? "undefined" : null === t ? "null" : typeof t; 4592 O("Argument is not a %s (or a non-Element, non-Location mock); got: %s", e, i) 4593 } 4594 } 4595 4596 function pt(t, e) { 4597 this.a = t === yt && e || "", this.b = gt 4598 } 4599 4600 function dt(t) { 4601 return t instanceof pt && t.constructor === pt && t.b === gt ? t.a : (O("expected object of type Const, got '" + t + "'"), "type_error:Const") 4602 } 4603 pt.prototype.sa = !0, pt.prototype.ra = function () { 4604 return this.a 4605 }, pt.prototype.toString = function () { 4606 return "Const{" + this.a + "}" 4607 }; 4608 var vt, gt = {}, 4609 yt = {}; 4610 4611 function mt() { 4612 if (void 0 === vt) { 4613 var t = null, 4614 e = l.trustedTypes; 4615 if (e && e.createPolicy) { 4616 try { 4617 t = e.createPolicy("goog#html", { 4618 createHTML: _, 4619 createScript: _, 4620 createScriptURL: _ 4621 }) 4622 } catch (t) { 4623 l.console && l.console.error(t.message) 4624 } 4625 vt = t 4626 } else vt = t 4627 } 4628 return vt 4629 } 4630 4631 function bt(t, e) { 4632 this.a = e === Et ? t : "" 4633 } 4634 4635 function wt(t) { 4636 return t instanceof bt && t.constructor === bt ? t.a : (O("expected object of type TrustedResourceUrl, got '" + t + "' of type " + p(t)), "type_error:TrustedResourceUrl") 4637 } 4638 4639 function _t(t, n) { 4640 var e, r = dt(t); 4641 if (!Tt.test(r)) throw Error("Invalid TrustedResourceUrl format: " + r); 4642 return t = r.replace(It, function (t, e) { 4643 if (!Object.prototype.hasOwnProperty.call(n, e)) throw Error('Found marker, "' + e + '", in format string, "' + r + '", but no valid label mapping found in args: ' + JSON.stringify(n)); 4644 return (t = n[e]) instanceof pt ? dt(t) : encodeURIComponent(String(t)) 4645 }), e = t, t = mt(), new bt(e = t ? t.createScriptURL(e) : e, Et) 4646 } 4647 bt.prototype.sa = !0, bt.prototype.ra = function () { 4648 return this.a.toString() 4649 }, bt.prototype.toString = function () { 4650 return "TrustedResourceUrl{" + this.a + "}" 4651 }; 4652 var It = /%{(\w+)}/g, 4653 Tt = /^((https:)?\/\/[0-9a-z.:[\]-]+\/|\/[^/\\]|[^:/\\%]+\/|[^:/\\%]*[?#]|about:blank#)/i, 4654 Et = {}; 4655 4656 function St(t, e) { 4657 this.a = e === Ot ? t : "" 4658 } 4659 4660 function Ct(t) { 4661 return t instanceof St && t.constructor === St ? t.a : (O("expected object of type SafeUrl, got '" + t + "' of type " + p(t)), "type_error:SafeUrl") 4662 } 4663 St.prototype.sa = !0, St.prototype.ra = function () { 4664 return this.a.toString() 4665 }, St.prototype.toString = function () { 4666 return "SafeUrl{" + this.a + "}" 4667 }; 4668 var Nt = /^(?: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, 4669 At = /^data:(.*);base64,[a-z0-9+\/]+=*$/i, 4670 kt = /^(?:(?:https?|mailto|ftp):|[^:/?#]*(?:[/?#]|$))/i; 4671 4672 function Rt(t) { 4673 return t instanceof St ? t : (t = "object" == typeof t && t.sa ? t.ra() : String(t), t = kt.test(t) || (e = (t = (t = String(t)).replace(/(%0A|%0D)/g, "")).match(At)) && Nt.test(e[1]) ? new St(t, Ot) : null); 4674 var e 4675 } 4676 4677 function Pt(t) { 4678 return t instanceof St ? t : (t = "object" == typeof t && t.sa ? t.ra() : String(t), new St(t = !kt.test(t) ? "about:invalid#zClosurez" : t, Ot)) 4679 } 4680 var Ot = {}, 4681 Dt = new St("about:invalid#zClosurez", Ot); 4682 4683 function xt(t, e, n) { 4684 this.a = n === Lt ? t : "" 4685 } 4686 xt.prototype.sa = !0, xt.prototype.ra = function () { 4687 return this.a.toString() 4688 }, xt.prototype.toString = function () { 4689 return "SafeHtml{" + this.a + "}" 4690 }; 4691 var Lt = {}; 4692 4693 function Mt(t, e, n, r) { 4694 return t = t instanceof St ? t : Pt(t), e = e || l, n = n instanceof pt ? dt(n) : n || "", e.open(Ct(t), n, r, void 0) 4695 } 4696 4697 function Ft(t) { 4698 for (var e = t.split("%s"), n = "", r = Array.prototype.slice.call(arguments, 1); r.length && 1 < e.length;
4698) n += e.shift() + r.shift(); 4699 return n + e.join("%s") 4700 } 4701 4702 function Ut(t) { 4703 return nt.test(t) && (-1 != (t = -1 != (t = -1 != (t = -1 != (t = -1 != (t = -1 != t.indexOf("&") ? t.replace(X, "&") : t).indexOf("<") ? t.replace(J, "<") : t).indexOf(">") ? t.replace($, ">") : t).indexOf('"') ? t.replace(Z, """) : t).indexOf("'") ? t.replace(tt, "'") : t).indexOf("\0") && (t = t.replace(et, "�"))), t 4704 } 4705 4706 function jt(t) { 4707 return jt[" "](t), t 4708 } 4709 jt[" "] = s; 4710 var qt, Vt = st("Opera"), 4711 Bt = st("Trident") || st("MSIE"), 4712 Kt = st("Edge"), 4713 Wt = Kt || Bt, 4714 Ht = st("Gecko") && !(rt(Q.toLowerCase(), "webkit") && !st("Edge")) && !(st("Trident") || st("MSIE")) && !st("Edge"), 4715 Gt = rt(Q.toLowerCase(), "webkit") && !st("Edge"); 4716 4717 function zt() { 4718 var t = l.document; 4719 return t ? t.documentMode : void 0 4720 } 4721 t: { 4722 var Qt = "", 4723 Yt = (Yt = Q, Ht ? /rv:([^\);]+)(\)|;)/.exec(Yt) : Kt ? /Edge\/([\d\.]+)/.exec(Yt) : Bt ? /\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(Yt) : Gt ? /WebKit\/(\S+)/.exec(Yt) : Vt ? /(?:Version)[ \/]?(\S+)/.exec(Yt) : void 0); 4724 if (Yt && (Qt = Yt ? Yt[1] : ""), Bt) { 4725 Yt = zt(); 4726 if (null != Yt && Yt > parseFloat(Qt)) { 4727 qt = String(Yt); 4728 break t 4729 } 4730 } 4731 qt = Qt 4732 } 4733 var Xt = {}; 4734 4735 function Jt(a) { 4736 return t = a, e = function () { 4737 for (var t = 0, e = Y(String(qt)).split("."), n = Y(String(a)).split("."), r = Math.max(e.length, n.length), i = 0; 0 == t && i < r; i++) 4738 for (var o = e[i] || "", s = n[i] || ""; o = /(\d*)(\D*)(.*)/.exec(o) || ["", "", "", ""], s = /(\d*)(\D*)(.*)/.exec(s) || ["", "", "", ""], (0 != o[0].length || 0 != s[0].length) && (t = it(0 == o[1].length ? 0 : parseInt(o[1], 10), 0 == s[1].length ? 0 : parseInt(s[1], 10)) || it(0 == o[2].length, 0 == s[2].length) || it(o[2], s[2]), o = o[3], s = s[3], 0 == t);); 4739 return 0 <= t 4740 }, n = Xt, Object.prototype.hasOwnProperty.call(n, t) ? n[t] : n[t] = e(t); 4741 var t, e, n 4742 } 4743 var $t = l.document && Bt && (zt() || parseInt(qt, 10)) || void 0; 4744 try { 4745 new self.OffscreenCanvas(0, 0).getContext("2d") 4746 } catch (t) {} 4747 var Zt = !Bt || 9 <= Number($t); 4748 4749 function te(t) { 4750 var e = document; 4751 return "string" == typeof t ? e.getElementById(t) : t 4752 } 4753 4754 function ee(n, t) { 4755 at(t, function (t, e) { 4756 t && "object" == typeof t && t.sa && (t = t.ra()), "style" == e ? n.style.cssText = t : "class" == e ? n.className = t : "for" == e ? n.htmlFor = t : ie.hasOwnProperty(e) ? n.setAttribute(ie[e], t) : 0 == e.lastIndexOf("aria-", 0) || 0 == e.lastIndexOf("data-", 0) ? n.setAttribute(e, t) : n[e] = t 4757 }) 4758 } 4759 var ne, re, ie = { 4760 cellpadding: "cellPadding", 4761 cellspacing: "cellSpacing", 4762 colspan: "colSpan", 4763 frameborder: "frameBorder", 4764 height: "height", 4765 maxlength: "maxLength", 4766 nonce: "nonce", 4767 role: "role", 4768 rowspan: "rowSpan", 4769 type: "type", 4770 usemap: "useMap", 4771 valign: "vAlign", 4772 width: "width" 4773 }; 4774 4775 function oe() { 4776 var t, e = arguments, 4777 n = document, 4778 r = String(e[0]), 4779 i = e[1]; 4780 return !Zt && i && (i.name || i.type) && (r = ["<", r], i.name && r.push(' name="', Ut(i.name), '"'), i.type && (r.push(' type="', Ut(i.type), '"'), lt(t = {}, i), delete t.type, i = t), r.push(">"), r = r.join("")), r = se(n, r), i && ("string" == typeof i ? r.className = i : Array.isArray(i) ? r.className = i.join(" ") : ee(r, i)), 2 < e.length && function (e, n, t) { 4781 function r(t) { 4782 t && n.appendChild("string" == typeof t ? e.createTextNode(t) : t) 4783 } 4784 for (var i = 2; i < t.length; i++) { 4785 var o = t[i]; 4786 if (!d(o) || g(o) && 0 < o.nodeType) r(o); 4787 else { 4788 t: { 4789 if (o && "number" == typeof o.length) { 4790 if (g(o)) { 4791 var s = "function" == typeof o.item || "string" == typeof o.item; 4792 break t 4793 } 4794 if (v(o)) { 4795 s = "function" == typeof o.item; 4796 break t 4797 } 4798 } 4799 s = !1 4800 } 4801 j(s ? z(o) : o, r) 4802 } 4803 } 4804 }(n, r, e), r 4805 } 4806 4807 function se(t, e) { 4808 return e = String(e), "application/xhtml+xml" === t.contentType && (e = e.toLowerCase()), t.createElement(e) 4809 } 4810 4811 function ae(t) { 4812 l.setTimeout(function () { 4813 throw t 4814 }, 0) 4815 } 4816 4817 function ue(t, e) { 4818 re || function () { 4819 { 4820 var t; 4821 re = l.Promise && l.Promise.resolve ? (t = l.Promise.resolve(void 0), function () { 4822 t.then(le) 4823 }) : function () { 4824 var t = le; 4825 !v(l.setImmediate) || l.Window && l.Window.prototype && !st("Edge") && l.Window.prototype.setImmediate == l.setImmediate ? (ne = ne || function () { 4826 var t = l.MessageChannel; 4827 if (void 0 === (t = void 0 === t && "undefined" != typeof window && window.postMessage && window.addEventListener && !st("Presto") ? function () { 4828 var t = se(document, "IFRAME"); 4829 t.style.display = "none", document.documentElement.appendChild(t); 4830 var e = t.contentWindow; 4831 (t = e.document).open(), t.close(); 4832 var n = "callImmediate" + Math.random(), 4833 r = "file:" == e.location.protocol ? "*" : e.location.protocol + "//" + e.location.host; 4834 t = m(function (t) { 4835 "*" != r && t.origin != r || t.data != n || this.port1.onmessage() 4836 }, this), e.addEventListener("message", t, !1), this.port1 = {}, this.port2 = { 4837 postMessage: function () { 4838 e.postMessage(n, r) 4839 } 4840 } 4841 } : t) || st("Trident") || st("MSIE")) return function (t) { 4842 l.setTimeout(t, 0) 4843 }; 4844 var e = new t, 4845 n = {}, 4846 r = n; 4847 return e.port1.onmessage = function () { 4848 var t; 4849 void 0 !== n.next && (t = (n = n.next).Gb, n.Gb = null, t()) 4850 }, 4851 function (t) { 4852 r.next = { 4853 Gb: t 4854 }, r = r.next, e.port2.postMessage(0) 4855 } 4856 }())(t) : l.setImmediate(t) 4857 } 4858 } 4859 }(), ce || (re(), ce = !0), he.add(t, e) 4860 } 4861 var ce = !1, 4862 he = new L; 4863 4864 function le() { 4865 for (var t, e, n; n = e = void 0, n = null, (e = he).a && (n = e.a, e.a = e.a.next, e.a || (e.b = null), n.next = null), t = n;) { 4866 try { 4867 t.a.call(t.b) 4868 } catch (t) { 4869 ae(t) 4870 } 4871 x(M, t) 4872 } 4873 ce = !1 4874 } 4875 4876 function fe(t, e) { 4877 if (this.a = pe, this.i = void 0, this.f = this.b = this.c = null, this.g = this.h = !1, t != s) try { 4878 var n = this; 4879 t.call(e, function (t) { 4880 Se(n, de, t) 4881 }, function (t) { 4882 if (!(t instanceof Oe)) try { 4883 if (t instanceof Error) throw t; 4884 throw Error("Promise rejected.") 4885 } catch (t) {} 4886 Se(n, ve, t) 4887 }) 4888 } catch (t) { 4889 Se(this, ve, t) 4890 } 4891 } 4892 var pe = 0, 4893 de = 2, 4894 ve = 3; 4895 4896 function ge() { 4897 this.next = this.f = this.b = this.g = this.a = null, this.c = !1 4898 } 4899 ge.prototype.reset = function () { 4900 this.f = this.b = this.g = this.a = null, this.c = !1 4901 }; 4902 var ye = new D(function () { 4903 return new ge 4904 }, function (t) { 4905 t.reset() 4906 }); 4907 4908 function me(t, e, n) { 4909 var r = ye.get(); 4910 return r.g = t, r.b = e, r.f = n, r 4911 } 4912 4913 function be(t) { 4914 if (t instanceof fe) return t; 4915 var e = new fe(s); 4916 return Se(e, de, t), e 4917 } 4918 4919 function we(n) { 4920 return new fe(function (t, e) { 4921 e(n) 4922 }) 4923 } 4924 4925 function _e(t, e, n) { 4926 Ce(t, e, n, null) || ue(b(e, t)) 4927 } 4928 4929 function Ie(n) { 4930 return new fe(function (r) { 4931 var i = n.length, 4932 o = []; 4933 if (i) 4934 for (var t = function (t, e, n) { 4935 i--, o[t] = e ? { 4936 Pb: !0, 4937 value: n 4938 } : { 4939 Pb: !1, 4940 reason: n 4941 }, 0 == i && r(o) 4942 }, e = 0; e < n.length; e++) _e(n[e], b(t, e, !0), b(t, e, !1)); 4943 else r(o) 4944 }) 4945 } 4946 4947 function Te(t, e) { 4948 t.b || t.a != de && t.a != ve || Ne(t), t.f ? t.f.next = e : t.b = e, t.f = e 4949 } 4950 4951 function Ee(t, i, o, s) { 4952 var e = me(null, null, null); 4953 return e.a = new fe(function (n, r) { 4954 e.g = i ? function (t) { 4955 try { 4956 var e = i.call(s, t); 4957 n(e) 4958 } catch (t) { 4959 r(t) 4960 } 4961 } : n, e.b = o ? function (t) { 4962 try { 4963 var e = o.call(s, t); 4964 void 0 === e && t instanceof Oe ? r(t) : n(e) 4965 } catch (t) { 4966 r(t) 4967 } 4968 } : r 4969 }), Te(e.a.c = t, e), e.a 4970 } 4971 4972 function Se(t, e, n) { 4973 var r, i; 4974 t.a == pe && (t === n && (e = ve, n = new TypeError("Promise cannot resolve to itself")), t.a = 1, Ce(n, t.$c, t.ad, t) || (t.i = n, t.a = e, t.c = null, Ne(t), e != ve || n instanceof Oe || (i = n, (r = t).g = !0, ue(function () { 4975 r.g && Pe.call(null, i) 4976 })))) 4977 } 4978 4979 function Ce(t, e, n, r) { 4980 if (t instanceof fe) return Te(t, me(e || s, n || null, r)), 1; 4981 if (k(t)) return t.then(e, n, r), 1; 4982 if (g(t)) try { 4983 var i = t.then; 4984 if (v(i)) return function (t, e, n, r, i) { 4985 function o(t) { 4986 s || (s = !0, r.call(i, t)) 4987 } 4988 var s = !1; 4989 try { 4990 e.call(t, function (t) { 4991 s || (s = !0, n.call(i, t)) 4992 }, o) 4993 } catch (t) { 4994 o(t) 4995 } 4996 }(t, i, e, n, r), 1 4997 } catch (t) { 4998 return n.call(r, t), 1 4999 } 5000 } 5001 5002 function Ne(t) { 5003 t.h || (t.h = !0, ue(t.gc, t)) 5004 } 5005 5006 function Ae(t) { 5007 var e = null; 5008 return t.b && (e = t.b, t.b = e.next, e.next = null), t.b || (t.f = null), e 5009 } 5010 5011 function ke(t, e, n, r) { 5012 if (n == ve && e.b && !e.c) 5013 for (; t && t.g; t = t.c) t.g = !1; 5014 if (e.a) e.a.c = null, Re(e, n, r); 5015 else try { 5016 e.c ? e.g.call(e.f) : Re(e, n, r) 5017 } catch (t) { 5018 Pe.call(null, t) 5019 } 5020 x(ye, e) 5021 } 5022 5023 function Re(t, e, n) { 5024 e == de ? t.g.call(t.f, n) : t.b && t.b.call(t.f, n) 5025 } 5026 fe.prototype.then = function (t, e, n) { 5027 return Ee(this, v(t) ? t : null, v(e) ? e : null, n) 5028 }
5028, fe.prototype.$goog_Thenable = !0, (t = fe.prototype).oa = function (t, e) { 5029 return (t = me(t, t, e)).c = !0, Te(this, t), this 5030 }, t.o = function (t, e) { 5031 return Ee(this, null, t, e) 5032 }, t.cancel = function (t) { 5033 var e; 5034 this.a == pe && (e = new Oe(t), ue(function () { 5035 ! function t(e, n) { 5036 if (e.a == pe) 5037 if (e.c) { 5038 var r = e.c; 5039 if (r.b) { 5040 for (var i = 0, o = null, s = null, a = r.b; a && (a.c || (i++, !((o = a.a == e ? a : o) && 1 < i))); a = a.next) o || (s = a); 5041 o && (r.a == pe && 1 == i ? t(r, n) : (s ? ((i = s).next == r.f && (r.f = i), i.next = i.next.next) : Ae(r), ke(r, o, ve, n))) 5042 } 5043 e.c = null 5044 } else Se(e, ve, n) 5045 }(this, e) 5046 }, this)) 5047 }, t.$c = function (t) { 5048 this.a = pe, Se(this, de, t) 5049 }, t.ad = function (t) { 5050 this.a = pe, Se(this, ve, t) 5051 }, t.gc = function () { 5052 for (var t; t = Ae(this);) ke(this, t, this.a, this.i); 5053 this.h = !1 5054 }; 5055 var Pe = ae; 5056 5057 function Oe(t) { 5058 R.call(this, t) 5059 } 5060 5061 function De() { 5062 this.xa = this.xa, this.pa = this.pa 5063 } 5064 w(Oe, R); 5065 var xe = 0; 5066 5067 function Le(t) { 5068 t.xa || (t.xa = !0, t.Da(), 0 == xe) || (t = t, Object.prototype.hasOwnProperty.call(t, n) && t[n] || (t[n] = ++r)) 5069 } 5070 De.prototype.xa = !(Oe.prototype.name = "cancel"), De.prototype.Da = function () { 5071 if (this.pa) 5072 for (; this.pa.length;) this.pa.shift()() 5073 }; 5074 var Me = Object.freeze || function (t) { 5075 return t 5076 }, 5077 Fe = !Bt || 9 <= Number($t), 5078 Ue = Bt && !Jt("9"), 5079 je = function () { 5080 if (!l.addEventListener || !Object.defineProperty) return !1; 5081 var t = !1, 5082 e = Object.defineProperty({}, "passive", { 5083 get: function () { 5084 t = !0 5085 } 5086 }); 5087 try { 5088 l.addEventListener("test", s, e), l.removeEventListener("test", s, e) 5089 } catch (t) {} 5090 return t 5091 }(); 5092 5093 function qe(t, e) { 5094 this.type = t, this.b = this.target = e, this.defaultPrevented = !1 5095 } 5096 5097 function Ve(t, e) { 5098 if (qe.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) { 5099 var n = this.type = t.type, 5100 r = t.changedTouches && t.changedTouches.length ? t.changedTouches[0] : null; 5101 if (this.target = t.target || t.srcElement, this.b = e, e = t.relatedTarget) { 5102 if (Ht) { 5103 t: { 5104 try { 5105 jt(e.nodeName); 5106 var i = !0; 5107 break t 5108 } catch (t) {} 5109 i = !1 5110 } 5111 i || (e = null) 5112 } 5113 } else "mouseover" == n ? e = t.fromElement : "mouseout" == n && (e = t.toElement); 5114 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 : Be[t.pointerType] || "", (this.a = t).defaultPrevented && this.preventDefault() 5115 } 5116 } 5117 qe.prototype.preventDefault = function () { 5118 this.defaultPrevented = !0 5119 }, w(Ve, qe); 5120 var Be = Me({ 5121 2: "touch", 5122 3: "pen", 5123 4: "mouse" 5124 }); 5125 Ve.prototype.preventDefault = function () { 5126 Ve.ab.preventDefault.call(this); 5127 var t = this.a; 5128 if (t.preventDefault) t.preventDefault(); 5129 else if (t.returnValue = !1, Ue) try { 5130 (t.ctrlKey || 112 <= t.keyCode && t.keyCode <= 123) && (t.keyCode = -1) 5131 } catch (t) {} 5132 }, Ve.prototype.g = function () { 5133 return this.a 5134 }; 5135 var Ke = "closure_listenable_" + (1e6 * Math.random() | 0), 5136 We = 0; 5137 5138 function He(t, e, n, r, i) { 5139 this.listener = t, this.proxy = null, this.src = e, this.type = n, this.capture = !!r, this.Va = i, this.key = ++We, this.va = this.Pa = !1 5140 } 5141 5142 function Ge(t) { 5143 t.va = !0, t.listener = null, t.proxy = null, t.src = null, t.Va = null 5144 } 5145 5146 function ze(t) { 5147 this.src = t, this.a = {}, this.b = 0 5148 } 5149 5150 function Qe(t, e) { 5151 var n = e.type; 5152 n in t.a && W(t.a[n], e) && (Ge(e), 0 == t.a[n].length && (delete t.a[n], t.b--)) 5153 } 5154 5155 function Ye(t, e, n, r) { 5156 for (var i = 0; i < t.length; ++i) { 5157 var o = t[i]; 5158 if (!o.va && o.listener == e && o.capture == !!n && o.Va == r) return i 5159 } 5160 return -1 5161 } 5162 ze.prototype.add = function (t, e, n, r, i) { 5163 var o = t.toString(); 5164 (t = this.a[o]) || (t = this.a[o] = [], this.b++); 5165 var s = Ye(t, e, r, i); 5166 return -1 < s ? (e = t[s], n || (e.Pa = !1)) : ((e = new He(e, this.src, o, !!r, i)).Pa = n, t.push(e)), e 5167 }; 5168 var Xe = "closure_lm_" + (1e6 * Math.random() | 0), 5169 Je = {}; 5170 5171 function $e(t, e, n, r, i) { 5172 if (r && r.once) tn(t, e, n, r, i); 5173 else if (Array.isArray(e)) 5174 for (var o = 0; o < e.length; o++) $e(t, e[o], n, r, i); 5175 else n = hn(n), t && t[Ke] ? fn(t, e, n, g(r) ? !!r.capture : !!r, i) : Ze(t, e, n, !1, r, i) 5176 } 5177 5178 function Ze(t, e, n, r, i, o) { 5179 if (!e) throw Error("Invalid event type"); 5180 var s, a, u = g(i) ? !!i.capture : !!i, 5181 c = un(t); 5182 if (c || (t[Xe] = c = new ze(t)), !(n = c.add(e, n, r, u, o)).proxy) 5183 if (s = an, r = a = Fe ? function (t) { 5184 return s.call(a.src, a.listener, t) 5185 } : function (t) { 5186 if (!(t = s.call(a.src, a.listener, t))) return t 5187 }, (n.proxy = r).src = t, r.listener = n, t.addEventListener) void 0 === (i = !je ? u : i) && (i = !1), t.addEventListener(e.toString(), r, i); 5188 else if (t.attachEvent) t.attachEvent(rn(e.toString()), r); 5189 else { 5190 if (!t.addListener || !t.removeListener) throw Error("addEventListener and attachEvent are unavailable."); 5191 t.addListener(r) 5192 } 5193 } 5194 5195 function tn(t, e, n, r, i) { 5196 if (Array.isArray(e)) 5197 for (var o = 0; o < e.length;
5197 o++) tn(t, e[o], n, r, i); 5198 else n = hn(n), t && t[Ke] ? pn(t, e, n, g(r) ? !!r.capture : !!r, i) : Ze(t, e, n, !0, r, i) 5199 } 5200 5201 function en(t, e, n, r, i) { 5202 if (Array.isArray(e)) 5203 for (var o = 0; o < e.length; o++) en(t, e[o], n, r, i); 5204 else r = g(r) ? !!r.capture : !!r, n = hn(n), t && t[Ke] ? (t = t.v, (e = String(e).toString()) in t.a && (-1 < (n = Ye(o = t.a[e], n, r, i)) && (Ge(o[n]), Array.prototype.splice.call(o, n, 1), 0 == o.length && (delete t.a[e], t.b--)))) : (t = t && un(t)) && (e = t.a[e.toString()], (n = (t = -1) < (t = e ? Ye(e, n, r, i) : t) ? e[t] : null) && nn(n)) 5205 } 5206 5207 function nn(t) { 5208 var e, n, r; 5209 "number" != typeof t && t && !t.va && ((e = t.src) && e[Ke] ? Qe(e.v, t) : (n = t.type, r = t.proxy, e.removeEventListener ? e.removeEventListener(n, r, t.capture) : e.detachEvent ? e.detachEvent(rn(n), r) : e.addListener && e.removeListener && e.removeListener(r), (n = un(e)) ? (Qe(n, t), 0 == n.b && (n.src = null, e[Xe] = null)) : Ge(t))) 5210 } 5211 5212 function rn(t) { 5213 return t in Je ? Je[t] : Je[t] = "on" + t 5214 } 5215 5216 function on(t, e, n, r) { 5217 var i = !0; 5218 if ((t = un(t)) && (e = t.a[e.toString()])) 5219 for (e = e.concat(), t = 0; t < e.length; t++) { 5220 var o = e[t]; 5221 o && o.capture == n && !o.va && (o = sn(o, r), i = i && !1 !== o) 5222 } 5223 return i 5224 } 5225 5226 function sn(t, e) { 5227 var n = t.listener, 5228 r = t.Va || t.src; 5229 return t.Pa && nn(t), n.call(r, e) 5230 } 5231 5232 function an(t, e) { 5233 if (t.va) return !0; 5234 if (Fe) return sn(t, new Ve(e, this)); 5235 if (!e) t: { 5236 e = ["window", "event"]; 5237 for (var n = l, r = 0; r < e.length; r++) 5238 if (null == (n = n[e[r]])) { 5239 e = null; 5240 break t 5241 } e = n 5242 } 5243 if (e = new Ve(r = e, this), n = !0, !(r.keyCode < 0 || null != r.returnValue)) { 5244 t: { 5245 var i = !1; 5246 if (0 == r.keyCode) try { 5247 r.keyCode = -1; 5248 break t 5249 } catch (t) { 5250 i = !0 5251 }!i && null != r.returnValue || (r.returnValue = !0) 5252 } 5253 for (r = [], i = e.b; i; i = i.parentNode) r.push(i); 5254 for (t = t.type, i = r.length - 1; 0 <= i; i--) { 5255 e.b = r[i]; 5256 var o = on(r[i], t, !0, e), 5257 n = n && o 5258 } 5259 for (i = 0; i < r.length; i++) e.b = r[i], 5260 o = on(r[i], t, !1, e), 5261 n = n && o 5262 } 5263 return n 5264 } 5265 5266 function un(t) { 5267 return (t = t[Xe]) instanceof ze ? t : null 5268 } 5269 var cn = "__closure_events_fn_" + (1e9 * Math.random() >>> 0); 5270 5271 function hn(e) { 5272 return v(e) ? e : (e[cn] || (e[cn] = function (t) { 5273 return e.handleEvent(t) 5274 }), e[cn]) 5275 } 5276 5277 function ln() { 5278 De.call(this), this.v = new ze(this), (this.ac = this).gb = null 5279 } 5280 5281 function fn(t, e, n, r, i) { 5282 t.v.add(String(e), n, !1, r, i) 5283 } 5284 5285 function pn(t, e, n, r, i) { 5286 t.v.add(String(e), n, !0, r, i) 5287 } 5288 5289 function dn(t, e, n, r) { 5290 if (!(e = t.v.a[String(e)])) return !0; 5291 e = e.concat(); 5292 for (var i = !0, o = 0; o < e.length; ++o) { 5293 var s, a, u = e[o]; 5294 u && !u.va && u.capture == n && (s = u.listener, a = u.Va || u.src, u.Pa && Qe(t.v, u), i = !1 !== s.call(a, r) && i) 5295 } 5296 return i && !r.defaultPrevented 5297 } 5298 5299 function vn(t, e, n) { 5300 if (v(t)) n && (t = m(t, n)); 5301 else { 5302 if (!t || "function" != typeof t.handleEvent) throw Error("Invalid listener argument"); 5303 t = m(t.handleEvent, t) 5304 } 5305 return 2147483647 < Number(e) ? -1 : l.setTimeout(t, e || 0
5305) 5306 } 5307 5308 function gn(n) { 5309 var r = null; 5310 return new fe(function (t, e) { 5311 -1 == (r = vn(function () { 5312 t(void 0) 5313 }, n)) && e(Error("Failed to schedule timer.")) 5314 }).o(function (t) { 5315 throw l.clearTimeout(r), t 5316 }) 5317 } 5318 5319 function yn(t) { 5320 if (t.W && "function" == typeof t.W) return t.W(); 5321 if ("string" == typeof t) return t.split(""); 5322 if (d(t)) { 5323 for (var e = [], n = t.length, r = 0; r < n; r++) e.push(t[r]); 5324 return e 5325 } 5326 for (r in e = [], n = 0, t) e[n++] = t[r]; 5327 return e 5328 } 5329 5330 function mn(t) { 5331 if (t.Y && "function" == typeof t.Y) return t.Y(); 5332 if (!t.W || "function" != typeof t.W) { 5333 if (d(t) || "string" == typeof t) { 5334 var e = []; 5335 t = t.length; 5336 for (var n = 0; n < t; n++) e.push(n); 5337 return e 5338 } 5339 for (var r in e = [], n = 0, t) e[n++] = r; 5340 return e 5341 } 5342 } 5343 5344 function bn(t, e) { 5345 this.b = {}, this.a = [], this.c = 0; 5346 var n = arguments.length; 5347 if (1 < n) { 5348 if (n % 2) throw Error("Uneven number of arguments"); 5349 for (var r = 0; r < n; r += 2) this.set(arguments[r], arguments[r + 1]) 5350 } else if (t) 5351 if (t instanceof bn) 5352 for (n = t.Y(), r = 0; r < n.length; r++) this.set(n[r], t.get(n[r])); 5353 else 5354 for (r in t) this.set(r, t[r]) 5355 } 5356 5357 function wn(t) { 5358 if (t.c != t.a.length) { 5359 for (var e = 0, n = 0; e < t.a.length;) { 5360 var r = t.a[e]; 5361 _n(t.b, r) && (t.a[n++] = r), e++ 5362 } 5363 t.a.length = n 5364 } 5365 if (t.c != t.a.length) { 5366 for (var i = {}, n = e = 0; e < t.a.length;) _n(i, r = t.a[e]) || (i[t.a[n++] = r] = 1), e++; 5367 t.a.length = n 5368 } 5369 } 5370 5371 function _n(t, e) { 5372 return Object.prototype.hasOwnProperty.call(t, e) 5373 } 5374 w(ln, De), ln.prototype[Ke] = !0, ln.prototype.addEventListener = function (t, e, n, r) { 5375 $e(this, t, e, n, r) 5376 }, ln.prototype.removeEventListener = function (t, e, n, r) { 5377 en(this, t, e, n, r) 5378 }, ln.prototype.dispatchEvent = function (t) { 5379 var e; 5380 if (n = this.gb) 5381 for (e = []; n; n = n.gb) e.push(n); 5382 var n = this.ac, 5383 r = t.type || t; 5384 if ("string" == typeof t ? t = new qe(t, n) : t instanceof qe ? t.target = t.target || n : (s = t, lt(t = new qe(r, n), s)), s = !0, e) 5385 for (var i = e.length - 1; 0 <= i; i--) var o = t.b = e[i], 5386 s = dn(o, r, !0, t) && s; 5387 if (s = dn(o = t.b = n, r, !0, t) && s, s = dn(o, r, !1, t) && s, e) 5388 for (i = 0; i < e.length; i++) s = dn(o = t.b = e[i], r, !1, t) && s; 5389 return s 5390 }, ln.prototype.Da = function () { 5391 if (ln.ab.Da.call(this), this.v) { 5392 var t, e = this.v; 5393 for (t in e.a) { 5394 for (var n = e.a[t], r = 0; r < n.length; r++) Ge(n[r]); 5395 delete e.a[t], e.b-- 5396 } 5397 } 5398 this.gb = null 5399 }, (t = bn.prototype).W = function () { 5400 wn(this); 5401 for (var t = [], e = 0; e < this.a.length; e++) t.push(this.b[this.a[e]]); 5402 return t 5403 }, t.Y = function () { 5404 return wn(this), this.a.concat() 5405 }, t.clear = function () { 5406 this.b = {}, this.c = this.a.length = 0 5407 }, t.get = function (t, e) { 5408 return _n(this.b, t) ? this.b[t] : e 5409 }, t.set = function (t, e) { 5410 _n(this.b, t) || (this.c++, this.a.push(t)), this.b[t] = e 5411 }, t.forEach = function (t, e) { 5412 for (var n = this.Y(), r = 0; r < n.length; r++) { 5413 var i = n[r], 5414 o = this.get(i); 5415 t.call(e, o, i, this) 5416 } 5417 }; 5418 var In = /^(?:([^:/?#.]+):)?(?:\/\/(?:([^\\/?#]*)@)?([^\\/?#]*?)(?::([0-9]+))?(?=[\\/?#]|$))?([^?#]+)?(?:\?([^#]*))?(?:#([\s\S]*))?$/; 5419 5420 function Tn(t, e) { 5421 var n; 5422 this.a = this.l = this.c = "", this.g = null, this.h = this.f = "", this.i = !1, t instanceof Tn ? (this.i = void 0 !== e ? e : t.i, En(this, t.c), this.l = t.l, this.a = t.a, Sn(this, t.g), this.f = t.f, Cn(this, Hn(t.b)), this.h = t.h) : t && (n = String(t).match(In)) ? (this.i = !!e, En(this, n[1] || "", !0), this.l = Pn(n[2] || ""), this.a = Pn(n[3] || "", !0), Sn(this, n[4]), this.f = Pn(n[5] || "", !0), Cn(this, n[6] || "", !0), this.h = Pn(n[7] || "")) : (this.i = !!e, this.b = new jn(null, this.i)) 5423 } 5424 5425 function En(t, e, n) { 5426 t.c = n ? Pn(e, !0) : e, t.c && (t.c = t.c.replace(/:$/, "")) 5427 } 5428 5429 function Sn(t, e) { 5430 if (e) { 5431 if (e = Number(e), isNaN(e) || e < 0) throw Error("Bad port number " + e); 5432 t.g = e 5433 } else t.g = null 5434 } 5435 5436 function Cn(t, e, n) { 5437 var r, i; 5438 e instanceof jn ? (t.b = e, r = t.b, (i = t.i) && !r.f && (qn(r), r.c = null, r.a.forEach(function (t, e) { 5439 var n = e.toLowerCase(); 5440 e != n && (Bn(this, e), Wn(this, n, t)) 5441 }, r)), r.f = i) : (n || (e = On(e, Fn)), t.b = new jn(e, t.i)) 5442 } 5443 5444 function Nn(t, e, n) { 5445 t.b.set(e, n) 5446 } 5447 5448 function An(t, e) { 5449 return t.b.get(e) 5450 } 5451 5452 function kn(t) { 5453 return t instanceof Tn ? new Tn(t) : new Tn(t, void 0) 5454 } 5455 5456 function Rn(t, e, n, r) { 5457 var i = new Tn(null, void 0); 5458 return t && En(i, t), e && (i.a = e), n && Sn(i, n), r && (i.f = r), i 5459 } 5460 5461 function Pn(t, e) { 5462 return t ? e ? decodeURI(t.replace(/%25/g, "%2525")) : decodeURIComponent(t) : "" 5463 } 5464 5465 function On(t, e, n) { 5466 return "string" == typeof t ? (t = encodeURI(t).replace(e, Dn), t = n ? t.replace(/%25([0-9a-fA-F]{2})/g, "%$1") : t) : null 5467 } 5468 5469 function Dn(t) { 5470 return "%" + ((t = t.charCodeAt(0)) >> 4 & 15).toString(16) + (15 & t).toString(16) 5471 } 5472 Tn.prototype.toString = function () { 5473 var t = [], 5474 e = this.c; 5475 e && t.push(On(e, xn, !0), ":"); 5476 var n = this.a; 5477 return !n && "file" != e || (t.push("//"), (e = this.l) && t.push(On(e, xn, !0), "@"), t.push(encodeURIComponent(String(n)).replace(/%25([0-9a-fA-F]{2})/g, "%$1")), null != (n = this.g) && t.push(":", String(n))), (n = this.f) && (this.a && "/" != n.charAt(0) && t.push("/"), t.push(On(n, "/" == n.charAt(0) ? Mn : Ln, !0))), (n = this.b.toString()) && t.push("?", n), (n = this.h) && t.push("#", On(n, Un)), t.join("") 5478 }, Tn.prototype.resolve = function (t) { 5479 var e = new Tn(this), 5480 n = !!t.c; 5481 n ? En(e, t.c) : n = !!t.l, n ? e.l = t.l : n = !!t.a, n ? e.a = t.a : n = null != t.g; 5482 var r = t.f; 5483 if (n) Sn(e, t.g); 5484 else if (n = !!t.f) 5485 if ("/" != r.charAt(0) && (this.a && !this.f ? r = "/" + r : -1 != (i = e.f.lastIndexOf("/")) && (r = e.f.substr(0, i + 1) + r)), ".." == (i = r) || "." == i) r = ""; 5486 else if (rt(i, "./") || rt(i, "/.")) { 5487 for (var r = 0 == i.lastIndexOf("/", 0), i = i.split("/"), o = [], s = 0; s < i.length;) { 5488 var a = i[s++]; 5489 "." == a ? r && s == i.length && o.push("") : ".." == a ? ((1 < o.length || 1 == o.length && "" != o[0]) && o.pop(), r && s == i.length && o.push("")) : (o.push(a), r = !0) 5490 } 5491 r = o.join("/") 5492 } else r = i; 5493 return n ? e.f = r : n = "" !== t.b.toString(), n ? Cn(e, Hn(t.b)) : n = !!t.h, n && (e.h = t.h), e 5494 }; 5495 var xn = /[#\/\?@]/g, 5496 Ln = /[#\?:]/g, 5497 Mn = /[#\?]/g,
5498 Fn = /[#\?@]/g, 5499 Un = /#/g; 5500 5501 function jn(t, e) { 5502 this.b = this.a = null, this.c = t || null, this.f = !!e 5503 } 5504 5505 function qn(n) { 5506 n.a || (n.a = new bn, n.b = 0, n.c && function (t, e) { 5507 if (t) { 5508 t = t.split("&"); 5509 for (var n = 0; n < t.length; n++) { 5510 var r, i = t[n].indexOf("="), 5511 o = null; 5512 0 <= i ? (r = t[n].substring(0, i), o = t[n].substring(i + 1)) : r = t[n], e(r, o ? decodeURIComponent(o.replace(/\+/g, " ")) : "") 5513 } 5514 } 5515 }(n.c, function (t, e) { 5516 n.add(decodeURIComponent(t.replace(/\+/g, " ")), e) 5517 })) 5518 } 5519 5520 function Vn(t) { 5521 var e = mn(t); 5522 if (void 0 === e) throw Error("Keys are undefined"); 5523 var n = new jn(null, void 0); 5524 t = yn(t); 5525 for (var r = 0; r < e.length; r++) { 5526 var i = e[r], 5527 o = t[r]; 5528 Array.isArray(o) ? Wn(n, i, o) : n.add(i, o) 5529 } 5530 return n 5531 } 5532 5533 function Bn(t, e) { 5534 qn(t), e = Gn(t, e), _n(t.a.b, e) && (t.c = null, t.b -= t.a.get(e).length, _n((t = t.a).b, e) && (delete t.b[e], t.c--, t.a.length > 2 * t.c && wn(t))) 5535 } 5536 5537 function Kn(t, e) { 5538 return qn(t), e = Gn(t, e), _n(t.a.b, e) 5539 } 5540 5541 function Wn(t, e, n) { 5542 Bn(t, e), 0 < n.length && (t.c = null, t.a.set(Gn(t, e), z(n)), t.b += n.length) 5543 } 5544 5545 function Hn(t) { 5546 var e = new jn; 5547 return e.c = t.c, t.a && (e.a = new bn(t.a), e.b = t.b), e 5548 } 5549 5550 function Gn(t, e) { 5551 return e = String(e), e = t.f ? e.toLowerCase() : e 5552 } 5553 5554 function zn(t) { 5555 var e = []; 5556 return function t(e, n, r) { 5557 if (null == n) r.push("null"); 5558 else { 5559 if ("object" == typeof n) { 5560 if (Array.isArray(n)) { 5561 var i = n; 5562 n = i.length, r.push("["); 5563 for (var o = "", s = 0; s < n; s++) r.push(o), t(e, i[s], r), o = ","; 5564 return void r.push("]") 5565 } 5566 if (!(n instanceof String || n instanceof Number || n instanceof Boolean)) { 5567 for (i in r.push("{"), o = "", n) Object.prototype.hasOwnProperty.call(n, i) && (s = n[i], "function" != typeof s && (r.push(o), Jn(i, r), r.push(":"), t(e, s, r), o = ",")); 5568 return void r.push("}") 5569 } 5570 n = n.valueOf() 5571 } 5572 switch (typeof n) { 5573 case "string": 5574 Jn(n, r); 5575 break; 5576 case "number": 5577 r.push(isFinite(n) && !isNaN(n) ? String(n) : "null"); 5578 break; 5579 case "boolean": 5580 r.push(String(n)); 5581 break; 5582 case "function": 5583 r.push("null"); 5584 break; 5585 default: 5586 throw Error("Unknown type: " + typeof n) 5587 } 5588 } 5589 }(new Qn, t, e), e.join("") 5590 } 5591 5592 function Qn() {}(t = jn.prototype).add = function (t, e) { 5593 qn(this), this.c = null, t = Gn(this, t); 5594 var n = this.a.get(t); 5595 return n || this.a.set(t, n = []), n.push(e), this.b += 1, this 5596 }, t.clear = function () { 5597 this.a = this.c = null, this.b = 0 5598 }, t.forEach = function (n, r) { 5599 qn(this), this.a.forEach(function (t, e) { 5600 j(t, function (t) { 5601 n.call(r, t, e, this) 5602 }, this) 5603 }, this) 5604 }, t.Y = function () { 5605 qn(this); 5606 for (var t = this.a.W(), e = this.a.Y(), n = [], r = 0; r < e.length; r++) 5607 for (var i = t[r], o = 0; o < i.length; o++) n.push(e[r]); 5608 return n 5609 }, t.W = function (t) { 5610 qn(this); 5611 var e = []; 5612 if ("string" == typeof t) Kn(this, t) && (e = G(e, this.a.get(Gn(this, t)))
5612); 5613 else { 5614 t = this.a.W(); 5615 for (var n = 0; n < t.length; n++) e = G(e, t[n]) 5616 } 5617 return e 5618 }, t.set = function (t, e) { 5619 return qn(this), this.c = null, Kn(this, t = Gn(this, t)) && (this.b -= this.a.get(t).length), this.a.set(t, [e]), this.b += 1, this 5620 }, t.get = function (t, e) { 5621 return t && 0 < (t = this.W(t)).length ? String(t[0]) : e 5622 }, t.toString = function () { 5623 if (this.c) return this.c; 5624 if (!this.a) return ""; 5625 for (var t = [], e = this.a.Y(), n = 0; n < e.length; n++) 5626 for (var r = e[n], i = encodeURIComponent(String(r)), r = this.W(r), o = 0; o < r.length; o++) { 5627 var s = i; 5628 "" !== r[o] && (s += "=" + encodeURIComponent(String(r[o]))), t.push(s) 5629 } 5630 return this.c = t.join("&") 5631 }; 5632 var Yn = { 5633 '"': '\\"', 5634 "\\": "\\\\", 5635 "/": "\\/", 5636 "\b": "\\b", 5637 "\f": "\\f", 5638 "\n": "\\n", 5639 "\r": "\\r", 5640 "\t": "\\t", 5641 "\v": "\\u000b" 5642 }, 5643 Xn = /\uffff/.test("ï¿¿") ? /[\\"\x00-\x1f\x7f-\uffff]/g : /[\\"\x00-\x1f\x7f-\xff]/g; 5644 5645 function Jn(t, e) { 5646 e.push('"', t.replace(Xn, function (t) { 5647 var e = Yn[t]; 5648 return e || (e = "\\u" + (65536 | t.charCodeAt(0)).toString(16).substr(1), Yn[t] = e), e 5649 }), '"') 5650 } 5651 5652 function $n() { 5653 var t = yr(); 5654 return Bt && $t && 11 == $t || /Edge\/\d+/.test(t) 5655 } 5656 5657 function Zn() { 5658 return l.window && l.window.location.href || self && self.location && self.location.href || "" 5659 } 5660 5661 function tr(t, e) { 5662 e = e || l.window; 5663 var n = "about:blank"; 5664 t && (n = Ct(Rt(t) || Dt)), e.location.href = n 5665 } 5666 5667 function er(t) { 5668 return !!((t = (t || yr()).toLowerCase()).match(/android/) || t.match(/webos/) || t.match(/iphone|ipad|ipod/) || t.match(/blackberry/) || t.match(/windows phone/) || t.match(/iemobile/)) 5669 } 5670 5671 function nr(t) { 5672 t = t || l.window; 5673 try { 5674 t.close() 5675 } catch (t) {} 5676 } 5677 5678 function rr(t, e, n) { 5679 var r = Math.floor(1e9 * Math.random()).toString(); 5680 e = e || 500, n = n || 600; 5681 var i = (window.screen.availHeight - n) / 2, 5682 o = (window.screen.availWidth - e) / 2; 5683 for (s in e = { 5684 width: e, 5685 height: n, 5686 top: 0 < i ? i : 0, 5687 left: 0 < o ? o : 0, 5688 location: !0, 5689 resizable: !0, 5690 statusbar: !0, 5691 toolbar: !1 5692 }, n = yr().toLowerCase(), r && (e.target = r, rt(n, "crios/") && (e.target = "_blank")), dr(yr()) == fr && (t = t || "http://localhost", e.scrollbars = !0), n = t || "", (t = e) || (t = {}), r = window, e = n instanceof St ? n : Rt(void 0 !== n.href ? n.href : String(n)) || Dt, n = t.target || n.target, i = [], t) switch (s) { 5693 case "width": 5694 case "height": 5695 case "top": 5696 case "left": 5697 i.push(s + "=" + t[s]); 5698 break; 5699 case "target": 5700 case "noopener": 5701 case "noreferrer": 5702 break; 5703 default: 5704 i.push(s + "=" + (t[s] ? 1 : 0)) 5705 } 5706 var s = i.join(","); 5707 if ((st("iPhone") && !st("iPod") && !st("iPad") || st("iPad") || st("iPod")) && r.navigator && r.navigator.standalone && n && "_self" != n ? (ft(s = se(document, "A"), "HTMLAnchorElement"), e = e instanceof St ? e : Pt(e), s.href = Ct(e), s.setAttribute("target", n), t.noreferrer && s.setAttribute("rel", "noreferrer"), (t = document.createEvent("MouseEvent")).initMouseEvent("click", !0, !0, r, 1), s.dispatchEvent(t), s = {}) : t.noreferrer ? (s = Mt("", r, n, s), t = Ct(e), s && (Wt && rt(t, ";") && (t = "'" + t.replace(/'/g, "%27") + "'"), s.opener = null, t = '<meta name="referrer" content="no-referrer"><meta http-equiv="refresh" content="0; url=' + Ut(t) + '">', t = new xt(t = (r = mt()) ? r.createHTML(t) : t, 0, Lt), r = s.document) && (r.write((o = t) instanceof xt && o.constructor === xt ? o.a : (O("expected object of type SafeHtml, got '" + o + "' of type " + p(o)), "type_error:SafeHtml")), r.close())) : (s = Mt(e, r, n, s)) && t.noopener && (s.opener = null), s) try { 5708 s.focus() 5709 } catch (t) {} 5710 return s 5711 } 5712 var ir = /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/, 5713 or = /^[^@]+@[^@]+$/; 5714 5715 function sr() { 5716 var e = null; 5717 return new fe(function (t) { 5718 "complete" == l.document.readyState ? t() : (e = function () { 5719 t() 5720 }, tn(window, "load", e)) 5721 }).o(function (t) { 5722 throw en(window, "load", e), t 5723 }) 5724 } 5725 5726 function ar(t) { 5727 return t = t || yr(), !("file:" !== Ir() && "ionic:" !== Ir() || !t.toLowerCase().match(/iphone|ipad|ipod|android/)) 5728 } 5729 5730 function ur() { 5731 var t = l.window; 5732 try { 5733 return t && t != t.top 5734 } catch (t) { 5735 return 5736 } 5737 } 5738 5739 function cr() { 5740 return void 0 !== l.WorkerGlobalScope && "function" == typeof l.importScripts 5741 } 5742 5743 function hr() { 5744 return Xl.INTERNAL.hasOwnProperty("reactNative") ? "ReactNative" : Xl.INTERNAL.hasOwnProperty("node") ? "Node" : cr() ? "Worker" : "Browser" 5745 } 5746 5747 function lr() { 5748 var t = hr(); 5749 return "ReactNative" === t || "Node" === t 5750 } 5751 var fr = "Firefox", 5752 pr = "Chrome"; 5753 5754 function dr(t) { 5755 var e = t.toLowerCase(); 5756 return rt(e, "opera/") || rt(e, "opr/") || rt(e, "opios/") ? "Opera" : rt(e, "iemobile") ? "IEMobile" : rt(e, "msie") || rt(e, "trident/") ? "IE" : rt(e, "edge/") ? "Edge" : rt(e, "firefox/") ? fr : rt(e, "silk/") ? "Silk" : rt(e, "blackberry") ? "Blackberry" : rt(e, "webos") ? "Webos" : !rt(e, "safari/") || rt(e, "chrome/") || rt(e, "crios/") || rt(e, "android") ? !rt(e, "chrome/") && !rt(e, "crios/") || rt(e, "edge/") ? rt(e, "android") ? "Android" : (t = t.match(/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/)) && 2 == t.length ? t[1] : "Other" : pr : "Safari" 5757 } 5758 var vr = { 5759 md: "FirebaseCore-web", 5760 od: "FirebaseUI-web" 5761 }; 5762 5763 function gr(t, e) { 5764 e = e || []; 5765 var n, r = [], 5766 i = {}; 5767 for (n in vr) i[vr[n]] = !0; 5768 for (n = 0; n < e.length; n++) void 0 !== i[e[n]] && (delete i[e[n]], r.push(e[n])); 5769 return r.sort(), (e = r).length || (e = ["FirebaseCore-web"]), "Browser" === (r = hr()) ? r = dr(i = yr()) : "Worker" === r && (r = dr(i = yr()) + "-" + r), r + "/JsCore/" + t + "/"
5769+ e.join(",") 5770 } 5771 5772 function yr() { 5773 return l.navigator && l.navigator.userAgent || "" 5774 } 5775 5776 function mr(t, e) { 5777 t = t.split("."), e = e || l; 5778 for (var n = 0; n < t.length && "object" == typeof e && null != e; n++) e = e[t[n]]; 5779 return e = n != t.length ? void 0 : e 5780 } 5781 5782 function br() { 5783 try { 5784 var t = l.localStorage, 5785 e = Nr(); 5786 if (t) return t.setItem(e, "1"), t.removeItem(e), !$n() || !!l.indexedDB 5787 } catch (t) { 5788 return cr() && !!l.indexedDB 5789 } 5790 return !1 5791 } 5792 5793 function wr() { 5794 return (_r() || "chrome-extension:" === Ir() || ar()) && !lr() && br() && !cr() 5795 } 5796 5797 function _r() { 5798 return "http:" === Ir() || "https:" === Ir() 5799 } 5800 5801 function Ir() { 5802 return l.location && l.location.protocol || null 5803 } 5804 5805 function Tr(t) { 5806 return !er(t = t || yr()) && dr(t) != fr 5807 } 5808 5809 function Er(t) { 5810 return void 0 === t ? null : zn(t) 5811 } 5812 5813 function Sr(t) { 5814 var e, n = {}; 5815 for (e in t) t.hasOwnProperty(e) && null !== t[e] && void 0 !== t[e] && (n[e] = t[e]); 5816 return n 5817 } 5818 5819 function Cr(t) { 5820 if (null !== t) return JSON.parse(t) 5821 } 5822 5823 function Nr(t) { 5824 return t || Math.floor(1e9 * Math.random()).toString() 5825 } 5826 5827 function Ar(t) { 5828 return "Safari" != dr(t = t || yr()) && !t.toLowerCase().match(/iphone|ipad|ipod/) 5829 } 5830 5831 function kr() { 5832 var t = l.___jsl; 5833 if (t && t.H) 5834 for (var e in t.H) 5835 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) 5836 for (var n = 0; n < t.CP.length; n++) t.CP[n] = null 5837 } 5838 5839 function Rr(t, e) { 5840 if (e < t) throw Error("Short delay should be less than long delay!"); 5841 this.a = t, this.c = e, t = yr(), e = hr(), this.b = er(t) || "ReactNative" === e 5842 } 5843 5844 function Pr() { 5845 var t = l.document; 5846 return !t || void 0 === t.visibilityState || "visible" == t.visibilityState 5847 } 5848 5849 function Or() { 5850 var e = l.document, 5851 n = null; 5852 return Pr() || !e ? be() : new fe(function (t) { 5853 n = function () { 5854 Pr() && (e.removeEventListener("visibilitychange", n, !1), t()) 5855 }, e.addEventListener("visibilitychange", n, !1) 5856 }).o(function (t) { 5857 throw e.removeEventListener("visibilitychange", n, !1), t 5858 }) 5859 } 5860 5861 function Dr(t) { 5862 try { 5863 var e = new Date(parseInt(t, 10)); 5864 if (!isNaN(e.getTime()) && !/[^0-9]/.test(t)) return e.toUTCString() 5865 } catch (t) {} 5866 return null 5867 } 5868 5869 function xr() { 5870 return mr("fireauth.oauthhelper", l) || mr("fireauth.iframe", l) 5871 } 5872 Rr.prototype.get = function () { 5873 var t = l.navigator; 5874 return !t || "boolean" != typeof t.onLine || !_r() && "chrome-extension:" !== Ir() && void 0 === t.connection || t.onLine ? this.b ? this.c : this.a : Math.min(5e3, this.a) 5875 }; 5876 var Lr, Mr = {}; 5877 5878 function Fr(t) { 5879 Mr[t] || (Mr[t] = !0, "undefined" != typeof console && "function" == typeof console.warn && console.warn(t)) 5880 } 5881 try { 5882 var Ur = {}; 5883 Object.defineProperty(Ur, "abcd", { 5884 configurable: !0, 5885 enumerable: !0, 5886 value: 1 5887 }), Object.defineProperty(Ur, "abcd", { 5888 configurable: !0, 5889 enumerable: !0, 5890 value: 2 5891 }), Lr = 2 == Ur.abcd 5892 } catch (t) { 5893 Lr = !1 5894 } 5895 5896 function jr(t, e, n) { 5897 Lr ? Object.defineProperty(t, e, { 5898 configurable: !0, 5899 enumerable: !0, 5900 value: n 5901 }) : t[e] = n 5902 } 5903 5904 function qr(t, e) { 5905 if (e) 5906 for (var n in e) e.hasOwnProperty(n) && jr(t, n, e[n]) 5907 } 5908 5909 function Vr(t) { 5910 var e = {}; 5911 return qr(e, t), e 5912 } 5913 5914 function Br(t) { 5915 var e = t; 5916 if ("object" == typeof t && null != t) 5917 for (var n in e = "length" in t ? [] : {}, t) jr(e, n, Br(t[n])); 5918 return e 5919 } 5920 5921 function Kr(t) { 5922 var e = t && (t[Qr] ? "phone" : null); 5923 if (!(e && t && t[zr])) throw new I("internal-error", "Internal assert: invalid MultiFactorInfo object"); 5924 jr(this, "uid", t[zr]), jr(this, "displayName", t[Hr] || null); 5925 var n = null; 5926 jr(this, "enrollmentTime", n = t[Gr] ? new Date(t[Gr]).toUTCString() : n), jr(this, "factorId", e) 5927 } 5928 5929 function Wr(t) { 5930 try { 5931 var e = new Yr(t) 5932 } catch (t) { 5933 e = null 5934 } 5935 return e 5936 } 5937 Kr.prototype.w = function () { 5938 return { 5939 uid: this.uid, 5940 displayName: this.displayName, 5941 factorId: this.factorId, 5942 enrollmentTime: this.enrollmentTime 5943 } 5944 }; 5945 var Hr = "displayName", 5946 Gr = "enrolledAt", 5947 zr = "mfaEnrollmentId", 5948 Qr = "phoneInfo"; 5949 5950 function Yr(t) { 5951 Kr.call(this, t), jr(this, "phoneNumber", t[Qr]) 5952 } 5953 5954 function Xr(t) { 5955 var e = {}, 5956 n = t[ti], 5957 r = t[ni], 5958 i = t[ri]; 5959 if (t = Wr(t[ei]), !i || i != $r && i != Zr && !n || i == Zr && !r || i == Jr && !t) throw Error("Invalid checkActionCode response!"); 5960 i == Zr ? (e[oi] = n || null, e[ai] = n || null, e[ii] = r) : (e[oi] = r || null, e[ai] = r || null, e[ii] = n || null), e[si] = t || null, jr(this, ci, i), jr(this, ui, Br(e)) 5961 } 5962 w(Yr, Kr), Yr.prototype.w = function () { 5963 var t = Yr.ab.w.call(this); 5964 return t.phoneNumber = this.phoneNumber, t 5965 }; 5966 var Jr = "REVERT_SECOND_FACTOR_ADDITION", 5967 $r = "EMAIL_SIGNIN", 5968 Zr = "VERIFY_AND_CHANGE_EMAIL", 5969 ti = "email", 5970 ei = "mfaInfo", 5971 ni = "newEmail", 5972 ri = "requestType", 5973 ii = "email",
5974 oi = "fromEmail", 5975 si = "multiFactorInfo", 5976 ai = "previousEmail", 5977 ui = "data", 5978 ci = "operation"; 5979 5980 function hi(t) { 5981 var e = An(t = kn(t), li) || null, 5982 n = An(t, fi) || null, 5983 r = (r = An(t, vi) || null) && yi[r] || null; 5984 if (!e || !n || !r) throw new I("argument-error", li + ", " + fi + "and " + vi + " are required in a valid action code URL."); 5985 qr(this, { 5986 apiKey: e, 5987 operation: r, 5988 code: n, 5989 continueUrl: An(t, pi) || null, 5990 languageCode: An(t, di) || null, 5991 tenantId: An(t, gi) || null 5992 }) 5993 } 5994 var li = "apiKey", 5995 fi = "oobCode", 5996 pi = "continueUrl", 5997 di = "languageCode", 5998 vi = "mode", 5999 gi = "tenantId", 6000 yi = { 6001 recoverEmail: "RECOVER_EMAIL", 6002 resetPassword: "PASSWORD_RESET", 6003 revertSecondFactorAddition: Jr, 6004 signIn: $r, 6005 verifyAndChangeEmail: Zr, 6006 verifyEmail: "VERIFY_EMAIL" 6007 }; 6008 6009 function mi(t) { 6010 try { 6011 return new hi(t) 6012 } catch (t) { 6013 return null 6014 } 6015 } 6016 6017 function bi(t) { 6018 if (void 0 === (e = t[Ei])) throw new I("missing-continue-uri"); 6019 if ("string" != typeof e || "string" == typeof e && !e.length) throw new I("invalid-continue-uri"); 6020 if (this.h = e, this.b = this.a = null, this.g = !1, (r = t[wi]) && "object" == typeof r) { 6021 var e = r[Ni], 6022 n = r[Si], 6023 r = r[Ci]; 6024 if ("string" == typeof e && e.length) { 6025 if (this.a = e, void 0 !== n && "boolean" != typeof n) throw new I("argument-error", Si + " property must be a boolean when specified."); 6026 if (this.g = !!n, void 0 !== r && ("string" != typeof r || "string" == typeof r && !r.length)) throw new I("argument-error", Ci + " property must be a non empty string when specified."); 6027 this.b = r || null 6028 } else { 6029 if (void 0 !== e) throw new I("argument-error", Ni + " property must be a non empty string when specified."); 6030 if (void 0 !== n || void 0 !== r) throw new I("missing-android-pkg-name") 6031 } 6032 } else if (void 0 !== r) throw new I("argument-error", wi + " property must be a non null object when specified."); 6033 if (this.f = null, (e = t[Ti]) && "object" == typeof e) { 6034 if ("string" == typeof (e = e[Ai]) && e.length) this.f = e; 6035 else if (void 0 !== e) throw new I("argument-error", Ai + " property must be a non empty string when specified.") 6036 } else if (void 0 !== e) throw new I("argument-error", Ti + " property must be a non null object when specified."); 6037 if (void 0 !== (e = t[Ii]) && "boolean" != typeof e) throw new I("argument-error", Ii + " property must be a boolean when specified."); 6038 if (this.c = !!e, void 0 !== (t = t[_i]) && ("string" != typeof t || "string" == typeof t && !t.length)) throw new I("argument-error", _i + " property must be a non empty string when specified."); 6039 this.i = t || null 6040 } 6041 var wi = "android", 6042 _i = "dynamicLinkDomain", 6043 Ii = "handleCodeInApp", 6044 Ti = "iOS", 6045 Ei = "url", 6046 Si = "installApp", 6047 Ci = "minimumVersion", 6048 Ni = "packageName", 6049 Ai = "bundleId"; 6050 6051 function ki(t) { 6052 var e, n = {}; 6053 for (e in n.continueUrl = t.h, n.canHandleCodeInApp = t.c, (n.androidPackageName = t.a) && (n.androidMinimumVersion = t.b, n.androidInstallApp = t.g), n.iOSBundleId = t.f, n.dynamicLinkDomain = t.i, n) null === n[e] && delete n[e]; 6054 return n 6055 } 6056 var Ri = null; 6057 6058 function Pi(t) { 6059 var e = []; 6060 return function (r, t) { 6061 function e(t) { 6062 for (; i < r.length;) { 6063 var e = r.charAt(i++), 6064 n = Ri[e]; 6065 if (null != n) return n; 6066 if (!/^[\s\xa0]*$/.test(e)) throw Error("Unknown base64 encoding at char: " + e) 6067 } 6068 return t 6069 }! function () { 6070 if (!Ri) { 6071 Ri = {}; 6072 for (var t = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""), e = ["+/=", "+/", "-_=", "-_.", "-_"], n = 0; n < 5; n++) 6073 for (var r = t.concat(e[n].split("")), i = 0; i < r.length; i++) { 6074 var o = r[i]; 6075 void 0 === Ri[o] && (Ri[o] = i) 6076 } 6077 } 6078 }(); 6079 for (var i = 0;;) { 6080 var n = e(-1), 6081 o = e(0), 6082 s = e(64), 6083 a = e(64); 6084 if (64 === a && -1 === n) break; 6085 t(n << 2 | o >> 4), 64 != s && (t(o << 4 & 240 | s >> 2), 64 != a && t(s << 6 & 192 | a)) 6086 } 6087 }(t, function (t) { 6088 e.push(t) 6089 }), e 6090 } 6091 6092 function Oi(t) { 6093 var e = xi(t); 6094 if (!(e && e.sub && e.iss && e.aud && e.exp)) throw Error("Invalid JWT"); 6095 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 6096 } 6097 6098 function Di(t) { 6099 try { 6100 return new Oi(t) 6101 } catch (t) { 6102 return null 6103 } 6104 } 6105 6106 function xi(t) { 6107 if (!t) return null; 6108 if (3 != (t = t.split(".")).length) return null; 6109 for (var e = (4 - (t = t[1]).length % 4) % 4, n = 0; n < e; n++) t += "."; 6110 try { 6111 var r = Pi(t); 6112 for (t = [], n = e = 0; e < r.length;) { 6113 var i, o, s, a = r[e++]; 6114 a < 128 ? t[n++] = String.fromCharCode(a) : 191 < a && a < 224 ? (i = r[e++], t[n++] = String.fromCharCode((31 & a) << 6 | 63 & i)) : 239 < a && a < 365 ? (s = ((7 & a) << 18 | (63 & (i = r[e++])) << 12 | (63 & (o = r[e++])) << 6 | 63 & r[e++]) - 65536, t[n++] = String.fromCharCode(55296 + (s >>
6114 10)), t[n++] = String.fromCharCode(56320 + (1023 & s))) : (i = r[e++], o = r[e++], t[n++] = String.fromCharCode((15 & a) << 12 | (63 & i) << 6 | 63 & o)) 6115 } 6116 return JSON.parse(t.join("")) 6117 } catch (t) {} 6118 return null 6119 } 6120 Oi.prototype.T = function () { 6121 return this.f 6122 }, Oi.prototype.l = function () { 6123 return this.c 6124 }, Oi.prototype.toString = function () { 6125 return this.h 6126 }; 6127 var Li = "oauth_consumer_key oauth_nonce oauth_signature oauth_signature_method oauth_timestamp oauth_token oauth_version".split(" "), 6128 Mi = ["client_id", "response_type", "scope", "redirect_uri", "state"], 6129 Fi = { 6130 nd: { 6131 Ja: "locale", 6132 ua: 700, 6133 ta: 600, 6134 fa: "facebook.com", 6135 Xa: Mi 6136 }, 6137 pd: { 6138 Ja: null, 6139 ua: 500, 6140 ta: 750, 6141 fa: "github.com", 6142 Xa: Mi 6143 }, 6144 qd: { 6145 Ja: "hl", 6146 ua: 515, 6147 ta: 680, 6148 fa: "google.com", 6149 Xa: Mi 6150 }, 6151 wd: { 6152 Ja: "lang", 6153 ua: 485, 6154 ta: 705, 6155 fa: "twitter.com", 6156 Xa: Li 6157 }, 6158 kd: { 6159 Ja: "locale", 6160 ua: 640, 6161 ta: 600, 6162 fa: "apple.com", 6163 Xa: [] 6164 } 6165 }; 6166 6167 function Ui(t) { 6168 for (var e in Fi) 6169 if (Fi[e].fa == t) return Fi[e]; 6170 return null 6171 } 6172 6173 function ji(t) { 6174 var e = {}; 6175 e["facebook.com"] = Wi, e["google.com"] = Gi, e["github.com"] = Hi, e["twitter.com"] = zi; 6176 var n = t && t[Vi]; 6177 try { 6178 if (n) return new(e[n] || Ki)(t); 6179 if (void 0 !== t[qi]) return new Bi(t) 6180 } catch (t) {} 6181 return null 6182 } 6183 var qi = "idToken", 6184 Vi = "providerId"; 6185 6186 function Bi(t) { 6187 var e, n = t[Vi]; 6188 if (n || !t[qi] || (e = Di(t[qi])) && e.b && (n = e.b), !n) throw Error("Invalid additional user info!"); 6189 "anonymous" != n && "custom" != n || (n = null), e = !1, void 0 !== t.isNewUser ? e = !!t.isNewUser : "identitytoolkit#SignupNewUserResponse" === t.kind && (e = !0), jr(this, "providerId", n), jr(this, "isNewUser", e) 6190 } 6191 6192 function Ki(t) { 6193 Bi.call(this, t), jr(this, "profile", Br((t = Cr(t.rawUserInfo || "{}")) || {})) 6194 } 6195 6196 function Wi(t) { 6197 if (Ki.call(this, t), "facebook.com" != this.providerId) throw Error("Invalid provider ID!") 6198 } 6199 6200 function Hi(t) { 6201 if (Ki.call(this, t), "github.com" != this.providerId) throw Error("Invalid provider ID!"); 6202 jr(this, "username", this.profile && this.profile.login || null) 6203 } 6204 6205 function Gi(t) { 6206 if (Ki.call(this, t), "google.com" != this.providerId) throw Error("Invalid provider ID!") 6207 } 6208 6209 function zi(t) { 6210 if (Ki.call(this, t), "twitter.com" != this.providerId) throw Error("Invalid provider ID!"); 6211 jr(this, "username", t.screenName || null) 6212 } 6213 6214 function Qi(t) { 6215 var e = An(r = kn(t), "link"), 6216 n = An(kn(e), "link"), 6217 r = An(r, "deep_link_id"); 6218 return An(kn(r), "link") || r || n || e || t 6219 } 6220 6221 function Yi(t, e) { 6222 if (!t && !e) throw new I("internal-error", "Internal assert: no raw session string available"); 6223 if (t && e) throw new I("internal-error", "Internal assert: unable to determine the session type"); 6224 this.a = t || null, this.b = e || null, this.type = this.a ? Xi : Ji 6225 } 6226 w(Ki, Bi), w(Wi, Ki), w(Hi, Ki), w(Gi, Ki), w(zi, Ki); 6227 var Xi = "enroll", 6228 Ji = "signin"; 6229 6230 function $i() {} 6231 6232 function Zi(t, n) { 6233 return t.then(function (t) { 6234 if (t[Bs]) { 6235 var e = Di(t[Bs]); 6236 if (!e || n != e.i) throw new I("user-mismatch"); 6237 return t 6238 } 6239 throw new I("user-mismatch") 6240 }).o(function (t) { 6241 throw t && t.code && t.code == S + "user-not-found" ? new I("user-mismatch") : t 6242 }) 6243 } 6244 6245 function to(t, e) { 6246 if (!e) throw new I("internal-error", "failed to construct a credential"); 6247 this.a = e, jr(this, "providerId", t), jr(this, "signInMethod", t) 6248 } 6249 6250 function eo(t) { 6251 return { 6252 pendingToken: t.a, 6253 requestUri: "http://localhost" 6254 } 6255 } 6256 6257 function no(t) { 6258 if (t && t.providerId && t.signInMethod && 0 == t.providerId.indexOf("saml.") && t.pendingToken) try { 6259 return new to(t.providerId, t.pendingToken) 6260 } catch (t) {} 6261 return null 6262 } 6263 6264 function ro(t, e, n) { 6265 if (this.a = null, e.idToken || e.accessToken) e.idToken && jr(this, "idToken", e.idToken), e.accessToken && jr(this, "accessToken", e.accessToken), e.nonce && !e.pendingToken && jr(this, "nonce", e.nonce), e.pendingToken && (this.a = e.pendingToken); 6266 else { 6267 if (!e.oauthToken || !e.oauthTokenSecret) throw new I("internal-error", "failed to construct a credential"); 6268 jr(this, "accessToken", e.oauthToken), jr(this, "secret", e.oauthTokenSecret) 6269 } 6270 jr(this, "providerId", t), jr(this, "signInMethod", n) 6271 } 6272 6273 function io(t) { 6274 var e = {}; 6275 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 = { 6276 postBody: Vn(e).toString(), 6277 requestUri: "http://localhost" 6278 }, t.a && (delete e.postBody, e.pendingToken = t.a), e 6279 } 6280 6281 function oo(t) { 6282 if (t && t.providerId && t.signInMethod) { 6283 var e = { 6284 idToken: t.oauthIdToken, 6285 accessToken: t.oauthTokenSecret ? null : t.oauthAccessToken, 6286 oauthTokenSecret: t.oauthTokenSecret, 6287 oauthToken: t.oauthTokenSecret && t.oauthAccessToken, 6288 nonce: t.nonce, 6289 pendingToken: t.pendingToken 6290 }; 6291 try { 6292 return new ro(t.providerId, e, t.signInMethod) 6293 } catch (t) {} 6294 } 6295 return null 6296 } 6297 6298 function so(t, e) { 6299 this.Qc = e || [], qr(this, { 6300 providerId: t, 6301 isOAuthProvider: !0 6302 }), this.Ib = {}, this.pb = (Ui(t) || {}).Ja || null, this.ob = null 6303 } 6304 6305 function ao(t) { 6306 if ("string" != typeof t || 0 != t.indexOf("saml.")) throw new I("argument-error", 'SAML provider IDs must be prefixed with "saml."'); 6307 so.call(this, t, []) 6308 } 6309 6310 function uo(t) { 6311 so.call(this, t, Mi), this.a = [] 6312 } 6313 6314 function co() { 6315 uo.call(this, "facebook.com") 6316 } 6317 6318 function ho(t) { 6319 if (!t) throw new I("argument-error", "credential failed: expected 1 argument (the OAuth access token)."); 6320 var e = t; 6321 return g(t) && (e = t.accessToken), (new co).credential({ 6322 accessToken: e 6323 }) 6324 } 6325 6326 function lo() { 6327 uo.call(this, "github.com") 6328 } 6329 6330 function fo(t) { 6331 if (!t) throw new I("argument-error", "credential failed: expected 1 argument (the OAuth access token)."); 6332 var e = t; 6333 return g(t) && (e = t.accessToken), (new lo).credential({ 6334 accessToken: e 6335 }) 6336 } 6337 6338 function po() { 6339 uo.call(this, "google.com"), this.Ca("profile") 6340 } 6341 6342 function vo(t, e) { 6343 var n = t; 6344 return g(t) && (n = t.idToken, e = t.accessToken), (new po).credential({ 6345 idToken: n, 6346 accessToken: e 6347 }) 6348 } 6349 6350 function go() { 6351 so.call(this, "twitter.com", Li) 6352 } 6353 6354 function yo(t, e) { 6355 var n = t; 6356 if (!(n = !g(n) ? { 6357 oauthToken: t, 6358 oauthTokenSecret: e 6359 } : n).oauthToken || !n.oauthTokenSecret) throw new I("argument-error", "credential failed: expected 2 arguments (the OAuth access token and secret)."); 6360 return new ro("twitter.com", n, "twitter.com") 6361 } 6362 6363 function mo(t, e, n) { 6364 this.a = t, this.f = e, jr(this, "providerId", "password"), jr(this, "signInMethod", n === wo.EMAIL_LINK_SIGN_IN_METHOD ? wo.EMAIL_LINK_SIGN_IN_METHOD : wo.EMAIL_PASSWORD_SIGN_IN_METHOD) 6365 } 6366 6367 function bo(t) { 6368 return t && t.email && t.password ? new mo(t.email, t.password, t.signInMethod) : null 6369 } 6370 6371 function wo() { 6372 qr(this, { 6373 providerId: "password", 6374 isOAuthProvider: !1 6375 }) 6376 } 6377 6378 function _o(t, e) { 6379 if (!(e = Io(e))) throw new I("argument-error", "Invalid email link!"); 6380 return new mo(t, e.code, wo.EMAIL_LINK_SIGN_IN_METHOD) 6381 } 6382 6383 function Io(t) { 6384 return (t = mi(t = Qi(t))) && t.operation === $r ? t : null 6385 } 6386 6387 function To(t) { 6388 if (!(t.eb && t.cb || t.La && t.ea)) throw new I("internal-error"); 6389 this.a = t, jr(this, "providerId", "phone"), this.fa = "phone", jr(this, "signInMethod", "phone") 6390 } 6391 6392 function Eo(e) { 6393 if (e && "phone" === e.providerId && (e.verificationId && e.verificationCode || e.temporaryProof && e.phoneNumber)) { 6394 var n = {}; 6395 return j(["verificationId", "verificationCode", "temporaryProof", "phoneNumber"], function (t) { 6396 e[t] && (n[t] = e[t]) 6397 }), new To(n) 6398 } 6399 return null 6400 } 6401 6402 function So(t) { 6403 return t.a.La && t.a.ea ? { 6404 temporaryProof: t.a.La, 6405 phoneNumber: t.a.ea 6406 } : { 6407 sessionInfo: t.a.eb, 6408 code: t.a.cb 6409 } 6410 } 6411 6412 function Co(t) { 6413 try { 6414 this.a = t || Xl.auth() 6415 } catch (t) { 6416 throw new I("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().") 6417 } 6418 qr(this, { 6419 providerId: "phone", 6420 isOAuthProvider: !1 6421 }) 6422 } 6423 6424 function No(t, e) { 6425 if (!t) throw new I("missing-verification-id"); 6426 if (!e) throw new I("missing-verification-code"); 6427 return new To({ 6428 eb: t, 6429 cb: e 6430 }) 6431 } 6432 6433 function Ao(t) { 6434 if (t.temporaryProof && t.phoneNumber) return new To({ 6435 La: t.temporaryProof, 6436 ea: t.phoneNumber 6437 }); 6438 var e = t && t.providerId; 6439 if (!e || "password" === e) return null; 6440 var n = t && t.oauthAccessToken, 6441 r = t && t.oauthTokenSecret, 6442 i = t && t.nonce, 6443 o = t && t.oauthIdToken, 6444 s = t && t.pendingToken; 6445 try { 6446 switch (e) { 6447 case "google.com": 6448 return vo(o, n); 6449 case "facebook.com": 6450 return ho(n); 6451 case "github.com": 6452 return fo(n); 6453 case "twitter.com": 6454 return yo(n, r); 6455 default: 6456 return n || r || o || s ? s ? 0 == e.indexOf("saml.") ? new to(e, s) : new ro(e, { 6457 pendingToken: s, 6458 idToken: t.oauthIdToken, 6459 accessToken: t.oauthAccessToken 6460 }, e) : new uo(e).credential({ 6461 idToken: o, 6462 accessToken: n, 6463 rawNonce: i 6464 }) : null 6465 } 6466 } catch (t) { 6467 return null 6468 } 6469 } 6470 6471 function ko(t) { 6472 if (!t.isOAuthProvider) throw new I("invalid-oauth-provider") 6473 } 6474 6475 function Ro(t, e, n, r, i, o, s) { 6476 if (this.c = t, this.b = e || null, this.g = n || null, this.f = r || null, this.i = o || null, this.h = s || null, this.a = i || null, !this.g && !this.a) throw new I("invalid-auth-event"); 6477 if (this.g && this.a) throw new I("invalid-auth-event"); 6478 if (this.g && !this.f) throw new I("invalid-auth-event") 6479 } 6480 6481 function Po(t) { 6482 return (t = t || {}).type ? new Ro(t.type, t.eventId, t.urlResponse, t.sessionId, t.error && T(t.error), t.postBody, t.tenantId) : null 6483 } 6484 6485 function Oo() { 6486 this.b = null, this.a = [] 6487 } 6488 Yi.prototype.Ha = function () { 6489 return this.a ? be(this.a) : be(this.b) 6490 }, Yi.prototype.w = function () { 6491 return this.type == Xi ? { 6492 multiFactorSession: { 6493 idToken: this.a 6494 } 6495 } : { 6496 multiFactorSession: { 6497 pendingCredential: this.b 6498 } 6499 } 6500 }, $i.prototype.ka = function () {}, $i.prototype.b = function () {}, $i.prototype.c = function () {}, $i.prototype.w = function () {}, to.prototype.ka = function (t) { 6501 return ha(t, eo(this)) 6502 }, to.prototype.b = function (t, e) { 6503 var n = eo(this); 6504 return n.idToken = e, la(t, n) 6505 }, to.prototype.c = function (t, e) { 6506 return Zi(fa(t, eo(this)), e) 6507 }, to.prototype.w = function () { 6508 return { 6509 providerId: this.providerId, 6510 signInMethod: this.signInMethod, 6511 pendingToken: this.a 6512 } 6513 }, ro.prototype.ka = function (t) { 6514 return ha(t, io(this)) 6515 }, ro.prototype.b = function (t, e) { 6516 var n = io(this); 6517 return n.idToken = e, la(t, n) 6518 }, ro.prototype.c = function (t, e) { 6519 return Zi(fa(t, io(this)), e) 6520 }, ro.prototype.w = function () { 6521 var t = { 6522 providerId: this.providerId, 6523 signInMethod: this.signInMethod 6524 }; 6525 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.pen
6525dingToken = this.a), t 6526 }, so.prototype.Ka = function (t) { 6527 return this.Ib = ct(t), this 6528 }, w(ao, so), w(uo, so), uo.prototype.Ca = function (t) { 6529 return K(this.a, t) || this.a.push(t), this 6530 }, uo.prototype.Qb = function () { 6531 return z(this.a) 6532 }, uo.prototype.credential = function (t, e) { 6533 e = g(t) ? { 6534 idToken: t.idToken || null, 6535 accessToken: t.accessToken || null, 6536 nonce: t.rawNonce || null 6537 } : { 6538 idToken: t || null, 6539 accessToken: e || null 6540 }; 6541 if (!e.idToken && !e.accessToken) throw new I("argument-error", "credential failed: must provide the ID token and/or the access token."); 6542 return new ro(this.providerId, e, this.providerId) 6543 }, w(co, uo), jr(co, "PROVIDER_ID", "facebook.com"), jr(co, "FACEBOOK_SIGN_IN_METHOD", "facebook.com"), w(lo, uo), jr(lo, "PROVIDER_ID", "github.com"), jr(lo, "GITHUB_SIGN_IN_METHOD", "github.com"), w(po, uo), jr(po, "PROVIDER_ID", "google.com"), jr(po, "GOOGLE_SIGN_IN_METHOD", "google.com"), w(go, so), jr(go, "PROVIDER_ID", "twitter.com"), jr(go, "TWITTER_SIGN_IN_METHOD", "twitter.com"), mo.prototype.ka = function (t) { 6544 return this.signInMethod == wo.EMAIL_LINK_SIGN_IN_METHOD ? za(t, wa, { 6545 email: this.a, 6546 oobCode: this.f 6547 }) : za(t, Ba, { 6548 email: this.a, 6549 password: this.f 6550 }) 6551 }, mo.prototype.b = function (t, e) { 6552 return this.signInMethod == wo.EMAIL_LINK_SIGN_IN_METHOD ? za(t, _a, { 6553 idToken: e, 6554 email: this.a, 6555 oobCode: this.f 6556 }) : za(t, xa, { 6557 idToken: e, 6558 email: this.a, 6559 password: this.f 6560 }) 6561 }, mo.prototype.c = function (t, e) { 6562 return Zi(this.ka(t), e) 6563 }, mo.prototype.w = function () { 6564 return { 6565 email: this.a, 6566 password: this.f, 6567 signInMethod: this.signInMethod 6568 } 6569 }, qr(wo, { 6570 PROVIDER_ID: "password" 6571 }), qr(wo, { 6572 EMAIL_LINK_SIGN_IN_METHOD: "emailLink" 6573 }), qr(wo, { 6574 EMAIL_PASSWORD_SIGN_IN_METHOD: "password" 6575 }), To.prototype.ka = function (t) { 6576 return t.fb(So(this)) 6577 }, To.prototype.b = function (t, e) { 6578 var n = So(this); 6579 return n.idToken = e, za(t, Wa, n) 6580 }, To.prototype.c = function (t, e) { 6581 var n = So(this); 6582 return n.operation = "REAUTH", Zi(t = za(t, Ha, n), e) 6583 }, To.prototype.w = function () { 6584 var t = { 6585 providerId: "phone" 6586 }; 6587 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 6588 }, Co.prototype.fb = function (r, i) { 6589 var o = this.a.a; 6590 return be(i.verify()).then(function (n) { 6591 if ("string" != typeof n) throw new I("argument-error", "An implementation of firebase.auth.ApplicationVerifier.prototype.verify() must return a firebase.Promise that resolves with a string."); 6592 if ("recaptcha" !== i.type) throw new I("argument-error", 'Only firebase.auth.ApplicationVerifiers with type="recaptcha" are currently supported.'); 6593 var t = g(r) ? r.session : null, 6594 e = g(r) ? r.phoneNumber : r, 6595 t = t && t.type == Xi ? t.Ha().then(function (t) { 6596 return za(o, Ma, { 6597 idToken: t, 6598 phoneEnrollmentInfo: { 6599 phoneNumber: e, 6600 recaptchaToken: n 6601 } 6602 }).then(function (t) { 6603 return t.phoneSessionInfo.sessionInfo 6604 }) 6605 }) : t && t.type == Ji ? t.Ha().then(function (t) { 6606 return e = o, t = { 6607 mfaPendingCredential: t, 6608 mfaEnrollmentId: r.multiFactorHint && r.multiFactorHint.uid || r.multiFactorUid, 6609 phoneSignInInfo: { 6610 recaptchaToken: n 6611 } 6612 }, za(e, Fa, t).then(function (t) { 6613 return t.phoneResponseInfo.sessionInfo 6614 }); 6615 var e 6616 }) : za(o, Oa, { 6617 phoneNumber: e, 6618 recaptchaToken: n 6619 }); 6620 return t.then(function (t) { 6621 return "function" == typeof i.reset && i.reset(), t 6622 }, function (t) { 6623 throw "function" == typeof i.reset && i.reset(), t 6624 }) 6625 }) 6626 }, qr(Co, { 6627 PROVIDER_ID: "phone" 6628 }), qr(Co, { 6629 PHONE_SIGN_IN_METHOD: "phone" 6630 }), Ro.prototype.getUid = function () { 6631 var t = []; 6632 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("-") 6633 }, Ro.prototype.T = function () { 6634 return this.h 6635 }, Ro.prototype.w = function () { 6636 return { 6637 type: this.c, 6638 eventId: this.b, 6639 urlResponse: this.g, 6640 sessionId: this.f, 6641 postBody: this.i, 6642 tenantId: this.h, 6643 error: this.a && this.a.w() 6644 } 6645 }; 6646 var Do, xo = null; 6647 6648 function Lo(t) { 6649 var e = "unauthorized-domain", 6650 n = void 0, 6651 r = kn(t); 6652 t = r.a, "chrome-extension" == (r = r.c) ? n = Ft("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 = Ft("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", I.call(this, e, n) 6653 } 6654 6655 function Mo(t, e, n) { 6656 I.call(this, t, n), (t = e || {}).Jb && jr(this, "email", t.Jb), t.ea && jr(this, "phoneNumber", t.ea), t.credential && jr(this, "credential", t.credential), t.Zb && jr(this, "tenantId", t.Zb) 6657 } 6658 6659 function Fo(t) { 6660 if (t.code) { 6661 var e = t.code || ""; 6662 0 == e.indexOf(S) && (e = e.substring(S.length)); 6663 var n = { 6664 credential: Ao(t), 6665 Zb: t.tenantId 6666 }; 6667 if (t.email) n.Jb = t.email; 6668 else if (t.phoneNumber) n.ea = t.phoneNumber; 6669 else if (!n.credential) return new I(e, t.message || void 0); 6670 return new Mo(e, n, t.message) 6671 } 6672 return null 6673 } 6674 6675 function Uo() {} 6676 6677 function jo(t) { 6678 return t.c || (t.c = t.b()) 6679 } 6680 6681 function qo() {} 6682 6683 function Vo(t) { 6684 if (t.f || "undefined" != typeof XMLHttpRequest || "undefined" == typeof ActiveXObject) return t.f; 6685 for (var e = ["MSXML2.XMLHTTP.6.0", "MSXML2.XMLHTTP.3.0", "MSXML2.XMLHTTP", "Microsoft.XMLHTTP"], n = 0; n < e.length; n++) { 6686 var r = e[n]; 6687 try { 6688 return new ActiveXObject(r), t.f = r 6689 } catch (t) {} 6690 } 6691 throw Error("Could not create ActiveXObject. ActiveX might be disabled, or MSXML might not be installed") 6692 } 6693 6694 function Bo() {} 6695 6696 function Ko() { 6697 this.a = new XDomainRequest, this.readyState = 0, this.onreadystatechange = null, this.responseType = this.responseText = this.response = "", this.status = -1, this.statusText = "", this.a.onload = m(this.qc, this), this.a.onerror = m(this.Sb, this), this.a.onprogress = m(this.rc, this), this.a.ontimeout = m(this.vc, this) 6698 } 6699 6700 function Wo(t, e) { 6701 t.readyState = e, t.onreadystatechange && t.onreadystatechange() 6702 } 6703 6704 function Ho(t, e, n) { 6705 this.reset(t, e, n, void 0, void 0) 6706 } 6707 6708 function Go(t) { 6709 this.f = t, this.b = this.c = this.a = null 6710 } 6711 6712 function zo(t, e) { 6713 this.name = t, this.value = e 6714 } 6715 w(Lo, I), w(Mo, I), Mo.prototype.w = function () { 6716 var t = {
6717 code: this.code, 6718 message: this.message 6719 }; 6720 this.email && (t.email = this.email), this.phoneNumber && (t.phoneNumber = this.phoneNumber), this.tenantId && (t.tenantId = this.tenantId); 6721 var e = this.credential && this.credential.w(); 6722 return e && lt(t, e), t 6723 }, Mo.prototype.toJSON = function () { 6724 return this.w() 6725 }, Uo.prototype.c = null, w(qo, Uo), qo.prototype.a = function () { 6726 var t = Vo(this); 6727 return t ? new ActiveXObject(t) : new XMLHttpRequest 6728 }, qo.prototype.b = function () { 6729 var t = {}; 6730 return Vo(this) && (t[0] = !0, t[1] = !0), t 6731 }, Do = new qo, w(Bo, Uo), Bo.prototype.a = function () { 6732 var t = new XMLHttpRequest; 6733 if ("withCredentials" in t) return t; 6734 if ("undefined" != typeof XDomainRequest) return new Ko; 6735 throw Error("Unsupported browser") 6736 }, Bo.prototype.b = function () { 6737 return {} 6738 }, (t = Ko.prototype).open = function (t, e, n) { 6739 if (null != n && !n) throw Error("Only async requests are supported."); 6740 this.a.open(t, e) 6741 }, t.send = function (t) { 6742 if (t) { 6743 if ("string" != typeof t) throw Error("Only string data is supported"); 6744 this.a.send(t) 6745 } else this.a.send() 6746 }, t.abort = function () { 6747 this.a.abort() 6748 }, t.setRequestHeader = function () {}, t.getResponseHeader = function (t) { 6749 return "content-type" == t.toLowerCase() ? this.a.contentType : "" 6750 }, t.qc = function () { 6751 this.status = 200, this.response = this.responseText = this.a.responseText, Wo(this, 4) 6752 }, t.Sb = function () { 6753 this.status = 500, this.response = this.responseText = "", Wo(this, 4) 6754 }, t.vc = function () { 6755 this.Sb() 6756 }, t.rc = function () { 6757 this.status = 200, Wo(this, 1) 6758 }, t.getAllResponseHeaders = function () { 6759 return "content-type: " + this.a.contentType 6760 }, Ho.prototype.a = null, Ho.prototype.reset = function (t, e, n, r, i) { 6761 delete this.a 6762 }, zo.prototype.toString = function () { 6763 return this.name 6764 }; 6765 var Qo = new zo("SEVERE", 1e3), 6766 Yo = new zo("WARNING", 900), 6767 Xo = new zo("CONFIG", 700), 6768 Jo = new zo("FINE", 500); 6769 Go.prototype.log = function (t, e, n) { 6770 if (t.value >= function t(e) { 6771 return e.c || (e.a ? t(e.a) : (O("Root logger has no level set."), null)) 6772 }(this).value) 6773 for (v(e) && (e = e()), t = new Ho(t, String(e), this.f), n && (t.a = n), n = this; n;) n = n.a 6774 }; 6775 var $o, Zo = {}, 6776 ts = null; 6777 6778 function es(t) { 6779 var e, n, r; 6780 return ts || (ts = new Go(""), (Zo[""] = ts).c = Xo), (e = Zo[t]) || (e = new Go(t), r = t.lastIndexOf("."), n = t.substr(r + 1), (r = es(t.substr(0, r))).b || (r.b = {}), (r.b[n] = e).a = r, Zo[t] = e), e 6781 } 6782 6783 function ns(t, e) { 6784 t && t.log(Jo, e, void 0) 6785 } 6786 6787 function rs(t) { 6788 this.f = t 6789 } 6790 6791 function is(t) { 6792 ln.call(this), this.u = t, this.h = void 0, this.readyState = os, 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 = es("goog.net.FetchXmlHttp"), this.m = this.c = this.g = null 6793 } 6794 w(rs, Uo), rs.prototype.a = function () { 6795 return new is(this.f) 6796 }, rs.prototype.b = ($o = {}, function () { 6797 return $o 6798 }), w(is, ln); 6799 var os = 0; 6800 6801 function ss(t) { 6802 t.c.read().then(t.pc.bind(t)).catch(t.Ua.bind(t)) 6803 } 6804 6805 function as(t) { 6806 t.readyState = 4, t.g = null, t.c = null, t.m = null, us(t) 6807 } 6808 6809 function us(t) { 6810 t.onreadystatechange && t.onreadystatechange.call(t) 6811 } 6812 6813 function cs(t) { 6814 ln.call(this), this.headers = new bn, 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 = hs, this.u = this.S = !1 6815 }(t = is.prototype).open = function (t, e) { 6816 if (this.readyState != os) throw this.abort(), Error("Error reopening a connection"); 6817 this.s = t, this.f = e, this.readyState = 1, us(this) 6818 }, t.send = function (t) { 6819 if (1 != this.readyState) throw this.abort(), Error("need to call open() first. "); 6820 this.a = !0; 6821 var e = { 6822 headers: this.l, 6823 method: this.s, 6824 credentials: this.h, 6825 cache: void 0 6826 };
6827 t && (e.body = t), this.u.fetch(new Request(this.f, e)).then(this.uc.bind(this), this.Ua.bind(this)) 6828 }, t.abort = function () { 6829 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, as(this)), this.readyState = os 6830 }, t.uc = function (t) { 6831 this.a && (this.g = t, this.b || (this.status = this.g.status, this.statusText = this.g.statusText, this.b = t.headers, this.readyState = 2, us(this)), this.a && (this.readyState = 3, us(this), this.a && ("arraybuffer" === this.responseType ? t.arrayBuffer().then(this.sc.bind(this), this.Ua.bind(this)) : void 0 !== l.ReadableStream && "body" in t ? (this.response = this.responseText = "", this.c = t.body.getReader(), this.m = new TextDecoder, ss(this)) : t.text().then(this.tc.bind(this), this.Ua.bind(this))))) 6832 }, t.pc = function (t) { 6833 var e; 6834 this.a && ((e = this.m.decode(t.value || new Uint8Array(0), { 6835 stream: !t.done 6836 })) && (this.response = this.responseText += e), (t.done ? as : us)(this), 3 == this.readyState && ss(this)) 6837 }, t.tc = function (t) { 6838 this.a && (this.response = this.responseText = t, as(this)) 6839 }, t.sc = function (t) { 6840 this.a && (this.response = t, as(this)) 6841 }, t.Ua = function (t) { 6842 var e = this.i; 6843 e && e.log(Yo, "Failed to fetch url " + this.f, t instanceof Error ? t : Error(t)), this.a && as(this) 6844 }, t.setRequestHeader = function (t, e) { 6845 this.l.append(t, e) 6846 }, t.getResponseHeader = function (t) { 6847 return this.b ? this.b.get(t.toLowerCase()) || "" : ((t = this.i) && t.log(Yo, "Attempting to get response header but no headers have been received for url: " + this.f, void 0), "") 6848 }, t.getAllResponseHeaders = function () { 6849 if (!this.b) { 6850 var t = this.i; 6851 return t && t.log(Yo, "Attempting to get all response headers but no headers have been received for url: " + this.f, void 0), "" 6852 } 6853 for (var t = [], e = this.b.entries(), n = e.next(); !n.done;) n = n.value, t.push(n[0] + ": " + n[1]), n = e.next(); 6854 return t.join("\r\n") 6855 }, Object.defineProperty(is.prototype, "withCredentials", { 6856 get: function () { 6857 return "include" === this.h 6858 }, 6859 set: function (t) { 6860 this.h = t ? "include" : "same-origin" 6861 } 6862 }), w(cs, ln); 6863 var hs = ""; 6864 cs.prototype.b = es("goog.net.XhrIo"); 6865 var ls = /^https?$/i, 6866 fs = ["POST", "PUT"]; 6867 6868 function ps(e, t, n, r, i) { 6869 if (e.a) throw Error("[goog.net.XhrIo] Object is active with another request=" + e.l + "; newUri=" + t); 6870 n = n ? n.toUpperCase() : "GET", e.l = t, e.h = "", e.R = n, e.J = !1, e.c = !0, e.a = (e.D || Do).a(), e.C = e.D ? jo(e.D) : jo(Do), e.a.onreadystatechange = m(e.Vb, e); 6871 try { 6872 ns(e.b, Is(e, "Opening Xhr")), e.O = !0, e.a.open(n, String(t), !0), e.O = !1 6873 } catch (t) { 6874 return ns(e.b, Is(e, "Error opening Xhr: " + t.message)), void vs(e, t) 6875 } 6876 t = r || ""; 6877 var o, s = new bn(e.headers); 6878 i && function (t, e) { 6879 if (t.forEach && "function" == typeof t.forEach) t.forEach(e, void 0); 6880 else if (d(t) || "string" == typeof t) j(t, e, void 0); 6881 else 6882 for (var n = mn(t), r = yn(t), i = r.length, o = 0; o < i; o++) e.call(void 0, r[o], n && n[o], t) 6883 }(i, function (t, e) { 6884 s.set(e, t) 6885 }), i = function (t) { 6886 t: { 6887 for (var e = ds, n = t.length, r = "string" == typeof t ? t.split("") : t, i = 0; i < n; i++) 6888 if (i in r && e.call(void 0, r[i], i, t)) { 6889 e = i; 6890 break t 6891 } e = -1 6892 } 6893 return e < 0 ? null : "string" == typeof t ? t.charAt(e) : t[e] 6894 }(s.Y()), r = l.FormData && t instanceof l.FormData, !K(fs, n) || i || r || s.set("Content-Type", "application/x-www-form-urlencoded;
6894charset=utf-8"), s.forEach(function (t, e) { 6895 this.a.setRequestHeader(e, t) 6896 }, e), e.m && (e.a.responseType = e.m), "withCredentials" in e.a && e.a.withCredentials !== e.S && (e.a.withCredentials = e.S); 6897 try { 6898 bs(e), 0 < e.g && (e.u = (o = e.a, Bt && Jt(9) && "number" == typeof o.timeout && void 0 !== o.ontimeout), ns(e.b, Is(e, "Will abort after " + e.g + "ms if incomplete, xhr2 " + e.u)), e.u ? (e.a.timeout = e.g, e.a.ontimeout = m(e.Ma, e)) : e.s = vn(e.Ma, e.g, e)), ns(e.b, Is(e, "Sending request")), e.i = !0, e.a.send(t), e.i = !1 6899 } catch (t) { 6900 ns(e.b, Is(e, "Send error: " + t.message)), vs(e, t) 6901 } 6902 } 6903 6904 function ds(t) { 6905 return "content-type" == t.toLowerCase() 6906 } 6907 6908 function vs(t, e) { 6909 t.c = !1, t.a && (t.f = !0, t.a.abort(), t.f = !1), t.h = e, gs(t), ms(t) 6910 } 6911 6912 function gs(t) { 6913 t.J || (t.J = !0, t.dispatchEvent("complete"), t.dispatchEvent("error")) 6914 } 6915 6916 function ys(e) { 6917 if (e.c && void 0 !== h) 6918 if (e.C[1] && 4 == ws(e) && 2 == _s(e)) ns(e.b, Is(e, "Local request error detected and ignored")); 6919 else if (e.i && 4 == ws(e)) vn(e.Vb, 0, e); 6920 else if (e.dispatchEvent("readystatechange"), 4 == ws(e)) { 6921 ns(e.b, Is(e, "Request complete")), e.c = !1; 6922 try { 6923 var t, n, r, i, o = _s(e); 6924 t: switch (o) { 6925 case 200: 6926 case 201: 6927 case 202: 6928 case 204: 6929 case 206: 6930 case 304: 6931 case 1223: 6932 var s = !0; 6933 break t; 6934 default: 6935 s = !1 6936 } 6937 if ((t = s) || ((n = 0 === o) && (!(i = String(e.l).match(In)[1] || null) && l.self && l.self.location && (i = (r = l.self.location.protocol).substr(0, r.length - 1)), n = !ls.test(i ? i.toLowerCase() : "")), t = n), t) e.dispatchEvent("complete"), e.dispatchEvent("success"); 6938 else { 6939 try { 6940 var a = 2 < ws(e) ? e.a.statusText : "" 6941 } catch (t) { 6942 ns(e.b, "Can not get status: " + t.message), a = "" 6943 } 6944 e.h = a + " [" + _s(e) + "]", gs(e) 6945 } 6946 } finally { 6947 ms(e) 6948 } 6949 } 6950 } 6951 6952 function ms(e, t) { 6953 if (e.a) { 6954 bs(e); 6955 var n = e.a, 6956 r = e.C[0] ? s : null; 6957 e.a = null, e.C = null, t || e.dispatchEvent("ready"); 6958 try { 6959 n.onreadystatechange = r 6960 } catch (t) { 6961 (e = e.b) && e.log(Qo, "Problem encountered resetting onreadystatechange: " + t.message, void 0) 6962 } 6963 } 6964 } 6965 6966 function bs(t) { 6967 t.a && t.u && (t.a.ontimeout = null), t.s && (l.clearTimeout(t.s), t.s = null) 6968 } 6969 6970 function ws(t) { 6971 return t.a ? t.a.readyState : 0 6972 } 6973 6974 function _s(t) { 6975 try { 6976 return 2 < ws(t) ? t.a.status : -1 6977 } catch (t) { 6978 return -1 6979 } 6980 } 6981 6982 function Is(t, e) { 6983 return e + " [" + t.R + " " + t.l + " " + _s(t) + "]" 6984 } 6985 6986 function Ts(t) { 6987 var e = xs; 6988 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 6989 } 6990 6991 function Es(t, e, n) { 6992 t.a = !0, t.c = n, t.f = !e, As(t) 6993 } 6994 6995 function Ss(t) { 6996 if (t.a) { 6997 if (!t.v) throw new ks; 6998 t.v = !1 6999 } 7000 } 7001 7002 function Cs(t, e, n, r) { 7003 t.g.push([e, n, r]), t.a && As(t) 7004 } 7005 7006 function Ns(t) { 7007 return B(t.g, function (t) { 7008 return v(t[1]) 7009 }) 7010 } 7011 7012 function As(e) { 7013 var n; 7014 e.h && e.a && Ns(e) && (r = e.h, (n = Os[r]) && (l.clearTimeout(n.a), delete Os[r]), e.h = 0), e.b && (e.b.l--, delete e.b); 7015 for (var r = e.c, t = n = !1; e.g.length && !e.i;) { 7016 var i = (s = e.g.shift())[0], 7017 o = s[1], 7018 s = s[2]; 7019 if (i = e.f ? o : i) try { 7020 var a = i.call(s || e.s, r); 7021 void 0 !== a && (e.f = e.f && (a == r || a instanceof Error), e.c = r = a), (k(r) || "function" == typeof l.Promise && r instanceof l.Promise) && (t = !0, e.i = !0) 7022 } catch (t) { 7023 r = t, e.f = !0, Ns(e) || (n = !0) 7024 } 7025 } 7026 e.c = r, t && (a = m(e.m, e, !0), t = m(e.m, e, !1), r instanceof Ts ? (Cs(r, a, t), r.C = !0) : r.then(a, t)), n && (r = new Ps(r), Os[r.a] = r, e.h = r.a) 7027 } 7028 7029 function ks() { 7030 R.call(this) 7031 } 7032 7033 function Rs() { 7034 R.call(this) 7035 } 7036 7037 function Ps(t) { 7038 this.a = l.setTimeout(m(this.c, this), 0), this.b = t 7039 }(t = cs.prototype).Ma = function () { 7040 void 0 !== h && this.a && (this.h = "Timed out after " + this.g + "ms, aborting", ns(this.b, Is(this, this.h)), this.dispatchEvent("timeout"), this.abort(8)) 7041 }, t.abort = function () { 7042 this.a && this.c && (ns(this.b, Is(this, "Aborting")), this.c = !1, this.f = !0, this.a.abort(), this.f = !1, this.dispatchEvent("complete"), this.dispatchEvent("abort"), ms(this)) 7043 }, t.Da = function () { 7044 this.a && (this.c && (this.c = !1, this.f = !0, this.a.abort(), this.f = !1), ms(this, !0)), cs.ab.Da.call(this) 7045 }, t.Vb = function () { 7046 this.xa || (this.O || this.i || this.f ? ys(this) : this.Jc()) 7047 }, t.Jc = function () { 7048 ys(this) 7049 }, t.getResponse = function () { 7050 try { 7051 if (!this.a) return null; 7052 if ("response" in this.a) return this.a.response; 7053 switch (this.m) { 7054 case hs: 7055 case "text": 7056 return this.a.responseText; 7057 case "arraybuffer": 7058 if ("mozResponseArrayBuffer" in this.a) return this.a.mozResponseArrayBuffer 7059 } 7060 var t = this.b; 7061 return t && t.log(Qo, "Response type " + this.m + " is not supported on this browser", void 0), null 7062 } catch (t) { 7063 return ns(this.b, "Can not get response: " + t.message), null 7064 } 7065 }, Ts.prototype.cancel = function (t) { 7066 var e; 7067 this.a ? this.c instanceof Ts && this.c.cancel() : (this.b && (e = this.b, delete this.b, t ? e.cancel(t) : (e.l--, e.l <= 0 && e.cancel())), this.u ? this.u.call(this.s, this) : this.v = !0, this.a || (t = new Rs, Ss(this), Es(this, !1, t))) 7068 }, Ts.prototype.m = function (t, e) { 7069 this.i = !1, Es(this, t, e) 7070 }, Ts.prototype.then = function (t, e, n) { 7071 var r, i, o = new fe(function (t, e) { 7072 r = t, i = e 7073 }); 7074 return Cs(this, r, function (t) { 7075 t instanceof Rs ? o.cancel() : i(t) 7076 }), o.then(t, e, n) 7077 }
7077, Ts.prototype.$goog_Thenable = !0, w(ks, R), ks.prototype.message = "Deferred has already fired", ks.prototype.name = "AlreadyCalledError", w(Rs, R), Rs.prototype.message = "Deferred was canceled", Rs.prototype.name = "CanceledError", Ps.prototype.c = function () { 7078 throw delete Os[this.a], this.b 7079 }; 7080 var Os = {}; 7081 7082 function Ds(t) { 7083 var e = document, 7084 n = wt(t).toString(), 7085 r = se(document, "SCRIPT"), 7086 i = { 7087 Wb: r, 7088 Ma: void 0 7089 }, 7090 o = new Ts(i), 7091 s = window.setTimeout(function () { 7092 Ls(r, !0); 7093 var t = new Us(Fs, "Timeout reached for loading script " + n); 7094 Ss(o), Es(o, !1, t) 7095 }, 5e3); 7096 return i.Ma = s, r.onload = r.onreadystatechange = function () { 7097 r.readyState && "loaded" != r.readyState && "complete" != r.readyState || (Ls(r, !1, s), Ss(o), Es(o, !0, null)) 7098 }, r.onerror = function () { 7099 Ls(r, !0, s); 7100 var t = new Us(Ms, "Error while loading script " + n); 7101 Ss(o), Es(o, !1, t) 7102 }, lt(i = {}, { 7103 type: "text/javascript", 7104 charset: "UTF-8" 7105 }), ee(r, i), i = t, ft(t = r, "HTMLScriptElement"), t.src = wt(i), (i = (i = t.ownerDocument && t.ownerDocument.defaultView) && i != l ? f(i.document) : a = null === a ? f(l.document) : a) && t.setAttribute("nonce", i), ((e = ((i = e) || document).getElementsByTagName("HEAD")) && 0 != e.length ? e[0] : i.documentElement).appendChild(r), o 7106 } 7107 7108 function xs() { 7109 var t; 7110 this && this.Wb && ((t = this.Wb) && "SCRIPT" == t.tagName && Ls(t, !0, this.Ma)) 7111 } 7112 7113 function Ls(t, e, n) { 7114 null != n && l.clearTimeout(n), t.onload = s, t.onerror = s, t.onreadystatechange = s, e && window.setTimeout(function () { 7115 t && t.parentNode && t.parentNode.removeChild(t) 7116 }, 0) 7117 } 7118 var Ms = 0, 7119 Fs = 1; 7120 7121 function Us(t, e) { 7122 var n = "Jsloader error (code #" + t + ")"; 7123 e && (n += ": " + e), R.call(this, n), this.code = t 7124 } 7125 7126 function js(t) { 7127 this.f = t 7128 } 7129 7130 function qs(t, e, n) { 7131 if (this.c = t, t = e || {}, this.l = t.secureTokenEndpoint || "https://securetoken.googleapis.com/v1/token", this.m = t.secureTokenTimeout || Ks, this.g = ct(t.secureTokenHeaders || Ws), this.h = t.firebaseEndpoint || "https://www.googleapis.com/identitytoolkit/v3/relyingparty/", this.i = t.identityPlatformEndpoint || "https://identitytoolkit.googleapis.com/v2/", this.v = t.firebaseTimeout || Hs, this.a = ct(t.firebaseHeaders || Gs), n && (this.a["X-Client-Version"] = n, this.g["X-Client-Version"] = n), n = "Node" == hr(), !(n = l.XMLHttpRequest || n && Xl.INTERNAL.node && Xl.INTERNAL.node.XMLHttpRequest) && !cr()) throw new I("internal-error", "The XMLHttpRequest compatibility library was not found."); 7132 this.f = void 0, cr() ? this.f = new rs(self) : lr() ? this.f = new js(n) : this.f = new Bo, this.b = null 7133 } 7134 w(Us, R), w(js, Uo), js.prototype.a = function () { 7135 return new this.f 7136 }, js.prototype.b = function () { 7137 return {} 7138 }; 7139 var Vs, Bs = "idToken", 7140 Ks = new Rr(3e4, 6e4), 7141 Ws = { 7142 "Content-Type": "application/x-www-form-urlencoded" 7143 }, 7144 Hs = new Rr(3e4, 6e4), 7145 Gs = { 7146 "Content-Type": "application/json" 7147 }; 7148 7149 function zs(t, e) { 7150 e ? t.a["X-Firebase-Locale"] = e : delete t.a["X-Firebase-Locale"] 7151 } 7152 7153 function Qs(t, e) { 7154 e && (t.l = Ys("https://securetoken.googleapis.com/v1/token", e), t.h = Ys("https://www.googleapis.com/identitytoolkit/v3/relyingparty/", e), t.i = Ys("https://identitytoolkit.googleapis.com/v2/", e)) 7155 } 7156 7157 function Ys(t, e) { 7158 return t = kn(t), e = kn(e.url), t.f = t.a + t.f, En(t, e.c), t.a = e.a, Sn(t, e.g), t.toString() 7159 } 7160 7161 function Xs(t, e) { 7162 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"]) 7163 } 7164 7165 function Js(t, e, n, r, i, o, s) { 7166 var a; 7167 (t = ((a = dr(a = yr()) == pr && (a = a.match(/\sChrome\/(\d+)/i)) && 2 == a.length ? parseInt(a[1], 10) : null) && a < 30 || Bt && $t && !(9 < $t)) && !cr() ? (Vs = Vs || new fe(function (t, e) { 7168 var n, r; 7169 n = t, r = e, ((window.gapi || {}).client || {}).request ? n() : (l[Zs] = function () { 7170 ((window.gapi || {}).client || {}).request ? n() : r(Error("CORS_UNSUPPORTED")) 7171 }, function (t, e) { 7172 Cs(t, null, e, void 0) 7173 }(Ds(_t($s, { 7174 onload: Zs 7175 })), function () { 7176 r(Error("CORS_UNSUPPORTED")) 7177 })) 7178 }), m(t.s, t)) : m(t.u, t))(e, n, r, i, o, s) 7179 } 7180 qs.prototype.T = function () { 7181 return this.b 7182 }, qs.prototype.u = function (t, n, e, r, i, o) { 7183 if (cr() && (void 0 === l.fetch || void 0 === l.Headers || void 0 === l.Request)) throw new I("operation-not-supported-in-this-environment", "fetch, Headers and Request native APIs or equivalent Polyfills must be available to supp
7183ort HTTP requests from a Worker environment."); 7184 var s, a = new cs(this.f); 7185 o && (a.g = Math.max(0, o), s = setTimeout(function () { 7186 a.dispatchEvent("timeout") 7187 }, o)), fn(a, "complete", function () { 7188 s && clearTimeout(s); 7189 var e = null; 7190 try { 7191 e = JSON.parse(function (e) { 7192 try { 7193 return e.a ? e.a.responseText : "" 7194 } catch (t) { 7195 return ns(e.b, "Can not get responseText: " + t.message), "" 7196 } 7197 }(this)) || null 7198 } catch (t) { 7199 e = null 7200 } 7201 n && n(e) 7202 }), pn(a, "ready", function () { 7203 s && clearTimeout(s), Le(this) 7204 }), pn(a, "timeout", function () { 7205 s && clearTimeout(s), Le(this), n && n(null) 7206 }), ps(a, t, e, r, i) 7207 }; 7208 var $s = new pt(yt, "https://apis.google.com/js/client.js?onload=%{onload}"), 7209 Zs = "__fcb" + Math.floor(1e6 * Math.random()).toString(); 7210 7211 function ta(t, e, n, r, i, o, s) { 7212 var a = kn(e + n); 7213 Nn(a, "key", t.c), s && Nn(a, "cb", Date.now().toString()); 7214 var u = "GET" == r; 7215 if (u) 7216 for (var c in i) i.hasOwnProperty(c) && Nn(a, c, i[c]); 7217 return new fe(function (e, n) { 7218 Js(t, a.toString(), function (t) { 7219 t ? t.error ? n(Ya(t, o || {})) : e(t) : n(new I("network-request-failed")) 7220 }, r, u ? void 0 : zn(Sr(i)), t.a, t.v.get()) 7221 }) 7222 } 7223 7224 function ea(t) { 7225 if ("string" != typeof (t = t.email) || !or.test(t)) throw new I("invalid-email") 7226 } 7227 7228 function na(t) { 7229 "email" in t && ea(t) 7230 } 7231 7232 function ra(t) { 7233 if (!t[Bs]) { 7234 if (t.mfaPendingCredential) throw new I("multi-factor-auth-required", null, ct(t)); 7235 throw new I("internal-error") 7236 } 7237 } 7238 7239 function ia(t) { 7240 if (t.phoneNumber || t.temporaryProof) { 7241 if (!t.phoneNumber || !t.temporaryProof) throw new I("internal-error") 7242 } else { 7243 if (!t.sessionInfo) throw new I("missing-verification-id"); 7244 if (!t.code) throw new I("missing-verification-code") 7245 } 7246 } 7247 qs.prototype.s = function (t, n, r, i, o) { 7248 var s = this; 7249 Vs.then(function () { 7250 window.gapi.client.setApiKey(s.c); 7251 var e = window.gapi.auth.getToken(); 7252 window.gapi.auth.setToken(null), window.gapi.client.request({ 7253 path: t, 7254 method: r, 7255 body: i, 7256 headers: o, 7257 authType: "none", 7258 callback: function (t) { 7259 window.gapi.auth.setToken(e), n && n(t) 7260 } 7261 }) 7262 }).o(function (t) { 7263 n && n({ 7264 error: { 7265 message: t && t.message || "CORS_UNSUPPORTED" 7266 } 7267 }) 7268 }) 7269 }, qs.prototype.zb = function () { 7270 return za(this, La, {}) 7271 }, qs.prototype.Bb = function (t, e) { 7272 return za(this, Da, { 7273 idToken: t, 7274 email: e 7275 }) 7276 }, qs.prototype.Cb = function (t, e) { 7277 return za(this, xa, { 7278 idToken: t, 7279 password: e 7280 }) 7281 }; 7282 var oa = { 7283 displayName: "DISPLAY_NAME", 7284 photoUrl: "PHOTO_URL" 7285 }; 7286 7287 function sa(t) { 7288 if (!t.phoneVerificationInfo) throw new I("internal-error"); 7289 if (!t.phoneVerificationInfo.sessionInfo) throw new I("missing-verification-id"); 7290 if (!t.phoneVerificationInfo.code) throw new I("missing-verification-code") 7291 } 7292 7293 function aa(t) { 7294 if (!t.requestUri || !t.sessionId && !t.postBody && !t.pen
7294dingToken) throw new I("internal-error") 7295 } 7296 7297 function ua(t, e) { 7298 return e.oauthIdToken && e.providerId && 0 == e.providerId.indexOf("oidc.") && !e.pendingToken && (t.sessionId ? e.nonce = t.sessionId : t.postBody && (Kn(t = new jn(t.postBody), "nonce") && (e.nonce = t.get("nonce")))), e 7299 } 7300 7301 function ca(t) { 7302 var e = null; 7303 if (t.needConfirmation ? (t.code = "account-exists-with-different-credential", e = Fo(t)) : "FEDERATED_USER_ID_ALREADY_LINKED" == t.errorMessage ? (t.code = "credential-already-in-use", e = Fo(t)) : "EMAIL_EXISTS" == t.errorMessage ? (t.code = "email-already-in-use", e = Fo(t)) : t.errorMessage && (e = Qa(t.errorMessage)), e) throw e; 7304 ra(t) 7305 } 7306 7307 function ha(t, e) { 7308 return e.returnIdpCredential = !0, za(t, Ua, e) 7309 } 7310 7311 function la(t, e) { 7312 return e.returnIdpCredential = !0, za(t, qa, e) 7313 } 7314 7315 function fa(t, e) { 7316 return e.returnIdpCredential = !0, e.autoCreate = !1, za(t, ja, e) 7317 } 7318 7319 function pa(t) { 7320 if (!t.oobCode) throw new I("invalid-action-code") 7321 }(t = qs.prototype).Db = function (t, r) { 7322 var i = { 7323 idToken: t 7324 }, 7325 o = []; 7326 return at(oa, function (t, e) { 7327 var n = r[e]; 7328 null === n ? o.push(t) : e in r && (i[e] = n) 7329 }), o.length && (i.deleteAttribute = o), za(this, Da, i) 7330 }, t.vb = function (t, e) { 7331 return lt(t = { 7332 requestType: "PASSWORD_RESET", 7333 email: t 7334 }, e), za(this, Aa, t) 7335 }, t.wb = function (t, e) { 7336 return lt(t = { 7337 requestType: "EMAIL_SIGNIN", 7338 email: t 7339 }, e), za(this, Sa, t) 7340 }, t.ub = function (t, e) { 7341 return lt(t = { 7342 requestType: "VERIFY_EMAIL", 7343 idToken: t 7344 }, e), za(this, Ca, t) 7345 }, t.Eb = function (t, e, n) { 7346 return lt(t = { 7347 requestType: "VERIFY_AND_CHANGE_EMAIL", 7348 idToken: t, 7349 newEmail: e 7350 }, n), za(this, Na, t) 7351 }, t.fb = function (t) { 7352 return za(this, Ka, t) 7353 }, t.nb = function (t, e) { 7354 return za(this, Pa, { 7355 oobCode: t, 7356 newPassword: e 7357 }) 7358 }, t.Ra = function (t) { 7359 return za(this, va, { 7360 oobCode: t 7361 }) 7362 }, t.jb = function (t) { 7363 return za(this, da, { 7364 oobCode: t 7365 }) 7366 }; 7367 var da = { 7368 endpoint: "setAccountInfo", 7369 A: pa, 7370 Z: "email", 7371 B: !0 7372 }, 7373 va = { 7374 endpoint: "resetPassword", 7375 A: pa, 7376 G: function (t) { 7377 var e = t.requestType; 7378 if (!e || !t.email && "EMAIL_SIGNIN" != e && "VERIFY_AND_CHANGE_EMAIL" != e) throw new I("internal-error") 7379 }, 7380 B: !0 7381 }, 7382 ga = { 7383 endpoint: "signupNewUser", 7384 A: function (t) { 7385 if (ea(t), !t.password) throw new I("weak-password") 7386 }, 7387 G: ra, 7388 V: !0, 7389 B: !0 7390 }, 7391 ya = { 7392 endpoint: "createAuthUri", 7393 B: !0 7394 }, 7395 ma = { 7396 endpoint: "deleteAccount", 7397 N: ["idToken"] 7398 }, 7399 ba = { 7400 endpoint: "setAccountInfo", 7401 N: ["idToken", "deleteProvider"], 7402 A: function (t) { 7403 if (!Array.isArray(t.deleteProvider)) throw new I("internal-error") 7404 } 7405 }, 7406 wa = { 7407 endpoint: "emailLinkSignin", 7408 N: ["email", "oobCode"], 7409 A: ea, 7410 G: ra, 7411 V: !0, 7412 B: !0 7413 }, 7414 _a = { 7415 endpoint: "emailLinkSignin", 7416 N: ["idToken", "email", "oobCode"], 7417 A: ea, 7418 G: ra, 7419 V: !0 7420 }, 7421 Ia = { 7422 endpoint: "accounts/mfaEnrollment:finalize", 7423 N: ["idToken", "phoneVerificationInfo"], 7424 A: sa, 7425 G: ra, 7426 B: !0, 7427 Na: !0 7428 }, 7429 Ta = { 7430 endpoint: "accounts/mfaSignIn:finalize", 7431 N: ["mfaPendingCredential", "phoneVerificationInfo"], 7432 A: sa, 7433 G: ra, 7434 B: !0, 7435 Na: !0 7436 }, 7437 Ea = { 7438 endpoint: "getAccountInfo" 7439 }, 7440 Sa = { 7441 endpoint: "getOobConfirmationCode", 7442 N: ["requestType"], 7443 A: function (t) { 7444 if ("EMAIL_SIGNIN" != t.requestType) throw new I("internal-error"); 7445 ea(t) 7446 }, 7447 Z: "email", 7448 B: !0 7449 }, 7450 Ca = { 7451 endpoint: "getOobConfirmationCode", 7452 N: ["idToken", "requestType"], 7453 A: function (t) { 7454 if ("VERIFY_EMAIL" != t.requestType) throw new I("internal-error") 7455 }, 7456 Z: "email", 7457 B: !0 7458 }, 7459 Na = { 7460 endpoint: "getOobConfirmationCode", 7461 N: ["idToken", "newEmail", "requestType"], 7462 A: function (t) { 7463 if ("VERIFY_AND_CHANGE_EMAIL" != t.requestType) throw new I("internal-error") 7464 }, 7465 Z: "email", 7466 B: !0 7467 }, 7468 Aa = { 7469 endpoint: "getOobConfirmationCode", 7470 N: ["requestType"], 7471 A: function (t) { 7472 if ("PASSWORD_RESET" != t.requestType) throw new I("internal-error"); 7473 ea(t) 7474 }, 7475 Z: "email", 7476 B: !0 7477 }, 7478 ka = { 7479 lb: !0, 7480 endpoint: "getProjectConfig", 7481 Ub: "GET" 7482 }, 7483 Ra = { 7484 lb: !0, 7485 endpoint: "getRecaptchaParam", 7486 Ub: "GET", 7487 G: function (t) { 7488 if (!t.recaptchaSiteKey) throw new I("internal-error") 7489 } 7490 }, 7491 Pa = { 7492 endpoint: "resetPassword", 7493 A: pa, 7494 Z: "email", 7495 B: !0 7496 }, 7497 Oa = { 7498 endpoint: "sendVerificationCode", 7499 N: ["phoneNumber", "recaptchaToken"], 7500 Z: "sessionInfo", 7501 B: !0 7502 }, 7503 Da = { 7504 endpoint: "setAccountInfo", 7505 N: ["idToken"], 7506 A: na, 7507 V: !0 7508 }, 7509 xa = { 7510 endpoint: "setAccountInfo", 7511 N: ["idToken"], 7512 A: function (t) { 7513 if (na(t), !t.password) throw new I("weak-password") 7514 }, 7515 G: ra, 7516 V: !0 7517 }, 7518 La = { 7519 endpoint: "signupNewUser", 7520 G: ra, 7521 V: !0, 7522 B: !0 7523 }, 7524 Ma = { 7525 endpoint: "accounts/mfaEnrollment:start", 7526 N: ["idToken", "phoneEnrollmentInfo"], 7527 A: function (t) {
7528 if (!t.phoneEnrollmentInfo) throw new I("internal-error"); 7529 if (!t.phoneEnrollmentInfo.phoneNumber) throw new I("missing-phone-number"); 7530 if (!t.phoneEnrollmentInfo.recaptchaToken) throw new I("missing-app-credential") 7531 }, 7532 G: function (t) { 7533 if (!t.phoneSessionInfo || !t.phoneSessionInfo.sessionInfo) throw new I("internal-error") 7534 }, 7535 B: !0, 7536 Na: !0 7537 }, 7538 Fa = { 7539 endpoint: "accounts/mfaSignIn:start", 7540 N: ["mfaPendingCredential", "mfaEnrollmentId", "phoneSignInInfo"], 7541 A: function (t) { 7542 if (!t.phoneSignInInfo || !t.phoneSignInInfo.recaptchaToken) throw new I("missing-app-credential") 7543 }, 7544 G: function (t) { 7545 if (!t.phoneResponseInfo || !t.phoneResponseInfo.sessionInfo) throw new I("internal-error") 7546 }, 7547 B: !0, 7548 Na: !0 7549 }, 7550 Ua = { 7551 endpoint: "verifyAssertion", 7552 A: aa, 7553 Ya: ua, 7554 G: ca, 7555 V: !0, 7556 B: !0 7557 }, 7558 ja = { 7559 endpoint: "verifyAssertion", 7560 A: aa, 7561 Ya: ua, 7562 G: function (t) { 7563 if (t.errorMessage && "USER_NOT_FOUND" == t.errorMessage) throw new I("user-not-found"); 7564 if (t.errorMessage) throw Qa(t.errorMessage); 7565 ra(t) 7566 }, 7567 V: !0, 7568 B: !0 7569 }, 7570 qa = { 7571 endpoint: "verifyAssertion", 7572 A: function (t) { 7573 if (aa(t), !t.idToken) throw new I("internal-error") 7574 }, 7575 Ya: ua, 7576 G: ca, 7577 V: !0 7578 }, 7579 Va = { 7580 endpoint: "verifyCustomToken", 7581 A: function (t) { 7582 if (!t.token) throw new I("invalid-custom-token") 7583 }, 7584 G: ra, 7585 V: !0, 7586 B: !0 7587 }, 7588 Ba = { 7589 endpoint: "verifyPassword", 7590 A: function (t) { 7591 if (ea(t), !t.password) throw new I("wrong-password") 7592 }, 7593 G: ra, 7594 V: !0, 7595 B: !0 7596 }, 7597 Ka = { 7598 endpoint: "verifyPhoneNumber", 7599 A: ia, 7600 G: ra, 7601 B: !0 7602 }, 7603 Wa = { 7604 endpoint: "verifyPhoneNumber", 7605 A: function (t) { 7606 if (!t.idToken) throw new I("internal-error"); 7607 ia(t) 7608 }, 7609 G: function (t) { 7610 if (t.temporaryProof) throw t.code = "credential-already-in-use", Fo(t); 7611 ra(t) 7612 } 7613 }, 7614 Ha = { 7615 Hb: { 7616 USER_NOT_FOUND: "user-not-found" 7617 }, 7618 endpoint: "verifyPhoneNumber", 7619 A: ia, 7620 G: ra, 7621 B: !0 7622 }, 7623 Ga = { 7624 endpoint: "accounts/mfaEnrollment:withdraw", 7625 N: ["idToken", "mfaEnrollmentId"], 7626 G: function (t) { 7627 if (!!t[Bs] ^ !!t.refreshToken) throw new I("internal-error") 7628 }, 7629 B: !0, 7630 Na: !0 7631 }; 7632 7633 function za(t, e, n) { 7634 if (! function (t, e) { 7635 if (!e || !e.length) return 1; 7636 if (t) { 7637 for (var n = 0; n < e.length; n++) { 7638 var r = t[e[n]]; 7639 if (null == r || "" === r) return 7640 } 7641 return 1 7642 } 7643 }(n, e.N)) return we(new I("internal-error")); 7644 var r, i = !!e.Na, 7645 o = e.Ub || "POST"; 7646 return be(n).then(e.A).then(function () { 7647 return e.V && (n.returnSecureToken = !0), e.B && t.b && void 0 === n.tenantId && (n.tenantId = t.b), ta(t, i ? t.i : t.h, e.endpoint, o, n, e.Hb, e.lb || !1) 7648 }).then(function (t) { 7649 return r = t, e.Ya ? e.Ya(n, r) : r 7650 }).then(e.G).then(function () { 7651 if (!e.Z) return r; 7652 if (!(e.Z in r)) throw new I("internal-error"); 7653 return r[e.Z] 7654 }) 7655 } 7656 7657 function Qa(t) { 7658 return Ya({ 7659 error: { 7660 errors: [{ 7661 message: t 7662 }], 7663 code: 400, 7664 message: t 7665 } 7666 }) 7667 } 7668 7669 function Ya(t, e) { 7670 var n, r = (t.error && t.error.errors && t.error.errors[0] || {}).reason || "", 7671 i = {
7672 keyInvalid: "invalid-api-key", 7673 ipRefererBlocked: "app-not-authorized" 7674 }; 7675 if (r = i[r] ? new I(i[r]) : null) return r; 7676 for (n in r = t.error && t.error.message || "", lt(i = { 7677 INVALID_CUSTOM_TOKEN: "invalid-custom-token", 7678 CREDENTIAL_MISMATCH: "custom-token-mismatch", 7679 MISSING_CUSTOM_TOKEN: "internal-error", 7680 INVALID_IDENTIFIER: "invalid-email", 7681 MISSING_CONTINUE_URI: "internal-error", 7682 INVALID_EMAIL: "invalid-email", 7683 INVALID_PASSWORD: "wrong-password", 7684 USER_DISABLED: "user-disabled", 7685 MISSING_PASSWORD: "internal-error", 7686 EMAIL_EXISTS: "email-already-in-use", 7687 PASSWORD_LOGIN_DISABLED: "operation-not-allowed", 7688 INVALID_IDP_RESPONSE: "invalid-credential", 7689 INVALID_PENDING_TOKEN: "invalid-credential", 7690 FEDERATED_USER_ID_ALREADY_LINKED: "credential-already-in-use",
7691 MISSING_OR_INVALID_NONCE: "missing-or-invalid-nonce", 7692 INVALID_MESSAGE_PAYLOAD: "invalid-message-payload", 7693 INVALID_RECIPIENT_EMAIL: "invalid-recipient-email", 7694 INVALID_SENDER: "invalid-sender", 7695 EMAIL_NOT_FOUND: "user-not-found", 7696 RESET_PASSWORD_EXCEED_LIMIT: "too-many-requests", 7697 EXPIRED_OOB_CODE: "expired-action-code", 7698 INVALID_OOB_CODE: "invalid-action-code", 7699 MISSING_OOB_CODE: "internal-error", 7700 INVALID_PROVIDER_ID: "invalid-provider-id", 7701 CREDENTIAL_TOO_OLD_LOGIN_AGAIN: "requires-recent-login", 7702 INVALID_ID_TOKEN: "invalid-user-token", 7703 TOKEN_EXPIRED: "user-token-expired", 7704 USER_NOT_FOUND: "user-token-expired", 7705 CORS_UNSUPPORTED: "cors-unsupported", 7706 DYNAMIC_LINK_NOT_ACTIVATED: "dynamic-link-not-activated", 7707 INVALID_APP_ID: "invalid-app-id", 7708 TOO_MANY_ATTEMPTS_TRY_LATER: "too-many-requests", 7709 WEAK_PASSWORD: "weak-password", 7710 OPERATION_NOT_ALLOWED: "operation-not-allowed", 7711 USER_CANCELLED: "user-cancelled", 7712 CAPTCHA_CHECK_FAILED: "captcha-check-failed", 7713 INVALID_APP_CREDENTIAL: "invalid-app-credential", 7714 INVALID_CODE: "invalid-verification-code", 7715 INVALID_PHONE_NUMBER: "invalid-phone-number", 7716 INVALID_SESSION_INFO: "invalid-verification-id", 7717 INVALID_TEMPORARY_PROOF: "invalid-credential", 7718 MISSING_APP_CREDENTIAL: "missing-app-credential", 7719 MISSING_CODE: "missing-verification-code", 7720 MISSING_PHONE_NUMBER: "missing-phone-number", 7721 MISSING_SESSION_INFO: "missing-verification-id", 7722 QUOTA_EXCEEDED: "quota-exceeded", 7723 SESSION_EXPIRED: "code-expired", 7724 REJECTED_CREDENTIAL: "rejected-credential", 7725 INVALID_CONTINUE_URI: "invalid-continue-uri", 7726 MISSING_ANDROID_PACKAGE_NAME: "missing-android-pkg-name", 7727 MISSING_IOS_BUNDLE_ID: "missing-ios-bundle-id", 7728 UNAUTHORIZED_DOMAIN: "unauthorized-continue-uri", 7729 INVALID_DYNAMIC_LINK_DOMAIN: "invalid-dynamic-link-domain", 7730 INVALID_OAUTH_CLIENT_ID: "invalid-oauth-client-id", 7731 INVALID_CERT_HASH: "invalid-cert-hash", 7732 UNSUPPORTED_TENANT_OPERATION: "unsupported-tenant-operation", 7733 INVALID_TENANT_ID: "invalid-tenant-id", 7734 TENANT_ID_MISMATCH: "tenant-id-mismatch", 7735 ADMIN_ONLY_OPERATION: "admin-restricted-operation", 7736 INVALID_MFA_PENDING_CREDENTIAL: "invalid-multi-factor-session", 7737 MFA_ENROLLMENT_NOT_FOUND: "multi-factor-info-not-found", 7738 MISSING_MFA_PENDING_CREDENTIAL: "missing-multi-factor-session", 7739 MISSING_MFA_ENROLLMENT_ID: "missing-multi-factor-info", 7740 EMAIL_CHANGE_NEEDS_VERIFICATION: "email-change-needs-verification", 7741 SECOND_FACTOR_EXISTS: "second-factor-already-in-use", 7742 SECOND_FACTOR_LIMIT_EXCEEDED: "maximum-second-factor-count-exceeded", 7743 UNSUPPORTED_FIRST_FACTOR: "unsupported-first-factor", 7744 UNVERIFIED_EMAIL: "unverified-email" 7745 }, e || {}), e = (e = r.match(/^[^\s]+\s*:\s*([\s\S]*)$/)) && 1 < e.length ? e[1] : void 0, i) 7746 if (0 === r.indexOf(n)) return new I(i[n], e); 7747 return new I("internal-error", e = !e && t ? Er(t) : e) 7748 } 7749 7750 function Xa(t) { 7751 var o; 7752 this.b = t, this.a = null, this.rb = (o = this, (tu = tu || new fe(function (t, e) { 7753 function n() { 7754 kr(), mr("gapi.load")("gapi.iframes", { 7755 callback: t, 7756 ontimeout: function () { 7757 kr(), e(Error("Network Error")) 7758 }, 7759 timeout: $a.get() 7760 }) 7761 } 7762 var r; 7763 mr("gapi.iframes.Iframe") ? t() : mr("gapi.load") ? n() : (r = "__iframefcb" + Math.floor(1e6 * Math.random()).toString(), l[r] = function () { 7764 mr("gapi.load") ? n() : e(Error("Network Error")) 7765 }, be(Ds(r = _t(Ja, { 7766 onload: r 7767 }))).o(function () { 7768 e(Error("Network Error")) 7769 })) 7770 }).o(function (t) { 7771 throw tu = null, t 7772 })).then(function () { 7773 return new fe(function (r, i) { 7774 mr("gapi.iframes.getContext")().open({ 7775 where: document.body, 7776 url: o.b, 7777 messageHandlersFilter: mr("gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER"), 7778 attributes: { 7779 style: { 7780 position: "absolute", 7781 top: "-100px", 7782 width: "1px", 7783 height: "1px" 7784 } 7785 }, 7786 dontclear: !0 7787 }, function (t) { 7788 function e() { 7789 clearTimeout(n), r() 7790 } 7791 o.a = t, o.a.restyle({ 7792 setHideOnLeave: !1 7793 }); 7794 var n = setTimeout(function () { 7795 i(Error("Network Error")) 7796 }, Za.get()); 7797 t.ping(e).then(e, function () { 7798 i(Error("Network Error")) 7799 }) 7800 }) 7801 }) 7802 })) 7803 } 7804 var Ja = new pt(yt, "https://apis.google.com/js/api.js?onload=%{onload}"), 7805 $a = new Rr(3e4, 6e4), 7806 Za = new Rr(5e3, 15e3), 7807 tu = null; 7808 7809 function eu(t, e, n, r) { 7810 this.l = t, this.h = e, this.i = n, this.g = r, this.f = null, t = this.g ? Rn((t = kn(this.g.url)).c, t.a, t.g, "/emulator/auth/iframe") : Rn("https", this.l, null, "/__/auth/iframe"), this.a = t, Nn(this.a, "apiKey", this.h), Nn(this.a, "appName", this.i), this.b = null, this.c = [] 7811 } 7812 7813 function nu(t, e, n, r, i, o) { 7814 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 7815 } 7816 7817 function ru(t) { 7818 try { 7819 return Xl.app(t).auth().Ga() 7820 } catch (t) { 7821 return [] 7822 } 7823 } 7824 7825 function iu(t, e, n, r, i, o) { 7826 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 7827 } 7828 7829 function ou(t) { 7830 var a = Zn(); 7831 return za(t, ka, {}).then(function (t) { 7832 return t.authorizedDomains || [] 7833 }).then(function (t) { 7834 t: { 7835 for (var e = (n = kn(a)).c, n = n.a, r = 0; r < t.length; r++) { 7836 var i = t[r], 7837 o = n, 7838 s = e; 7839 if (o = 0 == i.indexOf("chrome-extension://") ? kn(i).a == o && "chrome-extension" == s : ("http" == s || "https" == s) && (ir.test(i) ? o == i : (i = i.split(".").join("\\."), new RegExp("^(.+\\." + i + "|" + i + ")$", "i").test(o)))) { 7840 t = !0; 7841 break t 7842 } 7843 } 7844 t = !1 7845 } 7846 if (!t) throw new Lo(Zn()) 7847 }) 7848 } 7849 7850 function su(i) { 7851 return i.m || (i.m = sr().then(function () { 7852 var t, e, n, r; 7853 i.u || (t = i.c, e = i.i, n = ru(i.b), (r = new eu(i.s, i.g, i.b, i.f)).f = t, r.b = e, r.c = z(n || []), i.u = r.toString()), i.v = new Xa(i.u), 7854 function (r) { 7855 if (!r.v) throw Error("IfcHandler must be initialized!"); 7856 ! function (t, e) { 7857 t.rb.then(function () { 7858 t.a.register("authEvent", e, mr("gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER")) 7859 }) 7860 }(r.v, function (t) { 7861 var e = {}; 7862 if (t && t.authEvent) { 7863 var n = !1; 7864 for (t = Po(t.authEvent), e = 0; e < r.h.length; e++) n = r.h[e](t) || n; 7865 return (e = {}).status = n ? "ACK" : "ERROR", be(e) 7866 } 7867 return e.status = "ERROR", be(e) 7868 }) 7869 }(i) 7870 }), i.m) 7871 } 7872 7873 function au(t) { 7874 return t.l || (t.C = t.c ? gr(t.c, ru(t.b)) : null, t.l = new qs(t.g, A(t.i), t.C), t.f && Qs(t.l, t.f)), t.l 7875 } 7876 7877 function uu(t, e, n, r, i, o, s, a, u, c, h, l) { 7878 return (t = new nu(t, e, n, r, i, l)).l = o, t.g = s, t.i = a, t.b = ct(u || null), t.f = c, t.yb(h).toString() 7879 } 7880 7881 function cu(t) { 7882 if (this.a = t || Xl.INTERNAL.reactNative && Xl.INTERNAL.reactNative.AsyncStorage, !this.a) throw new I("internal-error", "The React Native compatibility library was not found."); 7883 this.type = "asyncStorage" 7884 } 7885 7886 function hu(t) { 7887 this.b = t, this.a = {}, this.f = m(this.c, this) 7888 } 7889 eu.prototype.toString = function () { 7890 return this.f ? Nn(this.a, "v", this.f) : Bn(this.a.b, "v"), this.b ? Nn(this.a, "eid", this.b) : Bn(this.a.b, "eid"), this.c.length ? Nn(this.a, "fw", this.c.join(",")) : Bn(this.a.b, "fw"), this.a.toString() 7891 }, nu.prototype.yb = function (t) { 7892 return this.h = t, this 7893 }, nu.prototype.toString = function () { 7894 var t; 7895 if (Nn(t = this.v ? Rn((t = kn(this.v.url)).c, t.a, t.g, "/emulator/auth/handler")
7895: Rn("https", this.u, null, "/__/auth/handler"), "apiKey", this.s), Nn(t, "appName", this.c), Nn(t, "authType", this.m), this.a.isOAuthProvider) { 7896 var e = this.a; 7897 try { 7898 var n = Xl.app(this.c).auth().la() 7899 } catch (t) { 7900 n = null 7901 } 7902 for (r in e.ob = n, Nn(t, "providerId", this.a.providerId), e = Sr((n = this.a).Ib)) e[r] = e[r].toString(); 7903 for (var r = n.Qc, e = ct(e), i = 0; i < r.length; i++) { 7904 var o = r[i]; 7905 o in e && delete e[o] 7906 } 7907 n.pb && n.ob && !e[n.pb] && (e[n.pb] = n.ob), ut(e) || Nn(t, "customParameters", Er(e)) 7908 } 7909 if ("function" == typeof this.a.Qb && ((n = this.a.Qb()).length && Nn(t, "scopes", n.join(","))), this.l ? Nn(t, "redirectUrl", this.l) : Bn(t.b, "redirectUrl"), this.g ? Nn(t, "eventId", this.g) : Bn(t.b, "eventId"), this.i ? Nn(t, "v", this.i) : Bn(t.b, "v"), this.b) 7910 for (var s in this.b) this.b.hasOwnProperty(s) && !An(t, s) && Nn(t, s, this.b[s]); 7911 return this.h ? Nn(t, "tid", this.h) : Bn(t.b, "tid"), this.f ? Nn(t, "eid", this.f) : Bn(t.b, "eid"), (s = ru(this.c)).length && Nn(t, "fw", s.join(",")), t.toString() 7912 }, (t = iu.prototype).Ob = function (e, n, t) { 7913 var r = new I("popup-closed-by-user"), 7914 i = new I("web-storage-unsupported"), 7915 o = this, 7916 s = !1; 7917 return this.ma().then(function () { 7918 var t, r; 7919 r = { 7920 type: "webStorageSupport" 7921 }, su(t = o).then(function () { 7922 return e = t.v, n = r, e.rb.then(function () { 7923 return new fe(function (t) { 7924 e.a.send(n.type, n, t, mr("gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER")) 7925 }) 7926 }); 7927 var e, n 7928 }).then(function (t) { 7929 if (t && t.length && void 0 !== t[0].webStorageSupport) return t[0].webStorageSupport; 7930 throw Error() 7931 }).then(function (t) { 7932 t || (e && nr(e), n(i), s = !0) 7933 }) 7934 }).o(function () {}).then(function () { 7935 if (!s) return n = e, new fe(function (e) { 7936 return function t() { 7937 gn(2e3).then(function () { 7938 return n && !n.closed ? t() : void e() 7939 }) 7940 }() 7941 }); 7942 var n 7943 }).then(function () { 7944 if (!s) return gn(t).then(function () { 7945 n(r) 7946 }) 7947 }) 7948 }, t.Xb = function () { 7949 var t = yr(); 7950 return !Tr(t) && !Ar(t) 7951 }, t.Tb = function () { 7952 return !1 7953 }, t.Mb = function (e, t, n, r, i, o, s, a) { 7954 if (!e) return we(new I("popup-blocked")); 7955 if (s && !Tr()) return this.ma().o(function (t) { 7956 nr(e), i(t) 7957 }), r(), be(); 7958 this.a || (this.a = ou(au(this))); 7959 var u = this; 7960 return this.a.then(function () { 7961 var t = u.ma().o(function (t) { 7962 throw nr(e), i(t), t 7963 }); 7964 return r(), t 7965 }).then(function () { 7966 ko(n), s || tr(uu(u.s, u.g, u.b, t, n, null, o, u.c, void 0, u.i, a, u.f), e) 7967 }).o(function (t) { 7968 throw "auth/network-request-failed" == t.code && (u.a = null), t 7969 }) 7970 }, t.Nb = function (t, e, n, r) { 7971 this.a || (this.a = ou(au(this))); 7972 var i = this; 7973 return this.a.then(function () { 7974 ko(e), tr(uu(i.s, i.g, i.b, t, e, Zn(), n, i.c, void 0, i.i, r, i.f)) 7975 }).o(function (t) { 7976 throw "auth/network-request-failed" == t.code && (i.a = null), t 7977 }) 7978 }, t.ma = function () { 7979 var t = this; 7980 return su(this).then(function () { 7981 return t.v.rb 7982 }).o(function () { 7983 throw t.a = null, new I("network-request-failed") 7984 }) 7985 }, t.$b = function () { 7986 return !0 7987 }, t.Ea = function (t) { 7988 this.h.push(t) 7989 }, t.Sa = function (e) { 7990 H(this.h, function (t) { 7991 return t == e 7992 }) 7993 }, (t = cu.prototype).get = function (t) { 7994 return be(this.a.getItem(t)).then(function (t) { 7995 return t && Cr(t) 7996 }) 7997 }, t.set = function (t, e) { 7998 return be(this.a.setItem(t, Er(e))) 7999 }, t.U = function (t) { 8000 return be(this.a.removeItem(t)) 8001 }, t.ca = function () {}, t.ia = function () {}; 8002 var lu, fu = []; 8003 8004 function pu(t, e, n) { 8005 ut(t.a) && t.b.addEventListener("message", t.f), void 0 === t.a[e] && (t.a[e] = []), t.a[e].push(n) 8006 } 8007 8008 function du(t) { 8009 this.a = t 8010 } 8011 8012 function vu(t) { 8013 this.c = t, this.b = !1, this.a = [] 8014 } 8015 8016 function gu(r, t, e, n) { 8017 var i, o, s, a, u = e || {}, 8018 c = null; 8019 if (r.b) return we(Error("connection_unavailable")); 8020 var h = n ? 800 : 50, 8021 l = "undefined" != typeof MessageChannel ? new MessageChannel : null; 8022 return new fe(function (e, n) { 8023 l ? (i = Math.floor(Math.random() * Math.pow(10, 20)).toString(), l.port1.start(), s = setTimeout(function () { 8024 n(Error("unsupported_event")) 8025 }, h), c = { 8026 messageChannel: l, 8027 onMessage: o = function (t) { 8028 t.data.eventId === i && ("ack" === t.data.status ? (clearTimeout(s), a = setTimeout(function () { 8029 n(Error("timeout")) 8030 }, 3e3)) : "done" === t.data.status ? (clearTimeout(a), void 0 !== t.data.response ? e(t.data.response)
8030: n(Error("unknown_error"))) : (clearTimeout(s), clearTimeout(a), n(Error("invalid_response")))) 8031 } 8032 }, r.a.push(c), l.port1.addEventListener("message", o), r.c.postMessage({ 8033 eventType: t, 8034 eventId: i, 8035 data: u 8036 }, [l.port2])) : n(Error("connection_unavailable")) 8037 }).then(function (t) { 8038 return yu(r, c), t 8039 }).o(function (t) { 8040 throw yu(r, c), t 8041 }) 8042 } 8043 8044 function yu(t, e) { 8045 var n, r; 8046 e && (n = e.messageChannel, r = e.onMessage, n && (n.port1.removeEventListener("message", r), n.port1.close()), H(t.a, function (t) { 8047 return t == e 8048 })) 8049 } 8050 8051 function mu() { 8052 if (!Iu()) throw new I("web-storage-unsupported"); 8053 this.c = {}, this.a = [], this.b = 0, this.m = l.indexedDB, this.type = "indexedDB", this.g = this.v = this.f = this.l = null, this.s = !1, this.h = null; 8054 var t, e, n, r = this; 8055 cr() && self ? (this.v = (n = cr() ? self : null, j(fu, function (t) { 8056 t.b == n && (e = t) 8057 }), e || (e = new hu(n), fu.push(e)), e), pu(this.v, "keyChanged", function (t, n) { 8058 return Nu(r).then(function (e) { 8059 return 0 < e.length && j(r.a, function (t) { 8060 t(e) 8061 }), { 8062 keyProcessed: K(e, n.key) 8063 } 8064 }) 8065 }), pu(this.v, "ping", function () { 8066 return be(["keyChanged"]) 8067 })) : ((t = l.navigator) && t.serviceWorker ? be().then(function () { 8068 return t.serviceWorker.ready 8069 }).then(function (t) { 8070 return t.active || null 8071 }).o(function () { 8072 return null 8073 }) : be(null)).then(function (t) { 8074 (r.h = t) && (r.g = new vu(new du(t)), gu(r.g, "ping", null, !0).then(function (t) { 8075 t[0].fulfilled && K(t[0].value, "keyChanged") && (r.s = !0) 8076 }).o(function () {})) 8077 }) 8078 } 8079 8080 function bu(i) { 8081 return new fe(function (e, n) { 8082 var t = i.m.open("firebaseLocalStorageDb", 1); 8083 t.onerror = function (t) { 8084 try { 8085 t.preventDefault() 8086 } catch (t) {} 8087 n(Error(t.target.error)) 8088 }, t.onupgradeneeded = function (t) { 8089 t = t.target.result; 8090 try { 8091 t.createObjectStore("firebaseLocalStorage", { 8092 keyPath: "fbase_key" 8093 }) 8094 } catch (t) { 8095 n(t) 8096 } 8097 }, t.onsuccess = function (t) { 8098 var r; 8099 (t = t.target.result).objectStoreNames.contains("firebaseLocalStorage") ? e(t) : (r = i, new fe(function (t, e) { 8100 var n = r.m.deleteDatabase("firebaseLocalStorageDb"); 8101 n.onsuccess = function () { 8102 t() 8103 }, n.onerror = function (t) { 8104 e(Error(t.target.error)) 8105 } 8106 }).then(function () { 8107 return bu(i) 8108 }).then(function (t) { 8109 e(t) 8110 }).o(function (t) { 8111 n(t) 8112 })) 8113 } 8114 }) 8115 } 8116 8117 function wu(t) { 8118 return t.i || (t.i = bu(t)), t.i 8119 } 8120 8121 function _u(i, t) { 8122 var o = 0; 8123 return new fe(function e(n, r) { 8124 wu(i).then(t).then(n).o(function (t) { 8125 return 3 < ++o ? void r(t) : wu(i).then(function (t) { 8126 return t.close(), i.i = void 0, e(n, r) 8127 }).o(function (t) { 8128 r(t) 8129 }) 8130 }) 8131 }) 8132 } 8133 8134 function Iu() { 8135 try { 8136 return l.indexedDB 8137 } catch (t) { 8138 return 8139 } 8140 } 8141 8142 function Tu(t) { 8143 return t.objectStore("firebaseLocalStorage") 8144 } 8145 8146 function Eu(t, e) { 8147 return t.transaction(["firebaseLocalStorage"], e ? "readwrite" : "readonly") 8148 } 8149 8150 function Su(t) { 8151 return new fe(function (e, n) { 8152 t.onsuccess = function (t) { 8153 t && t.target ? e(t.target.result) : e() 8154 }, t.onerror = function (t) { 8155 n(t.target.error) 8156 } 8157 }) 8158 } 8159 8160 function Cu(t, e) { 8161 return t.g && t.h && ((n = l.navigator) && n.serviceWorker && n.serviceWorker.controller || null) === t.h ? gu(t.g, "keyChanged", { 8162 key: e 8163 }, t.s).then(function () {}).o(function () {}) : be(); 8164 var n 8165 } 8166 8167 function Nu(r) { 8168 return wu(r).then(function (t) { 8169 var i = Tu(Eu(t, !1)); 8170 return i.getAll ? Su(i.getAll()) : new fe(function (e, n) { 8171 var r = [], 8172 t = i.openCursor(); 8173 t.onsuccess = function (t) { 8174 (t = t.target.result) ? (r.push(t.value), t.continue()) : e(r) 8175 }, t.onerror = function (t) { 8176 n(t.target.error) 8177 } 8178 }) 8179 }).then(function (t) { 8180 var e = {}, 8181 n = []; 8182 if (0 == r.b) { 8183 for (n = 0; n < t.length; n++) e[t[n].fbase_key] = t[n].value; 8184 n = function t(e, n) { 8185 var r, i = []; 8186 for (r in e) r in n && typeof e[r] == typeof n[r] ? "object" == typeof e[r] && null != e[r] && null != n[r] ? 0 < t(e[r], n[r]).length && i.push(r) : e[r] !== n[r] && i.push(r) : i.push(r); 8187 for (r in n) r in e || i.push(r); 8188 return i 8189 }(r.c, e), r.c = e 8190 } 8191 return n 8192 }) 8193 } 8194 8195 function Au(t) { 8196 t.l && t.l.cancel("STOP_EVENT"), t.f && (clearTimeout(t.f), t.f = null) 8197 } 8198 8199 function ku(t) { 8200 var r = this, 8201 i = null; 8202 this.a = [], this.type = "indexedDB", this.c = t, this.b = be().then(function () { 8203 if (Iu()) { 8204 var e = Nr(), 8205 n = "__sak" + e; 8206 return lu = lu || new mu, (i = lu).set(n, e).then(function () { 8207 return i.get(n) 8208 }).then(function (t) { 8209 if (t !== e) throw Error("indexedDB not supported!"); 8210 return i.U(n) 8211 }).then(function () { 8212 return i 8213 }).o(function () { 8214 return r.c 8215 }) 8216 } 8217 return r.c 8218 }).then(function (t) { 8219 return r.type = t.type, t.ca(function (e) { 8220 j(r.a, function (t) { 8221 t(e) 8222 }) 8223 }), t 8224 }) 8225 } 8226 8227 function Ru() { 8228 this.a = {}, this.type = "inMemory" 8229 } 8230 8231 function Pu() { 8232 if (! function () { 8233 var t = "Node" == hr(); 8234 if (!(t = Ou() || t && Xl.INTERNAL.node && Xl.INTERNAL.node.localStorage)) return !1; 8235 try { 8236 return t.setItem("__sak", "1"), t.removeItem("__sak"), !0 8237 } catch (t) { 8238 return !1 8239 } 8240 }()) { 8241 if ("Node" == hr()) throw new I("internal-error", "The LocalStorage compatibility library was not found."); 8242 throw new I("web-storage-unsupported") 8243 } 8244 this.a = Ou() || Xl.INTERNAL.node.localStorage, this.type = "localStorage" 8245 } 8246 8247 function Ou() { 8248 try { 8249 var t = l.localStorage, 8250 e = Nr(); 8251 return t && (t.setItem(e, "1"), t.removeItem(e)), t 8252 } catch (t) { 8253 return null 8254 } 8255 } 8256 8257 function Du() { 8258 this.type = "nullStorage" 8259 } 8260 8261 function xu() { 8262 if (! function () { 8263 var t = "Node" == hr(); 8264 if (!(t = Lu() || t && Xl.INTERNAL.node && Xl.INTERNAL.node.sessionStorage)) return !1; 8265 try { 8266 return t.setItem("__sak", "1"), t.removeItem("__sak"), !0 8267 } catch (t) { 8268 return !1 8269 } 8270 }()) { 8271 if ("Node" == hr()) throw new I("internal-error", "The SessionStorage compatibility library was not found."); 8272 throw new I("web-storage-unsupported") 8273 } 8274 this.a = Lu() || Xl.INTERNAL.node.sessionStorage, this.type = "sessionStorage" 8275 } 8276 8277 function Lu() { 8278 try { 8279 var t = l.sessionStorage, 8280 e = Nr(); 8281 return t && (t.setItem(e, "1"), t.removeItem(e)), t 8282 } catch (t) { 8283 return null 8284 } 8285 } 8286 8287 function Mu() { 8288 var t = {}; 8289 t.Browser = ju, t.Node = qu, t.ReactNative = Vu, t.Worker = Bu, this.a = t[hr()] 8290 } 8291 hu.prototype.c = function (n) { 8292 var e, r = n.data.eventType, 8293 i = n.data.eventId, 8294 t = this.a[r]; 8295 t && 0 < t.length && (n.ports[0].postMessage({ 8296 status: "ack", 8297 eventId: i, 8298 eventType: r, 8299 response: null 8300 }), e = [], j(t, function (t) { 8301 e.push(be().then(function () { 8302 return t(n.origin, n.data.data) 8303 })) 8304 }), Ie(e).then(function (t) { 8305 var e = []; 8306 j(t, function (t) { 8307 e.push({ 8308 fulfilled: t.Pb, 8309 value: t.value, 8310 reason: t.reason ? t.reason.message : void 0 8311 }) 8312 }), j(e, function (t) { 8313 for (var e in t) void 0 === t[e] && delete t[e] 8314 }), n.ports[0].postMessage({ 8315 status: "done", 8316 eventId: i, 8317 eventType: r, 8318 response: e 8319 }) 8320 })) 8321 }, du.prototype.postMessage = function (t, e) { 8322 this.a.postMessage(t, e) 8323 }, vu.prototype.close = function () { 8324 for (; 0 < this.a.length;) yu(this, this.a[0]); 8325 this.b = !0 8326 }, (t = mu.prototype).set = function (r, i) { 8327 var o = this, 8328 s = !1; 8329 return _u(this, function (t) { 8330 return Su((t = Tu(Eu(t, !0))).get(r)) 8331 }).then(function (n) { 8332 return _u(o, function (t) { 8333 if (t = Tu(Eu(t, !0)), n) return n.value = i, Su(t.put(n)); 8334 o.b++, s = !0; 8335 var e = {}; 8336 return e.fbase_key = r, e.value = i, Su(t.add(e)) 8337 }) 8338 }).then(function () { 8339 return o.c[r] = i, Cu(o, r) 8340 }).oa(function () { 8341 s && o.b-- 8342 }) 8343 }, t.get = function (e) { 8344 return _u(this, function (t) { 8345 return Su(Tu(Eu(t, !1)).get(e)) 8346 }).then(function (t) { 8347 return t && t.value 8348 }) 8349 }, t.U = function (e) { 8350 var n = this, 8351 r = !1; 8352 return _u(this, function (t) { 8353 return r = !0, n.b++, Su(Tu(Eu(t, !0)).delete(e)) 8354 }).then(function () { 8355 return delete n.c[e], Cu(n, e) 8356 }).oa(function () { 8357 r && n.b-- 8358 }) 8359 }, t.ca = function (t) { 8360 var n; 8361 0 == this.a.length && (Au(n = this), function e() { 8362 n.f = setTimeout(function () { 8363 n.l = Nu(n).then(function (e) { 8364 0 < e.length && j(n.a, function (t) { 8365 t(e) 8366 }) 8367 }).then(function () { 8368 e() 8369 }).o(function (t) { 8370 "STOP_EVENT" != t.message && e() 8371 }) 8372 }, 800) 8373 }()), this.a.push(t) 8374 }, t.ia = function (e) { 8375 H(this.a, function (t) { 8376 return t == e 8377 }), 0 == this.a.length && Au(this) 8378 }, (t = ku.prototype).get = function (e) { 8379 return this.b.then(function (t) { 8380 return t.get(e) 8381 }) 8382 }, t.set = function (e, n) { 8383 return this.b.then(function (t) { 8384 return t.set(e, n) 8385 }) 8386 }, t.U = function (e) { 8387 return this.b.then(function (t) { 8388 return t.U(e) 8389 }) 8390 }, t.ca = function (t) { 8391 this.a.push(t) 8392 }, t.ia = function (e) { 8393 H(this.a, function (t) { 8394 return t == e 8395 }) 8396 }, (t = Ru.prototype).get = function (t) { 8397 return be(this.a[t]) 8398 }, t.set = function (t, e) { 8399 return this.a[t] = e, be() 8400 }, t.U = function (t) { 8401 return delete this.a[t], be() 8402 }, t.ca = function () {}, t.ia = function () {}, (t = Pu.prototype).get = function (t) { 8403 var e = this; 8404 return be().then(function () { 8405 return Cr(e.a.getItem(t)) 8406 }) 8407 }, t.set = function (e, n) { 8408 var r = this; 8409 return be().then(function () { 8410 var t = Er(n); 8411 null === t ? r.U(e) : r.a.setItem(e, t) 8412 }) 8413 }, t.U = function (t) { 8414 var e = this; 8415 return be().then(function () { 8416 e.a.removeItem(t) 8417 }) 8418 }, t.ca = function (t) { 8419 l.window && $e(l.window, "storage", t) 8420 }, t.ia = function (t) { 8421 l.window && en(l.window, "storage", t) 8422 }, (t = Du.prototype).get = function () { 8423 return be(null) 8424 }, t.set = function () { 8425 return be() 8426 }, t.U = function () { 8427 return be() 8428 }, t.ca = function () {}, t.ia = function () {}, (t = xu.prototype).get = function (t) { 8429 var e = this; 8430 return be().then(function () { 8431 return Cr(e.a.getItem(t)) 8432 }) 8433 }, t.set = function (e, n) { 8434 var r = this; 8435 return be().then(function () { 8436 var t = Er(n); 8437 null === t ? r.U(e) : r.a.setItem(e, t) 8438 }) 8439 }, t.U = function (t) { 8440 var e = this; 8441 return be().then(function () { 8442 e.a.removeItem(t) 8443 }) 8444 }, t.ca = function () {}, t.ia = function () {}; 8445 var Fu, Uu, ju = { 8446 F: Pu, 8447 bb: xu 8448 }, 8449 qu = { 8450 F: Pu, 8451 bb: xu 8452 }, 8453 Vu = { 8454 F: cu, 8455 bb: Du 8456 }, 8457 Bu = { 8458 F: Pu, 8459 bb: Du 8460 }, 8461 Ku = { 8462 rd: "local", 8463 NONE: "none", 8464 td: "session" 8465 }; 8466 8467 function Wu() { 8468 var t = !(Ar(yr()) || !ur()), 8469 e = Tr(), 8470 n = br(); 8471 this.m = t, this.h = e, this.l = n, this.a = {}, t = Fu = Fu || new Mu; 8472 try { 8473 this.g = !$n() && xr() || !l.indexedDB ? new t.a.F : new ku(new(cr() ? Ru : t.a.F)) 8474 } catch (t) { 8475 this.g = new Ru, this.h = !0 8476 } 8477 try { 8478 this.i = new t.a.bb 8479 } catch (t) { 8480 this.i = new Ru 8481 } 8482
8482 this.v = new Ru, this.f = m(this.Yb, this), this.b = {} 8483 } 8484 8485 function Hu() { 8486 return Uu = Uu || new Wu 8487 } 8488 8489 function Gu(t, e) { 8490 switch (e) { 8491 case "session": 8492 return t.i; 8493 case "none": 8494 return t.v; 8495 default: 8496 return t.g 8497 } 8498 } 8499 8500 function zu(t, e) { 8501 return "firebase:" + t.name + (e ? ":" + e : "") 8502 } 8503 8504 function Qu(t, e, n) { 8505 return n = zu(e, n), "local" == e.F && (t.b[n] = null), Gu(t, e.F).U(n) 8506 } 8507 8508 function Yu(t) { 8509 t.c && (clearInterval(t.c), t.c = null) 8510 } 8511 8512 function Xu(t) { 8513 this.a = t, this.b = Hu() 8514 }(t = Wu.prototype).get = function (t, e) { 8515 return Gu(this, t.F).get(zu(t, e)) 8516 }, t.set = function (e, t, n) { 8517 var r = zu(e, n), 8518 i = this, 8519 o = Gu(this, e.F); 8520 return o.set(r, t).then(function () { 8521 return o.get(r) 8522 }).then(function (t) { 8523 "local" == e.F && (i.b[r] = t) 8524 }) 8525 }, t.addListener = function (t, e, n) { 8526 var r; 8527 t = zu(t, e), this.l && (this.b[t] = l.localStorage.getItem(t)), ut(this.a) && (Gu(this, "local").ca(this.f), this.h || ($n() || !xr()) && l.indexedDB || !this.l || (Yu(r = this), r.c = setInterval(function () { 8528 for (var t in r.a) { 8529 var e = l.localStorage.getItem(t), 8530 n = r.b[t]; 8531 e != n && (r.b[t] = e, e = new Ve({ 8532 type: "storage", 8533 key: t, 8534 target: window, 8535 oldValue: n, 8536 newValue: e, 8537 a: !0 8538 }), r.Yb(e)) 8539 } 8540 }, 1e3))), this.a[t] || (this.a[t] = []), this.a[t].push(n) 8541 }, t.removeListener = function (t, e, n) { 8542 t = zu(t, e), this.a[t] && (H(this.a[t], function (t) { 8543 return t == n 8544 }), 0 == this.a[t].length && delete this.a[t]), ut(this.a) && (Gu(this, "local").ia(this.f), Yu(this)) 8545 }, t.Yb = function (t) { 8546 if (t && t.g) { 8547 var e = t.a.key; 8548 if (null == e) 8549 for (var n in this.a) { 8550 var r = this.b[n]; 8551 void 0 === r && (r = null); 8552 var i = l.localStorage.getItem(n); 8553 i !== r && (this.b[n] = i, this.mb(n)) 8554 } else if (0 == e.indexOf("firebase:") && this.a[e]) { 8555 if (void 0 !== t.a.a ? Gu(this, "local").ia(this.f) : Yu(this), this.m) 8556 if (n = l.localStorage.getItem(e), (r = t.a.newValue) !== n) null !== r ? l.localStorage.setItem(e, r) : l.localStorage.removeItem(e); 8557 else if (this.b[e] === r && void 0 === t.a.a) return; 8558 var o = this, 8559 n = function () { 8560 void 0 === t.a.a && o.b[e] === l.localStorage.getItem(e) || (o.b[e] = l.localStorage.getItem(e), o.mb(e)) 8561 }; 8562 Bt && $t && 10 == $t && l.localStorage.getItem(e) !== t.a.newValue && t.a.newValue !== t.a.oldValue ? setTimeout(n, 10) : n() 8563 } 8564 } else j(t, m(this.mb, this)) 8565 }, t.mb = function (t) { 8566 this.a[t] && j(this.a[t], function (t) { 8567 t() 8568 }) 8569 }; 8570 var Ju, $u = { 8571 name: "authEvent", 8572 F: "local" 8573 }; 8574 8575 function Zu() { 8576 this.a = Hu() 8577 } 8578 8579 function tc(t, e) { 8580 this.b = ec, this.f = l.Uint8Array ? new Uint8Array(this.b) : Array(this.b), this.g = this.c = 0, this.a = [], this.i = t, this.h = e, this.l = l.Int32Array ? new Int32Array(64) : Array(64), void 0 === Ju && (Ju = l.Int32Array ? new Int32Array(uc) : uc), this.reset() 8581 } 8582 w(tc, function () { 8583 this.b = -1 8584 }); 8585 for (var ec = 64, nc = ec - 1, rc = [], ic = 0; ic < nc; ic++) rc[ic] = 0; 8586 var oc = G(128, rc); 8587 8588 function sc(t) { 8589 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; 8590 for (e = 16; e < 64; e++) { 8591 var i = 0 | n[e - 15], 8592 r = 0 | n[e - 2], 8593 o = (0 | n[e - 16]) + ((i >>> 7 | i << 25) ^ (i >>> 18 | i << 14) ^ i >>> 3) | 0, 8594 s = (0 | n[e - 7]) + ((r >>> 17 | r << 15) ^ (r >>> 19 | r << 13) ^ r >>> 10) | 0; 8595 n[e] = o + s | 0 8596 } 8597 r = 0 | t.a[0], i = 0 | t.a[1]; 8598 var a = 0 | t.a[2],
8599 u = 0 | t.a[3], 8600 c = 0 | t.a[4], 8601 h = 0 | t.a[5], 8602 l = 0 | t.a[6]; 8603 for (o = 0 | t.a[7], e = 0; e < 64; e++) { 8604 var f = ((r >>> 2 | r << 30) ^ (r >>> 13 | r << 19) ^ (r >>> 22 | r << 10)) + (r & i ^ r & a ^ i & a) | 0; 8605 s = (o = o + ((c >>> 6 | c << 26) ^ (c >>> 11 | c << 21) ^ (c >>> 25 | c << 7)) | 0) + ((s = (s = c & h ^ ~c & l) + (0 | Ju[e]) | 0) + (0 | n[e]) | 0) | 0, o = l, l = h, h = c, c = u + s | 0, u = a, a = i, i = r, r = s + f | 0 8606 } 8607 t.a[0] = t.a[0] + r | 0, t.a[1] = t.a[1] + i | 0, t.a[2] = t.a[2] + a | 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 8608 } 8609 8610 function ac(t, e, n) { 8611 void 0 === n && (n = e.length); 8612 var r = 0, 8613 i = t.c; 8614 if ("string" == typeof e) 8615 for (; r < n;) t.f[i++] = e.charCodeAt(r++), i == t.b && (sc(t), i = 0); 8616 else { 8617 if (!d(e)) throw Error("message must be string or array"); 8618 for (; r < n;) { 8619 var o = e[r++]; 8620 if (!("number" == typeof o && 0 <= o && o <= 255 && o == (0 | o))) throw Error("message must be a byte array"); 8621 t.f[i++] = o, i == t.b && (sc(t), i = 0) 8622 } 8623 } 8624 t.c = i, t.g += n 8625 } 8626 tc.prototype.reset = function () { 8627 this.g = this.c = 0, this.a = l.Int32Array ? new Int32Array(this.h) : z(this.h) 8628 }; 8629 var uc = [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]; 8630 8631 function cc() { 8632 tc.call(this, 8, hc) 8633 } 8634 w(cc, tc); 8635 var hc = [1779033703, 3144134277, 1013904242, 2773480762, 1359893119, 2600822924, 528734635, 1541459225]; 8636 8637 function lc(t, e, n, r, i, o) { 8638 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 Zu, this.g = new Xu(this.h), this.f = null, this.b = [], this.a = this.c = null 8639 } 8640 8641 function fc(t) { 8642 return new I("invalid-cordova-configuration", t) 8643 } 8644 8645 function pc(t) { 8646 var e = new cc; 8647 ac(e, t), t = []; 8648 var n = 8 * e.g; 8649 e.c < 56 ? ac(e, oc, 56 - e.c) : ac(e, oc, e.b - (e.c - 56)); 8650 for (var r = 63; 56 <= r; r--) e.f[r] = 255 & n, n /= 256; 8651 for (sc(e), r = n = 0; r < e.i; r++) 8652 for (var i = 24; 0 <= i; i -= 8) t[n++] = e.a[r] >> i & 255; 8653 return V(t, function (t) { 8654 return 1 < (t = t.toString(16)).length ? t : "0" + t 8655 }).join("") 8656 } 8657 8658 function dc(t, e) { 8659 for (var n = 0; n < t.b.length; n++) try { 8660 t.b[n](e) 8661 } catch (t) {} 8662 } 8663 8664 function vc(a) { 8665 return a.f || (a.f = a.ma().then(function () { 8666 return new fe(function (n) { 8667 function e(r) { 8668 t = !0, s && s.cancel(), gc(i).then(function (t) { 8669 var e, n = o; 8670 t && r && r.url && (e = null, n = (e = -1 != (n = Qi(r.url)).indexOf("/__/auth/callback") ? (e = "object" == typeof (e = Cr(An(e = kn(n), "firebaseError") || null)) ? T(e) : null) ? new Ro(t.c, t.b, null, null, e, null, t.T()) : new Ro(t.c, t.b, n, t.f, null, null, t.T()) : e) || o), dc(i, n) 8671 }) 8672 } 8673 var i, o, t, s, r; 8674 a.Ea(function t(e) { 8675 return n(e), a.Sa(t), !1 8676 }), i = a, o = new Ro("unknown", null, null, null, new I("no-auth-event")), t = !1, s = gn(500).then(function () { 8677 return gc(i).then(function () { 8678 t || dc(i, o) 8679 }) 8680 }), r = l.handleOpenURL, l.handleOpenURL = function (t) { 8681 if (0 == t.toLowerCase().indexOf(mr("BuildInfo.packageName", l).toLowerCase() + "://") && e({ 8682 url: t 8683 }), "function" == typeof r) try { 8684 r(t) 8685 } catch (t) { 8686 console.error(t) 8687 } 8688 }, xo = xo || new Oo, 8689 function (t) { 8690 var n = xo; 8691 n.a.push(t), n.b || (n.b = function (t) { 8692 for (var e = 0; e < n.a.length; e++) n.a[e](t) 8693 }, "function" == typeof (t = mr("universalLinks.subscribe", l)) && t(null, n.b)) 8694 }(e) 8695 }) 8696 })), a.f 8697 } 8698 8699 function gc(e) { 8700 var t, n = null; 8701 return (t = e.g).b.get($u, t.a).then(Po).then(function (t) { 8702 return n = t, Qu((t = e.g).b, $u, t.a) 8703 }).then(function () { 8704 return n 8705 }) 8706 } 8707 8708 function yc(t) { 8709 this.a = t, this.b = Hu() 8710 }(t = lc.prototype).ma = function () { 8711 return this.Ia || (this.Ia = (ar(void 0) ? sr().then(function () { 8712 return new fe(function (t, e) { 8713 var n = l.document, 8714 r = setTimeout(function () { 8715 e(Error("Cordova framework is not ready.")) 8716 }, 1e3); 8717 n.addEventListener("deviceready", function () { 8718 clearTimeout(r), t() 8719 }, !1) 8720 }) 8721 }) : we(Error("Cordova must run in an Android or iOS file scheme."))).then(function () { 8722 if ("function" != typeof mr("universalLinks.subscribe", l)) throw fc("cordova-universal-links-plugin-fix is not installed"); 8723 if (void 0 === mr("BuildInfo.packageName", l)) throw fc("cordova-plugin-buildinfo is not installed"); 8724 if ("function" != typeof mr("cordova.plugins.browsertab.openUrl", l)) throw fc("cordova-plugin-browsertab is not installed"); 8725 if ("function" != typeof mr("cordova.InAppBrowser.open", l)) throw fc("cordova-plugin-inappbrowser is not installed") 8726 }, function () { 8727 throw new I("cordova-not-ready") 8728 })) 8729 }, t.Ob = function (t, e) { 8730 return e(new I("operation-not-supported-in-this-environment")), be() 8731 }, t.Mb = function () {
8732 return we(new I("operation-not-supported-in-this-environment")) 8733 }, t.$b = function () { 8734 return !1 8735 }, t.Xb = function () { 8736 return !0 8737 }, t.Tb = function () { 8738 return !0 8739 }, t.Nb = function (t, e, n, r) { 8740 if (this.c) return we(new I("redirect-operation-pending")); 8741 var i = this, 8742 o = l.document, 8743 s = null, 8744 a = null, 8745 u = null, 8746 c = null; 8747 return this.c = be().then(function () { 8748 return ko(e), vc(i) 8749 }).then(function () { 8750 return function (n, t, e, r, i) { 8751 var o = function () { 8752 for (var t = 20, e = []; 0 < t;) e.push("1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".charAt(Math.floor(62 * Math.random()))), t--; 8753 return e.join("") 8754 }(), 8755 s = new Ro(t, r, null, o, new I("no-auth-event"), null, i), 8756 a = mr("BuildInfo.packageName", l); 8757 if ("string" != typeof a) throw new I("invalid-cordova-configuration"); 8758 var u = mr("BuildInfo.displayName", l), 8759 c = {}; 8760 if (yr().toLowerCase().match(/iphone|ipad|ipod/)) c.ibi = a; 8761 else { 8762 if (!yr().toLowerCase().match(/android/)) return we(new I("operation-not-supported-in-this-environment")); 8763 c.apn = a 8764 } 8765 u && (c.appDisplayName = u), o = pc(o), c.sessionId = o; 8766 var h = uu(n.v, n.i, n.l, t, e, null, r, n.m, c, n.u, i, n.s); 8767 return n.ma().then(function () { 8768 var t = n.h; 8769 return n.C.a.set($u, s.w(), t) 8770 }).then(function () { 8771 var t = mr("cordova.plugins.browsertab.isAvailable", l); 8772 if ("function" != typeof t) throw new I("invalid-cordova-configuration"); 8773 var e = null; 8774 t(function (t) { 8775 if (t) { 8776 if ("function" != typeof (e = mr("cordova.plugins.browsertab.openUrl", l))) throw new I("invalid-cordova-configuration"); 8777 e(h) 8778 } else { 8779 if ("function" != typeof (e = mr("cordova.InAppBrowser.open", l))) throw new I("invalid-cordova-configuration"); 8780 t = yr(), n.a = e(h, t.match(/(iPad|iPhone|iPod).*OS 7_\d/i) || t.match(/(iPad|iPhone|iPod).*OS 8_\d/i) ? "_blank" : "_system", "location=yes") 8781 } 8782 }) 8783 }) 8784 }(i, t, e, n, r) 8785 }).then(function () { 8786 return new fe(function (e, t) { 8787 a = function () { 8788 var t = mr("cordova.plugins.browsertab.close", l); 8789 return e(), "function" == typeof t && t(), i.a && "function" == typeof i.a.close && (i.a.close(), i.a = null), !1 8790 }, i.Ea(a), u = function () { 8791 s = s || gn(2e3).then(function () { 8792 t(new I("redirect-cancelled-by-user")) 8793 }) 8794 }, c = function () { 8795 Pr() && u() 8796 }, o.addEventListener("resume", u, !1), yr().toLowerCase().match(/android/) || o.addEventListener("visibilitychange", c, !1) 8797 }).o(function (t) { 8798 return gc(i).then(function () { 8799 throw t 8800 }) 8801 }) 8802 }).oa(function () { 8803 u && o.removeEventListener("resume", u, !1), c && o.removeEventListener("visibilitychange", c, !1), s && s.cancel(), a && i.Sa(a), i.c = null 8804 }) 8805 }, t.Ea = function (e) { 8806 this.b.push(e), vc(this).o(function (t) { 8807 "auth/invalid-cordova-configuration" === t.code && (t = new Ro("unknown", null, null, null, new I("no-auth-event")), e(t)) 8808 }) 8809 }, t.Sa = function (e) { 8810 H(this.b, function (t) { 8811 return t == e 8812 }) 8813 }; 8814 var mc = { 8815 name: "pendingRedirect", 8816 F: "session" 8817 }; 8818 8819 function bc(t) { 8820 return Qu(t.b, mc, t.a) 8821 } 8822 8823 function wc(t, e, n, r) { 8824 this.i = {}, this.u = 0, this.D = t, this.v = e, this.m = n, this.J = r, this.h = [], this.f = !1, this.l = m(this.s, this), this.b = new Lc, this.C = new qc, this.g = new yc(Dc(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 = _c(this.D, this.v, this.m, E, this.J) 8825 } 8826 8827 function _c(t, e, n, r, i) { 8828 var o = Xl.SDK_VERSION || null; 8829 return new(ar() ? lc : iu)(t, e, n, o, r, i) 8830 } 8831 8832 function Ic(e) { 8833 e.f || (e.f = !0, e.a.Ea(e.l)); 8834 var n = e.a; 8835 return e.a.ma().o(function (t) { 8836 throw e.a == n && e.reset(), t 8837 }) 8838 } 8839 8840 function Tc(n) { 8841 n.a.Xb() && Ic(n).o(function (t) { 8842 var e = new Ro("unknown", null, null, null, new I("operation-not-supported-in-this-environment")); 8843 kc(t) && n.s(e) 8844 }), n.a.Tb() || Mc(n.b) 8845 } 8846 8847 function Ec(n, t) { 8848 K(n.h, t) || n.h.push(t), n.f || (t = n.g).b.get(mc, t.a).then(function (t) { 8849 return "pending" == t 8850 }).then(function (t) { 8851 t ? bc(n.g).then(function () { 8852 Ic(n).o(function (t) { 8853 var e = new Ro("unknown", null, null, null, new I("operation-not-supported-in-this-environment")); 8854 kc(t) && n.s(e) 8855 }) 8856 }) : Tc(n) 8857 }).o(function () { 8858 Tc(n) 8859 }) 8860 } 8861 8862 function Sc(t, e) { 8863 H(t.h, function (t) { 8864 return t == e 8865 }) 8866 } 8867 wc.prototype.reset = function () { 8868 this.f = !1, this.a.Sa(this.l), this.a = _c(this.D, this.v, this.m, null, this.J), this.i = {} 8869 }, wc.prototype.s = function (t) { 8870 if (!t) throw new I("invalid-auth-event"); 8871 if (6e5 <= Date.now() - this.u && (this.i = {}, this.u = 0), t && t.getUid() && this.i.hasOwnProperty(t.getUid())) return !1; 8872 for (var e = !1, n = 0; n < this.h.length; n++) { 8873 var r = this.h[n]; 8874 if (r.Fb(t.c, t.b)) { 8875 (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; 8876 break 8877 } 8878 } 8879 return Mc(this.b), e 8880 };
8881 var Cc = new Rr(2e3, 1e4), 8882 Nc = new Rr(3e4, 6e4); 8883 8884 function Ac(t, e, n, r, i, o, s) { 8885 return t.a.Mb(e, n, r, function () { 8886 t.f || (t.f = !0, t.a.Ea(t.l)) 8887 }, function () { 8888 t.reset() 8889 }, i, o, s) 8890 } 8891 8892 function kc(t) { 8893 return !(!t || "auth/cordova-not-ready" != t.code) 8894 } 8895 8896 function Rc(e, t, n, r, i) { 8897 var o, s; 8898 return (s = e.g).b.set(mc, "pending", s.a).then(function () { 8899 return e.a.Nb(t, n, r, i).o(function (t) { 8900 if (kc(t)) throw new I("operation-not-supported-in-this-environment"); 8901 return o = t, bc(e.g).then(function () { 8902 throw o 8903 }) 8904 }).then(function () { 8905 return e.a.$b() ? new fe(function () {}) : bc(e.g).then(function () { 8906 return e.qa() 8907 }).then(function () {}).o(function () {}) 8908 }) 8909 }) 8910 } 8911 8912 function Pc(t, e, n, r, i) { 8913 return t.a.Ob(r, function (t) { 8914 e.na(n, null, t, i) 8915 }, Cc.get()) 8916 } 8917 wc.prototype.qa = function () { 8918 return this.b.qa() 8919 }; 8920 var Oc = {}; 8921 8922 function Dc(t, e, n) { 8923 return t = t + ":" + e, t = n ? t + ":" + n.url : t 8924 } 8925 8926 function xc(t, e, n, r) { 8927 var i = Dc(e, n, r); 8928 return Oc[i] || (Oc[i] = new wc(t, e, n, r)), Oc[i] 8929 } 8930 8931 function Lc() { 8932 this.b = null, this.f = [], this.c = [], this.a = null, this.i = this.g = !1 8933 } 8934 8935 function Mc(t) { 8936 t.g || (t.g = !0, jc(t, !1, null, null)) 8937 } 8938 8939 function Fc(t) { 8940 t.g && !t.i && jc(t, !1, null, null) 8941 } 8942 8943 function Uc(t, e) { 8944 if (t.b = function () { 8945 return be(e) 8946 }, t.f.length) 8947 for (var n = 0; n < t.f.length; n++) t.f[n](e) 8948 } 8949 8950 function jc(t, e, n, r) { 8951 e ? r ? function (t, e) { 8952 if (t.b = function () { 8953 return we(e) 8954 }, t.c.length) 8955 for (var n = 0; n < t.c.length; n++) t.c[n](e) 8956 }(t, r) : Uc(t, n) : Uc(t, { 8957 user: null 8958 }), t.f = [], t.c = [] 8959 } 8960 8961 function qc() {} 8962 8963 function Vc() { 8964 this.ib = !1, Object.defineProperty(this, "appVerificationDisabled", { 8965 get: function () { 8966 return this.ib 8967 }, 8968 set: function (t) { 8969 this.ib = t 8970 }, 8971 enumerable: !1 8972 }) 8973 } 8974 8975 function Bc(t, e) { 8976 this.a = e, jr(this, "verificationId", t) 8977 } 8978 8979 function Kc(t, e, n, r) { 8980 return new Co(t).fb(e, n).then(function (t) { 8981 return new Bc(t, r) 8982 }) 8983 } 8984 8985 function Wc(t) { 8986 var e = xi(t); 8987 if (!(e && e.exp && e.auth_time && e.iat)) throw new I("internal-error", "An internal error occurred. The token obtained by Firebase appears to be malformed. Please retry the operation."); 8988 qr(this, { 8989 token: t, 8990 expirationTime: Dr(1e3 * e.exp), 8991 authTime: Dr(1e3 * e.auth_time), 8992 issuedAtTime: Dr(1e3 * e.iat), 8993 signInProvider: e.firebase && e.firebase.sign_in_provider ? e.firebase.sign_in_provider : null, 8994 signInSecondFactor: e.firebase && e.firebase.sign_in_second_factor ? e.firebase.sign_in_second_factor : null, 8995 claims: e 8996 }) 8997 } 8998 8999 function Hc(t, e, n) { 9000 var r = e && e[zc]; 9001 if (!r) throw new I("argument-error", "Internal assert: Invalid MultiFactorResolver"); 9002 this.a = t, this.f = ct(e), this.g = n, this.c = new Yi(null, r), this.b = []; 9003 var i = this; 9004 j(e[Gc] || [], function (t) {
9005 (t = Wr(t)) && i.b.push(t) 9006 }), jr(this, "auth", this.a), jr(this, "session", this.c), jr(this, "hints", this.b) 9007 } 9008 Lc.prototype.reset = function () { 9009 this.b = null, this.a && (this.a.cancel(), this.a = null) 9010 }, Lc.prototype.h = function (t, e) { 9011 var n, r, i, o; 9012 t ? (this.reset(), this.g = !0, 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 ? (jc(this, !0, null, t.a), be()) : e.Fa(n, r) ? function (e, t, n) { 9013 n = n.Fa(t.c, t.b); 9014 var r = t.g, 9015 i = t.f, 9016 o = t.i, 9017 s = t.T(), 9018 a = !!t.c.match(/Redirect$/); 9019 n(r, i, s, o).then(function (t) { 9020 jc(e, a, t, null) 9021 }).o(function (t) { 9022 jc(e, a, null, t) 9023 }) 9024 }(this, t, e) : we(new I("invalid-auth-event")) : (jc(this, !1, null, null), be())) : we(new I("invalid-auth-event")) 9025 }, Lc.prototype.qa = function () { 9026 var i = this; 9027 return new fe(function (t, e) { 9028 var n, r; 9029 i.b ? i.b().then(t, e) : (i.f.push(t), i.c.push(e), n = i, r = new I("timeout"), n.a && n.a.cancel(), n.a = gn(Nc.get()).then(function () { 9030 n.b || (n.g = !0, jc(n, !0, null, r)) 9031 })) 9032 }) 9033 }, qc.prototype.h = function (t, e) { 9034 var n, r, i, o, s; 9035 t ? (n = t.c, r = t.b, t.a ? (e.na(t.c, null, t.a, t.b), be()) : e.Fa(n, r) ? (i = e, o = (t = t).b, s = t.c, i.Fa(s, o)(t.g, t.f, t.T(), t.i).then(function (t) { 9036 i.na(s, t, null, o) 9037 }).o(function (t) { 9038 i.na(s, null, t, o) 9039 })) : we(new I("invalid-auth-event"))) : we(new I("invalid-auth-event")) 9040 }, Bc.prototype.confirm = function (t) { 9041 return t = No(this.verificationId, t), this.a(t) 9042 }; 9043 var Gc = "mfaInfo", 9044 zc = "mfaPendingCredential"; 9045 9046 function Qc(t, e, n, r) { 9047 I.call(this, "multi-factor-auth-required", r, e), this.b = new Hc(t, e, n), jr(this, "resolver", this.b) 9048 } 9049 9050 function Yc(t, e, n) { 9051 if (t && g(t.serverResponse) && "auth/multi-factor-auth-required" === t.code) try { 9052 return new Qc(e, t.serverResponse, n, t.message) 9053 } catch (t) {} 9054 return null 9055 } 9056 9057 function Xc() {} 9058 9059 function Jc(t) { 9060 jr(this, "factorId", t.fa), this.a = t 9061 } 9062 9063 function $c(t) { 9064 if (Jc.call(this, t), this.a.fa != Co.PROVIDER_ID) throw new I("argument-error", "firebase.auth.PhoneMultiFactorAssertion requires a valid firebase.auth.PhoneAuthCredential") 9065 } 9066 9067 function Zc(t, e) { 9068 for (var n in qe.call(this, t), e) this[n] = e[n] 9069 } 9070 9071 function th(t, e) { 9072 this.a = t, this.b = [], this.c = m(this.yc, this), $e(this.a, "userReloaded", this.c); 9073 var r = []; 9074 e && e.multiFactor && e.multiFactor.enrolledFactors && j(e.multiFactor.enrolledFactors, function (t) { 9075 var e = null, 9076 n = {}; 9077 if (t) { 9078 t.uid && (n[zr] = t.uid), t.displayName && (n[Hr] = t.displayName), t.enrollmentTime && (n[Gr] = new Date(t.enrollmentTime).toISOString()), t.phoneNumber && (n[Qr] = t.phoneNumber); 9079 try { 9080 e = new Yr(n) 9081 } catch (t) {} 9082 t = e 9083 } else t = null; 9084 t && r.push(t) 9085 }), eh(this, r) 9086 } 9087 9088 function eh(t, e) { 9089 t.b = e, jr(t, "enrolledFactors", e) 9090 } 9091 9092 function nh(t, e, n) { 9093 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!") 9094 } 9095 9096 function rh(t, e) { 9097 return e ? (t.a = t.c, t.g()) : (e = t.a, t.a *= 2, t.a > t.f && (t.a = t.f), e) 9098 } 9099 9100 function ih(t) { 9101 this.f = t, this.b = this.a = null, this.c = Date.now() 9102 } 9103 9104 function oh(t, e) { 9105 void 0 === e && (e = t.b ? (e = t.b).a - e.g : 0), t.c = Date.now() + 1e3 * e 9106 } 9107 9108 function sh(t, e) { 9109 t.b = Di(e[Bs] || ""), t.a = e.refreshToken, oh(t, void 0 !== (e = e.expires
9109In) ? Number(e) : void 0) 9110 } 9111 9112 function ah(e, t) { 9113 return r = e.f, i = t, new fe(function (e, n) { 9114 "refresh_token" == i.grant_type && i.refresh_token || "authorization_code" == i.grant_type && i.code ? Js(r, r.l + "?key=" + encodeURIComponent(r.c), function (t) { 9115 t ? t.error ? n(Ya(t)) : t.access_token && t.refresh_token ? e(t) : n(new I("internal-error")) : n(new I("network-request-failed")) 9116 }, "POST", Vn(i).toString(), r.g, r.m.get()) : n(new I("internal-error")) 9117 }).then(function (t) { 9118 return e.b = Di(t.access_token), e.a = t.refresh_token, oh(e, t.expires_in), { 9119 accessToken: e.b.toString(), 9120 refreshToken: e.a 9121 } 9122 }).o(function (t) { 9123 throw "auth/user-token-expired" == t.code && (e.a = null), t 9124 }); 9125 var r, i 9126 } 9127 9128 function uh(t, e) { 9129 this.a = t || null, this.b = e || null, qr(this, { 9130 lastSignInTime: Dr(e || null), 9131 creationTime: Dr(t || null) 9132 }) 9133 } 9134 9135 function ch(t, e, n, r, i, o) { 9136 qr(this, { 9137 uid: t, 9138 displayName: r || null, 9139 photoURL: i || null, 9140 email: n || null, 9141 phoneNumber: o || null, 9142 providerId: e 9143 }) 9144 } 9145 9146 function hh(t, e, n) { 9147 this.J = [], this.l = t.apiKey, this.m = t.appName, this.s = t.authDomain || null; 9148 var r, i = Xl.SDK_VERSION ? gr(Xl.SDK_VERSION) : null; 9149 this.a = new qs(this.l, A(E), i), t.emulatorConfig && Qs(this.a, t.emulatorConfig), this.b = new ih(this.a), mh(this, e[Bs]), sh(this.b, e), jr(this, "refreshToken", this.b.a), _h(this, n || {}), ln.call(this), this.R = !1, this.s && wr() && (this.i = xc(this.s, this.l, this.m)), this.S = [], this.h = null, this.u = (r = this, new nh(function () { 9150 return r.I(!0) 9151 }, function (t) { 9152 return !(!t || "auth/network-request-failed" != t.code) 9153 }, function () { 9154 var t = r.b.c - Date.now() - 3e5; 9155 return 0 < t ? t : 0 9156 })), this.aa = m(this.hb, this); 9157 var o = this; 9158 this.ya = null, this.Oa = function (t) { 9159 o.wa(t.h) 9160 }, this.ja = null, this.Aa = function (t) { 9161 Qs(o.a, t.c) 9162 }, this.X = null, this.$ = [], this.Ba = function (t) { 9163 ph(o, t.f) 9164 }, this.ba = null, this.O = new th(this, n), jr(this, "multiFactor", this.O) 9165 } 9166 9167 function lh(t, e) { 9168 t.ja && en(t.ja, "languageCodeChanged", t.Oa), (t.ja = e) && $e(e, "languageCodeChanged", t.Oa) 9169 } 9170 9171 function fh(t, e) { 9172 t.X && en(t.X, "emulatorConfigChanged", t.Aa), (t.X = e) && $e(e, "emulatorConfigChanged", t.Aa) 9173 } 9174 9175 function ph(t, e) { 9176 t.$ = e, Xs(t.a, Xl.SDK_VERSION ? gr(Xl.SDK_VERSION, t.$) : null) 9177 } 9178 9179 function dh(t, e) { 9180 t.ba && en(t.ba, "frameworkChanged", t.Ba), (t.ba = e) && $e(e, "frameworkChanged", t.Ba) 9181 } 9182 9183 function vh(e) { 9184 try { 9185 return Xl.app(e.m).auth() 9186 } catch (t) { 9187 throw new I("internal-error", "No firebase.auth.Auth instance is available for the Firebase App '" + e.m + "'!") 9188 } 9189 } 9190 9191 function gh(t) { 9192 t.D || t.u.b || (t.u.start(), en(t, "tokenChanged", t.aa), $e(t, "tokenChanged", t.aa)) 9193 } 9194 9195 function yh(t) { 9196 en(t, "tokenChanged", t.aa), t.u.stop() 9197 } 9198 9199 function mh(t, e) { 9200 t.za = e, jr(t, "_lat", e) 9201 } 9202 9203 function bh(t) { 9204 for (var e = [], n = 0; n < t.S.length; n++) e.push(t.S[n](t)); 9205 return Ie(e).then(function () { 9206 return t 9207 }) 9208 } 9209 9210 function wh(t) { 9211 t.i && !t.R && (t.R = !0, Ec(t.i, t)) 9212 } 9213 9214 function _h(t, e) { 9215 qr(t, { 9216 uid: e.uid, 9217 displayName: e.displayName || null, 9218 photoURL: e.photoURL || null, 9219 email: e.email || null, 9220 emailVerified: e.emailVerified || !1, 9221 phoneNumber: e.phoneNumber || null, 9222 isAnonymous: e.isAnonymous || !1, 9223 tenantId: e.tenantId || null, 9224 metadata: new uh(e.createdAt, e.lastLoginAt), 9225 providerData: [] 9226 }), t.a.b = t.tenantId 9227 } 9228 9229 function Ih() {} 9230 9231 function Th(t) { 9232 return be().then(function () { 9233 if (t.D) throw new I("app-deleted") 9234 }) 9235 } 9236 9237 function Eh(t) { 9238 return V(t.providerData, function (t) { 9239 return t.providerId 9240 }) 9241 } 9242 9243 function Sh(t, e) { 9244 e && (Ch(t, e.providerId), t.providerData.push(e)) 9245 } 9246 9247 function Ch(t, e) { 9248 H(t.providerData, function (t) { 9249 return t.providerId == e 9250 }) 9251 } 9252 9253 function Nh(t, e, n) { 9254 ("uid" != e || n) && t.hasOwnProperty(e) && jr(t, e, n) 9255 } 9256 9257 function Ah(e, t) { 9258 var n, r; 9259 e != t && (qr(e, { 9260 uid: t.uid, 9261 displayName: t.displayName, 9262 photoURL: t.photoURL, 9263 email: t.email, 9264 emailVerified: t.emailVerified, 9265 phoneNumber: t.phoneNumber, 9266 isAnonymous: t.isAnonymous, 9267 tenantId: t.tenantId, 9268 providerData: [] 9269 }), t.metadata ? jr(e, "metadata", new uh((r = t.metadata).a, r.b)) : jr(e, "metadata", new uh), j(t.providerData, function (t) { 9270 Sh(e, t) 9271 }), n = e.b, r = t.b, n.b = r.b, n.a = r.a, n.c = r.c, jr(e, "refreshToken", e.b.a), eh(e.O, t.O.b)) 9272 } 9273 9274 function kh(i) { 9275 return i.I().then(function (t) { 9276 var e, n, r = i.isAnonymous; 9277 return n = t, za((e = i).a, Ea, { 9278 idToken: n 9279 }).then(m(e.Kc, e)).then(function () { 9280 return r || Nh(i, "isAnonymous", !1), t 9281 }) 9282 }) 9283 } 9284 9285 function Rh(t, e) {
9286 e[Bs] && t.za != e[Bs] && (sh(t.b, e), t.dispatchEvent(new Zc("tokenChanged")), mh(t, e[Bs]), Nh(t, "refreshToken", t.b.a)) 9287 } 9288 9289 function Ph(t, e) { 9290 return kh(t).then(function () { 9291 if (K(Eh(t), e)) return bh(t).then(function () { 9292 throw new I("provider-already-linked") 9293 }) 9294 }) 9295 } 9296 9297 function Oh(t, e, n) { 9298 return Vr({ 9299 user: t, 9300 credential: Ao(e), 9301 additionalUserInfo: e = ji(e), 9302 operationType: n 9303 }) 9304 } 9305 9306 function Dh(t, e) { 9307 return Rh(t, e), t.reload().then(function () { 9308 return t 9309 }) 9310 } 9311 9312 function xh(n, r, t, e, i) { 9313 if (!wr()) return we(new I("operation-not-supported-in-this-environment")); 9314 if (n.h && !i) return we(n.h); 9315 var o = Ui(t.providerId), 9316 s = Nr(n.uid + ":::"), 9317 a = null, 9318 u = rr(a = (!Tr() || ur()) && n.s && t.isOAuthProvider ? uu(n.s, n.l, n.m, r, t, null, s, Xl.SDK_VERSION || null, null, null, n.tenantId) : a, o && o.ua, o && o.ta); 9319 return e = e().then(function () { 9320 if (Mh(n), !i) return n.I().then(function () {}) 9321 }).then(function () { 9322 return Ac(n.i, u, r, t, s, !!a, n.tenantId) 9323 }).then(function () { 9324 return new fe(function (t, e) { 9325 n.na(r, null, new I("cancelled-popup-request"), n.g || null), n.f = t, n.C = e, n.g = s, n.c = Pc(n.i, n, r, u, s) 9326 }) 9327 }).then(function (t) { 9328 return u && nr(u), t ? Vr(t) : null 9329 }).o(function (t) { 9330 throw u && nr(u), t 9331 }), Fh(n, e, i) 9332 } 9333 9334 function Lh(e, t, n, r, i) { 9335 if (!wr()) return we(new I("operation-not-supported-in-this-environment")); 9336 if (e.h && !i) return we(e.h); 9337 var o = null, 9338 s = Nr(e.uid + ":::"); 9339 return r = r().then(function () { 9340 if (Mh(e), !i) return e.I().then(function () {}) 9341 }).then(function () { 9342 return e.ga = s, bh(e) 9343 }).then(function (t) { 9344 return t = e.ha ? (t = e.ha).b.set(qh, e.w(), t.a) : t 9345 }).then(function () { 9346 return Rc(e.i, t, n, s, e.tenantId) 9347 }).o(function (t) { 9348 if (o = t, e.ha) return Vh(e.ha); 9349 throw o 9350 }).then(function () { 9351 if (o) throw o 9352 }), Fh(e, r, i) 9353 } 9354 9355 function Mh(t) { 9356 if (!t.i || !t.R) { 9357 if (t.i && !t.R) throw new I("internal-error"); 9358 throw new I("auth-domain-config-required") 9359 } 9360 } 9361 9362 function Fh(n, t, e) { 9363 var r, i = (t = t, e = e, (r = n).h && !e ? (t.cancel(), we(r.h)) : t.o(function (t) { 9364 throw !t || "auth/user-disabled" != t.code && "auth/user-token-expired" != t.code || (r.h || r.dispatchEvent(new Zc("userInvalidated")), r.h = t), t 9365 })); 9366 return n.J.push(i), i.oa(function () { 9367 W(n.J, i) 9368 }), i.o(function (t) { 9369 var e = null; 9370 throw (e = t && "auth/multi-factor-auth-required" === t.code ? Yc(t.w(), vh(n), m(n.jc, n)) : e) || t 9371 }) 9372 } 9373 9374 function Uh(t) { 9375 if (!t.apiKey) return null; 9376 var e = { 9377 apiKey: t.apiKey, 9378 authDomain: t.authDomain, 9379 appName: t.appName, 9380 emulatorConfig: t.emulatorConfig 9381 }, 9382 n = {}; 9383 if (!t.stsTokenManager || !t.stsTokenManager.accessToken) return null; 9384 n[Bs] = t.stsTokenManager.accessToken, n.refreshToken = t.stsTokenManager.refreshToken || null; 9385 var r = t.stsTokenManager.expirationTime; 9386 r && (n.expiresIn = (r - Date.now()) / 1e3); 9387 var i = new hh(e, n, t); 9388 return t.providerData && j(t.providerData, function (t) { 9389 t && Sh(i, Vr(t)) 9390 }), t.redirectEventId && (i.ga = t.redirectEventId), i 9391 } 9392 9393 function jh(t) { 9394 this.a = t, this.b = Hu() 9395 } 9396 Hc.prototype.Rc = function (t) { 9397 var n = this; 9398 return t.sb(this.a.a, this.c).then(function (t) { 9399 var e = ct(n.f); 9400 return delete e[Gc], delete e[zc], lt(e, t), n.g(e) 9401 }) 9402 }, w(Qc, I), Xc.prototype.sb = function (t, e, n) { 9403 return e.type == Xi ? (o = this, s = t, a = n, e.Ha().then(function (t) { 9404 return t = { 9405 idToken: t 9406 }, void 0 !== a && (t.displayName = a), lt(t, { 9407 phoneVerificationInfo: So(o.a) 9408 }), za(s, Ia, t) 9409 })) : (r = this, i = t, e.Ha().then(function (t) { 9410 return lt(t = { 9411 mfaPendingCredential: t 9412 }, { 9413 phoneVerificationInfo: So(r.a) 9414 }), za(i, Ta, t) 9415 })); 9416 var r, i, o, s, a 9417 }, w(Jc, Xc), w($c, Jc), w(Zc, qe), (t = th.prototype).yc = function (t) { 9418 var e; 9419 eh(this, (t = t.hd, e = [], j(t.mfaInfo || [], function (t) { 9420 (t = Wr(t)) && e.push(t) 9421 }), e)) 9422 }, t.Rb = function () { 9423 return this.a.I().then(function (t) { 9424 return new Yi(t, null) 9425 }) 9426 }, t.fc = function (e, n) { 9427 var r = this, 9428 i = this.a.a; 9429 return this.Rb().then(function (t) { 9430 return e.sb(i, t, n) 9431 }).then(function (t) { 9432 return Rh(r.a, t), r.a.reload() 9433 }) 9434 }, t.bd = function (t) { 9435 var n = this, 9436 r = "string" == typeof t ? t : t.uid, 9437 e = this.a.a; 9438 return this.a.I().then(function (t) { 9439 return za(e, Ga, { 9440 idToken: t, 9441 mfaEnrollmentId: r 9442 }) 9443 }).then(function (t) { 9444 var e = q(n.b, function (t) { 9445 return t.uid != r 9446 }); 9447 return eh(n, e), Rh(n.a, t), n.a.reload().o(function (t) { 9448 if ("auth/user-token-expired" != t.code) throw t 9449 }) 9450 }) 9451 }, t.w = function () { 9452 return { 9453 multiFactor: { 9454 enrolledFactors: V(this.b, function (t) { 9455 return t.w() 9456 }) 9457 } 9458 } 9459 }, nh.prototype.start = function () { 9460 this.a = this.c, 9461 function e(n, t) { 9462 n.stop(); 9463 n.b = gn(rh(n, t)).then(Or).then(function () { 9464 return n.h() 9465 }).then(function () { 9466 e(n, !0) 9467 }).o(function (t) { 9468 n.i(t) && e(n, !1) 9469 }) 9470 }(this, !0) 9471 }, nh.prototype.stop = function () { 9472 this.b && (this.b.cancel(), this.b = null) 9473 }, ih.prototype.w = function () { 9474 return { 9475 apiKey: this.f.c, 9476 refreshToken: this.a, 9477 accessToken: this.b && this.b.toString(), 9478 expirationTime: this.c 9479 } 9480 }, ih.prototype.getToken = function (t) { 9481 return t = !!t, this.b && !this.a ? we(new I("user-token-expired")) : t || !this.b || Date.now() > this.c - 3e4 ? this.a ? ah(this, { 9482 grant_type: "refresh_token", 9483 refresh_token: this.a 9484 }) : be(null) : be({ 9485 accessToken: this.b.toString(), 9486 refreshToken: this.a 9487 }) 9488 }, uh.prototype.w = function () { 9489 return { 9490 lastLoginAt: this.b, 9491 createdAt: this.a 9492 } 9493 }, w(hh, ln), hh.prototype.wa = function (t) { 9494 this.ya = t, zs(this.a, t) 9495 }, hh.prototype.la = function () { 9496 return this.ya 9497 }, hh.prototype.Ga = function () { 9498 return z(this.$) 9499 }, hh.prototype.hb = function () { 9500 this.u.b && (this.u.stop(), this.u.start()) 9501 }, jr(hh.prototype, "providerId", "firebase"), (t = hh.prototype).reload = function () { 9502 var t = this; 9503 return Fh(this, Th(this).then(function () { 9504 return kh(t).then(function () { 9505 return bh(t) 9506 }).then(Ih) 9507 })) 9508 }, t.oc = function (t) { 9509 return this.I(t).then(function (t) { 9510 return new Wc(t) 9511 }) 9512 }, t.I = function (t) { 9513 var e = this; 9514 return Fh(this, Th(this).then(function () { 9515 return e.b.getToken(t) 9516 }).then(function (t) { 9517 if (!t) throw new I("internal-error"); 9518 return t.accessToken != e.za && (mh(e, t.accessToken), e.dispatchEvent(new Zc("tokenChanged"))), Nh(e, "refreshToken", t.refreshToken), t.accessToken 9519 })) 9520 }, t.Kc = function (t) { 9521 if (!(t = t.users) || !t.length) throw new I("internal-error"); 9522 _h(this, { 9523 uid: (t = t[0]).localId, 9524 displayName: t.displayName, 9525 photoURL: t.photoUrl, 9526 email: t.email, 9527 emailVerified: !!t.emailVerified, 9528 phoneNumber: t.phoneNumber, 9529 lastLoginAt: t.lastLoginAt, 9530 createdAt: t.createdAt, 9531 tenantId: t.tenantId 9532 }); 9533 for (var e, n = (e = (e = t).providerUserInfo) && e.length ? V(e, function (t) { 9534 return new ch(t.rawId, t.providerId, t.email, t.displayName, t.photoUrl, t.phoneNumber) 9535 }) : [], r = 0; r < n.length; r++) Sh(this, n[r]); 9536 Nh(this, "isAnonymous", !(this.email && t.passwordHash || this.providerData && this.providerData.length)), this.dispatchEvent(new Zc("userReloaded", { 9537 hd: t 9538 })) 9539 }, t.Lc = function (t) { 9540 return Fr("firebase.User.prototype.reauthenticateAndRetrieveDataWithCredential is deprecated. Please use firebase.User.prototype.reauthenticateWithCredential instead."), this.tb(t) 9541 }, t.tb = function (t) { 9542 var e = this, 9543 n = null; 9544 return Fh(this, t.c(this.a, this.uid).then(function (t) { 9545 return Rh(e, t), n = Oh(e, t, "reauthenticate"), e.h = null, e.reload() 9546 }).then(function () { 9547 return n 9548 }), !0) 9549 }, t.Cc = function (t) { 9550 return Fr("firebase.User.prototype.linkAndRetrieveDataWithCredential is deprecated. Please use firebase.User.prototype.linkWithCredential instead."), this.qb(t) 9551 }, t.qb = function (e) { 9552 var n = this, 9553 r = null; 9554 return Fh(this, Ph(this, e.providerId).then(function () { 9555 return n.I() 9556 }).then(function (t) { 9557 return e.b(n.a, t) 9558 }).then(function (t) { 9559 return r = Oh(n, t, "link"), Dh(n, t) 9560 }).then(function () { 9561 return r 9562 })) 9563 }, t.Dc = function (t, e) { 9564 var n = this; 9565 return Fh(this, Ph(this, "phone").then(function () { 9566 return Kc(vh(n), t, e, m(n.qb, n)) 9567 })) 9568 }, t.Mc = function (t, e) { 9569 var n = this; 9570 return Fh(this, be().then(function () { 9571 return Kc(vh(n), t, e, m(n.tb, n)) 9572 }), !0) 9573 }, t.Bb = function (e) { 9574 var n = this; 9575 return Fh(this, this.I().then(function (t) { 9576 return n.a.Bb(t, e) 9577 }).then(function (t) { 9578 return Rh(n, t), n.reload() 9579 })) 9580 }, t.ed = function (e) { 9581 var n = this; 9582 return Fh(this, this.I().then(function (t) { 9583 return e.b(n.a, t) 9584 }).then(function (t) { 9585 return Rh(n, t), n.reload() 9586 })) 9587 }, t.Cb = function (e) { 9588 var n = this; 9589 return Fh(this, this.I().then(function (t) { 9590 return n.a.Cb(t, e) 9591 }).then(function (t) { 9592 return Rh(n, t), n.reload() 9593 })) 9594 }, t.Db = function (e) { 9595 if (void 0 === e.displayName && void 0 === e.photoURL) return Th(this); 9596 var n = this; 9597 return Fh(this, this.I().then(function (t) { 9598 return n.a.Db(t, { 9599 displayName: e.displayName, 9600 photoUrl: e.photoURL 9601 }) 9602 }).then(function (t) { 9603 return Rh(n, t), Nh(n, "displayName", t.displayName || null), Nh(n, "photoURL", t.photoUrl || null), j(n.providerData, function (t) { 9604 "password" === t.providerId && (jr(t, "displayName", n.displayName), jr(t, "photoURL", n.photoURL)) 9605 }), bh(n) 9606 }).then(Ih)) 9607 }, t.cd = function (e) { 9608 var n = this; 9609 return Fh(this, kh(this).then(function (t) { 9610 return K(Eh(n), e) ? za(n.a, ba, { 9611 idToken: t, 9612 deleteProvider: [e] 9613 }).then(function (t) { 9614 var e = {}; 9615 return j(t.providerUserInfo || [], function (t) { 9616 e[t.providerId] = !0 9617 }
9617), j(Eh(n), function (t) { 9618 e[t] || Ch(n, t) 9619 }), e[Co.PROVIDER_ID] || jr(n, "phoneNumber", null), bh(n) 9620 }) : bh(n).then(function () { 9621 throw new I("no-such-provider") 9622 }) 9623 })) 9624 }, t.delete = function () { 9625 var e = this; 9626 return Fh(this, this.I().then(function (t) { 9627 return za(e.a, ma, { 9628 idToken: t 9629 }) 9630 }).then(function () { 9631 e.dispatchEvent(new Zc("userDeleted")) 9632 })).then(function () { 9633 for (var t = 0; t < e.J.length; t++) e.J[t].cancel("app-deleted"); 9634 lh(e, null), fh(e, null), dh(e, null), e.J = [], e.D = !0, yh(e), jr(e, "refreshToken", null), e.i && Sc(e.i, e) 9635 }) 9636 }, t.Fb = function (t, e) { 9637 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) 9638 }, t.na = function (t, e, n, r) { 9639 "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) 9640 }, t.Fa = function (t, e) { 9641 return "linkViaPopup" == t && e == (this.g || null) ? m(this.Kb, this) : "reauthViaPopup" == t && e == (this.g || null) ? m(this.Lb, this) : "linkViaRedirect" == t && (this.ga || null) == e ? m(this.Kb, this) : "reauthViaRedirect" == t && (this.ga || null) == e ? m(this.Lb, this) : null 9642 }, t.Ec = function (t) { 9643 var e = this; 9644 return xh(this, "linkViaPopup", t, function () { 9645 return Ph(e, t.providerId).then(function () { 9646 return bh(e) 9647 }) 9648 }, !1) 9649 }, t.Nc = function (t) { 9650 return xh(this, "reauthViaPopup", t, function () { 9651 return be() 9652 }, !0) 9653 }, t.Fc = function (t) { 9654 var e = this; 9655 return Lh(this, "linkViaRedirect", t, function () { 9656 return Ph(e, t.providerId) 9657 }, !1) 9658 }, t.Oc = function (t) { 9659 return Lh(this, "reauthViaRedirect", t, function () { 9660 return be() 9661 }, !0) 9662 }, t.Kb = function (e, n, t, r) { 9663 var i = this; 9664 this.c && (this.c.cancel(), this.c = null); 9665 var o = null; 9666 return t = this.I().then(function (t) { 9667 return la(i.a, { 9668 requestUri: e, 9669 postBody: r, 9670 sessionId: n, 9671 idToken: t 9672 }) 9673 }).then(function (t) { 9674 return o = Oh(i, t, "link"), Dh(i, t) 9675 }).then(function () { 9676 return o 9677 }), Fh(this, t) 9678 }, t.Lb = function (t, e, n, r) { 9679 var i = this; 9680 this.c && (this.c.cancel(), this.c = null); 9681 var o = null; 9682 return Fh(this, be().then(function () { 9683 return Zi(fa(i.a, { 9684 requestUri: t, 9685 sessionId: e, 9686 postBody: r, 9687 tenantId: n 9688 }), i.uid) 9689 }).then(function (t) { 9690 return o = Oh(i, t, "reauthenticate"), Rh(i, t), i.h = null, i.reload() 9691 }).then(function () { 9692 return o 9693 }), !0) 9694 }, t.ub = function (e) { 9695 var n = this, 9696 r = null; 9697 return Fh(this, this.I().then(function (t) { 9698 return r = t, void 0 === e || ut(e) ? {} : ki(new bi(e)) 9699 }).then(function (t) { 9700 return n.a.ub(r, t) 9701 }).then(function (t) { 9702 if (n.email != t) return n.reload() 9703 }).then(function () {})) 9704 }, t.Eb = function (e, n) { 9705 var r = this, 9706 i = null; 9707 return Fh(this, this.I().then(function (t) { 9708 return i = t, void 0 === n || ut(n) ? {}
9708 : ki(new bi(n)) 9709 }).then(function (t) { 9710 return r.a.Eb(i, e, t) 9711 }).then(function (t) { 9712 if (r.email != t) return r.reload() 9713 }).then(function () {})) 9714 }, t.jc = function (t) { 9715 var e = null, 9716 n = this; 9717 return Fh(this, t = Zi(be(t), n.uid).then(function (t) { 9718 return e = Oh(n, t, "reauthenticate"), Rh(n, t), n.h = null, n.reload() 9719 }).then(function () { 9720 return e 9721 }), !0) 9722 }, t.toJSON = function () { 9723 return this.w() 9724 }, t.w = function () { 9725 var e = { 9726 uid: this.uid, 9727 displayName: this.displayName, 9728 photoURL: this.photoURL, 9729 email: this.email, 9730 emailVerified: this.emailVerified, 9731 phoneNumber: this.phoneNumber, 9732 isAnonymous: this.isAnonymous, 9733 tenantId: this.tenantId, 9734 providerData: [], 9735 apiKey: this.l, 9736 appName: this.m, 9737 authDomain: this.s, 9738 stsTokenManager: this.b.w(), 9739 redirectEventId: this.ga || null 9740 }; 9741 return this.metadata && lt(e, this.metadata.w()), j(this.providerData, function (t) { 9742 e.providerData.push(function (t) { 9743 var e, n = {}; 9744 for (e in t) t.hasOwnProperty(e) && (n[e] = t[e]); 9745 return n 9746 }(t)) 9747 }), lt(e, this.O.w()), e 9748 }; 9749 var qh = { 9750 name: "redirectUser", 9751 F: "session" 9752 }; 9753 9754 function Vh(t) { 9755 return Qu(t.b, qh, t.a) 9756 } 9757 9758 function Bh(t) { 9759 var e, n, r, i; 9760 this.a = t, this.b = Hu(), this.c = null, this.f = (n = Hh("local"), r = Hh("session"), i = Hh("none"), function (n, r, i) { 9761 var o = zu(r, i), 9762 s = Gu(n, r.F); 9763 return n.get(r, i).then(function (t) { 9764 var e = null; 9765 try { 9766 e = Cr(l.localStorage.getItem(o)) 9767 } catch (t) {} 9768 if (e && !t) return l.localStorage.removeItem(o), n.set(r, e, i); 9769 e && t && "localStorage" != s.type && l.localStorage.removeItem(o) 9770 }) 9771 }((e = this).b, n, e.a).then(function () { 9772 return e.b.get(r, e.a) 9773 }).then(function (t) { 9774 return t ? r : e.b.get(i, e.a).then(function (t) { 9775 return t ? i : e.b.get(n, e.a).then(function (t) { 9776 return t ? n : e.b.get(Wh, e.a).then(function (t) { 9777 return t ? Hh(t) : n 9778 }) 9779 }) 9780 }) 9781 }).then(function (t) { 9782 return e.c = t, Kh(e, t.F) 9783 }).o(function () { 9784 e.c || (e.c = n) 9785 })), this.b.addListener(Hh("local"), this.a, m(this.g, this)) 9786 } 9787 9788 function Kh(t, e) { 9789 var n, a, r = []; 9790 for (n in Ku) Ku[n] !== e && r.push(Qu(t.b, Hh(Ku[n]), t.a)); 9791 return r.push(Qu(t.b, Wh, t.a)), a = r, new fe(function (n, e) { 9792 var r = a.length, 9793 i = []; 9794 if (r) 9795 for (var t = function (t, e) { 9796 r--, i[t] = e, 0 == r && n(i) 9797 }, o = function (t) { 9798 e(t) 9799 }, s = 0; s < a.length; s++) _e(a[s], b(t, s), o); 9800 else n(i) 9801 }) 9802 } 9803 Bh.prototype.g = function () { 9804 var e = this, 9805 n = Hh("local"); 9806 Yh(this, function () { 9807 return be().then(function () { 9808 return e.c && "local" != e.c.F ? e.b.get(n, e.a) : null 9809 }).then(function (t) { 9810 if (t) return Kh(e, "local").then(function () { 9811 e.c = n 9812 }) 9813 }) 9814 }) 9815 }; 9816 var Wh = { 9817 name: "persistence", 9818 F: "session" 9819 }; 9820 9821 function Hh(t) { 9822 return { 9823 name: "authUser", 9824 F: t 9825 } 9826 } 9827 9828 function Gh(t, e) { 9829 return Yh(t, function () { 9830 return t.b.set(t.c, e.w(), t.a) 9831 }) 9832 } 9833 9834 function zh(t) { 9835 return Yh(t, function () { 9836 return Qu(t.b, t.c, t.a) 9837 }) 9838 } 9839 9840 function Qh(t, e, n) { 9841 return Yh(t, function () { 9842 return t.b.get(t.c, t.a).then(function (t) { 9843 return t && e && (t.authDomain = e), t && n && (t.emulatorConfig = n), Uh(t || {}) 9844 }) 9845 }) 9846 } 9847 9848 function Yh(t, e) { 9849 return t.f = t.f.then(e, e), t.f 9850 } 9851 9852 function Xh(t) { 9853 if (this.l = !1, jr(this, "settings", new Vc), jr(this, "app", t), !this.app.options || !this.app.options.apiKey) throw new I("invalid-api-key"); 9854 var n, e, r, i, o, s; 9855 t = Xl.SDK_VERSION ? gr(Xl.SDK_VERSION) : null, this.a = new qs(this.app.options && this.app.options.apiKey, A(E), t), this.R = [], this.s = [], this.O = [], this.hb = Xl.INTERNAL.createSubscribe(m(this.zc, this)), this.X = void 0, this.bc = Xl.INTERNAL.createSubscribe(m(this.Ac, this)), rl(this, null), this.i = new Bh(this.app.options.apiKey + ":" + this.app.name), this.D = new jh(this.app.options.apiKey + ":" + this.app.name), this.$ = ul(this, (e = (n = this).app.options.authDomain, t = function (e) { 9856 var t = function (t, e) { 9857 return t.b.get(qh, t.a).then(function (t) { 9858 return t && e && (t.authDomain = e), Uh(t || {}) 9859 }) 9860 }(e.D, e.app.options.authDomain).then(function (t) { 9861 return (e.m = t) && (t.ha = e.D), Vh(e.D) 9862 }); 9863 return ul(e, t) 9864 }(n).then(function () { 9865 return Qh(n.i, e, n.P) 9866 }).then(function (e) { 9867 return e ? (e.ha = n.D, n.m && (n.m.ga || null) == (e.ga || null) ? e : e.reload().then(function () { 9868 return Gh(n.i, e).then(function () { 9869 return e 9870 }) 9871 }).o(function (t) { 9872 return "auth/network-request-failed" == t.code ? e : zh(n.i) 9873 })) : null 9874 }).then(function (t) { 9875 rl(n, t || null) 9876 }), ul(n, t))), this.h = ul(this, (r = this).$.then(function () { 9877 return el(r) 9878 }).o(function () {}).then(function () { 9879 if (!r.l) return r.ja() 9880 }).o(function () {}).then(function () { 9881 var t; 9882 r.l || (r.ba = !0, (t = r.i).b.addListener(Hh("local"), t.a, r.ja)) 9883 }
9883)), this.ba = !1, this.ja = m(this.Zc, this), this.Ba = m(this.da, this), this.ya = m(this.mc, this), this.za = m(this.wc, this), this.Aa = m(this.xc, this), this.b = null, o = (i = this).app.options.authDomain, s = i.app.options.apiKey, o && wr() && (i.Oa = i.$.then(function () { 9884 var t; 9885 if (!i.l) return i.b = xc(o, s, i.app.name, i.P), Ec(i.b, i), ol(i) && wh(ol(i)), i.m && (wh(i.m), (t = i.m).wa(i.la()), lh(t, i), ph(t = i.m, i.J), dh(t, i), Qs((t = i.m).a, i.P), fh(t, i), i.m = null), i.b 9886 })), this.INTERNAL = {}, this.INTERNAL.delete = m(this.delete, this), this.INTERNAL.logFramework = m(this.Gc, this), this.u = 0, ln.call(this), t = this, Object.defineProperty(t, "lc", { 9887 get: function () { 9888 return this.la() 9889 }, 9890 set: function (t) { 9891 this.wa(t) 9892 }, 9893 enumerable: !1 9894 }), t.aa = null, Object.defineProperty(t, "ti", { 9895 get: function () { 9896 return this.T() 9897 }, 9898 set: function (t) { 9899 this.yb(t) 9900 }, 9901 enumerable: !1 9902 }), t.S = null, Object.defineProperty(t, "emulatorConfig", { 9903 get: function () { 9904 var t; 9905 return t = this.P ? Vr({ 9906 protocol: (t = kn(this.P.url)).c, 9907 host: t.a, 9908 port: t.g, 9909 options: Vr({ 9910 disableWarnings: this.P.ec 9911 }) 9912 }) : null 9913 }, 9914 enumerable: !1 9915 }), this.J = [], this.P = null 9916 } 9917 9918 function Jh(t) { 9919 qe.call(this, "languageCodeChanged"), this.h = t 9920 } 9921 9922 function $h(t) { 9923 qe.call(this, "emulatorConfigChanged"), this.c = t 9924 } 9925 9926 function Zh(t) { 9927 qe.call(this, "frameworkChanged"), this.f = t 9928 } 9929 9930 function tl(t) { 9931 return t.Oa || we(new I("auth-domain-config-required")) 9932 } 9933 9934 function el(t) { 9935 if (!wr()) return we(new I("operation-not-supported-in-this-environment")); 9936 var e = tl(t).then(function () { 9937 return t.b.qa() 9938 }).then(function (t) { 9939 return t ? Vr(t) : null 9940 }); 9941 return ul(t, e) 9942 } 9943 9944 function nl(o, s) { 9945 var a = {}; 9946 return a.apiKey = o.app.options.apiKey, a.authDomain = o.app.options.authDomain, a.appName = o.app.name, o.P && (a.emulatorConfig = o.P), o.$.then(function () { 9947 return t = a, e = s, n = o.D, r = o.Ga(), i = new hh(t, e), n && (i.ha = n), r && ph(i, r), i.reload().then(function () { 9948 return i 9949 }); 9950 var t, e, n, r, i 9951 }).then(function (t) { 9952 return ol(o) && t.uid == ol(o).uid ? Ah(ol(o), t) : (rl(o, t), wh(t)), o.da(t) 9953 }).then(function () { 9954 al(o) 9955 }) 9956 } 9957 9958 function rl(t, e) { 9959 var n, r; 9960 ol(t) && (n = ol(t), r = t.Ba, H(n.S, function (t) { 9961 return t == r 9962 }), en(ol(t), "tokenChanged", t.ya), en(ol(t), "userDeleted", t.za), en(ol(t), "userInvalidated", t.Aa), yh(ol(t))), e && (e.S.push(t.Ba), $e(e, "tokenChanged", t.ya), $e(e, "userDeleted", t.za), $e(e, "userInvalidated", t.Aa), 0 < t.u && gh(e)), jr(t, "currentUser", e), e && (e.wa(t.la()), lh(e, t), ph(e, t.J), dh(e, t), Qs(e.a, t.P), fh(e, t)) 9963 } 9964 9965 function il(n, t) { 9966 var e = null, 9967 r = null; 9968 return ul(n, t.then(function (t) { 9969 return e = Ao(t), r = ji(t), nl(n, t) 9970 }, function (t) { 9971 var e = null; 9972 throw (e = t && "auth/multi-factor-auth-required" === t.code ? Yc(t.w(), n, m(n.kc, n)) : e) || t 9973 }).then(function () { 9974 return Vr({ 9975 user: ol(n), 9976 credential: e, 9977 additionalUserInfo: r, 9978 operationType: "signIn" 9979 }) 9980 })) 9981 } 9982 9983 function ol(t) { 9984 return t.currentUser 9985 } 9986 9987 function sl(t) { 9988 return ol(t) && ol(t)._lat || null 9989 } 9990 9991 function al(t) { 9992 if (t.ba) { 9993 for (var e = 0; e < t.s.length; e++) t.s[e] && t.s[e](sl(t)); 9994 if (t.X !== t.getUid() && t.O.length) 9995 for (t.X = t.getUid(), e = 0; e < t.O.length; e++) t.O[e] && t.O[e](sl(t)) 9996 } 9997 } 9998 9999 function ul(t, e) { 10000 return t.R.push(e), e.oa(function () { 10001 W(t.R, e) 10002 }), e 10003 } 10004 10005 function cl() {} 10006 10007 function hl() { 10008 this.a = {}, this.b = 1e12 10009 } 10010 Bh.prototype.xb = function (e) { 10011 var n = null, 10012 r = this; 10013 return function (t) { 10014 var e = new I("invalid-persistence-type"), 10015 n = new I("unsupported-persistence-type"); 10016 t: { 10017 for (r in Ku) 10018 if (Ku[r] == t) { 10019 var r = !0; 10020 break t 10021 } r = !1 10022 } 10023 if (!r || "string" != typeof t) throw e; 10024 switch (hr()) { 10025 case "ReactNative": 10026 if ("session" === t) throw n; 10027 break;
10028 case "Node": 10029 if ("none" !== t) throw n; 10030 break; 10031 case "Worker": 10032 if ("session" === t || !Iu() && "none" !== t) throw n; 10033 break; 10034 default: 10035 if (!br() && "none" !== t) throw n 10036 } 10037 }(e), Yh(this, function () { 10038 return e != r.c.F ? r.b.get(r.c, r.a).then(function (t) { 10039 return n = t, Kh(r, e) 10040 }).then(function () { 10041 if (r.c = Hh(e), n) return r.b.set(r.c, n, r.a) 10042 }) : be() 10043 }) 10044 }, w(Xh, ln), w(Jh, qe), w($h, qe), w(Zh, qe), (t = Xh.prototype).xb = function (t) { 10045 return t = this.i.xb(t), ul(this, t) 10046 }, t.wa = function (t) { 10047 this.aa === t || this.l || (this.aa = t, zs(this.a, this.aa), this.dispatchEvent(new Jh(this.la()))) 10048 }, t.la = function () { 10049 return this.aa 10050 }, t.fd = function () { 10051 var t = l.navigator; 10052 this.wa(t && (t.languages && t.languages[0] || t.language || t.userLanguage) || null) 10053 }, t.gd = function (t, e) { 10054 if (!this.P) { 10055 if (!/^https?:\/\//.test(t)) throw new I("argument-error", "Emulator URL must start with a valid scheme (http:// or https://)."); 10056 e = !!e && !!e.disableWarnings, n = e, "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."), l.document && !n && sr().then(function () { 10057 var t = l.document.createElement("div"); 10058 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"), l.document.body.appendChild(t) 10059 }), this.P = { 10060 url: t, 10061 ec: e 10062 }, this.settings.ib = !0, Qs(this.a, this.P), this.dispatchEvent(new $h(this.P)) 10063 } 10064 var n 10065 }, t.Gc = function (t) { 10066 this.J.push(t), Xs(this.a, Xl.SDK_VERSION ? gr(Xl.SDK_VERSION, this.J) : null), this.dispatchEvent(new Zh(this.J)) 10067 }, t.Ga = function () { 10068 return z(this.J) 10069 }, t.yb = function (t) { 10070 this.S === t || this.l || (this.S = t, this.a.b = this.S) 10071 }, t.T = function () { 10072 return this.S 10073 }, t.toJSON = function () { 10074 return { 10075 apiKey: this.app.options.apiKey, 10076 authDomain: this.app.options.authDomain, 10077 appName: this.app.name, 10078 currentUser: ol(this) && ol(this).w() 10079 } 10080 }, t.Fb = function (t, e) { 10081 switch (t) { 10082 case "unknown": 10083 case "signInViaRedirect": 10084 return !0; 10085 case "signInViaPopup": 10086 return this.g == e && !!this.f; 10087 default: 10088 return !1 10089 } 10090 }, t.na = function (t, e, n, r) { 10091 "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) 10092 }, t.Fa = function (t, e) { 10093 return "signInViaRedirect" == t || "signInViaPopup" == t && this.g == e && this.f ? m(this.ic, this) : null 10094 }, t.ic = function (t, e, n, r) { 10095 var i = this, 10096 o = { 10097 requestUri: t, 10098 postBody: r, 10099 sessionId: e, 10100 tenantId: n 10101 }; 10102 return this.c && (this.c.cancel(), this.c = null), i.$.then(function () { 10103 return il(i, ha(i.a, o)) 10104 }) 10105 }, t.Xc = function (e) {
10106 if (!wr()) return we(new I("operation-not-supported-in-this-environment")); 10107 var n = this, 10108 t = Ui(e.providerId), 10109 r = Nr(), 10110 i = null, 10111 o = rr(i = (!Tr() || ur()) && this.app.options.authDomain && e.isOAuthProvider ? uu(this.app.options.authDomain, this.app.options.apiKey, this.app.name, "signInViaPopup", e, null, r, Xl.SDK_VERSION || null, null, null, this.T(), this.P) : i, t && t.ua, t && t.ta); 10112 return ul(this, t = tl(this).then(function (t) { 10113 return Ac(t, o, "signInViaPopup", e, r, !!i, n.T()) 10114 }).then(function () { 10115 return new fe(function (t, e) { 10116 n.na("signInViaPopup", null, new I("cancelled-popup-request"), n.g), n.f = t, n.C = e, n.g = r, n.c = Pc(n.b, n, "signInViaPopup", o, r) 10117 }) 10118 }).then(function (t) { 10119 return o && nr(o), t ? Vr(t) : null 10120 }).o(function (t) { 10121 throw o && nr(o), t 10122 })) 10123 }, t.Yc = function (t) { 10124 if (!wr()) return we(new I("operation-not-supported-in-this-environment")); 10125 var e = this; 10126 return ul(this, tl(this).then(function () { 10127 return Yh(t = e.i, function () { 10128 return t.b.set(Wh, t.c.F, t.a) 10129 }); 10130 var t 10131 }).then(function () { 10132 return Rc(e.b, "signInViaRedirect", t, void 0, e.T()) 10133 })) 10134 }, t.qa = function () { 10135 var e = this; 10136 return el(this).then(function (t) { 10137 return e.b && Fc(e.b.b), t 10138 }).o(function (t) { 10139 throw e.b && Fc(e.b.b), t 10140 }) 10141 }, t.dd = function (t) { 10142 if (!t) return we(new I("null-user")); 10143 if (this.S != t.tenantId) return we(new I("tenant-id-mismatch")); 10144 var e = this, 10145 n = {}; 10146 n.apiKey = this.app.options.apiKey, n.authDomain = this.app.options.authDomain, n.appName = this.app.name; 10147 var r, i, o, s, a, u = (r = t, i = n, o = e.D, s = e.Ga(), a = r.b, (n = {})[Bs] = a.b && a.b.toString(), n.refreshToken = a.a, i = new hh(i || { 10148 apiKey: r.l, 10149 authDomain: r.s, 10150 appName: r.m 10151 }, n), o && (i.ha = o), s && ph(i, s), Ah(i, r), i); 10152 return ul(this, this.h.then(function () { 10153 if (e.app.options.apiKey != t.l) return u.reload() 10154 }).then(function () { 10155 return ol(e) && t.uid == ol(e).uid ? (Ah(ol(e), t), e.da(t)) : (rl(e, u), wh(u), e.da(u)) 10156 }).then(function () { 10157 al(e) 10158 })) 10159 }, t.Ab = function () { 10160 var t = this, 10161 e = this.h.then(function () { 10162 return t.b && Fc(t.b.b), ol(t) ? (rl(t, null), zh(t.i).then(function () { 10163 al(t) 10164 })) : be() 10165 }); 10166 return ul(this, e) 10167 }, t.Zc = function () { 10168 var r = this; 10169 return Qh(this.i, this.app.options.authDomain).then(function (t) { 10170 if (!r.l) { 10171 var e, n; 10172 if ((e = ol(r) && t) && (e = ol(r).uid, n = t.uid, e = null != e && "" !== e && null != n && "" !== n && e == n), e) return Ah(ol(r), t), ol(r).I(); 10173 (ol(r) || t) && (rl(r, t), t && (wh(t), t.ha = r.D), r.b && Ec(r.b, r), al(r)) 10174 } 10175 }) 10176 }, t.da = function (t) { 10177 return Gh(this.i, t) 10178 }, t.mc = function () { 10179 al(this), this.da(ol(this)) 10180 }, t.wc = function () { 10181 this.Ab() 10182 }, t.xc = function () { 10183 this.Ab() 10184 }, t.kc = function (t) { 10185 var e = this; 10186 return this.h.then(function () { 10187 return il(e, be(t)) 10188 }) 10189 }, t.zc = function (t) { 10190 var e = this; 10191 this.addAuthTokenListener(function () { 10192 t.next(ol(e)) 10193 }) 10194 }, t.Ac = function (t) { 10195 var e, n, r = this; 10196 n = function () { 10197 t.next(ol(r)) 10198 }, (e = this).O.push(n), ul(e, e.h.then(function () { 10199 !e.l && K(e.O, n) && e.X !== e.getUid() && (e.X = e.getUid(), n(sl(e))) 10200 })) 10201 }, t.Ic = function (t, e, n) { 10202 var r = this; 10203 return this.ba && Promise.resolve().then(function () { 10204 "function" == typeof t ? t(ol(r)) : "function" == typeof t.next && t.next(ol(r)) 10205 }), this.hb(t, e, n) 10206 }, t.Hc = function (t, e, n) { 10207 var r = this; 10208 return this.ba && Promise.resolve().then(function () { 10209 r.X = r.getUid(), "function" == typeof t ? t(ol(r)) : "function" == typeof t.next && t.next(ol(r)) 10210 }), this.bc(t, e, n) 10211 }, t.nc = function (t) { 10212 var e = this, 10213 n = this.h.then(function () { 10214 return ol(e) ? ol(e).I(t).then(function (t) { 10215 return { 10216 accessToken: t 10217 } 10218 }) : null 10219 }); 10220 return ul(this, n) 10221 }, t.Tc = function (t) { 10222 var n = this; 10223 return this.h.then(function () { 10224 return il(n, za(n.a, Va, { 10225 token: t 10226 })) 10227 }).then(function (t) { 10228 var e = t.user; 10229 return Nh(e, "isAnonymous", !1), n.da(e), t 10230 }) 10231 }
10231, t.Uc = function (t, e) { 10232 var n = this; 10233 return this.h.then(function () { 10234 return il(n, za(n.a, Ba, { 10235 email: t, 10236 password: e 10237 })) 10238 }) 10239 }, t.dc = function (t, e) { 10240 var n = this; 10241 return this.h.then(function () { 10242 return il(n, za(n.a, ga, { 10243 email: t, 10244 password: e 10245 })) 10246 }) 10247 }, t.$a = function (t) { 10248 var e = this; 10249 return this.h.then(function () { 10250 return il(e, t.ka(e.a)) 10251 }) 10252 }, t.Sc = function (t) { 10253 return Fr("firebase.auth.Auth.prototype.signInAndRetrieveDataWithCredential is deprecated. Please use firebase.auth.Auth.prototype.signInWithCredential instead."), this.$a(t) 10254 }, t.zb = function () { 10255 var n = this; 10256 return this.h.then(function () { 10257 var t = ol(n); 10258 if (t && t.isAnonymous) { 10259 var e = Vr({ 10260 providerId: null, 10261 isNewUser: !1 10262 }); 10263 return Vr({ 10264 user: t, 10265 credential: null, 10266 additionalUserInfo: e, 10267 operationType: "signIn" 10268 }) 10269 } 10270 return il(n, n.a.zb()).then(function (t) { 10271 var e = t.user; 10272 return Nh(e, "isAnonymous", !0), n.da(e), t 10273 }) 10274 }) 10275 }, t.getUid = function () { 10276 return ol(this) && ol(this).uid || null 10277 }, t.cc = function (t) { 10278 this.addAuthTokenListener(t), this.u++, 0 < this.u && ol(this) && gh(ol(this)) 10279 }, t.Pc = function (e) { 10280 var n = this; 10281 j(this.s, function (t) { 10282 t == e && n.u-- 10283 }), this.u < 0 && (this.u = 0), 0 == this.u && ol(this) && yh(ol(this)), this.removeAuthTokenListener(e) 10284 }, t.addAuthTokenListener = function (t) { 10285 var e = this; 10286 this.s.push(t), ul(this, this.h.then(function () { 10287 e.l || K(e.s, t) && t(sl(e)) 10288 })) 10289 }, t.removeAuthTokenListener = function (e) { 10290 H(this.s, function (t) { 10291 return t == e 10292 }) 10293 }, t.delete = function () { 10294 this.l = !0; 10295 for (var t = 0; t < this.R.length; t++) this.R[t].cancel("app-deleted"); 10296 return this.R = [], this.i && (t = this.i).b.removeListener(Hh("local"), t.a, this.ja), this.b && (Sc(this.b, this), Fc(this.b.b)), Promise.resolve() 10297 }, t.hc = function (t) { 10298 return ul(this, za(this.a, ya, { 10299 identifier: t, 10300 continueUri: _r() ? Zn() : "http://localhost" 10301 }).then(function (t) { 10302 return t.signinMethods || [] 10303 })) 10304 }, t.Bc = function (t) { 10305 return !!Io(t) 10306 }, t.wb = function (e, n) { 10307 var r = this; 10308 return ul(this, be().then(function () { 10309 var t = new bi(n); 10310 if (!t.c) throw new I("argument-error", Ii + " must be true when sending sign in link to email"); 10311 return ki(t) 10312 }).then(function (t) { 10313 return r.a.wb(e, t) 10314 }).then(function () {})) 10315 }, t.jd = function (t) { 10316 return this.Ra(t).then(function (t) { 10317 return t.data.email 10318 }) 10319 }, t.nb = function (t, e) { 10320 return ul(this, this.a.nb(t, e).then(function () {})) 10321 }, t.Ra = function (t) { 10322 return ul(this, this.a.Ra(t).then(function (t) { 10323 return new Xr(t) 10324 })) 10325 }, t.jb = function (t) { 10326 return ul(this, this.a.jb(t).then(function () {})) 10327 }, t.vb = function (e, t) { 10328 var n = this; 10329 return ul(this, be().then(function () { 10330 return void 0 === t || ut(t) ? {} : ki(new bi(t)) 10331 }).then(function (t) { 10332 return n.a.vb(e, t) 10333 }).then(function () {})) 10334 }, t.Wc = function (t, e) { 10335 return ul(this, Kc(this, t, e, m(this.$a, this))) 10336 }, t.Vc = function (n, r) { 10337 var i = this; 10338 return ul(this, be().then(function () { 10339 var t = r || Zn(), 10340 e = _o(n, t); 10341 if (!(t = Io(t))) throw new I("argument-error", "Invalid email link!"); 10342 if (t.tenantId !== i.T()) throw new I("tenant-id-mismatch"); 10343 return i.$a(e) 10344 })) 10345 }, cl.prototype.render = function () {}, cl.prototype.reset = function () {}, cl.prototype.getResponse = function () {}, cl.prototype.execute = function () {}; 10346 var ll = null; 10347 10348 function fl(t, e) { 10349 return (e = pl(e)) && t.a[e] || null 10350 } 10351 10352 function pl(t) { 10353 return (t = void 0 === t ? 1e12 : t) ? t.toString() : null 10354 } 10355 10356 function dl(t, e) { 10357 this.g = !1, this.c = e, this.a = this.b = null, this.h = "invisible" !== this.c.size, this.f = te
10357(t); 10358 var n = this; 10359 this.i = function () { 10360 n.execute() 10361 }, this.h ? this.execute() : $e(this.f, "click", this.i) 10362 } 10363 10364 function vl(t) { 10365 if (t.g) throw Error("reCAPTCHA mock was already deleted!") 10366 } 10367 10368 function gl() {} 10369 10370 function yl() {} 10371 hl.prototype.render = function (t, e) { 10372 return this.a[this.b.toString()] = new dl(t, e), this.b++ 10373 }, hl.prototype.reset = function (t) { 10374 var e = fl(this, t); 10375 t = pl(t), e && t && (e.delete(), delete this.a[t]) 10376 }, hl.prototype.getResponse = function (t) { 10377 return (t = fl(this, t)) ? t.getResponse() : null 10378 }, hl.prototype.execute = function (t) { 10379 (t = fl(this, t)) && t.execute() 10380 }, dl.prototype.getResponse = function () { 10381 return vl(this), this.b 10382 }, dl.prototype.execute = function () { 10383 vl(this); 10384 var n = this; 10385 this.a || (this.a = setTimeout(function () { 10386 n.b = function () { 10387 for (var t = 50, e = []; 0 < t;) e.push("1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".charAt(Math.floor(62 * Math.random()))), t--; 10388 return e.join("") 10389 }(); 10390 var t = n.c.callback, 10391 e = n.c["expired-callback"]; 10392 if (t) try { 10393 t(n.b) 10394 } catch (t) {} 10395 n.a = setTimeout(function () { 10396 if (n.a = null, n.b = null, e) try { 10397 e() 10398 } catch (t) {} 10399 n.h && n.execute() 10400 }, 6e4) 10401 }, 500)) 10402 }, dl.prototype.delete = function () { 10403 vl(this), this.g = !0, clearTimeout(this.a), this.a = null, en(this.f, "click", this.i) 10404 }, jr(gl, "FACTOR_ID", "phone"), yl.prototype.g = function () { 10405 return be(ll = ll || new hl) 10406 }, yl.prototype.c = function () {}; 10407 var ml = null; 10408 10409 function bl() { 10410 this.b = l.grecaptcha ? 1 / 0 : 0, this.f = null, this.a = "__rcb" + Math.floor(1e6 * Math.random()).toString() 10411 } 10412 var wl = new pt(yt, "https://www.google.com/recaptcha/api.js?onload=%{onload}&render=explicit&hl=%{hl}"), 10413 _l = new Rr(3e4, 6e4); 10414 bl.prototype.g = function (i) { 10415 var o = this; 10416 return new fe(function (t, e) { 10417 var r = setTimeout(function () { 10418 e(new I("network-request-failed")) 10419 }, _l.get()); 10420 !l.grecaptcha || i !== o.f && !o.b ? (l[o.a] = function () { 10421 var n; 10422 l.grecaptcha ? (o.f = i, n = l.grecaptcha.render, l.grecaptcha.render = function (t, e) { 10423 return t = n(t, e), o.b++, t 10424 }, clearTimeout(r), t(l.grecaptcha)) : (clearTimeout(r), e(new I("internal-error"))), delete l[o.a] 10425 }, be(Ds(_t(wl, { 10426 onload: o.a, 10427 hl: i || "" 10428 }))).o(function () { 10429 clearTimeout(r), e(new I("internal-error", "Unable to load external reCAPTCHA dependencies!")) 10430 })) : (clearTimeout(r), t(l.grecaptcha)) 10431 }) 10432 }, bl.prototype.c = function () { 10433 this.b-- 10434 }; 10435 var Il = null; 10436 10437 function Tl(t, e, n, r, i, o, s) { 10438 if (jr(this, "type", "recaptcha"), this.c = this.f = null, this.D = !1, this.v = e, this.g = null, s = s ? ml = ml || new yl : Il = Il || new bl, this.m = s, this.a = n || { 10439 theme: "light", 10440 type: "image" 10441 }, this.h = [], this.a[Cl]) throw new I("argument-error", "sitekey should not be provided for reCAPTCHA as one is automatically provisioned for the current project."); 10442 if (this.i = "invisible" === this.a[Nl], !l.document) throw new I("operation-not-supported-in-this-environment", "RecaptchaVerifier is only supported in a browser HTTP/HTTPS environment with DOM support."); 10443 if (!te(e) || !this.i && te(e).hasChildNodes()) throw new I("argument-error", "reCAPTCHA container is either not found or already contains inner elements!"); 10444 this.s = new qs(t, o || null, i || null), this.u = r || function () { 10445 return null 10446 }; 10447 var a = this; 10448 this.l = []; 10449 var u = this.a[El]; 10450 this.a[El] = function (t) { 10451 var e; 10452 Al(a, t), "function" == typeof u ? u(t) : "string" != typeof u || "function" == typeof (e = mr(u, l)) && e(t) 10453 }; 10454 var c = this.a[Sl]; 10455 this.a[Sl] = function () { 10456 var t; 10457 Al(a, null), "function" == typeof c ? c() : "string" != typeof c || "function" == typeof (t = mr(c, l)) && t() 10458 } 10459 } 10460 var El = "callback", 10461 Sl = "expired-callback", 10462 Cl = "sitekey", 10463 Nl = "size"; 10464 10465 function Al(t, e) { 10466 for (var n = 0; n < t.l.length; n++) try { 10467 t.l[n](e) 10468 } catch (t) {} 10469 } 10470 10471 function kl(t, e) { 10472 return t.h.push(e), e.oa(function () { 10473 W(t.h, e) 10474 }), e 10475 } 10476 10477 function Rl(t) { 10478 if (t.D) throw new I("internal-error", "RecaptchaVerifier instance has been destroyed.") 10479 } 10480 10481 function Pl(t, e, n) { 10482 var r = !1; 10483 try { 10484 this.b = n || Xl.app() 10485 } catch (t) { 10486 throw new I("argument-error", "No firebase.app.App instance is currently initialized.") 10487 } 10488 if (!this.b.options || !this.b.options.apiKey) throw new I("invalid-api-key"); 10489 n = this.b.options.apiKey; 10490 var i = this, 10491 o = null; 10492 try { 10493 o = this.b.auth().Ga() 10494 } catch (t) {} 10495 try { 10496 r = this.b.auth().settings.appVerificationDisabledForTesting 10497 } catch (t) {} 10498 o = Xl.SDK_VERSION ? gr(Xl.SDK_VERSION, o) : null, Tl.call(this, n, t, e, function () { 10499 try { 10500 var e = i.b.auth().la() 10501 } catch (t) { 10502 e = null 10503 } 10504 return e 10505 }, o, A(E), r) 10506 } 10507 10508 function Ol(t, e, n, r) { 10509 t: { 10510 n = Array.prototype.slice.call(n); 10511 for (var i = 0, o = !1, s = 0; s < e.length; s++) 10512 if (e[s].optional) o = !0; 10513 else { 10514 if (o) throw new I("internal-error", "Argument validator encountered a required argument after an optional argument."); 10515 i++ 10516 } 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 + "."; 10517 else { 10518 for (i = 0; i < n.length; i++) 10519 if (o = e[i].optional && void 0 === n[i], !e[i].M(n[i]) && !o) { 10520 if (e = e[i], i < 0 || i >= Dl.length) throw new I("internal-error", "Argument validator received an unsupported number of arguments."); 10521 n = Dl[i], r = (r ? "" : n + " argument ") + (e.n
10521ame ? '"' + e.name + '" ' : "") + "must be " + e.K + "."; 10522 break t 10523 } r = null 10524 } 10525 } 10526 if (r) throw new I("argument-error", t + " failed: " + r) 10527 }(t = Tl.prototype).Ia = function () { 10528 var e = this; 10529 return this.f || (this.f = kl(this, be().then(function () { 10530 if (_r() && !cr()) return sr(); 10531 throw new I("operation-not-supported-in-this-environment", "RecaptchaVerifier is only supported in a browser HTTP/HTTPS environment.") 10532 }).then(function () { 10533 return e.m.g(e.u()) 10534 }).then(function (t) { 10535 return e.g = t, za(e.s, Ra, {}) 10536 }).then(function (t) { 10537 e.a[Cl] = t.recaptchaSiteKey 10538 }).o(function (t) { 10539 throw e.f = null, t 10540 }))) 10541 }, t.render = function () { 10542 Rl(this); 10543 var n = this; 10544 return kl(this, this.Ia().then(function () { 10545 var t, e; 10546 return null === n.c && (e = n.v, n.i || (t = te(e), e = oe("DIV"), t.appendChild(e)), n.c = n.g.render(e, n.a)), n.c 10547 })) 10548 }, t.verify = function () { 10549 Rl(this); 10550 var i = this; 10551 return kl(this, this.render().then(function (e) { 10552 return new fe(function (n) { 10553 var r, t = i.g.getResponse(e); 10554 t ? n(t) : (r = function (t) { 10555 var e; 10556 t && (e = r, H(i.l, function (t) { 10557 return t == e 10558 }), n(t)) 10559 }, i.l.push(r), i.i && i.g.execute(i.c)) 10560 }) 10561 })) 10562 }, t.reset = function () { 10563 Rl(this), null !== this.c && this.g.reset(this.c) 10564 }, t.clear = function () { 10565 Rl(this), this.D = !0, this.m.c(); 10566 for (var t, e = 0; e < this.h.length; e++) this.h[e].cancel("RecaptchaVerifier instance has been destroyed."); 10567 if (!this.i) { 10568 e = te(this.v); 10569 for (; t = e.firstChild;) e.removeChild(t) 10570 } 10571 }, w(Pl, Tl); 10572 var Dl = "First Second Third Fourth Fifth Sixth Seventh Eighth Ninth".split(" "); 10573 10574 function xl(t, e) { 10575 return { 10576 name: t || "", 10577 K: "a valid string", 10578 optional: !!e, 10579 M: function (t) { 10580 return "string" == typeof t 10581 } 10582 } 10583 } 10584 10585 function Ll(t, e) { 10586 return { 10587 name: t || "", 10588 K: "a boolean", 10589 optional: !!e, 10590 M: function (t) { 10591 return "boolean" == typeof t 10592 } 10593 } 10594 } 10595 10596 function Ml(t, e) { 10597 return { 10598 name: t || "", 10599 K: "a valid object", 10600 optional: !!e, 10601 M: g 10602 } 10603 } 10604 10605 function Fl(t, e) { 10606 return { 10607 name: t || "", 10608 K: "a function", 10609 optional: !!e, 10610 M: function (t) { 10611 return "function" == typeof t 10612 } 10613 } 10614 } 10615 10616 function Ul(t, e) { 10617 return { 10618 name: t || "", 10619 K: "null", 10620 optional: !!e, 10621 M: function (t) { 10622 return null === t 10623 } 10624 } 10625 } 10626 10627 function jl(n) { 10628 return { 10629 name: n ? n + "Credential" : "credential", 10630 K: n ? "a valid " + n + " credential" : "a valid credential", 10631 optional: !1, 10632 M: function (t) { 10633 if (!t) return !1; 10634 var e = !n || t.providerId === n; 10635 return !(!t.ka || !e) 10636 } 10637 } 10638 } 10639 10640 function ql() { 10641 return { 10642 name: "multiFactorAssertion", 10643 K: "a valid multiFactorAssertion", 10644 optional: !1, 10645 M: function (t) { 10646 return !!t && !!t.sb 10647 } 10648 } 10649 } 10650 10651 function Vl() { 10652 return { 10653 name: "authProvider", 10654 K: "a valid Auth provider", 10655 optional: !1, 10656 M: function (t) { 10657 return !!(t && t.providerId && t.hasOwnProperty && t.hasOwnProperty("isOAuthProvider")) 10658 } 10659 } 10660 } 10661 10662 function Bl(t, e) { 10663 return g(t) && "string" == typeof t.type && t.type === e && "function" == typeof t.Ha 10664 } 10665 10666 function Kl(t) { 10667 return g(t) && "string" == typeof t.uid 10668 } 10669 10670 function Wl() { 10671 return { 10672 name: "applicationVerifier", 10673 K: "an implementation of firebase.auth.ApplicationVerifier", 10674 optional: !1, 10675 M: function (t) { 10676 return !(!t || "string" != typeof t.type || "function" != typeof t.verify) 10677 } 10678 } 10679 } 10680 10681 function Hl(e, n, t, r) { 10682 return { 10683 name: t || "", 10684 K: e.K + " or " + n.K, 10685 optional: !!r, 10686 M: function (t) { 10687 return e.M(t) || n.M(t) 10688 } 10689 } 10690 } 10691 10692 function Gl(t, e) { 10693 for (var n in e) { 10694 var r = e[n].name; 10695 t[r] = Yl(r, t[n], e[n].j) 10696 } 10697 } 10698 10699 function zl(t, e) { 10700 for (var n in e) { 10701 var r = e[n].name; 10702 r !== n && Object.defineProperty(t, r, { 10703 get: b(function (t) { 10704 return this[t] 10705 }, n), 10706 set: b(function (t, e, n, r) { 10707 Ol(t, [n], [r], !0), this[e] = r 10708 }, r, n, e[n].kb), 10709 enumerable: !0 10710 }) 10711 } 10712 } 10713 10714 function Ql(t, e, n, r) { 10715 t[e] = Yl(e, n, r) 10716 } 10717 10718 function Yl(t, e, n) { 10719 function r() { 10720 var t = Array.prototype.slice.call(arguments); 10721 return Ol(o, n, t), e.apply(this, t) 10722 } 10723 if (!n) return e; 10724 var i, o = (t = (t = t).split("."))[t.length - 1]; 10725 for (i in e) r[i] = e[i]; 10726 for (i in e.prototype) r.prototype[i] = e.prototype[i]; 10727 return r 10728 } 10729 Gl(Xh.prototype, { 10730 jb: { 10731 name: "applyActionCode", 10732 j: [xl("code")] 10733 }, 10734 Ra: { 10735 name: "checkActionCode", 10736 j: [xl("code")] 10737 }, 10738 nb: { 10739 name: "confirmPasswordReset", 10740 j: [xl("code"), xl("newPassword")] 10741 }, 10742 dc: { 10743 name: "createUserWithEmailAndPassword", 10744 j: [xl("email"), xl("password")] 10745 }, 10746 hc: { 10747 name: "fetchSignInMethodsForEmail", 10748 j: [xl("email")] 10749 }, 10750 qa: { 10751 name: "getRedirectResult", 10752 j: [] 10753 }, 10754 Bc: { 10755 name: "isSignInWithEmailLink", 10756 j: [xl("emailLink")] 10757 }, 10758 Hc: { 10759 name: "onAuthStateChanged", 10760 j: [Hl(Ml(), Fl(), "nextOrObserver"), Fl("opt_error", !0), Fl("opt_completed", !0)] 10761 }, 10762 Ic: { 10763 name: "onIdTokenChanged", 10764 j: [Hl(Ml(), Fl(), "nextOrObserver"), Fl("opt_error", !0), Fl("opt_completed", !0)] 10765 }, 10766 vb: { 10767 name: "sendPasswordResetEmail", 10768 j: [xl("email"), Hl(Ml("opt_actionCodeSettings", !0), Ul(null, !0), "opt_actionCodeSettings", !0)] 10769 }, 10770 wb: { 10771 name: "sendSignInLinkToEmail", 10772 j: [xl("email"), Ml("actionCodeSettings")] 10773 }, 10774 xb: { 10775 name: "setPersistence", 10776 j: [xl("persistence")] 10777 }, 10778 Sc: { 10779 name: "signInAndRetrieveDataWithCredential", 10780 j: [jl()] 10781 }, 10782 zb: { 10783 name: "signInAnonymously", 10784 j: [] 10785 }, 10786 $a: { 10787 name: "signInWithCredential", 10788 j: [jl()] 10789 }, 10790 Tc: { 10791 name: "signInWithCustomToken", 10792 j: [xl("token")] 10793 }, 10794 Uc: { 10795 name: "signInWithEmailAndPassword", 10796 j: [xl("email"), xl("password")] 10797 }, 10798 Vc: { 10799 name: "signInWithEmailLink", 10800 j: [xl("email"), xl("emailLink", !0)] 10801 }, 10802 Wc: { 10803 name: "signInWithPhoneNumber", 10804 j: [xl("phoneNumber"), Wl()] 10805 }, 10806 Xc: { 10807 name: "signInWithPopup", 10808 j: [Vl()] 10809 }, 10810 Yc: { 10811 name: "signInWithRedirect", 10812 j: [Vl()] 10813 }, 10814 dd: { 10815 name: "updateCurrentUser", 10816 j: [Hl({ 10817 name: "user", 10818 K: "an instance of Firebase User", 10819 optional: !1, 10820 M: function (t) { 10821 return !!(t && t instanceof hh) 10822 } 10823 }, Ul(), "user")] 10824 }, 10825 Ab: { 10826 name: "signOut", 10827 j: [] 10828 }, 10829 toJSON: { 10830 name: "toJSON", 10831 j: [xl(null, !0)] 10832 }, 10833 fd: { 10834 name: "useDeviceLanguage", 10835 j: [] 10836 }, 10837 gd: { 10838 name: "useEmulator", 10839 j: [xl("url"), Ml("options", !0)] 10840 }, 10841 jd: { 10842 name: "verifyPasswordResetCode", 10843 j: [xl("code")] 10844 } 10845 }), zl(Xh.prototype, { 10846 lc: { 10847 name: "languageCode", 10848 kb: Hl(xl(), Ul(), "languageCode") 10849 }, 10850 ti: { 10851 name: "tenantId", 10852 kb: Hl(xl(), Ul(), "tenantId") 10853 } 10854 }), (Xh.Persistence = Ku).LOCAL = "local", Xh.Persistence.SESSION = "session", Xh.Persistence.NONE = "none", Gl(hh.prototype, { 10855 delete: { 10856 name: "delete", 10857 j: [] 10858 }, 10859 oc: { 10860 name: "getIdTokenResult", 10861 j: [Ll("opt_forceRefresh", !0)] 10862 }, 10863 I: { 10864 name: "getIdToken", 10865 j: [Ll("opt_forceRefresh", !0)] 10866 }, 10867 Cc: { 10868 name: "linkAndRetrieveDataWithCredential", 10869 j: [jl()] 10870 }, 10871 qb: { 10872 name: "linkWithCredential", 10873 j: [jl()] 10874 }, 10875 Dc: { 10876 name: "linkWithPhoneNumber", 10877 j: [xl("phoneNumber"), Wl()] 10878 }, 10879 Ec: { 10880 name: "linkWithPopup", 10881 j: [Vl()] 10882 }, 10883 Fc: { 10884 name: "linkWithRedirect", 10885 j: [Vl()] 10886 }, 10887 Lc: { 10888 name: "reauthenticateAndRetrieveDataWithCredential", 10889 j: [jl()] 10890 }, 10891 tb: { 10892 name: "reauthenticateWithCredential", 10893 j: [jl()] 10894 }, 10895 Mc: { 10896 name: "reauthenticateWithPhoneNumber", 10897 j: [xl("phoneNumber"), Wl()] 10898 }, 10899 Nc: { 10900 name: "reauthenticateWithPopup", 10901 j: [Vl()] 10902 }, 10903 Oc: { 10904 name: "reauthenticateWithRedirect", 10905 j: [Vl()] 10906 }, 10907 reload: { 10908 name: "reload", 10909 j: [] 10910 }, 10911 ub: { 10912 name: "sendEmailVerification", 10913 j: [Hl(Ml("opt_actionCodeSettings", !0), Ul(null, !0), "opt_actionCodeSettings", !0)] 10914 }, 10915 toJSON: { 10916 name: "toJSON", 10917 j: [xl(null, !0)] 10918 }, 10919 cd: { 10920 name: "unlink", 10921 j: [xl("provider")] 10922 }, 10923 Bb: { 10924 name: "updateEmail", 10925 j: [xl("email")] 10926 }, 10927 Cb: { 10928 name: "updatePassword", 10929 j: [xl("password")] 10930 }, 10931 ed: { 10932 name: "updatePhoneNumber", 10933 j: [jl("phone")] 10934 }, 10935 Db: { 10936 name: "updateProfile", 10937 j: [Ml("profile")] 10938 }, 10939 Eb: { 10940 name: "verifyBeforeUpdateEmail", 10941 j: [xl("email"), Hl(Ml("opt_actionCodeSettings", !0), Ul(null, !0), "opt_actionCodeSettings", !0)] 10942 } 10943 }), Gl(hl.prototype, { 10944 execute: { 10945 name: "execute" 10946 }, 10947 render: { 10948 name: "render" 10949 }, 10950 reset: { 10951 name: "reset" 10952 }, 10953 getResponse: { 10954 name: "getResponse" 10955 } 10956 }), Gl(cl.prototype, { 10957 execute: { 10958 name: "execute" 10959 }, 10960 render: { 10961 name: "render" 10962 }, 10963 reset: { 10964 name: "reset" 10965 }, 10966 getResponse: { 10967 name: "getResponse" 10968 } 10969 }), Gl(fe.prototype, { 10970 oa: { 10971 name: "finally" 10972 }, 10973 o: { 10974 name: "catch" 10975 }, 10976 then: { 10977 name: "then" 10978 } 10979 }), zl(Vc.prototype, { 10980 appVerificationDisabled: { 10981 name: "appVerificationDisabledForTesting", 10982 kb: Ll("appVerificationDisabledForTesting") 10983 } 10984 }), Gl(Bc.prototype, { 10985 confirm: { 10986 name: "confirm", 10987 j: [xl("verificationCode")] 10988 } 10989 }), Ql($i, "fromJSON", function (t) { 10990 t = "string" == typeof t ? JSON.parse(t) : t; 10991 for (var e, n = [oo, bo, Eo, no], r = 0; r < n.length; r++) 10992 if (e = n[r](t)) return e; 10993 return null 10994 }, [Hl(xl(), Ml(), "json")]), Ql(wo, "credential", function (t, e) { 10995 return new mo(t, e) 10996 }, [xl("email"), xl("password")]), Gl(mo.prototype, { 10997 w: { 10998 name: "toJSON", 10999 j: [xl(null, !0)] 11000 } 11001 }), Gl(co.prototype, { 11002 Ca: { 11003 name: "addScope", 11004 j: [xl("scope")] 11005 }, 11006 Ka: { 11007 name: "setCustomParameters", 11008 j: [Ml("customOAuthParameters")] 11009 } 11010 }), Ql(co, "credential", ho, [Hl(xl(), Ml(), "token")]), Ql(wo, "credentialWithLink", _o, [xl("email"), xl("emailLink")]), Gl(lo.prototype, { 11011 Ca: { 11012 name: "addScope", 11013 j: [xl("scope")] 11014 }, 11015 Ka: { 11016 name: "setCustomParameters", 11017 j: [Ml("customOAuthParameters")] 11018 } 11019 }), Ql(lo, "credential", fo, [Hl(xl(), Ml(), "token")]), Gl(po.prototype, { 11020 Ca: { 11021 name: "addScope", 11022 j: [xl("scope")] 11023 }, 11024 Ka: { 11025 name: "setCustomParameters", 11026 j: [Ml("customOAuthParameters")] 11027 } 11028 }), Ql(po, "credential", vo, [Hl(xl(), Hl(Ml(), Ul()), "idToken"), Hl(xl(), Ul(), "accessToken", !0)]), Gl(go.prototype, { 11029 Ka: { 11030 name: "setCustomParameters", 11031 j: [Ml("customOAuthParameters")] 11032 } 11033 }), Ql(go, "credential", yo, [Hl(xl(), Ml(), "token"), xl("secret", !0)]), Gl(uo.prototype, { 11034 Ca: { 11035 name: "addScope", 11036 j: [xl("scope")] 11037 }, 11038 credential: { 11039 name: "credential", 11040 j: [Hl(xl(), Hl(Ml(), Ul()
11040), "optionsOrIdToken"), Hl(xl(), Ul(), "accessToken", !0)] 11041 }, 11042 Ka: { 11043 name: "setCustomParameters", 11044 j: [Ml("customOAuthParameters")] 11045 } 11046 }), Gl(ro.prototype, { 11047 w: { 11048 name: "toJSON", 11049 j: [xl(null, !0)] 11050 } 11051 }), Gl(to.prototype, { 11052 w: { 11053 name: "toJSON", 11054 j: [xl(null, !0)] 11055 } 11056 }), Ql(Co, "credential", No, [xl("verificationId"), xl("verificationCode")]), Gl(Co.prototype, { 11057 fb: { 11058 name: "verifyPhoneNumber", 11059 j: [Hl(xl(), { 11060 name: "phoneInfoOptions", 11061 K: "valid phone info options", 11062 optional: !1, 11063 M: function (t) { 11064 return !!t && (t.session && t.phoneNumber ? Bl(t.session, Xi) && "string" == typeof t.phoneNumber : t.session && t.multiFactorHint ? Bl(t.session, Ji) && Kl(t.multiFactorHint) : t.session && t.multiFactorUid ? Bl(t.session, Ji) && "string" == typeof t.multiFactorUid : !!t.phoneNumber && "string" == typeof t.phoneNumber) 11065 } 11066 }, "phoneInfoOptions"), Wl()] 11067 } 11068 }), Gl(To.prototype, { 11069 w: { 11070 name: "toJSON", 11071 j: [xl(null, !0)] 11072 } 11073 }), Gl(I.prototype, { 11074 toJSON: { 11075 name: "toJSON", 11076 j: [xl(null, !0)] 11077 } 11078 }), Gl(Mo.prototype, { 11079 toJSON: { 11080 name: "toJSON", 11081 j: [xl(null, !0)] 11082 } 11083 }), Gl(Lo.prototype, { 11084 toJSON: { 11085 name: "toJSON", 11086 j: [xl(null, !0)] 11087 } 11088 }), Gl(Qc.prototype, { 11089 toJSON: { 11090 name: "toJSON", 11091 j: [xl(null, !0)] 11092 } 11093 }), Gl(Hc.prototype, { 11094 Rc: { 11095 name: "resolveSignIn", 11096 j: [ql()] 11097 } 11098 }), Gl(th.prototype, { 11099 Rb: { 11100 name: "getSession", 11101 j: [] 11102 }, 11103 fc: { 11104 name: "enroll", 11105 j: [ql(), xl("displayName", !0)] 11106 }, 11107 bd: { 11108 name: "unenroll", 11109 j: [Hl({ 11110 name: "multiFactorInfo", 11111 K: "a valid multiFactorInfo", 11112 optional: !1, 11113 M: Kl 11114 }, xl(), "multiFactorInfoIdentifier")] 11115 } 11116 }), Gl(Pl.prototype, { 11117 clear: { 11118 name: "clear", 11119 j: [] 11120 }, 11121 render: { 11122 name: "render", 11123 j: [] 11124 }, 11125 verify: { 11126 name: "verify", 11127 j: [] 11128 } 11129 }), Ql(hi, "parseLink", mi, [xl("link")]), Ql(gl, "assertion", function (t) { 11130 return new $c(t) 11131 }, [jl("phone")]), 11132 function () { 11133 if (void 0 === Xl || !Xl.INTERNAL || !Xl.INTERNAL.registerComponent) throw Error("Cannot find the firebase namespace; be sure to include firebase-app.js before this library."); 11134 var t = { 11135 ActionCodeInfo: { 11136 Operation: { 11137 EMAIL_SIGNIN: $r, 11138 PASSWORD_RESET: "PASSWORD_RESET", 11139 RECOVER_EMAIL: "RECOVER_EMAIL", 11140 REVERT_SECOND_FACTOR_ADDITION: Jr, 11141 VERIFY_AND_CHANGE_EMAIL: Zr, 11142 VERIFY_EMAIL: "VERIFY_EMAIL" 11143 } 11144 }, 11145 Auth: Xh, 11146 AuthCredential: $i, 11147 Error: I 11148 }; 11149 Ql(t, "EmailAuthProvider", wo, []), Ql(t, "FacebookAuthProvider", co, []), Ql(t, "GithubAuthProvider", lo, []), Ql(t, "GoogleAuthProvider", po, []), Ql(t, "TwitterAuthProvider", go, []), Ql(t, "OAuthProvider", uo, [xl("providerId")]), Ql(t, "SAMLAuthProvider", ao, [xl("providerId")]), Ql(t, "PhoneAuthProvider", Co, [{ 11150 name: "auth", 11151 K: "an instance of Firebase Auth", 11152 optional: !0, 11153 M: function (t) { 11154 return !!(t && t instanceof Xh) 11155 } 11156 }]), Ql(t, "RecaptchaVerifier", Pl, [Hl(xl(), { 11157 name: "", 11158 K: "an HTML element", 11159 optional: !1, 11160 M: function (t) { 11161 return !!(t && t instanceof Element) 11162 } 11163 }, "recaptchaContainer"), Ml("recaptchaParameters", !0), { 11164 name: "app", 11165 K: "an instance of Firebase App", 11166 optional: !0, 11167 M: function (t) { 11168 return !!(t && t instanceof Xl.app.App) 11169 } 11170 }]), Ql(t, "ActionCodeURL", hi, []), Ql(t, "PhoneMultiFactorGenerator", gl, []), Xl.INTERNAL.registerComponent({ 11171 name: "auth", 11172 instanceFactory: function (t) { 11173 return new Xh(t = t.getProvider("app").getImmediate()) 11174 }, 11175 multipleInstances: !1, 11176 serviceProps: t, 11177 instantiationMode: "LAZY", 11178 type: "PUBLIC" 11179 }), Xl.INTERNAL.registerComponent({ 11180 name: "auth-internal", 11181 instanceFactory: function (t) { 11182 return { 11183 getUid: m((t = t.getProvider("auth").getImmediate()).getUid, t), 11184 getToken: m(t.nc, t),
11185 addAuthTokenListener: m(t.cc, t), 11186 removeAuthTokenListener: m(t.Pc, t) 11187 } 11188 }, 11189 multipleInstances: !1, 11190 instantiationMode: "LAZY", 11191 type: "PRIVATE" 11192 }), Xl.registerVersion("@firebase/auth", "0.16.4"), Xl.INTERNAL.extendNamespace({ 11193 User: hh 11194 }) 11195 }() 11196 }.apply("undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {}); 11197 var Ps = (Os.prototype.set = function (t, e) { 11198 null == e ? this.domStorage_.removeItem(this.prefixedName_(t)) : this.domStorage_.setItem(this.prefixedName_(t), Ro(e)) 11199 }, Os.prototype.get = function (t) { 11200 t = this.domStorage_.getItem(this.prefixedName_(t)); 11201 return null == t ? null : ko(t) 11202 }, Os.prototype.remove = function (t) { 11203 this.domStorage_.removeItem(this.prefixedName_(t)) 11204 }, Os.prototype.prefixedName_ = function (t) { 11205 return this.prefix_ + t 11206 }, Os.prototype.toString = function () { 11207 return this.domStorage_.toString() 11208 }, Os); 11209 11210 function Os(t) { 11211 this.domStorage_ = t, this.prefix_ = "firebase:" 11212 } 11213 var Ds = (xs.prototype.set = function (t, e) { 11214 null == e ? delete this.cache_[t] : this.cache_[t] = e 11215 }, xs.prototype.get = function (t) { 11216 return Oo(this.cache_, t) ? this.cache_[t] : null 11217 }, xs.prototype.remove = function (t) { 11218 delete this.cache_[t] 11219 }, xs); 11220 11221 function xs() { 11222 this.cache_ = {}, this.isInMemoryStorage = !0 11223 } 11224 11225 function Ls(t) { 11226 var e = function (t) { 11227 for (var e = [], n = 0, r = 0; r < t.length; r++) { 11228 var i, o = t.charCodeAt(r); 11229 55296 <= o && o <= 56319 && (i = o - 55296, so(++r < t.length, "Surrogate pair missing trail surrogate."), o = 65536 + (i << 10) + (t.charCodeAt(r) - 56320)), o < 128 ? e[n++] = o : (o < 2048 ? e[n++] = o >> 6 | 192 : (o < 65536 ? e[n++] = o >> 12 | 224 : (e[n++] = o >> 18 | 240, e[n++] = o >> 12 & 63 | 128), e[n++] = o >> 6 & 63 | 128), e[n++] = 63 & o | 128) 11230 } 11231 return e 11232 }(t); 11233 return (t = new Fo).update(e), t = t.digest(), uo.encodeByteArray(t) 11234 } 11235 11236 function Ms(t, e) { 11237 so(!e || !0 === t || !1 === t, "Can't turn on custom loggers persistently."), !0 === t ? (Hs.logLevel = as.VERBOSE, Qs = Hs.log.bind(Hs), e && Ws.set("logging_enabled", !0)) : "function" == typeof t ? Qs = t : (Qs = null, Ws.remove("logging_enabled")) 11238 } 11239 11240 function Fs() { 11241 for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e]; 11242 var n = "FIREBASE INTERNAL ERROR: " + zs.apply(void 0, no([], eo(t))); 11243 Hs.error(n) 11244 } 11245 11246 function Us(t) { 11247 return "number" == typeof t && (t != t || t === Number.POSITIVE_INFINITY || t === Number.NEGATIVE_INFINITY) 11248 } 11249 11250 function js(t, e) { 11251 return t === e ? 0 : t < e ? -1 : 1 11252 } 11253 11254 function qs(t, e) { 11255 if (e && t in e) return e[t]; 11256 throw new Error("Missing required key (" + t + ") in object: " + Ro(e)) 11257 } 11258 11259 function Vs(t, e) { 11260 var n = t.length; 11261 if (n <= e) return [t]; 11262 for (var r = [], i = 0; i < n; i += e) n < i + e ? r.push(t.substring(i, n)) : r.push(t.substring(i, i + e)); 11263 return r 11264 } 11265 var Bs, Sn = function (t) { 11266 try { 11267 if ("undefined" != typeof window && void 0 !== window[t]) { 11268 var e = window[t]; 11269 return e.setItem("firebase:sentinel", "cache"), e.removeItem("firebase:sentinel"), new Ps(e) 11270 } 11271 } catch (t) {} 11272 return new Ds 11273 }, 11274 Ks = Sn("localStorage"), 11275 Ws = Sn("sessionStorage"), 11276 Hs = new ps("@firebase/database"), 11277 Gs = (Bs = 1, function () { 11278 return Bs++ 11279 }), 11280 zs = function () { 11281 for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e]; 11282 for (var n = "", r = 0; r < t.length; r++) { 11283 var i = t[r]; 11284 Array.isArray(i) || i && "object" == typeof i && "number" == typeof i.length ? n += zs.apply(null, i) : n += "object" == typeof i ? Ro(i) : i, n += " " 11285 } 11286 return n 11287 },
11288 Qs = null, 11289 Ys = !0, 11290 Xs = function () { 11291 for (var t, e = [], n = 0; n < arguments.length; n++) e[n] = arguments[n]; 11292 !0 === Ys && (Ys = !1, null === Qs && !0 === Ws.get("logging_enabled") && Ms(!0)), Qs && (t = zs.apply(null, e), Qs(t)) 11293 }, 11294 Js = function (n) { 11295 return function () { 11296 for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e]; 11297 Xs.apply(void 0, no([n], eo(t))) 11298 } 11299 }, 11300 $s = function () { 11301 for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e]; 11302 var n = "FIREBASE FATAL ERROR: " + zs.apply(void 0, no([], eo(t))); 11303 throw Hs.error(n), new Error(n) 11304 }, 11305 Zs = function () { 11306 for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e]; 11307 var n = "FIREBASE WARNING: " + zs.apply(void 0, no([], eo(t))); 11308 Hs.warn(n) 11309 }, 11310 ta = "[MIN_NAME]", 11311 ea = "[MAX_NAME]", 11312 na = function (t, e) { 11313 if (t === e) return 0; 11314 if (t === ta || e === ea) return -1; 11315 if (e === ta || t === ea) return 1; 11316 var n = la(t), 11317 r = la(e); 11318 return null !== n ? null !== r ? n - r == 0 ? t.length - e.length : n - r : -1 : null === r && t < e ? -1 : 1 11319 }, 11320 ra = function (t) { 11321 if ("object" != typeof t || null === t) return Ro(t); 11322 var e, n = []; 11323 for (e in t) n.push(e); 11324 n.sort(); 11325 for (var r = "{", i = 0; i < n.length; i++) 0 !== i && (r += ","), r += Ro(n[i]), r += ":", r += ra(t[n[i]]); 11326 return r += "}" 11327 }; 11328 11329 function ia(t, e) { 11330 for (var n in t) t.hasOwnProperty(n) && e(n, t[n]) 11331 } 11332 11333 function oa(t) { 11334 var e, n, r, i; 11335 so(!Us(t), "Invalid JSON number"), 0 === t ? e = 1 / t == -1 / (r = n = 0) ? 1 : 0 : (e = t < 0, r = (t = Math.abs(t)) >= Math.pow(2, -1022) ? (n = (i = Math.min(Math.floor(Math.log(t) / Math.LN2), 1023)) + 1023, Math.round(t * Math.pow(2, 52 - i) - Math.pow(2, 52))) : (n = 0, Math.round(t / Math.pow(2, -1074)))); 11336 for (var o = [], s = 52; s; --s) o.push(r % 2 ? 1 : 0), r = Math.floor(r / 2); 11337 for (s = 11; s; --s) o.push(n % 2 ? 1 : 0), n = Math.floor(n / 2); 11338 o.push(e ? 1 : 0), o.reverse(); 11339 var a = o.join(""), 11340 u = ""; 11341 for (s = 0; s < 64; s += 8) { 11342 var c = parseInt(a.substr(s, 8), 2).toString(16); 11343 u += c = 1 === c.length ? "0" + c : c 11344 } 11345 return u.toLowerCase() 11346 } 11347 11348 function sa(t, e) { 11349 return "object" == typeof (e = setTimeout(t, e)) && e.unref && e.unref(), e 11350 } 11351 var aa = function (t, e) { 11352 var n = "Unknown Error"; 11353 "too_big" === t ? n = "The data requested exceeds the maximum size that can be accessed with a single request." : "permission_denied" === t ? n = "Client doesn't have permission to access the desired data." : "unavailable" === t && (n = "The service is unavailable"); 11354 n = new Error(t + " at " + e.path.toString() + ": " + n); 11355 return n.code = t.toUpperCase(), n 11356 }, 11357 ua = new RegExp("^-?(0*)\\d{1,10}$"), 11358 ca = -2147483648, 11359 ha = 2147483647, 11360 la = function (t) { 11361 if (ua.test(t)) { 11362 t = Number(t); 11363 if (ca <= t && t <= ha) return t 11364 } 11365 return null 11366 }, 11367 fa = function (t) { 11368 try { 11369 t() 11370 } catch (e) { 11371 setTimeout(function () { 11372 var t = e.stack || ""; 11373 throw Zs("Exception was thrown by user callback.", t), e 11374 }, Math.floor(0)) 11375 } 11376 }, 11377 pa = (da.prototype.getToken = function (t) { 11378 return this.auth_ ? this.auth_.getToken(t).catch(function (t) { 11379 return t && "auth/token-not-initialized" === t.code ? (Xs("Got auth/token-not-initialized error. Treating as null token."), null) : Promise.reject(t) 11380 }) : Promise.resolve(null) 11381 }, da.prototype.addTokenChangeListener = function (e) { 11382 this.auth_ ? this.auth_.addAuthTokenListener(e) : (setTimeout(function () { 11383 return e(null) 11384 }, 0), this.authProvider_.get().then(function (t) { 11385 return t.addAuthTokenListener(e) 11386 })) 11387 }, da.prototype.removeTokenChangeListener = function (e) { 11388 this.authProvider_.get().then(function (t) { 11389 return t.removeAuthTokenListener(e) 11390 }) 11391 }, da.prototype.notifyForInvalidToken = function () { 11392 var t = 'Provided authentication credentials for the app named "' + this.app_.name + '" are invalid. This usually indicates your app was not initialized correctly. '; 11393 "credential" in this.app_.options ? t += 'Make sure the "credential" property provided to initializeApp() is authorized to access the specified "databaseURL" and is from the correct project.' : "serviceAccount" in this.app_.options ? t += 'Make sure the "serviceAccount" property provided to initializeApp() is authorized to access the specified "databaseURL" and is from the correct project.' : t += 'Make sure the "apiKey" and "databaseURL" properties provided to initializeApp() match the values provided for your app at https://console.firebase.google.com/.', Zs(t) 11394 }, da); 11395 11396 function da(t, e) { 11397 var n = this; 11398 this.app_ = t, this.authProvider_ = e, this.auth_ = null, this.auth_ = e.getImmediate({ 11399 optional: !0 11400 }), this.auth_ || e.get().then(function (t) { 11401 return n.auth_ = t 11402 }) 11403 } 11404 var va = (ga.prototype.getToken = function (t) { 11405 return Promise.resolve({ 11406 accessToken: ga.EMULATOR_AUTH_TOKEN 11407 }) 11408 }, ga.prototype.addTokenChangeListener = function (t) { 11409 t(ga.EMULATOR_AUTH_TOKEN) 11410 }, ga.prototype.removeTokenChangeListener = function (t) {}, ga.prototype.notifyForInvalidToken = function () {}, ga.EMULATOR_AUTH_TOKEN = "owner", ga); 11411 11412 function ga() {} 11413 var ya = /(console\.firebase|firebase-console-\w+\.corp|firebase\.corp)\.google\.com/, 11414 ma = "websocket", 11415 ba = "long_polling", 11416 wa = (_a.prototype.isCacheableHost = function () { 11417 return "s-" === this.internalHost.substr(0, 2) 11418 }, _a.prototype.isCustomHost = function () { 11419 return "firebaseio.com" !== this._domain && "firebaseio-demo.com" !== this._domain 11420 }, Object.defineProperty(_a.prototype, "host", { 11421 get: function () { 11422 return this._host 11423 }, 11424 set: function (t) { 11425 t !== this.internalHost && (this.internalHost = t, this.isCacheableHost() && Ks.set("host:" + this._host, this.internalHost)) 11426 }, 11427 enumerable: !1, 11428 configurable: !0 11429 }), _a.prototype.toString = function () { 11430 var t = this.toURLString(); 11431 return this.persistenceKey && (t += "<" + this.persistenceKey + ">"), t 11432 }, _a.prototype.toURLString = function () { 11433 var t = this.secure ? "https://" : "http://", 11434 e = this.includeNamespaceInQueryParams ? "?ns=" + this.namespace : ""; 11435 return t + this.host + "/" + e 11436 }, _a); 11437 11438 function _a(t, e, n, r, i, o, s) { 11439 void 0 === i && (i = !1), void 0 === o && (o = ""), void 0 === s && (s = !1), this.secure = e, this.namespace = n, this.webSocketOnly = r, this.nodeAdmin = i, this.persistenceKey = o, this.includeNamespaceInQueryParams = s, this._host = t.toLowerCase(), this._domain = this._host.substr(this._host.indexOf(".") + 1), this.internalHost = Ks.get("host:" + t) || this._host 11440 } 11441 11442 function Ia(t, e, n) { 11443 var r; 11444 if (so("string" == typeof e, "typeof type must == string"), so("object" == typeof n, "typeof params must == object"), e === ma) r = (t.secure ? "wss://" : "ws://") + t.internalHost + "/.ws?"; 11445 else { 11446 if (e !== ba) throw new Error("Unknown connection type: " + e);
11447 r = (t.secure ? "https://" : "http://") + t.internalHost + "/.lp?" 11448 }((e = t).host !== e.internalHost || e.isCustomHost() || e.includeNamespaceInQueryParams) && (n.ns = t.namespace); 11449 var i = []; 11450 return ia(n, function (t, e) { 11451 i.push(t + "=" + e) 11452 }), r + i.join("&") 11453 } 11454 var Ta = (Ea.prototype.incrementCounter = function (t, e) { 11455 void 0 === e && (e = 1), Oo(this.counters_, t) || (this.counters_[t] = 0), this.counters_[t] += e 11456 }, Ea.prototype.get = function () { 11457 return co(this.counters_) 11458 }, Ea); 11459 11460 function Ea() { 11461 this.counters_ = {} 11462 } 11463 var Sa = {}, 11464 Ca = {}; 11465 11466 function Na(t) { 11467 t = t.toString(); 11468 return Sa[t] || (Sa[t] = new Ta), Sa[t] 11469 } 11470 var Aa = (ka.prototype.closeAfter = function (t, e) { 11471 this.closeAfterResponse = t, this.onClose = e, this.closeAfterResponse < this.currentResponseNum && (this.onClose(), this.onClose = null) 11472 }, ka.prototype.handleResponse = function (t, e) { 11473 var n = this; 11474 this.pendingResponses[t] = e; 11475 for (var r = this; this.pendingResponses[this.currentResponseNum];) 11476 if ("break" === function () { 11477 var e = r.pendingResponses[r.currentResponseNum]; 11478 delete r.pendingResponses[r.currentResponseNum]; 11479 for (var t = 0; t < e.length; ++t) ! function (t) { 11480 e[t] && fa(function () { 11481 n.onMessage_(e[t]) 11482 }) 11483 }(t); 11484 if (r.currentResponseNum === r.closeAfterResponse) return r.onClose && (r.onClose(), r.onClose = null), "break"; 11485 r.currentResponseNum++ 11486 }()) break 11487 }, ka); 11488 11489 function ka(t) { 11490 this.onMessage_ = t, this.pendingResponses = [], this.currentResponseNum = 0, this.closeAfterResponse = -1, this.onClose = null 11491 } 11492 var Ra = "pLPCommand", 11493 Pa = "pRTLPCB", 11494 Oa = (Da.prototype.open = function (t, e) { 11495 var n, r, i, s = this; 11496 this.curSegmentNum = 0, this.onDisconnect_ = e, this.myPacketOrderer = new Aa(t), this.isClosed_ = !1, this.connectTimeoutTimer_ = setTimeout(function () { 11497 s.log_("Timed out trying to connect."), s.onClosed_(), s.connectTimeoutTimer_ = null 11498 }, Math.floor(3e4)), n = function () { 11499 var t; 11500 s.isClosed_ || (s.scriptTagHolder = new xa(function () { 11501 for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e]; 11502 var n = eo(t, 5), 11503 r = n[0], 11504 i = n[1], 11505 o = n[2]; 11506 n[3], n[4]; 11507 if (s.incrementIncomingBytes_(t), s.scriptTagHolder) 11508 if (s.connectTimeoutTimer_ && (clearTimeout(s.connectTimeoutTimer_), s.connectTimeoutTimer_ = null), s.everConnected_ = !0, "start" === r) s.id = i, s.password = o; 11509 else { 11510 if ("close" !== r) throw new Error("Unrecognized command received: " + r); 11511 i ? (s.scriptTagHolder.sendNewPolls = !1, s.myPacketOrderer.closeAfter(i, function () { 11512 s.onClosed_() 11513 })) : s.onClosed_() 11514 } 11515 }, function () { 11516 for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e]; 11517 var n = eo(t, 2), 11518 r = n[0], 11519 n = n[1]; 11520 s.incrementIncomingBytes_(t), s.myPacketOrderer.handleResponse(r, n) 11521 }, function () { 11522 s.onClosed_() 11523 }, s.urlFn), (t = { 11524 start: "t" 11525 }).ser = Math.floor(1e8 * Math.random()), s.scriptTagHolder.uniqueCallbackIdentifier && (t.cb = s.scriptTagHolder.uniqueCallbackIdentifier), t.v = "5", s.transportSessionId && (t.s = s.transportSessionId), s.lastSessionId && (t.ls = s.lastSessionId), s.applicationId && (t.p = s.applicationId), "undefined" != typeof location && location.hostname && ya.test(location.hostname) && (t.r = "f"), t = s.urlFn(t), s.log_("Connecting via long-poll to " + t), s.scriptTagHolder.addTag(t, function () {})) 11526 }, "complete" === document.readyState ? n() : (r = !1, i = function () { 11527 document.body ? r || (r = !0, n()) : setTimeout(i, Math.floor(10)) 11528 }, document.addEventListener ? (document.addEventListener("DOMContentLoaded", i, !1), window.addEventListener("load", i, !1)) : document.attachEvent && (document.attachEvent("onreadystatechange", function () { 11529 "complete" === document.readyState && i() 11530 }), window.attachEvent("onload", i))) 11531 }, Da.prototype.start = function () { 11532 this.scriptTagHolder.startLongPoll(this.id, this.password), this.addDisconnectPingFrame(this.id, this.password) 11533 }, Da.forceAllow = function () { 11534 Da.forceAllow_ = !0 11535 }, Da.forceDisallow = function () { 11536 Da.forceDisallow_ = !0 11537 }, Da.isAvailable = function () { 11538 return !!Da.forceAllow_ || !(Da.forceDisallow_ || "undefined" == typeof document || null == document.createElement || "object" == typeof window && window.chrome && window.chrome.extension && !/^chrome/.test(window.location.href) || "object" == typeof Windows && "object" == typeof Windows.UI) 11539 }, Da.prototype.markConnectionHealthy = function () {}, Da.prototype.shutdown_ = function () { 11540 this.isClosed_ = !0, this.scriptTagHolder && (this.scriptTagHolder.close(), this.scriptTagHolder = null), this.myDisconnFrame && (document.body.removeChild(this.myDisconnFrame), this.myDisconnFrame = null), this.connectTimeoutTimer_ && (clearTimeout(this.connectTimeoutTimer_), this.connectTimeoutTimer_ = null) 11541 }, Da.prototype.onClosed_ = function () { 11542 this.isClosed_ || (this.log_("Longpoll is closing itself"), this.shutdown_(), this.onDisconnect_ && (this.onDisconnect_(this.everConnected_), this.onDisconnect_ = null)) 11543 }, Da.prototype.close = function () { 11544 this.isClosed_ || (this.log_("Longpoll is being closed."), this.shutdown_()) 11545 }, Da.prototype.send = function (t) { 11546 t = Ro(t); 11547 this.bytesSent += t.length, this.stats_.incrementCounter("bytes_sent", t.length); 11548 for (var t = function (t) { 11549 t = ro(t); 11550 return uo.encodeByteArray(t, !0) 11551 }(t), e = Vs(t, 1840), n = 0; n < e.length; n++) this.scriptTagHolder.enqueueSegment(this.curSegmentNum, e.length, e[n]), this.curSegmentNum++ 11552 }, Da.prototype.addDisconnectPingFrame = function (t, e) { 11553 this.myDisconnFrame = document.createElement("iframe"); 11554 var n = { 11555 dframe: "t" 11556 }; 11557 n.id = t, n.pw = e, this.myDisconnFrame.src = this.urlFn(n), this.myDisconnFrame.style.display = "none", document.body.appendChild(this.myDisconnFrame) 11558 }, Da.prototype.incrementIncomingBytes_ = function (t) { 11559 t = Ro(t).length; 11560 this.bytesReceived += t, this.stats_.incrementCounter("bytes_received", t) 11561 }, Da); 11562 11563 function Da(t, e, n, r, i) { 11564 this.connId = t, this.repoInfo = e, this.applicationId = n, this.transportSessionId = r, this.lastSessionId = i, this.bytesSent = 0, this.bytesReceived = 0, this.everConnected_ = !1, this.log_ = Js(t), this.stats_ = Na(e), this.urlFn = function (t) { 11565 return Ia(e, ba, t) 11566 } 11567 } 11568 var xa = (La.createIFrame_ = function () { 11569 var e = document.createElement("iframe"); 11570 if (e.style.display = "none", !document.body) throw "Document body has not initialized. Wait to initialize Firebase until after the document is ready.";
11571 document.body.appendChild(e); 11572 try { 11573 e.contentWindow.document || Xs("No IE domain setting required") 11574 } catch (t) { 11575 var n = document.domain; 11576 e.src = "javascript:void((function(){document.open();document.domain='" + n + "';document.close();})())" 11577 } 11578 return e.contentDocument ? e.doc = e.contentDocument : e.contentWindow ? e.doc = e.contentWindow.document : e.document && (e.doc = e.document), e 11579 }, La.prototype.close = function () { 11580 var t = this; 11581 this.alive = !1, this.myIFrame && (this.myIFrame.doc.body.innerHTML = "", setTimeout(function () { 11582 null !== t.myIFrame && (document.body.removeChild(t.myIFrame), t.myIFrame = null) 11583 }, Math.floor(0))); 11584 var e = this.onDisconnect; 11585 e && (this.onDisconnect = null, e()) 11586 }, La.prototype.startLongPoll = function (t, e) { 11587 for (this.myID = t, this.myPW = e, this.alive = !0; this.newRequest_();); 11588 }, La.prototype.newRequest_ = function () { 11589 if (this.alive && this.sendNewPolls && this.outstandingRequests.size < (0 < this.pendingSegs.length ? 2 : 1)) { 11590 this.currentSerial++; 11591 var t = {}; 11592 t.id = this.myID, t.pw = this.myPW, t.ser = this.currentSerial; 11593 for (var t = this.urlFn(t), e = "", n = 0; 0 < this.pendingSegs.length;) { 11594 if (!(this.pendingSegs[0].d.length + 30 + e.length <= 1870)) break; 11595 var r = this.pendingSegs.shift(), 11596 e = e + "&seg" + n + "=" + r.seg + "&ts" + n + "=" + r.ts + "&d" + n + "=" + r.d; 11597 n++ 11598 } 11599 return t += e, this.addLongPollTag_(t, this.currentSerial), !0 11600 } 11601 return !1 11602 }, La.prototype.enqueueSegment = function (t, e, n) { 11603 this.pendingSegs.push({ 11604 seg: t, 11605 ts: e, 11606 d: n 11607 }), this.alive && this.newRequest_() 11608 }, La.prototype.addLongPollTag_ = function (t, e) { 11609 var n = this; 11610 this.outstandingRequests.add(e); 11611 11612 function r() { 11613 n.outstandingRequests.delete(e), n.newRequest_() 11614 } 11615 var i = setTimeout(r, Math.floor(25e3)); 11616 this.addTag(t, function () { 11617 clearTimeout(i), r() 11618 }) 11619 }, La.prototype.addTag = function (t, n) { 11620 var r = this; 11621 setTimeout(function () { 11622 try { 11623 if (!r.sendNewPolls) return; 11624 var e = r.myIFrame.doc.createElement("script"); 11625 e.type = "text/javascript", e.async = !0, e.src = t, e.onload = e.onreadystatechange = function () { 11626 var t = e.readyState; 11627 t && "loaded" !== t && "complete" !== t || (e.onload = e.onreadystatechange = null, e.parentNode && e.parentNode.removeChild(e), n()) 11628 }, e.onerror = function () { 11629 Xs("Long-poll script failed to load: " + t), r.sendNewPolls = !1, r.close() 11630 }, r.myIFrame.doc.body.appendChild(e) 11631 } catch (t) {} 11632 }, Math.floor(1)) 11633 }, La); 11634 11635 function La(t, e, n, r) { 11636 this.onDisconnect = n, this.urlFn = r, this.outstandingRequests = new Set, this.pendingSegs = [], this.currentSerial = Math.floor(1e8 * Math.random()), this.sendNewPolls = !0, this.uniqueCallbackIdentifier = Gs(), window[Ra + this.uniqueCallbackIdentifier] = t, window[Pa + this.uniqueCallbackIdentifier] = e, this.myIFrame = La.createIFrame_(); 11637 var e = "", 11638 i = "<html><body>" + (e = this.myIFrame.src && "javascript:" === this.myIFrame.src.substr(0, "javascript:".length) ? '<script>document.domain="' + document.domain + '";<\/script>' : e) + "</body></html>"; 11639 try { 11640 this.myIFrame.doc.open(), this.myIFrame.doc.write(i), this.myIFrame.doc.close() 11641 } catch (t) { 11642 Xs("frame writing exception"), t.stack && Xs(t.stack), Xs(t) 11643 } 11644 } 11645 var Ma = ""; 11646 11647 function Fa(t) { 11648 Ma = t 11649 } 11650 var Ua = null; 11651 "undefined" != typeof MozWebSocket ? Ua = MozWebSocket : "undefined" != typeof WebSocket && (Ua = WebSocket); 11652 var ja = (qa.connectionURL_ = function (t, e, n) { 11653 var r = { 11654 v: "5" 11655 }; 11656 return "undefined" != typeof location && location.hostname && ya.test(location.hostname) && (r.r = "f"), e && (r.s = e), n && (r.ls = n), Ia(t, ma, r) 11657 }, qa.prototype.open = function (e, t) { 11658 var n, r = this; 11659 this.onDisconnect = t, this.onMessage = e, this.log_("Websocket connecting to " + this.connURL), this.everConnected_ = !1, Ks.set("previous_websocket_failure", !0); 11660 try { 11661 mo() || (n = { 11662 headers: { 11663 "X-Firebase-GMPID": this.applicationId || "" 11664 } 11665 }, this.mySock = new Ua(this.connURL, [], n)) 11666 } catch (t) { 11667 this.log_("Error instantiating WebSocket."); 11668 e = t.message || t.data; 11669 return e && this.log_(e), void this.onClosed_() 11670 } 11671 this.mySock.onopen = function () { 11672 r.log_("Websocket connected."), r.everConnected_ = !0 11673 }, this.mySock.onclose = function () { 11674 r.log_("Websocket connection was disconnected."), r.mySock = null, r.onClosed_() 11675 }, this.mySock.onmessage = function (t) { 11676 r.handleIncomingFrame(t) 11677 }, this.mySock.onerror = function (t) { 11678 r.log_("WebSocket error. Closing connection."); 11679 t = t.message || t.data; 11680 t && r.log_(t), r.onClosed_() 11681 } 11682 }, qa.prototype.start = function () {}, qa.forceDisallow = function () { 11683 qa.forceDisallow_ = !0 11684 }, qa.isAvailable = function () { 11685 var t, e = !1; 11686 return "undefined" != typeof navigator && navigator.userAgent && ((t = navigator.userAgent.match(/Android ([0-9]{0,}\.[0-9]{0,})/)) && 1 < t.length && parseFloat(t[1]) < 4.4 && (e = !0)), !e && null !== Ua && !qa.forceDisallow_ 11687 }, qa.previouslyFailed = function () { 11688 return Ks.isInMemoryStorage || !0 === Ks.get("previous_websocket_failure") 11689 }, qa.prototype.markConnectionHealthy = function () { 11690 Ks.remove("previous_websocket_failure") 11691 }, qa.prototype.appendFrame_ = function (t) { 11692 this.frames.push(t), this.frames.length === this.totalFrames && (t = this.frames.join(""), this.frames = null, t = ko(t), this.onMessage(t)) 11693 }, qa.prototype.handleNewFrameCount_ = function (t) { 11694 this.totalFrames = t, this.frames = [] 11695 }, qa.prototype.extractFrameCount_ = function (t) { 11696 if (so(null === this.frames, "We already have a frame buffer"), t.length <= 6) { 11697 var e = Number(t); 11698 if (!isNaN(e)) return this.handleNewFrameCount_(e), null 11699 } 11700 return this.handleNewFrameCount_(1), t 11701 }, qa.prototype.handleIncomingFrame = function (t) { 11702 null !== this.mySock && (t = t.data, this.bytesReceived += t.length, this.stats_.incrementCounter("bytes_received", t.length), this.resetKeepAlive(), null !== this.frames ? this.appendFrame_(t) : null !== (t = this.extractFrameCount_(t)) && this.appendFrame_(t)) 11703 }, qa.prototype.send = function (t) { 11704 this.resetKeepAlive(); 11705 t = Ro(t); 11706 this.bytesSent += t.length, this.stats_.incrementCounter("bytes_sent", t.length); 11707 var e = Vs(t, 16384); 11708 1 < e.length && this.sendString_(String(e.length)); 11709 for (var n = 0; n < e.length; n++) this.sendString_(e[n]) 11710 }, qa.prototype.shutdown_ = function () { 11711 this.isClosed_ = !0, this.keepaliveTimer && (clearInterval(this.keepaliveTimer), this.keepaliveTimer = null), this.mySock && (this.mySock.close(), this.mySock = null) 11712 }, qa.prototype.onClosed_ = function () { 11713 this.isClosed_ || (this.log_("WebSocket is closing itself"), this.shutdown_(), this.onDisconnect && (this.onDisconnect(this.everConnected_), this.onDisconnect = null)) 11714 }, qa.prototype.close = function () { 11715 this.isClosed_ || (this.log_("WebSocket is being closed"), this.shutdown_()) 11716 }, qa.prototype.resetKeepAlive = function () { 11717 var t = this; 11718 clearInterval(this.keepaliveTimer), this.keepaliveTimer = setInterval(function () { 11719 t.mySock && t.sendString_("0"), t.resetKeepAlive() 11720 }, Math.floor(45e3)) 11721 }, qa.prototype.sendString_ = function (t) { 11722 try { 11723 this.mySock.send(t) 11724 } catch (t) { 11725 this.log_("Exception thrown from WebSocket.send():", t.message || t.data, "Closing connection."), setTimeout(this.onClosed_.bind(this), 0) 11726 } 11727 }
11727, qa.responsesRequiredToBeHealthy = 2, qa.healthyTimeout = 3e4, qa); 11728 11729 function qa(t, e, n, r, i) { 11730 this.connId = t, this.applicationId = n, this.keepaliveTimer = null, this.frames = null, this.totalFrames = 0, this.bytesSent = 0, this.bytesReceived = 0, this.log_ = Js(this.connId), this.stats_ = Na(e), this.connURL = qa.connectionURL_(e, r, i), this.nodeAdmin = e.nodeAdmin 11731 } 11732 var Va = (Object.defineProperty(Ba, "ALL_TRANSPORTS", { 11733 get: function () { 11734 return [Oa, ja] 11735 }, 11736 enumerable: !1, 11737 configurable: !0 11738 }), Ba.prototype.initTransports_ = function (t) { 11739 var e, n, r = ja && ja.isAvailable(), 11740 i = r && !ja.previouslyFailed(); 11741 if (t.webSocketOnly && (r || Zs("wss:// URL used, but browser isn't known to support websockets. Trying anyway."), i = !0), i) this.transports_ = [ja]; 11742 else { 11743 var o = this.transports_ = []; 11744 try { 11745 for (var s = to(Ba.ALL_TRANSPORTS), a = s.next(); !a.done; a = s.next()) { 11746 var u = a.value; 11747 u && u.isAvailable() && o.push(u) 11748 } 11749 } catch (t) { 11750 e = { 11751 error: t 11752 } 11753 } finally { 11754 try { 11755 a && !a.done && (n = s.return) && n.call(s) 11756 } finally { 11757 if (e) throw e.error 11758 } 11759 } 11760 } 11761 }, Ba.prototype.initialTransport = function () { 11762 if (0 < this.transports_.length) return this.transports_[0]; 11763 throw new Error("No transports available") 11764 }, Ba.prototype.upgradeTransport = function () { 11765 return 1 < this.transports_.length ? this.transports_[1] : null 11766 }, Ba); 11767 11768 function Ba(t) { 11769 this.initTransports_(t) 11770 } 11771 var Ka = (Wa.prototype.start_ = function () { 11772 var t = this, 11773 e = this.transportManager_.initialTransport(); 11774 this.conn_ = new e(this.nextTransportId_(), this.repoInfo_, this.applicationId_, void 0, this.lastSessionId), this.primaryResponsesRequired_ = e.responsesRequiredToBeHealthy || 0; 11775 var n = this.connReceiver_(this.conn_), 11776 r = this.disconnReceiver_(this.conn_); 11777 this.tx_ = this.conn_, this.rx_ = this.conn_, this.secondaryConn_ = null, this.isHealthy_ = !1, setTimeout(function () { 11778 t.conn_ && t.conn_.open(n, r) 11779 }, Math.floor(0)); 11780 e = e.healthyTimeout || 0; 11781 0 < e && (this.healthyTimeout_ = sa(function () { 11782 t.healthyTimeout_ = null, t.isHealthy_ || (t.conn_ && 102400 < t.conn_.bytesReceived ? (t.log_("Connection exceeded healthy timeout but has received " + t.conn_.bytesReceived + " bytes. Marking connection healthy."), t.isHealthy_ = !0, t.conn_.markConnectionHealthy()) : t.conn_ && 10240 < t.conn_.bytesSent ? t.log_("Connection exceeded healthy timeout but has sent " + t.conn_.bytesSent + " bytes. Leaving connection alive.") : (t.log_("Closing unhealthy connection after timeout."), t.close())) 11783 }, Math.floor(e))) 11784 }, Wa.prototype.nextTransportId_ = function () { 11785 return "c:" + this.id + ":" + this.connectionCount++ 11786 }, Wa.prototype.disconnReceiver_ = function (e) { 11787 var n = this; 11788 return function (t) { 11789 e === n.conn_ ? n.onConnectionLost_(t) : e === n.secondaryConn_ ? (n.log_("Secondary connection lost."), n.onSecondaryConnectionLost_()) : n.log_("closing an old connection") 11790 } 11791 }, Wa.prototype.connReceiver_ = function (e) { 11792 var n = this; 11793 return function (t) { 11794 2 !== n.state_ && (e === n.rx_ ? n.onPrimaryMessageReceived_(t) : e === n.secondaryConn_ ? n.onSecondaryMessageReceived_(t) : n.log_("message on old connection")) 11795 } 11796 }, Wa.prototype.sendRequest = function (t) { 11797 t = { 11798 t: "d", 11799 d: t 11800 }; 11801 this.sendData_(t) 11802 }, Wa.prototype.tryCleanupConnection = function () { 11803 this.tx_ === this.secondaryConn_ && this.rx_ === this.secondaryConn_ && (this.log_("cleaning up and promoting a connection: " + this.secondaryConn_.connId), this.conn_ = this.secondaryConn_, this.secondaryConn_ = null) 11804 }, Wa.prototype.onSecondaryControl_ = function (t) { 11805 "t" in t && ("a" === (t = t.t) ? this.upgradeIfSecondaryHealthy_() : "r" === t ? (this.log_("Got a reset on secondary, closing it"), this.secondaryConn_.close(), this.tx_ !== this.secondaryConn_ && this.rx_ !== this.secondaryConn_ || this.close()) : "o" === t && (this.log_("got pong on secondary."), this.secondaryResponsesRequired_--, this.upgradeIfSecondaryHealthy_())) 11806 }, Wa.prototype.onSecondaryMessageReceived_ = function (t) { 11807 var e = qs("t", t), 11808 t = qs("d", t); 11809 if ("c" === e) this.onSecondaryControl_(t); 11810 else { 11811 if ("d" !== e) throw new Error("Unknown protocol layer: " + e); 11812 this.pendingDataMessages.push(t) 11813 } 11814 }, Wa.prototype.upgradeIfSecondaryHealthy_ = function () { 11815 this.secondaryResponsesRequired_ <= 0 ? (this.log_("Secondary connection is healthy."), this.isHealthy_ = !0, this.secondaryConn_.markConnectionHealthy(), this.proceedWithUpgrade_()) : (this.log_("sending ping on secondary."), this.secondaryConn_.send({ 11816 t: "c", 11817 d: { 11818 t: "p", 11819 d: {} 11820 } 11821 })) 11822 }, Wa.prototype.proceedWithUpgrade_ = function () { 11823 this.secondaryConn_.start(), this.log_("sending client ack on secondary"), this.secondaryConn_.send({ 11824 t: "c", 11825 d: { 11826 t: "a", 11827 d: {} 11828 } 11829 }), this.log_("Ending transmission on primary"), this.conn_.send({ 11830 t: "c", 11831 d: { 11832 t: "n", 11833 d: {} 11834 } 11835 }), this.tx_ = this.secondaryConn_, this.tryCleanupConnection() 11836 }, Wa.prototype.onPrimaryMessageReceived_ = function (t) { 11837 var e = qs("t", t), 11838 t = qs("d", t); 11839 "c" === e ? this.onControl_(t) : "d" === e && this.onDataMessage_(t) 11840 }, Wa.prototype.onDataMessage_ = function (t) { 11841 this.onPrimaryResponse_(), this.onMessage_(t) 11842 }, Wa.prototype.onPrimaryResponse_ = function () { 11843 this.isHealthy_ || (this.primaryResponsesRequired_--, this.primaryResponsesRequired_ <= 0 && (this.log_("Primary connection is healthy."), this.isHealthy_ = !0, this.conn_.markConnectionHealthy())) 11844 }, Wa.prototype.onControl_ = function (t) { 11845 var e = qs("t", t); 11846 if ("d" in t) { 11847 t = t.d; 11848 if ("h" === e) this.onHandshake_(t); 11849 else if ("n" === e) { 11850 this.log_("recvd end transmission on primary"), this.rx_ = this.secondaryConn_; 11851 for (var n = 0; n < this.pendingDataMessages.length; ++n) this.onDataMessage_(this.pendingDataMessages[n]); 11852 this.pendingDataMessages = [], this.tryCleanupConnection() 11853 } else "s" === e ? this.onConnectionShutdown_(t) : "r" === e ? this.onReset_(t) : "e" === e ? Fs("Server Error: " + t) : "o" === e ? (this.log_("got pong on primary."), this.onPrimaryResponse_(), this.sendPingOnPrimaryIfNecessary_()) : Fs("Unknown control packet command: " + e) 11854 } 11855 }, Wa.prototype.onHandshake_ = function (t) { 11856 var e = t.ts, 11857 n = t.v, 11858 r = t.h; 11859 this.sessionId = t.s, this.repoInfo_.host = r, 0 === this.state_ && (this.conn_.start(), this.onConnectionEstablished_(this.conn_, e), "5" !== n && Zs("Protocol version mismatch detected"), this.tryStartUpgrade_()) 11860 }, Wa.prototype.tryStartUpgrade_ = function () { 11861 var t = this.transportManager_.upgradeTransport(); 11862 t && this.startUpgrade_(t) 11863 }, Wa.prototype.startUpgrade_ = function (t) { 11864 var e = this; 11865 this.secondaryConn_ = new t(this.nextTransportId_(), this.repoInfo_, this.applicationId_, this.sessionId), this.secondaryResponsesRequired_ = t.responsesRequiredToBeHealthy || 0; 11866 var n = this.connReceiver_(this.secondaryConn_), 11867 t = this.disconnReceiver_(this.secondaryConn_); 11868 this.secondaryConn_.open(n, t), sa(function () { 11869 e.secondaryConn_ && (e.log_("Timed out trying to upgrade."), e.secondaryConn_.close()) 11870 }, Math.floor(6e4)) 11871 }, Wa.prototype.onReset_ = function (t) { 11872 this.log_("Reset packet received. New host: " + t), this.repoInfo_.host = t, 1 === this.state_ ? this.close() : (this.closeConnections_(), this.start_()) 11873 }, Wa.prototype.onConnectionEstablished_ = function (t, e) { 11874 var n = this; 11875 this.log_("Realtime connection established."), this.conn_ = t, this.state_ = 1, this.onReady_ && (this.onReady_(e, this.sessionId), this.onReady_ = null), 0 === this.primaryResponsesRequired_ ? (this.log_("Primary connection is healthy."), this.isHealthy_ = !0) : s
11875a(function () { 11876 n.sendPingOnPrimaryIfNecessary_() 11877 }, Math.floor(5e3)) 11878 }, Wa.prototype.sendPingOnPrimaryIfNecessary_ = function () { 11879 this.isHealthy_ || 1 !== this.state_ || (this.log_("sending ping on primary."), this.sendData_({ 11880 t: "c", 11881 d: { 11882 t: "p", 11883 d: {} 11884 } 11885 })) 11886 }, Wa.prototype.onSecondaryConnectionLost_ = function () { 11887 var t = this.secondaryConn_; 11888 this.secondaryConn_ = null, this.tx_ !== t && this.rx_ !== t || this.close() 11889 }, Wa.prototype.onConnectionLost_ = function (t) { 11890 this.conn_ = null, t || 0 !== this.state_ ? 1 === this.state_ && this.log_("Realtime connection lost.") : (this.log_("Realtime connection failed."), this.repoInfo_.isCacheableHost() && (Ks.remove("host:" + this.repoInfo_.host), this.repoInfo_.internalHost = this.repoInfo_.host)), this.close() 11891 }, Wa.prototype.onConnectionShutdown_ = function (t) { 11892 this.log_("Connection shutdown command received. Shutting down..."), this.onKill_ && (this.onKill_(t), this.onKill_ = null), this.onDisconnect_ = null, this.close() 11893 }, Wa.prototype.sendData_ = function (t) { 11894 if (1 !== this.state_) throw "Connection is not connected"; 11895 this.tx_.send(t) 11896 }, Wa.prototype.close = function () { 11897 2 !== this.state_ && (this.log_("Closing realtime connection."), this.state_ = 2, this.closeConnections_(), this.onDisconnect_ && (this.onDisconnect_(), this.onDisconnect_ = null)) 11898 }, Wa.prototype.closeConnections_ = function () { 11899 this.log_("Shutting down all connections"), this.conn_ && (this.conn_.close(), this.conn_ = null), this.secondaryConn_ && (this.secondaryConn_.close(), this.secondaryConn_ = null), this.healthyTimeout_ && (clearTimeout(this.healthyTimeout_), this.healthyTimeout_ = null) 11900 }, Wa); 11901 11902 function Wa(t, e, n, r, i, o, s, a) { 11903 this.id = t, this.repoInfo_ = e, this.applicationId_ = n, this.onMessage_ = r, this.onReady_ = i, this.onDisconnect_ = o, this.onKill_ = s, this.lastSessionId = a, this.connectionCount = 0, this.pendingDataMessages = [], this.state_ = 0, this.log_ = Js("c:" + this.id + ":"), this.transportManager_ = new Va(e), this.log_("Connection created"), this.start_() 11904 } 11905 Ha.prototype.put = function (t, e, n, r) {}, Ha.prototype.merge = function (t, e, n, r) {}, Ha.prototype.refreshAuthToken = function (t) {}, Ha.prototype.onDisconnectPut = function (t, e, n) {}, Ha.prototype.onDisconnectMerge = function (t, e, n) {}, Ha.prototype.onDisconnectCancel = function (t, e) {}, Ha.prototype.reportStats = function (t) {}, z = Ha; 11906 11907 function Ha() {} 11908 var Ga = (za.prototype.trigger = function (t) { 11909 for (var e = [], n = 1; n < arguments.length; n++) e[n - 1] = arguments[n]; 11910 if (Array.isArray(this.listeners_[t])) 11911 for (var r = no([], eo(this.listeners_[t])), i = 0; i < r.length; i++) r[i].callback.apply(r[i].context, e) 11912 }, za.prototype.on = function (t, e, n) { 11913 this.validateEventType_(t), this.listeners_[t] = this.listeners_[t] || [], this.listeners_[t].push({ 11914 callback: e, 11915 context: n 11916 }); 11917 t = this.getInitialEvent(t); 11918 t && e.apply(n, t) 11919 }, za.prototype.off = function (t, e, n) { 11920 this.validateEventType_(t); 11921 for (var r = this.listeners_[t] || [], i = 0; i < r.length; i++) 11922 if (r[i].callback === e && (!n || n === r[i].context)) return void r.splice(i, 1) 11923 }, za.prototype.validateEventType_ = function (e) { 11924 so(this.allowedEvents_.find(function (t) { 11925 return t === e 11926 }), "Unknown event: " + e) 11927 }, za); 11928 11929 function za(t) { 11930 this.allowedEvents_ = t, this.listeners_ = {}, so(Array.isArray(t) && 0 < t.length, "Requires a non-empty array") 11931 } 11932 var Qa, Ya = (Xi(Xa, Qa = Ga), Xa.getInstance = function () { 11933 return new Xa 11934 }, Xa.prototype.getInitialEvent = function (t) { 11935 return so("online" === t, "Unknown event type: " + t), [this.online_] 11936 }, Xa.prototype.currentlyOnline = function () { 11937 return this.online_ 11938 }, Xa); 11939 11940 function Xa() { 11941 var t = Qa.call(this, ["online"]) || this; 11942 return t.online_ = !0, "undefined" == typeof window || void 0 === window.addEventListener || vo() || (window.addEventListener("online", function () { 11943 t.online_ || (t.online_ = !0, t.trigger("online", !0)) 11944 }, !1), window.addEventListener("offline", function () { 11945 t.online_ && (t.online_ = !1, t.trigger("online", !1)) 11946 }, !1)), t 11947 } 11948 var Ja = 32, 11949 $a = 768, 11950 Za = (tu.prototype.toString = function () { 11951 for (var t = "", e = this.pieceNum_; e < this.pieces_.length; e++) "" !== this.pieces_[e] && (t += "/" + this.pieces_[e]); 11952 return t || "/" 11953 }, tu); 11954 11955 function tu(t, e) { 11956 if (void 0 === e) { 11957 this.pieces_ = t.split("/"); 11958 for (var n = 0, r = 0; r < this.pieces_.length; r++) 0 < this.pieces_[r].length && (this.pieces_[n] = this.pieces_[r], n++); 11959 this.pieces_.length = n, this.pieceNum_ = 0 11960 } else this.pieces_ = t, this.pieceNum_ = e 11961 } 11962 11963 function eu() { 11964 return new Za("") 11965 } 11966 11967 function nu(t) { 11968 return t.pieceNum_ >= t.pieces_.length ? null : t.pieces_[t.pieceNum_] 11969 } 11970 11971 function ru(t) { 11972 return t.pieces_.length - t.pieceNum_ 11973 } 11974 11975 function iu(t) { 11976 var e = t.pieceNum_; 11977 return e < t.pieces_.length && e++, new Za(t.pieces_, e) 11978 } 11979 11980 function ou(t) { 11981 return t.pieceNum_ < t.pieces_.length ? t.pieces_[t.pieces_.length - 1] : null 11982 } 11983 11984 function su(t, e) { 11985 return void 0 === e && (e = 0), t.pieces_.slice(t.pieceNum_ + e) 11986 } 11987 11988 function au(t) { 11989 if (t.pieceNum_ >= t.pieces_.length) return null; 11990 for (var e = [], n = t.pieceNum_; n < t.pieces_.length - 1; n++) e.push(t.pieces_[n]); 11991 return new Za(e, 0) 11992 } 11993 11994 function uu(t, e) { 11995 for (var n = [], r = t.pieceNum_; r < t.pieces_.length; r++) n.push(t.pieces_[r]); 11996 if (e instanceof Za) 11997 for (r = e.pieceNum_; r < e.pieces_.length; r++) n.push(e.pieces_[r]); 11998 else 11999 for (var i = e.split("/"), r = 0; r < i.length; r++) 0 < i[r].length && n.push(i[r]); 12000 return new Za(n, 0) 12001 } 12002 12003 function cu(t) { 12004 return t.pieceNum_ >= t.pieces_.length 12005 } 12006 12007 function hu(t, e) { 12008 var n = nu(t), 12009 r = nu(e); 12010 if (null === n) return e; 12011 if (n === r) return hu(iu(t), iu(e));
12012 throw new Error("INTERNAL ERROR: innerPath (" + e + ") is not within outerPath (" + t + ")") 12013 } 12014 12015 function lu(t, e) { 12016 for (var n = su(t, 0), r = su(e, 0), i = 0; i < n.length && i < r.length; i++) { 12017 var o = na(n[i], r[i]); 12018 if (0 !== o) return o 12019 } 12020 return n.length === r.length ? 0 : n.length < r.length ? -1 : 1 12021 } 12022 12023 function fu(t, e) { 12024 if (ru(t) !== ru(e)) return !1; 12025 for (var n = t.pieceNum_, r = e.pieceNum_; n <= t.pieces_.length; n++, r++) 12026 if (t.pieces_[n] !== e.pieces_[r]) return !1; 12027 return !0 12028 } 12029 12030 function pu(t, e) { 12031 var n = t.pieceNum_, 12032 r = e.pieceNum_; 12033 if (ru(t) > ru(e)) return !1; 12034 for (; n < t.pieces_.length;) { 12035 if (t.pieces_[n] !== e.pieces_[r]) return !1; 12036 ++n, ++r 12037 } 12038 return !0 12039 } 12040 var du = function (t, e) { 12041 this.errorPrefix_ = e, this.parts_ = su(t, 0), this.byteLength_ = Math.max(1, this.parts_.length); 12042 for (var n = 0; n < this.parts_.length; n++) this.byteLength_ += zo(this.parts_[n]); 12043 vu(this) 12044 }; 12045 12046 function vu(t) { 12047 if (t.byteLength_ > $a) throw new Error(t.errorPrefix_ + "has a key path longer than " + $a + " bytes (" + t.byteLength_ + ")."); 12048 if (t.parts_.length > Ja) throw new Error(t.errorPrefix_ + "path specified exceeds the maximum depth that can be written (" + Ja + ") or object contains a cycle " + gu(t)) 12049 } 12050 12051 function gu(t) { 12052 return 0 === t.parts_.length ? "" : "in property '" + t.parts_.join(".") + "'" 12053 } 12054 var yu, mu = (Xi(bu, yu = Ga), bu.getInstance = function () { 12055 return new bu 12056 }, bu.prototype.getInitialEvent = function (t) { 12057 return so("visible" === t, "Unknown event type: " + t), [this.visible_] 12058 }, bu); 12059 12060 function bu() { 12061 var e, t, n = yu.call(this, ["visible"]) || this; 12062 return "undefined" != typeof document && void 0 !== document.addEventListener && (void 0 !== document.hidden ? (t = "visibilitychange", e = "hidden") : void 0 !== document.mozHidden ? (t = "mozvisibilitychange", e = "mozHidden") : void 0 !== document.msHidden ? (t = "msvisibilitychange", e = "msHidden") : void 0 !== document.webkitHidden && (t = "webkitvisibilitychange", e = "webkitHidden")), n.visible_ = !0, t && document.addEventListener(t, function () { 12063 var t = !document[e]; 12064 t !== n.visible_ && (n.visible_ = t, n.trigger("visible", t)) 12065 }, !1), n 12066 } 12067 var wu, _u = 1e3, 12068 Iu = 3e5, 12069 Tu = (Xi(Eu, wu = z), Eu.prototype.sendRequest = function (t, e, n) { 12070 var r = ++this.requestNumber_, 12071 e = { 12072 r: r, 12073 a: t, 12074 b: e 12075 }; 12076 this.log_(Ro(e)), so(this.connected_, "sendRequest call when we're not connected not allowed."), this.realtime_.sendRequest(e), n && (this.requestCBHash_[r] = n) 12077 }, Eu.prototype.get = function (t) { 12078 var n = this, 12079 r = new lo, 12080 i = { 12081 p: t.path.toString(), 12082 q: t.queryObject() 12083 }, 12084 e = { 12085 action: "g", 12086 request: i, 12087 onComplete: function (t) { 12088 var e = t.d; 12089 "ok" === t.s ? (n.onDataUpdate_(i.p, e, !1, null), r.resolve(e)) : r.reject(e) 12090 } 12091 }; 12092 this.outstandingGets_.push(e), this.outstandingGetCount_++; 12093 var o = this.outstandingGets_.length - 1; 12094 return this.connected_ || setTimeout(function () { 12095 var t = n.outstandingGets_[o]; 12096 void 0 !== t && e === t && (delete n.outstandingGets_[o], n.outstandingGetCount_--, 0 === n.outstandingGetCount_ && (n.outstandingGets_ = []), n.log_("get " + o + " timed out on connection"), r.reject(new Error("Client is offline."))) 12097 }, 3e3), this.connected_ && this.sendGet_(o), r.promise 12098 }, Eu.prototype.listen = function (t, e, n, r) { 12099 var i = t.queryIdentifier(), 12100 o = t.path.toString(); 12101 this.log_("Listen called for " + o + " " + i), this.listens.has(o) || this.listens.set(o, new Map), so(t.getQueryParams().isDefault() || !t.getQueryParams().loadsAllData(), "listen() called for non-default but complete query"), so(!this.listens.get(o).has(i), "listen() called twice for same path/queryId."); 12102 n = { 12103 onComplete: r, 12104 hashFn: e, 12105 query: t, 12106 tag: n 12107 }; 12108 this.listens.get(o).set(i, n), this.connected_ && this.sendListen_(n) 12109 }, Eu.prototype.sendGet_ = function (e) { 12110 var n = this, 12111 r = this.outstandingGets_[e]; 12112 this.sendRequest("g", r.request, function (t) { 12113 delete n.outstandingGets_[e], n.outstandingGetCount_--, 0 === n.outstandingGetCount_ && (n.outstandingGets_ = []), r.onComplete && r.onComplete(t) 12114 }) 12115 }, Eu.prototype.sendListen_ = function (r) { 12116 var i = this, 12117 o = r.query, 12118 s = o.path.toString(), 12119 a = o.queryIdentifier(); 12120 this.log_("Listen on " + s + " for " + a); 12121 var t = { 12122 p: s 12123 }; 12124 r.tag && (t.q = o.queryObject(), t.t = r.tag), t.h = r.hashFn(), this.sendRequest("q", t, function (t) { 12125 var e = t.d, 12126 n = t.s; 12127 Eu.warnOnListenWarnings_(e, o), (i.listens.get(s) && i.listens.get(s).get(a)) === r && (i.log_("listen response", t), "ok" !== n && i.removeListen_(s, a), r.onComplete && r.onComplete(n, e)) 12128 }) 12129 }, Eu.warnOnListenWarnings_ = function (t, e) { 12130 t && "object" == typeof t && Oo(t, "w") && (t = Do(t, "w"), Array.isArray(t) && ~t.indexOf("no_index") && (t = '".indexOn": "' + e.getQueryParams().getIndex().toString() + '"', e = e.path.toString(), Zs("Using an unspecified index. Your data will be downloaded and filtered on the client. Consider adding " + t + " at " + e + " to your security rules for better performance."))) 12131 }, Eu.prototype.refreshAuthToken = function (t) { 12132 this.authToken_ = t, this.log_("Auth token refreshed"), this.authToken_ ? this.tryAuth() : this.connected_ && this.sendRequest("unauth", {}, function () {}), this.reduceReconnectDelayIfAdminCredential_(t) 12133 }, Eu.prototype.reduceReconnectDelayIfAdminCredential_ = function (t) { 12134 (t && 40 === t.length || function (t) { 12135 t = Po(t).claims; 12136 return "object" == typeof t && !0 === t.admin 12137 }(t)) && (this.log_("Admin auth credential detected. Reducing max reconnect time."), this.maxReconnectDelay_ = 3e4) 12138 }, Eu.prototype.tryAuth = function () { 12139 var n, t, e, r = this; 12140 this.connected_ && this.authToken_ && (t = function (t) { 12141 t = Po(t).claims; 12142 return !!t && "object" == typeof t && t.hasOwnProperty("iat") 12143 }(n = this.authToken_) ? "auth" : "gauth", e = { 12144 cred: n 12145 }, null === this.authOverride_ ? e.noauth = !0 : "object" == typeof this.authOverride_ && (e.authvar = this.authOverride_), this.sendRequest(t, e, function (t) { 12146 var e = t.s, 12147 t = t.d || "error"; 12148 r.authToken_ === n && ("ok" === e ? r.invalidAuthTokenCount_ = 0 : r.onAuthRevoked_(e, t)) 12149 })) 12150 }, Eu.prototype.unlisten = function (t, e) { 12151 var n = t.path.toString(), 12152 r = t.queryIdentifier(); 12153 this.log_("Unlisten called for " + n + " " + r), so(t.getQueryParams().isDefault() || !t.getQueryParams().loadsAllData(), "unlisten() called for non-default but complete query"), this.removeListen_(n, r) && this.connected_ && this.sendUnlisten_(n, r, t.queryObject(), e) 12154 }, Eu.prototype.sendUnlisten_ = function (t, e, n, r) { 12155 this.log_("Unlisten on " + t + " for " + e); 12156 t = { 12157 p: t 12158 }; 12159 r && (t.q = n, t.t = r), this.sendRequest("n", t) 12160 }, Eu.prototype.onDisconnectPut = function (t, e, n) { 12161 this.connected_ ? this.sendOnDisconnect_("o", t, e, n) : this.onDisconnectRequestQueue_.push({ 12162 pathString: t, 12163 action: "o", 12164 data: e, 12165 onComplete: n 12166 }) 12167 }, Eu.prototype.onDisconnectMerge = function (t, e, n) { 12168 this.connected_ ? this.sendOnDisconnect_("om", t, e, n) : this.onDisconnectRequestQueue_.push({ 12169 pathString: t, 12170 action: "om", 12171 data: e, 12172 onComplete: n 12173 }) 12174 }, Eu.prototype.onDisconnectCancel = function (t, e) { 12175 this.connected_ ? this.sendOnDisconnect_("oc", t, null, e) : this.onDisconnectRequestQueue_.push({ 12176 pathString: t, 12177 action: "oc", 12178 data: null, 12179 onComplete: e 12180 }) 12181 }, Eu.prototype.sendOnDisconnect_ = function (t, e, n, r) { 12182 n = { 12183 p: e, 12184 d: n 12185 }; 12186 this.log_("onDisconnect " + t, n), this.sendRequest(t, n, function (t) { 12187 r && setTimeout(function () { 12188 r(t.s, t.d) 12189 }, Math.floor(0)) 12190 }) 12191 }, Eu.prototype.put = function (t, e, n, r) { 12192 this.putInternal("p", t, e, n, r) 12193 }, Eu.prototype.merge = function (t, e, n, r) { 12194 this.putInternal("m", t, e, n, r) 12195 }, Eu.prototype.putInternal = function (t, e, n, r, i) { 12196 n = { 12197 p: e, 12198 d: n 12199 }; 12200 void 0 !== i && (n.h = i), this.outstandingPuts_.push({ 12201 action: t, 12202 request: n, 12203 onComplete: r 12204 }), this.outstandingPutCount_++; 12205 r = this.outstandingPuts_.length - 1; 12206 this.connected_ ? this.sendPut_(r) : this.log_("Buffering put: " + e) 12207 }, Eu.prototype.sendPut_ = function (e) { 12208 var n = this, 12209 r = this.outstandingPuts_[e].action, 12210 t = this.outstandingPuts_[e].request, 12211 i = this.outstandingPuts_[e].onComplete; 12212 this.outstandingPuts_[e].queued = this.connected_, this.sendRequest(r, t, function (t) { 12213 n.log_(r + " response", t), delete n.outstandingPuts_[e], n.outstandingPutCount_--, 0 === n.outstandingPutCount_ && (n.outstandingPuts_ = []), i && i(t.s, t.d) 12214 }) 12215 }, Eu.prototype.reportStats = function (t) { 12216 var e = this; 12217 this.connected_ && (t = { 12218 c: t 12219 }, this.log_("reportStats", t), this.sendRequest("s", t, function (t) { 12220 "ok" !== t.s && (t = t.d, e.log_("reportStats", "Error sending stats: " + t)) 12221 })) 12222 }, Eu.prototype.onDataMessage_ = function (t) { 12223 if ("r" in t) { 12224 this.log_("from server: " + Ro(t)); 12225 var e = t.r, 12226 n = this.requestCBHash_[e]; 12227 n && (delete this.requestCBHash_[e], n(t.b)) 12228 } else { 12229 if ("error" in t) throw "A server-side error has occurred: " + t.error; 12230 "a" in t && this.onDataPush_(t.a, t.b) 12231 } 12232 }, Eu.prototype.onDataPush_ = function (t, e) { 12233 this.log_("handleServerMessage", t, e), "d" === t ? this.onDataUpdate_(e.p, e.d, !1, e.t) : "m" === t ? this.onDataUpdate_(e.p, e.d, !0, e.t) : "c" === t ? this.onListenRevoked_(e.p, e.q) : "ac" === t ? this.onAuthRevoked_(e.s, e.d) : "sd" === t ? this.onSecurityDebugPacket_(e) : Fs("Unrecognized action received from server: " + Ro(t) + "\nAre you using the latest client?") 12234 }, Eu.prototype.onReady_ = function (t, e) { 12235 this.log_("connection ready"), this.connected_ = !0, this.lastConnectionEstablishedTime_ = (new Date).getTime(), this.handleTimestamp_(t), this.lastSessionId = e, this.firstConnection_ && this.sendConnectStats_(), this.restoreState_(), this.firstConnection_ = !1, this.onConnectStatus_(!0) 12236 }, Eu.prototype.scheduleConnect_ = function (t) { 12237 var e = this; 12238 so(!this.realtime_, "Scheduling a connect when we're already connected/ing?"), this.establishConnectionTimer_ && clearTimeout(this.establishConnectionTimer_), this.establishConnectionTimer_ = setTimeout(function () { 12239 e.establishConnectionTimer_ = null, e.establishConnection_() 12240 }, Math.floor(t)) 12241 }, Eu.prototype.onVisible_ = function (t) { 12242 t && !this.visible_ && this.reconnectDelay_ === this.maxReconnectDelay_ && (this.log_("Window became visible. Reducing delay."), this.reconnectDelay_ = _u, this.realtime_ || this.scheduleConnect_(0)), this.visible_ = t 12243 }, Eu.prototype.onOnline_ = function (t) { 12244 t ? (this.log_("Browser went online."), this.reconnectDelay_ = _u, this.realtime_ || this.scheduleConnect_(0)) : (this.log_("Browser went offline. Killing connection."), this.realtime_ && this.realtime_.close()) 12245 }, Eu.prototype.onRealtimeDisconnect_ = function () { 12246 var t; 12247 this.log_("data client disconnected"), this.connected_ = !1, this.realtime_ = null, this.cancelSentTransactions_(), this.requestCBHash_ = {}, this.shouldReconnect_() && (this.visible_ ? this.lastConnectionEstablishedTime_ && (3e4 < (new Date).getTime() - this.lastConnectionEstablishedTime_ && (this.reconnectDelay_ = _u), this.lastConnectionEstablishedTime_ = null) : (this.log_("Window isn't visible. Delaying reconnect."), this.reconnectDelay_ = this.maxReconnectDelay_, this.lastConnectionAttemptTime_ = (new Date).getTime()), t = (new Date).getTime() - this.lastConnectionAttemptTime_, t = Math.max(0, this.reconnectDelay_ - t), t = Math.random() * t, this.log_("Trying to re
12247connect in " + t + "ms"), this.scheduleConnect_(t), this.reconnectDelay_ = Math.min(this.maxReconnectDelay_, 1.3 * this.reconnectDelay_)), this.onConnectStatus_(!1) 12248 }, Eu.prototype.establishConnection_ = function () { 12249 var e, n, r, i, o, s, a, u, c, t, h = this; 12250 this.shouldReconnect_() && (this.log_("Making a connection attempt"), this.lastConnectionAttemptTime_ = (new Date).getTime(), this.lastConnectionEstablishedTime_ = null, e = this.onDataMessage_.bind(this), n = this.onReady_.bind(this), r = this.onRealtimeDisconnect_.bind(this), i = this.id + ":" + Eu.nextConnectionId_++, s = (o = this).lastSessionId, a = !1, u = null, c = function () { 12251 u ? u.close() : (a = !0, r()) 12252 }, this.realtime_ = { 12253 close: c, 12254 sendRequest: function (t) { 12255 so(u, "sendRequest call when we're not connected not allowed."), u.sendRequest(t) 12256 } 12257 }, t = this.forceTokenRefresh_, this.forceTokenRefresh_ = !1, this.authTokenProvider_.getToken(t).then(function (t) { 12258 a ? Xs("getToken() completed but was canceled") : (Xs("getToken() completed. Creating connection."), o.authToken_ = t && t.accessToken, u = new Ka(i, o.repoInfo_, o.applicationId_, e, n, r, function (t) { 12259 Zs(t + " (" + o.repoInfo_.toString() + ")"), o.interrupt("server_kill") 12260 }, s)) 12261 }).then(null, function (t) { 12262 o.log_("Failed to get token: " + t), a || (h.repoInfo_.nodeAdmin && Zs(t), c()) 12263 })) 12264 }, Eu.prototype.interrupt = function (t) { 12265 Xs("Interrupting connection for reason: " + t), this.interruptReasons_[t] = !0, this.realtime_ ? this.realtime_.close() : (this.establishConnectionTimer_ && (clearTimeout(this.establishConnectionTimer_), this.establishConnectionTimer_ = null), this.connected_ && this.onRealtimeDisconnect_()) 12266 }, Eu.prototype.resume = function (t) { 12267 Xs("Resuming connection for reason: " + t), delete this.interruptReasons_[t], xo(this.interruptReasons_) && (this.reconnectDelay_ = _u, this.realtime_ || this.scheduleConnect_(0)) 12268 }, Eu.prototype.handleTimestamp_ = function (t) { 12269 t -= (new Date).getTime(); 12270 this.onServerInfoUpdate_({ 12271 serverTimeOffset: t 12272 }) 12273 }, Eu.prototype.cancelSentTransactions_ = function () { 12274 for (var t = 0; t < this.outstandingPuts_.length; t++) { 12275 var e = this.outstandingPuts_[t]; 12276 e && "h" in e.request && e.queued && (e.onComplete && e.onComplete("disconnect"), delete this.outstandingPuts_[t], this.outstandingPutCount_--) 12277 } 12278 0 === this.outstandingPutCount_ && (this.outstandingPuts_ = []) 12279 }, Eu.prototype.onListenRevoked_ = function (t, e) { 12280 e = e ? e.map(function (t) { 12281 return ra(t) 12282 }).join("$") : "default", e = this.removeListen_(t, e); 12283 e && e.onComplete && e.onComplete("permission_denied") 12284 }, Eu.prototype.removeListen_ = function (t, e) { 12285 var n, r = new Za(t).toString(); 12286 return this.listens.has(r) ? (n = (t = this.listens.get(r)).get(e), t.delete(e), 0 === t.size && this.listens.delete(r)) : n = void 0, n 12287 }, Eu.prototype.onAuthRevoked_ = function (t, e) { 12288 Xs("Auth token revoked: " + t + "/" + e), this.authToken_ = null, this.forceTokenRefresh_ = !0, this.realtime_.close(), "invalid_token" !== t && "permission_denied" !== t || (this.invalidAuthTokenCount_++, 3 <= this.invalidAuthTokenCount_ && (this.reconnectDelay_ = 3e4, this.authTokenProvider_.notifyForInvalidToken())) 12289 }, Eu.prototype.onSecurityDebugPacket_ = function (t) { 12290 this.securityDebugCallback_ ? this.securityDebugCallback_(t) : "msg" in t && console.log("FIREBASE: " + t.msg.replace("\n", "\nFIREBASE: ")) 12291 }, Eu.prototype.restoreState_ = function () { 12292 var e, t, n, r; 12293 this.tryAuth(); 12294 try { 12295 for (var i = to(this.listens.values()), o = i.next(); !o.done; o = i.next()) { 12296 var s = o.value; 12297 try { 12298 for (var a = (n = void 0, to(s.values())
12298), u = a.next(); !u.done; u = a.next()) { 12299 var c = u.value; 12300 this.sendListen_(c) 12301 } 12302 } catch (t) { 12303 n = { 12304 error: t 12305 } 12306 } finally { 12307 try { 12308 u && !u.done && (r = a.return) && r.call(a) 12309 } finally { 12310 if (n) throw n.error 12311 } 12312 } 12313 } 12314 } catch (t) { 12315 e = { 12316 error: t 12317 } 12318 } finally { 12319 try { 12320 o && !o.done && (t = i.return) && t.call(i) 12321 } finally { 12322 if (e) throw e.error 12323 } 12324 } 12325 for (var h = 0; h < this.outstandingPuts_.length; h++) this.outstandingPuts_[h] && this.sendPut_(h); 12326 for (; this.onDisconnectRequestQueue_.length;) { 12327 var l = this.onDisconnectRequestQueue_.shift(); 12328 this.sendOnDisconnect_(l.action, l.pathString, l.data, l.onComplete) 12329 } 12330 for (h = 0; h < this.outstandingGets_.length; h++) this.outstandingGets_[h] && this.sendGet_(h) 12331 }, Eu.prototype.sendConnectStats_ = function () { 12332 var t = {}; 12333 t["sdk.js." + Ma.replace(/\./g, "-")] = 1, vo() ? t["framework.cordova"] = 1 : yo() && (t["framework.reactnative"] = 1), this.reportStats(t) 12334 }, Eu.prototype.shouldReconnect_ = function () { 12335 var t = Ya.getInstance().currentlyOnline(); 12336 return xo(this.interruptReasons_) && t 12337 }, Eu.nextPersistentConnectionId_ = 0, Eu.nextConnectionId_ = 0, Eu); 12338 12339 function Eu(t, e, n, r, i, o, s) { 12340 var a = wu.call(this) || this; 12341 if (a.repoInfo_ = t, a.applicationId_ = e, a.onDataUpdate_ = n, a.onConnectStatus_ = r, a.onServerInfoUpdate_ = i, a.authTokenProvider_ = o, a.authOverride_ = s, a.id = Eu.nextPersistentConnectionId_++, a.log_ = Js("p:" + a.id + ":"), a.interruptReasons_ = {}, a.listens = new Map, a.outstandingPuts_ = [], a.outstandingGets_ = [], a.outstandingPutCount_ = 0, a.outstandingGetCount_ = 0, a.onDisconnectRequestQueue_ = [], a.connected_ = !1, a.reconnectDelay_ = _u, a.maxReconnectDelay_ = Iu, a.securityDebugCallback_ = null, a.lastSessionId = null, a.establishConnectionTimer_ = null, a.visible_ = !1, a.requestCBHash_ = {}, a.requestNumber_ = 0, a.realtime_ = null, a.authToken_ = null, a.forceTokenRefresh_ = !1, a.invalidAuthTokenCount_ = 0, a.firstConnection_ = !0, a.lastConnectionAttemptTime_ = null, a.lastConnectionEstablishedTime_ = null, s && !mo()) throw new Error("Auth override specified in options, but not supported on non Node.js platforms"); 12342 return a.scheduleConnect_(0), mu.getInstance().on("visible", a.onVisible_, a), -1 === t.host.indexOf("fblocal") && Ya.getInstance().on("online", a.onOnline_, a), a 12343 } 12344 var Su = (Cu.Wrap = function (t, e) { 12345 return new Cu(t, e) 12346 }, Cu); 12347 12348 function Cu(t, e) { 12349 this.name = t, this.node = e 12350 } 12351 var Nu, G = (Au.prototype.getCompare = function () { 12352 return this.compare.bind(this) 12353 }, Au.prototype.indexedValueChanged = function (t, e) { 12354 t = new Su(ta, t), e = new Su(ta, e); 12355 return 0 !== this.compare(t, e) 12356 }, Au.prototype.minPost = function () { 12357 return Su.MIN 12358 }, Au); 12359 12360 function Au() {} 12361 var ku, Sn = (Xi(Ru, ku = G), Object.defineProperty(Ru, "__EMPTY_NODE", { 12362 get: function () { 12363 return Nu 12364 }, 12365 set: function (t) { 12366 Nu = t 12367 }, 12368 enumerable: !1, 12369 configurable: !0 12370 }), Ru.prototype.compare = function (t, e) { 12371 return na(t.name, e.name) 12372 }, Ru.prototype.isDefinedOn = function (t) { 12373 throw ao("KeyIndex.isDefinedOn not expected to be called.") 12374 }, Ru.prototype.indexedValueChanged = function (t, e) { 12375 return !1 12376 }, Ru.prototype.minPost = function () { 12377 return Su.MIN 12378 }, Ru.prototype.maxPost = function () { 12379 return new Su(ea, Nu) 12380 }, Ru.prototype.makePost = function (t, e) { 12381 return so("string" == typeof t, "KeyIndex indexValue must always be a string."), new Su(t, Nu) 12382 }, Ru.prototype.toString = function () { 12383 return ".key" 12384 }, Ru); 12385 12386 function Ru() { 12387 return null !== ku && ku.apply(this, arguments) || this 12388 } 12389 var Pu = new Sn, 12390 Ou = (Du.prototype.getNext = function () { 12391 if (0 === this.nodeStack_.length) return null; 12392 var t = this.nodeStack_.pop(), 12393 e = this.resultGenerator_ ? this.resultGenerator_(t.key, t.value) : { 12394 key: t.key, 12395 value: t.value 12396 }; 12397 if (this.isReverse_) 12398 for (t = t.left; !t.isEmpty();) this.nodeStack_.push(t), t = t.right; 12399 else 12400 for (t = t.right; !t.isEmpty();) this.nodeStack_.push(t), t = t.left; 12401 return e 12402 }, Du.prototype.hasNext = function () { 12403 return 0 < this.nodeStack_.length 12404 }, Du.prototype.peek = function () { 12405 if (0 === this.nodeStack_.length) return null; 12406 var t = this.nodeStack_[this.nodeStack_.length - 1]; 12407 return this.resultGenerator_ ? this.resultGenerator_(t.key, t.value) : { 12408 key: t.key, 12409 value: t.value 12410 } 12411 }, Du); 12412 12413 function Du(t, e, n, r, i) { 12414 void 0 === i && (i = null), this.isReverse_ = r, this.resultGenerator_ = i, this.nodeStack_ = []; 12415 for (var o = 1; !t.isEmpty();) 12416 if (o = e ? n(t.key, e) : 1, r && (o *= -1), o < 0) t = this.isReverse_ ? t.left : t.right; 12417 else { 12418 if (0 === o) { 12419 this.nodeStack_.push(t); 12420 break 12421 } 12422 this.nodeStack_.push(t), t = this.isReverse_ ? t.right : t.left 12423 } 12424 } 12425 var xu = (Lu.prototype.copy = function (t, e, n, r, i) { 12426 return new Lu(null != t ? t : this.key, null != e ? e : this.value, null != n ? n : this.color, null != r ? r : this.left, null != i ? i : this.right) 12427 }, Lu.prototype.count = function () { 12428 return this.left.count() + 1 + this.right.count() 12429 }, Lu.prototype.isEmpty = function () { 12430 return !1 12431 }, Lu.prototype.inorderTraversal = function (t) { 12432 return this.left.inorderTraversal(t) || !!t(this.key, this.value) || this.right.inorderTraversal(t) 12433 }, Lu.prototype.reverseTraversal = function (t) { 12434 return this.right.reverseTraversal(t) || t(this.key, this.value) || this.left.reverseTraversal(t) 12435 }, Lu.prototype.min_ = function () {
12436 return this.left.isEmpty() ? this : this.left.min_() 12437 }, Lu.prototype.minKey = function () { 12438 return this.min_().key 12439 }, Lu.prototype.maxKey = function () { 12440 return this.right.isEmpty() ? this.key : this.right.maxKey() 12441 }, Lu.prototype.insert = function (t, e, n) { 12442 var r = this, 12443 i = n(t, r.key); 12444 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_() 12445 }, Lu.prototype.removeMin_ = function () { 12446 if (this.left.isEmpty()) return Uu.EMPTY_NODE; 12447 var t = this; 12448 return (t = (t = !t.left.isRed_() && !t.left.left.isRed_() ? t.moveRedLeft_() : t).copy(null, null, null, t.left.removeMin_(), null)).fixUp_() 12449 }, Lu.prototype.remove = function (t, e) { 12450 var n, r = this; 12451 if (e(t, r.key) < 0) r = (r = !(r.left.isEmpty() || r.left.isRed_() || r.left.left.isRed_()) ? r.moveRedLeft_() : r).copy(null, null, null, r.left.remove(t, e), null); 12452 else { 12453 if (0 === e(t, (r = !((r = r.left.isRed_() ? r.rotateRight_() : r).right.isEmpty() || r.right.isRed_() || r.right.left.isRed_()) ? r.moveRedRight_() : r).key)) { 12454 if (r.right.isEmpty()) return Uu.EMPTY_NODE; 12455 n = r.right.min_(), r = r.copy(n.key, n.value, null, null, r.right.removeMin_()) 12456 } 12457 r = r.copy(null, null, null, null, r.right.remove(t, e)) 12458 } 12459 return r.fixUp_() 12460 }, Lu.prototype.isRed_ = function () { 12461 return this.color 12462 }, Lu.prototype.fixUp_ = function () { 12463 var t = this; 12464 return t = (t = (t = t.right.isRed_() && !t.left.isRed_() ? t.rotateLeft_() : t).left.isRed_() && t.left.left.isRed_() ? t.rotateRight_() : t).left.isRed_() && t.right.isRed_() ? t.colorFlip_() : t 12465 }, Lu.prototype.moveRedLeft_ = function () { 12466 var t = this.colorFlip_(); 12467 return t = t.right.left.isRed_() ? (t = (t = t.copy(null, null, null, null, t.right.rotateRight_())).rotateLeft_()).colorFlip_() : t 12468 }, Lu.prototype.moveRedRight_ = function () { 12469 var t = this.colorFlip_(); 12470 return t = t.left.left.isRed_() ? (t = t.rotateRight_()).colorFlip_() : t 12471 }, Lu.prototype.rotateLeft_ = function () { 12472 var t = this.copy(null, null, Lu.RED, null, this.right.left); 12473 return this.right.copy(null, null, this.color, t, null) 12474 }, Lu.prototype.rotateRight_ = function () { 12475 var t = this.copy(null, null, Lu.RED, this.left.right, null); 12476 return this.left.copy(null, null, this.color, null, t) 12477 }, Lu.prototype.colorFlip_ = function () { 12478 var t = this.left.copy(null, null, !this.left.color, null, null), 12479 e = this.right.copy(null, null, !this.right.color, null, null); 12480 return this.copy(null, null, !this.color, t, e) 12481 }, Lu.prototype.checkMaxDepth_ = function () { 12482 var t = this.check_(); 12483 return Math.pow(2, t) <= this.count() + 1 12484 }, Lu.prototype.check_ = function () { 12485 if (this.isRed_() && this.left.isRed_()) throw new Error("Red node has red child(" + this.key + "," + this.value + ")");
12486 if (this.right.isRed_()) throw new Error("Right child of (" + this.key + "," + this.value + ") is red"); 12487 var t = this.left.check_(); 12488 if (t !== this.right.check_()) throw new Error("Black depths differ"); 12489 return t + (this.isRed_() ? 0 : 1) 12490 }, Lu.RED = !0, Lu.BLACK = !1, Lu); 12491 12492 function Lu(t, e, n, r, i) { 12493 this.key = t, this.value = e, this.color = null != n ? n : Lu.RED, this.left = null != r ? r : Uu.EMPTY_NODE, this.right = null != i ? i : Uu.EMPTY_NODE 12494 } 12495 Mu.prototype.copy = function (t, e, n, r, i) { 12496 return this 12497 }, Mu.prototype.insert = function (t, e, n) { 12498 return new xu(t, e, null) 12499 }, Mu.prototype.remove = function (t, e) { 12500 return this 12501 }, Mu.prototype.count = function () { 12502 return 0 12503 }, Mu.prototype.isEmpty = function () { 12504 return !0 12505 }, Mu.prototype.inorderTraversal = function (t) { 12506 return !1 12507 }, Mu.prototype.reverseTraversal = function (t) { 12508 return !1 12509 }, Mu.prototype.minKey = function () { 12510 return null 12511 }, Mu.prototype.maxKey = function () { 12512 return null 12513 }, Mu.prototype.check_ = function () { 12514 return 0 12515 }, Mu.prototype.isRed_ = function () { 12516 return !1 12517 }, Ga = Mu; 12518 12519 function Mu() {} 12520 var Fu, Uu = (ju.prototype.insert = function (t, e) { 12521 return new ju(this.comparator_, this.root_.insert(t, e, this.comparator_).copy(null, null, xu.BLACK, null, null)) 12522 }, ju.prototype.remove = function (t) { 12523 return new ju(this.comparator_, this.root_.remove(t, this.comparator_).copy(null, null, xu.BLACK, null, null)) 12524 }, ju.prototype.get = function (t) { 12525 for (var e, n = this.root_; !n.isEmpty();) { 12526 if (0 === (e = this.comparator_(t, n.key))) return n.value; 12527 e < 0 ? n = n.left : 0 < e && (n = n.right) 12528 } 12529 return null 12530 }, ju.prototype.getPredecessorKey = function (t) { 12531 for (var e, n = this.root_, r = null; !n.isEmpty();) { 12532 if (0 === (e = this.comparator_(t, n.key))) { 12533 if (n.left.isEmpty()) return r ? r.key : null; 12534 for (n = n.left; !n.right.isEmpty();) n = n.right; 12535 return n.key 12536 } 12537 e < 0 ? n = n.left : 0 < e && (n = (r = n).right) 12538 } 12539 throw new Error("Attempted to find predecessor key for a nonexistent key. What gives?") 12540 }, ju.prototype.isEmpty = function () { 12541 return this.root_.isEmpty() 12542 }, ju.prototype.count = function () { 12543 return this.root_.count() 12544 }, ju.prototype.minKey = function () { 12545 return this.root_.minKey() 12546 }, ju.prototype.maxKey = function () { 12547 return this.root_.maxKey() 12548 }, ju.prototype.inorderTraversal = function (t) { 12549 return this.root_.inorderTraversal(t) 12550 }, ju.prototype.reverseTraversal = function (t) { 12551 return this.root_.reverseTraversal(t) 12552 }, ju.prototype.getIterator = function (t) { 12553 return new Ou(this.root_, null, this.comparator_, !1, t) 12554 }, ju.prototype.getIteratorFrom = function (t, e) { 12555 return new Ou(this.root_, t, this.comparator_, !1, e) 12556 }, ju.prototype.getReverseIteratorFrom = function (t, e) { 12557 return new Ou(this.root_, t, this.comparator_, !0, e) 12558 }, ju.prototype.getReverseIterator = function (t) { 12559 return new Ou(this.root_, null, this.comparator_, !0, t) 12560 }, ju.EMPTY_NODE = new Ga, ju); 12561 12562 function ju(t, e) { 12563 void 0 === e && (e = ju.EMPTY_NODE), this.comparator_ = t, this.root_ = e 12564 } 12565 12566 function qu(t, e) { 12567 return na(t.name, e.name) 12568 } 12569 12570 function Vu(t, e) { 12571 return na(t, e) 12572 } 12573 12574 function Bu(t) { 12575 return "number" == typeof t ? "number:" + oa(t) : "string:" + t 12576 } 12577 var Ku, Wu, Hu, Gu, zu = function (t) { 12578 var e; 12579 t.isLeafNode() ? (e = t.val(), so("string" == typeof e || "number" == typeof e || "object" == typeof e && Oo(e, ".sv"), "Priority must be a string or number.")) : so(t === Fu || t.isEmpty(), "priority of unexpected type."), so(t === Fu || t.getPriority().isEmpty(), "Priority nodes can't have a priority of their own.") 12580 }, 12581 Qu = (Object.defineProperty(Yu, "__childrenNodeConstructor", { 12582 get: function () { 12583 return Ku 12584 }, 12585 set: function (t) { 12586 Ku = t 12587 }, 12588 enumerable: !1, 12589 configurable: !0 12590 }), Yu.prototype.isLeafNode = function () { 12591 return !0 12592 }, Yu.prototype.getPriority = function () { 12593 return this.priorityNode_ 12594 }, Yu.prototype.updatePriority = function (t) { 12595 return new Yu(this.value_, t) 12596 }, Yu.prototype.getImmediateChild = function (t) { 12597 return ".priority" === t ? this.priorityNode_ : Yu.__childrenNodeConstructor.EMPTY_NODE 12598 }, Yu.prototype.getChild = function (t) {
12599 return cu(t) ? this : ".priority" === nu(t) ? this.priorityNode_ : Yu.__childrenNodeConstructor.EMPTY_NODE 12600 }, Yu.prototype.hasChild = function () { 12601 return !1 12602 }, Yu.prototype.getPredecessorChildName = function (t, e) { 12603 return null 12604 }, Yu.prototype.updateImmediateChild = function (t, e) { 12605 return ".priority" === t ? this.updatePriority(e) : e.isEmpty() && ".priority" !== t ? this : Yu.__childrenNodeConstructor.EMPTY_NODE.updateImmediateChild(t, e).updatePriority(this.priorityNode_) 12606 }, Yu.prototype.updateChild = function (t, e) { 12607 var n = nu(t); 12608 return null === n ? e : e.isEmpty() && ".priority" !== n ? this : (so(".priority" !== n || 1 === ru(t), ".priority must be the last token in a path"), this.updateImmediateChild(n, Yu.__childrenNodeConstructor.EMPTY_NODE.updateChild(iu(t), e))) 12609 }, Yu.prototype.isEmpty = function () { 12610 return !1 12611 }, Yu.prototype.numChildren = function () { 12612 return 0 12613 }, Yu.prototype.forEachChild = function (t, e) { 12614 return !1 12615 }, Yu.prototype.val = function (t) { 12616 return t && !this.getPriority().isEmpty() ? { 12617 ".value": this.getValue(), 12618 ".priority": this.getPriority().val() 12619 } : this.getValue() 12620 }, Yu.prototype.hash = function () { 12621 var t, e; 12622 return null === this.lazyHash_ && (t = "", this.priorityNode_.isEmpty() || (t += "priority:" + Bu(this.priorityNode_.val()) + ":"), t += (e = typeof this.value_) + ":", t += "number" == e ? oa(this.value_) : this.value_, this.lazyHash_ = Ls(t)), this.lazyHash_ 12623 }, Yu.prototype.getValue = function () { 12624 return this.value_ 12625 }, Yu.prototype.compareTo = function (t) { 12626 return t === Yu.__childrenNodeConstructor.EMPTY_NODE ? 1 : t instanceof Yu.__childrenNodeConstructor ? -1 : (so(t.isLeafNode(), "Unknown node type"), this.compareToLeafNode_(t)) 12627 }, Yu.prototype.compareToLeafNode_ = function (t) { 12628 var e = typeof t.value_, 12629 n = typeof this.value_, 12630 r = Yu.VALUE_TYPE_ORDER.indexOf(e), 12631 i = Yu.VALUE_TYPE_ORDER.indexOf(n); 12632 return so(0 <= r, "Unknown leaf type: " + e), so(0 <= i, "Unknown leaf type: " + n), r === i ? "object" == n ? 0 : this.value_ < t.value_ ? -1 : this.value_ === t.value_ ? 0 : 1 : i - r 12633 }, Yu.prototype.withIndex = function () { 12634 return this 12635 }, Yu.prototype.isIndexed = function () { 12636 return !0 12637 }, Yu.prototype.equals = function (t) { 12638 return t === this || !!t.isLeafNode() && (this.value_ === t.value_ && this.priorityNode_.equals(t.priorityNode_)) 12639 }, Yu.VALUE_TYPE_ORDER = ["object", "boolean", "number", "string"], Yu); 12640 12641 function Yu(t, e) { 12642 void 0 === e && (e = Yu.__childrenNodeConstructor.EMPTY_NODE), this.value_ = t, this.priorityNode_ = e, this.lazyHash_ = null, so(void 0 !== this.value_ && null !== this.value_, "LeafNode shouldn't be created with null/undefined value."), zu(this.priorityNode_) 12643 } 12644 12645 function Xu() { 12646 return null !== Gu && Gu.apply(this, arguments) || this 12647 } 12648 var Ju = new(Xi(Xu, Gu = G), Xu.prototype.compare = function (t, e) { 12649 var n = t.node.getPriority(), 12650 r = e.node.getPriority(), 12651 r = n.compareTo(r); 12652 return 0 === r ? na(t.name, e.name) : r 12653 }, Xu.prototype.isDefinedOn = function (t) { 12654 return !t.getPriority().isEmpty() 12655 }, Xu.prototype.indexedValueChanged = function (t, e) { 12656 return !t.getPriority().equals(e.getPriority()) 12657 }, Xu.prototype.minPost = function () { 12658 return Su.MIN 12659 }, Xu.prototype.maxPost = function () { 12660 return new Su(ea, new Qu("[PRIORITY-POST]", Hu)) 12661 }, Xu.prototype.makePost = function (t, e) { 12662 t = Wu(t); 12663 return new Su(e, new Qu("[PRIORITY-POST]", t)) 12664 }, Xu.prototype.toString = function () { 12665 return ".priority" 12666 }, Xu), 12667 $u = Math.log(2), 12668 Zu = (tc.prototype.nextBitIsOne = function () { 12669 var t = !(this.bits_ & 1 << this.current_); 12670 return this.current_--, t 12671 }, tc); 12672 12673 function tc(t) { 12674 var e; 12675 this.count = (e = t + 1, parseInt(Math.log(e) / $u, 10)), this.current_ = this.count - 1; 12676 var n, r = (n = this.count, parseInt(Array(n + 1).join("1"), 2)); 12677 this.bits_ = t + 1 & r 12678 } 12679 var ec, nc, rc = function (c, t, h, e) { 12680 c.sort(t); 12681 var l = function (t, e) { 12682 var n = e - t; 12683 if (0 == n) return null; 12684 if (1 == n) return r = c[t], i = h ? h(r) : r, new xu(i, r.node, xu.BLACK, null, null); 12685 var n = parseInt(n / 2, 10) + t, 12686 t = l(t, n), 12687 e = l(n + 1, e), 12688 r = c[n], 12689 i = h ? h(r) : r; 12690 return new xu(i, r.node, xu.BLACK, t, e) 12691 }, 12692 n = function (t) { 12693 for (var e = null, n = null, i = c.length, r = function (t, e) {
12694 var n = i - t, 12695 r = i; 12696 i -= t; 12697 t = l(1 + n, r), r = c[n], n = h ? h(r) : r; 12698 o(new xu(n, r.node, e, null, t)) 12699 }, o = function (t) { 12700 e = e ? e.left = t : n = t 12701 }, s = 0; s < t.count; ++s) { 12702 var a = t.nextBitIsOne(), 12703 u = Math.pow(2, t.count - (s + 1)); 12704 a ? r(u, xu.BLACK) : (r(u, xu.BLACK), r(u, xu.RED)) 12705 } 12706 return n 12707 }(new Zu(c.length)); 12708 return new Uu(e || t, n) 12709 }, 12710 ic = {}, 12711 oc = (Object.defineProperty(sc, "Default", { 12712 get: function () { 12713 return so(Ju, "ChildrenNode.ts has not been loaded"), ec = ec || new sc({ 12714 ".priority": ic 12715 }, { 12716 ".priority": Ju 12717 }) 12718 }, 12719 enumerable: !1, 12720 configurable: !0 12721 }), sc.prototype.get = function (t) { 12722 var e = Do(this.indexes_, t); 12723 if (!e) throw new Error("No index defined for " + t); 12724 return e instanceof Uu ? e : null 12725 }, sc.prototype.hasIndex = function (t) { 12726 return Oo(this.indexSet_, t.toString()) 12727 }, sc.prototype.addIndex = function (t, e) { 12728 so(t !== Pu, "KeyIndex always exists and isn't meant to be added to the IndexMap."); 12729 for (var n = [], r = !1, i = e.getIterator(Su.Wrap), o = i.getNext(); o;) r = r || t.isDefinedOn(o.node), n.push(o), o = i.getNext(); 12730 var s = r ? rc(n, t.getCompare()) : ic, 12731 a = t.toString(), 12732 u = Ji({}, this.indexSet_); 12733 u[a] = t; 12734 e = Ji({}, this.indexes_); 12735 return e[a] = s, new sc(e, u) 12736 }, sc.prototype.addToIndexes = function (s, a) { 12737 var u = this; 12738 return new sc(Lo(this.indexes_, function (t, e) { 12739 var n = Do(u.indexSet_, e); 12740 if (so(n, "Missing index implementation for " + e), t === ic) { 12741 if (n.isDefinedOn(s.node)) { 12742 for (var r = [], i = a.getIterator(Su.Wrap), o = i.getNext(); o;) o.name !== s.name && r.push(o), o = i.getNext(); 12743 return r.push(s), rc(r, n.getCompare()) 12744 } 12745 return ic 12746 } 12747 n = a.get(s.name); 12748 return (t = n ? t.remove(new Su(s.name, n)) : t).insert(s, s.node) 12749 }), this.indexSet_) 12750 }, sc.prototype.removeFromIndexes = function (n, r) { 12751 return new sc(Lo(this.indexes_, function (t) { 12752 if (t === ic) return t; 12753 var e = r.get(n.name); 12754 return e ? t.remove(new Su(n.name, e)) : t 12755 }), this.indexSet_) 12756 }, sc); 12757 12758 function sc(t, e) { 12759 this.indexes_ = t, this.indexSet_ = e 12760 } 12761 var ac, uc = (Object.defineProperty(cc, "EMPTY_NODE", { 12762 get: function () { 12763 return nc = nc || new cc(new Uu(Vu), null, oc.Default) 12764 }, 12765 enumerable: !1, 12766 configurable: !0 12767 }), cc.prototype.isLeafNode = function () { 12768 return !1 12769 }, cc.prototype.getPriority = function () { 12770 return this.priorityNode_ || nc 12771 }, cc.prototype.updatePriority = function (t) { 12772 return this.children_.isEmpty() ? this : new cc(this.children_, t, this.indexMap_) 12773 }, cc.prototype.getImmediateChild = function (t) { 12774 if (".priority" === t) return this.getPriority(); 12775 t = this.children_.get(t); 12776 return null === t ? nc : t 12777 }, cc.prototype.getChild = function (t) { 12778 var e = nu(t); 12779 return null === e ? this : this.getImmediateChild(e).getChild(iu(t)) 12780 }, cc.prototype.hasChild = function (t) { 12781 return null !== this.children_.get(t) 12782 }, cc.prototype.updateImmediateChild = function (t, e) { 12783 if (so(e, "We should always be passing snapshot nodes"), ".priority" === t) return this.updatePriority(e); 12784 var n = new Su(t, e), 12785 r = void 0, 12786 i = void 0, 12787 i = e.isEmpty() ? (r = this.children_.remove(t), this.indexMap_.removeFromIndexe
12787s(n, this.children_)) : (r = this.children_.insert(t, e), this.indexMap_.addToIndexes(n, this.children_)), 12788 n = r.isEmpty() ? nc : this.priorityNode_; 12789 return new cc(r, n, i) 12790 }, cc.prototype.updateChild = function (t, e) { 12791 var n = nu(t); 12792 if (null === n) return e; 12793 so(".priority" !== nu(t) || 1 === ru(t), ".priority must be the last token in a path"); 12794 e = this.getImmediateChild(n).updateChild(iu(t), e); 12795 return this.updateImmediateChild(n, e) 12796 }, cc.prototype.isEmpty = function () { 12797 return this.children_.isEmpty() 12798 }, cc.prototype.numChildren = function () { 12799 return this.children_.count() 12800 }, cc.prototype.val = function (n) { 12801 if (this.isEmpty()) return null; 12802 var r = {}, 12803 i = 0, 12804 o = 0, 12805 s = !0; 12806 if (this.forEachChild(Ju, function (t, e) { 12807 r[t] = e.val(n), i++, s && cc.INTEGER_REGEXP_.test(t) ? o = Math.max(o, Number(t)) : s = !1 12808 }), !n && s && o < 2 * i) { 12809 var t, e = []; 12810 for (t in r) e[t] = r[t]; 12811 return e 12812 } 12813 return n && !this.getPriority().isEmpty() && (r[".priority"] = this.getPriority().val()), r 12814 }, cc.prototype.hash = function () { 12815 var n; 12816 return null === this.lazyHash_ && (n = "", this.getPriority().isEmpty() || (n += "priority:" + Bu(this.getPriority().val()) + ":"), this.forEachChild(Ju, function (t, e) { 12817 e = e.hash(); 12818 "" !== e && (n += ":" + t + ":" + e) 12819 }), this.lazyHash_ = "" === n ? "" : Ls(n)), this.lazyHash_ 12820 }, cc.prototype.getPredecessorChildName = function (t, e, n) { 12821 n = this.resolveIndex_(n); 12822 if (n) { 12823 e = n.getPredecessorKey(new Su(t, e)); 12824 return e ? e.name : null 12825 } 12826 return this.children_.getPredecessorKey(t) 12827 }, cc.prototype.getFirstChildName = function (t) { 12828 t = this.resolveIndex_(t); 12829 if (t) { 12830 t = t.minKey(); 12831 return t && t.name 12832 } 12833 return this.children_.minKey() 12834 }, cc.prototype.getFirstChild = function (t) { 12835 t = this.getFirstChildName(t); 12836 return t ? new Su(t, this.children_.get(t)) : null 12837 }, cc.prototype.getLastChildName = function (t) { 12838 t = this.resolveIndex_(t); 12839 if (t) { 12840 t = t.maxKey(); 12841 return t && t.name 12842 } 12843 return this.children_.maxKey() 12844 }, cc.prototype.getLastChild = function (t) { 12845 t = this.getLastChildName(t); 12846 return t ? new Su(t, this.children_.get(t)) : null 12847 }, cc.prototype.forEachChild = function (t, e) { 12848 t = this.resolveIndex_(t); 12849 return t ? t.inorderTraversal(function (t) { 12850 return e(t.name, t.node) 12851 }) : this.children_.inorderTraversal(e) 12852 }, cc.prototype.getIterator = function (t) { 12853 return this.getIteratorFrom(t.minPost(), t) 12854 }, cc.prototype.getIteratorFrom = function (t, e) { 12855 var n = this.resolveIndex_(e); 12856 if (n) return n.getIteratorFrom(t, function (t) { 12857 return t 12858 }); 12859 for (var r = this.children_.getIteratorFrom(t.name, Su.Wrap), i = r.peek(); null != i && e.compare(i, t) < 0;) r.getNext(), i = r.peek(); 12860 return r 12861 }, cc.prototype.getReverseIterator = function (t) { 12862 return this.getReverseIteratorFrom(t.maxPost(), t) 12863 }, cc.prototype.getReverseIteratorFrom = function (t, e) { 12864 var n = this.resolveIndex_(e); 12865 if (n) return n.getReverseIteratorFrom(t, function (t) { 12866 return t 12867 }); 12868 for (var r = this.children_.getReverseIteratorFrom(t.name, Su.Wrap), i = r.peek(); null != i && 0 < e.compare(i, t);) r.getNext(), i = r.peek(); 12869 return r 12870 }, cc.prototype.compareTo = function (t) { 12871 return this.isEmpty() ? t.isEmpty() ? 0 : -1 : t.isLeafNode() || t.isEmpty() ? 1 : t === lc ? -1 : 0 12872 }, cc.prototype.withIndex = function (t) { 12873 if (t === Pu || this.indexMap_.hasIndex(t)) return this; 12874 t = this.indexMap_.addIndex(t, this.children_); 12875 return new cc(this.children_, this.priorityNode_, t) 12876 }, cc.prototype.isIndexed = function (t) { 12877 return t === Pu || this.indexMap_.hasIndex(t) 12878 }, cc.prototype.equals = function (t) { 12879 if (t === this) return !0; 12880 if (t.isLeafNode()) return !1;
12881 if (this.getPriority().equals(t.getPriority())) { 12882 if (this.children_.count() !== t.children_.count()) return !1; 12883 for (var e = this.getIterator(Ju), n = t.getIterator(Ju), r = e.getNext(), i = n.getNext(); r && i;) { 12884 if (r.name !== i.name || !r.node.equals(i.node)) return !1; 12885 r = e.getNext(), i = n.getNext() 12886 } 12887 return null === r && null === i 12888 } 12889 return !1 12890 }, cc.prototype.resolveIndex_ = function (t) { 12891 return t === Pu ? null : this.indexMap_.get(t.toString()) 12892 }, cc.INTEGER_REGEXP_ = /^(0|[1-9]\d*)$/, cc); 12893 12894 function cc(t, e, n) { 12895 this.children_ = t, this.priorityNode_ = e, this.indexMap_ = n, this.lazyHash_ = null, this.priorityNode_ && zu(this.priorityNode_), this.children_.isEmpty() && so(!this.priorityNode_ || this.priorityNode_.isEmpty(), "An empty node cannot have a priority") 12896 } 12897 12898 function hc() { 12899 return ac.call(this, new Uu(Vu), uc.EMPTY_NODE, oc.Default) || this 12900 } 12901 var lc = new(Xi(hc, ac = uc), hc.prototype.compareTo = function (t) { 12902 return t === this ? 0 : 1 12903 }, hc.prototype.equals = function (t) { 12904 return t === this 12905 }, hc.prototype.getPriority = function () { 12906 return this 12907 }, hc.prototype.getImmediateChild = function (t) { 12908 return uc.EMPTY_NODE 12909 }, hc.prototype.isEmpty = function () { 12910 return !1 12911 }, hc); 12912 Object.defineProperties(Su, { 12913 MIN: { 12914 value: new Su(ta, uc.EMPTY_NODE) 12915 }, 12916 MAX: { 12917 value: new Su(ea, lc) 12918 } 12919 }), Sn.__EMPTY_NODE = uc.EMPTY_NODE, Qu.__childrenNodeConstructor = uc, Fu = lc, Hu = lc; 12920 var fc = !0; 12921 12922 function pc(n, t) { 12923 if (void 0 === t && (t = null), null === n) return uc.EMPTY_NODE; 12924 if ("object" == typeof n && ".priority" in n && (t = n[".priority"]), so(null === t || "string" == typeof t || "number" == typeof t || "object" == typeof t && ".sv" in t, "Invalid priority type found: " + typeof t), "object" == typeof n && ".value" in n && null !== n[".value"] && (n = n[".value"]), "object" != typeof n || ".sv" in n) return new Qu(n, pc(t)); 12925 if (n instanceof Array || !fc) { 12926 var r = uc.EMPTY_NODE; 12927 return ia(n, function (t, e) { 12928 Oo(n, t) && "." !== t.substring(0, 1) && (!(e = pc(e)).isLeafNode() && e.isEmpty() || (r = r.updateImmediateChild(t, e))) 12929 }), r.updatePriority(pc(t)) 12930 } 12931 var i = [], 12932 o = !1; 12933 if (ia(n, function (t, e) { 12934 "." !== t.substring(0, 1) && ((e = pc(e)).isEmpty() || (o = o || !e.getPriority().isEmpty(), i.push(new Su(t, e)))) 12935 }), 0 === i.length) return uc.EMPTY_NODE; 12936 var e = rc(i, qu, function (t) { 12937 return t.name 12938 }, Vu); 12939 if (o) { 12940 var s = rc(i, Ju.getCompare()); 12941 return new uc(e, pc(t), new oc({ 12942 ".priority": s 12943 }, { 12944 ".priority": Ju 12945 })) 12946 } 12947 return new uc(e, pc(t), oc.Default) 12948 } 12949 Wu = pc; 12950 var dc, vc, gc = (Xi(yc, dc = G), yc.prototype.extractChild = function (t) { 12951 return t.getChild(this.indexPath_) 12952 }, yc.prototype.isDefinedOn = function (t) { 12953 return !t.getChild(this.indexPath_).isEmpty() 12954 }, yc.prototype.compare = function (t, e) { 12955 var n = this.extractChild(t.node), 12956 r = this.extractChild(e.node), 12957 r = n.compareTo(r); 12958 return 0 === r ? na(t.name, e.name) : r 12959 }, yc.prototype.makePost = function (t, e) { 12960 t = pc(t), t = uc.EMPTY_NODE.updateChild(this.indexPath_, t); 12961 return new Su(e, t) 12962 }, yc.prototype.maxPost = function () { 12963 var t = uc.EMPTY_NODE.updateChild(this.indexPath_, lc); 12964 return new Su(ea, t) 12965 }, yc.prototype.toString = function () { 12966 return su(this.indexPath_, 0).join("/") 12967 }, yc); 12968 12969 function yc(t) { 12970 var e = dc.call(this) || this; 12971 return e.indexPath_ = t, so(!cu(t) && ".priority" !== nu(t), "Can't create PathIndex with empty path or .priority key"), e 12972 } 12973 12974 function mc() { 12975 return null !== vc && vc.apply(this, arguments) || this 12976 } 12977 12978 function bc(t) { 12979 if (t === "" + ha) return "-"; 12980 var e = la(t); 12981 if (null != e) return "" + (e + 1); 12982 for (var n = new Array(t.length), r = 0; r < n.length; r++) n[r] = t.charAt(r); 12983 if (n.length < 786) return n.push("-"), n.join(""); 12984 for (var i = n.length - 1; 0 <= i && "z" === n[i];) i--; 12985 return -1 === i ? ea : (e = n[i], e = Ec.charAt(Ec.indexOf(e) + 1), n[i] = e, n.slice(0, i + 1).join("")) 12986 } 12987 12988 function wc(t) { 12989 if (t === "" + ca) return ta; 12990 var e = la(t); 12991 if (null != e) return "" + (e - 1); 12992 for (var n = new Array(t.length), r = 0; r < n.length; r++) n[r] = t.charAt(r); 12993 return "-" === n[n.length - 1] ? 1 === n.length ? "" + ha : (delete n[n.length - 1], n.join("")) : (n[n.length - 1] = Ec.charAt(Ec.indexOf(n[n.length - 1]) - 1), n.join("") + "z".repeat(786 - n.length)) 12994 } 12995 var _c, Ic, Tc = new(Xi(mc, vc = G), mc.prototype.compare = function (t, e) { 12996 var n = t.node.compareTo(e.node); 12997 return 0 === n ? na(t.name, e.name) : n 12998 }, mc.prototype.isDefinedOn = function (t) { 12999 return !0 13000 }, mc.prototype.indexedValueChanged = function (t, e) { 13001 return !t.equals(e) 13002 }, mc.prototype.minPost = function () { 13003 return Su.MIN 13004 }, mc.prototype.maxPost = function () { 13005 return Su.MAX 13006 }, mc.prototype.makePost = function (t, e) { 13007 t = pc(t); 13008 return new Su(e, t) 13009 }, mc.prototype.toString = function () { 13010 return ".value" 13011 }, mc), 13012 Ec = "-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz", 13013 Sc = (_c = 0, Ic = [], function (t) { 13014 var e = t === _c; 13015 _c = t; 13016 for (var n = new Array(8), r = 7; 0 <= r; r--) n[r] = Ec.charAt(t % 64), t = Math.floor(t / 64); 13017 so(0 === t, "Cannot push at time == 0"); 13018 var i = n.join(""); 13019 if (e) { 13020 for (r = 11; 0 <= r && 63 === Ic[r]; r--) Ic[r] = 0; 13021 Ic[r]++ 13022 } else 13023 for (r = 0; r < 12; r++) Ic[r] = Math.floor(64 * Math.random()); 13024 for (r = 0; r < 12; r++) i += Ec.charAt(Ic[r]); 13025 return so(20 === i.length, "nextPushId: Length should be 20."), i 13026 }); 13027 13028 function Cc(t) { 13029 return { 13030 type: "value", 13031 snapshotNode: t 13032 } 13033 } 13034 13035 function Nc(t, e) { 13036 return { 13037 type: "child_added", 13038 snapshotNode: e, 13039 childName: t 13040 } 13041 } 13042 13043 function Ac(t, e) { 13044 return { 13045 type: "child_removed", 13046 snapshotNode: e, 13047 childName: t 13048 } 13049 } 13050 13051 function kc(t, e, n) { 13052 return { 13053 type: "child_changed", 13054 snapshotNode: e, 13055 childName: t, 13056 oldSnap: n 13057 } 13058 } 13059 var Rc = (Pc.prototype.updateChild = function (t, e, n, r, i, o) { 13060 so(t.isIndexed(this.index_), "A node must be indexed if only a child is updated"); 13061 var s = t.getImmediateChild(e); 13062 return s.getChild(r).equals(n.getChild(r)) && s.isEmpty() === n.isEmpty() ? t : (null != o && (n.isEmpty() ? t.hasChild(e) ? o.trackChildChange(Ac(e, s)) : so(t.isLeafNode(), "A child remove without an old child only makes sense on a leaf node") : s.isEmpty() ? o.trackChildChange(Nc(e, n)) : o.trackChildChange(kc(e, n, s))), t.isLeafNode() && n.isEmpty() ? t : t.updateImmediateChild(e, n).withIndex(this.index_)) 13063 }, Pc.prototype.updateFullNode = function (r, n, i) { 13064 return null != i && (r.isLeafNode() || r.forEachChild(Ju, function (t, e) { 13065 n.hasChild(t) || i.trackChildChange(Ac(t, e)) 13066 }
13066), n.isLeafNode() || n.forEachChild(Ju, function (t, e) { 13067 var n; 13068 r.hasChild(t) ? (n = r.getImmediateChild(t)).equals(e) || i.trackChildChange(kc(t, e, n)) : i.trackChildChange(Nc(t, e)) 13069 })), n.withIndex(this.index_) 13070 }, Pc.prototype.updatePriority = function (t, e) { 13071 return t.isEmpty() ? uc.EMPTY_NODE : t.updatePriority(e) 13072 }, Pc.prototype.filtersNodes = function () { 13073 return !1 13074 }, Pc.prototype.getIndexedFilter = function () { 13075 return this 13076 }, Pc.prototype.getIndex = function () { 13077 return this.index_ 13078 }, Pc); 13079 13080 function Pc(t) { 13081 this.index_ = t 13082 } 13083 var Oc = (Dc.prototype.getStartPost = function () { 13084 return this.startPost_ 13085 }, Dc.prototype.getEndPost = function () { 13086 return this.endPost_ 13087 }, Dc.prototype.matches = function (t) { 13088 return this.index_.compare(this.getStartPost(), t) <= 0 && this.index_.compare(t, this.getEndPost()) <= 0 13089 }, Dc.prototype.updateChild = function (t, e, n, r, i, o) { 13090 return this.matches(new Su(e, n)) || (n = uc.EMPTY_NODE), this.indexedFilter_.updateChild(t, e, n, r, i, o) 13091 }, Dc.prototype.updateFullNode = function (t, e, n) { 13092 e.isLeafNode() && (e = uc.EMPTY_NODE); 13093 var r = (r = e.withIndex(this.index_)).updatePriority(uc.EMPTY_NODE), 13094 i = this; 13095 return e.forEachChild(Ju, function (t, e) { 13096 i.matches(new Su(t, e)) || (r = r.updateImmediateChild(t, uc.EMPTY_NODE)) 13097 }), this.indexedFilter_.updateFullNode(t, r, n) 13098 }, Dc.prototype.updatePriority = function (t, e) { 13099 return t 13100 }, Dc.prototype.filtersNodes = function () { 13101 return !0 13102 }, Dc.prototype.getIndexedFilter = function () { 13103 return this.indexedFilter_ 13104 }, Dc.prototype.getIndex = function () { 13105 return this.index_ 13106 }, Dc.getStartPost_ = function (t) { 13107 if (t.hasStart()) { 13108 var e = t.getIndexStartName(); 13109 return t.getIndex().makePost(t.getIndexStartValue(), e) 13110 } 13111 return t.getIndex().minPost() 13112 }, Dc.getEndPost_ = function (t) { 13113 if (t.hasEnd()) { 13114 var e = t.getIndexEndName(); 13115 return t.getIndex().makePost(t.getIndexEndValue(), e) 13116 } 13117 return t.getIndex().maxPost() 13118 }, Dc); 13119 13120 function Dc(t) { 13121 this.indexedFilter_ = new Rc(t.getIndex()), this.index_ = t.getIndex(), this.startPost_ = Dc.getStartPost_(t), this.endPost_ = Dc.getEndPost_(t) 13122 } 13123 var xc = (Lc.prototype.updateChild = function (t, e, n, r, i, o) { 13124 return this.rangedFilter_.matches(new Su(e, n)) || (n = uc.EMPTY_NODE), t.getImmediateChild(e).equals(n) ? t : t.numChildren() < this.limit_ ? this.rangedFilter_.getIndexedFilter().updateChild(t, e, n, r, i, o) : this.fullLimitUpdateChild_(t, e, n, i, o) 13125 }, Lc.prototype.updateFullNode = function (t, e, n) { 13126 if (e.isLeafNode() || e.isEmpty()) r = uc.EMPTY_NODE.withIndex(this.index_); 13127 else if (2 * this.limit_ < e.numChildren() && e.isIndexed(this.index_)) { 13128 var r = uc.EMPTY_NODE.withIndex(this.index_), 13129 i = void 0; 13130 i = this.reverse_ ? e.getReverseIteratorFrom(this.rangedFilter_.getEndPost(), this.index_) : e.getIteratorFrom(this.rangedFilter_.getStartPost(), this.index_); 13131 for (var o = 0; i.hasNext() && o < this.limit_;) { 13132 var s = i.getNext(); 13133 if (!(this.reverse_ ? this.index_.compare(this.rangedFilter_.getStartPost(), s) <= 0 : this.index_.compare(s, this.rangedFilter_.getEndPost()) <= 0)) break; 13134 r = r.updateImmediateChild(s.name, s.node), o++ 13135 } 13136 } else { 13137 r = (r = e.withIndex(this.index_)).updatePriority(uc.EMPTY_NODE); 13138 var a, u = void 0, 13139 c = void 0, 13140 h = void 0, 13141 i = void 0; 13142 h = this.reverse_ ? (i = r.getReverseIterator(this.index_), u = this.rangedFilter_.getEndPost(), c = this.rangedFilter_.getStartPost(), a = this.index_.getCompare(), function (t, e) { 13143 return a(e, t) 13144 }) : (i = r.getIterator(this.index_), u = this.rangedFilter_.getStartPost(), c = this.rangedFilter_.getEndPost(), this.index_.getCompare()); 13145 for (var o = 0, l = !1; i.hasNext();) { 13146 s = i.getNext(); 13147 (l = !l && h(u, s) <= 0 ? !0 : l) && o < this.limit_ && h(s, c) <= 0 ? o++ : r = r.updateImmediateChild(s.name, uc.EMPTY_NODE) 13148 } 13149 } 13150 return this.rangedFilter_.getIndexedFilter().updateFullNode(t, r, n) 13151 }, Lc.prototype.updatePriority = function (t, e) { 13152 return t 13153 }, Lc.prototype.filtersNodes = function () { 13154 return !0 13155 }, Lc.prototype.getIndexedFilter = function () { 13156 return this.rangedFilter_.getIndexedFilter() 13157 }, Lc.prototype.getIndex = function () { 13158 return this.index_ 13159 }
13159, Lc.prototype.fullLimitUpdateChild_ = function (t, e, n, r, i) { 13160 var o, s; 13161 s = this.reverse_ ? (o = this.index_.getCompare(), function (t, e) { 13162 return o(e, t) 13163 }) : this.index_.getCompare(); 13164 var a = t; 13165 so(a.numChildren() === this.limit_, ""); 13166 var u = new Su(e, n), 13167 c = this.reverse_ ? a.getFirstChild(this.index_) : a.getLastChild(this.index_), 13168 h = this.rangedFilter_.matches(u); 13169 if (a.hasChild(e)) { 13170 for (var l = a.getImmediateChild(e), f = r.getChildAfterChild(this.index_, c, this.reverse_); null != f && (f.name === e || a.hasChild(f.name));) f = r.getChildAfterChild(this.index_, f, this.reverse_); 13171 var p = null == f ? 1 : s(f, u); 13172 if (h && !n.isEmpty() && 0 <= p) return null != i && i.trackChildChange(kc(e, n, l)), a.updateImmediateChild(e, n); 13173 null != i && i.trackChildChange(Ac(e, l)); 13174 l = a.updateImmediateChild(e, uc.EMPTY_NODE); 13175 return null != f && this.rangedFilter_.matches(f) ? (null != i && i.trackChildChange(Nc(f.name, f.node)), l.updateImmediateChild(f.name, f.node)) : l 13176 } 13177 return !n.isEmpty() && h && 0 <= s(c, u) ? (null != i && (i.trackChildChange(Ac(c.name, c.node)), i.trackChildChange(Nc(e, n))), a.updateImmediateChild(e, n).updateImmediateChild(c.name, uc.EMPTY_NODE)) : t 13178 }, Lc); 13179 13180 function Lc(t) { 13181 this.rangedFilter_ = new Oc(t), this.index_ = t.getIndex(), this.limit_ = t.getLimit(), this.reverse_ = !t.isViewFromLeft() 13182 } 13183 var Mc = (Fc.prototype.hasStart = function () { 13184 return this.startSet_ 13185 }, Fc.prototype.hasStartAfter = function () { 13186 return this.startAfterSet_ 13187 }, Fc.prototype.hasEndBefore = function () { 13188 return this.endBeforeSet_ 13189 }, Fc.prototype.isViewFromLeft = function () { 13190 return "" === this.viewFrom_ ? this.startSet_ : "l" === this.viewFrom_ 13191 }, Fc.prototype.getIndexStartValue = function () { 13192 return so(this.startSet_, "Only valid if start has been set"), this.indexStartValue_ 13193 }, Fc.prototype.getIndexStartName = function () { 13194 return so(this.startSet_, "Only valid if start has been set"), this.startNameSet_ ? this.indexStartName_ : ta 13195 }, Fc.prototype.hasEnd = function () { 13196 return this.endSet_ 13197 }, Fc.prototype.getIndexEndValue = function () { 13198 return so(this.endSet_, "Only valid if end has been set"), this.indexEndValue_ 13199 }, Fc.prototype.getIndexEndName = function () { 13200 return so(this.endSet_, "Only valid if end has been set"), this.endNameSet_ ? this.indexEndName_ : ea 13201 }, Fc.prototype.hasLimit = function () { 13202 return this.limitSet_ 13203 }, Fc.prototype.hasAnchoredLimit = function () { 13204 return this.limitSet_ && "" !== this.viewFrom_ 13205 }, Fc.prototype.getLimit = function () { 13206 return so(this.limitSet_, "Only valid if limit has been set"), this.limit_ 13207 }, Fc.prototype.getIndex = function () { 13208 return this.index_ 13209 }, Fc.prototype.loadsAllData = function () { 13210 return !(this.startSet_ || this.endSet_ || this.limitSet_) 13211 }, Fc.prototype.isDefault = function () { 13212 return this.loadsAllData() && this.index_ === Ju 13213 }, Fc.prototype.copy = function () { 13214 var t = new Fc; 13215 return t.limitSet_ = this.limitSet_, t.limit_ = this.limit_, t.startSet_ = this.startSet_, t.indexStartValue_ = this.indexStartValue_, t.startNameSet_ = this.startNameSet_, t.indexStartName_ = this.indexStartName_, t.endSet_ = this.endSet_, t.indexEndValue_ = this.indexEndValue_, t.endNameSet_ = this.endNameSet_, t.indexEndName_ = this.indexEndName_, t.index_ = this.index_, t.viewFrom_ = this.viewFrom_, t 13216 }, Fc); 13217 13218 function Fc() { 13219 this.limitSet_ = !1, this.startSet_ = !1, this.startNameSet_ = !1, this.startAfterSet_ = !1, this.endSet_ = !1, this.endNameSet_ = !1, this.endBeforeSet_ = !1, this.limit_ = 0, this.viewFrom_ = "", this.indexStartValue_ = null, this.indexStartName_ = "", this.indexEndValue_ = null, this.indexEndName_ = "", this.index_ = Ju 13220 } 13221 13222 function Uc(t, e, n) { 13223 t = t.copy(); 13224 return t.startSet_ = !0, void 0 === e && (e = null), t.indexStartValue_ = e, null != n ? (t.startNameSet_ = !0, t.indexStartName_ = n) : (t.startNameSet_ = !1, t.indexStartName_ = ""), t 13225 } 13226 13227 function jc(t, e, n) { 13228 t = t.copy(); 13229 return t.endSet_ = !0, void 0 === e && (e = null), t.indexEndValue_ = e, void 0 !== n ? (t.endNameSet_ = !0, t.indexEndName_ = n) : (t.endNameSet_ = !1, t.indexEndName_ = ""), t 13230 } 13231 13232 function qc(t, e) { 13233 t = t.copy(); 13234 return t.index_ = e, t 13235 } 13236 13237 function Vc(t) { 13238 var e, n = {}; 13239 return t.isDefault() || (e = t.index_ === Ju ? "$priority" : t.index_ === Tc ? "$value" : t.index_ === Pu ? "$key" : (so(t.index_ instanceof gc, "Unrecognized index type!"), t.index_.toString()), n.orderBy = Ro(e), t.startSet_ && (n.startAt = Ro(t.indexStartValue_), t.startNameSet_ && (n.startAt += "," + Ro(t.indexStartName_))), t.endSet_ && (n.endAt = Ro(t.indexEndValue_), t.endNameSet_ && (n.endAt += "," + Ro(t.indexEndName_))), t.limitSet_ && (t.isViewFromLeft() ? n.limitToFirst = t.limit_ : n.limitToLast = t.limit_)), n 13240 } 13241 var Bc, Kc = (Xi(Wc, Bc = z), Wc.prototype.reportStats = function (t) { 13242 throw new Error("Method not implemented.") 13243 }, Wc.getListenId_ = function (t, e) { 13244 return void 0 !== e ? "tag$" + e : (so(t.getQueryParams().isDefault(), "should have a tag if it's not a default query."), t.path.toString()) 13245 }, Wc.prototype.listen = function (t, e, n, r) { 13246 var i = this, 13247 o = t.path.toString(); 13248 this.log_("Listen called for " + o + " " + t.queryIdentifier()); 13249 var s = Wc.getListenId_(t, n), 13250 a = {}; 13251 this.listens_[s] = a; 13252 t = Vc(t.getQueryParams()); 13253 this.restRequest_(o + ".json", t, function (t, e) { 13254 null === (t = 404 === t ? e = null : t) && i.onDataUpdate_(o, e, !1, n), Do(i.listens_, s) === a && r(t ? 401 === t ? "permission_denied" : "rest_error:" + t : "ok", null) 13255 }) 13256 }, Wc.prototype.unlisten = function (t, e) { 13257 e = Wc.getListenId_(t, e); 13258 delete this.listens_[e] 13259 }, Wc.prototype.get = function (t) { 13260 var n = this, 13261 e = Vc(t.getQueryParams()), 13262 r = t.path.toString(), 13263 i = new lo; 13264 return this.restRequest_(r + ".json", e, function (t, e) { 13265 null === (t = 404 === t ? e = null : t) ? (n.onDataUpdate_(r, e, !1, null), i.resolve(e)) : i.reject(new Error(e)) 13266 }), i.promise 13267 }, Wc.prototype.refreshAuthToken = function (t) {}, Wc.prototype.restRequest_ = function (r, i, o) { 13268 var s = this; 13269 (i = void 0 === i ? {} : i).format = "export", this.authTokenProvider_.getToken(!1).then(function (t) { 13270 t = t && t.accessToken; 13271 t && (i.auth = t); 13272 var e = (s.repoInfo_.secure ? "https://" : "http://") + s.repoInfo_.host + r + "?ns=" + s.repoInfo_.namespace + Mo(i); 13273 s.log_("Sending REST request for " + e); 13274 var n = new XMLHttpRequest; 13275 n.onreadystatechange = function () { 13276 if (o && 4 === n.readyState) { 13277 s.log_("REST Response for " + e + " received. status:", n.status, "response:", n.responseText); 13278 var t = null; 13279 if (200 <= n.status && n.status < 300) { 13280 try { 13281 t = ko(n.responseText) 13282 } catch (t) { 13283 Zs("Failed to parse JSON response for " + e + ": " + n.responseText) 13284 } 13285 o(null, t) 13286 } else 401 !== n.status && 404 !== n.status && Zs("Got unsuccessful REST response for " + e + " Status: " + n.status), o(n.status); 13287 o = null 13288 } 13289 }, n.open("GET", e, !0), n.send() 13290 }) 13291 }, Wc); 13292 13293 function Wc(t, e, n) { 13294 var r = Bc.call(this) || this; 13295 return r.repoInfo_ = t, r.onDataUpdate_ = e, r.authTokenProvider_ = n, r.log_ = Js("p:rest:"), r.listens_ = {}, r 13296 } 13297 var Hc = (Gc.prototype.getNode = function (t) { 13298 return this.rootNode_.getChild(t) 13299 }, Gc.prototype.updateSnapshot = function (t, e) { 13300 this.rootNode_ = this.rootNode_.updateChild(t, e) 13301 }, Gc); 13302 13303 function Gc() { 13304 this.rootNode_ = uc.EMPTY_NODE 13305 } 13306 13307 function zc() { 13308 return { 13309 value: null, 13310 children: new Map 13311 } 13312 } 13313 13314 function Qc(t, e, n) { 13315 var r; 13316 cu(e) ? (t.value = n, t.children.clear()) : null !== t.value ? t.value = t.value.updateChild(e, n) : (r = nu(e), t.children.has(r) || t.children.set(r, zc()), Qc(t.children.get(r), e = iu(e), n)) 13317 } 13318 13319 function Yc(t, n, r) { 13320 var i; 13321 null !== t.value ? r(n, t.value) : (i = function (t, e) { 13322 Yc(e, new Za(n.toString() + "/" + t), r) 13323 }
13323, t.children.forEach(function (t, e) { 13324 i(e, t) 13325 })) 13326 } 13327 var Xc = (Jc.prototype.get = function () { 13328 var t = this.collection_.get(), 13329 n = Ji({}, t); 13330 return this.last_ && ia(this.last_, function (t, e) { 13331 n[t] = n[t] - e 13332 }), this.last_ = t, n 13333 }, Jc); 13334 13335 function Jc(t) { 13336 this.collection_ = t, this.last_ = null 13337 } 13338 var $c, Zc = (th.prototype.reportStats_ = function () { 13339 var n = this, 13340 t = this.statsListener_.get(), 13341 r = {}, 13342 i = !1; 13343 ia(t, function (t, e) { 13344 0 < e && Oo(n.statsToReport_, t) && (r[t] = e, i = !0) 13345 }), i && this.server_.reportStats(r), sa(this.reportStats_.bind(this), Math.floor(2 * Math.random() * 3e5)) 13346 }, th); 13347 13348 function th(t, e) { 13349 this.server_ = e, this.statsToReport_ = {}, this.statsListener_ = new Xc(t); 13350 t = 1e4 + 2e4 * Math.random(); 13351 sa(this.reportStats_.bind(this), Math.floor(t)) 13352 } 13353 13354 function eh() { 13355 return { 13356 fromUser: !0, 13357 fromServer: !1, 13358 queryId: null, 13359 tagged: !1 13360 } 13361 } 13362 13363 function nh() { 13364 return { 13365 fromUser: !1, 13366 fromServer: !0, 13367 queryId: null, 13368 tagged: !1 13369 } 13370 } 13371 13372 function rh(t) { 13373 return { 13374 fromUser: !1, 13375 fromServer: !0, 13376 queryId: t, 13377 tagged: !0 13378 } 13379 }(Ga = $c = $c || {})[Ga.OVERWRITE = 0] = "OVERWRITE", Ga[Ga.MERGE = 1] = "MERGE", Ga[Ga.ACK_USER_WRITE = 2] = "ACK_USER_WRITE", Ga[Ga.LISTEN_COMPLETE = 3] = "LISTEN_COMPLETE"; 13380 var ih = (oh.prototype.operationForChild = function (t) { 13381 if (cu(this.path)) { 13382 if (null != this.affectedTree.value) return so(this.affectedTree.children.isEmpty(), "affectedTree should not have overlapping affected paths."), this; 13383 var e = this.affectedTree.subtree(new Za(t)); 13384 return new oh(eu(), e, this.revert) 13385 } 13386 return so(nu(this.path) === t, "operationForChild called for unrelated child."), new oh(iu(this.path), this.affectedTree, this.revert) 13387 }, oh); 13388 13389 function oh(t, e, n) { 13390 this.path = t, this.affectedTree = e, this.revert = n, this.type = $c.ACK_USER_WRITE, this.source = eh() 13391 } 13392 var sh = (ah.prototype.operationForChild = function (t) { 13393 return cu(this.path) ? new ah(this.source, eu()) : new ah(this.source, iu(this.path)) 13394 }, ah); 13395 13396 function ah(t, e) { 13397 this.source = t, this.path = e, this.type = $c.LISTEN_COMPLETE 13398 } 13399 var uh = (ch.prototype.operationForChild = function (t) { 13400 return cu(this.path) ? new ch(this.source, eu(), this.snap.getImmediateChild(t)) : new ch(this.source, iu(this.path), this.snap) 13401 }, ch); 13402 13403 function ch(t, e, n) { 13404 this.source = t, this.path = e, this.snap = n, this.type = $c.OVERWRITE 13405 } 13406 var hh = (lh.prototype.operationForChild = function (t) { 13407 if (cu(this.path)) { 13408 var e = this.children.subtree(new Za(t)); 13409 return e.isEmpty() ? null : e.value ? new uh(this.source, eu(), e.value) : new lh(this.source, eu(), e) 13410 } 13411 return so(nu(this.path) === t, "Can't get a merge for a child not on the path of the operation"), new lh(this.source, iu(this.path), this.children) 13412 }, lh.prototype.toString = function () { 13413 return "Operation(" + this.path + ": " + this.source.toString() + " merge: " + this.children.toString() + ")" 13414 }, lh); 13415 13416 function lh(t, e, n) { 13417 this.source = t, this.path = e, this.children = n, this.type = $c.MERGE 13418 } 13419 var fh = (ph.prototype.isFullyInitialized = function () { 13420 return this.fullyInitialized_ 13421 }, ph.prototype.isFiltered = function () { 13422 return this.filtered_ 13423 }, ph.prototype.isCompleteForPath = function (t) { 13424 if (cu(t)) return this.isFullyInitialized() && !this.filtered_; 13425 t = nu(t); 13426 return this.isCompleteForChild(t) 13427 }, ph.prototype.isCompleteForChild = function (t) { 13428 return this.isFullyInitialized() && !this.filtered_ || this.node_.hasChild(t) 13429 }, ph.prototype.getNode = function () { 13430 return this.node_ 13431 }, ph); 13432 13433 function ph(t, e, n) { 13434 this.node_ = t, this.fullyInitialized_ = e, this.filtered_ = n 13435 } 13436 var dh, vh = function (t) { 13437 this.query_ = t, this.index_ = this.query_.getQueryParams().getIndex() 13438 }; 13439 13440 function gh(n, t, e, r) { 13441 var i = [], 13442 o = []; 13443 return t.forEach(function (t) { 13444 var e; 13445 "child_changed" === t.type && n.index_.indexedValueChanged(t.oldSnap, t.snapshotNode) && o.push((e = t.childName, { 13446 type: "child_moved", 13447 snapshotNode: t.snapshotNode, 13448 childName: e 13449 })) 13450 }), yh(n, i, "child_removed", t, r, e), yh(n, i, "child_added", t, r, e), yh(n, i, "child_moved", o, r, e), yh(n, i, "child_changed", t, r, e), yh(n, i, "value", t, r, e), i 13451 } 13452 13453 function yh(o, s, e, t, a, u) { 13454 t = t.filter(function (t) { 13455 return t.type === e 13456 }); 13457 t.sort(function (t, e) { 13458 return function (t, e, n) { 13459 if (null == e.childName || null == n.childName) throw ao("Should only compare child_ events."); 13460 e = new Su(e.childName, e.snapshotNode), n = new Su(n.childName, n.snapshotNode); 13461 return t.index_.compare(e, n) 13462 }(o, t, e) 13463 }), t.forEach(function (e) { 13464 var t, n, r, i = (t = o, r = u, "value" === (n = e).type || "child_removed" === n.type || (n.prevName = r.getPredecessorChildName(n.childName, n.snapshotNode, t.index_)), n); 13465 a.forEach(function (t) { 13466 t.respondsTo(e.type) && s.push(t.createEvent(i, o.query_)) 13467 }) 13468 }) 13469 } 13470 13471 function mh(t, e) { 13472 return { 13473 eventCache: t, 13474 serverCache: e 13475 } 13476 } 13477 13478 function bh(t, e, n, r) { 13479 return mh(new fh(e, n, r), t.serverCache) 13480 } 13481 13482 function wh(t, e, n, r) { 13483 return mh(t.eventCache, new fh(e, n, r)) 13484 } 13485 13486 function _h(t) { 13487 return t.eventCache.isFullyInitialized() ? t.eventCache.getNode() : null 13488 } 13489 13490 function Ih(t) { 13491 return t.serverCache.isFullyInitialized() ? t.serverCache.getNode() : null 13492 } 13493 var Th = (Eh.fromObject = function (t) { 13494 var n = new Eh(null); 13495 return ia(t, function (t, e) { 13496 n = n.set(new Za(t), e) 13497 }), n 13498 }, Eh.prototype.isEmpty = function () { 13499 return null === this.value && this.children.isEmpty() 13500 }, Eh.prototype.findRootMostMatchingPathAndValue = function (t, e) { 13501 if (null != this.value && e(this.value)) return { 13502 path: eu(), 13503 value: this.value 13504 }; 13505 if (cu(t)) return null; 13506 var n = nu(t), 13507 r = this.children.get(n); 13508 if (null === r) return null; 13509 e = r.findRootMostMatchingPathAndValue(iu(t), e); 13510 return null == e ? null : { 13511 path: uu(new Za(n), e.path), 13512 value: e.value 13513 } 13514 }, Eh.prototype.findRootMostValueAndPath = function (t) { 13515 return this.findRootMostMatchingPathAndValue(t, function () { 13516 return !0 13517 }) 13518 }, Eh.prototype.subtree = function (t) { 13519 if (cu(t)) return this; 13520 var e = nu(t), 13521 e = this.children.get(e); 13522 return null !== e ? e.subtree(iu(t)) : new Eh(null) 13523 }, Eh.prototype.set = function (t, e) { 13524 if (cu(t)) return new Eh(e, this.children); 13525 var n = nu(t), 13526 e = (this.children.get(n) || new Eh(null)).set(iu(t), e), 13527 e = this.children.insert(n, e); 13528 return new Eh(this.value, e) 13529 }, Eh.prototype.remove = function (t) { 13530 if (cu(t)) return this.children.isEmpty() ? new Eh(null) : new Eh(null, this.children); 13531 var e = nu(t), 13532 n = this.children.get(e); 13533 if (n) { 13534 n = n.remove(iu(t)), t = void 0, t = n.isEmpty() ? this.children.remove(e) : this.children.insert(e, n); 13535 return null === this.value && t.isEmpty() ? new Eh(null) : new Eh(this.value, t) 13536 } 13537 return this 13538 }, Eh.prototype.get = function (t) { 13539 if (cu(t)) return this.value; 13540 var e = nu(t), 13541 e = this.children.get(e); 13542 return e ? e.get(iu(t)) : null 13543 }, Eh.prototype.setTree = function (t, e) { 13544 if (cu(t)) return e; 13545 var n = nu(t), 13546 t = (this.children.get(n) || new Eh(null)).setTree(iu(t), e), 13547 e = void 0, 13548 e = t.isEmpty() ? this.children.remove(n) : this.children.insert(n, t); 13549 return new Eh(this.value, e) 13550 }, Eh.prototype.fold = function (t) { 13551 return this.fold_(eu(), t) 13552 }, Eh.prototype.fold_ = function (n, r) { 13553 var i = {}; 13554 return this.children.inorderTraversal(function (t, e) { 13555 i[t] = e.fold_(uu(n, t), r) 13556 }), r(n, this.value, i) 13557 }, Eh.prototype.findOnPath = function (t, e) { 13558 return this.findOnPath_(t, eu(), e) 13559 }, Eh.prototype.findOnPath_ = function (t, e, n) { 13560 var r = !!this.value && n(e, this.value); 13561 if (r) return r; 13562 if (cu(t)) return null; 13563 var i = nu(t), 13564 r = this.children.get(i); 13565 return r ? r.findOnPath_(iu(t), uu(e, i), n) : null 13566 }, Eh.prototype.foreachOnPath = function (t, e) { 13567 return this.foreachOnPath_(t, eu(), e) 13568 }, Eh.prototype.foreachOnPath_ = function (t, e, n) { 13569 if (cu(t)) return this; 13570 this.value && n(e, this.value); 13571 var r = nu(t), 13572 i = this.children.get(r); 13573 return i ? i.foreachOnPath_(iu(t), uu(e, r), n) : new Eh(null) 13574 }, Eh.prototype.foreach = function (t) { 13575 this.foreach_(eu(), t) 13576 }, Eh.prototype.foreach_ = function (n, r) { 13577 this.children.inorderTraversal(function (t, e) { 13578 e.foreach_(uu(n, t), r) 13579 }), this.value && r(n, this.value) 13580 }, Eh.prototype.foreachChild = function (n) { 13581 this.children.inorderTraversal(function (t, e) { 13582 e.value && n(t, e.value) 13583 }) 13584 }, Eh); 13585 13586 function Eh(t, e) { 13587 void 0 === e && (e = dh = dh || new Uu(js)), this.value = t, this.children = e
13588 } 13589 var Sh = (Ch.empty = function () { 13590 return new Ch(new Th(null)) 13591 }, Ch); 13592 13593 function Ch(t) { 13594 this.writeTree_ = t 13595 } 13596 13597 function Nh(t, e, n) { 13598 if (cu(e)) return new Sh(new Th(n)); 13599 var r = t.writeTree_.findRootMostValueAndPath(e); 13600 if (null != r) { 13601 var i = r.path, 13602 o = r.value, 13603 r = hu(i, e), 13604 o = o.updateChild(r, n); 13605 return new Sh(t.writeTree_.set(i, o)) 13606 } 13607 n = new Th(n), n = t.writeTree_.setTree(e, n); 13608 return new Sh(n) 13609 } 13610 13611 function Ah(t, n, e) { 13612 var r = t; 13613 return ia(e, function (t, e) { 13614 r = Nh(r, uu(n, t), e) 13615 }), r 13616 } 13617 13618 function kh(t, e) { 13619 if (cu(e)) return Sh.empty(); 13620 e = t.writeTree_.setTree(e, new Th(null)); 13621 return new Sh(e) 13622 } 13623 13624 function Rh(t, e) { 13625 return null != Ph(t, e) 13626 } 13627 13628 function Ph(t, e) { 13629 var n = t.writeTree_.findRootMostValueAndPath(e); 13630 return null != n ? t.writeTree_.get(n.path).getChild(hu(n.path, e)) : null 13631 } 13632 13633 function Oh(t) { 13634 var n = [], 13635 e = t.writeTree_.value; 13636 return null != e ? e.isLeafNode() || e.forEachChild(Ju, function (t, e) { 13637 n.push(new Su(t, e)) 13638 }) : t.writeTree_.children.inorderTraversal(function (t, e) { 13639 null != e.value && n.push(new Su(t, e.value)) 13640 }), n 13641 } 13642 13643 function Dh(t, e) { 13644 if (cu(e)) return t; 13645 var n = Ph(t, e); 13646 return new Sh(null != n ? new Th(n) : t.writeTree_.subtree(e)) 13647 } 13648 13649 function xh(t) { 13650 return t.writeTree_.isEmpty() 13651 } 13652 13653 function Lh(t, e) { 13654 return function n(r, t, i) { 13655 { 13656 if (null != t.value) return i.updateChild(r, t.value); 13657 var o = null; 13658 return t.children.inorderTraversal(function (t, e) { 13659 ".priority" === t ? (so(null !== e.value, "Priority writes must always be leaf nodes"), o = e.value) : i = n(uu(r, t), e, i) 13660 }), i = !i.getChild(r).isEmpty() && null !== o ? i.updateChild(uu(r, ".priority"), o) : i 13661 } 13662 }(eu(), t.writeTree_, e) 13663 } 13664 13665 function Mh(t, e) { 13666 return Qh(e, t) 13667 } 13668 13669 function Fh(e, n) { 13670 var t = e.allWrites.findIndex(function (t) { 13671 return t.writeId === n 13672 }); 13673 so(0 <= t, "removeWrite called with nonexistent writeId."); 13674 var r = e.allWrites[t]; 13675 e.allWrites.splice(t, 1); 13676 for (var i, o = r.visible, s = !1, a = e.allWrites.length - 1; o && 0 <= a;) { 13677 var u = e.allWrites[a]; 13678 u.visible && (t <= a && function (t, e) { 13679 { 13680 if (t.snap) return pu(t.path, e); 13681 for (var n in t.children) 13682 if (t.children.hasOwnProperty(n) && pu(uu(t.path, n), e)) return !0; 13683 return !1 13684 } 13685 }(u, r.path) ? o = !1 : pu(r.path, u.path) && (s = !0)), a-- 13686 } 13687 return !!o && (s ? ((i = e).visibleWrites = jh(i.allWrites, Uh, eu()), 0 < i.allWrites.length ? i.lastWriteId = i.allWrites[i.allWrites.length - 1].writeId : i.lastWriteId = -1) : r.snap ? e.visibleWrites = kh(e.visibleWrites, r.path) : ia(r.children, function (t) { 13688 e.visibleWrites = kh(e.visibleWrites, uu(r.path, t)) 13689 }), !0) 13690 } 13691 13692 function Uh(t) { 13693 return t.visible 13694 } 13695 13696 function jh(t, e, n) { 13697 for (var r = Sh.empty(), i = 0; i < t.length; ++i) { 13698 var o = t[i]; 13699 if (e(o)) { 13700 var s = o.path, 13701 a = void 0; 13702 if (o.snap) pu(n, s) ? r = Nh(r, a = hu(n, s), o.snap) : pu(s, n) && (a = hu(s, n), r = Nh(r, eu(), o.snap.getChild(a))); 13703 else { 13704 if (!o.children) throw ao("WriteRecord should have .snap or .children"); 13705 pu(n, s) ? r = Ah(r, a = hu(n, s), o.children) : pu(s, n) && (cu(a = hu(s, n)) ? r = Ah(r, eu(), o.children) : (o = Do(o.children, nu(a))) && (a = o.getChild(iu(a)), r = Nh(r, eu(), a))) 13706 } 13707 } 13708 } 13709 return r 13710 } 13711 13712 function qh(t, e, n, r, i) { 13713 if (r || i) { 13714 var o = Dh(t.visibleWrites, e); 13715 if (!i && xh(o)) return n; 13716 if (i || null != n || Rh(o, eu())) return Lh(jh(t.allWrites, function (t) { 13717 return (t.visible || i) && (!r || !~r.indexOf(t.writeId)) && (pu(t.path, e) || pu(e, t.path)) 13718 }, e), n || uc.EMPTY_NODE); 13719 return null 13720 } 13721 o = Ph(t.visibleWrites, e); 13722 if (null != o) return o; 13723 t = Dh(t.visibleWrites, e); 13724 return xh(t) ? n : null != n || Rh(t, eu()) ? Lh(t, n || uc.EMPTY_NODE) : null 13725 } 13726 13727 function Vh(t, e, n, r) { 13728 return qh(t.writeTree, t.treePath, e, n, r) 13729 } 13730 13731 function Bh(t, e) { 13732 return function (t, e, n) { 13733 var r = uc.EMPTY_NODE, 13734 i = Ph(t.visibleWrites, e);
13735 if (i) return i.isLeafNode() || i.forEachChild(Ju, function (t, e) { 13736 r = r.updateImmediateChild(t, e) 13737 }), r; 13738 if (n) { 13739 var o = Dh(t.visibleWrites, e); 13740 return n.forEachChild(Ju, function (t, e) { 13741 e = Lh(Dh(o, new Za(t)), e); 13742 r = r.updateImmediateChild(t, e) 13743 }), Oh(o).forEach(function (t) { 13744 r = r.updateImmediateChild(t.name, t.node) 13745 }), r 13746 } 13747 return Oh(Dh(t.visibleWrites, e)).forEach(function (t) { 13748 r = r.updateImmediateChild(t.name, t.node) 13749 }), r 13750 }(t.writeTree, t.treePath, e) 13751 } 13752 13753 function Kh(t, e, n, r) { 13754 return i = t.writeTree, t = t.treePath, e = e, r = r, so(n || r, "Either existingEventSnap or existingServerSnap must exist"), t = uu(t, e), Rh(i.visibleWrites, t) ? null : xh(t = Dh(i.visibleWrites, t)) ? r.getChild(e) : Lh(t, r.getChild(e)); 13755 var i 13756 } 13757 13758 function Wh(t, e) { 13759 return n = t.writeTree, e = uu(t.treePath, e), Ph(n.visibleWrites, e); 13760 var n 13761 } 13762 13763 function Hh(t, e, n, r, i, o) { 13764 return function (t, e, n, r, i, o, s) { 13765 var a, t = Dh(t.visibleWrites, e); 13766 if (null != (e = Ph(t, eu()))) a = e; 13767 else { 13768 if (null == n) return []; 13769 a = Lh(t, n) 13770 } 13771 if ((a = a.withIndex(s)).isEmpty() || a.isLeafNode()) return []; 13772 for (var u = [], c = s.getCompare(), h = o ? a.getReverseIteratorFrom(r, s) : a.getIteratorFrom(r, s), l = h.getNext(); l && u.length < i;) 0 !== c(l, r) && u.push(l), l = h.getNext(); 13773 return u 13774 }(t.writeTree, t.treePath, e, n, r, i, o) 13775 } 13776 13777 function Gh(t, e, n) { 13778 return r = t.writeTree, i = t.treePath, t = n, e = uu(i, n = e), null != (i = Ph(r.visibleWrites, e)) ? i : t.isCompleteForChild(n) ? Lh(Dh(r.visibleWrites, e), t.getNode().getImmediateChild(n)) : null; 13779 var r, i 13780 } 13781 13782 function zh(t, e) { 13783 return Qh(uu(t.treePath, e), t.writeTree) 13784 } 13785 13786 function Qh(t, e) { 13787 return { 13788 treePath: t, 13789 writeTree: e 13790 } 13791 } 13792 var Yh = (Xh.prototype.trackChildChange = function (t) { 13793 var e = t.type, 13794 n = t.childName; 13795 so("child_added" === e || "child_changed" === e || "child_removed" === e, "Only child changes supported for tracking"), so(".priority" !== n, "Only non-priority child changes can be tracked."); 13796 var r = this.changeMap.get(n); 13797 if (r) { 13798 var i = r.type; 13799 if ("child_added" === e && "child_removed" === i) this.changeMap.set(n, kc(n, t.snapshotNode, r.snapshotNode)); 13800 else if ("child_removed" === e && "child_added" === i) this.changeMap.delete(n); 13801 else if ("child_removed" === e && "child_changed" === i) this.changeMap.set(n, Ac(n, r.oldSnap)); 13802 else if ("child_changed" === e && "child_added" === i) this.changeMap.set(n, Nc(n, t.snapshotNode)); 13803 else { 13804 if ("child_changed" !== e || "child_changed" !== i) throw ao("Illegal combination of changes: " + t + " occurred after " + r); 13805 this.changeMap.set(n, kc(n, t.snapshotNode, r.oldSnap)) 13806 } 13807 } else this.changeMap.set(n, t) 13808 }, Xh.prototype.getChanges = function () { 13809 return Array.from(this.changeMap.values()) 13810 }, Xh); 13811 13812 function Xh() { 13813 this.changeMap = new Map 13814 } 13815 13816 function Jh() {} 13817 var $h = new(Jh.prototype.getCompleteChild = function (t) { 13818 return null 13819 }, Jh.prototype.getChildAfterChild = function (t, e, n) { 13820 return null 13821 }, Jh), 13822 Zh = (tl.prototype.getCompleteChild = function (t) { 13823 var e = this.viewCache_.eventCache; 13824 if (e.isCompleteForChild(t)) return e.getNode().getImmediateChild(t); 13825 e = null != this.optCompleteServerCache_ ? new fh(this.optCompleteServerCache_, !0, !1) : this.viewCache_.serverCache; 13826 return Gh(this.writes_, t, e) 13827 }, tl.prototype.getChildAfterChild = function (t, e, n) { 13828 var r = null != this.optCompleteServerCache_ ? this.optCompleteServerCache_ : Ih(this.viewCache_), 13829 t = Hh(this.writes_, r, e, 1, n, t); 13830 return 0 === t.length ? null : t[0] 13831 }, tl); 13832 13833 function tl(t, e, n) { 13834 void 0 === n && (n = null), this.writes_ = t, this.viewCache_ = e, this.optCompleteServerCache_ = n 13835 } 13836 13837 function el(t, e, n, r, i) { 13838 var o, s, a, u, c, h, l, f, p = new Yh; 13839 if (n.type === $c.OVERWRITE) var d = n, 13840 v = d.source.fromUser ? il(t, e, d.path, d.snap, r, i, p) : (so(d.source.fromServer, "Unknown source."), o = d.source.tagged || e.serverCache.isFiltered() && !cu(d.path), rl(t, e, d.path, d.snap, r, i, o, p)); 13841 else if (n.type === $c.MERGE) { 13842 var g = n; 13843 v = g.source.fromUser ? (s = t, a = e, u = g.path, d = g.children, c = r, h = i, l = p, f = a, d.foreach(function (t, e) { 13844 t = uu(u, t); 13845 ol(a, nu(t)) && (f = il(s, f, t, e, c, h, l)) 13846 }), d.foreach(function (t, e) { 13847 t = uu(u, t); 13848 ol(a, nu(t)) || (f = il(s, f, t, e, c, h, l)) 13849 }), f) : (so(g.source.fromServer, "Unknown source."), o = g.source.tagged || e.serverCache.isFiltered(), al(t, e, g.path, g.children, r, i, o, p)) 13850 } else if (n.type === $c.ACK_USER_WRITE) { 13851 var y = n; 13852 v = y.revert ? function (t, e, n, r, i, o) { 13853 var s; { 13854 if (null != Wh(r, n)) return e; 13855 var a, u, c = new Zh(r, e, i), 13856 h = e.eventCache.getNode(), 13857 i = void 0; 13858 return cu(n) || ".priority" === nu(n) ? (u = void 0, u = e.serverCache.isFullyInitialized() ? Vh(r, Ih(e)) : (a = e.serverCache.getNode(), so(a instanceof uc, "serverChildren would be complete if leaf node"), Bh(r, a)), i = t.filter.updateFullNode(h, u, o)) : (a = nu(n), null == (u = Gh(r, a, e.serverCache)) && e.serverCache.isCompleteForChild(a) && (u = h.getImmediateChild(a)), (i = null != u ? t.filter.updateChild(h, a, u, iu(n), c, o) : e.eventCache.getNode().hasChild(a) ? t.filter.updateChild(h, a, uc.EMPTY_NODE, iu(n), c, o) : h).isEmpty() && e.serverCache.isFullyInitialized() && (s = Vh(r, Ih(e))).isLeafNode() && (i = t.filter.updateFullNode(i, s, o))), s = e.serverCache.isFullyInitialized() || null != Wh(r, eu()), bh(e, i, s, t.filter.filtersNodes()) 13859 } 13860 }(t, e, y.path, r, i, p) : function (t, e, r, n, i, o, s) { 13861 if (null != Wh(i, r)) return e; 13862 var a = e.serverCache.isFiltered(), 13863 u = e.serverCache; { 13864 if (null != n.value) { 13865 if (cu(r) && u.isFullyInitialized() || u.isCompleteForPath(r)) return rl(t, e, r, u.getNode().getChild(r), i, o, a, s); 13866 if (cu(r)) { 13867 var c = new Th(null);
13868 return u.getNode().forEachChild(Pu, function (t, e) { 13869 c = c.set(new Za(t), e) 13870 }), al(t, e, r, c, i, o, a, s) 13871 } 13872 return e 13873 } 13874 var h = new Th(null); 13875 return n.foreach(function (t, e) { 13876 var n = uu(r, t); 13877 u.isCompleteForPath(n) && (h = h.set(t, u.getNode().getChild(n))) 13878 }), al(t, e, r, h, i, o, a, s) 13879 } 13880 }(t, e, y.path, y.affectedTree, r, i, p) 13881 } else { 13882 if (n.type !== $c.LISTEN_COMPLETE) throw ao("Unknown operation type: " + n.type); 13883 o = t, y = e, i = n.path, t = r, n = p, r = y.serverCache, r = wh(y, r.getNode(), r.isFullyInitialized() || cu(i), r.isFiltered()), v = nl(o, r, i, t, $h, n) 13884 } 13885 p = p.getChanges(); 13886 return function (t, e, n) { 13887 var r = e.eventCache; { 13888 var i, o; 13889 r.isFullyInitialized() && (i = r.getNode().isLeafNode() || r.getNode().isEmpty(), o = _h(t), (0 < n.length || !t.eventCache.isFullyInitialized() || i && !r.getNode().equals(o) || !r.getNode().getPriority().equals(o.getPriority())) && n.push(Cc(_h(e)))) 13890 } 13891 }(e, v, p), { 13892 viewCache: v, 13893 changes: p 13894 } 13895 } 13896 13897 function nl(t, e, n, r, i, o) { 13898 var s = e.eventCache; 13899 if (null != Wh(r, n)) return e; 13900 var a, u, c, h, l = void 0, 13901 f = void 0; 13902 return l = cu(n) ? (so(e.serverCache.isFullyInitialized(), "If change path is empty, we must have complete server data"), e.serverCache.isFiltered() ? (a = Bh(r, (a = Ih(e)) instanceof uc ? a : uc.EMPTY_NODE), t.filter.updateFullNode(e.eventCache.getNode(), a, o)) : (u = Vh(r, Ih(e)), t.filter.updateFullNode(e.eventCache.getNode(), u, o))) : ".priority" === (u = nu(n)) ? (so(1 === ru(n), "Can't have a priority with additional path components"), null != (h = Kh(r, n, c = s.getNode(), f = e.serverCache.getNode())) ? t.filter.updatePriority(c, h) : s.getNode()) : (c = iu(n), h = void 0, null != (h = s.isCompleteForChild(u) ? (f = e.serverCache.getNode(), null != (f = Kh(r, n, s.getNode(), f)) ? s.getNode().getImmediateChild(u).updateChild(c, f) : s.getNode().getImmediateChild(u)) : Gh(r, u, e.serverCache)) ? t.filter.updateChild(s.getNode(), u, h, c, i, o) : s.getNode()), bh(e, l, s.isFullyInitialized() || cu(n), t.filter.filtersNodes()) 13903 } 13904 13905 function rl(t, e, n, r, i, o, s, a) { 13906 var u = e.serverCache, 13907 c = s ? t.filter : t.filter.getIndexedFilter(); 13908 if (cu(n)) l = c.updateFullNode(u.getNode(), r, null); 13909 else if (c.filtersNodes() && !u.isFiltered()) var h = u.getNode().updateChild(n, r), 13910 l = c.updateFullNode(u.getNode(), h, null); 13911 else { 13912 s = nu(n); 13913 if (!u.isCompleteForPath(n) && 1 < ru(n)) return e; 13914 h = iu(n), r = u.getNode().getImmediateChild(s).updateChild(h, r); 13915 l = ".priority" === s ? c.updatePriority(u.getNode(), r) : c.updateChild(u.getNode(), s, r, h, $h, null) 13916 } 13917 c = wh(e, l, u.isFullyInitialized() || cu(n), c.filtersNodes()); 13918 return nl(t, c, n, i, new Zh(i, c, o), a) 13919 } 13920 13921 function il(t, e, n, r, i, o, s) { 13922 var a, u, c = e.eventCache, 13923 h = new Zh(i, e, o); 13924 return cu(n) ? (u = t.filter.updateFullNode(e.eventCache.getNode(), r, s), bh(e, u, !0, t.filter.filtersNodes())) : ".priority" === (a = nu(n)) ? (u = t.filter.updatePriority(e.eventCache.getNode(), r), bh(e, u, c.isFullyInitialized(), c.isFiltered())) : (i = iu(n), o = c.getNode().getImmediateChild(a), u = void 0, u = cu(i) ? r : null != (n = h.getCompleteChild(a)) ? ".priority" === ou(i) && n.getChild(au(i)).isEmpty() ? n : n.updateChild(i, r) : uc.EMPTY_NODE, o.equals(u) ? e : bh(e, t.filter.updateChild(c.getNode(), a, u, i, h, s), c.isFullyInitialized(), t.filter.filtersNodes())) 13925 } 13926 13927 function ol(t, e) { 13928 return t.eventCache.isCompleteForChild(e) 13929 } 13930 13931 function sl(t, n, e) { 13932 return e.foreach(function (t, e) { 13933 n = n.updateChild(t, e) 13934 }), n 13935 } 13936 13937 function al(r, i, t, e, o, s, a, u) { 13938 if (i.serverCache.getNode().isEmpty() && !i.serverCache.isFullyInitialized()) return i; 13939 var c = i, 13940 e = cu(t) ? e : new Th(null).setTree(t, e), 13941 h = i.serverCache.getNode(); 13942 return e.children.inorderTraversal(function (t, e) { 13943 h.hasChild(t) && (e = sl(0, i.serverCache.getNode().getImmediateChild(t), e), c = rl(r, c, new Za(t), e, o, s, a, u)) 13944 }), e.children.inorderTraversal(function (t, e) { 13945 var n = !i.serverCache.isCompleteForChild(t) && void 0 === e.value; 13946 h.hasChild(t) || n || (e = sl(0, i.serverCache.getNode().getImmediateChild(t), e), c = rl(r, c, new Za(t), e, o, s, a, u)) 13947 }), c 13948 } 13949 var ul, cl = (Object.defineProperty(hl.prototype, "query", { 13950 get: function () { 13951 return this.query_ 13952 }, 13953 enumerable: !1, 13954 configurable: !0 13955 }), hl); 13956 13957 function hl(t, e) { 13958 this.query_ = t, this.eventRegistrations_ = []; 13959 var n = this.query_.getQueryParams(), 13960 r = new Rc(n.getIndex()), 13961 i = (o = n).loadsAllData() ? new Rc(o.getIndex()) : new(o.hasLimit() ? xc : Oc)(o); 13962 this.processor_ = { 13963 filter: i 13964 }; 13965 var t = e.serverCache, 13966 n = e.eventCache, 13967 o = r.updateFullNode(uc.EMPTY_NODE, t.getNode(), null), 13968 e = i.updateFullNode(uc.EMPTY_NODE, n.getNode(), null), 13969 r = new fh(o, t.isFullyInitialized(), r.filtersNodes()), 13970 i = new fh(e, n.isFullyInitialized(), i.filtersNodes()); 13971 this.viewCache_ = mh(i, r), this.eventGenerator_ = new vh(this.query_) 13972 } 13973 13974 function ll(t) { 13975 return 0 === t.eventRegistrations_.length 13976 } 13977 13978 function fl(t, e, n) { 13979 var r, i = []; 13980 if (n && (so(null == e, "A cancel should cancel all event registrations."), r = t.query.path, t.eventRegistrations_.forEach(function (t) { 13981 t = t.createCancelEvent(n, r); 13982 t && i.push(t) 13983 })), e) { 13984 for (var o = [], s = 0; s < t.eventRegistrations_.length; ++s) { 13985 var a = t.eventRegistrations_[s]; 13986 if (a.matches(e)) { 13987 if (e.hasAnyCallback()) { 13988 o = o.concat(t.eventRegistrations_.slice(s + 1)); 13989 break 13990 } 13991 } else o.push(a) 13992 } 13993 t.eventRegistrations_ = o 13994 } else t.eventRegistrations_ = []; 13995 return i 13996 } 13997 13998 function pl(t, e, n, r) { 13999 e.type === $c.MERGE && null !== e.source.queryId && (so(Ih(t.viewCache_), "We should always have a full c
13999ache before handling merges"), so(_h(t.viewCache_), "Missing event cache, even though we have a server cache")); 14000 var i = t.viewCache_, 14001 e = el(t.processor_, i, e, n, r); 14002 return n = t.processor_, r = e.viewCache, so(r.eventCache.getNode().isIndexed(n.filter.getIndex()), "Event snap not indexed"), so(r.serverCache.getNode().isIndexed(n.filter.getIndex()), "Server snap not indexed"), so(e.viewCache.serverCache.isFullyInitialized() || !i.serverCache.isFullyInitialized(), "Once a server snap is complete, it should never go back"), t.viewCache_ = e.viewCache, dl(t, e.changes, e.viewCache.eventCache.getNode(), null) 14003 } 14004 14005 function dl(t, e, n, r) { 14006 r = r ? [r] : t.eventRegistrations_; 14007 return gh(t.eventGenerator_, e, n, r) 14008 } 14009 var vl = function () { 14010 this.views = new Map 14011 }; 14012 14013 function gl(t, e, n, r) { 14014 var i, o, s = e.source.queryId; 14015 if (null !== s) { 14016 var a = t.views.get(s); 14017 return so(null != a, "SyncTree gave us an op for an invalid query."), pl(a, e, n, r) 14018 } 14019 var u = []; 14020 try { 14021 for (var c = to(t.views.values()), h = c.next(); !h.done; h = c.next()) a = h.value, u = u.concat(pl(a, e, n, r)) 14022 } catch (t) { 14023 i = { 14024 error: t 14025 } 14026 } finally { 14027 try { 14028 h && !h.done && (o = c.return) && o.call(c) 14029 } finally { 14030 if (i) throw i.error 14031 } 14032 } 14033 return u 14034 } 14035 14036 function yl(t, e, n, r, i) { 14037 var o = e.queryIdentifier(), 14038 t = t.views.get(o); 14039 if (t) return t; 14040 o = Vh(n, i ? r : null), t = !1, t = !!o || (o = r instanceof uc ? Bh(n, r) : uc.EMPTY_NODE, !1), i = mh(new fh(o, t, !1), new fh(r, i, !1)); 14041 return new cl(e, i) 14042 } 14043 14044 function ml(t, e, n, r, i, o) { 14045 var s, o = yl(t, e, r, i, o); 14046 return t.views.has(e.queryIdentifier()) || t.views.set(e.queryIdentifier(), o), e = n, o.eventRegistrations_.push(e), e = n, o = (n = o).viewCache_.eventCache, s = [], o.getNode().isLeafNode() || o.getNode().forEachChild(Ju, function (t, e) { 14047 s.push(Nc(t, e)) 14048 }), o.isFullyInitialized() && s.push(Cc(o.getNode())), dl(n, s, o.getNode(), e) 14049 } 14050 14051 function bl(t, e, n, r) { 14052 var i, o, s = e.queryIdentifier(), 14053 a = [], 14054 u = [], 14055 c = El(t); 14056 if ("default" === s) try { 14057 for (var h = to(t.views.entries()), l = h.next(); !l.done; l = h.next()) { 14058 var f = eo(l.value, 2), 14059 p = f[0], 14060 d = f[1], 14061 u = u.concat(fl(d, n, r)); 14062 ll(d) && (t.views.delete(p), d.query.getQueryParams().loadsAllData() || a.push(d.query)) 14063 } 14064 } catch (t) { 14065 i = { 14066 error: t 14067 } 14068 } finally { 14069 try { 14070 l && !l.done && (o = h.return) && o.call(h) 14071 } finally { 14072 if (i) throw i.error 14073 } 14074 } else(d = t.views.get(s)) && (u = u.concat(fl(d, n, r)), ll(d) && (t.views.delete(s), d.query.getQueryParams().loadsAllData() || a.push(d.query))); 14075 return c && !El(t) && a.push((so(ul, "Reference.ts has not been loaded"), new ul(e.database, e.path))), { 14076 removed: a, 14077 events: u 14078 } 14079 } 14080 14081 function wl(t) { 14082 var e, n, r = []; 14083 try { 14084 for (var i = to(t.views.values()), o = i.next(); !o.done; o = i.next()) { 14085 var s = o.value; 14086 s.query.getQueryParams().loadsAllData() || r.push(s) 14087 } 14088 } catch (t) { 14089 e = { 14090 error: t 14091 } 14092 } finally { 14093 try { 14094 o && !o.done && (n = i.return) && n.call(i) 14095 } finally { 14096 if (e) throw e.error 14097 } 14098 } 14099 return r 14100 } 14101 14102 function _l(t, e) { 14103 var n, r, i, o, s = null; 14104 try { 14105 for (var a = to(t.views.values()), u = a.next(); !u.done; u = a.next()) var c = u.value, 14106 s = s || (i = e, o = void 0, (o = Ih((c = c).viewCache_)) && (c.query.getQueryParams().loadsAllData() || !cu(i) && !o.getImmediateChild(nu(i)).isEmpty()) ? o.getChild(i) : null) 14107 } catch (t) { 14108 n = { 14109 error: t 14110 } 14111 } finally { 14112 try { 14113 u && !u.done && (r = a.return) && r.call(a) 14114 } finally { 14115 if (n) throw n.error 14116 } 14117 } 14118 return s 14119 } 14120 14121 function Il(t, e) { 14122 if (e.getQueryParams().loadsAllData()) return Sl(t); 14123 e = e.queryIdentifier(); 14124 return t.views.get(e) 14125 } 14126 14127 function Tl(t, e) { 14128 return null != Il(t, e) 14129 } 14130 14131 function El(t) { 14132 return null != Sl(t) 14133 } 14134 14135 function Sl(t) { 14136 var e, n; 14137 try { 14138 for (var r = to(t.views.values()), i = r.next(); !i.done; i = r.next()) { 14139 var o = i.value; 14140 if (o.query.getQueryParams().loadsAllData()) return o 14141 } 14142 } catch (t) { 14143 e = { 14144 error: t 14145 } 14146 } finally { 14147 try { 14148 i && !i.done && (n = r.return) && n.call(r) 14149 } finally { 14150 if (e) throw e.error 14151 } 14152 } 14153 return null 14154 } 14155 var Cl = 1, 14156 Nl = function (t) {
14157 this.listenProvider_ = t, this.syncPointTree_ = new Th(null), this.pendingWriteTree_ = { 14158 visibleWrites: Sh.empty(), 14159 allWrites: [], 14160 lastWriteId: -1 14161 }, this.tagToQueryMap = new Map, this.queryToTagMap = new Map 14162 }; 14163 14164 function Al(t, e, n, r, i) { 14165 var o, s, a, u; 14166 return o = t.pendingWriteTree_, s = e, a = n, u = i, so((r = r) > o.lastWriteId, "Stacking an older write on top of newer ones"), void 0 === u && (u = !0), o.allWrites.push({ 14167 path: s, 14168 snap: a, 14169 writeId: r, 14170 visible: u 14171 }), u && (o.visibleWrites = Nh(o.visibleWrites, s, a)), o.lastWriteId = r, i ? Ml(t, new uh(eh(), e, n)) : [] 14172 } 14173 14174 function kl(t, e, n, r) { 14175 var i, o, s; 14176 i = t.pendingWriteTree_, o = e, s = n, so((r = r) > i.lastWriteId, "Stacking an older merge on top of newer ones"), i.allWrites.push({ 14177 path: o, 14178 children: s, 14179 writeId: r, 14180 visible: !0 14181 }), i.visibleWrites = Ah(i.visibleWrites, o, s), i.lastWriteId = r; 14182 n = Th.fromObject(n); 14183 return Ml(t, new hh(eh(), e, n)) 14184 } 14185 14186 function Rl(t, e, n) { 14187 void 0 === n && (n = !1); 14188 var r = function (t, e) { 14189 for (var n = 0; n < t.allWrites.length; n++) { 14190 var r = t.allWrites[n]; 14191 if (r.writeId === e) return r 14192 } 14193 return null 14194 }(t.pendingWriteTree_, e); 14195 if (Fh(t.pendingWriteTree_, e)) { 14196 var i = new Th(null); 14197 return null != r.snap ? i = i.set(eu(), !0) : ia(r.children, function (t) { 14198 i = i.set(new Za(t), !0) 14199 }), Ml(t, new ih(r.path, i, n)) 14200 } 14201 return [] 14202 } 14203 14204 function Pl(t, e, n) { 14205 return Ml(t, new uh(nh(), e, n)) 14206 } 14207 14208 function Ol(n, t, e, r) { 14209 var i = t.path, 14210 o = n.syncPointTree_.get(i), 14211 s = []; 14212 if (o && ("default" === t.queryIdentifier() || Tl(o, t))) { 14213 var a = bl(o, t, e, r); 14214 0 === o.views.size && (n.syncPointTree_ = n.syncPointTree_.remove(i)); 14215 e = a.removed, s = a.events, o = -1 !== e.findIndex(function (t) { 14216 return t.getQueryParams().loadsAllData() 14217 }), a = n.syncPointTree_.findOnPath(i, function (t, e) { 14218 return El(e) 14219 }); 14220 if (o && !a) { 14221 i = n.syncPointTree_.subtree(i); 14222 if (!i.isEmpty()) 14223 for (var u = i.fold(function (t, e, n) { 14224 if (e && El(e)) return [Sl(e)]; 14225 var r = []; 14226 return e && (r = wl(e)), ia(n, function (t, e) { 14227 r = r.concat(e) 14228 }), r 14229 }), c = 0; c < u.length; ++c) { 14230 var h = u[c], 14231 l = h.query, 14232 h = Ul(n, h); 14233 n.listenProvider_.startListening(Wl(l), jl(n, l), h.hashFn, h.onComplete) 14234 } 14235 }!a && 0 < e.length && !r && (o ? n.listenProvider_.stopListening(Wl(t), null) : e.forEach(function (t) { 14236 var e = n.queryToTagMap.get(ql(t)); 14237 n.listenProvider_.stopListening(Wl(t), e) 14238 })), 14239 function (t, e) { 14240 for (var n = 0; n < e.length; ++n) { 14241 var r, i = e[n]; 14242 i.getQueryParams().loadsAllData() || (r = ql(i), i = t.queryToTagMap.get(r), t.queryToTagMap.delete(r), t.tagToQueryMap.delete(i)) 14243 } 14244 }(n, e) 14245 } 14246 return s 14247 } 14248 14249 function Dl(t, e, n) { 14250 var r = e.path, 14251 i = null, 14252 o = !1; 14253 t.syncPointTree_.foreachOnPath(r, function (t, e) { 14254 t = hu(t, r); 14255 i = i || _l(e, t), o = o || El(e) 14256 }); 14257 var s = t.syncPointTree_.get(r); 14258 s ? (o = o || El(s), i = i || _l(s, eu())) : (s = new vl, t.syncPointTree_ = t.syncPointTree_.set(r, s)), null != i ? h = !0 : (h = !1, i = uc.EMPTY_NODE, t.syncPointTree_.subtree(r).foreachChild(function (t, e) { 14259 e = _l(e, eu()); 14260 e && (i = i.updateImmediateChild(t, e)) 14261 })); 14262 var a, u, c = Tl(s, e); 14263 c || e.getQueryParams().loadsAllData() || (a = ql(e), so(!t.queryToTagMap.has(a), "View does not exist, but we have a tag"), u = Cl++, t.queryToTagMap.set(a, u), t.tagToQueryMap.set(u, a)); 14264 var h = ml(s, e, n, Mh(t.pendingWriteTree_, r), i, h); 14265 return c || o || (s = Il(s, e), h = h.concat(function (t, e, n) { 14266 var r = e.path, 14267 i = jl(t, e), 14268 n = Ul(t, n),
14269 n = t.listenProvider_.startListening(Wl(e), i, n.hashFn, n.onComplete), 14270 r = t.syncPointTree_.subtree(r); 14271 if (i) so(!El(r.value), "If we're adding a query, it shouldn't be shadowed"); 14272 else 14273 for (var o = r.fold(function (t, e, n) { 14274 if (!cu(t) && e && El(e)) return [Sl(e).query]; 14275 var r = []; 14276 return e && (r = r.concat(wl(e).map(function (t) { 14277 return t.query 14278 }))), ia(n, function (t, e) { 14279 r = r.concat(e) 14280 }), r 14281 }), s = 0; s < o.length; ++s) { 14282 var a = o[s]; 14283 t.listenProvider_.stopListening(Wl(a), jl(t, a)) 14284 } 14285 return n 14286 }(t, e, s))), h 14287 } 14288 14289 function xl(t, n, e) { 14290 var r = t.pendingWriteTree_, 14291 t = t.syncPointTree_.findOnPath(n, function (t, e) { 14292 t = _l(e, hu(t, n)); 14293 if (t) return t 14294 }); 14295 return qh(r, n, t, e, !0) 14296 } 14297 14298 function Ll(t, e) { 14299 var n = e.path, 14300 r = null; 14301 t.syncPointTree_.foreachOnPath(n, function (t, e) { 14302 t = hu(t, n); 14303 r = r || _l(e, t) 14304 }); 14305 var i = t.syncPointTree_.get(n); 14306 i ? r = r || _l(i, eu()) : (i = new vl, t.syncPointTree_ = t.syncPointTree_.set(n, i)); 14307 var o = null != r, 14308 s = o ? new fh(r, !0, !1) : null, 14309 o = yl(i, e, Mh(t.pendingWriteTree_, e.path), o ? s.getNode() : uc.EMPTY_NODE, o); 14310 return _h(o.viewCache_) 14311 } 14312 14313 function Ml(t, e) { 14314 return function t(e, n, r, i) { 14315 { 14316 if (cu(e.path)) return Fl(e, n, r, i); 14317 var o = n.get(eu()); 14318 null == r && null != o && (r = _l(o, eu())); 14319 var s = [], 14320 a = nu(e.path), 14321 u = e.operationForChild(a), 14322 c = n.children.get(a); 14323 return c && u && (n = r ? r.getImmediateChild(a) : null, a = zh(i, a), s = s.concat(t(u, c, n, a))), s = o ? s.concat(gl(o, e, i, r)) : s 14324 } 14325 }(e, t.syncPointTree_, null, Mh(t.pendingWriteTree_, eu())) 14326 } 14327 14328 function Fl(i, t, o, s) { 14329 var e = t.get(eu()); 14330 null == o && null != e && (o = _l(e, eu())); 14331 var a = []; 14332 return t.children.inorderTraversal(function (t, e) { 14333 var n = o ? o.getImmediateChild(t) : null, 14334 r = zh(s, t), 14335 t = i.operationForChild(t); 14336 t && (a = a.concat(Fl(t, e, n, r))) 14337 }), a = e ? a.concat(gl(e, i, s, o)) : a 14338 } 14339 14340 function Ul(r, t) { 14341 var i = t.query, 14342 o = jl(r, i); 14343 return { 14344 hashFn: function () { 14345 return (t.viewCache_.serverCache.getNode() || uc.EMPTY_NODE).hash() 14346 }, 14347 onComplete: function (t) { 14348 if ("ok" === t) return o ? function (t, e, n) { 14349 var r = Vl(t, n); 14350 if (r) { 14351 n = Bl(r), r = n.path, n = n.queryId, e = hu(r, e); 14352 return Kl(t, r, new sh(rh(n), e)) 14353 } 14354 return [] 14355 }(r, i.path, o) : (e = r, n = i.path, Ml(e, new sh(nh(), n))); 14356 var e, n, t = aa(t, i); 14357 return Ol(r, i, null, t) 14358 } 14359 } 14360 } 14361 14362 function jl(t, e) { 14363 e = ql(e); 14364 return t.queryToTagMap.get(e) 14365 } 14366 14367 function ql(t) { 14368 return t.path.toString() + "$" + t.queryIdentifier() 14369 } 14370 14371 function Vl(t, e) { 14372 return t.tagToQueryMap.get(e) 14373 } 14374 14375 function Bl(t) { 14376 var e = t.indexOf("$"); 14377 return so(-1 !== e && e < t.length - 1, "Bad queryKey."), { 14378 queryId: t.substr(e + 1), 14379 path: new Za(t.substr(0, e)) 14380 } 14381 } 14382 14383 function Kl(t, e, n) { 14384 var r = t.syncPointTree_.get(e); 14385 return so(r, "Missing sync point for query tag that we're tracking"), gl(r, n, Mh(t.pendingWriteTree_, e), null) 14386 } 14387 14388 function Wl(t) { 14389 return t.getQueryParams().loadsAllData() && !t.getQueryParams().isDefault() ? t.getRef() : t 14390 } 14391 var Hl = (Gl.prototype.getImmediateChild = function (t) { 14392 return new Gl(this.node_.getImmediateChild(t)) 14393 }, Gl.prototype.node = function () { 14394 return this.node_ 14395 }, Gl); 14396 14397 function Gl(t) { 14398 this.node_ = t 14399 } 14400 var zl = (Ql.prototype.getImmediateChild = function (t) { 14401 t = uu(this.path_, t); 14402 return new Ql(this.syncTree_, t) 14403 }, Ql.prototype.node = function () { 14404 return xl(this.syncTree_, this.path_) 14405 }, Ql); 14406 14407 function Ql(t, e) { 14408 this.syncTree_ = t, this.path_ = e 14409 } 14410 var Yl = function (t) { 14411 return (t = t || {}).timestamp = t.timestamp || (new Date).getTime(), t 14412 }, 14413 Jl = function (t, e, n) { 14414 return t && "object" == typeof t ? (so(".sv" in t, "Unexpected leaf node or priority contents"), "string" == typeof t[".sv"] ? $l(t[".sv"], e, n) : "object" == typeof t[".sv"] ? Zl(t[".sv"], e) : void so(!1, "Unexpected server value: " + JSON.stringify(t, null, 2))) : t 14415 }, 14416 $l = function (t, e, n) { 14417 if ("timestamp" === t) return n.timestamp; 14418 so(!1, "Unexpected server value: " + t) 14419 }, 14420 Zl = function (t, e, n) { 14421 t.hasOwnProperty("increment") || so(!1, "Unexpected server value: " + JSON.stringify(t, null, 2)); 14422 t = t.increment; 14423 "number" != typeof t && so(!1, "Unexpected increment value: " + t); 14424 e = e.node(); 14425 if (so(null != e, "Expected ChildrenNode.EMPTY_NODE for nulls"), !e.isLeafNode()) return t; 14426 e = e.getValue(); 14427 return "number" != typeof e ? t : e + t 14428 }, 14429 tf = function (t, e, n, r) { 14430 return nf(e, new zl(n, t), r) 14431 }, 14432 ef = function (t, e, n) { 14433 return nf(t, new Hl(e), n) 14434 }; 14435 14436 function nf(t, r, i) { 14437 var e = t.getPriority().val(), 14438 n = Jl(e, r.getImmediateChild(".priority"), i); 14439 if (t.isLeafNode()) { 14440 var o = t, 14441 e = Jl(o.getValue(), r, i);
14442 return e !== o.getValue() || n !== o.getPriority().val() ? new Qu(e, pc(n)) : t 14443 } 14444 var t = t, 14445 s = t; 14446 return n !== t.getPriority().val() && (s = s.updatePriority(new Qu(n))), t.forEachChild(Ju, function (t, e) { 14447 var n = nf(e, r.getImmediateChild(t), i); 14448 n !== e && (s = s.updateImmediateChild(t, n)) 14449 }), s 14450 } 14451 var rf = function (t, e, n) { 14452 void 0 === t && (t = ""), void 0 === e && (e = null), void 0 === n && (n = { 14453 children: {}, 14454 childCount: 0 14455 }), this.name = t, this.parent = e, this.node = n 14456 }; 14457 14458 function of (t, e) { 14459 for (var n = e instanceof Za ? e : new Za(e), r = t, i = nu(n); null !== i;) var o = Do(r.node.children, i) || { 14460 children: {}, 14461 childCount: 0 14462 }, 14463 r = new rf(i, r, o), 14464 i = nu(n = iu(n)); 14465 return r 14466 } 14467 14468 function sf(t) { 14469 return t.node.value 14470 } 14471 14472 function af(t, e) { 14473 t.node.value = e, lf(t) 14474 } 14475 14476 function uf(t) { 14477 return 0 < t.node.childCount 14478 } 14479 14480 function cf(n, r) { 14481 ia(n.node.children, function (t, e) { 14482 r(new rf(t, n, e)) 14483 }) 14484 } 14485 14486 function hf(t) { 14487 return new Za(null === t.parent ? t.name : hf(t.parent) + "/" + t.name) 14488 } 14489 14490 function lf(t) { 14491 var e, n, r, i; 14492 null !== t.parent && (e = t.parent, n = t.name, i = function (t) { 14493 return void 0 === sf(t) && !uf(t) 14494 }(r = t), t = Oo(e.node.children, n), i && t ? (delete e.node.children[n], e.node.childCount--, lf(e)) : i || t || (e.node.children[n] = r.node, e.node.childCount++, lf(e))) 14495 } 14496 14497 function ff(t) { 14498 return "string" == typeof t && 0 !== t.length && !If.test(t) 14499 } 14500 14501 function pf(t) { 14502 return "string" == typeof t && 0 !== t.length && !Tf.test(t) 14503 } 14504 14505 function df(t) { 14506 return null === t || "string" == typeof t || "number" == typeof t && !Us(t) || t && "object" == typeof t && Oo(t, ".sv") 14507 } 14508 14509 function vf(t, e, n, r, i) { 14510 i && void 0 === n || Sf(Wo(t, e, i), n, r) 14511 } 14512 14513 function gf(t, e, n, r, i) { 14514 if (!i || void 0 !== n) { 14515 var o = Wo(t, e, i); 14516 if (!n || "object" != typeof n || Array.isArray(n)) throw new Error(o + " must be an object containing the children to replace."); 14517 var s = []; 14518 ia(n, function (t, e) { 14519 t = new Za(t); 14520 if (Sf(o, e, uu(r, t)), ".priority" === ou(t) && !df(e)) throw new Error(o + "contains an invalid value for '" + t.toString() + "', which must be a valid Firebase priority (a string, finite number, server value, or null)."); 14521 s.push(t) 14522 }), 14523 function (t, e) { 14524 for (var n = 0; n < e.length; n++) 14525 for (var r, i = su(r = e[n]), o = 0; o < i.length; o++) 14526 if ((".priority" !== i[o] || o !== i.length - 1) && !ff(i[o])) throw new Error(t + "contains an invalid key (" + i[o] + ") in path " + r.toString() + '. Keys must be non-empty strings and can\'t contain ".", "#", "$", "/", "[", or "]"'); 14527 e.sort(lu); 14528 var s = null; 14529 for (n = 0; n < e.length; n++) { 14530 if (r = e[n], null !== s && pu(s, r)) throw new Error(t + "contains a path " + s.toString() + " that is ancestor of another path " + r.toString()); 14531 s = r 14532 } 14533 }(o, s) 14534 } 14535 } 14536 14537 function yf(t, e, n, r) { 14538 if (!r || void 0 !== n) { 14539 if (Us(n)) throw new Error(Wo(t, e, r) + "is " + n.toString() + ", but must be a valid Firebase priority (a string, finite number, server value, or null)."); 14540 if (!df(n)) throw new Error(Wo(t, e, r) + "must be a valid Firebase priority (a string, finite number, server value, or null).") 14541 } 14542 } 14543 14544 function mf(t, e, n, r) { 14545 if (!r || void 0 !== n) switch (n) { 14546 case "value": 14547 case "child_added": 14548 case "child_removed": 14549 case "child_changed": 14550 case "child_moved": 14551 break; 14552 default: 14553 throw new Error(Wo(t, e, r) + 'must be a valid event type = "value", "child_added", "child_removed", "child_changed", or "child_moved".') 14554 } 14555 } 14556 14557 function bf(t, e, n, r) { 14558 if (!(r && void 0 === n || ff(n))) throw new Error(Wo(t, e, r) + 'was an invali
14558d key = "' + n + '". Firebase keys must be non-empty strings and can\'t contain ".", "#", "$", "/", "[", or "]").') 14559 } 14560 14561 function wf(t, e, n, r) { 14562 if (!(r && void 0 === n || pf(n))) throw new Error(Wo(t, e, r) + 'was an invalid path = "' + n + '". Paths must be non-empty strings and can\'t contain ".", "#", "$", "[", or "]"') 14563 } 14564 14565 function _f(t, e) { 14566 if (".info" === nu(e)) throw new Error(t + " failed = Can't modify data under /.info/") 14567 } 14568 var If = /[\[\].#$\/\u0000-\u001F\u007F]/, 14569 Tf = /[\[\].#$\u0000-\u001F\u007F]/, 14570 Ef = 10485760, 14571 Sf = function (r, t, e) { 14572 var i = e instanceof Za ? new du(e, r) : e; 14573 if (void 0 === t) throw new Error(r + "contains undefined " + gu(i)); 14574 if ("function" == typeof t) throw new Error(r + "contains a function " + gu(i) + " with contents = " + t.toString()); 14575 if (Us(t)) throw new Error(r + "contains " + t.toString() + " " + gu(i)); 14576 if ("string" == typeof t && t.length > Ef / 3 && zo(t) > Ef) throw new Error(r + "contains a string greater than " + Ef + " utf8 bytes " + gu(i) + " ('" + t.substring(0, 50) + "...')"); 14577 if (t && "object" == typeof t) { 14578 var o = !1, 14579 s = !1; 14580 if (ia(t, function (t, e) { 14581 if (".value" === t) o = !0; 14582 else if (".priority" !== t && ".sv" !== t && (s = !0, !ff(t))) throw new Error(r + " contains an invalid key (" + t + ") " + gu(i) + '. Keys must be non-empty strings and can\'t contain ".", "#", "$", "/", "[", or "]"'); 14583 var n; 14584 n = t, 0 < (t = i).parts_.length && (t.byteLength_ += 1), t.parts_.push(n), t.byteLength_ += zo(n), vu(t), Sf(r, e, i), e = (t = i).parts_.pop(), t.byteLength_ -= zo(e), 0 < t.parts_.length && --t.byteLength_ 14585 }), o && s) throw new Error(r + ' contains ".value" child ' + gu(i) + " in addition to actual children.") 14586 } 14587 }, 14588 Cf = function (t, e, n) { 14589 var r = n.path.toString(); 14590 if ("string" != typeof n.repoInfo.host || 0 === n.repoInfo.host.length || !ff(n.repoInfo.namespace) && "localhost" !== n.repoInfo.host.split(":")[0] || 0 !== r.length && (r = (r = r) && r.replace(/^\/*\.info(\/|$)/, "/"), !pf(r))) throw new Error(Wo(t, e, !1) + 'must be a valid firebase URL and the path can\'t contain ".", "#", "$", "[", or "]".') 14591 }, 14592 Nf = function () { 14593 this.eventLists_ = [], this.recursionDepth_ = 0 14594 }; 14595 14596 function Af(t, e) { 14597 for (var n = null, r = 0; r < e.length; r++) { 14598 var i = e[r], 14599 o = i.getPath(); 14600 null === n || fu(o, n.path) || (t.eventLists_.push(n), n = null), (n = null === n ? { 14601 events: [], 14602 path: o 14603 } : n).events.push(i) 14604 } 14605 n && t.eventLists_.push(n) 14606 } 14607 14608 function kf(t, e, n) { 14609 Af(t, n), Pf(t, function (t) { 14610 return fu(t, e) 14611 }) 14612 } 14613 14614 function Rf(t, e, n) { 14615 Af(t, n), Pf(t, function (t) { 14616 return pu(t, e) || pu(e, t) 14617 }) 14618 } 14619 14620 function Pf(t, e) { 14621 t.recursionDepth_++; 14622 for (var n = !0, r = 0; r < t.eventLists_.length; r++) { 14623 var i = t.eventLists_[r]; 14624 i && (e(i.path) ? (function (t) { 14625 for (var e = 0; e < t.events.length; e++) { 14626 var n, r = t.events[e]; 14627 null !== r && (t.events[e] = null, n = r.getEventRunner(), Qs && Xs("event: " + r.toString()), fa(n)) 14628 } 14629 }(t.eventLists_[r]), t.eventLists_[r] = null) : n = !1) 14630 } 14631 n && (t.eventLists_ = []), t.recursionDepth_-- 14632 } 14633 var Of = "repo_interrupt", 14634 Df = 25, 14635 xf = (Lf.prototype.toString = function () { 14636 return (this.repoInfo_.secure ? "https://" : "http://") + this.repoInfo_.host 14637 }, Lf); 14638 14639 function Lf(t, e, n, r) { 14640 this.repoInfo_ = t, this.forceRestClient_ = e, this.app = n, this.authTokenProvider_ = r, this.dataUpdateCount = 0, this.statsListener_ = null, this.eventQueue_ = new
14640Nf, this.nextWriteId_ = 1, this.interceptServerDataCallback_ = null, this.onDisconnect_ = zc(), this.transactionQueueTree_ = new rf, this.persistentConnection_ = null, this.key = this.repoInfo_.toURLString() 14641 } 14642 14643 function Mf(s) { 14644 if (s.stats_ = Na(s.repoInfo_), s.forceRestClient_ || 0 <= ("object" == typeof window && window.navigator && window.navigator.userAgent || "").search(/googlebot|google webmaster tools|bingbot|yahoo! slurp|baiduspider|yandexbot|duckduckbot/i)) s.server_ = new Kc(s.repoInfo_, function (t, e, n, r) { 14645 jf(s, t, e, n, r) 14646 }, s.authTokenProvider_), setTimeout(function () { 14647 return qf(s, !0) 14648 }, 0); 14649 else { 14650 var t = s.app.options.databaseAuthVariableOverride; 14651 if (null != t) { 14652 if ("object" != typeof t) throw new Error("Only objects are supported for option databaseAuthVariableOverride"); 14653 try { 14654 Ro(t) 14655 } catch (t) { 14656 throw new Error("Invalid authOverride provided: " + t) 14657 } 14658 } 14659 s.persistentConnection_ = new Tu(s.repoInfo_, s.app.options.appId, function (t, e, n, r) { 14660 jf(s, t, e, n, r) 14661 }, function (t) { 14662 qf(s, t) 14663 }, function (t) { 14664 var n; 14665 n = s, ia(t, function (t, e) { 14666 Vf(n, t, e) 14667 }) 14668 }, s.authTokenProvider_, t), s.server_ = s.persistentConnection_ 14669 } 14670 var e, n; 14671 s.authTokenProvider_.addTokenChangeListener(function (t) { 14672 s.server_.refreshAuthToken(t) 14673 }), s.statsReporter_ = (e = s.repoInfo_, n = function () { 14674 return new Zc(s.stats_, s.server_) 14675 }, e = e.toString(), Ca[e] || (Ca[e] = n()), Ca[e]), s.infoData_ = new Hc, s.infoSyncTree_ = new Nl({ 14676 startListening: function (t, e, n, r) { 14677 var i = [], 14678 o = s.infoData_.getNode(t.path); 14679 return o.isEmpty() || (i = Pl(s.infoSyncTree_, t.path, o), setTimeout(function () { 14680 r("ok") 14681 }, 0)), i 14682 }, 14683 stopListening: function () {} 14684 }), Vf(s, "connected", !1), s.serverSyncTree_ = new Nl({ 14685 startListening: function (n, t, e, r) { 14686 return s.server_.listen(n, e, t, function (t, e) { 14687 e = r(t, e); 14688 Rf(s.eventQueue_, n.path, e) 14689 }), [] 14690 }, 14691 stopListening: function (t, e) { 14692 s.server_.unlisten(t, e) 14693 } 14694 }) 14695 } 14696 14697 function Ff(t) { 14698 t = t.infoData_.getNode(new Za(".info/serverTimeOffset")).val() || 0; 14699 return (new Date).getTime() + t 14700 } 14701 14702 function Uf(t) { 14703 return Yl({ 14704 timestamp: Ff(t) 14705 }) 14706 } 14707 14708 function jf(t, e, n, r, i) { 14709 t.dataUpdateCount++; 14710 var o = new Za(e); 14711 n = t.interceptServerDataCallback_ ? t.interceptServerDataCallback_(e, n) : n; 14712 var s, a, u, c = [], 14713 h = o; 14714 0 < (c = i ? r ? (s = Lo(n, function (t) { 14715 return pc(t) 14716 }), function (t, e, n, r) { 14717 var i = Vl(t, r); 14718 if (i) { 14719 r = Bl(i), i = r.path, r = r.queryId, e = hu(i, e), n = Th.fromObject(n); 14720 return Kl(t, i, new hh(rh(r), e, n)) 14721 } 14722 return [] 14723 }(t.serverSyncTree_, o, s, i)) : (e = pc(n), s = t.serverSyncTree_, a = o, u = e, null == (i = Vl(s, e = i)) ? [] : (e = Bl(i), i = e.path, e = e.queryId, a = hu(i, a), Kl(s, i, new uh(rh(e), a, u)))) : r ? (a = Lo(n, function (t) { 14724 return pc(t) 14725 }), u = t.serverSyncTree_, r = o, a = a, a = Th.fromObject(a), Ml(u, new hh(nh(), r, a))) : (n = pc(n), Pl(t.serverSyncTree_, o, n))).length && (h = $f(t, o)), Rf(t.eventQueue_, h, c) 14726 } 14727 14728 function qf(t, e) { 14729 Vf(t, "connected", e), !1 === e && function (n) { 14730 Qf(n, "onDisconnectEvents"); 14731 var r = Uf(n), 14732 i = zc(); 14733 Yc(n.onDisconnect_, eu(), function (t, e) { 14734 e = tf(t, e, n.serverSyncTree_, r); 14735 Qc(i, t, e) 14736 }); 14737 var o = []; 14738 Yc(i, eu(), function (t, e) { 14739 o = o.concat(Pl(n.serverSyncTree_, t, e)); 14740 t = np(n, t); 14741 $f(n, t) 14742 }
14742), n.onDisconnect_ = zc(), Rf(n.eventQueue_, eu(), o) 14743 }(t) 14744 } 14745 14746 function Vf(t, e, n) { 14747 e = new Za("/.info/" + e), n = pc(n); 14748 t.infoData_.updateSnapshot(e, n); 14749 n = Pl(t.infoSyncTree_, e, n); 14750 Rf(t.eventQueue_, e, n) 14751 } 14752 14753 function Bf(t) { 14754 return t.nextWriteId_++ 14755 } 14756 14757 function Kf(r, i, t, e, o) { 14758 Qf(r, "set", { 14759 path: i.toString(), 14760 value: t, 14761 priority: e 14762 }); 14763 var n = Uf(r), 14764 t = pc(t, e), 14765 e = xl(r.serverSyncTree_, i), 14766 n = ef(t, e, n), 14767 s = Bf(r), 14768 n = Al(r.serverSyncTree_, i, n, s, !0); 14769 Af(r.eventQueue_, n), r.server_.put(i.toString(), t.val(!0), function (t, e) { 14770 var n = "ok" === t; 14771 n || Zs("set at " + i + " failed: " + t); 14772 n = Rl(r.serverSyncTree_, s, !n); 14773 Rf(r.eventQueue_, i, n), Yf(0, o, t, e) 14774 }); 14775 t = np(r, i); 14776 $f(r, t), Rf(r.eventQueue_, t, []) 14777 } 14778 14779 function Wf(n, r, i) { 14780 n.server_.onDisconnectCancel(r.toString(), function (t, e) { 14781 "ok" === t && ! function t(n, e) { 14782 if (cu(e)) return n.value = null, n.children.clear(), !0; 14783 if (null !== n.value) { 14784 if (n.value.isLeafNode()) return !1; 14785 var r = n.value; 14786 return n.value = null, r.forEachChild(Ju, function (t, e) { 14787 Qc(n, new Za(t), e) 14788 }), t(n, e) 14789 } 14790 if (0 < n.children.size) return r = nu(e), e = iu(e), n.children.has(r) && t(n.children.get(r), e) && n.children.delete(r), 0 === n.children.size; 14791 return !0 14792 }(n.onDisconnect_, r), Yf(0, i, t, e) 14793 }) 14794 } 14795 14796 function Hf(n, r, t, i) { 14797 var o = pc(t); 14798 n.server_.onDisconnectPut(r.toString(), o.val(!0), function (t, e) { 14799 "ok" === t && Qc(n.onDisconnect_, r, o), Yf(0, i, t, e) 14800 }) 14801 } 14802 14803 function Gf(t, e, n) { 14804 n = ".info" === nu(e.path) ? Dl(t.infoSyncTree_, e, n) : Dl(t.serverSyncTree_, e, n); 14805 kf(t.eventQueue_, e.path, n) 14806 } 14807 14808 function zf(t) { 14809 t.persistentConnection_ && t.persistentConnection_.interrupt(Of) 14810 } 14811 14812 function Qf(t) { 14813 for (var e = [], n = 1; n < arguments.length; n++) e[n - 1] = arguments[n]; 14814 var r = ""; 14815 t.persistentConnection_ && (r = t.persistentConnection_.id + ":"), Xs.apply(void 0, no([r], eo(e))) 14816 } 14817 14818 function Yf(t, n, r, i) { 14819 n && fa(function () { 14820 var t, e; 14821 "ok" === r ? n(null) : (e = t = (r || "error").toUpperCase(), i && (e += ": " + i), (e = new Error(e)).code = t, n(e)) 14822 }) 14823 } 14824 14825 function Xf(t, e, n) { 14826 return xl(t.serverSyncTree_, e, n) || uc.EMPTY_NODE 14827 } 14828 14829 function Jf(e, t) { 14830 var n; 14831 (t = void 0 === t ? e.transactionQueueTree_ : t) || ep(e, t), sf(t) ? (n = tp(e, t), so(0 < n.length, "Sending zero length transaction queue"), n.every(function (t) { 14832 return 0 === t.status 14833 }) && function (i, o, s) { 14834 for (var t = s.map(function (t) { 14835 return t.currentWriteId 14836 }), e = Xf(i, o, t), n = e, t = e.hash(), r = 0; r < s.length; r++) { 14837 var a = s[r]; 14838 so(0 === a.status, "tryToSendTransactionQueue_: items in queue should all be run."), a.status = 1, a.retryCount++; 14839 var u = hu(o, a.path); 14840 n = n.updateChild(u, a.currentOutputSnapshotRaw) 14841 } 14842 var e = n.val(!0), 14843 c = o; 14844 i.server_.put(c.toString(), e, function (t) { 14845 Qf(i, "transaction put response", { 14846 path: c.toString(), 14847 status: t 14848 }); 14849 var e = []; 14850 if ("ok" === t) { 14851 for (var n = [], r = 0; r < s.length; r++) ! function (t) { 14852 s[t].status = 2, e = e.concat(Rl(i.serverSyncTree_, s[t].currentWriteId)), s[t].onComplete && n.push(function () { 14853 return s[t].onComplete(null, !0, s[t].currentOutputSnapshotResolved) 14854 }), s[t].unwatcher() 14855 }(r); 14856 ep(i, of (i.transactionQueueTree_, o)), Jf(i, i.transactionQueueTree_), Rf(i.eventQueue_, o, e); 14857 for (r = 0; r < n.length; r++) fa(n[r]) 14858 } else { 14859 if ("datastale" === t) 14860 for (r = 0; r < s.length; r++) 3 === s[r].status ? s[r].status = 4 : s[r].status = 0; 14861 else { 14862 Zs("transaction at " + c.toString() + " failed: " + t); 14863 for (r = 0; r < s.length; r++) s[r].status = 4, s[r].abortReason = t 14864 } 14865 $f(i, o) 14866 } 14867 }, t) 14868 }(e, hf(t), n)) : uf(t) && cf(t, function (t) { 14869 Jf(e, t) 14870 }) 14871 } 14872 14873 function $f(t, e) { 14874 var n = Zf(t, e), 14875 e = hf(n); 14876 return function (u, c, h) { 14877 if (0 === c.length) return;
14878 for (var l = [], f = [], p = c.filter(function (t) { 14879 return 0 === t.status 14880 }).map(function (t) { 14881 return t.currentWriteId 14882 }), t = 0; t < c.length; t++) ! function (t) { 14883 var e, n, r, i, o = c[t], 14884 s = hu(h, o.path), 14885 a = !1; 14886 so(null !== s, "rerunTransactionsUnderNode_: relativePath should not be null."), 4 === o.status ? (a = !0, e = o.abortReason, f = f.concat(Rl(u.serverSyncTree_, o.currentWriteId, !0))) : 0 === o.status && (f = o.retryCount >= Df ? (a = !0, e = "maxretry", f.concat(Rl(u.serverSyncTree_, o.currentWriteId, !0))) : (n = Xf(u, o.path, p), o.currentInputSnapshot = n, void 0 !== (i = c[t].update(n.val())) ? (Sf("transaction failed: Data returned ", i, o.path), r = pc(i), "object" == typeof i && null != i && Oo(i, ".priority") || (r = r.updatePriority(n.getPriority())), s = o.currentWriteId, i = Uf(u), i = ef(r, n, i), o.currentOutputSnapshotRaw = r, o.currentOutputSnapshotResolved = i, o.currentWriteId = Bf(u), p.splice(p.indexOf(s), 1), (f = f.concat(Al(u.serverSyncTree_, o.path, i, o.currentWriteId, o.applyLocally))).concat(Rl(u.serverSyncTree_, s, !0))) : (a = !0, e = "nodata", f.concat(Rl(u.serverSyncTree_, o.currentWriteId, !0))))), Rf(u.eventQueue_, h, f), f = [], a && (c[t].status = 2, a = c[t].unwatcher, setTimeout(a, Math.floor(0)), c[t].onComplete && ("nodata" === e ? l.push(function () { 14887 return c[t].onComplete(null, !1, c[t].currentInputSnapshot) 14888 }) : l.push(function () { 14889 return c[t].onComplete(new Error(e), !1, null) 14890 }))) 14891 }(t); 14892 ep(u, u.transactionQueueTree_); 14893 for (t = 0; t < l.length; t++) fa(l[t]); 14894 Jf(u, u.transactionQueueTree_) 14895 }(t, tp(t, n), e), e 14896 } 14897 14898 function Zf(t, e) { 14899 for (var n = t.transactionQueueTree_, r = nu(e); null !== r && void 0 === sf(n);) n = of (n, r), r = nu(e = iu(e)); 14900 return n 14901 } 14902 14903 function tp(t, e) { 14904 var n = []; 14905 return function e(n, t, r) { 14906 var i = sf(t); 14907 if (i) 14908 for (var o = 0; o < i.length; o++) r.push(i[o]); 14909 cf(t, function (t) { 14910 e(n, t, r) 14911 }) 14912 }(t, e, n), n.sort(function (t, e) { 14913 return t.order - e.order 14914 }), n 14915 } 14916 14917 function ep(e, t) { 14918 var n = sf(t); 14919 if (n) { 14920 for (var r = 0, i = 0; i < n.length; i++) 2 !== n[i].status && (n[r] = n[i], r++); 14921 n.length = r, af(t, 0 < n.length ? n : void 0) 14922 } 14923 cf(t, function (t) { 14924 ep(e, t) 14925 }) 14926 } 14927 14928 function np(e, t) { 14929 var n = hf(Zf(e, t)), 14930 t = of (e.transactionQueueTree_, t); 14931 return function (t, e, n) { 14932 for (var r = n ? t : t.parent; null !== r;) { 14933 if (e(r)) return; 14934 r = r.parent 14935 } 14936 }(t, function (t) { 14937 rp(e, t) 14938 }), rp(e, t), 14939 function e(t, n, r, i) { 14940 r && !i && n(t), cf(t, function (t) { 14941 e(t, n, !0, i) 14942 }), r && i && n(t) 14943 }(t, function (t) { 14944 rp(e, t) 14945 }), n 14946 } 14947 14948 function rp(t, e) { 14949 var n = sf(e); 14950 if (n) { 14951 for (var r = [], i = [], o = -1, s = 0; s < n.length; s++) 3 === n[s].status || (1 === n[s].status ? (so(o === s - 1, "All SENT items should be at beginning of queue."), n[o = s].status = 3, n[s].abortReason = "set") : (so(0 === n[s].status, "Unexpected transaction status in abort"), n[s].unwatcher(), i = i.concat(Rl(t.serverSyncTree_, n[s].currentWriteId, !0)), n[s].onComplete && r.push(n[s].onComplete.bind(null, new Error("set"), !1, null)))); - 1 === o ? af(e, void 0) : n.length = o + 1, Rf(t.eventQueue_, hf(e), i); 14952 for (s = 0; s < r.length; s++) fa(r[s]) 14953 } 14954 } 14955 var ip = function (t, e) { 14956 var n = op(t), 14957 r = n.namespace; 14958 "firebase.com" === n.domain && $s(n.host + " is no longer supported. Please use <YOUR FIREBASE>.firebaseio.com instead"), r && "undefined" !== r || "localhost" === n.domain || $s("Cannot parse Firebase url. Please use https://<YOUR FIREBASE>.firebaseio.com"), n.secure || "undefined" != typeof window && window.location && window.location.protocol && -1 !== window.location.protocol.indexOf("https:") && Zs("Insecure Firebase access from a secure page. Please use https in calls to new Firebase()."); 14959 t = "ws" === n.scheme || "wss" === n.scheme; 14960 return { 14961 repoInfo: new wa(n.host, n.secure, r, e, t, "", r !== n.subdomain), 14962 path: new Za(n.pathString) 14963 } 14964 }, 14965 op = function (t) { 14966 var e, n, r, i = "", 14967 o = "", 14968 s = "", 14969 a = "", 14970 u = "", 14971 c = !0, 14972 h = "https", 14973 l = 443; 14974 return "string" == typeof t && (0 <= (r = t.indexOf("//")) && (h = t.substring(0, r - 1), t = t.substring(r + 2)), -1 === (e = t.indexOf("/")) && (e = t.length), -1 === (n = t.indexOf("?")) && (n = t.length), i = t.substring(0, Math.min(e, n)), e < n && (a = function (t) { 14975 for (var e = "", n = t.split("/"), r = 0; r < n.length; r++) 14976 if (0 < n[r].length) { 14977 var i = n[r]; 14978 try { 14979 i = decodeURIComponent(i.replace(/\+/g, " ")) 14980 } catch (t) {} 14981 e += "/" + i 14982 } return e 14983 }(t.substring(e, n))), n = function (t) { 14984 var e, n, r = {}; 14985 "?" === t.charAt(0) && (t = t.substring(1)); 14986 try { 14987 for (var i = to(t.split("&")), o = i.next(); !o.done; o = i.next()) { 14988 var s, a = o.value; 14989 0 !== a.length && (2 === (s = a.split("=")).length ? r[decode
14989URIComponent(s[0])] = decodeURIComponent(s[1]) : Zs("Invalid query segment '" + a + "' in query '" + t + "'")) 14990 } 14991 } catch (t) { 14992 e = { 14993 error: t 14994 } 14995 } finally { 14996 try { 14997 o && !o.done && (n = i.return) && n.call(i) 14998 } finally { 14999 if (e) throw e.error 15000 } 15001 } 15002 return r 15003 }(t.substring(Math.min(t.length, n))), 0 <= (r = i.indexOf(":")) ? (c = "https" === h || "wss" === h, l = parseInt(i.substring(r + 1), 10)) : r = i.length, "localhost" === (r = i.slice(0, r)).toLowerCase() ? o = "localhost" : r.split(".").length <= 2 ? o = r : (r = i.indexOf("."), s = i.substring(0, r).toLowerCase(), o = i.substring(r + 1), u = s), "ns" in n && (u = n.ns)), { 15004 host: i, 15005 port: l, 15006 domain: o, 15007 subdomain: s, 15008 secure: c, 15009 scheme: h, 15010 pathString: a, 15011 namespace: u 15012 } 15013 }, 15014 sp = (ap.prototype.val = function () { 15015 return Ko("DataSnapshot.val", 0, 0, arguments.length), this.node_.val() 15016 }, ap.prototype.exportVal = function () { 15017 return Ko("DataSnapshot.exportVal", 0, 0, arguments.length), this.node_.val(!0) 15018 }, ap.prototype.toJSON = function () { 15019 return Ko("DataSnapshot.toJSON", 0, 1, arguments.length), this.exportVal() 15020 }, ap.prototype.exists = function () { 15021 return Ko("DataSnapshot.exists", 0, 0, arguments.length), !this.node_.isEmpty() 15022 }, ap.prototype.child = function (t) { 15023 Ko("DataSnapshot.child", 0, 1, arguments.length), t = String(t), wf("DataSnapshot.child", 1, t, !1); 15024 var e = new Za(t), 15025 t = this.ref_.child(e); 15026 return new ap(this.node_.getChild(e), t, Ju) 15027 }, ap.prototype.hasChild = function (t) { 15028 Ko("DataSnapshot.hasChild", 1, 1, arguments.length), wf("DataSnapshot.hasChild", 1, t, !1); 15029 t = new Za(t); 15030 return !this.node_.getChild(t).isEmpty() 15031 }, ap.prototype.getPriority = function () { 15032 return Ko("DataSnapshot.getPriority", 0, 0, arguments.length), this.node_.getPriority().val() 15033 }, ap.prototype.forEach = function (n) { 15034 var r = this; 15035 return Ko("DataSnapshot.forEach", 1, 1, arguments.length), Ho("DataSnapshot.forEach", 1, n, !1), !this.node_.isLeafNode() && !!this.node_.forEachChild(this.index_, function (t, e) { 15036 return n(new ap(e, r.ref_.child(t), Ju)) 15037 }) 15038 }, ap.prototype.hasChildren = function () { 15039 return Ko("DataSnapshot.hasChildren", 0, 0, arguments.length), !this.node_.isLeafNode() && !this.node_.isEmpty() 15040 }, Object.defineProperty(ap.prototype, "key", { 15041 get: function () { 15042 return this.ref_.getKey() 15043 }, 15044 enumerable: !1, 15045 configurable: !0 15046 }), ap.prototype.numChildren = function () { 15047 return Ko("DataSnapshot.numChildren", 0, 0, arguments.length), this.node_.numChildren() 15048 }, ap.prototype.getRef = function () { 15049 return Ko("DataSnapshot.ref", 0, 0, arguments.length), this.ref_ 15050 }, Object.defineProperty(ap.prototype, "ref", { 15051 get: function () { 15052 return this.getRef() 15053 }, 15054 enumerable: !1, 15055 configurable: !0 15056 }), ap); 15057 15058 function ap(t, e, n) { 15059 this.node_ = t, this.ref_ = e, this.index_ = n 15060 } 15061 var up = (cp.prototype.cancel = function (t) { 15062 Ko("OnDisconnect.cancel", 0, 1, arguments.length), Ho("OnDisconnect.cancel", 1, t, !0); 15063 var e = new lo; 15064 return Wf(this.repo_, this.path_, e.wrapCallback(t)), e.promise 15065 }, cp.prototype.remove = function (t) { 15066 Ko("OnDisconnect.remove", 0, 1, arguments.length), _f("OnDisconnect.remove", this.path_), Ho("OnDisconnect.remove", 1, t, !0); 15067 var e = new lo; 15068 return Hf(this.repo_, this.path_, null, e.wrapCallback(t)), e.promise 15069 }, cp.prototype.set = function (t, e) { 15070 Ko("OnDisconnect.set", 1, 2, arguments.length), _f("OnDisconnect.set", this.path_), vf("OnDisconnect.set", 1, t, this.path_, !1), Ho("OnDisconnect.set", 2, e, !0); 15071 var n = new lo; 15072 return Hf(this.repo_, this.path_, t, n.wrapCallback(e)), n.promise 15073 }, cp.prototype.setWithPriority = function (t, e, n) { 15074 Ko("OnDisconnect.setWithPriority", 2, 3, arguments.length), _f("OnDisconnect.setWithPriority", this.path_), vf("OnDisconnect.setWithPriority", 1, t, this.path_, !1), yf("OnDisconnect.setWithPriority", 2, e, !1), Ho("OnDisconnect.setWithPriority", 3, n, !0); 15075 var r, i, o, s, a = new lo; 15076 return r = this.repo_, i = this.path_, t = t, e = e, o = a.wrapCallback(n), s = pc(t, e), r.server_.onDisconnectPut(i.toString(), s.val(!0), function (t, e) { 15077 "ok" === t && Qc(r.onDisconnect_, i, s), Yf(0, o, t, e) 15078 }), a.promise 15079 }, cp.prototype.update = function (t, e) {
15080 if (Ko("OnDisconnect.update", 1, 2, arguments.length), _f("OnDisconnect.update", this.path_), Array.isArray(t)) { 15081 for (var n = {}, r = 0; r < t.length; ++r) n["" + r] = t[r]; 15082 t = n, Zs("Passing an Array to firebase.database.onDisconnect().update() is deprecated. Use set() if you want to overwrite the existing data, or an Object with integer keys if you really do want to only update some of the children.") 15083 } 15084 gf("OnDisconnect.update", 1, t, this.path_, !1), Ho("OnDisconnect.update", 2, e, !0); 15085 var i = new lo; 15086 return function (n, r, i, o) { 15087 if (xo(i)) return Xs("onDisconnect().update() called with empty data. Don't do anything."), Yf(0, o, "ok", void 0); 15088 n.server_.onDisconnectMerge(r.toString(), i, function (t, e) { 15089 "ok" === t && ia(i, function (t, e) { 15090 e = pc(e); 15091 Qc(n.onDisconnect_, uu(r, t), e) 15092 }), Yf(0, o, t, e) 15093 }) 15094 }(this.repo_, this.path_, t, i.wrapCallback(e)), i.promise 15095 }, cp); 15096 15097 function cp(t, e) { 15098 this.repo_ = t, this.path_ = e 15099 } 15100 var hp = (lp.prototype.getPath = function () { 15101 var t = this.snapshot.getRef(); 15102 return ("value" === this.eventType ? t : t.getParent()).path 15103 }, lp.prototype.getEventType = function () { 15104 return this.eventType 15105 }, lp.prototype.getEventRunner = function () { 15106 return this.eventRegistration.getEventRunner(this) 15107 }, lp.prototype.toString = function () { 15108 return this.getPath().toString() + ":" + this.eventType + ":" + Ro(this.snapshot.exportVal()) 15109 }, lp); 15110 15111 function lp(t, e, n, r) { 15112 this.eventType = t, this.eventRegistration = e, this.snapshot = n, this.prevName = r 15113 } 15114 var fp = (pp.prototype.getPath = function () { 15115 return this.path 15116 }, pp.prototype.getEventType = function () { 15117 return "cancel" 15118 }, pp.prototype.getEventRunner = function () { 15119 return this.eventRegistration.getEventRunner(this) 15120 }, pp.prototype.toString = function () { 15121 return this.path.toString() + ":cancel" 15122 }, pp); 15123 15124 function pp(t, e, n) { 15125 this.eventRegistration = t, this.error = e, this.path = n 15126 } 15127 var dp = (vp.prototype.respondsTo = function (t) { 15128 return "value" === t 15129 }, vp.prototype.createEvent = function (t, e) { 15130 var n = e.getQueryParams().getIndex(); 15131 return new hp("value", this, new sp(t.snapshotNode, e.getRef(), n)) 15132 }, vp.prototype.getEventRunner = function (t) { 15133 var e = this.context_; 15134 if ("cancel" === t.getEventType()) { 15135 so(this.cancelCallback_, "Raising a cancel event on a listener with no cancel callback"); 15136 var n = this.cancelCallback_; 15137 return function () { 15138 n.call(e, t.error) 15139 } 15140 } 15141 var r = this.callback_; 15142 return function () { 15143 r.call(e, t.snapshot) 15144 } 15145 }, vp.prototype.createCancelEvent = function (t, e) { 15146 return this.cancelCallback_ ? new fp(this, t, e) : null 15147 }, vp.prototype.matches = function (t) { 15148 return t instanceof vp && (!t.callback_ || !this.callback_ || t.callback_ === this.callback_ && t.context_ === this.context_) 15149 }, vp.prototype.hasAnyCallback = function () { 15150 return null !== this.callback_ 15151 }, vp); 15152 15153 function vp(t, e, n) { 15154 this.callback_ = t, this.cancelCallback_ = e, this.context_ = n 15155 } 15156 var gp, yp = (mp.prototype.respondsTo = function (t) { 15157 t = "children_removed" === (t = "children_added" === t ? "child_added" : t) ? "child_removed" : t; 15158 return Oo(this.callbacks_, t) 15159 }, mp.prototype.createCancelEvent = function (t, e) { 15160 return this.cancelCallback_ ? new fp(this, t, e) : null 15161 }, mp.prototype.createEvent = function (t, e) { 15162 so(null != t.childName, "Child events should have a childName."); 15163 var n = e.getRef().child(t.childName), 15164 e = e.getQueryParams().getIndex(); 15165 return new hp(t.type, this, new sp(t.snapshotNode, n, e), t.prevName) 15166 }, mp.prototype.getEventRunner = function (t) { 15167 var e = this.context_; 15168 if ("cancel" === t.getEventType()) { 15169 so(this.cancelCallback_, "Raising a cancel event on a listener with no cancel callback"); 15170 var n = this.cancelCallback_; 15171 return function () { 15172 n.call(e, t.error) 15173 } 15174 } 15175 var r = this.callbacks_[t.eventType]; 15176 return function () { 15177 r.call(e, t.snapshot, t.prevName) 15178 } 15179 }, mp.prototype.matches = function (e) { 15180 var n = this; 15181 if (e instanceof mp) { 15182 if (!this.callbacks_ || !e.callbacks_) return !0; 15183 if (this.context_ === e.context_) { 15184 var t = Object.keys(e.callbacks_), 15185 r = Object.keys(this.callbacks_), 15186 i = t.length; 15187 if (i === r.length) { 15188 if (1 !== i) return r.every(function (t) { 15189 return e.callbacks_[t] === n.callbacks_[t] 15190 }); 15191 t = t[0], r = r[0]; 15192 return !(r !== t || e.callbacks_[t] && this.callbacks_[r] && e.callbacks_[t] !== this.callbacks_[r]) 15193 } 15194 } 15195 } 15196 return !1 15197 }, mp.prototype.hasAnyCallback = function () { 15198 return null !== this.callbacks_ 15199 }, mp); 15200 15201 function mp(t, e, n) { 15202 this.callbacks_ = t, this.cancelCallback_ = e, this.context_ = n 15203 } 15204 var bp = (Object.defineProperty(wp, "__referenceConstructor", { 15205 get: function () { 15206 return so(gp, "Reference.ts has not been loaded"), gp 15207 }, 15208 set: function (t) { 15209 gp = t 15210 }, 15211 enumerable: !1, 15212 configurable: !0 15213 }), wp.validateQueryEndpoints_ = function (t) { 15214 var e = null, 15215 n = null; 15216 if (t.hasStart() && (e = t.getIndexStartValue()), t.hasEnd() && (n = t.getIndexEndValue()), t.getIndex() === Pu) { 15217 var r = "Query: When ordering by key, you may only pass one argument to startAt(), endAt(), or equalTo().", 15218 i = "Query: When ordering by key, the argument passed to startAt(), startAfter(), endAt(), endBefore(), or equalTo() must be a string."; 15219 if (t.hasStart()) { 15220 if (t.getIndexStartName() !== ta) throw new Error(r); 15221 if ("string" != typeof e) throw new Error(i) 15222 } 15223 if (t.hasEnd()) { 15224 if (t.getIndexEndName() !== ea) throw new Error(r); 15225 if ("string" != typeof n) throw new Error(i) 15226 } 15227 } else if (t.getIndex() === Ju) { 15228 if (null != e && !df(e) || null != n && !df(n)) throw new Error("Query: When ordering by priority, the first argument passed to startAt(), startAfter() endAt(), endBefore(), or equalTo() must be a valid priority value (null, a number, or a string).") 15229 } else if (so(t.getIndex() instanceof gc || t.getIndex() === Tc, "unknown index type."), null != e && "object" == typeof e || null != n && "object" == typeof n) throw new Error("Query: First argument passed to startAt(), startAfter(), endAt(), endBefore(), or equalTo() cannot be an object.") 15230 }, wp.validateLimit_ = function (t) { 15231 if (t.hasStart() && t.hasEnd() && t.hasLimit() && !t.hasAnchoredLimit()) throw new Error("Query: Can't combine startAt(), startAfter(), endAt(), endBefore(), and limit(). Use limitToFirst() or limitToLast() instead.") 15232 }, wp.prototype.validateNoPreviousOrderByCall_ = function (t) { 15233 if (!0 === this.orderByCalled_) throw new Error(t + ": You can't combine multiple orderBy calls.") 15234 }, wp.prototype.getQueryParams = function () { 15235 return this.queryParams_ 15236 }, wp.prototype.getRef = function () { 15237 return Ko("Query.ref", 0, 0, arguments.length), new wp.__referenceConstructor(this.database, this.path) 15238 }, wp.prototype.on = function (t, e, n, r) { 15239 Ko("Query.on", 2, 4, arguments.length), mf("Query.on", 1, t, !1), Ho("Query.on", 2, e, !1); 15240 n = wp.getCancelAndContextArgs_("Query.on", n, r); 15241 return "value" === t ? this.onValueEvent(e, n.cancel, n.context) : ((r = {})[t] = e, this.onChildEvent(r, n.cancel, n.context)), e 15242 }, wp.prototype.onValueEvent = function (t, e, n) { 15243 n = new dp(t, e || null, n || null); 15244 Gf(this.repo, this, n) 15245 }, wp.prototype.onChildEvent = function (t, e, n) { 15246 n = new yp(t, e, n); 15247 Gf(this.repo, this, n) 15248 }, wp.prototype.off = function (t, e, n) { 15249 Ko("Query.off", 0, 3, arguments.length), mf("Query.off", 1, t, !0), Ho("Query.off", 2, e, !0), Go("Query.off", 3, n, !0); 15250 var r = null, 15251 i = null; 15252 "value" === t ? r = new dp(e || null, null, n || null) : t && (e && ((i = {})[t] = e), r = new yp(i, null, n || null)), i = this.repo, n = r, n = ".info" === nu((r = this).path) ? Ol(i.infoSyncTree_, r, n) : Ol(i.serverSyncTree_, r, n), kf(i.eventQueue_, r.path, n) 15253 }, wp.prototype.get = function () { 15254 var n, r, t, e = this; 15255 return n = this.repo, r = this, (null != (t = Ll(n.serverSyncTree_, r)) ? Promise.resolve(t) : n.server_.get(r).then(function (t) { 15256 var e = pc(t), 15257 t = Pl(n.serverSyncTree_, r.path, e); 15258 return kf(n.eventQueue_, r.path, t), Promise.resolve(e) 15259 }, function (t) { 15260 return Qf(n, "get for query " + Ro(r) + " failed: " + t), Promise.reject(new Error(t)) 15261 })).then(function (t) { 15262 return new sp(t, e.getRef(), e.getQueryParams().getIndex()) 15263 }) 15264 }, wp.prototype.once = function (e, n, t, r) { 15265 var i = this; 15266 Ko("Query.once", 1, 4, arguments.length), mf("Query.once", 1, e, !1), Ho("Query.once", 2, n, !0); 15267 var o = wp.getCancelAndContextArgs_("Query.once", t, r), 15268 s = !0, 15269 a = new lo; 15270 a.promise.catch(function () {}); 15271 var u = function (t) { 15272 s && (s = !1, i.off(e, u), n && n.bind(o.context)(t), a.resolve(t)) 15273 }; 15274 return this.on(e, u, function (t) { 15275 i.off(e, u), o.cancel && o.cancel.bind(o.context)(t), a.reject(t) 15276 }), a.promise 15277 }, wp.prototype.limitToFirst = function (t) { 15278 if (Ko("Query.limitToFirst", 1, 1, arguments.length), "number" != typeof t || Math.floor(t) !== t || t
15278<= 0) throw new Error("Query.limitToFirst: First argument must be a positive integer."); 15279 if (this.queryParams_.hasLimit()) throw new Error("Query.limitToFirst: Limit was already set (by another call to limit, limitToFirst, or limitToLast)."); 15280 return new wp(this.database, this.path, (e = this.queryParams_, t = t, (e = e.copy()).limitSet_ = !0, e.limit_ = t, e.viewFrom_ = "l", e), this.orderByCalled_); 15281 var e 15282 }, wp.prototype.limitToLast = function (t) { 15283 if (Ko("Query.limitToLast", 1, 1, arguments.length), "number" != typeof t || Math.floor(t) !== t || t <= 0) throw new Error("Query.limitToLast: First argument must be a positive integer."); 15284 if (this.queryParams_.hasLimit()) throw new Error("Query.limitToLast: Limit was already set (by another call to limit, limitToFirst, or limitToLast)."); 15285 return new wp(this.database, this.path, (e = this.queryParams_, t = t, (e = e.copy()).limitSet_ = !0, e.limit_ = t, e.viewFrom_ = "r", e), this.orderByCalled_); 15286 var e 15287 }, wp.prototype.orderByChild = function (t) { 15288 if (Ko("Query.orderByChild", 1, 1, arguments.length), "$key" === t) throw new Error('Query.orderByChild: "$key" is invalid. Use Query.orderByKey() instead.'); 15289 if ("$priority" === t) throw new Error('Query.orderByChild: "$priority" is invalid. Use Query.orderByPriority() instead.'); 15290 if ("$value" === t) throw new Error('Query.orderByChild: "$value" is invalid. Use Query.orderByValue() instead.'); 15291 wf("Query.orderByChild", 1, t, !1), this.validateNoPreviousOrderByCall_("Query.orderByChild"); 15292 t = new Za(t); 15293 if (cu(t)) throw new Error("Query.orderByChild: cannot pass in empty path. Use Query.orderByValue() instead."); 15294 t = new gc(t), t = qc(this.queryParams_, t); 15295 return wp.validateQueryEndpoints_(t), new wp(this.database, this.path, t, !0) 15296 }, wp.prototype.orderByKey = function () { 15297 Ko("Query.orderByKey", 0, 0, arguments.length), this.validateNoPreviousOrderByCall_("Query.orderByKey"); 15298 var t = qc(this.queryParams_, Pu); 15299 return wp.validateQueryEndpoints_(t), new wp(this.database, this.path, t, !0) 15300 }, wp.prototype.orderByPriority = function () { 15301 Ko("Query.orderByPriority", 0, 0, arguments.length), this.validateNoPreviousOrderByCall_("Query.orderByPriority"); 15302 var t = qc(this.queryParams_, Ju); 15303 return wp.validateQueryEndpoints_(t), new wp(this.database, this.path, t, !0) 15304 }, wp.prototype.orderByValue = function () { 15305 Ko("Query.orderByValue", 0, 0, arguments.length), this.validateNoPreviousOrderByCall_("Query.orderByValue"); 15306 var t = qc(this.queryParams_, Tc); 15307 return wp.validateQueryEndpoints_(t), new wp(this.database, this.path, t, !0) 15308 }, wp.prototype.startAt = function (t, e) { 15309 void 0 === t && (t = null), Ko("Query.startAt", 0, 2, arguments.length), vf("Query.startAt", 1, t, this.path, !0), bf("Query.startAt", 2, e, !0); 15310 var n = Uc(this.queryParams_, t, e); 15311 if (wp.validateLimit_(n), wp.validateQueryEndpoints_(n), this.queryParams_.hasStart()) throw new Error("Query.startAt: Starting point was already set (by another call to startAt or equalTo)."); 15312 return void 0 === t && (e = t = null), new wp(this.database, this.path, n, this.orderByCalled_) 15313 }, wp.prototype.startAfter = function (t, e) { 15314 void 0 === t && (t = null), Ko("Query.startAfter", 0, 2, arguments.length), vf("Query.startAfter", 1, t, this.path, !1), bf("Query.startAfter", 2, e, !0); 15315 var n, e = (n = this.queryParams_, t = t, e = e, (e = n.index_ === Pu ? Uc(n, t = "string" == typeof t ? bc(t) : t, e) : Uc(n, t, null == e ? ea : bc(e))).startAfterSet_ = !0, e); 15316 if (wp.validateLimit_(e), wp.validateQueryEndpoints_(e), this.queryParams_.hasStart()) throw new Error("Query.startAfter: Starting point was already set (by another call to startAt, startAfter or equalTo)."); 15317 return new wp(this.database, this.path, e, this.orderByCalled_) 15318 }, wp.prototype.endAt = function (t, e) { 15319 void 0 === t && (t = null), Ko("Query.endAt", 0, 2, arguments.length), vf("Query.endAt",
153191, t, this.path, !0), bf("Query.endAt", 2, e, !0); 15320 e = jc(this.queryParams_, t, e); 15321 if (wp.validateLimit_(e), wp.validateQueryEndpoints_(e), this.queryParams_.hasEnd()) throw new Error("Query.endAt: Ending point was already set (by another call to endAt, endBefore, or equalTo)."); 15322 return new wp(this.database, this.path, e, this.orderByCalled_) 15323 }, wp.prototype.endBefore = function (t, e) { 15324 void 0 === t && (t = null), Ko("Query.endBefore", 0, 2, arguments.length), vf("Query.endBefore", 1, t, this.path, !1), bf("Query.endBefore", 2, e, !0); 15325 var n, e = (n = this.queryParams_, t = t, e = e, (e = n.index_ === Pu ? jc(n, t = "string" == typeof t ? wc(t) : t, e) : jc(n, t, null == e ? ta : wc(e))).endBeforeSet_ = !0, e); 15326 if (wp.validateLimit_(e), wp.validateQueryEndpoints_(e), this.queryParams_.hasEnd()) throw new Error("Query.endBefore: Ending point was already set (by another call to endAt, endBefore, or equalTo)."); 15327 return new wp(this.database, this.path, e, this.orderByCalled_) 15328 }, wp.prototype.equalTo = function (t, e) { 15329 if (Ko("Query.equalTo", 1, 2, arguments.length), vf("Query.equalTo", 1, t, this.path, !1), bf("Query.equalTo", 2, e, !0), this.queryParams_.hasStart()) throw new Error("Query.equalTo: Starting point was already set (by another call to startAt/startAfter or equalTo)."); 15330 if (this.queryParams_.hasEnd()) throw new Error("Query.equalTo: Ending point was already set (by another call to endAt/endBefore or equalTo)."); 15331 return this.startAt(t, e).endAt(t, e) 15332 }, wp.prototype.toString = function () { 15333 return Ko("Query.toString", 0, 0, arguments.length), this.repo.toString() + function (t) { 15334 for (var e = "", n = t.pieceNum_; n < t.pieces_.length; n++) "" !== t.pieces_[n] && (e += "/" + encodeURIComponent(String(t.pieces_[n]))); 15335 return e || "/" 15336 }(this.path) 15337 }, wp.prototype.toJSON = function () { 15338 return Ko("Query.toJSON", 0, 1, arguments.length), this.toString() 15339 }, wp.prototype.queryObject = function () { 15340 return t = this.queryParams_, n = {}, t.startSet_ && (n.sp = t.indexStartValue_, t.startNameSet_ && (n.sn = t.indexStartName_)), t.endSet_ && (n.ep = t.indexEndValue_, t.endNameSet_ && (n.en = t.indexEndName_)), t.limitSet_ && (n.l = t.limit_, "" === (e = t.viewFrom_) && (e = t.isViewFromLeft() ? "l" : "r"), n.vf = e), t.index_ !== Ju && (n.i = t.index_.toString()), n; 15341 var t, e, n 15342 }, wp.prototype.queryIdentifier = function () { 15343 var t = this.queryObject(), 15344 t = ra(t); 15345 return "{}" === t ? "default" : t 15346 }, wp.prototype.isEqual = function (t) { 15347 if (Ko("Query.isEqual", 1, 1, arguments.length), !(t instanceof wp)) throw new Error("Query.isEqual failed: First argument must be an instance of firebase.database.Query."); 15348 var e = this.repo === t.repo, 15349 n = fu(this.path, t.path), 15350 t = this.queryIdentifier() === t.queryIdentifier(); 15351 return e && n && t 15352 }, wp.getCancelAndContextArgs_ = function (t, e, n) { 15353 var r = { 15354 cancel: null, 15355 context: null 15356 }; 15357 if (e && n) r.cancel = e, Ho(t, 3, r.cancel, !0), r.context = n, Go(t, 4, r.context, !0); 15358 else if (e) 15359 if ("object" == typeof e && null !== e) r.context = e; 15360 else { 15361 if ("function" != typeof e) throw new Error(Wo(t, 3, !0) + " must either be a cancel callback or a context object."); 15362 r.cancel = e 15363 } return r 15364 }, Object.defineProperty(wp.prototype, "ref", { 15365 get: function () { 15366 return this.getRef() 15367 }, 15368 enumerable: !1, 15369 configurable: !0 15370 }), wp); 15371 15372 function wp(t, e, n, r) { 15373 this.database = t, this.path = e, this.queryParams_ = n, this.orderByCalled_ = r, this.repo = t.repo_ 15374 } 15375 var _p = (Ip.prototype.toJSON = function () { 15376 return Ko("TransactionResult.toJSON", 0, 1, arguments.length), { 15377 committed: this.committed, 15378 snapshot: this.snapshot.toJSON() 15379 } 15380 }, Ip); 15381 15382 function Ip(t, e) { 15383 this.committed = t, this.snapshot = e 15384 } 15385 var Tp, Ep, Sp = (Xi(Cp, Tp = bp), Cp.prototype.getKey = function () { 15386 return Ko("Reference.key", 0, 0, arguments.length), cu(this.path) ? null : ou(this.path) 15387 }, Cp.prototype.child = function (t) { 15388 var e, n, r, i; 15389 return Ko("Reference.child", 1, 1, arguments.length), "number" == typeof t ? t = String(t) : t instanceof Za || (null === nu(this.path) ? (e = "Reference.child", i = !(n = 1), r = (r = t) && r.replace(/^\/*\.info(\/|$)/, "/"), wf(e, n, r, i)) : wf("Reference.child", 1, t, !1)), new Cp(this.database, uu(this.path, t)) 15390 }, Cp.prototype.getParent = function () { 15391 Ko("Reference.parent", 0, 0, arguments.length); 15392 var t = au(this.path); 15393 return null === t ? null : new Cp(this.database, t) 15394 }, Cp.prototype.getRoot = function () { 15395 Ko("Reference.root", 0, 0, arguments.length); 15396 for (var t = this; null !== t.getParent();) t = t.getParent(); 15397 return t 15398 }, Cp.prototype.set = function (t, e) { 15399 Ko("Reference.set", 1, 2, arguments.length), _f("Reference.set", this.path), vf("Reference.set", 1, t, this.path, !1), Ho("Reference.set", 2, e, !0); 15400 var n = new lo; 15401 return Kf(this.repo, this.path, t, null, n.wrapCallback(e)), n.promise 15402 }, Cp.prototype.update = function (t, e) { 15403 if (Ko("Reference.update", 1, 2, arguments.length), _f("Reference.update", this.path), Array.isArray(t)) { 15404 for (var n = {}, r = 0; r < t.length; ++r) n["" + r] = t[r];
15405 t = n, Zs("Passing an Array to Firebase.update() is deprecated. Use set() if you want to overwrite the existing data, or an Object with integer keys if you really do want to only update some of the children.") 15406 } 15407 gf("Reference.update", 1, t, this.path, !1), Ho("Reference.update", 2, e, !0); 15408 var i = new lo; 15409 return function (i, o, t, s) { 15410 Qf(i, "update", { 15411 path: o.toString(), 15412 value: t 15413 }); 15414 var a, e, n = !0, 15415 r = Uf(i), 15416 u = {}; 15417 ia(t, function (t, e) { 15418 n = !1, u[t] = tf(uu(o, t), pc(e), i.serverSyncTree_, r) 15419 }), n ? (Xs("update() called with empty data. Don't do anything."), Yf(0, s, "ok", void 0)) : (a = Bf(i), e = kl(i.serverSyncTree_, o, u, a), Af(i.eventQueue_, e), i.server_.merge(o.toString(), t, function (t, e) { 15420 var n = "ok" === t; 15421 n || Zs("update at " + o + " failed: " + t); 15422 var r = Rl(i.serverSyncTree_, a, !n), 15423 n = 0 < r.length ? $f(i, o) : o; 15424 Rf(i.eventQueue_, n, r), Yf(0, s, t, e) 15425 }), ia(t, function (t) { 15426 t = np(i, uu(o, t)); 15427 $f(i, t) 15428 }), Rf(i.eventQueue_, o, [])) 15429 }(this.repo, this.path, t, i.wrapCallback(e)), i.promise 15430 }, Cp.prototype.setWithPriority = function (t, e, n) { 15431 if (Ko("Reference.setWithPriority", 2, 3, arguments.length), _f("Reference.setWithPriority", this.path), vf("Reference.setWithPriority", 1, t, this.path, !1), yf("Reference.setWithPriority", 2, e, !1), Ho("Reference.setWithPriority", 3, n, !0), ".length" === this.getKey() || ".keys" === this.getKey()) throw "Reference.setWithPriority failed: " + this.getKey() + " is a read-only object."; 15432 var r = new lo; 15433 return Kf(this.repo, this.path, t, e, r.wrapCallback(n)), r.promise 15434 }, Cp.prototype.remove = function (t) { 15435 return Ko("Reference.remove", 0, 1, arguments.length), _f("Reference.remove", this.path), Ho("Reference.remove", 1, t, !0), this.set(null, t) 15436 }, Cp.prototype.transaction = function (t, r, e) { 15437 var i = this; 15438 if (Ko("Reference.transaction", 1, 3, arguments.length), _f("Reference.transaction", this.path), Ho("Reference.transaction", 1, t, !1), Ho("Reference.transaction", 2, r, !0), function (t, e, n, r) { 15439 if ((!r || void 0 !== n) && "boolean" != typeof n) throw new Error(Wo(t, e, r) + "must be a boolean.") 15440 }("Reference.transaction", 3, e, !0), ".length" === this.getKey() || ".keys" === this.getKey()) throw "Reference.transaction failed: " + this.getKey() + " is a read-only object."; 15441 void 0 === e && (e = !0); 15442 var o = new lo; 15443 "function" == typeof r && o.promise.catch(function () {}); 15444 15445 function n() {} 15446 var s = new Cp(this.database, this.path); 15447 s.on("value", n); 15448 return function (t, e, n, r, i, o) { 15449 Qf(t, "transaction on " + e); 15450 var s = { 15451 path: e, 15452 update: n, 15453 onComplete: r, 15454 status: null, 15455 order: Gs(), 15456 applyLocally: o, 15457 retryCount: 0, 15458 unwatcher: i, 15459 abortReason: null, 15460 currentWriteId: null, 15461 currentInputSnapshot: null, 15462 currentOutputSnapshotRaw: null, 15463 currentOutputSnapshotResolved: null 15464 }, 15465 n = Xf(t, e, void 0); 15466 s.currentInputSnapshot = n, void 0 === (r = s.update(n.val())) ? (s.unwatcher(), s.currentOutputSnapshotRaw = null, s.currentOutputSnapshotResolved = null, s.onComplete && s.onComplete(null, !1, s.currentInputSnapshot)) : (Sf("transaction failed: Data returned ", r, s.path), s.status = 0, (i = sf(o = of (t.transactionQueueTree_, e)) || []).push(s), af(o, i), o = void 0, "object" == typeof r && null !== r && Oo(r, ".priority") ? (o = Do(r, ".priority"), so(df(o), "Invalid priority returned by transaction. Priority must be a valid string, finite number, server value, or null.")) : o = (xl(t.serverSyncTree_, e) || uc.EMPTY_NODE).getPriority().val(), i = Uf(t), o = pc(r, o), i = ef(o, n, i), s.currentOutputSnapshotRaw = o, s.currentOutputSnapshotResolved = i, s.currentWriteId = Bf(t), s = Al(t.serverSyncTree_, e, i, s.currentWriteId, s.applyLocally), Rf(t.eventQueue_, e, s), Jf(t, t.transactionQueueTree_)) 15467 }(this.repo, this.path, t, function (t, e, n) { 15468 t ? (o.reject(t), "function" == typeof r && r(t, e, null)) : (n = new sp(n, new Cp(i.database, i.path), Ju), o.resolve(new _p(e, n)), "function" == typeof r && r(null, e, n)) 15469 }, function () { 15470 s.off("value", n) 15471 }, e), o.promise 15472 }, Cp.prototype.setPriority = function (t, e) { 15473 Ko("Reference.setPriority", 1, 2, arguments.length), _f("Reference.setPriority", this.path), yf("Reference.setPriority", 1, t, !1), Ho("Reference.setPriority", 2, e, !0); 15474 var n = new lo; 15475 return Kf(this.repo, uu(this.path, ".priority"), t, null, n.wrapCallback(e)), n.promise 15476 }, Cp.prototype.push = function (t, e) { 15477 Ko("Reference.push", 0, 2, arguments.length), _f("Reference.push", this.path), vf("Reference.push", 1, t, this.path, !0), Ho("Reference.push", 2, e, !0); 15478 var n = Ff(this.repo), 15479 r = Sc(n), 15480 n = this.child(r), 15481 i = this.child(r), 15482 t = null != t ? n.set(t, e).then(function () { 15483 return i 15484 }) : Promise.resolve(i); 15485 return n.then = t.then.bind(t), n.catch = t.then.bind(t, void 0), "function" == typeof e && t.catch(function () {}), n 15486 }, Cp.prototype.onDisconnect = function () { 15487 return _f("Reference.onDisconnect", this.path), new up(this.repo, this.path) 15488 }, Object.defineProperty(Cp.prototype, "key", { 15489 get: function () { 15490 return this.getKey() 15491 }, 15492 enumerable: !1, 15493 configurable: !0 15494 }), Object.defineProperty(Cp.prototype, "parent", { 15495 get: function () { 15496 return this.getParent() 15497 }, 15498 enumerable: !1, 15499 configurable: !0 15500 }), Object.defineProperty(Cp.prototype, "root", { 15501 get: function () { 15502 return this.getRoot() 15503 }, 15504 enumerable: !1, 15505 configurable: !0 15506 }), Cp); 15507 15508 function Cp(t, e) { 15509 return Tp.call(this, t, e, new Mc, !1) || this 15510 } 15511 bp.__referenceConstructor = Sp, Ep = Sp, so(!ul, "__referenceConstructor has already been defined"), ul = Ep; 15512 var Np = "FIREBASE_DATABASE_EMULATOR_HOST", 15513 Ap = {}, 15514 kp = !1; 15515 15516 function Rp(t, e, n, r) { 15517 var i = n || t.options.databaseURL; 15518 void 0 === i && (t.options.projectId || $s("Can't determine Firebase Database URL. Be sure to include a Project ID when calling firebase.initializeApp()."), Xs("Using default host for project ", t.options.projectId), i = t.options.projectId + "-default-rtdb.firebaseio.com"); 15519 var o, s = ip(i, r), 15520 a = s.repoInfo, 15521 n = void 0; 15522 (n = "undefined" != typeof process ? process.env[Np] : n) ? (o = !0, i = "http://" + n + "?ns=" + a.namespace, a = (s = ip(i, r)).repoInfo) : o = !s.repoInfo.secure; 15523 e = r && o ? new va : new pa(t, e); 15524 Cf("Invalid Firebase Database URL", 1, s), cu(s.path) || $s("Database URL must point to the root of a Firebase Database (not including a child path)."); 15525 e = function (t, e, n) { 15526 var r = Do(Ap, e.name); 15527 r || (r = {}, Ap[e.name] = r); 15528 var i = Do(r, t.toURLString()); 15529 i && $s("Database initialized multiple times. Please make sure the format of the database URL matches with each database() call."); 15530 return i = new xf(t, kp, e, n), r[t.toURLString()] = i 15531 }(a, t, e); 15532 return new Pp(e) 15533 } 15534 var Pp = (Object.defineProperty(Op.prototype, "repo_", { 15535 get: function () { 15536 return this.instanceStarted_ || (Mf(this.repoInternal_), this.instanceStarted_ = !0), this.repoInternal_ 15537 }, 15538 enumerable: !1, 15539 configurable: !0 15540 }), Object.defineProperty(Op.prototype, "root_", { 15541 get: function () { 15542 return this.rootInternal_ || (this.rootInternal_ = new Sp(this, eu())), this.rootInternal_ 15543 }, 15544 enumerable: !1, 15545 configurable: !0 15546 }), Object.defineProperty(Op.prototype, "app", { 15547 get: function () { 15548 return this.repo_.app 15549 }, 15550 enumerable: !1, 15551 configurable: !0 15552 }), Op.prototype.useEmulator = function (t, e) { 15553 var n; 15554 this.checkDeleted_("useEmulator"), this.instanceStarted_ ? $s("Cannot call useEmulator() after instance has already been initialized.") : (n = this.repoInternal_, t = t, e = e, n.repoInfo_ = new wa(t + ":" + e, !1, n.repoInfo_.namespace, n.repoInfo_.webSocketOnly, n.repoInfo_.nodeAdmin, n.repoInfo_.persistenceKey, n.repoInfo_.includeNamespaceInQueryParams), n.repoInfo_.nodeAdmin && (n.authTokenProvider_ = new va)) 15555 }, Op.prototype.ref = function (t) { 15556 return this.checkDeleted_("ref"), Ko("database.ref", 0, 1, arguments.length), t instanceof Sp ? this.refFromURL(t.toString()) : void 0 !== t ? this.root_.child(t) : this.root_ 15557 }, Op.prototype.refFromURL = function (t) { 15558 var e = "database.refFromURL"; 15559 this.checkDeleted_(e), Ko(e, 1, 1, arguments.length); 15560 var n = ip(t, this.repo_.repoInfo_.nodeAdmin); 15561 Cf(e, 1, n); 15562 t = n.repoInfo; 15563 return this.repo_.repoInfo_.isCustomHost() || t.host === this.repo_.repoInfo_.host || $s(e + ": Host name does not match the current database: (found " + t.host + " but expected " + this.repo_.repoInfo_.host + ")"), this.ref(n.path.toString()) 15564 }, Op.prototype.checkDeleted_ = function (t) { 15565 null === this.repoInternal_ && $s("Cannot call " + t + " on a deleted database.") 15566 }, Op.prototype.goOffline = function () { 15567 Ko("database.goOffline", 0, 0, arguments.length), this.checkDeleted_("goOffline"), zf(this.repo_) 15568 }, Op.prototype.goOnline = function () { 15569 var t; 15570 Ko("database.goOnline", 0, 0, arguments.length), this.checkDeleted_("goOnline"), (t = this.repo_).persistentConnection_ && t.persistentConnection_.resume(Of) 15571 }, Op.ServerValue = { 15572 TIMESTAMP: { 15573 ".sv": "timestamp" 15574 }, 15575 increment: function (t) { 15576 return { 15577 ".sv": { 15578 increment: t 15579 } 15580 } 15581 } 15582 }, Op); 15583 15584 function Op(t) { 15585 var e = this; 15586 this.repoInternal_ = t, this.instanceStarted_ = !1, this.INTERNAL = { 15587 delete: function () { 15588 return $i(e, void 0, void 0, function () { 15589 return Zi(this, function (t) { 15590 var e, n; 15591 return this.checkDeleted_("delete"), e = this.repo_, (n = Do(Ap, e.app.name)) && Do(n, e.key) === e || $s("Database " + e.app.name + "(" + e.repoInfo_ + ") has already been deleted."), zf(e), delete n[e.key], this.repoInternal_ = null, this.rootInternal_ = null, [2] 15592 }) 15593 }) 15594 } 15595 }, t instanceof xf || $s("Don't call new Database() directly - please use firebase.database().") 15596 } 15597 var Dp = Object.freeze({ 15598 __proto__: null, 15599 forceLongPolling: function () { 15600 ja.forceDisallow(), Oa.forceAllow() 15601 }, 15602 forceWebSockets: function () { 15603 Oa.forceDisallow() 15604 }, 15605 isWebSocketsAvailable: function () { 15606 return ja.isAvailable() 15607 }, 15608 setSecurityDebugCallback: function (t, e) { 15609 t.repo.persistentConnection_.securityDebugCallback_ = e 15610 }, 15611 stats: function (t, e) { 15612 var i; 15613 t = t.repo, void 0 === (e = e) && (e = !1), "undefined" != typeof console && (t = e ? (t.statsListener_ || (t.statsListener_ = new Xc(t.stats_)), t.statsListener_.get()) : t.stats_.get(), i = Object.keys(t).reduce(function (t, e) { 15614 return Math.max(e.length, t) 15615 }, 0), ia(t, function (t, e) { 15616 for (var n = t, r = t.length; r < i + 2; r++) n += " "; 15617 console.log(n + e) 15618 })) 15619 }, 15620 statsIncrementCounter: function (t, e) { 15621 t = t.repo, e = e, t.stats_.incrementCounter(e), t = t.statsReporter_, e = e, t.statsToReport_[e] = !0 15622 }, 15623 dataUpdateCount: function (t) { 15624 return t.repo.dataUpdateCount 15625 }, 15626 interceptServerData: function (t, e) { 15627 t = t.repo, e = e, t.interceptServerDataCallback_ = e 15628 }, 15629 initStandalone: function (t) { 15630 var e = t.app, 15631 n = t.url, 15632 r = t.version, 15633 i = t.customAuthImpl, 15634 o = t.namespace, 15635 t = void 0 !== (t = t.nodeAdmin) && t; 15636 return Fa(r), (r = new rs("auth-internal", new os("database-standalone"))).setComponent(new ts("auth-internal", function () { 15637 return i 15638 }, "PRIVATE")), { 15639 instance: Rp(e, r, n, t), 15640 namespace: o 15641 } 15642 } 15643 }), 15644 Sn = Tu; 15645 Tu.prototype.simpleListen = function (t, e) { 15646 this.sendRequest("q", { 15647 p: t 15648 }, e) 15649 }, Tu.prototype.echo = function (t, e) { 15650 this.sendRequest("echo", { 15651 d: t 15652 }, e) 15653 }; 15654 var xp, Lp = Object.freeze({ 15655 __proto__: null, 15656 DataConnection: Sn, 15657 RealTimeConnection: Ka, 15658 hijackHash: function (i) { 15659 var o = Tu.prototype.put; 15660 return Tu.prototype.put = function (t, e, n, r) { 15661 void 0 !== r && (r = i()), o.call(this, t, e, n, r) 15662 }, 15663 function () { 15664 Tu.prototype.put = o 15665 } 15666 }, 15667 ConnectionTarget: wa, 15668 queryIdentifier: function (t) { 15669 return t.queryIdentifier() 15670 }, 15671 forceRestClient: function (t) { 15672 kp = t 15673 } 15674 }), 15675 Mp = Pp.ServerValue; 15676 Fa((xp = Xl).SDK_VERSION), xp.INTERNAL.registerComponent(new ts("database", function (t, e) { 15677 e = e.instanceIdentifier; 15678 return Rp(t.getProvider("app").getImmediate(), t.getProvider("auth-internal"), e, void 0) 15679 }, "PUBLIC").setServiceProps({ 15680 Reference: Sp, 15681 Query: bp, 15682 Database: Pp, 15683 DataSnapshot: sp, 15684 enableLogging: Ms, 15685 INTERNAL: Dp, 15686 ServerValue: Mp, 15687 TEST_ACCESS: Lp 15688 }).setMultipleInstances(!0)), xp.registerVersion("@firebase/database", "0.9.7"); 15689 var Fp = function (t, e) { 15690 return (Fp = Object.setPrototypeOf || { 15691 __proto__: [] 15692 } 15693 instanceof Array && function (t, e) { 15694 t.__proto__ = e 15695 } || function (t, e) { 15696 for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]) 15697 })(t, e) 15698 }; 15699 15700 function Up(t) { 15701 var e = "function" == typeof Symbol && Symbol.iterator, 15702 n = e && t[e], 15703 r = 0; 15704 if (n) return n.call(t); 15705 if (t && "number" == typeof t.length) return { 15706 next: function () { 15707 return { 15708 value: (t = t && r >= t.length ? void 0 : t) && t[r++], 15709 done: !t 15710 } 15711 } 15712 }; 15713 throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.") 15714 } 15715 var G = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : {}, 15716 jp = {}, 15717 qp = G || self; 15718 15719 function Vp() {} 15720 15721 function Bp(t) { 15722 var e = typeof t; 15723 return "array" == (e = "object" != e ? e : t ? Array.isArray(t) ? "array" : e : "null") || "object" == e && "number" == typeof t.length 15724 } 15725 15726 function Kp(t)
15726 { 15727 var e = typeof t; 15728 return "object" == e && null != t || "function" == e 15729 } 15730 var Wp = "closure_uid_" + (1e9 * Math.random() >>> 0), 15731 Hp = 0; 15732 15733 function Gp(t, e, n) { 15734 return t.call.apply(t.bind, arguments) 15735 } 15736 15737 function zp(e, n, t) { 15738 if (!e) throw Error(); 15739 if (2 < arguments.length) { 15740 var r = Array.prototype.slice.call(arguments, 2); 15741 return function () { 15742 var t = Array.prototype.slice.call(arguments); 15743 return Array.prototype.unshift.apply(t, r), e.apply(n, t) 15744 } 15745 } 15746 return function () { 15747 return e.apply(n, arguments) 15748 } 15749 } 15750 15751 function Qp(t, e, n) { 15752 return (Qp = Function.prototype.bind && -1 != Function.prototype.bind.toString().indexOf("native code") ? Gp : zp).apply(null, arguments) 15753 } 15754 15755 function Yp(e) { 15756 var n = Array.prototype.slice.call(arguments, 1); 15757 return function () { 15758 var t = n.slice(); 15759 return t.push.apply(t, arguments), e.apply(this, t) 15760 } 15761 } 15762 15763 function Xp() { 15764 return Date.now() 15765 } 15766 15767 function Jp(t, o) { 15768 function e() {} 15769 e.prototype = o.prototype, t.X = o.prototype, t.prototype = new e, (t.prototype.constructor = t).Kb = function (t, e, n) { 15770 for (var r = Array(arguments.length - 2), i = 2; i < arguments.length; i++) r[i - 2] = arguments[i]; 15771 return o.prototype[e].apply(t, r) 15772 } 15773 } 15774 15775 function $p() { 15776 this.j = this.j, this.i = this.i 15777 } 15778 $p.prototype.j = !1, $p.prototype.ja = function () { 15779 var t; 15780 !this.j && (this.j = !0, this.G(), 0) && (t = this, Object.prototype.hasOwnProperty.call(t, Wp) && t[Wp] || (t[Wp] = ++Hp)) 15781 }, $p.prototype.G = function () { 15782 if (this.i) 15783 for (; this.i.length;) this.i.shift()() 15784 }; 15785 var Zp = Array.prototype.indexOf ? function (t, e) { 15786 return Array.prototype.indexOf.call(t, e, void 0) 15787 } : function (t, e) { 15788 if ("string" == typeof t) return "string" != typeof e || 1 != e.length ? -1 : t.indexOf(e, 0); 15789 for (var n = 0; n < t.length; n++) 15790 if (n in t && t[n] === e) return n; 15791 return -1 15792 }, 15793 td = Array.prototype.forEach ? function (t, e, n) { 15794 Array.prototype.forEach.call(t, e, n) 15795 } : function (t, e, n) { 15796 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) 15797 }; 15798 15799 function ed() { 15800 return Array.prototype.concat.apply([], arguments) 15801 } 15802
15803 function nd(t) { 15804 var e = t.length; 15805 if (0 < e) { 15806 for (var n = Array(e), r = 0; r < e; r++) n[r] = t[r]; 15807 return n 15808 } 15809 return [] 15810 } 15811 15812 function rd(t) { 15813 return /^[\s\xa0]*$/.test(t) 15814 } 15815 var id, od = String.prototype.trim ? function (t) { 15816 return t.trim() 15817 } : function (t) { 15818 return /^[\s\xa0]*([\s\S]*?)[\s\xa0]*$/.exec(t)[1] 15819 }; 15820 15821 function sd(t, e) { 15822 return -1 != t.indexOf(e) 15823 } 15824 15825 function ad(t, e) { 15826 return t < e ? -1 : e < t ? 1 : 0 15827 } 15828 t: { 15829 var ud = qp.navigator; 15830 if (ud) { 15831 ud = ud.userAgent; 15832 if (ud) { 15833 id = ud; 15834 break t 15835 } 15836 } 15837 id = "" 15838 } 15839 15840 function cd(t, e, n) { 15841 for (var r in t) e.call(n, t[r], r, t) 15842 } 15843 15844 function hd(t) { 15845 var e, n = {}; 15846 for (e in t) n[e] = t[e]; 15847 return n 15848 } 15849 var ld = "constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "); 15850 15851 function fd(t) { 15852 for (var e, n, r = 1; r < arguments.length; r++) { 15853 for (e in n = arguments[r]) t[e] = n[e]; 15854 for (var i = 0; i < ld.length; i++) e = ld[i], Object.prototype.hasOwnProperty.call(n, e) && (t[e] = n[e]) 15855 } 15856 } 15857 15858 function pd(t) { 15859 return pd[" "](t), t 15860 } 15861 pd[" "] = Vp; 15862 var dd, vd = sd(id, "Opera"), 15863 gd = sd(id, "Trident") || sd(id, "MSIE"), 15864 yd = sd(id, "Edge"), 15865 md = yd || gd, 15866 bd = sd(id, "Gecko") && !(sd(id.toLowerCase(), "webkit") && !sd(id, "Edge")) && !(sd(id, "Trident") || sd(id, "MSIE")) && !sd(id, "Edge"), 15867 wd = sd(id.toLowerCase(), "webkit") && !sd(id, "Edge"); 15868 15869 function _d() { 15870 var t = qp.document; 15871 return t ? t.documentMode : void 0 15872 } 15873 t: { 15874 var Id = "", 15875 Td = (Td = id, bd ? /rv:([^\);]+)(\)|;)/.exec(Td) : yd ? /Edge\/([\d\.]+)/.exec(Td) : gd ? /\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(Td) : wd ? /WebKit\/(\S+)/.exec(Td) : vd ? /(?:Version)[ \/]?(\S+)/.exec(Td) : void 0); 15876 if (Td && (Id = Td ? Td[1] : ""), gd) { 15877 Td = _d(); 15878 if (null != Td && Td > parseFloat(Id)) { 15879 dd = String(Td); 15880 break t 15881 } 15882 } 15883 dd = Id 15884 } 15885 var Ed = {}; 15886 15887 function Sd(a) { 15888 return t = a, e = function () { 15889 for (var t = 0, e = od(String(dd)).split("."), n = od(String(a)).split("."), r = Math.max(e.length, n.length), i = 0; 0 == t && i < r; i++) 15890 for (var o = e[i] || "", s = n[i] || ""; o = /(\d*)(\D*)(.*)/.exec(o) || ["", "", "", ""], s = /(\d*)(\D*)(.*)/.exec(s) || ["", "", "", ""], (0 != o[0].length || 0 != s[0].length) && (t = ad(0 == o[1].length ? 0 : parseInt(o[1], 10), 0 == s[1].length ? 0 : parseInt(s[1], 10)) || ad(0 == o[2].length, 0 == s[2].length) || ad(o[2], s[2]), o = o[3], s = s[3], 0 == t);); 15891 return 0 <= t 15892 }, n = Ed, Object.prototype.hasOwnProperty.call(n, t) ? n[t] : n[t] = e(t); 15893 var t, e, n 15894 } 15895 var Cd = qp.document && gd && (_d() || parseInt(dd, 10)) || void 0, 15896 Nd = !gd || 9 <= Number(Cd), 15897 Ad = gd && !Sd("9"), 15898 kd = function () { 15899 if (!qp.addEventListener || !Object.defineProperty) return !1; 15900 var t = !1, 15901 e = Object.defineProperty({}, "passive", { 15902 get: function () { 15903 t = !0 15904 } 15905 }); 15906 try { 15907 qp.addEventListener("test", Vp, e), qp.removeEventListener("test", Vp, e) 15908 } catch (t) {} 15909 return t 15910 }(); 15911 15912 function Rd(t, e) { 15913 this.type = t, this.a = this.target = e, this.defaultPrevented = !1 15914 } 15915 15916 function Pd(t, e) { 15917 if (Rd.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) { 15918 var n = this.type = t.type, 15919 r = t.changedTouches && t.changedTouches.length ? t.changedTouches[0] : null; 15920 if (this.target = t.target || t.srcElement, this.a = e, e = t.relatedTarget) { 15921 if (bd) { 15922 t: { 15923 try {
15924 pd(e.nodeName); 15925 var i = !0; 15926 break t 15927 } catch (t) {} 15928 i = !1 15929 } 15930 i || (e = null) 15931 } 15932 } else "mouseover" == n ? e = t.fromElement : "mouseout" == n && (e = t.toElement); 15933 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 : Od[t.pointerType] || "", (this.c = t).defaultPrevented && this.b() 15934 } 15935 } 15936 Rd.prototype.b = function () { 15937 this.defaultPrevented = !0 15938 }, Jp(Pd, Rd); 15939 var Od = { 15940 2: "touch", 15941 3: "pen", 15942 4: "mouse" 15943 }; 15944 Pd.prototype.b = function () { 15945 Pd.X.b.call(this); 15946 var t = this.c; 15947 if (t.preventDefault) t.preventDefault(); 15948 else if (t.returnValue = !1, Ad) try { 15949 (t.ctrlKey || 112 <= t.keyCode && t.keyCode <= 123) && (t.keyCode = -1) 15950 } catch (t) {} 15951 }; 15952 var Dd = "closure_listenable_" + (1e6 * Math.random() | 0), 15953 xd = 0; 15954 15955 function Ld(t, e, n, r, i) { 15956 this.listener = t, this.proxy = null, this.src = e, this.type = n, this.capture = !!r, this.ca = i, this.key = ++xd, this.Y = this.Z = !1 15957 } 15958 15959 function Md(t) { 15960 t.Y = !0, t.listener = null, t.proxy = null, t.src = null, t.ca = null 15961 } 15962 15963 function Fd(t) { 15964 this.src = t, this.a = {}, this.b = 0 15965 } 15966 15967 function Ud(t, e) { 15968 var n, r, i, o = e.type; 15969 o in t.a && (n = t.a[o], (i = 0 <= (r = Zp(n, e))) && Array.prototype.splice.call(n, r, 1), i && (Md(e), 0 == t.a[o].length && (delete t.a[o], t.b--))) 15970 } 15971 15972 function jd(t, e, n, r) { 15973 for (var i = 0; i < t.length; ++i) { 15974 var o = t[i]; 15975 if (!o.Y && o.listener == e && o.capture == !!n && o.ca == r) return i 15976 } 15977 return -1 15978 } 15979 Fd.prototype.add = function (t, e, n, r, i) { 15980 var o = t.toString(); 15981 (t = this.a[o]) || (t = this.a[o] = [], this.b++); 15982 var s = jd(t, e, r, i); 15983 return -1 < s ? (e = t[s], n || (e.Z = !1)) : ((e = new Ld(e, this.src, o, !!r, i)).Z = n, t.push(e)), e 15984 }; 15985 var qd = "closure_lm_" + (1e6 * Math.random() | 0), 15986 Vd = {}; 15987 15988 function Bd(t, e, n, r, i) { 15989 if (r && r.once) return function t(e, n, r, i, o) { 15990 if (Array.isArray(n)) { 15991 for (var s = 0; s < n.length; s++) t(e, n[s], r, i, o); 15992 return null 15993 } 15994 r = Xd(r); 15995 return e && e[Dd] ? e.wa(n, r, Kp(i) ? !!i.capture : !!i, o) : Kd(e, n, r, !0, i, o) 15996 }(t, e, n, r, i); 15997 if (Array.isArray(e)) { 15998 for (var o = 0; o < e.length; o++) Bd(t, e[o], n, r, i); 15999 return null 16000 } 16001 return n = Xd(n), t && t[Dd] ? t.va(e, n, Kp(r) ? !!r.capture : !!r, i) : Kd(t, e, n, !1, r, i) 16002 } 16003 16004 function Kd(t, e, n, r, i, o) { 16005 if (!e) throw Error("Invalid event type"); 16006 var s = Kp(i) ? !!i.capture : !!i; 16007 if (s && !Nd) return null; 16008 var a, u, c = Qd(t); 16009 if (c || (t[qd] = c = new Fd(t)), (n = c.add(e, n, r, s, o)).proxy) return n; 16010 if (a = zd, r = u = Nd ? function (t) { 16011 return a.call(u.src, u.listener, t) 16012 } : function (t) { 16013 if (!(t = a.call(u.src, u.listener, t))) return t 16014 }, (n.proxy = r).src = t, r.listener = n, t.addEventListener) void 0 === (i = !kd ? s : i) && (i = !1), t.addEventListener(e.toString(), r, i); 16015 else if (t.attachEvent) t.attachEvent(Hd(e.toString()), r); 16016 else { 16017 if (!t.addListener || !t.removeListener) throw Error("addEventListener and attachEvent are unavailable."); 16018 t.addListener(r) 16019 } 16020 return n 16021 } 16022 16023 function Wd(t) { 16024 var e, n, r; 16025 "number" != typeof t && t && !t.Y && ((e = t.src) && e[Dd] ? Ud(e.c, t) : (n = t.type, r = t.proxy, e.removeEventListener ? e.removeEventListener(n, r, t.capture) : e.detachEvent ? e.detachEvent(Hd(n), r) : e.addListener && e.removeListener && e.removeListener(r), (n = Qd(e)) ? (Ud(n, t), 0 == n.b && (n.src = null, e[qd] = null)) : Md(t))) 16026 } 16027 16028 function Hd(t) { 16029 return t in Vd ? Vd[t] : Vd[t] = "on" + t 16030 } 16031 16032 function Gd(t, e) { 16033 var n = t.listener, 16034 r = t.ca || t.src; 16035 return t.Z && Wd(t), n.call(r, e) 16036 } 16037 16038 function zd(t, e) { 16039 if (t.Y) return !0; 16040 if (Nd) return Gd(t, new Pd(e, this)); 16041 if (!e) t: { 16042 e = ["window", "event"]; 16043 for (var n = qp, r = 0; r < e.length; r++) 16044 if (null == (n = n[e[r]])) { 16045 e = null; 16046 break t 16047 } e = n 16048 } 16049 return Gd(t, e = new Pd(e, this)) 16050 } 16051 16052 function Qd(t) { 16053 return (t = t[qd]) instanceof Fd ? t : null 16054 } 16055 var Yd = "__closure_events_fn_" + (1e9 * Math.random() >>> 0); 16056 16057 function Xd(e) { 16058 return "function" == typeof e ? e : (e[Yd] || (e[Yd] = function (t) { 16059 return e.handleEvent(t) 16060 }), e[Yd]) 16061 } 16062 16063 function Jd() { 16064 $p.call(this), this.c = new Fd(this), (this.J = this).C = null 16065 } 16066 16067 function $d(t, e) { 16068 var n, r = t.C; 16069 if (r) 16070 for (n = []; r; r = r.C) n.push(r); 16071 if (t = t.J, r = e.type || e, "string" == typeof e ? e = new Rd(e, t) : e instanceof Rd ? e.target = e.target || t : (s = e, fd(e = new Rd(r, t), s)), s = !0, n) 16072 for (var i = n.length - 1; 0 <= i; i--) var o = e.a = n[i], 16073 s = Zd(o, r, !0, e) && s; 16074 if (s = Zd(o = e.a = t, r, !0, e) && s, s = Zd(o, r, !1, e) && s, n) 16075 for (i = 0; i < n.length; i++) s = Zd(o = e.a = n[i], r, !1, e) && s 16076 } 16077 16078 function Zd(t, e, n, r) { 16079 if (!(e = t.c.a[String(e)])) return !0; 16080 e = e.concat(); 16081 for (var i = !0, o = 0; o < e.length; ++o) { 16082 var s, a, u = e[o]; 16083 u && !u.Y && u.capture == n && (s = u.listener, a = u.ca || u.src, u.Z && Ud(t.c, u), i = !1 !== s.call(a, r) && i) 16084 } 16085 return i && !r.defaultPrevented 16086 } 16087 Jp(Jd, $p), Jd.prototype[Dd] = !0, (z = Jd.prototype).addEventListener = function (t, e, n, r) { 16088 Bd(this, t, e, n, r) 16089 }, z.removeEventListener = function (t, e, n, r) { 16090 ! function t(e, n, r, i, o) { 16091 if (Array.isArray(n)) 16092 for (var s = 0; s < n.length; s++) t(e, n[s], r, i, o); 16093 else i = Kp(i) ? !!i.capture : !!i, r = Xd(r), e && e[Dd] ? (e = e.c, (n = String(n).toString()) in e.a && -1 < (r = jd(s = e.a[n], r, i, o)) && (Md(s[r]), Array.prototype.splice.call(s, r, 1), 0 == s.length && (delete e.a[n], e.b--))) : (e = e && Qd(e)) && (n = e.a[n.toString()], (r = (e = -1) < (e = n ? jd(n, r, i, o) : e) ? n[e] : null) && Wd(r)) 16094 }(this, t, e, n, r) 16095 }, z.G = function () { 16096 if (Jd.X.G.call(this), this.c) { 16097 var t, e = this.c; 16098 for (t in e.a) { 16099 for (var n = e.a[t], r = 0; r < n.length; r++) Md(n[r]); 16100 delete e.a[t], e.b-- 16101 } 16102 } 16103 this.C = null 16104 }, z.va = function (t, e, n, r) { 16105 return this.c.add(String(t), e, !1, n, r) 16106 }, z.wa = function (t, e, n, r) { 16107 return this.c.add(String(t), e, !0, n, r) 16108 }; 16109 var tv = qp.JSON.stringify; 16110 16111 function ev() { 16112 this.b = this.a = null 16113 } 16114 var nv, rv = (iv.prototype.get = function () { 16115 var t; 16116 return 0 < this.b ? (this.b--, t = this.a, this.a = t.next, t.next = null) : t = this.c(), t 16117 }, new iv(function () { 16118 return new ov 16119 }, function (t) { 16120 t.reset() 16121 })); 16122 16123 function iv(t, e) { 16124 this.c = t, this.f = e, this.b = 0, this.a = null 16125 } 16126 16127 function ov() { 16128 this.next = this.b = this.a = null 16129 } 16130 16131 function sv(t, e) { 16132 var n; 16133 nv || (n = qp.Promise.resolve(void 0), nv = function () { 16134 n.then(cv) 16135 }), av || (nv(), av = !0), uv.add(t, e) 16136 } 16137 ev.prototype.add = function (t, e) { 16138 var n = rv.get(); 16139 n.set(t, e), this.b ? this.b.next = n : this.a = n, this.b = n 16140 }, ov.prototype.set = function (t, e) { 16141 this.a = t, this.b = e, this.next = null 16142 }; 16143 var av = !(ov.prototype.reset = function () { 16144 this.next = this.b = this.a = null 16145 }), 16146 uv = new ev; 16147 16148 function cv() { 16149 for (var t, e; n = e = void 0, n = null, (e = uv).a && (n = e.a, e.a = e.a.next, e.a || (e.b = null), n.next = null), t = n;) { 16150 try { 16151 t.a.call(t.b) 16152 } catch (t) { 16153 ! function (t) { 16154 qp.setTimeout(function () { 16155 throw t 16156 }, 0) 16157 }(t) 16158 } 16159 var n = rv; 16160 n.f(t), n.b < 100 && (n.b++, t.next = n.a, n.a = t) 16161 } 16162 av = !1 16163 } 16164 16165 function hv(t, e) { 16166 Jd.call(this), this.b = t || 1, this.a = e || qp, this.f = Qp(this.Za, this), this.g = Xp() 16167 } 16168 16169 function lv(t) { 16170 t.aa = !1, t.M && (t.a.clearTimeout(t.M), t.M = null) 16171 } 16172 16173 function fv(t, e, n) { 16174 if ("function" == typeof t) n && (t = Qp(t, n)); 16175 else { 16176 if (!t || "function" != typeof t.handleEvent) throw Error("Invalid listener argument"); 16177 t = Qp(t.handleEvent, t) 16178 } 16179 return 2147483647 < Number(e) ? -1 : qp.setTimeout(t, e || 0
16179) 16180 } 16181 Jp(hv, Jd), (z = hv.prototype).aa = !1, z.M = null, z.Za = function () { 16182 var t; 16183 this.aa && (0 < (t = Xp() - this.g) && t < .8 * this.b ? this.M = this.a.setTimeout(this.f, this.b - t) : (this.M && (this.a.clearTimeout(this.M), this.M = null), $d(this, "tick"), this.aa && (lv(this), this.start()))) 16184 }, z.start = function () { 16185 this.aa = !0, this.M || (this.M = this.a.setTimeout(this.f, this.b), this.g = Xp()) 16186 }, z.G = function () { 16187 hv.X.G.call(this), lv(this), delete this.a 16188 }; 16189 var pv, dv, vv, gv = (Fp(dv = mv, vv = pv = $p), dv.prototype = null === vv ? Object.create(vv) : (yv.prototype = vv.prototype, new yv), mv.prototype.f = function (t) { 16190 this.b = arguments, this.a ? this.c = !0 : function t(e) { 16191 e.a = fv(function () { 16192 e.a = null, e.c && (e.c = !1, t(e)) 16193 }, e.h); 16194 var n = e.b; 16195 e.b = null, e.g.apply(null, n) 16196 }(this) 16197 }, mv.prototype.G = function () { 16198 pv.prototype.G.call(this), this.a && (qp.clearTimeout(this.a), this.a = null, this.c = !1, this.b = null) 16199 }, mv); 16200 16201 function yv() { 16202 this.constructor = dv 16203 } 16204 16205 function mv(t, e) { 16206 var n = pv.call(this) || this; 16207 return n.g = t, n.h = e, n.b = null, n.c = !1, n.a = null, n 16208 } 16209 16210 function bv(t) { 16211 $p.call(this), this.b = t, this.a = {} 16212 } 16213 Jp(bv, $p); 16214 var wv = []; 16215 16216 function _v(t, e, n, r) { 16217 Array.isArray(n) || (n && (wv[0] = n.toString()), n = wv); 16218 for (var i = 0; i < n.length; i++) { 16219 var o = Bd(e, n[i], r || t.handleEvent, !1, t.b || t); 16220 if (!o) break; 16221 t.a[o.key] = o 16222 } 16223 } 16224 16225 function Iv(t) { 16226 cd(t.a, function (t, e) { 16227 this.a.hasOwnProperty(e) && Wd(t) 16228 }, t), t.a = {} 16229 } 16230 16231 function Tv() { 16232 this.a = !0 16233 } 16234 16235 function Ev(t, e, n, r) { 16236 t.info(function () { 16237 return "XMLHTTP TEXT (" + e + "): " + function (t, e) { 16238 if (!t.a) return e; 16239 if (!e) return null; 16240 try { 16241 var n = JSON.parse(e); 16242 if (n) 16243 for (t = 0; t < n.length; t++) 16244 if (Array.isArray(n[t])) { 16245 var r = n[t]; 16246 if (!(r.length < 2)) { 16247 var i = r[1]; 16248 if (Array.isArray(i) && !(i.length < 1)) { 16249 r = i[0]; 16250 if ("noop" != r && "stop" != r && "close" != r) 16251 for (var o = 1; o < i.length; o++) i[o] = "" 16252 } 16253 } 16254 } return tv(n) 16255 } catch (t) { 16256 return e 16257 } 16258 }(t, n) + (r ? " " + r : "") 16259 }) 16260 } 16261 bv.prototype.G = function () { 16262 bv.X.G.call(this), Iv(this) 16263 }, bv.prototype.handleEvent = function () { 16264 throw Error("EventHandler.handleEvent not implemented") 16265 }, Tv.prototype.info = function () {}; 16266 var Sv = {}, 16267 Cv = null; 16268 16269 function Nv() { 16270 return Cv = Cv || new Jd 16271 } 16272 16273 function Av(t) { 16274 Rd.call(this, Sv.Fa, t) 16275 } 16276 16277 function kv(t) { 16278 var e = Nv(); 16279 $d(e, new Av(e)) 16280 } 16281 16282 function Rv(t, e) { 16283 Rd.call(this, Sv.STAT_EVENT, t), this.stat = e 16284 } 16285 16286 function Pv(t) { 16287 var e = Nv(); 16288 $d(e, new Rv(e, t)) 16289 } 16290 16291 function Ov(t) { 16292 Rd.call(this, Sv.Ga, t) 16293 } 16294 16295 function Dv(t, e) { 16296 if ("function" != typeof t) throw Error("Fn must not be null and must be a function"); 16297 return qp.setTimeout(function () { 16298 t() 16299 }, e) 16300 } 16301 Sv.Fa = "serverreachability", Jp(Av, Rd), Sv.STAT_EVENT = "statevent", Jp(Rv, Rd), Sv.Ga = "timingevent", Jp(Ov, Rd); 16302 Ga = { 16303 NO_ERROR: 0, 16304 $a: 1, 16305 nb: 2, 16306 mb: 3, 16307 hb: 4, 16308 lb: 5, 16309 ob: 6, 16310 Da: 7, 16311 TIMEOUT: 8, 16312 rb: 9 16313 }, Sn = { 16314 fb: "complete", 16315 Bb: "success", 16316 Ea: "error", 16317 Da: "abort", 16318 tb: "ready", 16319 ub: "readystatechange", 16320 TIMEOUT: "timeout", 16321 pb: "incrementaldata", 16322 sb: "progress", 16323 ib: "downloadprogress", 16324 Jb: "uploadprogress" 16325 }; 16326 16327 function xv() {} 16328 16329 function Lv(t) { 16330 var e; 16331 return e = !(e = t.a) ? t.a = {} : e 16332 } 16333 16334 function Mv() {} 16335 xv.prototype.a = null; 16336 G = { 16337 OPEN: "a", 16338 eb: "b", 16339 Ea: "c", 16340 qb: "d" 16341 }; 16342 16343 function Fv() { 16344 Rd.call(this, "d") 16345 } 16346 16347 function Uv() { 16348 Rd.call(this, "c") 16349 } 16350 16351 function jv() {} 16352 16353 function qv(t, e, n, r) { 16354 this.g = t, this.c = e, this.f = n, this.S = r || 1, this.J = new bv(this), this.P = Bv, t = md ? 125 : void 0, this.R = new hv(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
16354= null, this.V = this.C = this.U = this.I = !1 16355 } 16356 Jp(Fv, Rd), Jp(Uv, Rd), Jp(jv, xv); 16357 var Vv = new jv, 16358 Bv = 45e3, 16359 Kv = {}, 16360 Wv = {}; 16361 16362 function Hv(t, e, n) { 16363 t.H = 1, t.i = fg(sg(e)), t.j = n, t.I = !0, Gv(t, null) 16364 } 16365 16366 function Gv(t, e) { 16367 t.u = Xp(), Qv(t), t.l = sg(t.i); 16368 var s, a, u, c, h, l, n = t.l, 16369 r = t.S; 16370 Array.isArray(r) || (r = [String(r)]), Sg(n.b, "t", r), t.D = 0, t.a = my(t.g, t.g.C ? e : null), 0 < t.O && (t.F = new gv(Qp(t.Ca, t, t.a), t.O)), _v(t.J, t.a, "readystatechange", t.Xa), e = t.B ? hd(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)), kv(1), s = t.c, a = t.m, u = t.l, c = t.f, h = t.S, l = t.j, s.info(function () { 16371 if (s.a) 16372 if (l) 16373 for (var t = "", e = l.split("&"), n = 0; n < e.length; n++) { 16374 var r, i, o = e[n].split("="); 16375 1 < o.length && (r = o[0], o = o[1], t = 2 <= (i = r.split("_")).length && "type" == i[1] ? t + (r + "=") + o + "&" : t + (r + "=redacted&")) 16376 } else t = null; 16377 else t = l; 16378 return "XMLHTTP REQ (" + c + ") [attempt " + h + "]: " + a + "\n" + u + "\n" + t 16379 }) 16380 } 16381 16382 function zv(t, e, n) { 16383 for (var r, i, o, s = !0; !t.A && t.D < n.length;) { 16384 var a = (a = n, o = i = void 0, i = (r = t).D, -1 == (o = a.indexOf("\n", i)) ? Wv : (i = Number(a.substring(i, o)), isNaN(i) ? Kv : (o += 1) + i > a.length ? Wv : (a = a.substr(o, i), r.D = o + i, a))); 16385 if (a == Wv) { 16386 4 == e && (t.h = 4, Pv(14), s = !1), Ev(t.c, t.f, null, "[Incomplete Response]"); 16387 break 16388 } 16389 if (a == Kv) { 16390 t.h = 4, Pv(15), Ev(t.c, t.f, n, "[Invalid Chunk]"), s = !1; 16391 break 16392 } 16393 Ev(t.c, t.f, a, null), Zv(t, a) 16394 } 16395 4 == e && 0 == n.length && (t.h = 1, Pv(16), s = !1), t.b = t.b && s, s ? 0 < n.length && !t.V && (t.V = !0, (e = t.g).a == t && e.U && !e.F && (e.c.info("Great, no buffering proxy detected. Bytes received: " + n.length), hy(e), e.F = !0, Pv(11))) : (Ev(t.c, t.f, n, "[Invalid Chunked Response]"), $v(t), Jv(t)) 16396 } 16397 16398 function Qv(t) { 16399 t.T = Xp() + t.P, Yv(t, t.P) 16400 } 16401 16402 function Yv(t, e) { 16403 if (null != t.o) throw Error("WatchDog timer not null"); 16404 t.o = Dv(Qp(t.Va, t), e) 16405 } 16406 16407 function Xv(t) { 16408 t.o && (qp.clearTimeout(t.o), t.o = null) 16409 } 16410 16411 function Jv(t) { 16412 0 == t.g.v || t.A || py(t.g, t) 16413 } 16414 16415 function $v(t) { 16416 Xv(t); 16417 var e = t.F; 16418 e && "function" == typeof e.ja && e.ja(), t.F = null, lv(t.R), Iv(t.J), t.a && (e = t.a, t.a = null, e.abort(), e.ja()) 16419 } 16420 16421 function Zv(t, e) { 16422 try { 16423 var n, r, i, o, s, a = t.g; 16424 if (0 != a.v && (a.a == t || Og(a.b, t))) 16425 if (a.I = t.N, !t.C && Og(a.b, t) && 3 == a.v) { 16426 try { 16427 var u = a.ka.a.parse(e) 16428 } catch (t) { 16429 u = null 16430 } 16431 if (Array.isArray(u) && 3 == u.length) { 16432 var c = u; 16433 if (0 == c[0]) { 16434 t: if (!a.j) { 16435 if (a.a) { 16436 if (!(a.a.u + 3e3 < t.u)) break t; 16437 fy(a), ey(a) 16438 } 16439 cy(a), Pv(18) 16440 } 16441 } 16442 else a.oa = c[1], 0 < a.oa - a.P && c[2] < 37500 && a.H && 0 == a.o && !a.m && (a.m = Dv(Qp(a.Sa, a), 6e3)); 16443 if (Pg(a.b) <= 1 && a.ea) { 16444 try { 16445 a.ea() 16446 } catch (t) {} 16447 a.ea = void 0 16448 } 16449 } else vy(a, 11) 16450 } else if (!t.C && a.a != t || fy(a), !rd(e)) 16451 for (e = u = a.ka.a.parse(e), u = 0; u < e.length; u++) c = e[u], a.P = c[0], c = c[1], 2 == a.v ? "c" == c[0] ? (
16451a.J = c[1], a.ga = c[2], null != (r = c[3]) && (a.ha = r, a.c.info("VER=" + a.ha)), null != (o = c[4]) && (a.pa = o, a.c.info("SVER=" + a.pa)), null != (r = c[5]) && "number" == typeof r && 0 < r && (n = 1.5 * r, a.D = n, a.c.info("backChannelRequestTimeoutMs_=" + n)), n = a, (o = t.a) && (!(r = o.a ? o.a.getResponseHeader("X-Client-Wire-Protocol") : null) || !(i = n.b).a && (sd(r, "spdy") || sd(r, "quic") || sd(r, "h2")) && (i.f = i.g, i.a = new Set, i.b && (Dg(i, i.b), i.b = null)), !n.A || (s = o.a ? o.a.getResponseHeader("X-HTTP-Session-Id") : null) && (n.na = s, lg(n.B, n.A, s))), a.v = 3, a.f && a.f.ta(), a.U && (a.N = Xp() - t.u, a.c.info("Handshake RTT: " + a.N + "ms")), i = t, (n = a).la = yy(n, n.C ? n.ga : null, n.fa), i.C ? (xg(n.b, i), o = i, (s = n.D) && o.setTimeout(s), o.o && (Xv(o), Qv(o)), n.a = i) : uy(n), 0 < a.g.length && iy(a)) : "stop" != c[0] && "close" != c[0] || vy(a, 7) : 3 == a.v && ("stop" == c[0] || "close" == c[0] ? "stop" == c[0] ? vy(a, 7) : ty(a) : "noop" != c[0] && a.f && a.f.sa(c), a.o = 0); 16452 kv(4) 16453 } catch (t) {} 16454 } 16455 16456 function tg(t, e) { 16457 if (t.forEach && "function" == typeof t.forEach) t.forEach(e, void 0); 16458 else if (Bp(t) || "string" == typeof t) td(t, e, void 0); 16459 else { 16460 if (t.L && "function" == typeof t.L) var n = t.L(); 16461 else if (t.K && "function" == typeof t.K) n = void 0; 16462 else if (Bp(t) || "string" == typeof t) 16463 for (var n = [], r = t.length, i = 0; i < r; i++) n.push(i); 16464 else 16465 for (i in n = [], r = 0, t) n[r++] = i; 16466 for (var i = (r = function (t) { 16467 if (t.K && "function" == typeof t.K) return t.K(); 16468 if ("string" == typeof t) return t.split(""); 16469 if (Bp(t)) { 16470 for (var e = [], n = t.length, r = 0; r < n; r++) e.push(t[r]); 16471 return e 16472 } 16473 for (r in e = [], n = 0, t) e[n++] = t[r]; 16474 return e 16475 }(t)).length, o = 0; o < i; o++) e.call(void 0, r[o], n && n[o], t) 16476 } 16477 } 16478 16479 function eg(t, e) { 16480 this.b = {}, this.a = [], this.c = 0; 16481 var n = arguments.length; 16482 if (1 < n) { 16483 if (n % 2) throw Error("Uneven number of arguments"); 16484 for (var r = 0; r < n; r += 2) this.set(arguments[r], arguments[r + 1]) 16485 } else if (t) 16486 if (t instanceof eg) 16487 for (n = t.L(), r = 0; r < n.length; r++) this.set(n[r], t.get(n[r])); 16488 else 16489 for (r in t) this.set(r, t[r]) 16490 } 16491 16492 function ng(t) { 16493 if (t.c != t.a.length) { 16494 for (var e = 0, n = 0; e < t.a.length;) { 16495 var r = t.a[e]; 16496 rg(t.b, r) && (t.a[n++] = r), e++ 16497 } 16498 t.a.length = n 16499 } 16500 if (t.c != t.a.length) { 16501 for (var i = {}, n = e = 0; e < t.a.length;) rg(i, r = t.a[e]) || (i[t.a[n++] = r] = 1), e++; 16502 t.a.length = n 16503 } 16504 } 16505 16506 function rg(t, e) { 16507 return Object.prototype.hasOwnProperty.call(t, e) 16508 }(z = qv.prototype).setTimeout = function (t) { 16509 this.P = t 16510 }, z.Xa = function (t) { 16511 t = t.target; 16512 var e = this.F; 16513 e && 3 == Xg(t) ? e.f() : this.Ca(t) 16514 }, z.Ca = function (t) { 16515 try { 16516 if (t == this.a) t: { 16517 var e = Xg(this.a), 16518 n = this.a.ua(), 16519 r = this.a.W(); 16520 if (!(e < 3 || 3 == e && !md && !this.a.$())) { 16521 this.A || 4 != e || 7 == n || kv(8 == n || r <= 0 ? 3 : 2), Xv(this); 16522 var i = this.a.W(); 16523 this.N = i; 16524 var o = this.a.$(); 16525 if (this.b = 200 == i, r = this.c, u = this.m, c = this.l, h = this.f, l = this.S, f = e, p = i, r.info(function () { 16526 return "XMLHTTP RESP (" + h + ") [ attempt " + l + "]: " + u + "\n" + c + "\n" + f + " " + p 16527 }), this.b) { 16528 if (this.U && !this.C) { 16529 e: { 16530 if (this.a) { 16531 var s = this.a; 16532 if ((s = s.a ? s.a.getResponseHeader("X-HTTP-Initial-Response") : null) && !rd(s)) { 16533 var a = s; 16534 break e 16535 } 16536 } 16537 a = null 16538 } 16539 if (!a) { 16540 this.b = !1, this.h = 3, Pv(12), $v(this), Jv(this); 16541 break t 16542 } 16543 Ev(this.c, this.f, a, "Initial handshake response via X-HTTP-Initial-Response"), 16544 this.C = !0, 16545 Zv(this, a) 16546 } 16547 this.I ? (zv(this, e, o), md && this.b && 3 == e && (_v(this.J, this.R, "tick", this.Wa), this.R.start())) : (Ev(this.c, this.f, o, null), Zv(this, o)), 4 == e && $v(this), this.b && !this.A && (4 == e ? py(this.g, this) : (this.b = !1, Qv(this))) 16548 } else 400 == i && 0 < o.indexOf("Unknown SID") ? (this.h = 3, Pv(12)) : (this.h = 0, Pv(13)), $v(this), Jv(this) 16549 } 16550 } 16551 } catch (t) {} 16552 var u, c, h, l, f, p 16553 }, z.Wa = function () { 16554 var t, e; 16555 this.a && (t = Xg(this.a), e = this.a.$(), this.D < e.length && (Xv(this), zv(this, t, e), this.b && 4 != t && Qv(this))) 16556 }, z.cancel = function () { 16557 this.A = !0, $v(this) 16558 }, z.Va = function () { 16559 this.o = null; 16560 var t, e, n = Xp(); 16561 0 <= n - this.T ? (t = this.c, e = this.l, t.info(function () { 16562 return "TIMEOUT: " + e 16563 }), 2 != this.H && (kv(3), Pv(17)), $v(this), this.h = 2, Jv(this)) : Yv(this, this.T - n) 16564 }, (z = eg.prototype).K = function () { 16565 ng(this); 16566 for (var t = [], e = 0; e < this.a.length; e++) t.push(this.b[this.a[e]]); 16567 return t 16568 }, z.L = function () { 16569 return ng(this), this.a.concat() 16570 }, z.get = function (t, e) { 16571 return rg(this.b, t) ? this.b[t] : e 16572 }, z.set = function (t, e) { 16573 rg(this.b, t) || (this.c++, this.a.push(t)), this.b[t] = e 16574 }, z.forEach = function (t, e) { 16575 for (var n = this.L(), r = 0; r < n.length; r++) { 16576 var i = n[r], 16577 o = this.get(i); 16578 t.call(e, o, i, this) 16579 } 16580 }; 16581 var ig = /^(?:([^:/?#.]+):)?(?:\/\/(?:([^\\/?#]*)@)?([^\\/?#]*?)(?::([0-9]+))?(?=[\\/?#]|$))?([^?#]+)?(?:\?([^#]*))?(?:#([\s\S]*))?$/; 16582 16583 function og(t, e) { 16584 var n; 16585 this.c = this.j = this.f = "", this.h = null, this.i = this.g = "", this.a = !1, t instanceof og ? (this.a = void 0 !== e ? e : t.a, ag(this, t.f), this.j = t.j, ug(this, t.c), cg(this, t.h), this.g = t.g, e = t.b, (n = new _g).c = e.c, e.a && (n.a = new eg(e.a), n.b = e.b), hg(this, n), this.i = t.i) : t && (n = String(t).match(ig)) ? (this.a = !!e, ag(this, n[1] || "", !0), this.j = pg(n[2] || ""), ug(this, n[3] || "", !0), cg(this, n[4]), this.g = pg(n[5] || "", !0), hg(this, n[6] || "", !0), this.i = pg(n[7] || "")) : (this.a = !!e, this.b = new _g(null, this.a)) 16586 } 16587 16588 function sg(t) { 16589 return new og(t) 16590 } 16591 16592 function ag(t, e, n) { 16593 t.f = n ? pg(e, !0) : e, t.f && (t.f = t.f.replace(/:$/, "")) 16594 } 16595 16596 function ug(t, e, n) { 16597 t.c = n ? pg(e, !0) : e
16598 } 16599 16600 function cg(t, e) { 16601 if (e) { 16602 if (e = Number(e), isNaN(e) || e < 0) throw Error("Bad port number " + e); 16603 t.h = e 16604 } else t.h = null 16605 } 16606 16607 function hg(t, e, n) { 16608 var r, i; 16609 e instanceof _g ? (t.b = e, r = t.b, (i = t.a) && !r.f && (Ig(r), r.c = null, r.a.forEach(function (t, e) { 16610 var n = e.toLowerCase(); 16611 e != n && (Tg(this, e), Sg(this, n, t)) 16612 }, r)), r.f = i) : (n || (e = dg(e, bg)), t.b = new _g(e, t.a)) 16613 } 16614 16615 function lg(t, e, n) { 16616 t.b.set(e, n) 16617 } 16618 16619 function fg(t) { 16620 return lg(t, "zx", Math.floor(2147483648 * Math.random()).toString(36) + Math.abs(Math.floor(2147483648 * Math.random()) ^ Xp()).toString(36)), t 16621 } 16622 16623 function pg(t, e) { 16624 return t ? e ? decodeURI(t.replace(/%25/g, "%2525")) : decodeURIComponent(t) : "" 16625 } 16626 16627 function dg(t, e, n) { 16628 return "string" == typeof t ? (t = encodeURI(t).replace(e, vg), t = n ? t.replace(/%25([0-9a-fA-F]{2})/g, "%$1") : t) : null 16629 } 16630 16631 function vg(t) { 16632 return "%" + ((t = t.charCodeAt(0)) >> 4 & 15).toString(16) + (15 & t).toString(16) 16633 } 16634 og.prototype.toString = function () { 16635 var t = [], 16636 e = this.f; 16637 e && t.push(dg(e, gg, !0), ":"); 16638 var n = this.c; 16639 return !n && "file" != e || (t.push("//"), (e = this.j) && t.push(dg(e, gg, !0), "@"), t.push(encodeURIComponent(String(n)).replace(/%25([0-9a-fA-F]{2})/g, "%$1")), null != (n = this.h) && t.push(":", String(n))), (n = this.g) && (this.c && "/" != n.charAt(0) && t.push("/"), t.push(dg(n, "/" == n.charAt(0) ? mg : yg, !0))), (n = this.b.toString()) && t.push("?", n), (n = this.i) && t.push("#", dg(n, wg)), t.join("") 16640 }; 16641 var gg = /[#\/\?@]/g, 16642 yg = /[#\?:]/g, 16643 mg = /[#\?]/g, 16644 bg = /[#\?@]/g, 16645 wg = /#/g; 16646 16647 function _g(t, e) { 16648 this.b = this.a = null, this.c = t || null, this.f = !!e 16649 } 16650 16651 function Ig(n) { 16652 n.a || (n.a = new eg, n.b = 0, n.c && function (t, e) { 16653 if (t) { 16654 t = t.split("&"); 16655 for (var n = 0; n < t.length; n++) { 16656 var r, i = t[n].indexOf("="), 16657 o = null; 16658 0 <= i ? (r = t[n].substring(0, i), o = t[n].substring(i + 1)) : r = t[n], e(r, o ? decodeURIComponent(o.replace(/\+/g, " ")) : "") 16659 } 16660 } 16661 }(n.c, function (t, e) { 16662 n.add(decodeURIComponent(t.replace(/\+/g, " ")), e) 16663 })) 16664 } 16665 16666 function Tg(t, e) { 16667 Ig(t), e = Cg(t, e), rg(t.a.b, e) && (t.c = null, t.b -= t.a.get(e).length, rg((t = t.a).b, e) && (delete t.b[e], t.c--, t.a.length > 2 * t.c && ng(t))) 16668 } 16669 16670 function Eg(t, e) { 16671 return Ig(t), e = Cg(t, e), rg(t.a.b, e) 16672 } 16673 16674 function Sg(t, e, n) { 16675 Tg(t, e), 0 < n.length && (t.c = null, t.a.set(Cg(t, e), nd(n)), t.b += n.length) 16676 } 16677 16678 function Cg(t, e) { 16679 return e = String(e), e = t.f ? e.toLowerCase() : e 16680 }(z = _g.prototype).add = function (t, e) { 16681 Ig(this), this.c = null, t = Cg(this, t); 16682 var n = this.a.get(t); 16683 return n || this.a.set(t, n = []), n.push(e), this.b += 1, this 16684 }, z.forEach = function (n, r) { 16685 Ig(this), this.a.forEach(function (t, e) { 16686 td(t, function (t) { 16687 n.call(r, t, e, this) 16688 }, this) 16689 }, this) 16690 }, z.L = function () { 16691 Ig(this); 16692 for (var t = this.a.K(), e = this.a.L(), n = [], r = 0; r < e.length; r++) 16693 for (var i = t[r], o = 0; o < i.length; o++) n.push(e[r]); 16694 return n 16695 }, z.K = function (t) { 16696 Ig(this); 16697 var e = []; 16698 if ("string" == typeof t) Eg(this, t) && (e = ed(e, this.a.get(Cg(this, t)))); 16699 else { 16700 t = this.a.K(); 16701 for (var n = 0; n < t.length; n++) e = ed(e, t[n]) 16702 } 16703 return e 16704 }, z.set = function (t, e) { 16705 return Ig(this), this.c = null, Eg(this, t = Cg(this, t)) && (this.b -= this.a.get(t).length), this.a.set(t, [e]), this.b += 1, this 16706 }, z.get = function (t, e) { 16707 return t && 0 < (t = this.K(t)).length ? String(t[0]) : e 16708 }, z.toString = function () { 16709 if (this.c) return this.c; 16710 if (!this.a) return ""; 16711 for (var t = [], e = this.a.L(), n = 0; n < e.length; n++) 16712 for (var r = e[n], i = encodeURIComponent(String(r)), r = this.K(r), o = 0; o < r.length; o++) { 16713 var s = i; 16714 "" !== r[o] && (s += "=" + encodeURIComponent(String(r[o]))), t.push(s) 16715 }
16716 return this.c = t.join("&") 16717 }; 16718 var Ng = function (t, e) { 16719 this.b = t, this.a = e 16720 }; 16721 16722 function Ag(t) { 16723 this.g = t || kg, t = qp.PerformanceNavigationTiming ? 0 < (t = qp.performance.getEntriesByType("navigation")).length && ("hq" == t[0].nextHopProtocol || "h2" == t[0].nextHopProtocol) : !!(qp.ia && qp.ia.ya && qp.ia.ya() && qp.ia.ya().Lb), this.f = t ? this.g : 1, this.a = null, 1 < this.f && (this.a = new Set), this.b = null, this.c = [] 16724 } 16725 var kg = 10; 16726 16727 function Rg(t) { 16728 return t.b || t.a && t.a.size >= t.f 16729 } 16730 16731 function Pg(t) { 16732 return t.b ? 1 : t.a ? t.a.size : 0 16733 } 16734 16735 function Og(t, e) { 16736 return t.b ? t.b == e : t.a && t.a.has(e) 16737 } 16738 16739 function Dg(t, e) { 16740 t.a ? t.a.add(e) : t.b = e 16741 } 16742 16743 function xg(t, e) { 16744 t.b && t.b == e ? t.b = null : t.a && t.a.has(e) && t.a.delete(e) 16745 } 16746 16747 function Lg(t) { 16748 var e, n; 16749 if (null != t.b) return t.c.concat(t.b.s); 16750 if (null == t.a || 0 === t.a.size) return nd(t.c); 16751 var r = t.c; 16752 try { 16753 for (var i = Up(t.a.values()), o = i.next(); !o.done; o = i.next()) var s = o.value, 16754 r = r.concat(s.s) 16755 } catch (t) { 16756 e = { 16757 error: t 16758 } 16759 } finally { 16760 try { 16761 o && !o.done && (n = i.return) && n.call(i) 16762 } finally { 16763 if (e) throw e.error 16764 } 16765 } 16766 return r 16767 } 16768 16769 function Mg() {} 16770 16771 function Fg() { 16772 this.a = new Mg 16773 } 16774 16775 function Ug(t, e, n, r, i) { 16776 try { 16777 e.onload = null, e.onerror = null, e.onabort = null, e.ontimeout = null, i(r) 16778 } catch (t) {} 16779 } 16780 Ag.prototype.cancel = function () { 16781 var e, t; 16782 if (this.c = Lg(this), this.b) this.b.cancel(), this.b = null; 16783 else if (this.a && 0 !== this.a.size) { 16784 try { 16785 for (var n = Up(this.a.values()), r = n.next(); !r.done; r = n.next()) r.value.cancel() 16786 } catch (t) { 16787 e = { 16788 error: t 16789 } 16790 } finally { 16791 try { 16792 r && !r.done && (t = n.return) && t.call(n) 16793 } finally { 16794 if (e) throw e.error 16795 } 16796 } 16797 this.a.clear() 16798 } 16799 }, Mg.prototype.stringify = function (t) { 16800 return qp.JSON.stringify(t, void 0) 16801 }, Mg.prototype.parse = function (t) { 16802 return qp.JSON.parse(t, void 0) 16803 }; 16804 var jg = qp.JSON.parse; 16805 16806 function qg(t) { 16807 Jd.call(this), this.headers = new eg, 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 = Vg, this.D = this.F = !1 16808 } 16809 Jp(qg, Jd); 16810 var Vg = "", 16811 Bg = /^https?$/i, 16812 Kg = ["POST", "PUT"]; 16813 16814 function Wg(t) { 16815 return "content-type" == t.toLowerCase() 16816 } 16817 16818 function Hg(t, e) { 16819 t.b = !1, t.a && (t.g = !0, t.a.abort(), t.g = !1), t.f = e, t.h = 5, Gg(t), Qg(t) 16820 } 16821 16822 function Gg(t) { 16823 t.u || (t.u = !0, $d(t, "complete"), $d(t, "error")) 16824 } 16825 16826 function zg(t) { 16827 if (t.b && void 0 !== jp && (!t.s[1] || 4 != Xg(t) || 2 != t.W())) 16828 if (t.l && 4 == Xg(t)) fv(t.za, 0, t); 16829 else if ($d(t, "readystatechange"), 4 == Xg(t)) { 16830 t.b = !1; 16831 try { 16832 var e, n, r, i, o = t.W(); 16833 t: switch (o) { 16834 case 200: 16835 case 201: 16836 case 202: 16837 case 204: 16838 case 206: 16839 case 304: 16840 case 1223: 16841 var s = !0; 16842 break t; 16843 default: 16844 s = !1 16845 }(e = s) || ((n = 0 === o) && (!(i = String(t.B).match(ig)[1] || null) && qp.self && qp.self.location && (i = (r = qp.self.location.protocol).substr(0, r.length - 1)), n = !Bg.test(i ? i.toLowerCase() : "")), e = n); 16846 if (e) $d(t, "complete"), $d(t, "success"); 16847 else { 16848 t.h = 6; 16849 try { 16850 var a = 2 < Xg(t) ? t.a.statusText : "" 16851 } catch (o) { 16852 a = "" 16853 } 16854 t.f = a + " [" + t.W() + "]", Gg(t) 16855 } 16856 } finally { 16857 Qg(t) 16858 } 16859 } 16860 } 16861 16862 function Qg(t, e) { 16863 if (t.a) { 16864 Yg(t); 16865 var n = t.a, 16866 r = t.s[0] ? Vp : null; 16867 t.a = null, t.s = null, e || $d(t, "ready"); 16868 try { 16869 n.onreadystatechange = r 16870 } catch (t) {} 16871 } 16872 } 16873 16874 function Yg(t) { 16875 t.a && t.D && (t.a.ontimeout = null), t.m && (qp.clearTimeout(t.m), t.m = null) 16876 } 16877 16878 function Xg(t) { 16879 return t.a ? t.a.readyState : 0 16880 } 16881 16882 function Jg(t, e, n) { 16883 t: { 16884 for (r in n) { 16885 var r = !1; 16886 break t 16887 } 16888 r = !0 16889 } 16890 var i;r || (i = "", cd(n, function (t, e) { 16891 i += e, i += ":", i += t, i += "\r\n" 16892 }), n = i, "string" == typeof t ? null != n && encodeURIComponent(String(n)) : lg(t, e, n)) 16893 } 16894 16895 function $g(t, e, n) {
16896 return n && n.internalChannelParams && n.internalChannelParams[t] || e 16897 } 16898 16899 function Zg(t) { 16900 this.pa = 0, this.g = [], this.c = new Tv, 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 = $g("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 = $g("baseRetryDelayMs", 5e3, t), this.Ra = $g("retryDelaySeedMs", 1e4, t), this.Ma = $g("forwardChannelMaxRetries", 2, t), this.ma = $g("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 Ag(t && t.concurrentRequestLimit), this.ka = new Fg, 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.") 16901 } 16902 16903 function ty(t) { 16904 var e, n; 16905 ny(t), 3 == t.v && (e = t.R++, lg(n = sg(t.B), "SID", t.J), lg(n, "RID", e), lg(n, "TYPE", "terminate"), sy(t, n), (e = new qv(t, t.c, e, void 0)).H = 2, e.i = fg(sg(n)), n = !1, !(n = qp.navigator && qp.navigator.sendBeacon ? qp.navigator.sendBeacon(e.i.toString(), "") : n) && qp.Image && ((new Image).src = e.i, n = !0), n || (e.a = my(e.g, null), e.a.ba(e.i)), e.u = Xp(), Qv(e)), gy(t) 16906 } 16907 16908 function ey(t) { 16909 t.a && (hy(t), t.a.cancel(), t.a = null) 16910 } 16911 16912 function ny(t) { 16913 ey(t), t.j && (qp.clearTimeout(t.j), t.j = null), fy(t), t.b.cancel(), t.h && ("number" == typeof t.h && qp.clearTimeout(t.h), t.h = null) 16914 } 16915 16916 function ry(t, e) { 16917 t.g.push(new Ng(t.Oa++, e)), 3 == t.v && iy(t) 16918 } 16919 16920 function iy(t) { 16921 Rg(t.b) || t.h || (t.h = !0, sv(t.Ba, t), t.u = 0) 16922 } 16923 16924 function oy(t, e) { 16925 var n = e ? e.f : t.R++, 16926 r = sg(t.B); 16927 lg(r, "SID", t.J), lg(r, "RID", n), lg(r, "AID", t.P), sy(t, r), t.i && t.l && Jg(r, t.i, t.l), n = new qv(t, t.c, n, t.u + 1), null === t.i && (n.B = t.l), e && (t.g = e.s.concat(t.g)), e = ay(t, n, 1e3), n.setTimeout(Math.round(.5 * t.ma) + Math.round(.5 * t.ma * Math.random())), Dg(t.b, n), Hv(n, r, e) 16928 } 16929 16930 function sy(t, n) { 16931 t.f && tg({}, function (t, e) { 16932 lg(n, e, t) 16933 }) 16934 } 16935 16936 function ay(t, e, n) { 16937 n = Math.min(t.g.length, n); 16938 var r = t.f ? Qp(t.f.Ja, t.f, t) : null; 16939 t: for (var i = t.g, o = -1;;) { 16940 var s = ["count=" + n]; - 1 == o ? 0 < n ? (o = i[0].b, s.push("ofs=" + o)) : o = 0 : s.push("ofs=" + o); 16941 for (var a = !0, u = 0; u < n; u++) { 16942 var c = i[u].b, 16943 h = i[u].a; 16944 if ((c -= o) < 0) o = Math.max(0, i[u].b - 100), a = !1; 16945 else try { 16946 ! function (t, r, e) { 16947 var i = e || ""; 16948 try { 16949 tg(t, function (t, e) { 16950 var n = t; 16951 Kp(t) && (n = tv(t)), r.push(i + e + "=" + encodeURIComponent(n)) 16952 }) 16953 } catch (t) { 16954 throw r.push(i + "type=" + encodeURIComponent("_badmap")), t 16955 } 16956 }(h, s, "req" + c + "_") 16957 } catch (t) { 16958 r && r(h) 16959 } 16960 } 16961 if (a) { 16962 r = s.join("&"); 16963 break t 16964 } 16965 } 16966 return t = t.g.splice(0, n), e.s = t, r 16967 } 16968 16969 function uy(t) { 16970 t.a || t.j || (t.T = 1, sv(t.Aa, t), t.o = 0) 16971 } 16972 16973 function cy(t) { 16974 return !(t.a || t.j || 3 <= t.o) && (t.T++, t.j = Dv(Qp(t.Aa, t), dy(t, t.o)), t.o++, 1) 16975 } 16976 16977 function hy(t) { 16978 null != t.s && (qp.clearTimeout(t.s), t.s = null) 16979 } 16980 16981 function ly(t) { 16982 t.a = new qv(t, t.c, "rpc", t.T), null === t.i && (t.a.B = t.l), t.a.O = 0; 16983 var e = sg(t.la); 16984 lg(e, "RID", "rpc"), lg(e, "SID", t.J), lg(e, "CI", t.H ? "0" : "1"), lg(e, "AID", t.P), sy(t, e), lg(e, "TYPE", "xmlhttp"), t.i && t.l && Jg(e, t.i, t.l), t.D && t.a.setTimeout(t.D); 16985 var n = t.a; 16986 t = t.ga, n.H = 1, n.i = fg(sg(e)), n.j = null, n.I = !0, Gv(n, t) 16987 } 16988 16989 function fy(t) { 16990 null != t.m && (qp.clearTimeout(t.m), t.m = null) 16991 } 16992 16993 function py(t, e) { 16994 var n, r, i, o = null; 16995 if (t.a == e) { 16996 fy(t), hy(t), t.a = null; 16997 var s = 2 16998 } else { 16999 if (!Og(t.b, e)) return; 17000 o = e.s, xg(t.b, e), s = 1 17001 } 17002 if (t.I = e.N, 0 != t.v) 17003 if (e.b) 1 == s ? (o = e.j ? e.j.length : 0, e = Xp() - e.u, n = t.u, $d(s = Nv(), new Ov(s)), iy(t)) : uy(t); 17004 else if (3 == (n = e.h) || 0 == n && 0 < t.I || (1 != s || (i = e, Pg((r = t).b) >= r.b.f - (r.h ? 1 : 0) || (r.h ? (r.g = i.s.concat(r.g), 0) : 1 == r.v || 2 == r.v || r.u >= (r.La ? 0 : r.Ma) || (r.h = Dv(Qp(r.Ba, r, i), dy(r, r.u)), r.u++, 0)))) && (2 != s || !cy(t))) switch (o && 0 < o.length && (e = t.b, e.c = e.c.concat(o)), n) { 17005 case 1: 17006 vy(t, 5); 17007 break; 17008 case 4: 17009 vy(t, 10); 17010 break; 17011 case 3: 17012 vy(t, 6); 17013 break; 17014 default: 17015 vy(t, 2) 17016 } 17017 } 17018 17019 function dy(t, e) { 17020 var n = t.Ha + Math.floor(Math.random() * t.Ra); 17021 return t.f || (n *= 2), n * e 17022 } 17023 17024 function vy(t, e) { 17025 var n, r, i, o; 17026 t.c.info("Error code " + e), 2 == e ? (r = null, t.f && (r = null), o = Qp(t.Ya, t), r || (r = new og("//www.google.com/images/cleardot.gif"), qp.location && "http" == qp.location.protocol || ag(r, "https"), fg(r)), n = r.toString(), r = o, o = new Tv, qp.Image ? ((i = new Image).onload = Yp(Ug, o, i, "TestLoadImage: loaded", !0, r), i.onerror = Yp(Ug, o, i, "TestLoadImage: error", !1, r), i.onabort = Yp(Ug, o, i, "TestLoadImage: abort", !1, r), i.ontimeout = Yp(Ug, o, i, "TestLoadImage: timeout", !1, r), qp.setTimeout(function () { 17027 i.ontimeout && i.ontimeout() 17028 }, 1e4), i.src = n) : r(!1)) : Pv(2), t.v = 0, t.f && t.f.ra(e), gy(t), ny(t) 17029 } 17030 17031 function gy(t) { 17032 t.v = 0, t.I = -1, t.f && (0 == Lg(t.b).length && 0 == t.g.length || (t.b.c.length = 0, nd(t.g), t.g.length = 0), t.f.qa()) 17033 } 17034 17035 function yy(t, e, n) { 17036 var r, i, o, s, a, u = (s = n) instanceof og ? sg(s) : new og(s, void 0); 17037 return "" != u.c ? (e && ug(u, e + "." + u.c), cg(u, u.h)) : (a = qp.location, r = a.protocol, i = e ? e + "." + a.hostname : a.hostname, o = +a.port, s = n, a = new og(null, void 0), r && ag(a, r), i && ug(a, i), o && cg(a, o), s && (a.g = s), u = a), t.V && cd(t.V, function (t, e) { 17038 lg(u, e, t) 17039 }), e = t.A, n = t.na, e && n && lg(u, e, n), lg(u, "VER", t.ha), sy(t, u), u 17040 } 17041 17042 function my(t, e) { 17043 if (e && !t.C) throw Error("Can't create secondary domain capable XhrIo object."); 17044 return (e = new qg(t.Na)).F = t.C, e 17045 } 17046 17047 function by() {} 17048 17049 function wy() { 17050 if (gd && !(10 <= Number(Cd))) throw Error("Environmental error: no available transport.") 17051 } 17052 17053 function _y(t, e) { 17054 Jd.call(this), this.a = new Zg(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 = { 17055 "X-Client-Protocol": "webchannel" 17056 }), this.a.l = t, t = e && e.initMessageHeaders || null, e && e.messageContentType && (t ? t["X-WebChannel-Content-Type"] = e.messageContentType : t = { 17057 "X-WebChannel-Content-Type": e.messageContentType 17058 }), e && e.a && (t ? t["X-WebChannel-Client-Profile"] = e.a : t = { 17059 "X-WebChannel-Client-Profile": e.a 17060 }), this.a.O = t, (t = e && e.httpHeadersOverwriteParam) && !rd(t) && (this.a.i = t), this.m = e && e.supportsCrossDomainXhr || !1, this.l = e && e.sendRawJson || !1, (e = e && e.httpSessionIdParam) && !rd(e) && (this.a.A = e, null !== (t = this.b) && e in t && (e in (t = this.b) && delete t[e])), this.f = new Ey(this) 17061 } 17062 17063 function Iy(t) { 17064 Fv.call(this); 17065 var e = t.__sm__; 17066 if (e) { 17067 t: { 17068 for (var n in e) { 17069 t = n; 17070 break t 17071 } 17072 t = void 0 17073 }(this.c = t) ? (t = this.c, this.data = null !== e && t in e ? e[t] : void 0) : this.data = e 17074 } 17075 else this.data = t 17076 } 17077 17078 function Ty() { 17079 Uv.call(this), this.status = 1 17080 } 17081 17082 function Ey(t) { 17083 this.a = t 17084 }(z = qg.prototype).ba = function (t, e, n, r) { 17085 if (this.a) throw Error("[goog.net.XhrIo] Object is active with another request=" + this.B + "; newUri=" + t); 17086 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 ? Lv(this.H) : Lv(Vv), this.a.onreadystatechange = Qp(this.za, this); 17087 try { 17088 this.A = !0, this.a.open(e, String(t), !0), this.A = !1 17089 } catch (t) { 17090 return void Hg(this, t) 17091 } 17092 t = n || ""; 17093 var i, o = new eg(this.headers); 17094 r && tg(r, function (t, e) { 17095 o.set(e, t) 17096 }), r = function (t) { 17097 t: { 17098 for (var e = Wg, n = t.length, r = "string" == typeof t ? t.split("") : t, i = 0; i < n; i++) 17099 if (i in r && e.call(void 0, r[i], i, t)) { 17100 e = i; 17101 break t 17102 } e = -1 17103 } 17104 return e < 0 ? null : "string" == typeof t ? t.charAt(e) : t[e] 17105 }(o.L()), n = qp.FormData && t instanceof qp.FormData, 0 <= Zp(Kg, e) && !r && !n && o.set("Content-Type", "application/x-www-form-urlencoded;charset=utf-8"), o.forEach(function (t, e) { 17106 this.a.setRequestHeader(e, t) 17107 }, this), this.I && (this.a.responseType = this.I), "withCredentials" in this.a && this.a.withCredentials !== this.F && (this.a.withCredentials = this.F); 17108 try { 17109 Yg(this), 0 < this.o && ((this.D = (i = this.a, gd && Sd(9) && "number" == typeof i.timeout && void 0 !== i.ontimeout)) ? (this.a.timeout = this.o, this.a.ontimeout = Qp(this.xa, this)) : this.m = fv(this.xa, this.o, this)), this.l = !0, this.a.send(t), this.l = !1 17110 } catch (t) { 17111 Hg(this, t) 17112 } 17113 }, z.xa = function () { 17114 void 0 !== jp && this.a && (this.f = "Timed out after " + this.o + "ms, aborting", this.h = 8, $d(this, "timeout"), this.abort(8)) 17115 }, z.abort = function (t) { 17116 this.a && this.b && (this.b = !1, this.g = !0, this.a.abort(), this.g = !1, this.h = t || 7, $d(this, "complete"), $d(this, "abort"), Qg(this)) 17117 }, z.G = function () { 17118 this.a && (this.b && (this.b = !1, this.g = !0, this.a.abort(), this.g = !1), Qg(this, !0)), qg.X.G.call(this) 17119 }, z.za = function () { 17120 this.j || (this.A || this.l || this.g ? zg(this) : this.Ua()) 17121 }, z.Ua = function () { 17122 zg(this) 17123 }, z.W = function () { 17124 try { 17125 return 2 < Xg(this) ? this.a.status : -1 17126 } catch (t) { 17127 return -1 17128 } 17129 }, z.$ = function () { 17130 try { 17131 return this.a ? this.a.responseText : "" 17132 } catch (t) { 17133 return "" 17134 } 17135 }, z.Pa = function (t) { 17136 if (this.a) { 17137 var e = this.a.responseText; 17138 return t && 0 == e.indexOf(t) && (e = e.substring(t.length)), jg(e) 17139 } 17140 }, z.ua = function () { 17141 return this.h 17142 }, z.Qa = function () { 17143 return "string" == typeof this.f ? this.f : String(this.f) 17144 }, (z = Zg.prototype).ha = 8, z.v = 1, z.Ba = function (t) { 17145 if (this.h) 17146 if (this.h = null, 1 == this.v) { 17147 if (!t) { 17148 this.R = Math.floor(1e5 * Math.random()), t = this.R++; 17149 var e, n = new qv(this, this.c, t, void 0), 17150 r = this.l; 17151 if (this.O && (r ? fd(r = hd(r), this.O) : r = this.O), null === this.i && (n.B = r), this.da) t: { 17152 for (var i = e = 0; i < this.g.length; i++) { 17153 var o = this.g[i]; 17154 if ("__data__" in o.a && "string" == typeof (o = o.a.__data__) ? o = o.length : o = void 0, void 0 === o) break; 17155 if (4096 < (e += o)) { 17156 e = i; 17157 break t 17158 } 17159 if (4096 === e || i === this.g.length - 1) { 17160 e = i + 1; 17161 break t 17162 } 17163 } 17164 e = 1e3 17165 } 17166 else e = 1e3; 17167 e = ay(this, n, e), lg(i = sg(this.B), "RID", t), lg(i, "CVER", 22), this.A && lg(i, "X-HTTP-Session-Id", this.A), sy(this, i), this.i && r && Jg(i, this.i, r), Dg(this.b, n), this.Ia && lg(i, "TYPE", "init"), this.da ? (lg(i, "$req", e), lg(i, "SID", "null"), n.U = !0, Hv(n, i, null)) : Hv(n, i, e), this.v = 2 17168 } 17169 } else 3 == this.v && (t ? oy(this, t) : 0 == this.g.length || Rg(this.b) || oy(this)) 17170 }, z.Aa = function () { 17171 var t; 17172 this.j = null, ly(this), this.U && !(this.F || null == this.a || this.N <= 0) && (t = 2 * this.N, this.c.info("BP detection timer enabled: " + t), this.s = Dv(Qp(this.Ta, this), t)) 17173 }, z.Ta = function () { 17174 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
17174= !0, Pv(10), ey(this), ly(this)) 17175 }, z.Sa = function () { 17176 null != this.m && (this.m = null, ey(this), cy(this), Pv(19)) 17177 }, z.Ya = function (t) { 17178 t ? (this.c.info("Successfully pinged google.com"), Pv(2)) : (this.c.info("Failed to ping google.com"), Pv(1)) 17179 }, (z = by.prototype).ta = function () {}, z.sa = function () {}, z.ra = function () {}, z.qa = function () {}, z.Ja = function () {}, wy.prototype.a = function (t, e) { 17180 return new _y(t, e) 17181 }, Jp(_y, Jd), _y.prototype.g = function () { 17182 this.a.f = this.f, this.m && (this.a.C = !0); 17183 var t = this.a, 17184 e = this.o, 17185 n = this.b || void 0; 17186 Pv(0), t.fa = e, t.V = n || {}, t.H = t.S, t.B = yy(t, null, t.fa), iy(t) 17187 }, _y.prototype.close = function () { 17188 ty(this.a) 17189 }, _y.prototype.h = function (t) { 17190 var e; 17191 "string" == typeof t ? ((e = {}).__data__ = t, ry(this.a, e)) : this.l ? ((e = {}).__data__ = tv(t), ry(this.a, e)) : ry(this.a, t) 17192 }, _y.prototype.G = function () { 17193 this.a.f = null, delete this.f, ty(this.a), delete this.a, _y.X.G.call(this) 17194 }, Jp(Iy, Fv), Jp(Ty, Uv), Jp(Ey, by), Ey.prototype.ta = function () { 17195 $d(this.a, "a") 17196 }, Ey.prototype.sa = function (t) { 17197 $d(this.a, new Iy(t)) 17198 }, Ey.prototype.ra = function (t) { 17199 $d(this.a, new Ty) 17200 }, Ey.prototype.qa = function () { 17201 $d(this.a, "b") 17202 }, wy.prototype.createWebChannel = wy.prototype.a, _y.prototype.send = _y.prototype.h, _y.prototype.open = _y.prototype.g, Ga.NO_ERROR = 0, Ga.TIMEOUT = 8, Ga.HTTP_ERROR = 6, Sn.COMPLETE = "complete", (Mv.EventType = G).OPEN = "a", G.CLOSE = "b", G.ERROR = "c", G.MESSAGE = "d", Jd.prototype.listen = Jd.prototype.va, qg.prototype.listenOnce = qg.prototype.wa, qg.prototype.getLastError = qg.prototype.Qa, qg.prototype.getLastErrorCode = qg.prototype.ua, qg.prototype.getStatus = qg.prototype.W, qg.prototype.getResponseJson = qg.prototype.Pa, qg.prototype.getResponseText = qg.prototype.$, qg.prototype.send = qg.prototype.ba; 17203 var Sy = Nv, 17204 Cy = Ga, 17205 Ny = Sn, 17206 Ay = Sv, 17207 ky = 10, 17208 Ry = 11, 17209 Py = Mv, 17210 Oy = qg, 17211 Dy = (xy.prototype.t = function (t) { 17212 return this.previousValue = Math.max(t, this.previousValue), this.previousValue 17213 }, xy.prototype.next = function () { 17214 var t = ++this.previousValue; 17215 return this.i && this.i(t), t 17216 }, xy); 17217 17218 function xy(t, e) { 17219 var n = this; 17220 this.previousValue = t, e && (e.sequenceNumberHandler = function (t) { 17221 return n.t(t) 17222 }, this.i = function (t) { 17223 return e.writeSequenceNumber(t) 17224 }) 17225 } 17226 Dy.o = -1; 17227 var Ly, My = { 17228 OK: "ok", 17229 CANCELLED: "cancelled", 17230 UNKNOWN: "unknown", 17231 INVALID_ARGUMENT: "invalid-argument", 17232 DEADLINE_EXCEEDED: "deadline-exceeded", 17233 NOT_FOUND: "not-found", 17234 ALREADY_EXISTS: "already-exists", 17235 PERMISSION_DENIED: "permission-denied", 17236 UNAUTHENTICATED: "unauthenticated", 17237 RESOURCE_EXHAUSTED: "resource-exhausted", 17238 FAILED_PRECONDITION: "failed-precondition", 17239 ABORTED: "aborted", 17240 OUT_OF_RANGE: "out-of-range", 17241 UNIMPLEMENTED: "unimplemented", 17242 INTERNAL: "internal", 17243 UNAVAILABLE: "unavailable", 17244 DATA_LOSS: "data-loss" 17245 }, 17246 Fy = (Xi(jy, Ly = Error), jy), 17247 Uy = new ps("@firebase/firestore"); 17248 17249 function jy(t, e) { 17250 var n = this; 17251 return (n = Ly.call(this, e) || this).code = t, n.message = e, n.name = "FirebaseError", n.toString = function () { 17252 return n.name + ": [code=" + n.code + "]: " + n.message 17253 }, n 17254 } 17255 17256 function qy() { 17257 return Uy.logLevel 17258 } 17259 17260 function Vy(t) { 17261 for (var e, n = [], r = 1; r < arguments.length; r++) n[r - 1] = arguments[r]; 17262 Uy.logLevel <= as.DEBUG && (e = n.map(Wy), Uy.debug.apply(Uy, no(["Firestore (8.3.2): " + t], e))) 17263 } 17264 17265 function By(t) { 17266 for (var e, n = [], r = 1; r < arguments.length; r++) n[r - 1] = arguments[r]; 17267 Uy.logLevel <= as.ERROR && (e = n.map(Wy), Uy.error.apply(Uy, no(["Firestore (8.3.2): " + t], e))) 17268 } 17269 17270 function Ky(t) { 17271 for (var e, n = [], r = 1; r < arguments.length; r++) n[r - 1] = arguments[r]; 17272 Uy.logLevel <= as.WARN && (e = n.map(Wy), Uy.warn.apply(Uy, no(["Firestore (8.3.2): " + t], e))) 17273 } 17274 17275 function Wy(e) { 17276 if ("string" == typeof e) return e; 17277 try { 17278 return JSON.stringify(e) 17279 } catch (t) { 17280 return e 17281 } 17282 } 17283 17284 function Hy(t) { 17285 t = "FIRESTORE (8.3.2) INTERNAL ASSERTION FAILED: " + (t = void 0 === t ? "Unexpected state" : t); 17286 throw By(t), new Error(t) 17287 } 17288 17289 function Gy(t) { 17290 t || Hy() 17291 } 17292 var zy = (Qy.u = function () { 17293 for (var t = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", e = Math.floor(256 / t.length) * t.length, n = ""; n.length < 20;) 17294 for (var r = function (t) { 17295 var e = "undefined" != typeof self && (self.crypto || self.msCrypto), 17296 n = new Uint8Array(t); 17297 if (e && "function" == typeof e.getRandomValues) e.getRandomValues(n); 17298 else 17299 for (var r = 0; r < t; r++) n[r] = Math.floor(256 * Math.random()); 17300 return n 17301 }(40), i = 0; i < r.length; ++i) n.length < 20 && r[i] < e && (n += t.charAt(r[i] % t.length)); 17302 return n 17303 }, Qy); 17304 17305 function Qy() {} 17306 17307 function Yy(t, e) { 17308 return t < e ? -1 : e < t ? 1 : 0 17309 } 17310 17311 function Xy(t, n, r) { 17312 return t.length === n.length && t.every(function (t, e) { 17313 return r(t, n[e]) 17314 }) 17315 } 17316 17317 function Jy(t) { 17318 return t + "\0" 17319 } 17320 var $y = (em.now = function () { 17321 return em.fromMillis(Date.now()) 17322 }, em.fromDate = function (t) { 17323 return em.fromMillis(t.getTime()) 17324 }, em.fromMillis = function (t) { 17325 var e = Math.floor(t / 1e3); 17326 return new em(e, 1e6 * (t - 1e3 * e)) 17327 }, em.prototype.toDate = function () { 17328 return new Date(this.toMillis()) 17329 }, em.prototype.toMillis = function () { 17330 return 1e3 * this.seconds + this.nanoseconds / 1e6 17331 }, em.prototype._compareTo = function (t) { 17332 return this.seconds === t.seconds ? Yy(this.nanoseconds, t.nanoseconds) : Yy(this.seconds, t.seconds) 17333 }, em.prototype.isEqual = function (t) { 17334 return t.seconds === this.seconds && t.nanoseconds === this.nanoseconds 17335 }, em.prototype.toString = function () { 17336 return "Timestamp(seconds=" + this.seconds + ", nanoseconds=" + this.nanoseconds + ")" 17337 }, em.prototype.toJSON = function () { 17338 return { 17339 seconds: this.seconds, 17340 nanoseconds: this.nanoseconds 17341 } 17342 }, em.prototype.valueOf = function () { 17343 var t = this.seconds - -62135596800; 17344 return String(t).padStart(12, "0") + "." + String(this.nanoseconds).padStart(9, "0") 17345 }, em), 17346 Zy = (tm.fromTimestamp = function (t) { 17347 return new tm(t) 17348 }, tm.min = function () { 17349 return new tm(new $y(0, 0)) 17350 }, tm.prototype.compareTo = function (t) { 17351 return this.timestamp._compareTo(t.timestamp) 17352 }, tm.prototype.isEqual = function (t) { 17353 return this.timestamp.isEqual(t.timestamp) 17354 }, tm.prototype.toMicroseconds = function () { 17355 return 1e6 * this.timestamp.seconds + this.timestamp.nanoseconds / 1e3 17356 }, tm.prototype.toString = function () { 17357 return "SnapshotVersion(" + this.timestamp.toString() + ")" 17358 }, tm.prototype.toTimestamp = function () { 17359 return this.timestamp 17360 }, tm); 17361 17362 function tm(t) { 17363 this.timestamp = t 17364 } 17365 17366 function em(t, e) { 17367 if (this.seconds = t, (this.nanoseconds = e) < 0) throw new Fy(My.INVALID_ARGUMENT, "Timestamp nanoseconds out of range: " + e); 17368 if (1e9 <= e) throw new Fy(My.INVALID_ARGUMENT, "Timestamp nanoseconds out of range: " + e); 17369 if (t < -62135596800) throw new Fy(My.INVALID_ARGUMENT, "Timestamp seconds out of range: " + t); 17370 if (253402300800 <= t) throw new Fy(My.INVALID_ARGUMENT, "Timestamp seconds out of range: " + t) 17371 } 17372 17373 function nm(t) { 17374 var e, n = 0; 17375 for (e in t) Object.prototype.hasOwnProperty.call(t, e) && n++; 17376 return n 17377 } 17378 17379 function rm(t, e) { 17380 for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && e(n, t[n]) 17381 } 17382 17383 function im(t) { 17384 for (var e in t) 17385 if (Object.prototype.hasOwnProperty.call(t, e)) return !1; 17386 return !0 17387 } 17388 var om, sm, Ga = (Object.defineProperty(gm.prototype, "length", { 17389 get: function () { 17390 return this.len 17391 }, 17392 enumerable: !1, 17393 configurable: !0 17394 }), gm.prototype.isEqual = function (t) { 17395 return 0 === gm.comparator(this, t) 17396 }, gm.prototype.child = function (t) { 17397 var e = this.segments.slice(this.offset, this.limit()); 17398 return t instanceof gm ? t.forEach(function (t) { 17399 e.push(t) 17400 }) : e.push(t), this.construct(e) 17401 }, gm.prototype.limit = function () { 17402 return this.offset + this.length 17403 }, gm.prototype.popFirst = function (t) { 17404 return t = void 0 === t ? 1 : t, this.construct(this.segments, this.offset + t, this.length - t) 17405 }, gm.prototype.popLast = function () { 17406 return this.construct(this.segments, this.offset, this.length - 1) 17407 }, gm.prototype.firstSegment = function () { 17408 return this.segments[this.offset] 17409 }, gm.prototype.lastSegment = function () { 17410 return this.get(this.length - 1) 17411 }, gm.prototype.get = function (t) { 17412 return this.segments[this.offset + t] 17413 }, gm.prototype.isEmpty = function () { 17414 return 0 === this.length 17415 }, gm.prototype.isPrefixOf = function (t) { 17416 if (t.length < this.length) return !1; 17417 for (var e = 0; e < this.length; e++) 17418 if (this.get(e) !== t.get(e)) return !1; 17419 return !0 17420 }, gm.prototype.isImmediateParentOf = function (t) { 17421 if (this.length + 1 !== t.length) return !1; 17422 for (var e = 0; e < this.length; e++) 17423 if (this.get(e) !== t.get(e)) return !1; 17424 return !0 17425 }, gm.prototype.forEach = function (t) { 17426 for (var e = this.offset, n = this.limit(); e < n; e++) t(this.segments[e]) 17427 }, gm.prototype.toArray = function () { 17428 return this.segments.slice(this.offset, this.limit()) 17429 }, gm.comparator = function (t, e) { 17430 for (var n = Math.min(t.length, e.length), r = 0; r < n; r++) { 17431 var i = t.get(r), 17432 o = e.get(r); 17433 if (i < o) return -1; 17434 if (o < i) return 1 17435 } 17436 return t.length < e.length ? -1 : t.length > e.length ? 1 : 0 17437 }, gm), 17438 am = (Xi(vm, sm = Ga), vm.prototype.construct = function (t, e, n) { 17439 return new vm(t, e, n) 17440 }, vm.prototype.canonicalString = function () { 17441 return this.toArray().join("/") 17442 }, vm.prototype.toString = function () { 17443 return this.canonicalString() 17444 }, vm.fromString = function () { 17445 for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e]; 17446 for (var n = [], r = 0, i = t; r < i.length; r++) { 17447 var o = i[r]; 17448 if (0 <= o.indexOf("//")) throw new Fy(My.INVALID_ARGUMENT, "Invalid segment (" + o + "). Paths must not contain // in them."); 17449 n.push.apply(n, o.split("/").filter(function (t) { 17450 return 0 < t.length 17451 })) 17452 } 17453 return new vm(n) 17454 }, vm.emptyPath = function () { 17455 return new vm([]) 17456 }, vm), 17457 um = /^[_a-zA-Z][_a-zA-Z0-9]*$/, 17458 cm = (Xi(dm, om = Ga), dm.prototype.construct = function (t, e, n) { 17459 return new dm(t, e, n) 17460 }, dm.isValidIdentifier = function (t) { 17461 return um.test(t) 17462 }, dm.prototype.canonicalString = function () { 17463 return this.toArray().map(function (t) { 17464 return t = t.replace(/\\/g, "\\\\").replace(/`/g, "\\`"), t = !dm.isValidIdentifier(t) ? "`" + t + "`" : t 17465 }).join(".") 17466 }, dm.prototype.toString = function () { 17467 return this.canonicalString() 17468 }, dm.prototype.isKeyField = function () { 17469 return 1 === this.length && "__name__" === this.get(0) 17470 }, dm.keyField = function () { 17471 return new dm(["__name__"]) 17472 }, dm.fromServerFormat = function (t) { 17473 for (var e = [], n = "", r = 0, i = function () { 17474 if (0 === n.length) throw new Fy(My.INVALID_ARGUMENT, "Invalid field path (" + t + "). Paths must not be empty, begin with '.', end with '.', or contain '..'"); 17475 e.push(n), n = "" 17476 }, o = !1; r < t.length;) { 17477 var s = t[r]; 17478 if ("\\" === s) { 17479 if (r + 1 === t.length) throw new Fy(My.INVALID_ARGUMENT, "Path has trailing escape character: " + t); 17480 var a = t[r + 1]; 17481 if ("\\" !== a && "." !== a && "`" !== a) throw new Fy(My.INVALID_ARGUMENT, "Path has invali
17481d escape sequence: " + t); 17482 n += a, r += 2 17483 } else "`" === s ? o = !o : "." !== s || o ? n += s : i(), r++ 17484 } 17485 if (i(), o) throw new Fy(My.INVALID_ARGUMENT, "Unterminated ` in path: " + t); 17486 return new dm(e) 17487 }, dm.emptyPath = function () { 17488 return new dm([]) 17489 }, dm), 17490 hm = (pm.prototype.covers = function (t) { 17491 for (var e = 0, n = this.fields; e < n.length; e++) 17492 if (n[e].isPrefixOf(t)) return !0; 17493 return !1 17494 }, pm.prototype.isEqual = function (t) { 17495 return Xy(this.fields, t.fields, function (t, e) { 17496 return t.isEqual(e) 17497 }) 17498 }, pm), 17499 lm = (fm.fromBase64String = function (t) { 17500 return new fm(atob(t)) 17501 }, fm.fromUint8Array = function (t) { 17502 return new fm(function (t) { 17503 for (var e = "", n = 0; n < t.length; ++n) e += String.fromCharCode(t[n]); 17504 return e 17505 }(t)) 17506 }, fm.prototype.toBase64 = function () { 17507 return t = this.binaryString, btoa(t); 17508 var t 17509 }, fm.prototype.toUint8Array = function () { 17510 return function (t) { 17511 for (var e = new Uint8Array(t.length), n = 0; n < t.length; n++) e[n] = t.charCodeAt(n); 17512 return e 17513 }(this.binaryString) 17514 }, fm.prototype.approximateByteSize = function () { 17515 return 2 * this.binaryString.length 17516 }, fm.prototype.compareTo = function (t) { 17517 return Yy(this.binaryString, t.binaryString) 17518 }, fm.prototype.isEqual = function (t) { 17519 return this.binaryString === t.binaryString 17520 }, fm); 17521 17522 function fm(t) { 17523 this.binaryString = t 17524 } 17525 17526 function pm(t) { 17527 (this.fields = t).sort(cm.comparator) 17528 } 17529 17530 function dm() { 17531 return null !== om && om.apply(this, arguments) || this 17532 } 17533 17534 function vm() { 17535 return null !== sm && sm.apply(this, arguments) || this 17536 } 17537 17538 function gm(t, e, n) { 17539 void 0 === e ? e = 0 : e > t.length && Hy(), void 0 === n ? n = t.length - e : n > t.length - e && Hy(), this.segments = t, this.offset = e, this.len = n 17540 } 17541 lm.EMPTY_BYTE_STRING = new lm(""); 17542 var ym = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/); 17543 17544 function mm(t) { 17545 if (Gy(!!t), "string" != typeof t) return { 17546 seconds: bm(t.seconds), 17547 nanos: bm(t.nanos) 17548 }; 17549 var e = 0, 17550 n = ym.exec(t); 17551 Gy(!!n), n[1] && (n = ((n = n[1]) + "000000000").substr(0, 9), e = Number(n)); 17552 t = new Date(t); 17553 return { 17554 seconds: Math.floor(t.getTime() / 1e3), 17555 nanos: e 17556 } 17557 } 17558 17559 function bm(t) { 17560 return "number" == typeof t ? t : "string" == typeof t ? Number(t) : 0 17561 } 17562 17563 function wm(t) { 17564 return "string" == typeof t ? lm.fromBase64String(t) : lm.fromUint8Array(t) 17565 } 17566 17567 function _m(t) { 17568 return "server_timestamp" === (null === (t = ((null === (t = null == t ? void 0 : t.mapValue) || void 0 === t ? void 0 : t.fields) || {}).__type__) || void 0 === t ? void 0 : t.stringValue) 17569 } 17570 17571 function Im(t) { 17572 t = mm(t.mapValue.fields.__local_write_time__.timestampValue); 17573 return new $y(t.seconds, t.nanos) 17574 } 17575 17576 function Tm(t) { 17577 return null == t 17578 } 17579 17580 function Em(t) { 17581 return 0 === t && 1 / t == -1 / 0 17582 } 17583 17584 function Sm(t) { 17585 return "number" == typeof t && Number.isInteger(t) && !Em(t) && t <= Number.MAX_SAFE_INTEGER && t >= Number.MIN_SAFE_INTEGER 17586 } 17587 var Cm = (Nm.fromPath = function (t) { 17588 return new Nm(am.fromString(t)) 17589 }, Nm.fromName = function (t) { 17590 return new Nm(am.fromString(t).popFirst(5)) 17591 }, Nm.prototype.hasCollectionId = function (t) { 17592 return 2 <= this.path.length && this.path.get(this.path.length - 2) === t 17593 }, Nm.prototype.isEqual = function (t) { 17594 return null !== t && 0 === am.comparator(this.path, t.path) 17595 }, Nm.prototype.toString = function () { 17596 return this.path.toString() 17597 }, Nm.comparator = function (t, e) { 17598 return am.comparator(t.path, e.path) 17599 }, Nm.isDocumentKey = function (t) { 17600 return t.length % 2 == 0 17601 }, Nm.fromSegments = function (t) { 17602 return new Nm(new am(t.slice())) 17603 }, Nm); 17604 17605 function Nm(t) { 17606 this.path = t 17607 } 17608 17609 function Am(t) { 17610 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 ? _m(t) ? 4 : 10 : Hy() 17611 } 17612 17613 function km(r, i) { 17614 var t, e, n = Am(r); 17615 if (n !== Am(i)) return !1; 17616 switch (n) { 17617 case 0: 17618 return !0; 17619 case 1: 17620 return r.booleanValue === i.booleanValue; 17621 case 4: 17622 return Im(r).isEqual(Im(i)); 17623 case 3: 17624 return function (t) { 17625 if ("string" == typeof r.timestampValue && "string" == typeof t.timestampValue && r.timestampValue.length === t.timestampValue.length) return r.timestampValue === t.timestampValue; 17626 var e = mm(r.timestampValue), 17627 t = mm(t.timestampValue); 17628 return e.seconds === t.seconds && e.nanos === t.nanos 17629 }(i); 17630 case 5: 17631 return r.stringValue === i.stringValue; 17632 case 6: 17633 return e = i, wm(r.bytesValue).isEqual(wm(e.bytesValue)); 17634 case 7: 17635 return r.referenceValue === i.referenceValue; 17636 case 8: 17637 return t = i, bm((e = r).geoPointValue.latitude) === bm(t.geoPointValue.latitude) && bm(e.geoPointValue.longitude) === bm(t.geoPointValue.longitude); 17638 case 2: 17639 return function (t, e) { 17640 if ("integerValue" in t && "integerValue" in e) return bm(t.integerValue) === bm(e.integerValue); 17641 if ("doubleValue" in t && "doubleValue" in e) { 17642 t = bm(t.doubleValue), e = bm(e.doubleValue); 17643 return t === e ? Em(t) === Em(e) : isNaN(t) && isNaN(e) 17644 } 17645 return !1 17646 }(r, i); 17647 case 9: 17648 return Xy(r.arrayValue.values || [], i.arrayValue.values || [], km); 17649 case 10: 17650 return function () { 17651 var t, e = r.mapValue.fields || {}, 17652 n = i.mapValue.fields || {}; 17653 if (nm(e) !== nm(n)) return !1; 17654 for (t in e) 17655 if (e.hasOwnProperty(t) && (void 0 === n[t] || !km(e[t], n[t]))) return !1; 17656 return !0 17657 }(); 17658 default: 17659 return Hy() 17660 } 17661 } 17662 17663 function Rm(t, e) { 17664 return void 0 !== (t.values || []).find(function (t) { 17665 return km(t, e) 17666 }) 17667 } 17668 17669 function Pm(t, e) { 17670 var n, r, i, o = Am(t), 17671 s = Am(e); 17672 if (o !== s) return Yy(o, s); 17673 switch (o) { 17674 case 0: 17675 return 0; 17676 case 1: 17677 return Yy(t.booleanValue, e.booleanValue); 17678 case 2: 17679 return r = e, i = bm(t.integerValue || t.doubleValue), r = bm(r.integerValue || r.doubleValue), i < r ? -1 : r < i ? 1 : i === r ? 0 : isNaN(i) ? isNaN(r) ? 0 : -1 : 1; 17680 case 3: 17681 return Om(t.timestampValue, e.timestampValue); 17682 case 4: 17683 return Om(Im(t), Im(e)); 17684 case 5: 17685 return Yy(t.stringValue, e.stringValue); 17686 case 6: 17687 return function (t, e) { 17688 t = wm(t), e = wm(e); 17689 return t.compareTo(e) 17690 }(t.bytesValue, e.bytesValue); 17691 case 7: 17692 return function (t, e) { 17693 for (var n = t.split("/"), r = e.split("/"), i = 0; i < n.length && i < r.length; i++) { 17694 var o = Yy(n[i], r[i]); 17695 if (0 !== o) return o 17696 } 17697 return Yy(n.length, r.length) 17698 }(t.referenceValue, e.referenceValue); 17699 case 8: 17700 return n = t.geoPointValue, i = e.geoPointValue, 0 !== (r = Yy(bm(n.latitude), bm(i.latitude))) ? r : Yy(bm(n.longitude), bm(i.longitude)); 17701 case 9: 17702 return function (t, e) { 17703 for (var n = t.values || [], r = e.values || [], i = 0; i < n.length && i < r.length; ++i) { 17704 var o = Pm(n[i], r[i]); 17705 if (o) return o 17706 } 17707 return Yy(n.length, r.length) 17708 }(t.arrayValue, e.arrayValue); 17709 case 10: 17710 return function (t, e) { 17711 var n = t.fields || {}, 17712 r = Object.keys(n), 17713 i = e.fields || {}, 17714 o = Object.keys(i); 17715 r.sort(), o.sort(); 17716 for (var s = 0; s < r.length && s < o.length; ++s) { 17717 var a = Yy(r[s], o[s]); 17718 if (0 !== a) return a; 17719 a = Pm(n[r[s]], i[o[s]]); 17720 if (0 !== a) return a 17721 } 17722 return Yy(r.length, o.length) 17723 }(t.mapValue, e.mapValue); 17724 default: 17725 throw Hy() 17726 } 17727 } 17728
17729 function Om(t, e) { 17730 if ("string" == typeof t && "string" == typeof e && t.length === e.length) return Yy(t, e); 17731 var n = mm(t), 17732 t = mm(e), 17733 e = Yy(n.seconds, t.seconds); 17734 return 0 !== e ? e : Yy(n.nanos, t.nanos) 17735 } 17736 17737 function Dm(t) { 17738 return function s(t) { 17739 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) { 17740 var t = mm(t); 17741 return "time(" + t.seconds + "," + t.nanos + ")" 17742 }(t.timestampValue) : "stringValue" in t ? t.stringValue : "bytesValue" in t ? wm(t.bytesValue).toBase64() : "referenceValue" in t ? (e = t.referenceValue, Cm.fromName(e).toString()) : "geoPointValue" in t ? "geo(" + (e = t.geoPointValue).latitude + "," + e.longitude + ")" : "arrayValue" in t ? function (t) { 17743 for (var e = "[", n = !0, r = 0, i = t.values || []; r < i.length; r++) n ? n = !1 : e += ",", e += s(i[r]); 17744 return e + "]" 17745 }(t.arrayValue) : "mapValue" in t ? function (t) { 17746 for (var e = "{", n = !0, r = 0, i = Object.keys(t.fields || {}).sort(); r < i.length; r++) { 17747 var o = i[r]; 17748 n ? n = !1 : e += ",", e += o + ":" + s(t.fields[o]) 17749 } 17750 return e + "}" 17751 }(t.mapValue) : Hy(); 17752 var e 17753 }(t) 17754 } 17755 17756 function xm(t, e) { 17757 return { 17758 referenceValue: "projects/" + t.projectId + "/databases/" + t.database + "/documents/" + e.path.canonicalString() 17759 } 17760 } 17761 17762 function Lm(t) { 17763 return t && "integerValue" in t 17764 } 17765 17766 function Mm(t) { 17767 return !!t && "arrayValue" in t 17768 } 17769 17770 function Fm(t) { 17771 return t && "nullValue" in t 17772 } 17773 17774 function Um(t) { 17775 return t && "doubleValue" in t && isNaN(Number(t.doubleValue)) 17776 } 17777 17778 function jm(t) { 17779 return t && "mapValue" in t 17780 } 17781 var qm = (Vm.empty = function () { 17782 return new Vm({ 17783 mapValue: {} 17784 }) 17785 }, Vm.prototype.field = function (t) { 17786 return Vm.extractNestedValue(this.buildProto(), t) 17787 }, Vm.prototype.toProto = function () { 17788 return this.field(cm.emptyPath()) 17789 }, Vm.prototype.set = function (t, e) { 17790 this.setOverlay(t, e) 17791 }, Vm.prototype.setAll = function (t) { 17792 var n = this; 17793 t.forEach(function (t, e) { 17794 t ? n.set(e, t) : n.delete(e) 17795 }) 17796 }, Vm.prototype.delete = function (t) { 17797 this.setOverlay(t, null) 17798 }, Vm.prototype.isEqual = function (t) { 17799 return km(this.buildProto(), t.buildProto()) 17800 }, Vm.prototype.setOverlay = function (t, e) { 17801 for (var n = this.overlayMap, r = 0; r < t.length - 1; ++r) var i = t.get(r), 17802 o = n.get(i), 17803 n = (o instanceof Map || (o = o && 10 === Am(o) ? new Map(Object.entries(o.mapValue.fields || {})) : new Map, n.set(i, o)), o); 17804 n.set(t.lastSegment(), e) 17805 }, Vm.prototype.applyOverlay = function (r, t) { 17806 var i = this, 17807 o = !1, 17808 e = Vm.extractNestedValue(this.partialValue, r), 17809 s = jm(e) ? Object.assign({}, e.mapValue.fields) : {}; 17810 return t.forEach(function (t, e) { 17811 var n; 17812 t instanceof Map ? null != (n = i.applyOverlay(r.child(e), t)) && (s[e] = n, o = !0) : null !== t ? (s[e] = t, o = !0) : s.hasOwnProperty(e) && (delete s[e], o = !0) 17813 }), o ? { 17814 mapValue: { 17815 fields: s 17816 } 17817 } : null 17818 }, Vm.prototype.buildProto = function () { 17819 var t = this.applyOverlay(cm.emptyPath(), this.overlayMap); 17820 return null != t && (this.partialValue = t, this.overlayMap.clear()), this.partialValue 17821 }, Vm.extractNestedValue = function (t, e) { 17822 if (e.isEmpty()) return t; 17823 for (var n = t, r = 0; r < e.length - 1; ++r) { 17824 if (!n.mapValue.fields) return null; 17825 if (!jm(n = n.mapValue.fields[e.get(r)])) return null 17826 } 17827 return (n = (n.mapValue.fields || {})[e.lastSegment()]) || null 17828 }, Vm.prototype.clone = function () { 17829 return new Vm(this.buildProto()) 17830 }, Vm); 17831 17832 function Vm(t) { 17833 this.overlayMap = new Map, this.partialValue = t 17834 } 17835 var Bm = (Wm.newInvalidDocument = function (t) { 17836 return new Wm(t, 0, Zy.min(), qm.empty(), 0) 17837 }, Wm.newFoundDocument = function (t, e, n) { 17838 return new Wm(t, 1, e, n, 0) 17839 }, Wm.newNoDocument = function (t, e) { 17840 return new Wm(t, 2, e, qm.empty(), 0) 17841 }, Wm.newUnknownDocument = function (t, e) { 17842 return new Wm(t, 3, e, qm.empty(), 2) 17843 }, Wm.prototype.convertToFoundDocument = function (t, e) { 17844 return this.version = t, this.documentType = 1, this.data = e, this.documentState = 0, this 17845 }, Wm.prototype.convertToNoDocument = function (t) { 17846 return this.version = t, this.documentType = 2, this.data = qm.empty(), this.documentState = 0, this 17847 }, Wm.prototype.convertToUnknownDocument = function (t) { 17848 return this.version = t, this.documentType = 3, this.data = qm.empty(), this.documentState = 2, this 17849 }, Wm.prototype.setHasCommittedMutations = function () { 17850 return this.documentState = 2, this 17851 }, Wm.prototype.setHasLocalMutations = function () { 17852 return this.documentState = 1, this 17853 }, Object.defineProperty(Wm.prototype, "hasLocalMutations", { 17854 get: function () { 17855 return 1 === this.documentState 17856 }, 17857 enumerable: !1, 17858 configurable: !0 17859 }), Object.defineProperty(Wm.prototype, "hasCommittedMutations", { 17860 get: function () { 17861 return 2 === this.documentState 17862 }, 17863 enumerable: !1, 17864 configurable: !0 17865 }), Object.defineProperty(Wm.prototype, "hasPendingWrites", { 17866 get: function () { 17867 return this.hasLocalMutations || this.hasCommittedMutations 17868 }, 17869 enumerable: !1, 17870 configurable: !0 17871 }), Wm.prototype.isValidDocument = function () { 17872 return 0 !== this.documentType 17873 }, Wm.prototype.isFoundDocument = function () { 17874 return 1 === this.documentType 17875 }, Wm.prototype.isNoDocument = function () { 17876 return 2 === this.documentType 17877 }, Wm.prototype.isUnknownDocument = function () { 17878 return 3 === this.documentType 17879 }, Wm.prototype.isEqual = function (t) { 17880 return t instanceof Wm && this.key.isEqual(t.key) && this.version.isEqual(t.version) && this.documentType === t.documentType && this.documentState === t.documentState && this.data.isEqual(t.data) 17881 }, Wm.prototype.clone = function () { 17882 return new Wm(this.key, this.documentType, this.version, this.data.clone(), this.documentState) 17883 }, Wm.prototype.toString = function () { 17884 return "Document(" + this.key + ", " + this.version + ", " + JSON.stringify(this.data.toProto()) + ", {documentType: " + this.documentType + "}), {documentState: " + this.documentState + "})" 17885 }, Wm), 17886 Km = function (t, e, n, r, i, o, s) { 17887 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 === s && (s = null), this.path = t, this.collectionGroup = e, this.orderBy = n, this.filters = r, this.limit = i, this.startAt = o, this.endAt = s, this.h = null 17888 }; 17889 17890 function Wm(t, e, n, r, i) { 17891 this.key = t, this.documentType = e, this.version = n, this.data = r, this.documentState = i 17892 } 17893 17894 function Hm(t, e, n, r, i, o, s) { 17895 return new Km(t, e = void 0 === e ? null : e, n = void 0 === n ? [] : n, r = void 0 === r ? [] : r, i = void 0 === i ? null : i, o = void 0 === o ? null : o, s = void 0 === s ? null : s) 17896 } 17897 17898 function Gm(t) { 17899 var e = t; 17900 return null === e.h && (t = e.path.canonicalString(), null !== e.collectionGroup && (t += "|cg:" + e.collectionGroup), t += "|f:", t += e.filters.map(function (t) { 17901 return (t = t).field.canonicalString() + t.op.toString() + Dm(t.value) 17902 }).join(","), t += "|ob:", t += e.orderBy.map(function (t) { 17903 return (t = t).field.canonicalString() + t.dir 17904 }).join(","), Tm(e.limit) || (t += "|l:", t += e.limit), e.startAt && (t += "|lb:", t += _b(e.startAt)), e.endAt && (t += "|ub:", t += _b(e.endAt)), e.h = t), e.h 17905 } 17906 17907 function zm(t, e) { 17908 if (t.limit !== e.limit) return !1; 17909 if (t.orderBy.length !== e.orderBy.length) return !1; 17910 for (var n, r, i = 0; i < t.orderBy.length; i++) 17911 if (n = t.orderBy[i], r = e.orderBy[i], n.dir !== r.dir || !n.field.isEqual(r.field)) return !1; 17912 if (t.filters.length !== e.filters.length) return !1; 17913 for (var o, s, a = 0; a < t.filters.length; a++) 17914 if (o = t.filters[a], s = e.filters[a], o.op !== s.op || !o.field.isEqual(s.field) || !km(o.value, s.value)) return !1; 17915 return t.collectionGroup === e.collectionGroup && !!t.path.isEqual(e.path) && !!Eb(t.startAt, e.startAt) && Eb(t.endAt, e.endAt) 17916 } 17917 17918 function Qm(t) { 17919 return Cm.isDocumentKey(t.path) && null === t.collectionGroup && 0 === t.filters.length 17920 } 17921 var Ym, Xm = (Xi(Jm, Ym = function () {}), Jm.create = function (t, e, n) { 17922 return t.isKeyField() ? "in" === e || "not-in" === e ? this.l(t, e, n) : new eb(t, e, n) : "array-contains" === e ? new fb(t, n) : "in" === e ? new pb(t, n) : "not-in" === e ? new db(t, n) : "array-contains-any" === e ? new vb(t, n) : new Jm(t, e, n) 17923 }, Jm.l = function (t, e, n) { 17924 return new("in" === e ? nb : rb)(t, n) 17925 }, Jm.prototype.matches = function (t) { 17926 t = t.data.field(this.field); 17927 return "!=" === this.op ? null !== t && this.m(Pm(t, this.value)) : null !== t && Am(this.value) === Am(t) && this.m(Pm(t, this.value)) 17928 }, Jm.prototype.m = function (t) { 17929 switch (this.op) { 17930 case "<": 17931 return t < 0; 17932 case "<=": 17933 return t <= 0; 17934 case "==": 17935 return 0 === t; 17936 case "!=": 17937 return 0 !== t; 17938 case ">": 17939 return 0 < t; 17940 case ">=": 17941 return 0 <= t; 17942 default: 17943 return Hy() 17944 } 17945 }, Jm.prototype.g = function () { 17946 return 0 <= ["<", "<=", ">", ">=", "!=", "not-in"].indexOf(this.op) 17947 }, Jm); 17948 17949 function Jm(t, e, n) { 17950 var r = this; 17951 return (r = Ym.call(this) || this).field = t, r.op = e, r.value = n, r 17952 } 17953 var $m, Zm, tb, eb = (Xi(sb, tb = Xm), sb.prototype.matches = function (t) { 17954 t = Cm.comparator(t.key, this.key); 17955 return this.m(t) 17956 }, sb), 17957 nb = (Xi(ob, Zm = Xm), ob.prototype.matches = function (e) { 17958 return this.keys.some(function (t) { 17959 return t.isEqual(e.key) 17960 }) 17961 }, ob),
17962 rb = (Xi(ib, $m = Xm), ib.prototype.matches = function (e) { 17963 return !this.keys.some(function (t) { 17964 return t.isEqual(e.key) 17965 }) 17966 }, ib); 17967 17968 function ib(t, e) { 17969 var n = this; 17970 return (n = $m.call(this, t, "not-in", e) || this).keys = ab(0, e), n 17971 } 17972 17973 function ob(t, e) { 17974 var n = this; 17975 return (n = Zm.call(this, t, "in", e) || this).keys = ab(0, e), n 17976 } 17977 17978 function sb(t, e, n) { 17979 var r = this; 17980 return (r = tb.call(this, t, e, n) || this).key = Cm.fromName(n.referenceValue), r 17981 } 17982 17983 function ab(t, e) { 17984 return ((null === (e = e.arrayValue) || void 0 === e ? void 0 : e.values) || []).map(function (t) { 17985 return Cm.fromName(t.referenceValue) 17986 }) 17987 } 17988 var ub, cb, hb, lb, fb = (Xi(wb, lb = Xm), wb.prototype.matches = function (t) { 17989 t = t.data.field(this.field); 17990 return Mm(t) && Rm(t.arrayValue, this.value) 17991 }, wb), 17992 pb = (Xi(bb, hb = Xm), bb.prototype.matches = function (t) { 17993 t = t.data.field(this.field); 17994 return null !== t && Rm(this.value.arrayValue, t) 17995 }, bb), 17996 db = (Xi(mb, cb = Xm), mb.prototype.matches = function (t) { 17997 if (Rm(this.value.arrayValue, { 17998 nullValue: "NULL_VALUE" 17999 })) return !1; 18000 t = t.data.field(this.field); 18001 return null !== t && !Rm(this.value.arrayValue, t) 18002 }, mb), 18003 vb = (Xi(yb, ub = Xm), yb.prototype.matches = function (t) { 18004 var e = this, 18005 t = t.data.field(this.field); 18006 return !(!Mm(t) || !t.arrayValue.values) && t.arrayValue.values.some(function (t) { 18007 return Rm(e.value.arrayValue, t) 18008 }) 18009 }, yb), 18010 gb = function (t, e) { 18011 this.position = t, this.before = e 18012 }; 18013 18014 function yb(t, e) { 18015 return ub.call(this, t, "array-contains-any", e) || this 18016 } 18017 18018 function mb(t, e) { 18019 return cb.call(this, t, "not-in", e) || this 18020 } 18021 18022 function bb(t, e) { 18023 return hb.call(this, t, "in", e) || this 18024 } 18025 18026 function wb(t, e) { 18027 return lb.call(this, t, "array-contains", e) || this 18028 } 18029 18030 function _b(t) { 18031 return (t.before ? "b" : "a") + ":" + t.position.map(Dm).join(",") 18032 } 18033 var Ib = function (t, e) { 18034 void 0 === e && (e = "asc"), this.field = t, this.dir = e 18035 }; 18036 18037 function Tb(t, e, n) { 18038 for (var r = 0, i = 0; i < t.position.length; i++) { 18039 var o = e[i], 18040 s = t.position[i], 18041 r = o.field.isKeyField() ? Cm.comparator(Cm.fromName(s.referenceValue), n.key) : Pm(s, n.data.field(o.field)); 18042 if ("desc" === o.dir && (r *= -1), 0 !== r) break 18043 } 18044 return t.before ? r <= 0 : r < 0 18045 } 18046 18047 function Eb(t, e) { 18048 if (null === t) return null === e; 18049 if (null === e) return !1; 18050 if (t.before !== e.before || t.position.length !== e.position.length) return !1; 18051 for (var n = 0; n < t.position.length; n++) 18052 if (!km(t.position[n], e.position[n])) return !1; 18053 return !0 18054 } 18055 var Sb = function (t, e, n, r, i, o, s, a) { 18056 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 === s && (s = null), void 0 === a && (a = null), this.path = t, this.collectionGroup = e, this.explicitOrderBy = n, this.filters = r, this.limit = i, this.limitType = o, this.startAt = s, this.endAt = a, this.p = null, this.T = null, this.startAt, this.endAt 18057 }; 18058 18059 function Cb(t, e, n, r, i, o, s, a) { 18060 return new Sb(t, e, n, r, i, o, s, a) 18061 } 18062 18063 function Nb(t) { 18064 return new Sb(t) 18065 } 18066 18067 function Ab(t) { 18068 return !Tm(t.limit) && "F" === t.limitType 18069 } 18070 18071 function kb(t) { 18072 return !Tm(t.limit) && "L" === t.limitType 18073 } 18074 18075 function Rb(t) { 18076 return 0 < t.explicitOrderBy.length ? t.explicitOrderBy[0].field : null 18077 } 18078 18079 function Pb(t) { 18080 for (var e = 0, n = t.filters; e < n.length; e++) { 18081 var r = n[e]; 18082 if (r.g()) return r.field 18083 } 18084 return null 18085 } 18086 18087 function Ob(t) { 18088 return null !== t.collectionGroup 18089 } 18090 18091 function Db(t) { 18092 var e = t; 18093 if (null === e.p) { 18094 e.p = []; 18095 var n = Pb(e), 18096 t = Rb(e); 18097 if (null !== n && null === t) n.isKeyField() || e.p.push(new Ib(n)), e.p.push(new Ib(cm.keyField(), "asc")); 18098 else { 18099 for (var r = !1, i = 0, o = e.explicitOrderBy; i < o.length; i++) { 18100 var s = o[i]; 18101 e.p.push(s), s.field.isKeyField() && (r = !0) 18102 } 18103 r || (n = 0 < e.explicitOrderBy.length ? e.explicitOrderBy[e.explicitOrderBy.length - 1].dir : "asc", e.p.push(new Ib(cm.keyField(), n))) 18104 } 18105 } 18106 return e.p 18107 } 18108 18109 function xb(t) { 18110 var e = t; 18111 if (!e.T) 18112 if ("F" === e.limitType) e.T = Hm(e.path, e.collectionGroup, Db(e), e.filters, e.limit, e.startAt, e.endAt); 18113 else { 18114 for (var n = [], r = 0, i = Db(e); r < i.length; r++) { 18115 var o = i[r], 18116 s = "desc" === o.dir ? "asc" : "desc"; 18117 n.push(new Ib(o.field, s)) 18118 } 18119 var a = e.endAt ? new gb(e.endAt.position, !e.endAt.before) : null, 18120 t = e.startAt ? new gb(e.startAt.position, !e.startAt.before) : null; 18121 e.T = Hm(e.path, e.collectionGroup, n, e.filters, e.limit, a, t) 18122 } return e.T 18123 } 18124
18125 function Lb(t, e, n) { 18126 return new Sb(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), e, n, t.startAt, t.endAt) 18127 } 18128 18129 function Mb(t, e) { 18130 return zm(xb(t), xb(e)) && t.limitType === e.limitType 18131 } 18132 18133 function Fb(t) { 18134 return Gm(xb(t)) + "|lt:" + t.limitType 18135 } 18136 18137 function Ub(t) { 18138 return "Query(target=" + (e = xb(t), n = e.path.canonicalString(), null !== e.collectionGroup && (n += " collectionGroup=" + e.collectionGroup), 0 < e.filters.length && (n += ", filters: [" + e.filters.map(function (t) { 18139 return (t = t).field.canonicalString() + " " + t.op + " " + Dm(t.value) 18140 }).join(", ") + "]"), Tm(e.limit) || (n += ", limit: " + e.limit), 0 < e.orderBy.length && (n += ", orderBy: [" + e.orderBy.map(function (t) { 18141 return (t = t).field.canonicalString() + " (" + t.dir + ")" 18142 }).join(", ") + "]"), e.startAt && (n += ", startAt: " + _b(e.startAt)), e.endAt && (n += ", endAt: " + _b(e.endAt)), "Target(" + n + ")") + "; limitType=" + t.limitType + ")"; 18143 var e, n 18144 } 18145 18146 function jb(i, t) { 18147 return t.isFoundDocument() && (e = i, n = t.key.path, null !== e.collectionGroup ? t.key.hasCollectionId(e.collectionGroup) && e.path.isPrefixOf(n) : Cm.isDocumentKey(e.path) ? e.path.isEqual(n) : e.path.isImmediateParentOf(n)) && function (t) { 18148 for (var e = 0, n = i.explicitOrderBy; e < n.length; e++) { 18149 var r = n[e]; 18150 if (!r.field.isKeyField() && null === t.data.field(r.field)) return 18151 } 18152 return 1 18153 }(t) && function (t) { 18154 for (var e = 0, n = i.filters; e < n.length; e++) 18155 if (!n[e].matches(t)) return; 18156 return 1 18157 }(t) && (n = t, (!(t = i).startAt || Tb(t.startAt, Db(t), n)) && (!t.endAt || !Tb(t.endAt, Db(t), n))); 18158 var e, n 18159 } 18160 18161 function qb(a) { 18162 return function (t, e) { 18163 for (var n = !1, r = 0, i = Db(a); r < i.length; r++) { 18164 var o = i[r], 18165 s = function (t, r, e) { 18166 var n = t.field.isKeyField() ? Cm.comparator(r.key, e.key) : function (t, e) { 18167 var n = r.data.field(t), 18168 t = e.data.field(t); 18169 return null !== n && null !== t ? Pm(n, t) : Hy() 18170 }(t.field, e); 18171 switch (t.dir) { 18172 case "asc": 18173 return n; 18174 case "desc": 18175 return -1 * n; 18176 default: 18177 return Hy() 18178 } 18179 }(o, t, e); 18180 if (0 !== s) return s; 18181 n = n || o.field.isKeyField() 18182 } 18183 return 0 18184 } 18185 } 18186 18187 function Vb(t, e) { 18188 if (t.I) { 18189 if (isNaN(e)) return { 18190 doubleValue: "NaN" 18191 }; 18192 if (e === 1 / 0) return { 18193 doubleValue: "Infinity" 18194 }; 18195 if (e === -1 / 0) return { 18196 doubleValue: "-Infinity" 18197 } 18198 } 18199 return { 18200 doubleValue: Em(e) ? "-0" : e 18201 } 18202 } 18203 18204 function Bb(t) { 18205 return { 18206 integerValue: "" + t 18207 } 18208 } 18209 18210 function Kb(t, e) { 18211 return Sm(e) ? Bb(e) : Vb(t, e) 18212 } 18213 Sn = function () { 18214 this._ = void 0 18215 }; 18216 18217 function Wb(t, e) { 18218 return t instanceof rw ? Lm(t = e) || t && "doubleValue" in t ? e : { 18219 integerValue: 0 18220 } : null 18221 } 18222 var Hb, Gb, zb = (Xi(Xb, Gb = Sn), Xb), 18223 Qb = (Xi(Yb, Hb = Sn), Yb); 18224 18225 function Yb(t) { 18226 var e = this; 18227 return (e = Hb.call(this) || this).elements = t, e 18228 } 18229 18230 function Xb() { 18231 return null !== Gb && Gb.apply(this, arguments) || this 18232 } 18233 18234 function Jb(t, e) { 18235 for (var n = sw(e), r = 0, i = t.elements; r < i.length; r++) ! function (e) { 18236 n.some(function (t) { 18237 return km(t, e) 18238 }) || n.push(e) 18239 }(i[r]); 18240 return { 18241 arrayValue: { 18242 values: n 18243 } 18244 } 18245 } 18246 var $b, Zb = (Xi(tw, $b = Sn), tw); 18247 18248 function tw(t) { 18249 var e = this; 18250 return (e = $b.call(this) || this).elements = t, e 18251 } 18252 18253 function ew(t, e) { 18254 for (var n = sw(e), r = 0, i = t.elements; r < i.length; r++) ! function (e) { 18255 n = n.filter(function (t) { 18256 return !km(t, e) 18257 }) 18258 }(i[r]); 18259 return { 18260 arrayValue: { 18261 values: n 18262 } 18263 } 18264 } 18265 var nw, rw = (Xi(iw, nw = Sn), iw); 18266 18267 function iw(t, e) { 18268 var n = this; 18269 return (n = nw.call(this) || this).R = t, n.A = e, n 18270 } 18271 18272 function ow(t) { 18273 return bm(t.integerValue || t.doubleValue) 18274 } 18275 18276 function sw(t) { 18277 return Mm(t) && t.arrayValue.values ? t.arrayValue.values.slice() : [] 18278 } 18279 18280 function aw(t, e) { 18281 this.version = t, this.transformResults = e 18282 } 18283 var uw = function (t, e) { 18284 this.field = t, this.transform = e 18285 }, 18286 cw = (hw.none = function () { 18287 return new hw 18288 }, hw.exists = function (t) { 18289 return new hw(void 0, t) 18290 }, hw.updateTime = function (t) { 18291 return new hw(t) 18292 }, Object.defineProperty(hw.prototype, "isNone", { 18293 get: function () { 18294 return void 0 === this.updateTime && void 0 === this.exists 18295 }, 18296 enumerable: !1, 18297 configurable: !0 18298 }), hw.prototype.isEqual = function (t) { 18299 return this.exists === t.exists && (this.updateTime ? !!t.updateTime && this.updateTime.isEqual(t.updateTime) : !t.updateTime) 18300 }, hw); 18301 18302 function hw(t, e) { 18303 this.updateTime = t, this.exists = e
18304 } 18305 18306 function lw(t, e) { 18307 return void 0 !== t.updateTime ? e.isFoundDocument() && e.version.isEqual(t.updateTime) : void 0 === t.exists || t.exists === e.isFoundDocument() 18308 } 18309 Ga = function () {}; 18310 18311 function fw(t, e, n) { 18312 var r, i, o, s; 18313 t instanceof yw ? (i = e, o = n, lw((r = t).precondition, i) && (s = r.value.clone(), o = Tw(r.fieldTransforms, o, i), s.setAll(o), i.convertToFoundDocument(dw(i), s).setHasLocalMutations())) : t instanceof mw ? (o = e, i = n, lw((s = t).precondition, o) && (n = Tw(s.fieldTransforms, i, o), (i = o.data).setAll(_w(s)), i.setAll(n), o.convertToFoundDocument(dw(o), i).setHasLocalMutations())) : (e = e, lw(t.precondition, e) && e.convertToNoDocument(Zy.min())) 18314 } 18315 18316 function pw(t, e) { 18317 return t.type === e.type && !!t.key.isEqual(e.key) && !!t.precondition.isEqual(e.precondition) && (n = t.fieldTransforms, r = e.fieldTransforms, !!(void 0 === n && void 0 === r || n && r && Xy(n, r, function (t, e) { 18318 return e = e, (t = t).field.isEqual(e.field) && (t = t.transform, e = e.transform, t instanceof Qb && e instanceof Qb || t instanceof Zb && e instanceof Zb ? Xy(t.elements, e.elements, km) : t instanceof rw && e instanceof rw ? km(t.A, e.A) : t instanceof zb && e instanceof zb) 18319 }))) && (0 === t.type ? t.value.isEqual(e.value) : 1 !== t.type || t.data.isEqual(e.data) && t.fieldMask.isEqual(e.fieldMask)); 18320 var n, r 18321 } 18322 18323 function dw(t) { 18324 return t.isFoundDocument() ? t.version : Zy.min() 18325 } 18326 var vw, gw, yw = (Xi(ww, gw = Ga), ww), 18327 mw = (Xi(bw, vw = Ga), bw); 18328 18329 function bw(t, e, n, r, i) { 18330 void 0 === i && (i = []); 18331 var o = this; 18332 return (o = vw.call(this) || this).key = t, o.data = e, o.fieldMask = n, o.precondition = r, o.fieldTransforms = i, o.type = 1, o 18333 } 18334 18335 function ww(t, e, n, r) { 18336 void 0 === r && (r = []); 18337 var i = this; 18338 return (i = gw.call(this) || this).key = t, i.value = e, i.precondition = n, i.fieldTransforms = r, i.type = 0, i 18339 } 18340 18341 function _w(n) { 18342 var r = new Map; 18343 return n.fieldMask.fields.forEach(function (t) { 18344 var e; 18345 t.isEmpty() || (e = n.data.field(t), r.set(t, e)) 18346 }), r 18347 } 18348 18349 function Iw(t, e, n) { 18350 var r = new Map; 18351 Gy(t.length === n.length); 18352 for (var i = 0; i < n.length; i++) { 18353 var o = t[i], 18354 s = o.transform, 18355 a = e.data.field(o.field); 18356 r.set(o.field, (o = s, s = a, a = n[i], o instanceof Qb ? Jb(o, s) : o instanceof Zb ? ew(o, s) : a)) 18357 } 18358 return r 18359 } 18360 18361 function Tw(t, e, n) { 18362 for (var r, i = new Map, o = 0, s = t; o < s.length; o++) { 18363 var a = s[o], 18364 u = a.transform, 18365 c = n.data.field(a.field); 18366 i.set(a.field, (r = c, a = e, c = void 0, (u = u) instanceof zb ? (c = { 18367 fields: { 18368 __type__: { 18369 stringValue: "server_timestamp" 18370 }, 18371 __local_write_time__: { 18372 timestampValue: { 18373 seconds: a.seconds, 18374 nanos: a.nanoseconds 18375 } 18376 } 18377 } 18378 }, r && (c.fields.__previous_value__ = r), { 18379 mapValue: c 18380 }) : u instanceof Qb ? Jb(u, r) : u instanceof Zb ? ew(u, r) : (u = Wb(c = u, r), r = ow(u) + ow(c.A), Lm(u) && Lm(c.A) ? Bb(r) : Vb(c.R, r)))) 18381 } 18382 return i 18383 } 18384 18385 function Ew(t) { 18386 this.count = t 18387 } 18388 var Sw, Cw, Nw, Aw = (Xi(Pw, Nw = Ga), Pw), 18389 kw = (Xi(Rw, Cw = Ga), Rw); 18390 18391 function Rw(t, e) { 18392 var n = this; 18393 return (n = Cw.call(this) || this).key = t, n.precondition = e, n.type = 3, n.fieldTransforms = [], n 18394 } 18395 18396 function Pw(t, e) { 18397 var n = this; 18398 return (n = Nw.call(this) || this).key = t, n.precondition = e, n.type = 2, n.fieldTransforms = [], n 18399 } 18400 18401 function Ow(t) { 18402 switch (t) { 18403 case My.OK: 18404 return Hy(), 0; 18405 case My.CANCELLED: 18406 case My.UNKNOWN: 18407 case My.DEADLINE_EXCEEDED: 18408 case My.RESOURCE_EXHAUSTED: 18409 case My.INTERNAL: 18410 case My.UNAVAILABLE: 18411 case My.UNAUTHENTICATED: 18412 return; 18413 case My.INVALID_ARGUMENT: 18414 case My.NOT_FOUND: 18415 case My.ALREADY_EXISTS: 18416 case My.PERMISSION_DENIED: 18417 case My.FAILED_PRECONDITION: 18418 case My.ABORTED: 18419 case My.OUT_OF_RANGE:
18420 case My.UNIMPLEMENTED: 18421 case My.DATA_LOSS: 18422 return 1; 18423 default: 18424 return Hy(), 0 18425 } 18426 } 18427 18428 function Dw(t) { 18429 if (void 0 === t) return By("GRPC error has no .code"), My.UNKNOWN; 18430 switch (t) { 18431 case Sw.OK: 18432 return My.OK; 18433 case Sw.CANCELLED: 18434 return My.CANCELLED; 18435 case Sw.UNKNOWN: 18436 return My.UNKNOWN; 18437 case Sw.DEADLINE_EXCEEDED: 18438 return My.DEADLINE_EXCEEDED; 18439 case Sw.RESOURCE_EXHAUSTED: 18440 return My.RESOURCE_EXHAUSTED; 18441 case Sw.INTERNAL: 18442 return My.INTERNAL; 18443 case Sw.UNAVAILABLE: 18444 return My.UNAVAILABLE; 18445 case Sw.UNAUTHENTICATED: 18446 return My.UNAUTHENTICATED; 18447 case Sw.INVALID_ARGUMENT: 18448 return My.INVALID_ARGUMENT; 18449 case Sw.NOT_FOUND: 18450 return My.NOT_FOUND; 18451 case Sw.ALREADY_EXISTS: 18452 return My.ALREADY_EXISTS; 18453 case Sw.PERMISSION_DENIED: 18454 return My.PERMISSION_DENIED; 18455 case Sw.FAILED_PRECONDITION: 18456 return My.FAILED_PRECONDITION; 18457 case Sw.ABORTED: 18458 return My.ABORTED; 18459 case Sw.OUT_OF_RANGE: 18460 return My.OUT_OF_RANGE; 18461 case Sw.UNIMPLEMENTED: 18462 return My.UNIMPLEMENTED; 18463 case Sw.DATA_LOSS: 18464 return My.DATA_LOSS; 18465 default: 18466 return Hy() 18467 } 18468 }(Sn = Sw = Sw || {})[Sn.OK = 0] = "OK", Sn[Sn.CANCELLED = 1] = "CANCELLED", Sn[Sn.UNKNOWN = 2] = "UNKNOWN", Sn[Sn.INVALID_ARGUMENT = 3] = "INVALID_ARGUMENT", Sn[Sn.DEADLINE_EXCEEDED = 4] = "DEADLINE_EXCEEDED", Sn[Sn.NOT_FOUND = 5] = "NOT_FOUND", Sn[Sn.ALREADY_EXISTS = 6] = "ALREADY_EXISTS", Sn[Sn.PERMISSION_DENIED = 7] = "PERMISSION_DENIED", Sn[Sn.UNAUTHENTICATED = 16] = "UNAUTHENTICATED", Sn[Sn.RESOURCE_EXHAUSTED = 8] = "RESOURCE_EXHAUSTED", Sn[Sn.FAILED_PRECONDITION = 9] = "FAILED_PRECONDITION", Sn[Sn.ABORTED = 10] = "ABORTED", Sn[Sn.OUT_OF_RANGE = 11] = "OUT_OF_RANGE", Sn[Sn.UNIMPLEMENTED = 12] = "UNIMPLEMENTED", Sn[Sn.INTERNAL = 13] = "INTERNAL", Sn[Sn.UNAVAILABLE = 14] = "UNAVAILABLE", Sn[Sn.DATA_LOSS = 15] = "DATA_LOSS"; 18469 var xw = (jw.prototype.insert = function (t, e) { 18470 return new jw(this.comparator, this.root.insert(t, e, this.comparator).copy(null, null, Mw.BLACK, null, null)) 18471 }, jw.prototype.remove = function (t) { 18472 return new jw(this.comparator, this.root.remove(t, this.comparator).copy(null, null, Mw.BLACK, null, null)) 18473 }, jw.prototype.get = function (t) { 18474 for (var e = this.root; !e.isEmpty();) { 18475 var n = this.comparator(t, e.key); 18476 if (0 === n) return e.value; 18477 n < 0 ? e = e.left : 0 < n && (e = e.right) 18478 } 18479 return null 18480 }, jw.prototype.indexOf = function (t) { 18481 for (var e = 0, n = this.root; !n.isEmpty();) { 18482 var r = this.comparator(t, n.key); 18483 if (0 === r) return e + n.left.size; 18484 n = r < 0 ? n.left : (e += n.left.size + 1, n.right) 18485 } 18486 return -1 18487 }, jw.prototype.isEmpty = function () { 18488 return this.root.isEmpty() 18489 }, Object.defineProperty(jw.prototype, "size", { 18490 get: function () { 18491 return this.root.size 18492 }, 18493 enumerable: !1, 18494 configurable: !0 18495 }), jw.prototype.minKey = function () { 18496 return this.root.minKey() 18497 }, jw.prototype.maxKey = function () { 18498 return this.root.maxKey() 18499 }, jw.prototype.inorderTraversal = function (t) { 18500 return this.root.inorderTraversal(t) 18501 }, jw.prototype.forEach = function (n) { 18502 this.inorderTraversal(function (t, e) { 18503 return n(t, e), !1 18504 }) 18505 }, jw.prototype.toString = function () { 18506 var n = []; 18507 return this.inorderTraversal(function (t, e) { 18508 return n.push(t + ":" + e), !1 18509 }), "{" + n.join(", ") + "}" 18510 }, jw.prototype.reverseTraversal = function (t) { 18511 return this.root.reverseTraversal(t) 18512 }, jw.prototype.getIterator = function () { 18513 return new Lw(this.root, null, this.comparator, !1) 18514 }, jw.prototype.getIteratorFrom = function (t) { 18515 return new Lw(this.root, t, this.comparator, !1) 18516 }, jw.prototype.getReverseIterator = function () { 18517 return new Lw(this.root, null, this.comparator, !0) 18518 }, jw.prototype.getReverseIteratorFrom = function (t) { 18519 return new Lw(this.root, t, this.comparator, !0) 18520 }, jw), 18521 Lw = (Uw.prototype.getNext = function () { 18522 var t = this.nodeStack.pop(), 18523 e = { 18524 key: t.key, 18525 value: t.value 18526 }; 18527 if (this.isReverse) 18528 for (t = t.left; !t.isEmpty();) this.nodeStack.push(t), t = t.right; 18529 else 18530 for (t = t.right; !t.isEmpty();) this.nodeStack.push(t), t = t.left; 18531 return e 18532 }, Uw.prototype.hasNext = function () { 18533 return 0 < this.nodeStack.length 18534 }, Uw.prototype.peek = function () { 18535 if (0 === this.nodeStack.length) return null; 18536 var t = this.nodeStack[this.nodeStack.length - 1]; 18537 return { 18538 key: t.key, 18539 value: t.value 18540 } 18541 }, Uw), 18542 Mw = (Fw.prototype.copy = function (t, e, n, r, i) { 18543 return new Fw(null != t ? t : this.key, null != e ? e : this.value, null != n ? n : this.color, null != r ? r : this.left, null != i ? i : this.right) 18544 }, Fw.prototype.isEmpty = function () { 18545 return !1 18546 }, Fw.prototype.inorderTraversal = function (t) { 18547 return this.left.inorderTraversal(t) || t(this.key, this.value) || this.right.inorderTraversal(t) 18548 }, Fw.prototype.reverseTraversal = function (t) { 18549 return this.right.reverseTraversal(t) || t(this.key, this.value) || this.left.reverseTraversal(t) 18550 }, Fw.prototype.min = function () {
18551 return this.left.isEmpty() ? this : this.left.min() 18552 }, Fw.prototype.minKey = function () { 18553 return this.min().key 18554 }, Fw.prototype.maxKey = function () { 18555 return this.right.isEmpty() ? this.key : this.right.maxKey() 18556 }, Fw.prototype.insert = function (t, e, n) { 18557 var r = this, 18558 i = n(t, r.key); 18559 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() 18560 }, Fw.prototype.removeMin = function () { 18561 if (this.left.isEmpty()) return Fw.EMPTY; 18562 var t = this; 18563 return (t = (t = !t.left.isRed() && !t.left.left.isRed() ? t.moveRedLeft() : t).copy(null, null, null, t.left.removeMin(), null)).fixUp() 18564 }, Fw.prototype.remove = function (t, e) { 18565 var n, r = this; 18566 if (e(t, r.key) < 0) r = (r = !(r.left.isEmpty() || r.left.isRed() || r.left.left.isRed()) ? r.moveRedLeft() : r).copy(null, null, null, r.left.remove(t, e), null); 18567 else { 18568 if (0 === e(t, (r = !((r = r.left.isRed() ? r.rotateRight() : r).right.isEmpty() || r.right.isRed() || r.right.left.isRed()) ? r.moveRedRight() : r).key)) { 18569 if (r.right.isEmpty()) return Fw.EMPTY; 18570 n = r.right.min(), r = r.copy(n.key, n.value, null, null, r.right.removeMin()) 18571 } 18572 r = r.copy(null, null, null, null, r.right.remove(t, e)) 18573 } 18574 return r.fixUp() 18575 }, Fw.prototype.isRed = function () { 18576 return this.color 18577 }, Fw.prototype.fixUp = function () { 18578 var t = this; 18579 return t = (t = (t = t.right.isRed() && !t.left.isRed() ? t.rotateLeft() : t).left.isRed() && t.left.left.isRed() ? t.rotateRight() : t).left.isRed() && t.right.isRed() ? t.colorFlip() : t 18580 }, Fw.prototype.moveRedLeft = function () { 18581 var t = this.colorFlip(); 18582 return t = t.right.left.isRed() ? (t = (t = t.copy(null, null, null, null, t.right.rotateRight())).rotateLeft()).colorFlip() : t 18583 }, Fw.prototype.moveRedRight = function () { 18584 var t = this.colorFlip(); 18585 return t = t.left.left.isRed() ? (t = t.rotateRight()).colorFlip() : t 18586 }, Fw.prototype.rotateLeft = function () { 18587 var t = this.copy(null, null, Fw.RED, null, this.right.left); 18588 return this.right.copy(null, null, this.color, t, null) 18589 }, Fw.prototype.rotateRight = function () { 18590 var t = this.copy(null, null, Fw.RED, this.left.right, null); 18591 return this.left.copy(null, null, this.color, null, t) 18592 }, Fw.prototype.colorFlip = function () { 18593 var t = this.left.copy(null, null, !this.left.color, null, null), 18594 e = this.right.copy(null, null, !this.right.color, null, null); 18595 return this.copy(null, null, !this.color, t, e) 18596 }, Fw.prototype.checkMaxDepth = function () { 18597 var t = this.check(); 18598 return Math.pow(2, t) <= this.size + 1 18599 }, Fw.prototype.check = function () { 18600 if (this.isRed() && this.left.isRed()) throw Hy(); 18601 if (this.right.isRed()) throw Hy(); 18602 var t = this.left.check(); 18603 if (t !== this.right.check()) throw Hy(); 18604 return t + (this.isRed() ? 0 : 1) 18605 }, Fw); 18606 18607 function Fw(t, e, n, r, i) { 18608 this.key = t, this.value = e, this.color = null != n ? n : Fw.RED, this.left = null != r ? r : Fw.EMPTY, this.right = null != i ? i : Fw.EMPTY, this.size = this.left.size + 1 + this.right.size 18609 } 18610 18611 function Uw(t, e, n, r) { 18612 this.isReverse = r, this.nodeStack = []; 18613 for (var i = 1; !t.isEmpty();) 18614 if (i = e ? n(t.key, e) : 1, r && (i *= -1), i < 0) t = this.isReverse ? t.left : t.right; 18615 else { 18616 if (0 === i) { 18617 this.nodeStack.push(t); 18618 break 18619 } 18620 this.nodeStack.push(t), t = this.isReverse ? t.right : t.left 18621 } 18622 } 18623 18624 function jw(t, e) { 18625 this.comparator = t, this.root = e || Mw.EMPTY 18626 } 18627 18628 function qw() { 18629 this.size = 0 18630 } 18631 Mw.EMPTY = null, Mw.RED = !0, Mw.BLACK = !1, Mw.EMPTY = (Object.defineProperty(qw.prototype, "key", { 18632 get: function () { 18633 throw Hy() 18634 }, 18635 enumerable: !1, 18636 configurable: !0 18637 }), Object.defineProperty(qw.prototype, "value", { 18638 get: function () { 18639 throw Hy() 18640 }, 18641 enumerable: !1, 18642 configurable: !0 18643 }), Object.defineProperty(qw.prototype, "color", { 18644 get: function () { 18645 throw Hy() 18646 }, 18647 enumerable: !1, 18648 configurable: !0 18649 }), Object.defineProperty(qw.prototype, "left", { 18650 get: function () { 18651 throw Hy() 18652 }, 18653 enumerable: !1, 18654 configurable: !0 18655 }), Object.defineProperty(qw.prototype, "right", { 18656 get: function () { 18657 throw Hy() 18658 }, 18659 enumerable: !1, 18660 configurable: !0 18661 }), qw.prototype.copy = function (t, e, n, r, i) { 18662 return this 18663 }, qw.prototype.insert = function (t, e, n) { 18664 return new Mw(t, e) 18665 }, qw.prototype.remove = function (t, e) { 18666 return this 18667 }, qw.prototype.isEmpty = function () { 18668 return !0 18669 }, qw.prototype.inorderTraversal = function (t) { 18670 return !1 18671 }, qw.prototype.reverseTraversal = function (t) { 18672 return !1 18673 }, qw.prototype.minKey = function () { 18674 return null 18675 }, qw.prototype.maxKey = function () { 18676 return null 18677 }, qw.prototype.isRed = function () { 18678 return !1 18679 }, qw.prototype.checkMaxDepth = function () { 18680 return !0 18681 }
18681, qw.prototype.check = function () { 18682 return 0 18683 }, new qw); 18684 var Vw = (Hw.prototype.has = function (t) { 18685 return null !== this.data.get(t) 18686 }, Hw.prototype.first = function () { 18687 return this.data.minKey() 18688 }, Hw.prototype.last = function () { 18689 return this.data.maxKey() 18690 }, Object.defineProperty(Hw.prototype, "size", { 18691 get: function () { 18692 return this.data.size 18693 }, 18694 enumerable: !1, 18695 configurable: !0 18696 }), Hw.prototype.indexOf = function (t) { 18697 return this.data.indexOf(t) 18698 }, Hw.prototype.forEach = function (n) { 18699 this.data.inorderTraversal(function (t, e) { 18700 return n(t), !1 18701 }) 18702 }, Hw.prototype.forEachInRange = function (t, e) { 18703 for (var n = this.data.getIteratorFrom(t[0]); n.hasNext();) { 18704 var r = n.getNext(); 18705 if (0 <= this.comparator(r.key, t[1])) return; 18706 e(r.key) 18707 } 18708 }, Hw.prototype.forEachWhile = function (t, e) { 18709 for (var n = void 0 !== e ? this.data.getIteratorFrom(e) : this.data.getIterator(); n.hasNext();) 18710 if (!t(n.getNext().key)) return 18711 }, Hw.prototype.firstAfterOrEqual = function (t) { 18712 t = this.data.getIteratorFrom(t); 18713 return t.hasNext() ? t.getNext().key : null 18714 }, Hw.prototype.getIterator = function () { 18715 return new Bw(this.data.getIterator()) 18716 }, Hw.prototype.getIteratorFrom = function (t) { 18717 return new Bw(this.data.getIteratorFrom(t)) 18718 }, Hw.prototype.add = function (t) { 18719 return this.copy(this.data.remove(t).insert(t, !0)) 18720 }, Hw.prototype.delete = function (t) { 18721 return this.has(t) ? this.copy(this.data.remove(t)) : this 18722 }, Hw.prototype.isEmpty = function () { 18723 return this.data.isEmpty() 18724 }, Hw.prototype.unionWith = function (t) { 18725 var e = this; 18726 return e.size < t.size && (e = t, t = this), t.forEach(function (t) { 18727 e = e.add(t) 18728 }), e 18729 }, Hw.prototype.isEqual = function (t) { 18730 if (!(t instanceof Hw)) return !1; 18731 if (this.size !== t.size) return !1; 18732 for (var e = this.data.getIterator(), n = t.data.getIterator(); e.hasNext();) { 18733 var r = e.getNext().key, 18734 i = n.getNext().key; 18735 if (0 !== this.comparator(r, i)) return !1 18736 } 18737 return !0 18738 }, Hw.prototype.toArray = function () { 18739 var e = []; 18740 return this.forEach(function (t) { 18741 e.push(t) 18742 }), e 18743 }, Hw.prototype.toString = function () { 18744 var e = []; 18745 return this.forEach(function (t) { 18746 return e.push(t) 18747 }), "SortedSet(" + e.toString() + ")" 18748 }, Hw.prototype.copy = function (t) { 18749 var e = new Hw(this.comparator); 18750 return e.data = t, e 18751 }, Hw), 18752 Bw = (Ww.prototype.getNext = function () { 18753 return this.iter.getNext().key 18754 }, Ww.prototype.hasNext = function () { 18755 return this.iter.hasNext() 18756 }, Ww), 18757 Kw = new xw(Cm.comparator); 18758 18759 function Ww(t) { 18760 this.iter = t 18761 } 18762 18763 function Hw(t) { 18764 this.comparator = t, this.data = new xw(this.comparator) 18765 } 18766 var Gw = new xw(Cm.comparator); 18767 var zw = new xw(Cm.comparator); 18768 var Qw = new Vw(Cm.comparator); 18769 18770 function Yw() { 18771 for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e]; 18772 for (var n = Qw, r = 0, i = t; r < i.length; r++) var o = i[r], 18773 n = n.add(o); 18774 return n 18775 } 18776 var Xw = new Vw(Yy); 18777 var Jw = (a_.createSynthesizedRemoteEventForCurrentChange = function (t, e) { 18778 var n = new Map; 18779 return n.set(t, $w.createSynthesizedTargetChangeForCurrentChange(t, e)), new a_(Zy.min(), n, Xw, Kw, Yw()) 18780 }, a_), 18781 $w = (s_.createSynthesizedTargetChangeForCurrentChange = function (t, e) { 18782 return new s_(lm.EMPTY_BYTE_STRING, e, Yw(), Yw(), Yw()) 18783 }, s_), 18784 Zw = function (t, e, n, r) { 18785 this.v = t, this.removedTargetIds = e, this.key = n, this.P = r 18786 }, 18787 t_ = function (t, e) { 18788 this.targetId = t, this.V = e 18789 }, 18790 e_ = function (t, e, n, r) { 18791 void 0 === n && (n = lm.EMPTY_BYTE_STRING), void 0 === r && (r = null), this.state = t, this.targetIds = e, this.resumeToken = n, this.cause = r 18792 }, 18793 n_ = (Object.defineProperty(o_.prototype, "current", { 18794 get: function () { 18795 return this.N 18796 }, 18797 enumerable: !1, 18798 configurable: !0 18799 }), Object.defineProperty(o_.prototype, "resumeToken", { 18800 get: function () { 18801 return this.C 18802 }, 18803 enumerable: !1, 18804 configurable: !0 18805 }), Object.defineProperty(o_.prototype, "k", { 18806 get: function () { 18807 return 0 !== this.S 18808 }, 18809 enumerable: !1, 18810 configurable: !0 18811 }), Object.defineProperty(o_.prototype, "O", { 18812 get: function () { 18813 return this.F 18814 }, 18815 enumerable: !1, 18816 configurable: !0 18817 }), o_.prototype.$ = function (t) { 18818 0 < t.approximateByteSize() && (this.F = !0, this.C = t) 18819 }, o_.prototype.M = function () { 18820 var n = Yw(), 18821 r = Yw(), 18822 i = Yw(); 18823 return this.D.forEach(function (t, e) { 18824 switch (e) { 18825 case 0: 18826 n = n.add(t); 18827 break; 18828 case 2: 18829 r = r.add(t); 18830 break; 18831 case 1: 18832 i = i.add(t); 18833 break; 18834 default: 18835 Hy() 18836 } 18837 }), new $w(this.C, this.N, n, r, i) 18838 }, o_.prototype.L = function () {
18839 this.F = !1, this.D = c_() 18840 }, o_.prototype.B = function (t, e) { 18841 this.F = !0, this.D = this.D.insert(t, e) 18842 }, o_.prototype.q = function (t) { 18843 this.F = !0, this.D = this.D.remove(t) 18844 }, o_.prototype.U = function () { 18845 this.S += 1 18846 }, o_.prototype.K = function () { 18847 --this.S 18848 }, o_.prototype.j = function () { 18849 this.F = !0, this.N = !0 18850 }, o_), 18851 r_ = (i_.prototype.X = function (t) { 18852 for (var e = 0, n = t.v; e < n.length; e++) { 18853 var r = n[e]; 18854 t.P && t.P.isFoundDocument() ? this.Z(r, t.P) : this.tt(r, t.key, t.P) 18855 } 18856 for (var i = 0, o = t.removedTargetIds; i < o.length; i++) r = o[i], this.tt(r, t.key, t.P) 18857 }, i_.prototype.et = function (n) { 18858 var r = this; 18859 this.forEachTarget(n, function (t) { 18860 var e = r.nt(t); 18861 switch (n.state) { 18862 case 0: 18863 r.st(t) && e.$(n.resumeToken); 18864 break; 18865 case 1: 18866 e.K(), e.k || e.L(), e.$(n.resumeToken); 18867 break; 18868 case 2: 18869 e.K(), e.k || r.removeTarget(t); 18870 break; 18871 case 3: 18872 r.st(t) && (e.j(), e.$(n.resumeToken)); 18873 break; 18874 case 4: 18875 r.st(t) && (r.it(t), e.$(n.resumeToken)); 18876 break; 18877 default: 18878 Hy() 18879 } 18880 }) 18881 }, i_.prototype.forEachTarget = function (t, n) { 18882 var r = this; 18883 0 < t.targetIds.length ? t.targetIds.forEach(n) : this.G.forEach(function (t, e) { 18884 r.st(e) && n(e) 18885 }) 18886 }, i_.prototype.rt = function (t) { 18887 var e = t.targetId, 18888 n = t.V.count, 18889 t = this.ot(e); 18890 t && (Qm(t = t.target) ? 0 === n ? (t = new Cm(t.path), this.tt(e, t, Bm.newNoDocument(t, Zy.min()))) : Gy(1 === n) : this.ct(e) !== n && (this.it(e), this.Y = this.Y.add(e))) 18891 }, i_.prototype.ut = function (r) { 18892 var i = this, 18893 o = new Map; 18894 this.G.forEach(function (t, e) { 18895 var n = i.ot(e); 18896 n && (t.current && Qm(n.target) && (n = new Cm(n.target.path), null !== i.H.get(n) || i.at(e, n) || i.tt(e, n, Bm.newNoDocument(n, r))), t.O && (o.set(e, t.M()), t.L())) 18897 }); 18898 var s = Yw(); 18899 this.J.forEach(function (t, e) { 18900 var n = !0; 18901 e.forEachWhile(function (t) { 18902 t = i.ot(t); 18903 return !t || 2 === t.purpose || (n = !1) 18904 }), n && (s = s.add(t)) 18905 }); 18906 var t = new Jw(r, o, this.Y, this.H, s); 18907 return this.H = Kw, this.J = u_(), this.Y = new Vw(Yy), t 18908 }, i_.prototype.Z = function (t, e) { 18909 var n; 18910 this.st(t) && (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))) 18911 }, i_.prototype.tt = function (t, e, n) { 18912 var r; 18913 this.st(t) && (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))) 18914 }, i_.prototype.removeTarget = function (t) { 18915 this.G.delete(t) 18916 }, i_.prototype.ct = function (t) { 18917 var e = this.nt(t).M(); 18918 return this.W.getRemoteKeysForTarget(t).size + e.addedDocuments.size - e.removedDocuments.size 18919 }, i_.prototype.U = function (t) { 18920 this.nt(t).U() 18921 }, i_.prototype.nt = function (t) { 18922 var e = this.G.get(t); 18923 return e || (e = new n_, this.G.set(t, e)), e 18924 }, i_.prototype.ht = function (t) { 18925 var e = this.J.get(t); 18926 return e || (e = new Vw(Yy), this.J = this.J.insert(t, e)), e 18927 }, i_.prototype.st = function (t) { 18928 var e = null !== this.ot(t); 18929 return e || Vy("WatchChangeAggregator", "Detected inactive target", t), e 18930 }, i_.prototype.ot = function (t) { 18931 var e = this.G.get(t); 18932 return e && e.k ? null : this.W.lt(t) 18933 }, i_.prototype.it = function (e) { 18934 var n = this; 18935 this.G.set(e, new n_), this.W.getRemoteKeysForTarget(e).forEach(function (t) { 18936 n.tt(e, t, null) 18937 }) 18938 }, i_.prototype.at = function (t, e) { 18939 return this.W.getRemoteKeysForTarget(t).has(e) 18940 }, i_); 18941 18942 function i_(t) { 18943 this.W = t, this.G = new Map, this.H = Kw, this.J = u_(), this.Y = new Vw(Yy) 18944 } 18945 18946 function o_() { 18947 this.S = 0, this.D = c_(), this.C = lm.EMPTY_BYTE_STRING, this.N = !1, this.F
18947= !0 18948 } 18949 18950 function s_(t, e, n, r, i) { 18951 this.resumeToken = t, this.current = e, this.addedDocuments = n, this.modifiedDocuments = r, this.removedDocuments = i 18952 } 18953 18954 function a_(t, e, n, r, i) { 18955 this.snapshotVersion = t, this.targetChanges = e, this.targetMismatches = n, this.documentUpdates = r, this.resolvedLimboDocuments = i 18956 } 18957 18958 function u_() { 18959 return new xw(Cm.comparator) 18960 } 18961 18962 function c_() { 18963 return new xw(Cm.comparator) 18964 } 18965 var h_ = { 18966 asc: "ASCENDING", 18967 desc: "DESCENDING" 18968 }, 18969 l_ = { 18970 "<": "LESS_THAN", 18971 "<=": "LESS_THAN_OR_EQUAL", 18972 ">": "GREATER_THAN", 18973 ">=": "GREATER_THAN_OR_EQUAL", 18974 "==": "EQUAL", 18975 "!=": "NOT_EQUAL", 18976 "array-contains": "ARRAY_CONTAINS", 18977 in: "IN", 18978 "not-in": "NOT_IN", 18979 "array-contains-any": "ARRAY_CONTAINS_ANY" 18980 }, 18981 f_ = function (t, e) { 18982 this.databaseId = t, this.I = e 18983 }; 18984 18985 function p_(t, e) { 18986 return t.I ? new Date(1e3 * e.seconds).toISOString().replace(/\.\d*/, "").replace("Z", "") + "." + ("000000000" + e.nanoseconds).slice(-9) + "Z" : { 18987 seconds: "" + e.seconds, 18988 nanos: e.nanoseconds 18989 } 18990 } 18991 18992 function d_(t, e) { 18993 return t.I ? e.toBase64() : e.toUint8Array() 18994 } 18995 18996 function v_(t) { 18997 return Gy(!!t), Zy.fromTimestamp((t = mm(t), new $y(t.seconds, t.nanos))) 18998 } 18999 19000 function g_(t, e) { 19001 return new am(["projects", t.projectId, "databases", t.database]).child("documents").child(e).canonicalString() 19002 } 19003 19004 function y_(t) { 19005 t = am.fromString(t); 19006 return Gy(F_(t)), t 19007 } 19008 19009 function m_(t, e) { 19010 return g_(t.databaseId, e.path) 19011 } 19012 19013 function b_(t, e) { 19014 e = y_(e); 19015 if (e.get(1) !== t.databaseId.projectId) throw new Fy(My.INVALID_ARGUMENT, "Tried to deserialize key from different project: " + e.get(1) + " vs " + t.databaseId.projectId); 19016 if (e.get(3) !== t.databaseId.database) throw new Fy(My.INVALID_ARGUMENT, "Tried to deserialize key from different database: " + e.get(3) + " vs " + t.databaseId.database); 19017 return new Cm(T_(e)) 19018 } 19019 19020 function w_(t, e) { 19021 return g_(t.databaseId, e) 19022 } 19023 19024 function __(t) { 19025 t = y_(t); 19026 return 4 === t.length ? am.emptyPath() : T_(t) 19027 } 19028 19029 function I_(t) { 19030 return new am(["projects", t.databaseId.projectId, "databases", t.databaseId.database]).canonicalString() 19031 } 19032 19033 function T_(t) { 19034 return Gy(4 < t.length && "documents" === t.get(4)), t.popFirst(5) 19035 } 19036 19037 function E_(t, e, n) { 19038 return { 19039 name: m_(t, e), 19040 fields: n.toProto().mapValue.fields 19041 } 19042 } 19043 19044 function S_(t, e, n) { 19045 var r = b_(t, e.name), 19046 t = v_(e.updateTime), 19047 e = new qm({ 19048 mapValue: { 19049 fields: e.fields 19050 } 19051 }), 19052 e = Bm.newFoundDocument(r, t, e); 19053 return n && e.setHasCommittedMutations(), n ? e.setHasCommittedMutations() : e 19054 } 19055 19056 function C_(t, e) { 19057 var n, r, i; 19058 if (e instanceof yw) n = { 19059 update: E_(t, e.key, e.value) 19060 }; 19061 else if (e instanceof Aw) n = { 19062 delete: m_(t, e.key) 19063 }; 19064 else if (e instanceof mw) n = { 19065 update: E_(t, e.key, e.data), 19066 updateMask: (i = e.fieldMask, r = [], i.fields.forEach(function (t) { 19067 return r.push(t.canonicalString()) 19068 }), { 19069 fieldPaths: r 19070 }) 19071 }; 19072 else { 19073 if (!(e instanceof kw)) return Hy(); 19074 n = { 19075 verify: m_(t, e.key) 19076 } 19077 } 19078 return 0 < e.fieldTransforms.length && (n.updateTransforms = e.fieldTransforms.map(function (t) { 19079 var e = t.transform; 19080 if (e instanceof zb) return { 19081 fieldPath: t.field.canonicalString(), 19082 setToServerValue: "REQUEST_TIME" 19083 }; 19084 if (e instanceof Qb) return { 19085 fieldPath: t.field.canonicalString(), 19086 appendMissingElements: { 19087 values: e.elements 19088 } 19089 }; 19090 if (e instanceof Zb) return { 19091 fieldPath: t.field.canonicalString(), 19092 removeAllFromArray: { 19093 values: e.elements 19094 } 19095 }; 19096 if (e instanceof rw) return { 19097 fieldPath: t.field.canonicalString(), 19098 increment: e.A 19099 }; 19100 throw Hy() 19101 })), e.precondition.isNone || (n.currentDocument = void 0 !== (i = e.precondition).updateTime ? { 19102 updateTime: (e = t, t = i.updateTime, p_(e, t.toTimestamp())) 19103 } : void 0 !== i.exists ? { 19104 exists: i.exists 19105 } : Hy()), n 19106 } 19107 19108 function N_(e, t) { 19109 var n = t.currentDocument ? void 0 !== (s = t.currentDocument).updateTime ? cw.updateTime(v_(s.updateTime)) : void 0 !== s.exists ? cw.exists(s.exists) : cw.none() : cw.none(), 19110 r = t.updateTransforms ? t.updateTransforms.map(function (t) { 19111 return function (t, e) { 19112 var n, r = null; 19113 "setToServerValue" in e ? (Gy("REQUEST_TIME" === e.setToServerValue), r = new zb) : "appendMissingElements" in e ? (n = e.appendMissingElements.values || [], r = new Qb(n)) : "removeAllFromArray" in e ? (n = e.removeAllFromArray.values || [], r = new Zb(n)) : "increment" in e ? r = new rw(t, e.increment) : Hy(); 19114 e = cm.fromServerFormat(e.fieldPath); 19115 return new uw(e, r) 19116 }(e, t) 19117 }) : []; 19118 if (t.update) { 19119 t.update.name; 19120 var i = b_(e, t.update.name), 19121 o = new qm({ 19122 mapValue: { 19123 fields: t.update.fields 19124 } 19125 }); 19126 if (t.updateMask) { 19127 var s = (s = t.updateMask.fieldPaths || [], new hm(s.map(function (t) { 19128 return cm.fromServerFormat(t) 19129 }))); 19130 return new mw(i, o, s, n, r) 19131 } 19132 return new yw(i, o, n, r) 19133 } 19134 if (t.delete) { 19135 r = b_(e, t.delete); 19136 return new Aw(r, n) 19137 } 19138 if (t.verify) { 19139 t = b_(e, t.verify); 19140 return new kw(t, n) 19141 } 19142 return Hy() 19143 } 19144 19145 function A_(t, e) { 19146 return { 19147 documents: [w_(t, e.path)] 19148 } 19149 } 19150 19151 function k_(t, e) { 19152 var n = { 19153 structuredQuery: {} 19154 }, 19155 r = e.path; 19156 null !== e.collectionGroup ? (n.parent = w_(t, r), n.structuredQuery.from = [{ 19157 collectionId: e.collectionGroup, 19158 allDescendants: !0 19159 }]) : (n.parent = w_(t, r.popLast()), n.structuredQuery.from = [{ 19160 collectionId: r.lastSegment() 19161 }]); 19162 r = function (t) { 19163 if (0 !== t.length) { 19164 t = t.map(function (t) { 19165 if ("==" === t.op) { 19166 if (Um(t.value)) return { 19167 unaryFilter: { 19168 field: D_(t.field), 19169 op: "IS_NAN" 19170 } 19171 }; 19172 if (Fm(t.value)) return { 19173 unaryFilter: { 19174 field: D_(t.field), 19175 op: "IS_NULL" 19176 } 19177 } 19178 } else if ("!=" === t.op) { 19179 if (Um(t.value)) return { 19180 unaryFilter: { 19181 field: D_(t.field),
19182 op: "IS_NOT_NAN" 19183 } 19184 }; 19185 if (Fm(t.value)) return { 19186 unaryFilter: { 19187 field: D_(t.field), 19188 op: "IS_NOT_NULL" 19189 } 19190 } 19191 } 19192 return { 19193 fieldFilter: { 19194 field: D_(t.field), 19195 op: (e = t.op, l_[e]), 19196 value: t.value 19197 } 19198 }; 19199 var e 19200 }); 19201 return 1 === t.length ? t[0] : { 19202 compositeFilter: { 19203 op: "AND", 19204 filters: t 19205 } 19206 } 19207 } 19208 }(e.filters); 19209 r && (n.structuredQuery.where = r); 19210 r = function (t) { 19211 if (0 !== t.length) return t.map(function (t) { 19212 return { 19213 field: D_((t = t).field), 19214 direction: (t = t.dir, h_[t]) 19215 } 19216 }) 19217 }(e.orderBy); 19218 r && (n.structuredQuery.orderBy = r); 19219 r = e.limit, r = t.I || Tm(r) ? r : { 19220 value: r 19221 }; 19222 return null !== r && (n.structuredQuery.limit = r), e.startAt && (n.structuredQuery.startAt = P_(e.startAt)), e.endAt && (n.structuredQuery.endAt = P_(e.endAt)), n 19223 } 19224 19225 function R_(t) { 19226 var e = __(t.parent), 19227 n = t.structuredQuery, 19228 r = n.from ? n.from.length : 0, 19229 i = null; 19230 0 < r && (Gy(1 === r), (a = n.from[0]).allDescendants ? i = a.collectionId : e = e.child(a.collectionId)); 19231 var o = []; 19232 n.where && (o = function e(t) { 19233 return t ? void 0 !== t.unaryFilter ? [M_(t)] : void 0 !== t.fieldFilter ? [L_(t)] : void 0 !== t.compositeFilter ? t.compositeFilter.filters.map(function (t) { 19234 return e(t) 19235 }).reduce(function (t, e) { 19236 return t.concat(e) 19237 }) : Hy() : [] 19238 }(n.where)); 19239 var s = [], 19240 t = null, 19241 r = null, 19242 a = null; 19243 return Cb(e, i, s = n.orderBy ? n.orderBy.map(function (t) { 19244 return new Ib(x_((e = t).field), function () { 19245 switch (e.direction) { 19246 case "ASCENDING": 19247 return "asc"; 19248 case "DESCENDING": 19249 return "desc"; 19250 default: 19251 return 19252 } 19253 }()); 19254 var e 19255 }) : s, o, t = n.limit ? Tm(o = "object" == typeof (o = n.limit) ? o.value : o) ? null : o : t, "F", r = n.startAt ? O_(n.startAt) : r, a = n.endAt ? O_(n.endAt) : a) 19256 } 19257 19258 function P_(t) { 19259 return { 19260 before: t.before, 19261 values: t.position 19262 } 19263 } 19264 19265 function O_(t) { 19266 var e = !!t.before, 19267 t = t.values || []; 19268 return new gb(t, e) 19269 } 19270 19271 function D_(t) { 19272 return { 19273 fieldPath: t.canonicalString() 19274 } 19275 } 19276 19277 function x_(t) { 19278 return cm.fromServerFormat(t.fieldPath) 19279 } 19280 19281 function L_(t) { 19282 return Xm.create(x_(t.fieldFilter.field), function () { 19283 switch (t.fieldFilter.op) { 19284 case "EQUAL": 19285 return "=="; 19286 case "NOT_EQUAL": 19287 return "!="; 19288 case "GREATER_THAN": 19289 return ">"; 19290 case "GREATER_THAN_OR_EQUAL": 19291 return ">="; 19292 case "LESS_THAN": 19293 return "<"; 19294 case "LESS_THAN_OR_EQUAL": 19295 return "<="; 19296 case "ARRAY_CONTAINS": 19297 return "array-contains"; 19298 case "IN": 19299 return "in"; 19300 case "NOT_IN": 19301 return "not-in"; 19302 case "ARRAY_CONTAINS_ANY": 19303 return "array-contains-any"; 19304 case "OPERATOR_UNSPECIFIED": 19305 default: 19306 return Hy() 19307 } 19308 }(), t.fieldFilter.value) 19309 } 19310 19311 function M_(t) { 19312 switch (t.unaryFilter.op) { 19313 case "IS_NAN": 19314 var e = x_(t.unaryFilter.field); 19315 return Xm.create(e, "==", { 19316 doubleValue: NaN 19317 }); 19318 case "IS_NULL": 19319 e = x_(t.unaryFilter.field); 19320 return Xm.create(e, "==", { 19321 nullValue: "NULL_VALUE" 19322 });
19323 case "IS_NOT_NAN": 19324 var n = x_(t.unaryFilter.field); 19325 return Xm.create(n, "!=", { 19326 doubleValue: NaN 19327 }); 19328 case "IS_NOT_NULL": 19329 n = x_(t.unaryFilter.field); 19330 return Xm.create(n, "!=", { 19331 nullValue: "NULL_VALUE" 19332 }); 19333 case "OPERATOR_UNSPECIFIED": 19334 default: 19335 return Hy() 19336 } 19337 } 19338 19339 function F_(t) { 19340 return 4 <= t.length && "projects" === t.get(0) && "databases" === t.get(2) 19341 } 19342 19343 function U_(t) { 19344 for (var e = "", n = 0; n < t.length; n++) 0 < e.length && (e = j_(e)), e = function (t, e) { 19345 for (var n = e, r = t.length, i = 0; i < r; i++) { 19346 var o = t.charAt(i); 19347 switch (o) { 19348 case "\0": 19349 n += "��"; 19350 break; 19351 case "�": 19352 n += "��"; 19353 break; 19354 default: 19355 n += o 19356 } 19357 } 19358 return n 19359 }(t.get(n), e); 19360 return j_(e) 19361 } 19362 19363 function j_(t) { 19364 return t + "��" 19365 } 19366 19367 function q_(t) { 19368 var e = t.length; 19369 if (Gy(2 <= e), 2 === e) return Gy("�" === t.charAt(0) && "�" === t.charAt(1)), am.emptyPath(); 19370 for (var n = e - 2, r = [], i = "", o = 0; o < e;) { 19371 var s = t.indexOf("�", o); 19372 switch ((s < 0 || n < s) && Hy(), t.charAt(s + 1)) { 19373 case "�": 19374 var a = t.substring(o, s), 19375 u = void 0; 19376 0 === i.length ? u = a : (u = i += a, i = ""), r.push(u); 19377 break; 19378 case "�": 19379 i += t.substring(o, s), i += "\0"; 19380 break; 19381 case "�": 19382 i += t.substring(o, s + 1); 19383 break; 19384 default: 19385 Hy() 19386 } 19387 o = s + 2 19388 } 19389 return new am(r) 19390 } 19391 19392 function V_(t, e, n) { 19393 this.ownerId = t, this.allowTabSynchronization = e, this.leaseTimestampMs = n 19394 } 19395 var B_ = function (t, e) { 19396 this.seconds = t, this.nanoseconds = e 19397 }; 19398 V_.store = "owner", V_.key = "owner"; 19399 19400 function K_(t, e, n) { 19401 this.userId = t, this.lastAcknowledgedBatchId = e, this.lastStreamToken = n 19402 } 19403 K_.store = "mutationQueues", K_.keyPath = "userId"; 19404 19405 function W_(t, e, n, r, i) { 19406 this.userId = t, this.batchId = e, this.localWriteTimeMs = n, this.baseMutations = r, this.mutations = i 19407 } 19408 W_.store = "mutations", W_.keyPath = "batchId", W_.userMutationsIndex = "userMutationsIndex", W_.userMutationsKeyPath = ["userId", "batchId"]; 19409 var H_ = (G_.prefixForUser = function (t) { 19410 return [t] 19411 }, G_.prefixForPath = function (t, e) { 19412 return [t, U_(e)] 19413 }, G_.key = function (t, e, n) { 19414 return [t, U_(e), n] 19415 }, G_); 19416 19417 function G_() {} 19418 H_.store = "documentMutations", H_.PLACEHOLDER = new H_; 19419 19420 function z_(t, e) { 19421 this.path = t, this.readTime = e 19422 } 19423 19424 function Q_(t, e) { 19425 this.path = t, this.version = e 19426 } 19427 var Y_ = function (t, e, n, r, i, o) { 19428 this.unknownDocument = t, this.noDocument = e, this.document = n, this.hasCommittedMutations = r, this.readTime = i, this.parentPath = o 19429 }; 19430 Y_.store = "remoteDocuments", Y_.readTimeIndex = "readTimeIndex", Y_.readTimeIndexPath = "readTime", Y_.collectionReadTimeIndex = "collectionReadTimeIndex", Y_.collectionReadTimeIndexPath = ["parentPath", "readTime"]; 19431 19432 function X_(t) { 19433 this.byteSize = t 19434 } 19435 X_.store = "remoteDocumentGlobal", X_.key = "remoteDocumentGlobalKey"; 19436 19437 function J_(t, e, n, r, i, o, s) { 19438 this.targetId = t, this.canonicalId = e, this.readTime = n, this.resumeToken = r, this.lastListenSequenceNumber = i, this.lastLimboFreeSnapshotVersion = o, this.query = s 19439 } 19440 J_.store = "targets", J_.keyPath = "targetId", J_.queryTargetsIndexName = "queryTargetsIndex", J_.queryTargetsKeyPath = ["canonicalId", "targetId"]; 19441 var $_ = function (t, e, n) { 19442 this.targetId = t, this.path = e, this.sequenceNumber = n 19443 }; 19444 $_.store = "targetDocuments", $_.keyPath = ["targetId", "path"], $_.documentTargetsIndex = "documentTargetsIndex", $_.documentTargetsKeyPath = ["path", "targetId"]; 19445 19446 function Z_(t, e, n, r) { 19447 this.highestTargetId = t, this.highestListenSequenceNumber = e, this.lastRemoteSnapshotVersion = n, this.targetCount = r 19448 }
19449 Z_.key = "targetGlobalKey", Z_.store = "targetGlobal"; 19450 19451 function tI(t, e) { 19452 this.collectionId = t, this.parent = e 19453 } 19454 tI.store = "collectionParents", tI.keyPath = ["collectionId", "parent"]; 19455 19456 function eI(t, e, n, r) { 19457 this.clientId = t, this.updateTimeMs = e, this.networkEnabled = n, this.inForeground = r 19458 } 19459 eI.store = "clientMetadata", eI.keyPath = "clientId"; 19460 19461 function nI(t, e, n) { 19462 this.bundleId = t, this.createTime = e, this.version = n 19463 } 19464 nI.store = "bundles", nI.keyPath = "bundleId"; 19465 19466 function rI(t, e, n) { 19467 this.name = t, this.readTime = e, this.bundledQuery = n 19468 } 19469 rI.store = "namedQueries", rI.keyPath = "name"; 19470 var iI, oI = no(no([], no(no([], no(no([], no(no([], [K_.store, W_.store, H_.store, Y_.store, J_.store, V_.store, Z_.store, $_.store]), [eI.store])), [X_.store])), [tI.store])), [nI.store, rI.store]), 19471 sI = "The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.", 19472 Ga = (mI.prototype.addOnCommittedListener = function (t) { 19473 this.onCommittedListeners.push(t) 19474 }, mI.prototype.raiseOnCommittedEvent = function () { 19475 this.onCommittedListeners.forEach(function (t) { 19476 return t() 19477 }) 19478 }, mI), 19479 aI = function () { 19480 var n = this; 19481 this.promise = new Promise(function (t, e) { 19482 n.resolve = t, n.reject = e 19483 }) 19484 }, 19485 uI = (yI.prototype.catch = function (t) { 19486 return this.next(void 0, t) 19487 }, yI.prototype.next = function (r, i) { 19488 var o = this; 19489 return this.callbackAttached && Hy(), this.callbackAttached = !0, this.isDone ? this.error ? this.wrapFailure(i, this.error) : this.wrapSuccess(r, this.result) : new yI(function (e, n) { 19490 o.nextCallback = function (t) { 19491 o.wrapSuccess(r, t).next(e, n) 19492 }, o.catchCallback = function (t) { 19493 o.wrapFailure(i, t).next(e, n) 19494 } 19495 }) 19496 }, yI.prototype.toPromise = function () { 19497 var n = this; 19498 return new Promise(function (t, e) { 19499 n.next(t, e) 19500 }) 19501 }, yI.prototype.wrapUserFunction = function (t) { 19502 try { 19503 var e = t(); 19504 return e instanceof yI ? e : yI.resolve(e) 19505 } catch (t) { 19506 return yI.reject(t) 19507 } 19508 }, yI.prototype.wrapSuccess = function (t, e) { 19509 return t ? this.wrapUserFunction(function () { 19510 return t(e) 19511 }) : yI.resolve(e) 19512 }, yI.prototype.wrapFailure = function (t, e) { 19513 return t ? this.wrapUserFunction(function () { 19514 return t(e) 19515 }) : yI.reject(e) 19516 }, yI.resolve = function (n) { 19517 return new yI(function (t, e) { 19518 t(n) 19519 }) 19520 }, yI.reject = function (n) { 19521 return new yI(function (t, e) { 19522 e(n) 19523 }) 19524 }, yI.waitFor = function (t) { 19525 return new yI(function (e, n) { 19526 var r = 0, 19527 i = 0, 19528 o = !1; 19529 t.forEach(function (t) { 19530 ++r, t.next(function () { 19531 ++i, o && i === r && e() 19532 }, function (t) { 19533 return n(t) 19534 }) 19535 }), o = !0, i === r && e() 19536 }) 19537 }, yI.or = function (t) { 19538 for (var n = yI.resolve(!1), e = 0, r = t; e < r.length; e++) ! function (e) { 19539 n = n.next(function (t) { 19540 return t ? yI.resolve(t) : e() 19541 }) 19542 }(r[e]); 19543 return n 19544 }, yI.forEach = function (t, n) { 19545 var r = this, 19546 i = []; 19547 return t.forEach(function (t, e) { 19548 i.push(n.call(r, t, e)) 19549 }), this.waitFor(i) 19550 }, yI), 19551 cI = (gI.open = function (t, e, n, r) { 19552 try { 19553 return new gI(e, t.transaction(r, n)) 19554 } catch (t) { 19555 throw new fI(e, t) 19556 } 19557 }, Object.defineProperty(gI.prototype, "dt", { 19558 get: function () { 19559 return this.ft.promise 19560 }, 19561 enumerable: !1, 19562 configurable: !0 19563 }), gI.prototype.abort = function (t) { 19564 t && this.ft.reject(t), this.aborted || (Vy("SimpleDb", "Aborting transaction:", t ? t.message : "Client-initiated abort"), this.aborted = !0, this.transaction.abort()) 19565 }, gI.prototype.store = function (t) { 19566 t = this.transaction.objectStore(t); 19567 return new wI(t) 19568 }, gI), 19569 hI = (vI.delete = function (t) { 19570 return Vy("SimpleDb", "Removing database:", t), II(window.indexedDB.deleteDatabase(t)).toPromise() 19571 }, vI.yt = function () { 19572 if ("undefined" == typeof indexedDB) return !1; 19573 if (vI.gt()) return !0; 19574 var t = po(), 19575 e = vI._t(t), 19576 n = 0 < e && e < 10, 19577 e = vI.Et(t), 19578 e = 0 < e && e < 4.5; 19579 return !(0 < t.indexOf("MSIE ") || 0 < t.indexOf("Trident/") || 0 < t.indexOf("Edge/") || n || e) 19580 }, vI.gt = function () { 19581 var t; 19582 return "undefined" != typeof process && "YES" === (null === (t = process.env) || void 0 === t ? void 0 : t.Tt) 19583 }, vI.It = function (t, e) { 19584 return t.store(e) 19585 }, vI._t = function (t) { 19586 t = t.match(/i(?:phone|pad|pod) os ([\d_]+)/i), t = t ? t[1].split("_").slice(0, 2).join(".") : "-1"; 19587 return Number(t) 19588 }, vI.Et = function (t) { 19589 t = t.match(/Android ([\d.]+)/i), t = t ? t[1].split(".").slice(0, 2).join(".") : "-1"; 19590 return Number(t) 19591 }, vI.prototype.At = function (o) { 19592 return $i(this, void 0, void 0, function () { 19593 var e, i = this; 19594 return Zi(this, function (t) { 19595 switch (t.label) { 19596 case 0: 19597 return this.db ? [3, 2] : (Vy("SimpleDb", "Opening database:", this.name), e = this, [4, new Promise(function (e, n) { 19598 var r = indexedDB.open(i.name, i.version); 19599 r.onsuccess = function (t) { 19600 t = t.target.result; 19601 e(t) 19602 }, r.onblocked = function () { 19603 n(new fI(o, "Cannot upgrade IndexedDB schema while another tab is open. Close all tabs that access Firestore and reload this page to proceed.")) 19604 }, r.onerror = function (t) { 19605 t = t.target.error; 19606 "VersionError" === t.name ? n(new Fy(My.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.")) : n(new fI(o, t)) 19607 }
19607, r.onupgradeneeded = function (t) { 19608 Vy("SimpleDb", 'Database "' + i.name + '" requires upgrade from version:', t.oldVersion); 19609 var e = t.target.result; 19610 i.wt.Rt(e, r.transaction, t.oldVersion, i.version).next(function () { 19611 Vy("SimpleDb", "Database upgrade to version " + i.version + " complete") 19612 }) 19613 } 19614 })]); 19615 case 1: 19616 e.db = t.sent(), t.label = 2; 19617 case 2: 19618 return [2, (this.bt && (this.db.onversionchange = function (t) { 19619 return i.bt(t) 19620 }), this.db)] 19621 } 19622 }) 19623 }) 19624 }, vI.prototype.vt = function (e) { 19625 this.bt = e, this.db && (this.db.onversionchange = function (t) { 19626 return e(t) 19627 }) 19628 }, vI.prototype.runTransaction = function (a, n, u, c) { 19629 return $i(this, void 0, void 0, function () { 19630 var i, o, s, e; 19631 return Zi(this, function (t) { 19632 switch (t.label) { 19633 case 0: 19634 i = "readonly" === n, o = 0, e = function () { 19635 var e, n, r; 19636 return Zi(this, function (t) { 19637 switch (t.label) { 19638 case 0: 19639 ++o, t.label = 1; 19640 case 1: 19641 return t.trys.push([1, 4, , 5]), [4, s.At(a)]; 19642 case 2: 19643 return s.db = t.sent(), e = cI.open(s.db, a, i ? "readonly" : "readwrite", u), n = c(e).catch(function (t) { 19644 return e.abort(t), uI.reject(t) 19645 }).toPromise(), r = {}, n.catch(function () {}), [4, e.dt]; 19646 case 3: 19647 return [2, (r.value = (t.sent(), n), r)]; 19648 case 4: 19649 return n = t.sent(), r = "FirebaseError" !== n.name && o < 3, Vy("SimpleDb", "Transaction failed with error:", n.message, "Retrying:", r), s.close(), r ? [3, 5] : [2, { 19650 value: Promise.reject(n) 19651 }]; 19652 case 5: 19653 return [2] 19654 } 19655 }) 19656 }, s = this, t.label = 1; 19657 case 1: 19658 return [5, e()]; 19659 case 2: 19660 if ("object" == typeof (e = t.sent())) return [2, e.value]; 19661 t.label = 3; 19662 case 3: 19663 return [3, 1]; 19664 case 4: 19665 return [2] 19666 } 19667 }) 19668 }) 19669 }, vI.prototype.close = function () { 19670 this.db && this.db.close(), this.db = void 0 19671 }, vI), 19672 lI = (Object.defineProperty(dI.prototype, "isDone", { 19673 get: function () { 19674 return this.Vt 19675 }, 19676 enumerable: !1, 19677 configurable: !0 19678 }), Object.defineProperty(dI.prototype, "Dt", { 19679 get: function () { 19680 return this.St 19681 }, 19682 enumerable: !1, 19683 configurable: !0 19684 }), Object.defineProperty(dI.prototype, "cursor", { 19685 set: function (t) { 19686 this.Pt = t 19687 }, 19688 enumerable: !1, 19689 configurable: !0 19690 }), dI.prototype.done = function () { 19691 this.Vt = !0 19692 }, dI.prototype.Ct = function (t) { 19693 this.St = t 19694 }, dI.prototype.delete = function () { 19695 return II(this.Pt.delete()) 19696 }, dI), 19697 fI = (Xi(pI, iI = Fy), pI); 19698 19699 function pI(t, e) { 19700 var n = this; 19701 return (n = iI.call(this, My.UNAVAILABLE, "IndexedDB transaction '" + t + "' failed: " + e) || this).name = "IndexedDbTransactionError", n 19702 } 19703 19704 function dI(t) { 19705 this.Pt = t, this.Vt = !1, this.St = null 19706 } 19707 19708 function vI(t, e, n) { 19709 this.name = t, this.version = e, this.wt = n, 12.2 === vI._t(po()) && By("Firestore persistence suffers from a bug in
19709iOS 12.2 Safari that may cause your app to stop working. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.") 19710 } 19711 19712 function gI(e, t) { 19713 var n = this; 19714 this.action = e, this.transaction = t, this.aborted = !1, this.ft = new aI, this.transaction.oncomplete = function () { 19715 n.ft.resolve() 19716 }, this.transaction.onabort = function () { 19717 t.error ? n.ft.reject(new fI(e, t.error)) : n.ft.resolve() 19718 }, this.transaction.onerror = function (t) { 19719 t = EI(t.target.error); 19720 n.ft.reject(new fI(e, t)) 19721 } 19722 } 19723 19724 function yI(t) { 19725 var e = this; 19726 this.nextCallback = null, this.catchCallback = null, this.result = void 0, this.error = void 0, this.isDone = !1, this.callbackAttached = !1, t(function (t) { 19727 e.isDone = !0, e.result = t, e.nextCallback && e.nextCallback(t) 19728 }, function (t) { 19729 e.isDone = !0, e.error = t, e.catchCallback && e.catchCallback(t) 19730 }) 19731 } 19732 19733 function mI() { 19734 this.onCommittedListeners = [] 19735 } 19736 19737 function bI(t) { 19738 return "IndexedDbTransactionError" === t.name 19739 } 19740 var wI = (_I.prototype.put = function (t, e) { 19741 t = void 0 !== e ? (Vy("SimpleDb", "PUT", this.store.name, t, e), this.store.put(e, t)) : (Vy("SimpleDb", "PUT", this.store.name, "<auto-key>", t), this.store.put(t)); 19742 return II(t) 19743 }, _I.prototype.add = function (t) { 19744 return Vy("SimpleDb", "ADD", this.store.name, t, t), II(this.store.add(t)) 19745 }, _I.prototype.get = function (e) { 19746 var n = this; 19747 return II(this.store.get(e)).next(function (t) { 19748 return void 0 === t && (t = null), Vy("SimpleDb", "GET", n.store.name, e, t), t 19749 }) 19750 }, _I.prototype.delete = function (t) { 19751 return Vy("SimpleDb", "DELETE", this.store.name, t), II(this.store.delete(t)) 19752 }, _I.prototype.count = function () { 19753 return Vy("SimpleDb", "COUNT", this.store.name), II(this.store.count()) 19754 }, _I.prototype.Nt = function (t, e) { 19755 var e = this.cursor(this.options(t, e)), 19756 n = []; 19757 return this.xt(e, function (t, e) { 19758 n.push(e) 19759 }).next(function () { 19760 return n 19761 }) 19762 }, _I.prototype.Ft = function (t, e) { 19763 Vy("SimpleDb", "DELETE ALL", this.store.name); 19764 e = this.options(t, e); 19765 e.kt = !1; 19766 e = this.cursor(e); 19767 return this.xt(e, function (t, e, n) { 19768 return n.delete() 19769 }) 19770 }, _I.prototype.Ot = function (t, e) { 19771 e ? n = t : (n = {}, e = t); 19772 var n = this.cursor(n); 19773 return this.xt(n, e) 19774 }, _I.prototype.$t = function (r) { 19775 var t = this.cursor({}); 19776 return new uI(function (n, e) { 19777 t.onerror = function (t) { 19778 t = EI(t.target.error); 19779 e(t) 19780 }, t.onsuccess = function (t) { 19781 var e = t.target.result; 19782 e ? r(e.primaryKey, e.value).next(function (t) { 19783 t ? e.continue() : n() 19784 }) : n() 19785 } 19786 }) 19787 }, _I.prototype.xt = function (t, i) { 19788 var o = []; 19789 return new uI(function (r, e) { 19790 t.onerror = function (t) { 19791 e(t.target.error) 19792 }, t.onsuccess = function (t) { 19793 var e, n = t.target.result; 19794 n ? (e = new lI(n), (t = i(n.primaryKey, n.value, e)) instanceof uI && (t = t.catch(function (t) { 19795 return e.done(), uI.reject(t) 19796 }), o.push(t)), e.isDone ? r() : null === e.Dt ? n.continue() : n.continue(e.Dt)) : r() 19797 } 19798 }).next(function () { 19799 return uI.waitFor(o) 19800 }) 19801 }, _I.prototype.options = function (t, e) { 19802 var n; 19803 return void 0 !== t && ("string" == typeof t ? n = t : e = t), { 19804 index: n, 19805 range: e 19806 } 19807 }, _I.prototype.cursor = function (t) { 19808 var e = "next"; 19809 if (t.reverse && (e = "prev"), t.index) { 19810 var n = this.store.index(t.index); 19811 return t.kt ? n.openKeyCursor(t.range, e) : n.openCursor(t.range, e) 19812 } 19813 return this.store.openCursor(t.range, e) 19814 }, _I); 19815 19816 function _I(t) { 19817 this.store = t 19818 } 19819 19820 function II(t) { 19821 return new uI(function (e, n) { 19822 t.onsuccess = function (t) { 19823 t = t.target.result; 19824 e(t) 19825 }, t.onerror = function (t) { 19826 t = EI(t.target.error); 19827 n(t) 19828 } 19829 }) 19830 } 19831 var TI = !1; 19832 19833 function EI(t) { 19834 var e = hI._t(po()); 19835 if (12.2 <= e && e < 13) { 19836 e = "An internal error was encountered in the Indexed Database server"; 19837 if (0 <= t.message.indexOf(e)) { 19838 var n = new Fy("internal", "IOS_INDEXEDDB_BUG1: IndexedDb has thrown '" + e + "'. This is likely due to an unavoidable bug in iOS. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround."); 19839 return TI || (TI = !0, setTimeout(function () { 19840 throw n 19841 }, 0)), n 19842 } 19843 } 19844 return t 19845 } 19846 var SI, CI = (Xi(NI, SI = Ga), NI); 19847 19848 function NI(t, e) { 19849 var n = this; 19850 return (n = SI.call(this) || this).Mt = t, n.currentSequenceNumber = e, n 19851 } 19852 19853 function AI(t, e) { 19854 return hI.It(t.Mt, e) 19855 } 19856 var kI = (LI.prototype.applyToRemoteDocument = function (t, e) { 19857 for (var n, r, i, o, s, a, u = e.mutationResults, c = 0; c < this.mutations.length; c++) { 19858 var h = this.mutations[c]; 19859 h.key.isEqual(t.key) && (n = h, r = t, i = u[c], h = a = s = o = void 0, n instanceof yw ? (s = r, a = i, h = (o = n).value.clone(), o = Iw(o.fieldTransforms, s, a.transformResults), h.setAll(o), s.convertToFoundDocument(a.version, h).setHasCommittedMutations()) : n instanceof mw ? (o = r, s = i, lw((a = n).precondition, o) ? (h = Iw(a.fieldTransforms, o, s.transformResults), (n = o.data).setAll(_w(a)), n.setAll(h), o.convertToFoundDocument(s.version, n).setHasCommittedMutations()) : o.convertToUnknownDocument(s.version)) : r.convertToNoDocument(i.version).setHasCommittedMutations()) 19860 } 19861 }, LI.prototype.applyToLocalView = function (t) { 19862 for (var e = 0, n = this.baseMutations; e < n.length; e++)(r = n[e]).key.isEqual(t.key) && fw(r, t, this.localWriteTime); 19863 for (var r, i = 0, o = this.mutations; i < o.length; i++)(r = o[i]).key.isEqual(t.key) && fw(r, t, this.localWriteTime) 19864 }, LI.prototype.applyToLocalDocumentSet = function (n) { 19865 var r = this; 19866 this.mutations.forEach(function (t) { 19867 var e = n.get(t.key), 19868 t = e; 19869 r.applyToLocalView(t), e.isValidDocument() || t.convertToNoDocument(Zy.min()) 19870 }) 19871 }, LI.prototype.keys = function () { 19872 return this.mutations.reduce(function (t, e) { 19873 return t.add(e.key) 19874 }, Yw()) 19875 }, LI.prototype.isEqual = function (t) { 19876 return this.batchId === t.batchId && Xy(this.mutations, t.mutations, pw) && Xy(this.baseMutations, t.baseMutations, pw) 19877 }, LI), 19878 RI = (xI.from = function (t, e, n) { 19879 Gy(t.mutations.length === n.length); 19880 for (var r = zw, i = t.mutations, o = 0; o < i.length; o++) r = r.insert(i[o].key, n[o].version); 19881 return new xI(t, e, n, r) 19882 }, xI), 19883 PI = (DI.prototype.withSequenceNumber = function (t) { 19884 return new DI(this.target, this.targetId, this.purpose, t, this.snapshotVersion, this.lastLimboFreeSnapshotVersion, this.resumeToken) 19885 }, DI.prototype.withResumeToken = function (t, e) { 19886 return new DI(this.target, this.targetId, this.purpose, this.sequenceNumber, e, this.lastLimboFreeSnapshotVersion, t) 19887 }, DI.prototype.withLastLimboFreeSnapshotVersion = function (t) { 19888 return new DI(this.target, this.targetId, this.purpose, this.sequenceNumber, this.snapshotVersion, t, this.resumeToken) 19889 }, DI), 19890 OI = function (t) { 19891 this.Lt = t 19892 }; 19893 19894 function DI(t, e, n, r, i, o, s) { 19895 void 0 === i && (i = Zy.min()), void 0 === o && (o = Zy.min()), void 0 === s && (s = lm.EMPTY_BYTE_STRING), this.target = t, this.targetId = e, this.purpose = n, this.sequenceNumber = r, this.snapshotVersion = i, this.lastLimboFreeSnapshotVersion = o, this.resumeToken = s 19896 } 19897 19898 function xI(t, e, n, r) { 19899 this.batch = t, this.commitVersion = e, this.mutationResults = n, this.docVersions = r 19900 } 19901 19902 function LI(t, e, n, r) { 19903 this.batchId = t, this.localWriteTime = e, this.baseMutations = n, this.mutations = r 19904 } 19905 19906 function MI(t, e) { 19907 if (e.document) return S_(t.Lt, e.document, !!e.hasCommittedMutations); 19908 if (e.noDocument) { 19909 var n = Cm.fromSegments(e.noDocument.path), 19910 r = VI(e.noDocument.readTime), 19911 n = Bm.newNoDocument(n, r); 19912 return e.hasCommittedMutations ? n.setHasCommittedMutations() : n 19913 } 19914 if (e.unknownDocument) { 19915 n = Cm.fromSegments(e.unknownDocument.path), r = VI(e.unknownDocument.version); 19916 return Bm.newUnknownDocument(n, r) 19917 } 19918 return Hy() 19919 } 19920 19921 function FI(t, e, n) { 19922 var r = UI(n), 19923 n = e.key.path.popLast().toArray(); 19924 if (e.isFoundDocument()) { 19925 var i = { 19926 name: m_(o = t.Lt, (s = e).key), 19927 fields: s.data.toProto().mapValue.fields, 19928 updateTime: p_(o, s.version.toTimestamp()) 19929 }, 19930 o = e.hasCommittedMutations; 19931 return new Y_(null, null, i, o, r, n) 19932 } 19933 if (e.isNoDocument()) { 19934 var s = e.key.path.toArray(), 19935 i = qI(e.version), 19936 o = e.hasCommittedMutations; 19937 return new Y_(null, new z_(s, i), null, o, r, n) 19938 } 19939 if (e.isUnknownDocument()) { 19940 o = e.key.path.toArray(), e = qI(e.version); 19941 return new Y_(new Q_(o, e), null, null, !0, r, n) 19942 } 19943 return Hy() 19944 } 19945 19946 function UI(t) { 19947 t = t.toTimestamp(); 19948 return [t.seconds, t.nanoseconds] 19949 } 19950 19951 function jI(t) { 19952 t = new $y(t[0], t[1]); 19953 return Zy.fromTimestamp(t) 19954 } 19955 19956 function qI(t) { 19957 t = t.toTimestamp(); 19958 return new B_(t.seconds, t.nanoseconds) 19959 } 19960 19961 function VI(t) { 19962 t = new $y(t.seconds, t.nanoseconds); 19963 return Zy.fromTimestamp(t) 19964 } 19965 19966 function BI(e, t) { 19967 for (var n = (t.baseMutations || []).map(function (t) { 19968 return N_(e.Lt, t) 19969 }), r = 0; r < t.mutations.length - 1; ++r) { 19970 var i, o = t.mutations[r]; 19971 r + 1 < t.mutations.length && void 0 !== t.mutations[r + 1].transform && (i = t.mutations[r + 1], o.updateTransforms = i.transform.fieldTransforms, t.mutations.splice(r + 1, 1), ++r) 19972 } 19973 var s = t.mutations.map(function (t) { 19974 return N_(e.Lt, t) 19975 }), 19976 a = $y.fromMillis(t.localWriteTimeMs); 19977 return new kI(t.batchId, a, n, s) 19978 } 19979 19980 function KI(t) { 19981 var e = VI(t.readTime), 19982 n = void 0 !== t.lastLimboFreeSnapshotVersion ? VI(t.lastLimboFreeSnapshotVersion) : Zy.min(), 19983 r = void 0 !== t.query.documents ? (Gy(1 === (r = t.query).documents.length), xb(Nb(__(r.documents[0])))) : xb(R_(t.query)); 19984 return new PI(r, t.targetId, 0, t.lastListenSequenceNumber, e, n, lm.fromBase64String(t.resumeToken)) 19985 } 19986 19987 function WI(t, e) { 19988 var n = qI(e.snapshotVersion), 19989 r = qI(e.lastLimboFreeSnapshotVersion), 19990 i = (Qm(e.target) ? A_ : k_)(t.Lt, e.target), 19991 t = e.resumeToken.toBase64(); 19992 return new J_(e.targetId, Gm(e.target), n, t, e.sequenceNumber, r, i) 19993 } 19994 19995 function HI(t) { 19996 var e = R_({ 19997 parent: t.parent, 19998 structuredQuery: t.structuredQuery 19999 }); 20000 return "LAST" === t.limitType ? Lb(e, e.limit, "L") : e 20001 } 20002 var GI = (zI.prototype.getBundleMetadata = function (t, e) { 20003 return QI(t).get(e).next(function (t) { 20004 if (t) return { 20005 id: (t = t).bundleId, 20006 createTime: VI(t.createTime), 20007 version: t.version 20008 } 20009 }) 20010 }, zI.prototype.saveBundleMetadata = function (t, e) { 20011 return QI(t).put({ 20012 bundleId: (e = e).id, 20013 createTime: qI(v_(e.createTime)), 20014 version: e.version 20015 }) 20016 }
20016, zI.prototype.getNamedQuery = function (t, e) { 20017 return YI(t).get(e).next(function (t) { 20018 if (t) return { 20019 name: (t = t).name, 20020 query: HI(t.bundledQuery), 20021 readTime: VI(t.readTime) 20022 } 20023 }) 20024 }, zI.prototype.saveNamedQuery = function (t, e) { 20025 return YI(t).put({ 20026 name: (e = e).name, 20027 readTime: qI(v_(e.readTime)), 20028 bundledQuery: e.bundledQuery 20029 }) 20030 }, zI); 20031 20032 function zI() {} 20033 20034 function QI(t) { 20035 return AI(t, nI.store) 20036 } 20037 20038 function YI(t) { 20039 return AI(t, rI.store) 20040 } 20041 var XI = (eT.prototype.addToCollectionParentIndex = function (t, e) { 20042 return this.Bt.add(e), uI.resolve() 20043 }, eT.prototype.getCollectionParents = function (t, e) { 20044 return uI.resolve(this.Bt.getEntries(e)) 20045 }, eT), 20046 JI = (tT.prototype.add = function (t) { 20047 var e = t.lastSegment(), 20048 n = t.popLast(), 20049 r = this.index[e] || new Vw(am.comparator), 20050 t = !r.has(n); 20051 return this.index[e] = r.add(n), t 20052 }, tT.prototype.has = function (t) { 20053 var e = t.lastSegment(), 20054 t = t.popLast(), 20055 e = this.index[e]; 20056 return e && e.has(t) 20057 }, tT.prototype.getEntries = function (t) { 20058 return (this.index[t] || new Vw(am.comparator)).toArray() 20059 }, tT), 20060 $I = (ZI.prototype.addToCollectionParentIndex = function (t, e) { 20061 var n = this; 20062 if (this.qt.has(e)) return uI.resolve(); 20063 var r = e.lastSegment(), 20064 i = e.popLast(); 20065 t.addOnCommittedListener(function () { 20066 n.qt.add(e) 20067 }); 20068 i = { 20069 collectionId: r, 20070 parent: U_(i) 20071 }; 20072 return nT(t).put(i) 20073 }, ZI.prototype.getCollectionParents = function (t, i) { 20074 var o = [], 20075 e = IDBKeyRange.bound([i, ""], [Jy(i), ""], !1, !0); 20076 return nT(t).Nt(e).next(function (t) { 20077 for (var e = 0, n = t; e < n.length; e++) { 20078 var r = n[e]; 20079 if (r.collectionId !== i) break; 20080 o.push(q_(r.parent)) 20081 } 20082 return o 20083 }) 20084 }, ZI); 20085 20086 function ZI() { 20087 this.qt = new JI 20088 } 20089 20090 function tT() { 20091 this.index = {} 20092 } 20093 20094 function eT() { 20095 this.Bt = new JI 20096 } 20097 20098 function nT(t) { 20099 return AI(t, tI.store) 20100 } 20101 var rT = { 20102 didRun: !1, 20103 sequenceNumbersCollected: 0, 20104 targetsRemoved: 0, 20105 documentsRemoved: 0 20106 }, 20107 iT = (oT.withCacheSize = function (t) { 20108 return new oT(t, oT.DEFAULT_COLLECTION_PERCENTILE, oT.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT) 20109 }, oT); 20110 20111 function oT(t, e, n) { 20112 this.cacheSizeCollectionThreshold = t, this.percentileToCollect = e, this.maximumSequenceNumbersToCollect = n 20113 } 20114 20115 function sT(t, e, n) { 20116 var r = t.store(W_.store), 20117 i = t.store(H_.store), 20118 o = [], 20119 t = IDBKeyRange.only(n.batchId), 20120 s = 0, 20121 t = r.Ot({ 20122 range: t 20123 }, function (t, e, n) { 20124 return s++, n.delete() 20125 }); 20126 o.push(t.next(function () { 20127 Gy(1 === s) 20128 })); 20129 for (var a = [], u = 0, c = n.mutations; u < c.length; u++) { 20130 var h = c[u], 20131 l = H_.key(e, h.key.path, n.batchId); 20132 o.push(i.delete(l)), a.push(h.key) 20133 } 20134 return uI.waitFor(o).next(function () { 20135 return a 20136 }) 20137 } 20138 20139 function aT(t) { 20140 if (!t) return 0; 20141 var e; 20142 if (t.document) e = t.document; 20143 else if (t.unknownDocument) e = t.unknownDocument; 20144 else { 20145 if (!t.noDocument) throw Hy(); 20146 e = t.noDocument 20147 } 20148 return JSON.stringify(e).length 20149 } 20150 iT.DEFAULT_COLLECTION_PERCENTILE = 10, iT.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT = 1e3, iT.DEFAULT = new iT(41943040, iT.DEFAULT_COLLECTION_PE
20150RCENTILE, iT.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT), iT.DISABLED = new iT(-1, 0, 0); 20151 var uT = (cT.Kt = function (t, e, n, r) { 20152 return Gy("" !== t.uid), new cT(t.isAuthenticated() ? t.uid : "", e, n, r) 20153 }, cT.prototype.checkEmpty = function (t) { 20154 var r = !0, 20155 e = IDBKeyRange.bound([this.userId, Number.NEGATIVE_INFINITY], [this.userId, Number.POSITIVE_INFINITY]); 20156 return lT(t).Ot({ 20157 index: W_.userMutationsIndex, 20158 range: e 20159 }, function (t, e, n) { 20160 r = !1, n.done() 20161 }).next(function () { 20162 return r 20163 }) 20164 }, cT.prototype.addMutationBatch = function (d, v, g, y) { 20165 var m = this, 20166 b = fT(d), 20167 w = lT(d); 20168 return w.add({}).next(function (t) { 20169 Gy("number" == typeof t); 20170 for (var e, n, r, i, o, s = new kI(t, v, g, y), a = (e = m.R, n = m.userId, i = (r = s).baseMutations.map(function (t) { 20171 return C_(e.Lt, t) 20172 }), o = r.mutations.map(function (t) { 20173 return C_(e.Lt, t) 20174 }), new W_(n, r.batchId, r.localWriteTime.toMillis(), i, o)), u = [], c = new Vw(function (t, e) { 20175 return Yy(t.canonicalString(), e.canonicalString()) 20176 }), h = 0, l = y; h < l.length; h++) { 20177 var f = l[h], 20178 p = H_.key(m.userId, f.key.path, t), 20179 c = c.add(f.key.path.popLast()); 20180 u.push(w.put(a)), u.push(b.put(p, H_.PLACEHOLDER)) 20181 } 20182 return c.forEach(function (t) { 20183 u.push(m.Ut.addToCollectionParentIndex(d, t)) 20184 }), d.addOnCommittedListener(function () { 20185 m.Qt[t] = s.keys() 20186 }), uI.waitFor(u).next(function () { 20187 return s 20188 }) 20189 }) 20190 }, cT.prototype.lookupMutationBatch = function (t, e) { 20191 var n = this; 20192 return lT(t).get(e).next(function (t) { 20193 return t ? (Gy(t.userId === n.userId), BI(n.R, t)) : null 20194 }) 20195 }, cT.prototype.jt = function (t, e) { 20196 var n = this; 20197 return this.Qt[e] ? uI.resolve(this.Qt[e]) : this.lookupMutationBatch(t, e).next(function (t) { 20198 if (t) { 20199 t = t.keys(); 20200 return n.Qt[e] = t 20201 } 20202 return null 20203 }) 20204 }, cT.prototype.getNextMutationBatchAfterBatchId = function (t, e) { 20205 var r = this, 20206 i = e + 1, 20207 e = IDBKeyRange.lowerBound([this.userId, i]), 20208 o = null; 20209 return lT(t).Ot({ 20210 index: W_.userMutationsIndex, 20211 range: e 20212 }, function (t, e, n) { 20213 e.userId === r.userId && (Gy(e.batchId >= i), o = BI(r.R, e)), n.done() 20214 }).next(function () { 20215 return o 20216 }) 20217 }, cT.prototype.getHighestUnacknowledgedBatchId = function (t) { 20218 var e = IDBKeyRange.upperBound([this.userId, Number.POSITIVE_INFINITY]), 20219 r = -1; 20220 return lT(t).Ot({ 20221 index: W_.userMutationsIndex, 20222 range: e, 20223 reverse: !0 20224 }, function (t, e, n) { 20225 r = e.batchId, n.done() 20226 }).next(function () { 20227 return r 20228 }) 20229 }, cT.prototype.getAllMutationBatches = function (t) { 20230 var e = this, 20231 n = IDBKeyRange.bound([this.userId, -1], [this.userId, Number.POSITIVE_INFINITY]); 20232 return lT(t).Nt(W_.userMutationsIndex, n).next(function (t) { 20233 return t.map(function (t) { 20234 return BI(e.R, t) 20235 }) 20236 }) 20237 }, cT.prototype.getAllMutationBatchesAffectingDocumentKey = function (o, s) { 20238 var a = this, 20239 t = H_.prefixForPath(this.userId, s.path), 20240 t = IDBKeyRange.lowerBound(t), 20241 u = []; 20242 return fT(o).Ot({ 20243 range: t 20244 }, function (t, e, n) { 20245 var r = t[0], 20246 i = t[1], 20247 t = t[2], 20248 i = q_(i); 20249 if (r === a.userId && s.path.isEqual(i)) return lT(o).get(t).next(function (t) { 20250 if (!t) throw Hy(); 20251 Gy(t.userId === a.userId), u.push(BI(a.R, t)) 20252 }); 20253 n.done() 20254 }).next(function () { 20255 return u 20256 }) 20257 }, cT.prototype.getAllMutationBatchesAffectingDocumentKeys = function (e, t) { 20258 var s = this, 20259 a = new Vw(Yy), 20260 n = []; 20261 return t.forEach(function (o) { 20262 var t = H_.prefixForPath(s.userId, o.path), 20263 t = IDBKeyRange.lowerBound(t), 20264 t = fT(e).Ot({ 20265 range: t 20266 }, function (t, e, n) { 20267 var r = t[0], 20268 i = t[1], 20269 t = t[2], 20270 i = q_(i); 20271 r === s.userId && o.path.isEqual(i) ? a = a.add(t) : n.done() 20272 }); 20273 n.push(t) 20274 }), uI.waitFor(n).next(function () { 20275 return s.Wt(e, a) 20276 }) 20277 }, cT.prototype.getAllMutationBatchesAffectingQuery = function (t, e) { 20278 var o = this, 20279 s = e.path, 20280 a = s.length + 1, 20281 e = H_.prefixForPath(this.userId, s), 20282 e = IDBKeyRange.lowerBound(e), 20283 u = new Vw(Yy); 20284 return fT(t).Ot({ 20285 range: e 20286 }, function (t, e, n) { 20287 var r = t[0], 20288 i = t[1], 20289 t = t[2], 20290 i = q_(i); 20291 r === o.userId && s.isPrefixOf(i) ? i.length === a && (u = u.add(t)) : n.done() 20292 }).next(function () { 20293 return o.Wt(t, u) 20294 }) 20295 }, cT.prototype.Wt = function (e, t) { 20296 var n = this, 20297 r = [], 20298 i = []; 20299 return t.forEach(function (t) { 20300 i.push(lT(e).get(t).next(function (t) { 20301 if (null === t) throw Hy(); 20302 Gy(t.userId === n.userId), r.push(BI(n.R, t)) 20303 })) 20304 }), uI.waitFor(i).next(function () { 20305 return r 20306 }) 20307 }, cT.prototype.removeMutationBatch = function (e, n) { 20308 var r = this; 20309 return sT(e.Mt, this.userId, n).next(function (t) { 20310 return e.addOnCommittedListener(function () { 20311 r.Gt(n.batchId) 20312 }), uI.forEach(t, function (t) { 20313 return r.referenceDelegate.markPotentiallyOrphaned(e, t) 20314 }) 20315 }) 20316 }, cT.prototype.Gt = function (t) { 20317 delete this.Qt[t] 20318 }, cT.prototype.performConsistencyCheck = function (e) { 20319 var i = this; 20320 return this.checkEmpty(e).next(function (t) { 20321 if (!t) return uI.resolve(); 20322 var t = IDBKeyRange.lowerBound(H_.prefixForUser(i.userId)), 20323 r = []; 20324 return fT(e).Ot({ 20325 range: t 20326 }, function (t, e, n) { 20327 t[0] === i.userId ? (t = q_(t[1]), r.push(t)) : n.done() 20328 }).next(function () { 20329 Gy(0 === r.length) 20330 }) 20331 }) 20332 }, cT.prototype.containsKey = function (t, e) { 20333 return hT(t, this.userId, e) 20334 }, cT.prototype.zt = function (t) { 20335 var e = this; 20336 return pT(t).get(this.userId).next(function (t) { 20337 return t || new K_(e.userId, -1, "") 20338 }) 20339 }, cT); 20340 20341 function cT(t, e, n, r) { 20342 this.userId = t, this.R = e, this.Ut = n, this.referenceDelegate = r, this.Qt = {} 20343 } 20344 20345 function hT(t, o, e) { 20346 var e = H_.prefixForPath(o, e.path), 20347 s = e[1], 20348 e = IDBKeyRange.lowerBound(e), 20349 a = !1; 20350 return fT(t).Ot({ 20351 range: e, 20352 kt: !0 20353 }, function (t, e, n) { 20354 var r = t[0], 20355 i = t[1]; 20356 t[2], r === o && i === s && (a = !0), n.done() 20357 }).next(function () { 20358 return a 20359 }) 20360 } 20361 20362 function lT(t) { 20363 return AI(t, W_.store) 20364 } 20365 20366 function fT(t) { 20367 return AI(t, H_.store) 20368 } 20369 20370 function pT(t) { 20371 return AI(t, K_.store) 20372 } 20373 var dT = (yT.prototype.next = function () { 20374 return this.Ht += 2, this.Ht 20375 }, yT.Jt = function () { 20376 return new yT(0) 20377 }, yT.Yt = function () { 20378 return new yT(-1) 20379 }, yT), 20380 vT = (gT.prototype.allocateTargetId = function (n) { 20381 var r = this; 20382 return this.Xt(n).next(function (t) { 20383 var e = new dT(t.highestTargetId); 20384 return t.highestTargetId = e.next(), r.Zt(n, t).next(function () { 20385 return t.highestTargetId 20386 }) 20387 }) 20388 }, gT.prototype.getLastRemoteSnapshotVersion = function (t) { 20389 return this.Xt(t).next(function (t) { 20390 return Zy.fromTimestamp(new $y(t.lastRemoteSnapshotVersion.seconds, t.lastRemoteSnapshotVersion.nanoseconds)) 20391 }) 20392 }, gT.prototype.getHighestSequenceNumber = function (t) { 20393 return this.Xt(t).next(function (t) { 20394 return t.highestListenSequenceNumber 20395 }) 20396 }, gT.prototype.setTargetsMetadata = function (e, n, r) { 20397 var i = this; 20398 return this.Xt(e).next(function (t) { 20399 return t.highestListenSequenceNumber = n, r && (t.lastRemoteSnapshotVersion = r.toTimestamp()), n > t.highestListenSequenceNumber && (t.highestListenSequenceNumber = n), i.Zt(e, t) 20400 }) 20401 }, gT.prototype.addTargetData = function (e, n) { 20402 var r = this; 20403 return this.te(e, n).next(function () { 20404 return r.Xt(e).next(function (t) { 20405 return t.targetCount += 1, r.ee(n, t), r.Zt(e, t) 20406 }) 20407 }) 20408 }, gT.prototype.updateTargetData = function (t, e) { 20409 return this.te(t, e) 20410 }, gT.prototype.removeTargetData = function (e, t) { 20411 var n = this; 20412 return this.removeMatchingKeysForTargetId(e, t.targetId).next(function () { 20413 return mT(e).delete(t.targetId) 20414 }).next(function () { 20415 return n.Xt(e) 20416 }).next(function (t) { 20417 return Gy(0 < t.targetCount), --t.targetCount, n.Zt(e, t) 20418 }) 20419 }, gT.prototype.removeTargets = function (n, r, i) { 20420 var o = this, 20421 s = 0, 20422 a = []; 20423 return mT(n).Ot(function (t, e) { 20424 e = KI(e); 20425 e.sequenceNumber <= r && null === i.get(e.targetId) && (s++, a.push(o.removeTargetData(n, e))) 20426 }).next(function () { 20427 return uI.waitFor(a) 20428 }).next(function () { 20429 return s 20430 }) 20431 }, gT.prototype.forEachTarget = function (t, n) { 20432 return mT(t).Ot(function (t, e) { 20433 e = KI(e); 20434 n(e) 20435 }) 20436 }, gT.prototype.Xt = function (t) { 20437 return bT(t).get(Z_.key).next(function (t) { 20438 return Gy(null !== t), t 20439 }) 20440 }, gT.prototype.Zt = function (t, e) { 20441 return bT(t).put(Z_.key, e) 20442 }, gT.prototype.te = function (t, e) { 20443 return mT(t).put(WI(this.R, e)) 20444 }, gT.prototype.ee = function (t, e) { 20445 var n = !1; 20446 return t.targetId > e.highestTargetId && (e.highestTargetId = t.targetId, n = !0), t.sequenceNumber > e.highestListenSequenceNumber && (e.highestListenSequenceNumber = t.sequenceNumber, n = !0), n 20447 }, gT.prototype.getTargetCount = function (t) { 20448 return this.Xt(t).next(function (t) { 20449 return t.targetCount 20450 }) 20451 }, gT.prototype.getTargetData = function (t, r) { 20452 var e = Gm(r), 20453 e = IDBKeyRange.bound([e, Number.NEGATIVE_INFINITY], [e, Number.POSITIVE_INFINITY]), 20454 i = null; 20455 return mT(t).Ot({ 20456 range: e, 20457 index: J_.queryTargetsIndexName 20458 }, function (t, e, n) { 20459 e = KI(e); 20460 zm(r, e.target) && (i = e, n.done()) 20461 }).next(function () { 20462 return i 20463 }) 20464 }, gT.prototype.addMatchingKeys = function (n, t, r) { 20465 var i = this, 20466 o = [], 20467 s = wT(n); 20468 return t.forEach(function (t) { 20469 var e = U_(t.path); 20470 o.push(s.put(new $_(r, e))), o.push(i.referenceDelegate.addReference(n, r, t)) 20471 }), uI.waitFor(o) 20472 }, gT.prototype.removeMatchingKeys = function (n, t, r) { 20473 var i = this, 20474 o = wT(n); 20475 return uI.forEach(t, function (t) { 20476 var e = U_(t.path); 20477 return uI.waitFor([o.delete([r, e]), i.referenceDelegate.removeReference(n, r, t)]) 20478 }) 20479 }, gT.prototype.removeMatchingKeysForTargetId = function (t, e) { 20480 t = wT(t), e = IDBKeyRange.bound([e], [e + 1], !1, !0); 20481 return t.delete(e) 20482 }, gT.prototype.getMatchingKeysForTargetId = function (t, e) { 20483 var e = IDBKeyRange.bound([e], [e + 1], !1, !0), 20484 t = wT(t), 20485 r = Yw(); 20486 return t.Ot({ 20487 range: e, 20488 kt: !0 20489 }, function (t, e, n) { 20490 t = q_(t[1]), t = new Cm(t); 20491 r = r.add(t) 20492 }).next(function () { 20493 return r 20494 }) 20495 }, gT.prototype.containsKey = function (t, e) { 20496 var e = U_(e.path), 20497 e = IDBKeyRange.bound([e], [Jy(e)], !1, !0), 20498 i = 0; 20499 return wT(t).Ot({ 20500 index: $_.documentTargetsIndex, 20501 kt: !0, 20502 range: e 20503 }, function (t, e, n) { 20504 var r = t[0]; 20505 t[1], 0 !== r && (i++, n.done()) 20506 }).next(function () { 20507 return 0 < i 20508 }) 20509 }, gT.prototype.lt = function (t, e) { 20510 return mT(t).get(e).next(function (t) { 20511 return t ? KI(t) : null 20512 }) 20513 }, gT); 20514 20515 function gT(t, e) { 20516 this.referenceDelegate = t, this.R = e 20517 } 20518 20519 function yT(t) { 20520 this.Ht = t 20521 } 20522 20523 function mT(t) { 20524 return AI(t, J_.store) 20525 } 20526 20527 function bT(t) { 20528 return AI(t, Z_.store) 20529 } 20530 20531 function wT(t) { 20532 return AI(t, $_.store) 20533 } 20534 20535 function _T(e) { 20536 return $i(this, void 0, void 0, function () { 20537 return Zi(this, function (t) { 20538 if (e.code !== My.FAILED_PRECONDITION || e.message !== sI
20538) throw e; 20539 return Vy("LocalStore", "Unexpectedly lost primary lease"), [2] 20540 }) 20541 }) 20542 } 20543 20544 function IT(t, e) { 20545 var n = t[0], 20546 r = t[1], 20547 t = e[0], 20548 e = e[1], 20549 t = Yy(n, t); 20550 return 0 === t ? Yy(r, e) : t 20551 } 20552 var TT = (RT.prototype.ie = function () { 20553 return ++this.se 20554 }, RT.prototype.re = function (t) { 20555 var e = [t, this.ie()]; 20556 this.buffer.size < this.ne ? this.buffer = this.buffer.add(e) : IT(e, t = this.buffer.last()) < 0 && (this.buffer = this.buffer.delete(t).add(e)) 20557 }, Object.defineProperty(RT.prototype, "maxValue", { 20558 get: function () { 20559 return this.buffer.last()[0] 20560 }, 20561 enumerable: !1, 20562 configurable: !0 20563 }), RT), 20564 ET = (kT.prototype.start = function (t) { 20565 -1 !== this.garbageCollector.params.cacheSizeCollectionThreshold && this.ue(t) 20566 }, kT.prototype.stop = function () { 20567 this.ce && (this.ce.cancel(), this.ce = null) 20568 }, Object.defineProperty(kT.prototype, "started", { 20569 get: function () { 20570 return null !== this.ce 20571 }, 20572 enumerable: !1, 20573 configurable: !0 20574 }), kT.prototype.ue = function (n) { 20575 var t = this, 20576 e = this.oe ? 3e5 : 6e4; 20577 Vy("LruGarbageCollector", "Garbage collection scheduled in " + e + "ms"), this.ce = this.asyncQueue.enqueueAfterDelay("lru_garbage_collection", e, function () { 20578 return $i(t, void 0, void 0, function () { 20579 var e; 20580 return Zi(this, function (t) { 20581 switch (t.label) { 20582 case 0: 20583 this.ce = null, this.oe = !0, t.label = 1; 20584 case 1: 20585 return t.trys.push([1, 3, , 7]), [4, n.collectGarbage(this.garbageCollector)]; 20586 case 2: 20587 return t.sent(), [3, 7]; 20588 case 3: 20589 return bI(e = t.sent()) ? (Vy("LruGarbageCollector", "Ignoring IndexedDB error during garbage collection: ", e), [3, 6]) : [3, 4]; 20590 case 4: 20591 return [4, _T(e)]; 20592 case 5: 20593 t.sent(), t.label = 6; 20594 case 6: 20595 return [3, 7]; 20596 case 7: 20597 return [4, this.ue(n)]; 20598 case 8: 20599 return t.sent(), [2] 20600 } 20601 }) 20602 }) 20603 }) 20604 }, kT), 20605 ST = (AT.prototype.calculateTargetCount = function (t, e) { 20606 return this.ae.he(t).next(function (t) { 20607 return Math.floor(e / 100 * t) 20608 }) 20609 }, AT.prototype.nthSequenceNumber = function (t, e) { 20610 var n = this; 20611 if (0 === e) return uI.resolve(Dy.o); 20612 var r = new TT(e); 20613 return this.ae.forEachTarget(t, function (t) { 20614 return r.re(t.sequenceNumber) 20615 }).next(function () { 20616 return n.ae.le(t, function (t) { 20617 return r.re(t) 20618 }) 20619 }).next(function () { 20620 return r.maxValue 20621 }) 20622 }, AT.prototype.removeTargets = function (t, e, n) { 20623 return this.ae.removeTargets(t, e, n) 20624 }, AT.prototype.removeOrphanedDocuments = function (t, e) { 20625 return this.ae.removeOrphanedDocuments(t, e) 20626 }, AT.prototype.collect = function (e, n) { 20627 var r = this; 20628 return -1 === this.params.cacheSizeCollectionThreshold ? (Vy("LruGarbageCollector", "Garbage collection skipped; disabled"), uI.resolve(rT)) : this.getCacheSize(e).next(function (t) { 20629 return t < r.params.cacheSizeCollectionThreshold ? (Vy("LruGarbageCollector", "Garbage collection skipped; Cache size " + t + " is lower than threshold " + r.params.cacheSizeCollectionThreshold), rT) : r.fe(e, n) 20630 }) 20631 }, AT.prototype.getCacheSize = function (t) { 20632 return this.ae.getCacheSize(t) 20633 }, AT.prototype.fe = function (e, n) { 20634 var r, i, o, s, a, u, c, h = this, 20635 l = Date.now(); 20636 return this.calculateTargetCount(e, this.params.percentileToCollect).next(function (t) { 20637 return i = t > h.params.maximumSequenceNumbersToCollect ? (Vy("LruGarbageCollector", "Capping sequence numbers to collect down to the maximum of " + h.params.maximumSequenceNumbersToCollect + " from " + t), h.params.maximumSequenceNumbersToCollect) : t, s = Date.now(), h.nthSequenceNumber(e, i) 20638 }).next(function (t) { 20639 return r = t, a = Date.now(), h.removeTargets(e, r, n) 20640 }).next(function (t) { 20641 return o = t, u = Date.now(), h.removeOrphanedDocuments(e, r) 20642 }).next(function (t) { 20643 return c = Date.now(), qy() <= as.DEBUG && Vy("LruGarbageCollector", "LRU Garbage Collection\n\tCounted targets in " + (s - l) + "ms\n\tDetermined least recently used " + i + " in " + (a - s) + "ms\n\tRemoved " + o + " targets in " + (u - a) + "ms\n\tRemoved " + t + " documents in " + (c - u) + "ms\nTotal Duration: " + (c - l) + "ms"), uI.resolve({ 20644 didRun: !0, 20645 sequenceNumbersCollected: i, 20646 targetsRemoved: o, 20647 documentsRemoved: t 20648 }) 20649 }) 20650 }, AT), 20651 CT = (NT.prototype.he = function (t) { 20652 var n = this.de(t); 20653 return this.db.getTargetCache().getTargetCount(t).next(function (e) { 20654 return n.next(function (t) { 20655 return e + t 20656 }) 20657 }) 20658 }, NT.prototype.de = function (t) { 20659 var e = 0; 20660 return this.le(t, function (t) { 20661 e++ 20662 }).next(function () { 20663 return e 20664 }) 20665 }, NT.prototype.forEachTarget = function (t, e) {
20666 return this.db.getTargetCache().forEachTarget(t, e) 20667 }, NT.prototype.le = function (t, n) { 20668 return this.we(t, function (t, e) { 20669 return n(e) 20670 }) 20671 }, NT.prototype.addReference = function (t, e, n) { 20672 return PT(t, n) 20673 }, NT.prototype.removeReference = function (t, e, n) { 20674 return PT(t, n) 20675 }, NT.prototype.removeTargets = function (t, e, n) { 20676 return this.db.getTargetCache().removeTargets(t, e, n) 20677 }, NT.prototype.markPotentiallyOrphaned = PT, NT.prototype._e = function (t, e) { 20678 return r = e, i = !1, pT(n = t).$t(function (t) { 20679 return hT(n, t, r).next(function (t) { 20680 return t && (i = !0), uI.resolve(!t) 20681 }) 20682 }).next(function () { 20683 return i 20684 }); 20685 var n, r, i 20686 }, NT.prototype.removeOrphanedDocuments = function (n, r) { 20687 var i = this, 20688 o = this.db.getRemoteDocumentCache().newChangeBuffer(), 20689 s = [], 20690 a = 0; 20691 return this.we(n, function (e, t) { 20692 t <= r && (t = i._e(n, e).next(function (t) { 20693 if (!t) return a++, o.getEntry(n, e).next(function () { 20694 return o.removeEntry(e), wT(n).delete([0, U_(e.path)]) 20695 }) 20696 }), s.push(t)) 20697 }).next(function () { 20698 return uI.waitFor(s) 20699 }).next(function () { 20700 return o.apply(n) 20701 }).next(function () { 20702 return a 20703 }) 20704 }, NT.prototype.removeTarget = function (t, e) { 20705 e = e.withSequenceNumber(t.currentSequenceNumber); 20706 return this.db.getTargetCache().updateTargetData(t, e) 20707 }, NT.prototype.updateLimboDocument = PT, NT.prototype.we = function (t, r) { 20708 var i, t = wT(t), 20709 o = Dy.o; 20710 return t.Ot({ 20711 index: $_.documentTargetsIndex 20712 }, function (t, e) { 20713 var n = t[0], 20714 t = (t[1], e.path), 20715 e = e.sequenceNumber; 20716 0 === n ? (o !== Dy.o && r(new Cm(q_(i)), o), o = e, i = t) : o = Dy.o 20717 }).next(function () { 20718 o !== Dy.o && r(new Cm(q_(i)), o) 20719 }) 20720 }, NT.prototype.getCacheSize = function (t) { 20721 return this.db.getRemoteDocumentCache().getSize(t) 20722 }, NT); 20723 20724 function NT(t, e) { 20725 this.db = t, this.garbageCollector = new ST(this, e) 20726 } 20727 20728 function AT(t, e) { 20729 this.ae = t, this.params = e 20730 } 20731 20732 function kT(t, e) { 20733 this.garbageCollector = t, this.asyncQueue = e, this.oe = !1, this.ce = null 20734 } 20735 20736 function RT(t) { 20737 this.ne = t, this.buffer = new Vw(IT), this.se = 0 20738 } 20739 20740 function PT(t, e) { 20741 return wT(t).put((t = t.currentSequenceNumber, new $_(0, U_(e.path), t))) 20742 } 20743 var OT, DT = (jT.prototype.get = function (t) { 20744 var e = this.mapKeyFn(t), 20745 e = this.inner[e]; 20746 if (void 0 !== e) 20747 for (var n = 0, r = e; n < r.length; n++) { 20748 var i = r[n], 20749 o = i[0], 20750 i = i[1]; 20751 if (this.equalsFn(o, t)) return i 20752 } 20753 }, jT.prototype.has = function (t) { 20754 return void 0 !== this.get(t) 20755 }, jT.prototype.set = function (t, e) { 20756 var n = this.mapKeyFn(t), 20757 r = this.inner[n]; 20758 if (void 0 !== r) { 20759 for (var i = 0; i < r.length; i++) 20760 if (this.equalsFn(r[i][0], t)) return void(r[i] = [t, e]); 20761 r.push([t, e]) 20762 } else this.inner[n] = [ 20763 [t, e] 20764 ] 20765 }, jT.prototype.delete = function (t) { 20766 var e = this.mapKeyFn(t), 20767 n = this.inner[e]; 20768 if (void 0 === n) return !1; 20769 for (var r = 0; r < n.length; r++) 20770 if (this.equalsFn(n[r][0], t)) return 1 === n.length ? delete this.inner[e] : n.splice(r, 1), !0; 20771 return !1 20772 }, jT.prototype.forEach = function (s) { 20773 rm(this.inner, function (t, e) { 20774 for (var n = 0, r = e; n < r.length; n++) { 20775 var i = r[n], 20776 o = i[0], 20777 i = i[1]; 20778 s(o, i) 20779 } 20780 }) 20781 }, jT.prototype.isEmpty = function () { 20782 return im(this.inner) 20783 }, jT), 20784 Sn = (UT.prototype.getReadTime = function (t) { 20785 t = this.changes.get(t); 20786 return t ? t.readTime : Zy.min() 20787 }, UT.prototype.addEntry = function (t, e) { 20788 this.assertNotApplied(), this.changes.set(t.key, { 20789 document: t, 20790 readTime: e 20791 }) 20792 }, UT.prototype.removeEntry = function (t, e) { 20793 void 0 === e && (e = null), this.assertNotApplied(), this.changes.set(t, { 20794 document: Bm.newInvalidDocument(t), 20795 readTime: e 20796 }) 20797 }, UT.prototype.getEntry = function (t, e) { 20798 this.assertNotApplied(); 20799 var n = this.changes.get(e); 20800 return void 0 !== n ? uI.resolve(n.document) : this.getFromCache(t, e) 20801 }, UT.prototype.getEntries = function (t, e) { 20802 return this.getAllFromCache(t, e) 20803 }, UT.prototype.apply = function (t) { 20804 return this.assertNotApplied(), this.changesApplied = !0, this.applyChanges(t) 20805 }, UT.prototype.assertNotApplied = function () {}, UT), 20806 xT = (FT.prototype.addEntry = function (t, e, n) {
20807 return VT(t).put(BT(e), n) 20808 }, FT.prototype.removeEntry = function (t, e) { 20809 t = VT(t), e = BT(e); 20810 return t.delete(e) 20811 }, FT.prototype.updateMetadata = function (e, n) { 20812 var r = this; 20813 return this.getMetadata(e).next(function (t) { 20814 return t.byteSize += n, r.me(e, t) 20815 }) 20816 }, FT.prototype.getEntry = function (t, e) { 20817 var n = this; 20818 return VT(t).get(BT(e)).next(function (t) { 20819 return n.ye(e, t) 20820 }) 20821 }, FT.prototype.ge = function (t, e) { 20822 var n = this; 20823 return VT(t).get(BT(e)).next(function (t) { 20824 return { 20825 document: n.ye(e, t), 20826 size: aT(t) 20827 } 20828 }) 20829 }, FT.prototype.getEntries = function (t, e) { 20830 var n = this, 20831 r = Kw; 20832 return this.pe(t, e, function (t, e) { 20833 e = n.ye(t, e); 20834 r = r.insert(t, e) 20835 }).next(function () { 20836 return r 20837 }) 20838 }, FT.prototype.Ee = function (t, e) { 20839 var r = this, 20840 i = Kw, 20841 o = new xw(Cm.comparator); 20842 return this.pe(t, e, function (t, e) { 20843 var n = r.ye(t, e); 20844 i = i.insert(t, n), o = o.insert(t, aT(e)) 20845 }).next(function () { 20846 return { 20847 documents: i, 20848 Te: o 20849 } 20850 }) 20851 }, FT.prototype.pe = function (t, e, i) { 20852 if (e.isEmpty()) return uI.resolve(); 20853 var n = IDBKeyRange.bound(e.first().path.toArray(), e.last().path.toArray()), 20854 o = e.getIterator(), 20855 s = o.getNext(); 20856 return VT(t).Ot({ 20857 range: n 20858 }, function (t, e, n) { 20859 for (var r = Cm.fromSegments(t); s && Cm.comparator(s, r) < 0;) i(s, null), s = o.getNext(); 20860 s && s.isEqual(r) && (i(s, e), s = o.hasNext() ? o.getNext() : null), s ? n.Ct(s.path.toArray()) : n.done() 20861 }).next(function () { 20862 for (; s;) i(s, null), s = o.hasNext() ? o.getNext() : null 20863 }) 20864 }, FT.prototype.getDocumentsMatchingQuery = function (t, r, e) { 20865 var n, i = this, 20866 o = Kw, 20867 s = r.path.length + 1, 20868 a = {}; 20869 return e.isEqual(Zy.min()) ? (n = r.path.toArray(), a.range = IDBKeyRange.lowerBound(n)) : (n = r.path.toArray(), e = UI(e), a.range = IDBKeyRange.lowerBound([n, e], !0), a.index = Y_.collectionReadTimeIndex), VT(t).Ot(a, function (t, e, n) { 20870 t.length === s && (e = MI(i.R, e), r.path.isPrefixOf(e.key.path) ? jb(r, e) && (o = o.insert(e.key, e)) : n.done()) 20871 }).next(function () { 20872 return o 20873 }) 20874 }, FT.prototype.newChangeBuffer = function (t) { 20875 return new LT(this, !!t && t.trackRemovals) 20876 }, FT.prototype.getSize = function (t) { 20877 return this.getMetadata(t).next(function (t) { 20878 return t.byteSize 20879 }) 20880 }, FT.prototype.getMetadata = function (t) { 20881 return qT(t).get(X_.key).next(function (t) { 20882 return Gy(!!t), t 20883 }) 20884 }, FT.prototype.me = function (t, e) { 20885 return qT(t).put(X_.key, e) 20886 }, FT.prototype.ye = function (t, e) { 20887 if (e) { 20888 e = MI(this.R, e); 20889 if (!e.isNoDocument() || !e.version.isEqual(Zy.min())) return e 20890 } 20891 return Bm.newInvalidDocument(t) 20892 }, FT), 20893 LT = (Xi(MT, OT = Sn), MT.prototype.applyChanges = function (i) { 20894 var o = this, 20895 s = [], 20896 a = 0, 20897 u = new Vw(function (t, e) { 20898 return Yy(t.canonicalString(), e.canonicalString()) 20899 });
20900 return this.changes.forEach(function (t, e) { 20901 var n, r = o.Ae.get(t); 20902 e.document.isValidDocument() ? (n = FI(o.Ie.R, e.document, o.getReadTime(t)), u = u.add(t.path.popLast()), e = aT(n), a += e - r, s.push(o.Ie.addEntry(i, t, n))) : (a -= r, o.trackRemovals ? (r = FI(o.Ie.R, Bm.newNoDocument(t, Zy.min()), o.getReadTime(t)), s.push(o.Ie.addEntry(i, t, r))) : s.push(o.Ie.removeEntry(i, t))) 20903 }), u.forEach(function (t) { 20904 s.push(o.Ie.Ut.addToCollectionParentIndex(i, t)) 20905 }), s.push(this.Ie.updateMetadata(i, a)), uI.waitFor(s) 20906 }, MT.prototype.getFromCache = function (t, e) { 20907 var n = this; 20908 return this.Ie.ge(t, e).next(function (t) { 20909 return n.Ae.set(e, t.size), t.document 20910 }) 20911 }, MT.prototype.getAllFromCache = function (t, e) { 20912 var n = this; 20913 return this.Ie.Ee(t, e).next(function (t) { 20914 var e = t.documents; 20915 return t.Te.forEach(function (t, e) { 20916 n.Ae.set(t, e) 20917 }), e 20918 }) 20919 }, MT); 20920 20921 function MT(t, e) { 20922 var n = this; 20923 return (n = OT.call(this) || this).Ie = t, n.trackRemovals = e, n.Ae = new DT(function (t) { 20924 return t.toString() 20925 }, function (t, e) { 20926 return t.isEqual(e) 20927 }), n 20928 } 20929 20930 function FT(t, e) { 20931 this.R = t, this.Ut = e 20932 } 20933 20934 function UT() { 20935 this.changes = new DT(function (t) { 20936 return t.toString() 20937 }, function (t, e) { 20938 return t.isEqual(e) 20939 }), this.changesApplied = !1 20940 } 20941 20942 function jT(t, e) { 20943 this.mapKeyFn = t, this.equalsFn = e, this.inner = {} 20944 } 20945 20946 function qT(t) { 20947 return AI(t, X_.store) 20948 } 20949 20950 function VT(t) { 20951 return AI(t, Y_.store) 20952 } 20953 20954 function BT(t) { 20955 return t.path.toArray() 20956 } 20957 var KT = (WT.prototype.Rt = function (e, n, t, r) { 20958 var i = this; 20959 Gy(t < r && 0 <= t && r <= 11); 20960 var o = new cI("createOrUpgrade", n); 20961 t < 1 && 1 <= r && (e.createObjectStore(V_.store), (s = e).createObjectStore(K_.store, { 20962 keyPath: K_.keyPath 20963 }), s.createObjectStore(W_.store, { 20964 keyPath: W_.keyPath, 20965 autoIncrement: !0 20966 }).createIndex(W_.userMutationsIndex, W_.userMutationsKeyPath, { 20967 unique: !0 20968 }), s.createObjectStore(H_.store), HT(e), e.createObjectStore(Y_.store)); 20969 var s, a = uI.resolve(); 20970 return t < 3 && 3 <= r && (0 !== t && ((s = e).deleteObjectStore($_.store), s.deleteObjectStore(J_.store), s.deleteObjectStore(Z_.store), HT(e)), a = a.next(function () { 20971 return t = o.store(Z_.store), e = new Z_(0, 0, Zy.min().toTimestamp(), 0), t.put(Z_.key, e); 20972 var t, e 20973 })), t < 4 && 4 <= r && (a = (a = 0 !== t ? a.next(function () { 20974 return n = e, (r = o).store(W_.store).Nt().next(function (t) { 20975 n.deleteObjectStore(W_.store), n.createObjectStore(W_.store, { 20976 keyPath: W_.keyPath, 20977 autoIncrement: !0 20978 }).createIndex(W_.userMutationsIndex, W_.userMutationsKeyPath, { 20979 unique: !0 20980 }); 20981 var e = r.store(W_.store), 20982 t = t.map(function (t) { 20983 return e.put(t) 20984 }); 20985 return uI.waitFor(t) 20986 }); 20987 var n, r 20988 }) : a).next(function () { 20989 e.createObjectStore(eI.store, { 20990 keyPath: eI.keyPath 20991 }) 20992 })), t < 5 && 5 <= r && (a = a.next(function () { 20993 return i.Re(o) 20994 })), t < 6 && 6 <= r && (a = a.next(function () { 20995 return e.createObjectStore(X_.store), i.be(o) 20996 })), t < 7 && 7 <= r && (a = a.next(function () { 20997 return i.ve(o) 20998 })), t < 8 && 8 <= r && (a = a.next(function () { 20999 return i.Pe(e, o) 21000 })), t < 9 && 9 <= r && (a = a.next(function () { 21001 var t; 21002 (t = e).objectStoreNames.contains("remoteDocumentChanges") && t.deleteObjectStore("remoteDocumentChanges"), (t = n.objectStore(Y_.store)).createIndex(Y_.readTimeIndex, Y_.readTimeIndexPath, { 21003 unique: !1 21004 }), t.createIndex(Y_.collectionReadTimeIndex, Y_.collectionReadTimeIndexPath, { 21005 unique: !1 21006 }) 21007 })), t < 10 && 10 <= r && (a = a.next(function () { 21008 return i.Ve(o) 21009 })), a = t < 11 && 11 <= r ? a.next(function () { 21010 e.createObjectStore(nI.store, { 21011 keyPath: nI.keyPath 21012 }), e.createObjectStore(rI.store, { 21013 keyPath: rI.keyPath 21014 }) 21015 }) : a 21016 }, WT.prototype.be = function (e) { 21017 var n = 0; 21018 return e.store(Y_.store).Ot(function (t, e) { 21019 n += aT(e) 21020 }).next(function () { 21021 var t = new X_(n); 21022 return e.store(X_.store).put(X_.key, t) 21023 }) 21024 }, WT.prototype.Re = function (n) { 21025 var r = this, 21026 t = n.store(K_.store), 21027 i = n.store(W_.store); 21028 return t.Nt().next(function (t) { 21029 return uI.forEach(t, function (e) { 21030 var t = IDBKeyRange.bound([e.userId, -1], [e.userId, e.lastAcknowledgedBatchId]); 21031 return i.Nt(W_.userMutationsIndex, t).next(function (t) { 21032 return uI.forEach(t, function (t) { 21033 Gy(t.userId === e.userId); 21034 t = BI(r.R, t); 21035 return sT(n, e.userId, t).next(function () {}) 21036 }) 21037 }) 21038 }) 21039 }) 21040 }, WT.prototype.ve = function (t) { 21041 var o = t.store($_.store), 21042 e = t.store(Y_.store); 21043 return t.store(Z_.store).get(Z_.key).next(function (r) { 21044 var i = []; 21045 return e.Ot(function (t, e) { 21046 var n = new am(t), 21047 t = [0, U_(n)]; 21048 i.push(o.get(t).next(function (t) { 21049 return t ? uI.resolve() : o.put(new $_(0, U_(n), r.highestListenSequenceNumber)) 21050 })) 21051 }).next(function () { 21052 return uI.waitFor(i) 21053 }) 21054 }) 21055 }, WT.prototype.Pe = function (t, e) { 21056 t.createObjectStore(tI.store, { 21057 keyPath: tI.keyPath 21058 }); 21059 21060 function r(t) { 21061 if (i.add(t)) { 21062 var e = t.lastSegment(), 21063 t = t.popLast(); 21064 return n.put({ 21065 collectionId: e, 21066 parent: U_(t) 21067 }) 21068 } 21069 } 21070 var n = e.store(tI.store), 21071 i = new JI; 21072 return e.store(Y_.store).Ot({ 21073 kt: !0 21074 }, function (t, e) { 21075 t = new am(t); 21076 return r(t.popLast()) 21077 }).next(function () { 21078 return e.store(H_.store).Ot({ 21079 kt: !0 21080 }, function (t, e) { 21081 t[0]; 21082 var n = t[1], 21083 n = (t[2], q_(n)); 21084 return r(n.popLast()) 21085 }) 21086 }) 21087 }, WT.prototype.Ve = function (t) { 21088 var n = this, 21089 r = t.store(J_.store); 21090 return r.Ot(function (t, e) { 21091 e = KI(e), e = WI(n.R, e); 21092 return r.put(e) 21093 }) 21094 }, WT); 21095 21096 function WT(t) { 21097 this.R = t 21098 } 21099 21100 function HT(t) { 21101 t.createObjectStore($_.store, { 21102 keyPath: $_.keyPath 21103 }).createIndex($_.documentTargetsIndex, $_.documentTargetsKeyPath, { 21104 unique: !0 21105 }), t.createObjectStore(J_.store, { 21106 keyPath: J_.keyPath 21107 }).createIndex(J_.queryTargetsIndexName, J_.queryTargetsKeyPath, { 21108 unique: !0 21109 }), t.createObjectStore(Z_.store) 21110 } 21111 var GT = "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.", 21112 zT = (QT.prototype.start = function () { 21113 var e = this; 21114 return this.je().then(function () { 21115 if (!e.isPrimary && !e.allowTabSynchronization) throw new Fy(My.FAILED_PRECONDITION, GT); 21116 return e.We(), e.Ge(), e.ze(), e.runTransaction("getHighestListenSequenceNumber", "readonly", function (t) { 21117 return e.qe.getHighestSequenceNumber(t) 21118 }) 21119 }).then(function (t) { 21120 e.Ne = new Dy(t, e.De) 21121 }).then(function () { 21122 e.xe = !0 21123 }).catch(function (t) { 21124 return e.Be && e.Be.close(), Promise.reject(t) 21125 }) 21126 }, QT.prototype.He = function (n) { 21127 var t = this; 21128 return this.Me = function (e) { 21129 return $i(t, void 0, void 0, function () { 21130 return Zi(this, function (t) { 21131 return this.started ? [2, n(e)] : [2] 21132 }) 21133 }) 21134 }, n(this.isPrimary) 21135 }, QT.prototype.setDatabaseDeletedListener = function (n) { 21136 var t = this; 21137 this.Be.vt(function (e) { 21138 return $i(t, void 0, void 0, function () { 21139 return Zi(this, function (t) { 21140 switch (t.label) { 21141 case 0:
21142 return null === e.newVersion ? [4, n()] : [3, 2]; 21143 case 1: 21144 t.sent(), t.label = 2; 21145 case 2: 21146 return [2] 21147 } 21148 }) 21149 }) 21150 }) 21151 }, QT.prototype.setNetworkEnabled = function (t) { 21152 var e = this; 21153 this.networkEnabled !== t && (this.networkEnabled = t, this.Se.enqueueAndForget(function () { 21154 return $i(e, void 0, void 0, function () { 21155 return Zi(this, function (t) { 21156 switch (t.label) { 21157 case 0: 21158 return this.started ? [4, this.je()] : [3, 2]; 21159 case 1: 21160 t.sent(), t.label = 2; 21161 case 2: 21162 return [2] 21163 } 21164 }) 21165 }) 21166 })) 21167 }, QT.prototype.je = function () { 21168 var n = this; 21169 return this.runTransaction("updateClientMetadataAndTryBecomePrimary", "readwrite", function (e) { 21170 return XT(e).put(new eI(n.clientId, Date.now(), n.networkEnabled, n.inForeground)).next(function () { 21171 if (n.isPrimary) return n.Je(e).next(function (t) { 21172 t || (n.isPrimary = !1, n.Se.enqueueRetryable(function () { 21173 return n.Me(!1) 21174 })) 21175 }) 21176 }).next(function () { 21177 return n.Ye(e) 21178 }).next(function (t) { 21179 return n.isPrimary && !t ? n.Xe(e).next(function () { 21180 return !1 21181 }) : !!t && n.Ze(e).next(function () { 21182 return !0 21183 }) 21184 }) 21185 }).catch(function (t) { 21186 if (bI(t)) return Vy("IndexedDbPersistence", "Failed to extend owner lease: ", t), n.isPrimary; 21187 if (!n.allowTabSynchronization) throw t; 21188 return Vy("IndexedDbPersistence", "Releasing owner lease after error during lease refresh", t), !1 21189 }).then(function (t) { 21190 n.isPrimary !== t && n.Se.enqueueRetryable(function () { 21191 return n.Me(t) 21192 }), n.isPrimary = t 21193 }) 21194 }, QT.prototype.Je = function (t) { 21195 var e = this; 21196 return YT(t).get(V_.key).next(function (t) { 21197 return uI.resolve(e.tn(t)) 21198 }) 21199 }, QT.prototype.en = function (t) { 21200 return XT(t).delete(this.clientId) 21201 }, QT.prototype.nn = function () { 21202 return $i(this, void 0, void 0, function () { 21203 var e, n, r, i, o = this; 21204 return Zi(this, function (t) { 21205 switch (t.label) { 21206 case 0: 21207 return !this.isPrimary || this.sn(this.$e, 18e5) ? [3, 2] : (this.$e = Date.now(), [4, this.runTransaction("maybeGarbageCollectMultiClientState", "readwrite-primary", function (t) { 21208 var r = AI(t, eI.store);
21209 return r.Nt().next(function (t) { 21210 var e = o.rn(t, 18e5), 21211 n = t.filter(function (t) { 21212 return -1 === e.indexOf(t) 21213 }); 21214 return uI.forEach(n, function (t) { 21215 return r.delete(t.clientId) 21216 }).next(function () { 21217 return n 21218 }) 21219 }) 21220 }).catch(function () { 21221 return [] 21222 })]); 21223 case 1: 21224 if (e = t.sent(), this.Ke) 21225 for (n = 0, r = e; n < r.length; n++) i = r[n], this.Ke.removeItem(this.on(i.clientId)); 21226 t.label = 2; 21227 case 2: 21228 return [2] 21229 } 21230 }) 21231 }) 21232 }, QT.prototype.ze = function () { 21233 var t = this; 21234 this.Oe = this.Se.enqueueAfterDelay("client_metadata_refresh", 4e3, function () { 21235 return t.je().then(function () { 21236 return t.nn() 21237 }).then(function () { 21238 return t.ze() 21239 }) 21240 }) 21241 }, QT.prototype.tn = function (t) { 21242 return !!t && t.ownerId === this.clientId 21243 }, QT.prototype.Ye = function (e) { 21244 var r = this; 21245 return this.Ce ? uI.resolve(!0) : YT(e).get(V_.key).next(function (t) { 21246 if (null !== t && r.sn(t.leaseTimestampMs, 5e3) && !r.cn(t.ownerId)) { 21247 if (r.tn(t) && r.networkEnabled) return !0; 21248 if (!r.tn(t)) { 21249 if (!t.allowTabSynchronization) throw new Fy(My.FAILED_PRECONDITION, GT); 21250 return !1 21251 } 21252 } 21253 return !(!r.networkEnabled || !r.inForeground) || XT(e).Nt().next(function (t) { 21254 return void 0 === r.rn(t, 5e3).find(function (t) { 21255 if (r.clientId !== t.clientId) { 21256 var e = !r.networkEnabled && t.networkEnabled, 21257 n = !r.inForeground && t.inForeground, 21258 t = r.networkEnabled === t.networkEnabled; 21259 if (e || n && t) return !0 21260 } 21261 return !1 21262 }) 21263 }) 21264 }).next(function (t) { 21265 return r.isPrimary !== t && Vy("IndexedDbPersistence", "Client " + (t ? "is" : "is not") + " eligible for a primary lease."), t 21266 }) 21267 }, QT.prototype.shutdown = function () { 21268 return $i(this, void 0, void 0, function () { 21269 var n = this; 21270 return Zi(this, function (t) { 21271 switch (t.label) { 21272 case 0: 21273 return this.xe = !1, this.un(), this.Oe && (this.Oe.cancel(), this.Oe = null), this.an(), this.hn(), [4, this.Be.runTransaction("shutdown", "readwrite", [V_.store, eI.store], function (t) { 21274 var e = new CI(t, Dy.o); 21275 return n.Xe(e).next(function () { 21276 return n.en(e) 21277 }) 21278 })]; 21279 case 1: 21280 return t.sent(), this.Be.close(), this.ln(), [2] 21281 } 21282 }) 21283 }) 21284 }, QT.prototype.rn = function (t, e) { 21285 var n = this; 21286 return t.filter(function (t) { 21287 return n.sn(t.updateTimeMs, e) && !n.cn(t.clientId) 21288 }) 21289 }, QT.prototype.fn = function () { 21290 var e = this; 21291 return this.runTransaction("getActiveClients", "readonly", function (t) { 21292 return XT(t).Nt().next(function (t) { 21293 return e.rn(t, 18e5).map(function (t) { 21294 return t.clientId 21295 }) 21296 }) 21297 }) 21298 }, Object.defineProperty(QT.prototype, "started", { 21299 get: function () { 21300 return this.xe 21301 }, 21302 enumerable: !1, 21303 configurable: !0 21304 }), QT.prototype.getMutationQueue = function (t) { 21305 return uT.Kt(t, this.R, this.Ut, this.referenceDelegate) 21306 }, QT.prototype.getTargetCache = function () { 21307 return this.qe 21308 }, QT.prototype.getRemoteDocumentCache = function () { 21309 return this.Ue 21310 }, QT.prototype.getIndexManager = function () { 21311 return this.Ut 21312 }, QT.prototype.getBundleCache = function () { 21313 return this.Qe 21314 }, QT.prototype.runTransaction = function (e, n, r) { 21315 var i = this; 21316 Vy("IndexedDbPersistence", "Starting transaction:", e); 21317 var o, t = "readonly" === n ? "readonly" : "readwrite"; 21318 return this.Be.runTransaction(e, t, oI, function (t) { 21319 return o = new CI(t, i.Ne ? i.Ne.next() : Dy.o), "readwrite-primary" === n ? i.Je(o).next(function (t) { 21320 return !!t || i.Ye(o) 21321 }).next(function (t) { 21322 if (!t) throw By("Failed to obtain primary lease for action '" + e + "'."), i.isPrimary = !1, i.Se.enqueueRetryable(function () { 21323 return i.Me(!1) 21324 }), new Fy(My.FAILED_PRECONDITION, sI); 21325 return r(o) 21326 }).next(function (t) { 21327 return i.Ze(o).next(function () { 21328 return t 21329 }) 21330 }) : i.dn(o).next(function () { 21331 return r(o) 21332 }) 21333 }).then(function (t) { 21334 return o.raiseOnCommittedEvent(), t 21335 }) 21336 }, QT.prototype.dn = function (t) { 21337 var e = this; 21338 return YT(t).get(V_.key).next(function (t) { 21339 if (null !== t && e.sn(t.leaseTimestampMs, 5e3) && !e.cn(t.ownerId) && !e.tn(t) && !(e.Ce || e.allowTabSynchronization && t.allowTabSynchronization)) throw new Fy(My.FAILED_PRECONDITION, GT) 21340 }) 21341 }, QT.prototype.Ze = function (t) { 21342 var e = new V_(this.clientId, this.allowTabSynchronization, Date.now()); 21343 return YT(t).put(V_.key, e) 21344 }, QT.yt = function () { 21345 return hI.yt() 21346 }, QT.prototype.Xe = function (t) { 21347 var e = this, 21348 n = YT(t); 21349 return n.get(V_.key).next(function (t) { 21350 return e.tn(t) ? (Vy("IndexedDbPersistence", "Releasing primary lease."), n.delete(V_.ke
21350y)) : uI.resolve() 21351 }) 21352 }, QT.prototype.sn = function (t, e) { 21353 var n = Date.now(); 21354 return !(t < n - e || n < t && (By("Detected an update time that is in the future: " + t + " > " + n), 1)) 21355 }, QT.prototype.We = function () { 21356 var t = this; 21357 null !== this.document && "function" == typeof this.document.addEventListener && (this.ke = function () { 21358 t.Se.enqueueAndForget(function () { 21359 return t.inForeground = "visible" === t.document.visibilityState, t.je() 21360 }) 21361 }, this.document.addEventListener("visibilitychange", this.ke), this.inForeground = "visible" === this.document.visibilityState) 21362 }, QT.prototype.an = function () { 21363 this.ke && (this.document.removeEventListener("visibilitychange", this.ke), this.ke = null) 21364 }, QT.prototype.Ge = function () { 21365 var t, e = this; 21366 "function" == typeof (null === (t = this.window) || void 0 === t ? void 0 : t.addEventListener) && (this.Fe = function () { 21367 e.un(), e.Se.enqueueAndForget(function () { 21368 return e.shutdown() 21369 }) 21370 }, this.window.addEventListener("unload", this.Fe)) 21371 }, QT.prototype.hn = function () { 21372 this.Fe && (this.window.removeEventListener("unload", this.Fe), this.Fe = null) 21373 }, QT.prototype.cn = function (t) { 21374 try { 21375 var e = null !== (null === (e = this.Ke) || void 0 === e ? void 0 : e.getItem(this.on(t))); 21376 return Vy("IndexedDbPersistence", "Client '" + t + "' " + (e ? "is" : "is not") + " zombied in LocalStorage"), e 21377 } catch (t) { 21378 return By("IndexedDbPersistence", "Failed to get zombied client id.", t), !1 21379 } 21380 }, QT.prototype.un = function () { 21381 if (this.Ke) try { 21382 this.Ke.setItem(this.on(this.clientId), String(Date.now())) 21383 } catch (t) { 21384 By("Failed to set zombie client id.", t) 21385 } 21386 }, QT.prototype.ln = function () { 21387 if (this.Ke) try { 21388 this.Ke.removeItem(this.on(this.clientId)) 21389 } catch (t) {} 21390 }, QT.prototype.on = function (t) { 21391 return "firestore_zombie_" + this.persistenceKey + "_" + t 21392 }, QT); 21393 21394 function QT(t, e, n, r, i, o, s, a, u, c) { 21395 if (this.allowTabSynchronization = t, this.persistenceKey = e, this.clientId = n, this.Se = i, this.window = o, this.document = s, this.De = u, this.Ce = c, 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) { 21396 return Promise.resolve() 21397 }, !QT.yt()) throw new Fy(My.UNIMPLEMENTED, "This platform is either missing IndexedDB or is known to have an incomplete implementation. Offline persistence has been disabled."); 21398 this.referenceDelegate = new CT(this, r), this.Le = e + "main", this.R = new OI(a), this.Be = new hI(this.Le, 11, new KT(this.R)), this.qe = new vT(this.referenceDelegate, this.R), this.Ut = new $I, this.Ue = (e = this.R, a = this.Ut, new xT(e, a)), this.Qe = new GI, this.window && this.window.localStorage ? this.Ke = this.window.localStorage : (this.Ke = null, !1 === c && By("IndexedDbPersistence", "LocalStorage is unavailable. As a result, persistence may not work reliably. In particular enablePersistence() could fail immediately after refreshing the page.")) 21399 } 21400 21401 function YT(t) { 21402 return AI(t, V_.store) 21403 } 21404 21405 function XT(t) { 21406 return AI(t, eI.store) 21407 } 21408 21409 function JT(t, e) { 21410 var n = t.projectId; 21411 return t.isDefaultDatabase || (n += "." + t.database), "firestore/" + e + "/" + n + "/" 21412 } 21413 21414 function $T(t, e) { 21415 this.progress = t, this.wn = e 21416 } 21417 var ZT = (sE.prototype.mn = function (e, n) { 21418 var r = this; 21419 return this._n.getAllMutationBatchesAffectingDocumentKey(e, n).next(function (t) { 21420 return r.yn(e, n, t) 21421 }) 21422 }, sE.prototype.yn = function (t, e, r) { 21423 return this.Ue.getEntry(t, e).next(function (t) { 21424 for (var e = 0, n = r; e < n.length; e++) n[e].applyToLocalView(t); 21425 return t 21426 }) 21427 }, sE.prototype.gn = function (t, i) { 21428 t.forEach(function (t, e) { 21429 for (var n = 0, r = i; n < r.length; n++) r[n].applyToLocalView(e) 21430 }) 21431 }, sE.prototype.pn = function (e, t) { 21432 var n = this; 21433 return this.Ue.getEntries(e, t).next(function (t) { 21434 return n.En(e, t).next(function () { 21435 return t 21436 }) 21437 }) 21438 }, sE.prototype.En = function (t, e) { 21439 var n = this; 21440 return this._n.getAllMutationBatchesAffectingDocumentKeys(t, e).next(function (t) { 21441 return n.gn(e, t) 21442 }) 21443 }, sE.prototype.getDocumentsMatchingQuery = function (t, e, n) { 21444 return r = e, Cm.isDocumentKey(r.path) && null === r.collectionGroup && 0 === r.filters.length ? this.Tn(t, e.path) : Ob(e) ? this.In(t, e, n) : this.An(t, e, n); 21445 var r 21446 }, sE.prototype.Tn = function (t, e) { 21447 return this.mn(t, new Cm(e)).next(function (t) { 21448 var e = Gw; 21449 return e = t.isFoundDocument() ? e.insert(t.key, t) : e 21450 }) 21451 }, sE.prototype.In = function (n, r, i) { 21452 var o = this, 21453 s = r.collectionGroup, 21454 a = Gw; 21455 return this.Ut.getCollectionParents(n, s).next(function (t) { 21456 return uI.forEach(t, function (t) { 21457 var e, e = (e = r, t = t.child(s), new Sb(t, null, e.explicitOrderBy.slice(), e.filters.slice(), e.limit, e.limitType, e.startAt, e.endAt)); 21458 return o.An(n, e, i).next(function (t) { 21459 t.forEach(function (t, e) { 21460 a = a.insert(t, e) 21461 }) 21462 }) 21463 }).next(function () { 21464 return a 21465 }) 21466 }) 21467 }, sE.prototype.An = function (e, n, t) { 21468 var c, h, r = this; 21469 return this.Ue.getDocumentsMatchingQuery(e, n, t).next(function (t) { 21470 return c = t, r._n.getAllMutationBatchesAffectingQuery(e, n) 21471 }).next(function (t) { 21472 return h = t, r.Rn(e, h, c).next(function (t) { 21473 c = t; 21474 for (var e = 0, n = h; e < n.length; e++) 21475 for (var r = n[e], i = 0, o = r.mutations; i < o.length; i++) { 21476 var s = o[i], 21477 a = s.key, 21478 u = c.get(a); 21479 null == u && (u = Bm.newInvalidDocument(a), c = c.insert(a, u)), fw(s, u, r.localWriteTime), u.isFoundDocument() || (c = c.remove(a)) 21480 } 21481 }) 21482 }).next(function () {
21483 return c.forEach(function (t, e) { 21484 jb(n, e) || (c = c.remove(t)) 21485 }), c 21486 }) 21487 }, sE.prototype.Rn = function (t, e, n) { 21488 for (var r = Yw(), i = 0, o = e; i < o.length; i++) 21489 for (var s = 0, a = o[i].mutations; s < a.length; s++) { 21490 var u = a[s]; 21491 u instanceof mw && null === n.get(u.key) && (r = r.add(u.key)) 21492 } 21493 var c = n; 21494 return this.Ue.getEntries(t, r).next(function (t) { 21495 return t.forEach(function (t, e) { 21496 e.isFoundDocument() && (c = c.insert(t, e)) 21497 }), c 21498 }) 21499 }, sE), 21500 tE = (oE.Pn = function (t, e) { 21501 for (var n = Yw(), r = Yw(), i = 0, o = e.docChanges; i < o.length; i++) { 21502 var s = o[i]; 21503 switch (s.type) { 21504 case 0: 21505 n = n.add(s.doc.key); 21506 break; 21507 case 1: 21508 r = r.add(s.doc.key) 21509 } 21510 } 21511 return new oE(t, e.fromCache, n, r) 21512 }, oE), 21513 eE = (iE.prototype.Vn = function (t) { 21514 this.Sn = t 21515 }, iE.prototype.getDocumentsMatchingQuery = function (e, r, i, o) { 21516 var s = this; 21517 return 0 === r.filters.length && null === r.limit && null == r.startAt && null == r.endAt && (0 === r.explicitOrderBy.length || 1 === r.explicitOrderBy.length && r.explicitOrderBy[0].field.isKeyField()) || i.isEqual(Zy.min()) ? this.Dn(e, r) : this.Sn.pn(e, o).next(function (t) { 21518 var n = s.Cn(r, t); 21519 return (Ab(r) || kb(r)) && s.Nn(r.limitType, n, o, i) ? s.Dn(e, r) : (qy() <= as.DEBUG && Vy("QueryEngine", "Re-using previous result from %s to execute query: %s", i.toString(), Ub(r)), s.Sn.getDocumentsMatchingQuery(e, r, i).next(function (e) { 21520 return n.forEach(function (t) { 21521 e = e.insert(t.key, t) 21522 }), e 21523 })) 21524 }) 21525 }, iE.prototype.Cn = function (n, t) { 21526 var r = new Vw(qb(n)); 21527 return t.forEach(function (t, e) { 21528 jb(n, e) && (r = r.add(e)) 21529 }), r 21530 }, iE.prototype.Nn = function (t, e, n, r) { 21531 if (n.size !== e.size) return !0; 21532 e = "F" === t ? e.last() : e.first(); 21533 return !!e && (e.hasPendingWrites || 0 < e.version.compareTo(r)) 21534 }, iE.prototype.Dn = function (t, e) { 21535 return qy() <= as.DEBUG && Vy("QueryEngine", "Using full collection scan to execute query:", Ub(e)), this.Sn.getDocumentsMatchingQuery(t, e, Zy.min()) 21536 }, iE), 21537 nE = (rE.prototype.collectGarbage = function (e) { 21538 var n = this; 21539 return this.persistence.runTransaction("Collect garbage", "readwrite-primary", function (t) { 21540 return e.collect(t, n.Fn) 21541 }) 21542 }, rE); 21543 21544 function rE(t, e, n, r) { 21545 this.persistence = t, this.xn = e, this.R = r, this.Fn = new xw(Yy), this.kn = new DT(Gm, zm), this.On = Zy.min(), this._n = t.getMutationQueue(n), this.$n = t.getRemoteDocumentCache(), this.qe = t.getTargetCache(), this.Mn = new ZT(this.$n, this._n, this.persistence.getIndexManager()), this.Qe = t.getBundleCache(), this.xn.Vn(this.Mn) 21546 } 21547 21548 function iE() {} 21549 21550 function oE(t, e, n, r) { 21551 this.targetId = t, this.fromCache = e, this.bn = n, this.vn = r 21552 } 21553 21554 function sE(t, e, n) { 21555 this.Ue = t, this._n = e, this.Ut = n 21556 } 21557 21558 function aE(t, e, n, r) { 21559 return new nE(t, e, n, r) 21560 } 21561 21562 function uE(i, o) { 21563 return $i(this, void 0, void 0, function () { 21564 var e, n, m, r; 21565 return Zi(this, function (t) { 21566 switch (t.label) { 21567 case 0: 21568 return n = (e = i)._n, m = e.Mn, [4, e.persistence.runTransaction("Handle user change", "readonly", function (g) { 21569 var y; 21570 return e._n.getAllMutationBatches(g).next(function (t) { 21571 return y = t, n = e.persistence.getMutationQueue(o), m = new ZT(e.$n, n, e.persistence.getIndexManager()), n.getAllMutationBatches(g) 21572 }).next(function (t) { 21573 for (var e = [], n = [], r = Yw(), i = 0, o = y; i < o.length; i++) { 21574 var s = o[i]; 21575 e.push(s.batchId); 21576 for (var a = 0, u = s.mutations; a < u.length; a++) var c = u[a], 21577 r = r.add(c.key) 21578 } 21579 for (var h = 0, l = t; h < l.length; h++) { 21580 var f = l[h]; 21581 n.push(f.batchId); 21582 for (var p = 0, d = f.mutations; p < d.length; p++) { 21583 var v = d[p];
21584 r = r.add(v.key) 21585 } 21586 } 21587 return m.pn(g, r).next(function (t) { 21588 return { 21589 Ln: t, 21590 removedBatchIds: e, 21591 addedBatchIds: n 21592 } 21593 }) 21594 }) 21595 })]; 21596 case 1: 21597 return r = t.sent(), [2, (e._n = n, e.Mn = m, e.xn.Vn(e.Mn), r)] 21598 } 21599 }) 21600 }) 21601 } 21602 21603 function cE(t, h) { 21604 var l = t; 21605 return l.persistence.runTransaction("Acknowledge batch", "readwrite-primary", function (t) { 21606 var e, r, i, o, s, n, a, u = h.batch.keys(), 21607 c = l.$n.newChangeBuffer({ 21608 trackRemovals: !0 21609 }); 21610 return e = l, r = t, o = c, s = (i = h).batch, n = s.keys(), a = uI.resolve(), n.forEac
21610h(function (n) { 21611 a = a.next(function () { 21612 return o.getEntry(r, n) 21613 }).next(function (t) { 21614 var e = i.docVersions.get(n); 21615 Gy(null !== e), t.version.compareTo(e) < 0 && (s.applyToRemoteDocument(t, i), t.isValidDocument() && o.addEntry(t, i.commitVersion)) 21616 }) 21617 }), a.next(function () { 21618 return e._n.removeMutationBatch(r, s) 21619 }).next(function () { 21620 return c.apply(t) 21621 }).next(function () { 21622 return l._n.performConsistencyCheck(t) 21623 }).next(function () { 21624 return l.Mn.pn(t, u) 21625 }) 21626 }) 21627 } 21628 21629 function hE(t) { 21630 var e = t; 21631 return e.persistence.runTransaction("Get last remote snapshot version", "readonly", function (t) { 21632 return e.qe.getLastRemoteSnapshotVersion(t) 21633 }) 21634 } 21635 21636 function lE(t, r) { 21637 var u = t, 21638 c = r.snapshotVersion, 21639 h = u.Fn; 21640 return u.persistence.runTransaction("Apply remote event", "readwrite-primary", function (s) { 21641 var t = u.$n.newChangeBuffer({ 21642 trackRemovals: !0 21643 }); 21644 h = u.Fn; 21645 var a = [];
21646 r.targetChanges.forEach(function (t, e) { 21647 var n, r, i, o = h.get(e); 21648 o && (a.push(u.qe.removeMatchingKeys(s, t.removedDocuments, e).next(function () { 21649 return u.qe.addMatchingKeys(s, t.addedDocuments, e) 21650 })), 0 < (i = t.resumeToken).approximateByteSize() && (n = o.withResumeToken(i, c).withSequenceNumber(s.currentSequenceNumber), h = h.insert(e, n), r = o, i = t, Gy(0 < (o = n).resumeToken.approximateByteSize()), (0 === r.resumeToken.approximateByteSize() || 3e8 <= o.snapshotVersion.toMicroseconds() - r.snapshotVersion.toMicroseconds() || 0 < i.addedDocuments.size + i.modifiedDocuments.size + i.removedDocuments.size) && a.push(u.qe.updateTargetData(s, n)))) 21651 }); 21652 var e, n = Kw; 21653 return r.documentUpdates.forEach(function (t, e) { 21654 r.resolvedLimboDocuments.has(t) && a.push(u.persistence.referenceDelegate.updateLimboDocument(s, t)) 21655 }), a.push(fE(s, t, r.documentUpdates, c, void 0).next(function (t) { 21656 n = t 21657 })), c.isEqual(Zy.min()) || (e = u.qe.getLastRemoteSnapshotVersion(s).next(function (t) { 21658 return u.qe.setTargetsMetadata(s, s.currentSequenceNumber, c) 21659 }), a.push(e)), uI.waitFor(a).next(function () { 21660 return t.apply(s) 21661 }).next(function () { 21662 return u.Mn.En(s, n) 21663 }).next(function () { 21664 return n 21665 }) 21666 }).then(function (t) { 21667 return u.Fn = h, t 21668 }) 21669 } 21670 21671 function fE(t, s, e, a, u) { 21672 var n = Yw(); 21673 return e.forEach(function (t) { 21674 return n = n.add(t) 21675 }), s.getEntries(t, n).next(function (i) { 21676 var o = Kw; 21677 return e.forEach(function (t, e) { 21678 var n = i.get(t), 21679 r = (null == u ? void 0 : u.get(t)) || a; 21680 e.isNoDocument() && e.version.isEqual(Zy.min()) ? (s.removeEntry(t, r), o = o.insert(t, e)) : !n.isValidDocument() || 0 < e.version.compareTo(n.version) || 0 === e.version.compareTo(n.version) && n.hasPendingWrites ? (s.addEntry(e, r), o = o.insert(t, e)) : Vy("LocalStore", "Ignoring outdated watch update for ", t, ". Current version:", n.version, " Watch version:", e.version) 21681 }), o 21682 }) 21683 } 21684 21685 function pE(t, r) { 21686 var i = t; 21687 return i.persistence.runTransaction("Allocate target", "readwrite", function (e) { 21688 var n; 21689 return i.qe.getTargetData(e, r).next(function (t) { 21690 return t ? (n = t, uI.resolve(n)) : i.qe.allocateTargetId(e).next(function (t) { 21691 return n = new PI(r, t, 0, e.currentSequenceNumber), i.qe.addTargetData(e, n).next(function () { 21692 return n 21693 }) 21694 }) 21695 }) 21696 }).then(function (t) { 21697 var e = i.Fn.get(t.targetId); 21698 return (null === e || 0 < t.snapshotVersion.compareTo(e.snapshotVersion)) && (i.Fn = i.Fn.insert(t.targetId, t), i.kn.set(r, t.targetId)), t 21699 }) 21700 } 21701 21702 function dE(i, o, s) { 21703 return $i(this, void 0, void 0, function () { 21704 var e, n, r; 21705 return Zi(this, function (t) { 21706 switch (t.label) { 21707 case 0: 21708 n = (e = i).Fn.get(o), r = s ? "readwrite" : "readwrite-primary", t.label = 1; 21709 case 1: 21710 return t.trys.push([1, 4, , 5]), s ? [3, 3] : [4, e.persistence.runTransaction("Release target", r, function (t) { 21711 return e.persistence.referenceDelegate.removeTarget(t, n) 21712 })]; 21713 case 2: 21714 t.sent(), t.label = 3; 21715 case 3: 21716 return [3, 5]; 21717 case 4: 21718 if (!bI(r = t.sent())) throw r; 21719 return Vy("LocalStore", "Failed to update sequence numbers for target " + o + ": " + r), [3, 5]; 21720 case 5: 21721 return e.Fn = e.Fn.remove(o), e.kn.delete(n.target), [2] 21722 } 21723 }) 21724 }) 21725 } 21726 21727 function vE(t, o, s) { 21728 var a = t, 21729 u = Zy.min(), 21730 c = Yw();
21731 return a.persistence.runTransaction("Execute query", "readonly", function (e) { 21732 return t = a, n = e, r = xb(o), (void 0 !== (t = (i = t).kn.get(r)) ? uI.resolve(i.Fn.get(t)) : i.qe.getTargetData(n, r)).next(function (t) { 21733 if (t) return u = t.lastLimboFreeSnapshotVersion, a.qe.getMatchingKeysForTargetId(e, t.targetId).next(function (t) { 21734 c = t 21735 }) 21736 }).next(function () { 21737 return a.xn.getDocumentsMatchingQuery(e, o, s ? u : Zy.min(), s ? c : Yw()) 21738 }).next(function (t) { 21739 return { 21740 documents: t, 21741 Bn: c 21742 } 21743 }); 21744 var t, n, r, i 21745 }) 21746 } 21747 21748 function gE(t, e) { 21749 var n = t, 21750 r = n.qe, 21751 t = n.Fn.get(e); 21752 return t ? Promise.resolve(t.target) : n.persistence.runTransaction("Get target data", "readonly", function (t) { 21753 return r.lt(t, e).next(function (t) { 21754 return t ? t.target : null 21755 }) 21756 }) 21757 } 21758 21759 function yE(t) { 21760 var s = t; 21761 return s.persistence.runTransaction("Get new document changes", "readonly", function (t) { 21762 return e = s.$n, n = t, t = s.On, r = e, i = Kw, o = UI(t), t = VT(n), n = IDBKeyRange.lowerBound(o, !0), t.Ot({ 21763 index: Y_.readTimeIndex, 21764 range: n 21765 }, function (t, e) { 21766 var n = MI(r.R, e); 21767 i = i.insert(n.key, n), o = e.readTime 21768 }).next(function () { 21769 return { 21770 wn: i, 21771 readTime: jI(o) 21772 } 21773 }); 21774 var e, n, r, i, o 21775 }).then(function (t) { 21776 var e = t.wn, 21777 t = t.readTime; 21778 return s.On = t, e 21779 }) 21780 } 21781 21782 function mE(n) { 21783 return $i(this, void 0, void 0, function () { 21784 var e; 21785 return Zi(this, function (t) { 21786 return [2, (e = n).persistence.runTransaction("Synchronize last document change read time", "readonly", function (t) { 21787 return t = VT(t), r = Zy.min(), t.Ot({ 21788 index: Y_.readTimeIndex, 21789 reverse: !0 21790 }, function (t, e, n) { 21791 e.readTime && (r = jI(e.readTime)), n.done() 21792 }).next(function () { 21793 return r 21794 }); 21795 var r 21796 }).then(function (t) { 21797 e.On = t 21798 })] 21799 }) 21800 }) 21801 } 21802 var bE, wE, _E = (BE.prototype.getBundleMetadata = function (t, e) { 21803 return uI.resolve(this.Kn.get(e)) 21804 }, BE.prototype.saveBundleMetadata = function (t, e) { 21805 return this.Kn.set(e.id, { 21806 id: e.id, 21807 version: e.version, 21808 createTime: v_(e.createTime) 21809 }), uI.resolve() 21810 }, BE.prototype.getNamedQuery = function (t, e) { 21811 return uI.resolve(this.jn.get(e)) 21812 }, BE.prototype.saveNamedQuery = function (t, e) { 21813 return this.jn.set(e.name, { 21814 name: (e = e).name, 21815 query: HI(e.bundledQuery), 21816 readTime: v_(e.readTime) 21817 }), uI.resolve() 21818 }, BE), 21819 IE = (VE.prototype.isEmpty = function () { 21820 return this.Wn.isEmpty() 21821 }, VE.prototype.addReference = function (t, e) { 21822 e = new TE(t, e); 21823 this.Wn = this.Wn.add(e), this.zn = this.zn.add(e) 21824 }, VE.prototype.Jn = function (t, e) { 21825 var n = this; 21826 t.forEach(function (t) { 21827 return n.addReference(t, e) 21828 }) 21829 }, VE.prototype.removeReference = function (t, e) { 21830 this.Yn(new TE(t, e)) 21831 }, VE.prototype.Xn = function (t, e) { 21832 var n = this; 21833 t.forEach(function (t) { 21834 return n.removeReference(t, e) 21835 }) 21836 }, VE.prototype.Zn = function (t) { 21837 var e = this, 21838 n = new Cm(new am([])), 21839 r = new TE(n, t), 21840 t = new TE(n, t + 1), 21841 i = [];
21842 return this.zn.forEachInRange([r, t], function (t) { 21843 e.Yn(t), i.push(t.key) 21844 }), i 21845 }, VE.prototype.ts = function () { 21846 var e = this; 21847 this.Wn.forEach(function (t) { 21848 return e.Yn(t) 21849 }) 21850 }, VE.prototype.Yn = function (t) { 21851 this.Wn = this.Wn.delete(t), this.zn = this.zn.delete(t) 21852 }, VE.prototype.es = function (t) { 21853 var e = new Cm(new am([])), 21854 n = new TE(e, t), 21855 t = new TE(e, t + 1), 21856 r = Yw(); 21857 return this.zn.forEachInRange([n, t], function (t) { 21858 r = r.add(t.key) 21859 }), r 21860 }, VE.prototype.containsKey = function (t) { 21861 var e = new TE(t, 0), 21862 e = this.Wn.firstAfterOrEqual(e); 21863 return null !== e && t.isEqual(e.key) 21864 }, VE), 21865 TE = (qE.Gn = function (t, e) { 21866 return Cm.comparator(t.key, e.key) || Yy(t.ns, e.ns) 21867 }, qE.Hn = function (t, e) { 21868 return Yy(t.ns, e.ns) || Cm.comparator(t.key, e.key) 21869 }, qE), 21870 EE = (jE.prototype.checkEmpty = function (t) { 21871 return uI.resolve(0 === this._n.length) 21872 }, jE.prototype.addMutationBatch = function (t, e, n, r) { 21873 var i = this.ss; 21874 this.ss++, 0 < this._n.length && this._n[this._n.length - 1]; 21875 n = new kI(i, e, n, r); 21876 this._n.push(n); 21877 for (var o = 0, s = r; o < s.length; o++) { 21878 var a = s[o]; 21879 this.rs = this.rs.add(new TE(a.key, i)), this.Ut.addToCollectionParentIndex(t, a.key.path.popLast()) 21880 } 21881 return uI.resolve(n) 21882 }, jE.prototype.lookupMutationBatch = function (t, e) { 21883 return uI.resolve(this.os(e)) 21884 }, jE.prototype.getNextMutationBatchAfterBatchId = function (t, e) { 21885 e += 1, e = this.cs(e), e = e < 0 ? 0 : e; 21886 return uI.resolve(this._n.length > e ? this._n[e] : null) 21887 }, jE.prototype.getHighestUnacknowledgedBatchId = function () { 21888 return uI.resolve(0 === this._n.length ? -1 : this.ss - 1) 21889 }, jE.prototype.getAllMutationBatches = function (t) { 21890 return uI.resolve(this._n.slice()) 21891 }, jE.prototype.getAllMutationBatchesAffectingDocumentKey = function (t, e) { 21892 var n = this, 21893 r = new TE(e, 0), 21894 e = new TE(e, Number.POSITIVE_INFINITY), 21895 i = []; 21896 return this.rs.forEachInRange([r, e], function (t) { 21897 t = n.os(t.ns); 21898 i.push(t) 21899 }), uI.resolve(i) 21900 }, jE.prototype.getAllMutationBatchesAffectingDocumentKeys = function (t, e) { 21901 var n = this, 21902 r = new Vw(Yy); 21903 return e.forEach(function (t) { 21904 var e = new TE(t, 0), 21905 t = new TE(t, Number.POSITIVE_INFINITY); 21906 n.rs.forEachInRange([e, t], function (t) { 21907 r = r.add(t.ns) 21908 }) 21909 }), uI.resolve(this.us(r)) 21910 }, jE.prototype.getAllMutationBatchesAffectingQuery = function (t, e) { 21911 var n = e.path, 21912 r = n.length + 1, 21913 e = n; 21914 Cm.isDocumentKey(e) || (e = e.child("")); 21915 var e = new TE(new Cm(e), 0), 21916 i = new Vw(Yy); 21917 return this.rs.forEachWhile(function (t) { 21918 var e = t.key.path; 21919 return !!n.isPrefixOf(e) && (e.length === r && (i = i.add(t.ns)), !0) 21920 }, e), uI.resolve(this.us(i)) 21921 }, jE.prototype.us = function (t) { 21922 var e = this, 21923 n = []; 21924 return t.forEach(function (t) { 21925 t = e.os(t); 21926 null !== t && n.push(t) 21927 }), n 21928 }, jE.prototype.removeMutationBatch = function (n, r) { 21929 var i = this; 21930 Gy(0 === this.hs(r.batchId, "removed")), this._n.shift(); 21931 var o = this.rs; 21932 return uI.forEach(r.mutations, function (t) { 21933 var e = new TE(t.key, r.batchId); 21934 return o = o.delete(e), i.referenceDelegate.markPotentiallyOrphaned(n, t.key) 21935 }).next(function () { 21936 i.rs = o 21937 }) 21938 }, jE.prototype.Gt = function (t) {}, jE.prototype.containsKey = function (t, e) { 21939 var n = new TE(e, 0), 21940 n = this.rs.firstAfterOrEqual(n); 21941 return uI.resolve(e.isEqual(n && n.key)) 21942 }, jE.prototype.performConsistencyCheck = function (t) { 21943 return this._n.length, uI.resolve() 21944 }, jE.prototype.hs = function (t, e) { 21945 return this.cs(t) 21946 }, jE.prototype.cs = function (t) { 21947 return 0 === this._n.length ? 0 : t - this._n[0].batchId 21948 }, jE.prototype.os = function (t) { 21949 t = this.cs(t); 21950 return t < 0 || t >= this._n.length ? null : this._n[t] 21951 }, jE), 21952 SE = (UE.prototype.addEntry = function (t, e, n) { 21953 var r = e.key, 21954 i = this.docs.get(r), 21955 o = i ? i.size : 0, 21956 i = this.ls(e);
21957 return this.docs = this.docs.insert(r, { 21958 document: e.clone(), 21959 size: i, 21960 readTime: n 21961 }), this.size += i - o, this.Ut.addToCollectionParentIndex(t, r.path.popLast()) 21962 }, UE.prototype.removeEntry = function (t) { 21963 var e = this.docs.get(t); 21964 e && (this.docs = this.docs.remove(t), this.size -= e.size) 21965 }, UE.prototype.getEntry = function (t, e) { 21966 var n = this.docs.get(e); 21967 return uI.resolve(n ? n.document.clone() : Bm.newInvalidDocument(e)) 21968 }, UE.prototype.getEntries = function (t, e) { 21969 var n = this, 21970 r = Kw; 21971 return e.forEach(function (t) { 21972 var e = n.docs.get(t); 21973 r = r.insert(t, e ? e.document.clone() : Bm.newInvalidDocument(t)) 21974 }), uI.resolve(r) 21975 }, UE.prototype.getDocumentsMatchingQuery = function (t, e, n) { 21976 for (var r = Kw, i = new Cm(e.path.child("")), o = this.docs.getIteratorFrom(i); o.hasNext();) { 21977 var s = o.getNext(), 21978 a = s.key, 21979 u = s.value, 21980 s = u.document, 21981 u = u.readTime; 21982 if (!e.path.isPrefixOf(a.path)) break; 21983 u.compareTo(n) <= 0 || jb(e, s) && (r = r.insert(s.key, s.clone())) 21984 } 21985 return uI.resolve(r) 21986 }, UE.prototype.fs = function (t, e) { 21987 return uI.forEach(this.docs, function (t) { 21988 return e(t) 21989 }) 21990 }, UE.prototype.newChangeBuffer = function (t) { 21991 return new CE(this) 21992 }, UE.prototype.getSize = function (t) { 21993 return uI.resolve(this.size) 21994 }, UE), 21995 CE = (Xi(FE, wE = Sn), FE.prototype.applyChanges = function (n) { 21996 var r = this, 21997 i = [];
21998 return this.changes.forEach(function (t, e) { 21999 e.document.isValidDocument() ? i.push(r.Ie.addEntry(n, e.document, r.getReadTime(t))) : r.Ie.removeEntry(t) 22000 }), uI.waitFor(i) 22001 }, FE.prototype.getFromCache = function (t, e) { 22002 return this.Ie.getEntry(t, e) 22003 }, FE.prototype.getAllFromCache = function (t, e) { 22004 return this.Ie.getEntries(t, e) 22005 }, FE), 22006 NE = (ME.prototype.forEachTarget = function (t, n) { 22007 return this.ds.forEach(function (t, e) { 22008 return n(e) 22009 }), uI.resolve() 22010 }, ME.prototype.getLastRemoteSnapshotVersion = function (t) { 22011 return uI.resolve(this.lastRemoteSnapshotVersion) 22012 }, ME.prototype.getHighestSequenceNumber = function (t) { 22013 return uI.resolve(this.ws) 22014 }, ME.prototype.allocateTargetId = function (t) { 22015 return this.highestTargetId = this.ys.next(), uI.resolve(this.highestTargetId) 22016 }, ME.prototype.setTargetsMetadata = function (t, e, n) { 22017 return n && (this.lastRemoteSnapshotVersion = n), e > this.ws && (this.ws = e), uI.resolve() 22018 }, ME.prototype.te = function (t) { 22019 this.ds.set(t.target, t); 22020 var e = t.targetId; 22021 e > this.highestTargetId && (this.ys = new dT(e), this.highestTargetId = e), t.sequenceNumber > this.ws && (this.ws = t.sequenceNumber) 22022 }, ME.prototype.addTargetData = function (t, e) { 22023 return this.te(e), this.targetCount += 1, uI.resolve() 22024 }, ME.prototype.updateTargetData = function (t, e) { 22025 return this.te(e), uI.resolve() 22026 }, ME.prototype.removeTargetData = function (t, e) { 22027 return this.ds.delete(e.target), this._s.Zn(e.targetId), --this.targetCount, uI.resolve() 22028 }, ME.prototype.removeTargets = function (n, r, i) { 22029 var o = this, 22030 s = 0, 22031 a = []; 22032 return this.ds.forEach(function (t, e) { 22033 e.sequenceNumber <= r && null === i.get(e.targetId) && (o.ds.delete(t), a.push(o.removeMatchingKeysForTargetId(n, e.targetId)), s++) 22034 }), uI.waitFor(a).next(function () { 22035 return s 22036 }) 22037 }, ME.prototype.getTargetCount = function (t) { 22038 return uI.resolve(this.targetCount) 22039 }, ME.prototype.getTargetData = function (t, e) { 22040 e = this.ds.get(e) || null; 22041 return uI.resolve(e) 22042 }, ME.prototype.addMatchingKeys = function (t, e, n) { 22043 return this._s.Jn(e, n), uI.resolve() 22044 }, ME.prototype.removeMatchingKeys = function (e, t, n) { 22045 this._s.Xn(t, n); 22046 var r = this.persistence.referenceDelegate, 22047 i = []; 22048 return r && t.forEach(function (t) { 22049 i.push(r.markPotentiallyOrphaned(e, t)) 22050 }), uI.waitFor(i) 22051 }, ME.prototype.removeMatchingKeysForTargetId = function (t, e) { 22052 return this._s.Zn(e), uI.resolve() 22053 }, ME.prototype.getMatchingKeysForTargetId = function (t, e) { 22054 e = this._s.es(e); 22055 return uI.resolve(e) 22056 }, ME.prototype.containsKey = function (t, e) { 22057 return uI.resolve(this._s.containsKey(e)) 22058 }, ME), 22059 AE = (LE.prototype.start = function () { 22060 return Promise.resolve() 22061 }, LE.prototype.shutdown = function () { 22062 return this.xe = !1, Promise.resolve() 22063 }, Object.defineProperty(LE.prototype, "started", { 22064 get: function () { 22065 return this.xe 22066 }, 22067 enumerable: !1, 22068 configurable: !0 22069 }), LE.prototype.setDatabaseDeletedListener = function () {}, LE.prototype.setNetworkEnabled = function () {}, LE.prototype.getIndexManager = function () { 22070 return this.Ut 22071 }, LE.prototype.getMutationQueue = function (t) { 22072 var e = this.gs[t.toKey()]; 22073 return e || (e = new EE(this.Ut, this.referenceDelegate), this.gs[t.toKey()] = e), e 22074 }, LE.prototype.getTargetCache = function () { 22075 return this.qe 22076 }, LE.prototype.getRemoteDocumentCache = function () { 22077 return this.Ue 22078 }, LE.prototype.getBundleCache = function () { 22079 return this.Qe 22080 }, LE.prototype.runTransaction = function (t, e, n) { 22081 var r = this; 22082 Vy("MemoryPersistence", "Starting transaction:", t); 22083 var i = new kE(this.Ne.next()); 22084 return this.referenceDelegate.Es(), n(i).next(function (t) { 22085 return r.referenceDelegate.Ts(i).next(function () { 22086 return t 22087 }) 22088 }).toPromise().then(function (t) { 22089 return i.raiseOnCommittedEvent(), t 22090 }) 22091 }, LE.prototype.Is = function (e, n) { 22092 return uI.or(Object.values(this.gs).map(function (t) { 22093 return function () { 22094 return t.containsKey(e, n) 22095 } 22096 })) 22097 }, LE), 22098 kE = (Xi(xE, bE = Ga), xE), 22099 RE = (DE.bs = function (t) { 22100 return new DE(t) 22101 }, Object.defineProperty(DE.prototype, "vs", { 22102 get: function () { 22103 if (this.Rs) return this.Rs; 22104 throw Hy() 22105 }, 22106 enumerable: !1, 22107 configurable: !0 22108 }), DE.prototype.addReference = function (t, e, n) { 22109 return this.As.addReference(n, e), this.vs.delete(n.toString()), uI.resolve() 22110 }, DE.prototype.removeReference = function (t, e, n) { 22111 return this.As.removeReference(n, e), this.vs.add(n.toString()), uI.resolve() 22112 }, DE.prototype.markPotentiallyOrphaned = function (t, e) { 22113 return this.vs.add(e.toString()), uI.resolve() 22114 }, DE.prototype.removeTarget = function (t, e) { 22115 var n = this;
22116 this.As.Zn(e.targetId).forEach(function (t) { 22117 return n.vs.add(t.toString()) 22118 }); 22119 var r = this.persistence.getTargetCache(); 22120 return r.getMatchingKeysForTargetId(t, e.targetId).next(function (t) { 22121 t.forEach(function (t) { 22122 return n.vs.add(t.toString()) 22123 }) 22124 }).next(function () { 22125 return r.removeTargetData(t, e) 22126 }) 22127 }, DE.prototype.Es = function () { 22128 this.Rs = new Set 22129 }, DE.prototype.Ts = function (n) { 22130 var r = this, 22131 i = this.persistence.getRemoteDocumentCache().newChangeBuffer(); 22132 return uI.forEach(this.vs, function (t) { 22133 var e = Cm.fromPath(t); 22134 return r.Ps(n, e).next(function (t) { 22135 t || i.removeEntry(e) 22136 }) 22137 }).next(function () { 22138 return r.Rs = null, i.apply(n) 22139 }) 22140 }, DE.prototype.updateLimboDocument = function (t, e) { 22141 var n = this; 22142 return this.Ps(t, e).next(function (t) { 22143 t ? n.vs.delete(e.toString()) : n.vs.add(e.toString()) 22144 }) 22145 }, DE.prototype.ps = function (t) { 22146 return 0 22147 }, DE.prototype.Ps = function (t, e) { 22148 var n = this; 22149 return uI.or([function () { 22150 return uI.resolve(n.As.containsKey(e)) 22151 }, function () { 22152 return n.persistence.getTargetCache().containsKey(t, e) 22153 }, function () { 22154 return n.persistence.Is(t, e) 22155 }]) 22156 }, DE), 22157 PE = (OE.prototype.isAuthenticated = function () { 22158 return null != this.uid 22159 }, OE.prototype.toKey = function () { 22160 return this.isAuthenticated() ? "uid:" + this.uid : "anonymous-user" 22161 }, OE.prototype.isEqual = function (t) { 22162 return t.uid === this.uid 22163 }, OE); 22164 22165 function OE(t) { 22166 this.uid = t 22167 } 22168 22169 function DE(t) { 22170 this.persistence = t, this.As = new IE, this.Rs = null 22171 } 22172 22173 function xE(t) { 22174 var e = this; 22175 return (e = bE.call(this) || this).currentSequenceNumber = t, e 22176 } 22177 22178 function LE(t, e) { 22179 var n = this; 22180 this.gs = {}, this.Ne = new Dy(0), this.xe = !1, this.xe = !0, this.referenceDelegate = t(this), this.qe = new NE(this), this.Ut = new XI, this.Ue = (t = this.Ut, new SE(t, function (t) { 22181 return n.referenceDelegate.ps(t) 22182 })), this.R = new OI(e), this.Qe = new _E(this.R) 22183 } 22184 22185 function ME(t) { 22186 this.persistence = t, this.ds = new DT(Gm, zm), this.lastRemoteSnapshotVersion = Zy.min(), this.highestTargetId = 0, this.ws = 0, this._s = new IE, this.targetCount = 0, this.ys = dT.Jt() 22187 } 22188 22189 function FE(t) { 22190 var e = this; 22191 return (e = wE.call(this) || this).Ie = t, e 22192 } 22193 22194 function UE(t, e) { 22195 this.Ut = t, this.ls = e, this.docs = new xw(Cm.comparator), this.size = 0 22196 } 22197 22198 function jE(t, e) { 22199 this.Ut = t, this.referenceDelegate = e, this._n = [], this.ss = 1, this.rs = new Vw(TE.Gn) 22200 } 22201 22202 function qE(t, e) { 22203 this.key = t, this.ns = e 22204 } 22205 22206 function VE() { 22207 this.Wn = new Vw(TE.Gn), this.zn = new Vw(TE.Hn) 22208 } 22209 22210 function BE(t) { 22211 this.R = t, this.Kn = new Map, this.jn = new Map 22212 } 22213 22214 function KE(t, e) { 22215 return "firestore_clients_" + t + "_" + e 22216 } 22217 22218 function WE(t, e, n) { 22219 n = "firestore_mutations_" + t + "_" + n; 22220 return e.isAuthenticated() && (n += "_" + e.uid), n 22221 } 22222 22223 function HE(t, e) { 22224 return "firestore_targets_" + t + "_" + e 22225 } 22226 PE.UNAUTHENTICATED = new PE(null), PE.GOOGLE_CREDENTIALS = new PE("google-credentials-uid"), PE.FIRST_PARTY = new PE("first-party-uid"); 22227 var GE, zE = (gS.Vs = function (t, e, n) { 22228 var r, i = JSON.parse(n), 22229 o = "object" == typeof i && -1 !== ["pending", "acknowledged", "rejected"].indexOf(i.state) && (void 0 === i.error || "object" == typeof i.error); 22230 return o && i.error && (o = "string" == typeof i.error.message && "string" == typeof i.error.code) && (r = new Fy(i.error.code, i.error.message)), o ? new gS(t, e, i.state, r) : (By("SharedCl
22230ientState", "Failed to parse mutation state for ID '" + e + "': " + n), null) 22231 }, gS.prototype.Ss = function () { 22232 var t = { 22233 state: this.state, 22234 updateTimeMs: Date.now() 22235 }; 22236 return this.error && (t.error = { 22237 code: this.error.code, 22238 message: this.error.message 22239 }), JSON.stringify(t) 22240 }, gS), 22241 QE = (vS.Vs = function (t, e) { 22242 var n, r = JSON.parse(e), 22243 i = "object" == typeof r && -1 !== ["not-current", "current", "rejected"].indexOf(r.state) && (void 0 === r.error || "object" == typeof r.error); 22244 return i && r.error && (i = "string" == typeof r.error.message && "string" == typeof r.error.code) && (n = new Fy(r.error.code, r.error.message)), i ? new vS(t, r.state, n) : (By("SharedClientState", "Failed to parse target state for ID '" + t + "': " + e), null) 22245 }, vS.prototype.Ss = function () { 22246 var t = { 22247 state: this.state, 22248 updateTimeMs: Date.now() 22249 }; 22250 return this.error && (t.error = { 22251 code: this.error.code, 22252 message: this.error.message 22253 }), JSON.stringify(t) 22254 }, vS), 22255 YE = (dS.Vs = function (t, e) { 22256 for (var n = JSON.parse(e), r = "object" == typeof n && n.activeTargetIds instanceof Array, i = Xw, o = 0; r && o < n.activeTargetIds.length; ++o) r = Sm(n.activeTargetIds[o]), i = i.add(n.activeTargetIds[o]); 22257 return r ? new dS(t, i) : (By("SharedClientState", "Failed to parse client data for instance '" + t + "': " + e), null) 22258 }, dS), 22259 XE = (pS.Vs = function (t) { 22260 var e = JSON.parse(t); 22261 return "object" == typeof e && -1 !== ["Unknown", "Online", "Offline"].indexOf(e.onlineState) && "string" == typeof e.clientId ? new pS(e.clientId, e.onlineState) : (By("SharedClientState", "Failed to parse online state: " + t), null) 22262 }, pS), 22263 JE = (fS.prototype.Ds = function (t) { 22264 this.activeTargetIds = this.activeTargetIds.add(t) 22265 }, fS.prototype.Cs = function (t) { 22266 this.activeTargetIds = this.activeTargetIds.delete(t) 22267 }, fS.prototype.Ss = function () { 22268 var t = { 22269 activeTargetIds: this.activeTargetIds.toArray(), 22270 updateTimeMs: Date.now() 22271 }; 22272 return JSON.stringify(t) 22273 }, fS), 22274 $E = (lS.yt = function (t) { 22275 return !(!t || !t.localStorage) 22276 }, lS.prototype.start = function () { 22277 return $i(this, void 0, void 0, function () { 22278 var e, n, r, i, o, s, a, u, c, h, l = this; 22279 return Zi(this, function (t) { 22280 switch (t.label) { 22281 case 0: 22282 return [4, this.syncEngine.fn()]; 22283 case 1: 22284 for (s = t.sent(), e = 0, n = s; e < n.length; e++)(r = n[e]) !== this.Ns && (i = this.getItem(KE(this.persistenceKey, r))) && (o = YE.Vs(r, i)) && (this.ks = this.ks.insert(o.clientId, o)); 22285 for (this.Ks(), (s = this.storage.getItem(this.Us)) && (a = this.js(s)) && this.Ws(a), u = 0, c = this.Os; u < c.length; u++) h = c[u], this.Fs(h); 22286 return this.Os = [], this.window.addEventListener("unload", function () { 22287 return l.shutdown() 22288 }), this.started = !0, [2] 22289 } 22290 }) 22291 }) 22292 }, lS.prototype.writeSequenceNumber = function (t) { 22293 this.setItem(this.Ms, JSON.stringify(t)) 22294 }, lS.prototype.getAllActiveQueryTargets = function () { 22295 return this.Gs(this.ks) 22296 }, lS.prototype.isActiveQueryTarget = function (n) { 22297 var r = !1; 22298 return this.ks.forEach(function (t, e) { 22299 e.activeTargetIds.has(n) && (r = !0) 22300 }), r 22301 }, lS.prototype.addPendingMutation = function (t) { 22302 this.zs(t, "pending") 22303 }, lS.prototype.updateMutationState = function (t, e, n) { 22304 this.zs(t, e, n), this.Hs(t) 22305 }, lS.prototype.addLocalQueryTarget = function (t) { 22306 var e, n = "not-current"; 22307 return this.isActiveQueryTarget(t) && (!(e = this.storage.getItem(HE(this.persistenceKey, t))) || (e = QE.Vs(t, e)) && (n = e.state)), this.Js.Ds(t), this.Ks(), n 22308 }, lS.prototype.removeLocalQueryTarget = function (t) { 22309 this.Js.Cs(t), this.Ks() 22310 }, lS.prototype.isLocalQueryTarget = function (t) { 22311 return this.Js.activeTargetIds.has(t) 22312 }, lS.prototype.clearQueryState = function (t) { 22313 this.removeItem(HE(this.persistenceKey, t)) 22314 }, lS.prototype.updateQueryState = function (t, e, n) { 22315 this.Ys(t, e, n) 22316 }, lS.prototype.handleUserChange = function (t, e, n) { 22317 var r = this; 22318 e.forEach(function (t) { 22319 r.Hs(t) 22320 }
22320), this.currentUser = t, n.forEach(function (t) { 22321 r.addPendingMutation(t) 22322 }) 22323 }, lS.prototype.setOnlineState = function (t) { 22324 this.Xs(t) 22325 }, lS.prototype.notifyBundleLoaded = function () { 22326 this.Zs() 22327 }, lS.prototype.shutdown = function () { 22328 this.started && (this.window.removeEventListener("storage", this.xs), this.removeItem(this.$s), this.started = !1) 22329 }, lS.prototype.getItem = function (t) { 22330 var e = this.storage.getItem(t); 22331 return Vy("SharedClientState", "READ", t, e), e 22332 }, lS.prototype.setItem = function (t, e) { 22333 Vy("SharedClientState", "SET", t, e), this.storage.setItem(t, e) 22334 }, lS.prototype.removeItem = function (t) { 22335 Vy("SharedClientState", "REMOVE", t), this.storage.removeItem(t) 22336 }, lS.prototype.Fs = function (t) { 22337 var e = this, 22338 o = t; 22339 o.storageArea === this.storage && (Vy("SharedClientState", "EVENT", o.key, o.newValue), o.key !== this.$s ? this.Se.enqueueRetryable(function () { 22340 return $i(e, void 0, void 0, function () { 22341 var e, n, r, i; 22342 return Zi(this, function (t) { 22343 if (this.started) { 22344 if (null !== o.key) 22345 if (this.Ls.test(o.key)) { 22346 if (null == o.newValue) return e = this.ti(o.key), [2, this.ei(e, null)]; 22347 if (e = this.ni(o.key, o.newValue)) return [2, this.ei(e.clientId, e)] 22348 } else if (this.Bs.test(o.key)) { 22349 if (null !== o.newValue && (n = this.si(o.key, o.newValue))) return [2, this.ii(n)] 22350 } else if (this.qs.test(o.key)) { 22351 if (null !== o.newValue && (r = this.ri(o.key, o.newValue))) return [2, this.oi(r)] 22352 } else if (o.key === this.Us) { 22353 if (null !== o.newValue && (i = this.js(o.newValue))) return [2, this.Ws(i)] 22354 } else if (o.key === this.Ms)(i = function (t) { 22355 var e = Dy.o; 22356 if (null != t) try { 22357 var n = JSON.parse(t); 22358 Gy("number" == typeof n), e = n 22359 } catch (t) { 22360 By("SharedClientState", "Failed to read sequence number from WebStorage", t) 22361 } 22362 return e 22363 }(o.newValue)) !== Dy.o && this.sequenceNumberHandler(i); 22364 else if (o.key === this.Qs) return [2, this.syncEngine.ci()] 22365 } else this.Os.push(o); 22366 return [2] 22367 }) 22368 }) 22369 }) : By("Received WebStorage notification for local change. Another client might have garbage-collected our state")) 22370 }, Object.defineProperty(lS.prototype, "Js", { 22371 get: function () { 22372 return this.ks.get(this.Ns) 22373 }, 22374 enumerable: !1, 22375 configurable: !0 22376 }), lS.prototype.Ks = function () { 22377 this.setItem(this.$s, this.Js.Ss()) 22378 }, lS.prototype.zs = function (t, e, n) { 22379 n = new zE(this.currentUser, t, e, n), t = WE(this.persistenceKey, this.currentUser, t); 22380 this.setItem(t, n.Ss()) 22381 }, lS.prototype.Hs = function (t) { 22382 t = WE(this.persistenceKey, this.currentUser, t); 22383 this.removeItem(t) 22384 }, lS.prototype.Xs = function (t) { 22385 t = { 22386 clientId: this.Ns, 22387 onlineState: t 22388 }; 22389 this.storage.setItem(this.Us, JSON.stringify(t)) 22390 }, lS.prototype.Ys = function (t, e, n) { 22391 var r = HE(this.persistenceKey, t), 22392 n = new QE(t, e, n); 22393 this.setItem(r, n.Ss()) 22394 }, lS.prototype.Zs = function () { 22395 this.setItem(this.Qs, "value-not-used") 22396 }, lS.prototype.ti = function (t) { 22397 t = this.Ls.exec(t); 22398 return t ? t[1] : null 22399 }, lS.prototype.ni = function (t, e) { 22400 t = this.ti(t); 22401 return YE.Vs(t, e) 22402 }, lS.prototype.si = function (t, e) { 22403 var n = this.Bs.exec(t), 22404 t = Number(n[1]), 22405 n = void 0 !== n[2] ? n[2] : null; 22406 return zE.Vs(new PE(n), t, e) 22407 }, lS.prototype.ri = function (t, e) { 22408 t = this.qs.exec(t), t = Number(t[1]); 22409 return QE.Vs(t, e) 22410 }, lS.prototype.js = function (t) { 22411 return XE.Vs(t) 22412 }, lS.prototype.ii = function (e) { 22413 return $i(this, void 0, void 0, function () { 22414 return Zi(this, function (t) { 22415 return e.user.uid === this.currentUser.uid ? [2, this.syncEngine.ui(e.batchId, e.state, e.error)] : (Vy("SharedCl
22415ientState", "Ignoring mutation for non-active user " + e.user.uid), [2]) 22416 }) 22417 }) 22418 }, lS.prototype.oi = function (t) { 22419 return this.syncEngine.ai(t.targetId, t.state, t.error) 22420 }, lS.prototype.ei = function (t, e) { 22421 var n = this, 22422 r = e ? this.ks.insert(t, e) : this.ks.remove(t), 22423 i = this.Gs(this.ks), 22424 o = this.Gs(r), 22425 s = [], 22426 a = []; 22427 return o.forEach(function (t) { 22428 i.has(t) || s.push(t) 22429 }), i.forEach(function (t) { 22430 o.has(t) || a.push(t) 22431 }), this.syncEngine.hi(s, a).then(function () { 22432 n.ks = r 22433 }) 22434 }, lS.prototype.Ws = function (t) { 22435 this.ks.get(t.clientId) && this.onlineStateHandler(t.onlineState) 22436 }, lS.prototype.Gs = function (t) { 22437 var n = Xw; 22438 return t.forEach(function (t, e) { 22439 n = n.unionWith(e.activeTargetIds) 22440 }), n 22441 }, lS), 22442 ZE = (hS.prototype.addPendingMutation = function (t) {}, hS.prototype.updateMutationState = function (t, e, n) {}, hS.prototype.addLocalQueryTarget = function (t) { 22443 return this.li.Ds(t), this.fi[t] || "not-current" 22444 }, hS.prototype.updateQueryState = function (t, e, n) { 22445 this.fi[t] = e 22446 }, hS.prototype.removeLocalQueryTarget = function (t) { 22447 this.li.Cs(t) 22448 }, hS.prototype.isLocalQueryTarget = function (t) { 22449 return this.li.activeTargetIds.has(t) 22450 }, hS.prototype.clearQueryState = function (t) { 22451 delete this.fi[t] 22452 }, hS.prototype.getAllActiveQueryTargets = function () { 22453 return this.li.activeTargetIds 22454 }, hS.prototype.isActiveQueryTarget = function (t) { 22455 return this.li.activeTargetIds.has(t) 22456 }, hS.prototype.start = function () { 22457 return this.li = new JE, Promise.resolve() 22458 }, hS.prototype.handleUserChange = function (t, e, n) {}, hS.prototype.setOnlineState = function (t) {}, hS.prototype.shutdown = function () {}, hS.prototype.writeSequenceNumber = function (t) {}, hS.prototype.notifyBundleLoaded = function () {}, hS), 22459 tS = (cS.prototype.di = function (t) {}, cS.prototype.shutdown = function () {}, cS), 22460 eS = (uS.prototype.di = function (t) { 22461 this.gi.push(t) 22462 }, uS.prototype.shutdown = function () { 22463 window.removeEventListener("online", this.wi), window.removeEventListener("offline", this.mi) 22464 }, uS.prototype.pi = function () { 22465 window.addEventListener("online", this.wi), window.addEventListener("offline", this.mi) 22466 }, uS.prototype._i = function () { 22467 Vy("ConnectivityMonitor", "Network connectivity changed: AVAILABLE"); 22468 for (var t = 0, e = this.gi; t < e.length; t++)(0, e[t])(0) 22469 }, uS.prototype.yi = function () { 22470 Vy("ConnectivityMonitor", "Network connectivity changed: UNAVAILABLE"); 22471 for (var t = 0, e = this.gi; t < e.length; t++)(0, e[t])(1) 22472 }, uS.yt = function () { 22473 return "undefined" != typeof window && void 0 !== window.addEventListener && void 0 !== window.removeEventListener 22474 }, uS), 22475 nS = { 22476 BatchGetDocuments: "batchGet", 22477 Commit: "commit", 22478 RunQuery: "runQuery" 22479 }, 22480 rS = (aS.prototype.Ii = function (t) { 22481 this.Ai = t 22482 }, aS.prototype.Ri = function (t) { 22483 this.bi = t 22484 }, aS.prototype.onMessage = function (t) { 22485 this.vi = t 22486 }, aS.prototype.close = function () { 22487 this.Ti() 22488 }, aS.prototype.send = function (t) { 22489 this.Ei(t) 22490 }, aS.prototype.Pi = function () { 22491 this.Ai() 22492 }, aS.prototype.Vi = function (t) { 22493 this.bi(t) 22494 }, aS.prototype.Si = function (t) { 22495 this.vi(t) 22496 }, aS), 22497 iS = (sS.prototype.Ni = function (e, t, n, r) { 22498 var i = this.xi(e, t); 22499 Vy("RestConnection", "Sending: ", i, n); 22500 t = {}; 22501 return this.Fi(t, r), this.ki(e, i, t, n).then(function (t) { 22502 return Vy("RestConnection", "Received: ", t), t 22503 }, function (t) { 22504 throw Ky("RestConnection", e + " failed with error: ", t, "url: ", i, "request:", n), t 22505 }) 22506 }, sS.prototype.Oi = function (t, e, n, r) { 22507 return this.Ni(t, e, n, r) 22508 }, sS.prototype.Fi = function (t, e) { 22509 if (t["X-Goog-Api-Client"] = "gl-js/ fire/8.3.2", t["X-Firebase-GMPID"] = this.databaseInfo.appId, t["Content-Type"] = "text/plain", e) 22510 for (var n in e.authHeaders) e.authHeaders.hasOwnProperty(n) && (t[n] = e.authHeaders[n]) 22511 }, sS.prototype.xi = function (t, e) { 22512 t = nS[t]; 22513 return this.Di + "/v1/" + e + ":" + t 22514 }, Xi(oS, GE = sS), oS.prototype.ki = function (o, e, s, a) { 22515 return new Promise(function (n, r) { 22516 var i = new Oy; 22517 i.listenOnce(Ny.COMPLETE, function () { 22518 try { 22519 switch (i.getLastErrorCode()) { 22520 case Cy.NO_ERROR: 22521 var t = i.getResponseJson(); 22522 Vy("Connection", "XHR received:", JSON.stringify(t)), n(t); 22523 break; 22524 case Cy.TIMEOUT: 22525 Vy("Connection", 'RPC "' + o + '" timed out'), r(new Fy(My.DEADLINE_EXCEEDED, "Request time out")); 22526 break; 22527 case Cy.HTTP_ERROR: 22528 var e = i.getStatus(); 22529 Vy("Connection", 'RPC "' + o + '" failed with status:', e, "response text:", i.getResponseText()), 0 < e ? (t = i.getResponseJson().error) && t.status && t.message ? (e = t.status.toLowerCase().replace(/_/g, "-"), e = 0 <= Object.values(My).indexOf(e) ? e : My.UNKNOWN, r(new Fy(e, t.message))) : r(new Fy(My.UNKNOWN, "Server responded with status " + i.getStatus())) : r(new Fy(My.UNAVAILABLE, "Connection failed.")); 22530 break; 22531 default: 22532 Hy() 22533 } 22534 } finally { 22535 Vy("Connection", 'RPC "' + o + '" completed.') 22536 } 22537 }); 22538 var t = JSON.stringify(a); 22539 i.send(e, "POST", t, s, 15) 22540 }) 22541 }, oS.prototype.$i = function (t, e) { 22542 var n = [this.Di, "/", "google.firestore.v1.Firestore", "/", t, "/channel"], 22543 r = new wy, 22544 i = Sy(), 22545 t = { 22546 httpSessionIdParam: "gsessionid", 22547 initMessageHeaders: {}, 22548 messageUrlParams: { 22549 database: "projects/" + this.databaseId.projectId + "/databases/" + this.databaseId.database 22550 }, 22551 sendRawJson: !0, 22552 supportsCrossDomainXhr: !0,
22553 internalChannelParams: { 22554 forwardChannelRequestTimeoutMs: 6e5 22555 }, 22556 forceLongPolling: this.forceLongPolling, 22557 detectBufferingProxy: this.autoDetectLongPolling 22558 }; 22559 this.Fi(t.initMessageHeaders, e), vo() || yo() || 0 <= po().indexOf("Electron/") || (0 <= (e = po()).indexOf("MSIE ") || 0 <= e.indexOf("Trident/")) || 0 <= po().indexOf("MSAppHost/") || go() || (t.httpHeadersOverwriteParam = "$httpHeaders"); 22560 n = n.join(""); 22561 Vy("Connection", "Creating WebChannel: " + n, t); 22562 var o = r.createWebChannel(n, t), 22563 s = !1, 22564 a = !1, 22565 u = new rS({ 22566 Ei: function (t) { 22567 a ? Vy("Connection", "Not sending because WebChannel is closed:", t) : (s || (Vy("Connection", "Opening WebChannel transport."), o.open(), s = !0), Vy("Connection", "WebChannel sending:", t), o.send(t)) 22568 }, 22569 Ti: function () { 22570 return o.close() 22571 } 22572 }), 22573 t = function (t, e, n) { 22574 t.listen(e, function (t) { 22575 try { 22576 n(t) 22577 } catch (t) { 22578 setTimeout(function () { 22579 throw t 22580 }, 0) 22581 } 22582 }) 22583 }; 22584 return t(o, Py.EventType.OPEN, function () { 22585 a || Vy("Connection", "WebChannel transport opened.") 22586 }), t(o, Py.EventType.CLOSE, function () { 22587 a || (a = !0, Vy("Connection", "WebChannel transport closed"), u.Vi()) 22588 }), t(o, Py.EventType.ERROR, function (t) { 22589 a || (a = !0, Ky("Connection", "WebChannel transport errored:", t), u.Vi(new Fy(My.UNAVAILABLE, "The operation could not be completed"))) 22590 }), t(o, Py.EventType.MESSAGE, function (t) { 22591 var e, n, r, i; 22592 a || (Gy(!!(e = t.data[0])), (n = e.error || (null === (i = e[0]) || void 0 === i ? void 0 : i.error)) ? (Vy("Connection", "WebChannel received error:", n), r = n.status, t = function () { 22593 var t = Sw[r]; 22594 if (void 0 !== t) return Dw(t) 22595 }(), i = n.message, void 0 === t && (t = My.INTERNAL, i = "Unknown error status: " + r + " with message " + n.message), a = !0, u.Vi(new Fy(t, i)), o.close()) : (Vy("Connection", "WebChannel received:", e), u.Si(e))) 22596 }), t(i, Ay.STAT_EVENT, function (t) { 22597 t.stat === ky ? Vy("Connection", "Detected buffering proxy") : t.stat === Ry && Vy("Connection", "Detected no buffering proxy") 22598 }), setTimeout(function () { 22599 u.Pi() 22600 }, 0), u 22601 }, oS); 22602 22603 function oS(t) { 22604 var e = this; 22605 return (e = GE.call(this, t) || this).forceLongPolling = t.forceLongPolling, e.autoDetectLongPolling = t.autoDetectLongPolling, e 22606 } 22607 22608 function sS(t) { 22609 this.databaseInfo = t, this.databaseId = t.databaseId; 22610 var e = t.ssl ? "https" : "http"; 22611 this.Di = e + "://" + t.host, this.Ci = "projects/" + this.databaseId.projectId + "/databases/" + this.databaseId.database + "/documents" 22612 } 22613 22614 function aS(t) { 22615 this.Ei = t.Ei, this.Ti = t.Ti 22616 } 22617 22618 function uS() { 22619 var t = this; 22620 this.wi = function () { 22621 return t._i() 22622 }, this.mi = function () { 22623 return t.yi() 22624 }, this.gi = [], this.pi() 22625 } 22626 22627 function cS() {} 22628 22629 function hS() { 22630 this.li = new JE, this.fi = {}, this.onlineStateHandler = null, this.sequenceNumberHandler = null 22631 } 22632 22633 function lS(t, e, n, r, i) { 22634 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 xw(Yy), this.started = !1, this.Os = []; 22635 n = n.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); 22636 this.storage = this.window.localStorage, this.currentUser = i, this.$s = KE(this.persistenceKey, this.Ns), this.Ms = "firestore_sequence_number_" + this.persistenceKey, this.ks = this.ks.insert(this.Ns, new JE), this.Ls = new RegExp("^firestore_clients_" + n + "_([^_]*)$"), this.Bs = new RegExp("^firestore_mutations_" + n + "_(\\d+)(?:_(.*))?$"), this.qs = new RegExp("^firestore_targets_" + n + "_(\\d+)$"), this.Us = "firestore_online_state_" + this.persistenceKey, this.Qs = "firestore_bundle_loaded_" + this.persistenceKey, this.window.addEventListener("storage", this.xs) 22637 } 22638 22639 function fS() { 22640 this.activeTargetIds = Xw 22641 } 22642 22643 function pS(t, e) { 22644 this.clientId = t, this.onlineState = e 22645 } 22646 22647 function dS(t, e) { 22648 this.clientId = t, this.activeTargetIds = e 22649 } 22650 22651 function vS(t, e, n) { 22652 this.targetId = t, this.state = e, this.error = n 22653 } 22654 22655 function gS(t, e, n, r) { 22656 this.user = t, this.batchId = e, this.state = n, this.error = r 22657 } 22658 22659 function yS() { 22660 return "undefined" != typeof window ? window : null 22661 } 22662 22663 function mS() { 22664 return "undefined" != typeof document ? document : null 22665 } 22666 22667 function bS(t) { 22668 return new f_(t, !0) 22669 } 22670 22671 function wS(t, e, n, r, i) { 22672 var o = this; 22673 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) { 22674 n.enqueueAndForget(function () { 22675 return $i(o, void 0, void 0, function () { 22676 return Zi(this, function (t) { 22677 switch (t.label) { 22678 case 0: 22679 return KS(this) ? (Vy("RemoteStore", "Restarting streams for network reach
22679ability change."), [4, function (n) { 22680 return $i(this, void 0, void 0, function () { 22681 var e; 22682 return Zi(this, function (t) { 22683 switch (t.label) { 22684 case 0: 22685 return (e = n).$r.add(4), [4, MS(e)]; 22686 case 1: 22687 return t.sent(), e.Br.set("Unknown"), e.$r.delete(4), [4, LS(e)]; 22688 case 2: 22689 return t.sent(), [2] 22690 } 22691 }) 22692 }) 22693 }(this)]) : [3, 2]; 22694 case 1: 22695 t.sent(), t.label = 2; 22696 case 2: 22697 return [2] 22698 } 22699 }) 22700 }) 22701 }) 22702 }), this.Br = new AS(n, r) 22703 } 22704 var _S, IS, TS, ES = (xS.prototype.reset = function () { 22705 this.qi = 0 22706 }, xS.prototype.Ki = function () { 22707 this.qi = this.Bi 22708 }, xS.prototype.ji = function (t) { 22709 var e = this; 22710 this.cancel(); 22711 var n = Math.floor(this.qi + this.Wi()), 22712 r = Math.max(0, Date.now() - this.Qi), 22713 i = Math.max(0, n - r); 22714 0 < i && Vy("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 () { 22715 return e.Qi = Date.now(), t() 22716 }), this.qi *= this.Li, this.qi < this.Mi && (this.qi = this.Mi), this.qi > this.Bi && (this.qi = this.Bi) 22717 }, xS.prototype.Gi = function () { 22718 null !== this.Ui && (this.Ui.skipDelay(), this.Ui = null) 22719 }, xS.prototype.cancel = function () { 22720 null !== this.Ui && (this.Ui.cancel(), this.Ui = null) 22721 }, xS.prototype.Wi = function () { 22722 return (Math.random() - .5) * this.qi 22723 }, xS), 22724 Sn = (DS.prototype.tr = function () { 22725 return 1 === this.state || 2 === this.state || 4 === this.state 22726 }, DS.prototype.er = function () { 22727 return 2 === this.state 22728 }, DS.prototype.start = function () { 22729 3 !== this.state ? this.auth() : this.nr() 22730 }, DS.prototype.stop = function () { 22731 return $i(this, void 0, void 0, function () { 22732 return Zi(this, function (t) { 22733 switch (t.label) { 22734 case 0: 22735 return this.tr() ? [4, this.close(0)] : [3, 2]; 22736 case 1: 22737 t.sent(), t.label = 2; 22738 case 2: 22739 return [2] 22740 } 22741 }) 22742 }) 22743 }, DS.prototype.sr = function () { 22744 this.state = 0, this.Zi.reset() 22745 }, DS.prototype.ir = function () { 22746 var t = this; 22747 this.er() && null === this.Xi && (this.Xi = this.Se.enqueueAfterDelay(this.zi, 6e4, function () { 22748 return t.rr() 22749 })) 22750 }, DS.prototype.cr = function (t) { 22751 this.ur(), this.stream.send(t) 22752 }, DS.prototype.rr = function () { 22753 return $i(this, void 0, void 0, function () { 22754 return Zi(this, function (t) { 22755 return this.er() ? [2, this.close(0)] : [2] 22756 }) 22757 }) 22758 }, DS.prototype.ur = function () { 22759 this.Xi && (this.Xi.cancel(), this.Xi = null) 22760 }, DS.prototype.close = function (e, n) { 22761 return $i(this, void 0, void 0, function () { 22762 return Zi(this, function (t) { 22763 switch (t.label) { 22764 case 0: 22765 return this.ur(), this.Zi.cancel(), this.Yi++, 3 !== e ? this.Zi.reset() : n && n.code === My.RESOURCE_EXHAUSTED ? (By(n.toString()), By("Using maximum backoff delay to prevent overloading the backend."), this.Zi.Ki()) : n && n.code === My.UNAUTHENTICATED && this.Ji.invalidateToken(), null !== this.stream && (this.ar(), this.stream.close(), this.stream = null), this.state = e, [4, this.listener.Ri(n)]; 22766 case 1: 22767 return t.sent(), [2] 22768 } 22769 }) 22770 }) 22771 }, DS.prototype.ar = function () {}, DS.prototype.auth = function () { 22772 var n = this; 22773 this.state = 1; 22774 var t = this.hr(this.Yi), 22775 e = this.Yi; 22776 this.Ji.getToken().then(function (t) { 22777 n.Yi === e && n.lr(t) 22778 }, function (e) { 22779 t(function () { 22780 var t = new Fy(My.UNKNOWN, "Fetching auth token failed: " + e.message); 22781 return n.dr(t) 22782 }) 22783 }) 22784 }, DS.prototype.lr = function (t) { 22785 var e = this, 22786 n = this.hr(this.Yi); 22787 this.stream = this.wr(t), this.stream.Ii(function () { 22788 n(function () { 22789 return e.state = 2, e.listener.Ii() 22790 }) 22791 }), this.stream.Ri(function (t) { 22792 n(function () { 22793 return e.dr(t) 22794 }) 22795 }), this.stream.onMessage(function (t) { 22796 n(function () { 22797 return e.onMessage(t) 22798 }) 22799 }) 22800 }, DS.prototype.nr = function () { 22801 var t = this; 22802 this.state = 4, this.Zi.ji(function () { 22803 return $i(t, void 0, void 0, function () { 22804 return Zi(this, function (t) { 22805 return this.state = 0, this.start(), [2] 22806 }) 22807 }) 22808 }) 22809 }, DS.prototype.dr = function (t) { 22810 return Vy("PersistentStream", "close with error: " + t), this.stream = null, this.close(3, t) 22811 }, DS.prototype.hr = function (e) { 22812 var n = this; 22813 return function (t) { 22814 n.Se.enqueueAndForget(function () { 22815 return n.Yi === e ? t() : (Vy("PersistentStream", "stream callback skipped by getCloseGuardedDispatcher."), Promise.resolve()) 22816 }) 22817 } 22818 }, DS), 22819 SS = (Xi(OS, TS = Sn), OS.prototype.wr = function (t) { 22820 return this.Hi.$i("Listen", t) 22821 }, OS.prototype.onMessage = function (t) { 22822 this.Zi.reset(); 22823 var e = function (t, e) { 22824 if ("targetChange" in e) { 22825 e.targetChange; 22826 var n = "NO_CHANGE" === (o = e.targetChange.targetChangeType || "NO_CHANGE") ? 0 : "ADD" === o ? 1 : "REMOVE" === o ? 2 : "CURRENT" === o ? 3 : "RESET" === o ? 4 : Hy(), 22827 r = e.targetChange.targetIds || [], 22828 i = (s = e.targetChange.resumeToken, t.I ? (Gy(void 0 === s || "string" == typeof s), lm.fromBase64String(s || "")) : (Gy(void 0 === s || s instanceof Uint8Array), lm.fromUint8Array(s || new Uint8Array))), 22829 o = (a = e.targetChange.cause) && (u = void 0 === (c = a).code ? My.UNKNOWN : Dw(c.code), new Fy(u, c.message || "")), 22830 s = new e_(n, r, i, o || null) 22831 } else if ("documentChange" in e) { 22832 e.documentChange, (n = e.documentChange).document, n.document.name, n.document.updateTime; 22833 var r = b_(t, n.document.name), 22834 i = v_(n.document.updateTime), 22835 a = new qm({ 22836 mapValue: { 22837 fields: n.document.fields 22838 } 22839 }), 22840 u = (o = Bm.newFoundDocument(r, i, a), n.targetIds || []), 22841 c = n.removedTargetIds || []; 22842 s = new Zw(u, c, o.key, o) 22843 } else if ("documentDelete" in e) e.documentDelete, (n = e.documentDelete).document, r = b_(t, n.document), i = n.readTime ? v_(n.readTime) : Zy.min(), a = Bm.newNoDocument(r, i), o = n.removedTargetIds || [], s = new Zw([], o, a.key, a); 22844 else if ("documentRemove" in e) e.documentRemove, (n = e.documentRemove).document, r = b_(t, n.document), i = n.removedTargetIds || [], s = new Zw([], i, r, null); 22845 else { 22846 if (!("filter" in e)) return Hy(); 22847 e.filter; 22848 e = e.filter; 22849 e.targetId, n = e.count || 0, r = new Ew(n), i = e.targetId, s = new t_(i, r) 22850 } 22851 return s 22852 }(this.R, t), 22853 t = function (t) { 22854 if (!("targetChange" in t)) return Zy.min(); 22855 t = t.targetChange; 22856 return (!t.targetIds || !t.targetIds.length) && t.readTime ? v_(t.readTime) : Zy.min() 22857 }(t); 22858 return this.listener._r(e, t) 22859 }, OS.prototype.mr = function (t) { 22860 var e, n, r, i = {}; 22861 i.database = I_(this.R), i.addTarget = (e = this.R, (r = Qm(r = (n = t).target) ? {
22862 documents: A_(e, r) 22863 } : { 22864 query: k_(e, r) 22865 }).targetId = n.targetId, 0 < n.resumeToken.approximateByteSize() ? r.resumeToken = d_(e, n.resumeToken) : 0 < n.snapshotVersion.compareTo(Zy.min()) && (r.readTime = p_(e, n.snapshotVersion.toTimestamp())), r); 22866 var o, t = (this.R, o = t, null == (t = function () { 22867 switch (o.purpose) { 22868 case 0: 22869 return null; 22870 case 1: 22871 return "existence-filter-mismatch"; 22872 case 2: 22873 return "limbo-document"; 22874 default: 22875 return Hy() 22876 } 22877 }()) ? null : { 22878 "goog-listen-tags": t 22879 }); 22880 t && (i.labels = t), this.cr(i) 22881 }, OS.prototype.yr = function (t) { 22882 var e = {}; 22883 e.database = I_(this.R), e.removeTarget = t, this.cr(e) 22884 }, OS), 22885 CS = (Xi(PS, IS = Sn), Object.defineProperty(PS.prototype, "pr", { 22886 get: function () { 22887 return this.gr 22888 }, 22889 enumerable: !1, 22890 configurable: !0 22891 }), PS.prototype.start = function () { 22892 this.gr = !1, this.lastStreamToken = void 0, IS.prototype.start.call(this) 22893 }, PS.prototype.ar = function () { 22894 this.gr && this.Er([]) 22895 }, PS.prototype.wr = function (t) { 22896 return this.Hi.$i("Write", t) 22897 }, PS.prototype.onMessage = function (t) { 22898 if (Gy(!!t.streamToken), this.lastStreamToken = t.streamToken, this.gr) { 22899 this.Zi.reset(); 22900 var e = (n = t.writeResults, r = t.commitTime, n && 0 < n.length ? (Gy(void 0 !== r), n.map(function (t) { 22901 return n = r, (t = (e = t).updateTime ? v_(e.updateTime) : v_(n)).isEqual(Zy.min()) && (t = v_(n)), new aw(t, e.transformResults || []); 22902 var e, n 22903 })) : []), 22904 n = v_(t.commitTime); 22905 return this.listener.Tr(n, e) 22906 } 22907 var n, r; 22908 return Gy(!t.writeResults || 0 === t.writeResults.length), this.gr = !0, this.listener.Ir() 22909 }, PS.prototype.Ar = function () { 22910 var t = {}; 22911 t.database = I_(this.R), this.cr(t) 22912 }, PS.prototype.Er = function (t) { 22913 var e = this, 22914 t = { 22915 streamToken: this.lastStreamToken, 22916 writes: t.map(function (t) { 22917 return C_(e.R, t) 22918 }) 22919 }; 22920 this.cr(t) 22921 }, PS), 22922 NS = (Xi(RS, _S = function () {}), RS.prototype.br = function () { 22923 if (this.Rr) throw new Fy(My.FAILED_PRECONDITION, "The client has already been terminated.") 22924 }, RS.prototype.Ni = function (e, n, r) { 22925 var i = this; 22926 return this.br(), this.credentials.getToken().then(function (t) { 22927 return i.Hi.Ni(e, n, r, t) 22928 }).catch(function (t) { 22929 throw t.code === My.UNAUTHENTICATED && i.credentials.invalidateToken(), t 22930 }) 22931 }, RS.prototype.Oi = function (e, n, r) { 22932 var i = this; 22933 return this.br(), this.credentials.getToken().then(function (t) { 22934 return i.Hi.Oi(e, n, r, t) 22935 }).catch(function (t) { 22936 throw t.code === My.UNAUTHENTICATED && i.credentials.invalidateToken(), t 22937 }) 22938 }, RS.prototype.terminate = function () { 22939 this.Rr = !1 22940 }, RS), 22941 AS = (kS.prototype.Sr = function () { 22942 var t = this; 22943 0 === this.vr && (this.Dr("Unknown"), this.Pr = this.asyncQueue.enqueueAfterDelay("online_state_timeout", 1e4, function () { 22944 return t.Pr = null, t.Cr("Backend didn't respond within 10 seconds."), t.Dr("Offline"), Promise.resolve() 22945 })) 22946 }, kS.prototype.Nr = function (t) { 22947 "Online" === this.state ? this.Dr("Unknown") : (this.vr++, 1 <= this.vr && (this.Fr(), this.Cr("Connection failed 1 times. Most recent error: " + t.toString()), this.Dr("Offline"))) 22948 }, kS.prototype.set = function (t) { 22949 this.Fr(), this.vr = 0, "Online" === t && (this.Vr = !1), this.Dr(t) 22950 }, kS.prototype.Dr = function (t) { 22951 t !== this.state && (this.state = t, this.onlineStateHandler(t)) 22952 }, kS.prototype.Cr = function (t) { 22953 t = "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."; 22954 this.Vr ? (By(t), this.Vr = !1) : Vy("OnlineStateTracker", t) 22955 }, kS.prototype.Fr = function () { 22956 null !== this.Pr && (this.Pr.cancel(), this.Pr = null) 22957 }, kS); 22958 22959 function kS(t, e) { 22960 this.asyncQueue = t, this.onlineStateHandler = e, this.state = "Unknown", this.vr = 0, this.Pr = null, this.Vr = !0 22961 } 22962 22963 function RS(t, e, n) { 22964 var r = this; 22965 return (r = _S.call(this) || this).credentials = t, r.Hi = e, r.R = n, r.Rr = !1, r 22966 } 22967 22968 function PS(t, e, n, r, i) { 22969 var o = this; 22970 return (o = IS.call(this, t, "write_stream_connection_backoff", "write_stream_idle", e, n, i) || this).R = r, o.gr = !1, o 22971 } 22972 22973 function OS(t, e, n, r, i) { 22974 var o = this; 22975 return (o = TS.call(this, t, "listen_stream_connection_backoff", "listen_stream_idle", e, n, i) || this).R = r, o 22976 } 22977 22978 function DS(t, e, n, r, i, o) { 22979 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 ES(t, e) 22980 } 22981 22982 function xS(t, e, n, r, i) { 22983 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
22983= Date.now(), this.reset() 22984 } 22985 22986 function LS(r) { 22987 return $i(this, void 0, void 0, function () { 22988 var e, n; 22989 return Zi(this, function (t) { 22990 switch (t.label) { 22991 case 0: 22992 if (!KS(r)) return [3, 4]; 22993 e = 0, n = r.Mr, t.label = 1; 22994 case 1: 22995 return e < n.length ? [4, (0, n[e])(!0)] : [3, 4]; 22996 case 2: 22997 t.sent(), t.label = 3; 22998 case 3: 22999 return e++, [3, 1]; 23000 case 4: 23001 return [2] 23002 } 23003 }) 23004 }) 23005 } 23006 23007 function MS(r) { 23008 return $i(this, void 0, void 0, function () { 23009 var e, n; 23010 return Zi(this, function (t) { 23011 switch (t.label) { 23012 case 0: 23013 e = 0, n = r.Mr, t.label = 1; 23014 case 1: 23015 return e < n.length ? [4, (0, n[e])(!1)] : [3, 4]; 23016 case 2: 23017 t.sent(), t.label = 3; 23018 case 3: 23019 return e++, [3, 1]; 23020 case 4: 23021 return [2] 23022 } 23023 }) 23024 }) 23025 } 23026 23027 function FS(t, e) { 23028 t.Or.has(e.targetId) || (t.Or.set(e.targetId, e), BS(t) ? VS(t) : $S(t).er() && jS(t, e)) 23029 } 23030 23031 function US(t, e) { 23032 var n = t, 23033 t = $S(n); 23034 n.Or.delete(e), t.er() && qS(n, e), 0 === n.Or.size && (t.er() ? t.ir() : KS(n) && n.Br.set("Unknown")) 23035 } 23036 23037 function jS(t, e) { 23038 t.qr.U(e.targetId), $S(t).mr(e) 23039 } 23040 23041 function qS(t, e) { 23042 t.qr.U(e), $S(t).yr(e) 23043 } 23044 23045 function VS(e) { 23046 e.qr = new r_({ 23047 getRemoteKeysForTarget: function (t) { 23048 return e.remoteSyncer.getRemoteKeysForTarget(t) 23049 }, 23050 lt: function (t) { 23051 return e.Or.get(t) || null 23052 } 23053 }), $S(e).start(), e.Br.Sr() 23054 } 23055 23056 function BS(t) { 23057 return KS(t) && !$S(t).tr() && 0 < t.Or.size 23058 } 23059 23060 function KS(t) { 23061 return 0 === t.$r.size 23062 } 23063 23064 function WS(t) { 23065 t.qr = void 0 23066 } 23067 23068 function HS(s, a, u) { 23069 return $i(this, void 0, void 0, function () { 23070 var n, o; 23071 return Zi(this, function (t) { 23072 switch (t.label) { 23073 case 0: 23074 if (s.Br.set("Online"), !(a instanceof e_ && 2 === a.state && a.cause)) return [3, 6]; 23075 t.label = 1; 23076 case 1: 23077 return t.trys.push([1, 3, , 5]), [4, function (o, s) { 23078 return $i(this, void 0, void 0, function () { 23079 var e, n, r, i; 23080 return Zi(this, function (t) { 23081 switch (t.label) { 23082 case 0: 23083 e = s.cause, n = 0, r = s.targetIds, t.label = 1; 23084 case 1: 23085 return n < r.length ? (i = r[n], o.Or.has(i) ? [4, o.remoteSyncer.rejectListen(i, e)] : [3, 3]) : [3, 5]; 23086 case 2: 23087 t.sent(), o.Or.delete(i), o.qr.removeTarget(i), t.label = 3; 23088 case 3: 23089 t.label = 4; 23090 case 4: 23091 return n++, [3, 1]; 23092 case 5: 23093 return [2] 23094 } 23095 }) 23096 }) 23097 }(s, a)]; 23098 case 2: 23099 return t.sent(), [3, 5]; 23100 case 3: 23101 return n = t.sent(), Vy("RemoteStore", "Failed to remove targets %s: %s ", a.targetIds.join(","), n), [4, GS(s, n)]; 23102 case 4: 23103 return t.sent(), [3, 5]; 23104 case 5: 23105 return [3, 13]; 23106 case 6: 23107 if (a instanceof Zw ? s.qr.X(a) : a instanceof t_ ? s.qr.rt(a) : s.qr.et(a), u.isEqual(Zy.min())) return [3, 13]; 23108 t.label = 7; 23109 case 7: 23110 return t.trys.push([7, 11, , 13]), [4, hE(s.localStore)]; 23111 case 8: 23112 return o = t.sent(), 0 <= u.compareTo(o) ? [4, (i = u, (e = (r = s).qr.ut(i)).targetChanges.forEac
23112h(function (t, e) { 23113 var n; 23114 0 < t.resumeToken.approximateByteSize() && ((n = r.Or.get(e)) && r.Or.set(e, n.withResumeToken(t.resumeToken, i))) 23115 }), e.targetMismatches.forEach(function (t) { 23116 var e = r.Or.get(t); 23117 e && (r.Or.set(t, e.withResumeToken(lm.EMPTY_BYTE_STRING, e.snapshotVersion)), qS(r, t), e = new PI(e.target, t, 1, e.sequenceNumber), jS(r, e)) 23118 }), r.remoteSyncer.applyRemoteEvent(e))] : [3, 10]; 23119 case 9: 23120 t.sent(), t.label = 10; 23121 case 10: 23122 return [3, 13]; 23123 case 11: 23124 return Vy("RemoteStore", "Failed to raise snapshot:", o = t.sent()), [4, GS(s, o)]; 23125 case 12: 23126 return t.sent(), [3, 13]; 23127 case 13: 23128 return [2] 23129 } 23130 var r, i, e 23131 }) 23132 }) 23133 } 23134 23135 function GS(n, r, i) { 23136 return $i(this, void 0, void 0, function () { 23137 var e = this; 23138 return Zi(this, function (t) { 23139 switch (t.label) { 23140 case 0: 23141 if (!bI(r)) throw r; 23142 return n.$r.add(1), [4, MS(n)]; 23143 case 1: 23144 return t.sent(), n.Br.set("Offline"), i = i || function () { 23145 return hE(n.localStore) 23146 }, n.asyncQueue.enqueueRetryable(function () { 23147 return $i(e, void 0, void 0, function () { 23148 return Zi(this, function (t) { 23149 switch (t.label) { 23150 case 0: 23151 return Vy("RemoteStore", "Retrying IndexedDB access"), [4, i()]; 23152 case 1: 23153 return t.sent(), n.$r.delete(1), [4, LS(n)]; 23154 case 2: 23155 return t.sent(), [2] 23156 } 23157 }) 23158 }) 23159 }), [2] 23160 } 23161 }) 23162 }) 23163 } 23164 23165 function zS(e, n) { 23166 return n().catch(function (t) { 23167 return GS(e, t, n) 23168 }) 23169 } 23170 23171 function QS(u) { 23172 return $i(this, void 0, void 0, function () { 23173 var i, o, s, a; 23174 return Zi(this, function (t) { 23175 switch (t.label) { 23176 case 0: 23177 o = ZS(i = u), s = 0 < i.kr.length ? i.kr[i.kr.length - 1].batchId : -1, t.label = 1; 23178 case 1: 23179 if (!(KS(i) && i.kr.length < 10)) return [3, 7]; 23180 t.label = 2; 23181 case 2: 23182 return t.trys.push([2, 4, , 6]), [4, (e = i.localStore, n = s, (r = e).persistence.runTransaction("Get next mutation batch", "readonly", function (t) { 23183 return void 0 === n && (n = -1), r._n.getNextMutationBatchAfterBatchId(t, n) 23184 }))]; 23185 case 3: 23186 return null === (a = t.sent()) ? (0 === i.kr.length && o.ir(), [3, 7]) : (s = a.batchId, function (t, e) { 23187 t.kr.push(e); 23188 t = ZS(t); 23189 t.er() && t.pr && t.Er(e.mutations) 23190 }(i, a), [3, 6]); 23191 case 4: 23192 return a = t.sent(), [4, GS(i, a)]; 23193 case 5: 23194 return t.sent(), [3, 6]; 23195 case 6: 23196 return [3, 1]; 23197 case 7: 23198 return YS(i) && XS(i), [2] 23199 } 23200 var e, n, r 23201 }) 23202 }) 23203 } 23204 23205 function YS(t) { 23206 return KS(t) && !ZS(t).tr() && 0 < t.kr.length 23207 } 23208 23209 function XS(t) { 23210 ZS(t).start() 23211 } 23212 23213 function JS(n, r) { 23214 return $i(this, void 0, void 0, function () { 23215 var e; 23216 return Zi(this, function (t) { 23217 switch (t.label) { 23218 case 0: 23219 return e = n, r ? (e.$r.delete(2), [4, LS(e)]) : [3, 2]; 23220 case 1: 23221 return t.sent(), [3, 5]; 23222 case 2: 23223 return r ? [3, 4] : (e.$r.add(2), [4, MS(e)]); 23224 case 3: 23225 t.sent(), e.Br.set("Unknown"), t.label = 4; 23226 case 4: 23227 t.label = 5; 23228 case 5: 23229 return [2] 23230 } 23231 }) 23232 }) 23233 } 23234 23235 function $S(n) { 23236 var t, e, r, i = this; 23237 return n.Ur || (n.Ur = (t = n.datastore, e = n.asyncQueue, r = { 23238 Ii: function (n) { 23239 return $i(this, void 0, void 0, function () { 23240 return Zi(this, function (t) { 23241 return n.Or.forEach(function (t, e) { 23242 jS(n, t) 23243 }), [2] 23244 }) 23245 }) 23246 }.bind(null, n), 23247 Ri: function (e, n) { 23248 return $i(this, void 0, void 0, function () { 23249 return Zi(this, function (t) { 23250 return WS(e), BS(e) ? (e.Br.Nr(n), VS(e)) : e.Br.set("Unknown"), [2] 23251 }) 23252 }) 23253 }.bind(null, n), 23254 _r: HS.bind(null, n) 23255 }, t.br(), new SS(e, t.Hi, t.credentials, t.R, r)), n.Mr.push(function (e) { 23256 return $i(i, void 0, void 0, function () { 23257 return Zi(this, function (t) { 23258 switch (t.label) { 23259 case 0: 23260 return e ? (n.Ur.sr(), BS(n) ? VS(n) : n.Br.set("Unknown"), [3, 3]) : [3, 1]; 23261 case 1: 23262 return [4, n.Ur.stop()]; 23263 case 2: 23264 t.sent(), WS(n), t.label = 3; 23265 case 3: 23266 return [2] 23267 } 23268 }) 23269 }) 23270 })), n.Ur 23271 } 23272 23273 function ZS(n) { 23274 var t, e, r, i = this; 23275 return n.Qr || (n.Qr = (t = n.datastore, e = n.asyncQueue, r = { 23276 Ii: function (e) { 23277 return $i(this, void 0, void 0, function () { 23278 return Zi(this, function (t) { 23279 return ZS(e).Ar(), [2] 23280 }) 23281 }) 23282 }.bind(null, n), 23283 Ri: function (e, n) { 23284 return $i(this, void 0, void 0, function () { 23285 return Zi(this, function (t) { 23286 switch (t.label) { 23287 case 0: 23288 return n && ZS(e).pr ? [4, function (r, i) { 23289 return $i(this, void 0, void 0, function () { 23290 var e, n; 23291 return Zi(this, function (t) { 23292 switch (t.label) { 23293 case 0: 23294 return Ow(n = i.code) && n !== My.ABORTED ? (e = r.kr.shift(), ZS(r).sr(), [4, zS(r, function () { 23295 return r.remoteSyncer.rejectFailedWrite(e.batchId, i) 23296 })]) : [3, 3]; 23297 case 1: 23298 return t.sent(), [4, QS(r)]; 23299 case 2: 23300 t.sent(), t.label = 3; 23301 case 3: 23302 return [2] 23303 } 23304 }) 23305 }) 23306 }(e, n)] : [3, 2]; 23307 case 1: 23308 t.sent(), t.label = 2; 23309 case 2: 23310 return YS(e) && XS(e), [2] 23311 } 23312 }) 23313 }) 23314 }.bind(null, n), 23315 Ir: function (o) { 23316 return $i(this, void 0, void 0, function () { 23317 var e, n, r, i; 23318 return Zi(this, function (t) { 23319 for (e = ZS(o), n = 0, r = o.kr; n < r.length; n++) i = r[n], e.Er(i.mutations); 23320 return [2] 23321 }) 23322 }) 23323 }.bind(null, n), 23324 Tr: function (r, i, o) { 23325 return $i(this, void 0, void 0, function () { 23326 var e, n; 23327 return Zi(this, function (t) { 23328 switch (t.label) { 23329 case 0: 23330 return e = r.kr.shift(), n = RI.from(e, i, o), [4, zS(r, function () { 23331 return r.remoteSyncer.applySuccessfulWrite(n) 23332 })]; 23333 case 1: 23334 return t.sent(), [4, QS(r)]; 23335 case 2: 23336 return t.sent(), [2] 23337 } 23338 }) 23339 }) 23340 }.bind(null, n) 23341 }, t.br(), new CS(e, t.Hi, t.credentials, t.R, r)), n.Mr.push(function (e) { 23342 return $i(i, void 0, void 0, function () { 23343 return Zi(this, function (t) { 23344 switch (t.label) { 23345 case 0: 23346 return e ? (n.Qr.sr(), [4, QS(n)]) : [3, 2]; 23347 case 1: 23348 return t.sent(), [3, 4]; 23349 case 2: 23350 return [4, n.Qr.stop()]; 23351 case 3: 23352 t.sent(), 0 < n.kr.length && (Vy("RemoteStore", "Stopping write stream with " + n.kr.length + " pending writes"), n.kr = []), t.label = 4; 23353 case 4: 23354 return [2] 23355 } 23356 }) 23357 }) 23358 })), n.Qr 23359 } 23360 var tC = (eC.createAndSchedule = function (t, e, n, r, i) { 23361 i = new eC(t, e, Date.now() + n, r, i); 23362 return i.start(n), i 23363 }, eC.prototype.start = function (t) { 23364 var e = this; 23365 this.timerHandle = setTimeout(function () { 23366 return e.handleDelayElapsed() 23367 }, t) 23368 }, eC.prototype.skipDelay = function () { 23369 return this.handleDelayElapsed() 23370 }, eC.prototype.cancel = function (t) { 23371 null !== this.timerHandle && (this.clearTimeout(), this.deferred.reject(new Fy(My.CANCELLED, "Operation cancelled" + (t ? ": " + t : "")))) 23372 }, eC.prototype.handleDelayElapsed = function () { 23373 var e = this; 23374 this.asyncQueue.enqueueAndForget(function () { 23375 return null !== e.timerHandle ? (e.clearTimeout(), e.op().then(function (t) { 23376 return e.deferred.resolve(t) 23377 })) : Promise.resolve() 23378 }) 23379 }, eC.prototype.clearTimeout = function () { 23380 null !== this.timerHandle && (this.removalCallback(this), clearTimeout(this.timerHandle), this.timerHandle = null) 23381 }, eC); 23382 23383 function eC(t, e, n, r, i) { 23384 this.asyncQueue = t, this.timerId = e, this.targetTimeMs = n, this.op = r, this.removalCallback = i, this.deferred = new aI, this.then = this.deferred.promise.then.bind(this.deferred.promise), this.deferred.promise.catch(function (t) {}) 23385 } 23386 23387 function nC(t, e) { 23388 if (By("AsyncQueue", e + ": " + t), bI(t)) return new Fy(My.UNAVAILABLE, e + ": " + t); 23389 throw t 23390 } 23391 23392 function rC() { 23393 this.queries = new DT(Fb, Mb), this.onlineState = "Unknown", this.Gr = new Set 23394 } 23395 var iC = (hC.emptySet = function (t) { 23396 return new hC(t.comparator) 23397 }, hC.prototype.has = function (t) { 23398 return null != this.keyedMap.get(t) 23399 }, hC.prototype.get = function (t) { 23400 return this.keyedMap.get(t) 23401 }, hC.prototype.first = function () { 23402 return this.sortedSet.minKey() 23403 }, hC.prototype.last = function () { 23404 return this.sortedSet.maxKey() 23405 }, hC.prototype.isEmpty = function () { 23406 return this.sortedSet.isEmpty() 23407 }, hC.prototype.indexOf = function (t) { 23408 t = this.keyedMap.get(t); 23409 return t ? this.sortedSet.indexOf(t) : -1 23410 }, Object.defineProperty(hC.prototype, "size", { 23411 get: function () { 23412 return this.sortedSet.size 23413 }, 23414 enumerable: !1, 23415 configurable: !0 23416 }), hC.prototype.forEach = function (n) { 23417 this.sortedSet.inorderTraversal(function (t, e) { 23418 return n(t), !1 23419 }) 23420 }, hC.prototype.add = function (t) { 23421 var e = this.delete(t.key); 23422 return e.copy(e.keyedMap.insert(t.key, t), e.sortedSet.insert(t, null)) 23423 }, hC.prototype.delete = function (t) { 23424 var e = this.get(t); 23425 return e ? this.copy(this.keyedMap.remove(t), this.sortedSet.remove(e)) : this 23426 }, hC.prototype.isEqual = function (t) { 23427 if (!(t instanceof hC)) return !1; 23428 if (this.size !== t.size) return !1; 23429 for (var e = this.sortedSet.getIterator(), n = t.sortedSet.getIterator(); e.hasNext();) { 23430 var r = e.getNext().key, 23431 i = n.getNext().key; 23432 if (!r.isEqual(i)) return !1 23433 } 23434 return !0 23435 }, hC.prototype.toString = function () { 23436 var e = []; 23437 return this.forEach(function (t) { 23438 e.push(t.toString()) 23439 }), 0 === e.length ? "DocumentSet ()" : "DocumentSet (\n " + e.join(" \n") + "\n)" 23440 }, hC.prototype.copy = function (t, e) { 23441 var n = new hC; 23442 return n.comparator = this.comparator, n.keyedMap = t, n.sortedSet = e, n 23443 }, hC), 23444 oC = (cC.prototype.track = function (t) { 23445 var e = t.doc.key, 23446 n = this.Kr.get(e); 23447 !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, { 23448 type: n.type, 23449 doc: t.doc 23450 }) : 2 === t.type && 2 === n.type ? this.Kr = this.Kr.insert(e, { 23451 type: 2, 23452 doc: t.doc 23453 }) : 2 === t.type && 0 === n.type ? this.Kr = this.Kr.insert(e, { 23454 type: 0, 23455 doc: t.doc 23456 }) : 1 === t.type && 0 === n.type ? this.Kr = this.Kr.remove(e) : 1 === t.type && 2 === n.type ? this.Kr = this.Kr.insert(e, { 23457 type: 1, 23458 doc: n.doc 23459 }) : 0 === t.type && 1 === n.type ? this.Kr = this.Kr.insert(e, { 23460 type: 2, 23461 doc: t.doc 23462 }) : Hy() 23463 }, cC.prototype.jr = function () { 23464 var n = []; 23465 return this.Kr.inorderTraversal(function (t, e) { 23466 n.push(e) 23467 }), n 23468 }, cC), 23469 sC = (uC.fromInitialDocuments = function (t, e, n, r) { 23470 var i = []; 23471 return e.forEach(function (t) { 23472 i.push({ 23473 type: 0, 23474 doc: t 23475 }) 23476 }), new uC(t, e, iC.emptySet(e), i, n, r, !0, !1) 23477 }, Object.defineProperty(uC.prototype, "hasPendingWrites", { 23478 get: function () { 23479 return !this.mutatedKeys.isEmpty() 23480 }, 23481 enumerable: !1, 23482 configurable: !0 23483 }), uC.prototype.isEqual = function (t) { 23484 if (!(this.fromCache === t.fromCache && this.syncStateChanged === t.syncStateChanged && this.mutatedKeys.isEqual(t.mutatedKeys) && Mb(this.query, t.query) && this.docs.isEqual(t.docs) && this.oldDocs.isEqual(t.oldDocs))) return !
234841; 23485 var e = this.docChanges, 23486 n = t.docChanges; 23487 if (e.length !== n.length) return !1; 23488 for (var r = 0; r < e.length; r++) 23489 if (e[r].type !== n[r].type || !e[r].doc.isEqual(n[r].doc)) return !1; 23490 return !0 23491 }, uC), 23492 aC = function () { 23493 this.Wr = void 0, this.listeners = [] 23494 }; 23495 23496 function uC(t, e, n, r, i, o, s, a) { 23497 this.query = t, this.docs = e, this.oldDocs = n, this.docChanges = r, this.mutatedKeys = i, this.fromCache = o, this.syncStateChanged = s, this.excludesMetadataChanges = a 23498 } 23499 23500 function cC() { 23501 this.Kr = new xw(Cm.comparator) 23502 } 23503 23504 function hC(n) { 23505 this.comparator = n ? function (t, e) { 23506 return n(t, e) || Cm.comparator(t.key, e.key) 23507 } : function (t, e) { 23508 return Cm.comparator(t.key, e.key) 23509 }, this.keyedMap = Gw, this.sortedSet = new xw(this.comparator) 23510 } 23511 23512 function lC(s, a) { 23513 return $i(this, void 0, void 0, function () { 23514 var e, n, r, i, o; 23515 return Zi(this, function (t) { 23516 switch (t.label) { 23517 case 0: 23518 if (e = s, n = a.query, r = !1, (i = e.queries.get(n)) || (r = !0, i = new aC), !r) return [3, 4]; 23519 t.label = 1; 23520 case 1: 23521 return t.trys.push([1, 3, , 4]), o = i, [4, e.onListen(n)]; 23522 case 2: 23523 return o.Wr = t.sent(), [3, 4]; 23524 case 3: 23525 return o = t.sent(), o = nC(o, "Initialization of query '" + Ub(a.query) + "' failed"), [2, void a.onError(o)]; 23526 case 4: 23527 return e.queries.set(n, i), i.listeners.push(a), a.zr(e.onlineState), i.Wr && a.Hr(i.Wr) && pC(e), [2] 23528 } 23529 }) 23530 }) 23531 } 23532 23533 function fC(s, a) { 23534 return $i(this, void 0, void 0, function () { 23535 var e, n, r, i, o; 23536 return Zi(this, function (t) { 23537 return e = s, n = a.query, r = !1, (i = e.queries.get(n)) && 0 <= (o = i.listeners.indexOf(a)) && (i.listeners.splice(o, 1), r = 0 === i.listeners.length), r ? [2, (e.queries.delete(n), e.onUnlisten(n))] : [2] 23538 }) 23539 }) 23540 } 23541 23542 function pC(t) { 23543 t.Gr.forEach(function (t) { 23544 t.next() 23545 }) 23546 } 23547 var dC = (_C.prototype.Hr = function (t) { 23548 if (!this.options.includeMetadataChanges) { 23549 for (var e = [], n = 0, r = t.docChanges; n < r.length; n++) { 23550 var i = r[n]; 23551 3 !== i.type && e.push(i) 23552 } 23553 t = new sC(t.query, t.docs, t.oldDocs, e, t.mutatedKeys, t.fromCache, t.syncStateChanged, !0) 23554 } 23555 var o = !1; 23556 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 23557 }, _C.prototype.onError = function (t) { 23558 this.Jr.error(t) 23559 }, _C.prototype.zr = function (t) { 23560 this.onlineState = t; 23561 var e = !1; 23562 return this.Xr && !this.Yr && this.eo(this.Xr, t) && (this.no(this.Xr), e = !0), e 23563 }, _C.prototype.eo = function (t, e) { 23564 if (!t.fromCache) return !0; 23565 var n = "Offline" !== e; 23566 return !(this.options.so && n || t.docs.isEmpty() && "Offline" !== e) 23567 }, _C.prototype.Zr = function (t) { 23568 if (0 < t.docChanges.length) return !0; 23569 var e = this.Xr && this.Xr.hasPendingWrites !== t.hasPendingWrites; 23570 return !(!t.syncStateChanged && !e) && !0 === this.options.includeMetadataChanges 23571 }, _C.prototype.no = function (t) { 23572 t = sC.fromInitialDocuments(t.query, t.docs, t.mutatedKeys, t.fromCache), this.Yr = !0, this.Jr.next(t) 23573 }, _C), 23574 vC = (wC.prototype.io = function () { 23575 return "metadata" in this.payload 23576 }, wC), 23577 gC = (bC.prototype.qn = function (t) { 23578 return b_(this.R, t) 23579 }, bC.prototype.Un = function (t) { 23580 return t.metadata.exists ? S_(this.R, t.document, !1) : Bm.newNoDocument(this.qn(t.metadata.name), this.Qn(t.metadata.readTime)) 23581 }, bC.prototype.Qn = v_, bC), 23582 yC = (mC.prototype.oo = function (t) { 23583 this.progress.bytesLoaded += t.byteLength; 23584 var e = this.progress.documentsLoaded; 23585 return t.payload.namedQuery ? this.queries.push(t.payload.namedQuery) : t.payload.documentMetadata ? (this.documents.push({ 23586 metadata: t.payload.documentMetadata 23587 }), 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 23588 }, mC.prototype.co = function (t) { 23589 for (var e = new Map, n = new gC(this.R), r = 0, i = t; r < i.length; r++) { 23590 var o = i[r]; 23591 if (o.metadata.queries) 23592 for (var s = n.qn(o.metadata.name), a = 0, u = o.metadata.queries; a < u.length; a++) { 23593 var c = u[a], 23594 h = (e.get(c) || Yw()).add(s); 23595 e.set(c, h) 23596 } 23597 } 23598 return e 23599 }, mC.prototype.complete = function () { 23600 return $i(this, void 0, void 0, function () { 23601 var e, n, r, i; 23602 return Zi(this, function (t) { 23603 switch (t.label) { 23604 case 0: 23605 return [4, function (l, f, p, d) { 23606 return $i(this, void 0, void 0, function () { 23607 var n, r, i, o, e, s, a, u, c, h; 23608 return Zi(this, function (t) { 23609 switch (t.label) { 23610 case 0: 23611 for (n = l, r = Yw(), i = Kw, o = zw, e = 0, s = p; e < s.length; e++) a = s[e], u = f.qn(a.metadata.name), a.document && (r = r.add(u)), i = i.insert(u, f.Un(a)), o = o.insert(u, f.Qn(a.metadata.readTime)); 23612 return c = n.$n.newChangeBuffer({ 23613 trackRemovals: !0 23614 }), [4, pE(n, xb(Nb(am.fromString("__bundle__/docs/" + d))))]; 23615 case 1: 23616 return h = t.sent(), [2, n.persistence.runTransaction("Apply bundle documents", "readwrite", function (e) { 23617 return fE(e, c, i, Zy.min(), o).next(function (t) { 23618 return c.apply(e), t 23619 }).next(function (t) { 23620 return n.qe.removeMatchingKeysForTargetId(e, h.targetId).next(function () { 23621 return n.qe.addMatchingKeys(e, r, h.targetId) 23622 }).next(function () { 23623 return n.Mn.En(e, t) 23624 }).next(function () { 23625 return t 23626 }) 23627 }) 23628 })] 23629 } 23630 }) 23631 }) 23632 }(this.localStore, new gC(this.R), this.documents, this.ro.id)]; 23633 case 1: 23634 e = t.sent(), n = this.co(this.documents), r = 0, i = this.queries, t.label = 2; 23635 case 2: 23636 return r < i.length ? (i = i[r], [4, function (e, i, o) { 23637 return void 0 === o && (o = Yw()), $i(this, void 0, void 0, function () { 23638 var n, r; 23639 return Zi(this, function (t) { 23640 switch (t.label) { 23641 case 0: 23642 return [4, pE(e, xb(HI(i.bundledQuery)))]; 23643 case 1: 23644 return n = t.sent(), [2, (r = e).persistence.runTransaction("Save named query", "readwrite", function (t) { 23645 var e = v_(i.readTime); 23646 if (0 <= n.snapshotVersion.compareTo(e)) return r.Qe.saveNamedQuery(t, i); 23647 e = n.withResumeToken(lm.EMPTY_BYTE_STRING, e); 23648 return r.Fn = r.Fn.insert(e.targetId, e), r.qe.updateTargetData(t, e).next(function () { 23649 return r.qe.removeMatchingKeysForTargetId(t, n.targetId) 23650 }).next(function () { 23651 return r.qe.addMatchingKeys(t, o, n.targetId) 23652 }).next(function () { 23653 return r.Qe.saveNamedQuery(t, i) 23654 }) 23655 })] 23656 } 23657 }) 23658 }) 23659 }(this.localStore, i, n.get(i.name))]) : [3, 5]; 23660 case 3: 23661 t.sent(), t.label = 4; 23662 case 4: 23663 return r++, [3, 2]; 23664 case 5: 23665 return [2, (this.progress.taskState = "Success", new $T(Object.assign({}, this.progress), e))] 23666 } 23667 }) 23668 }) 23669 }, mC); 23670 23671 function mC(t, e, n) { 23672 this.ro = t, this.localStore = e, this.R = n, this.queries = [], this.documents = [], this.progress = IC(t) 23673 } 23674 23675 function bC(t) { 23676 this.R = t 23677 } 23678 23679 function wC(t, e) { 23680 this.payload = t, this.byteLength = e 23681 } 23682 23683 function _C(t, e, n) { 23684 this.query = t, this.Jr = e, this.Yr = !1, this.Xr = null, this.onlineState = "Unknown", this.options = n || {} 23685 } 23686 23687 function IC(t) { 23688 return { 23689 taskState: "Running", 23690 documentsLoaded: 0, 23691 bytesLoaded: 0, 23692 totalDocuments: t.totalDocuments, 23693 totalBytes: t.totalBytes 23694 } 23695 } 23696 var TC = function (t) { 23697 this.key = t 23698 },
23699 EC = function (t) { 23700 this.key = t 23701 }, 23702 SC = (Object.defineProperty(RC.prototype, "wo", { 23703 get: function () { 23704 return this.uo 23705 }, 23706 enumerable: !1, 23707 configurable: !0 23708 }), RC.prototype._o = function (t, e) { 23709 var s = this, 23710 a = e ? e.mo : new oC, 23711 u = (e || this).fo, 23712 c = (e || this).mutatedKeys, 23713 h = u, 23714 l = !1, 23715 f = Ab(this.query) && u.size === this.query.limit ? u.last() : null, 23716 p = kb(this.query) && u.size === this.query.limit ? u.first() : null; 23717 if (t.inorderTraversal(function (t, e) { 23718 var n = u.get(t), 23719 r = jb(s.query, e) ? e : null, 23720 i = !!n && s.mutatedKeys.has(n.key), 23721 o = !!r && (r.hasLocalMutations || s.mutatedKeys.has(r.key) && r.hasCommittedMutations), 23722 e = !1; 23723 n && r ? n.data.isEqual(r.data) ? i !== o && (a.track({ 23724 type: 3, 23725 doc: r 23726 }), e = !0) : s.yo(n, r) || (a.track({ 23727 type: 2, 23728 doc: r 23729 }), e = !0, (f && 0 < s.lo(r, f) || p && s.lo(r, p) < 0) && (l = !0)) : !n && r ? (a.track({ 23730 type: 0, 23731 doc: r 23732 }), e = !0) : n && !r && (a.track({ 23733 type: 1, 23734 doc: n 23735 }), e = !0, (f || p) && (l = !0)), e && (c = r ? (h = h.add(r), o ? c.add(t) : c.delete(t)) : (h = h.delete(t), c.delete(t))) 23736 }), Ab(this.query) || kb(this.query)) 23737 for (; h.size > this.query.limit;) { 23738 var n = Ab(this.query) ? h.last() : h.first(), 23739 h = h.delete(n.key), 23740 c = c.delete(n.key); 23741 a.track({ 23742 type: 1, 23743 doc: n 23744 }) 23745 } 23746 return { 23747 fo: h, 23748 mo: a, 23749 Nn: l, 23750 mutatedKeys: c 23751 } 23752 }, RC.prototype.yo = function (t, e) { 23753 return t.hasLocalMutations && e.hasCommittedMutations && !e.hasLocalMutations 23754 }, RC.prototype.applyChanges = function (t, e, n) { 23755 var o = this, 23756 r = this.fo; 23757 this.fo = t.fo, this.mutatedKeys = t.mutatedKeys; 23758 var i = t.mo.jr(); 23759 i.sort(function (t, e) { 23760 return r = t.type, i = e.type, n(r) - n(i) || o.lo(t.doc, e.doc); 23761 23762 function n(t) { 23763 switch (t) { 23764 case 0: 23765 return 1; 23766 case 2: 23767 case 3: 23768 return 2; 23769 case 1: 23770 return 0; 23771 default: 23772 return Hy() 23773 } 23774 } 23775 var r, i 23776 }), this.po(n); 23777 var s = e ? this.Eo() : [], 23778 n = 0 === this.ho.size && this.current ? 1 : 0, 23779 e = n !== this.ao; 23780 return this.ao = n, 0 !== i.length || e ? { 23781 snapshot: new sC(this.query, t.fo, r, i, t.mutatedKeys, 0 == n, e, !1), 23782 To: s 23783 } : { 23784 To: s 23785 } 23786 }, RC.prototype.zr = function (t) { 23787 return this.current && "Offline" === t ? (this.current = !1, this.applyChanges({ 23788 fo: this.fo, 23789 mo: new oC, 23790 mutatedKeys: this.mutatedKeys, 23791 Nn: !1 23792 }, !1)) : { 23793 To: [] 23794 } 23795 }, RC.prototype.Io = function (t) { 23796 return !this.uo.has(t) && !!this.fo.has(t) && !this.fo.get(t).hasLocalMutations 23797 }, RC.prototype.po = function (t) { 23798 var e = this; 23799 t && (t.addedDocuments.forEach(function (t) { 23800 return e.uo = e.uo.add(t) 23801 }
23801), t.modifiedDocuments.forEach(function (t) {}), t.removedDocuments.forEach(function (t) { 23802 return e.uo = e.uo.delete(t) 23803 }), this.current = t.current) 23804 }, RC.prototype.Eo = function () { 23805 var e = this; 23806 if (!this.current) return []; 23807 var n = this.ho; 23808 this.ho = Yw(), this.fo.forEach(function (t) { 23809 e.Io(t.key) && (e.ho = e.ho.add(t.key)) 23810 }); 23811 var r = []; 23812 return n.forEach(function (t) { 23813 e.ho.has(t) || r.push(new EC(t)) 23814 }), this.ho.forEach(function (t) { 23815 n.has(t) || r.push(new TC(t)) 23816 }), r 23817 }, RC.prototype.Ao = function (t) { 23818 this.uo = t.Bn, this.ho = Yw(); 23819 t = this._o(t.documents); 23820 return this.applyChanges(t, !0) 23821 }, RC.prototype.Ro = function () { 23822 return sC.fromInitialDocuments(this.query, this.fo, this.mutatedKeys, 0 === this.ao) 23823 }, RC), 23824 CC = function (t, e, n) { 23825 this.query = t, this.targetId = e, this.view = n 23826 }, 23827 NC = function (t) { 23828 this.key = t, this.bo = !1 23829 }, 23830 AC = (Object.defineProperty(kC.prototype, "isPrimaryClient", { 23831 get: function () { 23832 return !0 === this.Oo 23833 }, 23834 enumerable: !1, 23835 configurable: !0 23836 }), kC); 23837 23838 function kC(t, e, n, r, i, o) { 23839 this.localStore = t, this.remoteStore = e, this.eventManager = n, this.sharedClientState = r, this.currentUser = i, this.maxConcurrentLimboResolutions = o, this.vo = {}, this.Po = new DT(Fb, Mb), this.Vo = new Map, this.So = new Set, this.Do = new xw(Cm.comparator), this.Co = new Map, this.No = new IE, this.xo = {}, this.Fo = new Map, this.ko = dT.Yt(), this.onlineState = "Unknown", this.Oo = void 0 23840 } 23841 23842 function RC(t, e) { 23843 this.query = t, this.uo = e, this.ao = null, this.current = !1, this.ho = Yw(), this.mutatedKeys = Yw(), this.lo = qb(t), this.fo = new iC(this.lo) 23844 } 23845 23846 function PC(i, o, s, a) { 23847 return $i(this, void 0, void 0, function () { 23848 var e, n, r; 23849 return Zi(this, function (t) { 23850 switch (t.label) { 23851 case 0: 23852 return i.$o = function (t, e, n) { 23853 return function (r, i, o, s) { 23854 return $i(this, void 0, void 0, function () { 23855 var e, n; 23856 return Zi(this, function (t) { 23857 switch (t.label) { 23858 case 0: 23859 return (e = i.view._o(o)).Nn ? [4, vE(r.localStore, i.query, !1).then(function (t) { 23860 t = t.documents; 23861 return i.view._o(t, e) 23862 })] : [3, 2]; 23863 case 1: 23864 e = t.sent(), t.label = 2; 23865 case 2: 23866 return n = s && s.targetChanges.get(i.targetId), n = i.view.applyChanges(e, r.isPrimaryClient, n), [2, (VC(r, i.targetId, n.To), n.snapshot)] 23867 } 23868 }) 23869 }) 23870 }(i, t, e, n) 23871 }, [4, vE(i.localStore, o, !0)]; 23872 case 1: 23873 return n = t.sent(), r = new SC(o, n.Bn), e = r._o(n.documents), n = $w.createSynthesizedTargetChangeForCurrentChange(s, a && "Offline" !== i.onlineState), n = r.applyChanges(e, i.isPrimaryClient, n), VC(i, s, n.To), r = new CC(o, s, r), [2, (i.Po.set(o, r), i.Vo.has(s) ? i.Vo.get(s).push(o) : i.Vo.set(s, [o]), n.snapshot)] 23874 } 23875 }) 23876 }) 23877 } 23878 23879 function OC(f, p, d) { 23880 return $i(this, void 0, void 0, function () { 23881 var s, l; 23882 return Zi(this, function (t) { 23883 switch (t.label) { 23884 case 0: 23885 l = XC(f), t.label = 1; 23886 case 1: 23887 return t.trys.push([1, 5, , 6]), [4, (i = l.localStore, a = p, c = i, h = $y.now(), o = a.reduce(function (t, e) { 23888 return t.add(e.key) 23889 }, Yw()), c.persistence.runTransaction("Locally write mutations", "readwrite", function (s) { 23890 return c.Mn.pn(s, o).next(function (t) { 23891 u = t; 23892 for (var e = [], n = 0, r = a; n < r.length; n++) { 23893 var i = r[n], 23894 o = function (t, e) { 23895 for (var n = null, r = 0, i = t.fieldTransforms; r < i.length; r++) { 23896 var o = i[r], 23897 s = e.data.field(o.field), 23898 s = Wb(o.transform, s || null); 23899 null != s && (n = null == n ? qm.empty() : n).set(o.field, s) 23900 } 23901 return n || null 23902 }(i, u.get(i.key)); 23903 null != o && e.push(new mw(i.key, o, function s(t) { 23904 var a = []; 23905 return rm(t.fields || {}, function (t, e) { 23906 var n = new cm([t]); 23907 if (jm(e)) 23908 if (0 === (e = s(e.mapValue).fields).length) a.push(n); 23909 else 23910 for (var r = 0, i = e; r < i.length; r++) { 23911 var o = i[r]; 23912 a.push(n.child(o)) 23913 } else a.push(n) 23914 }), new hm(a) 23915 }(o.toProto().mapValue), cw.exists(!0))) 23916 } 23917 return c._n.addMutationBatch(s, h, e, a) 23918 }) 23919 }).then(function (t) { 23920 return t.applyToLocalDocumentSet(u), { 23921 batchId: t.batchId, 23922 changes: u 23923 } 23924 }))]; 23925 case 2:
23926 return s = t.sent(), l.sharedClientState.addPendingMutation(s.batchId), e = l, n = s.batchId, r = d, i = (i = (i = e.xo[e.currentUser.toKey()]) || new xw(Yy)).insert(n, r), e.xo[e.currentUser.toKey()] = i, [4, KC(l, s.changes)]; 23927 case 3: 23928 return t.sent(), [4, QS(l.remoteStore)]; 23929 case 4: 23930 return t.sent(), [3, 6]; 23931 case 5: 23932 return l = t.sent(), l = nC(l, "Failed to persist write"), d.reject(l), [3, 6]; 23933 case 6: 23934 return [2] 23935 } 23936 var e, n, r, i, a, u, c, h, o 23937 }) 23938 }) 23939 } 23940 23941 function DC(r, i) { 23942 return $i(this, void 0, void 0, function () { 23943 var n, e; 23944 return Zi(this, function (t) { 23945 switch (t.label) { 23946 case 0: 23947 n = r, t.label = 1; 23948 case 1: 23949 return t.trys.push([1, 4, , 6]), [4, lE(n.localStore, i)]; 23950 case 2: 23951 return e = t.sent(), i.targetChanges.forEac
23951h(function (t, e) { 23952 e = n.Co.get(e); 23953 e && (Gy(t.addedDocuments.size + t.modifiedDocuments.size + t.removedDocuments.size <= 1), 0 < t.addedDocuments.size ? e.bo = !0 : 0 < t.modifiedDocuments.size ? Gy(e.bo) : 0 < t.removedDocuments.size && (Gy(e.bo), e.bo = !1)) 23954 }), [4, KC(n, e, i)]; 23955 case 3: 23956 return t.sent(), [3, 6]; 23957 case 4: 23958 return [4, _T(t.sent())]; 23959 case 5: 23960 return t.sent(), [3, 6]; 23961 case 6: 23962 return [2] 23963 } 23964 }) 23965 }) 23966 } 23967 23968 function xC(t, n, e) { 23969 var r, t = t; 23970 (t.isPrimaryClient && 0 === e || !t.isPrimaryClient && 1 === e) && (r = [], t.Po.forEach(function (t, e) { 23971 e = e.view.zr(n); 23972 e.snapshot && r.push(e.snapshot) 23973 }), function (t, i) { 23974 t.onlineState = i; 23975 var o = !1; 23976 t.queries.forEach(function (t, e) { 23977 for (var n = 0, r = e.listeners; n < r.length; n++) r[n].zr(i) && (o = !0) 23978 }), o && pC(t) 23979 }(t.eventManager, n), r.length && t.vo._r(r), t.onlineState = n, t.isPrimaryClient && t.sharedClientState.setOnlineState(n)) 23980 } 23981 23982 function LC(s, a, u) { 23983 return $i(this, void 0, void 0, function () { 23984 var n, o; 23985 return Zi(this, function (t) { 23986 switch (t.label) { 23987 case 0: 23988 n = s, t.label = 1; 23989 case 1: 23990 return t.trys.push([1, 4, , 6]), [4, (e = n.localStore, r = a, (i = e).persistence.runTransaction("Reject batch", "readwrite-primary", function (e) { 23991 var n; 23992 return i._n.lookupMutationBatch(e, r).next(function (t) { 23993 return Gy(null !== t), n = t.keys(), i._n.removeMutationBatch(e, t) 23994 }).next(function () { 23995 return i._n.performConsistencyCheck(e) 23996 }).next(function () { 23997 return i.Mn.pn(e, n) 23998 }) 23999 }))]; 24000 case 2: 24001 return o = t.sent(), UC(n, a, u), FC(n, a), n.sharedClientState.updateMutationState(a, "rejected", u), [4, KC(n, o)]; 24002 case 3: 24003 return t.sent(), [3, 6]; 24004 case 4: 24005 return [4, _T(t.sent())]; 24006 case 5: 24007 return t.sent(), [3, 6]; 24008 case 6: 24009 return [2] 24010 } 24011 var e, r, i 24012 }) 24013 }) 24014 } 24015 24016 function MC(o, s) { 24017 return $i(this, void 0, void 0, function () { 24018 var n, r, i; 24019 return Zi(this, function (t) { 24020 switch (t.label) { 24021 case 0: 24022 KS((n = o).remoteStore) || Vy("SyncEngine", "The network is disabled. The task returned by 'awaitPendingWrites()' will not complete until the network is enabled."), t.label = 1; 24023 case 1: 24024 return t.trys.push([1, 3, , 4]), [4, (e = n.localStore).persistence.runTransaction("Get highest unacknowledged batch id", "readonly", function (t) { 24025 return e._n.getHighestUnacknowledgedBatchId(t) 24026 })]; 24027 case 2: 24028 return -1 === (r = t.sent()) ? [2, void s.resolve()] : ((i = n.Fo.get(r) || []).push(s), n.Fo.set(r, i), [3, 4]); 24029 case 3: 24030 return i = t.sent(), i = nC(i, "Initialization of waitForPendingWrites() operation failed"), s.reject(i), [3, 4]; 24031 case 4: 24032 return [2] 24033 } 24034 var e 24035 }) 24036 }) 24037 } 24038 24039 function FC(t, e) { 24040 (t.Fo.get(e) || []).forEach(function (t) { 24041 t.resolve() 24042 }), t.Fo.delete(e) 24043 } 24044 24045 function UC(t, e, n) { 24046 var r = t, 24047 i = r.xo[r.currentUser.toKey()]; 24048 i && ((t = i.get(e)) && (n ? t.reject(n) : t.resolve(), i = i.remove(e)), r.xo[r.currentUser.toKey()] = i) 24049 } 24050 24051 function jC(e, t, n) {
24052 void 0 === n && (n = null), e.sharedClientState.removeLocalQueryTarget(t); 24053 for (var r = 0, i = e.Vo.get(t); r < i.length; r++) { 24054 var o = i[r]; 24055 e.Po.delete(o), n && e.vo.Mo(o, n) 24056 } 24057 e.Vo.delete(t), e.isPrimaryClient && e.No.Zn(t).forEach(function (t) { 24058 e.No.containsKey(t) || qC(e, t) 24059 }) 24060 } 24061 24062 function qC(t, e) { 24063 t.So.delete(e.path.canonicalString()); 24064 var n = t.Do.get(e); 24065 null !== n && (US(t.remoteStore, n), t.Do = t.Do.remove(e), t.Co.delete(n), BC(t)) 24066 } 24067 24068 function VC(t, e, n) { 24069 for (var r, i, o, s = 0, a = n; s < a.length; s++) { 24070 var u = a[s]; 24071 u instanceof TC ? (t.No.addReference(u.key, e), r = t, o = void 0, i = (o = (i = u).key).path.canonicalString(), r.Do.get(o) || r.So.has(i) || (Vy("SyncEngine", "New document in limbo: " + o), r.So.add(i), BC(r))) : u instanceof EC ? (Vy("SyncEngine", "Document no longer in limbo: " + u.key), t.No.removeReference(u.key, e), t.No.containsKey(u.key) || qC(t, u.key)) : Hy() 24072 } 24073 } 24074 24075 function BC(t) { 24076 for (; 0 < t.So.size && t.Do.size < t.maxConcurrentLimboResolutions;) { 24077 var e = t.So.values().next().value; 24078 t.So.delete(e); 24079 var n = new Cm(am.fromString(e)), 24080 e = t.ko.next(); 24081 t.Co.set(e, new NC(n)), t.Do = t.Do.insert(n, e), FS(t.remoteStore, new PI(xb(Nb(n.path)), e, 2, Dy.o)) 24082 } 24083 } 24084 24085 function KC(e, s, a) { 24086 return $i(this, void 0, void 0, function () { 24087 var n, r, i, o; 24088 return Zi(this, function (t) { 24089 switch (t.label) { 24090 case 0: 24091 return r = [], i = [], o = [], (n = e).Po.isEmpty() ? [3, 3] : (n.Po.forEach(function (t, e) { 24092 o.push(n.$o(e, s, a).then(function (t) { 24093 t && (n.isPrimaryClient && n.sharedClientState.updateQueryState(e.targetId, t.fromCache ? "not-current" : "current"), r.push(t), t = tE.Pn(e.targetId, t), i.push(t)) 24094 })) 24095 }), [4, Promise.all(o)]); 24096 case 1: 24097 return t.sent(), n.vo._r(r), [4, function (u, c) { 24098 return $i(this, void 0, void 0, function () { 24099 var r, e, n, i, o, s, a; 24100 return Zi(this, function (t) { 24101 switch (t.label) { 24102 case 0: 24103 r = u, t.label = 1; 24104 case 1: 24105 return t.trys.push([1, 3, , 4]), [4, r.persistence.runTransaction("notifyLocalViewChanges", "readwrite", function (n) { 24106 return uI.forEach(c, function (e) { 24107 return uI.forEach(e.bn, function (t) { 24108 return r.persistence.referenceDelegate.addReference(n, e.targetId, t) 24109 }).next(function () { 24110 return uI.forEach(e.vn, function (t) { 24111 return r.persistence.referenceDelegate.removeReference(n, e.targetId, t) 24112 }) 24113 }) 24114 }) 24115 })]; 24116 case 2: 24117 return t.sent(), [3, 4]; 24118 case 3: 24119 if (!bI(e = t.sent())) throw e; 24120 return Vy("LocalStore", "Failed to update sequence numbers: " + e), [3, 4]; 24121 case 4: 24122 for (n = 0, i = c; n < i.length; n++) a = i[n], o = a.targetId, a.fromCache || (s = r.Fn.get(o), a = s.snapshotVersion, a = s.withLastLimboFreeSnapshotVersion(a), r.Fn = r.Fn.insert(o, a)); 24123 return [2] 24124 } 24125 }) 24126 }) 24127 }(n.localStore, i)]; 24128 case 2: 24129 t.sent(), t.label = 3; 24130 case 3: 24131 return [2] 24132 } 24133 }) 24134 }) 24135 } 24136 24137 function WC(i, o) { 24138 return $i(this, void 0, void 0, function () { 24139 var n, r; 24140 return Zi(this, function (t) { 24141 switch (t.label) { 24142 case 0: 24143 return (n = i).currentUser.isEqual(o) ? [3, 3] : (Vy("SyncEngine", "User change. New user:", o.toKey()), [4, uE(n.localStore, o)]); 24144 case 1: 24145 return r = t.sent(), n.currentUser = o, (e = n).Fo.forEac
24145h(function (t) { 24146 t.forEach(function (t) { 24147 t.reject(new Fy(My.CANCELLED, "'waitForPendingWrites' promise is rejected due to a user change.")) 24148 }) 24149 }), e.Fo.clear(), n.sharedClientState.handleUserChange(o, r.removedBatchIds, r.addedBatchIds), [4, KC(n, r.Ln)]; 24150 case 2: 24151 t.sent(), t.label = 3; 24152 case 3: 24153 return [2] 24154 } 24155 var e 24156 }) 24157 }) 24158 } 24159 24160 function HC(a, u, c, h) { 24161 return $i(this, void 0, void 0, function () { 24162 var o, s; 24163 return Zi(this, function (t) { 24164 switch (t.label) { 24165 case 0: 24166 return [4, (e = (o = a).localStore, n = u, i = (r = e)._n, r.persistence.runTransaction("Lookup mutation documents", "readonly", function (e) { 24167 return i.jt(e, n).next(function (t) { 24168 return t ? r.Mn.pn(e, t) : uI.resolve(null) 24169 }) 24170 }))]; 24171 case 1: 24172 return null === (s = t.sent()) ? [3, 6] : "pending" !== c ? [3, 3] : [4, QS(o.remoteStore)]; 24173 case 2: 24174 return t.sent(), [3, 4]; 24175 case 3: 24176 "acknowledged" === c || "rejected" === c ? (UC(o, u, h || null), FC(o, u), o.localStore._n.Gt(u)) : Hy(), t.label = 4; 24177 case 4: 24178 return [4, KC(o, s)]; 24179 case 5: 24180 return t.sent(), [3, 7]; 24181 case 6: 24182 Vy("SyncEngine", "Cannot apply mutation batch with id: " + u), t.label = 7; 24183 case 7: 24184 return [2] 24185 } 24186 var e, n, r, i 24187 }) 24188 }) 24189 } 24190 24191 function GC(h, l) { 24192 return $i(this, void 0, void 0, function () { 24193 var r, e, i, o, s, a, u, c; 24194 return Zi(this, function (t) { 24195 switch (t.label) { 24196 case 0: 24197 return YC(r = h), XC(r), !0 !== l || !0 === r.Oo ? [3, 3] : (e = r.sharedClientState.getAllActiveQueryTargets(), [4, zC(r, e.toArray())]); 24198 case 1: 24199 return i = t.sent(), r.Oo = !0, [4, JS(r.remoteStore, !0)]; 24200 case 2: 24201 for (t.sent(), o = 0, s = i; o < s.length; o++) a = s[o], FS(r.remoteStore, a); 24202 return [3, 7]; 24203 case 3: 24204 return !1 !== l || !1 === r.Oo ? [3, 7] : (u = [], c = Promise.resolve(), r.Vo.forEach(function (t, e) {
24205 r.sharedClientState.isLocalQueryTarget(e) ? u.push(e) : c = c.then(function () { 24206 return jC(r, e), dE(r.localStore, e, !0) 24207 }), US(r.remoteStore, e) 24208 }), [4, c]); 24209 case 4: 24210 return t.sent(), [4, zC(r, u)]; 24211 case 5: 24212 return t.sent(), (n = r).Co.forEach(function (t, e) { 24213 US(n.remoteStore, e) 24214 }), n.No.ts(), n.Co = new Map, n.Do = new xw(Cm.comparator), r.Oo = !1, [4, JS(r.remoteStore, !1)]; 24215 case 6: 24216 t.sent(), t.label = 7; 24217 case 7: 24218 return [2] 24219 } 24220 var n 24221 }) 24222 }) 24223 } 24224 24225 function zC(p, d) { 24226 return $i(this, void 0, void 0, function () { 24227 var e, n, r, i, o, s, a, u, c, h, l, f; 24228 return Zi(this, function (t) { 24229 switch (t.label) { 24230 case 0: 24231 e = p, n = [], r = [], i = 0, o = d, t.label = 1; 24232 case 1: 24233 return i < o.length ? (s = o[i], a = void 0, (u = e.Vo.get(s)) && 0 !== u.length ? [4, pE(e.localStore, xb(u[0]))] : [3, 7]) : [3, 13]; 24234 case 2: 24235 a = t.sent(), c = 0, h = u, t.label = 3; 24236 case 3: 24237 return c < h.length ? (l = h[c], l = e.Po.get(l), [4, function (r, i) { 24238 return $i(this, void 0, void 0, function () { 24239 var e, n; 24240 return Zi(this, function (t) { 24241 switch (t.label) { 24242 case 0: 24243 return [4, vE((e = r).localStore, i.query, !0)]; 24244 case 1: 24245 return n = t.sent(), n = i.view.Ao(n), [2, (e.isPrimaryClient && VC(e, i.targetId, n.To), n)] 24246 } 24247 }) 24248 }) 24249 }(e, l)]) : [3, 6]; 24250 case 4: 24251 (l = t.sent()).snapshot && r.push(l.snapshot), t.label = 5; 24252 case 5: 24253 return c++, [3, 3]; 24254 case 6: 24255 return [3, 11]; 24256 case 7: 24257 return [4, gE(e.localStore, s)]; 24258 case 8: 24259 return f = t.sent(), [4, pE(e.localStore, f)]; 24260 case 9: 24261 return a = t.sent(), [4, PC(e, QC(f), s, !1)]; 24262 case 10: 24263 t.sent(), t.label = 11; 24264 case 11: 24265 n.push(a), t.label = 12; 24266 case 12: 24267 return i++, [3, 1]; 24268 case 13: 24269 return [2, (e.vo._r(r), n)] 24270 } 24271 }) 24272 }) 24273 } 24274 24275 function QC(t) { 24276 return Cb(t.path, t.collectionGroup, t.orderBy, t.filters, t.limit, "F", t.startAt, t.endAt) 24277 } 24278 24279 function YC(t) { 24280 return t.remoteStore.remoteSyncer.applyRemoteEvent = DC.bind(null, t), t.remoteStore.remoteSyncer.getRemoteKeysForTarget = function (t, e) { 24281 var n = t; 24282 if ((t = n.Co.get(e)) && t.bo) return Yw().add(t.key); 24283 var r = Yw(); 24284 if (!(e = n.Vo.get(e))) return r; 24285 for (var i = 0, o = e; i < o.length; i++) var s = o[i], 24286 s = n.Po.get(s), 24287 r = r.unionWith(s.view.wo); 24288 return r 24289 }.bind(null, t), t.remoteStore.remoteSyncer.rejectListen = function (o, s, a) { 24290 return $i(this, void 0, void 0, function () { 24291 var e, n, r, i; 24292 return Zi(this, function (t) { 24293 switch (t.label) { 24294 case 0:
24295 return (e = o).sharedClientState.updateQueryState(s, "rejected", a), i = e.Co.get(s), (n = i && i.key) ? (r = (r = new xw(Cm.comparator)).insert(n, Bm.newNoDocument(n, Zy.min())), i = Yw().add(n), i = new Jw(Zy.min(), new Map, new Vw(Yy), r, i), [4, DC(e, i)]) : [3, 2]; 24296 case 1: 24297 return t.sent(), e.Do = e.Do.remove(n), e.Co.delete(s), BC(e), [3, 4]; 24298 case 2: 24299 return [4, dE(e.localStore, s, !1).then(function () { 24300 return jC(e, s, a) 24301 }).catch(_T)]; 24302 case 3: 24303 t.sent(), t.label = 4; 24304 case 4: 24305 return [2] 24306 } 24307 }) 24308 }) 24309 }.bind(null, t), t.vo._r = function (t, e) { 24310 for (var n = t, r = !1, i = 0, o = e; i < o.length; i++) { 24311 var s = o[i], 24312 a = s.query, 24313 a = n.queries.get(a); 24314 if (a) { 24315 for (var u = 0, c = a.listeners; u < c.length; u++) c[u].Hr(s) && (r = !0); 24316 a.Wr = s 24317 } 24318 } 24319 r && pC(n) 24320 }.bind(null, t.eventManager), t.vo.Mo = function (t, e, n) { 24321 var r = t; 24322 if (t = r.queries.get(e)) 24323 for (var i = 0, o = t.listeners; i < o.length; i++) o[i].onError(n); 24324 r.queries.delete(e) 24325 }.bind(null, t.eventManager), t 24326 } 24327 24328 function XC(t) { 24329 return t.remoteStore.remoteSyncer.applySuccessfulWrite = function (i, o) { 24330 return $i(this, void 0, void 0, function () { 24331 var e, n, r; 24332 return Zi(this, function (t) { 24333 switch (t.label) { 24334 case 0: 24335 e = i, n = o.batch.batchId, t.label = 1; 24336 case 1: 24337 return t.trys.push([1, 4, , 6]), [4, cE(e.localStore, o)]; 24338 case 2: 24339 return r = t.sent(), UC(e, n, null), FC(e, n), e.sharedClientState.updateMutationState(n, "acknowledged"), [4, KC(e, r)]; 24340 case 3: 24341 return t.sent(), [3, 6]; 24342 case 4: 24343 return [4, _T(t.sent())]; 24344 case 5: 24345 return t.sent(), [3, 6]; 24346 case 6: 24347 return [2] 24348 } 24349 }) 24350 }) 24351 }.bind(null, t), t.remoteStore.remoteSyncer.rejectFailedWrite = LC.bind(null, t), t 24352 } 24353 24354 function JC(t, e, n) { 24355 var r = t; 24356 ! function (f, p, d) { 24357 return $i(this, void 0, void 0, function () { 24358 var a, u, c, h, l; 24359 return Zi(this, function (t) { 24360 switch (t.label) { 24361 case 0: 24362 return t.trys.push([0, 14, , 15]), [4, p.getMetadata()]; 24363 case 1: 24364 return a = t.sent(), [4, (r = f.localStore, o = r, s = v_((i = a).createTime), o.persistence.runTransaction("hasNewerBundle", "readonly", function (t) { 24365 return o.Qe.getBundleMetadata(t, i.id) 24366 }).then(function (t) { 24367 return !!t && 0 <= t.createTime.compareTo(s) 24368 }))]; 24369 case 2: 24370 return t.sent() ? [4, p.close()] : [3, 4]; 24371 case 3: 24372 return [2, (t.sent(), void d._completeWith({ 24373 taskState: "Success", 24374 documentsLoaded: a.totalDocuments, 24375 bytesLoaded: a.totalBytes, 24376 totalDocuments: a.totalDocuments, 24377 totalBytes: a.totalBytes 24378 }))]; 24379 case 4: 24380 return d._updateProgress(IC(a)), u = new yC(a, f.localStore, p.R), [4, p.Lo()]; 24381 case 5: 24382 c = t.sent(), t.label = 6; 24383 case 6: 24384 return c ? [4, u.oo(c)] : [3, 10]; 24385 case 7: 24386 return (h = t.sent()) && d._updateProgress(h), [4, p.Lo()]; 24387 case 8: 24388 c = t.sent(), t.label = 9; 24389 case 9: 24390 return [3, 6]; 24391 case 10: 24392 return [4, u.complete()]; 24393 case 11: 24394 return l = t.sent(), [4, KC(f, l.wn, void 0)]; 24395 case 12: 24396 return t.sent(), [4, (r = f.localStore, e = a, (n = r).persistence.runTransaction("Save bundle", "readwrite", function (t) { 24397 return n.Qe.saveBundleMetadata(t, e) 24398 }))]; 24399 case 13: 24400 return t.sent(), d._completeWith(l.progress), [3, 15]; 24401 case 14: 24402 return Ky("SyncEngine", "Loading bundle failed with " + (l = t.sent())), d._failWith(l), [3, 15]; 24403 case 15: 24404 return [2] 24405 } 24406 var e, n, r, i, o, s 24407 }) 24408 }) 24409 }(r, e, n).then(function () {
24410 r.sharedClientState.notifyBundleLoaded() 24411 }) 24412 } 24413 var $C, ZC, tN = (aN.prototype.initialize = function (e) { 24414 return $i(this, void 0, void 0, function () { 24415 return Zi(this, function (t) { 24416 switch (t.label) { 24417 case 0: 24418 return this.R = bS(e.databaseInfo.databaseId), this.sharedClientState = this.Bo(e), this.persistence = this.qo(e), [4, this.persistence.start()]; 24419 case 1: 24420 return t.sent(), this.gcScheduler = this.Uo(e), this.localStore = this.Qo(e), [2] 24421 } 24422 }) 24423 }) 24424 }, aN.prototype.Uo = function (t) { 24425 return null 24426 }, aN.prototype.Qo = function (t) { 24427 return aE(this.persistence, new eE, t.initialUser, this.R) 24428 }, aN.prototype.qo = function (t) { 24429 return new AE(RE.bs, this.R) 24430 }, aN.prototype.Bo = function (t) { 24431 return new ZE 24432 }, aN.prototype.terminate = function () { 24433 return $i(this, void 0, void 0, function () { 24434 return Zi(this, function (t) { 24435 switch (t.label) { 24436 case 0: 24437 return this.gcScheduler && this.gcScheduler.stop(), [4, this.sharedClientState.shutdown()]; 24438 case 1: 24439 return t.sent(), [4, this.persistence.shutdown()]; 24440 case 2: 24441 return t.sent(), [2] 24442 } 24443 }) 24444 }) 24445 }, aN), 24446 eN = (Xi(sN, ZC = tN), sN.prototype.initialize = function (e) { 24447 return $i(this, void 0, void 0, function () { 24448 return Zi(this, function (t) { 24449 switch (t.label) { 24450 case 0: 24451 return [4, ZC.prototype.initialize.call(this, e)]; 24452 case 1: 24453 return t.sent(), [4, mE(this.localStore)]; 24454 case 2: 24455 return t.sent(), [4, this.Ko.initialize(this, e)]; 24456 case 3: 24457 return t.sent(), [4, XC(this.Ko.syncEngine)]; 24458 case 4: 24459 return t.sent(), [4, QS(this.Ko.remoteStore)]; 24460 case 5: 24461 return t.sent(), [2] 24462 } 24463 }) 24464 }) 24465 }, sN.prototype.Qo = function (t) { 24466 return aE(this.persistence, new eE, t.initialUser, this.R) 24467 }, sN.prototype.Uo = function (t) { 24468 var e = this.persistence.referenceDelegate.garbageCollector; 24469 return new ET(e, t.asyncQueue) 24470 }, sN.prototype.qo = function (t) { 24471 var e = JT(t.databaseInfo.databaseId, t.databaseInfo.persistenceKey), 24472 n = void 0 !== this.cacheSizeBytes ? iT.withCacheSize(this.cacheSizeBytes) : iT.DEFAULT; 24473 return new zT(this.synchronizeTabs, e, t.clientId, n, t.asyncQueue, yS(), mS(), this.R, this.sharedClientState, !!this.forceOwnership) 24474 }, sN.prototype.Bo = function (t) { 24475 return new ZE 24476 }, sN), 24477 nN = (Xi(oN, $C = eN), oN.prototype.initialize = function (r) { 24478 return $i(this, void 0, void 0, function () { 24479 var e, n = this; 24480 return Zi(this, function (t) { 24481 switch (t.label) { 24482 case 0: 24483 return [4, $C.prototype.initialize.call(this, r)]; 24484 case 1: 24485 return t.sent(), e = this.Ko.syncEngine, this.sharedClientState instanceof $E ? (this.sharedClientState.syncEngine = { 24486 ui: HC.bind(null, e), 24487 ai: function (i, o, s, a) { 24488 return $i(this, void 0, void 0, function () { 24489 var e, n, r; 24490 return Zi(this, function (t) { 24491 switch (t.label) { 24492 case 0: 24493 return (e = i).Oo ? (Vy("SyncEngine", "Ignoring unexpected query state notification."), [3, 8]) : [3, 1]; 24494 case 1: 24495 if (!e.Vo.has(o)) return [3, 8]; 24496 switch (s) { 24497 case "current": 24498 case "not-current": 24499 return [3, 2]; 24500 case "rejected": 24501 return [3, 5] 24502 } 24503 return [3, 7]; 24504 case 2: 24505 return [4, yE(e.localStore)]; 24506 case 3: 24507 return n = t.sent(), r = Jw.createSynthesizedRemoteEventForCurrentChange(o, "current" === s), [4, KC(e, n, r)]; 24508 case 4: 24509 return t.sent(), [3, 8]; 24510 case 5: 24511 return [4, dE(e.localStore, o, !0)]; 24512 case 6: 24513 return t.sent(), jC(e, o, a), [3, 8]; 24514 case 7: 24515 Hy(), t.label = 8; 24516 case 8: 24517 return [2] 24518 } 24519 }) 24520 }) 24521 }.bind(null, e), 24522 hi: function (c, h, l) { 24523 return $i(this, void 0, void 0, function () { 24524 var n, e, r, i, o, s, a, u; 24525 return Zi(this, function (t) { 24526 switch (t.label) { 24527 case 0: 24528 if (!(n = YC(c)).Oo) return [3, 10]; 24529 e = 0, r = h, t.label = 1; 24530 case 1: 24531 return e < r.length ? (r = r[e], n.Vo.has(r) ? (Vy("SyncEngine", "Adding an already active target " + r), [3, 5]) : [4, gE(n.localStore, r)]) : [3, 6]; 24532 case 2: 24533 return i = t.sent(), [4, pE(n.localStore, i)]; 24534 case 3: 24535 return o = t.sent(), [4, PC(n, QC(i), o.targetId, !1)]; 24536 case 4: 24537 t.sent(), FS(n.remoteStore, o), t.label = 5; 24538 case 5: 24539 return e++, [3, 1]; 24540 case 6: 24541 s = function (e) { 24542 return Zi(this, function (t) { 24543 switch (t.label) { 24544 case 0: 24545 return n.Vo.has(e) ? [4, dE(n.localStore, e, !1).then(function () { 24546 US(n.remoteStore, e), jC(n, e) 24547 }).catch(_T)] : [3, 2]; 24548 case 1: 24549 t.sent(), t.label = 2; 24550 case 2: 24551 return [2] 24552 } 24553 }) 24554 }, a = 0, u = l, t.label = 7; 24555 case 7: 24556 return a < u.length ? (u = u[a], [5, s(u)]) : [3, 10]; 24557 case 8: 24558 t.sent(), t.label = 9; 24559 case 9: 24560 return a++, [3, 7]; 24561 case 10: 24562 return [2] 24563 } 24564 }) 24565 }) 24566 }.bind(null, e), 24567 fn: function (t) { 24568 return t.localStore.persistence.fn() 24569 }.bind(null, e), 24570 ci: function (n) { 24571 return $i(this, void 0, void 0, function () { 24572 var e; 24573 return Zi(this, function (t) { 24574 return [2, yE((e = n).localStore).then(function (t) { 24575 return KC(e, t) 24576 })] 24577 }) 24578 }) 24579 }.bind(null, e) 24580 }
24580, [4, this.sharedClientState.start()]) : [3, 3]; 24581 case 2: 24582 t.sent(), t.label = 3; 24583 case 3: 24584 return [4, this.persistence.He(function (e) { 24585 return $i(n, void 0, void 0, function () { 24586 return Zi(this, function (t) { 24587 switch (t.label) { 24588 case 0: 24589 return [4, GC(this.Ko.syncEngine, e)]; 24590 case 1: 24591 return t.sent(), this.gcScheduler && (e && !this.gcScheduler.started ? this.gcScheduler.start(this.localStore) : e || this.gcScheduler.stop()), [2] 24592 } 24593 }) 24594 }) 24595 })]; 24596 case 4: 24597 return t.sent(), [2] 24598 } 24599 }) 24600 }) 24601 }, oN.prototype.Bo = function (t) { 24602 var e = yS(); 24603 if (!$E.yt(e)) throw new Fy(My.UNIMPLEMENTED, "IndexedDB persistence is only available on platforms that support LocalStorage."); 24604 var n = JT(t.databaseInfo.databaseId, t.databaseInfo.persistenceKey); 24605 return new $E(e, t.asyncQueue, n, t.clientId, t.initialUser) 24606 }, oN), 24607 rN = (iN.prototype.initialize = function (n, r) { 24608 return $i(this, void 0, void 0, function () { 24609 var e = this; 24610 return Zi(this, function (t) { 24611 switch (t.label) { 24612 case 0: 24613 return this.localStore ? [3, 2] : (this.localStore = n.localStore, this.sharedClientState = n.sharedClientState, this.datastore = this.createDatastore(r), this.remoteStore = this.createRemoteStore(r), this.eventManager = this.createEventManager(r), this.syncEngine = this.createSyncEngine(r, !n.synchronizeTabs), this.sharedClientState.onlineStateHandler = function (t) { 24614 return xC(e.syncEngine, t, 1) 24615 }, this.remoteStore.remoteSyncer.handleCredentialChange = WC.bind(null, this.syncEngine), [4, JS(this.remoteStore, this.syncEngine.isPrimaryClient)]); 24616 case 1: 24617 t.sent(), t.label = 2; 24618 case 2: 24619 return [2] 24620 } 24621 }) 24622 }) 24623 }, iN.prototype.createEventManager = function (t) { 24624 return new rC 24625 }, iN.prototype.createDatastore = function (t) { 24626 var e = bS(t.databaseInfo.databaseId), 24627 n = (n = t.databaseInfo, new iS(n)); 24628 return t = t.credentials, new NS(t, n, e) 24629 }, iN.prototype.createRemoteStore = function (t) { 24630 var e = this, 24631 n = this.localStore, 24632 r = this.datastore, 24633 i = t.asyncQueue, 24634 o = function (t) { 24635 return xC(e.syncEngine, t, 0) 24636 }, 24637 t = new(eS.yt() ? eS : tS); 24638 return new wS(n, r, i, o, t) 24639 }, iN.prototype.createSyncEngine = function (t, e) { 24640 return function (t, e, n, r, i, o, s) { 24641 o = new AC(t, e, n, r, i, o); 24642 return s && (o.Oo = !0), o 24643 }(this.localStore, this.remoteStore, this.eventManager, this.sharedClientState, t.initialUser, t.maxConcurrentLimboResolutions, e) 24644 }, iN.prototype.terminate = function () { 24645 return function (n) { 24646 return $i(this, void 0, void 0, function () { 24647 var e; 24648 return Zi(this, function (t) { 24649 switch (t.label) { 24650 case 0: 24651 return e = n, Vy("RemoteStore", "RemoteStore shutting down."), e.$r.add(5), [4, MS(e)]; 24652 case 1: 24653 return t.sent(), e.Lr.shutdown(), e.Br.set("Unknown"), [2] 24654 } 24655 }) 24656 }) 24657 }(this.remoteStore) 24658 }, iN); 24659 24660 function iN() {} 24661 24662 function oN(t, e) { 24663 var n = this; 24664 return (n = $C.call(this, t, e, !1) || this).Ko = t, n.cacheSizeBytes = e, n.synchronizeTabs = !0, n 24665 } 24666 24667 function sN(t, e, n) { 24668 var r = this; 24669 return (r = ZC.call(this) || this).Ko = t, r.cacheSizeBytes = e, r.forceOwnership = n, r.synchronizeTabs = !1, r 24670 } 24671 24672 function aN() { 24673 this.synchronizeTabs = !1 24674 } 24675 24676 function uN(n, r) { 24677 void 0 === r && (r = 10240); 24678 var i = 0; 24679 return { 24680 read: function () { 24681 return $i(this, void 0, void 0, function () { 24682 var e; 24683 return Zi(this, function (t) { 24684 return i < n.byteLength ? (e = { 24685 value: n.slice(i, i + r), 24686 done: !1 24687 }, [2, (i += r, e)]) : [2, { 24688 done: !0 24689 }] 24690 }) 24691 }) 24692 }, 24693 cancel: function () { 24694 return $i(this, void 0, void 0, function () { 24695 return Zi(this, function (t) { 24696 return [2] 24697 }) 24698 }) 24699 }, 24700 releaseLock: function () {}, 24701 closed: Promise.reject("unimplemented") 24702 } 24703 } 24704 var cN = (mN.prototype.next = function (t) { 24705 this.observer.next && this.jo(this.observer.next, t) 24706 }, mN.prototype.error = function (t) { 24707 this.observer.error ? this.jo(this.observer.error, t) : console.error("Uncaught Error in snapshot listener:", t) 24708 }, mN.prototype.Wo = function () { 24709 this.muted = !0 24710 }, mN.prototype.jo = function (t, e) { 24711 var n = this; 24712 this.muted || setTimeout(function () { 24713 n.muted || t(e) 24714 }, 0) 24715 }, mN), 24716 hN = (yN.prototype.close = function () { 24717 return this.Go.cancel() 24718 }, yN.prototype.getMetadata = function () { 24719 return $i(this, void 0, void 0, function () { 24720 return Zi(this, function (t) { 24721 return [2, this.metadata.promise] 24722 }) 24723 }) 24724 }, yN.prototype.Lo = function () { 24725 return $i(this, void 0, void 0, function () { 24726 return Zi(this, function (t) { 24727 switch (t.label) { 24728 case 0: 24729 return [4, this.getMetadata()]; 24730 case 1: 24731 return [2, (t.sent(), this.Ho())] 24732 } 24733 }) 24734 }) 24735 }, yN.prototype.Ho = function () { 24736 return $i(this, void 0, void 0, function () { 24737 var e, n, r; 24738 return Zi(this, function (t) { 24739 switch (t.label) { 24740 case 0: 24741 return [4, this.Jo()]; 24742 case 1: 24743 return null === (e = t.sent()) ? [2, null] : (r = this.zo.decode(e), n = Number(r), isNaN(n) && this.Yo("length string (" + r + ") is not val
24743id number"), [4, this.Xo(n)]); 24744 case 2: 24745 return r = t.sent(), [2, new vC(JSON.parse(r), e.length + n)] 24746 } 24747 }) 24748 }) 24749 }, yN.prototype.Zo = function () { 24750 return this.buffer.findIndex(function (t) { 24751 return t === "{".charCodeAt(0) 24752 }) 24753 }, yN.prototype.Jo = function () { 24754 return $i(this, void 0, void 0, function () { 24755 var e, n; 24756 return Zi(this, function (t) { 24757 switch (t.label) { 24758 case 0: 24759 return this.Zo() < 0 ? [4, this.tc()] : [3, 3]; 24760 case 1: 24761 if (t.sent()) return [3, 3]; 24762 t.label = 2; 24763 case 2: 24764 return [3, 0]; 24765 case 3: 24766 return 0 === this.buffer.length ? [2, null] : ((e = this.Zo()) < 0 && this.Yo("Reached the end of bundle when a length string is expected."), n = this.buffer.slice(0, e), [2, (this.buffer = this.buffer.slice(e), n)]) 24767 } 24768 }) 24769 }) 24770 }, yN.prototype.Xo = function (n) { 24771 return $i(this, void 0, void 0, function () { 24772 var e; 24773 return Zi(this, function (t) { 24774 switch (t.label) { 24775 case 0: 24776 return this.buffer.length < n ? [4, this.tc()] : [3, 3]; 24777 case 1: 24778 t.sent() && this.Yo("Reached the end of bundle when more is expected."), t.label = 2; 24779 case 2: 24780 return [3, 0]; 24781 case 3: 24782 return e = this.zo.decode(this.buffer.slice(0, n)), [2, (this.buffer = this.buffer.slice(n), e)] 24783 } 24784 }) 24785 }) 24786 }, yN.prototype.Yo = function (t) { 24787 throw this.Go.cancel(), new Error("Invalid bundle format: " + t) 24788 }, yN.prototype.tc = function () { 24789 return $i(this, void 0, void 0, function () { 24790 var e, n; 24791 return Zi(this, function (t) { 24792 switch (t.label) { 24793 case 0: 24794 return [4, this.Go.read()]; 24795 case 1: 24796 return (e = t.sent()).done || ((n = new Uint8Array(this.buffer.length + e.value.length)).set(this.buffer), n.set(e.value, this.buffer.length), this.buffer = n), [2, e.done] 24797 } 24798 }) 24799 }) 24800 }, yN), 24801 lN = (gN.prototype.lookup = function (r) { 24802 return $i(this, void 0, void 0, function () { 24803 var e, n = this; 24804 return Zi(this, function (t) { 24805 switch (t.label) { 24806 case 0: 24807 if (this.ensureCommitNotCalled(), 0 < this.mutations.length) throw new Fy(My.INVALID_ARGUMENT, "Firestore transactions require all reads to be executed before all writes."); 24808 return [4, function (s, a) { 24809 return $i(this, void 0, void 0, function () { 24810 var n, e, r, i, o; 24811 return Zi(this, function (t) { 24812 switch (t.label) { 24813 case 0: 24814 return e = I_((n = s).R) + "/documents", r = { 24815 documents: a.map(function (t) { 24816 return m_(n.R, t) 24817 }) 24818 }, [4, n.Oi("BatchGetDocuments", e, r)]; 24819 case 1: 24820 return r = t.sent(), i = new Map, r.forEach(function (t) { 24821 var e, t = (e = n.R, "found" in (t = t) ? function (t, e) { 24822 Gy(!!e.found), e.found.name, e.found.updateTime; 24823 var n = b_(t, e.found.name), 24824 t = v_(e.found.updateTime), 24825 e = new qm({ 24826 mapValue: { 24827 fields: e.found.fields 24828 } 24829 }); 24830 return Bm.newFoundDocument(n, t, e) 24831 }(e, t) : "missing" in t ? function (t, e) { 24832 Gy(!!e.missing), Gy(!!e.readTime); 24833 t = b_(t, e.missing), e = v_(e.readTime); 24834 return Bm.newNoDocument(t, e) 24835 }(e, t) : Hy()); 24836 i.set(t.key.toString(), t) 24837 }
24837), o = [], [2, (a.forEach(function (t) { 24838 t = i.get(t.toString()); 24839 Gy(!!t), o.push(t) 24840 }), o)] 24841 } 24842 }) 24843 }) 24844 }(this.datastore, r)]; 24845 case 1: 24846 return [2, ((e = t.sent()).forEach(function (t) { 24847 return n.recordVersion(t) 24848 }), e)] 24849 } 24850 }) 24851 }) 24852 }, gN.prototype.set = function (t, e) { 24853 this.write(e.toMutation(t, this.precondition(t))), this.writtenDocs.add(t.toString()) 24854 }, gN.prototype.update = function (t, e) { 24855 try { 24856 this.write(e.toMutation(t, this.preconditionForUpdate(t))) 24857 } catch (t) { 24858 this.lastWriteError = t 24859 } 24860 this.writtenDocs.add(t.toString()) 24861 }, gN.prototype.delete = function (t) { 24862 this.write(new Aw(t, this.precondition(t))), this.writtenDocs.add(t.toString()) 24863 }, gN.prototype.commit = function () { 24864 return $i(this, void 0, void 0, function () { 24865 var e, n = this; 24866 return Zi(this, function (t) { 24867 switch (t.label) { 24868 case 0: 24869 if (this.ensureCommitNotCalled(), this.lastWriteError) throw this.lastWriteError; 24870 return e = this.readVersions, this.mutations.forEach(function (t) { 24871 e.delete(t.key.toString()) 24872 }), e.forEach(function (t, e) { 24873 e = Cm.fromPath(e); 24874 n.mutations.push(new kw(e, n.precondition(e))) 24875 }), [4, function (i, o) { 24876 return $i(this, void 0, void 0, function () { 24877 var e, n, r; 24878 return Zi(this, function (t) { 24879 switch (t.label) { 24880 case 0: 24881 return n = I_((e = i).R) + "/documents", r = { 24882 writes: o.map(function (t) { 24883 return C_(e.R, t) 24884 }) 24885 }, [4, e.Ni("Commit", n, r)]; 24886 case 1: 24887 return t.sent(), [2] 24888 } 24889 }) 24890 }) 24891 }(this.datastore, this.mutations)]; 24892 case 1: 24893 return t.sent(), this.committed = !0, [2] 24894 } 24895 }) 24896 }) 24897 }, gN.prototype.recordVersion = function (t) { 24898 var e; 24899 if (t.isFoundDocument()) e = t.version; 24900 else { 24901 if (!t.isNoDocument()) throw Hy(); 24902 e = Zy.min() 24903 } 24904 var n = this.readVersions.get(t.key.toString()); 24905 if (n) { 24906 if (!e.isEqual(n)) throw new Fy(My.ABORTED, "Document version changed between two reads.") 24907 } else this.readVersions.set(t.key.toString(), e) 24908 }, gN.prototype.precondition = function (t) { 24909 var e = this.readVersions.get(t.toString()); 24910 return !this.writtenDocs.has(t.toString()) && e ? cw.updateTime(e) : cw.none() 24911 }, gN.prototype.preconditionForUpdate = function (t) { 24912 var e = this.readVersions.get(t.toString()); 24913 if (this.writtenDocs.has(t.toString()) || !e) return cw.exists(!0); 24914 if (e.isEqual(Zy.min())) throw new Fy(My.INVALID_ARGUMENT, "Can't update a document that doesn't exist."); 24915 return cw.updateTime(e) 24916 }, gN.prototype.write = function (t) { 24917 this.ensureCommitNotCalled(), this.mutations.push(t) 24918 }, gN.prototype.ensureCommitNotCalled = function () {}, gN), 24919 fN = (vN.prototype.run = function () { 24920 this.nc() 24921 }, vN.prototype.nc = function () { 24922 var t = this; 24923 this.Zi.ji(function () { 24924 return $i(t, void 0, void 0, function () { 24925 var e, n, r = this; 24926 return Zi(this, function (t) { 24927 return e = new lN(this.datastore), (n = this.sc(e)) && n.then(function (t) { 24928 r.asyncQueue.enqueueAndForget(function () { 24929 return e.commit().then(function () { 24930 r.deferred.resolve(t) 24931 }).catch(function (t) { 24932 r.ic(t) 24933 }) 24934 }) 24935 }).catch(function (t) { 24936 r.ic(t) 24937 }), [2] 24938 }) 24939 }) 24940 }) 24941 }, vN.prototype.sc = function (t) { 24942 try { 24943 var e = this.updateFunction(t); 24944 return !Tm(e) && e.catch && e.then ? e : (this.deferred.reject(Error("Transaction callback must return a Promise")), null) 24945 } catch (t) { 24946 return this.deferred.reject(t), null 24947 } 24948 }, vN.prototype.ic = function (t) { 24949 var e = this; 24950 0 < this.ec && this.rc(t) ? (--this.ec, this.asyncQueue.enqueueAndForget(function () { 24951 return e.nc(), Promise.resolve() 24952 })) : this.deferred.reject(t) 24953 }, vN.prototype.rc = function (t) { 24954 if ("FirebaseError" !== t.name) return !1; 24955 t = t.code; 24956 return "aborted" === t || "failed-precondition" === t || !Ow(t) 24957 }, vN), 24958 pN = (dN.prototype.getConfiguration = function () { 24959 return $i(this, void 0, void 0, function () { 24960 return Zi(this, function (t) { 24961 switch (t.label) { 24962 case 0: 24963 return [4, this.receivedInitialUser.promise]; 24964 case 1: 24965 return [2, (t.sent(), { 24966 asyncQueue: this.asyncQueue, 24967 databaseInfo: this.databaseInfo, 24968 clientId: this.clientId, 24969 credentials: this.credentials, 24970 initialUser: this.user, 24971 maxConcurrentLimboResolutions: 100 24972 })] 24973 } 24974 }) 24975 }) 24976 }, dN.prototype.setCredentialChangeListener = function (t) { 24977 var e = this; 24978 this.credentialListener = t, this.receivedInitialUser.promise.then(function () { 24979 return e.credentialListener(e.user) 24980 }) 24981 }, dN.prototype.verifyNotTerminated = function () { 24982 if (this.asyncQueue.isShuttingDown) throw new Fy(My.FAILED_PRECONDITION, "The client has already been terminated.") 24983 }, dN.prototype.terminate = function () { 24984 var t = this; 24985 this.asyncQueue.enterRestrictedMode(); 24986 var n = new aI; 24987 return this.asyncQueue.enqueueAndForgetEvenWhileRestricted(function () { 24988 return $i(t, void 0, void 0, function () { 24989 var e; 24990 return Zi(this, function (t) { 24991 switch (t.label) { 24992 case 0: 24993 return t.trys.push([0, 5, , 6]), this.onlineComponents ? [4, this.onlineComponents.terminate()] : [3, 2]; 24994 case 1: 24995 t.sent(), t.label = 2; 24996 case 2: 24997 return this.offlineComponents ? [4, this.offlineComponents.terminate()] : [3, 4]; 24998 case 3: 24999 t.sent(), t.label = 4; 25000 case 4: 25001 return this.credentials.removeChangeListener(), n.resolve(), [3, 6]; 25002 case 5: 25003 return e = t.sent(), e = nC(e, "Failed to shutdown persistence"), n.reject(e), [3, 6]; 25004 case 6: 25005 return [2] 25006 } 25007 }) 25008 }) 25009 }), n.promise 25010 }, dN); 25011 25012 function dN(t, e, n) { 25013 var r = this; 25014 this.credentials = t, this.asyncQueue = e, this.databaseInfo = n, this.user = PE.UNAUTHENTICATED, this.clientId = zy.u(), this.credentialListener = function () {}, this.receivedInitialUser = new aI, this.credentials.setChangeListener(function (t) { 25015 Vy("FirestoreClient", "Received user=", t.uid), r.user = t, r.credentialListener(t), r.receivedInitialUser.resolve() 25016 }) 25017 } 25018 25019 function vN(t, e, n, r) { 25020 this.asyncQueue = t, this.datastore = e, this.updateFunction = n, this.deferred = r, this.ec = 5, this.Zi = new ES(this.asyncQueue, "transaction_retry") 25021 } 25022 25023 function gN(t) { 25024 this.datastore = t, this.readVersions = new Map, this.mutations = [], this.committed = !1, this.lastWriteError = null, this.writtenDocs = new Set 25025 } 25026 25027 function yN(t, e) { 25028 var n = this; 25029 this.Go = t, this.R = e, this.metadata = new aI, this.buffer = new Uint8Array, this.zo = new TextDecoder("utf-8"), this.Ho().then(function (t) { 25030 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))) 25031 }, function (t) { 25032 return n.metadata.reject(t) 25033 }) 25034 } 25035 25036 function mN(t) { 25037 this.observer = t, this.muted = !1 25038 } 25039 25040 function bN(i, o) { 25041 return $i(this, void 0, void 0, function () { 25042 var e, n, r = this; 25043 return Zi(this, function (t) { 25044 switch (t.label) { 25045 case 0: 25046 return i.asyncQueue.verifyOperationInProgress(), Vy("FirestoreClient", "Initializing OfflineComponentProvider"), [4, i.getConfiguration()]; 25047 case 1: 25048 return e = t.sent(), [4, o.initialize(e)]; 25049 case 2: 25050 return t.sent(), n = e.initialUser, i.setCredentialChangeListener(function (e) { 25051 n.isEqual(e) || (n = e, i.asyncQueue.enqueueRetryable(function () { 25052 return $i(r, void 0, void 0, function () { 25053 return Zi(this, function (t) { 25054 switch (t.label) { 25055 case 0: 25056 return [4, uE(o.localStore, e)]; 25057 case 1: 25058 return t.sent(), [2] 25059 } 25060 }) 25061 }) 25062 })) 25063 }), o.persistence.setDatabaseDeletedListener(function () { 25064 return i.terminate() 25065 }), i.offlineComponents = o, [2] 25066 } 25067 }) 25068 }) 25069 } 25070 25071 function wN(r, i) { 25072 return $i(this, void 0, void 0, function () { 25073 var e, n; 25074 return Zi(this, function (t) { 25075 switch (t.label) { 25076 case 0: 25077 return r.asyncQueue.verifyOperationInProgress(), [4, _N(r)]; 25078 case 1: 25079 return e = t.sent(), Vy("FirestoreClient", "Initializing OnlineComponentProvider"), [4, r.getConfiguration()]; 25080 case 2: 25081 return n = t.sent(), [4, i.initialize(e, n)]; 25082 case 3: 25083 return t.sent(), r.setCredentialChangeListener(function (t) { 25084 return r.asyncQueue.enqueueRetryable(function () { 25085 return function (r, i) { 25086 return $i(this, void 0, void 0, function () { 25087 var e, n; 25088 return Zi(this, function (t) { 25089 switch (t.label) { 25090 case 0: 25091 return (e = r).asyncQueue.verifyOperationInProgress(), Vy("RemoteStore", "RemoteStore received new credentials"), n = KS(e), e.$r.add(3), [4, MS(e)]; 25092 case 1: 25093 return t.sent(), n && e.Br.set("Unknown"), [4, e.remoteSyncer.handleCredentialChange(i)]; 25094 case 2: 25095 return t.sent(), e.$r.delete(3), [4, LS(e)]; 25096 case 3: 25097 return t.sent(), [2] 25098 } 25099 }) 25100 }) 25101 }(i.remoteStore, t) 25102 }) 25103 }), r.onlineComponents = i, [2] 25104 } 25105 }) 25106 }) 25107 } 25108 25109 function _N(e) { 25110 return $i(this, void 0, void 0, function () { 25111 return Zi(this, function (t) { 25112 switch (t.label) { 25113 case 0: 25114 return e.offlineComponents ? [3, 2] : (Vy("FirestoreClient", "Using default OfflineComponentProvider"), [4, bN(e, new tN)]); 25115 case 1: 25116 t.sent(), t.label = 2; 25117 case 2: 25118 return [2, e.offlineComponents] 25119 } 25120 }) 25121 }) 25122 } 25123 25124 function IN(e) { 25125 return $i(this, void 0, void 0, function () { 25126 return Zi(this, function (t) { 25127 switch (t.label) { 25128 case 0: 25129 return e.onlineComponents ? [3, 2] : (Vy("FirestoreClient", "Using default OnlineComponentProvider"), [4, wN(e, new rN)]); 25130 case 1: 25131 t.sent(), t.label = 2; 25132 case 2: 25133 return [2, e.onlineComponents] 25134 } 25135 }) 25136 }) 25137 } 25138 25139 function TN(t) { 25140 return _N(t).then(function (t) { 25141 return t.persistence 25142 }) 25143 } 25144 25145 function EN(t) { 25146 return _N(t).then(function (t) { 25147 return t.localStore 25148 }) 25149 } 25150 25151 function SN(t) { 25152 return IN(t).then(function (t) { 25153 return t.remoteStore 25154 }) 25155 } 25156 25157 function CN(t) { 25158 return IN(t).then(function (t) { 25159 return t.syncEngine 25160 }) 25161 } 25162 25163 function NN(r) { 25164 return $i(this, void 0, void 0, function () { 25165 var e, n; 25166 return Zi(this, function (t) { 25167 switch (t.label) { 25168 case 0: 25169 return [4, IN(r)]; 25170 case 1: 25171 return e = t.sent(), [2, ((n = e.eventManager).onListen = function (s, a) { 25172 return $i(this, void 0, void 0, function () { 25173 var e, n, r, i, o; 25174 return Zi(this, function (t) { 25175 switch (t.label) { 25176 case 0: 25177 return e = YC(s), (o = e.Po.get(a)) ? (n = o.targetId, e.sharedCl
25177ientState.addLocalQueryTarget(n), r = o.view.Ro(), [3, 4]) : [3, 1]; 25178 case 1: 25179 return [4, pE(e.localStore, xb(a))]; 25180 case 2: 25181 return i = t.sent(), o = e.sharedClientState.addLocalQueryTarget(i.targetId), n = i.targetId, [4, PC(e, a, n, "current" === o)]; 25182 case 3: 25183 r = t.sent(), e.isPrimaryClient && FS(e.remoteStore, i), t.label = 4; 25184 case 4: 25185 return [2, r] 25186 } 25187 }) 25188 }) 25189 }.bind(null, e.syncEngine), n.onUnlisten = function (i, o) { 25190 return $i(this, void 0, void 0, function () { 25191 var e, n, r; 25192 return Zi(this, function (t) { 25193 switch (t.label) { 25194 case 0: 25195 return n = (e = i).Po.get(o), 1 < (r = e.Vo.get(n.targetId)).length ? [2, (e.Vo.set(n.targetId, r.filter(function (t) { 25196 return !Mb(t, o) 25197 })), void e.Po.delete(o))] : e.isPrimaryClient ? (e.sharedClientState.removeLocalQueryTarget(n.targetId), e.sharedClientState.isActiveQueryTarget(n.targetId) ? [3, 2] : [4, dE(e.localStore, n.targetId, !1).then(function () { 25198 e.sharedClientState.clearQueryState(n.targetId), US(e.remoteStore, n.targetId), jC(e, n.targetId) 25199 }).catch(_T)]) : [3, 3]; 25200 case 1: 25201 t.sent(), t.label = 2; 25202 case 2: 25203 return [3, 5]; 25204 case 3: 25205 return jC(e, n.targetId), [4, dE(e.localStore, n.targetId, !0)]; 25206 case 4: 25207 t.sent(), t.label = 5; 25208 case 5: 25209 return [2] 25210 } 25211 }) 25212 }) 25213 }.bind(null, e.syncEngine), n)] 25214 } 25215 }) 25216 }) 25217 } 25218 25219 function AN(n, r, i) { 25220 var t = this; 25221 void 0 === i && (i = {}); 25222 var o = new aI; 25223 return n.asyncQueue.enqueueAndForget(function () { 25224 return $i(t, void 0, void 0, function () { 25225 var e; 25226 return Zi(this, function (t) { 25227 switch (t.label) { 25228 case 0: 25229 return e = function (n, r, i, o, s) { 25230 var t = new cN({ 25231 next: function (t) { 25232 r.enqueueAndForget(function () { 25233 return fC(n, a) 25234 }); 25235 var e = t.docs.has(i); 25236 !e && t.fromCache ? s.reject(new Fy(My.UNAVAILABLE, "Failed to get document because the client is offline.")) : e && t.fromCache && o && "server" === o.source ? s.reject(new Fy(My.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.)')) : s.resolve(t) 25237 }, 25238 error: function (t) { 25239 return s.reject(t) 25240 } 25241 }), 25242 a = new dC(Nb(i.path), t, { 25243 includeMetadataChanges: !0, 25244 so: !0 25245 }); 25246 return lC(n, a) 25247 }, [4, NN(n)]; 25248 case 1: 25249 return [2, e.apply(void 0, [t.sent(), n.asyncQueue, r, i, o])] 25250 } 25251 }) 25252 }) 25253 }), o.promise 25254 } 25255 25256 function kN(n, r, i) { 25257 var t = this; 25258 void 0 === i && (i = {}); 25259 var o = new aI; 25260 return n.asyncQueue.enqueueAndForget(function () { 25261 return $i(t, void 0, void 0, function () { 25262 var e; 25263 return Zi(this, function (t) { 25264 switch (t.label) { 25265 case 0: 25266 return e = function (e, n, t, r, i) { 25267 var o = new cN({ 25268 next: function (t) { 25269 n.enqueueAndForget(function () { 25270 return fC(e, s) 25271 }), t.fromCache && "server" === r.source ? i.reject(new Fy(My.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(t) 25272 }, 25273 error: function (t) { 25274 return i.reject(t) 25275 } 25276 }), 25277 s = new dC(t, o, { 25278 includeMetadataChanges: !0, 25279 so: !0 25280 }); 25281 return lC(e, s) 25282 }, [4, NN(n)]; 25283 case 1: 25284 return [2, e.apply(void 0, [t.sent(), n.asyncQueue, r, i, o])] 25285 } 25286 }) 25287 }) 25288 }), o.promise 25289 } 25290 25291 function RN(t, e) { 25292 this.user = e, this.type = "OAuth", this.authHeaders = {}, this.authHeaders.Authorization = "Bearer " + t 25293 } 25294 var PN = function (t, e, n, r, i, o, s) { 25295 this.databaseId = t, this.appId = e, this.persistenceKey = n, this.host = r, this.ssl = i, this.forceLongPolling = o, this.autoDetectLongPolling = s 25296 }, 25297 ON = (Object.defineProperty(BN.prototype, "isDefaultDatabase", { 25298 get: function () { 25299 return "(default)" === this.database 25300 }, 25301 enumerable: !1, 25302 configurable: !0 25303 }), BN.prototype.isEqual = function (t) { 25304 return t instanceof BN && t.projectId === this.projectId && t.database === this.database 25305 }, BN), 25306 DN = new Map, 25307 xN = (VN.prototype.getToken = function () { 25308 return Promise.resolve(null) 25309 }, VN.prototype.invalidateToken = function () {}, VN.prototype.setChangeListener = function (t) { 25310 (this.changeListener = t)(PE.UNAUTHENTICATED) 25311 }, VN.prototype.removeChangeListener = function () { 25312 this.changeListener = null 25313 }, VN), 25314 LN = (qN.prototype.getToken = function () { 25315 var e = this, 25316 n = this.cc, 25317 t = this.forceRefresh; 25318 return this.forceRefresh = !1, this.auth ? this.auth.getToken(t).then(function (t) { 25319 return e.cc !== n ? (Vy("FirebaseCredentialsProvider", "getToken aborted due to token change."), e.getToken()) : t ? (Gy("string" == typeof t.accessToken), new RN(t.accessToken, e.currentUser)) : null 25320 }) : Promise.resolve(null) 25321 }, qN.prototype.invalidateToken = function () { 25322 this.forceRefresh = !0 25323 }, qN.prototype.setChangeListener = function (t) { 25324 this.changeListener = t, this.receivedInitialUser && t(this.currentUser) 25325 }, qN.prototype.removeChangeListener = function () { 25326 this.auth && this.auth.removeAuthTokenListener(this.oc), this.oc = null, this.changeListener = null 25327 }, qN.prototype.uc = function () { 25328 var t = this.auth && this.auth.getUid(); 25329 return Gy(null === t || "string" == typeof t), new PE(t) 25330 }, qN), 25331 MN = (Object.defineProperty(jN.prototype, "authHeaders", { 25332 get: function () { 25333 var t = { 25334 "X-Goog-AuthUser": this.hc 25335 }, 25336 e = this.ac.auth.getAuthHeaderValueForFirstParty([]); 25337 return e && (t.Authorization = e), t 25338 }, 25339 enumerable: !1, 25340 configurable: !0 25341 }), jN), 25342 FN = (UN.prototype.getToken = function () { 25343 return Promise.resolve(new MN(this.ac, this.hc)) 25344 }, UN.prototype.setChangeListener = function (t) { 25345 t(PE.FIRST_PARTY) 25346 }, UN.prototype.removeChangeListener = function () {}, UN.prototype.invalidateToken = function () {}, UN); 25347 25348 function UN(t, e) { 25349 this.ac = t, this.hc = e 25350 } 25351 25352 function jN(t, e) { 25353 this.ac = t, this.hc = e, this.type = "FirstParty", this.user = PE.FIRST_PARTY 25354 } 25355 25356 function qN(t) { 25357 var e = this; 25358 this.oc = null, this.currentUser = PE.UNAUTHENTICATED, this.receivedInitialUser = !1, this.cc = 0, this.changeListener = null, this.forceRefresh = !1, this.oc = function () { 25359 e.cc++, e.currentUser = e.uc(), e.receivedInitialUser = !0, e.changeListener && e.changeListener(e.currentUser) 25360 }, this.cc = 0, this.auth = t.getImmediate({ 25361 optional: !0 25362 }), this.auth ? this.auth.addAuthTokenListener(this.oc) : (this.oc(null), t.get().then(function (t) { 25363 e.auth = t, e.oc && e.auth.addAuthTokenListener(e.oc) 25364 }, function () {})) 25365 } 25366 25367 function VN() { 25368 this.changeListener = null 25369 } 25370 25371 function BN(t, e) { 25372 this.projectId = t, this.database = e || "(default)" 25373 } 25374 25375 function KN(t, e, n) { 25376 if (!n) throw new Fy(My.INVALID_ARGUMENT, "Function " + t + "() cannot be called with an empty " + e + ".") 25377 } 25378 25379 function WN(t, e) { 25380 if (void 0 === e) return { 25381 merge: !1 25382 }; 25383 if (void 0 !== e.mergeFields && void 0 !== e.merge) throw new Fy(My.INVALID_ARGUMENT, "Invalid options passed to function " + t + '(): You cannot specify both "merge" and "mergeFields".'); 25384 return e 25385 } 25386 25387 function HN(t, e, n, r) { 25388 if (!0 === e && !0 === r) throw new Fy(My.INVALID_ARGUMENT, t + " and " + n + " cannot be used together.") 25389 } 25390 25391 function GN(t) { 25392 if (!Cm.isDocumentKey(t)) throw new Fy(My.INVALID_ARGUMENT, "Invalid document reference. Document references must have an even number of segments, but " + t + " has " + t.length + ".") 25393 } 25394 25395 function zN(t) { 25396 if (Cm.isDocumentKey(t)) throw new Fy(My.INVALID_ARGUMENT, "Invalid collection reference. Collection references must have an odd number of segments, but " + t + " has " + t.length + ".") 25397 } 25398 25399 function QN(e) { 25400 if (void 0 === e) return "undefined"; 25401 if (null === e) return "null"; 25402 if ("string" == typeof e) return 20 < e.length && (e = e.substring(0, 20) + "..."), JSON.stringify(e); 25403 if ("number" == typeof e || "boolean" == typeof e) return "" + e; 25404 if ("object" != typeof e) return "function" == typeof e ? "a function" : Hy(); 25405 if (e instanceof Array) return "an array"; 25406 var t = function () { 25407 if (e.constructor) { 25408 var t = /function\s+([^\s(]+)\s*\(/.exec(e.constructor.toString()); 25409 if (t && 1 < t.length) return t[1] 25410 } 25411 return null 25412 }(); 25413 return t ? "a custom " + t + " object" : "an object" 25414 } 25415 25416 function YN(t, e) { 25417 if ((t = "_delegate" in t ? t._delegate : t) instanceof e) return t; 25418 if (e.name === t.constructor.name) throw new Fy(My.INVALID_ARGUMENT, "Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?"); 25419 t = QN(t); 25420 throw new Fy(My.INVALID_ARGUMENT, "Expected type '" + e.name + "', but it was: " + t) 25421 } 25422 25423 function XN(t, e) { 25424 if (e <= 0) throw new Fy(My.INVALID_ARGUMENT, "Function " + t + "() requires a positive number, but it was: " + e + ".") 25425 } 25426 var JN, $N = (aA.prototype.isEqual = function (t) { 25427 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 25428 }, aA), 25429 ZN = (Object.defineProperty(sA.prototype, "app", { 25430 get: function () { 25431 if (!this._app) throw new Fy(My.FAILED_PRECONDITION, "Firestore was not initialized using the Firebase SDK. 'app' is not available"); 25432 return this._app 25433 }, 25434 enumerable: !1, 25435 configurable: !0 25436 }), Object.defineProperty(sA.prototype, "_initialized", { 25437 get: function () { 25438 return this._settingsFrozen 25439 }, 25440 enumerable: !1, 25441 configurable: !0 25442 }), Object.defineProperty(sA.prototype, "_terminated", { 25443 get: function () { 25444 return void 0 !== this._terminateTask 25445 }, 25446 enumerable: !1, 25447 configurable: !0 25448 }), sA.prototype._setSettings = function (t) { 25449 if (this._settingsFrozen) throw new Fy(My.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."); 25450 this._settings = new $N(t), void 0 !== t.credentials && (this._credentials = function (t) { 25451 if (!t) return new xN; 25452 switch (t.type) {
25453 case "gapi": 25454 var e = t.client; 25455 return Gy(!("object" != typeof e || null === e || !e.auth || !e.auth.getAuthHeaderValueForFirstParty)), new FN(e, t.sessionIndex || "0"); 25456 case "provider": 25457 return t.client; 25458 default: 25459 throw new Fy(My.INVALID_ARGUMENT, "makeCredentialsProvider failed due to invalid credential type") 25460 } 25461 }(t.credentials)) 25462 }, sA.prototype._getSettings = function () { 25463 return this._settings 25464 }, sA.prototype._freezeSettings = function () { 25465 return this._settingsFrozen = !0, this._settings 25466 }, sA.prototype._delete = function () { 25467 return this._terminateTask || (this._terminateTask = this._terminate()), this._terminateTask 25468 }, sA.prototype.toJSON = function () { 25469 return { 25470 app: this._app, 25471 databaseId: this._databaseId, 25472 settings: this._settings 25473 } 25474 }, sA.prototype._terminate = function () { 25475 return (t = DN.get(this)) && (Vy("ComponentProvider", "Removing Datastore"), DN.delete(this), t.terminate()), Promise.resolve(); 25476 var t 25477 }, sA), 25478 tA = (Object.defineProperty(oA.prototype, "_path", { 25479 get: function () { 25480 return this._key.path 25481 }, 25482 enumerable: !1, 25483 configurable: !0 25484 }), Object.defineProperty(oA.prototype, "id", { 25485 get: function () { 25486 return this._key.path.lastSegment() 25487 }, 25488 enumerable: !1, 25489 configurable: !0 25490 }), Object.defineProperty(oA.prototype, "path", { 25491 get: function () { 25492 return this._key.path.canonicalString() 25493 }, 25494 enumerable: !1, 25495 configurable: !0 25496 }), Object.defineProperty(oA.prototype, "parent", { 25497 get: function () { 25498 return new nA(this.firestore, this._converter, this._key.path.popLast()) 25499 }, 25500 enumerable: !1, 25501 configurable: !0 25502 }), oA.prototype.withConverter = function (t) { 25503 return new oA(this.firestore, t, this._key) 25504 }, oA), 25505 eA = (iA.prototype.withConverter = function (t) { 25506 return new iA(this.firestore, t, this._query) 25507 }, iA), 25508 nA = (Xi(rA, JN = eA), Object.defineProperty(rA.prototype, "id", { 25509 get: function () { 25510 return this._query.path.lastSegment() 25511 }, 25512 enumerable: !1, 25513 configurable: !0 25514 }), Object.defineProperty(rA.prototype, "path", { 25515 get: function () { 25516 return this._query.path.canonicalString() 25517 }, 25518 enumerable: !1, 25519 configurable: !0 25520 }), Object.defineProperty(rA.prototype, "parent", { 25521 get: function () { 25522 var t = this._path.popLast(); 25523 return t.isEmpty() ? null : new tA(this.firestore, null, new Cm(t)) 25524 }, 25525 enumerable: !1, 25526 configurable: !0 25527 }), rA.prototype.withConverter = function (t) { 25528 return new rA(this.firestore, t, this._path) 25529 }, rA); 25530 25531 function rA(t, e, n) { 25532 var r = this; 25533 return (r = JN.call(this, t, e, Nb(n)) || this).firestore = t, r._path = n, r.type = "collection", r 25534 } 25535 25536 function iA(t, e, n) { 25537 this._converter = e, this._query = n, this.type = "query", this.firestore = t 25538 } 25539 25540 function oA(t, e, n) { 25541 this._converter = e, this._key = n, this.type = "document", this.firestore = t 25542 } 25543 25544 function sA(t, e) { 25545 this._persistenceKey = "(lite)", this._settings = new $N({}), this._settingsFrozen = !1, t instanceof ON ? (this._databaseId = t, this._credentials = new xN) : (this._app = t, this._databaseId = function (t) { 25546 if (!Object.prototype.hasOwnProperty.apply(t.options, ["projectId"])) throw new Fy(My.INVALID_ARGUMENT, '"projectId" not provided in firebase.initializeApp.'); 25547 return new ON(t.options.projectId) 25548 }(t), this._credentials = new LN(e)) 25549 } 25550 25551 function aA(t) { 25552 var e; 25553 if (void 0 === t.host) { 25554 if (void 0 !== t.ssl) throw new Fy(My.INVALID_ARGUMENT, "Can't provide ssl option if host option is not set"); 25555 this.host = "firestore.googleapis.com", this.ssl = !0 25556 } else this.host = t.host, this.ssl = null === (e = t.ssl) || void 0 === e || e; 25557 if (this.credentials = t.credentials, this.ignoreUndefinedProperties = !!t.ignoreUndefinedProperties, void 0 === t.cacheSizeBytes) this.cacheSizeBytes = 41943040; 25558 else {
25559 if (-1 !== t.cacheSizeBytes && t.cacheSizeBytes < 1048576) throw new Fy(My.INVALID_ARGUMENT, "cacheSizeBytes must be at least 1048576"); 25560 this.cacheSizeBytes = t.cacheSizeBytes 25561 } 25562 this.experimentalForceLongPolling = !!t.experimentalForceLongPolling, this.experimentalAutoDetectLongPolling = !!t.experimentalAutoDetectLongPolling, HN("experimentalForceLongPolling", t.experimentalForceLongPolling, "experimentalAutoDetectLongPolling", t.experimentalAutoDetectLongPolling) 25563 } 25564 25565 function uA(t, e) { 25566 for (var n, r = [], i = 2; i < arguments.length; i++) r[i - 2] = arguments[i]; 25567 if (t = Zo(t), KN("collection", "path", e), t instanceof ZN) return zN(n = am.fromString.apply(am, no([e], r))), new nA(t, null, n); 25568 if (!(t instanceof tA || t instanceof nA)) throw new Fy(My.INVALID_ARGUMENT, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore"); 25569 return zN(n = am.fromString.apply(am, no([t.path], r)).child(am.fromString(e))), new nA(t.firestore, null, n) 25570 } 25571 25572 function cA(t, e) { 25573 for (var n, r = [], i = 2; i < arguments.length; i++) r[i - 2] = arguments[i]; 25574 if (t = Zo(t), KN("doc", "path", e = 1 === arguments.length ? zy.u() : e), t instanceof ZN) return GN(n = am.fromString.apply(am, no([e], r))), new tA(t, null, new Cm(n)); 25575 if (!(t instanceof tA || t instanceof nA)) throw new Fy(My.INVALID_ARGUMENT, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore"); 25576 return GN(n = t._path.child(am.fromString.apply(am, no([e], r)))), new tA(t.firestore, t instanceof nA ? t._converter : null, new Cm(n)) 25577 } 25578 25579 function hA(t, e) { 25580 return t = Zo(t), e = Zo(e), (t instanceof tA || t instanceof nA) && (e instanceof tA || e instanceof nA) && t.firestore === e.firestore && t.path === e.path && t._converter === e._converter 25581 } 25582 25583 function lA(t, e) { 25584 return t = Zo(t), e = Zo(e), t instanceof eA && e instanceof eA && t.firestore === e.firestore && Mb(t._query, e._query) && t._converter === e._converter 25585 } 25586 var fA = (Object.defineProperty(pA.prototype, "isShuttingDown", { 25587 get: function () { 25588 return this.dc 25589 }, 25590 enumerable: !1, 25591 configurable: !0 25592 }), pA.prototype.enqueueAndForget = function (t) { 25593 this.enqueue(t) 25594 }, pA.prototype.enqueueAndForgetEvenWhileRestricted = function (t) { 25595 this.Ec(), this.Tc(t) 25596 }, pA.prototype.enterRestrictedMode = function () { 25597 var t; 25598 this.dc || (this.dc = !0, (t = mS()) && "function" == typeof t.removeEventListener && t.removeEventListener("visibilitychange", this.gc)) 25599 }, pA.prototype.enqueue = function (t) { 25600 return this.Ec(), this.dc ? new Promise(function (t) {}) : this.Tc(t) 25601 }, pA.prototype.enqueueRetryable = function (t) { 25602 var e = this; 25603 this.enqueueAndForget(function () { 25604 return e.fc.push(t), e.Ic() 25605 }) 25606 }, pA.prototype.Ic = function () { 25607 return $i(this, void 0, void 0, function () { 25608 var e, n = this; 25609 return Zi(this, function (t) { 25610 switch (t.label) { 25611 case 0: 25612 if (0 === this.fc.length) return [3, 5]; 25613 t.label = 1; 25614 case 1: 25615 return t.trys.push([1, 3, , 4]), [4, this.fc[0]()]; 25616 case 2: 25617 return t.sent(), this.fc.shift(), this.Zi.reset(), [3, 4]; 25618 case 3: 25619 if (!bI(e = t.sent())) throw e; 25620 return Vy("AsyncQueue", "Operation failed with retryable error: " + e), [3, 4]; 25621 case 4: 25622 0 < this.fc.length && this.Zi.ji(function () { 25623 return n.Ic() 25624 }), t.label = 5; 25625 case 5: 25626 return [2] 25627 } 25628 }) 25629 }) 25630 }, pA.prototype.Tc = function (t) { 25631 var r = this, 25632 e = this.lc.then(function () { 25633 return r.mc = !0, t().catch(function (t) { 25634 throw r._c = t, r.mc = !1, By("INTERNAL UNHANDLED ERROR: ", (n = (e = t).message || "", n = e.stack ? e.stack.includes(e.message) ? e.stack : e.message + "\n" + e.stack : n)), t; 25635 var e, n 25636 }).then(function (t) { 25637 return r.mc = !1, t 25638 }) 25639 }); 25640 return this.lc = e 25641 }, pA.prototype.enqueueAfterDelay = function (t, e, n) { 25642 var r = this; 25643 this.Ec(), -1 < this.yc.indexOf(t) && (e = 0); 25644 n = tC.createAndSchedule(this, t, e, n, function (t) { 25645 return r.Ac(t) 25646 }); 25647 return this.wc.push(n), n 25648 }, pA.prototype.Ec = function () { 25649 this._c && Hy() 25650 }, pA.prototype.verifyOperationInProgress = function () {}, pA.prototype.Rc = function () { 25651 return $i(this, void 0, void 0, function () { 25652 var e; 25653 return Zi(this, function (t) { 25654 switch (t.label) { 25655 case 0: 25656 return [4, e = this.lc]; 25657 case 1: 25658 t.sent(), t.label = 2; 25659 case 2: 25660 if (e !== this.lc) return [3, 0]; 25661 t.label = 3; 25662 case 3: 25663 return [2] 25664 } 25665 }) 25666 }) 25667 }, pA.prototype.bc = function (t) { 25668 for (var e = 0, n = this.wc; e < n.length; e++) 25669 if (n[e].timerId === t) return !0; 25670 return !1 25671 }, pA.prototype.vc = function (r) { 25672 var i = this; 25673 return this.Rc().then(function () { 25674 i.wc.sort(function (t, e) { 25675 return t.targetTimeMs - e.targetTimeMs 25676 }); 25677 for (var t = 0, e = i.wc; t < e.length; t++) { 25678 var n = e[t]; 25679 if (n.skipDelay(), "all" !== r && n.timerId === r) break 25680 } 25681 return i.Rc() 25682 }) 25683 }, pA.prototype.Pc = function (t) { 25684 this.yc.push(t) 25685 }, pA.prototype.Ac = function (t) { 25686 t = this.wc.indexOf(t); 25687 this.wc.splice(t, 1) 25688 }, pA); 25689 25690 function pA() { 25691 var e = this; 25692 this.lc = Promise.resolve(), this.fc = [], this.dc = !1, this.wc = [], this._c = null, this.mc = !1, this.yc = [], this.Zi = new ES(this, "async_queue_retry"), this.gc = function () { 25693 var t = mS(); 25694 t && Vy("AsyncQueue", "Visibility state changed to " + t.visibilityState), e.Zi.Gi() 25695 }; 25696 var t = mS(); 25697 t && "function" == typeof t.addEventListener && t.addEventListener("visibilitychange", this.gc) 25698 } 25699 25700 function dA(i) { 25701 return function () { 25702 if ("object" == typeof i && null !== i) 25703 for (var t = i, e = 0, n = ["next", "error", "complete"]; e < n.length; e++) { 25704 var r = n[e]; 25705 if (r in t && "function" == typeof t[r]) return 1 25706 } 25707 }() 25708 } 25709 var vA, gA = (bA.prototype.onProgress = function (t, e, n) { 25710 this._progressObserver = { 25711 next: t, 25712 error: e, 25713 complete: n 25714 } 25715 }, bA.prototype.catch = function (t) { 25716 return this._taskCompletionResolver.promise.catch(t) 25717 }, bA.prototype.then = function (t, e) { 25718 return this._taskCompletionResolver.promise.then(t, e) 25719 }, bA.prototype._completeWith = function (t) { 25720 this._updateProgress(t), this._progressObserver.complete && this._progressObserver.complete(), this._taskCompletionResolver.resolve(t) 25721 }, bA.prototype._failWith = function (t) { 25722 this._lastProgress.taskState = "Error", this._progressObserver.next && this._progressObserver.next(this._lastProgress), this._progressObserver.error && this._progressObserver.error(t), this._taskCompletionResolver.reject(t) 25723 }, bA.prototype._updateProgress = function (t) { 25724 this._lastProgress = t, this._progressObserver.next && this._progressObserver.next(t) 25725 }, bA), 25726 yA = (Xi(mA, vA = ZN), mA.prototype._terminate = function () { 25727 return this._firestoreClient || _A(this), this._firestoreClient.terminate() 25728 }, mA); 25729 25730 function mA(t, e) { 25731 var n = this; 25732 return (n = vA.call(this, t, e) || this)._queue = new fA, n._persistenceKey = "name" in t ? t.name : "[DEFAULT]", n 25733 } 25734 25735 function bA() { 25736 this._progressObserver = {}, this._taskCompletionResolver = new aI, this._lastProgress = { 25737 taskState: "Running", 25738 totalBytes: 0, 25739 totalDocuments: 0, 25740 bytesLoaded: 0, 25741 documentsLoaded: 0 25742 } 25743 } 25744 25745 function wA(t) { 25746 return t._firestoreClient || _A(t), t._firestoreClient.verifyNotTerminated(), t._firestoreClient 25747 } 25748 25749 function _A(t) { 25750 var e, n, r, i = t._freezeSettings(), 25751 i = (e = t._databaseId, n = (null === (r = t._app) || void 0 === r ? void 0 : r.options.appId) || "", r = t._persistenceKey, new PN(e, n, r, i.host, i.ssl, i.experimentalForceLongPolling, i.experimentalAutoDetectLongPolling)); 25752 t._firestoreClient = new pN(t._credentials, t._queue, i) 25753 } 25754 25755 function IA(r, i, o) { 25756 var t = this, 25757 s = new aI; 25758 return r.asyncQueue.enqueue(function () { 25759 return $i(t, void 0, void 0, function () { 25760 var n; 25761 return Zi(this, function (t) { 25762 switch (t.label) { 25763 case 0: 25764 return t.trys.push([0, 3, , 4]), [4, bN(r, o)]; 25765 case 1: 25766 return t.sent(), [4, wN(r, i)]; 25767 case 2: 25768 return t.sent(), s.resolve(), [3, 4]; 25769 case 3: 25770 if (!("FirebaseError" === (e = n = t.sent()).name ? e.code === My.FAILED_PRECONDITION || e.code === My.UNIMPLEMENT
25770ED : !("undefined" != typeof DOMException && e instanceof DOMException) || 22 === e.code || 20 === e.code || 11 === e.code)) throw n; 25771 return console.warn("Error enabling offline persistence. Falling back to persistence disabled: " + n), s.reject(n), [3, 4]; 25772 case 4: 25773 return [2] 25774 } 25775 var e 25776 }) 25777 }) 25778 }).then(function () { 25779 return s.promise 25780 }) 25781 } 25782 25783 function TA(t) { 25784 if (t._initialized || t._terminated) throw new Fy(My.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.") 25785 } 25786 var EA = (LA.prototype.isEqual = function (t) { 25787 return this._internalPath.isEqual(t._internalPath) 25788 }, LA), 25789 SA = (xA.fromBase64String = function (t) { 25790 try { 25791 return new xA(lm.fromBase64String(t)) 25792 } catch (t) { 25793 throw new Fy(My.INVALID_ARGUMENT, "Failed to construct data from Base64 string: " + t) 25794 } 25795 }, xA.fromUint8Array = function (t) { 25796 return new xA(lm.fromUint8Array(t)) 25797 }, xA.prototype.toBase64 = function () { 25798 return this._byteString.toBase64() 25799 }, xA.prototype.toUint8Array = function () { 25800 return this._byteString.toUint8Array() 25801 }, xA.prototype.toString = function () { 25802 return "Bytes(base64: " + this.toBase64() + ")" 25803 }, xA.prototype.isEqual = function (t) { 25804 return this._byteString.isEqual(t._byteString) 25805 }, xA), 25806 CA = function (t) { 25807 this._methodName = t 25808 }, 25809 NA = (Object.defineProperty(DA.prototype, "latitude", { 25810 get: function () { 25811 return this._lat 25812 }, 25813 enumerable: !1, 25814 configurable: !0 25815 }), Object.defineProperty(DA.prototype, "longitude", { 25816 get: function () { 25817 return this._long 25818 }, 25819 enumerable: !1, 25820 configurable: !0 25821 }), DA.prototype.isEqual = function (t) { 25822 return this._lat === t._lat && this._long === t._long 25823 }, DA.prototype.toJSON = function () { 25824 return { 25825 latitude: this._lat, 25826 longitude: this._long 25827 } 25828 }, DA.prototype._compareTo = function (t) { 25829 return Yy(this._lat, t._lat) || Yy(this._long, t._long) 25830 }, DA), 25831 AA = /^__.*__$/, 25832 kA = (OA.prototype.toMutation = function (t, e) { 25833 return null !== this.fieldMask ? new mw(t, this.data, this.fieldMask, e, this.fieldTransforms) : new yw(t, this.data, e, this.fieldTransforms) 25834 }, OA), 25835 RA = (PA.prototype.toMutation = function (t, e) { 25836 return new mw(t, this.data, this.fieldMask, e, this.fieldTransforms) 25837 }, PA); 25838 25839 function PA(t, e, n) { 25840 this.data = t, this.fieldMask = e, this.fieldTransforms = n 25841 } 25842 25843 function OA(t, e, n) { 25844 this.data = t, this.fieldMask = e, this.fieldTransforms = n 25845 } 25846 25847 function DA(t, e) { 25848 if (!isFinite(t) || t < -90 || 90 < t) throw new Fy(My.INVALID_ARGUMENT, "Latitude must be a number between -90 and 90, but was: " + t); 25849 if (!isFinite(e) || e < -180 || 180 < e) throw new Fy(My.INVALID_ARGUMENT, "Longitude must be a number between -180 and 180, but was: " + e); 25850 this._lat = t, this._long = e 25851 } 25852 25853 function xA(t) { 25854 this._byteString = t 25855 } 25856 25857 function LA() { 25858 for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e]; 25859 for (var n = 0; n < t.length; ++n) 25860 if (0 === t[n].length) throw new Fy(My.INVALID_ARGUMENT, "Invalid field name at argument $(i + 1). Field names must not be empty."); 25861 this._internalPath = new cm(t) 25862 } 25863 25864 function MA(t) { 25865 switch (t) { 25866 case 0: 25867 case 2: 25868 case 1: 25869 return 1; 25870 case 3: 25871 case 4: 25872 return; 25873 default: 25874 throw Hy() 25875 } 25876 } 25877 var FA = (Object.defineProperty(qA.prototype, "path", { 25878 get: function () { 25879 return this.settings.path 25880 }, 25881 enumerable: !1, 25882 configurable: !0 25883 }), Object.defineProperty(qA.prototype, "Sc", { 25884 get: function () { 25885 return this.settings.Sc 25886 }, 25887 enumerable: !1, 25888 configurable: !0 25889 }), qA.prototype.Dc = function (t) { 25890 return new qA(Object.assign(Object.assign({}, this.settings), t), this.databaseId, this.R, this.ignoreUndefinedProperties, this.fieldTransforms, this.fieldMask) 25891 }, qA.prototype.Cc = function (t) { 25892 var e = null === (e = this.path) || void 0 === e ? void 0 : e.child(t), 25893 e = this.Dc({ 25894 path: e, 25895 Nc: !1 25896 }); 25897 return e.xc(t), e 25898 }, qA.prototype.Fc = function (t) { 25899 var e, t = null === (e = this.path) || void 0 === e ? void 0 : e.child(t), 25900 t = this.Dc({ 25901 path: t, 25902 Nc: !1 25903 }); 25904 return t.Vc(), t 25905 }, qA.prototype.kc = function (t) { 25906 return this.Dc({ 25907 path: void 0, 25908 Nc: !0 25909 }) 25910 }, qA.prototype.Oc = function (t) { 25911 return vk(t, this.settings.methodName, this.settings.$c || !1, this.path, this.settings.Mc) 25912 }, qA.prototype.contains = function (e) { 25913 return void 0 !== this.fieldMask.find(function (t) { 25914 return e.isPrefixOf(t) 25915 }) || void 0 !== this.fieldTransforms.find(function (t) { 25916 return e.isPrefixOf(t.field) 25917 }) 25918 }, qA.prototype.Vc = function () { 25919 if (this.path) 25920 for (var t = 0; t < this.path.length; t++) this.xc(this.path.get(t)) 25921 }, qA.prototype.xc = function (t) { 25922 if (0 === t.length) throw this.Oc("Document fields must not be empty"); 25923 if (MA(this.Sc) && AA.test(t)) throw this.Oc('Document fields cannot begin and end with "__"') 25924 }, qA), 25925 UA = (jA.prototype.Lc = function (t, e, n, r) { 25926 return void 0 === r && (r = !1), new FA({ 25927 Sc: t, 25928 methodName: e, 25929 Mc: n, 25930 path: cm.emptyPath(), 25931 Nc: !1, 25932 $c: r 25933 }, this.databaseId, this.R, this.ignoreUndefinedProperties) 25934 }, jA); 25935 25936 function jA(t, e, n) { 25937 this.databaseId = t, this.ignoreUndefinedProperties = e, this.R = n || bS(t) 25938 } 25939 25940 function qA(t, e, n, r, i, o) { 25941 this.settings = t, this.databaseId = e, this.R = n, this.ignoreUndefinedProperties = r, void 0 === i && this.Vc(), this.fieldTransforms = i || [], this.fieldMask = o || [] 25942 } 25943 25944 function VA(t) { 25945 var e = t._freezeSettings(), 25946 n = bS(t._databaseId); 25947 return new UA(t._databaseId, !!e.ignoreUndefinedProperties, n) 25948 } 25949 25950 function BA(t, e, n, r, i, o) { 25951 void 0 === o && (o = {}); 25952 var s = t.Lc(o.merge || o.mergeFields ? 2 : 0, e, n, i); 25953 lk("Data must be an object, but it was:", s, r); 25954 var a, u, r = ck(r, s); 25955 if (o.merge) a = new hm(s.fieldMask), u = s.fieldTransforms; 25956 else if (o.mergeFields) { 25957 for (var c = [], h = 0, l = o.mergeFields; h < l.length; h++) { 25958 var f = fk(e, l[h], n); 25959 if (!s.contains(f)) throw new Fy(My.INVALID_ARGUMENT, "Field '" + f + "' is specified in your field mask but missing from your input data."); 25960 gk(c, f) || c.push(f) 25961 } 25962 a = new hm(c), u = s.fieldTransforms.filter(function (t) { 25963 return a.covers(t.field) 25964 }) 25965 } else a = null, u = s.fieldTransforms; 25966 return new kA(new qm(r), a, u) 25967 } 25968 var KA, WA = (Xi(HA, KA = CA), HA.prototype._toFieldTransform = function (t) { 25969 if (2 !== t.Sc) throw 1 === t.Sc ? t.Oc(this._methodName + "() can only appear at the top level of your update data") : t.Oc(this._methodName + "() cannot be used with set() unless you pass {merge:true}"); 25970 return t.fieldMask.push(t.path), null 25971 }, HA.prototype.isEqual = function (t) { 25972 return t instanceof HA 25973 }, HA); 25974 25975 function HA() { 25976 return null !== KA && KA.apply(this, arguments) || this 25977 } 25978 25979 function GA(t, e, n) { 25980 return new FA({ 25981 Sc: 3, 25982 Mc: e.settings.Mc, 25983 methodName: t._methodName, 25984 Nc: n 25985 }
25985, e.databaseId, e.R, e.ignoreUndefinedProperties) 25986 } 25987 var zA, QA, YA, XA, JA = (Xi(ik, XA = CA), ik.prototype._toFieldTransform = function (t) { 25988 return new uw(t.path, new zb) 25989 }, ik.prototype.isEqual = function (t) { 25990 return t instanceof ik 25991 }, ik), 25992 $A = (Xi(rk, YA = CA), rk.prototype._toFieldTransform = function (t) { 25993 var e = GA(this, t, !0), 25994 n = this.Bc.map(function (t) { 25995 return uk(t, e) 25996 }), 25997 n = new Qb(n); 25998 return new uw(t.path, n) 25999 }, rk.prototype.isEqual = function (t) { 26000 return this === t 26001 }, rk), 26002 ZA = (Xi(nk, QA = CA), nk.prototype._toFieldTransform = function (t) { 26003 var e = GA(this, t, !0), 26004 n = this.Bc.map(function (t) { 26005 return uk(t, e) 26006 }), 26007 n = new Zb(n); 26008 return new uw(t.path, n) 26009 }, nk.prototype.isEqual = function (t) { 26010 return this === t 26011 }, nk), 26012 tk = (Xi(ek, zA = CA), ek.prototype._toFieldTransform = function (t) { 26013 var e = new rw(t.R, Kb(t.R, this.qc)); 26014 return new uw(t.path, e) 26015 }, ek.prototype.isEqual = function (t) { 26016 return this === t 26017 }, ek); 26018 26019 function ek(t, e) { 26020 var n = this; 26021 return (n = zA.call(this, t) || this).qc = e, n 26022 } 26023 26024 function nk(t, e) { 26025 var n = this; 26026 return (n = QA.call(this, t) || this).Bc = e, n 26027 } 26028 26029 function rk(t, e) { 26030 var n = this; 26031 return (n = YA.call(this, t) || this).Bc = e, n 26032 } 26033 26034 function ik() { 26035 return null !== XA && XA.apply(this, arguments) || this 26036 } 26037 26038 function ok(t, r, i, e) { 26039 var o = t.Lc(1, r, i); 26040 lk("Data must be an object, but it was:", o, e); 26041 var s = [], 26042 a = qm.empty(); 26043 rm(e, function (t, e) { 26044 var n = dk(r, t, i); 26045 e = Zo(e); 26046 t = o.Fc(n); 26047 e instanceof WA ? s.push(n) : null != (t = uk(e, t)) && (s.push(n), a.set(n, t)) 26048 }); 26049 e = new hm(s); 26050 return new RA(a, e, o.fieldTransforms) 26051 } 26052 26053 function sk(t, e, n, r, i, o) { 26054 var s = t.Lc(1, e, n), 26055 a = [fk(e, r, n)], 26056 u = [i]; 26057 if (o.length % 2 != 0) throw new Fy(My.INVALID_ARGUMENT, "Function " + e + "() needs to be called with an even number of arguments that alternate between field names and values."); 26058 for (var c = 0; c < o.length; c += 2) a.push(fk(e, o[c])), u.push(o[c + 1]); 26059 for (var h, l, f, p = [], d = qm.empty(), v = a.length - 1; 0 <= v; --v) gk(p, a[v]) || (h = a[v], l = Zo(l = u[v]), f = s.Fc(h), l instanceof WA ? p.push(h) : null != (f = uk(l, f)) && (p.push(h), d.set(h, f))); 26060 i = new hm(p); 26061 return new RA(d, i, s.fieldTransforms) 26062 } 26063 26064 function ak(t, e, n, r) { 26065 return void 0 === r && (r = !1), uk(n, t.Lc(r ? 4 : 3, e)) 26066 } 26067 26068 function uk(s, t) { 26069 if (hk(s = Zo(s))) return lk("Unsupported field value:", t, s), ck(s, t); 26070 if (s instanceof CA) return function (t, e) { 26071 if (!MA(e.Sc)) throw e.Oc(t._methodName + "() can only be used with update() and set()"); 26072 if (!e.path) throw e.Oc(t._methodName + "() is not currently supported inside arrays"); 26073 t = t._toFieldTransform(e); 26074 t && e.fieldTransforms.push(t) 26075 }(s, t), null; 26076 if (void 0 === s && t.ignoreUndefinedProperties) return null; 26077 if (t.path && t.fieldMask.push(t.path), s instanceof Array) { 26078 if (t.settings.Nc && 4 !== t.Sc) throw t.Oc("Nested arrays are not supported"); 26079 return function (t) { 26080 for (var e = [], n = 0, r = 0, i = s; r < i.length; r++) { 26081 var o = uk(i[r], t.kc(n)); 26082 null == o && (o = { 26083 nullValue: "NULL_VALUE" 26084 }), e.push(o), n++ 26085 } 26086 return { 26087 arrayValue: { 26088 values: e 26089 } 26090 } 26091 }(t) 26092 } 26093 return function (t, e) { 26094 if (null === (t = Zo(t))) return { 26095 nullValue: "NULL_VALUE" 26096 }; 26097 if ("number" == typeof t) return Kb(e.R, t); 26098 if ("boolean" == typeof t) return { 26099 booleanValue: t 26100 }; 26101 if ("string" == typeof t) return {
26102 stringValue: t 26103 }; 26104 if (t instanceof Date) { 26105 var n = $y.fromDate(t); 26106 return { 26107 timestampValue: p_(e.R, n) 26108 } 26109 } 26110 if (t instanceof $y) return n = new $y(t.seconds, 1e3 * Math.floor(t.nanoseconds / 1e3)), { 26111 timestampValue: p_(e.R, n) 26112 }; 26113 if (t instanceof NA) return { 26114 geoPointValue: { 26115 latitude: t.latitude, 26116 longitude: t.longitude 26117 } 26118 }; 26119 if (t instanceof SA) return { 26120 bytesValue: d_(e.R, t._byteString) 26121 }; 26122 if (t instanceof tA) { 26123 var n = e.databaseId, 26124 r = t.firestore._databaseId; 26125 if (!r.isEqual(n)) throw e.Oc("Document reference is for database " + r.projectId + "/" + r.database + " but should be for database " + n.projectId + "/" + n.database); 26126 return { 26127 referenceValue: g_(t.firestore._databaseId || e.databaseId, t._key.path) 26128 } 26129 } 26130 throw e.Oc("Unsupported field value: " + QN(t)) 26131 }(s, t) 26132 } 26133 26134 function ck(t, n) { 26135 var r = {}; 26136 return im(t) ? n.path && 0 < n.path.length && n.fieldMask.push(n.path) : rm(t, function (t, e) { 26137 e = uk(e, n.Cc(t)); 26138 null != e && (r[t] = e) 26139 }), { 26140 mapValue: { 26141 fields: r 26142 } 26143 } 26144 } 26145 26146 function hk(t) { 26147 return !("object" != typeof t || null === t || t instanceof Array || t instanceof Date || t instanceof $y || t instanceof NA || t instanceof SA || t instanceof tA || t instanceof CA) 26148 } 26149 26150 function lk(t, e, n) { 26151 if (!hk(n) || ("object" != typeof (r = n) || null === r || Object.getPrototypeOf(r) !== Object.prototype && null !== Object.getPrototypeOf(r))) { 26152 n = QN(n); 26153 throw "an object" === n ? e.Oc(t + " a custom object") : e.Oc(t + " " + n) 26154 } 26155 var r 26156 } 26157 26158 function fk(t, e, n) { 26159 if ((e = Zo(e)) instanceof EA) return e._internalPath; 26160 if ("string" == typeof e) return dk(t, e); 26161 throw vk("Field path arguments must be of type string or FieldPath.", t, !1, void 0, n) 26162 } 26163 var pk = new RegExp("[~\\*/\\[\\]]"); 26164 26165 function dk(e, n, r) { 26166 if (0 <= n.search(pk)) throw vk("Invalid field path (" + n + "). Paths must not contain '~', '*', '/', '[', or ']'", e, !1, void 0, r); 26167 try { 26168 return (new(EA.bind.apply(EA, no([void 0], n.split(".")))))._internalPath 26169 } catch (t) { 26170 throw vk("Invalid field path (" + n + "). Paths must not be empty, begin with '.', end with '.', or contain '..'", e, !1, void 0, r) 26171 } 26172 } 26173 26174 function vk(t, e, n, r, i) { 26175 var o = r && !r.isEmpty(), 26176 s = void 0 !== i, 26177 e = "Function " + e + "() called with invalid data"; 26178 n && (e += " (via `toFirestore()`)"); 26179 n = ""; 26180 return (o || s) && (n += " (found", o && (n += " in field " + r), s && (n += " in document " + i), n += ")"), new Fy(My.INVALID_ARGUMENT, (e += ". ") + t + n) 26181 } 26182 26183 function gk(t, e) { 26184 return t.some(function (t) { 26185 return t.isEqual(e) 26186 }) 26187 } 26188 var yk, mk = (Object.defineProperty(_k.prototype, "id", { 26189 get: function () { 26190 return this._key.path.lastSegment() 26191 }, 26192 enumerable: !1, 26193 configurable: !0 26194 }), Object.defineProperty(_k.prototype, "ref", { 26195 get: function () { 26196 return new tA(this._firestore, this._converter, this._key) 26197 }, 26198 enumerable: !1, 26199 configurable: !0 26200 }), _k.prototype.exists = function () { 26201 return null !== this._document 26202 }, _k.prototype.data = function () { 26203 if (this._document) { 26204 if (this._converter) { 26205 var t = new bk(this._firestore, this._userDataWriter, this._key, this._document, null); 26206 return this._converter.fromFirestore(t) 26207 } 26208 return this._userDataWriter.convertValue(this._document.data.toProto()) 26209 } 26210 }, _k.prototype.get = function (t) { 26211 if (this._document) { 26212 t = this._document.data.field(Ik("DocumentSnapshot.get", t)); 26213 if (null !== t) return this._userDataWriter.convertValue(t) 26214 } 26215 }, _k), 26216 bk = (Xi(wk, yk = mk), wk.prototype.data = function () { 26217 return yk.prototype.data.call(this) 26218 }, wk); 26219 26220 function wk() { 26221 return null !== yk && yk.apply(this, arguments) || this 26222 } 26223 26224 function _k(t, e, n, r, i) { 26225 this._firestore = t, this._userDataWriter = e, this._key = n, this._document = r, this._converter = i 26226 } 26227 26228 function Ik(t, e) { 26229 return "string" == typeof e ? dk(t, e) : (e instanceof EA ? e : e._delegate)._internalPath 26230 } 26231 var Tk, Ek, Sk = (Ok.prototype.isEqual = function (t) { 26232 return this.hasPendingWrites === t.hasPendingWrites && this.fromCache === t.fromCache 26233 }, Ok), 26234 Ck = (Xi(Pk, Ek = mk), Pk.prototype.exists = function () { 26235 return Ek.prototype.exists.call(this) 26236 }, Pk.prototype.data = function (t) { 26237 if (void 0 === t && (t = {}), this._document) { 26238 if (this._converter) {
26239 var e = new Nk(this._firestore, this._userDataWriter, this._key, this._document, this.metadata, null); 26240 return this._converter.fromFirestore(e, t) 26241 } 26242 return this._userDataWriter.convertValue(this._document.data.toProto(), t.serverTimestamps) 26243 } 26244 }, Pk.prototype.get = function (t, e) { 26245 if (void 0 === e && (e = {}), this._document) { 26246 t = this._document.data.field(Ik("DocumentSnapshot.get", t)); 26247 if (null !== t) return this._userDataWriter.convertValue(t, e.serverTimestamps) 26248 } 26249 }, Pk), 26250 Nk = (Xi(Rk, Tk = Ck), Rk.prototype.data = function (t) { 26251 return void 0 === t && (t = {}), Tk.prototype.data.call(this, t) 26252 }, Rk), 26253 Ak = (Object.defineProperty(kk.prototype, "docs", { 26254 get: function () { 26255 var e = []; 26256 return this.forEach(function (t) { 26257 return e.push(t) 26258 }), e 26259 }, 26260 enumerable: !1, 26261 configurable: !0 26262 }), Object.defineProperty(kk.prototype, "size", { 26263 get: function () { 26264 return this._snapshot.docs.size 26265 }, 26266 enumerable: !1, 26267 configurable: !0 26268 }), Object.defineProperty(kk.prototype, "empty", { 26269 get: function () { 26270 return 0 === this.size 26271 }, 26272 enumerable: !1, 26273 configurable: !0 26274 }), kk.prototype.forEach = function (e, n) { 26275 var r = this; 26276 this._snapshot.docs.forEach(function (t) { 26277 e.call(n, new Nk(r._firestore, r._userDataWriter, t.key, t, new Sk(r._snapshot.mutatedKeys.has(t.key), r._snapshot.fromCache), r.query._converter)) 26278 }) 26279 }, kk.prototype.docChanges = function (t) { 26280 t = !!(t = void 0 === t ? {} : t).includeMetadataChanges; 26281 if (t && this._snapshot.excludesMetadataChanges) throw new Fy(My.INVALID_ARGUMENT, "To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot()."); 26282 return this._cachedChanges && this._cachedChangesIncludeMetadataChanges === t || (this._cachedChanges = function (i, e) { 26283 if (i._snapshot.oldDocs.isEmpty()) { 26284 var n = 0; 26285 return i._snapshot.docChanges.map(function (t) { 26286 var e = new Nk(i._firestore, i._userDataWriter, t.doc.key, t.doc, new Sk(i._snapshot.mutatedKeys.has(t.doc.key), i._snapshot.fromCache), i.query._converter); 26287 return t.doc, { 26288 type: "added", 26289 doc: e, 26290 oldIndex: -1, 26291 newIndex: n++ 26292 } 26293 }) 26294 } 26295 var o = i._snapshot.oldDocs; 26296 return i._snapshot.docChanges.filter(function (t) { 26297 return e || 3 !== t.type 26298 }).map(function (t) { 26299 var e = new Nk(i._firestore, i._userDataWriter, t.doc.key, t.doc, new Sk(i._snapshot.mutatedKeys.has(t.doc.key), i._snapshot.fromCache), i.query._converter), 26300 n = -1, 26301 r = -1; 26302 return 0 !== t.type && (n = o.indexOf(t.doc.key), o = o.delete(t.doc.key)), 1 !== t.type && (r = (o = o.add(t.doc)).indexOf(t.doc.key)), { 26303 type: function (t) { 26304 switch (t) { 26305 case 0: 26306 return "added"; 26307 case 2: 26308 case 3: 26309 return "modified"; 26310 case 1: 26311 return "removed"; 26312 default: 26313 return Hy() 26314 } 26315 }(t.type), 26316 doc: e, 26317 oldIndex: n, 26318 newIndex: r 26319 } 26320 }) 26321 }(this, t), this._cachedChangesIncludeMetadataChanges = t), this._cachedChanges 26322 }, kk); 26323 26324 function kk(t, e, n, r) { 26325 this._firestore = t, this._userDataWriter = e, this._snapshot = r, this.metadata = new Sk(r.hasPendingWrites, r.fromCache), this.query = n 26326 } 26327 26328 function Rk() { 26329 return null !== Tk && Tk.apply(this, arguments) || this 26330 } 26331 26332 function Pk(t, e, n, r, i, o) { 26333 var s = this; 26334 return (s = Ek.call(this, t, e, n, r, o) || this)._firestore = t, s._firestoreImpl = t, s.metadata = i, s 26335 } 26336 26337 function Ok(t, e) { 26338 this.hasPendingWrites = t, this.fromCache = e 26339 } 26340 26341 function Dk(t, e) { 26342 return t instanceof Ck && e instanceof Ck ? 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 Ak && e instanceof Ak && t._firestore === e._firestore && lA(t.query, e.query) && t.metadata.isEqual(e.metadata) && t._snapshot.isEqual(e._snapshot) 26343 } 26344 26345 function xk(t) { 26346 if (kb(t) && 0 === t.explicitOrderBy.length) throw new Fy(My.UNIMPLEMENT
26346ED, "limitToLast() queries require specifying at least one orderBy() clause") 26347 } 26348 Ga = function () {}; 26349 26350 function Lk(t) { 26351 for (var e = [], n = 1; n < arguments.length; n++) e[n - 1] = arguments[n]; 26352 for (var r = 0, i = e; r < i.length; r++) t = i[r]._apply(t); 26353 return t 26354 } 26355 var Mk, Fk, Uk, jk, qk, Vk = (Xi(Xk, qk = Ga), Xk.prototype._apply = function (t) { 26356 var e = VA(t.firestore), 26357 e = function (t, e, n, r, i, o) { 26358 if (r.isKeyField()) { 26359 if ("array-contains" === i || "array-contains-any" === i) throw new Fy(My.INVALID_ARGUMENT, "Invalid Query. You can't perform '" + i + "' queries on FieldPath.documentId()."); 26360 if ("in" === i || "not-in" === i) { 26361 Zk(o, i); 26362 for (var s = [], a = 0, u = o; a < u.length; a++) { 26363 var c = u[a]; 26364 s.push($k(n, t, c)) 26365 } 26366 h = { 26367 arrayValue: { 26368 values: s 26369 } 26370 } 26371 } else h = $k(n, t, o) 26372 } else "in" !== i && "not-in" !== i && "array-contains-any" !== i || Zk(o, i), h = ak(e, "where", o, "in" === i || "not-in" === i); 26373 var h = Xm.create(r, i, h); 26374 return function (t, e) { 26375 if (e.g()) { 26376 var n = Pb(t); 26377 if (null !== n && !n.isEqual(e.field)) throw new Fy(My.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() + "'"); 26378 n = Rb(t); 26379 null !== n && tR(0, e.field, n) 26380 } 26381 t = function (t, e) { 26382 for (var n = 0, r = t.filters; n < r.length; n++) { 26383 var i = r[n]; 26384 if (0 <= e.indexOf(i.op)) return i.op 26385 } 26386 return null 26387 }(t, function () { 26388 switch (e.op) { 26389 case "!=": 26390 return ["!=", "not-in"]; 26391 case "array-contains": 26392 return ["array-contains", "array-contains-any", "not-in"]; 26393 case "in": 26394 return ["array-contains-any", "in", "not-in"]; 26395 case "array-contains-any": 26396 return ["array-contains", "array-contains-any", "in", "not-in"]; 26397 case "not-in": 26398 return ["array-contains", "array-contains-any", "in", "not-in", "!="]; 26399 default: 26400 return [] 26401 } 26402 }()); 26403 if (null !== t) throw t === e.op ? new Fy(My.INVALID_ARGUMENT, "Invalid query. You cannot use more than one '" + e.op.toString() + "' filter.") : new Fy(My.INVALID_ARGUMENT, "Invalid query. You cannot use '" + e.op.toString() + "' filters with '" + t.toString() + "' filters.") 26404 }(t, h), h 26405 }(t._query, e, t.firestore._databaseId, this.Uc, this.Qc, this.Kc); 26406 return new eA(t.firestore, t._converter, (t = t._query, e = t.filters.concat([e]), new Sb(t.path, t.collectionGroup, t.explicitOrderBy.slice(), e, t.limit, t.limitType, t.startAt, t.endAt))) 26407 }, Xk), 26408 Bk = (Xi(Yk, jk = Ga), Yk.prototype._apply = function (t) { 26409 var e = function (t, e, n) { 26410 if (null !== t.startAt) throw new Fy(My.INVALID_ARGUMENT, "Invalid query. You must not call startAt() or startAfter() before calling orderBy()."); 26411 if (null !== t.endAt) throw new Fy(My.INVALID_ARGUMENT, "Invalid query. You must not call endAt() or endBefore() before calling orderBy()."); 26412 var r = new Ib(e, n); 26413 return e = r, null !== Rb(n = t) || null !== (t = Pb(n)) && tR(0, t, e.field), r 26414 }(t._query, this.Uc, this.jc); 26415 return new eA(t.firestore, t._converter, (t = t._query, e = t.explicitOrderBy.concat([e]), new Sb(t.path, t.collectionGroup, e, t.filters.slice(), t.limit, t.limitType, t.startAt, t.endAt))) 26416 }, Yk), 26417 Kk = (Xi(Qk, Uk = Ga), Qk.prototype._apply = function (t) { 26418 return new eA(t.firestore, t._converter, Lb(t._query, this.Wc, this.Gc)) 26419 }, Qk), 26420 Wk = (Xi(zk, Fk = Ga), zk.prototype._apply = function (t) { 26421 var e = Jk(t, this.type, this.zc, this.Hc); 26422 return new eA(t.firestore, t._converter, (t = t._query, e = e, new Sb(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, e, t.endAt))) 26423 }, zk), 26424 Hk = (Xi(Gk, Mk = Ga), Gk.prototype._apply = function (t) { 26425 var e = Jk(t, this.type, this.zc, this.Hc); 26426 return new eA(t.firestore, t._converter, (t = t._query, e = e, new Sb(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, t.startAt, e))) 26427 }, Gk); 26428 26429 function Gk(t, e, n) { 26430 var r = this; 26431 return (r = Mk.call(this) || this).type = t, r.zc = e, r.Hc = n, r 26432 } 26433 26434 function zk(t, e, n) { 26435 var r = this; 26436 return (r = Fk.call(this) || this).type = t, r.zc = e, r.Hc = n, r 26437 } 26438 26439 function Qk(t, e, n) { 26440 var r = this; 26441 return (r = Uk.call(this) || this).type = t, r.Wc = e, r.Gc = n, r 26442 } 26443 26444 function Yk(t, e) { 26445 var n = this; 26446 return (n = jk.call(this) || this).Uc = t, n.jc = e, n.type = "orderBy", n 26447 } 26448 26449 function Xk(t, e, n) { 26450 var r = this; 26451 return (r = qk.call(this) || this).Uc = t, r.Qc = e, r.Kc = n, r.type = "where", r 26452 } 26453 26454 function Jk(t, c, e, n) { 26455 if (e[0] = Zo(e[0]), e[0] instanceof mk) return function (t, e, n, r) { 26456 if (!n) throw new Fy(My.NOT_FOUND, "Can't use a DocumentSnapshot that doesn't exist for " + c + "()."); 26457 for (var i = [], o = 0, s = Db(t); o < s.length; o++) { 26458 var a = s[o]; 26459 if (a.field.isKeyField()) i.push(xm(e, n.key)); 26460 else { 26461 var u = n.data.field(a.field); 26462 if (_m(u)) throw new Fy(My.INVALID_ARGUMENT, 'Invalid query. You are trying to start or end a query using a document for which the field "' + a.field + '" is an uncommitted server timestamp. (Since the value of this field is unknown, you cannot start/end a query with it.)'); 26463 if (null === u) { 26464 a = a.field.canonicalString(); 26465 throw new Fy(My.INVALID_ARGUMENT, "Invalid query. You are trying to start or end a query using a document for which the field '" + a + "' (used as the orderBy) does not exist.") 26466 } 26467 i.push(u) 26468 } 26469 } 26470 return new gb(i, r) 26471 }(t._query, t.firestore._databaseId, e[0]._document, n); 26472 var r = VA(t.firestore); 26473 return function (t, e, n, r, i, o) { 26474 var s = t.explicitOrderBy; 26475 if (i.length > s.length) throw new Fy(My.INVALID_ARGUMENT, "Too many arguments provided to " + r + "(). The number of arguments must be less than or equal to the number of orderBy() clauses"); 26476 for (var a = [], u = 0; u < i.length; u++) { 26477 var c = i[u]; 26478 if (s[u].field.isKeyField()) { 26479 if ("string" != typeof c) throw new Fy(My.INVALID_ARGUMENT, "Invalid query. Expected a string for document ID in " + r + "(), but got a " + typeof c); 26480 if (!Ob(t) && -1 !== c.indexOf("/")) throw new Fy(My.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."); 26481 var h = t.path.child(am.fromString(c)); 26482 if (!Cm.isDocumentKey(h)) throw new Fy(My.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 c
26482ontains an odd number of segments."); 26483 h = new Cm(h); 26484 a.push(xm(e, h)) 26485 } else { 26486 c = ak(n, r, c); 26487 a.push(c) 26488 } 26489 } 26490 return new gb(a, o) 26491 }(t._query, t.firestore._databaseId, r, c, e, n) 26492 } 26493 26494 function $k(t, e, n) { 26495 if ("string" == typeof (n = Zo(n))) { 26496 if ("" === n) throw new Fy(My.INVALID_ARGUMENT, "Invalid query. When querying with FieldPath.documentId(), you must provide a valid document ID, but it was an empty string."); 26497 if (!Ob(e) && -1 !== n.indexOf("/")) throw new Fy(My.INVALID_ARGUMENT, "Invalid query. When querying a collection by FieldPath.documentId(), you must provide a plain document ID, but '" + n + "' contains a '/' character."); 26498 e = e.path.child(am.fromString(n)); 26499 if (!Cm.isDocumentKey(e)) throw new Fy(My.INVALID_ARGUMENT, "Invalid query. When querying a collection group by FieldPath.documentId(), the value provided must result in a valid document path, but '" + e + "' is not because it has an odd number of segments (" + e.length + ")."); 26500 return xm(t, new Cm(e)) 26501 } 26502 if (n instanceof tA) return xm(t, n._key); 26503 throw new Fy(My.INVALID_ARGUMENT, "Invalid query. When querying with FieldPath.documentId(), you must provide a valid string or a DocumentReference, but it was: " + QN(n) + ".") 26504 } 26505 26506 function Zk(t, e) { 26507 if (!Array.isArray(t) || 0 === t.length) throw new Fy(My.INVALID_ARGUMENT, "Invalid Query. A non-empty array is required for '" + e.toString() + "' filters."); 26508 if (10 < t.length) throw new Fy(My.INVALID_ARGUMENT, "Invalid Query. '" + e.toString() + "' filters support a maximum of 10 elements in the value array.") 26509 } 26510 26511 function tR(t, e, n) { 26512 if (!n.isEqual(e)) throw new Fy(My.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.") 26513 } 26514 eR.prototype.convertValue = function (t, e) { 26515 switch (void 0 === e && (e = "none"), Am(t)) { 26516 case 0: 26517 return null; 26518 case 1: 26519 return t.booleanValue; 26520 case 2: 26521 return bm(t.integerValue || t.doubleValue); 26522 case 3: 26523 return this.convertTimestamp(t.timestampValue); 26524 case 4: 26525 return this.convertServerTimestamp(t, e); 26526 case 5: 26527 return t.stringValue; 26528 case 6: 26529 return this.convertBytes(wm(t.bytesValue)); 26530 case 7: 26531 return this.convertReference(t.referenceValue); 26532 case 8: 26533 return this.convertGeoPoint(t.geoPointValue); 26534 case 9: 26535 return this.convertArray(t.arrayValue, e); 26536 case 10: 26537 return this.convertObject(t.mapValue, e); 26538 default: 26539 throw Hy() 26540 } 26541 }, eR.prototype.convertObject = function (t, n) { 26542 var r = this, 26543 i = {}; 26544 return rm(t.fields || {}, function (t, e) { 26545 i[t] = r.convertValue(e, n) 26546 }), i 26547 }, eR.prototype.convertGeoPoint = function (t) { 26548 return new NA(bm(t.latitude), bm(t.longitude)) 26549 }, eR.prototype.convertArray = function (t, e) { 26550 var n = this; 26551 return (t.values || []).map(function (t) { 26552 return n.convertValue(t, e) 26553 }) 26554 }, eR.prototype.convertServerTimestamp = function (t, e) { 26555 switch (e) { 26556 case "previous": 26557 var n = function t(e) { 26558 e = e.mapValue.fields.__previous_value__; 26559 return _m(e) ? t(e) : e 26560 }(t); 26561 return null == n ? null : this.convertValue(n, e); 26562 case "estimate": 26563 return this.convertTimestamp(Im(t)); 26564 default: 26565 return null 26566 } 26567 }, eR.prototype.convertTimestamp = function (t) { 26568 t = mm(t); 26569 return new $y(t.seconds, t.nanos) 26570 }, eR.prototype.convertDocumentKey = function (t, e) { 26571 var n = am.fromString(t); 26572 Gy(F_(n)); 26573 t = new ON(n.get(1), n.get(3)), n = new Cm(n.popFirst(5)); 26574 return t.isEqual(e) || By("Document " + n + " contains a document reference within a different database (" + t.projectId + "/" + t.database + ") which is not supported. It will be treated as a reference in the current database (" + e.projectId + "/" + e.database + ") instead."), n 26575 }, Sn = eR; 26576 26577 function eR() {} 26578 26579 function nR(t, e, n) { 26580 return t ? n && (n.merge || n.mergeFields) ? t.toFirestore(e, n) : t.toFirestore(e) : e 26581 } 26582 var rR, iR = (Xi(aR, rR = Sn), aR.prototype.convertBytes = function (t) { 26583 return new SA(t) 26584 }, aR.prototype.convertReference = function (t) { 26585 t = this.convertDocumentKey(t, this.firestore._databaseId); 26586 return new tA(this.firestore, null, t) 26587 }, aR), 26588 oR = (sR.prototype.set = function (t, e, n) { 26589 this._verifyNotCommitted(); 26590 t = uR(t, this._firestore), e = nR(t._converter, e, n), n = BA(this._dataReader, "WriteBatch.set", t._key, e, null !== t._converter, n); 26591 return this._mutations.push(n.toMutation(t._key, cw.none())), this 26592 }, sR.prototype.update = function (t, e, n) { 26593 for (var r = [], i = 3; i < arguments.length; i++) r[i - 3] = arguments[i]; 26594 this._verifyNotCommitted(); 26595 t = uR(t, this._firestore), e = "string" == typeof (e = Zo(e)) || e instanceof EA ? sk(this._dataReader, "WriteBatch.update", t._key, e, n, r) : ok(this._dataReader, "WriteBatch.update", t._key, e); 26596 return this._mutations.push(e.toMutation(t._key, cw.exists(!0))), this 26597 }, sR.prototype.delete = function (t) { 26598 this._verifyNotCommitted(); 26599 t = uR(t, this._firestore); 26600 return this._mutations = this._mutations.concat(new Aw(t._key, cw.none())), this 26601 }, sR.prototype.commit = function () { 26602 return this._verifyNotCommitted(), this._committed = !0, 0 < this._mutations.length ? this._commitHandler(this._mutations) : Promise.resolve() 26603 }, sR.prototype._verifyNotCommitted = function () { 26604 if (this._committed) throw new Fy(My.FAILED_PRECONDITION, "A write batch can no longer be used after commit() has been called.") 26605 }, sR); 26606 26607 function sR(t, e) { 26608 this._firestore = t, this._commitHandler = e, this._mutations = [], this._committed = !1, this._dataReader = VA(t) 26609 } 26610 26611 function aR(t) { 26612 var e = this; 26613 return (e = rR.call(this) || this).firestore = t, e 26614 } 26615 26616 function uR(t, e) { 26617 if ((t = Zo(t)).firestore !== e) throw new Fy(My.INVALID_ARGUMENT, "Provided document reference is from a different Firestore instance."); 26618 return t 26619 } 26620 var cR, hR = (Xi(lR, cR = Sn), lR.prototype.convertBytes = function (t) { 26621 return new SA(t) 26622 }, lR.prototype.convertReference = function (t) { 26623 t = this.convertDocumentKey(t, this.firestore._databaseId); 26624 return new tA(this.firestore, null, t) 26625 }, lR); 26626 26627 function lR(t) { 26628 var e = this; 26629 return (e = cR.call(this) || this).firestore = t, e 26630 } 26631 26632 function fR(t, e, n) { 26633 for (var r = [], i = 3; i < arguments.length; i++) r[i - 3] = arguments[i]; 26634 t = YN(t, tA); 26635 var o = YN(t.firestore, yA), 26636 s = VA(o); 26637 return dR(o, [("string" == typeof (e = Zo(e)) || e instanceof EA ? sk(s, "updateDoc", t._key, e, n, r) : ok(s, "updateDoc", t._key, e)).toMutation(t._key, cw.exists(!0))]) 26638 } 26639 26640 function pR(e) { 26641 for (var n = [], t = 1; t < arguments.length; t++) n[t - 1] = arguments[t]; 26642 e = Zo(e); 26643 var r = { 26644 includeMetadataChanges: !1 26645 }, 26646 i = 0; 26647 "object" != typeof n[i] || dA(n[i]) || (r = n[i], i++); 26648 var o, s, a, u, c, h, l = { 26649 includeMetadataChanges: r.includeMetadataChanges 26650 }; 26651 return dA(n[i]) && (o = n[i], n[i] = null === (r = o.next) || void 0 === r ? void 0 : r.bind(o), n[i + 1] = null === (r = o.error) || void 0 === r ? void 0 : r.bind(o), n[i + 2] = null === (r = o.complete) || void 0 === r ? void 0 : r.bind(o)), e instanceof tA ? (a = YN(e.firestore, yA), u = Nb
26651(e._key.path), h = { 26652 next: function (t) { 26653 n[i] && n[i](vR(a, e, t)) 26654 }, 26655 error: n[i + 1], 26656 complete: n[i + 2] 26657 }) : (s = YN(e, eA), a = YN(s.firestore, yA), u = s._query, c = new hR(a), h = { 26658 next: function (t) { 26659 n[i] && n[i](new Ak(a, c, s, t)) 26660 }, 26661 error: n[i + 1], 26662 complete: n[i + 2] 26663 }, xk(e._query)), 26664 function (n, t, e) { 26665 var r = this, 26666 i = new cN(h), 26667 o = new dC(t, i, e); 26668 return n.asyncQueue.enqueueAndForget(function () { 26669 return $i(r, void 0, void 0, function () { 26670 var e; 26671 return Zi(this, function (t) { 26672 switch (t.label) { 26673 case 0: 26674 return e = lC, [4, NN(n)]; 26675 case 1: 26676 return [2, e.apply(void 0, [t.sent(), o])] 26677 } 26678 }) 26679 }) 26680 }), 26681 function () { 26682 i.Wo(), n.asyncQueue.enqueueAndForget(function () { 26683 return $i(r, void 0, void 0, function () { 26684 var e; 26685 return Zi(this, function (t) { 26686 switch (t.label) { 26687 case 0: 26688 return e = fC, [4, NN(n)]; 26689 case 1: 26690 return [2, e.apply(void 0, [t.sent(), o])] 26691 } 26692 }) 26693 }) 26694 }) 26695 } 26696 }(wA(a), u, l) 26697 } 26698 26699 function dR(t, e) { 26700 return function (n, r) { 26701 var t = this, 26702 i = new aI; 26703 return n.asyncQueue.enqueueAndForget(function () { 26704 return $i(t, void 0, void 0, function () { 26705 var e; 26706 return Zi(this, function (t) { 26707 switch (t.label) { 26708 case 0: 26709 return e = OC, [4, CN(n)]; 26710 case 1: 26711 return [2, e.apply(void 0, [t.sent(), r, i])] 26712 } 26713 }) 26714 }) 26715 }), i.promise 26716 }(wA(t), e) 26717 } 26718 26719 function vR(t, e, n) { 26720 var r = n.docs.get(e._key), 26721 i = new hR(t); 26722 return new Ck(t, i, e._key, r, new Sk(n.hasPendingWrites, n.fromCache), e._converter) 26723 } 26724 var gR, yR = (bR.prototype.get = function (t) { 26725 var e = this, 26726 n = uR(t, this._firestore), 26727 r = new iR(this._firestore); 26728 return this._transaction.lookup([n._key]).then(function (t) { 26729 if (!t || 1 !== t.length) return Hy(); 26730 t = t[0]; 26731 if (t.isFoundDocument()) return new mk(e._firestore, r, t.key, t, n._converter); 26732 if (t.isNoDocument()) return new mk(e._firestore, r, n._key, null, n._converter); 26733 throw Hy() 26734 }) 26735 }, bR.prototype.set = function (t, e, n) { 26736 t = uR(t, this._firestore), e = nR(t._converter, e, n), n = BA(this._dataReader, "Transaction.set", t._key, e, null !== t._converter, n); 26737 return this._transaction.set(t._key, n), this 26738 }, bR.prototype.update = function (t, e, n) { 26739 for (var r = [], i = 3; i < arguments.length; i++) r[i - 3] = arguments[i]; 26740 t = uR(t, this._firestore), e = "string" == typeof (e = Zo(e)) || e instanceof EA ? sk(this._dataReader, "Transaction.update", t._key, e, n, r) : ok(this._dataReader, "Transaction.update", t._key, e); 26741 return this._transaction.update(t._key, e), this 26742 }, bR.prototype.delete = function (t) { 26743 t = uR(t, this._firestore); 26744 return this._transaction.delete(t._key), this 26745 }, Xi(mR, gR = bR), mR.prototype.get = function (t) { 26746 var e = this, 26747 n = uR(t, this._firestore), 26748 r = new hR(this._firestore); 26749 return gR.prototype.get.call(this, t).then(function (t) { 26750 return new Ck(e._firestore, r, n._key, t._document, new Sk(!1, !1), n._converter) 26751 }) 26752 }, mR); 26753 26754 function mR(t, e) { 26755 var n = this; 26756 return (n = gR.call(this, t, e) || this)._firestore = t, n 26757 } 26758 26759 function bR(t, e) { 26760 this._firestore = t, this._transaction = e, this._dataReader = VA(t) 26761 } 26762 26763 function wR() { 26764 if ("undefined" == typeof Uint8Array) throw new Fy(My.UNIMPLEMENT
26764ED, "Uint8Arrays are not available in this environment.") 26765 } 26766 26767 function _R() { 26768 if ("undefined" == typeof atob) throw new Fy(My.UNIMPLEMENTED, "Blobs are unavailable in Firestore in this environment.") 26769 } 26770 var IR, TR = (RR.fromBase64String = function (t) { 26771 return _R(), new RR(SA.fromBase64String(t)) 26772 }, RR.fromUint8Array = function (t) { 26773 return wR(), new RR(SA.fromUint8Array(t)) 26774 }, RR.prototype.toBase64 = function () { 26775 return _R(), this._delegate.toBase64() 26776 }, RR.prototype.toUint8Array = function () { 26777 return wR(), this._delegate.toUint8Array() 26778 }, RR.prototype.isEqual = function (t) { 26779 return this._delegate.isEqual(t._delegate) 26780 }, RR.prototype.toString = function () { 26781 return "Blob(base64: " + this.toBase64() + ")" 26782 }, RR), 26783 ER = (kR.prototype.enableIndexedDbPersistence = function (t, e) { 26784 return function (t, e) { 26785 TA(t = YN(t, yA)); 26786 var n = wA(t), 26787 r = t._freezeSettings(), 26788 t = new rN; 26789 return IA(n, t, new eN(t, r.cacheSizeBytes, null == e ? void 0 : e.forceOwnership)) 26790 }(t._delegate, { 26791 forceOwnership: e 26792 }) 26793 }, kR.prototype.enableMultiTabIndexedDbPersistence = function (t) { 26794 return function (t) { 26795 TA(t = YN(t, yA)); 26796 var e = wA(t), 26797 n = t._freezeSettings(), 26798 t = new rN; 26799 return IA(e, t, new nN(t, n.cacheSizeBytes)) 26800 }(t._delegate) 26801 }, kR.prototype.clearIndexedDbPersistence = function (t) { 26802 return function (n) { 26803 var t = this; 26804 if (n._initialized && !n._terminated) throw new Fy(My.FAILED_PRECONDITION, "Persistence can only be cleared before a Firestore instance is initialized or after it is terminated."); 26805 var r = new aI; 26806 return n._queue.enqueueAndForgetEvenWhileRestricted(function () { 26807 return $i(t, void 0, void 0, function () { 26808 var e; 26809 return Zi(this, function (t) { 26810 switch (t.label) { 26811 case 0: 26812 return t.trys.push([0, 2, , 3]), [4, function (n) { 26813 return $i(this, void 0, void 0, function () { 26814 var e; 26815 return Zi(this, function (t) { 26816 switch (t.label) { 26817 case 0: 26818 return hI.yt() ? (e = n + "main", [4, hI.delete(e)]) : [2, Promise.resolve()]; 26819 case 1: 26820 return t.sent(), [2] 26821 } 26822 }) 26823 }) 26824 }(JT(n._databaseId, n._persistenceKey))]; 26825 case 1: 26826 return t.sent(), r.resolve(), [3, 3]; 26827 case 2: 26828 return e = t.sent(), r.reject(e), [3, 3]; 26829 case 3: 26830 return [2] 26831 } 26832 }) 26833 }) 26834 }), r.promise 26835 }(t._delegate) 26836 }, kR), 26837 SR = (Object.defineProperty(AR.prototype, "_databaseId", { 26838 get: function () { 26839 return this._delegate._databaseId 26840 }, 26841 enumerable: !1, 26842 configurable: !0 26843 }), AR.prototype.settings = function (t) { 26844 t.merge && delete(t = Object.assign(Object.assign({}, this._delegate._getSettings()), t)).merge, this._delegate._setSettings(t) 26845 }, AR.prototype.useEmulator = function (t, e) { 26846 var n, r; 26847 n = this._delegate, r = t, t = e, "firestore.googleapis.com" !== (e = (n = YN(n, ZN))._getSettings()).host && e.host !== r && Ky("Host has been set in both settings() and useEmulator(), emulator host will be used"), n._setSettings(Object.assign(Object.assign({}, e), { 26848 host: r + ":" + t, 26849 ssl: !1 26850 })) 26851 }, AR.prototype.enableNetwork = function () { 26852 return function (i) { 26853 var t = this; 26854 return i.asyncQueue.enqueue(function () { 26855 return $i(t, void 0, void 0, function () { 26856 var n, r; 26857 return Zi(this, function (t) { 26858 switch (t.label) { 26859 case 0: 26860 return [4, TN(i)]; 26861 case 1: 26862 return n = t.sent(), [4, SN(i)]; 26863 case 2: 26864 return r = t.sent(), [2, (n.setNetworkEnabled(!0), (e = r).$r.delete(0), LS(e))] 26865 } 26866 var e 26867 }) 26868 }) 26869 }) 26870 }(wA(YN(this._delegate, yA))) 26871 }, AR.prototype.disableNetwork = function () { 26872 return function (r) { 26873 var t = this; 26874 return r.asyncQueue.enqueue(function () { 26875 return $i(t, void 0, void 0, function () { 26876 var e, n; 26877 return Zi(this, function (t) { 26878 switch (t.label) { 26879 case 0: 26880 return [4, TN(r)]; 26881 case 1: 26882 return e = t.sent(), [4, SN(r)]; 26883 case 2: 26884 return n = t.sent(), [2, (e.setNetworkEnabled(!1), function (n) { 26885 return $i(this, void 0, void 0, function () { 26886 var e; 26887 return Zi(this, function (t) { 26888 switch (t.label) { 26889 case 0: 26890 return (e = n).$r.add(0), [4, MS(e)]; 26891 case 1: 26892 return t.sent(), e.Br.set("Offline"), [2] 26893 } 26894 }) 26895 }) 26896 }(n))] 26897 } 26898 }) 26899 }) 26900 }) 26901 }(wA(YN(this._delegate, yA))) 26902 }, AR.prototype.enablePersistence = function (t) { 26903 var e = !1, 26904 n = !1; 26905 return t && HN("synchronizeTabs", e = !!t.synchronizeTabs, "experimentalForceOwningTab", n = !!t.experimentalForceOwningTab), e ? this.Jc.enableMultiTabIndexedDbPersistence(this) : this.Jc.enableIndexedDbPersistence(this, n) 26906 }, AR.prototype.clearPersistence = function () { 26907 return this.Jc.clearIndexedDbPersistence(this) 26908 }, AR.prototype.terminate = function () {
26909 return this.Yc && (this.Yc._removeServiceInstance("firestore"), this.Yc._removeServiceInstance("firestore-exp")), this._delegate._delete() 26910 }, AR.prototype.waitForPendingWrites = function () { 26911 return function (n) { 26912 var t = this, 26913 r = new aI; 26914 return n.asyncQueue.enqueueAndForget(function () { 26915 return $i(t, void 0, void 0, function () { 26916 var e; 26917 return Zi(this, function (t) { 26918 switch (t.label) { 26919 case 0: 26920 return e = MC, [4, CN(n)]; 26921 case 1: 26922 return [2, e.apply(void 0, [t.sent(), r])] 26923 } 26924 }) 26925 }) 26926 }), r.promise 26927 }(wA(YN(this._delegate, yA))) 26928 }, AR.prototype.onSnapshotsInSync = function (t) { 26929 return e = this._delegate, t = t, 26930 function (n, t) { 26931 var e = this, 26932 r = new cN(t); 26933 return n.asyncQueue.enqueueAndForget(function () { 26934 return $i(e, void 0, void 0, function () { 26935 var e; 26936 return Zi(this, function (t) { 26937 switch (t.label) { 26938 case 0: 26939 return e = function (t, e) { 26940 t.Gr.add(e), e.next() 26941 }, [4, NN(n)]; 26942 case 1: 26943 return [2, e.apply(void 0, [t.sent(), r])] 26944 } 26945 }) 26946 }) 26947 }), 26948 function () { 26949 r.Wo(), n.asyncQueue.enqueueAndForget(function () { 26950 return $i(e, void 0, void 0, function () { 26951 var e; 26952 return Zi(this, function (t) { 26953 switch (t.label) { 26954 case 0: 26955 return e = function (t, e) { 26956 t.Gr.delete(e) 26957 }, [4, NN(n)]; 26958 case 1: 26959 return [2, e.apply(void 0, [t.sent(), r])] 26960 } 26961 }) 26962 }) 26963 }) 26964 } 26965 }(wA(YN(e, yA)), dA(t) ? t : { 26966 next: t 26967 }); 26968 var e 26969 }, Object.defineProperty(AR.prototype, "app", { 26970 get: function () { 26971 if (!this.Yc) throw new Fy(My.FAILED_PRECONDITION, "Firestore was not initialized using the Firebase SDK. 'app' is not available"); 26972 return this.Yc 26973 }, 26974 enumerable: !1, 26975 configurable: !0 26976 }), AR.prototype.collection = function (t) { 26977 try { 26978 return new YR(this, uA(this._delegate, t)) 26979 } catch (t) { 26980 throw jR(t, "collection()", "Firestore.collection()") 26981 } 26982 }, AR.prototype.doc = function (t) { 26983 try { 26984 return new FR(this, cA(this._delegate, t)) 26985 } catch (t) { 26986 throw jR(t, "doc()", "Firestore.doc()") 26987 } 26988 }, AR.prototype.collectionGroup = function (t) { 26989 try { 26990 return new GR(this, function (t, e) { 26991 if (t = YN(t, ZN), KN("collectionGroup", "collection id", e), 0 <= e.indexOf("/")) throw new Fy(My.INVALID_ARGUMENT, "Invalid collection ID '" + e + "' passed to function collectionGroup(). Collection IDs must not contain '/'."); 26992 return new eA(t, null, (e = e, new Sb(am.emptyPath(), e))) 26993 }(this._delegate, t)) 26994 } catch (t) { 26995 throw jR(t, "collectionGroup()", "Firestore.collectionGroup()") 26996 } 26997 }, AR.prototype.runTransaction = function (e) { 26998 var n, r = this; 26999 return function (n, r) { 27000 var t = this, 27001 i = new aI; 27002 return n.asyncQueue.enqueueAndForget(function () { 27003 return $i(t, void 0, void 0, function () { 27004 var e; 27005 return Zi(this, function (t) { 27006 switch (t.label) { 27007 case 0: 27008 return [4, IN(n).then(function (t) { 27009 return t.datastore 27010 })]; 27011 case 1: 27012 return e = t.sent(), new fN(n.asyncQueue, e, r, i).run(), [2] 27013 } 27014 }) 27015 }) 27016 }), i.promise 27017 }(wA(n = this._delegate), function (t) { 27018 return t = new yR(n, t), e(new PR(r, t)) 27019 }) 27020 }, AR.prototype.batch = function () { 27021 var e = this; 27022 return wA(this._delegate), new OR(new oR(this._delegate, function (t) { 27023 return dR(e._delegate, t) 27024 })) 27025 }, AR.prototype.loadBundle = function (t) { 27026 throw new Fy(My.FAILED_PRECONDITION, '"loadBundle()" does not exist, have you imported "firebase/firestore/bundle"?') 27027 }, AR.prototype.namedQuery = function (t) {
27028 throw new Fy(My.FAILED_PRECONDITION, '"namedQuery()" does not exist, have you imported "firebase/firestore/bundle"?') 27029 }, AR), 27030 CR = (Xi(NR, IR = Sn), NR.prototype.convertBytes = function (t) { 27031 return new TR(new SA(t)) 27032 }, NR.prototype.convertReference = function (t) { 27033 t = this.convertDocumentKey(t, this.firestore._databaseId); 27034 return FR.Xc(t, this.firestore, null) 27035 }, NR); 27036 27037 function NR(t) { 27038 var e = this; 27039 return (e = IR.call(this) || this).firestore = t, e 27040 } 27041 27042 function AR(t, e, n) { 27043 var r = this; 27044 this._delegate = e, this.Jc = n, this.INTERNAL = { 27045 delete: function () { 27046 return r.terminate() 27047 } 27048 }, t instanceof ON || (this.Yc = t) 27049 } 27050 27051 function kR() {} 27052 27053 function RR(t) { 27054 this._delegate = t 27055 } 27056 var PR = (MR.prototype.get = function (t) { 27057 var e = this, 27058 n = nP(t); 27059 return this._delegate.get(n).then(function (t) { 27060 return new WR(e._firestore, new Ck(e._firestore._delegate, e._userDataWriter, t._key, t._document, t.metadata, n._converter)) 27061 }) 27062 }, MR.prototype.set = function (t, e, n) { 27063 t = nP(t); 27064 return n ? (WN("Transaction.set", n), this._delegate.set(t, e, n)) : this._delegate.set(t, e), this 27065 }, MR.prototype.update = function (t, e, n) { 27066 for (var r = [], i = 3; i < arguments.length; i++) r[i - 3] = arguments[i]; 27067 var o = nP(t); 27068 return 2 === arguments.length ? this._delegate.update(o, e) : (t = this._delegate).update.apply(t, no([o, e, n], r)), this 27069 }, MR.prototype.delete = function (t) { 27070 t = nP(t); 27071 return this._delegate.delete(t), this 27072 }, MR), 27073 OR = (LR.prototype.set = function (t, e, n) { 27074 t = nP(t); 27075 return n ? (WN("WriteBatch.set", n), this._delegate.set(t, e, n)) : this._delegate.set(t, e), this 27076 }, LR.prototype.update = function (t, e, n) { 27077 for (var r = [], i = 3; i < arguments.length; i++) r[i - 3] = arguments[i]; 27078 var o = nP(t); 27079 return 2 === arguments.length ? this._delegate.update(o, e) : (t = this._delegate).update.apply(t, no([o, e, n], r)), this 27080 }, LR.prototype.delete = function (t) { 27081 t = nP(t); 27082 return this._delegate.delete(t), this 27083 }, LR.prototype.commit = function () { 27084 return this._delegate.commit() 27085 }, LR), 27086 DR = (xR.prototype.fromFirestore = function (t, e) { 27087 t = new Nk(this._firestore._delegate, this._userDataWriter, t._key, t._document, t.metadata, null); 27088 return this._delegate.fromFirestore(new HR(this._firestore, t), null != e ? e : {}) 27089 }, xR.prototype.toFirestore = function (t, e) { 27090 return e ? this._delegate.toFirestore(t, e) : this._delegate.toFirestore(t) 27091 }, xR.Zc = function (t, e) { 27092 var n = xR.tu, 27093 r = n.get(t); 27094 r || (r = new WeakMap, n.set(t, r)); 27095 n = r.get(e); 27096 return n || (n = new xR(t, new CR(t), e), r.set(e, n)), n 27097 }, xR); 27098 27099 function xR(t, e, n) { 27100 this._firestore = t, this._userDataWriter = e, this._delegate = n 27101 } 27102 27103 function LR(t) { 27104 this._delegate = t 27105 } 27106 27107 function MR(t, e) { 27108 this._firestore = t, this._delegate = e, this._userDataWriter = new CR(t) 27109 } 27110 DR.tu = new WeakMap; 27111 var FR = (UR.eu = function (t, e, n) { 27112 if (t.length % 2 != 0) throw new Fy(My.INVALID_ARGUMENT, "Invalid document reference. Document references must have an even number of segments, but " + t.canonicalString() + " has " + t.length); 27113 return new UR(e, new tA(e._delegate, n, new Cm(t))) 27114 }, UR.Xc = function (t, e, n) { 27115 return new UR(e, new tA(e._delegate, n, t)) 27116 }, Object.defineProperty(UR.prototype, "id", { 27117 get: function () { 27118 return this._delegate.id 27119 }, 27120 enumerable: !1, 27121 configurable: !0 27122 }), Object.defineProperty(UR.prototype, "parent", { 27123 get: function () { 27124 return new YR(this.firestore, this._delegate.parent) 27125 }, 27126 enumerable: !1, 27127 configurable: !0 27128 }), Object.defineProperty(UR.prototype, "path", { 27129 get: function () { 27130 return this._delegate.path 27131 }, 27132 enumerable: !1, 27133 configurable: !0 27134 }), UR.prototype.collection = function (t) { 27135 try { 27136 return new YR(this.firestore, uA(this._delegate, t)) 27137 } catch (t) { 27138 throw jR(t, "collection()", "DocumentReference.collection()") 27139 } 27140 }, UR.prototype.isEqual = function (t) { 27141 return (t = Zo(t)) instanceof tA && hA(this._delegate, t) 27142 }, UR.prototype.set = function (t, e) { 27143 e = WN("DocumentReference.set", e); 27144 try { 27145 return function (t, e, n) { 27146 t = YN(t, tA); 27147 var r = YN(t.firestore, yA), 27148 e = nR(t._converter, e, n); 27149 return dR(r, [BA(VA(r), "setDoc", t._key, e, null !== t._converter, n).toMutation(t._key, cw.none())]) 27150 }(this._delegate, t, e) 27151 } catch (t) { 27152 throw jR(t, "setDoc()", "DocumentReference.set()") 27153 } 27154 }, UR.prototype.update = function (t, e) { 27155 for (var n = [], r = 2; r < arguments.length; r++) n[r - 2] = arguments[r]; 27156 try { 27157 return 1 === arguments.length ? fR(this._delegate, t) : fR.apply(void 0, no([this._delegate, t, e], n)) 27158 } catch (t) { 27159 throw jR(t, "updateDoc()", "DocumentReference.update(
27159)") 27160 } 27161 }, UR.prototype.delete = function () { 27162 return dR(YN((t = this._delegate).firestore, yA), [new Aw(t._key, cw.none())]); 27163 var t 27164 }, UR.prototype.onSnapshot = function () { 27165 for (var e = this, t = [], n = 0; n < arguments.length; n++) t[n] = arguments[n]; 27166 var r = qR(t), 27167 i = VR(t, function (t) { 27168 return new WR(e.firestore, new Ck(e.firestore._delegate, e._userDataWriter, t._key, t._document, t.metadata, e._delegate._converter)) 27169 }); 27170 return pR(this._delegate, r, i) 27171 }, UR.prototype.get = function (t) { 27172 var e = this; 27173 return ("cache" === (null == t ? void 0 : t.source) ? function (e) { 27174 e = YN(e, tA); 27175 var n = YN(e.firestore, yA), 27176 t = wA(n), 27177 r = new hR(n); 27178 return function (n, r) { 27179 var t = this, 27180 i = new aI; 27181 return n.asyncQueue.enqueueAndForget(function () { 27182 return $i(t, void 0, void 0, function () { 27183 var e; 27184 return Zi(this, function (t) { 27185 switch (t.label) { 27186 case 0: 27187 return e = function (o, s, a) { 27188 return $i(this, void 0, void 0, function () { 27189 var r, i; 27190 return Zi(this, function (t) { 27191 switch (t.label) { 27192 case 0: 27193 return t.trys.push([0, 2, , 3]), [4, (e = s, (n = o).persistence.runTransaction("read document", "readonly", function (t) { 27194 return n.Mn.mn(t, e) 27195 }))]; 27196 case 1: 27197 return (i = t.sent()).isFoundDocument() ? a.resolve(i) : i.isNoDocument() ? a.resolve(null) : a.reject(new Fy(My.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]; 27198 case 2: 27199 return r = t.sent(), i = nC(r, "Failed to get document '" + s + " from cache"), a.reject(i), [3, 3]; 27200 case 3: 27201 return [2] 27202 } 27203 var e, n 27204 }) 27205 }) 27206 }, [4, EN(n)]; 27207 case 1: 27208 return [2, e.apply(void 0, [t.sent(), r, i])] 27209 } 27210 }) 27211 }) 27212 }), i.promise 27213 }(t, e._key).then(function (t) { 27214 return new Ck(n, r, e._key, t, new Sk(null !== t && t.hasLocalMutations, !0), e._converter) 27215 }) 27216 } : "server" === (null == t ? void 0 : t.source) ? function (e) { 27217 e = YN(e, tA); 27218 var n = YN(e.firestore, yA); 27219 return AN(wA(n), e._key, { 27220 source: "server" 27221 }).then(function (t) { 27222 return vR(n, e, t) 27223 }) 27224 } : function (e) { 27225 e = YN(e, tA); 27226 var n = YN(e.firestore, yA); 27227 return AN(wA(n), e._key).then(function (t) { 27228 return vR(n, e, t) 27229 }) 27230 })(this._delegate).then(function (t) { 27231 return new WR(e.firestore, new Ck(e.firestore._delegate, e._userDataWriter, t._key, t._document, t.metadata, e._delegate._converter)) 27232 }) 27233 }, UR.prototype.withConverter = function (t) { 27234 return new UR(this.firestore, t ? this._delegate.withConverter(DR.Zc(this.firestore, t)) : this._delegate.withConverter(null)) 27235 }
27235, UR); 27236 27237 function UR(t, e) { 27238 this.firestore = t, this._delegate = e, this._userDataWriter = new CR(t) 27239 } 27240 27241 function jR(t, e, n) { 27242 return t.message = t.message.replace(e, n), t 27243 } 27244 27245 function qR(t) { 27246 for (var e = 0, n = t; e < n.length; e++) { 27247 var r = n[e]; 27248 if ("object" == typeof r && !dA(r)) return r 27249 } 27250 return {} 27251 } 27252 27253 function VR(t, e) { 27254 var n; 27255 return { 27256 next: function (t) { 27257 n.next && n.next(e(t)) 27258 }, 27259 error: null === (t = (n = dA(t[0]) ? t[0] : dA(t[1]) ? t[1] : "function" == typeof t[0] ? { 27260 next: t[0], 27261 error: t[1], 27262 complete: t[2] 27263 } : { 27264 next: t[1], 27265 error: t[2], 27266 complete: t[3] 27267 }).error) || void 0 === t ? void 0 : t.bind(n), 27268 complete: null === (t = n.complete) || void 0 === t ? void 0 : t.bind(n) 27269 } 27270 } 27271 var BR, KR, WR = (Object.defineProperty(eP.prototype, "ref", { 27272 get: function () { 27273 return new FR(this._firestore, this._delegate.ref) 27274 }, 27275 enumerable: !1, 27276 configurable: !0 27277 }), Object.defineProperty(eP.prototype, "id", { 27278 get: function () { 27279 return this._delegate.id 27280 }, 27281 enumerable: !1, 27282 configurable: !0 27283 }), Object.defineProperty(eP.prototype, "metadata", { 27284 get: function () { 27285 return this._delegate.metadata 27286 }, 27287 enumerable: !1, 27288 configurable: !0 27289 }), Object.defineProperty(eP.prototype, "exists", { 27290 get: function () { 27291 return this._delegate.exists() 27292 }, 27293 enumerable: !1, 27294 configurable: !0 27295 }), eP.prototype.data = function (t) { 27296 return this._delegate.data(t) 27297 }, eP.prototype.get = function (t, e) { 27298 return this._delegate.get(t, e) 27299 }, eP.prototype.isEqual = function (t) { 27300 return Dk(this._delegate, t._delegate) 27301 }, eP), 27302 HR = (Xi(tP, KR = WR), tP.prototype.data = function (t) { 27303 return this._delegate.data(t) 27304 }, tP), 27305 GR = (ZR.prototype.where = function (t, e, n) { 27306 try { 27307 return new ZR(this.firestore, Lk(this._delegate, (r = n, i = e, o = Ik("where", t), new Vk(o, i, r)))) 27308 } catch (t) { 27309 throw jR(t, /(orderBy|where)\(\)/, "Query.$1()") 27310 } 27311 var r, i, o 27312 }, ZR.prototype.orderBy = function (t, e) { 27313 try { 27314 return new ZR(this.firestore, Lk(this._delegate, (n = void 0 === e ? "asc" : e, r = Ik("orderBy", t), new Bk(r, n)))) 27315 } catch (t) { 27316 throw jR(t, /(orderBy|where)\(\)/, "Query.$1()") 27317 } 27318 var n, r 27319 }, ZR.prototype.limit = function (t) { 27320 try { 27321 return new ZR(this.firestore, Lk(this._delegate, (XN("limit", e = t), new Kk("limit", e, "F")))) 27322 } catch (t) { 27323 throw jR(t, "limit()", "Query.limit()") 27324 } 27325 var e 27326 }, ZR.prototype.limitToLast = function (t) { 27327 try { 27328 return new ZR(this.firestore, Lk(this._delegate, (XN("limitToLast", e = t), new Kk("limitToLast", e, "L")))) 27329 } catch (t) { 27330 throw jR(t, "limitToLast()", "Query.limitToLast()") 27331 } 27332 var e 27333 }, ZR.prototype.startAt = function () { 27334 for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e]; 27335 try { 27336 return new ZR(this.firestore, Lk(this._delegate, function () { 27337 for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e]; 27338 return new Wk("startAt", t, !0) 27339 }.apply(void 0, t))) 27340 } catch (t) { 27341 throw jR(t, "startAt()", "Query.startAt()") 27342 } 27343 }, ZR.prototype.startAfter = function () { 27344 for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e]; 27345 try { 27346 return new ZR(this.firestore, Lk(this._delegate, function () { 27347 for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e]; 27348 return new Wk("startAfter", t, !1) 27349 }.apply(void 0, t))) 27350 } catch (t) { 27351 throw jR(t, "startAfter()", "Query.startAfter()") 27352 } 27353 }, ZR.prototype.endBefore = function () { 27354 for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e]; 27355 try { 27356 return new ZR(this.firestore, Lk(this._delegate, function () { 27357 for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e]; 27358 return new Hk("endBefore", t, !0) 27359 }.apply(void 0, t))) 27360 } catch (t) { 27361 throw jR(t, "endBefore()", "Query.endBefore()") 27362 } 27363 }, ZR.prototype.endAt = function () { 27364 for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e]; 27365 try { 27366 return new ZR(this.firestore, Lk(this._delegate, function () { 27367 for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e]; 27368 return new Hk("endAt", t, !1) 27369 }.apply(void 0, t))) 27370 } catch (t) { 27371 throw jR(t, "endAt()", "Query.endAt()") 27372 } 27373 }, ZR.prototype.isEqual = function (t) { 27374 return lA(this._delegate, t._delegate) 27375 }, ZR.prototype.get = function (t) { 27376 var e = this; 27377 return ("cache" === (null == t ? void 0 : t.source) ? function (e) { 27378 e = YN(e, eA); 27379 var n = YN(e.firestore, yA), 27380 t = wA(n), 27381 r = new hR(n); 27382 return function (n, r) { 27383 var t = this, 27384 i = new aI; 27385 return n.asyncQueue.enqueueAndForget(function () { 27386 return $i(t, void 0, void 0, function () { 27387 var e; 27388 return Zi(this, function (t) { 27389 switch (t.label) { 27390 case 0: 27391 return e = function (i, o, s) { 27392 return $i(this, void 0, void 0, function () { 27393 var e, n, r; 27394 return Zi(this, function (t) { 27395 switch (t.label) { 27396 case 0: 27397 return t.trys.push([0, 2, , 3]), [4, vE(i, o, !0)]; 27398 case 1: 27399 return r = t.sent(), e = new SC(o, r.Bn), n = e._o(r.documents), n = e.applyChanges(n, !1), s.resolve(n.snapshot), [3, 3]; 27400 case 2: 27401 return n = t.sent(), r = nC(n, "Failed to execute query '" + o + " against cache"), s.reject(r), [3, 3]; 27402 case 3: 27403 return [2] 27404 } 27405 }) 27406 }) 27407 }, [4, EN(n)]; 27408 case 1: 27409 return [2, e.apply(void 0, [t.sent(), r, i])] 27410 } 27411 }) 27412 }) 27413 }), i.promise 27414 }(t, e._query).then(function (t) { 27415 return new Ak(n, r, e, t) 27416 }) 27417 } : "server" === (null == t ? void 0 : t.source) ? function (e) { 27418 e = YN(e, eA); 27419 var n = YN(e.firestore, yA), 27420 t = wA(n), 27421 r = new hR(n); 27422 return kN(t, e._query, { 27423 source: "server" 27424 }).then(function (t) { 27425 return new Ak(n, r, e, t) 27426 }) 27427 } : function (e) { 27428 e = YN(e, eA); 27429 var n = YN(e.firestore, yA), 27430 t = wA(n), 27431 r = new hR(n); 27432 return xk(e._query), kN(t, e._query).then(function (t) { 27433 return new Ak(n, r, e, t) 27434 }) 27435 })(this._delegate).then(function (t) { 27436 return new QR(e.firestore, new Ak(e.firestore._delegate, e._userDataWriter, e._delegate, t._snapshot)) 27437 }) 27438 }, ZR.prototype.onSnapshot = function () { 27439 for (var e = this, t = [], n = 0; n < arguments.length; n++) t[n] = arguments[n]; 27440 var r = qR(t), 27441 i = VR(t, function (t) { 27442 return new QR(e.firestore, new Ak(e.firestore._delegate, e._userDataWriter, e._delegate, t._snapshot)) 27443 }); 27444 return pR(this._delegate, r, i) 27445 }, ZR.prototype.withConverter = function (t) { 27446 return new ZR(this.firestore, t ? this._delegate.withConverter(DR.Zc(this.firestore, t)) : this._delegate.withConverter(null)) 27447 }, ZR), 27448 zR = (Object.defineProperty($R.prototype, "type", { 27449 get: function () { 27450 return this._delegate.type 27451 }, 27452 enumerable: !1, 27453 configurable: !0 27454 }), Object.defineProperty($R.prototype, "doc", { 27455 get: function () { 27456 return new HR(this._firestore, this._delegate.doc) 27457 }, 27458 enumerable: !1, 27459 configurable: !0 27460 }), Object.defineProperty($R.prototype, "oldIndex", { 27461 get: function () { 27462 return this._delegate.oldIndex 27463 }, 27464 enumerable: !1, 27465 configurable: !0 27466 }), Object.defineProperty($R.prototype, "newIndex", { 27467 get: function () { 27468 return this._delegate.newIndex 27469 }, 27470 enumerable: !1, 27471 configurable: !0 27472 }), $R), 27473 QR = (Object.defineProperty(JR.prototype, "query", { 27474 get: function () { 27475 return new GR(this._firestore, this._delegate.query) 27476 }, 27477 enumerable: !1, 27478 configurable: !0 27479 }), Object.defineProperty(JR.prototype, "metadata", { 27480 get: function () { 27481 return this._delegate.metadata 27482 }, 27483 enumerable: !1, 27484 configurable: !0 27485 }), Object.defineProperty(JR.prototype, "size", { 27486 get: function () { 27487 return this._delegate.size 27488 }, 27489 enumerable: !1, 27490 configurable: !0 27491 }), Object.defineProperty(JR.prototype, "empty", { 27492 get: function () { 27493 return this._delegate.empty 27494 }, 27495 enumerable: !1, 27496 configurable: !0 27497 }), Object.defineProperty(JR.prototype, "docs", { 27498 get: function () { 27499 var e = this; 27500 return this._delegate.docs.map(function (t) { 27501 return new HR(e._firestore, t) 27502 }) 27503 }, 27504 enumerable: !1, 27505 configurable: !0 27506 }), JR.prototype.docChanges = function (t) { 27507 var e = this; 27508 return this._delegate.docChanges(t).map(function (t) { 27509 return new zR(e._firestore, t) 27510 }) 27511 }, JR.prototype.forEach = function (e, n) { 27512 var r = this; 27513 this._delegate.forEach(function (t) { 27514 e.call(n, new HR(r._firestore, t)) 27515 }) 27516 }, JR.prototype.isEqual = function (t) { 27517 return Dk(this._delegate, t._delegate) 27518 }, JR), 27519 YR = (Xi(XR, BR = GR), Object.defineProperty(XR.prototype, "id", { 27520 get: function () { 27521 return this._delegate.id 27522 }, 27523 enumerable: !1, 27524 configurable: !0 27525 }), Object.defineProperty(XR.prototype, "path", { 27526 get: function () { 27527 return this._delegate.path 27528 }, 27529 enumerable: !1, 27530 configurable: !0 27531 }), Object.defineProperty(XR.prototype, "parent", { 27532 get: function () { 27533 var t = this._delegate.parent; 27534 return t ? new FR(this.firestore, t) : null 27535 }, 27536 enumerable: !1, 27537 configurable: !0 27538 }), XR.prototype.doc = function (t) { 27539 try { 27540 return new FR(this.firestore, void 0 === t ? cA(this._delegate) : cA(this._delegate, t)) 27541 } catch (t) { 27542 throw jR(t, "doc()", "CollectionReference.doc()") 27543 } 27544 }, XR.prototype.add = function (t) { 27545 var e, n, r, i = this; 27546 return e = this._delegate, n = t, t = YN(e.firestore, yA), r = cA(e), n = nR(e._converter, n), dR(t, [BA(VA(e.firestore), "addDoc", r._key, n, null !== e._converter, {}).toMutation(r._key, cw.exists(!1))]).then(function () { 27547 return r 27548 }).then(function (t) { 27549 return new FR(i.firestore, t) 27550 }) 27551 }, XR.prototype.isEqual = function (t) { 27552 return hA(this._delegate, t._delegate) 27553 }, XR.prototype.withConverter = function (t) { 27554 return new XR(this.firestore, t ? this._delegate.withConverter(DR.Zc(this.firestore, t)) : this._delegate.withConverter(null)) 27555 }, XR); 27556 27557 function XR(t, e) { 27558 var n = this; 27559 return (n = BR.call(this, t, e) || this).firestore = t, n._delegate = e, n 27560 } 27561 27562 function JR(t, e) { 27563 this._firestore = t, this._delegate = e 27564 } 27565 27566 function $R(t, e) { 27567 this._firestore = t, this._delegate = e 27568 } 27569 27570 function ZR(t, e) { 27571 this.firestore = t, this._delegate = e, this._userDataWriter = new CR(t) 27572 } 27573 27574 function tP() { 27575 return null !== KR && KR.apply(this, arguments) || this 27576 } 27577 27578 function eP(t, e) { 27579 this._firestore = t, this._delegate = e 27580 } 27581 27582 function nP(t) { 27583 return YN(t, tA) 27584 } 27585 iP.documentId = function () { 27586 return new iP(cm.keyField().canonicalString()) 27587 }, iP.prototype.isEqual = function (t) { 27588 return (t = Zo(t)) instanceof EA && this._delegate._internalPath.isEqual(t._internalPath) 27589 }, Ga = iP, rP.serverTimestamp = function () { 27590 var t = new JA("serverTimestamp"); 27591 return t._methodName = "FieldValue.serverTimestamp", new rP(t) 27592 }, rP.delete = function () { 27593 var t = new WA("deleteField"); 27594 return t._methodName = "FieldValue.delete", new rP(t) 27595 }, rP.arrayUnion = function () { 27596 for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e]; 27597 var n = function () { 27598 for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e]; 27599 return new $A("arrayUnion", t) 27600 }.apply(void 0, t); 27601 return n._methodName = "FieldValue.arrayUnion", new rP(n) 27602 }, rP.arrayRemove = function () { 27603 for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e]; 27604 var n = function () { 27605 for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e]; 27606 return new ZA("arrayRemove", t) 27607 }.apply(void 0, t); 27608 return n._methodName = "FieldValue.arrayRemove", new rP(n) 27609 }, rP.increment = function (t) { 27610 t = new tk("increment", t); 27611 return t._methodName = "FieldValue.increment", new rP(t) 27612 }, rP.prototype.isEqual = function (t) { 27613 return this._delegate.isEqual(t._delegate) 27614 }, Sn = rP; 27615 27616 function rP(t) { 27617 this._delegate = t 27618 } 27619 27620 function iP() { 27621 for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e]; 27622 this._delegate = new(EA.bind.apply(EA, no([void 0], t))) 27623 } 27624 27625 function oP(t) { 27626 return e = thi
27626s._delegate, s = t, n = wA(e = YN(e, yA)), t = new gA, 27627 function (n, t, r) { 27628 var e, i = this, 27629 o = (e = s, t = bS(t), e = function (t) { 27630 if (t instanceof Uint8Array) return uN(t, void 0); 27631 if (t instanceof ArrayBuffer) return uN(new Uint8Array(t), void 0); 27632 if (t instanceof ReadableStream) return t.getReader(); 27633 throw new Error("Source of `toByteStreamReader` has to be a ArrayBuffer or ReadableStream") 27634 }("string" == typeof e ? (new TextEncoder).encode(e) : e), new hN(e, t)); 27635 n.asyncQueue.enqueueAndForget(function () { 27636 return $i(i, void 0, void 0, function () { 27637 var e; 27638 return Zi(this, function (t) { 27639 switch (t.label) { 27640 case 0: 27641 return e = JC, [4, CN(n)]; 27642 case 1: 27643 return e.apply(void 0, [t.sent(), o, r]), [2] 27644 } 27645 }) 27646 }) 27647 }) 27648 }(n, e._databaseId, t), t; 27649 var e, s, n 27650 } 27651 27652 function sP(t) { 27653 var e = this, 27654 n = this._delegate, 27655 t = t; 27656 return function (n, r) { 27657 var t = this; 27658 return n.asyncQueue.enqueue(function () { 27659 return $i(t, void 0, void 0, function () { 27660 var e; 27661 return Zi(this, function (t) { 27662 switch (t.label) { 27663 case 0: 27664 return e = function (t, e) { 27665 var n = t; 27666 return n.persistence.runTransaction("Get named query", "readonly", function (t) { 27667 return n.Qe.getNamedQuery(t, e) 27668 }) 27669 }, [4, EN(n)]; 27670 case 1: 27671 return [2, e.apply(void 0, [t.sent(), r])] 27672 } 27673 }) 27674 }) 27675 }) 27676 }(wA(n = YN(n, yA)), t).then(function (t) { 27677 return t ? new eA(n, null, t.query) : null 27678 }).then(function (t) { 27679 return t ? new GR(e, t) : null 27680 }) 27681 } 27682 var aP, uP, cP = { 27683 Firestore: SR, 27684 GeoPoint: NA, 27685 Timestamp: $y, 27686 Blob: TR, 27687 Transaction: PR, 27688 WriteBatch: OR, 27689 DocumentReference: FR, 27690 DocumentSnapshot: WR, 27691 Query: GR, 27692 QueryDocumentSnapshot: HR, 27693 QuerySnapshot: QR, 27694 CollectionReference: YR, 27695 FieldPath: Ga, 27696 FieldValue: Sn, 27697 setLogLevel: function (t) { 27698 Uy.setLogLevel(t) 27699 }, 27700 CACHE_SIZE_UNLIMITED: -1 27701 }; 27702 (aP = Xl).INTERNAL.registerComponent(new ts("firestore", function (t) { 27703 var e = t.getProvider("app").getImmediate(); 27704 return e = e, t = t.getProvider("auth-internal"), new SR(e, new yA(e, t), new ER) 27705 }, "PUBLIC").setServiceProps(Object.assign({}, cP))), aP.registerVersion("@firebase/firestore", "2.2.2"), (uP = SR).prototype.loadBundle = oP, uP.prototype.namedQuery = sP; 27706 var hP, lP = { 27707 OK: "ok", 27708 CANCELLED: "cancelled", 27709 UNKNOWN: "unknown", 27710 INVALID_ARGUMENT: "invalid-argument", 27711 DEADLINE_EXCEEDED: "deadline-exceeded", 27712 NOT_FOUND: "not-found", 27713 ALREADY_EXISTS: "already-exists", 27714 PERMISSION_DENIED: "permission-denied", 27715 UNAUTHENTICATED: "unauthenticated", 27716 RESOURCE_EXHAUSTED: "resource-exhausted", 27717 FAILED_PRECONDITION: "failed-precondition", 27718 ABORTED: "aborted", 27719 OUT_OF_RANGE: "out-of-range", 27720 UNIMPLEMENTED: "unimplemented", 27721 INTERNAL: "internal", 27722 UNAVAILABLE: "unavailable", 27723 DATA_LOSS: "data-loss" 27724 }, 27725 fP = (Xi(pP, hP = Error), pP); 27726 27727 function pP(t, e, n) { 27728 e = hP.call(this, e) || this; 27729 return Object.setPrototypeOf(e, pP.prototype), e.code = t, e.details = n, e 27730 } 27731 27732 function dP(t, e, n) { 27733 var r = function (t) { 27734 if (200 <= t && t < 300) return "ok"; 27735 switch (t) { 27736 case 0: 27737 return "internal"; 27738 case 400:
27739 return "invalid-argument"; 27740 case 401: 27741 return "unauthenticated"; 27742 case 403: 27743 return "permission-denied"; 27744 case 404: 27745 return "not-found"; 27746 case 409: 27747 return "aborted"; 27748 case 429: 27749 return "resource-exhausted"; 27750 case 499: 27751 return "cancelled"; 27752 case 500: 27753 return "internal"; 27754 case 501: 27755 return "unimplemented"; 27756 case 503: 27757 return "unavailable"; 27758 case 504: 27759 return "deadline-exceeded" 27760 } 27761 return "unknown" 27762 }(t), 27763 i = r, 27764 o = void 0; 27765 try { 27766 var s = e && e.error; 27767 if (s) { 27768 var a = s.status; 27769 if ("string" == typeof a) { 27770 if (!lP[a]) return new fP("internal", "internal"); 27771 r = lP[a], i = a 27772 } 27773 a = s.message; 27774 "string" == typeof a && (i = a), void 0 !== (o = s.details) && (o = n.decode(o)) 27775 } 27776 } catch (t) {} 27777 return "ok" === r ? null : new fP(r, i, o) 27778 } 27779 var vP = (gP.prototype.getAuthToken = function () { 27780 return $i(this, void 0, void 0, function () { 27781 var e; 27782 return Zi(this, function (t) { 27783 switch (t.label) { 27784 case 0: 27785 if (!this.auth) return [2, void 0]; 27786 t.label = 1; 27787 case 1: 27788 return t.trys.push([1, 3, , 4]), [4, this.auth.getToken()]; 27789 case 2: 27790 return (e = t.sent()) ? [2, e.accessToken] : [2, void 0]; 27791 case 3: 27792 return t.sent(), [2, void 0]; 27793 case 4: 27794 return [2] 27795 } 27796 }) 27797 }) 27798 }, gP.prototype.getInstanceIdToken = function () { 27799 return $i(this, void 0, void 0, function () { 27800 return Zi(this, function (t) { 27801 if (!(this.messaging && "Notification" in self && "granted" === Notification.permission)) return [2, void 0]; 27802 try { 27803 return [2, this.messaging.getToken()] 27804 } catch (t) { 27805 return [2, void 0] 27806 } 27807 return [2] 27808 }) 27809 }) 27810 }, gP.prototype.getContext = function () { 27811 return $i(this, void 0, void 0, function () { 27812 var e, n; 27813 return Zi(this, function (t) { 27814 switch (t.label) { 27815 case 0: 27816 return [4, this.getAuthToken()]; 27817 case 1: 27818 return e = t.sent(), [4, this.getInstanceIdToken()]; 27819 case 2: 27820 return n = t.sent(), [2, { 27821 authToken: e, 27822 instanceIdToken: n 27823 }] 27824 } 27825 }) 27826 }) 27827 }, gP); 27828 27829 function gP(t, e) { 27830 var n = this; 27831 this.auth = null, this.messaging = null, this.auth = t.getImmediate({ 27832 optional: !0 27833 }), this.messaging = e.getImmediate({ 27834 optional: !0 27835 }), this.auth || t.get().then(function (t) { 27836 return n.auth = t 27837 }, function () {}), this.messaging || e.get().then(function (t) { 27838 return n.messaging = t 27839 }, function () {}) 27840 } 27841 27842 function yP(t, e) { 27843 var n, r = {}; 27844 for (n in t) t.hasOwnProperty(n) && (r[n] = e(t[n])); 27845 return r 27846 } 27847 var mP = (bP.prototype.encode = function (t) { 27848 var e = this; 27849 if (null == t) return null; 27850 if ("number" == typeof (t = t instanceof Number ? t.valueOf() : t) && isFinite(t)) return t; 27851 if (!0 === t || !1 === t) return t; 27852 if ("[object String]" === Object.prototype.toString.call(t)) return t; 27853 if (Array.isArray(t)) return t.map(function (t) { 27854 return e.encode(t) 27855 }); 27856 if ("function" == typeof t || "object" == typeof t) return yP(t, function (t) { 27857 return e.encode(t) 27858 }); 27859 throw new Error("Data cannot be encoded in JSON: " + t) 27860 }, bP.prototype.decode = function (t) { 27861 var e = this; 27862 if (null == t) return t; 27863 if (t["@type"]) switch (t["@type"]) { 27864 case "type.googleapis.com/google.protobuf.Int64Value": 27865 case "type.googleapis.com/google.protobuf.UInt64Value": 27866 var n = Number(t.value); 27867 if (isNaN(n)) throw new Error("Data cannot be decoded from JSON: " + t); 27868 return n; 27869 default: 27870 throw new Error("Data cannot be decoded from JSON: " + t) 27871 } 27872 return Array.isArray(t) ? t.map(function (t) { 27873 return e.decode(t) 27874 }) : "function" == typeof t || "object" == typeof t ? yP(t, function (t) { 27875 return e.decode(t) 27876 }) : t 27877 }, bP); 27878 27879 function bP() {} 27880 var wP = (Object.defineProperty(_P.prototype, "app", { 27881 get: function () { 27882 return this.app_ 27883 }, 27884 enumerable: !1, 27885 configurable: !0 27886 }), _P.prototype._url = function (t) { 27887 var e = this.app_.options.projectId; 27888 return null === this.emulatorOrigin ? null !== this.customDomain ? this.customDomain + "/" + t : "https://" + this.region + "-" + e + ".cloudfunctions.net/" + t : this.emulatorOrigin + "/" + e + "/" + this.region + "/" + t 27889 }, _P.prototype.useEmulator = function (t, e) { 27890 this.emulatorOrigin = "http://" + t + ":" + e 27891 }, _P.prototype.useFunctionsEmulator = function (t) { 27892 this.emulatorOrigin = t 27893 }, _P.prototype.httpsCallable = function (e, n) { 27894 var r = this; 27895 return function (t) { 27896 return r.call(e, t, n || {}) 27897 } 27898 }, _P.prototype.postJSON = function (r, i, o) { 27899 return $i(this, void 0, void 0, function () { 27900 var e, n; 27901 return Zi(this, function (t) { 27902 switch (t.label) { 27903 case 0:
27904 o["Content-Type"] = "application/json", t.label = 1; 27905 case 1: 27906 return t.trys.push([1, 3, , 4]), [4, this.fetchImpl(r, { 27907 method: "POST", 27908 body: JSON.stringify(i), 27909 headers: o 27910 })]; 27911 case 2: 27912 return e = t.sent(), [3, 4]; 27913 case 3: 27914 return t.sent(), [2, { 27915 status: 0, 27916 json: null 27917 }]; 27918 case 4: 27919 n = null, t.label = 5; 27920 case 5: 27921 return t.trys.push([5, 7, , 8]), [4, e.json()]; 27922 case 6: 27923 return n = t.sent(), [3, 8]; 27924 case 7: 27925 return t.sent(), [3, 8]; 27926 case 8: 27927 return [2, { 27928 status: e.status, 27929 json: n 27930 }] 27931 } 27932 }) 27933 }) 27934 }, _P.prototype.call = function (c, h, l) { 27935 return $i(this, void 0, void 0, function () { 27936 var i, o, s, a, u; 27937 return Zi(this, function (t) { 27938 switch (t.label) { 27939 case 0: 27940 return i = this._url(c), h = this.serializer.encode(h), o = { 27941 data: h 27942 }, s = {}, [4, this.contextProvider.getContext()]; 27943 case 1: 27944 return (a = t.sent()).authToken && (s.Authorization = "Bearer " + a.authToken), a.instanceIdToken && (s["Firebase-Instance-ID-Token"] = a.instanceIdToken), u = l.timeout || 7e4, n = u, e = new Promise(function (t, e) { 27945 r = setTimeout(function () { 27946 e(new fP("deadline-exceeded", "deadline-exceeded")) 27947 }, n) 27948 }), u = (a = { 27949 timer: r, 27950 promise: e 27951 }).timer, a = a.promise, [4, Promise.race([IP(u, this.postJSON(i, o, s)), a, IP(u, this.cancelAllRequests)])]; 27952 case 2: 27953 if (!(a = t.sent())) throw new fP("cancelled", "Firebase Functions instance was deleted."); 27954 if (u = dP(a.status, a.json, this.serializer)) throw u; 27955 if (!a.json) throw new fP("internal", "Response is not valid JSON object."); 27956 if (void 0 === (u = void 0 === (u = a.json.data) ? a.json.result : u)) throw new fP("internal", "Response is missing data field."); 27957 return [2, { 27958 data: this.serializer.decode(u) 27959 }] 27960 } 27961 var n, r, e 27962 }) 27963 }) 27964 }, _P); 27965 27966 function _P(t, e, n, r, i) { 27967 var o = this; 27968 void 0 === r && (r = "us-central1"), this.app_ = t, this.fetchImpl = i, this.serializer = new mP, this.emulatorOrigin = null, this.INTERNAL = { 27969 delete: function () { 27970 return Promise.resolve(o.deleteService()) 27971 } 27972 }, this.contextProvider = new vP(e, n), this.cancelAllRequests = new Promise(function (t) { 27973 o.deleteService = function () { 27974 return t() 27975 } 27976 }); 27977 try { 27978 var s = new URL(r); 27979 this.customDomain = s.origin, this.region = "us-central1" 27980 } catch (t) { 27981 this.customDomain = null, this.region = r 27982 } 27983 } 27984 27985 function IP(n, r) { 27986 return $i(this, void 0, void 0, function () { 27987 var e; 27988 return Zi(this, function (t) { 27989 switch (t.label) { 27990 case 0: 27991 return [4, r]; 27992 case 1: 27993 return e = t.sent(), clearTimeout(n), [2, e] 27994 } 27995 }) 27996 }) 27997 } 27998 var TP, EP, SP; 27999 28000 function CP(n) { 28001 return new Promise(function (t, e) { 28002 n.onsuccess = function () { 28003 t(n.result) 28004 }, n.onerror = function () { 28005 e(n.error) 28006 } 28007 }) 28008 } 28009 28010 function NP(n, r, i) { 28011 var o, t = new Promise(function (t, e) { 28012 CP(o = n[r].apply(n, i)).then(t, e) 28013 }); 28014 return t.request = o, t 28015 } 28016 28017 function AP(t, n, e) { 28018 e.forEach(function (e) { 28019 Object.defineProperty(t.prototype, e, { 28020 get: function () { 28021 return this[n][e] 28022 }, 28023 set: function (t) { 28024 this[n][e] = t 28025 } 28026 }) 28027 }) 28028 } 28029 28030 function kP(e, n, r, t) { 28031 t.forEach(function (t) { 28032 t in r.prototype && (e.prototype[t] = function () { 28033 return NP(this[n], t, arguments) 28034 }) 28035 }) 28036 } 28037 28038 function RP(e, n, r, t) { 28039 t.forEach(function (t) { 28040 t in r.prototype && (e.prototype[t] = function () { 28041 return this[n][t].apply(this[n], arguments) 28042 }) 28043 }) 28044 } 28045 28046 function PP(t, r, e, n) {
28047 n.forEach(function (n) { 28048 n in e.prototype && (t.prototype[n] = function () { 28049 return t = this[r], (e = NP(t, n, arguments)).then(function (t) { 28050 if (t) return new DP(t, e.request) 28051 }); 28052 var t, e 28053 }) 28054 }) 28055 } 28056 28057 function OP(t) { 28058 this._index = t 28059 } 28060 28061 function DP(t, e) { 28062 this._cursor = t, this._request = e 28063 } 28064 28065 function xP(t) { 28066 this._store = t 28067 } 28068 28069 function LP(n) { 28070 this._tx = n, this.complete = new Promise(function (t, e) { 28071 n.oncomplete = function () { 28072 t() 28073 }, n.onerror = function () { 28074 e(n.error) 28075 }, n.onabort = function () { 28076 e(n.error) 28077 } 28078 }) 28079 } 28080 28081 function MP(t, e, n) { 28082 this._db = t, this.oldVersion = e, this.transaction = new LP(n) 28083 } 28084 28085 function FP(t) { 28086 this._db = t 28087 } 28088 28089 function UP(t, e, n) { 28090 var e = NP(indexedDB, "open", [t, e]), 28091 r = e.request; 28092 return r && (r.onupgradeneeded = function (t) { 28093 n && n(new MP(r.result, t.oldVersion, r.transaction)) 28094 }), e.then(function (t) { 28095 return new FP(t) 28096 }) 28097 } 28098 28099 function jP(t) { 28100 return NP(indexedDB, "deleteDatabase", [t]) 28101 } 28102 TP = Xl, EP = fetch.bind(self), SP = { 28103 Functions: wP 28104 }, TP.INTERNAL.registerComponent(new ts("functions", function (t, e) { 28105 var n = e.instanceIdentifier, 28106 r = t.getProvider("app").getImmediate(), 28107 e = t.getProvider("auth-internal"), 28108 t = t.getProvider("messaging"); 28109 return new wP(r, e, t, n, EP) 28110 }, "PUBLIC").setServiceProps(SP).setMultipleInstances(!0)), Xl.registerVersion("@firebase/functions", "0.6.5"), AP(OP, "_index", ["name", "keyPath", "multiEntry", "unique"]), kP(OP, "_index", IDBIndex, ["get", "getKey", "getAll", "getAllKeys", "count"]), PP(OP, "_index", IDBIndex, ["openCursor", "openKeyCursor"]), AP(DP, "_cursor", ["direction", "key", "primaryKey", "value"]), kP(DP, "_cursor", IDBCursor, ["update", "delete"]), ["advance", "continue", "continuePrimaryKey"].forEach(function (n) { 28111 n in IDBCursor.prototype && (DP.prototype[n] = function () { 28112 var e = this, 28113 t = arguments; 28114 return Promise.resolve().then(function () { 28115 return e._cursor[n].apply(e._cursor, t), CP(e._request).then(function (t) { 28116 if (t) return new DP(t, e._request) 28117 }) 28118 }) 28119 }) 28120 }), xP.prototype.createIndex = function () { 28121 return new OP(this._store.createIndex.apply(this._store, arguments)) 28122 }, xP.prototype.index = function () { 28123 return new OP(this._store.index.apply(this._store, arguments)) 28124 }, AP(xP, "_store", ["name", "keyPath", "indexNames", "autoIncrement"]), kP(xP, "_store", IDBObjectStore, ["put", "add", "delete", "clear", "get", "getAll", "getKey", "getAllKeys", "count"]), PP(xP, "_store", IDBObjectStore, ["openCursor", "openKeyCursor"]), RP(xP, "_store", IDBObjectStore, ["deleteIndex"]), LP.prototype.objectStore = function () { 28125 return new xP(this._tx.objectStore.apply(this._tx, arguments)) 28126 }, AP(LP, "_tx", ["objectStoreNames", "mode"]), RP(LP, "_tx", IDBTransaction, ["abort"]), MP.prototype.createObjectStore = function () { 28127 return new xP(this._db.createObjectStore.apply(this._db, arguments)) 28128 }, AP(MP, "_db", ["name", "version", "objectStoreNames"]), RP(MP, "_db", IDBDatabase, ["deleteObjectStore", "close"]), FP.prototype.transaction = function () { 28129 return new LP(this._db.transaction.apply(this._db, arguments)) 28130 }, AP(FP, "_db", ["name", "version", "objectStoreNames"]), RP(FP, "_db", IDBDatabase, ["close"]), ["openCursor", "openKeyCursor"].forEach(function (i) { 28131 [xP, OP].forEach(function (t) { 28132 i in t.prototype && (t.prototype[i.replace("open", "iterate")] = function () { 28133 var t = (n = arguments, Array.prototype.slice.call(n)), 28134 e = t[t.length - 1], 28135 n = this._store || this._index, 28136 r = n[i].apply(n, t.slice(0, -1)); 28137 r.onsuccess = function () { 28138 e(r.result) 28139 } 28140 }) 28141 }) 28142 }), [OP, xP].forEach(function (t) { 28143 t.prototype.getAll || (t.prototype.getAll = function (t, n) { 28144 var r = this, 28145 i = []; 28146 return new Promise(function (e) { 28147 r.iterateCursor(t, function (t) { 28148 t ? (i.push(t.value), void 0 === n || i.length != n ? t.continue() : e(i)) : e(i) 28149 }) 28150 }) 28151 }) 28152 }); 28153 var qP = 1e4, 28154 VP = "w:0.4.23", 28155 BP = "FIS_v2", 28156 KP = "https://firebaseinstallations.googleapis.com/v1", 28157 WP = 36e5, 28158 Sn = ((Ga = {})["missing-app-config-values"] = 'Missing App configuration value: "{$valueName}"', Ga["not-registered"] = "Firebase Installation is not registered.", Ga["installation-not-found"] = "Firebase Installation not found.", Ga["request-failed"] = '{$requestName} request failed with error "{$serverCode} {$serverStatus}: {$serverMessage}"', Ga["app-offline"] = "Could not process request. Application offline.", Ga["delete-pending-registration"] = "Can't delete installation while there is a pending registration request.", Ga), 28159 HP = new Co("installations", "Installations", Sn); 28160 28161 function GP(t) { 28162 return t instanceof Eo && t.code.includes("request-failed") 28163 } 28164 28165 function zP(t) { 28166 t = t.projectId; 28167 return KP + "/projects/" + t + "/installations" 28168 } 28169 28170 function QP(t) { 28171 return { 28172 token: t.token, 28173 requestStatus: 2,
28174 expiresIn: (t = t.expiresIn, Number(t.replace("s", "000"))), 28175 creationTime: Date.now() 28176 } 28177 } 28178 28179 function YP(n, r) { 28180 return $i(this, void 0, void 0, function () { 28181 var e; 28182 return Zi(this, function (t) { 28183 switch (t.label) { 28184 case 0: 28185 return [4, r.json()]; 28186 case 1: 28187 return e = t.sent(), e = e.error, [2, HP.create("request-failed", { 28188 requestName: n, 28189 serverCode: e.code, 28190 serverMessage: e.message, 28191 serverStatus: e.status 28192 })] 28193 } 28194 }) 28195 }) 28196 } 28197 28198 function XP(t) { 28199 t = t.apiKey; 28200 return new Headers({ 28201 "Content-Type": "application/json", 28202 Accept: "application/json", 28203 "x-goog-api-key": t 28204 }) 28205 } 28206 28207 function JP(t, e) { 28208 e = e.refreshToken, t = XP(t); 28209 return t.append("Authorization", BP + " " + e), t 28210 } 28211 28212 function $P(n) { 28213 return $i(this, void 0, void 0, function () { 28214 var e; 28215 return Zi(this, function (t) { 28216 switch (t.label) { 28217 case 0: 28218 return [4, n()]; 28219 case 1: 28220 return 500 <= (e = t.sent()).status && e.status < 600 ? [2, n()] : [2, e] 28221 } 28222 }) 28223 }) 28224 } 28225 28226 function ZP(e) { 28227 return new Promise(function (t) { 28228 setTimeout(t, e) 28229 }) 28230 } 28231 var tO = /^[cdef][\w-]{21}$/, 28232 eO = ""; 28233 28234 function nO() { 28235 try { 28236 var t = new Uint8Array(17); 28237 (self.crypto || self.msCrypto).getRandomValues(t), t[0] = 112 + t[0] % 16; 28238 t = function (t) { 28239 return btoa(String.fromCharCode.apply(String, no([], eo(t)))).replace(/\+/g, "-").replace(/\//g, "_") 28240 }(t).substr(0, 22); 28241 return tO.test(t) ? t : eO 28242 } catch (t) { 28243 return eO 28244 } 28245 } 28246 28247 function rO(t) { 28248 return t.appName + "!" + t.appId 28249 } 28250 var iO = new Map; 28251 28252 function oO(t, e) { 28253 t = rO(t); 28254 sO(t, e), 28255 function (t, e) { 28256 var n = uO(); 28257 n && n.postMessage({ 28258 key: t, 28259 fid: e 28260 }); 28261 cO() 28262 }(t, e) 28263 } 28264 28265 function sO(t, e) { 28266 var n, r, i = iO.get(t); 28267 if (i) try { 28268 for (var o = to(i), s = o.next(); !s.done; s = o.next())(0, s.value)(e) 28269 } catch (t) { 28270 n = { 28271 error: t 28272 } 28273 } finally { 28274 try { 28275 s && !s.done && (r = o.return) && r.call(o) 28276 } finally { 28277 if (n) throw n.error 28278 } 28279 } 28280 } 28281 var aO = null; 28282 28283 function uO() { 28284 return !aO && "BroadcastChannel" in self && ((aO = new BroadcastChannel("[Firebase] FID Change")).onmessage = function (t) { 28285 sO(t.data.key, t.data.fid) 28286 }), aO 28287 } 28288 28289 function cO() { 28290 0 === iO.size && aO && (aO.close(), aO = null) 28291 } 28292 var hO, lO = "firebase-installations-database", 28293 fO = 1, 28294 pO = "firebase-installations-store", 28295 dO = null; 28296 28297 function vO() { 28298 return dO = dO || UP(lO, fO, function (t) { 28299 0 === t.oldVersion && t.createObjectStore(pO) 28300 }) 28301 } 28302 28303 function gO(o, s) { 28304 return $i(this, void 0, void 0, function () { 28305 var e, n, r, i; 28306 return Zi(this, function (t) { 28307 switch (t.label) { 28308 case 0: 28309 return e = rO(o), [4, vO()]; 28310 case 1: 28311 return r = t.sent(), n = r.transaction(pO, "readwrite"), [4, (r = n.objectStore(pO)).get(e)]; 28312 case 2: 28313 return i = t.sent(), [4, r.put(s, e)]; 28314 case 3: 28315 return t.sent(), [4, n.complete]; 28316 case 4: 28317 return t.sent(), i && i.fid === s.fid || oO(o, s.fid), [2, s] 28318 } 28319 }) 28320 }) 28321 } 28322 28323 function yO(r) { 28324 return $i(this, void 0, void 0, function () { 28325 var e, n; 28326 return Zi(this, function (t) { 28327 switch (t.label) { 28328 case 0: 28329 return e = rO(r), [4, vO()]; 28330 case 1: 28331 return n = t.sent(), [4, (n = n.transaction(pO, "readwrite")).objectStore(pO).delete(e)]; 28332 case 2: 28333 return t.sent(), [4, n.complete]; 28334 case 3: 28335 return t.sent(), [2] 28336 } 28337 }) 28338 }) 28339 } 28340 28341 function mO(s, a) { 28342 return $i(this, void 0, void 0, function () { 28343 var e, n, r, i, o; 28344 return Zi(this, function (t) { 28345 switch (t.label) { 28346 case 0: 28347 return e = rO(s), [4, vO()]; 28348 case 1: 28349 return r = t.sent(), n = r.transaction(pO, "readwrite"), [4, (r = n.objectStore(pO)).get(e)]; 28350 case 2: 28351 return i = t.sent(), void 0 !== (o = a(i)) ? [3, 4] : [4, r.delete(e)]; 28352 case 3: 28353 return t.sent(), [3, 6]; 28354 case 4: 28355 return [4, r.put(o, e)]; 28356 case 5: 28357 t.sent(), t.label = 6; 28358 case 6: 28359 return [4, n.complete]; 28360 case 7: 28361 return t.sent(), !o || i && i.fid === o.fid || oO(s, o.fid), [2, o] 28362 } 28363 }) 28364 }) 28365 } 28366 28367 function bO(i) { 28368 return $i(this, void 0, void 0, function () { 28369 var e, n, r; 28370 return Zi(this, function (t) { 28371 switch (t.label) { 28372 case 0: 28373 return [4, mO(i, function (t) { 28374 t = _O(t || { 28375 fid: nO(), 28376 registrationStatus: 0 28377 }), t = function (t, e) { 28378 { 28379 if (0 !== e.registrationStatus) return 1 === e.registrationStatus ? { 28380 installationEntry: e, 28381 registrationPromise: function (i) { 28382 return $i(this, void 0, void 0, function () { 28383 var e, n, r; 28384 return Zi(this, function (t) { 28385 switch (t.label) { 28386 case 0: 28387 return [4, wO(i)]; 28388 case 1: 28389 e = t.sent(), t.label = 2; 28390 case 2: 28391 return 1 !== e.registrationStatus ? [3, 5] : [4, ZP(100)]; 28392 case 3: 28393 return t.sent(), [4, wO(i)]; 28394 case 4: 28395 return e = t.sent(), [3, 2]; 28396 case 5: 28397 return 0 !== e.registrationStatus ? [3, 7] : [4, bO(i)]; 28398 case 6: 28399 return r = t.sent(), n = r.installationEntry, (r = r.registrationPromise) ? [2, r] : [2, n]; 28400 case 7: 28401 return [2, e] 28402 } 28403 }) 28404 }) 28405 }(t) 28406 } : { 28407 installationEntry: e 28408 }; 28409 if (!navigator.onLine) { 28410 var n = Promise.reject(HP.create("app-offline")); 28411 return { 28412 installationEntry: e, 28413 registrationPromise: n 28414 } 28415 } 28416 e = { 28417 fid: e.fid, 28418 registrationStatus: 1, 28419 registrationTime: Date.now() 28420 }, t = function (r, i) { 28421 return $i(this, void 0, void 0, function () { 28422 var e, n; 28423 return Zi(this, function (t) { 28424 switch (t.label) { 28425 case 0: 28426 return t.trys.push([0, 2, , 7]), [4, function (s, t) { 28427 var a = t.fid; 28428 return $i(this, void 0, void 0, function () { 28429 var e, n, r, i, o; 28430 return Zi(this, function (t) { 28431 switch (t.label) { 28432 case 0: 28433 return e = zP(s), n = XP(s), o = { 28434 fid: a, 28435 authVersion: BP, 28436 appId: s.appId, 28437 sdkVersion: VP 28438 }, r = { 28439 method: "POST", 28440 headers: n, 28441 body: JSON.stringify(o) 28442 }, [4, $P(function () { 28443 return fetch(e, r) 28444 })]; 28445 case 1: 28446 return (i = t.sent()).ok ? [4, i.json()] : [3, 3]; 28447 case 2: 28448 return o = t.sent(), [2, { 28449 fid: o.fid || a, 28450 registrationStatus: 2, 28451 refreshToken: o.refreshToken, 28452 authToken: QP(o.authToken) 28453 }]; 28454 case 3: 28455 return [4, YP("Create Installation", i)]; 28456 case 4: 28457 throw t.sent() 28458 } 28459 }) 28460 }) 28461 }(r, i)]; 28462 case 1: 28463 return e = t.sent(), [2, gO(r, e)]; 28464 case 2: 28465 return GP(n = t.sent()) && 409 === n.customData.serverCode ? [4, yO(r)] : [3, 4]; 28466 case 3: 28467 return t.sent(), [3, 6]; 28468 case 4: 28469 return [4, gO(r, { 28470 fid: i.fid, 28471 registrationStatus: 0 28472 })]; 28473 case 5: 28474 t.sent(), t.label = 6; 28475 case 6: 28476 throw n; 28477 case 7: 28478 return [2] 28479 } 28480 }) 28481 }) 28482 }(t, e); 28483 return { 28484 installationEntry: e, 28485 registrationPromise: t 28486 } 28487 } 28488 }(i, t); 28489 return e = t.registrationPromise, t.installationEntry 28490 })]; 28491 case 1: 28492 return (n = t.sent()).fid !== eO ? [3, 3] : (r = {}, [4, e]); 28493 case 2: 28494 return [2, (r.installationEntry = t.sent(), r)]; 28495 case 3: 28496 return [2, { 28497 installationEntry: n, 28498 registrationPromise: e 28499 }] 28500 } 28501 }) 28502 }) 28503 } 28504 28505 function wO(t) { 28506 return mO(t, function (t) { 28507 if (!t) throw HP.create("installation-not-found"); 28508 return _O(t) 28509 }) 28510 } 28511 28512 function _O(t) { 28513 return 1 === (e = t).registrationStatus && e.registrationTime + qP < Date.now() ? { 28514 fid: t.fid, 28515 registrationStatus: 0 28516 } : t; 28517 var e 28518 } 28519 28520 function IO(t, s) { 28521 var a = t.appConfig, 28522 u = t.platformLoggerProvider; 28523 return $i(this, void 0, void 0, function () { 28524 var e, n, r, i, o; 28525 return Zi(this, function (t) { 28526 switch (t.label) { 28527 case 0: 28528 return e = function (t, e) { 28529 e = e.fid; 28530 return zP(t) + "/" + e + "/authTokens:generate" 28531 }(a, s), n = JP(a, s), (o = u.getImmediate({ 28532 optional: !0 28533 })) && n.append("x-firebase-client", o.getPlatformInfoString()), o = { 28534 installation: { 28535 sdkVersion: VP 28536 } 28537 },
28537r = { 28538 method: "POST", 28539 headers: n, 28540 body: JSON.stringify(o) 28541 }, [4, $P(function () { 28542 return fetch(e, r) 28543 })]; 28544 case 1: 28545 return (i = t.sent()).ok ? [4, i.json()] : [3, 3]; 28546 case 2: 28547 return o = t.sent(), [2, QP(o)]; 28548 case 3: 28549 return [4, YP("Generate Auth Token", i)]; 28550 case 4: 28551 throw t.sent() 28552 } 28553 }) 28554 }) 28555 } 28556 28557 function TO(i, o) { 28558 return void 0 === o && (o = !1), $i(this, void 0, void 0, function () { 28559 var r, e, n; 28560 return Zi(this, function (t) { 28561 switch (t.label) { 28562 case 0: 28563 return [4, mO(i.appConfig, function (t) { 28564 if (!SO(t)) throw HP.create("not-registered"); 28565 var e, n = t.authToken; 28566 if (o || 2 !== (e = n).requestStatus || function (t) { 28567 var e = Date.now(); 28568 return e < t.creationTime || t.creationTime + t.expiresIn < e + WP 28569 }(e)) { 28570 if (1 === n.requestStatus) return r = function (n, r) { 28571 return $i(this, void 0, void 0, function () { 28572 var e; 28573 return Zi(this, function (t) { 28574 switch (t.label) { 28575 case 0: 28576 return [4, EO(n.appConfig)]; 28577 case 1: 28578 e = t.sent(), t.label = 2; 28579 case 2: 28580 return 1 !== e.authToken.requestStatus ? [3, 5] : [4, ZP(100)]; 28581 case 3: 28582 return t.sent(), [4, EO(n.appConfig)]; 28583 case 4: 28584 return e = t.sent(), [3, 2]; 28585 case 5: 28586 return 0 === (e = e.authToken).requestStatus ? [2, TO(n, r)] : [2, e] 28587 } 28588 }) 28589 }) 28590 }(i, o), t; 28591 if (!navigator.onLine) throw HP.create("app-offline"); 28592 n = (e = t, n = { 28593 requestStatus: 1, 28594 requestTime: Date.now() 28595 }, Ji(Ji({}, e), { 28596 authToken: n 28597 })); 28598 return r = function (i, o) { 28599 return $i(this, void 0, void 0, function () { 28600 var e, n, r; 28601 return Zi(this, function (t) { 28602 switch (t.label) { 28603 case 0: 28604 return t.trys.push([0, 3, , 8]), [4, IO(i, o)]; 28605 case 1: 28606 return e = t.sent(), r = Ji(Ji({}, o), { 28607 authToken: e 28608 }), [4, gO(i.appConfig, r)]; 28609 case 2: 28610 return t.sent(), [2, e]; 28611 case 3: 28612 return !GP(n = t.sent()) || 401 !== n.customData.serverCode && 404 !== n.customData.serverCode ? [3, 5] : [4, yO(i.appConfig)]; 28613 case 4: 28614 return t.sent(), [3, 7]; 28615 case 5: 28616 return r = Ji(Ji({}, o), { 28617 authToken: { 28618 requestStatus: 0 28619 } 28620 }), [4, gO(i.appConfig, r)]; 28621 case 6: 28622 t.sent(), t.label = 7; 28623 case 7: 28624 throw n; 28625 case 8: 28626 return [2] 28627 } 28628 }) 28629 }) 28630 }(i, n), n 28631 } 28632 return t 28633 })]; 28634 case 1: 28635 return e = t.sent(), r ? [4, r] : [3, 3]; 28636 case 2: 28637 return n = t.sent(), [3, 4]; 28638 case 3: 28639 n = e.authToken, t.label = 4; 28640 case 4: 28641 return [2, n] 28642 } 28643 }) 28644 }) 28645 } 28646 28647 function EO(t) { 28648 return mO(t, function (t) { 28649 if (!SO(t)) throw HP.create("not-registered"); 28650 var e = t.authToken; 28651 return 1 === (e = e).requestStatus && e.requestTime + qP < Date.now() ? Ji(Ji({}, t), {
28652 authToken: { 28653 requestStatus: 0 28654 } 28655 }) : t 28656 }) 28657 } 28658 28659 function SO(t) { 28660 return void 0 !== t && 2 === t.registrationStatus 28661 } 28662 28663 function CO(e, n) { 28664 return void 0 === n && (n = !1), $i(this, void 0, void 0, function () { 28665 return Zi(this, function (t) { 28666 switch (t.label) { 28667 case 0: 28668 return [4, function (n) { 28669 return $i(this, void 0, void 0, function () { 28670 var e; 28671 return Zi(this, function (t) { 28672 switch (t.label) { 28673 case 0: 28674 return [4, bO(n)]; 28675 case 1: 28676 return (e = t.sent().registrationPromise) ? [4, e] : [3, 3]; 28677 case 2: 28678 t.sent(), t.label = 3; 28679 case 3: 28680 return [2] 28681 } 28682 }) 28683 }) 28684 }(e.appConfig)]; 28685 case 1: 28686 return t.sent(), [4, TO(e, n)]; 28687 case 2: 28688 return [2, t.sent().token] 28689 } 28690 }) 28691 }) 28692 } 28693 28694 function NO(i, o) { 28695 return $i(this, void 0, void 0, function () { 28696 var e, n, r; 28697 return Zi(this, function (t) { 28698 switch (t.label) { 28699 case 0: 28700 return e = function (t, e) { 28701 e = e.fid; 28702 return zP(t) + "/" + e 28703 }(i, o), r = JP(i, o), n = { 28704 method: "DELETE", 28705 headers: r 28706 }, [4, $P(function () { 28707 return fetch(e, n) 28708 })]; 28709 case 1: 28710 return (r = t.sent()).ok ? [3, 3] : [4, YP("Delete Installation", r)]; 28711 case 2: 28712 throw t.sent(); 28713 case 3: 28714 return [2] 28715 } 28716 }) 28717 }) 28718 } 28719 28720 function AO(t, r) { 28721 var i = t.appConfig; 28722 return function (t, e) { 28723 uO(); 28724 var n = rO(t); 28725 (t = iO.get(n)) || (t = new Set, iO.set(n, t)), t.add(e) 28726 }(i, r), 28727 function () { 28728 var t, e, n; 28729 e = r, n = rO(t = i), (t = iO.get(n)) && (t.delete(e), 0 === t.size && iO.delete(n), cO()) 28730 } 28731 } 28732 28733 function kO(t) { 28734 return HP.create("missing-app-config-values", { 28735 valueName: t 28736 }) 28737 }(hO = Xl).INTERNAL.registerComponent(new ts("installations", function (t) { 28738 var e = t.getProvider("app").getImmediate(), 28739 n = { 28740 appConfig: function (t) { 28741 var e, n; 28742 if (!t || !t.options) throw kO("App Configuration"); 28743 if (!t.name) throw kO("App Name"); 28744 try { 28745 for (var r = to(["projectId", "apiKey", "appId"]), i = r.next(); !i.done; i = r.next()) { 28746 var o = i.value; 28747 if (!t.options[o]) throw kO(o) 28748 } 28749 } catch (t) { 28750 e = { 28751 error: t 28752 } 28753 } finally { 28754 try { 28755 i && !i.done && (n = r.return) && n.call(r) 28756 } finally { 28757 if (e) throw e.error 28758 } 28759 } 28760 return { 28761 appName: t.name, 28762 projectId: t.options.projectId, 28763 apiKey: t.options.apiKey, 28764 appId: t.options.appId 28765 } 28766 }(e), 28767 platformLoggerProvider: t.getProvider("platform-logger") 28768 }; 28769 return { 28770 app: e, 28771 getId: function () { 28772 return function (r) { 28773 return $i(this, void 0, void 0, function () { 28774 var e, n; 28775 return Zi(this, function (t) { 28776 switch (t.label) { 28777 case 0: 28778 return [4, bO(r.appConfig)]; 28779 case 1: 28780 return e = t.sent(), n = e.installationEntry, (e.registrationPromise || TO(r)).catch(console.error), [2, n.fid] 28781 } 28782 }) 28783 }) 28784 }(n) 28785 }, 28786 getToken: function (t) { 28787 return CO(n, t) 28788 }, 28789 delete: function () { 28790 return function (r) { 28791 return $i(this, void 0, void 0, function () { 28792 var e, n; 28793 return Zi(this, function (t) { 28794 switch (t.label) { 28795 case 0: 28796 return [4, mO(e = r.appConfig, function (t) { 28797 if (!t || 0 !== t.registrationStatus) return t 28798 })]; 28799 case 1: 28800 if (!(n = t.sent())) return [3, 6]; 28801 if (1 !== n.registrationStatus) return [3, 2]; 28802 throw HP.create("delete-pending-registration"); 28803 case 2: 28804 if (2 !== n.registrationStatus) return [3, 6]; 28805 if (navigator.onLine) return [3, 3]; 28806 throw HP.create("app-offline"); 28807 case 3: 28808 return [4, NO(e, n)]; 28809 case 4: 28810 return t.sent(), [4, yO(e)]; 28811 case 5: 28812 t.sent(), t.label = 6; 28813 case 6: 28814 return [2] 28815 } 28816 }) 28817 }) 28818 }(n) 28819 }, 28820 onIdChange: function (t) { 28821 return AO(n, t) 28822 } 28823 } 28824 }, "PUBLIC")), hO.registerVersion("@firebase/installations", "0.4.23"); 28825 var RO, Sn = ((Ga = {})["missing-app-config-values"] = 'Missing App configuration value: "{$valueName}"', Ga["only-available-in-window"] = "This method is available in a Window context.", Ga["only-available-in-sw"] = "This method is available in a service worker context.", Ga["permission-default"] = "The notification permission was not granted and dismissed instead.", Ga["permission-blocked"] = "The notification permission was not granted and blocked instead.", Ga["unsupported-browser"] = "This browser doesn't support the API's required to use the firebase SDK.", Ga["failed-service-worker-registration"] = "We are unable to register the default service worker. {$browserErrorMessage}", Ga["token-subscribe-failed"] = "A problem occurred while subscribing the user to FCM: {$errorInfo}", Ga["token-subscribe-no-token"] = "FCM returned no token when subscribing the user to push.", Ga["token-unsubscribe-failed"] = "A problem occurred while unsubscribing the user from FCM: {$errorInfo}", Ga["token-update-failed"] = "A problem occurred while updating the user from FCM: {$errorInfo}", Ga["token-update-no-token"] = "FCM returned no token when updating the user to push.", Ga["use-sw-after-get-token"] = "The useServiceWorker() method may only be called once and must be called before calling getToken() to ensure your service worker is used.", Ga["invalid-sw-registration"] = "The input to useServiceWorker() must be a ServiceWorkerRegistration.", Ga["invalid-bg-handler"] = "The input to setBackgroun
28825dMessageHandler() must be a function.", Ga["invalid-vapid-key"] = "The public VAPID key must be a string.", Ga["use-vapid-key-after-get-token"] = "The usePublicVapidKey() method may only be called once and must be called before calling getToken() to ensure your VAPID key is used.", Ga), 28826 PO = new Co("messaging", "Messaging", Sn), 28827 OO = "BDOU99-h67HcA6JeFXHbSNMu7e2yNNu3RzoMj8TM4W88jITfq7ZmPvIM1Iv-4_l2LxQcYwhqby2xGpWwzjfAnG4", 28828 DO = "https://fcmregistrations.googleapis.com/v1", 28829 xO = "FCM_MSG", 28830 LO = "google.c.a.c_id"; 28831 28832 function MO(t) { 28833 t = new Uint8Array(t); 28834 return btoa(String.fromCharCode.apply(String, no([], eo(t)))).replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_") 28835 }(Ga = RO = RO || {}).PUSH_RECEIVED = "push-received", Ga.NOTIFICATION_CLICKED = "notification-clicked"; 28836 var FO = "fcm_token_details_db", 28837 UO = 5, 28838 jO = "fcm_token_object_Store"; 28839 28840 function qO(s) { 28841 return $i(this, void 0, void 0, function () { 28842 var e, o, n = this; 28843 return Zi(this, function (t) { 28844 switch (t.label) { 28845 case 0: 28846 return "databases" in indexedDB ? [4, indexedDB.databases()] : [3, 2]; 28847 case 1: 28848 if (e = t.sent(), !e.map(function (t) { 28849 return t.name 28850 }).includes(FO)) return [2, null]; 28851 t.label = 2; 28852 case 2: 28853 return o = null, [4, UP(FO, UO, function (i) { 28854 return $i(n, void 0, void 0, function () { 28855 var e, n, r; 28856 return Zi(this, function (t) { 28857 switch (t.label) { 28858 case 0: 28859 return i.oldVersion < 2 ? [2] : i.objectStoreNames.contains(jO) ? [4, (r = i.transaction.objectStore(jO)).index("fcmSenderId").get(s)] : [2]; 28860 case 1: 28861 return e = t.sent(), [4, r.clear()]; 28862 case 2: 28863 if (t.sent(), !e) return [2]; 28864 if (2 === i.oldVersion) { 28865 if (!(n = e).auth || !n.p256dh || !n.endpoint) return [2]; 28866 o = { 28867 token: n.fcmToken, 28868 createTime: null !== (r = n.createTime) && void 0 !== r ? r : Date.now(), 28869 subscriptionOptions: { 28870 auth: n.auth, 28871 p256dh: n.p256dh, 28872 endpoint: n.endpoint, 28873 swScope: n.swScope, 28874 vapidKey: "string" == typeof n.vapidKey ? n.vapidKey : MO(n.vapidKey) 28875 } 28876 } 28877 } else(3 === i.oldVersion || 4 === i.oldVersion) && (o = { 28878 token: (n = e).fcmToken, 28879 createTime: n.createTime, 28880 subscriptionOptions: { 28881 auth: MO(n.auth), 28882 p256dh: MO(n.p256dh), 28883 endpoint: n.endpoint, 28884 swScope: n.swScope, 28885 vapidKey: MO(n.vapidKey) 28886 } 28887 }); 28888 return [2] 28889 } 28890 }) 28891 }) 28892 })]; 28893 case 3: 28894 return t.sent().close(), [4, jP(FO)]; 28895 case 4: 28896 return t.sent(), [4, jP("fcm_vapid_details_db")]; 28897 case 5: 28898 return t.sent(), [4, jP("undefined")]; 28899 case 6: 28900 return t.sent(), [2, function (t) { 28901 if (!t || !t.subscriptionOptions) return !1; 28902 var e = t.subscriptionOptions; 28903 return "number" == typeof t.createTime && 0 < t.createTime && "string" == typeof t.token && 0 < t.token.length && "string" == typeof e.auth && 0 < e.auth.length && "string" == typeof e.p256dh && 0 < e.p256dh.length && "string" == typeof e.endpoint && 0 < e.endpoint.length && "string" == typeof e.swScope && 0 < e.swScope.length && "string" == typeof e.vapidKey && 0 < e.vapidKey.length 28904 }(o) ? o : null] 28905 } 28906 }) 28907 }) 28908 } 28909 var VO = "firebase-messaging-database", 28910 BO = 1, 28911 KO = "firebase-messaging-store", 28912 WO = null; 28913 28914 function HO() {
28915 return WO = WO || UP(VO, BO, function (t) { 28916 0 === t.oldVersion && t.createObjectStore(KO) 28917 }) 28918 } 28919 28920 function GO(r) { 28921 return $i(this, void 0, void 0, function () { 28922 var e, n; 28923 return Zi(this, function (t) { 28924 switch (t.label) { 28925 case 0: 28926 return e = QO(r), [4, HO()]; 28927 case 1: 28928 return [4, t.sent().transaction(KO).objectStore(KO).get(e)]; 28929 case 2: 28930 return (e = t.sent()) ? [2, e] : [3, 3]; 28931 case 3: 28932 return [4, qO(r.appConfig.senderId)]; 28933 case 4: 28934 return (n = t.sent()) ? [4, zO(r, n)] : [3, 6]; 28935 case 5: 28936 return t.sent(), [2, n]; 28937 case 6: 28938 return [2] 28939 } 28940 }) 28941 }) 28942 } 28943 28944 function zO(r, i) { 28945 return $i(this, void 0, void 0, function () { 28946 var e, n; 28947 return Zi(this, function (t) { 28948 switch (t.label) { 28949 case 0: 28950 return e = QO(r), [4, HO()]; 28951 case 1: 28952 return n = t.sent(), [4, (n = n.transaction(KO, "readwrite")).objectStore(KO).put(i, e)]; 28953 case 2: 28954 return t.sent(), [4, n.complete]; 28955 case 3: 28956 return t.sent(), [2, i] 28957 } 28958 }) 28959 }) 28960 } 28961 28962 function QO(t) { 28963 return t.appConfig.appId 28964 } 28965 28966 function YO(r, i) { 28967 return $i(this, void 0, void 0, function () { 28968 var e, n; 28969 return Zi(this, function (t) { 28970 switch (t.label) { 28971 case 0: 28972 return [4, JO(r)]; 28973 case 1: 28974 e = t.sent(), e = { 28975 method: "DELETE", 28976 headers: e 28977 }, t.label = 2; 28978 case 2: 28979 return t.trys.push([2, 5, , 6]), [4, fetch(XO(r.appConfig) + "/" + i, e)]; 28980 case 3: 28981 return [4, t.sent().json()]; 28982 case 4: 28983 if ((e = t.sent()).error) throw n = e.error.message, PO.create("token-unsubscribe-failed", { 28984 errorInfo: n 28985 }); 28986 return [3, 6]; 28987 case 5: 28988 throw n = t.sent(), PO.create("token-unsubscribe-failed", { 28989 errorInfo: n 28990 }); 28991 case 6: 28992 return [2] 28993 } 28994 }) 28995 }) 28996 } 28997 28998 function XO(t) { 28999 t = t.projectId; 29000 return DO + "/projects/" + t + "/registrations" 29001 } 29002 29003 function JO(t) { 29004 var n = t.appConfig, 29005 r = t.installations; 29006 return $i(this, void 0, void 0, function () { 29007 var e; 29008 return Zi(this, function (t) { 29009 switch (t.label) { 29010 case 0: 29011 return [4, r.getToken()]; 29012 case 1: 29013 return e = t.sent(), [2, new Headers({ 29014 "Content-Type": "application/json", 29015 Accept: "application/json", 29016 "x-goog-api-key": n.apiKey, 29017 "x-goog-firebase-installations-auth": "FIS " + e 29018 })] 29019 } 29020 }) 29021 }) 29022 } 29023 29024 function $O(t) { 29025 var e = t.p256dh, 29026 n = t.auth, 29027 r = t.endpoint, 29028 t = t.vapidKey, 29029 e = { 29030 web: { 29031 endpoint: r, 29032 auth: n, 29033 p256dh: e 29034 } 29035 }; 29036 return t !== OO && (e.web.applicationPubKey = t), e 29037 } 29038 29039 function ZO(c, h, l) { 29040 return $i(this, void 0, void 0, function () { 29041 var s, a, u; 29042 return Zi(this, function (t) { 29043 switch (t.label) { 29044 case 0: 29045 if ("granted" !== Notification.permission) throw PO.create("permission-blocked"); 29046 return [4, function (n, r) { 29047 return $i(this, void 0, void 0, function () { 29048 var e; 29049 return Zi(this, function (t) { 29050 switch (t.label) { 29051 case 0: 29052 return [4, n.pushManager.getSubscription()]; 29053 case 1: 29054 return (e = t.sent()) ? [2, e] : [2, n.pushManager.subscribe({ 29055 userVisibleOnly: !0, 29056 applicationServerKey: function (t) { 29057 for (var t = (t + "=".repeat((4 - t.length % 4) % 4)).replace(/\-/g, "+").replace(/_/g, "/"), e = atob(t), n = new Uint8Array(e.length), r = 0; r < e.length; ++r) n[r] = e.charCodeAt(r); 29058 return n 29059 }(r) 29060 })] 29061 } 29062 }) 29063 }) 29064 }(h, l)]; 29065 case 1: 29066 return u = t.sent(), [4, GO(c)]; 29067 case 2: 29068 return s = t.sent(), a = { 29069 vapidKey: l, 29070 swScope: h.scope, 29071 endpoint: u.endpoint, 29072 auth: MO(u.getKey("auth")), 29073 p256dh: MO(u.getKey("p256dh")) 29074 }, s ? [3, 3] : [2, eD(c, a)]; 29075 case 3: 29076 if (e = s.subscriptionOptions, r = (n = a).vapidKey === e.vapidKey, i = n.endpoint === e.endpoint, o = n.auth === e.auth, e = n.p256dh === e.p256dh, r && i && o && e) return [3, 8]; 29077 t.label = 4; 29078 case 4: 29079 return t.trys.push([4, 6, , 7]), [4, YO(c, s.token)]; 29080 case 5: 29081 return t.sent(), [3, 7]; 29082 case 6: 29083 return u = t.sent(), console.warn(u), [3, 7]; 29084 case 7: 29085 return [2, eD(c, a)]; 29086 case 8: 29087 return Date.now() >= s.createTime + 6048e5 ? [2, function (i, o, s) { 29088 return $i(this, void 0, void 0, function () { 29089 var e, n, r; 29090 return Zi(this, function (t) { 29091 switch (t.label) { 29092 case 0: 29093 return t.trys.push([0, 3, , 5]), [4, function (o, s) { 29094 return $i(this, void 0, void 0, function () { 29095 var e, n, r, i; 29096 return Zi(this, function (t) { 29097 switch (t.label) { 29098 case 0: 29099 return [4, JO(o)]; 29100 case 1: 29101 e = t.sent(), n = $O(s.subscriptionOptions), n = { 29102 method: "PATCH", 29103 headers: e, 29104 body: JSON.stringify(n) 29105 }, t.label = 2; 29106 case 2: 29107 return t.trys.push([2, 5, , 6]), [4, fetch(XO(o.appConfig) + "/" + s.token, n)]; 29108 case 3: 29109 return [4, t.sent().json()]; 29110 case 4: 29111 return r = t.sent(), [3, 6]; 29112 case 5: 29113 throw i = t.sent(), PO.create("token-update-failed", { 29114 errorInfo: i 29115 }); 29116 case 6: 29117 if (r.error) throw i = r.error.message, PO.create("token-update-failed", { 29118 errorInfo: i 29119 }); 29120 if (!r.token) throw PO.create("token-update-no-token"); 29121 return [2, r.token] 29122 } 29123 }) 29124 }) 29125 }(o, i)]; 29126 case 1: 29127 return e = t.sent(), n = Ji(Ji({}, i), { 29128 token: e, 29129 createTime: Date.now() 29130 }), [4, zO(o, n)]; 29131 case 2: 29132 return t.sent(), [2, e]; 29133 case 3: 29134 return r = t.sent(), [4, tD(o, s)]; 29135 case 4: 29136 throw t.sent(), r; 29137 case 5: 29138 return [2] 29139 } 29140 }) 29141 }) 29142 }({ 29143 token: s.token, 29144 createTime: Date.now(), 29145 subscriptionOptions: a 29146 }, c, h)] : [2, s.token]; 29147 case 9: 29148 return [2] 29149 } 29150 var e, n, r, i, o 29151 }) 29152 }) 29153 } 29154 29155 function tD(n, r) { 29156 return $i(this, void 0, void 0, function () { 29157 var e; 29158 return Zi(this, function (t) { 29159 switch (t.label) { 29160 case 0: 29161 return [4, GO(n)]; 29162 case 1: 29163 return (e = t.sent()) ? [4, YO(n, e.token)] : [3, 4]; 29164 case 2: 29165 return t.sent(), [4, function (r) { 29166 return $i(this, void 0, void 0, function () { 29167 var e, n; 29168 return Zi(this, function (t) { 29169 switch (t.label) { 29170 case 0: 29171 return e = QO(r), [4, HO()]; 29172 case 1: 29173 return n = t.sent(), [4, (n = n.transaction(KO, "readwrite")).objectStore(KO).delete(e)]; 29174 case 2: 29175 return t.sent(), [4, n.complete]; 29176 case 3: 29177 return t.sent(), [2] 29178 } 29179 }) 29180 }) 29181 }(n)]; 29182 case 3: 29183 t.sent(), t.label = 4; 29184 case 4: 29185 return [4, r.pushManager.getSubscription()]; 29186 case 5: 29187 return (e = t.sent()) ? [2, e.unsubscribe()] : [2, !0] 29188 } 29189 }) 29190 }) 29191 } 29192 29193 function eD(n, r) { 29194 return $i(this, void 0, void 0, function () { 29195 var e; 29196 return Zi(this, function (t) { 29197 switch (t.label) { 29198 case 0: 29199 return [4, function (o, s) { 29200 return $i(this, void 0, void 0, function () { 29201 var e, n, r, i; 29202 return Zi(this, function (t) { 29203 switch (t.label) { 29204 case 0: 29205 return [4, JO(o)]; 29206 case 1: 29207 e = t.sent(), n = $O(s), n = { 29208 method: "POST", 29209 headers: e, 29210 body: JSON.stringify(n) 29211 }, t.label = 2; 29212 case 2: 29213 return t.trys.push([2, 5, , 6]), [4, fetch(XO(o.appConfig), n)]; 29214 case 3: 29215 return [4, t.sent().json()]; 29216 case 4: 29217 return r = t.sent(), [3, 6]; 29218 case 5: 29219 throw i = t.sent(), PO.create("token-subscribe-failed", { 29220 errorInfo: i 29221 }); 29222 case 6: 29223 if (r.error) throw i = r.error.message, PO.create("token-subscribe-failed", { 29224 errorInfo: i 29225 }); 29226 if (!r.token) throw PO.create("token-subscribe-no-token"); 29227 return [2, r.token] 29228 } 29229 }) 29230 }) 29231 }(n, r)]; 29232 case 1: 29233 return e = t.sent(), e = { 29234 token: e, 29235 createTime: Date.now(), 29236 subscriptionOptions: r 29237 }, [4, zO(n, e)]; 29238 case 2: 29239 return t.sent(), [2, e.token] 29240 } 29241 }) 29242 }) 29243 } 29244 29245 function nD(t) { 29246 var e = { 29247 from: t.from, 29248 collapseKey: t.collapse_key 29249 }; 29250 return function (t, e) { 29251 if (!e.notification) return; 29252 t.notification = {}; 29253 var n = e.notification.title; 29254 n && (t.notification.title = n); 29255 n = e.notification.body; 29256 n && (t.notification.body = n); 29257 e = e.notification.image; 29258 e && (t.notification.image = e) 29259 }(e, t), 29260 function (t, e) { 29261 if (!e.data) return; 29262 t.data = e.data 29263 }(e, t), 29264 function (t, e) { 29265 if (!e.fcmOptions) return; 29266 t.fcmOptions = {}; 29267 var n = e.fcmOptions.link; 29268 n && (t.fcmOptions.link = n); 29269 e = e.fcmOptions.analytics_label; 29270 e && (t.fcmOptions.analyticsLabel = e) 29271 }(e, t), e 29272
29272 } 29273 29274 function rD(t) { 29275 return "object" == typeof t && t && LO in t 29276 } 29277 29278 function iD(e) { 29279 return new Promise(function (t) { 29280 setTimeout(t, e) 29281 }) 29282 } 29283 var oD = (Object.defineProperty(sD.prototype, "app", { 29284 get: function () { 29285 return this.firebaseDependencies.app 29286 }, 29287 enumerable: !1, 29288 configurable: !0 29289 }), sD.prototype.setBackgroundMessageHandler = function (t) { 29290 if (this.isOnBackgroundMessageUsed = !1, !t || "function" != typeof t) throw PO.create("invalid-bg-handler"); 29291 this.bgMessageHandler = t 29292 }, sD.prototype.onBackgroundMessage = function (t) { 29293 var e = this; 29294 return this.isOnBackgroundMessageUsed = !0, this.bgMessageHandler = t, 29295 function () { 29296 e.bgMessageHandler = null 29297 } 29298 }, sD.prototype.getToken = function () { 29299 var n; 29300 return $i(this, void 0, void 0, function () { 29301 var e; 29302 return Zi(this, function (t) { 29303 switch (t.label) { 29304 case 0: 29305 return this.vapidKey ? [3, 2] : [4, GO(this.firebaseDependencies)]; 29306 case 1: 29307 e = t.sent(), this.vapidKey = null !== (n = null === (n = null == e ? void 0 : e.subscriptionOptions) || void 0 === n ? void 0 : n.vapidKey) && void 0 !== n ? n : OO, t.label = 2; 29308 case 2: 29309 return [2, ZO(this.firebaseDependencies, self.registration, this.vapidKey)] 29310 } 29311 }) 29312 }) 29313 }, sD.prototype.deleteToken = function () { 29314 return tD(this.firebaseDependencies, self.registration) 29315 }, sD.prototype.requestPermission = function () { 29316 throw PO.create("only-available-in-window") 29317 }, sD.prototype.usePublicVapidKey = function (t) { 29318 if (null !== this.vapidKey) throw PO.create("use-vapid-key-after-get-token"); 29319 if ("string" != typeof t || 0 === t.length) throw PO.create("invalid-vapid-key"); 29320 this.vapidKey = t 29321 }, sD.prototype.useServiceWorker = function () { 29322 throw PO.create("only-available-in-window") 29323 }, sD.prototype.onMessage = function () { 29324 throw PO.create("only-available-in-window") 29325 }, sD.prototype.onTokenRefresh = function () { 29326 throw PO.create("only-available-in-window") 29327 }, sD.prototype.onPush = function (a) { 29328 return $i(this, void 0, void 0, function () { 29329 var i, o, s; 29330 return Zi(this, function (t) { 29331 switch (t.label) { 29332 case 0: 29333 return (s = function (t) { 29334 var e = t.data; 29335 if (!e) return null; 29336 try { 29337 return e.json() 29338 } catch (t) { 29339 return null 29340 } 29341 }(a)) ? [4, aD()] : (console.debug("FirebaseMessaging: failed to get parsed MessagePayload from the PushEvent. Skip handling the push."), [2]); 29342 case 1: 29343 return (i = t.sent(), i.some(function (t) { 29344 return "visible" === t.visibilityState && !t.url.startsWith("chrome-extension://") 29345 })) ? [2, function (t, e) { 29346 var n, r; 29347 e.isFirebaseMessaging = !0, e.messageType = RO.PUSH_RECEIVED; 29348 try { 29349 for (var i = to(t), o = i.next(); !o.done; o = i.next()) o.value.postMessage(e) 29350 } catch (t) { 29351 n = { 29352 error: t 29353 } 29354 } finally { 29355 try { 29356 o && !o.done && (r = i.return) && r.call(i) 29357 } finally { 29358 if (n) throw n.error 29359 } 29360 } 29361 }(i, s)] : (o = !1, s.notification ? [4, function (t) { 29362 var e = t.actions, 29363 n = Notification.maxActions; 29364 e && n && e.length > n && console.warn("This browser only supports " + n + " actions. The remaining actions will not be displayed."); 29365 return self.registration.showNotification(null !== (n = t.title) && void 0 !== n ? n : "", t) 29366 }(((r = Ji({}, (e = s).notification)).data = ((n = {})[xO] = e, n), r))] : [3, 3]); 29367 case 2: 29368 t.sent(), o = !0, t.label = 3; 29369 case 3: 29370 return !0 === o && !1 === this.isOnBackgroun
29370dMessageUsed ? [2] : (this.bgMessageHandler && (s = nD(s), "function" == typeof this.bgMessageHandler ? this.bgMessageHandler(s) : this.bgMessageHandler.next(s)), [4, iD(1e3)]); 29371 case 4: 29372 return t.sent(), [2] 29373 } 29374 var e, n, r 29375 }) 29376 }) 29377 }, sD.prototype.onSubChange = function (n) { 29378 var r; 29379 return $i(this, void 0, void 0, function () { 29380 var e; 29381 return Zi(this, function (t) { 29382 switch (t.label) { 29383 case 0: 29384 return n.newSubscription ? [3, 2] : [4, tD(this.firebaseDependencies, self.registration)]; 29385 case 1: 29386 return t.sent(), [2]; 29387 case 2: 29388 return [4, GO(this.firebaseDependencies)]; 29389 case 3: 29390 return e = t.sent(), [4, tD(this.firebaseDependencies, self.registration)]; 29391 case 4: 29392 return t.sent(), [4, ZO(this.firebaseDependencies, self.registration, null !== (r = null === (r = null == e ? void 0 : e.subscriptionOptions) || void 0 === r ? void 0 : r.vapidKey) && void 0 !== r ? r : OO)]; 29393 case 5: 29394 return t.sent(), [2] 29395 } 29396 }) 29397 }) 29398 }, sD.prototype.onNotificationClick = function (s) { 29399 var a; 29400 return $i(this, void 0, void 0, function () { 29401 var e, n, r, i, o; 29402 return Zi(this, function (t) { 29403 switch (t.label) { 29404 case 0: 29405 return (e = null === (a = null === (a = s.notification) || void 0 === a ? void 0 : a.data) || void 0 === a ? void 0 : a[xO]) ? s.action ? [2] : (s.stopImmediatePropagation(), s.notification.close(), (n = function (t) { 29406 var e, n = null !== (e = null === (e = t.fcmOptions) || void 0 === e ? void 0 : e.link) && void 0 !== e ? e : null === (n = t.notification) || void 0 === n ? void 0 : n.click_action; 29407 if (n) return n; 29408 return rD(t.data) ? self.location.origin : null 29409 }(e)) ? (r = new URL(n, self.location.href), i = new URL(self.location.origin), r.host !== i.host ? [2] : [4, function (u) { 29410 return $i(this, void 0, void 0, function () { 29411 var e, n, r, i, o, s, a; 29412 return Zi(this, function (t) { 29413 switch (t.label) { 29414 case 0: 29415 return [4, aD()]; 29416 case 1: 29417 e = t.sent(); 29418 try { 29419 for (n = to(e), r = n.next(); !r.done; r = n.next()) 29420 if (i = r.value, o = new URL(i.url, self.location.href), u.host === o.host) return [2, i] 29421 } catch (t) { 29422 s = { 29423 error: t 29424 } 29425 } finally { 29426 try { 29427 r && !r.done && (a = n.return) && a.call(n) 29428 } finally { 29429 if (s) throw s.error 29430 } 29431 } 29432 return [2, null] 29433 } 29434 }) 29435 }) 29436 }(r)]) : [2]) : [2]; 29437 case 1: 29438 return (o = t.sent()) ? [3, 4] : [4, self.clients.openWindow(n)]; 29439 case 2: 29440 return o = t.sent(), [4, iD(3e3)]; 29441 case 3: 29442 return t.sent(), [3, 6]; 29443 case 4: 29444 return [4, o.focus()]; 29445 case 5: 29446 o = t.sent(), t.label = 6; 29447 case 6: 29448 return o ? (e.messageType = RO.NOTIFICATION_CLICKED, e.isFirebaseMessaging = !0, [2, o.postMessage(e)]) : [2] 29449 } 29450 }) 29451 }) 29452 }, sD); 29453 29454 function sD(t) { 29455 var e = this;
29456 this.firebaseDependencies = t, this.isOnBackgroundMessageUsed = null, this.vapidKey = null, this.bgMessageHandler = null, self.addEventListener("push", function (t) { 29457 t.waitUntil(e.onPush(t)) 29458 }), self.addEventListener("pushsubscriptionchange", function (t) { 29459 t.waitUntil(e.onSubChange(t)) 29460 }), self.addEventListener("notificationclick", function (t) { 29461 t.waitUntil(e.onNotificationClick(t)) 29462 }) 29463 } 29464 29465 function aD() { 29466 return self.clients.matchAll({ 29467 type: "window", 29468 includeUncontrolled: !0 29469 }) 29470 } 29471 var uD = (Object.defineProperty(cD.prototype, "app", { 29472 get: function () { 29473 return this.firebaseDependencies.app 29474 }, 29475 enumerable: !1, 29476 configurable: !0 29477 }), cD.prototype.messageEventListener = function (i) { 29478 return $i(this, void 0, void 0, function () { 29479 var n, r; 29480 return Zi(this, function (t) { 29481 switch (t.label) { 29482 case 0: 29483 return (n = i.data).isFirebaseMessaging ? (this.onMessageCallback && n.messageType === RO.PUSH_RECEIVED && ("function" == typeof this.onMessageCallback ? this.onMessageCallback((delete(e = Object.assign({}, n)).messageType, delete e.isFirebaseMessaging, e)) : this.onMessageCallback.next(Object.assign({}, n))), rD(r = n.data) && "1" === r["google.c.a.e"] ? [4, this.logEvent(n.messageType, r)] : [3, 2]) : [2]; 29484 case 1: 29485 t.sent(), t.label = 2; 29486 case 2: 29487 return [2] 29488 } 29489 var e 29490 }) 29491 }) 29492 }, cD.prototype.getVapidKey = function () { 29493 return this.vapidKey 29494 }, cD.prototype.getSwReg = function () { 29495 return this.swRegistration 29496 }, cD.prototype.getToken = function (e) { 29497 return $i(this, void 0, void 0, function () { 29498 return Zi(this, function (t) { 29499 switch (t.label) { 29500 case 0: 29501 return "default" !== Notification.permission ? [3, 2] : [4, Notification.requestPermission()]; 29502 case 1: 29503 t.sent(), t.label = 2; 29504 case 2: 29505 if ("granted" !== Notification.permission) throw PO.create("permission-blocked"); 29506 return [4, this.updateVapidKey(null == e ? void 0 : e.vapidKey)]; 29507 case 3: 29508 return t.sent(), [4, this.updateSwReg(null == e ? void 0 : e.serviceWorkerRegistration)]; 29509 case 4: 29510 return t.sent(), [2, ZO(this.firebaseDependencies, this.swRegistration, this.vapidKey)] 29511 } 29512 }) 29513 }) 29514 }, cD.prototype.updateVapidKey = function (e) { 29515 return $i(this, void 0, void 0, function () { 29516 return Zi(this, function (t) { 29517 return e ? this.vapidKey = e : this.vapidKey || (this.vapidKey = OO), [2] 29518 }) 29519 }) 29520 }, cD.prototype.updateSwReg = function (e) { 29521 return $i(this, void 0, void 0, function () { 29522 return Zi(this, function (t) { 29523 switch (t.label) { 29524 case 0: 29525 return e || this.swRegistration ? [3, 2] : [4, this.registerDefaultSw()]; 29526 case 1: 29527 t.sent(), t.label = 2; 29528 case 2: 29529 if (!e && this.swRegistration) return [2]; 29530 if (!(e instanceof ServiceWorkerRegistration)) throw PO.create("invalid-sw-registration"); 29531 return this.swRegistration = e, [2] 29532 } 29533 }) 29534 }) 29535 }, cD.prototype.registerDefaultSw = function () { 29536 return $i(this, void 0, void 0, function () { 29537 var e; 29538 return Zi(this, function (t) { 29539 switch (t.label) { 29540 case 0: 29541 return t.trys.push([0, 2, , 3]), e = this, [4, navigator.serviceWorker.register(firebaseServiceWorkerPath, {
29542 scope: firebaseServiceWorkerScope 29543 })]; 29544 case 1: 29545 return e.swRegistration = t.sent(), this.swRegistration.update().catch(function () {}), [3, 3]; 29546 case 2: 29547 throw e = t.sent(), PO.create("failed-service-worker-registration", { 29548 browserErrorMessage: e.message 29549 }); 29550 case 3: 29551 return [2] 29552 } 29553 }) 29554 }) 29555 }, cD.prototype.deleteToken = function () { 29556 return $i(this, void 0, void 0, function () { 29557 return Zi(this, function (t) { 29558 switch (t.label) { 29559 case 0: 29560 return this.swRegistration ? [3, 2] : [4, this.registerDefaultSw()]; 29561 case 1: 29562 t.sent(), t.label = 2; 29563 case 2: 29564 return [2, tD(this.firebaseDependencies, this.swRegistration)] 29565 } 29566 }) 29567 }) 29568 }, cD.prototype.requestPermission = function () { 29569 return $i(this, void 0, void 0, function () { 29570 var e; 29571 return Zi(this, function (t) { 29572 switch (t.label) { 29573 case 0: 29574 return "granted" === Notification.permission ? [2] : [4, Notification.requestPermission()]; 29575 case 1: 29576 if ("granted" === (e = t.sent())) return [2]; 29577 throw "denied" === e ? PO.create("permission-blocked") : PO.create("permission-default") 29578 } 29579 }) 29580 }) 29581 }, cD.prototype.usePublicVapidKey = function (t) { 29582 if (null !== this.vapidKey) throw PO.create("use-vapid-key-after-get-token"); 29583 if ("string" != typeof t || 0 === t.length) throw PO.create("invalid-vapid-key"); 29584 this.vapidKey = t 29585 }, cD.prototype.useServiceWorker = function (t) { 29586 if (!(t instanceof ServiceWorkerRegistration)) throw PO.create("invalid-sw-registration"); 29587 if (this.swRegistration) throw PO.create("use-sw-after-get-token"); 29588 this.swRegistration = t 29589 }, cD.prototype.onMessage = function (t) { 29590 var e = this; 29591 return this.onMessageCallback = t, 29592 function () { 29593 e.onMessageCallback = null 29594 } 29595 }, cD.prototype.setBackgroundMessageHandler = function () { 29596 throw PO.create("only-available-in-sw") 29597 }, cD.prototype.onBackgroundMessage = function () { 29598 throw PO.create("only-available-in-sw") 29599 }, cD.prototype.onTokenRefresh = function () { 29600 return function () {} 29601 }, cD.prototype.logEvent = function (n, r) { 29602 return $i(this, void 0, void 0, function () { 29603 var e; 29604 return Zi(this, function (t) { 29605 switch (t.label) { 29606 case 0: 29607 return e = function (t) { 29608 switch (t) { 29609 case RO.NOTIFICATION_CLICKED: 29610 return "notification_open"; 29611 case RO.PUSH_RECEIVED: 29612 return "notification_foreground"; 29613 default: 29614 throw new Error 29615 } 29616 }(n), [4, this.firebaseDependencies.analyticsProvider.get()]; 29617 case 1: 29618 return t.sent().logEvent(e, { 29619 message_id: r[LO], 29620 message_name: r["google.c.a.c_l"], 29621 message_time: r["google.c.a.ts"], 29622 message_device_time: Math.floor(Date.now() / 1e3) 29623 }), [2] 29624 } 29625 }) 29626 }) 29627 }, cD); 29628 29629 function cD(t) { 29630 var e = this; 29631 this.firebaseDependencies = t, this.vapidKey = null, this.onMessageCallback = null, navigator.serviceWorker.addEventListener("message", function (t) { 29632 return e.messageEventListener(t) 29633 }) 29634 } 29635 29636 function hD(t) { 29637 return PO.create("missing-app-config-values", { 29638 valueName: t 29639 }) 29640 } 29641 Sn = { 29642 isSupported: lD 29643 }; 29644 29645 function lD() { 29646 return self && "ServiceWorkerGlobalScope" in self ? "indexedDB" in self && null !== indexedDB && "PushManager" in self && "Notification" in self && ServiceWorkerRegistration.prototype.hasOwnProperty("showNotification") && PushSub
29646scription.prototype.hasOwnProperty("getKey") : "indexedDB" in window && null !== indexedDB && navigator.cookieEnabled && "serviceWorker" in navigator && "PushManager" in window && "Notification" in window && "fetch" in window && ServiceWorkerRegistration.prototype.hasOwnProperty("showNotification") && PushSubscription.prototype.hasOwnProperty("getKey") 29647 } 29648 Xl.INTERNAL.registerComponent(new ts("messaging", function (t) { 29649 var e = t.getProvider("app").getImmediate(), 29650 t = { 29651 app: e, 29652 appConfig: function (t) { 29653 var e, n; 29654 if (!t || !t.options) throw hD("App Configuration Object"); 29655 if (!t.name) throw hD("App Name"); 29656 var r = t.options; 29657 try { 29658 for (var i = to(["projectId", "apiKey", "appId", "messagingSenderId"]), o = i.next(); !o.done; o = i.next()) { 29659 var s = o.value; 29660 if (!r[s]) throw hD(s) 29661 } 29662 } catch (t) { 29663 e = { 29664 error: t 29665 } 29666 } finally { 29667 try { 29668 o && !o.done && (n = i.return) && n.call(i) 29669 } finally { 29670 if (e) throw e.error 29671 } 29672 } 29673 return { 29674 appName: t.name, 29675 projectId: r.projectId, 29676 apiKey: r.apiKey, 29677 appId: r.appId, 29678 senderId: r.messagingSenderId 29679 } 29680 }(e), 29681 installations: t.getProvider("installations").getImmediate(), 29682 analyticsProvider: t.getProvider("analytics-internal") 29683 }; 29684 if (!lD()) throw PO.create("unsupported-browser"); 29685 return new(self && "ServiceWorkerGlobalScope" in self ? oD : uD)(t) 29686 }, "PUBLIC").setServiceProps(Sn)); 29687 var fD, pD = "firebasestorage.googleapis.com", 29688 dD = "storageBucket", 29689 vD = (Xi(gD, fD = Eo), gD.prototype._codeEquals = function (t) { 29690 return yD(t) === this.code 29691 }, Object.defineProperty(gD.prototype, "message", { 29692 get: function () { 29693 return this.customData.serverResponse ? this.message + "\n" + this.customData.serverResponse : this.message 29694 }, 29695 enumerable: !1, 29696 configurable: !0 29697 }), Object.defineProperty(gD.prototype, "serverResponse", { 29698 get: function () { 29699 return this.customData.serverResponse 29700 }, 29701 set: function (t) { 29702 this.customData.serverResponse = t 29703 }, 29704 enumerable: !1, 29705 configurable: !0 29706 }), gD); 29707 29708 function gD(t, e) { 29709 t = fD.call(this, yD(t), "Firebase Storage: " + e + " (" + yD(t) + ")") || this; 29710 return t.customData = { 29711 serverResponse: null 29712 }, Object.setPrototypeOf(t, gD.prototype), t 29713 } 29714 29715 function yD(t) { 29716 return "storage/" + t 29717 } 29718 29719 function mD() { 29720 return new vD("unknown", "An unknown error occurred, please check the error payload for server response.") 29721 } 29722 29723 function bD() { 29724 return new vD("canceled", "User canceled the upload/download.") 29725 } 29726 29727 function wD() { 29728 return new vD("cannot-slice-blob", "Cannot slice blob for upload. Please retry the upload.") 29729 } 29730 29731 function _D(t) { 29732 return new vD("invalid-argument", t) 29733 } 29734 29735 function ID() { 29736 return new vD("app-deleted", "The Firebase app was deleted.") 29737 } 29738 29739 function TD(t) { 29740 return new vD("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').") 29741 } 29742 29743 function ED(t, e) { 29744 return new vD("invalid-format", "String does not match format '" + t + "': " + e) 29745 } 29746 29747 function SD(t) { 29748 throw new vD("internal-error", "Internal error: " + t) 29749 } 29750 var CD = { 29751 RAW: "raw", 29752 BASE64: "base64", 29753 BASE64URL: "base64url", 29754 DATA_URL: "data_url" 29755 }, 29756 ND = function (t, e) { 29757 this.data = t, this.contentType = e || null 29758 }; 29759 29760 function AD(t, e) { 29761 switch (t) { 29762 case CD.RAW: 29763 return new ND(kD(e)); 29764 case CD.BASE64: 29765 case CD.BASE64URL: 29766 return new ND(RD(t, e)); 29767 case CD.DATA_URL: 29768 return new ND(function (t) { 29769 t = new PD(t); 29770 return t.base64 ? RD(CD.BASE64, t.rest) : function (t) { 29771 var e; 29772 try { 29773 e = decodeURIComponent(t) 29774 } catch (t) { 29775 throw ED(CD.DATA_URL, "Malformed data URL.") 29776 } 29777 return kD(e) 29778 }(t.rest) 29779 }(e), new PD(e).contentType) 29780 } 29781 throw mD() 29782 } 29783 29784 function kD(t) { 29785 for (var e = [], n = 0; n < t.length; n++) { 29786 var r = t.charCodeAt(n); 29787 r <= 127 ? e.push(r) : r <= 2047 ? e.push(192 | r >> 6, 128 | 63 & r) : 55296 == (64512 & r) ? n < t.length - 1 && 56320 == (64512 & t.charCodeAt(n + 1)) ? (r = 65536 | (1023 & r) << 10 | 1023 & t.charCodeAt(++n), e.push(240 | r >> 18, 128 | r >> 12 & 63, 128 | r >> 6 & 63, 128 | 63 & r)) : e.push(239, 191, 189) : 56320 == (64512 & r) ? e.push(239, 191, 189) : e.push(224 | r >> 12, 128 | r >> 6 & 63, 128 | 63 & r) 29788 } 29789 return new Uint8Array(e) 29790 } 29791 29792 function RD(e, t) { 29793 switch (e) { 29794 case CD.BASE64: 29795 var n = -1 !== t.indexOf("-"), 29796 r = -1 !== t.indexOf("_"); 29797 if (n || r) throw ED(e, "Invalid character '" + (n ? "-" : "_") + "' found: is it base64url encoded?"); 29798 break; 29799 case CD.BASE64URL: 29800 r = -1 !== t.indexOf("+"), n = -1 !== t.indexOf("/"); 29801 if (r || n) throw ED(e, "Invalid character '" + (r ? "+" : "/") + "' found: is it base64 encoded?"); 29802 t = t.replace(/-/g, "+").replace(/_/g, "/") 29803 } 29804 var i; 29805 try { 29806 i = atob(t) 29807 } catch (t) { 29808 throw ED(e, "Invalid character found") 29809 } 29810 for (var o = new Uint8Array(i.length), s = 0; s < i.length;
29810 s++) o[s] = i.charCodeAt(s); 29811 return o 29812 } 29813 var PD = function (t) { 29814 var e; 29815 if (this.base64 = !1, (this.contentType = null) === (e = t.match(/^data:([^,]+)?,/))) throw ED(CD.DATA_URL, "Must be formatted 'data:[<mediatype>][;base64],<data>"); 29816 var n, r = e[1] || null; 29817 null != r && (this.base64 = (n = ";base64", (e = r).length >= n.length && e.substring(e.length - n.length) === n), this.contentType = this.base64 ? r.substring(0, r.length - ";base64".length) : r), this.rest = t.substring(t.indexOf(",") + 1) 29818 }; 29819 var OD, DD = { 29820 STATE_CHANGED: "state_changed" 29821 }, 29822 xD = { 29823 RUNNING: "running", 29824 PAUSED: "paused", 29825 SUCCESS: "success", 29826 CANCELED: "canceled", 29827 ERROR: "error" 29828 }; 29829 29830 function LD(t) { 29831 switch (t) { 29832 case "running": 29833 case "pausing": 29834 case "canceling": 29835 return xD.RUNNING; 29836 case "paused": 29837 return xD.PAUSED; 29838 case "success": 29839 return xD.SUCCESS; 29840 case "canceled": 29841 return xD.CANCELED; 29842 case "error": 29843 default: 29844 return xD.ERROR 29845 } 29846 }(Ga = OD = OD || {})[Ga.NO_ERROR = 0] = "NO_ERROR", Ga[Ga.NETWORK_ERROR = 1] = "NETWORK_ERROR", Ga[Ga.ABORT = 2] = "ABORT"; 29847 var MD = (FD.prototype.send = function (t, e, n, r) { 29848 if (this.sent_) throw SD("cannot .send() more than once"); 29849 if (this.sent_ = !0, this.xhr_.open(e, t, !0), void 0 !== r) 29850 for (var i in r) r.hasOwnProperty(i) && this.xhr_.setRequestHeader(i, r[i].toString()); 29851 return void 0 !== n ? this.xhr_.send(n) : this.xhr_.send(), this.sendPromise_ 29852 }, FD.prototype.getErrorCode = function () { 29853 if (!this.sent_) throw SD("cannot .getErrorCode() before sending"); 29854 return this.errorCode_ 29855 }, FD.prototype.getStatus = function () { 29856 if (!this.sent_) throw SD("cannot .getStatus() before sending"); 29857 try { 29858 return this.xhr_.status 29859 } catch (t) { 29860 return -1 29861 } 29862 }, FD.prototype.getResponseText = function () { 29863 if (!this.sent_) throw SD("cannot .getResponseText() before sending"); 29864 return this.xhr_.responseText 29865 }, FD.prototype.abort = function () { 29866 this.xhr_.abort() 29867 }, FD.prototype.getResponseHeader = function (t) { 29868 return this.xhr_.getResponseHeader(t) 29869 }, FD.prototype.addUploadProgressListener = function (t) { 29870 null != this.xhr_.upload && this.xhr_.upload.addEventListener("progress", t) 29871 }, FD.prototype.removeUploadProgressListener = function (t) { 29872 null != this.xhr_.upload && this.xhr_.upload.removeEventListener("progress", t) 29873 }, FD); 29874 29875 function FD() { 29876 var e = this; 29877 this.sent_ = !1, this.xhr_ = new XMLHttpRequest, this.errorCode_ = OD.NO_ERROR, this.sendPromise_ = new Promise(function (t) { 29878 e.xhr_.addEventListener("abort", function () { 29879 e.errorCode_ = OD.ABORT, t(e) 29880 }), e.xhr_.addEventListener("error", function () { 29881 e.errorCode_ = OD.NETWORK_ERROR, t(e) 29882 }), e.xhr_.addEventListener("load", function () { 29883 t(e) 29884 }) 29885 }) 29886 } 29887 var UD = (jD.prototype.createXhrIo = function () { 29888 return new MD 29889 }, jD); 29890 29891 function jD() {} 29892 var qD = (Object.defineProperty(VD.prototype, "path", { 29893 get: function () { 29894 return this.path_ 29895 }, 29896 enumerable: !1, 29897 configurable: !0 29898 }), Object.defineProperty(VD.prototype, "isRoot", { 29899 get: function () { 29900 return 0 === this.path.length 29901 }, 29902 enumerable: !1, 29903 configurable: !0 29904 }), VD.prototype.fullServerUrl = function () { 29905 var t = encodeURIComponent; 29906 return "/b/" + t(this.bucket) + "/o/" + t(this.path) 29907 }, VD.prototype.bucketOnlyServerUrl = function () { 29908 return "/b/" + encodeURIComponent(this.bucket) + "/o" 29909 }, VD.makeFromBucketSpec = function (e) { 29910 var t; 29911 try { 29912 t = VD.makeFromUrl(e) 29913 } catch (t) { 29914 return new VD(e, "") 29915 } 29916 if ("" === t.path) return t; 29917 throw new vD("invalid-default-bucket", "Invalid default bucket '" + e + "'.") 29918 }, VD.makeFromUrl = function (t) { 29919 var e = null, 29920 n = "([A-Za-z0-9.\\-_]+)"; 29921 var r = new RegExp("^gs://" + n + "(/(.*))?$", "i"); 29922 29923 function i(t) { 29924 t.path_ = decodeURIComponent(t.path) 29925 } 29926 for (var o = pD.replace(/[.]/g, "\\."), s = [{ 29927 regex: r, 29928 indices: { 29929 bucket: 1, 29930 path: 3 29931 }, 29932 postModify: function (t) { 29933 "/" === t.path.charAt(t.path.length - 1) && (t.path_ = t.path_.slice(0, -1)) 29934 } 29935 }, { 29936 regex: new RegExp("^https?://" + o + "/v[A-Za-z0-9_]+/b/" + n + "/o(/([^?#]*).*)?$", "i"), 29937 indices: { 29938 bucket: 1, 29939 path: 3 29940 }, 29941 postModify: i 29942 }, { 29943 regex: new RegExp("^https?://(?:storage.googleapis.com|storage.cloud.google.com)/" + n + "/([^?#]*)", "i"), 29944 indices: { 29945 bucket: 1, 29946 path: 2 29947 }, 29948 postModify: i 29949 }], a = 0; a < s.length; a++) { 29950 var u = s[a], 29951 c = u.regex.exec(t); 29952 if (c) { 29953 e = new VD(c[u.indices.bucket], c[u.indices.path] || ""); 29954 u.postModify(e); 29955 break 29956 } 29957 } 29958 if (null == e) throw new vD("invalid-url", "Invalid URL '" + t + "'."); 29959 return e 29960 }, VD); 29961 29962 function VD(t, e) { 29963 this.bucket = t, this.path_ = e 29964 } 29965 var BD = (KD.prototype.getPromise = function () { 29966 return this.promise_ 29967 }, KD.prototype.cancel = function (t) {}, KD); 29968 29969 function KD(t) { 29970 this.promise_ = Promise.reject(t) 29971 } 29972 29973 function WD(t) { 29974 return "string" == typeof t || t instanceof String 29975 } 29976 29977 function HD(t) { 29978 return GD() && t instanceof Blob 29979 } 29980 29981 function GD() { 29982 return "undefined" != typeof Blob 29983 } 29984 29985 function zD(t, e, n, r) { 29986 if (r < e) throw _D("Invalid value for '" + t + "'. Expected " + e + " or greater."); 29987 if (n < r) throw _D("Invalid value for '" + t + "'. Expected " + n + " or less.") 29988 } 29989 29990 function QD(t) { 29991 return "https://" + pD + "/v0" + t 29992 } 29993 29994 function YD(t) { 29995 var e, n = encodeURIComponent, 29996 r = "?"; 29997 for (e in t) t.hasOwnProperty(e) && (r = r + (n(e) + "=" + n(t[e])) + "&"); 29998 return r = r.slice(0, -1) 29999 } 30000 var XD = (JD.prototype.start_ = function () { 30001 var e, n, t, r, i, o, s, a, u, c = this; 30002 30003 function h(t, e) { 30004 var n, r = c.resolve_, 30005 i = c.reject_, 30006 o = e.xhr; 30007 if (e.wasSuccessCode) try { 30008 var s = c.callback_(o, o.getResponseText()); 30009 void 0 !== s ? r(s) : r() 30010 } catch (t) { 30011 i(t) 30012 } else null !== o ? ((n = mD()).serverResponse = o.getResponseText(), c.errorCallback_ ? i(c.errorCallback_(o, n)) : i(n)) : e.canceled ? i(n = (c.appDelete_ ? ID : bD)()) : i(n = new vD("retry-limit-exceeded", "Max retry time for operation exceeded, please try again.")) 30013 } 30014 30015 function l() { 30016 return 2 === s 30017 } 30018 30019 function f() { 30020 for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e]; 30021 a || (a = !0, n.apply(null, t)) 30022 } 30023 30024 function p(t) { 30025 i = setTimeout(function () { 30026 i = null, e(d, l()) 30027 }, t) 30028 } 30029 30030 function d(t) { 30031 for (var e = [], n = 1; n < arguments.length; n++) e[n - 1] = arguments[n]; 30032 a || (t || l() || o ? f.call.apply(f, no([null, t], e)) : (r < 64 && (r *= 2), p(1 === s ? (s = 2, 0) : 1e3 * (r + Math.random())))) 30033 } 30034 30035 function v(t) { 30036 u || (u = !0, a || (null !== i ? (t || (s = 2), clearTimeout(i), p(0)) : t || (s = 1))) 30037 } 30038 this.canceled_ ? h(0, new $D(!1, null, !0)) : this.backoffId_ = (e = function (r, t) { 30039 function i(t) { 30040 var e = t.loaded, 30041 t = t.lengthComputable ? t.total : -1; 30042 null !== c.progressCallback_ && c.progressCallback_(e, t) 30043 } 30044 t ? r(!1, new $D(!1, null, !0)) : (t = c.pool_.createXhrIo(), c.pendingXhr_ = t, null !== c.progressCallback_ && t.addUploadProgressListener(i), t.send(c.url_, c.method_, c.body_, c.headers_).then(function (t) { 30045 null !== c.progressCallback_ && t.removeUploadProgressListener(i), c.pendingXhr_ = null; 30046 var e = t.getErrorCode() === OD.NO_ERROR, 30047 n = t.getStatus(); 30048 e && !c.isRetryStatusCode_(n) ? (n = -1 !== c.successCodes_.indexOf(n), r(!0, new $D(n, t))) : (t = t.getErrorCode() === OD.ABORT, r(!1, new $D(!1, null, t))) 30049 })) 30050 }, n = h, t = this.timeout_, i = null, u = a = o = !(r = 1), p(s = 0), setTimeout(function () { 30051 o = !0, v(!0) 30052 }, t), v) 30053 }, JD.prototype.getPromise = function () { 30054 return this.promise_ 30055 }, JD.prototype.cancel = function (t) { 30056 this.canceled_ = !0, this.appDelete_ = t || !1, null !== this.backoffId_ && (0, this.backoffId_)(!1), null !== this.pendingXhr_ && this.pendingXhr_.abort() 30057 }, JD.prototype.isRetryStatusCode_ = function (t) { 30058 var e = 500 <= t && t < 600, 30059 n = -1 !== [408, 429].indexOf(t), 30060 t = -1 !== this.additionalRetryCodes_.indexOf(t); 30061 return e || n || t 30062 }, JD); 30063 30064 function JD(t, e, n, r, i, o, s, a, u, c, h) { 30065 var l = this; 30066 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_ = s, this.errorCallback_ = a, this.progressCallback_ = c, this.timeout_ = u, this.pool_ = h, this.promise_ = new Promise(function (t, e) { 30067 l.resolve_ = t, l.reject_ = e, l.start_() 30068 }) 30069 } 30070 var $D = function (t, e, n) { 30071 this.wasSuccessCode = t, this.xhr = e, this.canceled = !!n 30072 }; 30073 30074 function ZD() { 30075 for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e]; 30076 var n = "undefined" != typeof BlobBuilder ? BlobBuilder : "undefined" != typeof WebKitBlobBuilder ? WebKitBlobBuilder : void 0; 30077 if (void 0 !== n) { 30078 for (var r = new n, i = 0; i < t.length; i++) r.append(t[i]); 30079 return r.getBlob() 30080 } 30081 if (GD()) return new Blob(t); 30082 throw new vD("unsupported-environment", "This browser doesn't seem to supp
30082ort creating Blobs") 30083 } 30084 var tx = (ex.prototype.size = function () { 30085 return this.size_ 30086 }, ex.prototype.type = function () { 30087 return this.type_ 30088 }, ex.prototype.slice = function (t, e) { 30089 if (HD(this.data_)) { 30090 var n = this.data_, 30091 r = (i = t, r = e, (n = n).webkitSlice ? n.webkitSlice(i, r) : n.mozSlice ? n.mozSlice(i, r) : n.slice ? n.slice(i, r) : null); 30092 return null === r ? null : new ex(r) 30093 } 30094 var i, r; 30095 return new ex(new Uint8Array(this.data_.buffer, t, e - t), !0) 30096 }, ex.getBlob = function () { 30097 for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e]; 30098 if (GD()) { 30099 var n = t.map(function (t) { 30100 return t instanceof ex ? t.data_ : t 30101 }); 30102 return new ex(ZD.apply(null, n)) 30103 } 30104 var n = t.map(function (t) { 30105 return WD(t) ? AD(CD.RAW, t).data : t.data_ 30106 }), 30107 r = 0; 30108 n.forEach(function (t) { 30109 r += t.byteLength 30110 }); 30111 var i = new Uint8Array(r), 30112 o = 0; 30113 return n.forEach(function (t) { 30114 for (var e = 0; e < t.length; e++) i[o++] = t[e] 30115 }), new ex(i, !0) 30116 }, ex.prototype.uploadData = function () { 30117 return this.data_ 30118 }, ex); 30119 30120 function ex(t, e) { 30121 var n = 0, 30122 r = ""; 30123 HD(t) ? (n = (this.data_ = 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 30124 } 30125 30126 function nx(t) { 30127 var e, n; 30128 try { 30129 e = JSON.parse(t) 30130 } catch (t) { 30131 return null 30132 } 30133 return "object" != typeof (n = e) || Array.isArray(n) ? null : e 30134 } 30135 30136 function rx(t) { 30137 var e = t.lastIndexOf("/", t.length - 2); 30138 return -1 === e ? t : t.slice(e + 1) 30139 } 30140 30141 function ix(t, e) { 30142 return e 30143 } 30144 var ox = function (t, e, n, r) { 30145 this.server = t, this.local = e || t, this.writable = !!n, this.xform = r || ix 30146 }, 30147 sx = null; 30148 30149 function ax() { 30150 if (sx) return sx; 30151 var t = []; 30152 t.push(new ox("bucket")), t.push(new ox("generation")), t.push(new ox("metageneration")), t.push(new ox("name", "fullPath", !0)); 30153 var e = new ox("name"); 30154 e.xform = function (t, e) { 30155 return !WD(e = e) || e.length < 2 ? e : rx(e) 30156 }, t.push(e); 30157 e = new ox("size"); 30158 return e.xform = function (t, e) { 30159 return void 0 !== e ? Number(e) : e 30160 }, t.push(e), t.push(new ox("timeCreated")), t.push(new ox("updated")), t.push(new ox("md5Hash", null, !0)), t.push(new ox("cacheControl", null, !0)), t.push(new ox("contentDisposition", null, !0)), t.push(new ox("contentEncoding", null, !0)), t.push(new ox("contentLanguage", null, !0)), t.push(new ox("contentType", null, !0)), t.push(new ox("metadata", "customMetadata", !0)), sx = t 30161 } 30162 30163 function ux(n, r) { 30164 Object.defineProperty(n, "ref", { 30165 get: function () { 30166 var t = n.bucket, 30167 e = n.fullPath, 30168 e = new qD(t, e); 30169 return r._makeStorageReference(e) 30170 } 30171 }) 30172 } 30173 30174 function cx(t, e, n) { 30175 e = nx(e); 30176 if (null === e) return null; 30177 return function (t, e, n) { 30178 for (var r = { 30179 type: "file" 30180 }, i = n.length, o = 0; o < i; o++) { 30181 var s = n[o]; 30182 r[s.local] = s.xform(r, e[s.server]) 30183 } 30184 return ux(r, t), r 30185 }(t, e, n) 30186 } 30187 30188 function hx(t, e) { 30189 for (var n = {}, r = e.length, i = 0; i < r; i++) { 30190 var o = e[i]; 30191 o.writable && (n[o.server] = t[o.local]) 30192 } 30193 return JSON.stringify(n) 30194 } 30195 var lx = "prefixes", 30196 fx = "items"; 30197 30198 function px(t, e, n) { 30199 n = nx(n); 30200 if (null === n) return null; 30201 return function (t, e, n) { 30202 var r = { 30203 prefixes: [], 30204 items: [], 30205 nextPageToken: n.nextPageToken 30206 }; 30207 if (n[lx]) 30208 for (var i = 0, o = n[lx]; i < o.length; i++) { 30209 var s = o[i].replace(/\/$/, ""), 30210 a = t._makeStorageReference(new qD(e, s)); 30211 r.prefixes.push(a) 30212 } 30213 if (n[fx]) 30214 for (var u = 0, c = n[fx]; u < c.length; u++) { 30215 var h = c[u], 30216 a = t._makeStorageReference(new qD(e, h.name)); 30217 r.items.push(a) 30218 } 30219 return r 30220 }(t, e, n) 30221 } 30222 var dx = function (t, e, n, r) { 30223 this.url = t, this.method = e, this.handler = n, this.timeout = r, this.urlParam
30223s = {}, this.headers = {}, this.body = null, this.errorHandler = null, this.progressCallback = null, this.successCodes = [200], this.additionalRetryCodes = [] 30224 }; 30225 30226 function vx(t) { 30227 if (!t) throw mD() 30228 } 30229 30230 function gx(n, r) { 30231 return function (t, e) { 30232 return vx(null !== (e = cx(n, e, r))), e 30233 } 30234 } 30235 30236 function yx(n, r) { 30237 return function (t, e) { 30238 return vx(null !== (e = px(n, r, e))), e 30239 } 30240 } 30241 30242 function mx(r, i) { 30243 return function (t, e) { 30244 var n = cx(r, e, i); 30245 return vx(null !== n), 30246 function (r, t) { 30247 if (null === (t = nx(t))) return null; 30248 if (!WD(t.downloadTokens)) return null; 30249 if (0 === (t = t.downloadTokens).length) return null; 30250 var i = encodeURIComponent; 30251 return t.split(",").map(function (t) { 30252 var e = r.bucket, 30253 n = r.fullPath; 30254 return QD("/b/" + i(e) + "/o/" + i(n)) + YD({ 30255 alt: "media", 30256 token: t 30257 }) 30258 })[0] 30259 }(n, e) 30260 } 30261 } 30262 30263 function bx(i) { 30264 return function (t, e) { 30265 var n, r = 401 === t.getStatus() ? new vD("unauthenticated", "User is not authenticated, please authenticate using Firebase Authentication and try again.") : 402 === t.getStatus() ? (n = i.bucket, new vD("quota-exceeded", "Quota for bucket '" + n + "' exceeded, please view quota on https://firebase.google.com/pricing/.")) : 403 === t.getStatus() ? (r = i.path, new vD("unauthorized", "User does not have permission to access '" + r + "'.")) : e; 30266 return r.serverResponse = e.serverResponse, r 30267 } 30268 } 30269 30270 function wx(r) { 30271 var i = bx(r); 30272 return function (t, e) { 30273 var n = i(t, e); 30274 return 404 === t.getStatus() && (t = r.path, n = new vD("object-not-found", "Object '" + t + "' does not exist.")), n.serverResponse = e.serverResponse, n 30275 } 30276 } 30277 30278 function _x(t, e, n) { 30279 var r = QD(e.fullServerUrl()), 30280 i = t.maxOperationRetryTime, 30281 i = new dx(r, "GET", gx(t, n), i); 30282 return i.errorHandler = wx(e), i 30283 } 30284 30285 function Ix(t, e, n) { 30286 n = Object.assign({}, n); 30287 return n.fullPath = t.path, n.size = e.size(), n.contentType || (n.contentType = (t = e, (e = null) && e.contentType || t && t.type() || "application/octet-stream")), n 30288 } 30289 30290 function Tx(t, e, n, r, i) { 30291 var o = e.bucketOnlyServerUrl(), 30292 s = { 30293 "X-Goog-Upload-Protocol": "multipart" 30294 }; 30295 var a = function () { 30296 for (var t = "", e = 0; e < 2; e++) t += Math.random().toString().slice(2); 30297 return t 30298 }(); 30299 s["Content-Type"] = "multipart/related; boundary=" + a; 30300 var u = Ix(e, r, i), 30301 i = "--" + a + "\r\nContent-Type: application/json; charset=utf-8\r\n\r\n" + hx(u, n) + "\r\n--" + a + "\r\nContent-Type: " + u.contentType + "\r\n\r\n", 30302 a = "\r\n--" + a + "--", 30303 r = tx.getBlob(i, r, a); 30304 if (null === r) throw wD(); 30305 a = { 30306 name: u.fullPath 30307 }, u = QD(o), o = t.maxUploadRetryTime, o = new dx(u, "POST", gx(t, n), o); 30308 return o.urlParams = a, o.headers = s, o.body = r.uploadData(), o.errorHandler = bx(e), o 30309 } 30310 var Ex = function (t, e, n, r) { 30311 this.current = t, this.total = e, this.finalized = !!n, this.metadata = r || null 30312 }; 30313 30314 function Sx(t, e) { 30315 var n = null; 30316 try { 30317 n = t.getResponseHeader("X-Goog-Upload-Status") 30318 } catch (t) { 30319 vx(!1) 30320 } 30321 return vx(!!n && -1 !== (e || ["active"]).indexOf(n)), n 30322 } 30323 30324 function Cx(t, e, n, r, i) { 30325 var o = e.bucketOnlyServerUrl(), 30326 s = Ix(e, r, i), 30327 i = { 30328 name: s.fullPath 30329 }, 30330 o = QD(o), 30331 r = { 30332 "X-Goog-Upload-Protocol": "resumable", 30333 "X-Goog-Upload-Command": "start", 30334 "X-Goog-Upload-Header-Content-Length": r.size(), 30335 "X-Goog-Upload-Header-Content-Type": s.contentType, 30336 "Content-Type": "application/json; charset=utf-8" 30337 }, 30338 n = hx(s, n), 30339 t = t.maxUploadRetryTime; 30340 t = new dx(o, "POST", function (t) { 30341 var e; 30342 Sx(t); 30343 try { 30344 e = t.getResponseHeader("X-Goog-Upload-URL") 30345 } catch (t) { 30346 vx(!1) 30347 } 30348 return vx(WD(e)), e 30349 }, t);
30350 return t.urlParams = i, t.headers = r, t.body = n, t.errorHandler = bx(e), t 30351 } 30352 30353 function Nx(t, e, n, i) { 30354 t = t.maxUploadRetryTime, t = new dx(n, "POST", function (t) { 30355 var e = Sx(t, ["active", "final"]), 30356 n = null; 30357 try { 30358 n = t.getResponseHeader("X-Goog-Upload-Size-Received") 30359 } catch (t) { 30360 vx(!1) 30361 } 30362 n || vx(!1); 30363 var r = Number(n); 30364 return vx(!isNaN(r)), new Ex(r, i.size(), "final" === e) 30365 }, t); 30366 return t.headers = { 30367 "X-Goog-Upload-Command": "query" 30368 }, t.errorHandler = bx(e), t 30369 } 30370 30371 function Ax(t, o, e, s, n, a, r, i) { 30372 var u = new Ex(0, 0); 30373 if (r ? (u.current = r.current, u.total = r.total) : (u.current = 0, u.total = s.size()), s.size() !== u.total) throw new vD("server-file-wrong-size", "Server recorded incorrect upload file size, please retry the upload."); 30374 var c = u.total - u.current, 30375 h = c; 30376 0 < n && (h = Math.min(h, n)); 30377 r = u.current, n = r + h, c = { 30378 "X-Goog-Upload-Command": h === c ? "upload, finalize" : "upload", 30379 "X-Goog-Upload-Offset": u.current 30380 }, r = s.slice(r, n); 30381 if (null === r) throw wD(); 30382 n = o.maxUploadRetryTime, n = new dx(e, "POST", function (t, e) { 30383 var n = Sx(t, ["active", "final"]), 30384 r = u.current + h, 30385 i = s.size(), 30386 e = "final" === n ? gx(o, a)(t, e) : null; 30387 return new Ex(r, i, "final" === n, e) 30388 }, n); 30389 return n.headers = c, n.body = r.uploadData(), n.progressCallback = i || null, n.errorHandler = bx(t), n 30390 } 30391 var kx = function (t, e, n) { 30392 "function" == typeof t || null != e || null != n ? (this.next = t, this.error = e, this.complete = n) : (t = t, this.next = t.next, this.error = t.error, this.complete = t.complete) 30393 }; 30394 30395 function Rx(n) { 30396 return function () { 30397 for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e]; 30398 Promise.resolve().then(function () { 30399 return n.apply(void 0, t) 30400 }) 30401 } 30402 } 30403 var Px = (Ox.prototype._makeProgressCallback = function () { 30404 var e = this, 30405 n = this._transferred; 30406 return function (t) { 30407 return e._updateProgress(n + t) 30408 } 30409 }, Ox.prototype._shouldDoResumable = function (t) { 30410 return 262144 < t.size() 30411 }, Ox.prototype._start = function () { 30412 "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()) 30413 }, Ox.prototype._resolveToken = function (e) { 30414 var n = this; 30415 this._ref.storage._getAuthToken().then(function (t) { 30416 switch (n._state) { 30417 case "running": 30418 e(t); 30419 break; 30420 case "canceling": 30421 n._transition("canceled"); 30422 break; 30423 case "pausing": 30424 n._transition("paused") 30425 } 30426 }) 30427 }, Ox.prototype._createResumable = function () { 30428 var n = this; 30429 this._resolveToken(function (t) { 30430 var e = Cx(n._ref.storage, n._ref._location, n._mappings, n._blob, n._metadata), 30431 t = n._ref.storage._makeRequest(e, t); 30432 (n._request = t).getPromise().then(function (t) { 30433 n._request = void 0, n._uploadUrl = t, n._needToFetchStatus = !1, n.completeTransitions_() 30434 }, n._errorHandler) 30435 }) 30436 }, Ox.prototype._fetchStatus = function () { 30437 var n = this, 30438 r = this._uploadUrl; 30439 this._resolveToken(function (t) { 30440 var e = Nx(n._ref.storage, n._ref._location, r, n._blob), 30441 t = n._ref.storage._makeRequest(e, t); 30442 (n._request = t).getPromise().then(function (t) { 30443 n._request = void 0, n._updateProgress(t.current), n._needToFetchStatus = !1, t.finalized && (n._needToFetchMetadata = !0), n.completeTransitions_() 30444 }, n._errorHandler) 30445 }) 30446 }, Ox.prototype._continueUpload = function () { 30447 var n = this, 30448 r = 262144 * this._chunkMultiplier, 30449 i = new Ex(this._transferred, this._blob.size()), 30450 o = this._uploadUrl; 30451 this._resolveToken(function (t) { 30452 var e; 30453 try { 30454 e = Ax(n._ref._location, n._ref.storage, o, n._blob, r, n._mappings, i, n._makeProgressCallback()) 30455 } catch (t) { 30456 return n._error = t, void n._transition("error") 30457 }
30458 t = n._ref.storage._makeRequest(e, t); 30459 (n._request = t).getPromise().then(function (t) { 30460 n._increaseMultiplier(), n._request = void 0, n._updateProgress(t.current), t.finalized ? (n._metadata = t.metadata, n._transition("success")) : n.completeTransitions_() 30461 }, n._errorHandler) 30462 }) 30463 }, Ox.prototype._increaseMultiplier = function () { 30464 262144 * this._chunkMultiplier < 33554432 && (this._chunkMultiplier *= 2) 30465 }, Ox.prototype._fetchMetadata = function () { 30466 var n = this; 30467 this._resolveToken(function (t) { 30468 var e = _x(n._ref.storage, n._ref._location, n._mappings), 30469 t = n._ref.storage._makeRequest(e, t); 30470 (n._request = t).getPromise().then(function (t) { 30471 n._request = void 0, n._metadata = t, n._transition("success") 30472 }, n._metadataErrorHandler) 30473 }) 30474 }, Ox.prototype._oneShotUpload = function () { 30475 var n = this; 30476 this._resolveToken(function (t) { 30477 var e = Tx(n._ref.storage, n._ref._location, n._mappings, n._blob, n._metadata), 30478 t = n._ref.storage._makeRequest(e, t); 30479 (n._request = t).getPromise().then(function (t) { 30480 n._request = void 0, n._metadata = t, n._updateProgress(n._blob.size()), n._transition("success") 30481 }, n._errorHandler) 30482 }) 30483 }, Ox.prototype._updateProgress = function (t) { 30484 var e = this._transferred; 30485 this._transferred = t, this._transferred !== e && this._notifyObservers() 30486 }, Ox.prototype._transition = function (t) { 30487 if (this._state !== t) switch (t) { 30488 case "canceling": 30489 case "pausing": 30490 this._state = t, void 0 !== this._request && this._request.cancel(); 30491 break; 30492 case "running": 30493 var e = "paused" === this._state; 30494 this._state = t, e && (this._notifyObservers(), this._start()); 30495 break; 30496 case "paused": 30497 this._state = t, this._notifyObservers(); 30498 break; 30499 case "canceled": 30500 this._error = bD(), this._state = t, this._notifyObservers(); 30501 break; 30502 case "error": 30503 case "success": 30504 this._state = t, this._notifyObservers() 30505 } 30506 }, Ox.prototype.completeTransitions_ = function () { 30507 switch (this._state) { 30508 case "pausing": 30509 this._transition("paused"); 30510 break; 30511 case "canceling": 30512 this._transition("canceled"); 30513 break; 30514 case "running": 30515 this._start() 30516 } 30517 }, Object.defineProperty(Ox.prototype, "snapshot", { 30518 get: function () { 30519 var t = LD(this._state); 30520 return { 30521 bytesTransferred: this._transferred, 30522 totalBytes: this._blob.size(), 30523 state: t, 30524 metadata: this._metadata, 30525 task: this, 30526 ref: this._ref 30527 } 30528 }, 30529 enumerable: !1, 30530 configurable: !0 30531 }), Ox.prototype.on = function (t, e, n, r) { 30532 var i = this, 30533 o = new kx(e, n, r); 30534 return this._addObserver(o), 30535 function () { 30536 i._removeObserver(o) 30537 } 30538 }, Ox.prototype.then = function (t, e) { 30539 return this._promise.then(t, e) 30540 }, Ox.prototype.catch = function (t) { 30541 return this.then(null, t) 30542 }, Ox.prototype._addObserver = function (t) { 30543 this._observers.push(t), this._notifyObserver(t) 30544 }, Ox.prototype._removeObserver = function (t) { 30545 t = this._observers.indexOf(t); - 1 !== t && this._observers.splice(t, 1) 30546 }, Ox.prototype._notifyObservers = function () { 30547 var e = this; 30548 this._finishPromise(), this._observers.slice().forEach(function (t) { 30549 e._notifyObserver(t) 30550 }) 30551 }, Ox.prototype._finishPromise = function () { 30552 if (void 0 !== this._resolve) { 30553 var t = !0; 30554 switch (LD(this._state)) { 30555 case xD.SUCCESS: 30556 Rx(this._resolve.bind(null, this.snapshot))(); 30557 break; 30558 case xD.CANCELED: 30559 case xD.ERROR: 30560 Rx(this._reject.bind(null, this._error))(); 30561 break; 30562 default: 30563 t = !1 30564 } 30565 t && (this._resolve = void 0, this._reject = void 0) 30566 } 30567 }, Ox.prototype._notifyObserver = function (t) { 30568 switch (LD(this._state)) { 30569 case xD.RUNNING: 30570 case xD.PAUSED: 30571 t.next && Rx(t.next.bind(t, this.snapshot))(); 30572 break; 30573 case xD.SUCCESS: 30574 t.complete && Rx(t.complete.bind(t))(); 30575 break; 30576 case xD.CANCELED: 30577 case xD.ERROR: 30578 t.error && Rx(t.error.bind(t, this._error))(); 30579 break; 30580 default: 30581 t.error && Rx(t.error.bind(t, this._error))() 30582 } 30583 }, Ox.prototype.resume = function () { 30584 var t = "paused" === this._state || "pausing" === this._state; 30585 return t && this._transition("running"), t 30586 }, Ox.prototype.pause = function () { 30587 var t = "running" === this._state; 30588 return t && this._transition("pausing"), t 30589 }, Ox.prototype.cancel = function () { 30590 var t = "running" === this._state || "pausing" === this._state; 30591 return t && this._transition("canceling"), t 30592 }, Ox); 30593 30594 function Ox(t, e, n) { 30595 var r = this; 30596 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 = ax(), this._resumable = this._shouldDoResumable(this._blob), this._state = "running", this._errorHandler = function (t) { 30597 r._request = void 0, r._chunkMultiplier = 1, t._codeEquals("canceled") ? (r._needToFetchStatus = !0, r.completeTransitions_()) : (r._error = t, r._transition("error")) 30598 }, this._metadataErrorHandler = function (t) { 30599 r._request = void 0, t._codeEquals("canceled") ? r.completeTransitions_() : (r._error = t, r._transition("error")) 30600 }, this._promise = new Promise(function (t, e) { 30601 r._resolve = t, r._reject = e, r._start() 30602 }), this._promise.then(null, function () {}) 30603 } 30604 var Dx = (xx.prototype.toString = function () {
30605 return "gs://" + this._location.bucket + "/" + this._location.path 30606 }, xx.prototype._newRef = function (t, e) { 30607 return new xx(t, e) 30608 }, Object.defineProperty(xx.prototype, "root", { 30609 get: function () { 30610 var t = new qD(this._location.bucket, ""); 30611 return this._newRef(this._service, t) 30612 }, 30613 enumerable: !1, 30614 configurable: !0 30615 }), Object.defineProperty(xx.prototype, "bucket", { 30616 get: function () { 30617 return this._location.bucket 30618 }, 30619 enumerable: !1, 30620 configurable: !0 30621 }), Object.defineProperty(xx.prototype, "fullPath", { 30622 get: function () { 30623 return this._location.path 30624 }, 30625 enumerable: !1, 30626 configurable: !0 30627 }), Object.defineProperty(xx.prototype, "name", { 30628 get: function () { 30629 return rx(this._location.path) 30630 }, 30631 enumerable: !1, 30632 configurable: !0 30633 }), Object.defineProperty(xx.prototype, "storage", { 30634 get: function () { 30635 return this._service 30636 }, 30637 enumerable: !1, 30638 configurable: !0 30639 }), Object.defineProperty(xx.prototype, "parent", { 30640 get: function () { 30641 var t = function (t) { 30642 if (0 === t.length) return null; 30643 var e = t.lastIndexOf("/"); 30644 return -1 === e ? "" : t.slice(0, e) 30645 }(this._location.path); 30646 if (null === t) return null; 30647 t = new qD(this._location.bucket, t); 30648 return new xx(this._service, t) 30649 }, 30650 enumerable: !1, 30651 configurable: !0 30652 }), xx.prototype._throwIfRoot = function (t) { 30653 if ("" === this._location.path) throw TD(t) 30654 }, xx); 30655 30656 function xx(t, e) { 30657 this._service = t, this._location = e instanceof qD ? e : qD.makeFromUrl(e) 30658 } 30659 30660 function Lx(t) { 30661 var e = { 30662 prefixes: [], 30663 items: [] 30664 }; 30665 return function r(i, o, s) { 30666 return $i(this, void 0, void 0, function () { 30667 var e, n; 30668 return Zi(this, function (t) { 30669 switch (t.label) { 30670 case 0: 30671 return [4, Mx(i, { 30672 pageToken: s 30673 })]; 30674 case 1: 30675 return e = t.sent(), (n = o.prefixes).push.apply(n, e.prefixes), (n = o.items).push.apply(n, e.items), null == e.nextPageToken ? [3, 3] : [4, r(i, o, e.nextPageToken)]; 30676 case 2: 30677 t.sent(), t.label = 3; 30678 case 3: 30679 return [2] 30680 } 30681 }) 30682 }) 30683 }(t, e).then(function () { 30684 return e 30685 }) 30686 } 30687 30688 function Mx(c, h) { 30689 return $i(this, void 0, void 0, function () { 30690 var a, u; 30691 return Zi(this, function (t) { 30692 switch (t.label) { 30693 case 0: 30694 return null != h && "number" == typeof h.maxResults && zD("options.maxResults", 1, 1e3, h.maxResults), [4, c.storage._getAuthToken()]; 30695 case 1: 30696 return a = t.sent(), u = h || {}, e = c.storage, n = c._location, r = "/", i = u.pageToken, o = u.maxResults, s = {}, n.isRoot ? s.prefix = "" : s.prefix = n.path + "/", r && 0 < r.length && (s.delimiter = r), i && (s.pageToken = i), o && (s.maxResults = o), i = QD(n.bucketOnlyServerUrl()), o = e.maxOperationRetryTime, (o = new dx(i, "GET", yx(e, n.bucket), o)).urlParams = s, o.errorHandler = bx(n), [2, c.storage._makeRequest(o, a).getPromise()] 30697 } 30698 var e, n, r, i, o, s 30699 }) 30700 }) 30701 } 30702 30703 function Fx(u, c) { 30704 return $i(this, void 0, void 0, function () { 30705 var a; 30706 return Zi(this, function (t) { 30707 switch (t.label) { 30708 case 0: 30709 return u._throwIfRoot("updateMetadata"), [4, u.storage._getAuthToken()]; 30710 case 1: 30711 return a = t.sent(), e = u.storage, n = u._location, r = c, i = ax(), o = QD(n.fullServerUrl()), s = hx(r, i), r = e.maxOperationRetryTime, (r = new dx(o, "PATCH", gx(e, i), r)).headers = { 30712 "Content-Type": "application/json; charset=utf-8" 30713 }, r.body = s, r.errorHandler = wx(n), [2, u.storage._makeRequest
30713(r, a).getPromise()] 30714 } 30715 var e, n, r, i, o, s 30716 }) 30717 }) 30718 } 30719 30720 function Ux(a) { 30721 return $i(this, void 0, void 0, function () { 30722 var s; 30723 return Zi(this, function (t) { 30724 switch (t.label) { 30725 case 0: 30726 return a._throwIfRoot("getDownloadURL"), [4, a.storage._getAuthToken()]; 30727 case 1: 30728 return s = t.sent(), e = a.storage, n = a._location, r = ax(), i = QD(n.fullServerUrl()), o = e.maxOperationRetryTime, (o = new dx(i, "GET", mx(e, r), o)).errorHandler = wx(n), [2, a.storage._makeRequest(o, s).getPromise().then(function (t) { 30729 if (null === t) throw new vD("no-download-url", "The given file does not have any download URLs."); 30730 return t 30731 })] 30732 } 30733 var e, n, r, i, o 30734 }) 30735 }) 30736 } 30737 30738 function jx(o) { 30739 return $i(this, void 0, void 0, function () { 30740 var i; 30741 return Zi(this, function (t) { 30742 switch (t.label) { 30743 case 0: 30744 return o._throwIfRoot("deleteObject"), [4, o.storage._getAuthToken()]; 30745 case 1: 30746 return i = t.sent(), e = o.storage, n = o._location, r = QD(n.fullServerUrl()), e = e.maxOperationRetryTime, (e = new dx(r, "DELETE", function (t, e) {}, e)).successCodes = [200, 204], e.errorHandler = wx(n), [2, o.storage._makeRequest(e, i).getPromise()] 30747 } 30748 var e, n, r 30749 }) 30750 }) 30751 } 30752 30753 function qx(t, e) { 30754 var n, e = (n = t._location.path, e = (e = e).split("/").filter(function (t) { 30755 return 0 < t.length 30756 }).join("/"), 0 === n.length ? e : n + "/" + e), 30757 e = new qD(t._location.bucket, e); 30758 return new Dx(t.storage, e) 30759 } 30760 30761 function Vx(t) { 30762 return /^[A-Za-z]+:\/\//.test(t) 30763 } 30764 30765 function Bx(t, e) { 30766 if (t instanceof Wx) { 30767 var n = t; 30768 if (null == n._bucket) throw new vD("no-default-bucket", "No default bucket found. Did you set the '" + dD + "' property when initializing the app?"); 30769 n = new Dx(n, n._bucket); 30770 return null != e ? Bx(n, e) : n 30771 } 30772 if (void 0 === e) return t; 30773 if (e.includes("..")) throw _D('`path` param cannot contain ".."'); 30774 return qx(t, e) 30775 } 30776 30777 function Kx(t, e) { 30778 if (e && Vx(e)) { 30779 if (t instanceof Wx) return new Dx(t, e); 30780 throw _D("To use ref(service, url), the first argument must be a Storage instance.") 30781 } 30782 return Bx(t, e) 30783 } 30784 var Wx = (Object.defineProperty(Hx.prototype, "maxUploadRetryTime", { 30785 get: function () { 30786 return this._maxUploadRetryTime 30787 }, 30788 set: function (t) { 30789 zD("time", 0, Number.POSITIVE_INFINITY, t), this._maxUploadRetryTime = t 30790 }, 30791 enumerable: !1, 30792 configurable: !0 30793 }), Object.defineProperty(Hx.prototype, "maxOperationRetryTime", { 30794 get: function () { 30795 return this._maxOperationRetryTime 30796 }, 30797 set: function (t) { 30798 zD("time", 0, Number.POSITIVE_INFINITY, t), this._maxOperationRetryTime = t 30799 }, 30800 enumerable: !1, 30801 configurable: !0 30802 }), Hx.prototype._getAuthToken = function () { 30803 return $i(this, void 0, void 0, function () { 30804 var e; 30805 return Zi(this, function (t) { 30806 switch (t.label) { 30807 case 0: 30808 return (e = this._authProvider.getImmediate({ 30809 optional: !0 30810 })) ? [4, e.getToken()] : [3, 2]; 30811 case 1: 30812 if (null !== (e = t.sent())) return [2, e.accessToken]; 30813 t.label = 2; 30814 case 2: 30815 return [2, null] 30816 } 30817 }) 30818 }) 30819 }, Hx.prototype._delete = function () {
30820 return this._deleted = !0, this._requests.forEach(function (t) { 30821 return t.cancel() 30822 }), this._requests.clear(), Promise.resolve() 30823 }, Hx.prototype._makeStorageReference = function (t) { 30824 return new Dx(this, t) 30825 }, Hx.prototype._makeRequest = function (t, e) { 30826 var n = this; 30827 if (this._deleted) return new BD(ID()); 30828 var r, i, o, s, a, u, c = (r = t, i = this._appId, o = e, s = this._pool, a = this._firebaseVersion, u = YD(r.urlParams), t = r.url + u, e = Object.assign({}, r.headers), u = e, (i = i) && (u["X-Firebase-GMPID"] = i), i = e, null !== (o = o) && 0 < o.length && (i.Authorization = "Firebase " + o), a = a, e["X-Firebase-Storage-Version"] = "webjs/" + (null != a ? a : "AppManager"), new XD(t, r.method, e, r.body, r.successCodes, r.additionalRetryCodes, r.handler, r.errorHandler, r.timeout, r.progressCallback, s)); 30829 return this._requests.add(c), c.getPromise().then(function () { 30830 return n._requests.delete(c) 30831 }, function () { 30832 return n._requests.delete(c) 30833 }), c 30834 }, Hx); 30835 30836 function Hx(t, e, n, r, i) { 30837 this.app = t, this._authProvider = e, this._pool = n, this._url = r, this._firebaseVersion = i, this._bucket = null, this._appId = null, this._deleted = !1, this._maxOperationRetryTime = 12e4, this._maxUploadRetryTime = 6e5, this._requests = new Set, this._bucket = null != r ? qD.makeFromBucketSpec(r) : null == (r = null == (r = this.app.options) ? void 0 : r[dD]) ? null : qD.makeFromBucketSpec(r) 30838 } 30839 30840 function Gx(t, e, n) { 30841 return e = e, n = n, (t = t)._throwIfRoot("uploadBytesResumable"), new Px(t, new tx(e), n) 30842 } 30843 30844 function zx(t) { 30845 return function (r) { 30846 return $i(this, void 0, void 0, function () { 30847 var e, n; 30848 return Zi(this, function (t) { 30849 switch (t.label) { 30850 case 0: 30851 return r._throwIfRoot("getMetadata"), [4, r.storage._getAuthToken()]; 30852 case 1: 30853 return e = t.sent(), n = _x(r.storage, r._location, ax()), [2, r.storage._makeRequest(n, e).getPromise()] 30854 } 30855 }) 30856 }) 30857 }(t) 30858 } 30859 30860 function Qx(t, e) { 30861 return Kx(t, e) 30862 } 30863 var Yx = (Object.defineProperty(Xx.prototype, "bytesTransferred", { 30864 get: function () { 30865 return this._delegate.bytesTransferred 30866 }, 30867 enumerable: !1, 30868 configurable: !0 30869 }), Object.defineProperty(Xx.prototype, "metadata", { 30870 get: function () { 30871 return this._delegate.metadata 30872 }, 30873 enumerable: !1, 30874 configurable: !0 30875 }), Object.defineProperty(Xx.prototype, "state", { 30876 get: function () { 30877 return this._delegate.state 30878 }, 30879 enumerable: !1, 30880 configurable: !0 30881 }), Object.defineProperty(Xx.prototype, "totalBytes", { 30882 get: function () { 30883 return this._delegate.totalBytes 30884 }, 30885 enumerable: !1, 30886 configurable: !0 30887 }), Xx); 30888 30889 function Xx(t, e, n) { 30890 this._delegate = t, this.task = e, this.ref = n 30891 } 30892 var Jx = (Object.defineProperty($x.prototype, "snapshot", { 30893 get: function () { 30894 return new Yx(this._delegate.snapshot, this, this._ref) 30895 }, 30896 enumerable: !1, 30897 configurable: !0 30898 }), $x.prototype.then = function (e, t) { 30899 var n = this; 30900 return this._delegate.then(function (t) { 30901 if (e) return e(new Yx(t, n, n._ref)) 30902 }, t) 30903 }, $x.prototype.on = function (t, e, n, r) { 30904 var i = this, 30905 o = void 0; 30906 return e && (o = "function" == typeof e ? function (t) { 30907 return e(new Yx(t, i, i._ref)) 30908 } : { 30909 next: e.next ? function (t) { 30910 return e.next(new Yx(t, i, i._ref)) 30911 } : void 0, 30912 complete: e.complete || void 0, 30913 error: e.error || void 0 30914 }), this._delegate.on(t, o, n || void 0, r || void 0) 30915 }, $x); 30916 30917 function $x(t, e) { 30918 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) 30919 } 30920 var Zx = (Object.defineProperty(tL.prototype, "prefixes", { 30921 get: function () { 30922 var e = this; 30923 return this._delegate.prefixes.map(function (t) { 30924 return new eL(t, e._service) 30925 }) 30926 }, 30927 enumerable: !1, 30928 configurable: !0 30929 }), Object.defineProperty(tL.prototype, "items", { 30930 get: function () { 30931 var e = this; 30932 return this._delegate.items.map(function (t) { 30933 return new eL(t, e._service) 30934 }) 30935 }, 30936 enumerable: !1, 30937 configurable: !0 30938 }), Object.defineProperty(tL.prototype, "nextPageToken", { 30939 get: function () { 30940 return this._delegate.nextPageToken || null 30941 }, 30942 enumerable: !1, 30943 configurable: !0 30944 }), tL); 30945 30946 function tL(t, e) { 30947 this._delegate = t, this._service = e 30948 }
30949 var eL = (Object.defineProperty(nL.prototype, "name", { 30950 get: function () { 30951 return this._delegate.name 30952 }, 30953 enumerable: !1, 30954 configurable: !0 30955 }), Object.defineProperty(nL.prototype, "bucket", { 30956 get: function () { 30957 return this._delegate.bucket 30958 }, 30959 enumerable: !1, 30960 configurable: !0 30961 }), Object.defineProperty(nL.prototype, "fullPath", { 30962 get: function () { 30963 return this._delegate.fullPath 30964 }, 30965 enumerable: !1, 30966 configurable: !0 30967 }), nL.prototype.toString = function () { 30968 return this._delegate.toString() 30969 }, nL.prototype.child = function (t) { 30970 return new nL(qx(this._delegate, t), this.storage) 30971 }, Object.defineProperty(nL.prototype, "root", { 30972 get: function () { 30973 return new nL(this._delegate.root, this.storage) 30974 }, 30975 enumerable: !1, 30976 configurable: !0 30977 }), Object.defineProperty(nL.prototype, "parent", { 30978 get: function () { 30979 var t = this._delegate.parent; 30980 return null == t ? null : new nL(t, this.storage) 30981 }, 30982 enumerable: !1, 30983 configurable: !0 30984 }), nL.prototype.put = function (t, e) { 30985 return this._throwIfRoot("put"), new Jx(Gx(this._delegate, t, e), this) 30986 }, nL.prototype.putString = function (t, e, n) { 30987 void 0 === e && (e = CD.RAW), this._throwIfRoot("putString"); 30988 t = AD(e, t), n = Ji({}, n); 30989 return null == n.contentType && null != t.contentType && (n.contentType = t.contentType), new Jx(new Px(this._delegate, new tx(t.data, !0), n), this) 30990 }, nL.prototype.listAll = function () { 30991 var e = this; 30992 return Lx(this._delegate).then(function (t) { 30993 return new Zx(t, e.storage) 30994 }) 30995 }, nL.prototype.list = function (t) { 30996 var e = this; 30997 return Mx(this._delegate, t || void 0).then(function (t) { 30998 return new Zx(t, e.storage) 30999 }) 31000 }, nL.prototype.getMetadata = function () { 31001 return zx(this._delegate) 31002 }, nL.prototype.updateMetadata = function (t) { 31003 return Fx(this._delegate, t) 31004 }, nL.prototype.getDownloadURL = function () { 31005 return Ux(this._delegate) 31006 }, nL.prototype.delete = function () { 31007 return this._throwIfRoot("delete"), jx(this._delegate) 31008 }, nL.prototype._throwIfRoot = function (t) { 31009 if ("" === this._delegate._location.path) throw TD(t) 31010 }, nL); 31011 31012 function nL(t, e) { 31013 this._delegate = t, this.storage = e 31014 } 31015 var rL = (Object.defineProperty(iL.prototype, "maxOperationRetryTime", { 31016 get: function () { 31017 return this._delegate.maxOperationRetryTime 31018 }, 31019 enumerable: !1, 31020 configurable: !0 31021 }), Object.defineProperty(iL.prototype, "maxUploadRetryTime", { 31022 get: function () { 31023 return this._delegate.maxUploadRetryTime 31024 }, 31025 enumerable: !1, 31026 configurable: !0 31027 }), iL.prototype.ref = function (t) { 31028 if (Vx(t)) throw _D("ref() expected a child path but got a URL, use refFromURL instead."); 31029 return new eL(Qx(this._delegate, t), this) 31030 }, iL.prototype.refFromURL = function (t) { 31031 if (!Vx(t)) throw _D("refFromURL() expected a full URL but got a child path, use ref() instead."); 31032 try { 31033 qD.makeFromUrl(t) 31034 } catch (t) { 31035 throw _D("refFromUrl() expected a valid full URL but got an invalid one.") 31036 } 31037 return new eL(Qx(this._delegate, t), this) 31038 }, iL.prototype.setMaxUploadRetryTime = function (t) { 31039 this._delegate.maxUploadRetryTime = t 31040 }, iL.prototype.setMaxOperationRetryTime = function (t) { 31041 this._delegate.maxOperationRetryTime = t 31042 }, iL); 31043 31044 function iL(t, e) { 31045 var n = this; 31046 this.app = t, this._delegate = e, this.INTERNAL = { 31047 delete: function () { 31048 return n._delegate._delete() 31049 } 31050 } 31051 } 31052 var oL, sL; 31053 31054 function aL(t, e) { 31055 var n = e.instanceIdentifier, 31056 e = t.getProvider("app").getImmediate(), 31057 t = t.getProvider("auth-internal"); 31058 return new rL(e, new Wx(e, t, new UD, n, Xl.SDK_VERSION)) 31059 } 31060 sL = { 31061 TaskState: xD, 31062 TaskEvent: DD, 31063 StringFormat: CD, 31064 Storage: Wx, 31065 Reference: eL 31066 }, (oL = Xl).INTERNAL.registerComponent(new ts("storage", aL, "PUBLIC").setServiceProps(sL).setMultipleInstances(!0)), oL.registerVersion("@firebase/storage", "0.4.6"); 31067 var uL, cL, hL = "0.4.9", 31068 lL = "FB-PERF-TRACE-MEASURE", 31069 fL = "@firebase/performance/config", 31070 pL = "@firebase/performance/configexpire", 31071 Sn = "Performance", 31072 Ga = ((Ga = {})["trace started"] = "Trace {$traceName} was started before.", Ga["trace stopped"] = "Trace {$traceName} is not running.", Ga["nonpositive trace startTime"] = "Trace {$traceName} startTime should be positive.", Ga["nonpositive trace duration"] = "Trace {$traceName} duration should be positive.", Ga["no window"] = "Window is not available.", Ga["no app id"] = "App id is not available.", Ga["no project id"] = "Project id is not available.", Ga["no api key"] = "Api key is not available.", Ga["invalid cc log"] = "Attempted to queue invalid cc event", Ga["FB not default"] = "Performance can only start when Firebase app instance is the default one.", Ga["RC response not ok"] = "RC response is not ok", Ga["invalid attribute name"] = "Attribute name {$attributeName}
31072 is invalid.", Ga["invalid attribute value"] = "Attribute value {$attributeValue} is invalid.", Ga["invalid custom metric name"] = "Custom metric name {$customMetricName} is invalid", Ga["invalid String merger input"] = "Input for String merger is invalid, contact support team to resolve.", Ga), 31073 dL = new Co("performance", Sn, Ga), 31074 vL = new ps(Sn); 31075 vL.logLevel = as.INFO; 31076 var gL, yL = (mL.prototype.getUrl = function () { 31077 return this.windowLocation.href.split("?")[0] 31078 }, mL.prototype.mark = function (t) { 31079 this.performance && this.performance.mark && this.performance.mark(t) 31080 }, mL.prototype.measure = function (t, e, n) { 31081 this.performance && this.performance.measure && this.performance.measure(t, e, n) 31082 }, mL.prototype.getEntriesByType = function (t) { 31083 return this.performance && this.performance.getEntriesByType ? this.performance.getEntriesByType(t) : [] 31084 }, mL.prototype.getEntriesByName = function (t) { 31085 return this.performance && this.performance.getEntriesByName ? this.performance.getEntriesByName(t) : [] 31086 }, mL.prototype.getTimeOrigin = function () { 31087 return this.performance && (this.performance.timeOrigin || this.performance.timing.navigationStart) 31088 }, mL.prototype.requiredApisAvailable = function () { 31089 return fetch && Promise && this.navigator && this.navigator.cookieEnabled ? !!bo() || (vL.info("IndexedDB is not supported by current browswer"), !1) : (vL.info("Firebase Performance cannot start if browser does not support fetch and Promise or cookie is disabled."), !1) 31090 }, mL.prototype.setupObserver = function (t, i) { 31091 this.PerformanceObserver && new this.PerformanceObserver(function (t) { 31092 for (var e = 0, n = t.getEntries(); e < n.length; e++) { 31093 var r = n[e]; 31094 i(r) 31095 } 31096 }).observe({ 31097 entryTypes: [t] 31098 }) 31099 }, mL.getInstance = function () { 31100 return uL = void 0 === uL ? new mL(cL) : uL 31101 }, mL); 31102 31103 function mL(t) { 31104 if (!(this.window = t)) throw dL.create("no window"); 31105 this.performance = t.performance, this.PerformanceObserver = t.PerformanceObserver, this.windowLocation = t.location, this.navigator = t.navigator, this.document = t.document, this.navigator && this.navigator.cookieEnabled && (this.localStorage = t.localStorage), t.perfMetrics && t.perfMetrics.onFirstInputDelay && (this.onFirstInputDelay = t.perfMetrics.onFirstInputDelay) 31106 } 31107 31108 function bL(t, e) { 31109 var n = t.length - e.length; 31110 if (n < 0 || 1 < n) throw dL.create("invalid String merger input"); 31111 for (var r = [], i = 0; i < t.length; i++) r.push(t.charAt(i)), e.length > i && r.push(e.charAt(i)); 31112 return r.join("") 31113 } 31114 var wL, _L, IL = (TL.prototype.getAppId = function () { 31115 var t = this.firebaseAppInstance && this.firebaseAppInstance.options && this.firebaseAppInstance.options.appId; 31116 if (!t) throw dL.create("no app id"); 31117 return t 31118 }, TL.prototype.getProjectId = function () { 31119 var t = this.firebaseAppInstance && this.firebaseAppInstance.options && this.firebaseAppInstance.options.projectId; 31120 if (!t) throw dL.create("no project id"); 31121 return t 31122 }, TL.prototype.getApiKey = function () { 31123 var t = this.firebaseAppInstance && this.firebaseAppInstance.options && this.firebaseAppInstance.options.apiKey; 31124 if (!t) throw dL.create("no api key"); 31125 return t 31126 }, TL.prototype.getFlTransportFullUrl = function () { 31127 return this.flTransportEndpointUrl.concat("?key=", this.transportKey) 31128 }, TL.getInstance = function () { 31129 return gL = void 0 === gL ? new TL : gL 31130 }, TL); 31131 31132 function TL() { 31133 this.instrumentationEnabled = !0, this.dataCollectionEnabled = !0, this.loggingEnabled = !1, this.tracesSamplingRate = 1, this.networkRequestsSamplingRate = 1, this.logEndPointUrl = "https://firebaselogging.googleapis.com/v0cc/log?format=json_proto", this.flTransportEndpointUrl = bL("hts/frbslgigp.ogepscmv/ieo/eaylg", "tp:/ieaeogn-agolai.o/1frlglgc/o"), this.transportKey = bL("AzSC8r6ReiGqFMyfvgow", "Iayx0u-XT3vksVM-pIV"), this.logSource = 462, this.logTraceAfterSampling = !1, this.logNetworkAfterSampling = !1, this.configTimeToLive = 12 31134 }(Sn = _L = _L || {})[Sn.UNKNOWN = 0] = "UNKNOWN", Sn[Sn.VISIBLE = 1] = "VISIBLE", Sn[Sn.HIDDEN = 2] = "HIDDEN"; 31135 var EL = ["firebase_", "google_", "ga_"], 31136 SL = new RegExp("^[a-zA-Z]\\w*$"); 31137 31138 function CL() { 31139 switch (yL.getInstance().document.visibilityState) { 31140 case "visible": 31141 return _L.VISIBLE; 31142 case "hidden": 31143 return _L.HIDDEN; 31144 default: 31145 return _L.UNKNOWN 31146 } 31147 } 31148 var NL = "0.0.1", 31149 AL = { 31150 loggingEnabled: !0 31151 }, 31152 kL = "FIREBASE_INSTALLATIONS_AUTH"; 31153 31154 function RL(t) { 31155 var n, e = function () { 31156 var t = yL.getInstance().localStorage; 31157 if (!t) return; 31158 var e = t.getItem(pL); 31159 if (!e || ! function (t) { 31160 return Number(t) > Date.now() 31161 }(e)) return; 31162 var n = t.getItem(fL); 31163 if (!n) return; 31164 try { 31165 return JSON.parse(n) 31166 } catch (t) { 31167 return 31168 } 31169 }(); 31170 return e ? (OL(e), Promise.resolve()) : (n = t, function () { 31171 var t = IL.getInstance().installationsService.getToken(); 31172 return t.then(function (t) {}), t 31173 }().then(function (t) { 31174 var e = "https://firebaseremoteconfig.googleapis.com/v1/projects/" + IL.getInstance().getProjectId() + "/namespaces/fireperf:fetch?ke
31174y=" + IL.getInstance().getApiKey(), 31175 t = new Request(e, { 31176 method: "POST", 31177 headers: { 31178 Authorization: kL + " " + t 31179 }, 31180 body: JSON.stringify({ 31181 app_instance_id: n, 31182 app_instance_id_token: t, 31183 app_id: IL.getInstance().getAppId(), 31184 app_version: hL, 31185 sdk_version: NL 31186 }) 31187 }); 31188 return fetch(t).then(function (t) { 31189 if (t.ok) return t.json(); 31190 throw dL.create("RC response not ok") 31191 }) 31192 }).catch(function () { 31193 vL.info(PL) 31194 }).then(OL).then(function (t) { 31195 var e = yL.getInstance().localStorage; 31196 if (!t || !e) return; 31197 e.setItem(fL, JSON.stringify(t)), e.setItem(pL, String(Date.now() + 60 * IL.getInstance().configTimeToLive * 60 * 1e3)) 31198 }, function () {})) 31199 } 31200 var PL = "Could not fetch config, will use default configs"; 31201 31202 function OL(t) { 31203 if (!t) return t; 31204 var e = IL.getInstance(), 31205 n = t.entries || {}; 31206 return e.loggingEnabled = void 0 !== n.fpr_enabled ? "true" === String(n.fpr_enabled) : AL.loggingEnabled, n.fpr_log_source && (e.logSource = Number(n.fpr_log_source)), n.fpr_log_endpoint_url && (e.logEndPointUrl = n.fpr_log_endpoint_url), n.fpr_log_transport_key && (e.transportKey = n.fpr_log_transport_key), void 0 !== n.fpr_vc_network_request_sampling_rate && (e.networkRequestsSamplingRate = Number(n.fpr_vc_network_request_sampling_rate)), void 0 !== n.fpr_vc_trace_sampling_rate && (e.tracesSamplingRate = Number(n.fpr_vc_trace_sampling_rate)), e.logTraceAfterSampling = DL(e.tracesSamplingRate), e.logNetworkAfterSampling = DL(e.networkRequestsSamplingRate), t 31207 } 31208 31209 function DL(t) { 31210 return Math.random() <= t 31211 } 31212 var xL, LL = 1; 31213 31214 function ML() { 31215 return LL = 2, xL = xL || function () { 31216 var n = yL.getInstance().document; 31217 return new Promise(function (t) { 31218 var e; 31219 n && "complete" !== n.readyState ? (e = function () { 31220 "complete" === n.readyState && (n.removeEventListener("readystatechange", e), t()) 31221 }, n.addEventListener("readystatechange", e)) : t() 31222 }) 31223 }().then(function () { 31224 return (t = IL.getInstance().installationsService.getId()).then(function (t) { 31225 wL = t 31226 }), t; 31227 var t 31228 }).then(RL).then(FL, FL) 31229 } 31230 31231 function FL() { 31232 LL = 3 31233 } 31234 var UL, jL = 1e4, 31235 qL = 5500, 31236 VL = 3, 31237 BL = 1e3, 31238 KL = VL, 31239 WL = [], 31240 HL = !1; 31241 31242 function GL(t) { 31243 setTimeout(function () { 31244 var t, e; 31245 if (0 !== KL) return WL.length ? (t = WL.splice(0, BL), e = t.map(function (t) { 31246 return { 31247 source_extension_json_proto3: t.message, 31248 event_time_ms: String(t.eventTime) 31249 } 31250 }), void 31251 function (t, r) { 31252 return function (t) { 31253 var e = IL.getInstance().getFlTransportFullUrl(); 31254 return fetch(e, { 31255 method: "POST", 31256 body: JSON.stringify(t) 31257 }) 31258 }(t).then(function (t) { 31259 return t.ok || vL.info("Call to Firebase backend failed."), t.json() 31260 }).then(function (t) { 31261 var e = Number(t.nextRequestWaitMillis), 31262 n = jL; 31263 isNaN(e) || (n = Math.max(e, n)); 31264 t = t.logResponseDetails; 31265 Array.isArray(t) && 0 < t.length && "RETRY_REQUEST_LATER" === t[0].responseAction && (WL = no(no([], r), WL), vL.info("Retry transport request later.")), KL = VL, GL(n) 31266 }) 31267 }({ 31268 request_time_ms: String(Date.now()), 31269 client_info: { 31270 client_type: 1, 31271 js_client_info: {} 31272 }, 31273 log_source: IL.getInstance().logSource, 31274 log_event: e 31275 }, t).catch(function () { 31276 WL = no(no([], t), WL), KL--, vL.info("Tries left: " +
31276KL + "."), GL(jL) 31277 })) : GL(jL) 31278 }, t) 31279 } 31280 31281 function zL(n) { 31282 return function () { 31283 for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e]; 31284 ! function (t) { 31285 if (!t.eventTime || !t.message) throw dL.create("invalid cc log"); 31286 WL = no(no([], WL), [t]) 31287 }({ 31288 message: n.apply(void 0, t), 31289 eventTime: Date.now() 31290 }) 31291 } 31292 } 31293 31294 function QL(t, e) { 31295 (UL = UL || zL(JL))(t, e) 31296 } 31297 31298 function YL(t) { 31299 var e = IL.getInstance(); 31300 !e.instrumentationEnabled && t.isAuto || (e.dataCollectionEnabled || t.isAuto) && yL.getInstance().requiredApisAvailable() && (t.isAuto && CL() !== _L.VISIBLE || (3 === LL ? XL(t) : ML().then(function () { 31301 return XL(t) 31302 }, function () { 31303 return XL(t) 31304 }))) 31305 } 31306 31307 function XL(t) { 31308 var e; 31309 !wL || (e = IL.getInstance()).loggingEnabled && e.logTraceAfterSampling && setTimeout(function () { 31310 return QL(t, 1) 31311 }, 0) 31312 } 31313 31314 function JL(t, e) { 31315 return (0 === e ? function (t) { 31316 t = { 31317 url: t.url, 31318 http_method: t.httpMethod || 0, 31319 http_response_code: 200, 31320 response_payload_bytes: t.responsePayloadBytes, 31321 client_start_time_us: t.startTimeUs, 31322 time_to_response_initiated_us: t.timeToResponseInitiatedUs, 31323 time_to_response_completed_us: t.timeToResponseCompletedUs 31324 }, t = { 31325 application_info: $L(), 31326 network_request_metric: t 31327 }; 31328 return JSON.stringify(t) 31329 } : function (t) { 31330 var e = { 31331 name: t.name, 31332 is_auto: t.isAuto, 31333 client_start_time_us: t.startTimeUs, 31334 duration_us: t.durationUs 31335 }; 31336 0 !== Object.keys(t.counters).length && (e.counters = t.counters); 31337 t = t.getAttributes(); 31338 0 !== Object.keys(t).length && (e.custom_attributes = t); 31339 e = { 31340 application_info: $L(), 31341 trace_metric: e 31342 }; 31343 return JSON.stringify(e) 31344 })(t) 31345 } 31346 31347 function $L() { 31348 return { 31349 google_app_id: IL.getInstance().getAppId(), 31350 app_instance_id: wL, 31351 web_app_info: { 31352 sdk_version: hL, 31353 page_url: yL.getInstance().getUrl(), 31354 service_worker_status: "serviceWorker" in (t = yL.getInstance().navigator) ? t.serviceWorker.controller ? 2 : 3 : 1, 31355 visibility_state: CL(), 31356 effective_connection_type: function () { 31357 var t = yL.getInstance().navigator.connection; 31358 switch (t && t.effectiveType) { 31359 case "slow-2g": 31360 return 1; 31361 case "2g": 31362 return 2; 31363 case "3g": 31364 return 3; 31365 case "4g": 31366 return 4; 31367 default: 31368 return 0 31369 } 31370 }() 31371 }, 31372 application_process_state: 0 31373 }; 31374 var t 31375 } 31376 var ZL = ["_fp", "_fcp", "_fid"]; 31377 var tM = (eM.prototype.start = function () { 31378 if (1 !== this.state) throw dL.create("trace started", { 31379 traceName: this.name 31380 }); 31381 this.api.mark(this.traceStartMark), this.state = 2 31382 }, eM.prototype.stop = function () { 31383 if (2 !== this.state) throw dL.create("trace stopped", { 31384 traceName: this.name 31385 }); 31386 this.state = 3, this.api.mark(this.traceStopMark), this.api.measure(this.traceMeasure, this.traceStartMark, this.traceStopMark), this.calculateTraceMetrics(), YL(this) 31387 }, eM.prototype.record = function (t, e, n) { 31388 if (t <= 0) throw dL.create("nonpositive trace startTime", { 31389 traceName: this.name 31390 }); 31391 if (e <= 0) throw dL.create("nonpositive trace duration", { 31392 traceName: this.name 31393 }); 31394 if (this.durationUs = Math.floor(1e3 * e), this.startTimeUs = Math.floor(1e3 * t), n && n.attributes && (this.customAttributes = Ji({}, n.attributes)), n && n.metrics) 31395 for (var r = 0, i = Object.keys(n.metrics); r < i.length; r++) { 31396 var o = i[r]; 31397 isNaN(Number(n.metrics[o])) || (this.counters[o] = Number(Math.floor(n.metrics[o]))) 31398 } 31399 YL(this) 31400 }, eM.prototype.incrementMetric = function (t, e) { 31401 void 0 === e && (e = 1), void 0 === this.counters[t] ? this.putMetric(t, e) : this.putMetric(t, this.counters[t] + e) 31402 }, eM.prototype.putMetric = function (t, e) { 31403 if (n = t, r = this.name, 0 === n.length || 100 < n.length || !(r && r.startsWith("_wt_") && -1 < ZL.indexOf(n)) && n.startsWith("_")) throw dL.create("invalid custom metric name", { 31404 customMetricName: t 31405 }); 31406 var n, r; 31407 this.counters[t] = (t = e, (e = Math.floor(t)) < t && vL.info("Metric value should be an Integer, setting the value as : " + e + "."), e) 31408 }, eM.prototype.getMetric = function (t) { 31409 return this.counters[t] || 0 31410 }, eM.prototype.putAttribute = function (t, e) { 31411 var n, r, i = !(0 === (n = t).length || 40 < n.length) && (!EL.some(function (t) { 31412 return n.startsWith(t) 31413 }) && !!n.match(SL)), 31414 r = 0 !== (r = e).length && r.length <= 100; 31415 if (i && r) this.customAttributes[t] = e; 31416 else { 31417 if (!i) throw dL.create("invalid attribute name", { 31418 attributeName: t 31419 }); 31420 if (!r) throw dL.create("invalid attribute value", { 31421 attributeValue: e 31422 }) 31423 } 31424 }, eM.prototype.getAttribute = function (t) { 31425 return this.customAttributes[t] 31426 }, eM.prototype.removeAttribute = function (t) { 31427 void 0 !== this.customAttributes[t] && delete this.customAttributes[t] 31428 }, eM.prototype.getAttributes = function () { 31429 return Ji({}, this.customAttributes) 31430 }, eM.prototype.setStartTime = function (t) { 31431 this.startTimeUs = t 31432 }, eM.prototype.setDuration = function (t) { 31433 this.durationUs = t 31434 }, eM.prototype.calculateTraceMetrics = function () { 31435 var t = this.api.getEntriesByName(this.traceMeasure), 31436 t = t && t[0]; 31437 t && (this.durationUs = Math.floor(1e3 * t.duration), this.startTimeUs = Math.floor(1e3 * (t.startTime + this.api.getTimeOrigin()))) 31438 }, eM.createOobTrace = function (t, e, n) { 31439 var r, i = yL.getInstance().getUrl(); 31440 i && (r = new eM("_wt_" + i, !0), i = Math.floor(1e3 * yL.getInstance().getTimeOrigin()), r.setStartTime(i), t && t[0] && (r.setDuration(Math.floor(1e3 * t[0].duration)), r.putMetric("domInteractive", Math.floor(1e3 * t[0].domInteractive)), r.putMetric("domContentLoadedEventEnd", Math.floor(1e3 * t[0].domContentLoadedEventEnd)), r.putMetric("loadEventEnd", Math.floor(1e3 * t[0].loadEventEnd))), e && ((t = e.find(function (t) { 31441 return "first-paint" === t.name 31442 })) && t.startTime && r.putMetric("_fp", Math.floor(1e3 * t.startTime)), (e = e.find(function (t) { 31443 return "first-contentful-paint" === t.name 31444 })) && e.startTime && r.putMetric("_fcp", Math.floor(1e3 * e.startTime)), n && r.putMetric("_fid", Math.floor(1e3 * n))), YL(r)) 31445 }, eM.createUserTimingTrace = function (t) { 31446 YL(new eM(t, !1, t)) 31447 }, eM); 31448 31449 function eM(t, e, n) { 31450 void 0 === e && (e = !1), this.name = t, this.isAuto = e, this.state = 1, this.customAttributes = {}, this.counters = {}, this.api = yL.getInstance(), this.randomId = Math.floor(1e6 * Math.random()), this.isAuto || (this.traceStartMark = "FB-PERF-TRACE-START-" + this.randomId + "-" + this.name, this.traceStopMark = "FB-PERF-TRACE-STOP-" + this.randomId + "-" + this.name, this.traceMeasure = n || lL + "-" + this.randomId + "-" + this.name, n && this.calculateTraceMetrics()) 31451 } 31452 31453 function nM(t) { 31454 var e, n, r, i = t; 31455 i && void 0 !== i.responseStart && (n = yL.getInstance().getTimeOrigin(), r = Math.floor(1e3 * (i.startTime + n)), t = i.responseStart ? Math.floor(1e3 * (i.responseStart - i.startTime)) : void 0, n = Math.floor(1e3 * (i.responseEnd - i.startTime)), i = { 31456 url: i.name && i.name.split("?")[0], 31457 responsePayloadBytes: i.transferSize, 31458 startTimeUs: r, 31459 timeToResponseInitiatedUs: t, 31460 timeToResponseCompletedUs: n 31461 }, e = i, (r = IL.getInstance()).instrumentationEnabled && (t = e.url, n = r.logEndPointUrl.split("?")[0], i = r.flTransportEndpointUrl.split("?")[0], t !== n && t !== i && r.loggingEnabled && r.logNetworkAfterSampling && setTimeout(function () { 31462 return QL(e, 0) 31463 }, 0))) 31464 } 31465 var rM = 5e3; 31466 31467 function iM() { 31468 wL && (setTimeout(function () { 31469 var t = yL.getInstance(), 31470 e = t.getEntriesByType("navigation"), 31471 n = t.getEntriesByType("paint"); { 31472 var r; 31473 t.onFirstInputDelay ? (r = setTimeout(function () { 31474 tM.createOobTrace(e, n), r = void 0 31475 }, rM), t.onFirstInputDelay(function (t) { 31476 r && (clearTimeout(r), tM.createOobTrace(e, n, t)) 31477 })) : tM.createOobTrace(e, n) 31478 } 31479 }, 0), setTimeout(function () { 31480 for (var t = yL.getInstance(), e = t.getEntriesByType("resource"), n = 0, r = e; n < r.length; n++) nM(r[n]); 31481 t.setupObserver("resource", nM) 31482 }, 0), setTimeout(function () { 31483 for (var t = yL.getInstance(), e = t.getEntriesByType("measure"), n = 0, r = e; n < r.length; n++) oM(r[n]); 31484 t.setupObserver("measure", oM) 31485 }, 0)) 31486 } 31487 31488 function oM(t) { 31489 t = t.name; 31490 t.substring(0, lL.length) !== lL && tM.createUserTimingTrace(t) 31491 } 31492 var sM = (aM.prototype.trace = function (t) { 31493 return new tM(t) 31494 }, Object.defineProperty(aM.prototype, "instrumentationEnabled", { 31495 get: function () { 31496 return IL.getInstance().instrumentationEnabled 31497 }, 31498 set: function (t) { 31499 IL.getInstance().instrumentationEnabled = t 31500 }, 31501 enumerable: !1, 31502 configurable: !0 31503 }), Object.defineProperty(aM.prototype, "dataCollectionEnabled", { 31504 get: function () { 31505 return IL.getInstance().dataCollectionEnabled 31506 }, 31507 set: function (t) { 31508 IL.getInstance().dataCollectionEnabled = t 31509 }, 31510 enumerable: !1, 31511 configurable: !0 31512 }), aM); 31513 31514 function aM(t) { 31515 this.app = t, yL.getInstance().requiredApisAvailable() && wo().then(function (t) { 31516 t && (HL || (GL(qL), HL = !0), ML().then(iM, iM)) 31517 }).catch(function (t) { 31518 vL.info("Environment doesn't support IndexedDB: " + t) 31519 }) 31520 } 31521 var uM; 31522 31523 function cM(t, e) { 31524 if ("[DEFAULT]" !== t.name) throw dL.create("FB not default"); 31525 if ("undefined" == typeof window) throw dL.create("no window"); 31526 return cL = window, IL.getInstance().firebaseAppInstance = t, IL.getInstance().installationsService = e, new sM(t) 31527 }(uM = Xl).INTERNAL.registerComponent(new ts("performance", function (t) { 31528 var e = t.getProvider("app").getImmediate(), 31529 t = t.getProvider("installations").getImmediate(); 31530 return cM(e, t) 31531 }, "PUBLIC")), uM.registerVersion("@firebase/performance", "0.4.9"); 31532 var hM, lM, fM = "firebase_id", 31533 pM = "origin", 31534 dM = 6e4, 31535 vM = "https://firebase.googleapis.com/v1alpha/projects/-/apps/{app-id}/webConfig", 31536 gM = "https://www.googletagmanager.com/gtag/js"; 31537 (Sn = hM = hM || {}).EVENT = "event", Sn.SET = "set", Sn.CONFIG = "config", (Sn = lM = lM || {}).ADD_SHIPPING_INFO = "add_shipping_info", Sn.ADD_PAYMENT_INFO = "add_payment_info", Sn.ADD_TO_CART = "add_to_cart", Sn.ADD_TO_WISHLIST = "add_to_wishlist", Sn.BEGIN_CHECKOUT = "begin_checkout", Sn.CHECKOUT_PROGRESS = "checkout_progress", Sn.EXCEPTION = "exception", Sn.GENERATE_LEAD = "generate_lead", Sn.LOGIN = "login", Sn.PAGE_VIEW = "page_view", Sn.PURCHASE = "purchase", Sn.REFUND = "refund", Sn.REMOVE_FROM_CART = "remove_from_cart", Sn.SCREEN_VIEW = "screen_view", Sn.SEARCH = "search", Sn.SELECT_CONTENT = "select_content", Sn.SELECT_ITEM = "select_item", Sn.SELECT_PROMOTION = "select_promotion", Sn.SET_CHECKOUT_OPTION = "set_checkout_option", Sn.SHARE = "share", Sn.SIGN_UP = "sign_up", Sn.TIM
31537ING_COMPLETE = "timing_complete", Sn.VIEW_CART = "view_cart", Sn.VIEW_ITEM = "view_item", Sn.VIEW_ITEM_LIST = "view_item_list", Sn.VIEW_PROMOTION = "view_promotion", Sn.VIEW_SEARCH_RESULTS = "view_search_results"; 31538 var yM = new ps("@firebase/analytics"); 31539 31540 function mM(o, s, a, u) { 31541 return function (n, r, i) { 31542 return $i(this, void 0, void 0, function () { 31543 var e; 31544 return Zi(this, function (t) { 31545 switch (t.label) { 31546 case 0: 31547 return t.trys.push([0, 6, , 7]), n !== hM.EVENT ? [3, 2] : [4, function (u, c, h, l, f) { 31548 return $i(this, void 0, void 0, function () { 31549 var n, r, e, i, o, s, a; 31550 return Zi(this, function (t) { 31551 switch (t.label) { 31552 case 0: 31553 return (t.trys.push([0, 4, , 5]), n = [], f && f.send_to) ? (a = f.send_to, Array.isArray(a) || (a = [a]), [4, Promise.all(h)]) : [3, 2]; 31554 case 1: 31555 for (r = t.sent(), e = function (e) { 31556 var t = r.find(function (t) { 31557 return t.measurementId === e 31558 }), 31559 t = t && c[t.appId]; 31560 if (!t) return n = [], "break"; 31561 n.push(t) 31562 }, i = 0, o = a; i < o.length && (s = o[i], "break" !== e(s)); i++); 31563 t.label = 2; 31564 case 2: 31565 return 0 === n.length && (n = Object.values(c)), [4, Promise.all(n)]; 31566 case 3: 31567 return t.sent(), u(hM.EVENT, l, f || {}), [3, 5]; 31568 case 4: 31569 return a = t.sent(), yM.error(a), [3, 5]; 31570 case 5: 31571 return [2] 31572 } 31573 }) 31574 }) 31575 }(o, s, a, r, i)]; 31576 case 1: 31577 return t.sent(), [3, 5]; 31578 case 2: 31579 return n !== hM.CONFIG ? [3, 4] : [4, function (r, i, o, s, a, u) { 31580 return $i(this, void 0, void 0, function () { 31581 var e, n; 31582 return Zi(this, function (t) { 31583 switch (t.label) { 31584 case 0: 31585 e = s[a], t.label = 1; 31586 case 1: 31587 return t.trys.push([1, 7, , 8]), e ? [4, i[e]] : [3, 3]; 31588 case 2: 31589 return t.sent(), [3, 6]; 31590 case 3: 31591 return [4, Promise.all(o)]; 31592 case 4: 31593 return n = t.sent(), (n = n.find(function (t) { 31594 return t.measurementId === a 31595 })) ? [4, i[n.appId]] : [3, 6]; 31596 case 5: 31597 t.sent(), t.label = 6; 31598 case 6: 31599 return [3, 8]; 31600 case 7: 31601 return n = t.sent(), yM.error(n), [3, 8]; 31602 case 8: 31603 return r(hM.CONFIG, a, u), [2] 31604 } 31605 }) 31606 }) 31607 }(o, s, a, u, r, i)]; 31608 case 3: 31609 return t.sent(), [3, 5]; 31610 case 4: 31611 o(hM.SET, r), t.label = 5; 31612 case 5: 31613 return [3, 7]; 31614 case 6: 31615 return e = t.sent(), yM.error(e), [3, 7]; 31616 case 7: 31617 return [2] 31618 } 31619 }) 31620 }) 31621 } 31622 } 31623 var Sn = ((Sn = {})["already-exists"] = "A Firebase Analytics instance with the appId {$id} already exists. Only one Firebase Analytics instance can be created for each appId.", Sn["already-initialized"] = "Firebase Analytics has already been initialized.settings() must be called before initializing any Analytics instanceor it will have no effect.", Sn["interop-component-reg-failed"] = "Firebase Analytics Interop Component failed to instantiate: {$reason}", Sn["invalid-analytics-context"] = "Firebase Analytics is not supported in this environment. Wrap initialization of analytics in analytics.isSupported() to prevent initialization in unsupported environments. Details: {$errorInfo}", Sn["indexeddb-unavailable"] = "IndexedDB unavailable or restricted in this environment. Wrap initialization of analytics in analytics.isSupported() to prevent initialization in unsupported environments. Details: {$errorInfo}", Sn["fetch-throttle"] = "The config fetch request timed out while in an exponential backoff state. Unix timestamp in milliseconds when fetch request throttling ends: {$throttleEndTimeMillis}.", Sn["config-fetch-failed"] = "Dynamic config fetch failed: [{$httpStatus}] {$responseMessage}", Sn["no-api-key"] = 'The "apiKey" field is empty in the local Firebase config. Firebase Analytics requires this field tocontain a valid API key.', Sn["no-app-id"] = 'The "appId" field is empty in the local Firebase config. Firebase Analytics requires this field tocontain a valid app ID.', Sn), 31624 bM = new Co("analytics", "Analytics", Sn), 31625 wM = 30; 31626 31627 function _M(t, e) { 31628 void 0 === t && (t = {}), void 0 === e && (e = 1e3), this.throttleMetadata = t, this.intervalMillis = e 31629 } 31630 var IM = new(_M.prototype.getThrottleMetadata = function (t) { 31631 return this.throttleMetadata[t] 31632 }, _M.prototype.setThrottleMetadata = function (t, e) { 31633 this.throttleMetadata[t] = e 31634 }, _M.prototype.deleteThrottleMetadata = function (t) { 31635 delete this.throttleMetadata[t] 31636 }, _M); 31637 31638 function TM(o) { 31639 var s; 31640 return $i(this, void 0, void 0, function () { 31641 var e, n, r, i; 31642 return Zi(this, function (t) { 31643 switch (t.label) { 31644 case 0: 31645 return e = o.appId, i = o.apiKey, i = { 31646 method: "GET", 31647 headers: new Headers({ 31648 Accept: "application/json", 31649 "x-goog-api-key": i 31650 }) 31651 }, e = vM.replace("{app-id}", e), [4, fetch(e, i)]; 31652 case 1: 31653 if (200 === (n = t.sent()).status || 304 === n.status) return [3, 6]; 31654 r = "", t.label = 2; 31655 case 2: 31656 return t.trys.push([2, 4, , 5]), [4, n.json()]; 31657 case 3: 31658 return i = t.sent(), null !== (s = i.error) && void 0 !== s && s.message && (r = i.error.message), [3, 5]; 31659 case 4: 31660 return t.sent(), [3, 5]; 31661 case 5: 31662 throw bM.create("config-fetch-failed", { 31663 httpStatus: n.status, 31664 responseMessage: r 31665 }); 31666 case 6: 31667 return [2, n.json()] 31668 } 31669 }) 31670 }) 31671 } 31672 31673 function EM(a, u, c) { 31674 return void 0 === u && (u = IM), $i(this, void 0, void 0, function () { 31675 var e, n, r, i, o, s = this; 31676 return Zi(this, function (t) { 31677 if (i = a.options, e = i.appId, n = i.apiKey, r = i.measurementId, !e) throw bM.create("no-app-id"); 31678 if (n) return i = u.getThrottleMetadata(e) || { 31679 backoffCount: 0, 31680 throttleEndTimeMillis: Date.now() 31681 }, o = new NM, setTimeout(function () { 31682 return $i(s, void 0, void 0, function () { 31683 return Zi(this, function (t) { 31684 return o.abort(), [2] 31685 }) 31686 }) 31687 }, void 0 !== c ? c : dM), [2, function s(a, t, u, c) { 31688 var h = t.throttleEndTimeMillis, 31689 l = t.backoffCount; 31690 void 0 === c && (c = IM); 31691 return $i(this, void 0, void 0, function () { 31692 var e, n, r, i, o; 31693 return Zi(this, function (t) { 31694 switch (t.label) { 31695 case 0: 31696 e = a.appId, n = a.measurementId, t.label = 1; 31697 case 1: 31698 return t.trys.push([1, 3, , 4]), [4, SM(u, h)]; 31699 case 2: 31700 return t.sent(), [3, 4]; 31701 case 3: 31702 if (i = t.sent(), n) return yM.warn("Timed out fetching this Firebase app's measurement ID from the server. Falling back to the measurement ID " + n + ' provided in the "measurementId" field in the local Firebase config. [' + i.message + "]"), [2, { 31703 appId: e, 31704 measurementId: n 31705 }]; 31706 throw i; 31707 case 4: 31708 return t.trys.push([4, 6, , 7]), [4, TM(a)]; 31709 case 5: 31710 return o = t.sent(), c.deleteThrottleMetadata(e), [2, o]; 31711 case 6: 31712 if (CM(r = t.sent())) return i = 503 === Number(r.customData.httpStatus) ? $o(l, c.intervalMillis, wM) : $o(l, c.intervalMillis), o = { 31713 throttleEndTimeMillis: Date.now() + i, 31714 backoffCount: l + 1 31715 }, c.setThrottleMetadata(e, o), yM.debug("Calling attemptFetch again in " + i + " millis"), [2, s(a, o, u, c)]; 31716 if (c.deleteThrottleMetadata(e), n) return yM.warn("Failed to fetch this Firebase app's measurement ID from the server. Falling back to the measurement ID " + n + ' provided in the "measurementId" field in the local Firebase config. [' + r.message + "]"), [2, { 31717 appId: e, 31718 measurementId: n 31719 }]; 31720 throw r; 31721 case 7: 31722 return [2] 31723 } 31724 }) 31725 }) 31726 }({ 31727 appId: e, 31728 apiKey: n, 31729 measurementId: r 31730 }, i, o, u)]; 31731 if (r) return [2, { 31732 measurementId: r, 31733 appId: e 31734 }]; 31735 throw bM.create("no-api-key") 31736 }) 31737 }) 31738 } 31739 31740 function SM(i, o) { 31741 return new Promise(function (t, e) { 31742 var n = Math.max(o - Date.now(), 0), 31743 r = setTimeout(t, n); 31744 i.addEventListener(function () { 31745 clearTimeout(r), e(bM.create("fetch-throttle", { 31746 throttleEndTimeMillis: o 31747 })) 31748 }) 31749 }) 31750 } 31751 31752 function CM(t) { 31753 if (t instanceof Eo && t.customData) { 31754 t = Number(t.customData.httpStatus); 31755 return 429 === t || 500 === t || 503 === t || 504 === t 31756 } 31757 } 31758 var NM = (AM.prototype.addEventListener = function (t) { 31759 this.listeners.push(t) 31760 }, AM.prototype.abort = function () {
31761 this.listeners.forEach(function (t) { 31762 return t() 31763 }) 31764 }, AM); 31765 31766 function AM() { 31767 this.listeners = [] 31768 } 31769 31770 function kM(a, u, c, h, l, f) { 31771 return $i(this, void 0, void 0, function () { 31772 var i, o, s; 31773 return Zi(this, function (t) { 31774 switch (t.label) { 31775 case 0: 31776 return (i = EM(a)).then(function (t) { 31777 c[t.measurementId] = t.appId, a.options.measurementId && t.measurementId !== a.options.measurementId && yM.warn("The measurement ID in the local Firebase config (" + a.options.measurementId + ") does not match the measurement ID fetched from the server (" + t.measurementId + "). To ensure analytics events are always sent to the correct Analytics property, update the measurement ID field in the local config or remove it from the local config.") 31778 }).catch(function (t) { 31779 return yM.error(t) 31780 }), u.push(i), o = function () { 31781 return $i(this, void 0, void 0, function () { 31782 var e; 31783 return Zi(this, function (t) { 31784 switch (t.label) { 31785 case 0: 31786 return bo() ? [3, 1] : (yM.warn(bM.create("indexeddb-unavailable", { 31787 errorInfo: "IndexedDB is not available in this environment." 31788 }).message), [2, !1]); 31789 case 1: 31790 return t.trys.push([1, 3, , 4]), [4, wo()]; 31791 case 2: 31792 return t.sent(), [3, 4]; 31793 case 3: 31794 return e = t.sent(), yM.warn(bM.create("indexeddb-unavailable", { 31795 errorInfo: e 31796 }).message), [2, !1]; 31797 case 4: 31798 return [2, !0] 31799 } 31800 }) 31801 }) 31802 }().then(function (t) { 31803 if (t) return h.getId() 31804 }), [4, Promise.all([i, o])]; 31805 case 1: 31806 return s = t.sent(), i = s[0], o = s[1], 31807 function () { 31808 for (var t = window.document.getElementsByTagName("script"), e = 0, n = Object.values(t); e < n.length; e++) { 31809 var r = n[e]; 31810 if (r.src && r.src.includes(gM)) return r 31811 } 31812 }() || (e = f, n = i.measurementId, (r = document.createElement("script")).src = gM + "?l=" + e + "&id=" + n, r.async = !0, document.head.appendChild(r)), l("js", new Date), (s = {})[pM] = "firebase", s.update = !0, s = s, null != o && (s[fM] = o), l(hM.CONFIG, i.measurementId, s), [2, i.measurementId] 31813 } 31814 var e, n, r 31815 }) 31816 }) 31817 } 31818 var RM, PM, OM = {}, 31819 DM = [], 31820 xM = {}, 31821 LM = "dataLayer", 31822 MM = "gtag", 31823 FM = !1; 31824 31825 function UM(t) { 31826 if (FM) throw bM.create("already-initialized"); 31827 t.dataLayerName && (LM = t.dataLayerName), t.gtagName && (MM = t.gtagName) 31828 } 31829 31830 function jM(t, e) { 31831 i = [], go() && i.push("This is a browser extension environment."), _o() || i.push("Cookies are not available."), 0 < i.length && (i = i.map(function (t, e) { 31832 return "(" + (e + 1) + ") " + t 31833 }).join(" "), i = bM.create("invalid-analytics-context", { 31834 errorInfo: i 31835 }), yM.warn(i.message)); 31836 var n, r, i, o, s, a, u = t.options.appId; 31837 if (!u) throw bM.create("no-app-id"); 31838 if (!t.options.apiKey) { 31839 if (!t.options.measurementId) throw bM.create("no-api-key"); 31840 yM.warn('The "apiKey" field is empty in the local Firebase config. This is needed to fetch the latest measurement ID for this Firebase app. Falling back to the measurement ID ' + t.options.measurementId + ' provided in the "measurementId" field in the local Firebase config.') 31841 } 31842 if (null != OM[u]) throw bM.create("already-exists", { 31843 id: u 31844 }); 31845 return FM || (s = LM, a = [], Array.isArray(window[s]) ? a = window[s] : window[s] = a, n = OM, r = DM, i = xM, o = LM, s = MM, a = function () { 31846 for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e]; 31847 window[o].push(arguments) 31848 }, window[s] && "function" == typeof window[s] && (a = window[s]), window[s] = mM(a, n, r, i), s = { 31849 gtagCore: a, 31850 wrappedGtag: window[s] 31851 }
31851, PM = s.wrappedGtag, RM = s.gtagCore, FM = !0), OM[u] = kM(t, DM, xM, e, RM, LM), { 31852 app: t, 31853 logEvent: function (t, e, n) { 31854 ! function (n, r, i, o, s) { 31855 return $i(this, void 0, void 0, function () { 31856 var e; 31857 return Zi(this, function (t) { 31858 switch (t.label) { 31859 case 0: 31860 return s && s.global ? (n(hM.EVENT, i, o), [2]) : [3, 1]; 31861 case 1: 31862 return [4, r]; 31863 case 2: 31864 e = t.sent(), e = Ji(Ji({}, o), { 31865 send_to: e 31866 }), n(hM.EVENT, i, e), t.label = 3; 31867 case 3: 31868 return [2] 31869 } 31870 }) 31871 }) 31872 }(PM, OM[u], t, e, n).catch(function (t) { 31873 return yM.error(t) 31874 }) 31875 }, 31876 setCurrentScreen: function (t, e) { 31877 ! function (n, r, i, o) { 31878 return $i(this, void 0, void 0, function () { 31879 var e; 31880 return Zi(this, function (t) { 31881 switch (t.label) { 31882 case 0: 31883 return o && o.global ? (n(hM.SET, { 31884 screen_name: i 31885 }), [2, Promise.resolve()]) : [3, 1]; 31886 case 1: 31887 return [4, r]; 31888 case 2: 31889 e = t.sent(), n(hM.CONFIG, e, { 31890 update: !0, 31891 screen_name: i 31892 }), t.label = 3; 31893 case 3: 31894 return [2] 31895 } 31896 }) 31897 }) 31898 }(PM, OM[u], t, e).catch(function (t) { 31899 return yM.error(t) 31900 }) 31901 }, 31902 setUserId: function (t, e) { 31903 ! function (n, r, i, o) { 31904 return $i(this, void 0, void 0, function () { 31905 var e; 31906 return Zi(this, function (t) { 31907 switch (t.label) { 31908 case 0: 31909 return o && o.global ? (n(hM.SET, { 31910 user_id: i 31911 }), [2, Promise.resolve()]) : [3, 1]; 31912 case 1: 31913 return [4, r]; 31914 case 2: 31915 e = t.sent(), n(hM.CONFIG, e, { 31916 update: !0, 31917 user_id: i 31918 }), t.label = 3; 31919 case 3: 31920 return [2] 31921 } 31922 }) 31923 }) 31924 }(PM, OM[u], t, e).catch(function (t) { 31925 return yM.error(t) 31926 }) 31927 }, 31928 setUserProperties: function (t, e) { 31929 ! function (s, a, u, c) { 31930 return $i(this, void 0, void 0, function () { 31931 var e, n, r, i, o; 31932 return Zi(this, function (t) { 31933 switch (t.label) { 31934 case 0: 31935 if (!c || !c.global) return [3, 1]; 31936 for (e = {}, n = 0, r = Object.keys(u); n < r.length; n++) i = r[n], e["user_properties." + i] = u[i]; 31937 return s(hM.SET, e), [2, Promise.resolve()]; 31938 case 1: 31939 return [4, a]; 31940 case 2: 31941 o = t.sent(), s(hM.CONFIG, o, { 31942 update: !0, 31943 user_properties: u 31944 }), t.label = 3; 31945 case 3: 31946 return [2] 31947 } 31948 }) 31949 }) 31950 }
31950(PM, OM[u], t, e).catch(function (t) { 31951 return yM.error(t) 31952 }) 31953 }, 31954 setAnalyticsCollectionEnabled: function (t) { 31955 ! function (n, r) { 31956 return $i(this, void 0, void 0, function () { 31957 var e; 31958 return Zi(this, function (t) { 31959 switch (t.label) { 31960 case 0: 31961 return [4, n]; 31962 case 1: 31963 return e = t.sent(), window["ga-disable-" + e] = !r, [2] 31964 } 31965 }) 31966 }) 31967 }(OM[u], t).catch(function (t) { 31968 return yM.error(t) 31969 }) 31970 }, 31971 INTERNAL: { 31972 delete: function () { 31973 return delete OM[u], Promise.resolve() 31974 } 31975 } 31976 } 31977 } 31978 var qM, VM = "analytics"; 31979 31980 function BM() { 31981 return $i(this, void 0, void 0, function () { 31982 return Zi(this, function (t) { 31983 switch (t.label) { 31984 case 0: 31985 if (go()) return [2, !1]; 31986 if (!_o()) return [2, !1]; 31987 if (!bo()) return [2, !1]; 31988 t.label = 1; 31989 case 1: 31990 return t.trys.push([1, 3, , 4]), [4, wo()]; 31991 case 2: 31992 return [2, t.sent()]; 31993 case 3: 31994 return t.sent(), [2, !1]; 31995 case 4: 31996 return [2] 31997 } 31998 }) 31999 }) 32000 }(qM = Xl).INTERNAL.registerComponent(new ts(VM, function (t) { 32001 return jM(t.getProvider("app").getImmediate(), t.getProvider("installations").getImmediate()) 32002 }, "PUBLIC").setServiceProps({ 32003 settings: UM, 32004 EventName: lM, 32005 isSupported: BM 32006 })), qM.INTERNAL.registerComponent(new ts("analytics-internal", function (t) { 32007 try { 32008 return { 32009 logEvent: t.getProvider(VM).getImmediate().logEvent 32010 } 32011 } catch (t) { 32012 throw bM.create("interop-component-reg-failed", { 32013 reason: t 32014 }) 32015 } 32016 }, "PRIVATE")), qM.registerVersion("@firebase/analytics", "0.6.7"); 32017 var KM = (WM.prototype.isCachedDataFresh = function (t, e) { 32018 if (!e) return this.logger.debug("Config fetch cache check. Cache unpopulated."), !1; 32019 var n = Date.now() - e, 32020 e = n <= t; 32021 return this.logger.debug("Config fetch cache check. Cache age millis: " + n + ". Cache max age millis (minimumFetchIntervalMillis setting): " + t + ". Is cache hit: " + e + "."), e 32022 }, WM.prototype.fetch = function (i) { 32023 return $i(this, void 0, void 0, function () { 32024 var e, n, r; 32025 return Zi(this, function (t) { 32026 switch (t.label) { 32027 case 0: 32028 return [4, Promise.all([this.storage.getLastSuccessfulFetchTimestampMillis(), this.storage.getLastSuccessfulFetchResponse()])]; 32029 case 1: 32030 return (r = t.sent(), e = r[0], (r = r[1]) && this.isCachedDataFresh(i.cacheMaxAgeMillis, e)) ? [2, r] : (i.eTag = r && r.eTag, [4, this.client.fetch(i)]); 32031 case 2: 32032 return n = t.sent(), r = [this.storageCache.setLastSuccessfulFetchTimestampMillis(Date.now())], 200 === n.status && r.push(this.storage.setLastSuccessfulFetchResponse(n)), [4, Promise.all(r)]; 32033 case 3: 32034 return t.sent(), [2, n] 32035 } 32036 }) 32037 }) 32038 }, WM); 32039 32040 function WM(t, e, n, r) { 32041 this.client = t, this.storage = e, this.storageCache = n, this.logger = r 32042 } 32043 var Sn = ((Sn = {})["registration-window"] = "Undefined window object. This SDK only supports usage in a browser environment.", Sn["registration-project-id"] = "Undefined project identifier. Check Firebase app initialization.", Sn["registration-api-key"] = "Undefined API key. Check Firebase app initialization.", Sn["registration-app-id"] = "Undefined app identifier. Check Firebase app initialization.", Sn["storage-open"] = "Error thrown when opening storage. Original error: {$originalErrorMessage}.", Sn["storage-get"] = "Error thrown when reading from storage. Original error: {$originalErrorMessage}.", Sn["storage-set"] = "Error thrown when writing to storage. Original error: {$originalErrorMessage}
32043.", Sn["storage-delete"] = "Error thrown when deleting from storage. Original error: {$originalErrorMessage}.", Sn["fetch-client-network"] = "Fetch client failed to connect to a network. Check Internet connection. Original error: {$originalErrorMessage}.", Sn["fetch-timeout"] = 'The config fetch request timed out. Configure timeout using "fetchTimeoutMillis" SDK setting.', Sn["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}.', Sn["fetch-client-parse"] = "Fetch client could not parse response. Original error: {$originalErrorMessage}.", Sn["fetch-status"] = "Fetch server returned an HTTP error status. HTTP status: {$httpStatus}.", Sn), 32044 HM = new Co("remoteconfig", "Remote Config", Sn); 32045 var GM = (zM.prototype.fetch = function (f) { 32046 return $i(this, void 0, void 0, function () { 32047 var n, r, i, o, s, a, u, c, h, l; 32048 return Zi(this, function (t) { 32049 switch (t.label) { 32050 case 0: 32051 return [4, Promise.all([this.firebaseInstallations.getId(), this.firebaseInstallations.getToken()])]; 32052 case 1: 32053 o = t.sent(), n = o[0], i = o[1], r = window.FIREBASE_REMOTE_CONFIG_URL_BASE || "https://firebaseremoteconfig.googleapis.com", o = r + "/v1/projects/" + this.projectId + "/namespaces/" + this.namespace + ":fetch?key=" + this.apiKey, r = { 32054 "Content-Type": "application/json", 32055 "Content-Encoding": "gzip", 32056 "If-None-Match": f.eTag || "*" 32057 }, i = { 32058 sdk_version: this.sdkVersion, 32059 app_instance_id: n, 32060 app_instance_id_token: i, 32061 app_id: this.appId, 32062 language_code: (e = void 0 === e ? navigator : e).languages && e.languages[0] || e.language 32063 }, i = { 32064 method: "POST", 32065 headers: r, 32066 body: JSON.stringify(i) 32067 }, o = fetch(o, i), i = new Promise(function (t, e) { 32068 f.signal.addEventListener(function () { 32069 var t = new Error("The operation was aborted."); 32070 t.name = "AbortError", e(t) 32071 }) 32072 }), t.label = 2; 32073 case 2: 32074 return t.trys.push([2, 5, , 6]), [4, Promise.race([o, i])]; 32075 case 3: 32076 return t.sent(), [4, o]; 32077 case 4: 32078 return l = t.sent(), [3, 6]; 32079 case 5: 32080 throw i = t.sent(), o = "fetch-client-network", "AbortError" === i.name && (o = "fetch-timeout"), HM.create(o, { 32081 originalErrorMessage: i.message 32082 }); 32083 case 6: 32084 if (s = l.status, a = l.headers.get("ETag") || void 0, 200 !== l.status) return [3, 11]; 32085 h = void 0, t.label = 7; 32086 case 7: 32087 return t.trys.push([7, 9, , 10]), [4, l.json()]; 32088 case 8: 32089 return h = t.sent(), [3, 10]; 32090 case 9: 32091 throw l = t.sent(), HM.create("fetch-client-parse", { 32092 originalErrorMessage: l.message 32093 }); 32094 case 10: 32095 u = h.entries, c = h.state, t.label = 11; 32096 case 11: 32097 if ("INSTANCE_STATE_UNSPECIFIED" === c ? s = 500 : "NO_CHANGE" === c ? s = 304 : "NO_TEMPLATE" !== c && "EMPTY_CONFIG" !== c || (u = {}), 304 !== s && 200 !== s) throw HM.create("fetch-status", { 32098 httpStatus: s 32099 }); 32100 return [2, { 32101 status: s, 32102 eTag: a, 32103 config: u 32104 }] 32105 } 32106 var e 32107 }) 32108 }) 32109 }, zM); 32110 32111 function zM(t, e, n, r, i, o) { 32112 this.firebaseInstallations = t, this.sdkVersion = e, this.namespace = n, this.projectId = r, this.apiKey = i, this.appId = o 32113 } 32114 var QM = (YM.prototype.addEventListener = function (t) { 32115 this.listeners.push(t) 32116 }, YM.prototype.abort = function () {
32117 this.listeners.forEach(function (t) { 32118 return t() 32119 }) 32120 }, YM); 32121 32122 function YM() { 32123 this.listeners = [] 32124 } 32125 var XM = ["1", "true", "t", "yes", "y", "on"], 32126 JM = ($M.prototype.asString = function () { 32127 return this._value 32128 }, $M.prototype.asBoolean = function () { 32129 return "static" !== this._source && 0 <= XM.indexOf(this._value.toLowerCase()) 32130 }, $M.prototype.asNumber = function () { 32131 if ("static" === this._source) return 0; 32132 var t = Number(this._value); 32133 return t = isNaN(t) ? 0 : t 32134 }, $M.prototype.getSource = function () { 32135 return this._source 32136 }, $M); 32137 32138 function $M(t, e) { 32139 void 0 === e && (e = ""), this._source = t, this._value = e 32140 } 32141 var ZM = (tF.prototype.setLogLevel = function (t) { 32142 switch (t) { 32143 case "debug": 32144 this._logger.logLevel = as.DEBUG; 32145 break; 32146 case "silent": 32147 this._logger.logLevel = as.SILENT; 32148 break; 32149 default: 32150 this._logger.logLevel = as.ERROR 32151 } 32152 }, Object.defineProperty(tF.prototype, "fetchTimeMillis", { 32153 get: function () { 32154 return this._storageCache.getLastSuccessfulFetchTimestampMillis() || -1 32155 }, 32156 enumerable: !1, 32157 configurable: !0 32158 }), Object.defineProperty(tF.prototype, "lastFetchStatus", { 32159 get: function () { 32160 return this._storageCache.getLastFetchStatus() || "no-fetch-yet" 32161 }, 32162 enumerable: !1, 32163 configurable: !0 32164 }), tF.prototype.activate = function () { 32165 return $i(this, void 0, void 0, function () { 32166 var e, n; 32167 return Zi(this, function (t) { 32168 switch (t.label) { 32169 case 0: 32170 return [4, Promise.all([this._storage.getLastSuccessfulFetchResponse(), this._storage.getActiveConfigEtag()])]; 32171 case 1: 32172 return n = t.sent(), e = n[0], n = n[1], e && e.config && e.eTag && e.eTag !== n ? [4, Promise.all([this._storageCache.setActiveConfig(e.config), this._storage.setActiveConfigEtag(e.eTag)])] : [2, !1]; 32173 case 2: 32174 return t.sent(), [2, !0] 32175 } 32176 }) 32177 }) 32178 }, tF.prototype.ensureInitialized = function () { 32179 var t = this; 32180 return this._initializePromise || (this._initializePromise = this._storageCache.loadFromStorage().then(function () { 32181 t._isInitializationComplete = !0 32182 })), this._initializePromise 32183 }, tF.prototype.fetch = function () { 32184 return $i(this, void 0, void 0, function () { 32185 var r, i, o, s = this; 32186 return Zi(this, function (t) { 32187 switch (t.label) { 32188 case 0: 32189 r = new QM, setTimeout(function () { 32190 return $i(s, void 0, void 0, function () { 32191 return Zi(this, function (t) { 32192 return r.abort(), [2] 32193 }) 32194 }) 32195 }, this.settings.fetchTimeoutMillis), t.label = 1; 32196 case 1: 32197 return t.trys.push([1, 4, , 6]), [4, this._client.fetch({ 32198 cacheMaxAgeMillis: this.settings.minimumFetchIntervalMillis, 32199 signal: r 32200 })]; 32201 case 2: 32202 return t.sent(), [4, this._storageCache.setLastFetchStatus("success")]; 32203 case 3: 32204 return t.sent(), [3, 6]; 32205 case 4: 32206 return i = t.sent(), n = "fetch-throttle", o = (e = i) instanceof Eo && -1 !== e.code.indexOf(n) ? "throttle" : "failure", [4, this._storageCache.setLastFetchStatus(o)]; 32207 case 5: 32208 throw t.sent(), i; 32209 case 6: 32210 return [2] 32211 } 32212 var e, n 32213 }) 32214 }) 32215 }, tF.prototype.fetchAndActivate = function () { 32216 return $i(this, void 0, void 0, function () { 32217 return Zi(this, function (t) { 32218 switch (t.label) { 32219 case 0: 32220 return [4, this.fetch()]; 32221 case 1: 32222 return t.sent(), [2, this.activate()] 32223 } 32224 }) 32225 }) 32226 }, tF.prototype.getAll = function () { 32227 var n = this; 32228 return function (t, e) { 32229 void 0 === t && (t = {}); 32230 void 0 === e && (e = {}); 32231 return Object.keys(Ji(Ji({}, t), e)) 32232 }(this._storageCache.getActiveConfig(), this.defaultConfig).reduce(function (t, e) { 32233 return t[e] = n.getValue(e), t 32234 }, {}) 32235 }, tF.prototype.getBoolean = function (t) { 32236 return this.getValue(t).asBoolean() 32237 }, tF.prototype.getNumber = function (t) { 32238 return this.getValue(t).asNumber() 32239 }, tF.prototype.getString = function (t) { 32240 return this.getValue(t).asString() 32241 }, tF.prototype.getValue = function (t) { 32242 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.'); 32243 var e = this._storageCache.getActiveConfig(); 32244 return e && void 0 !== e[t] ? new JM("remote", e[t]) : this.defaultConfig && void 0 !== this.defaultConfig[t] ? new JM("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 JM("static")) 32245 }, tF); 32246 32247 function tF(t, e, n, r, i) { 32248 this.app = t, this._client = e, this._storageCache = n, this._storage = r, this._logger = i, this._isInitializationComplete = !1, this.settings = { 32249 fetchTimeoutMillis: 6e4, 32250 minimumFetchIntervalMillis: 432e5 32251 }, this.defaultConfig = {} 32252 } 32253 32254 function eF(t, e) { 32255 t = t.target.error || void 0; 32256 return HM.create(e, { 32257 originalErrorMessage: t && t.message 32258 }) 32259 } 32260 var nF = "app_namespace_store", 32261 rF = "firebase_remote_config", 32262 iF = 1; 32263 var oF = (sF.prototype.getLastFetchStatus = function () { 32264 return this.get("last_fetch_status") 32265 }, sF.prototype.setLastFetchStatus = function (t) { 32266 return this.set("last_fetch_status", t) 32267 }, sF.prototype.getLastSuccessfulFetchTimestampMillis = function () { 32268 return this.get("last_successful_fetch_timestamp_millis") 32269 }, sF.prototype.setLastSuccessfulFetchTimestampMillis = function (t) { 32270 return this.set("last_successful_fetch_timestamp_millis", t) 32271 }, sF.prototype.getLastSuccessfulFetchResponse = function () { 32272 return this.get("last_successful_fetch_response") 32273 }, sF.prototype.setLastSuccessfulFetchResponse = function (t) { 32274 return this.set("last_successful_fetch_response", t) 32275 }, sF.prototype.getActiveConfig = function () { 32276 return this.get("active_config") 32277 }, sF.prototype.setActiveConfig = function (t) { 32278 return this.set("active_config", t) 32279 }, sF.prototype.getActiveConfigEtag = function () { 32280 return this.get("active_config_etag") 32281 }, sF.prototype.setActiveConfigEtag = function (t) { 32282 return this.set("active_config_etag", t) 32283 }, sF.prototype.getThrottleMetadata = function () { 32284 return this.get("throttle_metadata") 32285 }, sF.prototype.setThrottleMetadata = function (t) { 32286 return this.set("throttle_metadata", t) 32287 }, sF.prototype.deleteThrottleMetadata = function () { 32288 return this.delete("throttle_metadata") 32289 }, sF.prototype.get = function (a) { 32290 return $i(this, void 0, void 0, function () { 32291 var o, s = this; 32292 return Zi(this, function (t) { 32293 switch (t.label) { 32294 case 0: 32295 return [4, this.openDbPromise]; 32296 case 1: 32297 return o = t.sent(), [2, new Promise(function (e, n) { 32298 var t = o.transaction([nF], "readonly").objectStore(nF), 32299 r = s.createCompositeKey(a); 32300 try { 32301 var i = t.get(r); 32302 i.onerror = function (t) { 32303 n(eF(t, "storage-get")) 32304 }, i.onsuccess = function (t) { 32305 t = t.target.result; 32306 e(t ? t.value : void 0) 32307 } 32308 } catch (t) { 32309 n(HM.create("storage-get", { 32310 originalErrorMessage: t && t.message 32311 })) 32312 } 32313 })] 32314 } 32315 }) 32316 }) 32317 }, sF.prototype.set = function (a, u) { 32318 return $i(this, void 0, void 0, function () { 32319 var o, s = this; 32320 return Zi(this, function (t) { 32321 switch (t.label) { 32322 case 0: 32323 return [4, this.openDbPromise]; 32324 case 1: 32325 return o = t.sent(), [2, new Promise(function (t, e) { 32326 var n = o.transaction([nF], "readwrite").objectStore(nF), 32327 r = s.createCompositeKey(a); 32328 try { 32329 var i = n.put({ 32330 compositeKey: r, 32331 value: u 32332 }); 32333 i.onerror = function (t) { 32334 e(eF(t, "storage-set")) 32335 }, i.onsuccess = function () { 32336 t() 32337 } 32338 } catch (t) { 32339 e(HM.create("storage-set", { 32340 originalErrorMessage: t && t.message 32341 })) 32342 } 32343 })] 32344 } 32345 }) 32346 }) 32347 }, sF.prototype.delete = function (a) { 32348 return $i(this, void 0, void 0, function () { 32349 var o, s = this; 32350 return Zi(this, function (t) { 32351 switch (t.label) { 32352 case 0: 32353 return [4, this.openDbPromise]; 32354 case 1: 32355 return o = t.sent(), [2, new Promise(function (t, e) { 32356 var n = o.transaction([nF], "readwrite").objectStore(nF), 32357 r = s.createCompositeKey(a); 32358 try { 32359 var i = n.delete(r); 32360 i.onerror = function (t) { 32361 e(eF(t, "storage-delete")) 32362 }, i.onsuccess = function () { 32363 t() 32364 } 32365 } catch (t) { 32366 e(HM.create("storage-delete", { 32367 originalErrorMessage: t && t.message 32368 })) 32369 } 32370 })] 32371 } 32372 }) 32373 }) 32374 }, sF.prototype.createCompositeKey = function (t) { 32375 return [this.appId, this.appName, this.namespace, t].join() 32376 }, sF); 32377 32378 function sF(t, e, n, r) { 32379 void 0 === r && (r = new Promise(function (e, n) { 32380 var t = indexedDB.open(rF, iF); 32381 t.onerror = function (t) { 32382 n(eF(t, "storage-open")) 32383 }, t.onsuccess = function (t) { 32384 e(t.target.result) 32385 }
32385, t.onupgradeneeded = function (t) { 32386 var e = t.target.result; 32387 0 === t.oldVersion && e.createObjectStore(nF, { 32388 keyPath: "compositeKey" 32389 }) 32390 } 32391 })), this.appId = t, this.appName = e, this.namespace = n, this.openDbPromise = r 32392 } 32393 var aF = (uF.prototype.getLastFetchStatus = function () { 32394 return this.lastFetchStatus 32395 }, uF.prototype.getLastSuccessfulFetchTimestampMillis = function () { 32396 return this.lastSuccessfulFetchTimestampMillis 32397 }, uF.prototype.getActiveConfig = function () { 32398 return this.activeConfig 32399 }, uF.prototype.loadFromStorage = function () { 32400 return $i(this, void 0, void 0, function () { 32401 var e, n, r; 32402 return Zi(this, function (t) { 32403 switch (t.label) { 32404 case 0: 32405 return e = this.storage.getLastFetchStatus(), n = this.storage.getLastSuccessfulFetchTimestampMillis(), r = this.storage.getActiveConfig(), [4, e]; 32406 case 1: 32407 return (e = t.sent()) && (this.lastFetchStatus = e), [4, n]; 32408 case 2: 32409 return (n = t.sent()) && (this.lastSuccessfulFetchTimestampMillis = n), [4, r]; 32410 case 3: 32411 return (r = t.sent()) && (this.activeConfig = r), [2] 32412 } 32413 }) 32414 }) 32415 }, uF.prototype.setLastFetchStatus = function (t) { 32416 return this.lastFetchStatus = t, this.storage.setLastFetchStatus(t) 32417 }, uF.prototype.setLastSuccessfulFetchTimestampMillis = function (t) { 32418 return this.lastSuccessfulFetchTimestampMillis = t, this.storage.setLastSuccessfulFetchTimestampMillis(t) 32419 }, uF.prototype.setActiveConfig = function (t) { 32420 return this.activeConfig = t, this.storage.setActiveConfig(t) 32421 }, uF); 32422 32423 function uF(t) { 32424 this.storage = t 32425 } 32426 var cF = (hF.prototype.fetch = function (n) { 32427 return $i(this, void 0, void 0, function () { 32428 var e; 32429 return Zi(this, function (t) { 32430 switch (t.label) { 32431 case 0: 32432 return [4, this.storage.getThrottleMetadata()]; 32433 case 1: 32434 return e = t.sent() || { 32435 backoffCount: 0, 32436 throttleEndTimeMillis: Date.now() 32437 }, [2, this.attemptFetch(n, e)] 32438 } 32439 }) 32440 }) 32441 }, hF.prototype.attemptFetch = function (r, t) { 32442 var s = t.throttleEndTimeMillis, 32443 a = t.backoffCount; 32444 return $i(this, void 0, void 0, function () { 32445 var e, n; 32446 return Zi(this, function (t) { 32447 switch (t.label) { 32448 case 0: 32449 return [4, (i = r.signal, o = s, new Promise(function (t, e) { 32450 var n = Math.max(o - Date.now(), 0), 32451 r = setTimeout(t, n); 32452 i.addEventListener(function () { 32453 clearTimeout(r), e(HM.create("fetch-throttle", { 32454 throttleEndTimeMillis: o 32455 })) 32456 }) 32457 }))]; 32458 case 1: 32459 t.sent(), t.label = 2; 32460 case 2: 32461 return t.trys.push([2, 5, , 7]), [4, this.client.fetch(r)]; 32462 case 3: 32463 return e = t.sent(), [4, this.storage.deleteThrottleMetadata()]; 32464 case 4: 32465 return t.sent(), [2, e]; 32466 case 5: 32467 if (! function (t) { 32468 if (t instanceof Eo && t.customData) { 32469 t = Number(t.customData.httpStatus); 32470 return 429 === t || 500 === t || 503 === t || 504 === t 32471 } 32472 }(n = t.sent())) throw n; 32473 return n = { 32474 throttleEndTimeMillis: Date.now() + $o(a), 32475 backoffCount: a + 1 32476 }, [4, this.storage.setThrottleMetadata(n)]; 32477 case 6: 32478 return t.sent(), [2, this.attemptFetch(r, n)]; 32479 case 7: 32480 return [2] 32481 } 32482 var i, o 32483 }) 32484 }) 32485 }, hF); 32486 32487 function hF(t, e) { 32488 this.client = t, this.storage = e 32489 } 32490 var lF, fF = "@firebase/remote-config"; 32491 return (lF = Xl).INTERNAL.registerComponent(new ts("remoteConfig", function (t, e) { 32492 var n = e.instanceIdentifier, 32493 r = t.getProvider("app").getImmediate(), 32494 i = t.getProvider("installations").getImmediate(); 32495 if ("undefined" == typeof window) throw HM.create("registration-window"); 32496 var o = r.options, 32497 s = o.projectId, 32498 a = o.apiKey, 32499 u = o.appId; 32500 if (!s) throw HM.create("registration-project-id"); 32501 if (!a) throw HM.create("registration-api-key"); 32502 if (!u) throw HM.create("registration-app-id"); 32503 n = n || "firebase"; 32504 e = new oF(u, r.name, n), t = new aF(e), o = new ps(fF); 32505 o.logLevel = as.ERROR; 32506 u = new GM(i, lF.SDK_VERSION, n, s, a, u), u = new cF(u, e), u = new KM(u, e, t, o), o = new ZM(r, u, t, e, o); 32507 return o.ensureInitialized(), o 32508 }, "PUBLIC").setMultipleInstances(!0)), lF.registerVersion(fF, "0.1.34"), console.warn("\nIt looks like you're using the development build of the Firebase JS SDK.\nWhen deploying Firebase apps to production, it is advisable to only import\nthe individual SDK components you intend to use.\n\nFor the CDN builds, these are available in the following manner\n(replace <PACKAGE> with the name of a component - i.e. auth, database, etc):\n\nhttps://www.gstatic.
32508com/firebasejs/5.0.0/firebase-<PACKAGE>.js\n"), Xl.registerVersion("firebase", "8.3.2", "cdn"), Xl 32509}); 32510//# sourceMappingURL=firebase.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.