binnacle 0.4.9 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (27) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -1
  3. data/Gemfile.lock +15 -15
  4. data/lib/binnacle/version.rb +1 -1
  5. data/lib/generators/binnacle/templates/firebase-messaging-sw.js.erb +2 -2
  6. data/spec/commands_spec.rb +6 -6
  7. data/vendor/assets/javascripts/base64/base64.js +6 -2
  8. data/vendor/assets/javascripts/binnacle/binnacle.js +335 -619
  9. data/vendor/assets/javascripts/firebase/firebase-app-externs.js +46 -2
  10. data/vendor/assets/javascripts/firebase/firebase-app.js +5 -35
  11. data/vendor/assets/javascripts/firebase/firebase-auth-externs.js +684 -36
  12. data/vendor/assets/javascripts/firebase/firebase-auth.js +293 -241
  13. data/vendor/assets/javascripts/firebase/firebase-database-externs.js +48 -1
  14. data/vendor/assets/javascripts/firebase/firebase-database.js +22 -254
  15. data/vendor/assets/javascripts/firebase/firebase-messaging-externs.js +29 -10
  16. data/vendor/assets/javascripts/firebase/firebase-messaging.js +5 -35
  17. data/vendor/assets/javascripts/firebase/firebase-storage-externs.js +30 -10
  18. data/vendor/assets/javascripts/firebase/firebase-storage.js +5 -52
  19. data/vendor/assets/javascripts/firebase/firebase.js +319 -605
  20. data/vendor/assets/javascripts/moment/min/locales.min.js +498 -0
  21. data/vendor/assets/javascripts/moment/min/moment-with-locales.js +3 -3
  22. data/vendor/assets/javascripts/moment/min/moment-with-locales.min.js +505 -0
  23. data/vendor/assets/javascripts/moment/min/moment.min.js +2 -2
  24. data/vendor/assets/javascripts/moment/moment.js +3 -3
  25. data/vendor/assets/javascripts/moment/src/lib/locale/set.js +1 -1
  26. data/vendor/assets/javascripts/moment/src/moment.js +2 -2
  27. metadata +4 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 957b5284e87ffafca6a136ed720f5b7fc95cf095
4
- data.tar.gz: 78b6d5c88873e108f166a13b2d8b001ded78c98d
3
+ metadata.gz: 252dc52875fd8a1cdce9b20f5cc00e79544caca8
4
+ data.tar.gz: 5b3bc2c89bbb47dcf2fee44b9e1a358948aeb205
5
5
  SHA512:
6
- metadata.gz: 652ce111e80447a30de76e235bc54626908cb9a25d2bab117d9360643ed045b301a416e91206793c30ff47744e78911e9bf1141c7242b6b6c2386225238e6509
7
- data.tar.gz: 56720fc4a5ce64a7966472b6703d0a03714215fdab8253f232b63c6b8d640a418b1b257ac61ca15dc98f9a8cfea26a480f9a701bf91352b01e283a018f0634a2
6
+ metadata.gz: 8a5a7896cd9fdff11aa1eb1f9d2ca9e36b08c7b4d2f38741d069ac39761ffa21087112f3ceae8ecdbbcfcf61996e225bd6208ef14613c6f797350752694e695e
7
+ data.tar.gz: b5c4a8cfa0b1d22f413260f494b280e97f044b86dc6c03dfa71ea5a9bca1c5e6eba83baac3ef42051bdc7af9140f44aa16a5c7ac5d65fa29d521d83d85128708
data/Gemfile CHANGED
@@ -2,7 +2,7 @@ source 'https://rubygems.org'
2
2
  source 'https://rails-assets.org'
3
3
 
4
4
  source 'https://rails-assets.org' do
5
- gem 'rails-assets-binnacle', '>= 0.2.6'
5
+ gem 'rails-assets-binnacle', '>= 0.2.7'
6
6
  end
7
7
 
8
8
  gemspec
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- binnacle (0.4.9)
4
+ binnacle (0.5.0)
5
5
  addressable (~> 2.5)
6
6
  colorize (~> 0.8.1)
7
7
  faraday (~> 0.11)
@@ -28,9 +28,9 @@ GEM
28
28
  unf (>= 0.0.5, < 1.0.0)
29
29
  ethon (0.10.1)
30
30
  ffi (>= 1.3.0)
31
- eventmachine (1.2.3)
32
- excon (0.57.1)
33
- faraday (0.12.1)
31
+ eventmachine (1.2.5)
32
+ excon (0.58.0)
33
+ faraday (0.12.2)
34
34
  multipart-post (>= 1.2, < 3)
35
35
  faye-websocket (0.10.7)
36
36
  eventmachine (>= 0.12.0)
@@ -47,25 +47,25 @@ GEM
47
47
  domain_name (~> 0.5)
48
48
  http-form_data (1.0.3)
49
49
  http_parser.rb (0.6.0)
50
- httparty (0.15.5)
50
+ httparty (0.15.6)
51
51
  multi_xml (>= 0.5.2)
52
52
  httpclient (2.8.3)
53
53
  json (2.1.0)
54
54
  multi_xml (0.6.0)
55
55
  multipart-post (2.0.0)
56
- patron (0.8.0)
56
+ patron (0.9.1)
57
57
  public_suffix (2.0.5)
58
58
  rack (2.0.3)
59
59
  rack-timeout (0.4.2)
60
60
  rails-assets-atmosphere (2.3.2)
61
- rails-assets-base64 (1.0.0)
62
- rails-assets-binnacle (0.2.6)
61
+ rails-assets-base64 (1.0.1)
62
+ rails-assets-binnacle (0.2.7)
63
63
  rails-assets-atmosphere (= 2.3.2)
64
- rails-assets-base64 (= 1.0.0)
65
- rails-assets-firebase (= 3.7.1)
66
- rails-assets-moment (= 2.18.0)
67
- rails-assets-firebase (3.7.1)
68
- rails-assets-moment (2.18.0)
64
+ rails-assets-base64 (= 1.0.1)
65
+ rails-assets-firebase (= 4.2.0)
66
+ rails-assets-moment (= 2.18.1)
67
+ rails-assets-firebase (4.2.0)
68
+ rails-assets-moment (2.18.1)
69
69
  rake (10.5.0)
70
70
  rspec (3.6.0)
71
71
  rspec-core (~> 3.6.0)
@@ -90,7 +90,7 @@ GEM
90
90
  json (>= 1.8, < 3)
91
91
  simplecov-html (~> 0.10.0)
92
92
  simplecov-html (0.10.1)
93
- thin (1.7.1)
93
+ thin (1.7.2)
94
94
  daemons (~> 1.0, >= 1.0.9)
95
95
  eventmachine (~> 1.0, >= 1.0.4)
96
96
  rack (>= 1, < 3)
@@ -123,7 +123,7 @@ DEPENDENCIES
123
123
  httparty (~> 0.14)
124
124
  patron (~> 0.8)
125
125
  rack (~> 2.0)
126
- rails-assets-binnacle (>= 0.2.6)!
126
+ rails-assets-binnacle (>= 0.2.7)!
127
127
  rake (~> 10.5)
128
128
  rspec (~> 3.5, >= 3.2.0)
129
129
  rspec-collection_matchers (~> 1.1, >= 1.1.2)
@@ -1,3 +1,3 @@
1
1
  module Binnacle
2
- VERSION = "0.4.9"
2
+ VERSION = "0.5.0"
3
3
  end
@@ -2,8 +2,8 @@
2
2
  // Give the service worker access to Firebase Messaging.
3
3
  // Note that you can only use Firebase Messaging here, other Firebase libraries
4
4
  // are not available in the service worker.
5
- importScripts('https://www.gstatic.com/firebasejs/3.5.2/firebase-app.js');
6
- importScripts('https://www.gstatic.com/firebasejs/3.5.2/firebase-messaging.js');
5
+ importScripts('https://www.gstatic.com/firebasejs/4.2.0/firebase-app.js');
6
+ importScripts('https://www.gstatic.com/firebasejs/4.2.0/firebase-messaging.js');
7
7
 
8
8
  // Initialize the Firebase app in the service worker by passing in the
9
9
  // messagingSenderId.
@@ -92,10 +92,10 @@ EOS
92
92
 
93
93
  TAIL_DASH_L = <<-EOS
94
94
  Retrieving last 10 lines since 60 minutes ago from Channel icoc0tnol3obe8pas207 ...
95
- production::INFO [2017-07-06 14:59:36 -0400] log :: ip = 0:0:0:0:0:0:0:1
96
- production::DEBUG [2017-07-06 14:59:37 -0400] log :: ip = 0:0:0:0:0:0:0:1
97
- production::INFO [2017-07-06 15:21:31 -0400] failed_tra :: session_id = 8675309, ip = 0:0:0:0:0:0:0:1
98
- production::INFO [2017-07-06 15:22:45 -0400] failed_tra :: session_id = 8675309, ip = 0:0:0:0:0:0:0:1
99
- production::DEBUG [2017-07-06 15:23:03 -0400] log :: ip = 0:0:0:0:0:0:0:1
100
- production::INFO [2017-07-06 15:23:21 -0400] log :: ip = 0:0:0:0:0:0:0:1
95
+ production::INFO [2017-07-06 11:59:36 -0700] log :: ip = 0:0:0:0:0:0:0:1
96
+ production::DEBUG [2017-07-06 11:59:37 -0700] log :: ip = 0:0:0:0:0:0:0:1
97
+ production::INFO [2017-07-06 12:21:31 -0700] failed_tra :: session_id = 8675309, ip = 0:0:0:0:0:0:0:1
98
+ production::INFO [2017-07-06 12:22:45 -0700] failed_tra :: session_id = 8675309, ip = 0:0:0:0:0:0:0:1
99
+ production::DEBUG [2017-07-06 12:23:03 -0700] log :: ip = 0:0:0:0:0:0:0:1
100
+ production::INFO [2017-07-06 12:23:21 -0700] log :: ip = 0:0:0:0:0:0:0:1
101
101
  EOS
@@ -1,6 +1,10 @@
1
1
  ;(function () {
2
2
 
3
- var object = typeof exports != 'undefined' ? exports : self; // #8: web workers
3
+ var object =
4
+ typeof exports != 'undefined' ? exports :
5
+ typeof self != 'undefined' ? self : // #8: web workers
6
+ $.global; // #31: ExtendScript
7
+
4
8
  var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
5
9
 
6
10
  function InvalidCharacterError(message) {
@@ -37,7 +41,7 @@
37
41
  // [https://gist.github.com/1020396] by [https://github.com/atk]
38
42
  object.atob || (
39
43
  object.atob = function (input) {
40
- var str = String(input).replace(/=+$/, '');
44
+ var str = String(input).replace(/[=]+$/, ''); // #31: ExtendScript bad parse of /=
41
45
  if (str.length % 4 == 1) {
42
46
  throw new InvalidCharacterError("'atob' failed: The string to be decoded is not correctly encoded.");
43
47
  }
@@ -1,5 +1,5 @@
1
1
  /* ===========================================================
2
- # Binnacle JS - v0.2.6
2
+ # Binnacle JS - v0.2.7
3
3
  # ==============================================================
4
4
  # Copyright (c) 2017 Brian Sam-Bodden
5
5
  # Licensed .
@@ -3477,620 +3477,334 @@
3477
3477
  }));
3478
3478
  /* jshint eqnull:true, noarg:true, noempty:true, eqeqeq:true, evil:true, laxbreak:true, undef:true, browser:true, indent:false, maxerr:50 */
3479
3479
 
3480
- /*! @license Firebase v3.7.1
3481
- Build: 3.7.1-rc.1
3482
- Terms: https://firebase.google.com/terms/
3483
-
3484
- ---
3485
-
3486
- typedarray.js
3487
- Copyright (c) 2010, Linden Research, Inc.
3488
-
3489
- Permission is hereby granted, free of charge, to any person obtaining a copy
3490
- of this software and associated documentation files (the "Software"), to deal
3491
- in the Software without restriction, including without limitation the rights
3492
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
3493
- copies of the Software, and to permit persons to whom the Software is
3494
- furnished to do so, subject to the following conditions:
3495
-
3496
- The above copyright notice and this permission notice shall be included in
3497
- all copies or substantial portions of the Software.
3498
-
3499
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
3500
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
3501
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
3502
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
3503
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
3504
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
3505
- THE SOFTWARE. */
3506
- var firebase = null; (function() { var aa="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(c.get||c.set)throw new TypeError("ES3 does not support getters and setters.");a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)},k="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global&&null!=global?global:this,l=function(){l=function(){};k.Symbol||(k.Symbol=ba)},ca=0,ba=function(a){return"jscomp_symbol_"+(a||"")+ca++},n=function(){l();var a=k.Symbol.iterator;a||(a=k.Symbol.iterator=
3507
- k.Symbol("iterator"));"function"!=typeof Array.prototype[a]&&aa(Array.prototype,a,{configurable:!0,writable:!0,value:function(){return m(this)}});n=function(){}},m=function(a){var b=0;return da(function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}})},da=function(a){n();a={next:a};a[k.Symbol.iterator]=function(){return this};return a},q=this,r=function(){},t=function(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);
3508
- if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null";else if("function"==b&&"undefined"==typeof a.call)return"object";return b},v=function(a){return"function"==t(a)},ea=function(a,
3509
- b,c){return a.call.apply(a.bind,arguments)},fa=function(a,b,c){if(!a)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var c=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(c,d);return a.apply(b,c)}}return function(){return a.apply(b,arguments)}},w=function(a,b,c){w=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?ea:fa;return w.apply(null,arguments)},x=function(a,b){var c=Array.prototype.slice.call(arguments,
3510
- 1);return function(){var b=c.slice();b.push.apply(b,arguments);return a.apply(this,b)}},y=function(a,b){function c(){}c.prototype=b.prototype;a.ha=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.base=function(a,c,h){for(var e=Array(arguments.length-2),d=2;d<arguments.length;d++)e[d-2]=arguments[d];return b.prototype[c].apply(a,e)}};var A;A="undefined"!==typeof window?window:"undefined"!==typeof self?self:global;
3511
- var __extends=function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)},__assign=Object.assign||function(a){for(var b,c=1,d=arguments.length;c<d;c++){b=arguments[c];for(var e in b)Object.prototype.hasOwnProperty.call(b,e)&&(a[e]=b[e])}return a},__rest=function(a,b){var c={},d;for(d in a)Object.prototype.hasOwnProperty.call(a,d)&&0>b.indexOf(d)&&(c[d]=a[d]);if(null!=a&&"function"===typeof Object.getOwnPropertySymbols){var e=
3512
- 0;for(d=Object.getOwnPropertySymbols(a);e<d.length;e++)0>b.indexOf(d[e])&&(c[d[e]]=a[d[e]])}return c},__decorate=function(a,b,c,d){var e=arguments.length,h=3>e?b:null===d?d=Object.getOwnPropertyDescriptor(b,c):d,g;g=A.Reflect;if("object"===typeof g&&"function"===typeof g.decorate)h=g.decorate(a,b,c,d);else for(var f=a.length-1;0<=f;f--)if(g=a[f])h=(3>e?g(h):3<e?g(b,c,h):g(b,c))||h;return 3<e&&h&&Object.defineProperty(b,c,h),h},__metadata=function(a,b){var c=A.Reflect;if("object"===typeof c&&"function"===
3513
- typeof c.metadata)return c.metadata(a,b)},__param=function(a,b){return function(c,d){b(c,d,a)}},__awaiter=function(a,b,c,d){return new (c||(c=Promise))(function(e,h){function g(a){try{p(d.next(a))}catch(u){h(u)}}function f(a){try{p(d["throw"](a))}catch(u){h(u)}}function p(a){a.done?e(a.value):(new c(function(b){b(a.value)})).then(g,f)}p((d=d.apply(a,b)).next())})},__generator=function(a,b){function c(a){return function(b){return d([a,b])}}function d(c){if(h)throw new TypeError("Generator is already executing.");
3514
- for(;e;)try{if(h=1,g&&(f=g[c[0]&2?"return":c[0]?"throw":"next"])&&!(f=f.call(g,c[1])).done)return f;if(g=0,f)c=[0,f.value];switch(c[0]){case 0:case 1:f=c;break;case 4:return e.label++,{value:c[1],done:!1};case 5:e.label++;g=c[1];c=[0];continue;case 7:c=e.G.pop();e.I.pop();continue;default:if(!(f=e.I,f=0<f.length&&f[f.length-1])&&(6===c[0]||2===c[0])){e=0;continue}if(3===c[0]&&(!f||c[1]>f[0]&&c[1]<f[3]))e.label=c[1];else if(6===c[0]&&e.label<f[1])e.label=f[1],f=c;else if(f&&e.label<f[2])e.label=f[2],
3515
- e.G.push(c);else{f[2]&&e.G.pop();e.I.pop();continue}}c=b.call(a,e)}catch(z){c=[6,z],g=0}finally{h=f=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}var e={label:0,ga:function(){if(f[0]&1)throw f[1];return f[1]},I:[],G:[]},h,g,f;return{next:c(0),"throw":c(1),"return":c(2)}};
3516
- "undefined"!==typeof A.S&&A.S||(A.__extends=__extends,A.__assign=__assign,A.__rest=__rest,A.__extends=__extends,A.__decorate=__decorate,A.__metadata=__metadata,A.__param=__param,A.__awaiter=__awaiter,A.__generator=__generator);var B=function(a){if(Error.captureStackTrace)Error.captureStackTrace(this,B);else{var b=Error().stack;b&&(this.stack=b)}a&&(this.message=String(a))};y(B,Error);B.prototype.name="CustomError";var ga=function(a,b){for(var c=a.split("%s"),d="",e=Array.prototype.slice.call(arguments,1);e.length&&1<c.length;)d+=c.shift()+e.shift();return d+c.join("%s")};var C=function(a,b){b.unshift(a);B.call(this,ga.apply(null,b));b.shift()};y(C,B);C.prototype.name="AssertionError";var ha=function(a,b,c,d){var e="Assertion failed";if(c)var e=e+(": "+c),h=d;else a&&(e+=": "+a,h=b);throw new C(""+e,h||[]);},D=function(a,b,c){a||ha("",null,b,Array.prototype.slice.call(arguments,2))},E=function(a,b,c){v(a)||ha("Expected function but got %s: %s.",[t(a),a],b,Array.prototype.slice.call(arguments,2))};var F=function(a,b,c){this.Y=c;this.T=a;this.Z=b;this.s=0;this.o=null};F.prototype.get=function(){var a;0<this.s?(this.s--,a=this.o,this.o=a.next,a.next=null):a=this.T();return a};F.prototype.put=function(a){this.Z(a);this.s<this.Y&&(this.s++,a.next=this.o,this.o=a)};var G;a:{var ia=q.navigator;if(ia){var ja=ia.userAgent;if(ja){G=ja;break a}}G=""};var ka=function(a){q.setTimeout(function(){throw a;},0)},H,la=function(){var a=q.MessageChannel;"undefined"===typeof a&&"undefined"!==typeof window&&window.postMessage&&window.addEventListener&&-1==G.indexOf("Presto")&&(a=function(){var a=document.createElement("IFRAME");a.style.display="none";a.src="";document.documentElement.appendChild(a);var b=a.contentWindow,a=b.document;a.open();a.write("");a.close();var c="callImmediate"+Math.random(),d="file:"==b.location.protocol?"*":b.location.protocol+
3517
- "//"+b.location.host,a=w(function(a){if(("*"==d||a.origin==d)&&a.data==c)this.port1.onmessage()},this);b.addEventListener("message",a,!1);this.port1={};this.port2={postMessage:function(){b.postMessage(c,d)}}});if("undefined"!==typeof a&&-1==G.indexOf("Trident")&&-1==G.indexOf("MSIE")){var b=new a,c={},d=c;b.port1.onmessage=function(){if(void 0!==c.next){c=c.next;var a=c.J;c.J=null;a()}};return function(a){d.next={J:a};d=d.next;b.port2.postMessage(0)}}return"undefined"!==typeof document&&"onreadystatechange"in
3518
- document.createElement("SCRIPT")?function(a){var b=document.createElement("SCRIPT");b.onreadystatechange=function(){b.onreadystatechange=null;b.parentNode.removeChild(b);b=null;a();a=null};document.documentElement.appendChild(b)}:function(a){q.setTimeout(a,0)}};var I=function(){this.v=this.g=null},ma=new F(function(){return new J},function(a){a.reset()},100);I.prototype.add=function(a,b){var c=ma.get();c.set(a,b);this.v?this.v.next=c:(D(!this.g),this.g=c);this.v=c};I.prototype.remove=function(){var a=null;this.g&&(a=this.g,this.g=this.g.next,this.g||(this.v=null),a.next=null);return a};var J=function(){this.next=this.scope=this.B=null};J.prototype.set=function(a,b){this.B=a;this.scope=b;this.next=null};
3519
- J.prototype.reset=function(){this.next=this.scope=this.B=null};var M=function(a,b){K||na();L||(K(),L=!0);oa.add(a,b)},K,na=function(){if(-1!=String(q.Promise).indexOf("[native code]")){var a=q.Promise.resolve(void 0);K=function(){a.then(pa)}}else K=function(){var a=pa;!v(q.setImmediate)||q.Window&&q.Window.prototype&&-1==G.indexOf("Edge")&&q.Window.prototype.setImmediate==q.setImmediate?(H||(H=la()),H(a)):q.setImmediate(a)}},L=!1,oa=new I,pa=function(){for(var a;a=oa.remove();){try{a.B.call(a.scope)}catch(b){ka(b)}ma.put(a)}L=!1};var O=function(a,b){this.b=0;this.R=void 0;this.j=this.h=this.u=null;this.m=this.A=!1;if(a!=r)try{var c=this;a.call(b,function(a){N(c,2,a)},function(a){try{if(a instanceof Error)throw a;throw Error("Promise rejected.");}catch(e){}N(c,3,a)})}catch(d){N(this,3,d)}},qa=function(){this.next=this.context=this.i=this.f=this.child=null;this.w=!1};qa.prototype.reset=function(){this.context=this.i=this.f=this.child=null;this.w=!1};
3520
- var ra=new F(function(){return new qa},function(a){a.reset()},100),sa=function(a,b,c){var d=ra.get();d.f=a;d.i=b;d.context=c;return d},ua=function(a,b,c){ta(a,b,c,null)||M(x(b,a))};O.prototype.then=function(a,b,c){null!=a&&E(a,"opt_onFulfilled should be a function.");null!=b&&E(b,"opt_onRejected should be a function. Did you pass opt_context as the second argument instead of the third?");return va(this,v(a)?a:null,v(b)?b:null,c)};O.prototype.then=O.prototype.then;O.prototype.$goog_Thenable=!0;
3521
- O.prototype.ba=function(a,b){return va(this,null,a,b)};var xa=function(a,b){a.h||2!=a.b&&3!=a.b||wa(a);D(null!=b.f);a.j?a.j.next=b:a.h=b;a.j=b},va=function(a,b,c,d){var e=sa(null,null,null);e.child=new O(function(a,g){e.f=b?function(c){try{var e=b.call(d,c);a(e)}catch(z){g(z)}}:a;e.i=c?function(b){try{var e=c.call(d,b);a(e)}catch(z){g(z)}}:g});e.child.u=a;xa(a,e);return e.child};O.prototype.da=function(a){D(1==this.b);this.b=0;N(this,2,a)};
3522
- O.prototype.ea=function(a){D(1==this.b);this.b=0;N(this,3,a)};
3523
- var N=function(a,b,c){0==a.b&&(a===c&&(b=3,c=new TypeError("Promise cannot resolve to itself")),a.b=1,ta(c,a.da,a.ea,a)||(a.R=c,a.b=b,a.u=null,wa(a),3!=b||ya(a,c)))},ta=function(a,b,c,d){if(a instanceof O)return null!=b&&E(b,"opt_onFulfilled should be a function."),null!=c&&E(c,"opt_onRejected should be a function. Did you pass opt_context as the second argument instead of the third?"),xa(a,sa(b||r,c||null,d)),!0;var e;if(a)try{e=!!a.$goog_Thenable}catch(g){e=!1}else e=!1;if(e)return a.then(b,c,d),
3524
- !0;e=typeof a;if("object"==e&&null!=a||"function"==e)try{var h=a.then;if(v(h))return za(a,h,b,c,d),!0}catch(g){return c.call(d,g),!0}return!1},za=function(a,b,c,d,e){var h=!1,g=function(a){h||(h=!0,c.call(e,a))},f=function(a){h||(h=!0,d.call(e,a))};try{b.call(a,g,f)}catch(p){f(p)}},wa=function(a){a.A||(a.A=!0,M(a.V,a))},Aa=function(a){var b=null;a.h&&(b=a.h,a.h=b.next,b.next=null);a.h||(a.j=null);null!=b&&D(null!=b.f);return b};
3525
- O.prototype.V=function(){for(var a;a=Aa(this);){var b=this.b,c=this.R;if(3==b&&a.i&&!a.w){var d;for(d=this;d&&d.m;d=d.u)d.m=!1}if(a.child)a.child.u=null,Ba(a,b,c);else try{a.w?a.f.call(a.context):Ba(a,b,c)}catch(e){Ca.call(null,e)}ra.put(a)}this.A=!1};var Ba=function(a,b,c){2==b?a.f.call(a.context,c):a.i&&a.i.call(a.context,c)},ya=function(a,b){a.m=!0;M(function(){a.m&&Ca.call(null,b)})},Ca=ka;function P(a,b){if(!(b instanceof Object))return b;switch(b.constructor){case Date:return new Date(b.getTime());case Object:void 0===a&&(a={});break;case Array:a=[];break;default:return b}for(var c in b)b.hasOwnProperty(c)&&(a[c]=P(a[c],b[c]));return a};O.all=function(a){return new O(function(b,c){var d=a.length,e=[];if(d)for(var h=function(a,c){d--;e[a]=c;0==d&&b(e)},g=function(a){c(a)},f=0,p;f<a.length;f++)p=a[f],ua(p,x(h,f),g);else b(e)})};O.resolve=function(a){if(a instanceof O)return a;var b=new O(r);N(b,2,a);return b};O.reject=function(a){return new O(function(b,c){c(a)})};O.prototype["catch"]=O.prototype.ba;var Q=O;"undefined"!==typeof Promise&&(Q=Promise);var Da=Q;function Ea(a,b){a=new R(a,b);return a.subscribe.bind(a)}var R=function(a,b){var c=this;this.a=[];this.P=0;this.task=Da.resolve();this.l=!1;this.F=b;this.task.then(function(){a(c)}).catch(function(a){c.error(a)})};R.prototype.next=function(a){S(this,function(b){b.next(a)})};R.prototype.error=function(a){S(this,function(b){b.error(a)});this.close(a)};R.prototype.complete=function(){S(this,function(a){a.complete()});this.close()};
3526
- R.prototype.subscribe=function(a,b,c){var d=this,e;if(void 0===a&&void 0===b&&void 0===c)throw Error("Missing Observer.");e=Fa(a)?a:{next:a,error:b,complete:c};void 0===e.next&&(e.next=T);void 0===e.error&&(e.error=T);void 0===e.complete&&(e.complete=T);a=this.fa.bind(this,this.a.length);this.l&&this.task.then(function(){try{d.K?e.error(d.K):e.complete()}catch(h){}});this.a.push(e);return a};
3527
- R.prototype.fa=function(a){void 0!==this.a&&void 0!==this.a[a]&&(delete this.a[a],--this.P,0===this.P&&void 0!==this.F&&this.F(this))};var S=function(a,b){if(!a.l)for(var c=0;c<a.a.length;c++)Ga(a,c,b)},Ga=function(a,b,c){a.task.then(function(){if(void 0!==a.a&&void 0!==a.a[b])try{c(a.a[b])}catch(d){"undefined"!==typeof console&&console.error&&console.error(d)}})};R.prototype.close=function(a){var b=this;this.l||(this.l=!0,void 0!==a&&(this.K=a),this.task.then(function(){b.a=void 0;b.F=void 0}))};
3528
- function Fa(a){if("object"!==typeof a||null===a)return!1;var b;b=["next","error","complete"];n();var c=b[Symbol.iterator];b=c?c.call(b):m(b);for(c=b.next();!c.done;c=b.next())if(c=c.value,c in a&&"function"===typeof a[c])return!0;return!1}function T(){};var Ha=Error.captureStackTrace,V=function(a,b){this.code=a;this.message=b;if(Ha)Ha(this,U.prototype.create);else{var c=Error.apply(this,arguments);this.name="FirebaseError";Object.defineProperty(this,"stack",{get:function(){return c.stack}})}};V.prototype=Object.create(Error.prototype);V.prototype.constructor=V;V.prototype.name="FirebaseError";var U=function(a,b,c){this.$=a;this.aa=b;this.U=c;this.pattern=/\{\$([^}]+)}/g};
3529
- U.prototype.create=function(a,b){void 0===b&&(b={});var c=this.U[a];a=this.$+"/"+a;var c=void 0===c?"Error":c.replace(this.pattern,function(a,c){a=b[c];return void 0!==a?a.toString():"<"+c+"?>"}),c=this.aa+": "+c+" ("+a+").",c=new V(a,c),d;for(d in b)b.hasOwnProperty(d)&&"_"!==d.slice(-1)&&(c[d]=b[d]);return c};var W=Q,X=function(a,b,c){var d=this;this.M=c;this.N=!1;this.c={};this.D=b;this.H=P(void 0,a);a="serviceAccount"in this.H;("credential"in this.H||a)&&"undefined"!==typeof console&&console.log("The '"+(a?"serviceAccount":"credential")+"' property specified in the first argument to initializeApp() is deprecated and will be removed in the next major version. You should instead use the 'firebase-admin' package. See https://firebase.google.com/docs/admin/setup for details on how to get started.");Object.keys(c.INTERNAL.factories).forEach(function(a){var b=
3530
- c.INTERNAL.useAsService(d,a);null!==b&&(b=d.X.bind(d,b),d[a]=b)})};X.prototype.delete=function(){var a=this;return(new W(function(b){Y(a);b()})).then(function(){a.M.INTERNAL.removeApp(a.D);var b=[];Object.keys(a.c).forEach(function(c){Object.keys(a.c[c]).forEach(function(d){b.push(a.c[c][d])})});return W.all(b.map(function(a){return a.INTERNAL.delete()}))}).then(function(){a.N=!0;a.c={}})};
3531
- X.prototype.X=function(a,b){Y(this);"undefined"===typeof this.c[a]&&(this.c[a]={});var c=b||"[DEFAULT]";return"undefined"===typeof this.c[a][c]?(b=this.M.INTERNAL.factories[a](this,this.W.bind(this),b),this.c[a][c]=b):this.c[a][c]};X.prototype.W=function(a){P(this,a)};var Y=function(a){a.N&&Z("app-deleted",{name:a.D})};k.Object.defineProperties(X.prototype,{name:{configurable:!0,enumerable:!0,get:function(){Y(this);return this.D}},options:{configurable:!0,enumerable:!0,get:function(){Y(this);return this.H}}});
3532
- X.prototype.name&&X.prototype.options||X.prototype.delete||console.log("dc");
3533
- function Ia(){function a(a){a=a||"[DEFAULT]";var b=d[a];void 0===b&&Z("no-app",{name:a});return b}function b(a,b){Object.keys(e).forEach(function(d){d=c(a,d);if(null!==d&&h[d])h[d](b,a)})}function c(a,b){if("serverAuth"===b)return null;var c=b;a=a.options;"auth"===b&&(a.serviceAccount||a.credential)&&(c="serverAuth","serverAuth"in e||Z("sa-not-supported"));return c}var d={},e={},h={},g={__esModule:!0,initializeApp:function(a,c){void 0===c?c="[DEFAULT]":"string"===typeof c&&""!==c||Z("bad-app-name",
3534
- {name:c+""});void 0!==d[c]&&Z("duplicate-app",{name:c});a=new X(a,c,g);d[c]=a;b(a,"create");void 0!=a.INTERNAL&&void 0!=a.INTERNAL.getToken||P(a,{INTERNAL:{getUid:function(){return null},getToken:function(){return W.resolve(null)},addAuthTokenListener:function(){},removeAuthTokenListener:function(){}}});return a},app:a,apps:null,Promise:W,SDK_VERSION:"0.0.0",INTERNAL:{registerService:function(b,c,d,u){e[b]&&Z("duplicate-service",{name:b});e[b]=c;u&&(h[b]=u);c=function(c){void 0===c&&(c=a());return c[b]()};
3535
- void 0!==d&&P(c,d);return g[b]=c},createFirebaseNamespace:Ia,extendNamespace:function(a){P(g,a)},createSubscribe:Ea,ErrorFactory:U,removeApp:function(a){b(d[a],"delete");delete d[a]},factories:e,useAsService:c,Promise:O,deepExtend:P}};g["default"]=g;Object.defineProperty(g,"apps",{get:function(){return Object.keys(d).map(function(a){return d[a]})}});a.App=X;return g}function Z(a,b){throw Ja.create(a,b);}
3536
- var Ja=new U("app","Firebase",{"no-app":"No Firebase App '{$name}' has been created - call Firebase App.initializeApp()","bad-app-name":"Illegal App name: '{$name}","duplicate-app":"Firebase App named '{$name}' already exists","app-deleted":"Firebase App named '{$name}' already deleted","duplicate-service":"Firebase service named '{$name}' already registered","sa-not-supported":"Initializing the Firebase SDK with a service account is only allowed in a Node.js environment. On client devices, you should instead initialize the SDK with an api key and auth domain"});"undefined"!==typeof firebase&&(firebase=Ia()); }).call(this);
3537
- firebase.SDK_VERSION = "3.7.1";
3538
- (function(){var h,aa=aa||{},l=this,ba=function(){},m=function(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&
3539
- !a.propertyIsEnumerable("call"))return"function"}else return"null";else if("function"==b&&"undefined"==typeof a.call)return"object";return b},ca=function(a){return null===a},da=function(a){return"array"==m(a)},ea=function(a){var b=m(a);return"array"==b||"object"==b&&"number"==typeof a.length},p=function(a){return"string"==typeof a},fa=function(a){return"number"==typeof a},q=function(a){return"function"==m(a)},ga=function(a){var b=typeof a;return"object"==b&&null!=a||"function"==b},ha=function(a,b,
3540
- c){return a.call.apply(a.bind,arguments)},ia=function(a,b,c){if(!a)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var c=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(c,d);return a.apply(b,c)}}return function(){return a.apply(b,arguments)}},r=function(a,b,c){r=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?ha:ia;return r.apply(null,arguments)},ja=function(a,b){var c=Array.prototype.slice.call(arguments,
3541
- 1);return function(){var b=c.slice();b.push.apply(b,arguments);return a.apply(this,b)}},ka=Date.now||function(){return+new Date},t=function(a,b){function c(){}c.prototype=b.prototype;a.pd=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.Hf=function(a,c,f){for(var d=Array(arguments.length-2),e=2;e<arguments.length;e++)d[e-2]=arguments[e];return b.prototype[c].apply(a,d)}};var u=function(a){if(Error.captureStackTrace)Error.captureStackTrace(this,u);else{var b=Error().stack;b&&(this.stack=b)}a&&(this.message=String(a))};t(u,Error);u.prototype.name="CustomError";var la=function(a,b){for(var c=a.split("%s"),d="",e=Array.prototype.slice.call(arguments,1);e.length&&1<c.length;)d+=c.shift()+e.shift();return d+c.join("%s")},ma=String.prototype.trim?function(a){return a.trim()}:function(a){return a.replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},na=/&/g,oa=/</g,pa=/>/g,qa=/"/g,ra=/'/g,sa=/\x00/g,ta=/[\x00&<>"']/,v=function(a,b){return-1!=a.indexOf(b)},ua=function(a,b){return a<b?-1:a>b?1:0};var va=function(a,b){b.unshift(a);u.call(this,la.apply(null,b));b.shift()};t(va,u);va.prototype.name="AssertionError";
3542
- var wa=function(a,b,c,d){var e="Assertion failed";if(c)var e=e+(": "+c),f=d;else a&&(e+=": "+a,f=b);throw new va(""+e,f||[]);},w=function(a,b,c){a||wa("",null,b,Array.prototype.slice.call(arguments,2))},xa=function(a,b){throw new va("Failure"+(a?": "+a:""),Array.prototype.slice.call(arguments,1));},ya=function(a,b,c){fa(a)||wa("Expected number but got %s: %s.",[m(a),a],b,Array.prototype.slice.call(arguments,2));return a},za=function(a,b,c){p(a)||wa("Expected string but got %s: %s.",[m(a),a],b,Array.prototype.slice.call(arguments,
3543
- 2))},Aa=function(a,b,c){q(a)||wa("Expected function but got %s: %s.",[m(a),a],b,Array.prototype.slice.call(arguments,2))};var Ba=Array.prototype.indexOf?function(a,b,c){w(null!=a.length);return Array.prototype.indexOf.call(a,b,c)}:function(a,b,c){c=null==c?0:0>c?Math.max(0,a.length+c):c;if(p(a))return p(b)&&1==b.length?a.indexOf(b,c):-1;for(;c<a.length;c++)if(c in a&&a[c]===b)return c;return-1},x=Array.prototype.forEach?function(a,b,c){w(null!=a.length);Array.prototype.forEach.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=p(a)?a.split(""):a,f=0;f<d;f++)f in e&&b.call(c,e[f],f,a)},Ca=function(a,b){for(var c=p(a)?
3544
- a.split(""):a,d=a.length-1;0<=d;--d)d in c&&b.call(void 0,c[d],d,a)},Da=Array.prototype.map?function(a,b,c){w(null!=a.length);return Array.prototype.map.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=Array(d),f=p(a)?a.split(""):a,g=0;g<d;g++)g in f&&(e[g]=b.call(c,f[g],g,a));return e},Ea=Array.prototype.some?function(a,b,c){w(null!=a.length);return Array.prototype.some.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=p(a)?a.split(""):a,f=0;f<d;f++)if(f in e&&b.call(c,e[f],f,a))return!0;return!1},
3545
- Ga=function(a){var b;a:{b=Fa;for(var c=a.length,d=p(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a)){b=e;break a}b=-1}return 0>b?null:p(a)?a.charAt(b):a[b]},Ha=function(a,b){return 0<=Ba(a,b)},Ja=function(a,b){b=Ba(a,b);var c;(c=0<=b)&&Ia(a,b);return c},Ia=function(a,b){w(null!=a.length);return 1==Array.prototype.splice.call(a,b,1).length},Ka=function(a,b){var c=0;Ca(a,function(d,e){b.call(void 0,d,e,a)&&Ia(a,e)&&c++})},La=function(a){return Array.prototype.concat.apply([],arguments)},
3546
- Ma=function(a){var b=a.length;if(0<b){for(var c=Array(b),d=0;d<b;d++)c[d]=a[d];return c}return[]};var Na=function(a,b){for(var c in a)b.call(void 0,a[c],c,a)},Oa=function(a){var b=[],c=0,d;for(d in a)b[c++]=a[d];return b},Pa=function(a){var b=[],c=0,d;for(d in a)b[c++]=d;return b},Qa=function(a){for(var b in a)return!1;return!0},Ra=function(a,b){for(var c in a)if(!(c in b)||a[c]!==b[c])return!1;for(c in b)if(!(c in a))return!1;return!0},Sa=function(a){var b={},c;for(c in a)b[c]=a[c];return b},Ta="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),
3547
- Ua=function(a,b){for(var c,d,e=1;e<arguments.length;e++){d=arguments[e];for(c in d)a[c]=d[c];for(var f=0;f<Ta.length;f++)c=Ta[f],Object.prototype.hasOwnProperty.call(d,c)&&(a[c]=d[c])}};var Va;a:{var Wa=l.navigator;if(Wa){var Ya=Wa.userAgent;if(Ya){Va=Ya;break a}}Va=""}var y=function(a){return v(Va,a)};var Za=function(a){Za[" "](a);return a};Za[" "]=ba;var ab=function(a,b){var c=$a;return Object.prototype.hasOwnProperty.call(c,a)?c[a]:c[a]=b(a)};var bb=y("Opera"),z=y("Trident")||y("MSIE"),cb=y("Edge"),db=cb||z,eb=y("Gecko")&&!(v(Va.toLowerCase(),"webkit")&&!y("Edge"))&&!(y("Trident")||y("MSIE"))&&!y("Edge"),fb=v(Va.toLowerCase(),"webkit")&&!y("Edge"),gb=function(){var a=l.document;return a?a.documentMode:void 0},hb;
3548
- a:{var ib="",jb=function(){var a=Va;if(eb)return/rv\:([^\);]+)(\)|;)/.exec(a);if(cb)return/Edge\/([\d\.]+)/.exec(a);if(z)return/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(a);if(fb)return/WebKit\/(\S+)/.exec(a);if(bb)return/(?:Version)[ \/]?(\S+)/.exec(a)}();jb&&(ib=jb?jb[1]:"");if(z){var kb=gb();if(null!=kb&&kb>parseFloat(ib)){hb=String(kb);break a}}hb=ib}
3549
- var lb=hb,$a={},B=function(a){return ab(a,function(){for(var b=0,c=ma(String(lb)).split("."),d=ma(String(a)).split("."),e=Math.max(c.length,d.length),f=0;0==b&&f<e;f++){var g=c[f]||"",k=d[f]||"";do{g=/(\d*)(\D*)(.*)/.exec(g)||["","","",""];k=/(\d*)(\D*)(.*)/.exec(k)||["","","",""];if(0==g[0].length&&0==k[0].length)break;b=ua(0==g[1].length?0:parseInt(g[1],10),0==k[1].length?0:parseInt(k[1],10))||ua(0==g[2].length,0==k[2].length)||ua(g[2],k[2]);g=g[3];k=k[3]}while(0==b)}return 0<=b})},mb;var nb=l.document;
3550
- mb=nb&&z?gb()||("CSS1Compat"==nb.compatMode?parseInt(lb,10):5):void 0;var ob=function(a){return Da(a,function(a){a=a.toString(16);return 1<a.length?a:"0"+a}).join("")};var pb=null,qb=null,sb=function(a){var b="";rb(a,function(a){b+=String.fromCharCode(a)});return b},rb=function(a,b){function c(b){for(;d<a.length;){var c=a.charAt(d++),e=qb[c];if(null!=e)return e;if(!/^[\s\xa0]*$/.test(c))throw Error("Unknown base64 encoding at char: "+c);}return b}tb();for(var d=0;;){var e=c(-1),f=c(0),g=c(64),k=c(64);if(64===k&&-1===e)break;b(e<<2|f>>4);64!=g&&(b(f<<4&240|g>>2),64!=k&&b(g<<6&192|k))}},tb=function(){if(!pb){pb={};qb={};for(var a=0;65>a;a++)pb[a]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(a),
3551
- qb[pb[a]]=a,62<=a&&(qb["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.".charAt(a)]=a)}};var ub=function(){this.za=-1};var xb=function(a,b){this.za=64;this.Wb=l.Uint8Array?new Uint8Array(this.za):Array(this.za);this.Ac=this.$a=0;this.h=[];this.Ze=a;this.Ld=b;this.Af=l.Int32Array?new Int32Array(64):Array(64);void 0!==vb||(vb=l.Int32Array?new Int32Array(wb):wb);this.reset()},vb;t(xb,ub);for(var yb=[],zb=0;63>zb;zb++)yb[zb]=0;var Ab=La(128,yb);xb.prototype.reset=function(){this.Ac=this.$a=0;this.h=l.Int32Array?new Int32Array(this.Ld):Ma(this.Ld)};
3552
- var Bb=function(a){var b=a.Wb;w(b.length==a.za);for(var c=a.Af,d=0,e=0;e<b.length;)c[d++]=b[e]<<24|b[e+1]<<16|b[e+2]<<8|b[e+3],e=4*d;for(b=16;64>b;b++){var e=c[b-15]|0,d=c[b-2]|0,f=(c[b-16]|0)+((e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3)|0,g=(c[b-7]|0)+((d>>>17|d<<15)^(d>>>19|d<<13)^d>>>10)|0;c[b]=f+g|0}for(var d=a.h[0]|0,e=a.h[1]|0,k=a.h[2]|0,n=a.h[3]|0,A=a.h[4]|0,Xa=a.h[5]|0,Gb=a.h[6]|0,f=a.h[7]|0,b=0;64>b;b++)var gh=((d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10))+(d&e^d&k^e&k)|0,g=A&Xa^~A&Gb,f=f+((A>>>6|
3553
- A<<26)^(A>>>11|A<<21)^(A>>>25|A<<7))|0,g=g+(vb[b]|0)|0,g=f+(g+(c[b]|0)|0)|0,f=Gb,Gb=Xa,Xa=A,A=n+g|0,n=k,k=e,e=d,d=g+gh|0;a.h[0]=a.h[0]+d|0;a.h[1]=a.h[1]+e|0;a.h[2]=a.h[2]+k|0;a.h[3]=a.h[3]+n|0;a.h[4]=a.h[4]+A|0;a.h[5]=a.h[5]+Xa|0;a.h[6]=a.h[6]+Gb|0;a.h[7]=a.h[7]+f|0};
3554
- xb.prototype.update=function(a,b){void 0===b&&(b=a.length);var c=0,d=this.$a;if(p(a))for(;c<b;)this.Wb[d++]=a.charCodeAt(c++),d==this.za&&(Bb(this),d=0);else if(ea(a))for(;c<b;){var e=a[c++];if(!("number"==typeof e&&0<=e&&255>=e&&e==(e|0)))throw Error("message must be a byte array");this.Wb[d++]=e;d==this.za&&(Bb(this),d=0)}else throw Error("message must be string or array");this.$a=d;this.Ac+=b};
3555
- xb.prototype.digest=function(){var a=[],b=8*this.Ac;56>this.$a?this.update(Ab,56-this.$a):this.update(Ab,this.za-(this.$a-56));for(var c=63;56<=c;c--)this.Wb[c]=b&255,b/=256;Bb(this);for(c=b=0;c<this.Ze;c++)for(var d=24;0<=d;d-=8)a[b++]=this.h[c]>>d&255;return a};
3556
- var wb=[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,
3557
- 4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];var Db=function(){xb.call(this,8,Cb)};t(Db,xb);var Cb=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225];var Eb=!z||9<=Number(mb),Fb=z&&!B("9");!fb||B("528");eb&&B("1.9b")||z&&B("8")||bb&&B("9.5")||fb&&B("528");eb&&!B("8")||z&&B("9");var Hb=function(){this.Ba=this.Ba;this.nc=this.nc};Hb.prototype.Ba=!1;Hb.prototype.isDisposed=function(){return this.Ba};Hb.prototype.Wa=function(){if(this.nc)for(;this.nc.length;)this.nc.shift()()};var Ib=function(a,b){this.type=a;this.currentTarget=this.target=b;this.defaultPrevented=this.gb=!1;this.Wd=!0};Ib.prototype.preventDefault=function(){this.defaultPrevented=!0;this.Wd=!1};var Jb=function(a,b){Ib.call(this,a?a.type:"");this.relatedTarget=this.currentTarget=this.target=null;this.button=this.screenY=this.screenX=this.clientY=this.clientX=this.offsetY=this.offsetX=0;this.key="";this.charCode=this.keyCode=0;this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1;this.Xa=this.state=null;a&&this.init(a,b)};t(Jb,Ib);
3558
- Jb.prototype.init=function(a,b){var c=this.type=a.type,d=a.changedTouches?a.changedTouches[0]:null;this.target=a.target||a.srcElement;this.currentTarget=b;if(b=a.relatedTarget){if(eb){var e;a:{try{Za(b.nodeName);e=!0;break a}catch(f){}e=!1}e||(b=null)}}else"mouseover"==c?b=a.fromElement:"mouseout"==c&&(b=a.toElement);this.relatedTarget=b;null===d?(this.offsetX=fb||void 0!==a.offsetX?a.offsetX:a.layerX,this.offsetY=fb||void 0!==a.offsetY?a.offsetY:a.layerY,this.clientX=void 0!==a.clientX?a.clientX:
3559
- a.pageX,this.clientY=void 0!==a.clientY?a.clientY:a.pageY,this.screenX=a.screenX||0,this.screenY=a.screenY||0):(this.clientX=void 0!==d.clientX?d.clientX:d.pageX,this.clientY=void 0!==d.clientY?d.clientY:d.pageY,this.screenX=d.screenX||0,this.screenY=d.screenY||0);this.button=a.button;this.keyCode=a.keyCode||0;this.key=a.key||"";this.charCode=a.charCode||("keypress"==c?a.keyCode:0);this.ctrlKey=a.ctrlKey;this.altKey=a.altKey;this.shiftKey=a.shiftKey;this.metaKey=a.metaKey;this.state=a.state;this.Xa=
3560
- a;a.defaultPrevented&&this.preventDefault()};Jb.prototype.preventDefault=function(){Jb.pd.preventDefault.call(this);var a=this.Xa;if(a.preventDefault)a.preventDefault();else if(a.returnValue=!1,Fb)try{if(a.ctrlKey||112<=a.keyCode&&123>=a.keyCode)a.keyCode=-1}catch(b){}};Jb.prototype.Ee=function(){return this.Xa};var Kb="closure_listenable_"+(1E6*Math.random()|0),Lb=0;var Mb=function(a,b,c,d,e){this.listener=a;this.rc=null;this.src=b;this.type=c;this.capture=!!d;this.dc=e;this.key=++Lb;this.lb=this.Vb=!1},Nb=function(a){a.lb=!0;a.listener=null;a.rc=null;a.src=null;a.dc=null};var Ob=function(a){this.src=a;this.D={};this.Rb=0};Ob.prototype.add=function(a,b,c,d,e){var f=a.toString();a=this.D[f];a||(a=this.D[f]=[],this.Rb++);var g=Pb(a,b,d,e);-1<g?(b=a[g],c||(b.Vb=!1)):(b=new Mb(b,this.src,f,!!d,e),b.Vb=c,a.push(b));return b};Ob.prototype.remove=function(a,b,c,d){a=a.toString();if(!(a in this.D))return!1;var e=this.D[a];b=Pb(e,b,c,d);return-1<b?(Nb(e[b]),Ia(e,b),0==e.length&&(delete this.D[a],this.Rb--),!0):!1};
3561
- var Qb=function(a,b){var c=b.type;c in a.D&&Ja(a.D[c],b)&&(Nb(b),0==a.D[c].length&&(delete a.D[c],a.Rb--))};Ob.prototype.Oc=function(a,b,c,d){a=this.D[a.toString()];var e=-1;a&&(e=Pb(a,b,c,d));return-1<e?a[e]:null};var Pb=function(a,b,c,d){for(var e=0;e<a.length;++e){var f=a[e];if(!f.lb&&f.listener==b&&f.capture==!!c&&f.dc==d)return e}return-1};var Rb="closure_lm_"+(1E6*Math.random()|0),Sb={},Tb=0,Ub=function(a,b,c,d,e){if(da(b))for(var f=0;f<b.length;f++)Ub(a,b[f],c,d,e);else c=Vb(c),a&&a[Kb]?a.listen(b,c,d,e):Wb(a,b,c,!1,d,e)},Wb=function(a,b,c,d,e,f){if(!b)throw Error("Invalid event type");var g=!!e,k=Xb(a);k||(a[Rb]=k=new Ob(a));c=k.add(b,c,d,e,f);if(!c.rc){d=Yb();c.rc=d;d.src=a;d.listener=c;if(a.addEventListener)a.addEventListener(b.toString(),d,g);else if(a.attachEvent)a.attachEvent(Zb(b.toString()),d);else throw Error("addEventListener and attachEvent are unavailable.");
3562
- Tb++}},Yb=function(){var a=$b,b=Eb?function(c){return a.call(b.src,b.listener,c)}:function(c){c=a.call(b.src,b.listener,c);if(!c)return c};return b},ac=function(a,b,c,d,e){if(da(b))for(var f=0;f<b.length;f++)ac(a,b[f],c,d,e);else c=Vb(c),a&&a[Kb]?bc(a,b,c,d,e):Wb(a,b,c,!0,d,e)},cc=function(a,b,c,d,e){if(da(b))for(var f=0;f<b.length;f++)cc(a,b[f],c,d,e);else c=Vb(c),a&&a[Kb]?a.aa.remove(String(b),c,d,e):a&&(a=Xb(a))&&(b=a.Oc(b,c,!!d,e))&&dc(b)},dc=function(a){if(!fa(a)&&a&&!a.lb){var b=a.src;if(b&&
3563
- b[Kb])Qb(b.aa,a);else{var c=a.type,d=a.rc;b.removeEventListener?b.removeEventListener(c,d,a.capture):b.detachEvent&&b.detachEvent(Zb(c),d);Tb--;(c=Xb(b))?(Qb(c,a),0==c.Rb&&(c.src=null,b[Rb]=null)):Nb(a)}}},Zb=function(a){return a in Sb?Sb[a]:Sb[a]="on"+a},fc=function(a,b,c,d){var e=!0;if(a=Xb(a))if(b=a.D[b.toString()])for(b=b.concat(),a=0;a<b.length;a++){var f=b[a];f&&f.capture==c&&!f.lb&&(f=ec(f,d),e=e&&!1!==f)}return e},ec=function(a,b){var c=a.listener,d=a.dc||a.src;a.Vb&&dc(a);return c.call(d,
3564
- b)},$b=function(a,b){if(a.lb)return!0;if(!Eb){if(!b)a:{b=["window","event"];for(var c=l,d;d=b.shift();)if(null!=c[d])c=c[d];else{b=null;break a}b=c}d=b;b=new Jb(d,this);c=!0;if(!(0>d.keyCode||void 0!=d.returnValue)){a:{var e=!1;if(0==d.keyCode)try{d.keyCode=-1;break a}catch(g){e=!0}if(e||void 0==d.returnValue)d.returnValue=!0}d=[];for(e=b.currentTarget;e;e=e.parentNode)d.push(e);a=a.type;for(e=d.length-1;!b.gb&&0<=e;e--){b.currentTarget=d[e];var f=fc(d[e],a,!0,b),c=c&&f}for(e=0;!b.gb&&e<d.length;e++)b.currentTarget=
3565
- d[e],f=fc(d[e],a,!1,b),c=c&&f}return c}return ec(a,new Jb(b,this))},Xb=function(a){a=a[Rb];return a instanceof Ob?a:null},gc="__closure_events_fn_"+(1E9*Math.random()>>>0),Vb=function(a){w(a,"Listener can not be null.");if(q(a))return a;w(a.handleEvent,"An object listener must have handleEvent method.");a[gc]||(a[gc]=function(b){return a.handleEvent(b)});return a[gc]};var hc=/^[+a-zA-Z0-9_.!#$%&'*\/=?^`{|}~-]+@([a-zA-Z0-9-]+\.)+[a-zA-Z0-9]{2,63}$/;var jc=function(){this.xc="";this.me=ic};jc.prototype.hc=!0;jc.prototype.bc=function(){return this.xc};jc.prototype.toString=function(){return"Const{"+this.xc+"}"};var kc=function(a){if(a instanceof jc&&a.constructor===jc&&a.me===ic)return a.xc;xa("expected object of type Const, got '"+a+"'");return"type_error:Const"},ic={},lc=function(a){var b=new jc;b.xc=a;return b};lc("");var nc=function(){this.qc="";this.ne=mc};nc.prototype.hc=!0;nc.prototype.bc=function(){return this.qc};nc.prototype.toString=function(){return"TrustedResourceUrl{"+this.qc+"}"};var mc={};var pc=function(){this.ma="";this.le=oc};pc.prototype.hc=!0;pc.prototype.bc=function(){return this.ma};pc.prototype.toString=function(){return"SafeUrl{"+this.ma+"}"};
3566
- var qc=function(a){if(a instanceof pc&&a.constructor===pc&&a.le===oc)return a.ma;xa("expected object of type SafeUrl, got '"+a+"' of type "+m(a));return"type_error:SafeUrl"},rc=/^(?:(?:https?|mailto|ftp):|[^&:/?#]*(?:[/?#]|$))/i,tc=function(a){if(a instanceof pc)return a;a=a.hc?a.bc():String(a);rc.test(a)||(a="about:invalid#zClosurez");return sc(a)},oc={},sc=function(a){var b=new pc;b.ma=a;return b};sc("about:blank");var vc=function(){this.ma="";this.ke=uc};vc.prototype.hc=!0;vc.prototype.bc=function(){return this.ma};vc.prototype.toString=function(){return"SafeHtml{"+this.ma+"}"};var wc=function(a){if(a instanceof vc&&a.constructor===vc&&a.ke===uc)return a.ma;xa("expected object of type SafeHtml, got '"+a+"' of type "+m(a));return"type_error:SafeHtml"},uc={};vc.prototype.Pe=function(a){this.ma=a;return this};var xc="StopIteration"in l?l.StopIteration:{message:"StopIteration",stack:""},yc=function(){};yc.prototype.next=function(){throw xc;};yc.prototype.oe=function(){return this};var zc=function(a,b){this.ba={};this.w=[];this.sb=this.o=0;var c=arguments.length;if(1<c){if(c%2)throw Error("Uneven number of arguments");for(var d=0;d<c;d+=2)this.set(arguments[d],arguments[d+1])}else a&&this.addAll(a)};zc.prototype.X=function(){Ac(this);for(var a=[],b=0;b<this.w.length;b++)a.push(this.ba[this.w[b]]);return a};zc.prototype.ka=function(){Ac(this);return this.w.concat()};zc.prototype.ub=function(a){return Bc(this.ba,a)};
3567
- zc.prototype.remove=function(a){return Bc(this.ba,a)?(delete this.ba[a],this.o--,this.sb++,this.w.length>2*this.o&&Ac(this),!0):!1};var Ac=function(a){if(a.o!=a.w.length){for(var b=0,c=0;b<a.w.length;){var d=a.w[b];Bc(a.ba,d)&&(a.w[c++]=d);b++}a.w.length=c}if(a.o!=a.w.length){for(var e={},c=b=0;b<a.w.length;)d=a.w[b],Bc(e,d)||(a.w[c++]=d,e[d]=1),b++;a.w.length=c}};h=zc.prototype;h.get=function(a,b){return Bc(this.ba,a)?this.ba[a]:b};
3568
- h.set=function(a,b){Bc(this.ba,a)||(this.o++,this.w.push(a),this.sb++);this.ba[a]=b};h.addAll=function(a){var b;a instanceof zc?(b=a.ka(),a=a.X()):(b=Pa(a),a=Oa(a));for(var c=0;c<b.length;c++)this.set(b[c],a[c])};h.forEach=function(a,b){for(var c=this.ka(),d=0;d<c.length;d++){var e=c[d],f=this.get(e);a.call(b,f,e,this)}};h.clone=function(){return new zc(this)};
3569
- h.oe=function(a){Ac(this);var b=0,c=this.sb,d=this,e=new yc;e.next=function(){if(c!=d.sb)throw Error("The map has changed since the iterator was created");if(b>=d.w.length)throw xc;var e=d.w[b++];return a?e:d.ba[e]};return e};var Bc=function(a,b){return Object.prototype.hasOwnProperty.call(a,b)};var Cc=function(a){if(a.X&&"function"==typeof a.X)return a.X();if(p(a))return a.split("");if(ea(a)){for(var b=[],c=a.length,d=0;d<c;d++)b.push(a[d]);return b}return Oa(a)},Dc=function(a){if(a.ka&&"function"==typeof a.ka)return a.ka();if(!a.X||"function"!=typeof a.X){if(ea(a)||p(a)){var b=[];a=a.length;for(var c=0;c<a;c++)b.push(c);return b}return Pa(a)}},Ec=function(a,b){if(a.forEach&&"function"==typeof a.forEach)a.forEach(b,void 0);else if(ea(a)||p(a))x(a,b,void 0);else for(var c=Dc(a),d=Cc(a),e=
3570
- d.length,f=0;f<e;f++)b.call(void 0,d[f],c&&c[f],a)};var Fc=function(a,b,c,d,e){this.reset(a,b,c,d,e)};Fc.prototype.Cd=null;var Gc=0;Fc.prototype.reset=function(a,b,c,d,e){"number"==typeof e||Gc++;d||ka();this.Bb=a;this.We=b;delete this.Cd};Fc.prototype.$d=function(a){this.Bb=a};var Hc=function(a){this.Xe=a;this.Id=this.Jc=this.Bb=this.s=null},Ic=function(a,b){this.name=a;this.value=b};Ic.prototype.toString=function(){return this.name};var Jc=new Ic("SEVERE",1E3),Kc=new Ic("CONFIG",700),Lc=new Ic("FINE",500);Hc.prototype.getParent=function(){return this.s};Hc.prototype.$d=function(a){this.Bb=a};var Mc=function(a){if(a.Bb)return a.Bb;if(a.s)return Mc(a.s);xa("Root logger has no level set.");return null};
3571
- Hc.prototype.log=function(a,b,c){if(a.value>=Mc(this).value)for(q(b)&&(b=b()),a=new Fc(a,String(b),this.Xe),c&&(a.Cd=c),c="log:"+a.We,l.console&&(l.console.timeStamp?l.console.timeStamp(c):l.console.markTimeline&&l.console.markTimeline(c)),l.msWriteProfilerMark&&l.msWriteProfilerMark(c),c=this;c;){var d=c,e=a;if(d.Id)for(var f=0;b=d.Id[f];f++)b(e);c=c.getParent()}};
3572
- var Nc={},Oc=null,Pc=function(a){Oc||(Oc=new Hc(""),Nc[""]=Oc,Oc.$d(Kc));var b;if(!(b=Nc[a])){b=new Hc(a);var c=a.lastIndexOf("."),d=a.substr(c+1),c=Pc(a.substr(0,c));c.Jc||(c.Jc={});c.Jc[d]=b;b.s=c;Nc[a]=b}return b};var C=function(a,b){a&&a.log(Lc,b,void 0)};var Sc=function(a){var b=[];Qc(new Rc,a,b);return b.join("")},Rc=function(){this.tc=void 0},Qc=function(a,b,c){if(null==b)c.push("null");else{if("object"==typeof b){if(da(b)){var d=b;b=d.length;c.push("[");for(var e="",f=0;f<b;f++)c.push(e),e=d[f],Qc(a,a.tc?a.tc.call(d,String(f),e):e,c),e=",";c.push("]");return}if(b instanceof String||b instanceof Number||b instanceof Boolean)b=b.valueOf();else{c.push("{");f="";for(d in b)Object.prototype.hasOwnProperty.call(b,d)&&(e=b[d],"function"!=typeof e&&(c.push(f),
3573
- Tc(d,c),c.push(":"),Qc(a,a.tc?a.tc.call(b,d,e):e,c),f=","));c.push("}");return}}switch(typeof b){case "string":Tc(b,c);break;case "number":c.push(isFinite(b)&&!isNaN(b)?String(b):"null");break;case "boolean":c.push(String(b));break;case "function":c.push("null");break;default:throw Error("Unknown type: "+typeof b);}}},Uc={'"':'\\"',"\\":"\\\\","/":"\\/","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\x0B":"\\u000b"},Vc=/\uffff/.test("\uffff")?/[\\\"\x00-\x1f\x7f-\uffff]/g:/[\\\"\x00-\x1f\x7f-\xff]/g,
3574
- Tc=function(a,b){b.push('"',a.replace(Vc,function(a){var b=Uc[a];b||(b="\\u"+(a.charCodeAt(0)|65536).toString(16).substr(1),Uc[a]=b);return b}),'"')};var Wc=function(){};Wc.prototype.td=null;var Xc=function(a){return a.td||(a.td=a.Uc())};var Yc,Zc=function(){};t(Zc,Wc);Zc.prototype.Xb=function(){var a=$c(this);return a?new ActiveXObject(a):new XMLHttpRequest};Zc.prototype.Uc=function(){var a={};$c(this)&&(a[0]=!0,a[1]=!0);return a};
3575
- var $c=function(a){if(!a.Kd&&"undefined"==typeof XMLHttpRequest&&"undefined"!=typeof ActiveXObject){for(var b=["MSXML2.XMLHTTP.6.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"],c=0;c<b.length;c++){var d=b[c];try{return new ActiveXObject(d),a.Kd=d}catch(e){}}throw Error("Could not create ActiveXObject. ActiveX might be disabled, or MSXML might not be installed");}return a.Kd};Yc=new Zc;var ad=function(){};t(ad,Wc);ad.prototype.Xb=function(){var a=new XMLHttpRequest;if("withCredentials"in a)return a;if("undefined"!=typeof XDomainRequest)return new bd;throw Error("Unsupported browser");};ad.prototype.Uc=function(){return{}};
3576
- var bd=function(){this.qa=new XDomainRequest;this.readyState=0;this.onreadystatechange=null;this.responseText="";this.status=-1;this.statusText=this.responseXML=null;this.qa.onload=r(this.Ge,this);this.qa.onerror=r(this.Hd,this);this.qa.onprogress=r(this.He,this);this.qa.ontimeout=r(this.Ie,this)};h=bd.prototype;h.open=function(a,b,c){if(null!=c&&!c)throw Error("Only async requests are supported.");this.qa.open(a,b)};
3577
- h.send=function(a){if(a)if("string"==typeof a)this.qa.send(a);else throw Error("Only string data is supported");else this.qa.send()};h.abort=function(){this.qa.abort()};h.setRequestHeader=function(){};h.Ge=function(){this.status=200;this.responseText=this.qa.responseText;cd(this,4)};h.Hd=function(){this.status=500;this.responseText="";cd(this,4)};h.Ie=function(){this.Hd()};h.He=function(){this.status=200;cd(this,1)};var cd=function(a,b){a.readyState=b;if(a.onreadystatechange)a.onreadystatechange()};!eb&&!z||z&&9<=Number(mb)||eb&&B("1.9.1");z&&B("9");var ed=function(a,b){Na(b,function(b,d){"style"==d?a.style.cssText=b:"class"==d?a.className=b:"for"==d?a.htmlFor=b:dd.hasOwnProperty(d)?a.setAttribute(dd[d],b):0==d.lastIndexOf("aria-",0)||0==d.lastIndexOf("data-",0)?a.setAttribute(d,b):a[d]=b})},dd={cellpadding:"cellPadding",cellspacing:"cellSpacing",colspan:"colSpan",frameborder:"frameBorder",height:"height",maxlength:"maxLength",nonce:"nonce",role:"role",rowspan:"rowSpan",type:"type",usemap:"useMap",valign:"vAlign",width:"width"};var fd=function(a,b,c){this.Te=c;this.ue=a;this.jf=b;this.mc=0;this.ec=null};fd.prototype.get=function(){var a;0<this.mc?(this.mc--,a=this.ec,this.ec=a.next,a.next=null):a=this.ue();return a};fd.prototype.put=function(a){this.jf(a);this.mc<this.Te&&(this.mc++,a.next=this.ec,this.ec=a)};var gd=function(a){l.setTimeout(function(){throw a;},0)},hd,id=function(){var a=l.MessageChannel;"undefined"===typeof a&&"undefined"!==typeof window&&window.postMessage&&window.addEventListener&&!y("Presto")&&(a=function(){var a=document.createElement("IFRAME");a.style.display="none";a.src="";document.documentElement.appendChild(a);var b=a.contentWindow,a=b.document;a.open();a.write("");a.close();var c="callImmediate"+Math.random(),d="file:"==b.location.protocol?"*":b.location.protocol+"//"+b.location.host,
3578
- a=r(function(a){if(("*"==d||a.origin==d)&&a.data==c)this.port1.onmessage()},this);b.addEventListener("message",a,!1);this.port1={};this.port2={postMessage:function(){b.postMessage(c,d)}}});if("undefined"!==typeof a&&!y("Trident")&&!y("MSIE")){var b=new a,c={},d=c;b.port1.onmessage=function(){if(void 0!==c.next){c=c.next;var a=c.wd;c.wd=null;a()}};return function(a){d.next={wd:a};d=d.next;b.port2.postMessage(0)}}return"undefined"!==typeof document&&"onreadystatechange"in document.createElement("SCRIPT")?
3579
- function(a){var b=document.createElement("SCRIPT");b.onreadystatechange=function(){b.onreadystatechange=null;b.parentNode.removeChild(b);b=null;a();a=null};document.documentElement.appendChild(b)}:function(a){l.setTimeout(a,0)}};var jd=function(){this.Dc=this.Ra=null},ld=new fd(function(){return new kd},function(a){a.reset()},100);jd.prototype.add=function(a,b){var c=ld.get();c.set(a,b);this.Dc?this.Dc.next=c:(w(!this.Ra),this.Ra=c);this.Dc=c};jd.prototype.remove=function(){var a=null;this.Ra&&(a=this.Ra,this.Ra=this.Ra.next,this.Ra||(this.Dc=null),a.next=null);return a};var kd=function(){this.next=this.scope=this.Nc=null};kd.prototype.set=function(a,b){this.Nc=a;this.scope=b;this.next=null};
3580
- kd.prototype.reset=function(){this.next=this.scope=this.Nc=null};var qd=function(a,b){md||nd();od||(md(),od=!0);pd.add(a,b)},md,nd=function(){if(-1!=String(l.Promise).indexOf("[native code]")){var a=l.Promise.resolve(void 0);md=function(){a.then(rd)}}else md=function(){var a=rd;!q(l.setImmediate)||l.Window&&l.Window.prototype&&!y("Edge")&&l.Window.prototype.setImmediate==l.setImmediate?(hd||(hd=id()),hd(a)):l.setImmediate(a)}},od=!1,pd=new jd,rd=function(){for(var a;a=pd.remove();){try{a.Nc.call(a.scope)}catch(b){gd(b)}ld.put(a)}od=!1};var sd=function(a){a.prototype.then=a.prototype.then;a.prototype.$goog_Thenable=!0},td=function(a){if(!a)return!1;try{return!!a.$goog_Thenable}catch(b){return!1}};var D=function(a,b){this.M=0;this.na=void 0;this.Ua=this.ja=this.s=null;this.cc=this.Mc=!1;if(a!=ba)try{var c=this;a.call(b,function(a){ud(c,2,a)},function(a){if(!(a instanceof vd))try{if(a instanceof Error)throw a;throw Error("Promise rejected.");}catch(e){}ud(c,3,a)})}catch(d){ud(this,3,d)}},wd=function(){this.next=this.context=this.bb=this.Ja=this.child=null;this.tb=!1};wd.prototype.reset=function(){this.context=this.bb=this.Ja=this.child=null;this.tb=!1};
3581
- var xd=new fd(function(){return new wd},function(a){a.reset()},100),yd=function(a,b,c){var d=xd.get();d.Ja=a;d.bb=b;d.context=c;return d},E=function(a){if(a instanceof D)return a;var b=new D(ba);ud(b,2,a);return b},F=function(a){return new D(function(b,c){c(a)})},Ad=function(a,b,c){zd(a,b,c,null)||qd(ja(b,a))},Bd=function(a){return new D(function(b){var c=a.length,d=[];if(c)for(var e=function(a,e,f){c--;d[a]=e?{Ce:!0,value:f}:{Ce:!1,reason:f};0==c&&b(d)},f=0,g;f<a.length;f++)g=a[f],Ad(g,ja(e,f,!0),
3582
- ja(e,f,!1));else b(d)})};D.prototype.then=function(a,b,c){null!=a&&Aa(a,"opt_onFulfilled should be a function.");null!=b&&Aa(b,"opt_onRejected should be a function. Did you pass opt_context as the second argument instead of the third?");return Cd(this,q(a)?a:null,q(b)?b:null,c)};sd(D);var Ed=function(a,b){b=yd(b,b,void 0);b.tb=!0;Dd(a,b);return a};D.prototype.f=function(a,b){return Cd(this,null,a,b)};D.prototype.cancel=function(a){0==this.M&&qd(function(){var b=new vd(a);Fd(this,b)},this)};
3583
- var Fd=function(a,b){if(0==a.M)if(a.s){var c=a.s;if(c.ja){for(var d=0,e=null,f=null,g=c.ja;g&&(g.tb||(d++,g.child==a&&(e=g),!(e&&1<d)));g=g.next)e||(f=g);e&&(0==c.M&&1==d?Fd(c,b):(f?(d=f,w(c.ja),w(null!=d),d.next==c.Ua&&(c.Ua=d),d.next=d.next.next):Gd(c),Hd(c,e,3,b)))}a.s=null}else ud(a,3,b)},Dd=function(a,b){a.ja||2!=a.M&&3!=a.M||Id(a);w(null!=b.Ja);a.Ua?a.Ua.next=b:a.ja=b;a.Ua=b},Cd=function(a,b,c,d){var e=yd(null,null,null);e.child=new D(function(a,g){e.Ja=b?function(c){try{var e=b.call(d,c);a(e)}catch(A){g(A)}}:
3584
- a;e.bb=c?function(b){try{var e=c.call(d,b);void 0===e&&b instanceof vd?g(b):a(e)}catch(A){g(A)}}:g});e.child.s=a;Dd(a,e);return e.child};D.prototype.xf=function(a){w(1==this.M);this.M=0;ud(this,2,a)};D.prototype.yf=function(a){w(1==this.M);this.M=0;ud(this,3,a)};
3585
- var ud=function(a,b,c){0==a.M&&(a===c&&(b=3,c=new TypeError("Promise cannot resolve to itself")),a.M=1,zd(c,a.xf,a.yf,a)||(a.na=c,a.M=b,a.s=null,Id(a),3!=b||c instanceof vd||Jd(a,c)))},zd=function(a,b,c,d){if(a instanceof D)return null!=b&&Aa(b,"opt_onFulfilled should be a function."),null!=c&&Aa(c,"opt_onRejected should be a function. Did you pass opt_context as the second argument instead of the third?"),Dd(a,yd(b||ba,c||null,d)),!0;if(td(a))return a.then(b,c,d),!0;if(ga(a))try{var e=a.then;if(q(e))return Kd(a,
3586
- e,b,c,d),!0}catch(f){return c.call(d,f),!0}return!1},Kd=function(a,b,c,d,e){var f=!1,g=function(a){f||(f=!0,c.call(e,a))},k=function(a){f||(f=!0,d.call(e,a))};try{b.call(a,g,k)}catch(n){k(n)}},Id=function(a){a.Mc||(a.Mc=!0,qd(a.xe,a))},Gd=function(a){var b=null;a.ja&&(b=a.ja,a.ja=b.next,b.next=null);a.ja||(a.Ua=null);null!=b&&w(null!=b.Ja);return b};D.prototype.xe=function(){for(var a;a=Gd(this);)Hd(this,a,this.M,this.na);this.Mc=!1};
3587
- var Hd=function(a,b,c,d){if(3==c&&b.bb&&!b.tb)for(;a&&a.cc;a=a.s)a.cc=!1;if(b.child)b.child.s=null,Ld(b,c,d);else try{b.tb?b.Ja.call(b.context):Ld(b,c,d)}catch(e){Md.call(null,e)}xd.put(b)},Ld=function(a,b,c){2==b?a.Ja.call(a.context,c):a.bb&&a.bb.call(a.context,c)},Jd=function(a,b){a.cc=!0;qd(function(){a.cc&&Md.call(null,b)})},Md=gd,vd=function(a){u.call(this,a)};t(vd,u);vd.prototype.name="cancel";/*
3588
- Portions of this code are from MochiKit, received by
3589
- The Closure Authors under the MIT license. All other code is Copyright
3590
- 2005-2009 The Closure Authors. All Rights Reserved.
3591
- */
3592
- var Nd=function(a,b){this.uc=[];this.Qd=a;this.zd=b||null;this.wb=this.Ya=!1;this.na=void 0;this.md=this.sd=this.Hc=!1;this.Bc=0;this.s=null;this.Ic=0};Nd.prototype.cancel=function(a){if(this.Ya)this.na instanceof Nd&&this.na.cancel();else{if(this.s){var b=this.s;delete this.s;a?b.cancel(a):(b.Ic--,0>=b.Ic&&b.cancel())}this.Qd?this.Qd.call(this.zd,this):this.md=!0;this.Ya||Od(this,new Pd)}};Nd.prototype.xd=function(a,b){this.Hc=!1;Qd(this,a,b)};
3593
- var Qd=function(a,b,c){a.Ya=!0;a.na=c;a.wb=!b;Rd(a)},Td=function(a){if(a.Ya){if(!a.md)throw new Sd;a.md=!1}};Nd.prototype.callback=function(a){Td(this);Ud(a);Qd(this,!0,a)};
3594
- var Od=function(a,b){Td(a);Ud(b);Qd(a,!1,b)},Ud=function(a){w(!(a instanceof Nd),"An execution sequence may not be initiated with a blocking Deferred.")},Yd=function(a){var b=Vd("https://apis.google.com/js/client.js?onload="+Wd);Xd(b,null,a,void 0)},Xd=function(a,b,c,d){w(!a.sd,"Blocking Deferreds can not be re-used");a.uc.push([b,c,d]);a.Ya&&Rd(a)};Nd.prototype.then=function(a,b,c){var d,e,f=new D(function(a,b){d=a;e=b});Xd(this,d,function(a){a instanceof Pd?f.cancel():e(a)});return f.then(a,b,c)};
3595
- sd(Nd);
3596
- var Zd=function(a){return Ea(a.uc,function(a){return q(a[1])})},Rd=function(a){if(a.Bc&&a.Ya&&Zd(a)){var b=a.Bc,c=$d[b];c&&(l.clearTimeout(c.xb),delete $d[b]);a.Bc=0}a.s&&(a.s.Ic--,delete a.s);for(var b=a.na,d=c=!1;a.uc.length&&!a.Hc;){var e=a.uc.shift(),f=e[0],g=e[1],e=e[2];if(f=a.wb?g:f)try{var k=f.call(e||a.zd,b);void 0!==k&&(a.wb=a.wb&&(k==b||k instanceof Error),a.na=b=k);if(td(b)||"function"===typeof l.Promise&&b instanceof l.Promise)d=!0,a.Hc=!0}catch(n){b=n,a.wb=!0,Zd(a)||(c=!0)}}a.na=b;d&&
3597
- (k=r(a.xd,a,!0),d=r(a.xd,a,!1),b instanceof Nd?(Xd(b,k,d),b.sd=!0):b.then(k,d));c&&(b=new ae(b),$d[b.xb]=b,a.Bc=b.xb)},Sd=function(){u.call(this)};t(Sd,u);Sd.prototype.message="Deferred has already fired";Sd.prototype.name="AlreadyCalledError";var Pd=function(){u.call(this)};t(Pd,u);Pd.prototype.message="Deferred was canceled";Pd.prototype.name="CanceledError";var ae=function(a){this.xb=l.setTimeout(r(this.wf,this),0);this.O=a};
3598
- ae.prototype.wf=function(){w($d[this.xb],"Cannot throw an error that is not scheduled.");delete $d[this.xb];throw this.O;};var $d={};var Vd=function(a){var b=new nc;b.qc=a;return be(b)},be=function(a){var b={},c=b.document||document,d;a instanceof nc&&a.constructor===nc&&a.ne===mc?d=a.qc:(xa("expected object of type TrustedResourceUrl, got '"+a+"' of type "+m(a)),d="type_error:TrustedResourceUrl");var e=document.createElement("SCRIPT");a={Xd:e,Qb:void 0};var f=new Nd(ce,a),g=null,k=null!=b.timeout?b.timeout:5E3;0<k&&(g=window.setTimeout(function(){de(e,!0);Od(f,new ee(1,"Timeout reached for loading script "+d))},k),a.Qb=g);e.onload=
3599
- e.onreadystatechange=function(){e.readyState&&"loaded"!=e.readyState&&"complete"!=e.readyState||(de(e,b.If||!1,g),f.callback(null))};e.onerror=function(){de(e,!0,g);Od(f,new ee(0,"Error while loading script "+d))};a=b.attributes||{};Ua(a,{type:"text/javascript",charset:"UTF-8",src:d});ed(e,a);fe(c).appendChild(e);return f},fe=function(a){var b;return(b=(a||document).getElementsByTagName("HEAD"))&&0!=b.length?b[0]:a.documentElement},ce=function(){if(this&&this.Xd){var a=this.Xd;a&&"SCRIPT"==a.tagName&&
3600
- de(a,!0,this.Qb)}},de=function(a,b,c){null!=c&&l.clearTimeout(c);a.onload=ba;a.onerror=ba;a.onreadystatechange=ba;b&&window.setTimeout(function(){a&&a.parentNode&&a.parentNode.removeChild(a)},0)},ee=function(a,b){var c="Jsloader error (code #"+a+")";b&&(c+=": "+b);u.call(this,c);this.code=a};t(ee,u);var ge=function(){Hb.call(this);this.aa=new Ob(this);this.pe=this;this.$c=null};t(ge,Hb);ge.prototype[Kb]=!0;h=ge.prototype;h.addEventListener=function(a,b,c,d){Ub(this,a,b,c,d)};h.removeEventListener=function(a,b,c,d){cc(this,a,b,c,d)};
3601
- h.dispatchEvent=function(a){he(this);var b,c=this.$c;if(c){b=[];for(var d=1;c;c=c.$c)b.push(c),w(1E3>++d,"infinite loop")}c=this.pe;d=a.type||a;if(p(a))a=new Ib(a,c);else if(a instanceof Ib)a.target=a.target||c;else{var e=a;a=new Ib(d,c);Ua(a,e)}var e=!0,f;if(b)for(var g=b.length-1;!a.gb&&0<=g;g--)f=a.currentTarget=b[g],e=ie(f,d,!0,a)&&e;a.gb||(f=a.currentTarget=c,e=ie(f,d,!0,a)&&e,a.gb||(e=ie(f,d,!1,a)&&e));if(b)for(g=0;!a.gb&&g<b.length;g++)f=a.currentTarget=b[g],e=ie(f,d,!1,a)&&e;return e};
3602
- h.Wa=function(){ge.pd.Wa.call(this);if(this.aa){var a=this.aa,b=0,c;for(c in a.D){for(var d=a.D[c],e=0;e<d.length;e++)++b,Nb(d[e]);delete a.D[c];a.Rb--}}this.$c=null};h.listen=function(a,b,c,d){he(this);return this.aa.add(String(a),b,!1,c,d)};
3603
- var bc=function(a,b,c,d,e){a.aa.add(String(b),c,!0,d,e)},ie=function(a,b,c,d){b=a.aa.D[String(b)];if(!b)return!0;b=b.concat();for(var e=!0,f=0;f<b.length;++f){var g=b[f];if(g&&!g.lb&&g.capture==c){var k=g.listener,n=g.dc||g.src;g.Vb&&Qb(a.aa,g);e=!1!==k.call(n,d)&&e}}return e&&0!=d.Wd};ge.prototype.Oc=function(a,b,c,d){return this.aa.Oc(String(a),b,c,d)};var he=function(a){w(a.aa,"Event target is not initialized. Did you call the superclass (goog.events.EventTarget) constructor?")};var je=function(a,b,c){if(q(a))c&&(a=r(a,c));else if(a&&"function"==typeof a.handleEvent)a=r(a.handleEvent,a);else throw Error("Invalid listener argument");return 2147483647<Number(b)?-1:l.setTimeout(a,b||0)},ke=function(a){var b=null;return(new D(function(c,d){b=je(function(){c(void 0)},a);-1==b&&d(Error("Failed to schedule timer."))})).f(function(a){l.clearTimeout(b);throw a;})};var le=/^(?:([^:/?#.]+):)?(?:\/\/(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\?([^#]*))?(?:#([\s\S]*))?$/,me=function(a,b){if(a){a=a.split("&");for(var c=0;c<a.length;c++){var d=a[c].indexOf("="),e,f=null;0<=d?(e=a[c].substring(0,d),f=a[c].substring(d+1)):e=a[c];b(e,f?decodeURIComponent(f.replace(/\+/g," ")):"")}}};var G=function(a){ge.call(this);this.headers=new zc;this.Fc=a||null;this.ra=!1;this.Ec=this.b=null;this.Ab=this.Od=this.kc="";this.Fa=this.Sc=this.ic=this.Lc=!1;this.ob=0;this.zc=null;this.Vd="";this.Cc=this.ef=this.je=!1};t(G,ge);var ne=G.prototype,oe=Pc("goog.net.XhrIo");ne.T=oe;var pe=/^https?$/i,qe=["POST","PUT"];
3604
- G.prototype.send=function(a,b,c,d){if(this.b)throw Error("[goog.net.XhrIo] Object is active with another request="+this.kc+"; newUri="+a);b=b?b.toUpperCase():"GET";this.kc=a;this.Ab="";this.Od=b;this.Lc=!1;this.ra=!0;this.b=this.Fc?this.Fc.Xb():Yc.Xb();this.Ec=this.Fc?Xc(this.Fc):Xc(Yc);this.b.onreadystatechange=r(this.Sd,this);this.ef&&"onprogress"in this.b&&(this.b.onprogress=r(function(a){this.Rd(a,!0)},this),this.b.upload&&(this.b.upload.onprogress=r(this.Rd,this)));try{C(this.T,re(this,"Opening Xhr")),
3605
- this.Sc=!0,this.b.open(b,String(a),!0),this.Sc=!1}catch(f){C(this.T,re(this,"Error opening Xhr: "+f.message));this.O(5,f);return}a=c||"";var e=this.headers.clone();d&&Ec(d,function(a,b){e.set(b,a)});d=Ga(e.ka());c=l.FormData&&a instanceof l.FormData;!Ha(qe,b)||d||c||e.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");e.forEach(function(a,b){this.b.setRequestHeader(b,a)},this);this.Vd&&(this.b.responseType=this.Vd);"withCredentials"in this.b&&this.b.withCredentials!==this.je&&(this.b.withCredentials=
3606
- this.je);try{se(this),0<this.ob&&(this.Cc=te(this.b),C(this.T,re(this,"Will abort after "+this.ob+"ms if incomplete, xhr2 "+this.Cc)),this.Cc?(this.b.timeout=this.ob,this.b.ontimeout=r(this.Qb,this)):this.zc=je(this.Qb,this.ob,this)),C(this.T,re(this,"Sending request")),this.ic=!0,this.b.send(a),this.ic=!1}catch(f){C(this.T,re(this,"Send error: "+f.message)),this.O(5,f)}};var te=function(a){return z&&B(9)&&fa(a.timeout)&&void 0!==a.ontimeout},Fa=function(a){return"content-type"==a.toLowerCase()};
3607
- G.prototype.Qb=function(){"undefined"!=typeof aa&&this.b&&(this.Ab="Timed out after "+this.ob+"ms, aborting",C(this.T,re(this,this.Ab)),this.dispatchEvent("timeout"),this.abort(8))};G.prototype.O=function(a,b){this.ra=!1;this.b&&(this.Fa=!0,this.b.abort(),this.Fa=!1);this.Ab=b;ue(this);ve(this)};var ue=function(a){a.Lc||(a.Lc=!0,a.dispatchEvent("complete"),a.dispatchEvent("error"))};
3608
- G.prototype.abort=function(){this.b&&this.ra&&(C(this.T,re(this,"Aborting")),this.ra=!1,this.Fa=!0,this.b.abort(),this.Fa=!1,this.dispatchEvent("complete"),this.dispatchEvent("abort"),ve(this))};G.prototype.Wa=function(){this.b&&(this.ra&&(this.ra=!1,this.Fa=!0,this.b.abort(),this.Fa=!1),ve(this,!0));G.pd.Wa.call(this)};G.prototype.Sd=function(){this.isDisposed()||(this.Sc||this.ic||this.Fa?we(this):this.af())};G.prototype.af=function(){we(this)};
3609
- var we=function(a){if(a.ra&&"undefined"!=typeof aa)if(a.Ec[1]&&4==xe(a)&&2==ye(a))C(a.T,re(a,"Local request error detected and ignored"));else if(a.ic&&4==xe(a))je(a.Sd,0,a);else if(a.dispatchEvent("readystatechange"),4==xe(a)){C(a.T,re(a,"Request complete"));a.ra=!1;try{var b=ye(a),c;a:switch(b){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:c=!0;break a;default:c=!1}var d;if(!(d=c)){var e;if(e=0===b){var f=String(a.kc).match(le)[1]||null;if(!f&&l.self&&l.self.location)var g=l.self.location.protocol,
3610
- f=g.substr(0,g.length-1);e=!pe.test(f?f.toLowerCase():"")}d=e}if(d)a.dispatchEvent("complete"),a.dispatchEvent("success");else{var k;try{k=2<xe(a)?a.b.statusText:""}catch(n){C(a.T,"Can not get status: "+n.message),k=""}a.Ab=k+" ["+ye(a)+"]";ue(a)}}finally{ve(a)}}};G.prototype.Rd=function(a,b){w("progress"===a.type,"goog.net.EventType.PROGRESS is of the same type as raw XHR progress.");this.dispatchEvent(ze(a,"progress"));this.dispatchEvent(ze(a,b?"downloadprogress":"uploadprogress"))};
3611
- var ze=function(a,b){return{type:b,lengthComputable:a.lengthComputable,loaded:a.loaded,total:a.total}},ve=function(a,b){if(a.b){se(a);var c=a.b,d=a.Ec[0]?ba:null;a.b=null;a.Ec=null;b||a.dispatchEvent("ready");try{c.onreadystatechange=d}catch(e){(a=a.T)&&a.log(Jc,"Problem encountered resetting onreadystatechange: "+e.message,void 0)}}},se=function(a){a.b&&a.Cc&&(a.b.ontimeout=null);fa(a.zc)&&(l.clearTimeout(a.zc),a.zc=null)},xe=function(a){return a.b?a.b.readyState:0},ye=function(a){try{return 2<xe(a)?
3612
- a.b.status:-1}catch(b){return-1}},Ae=function(a){try{return a.b?a.b.responseText:""}catch(b){return C(a.T,"Can not get responseText: "+b.message),""}},re=function(a,b){return b+" ["+a.Od+" "+a.kc+" "+ye(a)+"]"};var Be=function(a,b){this.$=this.Pa=this.da="";this.eb=null;this.Ea=this.ta="";this.R=this.Se=!1;var c;a instanceof Be?(this.R=void 0!==b?b:a.R,Ce(this,a.da),c=a.Pa,H(this),this.Pa=c,De(this,a.$),Ee(this,a.eb),Fe(this,a.ta),Ge(this,a.V.clone()),a=a.Ea,H(this),this.Ea=a):a&&(c=String(a).match(le))?(this.R=!!b,Ce(this,c[1]||"",!0),a=c[2]||"",H(this),this.Pa=He(a),De(this,c[3]||"",!0),Ee(this,c[4]),Fe(this,c[5]||"",!0),Ge(this,c[6]||"",!0),a=c[7]||"",H(this),this.Ea=He(a)):(this.R=!!b,this.V=new I(null,
3613
- 0,this.R))};Be.prototype.toString=function(){var a=[],b=this.da;b&&a.push(Ie(b,Je,!0),":");var c=this.$;if(c||"file"==b)a.push("//"),(b=this.Pa)&&a.push(Ie(b,Je,!0),"@"),a.push(encodeURIComponent(String(c)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),c=this.eb,null!=c&&a.push(":",String(c));if(c=this.ta)this.$&&"/"!=c.charAt(0)&&a.push("/"),a.push(Ie(c,"/"==c.charAt(0)?Ke:Le,!0));(c=this.V.toString())&&a.push("?",c);(c=this.Ea)&&a.push("#",Ie(c,Me));return a.join("")};
3614
- Be.prototype.resolve=function(a){var b=this.clone(),c=!!a.da;c?Ce(b,a.da):c=!!a.Pa;if(c){var d=a.Pa;H(b);b.Pa=d}else c=!!a.$;c?De(b,a.$):c=null!=a.eb;d=a.ta;if(c)Ee(b,a.eb);else if(c=!!a.ta){if("/"!=d.charAt(0))if(this.$&&!this.ta)d="/"+d;else{var e=b.ta.lastIndexOf("/");-1!=e&&(d=b.ta.substr(0,e+1)+d)}e=d;if(".."==e||"."==e)d="";else if(v(e,"./")||v(e,"/.")){for(var d=0==e.lastIndexOf("/",0),e=e.split("/"),f=[],g=0;g<e.length;){var k=e[g++];"."==k?d&&g==e.length&&f.push(""):".."==k?((1<f.length||
3615
- 1==f.length&&""!=f[0])&&f.pop(),d&&g==e.length&&f.push("")):(f.push(k),d=!0)}d=f.join("/")}else d=e}c?Fe(b,d):c=""!==a.V.toString();c?Ge(b,a.V.clone()):c=!!a.Ea;c&&(a=a.Ea,H(b),b.Ea=a);return b};Be.prototype.clone=function(){return new Be(this)};
3616
- var Ce=function(a,b,c){H(a);a.da=c?He(b,!0):b;a.da&&(a.da=a.da.replace(/:$/,""))},De=function(a,b,c){H(a);a.$=c?He(b,!0):b},Ee=function(a,b){H(a);if(b){b=Number(b);if(isNaN(b)||0>b)throw Error("Bad port number "+b);a.eb=b}else a.eb=null},Fe=function(a,b,c){H(a);a.ta=c?He(b,!0):b},Ge=function(a,b,c){H(a);b instanceof I?(a.V=b,a.V.ld(a.R)):(c||(b=Ie(b,Ne)),a.V=new I(b,0,a.R))},J=function(a,b,c){H(a);a.V.set(b,c)},Oe=function(a,b){return a.V.get(b)},Pe=function(a,b){H(a);a.V.remove(b)},H=function(a){if(a.Se)throw Error("Tried to modify a read-only Uri");
3617
- };Be.prototype.ld=function(a){this.R=a;this.V&&this.V.ld(a);return this};
3618
- var Qe=function(a){return a instanceof Be?a.clone():new Be(a,void 0)},Re=function(a,b){var c=new Be(null,void 0);Ce(c,"https");a&&De(c,a);b&&Fe(c,b);return c},He=function(a,b){return a?b?decodeURI(a.replace(/%25/g,"%2525")):decodeURIComponent(a):""},Ie=function(a,b,c){return p(a)?(a=encodeURI(a).replace(b,Se),c&&(a=a.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),a):null},Se=function(a){a=a.charCodeAt(0);return"%"+(a>>4&15).toString(16)+(a&15).toString(16)},Je=/[#\/\?@]/g,Le=/[\#\?:]/g,Ke=/[\#\?]/g,Ne=/[\#\?@]/g,
3619
- Me=/#/g,I=function(a,b,c){this.o=this.l=null;this.N=a||null;this.R=!!c},Te=function(a){a.l||(a.l=new zc,a.o=0,a.N&&me(a.N,function(b,c){a.add(decodeURIComponent(b.replace(/\+/g," ")),c)}))},Ve=function(a){var b=Dc(a);if("undefined"==typeof b)throw Error("Keys are undefined");var c=new I(null,0,void 0);a=Cc(a);for(var d=0;d<b.length;d++){var e=b[d],f=a[d];da(f)?Ue(c,e,f):c.add(e,f)}return c};h=I.prototype;
3620
- h.add=function(a,b){Te(this);this.N=null;a=this.P(a);var c=this.l.get(a);c||this.l.set(a,c=[]);c.push(b);this.o=ya(this.o)+1;return this};h.remove=function(a){Te(this);a=this.P(a);return this.l.ub(a)?(this.N=null,this.o=ya(this.o)-this.l.get(a).length,this.l.remove(a)):!1};h.ub=function(a){Te(this);a=this.P(a);return this.l.ub(a)};h.ka=function(){Te(this);for(var a=this.l.X(),b=this.l.ka(),c=[],d=0;d<b.length;d++)for(var e=a[d],f=0;f<e.length;f++)c.push(b[d]);return c};
3621
- h.X=function(a){Te(this);var b=[];if(p(a))this.ub(a)&&(b=La(b,this.l.get(this.P(a))));else{a=this.l.X();for(var c=0;c<a.length;c++)b=La(b,a[c])}return b};h.set=function(a,b){Te(this);this.N=null;a=this.P(a);this.ub(a)&&(this.o=ya(this.o)-this.l.get(a).length);this.l.set(a,[b]);this.o=ya(this.o)+1;return this};h.get=function(a,b){a=a?this.X(a):[];return 0<a.length?String(a[0]):b};var Ue=function(a,b,c){a.remove(b);0<c.length&&(a.N=null,a.l.set(a.P(b),Ma(c)),a.o=ya(a.o)+c.length)};
3622
- I.prototype.toString=function(){if(this.N)return this.N;if(!this.l)return"";for(var a=[],b=this.l.ka(),c=0;c<b.length;c++)for(var d=b[c],e=encodeURIComponent(String(d)),d=this.X(d),f=0;f<d.length;f++){var g=e;""!==d[f]&&(g+="="+encodeURIComponent(String(d[f])));a.push(g)}return this.N=a.join("&")};I.prototype.clone=function(){var a=new I;a.N=this.N;this.l&&(a.l=this.l.clone(),a.o=this.o);return a};I.prototype.P=function(a){a=String(a);this.R&&(a=a.toLowerCase());return a};
3623
- I.prototype.ld=function(a){a&&!this.R&&(Te(this),this.N=null,this.l.forEach(function(a,c){var b=c.toLowerCase();c!=b&&(this.remove(c),Ue(this,b,a))},this));this.R=a};var We=function(){var a=K();return z&&!!mb&&11==mb||/Edge\/\d+/.test(a)},Xe=function(){return l.window&&l.window.location.href||""},Ye=function(a,b){b=b||l.window;var c="about:blank";a&&(c=qc(tc(a)));b.location.href=c},Ze=function(a,b){var c=[],d;for(d in a)d in b?typeof a[d]!=typeof b[d]?c.push(d):da(a[d])?Ra(a[d],b[d])||c.push(d):"object"==typeof a[d]&&null!=a[d]&&null!=b[d]?0<Ze(a[d],b[d]).length&&c.push(d):a[d]!==b[d]&&c.push(d):c.push(d);for(d in b)d in a||c.push(d);return c},af=function(){var a;
3624
- a=K();a="Chrome"!=$e(a)?null:(a=a.match(/\sChrome\/(\d+)/i))&&2==a.length?parseInt(a[1],10):null;return a&&30>a?!1:!z||!mb||9<mb},bf=function(a){a=(a||K()).toLowerCase();return a.match(/android/)||a.match(/webos/)||a.match(/iphone|ipad|ipod/)||a.match(/blackberry/)||a.match(/windows phone/)||a.match(/iemobile/)?!0:!1},cf=function(a){a=a||l.window;try{a.close()}catch(b){}},df=function(a,b,c){var d=Math.floor(1E9*Math.random()).toString();b=b||500;c=c||600;var e=(window.screen.availHeight-c)/2,f=(window.screen.availWidth-
3625
- b)/2;b={width:b,height:c,top:0<e?e:0,left:0<f?f:0,location:!0,resizable:!0,statusbar:!0,toolbar:!1};c=K().toLowerCase();d&&(b.target=d,v(c,"crios/")&&(b.target="_blank"));"Firefox"==$e(K())&&(a=a||"http://localhost",b.scrollbars=!0);var g;c=a||"about:blank";(d=b)||(d={});a=window;b=c instanceof pc?c:tc("undefined"!=typeof c.href?c.href:String(c));c=d.target||c.target;e=[];for(g in d)switch(g){case "width":case "height":case "top":case "left":e.push(g+"="+d[g]);break;case "target":case "noreferrer":break;
3626
- default:e.push(g+"="+(d[g]?1:0))}g=e.join(",");(y("iPhone")&&!y("iPod")&&!y("iPad")||y("iPad")||y("iPod"))&&a.navigator&&a.navigator.standalone&&c&&"_self"!=c?(g=a.document.createElement("A"),"undefined"!=typeof HTMLAnchorElement&&"undefined"!=typeof Location&&"undefined"!=typeof Element&&(e=g&&(g instanceof HTMLAnchorElement||!(g instanceof Location||g instanceof Element)),f=ga(g)?g.constructor.displayName||g.constructor.name||Object.prototype.toString.call(g):void 0===g?"undefined":null===g?"null":
3627
- typeof g,w(e,"Argument is not a HTMLAnchorElement (or a non-Element mock); got: %s",f)),b=b instanceof pc?b:tc(b),g.href=qc(b),g.setAttribute("target",c),d.noreferrer&&g.setAttribute("rel","noreferrer"),d=document.createEvent("MouseEvent"),d.initMouseEvent("click",!0,!0,a,1),g.dispatchEvent(d),g={}):d.noreferrer?(g=a.open("",c,g),d=qc(b),g&&(db&&v(d,";")&&(d="'"+d.replace(/'/g,"%27")+"'"),g.opener=null,a=lc("b/12014412, meta tag with sanitized URL"),ta.test(d)&&(-1!=d.indexOf("&")&&(d=d.replace(na,
3628
- "&amp;")),-1!=d.indexOf("<")&&(d=d.replace(oa,"&lt;")),-1!=d.indexOf(">")&&(d=d.replace(pa,"&gt;")),-1!=d.indexOf('"')&&(d=d.replace(qa,"&quot;")),-1!=d.indexOf("'")&&(d=d.replace(ra,"&#39;")),-1!=d.indexOf("\x00")&&(d=d.replace(sa,"&#0;"))),d='<META HTTP-EQUIV="refresh" content="0; url='+d+'">',za(kc(a),"must provide justification"),w(!/^[\s\xa0]*$/.test(kc(a)),"must provide non-empty justification"),g.document.write(wc((new vc).Pe(d))),g.document.close())):g=a.open(qc(b),c,g);if(g)try{g.focus()}catch(k){}return g},
3629
- ef=function(a){return new D(function(b){var c=function(){ke(2E3).then(function(){if(!a||a.closed)b();else return c()})};return c()})},ff=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,gf=function(){var a=null;return(new D(function(b){"complete"==l.document.readyState?b():(a=function(){b()},ac(window,"load",a))})).f(function(b){cc(window,"load",a);throw b;})},jf=function(){return hf(void 0)?gf().then(function(){return new D(function(a,b){var c=l.document,d=setTimeout(function(){b(Error("Cordova framework is not ready."))},
3630
- 1E3);c.addEventListener("deviceready",function(){clearTimeout(d);a()},!1)})}):F(Error("Cordova must run in an Android or iOS file scheme."))},hf=function(a){a=a||K();return!("file:"!==kf()||!a.toLowerCase().match(/iphone|ipad|ipod|android/))},lf=function(){var a=l.window;try{return!(!a||a==a.top)}catch(b){return!1}},L=function(){return firebase.INTERNAL.hasOwnProperty("reactNative")?"ReactNative":firebase.INTERNAL.hasOwnProperty("node")?"Node":"Browser"},mf=function(){var a=L();return"ReactNative"===
3631
- a||"Node"===a},$e=function(a){var b=a.toLowerCase();if(v(b,"opera/")||v(b,"opr/")||v(b,"opios/"))return"Opera";if(v(b,"iemobile"))return"IEMobile";if(v(b,"msie")||v(b,"trident/"))return"IE";if(v(b,"edge/"))return"Edge";if(v(b,"firefox/"))return"Firefox";if(v(b,"silk/"))return"Silk";if(v(b,"blackberry"))return"Blackberry";if(v(b,"webos"))return"Webos";if(!v(b,"safari/")||v(b,"chrome/")||v(b,"crios/")||v(b,"android"))if(!v(b,"chrome/")&&!v(b,"crios/")||v(b,"edge/")){if(v(b,"android"))return"Android";
3632
- if((a=a.match(/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/))&&2==a.length)return a[1]}else return"Chrome";else return"Safari";return"Other"},nf=function(a){var b=L();return("Browser"===b?$e(K()):b)+"/JsCore/"+a},K=function(){return l.navigator&&l.navigator.userAgent||""},M=function(a,b){a=a.split(".");b=b||l;for(var c=0;c<a.length&&"object"==typeof b&&null!=b;c++)b=b[a[c]];c!=a.length&&(b=void 0);return b},qf=function(){var a;if(a=(of()||"chrome-extension:"===kf()||hf()&&!1)&&!mf())a:{try{var b=l.localStorage,
3633
- c=pf();if(b){b.setItem(c,"1");b.removeItem(c);a=We()?!!l.indexedDB:!0;break a}}catch(d){}a=!1}return a},of=function(){return"http:"===kf()||"https:"===kf()},kf=function(){return l.location&&l.location.protocol||null},rf=function(a){a=a||K();return bf(a)||"Firefox"==$e(a)?!1:!0},sf=function(a){return"undefined"===typeof a?null:Sc(a)},tf=function(a){var b={},c;for(c in a)a.hasOwnProperty(c)&&null!==a[c]&&void 0!==a[c]&&(b[c]=a[c]);return b},uf=function(a){if(null!==a)return JSON.parse(a)},pf=function(a){return a?
3634
- a:""+Math.floor(1E9*Math.random()).toString()},vf=function(a){a=a||K();return"Safari"==$e(a)||a.toLowerCase().match(/iphone|ipad|ipod/)?!1:!0},wf=function(){var a=l.___jsl;if(a&&a.H)for(var b in a.H)if(a.H[b].r=a.H[b].r||[],a.H[b].L=a.H[b].L||[],a.H[b].r=a.H[b].L.concat(),a.CP)for(var c=0;c<a.CP.length;c++)a.CP[c]=null},xf=function(){return l.navigator&&"boolean"===typeof l.navigator.onLine?l.navigator.onLine:!0},yf=function(a,b,c,d){if(a>b)throw Error("Short delay should be less than long delay!");
3635
- this.tf=a;this.Ve=b;a=c||K();d=d||L();this.Re=bf(a)||"ReactNative"===d};yf.prototype.get=function(){return this.Re?this.Ve:this.tf};
3636
- var zf=function(){var a=l.document;return a&&"undefined"!==typeof a.visibilityState?"visible"==a.visibilityState:!0},Af=function(){var a=l.document,b=null;return zf()||!a?E():(new D(function(c){b=function(){zf()&&(a.removeEventListener("visibilitychange",b,!1),c())};a.addEventListener("visibilitychange",b,!1)})).f(function(c){a.removeEventListener("visibilitychange",b,!1);throw c;})};var Bf;try{var Cf={};Object.defineProperty(Cf,"abcd",{configurable:!0,enumerable:!0,value:1});Object.defineProperty(Cf,"abcd",{configurable:!0,enumerable:!0,value:2});Bf=2==Cf.abcd}catch(a){Bf=!1}
3637
- var N=function(a,b,c){Bf?Object.defineProperty(a,b,{configurable:!0,enumerable:!0,value:c}):a[b]=c},Df=function(a,b){if(b)for(var c in b)b.hasOwnProperty(c)&&N(a,c,b[c])},Ef=function(a){var b={},c;for(c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b},Ff=function(a,b){if(!b||!b.length)return!0;if(!a)return!1;for(var c=0;c<b.length;c++){var d=a[b[c]];if(void 0===d||null===d||""===d)return!1}return!0},Gf=function(a){var b=a;if("object"==typeof a&&null!=a){var b="length"in a?[]:{},c;for(c in a)N(b,c,
3638
- Gf(a[c]))}return b};var Hf="oauth_consumer_key oauth_nonce oauth_signature oauth_signature_method oauth_timestamp oauth_token oauth_version".split(" "),If=["client_id","response_type","scope","redirect_uri","state"],Jf={Df:{Fb:500,Eb:600,providerId:"facebook.com",hd:If},Ef:{Fb:500,Eb:620,providerId:"github.com",hd:If},Ff:{Fb:515,Eb:680,providerId:"google.com",hd:If},Gf:{Fb:485,Eb:705,providerId:"twitter.com",hd:Hf}},Kf=function(a){for(var b in Jf)if(Jf[b].providerId==a)return Jf[b];return null};var O=function(a,b){this.code="auth/"+a;this.message=b||Lf[a]||""};t(O,Error);O.prototype.C=function(){return{code:this.code,message:this.message}};O.prototype.toJSON=function(){return this.C()};
3639
- var Mf=function(a){var b=a&&a.code;return b?new O(b.substring(5),a.message):null},Lf={"argument-error":"","app-not-authorized":"This app, identified by the domain where it's hosted, is not authorized to use Firebase Authentication with the provided API key. Review your key configuration in the Google API console.","app-not-installed":"The requested mobile application corresponding to the identifier (Android package name or iOS bundle ID) provided is not installed on this device.","cordova-not-ready":"Cordova framework is not ready.",
3640
- "cors-unsupported":"This browser is not supported.","credential-already-in-use":"This credential is already associated with a different user account.","custom-token-mismatch":"The custom token corresponds to a different audience.","requires-recent-login":"This operation is sensitive and requires recent authentication. Log in again before retrying this request.","dynamic-link-not-activated":"Please activate Dynamic Links in the Firebase Console and agree to the terms and conditions.","email-already-in-use":"The email address is already in use by another account.",
3641
- "expired-action-code":"The action code has expired. ","cancelled-popup-request":"This operation has been cancelled due to another conflicting popup being opened.","internal-error":"An internal error has occurred.","invalid-user-token":"The user's credential is no longer valid. The user must sign in again.","invalid-auth-event":"An internal error has occurred.","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.",
3642
- "invalid-custom-token":"The custom token format is incorrect. Please check the documentation.","invalid-email":"The email address is badly formatted.","invalid-api-key":"Your API key is invalid, please check you have copied it correctly.","invalid-credential":"The supplied auth credential is malformed or has expired.","invalid-message-payload":"The email template corresponding to this action contains invalid characters in its message. Please fix by going to the Auth email templates section in the Firebase Console.",
3643
- "invalid-oauth-provider":"EmailAuthProvider is not supported for this operation. This operation only supports OAuth providers.","unauthorized-domain":"This domain is not authorized for OAuth operations for your Firebase project. Edit the list of authorized domains from the Firebase console.","invalid-action-code":"The action code is invalid. This can happen if the code is malformed, expired, or has already been used.","wrong-password":"The password is invalid or the user does not have a password.",
3644
- "invalid-recipient-email":"The email corresponding to this action failed to send as the provided recipient email address is invalid.","invalid-sender":"The email template corresponding to this action contains an invalid sender email or name. Please fix by going to the Auth email templates section in the Firebase Console.","missing-iframe-start":"An internal error has occurred.","auth-domain-config-required":"Be sure to include authDomain when calling firebase.initializeApp(), by following the instructions in the Firebase console.",
3645
- "app-deleted":"This instance of FirebaseApp has been deleted.","account-exists-with-different-credential":"An account already exists with the same email address but different sign-in credentials. Sign in using a provider associated with this email address.","network-request-failed":"A network error (such as timeout, interrupted connection or unreachable host) has occurred.","no-auth-event":"An internal error has occurred.","no-such-provider":"User was not linked to an account with the given provider.",
3646
- "operation-not-allowed":"The given sign-in provider is disabled for this Firebase project. Enable it in the Firebase console, under the sign-in method tab of the Auth section.","operation-not-supported-in-this-environment":'This operation is not supported in the environment this application is running on. "location.protocol" must be http, https or chrome-extension and web storage must be enabled.',"popup-blocked":"Unable to establish a connection with the popup. It may have been blocked by the browser.",
3647
- "popup-closed-by-user":"The popup has been closed by the user before finalizing the operation.","provider-already-linked":"User can only be linked to one identity for the given provider.","redirect-cancelled-by-user":"The redirect operation has been cancelled by the user before finalizing.","redirect-operation-pending":"A redirect sign-in operation is already pending.",timeout:"The operation has timed out.","user-token-expired":"The user's credential is no longer valid. The user must sign in again.",
3648
- "too-many-requests":"We have blocked all requests from this device due to unusual activity. Try again later.","user-cancelled":"User did not grant your application the permissions it requested.","user-not-found":"There is no user record corresponding to this identifier. The user may have been deleted.","user-disabled":"The user account has been disabled by an administrator.","user-mismatch":"The supplied credentials do not correspond to the previously signed in user.","user-signed-out":"","weak-password":"The password must be 6 characters long or more.",
3649
- "web-storage-unsupported":"This browser is not supported or 3rd party cookies and data may be disabled."};var P=function(a,b,c,d,e){this.ga=a;this.F=b||null;this.qb=c||null;this.kd=d||null;this.O=e||null;if(this.qb||this.O){if(this.qb&&this.O)throw new O("invalid-auth-event");if(this.qb&&!this.kd)throw new O("invalid-auth-event");}else throw new O("invalid-auth-event");};P.prototype.ac=function(){return this.kd};P.prototype.getError=function(){return this.O};P.prototype.C=function(){return{type:this.ga,eventId:this.F,urlResponse:this.qb,sessionId:this.kd,error:this.O&&this.O.C()}};
3650
- var Nf=function(a){a=a||{};return a.type?new P(a.type,a.eventId,a.urlResponse,a.sessionId,a.error&&Mf(a.error)):null};var Of=function(a){var b="unauthorized-domain",c=void 0,d=Qe(a);a=d.$;d=d.da;"chrome-extension"==d?c=la("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.",a):"http"==d||"https"==d?c=la("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.",a):b=
3651
- "operation-not-supported-in-this-environment";O.call(this,b,c)};t(Of,O);var Pf=function(a){this.Ue=a.sub;ka();this.Yb=a.email||null};var Qf=function(a,b){if(b.idToken||b.accessToken)b.idToken&&N(this,"idToken",b.idToken),b.accessToken&&N(this,"accessToken",b.accessToken);else if(b.oauthToken&&b.oauthTokenSecret)N(this,"accessToken",b.oauthToken),N(this,"secret",b.oauthTokenSecret);else throw new O("internal-error","failed to construct a credential");N(this,"provider",a)};Qf.prototype.$b=function(a){return Rf(a,Sf(this))};Qf.prototype.Pd=function(a,b){var c=Sf(this);c.idToken=b;return Tf(a,c)};
3652
- var Sf=function(a){var b={};a.idToken&&(b.id_token=a.idToken);a.accessToken&&(b.access_token=a.accessToken);a.secret&&(b.oauth_token_secret=a.secret);b.providerId=a.provider;return{postBody:Ve(b).toString(),requestUri:"http://localhost"}};Qf.prototype.C=function(){var a={provider:this.provider};this.idToken&&(a.oauthIdToken=this.idToken);this.accessToken&&(a.oauthAccessToken=this.accessToken);this.secret&&(a.oauthTokenSecret=this.secret);return a};
3653
- var Uf=function(a,b){this.hf=b||[];Df(this,{providerId:a,isOAuthProvider:!0});this.yd={}};Uf.prototype.setCustomParameters=function(a){this.yd=Sa(a);return this};var Q=function(a){Uf.call(this,a,If);this.jd=[]};t(Q,Uf);Q.prototype.addScope=function(a){Ha(this.jd,a)||this.jd.push(a);return this};Q.prototype.Gd=function(){return Ma(this.jd)};
3654
- Q.prototype.credential=function(a,b){if(!a&&!b)throw new O("argument-error","credential failed: must provide the ID token and/or the access token.");return new Qf(this.providerId,{idToken:a||null,accessToken:b||null})};var Vf=function(){Q.call(this,"facebook.com")};t(Vf,Q);N(Vf,"PROVIDER_ID","facebook.com");var Wf=function(a){if(!a)throw new O("argument-error","credential failed: expected 1 argument (the OAuth access token).");return(new Vf).credential(null,a)},Xf=function(){Q.call(this,"github.com")};
3655
- t(Xf,Q);N(Xf,"PROVIDER_ID","github.com");var Yf=function(a){if(!a)throw new O("argument-error","credential failed: expected 1 argument (the OAuth access token).");return(new Xf).credential(null,a)},Zf=function(){Q.call(this,"google.com");this.addScope("profile")};t(Zf,Q);N(Zf,"PROVIDER_ID","google.com");var $f=function(a,b){return(new Zf).credential(a,b)},ag=function(){Uf.call(this,"twitter.com",Hf)};t(ag,Uf);N(ag,"PROVIDER_ID","twitter.com");
3656
- var bg=function(a,b){if(!a||!b)throw new O("argument-error","credential failed: expected 2 arguments (the OAuth access token and secret).");return new Qf("twitter.com",{oauthToken:a,oauthTokenSecret:b})},cg=function(a,b){this.Yb=a;this.ad=b;N(this,"provider","password")};cg.prototype.$b=function(a){return R(a,dg,{email:this.Yb,password:this.ad})};cg.prototype.Pd=function(a,b){return R(a,eg,{idToken:b,email:this.Yb,password:this.ad})};cg.prototype.C=function(){return{email:this.Yb,password:this.ad}};
3657
- var fg=function(){Df(this,{providerId:"password",isOAuthProvider:!1})};Df(fg,{PROVIDER_ID:"password"});
3658
- var gg=function(a){var b=a&&a.providerId;if(!b||"password"===b)return null;var c=a&&a.oauthAccessToken,d=a&&a.oauthTokenSecret;a=a&&a.oauthIdToken;try{switch(b){case "google.com":return $f(a,c);case "facebook.com":return Wf(c);case "github.com":return Yf(c);case "twitter.com":return bg(c,d);default:return(new Q(b)).credential(a,c)}}catch(e){return null}},hg=function(a){if(!a.isOAuthProvider)throw new O("invalid-oauth-provider");};var ig=function(a,b,c,d){O.call(this,a,d);N(this,"email",b);N(this,"credential",c)};t(ig,O);ig.prototype.C=function(){var a={code:this.code,message:this.message,email:this.email},b=this.credential&&this.credential.C();b&&(Ua(a,b),a.providerId=b.provider,delete a.provider);return a};ig.prototype.toJSON=function(){return this.C()};var jg=function(a){if(a.code){var b=a.code||"";0==b.indexOf("auth/")&&(b=b.substring(5));return a.email?new ig(b,a.email,gg(a),a.message):new O(b,a.message||void 0)}return null};var kg=function(a){this.Cf=a};t(kg,Wc);kg.prototype.Xb=function(){return new this.Cf};kg.prototype.Uc=function(){return{}};
3659
- var S=function(a,b,c){var d;d="Node"==L();d=l.XMLHttpRequest||d&&firebase.INTERNAL.node&&firebase.INTERNAL.node.XMLHttpRequest;if(!d)throw new O("internal-error","The XMLHttpRequest compatibility library was not found.");this.j=a;a=b||{};this.pf=a.secureTokenEndpoint||"https://securetoken.googleapis.com/v1/token";this.qf=a.secureTokenTimeout||lg;this.Yd=Sa(a.secureTokenHeaders||mg);this.Ae=a.firebaseEndpoint||"https://www.googleapis.com/identitytoolkit/v3/relyingparty/";this.Be=a.firebaseTimeout||
3660
- ng;this.Ed=Sa(a.firebaseHeaders||og);c&&(this.Ed["X-Client-Version"]=c,this.Yd["X-Client-Version"]=c);this.te=new ad;this.Bf=new kg(d)},pg,lg=new yf(3E4,6E4),mg={"Content-Type":"application/x-www-form-urlencoded"},ng=new yf(3E4,6E4),og={"Content-Type":"application/json"},rg=function(a,b,c,d,e,f,g){xf()?(af()?a=r(a.sf,a):(pg||(pg=new D(function(a,b){qg(a,b)})),a=r(a.rf,a)),a(b,c,d,e,f,g)):c&&c(null)};
3661
- S.prototype.sf=function(a,b,c,d,e,f){var g="Node"==L(),k=mf()?g?new G(this.Bf):new G:new G(this.te),n;f&&(k.ob=Math.max(0,f),n=setTimeout(function(){k.dispatchEvent("timeout")},f));k.listen("complete",function(){n&&clearTimeout(n);var a=null;try{a=JSON.parse(Ae(this))||null}catch(Xa){a=null}b&&b(a)});bc(k,"ready",function(){n&&clearTimeout(n);this.Ba||(this.Ba=!0,this.Wa())});bc(k,"timeout",function(){n&&clearTimeout(n);this.Ba||(this.Ba=!0,this.Wa());b&&b(null)});k.send(a,c,d,e)};
3662
- var Wd="__fcb"+Math.floor(1E6*Math.random()).toString(),qg=function(a,b){((window.gapi||{}).client||{}).request?a():(l[Wd]=function(){((window.gapi||{}).client||{}).request?a():b(Error("CORS_UNSUPPORTED"))},Yd(function(){b(Error("CORS_UNSUPPORTED"))}))};
3663
- S.prototype.rf=function(a,b,c,d,e){var f=this;pg.then(function(){window.gapi.client.setApiKey(f.j);var g=window.gapi.auth.getToken();window.gapi.auth.setToken(null);window.gapi.client.request({path:a,method:c,body:d,headers:e,authType:"none",callback:function(a){window.gapi.auth.setToken(g);b&&b(a)}})}).f(function(a){b&&b({error:{message:a&&a.message||"CORS_UNSUPPORTED"}})})};
3664
- var tg=function(a,b){return new D(function(c,d){"refresh_token"==b.grant_type&&b.refresh_token||"authorization_code"==b.grant_type&&b.code?rg(a,a.pf+"?key="+encodeURIComponent(a.j),function(a){a?a.error?d(sg(a)):a.access_token&&a.refresh_token?c(a):d(new O("internal-error")):d(new O("network-request-failed"))},"POST",Ve(b).toString(),a.Yd,a.qf.get()):d(new O("internal-error"))})},ug=function(a,b,c,d,e){var f=Qe(a.Ae+b);J(f,"key",a.j);e&&J(f,"cb",ka().toString());var g="GET"==c;if(g)for(var k in d)d.hasOwnProperty(k)&&
3665
- J(f,k,d[k]);return new D(function(b,e){rg(a,f.toString(),function(a){a?a.error?e(sg(a)):b(a):e(new O("network-request-failed"))},c,g?void 0:Sc(tf(d)),a.Ed,a.Be.get())})},vg=function(a){if(!hc.test(a.email))throw new O("invalid-email");},wg=function(a){"email"in a&&vg(a)},yg=function(a,b){return R(a,xg,{identifier:b,continueUri:of()?Xe():"http://localhost"}).then(function(a){return a.allProviders||[]})},Ag=function(a){return R(a,zg,{}).then(function(a){return a.authorizedDomains||[]})},Bg=function(a){if(!a.idToken)throw new O("internal-error");
3666
- };S.prototype.signInAnonymously=function(){return R(this,Cg,{})};S.prototype.updateEmail=function(a,b){return R(this,Dg,{idToken:a,email:b})};S.prototype.updatePassword=function(a,b){return R(this,eg,{idToken:a,password:b})};var Eg={displayName:"DISPLAY_NAME",photoUrl:"PHOTO_URL"};S.prototype.updateProfile=function(a,b){var c={idToken:a},d=[];Na(Eg,function(a,f){var e=b[f];null===e?d.push(a):f in b&&(c[f]=e)});d.length&&(c.deleteAttribute=d);return R(this,Dg,c)};
3667
- S.prototype.sendPasswordResetEmail=function(a){return R(this,Fg,{requestType:"PASSWORD_RESET",email:a})};S.prototype.sendEmailVerification=function(a){return R(this,Gg,{requestType:"VERIFY_EMAIL",idToken:a})};
3668
- var Ig=function(a,b,c){return R(a,Hg,{idToken:b,deleteProvider:c})},Jg=function(a){if(!a.requestUri||!a.sessionId&&!a.postBody)throw new O("internal-error");},Kg=function(a){var b=null;a.needConfirmation?(a.code="account-exists-with-different-credential",b=jg(a)):"FEDERATED_USER_ID_ALREADY_LINKED"==a.errorMessage?(a.code="credential-already-in-use",b=jg(a)):"EMAIL_EXISTS"==a.errorMessage&&(a.code="email-already-in-use",b=jg(a));if(b)throw b;if(!a.idToken)throw new O("internal-error");},Rf=function(a,
3669
- b){b.returnIdpCredential=!0;return R(a,Lg,b)},Tf=function(a,b){b.returnIdpCredential=!0;return R(a,Mg,b)},Ng=function(a){if(!a.oobCode)throw new O("invalid-action-code");};S.prototype.confirmPasswordReset=function(a,b){return R(this,Og,{oobCode:a,newPassword:b})};S.prototype.checkActionCode=function(a){return R(this,Pg,{oobCode:a})};S.prototype.applyActionCode=function(a){return R(this,Qg,{oobCode:a})};
3670
- var Qg={endpoint:"setAccountInfo",K:Ng,nb:"email"},Pg={endpoint:"resetPassword",K:Ng,va:function(a){if(!a.email||!a.requestType)throw new O("internal-error");}},Rg={endpoint:"signupNewUser",K:function(a){vg(a);if(!a.password)throw new O("weak-password");},va:Bg,wa:!0},xg={endpoint:"createAuthUri"},Sg={endpoint:"deleteAccount",mb:["idToken"]},Hg={endpoint:"setAccountInfo",mb:["idToken","deleteProvider"],K:function(a){if(!da(a.deleteProvider))throw new O("internal-error");}},Tg={endpoint:"getAccountInfo"},
3671
- Gg={endpoint:"getOobConfirmationCode",mb:["idToken","requestType"],K:function(a){if("VERIFY_EMAIL"!=a.requestType)throw new O("internal-error");},nb:"email"},Fg={endpoint:"getOobConfirmationCode",mb:["requestType"],K:function(a){if("PASSWORD_RESET"!=a.requestType)throw new O("internal-error");vg(a)},nb:"email"},zg={se:!0,endpoint:"getProjectConfig",Le:"GET"},Og={endpoint:"resetPassword",K:Ng,nb:"email"},Dg={endpoint:"setAccountInfo",mb:["idToken"],K:wg,wa:!0},eg={endpoint:"setAccountInfo",mb:["idToken"],
3672
- K:function(a){wg(a);if(!a.password)throw new O("weak-password");},va:Bg,wa:!0},Cg={endpoint:"signupNewUser",va:Bg,wa:!0},Lg={endpoint:"verifyAssertion",K:Jg,va:Kg,wa:!0},Mg={endpoint:"verifyAssertion",K:function(a){Jg(a);if(!a.idToken)throw new O("internal-error");},va:Kg,wa:!0},Ug={endpoint:"verifyCustomToken",K:function(a){if(!a.token)throw new O("invalid-custom-token");},va:Bg,wa:!0},dg={endpoint:"verifyPassword",K:function(a){vg(a);if(!a.password)throw new O("wrong-password");},va:Bg,wa:!0},R=
3673
- function(a,b,c){if(!Ff(c,b.mb))return F(new O("internal-error"));var d=b.Le||"POST",e;return E(c).then(b.K).then(function(){b.wa&&(c.returnSecureToken=!0);return ug(a,b.endpoint,d,c,b.se||!1)}).then(function(a){return e=a}).then(b.va).then(function(){if(!b.nb)return e;if(!(b.nb in e))throw new O("internal-error");return e[b.nb]})},sg=function(a){var b,c;c=(a.error&&a.error.errors&&a.error.errors[0]||{}).reason||"";var d={keyInvalid:"invalid-api-key",ipRefererBlocked:"app-not-authorized"};if(c=d[c]?
3674
- new O(d[c]):null)return c;c=a.error&&a.error.message||"";d={INVALID_CUSTOM_TOKEN:"invalid-custom-token",CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVALID_IDENTIFIER:"invalid-email",MISSING_CONTINUE_URI:"internal-error",INVALID_EMAIL:"invalid-email",INVALID_PASSWORD:"wrong-password",USER_DISABLED:"user-disabled",MISSING_PASSWORD:"internal-error",EMAIL_EXISTS:"email-already-in-use",PASSWORD_LOGIN_DISABLED:"operation-not-allowed",INVALID_IDP_RESPONSE:"invalid-credential",
3675
- FEDERATED_USER_ID_ALREADY_LINKED:"credential-already-in-use",INVALID_MESSAGE_PAYLOAD:"invalid-message-payload",INVALID_RECIPIENT_EMAIL:"invalid-recipient-email",INVALID_SENDER:"invalid-sender",EMAIL_NOT_FOUND:"user-not-found",EXPIRED_OOB_CODE:"expired-action-code",INVALID_OOB_CODE:"invalid-action-code",MISSING_OOB_CODE:"internal-error",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"requires-recent-login",INVALID_ID_TOKEN:"invalid-user-token",TOKEN_EXPIRED:"user-token-expired",USER_NOT_FOUND:"user-token-expired",
3676
- CORS_UNSUPPORTED:"cors-unsupported",DYNAMIC_LINK_NOT_ACTIVATED:"dynamic-link-not-activated",TOO_MANY_ATTEMPTS_TRY_LATER:"too-many-requests",WEAK_PASSWORD:"weak-password",OPERATION_NOT_ALLOWED:"operation-not-allowed",USER_CANCELLED:"user-cancelled"};b=(b=c.match(/^[^\s]+\s*:\s*(.*)$/))&&1<b.length?b[1]:void 0;for(var e in d)if(0===c.indexOf(e))return new O(d[e],b);!b&&a&&(b=sf(a));return new O("internal-error",b)};var Vg=function(a){this.U=a};Vg.prototype.value=function(){return this.U};Vg.prototype.ae=function(a){this.U.style=a;return this};var Wg=function(a){this.U=a||{}};Wg.prototype.value=function(){return this.U};Wg.prototype.ae=function(a){this.U.style=a;return this};var Yg=function(a){this.zf=a;this.gc=null;this.Zc=Xg(this)},Zg=function(a){var b=new Wg;b.U.where=document.body;b.U.url=a.zf;b.U.messageHandlersFilter=M("gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER");b.U.attributes=b.U.attributes||{};(new Vg(b.U.attributes)).ae({position:"absolute",top:"-100px",width:"1px",height:"1px"});b.U.dontclear=!0;return b},Xg=function(a){return $g().then(function(){return new D(function(b,c){M("gapi.iframes.getContext")().open(Zg(a).value(),function(d){a.gc=d;a.gc.restyle({setHideOnLeave:!1});
3677
- var e=setTimeout(function(){c(Error("Network Error"))},ah.get()),f=function(){clearTimeout(e);b()};d.ping(f).then(f,function(){c(Error("Network Error"))})})})})};Yg.prototype.sendMessage=function(a){var b=this;return this.Zc.then(function(){return new D(function(c){b.gc.send(a.type,a,c,M("gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER"))})})};
3678
- var bh=function(a,b){a.Zc.then(function(){a.gc.register("authEvent",b,M("gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER"))})},ch=new yf(3E4,6E4),ah=new yf(5E3,15E3),$g=function(){return new D(function(a,b){if(xf()){var c=function(){wf();M("gapi.load")("gapi.iframes",{callback:a,ontimeout:function(){wf();b(Error("Network Error"))},timeout:ch.get()})};if(M("gapi.iframes.Iframe"))a();else if(M("gapi.load"))c();else{var d="__iframefcb"+Math.floor(1E6*Math.random()).toString();l[d]=function(){M("gapi.load")?
3679
- c():b(Error("Network Error"))};E(Vd("https://apis.google.com/js/api.js?onload="+d)).f(function(){b(Error("Network Error"))})}}else b(Error("Network Error"))})};var dh=function(a,b,c){this.v=a;this.j=b;this.B=c;this.Qa=null;this.Sb=Re(this.v,"/__/auth/iframe");J(this.Sb,"apiKey",this.j);J(this.Sb,"appName",this.B)};dh.prototype.setVersion=function(a){this.Qa=a;return this};dh.prototype.toString=function(){this.Qa?J(this.Sb,"v",this.Qa):Pe(this.Sb,"v");return this.Sb.toString()};var eh=function(a,b,c,d,e){this.v=a;this.j=b;this.B=c;this.re=d;this.Qa=this.F=this.fd=null;this.Ib=e};eh.prototype.setVersion=function(a){this.Qa=a;return this};
3680
- eh.prototype.toString=function(){var a=Re(this.v,"/__/auth/handler");J(a,"apiKey",this.j);J(a,"appName",this.B);J(a,"authType",this.re);if(this.Ib.isOAuthProvider){J(a,"providerId",this.Ib.providerId);var b=this.Ib,c=tf(b.yd),d;for(d in c)c[d]=c[d].toString();b=b.hf;c=Sa(c);for(d=0;d<b.length;d++){var e=b[d];e in c&&delete c[e]}Qa(c)||J(a,"customParameters",sf(c))}"function"===typeof this.Ib.Gd&&(b=this.Ib.Gd(),b.length&&J(a,"scopes",b.join(",")));this.fd?J(a,"redirectUrl",this.fd):Pe(a,"redirectUrl");
3681
- this.F?J(a,"eventId",this.F):Pe(a,"eventId");this.Qa?J(a,"v",this.Qa):Pe(a,"v");if(this.Tb)for(var f in this.Tb)this.Tb.hasOwnProperty(f)&&!Oe(a,f)&&J(a,f,this.Tb[f]);return a.toString()};
3682
- var fh=function(a,b,c,d){this.v=a;this.j=b;this.B=c;this.De=(this.Aa=d||null)?nf(this.Aa):null;d=this.Aa;this.Me=(new dh(a,b,c)).setVersion(d).toString();this.ia=[];this.g=new S(b,null,this.De);this.jc=this.sa=null},hh=function(a){var b=Xe();return Ag(a).then(function(a){a:{for(var c=Qe(b),e=c.da,c=c.$,f=0;f<a.length;f++){var g;var k=a[f];g=c;var n=e;0==k.indexOf("chrome-extension://")?g=Qe(k).$==g&&"chrome-extension"==n:"http"!=n&&"https"!=n?g=!1:ff.test(k)?g=g==k:(k=k.split(".").join("\\."),g=(new RegExp("^(.+\\."+
3683
- k+"|"+k+")$","i")).test(g));if(g){a=!0;break a}}a=!1}if(!a)throw new Of(Xe());})};h=fh.prototype;h.zb=function(){if(this.jc)return this.jc;var a=this;return this.jc=gf().then(function(){a.fc=new Yg(a.Me);ih(a)})};h.Nb=function(a,b,c){var d=new O("popup-closed-by-user"),e=new O("web-storage-unsupported"),f=this,g=!1;return this.Ga().then(function(){jh(f).then(function(c){c||(a&&cf(a),b(e),g=!0)})}).f(function(){}).then(function(){if(!g)return ef(a)}).then(function(){if(!g)return ke(c).then(function(){b(d)})})};
3684
- h.be=function(){var a=K();return!rf(a)&&!vf(a)};h.Jd=function(){return!1};h.Gb=function(a,b,c,d,e,f,g){if(!a)return F(new O("popup-blocked"));if(g&&!rf())return this.Ga().f(function(b){cf(a);e(b)}),d(),E();this.sa||(this.sa=hh(this.g));var k=this;return this.sa.then(function(){var b=k.Ga().f(function(b){cf(a);e(b);throw b;});d();return b}).then(function(){hg(c);if(!g){var d=kh(k.v,k.j,k.B,b,c,null,f,k.Aa);Ye(d,a)}}).f(function(a){"auth/network-request-failed"==a.code&&(k.sa=null);throw a;})};
3685
- h.Hb=function(a,b,c){this.sa||(this.sa=hh(this.g));var d=this;return this.sa.then(function(){hg(b);var e=kh(d.v,d.j,d.B,a,b,Xe(),c,d.Aa);Ye(e)})};h.Ga=function(){var a=this;return this.zb().then(function(){return a.fc.Zc}).f(function(){a.sa=null;throw new O("network-request-failed");})};h.ee=function(){return!0};
3686
- var kh=function(a,b,c,d,e,f,g,k,n){a=new eh(a,b,c,d,e);a.fd=f;a.F=g;f=a.setVersion(k);f.Tb=Sa(n||null);return f.toString()},ih=function(a){if(!a.fc)throw Error("IfcHandler must be initialized!");bh(a.fc,function(b){var c={};if(b&&b.authEvent){var d=!1;b=Nf(b.authEvent);for(c=0;c<a.ia.length;c++)d=a.ia[c](b)||d;c={};c.status=d?"ACK":"ERROR";return E(c)}c.status="ERROR";return E(c)})},jh=function(a){var b={type:"webStorageSupport"};return a.zb().then(function(){return a.fc.sendMessage(b)}).then(function(a){if(a&&
3687
- a.length&&"undefined"!==typeof a[0].webStorageSupport)return a[0].webStorageSupport;throw Error();})};fh.prototype.Sa=function(a){this.ia.push(a)};fh.prototype.Lb=function(a){Ka(this.ia,function(b){return b==a})};var lh=function(a){this.A=a||firebase.INTERNAL.reactNative&&firebase.INTERNAL.reactNative.AsyncStorage;if(!this.A)throw new O("internal-error","The React Native compatibility library was not found.");};h=lh.prototype;h.get=function(a){return E(this.A.getItem(a)).then(function(a){return a&&uf(a)})};h.set=function(a,b){return E(this.A.setItem(a,sf(b)))};h.remove=function(a){return E(this.A.removeItem(a))};h.Ta=function(){};h.Na=function(){};var mh=function(){this.A={}};h=mh.prototype;h.get=function(a){return E(this.A[a])};h.set=function(a,b){this.A[a]=b;return E()};h.remove=function(a){delete this.A[a];return E()};h.Ta=function(){};h.Na=function(){};var oh=function(){if(!nh()){if("Node"==L())throw new O("internal-error","The LocalStorage compatibility library was not found.");throw new O("web-storage-unsupported");}this.A=l.localStorage||firebase.INTERNAL.node.localStorage},nh=function(){var a="Node"==L(),a=l.localStorage||a&&firebase.INTERNAL.node&&firebase.INTERNAL.node.localStorage;if(!a)return!1;try{return a.setItem("__sak","1"),a.removeItem("__sak"),!0}catch(b){return!1}};h=oh.prototype;
3688
- h.get=function(a){var b=this;return E().then(function(){var c=b.A.getItem(a);return uf(c)})};h.set=function(a,b){var c=this;return E().then(function(){var d=sf(b);null===d?c.remove(a):c.A.setItem(a,d)})};h.remove=function(a){var b=this;return E().then(function(){b.A.removeItem(a)})};h.Ta=function(a){l.window&&Ub(l.window,"storage",a)};h.Na=function(a){l.window&&cc(l.window,"storage",a)};var ph=function(){this.A={}};h=ph.prototype;h.get=function(){return E(null)};h.set=function(){return E()};h.remove=function(){return E()};h.Ta=function(){};h.Na=function(){};var rh=function(){if(!qh()){if("Node"==L())throw new O("internal-error","The SessionStorage compatibility library was not found.");throw new O("web-storage-unsupported");}this.A=l.sessionStorage||firebase.INTERNAL.node.sessionStorage},qh=function(){var a="Node"==L(),a=l.sessionStorage||a&&firebase.INTERNAL.node&&firebase.INTERNAL.node.sessionStorage;if(!a)return!1;try{return a.setItem("__sak","1"),a.removeItem("__sak"),!0}catch(b){return!1}};h=rh.prototype;
3689
- h.get=function(a){var b=this;return E().then(function(){var c=b.A.getItem(a);return uf(c)})};h.set=function(a,b){var c=this;return E().then(function(){var d=sf(b);null===d?c.remove(a):c.A.setItem(a,d)})};h.remove=function(a){var b=this;return E().then(function(){b.A.removeItem(a)})};h.Ta=function(){};h.Na=function(){};var sh=function(a,b,c,d,e,f){if(!window.indexedDB)throw new O("web-storage-unsupported");this.ve=a;this.Yc=b;this.Kc=c;this.ie=d;this.sb=e;this.Y={};this.Ob=[];this.Cb=0;this.Ne=f||l.indexedDB},th,uh=function(a){return new D(function(b,c){var d=a.Ne.open(a.ve,a.sb);d.onerror=function(a){c(Error(a.target.errorCode))};d.onupgradeneeded=function(b){b=b.target.result;try{b.createObjectStore(a.Yc,{keyPath:a.Kc})}catch(f){c(f)}};d.onsuccess=function(a){b(a.target.result)}})},vh=function(a){a.Md||(a.Md=
3690
- uh(a));return a.Md},wh=function(a,b){return b.objectStore(a.Yc)},xh=function(a,b,c){return b.transaction([a.Yc],c?"readwrite":"readonly")},yh=function(a){return new D(function(b,c){a.onsuccess=function(a){a&&a.target?b(a.target.result):b()};a.onerror=function(a){c(Error(a.target.errorCode))}})};h=sh.prototype;
3691
- h.set=function(a,b){var c=!1,d,e=this;return Ed(vh(this).then(function(b){d=b;b=wh(e,xh(e,d,!0));return yh(b.get(a))}).then(function(f){var g=wh(e,xh(e,d,!0));if(f)return f.value=b,yh(g.put(f));e.Cb++;c=!0;f={};f[e.Kc]=a;f[e.ie]=b;return yh(g.add(f))}).then(function(){e.Y[a]=b}),function(){c&&e.Cb--})};h.get=function(a){var b=this;return vh(this).then(function(c){return yh(wh(b,xh(b,c,!1)).get(a))}).then(function(a){return a&&a.value})};
3692
- h.remove=function(a){var b=!1,c=this;return Ed(vh(this).then(function(d){b=!0;c.Cb++;return yh(wh(c,xh(c,d,!0))["delete"](a))}).then(function(){delete c.Y[a]}),function(){b&&c.Cb--})};
3693
- h.vf=function(){var a=this;return vh(this).then(function(b){var c=wh(a,xh(a,b,!1));return c.getAll?yh(c.getAll()):new D(function(a,b){var d=[],e=c.openCursor();e.onsuccess=function(b){(b=b.target.result)?(d.push(b.value),b["continue"]()):a(d)};e.onerror=function(a){b(Error(a.target.errorCode))}})}).then(function(b){var c={},d=[];if(0==a.Cb){for(d=0;d<b.length;d++)c[b[d][a.Kc]]=b[d][a.ie];d=Ze(a.Y,c);a.Y=c}return d})};h.Ta=function(a){0==this.Ob.length&&this.nd();this.Ob.push(a)};
3694
- h.Na=function(a){Ka(this.Ob,function(b){return b==a});0==this.Ob.length&&this.wc()};h.nd=function(){var a=this;this.wc();var b=function(){a.bd=ke(800).then(r(a.vf,a)).then(function(b){0<b.length&&x(a.Ob,function(a){a(b)})}).then(b).f(function(a){"STOP_EVENT"!=a.message&&b()});return a.bd};b()};h.wc=function(){this.bd&&this.bd.cancel("STOP_EVENT")};var Ch=function(){this.Bd={Browser:zh,Node:Ah,ReactNative:Bh}[L()]},Dh,zh={I:oh,qd:rh},Ah={I:oh,qd:rh},Bh={I:lh,qd:ph};var Eh=function(a){var b={},c=a.email,d=a.newEmail;a=a.requestType;if(!c||!a)throw Error("Invalid provider user info!");b.fromEmail=d||null;b.email=c;N(this,"operation",a);N(this,"data",Gf(b))};var Fh="First Second Third Fourth Fifth Sixth Seventh Eighth Ninth".split(" "),T=function(a,b){return{name:a||"",fa:"a valid string",optional:!!b,ha:p}},Gh=function(a){return{name:a||"",fa:"a valid object",optional:!1,ha:ga}},Hh=function(a,b){return{name:a||"",fa:"a function",optional:!!b,ha:q}},Ih=function(){return{name:"",fa:"null",optional:!1,ha:ca}},Jh=function(){return{name:"credential",fa:"a valid credential",optional:!1,ha:function(a){return!(!a||!a.$b)}}},Kh=function(){return{name:"authProvider",
3695
- fa:"a valid Auth provider",optional:!1,ha:function(a){return!!(a&&a.providerId&&a.hasOwnProperty&&a.hasOwnProperty("isOAuthProvider"))}}},Lh=function(a,b,c,d){return{name:c||"",fa:a.fa+" or "+b.fa,optional:!!d,ha:function(c){return a.ha(c)||b.ha(c)}}};var Mh=function(a,b,c,d,e,f){this.bf=a;this.kf=b;this.Fe=c;this.lc=d;this.rd=e;this.lf=!!f;this.cb=null;this.Ha=this.lc;if(this.rd<this.lc)throw Error("Proactive refresh lower bound greater than upper bound!");};Mh.prototype.start=function(){this.Ha=this.lc;Nh(this,!0)};
3696
- var Oh=function(a,b){if(b)return a.Ha=a.lc,a.Fe();b=a.Ha;a.Ha*=2;a.Ha>a.rd&&(a.Ha=a.rd);return b},Nh=function(a,b){a.stop();a.cb=ke(Oh(a,b)).then(function(){return a.lf?E():Af()}).then(function(){return a.bf()}).then(function(){Nh(a,!0)}).f(function(b){a.kf(b)&&Nh(a,!1)})};Mh.prototype.stop=function(){this.cb&&(this.cb.cancel(),this.cb=null)};var U=function(a,b){for(var c in b){var d=b[c].name;a[d]=Ph(d,a[c],b[c].a)}},V=function(a,b,c,d){a[b]=Ph(b,c,d)},Ph=function(a,b,c){if(!c)return b;var d=Qh(a);a=function(){var a=Array.prototype.slice.call(arguments),e;a:{e=Array.prototype.slice.call(a);var k;k=0;for(var n=!1,A=0;A<c.length;A++)if(c[A].optional)n=!0;else{if(n)throw new O("internal-error","Argument validator encountered a required argument after an optional argument.");k++}n=c.length;if(e.length<k||n<e.length)e="Expected "+(k==n?1==
3697
- k?"1 argument":k+" arguments":k+"-"+n+" arguments")+" but got "+e.length+".";else{for(k=0;k<e.length;k++)if(n=c[k].optional&&void 0===e[k],!c[k].ha(e[k])&&!n){e=c[k];if(0>k||k>=Fh.length)throw new O("internal-error","Argument validator received an unsupported number of arguments.");e=Fh[k]+" argument "+(e.name?'"'+e.name+'" ':"")+"must be "+e.fa+".";break a}e=null}}if(e)throw new O("argument-error",d+" failed: "+e);return b.apply(this,a)};for(var e in b)a[e]=b[e];for(e in b.prototype)a.prototype[e]=
3698
- b.prototype[e];return a},Qh=function(a){a=a.split(".");return a[a.length-1]};var Rh=function(a,b,c,d){this.Ye=a;this.Zd=b;this.mf=c;this.Mb=d;this.S={};Dh||(Dh=new Ch);a=Dh;try{var e;We()?(th||(th=new sh("firebaseLocalStorageDb","firebaseLocalStorage","fbase_key","value",1)),e=th):e=new a.Bd.I;this.La=e}catch(f){this.La=new mh,this.Mb=!0}try{this.yc=new a.Bd.qd}catch(f){this.yc=new mh}this.od=r(this.ce,this);this.Y={}},Sh,Th=function(){Sh||(Sh=new Rh("firebase",":",!vf(K())&&lf()?!0:!1,rf()));return Sh};h=Rh.prototype;
3699
- h.P=function(a,b){return this.Ye+this.Zd+a.name+(b?this.Zd+b:"")};h.get=function(a,b){return(a.I?this.La:this.yc).get(this.P(a,b))};h.remove=function(a,b){b=this.P(a,b);a.I&&!this.Mb&&(this.Y[b]=null);return(a.I?this.La:this.yc).remove(b)};h.set=function(a,b,c){var d=this.P(a,c),e=this,f=a.I?this.La:this.yc;return f.set(d,b).then(function(){return f.get(d)}).then(function(b){a.I&&!this.Mb&&(e.Y[d]=b)})};
3700
- h.addListener=function(a,b,c){a=this.P(a,b);this.Mb||(this.Y[a]=l.localStorage.getItem(a));Qa(this.S)&&this.nd();this.S[a]||(this.S[a]=[]);this.S[a].push(c)};h.removeListener=function(a,b,c){a=this.P(a,b);this.S[a]&&(Ka(this.S[a],function(a){return a==c}),0==this.S[a].length&&delete this.S[a]);Qa(this.S)&&this.wc()};h.nd=function(){this.La.Ta(this.od);this.Mb||We()||Uh(this)};
3701
- var Uh=function(a){Vh(a);a.Xc=setInterval(function(){for(var b in a.S){var c=l.localStorage.getItem(b),d=a.Y[b];c!=d&&(a.Y[b]=c,c=new Jb({type:"storage",key:b,target:window,oldValue:d,newValue:c,df:!0}),a.ce(c))}},1E3)},Vh=function(a){a.Xc&&(clearInterval(a.Xc),a.Xc=null)};Rh.prototype.wc=function(){this.La.Na(this.od);Vh(this)};
3702
- Rh.prototype.ce=function(a){if(a&&a.Ee){var b=a.Xa.key;"undefined"!==typeof a.Xa.df?this.La.Na(this.od):Vh(this);if(this.mf){var c=l.localStorage.getItem(b);a=a.Xa.newValue;a!=c&&(a?l.localStorage.setItem(b,a):a||l.localStorage.removeItem(b))}this.Y[b]=l.localStorage.getItem(b);this.ud(b)}else x(a,r(this.ud,this))};Rh.prototype.ud=function(a){this.S[a]&&x(this.S[a],function(a){a()})};var Wh=function(a,b){this.u=a;this.i=b||Th()},Xh={name:"authEvent",I:!0},Yh=function(a){return a.i.get(Xh,a.u).then(function(a){return Nf(a)})};Wh.prototype.Sa=function(a){this.i.addListener(Xh,this.u,a)};Wh.prototype.Lb=function(a){this.i.removeListener(Xh,this.u,a)};var Zh=function(a){this.i=a||Th()},$h={name:"sessionId",I:!1};Zh.prototype.ac=function(a){return this.i.get($h,a)};var ai=function(a,b,c,d,e,f){this.v=a;this.j=b;this.B=c;this.Aa=d||null;this.de=b+":"+c;this.nf=new Zh;this.Fd=new Wh(this.de);this.Tc=null;this.ia=[];this.Qe=e||500;this.ff=f||2E3;this.yb=this.oc=null},bi=function(a){return new O("invalid-cordova-configuration",a)};
3703
- ai.prototype.Ga=function(){return this.Vc?this.Vc:this.Vc=jf().then(function(){if("function"!==typeof M("universalLinks.subscribe",l))throw bi("cordova-universal-links-plugin is not installed");if("undefined"===typeof M("BuildInfo.packageName",l))throw bi("cordova-plugin-buildinfo is not installed");if("function"!==typeof M("cordova.plugins.browsertab.openUrl",l))throw bi("cordova-plugin-browsertab is not installed");if("function"!==typeof M("cordova.InAppBrowser.open",l))throw bi("cordova-plugin-inappbrowser is not installed");
3704
- },function(){throw new O("cordova-not-ready");})};var ci=function(){for(var a=20,b=[];0<a;)b.push("1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".charAt(Math.floor(62*Math.random()))),a--;return b.join("")},di=function(a){var b=new Db;b.update(a);return ob(b.digest())};h=ai.prototype;h.Nb=function(a,b){b(new O("operation-not-supported-in-this-environment"));return E()};h.Gb=function(){return F(new O("operation-not-supported-in-this-environment"))};h.ee=function(){return!1};h.be=function(){return!0};
3705
- h.Jd=function(){return!0};
3706
- h.Hb=function(a,b,c){if(this.oc)return F(new O("redirect-operation-pending"));var d=this,e=l.document,f=null,g=null,k=null,n=null;return this.oc=Ed(E().then(function(){hg(b);return ei(d)}).then(function(){return fi(d,a,b,c)}).then(function(){return(new D(function(a,b){g=function(){var b=M("cordova.plugins.browsertab.close",l);a();"function"===typeof b&&b();d.yb&&"function"===typeof d.yb.close&&(d.yb.close(),d.yb=null);return!1};d.Sa(g);k=function(){f||(f=ke(d.ff).then(function(){b(new O("redirect-cancelled-by-user"))}))};n=
3707
- function(){zf()&&k()};e.addEventListener("resume",k,!1);K().toLowerCase().match(/android/)||e.addEventListener("visibilitychange",n,!1)})).f(function(a){return gi(d).then(function(){throw a;})})}),function(){k&&e.removeEventListener("resume",k,!1);n&&e.removeEventListener("visibilitychange",n,!1);f&&f.cancel();g&&d.Lb(g);d.oc=null})};
3708
- var fi=function(a,b,c,d){var e=ci(),f=new P(b,d,null,e,new O("no-auth-event")),g=M("BuildInfo.packageName",l);if("string"!==typeof g)throw new O("invalid-cordova-configuration");var k=M("BuildInfo.displayName",l),n={};if(K().toLowerCase().match(/iphone|ipad|ipod/))n.ibi=g;else if(K().toLowerCase().match(/android/))n.apn=g;else return F(new O("operation-not-supported-in-this-environment"));k&&(n.appDisplayName=k);e=di(e);n.sessionId=e;var A=kh(a.v,a.j,a.B,b,c,null,d,a.Aa,n);return a.Ga().then(function(){var b=
3709
- a.de;return a.nf.i.set(Xh,f.C(),b)}).then(function(){var b=M("cordova.plugins.browsertab.isAvailable",l);if("function"!==typeof b)throw new O("invalid-cordova-configuration");var c=null;b(function(b){if(b){c=M("cordova.plugins.browsertab.openUrl",l);if("function"!==typeof c)throw new O("invalid-cordova-configuration");c(A)}else{c=M("cordova.InAppBrowser.open",l);if("function"!==typeof c)throw new O("invalid-cordova-configuration");b=c;var d;d=K();d=!(!d.match(/(iPad|iPhone|iPod).*OS 7_\d/i)&&!d.match(/(iPad|iPhone|iPod).*OS 8_\d/i));
3710
- a.yb=b(A,d?"_blank":"_system","location=yes")}})})},hi=function(a,b){for(var c=0;c<a.ia.length;c++)try{a.ia[c](b)}catch(d){}},ei=function(a){a.Tc||(a.Tc=a.Ga().then(function(){return new D(function(b){var c=function(d){b(d);a.Lb(c);return!1};a.Sa(c);ii(a)})}));return a.Tc},gi=function(a){var b=null;return Yh(a.Fd).then(function(c){b=c;c=a.Fd;return c.i.remove(Xh,c.u)}).then(function(){return b})},ii=function(a){var b=M("universalLinks.subscribe",l);if("function"!==typeof b)throw new O("invalid-cordova-configuration");
3711
- var c=new P("unknown",null,null,null,new O("no-auth-event")),d=!1,e=ke(a.Qe).then(function(){return gi(a).then(function(){d||hi(a,c)})}),f=function(b){d=!0;e&&e.cancel();gi(a).then(function(d){var e=c;if(d&&b&&b.url){var e=null,f;f=b.url;var g=Qe(f),k=Oe(g,"link"),n=Oe(Qe(k),"link"),g=Oe(g,"deep_link_id");f=Oe(Qe(g),"link")||g||n||k||f;-1!=f.indexOf("/__/auth/callback")&&(e=Qe(f),e=uf(Oe(e,"firebaseError")||null),e=(e="object"===typeof e?Mf(e):null)?new P(d.ga,d.F,null,null,e):new P(d.ga,d.F,f,d.ac()));
3712
- e=e||c}hi(a,e)})},g=l.handleOpenURL;l.handleOpenURL=function(a){0==a.indexOf(M("BuildInfo.packageName",l)+"://")&&f({url:a});if("function"===typeof g)try{g(a)}catch(n){console.error(n)}};b(null,f)};ai.prototype.Sa=function(a){this.ia.push(a);ei(this).f(function(){})};ai.prototype.Lb=function(a){Ka(this.ia,function(b){return b==a})};var ji=function(a){this.u=a;this.i=Th()},ki={name:"pendingRedirect",I:!1},li=function(a){return a.i.set(ki,"pending",a.u)},mi=function(a){return a.i.remove(ki,a.u)},ni=function(a){return a.i.get(ki,a.u).then(function(a){return"pending"==a})};var W=function(a,b,c){this.v=a;this.j=b;this.B=c;this.Pb=[];this.ab=!1;this.Gc=r(this.Qc,this);this.hb=new oi(this);this.Td=new pi(this);this.Db=new ji(this.j+":"+this.B);this.pb={};this.pb.unknown=this.hb;this.pb.signInViaRedirect=this.hb;this.pb.linkViaRedirect=this.hb;this.pb.signInViaPopup=this.Td;this.pb.linkViaPopup=this.Td;this.G=qi(this.v,this.j,this.B)},qi=function(a,b,c){var d=firebase.SDK_VERSION||null;return hf()?new ai(a,b,c,d):new fh(a,b,c,d)};
3713
- W.prototype.reset=function(){this.ab=!1;this.G.Lb(this.Gc);this.G=qi(this.v,this.j,this.B)};W.prototype.zb=function(){var a=this;this.ab||(this.ab=!0,this.G.Sa(this.Gc));var b=this.G;return this.G.Ga().f(function(c){a.G==b&&a.reset();throw c;})};var ti=function(a){a.G.be()&&a.zb().f(function(b){var c=new P("unknown",null,null,null,new O("operation-not-supported-in-this-environment"));ri(b)&&a.Qc(c)});a.G.Jd()||si(a.hb)};
3714
- W.prototype.subscribe=function(a){Ha(this.Pb,a)||this.Pb.push(a);if(!this.ab){var b=this;ni(this.Db).then(function(a){a?mi(b.Db).then(function(){b.zb().f(function(a){var c=new P("unknown",null,null,null,new O("operation-not-supported-in-this-environment"));ri(a)&&b.Qc(c)})}):ti(b)}).f(function(){ti(b)})}};W.prototype.unsubscribe=function(a){Ka(this.Pb,function(b){return b==a})};
3715
- W.prototype.Qc=function(a){if(!a)throw new O("invalid-auth-event");for(var b=!1,c=0;c<this.Pb.length;c++){var d=this.Pb[c];if(d.vd(a.ga,a.F)){(b=this.pb[a.ga])&&b.Ud(a,d);b=!0;break}}si(this.hb);return b};var ui=new yf(2E3,1E4),vi=new yf(3E4,6E4);W.prototype.getRedirectResult=function(){return this.hb.getRedirectResult()};W.prototype.Gb=function(a,b,c,d,e){var f=this;return this.G.Gb(a,b,c,function(){f.ab||(f.ab=!0,f.G.Sa(f.Gc))},function(){f.reset()},d,e)};
3716
- var ri=function(a){return a&&"auth/cordova-not-ready"==a.code?!0:!1};W.prototype.Hb=function(a,b,c){var d=this,e;return li(this.Db).then(function(){return d.G.Hb(a,b,c).f(function(a){if(ri(a))throw new O("operation-not-supported-in-this-environment");e=a;return mi(d.Db).then(function(){throw e;})}).then(function(){return d.G.ee()?new D(function(){}):mi(d.Db).then(function(){return d.getRedirectResult()}).then(function(){}).f(function(){})})})};
3717
- W.prototype.Nb=function(a,b,c,d){return this.G.Nb(c,function(c){a.Oa(b,null,c,d)},ui.get())};var wi={},xi=function(a,b,c){var d=b+":"+c;wi[d]||(wi[d]=new W(a,b,c));return wi[d]},oi=function(a){this.i=a;this.kb=null;this.Kb=[];this.Jb=[];this.ib=null;this.ed=!1};oi.prototype.reset=function(){this.kb=null;this.ib&&(this.ib.cancel(),this.ib=null)};
3718
- oi.prototype.Ud=function(a,b){if(!a)return F(new O("invalid-auth-event"));this.reset();this.ed=!0;var c=a.ga,d=a.F,e=a.getError()&&"auth/web-storage-unsupported"==a.getError().code,f=a.getError()&&"auth/operation-not-supported-in-this-environment"==a.getError().code;"unknown"!=c||e||f?a=a.O?this.cd(a,b):b.vb(c,d)?this.dd(a,b):F(new O("invalid-auth-event")):(yi(this,!1,null,null),a=E());return a};var si=function(a){a.ed||(a.ed=!0,yi(a,!1,null,null))};
3719
- oi.prototype.cd=function(a){yi(this,!0,null,a.getError());return E()};oi.prototype.dd=function(a,b){var c=this,d=a.ga;b=b.vb(d,a.F);var e=a.qb;a=a.ac();var f="signInViaRedirect"==d||"linkViaRedirect"==d;return b(e,a).then(function(a){yi(c,f,a,null)}).f(function(a){yi(c,f,null,a)})};
3720
- var zi=function(a,b){a.kb=function(){return F(b)};if(a.Jb.length)for(var c=0;c<a.Jb.length;c++)a.Jb[c](b)},Ai=function(a,b){a.kb=function(){return E(b)};if(a.Kb.length)for(var c=0;c<a.Kb.length;c++)a.Kb[c](b)},yi=function(a,b,c,d){b?d?zi(a,d):Ai(a,c):Ai(a,{user:null});a.Kb=[];a.Jb=[]};oi.prototype.getRedirectResult=function(){var a=this;return new D(function(b,c){a.kb?a.kb().then(b,c):(a.Kb.push(b),a.Jb.push(c),Bi(a))})};
3721
- var Bi=function(a){var b=new O("timeout");a.ib&&a.ib.cancel();a.ib=ke(vi.get()).then(function(){a.kb||yi(a,!0,null,b)})},pi=function(a){this.i=a};pi.prototype.Ud=function(a,b){if(!a)return F(new O("invalid-auth-event"));var c=a.ga,d=a.F;return a.O?this.cd(a,b):b.vb(c,d)?this.dd(a,b):F(new O("invalid-auth-event"))};pi.prototype.cd=function(a,b){b.Oa(a.ga,null,a.getError(),a.F);return E()};
3722
- pi.prototype.dd=function(a,b){var c=a.F,d=a.ga,e=b.vb(d,c),f=a.qb;a=a.ac();return e(f,a).then(function(a){b.Oa(d,a,null,c)}).f(function(a){b.Oa(d,null,a,c)})};var Ci=function(a){this.g=a;this.xa=this.W=null;this.Ca=0};Ci.prototype.C=function(){return{apiKey:this.g.j,refreshToken:this.W,accessToken:this.xa,expirationTime:this.Ca}};
3723
- var Ei=function(a,b){var c=b.idToken,d=b.refreshToken;b=Di(b.expiresIn);a.xa=c;a.Ca=b;a.W=d},Di=function(a){return ka()+1E3*parseInt(a,10)},Fi=function(a,b){return tg(a.g,b).then(function(b){a.xa=b.access_token;a.Ca=Di(b.expires_in);a.W=b.refresh_token;return{accessToken:a.xa,expirationTime:a.Ca,refreshToken:a.W}}).f(function(b){"auth/user-token-expired"==b.code&&(a.W=null);throw b;})};
3724
- Ci.prototype.getToken=function(a){a=!!a;return this.xa&&!this.W?F(new O("user-token-expired")):a||!this.xa||ka()>this.Ca-3E4?this.W?Fi(this,{grant_type:"refresh_token",refresh_token:this.W}):E(null):E({accessToken:this.xa,expirationTime:this.Ca,refreshToken:this.W})};var Gi=function(a,b,c,d,e){Df(this,{uid:a,displayName:d||null,photoURL:e||null,email:c||null,providerId:b})},Hi=function(a,b){Ib.call(this,a);for(var c in b)this[c]=b[c]};t(Hi,Ib);
3725
- var X=function(a,b,c){this.Z=[];this.j=a.apiKey;this.B=a.appName;this.v=a.authDomain||null;a=firebase.SDK_VERSION?nf(firebase.SDK_VERSION):null;this.g=new S(this.j,null,a);this.ea=new Ci(this.g);Ii(this,b.idToken);Ei(this.ea,b);N(this,"refreshToken",this.ea.W);Ji(this,c||{});ge.call(this);this.pc=!1;this.v&&qf()&&(this.m=xi(this.v,this.j,this.B));this.vc=[];this.oa=null;this.fb=Ki(this);this.rb=r(this.Rc,this)};t(X,ge);X.prototype.Rc=function(){this.fb.cb&&(this.fb.stop(),this.fb.start())};
3726
- var Ki=function(a){return new Mh(function(){return a.getToken(!0)},function(a){return a&&"auth/network-request-failed"==a.code?!0:!1},function(){var b=a.ea.Ca-ka()-3E5;return 0<b?b:0},3E4,96E4,!1)},Li=function(a){a.Ad||a.fb.cb||(a.fb.start(),cc(a,"tokenChanged",a.rb),Ub(a,"tokenChanged",a.rb))},Mi=function(a){cc(a,"tokenChanged",a.rb);a.fb.stop()},Ii=function(a,b){a.Nd=b;N(a,"_lat",b)},Ni=function(a,b){Ka(a.vc,function(a){return a==b})},Oi=function(a){for(var b=[],c=0;c<a.vc.length;c++)b.push(a.vc[c](a));
3727
- return Bd(b).then(function(){return a})},Pi=function(a){a.m&&!a.pc&&(a.pc=!0,a.m.subscribe(a))},Ji=function(a,b){Df(a,{uid:b.uid,displayName:b.displayName||null,photoURL:b.photoURL||null,email:b.email||null,emailVerified:b.emailVerified||!1,isAnonymous:b.isAnonymous||!1,providerData:[]})};N(X.prototype,"providerId","firebase");
3728
- var Qi=function(){},Ri=function(a){return E().then(function(){if(a.Ad)throw new O("app-deleted");})},Si=function(a){return Da(a.providerData,function(a){return a.providerId})},Ui=function(a,b){b&&(Ti(a,b.providerId),a.providerData.push(b))},Ti=function(a,b){Ka(a.providerData,function(a){return a.providerId==b})},Vi=function(a,b,c){("uid"!=b||c)&&a.hasOwnProperty(b)&&N(a,b,c)};
3729
- X.prototype.copy=function(a){var b=this;b!=a&&(Df(this,{uid:a.uid,displayName:a.displayName,photoURL:a.photoURL,email:a.email,emailVerified:a.emailVerified,isAnonymous:a.isAnonymous,providerData:[]}),x(a.providerData,function(a){Ui(b,a)}),this.ea=a.ea,N(this,"refreshToken",this.ea.W))};X.prototype.reload=function(){var a=this;return this.c(Ri(this).then(function(){return Wi(a).then(function(){return Oi(a)}).then(Qi)}))};
3730
- var Wi=function(a){return a.getToken().then(function(b){var c=a.isAnonymous;return Xi(a,b).then(function(){c||Vi(a,"isAnonymous",!1);return b})})};X.prototype.getToken=function(a){var b=this;return this.c(Ri(this).then(function(){return b.ea.getToken(a)}).then(function(a){if(!a)throw new O("internal-error");a.accessToken!=b.Nd&&(Ii(b,a.accessToken),b.Ia());Vi(b,"refreshToken",a.refreshToken);return a.accessToken}))};
3731
- var Yi=function(a,b){b.idToken&&a.Nd!=b.idToken&&(Ei(a.ea,b),a.Ia(),Ii(a,b.idToken),Vi(a,"refreshToken",a.ea.W))};X.prototype.Ia=function(){this.dispatchEvent(new Hi("tokenChanged"))};var Xi=function(a,b){return R(a.g,Tg,{idToken:b}).then(r(a.cf,a))};
3732
- X.prototype.cf=function(a){a=a.users;if(!a||!a.length)throw new O("internal-error");a=a[0];Ji(this,{uid:a.localId,displayName:a.displayName,photoURL:a.photoUrl,email:a.email,emailVerified:!!a.emailVerified});for(var b=Zi(a),c=0;c<b.length;c++)Ui(this,b[c]);Vi(this,"isAnonymous",!(this.email&&a.passwordHash)&&!(this.providerData&&this.providerData.length))};
3733
- var Zi=function(a){return(a=a.providerUserInfo)&&a.length?Da(a,function(a){return new Gi(a.rawId,a.providerId,a.email,a.displayName,a.photoUrl)}):[]};
3734
- X.prototype.reauthenticate=function(a){var b=this;return this.c(a.$b(this.g).then(function(a){var c;a:{var e=a.idToken.split(".");if(3==e.length){for(var e=e[1],f=(4-e.length%4)%4,g=0;g<f;g++)e+=".";try{var k=JSON.parse(sb(e));if(k.sub&&k.iss&&k.aud&&k.exp){c=new Pf(k);break a}}catch(n){}}c=null}if(!c||b.uid!=c.Ue)throw new O("user-mismatch");Yi(b,a);b.oa=null;return b.reload()}),!0)};
3735
- var $i=function(a,b){return Wi(a).then(function(){if(Ha(Si(a),b))return Oi(a).then(function(){throw new O("provider-already-linked");})})};h=X.prototype;h.link=function(a){var b=this;return this.c($i(this,a.provider).then(function(){return b.getToken()}).then(function(c){return a.Pd(b.g,c)}).then(r(this.Dd,this)))};h.Dd=function(a){Yi(this,a);var b=this;return this.reload().then(function(){return b})};
3736
- h.updateEmail=function(a){var b=this;return this.c(this.getToken().then(function(c){return b.g.updateEmail(c,a)}).then(function(a){Yi(b,a);return b.reload()}))};h.updatePassword=function(a){var b=this;return this.c(this.getToken().then(function(c){return b.g.updatePassword(c,a)}).then(function(a){Yi(b,a);return b.reload()}))};
3737
- h.updateProfile=function(a){if(void 0===a.displayName&&void 0===a.photoURL)return Ri(this);var b=this;return this.c(this.getToken().then(function(c){return b.g.updateProfile(c,{displayName:a.displayName,photoUrl:a.photoURL})}).then(function(a){Yi(b,a);Vi(b,"displayName",a.displayName||null);Vi(b,"photoURL",a.photoUrl||null);return Oi(b)}).then(Qi))};
3738
- h.unlink=function(a){var b=this;return this.c(Wi(this).then(function(c){return Ha(Si(b),a)?Ig(b.g,c,[a]).then(function(a){var c={};x(a.providerUserInfo||[],function(a){c[a.providerId]=!0});x(Si(b),function(a){c[a]||Ti(b,a)});return Oi(b)}):Oi(b).then(function(){throw new O("no-such-provider");})}))};
3739
- h["delete"]=function(){var a=this;return this.c(this.getToken().then(function(b){return R(a.g,Sg,{idToken:b})}).then(function(){a.dispatchEvent(new Hi("userDeleted"))})).then(function(){for(var b=0;b<a.Z.length;b++)a.Z[b].cancel("app-deleted");a.Z=[];a.Ad=!0;Mi(a);N(a,"refreshToken",null);a.m&&a.m.unsubscribe(a)})};h.vd=function(a,b){return"linkViaPopup"==a&&(this.la||null)==b&&this.ca||"linkViaRedirect"==a&&(this.sc||null)==b?!0:!1};
3740
- h.Oa=function(a,b,c,d){"linkViaPopup"==a&&d==(this.la||null)&&(c&&this.Ka?this.Ka(c):b&&!c&&this.ca&&this.ca(b),this.J&&(this.J.cancel(),this.J=null),delete this.ca,delete this.Ka)};h.vb=function(a,b){return"linkViaPopup"==a&&b==(this.la||null)||"linkViaRedirect"==a&&(this.sc||null)==b?r(this.ye,this):null};h.Zb=function(){return pf(this.uid+":::")};
3741
- h.linkWithPopup=function(a){if(!qf())return F(new O("operation-not-supported-in-this-environment"));if(this.oa)return F(this.oa);var b=this,c=Kf(a.providerId),d=this.Zb(),e=null;(!rf()||lf())&&this.v&&a.isOAuthProvider&&(e=kh(this.v,this.j,this.B,"linkViaPopup",a,null,d,firebase.SDK_VERSION||null));var f=df(e,c&&c.Fb,c&&c.Eb),c=$i(this,a.providerId).then(function(){return Oi(b)}).then(function(){aj(b);return b.getToken()}).then(function(){return b.m.Gb(f,"linkViaPopup",a,d,!!e)}).then(function(){return new D(function(a,
3742
- c){b.Oa("linkViaPopup",null,new O("cancelled-popup-request"),b.la||null);b.ca=a;b.Ka=c;b.la=d;b.J=b.m.Nb(b,"linkViaPopup",f,d)})}).then(function(a){f&&cf(f);return a}).f(function(a){f&&cf(f);throw a;});return this.c(c)};
3743
- h.linkWithRedirect=function(a){if(!qf())return F(new O("operation-not-supported-in-this-environment"));if(this.oa)return F(this.oa);var b=this,c=null,d=this.Zb(),e=$i(this,a.providerId).then(function(){aj(b);return b.getToken()}).then(function(){b.sc=d;return Oi(b)}).then(function(a){b.Ma&&(a=b.Ma,a=a.i.set(bj,b.C(),a.u));return a}).then(function(){return b.m.Hb("linkViaRedirect",a,d)}).f(function(a){c=a;if(b.Ma)return cj(b.Ma);throw c;}).then(function(){if(c)throw c;});return this.c(e)};
3744
- var aj=function(a){if(!a.m||!a.pc){if(a.m&&!a.pc)throw new O("internal-error");throw new O("auth-domain-config-required");}};X.prototype.ye=function(a,b){var c=this;this.J&&(this.J.cancel(),this.J=null);var d=null,e=this.getToken().then(function(d){return Tf(c.g,{requestUri:a,sessionId:b,idToken:d})}).then(function(a){d=gg(a);return c.Dd(a)}).then(function(a){return{user:a,credential:d}});return this.c(e)};
3745
- X.prototype.sendEmailVerification=function(){var a=this;return this.c(this.getToken().then(function(b){return a.g.sendEmailVerification(b)}).then(function(b){if(a.email!=b)return a.reload()}).then(function(){}))};X.prototype.c=function(a,b){var c=this,d=dj(this,a,b);this.Z.push(d);Ed(d,function(){Ja(c.Z,d)});return d};
3746
- var dj=function(a,b,c){return a.oa&&!c?(b.cancel(),F(a.oa)):b.f(function(b){!b||"auth/user-disabled"!=b.code&&"auth/user-token-expired"!=b.code||(a.oa||a.dispatchEvent(new Hi("userInvalidated")),a.oa=b);throw b;})};X.prototype.toJSON=function(){return this.C()};
3747
- X.prototype.C=function(){var a={uid:this.uid,displayName:this.displayName,photoURL:this.photoURL,email:this.email,emailVerified:this.emailVerified,isAnonymous:this.isAnonymous,providerData:[],apiKey:this.j,appName:this.B,authDomain:this.v,stsTokenManager:this.ea.C(),redirectEventId:this.sc||null};x(this.providerData,function(b){a.providerData.push(Ef(b))});return a};
3748
- var ej=function(a){if(!a.apiKey)return null;var b={apiKey:a.apiKey,authDomain:a.authDomain,appName:a.appName},c={};if(a.stsTokenManager&&a.stsTokenManager.accessToken&&a.stsTokenManager.expirationTime)c.idToken=a.stsTokenManager.accessToken,c.refreshToken=a.stsTokenManager.refreshToken||null,c.expiresIn=(a.stsTokenManager.expirationTime-ka())/1E3;else return null;var d=new X(b,c,a);a.providerData&&x(a.providerData,function(a){if(a){var b={};Df(b,a);Ui(d,b)}});a.redirectEventId&&(d.sc=a.redirectEventId);
3749
- return d},fj=function(a,b,c){var d=new X(a,b);c&&(d.Ma=c);return d.reload().then(function(){return d})};var gj=function(a){this.u=a;this.i=Th()},bj={name:"redirectUser",I:!1},cj=function(a){return a.i.remove(bj,a.u)},hj=function(a,b){return a.i.get(bj,a.u).then(function(a){a&&b&&(a.authDomain=b);return ej(a||{})})};var ij=function(a){this.u=a;this.i=Th()},jj={name:"authUser",I:!0},kj=function(a,b){return a.i.set(jj,b.C(),a.u)},lj=function(a){return a.i.remove(jj,a.u)},mj=function(a,b){return a.i.get(jj,a.u).then(function(a){a&&b&&(a.authDomain=b);return ej(a||{})})};var rj=function(a){this.Va=!1;N(this,"app",a);if(Y(this).options&&Y(this).options.apiKey)a=firebase.SDK_VERSION?nf(firebase.SDK_VERSION):null,this.g=new S(Y(this).options&&Y(this).options.apiKey,null,a);else throw new O("invalid-api-key");this.Z=[];this.ya=[];this.$e=firebase.INTERNAL.createSubscribe(r(this.Oe,this));nj(this,null);this.pa=new ij(Y(this).options.apiKey+":"+Y(this).name);this.jb=new gj(Y(this).options.apiKey+":"+Y(this).name);this.Ub=this.c(oj(this));this.ua=this.c(pj(this));this.Wc=
3750
- !1;this.Pc=r(this.uf,this);this.he=r(this.Za,this);this.rb=r(this.Rc,this);this.fe=r(this.Je,this);this.ge=r(this.Ke,this);qj(this);this.INTERNAL={};this.INTERNAL["delete"]=r(this["delete"],this);this.Da=0};rj.prototype.toJSON=function(){return{apiKey:Y(this).options.apiKey,authDomain:Y(this).options.authDomain,appName:Y(this).name,currentUser:Z(this)&&Z(this).C()}};
3751
- var sj=function(a){return a.we||F(new O("auth-domain-config-required"))},qj=function(a){var b=Y(a).options.authDomain,c=Y(a).options.apiKey;b&&qf()&&(a.we=a.Ub.then(function(){if(!a.Va)return a.m=xi(b,c,Y(a).name),a.m.subscribe(a),Z(a)&&Pi(Z(a)),a.gd&&(Pi(a.gd),a.gd=null),a.m}))};h=rj.prototype;h.vd=function(a,b){switch(a){case "unknown":case "signInViaRedirect":return!0;case "signInViaPopup":return this.la==b&&!!this.ca;default:return!1}};
3752
- h.Oa=function(a,b,c,d){"signInViaPopup"==a&&this.la==d&&(c&&this.Ka?this.Ka(c):b&&!c&&this.ca&&this.ca(b),this.J&&(this.J.cancel(),this.J=null),delete this.ca,delete this.Ka)};h.vb=function(a,b){return"signInViaRedirect"==a||"signInViaPopup"==a&&this.la==b&&this.ca?r(this.ze,this):null};
3753
- h.ze=function(a,b){var c=this;a={requestUri:a,sessionId:b};this.J&&(this.J.cancel(),this.J=null);var d=null,e=Rf(c.g,a).then(function(a){d=gg(a);return a});a=c.Ub.then(function(){return e}).then(function(a){return tj(c,a)}).then(function(){return{user:Z(c),credential:d}});return this.c(a)};h.Zb=function(){return pf()};
3754
- h.signInWithPopup=function(a){if(!qf())return F(new O("operation-not-supported-in-this-environment"));var b=this,c=Kf(a.providerId),d=this.Zb(),e=null;(!rf()||lf())&&Y(this).options.authDomain&&a.isOAuthProvider&&(e=kh(Y(this).options.authDomain,Y(this).options.apiKey,Y(this).name,"signInViaPopup",a,null,d,firebase.SDK_VERSION||null));var f=df(e,c&&c.Fb,c&&c.Eb),c=sj(this).then(function(b){return b.Gb(f,"signInViaPopup",a,d,!!e)}).then(function(){return new D(function(a,c){b.Oa("signInViaPopup",null,
3755
- new O("cancelled-popup-request"),b.la);b.ca=a;b.Ka=c;b.la=d;b.J=b.m.Nb(b,"signInViaPopup",f,d)})}).then(function(a){f&&cf(f);return a}).f(function(a){f&&cf(f);throw a;});return this.c(c)};h.signInWithRedirect=function(a){if(!qf())return F(new O("operation-not-supported-in-this-environment"));var b=this,c=sj(this).then(function(){return b.m.Hb("signInViaRedirect",a)});return this.c(c)};
3756
- h.getRedirectResult=function(){if(!qf())return F(new O("operation-not-supported-in-this-environment"));var a=this,b=sj(this).then(function(){return a.m.getRedirectResult()});return this.c(b)};
3757
- var tj=function(a,b){var c={};c.apiKey=Y(a).options.apiKey;c.authDomain=Y(a).options.authDomain;c.appName=Y(a).name;return a.Ub.then(function(){return fj(c,b,a.jb)}).then(function(b){if(Z(a)&&b.uid==Z(a).uid)return Z(a).copy(b),a.Za(b);nj(a,b);Pi(b);return a.Za(b)}).then(function(){a.Ia()})},nj=function(a,b){Z(a)&&(Ni(Z(a),a.he),cc(Z(a),"tokenChanged",a.rb),cc(Z(a),"userDeleted",a.fe),cc(Z(a),"userInvalidated",a.ge),Mi(Z(a)));b&&(b.vc.push(a.he),Ub(b,"tokenChanged",a.rb),Ub(b,"userDeleted",a.fe),
3758
- Ub(b,"userInvalidated",a.ge),0<a.Da&&Li(b));N(a,"currentUser",b)};rj.prototype.signOut=function(){var a=this,b=this.ua.then(function(){if(!Z(a))return E();nj(a,null);return lj(a.pa).then(function(){a.Ia()})});return this.c(b)};
3759
- var uj=function(a){var b=hj(a.jb,Y(a).options.authDomain).then(function(b){if(a.gd=b)b.Ma=a.jb;return cj(a.jb)});return a.c(b)},oj=function(a){var b=Y(a).options.authDomain,c=uj(a).then(function(){return mj(a.pa,b)}).then(function(b){return b?(b.Ma=a.jb,b.reload().then(function(){return kj(a.pa,b).then(function(){return b})}).f(function(c){return"auth/network-request-failed"==c.code?b:lj(a.pa)})):null}).then(function(b){nj(a,b||null)});return a.c(c)},pj=function(a){return a.Ub.then(function(){return a.getRedirectResult()}).f(function(){}).then(function(){if(!a.Va)return a.Pc()}).f(function(){}).then(function(){if(!a.Va){a.Wc=
3760
- !0;var b=a.pa;b.i.addListener(jj,b.u,a.Pc)}})};h=rj.prototype;h.uf=function(){var a=this;return mj(this.pa,Y(this).options.authDomain).then(function(b){if(!a.Va){var c;if(c=Z(a)&&b){c=Z(a).uid;var d=b.uid;c=void 0===c||null===c||""===c||void 0===d||null===d||""===d?!1:c==d}if(c)return Z(a).copy(b),Z(a).getToken();if(Z(a)||b)nj(a,b),b&&(Pi(b),b.Ma=a.jb),a.m&&a.m.subscribe(a),a.Ia()}})};h.Za=function(a){return kj(this.pa,a)};h.Rc=function(){this.Ia();this.Za(Z(this))};h.Je=function(){this.signOut()};
3761
- h.Ke=function(){this.signOut()};var vj=function(a,b){return a.c(b.then(function(b){return tj(a,b)}).then(function(){return Z(a)}))};h=rj.prototype;h.Oe=function(a){var b=this;this.addAuthTokenListener(function(){a.next(Z(b))})};h.onAuthStateChanged=function(a,b,c){var d=this;this.Wc&&firebase.Promise.resolve().then(function(){q(a)?a(Z(d)):q(a.next)&&a.next(Z(d))});return this.$e(a,b,c)};
3762
- h.getToken=function(a){var b=this,c=this.ua.then(function(){return Z(b)?Z(b).getToken(a).then(function(a){return{accessToken:a}}):null});return this.c(c)};h.signInWithCustomToken=function(a){var b=this;return this.ua.then(function(){return vj(b,R(b.g,Ug,{token:a}))}).then(function(a){Vi(a,"isAnonymous",!1);return b.Za(a)}).then(function(){return Z(b)})};h.signInWithEmailAndPassword=function(a,b){var c=this;return this.ua.then(function(){return vj(c,R(c.g,dg,{email:a,password:b}))})};
3763
- h.createUserWithEmailAndPassword=function(a,b){var c=this;return this.ua.then(function(){return vj(c,R(c.g,Rg,{email:a,password:b}))})};h.signInWithCredential=function(a){var b=this;return this.ua.then(function(){return vj(b,a.$b(b.g))})};h.signInAnonymously=function(){var a=Z(this),b=this;return a&&a.isAnonymous?E(a):this.ua.then(function(){return vj(b,b.g.signInAnonymously())}).then(function(a){Vi(a,"isAnonymous",!0);return b.Za(a)}).then(function(){return Z(b)})};
3764
- var Y=function(a){return a.app},Z=function(a){return a.currentUser};h=rj.prototype;h.getUid=function(){return Z(this)&&Z(this).uid||null};h.Ia=function(){if(this.Wc)for(var a=0;a<this.ya.length;a++)if(this.ya[a])this.ya[a](Z(this)&&Z(this)._lat||null)};h.qe=function(a){this.addAuthTokenListener(a);this.Da++;0<this.Da&&Z(this)&&Li(Z(this))};h.gf=function(a){var b=this;x(this.ya,function(c){c==a&&b.Da--});0>this.Da&&(this.Da=0);0==this.Da&&Z(this)&&Mi(Z(this));this.removeAuthTokenListener(a)};
3765
- h.addAuthTokenListener=function(a){var b=this;this.ya.push(a);this.c(this.ua.then(function(){b.Va||Ha(b.ya,a)&&a(Z(b)&&Z(b)._lat||null)}))};h.removeAuthTokenListener=function(a){Ka(this.ya,function(b){return b==a})};h["delete"]=function(){this.Va=!0;for(var a=0;a<this.Z.length;a++)this.Z[a].cancel("app-deleted");this.Z=[];this.pa&&(a=this.pa,a.i.removeListener(jj,a.u,this.Pc));this.m&&this.m.unsubscribe(this);return firebase.Promise.resolve()};
3766
- h.c=function(a){var b=this;this.Z.push(a);Ed(a,function(){Ja(b.Z,a)});return a};h.fetchProvidersForEmail=function(a){return this.c(yg(this.g,a))};h.verifyPasswordResetCode=function(a){return this.checkActionCode(a).then(function(a){return a.data.email})};h.confirmPasswordReset=function(a,b){return this.c(this.g.confirmPasswordReset(a,b).then(function(){}))};h.checkActionCode=function(a){return this.c(this.g.checkActionCode(a).then(function(a){return new Eh(a)}))};h.applyActionCode=function(a){return this.c(this.g.applyActionCode(a).then(function(){}))};
3767
- h.sendPasswordResetEmail=function(a){return this.c(this.g.sendPasswordResetEmail(a).then(function(){}))};U(rj.prototype,{applyActionCode:{name:"applyActionCode",a:[T("code")]},checkActionCode:{name:"checkActionCode",a:[T("code")]},confirmPasswordReset:{name:"confirmPasswordReset",a:[T("code"),T("newPassword")]},createUserWithEmailAndPassword:{name:"createUserWithEmailAndPassword",a:[T("email"),T("password")]},fetchProvidersForEmail:{name:"fetchProvidersForEmail",a:[T("email")]},getRedirectResult:{name:"getRedirectResult",a:[]},onAuthStateChanged:{name:"onAuthStateChanged",a:[Lh(Gh(),Hh(),"nextOrObserver"),
3768
- Hh("opt_error",!0),Hh("opt_completed",!0)]},sendPasswordResetEmail:{name:"sendPasswordResetEmail",a:[T("email")]},signInAnonymously:{name:"signInAnonymously",a:[]},signInWithCredential:{name:"signInWithCredential",a:[Jh()]},signInWithCustomToken:{name:"signInWithCustomToken",a:[T("token")]},signInWithEmailAndPassword:{name:"signInWithEmailAndPassword",a:[T("email"),T("password")]},signInWithPopup:{name:"signInWithPopup",a:[Kh()]},signInWithRedirect:{name:"signInWithRedirect",a:[Kh()]},signOut:{name:"signOut",
3769
- a:[]},toJSON:{name:"toJSON",a:[T(null,!0)]},verifyPasswordResetCode:{name:"verifyPasswordResetCode",a:[T("code")]}});
3770
- U(X.prototype,{"delete":{name:"delete",a:[]},getToken:{name:"getToken",a:[{name:"opt_forceRefresh",fa:"a boolean",optional:!0,ha:function(a){return"boolean"==typeof a}}]},link:{name:"link",a:[Jh()]},linkWithPopup:{name:"linkWithPopup",a:[Kh()]},linkWithRedirect:{name:"linkWithRedirect",a:[Kh()]},reauthenticate:{name:"reauthenticate",a:[Jh()]},reload:{name:"reload",a:[]},sendEmailVerification:{name:"sendEmailVerification",a:[]},toJSON:{name:"toJSON",a:[T(null,!0)]},unlink:{name:"unlink",a:[T("provider")]},
3771
- updateEmail:{name:"updateEmail",a:[T("email")]},updatePassword:{name:"updatePassword",a:[T("password")]},updateProfile:{name:"updateProfile",a:[Gh("profile")]}});U(D.prototype,{f:{name:"catch"},then:{name:"then"}});V(fg,"credential",function(a,b){return new cg(a,b)},[T("email"),T("password")]);U(Vf.prototype,{addScope:{name:"addScope",a:[T("scope")]},setCustomParameters:{name:"setCustomParameters",a:[Gh("customOAuthParameters")]}});V(Vf,"credential",Wf,[Lh(T(),Gh(),"token")]);
3772
- U(Xf.prototype,{addScope:{name:"addScope",a:[T("scope")]},setCustomParameters:{name:"setCustomParameters",a:[Gh("customOAuthParameters")]}});V(Xf,"credential",Yf,[Lh(T(),Gh(),"token")]);U(Zf.prototype,{addScope:{name:"addScope",a:[T("scope")]},setCustomParameters:{name:"setCustomParameters",a:[Gh("customOAuthParameters")]}});V(Zf,"credential",$f,[Lh(T(),Ih(),"idToken",!0),Lh(T(),Ih(),"accessToken",!0)]);U(ag.prototype,{setCustomParameters:{name:"setCustomParameters",a:[Gh("customOAuthParameters")]}});
3773
- V(ag,"credential",bg,[Lh(T(),Gh(),"token"),T("secret",!0)]);U(O.prototype,{toJSON:{name:"toJSON",a:[T(null,!0)]}});U(ig.prototype,{toJSON:{name:"toJSON",a:[T(null,!0)]}});U(Of.prototype,{toJSON:{name:"toJSON",a:[T(null,!0)]}});
3774
- (function(){if("undefined"!==typeof firebase&&firebase.INTERNAL&&firebase.INTERNAL.registerService){var a={Auth:rj,Error:O};V(a,"EmailAuthProvider",fg,[]);V(a,"FacebookAuthProvider",Vf,[]);V(a,"GithubAuthProvider",Xf,[]);V(a,"GoogleAuthProvider",Zf,[]);V(a,"TwitterAuthProvider",ag,[]);firebase.INTERNAL.registerService("auth",function(a,c){a=new rj(a);c({INTERNAL:{getUid:r(a.getUid,a),getToken:r(a.getToken,a),addAuthTokenListener:r(a.qe,a),removeAuthTokenListener:r(a.gf,a)}});return a},a,function(a,
3775
- c){if("create"===a)try{c.auth()}catch(d){}});firebase.INTERNAL.extendNamespace({User:X})}else throw Error("Cannot find the firebase namespace; be sure to include firebase-app.js before this library.");})();}).call(this);
3776
- (function() {var g,aa=this;function n(a){return void 0!==a}function ba(){}function ca(a){a.Vb=function(){return a.Ye?a.Ye:a.Ye=new a}}
3777
- function da(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null";
3778
- else if("function"==b&&"undefined"==typeof a.call)return"object";return b}function ea(a){return"array"==da(a)}function fa(a){var b=da(a);return"array"==b||"object"==b&&"number"==typeof a.length}function p(a){return"string"==typeof a}function ga(a){return"number"==typeof a}function ha(a){return"function"==da(a)}function ia(a){var b=typeof a;return"object"==b&&null!=a||"function"==b}function ja(a,b,c){return a.call.apply(a.bind,arguments)}
3779
- function ka(a,b,c){if(!a)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var c=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(c,d);return a.apply(b,c)}}return function(){return a.apply(b,arguments)}}function q(a,b,c){q=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?ja:ka;return q.apply(null,arguments)}
3780
- function la(a,b){function c(){}c.prototype=b.prototype;a.wg=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.sg=function(a,c,f){for(var h=Array(arguments.length-2),k=2;k<arguments.length;k++)h[k-2]=arguments[k];return b.prototype[c].apply(a,h)}};function r(a,b){for(var c in a)b.call(void 0,a[c],c,a)}function ma(a,b){var c={},d;for(d in a)c[d]=b.call(void 0,a[d],d,a);return c}function na(a,b){for(var c in a)if(!b.call(void 0,a[c],c,a))return!1;return!0}function oa(a){var b=0,c;for(c in a)b++;return b}function pa(a){for(var b in a)return b}function qa(a){var b=[],c=0,d;for(d in a)b[c++]=a[d];return b}function ra(a){var b=[],c=0,d;for(d in a)b[c++]=d;return b}function sa(a,b){for(var c in a)if(a[c]==b)return!0;return!1}
3781
- function ta(a,b,c){for(var d in a)if(b.call(c,a[d],d,a))return d}function ua(a,b){var c=ta(a,b,void 0);return c&&a[c]}function va(a){for(var b in a)return!1;return!0}function wa(a){var b={},c;for(c in a)b[c]=a[c];return b};var t=Array.prototype,xa=t.indexOf?function(a,b,c){return t.indexOf.call(a,b,c)}:function(a,b,c){c=null==c?0:0>c?Math.max(0,a.length+c):c;if(p(a))return p(b)&&1==b.length?a.indexOf(b,c):-1;for(;c<a.length;c++)if(c in a&&a[c]===b)return c;return-1},ya=t.forEach?function(a,b,c){t.forEach.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=p(a)?a.split(""):a,f=0;f<d;f++)f in e&&b.call(c,e[f],f,a)},za=t.filter?function(a,b,c){return t.filter.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=[],f=0,h=p(a)?
3782
- a.split(""):a,k=0;k<d;k++)if(k in h){var l=h[k];b.call(c,l,k,a)&&(e[f++]=l)}return e},Aa=t.map?function(a,b,c){return t.map.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=Array(d),f=p(a)?a.split(""):a,h=0;h<d;h++)h in f&&(e[h]=b.call(c,f[h],h,a));return e},Ba=t.reduce?function(a,b,c,d){for(var e=[],f=1,h=arguments.length;f<h;f++)e.push(arguments[f]);d&&(e[0]=q(b,d));return t.reduce.apply(a,e)}:function(a,b,c,d){var e=c;ya(a,function(c,h){e=b.call(d,e,c,h,a)});return e},Ca=t.every?function(a,b,
3783
- c){return t.every.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=p(a)?a.split(""):a,f=0;f<d;f++)if(f in e&&!b.call(c,e[f],f,a))return!1;return!0};function Da(a,b){var c=Ea(a,b,void 0);return 0>c?null:p(a)?a.charAt(c):a[c]}function Ea(a,b,c){for(var d=a.length,e=p(a)?a.split(""):a,f=0;f<d;f++)if(f in e&&b.call(c,e[f],f,a))return f;return-1}function Fa(a,b){var c=xa(a,b);0<=c&&t.splice.call(a,c,1)}function Ga(a,b,c){return 2>=arguments.length?t.slice.call(a,b):t.slice.call(a,b,c)}
3784
- function Ha(a,b){a.sort(b||Ia)}function Ia(a,b){return a>b?1:a<b?-1:0};function Ja(){this.Wa=-1};function Ka(){this.Wa=-1;this.Wa=64;this.M=[];this.Wd=[];this.Af=[];this.zd=[];this.zd[0]=128;for(var a=1;a<this.Wa;++a)this.zd[a]=0;this.Pd=this.$b=0;this.reset()}la(Ka,Ja);Ka.prototype.reset=function(){this.M[0]=1732584193;this.M[1]=4023233417;this.M[2]=2562383102;this.M[3]=271733878;this.M[4]=3285377520;this.Pd=this.$b=0};
3785
- function La(a,b,c){c||(c=0);var d=a.Af;if(p(b))for(var e=0;16>e;e++)d[e]=b.charCodeAt(c)<<24|b.charCodeAt(c+1)<<16|b.charCodeAt(c+2)<<8|b.charCodeAt(c+3),c+=4;else for(e=0;16>e;e++)d[e]=b[c]<<24|b[c+1]<<16|b[c+2]<<8|b[c+3],c+=4;for(e=16;80>e;e++){var f=d[e-3]^d[e-8]^d[e-14]^d[e-16];d[e]=(f<<1|f>>>31)&4294967295}b=a.M[0];c=a.M[1];for(var h=a.M[2],k=a.M[3],l=a.M[4],m,e=0;80>e;e++)40>e?20>e?(f=k^c&(h^k),m=1518500249):(f=c^h^k,m=1859775393):60>e?(f=c&h|k&(c|h),m=2400959708):(f=c^h^k,m=3395469782),f=(b<<
3786
- 5|b>>>27)+f+l+m+d[e]&4294967295,l=k,k=h,h=(c<<30|c>>>2)&4294967295,c=b,b=f;a.M[0]=a.M[0]+b&4294967295;a.M[1]=a.M[1]+c&4294967295;a.M[2]=a.M[2]+h&4294967295;a.M[3]=a.M[3]+k&4294967295;a.M[4]=a.M[4]+l&4294967295}
3787
- Ka.prototype.update=function(a,b){if(null!=a){n(b)||(b=a.length);for(var c=b-this.Wa,d=0,e=this.Wd,f=this.$b;d<b;){if(0==f)for(;d<=c;)La(this,a,d),d+=this.Wa;if(p(a))for(;d<b;){if(e[f]=a.charCodeAt(d),++f,++d,f==this.Wa){La(this,e);f=0;break}}else for(;d<b;)if(e[f]=a[d],++f,++d,f==this.Wa){La(this,e);f=0;break}}this.$b=f;this.Pd+=b}};var v;a:{var Ma=aa.navigator;if(Ma){var Na=Ma.userAgent;if(Na){v=Na;break a}}v=""};var Oa=-1!=v.indexOf("Opera")||-1!=v.indexOf("OPR"),Pa=-1!=v.indexOf("Trident")||-1!=v.indexOf("MSIE"),Qa=-1!=v.indexOf("Gecko")&&-1==v.toLowerCase().indexOf("webkit")&&!(-1!=v.indexOf("Trident")||-1!=v.indexOf("MSIE")),Ra=-1!=v.toLowerCase().indexOf("webkit");
3788
- (function(){var a="",b;if(Oa&&aa.opera)return a=aa.opera.version,ha(a)?a():a;Qa?b=/rv\:([^\);]+)(\)|;)/:Pa?b=/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/:Ra&&(b=/WebKit\/(\S+)/);b&&(a=(a=b.exec(v))?a[1]:"");return Pa&&(b=(b=aa.document)?b.documentMode:void 0,b>parseFloat(a))?String(b):a})();var Sa=null,Ta=null,Ua=null;function Va(a,b){if(!fa(a))throw Error("encodeByteArray takes an array as a parameter");Wa();for(var c=b?Ta:Sa,d=[],e=0;e<a.length;e+=3){var f=a[e],h=e+1<a.length,k=h?a[e+1]:0,l=e+2<a.length,m=l?a[e+2]:0,u=f>>2,f=(f&3)<<4|k>>4,k=(k&15)<<2|m>>6,m=m&63;l||(m=64,h||(k=64));d.push(c[u],c[f],c[k],c[m])}return d.join("")}
3789
- function Wa(){if(!Sa){Sa={};Ta={};Ua={};for(var a=0;65>a;a++)Sa[a]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(a),Ta[a]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.".charAt(a),Ua[Ta[a]]=a,62<=a&&(Ua["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(a)]=a)}};function Xa(a){a=String(a);if(/^\s*$/.test(a)?0:/^[\],:{}\s\u2028\u2029]*$/.test(a.replace(/\\["\\\/bfnrtu]/g,"@").replace(/"[^"\\\n\r\u2028\u2029\x00-\x08\x0a-\x1f]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:[\s\u2028\u2029]*\[)+/g,"")))try{return eval("("+a+")")}catch(b){}throw Error("Invalid JSON string: "+a);}function Ya(){this.Fd=void 0}
3790
- function Za(a,b,c){switch(typeof b){case "string":$a(b,c);break;case "number":c.push(isFinite(b)&&!isNaN(b)?b:"null");break;case "boolean":c.push(b);break;case "undefined":c.push("null");break;case "object":if(null==b){c.push("null");break}if(ea(b)){var d=b.length;c.push("[");for(var e="",f=0;f<d;f++)c.push(e),e=b[f],Za(a,a.Fd?a.Fd.call(b,String(f),e):e,c),e=",";c.push("]");break}c.push("{");d="";for(f in b)Object.prototype.hasOwnProperty.call(b,f)&&(e=b[f],"function"!=typeof e&&(c.push(d),$a(f,c),
3791
- c.push(":"),Za(a,a.Fd?a.Fd.call(b,f,e):e,c),d=","));c.push("}");break;case "function":break;default:throw Error("Unknown type: "+typeof b);}}var ab={'"':'\\"',"\\":"\\\\","/":"\\/","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\x0B":"\\u000b"},bb=/\uffff/.test("\uffff")?/[\\\"\x00-\x1f\x7f-\uffff]/g:/[\\\"\x00-\x1f\x7f-\xff]/g;
3792
- function $a(a,b){b.push('"',a.replace(bb,function(a){if(a in ab)return ab[a];var b=a.charCodeAt(0),e="\\u";16>b?e+="000":256>b?e+="00":4096>b&&(e+="0");return ab[a]=e+b.toString(16)}),'"')};var cb=firebase.Promise;function db(){var a=this;this.reject=this.resolve=null;this.ra=new cb(function(b,c){a.resolve=b;a.reject=c})}function eb(a,b){return function(c,d){c?a.reject(c):a.resolve(d);ha(b)&&(fb(a.ra),1===b.length?b(c):b(c,d))}}function fb(a){a.then(void 0,ba)};function gb(a){return"undefined"!==typeof JSON&&n(JSON.parse)?JSON.parse(a):Xa(a)}function w(a){if("undefined"!==typeof JSON&&n(JSON.stringify))a=JSON.stringify(a);else{var b=[];Za(new Ya,a,b);a=b.join("")}return a};function x(a,b,c,d){var e;d<b?e="at least "+b:d>c&&(e=0===c?"none":"no more than "+c);if(e)throw Error(a+" failed: Was called with "+d+(1===d?" argument.":" arguments.")+" Expects "+e+".");}function y(a,b,c){var d="";switch(b){case 1:d=c?"first":"First";break;case 2:d=c?"second":"Second";break;case 3:d=c?"third":"Third";break;case 4:d=c?"fourth":"Fourth";break;default:throw Error("errorPrefix called with argumentNumber > 4. Need to update it?");}return a=a+" failed: "+(d+" argument ")}
3793
- function A(a,b,c,d){if((!d||n(c))&&!ha(c))throw Error(y(a,b,d)+"must be a valid function.");}function hb(a,b,c){if(n(c)&&(!ia(c)||null===c))throw Error(y(a,b,!0)+"must be a valid context object.");};function ib(a,b){return Object.prototype.hasOwnProperty.call(a,b)}function B(a,b){if(Object.prototype.hasOwnProperty.call(a,b))return a[b]}function jb(a,b){for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&b(c,a[c])};function kb(a){var b=[];jb(a,function(a,d){ea(d)?ya(d,function(d){b.push(encodeURIComponent(a)+"="+encodeURIComponent(d))}):b.push(encodeURIComponent(a)+"="+encodeURIComponent(d))});return b.length?"&"+b.join("&"):""};function lb(a,b){if(!a)throw mb(b);}function mb(a){return Error("Firebase Database ("+firebase.SDK_VERSION+") INTERNAL ASSERT FAILED: "+a)};function nb(a){for(var b=[],c=0,d=0;d<a.length;d++){var e=a.charCodeAt(d);55296<=e&&56319>=e&&(e-=55296,d++,lb(d<a.length,"Surrogate pair missing trail surrogate."),e=65536+(e<<10)+(a.charCodeAt(d)-56320));128>e?b[c++]=e:(2048>e?b[c++]=e>>6|192:(65536>e?b[c++]=e>>12|224:(b[c++]=e>>18|240,b[c++]=e>>12&63|128),b[c++]=e>>6&63|128),b[c++]=e&63|128)}return b}function ob(a){for(var b=0,c=0;c<a.length;c++){var d=a.charCodeAt(c);128>d?b++:2048>d?b+=2:55296<=d&&56319>=d?(b+=4,c++):b+=3}return b};function pb(a){this.te=a;this.Bd=[];this.Qb=0;this.Yd=-1;this.Fb=null}function qb(a,b,c){a.Yd=b;a.Fb=c;a.Yd<a.Qb&&(a.Fb(),a.Fb=null)}function rb(a,b,c){for(a.Bd[b]=c;a.Bd[a.Qb];){var d=a.Bd[a.Qb];delete a.Bd[a.Qb];for(var e=0;e<d.length;++e)if(d[e]){var f=a;sb(function(){f.te(d[e])})}if(a.Qb===a.Yd){a.Fb&&(clearTimeout(a.Fb),a.Fb(),a.Fb=null);break}a.Qb++}};function tb(){return"undefined"!==typeof window&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test("undefined"!==typeof navigator&&"string"===typeof navigator.userAgent?navigator.userAgent:"")};function ub(a,b){this.committed=a;this.snapshot=b};function vb(a,b,c){this.type=wb;this.source=a;this.path=b;this.Ga=c}vb.prototype.Mc=function(a){return this.path.e()?new vb(this.source,C,this.Ga.Q(a)):new vb(this.source,D(this.path),this.Ga)};vb.prototype.toString=function(){return"Operation("+this.path+": "+this.source.toString()+" overwrite: "+this.Ga.toString()+")"};function xb(a,b){this.type=yb;this.source=a;this.path=b}xb.prototype.Mc=function(){return this.path.e()?new xb(this.source,C):new xb(this.source,D(this.path))};xb.prototype.toString=function(){return"Operation("+this.path+": "+this.source.toString()+" listen_complete)"};function zb(){this.tc={}}function Ab(a,b,c){n(c)||(c=1);ib(a.tc,b)||(a.tc[b]=0);a.tc[b]+=c}zb.prototype.get=function(){return wa(this.tc)};function Bb(a){this.Ef=a;this.rd=null}Bb.prototype.get=function(){var a=this.Ef.get(),b=wa(a);if(this.rd)for(var c in this.rd)b[c]-=this.rd[c];this.rd=a;return b};function Cb(a){this.uc=a;this.Cd="firebase:"}g=Cb.prototype;g.set=function(a,b){null==b?this.uc.removeItem(this.Cd+a):this.uc.setItem(this.Cd+a,w(b))};g.get=function(a){a=this.uc.getItem(this.Cd+a);return null==a?null:gb(a)};g.remove=function(a){this.uc.removeItem(this.Cd+a)};g.Ze=!1;g.toString=function(){return this.uc.toString()};function Db(){this.pc={}}Db.prototype.set=function(a,b){null==b?delete this.pc[a]:this.pc[a]=b};Db.prototype.get=function(a){return ib(this.pc,a)?this.pc[a]:null};Db.prototype.remove=function(a){delete this.pc[a]};Db.prototype.Ze=!0;function Eb(a){try{if("undefined"!==typeof window&&"undefined"!==typeof window[a]){var b=window[a];b.setItem("firebase:sentinel","cache");b.removeItem("firebase:sentinel");return new Cb(b)}}catch(c){}return new Db}var Fb=Eb("localStorage"),Gb=Eb("sessionStorage");function Hb(a,b,c,d,e){this.host=a.toLowerCase();this.domain=this.host.substr(this.host.indexOf(".")+1);this.Sc=b;this.pe=c;this.qg=d;this.gf=e||"";this.$a=Fb.get("host:"+a)||this.host}function Ib(a,b){b!==a.$a&&(a.$a=b,"s-"===a.$a.substr(0,2)&&Fb.set("host:"+a.host,a.$a))}
3794
- function Jb(a,b,c){E("string"===typeof b,"typeof type must == string");E("object"===typeof c,"typeof params must == object");if("websocket"===b)b=(a.Sc?"wss://":"ws://")+a.$a+"/.ws?";else if("long_polling"===b)b=(a.Sc?"https://":"http://")+a.$a+"/.lp?";else throw Error("Unknown connection type: "+b);a.host!==a.$a&&(c.ns=a.pe);var d=[];r(c,function(a,b){d.push(b+"="+a)});return b+d.join("&")}
3795
- Hb.prototype.toString=function(){var a=(this.Sc?"https://":"http://")+this.host;this.gf&&(a+="<"+this.gf+">");return a};function Kb(a){this.oc=a}Kb.prototype.getToken=function(a){return this.oc.INTERNAL.getToken(a).then(null,function(a){return a&&"auth/token-not-initialized"===a.code?(G("Got auth/token-not-initialized error. Treating as null token."),null):Promise.reject(a)})};function Lb(a,b){a.oc.INTERNAL.addAuthTokenListener(b)};function Mb(a,b,c){this.A=a;this.da=b;this.Sb=c}function Nb(a){return a.da}function Ob(a){return a.Sb}function Pb(a,b){return b.e()?a.da&&!a.Sb:Qb(a,H(b))}function Qb(a,b){return a.da&&!a.Sb||a.A.Da(b)}Mb.prototype.j=function(){return this.A};function Rb(a,b,c,d){this.ae=b;this.Md=c;this.Dd=d;this.hd=a}Rb.prototype.Yb=function(){var a=this.Md.wb();return"value"===this.hd?a.path:a.getParent().path};Rb.prototype.ge=function(){return this.hd};Rb.prototype.Tb=function(){return this.ae.Tb(this)};Rb.prototype.toString=function(){return this.Yb().toString()+":"+this.hd+":"+w(this.Md.be())};function Sb(a,b,c){this.ae=a;this.error=b;this.path=c}Sb.prototype.Yb=function(){return this.path};Sb.prototype.ge=function(){return"cancel"};
3796
- Sb.prototype.Tb=function(){return this.ae.Tb(this)};Sb.prototype.toString=function(){return this.path.toString()+":cancel"};function Tb(){this.vb=[]}function Ub(a,b){for(var c=null,d=0;d<b.length;d++){var e=b[d],f=e.Yb();null===c||f.Z(c.Yb())||(a.vb.push(c),c=null);null===c&&(c=new Vb(f));c.add(e)}c&&a.vb.push(c)}function Wb(a,b,c){Ub(a,c);Xb(a,function(a){return a.Z(b)})}function Yb(a,b,c){Ub(a,c);Xb(a,function(a){return a.contains(b)||b.contains(a)})}
3797
- function Xb(a,b){for(var c=!0,d=0;d<a.vb.length;d++){var e=a.vb[d];if(e)if(e=e.Yb(),b(e)){for(var e=a.vb[d],f=0;f<e.jd.length;f++){var h=e.jd[f];if(null!==h){e.jd[f]=null;var k=h.Tb();Zb&&G("event: "+h.toString());sb(k)}}a.vb[d]=null}else c=!1}c&&(a.vb=[])}function Vb(a){this.qa=a;this.jd=[]}Vb.prototype.add=function(a){this.jd.push(a)};Vb.prototype.Yb=function(){return this.qa};function I(a,b,c,d){this.type=a;this.Ja=b;this.Xa=c;this.qe=d;this.Dd=void 0}function $b(a){return new I(ac,a)}var ac="value";function bc(){}bc.prototype.Te=function(){return null};bc.prototype.fe=function(){return null};var cc=new bc;function dc(a,b,c){this.xf=a;this.Ka=b;this.yd=c}dc.prototype.Te=function(a){var b=this.Ka.N;if(Qb(b,a))return b.j().Q(a);b=null!=this.yd?new Mb(this.yd,!0,!1):this.Ka.w();return this.xf.qc(a,b)};dc.prototype.fe=function(a,b,c){var d=null!=this.yd?this.yd:ec(this.Ka);a=this.xf.Xd(d,b,1,c,a);return 0===a.length?null:a[0]};function fc(){this.Jd=J}fc.prototype.j=function(a){return this.Jd.P(a)};fc.prototype.toString=function(){return this.Jd.toString()};function gc(a,b){this.La=a;this.ba=b?b:hc}g=gc.prototype;g.Oa=function(a,b){return new gc(this.La,this.ba.Oa(a,b,this.La).X(null,null,!1,null,null))};g.remove=function(a){return new gc(this.La,this.ba.remove(a,this.La).X(null,null,!1,null,null))};g.get=function(a){for(var b,c=this.ba;!c.e();){b=this.La(a,c.key);if(0===b)return c.value;0>b?c=c.left:0<b&&(c=c.right)}return null};
3798
- function ic(a,b){for(var c,d=a.ba,e=null;!d.e();){c=a.La(b,d.key);if(0===c){if(d.left.e())return e?e.key:null;for(d=d.left;!d.right.e();)d=d.right;return d.key}0>c?d=d.left:0<c&&(e=d,d=d.right)}throw Error("Attempted to find predecessor key for a nonexistent key. What gives?");}g.e=function(){return this.ba.e()};g.count=function(){return this.ba.count()};g.Gc=function(){return this.ba.Gc()};g.ec=function(){return this.ba.ec()};g.ha=function(a){return this.ba.ha(a)};
3799
- g.Wb=function(a){return new jc(this.ba,null,this.La,!1,a)};g.Xb=function(a,b){return new jc(this.ba,a,this.La,!1,b)};g.Zb=function(a,b){return new jc(this.ba,a,this.La,!0,b)};g.We=function(a){return new jc(this.ba,null,this.La,!0,a)};function jc(a,b,c,d,e){this.Hd=e||null;this.le=d;this.Pa=[];for(e=1;!a.e();)if(e=b?c(a.key,b):1,d&&(e*=-1),0>e)a=this.le?a.left:a.right;else if(0===e){this.Pa.push(a);break}else this.Pa.push(a),a=this.le?a.right:a.left}
3800
- function K(a){if(0===a.Pa.length)return null;var b=a.Pa.pop(),c;c=a.Hd?a.Hd(b.key,b.value):{key:b.key,value:b.value};if(a.le)for(b=b.left;!b.e();)a.Pa.push(b),b=b.right;else for(b=b.right;!b.e();)a.Pa.push(b),b=b.left;return c}function kc(a){if(0===a.Pa.length)return null;var b;b=a.Pa;b=b[b.length-1];return a.Hd?a.Hd(b.key,b.value):{key:b.key,value:b.value}}function lc(a,b,c,d,e){this.key=a;this.value=b;this.color=null!=c?c:!0;this.left=null!=d?d:hc;this.right=null!=e?e:hc}g=lc.prototype;
3801
- g.X=function(a,b,c,d,e){return new lc(null!=a?a:this.key,null!=b?b:this.value,null!=c?c:this.color,null!=d?d:this.left,null!=e?e:this.right)};g.count=function(){return this.left.count()+1+this.right.count()};g.e=function(){return!1};g.ha=function(a){return this.left.ha(a)||a(this.key,this.value)||this.right.ha(a)};function mc(a){return a.left.e()?a:mc(a.left)}g.Gc=function(){return mc(this).key};g.ec=function(){return this.right.e()?this.key:this.right.ec()};
3802
- g.Oa=function(a,b,c){var d,e;e=this;d=c(a,e.key);e=0>d?e.X(null,null,null,e.left.Oa(a,b,c),null):0===d?e.X(null,b,null,null,null):e.X(null,null,null,null,e.right.Oa(a,b,c));return nc(e)};function oc(a){if(a.left.e())return hc;a.left.ea()||a.left.left.ea()||(a=pc(a));a=a.X(null,null,null,oc(a.left),null);return nc(a)}
3803
- g.remove=function(a,b){var c,d;c=this;if(0>b(a,c.key))c.left.e()||c.left.ea()||c.left.left.ea()||(c=pc(c)),c=c.X(null,null,null,c.left.remove(a,b),null);else{c.left.ea()&&(c=qc(c));c.right.e()||c.right.ea()||c.right.left.ea()||(c=rc(c),c.left.left.ea()&&(c=qc(c),c=rc(c)));if(0===b(a,c.key)){if(c.right.e())return hc;d=mc(c.right);c=c.X(d.key,d.value,null,null,oc(c.right))}c=c.X(null,null,null,null,c.right.remove(a,b))}return nc(c)};g.ea=function(){return this.color};
3804
- function nc(a){a.right.ea()&&!a.left.ea()&&(a=sc(a));a.left.ea()&&a.left.left.ea()&&(a=qc(a));a.left.ea()&&a.right.ea()&&(a=rc(a));return a}function pc(a){a=rc(a);a.right.left.ea()&&(a=a.X(null,null,null,null,qc(a.right)),a=sc(a),a=rc(a));return a}function sc(a){return a.right.X(null,null,a.color,a.X(null,null,!0,null,a.right.left),null)}function qc(a){return a.left.X(null,null,a.color,null,a.X(null,null,!0,a.left.right,null))}
3805
- function rc(a){return a.X(null,null,!a.color,a.left.X(null,null,!a.left.color,null,null),a.right.X(null,null,!a.right.color,null,null))}function tc(){}g=tc.prototype;g.X=function(){return this};g.Oa=function(a,b){return new lc(a,b,null)};g.remove=function(){return this};g.count=function(){return 0};g.e=function(){return!0};g.ha=function(){return!1};g.Gc=function(){return null};g.ec=function(){return null};g.ea=function(){return!1};var hc=new tc;function uc(a,b){return a&&"object"===typeof a?(E(".sv"in a,"Unexpected leaf node or priority contents"),b[a[".sv"]]):a}function vc(a,b){var c=new wc;xc(a,new L(""),function(a,e){yc(c,a,zc(e,b))});return c}function zc(a,b){var c=a.C().H(),c=uc(c,b),d;if(a.J()){var e=uc(a.Ca(),b);return e!==a.Ca()||c!==a.C().H()?new Ac(e,M(c)):a}d=a;c!==a.C().H()&&(d=d.fa(new Ac(c)));a.O(N,function(a,c){var e=zc(c,b);e!==c&&(d=d.T(a,e))});return d};var Bc=function(){var a=1;return function(){return a++}}(),E=lb,Cc=mb;
3806
- function Dc(a){try{var b;Wa();for(var c=Ua,d=[],e=0;e<a.length;){var f=c[a.charAt(e++)],h=e<a.length?c[a.charAt(e)]:0;++e;var k=e<a.length?c[a.charAt(e)]:64;++e;var l=e<a.length?c[a.charAt(e)]:64;++e;if(null==f||null==h||null==k||null==l)throw Error();d.push(f<<2|h>>4);64!=k&&(d.push(h<<4&240|k>>2),64!=l&&d.push(k<<6&192|l))}if(8192>d.length)b=String.fromCharCode.apply(null,d);else{a="";for(c=0;c<d.length;c+=8192)a+=String.fromCharCode.apply(null,Ga(d,c,c+8192));b=a}return b}catch(m){G("base64Decode failed: ",
3807
- m)}return null}function Ec(a){var b=nb(a);a=new Ka;a.update(b);var b=[],c=8*a.Pd;56>a.$b?a.update(a.zd,56-a.$b):a.update(a.zd,a.Wa-(a.$b-56));for(var d=a.Wa-1;56<=d;d--)a.Wd[d]=c&255,c/=256;La(a,a.Wd);for(d=c=0;5>d;d++)for(var e=24;0<=e;e-=8)b[c]=a.M[d]>>e&255,++c;return Va(b)}function Fc(a){for(var b="",c=0;c<arguments.length;c++)b=fa(arguments[c])?b+Fc.apply(null,arguments[c]):"object"===typeof arguments[c]?b+w(arguments[c]):b+arguments[c],b+=" ";return b}var Zb=null,Gc=!0;
3808
- function Hc(a,b){lb(!b||!0===a||!1===a,"Can't turn on custom loggers persistently.");!0===a?("undefined"!==typeof console&&("function"===typeof console.log?Zb=q(console.log,console):"object"===typeof console.log&&(Zb=function(a){console.log(a)})),b&&Gb.set("logging_enabled",!0)):ha(a)?Zb=a:(Zb=null,Gb.remove("logging_enabled"))}function G(a){!0===Gc&&(Gc=!1,null===Zb&&!0===Gb.get("logging_enabled")&&Hc(!0));if(Zb){var b=Fc.apply(null,arguments);Zb(b)}}
3809
- function Ic(a){return function(){G(a,arguments)}}function Jc(a){if("undefined"!==typeof console){var b="FIREBASE INTERNAL ERROR: "+Fc.apply(null,arguments);"undefined"!==typeof console.error?console.error(b):console.log(b)}}function Kc(a){var b=Fc.apply(null,arguments);throw Error("FIREBASE FATAL ERROR: "+b);}function O(a){if("undefined"!==typeof console){var b="FIREBASE WARNING: "+Fc.apply(null,arguments);"undefined"!==typeof console.warn?console.warn(b):console.log(b)}}
3810
- function Lc(a){var b,c,d,e,f,h=a;f=c=a=b="";d=!0;e="https";if(p(h)){var k=h.indexOf("//");0<=k&&(e=h.substring(0,k-1),h=h.substring(k+2));k=h.indexOf("/");-1===k&&(k=h.length);b=h.substring(0,k);f="";h=h.substring(k).split("/");for(k=0;k<h.length;k++)if(0<h[k].length){var l=h[k];try{l=decodeURIComponent(l.replace(/\+/g," "))}catch(m){}f+="/"+l}h=b.split(".");3===h.length?(a=h[1],c=h[0].toLowerCase()):2===h.length&&(a=h[0]);k=b.indexOf(":");0<=k&&(d="https"===e||"wss"===e)}"firebase"===a&&Kc(b+" is no longer supported. Please use <YOUR FIREBASE>.firebaseio.com instead");
3811
- c&&"undefined"!=c||Kc("Cannot parse Firebase url. Please use https://<YOUR FIREBASE>.firebaseio.com");d||"undefined"!==typeof window&&window.location&&window.location.protocol&&-1!==window.location.protocol.indexOf("https:")&&O("Insecure Firebase access from a secure page. Please use https in calls to new Firebase().");return{jc:new Hb(b,d,c,"ws"===e||"wss"===e),path:new L(f)}}function Mc(a){return ga(a)&&(a!=a||a==Number.POSITIVE_INFINITY||a==Number.NEGATIVE_INFINITY)}
3812
- function Nc(a){if("complete"===document.readyState)a();else{var b=!1,c=function(){document.body?b||(b=!0,a()):setTimeout(c,Math.floor(10))};document.addEventListener?(document.addEventListener("DOMContentLoaded",c,!1),window.addEventListener("load",c,!1)):document.attachEvent&&(document.attachEvent("onreadystatechange",function(){"complete"===document.readyState&&c()}),window.attachEvent("onload",c))}}
3813
- function Oc(a,b){if(a===b)return 0;if("[MIN_NAME]"===a||"[MAX_NAME]"===b)return-1;if("[MIN_NAME]"===b||"[MAX_NAME]"===a)return 1;var c=Pc(a),d=Pc(b);return null!==c?null!==d?0==c-d?a.length-b.length:c-d:-1:null!==d?1:a<b?-1:1}function Qc(a,b){if(b&&a in b)return b[a];throw Error("Missing required key ("+a+") in object: "+w(b));}
3814
- function Rc(a){if("object"!==typeof a||null===a)return w(a);var b=[],c;for(c in a)b.push(c);b.sort();c="{";for(var d=0;d<b.length;d++)0!==d&&(c+=","),c+=w(b[d]),c+=":",c+=Rc(a[b[d]]);return c+"}"}function Sc(a,b){if(a.length<=b)return[a];for(var c=[],d=0;d<a.length;d+=b)d+b>a?c.push(a.substring(d,a.length)):c.push(a.substring(d,d+b));return c}function Tc(a,b){if(ea(a))for(var c=0;c<a.length;++c)b(c,a[c]);else r(a,b)}
3815
- function Uc(a){E(!Mc(a),"Invalid JSON number");var b,c,d,e;0===a?(d=c=0,b=-Infinity===1/a?1:0):(b=0>a,a=Math.abs(a),a>=Math.pow(2,-1022)?(d=Math.min(Math.floor(Math.log(a)/Math.LN2),1023),c=d+1023,d=Math.round(a*Math.pow(2,52-d)-Math.pow(2,52))):(c=0,d=Math.round(a/Math.pow(2,-1074))));e=[];for(a=52;a;--a)e.push(d%2?1:0),d=Math.floor(d/2);for(a=11;a;--a)e.push(c%2?1:0),c=Math.floor(c/2);e.push(b?1:0);e.reverse();b=e.join("");c="";for(a=0;64>a;a+=8)d=parseInt(b.substr(a,8),2).toString(16),1===d.length&&
3816
- (d="0"+d),c+=d;return c.toLowerCase()}var Vc=/^-?\d{1,10}$/;function Pc(a){return Vc.test(a)&&(a=Number(a),-2147483648<=a&&2147483647>=a)?a:null}function sb(a){try{a()}catch(b){setTimeout(function(){O("Exception was thrown by user callback.",b.stack||"");throw b;},Math.floor(0))}}function Wc(a,b,c){Object.defineProperty(a,b,{get:c})}function Xc(a,b){var c=setTimeout(a,b);"object"===typeof c&&c.unref&&c.unref();return c};function Yc(a){var b={},c={},d={},e="";try{var f=a.split("."),b=gb(Dc(f[0])||""),c=gb(Dc(f[1])||""),e=f[2],d=c.d||{};delete c.d}catch(h){}return{tg:b,Je:c,data:d,mg:e}}function Zc(a){a=Yc(a);var b=a.Je;return!!a.mg&&!!b&&"object"===typeof b&&b.hasOwnProperty("iat")}function $c(a){a=Yc(a).Je;return"object"===typeof a&&!0===B(a,"admin")};function ad(a,b,c){this.type=bd;this.source=a;this.path=b;this.children=c}ad.prototype.Mc=function(a){if(this.path.e())return a=this.children.subtree(new L(a)),a.e()?null:a.value?new vb(this.source,C,a.value):new ad(this.source,C,a);E(H(this.path)===a,"Can't get a merge for a child not on the path of the operation");return new ad(this.source,D(this.path),this.children)};ad.prototype.toString=function(){return"Operation("+this.path+": "+this.source.toString()+" merge: "+this.children.toString()+")"};function cd(a,b,c){this.f=Ic("p:rest:");this.L=a;this.Gb=b;this.$c=c;this.$={}}function dd(a,b){if(n(b))return"tag$"+b;E(ed(a.m),"should have a tag if it's not a default query.");return a.path.toString()}g=cd.prototype;
3817
- g.$e=function(a,b,c,d){var e=a.path.toString();this.f("Listen called for "+e+" "+a.ja());var f=dd(a,c),h={};this.$[f]=h;a=fd(a.m);var k=this;gd(this,e+".json",a,function(a,b){var u=b;404===a&&(a=u=null);null===a&&k.Gb(e,u,!1,c);B(k.$,f)===h&&d(a?401==a?"permission_denied":"rest_error:"+a:"ok",null)})};g.uf=function(a,b){var c=dd(a,b);delete this.$[c]};g.kf=function(){};g.re=function(){};g.cf=function(){};g.xd=function(){};g.put=function(){};g.af=function(){};g.ye=function(){};
3818
- function gd(a,b,c,d){c=c||{};c.format="export";a.$c.getToken(!1).then(function(e){(e=e&&e.accessToken)&&(c.auth=e);var f=(a.L.Sc?"https://":"http://")+a.L.host+b+"?"+kb(c);a.f("Sending REST request for "+f);var h=new XMLHttpRequest;h.onreadystatechange=function(){if(d&&4===h.readyState){a.f("REST Response for "+f+" received. status:",h.status,"response:",h.responseText);var b=null;if(200<=h.status&&300>h.status){try{b=gb(h.responseText)}catch(c){O("Failed to parse JSON response for "+f+": "+h.responseText)}d(null,
3819
- b)}else 401!==h.status&&404!==h.status&&O("Got unsuccessful REST response for "+f+" Status: "+h.status),d(h.status);d=null}};h.open("GET",f,!0);h.send()})};function hd(a,b){this.rf={};this.Vc=new Bb(a);this.va=b;var c=1E4+2E4*Math.random();Xc(q(this.lf,this),Math.floor(c))}hd.prototype.lf=function(){var a=this.Vc.get(),b={},c=!1,d;for(d in a)0<a[d]&&ib(this.rf,d)&&(b[d]=a[d],c=!0);c&&this.va.ye(b);Xc(q(this.lf,this),Math.floor(6E5*Math.random()))};var id={},jd={};function kd(a){a=a.toString();id[a]||(id[a]=new zb);return id[a]}function ld(a,b){var c=a.toString();jd[c]||(jd[c]=b());return jd[c]};function md(a,b){this.Sd=a;this.Df=b}function nd(a){this.U=a}
3820
- nd.prototype.eb=function(a,b,c,d){var e=new od,f;if(b.type===wb)b.source.ee?c=pd(this,a,b.path,b.Ga,c,d,e):(E(b.source.Se,"Unknown source."),f=b.source.Ee||Ob(a.w())&&!b.path.e(),c=qd(this,a,b.path,b.Ga,c,d,f,e));else if(b.type===bd)b.source.ee?c=rd(this,a,b.path,b.children,c,d,e):(E(b.source.Se,"Unknown source."),f=b.source.Ee||Ob(a.w()),c=sd(this,a,b.path,b.children,c,d,f,e));else if(b.type===ud)if(b.Id)if(b=b.path,null!=c.lc(b))c=a;else{f=new dc(c,a,d);d=a.N.j();if(b.e()||".priority"===H(b))Nb(a.w())?
3821
- b=c.Aa(ec(a)):(b=a.w().j(),E(b instanceof P,"serverChildren would be complete if leaf node"),b=c.rc(b)),b=this.U.ya(d,b,e);else{var h=H(b),k=c.qc(h,a.w());null==k&&Qb(a.w(),h)&&(k=d.Q(h));b=null!=k?this.U.F(d,h,k,D(b),f,e):a.N.j().Da(h)?this.U.F(d,h,J,D(b),f,e):d;b.e()&&Nb(a.w())&&(d=c.Aa(ec(a)),d.J()&&(b=this.U.ya(b,d,e)))}d=Nb(a.w())||null!=c.lc(C);c=vd(a,b,d,this.U.Na())}else c=wd(this,a,b.path,b.Ob,c,d,e);else if(b.type===yb)d=b.path,b=a.w(),f=b.j(),h=b.da||d.e(),c=xd(this,new yd(a.N,new Mb(f,
3822
- h,b.Sb)),d,c,cc,e);else throw Cc("Unknown operation type: "+b.type);e=qa(e.fb);d=c;b=d.N;b.da&&(f=b.j().J()||b.j().e(),h=zd(a),(0<e.length||!a.N.da||f&&!b.j().Z(h)||!b.j().C().Z(h.C()))&&e.push($b(zd(d))));return new md(c,e)};
3823
- function xd(a,b,c,d,e,f){var h=b.N;if(null!=d.lc(c))return b;var k;if(c.e())E(Nb(b.w()),"If change path is empty, we must have complete server data"),Ob(b.w())?(e=ec(b),d=d.rc(e instanceof P?e:J)):d=d.Aa(ec(b)),f=a.U.ya(b.N.j(),d,f);else{var l=H(c);if(".priority"==l)E(1==Ad(c),"Can't have a priority with additional path components"),f=h.j(),k=b.w().j(),d=d.ad(c,f,k),f=null!=d?a.U.fa(f,d):h.j();else{var m=D(c);Qb(h,l)?(k=b.w().j(),d=d.ad(c,h.j(),k),d=null!=d?h.j().Q(l).F(m,d):h.j().Q(l)):d=d.qc(l,
3824
- b.w());f=null!=d?a.U.F(h.j(),l,d,m,e,f):h.j()}}return vd(b,f,h.da||c.e(),a.U.Na())}function qd(a,b,c,d,e,f,h,k){var l=b.w();h=h?a.U:a.U.Ub();if(c.e())d=h.ya(l.j(),d,null);else if(h.Na()&&!l.Sb)d=l.j().F(c,d),d=h.ya(l.j(),d,null);else{var m=H(c);if(!Pb(l,c)&&1<Ad(c))return b;var u=D(c);d=l.j().Q(m).F(u,d);d=".priority"==m?h.fa(l.j(),d):h.F(l.j(),m,d,u,cc,null)}l=l.da||c.e();b=new yd(b.N,new Mb(d,l,h.Na()));return xd(a,b,c,e,new dc(e,b,f),k)}
3825
- function pd(a,b,c,d,e,f,h){var k=b.N;e=new dc(e,b,f);if(c.e())h=a.U.ya(b.N.j(),d,h),a=vd(b,h,!0,a.U.Na());else if(f=H(c),".priority"===f)h=a.U.fa(b.N.j(),d),a=vd(b,h,k.da,k.Sb);else{c=D(c);var l=k.j().Q(f);if(!c.e()){var m=e.Te(f);d=null!=m?".priority"===Bd(c)&&m.P(c.parent()).e()?m:m.F(c,d):J}l.Z(d)?a=b:(h=a.U.F(k.j(),f,d,c,e,h),a=vd(b,h,k.da,a.U.Na()))}return a}
3826
- function rd(a,b,c,d,e,f,h){var k=b;Cd(d,function(d,m){var u=c.n(d);Qb(b.N,H(u))&&(k=pd(a,k,u,m,e,f,h))});Cd(d,function(d,m){var u=c.n(d);Qb(b.N,H(u))||(k=pd(a,k,u,m,e,f,h))});return k}function Dd(a,b){Cd(b,function(b,d){a=a.F(b,d)});return a}
3827
- function sd(a,b,c,d,e,f,h,k){if(b.w().j().e()&&!Nb(b.w()))return b;var l=b;c=c.e()?d:Ed(Q,c,d);var m=b.w().j();c.children.ha(function(c,d){if(m.Da(c)){var F=b.w().j().Q(c),F=Dd(F,d);l=qd(a,l,new L(c),F,e,f,h,k)}});c.children.ha(function(c,d){var F=!Qb(b.w(),c)&&null==d.value;m.Da(c)||F||(F=b.w().j().Q(c),F=Dd(F,d),l=qd(a,l,new L(c),F,e,f,h,k))});return l}
3828
- function wd(a,b,c,d,e,f,h){if(null!=e.lc(c))return b;var k=Ob(b.w()),l=b.w();if(null!=d.value){if(c.e()&&l.da||Pb(l,c))return qd(a,b,c,l.j().P(c),e,f,k,h);if(c.e()){var m=Q;l.j().O(Fd,function(a,b){m=m.set(new L(a),b)});return sd(a,b,c,m,e,f,k,h)}return b}m=Q;Cd(d,function(a){var b=c.n(a);Pb(l,b)&&(m=m.set(a,l.j().P(b)))});return sd(a,b,c,m,e,f,k,h)};function od(){this.fb={}}
3829
- function Gd(a,b){var c=b.type,d=b.Xa;E("child_added"==c||"child_changed"==c||"child_removed"==c,"Only child changes supported for tracking");E(".priority"!==d,"Only non-priority child changes can be tracked.");var e=B(a.fb,d);if(e){var f=e.type;if("child_added"==c&&"child_removed"==f)a.fb[d]=new I("child_changed",b.Ja,d,e.Ja);else if("child_removed"==c&&"child_added"==f)delete a.fb[d];else if("child_removed"==c&&"child_changed"==f)a.fb[d]=new I("child_removed",e.qe,d);else if("child_changed"==c&&
3830
- "child_added"==f)a.fb[d]=new I("child_added",b.Ja,d);else if("child_changed"==c&&"child_changed"==f)a.fb[d]=new I("child_changed",b.Ja,d,e.qe);else throw Cc("Illegal combination of changes: "+b+" occurred after "+e);}else a.fb[d]=b};function Hd(a){this.g=a}g=Hd.prototype;g.F=function(a,b,c,d,e,f){E(a.yc(this.g),"A node must be indexed if only a child is updated");e=a.Q(b);if(e.P(d).Z(c.P(d))&&e.e()==c.e())return a;null!=f&&(c.e()?a.Da(b)?Gd(f,new I("child_removed",e,b)):E(a.J(),"A child remove without an old child only makes sense on a leaf node"):e.e()?Gd(f,new I("child_added",c,b)):Gd(f,new I("child_changed",c,b,e)));return a.J()&&c.e()?a:a.T(b,c).nb(this.g)};
3831
- g.ya=function(a,b,c){null!=c&&(a.J()||a.O(N,function(a,e){b.Da(a)||Gd(c,new I("child_removed",e,a))}),b.J()||b.O(N,function(b,e){if(a.Da(b)){var f=a.Q(b);f.Z(e)||Gd(c,new I("child_changed",e,b,f))}else Gd(c,new I("child_added",e,b))}));return b.nb(this.g)};g.fa=function(a,b){return a.e()?J:a.fa(b)};g.Na=function(){return!1};g.Ub=function(){return this};function Id(a){this.he=new Hd(a.g);this.g=a.g;var b;a.ka?(b=Jd(a),b=a.g.Ec(Kd(a),b)):b=a.g.Hc();this.Uc=b;a.na?(b=Ld(a),a=a.g.Ec(Md(a),b)):a=a.g.Fc();this.vc=a}g=Id.prototype;g.matches=function(a){return 0>=this.g.compare(this.Uc,a)&&0>=this.g.compare(a,this.vc)};g.F=function(a,b,c,d,e,f){this.matches(new R(b,c))||(c=J);return this.he.F(a,b,c,d,e,f)};
3832
- g.ya=function(a,b,c){b.J()&&(b=J);var d=b.nb(this.g),d=d.fa(J),e=this;b.O(N,function(a,b){e.matches(new R(a,b))||(d=d.T(a,J))});return this.he.ya(a,d,c)};g.fa=function(a){return a};g.Na=function(){return!0};g.Ub=function(){return this.he};function L(a,b){if(1==arguments.length){this.o=a.split("/");for(var c=0,d=0;d<this.o.length;d++)0<this.o[d].length&&(this.o[c]=this.o[d],c++);this.o.length=c;this.Y=0}else this.o=a,this.Y=b}function S(a,b){var c=H(a);if(null===c)return b;if(c===H(b))return S(D(a),D(b));throw Error("INTERNAL ERROR: innerPath ("+b+") is not within outerPath ("+a+")");}
3833
- function Nd(a,b){for(var c=a.slice(),d=b.slice(),e=0;e<c.length&&e<d.length;e++){var f=Oc(c[e],d[e]);if(0!==f)return f}return c.length===d.length?0:c.length<d.length?-1:1}function H(a){return a.Y>=a.o.length?null:a.o[a.Y]}function Ad(a){return a.o.length-a.Y}function D(a){var b=a.Y;b<a.o.length&&b++;return new L(a.o,b)}function Bd(a){return a.Y<a.o.length?a.o[a.o.length-1]:null}g=L.prototype;
3834
- g.toString=function(){for(var a="",b=this.Y;b<this.o.length;b++)""!==this.o[b]&&(a+="/"+this.o[b]);return a||"/"};g.slice=function(a){return this.o.slice(this.Y+(a||0))};g.parent=function(){if(this.Y>=this.o.length)return null;for(var a=[],b=this.Y;b<this.o.length-1;b++)a.push(this.o[b]);return new L(a,0)};
3835
- g.n=function(a){for(var b=[],c=this.Y;c<this.o.length;c++)b.push(this.o[c]);if(a instanceof L)for(c=a.Y;c<a.o.length;c++)b.push(a.o[c]);else for(a=a.split("/"),c=0;c<a.length;c++)0<a[c].length&&b.push(a[c]);return new L(b,0)};g.e=function(){return this.Y>=this.o.length};g.Z=function(a){if(Ad(this)!==Ad(a))return!1;for(var b=this.Y,c=a.Y;b<=this.o.length;b++,c++)if(this.o[b]!==a.o[c])return!1;return!0};
3836
- g.contains=function(a){var b=this.Y,c=a.Y;if(Ad(this)>Ad(a))return!1;for(;b<this.o.length;){if(this.o[b]!==a.o[c])return!1;++b;++c}return!0};var C=new L("");function Od(a,b){this.Qa=a.slice();this.Ha=Math.max(1,this.Qa.length);this.Qe=b;for(var c=0;c<this.Qa.length;c++)this.Ha+=ob(this.Qa[c]);Pd(this)}Od.prototype.push=function(a){0<this.Qa.length&&(this.Ha+=1);this.Qa.push(a);this.Ha+=ob(a);Pd(this)};Od.prototype.pop=function(){var a=this.Qa.pop();this.Ha-=ob(a);0<this.Qa.length&&--this.Ha};
3837
- function Pd(a){if(768<a.Ha)throw Error(a.Qe+"has a key path longer than 768 bytes ("+a.Ha+").");if(32<a.Qa.length)throw Error(a.Qe+"path specified exceeds the maximum depth that can be written (32) or object contains a cycle "+Qd(a));}function Qd(a){return 0==a.Qa.length?"":"in property '"+a.Qa.join(".")+"'"};function Rd(a){a instanceof Sd||Kc("Don't call new Database() directly - please use firebase.database().");this.ta=a;this.ba=new T(a,C);this.INTERNAL=new Td(this)}var Ud={TIMESTAMP:{".sv":"timestamp"}};g=Rd.prototype;g.app=null;g.jf=function(a){Vd(this,"ref");x("database.ref",0,1,arguments.length);return n(a)?this.ba.n(a):this.ba};
3838
- g.gg=function(a){Vd(this,"database.refFromURL");x("database.refFromURL",1,1,arguments.length);var b=Lc(a);Wd("database.refFromURL",b);var c=b.jc;c.host!==this.ta.L.host&&Kc("database.refFromURL: Host name does not match the current database: (found "+c.host+" but expected "+this.ta.L.host+")");return this.jf(b.path.toString())};function Vd(a,b){null===a.ta&&Kc("Cannot call "+b+" on a deleted database.")}g.Pf=function(){x("database.goOffline",0,0,arguments.length);Vd(this,"goOffline");this.ta.ab()};
3839
- g.Qf=function(){x("database.goOnline",0,0,arguments.length);Vd(this,"goOnline");this.ta.kc()};Object.defineProperty(Rd.prototype,"app",{get:function(){return this.ta.app}});function Td(a){this.Ya=a}Td.prototype.delete=function(){Vd(this.Ya,"delete");var a=Xd.Vb(),b=this.Ya.ta;B(a.lb,b.app.name)!==b&&Kc("Database "+b.app.name+" has already been deleted.");b.ab();delete a.lb[b.app.name];this.Ya.ta=null;this.Ya.ba=null;this.Ya=this.Ya.INTERNAL=null;return firebase.Promise.resolve()};
3840
- Rd.prototype.ref=Rd.prototype.jf;Rd.prototype.refFromURL=Rd.prototype.gg;Rd.prototype.goOnline=Rd.prototype.Qf;Rd.prototype.goOffline=Rd.prototype.Pf;Td.prototype["delete"]=Td.prototype.delete;function Yd(){this.children={};this.bd=0;this.value=null}function Zd(a,b,c){this.ud=a?a:"";this.Pc=b?b:null;this.A=c?c:new Yd}function $d(a,b){for(var c=b instanceof L?b:new L(b),d=a,e;null!==(e=H(c));)d=new Zd(e,d,B(d.A.children,e)||new Yd),c=D(c);return d}g=Zd.prototype;g.Ca=function(){return this.A.value};function ae(a,b){E("undefined"!==typeof b,"Cannot set value to undefined");a.A.value=b;be(a)}g.clear=function(){this.A.value=null;this.A.children={};this.A.bd=0;be(this)};
3841
- g.kd=function(){return 0<this.A.bd};g.e=function(){return null===this.Ca()&&!this.kd()};g.O=function(a){var b=this;r(this.A.children,function(c,d){a(new Zd(d,b,c))})};function ce(a,b,c,d){c&&!d&&b(a);a.O(function(a){ce(a,b,!0,d)});c&&d&&b(a)}function de(a,b){for(var c=a.parent();null!==c&&!b(c);)c=c.parent()}g.path=function(){return new L(null===this.Pc?this.ud:this.Pc.path()+"/"+this.ud)};g.name=function(){return this.ud};g.parent=function(){return this.Pc};
3842
- function be(a){if(null!==a.Pc){var b=a.Pc,c=a.ud,d=a.e(),e=ib(b.A.children,c);d&&e?(delete b.A.children[c],b.A.bd--,be(b)):d||e||(b.A.children[c]=a.A,b.A.bd++,be(b))}};function ee(){this.set={}}g=ee.prototype;g.add=function(a,b){this.set[a]=null!==b?b:!0};g.contains=function(a){return ib(this.set,a)};g.get=function(a){return this.contains(a)?this.set[a]:void 0};g.remove=function(a){delete this.set[a]};g.clear=function(){this.set={}};g.e=function(){return va(this.set)};g.count=function(){return oa(this.set)};function fe(a,b){r(a.set,function(a,d){b(d,a)})}g.keys=function(){var a=[];r(this.set,function(b,c){a.push(c)});return a};function ge(a,b,c,d){this.Zd=a;this.f=Ic(a);this.jc=b;this.pb=this.qb=0;this.Va=kd(b);this.tf=c;this.wc=!1;this.Cb=d;this.Yc=function(a){return Jb(b,"long_polling",a)}}var he,ie;
3843
- ge.prototype.open=function(a,b){this.Ne=0;this.ia=b;this.bf=new pb(a);this.Ab=!1;var c=this;this.sb=setTimeout(function(){c.f("Timed out trying to connect.");c.bb();c.sb=null},Math.floor(3E4));Nc(function(){if(!c.Ab){c.Ta=new je(function(a,b,d,k,l){ke(c,arguments);if(c.Ta)if(c.sb&&(clearTimeout(c.sb),c.sb=null),c.wc=!0,"start"==a)c.id=b,c.ff=d;else if("close"===a)b?(c.Ta.Kd=!1,qb(c.bf,b,function(){c.bb()})):c.bb();else throw Error("Unrecognized command received: "+a);},function(a,b){ke(c,arguments);
3844
- rb(c.bf,a,b)},function(){c.bb()},c.Yc);var a={start:"t"};a.ser=Math.floor(1E8*Math.random());c.Ta.Qd&&(a.cb=c.Ta.Qd);a.v="5";c.tf&&(a.s=c.tf);c.Cb&&(a.ls=c.Cb);"undefined"!==typeof location&&location.href&&-1!==location.href.indexOf("firebaseio.com")&&(a.r="f");a=c.Yc(a);c.f("Connecting via long-poll to "+a);le(c.Ta,a,function(){})}})};
3845
- ge.prototype.start=function(){var a=this.Ta,b=this.ff;a.Vf=this.id;a.Wf=b;for(a.Ud=!0;me(a););a=this.id;b=this.ff;this.fc=document.createElement("iframe");var c={dframe:"t"};c.id=a;c.pw=b;this.fc.src=this.Yc(c);this.fc.style.display="none";document.body.appendChild(this.fc)};
3846
- ge.isAvailable=function(){return he||!ie&&"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.rg)&&!0};g=ge.prototype;g.sd=function(){};g.Tc=function(){this.Ab=!0;this.Ta&&(this.Ta.close(),this.Ta=null);this.fc&&(document.body.removeChild(this.fc),this.fc=null);this.sb&&(clearTimeout(this.sb),this.sb=null)};
3847
- g.bb=function(){this.Ab||(this.f("Longpoll is closing itself"),this.Tc(),this.ia&&(this.ia(this.wc),this.ia=null))};g.close=function(){this.Ab||(this.f("Longpoll is being closed."),this.Tc())};g.send=function(a){a=w(a);this.qb+=a.length;Ab(this.Va,"bytes_sent",a.length);a=nb(a);a=Va(a,!0);a=Sc(a,1840);for(var b=0;b<a.length;b++){var c=this.Ta;c.Qc.push({jg:this.Ne,pg:a.length,Pe:a[b]});c.Ud&&me(c);this.Ne++}};function ke(a,b){var c=w(b).length;a.pb+=c;Ab(a.Va,"bytes_received",c)}
3848
- function je(a,b,c,d){this.Yc=d;this.ib=c;this.ve=new ee;this.Qc=[];this.$d=Math.floor(1E8*Math.random());this.Kd=!0;this.Qd=Bc();window["pLPCommand"+this.Qd]=a;window["pRTLPCB"+this.Qd]=b;a=document.createElement("iframe");a.style.display="none";if(document.body){document.body.appendChild(a);try{a.contentWindow.document||G("No IE domain setting required")}catch(e){a.src="javascript:void((function(){document.open();document.domain='"+document.domain+"';document.close();})())"}}else throw"Document body has not initialized. Wait to initialize Firebase until after the document is ready.";
3849
- a.contentDocument?a.gb=a.contentDocument:a.contentWindow?a.gb=a.contentWindow.document:a.document&&(a.gb=a.document);this.Ea=a;a="";this.Ea.src&&"javascript:"===this.Ea.src.substr(0,11)&&(a='<script>document.domain="'+document.domain+'";\x3c/script>');a="<html><body>"+a+"</body></html>";try{this.Ea.gb.open(),this.Ea.gb.write(a),this.Ea.gb.close()}catch(f){G("frame writing exception"),f.stack&&G(f.stack),G(f)}}
3850
- je.prototype.close=function(){this.Ud=!1;if(this.Ea){this.Ea.gb.body.innerHTML="";var a=this;setTimeout(function(){null!==a.Ea&&(document.body.removeChild(a.Ea),a.Ea=null)},Math.floor(0))}var b=this.ib;b&&(this.ib=null,b())};
3851
- function me(a){if(a.Ud&&a.Kd&&a.ve.count()<(0<a.Qc.length?2:1)){a.$d++;var b={};b.id=a.Vf;b.pw=a.Wf;b.ser=a.$d;for(var b=a.Yc(b),c="",d=0;0<a.Qc.length;)if(1870>=a.Qc[0].Pe.length+30+c.length){var e=a.Qc.shift(),c=c+"&seg"+d+"="+e.jg+"&ts"+d+"="+e.pg+"&d"+d+"="+e.Pe;d++}else break;ne(a,b+c,a.$d);return!0}return!1}function ne(a,b,c){function d(){a.ve.remove(c);me(a)}a.ve.add(c,1);var e=setTimeout(d,Math.floor(25E3));le(a,b,function(){clearTimeout(e);d()})}
3852
- function le(a,b,c){setTimeout(function(){try{if(a.Kd){var d=a.Ea.gb.createElement("script");d.type="text/javascript";d.async=!0;d.src=b;d.onload=d.onreadystatechange=function(){var a=d.readyState;a&&"loaded"!==a&&"complete"!==a||(d.onload=d.onreadystatechange=null,d.parentNode&&d.parentNode.removeChild(d),c())};d.onerror=function(){G("Long-poll script failed to load: "+b);a.Kd=!1;a.close()};a.Ea.gb.body.appendChild(d)}}catch(e){}},Math.floor(1))};var oe=/[\[\].#$\/\u0000-\u001F\u007F]/,pe=/[\[\].#$\u0000-\u001F\u007F]/;function qe(a){return p(a)&&0!==a.length&&!oe.test(a)}function re(a){return null===a||p(a)||ga(a)&&!Mc(a)||ia(a)&&ib(a,".sv")}function se(a,b,c,d){d&&!n(b)||te(y(a,1,d),b,c)}
3853
- function te(a,b,c){c instanceof L&&(c=new Od(c,a));if(!n(b))throw Error(a+"contains undefined "+Qd(c));if(ha(b))throw Error(a+"contains a function "+Qd(c)+" with contents: "+b.toString());if(Mc(b))throw Error(a+"contains "+b.toString()+" "+Qd(c));if(p(b)&&b.length>10485760/3&&10485760<ob(b))throw Error(a+"contains a string greater than 10485760 utf8 bytes "+Qd(c)+" ('"+b.substring(0,50)+"...')");if(ia(b)){var d=!1,e=!1;jb(b,function(b,h){if(".value"===b)d=!0;else if(".priority"!==b&&".sv"!==b&&(e=
3854
- !0,!qe(b)))throw Error(a+" contains an invalid key ("+b+") "+Qd(c)+'. Keys must be non-empty strings and can\'t contain ".", "#", "$", "/", "[", or "]"');c.push(b);te(a,h,c);c.pop()});if(d&&e)throw Error(a+' contains ".value" child '+Qd(c)+" in addition to actual children.");}}
3855
- function ue(a,b){var c,d;for(c=0;c<b.length;c++){d=b[c];for(var e=d.slice(),f=0;f<e.length;f++)if((".priority"!==e[f]||f!==e.length-1)&&!qe(e[f]))throw Error(a+"contains an invalid key ("+e[f]+") in path "+d.toString()+'. Keys must be non-empty strings and can\'t contain ".", "#", "$", "/", "[", or "]"');}b.sort(Nd);e=null;for(c=0;c<b.length;c++){d=b[c];if(null!==e&&e.contains(d))throw Error(a+"contains a path "+e.toString()+" that is ancestor of another path "+d.toString());e=d}}
3856
- function ve(a,b,c){var d=y(a,1,!1);if(!ia(b)||ea(b))throw Error(d+" must be an object containing the children to replace.");var e=[];jb(b,function(a,b){var k=new L(a);te(d,b,c.n(k));if(".priority"===Bd(k)&&!re(b))throw Error(d+"contains an invalid value for '"+k.toString()+"', which must be a valid Firebase priority (a string, finite number, server value, or null).");e.push(k)});ue(d,e)}
3857
- function we(a,b,c){if(Mc(c))throw Error(y(a,b,!1)+"is "+c.toString()+", but must be a valid Firebase priority (a string, finite number, server value, or null).");if(!re(c))throw Error(y(a,b,!1)+"must be a valid Firebase priority (a string, finite number, server value, or null).");}
3858
- function xe(a,b,c){if(!c||n(b))switch(b){case "value":case "child_added":case "child_removed":case "child_changed":case "child_moved":break;default:throw Error(y(a,1,c)+'must be a valid event type: "value", "child_added", "child_removed", "child_changed", or "child_moved".');}}function ye(a,b){if(n(b)&&!qe(b))throw Error(y(a,2,!0)+'was an invalid key: "'+b+'". Firebase keys must be non-empty strings and can\'t contain ".", "#", "$", "/", "[", or "]").');}
3859
- function ze(a,b){if(!p(b)||0===b.length||pe.test(b))throw Error(y(a,1,!1)+'was an invalid path: "'+b+'". Paths must be non-empty strings and can\'t contain ".", "#", "$", "[", or "]"');}function Ae(a,b){if(".info"===H(b))throw Error(a+" failed: Can't modify data under /.info/");}
3860
- function Wd(a,b){var c=b.path.toString(),d;!(d=!p(b.jc.host)||0===b.jc.host.length||!qe(b.jc.pe))&&(d=0!==c.length)&&(c&&(c=c.replace(/^\/*\.info(\/|$)/,"/")),d=!(p(c)&&0!==c.length&&!pe.test(c)));if(d)throw Error(y(a,1,!1)+'must be a valid firebase URL and the path can\'t contain ".", "#", "$", "[", or "]".');};function U(a,b){this.ta=a;this.qa=b}U.prototype.cancel=function(a){x("Firebase.onDisconnect().cancel",0,1,arguments.length);A("Firebase.onDisconnect().cancel",1,a,!0);var b=new db;this.ta.xd(this.qa,eb(b,a));return b.ra};U.prototype.cancel=U.prototype.cancel;U.prototype.remove=function(a){x("Firebase.onDisconnect().remove",0,1,arguments.length);Ae("Firebase.onDisconnect().remove",this.qa);A("Firebase.onDisconnect().remove",1,a,!0);var b=new db;Be(this.ta,this.qa,null,eb(b,a));return b.ra};
3861
- U.prototype.remove=U.prototype.remove;U.prototype.set=function(a,b){x("Firebase.onDisconnect().set",1,2,arguments.length);Ae("Firebase.onDisconnect().set",this.qa);se("Firebase.onDisconnect().set",a,this.qa,!1);A("Firebase.onDisconnect().set",2,b,!0);var c=new db;Be(this.ta,this.qa,a,eb(c,b));return c.ra};U.prototype.set=U.prototype.set;
3862
- U.prototype.Jb=function(a,b,c){x("Firebase.onDisconnect().setWithPriority",2,3,arguments.length);Ae("Firebase.onDisconnect().setWithPriority",this.qa);se("Firebase.onDisconnect().setWithPriority",a,this.qa,!1);we("Firebase.onDisconnect().setWithPriority",2,b);A("Firebase.onDisconnect().setWithPriority",3,c,!0);var d=new db;Ce(this.ta,this.qa,a,b,eb(d,c));return d.ra};U.prototype.setWithPriority=U.prototype.Jb;
3863
- U.prototype.update=function(a,b){x("Firebase.onDisconnect().update",1,2,arguments.length);Ae("Firebase.onDisconnect().update",this.qa);if(ea(a)){for(var c={},d=0;d<a.length;++d)c[""+d]=a[d];a=c;O("Passing an Array to Firebase.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.")}ve("Firebase.onDisconnect().update",a,this.qa);A("Firebase.onDisconnect().update",2,b,!0);
3864
- c=new db;De(this.ta,this.qa,a,eb(c,b));return c.ra};U.prototype.update=U.prototype.update;function Ee(a){E(ea(a)&&0<a.length,"Requires a non-empty array");this.Bf=a;this.Dc={}}Ee.prototype.Ge=function(a,b){var c;c=this.Dc[a]||[];var d=c.length;if(0<d){for(var e=Array(d),f=0;f<d;f++)e[f]=c[f];c=e}else c=[];for(d=0;d<c.length;d++)c[d].Ie.apply(c[d].Ma,Array.prototype.slice.call(arguments,1))};Ee.prototype.gc=function(a,b,c){Fe(this,a);this.Dc[a]=this.Dc[a]||[];this.Dc[a].push({Ie:b,Ma:c});(a=this.Ue(a))&&b.apply(c,a)};
3865
- Ee.prototype.Ic=function(a,b,c){Fe(this,a);a=this.Dc[a]||[];for(var d=0;d<a.length;d++)if(a[d].Ie===b&&(!c||c===a[d].Ma)){a.splice(d,1);break}};function Fe(a,b){E(Da(a.Bf,function(a){return a===b}),"Unknown event: "+b)};function Ge(){Ee.call(this,["visible"]);var a,b;"undefined"!==typeof document&&"undefined"!==typeof document.addEventListener&&("undefined"!==typeof document.hidden?(b="visibilitychange",a="hidden"):"undefined"!==typeof document.mozHidden?(b="mozvisibilitychange",a="mozHidden"):"undefined"!==typeof document.msHidden?(b="msvisibilitychange",a="msHidden"):"undefined"!==typeof document.webkitHidden&&(b="webkitvisibilitychange",a="webkitHidden"));this.Mb=!0;if(b){var c=this;document.addEventListener(b,
3866
- function(){var b=!document[a];b!==c.Mb&&(c.Mb=b,c.Ge("visible",b))},!1)}}la(Ge,Ee);Ge.prototype.Ue=function(a){E("visible"===a,"Unknown event type: "+a);return[this.Mb]};ca(Ge);function He(){Ee.call(this,["online"]);this.hc=!0;if("undefined"!==typeof window&&"undefined"!==typeof window.addEventListener&&!tb()){var a=this;window.addEventListener("online",function(){a.hc||(a.hc=!0,a.Ge("online",!0))},!1);window.addEventListener("offline",function(){a.hc&&(a.hc=!1,a.Ge("online",!1))},!1)}}la(He,Ee);He.prototype.Ue=function(a){E("online"===a,"Unknown event type: "+a);return[this.hc]};ca(He);var Ie=function(){var a=0,b=[];return function(c){var d=c===a;a=c;for(var e=Array(8),f=7;0<=f;f--)e[f]="-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz".charAt(c%64),c=Math.floor(c/64);E(0===c,"Cannot push at time == 0");c=e.join("");if(d){for(f=11;0<=f&&63===b[f];f--)b[f]=0;b[f]++}else for(f=0;12>f;f++)b[f]=Math.floor(64*Math.random());for(f=0;12>f;f++)c+="-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz".charAt(b[f]);E(20===c.length,"nextPushId: Length should be 20.");
3867
- return c}}();function Je(a,b){this.value=a;this.children=b||Ke}var Ke=new gc(function(a,b){return a===b?0:a<b?-1:1});function Le(a){var b=Q;r(a,function(a,d){b=b.set(new L(d),a)});return b}g=Je.prototype;g.e=function(){return null===this.value&&this.children.e()};function Me(a,b,c){if(null!=a.value&&c(a.value))return{path:C,value:a.value};if(b.e())return null;var d=H(b);a=a.children.get(d);return null!==a?(b=Me(a,D(b),c),null!=b?{path:(new L(d)).n(b.path),value:b.value}:null):null}
3868
- function Ne(a,b){return Me(a,b,function(){return!0})}g.subtree=function(a){if(a.e())return this;var b=this.children.get(H(a));return null!==b?b.subtree(D(a)):Q};g.set=function(a,b){if(a.e())return new Je(b,this.children);var c=H(a),d=(this.children.get(c)||Q).set(D(a),b),c=this.children.Oa(c,d);return new Je(this.value,c)};
3869
- g.remove=function(a){if(a.e())return this.children.e()?Q:new Je(null,this.children);var b=H(a),c=this.children.get(b);return c?(a=c.remove(D(a)),b=a.e()?this.children.remove(b):this.children.Oa(b,a),null===this.value&&b.e()?Q:new Je(this.value,b)):this};g.get=function(a){if(a.e())return this.value;var b=this.children.get(H(a));return b?b.get(D(a)):null};
3870
- function Ed(a,b,c){if(b.e())return c;var d=H(b);b=Ed(a.children.get(d)||Q,D(b),c);d=b.e()?a.children.remove(d):a.children.Oa(d,b);return new Je(a.value,d)}function Oe(a,b){return Pe(a,C,b)}function Pe(a,b,c){var d={};a.children.ha(function(a,f){d[a]=Pe(f,b.n(a),c)});return c(b,a.value,d)}function Qe(a,b,c){return Re(a,b,C,c)}function Re(a,b,c,d){var e=a.value?d(c,a.value):!1;if(e)return e;if(b.e())return null;e=H(b);return(a=a.children.get(e))?Re(a,D(b),c.n(e),d):null}
3871
- function Se(a,b,c){Te(a,b,C,c)}function Te(a,b,c,d){if(b.e())return a;a.value&&d(c,a.value);var e=H(b);return(a=a.children.get(e))?Te(a,D(b),c.n(e),d):Q}function Cd(a,b){Ue(a,C,b)}function Ue(a,b,c){a.children.ha(function(a,e){Ue(e,b.n(a),c)});a.value&&c(b,a.value)}function Ve(a,b){a.children.ha(function(a,d){d.value&&b(a,d.value)})}var Q=new Je(null);Je.prototype.toString=function(){var a={};Cd(this,function(b,c){a[b.toString()]=c.toString()});return w(a)};function We(a,b,c){this.type=ud;this.source=Xe;this.path=a;this.Ob=b;this.Id=c}We.prototype.Mc=function(a){if(this.path.e()){if(null!=this.Ob.value)return E(this.Ob.children.e(),"affectedTree should not have overlapping affected paths."),this;a=this.Ob.subtree(new L(a));return new We(C,a,this.Id)}E(H(this.path)===a,"operationForChild called for unrelated child.");return new We(D(this.path),this.Ob,this.Id)};
3872
- We.prototype.toString=function(){return"Operation("+this.path+": "+this.source.toString()+" ack write revert="+this.Id+" affectedTree="+this.Ob+")"};var wb=0,bd=1,ud=2,yb=3;function Ye(a,b,c,d){this.ee=a;this.Se=b;this.Hb=c;this.Ee=d;E(!d||b,"Tagged queries must be from server.")}var Xe=new Ye(!0,!1,null,!1),Ze=new Ye(!1,!0,null,!1);Ye.prototype.toString=function(){return this.ee?"user":this.Ee?"server(queryID="+this.Hb+")":"server"};var $e=null;"undefined"!==typeof MozWebSocket?$e=MozWebSocket:"undefined"!==typeof WebSocket&&($e=WebSocket);function af(a,b,c,d){this.Zd=a;this.f=Ic(this.Zd);this.frames=this.zc=null;this.pb=this.qb=this.Fe=0;this.Va=kd(b);a={v:"5"};"undefined"!==typeof location&&location.href&&-1!==location.href.indexOf("firebaseio.com")&&(a.r="f");c&&(a.s=c);d&&(a.ls=d);this.Ke=Jb(b,"websocket",a)}var bf;
3873
- af.prototype.open=function(a,b){this.ib=b;this.Xf=a;this.f("Websocket connecting to "+this.Ke);this.wc=!1;Fb.set("previous_websocket_failure",!0);try{this.Ia=new $e(this.Ke)}catch(c){this.f("Error instantiating WebSocket.");var d=c.message||c.data;d&&this.f(d);this.bb();return}var e=this;this.Ia.onopen=function(){e.f("Websocket connected.");e.wc=!0};this.Ia.onclose=function(){e.f("Websocket connection was disconnected.");e.Ia=null;e.bb()};this.Ia.onmessage=function(a){if(null!==e.Ia)if(a=a.data,e.pb+=
3874
- a.length,Ab(e.Va,"bytes_received",a.length),cf(e),null!==e.frames)df(e,a);else{a:{E(null===e.frames,"We already have a frame buffer");if(6>=a.length){var b=Number(a);if(!isNaN(b)){e.Fe=b;e.frames=[];a=null;break a}}e.Fe=1;e.frames=[]}null!==a&&df(e,a)}};this.Ia.onerror=function(a){e.f("WebSocket error. Closing connection.");(a=a.message||a.data)&&e.f(a);e.bb()}};af.prototype.start=function(){};
3875
- af.isAvailable=function(){var a=!1;if("undefined"!==typeof navigator&&navigator.userAgent){var b=navigator.userAgent.match(/Android ([0-9]{0,}\.[0-9]{0,})/);b&&1<b.length&&4.4>parseFloat(b[1])&&(a=!0)}return!a&&null!==$e&&!bf};af.responsesRequiredToBeHealthy=2;af.healthyTimeout=3E4;g=af.prototype;g.sd=function(){Fb.remove("previous_websocket_failure")};function df(a,b){a.frames.push(b);if(a.frames.length==a.Fe){var c=a.frames.join("");a.frames=null;c=gb(c);a.Xf(c)}}
3876
- g.send=function(a){cf(this);a=w(a);this.qb+=a.length;Ab(this.Va,"bytes_sent",a.length);a=Sc(a,16384);1<a.length&&ef(this,String(a.length));for(var b=0;b<a.length;b++)ef(this,a[b])};g.Tc=function(){this.Ab=!0;this.zc&&(clearInterval(this.zc),this.zc=null);this.Ia&&(this.Ia.close(),this.Ia=null)};g.bb=function(){this.Ab||(this.f("WebSocket is closing itself"),this.Tc(),this.ib&&(this.ib(this.wc),this.ib=null))};g.close=function(){this.Ab||(this.f("WebSocket is being closed"),this.Tc())};
3877
- function cf(a){clearInterval(a.zc);a.zc=setInterval(function(){a.Ia&&ef(a,"0");cf(a)},Math.floor(45E3))}function ef(a,b){try{a.Ia.send(b)}catch(c){a.f("Exception thrown from WebSocket.send():",c.message||c.data,"Closing connection."),setTimeout(q(a.bb,a),0)}};function ff(a){gf(this,a)}var hf=[ge,af];function gf(a,b){var c=af&&af.isAvailable(),d=c&&!(Fb.Ze||!0===Fb.get("previous_websocket_failure"));b.qg&&(c||O("wss:// URL used, but browser isn't known to support websockets. Trying anyway."),d=!0);if(d)a.Wc=[af];else{var e=a.Wc=[];Tc(hf,function(a,b){b&&b.isAvailable()&&e.push(b)})}}function jf(a){if(0<a.Wc.length)return a.Wc[0];throw Error("No transports available");};function kf(a,b,c,d,e,f,h){this.id=a;this.f=Ic("c:"+this.id+":");this.te=c;this.Lc=d;this.ia=e;this.se=f;this.L=b;this.Ad=[];this.Le=0;this.sf=new ff(b);this.Ua=0;this.Cb=h;this.f("Connection created");lf(this)}
3878
- function lf(a){var b=jf(a.sf);a.I=new b("c:"+a.id+":"+a.Le++,a.L,void 0,a.Cb);a.xe=b.responsesRequiredToBeHealthy||0;var c=mf(a,a.I),d=nf(a,a.I);a.Xc=a.I;a.Rc=a.I;a.D=null;a.Bb=!1;setTimeout(function(){a.I&&a.I.open(c,d)},Math.floor(0));b=b.healthyTimeout||0;0<b&&(a.md=Xc(function(){a.md=null;a.Bb||(a.I&&102400<a.I.pb?(a.f("Connection exceeded healthy timeout but has received "+a.I.pb+" bytes. Marking connection healthy."),a.Bb=!0,a.I.sd()):a.I&&10240<a.I.qb?a.f("Connection exceeded healthy timeout but has sent "+
3879
- a.I.qb+" bytes. Leaving connection alive."):(a.f("Closing unhealthy connection after timeout."),a.close()))},Math.floor(b)))}function nf(a,b){return function(c){b===a.I?(a.I=null,c||0!==a.Ua?1===a.Ua&&a.f("Realtime connection lost."):(a.f("Realtime connection failed."),"s-"===a.L.$a.substr(0,2)&&(Fb.remove("host:"+a.L.host),a.L.$a=a.L.host)),a.close()):b===a.D?(a.f("Secondary connection lost."),c=a.D,a.D=null,a.Xc!==c&&a.Rc!==c||a.close()):a.f("closing an old connection")}}
3880
- function mf(a,b){return function(c){if(2!=a.Ua)if(b===a.Rc){var d=Qc("t",c);c=Qc("d",c);if("c"==d){if(d=Qc("t",c),"d"in c)if(c=c.d,"h"===d){var d=c.ts,e=c.v,f=c.h;a.qf=c.s;Ib(a.L,f);0==a.Ua&&(a.I.start(),of(a,a.I,d),"5"!==e&&O("Protocol version mismatch detected"),c=a.sf,(c=1<c.Wc.length?c.Wc[1]:null)&&pf(a,c))}else if("n"===d){a.f("recvd end transmission on primary");a.Rc=a.D;for(c=0;c<a.Ad.length;++c)a.wd(a.Ad[c]);a.Ad=[];qf(a)}else"s"===d?(a.f("Connection shutdown command received. Shutting down..."),
3881
- a.se&&(a.se(c),a.se=null),a.ia=null,a.close()):"r"===d?(a.f("Reset packet received. New host: "+c),Ib(a.L,c),1===a.Ua?a.close():(rf(a),lf(a))):"e"===d?Jc("Server Error: "+c):"o"===d?(a.f("got pong on primary."),sf(a),tf(a)):Jc("Unknown control packet command: "+d)}else"d"==d&&a.wd(c)}else if(b===a.D)if(d=Qc("t",c),c=Qc("d",c),"c"==d)"t"in c&&(c=c.t,"a"===c?uf(a):"r"===c?(a.f("Got a reset on secondary, closing it"),a.D.close(),a.Xc!==a.D&&a.Rc!==a.D||a.close()):"o"===c&&(a.f("got pong on secondary."),
3882
- a.pf--,uf(a)));else if("d"==d)a.Ad.push(c);else throw Error("Unknown protocol layer: "+d);else a.f("message on old connection")}}kf.prototype.ua=function(a){vf(this,{t:"d",d:a})};function qf(a){a.Xc===a.D&&a.Rc===a.D&&(a.f("cleaning up and promoting a connection: "+a.D.Zd),a.I=a.D,a.D=null)}
3883
- function uf(a){0>=a.pf?(a.f("Secondary connection is healthy."),a.Bb=!0,a.D.sd(),a.D.start(),a.f("sending client ack on secondary"),a.D.send({t:"c",d:{t:"a",d:{}}}),a.f("Ending transmission on primary"),a.I.send({t:"c",d:{t:"n",d:{}}}),a.Xc=a.D,qf(a)):(a.f("sending ping on secondary."),a.D.send({t:"c",d:{t:"p",d:{}}}))}kf.prototype.wd=function(a){sf(this);this.te(a)};function sf(a){a.Bb||(a.xe--,0>=a.xe&&(a.f("Primary connection is healthy."),a.Bb=!0,a.I.sd()))}
3884
- function pf(a,b){a.D=new b("c:"+a.id+":"+a.Le++,a.L,a.qf);a.pf=b.responsesRequiredToBeHealthy||0;a.D.open(mf(a,a.D),nf(a,a.D));Xc(function(){a.D&&(a.f("Timed out trying to upgrade."),a.D.close())},Math.floor(6E4))}function of(a,b,c){a.f("Realtime connection established.");a.I=b;a.Ua=1;a.Lc&&(a.Lc(c,a.qf),a.Lc=null);0===a.xe?(a.f("Primary connection is healthy."),a.Bb=!0):Xc(function(){tf(a)},Math.floor(5E3))}
3885
- function tf(a){a.Bb||1!==a.Ua||(a.f("sending ping on primary."),vf(a,{t:"c",d:{t:"p",d:{}}}))}function vf(a,b){if(1!==a.Ua)throw"Connection is not connected";a.Xc.send(b)}kf.prototype.close=function(){2!==this.Ua&&(this.f("Closing realtime connection."),this.Ua=2,rf(this),this.ia&&(this.ia(),this.ia=null))};function rf(a){a.f("Shutting down all connections");a.I&&(a.I.close(),a.I=null);a.D&&(a.D.close(),a.D=null);a.md&&(clearTimeout(a.md),a.md=null)};function wf(a,b,c,d,e,f){this.id=xf++;this.f=Ic("p:"+this.id+":");this.qd={};this.$={};this.pa=[];this.Oc=0;this.Kc=[];this.ma=!1;this.Sa=1E3;this.td=3E5;this.Gb=b;this.Jc=c;this.ue=d;this.L=a;this.ob=this.Fa=this.Cb=this.ze=null;this.$c=e;this.de=!1;this.ke=0;if(f)throw Error("Auth override specified in options, but not supported on non Node.js platforms");this.Vd=f;this.ub=null;this.Mb=!1;this.Gd={};this.ig=0;this.Re=!0;this.Ac=this.me=null;yf(this,0);Ge.Vb().gc("visible",this.Zf,this);-1===a.host.indexOf("fblocal")&&
3886
- He.Vb().gc("online",this.Yf,this)}var xf=0,zf=0;g=wf.prototype;g.ua=function(a,b,c){var d=++this.ig;a={r:d,a:a,b:b};this.f(w(a));E(this.ma,"sendRequest call when we're not connected not allowed.");this.Fa.ua(a);c&&(this.Gd[d]=c)};
3887
- g.$e=function(a,b,c,d){var e=a.ja(),f=a.path.toString();this.f("Listen called for "+f+" "+e);this.$[f]=this.$[f]||{};E(ed(a.m)||!V(a.m),"listen() called for non-default but complete query");E(!this.$[f][e],"listen() called twice for same path/queryId.");a={G:d,ld:b,eg:a,tag:c};this.$[f][e]=a;this.ma&&Af(this,a)};
3888
- function Af(a,b){var c=b.eg,d=c.path.toString(),e=c.ja();a.f("Listen on "+d+" for "+e);var f={p:d};b.tag&&(f.q=Bf(c.m),f.t=b.tag);f.h=b.ld();a.ua("q",f,function(f){var k=f.d,l=f.s;if(k&&"object"===typeof k&&ib(k,"w")){var m=B(k,"w");ea(m)&&0<=xa(m,"no_index")&&O("Using an unspecified index. Consider adding "+('".indexOn": "'+c.m.g.toString()+'"')+" at "+c.path.toString()+" to your security rules for better performance")}(a.$[d]&&a.$[d][e])===b&&(a.f("listen response",f),"ok"!==l&&Cf(a,d,e),b.G&&b.G(l,
3889
- k))})}g.kf=function(a){this.ob=a;this.f("Auth token refreshed");this.ob?Df(this):this.ma&&this.ua("unauth",{},function(){});if(a&&40===a.length||$c(a))this.f("Admin auth credential detected. Reducing max reconnect time."),this.td=3E4};function Df(a){if(a.ma&&a.ob){var b=a.ob,c=Zc(b)?"auth":"gauth",d={cred:b};null===a.Vd?d.noauth=!0:"object"===typeof a.Vd&&(d.authvar=a.Vd);a.ua(c,d,function(c){var d=c.s;c=c.d||"error";a.ob===b&&("ok"===d?a.ke=0:Ef(a,d,c))})}}
3890
- g.uf=function(a,b){var c=a.path.toString(),d=a.ja();this.f("Unlisten called for "+c+" "+d);E(ed(a.m)||!V(a.m),"unlisten() called for non-default but complete query");if(Cf(this,c,d)&&this.ma){var e=Bf(a.m);this.f("Unlisten on "+c+" for "+d);c={p:c};b&&(c.q=e,c.t=b);this.ua("n",c)}};g.re=function(a,b,c){this.ma?Ff(this,"o",a,b,c):this.Kc.push({we:a,action:"o",data:b,G:c})};g.cf=function(a,b,c){this.ma?Ff(this,"om",a,b,c):this.Kc.push({we:a,action:"om",data:b,G:c})};
3891
- g.xd=function(a,b){this.ma?Ff(this,"oc",a,null,b):this.Kc.push({we:a,action:"oc",data:null,G:b})};function Ff(a,b,c,d,e){c={p:c,d:d};a.f("onDisconnect "+b,c);a.ua(b,c,function(a){e&&setTimeout(function(){e(a.s,a.d)},Math.floor(0))})}g.put=function(a,b,c,d){Gf(this,"p",a,b,c,d)};g.af=function(a,b,c,d){Gf(this,"m",a,b,c,d)};function Gf(a,b,c,d,e,f){d={p:c,d:d};n(f)&&(d.h=f);a.pa.push({action:b,mf:d,G:e});a.Oc++;b=a.pa.length-1;a.ma?Hf(a,b):a.f("Buffering put: "+c)}
3892
- function Hf(a,b){var c=a.pa[b].action,d=a.pa[b].mf,e=a.pa[b].G;a.pa[b].fg=a.ma;a.ua(c,d,function(d){a.f(c+" response",d);delete a.pa[b];a.Oc--;0===a.Oc&&(a.pa=[]);e&&e(d.s,d.d)})}g.ye=function(a){this.ma&&(a={c:a},this.f("reportStats",a),this.ua("s",a,function(a){"ok"!==a.s&&this.f("reportStats","Error sending stats: "+a.d)}))};
3893
- g.wd=function(a){if("r"in a){this.f("from server: "+w(a));var b=a.r,c=this.Gd[b];c&&(delete this.Gd[b],c(a.b))}else{if("error"in a)throw"A server-side error has occurred: "+a.error;"a"in a&&(b=a.a,a=a.b,this.f("handleServerMessage",b,a),"d"===b?this.Gb(a.p,a.d,!1,a.t):"m"===b?this.Gb(a.p,a.d,!0,a.t):"c"===b?If(this,a.p,a.q):"ac"===b?Ef(this,a.s,a.d):"sd"===b?this.ze?this.ze(a):"msg"in a&&"undefined"!==typeof console&&console.log("FIREBASE: "+a.msg.replace("\n","\nFIREBASE: ")):Jc("Unrecognized action received from server: "+
3894
- w(b)+"\nAre you using the latest client?"))}};g.Lc=function(a,b){this.f("connection ready");this.ma=!0;this.Ac=(new Date).getTime();this.ue({serverTimeOffset:a-(new Date).getTime()});this.Cb=b;if(this.Re){var c={};c["sdk.js."+firebase.SDK_VERSION.replace(/\./g,"-")]=1;tb()?c["framework.cordova"]=1:"object"===typeof navigator&&"ReactNative"===navigator.product&&(c["framework.reactnative"]=1);this.ye(c)}Jf(this);this.Re=!1;this.Jc(!0)};
3895
- function yf(a,b){E(!a.Fa,"Scheduling a connect when we're already connected/ing?");a.ub&&clearTimeout(a.ub);a.ub=setTimeout(function(){a.ub=null;Kf(a)},Math.floor(b))}g.Zf=function(a){a&&!this.Mb&&this.Sa===this.td&&(this.f("Window became visible. Reducing delay."),this.Sa=1E3,this.Fa||yf(this,0));this.Mb=a};g.Yf=function(a){a?(this.f("Browser went online."),this.Sa=1E3,this.Fa||yf(this,0)):(this.f("Browser went offline. Killing connection."),this.Fa&&this.Fa.close())};
3896
- g.df=function(){this.f("data client disconnected");this.ma=!1;this.Fa=null;for(var a=0;a<this.pa.length;a++){var b=this.pa[a];b&&"h"in b.mf&&b.fg&&(b.G&&b.G("disconnect"),delete this.pa[a],this.Oc--)}0===this.Oc&&(this.pa=[]);this.Gd={};Lf(this)&&(this.Mb?this.Ac&&(3E4<(new Date).getTime()-this.Ac&&(this.Sa=1E3),this.Ac=null):(this.f("Window isn't visible. Delaying reconnect."),this.Sa=this.td,this.me=(new Date).getTime()),a=Math.max(0,this.Sa-((new Date).getTime()-this.me)),a*=Math.random(),this.f("Trying to reconnect in "+
3897
- a+"ms"),yf(this,a),this.Sa=Math.min(this.td,1.3*this.Sa));this.Jc(!1)};
3898
- function Kf(a){if(Lf(a)){a.f("Making a connection attempt");a.me=(new Date).getTime();a.Ac=null;var b=q(a.wd,a),c=q(a.Lc,a),d=q(a.df,a),e=a.id+":"+zf++,f=a.Cb,h=!1,k=null,l=function(){k?k.close():(h=!0,d())};a.Fa={close:l,ua:function(a){E(k,"sendRequest call when we're not connected not allowed.");k.ua(a)}};var m=a.de;a.de=!1;a.$c.getToken(m).then(function(l){h?G("getToken() completed but was canceled"):(G("getToken() completed. Creating connection."),a.ob=l&&l.accessToken,k=new kf(e,a.L,b,c,d,function(b){O(b+
3899
- " ("+a.L.toString()+")");a.ab("server_kill")},f))}).then(null,function(b){a.f("Failed to get token: "+b);h||l()})}}g.ab=function(a){G("Interrupting connection for reason: "+a);this.qd[a]=!0;this.Fa?this.Fa.close():(this.ub&&(clearTimeout(this.ub),this.ub=null),this.ma&&this.df())};g.kc=function(a){G("Resuming connection for reason: "+a);delete this.qd[a];va(this.qd)&&(this.Sa=1E3,this.Fa||yf(this,0))};
3900
- function If(a,b,c){c=c?Aa(c,function(a){return Rc(a)}).join("$"):"default";(a=Cf(a,b,c))&&a.G&&a.G("permission_denied")}function Cf(a,b,c){b=(new L(b)).toString();var d;n(a.$[b])?(d=a.$[b][c],delete a.$[b][c],0===oa(a.$[b])&&delete a.$[b]):d=void 0;return d}
3901
- function Ef(a,b,c){G("Auth token revoked: "+b+"/"+c);a.ob=null;a.de=!0;a.Fa.close();"invalid_token"===b&&(a.ke++,3<=a.ke&&(a.Sa=3E4,a=a.$c,b='Provided authentication credentials for the app named "'+a.oc.name+'" are invalid. This usually indicates your app was not initialized correctly. ',b="credential"in a.oc.options?b+'Make sure the "credential" property provided to initializeApp() is authorized to access the specified "databaseURL" and is from the correct project.':"serviceAccount"in a.oc.options?
3902
- b+'Make sure the "serviceAccount" property provided to initializeApp() is authorized to access the specified "databaseURL" and is from the correct project.':b+'Make sure the "apiKey" and "databaseURL" properties provided to initializeApp() match the values provided for your app at https://console.firebase.google.com/.',O(b)))}
3903
- function Jf(a){Df(a);r(a.$,function(b){r(b,function(b){Af(a,b)})});for(var b=0;b<a.pa.length;b++)a.pa[b]&&Hf(a,b);for(;a.Kc.length;)b=a.Kc.shift(),Ff(a,b.action,b.we,b.data,b.G)}function Lf(a){var b;b=He.Vb().hc;return va(a.qd)&&b};var W={Mf:function(){he=bf=!0}};W.forceLongPolling=W.Mf;W.Nf=function(){ie=!0};W.forceWebSockets=W.Nf;W.Tf=function(){return af.isAvailable()};W.isWebSocketsAvailable=W.Tf;W.lg=function(a,b){a.u.Ra.ze=b};W.setSecurityDebugCallback=W.lg;W.Be=function(a,b){a.u.Be(b)};W.stats=W.Be;W.Ce=function(a,b){a.u.Ce(b)};W.statsIncrementCounter=W.Ce;W.fd=function(a){return a.u.fd};W.dataUpdateCount=W.fd;W.Sf=function(a,b){a.u.je=b};W.interceptServerData=W.Sf;function R(a,b){this.name=a;this.R=b}function Mf(a,b){return new R(a,b)};function Nf(a){this.V=a;this.g=a.m.g}function Of(a,b,c,d){var e=[],f=[];ya(b,function(b){"child_changed"===b.type&&a.g.nd(b.qe,b.Ja)&&f.push(new I("child_moved",b.Ja,b.Xa))});Pf(a,e,"child_removed",b,d,c);Pf(a,e,"child_added",b,d,c);Pf(a,e,"child_moved",f,d,c);Pf(a,e,"child_changed",b,d,c);Pf(a,e,ac,b,d,c);return e}function Pf(a,b,c,d,e,f){d=za(d,function(a){return a.type===c});Ha(d,q(a.Ff,a));ya(d,function(c){var d=Qf(a,c,f);ya(e,function(e){e.nf(c.type)&&b.push(e.createEvent(d,a.V))})})}
3904
- function Qf(a,b,c){"value"!==b.type&&"child_removed"!==b.type&&(b.Dd=c.Ve(b.Xa,b.Ja,a.g));return b}Nf.prototype.Ff=function(a,b){if(null==a.Xa||null==b.Xa)throw Cc("Should only compare child_ events.");return this.g.compare(new R(a.Xa,a.Ja),new R(b.Xa,b.Ja))};function Rf(a){this.sa=new Id(a);this.g=a.g;E(a.xa,"Only valid if limit has been set");this.oa=a.oa;this.Ib=!Sf(a)}g=Rf.prototype;g.F=function(a,b,c,d,e,f){this.sa.matches(new R(b,c))||(c=J);return a.Q(b).Z(c)?a:a.Eb()<this.oa?this.sa.Ub().F(a,b,c,d,e,f):Tf(this,a,b,c,e,f)};
3905
- g.ya=function(a,b,c){var d;if(b.J()||b.e())d=J.nb(this.g);else if(2*this.oa<b.Eb()&&b.yc(this.g)){d=J.nb(this.g);b=this.Ib?b.Zb(this.sa.vc,this.g):b.Xb(this.sa.Uc,this.g);for(var e=0;0<b.Pa.length&&e<this.oa;){var f=K(b),h;if(h=this.Ib?0>=this.g.compare(this.sa.Uc,f):0>=this.g.compare(f,this.sa.vc))d=d.T(f.name,f.R),e++;else break}}else{d=b.nb(this.g);d=d.fa(J);var k,l,m;if(this.Ib){b=d.We(this.g);k=this.sa.vc;l=this.sa.Uc;var u=Uf(this.g);m=function(a,b){return u(b,a)}}else b=d.Wb(this.g),k=this.sa.Uc,
3906
- l=this.sa.vc,m=Uf(this.g);for(var e=0,z=!1;0<b.Pa.length;)f=K(b),!z&&0>=m(k,f)&&(z=!0),(h=z&&e<this.oa&&0>=m(f,l))?e++:d=d.T(f.name,J)}return this.sa.Ub().ya(a,d,c)};g.fa=function(a){return a};g.Na=function(){return!0};g.Ub=function(){return this.sa.Ub()};
3907
- function Tf(a,b,c,d,e,f){var h;if(a.Ib){var k=Uf(a.g);h=function(a,b){return k(b,a)}}else h=Uf(a.g);E(b.Eb()==a.oa,"");var l=new R(c,d),m=a.Ib?Vf(b,a.g):Wf(b,a.g),u=a.sa.matches(l);if(b.Da(c)){for(var z=b.Q(c),m=e.fe(a.g,m,a.Ib);null!=m&&(m.name==c||b.Da(m.name));)m=e.fe(a.g,m,a.Ib);e=null==m?1:h(m,l);if(u&&!d.e()&&0<=e)return null!=f&&Gd(f,new I("child_changed",d,c,z)),b.T(c,d);null!=f&&Gd(f,new I("child_removed",z,c));b=b.T(c,J);return null!=m&&a.sa.matches(m)?(null!=f&&Gd(f,new I("child_added",
3908
- m.R,m.name)),b.T(m.name,m.R)):b}return d.e()?b:u&&0<=h(m,l)?(null!=f&&(Gd(f,new I("child_removed",m.R,m.name)),Gd(f,new I("child_added",d,c))),b.T(c,d).T(m.name,J)):b};function Ac(a,b){this.B=a;E(n(this.B)&&null!==this.B,"LeafNode shouldn't be created with null/undefined value.");this.aa=b||J;Xf(this.aa);this.Db=null}var Yf=["object","boolean","number","string"];g=Ac.prototype;g.J=function(){return!0};g.C=function(){return this.aa};g.fa=function(a){return new Ac(this.B,a)};g.Q=function(a){return".priority"===a?this.aa:J};g.P=function(a){return a.e()?this:".priority"===H(a)?this.aa:J};g.Da=function(){return!1};g.Ve=function(){return null};
3909
- g.T=function(a,b){return".priority"===a?this.fa(b):b.e()&&".priority"!==a?this:J.T(a,b).fa(this.aa)};g.F=function(a,b){var c=H(a);if(null===c)return b;if(b.e()&&".priority"!==c)return this;E(".priority"!==c||1===Ad(a),".priority must be the last token in a path");return this.T(c,J.F(D(a),b))};g.e=function(){return!1};g.Eb=function(){return 0};g.O=function(){return!1};g.H=function(a){return a&&!this.C().e()?{".value":this.Ca(),".priority":this.C().H()}:this.Ca()};
3910
- g.hash=function(){if(null===this.Db){var a="";this.aa.e()||(a+="priority:"+Zf(this.aa.H())+":");var b=typeof this.B,a=a+(b+":"),a="number"===b?a+Uc(this.B):a+this.B;this.Db=Ec(a)}return this.Db};g.Ca=function(){return this.B};g.sc=function(a){if(a===J)return 1;if(a instanceof P)return-1;E(a.J(),"Unknown node type");var b=typeof a.B,c=typeof this.B,d=xa(Yf,b),e=xa(Yf,c);E(0<=d,"Unknown leaf type: "+b);E(0<=e,"Unknown leaf type: "+c);return d===e?"object"===c?0:this.B<a.B?-1:this.B===a.B?0:1:e-d};
3911
- g.nb=function(){return this};g.yc=function(){return!0};g.Z=function(a){return a===this?!0:a.J()?this.B===a.B&&this.aa.Z(a.aa):!1};g.toString=function(){return w(this.H(!0))};function $f(a,b){return Oc(a.name,b.name)}function ag(a,b){return Oc(a,b)};function bg(){}var cg={};function Uf(a){return q(a.compare,a)}bg.prototype.nd=function(a,b){return 0!==this.compare(new R("[MIN_NAME]",a),new R("[MIN_NAME]",b))};bg.prototype.Hc=function(){return dg};function eg(a){E(!a.e()&&".priority"!==H(a),"Can't create PathIndex with empty path or .priority key");this.bc=a}la(eg,bg);g=eg.prototype;g.xc=function(a){return!a.P(this.bc).e()};g.compare=function(a,b){var c=a.R.P(this.bc),d=b.R.P(this.bc),c=c.sc(d);return 0===c?Oc(a.name,b.name):c};
3912
- g.Ec=function(a,b){var c=M(a),c=J.F(this.bc,c);return new R(b,c)};g.Fc=function(){var a=J.F(this.bc,fg);return new R("[MAX_NAME]",a)};g.toString=function(){return this.bc.slice().join("/")};function gg(){}la(gg,bg);g=gg.prototype;g.compare=function(a,b){var c=a.R.C(),d=b.R.C(),c=c.sc(d);return 0===c?Oc(a.name,b.name):c};g.xc=function(a){return!a.C().e()};g.nd=function(a,b){return!a.C().Z(b.C())};g.Hc=function(){return dg};g.Fc=function(){return new R("[MAX_NAME]",new Ac("[PRIORITY-POST]",fg))};
3913
- g.Ec=function(a,b){var c=M(a);return new R(b,new Ac("[PRIORITY-POST]",c))};g.toString=function(){return".priority"};var N=new gg;function hg(){}la(hg,bg);g=hg.prototype;g.compare=function(a,b){return Oc(a.name,b.name)};g.xc=function(){throw Cc("KeyIndex.isDefinedOn not expected to be called.");};g.nd=function(){return!1};g.Hc=function(){return dg};g.Fc=function(){return new R("[MAX_NAME]",J)};g.Ec=function(a){E(p(a),"KeyIndex indexValue must always be a string.");return new R(a,J)};g.toString=function(){return".key"};
3914
- var Fd=new hg;function ig(){}la(ig,bg);g=ig.prototype;g.compare=function(a,b){var c=a.R.sc(b.R);return 0===c?Oc(a.name,b.name):c};g.xc=function(){return!0};g.nd=function(a,b){return!a.Z(b)};g.Hc=function(){return dg};g.Fc=function(){return jg};g.Ec=function(a,b){var c=M(a);return new R(b,c)};g.toString=function(){return".value"};var kg=new ig;function lg(){this.Rb=this.na=this.Kb=this.ka=this.xa=!1;this.oa=0;this.mb="";this.dc=null;this.zb="";this.ac=null;this.xb="";this.g=N}var mg=new lg;function Sf(a){return""===a.mb?a.ka:"l"===a.mb}function Kd(a){E(a.ka,"Only valid if start has been set");return a.dc}function Jd(a){E(a.ka,"Only valid if start has been set");return a.Kb?a.zb:"[MIN_NAME]"}function Md(a){E(a.na,"Only valid if end has been set");return a.ac}
3915
- function Ld(a){E(a.na,"Only valid if end has been set");return a.Rb?a.xb:"[MAX_NAME]"}function ng(a){var b=new lg;b.xa=a.xa;b.oa=a.oa;b.ka=a.ka;b.dc=a.dc;b.Kb=a.Kb;b.zb=a.zb;b.na=a.na;b.ac=a.ac;b.Rb=a.Rb;b.xb=a.xb;b.g=a.g;b.mb=a.mb;return b}g=lg.prototype;g.ne=function(a){var b=ng(this);b.xa=!0;b.oa=a;b.mb="l";return b};g.oe=function(a){var b=ng(this);b.xa=!0;b.oa=a;b.mb="r";return b};g.Nd=function(a,b){var c=ng(this);c.ka=!0;n(a)||(a=null);c.dc=a;null!=b?(c.Kb=!0,c.zb=b):(c.Kb=!1,c.zb="");return c};
3916
- g.gd=function(a,b){var c=ng(this);c.na=!0;n(a)||(a=null);c.ac=a;n(b)?(c.Rb=!0,c.xb=b):(c.vg=!1,c.xb="");return c};function og(a,b){var c=ng(a);c.g=b;return c}function Bf(a){var b={};a.ka&&(b.sp=a.dc,a.Kb&&(b.sn=a.zb));a.na&&(b.ep=a.ac,a.Rb&&(b.en=a.xb));if(a.xa){b.l=a.oa;var c=a.mb;""===c&&(c=Sf(a)?"l":"r");b.vf=c}a.g!==N&&(b.i=a.g.toString());return b}function V(a){return!(a.ka||a.na||a.xa)}function ed(a){return V(a)&&a.g==N}
3917
- function fd(a){var b={};if(ed(a))return b;var c;a.g===N?c="$priority":a.g===kg?c="$value":a.g===Fd?c="$key":(E(a.g instanceof eg,"Unrecognized index type!"),c=a.g.toString());b.orderBy=w(c);a.ka&&(b.startAt=w(a.dc),a.Kb&&(b.startAt+=","+w(a.zb)));a.na&&(b.endAt=w(a.ac),a.Rb&&(b.endAt+=","+w(a.xb)));a.xa&&(Sf(a)?b.limitToFirst=a.oa:b.limitToLast=a.oa);return b}g.toString=function(){return w(Bf(this))};function wc(){this.k=this.B=null}wc.prototype.find=function(a){if(null!=this.B)return this.B.P(a);if(a.e()||null==this.k)return null;var b=H(a);a=D(a);return this.k.contains(b)?this.k.get(b).find(a):null};function yc(a,b,c){if(b.e())a.B=c,a.k=null;else if(null!==a.B)a.B=a.B.F(b,c);else{null==a.k&&(a.k=new ee);var d=H(b);a.k.contains(d)||a.k.add(d,new wc);a=a.k.get(d);b=D(b);yc(a,b,c)}}
3918
- function pg(a,b){if(b.e())return a.B=null,a.k=null,!0;if(null!==a.B){if(a.B.J())return!1;var c=a.B;a.B=null;c.O(N,function(b,c){yc(a,new L(b),c)});return pg(a,b)}return null!==a.k?(c=H(b),b=D(b),a.k.contains(c)&&pg(a.k.get(c),b)&&a.k.remove(c),a.k.e()?(a.k=null,!0):!1):!0}function xc(a,b,c){null!==a.B?c(b,a.B):a.O(function(a,e){var f=new L(b.toString()+"/"+a);xc(e,f,c)})}wc.prototype.O=function(a){null!==this.k&&fe(this.k,function(b,c){a(b,c)})};function qg(a,b){this.od=a;this.cc=b}qg.prototype.get=function(a){var b=B(this.od,a);if(!b)throw Error("No index defined for "+a);return b===cg?null:b};function rg(a,b,c){var d=ma(a.od,function(d,f){var h=B(a.cc,f);E(h,"Missing index implementation for "+f);if(d===cg){if(h.xc(b.R)){for(var k=[],l=c.Wb(Mf),m=K(l);m;)m.name!=b.name&&k.push(m),m=K(l);k.push(b);return sg(k,Uf(h))}return cg}h=c.get(b.name);k=d;h&&(k=k.remove(new R(b.name,h)));return k.Oa(b,b.R)});return new qg(d,a.cc)}
3919
- function tg(a,b,c){var d=ma(a.od,function(a){if(a===cg)return a;var d=c.get(b.name);return d?a.remove(new R(b.name,d)):a});return new qg(d,a.cc)}var ug=new qg({".priority":cg},{".priority":N});function P(a,b,c){this.k=a;(this.aa=b)&&Xf(this.aa);a.e()&&E(!this.aa||this.aa.e(),"An empty node cannot have a priority");this.yb=c;this.Db=null}g=P.prototype;g.J=function(){return!1};g.C=function(){return this.aa||J};g.fa=function(a){return this.k.e()?this:new P(this.k,a,this.yb)};g.Q=function(a){if(".priority"===a)return this.C();a=this.k.get(a);return null===a?J:a};g.P=function(a){var b=H(a);return null===b?this:this.Q(b).P(D(a))};g.Da=function(a){return null!==this.k.get(a)};
3920
- g.T=function(a,b){E(b,"We should always be passing snapshot nodes");if(".priority"===a)return this.fa(b);var c=new R(a,b),d,e;b.e()?(d=this.k.remove(a),c=tg(this.yb,c,this.k)):(d=this.k.Oa(a,b),c=rg(this.yb,c,this.k));e=d.e()?J:this.aa;return new P(d,e,c)};g.F=function(a,b){var c=H(a);if(null===c)return b;E(".priority"!==H(a)||1===Ad(a),".priority must be the last token in a path");var d=this.Q(c).F(D(a),b);return this.T(c,d)};g.e=function(){return this.k.e()};g.Eb=function(){return this.k.count()};
3921
- var vg=/^(0|[1-9]\d*)$/;g=P.prototype;g.H=function(a){if(this.e())return null;var b={},c=0,d=0,e=!0;this.O(N,function(f,h){b[f]=h.H(a);c++;e&&vg.test(f)?d=Math.max(d,Number(f)):e=!1});if(!a&&e&&d<2*c){var f=[],h;for(h in b)f[h]=b[h];return f}a&&!this.C().e()&&(b[".priority"]=this.C().H());return b};g.hash=function(){if(null===this.Db){var a="";this.C().e()||(a+="priority:"+Zf(this.C().H())+":");this.O(N,function(b,c){var d=c.hash();""!==d&&(a+=":"+b+":"+d)});this.Db=""===a?"":Ec(a)}return this.Db};
3922
- g.Ve=function(a,b,c){return(c=wg(this,c))?(a=ic(c,new R(a,b)))?a.name:null:ic(this.k,a)};function Vf(a,b){var c;c=(c=wg(a,b))?(c=c.Gc())&&c.name:a.k.Gc();return c?new R(c,a.k.get(c)):null}function Wf(a,b){var c;c=(c=wg(a,b))?(c=c.ec())&&c.name:a.k.ec();return c?new R(c,a.k.get(c)):null}g.O=function(a,b){var c=wg(this,a);return c?c.ha(function(a){return b(a.name,a.R)}):this.k.ha(b)};g.Wb=function(a){return this.Xb(a.Hc(),a)};
3923
- g.Xb=function(a,b){var c=wg(this,b);if(c)return c.Xb(a,function(a){return a});for(var c=this.k.Xb(a.name,Mf),d=kc(c);null!=d&&0>b.compare(d,a);)K(c),d=kc(c);return c};g.We=function(a){return this.Zb(a.Fc(),a)};g.Zb=function(a,b){var c=wg(this,b);if(c)return c.Zb(a,function(a){return a});for(var c=this.k.Zb(a.name,Mf),d=kc(c);null!=d&&0<b.compare(d,a);)K(c),d=kc(c);return c};g.sc=function(a){return this.e()?a.e()?0:-1:a.J()||a.e()?1:a===fg?-1:0};
3924
- g.nb=function(a){if(a===Fd||sa(this.yb.cc,a.toString()))return this;var b=this.yb,c=this.k;E(a!==Fd,"KeyIndex always exists and isn't meant to be added to the IndexMap.");for(var d=[],e=!1,c=c.Wb(Mf),f=K(c);f;)e=e||a.xc(f.R),d.push(f),f=K(c);d=e?sg(d,Uf(a)):cg;e=a.toString();c=wa(b.cc);c[e]=a;a=wa(b.od);a[e]=d;return new P(this.k,this.aa,new qg(a,c))};g.yc=function(a){return a===Fd||sa(this.yb.cc,a.toString())};
3925
- g.Z=function(a){if(a===this)return!0;if(a.J())return!1;if(this.C().Z(a.C())&&this.k.count()===a.k.count()){var b=this.Wb(N);a=a.Wb(N);for(var c=K(b),d=K(a);c&&d;){if(c.name!==d.name||!c.R.Z(d.R))return!1;c=K(b);d=K(a)}return null===c&&null===d}return!1};function wg(a,b){return b===Fd?null:a.yb.get(b.toString())}g.toString=function(){return w(this.H(!0))};function M(a,b){if(null===a)return J;var c=null;"object"===typeof a&&".priority"in a?c=a[".priority"]:"undefined"!==typeof b&&(c=b);E(null===c||"string"===typeof c||"number"===typeof c||"object"===typeof c&&".sv"in c,"Invalid priority type found: "+typeof c);"object"===typeof a&&".value"in a&&null!==a[".value"]&&(a=a[".value"]);if("object"!==typeof a||".sv"in a)return new Ac(a,M(c));if(a instanceof Array){var d=J,e=a;r(e,function(a,b){if(ib(e,b)&&"."!==b.substring(0,1)){var c=M(a);if(c.J()||!c.e())d=
3926
- d.T(b,c)}});return d.fa(M(c))}var f=[],h=!1,k=a;jb(k,function(a){if("string"!==typeof a||"."!==a.substring(0,1)){var b=M(k[a]);b.e()||(h=h||!b.C().e(),f.push(new R(a,b)))}});if(0==f.length)return J;var l=sg(f,$f,function(a){return a.name},ag);if(h){var m=sg(f,Uf(N));return new P(l,M(c),new qg({".priority":m},{".priority":N}))}return new P(l,M(c),ug)}var xg=Math.log(2);
3927
- function yg(a){this.count=parseInt(Math.log(a+1)/xg,10);this.Oe=this.count-1;this.Cf=a+1&parseInt(Array(this.count+1).join("1"),2)}function zg(a){var b=!(a.Cf&1<<a.Oe);a.Oe--;return b}
3928
- function sg(a,b,c,d){function e(b,d){var f=d-b;if(0==f)return null;if(1==f){var m=a[b],u=c?c(m):m;return new lc(u,m.R,!1,null,null)}var m=parseInt(f/2,10)+b,f=e(b,m),z=e(m+1,d),m=a[m],u=c?c(m):m;return new lc(u,m.R,!1,f,z)}a.sort(b);var f=function(b){function d(b,h){var k=u-b,z=u;u-=b;var z=e(k+1,z),k=a[k],F=c?c(k):k,z=new lc(F,k.R,h,null,z);f?f.left=z:m=z;f=z}for(var f=null,m=null,u=a.length,z=0;z<b.count;++z){var F=zg(b),td=Math.pow(2,b.count-(z+1));F?d(td,!1):(d(td,!1),d(td,!0))}return m}(new yg(a.length));
3929
- return null!==f?new gc(d||b,f):new gc(d||b)}function Zf(a){return"number"===typeof a?"number:"+Uc(a):"string:"+a}function Xf(a){if(a.J()){var b=a.H();E("string"===typeof b||"number"===typeof b||"object"===typeof b&&ib(b,".sv"),"Priority must be a string or number.")}else E(a===fg||a.e(),"priority of unexpected type.");E(a===fg||a.C().e(),"Priority nodes can't have a priority of their own.")}var J=new P(new gc(ag),null,ug);function Ag(){P.call(this,new gc(ag),J,ug)}la(Ag,P);g=Ag.prototype;
3930
- g.sc=function(a){return a===this?0:1};g.Z=function(a){return a===this};g.C=function(){return this};g.Q=function(){return J};g.e=function(){return!1};var fg=new Ag,dg=new R("[MIN_NAME]",J),jg=new R("[MAX_NAME]",fg);function X(a,b,c){this.A=a;this.V=b;this.g=c}X.prototype.H=function(){x("Firebase.DataSnapshot.val",0,0,arguments.length);return this.A.H()};X.prototype.val=X.prototype.H;X.prototype.be=function(){x("Firebase.DataSnapshot.exportVal",0,0,arguments.length);return this.A.H(!0)};X.prototype.exportVal=X.prototype.be;X.prototype.toJSON=function(){x("Firebase.DataSnapshot.toJSON",0,1,arguments.length);return this.be()};X.prototype.toJSON=X.prototype.toJSON;
3931
- X.prototype.Lf=function(){x("Firebase.DataSnapshot.exists",0,0,arguments.length);return!this.A.e()};X.prototype.exists=X.prototype.Lf;X.prototype.n=function(a){x("Firebase.DataSnapshot.child",0,1,arguments.length);ga(a)&&(a=String(a));ze("Firebase.DataSnapshot.child",a);var b=new L(a),c=this.V.n(b);return new X(this.A.P(b),c,N)};X.prototype.child=X.prototype.n;
3932
- X.prototype.Da=function(a){x("Firebase.DataSnapshot.hasChild",1,1,arguments.length);ze("Firebase.DataSnapshot.hasChild",a);var b=new L(a);return!this.A.P(b).e()};X.prototype.hasChild=X.prototype.Da;X.prototype.C=function(){x("Firebase.DataSnapshot.getPriority",0,0,arguments.length);return this.A.C().H()};X.prototype.getPriority=X.prototype.C;
3933
- X.prototype.forEach=function(a){x("Firebase.DataSnapshot.forEach",1,1,arguments.length);A("Firebase.DataSnapshot.forEach",1,a,!1);if(this.A.J())return!1;var b=this;return!!this.A.O(this.g,function(c,d){return a(new X(d,b.V.n(c),N))})};X.prototype.forEach=X.prototype.forEach;X.prototype.kd=function(){x("Firebase.DataSnapshot.hasChildren",0,0,arguments.length);return this.A.J()?!1:!this.A.e()};X.prototype.hasChildren=X.prototype.kd;
3934
- X.prototype.getKey=function(){x("Firebase.DataSnapshot.key",0,0,arguments.length);return this.V.getKey()};Wc(X.prototype,"key",X.prototype.getKey);X.prototype.Eb=function(){x("Firebase.DataSnapshot.numChildren",0,0,arguments.length);return this.A.Eb()};X.prototype.numChildren=X.prototype.Eb;X.prototype.wb=function(){x("Firebase.DataSnapshot.ref",0,0,arguments.length);return this.V};Wc(X.prototype,"ref",X.prototype.wb);function yd(a,b){this.N=a;this.Ld=b}function vd(a,b,c,d){return new yd(new Mb(b,c,d),a.Ld)}function zd(a){return a.N.da?a.N.j():null}yd.prototype.w=function(){return this.Ld};function ec(a){return a.Ld.da?a.Ld.j():null};function Bg(a,b){this.V=a;var c=a.m,d=new Hd(c.g),c=V(c)?new Hd(c.g):c.xa?new Rf(c):new Id(c);this.hf=new nd(c);var e=b.w(),f=b.N,h=d.ya(J,e.j(),null),k=c.ya(J,f.j(),null);this.Ka=new yd(new Mb(k,f.da,c.Na()),new Mb(h,e.da,d.Na()));this.Za=[];this.Jf=new Nf(a)}function Cg(a){return a.V}g=Bg.prototype;g.w=function(){return this.Ka.w().j()};g.hb=function(a){var b=ec(this.Ka);return b&&(V(this.V.m)||!a.e()&&!b.Q(H(a)).e())?b.P(a):null};g.e=function(){return 0===this.Za.length};g.Nb=function(a){this.Za.push(a)};
3935
- g.kb=function(a,b){var c=[];if(b){E(null==a,"A cancel should cancel all event registrations.");var d=this.V.path;ya(this.Za,function(a){(a=a.Me(b,d))&&c.push(a)})}if(a){for(var e=[],f=0;f<this.Za.length;++f){var h=this.Za[f];if(!h.matches(a))e.push(h);else if(a.Xe()){e=e.concat(this.Za.slice(f+1));break}}this.Za=e}else this.Za=[];return c};
3936
- g.eb=function(a,b,c){a.type===bd&&null!==a.source.Hb&&(E(ec(this.Ka),"We should always have a full cache before handling merges"),E(zd(this.Ka),"Missing event cache, even though we have a server cache"));var d=this.Ka;a=this.hf.eb(d,a,b,c);b=this.hf;c=a.Sd;E(c.N.j().yc(b.U.g),"Event snap not indexed");E(c.w().j().yc(b.U.g),"Server snap not indexed");E(Nb(a.Sd.w())||!Nb(d.w()),"Once a server snap is complete, it should never go back");this.Ka=a.Sd;return Dg(this,a.Df,a.Sd.N.j(),null)};
3937
- function Eg(a,b){var c=a.Ka.N,d=[];c.j().J()||c.j().O(N,function(a,b){d.push(new I("child_added",b,a))});c.da&&d.push($b(c.j()));return Dg(a,d,c.j(),b)}function Dg(a,b,c,d){return Of(a.Jf,b,c,d?[d]:a.Za)};function Fg(a,b,c){this.Pb=a;this.rb=b;this.tb=c||null}g=Fg.prototype;g.nf=function(a){return"value"===a};g.createEvent=function(a,b){var c=b.m.g;return new Rb("value",this,new X(a.Ja,b.wb(),c))};g.Tb=function(a){var b=this.tb;if("cancel"===a.ge()){E(this.rb,"Raising a cancel event on a listener with no cancel callback");var c=this.rb;return function(){c.call(b,a.error)}}var d=this.Pb;return function(){d.call(b,a.Md)}};g.Me=function(a,b){return this.rb?new Sb(this,a,b):null};
3938
- g.matches=function(a){return a instanceof Fg?a.Pb&&this.Pb?a.Pb===this.Pb&&a.tb===this.tb:!0:!1};g.Xe=function(){return null!==this.Pb};function Gg(a,b,c){this.ga=a;this.rb=b;this.tb=c}g=Gg.prototype;g.nf=function(a){a="children_added"===a?"child_added":a;return("children_removed"===a?"child_removed":a)in this.ga};g.Me=function(a,b){return this.rb?new Sb(this,a,b):null};
3939
- g.createEvent=function(a,b){E(null!=a.Xa,"Child events should have a childName.");var c=b.wb().n(a.Xa);return new Rb(a.type,this,new X(a.Ja,c,b.m.g),a.Dd)};g.Tb=function(a){var b=this.tb;if("cancel"===a.ge()){E(this.rb,"Raising a cancel event on a listener with no cancel callback");var c=this.rb;return function(){c.call(b,a.error)}}var d=this.ga[a.hd];return function(){d.call(b,a.Md,a.Dd)}};
3940
- g.matches=function(a){if(a instanceof Gg){if(!this.ga||!a.ga)return!0;if(this.tb===a.tb){var b=oa(a.ga);if(b===oa(this.ga)){if(1===b){var b=pa(a.ga),c=pa(this.ga);return c===b&&(!a.ga[b]||!this.ga[c]||a.ga[b]===this.ga[c])}return na(this.ga,function(b,c){return a.ga[c]===b})}}}return!1};g.Xe=function(){return null!==this.ga};function Y(a,b,c,d){this.u=a;this.path=b;this.m=c;this.Nc=d}
3941
- function Hg(a){var b=null,c=null;a.ka&&(b=Kd(a));a.na&&(c=Md(a));if(a.g===Fd){if(a.ka){if("[MIN_NAME]"!=Jd(a))throw Error("Query: When ordering by key, you may only pass one argument to startAt(), endAt(), or equalTo().");if("string"!==typeof b)throw Error("Query: When ordering by key, the argument passed to startAt(), endAt(),or equalTo() must be a string.");}if(a.na){if("[MAX_NAME]"!=Ld(a))throw Error("Query: When ordering by key, you may only pass one argument to startAt(), endAt(), or equalTo().");if("string"!==
3942
- typeof c)throw Error("Query: When ordering by key, the argument passed to startAt(), endAt(),or equalTo() must be a string.");}}else if(a.g===N){if(null!=b&&!re(b)||null!=c&&!re(c))throw Error("Query: When ordering by priority, the first argument passed to startAt(), endAt(), or equalTo() must be a valid priority value (null, a number, or a string).");}else if(E(a.g instanceof eg||a.g===kg,"unknown index type."),null!=b&&"object"===typeof b||null!=c&&"object"===typeof c)throw Error("Query: First argument passed to startAt(), endAt(), or equalTo() cannot be an object.");
3943
- }function Ig(a){if(a.ka&&a.na&&a.xa&&(!a.xa||""===a.mb))throw Error("Query: Can't combine startAt(), endAt(), and limit(). Use limitToFirst() or limitToLast() instead.");}function Jg(a,b){if(!0===a.Nc)throw Error(b+": You can't combine multiple orderBy calls.");}g=Y.prototype;g.wb=function(){x("Query.ref",0,0,arguments.length);return new T(this.u,this.path)};
3944
- g.gc=function(a,b,c,d){x("Query.on",2,4,arguments.length);xe("Query.on",a,!1);A("Query.on",2,b,!1);var e=Kg("Query.on",c,d);if("value"===a)Lg(this.u,this,new Fg(b,e.cancel||null,e.Ma||null));else{var f={};f[a]=b;Lg(this.u,this,new Gg(f,e.cancel,e.Ma))}return b};
3945
- g.Ic=function(a,b,c){x("Query.off",0,3,arguments.length);xe("Query.off",a,!0);A("Query.off",2,b,!0);hb("Query.off",3,c);var d=null,e=null;"value"===a?d=new Fg(b||null,null,c||null):a&&(b&&(e={},e[a]=b),d=new Gg(e,null,c||null));e=this.u;d=".info"===H(this.path)?e.pd.kb(this,d):e.K.kb(this,d);Wb(e.ca,this.path,d)};
3946
- g.$f=function(a,b){function c(k){f&&(f=!1,e.Ic(a,c),b&&b.call(d.Ma,k),h.resolve(k))}x("Query.once",1,4,arguments.length);xe("Query.once",a,!1);A("Query.once",2,b,!0);var d=Kg("Query.once",arguments[2],arguments[3]),e=this,f=!0,h=new db;fb(h.ra);this.gc(a,c,function(b){e.Ic(a,c);d.cancel&&d.cancel.call(d.Ma,b);h.reject(b)});return h.ra};
3947
- g.ne=function(a){x("Query.limitToFirst",1,1,arguments.length);if(!ga(a)||Math.floor(a)!==a||0>=a)throw Error("Query.limitToFirst: First argument must be a positive integer.");if(this.m.xa)throw Error("Query.limitToFirst: Limit was already set (by another call to limit, limitToFirst, or limitToLast).");return new Y(this.u,this.path,this.m.ne(a),this.Nc)};
3948
- g.oe=function(a){x("Query.limitToLast",1,1,arguments.length);if(!ga(a)||Math.floor(a)!==a||0>=a)throw Error("Query.limitToLast: First argument must be a positive integer.");if(this.m.xa)throw Error("Query.limitToLast: Limit was already set (by another call to limit, limitToFirst, or limitToLast).");return new Y(this.u,this.path,this.m.oe(a),this.Nc)};
3949
- g.ag=function(a){x("Query.orderByChild",1,1,arguments.length);if("$key"===a)throw Error('Query.orderByChild: "$key" is invalid. Use Query.orderByKey() instead.');if("$priority"===a)throw Error('Query.orderByChild: "$priority" is invalid. Use Query.orderByPriority() instead.');if("$value"===a)throw Error('Query.orderByChild: "$value" is invalid. Use Query.orderByValue() instead.');ze("Query.orderByChild",a);Jg(this,"Query.orderByChild");var b=new L(a);if(b.e())throw Error("Query.orderByChild: cannot pass in empty path. Use Query.orderByValue() instead.");
3950
- b=new eg(b);b=og(this.m,b);Hg(b);return new Y(this.u,this.path,b,!0)};g.bg=function(){x("Query.orderByKey",0,0,arguments.length);Jg(this,"Query.orderByKey");var a=og(this.m,Fd);Hg(a);return new Y(this.u,this.path,a,!0)};g.cg=function(){x("Query.orderByPriority",0,0,arguments.length);Jg(this,"Query.orderByPriority");var a=og(this.m,N);Hg(a);return new Y(this.u,this.path,a,!0)};
3951
- g.dg=function(){x("Query.orderByValue",0,0,arguments.length);Jg(this,"Query.orderByValue");var a=og(this.m,kg);Hg(a);return new Y(this.u,this.path,a,!0)};g.Nd=function(a,b){x("Query.startAt",0,2,arguments.length);se("Query.startAt",a,this.path,!0);ye("Query.startAt",b);var c=this.m.Nd(a,b);Ig(c);Hg(c);if(this.m.ka)throw Error("Query.startAt: Starting point was already set (by another call to startAt or equalTo).");n(a)||(b=a=null);return new Y(this.u,this.path,c,this.Nc)};
3952
- g.gd=function(a,b){x("Query.endAt",0,2,arguments.length);se("Query.endAt",a,this.path,!0);ye("Query.endAt",b);var c=this.m.gd(a,b);Ig(c);Hg(c);if(this.m.na)throw Error("Query.endAt: Ending point was already set (by another call to endAt or equalTo).");return new Y(this.u,this.path,c,this.Nc)};
3953
- g.If=function(a,b){x("Query.equalTo",1,2,arguments.length);se("Query.equalTo",a,this.path,!1);ye("Query.equalTo",b);if(this.m.ka)throw Error("Query.equalTo: Starting point was already set (by another call to endAt or equalTo).");if(this.m.na)throw Error("Query.equalTo: Ending point was already set (by another call to endAt or equalTo).");return this.Nd(a,b).gd(a,b)};
3954
- g.toString=function(){x("Query.toString",0,0,arguments.length);for(var a=this.path,b="",c=a.Y;c<a.o.length;c++)""!==a.o[c]&&(b+="/"+encodeURIComponent(String(a.o[c])));return this.u.toString()+(b||"/")};g.toJSON=function(){x("Query.toJSON",0,1,arguments.length);return this.toString()};g.ja=function(){var a=Rc(Bf(this.m));return"{}"===a?"default":a};
3955
- g.isEqual=function(a){x("Query.isEqual",1,1,arguments.length);if(!(a instanceof Y))throw Error("Query.isEqual failed: First argument must be an instance of firebase.database.Query.");var b=this.u===a.u,c=this.path.Z(a.path),d=this.ja()===a.ja();return b&&c&&d};
3956
- function Kg(a,b,c){var d={cancel:null,Ma:null};if(b&&c)d.cancel=b,A(a,3,d.cancel,!0),d.Ma=c,hb(a,4,d.Ma);else if(b)if("object"===typeof b&&null!==b)d.Ma=b;else if("function"===typeof b)d.cancel=b;else throw Error(y(a,3,!0)+" must either be a cancel callback or a context object.");return d}Y.prototype.on=Y.prototype.gc;Y.prototype.off=Y.prototype.Ic;Y.prototype.once=Y.prototype.$f;Y.prototype.limitToFirst=Y.prototype.ne;Y.prototype.limitToLast=Y.prototype.oe;Y.prototype.orderByChild=Y.prototype.ag;
3957
- Y.prototype.orderByKey=Y.prototype.bg;Y.prototype.orderByPriority=Y.prototype.cg;Y.prototype.orderByValue=Y.prototype.dg;Y.prototype.startAt=Y.prototype.Nd;Y.prototype.endAt=Y.prototype.gd;Y.prototype.equalTo=Y.prototype.If;Y.prototype.toString=Y.prototype.toString;Y.prototype.isEqual=Y.prototype.isEqual;Wc(Y.prototype,"ref",Y.prototype.wb);function Mg(){this.za={}}g=Mg.prototype;g.e=function(){return va(this.za)};g.eb=function(a,b,c){var d=a.source.Hb;if(null!==d)return d=B(this.za,d),E(null!=d,"SyncTree gave us an op for an invalid query."),d.eb(a,b,c);var e=[];r(this.za,function(d){e=e.concat(d.eb(a,b,c))});return e};g.Nb=function(a,b,c,d,e){var f=a.ja(),h=B(this.za,f);if(!h){var h=c.Aa(e?d:null),k=!1;h?k=!0:(h=d instanceof P?c.rc(d):J,k=!1);h=new Bg(a,new yd(new Mb(h,k,!1),new Mb(d,e,!1)));this.za[f]=h}h.Nb(b);return Eg(h,b)};
3958
- g.kb=function(a,b,c){var d=a.ja(),e=[],f=[],h=null!=Ng(this);if("default"===d){var k=this;r(this.za,function(a,d){f=f.concat(a.kb(b,c));a.e()&&(delete k.za[d],V(a.V.m)||e.push(a.V))})}else{var l=B(this.za,d);l&&(f=f.concat(l.kb(b,c)),l.e()&&(delete this.za[d],V(l.V.m)||e.push(l.V)))}h&&null==Ng(this)&&e.push(new T(a.u,a.path));return{hg:e,Kf:f}};function Og(a){return za(qa(a.za),function(a){return!V(a.V.m)})}g.hb=function(a){var b=null;r(this.za,function(c){b=b||c.hb(a)});return b};
3959
- function Pg(a,b){if(V(b.m))return Ng(a);var c=b.ja();return B(a.za,c)}function Ng(a){return ua(a.za,function(a){return V(a.V.m)})||null};function Qg(a){this.W=a}var Rg=new Qg(new Je(null));function Sg(a,b,c){if(b.e())return new Qg(new Je(c));var d=Ne(a.W,b);if(null!=d){var e=d.path,d=d.value;b=S(e,b);d=d.F(b,c);return new Qg(a.W.set(e,d))}a=Ed(a.W,b,new Je(c));return new Qg(a)}function Tg(a,b,c){var d=a;jb(c,function(a,c){d=Sg(d,b.n(a),c)});return d}Qg.prototype.Ed=function(a){if(a.e())return Rg;a=Ed(this.W,a,Q);return new Qg(a)};function Ug(a,b){var c=Ne(a.W,b);return null!=c?a.W.get(c.path).P(S(c.path,b)):null}
3960
- function Vg(a){var b=[],c=a.W.value;null!=c?c.J()||c.O(N,function(a,c){b.push(new R(a,c))}):a.W.children.ha(function(a,c){null!=c.value&&b.push(new R(a,c.value))});return b}function Wg(a,b){if(b.e())return a;var c=Ug(a,b);return null!=c?new Qg(new Je(c)):new Qg(a.W.subtree(b))}Qg.prototype.e=function(){return this.W.e()};Qg.prototype.apply=function(a){return Xg(C,this.W,a)};
3961
- function Xg(a,b,c){if(null!=b.value)return c.F(a,b.value);var d=null;b.children.ha(function(b,f){".priority"===b?(E(null!==f.value,"Priority writes must always be leaf nodes"),d=f.value):c=Xg(a.n(b),f,c)});c.P(a).e()||null===d||(c=c.F(a.n(".priority"),d));return c};function Yg(){this.S=Rg;this.la=[];this.Bc=-1}function Zg(a,b){for(var c=0;c<a.la.length;c++){var d=a.la[c];if(d.Zc===b)return d}return null}g=Yg.prototype;
3962
- g.Ed=function(a){var b=Ea(this.la,function(b){return b.Zc===a});E(0<=b,"removeWrite called with nonexistent writeId.");var c=this.la[b];this.la.splice(b,1);for(var d=c.visible,e=!1,f=this.la.length-1;d&&0<=f;){var h=this.la[f];h.visible&&(f>=b&&$g(h,c.path)?d=!1:c.path.contains(h.path)&&(e=!0));f--}if(d){if(e)this.S=ah(this.la,bh,C),this.Bc=0<this.la.length?this.la[this.la.length-1].Zc:-1;else if(c.Ga)this.S=this.S.Ed(c.path);else{var k=this;r(c.children,function(a,b){k.S=k.S.Ed(c.path.n(b))})}return!0}return!1};
3963
- g.Aa=function(a,b,c,d){if(c||d){var e=Wg(this.S,a);return!d&&e.e()?b:d||null!=b||null!=Ug(e,C)?(e=ah(this.la,function(b){return(b.visible||d)&&(!c||!(0<=xa(c,b.Zc)))&&(b.path.contains(a)||a.contains(b.path))},a),b=b||J,e.apply(b)):null}e=Ug(this.S,a);if(null!=e)return e;e=Wg(this.S,a);return e.e()?b:null!=b||null!=Ug(e,C)?(b=b||J,e.apply(b)):null};
3964
- g.rc=function(a,b){var c=J,d=Ug(this.S,a);if(d)d.J()||d.O(N,function(a,b){c=c.T(a,b)});else if(b){var e=Wg(this.S,a);b.O(N,function(a,b){var d=Wg(e,new L(a)).apply(b);c=c.T(a,d)});ya(Vg(e),function(a){c=c.T(a.name,a.R)})}else e=Wg(this.S,a),ya(Vg(e),function(a){c=c.T(a.name,a.R)});return c};g.ad=function(a,b,c,d){E(c||d,"Either existingEventSnap or existingServerSnap must exist");a=a.n(b);if(null!=Ug(this.S,a))return null;a=Wg(this.S,a);return a.e()?d.P(b):a.apply(d.P(b))};
3965
- g.qc=function(a,b,c){a=a.n(b);var d=Ug(this.S,a);return null!=d?d:Qb(c,b)?Wg(this.S,a).apply(c.j().Q(b)):null};g.lc=function(a){return Ug(this.S,a)};g.Xd=function(a,b,c,d,e,f){var h;a=Wg(this.S,a);h=Ug(a,C);if(null==h)if(null!=b)h=a.apply(b);else return[];h=h.nb(f);if(h.e()||h.J())return[];b=[];a=Uf(f);e=e?h.Zb(c,f):h.Xb(c,f);for(f=K(e);f&&b.length<d;)0!==a(f,c)&&b.push(f),f=K(e);return b};
3966
- function $g(a,b){return a.Ga?a.path.contains(b):!!ta(a.children,function(c,d){return a.path.n(d).contains(b)})}function bh(a){return a.visible}
3967
- function ah(a,b,c){for(var d=Rg,e=0;e<a.length;++e){var f=a[e];if(b(f)){var h=f.path;if(f.Ga)c.contains(h)?(h=S(c,h),d=Sg(d,h,f.Ga)):h.contains(c)&&(h=S(h,c),d=Sg(d,C,f.Ga.P(h)));else if(f.children)if(c.contains(h))h=S(c,h),d=Tg(d,h,f.children);else{if(h.contains(c))if(h=S(h,c),h.e())d=Tg(d,C,f.children);else if(f=B(f.children,H(h)))f=f.P(D(h)),d=Sg(d,C,f)}else throw Cc("WriteRecord should have .snap or .children");}}return d}function ch(a,b){this.Lb=a;this.W=b}g=ch.prototype;
3968
- g.Aa=function(a,b,c){return this.W.Aa(this.Lb,a,b,c)};g.rc=function(a){return this.W.rc(this.Lb,a)};g.ad=function(a,b,c){return this.W.ad(this.Lb,a,b,c)};g.lc=function(a){return this.W.lc(this.Lb.n(a))};g.Xd=function(a,b,c,d,e){return this.W.Xd(this.Lb,a,b,c,d,e)};g.qc=function(a,b){return this.W.qc(this.Lb,a,b)};g.n=function(a){return new ch(this.Lb.n(a),this.W)};function dh(a){this.wa=Q;this.jb=new Yg;this.De={};this.ic={};this.Cc=a}function eh(a,b,c,d,e){var f=a.jb,h=e;E(d>f.Bc,"Stacking an older write on top of newer ones");n(h)||(h=!0);f.la.push({path:b,Ga:c,Zc:d,visible:h});h&&(f.S=Sg(f.S,b,c));f.Bc=d;return e?fh(a,new vb(Xe,b,c)):[]}function gh(a,b,c,d){var e=a.jb;E(d>e.Bc,"Stacking an older merge on top of newer ones");e.la.push({path:b,children:c,Zc:d,visible:!0});e.S=Tg(e.S,b,c);e.Bc=d;c=Le(c);return fh(a,new ad(Xe,b,c))}
3969
- function hh(a,b,c){c=c||!1;var d=Zg(a.jb,b);if(a.jb.Ed(b)){var e=Q;null!=d.Ga?e=e.set(C,!0):jb(d.children,function(a,b){e=e.set(new L(a),b)});return fh(a,new We(d.path,e,c))}return[]}function ih(a,b,c){c=Le(c);return fh(a,new ad(Ze,b,c))}function jh(a,b,c,d){d=kh(a,d);if(null!=d){var e=lh(d);d=e.path;e=e.Hb;b=S(d,b);c=new vb(new Ye(!1,!0,e,!0),b,c);return mh(a,d,c)}return[]}
3970
- function nh(a,b,c,d){if(d=kh(a,d)){var e=lh(d);d=e.path;e=e.Hb;b=S(d,b);c=Le(c);c=new ad(new Ye(!1,!0,e,!0),b,c);return mh(a,d,c)}return[]}
3971
- dh.prototype.Nb=function(a,b){var c=a.path,d=null,e=!1;Se(this.wa,c,function(a,b){var f=S(a,c);d=d||b.hb(f);e=e||null!=Ng(b)});var f=this.wa.get(c);f?(e=e||null!=Ng(f),d=d||f.hb(C)):(f=new Mg,this.wa=this.wa.set(c,f));var h;null!=d?h=!0:(h=!1,d=J,Ve(this.wa.subtree(c),function(a,b){var c=b.hb(C);c&&(d=d.T(a,c))}));var k=null!=Pg(f,a);if(!k&&!V(a.m)){var l=oh(a);E(!(l in this.ic),"View does not exist, but we have a tag");var m=ph++;this.ic[l]=m;this.De["_"+m]=l}h=f.Nb(a,b,new ch(c,this.jb),d,h);k||
3972
- e||(f=Pg(f,a),h=h.concat(qh(this,a,f)));return h};
3973
- dh.prototype.kb=function(a,b,c){var d=a.path,e=this.wa.get(d),f=[];if(e&&("default"===a.ja()||null!=Pg(e,a))){f=e.kb(a,b,c);e.e()&&(this.wa=this.wa.remove(d));e=f.hg;f=f.Kf;b=-1!==Ea(e,function(a){return V(a.m)});var h=Qe(this.wa,d,function(a,b){return null!=Ng(b)});if(b&&!h&&(d=this.wa.subtree(d),!d.e()))for(var d=rh(d),k=0;k<d.length;++k){var l=d[k],m=l.V,l=sh(this,l);this.Cc.Ae(th(m),uh(this,m),l.ld,l.G)}if(!h&&0<e.length&&!c)if(b)this.Cc.Od(th(a),null);else{var u=this;ya(e,function(a){a.ja();
3974
- var b=u.ic[oh(a)];u.Cc.Od(th(a),b)})}vh(this,e)}return f};dh.prototype.Aa=function(a,b){var c=this.jb,d=Qe(this.wa,a,function(b,c){var d=S(b,a);if(d=c.hb(d))return d});return c.Aa(a,d,b,!0)};function rh(a){return Oe(a,function(a,c,d){if(c&&null!=Ng(c))return[Ng(c)];var e=[];c&&(e=Og(c));r(d,function(a){e=e.concat(a)});return e})}function vh(a,b){for(var c=0;c<b.length;++c){var d=b[c];if(!V(d.m)){var d=oh(d),e=a.ic[d];delete a.ic[d];delete a.De["_"+e]}}}
3975
- function th(a){return V(a.m)&&!ed(a.m)?a.wb():a}function qh(a,b,c){var d=b.path,e=uh(a,b);c=sh(a,c);b=a.Cc.Ae(th(b),e,c.ld,c.G);d=a.wa.subtree(d);if(e)E(null==Ng(d.value),"If we're adding a query, it shouldn't be shadowed");else for(e=Oe(d,function(a,b,c){if(!a.e()&&b&&null!=Ng(b))return[Cg(Ng(b))];var d=[];b&&(d=d.concat(Aa(Og(b),function(a){return a.V})));r(c,function(a){d=d.concat(a)});return d}),d=0;d<e.length;++d)c=e[d],a.Cc.Od(th(c),uh(a,c));return b}
3976
- function sh(a,b){var c=b.V,d=uh(a,c);return{ld:function(){return(b.w()||J).hash()},G:function(b){if("ok"===b){if(d){var f=c.path;if(b=kh(a,d)){var h=lh(b);b=h.path;h=h.Hb;f=S(b,f);f=new xb(new Ye(!1,!0,h,!0),f);b=mh(a,b,f)}else b=[]}else b=fh(a,new xb(Ze,c.path));return b}f="Unknown Error";"too_big"===b?f="The data requested exceeds the maximum size that can be accessed with a single request.":"permission_denied"==b?f="Client doesn't have permission to access the desired data.":"unavailable"==b&&
3977
- (f="The service is unavailable");f=Error(b+" at "+c.path.toString()+": "+f);f.code=b.toUpperCase();return a.kb(c,null,f)}}}function oh(a){return a.path.toString()+"$"+a.ja()}function lh(a){var b=a.indexOf("$");E(-1!==b&&b<a.length-1,"Bad queryKey.");return{Hb:a.substr(b+1),path:new L(a.substr(0,b))}}function kh(a,b){var c=a.De,d="_"+b;return d in c?c[d]:void 0}function uh(a,b){var c=oh(b);return B(a.ic,c)}var ph=1;
3978
- function mh(a,b,c){var d=a.wa.get(b);E(d,"Missing sync point for query tag that we're tracking");return d.eb(c,new ch(b,a.jb),null)}function fh(a,b){return wh(a,b,a.wa,null,new ch(C,a.jb))}function wh(a,b,c,d,e){if(b.path.e())return xh(a,b,c,d,e);var f=c.get(C);null==d&&null!=f&&(d=f.hb(C));var h=[],k=H(b.path),l=b.Mc(k);if((c=c.children.get(k))&&l)var m=d?d.Q(k):null,k=e.n(k),h=h.concat(wh(a,l,c,m,k));f&&(h=h.concat(f.eb(b,e,d)));return h}
3979
- function xh(a,b,c,d,e){var f=c.get(C);null==d&&null!=f&&(d=f.hb(C));var h=[];c.children.ha(function(c,f){var m=d?d.Q(c):null,u=e.n(c),z=b.Mc(c);z&&(h=h.concat(xh(a,z,f,m,u)))});f&&(h=h.concat(f.eb(b,e,d)));return h};function Sd(a,b,c){this.app=c;var d=new Kb(c);this.L=a;this.Va=kd(a);this.Vc=null;this.ca=new Tb;this.vd=1;this.Ra=null;if(b||0<=("object"===typeof window&&window.navigator&&window.navigator.userAgent||"").search(/googlebot|google webmaster tools|bingbot|yahoo! slurp|baiduspider|yandexbot|duckduckbot/i))this.va=new cd(this.L,q(this.Gb,this),d),setTimeout(q(this.Jc,this,!0),0);else{b=c.options.databaseAuthVariableOverride;if("undefined"!==da(b)&&null!==b){if("object"!==da(b))throw Error("Only objects are supported for option databaseAuthVariableOverride");
3980
- try{w(b)}catch(e){throw Error("Invalid authOverride provided: "+e);}}this.va=this.Ra=new wf(this.L,q(this.Gb,this),q(this.Jc,this),q(this.ue,this),d,b)}var f=this;Lb(d,function(a){f.va.kf(a)});this.og=ld(a,q(function(){return new hd(this.Va,this.va)},this));this.mc=new Zd;this.ie=new fc;this.pd=new dh({Ae:function(a,b,c,d){b=[];c=f.ie.j(a.path);c.e()||(b=fh(f.pd,new vb(Ze,a.path,c)),setTimeout(function(){d("ok")},0));return b},Od:ba});yh(this,"connected",!1);this.ia=new wc;this.Ya=new Rd(this);this.fd=
3981
- 0;this.je=null;this.K=new dh({Ae:function(a,b,c,d){f.va.$e(a,c,b,function(b,c){var e=d(b,c);Yb(f.ca,a.path,e)});return[]},Od:function(a,b){f.va.uf(a,b)}})}g=Sd.prototype;g.toString=function(){return(this.L.Sc?"https://":"http://")+this.L.host};g.name=function(){return this.L.pe};function zh(a){a=a.ie.j(new L(".info/serverTimeOffset")).H()||0;return(new Date).getTime()+a}function Ah(a){a=a={timestamp:zh(a)};a.timestamp=a.timestamp||(new Date).getTime();return a}
3982
- g.Gb=function(a,b,c,d){this.fd++;var e=new L(a);b=this.je?this.je(a,b):b;a=[];d?c?(b=ma(b,function(a){return M(a)}),a=nh(this.K,e,b,d)):(b=M(b),a=jh(this.K,e,b,d)):c?(d=ma(b,function(a){return M(a)}),a=ih(this.K,e,d)):(d=M(b),a=fh(this.K,new vb(Ze,e,d)));d=e;0<a.length&&(d=Bh(this,e));Yb(this.ca,d,a)};g.Jc=function(a){yh(this,"connected",a);!1===a&&Ch(this)};g.ue=function(a){var b=this;Tc(a,function(a,d){yh(b,d,a)})};
3983
- function yh(a,b,c){b=new L("/.info/"+b);c=M(c);var d=a.ie;d.Jd=d.Jd.F(b,c);c=fh(a.pd,new vb(Ze,b,c));Yb(a.ca,b,c)}g.Jb=function(a,b,c,d){this.f("set",{path:a.toString(),value:b,ug:c});var e=Ah(this);b=M(b,c);var e=zc(b,e),f=this.vd++,e=eh(this.K,a,e,f,!0);Ub(this.ca,e);var h=this;this.va.put(a.toString(),b.H(!0),function(b,c){var e="ok"===b;e||O("set at "+a+" failed: "+b);e=hh(h.K,f,!e);Yb(h.ca,a,e);Dh(d,b,c)});e=Eh(this,a);Bh(this,e);Yb(this.ca,e,[])};
3984
- g.update=function(a,b,c){this.f("update",{path:a.toString(),value:b});var d=!0,e=Ah(this),f={};r(b,function(a,b){d=!1;var c=M(a);f[b]=zc(c,e)});if(d)G("update() called with empty data. Don't do anything."),Dh(c,"ok");else{var h=this.vd++,k=gh(this.K,a,f,h);Ub(this.ca,k);var l=this;this.va.af(a.toString(),b,function(b,d){var e="ok"===b;e||O("update at "+a+" failed: "+b);var e=hh(l.K,h,!e),f=a;0<e.length&&(f=Bh(l,a));Yb(l.ca,f,e);Dh(c,b,d)});r(b,function(b,c){var d=Eh(l,a.n(c));Bh(l,d)});Yb(this.ca,
3985
- a,[])}};function Ch(a){a.f("onDisconnectEvents");var b=Ah(a),c=[];xc(vc(a.ia,b),C,function(b,e){c=c.concat(fh(a.K,new vb(Ze,b,e)));var f=Eh(a,b);Bh(a,f)});a.ia=new wc;Yb(a.ca,C,c)}g.xd=function(a,b){var c=this;this.va.xd(a.toString(),function(d,e){"ok"===d&&pg(c.ia,a);Dh(b,d,e)})};function Be(a,b,c,d){var e=M(c);a.va.re(b.toString(),e.H(!0),function(c,h){"ok"===c&&yc(a.ia,b,e);Dh(d,c,h)})}
3986
- function Ce(a,b,c,d,e){var f=M(c,d);a.va.re(b.toString(),f.H(!0),function(c,d){"ok"===c&&yc(a.ia,b,f);Dh(e,c,d)})}function De(a,b,c,d){var e=!0,f;for(f in c)e=!1;e?(G("onDisconnect().update() called with empty data. Don't do anything."),Dh(d,"ok")):a.va.cf(b.toString(),c,function(e,f){if("ok"===e)for(var l in c){var m=M(c[l]);yc(a.ia,b.n(l),m)}Dh(d,e,f)})}function Lg(a,b,c){c=".info"===H(b.path)?a.pd.Nb(b,c):a.K.Nb(b,c);Wb(a.ca,b.path,c)}g.ab=function(){this.Ra&&this.Ra.ab("repo_interrupt")};
3987
- g.kc=function(){this.Ra&&this.Ra.kc("repo_interrupt")};g.Be=function(a){if("undefined"!==typeof console){a?(this.Vc||(this.Vc=new Bb(this.Va)),a=this.Vc.get()):a=this.Va.get();var b=Ba(ra(a),function(a,b){return Math.max(b.length,a)},0),c;for(c in a){for(var d=a[c],e=c.length;e<b+2;e++)c+=" ";console.log(c+d)}}};g.Ce=function(a){Ab(this.Va,a);this.og.rf[a]=!0};g.f=function(a){var b="";this.Ra&&(b=this.Ra.id+":");G(b,arguments)};
3988
- function Dh(a,b,c){a&&sb(function(){if("ok"==b)a(null);else{var d=(b||"error").toUpperCase(),e=d;c&&(e+=": "+c);e=Error(e);e.code=d;a(e)}})};function Fh(a,b,c,d,e){function f(){}a.f("transaction on "+b);var h=new T(a,b);h.gc("value",f);c={path:b,update:c,G:d,status:null,ef:Bc(),He:e,of:0,Rd:function(){h.Ic("value",f)},Td:null,Ba:null,cd:null,dd:null,ed:null};d=a.K.Aa(b,void 0)||J;c.cd=d;d=c.update(d.H());if(n(d)){te("transaction failed: Data returned ",d,c.path);c.status=1;e=$d(a.mc,b);var k=e.Ca()||[];k.push(c);ae(e,k);"object"===typeof d&&null!==d&&ib(d,".priority")?(k=B(d,".priority"),E(re(k),"Invalid priority returned by transaction. Priority must be a valid string, finite number, server value, or null.")):
3989
- k=(a.K.Aa(b)||J).C().H();e=Ah(a);d=M(d,k);e=zc(d,e);c.dd=d;c.ed=e;c.Ba=a.vd++;c=eh(a.K,b,e,c.Ba,c.He);Yb(a.ca,b,c);Gh(a)}else c.Rd(),c.dd=null,c.ed=null,c.G&&(a=new X(c.cd,new T(a,c.path),N),c.G(null,!1,a))}function Gh(a,b){var c=b||a.mc;b||Hh(a,c);if(null!==c.Ca()){var d=Ih(a,c);E(0<d.length,"Sending zero length transaction queue");Ca(d,function(a){return 1===a.status})&&Jh(a,c.path(),d)}else c.kd()&&c.O(function(b){Gh(a,b)})}
3990
- function Jh(a,b,c){for(var d=Aa(c,function(a){return a.Ba}),e=a.K.Aa(b,d)||J,d=e,e=e.hash(),f=0;f<c.length;f++){var h=c[f];E(1===h.status,"tryToSendTransactionQueue_: items in queue should all be run.");h.status=2;h.of++;var k=S(b,h.path),d=d.F(k,h.dd)}d=d.H(!0);a.va.put(b.toString(),d,function(d){a.f("transaction put response",{path:b.toString(),status:d});var e=[];if("ok"===d){d=[];for(f=0;f<c.length;f++){c[f].status=3;e=e.concat(hh(a.K,c[f].Ba));if(c[f].G){var h=c[f].ed,k=new T(a,c[f].path);d.push(q(c[f].G,
3991
- null,null,!0,new X(h,k,N)))}c[f].Rd()}Hh(a,$d(a.mc,b));Gh(a);Yb(a.ca,b,e);for(f=0;f<d.length;f++)sb(d[f])}else{if("datastale"===d)for(f=0;f<c.length;f++)c[f].status=4===c[f].status?5:1;else for(O("transaction at "+b.toString()+" failed: "+d),f=0;f<c.length;f++)c[f].status=5,c[f].Td=d;Bh(a,b)}},e)}function Bh(a,b){var c=Kh(a,b),d=c.path(),c=Ih(a,c);Lh(a,c,d);return d}
3992
- function Lh(a,b,c){if(0!==b.length){for(var d=[],e=[],f=za(b,function(a){return 1===a.status}),f=Aa(f,function(a){return a.Ba}),h=0;h<b.length;h++){var k=b[h],l=S(c,k.path),m=!1,u;E(null!==l,"rerunTransactionsUnderNode_: relativePath should not be null.");if(5===k.status)m=!0,u=k.Td,e=e.concat(hh(a.K,k.Ba,!0));else if(1===k.status)if(25<=k.of)m=!0,u="maxretry",e=e.concat(hh(a.K,k.Ba,!0));else{var z=a.K.Aa(k.path,f)||J;k.cd=z;var F=b[h].update(z.H());n(F)?(te("transaction failed: Data returned ",F,
3993
- k.path),l=M(F),"object"===typeof F&&null!=F&&ib(F,".priority")||(l=l.fa(z.C())),z=k.Ba,F=Ah(a),F=zc(l,F),k.dd=l,k.ed=F,k.Ba=a.vd++,Fa(f,z),e=e.concat(eh(a.K,k.path,F,k.Ba,k.He)),e=e.concat(hh(a.K,z,!0))):(m=!0,u="nodata",e=e.concat(hh(a.K,k.Ba,!0)))}Yb(a.ca,c,e);e=[];m&&(b[h].status=3,setTimeout(b[h].Rd,Math.floor(0)),b[h].G&&("nodata"===u?(k=new T(a,b[h].path),d.push(q(b[h].G,null,null,!1,new X(b[h].cd,k,N)))):d.push(q(b[h].G,null,Error(u),!1,null))))}Hh(a,a.mc);for(h=0;h<d.length;h++)sb(d[h]);Gh(a)}}
3994
- function Kh(a,b){for(var c,d=a.mc;null!==(c=H(b))&&null===d.Ca();)d=$d(d,c),b=D(b);return d}function Ih(a,b){var c=[];Mh(a,b,c);c.sort(function(a,b){return a.ef-b.ef});return c}function Mh(a,b,c){var d=b.Ca();if(null!==d)for(var e=0;e<d.length;e++)c.push(d[e]);b.O(function(b){Mh(a,b,c)})}function Hh(a,b){var c=b.Ca();if(c){for(var d=0,e=0;e<c.length;e++)3!==c[e].status&&(c[d]=c[e],d++);c.length=d;ae(b,0<c.length?c:null)}b.O(function(b){Hh(a,b)})}
3995
- function Eh(a,b){var c=Kh(a,b).path(),d=$d(a.mc,b);de(d,function(b){Nh(a,b)});Nh(a,d);ce(d,function(b){Nh(a,b)});return c}
3996
- function Nh(a,b){var c=b.Ca();if(null!==c){for(var d=[],e=[],f=-1,h=0;h<c.length;h++)4!==c[h].status&&(2===c[h].status?(E(f===h-1,"All SENT items should be at beginning of queue."),f=h,c[h].status=4,c[h].Td="set"):(E(1===c[h].status,"Unexpected transaction status in abort"),c[h].Rd(),e=e.concat(hh(a.K,c[h].Ba,!0)),c[h].G&&d.push(q(c[h].G,null,Error("set"),!1,null))));-1===f?ae(b,null):c.length=f+1;Yb(a.ca,b.path(),e);for(h=0;h<d.length;h++)sb(d[h])}};function Xd(){this.lb={};this.wf=!1}Xd.prototype.ab=function(){for(var a in this.lb)this.lb[a].ab()};Xd.prototype.kc=function(){for(var a in this.lb)this.lb[a].kc()};Xd.prototype.ce=function(a){this.wf=a};ca(Xd);Xd.prototype.interrupt=Xd.prototype.ab;Xd.prototype.resume=Xd.prototype.kc;var Z={};Z.nc=wf;Z.DataConnection=Z.nc;wf.prototype.ng=function(a,b){this.ua("q",{p:a},b)};Z.nc.prototype.simpleListen=Z.nc.prototype.ng;wf.prototype.Hf=function(a,b){this.ua("echo",{d:a},b)};Z.nc.prototype.echo=Z.nc.prototype.Hf;wf.prototype.interrupt=wf.prototype.ab;Z.zf=kf;Z.RealTimeConnection=Z.zf;kf.prototype.sendRequest=kf.prototype.ua;kf.prototype.close=kf.prototype.close;
3997
- Z.Rf=function(a){var b=wf.prototype.put;wf.prototype.put=function(c,d,e,f){n(f)&&(f=a());b.call(this,c,d,e,f)};return function(){wf.prototype.put=b}};Z.hijackHash=Z.Rf;Z.yf=Hb;Z.ConnectionTarget=Z.yf;Z.ja=function(a){return a.ja()};Z.queryIdentifier=Z.ja;Z.Uf=function(a){return a.u.Ra.$};Z.listens=Z.Uf;Z.ce=function(a){Xd.Vb().ce(a)};Z.forceRestClient=Z.ce;Z.Context=Xd;function T(a,b){if(!(a instanceof Sd))throw Error("new Firebase() no longer supported - use app.database().");Y.call(this,a,b,mg,!1);this.then=void 0;this["catch"]=void 0}la(T,Y);g=T.prototype;g.getKey=function(){x("Firebase.key",0,0,arguments.length);return this.path.e()?null:Bd(this.path)};
3998
- g.n=function(a){x("Firebase.child",1,1,arguments.length);if(ga(a))a=String(a);else if(!(a instanceof L))if(null===H(this.path)){var b=a;b&&(b=b.replace(/^\/*\.info(\/|$)/,"/"));ze("Firebase.child",b)}else ze("Firebase.child",a);return new T(this.u,this.path.n(a))};g.getParent=function(){x("Firebase.parent",0,0,arguments.length);var a=this.path.parent();return null===a?null:new T(this.u,a)};
3999
- g.Of=function(){x("Firebase.ref",0,0,arguments.length);for(var a=this;null!==a.getParent();)a=a.getParent();return a};g.Gf=function(){return this.u.Ya};g.set=function(a,b){x("Firebase.set",1,2,arguments.length);Ae("Firebase.set",this.path);se("Firebase.set",a,this.path,!1);A("Firebase.set",2,b,!0);var c=new db;this.u.Jb(this.path,a,null,eb(c,b));return c.ra};
4000
- g.update=function(a,b){x("Firebase.update",1,2,arguments.length);Ae("Firebase.update",this.path);if(ea(a)){for(var c={},d=0;d<a.length;++d)c[""+d]=a[d];a=c;O("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.")}ve("Firebase.update",a,this.path);A("Firebase.update",2,b,!0);c=new db;this.u.update(this.path,a,eb(c,b));return c.ra};
4001
- g.Jb=function(a,b,c){x("Firebase.setWithPriority",2,3,arguments.length);Ae("Firebase.setWithPriority",this.path);se("Firebase.setWithPriority",a,this.path,!1);we("Firebase.setWithPriority",2,b);A("Firebase.setWithPriority",3,c,!0);if(".length"===this.getKey()||".keys"===this.getKey())throw"Firebase.setWithPriority failed: "+this.getKey()+" is a read-only object.";var d=new db;this.u.Jb(this.path,a,b,eb(d,c));return d.ra};
4002
- g.remove=function(a){x("Firebase.remove",0,1,arguments.length);Ae("Firebase.remove",this.path);A("Firebase.remove",1,a,!0);return this.set(null,a)};
4003
- g.transaction=function(a,b,c){x("Firebase.transaction",1,3,arguments.length);Ae("Firebase.transaction",this.path);A("Firebase.transaction",1,a,!1);A("Firebase.transaction",2,b,!0);if(n(c)&&"boolean"!=typeof c)throw Error(y("Firebase.transaction",3,!0)+"must be a boolean.");if(".length"===this.getKey()||".keys"===this.getKey())throw"Firebase.transaction failed: "+this.getKey()+" is a read-only object.";"undefined"===typeof c&&(c=!0);var d=new db;ha(b)&&fb(d.ra);Fh(this.u,this.path,a,function(a,c,h){a?
4004
- d.reject(a):d.resolve(new ub(c,h));ha(b)&&b(a,c,h)},c);return d.ra};g.kg=function(a,b){x("Firebase.setPriority",1,2,arguments.length);Ae("Firebase.setPriority",this.path);we("Firebase.setPriority",1,a);A("Firebase.setPriority",2,b,!0);var c=new db;this.u.Jb(this.path.n(".priority"),a,null,eb(c,b));return c.ra};
4005
- g.push=function(a,b){x("Firebase.push",0,2,arguments.length);Ae("Firebase.push",this.path);se("Firebase.push",a,this.path,!0);A("Firebase.push",2,b,!0);var c=zh(this.u),d=Ie(c),c=this.n(d),e;if(null!=a){var f=this;e=c.set(a,b).then(function(){return f.n(d)})}else e=cb.resolve(c);c.then=q(e.then,e);c["catch"]=q(e.then,e,void 0);ha(b)&&fb(e);return c};g.ib=function(){Ae("Firebase.onDisconnect",this.path);return new U(this.u,this.path)};T.prototype.child=T.prototype.n;T.prototype.set=T.prototype.set;
4006
- T.prototype.update=T.prototype.update;T.prototype.setWithPriority=T.prototype.Jb;T.prototype.remove=T.prototype.remove;T.prototype.transaction=T.prototype.transaction;T.prototype.setPriority=T.prototype.kg;T.prototype.push=T.prototype.push;T.prototype.onDisconnect=T.prototype.ib;Wc(T.prototype,"database",T.prototype.Gf);Wc(T.prototype,"key",T.prototype.getKey);Wc(T.prototype,"parent",T.prototype.getParent);Wc(T.prototype,"root",T.prototype.Of);if("undefined"===typeof firebase)throw Error("Cannot install Firebase Database - be sure to load firebase-app.js first.");
4007
- try{firebase.INTERNAL.registerService("database",function(a){var b=Xd.Vb(),c=a.options.databaseURL;n(c)||Kc("Can't determine Firebase Database URL. Be sure to include databaseURL option when calling firebase.intializeApp().");var d=Lc(c),c=d.jc;Wd("Invalid Firebase Database URL",d);d.path.e()||Kc("Database URL must point to the root of a Firebase Database (not including a child path).");(d=B(b.lb,a.name))&&Kc("FIREBASE INTERNAL ERROR: Database initialized multiple times.");d=new Sd(c,b.wf,a);b.lb[a.name]=
4008
- d;return d.Ya},{Reference:T,Query:Y,Database:Rd,enableLogging:Hc,INTERNAL:W,TEST_ACCESS:Z,ServerValue:Ud})}catch(Oh){Kc("Failed to register the Firebase Database Service ("+Oh+")")};})();
4009
-
4010
- (function(){var f=function(a,b){function c(){}c.prototype=b.prototype;a.prototype=new c;for(var d in b)if(Object.defineProperties){var e=Object.getOwnPropertyDescriptor(b,d);e&&Object.defineProperty(a,d,e)}else a[d]=b[d]},g=this,h=function(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=
4011
- typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null";else if("function"==b&&"undefined"==typeof a.call)return"object";return b},k=function(a,b){function c(){}c.prototype=b.prototype;a.B=b.prototype;a.prototype=new c;a.u=function(a,c,n){for(var d=Array(arguments.length-2),e=2;e<arguments.length;e++)d[e-2]=arguments[e];
4012
- return b.prototype[c].apply(a,d)}};var m={},p=(m["only-available-in-window"]="This method is available in a Window context.",m["only-available-in-sw"]="This method is available in a service worker context.",m["should-be-overriden"]="This method should be overriden by extended classes.",m["bad-sender-id"]="Please ensure that 'messagingSenderId' is set correctly in the options passed into firebase.initializeApp().",m["permission-default"]="The required permissions were not granted and dismissed instead.",m["permission-blocked"]="The required permissions were not granted and blocked instead.",
4013
- m["unsupported-browser"]="This browser doesn't support the API's required to use the firebase SDK.",m["notifications-blocked"]="Notifications have been blocked.",m["failed-serviceworker-registration"]="We are unable to register the default service worker. {$browserErrorMessage}",m["sw-registration-expected"]="A service worker registration was the expected input.",m["get-subscription-failed"]="There was an error when trying to get any existing Push Subscriptions.",m["invalid-saved-token"]="Unable to access details of the saved token.",
4014
- m["sw-reg-redundant"]="The service worker being used for push was made redundant.",m["token-subscribe-failed"]="A problem occured while subscribing the user to FCM: {$message}",m["token-subscribe-no-token"]="FCM returned no token when subscribing the user to push.",m["token-subscribe-no-push-set"]="FCM returned an invalid response when getting an FCM token.",m["use-sw-before-get-token"]="You must call useServiceWorker() before calling getToken() to ensure your service worker is used.",m["invalid-delete-token"]=
4015
- "You must pass a valid token into deleteToken(), i.e. the token from getToken().",m["delete-token-not-found"]="The deletion attempt for token could not be performed as the token was not found.",m["bg-handler-function-expected"]="The input to setBackgroundMessageHandler() must be a function.",m["no-window-client-to-msg"]="An attempt was made to message a non-existant window client.",m["unable-to-resubscribe"]="There was an error while re-subscribing the FCM token for push messaging. Will have to resubscribe the user on next visit. {$message}",
4016
- m["no-fcm-token-for-resubscribe"]="Could not find an FCM token and as a result, unable to resubscribe. Will have to resubscribe the user on next visit.",m["failed-to-delete-token"]="Unable to delete the currently saved token.",m["no-sw-in-reg"]="Even though the service worker registration was successful, there was a problem accessing the service worker itself.",m["incorrect-gcm-sender-id"]="Please change your web app manifest's 'gcm_sender_id' value to '103953800507' to use Firebase messaging.",m);var q={userVisibleOnly:!0,applicationServerKey:new Uint8Array([4,51,148,247,223,161,235,177,220,3,162,94,21,113,219,72,211,46,237,237,178,52,219,183,71,58,12,143,196,204,225,111,60,140,132,223,171,182,102,62,242,12,212,139,254,227,249,118,47,20,28,99,8,106,111,45,177,26,149,176,206,55,192,156,110])};var r=function(a,b){var c={};return c["firebase-messaging-msg-type"]=a,c["firebase-messaging-msg-data"]=b,c};var u=function(a){if(Error.captureStackTrace)Error.captureStackTrace(this,u);else{var b=Error().stack;b&&(this.stack=b)}a&&(this.message=String(a))};k(u,Error);var v=function(a,b){for(var c=a.split("%s"),d="",e=Array.prototype.slice.call(arguments,1);e.length&&1<c.length;)d+=c.shift()+e.shift();return d+c.join("%s")};var w=function(a,b){b.unshift(a);u.call(this,v.apply(null,b));b.shift()};k(w,u);var x=function(a,b,c){if(!a){var d="Assertion failed";if(b)var d=d+(": "+b),e=Array.prototype.slice.call(arguments,2);throw new w(""+d,e||[]);}};var y=null;var A=function(a){a=new Uint8Array(a);var b=h(a);x("array"==b||"object"==b&&"number"==typeof a.length,"encodeByteArray takes an array as a parameter");if(!y)for(y={},b=0;65>b;b++)y[b]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(b);for(var b=y,c=[],d=0;d<a.length;d+=3){var e=a[d],n=d+1<a.length,l=n?a[d+1]:0,z=d+2<a.length,t=z?a[d+2]:0,M=e>>2,e=(e&3)<<4|l>>4,l=(l&15)<<2|t>>6,t=t&63;z||(t=64,n||(l=64));c.push(b[M],b[e],b[l],b[t])}return c.join("").replace(/\+/g,"-").replace(/\//g,
4017
- "_").replace(/=+$/,"")};var B=new firebase.INTERNAL.ErrorFactory("messaging","Messaging",p),C=function(){this.a=null},D=function(a){if(a.a)return a.a;a.a=new Promise(function(a,c){var b=g.indexedDB.open("fcm_token_details_db",1);b.onerror=function(a){c(a.target.error)};b.onsuccess=function(b){a(b.target.result)};b.onupgradeneeded=function(a){a=a.target.result.createObjectStore("fcm_token_object_Store",{keyPath:"swScope"});a.createIndex("fcmSenderId","fcmSenderId",{unique:!1});a.createIndex("fcmToken","fcmToken",{unique:!0})}});
4018
- return a.a},E=function(a){a.a?a.a.then(function(b){b.close();a.a=null}):Promise.resolve()},F=function(a,b){return D(a).then(function(a){return new Promise(function(c,e){var d=a.transaction(["fcm_token_object_Store"]).objectStore("fcm_token_object_Store").index("fcmToken").get(b);d.onerror=function(a){e(a.target.error)};d.onsuccess=function(a){c(a.target.result)}})})},G=function(a,b){return D(a).then(function(a){return new Promise(function(c,e){var d=[],l=a.transaction(["fcm_token_object_Store"]).objectStore("fcm_token_object_Store").openCursor();
4019
- l.onerror=function(a){e(a.target.error)};l.onsuccess=function(a){(a=a.target.result)?(a.value.fcmSenderId===b&&d.push(a.value),a.continue()):c(d)}})})},H=function(a,b,c){var d=A(b.getKey("p256dh")),e=A(b.getKey("auth"));a="authorized_entity="+a+"&"+("endpoint="+b.endpoint+"&")+("encryption_key="+d+"&")+("encryption_auth="+e);c&&(a+="&pushSet="+c);c=new Headers;c.append("Content-Type","application/x-www-form-urlencoded");return fetch("https://fcm.googleapis.com/fcm/connect/subscribe",{method:"POST",
4020
- headers:c,body:a}).then(function(a){return a.json()}).then(function(a){if(a.error)throw B.create("token-subscribe-failed",{message:a.error.message});if(!a.token)throw B.create("token-subscribe-no-token");if(!a.pushSet)throw B.create("token-subscribe-no-push-set");return{token:a.token,pushSet:a.pushSet}})},I=function(a,b,c,d,e,n){var l={swScope:c.scope,endpoint:d.endpoint,auth:A(d.getKey("auth")),p256dh:A(d.getKey("p256dh")),fcmToken:e,fcmPushSet:n,fcmSenderId:b};return D(a).then(function(a){return new Promise(function(b,
4021
- c){var d=a.transaction(["fcm_token_object_Store"],"readwrite").objectStore("fcm_token_object_Store").put(l);d.onerror=function(a){c(a.target.error)};d.onsuccess=function(){b()}})})};
4022
- C.prototype.i=function(a,b){return b instanceof ServiceWorkerRegistration?"string"!==typeof a||0===a.length?Promise.reject(B.create("bad-sender-id")):G(this,a).then(function(c){if(0!==c.length){var d=c.findIndex(function(c){return b.scope===c.swScope&&a===c.fcmSenderId});if(-1!==d)return c[d]}}).then(function(a){if(a)return b.pushManager.getSubscription().catch(function(){throw B.create("get-subscription-failed");}).then(function(b){var c;if(c=b)c=b.endpoint===a.endpoint&&A(b.getKey("auth"))===a.auth&&
4023
- A(b.getKey("p256dh"))===a.p256dh;if(c)return a.fcmToken})}):Promise.reject(B.create("sw-registration-expected"))};C.prototype.getSavedToken=C.prototype.i;
4024
- C.prototype.h=function(a,b){var c=this;return"string"!==typeof a||0===a.length?Promise.reject(B.create("bad-sender-id")):b instanceof ServiceWorkerRegistration?b.pushManager.getSubscription().then(function(a){return a?a:b.pushManager.subscribe(q)}).then(function(d){return H(a,d).then(function(e){return I(c,a,b,d,e.token,e.pushSet).then(function(){return e.token})})}):Promise.reject(B.create("sw-registration-expected"))};C.prototype.createToken=C.prototype.h;
4025
- C.prototype.deleteToken=function(a){var b=this;return"string"!==typeof a||0===a.length?Promise.reject(B.create("invalid-delete-token")):F(this,a).then(function(a){if(!a)throw B.create("delete-token-not-found");return D(b).then(function(b){return new Promise(function(c,d){var e=b.transaction(["fcm_token_object_Store"],"readwrite").objectStore("fcm_token_object_Store").delete(a.swScope);e.onerror=function(a){d(a.target.error)};e.onsuccess=function(b){0===b.target.result?d(B.create("failed-to-delete-token")):
4026
- c(a)}})})})};var J=function(a){var b=this;this.a=new firebase.INTERNAL.ErrorFactory("messaging","Messaging",p);if(!a.options.messagingSenderId||"string"!==typeof a.options.messagingSenderId)throw this.a.create("bad-sender-id");this.l=a.options.messagingSenderId;this.c=new C;this.app=a;this.INTERNAL={};this.INTERNAL.delete=function(){return b.delete}};
4027
- J.prototype.getToken=function(){var a=this,b=Notification.permission;return"granted"!==b?"denied"===b?Promise.reject(this.a.create("notifications-blocked")):Promise.resolve(null):this.f().then(function(b){return a.c.i(a.l,b).then(function(c){return c?c:a.c.h(a.l,b)})})};J.prototype.getToken=J.prototype.getToken;J.prototype.deleteToken=function(a){var b=this;return this.c.deleteToken(a).then(function(){return b.f()}).then(function(a){return a?a.pushManager.getSubscription():null}).then(function(a){if(a)return a.unsubscribe()})};
4028
- J.prototype.deleteToken=J.prototype.deleteToken;J.prototype.f=function(){throw this.a.create("should-be-overriden");};J.prototype.requestPermission=function(){throw this.a.create("only-available-in-window");};J.prototype.useServiceWorker=function(){throw this.a.create("only-available-in-window");};J.prototype.useServiceWorker=J.prototype.useServiceWorker;J.prototype.onMessage=function(){throw this.a.create("only-available-in-window");};J.prototype.onMessage=J.prototype.onMessage;
4029
- J.prototype.onTokenRefresh=function(){throw this.a.create("only-available-in-window");};J.prototype.onTokenRefresh=J.prototype.onTokenRefresh;J.prototype.setBackgroundMessageHandler=function(){throw this.a.create("only-available-in-sw");};J.prototype.setBackgroundMessageHandler=J.prototype.setBackgroundMessageHandler;J.prototype.delete=function(){E(this.c)};var K=self,P=function(a){J.call(this,a);var b=this;this.a=new firebase.INTERNAL.ErrorFactory("messaging","Messaging",p);K.addEventListener("push",function(a){return L(b,a)},!1);K.addEventListener("pushsubscriptionchange",function(a){return N(b,a)},!1);K.addEventListener("notificationclick",function(a){return O(b,a)},!1);this.b=null};f(P,J);
4030
- var L=function(a,b){var c;try{c=b.data.json()}catch(e){return}var d=Q().then(function(b){if(b){if(c.notification||a.b)return R(a,c)}else{if((b=c)&&"object"===typeof b.notification){var d=Object.assign({},b.notification),e={};d.data=(e.FCM_MSG=b,e);b=d}else b=void 0;if(b)return K.registration.showNotification(b.title||"",b);if(a.b)return a.b(c)}});b.waitUntil(d)},N=function(a,b){var c=a.getToken().then(function(b){if(!b)throw a.a.create("no-fcm-token-for-resubscribe");var c=a.c;return F(c,b).then(function(b){if(!b)throw a.a.create("invalid-saved-token");
4031
- return K.registration.pushManager.subscribe(q).then(function(a){return H(b.w,a,b.v)}).catch(function(d){return c.deleteToken(b.A).then(function(){throw a.a.create("unable-to-resubscribe",{message:d});})})})});b.waitUntil(c)},O=function(a,b){if(b.notification&&b.notification.data&&b.notification.data.FCM_MSG){b.stopImmediatePropagation();b.notification.close();var c=b.notification.data.FCM_MSG,d=c.notification.click_action;if(d){var e=S(d).then(function(a){return a?a:K.clients.openWindow(d)}).then(function(b){if(b)return delete c.notification,
4032
- T(a,b,r("notification-clicked",c))});b.waitUntil(e)}}};P.prototype.setBackgroundMessageHandler=function(a){if(a&&"function"!==typeof a)throw this.a.create("bg-handler-function-expected");this.b=a};P.prototype.setBackgroundMessageHandler=P.prototype.setBackgroundMessageHandler;
4033
- var S=function(a){var b=(new URL(a)).href;return K.clients.matchAll({type:"window",includeUncontrolled:!0}).then(function(a){for(var c=null,e=0;e<a.length;e++)if((new URL(a[e].url)).href===b){c=a[e];break}if(c)return c.focus(),c})},T=function(a,b,c){return new Promise(function(d,e){if(!b)return e(a.a.create("no-window-client-to-msg"));b.postMessage(c);d()})},Q=function(){return K.clients.matchAll({type:"window",includeUncontrolled:!0}).then(function(a){return a.some(function(a){return"visible"===
4034
- a.visibilityState})})},R=function(a,b){return K.clients.matchAll({type:"window",includeUncontrolled:!0}).then(function(c){var d=r("push-msg-received",b);return Promise.all(c.map(function(b){return T(a,b,d)}))})};P.prototype.f=function(){return Promise.resolve(K.registration)};var V=function(a){J.call(this,a);var b=this;this.j=null;this.m=firebase.INTERNAL.createSubscribe(function(a){b.j=a});this.s=null;this.o=firebase.INTERNAL.createSubscribe(function(a){b.s=a});U(this)};f(V,J);
4035
- V.prototype.getToken=function(){var a=this;return"serviceWorker"in navigator&&"PushManager"in window&&"Notification"in window&&ServiceWorkerRegistration.prototype.hasOwnProperty("showNotification")&&PushSubscription.prototype.hasOwnProperty("getKey")?W(this).then(function(){return J.prototype.getToken.call(a)}):Promise.reject(this.a.create("unsupported-browser"))};V.prototype.getToken=V.prototype.getToken;
4036
- var W=function(a){if(a.g)return a.g;var b=document.querySelector('link[rel="manifest"]');b?a.g=fetch(b.href).then(function(a){return a.json()}).catch(function(){return Promise.resolve()}).then(function(b){if(b&&b.gcm_sender_id&&"103953800507"!==b.gcm_sender_id)throw a.a.create("incorrect-gcm-sender-id");}):a.g=Promise.resolve();return a.g};
4037
- V.prototype.requestPermission=function(){var a=this;return"granted"===Notification.permission?Promise.resolve():new Promise(function(b,c){var d=function(d){return"granted"===d?b():"denied"===d?c(a.a.create("permission-blocked")):c(a.a.create("permission-default"))},e=Notification.requestPermission(function(a){e||d(a)});e&&e.then(d)})};V.prototype.requestPermission=V.prototype.requestPermission;
4038
- V.prototype.useServiceWorker=function(a){if(!(a instanceof ServiceWorkerRegistration))throw this.a.create("sw-registration-expected");if("undefined"!==typeof this.b)throw this.a.create("use-sw-before-get-token");this.b=a};V.prototype.useServiceWorker=V.prototype.useServiceWorker;V.prototype.onMessage=function(a,b,c){return this.m(a,b,c)};V.prototype.onMessage=V.prototype.onMessage;V.prototype.onTokenRefresh=function(a,b,c){return this.o(a,b,c)};V.prototype.onTokenRefresh=V.prototype.onTokenRefresh;
4039
- var X=function(a,b){var c=b.installing||b.waiting||b.active;return new Promise(function(d,e){if(c)if("activated"===c.state)d(b);else if("redundant"===c.state)e(a.a.create("sw-reg-redundant"));else{var n=function(){if("activated"===c.state)d(b);else if("redundant"===c.state)e(a.a.create("sw-reg-redundant"));else return;c.removeEventListener("statechange",n)};c.addEventListener("statechange",n)}else e(a.a.create("no-sw-in-reg"))})};
4040
- V.prototype.f=function(){var a=this;if(this.b)return X(this,this.b);this.b=null;return navigator.serviceWorker.register("/firebase-messaging-sw.js",{scope:"/firebase-cloud-messaging-push-scope"}).catch(function(b){throw a.a.create("failed-serviceworker-registration",{browserErrorMessage:b.message});}).then(function(b){return X(a,b).then(function(){a.b=b;b.update();return b})})};
4041
- var U=function(a){"serviceWorker"in navigator&&navigator.serviceWorker.addEventListener("message",function(b){if(b.data&&b.data["firebase-messaging-msg-type"])switch(b=b.data,b["firebase-messaging-msg-type"]){case "push-msg-received":case "notification-clicked":a.j.next(b["firebase-messaging-msg-data"])}},!1)};if(!(firebase&&firebase.INTERNAL&&firebase.INTERNAL.registerService))throw Error("Cannot install Firebase Messaging - be sure to load firebase-app.js first.");firebase.INTERNAL.registerService("messaging",function(a){return self&&"ServiceWorkerGlobalScope"in self?new P(a):new V(a)},{Messaging:V});}).call(this);
4042
- (function(){for(var k,aa="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(c.get||c.set)throw new TypeError("ES3 does not support getters and setters.");a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)},l="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global&&null!=global?global:this,m=["Number","MIN_SAFE_INTEGER"],ba=0;ba<m.length-1;ba++){var ca=m[ba];ca in l||(l[ca]={});l=l[ca]}var da=m[m.length-1];
4043
- -9007199254740991!=l[da]&&aa(l,da,{configurable:!0,writable:!0,value:-9007199254740991});
4044
- var n=this,q=function(a){return void 0!==a},ea=function(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&
4045
- !a.propertyIsEnumerable("call"))return"function"}else return"null";else if("function"==b&&"undefined"==typeof a.call)return"object";return b};var r=function(a,b){return-1!==a.indexOf(b)};var fa=function(a,b,c){function d(){z||(z=!0,b.apply(null,arguments))}function e(b){p=setTimeout(function(){p=null;a(g,2===C)},b)}function g(a,b){if(!z)if(a)d.apply(null,arguments);else if(2===C||B)d.apply(null,arguments);else{64>h&&(h*=2);var c;1===C?(C=2,c=0):c=1E3*(h+Math.random());e(c)}}function f(a){Ma||(Ma=!0,z||(null!==p?(a||(C=2),clearTimeout(p),e(0)):a||(C=1)))}var h=1,p=null,B=!1,C=0,z=!1,Ma=!1;e(0);setTimeout(function(){B=!0;f(!0)},c);return f};var t="https://firebasestorage.googleapis.com";var u=function(a,b){this.code="storage/"+a;this.message="Firebase Storage: "+b;this.serverResponse=null;this.name="FirebaseError"};(function(){var a=Error;function b(){}b.prototype=a.prototype;u.b=a.prototype;u.prototype=new b;u.a=function(b,d,e){for(var c=Array(arguments.length-2),f=2;f<arguments.length;f++)c[f-2]=arguments[f];return a.prototype[d].apply(b,c)}})();
4046
- var ga=function(){return new u("unknown","An unknown error occurred, please check the error payload for server response.")},ha=function(){return new u("canceled","User canceled the upload/download.")},ia=function(){return new u("cannot-slice-blob","Cannot slice blob for upload. Please retry the upload.")},ja=function(a,b,c){return new u("invalid-argument","Invalid argument in `"+b+"` at index "+a+": "+c)},ka=function(){return new u("app-deleted","The Firebase app was deleted.")},v=function(a,b){return new u("invalid-format",
4047
- "String does not match format '"+a+"': "+b)},la=function(a){throw new u("internal-error","Internal error: "+a);};var ma=function(a,b){for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&b(c,a[c])},na=function(a){var b={};ma(a,function(a,d){b[a]=d});return b};var oa=function(a,b){b=b.split("/").filter(function(a){return 0<a.length}).join("/");return 0===a.length?b:a+"/"+b},pa=function(a){var b=a.lastIndexOf("/",a.length-2);return-1===b?a:a.slice(b+1)};var qa=function(a){if("undefined"!==typeof firebase)return new firebase.Promise(a);throw Error("Error in Firebase Storage - be sure to load firebase-app.js first.");};var w=function(a,b,c,d){this.h=a;this.b={};this.method=b;this.headers={};this.body=null;this.j=c;this.l=this.a=null;this.c=[200];this.g=[];this.timeout=d;this.f=!0};var ra={STATE_CHANGED:"state_changed"},x={RUNNING:"running",PAUSED:"paused",SUCCESS:"success",CANCELED:"canceled",ERROR:"error"},sa=function(a){switch(a){case "running":case "pausing":case "canceling":return"running";case "paused":return"paused";case "success":return"success";case "canceled":return"canceled";case "error":return"error";default:return"error"}};var y=function(a){return q(a)&&null!==a},ta=function(a){return"string"===typeof a||a instanceof String},ua=function(){return"undefined"!==typeof Blob};var wa=function(a,b){var c=va;return Object.prototype.hasOwnProperty.call(c,a)?c[a]:c[a]=b(a)};var xa=String.prototype.trim?function(a){return a.trim()}:function(a){return a.replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},ya=function(a,b){return a<b?-1:a>b?1:0};var A=function(a){return function(){var b=[];Array.prototype.push.apply(b,arguments);firebase.Promise.resolve(!0).then(function(){a.apply(null,b)})}};var D=function(a,b){this.bucket=a;this.path=b},za=function(a){var b=encodeURIComponent;return"/b/"+b(a.bucket)+"/o/"+b(a.path)},Ba=function(a){var b;try{b=Aa(a)}catch(c){return new D(a,"")}if(""===b.path)return b;throw new u("invalid-default-bucket","Invalid default bucket '"+a+"'.");},Aa=function(a){for(var b=null,c=[{K:/^gs:\/\/([A-Za-z0-9.\-]+)(\/(.*))?$/i,G:{bucket:1,path:3},J:function(a){"/"===a.path.charAt(a.path.length-1)&&(a.path=a.path.slice(0,-1))}},{K:/^https?:\/\/firebasestorage\.googleapis\.com\/v[A-Za-z0-9_]+\/b\/([A-Za-z0-9.\-]+)\/o(\/([^?#]*).*)?$/i,
4048
- G:{bucket:1,path:3},J:function(a){a.path=decodeURIComponent(a.path)}}],d=0;d<c.length;d++){var e=c[d],g=e.K.exec(a);if(g){b=g[e.G.bucket];(g=g[e.G.path])||(g="");b=new D(b,g);e.J(b);break}}if(null==b)throw new u("invalid-url","Invalid URL '"+a+"'.");return b};var Ca=function(a,b,c){"function"==ea(a)||y(b)||y(c)?(this.b=a,this.error=b||null,this.a=c||null):(this.b=a.next||null,this.error=a.error||null,this.a=a.complete||null)};var E={RAW:"raw",BASE64:"base64",BASE64URL:"base64url",DATA_URL:"data_url"},Da=function(a){switch(a){case "raw":case "base64":case "base64url":case "data_url":break;default:throw"Expected one of the event types: [raw, base64, base64url, data_url].";}},Ea=function(a,b){this.data=a;this.a=b||null},Ia=function(a,b){switch(a){case "raw":return new Ea(Fa(b));case "base64":case "base64url":return new Ea(Ga(a,b));case "data_url":a=new Ha(b);var c;if(a.a)c=Ga("base64",a.c);else{try{c=decodeURIComponent(a.c)}catch(d){throw v("data_url",
4049
- "Malformed data URL.");}c=Fa(c)}return new Ea(c,(new Ha(b)).b)}throw ga();},Fa=function(a){for(var b=[],c=0;c<a.length;c++){var d=a.charCodeAt(c);if(127>=d)b.push(d);else if(2047>=d)b.push(192|d>>6,128|d&63);else if(55296==(d&64512))if(c<a.length-1&&56320==(a.charCodeAt(c+1)&64512)){var e=a.charCodeAt(++c),d=65536|(d&1023)<<10|e&1023;b.push(240|d>>18,128|d>>12&63,128|d>>6&63,128|d&63)}else b.push(239,191,189);else 56320==(d&64512)?b.push(239,191,189):b.push(224|d>>12,128|d>>6&63,128|d&63)}return new Uint8Array(b)},
4050
- Ga=function(a,b){switch(a){case "base64":var c=-1!==b.indexOf("-"),d=-1!==b.indexOf("_");if(c||d)throw v(a,"Invalid character '"+(c?"-":"_")+"' found: is it base64url encoded?");break;case "base64url":c=-1!==b.indexOf("+");d=-1!==b.indexOf("/");if(c||d)throw v(a,"Invalid character '"+(c?"+":"/")+"' found: is it base64 encoded?");b=b.replace(/-/g,"+").replace(/_/g,"/")}var e;try{e=atob(b)}catch(g){throw v(a,"Invalid character found");}a=new Uint8Array(e.length);for(b=0;b<e.length;b++)a[b]=e.charCodeAt(b);
4051
- return a},Ha=function(a){var b=a.match(/^data:([^,]+)?,/);if(null===b)throw v("data_url","Must be formatted 'data:[<mediatype>][;base64],<data>");b=b[1]||null;this.a=!1;this.b=null;if(null!=b){var c=b.length-7;this.b=(this.a=0<=c&&b.indexOf(";base64",c)==c)?b.substring(0,b.length-7):b}this.c=a.substring(a.indexOf(",")+1)};var Ja=function(a){var b=encodeURIComponent,c="?";ma(a,function(a,e){a=b(a)+"="+b(e);c=c+a+"&"});return c=c.slice(0,-1)};var Ka=function(){var a=this;this.a=new XMLHttpRequest;this.c=0;this.f=qa(function(b){a.a.addEventListener("abort",function(){a.c=2;b(a)});a.a.addEventListener("error",function(){a.c=1;b(a)});a.a.addEventListener("load",function(){b(a)})});this.b=!1},La=function(a,b,c,d,e){if(a.b)throw la("cannot .send() more than once");a.b=!0;a.a.open(c,b,!0);y(e)&&ma(e,function(b,c){a.a.setRequestHeader(b,c.toString())});y(d)?a.a.send(d):a.a.send();return a.f},Na=function(a){if(!a.b)throw la("cannot .getErrorCode() before sending");
4052
- return a.c},F=function(a){if(!a.b)throw la("cannot .getStatus() before sending");try{return a.a.status}catch(b){return-1}},Oa=function(a){if(!a.b)throw la("cannot .getResponseText() before sending");return a.a.responseText};Ka.prototype.abort=function(){this.a.abort()};var G=function(a,b,c,d,e,g){this.b=a;this.h=b;this.f=c;this.a=d;this.g=e;this.c=g};k=G.prototype;k.V=function(){return this.b};k.qa=function(){return this.h};k.na=function(){return this.f};k.ia=function(){return this.a};k.W=function(){if(y(this.a)){var a=this.a.downloadURLs;return y(a)&&y(a[0])?a[0]:null}return null};k.pa=function(){return this.g};k.la=function(){return this.c};var H;a:{var Pa=n.navigator;if(Pa){var Qa=Pa.userAgent;if(Qa){H=Qa;break a}}H=""};var Sa=function(a,b,c,d,e,g,f,h,p,B,C){this.C=a;this.A=b;this.v=c;this.o=d;this.B=e.slice();this.m=g.slice();this.j=this.l=this.c=this.b=null;this.f=this.g=!1;this.s=f;this.h=h;this.D=C;this.w=p;var z=this;this.u=qa(function(a,b){z.l=a;z.j=b;Ra(z)})},Ta=function(a,b,c){this.b=a;this.c=b;this.a=!!c},Ra=function(a){function b(a,b){b?a(!1,new Ta(!1,null,!0)):(b=new Ka,b.a.withCredentials=d.D,d.b=b,La(b,d.C,d.A,d.o,d.v).then(function(b){d.b=null;var c=0===Na(b),e=F(b);if(!(c=!c))var c=r([408,429],e),
4053
- g=r(d.m,e),c=500<=e&&600>e||c||g;c?(b=2===Na(b),a(!1,new Ta(!1,null,b))):a(!0,new Ta(r(d.B,e),b))}))}function c(a,b){var c=d.l;a=d.j;var e=b.c;if(b.b)try{var g=d.s(e,Oa(e));q(g)?c(g):c()}catch(B){a(B)}else null!==e?(b=ga(),g=Oa(e),b.serverResponse=g,d.h?a(d.h(e,b)):a(b)):(b=b.a?d.f?ka():ha():new u("retry-limit-exceeded","Max retry time for operation exceeded, please try again."),a(b))}var d=a;a.g?c(0,new Ta(!1,null,!0)):a.c=fa(b,c,a.w)};Sa.prototype.a=function(){return this.u};
4054
- Sa.prototype.cancel=function(a){this.g=!0;this.f=a||!1;null!==this.c&&(0,this.c)(!1);null!==this.b&&this.b.abort()};var Ua=function(a,b,c){var d=Ja(a.b),d=a.h+d,e=a.headers?na(a.headers):{};null!==b&&0<b.length&&(e.Authorization="Firebase "+b);e["X-Firebase-Storage-Version"]="webjs/"+("undefined"!==typeof firebase?firebase.SDK_VERSION:"AppManager");return new Sa(d,a.method,e,a.body,a.c,a.g,a.j,a.a,a.timeout,0,c)};var Va=function(){};var Wa=function(a){this.b=firebase.Promise.reject(a)};Wa.prototype.a=function(){return this.b};Wa.prototype.cancel=function(){};var Xa=function(){this.a={};this.b=Number.MIN_SAFE_INTEGER},Ya=function(a,b){function c(){delete e.a[d]}var d=a.b;a.b++;a.a[d]=b;var e=a;b.a().then(c,c)},Za=function(a){ma(a.a,function(a,c){c&&c.cancel(!0)});a.a={}};var $a=function(a,b,c,d,e){this.a=a;this.g=null;null!==this.a&&(a=this.a.options,y(a)&&(a=a.storageBucket||null,this.g=null==a?null:Ba(a).bucket));this.o=b;this.m=c;this.j=e;this.l=d;this.c=12E4;this.b=6E4;this.h=new Xa;this.f=!1},ab=function(a){return null!==a.a&&y(a.a.INTERNAL)&&y(a.a.INTERNAL.getToken)?a.a.INTERNAL.getToken().then(function(a){return y(a)?a.accessToken:null},function(){return null}):firebase.Promise.resolve(null)};$a.prototype.bucket=function(){if(this.f)throw ka();return this.g};
4055
- var I=function(a,b,c){if(a.f)return new Wa(ka());b=a.m(b,c,null===a.a,a.j);Ya(a.h,b);return b};var bb=-1!=H.indexOf("Opera"),cb=-1!=H.indexOf("Trident")||-1!=H.indexOf("MSIE"),db=-1!=H.indexOf("Edge"),eb=-1!=H.indexOf("Gecko")&&!(-1!=H.toLowerCase().indexOf("webkit")&&-1==H.indexOf("Edge"))&&!(-1!=H.indexOf("Trident")||-1!=H.indexOf("MSIE"))&&-1==H.indexOf("Edge"),fb=-1!=H.toLowerCase().indexOf("webkit")&&-1==H.indexOf("Edge"),gb;
4056
- a:{var hb="",ib=function(){var a=H;if(eb)return/rv\:([^\);]+)(\)|;)/.exec(a);if(db)return/Edge\/([\d\.]+)/.exec(a);if(cb)return/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(a);if(fb)return/WebKit\/(\S+)/.exec(a);if(bb)return/(?:Version)[ \/]?(\S+)/.exec(a)}();ib&&(hb=ib?ib[1]:"");if(cb){var jb,kb=n.document;jb=kb?kb.documentMode:void 0;if(null!=jb&&jb>parseFloat(hb)){gb=String(jb);break a}}gb=hb}
4057
- var lb=gb,va={},mb=function(a){return wa(a,function(){for(var b=0,c=xa(String(lb)).split("."),d=xa(String(a)).split("."),e=Math.max(c.length,d.length),g=0;0==b&&g<e;g++){var f=c[g]||"",h=d[g]||"";do{f=/(\d*)(\D*)(.*)/.exec(f)||["","","",""];h=/(\d*)(\D*)(.*)/.exec(h)||["","","",""];if(0==f[0].length&&0==h[0].length)break;b=ya(0==f[1].length?0:parseInt(f[1],10),0==h[1].length?0:parseInt(h[1],10))||ya(0==f[2].length,0==h[2].length)||ya(f[2],h[2]);f=f[3];h=h[3]}while(0==b)}return 0<=b})};var nb=function(a){var b=n.BlobBuilder||n.WebKitBlobBuilder;if(q(b)){for(var b=new b,c=0;c<arguments.length;c++)b.append(arguments[c]);return b.getBlob()}b=Array.prototype.slice.call(arguments);c=n.BlobBuilder||n.WebKitBlobBuilder;if(q(c)){for(var c=new c,d=0;d<b.length;d++)c.append(b[d],void 0);b=c.getBlob(void 0)}else if(q(n.Blob))b=new Blob(b,{});else throw Error("This browser doesn't seem to support creating Blobs");return b},ob=function(a,b,c){q(c)||(c=a.size);return a.webkitSlice?a.webkitSlice(b,
4058
- c):a.mozSlice?a.mozSlice(b,c):a.slice?eb&&!mb("13.0")||fb&&!mb("537.1")?(0>b&&(b+=a.size),0>b&&(b=0),0>c&&(c+=a.size),c<b&&(c=b),a.slice(b,c-b)):a.slice(b,c):null};var pb=function(a,b){return b},J=function(a,b,c,d){this.c=a;this.b=b||a;this.writable=!!c;this.a=d||pb},qb=null,rb=function(){if(qb)return qb;var a=[];a.push(new J("bucket"));a.push(new J("generation"));a.push(new J("metageneration"));a.push(new J("name","fullPath",!0));var b=new J("name");b.a=function(a,b){return!ta(b)||2>b.length?b:pa(b)};a.push(b);b=new J("size");b.a=function(a,b){return y(b)?+b:b};a.push(b);a.push(new J("timeCreated"));a.push(new J("updated"));a.push(new J("md5Hash",null,!0));
4059
- a.push(new J("cacheControl",null,!0));a.push(new J("contentDisposition",null,!0));a.push(new J("contentEncoding",null,!0));a.push(new J("contentLanguage",null,!0));a.push(new J("contentType",null,!0));a.push(new J("metadata","customMetadata",!0));a.push(new J("downloadTokens","downloadURLs",!1,function(a,b){if(!(ta(b)&&0<b.length))return[];var c=encodeURIComponent;return b.split(",").map(function(b){var d=a.fullPath,d="https://firebasestorage.googleapis.com/v0"+("/b/"+c(a.bucket)+"/o/"+c(d));b=Ja({alt:"media",
4060
- token:b});return d+b})}));return qb=a},sb=function(a,b){Object.defineProperty(a,"ref",{get:function(){return b.o(b,new D(a.bucket,a.fullPath))}})},tb=function(a,b){for(var c={},d=b.length,e=0;e<d;e++){var g=b[e];g.writable&&(c[g.c]=a[g.b])}return JSON.stringify(c)},ub=function(a){if(!a||"object"!==typeof a)throw"Expected Metadata object.";for(var b in a){var c=a[b];if("customMetadata"===b){if("object"!==typeof c)throw"Expected object for 'customMetadata' mapping.";}else if(null!=c&&"object"===typeof c)throw"Mapping for '"+
4061
- b+"' cannot be an object.";}};var K=function(a,b,c){for(var d=b.length,e=b.length,g=0;g<b.length;g++)if(b[g].b){d=g;break}if(!(d<=c.length&&c.length<=e))throw d===e?(b=d,d=1===d?"argument":"arguments"):(b="between "+d+" and "+e,d="arguments"),new u("invalid-argument-count","Invalid argument count in `"+a+"`: Expected "+b+" "+d+", received "+c.length+".");for(g=0;g<c.length;g++)try{b[g].a(c[g])}catch(f){if(f instanceof Error)throw ja(g,a,f.message);throw ja(g,a,f);}},L=function(a,b){var c=this;this.a=function(b){c.b&&!q(b)||a(b)};
4062
- this.b=!!b},vb=function(a,b){return function(c){a(c);b(c)}},M=function(a,b){function c(a){if(!("string"===typeof a||a instanceof String))throw"Expected string.";}var d;a?d=vb(c,a):d=c;return new L(d,b)},wb=function(){return new L(function(a){if(!(a instanceof Uint8Array||a instanceof ArrayBuffer||ua()&&a instanceof Blob))throw"Expected Blob or File.";})},xb=function(){return new L(function(a){if(!(("number"===typeof a||a instanceof Number)&&0<=a))throw"Expected a number 0 or greater.";})},yb=function(a,
4063
- b){return new L(function(b){if(!(null===b||y(b)&&b instanceof Object))throw"Expected an Object.";y(a)&&a(b)},b)},N=function(){return new L(function(a){if(null!==a&&"function"!=ea(a))throw"Expected a Function.";},!0)};var O=function(a,b){ua()&&a instanceof Blob?(this.i=a,b=a.size,a=a.type):(a instanceof ArrayBuffer?(b?this.i=new Uint8Array(a):(this.i=new Uint8Array(a.byteLength),this.i.set(new Uint8Array(a))),b=this.i.length):(b?this.i=a:(this.i=new Uint8Array(a.length),this.i.set(a)),b=a.length),a="");this.a=b;this.b=a};O.prototype.type=function(){return this.b};
4064
- O.prototype.slice=function(a,b){if(ua()&&this.i instanceof Blob)return a=ob(this.i,a,b),null===a?null:new O(a);a=new Uint8Array(this.i.buffer,a,b-a);return new O(a,!0)};
4065
- var zb=function(a){var b=[];Array.prototype.push.apply(b,arguments);if(ua())return b=b.map(function(a){return a instanceof O?a.i:a}),new O(nb.apply(null,b));var b=b.map(function(a){return ta(a)?Ia("raw",a).data.buffer:a.i.buffer}),c=0;b.forEach(function(a){c+=a.byteLength});var d=new Uint8Array(c),e=0;b.forEach(function(a){a=new Uint8Array(a);for(var b=0;b<a.length;b++)d[e++]=a[b]});return new O(d,!0)};var P=function(a){if(!a)throw ga();},Ab=function(a,b){return function(c,d){var e;a:{try{e=JSON.parse(d)}catch(h){e=null;break a}c=typeof e;e="object"==c&&null!=e||"function"==c?e:null}if(null===e)e=null;else{c={type:"file"};d=b.length;for(var g=0;g<d;g++){var f=b[g];c[f.b]=f.a(c,e[f.c])}sb(c,a);e=c}P(null!==e);return e}},Q=function(a){return function(b,c){b=401===F(b)?new u("unauthenticated","User is not authenticated, please authenticate using Firebase Authentication and try again."):402===F(b)?
4066
- new u("quota-exceeded","Quota for bucket '"+a.bucket+"' exceeded, please view quota on https://firebase.google.com/pricing/."):403===F(b)?new u("unauthorized","User does not have permission to access '"+a.path+"'."):c;b.serverResponse=c.serverResponse;return b}},Bb=function(a){var b=Q(a);return function(c,d){var e=b(c,d);404===F(c)&&(e=new u("object-not-found","Object '"+a.path+"' does not exist."));e.serverResponse=d.serverResponse;return e}},Cb=function(a,b,c){var d=za(b);a=new w(t+"/v0"+d,"GET",
4067
- Ab(a,c),a.c);a.a=Bb(b);return a},Db=function(a,b){var c=za(b);a=new w(t+"/v0"+c,"DELETE",function(){},a.c);a.c=[200,204];a.a=Bb(b);return a},Eb=function(a,b,c){c=c?na(c):{};c.fullPath=a.path;c.size=b.a;c.contentType||(a=b&&b.type()||"application/octet-stream",c.contentType=a);return c},Fb=function(a,b,c,d,e){var g="/b/"+encodeURIComponent(b.bucket)+"/o",f={"X-Goog-Upload-Protocol":"multipart"},h;h="";for(var p=0;2>p;p++)h+=Math.random().toString().slice(2);f["Content-Type"]="multipart/related; boundary="+
4068
- h;e=Eb(b,d,e);p=tb(e,c);d=zb("--"+h+"\r\nContent-Type: application/json; charset=utf-8\r\n\r\n"+p+"\r\n--"+h+"\r\nContent-Type: "+e.contentType+"\r\n\r\n",d,"\r\n--"+h+"--");if(null===d)throw ia();a=new w(t+"/v0"+g,"POST",Ab(a,c),a.b);a.b={name:e.fullPath};a.headers=f;a.body=d.i;a.a=Q(b);return a},Gb=function(a,b,c,d){this.a=a;this.total=b;this.b=!!c;this.c=d||null},Hb=function(a,b){var c;try{c=a.a.getResponseHeader("X-Goog-Upload-Status")}catch(d){P(!1)}P(r(b||["active"],c));return c},Ib=function(a,
4069
- b,c,d,e){var g="/b/"+encodeURIComponent(b.bucket)+"/o",f=Eb(b,d,e);e={name:f.fullPath};g=t+"/v0"+g;d={"X-Goog-Upload-Protocol":"resumable","X-Goog-Upload-Command":"start","X-Goog-Upload-Header-Content-Length":d.a,"X-Goog-Upload-Header-Content-Type":f.contentType,"Content-Type":"application/json; charset=utf-8"};c=tb(f,c);a=new w(g,"POST",function(a){Hb(a);var b;try{b=a.a.getResponseHeader("X-Goog-Upload-URL")}catch(B){P(!1)}P(ta(b));return b},a.b);a.b=e;a.headers=d;a.body=c;a.a=Q(b);return a},Jb=
4070
- function(a,b,c,d){a=new w(c,"POST",function(a){var b=Hb(a,["active","final"]),c;try{c=a.a.getResponseHeader("X-Goog-Upload-Size-Received")}catch(h){P(!1)}a=c;isFinite(a)&&(a=String(a));a="string"==typeof a?/^\s*-?0x/i.test(a)?parseInt(a,16):parseInt(a,10):NaN;P(!isNaN(a));return new Gb(a,d.a,"final"===b)},a.b);a.headers={"X-Goog-Upload-Command":"query"};a.a=Q(b);a.f=!1;return a},Kb=function(a,b,c,d,e,g,f){var h=new Gb(0,0);f?(h.a=f.a,h.total=f.total):(h.a=0,h.total=d.a);if(d.a!==h.total)throw new u("server-file-wrong-size",
4071
- "Server recorded incorrect upload file size, please retry the upload.");var p=f=h.total-h.a;0<e&&(p=Math.min(p,e));var B=h.a;e={"X-Goog-Upload-Command":p===f?"upload, finalize":"upload","X-Goog-Upload-Offset":h.a};f=d.slice(B,B+p);if(null===f)throw ia();c=new w(c,"POST",function(a,c){var e=Hb(a,["active","final"]),f=h.a+p,C=d.a,z;"final"===e?z=Ab(b,g)(a,c):z=null;return new Gb(f,C,"final"===e,z)},b.b);c.headers=e;c.body=f.i;c.l=null;c.a=Q(a);c.f=!1;return c};var T=function(a,b,c,d,e,g){this.L=a;this.c=b;this.l=c;this.f=e;this.h=g||null;this.s=d;this.m=0;this.D=this.u=!1;this.B=[];this.S=262144<this.f.a;this.b="running";this.a=this.v=this.g=null;this.j=1;var f=this;this.F=function(a){f.a=null;f.j=1;"storage/canceled"===a.code?(f.u=!0,R(f)):(f.g=a,S(f,"error"))};this.P=function(a){f.a=null;"storage/canceled"===a.code?R(f):(f.g=a,S(f,"error"))};this.A=this.o=null;this.C=qa(function(a,b){f.o=a;f.A=b;Lb(f)});this.C.then(null,function(){})},Lb=function(a){"running"===
4072
- a.b&&null===a.a&&(a.S?null===a.v?Mb(a):a.u?Nb(a):a.D?Ob(a):Pb(a):Qb(a))},U=function(a,b){ab(a.c).then(function(c){switch(a.b){case "running":b(c);break;case "canceling":S(a,"canceled");break;case "pausing":S(a,"paused")}})},Mb=function(a){U(a,function(b){var c=Ib(a.c,a.l,a.s,a.f,a.h);a.a=I(a.c,c,b);a.a.a().then(function(b){a.a=null;a.v=b;a.u=!1;R(a)},this.F)})},Nb=function(a){var b=a.v;U(a,function(c){var d=Jb(a.c,a.l,b,a.f);a.a=I(a.c,d,c);a.a.a().then(function(b){a.a=null;Rb(a,b.a);a.u=!1;b.b&&(a.D=
4073
- !0);R(a)},a.F)})},Pb=function(a){var b=262144*a.j,c=new Gb(a.m,a.f.a),d=a.v;U(a,function(e){var g;try{g=Kb(a.l,a.c,d,a.f,b,a.s,c)}catch(f){a.g=f;S(a,"error");return}a.a=I(a.c,g,e);a.a.a().then(function(b){33554432>262144*a.j&&(a.j*=2);a.a=null;Rb(a,b.a);b.b?(a.h=b.c,S(a,"success")):R(a)},a.F)})},Ob=function(a){U(a,function(b){var c=Cb(a.c,a.l,a.s);a.a=I(a.c,c,b);a.a.a().then(function(b){a.a=null;a.h=b;S(a,"success")},a.P)})},Qb=function(a){U(a,function(b){var c=Fb(a.c,a.l,a.s,a.f,a.h);a.a=I(a.c,c,
4074
- b);a.a.a().then(function(b){a.a=null;a.h=b;Rb(a,a.f.a);S(a,"success")},a.F)})},Rb=function(a,b){var c=a.m;a.m=b;a.m>c&&V(a)},S=function(a,b){if(a.b!==b)switch(b){case "canceling":a.b=b;null!==a.a&&a.a.cancel();break;case "pausing":a.b=b;null!==a.a&&a.a.cancel();break;case "running":var c="paused"===a.b;a.b=b;c&&(V(a),Lb(a));break;case "paused":a.b=b;V(a);break;case "canceled":a.g=ha();a.b=b;V(a);break;case "error":a.b=b;V(a);break;case "success":a.b=b,V(a)}},R=function(a){switch(a.b){case "pausing":S(a,
4075
- "paused");break;case "canceling":S(a,"canceled");break;case "running":Lb(a)}};T.prototype.w=function(){return new G(this.m,this.f.a,sa(this.b),this.h,this,this.L)};
4076
- T.prototype.M=function(a,b,c,d){function e(a){try{f(a);return}catch(z){}try{if(h(a),!(q(a.next)||q(a.error)||q(a.complete)))throw"";}catch(z){throw"Expected a function or an Object with one of `next`, `error`, `complete` properties.";}}function g(a){return function(b,c,d){null!==a&&K("on",a,arguments);var e=new Ca(b,c,d);Sb(p,e);return function(){var a=p.B,b=a.indexOf(e);-1!==b&&a.splice(b,1)}}}var f=N().a,h=yb(null,!0).a;K("on",[M(function(){if("state_changed"!==a)throw"Expected one of the event types: [state_changed].";
4077
- }),yb(e,!0),N(),N()],arguments);var p=this,B=[yb(function(a){if(null===a)throw"Expected a function or an Object with one of `next`, `error`, `complete` properties.";e(a)}),N(),N()];return q(b)||q(c)||q(d)?g(null)(b,c,d):g(B)};T.prototype.then=function(a,b){return this.C.then(a,b)};T.prototype["catch"]=function(a){return this.then(null,a)};
4078
- var Sb=function(a,b){a.B.push(b);Tb(a,b)},V=function(a){Ub(a);Array.prototype.slice.call(a.B).forEach(function(b){Tb(a,b)})},Ub=function(a){if(null!==a.o){var b=!0;switch(sa(a.b)){case "success":A(a.o.bind(null,a.w()))();break;case "canceled":case "error":A(a.A.bind(null,a.g))();break;default:b=!1}b&&(a.o=null,a.A=null)}},Tb=function(a,b){switch(sa(a.b)){case "running":case "paused":null!==b.b&&A(b.b.bind(b,a.w()))();break;case "success":null!==b.a&&A(b.a.bind(b))();break;case "canceled":case "error":null!==
4079
- b.error&&A(b.error.bind(b,a.g))();break;default:null!==b.error&&A(b.error.bind(b,a.g))()}};T.prototype.O=function(){K("resume",[],arguments);var a="paused"===this.b||"pausing"===this.b;a&&S(this,"running");return a};T.prototype.N=function(){K("pause",[],arguments);var a="running"===this.b;a&&S(this,"pausing");return a};T.prototype.cancel=function(){K("cancel",[],arguments);var a="running"===this.b||"pausing"===this.b;a&&S(this,"canceling");return a};var W=function(a,b){this.a=a;this.location=b instanceof D?b:Aa(b)};W.prototype.toString=function(){K("toString",[],arguments);return"gs://"+this.location.bucket+"/"+this.location.path};var Vb=function(a,b){return new W(a,b)};k=W.prototype;k.H=function(a){K("child",[M()],arguments);var b=oa(this.location.path,a);return Vb(this.a,new D(this.location.bucket,b))};
4080
- k.ka=function(){var a;a=this.location.path;if(0==a.length)a=null;else{var b=a.lastIndexOf("/");a=-1===b?"":a.slice(0,b)}return null===a?null:Vb(this.a,new D(this.location.bucket,a))};k.ma=function(){return Vb(this.a,new D(this.location.bucket,""))};k.U=function(){return this.location.bucket};k.fa=function(){return this.location.path};k.ja=function(){return pa(this.location.path)};k.oa=function(){return this.a.l};
4081
- k.Z=function(a,b){K("put",[wb(),new L(ub,!0)],arguments);X(this,"put");return new T(this,this.a,this.location,rb(),new O(a),b)};k.$=function(a,b,c){K("putString",[M(),M(Da,!0),new L(ub,!0)],arguments);X(this,"putString");var d=Ia(y(b)?b:"raw",a),e=c?na(c):{};!y(e.contentType)&&y(d.a)&&(e.contentType=d.a);return new T(this,this.a,this.location,rb(),new O(d.data,!0),e)};
4082
- k.X=function(){K("delete",[],arguments);X(this,"delete");var a=this;return ab(this.a).then(function(b){var c=Db(a.a,a.location);return I(a.a,c,b).a()})};k.I=function(){K("getMetadata",[],arguments);X(this,"getMetadata");var a=this;return ab(this.a).then(function(b){var c=Cb(a.a,a.location,rb());return I(a.a,c,b).a()})};
4083
- k.aa=function(a){K("updateMetadata",[new L(ub,void 0)],arguments);X(this,"updateMetadata");var b=this;return ab(this.a).then(function(c){var d=b.a,e=b.location,g=a,f=rb(),h=za(e),h=t+"/v0"+h,g=tb(g,f),d=new w(h,"PATCH",Ab(d,f),d.c);d.headers={"Content-Type":"application/json; charset=utf-8"};d.body=g;d.a=Bb(e);return I(b.a,d,c).a()})};
4084
- k.Y=function(){K("getDownloadURL",[],arguments);X(this,"getDownloadURL");return this.I().then(function(a){a=a.downloadURLs[0];if(y(a))return a;throw new u("no-download-url","The given file does not have any download URLs.");})};var X=function(a,b){if(""===a.location.path)throw new u("invalid-root-operation","The operation '"+b+"' cannot be performed on a root reference, create a non-root reference using child, such as .child('file.png').");};var Y=function(a,b,c){this.a=new $a(a,function(a,b){return new W(a,b)},Ua,this,b);this.c=a;q(c)?this.b=Ba(c):null!=this.a.bucket()&&(this.b=new D(this.a.bucket(),""));this.f=new Wb(this)};k=Y.prototype;k.ba=function(a){K("ref",[M(function(a){if(/^[A-Za-z]+:\/\//.test(a))throw"Expected child path but got a URL, use refFromURL instead.";},!0)],arguments);if(null===this.b)throw Error("No Storage Bucket defined in Firebase Options.");var b=new W(this.a,this.b);return q(a)?b.H(a):b};
4085
- k.ca=function(a){K("refFromURL",[M(function(a){if(!/^[A-Za-z]+:\/\//.test(a))throw"Expected full URL but got a child path, use ref instead.";try{Aa(a)}catch(c){throw"Expected valid full URL but got an invalid one.";}},!1)],arguments);return new W(this.a,a)};k.ha=function(){return this.a.b};k.ea=function(a){K("setMaxUploadRetryTime",[xb()],arguments);this.a.b=a};k.ga=function(){return this.a.c};k.da=function(a){K("setMaxOperationRetryTime",[xb()],arguments);this.a.c=a};k.T=function(){return this.c};
4086
- k.R=function(){return this.f};var Wb=function(a){this.a=a};Wb.prototype.b=function(){var a=this.a.a;a.f=!0;a.a=null;Za(a.h)};var Z=function(a,b,c){Object.defineProperty(a,b,{get:c})};W.prototype.toString=W.prototype.toString;W.prototype.child=W.prototype.H;W.prototype.put=W.prototype.Z;W.prototype.putString=W.prototype.$;W.prototype["delete"]=W.prototype.X;W.prototype.getMetadata=W.prototype.I;W.prototype.updateMetadata=W.prototype.aa;W.prototype.getDownloadURL=W.prototype.Y;Z(W.prototype,"parent",W.prototype.ka);Z(W.prototype,"root",W.prototype.ma);Z(W.prototype,"bucket",W.prototype.U);Z(W.prototype,"fullPath",W.prototype.fa);
4087
- Z(W.prototype,"name",W.prototype.ja);Z(W.prototype,"storage",W.prototype.oa);Y.prototype.ref=Y.prototype.ba;Y.prototype.refFromURL=Y.prototype.ca;Z(Y.prototype,"maxOperationRetryTime",Y.prototype.ga);Y.prototype.setMaxOperationRetryTime=Y.prototype.da;Z(Y.prototype,"maxUploadRetryTime",Y.prototype.ha);Y.prototype.setMaxUploadRetryTime=Y.prototype.ea;Z(Y.prototype,"app",Y.prototype.T);Z(Y.prototype,"INTERNAL",Y.prototype.R);Wb.prototype["delete"]=Wb.prototype.b;Y.prototype.capi_=function(a){t=a};
4088
- T.prototype.on=T.prototype.M;T.prototype.resume=T.prototype.O;T.prototype.pause=T.prototype.N;T.prototype.cancel=T.prototype.cancel;T.prototype.then=T.prototype.then;T.prototype["catch"]=T.prototype["catch"];Z(T.prototype,"snapshot",T.prototype.w);Z(G.prototype,"bytesTransferred",G.prototype.V);Z(G.prototype,"totalBytes",G.prototype.qa);Z(G.prototype,"state",G.prototype.na);Z(G.prototype,"metadata",G.prototype.ia);Z(G.prototype,"downloadURL",G.prototype.W);Z(G.prototype,"task",G.prototype.pa);
4089
- Z(G.prototype,"ref",G.prototype.la);ra.STATE_CHANGED="state_changed";x.RUNNING="running";x.PAUSED="paused";x.SUCCESS="success";x.CANCELED="canceled";x.ERROR="error";E.RAW="raw";E.BASE64="base64";E.BASE64URL="base64url";E.DATA_URL="data_url";
4090
- (function(){function a(a,b,e){return new Y(a,new Va,e)}var b={TaskState:x,TaskEvent:ra,StringFormat:E,Storage:Y,Reference:W};if("undefined"!==typeof firebase)firebase.INTERNAL.registerService("storage",a,b);else throw Error("Cannot install Firebase Storage - be sure to load firebase-app.js first.");})();}).call(this);
3480
+ /*! @license Firebase v4.2.0
3481
+ Build: rev-d6b2db4
3482
+ Terms: https://firebase.google.com/terms/
3483
+
3484
+ ---
3485
+
3486
+ typedarray.js
3487
+ Copyright (c) 2010, Linden Research, Inc.
3488
+
3489
+ Permission is hereby granted, free of charge, to any person obtaining a copy
3490
+ of this software and associated documentation files (the "Software"), to deal
3491
+ in the Software without restriction, including without limitation the rights
3492
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
3493
+ copies of the Software, and to permit persons to whom the Software is
3494
+ furnished to do so, subject to the following conditions:
3495
+
3496
+ The above copyright notice and this permission notice shall be included in
3497
+ all copies or substantial portions of the Software.
3498
+
3499
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
3500
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
3501
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
3502
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
3503
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
3504
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
3505
+ THE SOFTWARE. */
3506
+
3507
+ var firebase=function(){var e=void 0===e?self:e;return function(t){function n(e){if(o[e])return o[e].exports;var r=o[e]={i:e,l:!1,exports:{}};return t[e].call(r.exports,r,r.exports,n),r.l=!0,r.exports}var r=e.webpackJsonpFirebase;e.webpackJsonpFirebase=function(e,o,c){for(var s,a,u,f=0,l=[];f<e.length;f++)a=e[f],i[a]&&l.push(i[a][0]),i[a]=0;for(s in o)Object.prototype.hasOwnProperty.call(o,s)&&(t[s]=o[s]);for(r&&r(e,o,c);l.length;)l.shift()();if(c)for(f=0;f<c.length;f++)u=n(n.s=c[f]);return u};var o={},i={3:0};return n.e=function(e){function t(){s.onerror=s.onload=null,clearTimeout(a);var t=i[e];0!==t&&(t&&t[1](Error("Loading chunk "+e+" failed.")),i[e]=void 0)}var r=i[e];if(0===r)return new Promise(function(e){e()});if(r)return r[2];var o=new Promise(function(t,n){r=i[e]=[t,n]});r[2]=o;var c=document.getElementsByTagName("head")[0],s=document.createElement("script");s.type="text/javascript",s.charset="utf-8",s.async=!0,s.timeout=12e4,n.nc&&s.setAttribute("nonce",n.nc),s.src=n.p+""+e+".js";var a=setTimeout(t,12e4);return s.onerror=s.onload=t,c.appendChild(s),o},n.m=t,n.c=o,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.t?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n.oe=function(e){throw console.error(e),e},n(n.s=5)}([,,,,function(e,t,n){"use strict";n.d(t,"b",function(){return o}),n.d(t,"a",function(){return i}),n.d(t,"c",function(){return c});var r=n(14),o=r.a.Promise||n(20),i=function(){function e(){var e=this;this.resolve=null,this.reject=null,this.promise=new o(function(t,n){e.resolve=t,e.reject=n})}return e.prototype.wrapCallback=function(e){function t(t,r){t?n.reject(t):n.resolve(r),"function"==typeof e&&(c(n.promise),1===e.length?e(t):e(t,r))}var n=this;return t},e}(),c=function(e){e.catch(function(){})}},function(e,t,n){"use strict";function r(){function e(e){v(y[e],"delete"),delete y[e]}function t(e){return e=e||f,u(y,e)||o("no-app",{name:e}),y[e]}function n(e,t){void 0===t?t=f:"string"==typeof t&&""!==t||o("bad-app-name",{name:t+""}),u(y,t)&&o("duplicate-app",{name:t});var n=new p(e,t,g);return y[t]=n,v(n,"create"),n}function l(){return Object.keys(y).map(function(e){return y[e]})}function h(e,n,r,i,c){b[e]&&o("duplicate-service",{name:e}),b[e]=n,i&&(_[e]=i,l().forEach(function(e){i("create",e)}));var s=function(n){return void 0===n&&(n=t()),"function"!=typeof n[e]&&o("invalid-app-argument",{name:e}),n[e]()};return void 0!==r&&Object(a.b)(s,r),g[e]=s,p.prototype[e]=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return this.r.bind(this,e).apply(this,c?t:[])},s}function d(e){Object(a.b)(g,e)}function v(e,t){Object.keys(b).forEach(function(n){var r=m(e,n);null!==r&&_[r]&&_[r](t,e)})}function m(e,t){if("serverAuth"===t)return null;var n=t;return e.options,n}var y={},b={},_={},g={t:!0,initializeApp:n,app:t,apps:null,Promise:s.b,SDK_VERSION:"4.2.0",INTERNAL:{registerService:h,createFirebaseNamespace:r,extendNamespace:d,createSubscribe:i.a,ErrorFactory:c.a,removeApp:e,factories:b,useAsService:m,Promise:s.b,deepExtend:a.b}};return Object(a.c)(g,"default",g),Object.defineProperty(g,"apps",{get:l}),Object(a.c)(t,"App",p),g}function o(e,t){throw d.create(e,t)}Object.defineProperty(t,"__esModule",{value:!0});var i=n(13),c=n(10),s=n(4),a=n(17),u=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},f="[DEFAULT]",l=[],p=function(){function e(e,t,n){this.u=n,this.f=!1,this.h={},this.v=t,this.y=Object(a.a)(e),this.INTERNAL={getUid:function(){return null},getToken:function(){return s.b.resolve(null)},addAuthTokenListener:function(e){l.push(e),setTimeout(function(){return e(null)},0)},removeAuthTokenListener:function(e){l=l.filter(function(t){return t!==e})}}}return Object.defineProperty(e.prototype,"name",{get:function(){return this._(),this.v},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"options",{get:function(){return this._(),this.y},enumerable:!0,configurable:!0}),e.prototype.delete=function(){var e=this;return new s.b(function(t){e._(),t()}).then(function(){e.u.INTERNAL.removeApp(e.v);var t=[];return Object.keys(e.h).forEach(function(n){Object.keys(e.h[n]).forEach(function(r){t.push(e.h[n][r])})}),s.b.all(t.map(function(e){return e.INTERNAL.delete()}))}).then(function(){e.f=!0,e.h={}})},e.prototype.r=function(e,t){if(void 0===t&&(t=f),this._(),this.h[e]||(this.h[e]={}),!this.h[e][t]){var n=t!==f?t:void 0,r=this.u.INTERNAL.factories[e](this,this.extendApp.bind(this),n);this.h[e][t]=r}return this.h[e][t]},e.prototype.extendApp=function(e){var t=this;Object(a.b)(this,e),e.INTERNAL&&e.INTERNAL.addAuthTokenListener&&(l.forEach(function(e){t.INTERNAL.addAuthTokenListener(e)}),l=[])},e.prototype._=function(){this.f&&o("app-deleted",{name:this.v})},e}();p.prototype.name&&p.prototype.options||p.prototype.delete||console.log("dc");var h={"no-app":"No Firebase App '{$name}' has been created - call Firebase App.initializeApp()","bad-app-name":"Illegal App name: '{$name}","duplicate-app":"Firebase App named '{$name}' already exists","app-deleted":"Firebase App named '{$name}' already deleted","duplicate-service":"Firebase service named '{$name}' already registered","sa-not-supported":"Initializing the Firebase SDK with a service account is only allowed in a Node.js environment. On client devices, you should instead initialize the SDK with an api key and auth domain","invalid-app-argument":"firebase.{$name}() takes either no argument or a Firebase App instance."},d=new c.a("app","Firebase",h),v=n(19),m=(n.n(v),r());t.default=m},,,,,function(e,t,n){"use strict";n.d(t,"a",function(){return c});var r="FirebaseError",o=Error.captureStackTrace,i=function(){function e(e,t){if(this.code=e,this.message=t,o)o(this,c.prototype.create);else{var n=Error.apply(this,arguments);this.name=r,Object.defineProperty(this,"stack",{get:function(){return n.stack}})}}return e}();i.prototype=Object.create(Error.prototype),i.prototype.constructor=i,i.prototype.name=r;var c=function(){function e(e,t,n){this.service=e,this.serviceName=t,this.errors=n,this.pattern=/\{\$([^}]+)}/g}return e.prototype.create=function(e,t){void 0===t&&(t={});var n,r=this.errors[e],o=this.service+"/"+e;n=void 0===r?"Error":r.replace(this.pattern,function(e,n){var r=t[n];return void 0!==r?""+r:"<"+n+"?>"}),n=this.serviceName+": "+n+" ("+o+").";var c=new i(o,n);for(var s in t)t.hasOwnProperty(s)&&"_"!==s.slice(-1)&&(c[s]=t[s]);return c},e}()},,,function(e,t,n){"use strict";function r(e,t){var n=new a(e,t);return n.subscribe.bind(n)}function o(e,t){if("object"!==(void 0===e?"undefined":s(e))||null===e)return!1;for(var n=0,r=t;n<r.length;n++){var o=r[n];if(o in e&&"function"==typeof e[o])return!0}return!1}function i(){}t.a=r;var c=n(4),s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a=function(){function e(e,t){var n=this;this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=c.b.resolve(),this.finalized=!1,this.onNoObservers=t,this.task.then(function(){e(n)}).catch(function(e){n.error(e)})}return e.prototype.next=function(e){this.forEachObserver(function(t){t.next(e)})},e.prototype.error=function(e){this.forEachObserver(function(t){t.error(e)}),this.close(e)},e.prototype.complete=function(){this.forEachObserver(function(e){e.complete()}),this.close()},e.prototype.subscribe=function(e,t,n){var r,c=this;if(void 0===e&&void 0===t&&void 0===n)throw Error("Missing Observer.");r=o(e,["next","error","complete"])?e:{next:e,error:t,complete:n},void 0===r.next&&(r.next=i),void 0===r.error&&(r.error=i),void 0===r.complete&&(r.complete=i);var s=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(function(){try{c.finalError?r.error(c.finalError):r.complete()}catch(e){}}),this.observers.push(r),s},e.prototype.unsubscribeOne=function(e){void 0!==this.observers&&void 0!==this.observers[e]&&(delete this.observers[e],this.observerCount-=1,0===this.observerCount&&void 0!==this.onNoObservers&&this.onNoObservers(this))},e.prototype.forEachObserver=function(e){if(!this.finalized)for(var t=0;t<this.observers.length;t++)this.sendOne(t,e)},e.prototype.sendOne=function(e,t){var n=this;this.task.then(function(){if(void 0!==n.observers&&void 0!==n.observers[e])try{t(n.observers[e])}catch(e){"undefined"!=typeof console&&console.error&&console.error(e)}})},e.prototype.close=function(e){var t=this;this.finalized||(this.finalized=!0,void 0!==e&&(this.finalError=e),this.task.then(function(){t.observers=void 0,t.onNoObservers=void 0}))},e}()},function(e,t,n){"use strict";(function(e){n.d(t,"a",function(){return o});var r;if(void 0!==e)r=e;else if("undefined"!=typeof self)r=self;else try{r=Function("return this")()}catch(e){throw Error("polyfill failed because global object is unavailable in this environment")}var o=r}).call(t,n(15))},function(t,n){var r;r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof e&&(r=e)}t.exports=r},function(e,t){function n(){throw Error("setTimeout has not been defined")}function r(){throw Error("clearTimeout has not been defined")}function o(e){if(f===setTimeout)return setTimeout(e,0);if((f===n||!f)&&setTimeout)return f=setTimeout,setTimeout(e,0);try{return f(e,0)}catch(t){try{return f.call(null,e,0)}catch(t){return f.call(this,e,0)}}}function i(e){if(l===clearTimeout)return clearTimeout(e);if((l===r||!l)&&clearTimeout)return l=clearTimeout,clearTimeout(e);try{return l(e)}catch(t){try{return l.call(null,e)}catch(t){return l.call(this,e)}}}function c(){v&&h&&(v=!1,h.length?d=h.concat(d):m=-1,d.length&&s())}function s(){if(!v){var e=o(c);v=!0;for(var t=d.length;t;){for(h=d,d=[];++m<t;)h&&h[m].run();m=-1,t=d.length}h=null,v=!1,i(e)}}function a(e,t){this.fun=e,this.array=t}function u(){}var f,l,p=e.exports={};!function(){try{f="function"==typeof setTimeout?setTimeout:n}catch(e){f=n}try{l="function"==typeof clearTimeout?clearTimeout:r}catch(e){l=r}}();var h,d=[],v=!1,m=-1;p.nextTick=function(e){var t=Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];d.push(new a(e,t)),1!==d.length||v||o(s)},a.prototype.run=function(){this.fun.apply(null,this.array)},p.title="browser",p.browser=!0,p.env={},p.argv=[],p.version="",p.versions={},p.on=u,p.addListener=u,p.once=u,p.off=u,p.removeListener=u,p.removeAllListeners=u,p.emit=u,p.prependListener=u,p.prependOnceListener=u,p.listeners=function(e){return[]},p.binding=function(e){throw Error("process.binding is not supported")},p.cwd=function(){return"/"},p.chdir=function(e){throw Error("process.chdir is not supported")},p.umask=function(){return 0}},function(e,t,n){"use strict";function r(e){return o(void 0,e)}function o(e,t){if(!(t instanceof Object))return t;switch(t.constructor){case Date:var n=t;return new Date(n.getTime());case Object:void 0===e&&(e={});break;case Array:e=[];break;default:return t}for(var r in t)t.hasOwnProperty(r)&&(e[r]=o(e[r],t[r]));return e}function i(e,t,n){e[t]=n}t.a=r,t.b=o,t.c=i},,function(e,t){Array.prototype.findIndex||Object.defineProperty(Array.prototype,"findIndex",{value:function(e){if(null==this)throw new TypeError('"this" is null or not defined');var t=Object(this),n=t.length>>>0;if("function"!=typeof e)throw new TypeError("predicate must be a function");for(var r=arguments[1],o=0;o<n;){var i=t[o];if(e.call(r,i,o,t))return o;o++}return-1}}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(e){if(null==this)throw new TypeError('"this" is null or not defined');var t=Object(this),n=t.length>>>0;if("function"!=typeof e)throw new TypeError("predicate must be a function");for(var r=arguments[1],o=0;o<n;){var i=t[o];if(e.call(r,i,o,t))return i;o++}}})},function(e,t,n){(function(t){!function(n){function r(){}function o(e,t){return function(){e.apply(t,arguments)}}function i(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this.g=0,this.T=!1,this.w=void 0,this.O=[],l(e,this)}function c(e,t){for(;3===e.g;)e=e.w;if(0===e.g)return void e.O.push(t);e.T=!0,i.j(function(){var n=1===e.g?t.onFulfilled:t.onRejected;if(null===n)return void(1===e.g?s:a)(t.promise,e.w);var r;try{r=n(e.w)}catch(e){return void a(t.promise,e)}s(t.promise,r)})}function s(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if(t instanceof i)return e.g=3,e.w=t,void u(e);if("function"==typeof n)return void l(o(n,t),e)}e.g=1,e.w=t,u(e)}catch(t){a(e,t)}}function a(e,t){e.g=2,e.w=t,u(e)}function u(e){2===e.g&&0===e.O.length&&i.j(function(){e.T||i.A(e.w)});for(var t=0,n=e.O.length;t<n;t++)c(e,e.O[t]);e.O=null}function f(e,t,n){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.promise=n}function l(e,t){var n=!1;try{e(function(e){n||(n=!0,s(t,e))},function(e){n||(n=!0,a(t,e))})}catch(e){if(n)return;n=!0,a(t,e)}}var p=setTimeout;i.prototype.catch=function(e){return this.then(null,e)},i.prototype.then=function(e,t){var n=new this.constructor(r);return c(this,new f(e,t,n)),n},i.all=function(e){var t=Array.prototype.slice.call(e);return new i(function(e,n){function r(i,c){try{if(c&&("object"==typeof c||"function"==typeof c)){var s=c.then;if("function"==typeof s)return void s.call(c,function(e){r(i,e)},n)}t[i]=c,0==--o&&e(t)}catch(e){n(e)}}if(0===t.length)return e([]);for(var o=t.length,i=0;i<t.length;i++)r(i,t[i])})},i.resolve=function(e){return e&&"object"==typeof e&&e.constructor===i?e:new i(function(t){t(e)})},i.reject=function(e){return new i(function(t,n){n(e)})},i.race=function(e){return new i(function(t,n){for(var r=0,o=e.length;r<o;r++)e[r].then(t,n)})},i.j="function"==typeof t&&function(e){t(e)}||function(e){p(e,0)},i.A=function(e){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)},i.k=function(e){i.j=e},i.I=function(e){i.A=e},void 0!==e&&e.exports?e.exports=i:n.Promise||(n.Promise=i)}(this)}).call(t,n(21).setImmediate)},function(t,n,r){function o(e,t){this.F=e,this.N=t}var i=Function.prototype.apply;n.setTimeout=function(){return new o(i.call(setTimeout,e,arguments),clearTimeout)},n.setInterval=function(){return new o(i.call(setInterval,e,arguments),clearInterval)},n.clearTimeout=n.clearInterval=function(e){e&&e.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this.N.call(e,this.F)},n.enroll=function(e,t){clearTimeout(e.x),e.P=t},n.unenroll=function(e){clearTimeout(e.x),e.P=-1},n.L=n.active=function(e){clearTimeout(e.x);var t=e.P;t>=0&&(e.x=setTimeout(function(){e.S&&e.S()},t))},r(22),n.setImmediate=setImmediate,n.clearImmediate=clearImmediate},function(e,t,n){(function(e,t){!function(e,n){"use strict";function r(e){"function"!=typeof e&&(e=Function(""+e));for(var t=Array(arguments.length-1),n=0;n<t.length;n++)t[n]=arguments[n+1];var r={callback:e,args:t};return u[a]=r,s(a),a++}function o(e){delete u[e]}function i(e){var t=e.callback,r=e.args;switch(r.length){case 0:t();break;case 1:t(r[0]);break;case 2:t(r[0],r[1]);break;case 3:t(r[0],r[1],r[2]);break;default:t.apply(n,r)}}function c(e){if(f)setTimeout(c,0,e);else{var t=u[e];if(t){f=!0;try{i(t)}finally{o(e),f=!1}}}}if(!e.setImmediate){var s,a=1,u={},f=!1,l=e.document,p=Object.getPrototypeOf&&Object.getPrototypeOf(e);p=p&&p.setTimeout?p:e,"[object process]"==={}.toString.call(e.process)?function(){s=function(e){t.nextTick(function(){c(e)})}}():function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?function(){var t="setImmediate$"+Math.random()+"$",n=function(n){n.source===e&&"string"==typeof n.data&&0===n.data.indexOf(t)&&c(+n.data.slice(t.length))};e.addEventListener?e.addEventListener("message",n,!1):e.attachEvent("onmessage",n),s=function(n){e.postMessage(t+n,"*")}}():e.MessageChannel?function(){var e=new MessageChannel;e.port1.onmessage=function(e){c(e.data)},s=function(t){e.port2.postMessage(t)}}():l&&"onreadystatechange"in l.createElement("script")?function(){var e=l.documentElement;s=function(t){var n=l.createElement("script");n.onreadystatechange=function(){c(t),n.onreadystatechange=null,e.removeChild(n),n=null},e.appendChild(n)}}():function(){s=function(e){setTimeout(c,0,e)}}(),p.setImmediate=r,p.clearImmediate=o}}("undefined"==typeof self?void 0===e?this:e:self)}).call(t,n(15),n(16))}])}().default;
3508
+
3509
+ (function(){var h,aa=aa||{},k=this,ba=function(a){return void 0!==a},m=function(a){return"string"==typeof a},ca=function(a){return"boolean"==typeof a},da=function(a){return"number"==typeof a},ea=function(){},fa=function(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&
3510
+ !a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null";else if("function"==b&&"undefined"==typeof a.call)return"object";return b},ha=function(a){return null===a},ia=function(a){return"array"==fa(a)},ja=function(a){var b=fa(a);return"array"==b||"object"==b&&"number"==typeof a.length},p=function(a){return"function"==fa(a)},q=function(a){var b=
3511
+ typeof a;return"object"==b&&null!=a||"function"==b},ka=function(a,b,c){return a.call.apply(a.bind,arguments)},la=function(a,b,c){if(!a)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var c=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(c,d);return a.apply(b,c)}}return function(){return a.apply(b,arguments)}},r=function(a,b,c){r=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?ka:la;return r.apply(null,
3512
+ arguments)},ma=function(a,b){var c=Array.prototype.slice.call(arguments,1);return function(){var b=c.slice();b.push.apply(b,arguments);return a.apply(this,b)}},na=Date.now||function(){return+new Date},t=function(a,b){function c(){}c.prototype=b.prototype;a.Sc=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.Cg=function(a,c,f){for(var d=Array(arguments.length-2),e=2;e<arguments.length;e++)d[e-2]=arguments[e];return b.prototype[c].apply(a,d)}};var u=function(a){if(Error.captureStackTrace)Error.captureStackTrace(this,u);else{var b=Error().stack;b&&(this.stack=b)}a&&(this.message=String(a))};t(u,Error);u.prototype.name="CustomError";var oa=function(a,b){for(var c=a.split("%s"),d="",e=Array.prototype.slice.call(arguments,1);e.length&&1<c.length;)d+=c.shift()+e.shift();return d+c.join("%s")},pa=String.prototype.trim?function(a){return a.trim()}:function(a){return a.replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},xa=function(a){if(!qa.test(a))return a;-1!=a.indexOf("&")&&(a=a.replace(ra,"&amp;"));-1!=a.indexOf("<")&&(a=a.replace(sa,"&lt;"));-1!=a.indexOf(">")&&(a=a.replace(ta,"&gt;"));-1!=a.indexOf('"')&&(a=a.replace(ua,"&quot;"));-1!=a.indexOf("'")&&
3513
+ (a=a.replace(va,"&#39;"));-1!=a.indexOf("\x00")&&(a=a.replace(wa,"&#0;"));return a},ra=/&/g,sa=/</g,ta=/>/g,ua=/"/g,va=/'/g,wa=/\x00/g,qa=/[\x00&<>"']/,v=function(a,b){return-1!=a.indexOf(b)},ya=function(a,b){return a<b?-1:a>b?1:0};var za=function(a,b){b.unshift(a);u.call(this,oa.apply(null,b));b.shift()};t(za,u);za.prototype.name="AssertionError";
3514
+ var Aa=function(a,b,c,d){var e="Assertion failed";if(c){e+=": "+c;var f=d}else a&&(e+=": "+a,f=b);throw new za(""+e,f||[]);},w=function(a,b,c){a||Aa("",null,b,Array.prototype.slice.call(arguments,2));return a},Ba=function(a,b){throw new za("Failure"+(a?": "+a:""),Array.prototype.slice.call(arguments,1));},Ca=function(a,b,c){da(a)||Aa("Expected number but got %s: %s.",[fa(a),a],b,Array.prototype.slice.call(arguments,2));return a},Da=function(a,b,c){m(a)||Aa("Expected string but got %s: %s.",[fa(a),
3515
+ a],b,Array.prototype.slice.call(arguments,2))},Ea=function(a,b,c){p(a)||Aa("Expected function but got %s: %s.",[fa(a),a],b,Array.prototype.slice.call(arguments,2))};var Ga=function(){this.Rc="";this.$e=Fa};Ga.prototype.mb=!0;Ga.prototype.kb=function(){return this.Rc};Ga.prototype.toString=function(){return"Const{"+this.Rc+"}"};var Ha=function(a){if(a instanceof Ga&&a.constructor===Ga&&a.$e===Fa)return a.Rc;Ba("expected object of type Const, got '"+a+"'");return"type_error:Const"},Fa={},Ia=function(a){var b=new Ga;b.Rc=a;return b};Ia("");var Ka=function(){this.Kc="";this.af=Ja};Ka.prototype.mb=!0;Ka.prototype.kb=function(){return this.Kc};Ka.prototype.toString=function(){return"TrustedResourceUrl{"+this.Kc+"}"};
3516
+ var La=function(a){if(a instanceof Ka&&a.constructor===Ka&&a.af===Ja)return a.Kc;Ba("expected object of type TrustedResourceUrl, got '"+a+"' of type "+fa(a));return"type_error:TrustedResourceUrl"},Na=function(a,b){a=Ma(a,b);b=new Ka;b.Kc=a;return b},Ma=function(a,b){var c=Ha(a);if(!Oa.test(c))throw Error("Invalid TrustedResourceUrl format: "+c);return c.replace(Pa,function(a,e){if(!Object.prototype.hasOwnProperty.call(b,e))throw Error('Found marker, "'+e+'", in format string, "'+c+'", but no valid label mapping found in args: '+
3517
+ JSON.stringify(b));a=b[e];return a instanceof Ga?Ha(a):encodeURIComponent(String(a))})},Pa=/%{(\w+)}/g,Oa=/^(?:https:)?\/\/[0-9a-z.:[\]-]+\/|^\/[^\/\\]|^about:blank(#|$)/i,Ja={};var Qa=Array.prototype.indexOf?function(a,b,c){w(null!=a.length);return Array.prototype.indexOf.call(a,b,c)}:function(a,b,c){c=null==c?0:0>c?Math.max(0,a.length+c):c;if(m(a))return m(b)&&1==b.length?a.indexOf(b,c):-1;for(;c<a.length;c++)if(c in a&&a[c]===b)return c;return-1},x=Array.prototype.forEach?function(a,b,c){w(null!=a.length);Array.prototype.forEach.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=m(a)?a.split(""):a,f=0;f<d;f++)f in e&&b.call(c,e[f],f,a)},Ra=function(a,b){for(var c=m(a)?
3518
+ a.split(""):a,d=a.length-1;0<=d;--d)d in c&&b.call(void 0,c[d],d,a)},Sa=Array.prototype.map?function(a,b,c){w(null!=a.length);return Array.prototype.map.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=Array(d),f=m(a)?a.split(""):a,g=0;g<d;g++)g in f&&(e[g]=b.call(c,f[g],g,a));return e},Ta=Array.prototype.some?function(a,b,c){w(null!=a.length);return Array.prototype.some.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=m(a)?a.split(""):a,f=0;f<d;f++)if(f in e&&b.call(c,e[f],f,a))return!0;return!1},
3519
+ Va=function(a){a:{var b=Ua;for(var c=a.length,d=m(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a)){b=e;break a}b=-1}return 0>b?null:m(a)?a.charAt(b):a[b]},Wa=function(a,b){return 0<=Qa(a,b)},Ya=function(a,b){b=Qa(a,b);var c;(c=0<=b)&&Xa(a,b);return c},Xa=function(a,b){w(null!=a.length);return 1==Array.prototype.splice.call(a,b,1).length},Za=function(a,b){var c=0;Ra(a,function(d,e){b.call(void 0,d,e,a)&&Xa(a,e)&&c++})},$a=function(a){return Array.prototype.concat.apply([],arguments)},
3520
+ ab=function(a){var b=a.length;if(0<b){for(var c=Array(b),d=0;d<b;d++)c[d]=a[d];return c}return[]};var bb=function(a){return Sa(a,function(a){a=a.toString(16);return 1<a.length?a:"0"+a}).join("")};var cb;a:{var db=k.navigator;if(db){var eb=db.userAgent;if(eb){cb=eb;break a}}cb=""}var y=function(a){return v(cb,a)};var fb=function(a,b){for(var c in a)b.call(void 0,a[c],c,a)},gb=function(a,b){for(var c in a)if(b.call(void 0,a[c],c,a))return!0;return!1},hb=function(a){var b=[],c=0,d;for(d in a)b[c++]=a[d];return b},ib=function(a){var b=[],c=0,d;for(d in a)b[c++]=d;return b},jb=function(a){for(var b in a)return!1;return!0},kb=function(a,b){for(var c in a)if(!(c in b)||a[c]!==b[c])return!1;for(c in b)if(!(c in a))return!1;return!0},lb=function(a){var b={},c;for(c in a)b[c]=a[c];return b},mb="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),
3521
+ nb=function(a,b){for(var c,d,e=1;e<arguments.length;e++){d=arguments[e];for(c in d)a[c]=d[c];for(var f=0;f<mb.length;f++)c=mb[f],Object.prototype.hasOwnProperty.call(d,c)&&(a[c]=d[c])}};var ob=function(a){ob[" "](a);return a};ob[" "]=ea;var qb=function(a,b){var c=pb;return Object.prototype.hasOwnProperty.call(c,a)?c[a]:c[a]=b(a)};var rb=y("Opera"),z=y("Trident")||y("MSIE"),sb=y("Edge"),tb=sb||z,ub=y("Gecko")&&!(v(cb.toLowerCase(),"webkit")&&!y("Edge"))&&!(y("Trident")||y("MSIE"))&&!y("Edge"),vb=v(cb.toLowerCase(),"webkit")&&!y("Edge"),xb=function(){var a=k.document;return a?a.documentMode:void 0},yb;
3522
+ a:{var zb="",Ab=function(){var a=cb;if(ub)return/rv\:([^\);]+)(\)|;)/.exec(a);if(sb)return/Edge\/([\d\.]+)/.exec(a);if(z)return/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(a);if(vb)return/WebKit\/(\S+)/.exec(a);if(rb)return/(?:Version)[ \/]?(\S+)/.exec(a)}();Ab&&(zb=Ab?Ab[1]:"");if(z){var Bb=xb();if(null!=Bb&&Bb>parseFloat(zb)){yb=String(Bb);break a}}yb=zb}
3523
+ var Cb=yb,pb={},A=function(a){return qb(a,function(){for(var b=0,c=pa(String(Cb)).split("."),d=pa(String(a)).split("."),e=Math.max(c.length,d.length),f=0;0==b&&f<e;f++){var g=c[f]||"",l=d[f]||"";do{g=/(\d*)(\D*)(.*)/.exec(g)||["","","",""];l=/(\d*)(\D*)(.*)/.exec(l)||["","","",""];if(0==g[0].length&&0==l[0].length)break;b=ya(0==g[1].length?0:parseInt(g[1],10),0==l[1].length?0:parseInt(l[1],10))||ya(0==g[2].length,0==l[2].length)||ya(g[2],l[2]);g=g[3];l=l[3]}while(0==b)}return 0<=b})},Db;var Eb=k.document;
3524
+ Db=Eb&&z?xb()||("CSS1Compat"==Eb.compatMode?parseInt(Cb,10):5):void 0;var Fb=null,Gb=null,Ib=function(a){var b="";Hb(a,function(a){b+=String.fromCharCode(a)});return b},Hb=function(a,b){function c(b){for(;d<a.length;){var c=a.charAt(d++),e=Gb[c];if(null!=e)return e;if(!/^[\s\xa0]*$/.test(c))throw Error("Unknown base64 encoding at char: "+c);}return b}Jb();for(var d=0;;){var e=c(-1),f=c(0),g=c(64),l=c(64);if(64===l&&-1===e)break;b(e<<2|f>>4);64!=g&&(b(f<<4&240|g>>2),64!=l&&b(g<<6&192|l))}},Jb=function(){if(!Fb){Fb={};Gb={};for(var a=0;65>a;a++)Fb[a]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(a),
3525
+ Gb[Fb[a]]=a,62<=a&&(Gb["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.".charAt(a)]=a)}};var Kb=function(){this.Ia=-1};var Nb=function(a,b){this.Ia=64;this.oc=k.Uint8Array?new Uint8Array(this.Ia):Array(this.Ia);this.Vc=this.nb=0;this.l=[];this.Sf=a;this.we=b;this.tg=k.Int32Array?new Int32Array(64):Array(64);ba(Lb)||(Lb=k.Int32Array?new Int32Array(Mb):Mb);this.reset()},Lb;t(Nb,Kb);for(var Ob=[],Pb=0;63>Pb;Pb++)Ob[Pb]=0;var Qb=$a(128,Ob);Nb.prototype.reset=function(){this.Vc=this.nb=0;this.l=k.Int32Array?new Int32Array(this.we):ab(this.we)};
3526
+ var Rb=function(a){var b=a.oc;w(b.length==a.Ia);for(var c=a.tg,d=0,e=0;e<b.length;)c[d++]=b[e]<<24|b[e+1]<<16|b[e+2]<<8|b[e+3],e=4*d;for(b=16;64>b;b++){d=c[b-15]|0;e=c[b-2]|0;e=(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10;var f=(c[b-16]|0)+((d>>>7|d<<25)^(d>>>18|d<<14)^d>>>3)|0;var g=(c[b-7]|0)+e|0;c[b]=f+g|0}d=a.l[0]|0;e=a.l[1]|0;var l=a.l[2]|0,n=a.l[3]|0,C=a.l[4]|0,wb=a.l[5]|0,ec=a.l[6]|0;f=a.l[7]|0;for(b=0;64>b;b++){var mi=((d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10))+(d&e^d&l^e&l)|0;g=C&wb^~C&ec;f=f+
3527
+ ((C>>>6|C<<26)^(C>>>11|C<<21)^(C>>>25|C<<7))|0;g=g+(Lb[b]|0)|0;g=f+(g+(c[b]|0)|0)|0;f=ec;ec=wb;wb=C;C=n+g|0;n=l;l=e;e=d;d=g+mi|0}a.l[0]=a.l[0]+d|0;a.l[1]=a.l[1]+e|0;a.l[2]=a.l[2]+l|0;a.l[3]=a.l[3]+n|0;a.l[4]=a.l[4]+C|0;a.l[5]=a.l[5]+wb|0;a.l[6]=a.l[6]+ec|0;a.l[7]=a.l[7]+f|0};
3528
+ Nb.prototype.update=function(a,b){ba(b)||(b=a.length);var c=0,d=this.nb;if(m(a))for(;c<b;)this.oc[d++]=a.charCodeAt(c++),d==this.Ia&&(Rb(this),d=0);else if(ja(a))for(;c<b;){var e=a[c++];if(!("number"==typeof e&&0<=e&&255>=e&&e==(e|0)))throw Error("message must be a byte array");this.oc[d++]=e;d==this.Ia&&(Rb(this),d=0)}else throw Error("message must be string or array");this.nb=d;this.Vc+=b};
3529
+ Nb.prototype.digest=function(){var a=[],b=8*this.Vc;56>this.nb?this.update(Qb,56-this.nb):this.update(Qb,this.Ia-(this.nb-56));for(var c=63;56<=c;c--)this.oc[c]=b&255,b/=256;Rb(this);for(c=b=0;c<this.Sf;c++)for(var d=24;0<=d;d-=8)a[b++]=this.l[c]>>d&255;return a};
3530
+ var Mb=[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,
3531
+ 4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];var Tb=function(){Nb.call(this,8,Sb)};t(Tb,Nb);var Sb=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225];var Ub=function(){this.Ka=this.Ka;this.Hc=this.Hc};Ub.prototype.Ka=!1;Ub.prototype.isDisposed=function(){return this.Ka};Ub.prototype.ib=function(){if(this.Hc)for(;this.Hc.length;)this.Hc.shift()()};var Vb=!z||9<=Number(Db),Wb=z&&!A("9");!vb||A("528");ub&&A("1.9b")||z&&A("8")||rb&&A("9.5")||vb&&A("528");ub&&!A("8")||z&&A("9");var Xb=function(){if(!k.addEventListener||!Object.defineProperty)return!1;var a=!1,b=Object.defineProperty({},"passive",{get:function(){a=!0}});k.addEventListener("test",ea,b);k.removeEventListener("test",ea,b);return a}();var B=function(a,b){this.type=a;this.currentTarget=this.target=b;this.defaultPrevented=this.Ua=!1;this.Je=!0};B.prototype.stopPropagation=function(){this.Ua=!0};B.prototype.preventDefault=function(){this.defaultPrevented=!0;this.Je=!1};var Yb=function(a,b){B.call(this,a?a.type:"");this.relatedTarget=this.currentTarget=this.target=null;this.button=this.screenY=this.screenX=this.clientY=this.clientX=this.offsetY=this.offsetX=0;this.key="";this.charCode=this.keyCode=0;this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1;this.fa=this.state=null;a&&this.init(a,b)};t(Yb,B);
3532
+ Yb.prototype.init=function(a,b){var c=this.type=a.type,d=a.changedTouches?a.changedTouches[0]:null;this.target=a.target||a.srcElement;this.currentTarget=b;if(b=a.relatedTarget){if(ub){a:{try{ob(b.nodeName);var e=!0;break a}catch(f){}e=!1}e||(b=null)}}else"mouseover"==c?b=a.fromElement:"mouseout"==c&&(b=a.toElement);this.relatedTarget=b;null===d?(this.offsetX=vb||void 0!==a.offsetX?a.offsetX:a.layerX,this.offsetY=vb||void 0!==a.offsetY?a.offsetY:a.layerY,this.clientX=void 0!==a.clientX?a.clientX:a.pageX,
3533
+ this.clientY=void 0!==a.clientY?a.clientY:a.pageY,this.screenX=a.screenX||0,this.screenY=a.screenY||0):(this.clientX=void 0!==d.clientX?d.clientX:d.pageX,this.clientY=void 0!==d.clientY?d.clientY:d.pageY,this.screenX=d.screenX||0,this.screenY=d.screenY||0);this.button=a.button;this.keyCode=a.keyCode||0;this.key=a.key||"";this.charCode=a.charCode||("keypress"==c?a.keyCode:0);this.ctrlKey=a.ctrlKey;this.altKey=a.altKey;this.shiftKey=a.shiftKey;this.metaKey=a.metaKey;this.state=a.state;this.fa=a;a.defaultPrevented&&
3534
+ this.preventDefault()};Yb.prototype.stopPropagation=function(){Yb.Sc.stopPropagation.call(this);this.fa.stopPropagation?this.fa.stopPropagation():this.fa.cancelBubble=!0};Yb.prototype.preventDefault=function(){Yb.Sc.preventDefault.call(this);var a=this.fa;if(a.preventDefault)a.preventDefault();else if(a.returnValue=!1,Wb)try{if(a.ctrlKey||112<=a.keyCode&&123>=a.keyCode)a.keyCode=-1}catch(b){}};Yb.prototype.wf=function(){return this.fa};var Zb="closure_listenable_"+(1E6*Math.random()|0),$b=0;var ac=function(a,b,c,d,e){this.listener=a;this.Lc=null;this.src=b;this.type=c;this.capture=!!d;this.uc=e;this.key=++$b;this.yb=this.nc=!1},bc=function(a){a.yb=!0;a.listener=null;a.Lc=null;a.src=null;a.uc=null};var cc=function(a){this.src=a;this.J={};this.hc=0};cc.prototype.add=function(a,b,c,d,e){var f=a.toString();a=this.J[f];a||(a=this.J[f]=[],this.hc++);var g=dc(a,b,d,e);-1<g?(b=a[g],c||(b.nc=!1)):(b=new ac(b,this.src,f,!!d,e),b.nc=c,a.push(b));return b};cc.prototype.remove=function(a,b,c,d){a=a.toString();if(!(a in this.J))return!1;var e=this.J[a];b=dc(e,b,c,d);return-1<b?(bc(e[b]),Xa(e,b),0==e.length&&(delete this.J[a],this.hc--),!0):!1};
3535
+ var fc=function(a,b){var c=b.type;c in a.J&&Ya(a.J[c],b)&&(bc(b),0==a.J[c].length&&(delete a.J[c],a.hc--))};cc.prototype.od=function(a,b,c,d){a=this.J[a.toString()];var e=-1;a&&(e=dc(a,b,c,d));return-1<e?a[e]:null};cc.prototype.hasListener=function(a,b){var c=ba(a),d=c?a.toString():"",e=ba(b);return gb(this.J,function(a){for(var f=0;f<a.length;++f)if(!(c&&a[f].type!=d||e&&a[f].capture!=b))return!0;return!1})};
3536
+ var dc=function(a,b,c,d){for(var e=0;e<a.length;++e){var f=a[e];if(!f.yb&&f.listener==b&&f.capture==!!c&&f.uc==d)return e}return-1};var gc="closure_lm_"+(1E6*Math.random()|0),hc={},ic=0,kc=function(a,b,c,d,e){if(d&&d.once)jc(a,b,c,d,e);else if(ia(b))for(var f=0;f<b.length;f++)kc(a,b[f],c,d,e);else c=lc(c),a&&a[Zb]?a.listen(b,c,q(d)?!!d.capture:!!d,e):mc(a,b,c,!1,d,e)},mc=function(a,b,c,d,e,f){if(!b)throw Error("Invalid event type");var g=q(e)?!!e.capture:!!e,l=nc(a);l||(a[gc]=l=new cc(a));c=l.add(b,c,d,g,f);if(!c.Lc){d=oc();c.Lc=d;d.src=a;d.listener=c;if(a.addEventListener)Xb||(e=g),void 0===e&&(e=!1),a.addEventListener(b.toString(),
3537
+ d,e);else if(a.attachEvent)a.attachEvent(pc(b.toString()),d);else throw Error("addEventListener and attachEvent are unavailable.");ic++}},oc=function(){var a=qc,b=Vb?function(c){return a.call(b.src,b.listener,c)}:function(c){c=a.call(b.src,b.listener,c);if(!c)return c};return b},jc=function(a,b,c,d,e){if(ia(b))for(var f=0;f<b.length;f++)jc(a,b[f],c,d,e);else c=lc(c),a&&a[Zb]?rc(a,b,c,q(d)?!!d.capture:!!d,e):mc(a,b,c,!0,d,e)},sc=function(a,b,c,d,e){if(ia(b))for(var f=0;f<b.length;f++)sc(a,b[f],c,d,
3538
+ e);else d=q(d)?!!d.capture:!!d,c=lc(c),a&&a[Zb]?a.ea.remove(String(b),c,d,e):a&&(a=nc(a))&&(b=a.od(b,c,d,e))&&tc(b)},tc=function(a){if(!da(a)&&a&&!a.yb){var b=a.src;if(b&&b[Zb])fc(b.ea,a);else{var c=a.type,d=a.Lc;b.removeEventListener?b.removeEventListener(c,d,a.capture):b.detachEvent&&b.detachEvent(pc(c),d);ic--;(c=nc(b))?(fc(c,a),0==c.hc&&(c.src=null,b[gc]=null)):bc(a)}}},pc=function(a){return a in hc?hc[a]:hc[a]="on"+a},vc=function(a,b,c,d){var e=!0;if(a=nc(a))if(b=a.J[b.toString()])for(b=b.concat(),
3539
+ a=0;a<b.length;a++){var f=b[a];f&&f.capture==c&&!f.yb&&(f=uc(f,d),e=e&&!1!==f)}return e},uc=function(a,b){var c=a.listener,d=a.uc||a.src;a.nc&&tc(a);return c.call(d,b)},qc=function(a,b){if(a.yb)return!0;if(!Vb){if(!b)a:{b=["window","event"];for(var c=k,d;d=b.shift();)if(null!=c[d])c=c[d];else{b=null;break a}b=c}d=b;b=new Yb(d,this);c=!0;if(!(0>d.keyCode||void 0!=d.returnValue)){a:{var e=!1;if(0==d.keyCode)try{d.keyCode=-1;break a}catch(g){e=!0}if(e||void 0==d.returnValue)d.returnValue=!0}d=[];for(e=
3540
+ b.currentTarget;e;e=e.parentNode)d.push(e);e=a.type;for(var f=d.length-1;!b.Ua&&0<=f;f--)b.currentTarget=d[f],a=vc(d[f],e,!0,b),c=c&&a;for(f=0;!b.Ua&&f<d.length;f++)b.currentTarget=d[f],a=vc(d[f],e,!1,b),c=c&&a}return c}return uc(a,new Yb(b,this))},nc=function(a){a=a[gc];return a instanceof cc?a:null},wc="__closure_events_fn_"+(1E9*Math.random()>>>0),lc=function(a){w(a,"Listener can not be null.");if(p(a))return a;w(a.handleEvent,"An object listener must have handleEvent method.");a[wc]||(a[wc]=function(b){return a.handleEvent(b)});
3541
+ return a[wc]};var xc=/^[+a-zA-Z0-9_.!#$%&'*\/=?^`{|}~-]+@([a-zA-Z0-9-]+\.)+[a-zA-Z0-9]{2,63}$/;var zc=function(){this.wa="";this.Ze=yc};zc.prototype.mb=!0;zc.prototype.kb=function(){return this.wa};zc.prototype.toString=function(){return"SafeUrl{"+this.wa+"}"};
3542
+ var Ac=function(a){if(a instanceof zc&&a.constructor===zc&&a.Ze===yc)return a.wa;Ba("expected object of type SafeUrl, got '"+a+"' of type "+fa(a));return"type_error:SafeUrl"},Bc=/^(?:(?:https?|mailto|ftp):|[^:/?#]*(?:[/?#]|$))/i,Dc=function(a){if(a instanceof zc)return a;a=a.mb?a.kb():String(a);Bc.test(a)||(a="about:invalid#zClosurez");return Cc(a)},yc={},Cc=function(a){var b=new zc;b.wa=a;return b};Cc("about:blank");var Gc=function(a){var b=[];Ec(new Fc,a,b);return b.join("")},Fc=function(){this.Mc=void 0},Ec=function(a,b,c){if(null==b)c.push("null");else{if("object"==typeof b){if(ia(b)){var d=b;b=d.length;c.push("[");for(var e="",f=0;f<b;f++)c.push(e),e=d[f],Ec(a,a.Mc?a.Mc.call(d,String(f),e):e,c),e=",";c.push("]");return}if(b instanceof String||b instanceof Number||b instanceof Boolean)b=b.valueOf();else{c.push("{");f="";for(d in b)Object.prototype.hasOwnProperty.call(b,d)&&(e=b[d],"function"!=typeof e&&(c.push(f),
3543
+ Hc(d,c),c.push(":"),Ec(a,a.Mc?a.Mc.call(b,d,e):e,c),f=","));c.push("}");return}}switch(typeof b){case "string":Hc(b,c);break;case "number":c.push(isFinite(b)&&!isNaN(b)?String(b):"null");break;case "boolean":c.push(String(b));break;case "function":c.push("null");break;default:throw Error("Unknown type: "+typeof b);}}},Ic={'"':'\\"',"\\":"\\\\","/":"\\/","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\x0B":"\\u000b"},Jc=/\uffff/.test("\uffff")?/[\\\"\x00-\x1f\x7f-\uffff]/g:/[\\\"\x00-\x1f\x7f-\xff]/g,
3544
+ Hc=function(a,b){b.push('"',a.replace(Jc,function(a){var b=Ic[a];b||(b="\\u"+(a.charCodeAt(0)|65536).toString(16).substr(1),Ic[a]=b);return b}),'"')};var Kc=function(){};Kc.prototype.be=null;var Lc=function(a){return a.be||(a.be=a.wd())};var Mc,Nc=function(){};t(Nc,Kc);Nc.prototype.pc=function(){var a=Oc(this);return a?new ActiveXObject(a):new XMLHttpRequest};Nc.prototype.wd=function(){var a={};Oc(this)&&(a[0]=!0,a[1]=!0);return a};
3545
+ var Oc=function(a){if(!a.ve&&"undefined"==typeof XMLHttpRequest&&"undefined"!=typeof ActiveXObject){for(var b=["MSXML2.XMLHTTP.6.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"],c=0;c<b.length;c++){var d=b[c];try{return new ActiveXObject(d),a.ve=d}catch(e){}}throw Error("Could not create ActiveXObject. ActiveX might be disabled, or MSXML might not be installed");}return a.ve};Mc=new Nc;var Pc=function(){};t(Pc,Kc);Pc.prototype.pc=function(){var a=new XMLHttpRequest;if("withCredentials"in a)return a;if("undefined"!=typeof XDomainRequest)return new Qc;throw Error("Unsupported browser");};Pc.prototype.wd=function(){return{}};
3546
+ var Qc=function(){this.na=new XDomainRequest;this.readyState=0;this.onreadystatechange=null;this.responseText="";this.status=-1;this.statusText=this.responseXML=null;this.na.onload=r(this.zf,this);this.na.onerror=r(this.qe,this);this.na.onprogress=r(this.Af,this);this.na.ontimeout=r(this.Bf,this)};h=Qc.prototype;h.open=function(a,b,c){if(null!=c&&!c)throw Error("Only async requests are supported.");this.na.open(a,b)};
3547
+ h.send=function(a){if(a)if("string"==typeof a)this.na.send(a);else throw Error("Only string data is supported");else this.na.send()};h.abort=function(){this.na.abort()};h.setRequestHeader=function(){};h.getResponseHeader=function(a){return"content-type"==a.toLowerCase()?this.na.contentType:""};h.zf=function(){this.status=200;this.responseText=this.na.responseText;Rc(this,4)};h.qe=function(){this.status=500;this.responseText="";Rc(this,4)};h.Bf=function(){this.qe()};
3548
+ h.Af=function(){this.status=200;Rc(this,1)};var Rc=function(a,b){a.readyState=b;if(a.onreadystatechange)a.onreadystatechange()};Qc.prototype.getAllResponseHeaders=function(){return"content-type: "+this.na.contentType};var Sc=function(a,b,c){this.Of=c;this.kf=a;this.cg=b;this.Gc=0;this.vc=null};Sc.prototype.get=function(){if(0<this.Gc){this.Gc--;var a=this.vc;this.vc=a.next;a.next=null}else a=this.kf();return a};Sc.prototype.put=function(a){this.cg(a);this.Gc<this.Of&&(this.Gc++,a.next=this.vc,this.vc=a)};var Tc=function(a){k.setTimeout(function(){throw a;},0)},Uc,Vc=function(){var a=k.MessageChannel;"undefined"===typeof a&&"undefined"!==typeof window&&window.postMessage&&window.addEventListener&&!y("Presto")&&(a=function(){var a=document.createElement("IFRAME");a.style.display="none";a.src="";document.documentElement.appendChild(a);var b=a.contentWindow;a=b.document;a.open();a.write("");a.close();var c="callImmediate"+Math.random(),d="file:"==b.location.protocol?"*":b.location.protocol+"//"+b.location.host;
3549
+ a=r(function(a){if(("*"==d||a.origin==d)&&a.data==c)this.port1.onmessage()},this);b.addEventListener("message",a,!1);this.port1={};this.port2={postMessage:function(){b.postMessage(c,d)}}});if("undefined"!==typeof a&&!y("Trident")&&!y("MSIE")){var b=new a,c={},d=c;b.port1.onmessage=function(){if(ba(c.next)){c=c.next;var a=c.fe;c.fe=null;a()}};return function(a){d.next={fe:a};d=d.next;b.port2.postMessage(0)}}return"undefined"!==typeof document&&"onreadystatechange"in document.createElement("SCRIPT")?
3550
+ function(a){var b=document.createElement("SCRIPT");b.onreadystatechange=function(){b.onreadystatechange=null;b.parentNode.removeChild(b);b=null;a();a=null};document.documentElement.appendChild(b)}:function(a){k.setTimeout(a,0)}};var Wc=function(){this.$c=this.eb=null},Yc=new Sc(function(){return new Xc},function(a){a.reset()},100);Wc.prototype.add=function(a,b){var c=Yc.get();c.set(a,b);this.$c?this.$c.next=c:(w(!this.eb),this.eb=c);this.$c=c};Wc.prototype.remove=function(){var a=null;this.eb&&(a=this.eb,this.eb=this.eb.next,this.eb||(this.$c=null),a.next=null);return a};var Xc=function(){this.next=this.scope=this.nd=null};Xc.prototype.set=function(a,b){this.nd=a;this.scope=b;this.next=null};
3551
+ Xc.prototype.reset=function(){this.next=this.scope=this.nd=null};var cd=function(a,b){Zc||$c();ad||(Zc(),ad=!0);bd.add(a,b)},Zc,$c=function(){if(-1!=String(k.Promise).indexOf("[native code]")){var a=k.Promise.resolve(void 0);Zc=function(){a.then(dd)}}else Zc=function(){var a=dd;!p(k.setImmediate)||k.Window&&k.Window.prototype&&!y("Edge")&&k.Window.prototype.setImmediate==k.setImmediate?(Uc||(Uc=Vc()),Uc(a)):k.setImmediate(a)}},ad=!1,bd=new Wc,dd=function(){for(var a;a=bd.remove();){try{a.nd.call(a.scope)}catch(b){Tc(b)}Yc.put(a)}ad=!1};var ed=function(a){return q(a)?a.constructor.displayName||a.constructor.name||Object.prototype.toString.call(a):void 0===a?"undefined":null===a?"null":typeof a},fd=function(a){return(a=a&&a.ownerDocument)&&(a.defaultView||a.parentWindow)||window};var gd=!z||9<=Number(Db);!ub&&!z||z&&9<=Number(Db)||ub&&A("1.9.1");z&&A("9");var id=function(){this.wa="";this.Ye=hd};id.prototype.mb=!0;id.prototype.kb=function(){return this.wa};id.prototype.toString=function(){return"SafeHtml{"+this.wa+"}"};var jd=function(a){if(a instanceof id&&a.constructor===id&&a.Ye===hd)return a.wa;Ba("expected object of type SafeHtml, got '"+a+"' of type "+fa(a));return"type_error:SafeHtml"},hd={};id.prototype.If=function(a){this.wa=a;return this};var kd=function(a,b){var c=fd(a);"undefined"!=typeof c.HTMLScriptElement&&"undefined"!=typeof c.Element&&w(a&&(a instanceof c.HTMLScriptElement||!(a instanceof c.Element)),"Argument is not a HTMLScriptElement (or a non-Element mock); got: %s",ed(a));a.src=La(b)};var ld=function(a){var b=document;return m(a)?b.getElementById(a):a},nd=function(a,b){fb(b,function(b,d){b&&b.mb&&(b=b.kb());"style"==d?a.style.cssText=b:"class"==d?a.className=b:"for"==d?a.htmlFor=b:md.hasOwnProperty(d)?a.setAttribute(md[d],b):0==d.lastIndexOf("aria-",0)||0==d.lastIndexOf("data-",0)?a.setAttribute(d,b):a[d]=b})},md={cellpadding:"cellPadding",cellspacing:"cellSpacing",colspan:"colSpan",frameborder:"frameBorder",height:"height",maxlength:"maxLength",nonce:"nonce",role:"role",rowspan:"rowSpan",
3552
+ type:"type",usemap:"useMap",valign:"vAlign",width:"width"},pd=function(a,b,c){var d=arguments,e=document,f=String(d[0]),g=d[1];if(!gd&&g&&(g.name||g.type)){f=["<",f];g.name&&f.push(' name="',xa(g.name),'"');if(g.type){f.push(' type="',xa(g.type),'"');var l={};nb(l,g);delete l.type;g=l}f.push(">");f=f.join("")}f=e.createElement(f);g&&(m(g)?f.className=g:ia(g)?f.className=g.join(" "):nd(f,g));2<d.length&&od(e,f,d);return f},od=function(a,b,c){function d(c){c&&b.appendChild(m(c)?a.createTextNode(c):
3553
+ c)}for(var e=2;e<c.length;e++){var f=c[e];!ja(f)||q(f)&&0<f.nodeType?d(f):x(qd(f)?ab(f):f,d)}},qd=function(a){if(a&&"number"==typeof a.length){if(q(a))return"function"==typeof a.item||"string"==typeof a.item;if(p(a))return"function"==typeof a.item}return!1};var rd=function(a){a.prototype.then=a.prototype.then;a.prototype.$goog_Thenable=!0},sd=function(a){if(!a)return!1;try{return!!a.$goog_Thenable}catch(b){return!1}};var D=function(a,b){this.Z=0;this.ya=void 0;this.hb=this.ta=this.w=null;this.tc=this.md=!1;if(a!=ea)try{var c=this;a.call(b,function(a){td(c,2,a)},function(a){if(!(a instanceof ud))try{if(a instanceof Error)throw a;throw Error("Promise rejected.");}catch(e){}td(c,3,a)})}catch(d){td(this,3,d)}},vd=function(){this.next=this.context=this.pb=this.Sa=this.child=null;this.Db=!1};vd.prototype.reset=function(){this.context=this.pb=this.Sa=this.child=null;this.Db=!1};
3554
+ var wd=new Sc(function(){return new vd},function(a){a.reset()},100),xd=function(a,b,c){var d=wd.get();d.Sa=a;d.pb=b;d.context=c;return d},E=function(a){if(a instanceof D)return a;var b=new D(ea);td(b,2,a);return b},F=function(a){return new D(function(b,c){c(a)})},zd=function(a,b,c){yd(a,b,c,null)||cd(ma(b,a))},Ad=function(a){return new D(function(b,c){var d=a.length,e=[];if(d)for(var f=function(a,c){d--;e[a]=c;0==d&&b(e)},g=function(a){c(a)},l=0,n;l<a.length;l++)n=a[l],zd(n,ma(f,l),g);else b(e)})},
3555
+ Bd=function(a){return new D(function(b){var c=a.length,d=[];if(c)for(var e=function(a,e,f){c--;d[a]=e?{uf:!0,value:f}:{uf:!1,reason:f};0==c&&b(d)},f=0,g;f<a.length;f++)g=a[f],zd(g,ma(e,f,!0),ma(e,f,!1));else b(d)})};D.prototype.then=function(a,b,c){null!=a&&Ea(a,"opt_onFulfilled should be a function.");null!=b&&Ea(b,"opt_onRejected should be a function. Did you pass opt_context as the second argument instead of the third?");return Cd(this,p(a)?a:null,p(b)?b:null,c)};rd(D);
3556
+ var Ed=function(a,b){b=xd(b,b,void 0);b.Db=!0;Dd(a,b);return a};D.prototype.f=function(a,b){return Cd(this,null,a,b)};D.prototype.cancel=function(a){0==this.Z&&cd(function(){var b=new ud(a);Fd(this,b)},this)};
3557
+ var Fd=function(a,b){if(0==a.Z)if(a.w){var c=a.w;if(c.ta){for(var d=0,e=null,f=null,g=c.ta;g&&(g.Db||(d++,g.child==a&&(e=g),!(e&&1<d)));g=g.next)e||(f=g);e&&(0==c.Z&&1==d?Fd(c,b):(f?(d=f,w(c.ta),w(null!=d),d.next==c.hb&&(c.hb=d),d.next=d.next.next):Gd(c),Hd(c,e,3,b)))}a.w=null}else td(a,3,b)},Dd=function(a,b){a.ta||2!=a.Z&&3!=a.Z||Id(a);w(null!=b.Sa);a.hb?a.hb.next=b:a.ta=b;a.hb=b},Cd=function(a,b,c,d){var e=xd(null,null,null);e.child=new D(function(a,g){e.Sa=b?function(c){try{var e=b.call(d,c);a(e)}catch(C){g(C)}}:
3558
+ a;e.pb=c?function(b){try{var e=c.call(d,b);!ba(e)&&b instanceof ud?g(b):a(e)}catch(C){g(C)}}:g});e.child.w=a;Dd(a,e);return e.child};D.prototype.qg=function(a){w(1==this.Z);this.Z=0;td(this,2,a)};D.prototype.rg=function(a){w(1==this.Z);this.Z=0;td(this,3,a)};
3559
+ var td=function(a,b,c){0==a.Z&&(a===c&&(b=3,c=new TypeError("Promise cannot resolve to itself")),a.Z=1,yd(c,a.qg,a.rg,a)||(a.ya=c,a.Z=b,a.w=null,Id(a),3!=b||c instanceof ud||Jd(a,c)))},yd=function(a,b,c,d){if(a instanceof D)return null!=b&&Ea(b,"opt_onFulfilled should be a function."),null!=c&&Ea(c,"opt_onRejected should be a function. Did you pass opt_context as the second argument instead of the third?"),Dd(a,xd(b||ea,c||null,d)),!0;if(sd(a))return a.then(b,c,d),!0;if(q(a))try{var e=a.then;if(p(e))return Kd(a,
3560
+ e,b,c,d),!0}catch(f){return c.call(d,f),!0}return!1},Kd=function(a,b,c,d,e){var f=!1,g=function(a){f||(f=!0,c.call(e,a))},l=function(a){f||(f=!0,d.call(e,a))};try{b.call(a,g,l)}catch(n){l(n)}},Id=function(a){a.md||(a.md=!0,cd(a.qf,a))},Gd=function(a){var b=null;a.ta&&(b=a.ta,a.ta=b.next,b.next=null);a.ta||(a.hb=null);null!=b&&w(null!=b.Sa);return b};D.prototype.qf=function(){for(var a;a=Gd(this);)Hd(this,a,this.Z,this.ya);this.md=!1};
3561
+ var Hd=function(a,b,c,d){if(3==c&&b.pb&&!b.Db)for(;a&&a.tc;a=a.w)a.tc=!1;if(b.child)b.child.w=null,Ld(b,c,d);else try{b.Db?b.Sa.call(b.context):Ld(b,c,d)}catch(e){Md.call(null,e)}wd.put(b)},Ld=function(a,b,c){2==b?a.Sa.call(a.context,c):a.pb&&a.pb.call(a.context,c)},Jd=function(a,b){a.tc=!0;cd(function(){a.tc&&Md.call(null,b)})},Md=Tc,ud=function(a){u.call(this,a)};t(ud,u);ud.prototype.name="cancel";
3562
+ var Nd=function(a,b){this.Oc=[];this.De=a;this.je=b||null;this.Lb=this.jb=!1;this.ya=void 0;this.Ud=this.$d=this.dd=!1;this.Wc=0;this.w=null;this.ed=0};Nd.prototype.cancel=function(a){if(this.jb)this.ya instanceof Nd&&this.ya.cancel();else{if(this.w){var b=this.w;delete this.w;a?b.cancel(a):(b.ed--,0>=b.ed&&b.cancel())}this.De?this.De.call(this.je,this):this.Ud=!0;this.jb||Od(this,new Pd)}};Nd.prototype.he=function(a,b){this.dd=!1;Qd(this,a,b)};
3563
+ var Qd=function(a,b,c){a.jb=!0;a.ya=c;a.Lb=!b;Rd(a)},Td=function(a){if(a.jb){if(!a.Ud)throw new Sd;a.Ud=!1}};Nd.prototype.callback=function(a){Td(this);Ud(a);Qd(this,!0,a)};var Od=function(a,b){Td(a);Ud(b);Qd(a,!1,b)},Ud=function(a){w(!(a instanceof Nd),"An execution sequence may not be initiated with a blocking Deferred.")},Wd=function(a,b){Vd(a,null,b,void 0)},Vd=function(a,b,c,d){w(!a.$d,"Blocking Deferreds can not be re-used");a.Oc.push([b,c,d]);a.jb&&Rd(a)};
3564
+ Nd.prototype.then=function(a,b,c){var d,e,f=new D(function(a,b){d=a;e=b});Vd(this,d,function(a){a instanceof Pd?f.cancel():e(a)});return f.then(a,b,c)};rd(Nd);
3565
+ var Xd=function(a){return Ta(a.Oc,function(a){return p(a[1])})},Rd=function(a){if(a.Wc&&a.jb&&Xd(a)){var b=a.Wc,c=Yd[b];c&&(k.clearTimeout(c.Mb),delete Yd[b]);a.Wc=0}a.w&&(a.w.ed--,delete a.w);b=a.ya;for(var d=c=!1;a.Oc.length&&!a.dd;){var e=a.Oc.shift(),f=e[0],g=e[1];e=e[2];if(f=a.Lb?g:f)try{var l=f.call(e||a.je,b);ba(l)&&(a.Lb=a.Lb&&(l==b||l instanceof Error),a.ya=b=l);if(sd(b)||"function"===typeof k.Promise&&b instanceof k.Promise)d=!0,a.dd=!0}catch(n){b=n,a.Lb=!0,Xd(a)||(c=!0)}}a.ya=b;d&&(l=r(a.he,
3566
+ a,!0),d=r(a.he,a,!1),b instanceof Nd?(Vd(b,l,d),b.$d=!0):b.then(l,d));c&&(b=new Zd(b),Yd[b.Mb]=b,a.Wc=b.Mb)},Sd=function(){u.call(this)};t(Sd,u);Sd.prototype.message="Deferred has already fired";Sd.prototype.name="AlreadyCalledError";var Pd=function(){u.call(this)};t(Pd,u);Pd.prototype.message="Deferred was canceled";Pd.prototype.name="CanceledError";var Zd=function(a){this.Mb=k.setTimeout(r(this.pg,this),0);this.$=a};
3567
+ Zd.prototype.pg=function(){w(Yd[this.Mb],"Cannot throw an error that is not scheduled.");delete Yd[this.Mb];throw this.$;};var Yd={};var de=function(a){var b={},c=b.document||document,d=La(a),e=document.createElement("SCRIPT"),f={Ke:e,gc:void 0},g=new Nd($d,f),l=null,n=null!=b.timeout?b.timeout:5E3;0<n&&(l=window.setTimeout(function(){ae(e,!0);Od(g,new be(1,"Timeout reached for loading script "+d))},n),f.gc=l);e.onload=e.onreadystatechange=function(){e.readyState&&"loaded"!=e.readyState&&"complete"!=e.readyState||(ae(e,b.Dg||!1,l),g.callback(null))};e.onerror=function(){ae(e,!0,l);Od(g,new be(0,"Error while loading script "+d))};
3568
+ f=b.attributes||{};nb(f,{type:"text/javascript",charset:"UTF-8"});nd(e,f);kd(e,a);ce(c).appendChild(e);return g},ce=function(a){var b;return(b=(a||document).getElementsByTagName("HEAD"))&&0!=b.length?b[0]:a.documentElement},$d=function(){if(this&&this.Ke){var a=this.Ke;a&&"SCRIPT"==a.tagName&&ae(a,!0,this.gc)}},ae=function(a,b,c){null!=c&&k.clearTimeout(c);a.onload=ea;a.onerror=ea;a.onreadystatechange=ea;b&&window.setTimeout(function(){a&&a.parentNode&&a.parentNode.removeChild(a)},0)},be=function(a,
3569
+ b){var c="Jsloader error (code #"+a+")";b&&(c+=": "+b);u.call(this,c);this.code=a};t(be,u);var ee=function(a,b,c,d,e){this.reset(a,b,c,d,e)};ee.prototype.le=null;var fe=0;ee.prototype.reset=function(a,b,c,d,e){"number"==typeof e||fe++;d||na();this.Rb=a;this.Rf=b;delete this.le};ee.prototype.Me=function(a){this.Rb=a};var ge=function(a){this.Be=a;this.re=this.gd=this.Rb=this.w=null},he=function(a,b){this.name=a;this.value=b};he.prototype.toString=function(){return this.name};var ie=new he("SEVERE",1E3),je=new he("INFO",800),ke=new he("CONFIG",700),le=new he("FINE",500);ge.prototype.getName=function(){return this.Be};ge.prototype.getParent=function(){return this.w};ge.prototype.Me=function(a){this.Rb=a};var me=function(a){if(a.Rb)return a.Rb;if(a.w)return me(a.w);Ba("Root logger has no level set.");return null};
3570
+ ge.prototype.log=function(a,b,c){if(a.value>=me(this).value)for(p(b)&&(b=b()),a=new ee(a,String(b),this.Be),c&&(a.le=c),c="log:"+a.Rf,(b=k.console)&&b.timeStamp&&b.timeStamp(c),(b=k.msWriteProfilerMark)&&b(c),c=this;c;){var d=c,e=a;if(d.re)for(var f=0;b=d.re[f];f++)b(e);c=c.getParent()}};ge.prototype.info=function(a,b){this.log(je,a,b)};ge.prototype.config=function(a,b){this.log(ke,a,b)};
3571
+ var ne={},oe=null,pe=function(a){oe||(oe=new ge(""),ne[""]=oe,oe.Me(ke));var b;if(!(b=ne[a])){b=new ge(a);var c=a.lastIndexOf("."),d=a.substr(c+1);c=pe(a.substr(0,c));c.gd||(c.gd={});c.gd[d]=b;b.w=c;ne[a]=b}return b};var G=function(){Ub.call(this);this.ea=new cc(this);this.cf=this;this.Ed=null};t(G,Ub);G.prototype[Zb]=!0;h=G.prototype;h.addEventListener=function(a,b,c,d){kc(this,a,b,c,d)};h.removeEventListener=function(a,b,c,d){sc(this,a,b,c,d)};
3572
+ h.dispatchEvent=function(a){qe(this);var b=this.Ed;if(b){var c=[];for(var d=1;b;b=b.Ed)c.push(b),w(1E3>++d,"infinite loop")}b=this.cf;d=a.type||a;if(m(a))a=new B(a,b);else if(a instanceof B)a.target=a.target||b;else{var e=a;a=new B(d,b);nb(a,e)}e=!0;if(c)for(var f=c.length-1;!a.Ua&&0<=f;f--){var g=a.currentTarget=c[f];e=re(g,d,!0,a)&&e}a.Ua||(g=a.currentTarget=b,e=re(g,d,!0,a)&&e,a.Ua||(e=re(g,d,!1,a)&&e));if(c)for(f=0;!a.Ua&&f<c.length;f++)g=a.currentTarget=c[f],e=re(g,d,!1,a)&&e;return e};
3573
+ h.ib=function(){G.Sc.ib.call(this);if(this.ea){var a=this.ea,b=0,c;for(c in a.J){for(var d=a.J[c],e=0;e<d.length;e++)++b,bc(d[e]);delete a.J[c];a.hc--}}this.Ed=null};h.listen=function(a,b,c,d){qe(this);return this.ea.add(String(a),b,!1,c,d)};
3574
+ var rc=function(a,b,c,d,e){a.ea.add(String(b),c,!0,d,e)},re=function(a,b,c,d){b=a.ea.J[String(b)];if(!b)return!0;b=b.concat();for(var e=!0,f=0;f<b.length;++f){var g=b[f];if(g&&!g.yb&&g.capture==c){var l=g.listener,n=g.uc||g.src;g.nc&&fc(a.ea,g);e=!1!==l.call(n,d)&&e}}return e&&0!=d.Je};G.prototype.od=function(a,b,c,d){return this.ea.od(String(a),b,c,d)};G.prototype.hasListener=function(a,b){return this.ea.hasListener(ba(a)?String(a):void 0,b)};var qe=function(a){w(a.ea,"Event target is not initialized. Did you call the superclass (goog.events.EventTarget) constructor?")};var se="StopIteration"in k?k.StopIteration:{message:"StopIteration",stack:""},te=function(){};te.prototype.next=function(){throw se;};te.prototype.bf=function(){return this};var H=function(a,b){a&&a.log(le,b,void 0)};var ue=function(a,b){this.ia={};this.A=[];this.cb=this.s=0;var c=arguments.length;if(1<c){if(c%2)throw Error("Uneven number of arguments");for(var d=0;d<c;d+=2)this.set(arguments[d],arguments[d+1])}else a&&this.addAll(a)};h=ue.prototype;h.ga=function(){ve(this);for(var a=[],b=0;b<this.A.length;b++)a.push(this.ia[this.A[b]]);return a};h.ua=function(){ve(this);return this.A.concat()};h.Fb=function(a){return we(this.ia,a)};h.clear=function(){this.ia={};this.cb=this.s=this.A.length=0};
3575
+ h.remove=function(a){return we(this.ia,a)?(delete this.ia[a],this.s--,this.cb++,this.A.length>2*this.s&&ve(this),!0):!1};var ve=function(a){var b,c;if(a.s!=a.A.length){for(b=c=0;c<a.A.length;){var d=a.A[c];we(a.ia,d)&&(a.A[b++]=d);c++}a.A.length=b}if(a.s!=a.A.length){var e={};for(b=c=0;c<a.A.length;)d=a.A[c],we(e,d)||(a.A[b++]=d,e[d]=1),c++;a.A.length=b}};h=ue.prototype;h.get=function(a,b){return we(this.ia,a)?this.ia[a]:b};
3576
+ h.set=function(a,b){we(this.ia,a)||(this.s++,this.A.push(a),this.cb++);this.ia[a]=b};h.addAll=function(a){if(a instanceof ue){var b=a.ua();a=a.ga()}else b=ib(a),a=hb(a);for(var c=0;c<b.length;c++)this.set(b[c],a[c])};h.forEach=function(a,b){for(var c=this.ua(),d=0;d<c.length;d++){var e=c[d],f=this.get(e);a.call(b,f,e,this)}};h.clone=function(){return new ue(this)};
3577
+ h.bf=function(a){ve(this);var b=0,c=this.cb,d=this,e=new te;e.next=function(){if(c!=d.cb)throw Error("The map has changed since the iterator was created");if(b>=d.A.length)throw se;var e=d.A[b++];return a?e:d.ia[e]};return e};var we=function(a,b){return Object.prototype.hasOwnProperty.call(a,b)};var xe=function(a){if(a.ga&&"function"==typeof a.ga)return a.ga();if(m(a))return a.split("");if(ja(a)){for(var b=[],c=a.length,d=0;d<c;d++)b.push(a[d]);return b}return hb(a)},ye=function(a){if(a.ua&&"function"==typeof a.ua)return a.ua();if(!a.ga||"function"!=typeof a.ga){if(ja(a)||m(a)){var b=[];a=a.length;for(var c=0;c<a;c++)b.push(c);return b}return ib(a)}},ze=function(a,b,c){if(a.forEach&&"function"==typeof a.forEach)a.forEach(b,c);else if(ja(a)||m(a))x(a,b,c);else for(var d=ye(a),e=xe(a),f=e.length,
3578
+ g=0;g<f;g++)b.call(c,e[g],d&&d[g],a)};var Ae=function(a,b,c){if(p(a))c&&(a=r(a,c));else if(a&&"function"==typeof a.handleEvent)a=r(a.handleEvent,a);else throw Error("Invalid listener argument");return 2147483647<Number(b)?-1:k.setTimeout(a,b||0)},Be=function(a){var b=null;return(new D(function(c,d){b=Ae(function(){c(void 0)},a);-1==b&&d(Error("Failed to schedule timer."))})).f(function(a){k.clearTimeout(b);throw a;})};var Ce=/^(?:([^:/?#.]+):)?(?:\/\/(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\?([^#]*))?(?:#([\s\S]*))?$/,De=function(a,b){if(a){a=a.split("&");for(var c=0;c<a.length;c++){var d=a[c].indexOf("="),e=null;if(0<=d){var f=a[c].substring(0,d);e=a[c].substring(d+1)}else f=a[c];b(f,e?decodeURIComponent(e.replace(/\+/g," ")):"")}}};var I=function(a){G.call(this);this.headers=new ue;this.bd=a||null;this.Aa=!1;this.ad=this.b=null;this.Qb=this.Ae=this.Dc="";this.Oa=this.td=this.yc=this.ld=!1;this.zb=0;this.Tc=null;this.Nc="";this.Xc=this.Yf=this.Xe=!1};t(I,G);var Ee=I.prototype,Fe=pe("goog.net.XhrIo");Ee.O=Fe;var Ge=/^https?$/i,He=["POST","PUT"];
3579
+ I.prototype.send=function(a,b,c,d){if(this.b)throw Error("[goog.net.XhrIo] Object is active with another request="+this.Dc+"; newUri="+a);b=b?b.toUpperCase():"GET";this.Dc=a;this.Qb="";this.Ae=b;this.ld=!1;this.Aa=!0;this.b=this.bd?this.bd.pc():Mc.pc();this.ad=this.bd?Lc(this.bd):Lc(Mc);this.b.onreadystatechange=r(this.Ge,this);this.Yf&&"onprogress"in this.b&&(this.b.onprogress=r(function(a){this.Fe(a,!0)},this),this.b.upload&&(this.b.upload.onprogress=r(this.Fe,this)));try{H(this.O,Ie(this,"Opening Xhr")),
3580
+ this.td=!0,this.b.open(b,String(a),!0),this.td=!1}catch(f){H(this.O,Ie(this,"Error opening Xhr: "+f.message));this.$(5,f);return}a=c||"";var e=this.headers.clone();d&&ze(d,function(a,b){e.set(b,a)});d=Va(e.ua());c=k.FormData&&a instanceof k.FormData;!Wa(He,b)||d||c||e.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");e.forEach(function(a,b){this.b.setRequestHeader(b,a)},this);this.Nc&&(this.b.responseType=this.Nc);"withCredentials"in this.b&&this.b.withCredentials!==this.Xe&&(this.b.withCredentials=
3581
+ this.Xe);try{Je(this),0<this.zb&&(this.Xc=Ke(this.b),H(this.O,Ie(this,"Will abort after "+this.zb+"ms if incomplete, xhr2 "+this.Xc)),this.Xc?(this.b.timeout=this.zb,this.b.ontimeout=r(this.gc,this)):this.Tc=Ae(this.gc,this.zb,this)),H(this.O,Ie(this,"Sending request")),this.yc=!0,this.b.send(a),this.yc=!1}catch(f){H(this.O,Ie(this,"Send error: "+f.message)),this.$(5,f)}};var Ke=function(a){return z&&A(9)&&da(a.timeout)&&ba(a.ontimeout)},Ua=function(a){return"content-type"==a.toLowerCase()};
3582
+ I.prototype.gc=function(){"undefined"!=typeof aa&&this.b&&(this.Qb="Timed out after "+this.zb+"ms, aborting",H(this.O,Ie(this,this.Qb)),this.dispatchEvent("timeout"),this.abort(8))};I.prototype.$=function(a,b){this.Aa=!1;this.b&&(this.Oa=!0,this.b.abort(),this.Oa=!1);this.Qb=b;Le(this);Me(this)};var Le=function(a){a.ld||(a.ld=!0,a.dispatchEvent("complete"),a.dispatchEvent("error"))};
3583
+ I.prototype.abort=function(){this.b&&this.Aa&&(H(this.O,Ie(this,"Aborting")),this.Aa=!1,this.Oa=!0,this.b.abort(),this.Oa=!1,this.dispatchEvent("complete"),this.dispatchEvent("abort"),Me(this))};I.prototype.ib=function(){this.b&&(this.Aa&&(this.Aa=!1,this.Oa=!0,this.b.abort(),this.Oa=!1),Me(this,!0));I.Sc.ib.call(this)};I.prototype.Ge=function(){this.isDisposed()||(this.td||this.yc||this.Oa?Ne(this):this.Uf())};I.prototype.Uf=function(){Ne(this)};
3584
+ var Ne=function(a){if(a.Aa&&"undefined"!=typeof aa)if(a.ad[1]&&4==Oe(a)&&2==Pe(a))H(a.O,Ie(a,"Local request error detected and ignored"));else if(a.yc&&4==Oe(a))Ae(a.Ge,0,a);else if(a.dispatchEvent("readystatechange"),4==Oe(a)){H(a.O,Ie(a,"Request complete"));a.Aa=!1;try{var b=Pe(a);a:switch(b){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var c=!0;break a;default:c=!1}var d;if(!(d=c)){var e;if(e=0===b){var f=String(a.Dc).match(Ce)[1]||null;if(!f&&k.self&&k.self.location){var g=
3585
+ k.self.location.protocol;f=g.substr(0,g.length-1)}e=!Ge.test(f?f.toLowerCase():"")}d=e}if(d)a.dispatchEvent("complete"),a.dispatchEvent("success");else{try{var l=2<Oe(a)?a.b.statusText:""}catch(n){H(a.O,"Can not get status: "+n.message),l=""}a.Qb=l+" ["+Pe(a)+"]";Le(a)}}finally{Me(a)}}};I.prototype.Fe=function(a,b){w("progress"===a.type,"goog.net.EventType.PROGRESS is of the same type as raw XHR progress.");this.dispatchEvent(Qe(a,"progress"));this.dispatchEvent(Qe(a,b?"downloadprogress":"uploadprogress"))};
3586
+ var Qe=function(a,b){return{type:b,lengthComputable:a.lengthComputable,loaded:a.loaded,total:a.total}},Me=function(a,b){if(a.b){Je(a);var c=a.b,d=a.ad[0]?ea:null;a.b=null;a.ad=null;b||a.dispatchEvent("ready");try{c.onreadystatechange=d}catch(e){(a=a.O)&&a.log(ie,"Problem encountered resetting onreadystatechange: "+e.message,void 0)}}},Je=function(a){a.b&&a.Xc&&(a.b.ontimeout=null);da(a.Tc)&&(k.clearTimeout(a.Tc),a.Tc=null)},Oe=function(a){return a.b?a.b.readyState:0},Pe=function(a){try{return 2<Oe(a)?
3587
+ a.b.status:-1}catch(b){return-1}},Re=function(a){try{return a.b?a.b.responseText:""}catch(b){return H(a.O,"Can not get responseText: "+b.message),""}};
3588
+ I.prototype.getResponse=function(){try{if(!this.b)return null;if("response"in this.b)return this.b.response;switch(this.Nc){case "":case "text":return this.b.responseText;case "arraybuffer":if("mozResponseArrayBuffer"in this.b)return this.b.mozResponseArrayBuffer}var a=this.O;a&&a.log(ie,"Response type "+this.Nc+" is not supported on this browser",void 0);return null}catch(b){return H(this.O,"Can not get response: "+b.message),null}};
3589
+ I.prototype.getResponseHeader=function(a){if(this.b&&4==Oe(this))return a=this.b.getResponseHeader(a),null===a?void 0:a};I.prototype.getAllResponseHeaders=function(){return this.b&&4==Oe(this)?this.b.getAllResponseHeaders():""};var Ie=function(a,b){return b+" ["+a.Ae+" "+a.Dc+" "+Pe(a)+"]"};var Se=function(a,b){this.oa=this.ab=this.pa="";this.rb=null;this.Na=this.Da="";this.ba=this.Mf=!1;if(a instanceof Se){this.ba=ba(b)?b:a.ba;Te(this,a.pa);var c=a.ab;J(this);this.ab=c;Ue(this,a.oa);Ve(this,a.rb);We(this,a.Da);Xe(this,a.ca.clone());a=a.Na;J(this);this.Na=a}else a&&(c=String(a).match(Ce))?(this.ba=!!b,Te(this,c[1]||"",!0),a=c[2]||"",J(this),this.ab=Ye(a),Ue(this,c[3]||"",!0),Ve(this,c[4]),We(this,c[5]||"",!0),Xe(this,c[6]||"",!0),a=c[7]||"",J(this),this.Na=Ye(a)):(this.ba=!!b,this.ca=
3590
+ new Ze(null,0,this.ba))};Se.prototype.toString=function(){var a=[],b=this.pa;b&&a.push($e(b,af,!0),":");var c=this.oa;if(c||"file"==b)a.push("//"),(b=this.ab)&&a.push($e(b,af,!0),"@"),a.push(encodeURIComponent(String(c)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),c=this.rb,null!=c&&a.push(":",String(c));if(c=this.Da)this.oa&&"/"!=c.charAt(0)&&a.push("/"),a.push($e(c,"/"==c.charAt(0)?bf:cf,!0));(c=this.ca.toString())&&a.push("?",c);(c=this.Na)&&a.push("#",$e(c,df));return a.join("")};
3591
+ Se.prototype.resolve=function(a){var b=this.clone(),c=!!a.pa;c?Te(b,a.pa):c=!!a.ab;if(c){var d=a.ab;J(b);b.ab=d}else c=!!a.oa;c?Ue(b,a.oa):c=null!=a.rb;d=a.Da;if(c)Ve(b,a.rb);else if(c=!!a.Da){if("/"!=d.charAt(0))if(this.oa&&!this.Da)d="/"+d;else{var e=b.Da.lastIndexOf("/");-1!=e&&(d=b.Da.substr(0,e+1)+d)}e=d;if(".."==e||"."==e)d="";else if(v(e,"./")||v(e,"/.")){d=0==e.lastIndexOf("/",0);e=e.split("/");for(var f=[],g=0;g<e.length;){var l=e[g++];"."==l?d&&g==e.length&&f.push(""):".."==l?((1<f.length||
3592
+ 1==f.length&&""!=f[0])&&f.pop(),d&&g==e.length&&f.push("")):(f.push(l),d=!0)}d=f.join("/")}else d=e}c?We(b,d):c=""!==a.ca.toString();c?Xe(b,a.ca.clone()):c=!!a.Na;c&&(a=a.Na,J(b),b.Na=a);return b};Se.prototype.clone=function(){return new Se(this)};
3593
+ var Te=function(a,b,c){J(a);a.pa=c?Ye(b,!0):b;a.pa&&(a.pa=a.pa.replace(/:$/,""))},Ue=function(a,b,c){J(a);a.oa=c?Ye(b,!0):b},Ve=function(a,b){J(a);if(b){b=Number(b);if(isNaN(b)||0>b)throw Error("Bad port number "+b);a.rb=b}else a.rb=null},We=function(a,b,c){J(a);a.Da=c?Ye(b,!0):b},Xe=function(a,b,c){J(a);b instanceof Ze?(a.ca=b,a.ca.Rd(a.ba)):(c||(b=$e(b,ef)),a.ca=new Ze(b,0,a.ba))},K=function(a,b,c){J(a);a.ca.set(b,c)},ff=function(a,b){return a.ca.get(b)};
3594
+ Se.prototype.removeParameter=function(a){J(this);this.ca.remove(a);return this};var J=function(a){if(a.Mf)throw Error("Tried to modify a read-only Uri");};Se.prototype.Rd=function(a){this.ba=a;this.ca&&this.ca.Rd(a);return this};
3595
+ var gf=function(a){return a instanceof Se?a.clone():new Se(a,void 0)},hf=function(a,b){var c=new Se(null,void 0);Te(c,"https");a&&Ue(c,a);b&&We(c,b);return c},Ye=function(a,b){return a?b?decodeURI(a.replace(/%25/g,"%2525")):decodeURIComponent(a):""},$e=function(a,b,c){return m(a)?(a=encodeURI(a).replace(b,jf),c&&(a=a.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),a):null},jf=function(a){a=a.charCodeAt(0);return"%"+(a>>4&15).toString(16)+(a&15).toString(16)},af=/[#\/\?@]/g,cf=/[\#\?:]/g,bf=/[\#\?]/g,ef=/[\#\?@]/g,
3596
+ df=/#/g,Ze=function(a,b,c){this.s=this.m=null;this.T=a||null;this.ba=!!c},kf=function(a){a.m||(a.m=new ue,a.s=0,a.T&&De(a.T,function(b,c){a.add(decodeURIComponent(b.replace(/\+/g," ")),c)}))},mf=function(a){var b=ye(a);if("undefined"==typeof b)throw Error("Keys are undefined");var c=new Ze(null,0,void 0);a=xe(a);for(var d=0;d<b.length;d++){var e=b[d],f=a[d];ia(f)?lf(c,e,f):c.add(e,f)}return c};h=Ze.prototype;
3597
+ h.add=function(a,b){kf(this);this.T=null;a=this.aa(a);var c=this.m.get(a);c||this.m.set(a,c=[]);c.push(b);this.s=Ca(this.s)+1;return this};h.remove=function(a){kf(this);a=this.aa(a);return this.m.Fb(a)?(this.T=null,this.s=Ca(this.s)-this.m.get(a).length,this.m.remove(a)):!1};h.clear=function(){this.m=this.T=null;this.s=0};h.Fb=function(a){kf(this);a=this.aa(a);return this.m.Fb(a)};h.forEach=function(a,b){kf(this);this.m.forEach(function(c,d){x(c,function(c){a.call(b,c,d,this)},this)},this)};
3598
+ h.ua=function(){kf(this);for(var a=this.m.ga(),b=this.m.ua(),c=[],d=0;d<b.length;d++)for(var e=a[d],f=0;f<e.length;f++)c.push(b[d]);return c};h.ga=function(a){kf(this);var b=[];if(m(a))this.Fb(a)&&(b=$a(b,this.m.get(this.aa(a))));else{a=this.m.ga();for(var c=0;c<a.length;c++)b=$a(b,a[c])}return b};h.set=function(a,b){kf(this);this.T=null;a=this.aa(a);this.Fb(a)&&(this.s=Ca(this.s)-this.m.get(a).length);this.m.set(a,[b]);this.s=Ca(this.s)+1;return this};
3599
+ h.get=function(a,b){a=a?this.ga(a):[];return 0<a.length?String(a[0]):b};var lf=function(a,b,c){a.remove(b);0<c.length&&(a.T=null,a.m.set(a.aa(b),ab(c)),a.s=Ca(a.s)+c.length)};h=Ze.prototype;h.toString=function(){if(this.T)return this.T;if(!this.m)return"";for(var a=[],b=this.m.ua(),c=0;c<b.length;c++){var d=b[c],e=encodeURIComponent(String(d));d=this.ga(d);for(var f=0;f<d.length;f++){var g=e;""!==d[f]&&(g+="="+encodeURIComponent(String(d[f])));a.push(g)}}return this.T=a.join("&")};
3600
+ h.clone=function(){var a=new Ze;a.T=this.T;this.m&&(a.m=this.m.clone(),a.s=this.s);return a};h.aa=function(a){a=String(a);this.ba&&(a=a.toLowerCase());return a};h.Rd=function(a){a&&!this.ba&&(kf(this),this.T=null,this.m.forEach(function(a,c){var b=c.toLowerCase();c!=b&&(this.remove(c),lf(this,b,a))},this));this.ba=a};h.extend=function(a){for(var b=0;b<arguments.length;b++)ze(arguments[b],function(a,b){this.add(b,a)},this)};var nf=function(){var a=L();return z&&!!Db&&11==Db||/Edge\/\d+/.test(a)},of=function(){return k.window&&k.window.location.href||""},pf=function(a,b){b=b||k.window;var c="about:blank";a&&(c=Ac(Dc(a)));b.location.href=c},qf=function(a,b){var c=[],d;for(d in a)d in b?typeof a[d]!=typeof b[d]?c.push(d):ia(a[d])?kb(a[d],b[d])||c.push(d):"object"==typeof a[d]&&null!=a[d]&&null!=b[d]?0<qf(a[d],b[d]).length&&c.push(d):a[d]!==b[d]&&c.push(d):c.push(d);for(d in b)d in a||c.push(d);return c},sf=function(){var a=
3601
+ L();a="Chrome"!=rf(a)?null:(a=a.match(/\sChrome\/(\d+)/i))&&2==a.length?parseInt(a[1],10):null;return a&&30>a?!1:!z||!Db||9<Db},tf=function(a){a=(a||L()).toLowerCase();return a.match(/android/)||a.match(/webos/)||a.match(/iphone|ipad|ipod/)||a.match(/blackberry/)||a.match(/windows phone/)||a.match(/iemobile/)?!0:!1},uf=function(a){a=a||k.window;try{a.close()}catch(b){}},vf=function(a,b,c){var d=Math.floor(1E9*Math.random()).toString();b=b||500;c=c||600;var e=(window.screen.availHeight-c)/2,f=(window.screen.availWidth-
3602
+ b)/2;b={width:b,height:c,top:0<e?e:0,left:0<f?f:0,location:!0,resizable:!0,statusbar:!0,toolbar:!1};c=L().toLowerCase();d&&(b.target=d,v(c,"crios/")&&(b.target="_blank"));"Firefox"==rf(L())&&(a=a||"http://localhost",b.scrollbars=!0);c=a||"";(d=b)||(d={});a=window;b=c instanceof zc?c:Dc("undefined"!=typeof c.href?c.href:String(c));c=d.target||c.target;e=[];for(g in d)switch(g){case "width":case "height":case "top":case "left":e.push(g+"="+d[g]);break;case "target":case "noreferrer":break;default:e.push(g+
3603
+ "="+(d[g]?1:0))}var g=e.join(",");(y("iPhone")&&!y("iPod")&&!y("iPad")||y("iPad")||y("iPod"))&&a.navigator&&a.navigator.standalone&&c&&"_self"!=c?(g=a.document.createElement("A"),e=fd(g),"undefined"!=typeof e.HTMLAnchorElement&&"undefined"!=typeof e.Location&&"undefined"!=typeof e.Element&&w(g&&(g instanceof e.HTMLAnchorElement||!(g instanceof e.Location||g instanceof e.Element)),"Argument is not a HTMLAnchorElement (or a non-Element mock); got: %s",ed(g)),b instanceof zc||b instanceof zc||(b=b.mb?
3604
+ b.kb():String(b),w(Bc.test(b))||(b="about:invalid#zClosurez"),b=Cc(b)),g.href=Ac(b),g.setAttribute("target",c),d.noreferrer&&g.setAttribute("rel","noreferrer"),d=document.createEvent("MouseEvent"),d.initMouseEvent("click",!0,!0,a,1),g.dispatchEvent(d),g={}):d.noreferrer?(g=a.open("",c,g),d=Ac(b),g&&(tb&&v(d,";")&&(d="'"+d.replace(/'/g,"%27")+"'"),g.opener=null,a=Ia("b/12014412, meta tag with sanitized URL"),d='<META HTTP-EQUIV="refresh" content="0; url='+xa(d)+'">',Da(Ha(a),"must provide justification"),
3605
+ w(!/^[\s\xa0]*$/.test(Ha(a)),"must provide non-empty justification"),g.document.write(jd((new id).If(d))),g.document.close())):g=a.open(Ac(b),c,g);if(g)try{g.focus()}catch(l){}return g},wf=function(a){return new D(function(b){var c=function(){Be(2E3).then(function(){if(!a||a.closed)b();else return c()})};return c()})},xf=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,yf=function(){var a=null;return(new D(function(b){"complete"==k.document.readyState?b():(a=function(){b()},jc(window,"load",a))})).f(function(b){sc(window,
3606
+ "load",a);throw b;})},Af=function(){return zf(void 0)?yf().then(function(){return new D(function(a,b){var c=k.document,d=setTimeout(function(){b(Error("Cordova framework is not ready."))},1E3);c.addEventListener("deviceready",function(){clearTimeout(d);a()},!1)})}):F(Error("Cordova must run in an Android or iOS file scheme."))},zf=function(a){a=a||L();return!("file:"!==Bf()||!a.toLowerCase().match(/iphone|ipad|ipod|android/))},Cf=function(){var a=k.window;try{return!(!a||a==a.top)}catch(b){return!1}},
3607
+ Df=function(){return firebase.INTERNAL.hasOwnProperty("reactNative")?"ReactNative":firebase.INTERNAL.hasOwnProperty("node")?"Node":"Browser"},Ef=function(){var a=Df();return"ReactNative"===a||"Node"===a},rf=function(a){var b=a.toLowerCase();if(v(b,"opera/")||v(b,"opr/")||v(b,"opios/"))return"Opera";if(v(b,"iemobile"))return"IEMobile";if(v(b,"msie")||v(b,"trident/"))return"IE";if(v(b,"edge/"))return"Edge";if(v(b,"firefox/"))return"Firefox";if(v(b,"silk/"))return"Silk";if(v(b,"blackberry"))return"Blackberry";
3608
+ if(v(b,"webos"))return"Webos";if(!v(b,"safari/")||v(b,"chrome/")||v(b,"crios/")||v(b,"android"))if(!v(b,"chrome/")&&!v(b,"crios/")||v(b,"edge/")){if(v(b,"android"))return"Android";if((a=a.match(/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/))&&2==a.length)return a[1]}else return"Chrome";else return"Safari";return"Other"},Ff=function(a){var b=Df();return("Browser"===b?rf(L()):b)+"/JsCore/"+a},L=function(){return k.navigator&&k.navigator.userAgent||""},M=function(a,b){a=a.split(".");b=b||k;for(var c=0;c<a.length&&
3609
+ "object"==typeof b&&null!=b;c++)b=b[a[c]];c!=a.length&&(b=void 0);return b},Hf=function(){try{var a=k.localStorage,b=Gf();if(a)return a.setItem(b,"1"),a.removeItem(b),nf()?!!k.indexedDB:!0}catch(c){}return!1},Jf=function(){return(If()||"chrome-extension:"===Bf()||zf())&&!Ef()&&Hf()},If=function(){return"http:"===Bf()||"https:"===Bf()},Bf=function(){return k.location&&k.location.protocol||null},Kf=function(a){a=a||L();return tf(a)||"Firefox"==rf(a)?!1:!0},Lf=function(a){return"undefined"===typeof a?
3610
+ null:Gc(a)},Mf=function(a){var b={},c;for(c in a)a.hasOwnProperty(c)&&null!==a[c]&&void 0!==a[c]&&(b[c]=a[c]);return b},Nf=function(a){if(null!==a)return JSON.parse(a)},Gf=function(a){return a?a:""+Math.floor(1E9*Math.random()).toString()},Of=function(a){a=a||L();return"Safari"==rf(a)||a.toLowerCase().match(/iphone|ipad|ipod/)?!1:!0},Pf=function(){var a=k.___jsl;if(a&&a.H)for(var b in a.H)if(a.H[b].r=a.H[b].r||[],a.H[b].L=a.H[b].L||[],a.H[b].r=a.H[b].L.concat(),a.CP)for(var c=0;c<a.CP.length;c++)a.CP[c]=
3611
+ null},Qf=function(){var a=k.navigator;return a&&"boolean"===typeof a.onLine&&(If()||"chrome-extension:"===Bf()||"undefined"!==typeof a.connection)?a.onLine:!0},Rf=function(a,b,c,d){if(a>b)throw Error("Short delay should be less than long delay!");this.lg=a;this.Qf=b;a=c||L();d=d||Df();this.Lf=tf(a)||"ReactNative"===d};Rf.prototype.get=function(){return this.Lf?this.Qf:this.lg};
3612
+ var Sf=function(){var a=k.document;return a&&"undefined"!==typeof a.visibilityState?"visible"==a.visibilityState:!0},Tf=function(){var a=k.document,b=null;return Sf()||!a?E():(new D(function(c){b=function(){Sf()&&(a.removeEventListener("visibilitychange",b,!1),c())};a.addEventListener("visibilitychange",b,!1)})).f(function(c){a.removeEventListener("visibilitychange",b,!1);throw c;})};var Uf={};var Vf;try{var Wf={};Object.defineProperty(Wf,"abcd",{configurable:!0,enumerable:!0,value:1});Object.defineProperty(Wf,"abcd",{configurable:!0,enumerable:!0,value:2});Vf=2==Wf.abcd}catch(a){Vf=!1}
3613
+ var N=function(a,b,c){Vf?Object.defineProperty(a,b,{configurable:!0,enumerable:!0,value:c}):a[b]=c},Xf=function(a,b){if(b)for(var c in b)b.hasOwnProperty(c)&&N(a,c,b[c])},Yf=function(a){var b={};Xf(b,a);return b},Zf=function(a){var b={},c;for(c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b},$f=function(a,b){if(!b||!b.length)return!0;if(!a)return!1;for(var c=0;c<b.length;c++){var d=a[b[c]];if(void 0===d||null===d||""===d)return!1}return!0},ag=function(a){var b=a;if("object"==typeof a&&null!=a){b=
3614
+ "length"in a?[]:{};for(var c in a)N(b,c,ag(a[c]))}return b};var bg="oauth_consumer_key oauth_nonce oauth_signature oauth_signature_method oauth_timestamp oauth_token oauth_version".split(" "),cg=["client_id","response_type","scope","redirect_uri","state"],dg={wg:{Cc:"locale",Vb:500,Ub:600,providerId:"facebook.com",Nd:cg},xg:{Cc:null,Vb:500,Ub:620,providerId:"github.com",Nd:cg},yg:{Cc:"hl",Vb:515,Ub:680,providerId:"google.com",Nd:cg},Bg:{Cc:"lang",Vb:485,Ub:705,providerId:"twitter.com",Nd:bg}},eg=function(a){for(var b in dg)if(dg[b].providerId==a)return dg[b];
3615
+ return null};var O=function(a,b){this.code="auth/"+a;this.message=b||fg[a]||""};t(O,Error);O.prototype.I=function(){return{code:this.code,message:this.message}};O.prototype.toJSON=function(){return this.I()};
3616
+ var gg=function(a){var b=a&&a.code;return b?new O(b.substring(5),a.message):null},fg={"argument-error":"","app-not-authorized":"This app, identified by the domain where it's hosted, is not authorized to use Firebase Authentication with the provided API key. Review your key configuration in the Google API console.","app-not-installed":"The requested mobile application corresponding to the identifier (Android package name or iOS bundle ID) provided is not installed on this device.","captcha-check-failed":"The reCAPTCHA response token provided is either invalid, expired, already used or the domain associated with it does not match the list of whitelisted domains.",
3617
+ "code-expired":"The SMS code has expired. Please re-send the verification code to try again.","cordova-not-ready":"Cordova framework is not ready.","cors-unsupported":"This browser is not supported.","credential-already-in-use":"This credential is already associated with a different user account.","custom-token-mismatch":"The custom token corresponds to a different audience.","requires-recent-login":"This operation is sensitive and requires recent authentication. Log in again before retrying this request.",
3618
+ "dynamic-link-not-activated":"Please activate Dynamic Links in the Firebase Console and agree to the terms and conditions.","email-already-in-use":"The email address is already in use by another account.","expired-action-code":"The action code has expired. ","cancelled-popup-request":"This operation has been cancelled due to another conflicting popup being opened.","internal-error":"An internal error has occurred.","invalid-app-credential":"The phone verification request contains an invalid application verifier. The reCAPTCHA token response is either invalid or expired.",
3619
+ "invalid-app-id":"The mobile app identifier is not registed for the current project.","invalid-user-token":"The user's credential is no longer valid. The user must sign in again.","invalid-auth-event":"An internal error has occurred.","invalid-verification-code":"The SMS verification code used to create the phone auth credential is invalid. Please resend the verification code sms and be sure use the verification code provided by the user.","invalid-continue-uri":"The continue URL provided in the request is invalid.",
3620
+ "invalid-cordova-configuration":"The following Cordova plugins must be installed to enable OAuth sign-in: cordova-plugin-buildinfo, cordova-universal-links-plugin, cordova-plugin-browsertab, cordova-plugin-inappbrowser and cordova-plugin-customurlscheme.","invalid-custom-token":"The custom token format is incorrect. Please check the documentation.","invalid-email":"The email address is badly formatted.","invalid-api-key":"Your API key is invalid, please check you have copied it correctly.","invalid-credential":"The supplied auth credential is malformed or has expired.",
3621
+ "invalid-persistence-type":"The specified persistence type is invalid. It can only be local, session or none.","invalid-message-payload":"The email template corresponding to this action contains invalid characters in its message. Please fix by going to the Auth email templates section in the Firebase Console.","invalid-oauth-provider":"EmailAuthProvider is not supported for this operation. This operation only supports OAuth providers.","unauthorized-domain":"This domain is not authorized for OAuth operations for your Firebase project. Edit the list of authorized domains from the Firebase console.",
3622
+ "invalid-action-code":"The action code is invalid. This can happen if the code is malformed, expired, or has already been used.","wrong-password":"The password is invalid or the user does not have a password.","invalid-phone-number":"The format of the phone number provided is incorrect. Please enter the phone number in a format that can be parsed into E.164 format. E.164 phone numbers are written in the format [+][country code][subscriber number including area code].","invalid-recipient-email":"The email corresponding to this action failed to send as the provided recipient email address is invalid.",
3623
+ "invalid-sender":"The email template corresponding to this action contains an invalid sender email or name. Please fix by going to the Auth email templates section in the Firebase Console.","invalid-verification-id":"The verification ID used to create the phone auth credential is invalid.","missing-android-pkg-name":"An Android Package Name must be provided if the Android App is required to be installed.","auth-domain-config-required":"Be sure to include authDomain when calling firebase.initializeApp(), by following the instructions in the Firebase console.",
3624
+ "missing-app-credential":"The phone verification request is missing an application verifier assertion. A reCAPTCHA response token needs to be provided.","missing-verification-code":"The phone auth credential was created with an empty SMS verification code.","missing-continue-uri":"A continue URL must be provided in the request.","missing-iframe-start":"An internal error has occurred.","missing-ios-bundle-id":"An iOS Bundle ID must be provided if an App Store ID is provided.","missing-phone-number":"To send verification codes, provide a phone number for the recipient.",
3625
+ "missing-verification-id":"The phone auth credential was created with an empty verification ID.","app-deleted":"This instance of FirebaseApp has been deleted.","account-exists-with-different-credential":"An account already exists with the same email address but different sign-in credentials. Sign in using a provider associated with this email address.","network-request-failed":"A network error (such as timeout, interrupted connection or unreachable host) has occurred.","no-auth-event":"An internal error has occurred.",
3626
+ "no-such-provider":"User was not linked to an account with the given provider.","operation-not-allowed":"The given sign-in provider is disabled for this Firebase project. Enable it in the Firebase console, under the sign-in method tab of the Auth section.","operation-not-supported-in-this-environment":'This operation is not supported in the environment this application is running on. "location.protocol" must be http, https or chrome-extension and web storage must be enabled.',"popup-blocked":"Unable to establish a connection with the popup. It may have been blocked by the browser.",
3627
+ "popup-closed-by-user":"The popup has been closed by the user before finalizing the operation.","provider-already-linked":"User can only be linked to one identity for the given provider.","quota-exceeded":"The SMS quota for this project has been exceeded.","redirect-cancelled-by-user":"The redirect operation has been cancelled by the user before finalizing.","redirect-operation-pending":"A redirect sign-in operation is already pending.",timeout:"The operation has timed out.","user-token-expired":"The user's credential is no longer valid. The user must sign in again.",
3628
+ "too-many-requests":"We have blocked all requests from this device due to unusual activity. Try again later.","unauthorized-continue-uri":"The domain of the continue URL is not whitelisted. Please whitelist the domain in the Firebase console.","unsupported-persistence-type":"The current environment does not support the specified persistence type.","user-cancelled":"User did not grant your application the permissions it requested.","user-not-found":"There is no user record corresponding to this identifier. The user may have been deleted.",
3629
+ "user-disabled":"The user account has been disabled by an administrator.","user-mismatch":"The supplied credentials do not correspond to the previously signed in user.","user-signed-out":"","weak-password":"The password must be 6 characters long or more.","web-storage-unsupported":"This browser is not supported or 3rd party cookies and data may be disabled."};var hg=function(a,b,c,d,e){this.la=a;this.U=b||null;this.Ab=c||null;this.Qd=d||null;this.$=e||null;if(this.Ab||this.$){if(this.Ab&&this.$)throw new O("invalid-auth-event");if(this.Ab&&!this.Qd)throw new O("invalid-auth-event");}else throw new O("invalid-auth-event");};hg.prototype.sc=function(){return this.Qd};hg.prototype.getError=function(){return this.$};hg.prototype.I=function(){return{type:this.la,eventId:this.U,urlResponse:this.Ab,sessionId:this.Qd,error:this.$&&this.$.I()}};
3630
+ var ig=function(a){a=a||{};return a.type?new hg(a.type,a.eventId,a.urlResponse,a.sessionId,a.error&&gg(a.error)):null};var jg=function(a){var b="unauthorized-domain",c=void 0,d=gf(a);a=d.oa;d=d.pa;"chrome-extension"==d?c=oa("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.",a):"http"==d||"https"==d?c=oa("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.",a):b=
3631
+ "operation-not-supported-in-this-environment";O.call(this,b,c)};t(jg,O);var kg=function(a){this.Pf=a.sub;na();this.Ib=a.email||null;this.Zf=a.provider_id||null;this.ef=!!a.is_anonymous||"anonymous"==this.Zf};kg.prototype.getEmail=function(){return this.Ib};kg.prototype.isAnonymous=function(){return this.ef};var lg=function(a,b){return a.then(function(a){if(a.idToken){a:{var c=a.idToken.split(".");if(3==c.length){c=c[1];for(var e=(4-c.length%4)%4,f=0;f<e;f++)c+=".";try{var g=JSON.parse(Ib(c));if(g.sub&&g.iss&&g.aud&&g.exp){var l=new kg(g);break a}}catch(n){}}l=null}if(!l||b!=l.Pf)throw new O("user-mismatch");return a}throw new O("user-mismatch");}).f(function(a){throw a&&a.code&&"auth/user-not-found"==a.code?new O("user-mismatch"):a;})},mg=function(a,b){if(b.idToken||b.accessToken)b.idToken&&N(this,"idToken",
3632
+ b.idToken),b.accessToken&&N(this,"accessToken",b.accessToken);else if(b.oauthToken&&b.oauthTokenSecret)N(this,"accessToken",b.oauthToken),N(this,"secret",b.oauthTokenSecret);else throw new O("internal-error","failed to construct a credential");N(this,"providerId",a)};mg.prototype.Kb=function(a){return ng(a,og(this))};mg.prototype.Ec=function(a,b){var c=og(this);c.idToken=b;return pg(a,c)};mg.prototype.Ad=function(a,b){var c=og(this);return lg(qg(a,c),b)};
3633
+ var og=function(a){var b={};a.idToken&&(b.id_token=a.idToken);a.accessToken&&(b.access_token=a.accessToken);a.secret&&(b.oauth_token_secret=a.secret);b.providerId=a.providerId;return{postBody:mf(b).toString(),requestUri:"http://localhost"}};mg.prototype.I=function(){var a={providerId:this.providerId};this.idToken&&(a.oauthIdToken=this.idToken);this.accessToken&&(a.oauthAccessToken=this.accessToken);this.secret&&(a.oauthTokenSecret=this.secret);return a};
3634
+ var rg=function(a,b){this.bg=b||[];Xf(this,{providerId:a,isOAuthProvider:!0});this.ie={};this.yd=(eg(a)||{}).Cc||null;this.kd=null};rg.prototype.setCustomParameters=function(a){this.ie=lb(a);return this};var P=function(a){rg.call(this,a,cg);this.Od=[]};t(P,rg);P.prototype.addScope=function(a){Wa(this.Od,a)||this.Od.push(a);return this};P.prototype.pe=function(){return ab(this.Od)};
3635
+ P.prototype.credential=function(a,b){if(!a&&!b)throw new O("argument-error","credential failed: must provide the ID token and/or the access token.");return new mg(this.providerId,{idToken:a||null,accessToken:b||null})};var sg=function(){P.call(this,"facebook.com")};t(sg,P);N(sg,"PROVIDER_ID","facebook.com");
3636
+ var tg=function(a){if(!a)throw new O("argument-error","credential failed: expected 1 argument (the OAuth access token).");var b=a;q(a)&&(b=a.accessToken);return(new sg).credential(null,b)},ug=function(){P.call(this,"github.com")};t(ug,P);N(ug,"PROVIDER_ID","github.com");var vg=function(a){if(!a)throw new O("argument-error","credential failed: expected 1 argument (the OAuth access token).");var b=a;q(a)&&(b=a.accessToken);return(new ug).credential(null,b)},wg=function(){P.call(this,"google.com");this.addScope("profile")};
3637
+ t(wg,P);N(wg,"PROVIDER_ID","google.com");var xg=function(a,b){var c=a;q(a)&&(c=a.idToken,b=a.accessToken);return(new wg).credential(c,b)},yg=function(){rg.call(this,"twitter.com",bg)};t(yg,rg);N(yg,"PROVIDER_ID","twitter.com");
3638
+ var zg=function(a,b){var c=a;q(c)||(c={oauthToken:a,oauthTokenSecret:b});if(!c.oauthToken||!c.oauthTokenSecret)throw new O("argument-error","credential failed: expected 2 arguments (the OAuth access token and secret).");return new mg("twitter.com",c)},Ag=function(a,b){this.Ib=a;this.Fd=b;N(this,"providerId","password")};Ag.prototype.Kb=function(a){return Q(a,Bg,{email:this.Ib,password:this.Fd})};Ag.prototype.Ec=function(a,b){return Q(a,Cg,{idToken:b,email:this.Ib,password:this.Fd})};
3639
+ Ag.prototype.Ad=function(a,b){return lg(this.Kb(a),b)};Ag.prototype.I=function(){return{email:this.Ib,password:this.Fd}};var Dg=function(){Xf(this,{providerId:"password",isOAuthProvider:!1})};Xf(Dg,{PROVIDER_ID:"password"});var Eg=function(a){if(!(a.verificationId&&a.Yc||a.fc&&a.phoneNumber))throw new O("internal-error");this.P=a;N(this,"providerId","phone")};Eg.prototype.Kb=function(a){return a.verifyPhoneNumber(Fg(this))};Eg.prototype.Ec=function(a,b){var c=Fg(this);c.idToken=b;return Q(a,Gg,c)};
3640
+ Eg.prototype.Ad=function(a,b){var c=Fg(this);c.operation="REAUTH";a=Q(a,Hg,c);return lg(a,b)};Eg.prototype.I=function(){var a={providerId:"phone"};this.P.verificationId&&(a.verificationId=this.P.verificationId);this.P.Yc&&(a.verificationCode=this.P.Yc);this.P.fc&&(a.temporaryProof=this.P.fc);this.P.phoneNumber&&(a.phoneNumber=this.P.phoneNumber);return a};
3641
+ var Fg=function(a){return a.P.fc&&a.P.phoneNumber?{temporaryProof:a.P.fc,phoneNumber:a.P.phoneNumber}:{sessionInfo:a.P.verificationId,code:a.P.Yc}},Ig=function(a){try{this.gf=a||firebase.auth()}catch(b){throw new O("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().");}Xf(this,{providerId:"phone",isOAuthProvider:!1})};
3642
+ Ig.prototype.verifyPhoneNumber=function(a,b){var c=this.gf.g;return E(b.verify()).then(function(d){if(!m(d))throw new O("argument-error","An implementation of firebase.auth.ApplicationVerifier.prototype.verify() must return a firebase.Promise that resolves with a string.");switch(b.type){case "recaptcha":return Q(c,Jg,{phoneNumber:a,recaptchaToken:d});default:throw new O("argument-error",'Only firebase.auth.ApplicationVerifiers with type="recaptcha" are currently supported.');}})};
3643
+ var Kg=function(a,b){if(!a)throw new O("missing-verification-id");if(!b)throw new O("missing-verification-code");return new Eg({verificationId:a,Yc:b})};Xf(Ig,{PROVIDER_ID:"phone"});
3644
+ var Lg=function(a){if(a.temporaryProof&&a.phoneNumber)return new Eg({fc:a.temporaryProof,phoneNumber:a.phoneNumber});var b=a&&a.providerId;if(!b||"password"===b)return null;var c=a&&a.oauthAccessToken,d=a&&a.oauthTokenSecret;a=a&&a.oauthIdToken;try{switch(b){case "google.com":return xg(a,c);case "facebook.com":return tg(c);case "github.com":return vg(c);case "twitter.com":return zg(c,d);default:return(new P(b)).credential(a,c)}}catch(e){return null}},Mg=function(a){if(!a.isOAuthProvider)throw new O("invalid-oauth-provider");
3645
+ };var Ng=function(a,b,c){O.call(this,a,c);a=b||{};a.email&&N(this,"email",a.email);a.phoneNumber&&N(this,"phoneNumber",a.phoneNumber);a.credential&&N(this,"credential",a.credential)};t(Ng,O);Ng.prototype.I=function(){var a={code:this.code,message:this.message};this.email&&(a.email=this.email);this.phoneNumber&&(a.phoneNumber=this.phoneNumber);var b=this.credential&&this.credential.I();b&&nb(a,b);return a};Ng.prototype.toJSON=function(){return this.I()};
3646
+ var Og=function(a){if(a.code){var b=a.code||"";0==b.indexOf("auth/")&&(b=b.substring(5));var c={credential:Lg(a)};if(a.email)c.email=a.email;else if(a.phoneNumber)c.phoneNumber=a.phoneNumber;else return new O(b,a.message||void 0);return new Ng(b,c,a.message)}return null};var Pg=function(a){this.vg=a};t(Pg,Kc);Pg.prototype.pc=function(){return new this.vg};Pg.prototype.wd=function(){return{}};
3647
+ var R=function(a,b,c){var d="Node"==Df();d=k.XMLHttpRequest||d&&firebase.INTERNAL.node&&firebase.INTERNAL.node.XMLHttpRequest;if(!d)throw new O("internal-error","The XMLHttpRequest compatibility library was not found.");this.o=a;a=b||{};this.hg=a.secureTokenEndpoint||"https://securetoken.googleapis.com/v1/token";this.ig=a.secureTokenTimeout||Qg;this.Le=lb(a.secureTokenHeaders||Rg);this.sf=a.firebaseEndpoint||"https://www.googleapis.com/identitytoolkit/v3/relyingparty/";this.tf=a.firebaseTimeout||
3648
+ Sg;this.qc=lb(a.firebaseHeaders||Tg);c&&(this.qc["X-Client-Version"]=c,this.Le["X-Client-Version"]=c);this.jf=new Pc;this.ug=new Pg(d)},Ug,Qg=new Rf(3E4,6E4),Rg={"Content-Type":"application/x-www-form-urlencoded"},Sg=new Rf(3E4,6E4),Tg={"Content-Type":"application/json"},Vg=function(a,b){b?a.qc.firebase_locale=b:delete a.qc.firebase_locale},Xg=function(a,b,c,d,e,f,g){Qf()?(sf()?a=r(a.kg,a):(Ug||(Ug=new D(function(a,b){Wg(a,b)})),a=r(a.jg,a)),a(b,c,d,e,f,g)):c&&c(null)};
3649
+ R.prototype.kg=function(a,b,c,d,e,f){var g="Node"==Df(),l=Ef()?g?new I(this.ug):new I:new I(this.jf);if(f){l.zb=Math.max(0,f);var n=setTimeout(function(){l.dispatchEvent("timeout")},f)}l.listen("complete",function(){n&&clearTimeout(n);var a=null;try{a=JSON.parse(Re(this))||null}catch(wb){a=null}b&&b(a)});rc(l,"ready",function(){n&&clearTimeout(n);this.Ka||(this.Ka=!0,this.ib())});rc(l,"timeout",function(){n&&clearTimeout(n);this.Ka||(this.Ka=!0,this.ib());b&&b(null)});l.send(a,c,d,e)};
3650
+ var Yg=Ia("https://apis.google.com/js/client.js?onload=%{onload}"),Zg="__fcb"+Math.floor(1E6*Math.random()).toString(),Wg=function(a,b){if(((window.gapi||{}).client||{}).request)a();else{k[Zg]=function(){((window.gapi||{}).client||{}).request?a():b(Error("CORS_UNSUPPORTED"))};var c=Na(Yg,{onload:Zg});Wd(de(c),function(){b(Error("CORS_UNSUPPORTED"))})}};
3651
+ R.prototype.jg=function(a,b,c,d,e){var f=this;Ug.then(function(){window.gapi.client.setApiKey(f.o);var g=window.gapi.auth.getToken();window.gapi.auth.setToken(null);window.gapi.client.request({path:a,method:c,body:d,headers:e,authType:"none",callback:function(a){window.gapi.auth.setToken(g);b&&b(a)}})}).f(function(a){b&&b({error:{message:a&&a.message||"CORS_UNSUPPORTED"}})})};
3652
+ var ah=function(a,b){return new D(function(c,d){"refresh_token"==b.grant_type&&b.refresh_token||"authorization_code"==b.grant_type&&b.code?Xg(a,a.hg+"?key="+encodeURIComponent(a.o),function(a){a?a.error?d($g(a)):a.access_token&&a.refresh_token?c(a):d(new O("internal-error")):d(new O("network-request-failed"))},"POST",mf(b).toString(),a.Le,a.ig.get()):d(new O("internal-error"))})},bh=function(a,b,c,d,e,f){var g=gf(a.sf+b);K(g,"key",a.o);f&&K(g,"cb",na().toString());var l="GET"==c;if(l)for(var n in d)d.hasOwnProperty(n)&&
3653
+ K(g,n,d[n]);return new D(function(b,f){Xg(a,g.toString(),function(a){a?a.error?f($g(a,e||{})):b(a):f(new O("network-request-failed"))},c,l?void 0:Gc(Mf(d)),a.qc,a.tf.get())})},ch=function(a){if(!xc.test(a.email))throw new O("invalid-email");},dh=function(a){"email"in a&&ch(a)},fh=function(a,b){return Q(a,eh,{identifier:b,continueUri:If()?of():"http://localhost"}).then(function(a){return a.allProviders||[]})},hh=function(a){return Q(a,gh,{}).then(function(a){return a.authorizedDomains||[]})},ih=function(a){if(!a.idToken)throw new O("internal-error");
3654
+ },jh=function(a){if(a.phoneNumber||a.temporaryProof){if(!a.phoneNumber||!a.temporaryProof)throw new O("internal-error");}else{if(!a.sessionInfo)throw new O("missing-verification-id");if(!a.code)throw new O("missing-verification-code");}};R.prototype.signInAnonymously=function(){return Q(this,kh,{})};R.prototype.updateEmail=function(a,b){return Q(this,lh,{idToken:a,email:b})};R.prototype.updatePassword=function(a,b){return Q(this,Cg,{idToken:a,password:b})};var mh={displayName:"DISPLAY_NAME",photoUrl:"PHOTO_URL"};
3655
+ R.prototype.updateProfile=function(a,b){var c={idToken:a},d=[];fb(mh,function(a,f){var e=b[f];null===e?d.push(a):f in b&&(c[f]=e)});d.length&&(c.deleteAttribute=d);return Q(this,lh,c)};R.prototype.sendPasswordResetEmail=function(a,b){a={requestType:"PASSWORD_RESET",email:a};nb(a,b);return Q(this,nh,a)};R.prototype.sendEmailVerification=function(a,b){a={requestType:"VERIFY_EMAIL",idToken:a};nb(a,b);return Q(this,oh,a)};R.prototype.verifyPhoneNumber=function(a){return Q(this,ph,a)};
3656
+ var rh=function(a,b,c){return Q(a,qh,{idToken:b,deleteProvider:c})},sh=function(a){if(!a.requestUri||!a.sessionId&&!a.postBody)throw new O("internal-error");},th=function(a){var b=null;a.needConfirmation?(a.code="account-exists-with-different-credential",b=Og(a)):"FEDERATED_USER_ID_ALREADY_LINKED"==a.errorMessage?(a.code="credential-already-in-use",b=Og(a)):"EMAIL_EXISTS"==a.errorMessage&&(a.code="email-already-in-use",b=Og(a));if(b)throw b;if(!a.idToken)throw new O("internal-error");},ng=function(a,
3657
+ b){b.returnIdpCredential=!0;return Q(a,uh,b)},pg=function(a,b){b.returnIdpCredential=!0;return Q(a,vh,b)},qg=function(a,b){b.returnIdpCredential=!0;b.autoCreate=!1;return Q(a,wh,b)},xh=function(a){if(!a.oobCode)throw new O("invalid-action-code");};R.prototype.confirmPasswordReset=function(a,b){return Q(this,yh,{oobCode:a,newPassword:b})};R.prototype.checkActionCode=function(a){return Q(this,zh,{oobCode:a})};R.prototype.applyActionCode=function(a){return Q(this,Ah,{oobCode:a})};
3658
+ var Ah={endpoint:"setAccountInfo",F:xh,$a:"email"},zh={endpoint:"resetPassword",F:xh,Y:function(a){if(!a.email||!a.requestType)throw new O("internal-error");}},Bh={endpoint:"signupNewUser",F:function(a){ch(a);if(!a.password)throw new O("weak-password");},Y:ih,za:!0},eh={endpoint:"createAuthUri"},Ch={endpoint:"deleteAccount",Ya:["idToken"]},qh={endpoint:"setAccountInfo",Ya:["idToken","deleteProvider"],F:function(a){if(!ia(a.deleteProvider))throw new O("internal-error");}},Dh={endpoint:"getAccountInfo"},
3659
+ oh={endpoint:"getOobConfirmationCode",Ya:["idToken","requestType"],F:function(a){if("VERIFY_EMAIL"!=a.requestType)throw new O("internal-error");},$a:"email"},nh={endpoint:"getOobConfirmationCode",Ya:["requestType"],F:function(a){if("PASSWORD_RESET"!=a.requestType)throw new O("internal-error");ch(a)},$a:"email"},gh={ae:!0,endpoint:"getProjectConfig",ue:"GET"},Eh={ae:!0,endpoint:"getRecaptchaParam",ue:"GET",Y:function(a){if(!a.recaptchaSiteKey)throw new O("internal-error");}},yh={endpoint:"resetPassword",
3660
+ F:xh,$a:"email"},Jg={endpoint:"sendVerificationCode",Ya:["phoneNumber","recaptchaToken"],$a:"sessionInfo"},lh={endpoint:"setAccountInfo",Ya:["idToken"],F:dh,za:!0},Cg={endpoint:"setAccountInfo",Ya:["idToken"],F:function(a){dh(a);if(!a.password)throw new O("weak-password");},Y:ih,za:!0},kh={endpoint:"signupNewUser",Y:ih,za:!0},uh={endpoint:"verifyAssertion",F:sh,Y:th,za:!0},wh={endpoint:"verifyAssertion",F:sh,Y:function(a){if(a.errorMessage&&"USER_NOT_FOUND"==a.errorMessage)throw new O("user-not-found");
3661
+ if(!a.idToken)throw new O("internal-error");},za:!0},vh={endpoint:"verifyAssertion",F:function(a){sh(a);if(!a.idToken)throw new O("internal-error");},Y:th,za:!0},Fh={endpoint:"verifyCustomToken",F:function(a){if(!a.token)throw new O("invalid-custom-token");},Y:ih,za:!0},Bg={endpoint:"verifyPassword",F:function(a){ch(a);if(!a.password)throw new O("wrong-password");},Y:ih,za:!0},ph={endpoint:"verifyPhoneNumber",F:jh,Y:ih},Gg={endpoint:"verifyPhoneNumber",F:function(a){if(!a.idToken)throw new O("internal-error");
3662
+ jh(a)},Y:function(a){if(a.temporaryProof)throw a.code="credential-already-in-use",Og(a);ih(a)}},Hg={mf:{USER_NOT_FOUND:"user-not-found"},endpoint:"verifyPhoneNumber",F:jh,Y:ih},Q=function(a,b,c){if(!$f(c,b.Ya))return F(new O("internal-error"));var d=b.ue||"POST",e;return E(c).then(b.F).then(function(){b.za&&(c.returnSecureToken=!0);return bh(a,b.endpoint,d,c,b.mf,b.ae||!1)}).then(function(a){return e=a}).then(b.Y).then(function(){if(!b.$a)return e;if(!(b.$a in e))throw new O("internal-error");return e[b.$a]})},
3663
+ $g=function(a,b){var c=(a.error&&a.error.errors&&a.error.errors[0]||{}).reason||"";var d={keyInvalid:"invalid-api-key",ipRefererBlocked:"app-not-authorized"};if(c=d[c]?new O(d[c]):null)return c;c=a.error&&a.error.message||"";d={INVALID_CUSTOM_TOKEN:"invalid-custom-token",CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVALID_IDENTIFIER:"invalid-email",MISSING_CONTINUE_URI:"internal-error",INVALID_EMAIL:"invalid-email",INVALID_PASSWORD:"wrong-password",USER_DISABLED:"user-disabled",
3664
+ MISSING_PASSWORD:"internal-error",EMAIL_EXISTS:"email-already-in-use",PASSWORD_LOGIN_DISABLED:"operation-not-allowed",INVALID_IDP_RESPONSE:"invalid-credential",FEDERATED_USER_ID_ALREADY_LINKED:"credential-already-in-use",INVALID_MESSAGE_PAYLOAD:"invalid-message-payload",INVALID_RECIPIENT_EMAIL:"invalid-recipient-email",INVALID_SENDER:"invalid-sender",EMAIL_NOT_FOUND:"user-not-found",EXPIRED_OOB_CODE:"expired-action-code",INVALID_OOB_CODE:"invalid-action-code",MISSING_OOB_CODE:"internal-error",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"requires-recent-login",
3665
+ INVALID_ID_TOKEN:"invalid-user-token",TOKEN_EXPIRED:"user-token-expired",USER_NOT_FOUND:"user-token-expired",CORS_UNSUPPORTED:"cors-unsupported",DYNAMIC_LINK_NOT_ACTIVATED:"dynamic-link-not-activated",INVALID_APP_ID:"invalid-app-id",TOO_MANY_ATTEMPTS_TRY_LATER:"too-many-requests",WEAK_PASSWORD:"weak-password",OPERATION_NOT_ALLOWED:"operation-not-allowed",USER_CANCELLED:"user-cancelled",CAPTCHA_CHECK_FAILED:"captcha-check-failed",INVALID_APP_CREDENTIAL:"invalid-app-credential",INVALID_CODE:"invalid-verification-code",
3666
+ INVALID_PHONE_NUMBER:"invalid-phone-number",INVALID_SESSION_INFO:"invalid-verification-id",INVALID_TEMPORARY_PROOF:"invalid-credential",MISSING_APP_CREDENTIAL:"missing-app-credential",MISSING_CODE:"missing-verification-code",MISSING_PHONE_NUMBER:"missing-phone-number",MISSING_SESSION_INFO:"missing-verification-id",QUOTA_EXCEEDED:"quota-exceeded",SESSION_EXPIRED:"code-expired",INVALID_CONTINUE_URI:"invalid-continue-uri",MISSING_ANDROID_PACKAGE_NAME:"missing-android-pkg-name",MISSING_IOS_BUNDLE_ID:"missing-ios-bundle-id",
3667
+ UNAUTHORIZED_DOMAIN:"unauthorized-continue-uri"};nb(d,b||{});b=(b=c.match(/^[^\s]+\s*:\s*(.*)$/))&&1<b.length?b[1]:void 0;for(var e in d)if(0===c.indexOf(e))return new O(d[e],b);!b&&a&&(b=Lf(a));return new O("internal-error",b)};var Gh=function(a){this.D=a};Gh.prototype.value=function(){return this.D};Gh.prototype.Ne=function(a){this.D.style=a;return this};Gh.prototype.getStyle=function(){return this.D.style};var Hh=function(a){this.D=a||{}};h=Hh.prototype;h.value=function(){return this.D};h.getUrl=function(){return this.D.url};h.Ne=function(a){this.D.style=a;return this};h.getStyle=function(){return this.D.style};h.getId=function(){return this.D.id};h.getContext=function(){return this.D.context};var Jh=function(a){this.sg=a;this.xc=null;this.Cd=Ih(this)},Kh=function(a){var b=new Hh;b.D.where=document.body;b.D.url=a.sg;b.D.messageHandlersFilter=M("gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER");b.D.attributes=b.D.attributes||{};(new Gh(b.D.attributes)).Ne({position:"absolute",top:"-100px",width:"1px",height:"1px"});b.D.dontclear=!0;return b},Ih=function(a){return Lh().then(function(){return new D(function(b,c){M("gapi.iframes.getContext")().open(Kh(a).value(),function(d){a.xc=d;a.xc.restyle({setHideOnLeave:!1});
3668
+ var e=setTimeout(function(){c(Error("Network Error"))},Mh.get()),f=function(){clearTimeout(e);b()};d.ping(f).then(f,function(){c(Error("Network Error"))})})})})};Jh.prototype.sendMessage=function(a){var b=this;return this.Cd.then(function(){return new D(function(c){b.xc.send(a.type,a,c,M("gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER"))})})};
3669
+ var Nh=function(a,b){a.Cd.then(function(){a.xc.register("authEvent",b,M("gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER"))})},Oh=Ia("https://apis.google.com/js/api.js?onload=%{onload}"),Ph=new Rf(3E4,6E4),Mh=new Rf(5E3,15E3),Qh=null,Lh=function(){return Qh?Qh:Qh=(new D(function(a,b){if(Qf()){var c=function(){Pf();M("gapi.load")("gapi.iframes",{callback:a,ontimeout:function(){Pf();b(Error("Network Error"))},timeout:Ph.get()})};if(M("gapi.iframes.Iframe"))a();else if(M("gapi.load"))c();else{var d="__iframefcb"+
3670
+ Math.floor(1E6*Math.random()).toString();k[d]=function(){M("gapi.load")?c():b(Error("Network Error"))};d=Na(Oh,{onload:d});E(de(d)).f(function(){b(Error("Network Error"))})}}else b(Error("Network Error"))})).f(function(a){Qh=null;throw a;})};var Rh=function(a,b,c){this.C=a;this.o=b;this.u=c;this.bb=null;this.ic=hf(this.C,"/__/auth/iframe");K(this.ic,"apiKey",this.o);K(this.ic,"appName",this.u)};Rh.prototype.Td=function(a){this.bb=a;return this};Rh.prototype.toString=function(){this.bb?K(this.ic,"v",this.bb):this.ic.removeParameter("v");return this.ic.toString()};var Sh=function(a,b,c,d,e){this.C=a;this.o=b;this.u=c;this.ff=d;this.bb=this.U=this.Md=null;this.tb=e};Sh.prototype.Td=function(a){this.bb=a;return this};
3671
+ Sh.prototype.toString=function(){var a=hf(this.C,"/__/auth/handler");K(a,"apiKey",this.o);K(a,"appName",this.u);K(a,"authType",this.ff);if(this.tb.isOAuthProvider){var b=this.tb;try{var c=firebase.app(this.u).auth().ha}catch(l){c=null}b.kd=c;K(a,"providerId",this.tb.providerId);b=this.tb;c=Mf(b.ie);for(var d in c)c[d]=c[d].toString();d=b.bg;c=lb(c);for(var e=0;e<d.length;e++){var f=d[e];f in c&&delete c[f]}b.yd&&b.kd&&!c[b.yd]&&(c[b.yd]=b.kd);jb(c)||K(a,"customParameters",Lf(c))}"function"===typeof this.tb.pe&&
3672
+ (b=this.tb.pe(),b.length&&K(a,"scopes",b.join(",")));this.Md?K(a,"redirectUrl",this.Md):a.removeParameter("redirectUrl");this.U?K(a,"eventId",this.U):a.removeParameter("eventId");this.bb?K(a,"v",this.bb):a.removeParameter("v");if(this.kc)for(var g in this.kc)this.kc.hasOwnProperty(g)&&!ff(a,g)&&K(a,g,this.kc[g]);return a.toString()};
3673
+ var Th=function(a,b,c,d){this.C=a;this.o=b;this.u=c;this.vf=(this.Ja=d||null)?Ff(this.Ja):null;d=this.Ja;this.Ef=(new Rh(a,b,c)).Td(d).toString();this.sa=[];this.g=new R(b,null,this.vf);this.zc=this.va=null},Uh=function(a){var b=of();return hh(a).then(function(a){a:{var c=gf(b),e=c.pa;c=c.oa;for(var f=0;f<a.length;f++){var g=a[f];var l=c;var n=e;0==g.indexOf("chrome-extension://")?l=gf(g).oa==l&&"chrome-extension"==n:"http"!=n&&"https"!=n?l=!1:xf.test(g)?l=l==g:(g=g.split(".").join("\\."),l=(new RegExp("^(.+\\."+
3674
+ g+"|"+g+")$","i")).test(l));if(l){a=!0;break a}}a=!1}if(!a)throw new jg(of());})};h=Th.prototype;h.Ob=function(){if(this.zc)return this.zc;var a=this;return this.zc=yf().then(function(){a.wc=new Jh(a.Ef);Vh(a)})};h.cc=function(a,b,c){var d=new O("popup-closed-by-user"),e=new O("web-storage-unsupported"),f=this,g=!1;return this.Pa().then(function(){Wh(f).then(function(c){c||(a&&uf(a),b(e),g=!0)})}).f(function(){}).then(function(){if(!g)return wf(a)}).then(function(){if(!g)return Be(c).then(function(){b(d)})})};
3675
+ h.Oe=function(){var a=L();return!Kf(a)&&!Of(a)};h.se=function(){return!1};h.Wb=function(a,b,c,d,e,f,g){if(!a)return F(new O("popup-blocked"));if(g&&!Kf())return this.Pa().f(function(b){uf(a);e(b)}),d(),E();this.va||(this.va=Uh(this.g));var l=this;return this.va.then(function(){var b=l.Pa().f(function(b){uf(a);e(b);throw b;});d();return b}).then(function(){Mg(c);if(!g){var d=Xh(l.C,l.o,l.u,b,c,null,f,l.Ja);pf(d,a)}}).f(function(a){"auth/network-request-failed"==a.code&&(l.va=null);throw a;})};
3676
+ h.Xb=function(a,b,c){this.va||(this.va=Uh(this.g));var d=this;return this.va.then(function(){Mg(b);var e=Xh(d.C,d.o,d.u,a,b,of(),c,d.Ja);pf(e)}).f(function(a){"auth/network-request-failed"==a.code&&(d.va=null);throw a;})};h.Pa=function(){var a=this;return this.Ob().then(function(){return a.wc.Cd}).f(function(){a.va=null;throw new O("network-request-failed");})};h.Se=function(){return!0};
3677
+ var Xh=function(a,b,c,d,e,f,g,l,n){a=new Sh(a,b,c,d,e);a.Md=f;a.U=g;f=a.Td(l);f.kc=lb(n||null);return f.toString()},Vh=function(a){if(!a.wc)throw Error("IfcHandler must be initialized!");Nh(a.wc,function(b){var c={};if(b&&b.authEvent){var d=!1;b=ig(b.authEvent);for(c=0;c<a.sa.length;c++)d=a.sa[c](b)||d;c={};c.status=d?"ACK":"ERROR";return E(c)}c.status="ERROR";return E(c)})},Wh=function(a){var b={type:"webStorageSupport"};return a.Ob().then(function(){return a.wc.sendMessage(b)}).then(function(a){if(a&&
3678
+ a.length&&"undefined"!==typeof a[0].webStorageSupport)return a[0].webStorageSupport;throw Error();})};Th.prototype.fb=function(a){this.sa.push(a)};Th.prototype.$b=function(a){Za(this.sa,function(b){return b==a})};var Yh=function(a,b,c){N(this,"type","recaptcha");this.Zc=this.Eb=null;this.Gb=!1;this.ge=a;this.Ca=b||{theme:"light",type:"image"};this.K=[];if(this.Ca.sitekey)throw new O("argument-error","sitekey should not be provided for reCAPTCHA as one is automatically provisioned for the current project.");this.Ac="invisible"===this.Ca.size;if(!ld(a)||!this.Ac&&ld(a).hasChildNodes())throw new O("argument-error","reCAPTCHA container is either not found or already contains inner elements!");try{this.i=c||firebase.app()}catch(g){throw new O("argument-error",
3679
+ "No firebase.app.App instance is currently initialized.");}if(this.i.options&&this.i.options.apiKey)a=firebase.SDK_VERSION?Ff(firebase.SDK_VERSION):null,this.g=new R(this.i.options&&this.i.options.apiKey,null,a);else throw new O("invalid-api-key");var d=this;this.Uc=[];var e=this.Ca.callback;this.Ca.callback=function(a){d.Hb(a);if("function"===typeof e)e(a);else if("string"===typeof e){var b=M(e,k);"function"===typeof b&&b(a)}};var f=this.Ca["expired-callback"];this.Ca["expired-callback"]=function(){d.Hb(null);
3680
+ if("function"===typeof f)f();else if("string"===typeof f){var a=M(f,k);"function"===typeof a&&a()}}};Yh.prototype.Hb=function(a){for(var b=0;b<this.Uc.length;b++)try{this.Uc[b](a)}catch(c){}};var Zh=function(a,b){Za(a.Uc,function(a){return a==b})};Yh.prototype.c=function(a){var b=this;this.K.push(a);Ed(a,function(){Ya(b.K,a)});return a};
3681
+ Yh.prototype.Pb=function(){var a=this;return this.Eb?this.Eb:this.Eb=this.c(E().then(function(){if(If())return yf();throw new O("operation-not-supported-in-this-environment","RecaptchaVerifier is only supported in a browser HTTP/HTTPS environment.");}).then(function(){try{var b=a.i.auth().ha}catch(c){b=null}return $h(ai(),b)}).then(function(){return Q(a.g,Eh,{})}).then(function(b){a.Ca.sitekey=b.recaptchaSiteKey}).f(function(b){a.Eb=null;throw b;}))};
3682
+ Yh.prototype.render=function(){bi(this);var a=this;return this.c(this.Pb().then(function(){if(null===a.Zc){var b=a.ge;if(!a.Ac){var c=ld(b);b=pd("DIV");c.appendChild(b)}a.Zc=grecaptcha.render(b,a.Ca)}return a.Zc}))};Yh.prototype.verify=function(){bi(this);var a=this;return this.c(this.render().then(function(b){return new D(function(c){var d=grecaptcha.getResponse(b);if(d)c(d);else{var e=function(b){b&&(Zh(a,e),c(b))};a.Uc.push(e);a.Ac&&grecaptcha.execute(a.Zc)}})}))};
3683
+ var bi=function(a){if(a.Gb)throw new O("internal-error","RecaptchaVerifier instance has been destroyed.");};Yh.prototype.clear=function(){bi(this);this.Gb=!0;ai().hd--;for(var a=0;a<this.K.length;a++)this.K[a].cancel("RecaptchaVerifier instance has been destroyed.");if(!this.Ac){a=ld(this.ge);for(var b;b=a.firstChild;)a.removeChild(b)}};
3684
+ var ci=Ia("https://www.google.com/recaptcha/api.js?onload=%{onload}&render=explicit&hl=%{hl}"),di=function(){this.hd=k.grecaptcha?Infinity:0;this.te=null;this.fd="__rcb"+Math.floor(1E6*Math.random()).toString()},$h=function(a,b){return new D(function(c,d){if(Qf())if(!k.grecaptcha||b!==a.te&&!a.hd){k[a.fd]=function(){if(k.grecaptcha){a.te=b;var e=k.grecaptcha.render;k.grecaptcha.render=function(b,c){b=e(b,c);a.hd++;return b};c()}else d(new O("internal-error"));delete k[a.fd]};var e=Na(ci,{onload:a.fd,
3685
+ hl:b||""});E(de(e)).f(function(){d(new O("internal-error","Unable to load external reCAPTCHA dependencies!"))})}else c();else d(new O("network-request-failed"))})},ei=null,ai=function(){ei||(ei=new di);return ei};var fi=function(a){this.G=a||firebase.INTERNAL.reactNative&&firebase.INTERNAL.reactNative.AsyncStorage;if(!this.G)throw new O("internal-error","The React Native compatibility library was not found.");};h=fi.prototype;h.get=function(a){return E(this.G.getItem(a)).then(function(a){return a&&Nf(a)})};h.set=function(a,b){return E(this.G.setItem(a,Lf(b)))};h.remove=function(a){return E(this.G.removeItem(a))};h.gb=function(){};h.Xa=function(){};var gi=function(){this.G={}};h=gi.prototype;h.get=function(a){return E(this.G[a])};h.set=function(a,b){this.G[a]=b;return E()};h.remove=function(a){delete this.G[a];return E()};h.gb=function(){};h.Xa=function(){};var ii=function(){if(!hi()){if("Node"==Df())throw new O("internal-error","The LocalStorage compatibility library was not found.");throw new O("web-storage-unsupported");}this.G=k.localStorage||firebase.INTERNAL.node.localStorage},hi=function(){var a="Node"==Df();a=k.localStorage||a&&firebase.INTERNAL.node&&firebase.INTERNAL.node.localStorage;if(!a)return!1;try{return a.setItem("__sak","1"),a.removeItem("__sak"),!0}catch(b){return!1}};h=ii.prototype;
3686
+ h.get=function(a){var b=this;return E().then(function(){var c=b.G.getItem(a);return Nf(c)})};h.set=function(a,b){var c=this;return E().then(function(){var d=Lf(b);null===d?c.remove(a):c.G.setItem(a,d)})};h.remove=function(a){var b=this;return E().then(function(){b.G.removeItem(a)})};h.gb=function(a){k.window&&kc(k.window,"storage",a)};h.Xa=function(a){k.window&&sc(k.window,"storage",a)};var ji=function(){this.G={}};h=ji.prototype;h.get=function(){return E(null)};h.set=function(){return E()};h.remove=function(){return E()};h.gb=function(){};h.Xa=function(){};var li=function(){if(!ki()){if("Node"==Df())throw new O("internal-error","The SessionStorage compatibility library was not found.");throw new O("web-storage-unsupported");}this.G=k.sessionStorage||firebase.INTERNAL.node.sessionStorage},ki=function(){var a="Node"==Df();a=k.sessionStorage||a&&firebase.INTERNAL.node&&firebase.INTERNAL.node.sessionStorage;if(!a)return!1;try{return a.setItem("__sak","1"),a.removeItem("__sak"),!0}catch(b){return!1}};h=li.prototype;
3687
+ h.get=function(a){var b=this;return E().then(function(){var c=b.G.getItem(a);return Nf(c)})};h.set=function(a,b){var c=this;return E().then(function(){var d=Lf(b);null===d?c.remove(a):c.G.setItem(a,d)})};h.remove=function(a){var b=this;return E().then(function(){b.G.removeItem(a)})};h.gb=function(){};h.Xa=function(){};var ni=function(a,b,c,d,e,f){if(!window.indexedDB)throw new O("web-storage-unsupported");this.nf=a;this.Bd=b;this.jd=c;this.We=d;this.cb=e;this.W={};this.dc=[];this.Sb=0;this.Gf=f||k.indexedDB},oi,pi=function(a){return new D(function(b,c){var d=a.Gf.open(a.nf,a.cb);d.onerror=function(a){c(Error(a.target.errorCode))};d.onupgradeneeded=function(b){b=b.target.result;try{b.createObjectStore(a.Bd,{keyPath:a.jd})}catch(f){c(f)}};d.onsuccess=function(a){b(a.target.result)}})},qi=function(a){a.xe||(a.xe=
3688
+ pi(a));return a.xe},ri=function(a,b){return b.objectStore(a.Bd)},si=function(a,b,c){return b.transaction([a.Bd],c?"readwrite":"readonly")},ti=function(a){return new D(function(b,c){a.onsuccess=function(a){a&&a.target?b(a.target.result):b()};a.onerror=function(a){c(Error(a.target.errorCode))}})};h=ni.prototype;
3689
+ h.set=function(a,b){var c=!1,d,e=this;return Ed(qi(this).then(function(b){d=b;b=ri(e,si(e,d,!0));return ti(b.get(a))}).then(function(f){var g=ri(e,si(e,d,!0));if(f)return f.value=b,ti(g.put(f));e.Sb++;c=!0;f={};f[e.jd]=a;f[e.We]=b;return ti(g.add(f))}).then(function(){e.W[a]=b}),function(){c&&e.Sb--})};h.get=function(a){var b=this;return qi(this).then(function(c){return ti(ri(b,si(b,c,!1)).get(a))}).then(function(a){return a&&a.value})};
3690
+ h.remove=function(a){var b=!1,c=this;return Ed(qi(this).then(function(d){b=!0;c.Sb++;return ti(ri(c,si(c,d,!0))["delete"](a))}).then(function(){delete c.W[a]}),function(){b&&c.Sb--})};
3691
+ h.og=function(){var a=this;return qi(this).then(function(b){var c=ri(a,si(a,b,!1));return c.getAll?ti(c.getAll()):new D(function(a,b){var d=[],e=c.openCursor();e.onsuccess=function(b){(b=b.target.result)?(d.push(b.value),b["continue"]()):a(d)};e.onerror=function(a){b(Error(a.target.errorCode))}})}).then(function(b){var c={},d=[];if(0==a.Sb){for(d=0;d<b.length;d++)c[b[d][a.jd]]=b[d][a.We];d=qf(a.W,c);a.W=c}return d})};h.gb=function(a){0==this.dc.length&&this.Vd();this.dc.push(a)};
3692
+ h.Xa=function(a){Za(this.dc,function(b){return b==a});0==this.dc.length&&this.Qc()};h.Vd=function(){var a=this;this.Qc();var b=function(){a.Hd=Be(800).then(r(a.og,a)).then(function(b){0<b.length&&x(a.dc,function(a){a(b)})}).then(b).f(function(a){"STOP_EVENT"!=a.message&&b()});return a.Hd};b()};h.Qc=function(){this.Hd&&this.Hd.cancel("STOP_EVENT")};var xi=function(){this.ke={Browser:ui,Node:vi,ReactNative:wi}[Df()]},yi,ui={B:ii,Xd:li},vi={B:ii,Xd:li},wi={B:fi,Xd:ji};var zi=function(a){this.vd(a)};
3693
+ zi.prototype.vd=function(a){var b=a.url;if("undefined"===typeof b)throw new O("missing-continue-uri");if("string"!==typeof b||"string"===typeof b&&!b.length)throw new O("invalid-continue-uri");this.hf=b;this.Zd=this.lc=null;this.ye=!1;var c=a.android;if(c&&"object"===typeof c){b=c.packageName;var d=c.installApp;c=c.minimumVersion;if("string"===typeof b&&b.length){this.lc=b;if("undefined"!==typeof d&&"boolean"!==typeof d)throw new O("argument-error","installApp property must be a boolean when specified.");this.ye=
3694
+ !!d;if("undefined"!==typeof c&&("string"!==typeof c||"string"===typeof c&&!c.length))throw new O("argument-error","minimumVersion property must be a non empty string when specified.");this.Zd=c||null}else{if("undefined"!==typeof b)throw new O("argument-error","packageName property must be a non empty string when specified.");if("undefined"!==typeof d||"undefined"!==typeof c)throw new O("missing-android-pkg-name");}}else if("undefined"!==typeof c)throw new O("argument-error","android property must be a non null object when specified.");
3695
+ this.sd=null;if((b=a.iOS)&&"object"===typeof b)if(b=b.bundleId,"string"===typeof b&&b.length)this.sd=b;else{if("undefined"!==typeof b)throw new O("argument-error","bundleId property must be a non empty string when specified.");}else if("undefined"!==typeof b)throw new O("argument-error","iOS property must be a non null object when specified.");a=a.handleCodeInApp;if("undefined"!==typeof a&&"boolean"!==typeof a)throw new O("argument-error","handleCodeInApp property must be a boolean when specified.");
3696
+ if((this.ee=!!a)&&!this.sd&&!this.lc)throw new O("argument-error","handleCodeInApp property can't be true when no mobile application is provided.");};var Ai=function(a){var b={};b.continueUrl=a.hf;b.canHandleCodeInApp=a.ee;if(b.androidPackageName=a.lc)b.androidMinimumVersion=a.Zd,b.androidInstallApp=a.ye;b.iOSBundleId=a.sd;for(var c in b)null===b[c]&&delete b[c];return b};var Bi=function(a,b){this.lf=b;N(this,"verificationId",a)};Bi.prototype.confirm=function(a){a=Kg(this.verificationId,a);return this.lf(a)};var Ci=function(a,b,c,d){return(new Ig(a)).verifyPhoneNumber(b,c).then(function(a){return new Bi(a,d)})};var Di=function(a){var b={},c=a.email,d=a.newEmail;a=a.requestType;if(!c||!a)throw Error("Invalid provider user info!");b.fromEmail=d||null;b.email=c;N(this,"operation",a);N(this,"data",ag(b))};var Ei=function(a,b,c,d,e,f){this.Wf=a;this.dg=b;this.yf=c;this.Fc=d;this.Yd=e;this.eg=!!f;this.qb=null;this.Qa=this.Fc;if(this.Yd<this.Fc)throw Error("Proactive refresh lower bound greater than upper bound!");};Ei.prototype.start=function(){this.Qa=this.Fc;Fi(this,!0)};
3697
+ var Gi=function(a,b){if(b)return a.Qa=a.Fc,a.yf();b=a.Qa;a.Qa*=2;a.Qa>a.Yd&&(a.Qa=a.Yd);return b},Fi=function(a,b){a.stop();a.qb=Be(Gi(a,b)).then(function(){return a.eg?E():Tf()}).then(function(){return a.Wf()}).then(function(){Fi(a,!0)}).f(function(b){a.dg(b)&&Fi(a,!1)})};Ei.prototype.stop=function(){this.qb&&(this.qb.cancel(),this.qb=null)};var Mi=function(a){var b={};b["facebook.com"]=Hi;b["google.com"]=Ii;b["github.com"]=Ji;b["twitter.com"]=Ki;var c=a&&a.providerId;return c?b[c]?new b[c](a):new Li(a):null},Li=function(a){var b=Nf(a.rawUserInfo||"{}");a=a.providerId;if(!a)throw Error("Invalid additional user info!");N(this,"profile",ag(b||{}));N(this,"providerId",a)},Hi=function(a){Li.call(this,a);if("facebook.com"!=this.providerId)throw Error("Invalid provider id!");};t(Hi,Li);
3698
+ var Ji=function(a){Li.call(this,a);if("github.com"!=this.providerId)throw Error("Invalid provider id!");N(this,"username",this.profile&&this.profile.login||null)};t(Ji,Li);var Ii=function(a){Li.call(this,a);if("google.com"!=this.providerId)throw Error("Invalid provider id!");};t(Ii,Li);var Ki=function(a){Li.call(this,a);if("twitter.com"!=this.providerId)throw Error("Invalid provider id!");N(this,"username",a.screenName||null)};t(Ki,Li);var Ni={zg:"local",NONE:"none",Ag:"session"},Oi=function(a){var b=new O("invalid-persistence-type"),c=new O("unsupported-persistence-type");a:{for(d in Ni)if(Ni[d]==a){var d=!0;break a}d=!1}if(!d||"string"!==typeof a)throw b;switch(Df()){case "ReactNative":if("session"===a)throw c;break;case "Node":if("none"!==a)throw c;break;default:if(!Hf()&&"none"!==a)throw c;}},Pi=function(a,b,c,d){this.Ce=a;this.Pd=b;this.fg=c;this.ac=d;this.V={};yi||(yi=new xi);a=yi;try{if(nf()){oi||(oi=new ni("firebaseLocalStorageDb",
3699
+ "firebaseLocalStorage","fbase_key","value",1));var e=oi}else e=new a.ke.B;this.He=e}catch(f){this.He=new gi,this.ac=!0}try{this.Re=new a.ke.Xd}catch(f){this.Re=new gi}this.Ff=new gi;this.Wd=r(this.Pe,this);this.W={}},Qi,Ri=function(){Qi||(Qi=new Pi("firebase",":",!Of(L())&&Cf()?!0:!1,Kf()));return Qi},Si=function(a,b){switch(b){case "session":return a.Re;case "none":return a.Ff;default:return a.He}};h=Pi.prototype;h.aa=function(a,b){return this.Ce+this.Pd+a.name+(b?this.Pd+b:"")};
3700
+ h.get=function(a,b){return Si(this,a.B).get(this.aa(a,b))};h.remove=function(a,b){b=this.aa(a,b);"local"!=a.B||this.ac||(this.W[b]=null);return Si(this,a.B).remove(b)};h.set=function(a,b,c){var d=this.aa(a,c),e=this,f=Si(this,a.B);return f.set(d,b).then(function(){return f.get(d)}).then(function(b){"local"!=a.B||this.ac||(e.W[d]=b)})};h.addListener=function(a,b,c){a=this.aa(a,b);this.ac||(this.W[a]=k.localStorage.getItem(a));jb(this.V)&&this.Vd();this.V[a]||(this.V[a]=[]);this.V[a].push(c)};
3701
+ h.removeListener=function(a,b,c){a=this.aa(a,b);this.V[a]&&(Za(this.V[a],function(a){return a==c}),0==this.V[a].length&&delete this.V[a]);jb(this.V)&&this.Qc()};h.Vd=function(){Si(this,"local").gb(this.Wd);this.ac||nf()||Ti(this)};var Ti=function(a){Ui(a);a.zd=setInterval(function(){for(var b in a.V){var c=k.localStorage.getItem(b),d=a.W[b];c!=d&&(a.W[b]=c,c=new Yb({type:"storage",key:b,target:window,oldValue:d,newValue:c,Gd:!0}),a.Pe(c))}},1E3)},Ui=function(a){a.zd&&(clearInterval(a.zd),a.zd=null)};
3702
+ Pi.prototype.Qc=function(){Si(this,"local").Xa(this.Wd);Ui(this)};
3703
+ Pi.prototype.Pe=function(a){if(a&&a.wf){var b=a.fa.key;if(0==b.indexOf(this.Ce+this.Pd)&&this.V[b]){"undefined"!==typeof a.fa.Gd?Si(this,"local").Xa(this.Wd):Ui(this);if(this.fg){var c=k.localStorage.getItem(b),d=a.fa.newValue;if(d!==c)null!==d?k.localStorage.setItem(b,d):k.localStorage.removeItem(b);else if(this.W[b]===d&&"undefined"===typeof a.fa.Gd)return}if("undefined"!==typeof a.fa.Gd||this.W[b]!==k.localStorage.getItem(b))this.W[b]=k.localStorage.getItem(b),this.ce(b)}}else x(a,r(this.ce,this))};
3704
+ Pi.prototype.ce=function(a){this.V[a]&&x(this.V[a],function(a){a()})};var Vi=function(a,b){this.j=a;this.h=b||Ri()},Wi={name:"authEvent",B:"local"},Xi=function(a){return a.h.get(Wi,a.j).then(function(a){return ig(a)})};Vi.prototype.fb=function(a){this.h.addListener(Wi,this.j,a)};Vi.prototype.$b=function(a){this.h.removeListener(Wi,this.j,a)};var Yi=function(a){this.h=a||Ri()},Zi={name:"sessionId",B:"session"};Yi.prototype.sc=function(a){return this.h.get(Zi,a)};var $i=function(a,b,c,d,e,f){this.C=a;this.o=b;this.u=c;this.Ja=d||null;this.Qe=b+":"+c;this.gg=new Yi;this.oe=new Vi(this.Qe);this.ud=null;this.sa=[];this.Kf=e||500;this.$f=f||2E3;this.Nb=this.Ic=null},aj=function(a){return new O("invalid-cordova-configuration",a)};
3705
+ $i.prototype.Pa=function(){return this.Pb?this.Pb:this.Pb=Af().then(function(){if("function"!==typeof M("universalLinks.subscribe",k))throw aj("cordova-universal-links-plugin is not installed");if("undefined"===typeof M("BuildInfo.packageName",k))throw aj("cordova-plugin-buildinfo is not installed");if("function"!==typeof M("cordova.plugins.browsertab.openUrl",k))throw aj("cordova-plugin-browsertab is not installed");if("function"!==typeof M("cordova.InAppBrowser.open",k))throw aj("cordova-plugin-inappbrowser is not installed");
3706
+ },function(){throw new O("cordova-not-ready");})};var bj=function(){for(var a=20,b=[];0<a;)b.push("1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".charAt(Math.floor(62*Math.random()))),a--;return b.join("")},cj=function(a){var b=new Tb;b.update(a);return bb(b.digest())};h=$i.prototype;h.cc=function(a,b){b(new O("operation-not-supported-in-this-environment"));return E()};h.Wb=function(){return F(new O("operation-not-supported-in-this-environment"))};h.Se=function(){return!1};h.Oe=function(){return!0};
3707
+ h.se=function(){return!0};
3708
+ h.Xb=function(a,b,c){if(this.Ic)return F(new O("redirect-operation-pending"));var d=this,e=k.document,f=null,g=null,l=null,n=null;return this.Ic=Ed(E().then(function(){Mg(b);return dj(d)}).then(function(){return ej(d,a,b,c)}).then(function(){return(new D(function(a,b){g=function(){var b=M("cordova.plugins.browsertab.close",k);a();"function"===typeof b&&b();d.Nb&&"function"===typeof d.Nb.close&&(d.Nb.close(),d.Nb=null);return!1};d.fb(g);l=function(){f||(f=Be(d.$f).then(function(){b(new O("redirect-cancelled-by-user"))}))};n=
3709
+ function(){Sf()&&l()};e.addEventListener("resume",l,!1);L().toLowerCase().match(/android/)||e.addEventListener("visibilitychange",n,!1)})).f(function(a){return fj(d).then(function(){throw a;})})}),function(){l&&e.removeEventListener("resume",l,!1);n&&e.removeEventListener("visibilitychange",n,!1);f&&f.cancel();g&&d.$b(g);d.Ic=null})};
3710
+ var ej=function(a,b,c,d){var e=bj(),f=new hg(b,d,null,e,new O("no-auth-event")),g=M("BuildInfo.packageName",k);if("string"!==typeof g)throw new O("invalid-cordova-configuration");var l=M("BuildInfo.displayName",k),n={};if(L().toLowerCase().match(/iphone|ipad|ipod/))n.ibi=g;else if(L().toLowerCase().match(/android/))n.apn=g;else return F(new O("operation-not-supported-in-this-environment"));l&&(n.appDisplayName=l);e=cj(e);n.sessionId=e;var C=Xh(a.C,a.o,a.u,b,c,null,d,a.Ja,n);return a.Pa().then(function(){var b=
3711
+ a.Qe;return a.gg.h.set(Wi,f.I(),b)}).then(function(){var b=M("cordova.plugins.browsertab.isAvailable",k);if("function"!==typeof b)throw new O("invalid-cordova-configuration");var c=null;b(function(b){if(b){c=M("cordova.plugins.browsertab.openUrl",k);if("function"!==typeof c)throw new O("invalid-cordova-configuration");c(C)}else{c=M("cordova.InAppBrowser.open",k);if("function"!==typeof c)throw new O("invalid-cordova-configuration");b=c;var d=L();d=!(!d.match(/(iPad|iPhone|iPod).*OS 7_\d/i)&&!d.match(/(iPad|iPhone|iPod).*OS 8_\d/i));
3712
+ a.Nb=b(C,d?"_blank":"_system","location=yes")}})})};$i.prototype.Hb=function(a){for(var b=0;b<this.sa.length;b++)try{this.sa[b](a)}catch(c){}};
3713
+ var dj=function(a){a.ud||(a.ud=a.Pa().then(function(){return new D(function(b){var c=function(d){b(d);a.$b(c);return!1};a.fb(c);gj(a)})}));return a.ud},fj=function(a){var b=null;return Xi(a.oe).then(function(c){b=c;c=a.oe;return c.h.remove(Wi,c.j)}).then(function(){return b})},gj=function(a){var b=M("universalLinks.subscribe",k);if("function"!==typeof b)throw new O("invalid-cordova-configuration");var c=new hg("unknown",null,null,null,new O("no-auth-event")),d=!1,e=Be(a.Kf).then(function(){return fj(a).then(function(){d||
3714
+ a.Hb(c)})}),f=function(b){d=!0;e&&e.cancel();fj(a).then(function(d){var e=c;if(d&&b&&b.url){e=null;var f=b.url;var g=gf(f),l=ff(g,"link"),n=ff(gf(l),"link");g=ff(g,"deep_link_id");f=ff(gf(g),"link")||g||n||l||f;-1!=f.indexOf("/__/auth/callback")&&(e=gf(f),e=Nf(ff(e,"firebaseError")||null),e=(e="object"===typeof e?gg(e):null)?new hg(d.la,d.U,null,null,e):new hg(d.la,d.U,f,d.sc()));e=e||c}a.Hb(e)})},g=k.handleOpenURL;k.handleOpenURL=function(a){0==a.toLowerCase().indexOf(M("BuildInfo.packageName",k).toLowerCase()+
3715
+ "://")&&f({url:a});if("function"===typeof g)try{g(a)}catch(n){console.error(n)}};b(null,f)};$i.prototype.fb=function(a){this.sa.push(a);dj(this).f(function(b){"auth/invalid-cordova-configuration"===b.code&&(b=new hg("unknown",null,null,null,new O("no-auth-event")),a(b))})};$i.prototype.$b=function(a){Za(this.sa,function(b){return b==a})};var hj=function(a){this.j=a;this.h=Ri()},ij={name:"pendingRedirect",B:"session"},jj=function(a){return a.h.set(ij,"pending",a.j)},kj=function(a){return a.h.remove(ij,a.j)},lj=function(a){return a.h.get(ij,a.j).then(function(a){return"pending"==a})};var pj=function(a,b,c){this.C=a;this.o=b;this.u=c;this.ec=[];this.ob=!1;this.cd=r(this.qd,this);this.Va=new mj(this);this.Id=new nj(this);this.Tb=new hj(this.o+":"+this.u);this.Fa={};this.Fa.unknown=this.Va;this.Fa.signInViaRedirect=this.Va;this.Fa.linkViaRedirect=this.Va;this.Fa.reauthViaRedirect=this.Va;this.Fa.signInViaPopup=this.Id;this.Fa.linkViaPopup=this.Id;this.Fa.reauthViaPopup=this.Id;this.X=oj(this.C,this.o,this.u)},oj=function(a,b,c){var d=firebase.SDK_VERSION||null;return zf()?new $i(a,
3716
+ b,c,d):new Th(a,b,c,d)};pj.prototype.reset=function(){this.ob=!1;this.X.$b(this.cd);this.X=oj(this.C,this.o,this.u)};pj.prototype.Ob=function(){var a=this;this.ob||(this.ob=!0,this.X.fb(this.cd));var b=this.X;return this.X.Pa().f(function(c){a.X==b&&a.reset();throw c;})};var sj=function(a){a.X.Oe()&&a.Ob().f(function(b){var c=new hg("unknown",null,null,null,new O("operation-not-supported-in-this-environment"));qj(b)&&a.qd(c)});a.X.se()||rj(a.Va)};
3717
+ pj.prototype.subscribe=function(a){Wa(this.ec,a)||this.ec.push(a);if(!this.ob){var b=this;lj(this.Tb).then(function(a){a?kj(b.Tb).then(function(){b.Ob().f(function(a){var c=new hg("unknown",null,null,null,new O("operation-not-supported-in-this-environment"));qj(a)&&b.qd(c)})}):sj(b)}).f(function(){sj(b)})}};pj.prototype.unsubscribe=function(a){Za(this.ec,function(b){return b==a})};
3718
+ pj.prototype.qd=function(a){if(!a)throw new O("invalid-auth-event");for(var b=!1,c=0;c<this.ec.length;c++){var d=this.ec[c];if(d.de(a.la,a.U)){(b=this.Fa[a.la])&&b.Ie(a,d);b=!0;break}}rj(this.Va);return b};var tj=new Rf(2E3,1E4),uj=new Rf(3E4,6E4);pj.prototype.getRedirectResult=function(){return this.Va.getRedirectResult()};pj.prototype.Wb=function(a,b,c,d,e){var f=this;return this.X.Wb(a,b,c,function(){f.ob||(f.ob=!0,f.X.fb(f.cd))},function(){f.reset()},d,e)};
3719
+ var qj=function(a){return a&&"auth/cordova-not-ready"==a.code?!0:!1};pj.prototype.Xb=function(a,b,c){var d=this,e;return jj(this.Tb).then(function(){return d.X.Xb(a,b,c).f(function(a){if(qj(a))throw new O("operation-not-supported-in-this-environment");e=a;return kj(d.Tb).then(function(){throw e;})}).then(function(){return d.X.Se()?new D(function(){}):kj(d.Tb).then(function(){return d.getRedirectResult()}).then(function(){}).f(function(){})})})};
3720
+ pj.prototype.cc=function(a,b,c,d){return this.X.cc(c,function(c){a.Za(b,null,c,d)},tj.get())};var vj={},wj=function(a,b,c){var d=b+":"+c;vj[d]||(vj[d]=new pj(a,b,c));return vj[d]},mj=function(a){this.h=a;this.xb=null;this.Zb=[];this.Yb=[];this.ub=null;this.Ld=!1};mj.prototype.reset=function(){this.xb=null;this.ub&&(this.ub.cancel(),this.ub=null)};
3721
+ mj.prototype.Ie=function(a,b){if(!a)return F(new O("invalid-auth-event"));this.reset();this.Ld=!0;var c=a.la,d=a.U,e=a.getError()&&"auth/web-storage-unsupported"==a.getError().code,f=a.getError()&&"auth/operation-not-supported-in-this-environment"==a.getError().code;"unknown"!=c||e||f?a=a.$?this.Jd(a,b):b.Jb(c,d)?this.Kd(a,b):F(new O("invalid-auth-event")):(xj(this,!1,null,null),a=E());return a};var rj=function(a){a.Ld||(a.Ld=!0,xj(a,!1,null,null))};
3722
+ mj.prototype.Jd=function(a){xj(this,!0,null,a.getError());return E()};mj.prototype.Kd=function(a,b){var c=this;b=b.Jb(a.la,a.U);var d=a.Ab,e=a.sc(),f=!!a.la.match(/Redirect$/);return b(d,e).then(function(a){xj(c,f,a,null)}).f(function(a){xj(c,f,null,a)})};
3723
+ var yj=function(a,b){a.xb=function(){return F(b)};if(a.Yb.length)for(var c=0;c<a.Yb.length;c++)a.Yb[c](b)},zj=function(a,b){a.xb=function(){return E(b)};if(a.Zb.length)for(var c=0;c<a.Zb.length;c++)a.Zb[c](b)},xj=function(a,b,c,d){b?d?yj(a,d):zj(a,c):zj(a,{user:null});a.Zb=[];a.Yb=[]};mj.prototype.getRedirectResult=function(){var a=this;return new D(function(b,c){a.xb?a.xb().then(b,c):(a.Zb.push(b),a.Yb.push(c),Aj(a))})};
3724
+ var Aj=function(a){var b=new O("timeout");a.ub&&a.ub.cancel();a.ub=Be(uj.get()).then(function(){a.xb||xj(a,!0,null,b)})},nj=function(a){this.h=a};nj.prototype.Ie=function(a,b){if(!a)return F(new O("invalid-auth-event"));var c=a.la,d=a.U;return a.$?this.Jd(a,b):b.Jb(c,d)?this.Kd(a,b):F(new O("invalid-auth-event"))};nj.prototype.Jd=function(a,b){b.Za(a.la,null,a.getError(),a.U);return E()};
3725
+ nj.prototype.Kd=function(a,b){var c=a.U,d=a.la,e=b.Jb(d,c),f=a.Ab;a=a.sc();return e(f,a).then(function(a){b.Za(d,a,null,c)}).f(function(a){b.Za(d,null,a,c)})};var Bj=function(a){this.g=a;this.Ga=this.da=null;this.La=0};Bj.prototype.I=function(){return{apiKey:this.g.o,refreshToken:this.da,accessToken:this.Ga,expirationTime:this.La}};
3726
+ var Dj=function(a,b){var c=b.idToken,d=b.refreshToken;b=Cj(b.expiresIn);a.Ga=c;a.La=b;a.da=d},Cj=function(a){return na()+1E3*parseInt(a,10)},Ej=function(a,b){return ah(a.g,b).then(function(b){a.Ga=b.access_token;a.La=Cj(b.expires_in);a.da=b.refresh_token;return{accessToken:a.Ga,expirationTime:a.La,refreshToken:a.da}}).f(function(b){"auth/user-token-expired"==b.code&&(a.da=null);throw b;})};
3727
+ Bj.prototype.getToken=function(a){a=!!a;return this.Ga&&!this.da?F(new O("user-token-expired")):a||!this.Ga||na()>this.La-3E4?this.da?Ej(this,{grant_type:"refresh_token",refresh_token:this.da}):E(null):E({accessToken:this.Ga,expirationTime:this.La,refreshToken:this.da})};var Fj=function(a,b,c,d,e,f){Xf(this,{uid:a,displayName:d||null,photoURL:e||null,email:c||null,phoneNumber:f||null,providerId:b})},Gj=function(a,b){B.call(this,a);for(var c in b)this[c]=b[c]};t(Gj,B);
3728
+ var S=function(a,b,c){this.K=[];this.o=a.apiKey;this.u=a.appName;this.C=a.authDomain||null;a=firebase.SDK_VERSION?Ff(firebase.SDK_VERSION):null;this.g=new R(this.o,null,a);this.qa=new Bj(this.g);Hj(this,b.idToken);Dj(this.qa,b);N(this,"refreshToken",this.qa.da);Ij(this,c||{});G.call(this);this.Jc=!1;this.C&&Jf()&&(this.v=wj(this.C,this.o,this.u));this.Pc=[];this.ra=null;this.sb=Jj(this);this.Cb=r(this.rd,this);var d=this;this.ha=null;this.Ee=function(a){d.bc(a.Nf)};this.xd=null};t(S,G);
3729
+ S.prototype.bc=function(a){this.ha=a;Vg(this.g,a)};var Kj=function(a,b){a.xd&&sc(a.xd,"languageCodeChanged",a.Ee);(a.xd=b)&&kc(b,"languageCodeChanged",a.Ee)};S.prototype.rd=function(){this.sb.qb&&(this.sb.stop(),this.sb.start())};
3730
+ var Lj=function(a){try{return firebase.app(a.u).auth()}catch(b){throw new O("internal-error","No firebase.auth.Auth instance is available for the Firebase App '"+a.u+"'!");}},Jj=function(a){return new Ei(function(){return a.getIdToken(!0)},function(a){return a&&"auth/network-request-failed"==a.code?!0:!1},function(){var b=a.qa.La-na()-3E5;return 0<b?b:0},3E4,96E4,!1)},Mj=function(a){a.Gb||a.sb.qb||(a.sb.start(),sc(a,"tokenChanged",a.Cb),kc(a,"tokenChanged",a.Cb))},Nj=function(a){sc(a,"tokenChanged",
3731
+ a.Cb);a.sb.stop()},Hj=function(a,b){a.ze=b;N(a,"_lat",b)},Oj=function(a,b){Za(a.Pc,function(a){return a==b})},Pj=function(a){for(var b=[],c=0;c<a.Pc.length;c++)b.push(a.Pc[c](a));return Bd(b).then(function(){return a})},Qj=function(a){a.v&&!a.Jc&&(a.Jc=!0,a.v.subscribe(a))},Ij=function(a,b){Xf(a,{uid:b.uid,displayName:b.displayName||null,photoURL:b.photoURL||null,email:b.email||null,emailVerified:b.emailVerified||!1,phoneNumber:b.phoneNumber||null,isAnonymous:b.isAnonymous||!1,providerData:[]})};
3732
+ N(S.prototype,"providerId","firebase");var Rj=function(){},Sj=function(a){return E().then(function(){if(a.Gb)throw new O("app-deleted");})},Tj=function(a){return Sa(a.providerData,function(a){return a.providerId})},Vj=function(a,b){b&&(Uj(a,b.providerId),a.providerData.push(b))},Uj=function(a,b){Za(a.providerData,function(a){return a.providerId==b})},Wj=function(a,b,c){("uid"!=b||c)&&a.hasOwnProperty(b)&&N(a,b,c)};
3733
+ S.prototype.copy=function(a){var b=this;b!=a&&(Xf(this,{uid:a.uid,displayName:a.displayName,photoURL:a.photoURL,email:a.email,emailVerified:a.emailVerified,phoneNumber:a.phoneNumber,isAnonymous:a.isAnonymous,providerData:[]}),x(a.providerData,function(a){Vj(b,a)}),this.qa=a.qa,N(this,"refreshToken",this.qa.da))};S.prototype.reload=function(){var a=this;return this.c(Sj(this).then(function(){return Xj(a).then(function(){return Pj(a)}).then(Rj)}))};
3734
+ var Xj=function(a){return a.getIdToken().then(function(b){var c=a.isAnonymous;return Yj(a,b).then(function(){c||Wj(a,"isAnonymous",!1);return b})})};S.prototype.getIdToken=function(a){var b=this;return this.c(Sj(this).then(function(){return b.qa.getToken(a)}).then(function(a){if(!a)throw new O("internal-error");a.accessToken!=b.ze&&(Hj(b,a.accessToken),b.Ra());Wj(b,"refreshToken",a.refreshToken);return a.accessToken}))};
3735
+ S.prototype.getToken=function(a){Uf["firebase.User.prototype.getToken is deprecated. Please use firebase.User.prototype.getIdToken instead."]||(Uf["firebase.User.prototype.getToken is deprecated. Please use firebase.User.prototype.getIdToken instead."]=!0,"undefined"!==typeof console&&"function"===typeof console.warn&&console.warn("firebase.User.prototype.getToken is deprecated. Please use firebase.User.prototype.getIdToken instead."));return this.getIdToken(a)};
3736
+ var Zj=function(a,b){b.idToken&&a.ze!=b.idToken&&(Dj(a.qa,b),a.Ra(),Hj(a,b.idToken),Wj(a,"refreshToken",a.qa.da))};S.prototype.Ra=function(){this.dispatchEvent(new Gj("tokenChanged"))};var Yj=function(a,b){return Q(a.g,Dh,{idToken:b}).then(r(a.Xf,a))};
3737
+ S.prototype.Xf=function(a){a=a.users;if(!a||!a.length)throw new O("internal-error");a=a[0];Ij(this,{uid:a.localId,displayName:a.displayName,photoURL:a.photoUrl,email:a.email,emailVerified:!!a.emailVerified,phoneNumber:a.phoneNumber});for(var b=ak(a),c=0;c<b.length;c++)Vj(this,b[c]);Wj(this,"isAnonymous",!(this.email&&a.passwordHash)&&!(this.providerData&&this.providerData.length))};
3738
+ var ak=function(a){return(a=a.providerUserInfo)&&a.length?Sa(a,function(a){return new Fj(a.rawId,a.providerId,a.email,a.displayName,a.photoUrl,a.phoneNumber)}):[]};S.prototype.reauthenticateAndRetrieveDataWithCredential=function(a){var b=this,c=null;return this.c(a.Ad(this.g,this.uid).then(function(a){Zj(b,a);c=bk(b,a,"reauthenticate");b.ra=null;return b.reload()}).then(function(){return c}),!0)};S.prototype.reauthenticateWithCredential=function(a){return this.reauthenticateAndRetrieveDataWithCredential(a).then(function(){})};
3739
+ var ck=function(a,b){return Xj(a).then(function(){if(Wa(Tj(a),b))return Pj(a).then(function(){throw new O("provider-already-linked");})})};S.prototype.linkAndRetrieveDataWithCredential=function(a){var b=this,c=null;return this.c(ck(this,a.providerId).then(function(){return b.getIdToken()}).then(function(c){return a.Ec(b.g,c)}).then(function(a){c=bk(b,a,"link");return dk(b,a)}).then(function(){return c}))};S.prototype.linkWithCredential=function(a){return this.linkAndRetrieveDataWithCredential(a).then(function(a){return a.user})};
3740
+ S.prototype.linkWithPhoneNumber=function(a,b){var c=this;return this.c(ck(this,"phone").then(function(){return Ci(Lj(c),a,b,r(c.linkAndRetrieveDataWithCredential,c))}))};S.prototype.reauthenticateWithPhoneNumber=function(a,b){var c=this;return this.c(E().then(function(){return Ci(Lj(c),a,b,r(c.reauthenticateAndRetrieveDataWithCredential,c))}),!0)};var bk=function(a,b,c){var d=Lg(b);b=Mi(b);return Yf({user:a,credential:d,additionalUserInfo:b,operationType:c})},dk=function(a,b){Zj(a,b);return a.reload().then(function(){return a})};
3741
+ h=S.prototype;h.updateEmail=function(a){var b=this;return this.c(this.getIdToken().then(function(c){return b.g.updateEmail(c,a)}).then(function(a){Zj(b,a);return b.reload()}))};h.updatePhoneNumber=function(a){var b=this;return this.c(this.getIdToken().then(function(c){return a.Ec(b.g,c)}).then(function(a){Zj(b,a);return b.reload()}))};h.updatePassword=function(a){var b=this;return this.c(this.getIdToken().then(function(c){return b.g.updatePassword(c,a)}).then(function(a){Zj(b,a);return b.reload()}))};
3742
+ h.updateProfile=function(a){if(void 0===a.displayName&&void 0===a.photoURL)return Sj(this);var b=this;return this.c(this.getIdToken().then(function(c){return b.g.updateProfile(c,{displayName:a.displayName,photoUrl:a.photoURL})}).then(function(a){Zj(b,a);Wj(b,"displayName",a.displayName||null);Wj(b,"photoURL",a.photoUrl||null);x(b.providerData,function(a){"password"===a.providerId&&(N(a,"displayName",b.displayName),N(a,"photoURL",b.photoURL))});return Pj(b)}).then(Rj))};
3743
+ h.unlink=function(a){var b=this;return this.c(Xj(this).then(function(c){return Wa(Tj(b),a)?rh(b.g,c,[a]).then(function(a){var c={};x(a.providerUserInfo||[],function(a){c[a.providerId]=!0});x(Tj(b),function(a){c[a]||Uj(b,a)});c[Ig.PROVIDER_ID]||N(b,"phoneNumber",null);return Pj(b)}):Pj(b).then(function(){throw new O("no-such-provider");})}))};
3744
+ h["delete"]=function(){var a=this;return this.c(this.getIdToken().then(function(b){return Q(a.g,Ch,{idToken:b})}).then(function(){a.dispatchEvent(new Gj("userDeleted"))})).then(function(){for(var b=0;b<a.K.length;b++)a.K[b].cancel("app-deleted");Kj(a,null);a.K=[];a.Gb=!0;Nj(a);N(a,"refreshToken",null);a.v&&a.v.unsubscribe(a)})};
3745
+ h.de=function(a,b){return"linkViaPopup"==a&&(this.ka||null)==b&&this.ja||"reauthViaPopup"==a&&(this.ka||null)==b&&this.ja||"linkViaRedirect"==a&&(this.Ea||null)==b||"reauthViaRedirect"==a&&(this.Ea||null)==b?!0:!1};h.Za=function(a,b,c,d){"linkViaPopup"!=a&&"reauthViaPopup"!=a||d!=(this.ka||null)||(c&&this.Ta?this.Ta(c):b&&!c&&this.ja&&this.ja(b),this.M&&(this.M.cancel(),this.M=null),delete this.ja,delete this.Ta)};
3746
+ h.Jb=function(a,b){return"linkViaPopup"==a&&b==(this.ka||null)?r(this.me,this):"reauthViaPopup"==a&&b==(this.ka||null)?r(this.ne,this):"linkViaRedirect"==a&&(this.Ea||null)==b?r(this.me,this):"reauthViaRedirect"==a&&(this.Ea||null)==b?r(this.ne,this):null};h.rc=function(){return Gf(this.uid+":::")};h.linkWithPopup=function(a){var b=this;return ek(this,"linkViaPopup",a,function(){return ck(b,a.providerId).then(function(){return Pj(b)})},!1)};
3747
+ h.reauthenticateWithPopup=function(a){return ek(this,"reauthViaPopup",a,function(){return E()},!0)};
3748
+ var ek=function(a,b,c,d,e){if(!Jf())return F(new O("operation-not-supported-in-this-environment"));if(a.ra&&!e)return F(a.ra);var f=eg(c.providerId),g=a.rc(),l=null;(!Kf()||Cf())&&a.C&&c.isOAuthProvider&&(l=Xh(a.C,a.o,a.u,b,c,null,g,firebase.SDK_VERSION||null));var n=vf(l,f&&f.Vb,f&&f.Ub);d=d().then(function(){fk(a);if(!e)return a.getIdToken().then(function(){})}).then(function(){return a.v.Wb(n,b,c,g,!!l)}).then(function(){return new D(function(c,d){a.Za(b,null,new O("cancelled-popup-request"),a.ka||
3749
+ null);a.ja=c;a.Ta=d;a.ka=g;a.M=a.v.cc(a,b,n,g)})}).then(function(a){n&&uf(n);return a?Yf(a):null}).f(function(a){n&&uf(n);throw a;});return a.c(d,e)};S.prototype.linkWithRedirect=function(a){var b=this;return gk(this,"linkViaRedirect",a,function(){return ck(b,a.providerId)},!1)};S.prototype.reauthenticateWithRedirect=function(a){return gk(this,"reauthViaRedirect",a,function(){return E()},!0)};
3750
+ var gk=function(a,b,c,d,e){if(!Jf())return F(new O("operation-not-supported-in-this-environment"));if(a.ra&&!e)return F(a.ra);var f=null,g=a.rc();d=d().then(function(){fk(a);if(!e)return a.getIdToken().then(function(){})}).then(function(){a.Ea=g;return Pj(a)}).then(function(b){a.Wa&&(b=a.Wa,b=b.h.set(hk,a.I(),b.j));return b}).then(function(){return a.v.Xb(b,c,g)}).f(function(b){f=b;if(a.Wa)return ik(a.Wa);throw f;}).then(function(){if(f)throw f;});return a.c(d,e)},fk=function(a){if(!a.v||!a.Jc){if(a.v&&
3751
+ !a.Jc)throw new O("internal-error");throw new O("auth-domain-config-required");}};S.prototype.me=function(a,b){var c=this;this.M&&(this.M.cancel(),this.M=null);var d=null,e=this.getIdToken().then(function(d){return pg(c.g,{requestUri:a,sessionId:b,idToken:d})}).then(function(a){d=bk(c,a,"link");return dk(c,a)}).then(function(){return d});return this.c(e)};
3752
+ S.prototype.ne=function(a,b){var c=this;this.M&&(this.M.cancel(),this.M=null);var d=null,e=E().then(function(){return lg(qg(c.g,{requestUri:a,sessionId:b}),c.uid)}).then(function(a){d=bk(c,a,"reauthenticate");Zj(c,a);c.ra=null;return c.reload()}).then(function(){return d});return this.c(e,!0)};
3753
+ S.prototype.sendEmailVerification=function(a){var b=this,c=null;return this.c(this.getIdToken().then(function(b){c=b;return"undefined"===typeof a||jb(a)?{}:Ai(new zi(a))}).then(function(a){return b.g.sendEmailVerification(c,a)}).then(function(a){if(b.email!=a)return b.reload()}).then(function(){}))};S.prototype.c=function(a,b){var c=this,d=jk(this,a,b);this.K.push(d);Ed(d,function(){Ya(c.K,d)});return d};
3754
+ var jk=function(a,b,c){return a.ra&&!c?(b.cancel(),F(a.ra)):b.f(function(b){!b||"auth/user-disabled"!=b.code&&"auth/user-token-expired"!=b.code||(a.ra||a.dispatchEvent(new Gj("userInvalidated")),a.ra=b);throw b;})};S.prototype.toJSON=function(){return this.I()};
3755
+ S.prototype.I=function(){var a={uid:this.uid,displayName:this.displayName,photoURL:this.photoURL,email:this.email,emailVerified:this.emailVerified,phoneNumber:this.phoneNumber,isAnonymous:this.isAnonymous,providerData:[],apiKey:this.o,appName:this.u,authDomain:this.C,stsTokenManager:this.qa.I(),redirectEventId:this.Ea||null};x(this.providerData,function(b){a.providerData.push(Zf(b))});return a};
3756
+ var kk=function(a){if(!a.apiKey)return null;var b={apiKey:a.apiKey,authDomain:a.authDomain,appName:a.appName},c={};if(a.stsTokenManager&&a.stsTokenManager.accessToken&&a.stsTokenManager.expirationTime)c.idToken=a.stsTokenManager.accessToken,c.refreshToken=a.stsTokenManager.refreshToken||null,c.expiresIn=(a.stsTokenManager.expirationTime-na())/1E3;else return null;var d=new S(b,c,a);a.providerData&&x(a.providerData,function(a){a&&Vj(d,Yf(a))});a.redirectEventId&&(d.Ea=a.redirectEventId);return d},
3757
+ lk=function(a,b,c){var d=new S(a,b);c&&(d.Wa=c);return d.reload().then(function(){return d})};var mk=function(a){this.j=a;this.h=Ri()},hk={name:"redirectUser",B:"session"},ik=function(a){return a.h.remove(hk,a.j)},nk=function(a,b){return a.h.get(hk,a.j).then(function(a){a&&b&&(a.authDomain=b);return kk(a||{})})};var pk=function(a,b){this.j=a;this.h=b||Ri();this.N=null;this.Dd=this.vd();this.h.addListener(ok("local"),this.j,r(this.mg,this))};pk.prototype.mg=function(){var a=this,b=ok("local");qk(this,function(){return E().then(function(){return a.N&&"local"!=a.N.B?a.h.get(b,a.j):null}).then(function(c){if(c)return rk(a,"local").then(function(){a.N=b})})})};var rk=function(a,b){var c=[],d;for(d in Ni)Ni[d]!==b&&c.push(a.h.remove(ok(Ni[d]),a.j));c.push(a.h.remove(sk,a.j));return Ad(c)};
3758
+ pk.prototype.vd=function(){var a=this,b=ok("local"),c=ok("session"),d=ok("none");return this.h.get(c,this.j).then(function(e){return e?c:a.h.get(d,a.j).then(function(c){return c?d:a.h.get(b,a.j).then(function(c){return c?b:a.h.get(sk,a.j).then(function(a){return a?ok(a):b})})})}).then(function(b){a.N=b;return rk(a,b.B)}).f(function(){a.N||(a.N=b)})};var sk={name:"persistence",B:"session"},ok=function(a){return{name:"authUser",B:a}};
3759
+ pk.prototype.Sd=function(a){var b=null,c=this;Oi(a);return qk(this,function(){return a!=c.N.B?c.h.get(c.N,c.j).then(function(d){b=d;return rk(c,a)}).then(function(){c.N=ok(a);if(b)return c.h.set(c.N,b,c.j)}):E()})};
3760
+ var tk=function(a){return qk(a,function(){return a.h.set(sk,a.N.B,a.j)})},uk=function(a,b){return qk(a,function(){return a.h.set(a.N,b.I(),a.j)})},vk=function(a){return qk(a,function(){return a.h.remove(a.N,a.j)})},wk=function(a,b){return qk(a,function(){return a.h.get(a.N,a.j).then(function(a){a&&b&&(a.authDomain=b);return kk(a||{})})})},qk=function(a,b){a.Dd=a.Dd.then(b,b);return a.Dd};var T=function(a){this.Ba=!1;N(this,"app",a);if(this.i().options&&this.i().options.apiKey)a=firebase.SDK_VERSION?Ff(firebase.SDK_VERSION):null,this.g=new R(this.i().options&&this.i().options.apiKey,null,a);else throw new O("invalid-api-key");this.K=[];this.Ha=[];this.Bb=[];this.Tf=firebase.INTERNAL.createSubscribe(r(this.Hf,this));this.jc=void 0;this.Vf=firebase.INTERNAL.createSubscribe(r(this.Jf,this));xk(this,null);a=this.i().options.apiKey;var b=this.i().name;this.ma=new pk(a+":"+b);a=this.i().options.apiKey;
3761
+ b=this.i().name;this.vb=new mk(a+":"+b);this.mc=this.c(yk(this));this.xa=this.c(zk(this));this.Bc=!1;this.pd=r(this.ng,this);this.Ve=r(this.lb,this);this.Cb=r(this.rd,this);this.Te=r(this.Cf,this);this.Ue=r(this.Df,this);Ak(this);this.INTERNAL={};this.INTERNAL["delete"]=r(this["delete"],this);this.Ma=0;G.call(this);Bk(this)};t(T,G);var Ck=function(a){B.call(this,"languageCodeChanged");this.Nf=a};t(Ck,B);T.prototype.Sd=function(a){a=this.ma.Sd(a);return this.c(a)};
3762
+ T.prototype.bc=function(a){this.ha===a||this.Ba||(this.ha=a,Vg(this.g,this.ha),this.dispatchEvent(new Ck(this.ha)))};var Bk=function(a){Object.defineProperty(a,"lc",{get:function(){return this.ha},set:function(a){this.bc(a)},enumerable:!1});a.ha=null};T.prototype.toJSON=function(){return{apiKey:this.i().options.apiKey,authDomain:this.i().options.authDomain,appName:this.i().name,currentUser:U(this)&&U(this).I()}};
3763
+ var Dk=function(a){return a.pf||F(new O("auth-domain-config-required"))},Ak=function(a){var b=a.i().options.authDomain,c=a.i().options.apiKey;b&&Jf()&&(a.pf=a.mc.then(function(){if(!a.Ba){a.v=wj(b,c,a.i().name);a.v.subscribe(a);U(a)&&Qj(U(a));if(a.wb){Qj(a.wb);var d=a.wb;d.bc(a.ha);Kj(d,a);a.wb=null}return a.v}}))};h=T.prototype;h.de=function(a,b){switch(a){case "unknown":case "signInViaRedirect":return!0;case "signInViaPopup":return this.ka==b&&!!this.ja;default:return!1}};
3764
+ h.Za=function(a,b,c,d){"signInViaPopup"==a&&this.ka==d&&(c&&this.Ta?this.Ta(c):b&&!c&&this.ja&&this.ja(b),this.M&&(this.M.cancel(),this.M=null),delete this.ja,delete this.Ta)};h.Jb=function(a,b){return"signInViaRedirect"==a||"signInViaPopup"==a&&this.ka==b&&this.ja?r(this.rf,this):null};
3765
+ h.rf=function(a,b){var c=this;a={requestUri:a,sessionId:b};this.M&&(this.M.cancel(),this.M=null);var d=null,e=null,f=ng(c.g,a).then(function(a){d=Lg(a);e=Mi(a);return a});a=c.mc.then(function(){return f}).then(function(a){return Ek(c,a)}).then(function(){return Yf({user:U(c),credential:d,additionalUserInfo:e,operationType:"signIn"})});return this.c(a)};h.rc=function(){return Gf()};
3766
+ h.signInWithPopup=function(a){if(!Jf())return F(new O("operation-not-supported-in-this-environment"));var b=this,c=eg(a.providerId),d=this.rc(),e=null;(!Kf()||Cf())&&this.i().options.authDomain&&a.isOAuthProvider&&(e=Xh(this.i().options.authDomain,this.i().options.apiKey,this.i().name,"signInViaPopup",a,null,d,firebase.SDK_VERSION||null));var f=vf(e,c&&c.Vb,c&&c.Ub);c=Dk(this).then(function(b){return b.Wb(f,"signInViaPopup",a,d,!!e)}).then(function(){return new D(function(a,c){b.Za("signInViaPopup",
3767
+ null,new O("cancelled-popup-request"),b.ka);b.ja=a;b.Ta=c;b.ka=d;b.M=b.v.cc(b,"signInViaPopup",f,d)})}).then(function(a){f&&uf(f);return a?Yf(a):null}).f(function(a){f&&uf(f);throw a;});return this.c(c)};h.signInWithRedirect=function(a){if(!Jf())return F(new O("operation-not-supported-in-this-environment"));var b=this,c=Dk(this).then(function(){return tk(b.ma)}).then(function(){return b.v.Xb("signInViaRedirect",a)});return this.c(c)};
3768
+ h.getRedirectResult=function(){if(!Jf())return F(new O("operation-not-supported-in-this-environment"));var a=this,b=Dk(this).then(function(){return a.v.getRedirectResult()}).then(function(a){return a?Yf(a):null});return this.c(b)};
3769
+ var Ek=function(a,b){var c={};c.apiKey=a.i().options.apiKey;c.authDomain=a.i().options.authDomain;c.appName=a.i().name;return a.mc.then(function(){return lk(c,b,a.vb)}).then(function(b){if(U(a)&&b.uid==U(a).uid)return U(a).copy(b),a.lb(b);xk(a,b);Qj(b);return a.lb(b)}).then(function(){a.Ra()})},xk=function(a,b){U(a)&&(Oj(U(a),a.Ve),sc(U(a),"tokenChanged",a.Cb),sc(U(a),"userDeleted",a.Te),sc(U(a),"userInvalidated",a.Ue),Nj(U(a)));b&&(b.Pc.push(a.Ve),kc(b,"tokenChanged",a.Cb),kc(b,"userDeleted",a.Te),
3770
+ kc(b,"userInvalidated",a.Ue),0<a.Ma&&Mj(b));N(a,"currentUser",b);b&&(b.bc(a.ha),Kj(b,a))};T.prototype.signOut=function(){var a=this,b=this.xa.then(function(){if(!U(a))return E();xk(a,null);return vk(a.ma).then(function(){a.Ra()})});return this.c(b)};
3771
+ var Fk=function(a){var b=a.i().options.authDomain;b=nk(a.vb,b).then(function(b){if(a.wb=b)b.Wa=a.vb;return ik(a.vb)});return a.c(b)},yk=function(a){var b=a.i().options.authDomain,c=Fk(a).then(function(){return wk(a.ma,b)}).then(function(b){return b?(b.Wa=a.vb,a.wb&&(a.wb.Ea||null)==(b.Ea||null)?b:b.reload().then(function(){return uk(a.ma,b).then(function(){return b})}).f(function(c){return"auth/network-request-failed"==c.code?b:vk(a.ma)})):null}).then(function(b){xk(a,b||null)});return a.c(c)},zk=
3772
+ function(a){return a.mc.then(function(){return a.getRedirectResult()}).f(function(){}).then(function(){if(!a.Ba)return a.pd()}).f(function(){}).then(function(){if(!a.Ba){a.Bc=!0;var b=a.ma;b.h.addListener(ok("local"),b.j,a.pd)}})};h=T.prototype;
3773
+ h.ng=function(){var a=this,b=this.i().options.authDomain;return wk(this.ma,b).then(function(b){if(!a.Ba){var c;if(c=U(a)&&b){c=U(a).uid;var e=b.uid;c=void 0===c||null===c||""===c||void 0===e||null===e||""===e?!1:c==e}if(c)return U(a).copy(b),U(a).getIdToken();if(U(a)||b)xk(a,b),b&&(Qj(b),b.Wa=a.vb),a.v&&a.v.subscribe(a),a.Ra()}})};h.lb=function(a){return uk(this.ma,a)};h.rd=function(){this.Ra();this.lb(U(this))};h.Cf=function(){this.signOut()};h.Df=function(){this.signOut()};
3774
+ var Gk=function(a,b){var c=null,d=null;return a.c(b.then(function(b){c=Lg(b);d=Mi(b);return Ek(a,b)}).then(function(){return Yf({user:U(a),credential:c,additionalUserInfo:d,operationType:"signIn"})}))};h=T.prototype;h.Hf=function(a){var b=this;this.addAuthTokenListener(function(){a.next(U(b))})};h.Jf=function(a){var b=this;Hk(this,function(){a.next(U(b))})};
3775
+ h.onIdTokenChanged=function(a,b,c){var d=this;this.Bc&&firebase.Promise.resolve().then(function(){p(a)?a(U(d)):p(a.next)&&a.next(U(d))});return this.Tf(a,b,c)};h.onAuthStateChanged=function(a,b,c){var d=this;this.Bc&&firebase.Promise.resolve().then(function(){d.jc=d.getUid();p(a)?a(U(d)):p(a.next)&&a.next(U(d))});return this.Vf(a,b,c)};h.xf=function(a){var b=this,c=this.xa.then(function(){return U(b)?U(b).getIdToken(a).then(function(a){return{accessToken:a}}):null});return this.c(c)};
3776
+ h.signInWithCustomToken=function(a){var b=this;return this.xa.then(function(){return Gk(b,Q(b.g,Fh,{token:a}))}).then(function(a){a=a.user;Wj(a,"isAnonymous",!1);return b.lb(a)}).then(function(){return U(b)})};h.signInWithEmailAndPassword=function(a,b){var c=this;return this.xa.then(function(){return Gk(c,Q(c.g,Bg,{email:a,password:b}))}).then(function(a){return a.user})};h.createUserWithEmailAndPassword=function(a,b){var c=this;return this.xa.then(function(){return Gk(c,Q(c.g,Bh,{email:a,password:b}))}).then(function(a){return a.user})};
3777
+ h.signInWithCredential=function(a){return this.signInAndRetrieveDataWithCredential(a).then(function(a){return a.user})};h.signInAndRetrieveDataWithCredential=function(a){var b=this;return this.xa.then(function(){return Gk(b,a.Kb(b.g))})};h.signInAnonymously=function(){var a=this;return this.xa.then(function(){var b=U(a);return b&&b.isAnonymous?b:Gk(a,a.g.signInAnonymously()).then(function(b){b=b.user;Wj(b,"isAnonymous",!0);return a.lb(b)}).then(function(){return U(a)})})};h.i=function(){return this.app};
3778
+ var U=function(a){return a.currentUser};T.prototype.getUid=function(){return U(this)&&U(this).uid||null};var Ik=function(a){return U(a)&&U(a)._lat||null};h=T.prototype;h.Ra=function(){if(this.Bc){for(var a=0;a<this.Ha.length;a++)if(this.Ha[a])this.Ha[a](Ik(this));if(this.jc!==this.getUid()&&this.Bb.length)for(this.jc=this.getUid(),a=0;a<this.Bb.length;a++)if(this.Bb[a])this.Bb[a](Ik(this))}};h.df=function(a){this.addAuthTokenListener(a);this.Ma++;0<this.Ma&&U(this)&&Mj(U(this))};
3779
+ h.ag=function(a){var b=this;x(this.Ha,function(c){c==a&&b.Ma--});0>this.Ma&&(this.Ma=0);0==this.Ma&&U(this)&&Nj(U(this));this.removeAuthTokenListener(a)};h.addAuthTokenListener=function(a){var b=this;this.Ha.push(a);this.c(this.xa.then(function(){b.Ba||Wa(b.Ha,a)&&a(Ik(b))}))};h.removeAuthTokenListener=function(a){Za(this.Ha,function(b){return b==a})};var Hk=function(a,b){a.Bb.push(b);a.c(a.xa.then(function(){!a.Ba&&Wa(a.Bb,b)&&a.jc!==a.getUid()&&(a.jc=a.getUid(),b(Ik(a)))}))};h=T.prototype;
3780
+ h["delete"]=function(){this.Ba=!0;for(var a=0;a<this.K.length;a++)this.K[a].cancel("app-deleted");this.K=[];this.ma&&(a=this.ma,a.h.removeListener(ok("local"),a.j,this.pd));this.v&&this.v.unsubscribe(this);return firebase.Promise.resolve()};h.c=function(a){var b=this;this.K.push(a);Ed(a,function(){Ya(b.K,a)});return a};h.fetchProvidersForEmail=function(a){return this.c(fh(this.g,a))};h.verifyPasswordResetCode=function(a){return this.checkActionCode(a).then(function(a){return a.data.email})};
3781
+ h.confirmPasswordReset=function(a,b){return this.c(this.g.confirmPasswordReset(a,b).then(function(){}))};h.checkActionCode=function(a){return this.c(this.g.checkActionCode(a).then(function(a){return new Di(a)}))};h.applyActionCode=function(a){return this.c(this.g.applyActionCode(a).then(function(){}))};h.sendPasswordResetEmail=function(a,b){var c=this;return this.c(E().then(function(){return"undefined"===typeof b||jb(b)?{}:Ai(new zi(b))}).then(function(b){return c.g.sendPasswordResetEmail(a,b)}).then(function(){}))};
3782
+ h.signInWithPhoneNumber=function(a,b){return this.c(Ci(this,a,b,r(this.signInAndRetrieveDataWithCredential,this)))};var Jk="First Second Third Fourth Fifth Sixth Seventh Eighth Ninth".split(" "),V=function(a,b){return{name:a||"",R:"a valid string",optional:!!b,S:m}},Kk=function(){return{name:"opt_forceRefresh",R:"a boolean",optional:!0,S:ca}},W=function(a,b){return{name:a||"",R:"a valid object",optional:!!b,S:q}},Lk=function(a,b){return{name:a||"",R:"a function",optional:!!b,S:p}},Mk=function(a,b){return{name:a||"",R:"null",optional:!!b,S:ha}},Nk=function(){return{name:"",R:"an HTML element",optional:!1,S:function(a){return!!(a&&
3783
+ a instanceof Element)}}},Ok=function(){return{name:"auth",R:"an instance of Firebase Auth",optional:!0,S:function(a){return!!(a&&a instanceof T)}}},Pk=function(){return{name:"app",R:"an instance of Firebase App",optional:!0,S:function(a){return!!(a&&a instanceof firebase.app.App)}}},Qk=function(a){return{name:a?a+"Credential":"credential",R:a?"a valid "+a+" credential":"a valid credential",optional:!1,S:function(b){if(!b)return!1;var c=!a||b.providerId===a;return!(!b.Kb||!c)}}},Rk=function(){return{name:"authProvider",
3784
+ R:"a valid Auth provider",optional:!1,S:function(a){return!!(a&&a.providerId&&a.hasOwnProperty&&a.hasOwnProperty("isOAuthProvider"))}}},Sk=function(){return{name:"applicationVerifier",R:"an implementation of firebase.auth.ApplicationVerifier",optional:!1,S:function(a){return!!(a&&m(a.type)&&p(a.verify))}}},X=function(a,b,c,d){return{name:c||"",R:a.R+" or "+b.R,optional:!!d,S:function(c){return a.S(c)||b.S(c)}}};var Y=function(a,b){for(var c in b){var d=b[c].name;a[d]=Tk(d,a[c],b[c].a)}},Z=function(a,b,c,d){a[b]=Tk(b,c,d)},Tk=function(a,b,c){if(!c)return b;var d=Uk(a);a=function(){var a=Array.prototype.slice.call(arguments);a:{var e=Array.prototype.slice.call(a);var l=0;for(var n=!1,C=0;C<c.length;C++)if(c[C].optional)n=!0;else{if(n)throw new O("internal-error","Argument validator encountered a required argument after an optional argument.");l++}n=c.length;if(e.length<l||n<e.length)e="Expected "+(l==n?1==
3785
+ l?"1 argument":l+" arguments":l+"-"+n+" arguments")+" but got "+e.length+".";else{for(l=0;l<e.length;l++)if(n=c[l].optional&&void 0===e[l],!c[l].S(e[l])&&!n){e=c[l];if(0>l||l>=Jk.length)throw new O("internal-error","Argument validator received an unsupported number of arguments.");e=Jk[l]+" argument "+(e.name?'"'+e.name+'" ':"")+"must be "+e.R+".";break a}e=null}}if(e)throw new O("argument-error",d+" failed: "+e);return b.apply(this,a)};for(var e in b)a[e]=b[e];for(e in b.prototype)a.prototype[e]=
3786
+ b.prototype[e];return a},Uk=function(a){a=a.split(".");return a[a.length-1]};Y(T.prototype,{applyActionCode:{name:"applyActionCode",a:[V("code")]},checkActionCode:{name:"checkActionCode",a:[V("code")]},confirmPasswordReset:{name:"confirmPasswordReset",a:[V("code"),V("newPassword")]},createUserWithEmailAndPassword:{name:"createUserWithEmailAndPassword",a:[V("email"),V("password")]},fetchProvidersForEmail:{name:"fetchProvidersForEmail",a:[V("email")]},getRedirectResult:{name:"getRedirectResult",a:[]},onAuthStateChanged:{name:"onAuthStateChanged",a:[X(W(),Lk(),"nextOrObserver"),
3787
+ Lk("opt_error",!0),Lk("opt_completed",!0)]},onIdTokenChanged:{name:"onIdTokenChanged",a:[X(W(),Lk(),"nextOrObserver"),Lk("opt_error",!0),Lk("opt_completed",!0)]},sendPasswordResetEmail:{name:"sendPasswordResetEmail",a:[V("email"),X(W("opt_actionCodeSettings",!0),Mk(null,!0),"opt_actionCodeSettings",!0)]},Sd:{name:"setPersistence",a:[V("persistence")]},signInAndRetrieveDataWithCredential:{name:"signInAndRetrieveDataWithCredential",a:[Qk()]},signInAnonymously:{name:"signInAnonymously",a:[]},signInWithCredential:{name:"signInWithCredential",
3788
+ a:[Qk()]},signInWithCustomToken:{name:"signInWithCustomToken",a:[V("token")]},signInWithEmailAndPassword:{name:"signInWithEmailAndPassword",a:[V("email"),V("password")]},signInWithPhoneNumber:{name:"signInWithPhoneNumber",a:[V("phoneNumber"),Sk()]},signInWithPopup:{name:"signInWithPopup",a:[Rk()]},signInWithRedirect:{name:"signInWithRedirect",a:[Rk()]},signOut:{name:"signOut",a:[]},toJSON:{name:"toJSON",a:[V(null,!0)]},verifyPasswordResetCode:{name:"verifyPasswordResetCode",a:[V("code")]}});
3789
+ T.Persistence=Ni;T.Persistence.LOCAL="local";T.Persistence.SESSION="session";T.Persistence.NONE="none";
3790
+ Y(S.prototype,{"delete":{name:"delete",a:[]},getIdToken:{name:"getIdToken",a:[Kk()]},getToken:{name:"getToken",a:[Kk()]},linkAndRetrieveDataWithCredential:{name:"linkAndRetrieveDataWithCredential",a:[Qk()]},linkWithCredential:{name:"linkWithCredential",a:[Qk()]},linkWithPhoneNumber:{name:"linkWithPhoneNumber",a:[V("phoneNumber"),Sk()]},linkWithPopup:{name:"linkWithPopup",a:[Rk()]},linkWithRedirect:{name:"linkWithRedirect",a:[Rk()]},reauthenticateAndRetrieveDataWithCredential:{name:"reauthenticateAndRetrieveDataWithCredential",
3791
+ a:[Qk()]},reauthenticateWithCredential:{name:"reauthenticateWithCredential",a:[Qk()]},reauthenticateWithPhoneNumber:{name:"reauthenticateWithPhoneNumber",a:[V("phoneNumber"),Sk()]},reauthenticateWithPopup:{name:"reauthenticateWithPopup",a:[Rk()]},reauthenticateWithRedirect:{name:"reauthenticateWithRedirect",a:[Rk()]},reload:{name:"reload",a:[]},sendEmailVerification:{name:"sendEmailVerification",a:[X(W("opt_actionCodeSettings",!0),Mk(null,!0),"opt_actionCodeSettings",!0)]},toJSON:{name:"toJSON",a:[V(null,
3792
+ !0)]},unlink:{name:"unlink",a:[V("provider")]},updateEmail:{name:"updateEmail",a:[V("email")]},updatePassword:{name:"updatePassword",a:[V("password")]},updatePhoneNumber:{name:"updatePhoneNumber",a:[Qk("phone")]},updateProfile:{name:"updateProfile",a:[W("profile")]}});Y(D.prototype,{f:{name:"catch"},then:{name:"then"}});Y(Bi.prototype,{confirm:{name:"confirm",a:[V("verificationCode")]}});Z(Dg,"credential",function(a,b){return new Ag(a,b)},[V("email"),V("password")]);
3793
+ Y(sg.prototype,{addScope:{name:"addScope",a:[V("scope")]},setCustomParameters:{name:"setCustomParameters",a:[W("customOAuthParameters")]}});Z(sg,"credential",tg,[X(V(),W(),"token")]);Y(ug.prototype,{addScope:{name:"addScope",a:[V("scope")]},setCustomParameters:{name:"setCustomParameters",a:[W("customOAuthParameters")]}});Z(ug,"credential",vg,[X(V(),W(),"token")]);Y(wg.prototype,{addScope:{name:"addScope",a:[V("scope")]},setCustomParameters:{name:"setCustomParameters",a:[W("customOAuthParameters")]}});
3794
+ Z(wg,"credential",xg,[X(V(),X(W(),Mk()),"idToken"),X(V(),Mk(),"accessToken",!0)]);Y(yg.prototype,{setCustomParameters:{name:"setCustomParameters",a:[W("customOAuthParameters")]}});Z(yg,"credential",zg,[X(V(),W(),"token"),V("secret",!0)]);Y(P.prototype,{addScope:{name:"addScope",a:[V("scope")]},credential:{name:"credential",a:[X(V(),Mk(),"idToken",!0),X(V(),Mk(),"accessToken",!0)]},setCustomParameters:{name:"setCustomParameters",a:[W("customOAuthParameters")]}});
3795
+ Z(Ig,"credential",Kg,[V("verificationId"),V("verificationCode")]);Y(Ig.prototype,{verifyPhoneNumber:{name:"verifyPhoneNumber",a:[V("phoneNumber"),Sk()]}});Y(O.prototype,{toJSON:{name:"toJSON",a:[V(null,!0)]}});Y(Ng.prototype,{toJSON:{name:"toJSON",a:[V(null,!0)]}});Y(jg.prototype,{toJSON:{name:"toJSON",a:[V(null,!0)]}});Y(Yh.prototype,{clear:{name:"clear",a:[]},render:{name:"render",a:[]},verify:{name:"verify",a:[]}});
3796
+ (function(){if("undefined"!==typeof firebase&&firebase.INTERNAL&&firebase.INTERNAL.registerService){var a={Auth:T,Error:O};Z(a,"EmailAuthProvider",Dg,[]);Z(a,"FacebookAuthProvider",sg,[]);Z(a,"GithubAuthProvider",ug,[]);Z(a,"GoogleAuthProvider",wg,[]);Z(a,"TwitterAuthProvider",yg,[]);Z(a,"OAuthProvider",P,[V("providerId")]);Z(a,"PhoneAuthProvider",Ig,[Ok()]);Z(a,"RecaptchaVerifier",Yh,[X(V(),Nk(),"recaptchaContainer"),W("recaptchaParameters",!0),Pk()]);firebase.INTERNAL.registerService("auth",function(a,
3797
+ c){a=new T(a);c({INTERNAL:{getUid:r(a.getUid,a),getToken:r(a.xf,a),addAuthTokenListener:r(a.df,a),removeAuthTokenListener:r(a.ag,a)}});return a},a,function(a,c){if("create"===a)try{c.auth()}catch(d){}});firebase.INTERNAL.extendNamespace({User:S})}else throw Error("Cannot find the firebase namespace; be sure to include firebase-app.js before this library.");})();}).call(this);
3798
+
3799
+ try{webpackJsonpFirebase([0],[function(t,e,n){"use strict";n.d(e,"a",function(){return i}),n.d(e,"b",function(){return o});var r=n(7),i=function(t,e){if(!t)throw o(e)},o=function(t){return Error("Firebase Database ("+r.a.SDK_VERSION+") INTERNAL ASSERT FAILED: "+t)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(14),i=function(t){for(var e=[],n=0,r=0;r<t.length;r++){for(var i=t.charCodeAt(r);i>255;)e[n++]=255&i,i>>=8;e[n++]=i}return e},o=function(t){if(t.length<8192)return String.fromCharCode.apply(null,t);for(var e="",n=0;n<t.length;n+=8192){var r=t.slice(n,n+8192);e+=String.fromCharCode.apply(null,r)}return e},s={_:null,O:null,S:null,T:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:"function"==typeof r.a.atob,encodeByteArray:function(t,e){if(!Array.isArray(t))throw Error("encodeByteArray takes an array as a parameter");this.N();for(var n=e?this.S:this._,r=[],i=0;i<t.length;i+=3){var o=t[i],s=i+1<t.length,a=s?t[i+1]:0,u=i+2<t.length,c=u?t[i+2]:0,h=o>>2,l=(3&o)<<4|a>>4,p=(15&a)<<2|c>>6,d=63&c;u||(d=64,s||(p=64)),r.push(n[h],n[l],n[p],n[d])}return r.join("")},encodeString:function(t,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(t):this.encodeByteArray(i(t),e)},decodeString:function(t,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(t):o(this.decodeStringToByteArray(t,e))},decodeStringToByteArray:function(t,e){this.N();for(var n=e?this.T:this.O,r=[],i=0;i<t.length;){var o=n[t.charAt(i++)],s=i<t.length,a=s?n[t.charAt(i)]:0;++i;var u=i<t.length,c=u?n[t.charAt(i)]:64;++i;var h=i<t.length,l=h?n[t.charAt(i)]:64;if(++i,null==o||null==a||null==c||null==l)throw Error();var p=o<<2|a>>4;if(r.push(p),64!=c){var d=a<<4&240|c>>2;if(r.push(d),64!=l){var f=c<<6&192|l;r.push(f)}}}return r},N:function(){if(!this._){this._={},this.O={},this.S={},this.T={};for(var t=0;t<this.ENCODED_VALS.length;t++)this._[t]=this.ENCODED_VALS.charAt(t),this.O[this._[t]]=t,this.S[t]=this.ENCODED_VALS_WEBSAFE.charAt(t),this.T[this.S[t]]=t,t>=this.ENCODED_VALS_BASE.length&&(this.O[this.ENCODED_VALS_WEBSAFE.charAt(t)]=t,this.T[this.ENCODED_VALS.charAt(t)]=t)}}},a=function(){function t(){this.blockSize=-1}return t}(),u=this&&this.I||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),c=function(t){function e(){var e=t.call(this)||this;e.P=[],e.R=[],e.D=[],e.F=[],e.L=0,e.M=0,e.blockSize=64,e.F[0]=128;for(var n=1;n<e.blockSize;++n)e.F[n]=0;return e.reset(),e}return u(e,t),e.prototype.reset=function(){this.P[0]=1732584193,this.P[1]=4023233417,this.P[2]=2562383102,this.P[3]=271733878,this.P[4]=3285377520,this.L=0,this.M=0},e.prototype.W=function(t,e){e||(e=0);var n=this.D;if("string"==typeof t)for(var r=0;r<16;r++)n[r]=t.charCodeAt(e)<<24|t.charCodeAt(e+1)<<16|t.charCodeAt(e+2)<<8|t.charCodeAt(e+3),e+=4;else for(var r=0;r<16;r++)n[r]=t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3],e+=4;for(var r=16;r<80;r++){var i=n[r-3]^n[r-8]^n[r-14]^n[r-16];n[r]=4294967295&(i<<1|i>>>31)}for(var o,s,a=this.P[0],u=this.P[1],c=this.P[2],h=this.P[3],l=this.P[4],r=0;r<80;r++){r<40?r<20?(o=h^u&(c^h),s=1518500249):(o=u^c^h,s=1859775393):r<60?(o=u&c|h&(u|c),s=2400959708):(o=u^c^h,s=3395469782);var i=(a<<5|a>>>27)+o+l+s+n[r]&4294967295;l=h,h=c,c=4294967295&(u<<30|u>>>2),u=a,a=i}this.P[0]=this.P[0]+a&4294967295,this.P[1]=this.P[1]+u&4294967295,this.P[2]=this.P[2]+c&4294967295,this.P[3]=this.P[3]+h&4294967295,this.P[4]=this.P[4]+l&4294967295},e.prototype.update=function(t,e){if(null!=t){void 0===e&&(e=t.length);for(var n=e-this.blockSize,r=0,i=this.R,o=this.L;r<e;){if(0==o)for(;r<=n;)this.W(t,r),r+=this.blockSize;if("string"==typeof t){for(;r<e;)if(i[o]=t.charCodeAt(r),++o,++r,o==this.blockSize){this.W(i),o=0;break}}else for(;r<e;)if(i[o]=t[r],++o,++r,o==this.blockSize){this.W(i),o=0;break}}this.L=o,this.M+=e}},e.prototype.digest=function(){var t=[],e=8*this.M;this.L<56?this.update(this.F,56-this.L):this.update(this.F,this.blockSize-(this.L-56));for(var n=this.blockSize-1;n>=56;n--)this.R[n]=255&e,e/=256;this.W(this.R);for(var r=0,n=0;n<5;n++)for(var i=24;i>=0;i-=8)t[r]=this.P[n]>>i&255,++r;return t},e}(a);n.d(e,"a",function(){return g}),n.d(e,"f",function(){return m}),n.d(e,"e",function(){return b}),n.d(e,"y",function(){return C}),n.d(e,"u",function(){return w}),n.d(e,"j",function(){return S}),n.d(e,"s",function(){return T}),n.d(e,"t",function(){return N}),n.d(e,"k",function(){return I}),n.d(e,"o",function(){return P}),n.d(e,"B",function(){return R}),n.d(e,"C",function(){return D}),n.d(e,"q",function(){return j}),n.d(e,"n",function(){return x}),n.d(e,"c",function(){return k}),n.d(e,"b",function(){return F}),n.d(e,"v",function(){return A}),n.d(e,"A",function(){return L}),n.d(e,"w",function(){return M}),n.d(e,"d",function(){return W}),n.d(e,"z",function(){return q}),n.d(e,"i",function(){return Q}),n.d(e,"h",function(){return U}),n.d(e,"p",function(){return V}),n.d(e,"r",function(){return B}),n.d(e,"l",function(){return H}),n.d(e,"m",function(){return z}),n.d(e,"g",function(){return G}),n.d(e,"x",function(){return X});var h,l=n(0),p=n(2),d=n(11),f=n(3),_=n(8),y=n(6),v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},g=function(){var t=1;return function(){return t++}}(),m=function(t){var e=Object(d.b)(t);return s.encodeByteArray(e,!0)},b=function(t){try{return h?new h(t,"base64").toString("utf8"):s.decodeString(t,!0)}catch(t){T("base64Decode failed: ",t)}return null},C=function(t){var e=Object(d.b)(t),n=new c;n.update(e);var r=n.digest();return s.encodeByteArray(r)},E=function t(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];for(var r="",i=0;i<e.length;i++)Array.isArray(e[i])||e[i]&&"object"===v(e[i])&&"number"==typeof e[i].length?r+=t.apply(null,e[i]):"object"===v(e[i])?r+=Object(f.b)(e[i]):r+=e[i],r+=" ";return r},w=null,O=!0,S=function(t,e){Object(l.a)(!e||!0===t||!1===t,"Can't turn on custom loggers persistently."),!0===t?("undefined"!=typeof console&&("function"==typeof console.log?w=console.log.bind(console):"object"===v(console.log)&&(w=function(t){console.log(t)})),e&&_.b.set("logging_enabled",!0)):"function"==typeof t?w=t:(w=null,_.b.remove("logging_enabled"))},T=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(!0===O&&(O=!1,null===w&&!0===_.b.get("logging_enabled")&&S(!0)),w){var n=E.apply(null,t);w(n)}},N=function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];T.apply(void 0,[t].concat(e))}},I=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if("undefined"!=typeof console){var n="FIREBASE INTERNAL ERROR: "+E.apply(void 0,t);void 0!==console.error?console.error(n):console.log(n)}},P=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=E.apply(void 0,t);throw Error("FIREBASE FATAL ERROR: "+n)},R=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if("undefined"!=typeof console){var n="FIREBASE WARNING: "+E.apply(void 0,t);void 0!==console.warn?console.warn(n):console.log(n)}},D=function(){"undefined"!=typeof window&&window.location&&window.location.protocol&&-1!==window.location.protocol.indexOf("https:")&&R("Insecure Firebase access from a secure page. Please use https in calls to new Firebase().")},j=function(t){return"number"==typeof t&&(t!=t||t==Number.POSITIVE_INFINITY||t==Number.NEGATIVE_INFINITY)},x=function(t){if(Object(y.b)()||"complete"===document.readyState)t();else{var e=!1,n=function n(){if(!document.body)return void setTimeout(n,Math.floor(10));e||(e=!0,t())};document.addEventListener?(document.addEventListener("DOMContentLoaded",n,!1),window.addEventListener("load",n,!1)):document.attachEvent&&(document.attachEvent("onreadystatechange",function(){"complete"===document.readyState&&n()}),window.attachEvent("onload",n))}},k="[MIN_NAME]",F="[MAX_NAME]",A=function(t,e){if(t===e)return 0;if(t===k||e===F)return-1;if(e===k||t===F)return 1;var n=Y(t),r=Y(e);return null!==n?null!==r?n-r==0?t.length-e.length:n-r:-1:null!==r?1:t<e?-1:1},L=function(t,e){return t===e?0:t<e?-1:1},M=function(t,e){if(e&&t in e)return e[t];throw Error("Missing required key ("+t+") in object: "+Object(f.b)(e))},W=function t(e){if("object"!==(void 0===e?"undefined":v(e))||null===e)return Object(f.b)(e);var n=[];for(var r in e)n.push(r);n.sort();for(var i="{",o=0;o<n.length;o++)0!==o&&(i+=","),i+=Object(f.b)(n[o]),i+=":",i+=t(e[n[o]]);return i+="}"},q=function(t,e){var n=t.length;if(n<=e)return[t];for(var r=[],i=0;i<n;i+=e)i+e>n?r.push(t.substring(i,n)):r.push(t.substring(i,i+e));return r},Q=function(t,e){if(Array.isArray(t))for(var n=0;n<t.length;++n)e(n,t[n]);else Object(p.f)(t,function(t,n){return e(n,t)})},U=function(t){Object(l.a)(!j(t),"Invalid JSON number");var e,n,r,i,o,s,a;for(0===t?(n=0,r=0,e=1/t==-1/0?1:0):(e=t<0,t=Math.abs(t),t>=Math.pow(2,-1022)?(i=Math.min(Math.floor(Math.log(t)/Math.LN2),1023),n=i+1023,r=Math.round(t*Math.pow(2,52-i)-Math.pow(2,52))):(n=0,r=Math.round(t/Math.pow(2,-1074)))),s=[],o=52;o;o-=1)s.push(r%2?1:0),r=Math.floor(r/2);for(o=11;o;o-=1)s.push(n%2?1:0),n=Math.floor(n/2);s.push(e?1:0),s.reverse(),a=s.join("");var u="";for(o=0;o<64;o+=8){var c=parseInt(a.substr(o,8),2).toString(16);1===c.length&&(c="0"+c),u+=c}return u.toLowerCase()},V=function(){return!("object"!==("undefined"==typeof window?"undefined":v(window))||!window.chrome||!window.chrome.extension||/^chrome/.test(window.location.href))},B=function(){return"object"===("undefined"==typeof Windows?"undefined":v(Windows))&&"object"===v(Windows.UI)},H=function(t,e){var n="Unknown Error";"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");var r=Error(t+" at "+e.path+": "+n);return r.code=t.toUpperCase(),r},K=RegExp("^-?\\d{1,10}$"),Y=function(t){if(K.test(t)){var e=+t;if(e>=-2147483648&&e<=2147483647)return e}return null},z=function(t){try{t()}catch(t){setTimeout(function(){var e=t.stack||"";throw R("Exception was thrown by user callback.",e),t},Math.floor(0))}},G=function(){return("object"===("undefined"==typeof window?"undefined":v(window))&&window.navigator&&window.navigator.userAgent||"").search(/googlebot|google webmaster tools|bingbot|yahoo! slurp|baiduspider|yandexbot|duckduckbot/i)>=0},X=function(t,e){var n=setTimeout(t,e);return"object"===(void 0===n?"undefined":v(n))&&n.unref&&n.unref(),n}},function(t,e,n){"use strict";n.d(e,"b",function(){return r}),n.d(e,"l",function(){return i}),n.d(e,"f",function(){return o}),n.d(e,"a",function(){return a}),n.d(e,"j",function(){return u}),n.d(e,"h",function(){return c}),n.d(e,"k",function(){return h}),n.d(e,"d",function(){return l}),n.d(e,"e",function(){return p}),n.d(e,"g",function(){return d}),n.d(e,"i",function(){return f}),n.d(e,"c",function(){return _});var r=("function"==typeof Symbol&&Symbol.iterator,function(t,e){return Object.prototype.hasOwnProperty.call(t,e)}),i=function(t,e){if(Object.prototype.hasOwnProperty.call(t,e))return t[e]},o=function(t,e){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e(n,t[n])},s=function(t,e){return o(e,function(e,n){t[e]=n}),t},a=function(t){return s({},t)},u=function(t){for(var e in t)return!1;return!0},c=function(t){var e=0;for(var n in t)e++;return e},h=function(t,e,n){var r={};for(var i in t)r[i]=e.call(n,t[i],i,t);return r},l=function(t,e,n){for(var r in t)if(e.call(n,t[r],r,t))return r},p=function(t,e,n){var r=l(t,e,n);return r&&t[r]},d=function(t){for(var e in t)return e},f=function(t){var e=[],n=0;for(var r in t)e[n++]=t[r];return e},_=function(t,e){for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&!e(n,t[n]))return!1;return!0}},function(t,e,n){"use strict";n.d(e,"a",function(){return r}),n.d(e,"b",function(){return i});var r=function(t){return JSON.parse(t)},i=function(t){return JSON.stringify(t)}},,,function(t,e,n){"use strict";n.d(e,"a",function(){return s}),n.d(e,"c",function(){return a}),n.d(e,"b",function(){return u});var r=n(7),i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o=function(){return"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:""},s=function(){return"undefined"!=typeof window&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(o())},a=function(){return"object"===("undefined"==typeof navigator?"undefined":i(navigator))&&"ReactNative"===navigator.product},u=function(){return!0===r.a.NODE_CLIENT||!0===r.a.NODE_ADMIN}},function(t,e,n){"use strict";n.d(e,"a",function(){return r});var r={NODE_CLIENT:!1,NODE_ADMIN:!1,SDK_VERSION:"4.2.0"}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(3),i=function(){function t(t){this.Q=t,this.U="firebase:"}return t.prototype.set=function(t,e){null==e?this.Q.removeItem(this.V(t)):this.Q.setItem(this.V(t),Object(r.b)(e))},t.prototype.get=function(t){var e=this.Q.getItem(this.V(t));return null==e?null:Object(r.a)(e)},t.prototype.remove=function(t){this.Q.removeItem(this.V(t))},t.prototype.V=function(t){return this.U+t},t.prototype.toString=function(){return""+this.Q},t}(),o=n(2),s=function(){function t(){this.H={},this.isInMemoryStorage=!0}return t.prototype.set=function(t,e){null==e?delete this.H[t]:this.H[t]=e},t.prototype.get=function(t){return Object(o.b)(this.H,t)?this.H[t]:null},t.prototype.remove=function(t){delete this.H[t]},t}();n.d(e,"a",function(){return u}),n.d(e,"b",function(){return c});var a=function(t){try{if("undefined"!=typeof window&&void 0!==window[t]){var e=window[t];return e.setItem("firebase:sentinel","cache"),e.removeItem("firebase:sentinel"),new i(e)}}catch(t){}return new s},u=a("localStorage"),c=a("sessionStorage")},function(t,e,n){"use strict";n.d(e,"e",function(){return r}),n.d(e,"h",function(){return i}),n.d(e,"g",function(){return o}),n.d(e,"f",function(){return s}),n.d(e,"b",function(){return a}),n.d(e,"a",function(){return u}),n.d(e,"c",function(){return c}),n.d(e,"i",function(){return h}),n.d(e,"d",function(){return l});var r="5",i="v",o="s",s="r",a="f",u="firebaseio.com",c="ls",h="websocket",l="long_polling"},,function(t,e,n){"use strict";n.d(e,"b",function(){return i}),n.d(e,"a",function(){return o});var r=n(0),i=function(t){for(var e=[],n=0,i=0;i<t.length;i++){var o=t.charCodeAt(i);if(o>=55296&&o<=56319){var s=o-55296;i++,Object(r.a)(i<t.length,"Surrogate pair missing trail surrogate."),o=65536+(s<<10)+(t.charCodeAt(i)-56320)}o<128?e[n++]=o:o<2048?(e[n++]=o>>6|192,e[n++]=63&o|128):o<65536?(e[n++]=o>>12|224,e[n++]=o>>6&63|128,e[n++]=63&o|128):(e[n++]=o>>18|240,e[n++]=o>>12&63|128,e[n++]=o>>6&63|128,e[n++]=63&o|128)}return e},o=function(t){for(var e=0,n=0;n<t.length;n++){var r=t.charCodeAt(n);r<128?e++:r<2048?e+=2:r>=55296&&r<=56319?(e+=4,n++):e+=3}return e}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(17),i=n(2),o=function(){function t(){this.K={}}return t.prototype.incrementCounter=function(t,e){void 0===e&&(e=1),Object(i.b)(this.K,t)||(this.K[t]=0),this.K[t]+=e},t.prototype.get=function(){return Object(r.a)(this.K)},t}();n.d(e,"a",function(){return s});var s=function(){function t(){}return t.getCollection=function(t){var e=""+t;return this.Y[e]||(this.Y[e]=new o),this.Y[e]},t.getOrCreateReporter=function(t,e){var n=""+t;return this.G[n]||(this.G[n]=e()),this.G[n]},t.Y={},t.G={},t}()},,,,,,function(t,e,n){"use strict";(function(t){n.d(e,"a",function(){return d});var r=n(5),i=n(0),o=n(1),s=n(12),a=n(9),u=n(7),c=n(8),h=n(3),l=n(6),p=null;"undefined"!=typeof MozWebSocket?p=MozWebSocket:"undefined"!=typeof WebSocket&&(p=WebSocket);var d=function(){function e(t,n,r,i){this.connId=t,this.keepaliveTimer=null,this.frames=null,this.totalFrames=0,this.bytesSent=0,this.bytesReceived=0,this.X=Object(o.t)(this.connId),this.$=s.a.getCollection(n),this.connURL=e.J(n,r,i)}return e.J=function(t,e,n){var r={};return r[a.h]=a.e,!Object(l.b)()&&"undefined"!=typeof location&&location.href&&-1!==location.href.indexOf(a.a)&&(r[a.f]=a.b),e&&(r[a.g]=e),n&&(r[a.c]=n),t.connectionURL(a.i,r)},e.prototype.open=function(e,n){var i=this;this.onDisconnect=n,this.onMessage=e,this.X("Websocket connecting to "+this.connURL),this.Z=!1,c.a.set("previous_websocket_failure",!0);try{if(Object(l.b)()){var o=u.a.NODE_ADMIN?"AdminNode":"Node",s={headers:{"User-Agent":"Firebase/"+a.e+"/"+r.default.SDK_VERSION+"/"+t.platform+"/"+o}},h=t.env,d=0==this.connURL.indexOf("wss://")?h.HTTPS_PROXY||h.https_proxy:h.HTTP_PROXY||h.http_proxy;d&&(s.proxy={origin:d}),this.mySock=new p(this.connURL,[],s)}else this.mySock=new p(this.connURL)}catch(t){this.X("Error instantiating WebSocket.");var f=t.message||t.data;return f&&this.X(f),void this.tt()}this.mySock.onopen=function(){i.X("Websocket connected."),i.Z=!0},this.mySock.onclose=function(){i.X("Websocket connection was disconnected."),i.mySock=null,i.tt()},this.mySock.onmessage=function(t){i.handleIncomingFrame(t)},this.mySock.onerror=function(t){i.X("WebSocket error. Closing connection.");var e=t.message||t.data;e&&i.X(e),i.tt()}},e.prototype.start=function(){},e.forceDisallow=function(){e.et=!0},e.isAvailable=function(){var t=!1;if("undefined"!=typeof navigator&&navigator.userAgent){var n=/Android ([0-9]{0,}\.[0-9]{0,})/,r=navigator.userAgent.match(n);r&&r.length>1&&parseFloat(r[1])<4.4&&(t=!0)}return!t&&null!==p&&!e.et},e.previouslyFailed=function(){return c.a.isInMemoryStorage||!0===c.a.get("previous_websocket_failure")},e.prototype.markConnectionHealthy=function(){c.a.remove("previous_websocket_failure")},e.prototype.nt=function(t){if(this.frames.push(t),this.frames.length==this.totalFrames){var e=this.frames.join("");this.frames=null;var n=Object(h.a)(e);this.onMessage(n)}},e.prototype.rt=function(t){this.totalFrames=t,this.frames=[]},e.prototype.it=function(t){if(Object(i.a)(null===this.frames,"We already have a frame buffer"),t.length<=6){var e=+t;if(!isNaN(e))return this.rt(e),null}return this.rt(1),t},e.prototype.handleIncomingFrame=function(t){if(null!==this.mySock){var e=t.data;if(this.bytesReceived+=e.length,this.$.incrementCounter("bytes_received",e.length),this.resetKeepAlive(),null!==this.frames)this.nt(e);else{var n=this.it(e);null!==n&&this.nt(n)}}},e.prototype.send=function(t){this.resetKeepAlive();var e=Object(h.b)(t);this.bytesSent+=e.length,this.$.incrementCounter("bytes_sent",e.length);var n=Object(o.z)(e,16384);n.length>1&&this.ot(n.length+"");for(var r=0;r<n.length;r++)this.ot(n[r])},e.prototype.st=function(){this.ut=!0,this.keepaliveTimer&&(clearInterval(this.keepaliveTimer),this.keepaliveTimer=null),this.mySock&&(this.mySock.close(),this.mySock=null)},e.prototype.tt=function(){this.ut||(this.X("WebSocket is closing itself"),this.st(),this.onDisconnect&&(this.onDisconnect(this.Z),this.onDisconnect=null))},e.prototype.close=function(){this.ut||(this.X("WebSocket is being closed"),this.st())},e.prototype.resetKeepAlive=function(){var t=this;clearInterval(this.keepaliveTimer),this.keepaliveTimer=setInterval(function(){t.mySock&&t.ot("0"),t.resetKeepAlive()},Math.floor(45e3))},e.prototype.ot=function(t){try{this.mySock.send(t)}catch(t){this.X("Exception thrown from WebSocket.send():",t.message||t.data,"Closing connection."),setTimeout(this.tt.bind(this),0)}},e.responsesRequiredToBeHealthy=2,e.healthyTimeout=3e4,e}()}).call(e,n(16))},,,,,,,function(t,e,n){"use strict";function r(t){for(var e="",n=t.split("/"),r=0;r<n.length;r++)if(n[r].length>0){var i=n[r];try{i=decodeURIComponent(i.replace(/\+/g," "))}catch(t){}e+="/"+i}return e}function i(t,e,n){var r="";switch(e){case 1:r=n?"first":"First";break;case 2:r=n?"second":"Second";break;case 3:r=n?"third":"Third";break;case 4:r=n?"fourth":"Fourth";break;default:throw Error("errorPrefix called with argumentNumber > 4. Need to update it?")}var i=t+" failed: ";return i+=r+" argument "}function o(t,e){return Object(Wt.v)(t.name,e.name)}function s(t,e){return Object(Wt.v)(t,e)}function a(t,e){if(void 0===e&&(e=null),null===t)return Vt.EMPTY_NODE;if("object"===(void 0===t?"undefined":zt(t))&&".priority"in t&&(e=t[".priority"]),Object(Yt.a)(null===e||"string"==typeof e||"number"==typeof e||"object"===(void 0===e?"undefined":zt(e))&&".sv"in e,"Invalid priority type found: "+(void 0===e?"undefined":zt(e))),"object"===(void 0===t?"undefined":zt(t))&&".value"in t&&null!==t[".value"]&&(t=t[".value"]),"object"!==(void 0===t?"undefined":zt(t))||".sv"in t)return new wt(t,a(e));if(t instanceof Array||!Gt){var n=Vt.EMPTY_NODE,r=t;return Object(Kt.f)(r,function(t,e){if(Object(Kt.b)(r,t)&&"."!==t.substring(0,1)){var i=a(e);!i.isLeafNode()&&i.isEmpty()||(n=n.updateImmediateChild(t,i))}}),n.updatePriority(a(e))}var i=[],u=!1,c=t;if(Object(Kt.f)(c,function(t,e){if("string"!=typeof t||"."!==t.substring(0,1)){var n=a(c[t]);n.isEmpty()||(u=u||!n.getPriority().isEmpty(),i.push(new st(t,n)))}}),0==i.length)return Vt.EMPTY_NODE;var h=kt(i,o,function(t){return t.name},s);if(u){var l=kt(i,Nt.getCompare());return new Vt(h,a(e),new Mt({".priority":l},{".priority":Nt}))}return new Vt(h,a(e),Mt.Default)}Object.defineProperty(e,"__esModule",{value:!0});var u,c,h,l,p,d,f,_=n(1),y=n(11),v=function(){function t(t,e){if(void 0===e){this.ct=t.split("/");for(var n=0,r=0;r<this.ct.length;r++)this.ct[r].length>0&&(this.ct[n]=this.ct[r],n++);this.ct.length=n,this.ht=0}else this.ct=t,this.ht=e}return Object.defineProperty(t,"Empty",{get:function(){return new t("")},enumerable:!0,configurable:!0}),t.prototype.getFront=function(){return this.ht>=this.ct.length?null:this.ct[this.ht]},t.prototype.getLength=function(){return this.ct.length-this.ht},t.prototype.popFront=function(){var e=this.ht;return e<this.ct.length&&e++,new t(this.ct,e)},t.prototype.getBack=function(){return this.ht<this.ct.length?this.ct[this.ct.length-1]:null},t.prototype.toString=function(){for(var t="",e=this.ht;e<this.ct.length;e++)""!==this.ct[e]&&(t+="/"+this.ct[e]);return t||"/"},t.prototype.toUrlEncodedString=function(){for(var t="",e=this.ht;e<this.ct.length;e++)""!==this.ct[e]&&(t+="/"+encodeURIComponent(this.ct[e]+""));return t||"/"},t.prototype.slice=function(t){return void 0===t&&(t=0),this.ct.slice(this.ht+t)},t.prototype.parent=function(){if(this.ht>=this.ct.length)return null;for(var e=[],n=this.ht;n<this.ct.length-1;n++)e.push(this.ct[n]);return new t(e,0)},t.prototype.child=function(e){for(var n=[],r=this.ht;r<this.ct.length;r++)n.push(this.ct[r]);if(e instanceof t)for(var r=e.ht;r<e.ct.length;r++)n.push(e.ct[r]);else for(var i=e.split("/"),r=0;r<i.length;r++)i[r].length>0&&n.push(i[r]);return new t(n,0)},t.prototype.isEmpty=function(){return this.ht>=this.ct.length},t.relativePath=function(e,n){var r=e.getFront(),i=n.getFront();if(null===r)return n;if(r===i)return t.relativePath(e.popFront(),n.popFront());throw Error("INTERNAL ERROR: innerPath ("+n+") is not within outerPath ("+e+")")},t.comparePaths=function(t,e){for(var n=t.slice(),r=e.slice(),i=0;i<n.length&&i<r.length;i++){var o=Object(_.v)(n[i],r[i]);if(0!==o)return o}return n.length===r.length?0:n.length<r.length?-1:1},t.prototype.equals=function(t){if(this.getLength()!==t.getLength())return!1;for(var e=this.ht,n=t.ht;e<=this.ct.length;e++,n++)if(this.ct[e]!==t.ct[n])return!1;return!0},t.prototype.contains=function(t){var e=this.ht,n=t.ht;if(this.getLength()>t.getLength())return!1;for(;e<this.ct.length;){if(this.ct[e]!==t.ct[n])return!1;++e,++n}return!0},t}(),g=function(){function t(t,e){this.lt=e,this.pt=t.slice(),this.dt=Math.max(1,this.pt.length);for(var n=0;n<this.pt.length;n++)this.dt+=Object(y.a)(this.pt[n]);this.ft()}return Object.defineProperty(t,"MAX_PATH_DEPTH",{get:function(){return 32},enumerable:!0,configurable:!0}),Object.defineProperty(t,"MAX_PATH_LENGTH_BYTES",{get:function(){return 768},enumerable:!0,configurable:!0}),t.prototype.push=function(t){this.pt.length>0&&(this.dt+=1),this.pt.push(t),this.dt+=Object(y.a)(t),this.ft()},t.prototype.pop=function(){var t=this.pt.pop();this.dt-=Object(y.a)(t),this.pt.length>0&&(this.dt-=1)},t.prototype.ft=function(){if(this.dt>t.MAX_PATH_LENGTH_BYTES)throw Error(this.lt+"has a key path longer than "+t.MAX_PATH_LENGTH_BYTES+" bytes ("+this.dt+").");if(this.pt.length>t.MAX_PATH_DEPTH)throw Error(this.lt+"path specified exceeds the maximum depth that can be written ("+t.MAX_PATH_DEPTH+") or object contains a cycle "+this.toErrorString())},t.prototype.toErrorString=function(){return 0==this.pt.length?"":"in property '"+this.pt.join(".")+"'"},t}(),m=n(0),b=n(2),C=n(8),E=n(9),w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},O=function(){function t(t,e,n,r,i){void 0===i&&(i=""),this.secure=e,this.namespace=n,this.webSocketOnly=r,this.persistenceKey=i,this.host=t.toLowerCase(),this.domain=this.host.substr(this.host.indexOf(".")+1),this.internalHost=C.a.get("host:"+t)||this.host}return t.prototype.needsQueryParam=function(){return this.host!==this.internalHost},t.prototype.isCacheableHost=function(){return"s-"===this.internalHost.substr(0,2)},t.prototype.isDemoHost=function(){return"firebaseio-demo.com"===this.domain},t.prototype.isCustomHost=function(){return"firebaseio.com"!==this.domain&&"firebaseio-demo.com"!==this.domain},t.prototype.updateHost=function(t){t!==this.internalHost&&(this.internalHost=t,this.isCacheableHost()&&C.a.set("host:"+this.host,this.internalHost))},t.prototype.connectionURL=function(t,e){Object(m.a)("string"==typeof t,"typeof type must == string"),Object(m.a)("object"===(void 0===e?"undefined":w(e)),"typeof params must == object");var n;if(t===E.i)n=(this.secure?"wss://":"ws://")+this.internalHost+"/.ws?";else{if(t!==E.d)throw Error("Unknown connection type: "+t);n=(this.secure?"https://":"http://")+this.internalHost+"/.lp?"}this.needsQueryParam()&&(e.ns=this.namespace);var r=[];return Object(b.f)(e,function(t,e){r.push(t+"="+e)}),n+r.join("&")},t.prototype.toString=function(){var t=this.toURLString();return this.persistenceKey&&(t+="<"+this.persistenceKey+">"),t},t.prototype.toURLString=function(){return(this.secure?"https://":"http://")+this.host},t}(),S=n(1),T=function(t){var e=N(t),n=e.subdomain;"firebase"===e.domain&&Object(S.o)(e.host+" is no longer supported. Please use <YOUR FIREBASE>.firebaseio.com instead"),n&&"undefined"!=n||Object(S.o)("Cannot parse Firebase url. Please use https://<YOUR FIREBASE>.firebaseio.com"),e.secure||Object(S.C)();var r="ws"===e.scheme||"wss"===e.scheme;return{repoInfo:new O(e.host,e.secure,n,r),path:new v(e.pathString)}},N=function(t){var e="",n="",i="",o="",s=!0,a="https",u=443;if("string"==typeof t){var c=t.indexOf("//");c>=0&&(a=t.substring(0,c-1),t=t.substring(c+2));var h=t.indexOf("/");-1===h&&(h=t.length),e=t.substring(0,h),o=r(t.substring(h));var l=e.split(".");3===l.length?(n=l[1],i=l[0].toLowerCase()):2===l.length&&(n=l[0]),(c=e.indexOf(":"))>=0&&(s="https"===a||"wss"===a,u=parseInt(e.substring(c+1),10))}return{host:e,port:u,domain:n,subdomain:i,secure:s,scheme:a,pathString:o}},I="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},P=function(t,e,n,r){var i;if(r<e?i="at least "+e:r>n&&(i=0===n?"none":"no more than "+n),i){var o=t+" failed: Was called with "+r+(1===r?" argument.":" arguments.")+" Expects "+i+".";throw Error(o)}},R=function(t,e,n,r){if((!r||n)&&"function"!=typeof n)throw Error(i(t,e,r)+"must be a valid function.")},D=function(t,e,n,r){if((!r||n)&&("object"!==(void 0===n?"undefined":I(n))||null===n))throw Error(i(t,e,r)+"must be a valid context object.")},j=n(2),x=n(1),k=n(11),F="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},A=/[\[\].#$\/\u0000-\u001F\u007F]/,L=/[\[\].#$\u0000-\u001F\u007F]/,M=function(t){return"string"==typeof t&&0!==t.length&&!A.test(t)},W=function(t){return"string"==typeof t&&0!==t.length&&!L.test(t)},q=function(t){return t&&(t=t.replace(/^\/*\.info(\/|$)/,"/")),W(t)},Q=function(t){return null===t||"string"==typeof t||"number"==typeof t&&!Object(x.q)(t)||t&&"object"===(void 0===t?"undefined":F(t))&&Object(j.b)(t,".sv")},U=function(t,e,n,r,o){o&&void 0===n||V(i(t,e,o),n,r)},V=function t(e,n,r){var i=r instanceof v?new g(r,e):r;if(void 0===n)throw Error(e+"contains undefined "+i.toErrorString());if("function"==typeof n)throw Error(e+"contains a function "+i.toErrorString()+" with contents = "+n);if(Object(x.q)(n))throw Error(e+"contains "+n+" "+i.toErrorString());if("string"==typeof n&&n.length>10485760/3&&Object(k.a)(n)>10485760)throw Error(e+"contains a string greater than 10485760 utf8 bytes "+i.toErrorString()+" ('"+n.substring(0,50)+"...')");if(n&&"object"===(void 0===n?"undefined":F(n))){var o=!1,s=!1;if(Object(j.f)(n,function(n,r){if(".value"===n)o=!0;else if(".priority"!==n&&".sv"!==n&&(s=!0,!M(n)))throw Error(e+" contains an invalid key ("+n+") "+i.toErrorString()+'. Keys must be non-empty strings and can\'t contain ".", "#", "$", "/", "[", or "]"');i.push(n),t(e,r,i),i.pop()}),o&&s)throw Error(e+' contains ".value" child '+i.toErrorString()+" in addition to actual children.")}},B=function(t,e){var n,r;for(n=0;n<e.length;n++){r=e[n];for(var i=r.slice(),o=0;o<i.length;o++)if(".priority"===i[o]&&o===i.length-1);else if(!M(i[o]))throw Error(t+"contains an invalid key ("+i[o]+") in path "+r+'. Keys must be non-empty strings and can\'t contain ".", "#", "$", "/", "[", or "]"')}e.sort(v.comparePaths);var s=null;for(n=0;n<e.length;n++){if(r=e[n],null!==s&&s.contains(r))throw Error(t+"contains a path "+s+" that is ancestor of another path "+r);s=r}},H=function(t,e,n,r,o){if(!o||void 0!==n){var s=i(t,e,o);if(!n||"object"!==(void 0===n?"undefined":F(n))||Array.isArray(n))throw Error(s+" must be an object containing the children to replace.");var a=[];Object(j.f)(n,function(t,e){var n=new v(t);if(V(s,e,r.child(n)),".priority"===n.getBack()&&!Q(e))throw Error(s+"contains an invalid value for '"+n+"', which must be a valid Firebase priority (a string, finite number, server value, or null).");a.push(n)}),B(s,a)}},K=function(t,e,n,r){if(!r||void 0!==n){if(Object(x.q)(n))throw Error(i(t,e,r)+"is "+n+", but must be a valid Firebase priority (a string, finite number, server value, or null).");if(!Q(n))throw Error(i(t,e,r)+"must be a valid Firebase priority (a string, finite number, server value, or null).")}},Y=function(t,e,n,r){if(!r||void 0!==n)switch(n){case"value":case"child_added":case"child_removed":case"child_changed":case"child_moved":break;default:throw Error(i(t,e,r)+'must be a valid event type = "value", "child_added", "child_removed", "child_changed", or "child_moved".')}},z=function(t,e,n,r){if(!(r&&void 0===n||M(n)))throw Error(i(t,e,r)+'was an invalid key = "'+n+'". Firebase keys must be non-empty strings and can\'t contain ".", "#", "$", "/", "[", or "]").')},G=function(t,e,n,r){if(!(r&&void 0===n||W(n)))throw Error(i(t,e,r)+'was an invalid path = "'+n+'". Paths must be non-empty strings and can\'t contain ".", "#", "$", "[", or "]"')},X=function(t,e,n,r){n&&(n=n.replace(/^\/*\.info(\/|$)/,"/")),G(t,e,n,r)},$=function(t,e){if(".info"===e.getFront())throw Error(t+" failed = Can't modify data under /.info/")},J=function(t,e,n){var r=""+n.path;if("string"!=typeof n.repoInfo.host||0===n.repoInfo.host.length||!M(n.repoInfo.namespace)||0!==r.length&&!q(r))throw Error(i(t,e,!1)+'must be a valid firebase URL and the path can\'t contain ".", "#", "$", "[", or "]".')},Z=function(t,e,n,r){if((!r||void 0!==n)&&"boolean"!=typeof n)throw Error(i(t,e,r)+"must be a boolean.")},tt=n(1),et=n(4),nt=function(){function t(t,e){this._t=t,this.yt=e}return t.prototype.cancel=function(t){P("OnDisconnect.cancel",0,1,arguments.length),R("OnDisconnect.cancel",1,t,!0);var e=new et.a;return this._t.onDisconnectCancel(this.yt,e.wrapCallback(t)),e.promise},t.prototype.remove=function(t){P("OnDisconnect.remove",0,1,arguments.length),$("OnDisconnect.remove",this.yt),R("OnDisconnect.remove",1,t,!0);var e=new et.a;return this._t.onDisconnectSet(this.yt,null,e.wrapCallback(t)),e.promise},t.prototype.set=function(t,e){P("OnDisconnect.set",1,2,arguments.length),$("OnDisconnect.set",this.yt),U("OnDisconnect.set",1,t,this.yt,!1),R("OnDisconnect.set",2,e,!0);var n=new et.a;return this._t.onDisconnectSet(this.yt,t,n.wrapCallback(e)),n.promise},t.prototype.setWithPriority=function(t,e,n){P("OnDisconnect.setWithPriority",2,3,arguments.length),$("OnDisconnect.setWithPriority",this.yt),U("OnDisconnect.setWithPriority",1,t,this.yt,!1),K("OnDisconnect.setWithPriority",2,e,!1),R("OnDisconnect.setWithPriority",3,n,!0);var r=new et.a;return this._t.onDisconnectSetWithPriority(this.yt,t,e,r.wrapCallback(n)),r.promise},t.prototype.update=function(t,e){if(P("OnDisconnect.update",1,2,arguments.length),$("OnDisconnect.update",this.yt),Array.isArray(t)){for(var n={},r=0;r<t.length;++r)n[""+r]=t[r];t=n,Object(tt.B)("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.")}H("OnDisconnect.update",1,t,this.yt,!1),R("OnDisconnect.update",2,e,!0);var i=new et.a;return this._t.onDisconnectUpdate(this.yt,t,i.wrapCallback(e)),i.promise},t}(),rt=function(){function t(t,e){this.committed=t,this.snapshot=e}return t.prototype.toJSON=function(){return P("TransactionResult.toJSON",0,1,arguments.length),{committed:this.committed,snapshot:this.snapshot.toJSON()}},t}(),it=n(0),ot=function(){var t="-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz",e=0,n=[];return function(r){var i=r===e;e=r;var o,s=Array(8);for(o=7;o>=0;o--)s[o]=t.charAt(r%64),r=Math.floor(r/64);Object(it.a)(0===r,"Cannot push at time == 0");var a=s.join("");if(i){for(o=11;o>=0&&63===n[o];o--)n[o]=0;n[o]++}else for(o=0;o<12;o++)n[o]=Math.floor(64*Math.random());for(o=0;o<12;o++)a+=t.charAt(n[o]);return Object(it.a)(20===a.length,"nextPushId: Length should be 20."),a}}(),st=function(){function t(t,e){this.name=t,this.node=e}return t.Wrap=function(e,n){return new t(e,n)},t}(),at=n(1),ut=function(){function t(){}return t.prototype.getCompare=function(){return this.compare.bind(this)},t.prototype.indexedValueChanged=function(t,e){var n=new st(at.c,t),r=new st(at.c,e);return 0!==this.compare(n,r)},t.prototype.minPost=function(){return st.MIN},t}(),ct=n(1),ht=n(0),lt=this&&this.I||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),pt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return lt(e,t),Object.defineProperty(e,"__EMPTY_NODE",{get:function(){return u},set:function(t){u=t},enumerable:!0,configurable:!0}),e.prototype.compare=function(t,e){return Object(ct.v)(t.name,e.name)},e.prototype.isDefinedOn=function(t){throw Object(ht.b)("KeyIndex.isDefinedOn not expected to be called.")},e.prototype.indexedValueChanged=function(t,e){return!1},e.prototype.minPost=function(){return st.MIN},e.prototype.maxPost=function(){return new st(ct.b,u)},e.prototype.makePost=function(t,e){return Object(ht.a)("string"==typeof t,"KeyIndex indexValue must always be a string."),new st(t,u)},e.prototype.toString=function(){return".key"},e}(ut),dt=new pt,ft=n(0),_t=n(1),yt=n(2),vt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gt=function(t){return"number"==typeof t?"number:"+Object(_t.h)(t):"string:"+t},mt=function(t){if(t.isLeafNode()){var e=t.val();Object(ft.a)("string"==typeof e||"number"==typeof e||"object"===(void 0===e?"undefined":vt(e))&&Object(yt.b)(e,".sv"),"Priority must be a string or number.")}else Object(ft.a)(t===c||t.isEmpty(),"priority of unexpected type.");Object(ft.a)(t===c||t.getPriority().isEmpty(),"Priority nodes can't have a priority of their own.")},bt=n(0),Ct=n(1),Et="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wt=function(){function t(e,n){void 0===n&&(n=t.vt.EMPTY_NODE),this.gt=e,this.mt=n,this.bt=null,Object(bt.a)(void 0!==this.gt&&null!==this.gt,"LeafNode shouldn't be created with null/undefined value."),mt(this.mt)}return Object.defineProperty(t,"__childrenNodeConstructor",{get:function(){return h},set:function(t){h=t},enumerable:!0,configurable:!0}),t.prototype.isLeafNode=function(){return!0},t.prototype.getPriority=function(){return this.mt},t.prototype.updatePriority=function(e){return new t(this.gt,e)},t.prototype.getImmediateChild=function(e){return".priority"===e?this.mt:t.vt.EMPTY_NODE},t.prototype.getChild=function(e){return e.isEmpty()?this:".priority"===e.getFront()?this.mt:t.vt.EMPTY_NODE},t.prototype.hasChild=function(){return!1},t.prototype.getPredecessorChildName=function(t,e){return null},t.prototype.updateImmediateChild=function(e,n){return".priority"===e?this.updatePriority(n):n.isEmpty()&&".priority"!==e?this:t.vt.EMPTY_NODE.updateImmediateChild(e,n).updatePriority(this.mt)},t.prototype.updateChild=function(e,n){var r=e.getFront();return null===r?n:n.isEmpty()&&".priority"!==r?this:(Object(bt.a)(".priority"!==r||1===e.getLength(),".priority must be the last token in a path"),this.updateImmediateChild(r,t.vt.EMPTY_NODE.updateChild(e.popFront(),n)))},t.prototype.isEmpty=function(){return!1},t.prototype.numChildren=function(){return 0},t.prototype.forEachChild=function(t,e){return!1},t.prototype.val=function(t){return t&&!this.getPriority().isEmpty()?{".value":this.getValue(),".priority":this.getPriority().val()}:this.getValue()},t.prototype.hash=function(){if(null===this.bt){var t="";this.mt.isEmpty()||(t+="priority:"+gt(this.mt.val())+":");var e=Et(this.gt);t+=e+":",t+="number"===e?Object(Ct.h)(this.gt):this.gt,this.bt=Object(Ct.y)(t)}return this.bt},t.prototype.getValue=function(){return this.gt},t.prototype.compareTo=function(e){return e===t.vt.EMPTY_NODE?1:e instanceof t.vt?-1:(Object(bt.a)(e.isLeafNode(),"Unknown node type"),this.Ct(e))},t.prototype.Ct=function(e){var n=Et(e.gt),r=Et(this.gt),i=t.VALUE_TYPE_ORDER.indexOf(n),o=t.VALUE_TYPE_ORDER.indexOf(r);return Object(bt.a)(i>=0,"Unknown leaf type: "+n),Object(bt.a)(o>=0,"Unknown leaf type: "+r),i===o?"object"===r?0:this.gt<e.gt?-1:this.gt===e.gt?0:1:o-i},t.prototype.withIndex=function(){return this},t.prototype.isIndexed=function(){return!0},t.prototype.equals=function(t){if(t===this)return!0;if(t.isLeafNode()){var e=t;return this.gt===e.gt&&this.mt.equals(e.mt)}return!1},t.VALUE_TYPE_ORDER=["object","boolean","number","string"],t}(),Ot=n(1),St=this&&this.I||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Tt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return St(e,t),e.prototype.compare=function(t,e){var n=t.node.getPriority(),r=e.node.getPriority(),i=n.compareTo(r);return 0===i?Object(Ot.v)(t.name,e.name):i},e.prototype.isDefinedOn=function(t){return!t.getPriority().isEmpty()},e.prototype.indexedValueChanged=function(t,e){return!t.getPriority().equals(e.getPriority())},e.prototype.minPost=function(){return st.MIN},e.prototype.maxPost=function(){return new st(Ot.b,new wt("[PRIORITY-POST]",p))},e.prototype.makePost=function(t,e){var n=l(t);return new st(e,new wt("[PRIORITY-POST]",n))},e.prototype.toString=function(){return".priority"},e}(ut),Nt=new Tt,It=function(){function t(t,e,n,r,i){void 0===i&&(i=null),this.Et=r,this.wt=i,this.Ot=[];for(var o=1;!t.isEmpty();)if(t=t,o=e?n(t.key,e):1,r&&(o*=-1),o<0)t=this.Et?t.left:t.right;else{if(0===o){this.Ot.push(t);break}this.Ot.push(t),t=this.Et?t.right:t.left}}return t.prototype.getNext=function(){if(0===this.Ot.length)return null;var t,e=this.Ot.pop();if(t=this.wt?this.wt(e.key,e.value):{key:e.key,value:e.value},this.Et)for(e=e.left;!e.isEmpty();)this.Ot.push(e),e=e.right;else for(e=e.right;!e.isEmpty();)this.Ot.push(e),e=e.left;return t},t.prototype.hasNext=function(){return this.Ot.length>0},t.prototype.peek=function(){if(0===this.Ot.length)return null;var t=this.Ot[this.Ot.length-1];return this.wt?this.wt(t.key,t.value):{key:t.key,value:t.value}},t}(),Pt=function(){function t(e,n,r,i,o){this.key=e,this.value=n,this.color=null!=r?r:t.RED,this.left=null!=i?i:Dt.EMPTY_NODE,this.right=null!=o?o:Dt.EMPTY_NODE}return t.prototype.copy=function(e,n,r,i,o){return new t(null!=e?e:this.key,null!=n?n:this.value,null!=r?r:this.color,null!=i?i:this.left,null!=o?o:this.right)},t.prototype.count=function(){return this.left.count()+1+this.right.count()},t.prototype.isEmpty=function(){return!1},t.prototype.inorderTraversal=function(t){return this.left.inorderTraversal(t)||t(this.key,this.value)||this.right.inorderTraversal(t)},t.prototype.reverseTraversal=function(t){return this.right.reverseTraversal(t)||t(this.key,this.value)||this.left.reverseTraversal(t)},t.prototype.St=function(){return this.left.isEmpty()?this:this.left.St()},t.prototype.minKey=function(){return this.St().key},t.prototype.maxKey=function(){return this.right.isEmpty()?this.key:this.right.maxKey()},t.prototype.insert=function(t,e,n){var r,i;return i=this,r=n(t,i.key),i=r<0?i.copy(null,null,null,i.left.insert(t,e,n),null):0===r?i.copy(null,e,null,null,null):i.copy(null,null,null,null,i.right.insert(t,e,n)),i.Tt()},t.prototype.Nt=function(){if(this.left.isEmpty())return Dt.EMPTY_NODE;var t=this;return t.left.It()||t.left.left.It()||(t=t.Pt()),t=t.copy(null,null,null,t.left.Nt(),null),t.Tt()},t.prototype.remove=function(t,e){var n,r;if(n=this,e(t,n.key)<0)n.left.isEmpty()||n.left.It()||n.left.left.It()||(n=n.Pt()),n=n.copy(null,null,null,n.left.remove(t,e),null);else{if(n.left.It()&&(n=n.Rt()),n.right.isEmpty()||n.right.It()||n.right.left.It()||(n=n.Dt()),0===e(t,n.key)){if(n.right.isEmpty())return Dt.EMPTY_NODE;r=n.right.St(),n=n.copy(r.key,r.value,null,null,n.right.Nt())}n=n.copy(null,null,null,null,n.right.remove(t,e))}return n.Tt()},t.prototype.It=function(){return this.color},t.prototype.Tt=function(){var t=this;return t.right.It()&&!t.left.It()&&(t=t.jt()),t.left.It()&&t.left.left.It()&&(t=t.Rt()),t.left.It()&&t.right.It()&&(t=t.xt()),t},t.prototype.Pt=function(){var t=this.xt();return t.right.left.It()&&(t=t.copy(null,null,null,null,t.right.Rt()),t=t.jt(),t=t.xt()),t},t.prototype.Dt=function(){var t=this.xt();return t.left.left.It()&&(t=t.Rt(),t=t.xt()),t},t.prototype.jt=function(){var e=this.copy(null,null,t.RED,null,this.right.left);return this.right.copy(null,null,this.color,e,null)},t.prototype.Rt=function(){var e=this.copy(null,null,t.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,e)},t.prototype.xt=function(){var t=this.left.copy(null,null,!this.left.color,null,null),e=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,t,e)},t.prototype.kt=function(){var t=this.Ft();return Math.pow(2,t)<=this.count()+1},t.prototype.Ft=function(){var t;if(this.It()&&this.left.It())throw Error("Red node has red child("+this.key+","+this.value+")");if(this.right.It())throw Error("Right child of ("+this.key+","+this.value+") is red");if((t=this.left.Ft())!==this.right.Ft())throw Error("Black depths differ");return t+(this.It()?0:1)},t.RED=!0,t.BLACK=!1,t}(),Rt=function(){function t(){}return t.prototype.copy=function(t,e,n,r,i){return this},t.prototype.insert=function(t,e,n){return new Pt(t,e,null)},t.prototype.remove=function(t,e){return this},t.prototype.count=function(){return 0},t.prototype.isEmpty=function(){return!0},t.prototype.inorderTraversal=function(t){return!1},t.prototype.reverseTraversal=function(t){return!1},t.prototype.minKey=function(){return null},t.prototype.maxKey=function(){return null},t.prototype.Ft=function(){return 0},t.prototype.It=function(){return!1},t}(),Dt=function(){function t(e,n){void 0===n&&(n=t.EMPTY_NODE),this.At=e,this.Lt=n}return t.prototype.insert=function(e,n){return new t(this.At,this.Lt.insert(e,n,this.At).copy(null,null,Pt.BLACK,null,null))},t.prototype.remove=function(e){return new t(this.At,this.Lt.remove(e,this.At).copy(null,null,Pt.BLACK,null,null))},t.prototype.get=function(t){for(var e,n=this.Lt;!n.isEmpty();){if(0===(e=this.At(t,n.key)))return n.value;e<0?n=n.left:e>0&&(n=n.right)}return null},t.prototype.getPredecessorKey=function(t){for(var e,n=this.Lt,r=null;!n.isEmpty();){if(0===(e=this.At(t,n.key))){if(n.left.isEmpty())return r?r.key:null;for(n=n.left;!n.right.isEmpty();)n=n.right;return n.key}e<0?n=n.left:e>0&&(r=n,n=n.right)}throw Error("Attempted to find predecessor key for a nonexistent key. What gives?")},t.prototype.isEmpty=function(){return this.Lt.isEmpty()},t.prototype.count=function(){return this.Lt.count()},t.prototype.minKey=function(){return this.Lt.minKey()},t.prototype.maxKey=function(){return this.Lt.maxKey()},t.prototype.inorderTraversal=function(t){return this.Lt.inorderTraversal(t)},t.prototype.reverseTraversal=function(t){return this.Lt.reverseTraversal(t)},t.prototype.getIterator=function(t){return new It(this.Lt,null,this.At,!1,t)},t.prototype.getIteratorFrom=function(t,e){return new It(this.Lt,t,this.At,!1,e)},t.prototype.getReverseIteratorFrom=function(t,e){return new It(this.Lt,t,this.At,!0,e)},t.prototype.getReverseIterator=function(t){return new It(this.Lt,null,this.At,!0,t)},t.EMPTY_NODE=new Rt,t}(),jt=Math.log(2),xt=function(){function t(t){this.count=function(t){return parseInt(Math.log(t)/jt,10)}(t+1),this.Mt=this.count-1;var e=function(t){return parseInt(Array(t+1).join("1"),2)}(this.count);this.Wt=t+1&e}return t.prototype.nextBitIsOne=function(){var t=!(this.Wt&1<<this.Mt);return this.Mt--,t},t}(),kt=function(t,e,n,r){t.sort(e);var i=function e(r,i){var o,s,a=i-r;if(0==a)return null;if(1==a)return o=t[r],s=n?n(o):o,new Pt(s,o.node,Pt.BLACK,null,null);var u=parseInt(a/2,10)+r,c=e(r,u),h=e(u+1,i);return o=t[u],s=n?n(o):o,new Pt(s,o.node,Pt.BLACK,c,h)},o=new xt(t.length),s=function(e){for(var r=null,o=null,s=t.length,a=function(e,r){var o=s-e,a=s;s-=e;var c=i(o+1,a),h=t[o],l=n?n(h):h;u(new Pt(l,h.node,r,null,c))},u=function(t){r?(r.left=t,r=t):(o=t,r=t)},c=0;c<e.count;++c){var h=e.nextBitIsOne(),l=Math.pow(2,e.count-(c+1));h?a(l,Pt.BLACK):(a(l,Pt.BLACK),a(l,Pt.RED))}return o}(o);return new Dt(r||e,s)},Ft=n(0),At=n(2),Lt={},Mt=function(){function t(t,e){this.qt=t,this.Qt=e}return Object.defineProperty(t,"Default",{get:function(){return Object(Ft.a)(Lt&&Nt,"ChildrenNode.ts has not been loaded"),d=d||new t({".priority":Lt},{".priority":Nt})},enumerable:!0,configurable:!0}),t.prototype.get=function(t){var e=Object(At.l)(this.qt,t);if(!e)throw Error("No index defined for "+t);return e===Lt?null:e},t.prototype.hasIndex=function(t){return Object(At.b)(this.Qt,""+t)},t.prototype.addIndex=function(e,n){Object(Ft.a)(e!==dt,"KeyIndex always exists and isn't meant to be added to the IndexMap.");for(var r=[],i=!1,o=n.getIterator(st.Wrap),s=o.getNext();s;)i=i||e.isDefinedOn(s.node),r.push(s),s=o.getNext();var a;a=i?kt(r,e.getCompare()):Lt;var u=""+e,c=Object(At.a)(this.Qt);c[u]=e;var h=Object(At.a)(this.qt);return h[u]=a,new t(h,c)},t.prototype.addToIndexes=function(e,n){var r=this;return new t(Object(At.k)(this.qt,function(t,i){var o=Object(At.l)(r.Qt,i);if(Object(Ft.a)(o,"Missing index implementation for "+i),t===Lt){if(o.isDefinedOn(e.node)){for(var s=[],a=n.getIterator(st.Wrap),u=a.getNext();u;)u.name!=e.name&&s.push(u),u=a.getNext();return s.push(e),kt(s,o.getCompare())}return Lt}var c=n.get(e.name),h=t;return c&&(h=h.remove(new st(e.name,c))),h.insert(e,e.node)}),this.Qt)},t.prototype.removeFromIndexes=function(e,n){return new t(Object(At.k)(this.qt,function(t){if(t===Lt)return t;var r=n.get(e.name);return r?t.remove(new st(e.name,r)):t}),this.Qt)},t}(),Wt=n(1),qt=n(0),Qt=n(1),Ut=this&&this.I||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Vt=function(){function t(t,e,n){this.Ut=t,this.mt=e,this.Vt=n,this.bt=null,this.mt&&mt(this.mt),this.Ut.isEmpty()&&Object(qt.a)(!this.mt||this.mt.isEmpty(),"An empty node cannot have a priority")}return Object.defineProperty(t,"EMPTY_NODE",{get:function(){return f||(f=new t(new Dt(s),null,Mt.Default))},enumerable:!0,configurable:!0}),t.prototype.isLeafNode=function(){return!1},t.prototype.getPriority=function(){return this.mt||f},t.prototype.updatePriority=function(e){return this.Ut.isEmpty()?this:new t(this.Ut,e,this.Vt)},t.prototype.getImmediateChild=function(t){if(".priority"===t)return this.getPriority();var e=this.Ut.get(t);return null===e?f:e},t.prototype.getChild=function(t){var e=t.getFront();return null===e?this:this.getImmediateChild(e).getChild(t.popFront())},t.prototype.hasChild=function(t){return null!==this.Ut.get(t)},t.prototype.updateImmediateChild=function(e,n){if(Object(qt.a)(n,"We should always be passing snapshot nodes"),".priority"===e)return this.updatePriority(n);var r=new st(e,n),i=void 0,o=void 0,s=void 0;return n.isEmpty()?(i=this.Ut.remove(e),o=this.Vt.removeFromIndexes(r,this.Ut)):(i=this.Ut.insert(e,n),o=this.Vt.addToIndexes(r,this.Ut)),s=i.isEmpty()?f:this.mt,new t(i,s,o)},t.prototype.updateChild=function(t,e){var n=t.getFront();if(null===n)return e;Object(qt.a)(".priority"!==t.getFront()||1===t.getLength(),".priority must be the last token in a path");var r=this.getImmediateChild(n).updateChild(t.popFront(),e);return this.updateImmediateChild(n,r)},t.prototype.isEmpty=function(){return this.Ut.isEmpty()},t.prototype.numChildren=function(){return this.Ut.count()},t.prototype.val=function(e){if(this.isEmpty())return null;var n={},r=0,i=0,o=!0;if(this.forEachChild(Nt,function(s,a){n[s]=a.val(e),r++,o&&t.Bt.test(s)?i=Math.max(i,+s):o=!1}),!e&&o&&i<2*r){var s=[];for(var a in n)s[a]=n[a];return s}return e&&!this.getPriority().isEmpty()&&(n[".priority"]=this.getPriority().val()),n},t.prototype.hash=function(){if(null===this.bt){var t="";this.getPriority().isEmpty()||(t+="priority:"+gt(this.getPriority().val())+":"),this.forEachChild(Nt,function(e,n){var r=n.hash();""!==r&&(t+=":"+e+":"+r)}),this.bt=""===t?"":Object(Qt.y)(t)}return this.bt},t.prototype.getPredecessorChildName=function(t,e,n){var r=this.Ht(n);if(r){var i=r.getPredecessorKey(new st(t,e));return i?i.name:null}return this.Ut.getPredecessorKey(t)},t.prototype.getFirstChildName=function(t){var e=this.Ht(t);if(e){var n=e.minKey();return n&&n.name}return this.Ut.minKey()},t.prototype.getFirstChild=function(t){var e=this.getFirstChildName(t);return e?new st(e,this.Ut.get(e)):null},t.prototype.getLastChildName=function(t){var e=this.Ht(t);if(e){var n=e.maxKey();return n&&n.name}return this.Ut.maxKey()},t.prototype.getLastChild=function(t){var e=this.getLastChildName(t);return e?new st(e,this.Ut.get(e)):null},t.prototype.forEachChild=function(t,e){var n=this.Ht(t);return n?n.inorderTraversal(function(t){return e(t.name,t.node)}):this.Ut.inorderTraversal(e)},t.prototype.getIterator=function(t){return this.getIteratorFrom(t.minPost(),t)},t.prototype.getIteratorFrom=function(t,e){var n=this.Ht(e);if(n)return n.getIteratorFrom(t,function(t){return t});for(var r=this.Ut.getIteratorFrom(t.name,st.Wrap),i=r.peek();null!=i&&e.compare(i,t)<0;)r.getNext(),i=r.peek();return r},t.prototype.getReverseIterator=function(t){return this.getReverseIteratorFrom(t.maxPost(),t)},t.prototype.getReverseIteratorFrom=function(t,e){var n=this.Ht(e);if(n)return n.getReverseIteratorFrom(t,function(t){return t});for(var r=this.Ut.getReverseIteratorFrom(t.name,st.Wrap),i=r.peek();null!=i&&e.compare(i,t)>0;)r.getNext(),i=r.peek();return r},t.prototype.compareTo=function(t){return this.isEmpty()?t.isEmpty()?0:-1:t.isLeafNode()||t.isEmpty()?1:t===Ht?-1:0},t.prototype.withIndex=function(e){if(e===dt||this.Vt.hasIndex(e))return this;var n=this.Vt.addIndex(e,this.Ut);return new t(this.Ut,this.mt,n)},t.prototype.isIndexed=function(t){return t===dt||this.Vt.hasIndex(t)},t.prototype.equals=function(t){if(t===this)return!0;if(t.isLeafNode())return!1;var e=t;if(this.getPriority().equals(e.getPriority())){if(this.Ut.count()===e.Ut.count()){for(var n=this.getIterator(Nt),r=e.getIterator(Nt),i=n.getNext(),o=r.getNext();i&&o;){if(i.name!==o.name||!i.node.equals(o.node))return!1;i=n.getNext(),o=r.getNext()}return null===i&&null===o}return!1}return!1},t.prototype.Ht=function(t){return t===dt?null:this.Vt.get(""+t)},t.Bt=/^(0|[1-9]\d*)$/,t}(),Bt=function(t){function e(){return t.call(this,new Dt(s),Vt.EMPTY_NODE,Mt.Default)||this}return Ut(e,t),e.prototype.compareTo=function(t){return t===this?0:1},e.prototype.equals=function(t){return t===this},e.prototype.getPriority=function(){return this},e.prototype.getImmediateChild=function(t){return Vt.EMPTY_NODE},e.prototype.isEmpty=function(){return!1},e}(Vt),Ht=new Bt;Object.defineProperties(st,{MIN:{value:new st(Qt.c,Vt.EMPTY_NODE)},MAX:{value:new st(Qt.b,Ht)}}),pt.Kt=Vt.EMPTY_NODE,wt.vt=Vt,function(t){c=t}(Ht),function(t){p=t}(Ht);var Kt=n(2),Yt=n(0),zt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gt=!0;!function(t){l=t}(a);var Xt,$t,Jt=n(1),Zt=this&&this.I||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),te=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Zt(e,t),e.prototype.compare=function(t,e){var n=t.node.compareTo(e.node);return 0===n?Object(Jt.v)(t.name,e.name):n},e.prototype.isDefinedOn=function(t){return!0},e.prototype.indexedValueChanged=function(t,e){return!t.equals(e)},e.prototype.minPost=function(){return st.MIN},e.prototype.maxPost=function(){return st.MAX},e.prototype.makePost=function(t,e){var n=a(t);return new st(e,n)},e.prototype.toString=function(){return".value"},e}(ut),ee=new te,ne=n(0),re=n(1),ie=this&&this.I||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),oe=function(t){function e(e){var n=t.call(this)||this;return n.Yt=e,Object(ne.a)(!e.isEmpty()&&".priority"!==e.getFront(),"Can't create PathIndex with empty path or .priority key"),n}return ie(e,t),e.prototype.extractChild=function(t){return t.getChild(this.Yt)},e.prototype.isDefinedOn=function(t){return!t.getChild(this.Yt).isEmpty()},e.prototype.compare=function(t,e){var n=this.extractChild(t.node),r=this.extractChild(e.node),i=n.compareTo(r);return 0===i?Object(re.v)(t.name,e.name):i},e.prototype.makePost=function(t,e){var n=a(t),r=Vt.EMPTY_NODE.updateChild(this.Yt,n);return new st(e,r)},e.prototype.maxPost=function(){var t=Vt.EMPTY_NODE.updateChild(this.Yt,Ht);return new st(re.b,t)},e.prototype.toString=function(){return this.Yt.slice().join("/")},e}(ut),se=function(){function t(t,e,n){this.zt=t,this.Gt=e,this.Xt=n}return t.prototype.val=function(){return P("DataSnapshot.val",0,0,arguments.length),this.zt.val()},t.prototype.exportVal=function(){return P("DataSnapshot.exportVal",0,0,arguments.length),this.zt.val(!0)},t.prototype.toJSON=function(){return P("DataSnapshot.toJSON",0,1,arguments.length),this.exportVal()},t.prototype.exists=function(){return P("DataSnapshot.exists",0,0,arguments.length),!this.zt.isEmpty()},t.prototype.child=function(e){P("DataSnapshot.child",0,1,arguments.length),e+="",G("DataSnapshot.child",1,e,!1);var n=new v(e),r=this.Gt.child(n);return new t(this.zt.getChild(n),r,Nt)},t.prototype.hasChild=function(t){P("DataSnapshot.hasChild",1,1,arguments.length),G("DataSnapshot.hasChild",1,t,!1);var e=new v(t);return!this.zt.getChild(e).isEmpty()},t.prototype.getPriority=function(){return P("DataSnapshot.getPriority",0,0,arguments.length),this.zt.getPriority().val()},t.prototype.forEach=function(e){var n=this;return P("DataSnapshot.forEach",1,1,arguments.length),R("DataSnapshot.forEach",1,e,!1),!this.zt.isLeafNode()&&!!this.zt.forEachChild(this.Xt,function(r,i){return e(new t(i,n.Gt.child(r),Nt))})},t.prototype.hasChildren=function(){return P("DataSnapshot.hasChildren",0,0,arguments.length),!this.zt.isLeafNode()&&!this.zt.isEmpty()},Object.defineProperty(t.prototype,"key",{get:function(){return this.Gt.getKey()},enumerable:!0,configurable:!0}),t.prototype.numChildren=function(){return P("DataSnapshot.numChildren",0,0,arguments.length),this.zt.numChildren()},t.prototype.getRef=function(){return P("DataSnapshot.ref",0,0,arguments.length),this.Gt},Object.defineProperty(t.prototype,"ref",{get:function(){return this.getRef()},enumerable:!0,configurable:!0}),t}(),ae=n(3),ue=function(){function t(t,e,n,r){this.eventType=t,this.eventRegistration=e,this.snapshot=n,this.prevName=r}return t.prototype.getPath=function(){var t=this.snapshot.getRef();return"value"===this.eventType?t.path:t.getParent().path},t.prototype.getEventType=function(){return this.eventType},t.prototype.getEventRunner=function(){return this.eventRegistration.getEventRunner(this)},t.prototype.toString=function(){return this.getPath()+":"+this.eventType+":"+Object(ae.b)(this.snapshot.exportVal())},t}(),ce=function(){function t(t,e,n){this.eventRegistration=t,this.error=e,this.path=n}return t.prototype.getPath=function(){return this.path},t.prototype.getEventType=function(){return"cancel"},t.prototype.getEventRunner=function(){return this.eventRegistration.getEventRunner(this)},t.prototype.toString=function(){return this.path+":cancel"},t}(),he=n(2),le=n(0),pe=function(){function t(t,e,n){this.$t=t,this.Jt=e,this.Zt=n}return t.prototype.respondsTo=function(t){return"value"===t},t.prototype.createEvent=function(t,e){var n=e.getQueryParams().getIndex();return new ue("value",this,new se(t.snapshotNode,e.getRef(),n))},t.prototype.getEventRunner=function(t){var e=this.Zt;if("cancel"===t.getEventType()){Object(le.a)(this.Jt,"Raising a cancel event on a listener with no cancel callback");var n=this.Jt;return function(){n.call(e,t.error)}}var r=this.$t;return function(){r.call(e,t.snapshot)}},t.prototype.createCancelEvent=function(t,e){return this.Jt?new ce(this,t,e):null},t.prototype.matches=function(e){return e instanceof t&&(!e.$t||!this.$t||e.$t===this.$t&&e.Zt===this.Zt)},t.prototype.hasAnyCallback=function(){return null!==this.$t},t}(),de=function(){function t(t,e,n){this.te=t,this.Jt=e,this.Zt=n}return t.prototype.respondsTo=function(t){var e="children_added"===t?"child_added":t;return e="children_removed"===e?"child_removed":e,Object(he.b)(this.te,e)},t.prototype.createCancelEvent=function(t,e){return this.Jt?new ce(this,t,e):null},t.prototype.createEvent=function(t,e){Object(le.a)(null!=t.childName,"Child events should have a childName.");var n=e.getRef().child(t.childName),r=e.getQueryParams().getIndex();return new ue(t.type,this,new se(t.snapshotNode,n,r),t.prevName)},t.prototype.getEventRunner=function(t){var e=this.Zt;if("cancel"===t.getEventType()){Object(le.a)(this.Jt,"Raising a cancel event on a listener with no cancel callback");var n=this.Jt;return function(){n.call(e,t.error)}}var r=this.te[t.eventType];return function(){r.call(e,t.snapshot,t.prevName)}},t.prototype.matches=function(e){if(e instanceof t){if(!this.te||!e.te)return!0;if(this.Zt===e.Zt){var n=Object(he.h)(e.te);if(n===Object(he.h)(this.te)){if(1===n){var r=Object(he.g)(e.te),i=Object(he.g)(this.te);return!(i!==r||e.te[r]&&this.te[i]&&e.te[r]!==this.te[i])}return Object(he.c)(this.te,function(t,n){return e.te[t]===n})}}}return!1},t.prototype.hasAnyCallback=function(){return null!==this.te},t}(),fe=n(0),_e=n(1),ye=n(4),ve="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ge=function(){function t(t,e,n,r){this.repo=t,this.path=e,this.ee=n,this.ne=r}return Object.defineProperty(t,"__referenceConstructor",{get:function(){return Object(fe.a)(Xt,"Reference.ts has not been loaded"),Xt},set:function(t){Xt=t},enumerable:!0,configurable:!0}),t.re=function(t){var e=null,n=null;if(t.hasStart()&&(e=t.getIndexStartValue()),t.hasEnd()&&(n=t.getIndexEndValue()),t.getIndex()===dt){var r="Query: When ordering by key, you may only pass one argument to startAt(), endAt(), or equalTo().",i="Query: When ordering by key, the argument passed to startAt(), endAt(),or equalTo() must be a string.";if(t.hasStart()){if(t.getIndexStartName()!=_e.c)throw Error(r);if("string"!=typeof e)throw Error(i)}if(t.hasEnd()){if(t.getIndexEndName()!=_e.b)throw Error(r);if("string"!=typeof n)throw Error(i)}}else if(t.getIndex()===Nt){if(null!=e&&!Q(e)||null!=n&&!Q(n))throw Error("Query: When ordering by priority, the first argument passed to startAt(), endAt(), or equalTo() must be a valid priority value (null, a number, or a string).")}else if(Object(fe.a)(t.getIndex()instanceof oe||t.getIndex()===ee,"unknown index type."),null!=e&&"object"===(void 0===e?"undefined":ve(e))||null!=n&&"object"===(void 0===n?"undefined":ve(n)))throw Error("Query: First argument passed to startAt(), endAt(), or equalTo() cannot be an object.")},t.ie=function(t){if(t.hasStart()&&t.hasEnd()&&t.hasLimit()&&!t.hasAnchoredLimit())throw Error("Query: Can't combine startAt(), endAt(), and limit(). Use limitToFirst() or limitToLast() instead.")},t.prototype.oe=function(t){if(!0===this.ne)throw Error(t+": You can't combine multiple orderBy calls.")},t.prototype.getQueryParams=function(){return this.ee},t.prototype.getRef=function(){return P("Query.ref",0,0,arguments.length),new t.se(this.repo,this.path)},t.prototype.on=function(e,n,r,i){P("Query.on",2,4,arguments.length),Y("Query.on",1,e,!1),R("Query.on",2,n,!1);var o=t.ae("Query.on",r,i);if("value"===e)this.onValueEvent(n,o.cancel,o.context);else{var s={};s[e]=n,this.onChildEvent(s,o.cancel,o.context)}return n},t.prototype.onValueEvent=function(t,e,n){var r=new pe(t,e||null,n||null);this.repo.addEventCallbackForQuery(this,r)},t.prototype.onChildEvent=function(t,e,n){var r=new de(t,e,n);this.repo.addEventCallbackForQuery(this,r)},t.prototype.off=function(t,e,n){P("Query.off",0,3,arguments.length),Y("Query.off",1,t,!0),R("Query.off",2,e,!0),D("Query.off",3,n,!0);var r=null,i=null;"value"===t?r=new pe(e||null,null,n||null):t&&(e&&(i={},i[t]=e),r=new de(i,null,n||null)),this.repo.removeEventCallbackForQuery(this,r)},t.prototype.once=function(e,n,r,i){var o=this;P("Query.once",1,4,arguments.length),Y("Query.once",1,e,!1),R("Query.once",2,n,!0);var s=t.ae("Query.once",r,i),a=!0,u=new ye.a;Object(ye.c)(u.promise);var c=function t(r){a&&(a=!1,o.off(e,t),n&&n.bind(s.context)(r),u.resolve(r))};return this.on(e,c,function(t){o.off(e,c),s.cancel&&s.cancel.bind(s.context)(t),u.reject(t)}),u.promise},t.prototype.limitToFirst=function(e){if(P("Query.limitToFirst",1,1,arguments.length),"number"!=typeof e||Math.floor(e)!==e||e<=0)throw Error("Query.limitToFirst: First argument must be a positive integer.");if(this.ee.hasLimit())throw Error("Query.limitToFirst: Limit was already set (by another call to limit, limitToFirst, or limitToLast).");return new t(this.repo,this.path,this.ee.limitToFirst(e),this.ne)},t.prototype.limitToLast=function(e){if(P("Query.limitToLast",1,1,arguments.length),"number"!=typeof e||Math.floor(e)!==e||e<=0)throw Error("Query.limitToLast: First argument must be a positive integer.");if(this.ee.hasLimit())throw Error("Query.limitToLast: Limit was already set (by another call to limit, limitToFirst, or limitToLast).");return new t(this.repo,this.path,this.ee.limitToLast(e),this.ne)},t.prototype.orderByChild=function(e){if(P("Query.orderByChild",1,1,arguments.length),"$key"===e)throw Error('Query.orderByChild: "$key" is invalid. Use Query.orderByKey() instead.');if("$priority"===e)throw Error('Query.orderByChild: "$priority" is invalid. Use Query.orderByPriority() instead.');if("$value"===e)throw Error('Query.orderByChild: "$value" is invalid. Use Query.orderByValue() instead.');G("Query.orderByChild",1,e,!1),this.oe("Query.orderByChild");var n=new v(e);if(n.isEmpty())throw Error("Query.orderByChild: cannot pass in empty path. Use Query.orderByValue() instead.");var r=new oe(n),i=this.ee.orderBy(r);return t.re(i),new t(this.repo,this.path,i,!0)},t.prototype.orderByKey=function(){P("Query.orderByKey",0,0,arguments.length),this.oe("Query.orderByKey");var e=this.ee.orderBy(dt);return t.re(e),new t(this.repo,this.path,e,!0)},t.prototype.orderByPriority=function(){P("Query.orderByPriority",0,0,arguments.length),this.oe("Query.orderByPriority");var e=this.ee.orderBy(Nt);return t.re(e),new t(this.repo,this.path,e,!0)},t.prototype.orderByValue=function(){P("Query.orderByValue",0,0,arguments.length),this.oe("Query.orderByValue");var e=this.ee.orderBy(ee);return t.re(e),new t(this.repo,this.path,e,!0)},t.prototype.startAt=function(e,n){void 0===e&&(e=null),P("Query.startAt",0,2,arguments.length),U("Query.startAt",1,e,this.path,!0),z("Query.startAt",2,n,!0);var r=this.ee.startAt(e,n);if(t.ie(r),t.re(r),this.ee.hasStart())throw Error("Query.startAt: Starting point was already set (by another call to startAt or equalTo).");return void 0===e&&(e=null,n=null),new t(this.repo,this.path,r,this.ne)},t.prototype.endAt=function(e,n){void 0===e&&(e=null),P("Query.endAt",0,2,arguments.length),U("Query.endAt",1,e,this.path,!0),z("Query.endAt",2,n,!0);var r=this.ee.endAt(e,n);if(t.ie(r),t.re(r),this.ee.hasEnd())throw Error("Query.endAt: Ending point was already set (by another call to endAt or equalTo).");return new t(this.repo,this.path,r,this.ne)},t.prototype.equalTo=function(t,e){if(P("Query.equalTo",1,2,arguments.length),U("Query.equalTo",1,t,this.path,!1),z("Query.equalTo",2,e,!0),this.ee.hasStart())throw Error("Query.equalTo: Starting point was already set (by another call to startAt or equalTo).");if(this.ee.hasEnd())throw Error("Query.equalTo: Ending point was already set (by another call to endAt or equalTo).");return this.startAt(t,e).endAt(t,e)},t.prototype.toString=function(){return P("Query.toString",0,0,arguments.length),""+this.repo+this.path.toUrlEncodedString()},t.prototype.toJSON=function(){return P("Query.toJSON",0,1,arguments.length),""+this},t.prototype.queryObject=function(){return this.ee.getQueryObject()},t.prototype.queryIdentifier=function(){var t=this.queryObject(),e=Object(_e.d)(t);return"{}"===e?"default":e},t.prototype.isEqual=function(e){if(P("Query.isEqual",1,1,arguments.length),!(e instanceof t))throw Error("Query.isEqual failed: First argument must be an instance of firebase.database.Query.");var n=this.repo===e.repo,r=this.path.equals(e.path),i=this.queryIdentifier()===e.queryIdentifier();return n&&r&&i},t.ae=function(t,e,n){var r={cancel:null,context:null};if(e&&n)r.cancel=e,R(t,3,r.cancel,!0),r.context=n,D(t,4,r.context,!0);else if(e)if("object"===(void 0===e?"undefined":ve(e))&&null!==e)r.context=e;else{if("function"!=typeof e)throw Error(i(t,3,!0)+" must either be a cancel callback or a context object.");r.cancel=e}return r},Object.defineProperty(t.prototype,"ref",{get:function(){return this.getRef()},enumerable:!0,configurable:!0}),t}(),me=n(2),be=function(){function t(){this.set={}}return t.prototype.add=function(t,e){this.set[t]=null===e||e},t.prototype.contains=function(t){return Object(me.b)(this.set,t)},t.prototype.get=function(t){return this.contains(t)?this.set[t]:void 0},t.prototype.remove=function(t){delete this.set[t]},t.prototype.clear=function(){this.set={}},t.prototype.isEmpty=function(){return Object(me.j)(this.set)},t.prototype.count=function(){return Object(me.h)(this.set)},t.prototype.each=function(t){Object(me.f)(this.set,function(e,n){return t(e,n)})},t.prototype.keys=function(){var t=[];return Object(me.f)(this.set,function(e){t.push(e)}),t},t}(),Ce=function(){function t(){this.gt=null,this.Ut=null}return t.prototype.find=function(t){if(null!=this.gt)return this.gt.getChild(t);if(t.isEmpty()||null==this.Ut)return null;var e=t.getFront();return t=t.popFront(),this.Ut.contains(e)?this.Ut.get(e).find(t):null},t.prototype.remember=function(e,n){if(e.isEmpty())this.gt=n,this.Ut=null;else if(null!==this.gt)this.gt=this.gt.updateChild(e,n);else{null==this.Ut&&(this.Ut=new be);var r=e.getFront();this.Ut.contains(r)||this.Ut.add(r,new t);var i=this.Ut.get(r);e=e.popFront(),i.remember(e,n)}},t.prototype.forget=function(t){if(t.isEmpty())return this.gt=null,this.Ut=null,!0;if(null!==this.gt){if(this.gt.isLeafNode())return!1;var e=this.gt;this.gt=null;var n=this;return e.forEachChild(Nt,function(t,e){n.remember(new v(t),e)}),this.forget(t)}if(null!==this.Ut){var r=t.getFront();return t=t.popFront(),this.Ut.contains(r)&&this.Ut.get(r).forget(t)&&this.Ut.remove(r),!!this.Ut.isEmpty()&&(this.Ut=null,!0)}return!0},t.prototype.forEachTree=function(t,e){null!==this.gt?e(t,this.gt):this.forEachChild(function(n,r){var i=new v(t+"/"+n);r.forEachTree(i,e)})},t.prototype.forEachChild=function(t){null!==this.Ut&&this.Ut.each(function(e,n){t(e,n)})},t}(),Ee=n(0),we="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Oe=function(t){return t=t||{},t.timestamp=t.timestamp||(new Date).getTime(),t},Se=function(t,e){return t&&"object"===(void 0===t?"undefined":we(t))?(Object(Ee.a)(".sv"in t,"Unexpected leaf node or priority contents"),e[t[".sv"]]):t},Te=function(t,e){var n=new Ce;return t.forEachTree(new v(""),function(t,r){n.remember(t,Ne(r,e))}),n},Ne=function t(e,n){var r,i=e.getPriority().val(),o=Se(i,n);if(e.isLeafNode()){var s=e,u=Se(s.getValue(),n);return u!==s.getValue()||o!==s.getPriority().val()?new wt(u,a(o)):e}var c=e;return r=c,o!==c.getPriority().val()&&(r=r.updatePriority(new wt(o))),c.forEachChild(Nt,function(e,i){var o=t(i,n);o!==i&&(r=r.updateImmediateChild(e,o))}),r},Ie=n(0);!function(t){t[t.OVERWRITE=0]="OVERWRITE",t[t.MERGE=1]="MERGE",t[t.ACK_USER_WRITE=2]="ACK_USER_WRITE",t[t.LISTEN_COMPLETE=3]="LISTEN_COMPLETE"}($t||($t={}));var Pe,Re,De=function(){function t(t,e,n,r){this.fromUser=t,this.fromServer=e,this.queryId=n,this.tagged=r,Object(Ie.a)(!r||e,"Tagged queries must be from server.")}return t.User=new t(!0,!1,null,!1),t.Server=new t(!1,!0,null,!1),t.forServerTaggedQuery=function(e){return new t(!1,!0,e,!0)},t}(),je=n(0),xe=function(){function t(t,e,n){this.path=t,this.affectedTree=e,this.revert=n,this.type=$t.ACK_USER_WRITE,this.source=De.User}return t.prototype.operationForChild=function(e){if(this.path.isEmpty()){if(null!=this.affectedTree.value)return Object(je.a)(this.affectedTree.children.isEmpty(),"affectedTree should not have overlapping affected paths."),this;var n=this.affectedTree.subtree(new v(e));return new t(v.Empty,n,this.revert)}return Object(je.a)(this.path.getFront()===e,"operationForChild called for unrelated child."),new t(this.path.popFront(),this.affectedTree,this.revert)},t}(),ke=n(1),Fe=n(2),Ae=function(){return Pe||(Pe=new Dt(ke.A)),Pe},Le=function(){function t(t,e){void 0===e&&(e=Ae()),this.value=t,this.children=e}return t.fromObject=function(e){var n=t.Empty;return Object(Fe.f)(e,function(t,e){n=n.set(new v(t),e)}),n},t.prototype.isEmpty=function(){return null===this.value&&this.children.isEmpty()},t.prototype.findRootMostMatchingPathAndValue=function(t,e){if(null!=this.value&&e(this.value))return{path:v.Empty,value:this.value};if(t.isEmpty())return null;var n=t.getFront(),r=this.children.get(n);if(null!==r){var i=r.findRootMostMatchingPathAndValue(t.popFront(),e);return null!=i?{path:new v(n).child(i.path),value:i.value}:null}return null},t.prototype.findRootMostValueAndPath=function(t){return this.findRootMostMatchingPathAndValue(t,function(){return!0})},t.prototype.subtree=function(e){if(e.isEmpty())return this;var n=e.getFront(),r=this.children.get(n);return null!==r?r.subtree(e.popFront()):t.Empty},t.prototype.set=function(e,n){if(e.isEmpty())return new t(n,this.children);var r=e.getFront(),i=this.children.get(r)||t.Empty,o=i.set(e.popFront(),n),s=this.children.insert(r,o);return new t(this.value,s)},t.prototype.remove=function(e){if(e.isEmpty())return this.children.isEmpty()?t.Empty:new t(null,this.children);var n=e.getFront(),r=this.children.get(n);if(r){var i=r.remove(e.popFront()),o=void 0;return o=i.isEmpty()?this.children.remove(n):this.children.insert(n,i),null===this.value&&o.isEmpty()?t.Empty:new t(this.value,o)}return this},t.prototype.get=function(t){if(t.isEmpty())return this.value;var e=t.getFront(),n=this.children.get(e);return n?n.get(t.popFront()):null},t.prototype.setTree=function(e,n){if(e.isEmpty())return n;var r=e.getFront(),i=this.children.get(r)||t.Empty,o=i.setTree(e.popFront(),n),s=void 0;return s=o.isEmpty()?this.children.remove(r):this.children.insert(r,o),new t(this.value,s)},t.prototype.fold=function(t){return this.ue(v.Empty,t)},t.prototype.ue=function(t,e){var n={};return this.children.inorderTraversal(function(r,i){n[r]=i.ue(t.child(r),e)}),e(t,this.value,n)},t.prototype.findOnPath=function(t,e){return this.ce(t,v.Empty,e)},t.prototype.ce=function(t,e,n){var r=!!this.value&&n(e,this.value);if(r)return r;if(t.isEmpty())return null;var i=t.getFront(),o=this.children.get(i);return o?o.ce(t.popFront(),e.child(i),n):null},t.prototype.foreachOnPath=function(t,e){return this.he(t,v.Empty,e)},t.prototype.he=function(e,n,r){if(e.isEmpty())return this;this.value&&r(n,this.value);var i=e.getFront(),o=this.children.get(i);return o?o.he(e.popFront(),n.child(i),r):t.Empty},t.prototype.foreach=function(t){this.le(v.Empty,t)},t.prototype.le=function(t,e){this.children.inorderTraversal(function(n,r){r.le(t.child(n),e)}),this.value&&e(t,this.value)},t.prototype.foreachChild=function(t){this.children.inorderTraversal(function(e,n){n.value&&t(e,n.value)})},t.Empty=new t(null),t}(),Me=function(){function t(t,e){this.source=t,this.path=e,this.type=$t.LISTEN_COMPLETE}return t.prototype.operationForChild=function(e){return this.path.isEmpty()?new t(this.source,v.Empty):new t(this.source,this.path.popFront())},t}(),We=function(){function t(t,e,n){this.source=t,this.path=e,this.snap=n,this.type=$t.OVERWRITE}return t.prototype.operationForChild=function(e){return this.path.isEmpty()?new t(this.source,v.Empty,this.snap.getImmediateChild(e)):new t(this.source,this.path.popFront(),this.snap)},t}(),qe=n(0),Qe=function(){function t(t,e,n){this.source=t,this.path=e,this.children=n,this.type=$t.MERGE}return t.prototype.operationForChild=function(e){if(this.path.isEmpty()){var n=this.children.subtree(new v(e));return n.isEmpty()?null:n.value?new We(this.source,v.Empty,n.value):new t(this.source,v.Empty,n)}return Object(qe.a)(this.path.getFront()===e,"Can't get a merge for a child not on the path of the operation"),new t(this.source,this.path.popFront(),this.children)},t.prototype.toString=function(){return"Operation("+this.path+": "+this.source+" merge: "+this.children+")"},t}(),Ue=function(){function t(t,e,n){this.zt=t,this.pe=e,this.de=n}return t.prototype.isFullyInitialized=function(){return this.pe},t.prototype.isFiltered=function(){return this.de},t.prototype.isCompleteForPath=function(t){if(t.isEmpty())return this.isFullyInitialized()&&!this.de;var e=t.getFront();return this.isCompleteForChild(e)},t.prototype.isCompleteForChild=function(t){return this.isFullyInitialized()&&!this.de||this.zt.hasChild(t)},t.prototype.getNode=function(){return this.zt},t}(),Ve=function(){function t(t,e){this.fe=t,this._e=e}return t.prototype.updateEventSnap=function(e,n,r){return new t(new Ue(e,n,r),this._e)},t.prototype.updateServerSnap=function(e,n,r){return new t(this.fe,new Ue(e,n,r))},t.prototype.getEventCache=function(){return this.fe},t.prototype.getCompleteEventSnap=function(){return this.fe.isFullyInitialized()?this.fe.getNode():null},t.prototype.getServerCache=function(){return this._e},t.prototype.getCompleteServerSnap=function(){return this._e.isFullyInitialized()?this._e.getNode():null},t.Empty=new t(new Ue(Vt.EMPTY_NODE,!1,!1),new Ue(Vt.EMPTY_NODE,!1,!1)),t}(),Be=function(){function t(t,e,n,r,i){this.type=t,this.snapshotNode=e,this.childName=n,this.oldSnap=r,this.prevName=i}return t.valueChange=function(e){return new t(t.VALUE,e)},t.childAddedChange=function(e,n){return new t(t.CHILD_ADDED,n,e)},t.childRemovedChange=function(e,n){return new t(t.CHILD_REMOVED,n,e)},t.childChangedChange=function(e,n,r){return new t(t.CHILD_CHANGED,n,e,r)},t.childMovedChange=function(e,n){return new t(t.CHILD_MOVED,n,e)},t.CHILD_ADDED="child_added",t.CHILD_REMOVED="child_removed",t.CHILD_CHANGED="child_changed",t.CHILD_MOVED="child_moved",t.VALUE="value",t}(),He=n(0),Ke=function(){function t(t){this.Xt=t}return t.prototype.updateChild=function(t,e,n,r,i,o){Object(He.a)(t.isIndexed(this.Xt),"A node must be indexed if only a child is updated");var s=t.getImmediateChild(e);return s.getChild(r).equals(n.getChild(r))&&s.isEmpty()==n.isEmpty()?t:(null!=o&&(n.isEmpty()?t.hasChild(e)?o.trackChildChange(Be.childRemovedChange(e,s)):Object(He.a)(t.isLeafNode(),"A child remove without an old child only makes sense on a leaf node"):s.isEmpty()?o.trackChildChange(Be.childAddedChange(e,n)):o.trackChildChange(Be.childChangedChange(e,n,s))),t.isLeafNode()&&n.isEmpty()?t:t.updateImmediateChild(e,n).withIndex(this.Xt))},t.prototype.updateFullNode=function(t,e,n){return null!=n&&(t.isLeafNode()||t.forEachChild(Nt,function(t,r){e.hasChild(t)||n.trackChildChange(Be.childRemovedChange(t,r))}),e.isLeafNode()||e.forEachChild(Nt,function(e,r){if(t.hasChild(e)){var i=t.getImmediateChild(e);i.equals(r)||n.trackChildChange(Be.childChangedChange(e,r,i))}else n.trackChildChange(Be.childAddedChange(e,r))})),e.withIndex(this.Xt)},t.prototype.updatePriority=function(t,e){return t.isEmpty()?Vt.EMPTY_NODE:t.updatePriority(e)},t.prototype.filtersNodes=function(){return!1},t.prototype.getIndexedFilter=function(){return this},t.prototype.getIndex=function(){return this.Xt},t}(),Ye=n(2),ze=n(0),Ge=function(){function t(){this.ye={}}return t.prototype.trackChildChange=function(t){var e=t.type,n=t.childName;Object(ze.a)(e==Be.CHILD_ADDED||e==Be.CHILD_CHANGED||e==Be.CHILD_REMOVED,"Only child changes supported for tracking"),Object(ze.a)(".priority"!==n,"Only non-priority child changes can be tracked.");var r=Object(Ye.l)(this.ye,n);if(r){var i=r.type;if(e==Be.CHILD_ADDED&&i==Be.CHILD_REMOVED)this.ye[n]=Be.childChangedChange(n,t.snapshotNode,r.snapshotNode);else if(e==Be.CHILD_REMOVED&&i==Be.CHILD_ADDED)delete this.ye[n];else if(e==Be.CHILD_REMOVED&&i==Be.CHILD_CHANGED)this.ye[n]=Be.childRemovedChange(n,r.oldSnap);else if(e==Be.CHILD_CHANGED&&i==Be.CHILD_ADDED)this.ye[n]=Be.childAddedChange(n,t.snapshotNode);else{if(e!=Be.CHILD_CHANGED||i!=Be.CHILD_CHANGED)throw Object(ze.b)("Illegal combination of changes: "+t+" occurred after "+r);this.ye[n]=Be.childChangedChange(n,t.snapshotNode,r.oldSnap)}}else this.ye[n]=t},t.prototype.getChanges=function(){return Object(Ye.i)(this.ye)},t}(),Xe=function(){function t(){}return t.prototype.getCompleteChild=function(t){return null},t.prototype.getChildAfterChild=function(t,e,n){return null},t}(),$e=new Xe,Je=function(){function t(t,e,n){void 0===n&&(n=null),this.ve=t,this.ge=e,this.me=n}return t.prototype.getCompleteChild=function(t){var e=this.ge.getEventCache();if(e.isCompleteForChild(t))return e.getNode().getImmediateChild(t);var n=null!=this.me?new Ue(this.me,!0,!1):this.ge.getServerCache();return this.ve.calcCompleteChild(t,n)},t.prototype.getChildAfterChild=function(t,e,n){var r=null!=this.me?this.me:this.ge.getCompleteServerSnap(),i=this.ve.calcIndexedSlice(r,e,1,n,t);return 0===i.length?null:i[0]},t}(),Ze=n(0),tn=function(){function t(t,e){this.viewCache=t,this.changes=e}return t}(),en=function(){function t(t){this.be=t}return t.prototype.assertIndexed=function(t){Object(Ze.a)(t.getEventCache().getNode().isIndexed(this.be.getIndex()),"Event snap not indexed"),Object(Ze.a)(t.getServerCache().getNode().isIndexed(this.be.getIndex()),"Server snap not indexed")},t.prototype.applyOperation=function(e,n,r,i){var o,s,a=new Ge;if(n.type===$t.OVERWRITE){var u=n;u.source.fromUser?o=this.Ce(e,u.path,u.snap,r,i,a):(Object(Ze.a)(u.source.fromServer,"Unknown source."),s=u.source.tagged||e.getServerCache().isFiltered()&&!u.path.isEmpty(),o=this.Ee(e,u.path,u.snap,r,i,s,a))}else if(n.type===$t.MERGE){var c=n;c.source.fromUser?o=this.we(e,c.path,c.children,r,i,a):(Object(Ze.a)(c.source.fromServer,"Unknown source."),s=c.source.tagged||e.getServerCache().isFiltered(),o=this.Oe(e,c.path,c.children,r,i,s,a))}else if(n.type===$t.ACK_USER_WRITE){var h=n;o=h.revert?this.Se(e,h.path,r,i,a):this.Te(e,h.path,h.affectedTree,r,i,a)}else{if(n.type!==$t.LISTEN_COMPLETE)throw Object(Ze.b)("Unknown operation type: "+n.type);o=this.Ne(e,n.path,r,a)}var l=a.getChanges();return t.Ie(e,o,l),new tn(o,l)},t.Ie=function(t,e,n){var r=e.getEventCache();if(r.isFullyInitialized()){var i=r.getNode().isLeafNode()||r.getNode().isEmpty(),o=t.getCompleteEventSnap();(n.length>0||!t.getEventCache().isFullyInitialized()||i&&!r.getNode().equals(o)||!r.getNode().getPriority().equals(o.getPriority()))&&n.push(Be.valueChange(e.getCompleteEventSnap()))}},t.prototype.Pe=function(t,e,n,r,i){var o=t.getEventCache();if(null!=n.shadowingWrite(e))return t;var s=void 0,a=void 0;if(e.isEmpty())if(Object(Ze.a)(t.getServerCache().isFullyInitialized(),"If change path is empty, we must have complete server data"),t.getServerCache().isFiltered()){var u=t.getCompleteServerSnap(),c=u instanceof Vt?u:Vt.EMPTY_NODE,h=n.calcCompleteEventChildren(c);s=this.be.updateFullNode(t.getEventCache().getNode(),h,i)}else{var l=n.calcCompleteEventCache(t.getCompleteServerSnap());s=this.be.updateFullNode(t.getEventCache().getNode(),l,i)}else{var p=e.getFront();if(".priority"==p){Object(Ze.a)(1==e.getLength(),"Can't have a priority with additional path components");var d=o.getNode();a=t.getServerCache().getNode();var f=n.calcEventCacheAfterServerOverwrite(e,d,a);s=null!=f?this.be.updatePriority(d,f):o.getNode()}else{var _=e.popFront(),y=void 0;if(o.isCompleteForChild(p)){a=t.getServerCache().getNode();var v=n.calcEventCacheAfterServerOverwrite(e,o.getNode(),a);y=null!=v?o.getNode().getImmediateChild(p).updateChild(_,v):o.getNode().getImmediateChild(p)}else y=n.calcCompleteChild(p,t.getServerCache());s=null!=y?this.be.updateChild(o.getNode(),p,y,_,r,i):o.getNode()}}return t.updateEventSnap(s,o.isFullyInitialized()||e.isEmpty(),this.be.filtersNodes())},t.prototype.Ee=function(t,e,n,r,i,o,s){var a,u=t.getServerCache(),c=o?this.be:this.be.getIndexedFilter();if(e.isEmpty())a=c.updateFullNode(u.getNode(),n,null);else if(c.filtersNodes()&&!u.isFiltered()){var h=u.getNode().updateChild(e,n);a=c.updateFullNode(u.getNode(),h,null)}else{var l=e.getFront();if(!u.isCompleteForPath(e)&&e.getLength()>1)return t;var p=e.popFront(),d=u.getNode().getImmediateChild(l),f=d.updateChild(p,n);a=".priority"==l?c.updatePriority(u.getNode(),f):c.updateChild(u.getNode(),l,f,p,$e,null)}var _=t.updateServerSnap(a,u.isFullyInitialized()||e.isEmpty(),c.filtersNodes()),y=new Je(r,_,i);return this.Pe(_,e,r,y,s)},t.prototype.Ce=function(t,e,n,r,i,o){var s,a,u=t.getEventCache(),c=new Je(r,t,i);if(e.isEmpty())a=this.be.updateFullNode(t.getEventCache().getNode(),n,o),s=t.updateEventSnap(a,!0,this.be.filtersNodes());else{var h=e.getFront();if(".priority"===h)a=this.be.updatePriority(t.getEventCache().getNode(),n),s=t.updateEventSnap(a,u.isFullyInitialized(),u.isFiltered());else{var l=e.popFront(),p=u.getNode().getImmediateChild(h),d=void 0;if(l.isEmpty())d=n;else{var f=c.getCompleteChild(h);d=null!=f?".priority"===l.getBack()&&f.getChild(l.parent()).isEmpty()?f:f.updateChild(l,n):Vt.EMPTY_NODE}if(p.equals(d))s=t;else{var _=this.be.updateChild(u.getNode(),h,d,l,c,o);s=t.updateEventSnap(_,u.isFullyInitialized(),this.be.filtersNodes())}}}return s},t.Re=function(t,e){return t.getEventCache().isCompleteForChild(e)},t.prototype.we=function(e,n,r,i,o,s){var a=this,u=e;return r.foreach(function(r,c){var h=n.child(r);t.Re(e,h.getFront())&&(u=a.Ce(u,h,c,i,o,s))}),r.foreach(function(r,c){var h=n.child(r);t.Re(e,h.getFront())||(u=a.Ce(u,h,c,i,o,s))}),u},t.prototype.De=function(t,e){return e.foreach(function(e,n){t=t.updateChild(e,n)}),t},t.prototype.Oe=function(t,e,n,r,i,o,s){var a=this;if(t.getServerCache().getNode().isEmpty()&&!t.getServerCache().isFullyInitialized())return t;var u,c=t;u=e.isEmpty()?n:Le.Empty.setTree(e,n);var h=t.getServerCache().getNode();return u.children.inorderTraversal(function(e,n){if(h.hasChild(e)){var u=t.getServerCache().getNode().getImmediateChild(e),l=a.De(u,n);c=a.Ee(c,new v(e),l,r,i,o,s)}}),u.children.inorderTraversal(function(e,n){var u=!t.getServerCache().isCompleteForChild(e)&&null==n.value;if(!h.hasChild(e)&&!u){var l=t.getServerCache().getNode().getImmediateChild(e),p=a.De(l,n);c=a.Ee(c,new v(e),p,r,i,o,s)}}),c},t.prototype.Te=function(t,e,n,r,i,o){if(null!=r.shadowingWrite(e))return t;var s=t.getServerCache().isFiltered(),a=t.getServerCache();if(null!=n.value){if(e.isEmpty()&&a.isFullyInitialized()||a.isCompleteForPath(e))return this.Ee(t,e,a.getNode().getChild(e),r,i,s,o);if(e.isEmpty()){var u=Le.Empty;return a.getNode().forEachChild(dt,function(t,e){u=u.set(new v(t),e)}),this.Oe(t,e,u,r,i,s,o)}return t}var c=Le.Empty;return n.foreach(function(t,n){var r=e.child(t);a.isCompleteForPath(r)&&(c=c.set(t,a.getNode().getChild(r)))}),this.Oe(t,e,c,r,i,s,o)},t.prototype.Ne=function(t,e,n,r){var i=t.getServerCache(),o=t.updateServerSnap(i.getNode(),i.isFullyInitialized()||e.isEmpty(),i.isFiltered());return this.Pe(o,e,n,$e,r)},t.prototype.Se=function(t,e,n,r,i){var o;if(null!=n.shadowingWrite(e))return t;var s=new Je(n,t,r),a=t.getEventCache().getNode(),u=void 0;if(e.isEmpty()||".priority"===e.getFront()){var c=void 0;if(t.getServerCache().isFullyInitialized())c=n.calcCompleteEventCache(t.getCompleteServerSnap());else{var h=t.getServerCache().getNode();Object(Ze.a)(h instanceof Vt,"serverChildren would be complete if leaf node"),c=n.calcCompleteEventChildren(h)}c=c,u=this.be.updateFullNode(a,c,i)}else{var l=e.getFront(),p=n.calcCompleteChild(l,t.getServerCache());null==p&&t.getServerCache().isCompleteForChild(l)&&(p=a.getImmediateChild(l)),u=null!=p?this.be.updateChild(a,l,p,e.popFront(),s,i):t.getEventCache().getNode().hasChild(l)?this.be.updateChild(a,l,Vt.EMPTY_NODE,e.popFront(),s,i):a,u.isEmpty()&&t.getServerCache().isFullyInitialized()&&(o=n.calcCompleteEventCache(t.getCompleteServerSnap()),o.isLeafNode()&&(u=this.be.updateFullNode(u,o,i)))}return o=t.getServerCache().isFullyInitialized()||null!=n.shadowingWrite(v.Empty),t.updateEventSnap(u,o,this.be.filtersNodes())},t}(),nn=n(0),rn=function(){function t(t){this.je=t,this.Xt=this.je.getQueryParams().getIndex()}return t.prototype.generateEventsForChanges=function(t,e,n){var r=this,i=[],o=[];return t.forEach(function(t){t.type===Be.CHILD_CHANGED&&r.Xt.indexedValueChanged(t.oldSnap,t.snapshotNode)&&o.push(Be.childMovedChange(t.childName,t.snapshotNode))}),this.xe(i,Be.CHILD_REMOVED,t,n,e),this.xe(i,Be.CHILD_ADDED,t,n,e),this.xe(i,Be.CHILD_MOVED,o,n,e),this.xe(i,Be.CHILD_CHANGED,t,n,e),this.xe(i,Be.VALUE,t,n,e),i},t.prototype.xe=function(t,e,n,r,i){var o=this,s=n.filter(function(t){return t.type===e});s.sort(this.ke.bind(this)),s.forEach(function(e){var n=o.Fe(e,i);r.forEach(function(r){r.respondsTo(e.type)&&t.push(r.createEvent(n,o.je))})})},t.prototype.Fe=function(t,e){return"value"===t.type||"child_removed"===t.type?t:(t.prevName=e.getPredecessorChildName(t.childName,t.snapshotNode,this.Xt),t)},t.prototype.ke=function(t,e){if(null==t.childName||null==e.childName)throw Object(nn.b)("Should only compare child_ events.");var n=new st(t.childName,t.snapshotNode),r=new st(e.childName,e.snapshotNode);return this.Xt.compare(n,r)},t}(),on=n(0),sn=function(){function t(t,e){this.je=t,this.Ae=[];var n=this.je.getQueryParams(),r=new Ke(n.getIndex()),i=n.getNodeFilter();this.Le=new en(i);var o=e.getServerCache(),s=e.getEventCache(),a=r.updateFullNode(Vt.EMPTY_NODE,o.getNode(),null),u=i.updateFullNode(Vt.EMPTY_NODE,s.getNode(),null),c=new Ue(a,o.isFullyInitialized(),r.filtersNodes()),h=new Ue(u,s.isFullyInitialized(),i.filtersNodes());this.ge=new Ve(h,c),this.Me=new rn(this.je)}return t.prototype.getQuery=function(){return this.je},t.prototype.getServerCache=function(){return this.ge.getServerCache().getNode()},t.prototype.getCompleteServerCache=function(t){var e=this.ge.getCompleteServerSnap();return e&&(this.je.getQueryParams().loadsAllData()||!t.isEmpty()&&!e.getImmediateChild(t.getFront()).isEmpty())?e.getChild(t):null},t.prototype.isEmpty=function(){return 0===this.Ae.length},t.prototype.addEventRegistration=function(t){this.Ae.push(t)},t.prototype.removeEventRegistration=function(t,e){var n=[];if(e){Object(on.a)(null==t,"A cancel should cancel all event registrations.");var r=this.je.path;this.Ae.forEach(function(t){e=e;var i=t.createCancelEvent(e,r);i&&n.push(i)})}if(t){for(var i=[],o=0;o<this.Ae.length;++o){var s=this.Ae[o];if(s.matches(t)){if(t.hasAnyCallback()){i=i.concat(this.Ae.slice(o+1));break}}else i.push(s)}this.Ae=i}else this.Ae=[];return n},t.prototype.applyOperation=function(t,e,n){t.type===$t.MERGE&&null!==t.source.queryId&&(Object(on.a)(this.ge.getCompleteServerSnap(),"We should always have a full cache before handling merges"),Object(on.a)(this.ge.getCompleteEventSnap(),"Missing event cache, even though we have a server cache"));var r=this.ge,i=this.Le.applyOperation(r,t,e,n);return this.Le.assertIndexed(i.viewCache),Object(on.a)(i.viewCache.getServerCache().isFullyInitialized()||!r.getServerCache().isFullyInitialized(),"Once a server snap is complete, it should never go back"),this.ge=i.viewCache,this.We(i.changes,i.viewCache.getEventCache().getNode(),null)},t.prototype.getInitialEvents=function(t){var e=this.ge.getEventCache(),n=[];return e.getNode().isLeafNode()||e.getNode().forEachChild(Nt,function(t,e){n.push(Be.childAddedChange(t,e))}),e.isFullyInitialized()&&n.push(Be.valueChange(e.getNode())),this.We(n,e.getNode(),t)},t.prototype.We=function(t,e,n){var r=n?[n]:this.Ae;return this.Me.generateEventsForChanges(t,e,r)},t}(),an=n(0),un=n(2),cn=function(){function t(){this.qe={}}return Object.defineProperty(t,"__referenceConstructor",{get:function(){return Object(an.a)(Re,"Reference.ts has not been loaded"),Re},set:function(t){Object(an.a)(!Re,"__referenceConstructor has already been defined"),Re=t},enumerable:!0,configurable:!0}),t.prototype.isEmpty=function(){return Object(un.j)(this.qe)},t.prototype.applyOperation=function(t,e,n){var r=t.source.queryId;if(null!==r){var i=Object(un.l)(this.qe,r);return Object(an.a)(null!=i,"SyncTree gave us an op for an invalid query."),i.applyOperation(t,e,n)}var o=[];return Object(un.f)(this.qe,function(r,i){o=o.concat(i.applyOperation(t,e,n))}),o},t.prototype.addEventRegistration=function(t,e,n,r,i){var o=t.queryIdentifier(),s=Object(un.l)(this.qe,o);if(!s){var a=n.calcCompleteEventCache(i?r:null),u=!1;a?u=!0:r instanceof Vt?(a=n.calcCompleteEventChildren(r),u=!1):(a=Vt.EMPTY_NODE,u=!1);var c=new Ve(new Ue(a,u,!1),new Ue(r,i,!1));s=new sn(t,c),this.qe[o]=s}return s.addEventRegistration(e),s.getInitialEvents(e)},t.prototype.removeEventRegistration=function(e,n,r){var i=e.queryIdentifier(),o=[],s=[],a=this.hasCompleteView();if("default"===i){var u=this;Object(un.f)(this.qe,function(t,e){s=s.concat(e.removeEventRegistration(n,r)),e.isEmpty()&&(delete u.qe[t],e.getQuery().getQueryParams().loadsAllData()||o.push(e.getQuery()))})}else{var c=Object(un.l)(this.qe,i);c&&(s=s.concat(c.removeEventRegistration(n,r)),c.isEmpty()&&(delete this.qe[i],c.getQuery().getQueryParams().loadsAllData()||o.push(c.getQuery())))}return a&&!this.hasCompleteView()&&o.push(new t.se(e.repo,e.path)),{removed:o,events:s}},t.prototype.getQueryViews=function(){var t=this;return Object.keys(this.qe).map(function(e){return t.qe[e]}).filter(function(t){return!t.getQuery().getQueryParams().loadsAllData()})},t.prototype.getCompleteServerCache=function(t){var e=null;return Object(un.f)(this.qe,function(n,r){e=e||r.getCompleteServerCache(t)}),e},t.prototype.viewForQuery=function(t){if(t.getQueryParams().loadsAllData())return this.getCompleteView();var e=t.queryIdentifier();return Object(un.l)(this.qe,e)},t.prototype.viewExistsForQuery=function(t){return null!=this.viewForQuery(t)},t.prototype.hasCompleteView=function(){return null!=this.getCompleteView()},t.prototype.getCompleteView=function(){return Object(un.e)(this.qe,function(t){return t.getQuery().getQueryParams().loadsAllData()})||null},t}(),hn=n(2),ln=n(0),pn=function(){function t(t){this.Qe=t}return t.prototype.addWrite=function(e,n){if(e.isEmpty())return new t(new Le(n));var r=this.Qe.findRootMostValueAndPath(e);if(null!=r){var i=r.path,o=r.value,s=v.relativePath(i,e);return o=o.updateChild(s,n),new t(this.Qe.set(i,o))}var a=new Le(n);return new t(this.Qe.setTree(e,a))},t.prototype.addWrites=function(t,e){var n=this;return Object(hn.f)(e,function(e,r){n=n.addWrite(t.child(e),r)}),n},t.prototype.removeWrite=function(e){return e.isEmpty()?t.Empty:new t(this.Qe.setTree(e,Le.Empty))},t.prototype.hasCompleteWrite=function(t){return null!=this.getCompleteNode(t)},t.prototype.getCompleteNode=function(t){var e=this.Qe.findRootMostValueAndPath(t);return null!=e?this.Qe.get(e.path).getChild(v.relativePath(e.path,t)):null},t.prototype.getCompleteChildren=function(){var t=[],e=this.Qe.value;return null!=e?e.isLeafNode()||e.forEachChild(Nt,function(e,n){t.push(new st(e,n))}):this.Qe.children.inorderTraversal(function(e,n){null!=n.value&&t.push(new st(e,n.value))}),t},t.prototype.childCompoundWrite=function(e){if(e.isEmpty())return this;var n=this.getCompleteNode(e);return new t(null!=n?new Le(n):this.Qe.subtree(e))},t.prototype.isEmpty=function(){return this.Qe.isEmpty()},t.prototype.apply=function(e){return t.Ue(v.Empty,this.Qe,e)},t.Empty=new t(new Le(null)),t.Ue=function(e,n,r){if(null!=n.value)return r.updateChild(e,n.value);var i=null;return n.children.inorderTraversal(function(n,o){".priority"===n?(Object(ln.a)(null!==o.value,"Priority writes must always be leaf nodes"),i=o.value):r=t.Ue(e.child(n),o,r)}),r.getChild(e).isEmpty()||null===i||(r=r.updateChild(e.child(".priority"),i)),r},t}(),dn=n(2),fn=n(0),_n=function(){function t(){this.Ve=pn.Empty,this.Be=[],this.He=-1}return t.prototype.childWrites=function(t){return new yn(t,this)},t.prototype.addOverwrite=function(t,e,n,r){Object(fn.a)(n>this.He,"Stacking an older write on top of newer ones"),void 0===r&&(r=!0),this.Be.push({path:t,snap:e,writeId:n,visible:r}),r&&(this.Ve=this.Ve.addWrite(t,e)),this.He=n},t.prototype.addMerge=function(t,e,n){Object(fn.a)(n>this.He,"Stacking an older merge on top of newer ones"),this.Be.push({path:t,children:e,writeId:n,visible:!0}),this.Ve=this.Ve.addWrites(t,e),this.He=n},t.prototype.getWrite=function(t){for(var e=0;e<this.Be.length;e++){var n=this.Be[e];if(n.writeId===t)return n}return null},t.prototype.removeWrite=function(t){var e=this,n=this.Be.findIndex(function(e){return e.writeId===t});Object(fn.a)(n>=0,"removeWrite called with nonexistent writeId.");var r=this.Be[n];this.Be.splice(n,1);for(var i=r.visible,o=!1,s=this.Be.length-1;i&&s>=0;){var a=this.Be[s];a.visible&&(s>=n&&this.Ke(a,r.path)?i=!1:r.path.contains(a.path)&&(o=!0)),s--}if(i){if(o)return this.Ye(),!0;if(r.snap)this.Ve=this.Ve.removeWrite(r.path);else{var u=r.children;Object(dn.f)(u,function(t){e.Ve=e.Ve.removeWrite(r.path.child(t))})}return!0}return!1},t.prototype.getCompleteWriteData=function(t){return this.Ve.getCompleteNode(t)},t.prototype.calcCompleteEventCache=function(e,n,r,i){if(r||i){var o=this.Ve.childCompoundWrite(e);if(!i&&o.isEmpty())return n;if(i||null!=n||o.hasCompleteWrite(v.Empty)){var s=function(t){return(t.visible||i)&&(!r||!~r.indexOf(t.writeId))&&(t.path.contains(e)||e.contains(t.path))},a=t.ze(this.Be,s,e),u=n||Vt.EMPTY_NODE;return a.apply(u)}return null}var c=this.Ve.getCompleteNode(e);if(null!=c)return c;var h=this.Ve.childCompoundWrite(e);if(h.isEmpty())return n;if(null!=n||h.hasCompleteWrite(v.Empty)){var u=n||Vt.EMPTY_NODE;return h.apply(u)}return null},t.prototype.calcCompleteEventChildren=function(t,e){var n=Vt.EMPTY_NODE,r=this.Ve.getCompleteNode(t);if(r)return r.isLeafNode()||r.forEachChild(Nt,function(t,e){n=n.updateImmediateChild(t,e)}),n;if(e){var i=this.Ve.childCompoundWrite(t);return e.forEachChild(Nt,function(t,e){var r=i.childCompoundWrite(new v(t)).apply(e);n=n.updateImmediateChild(t,r)}),i.getCompleteChildren().forEach(function(t){n=n.updateImmediateChild(t.name,t.node)}),n}return this.Ve.childCompoundWrite(t).getCompleteChildren().forEach(function(t){n=n.updateImmediateChild(t.name,t.node)}),n},t.prototype.calcEventCacheAfterServerOverwrite=function(t,e,n,r){Object(fn.a)(n||r,"Either existingEventSnap or existingServerSnap must exist");var i=t.child(e);if(this.Ve.hasCompleteWrite(i))return null;var o=this.Ve.childCompoundWrite(i);return o.isEmpty()?r.getChild(e):o.apply(r.getChild(e))},t.prototype.calcCompleteChild=function(t,e,n){var r=t.child(e),i=this.Ve.getCompleteNode(r);return null!=i?i:n.isCompleteForChild(e)?this.Ve.childCompoundWrite(r).apply(n.getNode().getImmediateChild(e)):null},t.prototype.shadowingWrite=function(t){return this.Ve.getCompleteNode(t)},t.prototype.calcIndexedSlice=function(t,e,n,r,i,o){var s,a=this.Ve.childCompoundWrite(t),u=a.getCompleteNode(v.Empty);if(null!=u)s=u;else{if(null==e)return[];s=a.apply(e)}if(s=s.withIndex(o),s.isEmpty()||s.isLeafNode())return[];for(var c=[],h=o.getCompare(),l=i?s.getReverseIteratorFrom(n,o):s.getIteratorFrom(n,o),p=l.getNext();p&&c.length<r;)0!==h(p,n)&&c.push(p),p=l.getNext();return c},t.prototype.Ke=function(t,e){return t.snap?t.path.contains(e):!!Object(dn.d)(t.children,function(n,r){return t.path.child(r).contains(e)})},t.prototype.Ye=function(){this.Ve=t.ze(this.Be,t.Ge,v.Empty),this.Be.length>0?this.He=this.Be[this.Be.length-1].writeId:this.He=-1},t.Ge=function(t){return t.visible},t.ze=function(t,e,n){for(var r=pn.Empty,i=0;i<t.length;++i){var o=t[i];if(e(o)){var s=o.path,a=void 0;if(o.snap)n.contains(s)?(a=v.relativePath(n,s),r=r.addWrite(a,o.snap)):s.contains(n)&&(a=v.relativePath(s,n),r=r.addWrite(v.Empty,o.snap.getChild(a)));else{if(!o.children)throw Object(fn.b)("WriteRecord should have .snap or .children");if(n.contains(s))a=v.relativePath(n,s),r=r.addWrites(a,o.children);else if(s.contains(n))if(a=v.relativePath(s,n),a.isEmpty())r=r.addWrites(v.Empty,o.children);else{var u=Object(dn.l)(o.children,a.getFront());if(u){var c=u.getChild(a.popFront());r=r.addWrite(v.Empty,c)}}}}}return r},t}(),yn=function(){function t(t,e){this.Xe=t,this.Qe=e}return t.prototype.calcCompleteEventCache=function(t,e,n){return this.Qe.calcCompleteEventCache(this.Xe,t,e,n)},t.prototype.calcCompleteEventChildren=function(t){return this.Qe.calcCompleteEventChildren(this.Xe,t)},t.prototype.calcEventCacheAfterServerOverwrite=function(t,e,n){return this.Qe.calcEventCacheAfterServerOverwrite(this.Xe,t,e,n)},t.prototype.shadowingWrite=function(t){return this.Qe.shadowingWrite(this.Xe.child(t))},t.prototype.calcIndexedSlice=function(t,e,n,r,i){return this.Qe.calcIndexedSlice(this.Xe,t,e,n,r,i)},t.prototype.calcCompleteChild=function(t,e){return this.Qe.calcCompleteChild(this.Xe,t,e)},t.prototype.child=function(e){return new t(this.Xe.child(e),this.Qe)},t}(),vn=n(0),gn=n(1),mn=n(2),bn=function(){function t(t){this.$e=t,this.Je=Le.Empty,this.Ze=new _n,this.tn={},this.en={}}return t.prototype.applyUserOverwrite=function(t,e,n,r){return this.Ze.addOverwrite(t,e,n,r),r?this.nn(new We(De.User,t,e)):[]},t.prototype.applyUserMerge=function(t,e,n){this.Ze.addMerge(t,e,n);var r=Le.fromObject(e);return this.nn(new Qe(De.User,t,r))},t.prototype.ackUserWrite=function(t,e){void 0===e&&(e=!1);var n=this.Ze.getWrite(t);if(this.Ze.removeWrite(t)){var r=Le.Empty;return null!=n.snap?r=r.set(v.Empty,!0):Object(mn.f)(n.children,function(t,e){r=r.set(new v(t),e)}),this.nn(new xe(n.path,r,e))}return[]},t.prototype.applyServerOverwrite=function(t,e){return this.nn(new We(De.Server,t,e))},t.prototype.applyServerMerge=function(t,e){var n=Le.fromObject(e);return this.nn(new Qe(De.Server,t,n))},t.prototype.applyListenComplete=function(t){return this.nn(new Me(De.Server,t))},t.prototype.applyTaggedQueryOverwrite=function(e,n,r){var i=this.rn(r);if(null!=i){var o=t.in(i),s=o.path,a=o.queryId,u=v.relativePath(s,e),c=new We(De.forServerTaggedQuery(a),u,n);return this.sn(s,c)}return[]},t.prototype.applyTaggedQueryMerge=function(e,n,r){var i=this.rn(r);if(i){var o=t.in(i),s=o.path,a=o.queryId,u=v.relativePath(s,e),c=Le.fromObject(n),h=new Qe(De.forServerTaggedQuery(a),u,c);return this.sn(s,h)}return[]},t.prototype.applyTaggedListenComplete=function(e,n){var r=this.rn(n);if(r){var i=t.in(r),o=i.path,s=i.queryId,a=v.relativePath(o,e),u=new Me(De.forServerTaggedQuery(s),a);return this.sn(o,u)}return[]},t.prototype.addEventRegistration=function(e,n){var r=e.path,i=null,o=!1;this.Je.foreachOnPath(r,function(t,e){var n=v.relativePath(t,r);i=i||e.getCompleteServerCache(n),o=o||e.hasCompleteView()});var s=this.Je.get(r);s?(o=o||s.hasCompleteView(),i=i||s.getCompleteServerCache(v.Empty)):(s=new cn,this.Je=this.Je.set(r,s));var a;null!=i?a=!0:(a=!1,i=Vt.EMPTY_NODE,this.Je.subtree(r).foreachChild(function(t,e){var n=e.getCompleteServerCache(v.Empty);n&&(i=i.updateImmediateChild(t,n))}));var u=s.viewExistsForQuery(e);if(!u&&!e.getQueryParams().loadsAllData()){var c=t.an(e);Object(vn.a)(!(c in this.en),"View does not exist, but we have a tag");var h=t.un();this.en[c]=h,this.tn["_"+h]=c}var l=this.Ze.childWrites(r),p=s.addEventRegistration(e,n,l,i,a);if(!u&&!o){var d=s.viewForQuery(e);p=p.concat(this.cn(e,d))}return p},t.prototype.removeEventRegistration=function(e,n,r){var i=this,o=e.path,s=this.Je.get(o),a=[];if(s&&("default"===e.queryIdentifier()||s.viewExistsForQuery(e))){var u=s.removeEventRegistration(e,n,r);s.isEmpty()&&(this.Je=this.Je.remove(o));var c=u.removed;a=u.events;var h=-1!==c.findIndex(function(t){return t.getQueryParams().loadsAllData()}),l=this.Je.findOnPath(o,function(t,e){return e.hasCompleteView()});if(h&&!l){var p=this.Je.subtree(o);if(!p.isEmpty())for(var d=this.hn(p),f=0;f<d.length;++f){var _=d[f],y=_.getQuery(),v=this.ln(_);this.$e.startListening(t.pn(y),this.dn(y),v.hashFn,v.onComplete)}}!l&&c.length>0&&!r&&(h?this.$e.stopListening(t.pn(e),null):c.forEach(function(e){var n=i.en[t.an(e)];i.$e.stopListening(t.pn(e),n)})),this.fn(c)}return a},t.prototype.calcCompleteEventCache=function(t,e){var n=this.Ze,r=this.Je.findOnPath(t,function(e,n){var r=v.relativePath(e,t),i=n.getCompleteServerCache(r);if(i)return i});return n.calcCompleteEventCache(t,r,e,!0)},t.prototype.hn=function(t){return t.fold(function(t,e,n){if(e&&e.hasCompleteView())return[e.getCompleteView()];var r=[];return e&&(r=e.getQueryViews()),Object(mn.f)(n,function(t,e){r=r.concat(e)}),r})},t.prototype.fn=function(e){for(var n=0;n<e.length;++n){var r=e[n];if(!r.getQueryParams().loadsAllData()){var i=t.an(r),o=this.en[i];delete this.en[i],delete this.tn["_"+o]}}},t.pn=function(t){return t.getQueryParams().loadsAllData()&&!t.getQueryParams().isDefault()?t.getRef():t},t.prototype.cn=function(e,n){var r=e.path,i=this.dn(e),o=this.ln(n),s=this.$e.startListening(t.pn(e),i,o.hashFn,o.onComplete),a=this.Je.subtree(r);if(i)Object(vn.a)(!a.value.hasCompleteView(),"If we're adding a query, it shouldn't be shadowed");else for(var u=a.fold(function(t,e,n){if(!t.isEmpty()&&e&&e.hasCompleteView())return[e.getCompleteView().getQuery()];var r=[];return e&&(r=r.concat(e.getQueryViews().map(function(t){return t.getQuery()}))),Object(mn.f)(n,function(t,e){r=r.concat(e)}),r}),c=0;c<u.length;++c){var h=u[c];this.$e.stopListening(t.pn(h),this.dn(h))}return s},t.prototype.ln=function(t){var e=this,n=t.getQuery(),r=this.dn(n);return{hashFn:function(){return(t.getServerCache()||Vt.EMPTY_NODE).hash()},onComplete:function(t){if("ok"===t)return r?e.applyTaggedListenComplete(n.path,r):e.applyListenComplete(n.path);var i=Object(gn.l)(t,n);return e.removeEventRegistration(n,null,i)}}},t.an=function(t){return t.path+"$"+t.queryIdentifier()},t.in=function(t){var e=t.indexOf("$");return Object(vn.a)(-1!==e&&e<t.length-1,"Bad queryKey."),{queryId:t.substr(e+1),path:new v(t.substr(0,e))}},t.prototype.rn=function(t){return this.tn["_"+t]},t.prototype.dn=function(e){var n=t.an(e);return Object(mn.l)(this.en,n)},t.un=function(){return t._n++},t.prototype.sn=function(t,e){var n=this.Je.get(t);Object(vn.a)(n,"Missing sync point for query tag that we're tracking");var r=this.Ze.childWrites(t);return n.applyOperation(e,r,null)},t.prototype.nn=function(t){return this.yn(t,this.Je,null,this.Ze.childWrites(v.Empty))},t.prototype.yn=function(t,e,n,r){if(t.path.isEmpty())return this.vn(t,e,n,r);var i=e.get(v.Empty);null==n&&null!=i&&(n=i.getCompleteServerCache(v.Empty));var o=[],s=t.path.getFront(),a=t.operationForChild(s),u=e.children.get(s);if(u&&a){var c=n?n.getImmediateChild(s):null,h=r.child(s);o=o.concat(this.yn(a,u,c,h))}return i&&(o=o.concat(i.applyOperation(t,r,n))),o},t.prototype.vn=function(t,e,n,r){var i=this,o=e.get(v.Empty);null==n&&null!=o&&(n=o.getCompleteServerCache(v.Empty));var s=[];return e.children.inorderTraversal(function(e,o){var a=n?n.getImmediateChild(e):null,u=r.child(e),c=t.operationForChild(e);c&&(s=s.concat(i.vn(c,o,a,u)))}),o&&(s=s.concat(o.applyOperation(t,r,n))),s},t._n=1,t}(),Cn=function(){function t(){this.gn=Vt.EMPTY_NODE}return t.prototype.getNode=function(t){return this.gn.getChild(t)},t.prototype.updateSnapshot=function(t,e){this.gn=this.gn.updateChild(t,e)},t}(),En=n(1),wn=function(){function t(t){this.mn=t}return t.prototype.getToken=function(t){return this.mn.INTERNAL.getToken(t).then(null,function(t){return t&&"auth/token-not-initialized"===t.code?(Object(En.s)("Got auth/token-not-initialized error. Treating as null token."),null):Promise.reject(t)})},t.prototype.addTokenChangeListener=function(t){this.mn.INTERNAL.addAuthTokenListener(t)},t.prototype.removeTokenChangeListener=function(t){this.mn.INTERNAL.removeAuthTokenListener(t)},t.prototype.notifyForInvalidToken=function(){var t='Provided authentication credentials for the app named "'+this.mn.name+'" are invalid. This usually indicates your app was not initialized correctly. ';"credential"in this.mn.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.mn.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/.',Object(En.B)(t)},t}(),On=n(2),Sn=function(){function t(t){this.bn=t,this.Cn=null}return t.prototype.get=function(){var t=this.bn.get(),e=Object(On.a)(t);return this.Cn&&Object(On.f)(this.Cn,function(t,n){e[t]=e[t]-n}),this.Cn=t,e},t}(),Tn=n(2),Nn=n(1),In=1e4,Pn=3e4,Rn=function(){function t(t,e){this.En=e,this.wn={},this.On=new Sn(t);var n=In+(Pn-In)*Math.random();Object(Nn.x)(this.Sn.bind(this),Math.floor(n))}return t.prototype.includeStat=function(t){this.wn[t]=!0},t.prototype.Sn=function(){var t=this,e=this.On.get(),n={},r=!1;Object(Tn.f)(e,function(e,i){i>0&&Object(Tn.b)(t.wn,e)&&(n[e]=i,r=!0)}),r&&this.En.reportStats(n),Object(Nn.x)(this.Sn.bind(this),Math.floor(2*Math.random()*3e5))},t}(),Dn=n(1),jn=function(){function t(){this.Tn=[],this.Nn=0}return t.prototype.queueEvents=function(t){for(var e=null,n=0;n<t.length;n++){var r=t[n],i=r.getPath();null===e||i.equals(e.getPath())||(this.Tn.push(e),e=null),null===e&&(e=new xn(i)),e.add(r)}e&&this.Tn.push(e)},t.prototype.raiseEventsAtPath=function(t,e){this.queueEvents(e),this.In(function(e){return e.equals(t)})},t.prototype.raiseEventsForChangedPath=function(t,e){this.queueEvents(e),this.In(function(e){return e.contains(t)||t.contains(e)})},t.prototype.In=function(t){this.Nn++;for(var e=!0,n=0;n<this.Tn.length;n++){var r=this.Tn[n];r&&(t(r.getPath())?(this.Tn[n].raise(),this.Tn[n]=null):e=!1)}e&&(this.Tn=[]),this.Nn--},t}(),xn=function(){function t(t){this.yt=t,this.Pn=[]}return t.prototype.add=function(t){this.Pn.push(t)},t.prototype.raise=function(){for(var t=0;t<this.Pn.length;t++){var e=this.Pn[t];if(null!==e){this.Pn[t]=null;var n=e.getEventRunner();Dn.u&&Object(Dn.s)("event: "+e),Object(Dn.m)(n)}}},t.prototype.getPath=function(){return this.yt},t}(),kn=n(0),Fn=function(){function t(t){this.Rn=t,this.Dn={},Object(kn.a)(Array.isArray(t)&&t.length>0,"Requires a non-empty array")}return t.prototype.trigger=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(Array.isArray(this.Dn[t]))for(var r=this.Dn[t].slice(),i=0;i<r.length;i++)r[i].callback.apply(r[i].context,e)},t.prototype.on=function(t,e,n){this.jn(t),this.Dn[t]=this.Dn[t]||[],this.Dn[t].push({callback:e,context:n});var r=this.getInitialEvent(t);r&&e.apply(n,r)},t.prototype.off=function(t,e,n){this.jn(t);for(var r=this.Dn[t]||[],i=0;i<r.length;i++)if(r[i].callback===e&&(!n||n===r[i].context))return void r.splice(i,1)},t.prototype.jn=function(t){Object(kn.a)(this.Rn.find(function(e){return e===t}),"Unknown event: "+t)},t}(),An=n(0),Ln=this&&this.I||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Mn=function(t){function e(){var e,n,r=t.call(this,["visible"])||this;return"undefined"!=typeof document&&void 0!==document.addEventListener&&(void 0!==document.hidden?(n="visibilitychange",e="hidden"):void 0!==document.mozHidden?(n="mozvisibilitychange",e="mozHidden"):void 0!==document.msHidden?(n="msvisibilitychange",e="msHidden"):void 0!==document.webkitHidden&&(n="webkitvisibilitychange",e="webkitHidden")),r.xn=!0,n&&document.addEventListener(n,function(){var t=!document[e];t!==r.xn&&(r.xn=t,r.trigger("visible",t))},!1),r}return Ln(e,t),e.getInstance=function(){return new e},e.prototype.getInitialEvent=function(t){return Object(An.a)("visible"===t,"Unknown event type: "+t),[this.xn]},e}(Fn),Wn=n(0),qn=n(6),Qn=this&&this.I||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Un=function(t){function e(){var e=t.call(this,["online"])||this;return e.kn=!0,"undefined"==typeof window||void 0===window.addEventListener||Object(qn.a)()||(window.addEventListener("online",function(){e.kn||(e.kn=!0,e.trigger("online",!0))},!1),window.addEventListener("offline",function(){e.kn&&(e.kn=!1,e.trigger("online",!1))},!1)),e}return Qn(e,t),e.getInstance=function(){return new e},e.prototype.getInitialEvent=function(t){return Object(Wn.a)("online"===t,"Unknown event type: "+t),[this.kn]},e.prototype.currentlyOnline=function(){return this.kn},e}(Fn),Vn=n(1),Bn=n(3),Hn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Kn=function(t){var e={},n={},r={},i="";try{var o=t.split(".");e=Object(Bn.a)(Object(Vn.e)(o[0])||""),n=Object(Bn.a)(Object(Vn.e)(o[1])||""),i=o[2],r=n.d||{},delete n.d}catch(t){}return{header:e,claims:n,data:r,signature:i}},Yn=function(t){var e=Kn(t),n=e.claims;return!!e.signature&&!!n&&"object"===(void 0===n?"undefined":Hn(n))&&n.hasOwnProperty("iat")},zn=function(t){var e=Kn(t).claims;return"object"===(void 0===e?"undefined":Hn(e))&&!0===e.admin},Gn=n(1),Xn=function(){function t(t){this.Fn=t,this.pendingResponses=[],this.currentResponseNum=0,this.closeAfterResponse=-1,this.onClose=null}return t.prototype.closeAfter=function(t,e){this.closeAfterResponse=t,this.onClose=e,this.closeAfterResponse<this.currentResponseNum&&(this.onClose(),this.onClose=null)},t.prototype.handleResponse=function(t,e){var n=this;this.pendingResponses[t]=e;for(var r=this;this.pendingResponses[this.currentResponseNum]&&"break"!==function(){var t=r.pendingResponses[r.currentResponseNum];delete r.pendingResponses[r.currentResponseNum];for(var e=0;e<t.length;++e)!function(e){t[e]&&Object(Gn.m)(function(){n.Fn(t[e])})}(e);if(r.currentResponseNum===r.closeAfterResponse)return r.onClose&&(r.onClose(),r.onClose=null),"break";r.currentResponseNum++}(););},t}(),$n=n(1),Jn=n(12),Zn=n(9),tr=n(3),er=n(6),nr="pLPCommand",rr="pRTLPCB",ir=function(){function t(t,e,n,r){this.connId=t,this.repoInfo=e,this.transportSessionId=n,this.lastSessionId=r,this.bytesSent=0,this.bytesReceived=0,this.Z=!1,this.X=Object($n.t)(t),this.$=Jn.a.getCollection(e),this.urlFn=function(t){return e.connectionURL(Zn.d,t)}}return t.prototype.open=function(t,e){var n=this;this.curSegmentNum=0,this.An=e,this.myPacketOrderer=new Xn(t),this.ut=!1,this.Ln=setTimeout(function(){n.X("Timed out trying to connect."),n.tt(),n.Ln=null},Math.floor(3e4)),Object($n.n)(function(){if(!n.ut){n.scriptTagHolder=new or(function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t[0],i=t[1],o=t[2];if(t[3],t[4],n.Mn(t),n.scriptTagHolder)if(n.Ln&&(clearTimeout(n.Ln),n.Ln=null),n.Z=!0,"start"==r)n.id=i,n.password=o;else{if("close"!==r)throw Error("Unrecognized command received: "+r);i?(n.scriptTagHolder.sendNewPolls=!1,n.myPacketOrderer.closeAfter(i,function(){n.tt()})):n.tt()}},function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t[0],i=t[1];n.Mn(t),n.myPacketOrderer.handleResponse(r,i)},function(){n.tt()},n.urlFn);var t={};t.start="t",t.ser=Math.floor(1e8*Math.random()),n.scriptTagHolder.uniqueCallbackIdentifier&&(t.cb=n.scriptTagHolder.uniqueCallbackIdentifier),t[Zn.h]=Zn.e,n.transportSessionId&&(t[Zn.g]=n.transportSessionId),n.lastSessionId&&(t[Zn.c]=n.lastSessionId),!Object(er.b)()&&"undefined"!=typeof location&&location.href&&-1!==location.href.indexOf(Zn.a)&&(t[Zn.f]=Zn.b);var e=n.urlFn(t);n.X("Connecting via long-poll to "+e),n.scriptTagHolder.addTag(e,function(){})}})},t.prototype.start=function(){this.scriptTagHolder.startLongPoll(this.id,this.password),this.addDisconnectPingFrame(this.id,this.password)},t.forceAllow=function(){t.Wn=!0},t.forceDisallow=function(){t.et=!0},t.isAvailable=function(){return t.Wn||!t.et&&"undefined"!=typeof document&&null!=document.createElement&&!Object($n.p)()&&!Object($n.r)()&&!Object(er.b)()},t.prototype.markConnectionHealthy=function(){},t.prototype.st=function(){this.ut=!0,this.scriptTagHolder&&(this.scriptTagHolder.close(),this.scriptTagHolder=null),this.myDisconnFrame&&(document.body.removeChild(this.myDisconnFrame),this.myDisconnFrame=null),this.Ln&&(clearTimeout(this.Ln),this.Ln=null)},t.prototype.tt=function(){this.ut||(this.X("Longpoll is closing itself"),this.st(),this.An&&(this.An(this.Z),this.An=null))},t.prototype.close=function(){this.ut||(this.X("Longpoll is being closed."),this.st())},t.prototype.send=function(t){var e=Object(tr.b)(t);this.bytesSent+=e.length,this.$.incrementCounter("bytes_sent",e.length);for(var n=Object($n.f)(e),r=Object($n.z)(n,1840),i=0;i<r.length;i++)this.scriptTagHolder.enqueueSegment(this.curSegmentNum,r.length,r[i]),this.curSegmentNum++},t.prototype.addDisconnectPingFrame=function(t,e){if(!Object(er.b)()){this.myDisconnFrame=document.createElement("iframe");var n={};n.dframe="t",n.id=t,n.pw=e,this.myDisconnFrame.src=this.urlFn(n),this.myDisconnFrame.style.display="none",document.body.appendChild(this.myDisconnFrame)}},t.prototype.Mn=function(t){var e=Object(tr.b)(t).length;this.bytesReceived+=e,this.$.incrementCounter("bytes_received",e)},t}(),or=function(){function t(e,n,r,i){if(this.onDisconnect=r,this.urlFn=i,this.outstandingRequests=new be,this.pendingSegs=[],this.currentSerial=Math.floor(1e8*Math.random()),this.sendNewPolls=!0,Object(er.b)())this.commandCB=e,this.onMessageCB=n;else{this.uniqueCallbackIdentifier=Object($n.a)(),window[nr+this.uniqueCallbackIdentifier]=e,window[rr+this.uniqueCallbackIdentifier]=n,this.myIFrame=t.qn();var o="";this.myIFrame.src&&"javascript:"===this.myIFrame.src.substr(0,11)&&(o='<script>document.domain="'+document.domain+'";<\/script>');var s="<html><body>"+o+"</body></html>";try{this.myIFrame.doc.open(),this.myIFrame.doc.write(s),this.myIFrame.doc.close()}catch(t){Object($n.s)("frame writing exception"),t.stack&&Object($n.s)(t.stack),Object($n.s)(t)}}}return t.qn=function(){var t=document.createElement("iframe");if(t.style.display="none",!document.body)throw"Document body has not initialized. Wait to initialize Firebase until after the document is ready.";document.body.appendChild(t);try{t.contentWindow.document||Object($n.s)("No IE domain setting required")}catch(n){var e=document.domain;t.src="javascript:void((function(){document.open();document.domain='"+e+"';document.close();})())"}return t.contentDocument?t.doc=t.contentDocument:t.contentWindow?t.doc=t.contentWindow.document:t.document&&(t.doc=t.document),t},t.prototype.close=function(){var e=this;if(this.alive=!1,this.myIFrame&&(this.myIFrame.doc.body.innerHTML="",setTimeout(function(){null!==e.myIFrame&&(document.body.removeChild(e.myIFrame),e.myIFrame=null)},Math.floor(0))),Object(er.b)()&&this.myID){var n={};n.disconn="t",n.id=this.myID,n.pw=this.myPW;var r=this.urlFn(n);t.nodeRestRequest(r)}var i=this.onDisconnect;i&&(this.onDisconnect=null,i())},t.prototype.startLongPoll=function(t,e){for(this.myID=t,this.myPW=e,this.alive=!0;this.Qn(););},t.prototype.Qn=function(){if(this.alive&&this.sendNewPolls&&this.outstandingRequests.count()<(this.pendingSegs.length>0?2:1)){this.currentSerial++;var t={};t.id=this.myID,t.pw=this.myPW,t.ser=this.currentSerial;for(var e=this.urlFn(t),n="",r=0;this.pendingSegs.length>0&&this.pendingSegs[0].d.length+30+n.length<=1870;){var i=this.pendingSegs.shift();n=n+"&seg"+r+"="+i.seg+"&ts"+r+"="+i.ts+"&d"+r+"="+i.d,r++}return e+=n,this.Un(e,this.currentSerial),!0}return!1},t.prototype.enqueueSegment=function(t,e,n){this.pendingSegs.push({seg:t,ts:e,d:n}),this.alive&&this.Qn()},t.prototype.Un=function(t,e){var n=this;this.outstandingRequests.add(e,1);var r=function(){n.outstandingRequests.remove(e),n.Qn()},i=setTimeout(r,Math.floor(25e3)),o=function(){clearTimeout(i),r()};this.addTag(t,o)},t.prototype.addTag=function(t,e){var n=this;Object(er.b)()?this.doNodeLongPoll(t,e):setTimeout(function(){try{if(!n.sendNewPolls)return;var r=n.myIFrame.doc.createElement("script");r.type="text/javascript",r.async=!0,r.src=t,r.onload=r.onreadystatechange=function(){var t=r.readyState;t&&"loaded"!==t&&"complete"!==t||(r.onload=r.onreadystatechange=null,r.parentNode&&r.parentNode.removeChild(r),e())},r.onerror=function(){Object($n.s)("Long-poll script failed to load: "+t),n.sendNewPolls=!1,n.close()},n.myIFrame.doc.body.appendChild(r)}catch(t){}},Math.floor(1))},t}(),sr=n(18),ar=n(1),ur=function(){function t(t){this.Vn(t)}return Object.defineProperty(t,"ALL_TRANSPORTS",{get:function(){return[ir,sr.a]},enumerable:!0,configurable:!0}),t.prototype.Vn=function(e){var n=sr.a&&sr.a.isAvailable(),r=n&&!sr.a.previouslyFailed();if(e.webSocketOnly&&(n||Object(ar.B)("wss:// URL used, but browser isn't known to support websockets. Trying anyway."),r=!0),r)this.Bn=[sr.a];else{var i=this.Bn=[];Object(ar.i)(t.ALL_TRANSPORTS,function(t,e){e&&e.isAvailable()&&i.push(e)})}},t.prototype.initialTransport=function(){if(this.Bn.length>0)return this.Bn[0];throw Error("No transports available")},t.prototype.upgradeTransport=function(){return this.Bn.length>1?this.Bn[1]:null},t}(),cr=n(1),hr=n(8),lr=n(9),pr=function(){function t(t,e,n,r,i,o,s){this.id=t,this.Hn=e,this.Fn=n,this.Kn=r,this.An=i,this.Yn=o,this.lastSessionId=s,this.connectionCount=0,this.pendingDataMessages=[],this.zn=0,this.X=Object(cr.t)("c:"+this.id+":"),this.Gn=new ur(e),this.X("Connection created"),this.Xn()}return t.prototype.Xn=function(){var t=this,e=this.Gn.initialTransport();this.$n=new e(this.Jn(),this.Hn,void 0,this.lastSessionId),this.Zn=e.responsesRequiredToBeHealthy||0;var n=this.tr(this.$n),r=this.er(this.$n);this.nr=this.$n,this.rr=this.$n,this.ir=null,this.or=!1,setTimeout(function(){t.$n&&t.$n.open(n,r)},Math.floor(0));var i=e.healthyTimeout||0;i>0&&(this.sr=Object(cr.x)(function(){t.sr=null,t.or||(t.$n&&t.$n.bytesReceived>102400?(t.X("Connection exceeded healthy timeout but has received "+t.$n.bytesReceived+" bytes. Marking connection healthy."),t.or=!0,t.$n.markConnectionHealthy()):t.$n&&t.$n.bytesSent>10240?t.X("Connection exceeded healthy timeout but has sent "+t.$n.bytesSent+" bytes. Leaving connection alive."):(t.X("Closing unhealthy connection after timeout."),t.close()))},Math.floor(i)))},t.prototype.Jn=function(){return"c:"+this.id+":"+this.connectionCount++},t.prototype.er=function(t){var e=this;return function(n){t===e.$n?e.ar(n):t===e.ir?(e.X("Secondary connection lost."),e.ur()):e.X("closing an old connection")}},t.prototype.tr=function(t){var e=this;return function(n){2!=e.zn&&(t===e.rr?e.cr(n):t===e.ir?e.hr(n):e.X("message on old connection"))}},t.prototype.sendRequest=function(t){var e={t:"d",d:t};this.lr(e)},t.prototype.tryCleanupConnection=function(){this.nr===this.ir&&this.rr===this.ir&&(this.X("cleaning up and promoting a connection: "+this.ir.connId),this.$n=this.ir,this.ir=null)},t.prototype.pr=function(t){if("t"in t){var e=t.t;"a"===e?this.dr():"r"===e?(this.X("Got a reset on secondary, closing it"),this.ir.close(),this.nr!==this.ir&&this.rr!==this.ir||this.close()):"o"===e&&(this.X("got pong on secondary."),this.fr--,this.dr())}},t.prototype.hr=function(t){var e=Object(cr.w)("t",t),n=Object(cr.w)("d",t);if("c"==e)this.pr(n);else{if("d"!=e)throw Error("Unknown protocol layer: "+e);this.pendingDataMessages.push(n)}},t.prototype.dr=function(){this.fr<=0?(this.X("Secondary connection is healthy."),this.or=!0,this.ir.markConnectionHealthy(),this._r()):(this.X("sending ping on secondary."),this.ir.send({t:"c",d:{t:"p",d:{}}}))},t.prototype._r=function(){this.ir.start(),this.X("sending client ack on secondary"),this.ir.send({t:"c",d:{t:"a",d:{}}}),this.X("Ending transmission on primary"),this.$n.send({t:"c",d:{t:"n",d:{}}}),this.nr=this.ir,this.tryCleanupConnection()},t.prototype.cr=function(t){var e=Object(cr.w)("t",t),n=Object(cr.w)("d",t);"c"==e?this.yr(n):"d"==e&&this.vr(n)},t.prototype.vr=function(t){this.gr(),this.Fn(t)},t.prototype.gr=function(){this.or||--this.Zn<=0&&(this.X("Primary connection is healthy."),this.or=!0,this.$n.markConnectionHealthy())},t.prototype.yr=function(t){var e=Object(cr.w)("t",t);if("d"in t){var n=t.d;if("h"===e)this.mr(n);else if("n"===e){this.X("recvd end transmission on primary"),this.rr=this.ir;for(var r=0;r<this.pendingDataMessages.length;++r)this.vr(this.pendingDataMessages[r]);this.pendingDataMessages=[],this.tryCleanupConnection()}else"s"===e?this.br(n):"r"===e?this.Cr(n):"e"===e?Object(cr.k)("Server Error: "+n):"o"===e?(this.X("got pong on primary."),this.gr(),this.Er()):Object(cr.k)("Unknown control packet command: "+e)}},t.prototype.mr=function(t){var e=t.ts,n=t.v,r=t.h;this.sessionId=t.s,this.Hn.updateHost(r),0==this.zn&&(this.$n.start(),this.wr(this.$n,e),lr.e!==n&&Object(cr.B)("Protocol version mismatch detected"),this.Or())},t.prototype.Or=function(){var t=this.Gn.upgradeTransport();t&&this.Sr(t)},t.prototype.Sr=function(t){var e=this;this.ir=new t(this.Jn(),this.Hn,this.sessionId),this.fr=t.responsesRequiredToBeHealthy||0;var n=this.tr(this.ir),r=this.er(this.ir);this.ir.open(n,r),Object(cr.x)(function(){e.ir&&(e.X("Timed out trying to upgrade."),e.ir.close())},Math.floor(6e4))},t.prototype.Cr=function(t){this.X("Reset packet received. New host: "+t),this.Hn.updateHost(t),1===this.zn?this.close():(this.Tr(),this.Xn())},t.prototype.wr=function(t,e){var n=this;this.X("Realtime connection established."),this.$n=t,this.zn=1,this.Kn&&(this.Kn(e,this.sessionId),this.Kn=null),0===this.Zn?(this.X("Primary connection is healthy."),this.or=!0):Object(cr.x)(function(){n.Er()},Math.floor(5e3))},t.prototype.Er=function(){this.or||1!==this.zn||(this.X("sending ping on primary."),this.lr({t:"c",d:{t:"p",d:{}}}))},t.prototype.ur=function(){var t=this.ir;this.ir=null,this.nr!==t&&this.rr!==t||this.close()},t.prototype.ar=function(t){this.$n=null,t||0!==this.zn?1===this.zn&&this.X("Realtime connection lost."):(this.X("Realtime connection failed."),this.Hn.isCacheableHost()&&(hr.a.remove("host:"+this.Hn.host),this.Hn.internalHost=this.Hn.host)),this.close()},t.prototype.br=function(t){this.X("Connection shutdown command received. Shutting down..."),this.Yn&&(this.Yn(t),this.Yn=null),this.An=null,this.close()},t.prototype.lr=function(t){if(1!==this.zn)throw"Connection is not connected";this.nr.send(t)},t.prototype.close=function(){2!==this.zn&&(this.X("Closing realtime connection."),this.zn=2,this.Tr(),this.An&&(this.An(),this.An=null))},t.prototype.Tr=function(){this.X("Shutting down all connections"),this.$n&&(this.$n.close(),this.$n=null),this.ir&&(this.ir.close(),this.ir=null),this.sr&&(clearTimeout(this.sr),this.sr=null)},t}(),dr=function(){function t(){}return t.prototype.put=function(t,e,n,r){},t.prototype.merge=function(t,e,n,r){},t.prototype.refreshAuthToken=function(t){},t.prototype.onDisconnectPut=function(t,e,n){},t.prototype.onDisconnectMerge=function(t,e,n){},t.prototype.onDisconnectCancel=function(t,e){},t.prototype.reportStats=function(t){},t}(),fr=n(5),_r=n(2),yr=n(3),vr=n(0),gr=n(1),mr=n(7),br=n(6),Cr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Er=this&&this.I||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),wr=1e3,Or=3e5,Sr=function(t){function e(n,r,i,o,s,a){var u=t.call(this)||this;if(u.Hn=n,u.Nr=r,u.Ir=i,u.Pr=o,u.Rr=s,u.Dr=a,u.id=e.jr++,u.X=Object(gr.t)("p:"+u.id+":"),u.xr={},u.kr={},u.Fr=[],u.Ar=0,u.Lr=[],u.Mr=!1,u.Wr=wr,u.qr=Or,u.Qr=null,u.lastSessionId=null,u.Ur=null,u.xn=!1,u.Vr={},u.Br=0,u.Hr=null,u.Kr=null,u.Yr=!1,u.zr=0,u.Gr=!0,u.Xr=null,u.$r=null,a&&!Object(br.b)())throw Error("Auth override specified in options, but not supported on non Node.js platforms");return u.Jr(0),Mn.getInstance().on("visible",u.Zr,u),-1===n.host.indexOf("fblocal")&&Un.getInstance().on("online",u.ti,u),u}return Er(e,t),e.prototype.sendRequest=function(t,e,n){var r=++this.Br,i={r:r,a:t,b:e};this.X(Object(yr.b)(i)),Object(vr.a)(this.Mr,"sendRequest call when we're not connected not allowed."),this.Hr.sendRequest(i),n&&(this.Vr[r]=n)},e.prototype.listen=function(t,e,n,r){var i=t.queryIdentifier(),o=""+t.path;this.X("Listen called for "+o+" "+i),this.kr[o]=this.kr[o]||{},Object(vr.a)(t.getQueryParams().isDefault()||!t.getQueryParams().loadsAllData(),"listen() called for non-default but complete query"),Object(vr.a)(!this.kr[o][i],"listen() called twice for same path/queryId.");var s={onComplete:r,hashFn:e,query:t,tag:n};this.kr[o][i]=s,this.Mr&&this.ei(s)},e.prototype.ei=function(t){var n=this,r=t.query,i=""+r.path,o=r.queryIdentifier();this.X("Listen on "+i+" for "+o);var s={p:i};t.tag&&(s.q=r.queryObject(),s.t=t.tag),s.h=t.hashFn(),this.sendRequest("q",s,function(s){var a=s.d,u=s.s;e.ni(a,r),(n.kr[i]&&n.kr[i][o])===t&&(n.X("listen response",s),"ok"!==u&&n.ri(i,o),t.onComplete&&t.onComplete(u,a))})},e.ni=function(t,e){if(t&&"object"===(void 0===t?"undefined":Cr(t))&&Object(_r.b)(t,"w")){var n=Object(_r.l)(t,"w");if(Array.isArray(n)&&~n.indexOf("no_index")){var r='".indexOn": "'+e.getQueryParams().getIndex()+'"',i=""+e.path;Object(gr.B)("Using an unspecified index. Consider adding "+r+" at "+i+" to your security rules for better performance")}}},e.prototype.refreshAuthToken=function(t){this.Kr=t,this.X("Auth token refreshed"),this.Kr?this.tryAuth():this.Mr&&this.sendRequest("unauth",{},function(){}),this.ii(t)},e.prototype.ii=function(t){(t&&40===t.length||zn(t))&&(this.X("Admin auth credential detected. Reducing max reconnect time."),this.qr=3e4)},e.prototype.tryAuth=function(){var t=this;if(this.Mr&&this.Kr){var e=this.Kr,n=Yn(e)?"auth":"gauth",r={cred:e};null===this.Dr?r.noauth=!0:"object"===Cr(this.Dr)&&(r.authvar=this.Dr),this.sendRequest(n,r,function(n){var r=n.s,i=n.d||"error";t.Kr===e&&("ok"===r?t.zr=0:t.oi(r,i))})}},e.prototype.unlisten=function(t,e){var n=""+t.path,r=t.queryIdentifier();this.X("Unlisten called for "+n+" "+r),Object(vr.a)(t.getQueryParams().isDefault()||!t.getQueryParams().loadsAllData(),"unlisten() called for non-default but complete query"),this.ri(n,r)&&this.Mr&&this.si(n,r,t.queryObject(),e)},e.prototype.si=function(t,e,n,r){this.X("Unlisten on "+t+" for "+e);var i={p:t};r&&(i.q=n,i.t=r),this.sendRequest("n",i)},e.prototype.onDisconnectPut=function(t,e,n){this.Mr?this.ai("o",t,e,n):this.Lr.push({pathString:t,action:"o",data:e,onComplete:n})},e.prototype.onDisconnectMerge=function(t,e,n){this.Mr?this.ai("om",t,e,n):this.Lr.push({pathString:t,action:"om",data:e,onComplete:n})},e.prototype.onDisconnectCancel=function(t,e){this.Mr?this.ai("oc",t,null,e):this.Lr.push({pathString:t,action:"oc",data:null,onComplete:e})},e.prototype.ai=function(t,e,n,r){var i={p:e,d:n};this.X("onDisconnect "+t,i),this.sendRequest(t,i,function(t){r&&setTimeout(function(){r(t.s,t.d)},Math.floor(0))})},e.prototype.put=function(t,e,n,r){this.putInternal("p",t,e,n,r)},e.prototype.merge=function(t,e,n,r){this.putInternal("m",t,e,n,r)},e.prototype.putInternal=function(t,e,n,r,i){var o={p:e,d:n};void 0!==i&&(o.h=i),this.Fr.push({action:t,request:o,onComplete:r}),this.Ar++;var s=this.Fr.length-1;this.Mr?this.ui(s):this.X("Buffering put: "+e)},e.prototype.ui=function(t){var e=this,n=this.Fr[t].action,r=this.Fr[t].request,i=this.Fr[t].onComplete;this.Fr[t].queued=this.Mr,this.sendRequest(n,r,function(r){e.X(n+" response",r),delete e.Fr[t],e.Ar--,0===e.Ar&&(e.Fr=[]),i&&i(r.s,r.d)})},e.prototype.reportStats=function(t){var e=this;if(this.Mr){var n={c:t};this.X("reportStats",n),this.sendRequest("s",n,function(t){if("ok"!==t.s){var n=t.d;e.X("reportStats","Error sending stats: "+n)}})}},e.prototype.vr=function(t){if("r"in t){this.X("from server: "+Object(yr.b)(t));var e=t.r,n=this.Vr[e];n&&(delete this.Vr[e],n(t.b))}else{if("error"in t)throw"A server-side error has occurred: "+t.error;"a"in t&&this.ci(t.a,t.b)}},e.prototype.ci=function(t,e){this.X("handleServerMessage",t,e),"d"===t?this.Nr(e.p,e.d,!1,e.t):"m"===t?this.Nr(e.p,e.d,!0,e.t):"c"===t?this.hi(e.p,e.q):"ac"===t?this.oi(e.s,e.d):"sd"===t?this.li(e):Object(gr.k)("Unrecognized action received from server: "+Object(yr.b)(t)+"\nAre you using the latest client?")},e.prototype.Kn=function(t,e){this.X("connection ready"),this.Mr=!0,this.$r=(new Date).getTime(),this.pi(t),this.lastSessionId=e,this.Gr&&this.di(),this.fi(),this.Gr=!1,this.Ir(!0)},e.prototype.Jr=function(t){var e=this;Object(vr.a)(!this.Hr,"Scheduling a connect when we're already connected/ing?"),this.Ur&&clearTimeout(this.Ur),this.Ur=setTimeout(function(){e.Ur=null,e._i()},Math.floor(t))},e.prototype.Zr=function(t){t&&!this.xn&&this.Wr===this.qr&&(this.X("Window became visible. Reducing delay."),this.Wr=wr,this.Hr||this.Jr(0)),this.xn=t},e.prototype.ti=function(t){t?(this.X("Browser went online."),this.Wr=wr,this.Hr||this.Jr(0)):(this.X("Browser went offline. Killing connection."),this.Hr&&this.Hr.close())},e.prototype.yi=function(){if(this.X("data client disconnected"),this.Mr=!1,this.Hr=null,this.vi(),this.Vr={},this.gi()){if(this.xn){if(this.$r){var t=(new Date).getTime()-this.$r;t>3e4&&(this.Wr=wr),this.$r=null}}else this.X("Window isn't visible. Delaying reconnect."),this.Wr=this.qr,this.Xr=(new Date).getTime();var e=(new Date).getTime()-this.Xr,n=Math.max(0,this.Wr-e);n=Math.random()*n,this.X("Trying to reconnect in "+n+"ms"),this.Jr(n),this.Wr=Math.min(this.qr,1.3*this.Wr)}this.Ir(!1)},e.prototype._i=function(){if(this.gi()){this.X("Making a connection attempt"),this.Xr=(new Date).getTime(),this.$r=null;var t=this.vr.bind(this),n=this.Kn.bind(this),r=this.yi.bind(this),i=this.id+":"+e.mi++,o=this,s=this.lastSessionId,a=!1,u=null,c=function(){u?u.close():(a=!0,r())},h=function(t){Object(vr.a)(u,"sendRequest call when we're not connected not allowed."),u.sendRequest(t)};this.Hr={close:c,sendRequest:h};var l=this.Yr;this.Yr=!1,this.Rr.getToken(l).then(function(e){a?Object(gr.s)("getToken() completed but was canceled"):(Object(gr.s)("getToken() completed. Creating connection."),o.Kr=e&&e.accessToken,u=new pr(i,o.Hn,t,n,r,function(t){Object(gr.B)(t+" ("+o.Hn+")"),o.interrupt("server_kill")},s))}).then(null,function(t){o.X("Failed to get token: "+t),a||(mr.a.NODE_ADMIN&&Object(gr.B)(t),c())})}},e.prototype.interrupt=function(t){Object(gr.s)("Interrupting connection for reason: "+t),this.xr[t]=!0,this.Hr?this.Hr.close():(this.Ur&&(clearTimeout(this.Ur),this.Ur=null),this.Mr&&this.yi())},e.prototype.resume=function(t){Object(gr.s)("Resuming connection for reason: "+t),delete this.xr[t],Object(_r.j)(this.xr)&&(this.Wr=wr,this.Hr||this.Jr(0))},e.prototype.pi=function(t){var e=t-(new Date).getTime();this.Pr({serverTimeOffset:e})},e.prototype.vi=function(){for(var t=0;t<this.Fr.length;t++){var e=this.Fr[t];e&&"h"in e.request&&e.queued&&(e.onComplete&&e.onComplete("disconnect"),delete this.Fr[t],this.Ar--)}0===this.Ar&&(this.Fr=[])},e.prototype.hi=function(t,e){var n;n=e?e.map(function(t){return Object(gr.d)(t)}).join("$"):"default";var r=this.ri(t,n);r&&r.onComplete&&r.onComplete("permission_denied")},e.prototype.ri=function(t,e){var n,r=""+new v(t);return void 0!==this.kr[r]?(n=this.kr[r][e],delete this.kr[r][e],0===Object(_r.h)(this.kr[r])&&delete this.kr[r]):n=void 0,n},e.prototype.oi=function(t,e){Object(gr.s)("Auth token revoked: "+t+"/"+e),this.Kr=null,this.Yr=!0,this.Hr.close(),"invalid_token"!==t&&"permission_denied"!==t||++this.zr>=3&&(this.Wr=3e4,this.Rr.notifyForInvalidToken())},e.prototype.li=function(t){this.Qr?this.Qr(t):"msg"in t&&"undefined"!=typeof console&&console.log("FIREBASE: "+t.msg.replace("\n","\nFIREBASE: "))},e.prototype.fi=function(){var t=this;this.tryAuth(),Object(_r.f)(this.kr,function(e,n){Object(_r.f)(n,function(e,n){t.ei(n)})});for(var e=0;e<this.Fr.length;e++)this.Fr[e]&&this.ui(e);for(;this.Lr.length;){var n=this.Lr.shift();this.ai(n.action,n.pathString,n.data,n.onComplete)}},e.prototype.di=function(){var t={},e="js";mr.a.NODE_ADMIN?e="admin_node":mr.a.NODE_CLIENT&&(e="node"),t["sdk."+e+"."+fr.default.SDK_VERSION.replace(/\./g,"-")]=1,Object(br.a)()?t["framework.cordova"]=1:Object(br.c)()&&(t["framework.reactnative"]=1),this.reportStats(t)},e.prototype.gi=function(){var t=Un.getInstance().currentlyOnline();return Object(_r.j)(this.xr)&&t},e.jr=0,e.mi=0,e}(dr),Tr=n(2),Nr=function(t){var e=[];return Object(Tr.f)(t,function(t,n){Array.isArray(n)?n.forEach(function(n){e.push(encodeURIComponent(t)+"="+encodeURIComponent(n))}):e.push(encodeURIComponent(t)+"="+encodeURIComponent(n))}),e.length?"&"+e.join("&"):""},Ir=n(0),Pr=n(1),Rr=n(3),Dr=n(2),jr=this&&this.I||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),xr=function(t){function e(e,n,r){var i=t.call(this)||this;return i.Hn=e,i.Nr=n,i.Rr=r,i.X=Object(Pr.t)("p:rest:"),i.kr={},i}return jr(e,t),e.prototype.reportStats=function(t){throw Error("Method not implemented.")},e.bi=function(t,e){return void 0!==e?"tag$"+e:(Object(Ir.a)(t.getQueryParams().isDefault(),"should have a tag if it's not a default query."),""+t.path)},e.prototype.listen=function(t,n,r,i){var o=this,s=""+t.path;this.X("Listen called for "+s+" "+t.queryIdentifier());var a=e.bi(t,r),u={};this.kr[a]=u;var c=t.getQueryParams().toRestQueryStringParameters();this.Ci(s+".json",c,function(t,e){var n=e;if(404===t&&(n=null,t=null),null===t&&o.Nr(s,n,!1,r),Object(Dr.l)(o.kr,a)===u){var c;c=t?401==t?"permission_denied":"rest_error:"+t:"ok",i(c,null)}})},e.prototype.unlisten=function(t,n){var r=e.bi(t,n);delete this.kr[r]},e.prototype.refreshAuthToken=function(t){},e.prototype.Ci=function(t,e,n){var r=this;void 0===e&&(e={}),e.format="export",this.Rr.getToken(!1).then(function(i){var o=i&&i.accessToken;o&&(e.auth=o);var s=(r.Hn.secure?"https://":"http://")+r.Hn.host+t+"?"+Nr(e);r.X("Sending REST request for "+s);var a=new XMLHttpRequest;a.onreadystatechange=function(){if(n&&4===a.readyState){r.X("REST Response for "+s+" received. status:",a.status,"response:",a.responseText);var t=null;if(a.status>=200&&a.status<300){try{t=Object(Rr.a)(a.responseText)}catch(t){Object(Pr.B)("Failed to parse JSON response for "+s+": "+a.responseText)}n(null,t)}else 401!==a.status&&404!==a.status&&Object(Pr.B)("Got unsuccessful REST response for "+s+" Status: "+a.status),n(a.status);n=null}},a.open("GET",s,!0),a.send()})},e}(dr),kr=n(3),Fr=n(1),Ar=n(2),Lr=n(12),Mr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wr=function(){function t(t,e,n){var r=this;this.Hn=t,this.app=n,this.dataUpdateCount=0,this.On=null,this.Ei=new jn,this.wi=1,this.Oi=null,this.An=new Ce,this.Si=null;var i=new wn(n);if(this.$=Lr.a.getCollection(t),e||Object(Fr.g)())this.En=new xr(this.Hn,this.Nr.bind(this),i),setTimeout(this.Ir.bind(this,!0),0);else{var o=n.options.databaseAuthVariableOverride;if(void 0!==o&&null!==o){if("object"!==(void 0===o?"undefined":Mr(o)))throw Error("Only objects are supported for option databaseAuthVariableOverride");try{Object(kr.b)(o)}catch(t){throw Error("Invalid authOverride provided: "+t)}}this.Si=new Sr(this.Hn,this.Nr.bind(this),this.Ir.bind(this),this.Pr.bind(this),i,o),this.En=this.Si}i.addTokenChangeListener(function(t){r.En.refreshAuthToken(t)}),this.Ti=Lr.a.getOrCreateReporter(t,function(){return new Rn(r.$,r.En)}),this.Ni(),this.Ii=new Cn,this.Pi=new bn({startListening:function(t,e,n,i){var o=[],s=r.Ii.getNode(t.path);return s.isEmpty()||(o=r.Pi.applyServerOverwrite(t.path,s),setTimeout(function(){i("ok")},0)),o},stopListening:function(){}}),this.Ri("connected",!1),this.Di=new bn({startListening:function(t,e,n,i){return r.En.listen(t,n,e,function(e,n){var o=i(e,n);r.Ei.raiseEventsForChangedPath(t.path,o)}),[]},stopListening:function(t,e){r.En.unlisten(t,e)}})}return t.prototype.toString=function(){return(this.Hn.secure?"https://":"http://")+this.Hn.host},t.prototype.name=function(){return this.Hn.namespace},t.prototype.serverTime=function(){var t=this.Ii.getNode(new v(".info/serverTimeOffset")),e=t.val()||0;return(new Date).getTime()+e},t.prototype.generateServerValues=function(){return Oe({timestamp:this.serverTime()})},t.prototype.Nr=function(t,e,n,r){this.dataUpdateCount++;var i=new v(t);e=this.Oi?this.Oi(t,e):e;var o=[];if(r)if(n){var s=Object(Ar.k)(e,function(t){return a(t)});o=this.Di.applyTaggedQueryMerge(i,s,r)}else{var u=a(e);o=this.Di.applyTaggedQueryOverwrite(i,u,r)}else if(n){var c=Object(Ar.k)(e,function(t){return a(t)});o=this.Di.applyServerMerge(i,c)}else{var h=a(e);o=this.Di.applyServerOverwrite(i,h)}var l=i;o.length>0&&(l=this.ji(i)),this.Ei.raiseEventsForChangedPath(l,o)},t.prototype.xi=function(t){this.Oi=t},t.prototype.Ir=function(t){this.Ri("connected",t),!1===t&&this.ki()},t.prototype.Pr=function(t){var e=this;Object(Fr.i)(t,function(t,n){e.Ri(n,t)})},t.prototype.Ri=function(t,e){var n=new v("/.info/"+t),r=a(e);this.Ii.updateSnapshot(n,r);var i=this.Pi.applyServerOverwrite(n,r);this.Ei.raiseEventsForChangedPath(n,i)},t.prototype.Fi=function(){return this.wi++},t.prototype.setWithPriority=function(t,e,n,r){var i=this;this.X("set",{path:""+t,value:e,priority:n});var o=this.generateServerValues(),s=a(e,n),u=Ne(s,o),c=this.Fi(),h=this.Di.applyUserOverwrite(t,u,c,!0);this.Ei.queueEvents(h),this.En.put(""+t,s.val(!0),function(e,n){var o="ok"===e;o||Object(Fr.B)("set at "+t+" failed: "+e);var s=i.Di.ackUserWrite(c,!o);i.Ei.raiseEventsForChangedPath(t,s),i.callOnCompleteCallback(r,e,n)});var l=this.Ai(t);this.ji(l),this.Ei.raiseEventsForChangedPath(l,[])},t.prototype.update=function(t,e,n){var r=this;this.X("update",{path:""+t,value:e});var i=!0,o=this.generateServerValues(),s={};if(Object(Ar.f)(e,function(t,e){i=!1;var n=a(e);s[t]=Ne(n,o)}),i)Object(Fr.s)("update() called with empty data. Don't do anything."),this.callOnCompleteCallback(n,"ok");else{var u=this.Fi(),c=this.Di.applyUserMerge(t,s,u);this.Ei.queueEvents(c),this.En.merge(""+t,e,function(e,i){var o="ok"===e;o||Object(Fr.B)("update at "+t+" failed: "+e);var s=r.Di.ackUserWrite(u,!o),a=s.length>0?r.ji(t):t;r.Ei.raiseEventsForChangedPath(a,s),r.callOnCompleteCallback(n,e,i)}),Object(Ar.f)(e,function(e){var n=r.Ai(t.child(e));r.ji(n)}),this.Ei.raiseEventsForChangedPath(t,[])}},t.prototype.ki=function(){var t=this;this.X("onDisconnectEvents");var e=this.generateServerValues(),n=Te(this.An,e),r=[];n.forEachTree(v.Empty,function(e,n){r=r.concat(t.Di.applyServerOverwrite(e,n));var i=t.Ai(e);t.ji(i)}),this.An=new Ce,this.Ei.raiseEventsForChangedPath(v.Empty,r)},t.prototype.onDisconnectCancel=function(t,e){var n=this;this.En.onDisconnectCancel(""+t,function(r,i){"ok"===r&&n.An.forget(t),n.callOnCompleteCallback(e,r,i)})},t.prototype.onDisconnectSet=function(t,e,n){var r=this,i=a(e);this.En.onDisconnectPut(""+t,i.val(!0),function(e,o){"ok"===e&&r.An.remember(t,i),r.callOnCompleteCallback(n,e,o)})},t.prototype.onDisconnectSetWithPriority=function(t,e,n,r){var i=this,o=a(e,n);this.En.onDisconnectPut(""+t,o.val(!0),function(e,n){"ok"===e&&i.An.remember(t,o),i.callOnCompleteCallback(r,e,n)})},t.prototype.onDisconnectUpdate=function(t,e,n){var r=this;if(Object(Ar.j)(e))return Object(Fr.s)("onDisconnect().update() called with empty data. Don't do anything."),void this.callOnCompleteCallback(n,"ok");this.En.onDisconnectMerge(""+t,e,function(i,o){"ok"===i&&Object(Ar.f)(e,function(e,n){var i=a(n);r.An.remember(t.child(e),i)}),r.callOnCompleteCallback(n,i,o)})},t.prototype.addEventCallbackForQuery=function(t,e){var n;n=".info"===t.path.getFront()?this.Pi.addEventRegistration(t,e):this.Di.addEventRegistration(t,e),this.Ei.raiseEventsAtPath(t.path,n)},t.prototype.removeEventCallbackForQuery=function(t,e){var n;n=".info"===t.path.getFront()?this.Pi.removeEventRegistration(t,e):this.Di.removeEventRegistration(t,e),this.Ei.raiseEventsAtPath(t.path,n)},t.prototype.interrupt=function(){this.Si&&this.Si.interrupt("repo_interrupt")},t.prototype.resume=function(){this.Si&&this.Si.resume("repo_interrupt")},t.prototype.stats=function(t){if(void 0===t&&(t=!1),"undefined"!=typeof console){var e;t?(this.On||(this.On=new Sn(this.$)),e=this.On.get()):e=this.$.get();var n=Object.keys(e).reduce(function(t,e){return Math.max(e.length,t)},0);Object(Ar.f)(e,function(t,e){for(var r=t.length;r<n+2;r++)t+=" ";console.log(t+e)})}},t.prototype.statsIncrementCounter=function(t){this.$.incrementCounter(t),this.Ti.includeStat(t)},t.prototype.X=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n="";this.Si&&(n=this.Si.id+":"),Fr.s.apply(void 0,[n].concat(t))},t.prototype.callOnCompleteCallback=function(t,e,n){t&&Object(Fr.m)(function(){if("ok"==e)t(null);else{var r=(e||"error").toUpperCase(),i=r;n&&(i+=": "+n);var o=Error(i);o.code=r,t(o)}})},Object.defineProperty(t.prototype,"database",{get:function(){return this.Li||(this.Li=new pi(this))},enumerable:!0,configurable:!0}),t}(),qr=function(){function t(e){this.Mi=new Ke(e.getIndex()),this.Xt=e.getIndex(),this.Wi=t.qi(e),this.Qi=t.Ui(e)}return t.prototype.getStartPost=function(){return this.Wi},t.prototype.getEndPost=function(){return this.Qi},t.prototype.matches=function(t){return this.Xt.compare(this.getStartPost(),t)<=0&&this.Xt.compare(t,this.getEndPost())<=0},t.prototype.updateChild=function(t,e,n,r,i,o){return this.matches(new st(e,n))||(n=Vt.EMPTY_NODE),this.Mi.updateChild(t,e,n,r,i,o)},t.prototype.updateFullNode=function(t,e,n){e.isLeafNode()&&(e=Vt.EMPTY_NODE);var r=e.withIndex(this.Xt);r=r.updatePriority(Vt.EMPTY_NODE);var i=this;return e.forEachChild(Nt,function(t,e){i.matches(new st(t,e))||(r=r.updateImmediateChild(t,Vt.EMPTY_NODE))}),this.Mi.updateFullNode(t,r,n)},t.prototype.updatePriority=function(t,e){return t},t.prototype.filtersNodes=function(){return!0},t.prototype.getIndexedFilter=function(){return this.Mi},t.prototype.getIndex=function(){return this.Xt},t.qi=function(t){if(t.hasStart()){var e=t.getIndexStartName();return t.getIndex().makePost(t.getIndexStartValue(),e)}return t.getIndex().minPost()},t.Ui=function(t){if(t.hasEnd()){var e=t.getIndexEndName();return t.getIndex().makePost(t.getIndexEndValue(),e)}return t.getIndex().maxPost()},t}(),Qr=n(0),Ur=function(){function t(t){this.Vi=new qr(t),this.Xt=t.getIndex(),this.Bi=t.getLimit(),this.Hi=!t.isViewFromLeft()}return t.prototype.updateChild=function(t,e,n,r,i,o){return this.Vi.matches(new st(e,n))||(n=Vt.EMPTY_NODE),t.getImmediateChild(e).equals(n)?t:t.numChildren()<this.Bi?this.Vi.getIndexedFilter().updateChild(t,e,n,r,i,o):this.Ki(t,e,n,i,o)},t.prototype.updateFullNode=function(t,e,n){var r;if(e.isLeafNode()||e.isEmpty())r=Vt.EMPTY_NODE.withIndex(this.Xt);else if(2*this.Bi<e.numChildren()&&e.isIndexed(this.Xt)){r=Vt.EMPTY_NODE.withIndex(this.Xt);var i=void 0;i=this.Hi?e.getReverseIteratorFrom(this.Vi.getEndPost(),this.Xt):e.getIteratorFrom(this.Vi.getStartPost(),this.Xt);for(var o=0;i.hasNext()&&o<this.Bi;){var s=i.getNext(),a=void 0;if(!(a=this.Hi?this.Xt.compare(this.Vi.getStartPost(),s)<=0:this.Xt.compare(s,this.Vi.getEndPost())<=0))break;r=r.updateImmediateChild(s.name,s.node),o++}}else{r=e.withIndex(this.Xt),r=r.updatePriority(Vt.EMPTY_NODE);var u=void 0,c=void 0,h=void 0,i=void 0;if(this.Hi){i=r.getReverseIterator(this.Xt),u=this.Vi.getEndPost(),c=this.Vi.getStartPost();var l=this.Xt.getCompare();h=function(t,e){return l(e,t)}}else i=r.getIterator(this.Xt),u=this.Vi.getStartPost(),c=this.Vi.getEndPost(),h=this.Xt.getCompare();for(var o=0,p=!1;i.hasNext();){var s=i.getNext();!p&&h(u,s)<=0&&(p=!0);var a=p&&o<this.Bi&&h(s,c)<=0;a?o++:r=r.updateImmediateChild(s.name,Vt.EMPTY_NODE)}}return this.Vi.getIndexedFilter().updateFullNode(t,r,n)},t.prototype.updatePriority=function(t,e){return t},t.prototype.filtersNodes=function(){return!0},t.prototype.getIndexedFilter=function(){return this.Vi.getIndexedFilter()},t.prototype.getIndex=function(){return this.Xt},t.prototype.Ki=function(t,e,n,r,i){var o;if(this.Hi){var s=this.Xt.getCompare();o=function(t,e){return s(e,t)}}else o=this.Xt.getCompare();var a=t;Object(Qr.a)(a.numChildren()==this.Bi,"");var u=new st(e,n),c=this.Hi?a.getFirstChild(this.Xt):a.getLastChild(this.Xt),h=this.Vi.matches(u);if(a.hasChild(e)){for(var l=a.getImmediateChild(e),p=r.getChildAfterChild(this.Xt,c,this.Hi);null!=p&&(p.name==e||a.hasChild(p.name));)p=r.getChildAfterChild(this.Xt,p,this.Hi);var d=null==p?1:o(p,u);if(h&&!n.isEmpty()&&d>=0)return null!=i&&i.trackChildChange(Be.childChangedChange(e,n,l)),a.updateImmediateChild(e,n);null!=i&&i.trackChildChange(Be.childRemovedChange(e,l));var f=a.updateImmediateChild(e,Vt.EMPTY_NODE);return null!=p&&this.Vi.matches(p)?(null!=i&&i.trackChildChange(Be.childAddedChange(p.name,p.node)),f.updateImmediateChild(p.name,p.node)):f}return n.isEmpty()?t:h&&o(c,u)>=0?(null!=i&&(i.trackChildChange(Be.childRemovedChange(c.name,c.node)),i.trackChildChange(Be.childAddedChange(e,n))),a.updateImmediateChild(e,n).updateImmediateChild(c.name,Vt.EMPTY_NODE)):t},t}(),Vr=n(0),Br=n(1),Hr=n(3),Kr=function(){function t(){this.Yi=!1,this.zi=!1,this.Gi=!1,this.Xi=!1,this.$i=!1,this.Bi=0,this.Ji="",this.Zi=null,this.to="",this.eo=null,this.no="",this.Xt=Nt}return t.prototype.hasStart=function(){return this.zi},t.prototype.isViewFromLeft=function(){return""===this.Ji?this.zi:this.Ji===t.ro.VIEW_FROM_LEFT},t.prototype.getIndexStartValue=function(){return Object(Vr.a)(this.zi,"Only valid if start has been set"),this.Zi},t.prototype.getIndexStartName=function(){return Object(Vr.a)(this.zi,"Only valid if start has been set"),this.Gi?this.to:Br.c},t.prototype.hasEnd=function(){return this.Xi},t.prototype.getIndexEndValue=function(){return Object(Vr.a)(this.Xi,"Only valid if end has been set"),this.eo},t.prototype.getIndexEndName=function(){return Object(Vr.a)(this.Xi,"Only valid if end has been set"),this.$i?this.no:Br.b},t.prototype.hasLimit=function(){return this.Yi},t.prototype.hasAnchoredLimit=function(){return this.Yi&&""!==this.Ji},t.prototype.getLimit=function(){return Object(Vr.a)(this.Yi,"Only valid if limit has been set"),this.Bi},t.prototype.getIndex=function(){return this.Xt},t.prototype.io=function(){var e=new t;return e.Yi=this.Yi,e.Bi=this.Bi,e.zi=this.zi,e.Zi=this.Zi,e.Gi=this.Gi,e.to=this.to,e.Xi=this.Xi,e.eo=this.eo,e.$i=this.$i,e.no=this.no,e.Xt=this.Xt,e.Ji=this.Ji,e},t.prototype.limit=function(t){var e=this.io();return e.Yi=!0,e.Bi=t,e.Ji="",e},t.prototype.limitToFirst=function(e){var n=this.io();return n.Yi=!0,n.Bi=e,n.Ji=t.ro.VIEW_FROM_LEFT,n},t.prototype.limitToLast=function(e){var n=this.io();return n.Yi=!0,n.Bi=e,n.Ji=t.ro.VIEW_FROM_RIGHT,n},t.prototype.startAt=function(t,e){var n=this.io();return n.zi=!0,void 0===t&&(t=null),n.Zi=t,null!=e?(n.Gi=!0,n.to=e):(n.Gi=!1,n.to=""),n},t.prototype.endAt=function(t,e){var n=this.io();return n.Xi=!0,void 0===t&&(t=null),n.eo=t,void 0!==e?(n.$i=!0,n.no=e):(n.$i=!1,n.no=""),n},t.prototype.orderBy=function(t){var e=this.io();return e.Xt=t,e},t.prototype.getQueryObject=function(){var e=t.ro,n={};if(this.zi&&(n[e.INDEX_START_VALUE]=this.Zi,this.Gi&&(n[e.INDEX_START_NAME]=this.to)),this.Xi&&(n[e.INDEX_END_VALUE]=this.eo,this.$i&&(n[e.INDEX_END_NAME]=this.no)),this.Yi){n[e.LIMIT]=this.Bi;var r=this.Ji;""===r&&(r=this.isViewFromLeft()?e.VIEW_FROM_LEFT:e.VIEW_FROM_RIGHT),n[e.VIEW_FROM]=r}return this.Xt!==Nt&&(n[e.INDEX]=""+this.Xt),n},t.prototype.loadsAllData=function(){return!(this.zi||this.Xi||this.Yi)},t.prototype.isDefault=function(){return this.loadsAllData()&&this.Xt==Nt},t.prototype.getNodeFilter=function(){return this.loadsAllData()?new Ke(this.getIndex()):this.hasLimit()?new Ur(this):new qr(this)},t.prototype.toRestQueryStringParameters=function(){var e=t.oo,n={};if(this.isDefault())return n;var r;return this.Xt===Nt?r=e.PRIORITY_INDEX:this.Xt===ee?r=e.VALUE_INDEX:this.Xt===dt?r=e.KEY_INDEX:(Object(Vr.a)(this.Xt instanceof oe,"Unrecognized index type!"),r=""+this.Xt),n[e.ORDER_BY]=Object(Hr.b)(r),this.zi&&(n[e.START_AT]=Object(Hr.b)(this.Zi),this.Gi&&(n[e.START_AT]+=","+Object(Hr.b)(this.to))),this.Xi&&(n[e.END_AT]=Object(Hr.b)(this.eo),this.$i&&(n[e.END_AT]+=","+Object(Hr.b)(this.no))),this.Yi&&(this.isViewFromLeft()?n[e.LIMIT_TO_FIRST]=this.Bi:n[e.LIMIT_TO_LAST]=this.Bi),n},t.ro={INDEX_START_VALUE:"sp",INDEX_START_NAME:"sn",INDEX_END_VALUE:"ep",INDEX_END_NAME:"en",LIMIT:"l",VIEW_FROM:"vf",VIEW_FROM_LEFT:"l",VIEW_FROM_RIGHT:"r",INDEX:"i"},t.oo={ORDER_BY:"orderBy",PRIORITY_INDEX:"$priority",VALUE_INDEX:"$value",KEY_INDEX:"$key",START_AT:"startAt",END_AT:"endAt",LIMIT_TO_FIRST:"limitToFirst",LIMIT_TO_LAST:"limitToLast"},t.DEFAULT=new t,t}(),Yr=n(1),zr=n(4),Gr=this&&this.I||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Xr=function(t){function e(e,n){if(!(e instanceof Wr))throw Error("new Reference() no longer supported - use app.database().");return t.call(this,e,n,Kr.DEFAULT,!1)||this}return Gr(e,t),e.prototype.getKey=function(){return P("Reference.key",0,0,arguments.length),this.path.isEmpty()?null:this.path.getBack()},e.prototype.child=function(t){return P("Reference.child",1,1,arguments.length),"number"==typeof t?t+="":t instanceof v||(null===this.path.getFront()?X("Reference.child",1,t,!1):G("Reference.child",1,t,!1)),new e(this.repo,this.path.child(t))},e.prototype.getParent=function(){P("Reference.parent",0,0,arguments.length);var t=this.path.parent();return null===t?null:new e(this.repo,t)},e.prototype.getRoot=function(){P("Reference.root",0,0,arguments.length);for(var t=this;null!==t.getParent();)t=t.getParent();return t},e.prototype.databaseProp=function(){return this.repo.database},e.prototype.set=function(t,e){P("Reference.set",1,2,arguments.length),$("Reference.set",this.path),U("Reference.set",1,t,this.path,!1),R("Reference.set",2,e,!0);var n=new zr.a;return this.repo.setWithPriority(this.path,t,null,n.wrapCallback(e)),n.promise},e.prototype.update=function(t,e){if(P("Reference.update",1,2,arguments.length),$("Reference.update",this.path),Array.isArray(t)){for(var n={},r=0;r<t.length;++r)n[""+r]=t[r];t=n,Object(Yr.B)("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.")}H("Reference.update",1,t,this.path,!1),R("Reference.update",2,e,!0);var i=new zr.a;return this.repo.update(this.path,t,i.wrapCallback(e)),i.promise},e.prototype.setWithPriority=function(t,e,n){if(P("Reference.setWithPriority",2,3,arguments.length),$("Reference.setWithPriority",this.path),U("Reference.setWithPriority",1,t,this.path,!1),K("Reference.setWithPriority",2,e,!1),R("Reference.setWithPriority",3,n,!0),".length"===this.getKey()||".keys"===this.getKey())throw"Reference.setWithPriority failed: "+this.getKey()+" is a read-only object.";var r=new zr.a;return this.repo.setWithPriority(this.path,t,e,r.wrapCallback(n)),r.promise},e.prototype.remove=function(t){return P("Reference.remove",0,1,arguments.length),$("Reference.remove",this.path),R("Reference.remove",1,t,!0),this.set(null,t)},e.prototype.transaction=function(t,e,n){if(P("Reference.transaction",1,3,arguments.length),$("Reference.transaction",this.path),R("Reference.transaction",1,t,!1),R("Reference.transaction",2,e,!0),Z("Reference.transaction",3,n,!0),".length"===this.getKey()||".keys"===this.getKey())throw"Reference.transaction failed: "+this.getKey()+" is a read-only object.";void 0===n&&(n=!0);var r=new zr.a;"function"==typeof e&&Object(zr.c)(r.promise);var i=function(t,n,i){t?r.reject(t):r.resolve(new rt(n,i)),"function"==typeof e&&e(t,n,i)};return this.repo.startTransaction(this.path,t,i,n),r.promise},e.prototype.setPriority=function(t,e){P("Reference.setPriority",1,2,arguments.length),$("Reference.setPriority",this.path),K("Reference.setPriority",1,t,!1),R("Reference.setPriority",2,e,!0);var n=new zr.a;return this.repo.setWithPriority(this.path.child(".priority"),t,null,n.wrapCallback(e)),n.promise},e.prototype.push=function(t,e){P("Reference.push",0,2,arguments.length),$("Reference.push",this.path),U("Reference.push",1,t,this.path,!0),R("Reference.push",2,e,!0);var n,r=this.repo.serverTime(),i=ot(r),o=this.child(i),s=this.child(i);return n=null!=t?o.set(t,e).then(function(){return s}):zr.b.resolve(s),o.then=n.then.bind(n),o.catch=n.then.bind(n,void 0),"function"==typeof e&&Object(zr.c)(n),o},e.prototype.onDisconnect=function(){return $("Reference.onDisconnect",this.path),new nt(this.repo,this.path)},Object.defineProperty(e.prototype,"database",{get:function(){return this.databaseProp()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"key",{get:function(){return this.getKey()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){return this.getParent()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"root",{get:function(){return this.getRoot()},enumerable:!0,configurable:!0}),e}(ge);ge.se=Xr,cn.se=Xr;var $r,Jr=n(0),Zr=n(2),ti=function(){function t(){this.children={},this.childCount=0,this.value=null}return t}(),ei=function(){function t(t,e,n){void 0===t&&(t=""),void 0===e&&(e=null),void 0===n&&(n=new ti),this.so=t,this.ao=e,this.zt=n}return t.prototype.subTree=function(e){for(var n,r=e instanceof v?e:new v(e),i=this;null!==(n=r.getFront());)i=new t(n,i,Object(Zr.l)(i.zt.children,n)||new ti),r=r.popFront();return i},t.prototype.getValue=function(){return this.zt.value},t.prototype.setValue=function(t){Object(Jr.a)(void 0!==t,"Cannot set value to undefined"),this.zt.value=t,this.uo()},t.prototype.clear=function(){this.zt.value=null,this.zt.children={},this.zt.childCount=0,this.uo()},t.prototype.hasChildren=function(){return this.zt.childCount>0},t.prototype.isEmpty=function(){return null===this.getValue()&&!this.hasChildren()},t.prototype.forEachChild=function(e){var n=this;Object(Zr.f)(this.zt.children,function(r,i){e(new t(r,n,i))})},t.prototype.forEachDescendant=function(t,e,n){e&&!n&&t(this),this.forEachChild(function(e){e.forEachDescendant(t,!0,n)}),e&&n&&t(this)},t.prototype.forEachAncestor=function(t,e){for(var n=e?this:this.parent();null!==n;){if(t(n))return!0;n=n.parent()}return!1},t.prototype.forEachImmediateDescendantWithValue=function(t){this.forEachChild(function(e){null!==e.getValue()?t(e):e.forEachImmediateDescendantWithValue(t)})},t.prototype.path=function(){return new v(null===this.ao?this.so:this.ao.path()+"/"+this.so)},t.prototype.name=function(){return this.so},t.prototype.parent=function(){return this.ao},t.prototype.uo=function(){null!==this.ao&&this.ao.co(this.so,this)},t.prototype.co=function(t,e){var n=e.isEmpty(),r=Object(Zr.b)(this.zt.children,t);n&&r?(delete this.zt.children[t],this.zt.childCount--,this.uo()):n||r||(this.zt.children[t]=e.zt,this.zt.childCount++,this.uo())},t}(),ni=n(0),ri=n(1),ii=n(2),oi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};!function(t){t[t.RUN=0]="RUN",t[t.SENT=1]="SENT",t[t.COMPLETED=2]="COMPLETED",t[t.SENT_NEEDS_ABORT=3]="SENT_NEEDS_ABORT",t[t.NEEDS_ABORT=4]="NEEDS_ABORT"}($r||($r={})),Wr.ho=25,Wr.prototype.Ni=function(){this.lo=new ei},Wr.prototype.startTransaction=function(t,e,n,r){this.X("transaction on "+t);var i=function(){},o=new Xr(this,t);o.on("value",i);var s=function(){o.off("value",i)},u={path:t,update:e,onComplete:n,status:null,order:Object(ri.a)(),applyLocally:r,retryCount:0,unwatcher:s,abortReason:null,currentWriteId:null,currentInputSnapshot:null,currentOutputSnapshotRaw:null,currentOutputSnapshotResolved:null},c=this.po(t);u.currentInputSnapshot=c;var h=u.update(c.val());if(void 0===h){if(u.unwatcher(),u.currentOutputSnapshotRaw=null,u.currentOutputSnapshotResolved=null,u.onComplete){var l=new se(u.currentInputSnapshot,new Xr(this,u.path),Nt);u.onComplete(null,!1,l)}}else{V("transaction failed: Data returned ",h,u.path),u.status=$r.RUN;var p=this.lo.subTree(t),d=p.getValue()||[];d.push(u),p.setValue(d);var f=void 0;"object"===(void 0===h?"undefined":oi(h))&&null!==h&&Object(ii.b)(h,".priority")?(f=Object(ii.l)(h,".priority"),Object(ni.a)(Q(f),"Invalid priority returned by transaction. Priority must be a valid string, finite number, server value, or null.")):f=(this.Di.calcCompleteEventCache(t)||Vt.EMPTY_NODE).getPriority().val(),f=f;var _=this.generateServerValues(),y=a(h,f),v=Ne(y,_);u.currentOutputSnapshotRaw=y,u.currentOutputSnapshotResolved=v,u.currentWriteId=this.Fi();var g=this.Di.applyUserOverwrite(t,v,u.currentWriteId,u.applyLocally);this.Ei.raiseEventsForChangedPath(t,g),this.do()}},Wr.prototype.po=function(t,e){return this.Di.calcCompleteEventCache(t,e)||Vt.EMPTY_NODE},Wr.prototype.do=function(t){var e=this;if(void 0===t&&(t=this.lo),t||this.fo(t),null!==t.getValue()){var n=this._o(t);Object(ni.a)(n.length>0,"Sending zero length transaction queue"),n.every(function(t){return t.status===$r.RUN})&&this.yo(t.path(),n)}else t.hasChildren()&&t.forEachChild(function(t){e.do(t)})},Wr.prototype.yo=function(t,e){for(var n=this,r=e.map(function(t){return t.currentWriteId}),i=this.po(t,r),o=i,s=i.hash(),a=0;a<e.length;a++){var u=e[a];Object(ni.a)(u.status===$r.RUN,"tryToSendTransactionQueue_: items in queue should all be run."),u.status=$r.SENT,u.retryCount++;var c=v.relativePath(t,u.path);o=o.updateChild(c,u.currentOutputSnapshotRaw)}var h=o.val(!0),l=t;this.En.put(""+l,h,function(r){n.X("transaction put response",{path:""+l,status:r});var i=[];if("ok"===r){for(var o=[],s=0;s<e.length;s++){if(e[s].status=$r.COMPLETED,i=i.concat(n.Di.ackUserWrite(e[s].currentWriteId)),e[s].onComplete){var a=e[s].currentOutputSnapshotResolved,u=new Xr(n,e[s].path),c=new se(a,u,Nt);o.push(e[s].onComplete.bind(null,null,!0,c))}e[s].unwatcher()}n.fo(n.lo.subTree(t)),n.do(),n.Ei.raiseEventsForChangedPath(t,i);for(var s=0;s<o.length;s++)Object(ri.m)(o[s])}else{if("datastale"===r)for(var s=0;s<e.length;s++)e[s].status===$r.SENT_NEEDS_ABORT?e[s].status=$r.NEEDS_ABORT:e[s].status=$r.RUN;else{Object(ri.B)("transaction at "+l+" failed: "+r);for(var s=0;s<e.length;s++)e[s].status=$r.NEEDS_ABORT,e[s].abortReason=r}n.ji(t)}},s)},Wr.prototype.ji=function(t){var e=this.vo(t),n=e.path(),r=this._o(e);return this.go(r,n),n},Wr.prototype.go=function(t,e){if(0!==t.length){for(var n=[],r=[],i=t.filter(function(t){return t.status===$r.RUN}),o=i.map(function(t){return t.currentWriteId}),s=0;s<t.length;s++){var u=t[s],c=v.relativePath(e,u.path),h=!1,l=void 0;if(Object(ni.a)(null!==c,"rerunTransactionsUnderNode_: relativePath should not be null."),u.status===$r.NEEDS_ABORT)h=!0,l=u.abortReason,r=r.concat(this.Di.ackUserWrite(u.currentWriteId,!0));else if(u.status===$r.RUN)if(u.retryCount>=Wr.ho)h=!0,l="maxretry",r=r.concat(this.Di.ackUserWrite(u.currentWriteId,!0));else{var p=this.po(u.path,o);u.currentInputSnapshot=p;var d=t[s].update(p.val());if(void 0!==d){V("transaction failed: Data returned ",d,u.path);var f=a(d),_="object"===(void 0===d?"undefined":oi(d))&&null!=d&&Object(ii.b)(d,".priority");_||(f=f.updatePriority(p.getPriority()));var y=u.currentWriteId,g=this.generateServerValues(),m=Ne(f,g);u.currentOutputSnapshotRaw=f,u.currentOutputSnapshotResolved=m,u.currentWriteId=this.Fi(),o.splice(o.indexOf(y),1),r=r.concat(this.Di.applyUserOverwrite(u.path,m,u.currentWriteId,u.applyLocally)),r=r.concat(this.Di.ackUserWrite(y,!0))}else h=!0,l="nodata",r=r.concat(this.Di.ackUserWrite(u.currentWriteId,!0))}if(this.Ei.raiseEventsForChangedPath(e,r),r=[],h&&(t[s].status=$r.COMPLETED,function(t){setTimeout(t,Math.floor(0))}(t[s].unwatcher),t[s].onComplete))if("nodata"===l){var b=new Xr(this,t[s].path),C=t[s].currentInputSnapshot,E=new se(C,b,Nt);n.push(t[s].onComplete.bind(null,null,!1,E))}else n.push(t[s].onComplete.bind(null,Error(l),!1,null))}this.fo(this.lo);for(var s=0;s<n.length;s++)Object(ri.m)(n[s]);this.do()}},Wr.prototype.vo=function(t){for(var e,n=this.lo;null!==(e=t.getFront())&&null===n.getValue();)n=n.subTree(e),t=t.popFront();return n},Wr.prototype._o=function(t){var e=[];return this.mo(t,e),e.sort(function(t,e){return t.order-e.order}),e},Wr.prototype.mo=function(t,e){var n=this,r=t.getValue();if(null!==r)for(var i=0;i<r.length;i++)e.push(r[i]);t.forEachChild(function(t){n.mo(t,e)})},Wr.prototype.fo=function(t){var e=this,n=t.getValue();if(n){for(var r=0,i=0;i<n.length;i++)n[i].status!==$r.COMPLETED&&(n[r]=n[i],r++);n.length=r,t.setValue(n.length>0?n:null)}t.forEachChild(function(t){e.fo(t)})},Wr.prototype.Ai=function(t){var e=this,n=this.vo(t).path(),r=this.lo.subTree(t);return r.forEachAncestor(function(t){e.bo(t)}),this.bo(r),r.forEachDescendant(function(t){e.bo(t)}),n},Wr.prototype.bo=function(t){var e=t.getValue();if(null!==e){for(var n=[],r=[],i=-1,o=0;o<e.length;o++)e[o].status===$r.SENT_NEEDS_ABORT||(e[o].status===$r.SENT?(Object(ni.a)(i===o-1,"All SENT items should be at beginning of queue."),i=o,e[o].status=$r.SENT_NEEDS_ABORT,e[o].abortReason="set"):(Object(ni.a)(e[o].status===$r.RUN,"Unexpected transaction status in abort"),e[o].unwatcher(),r=r.concat(this.Di.ackUserWrite(e[o].currentWriteId,!0)),e[o].onComplete&&n.push(e[o].onComplete.bind(null,Error("set"),!1,null))));-1===i?t.setValue(null):e.length=i+1,this.Ei.raiseEventsForChangedPath(t.path(),r);for(var o=0;o<n.length;o++)Object(ri.m)(n[o])}};var si,ai=n(2),ui=n(1),ci=function(){function t(){this.Co={},this.Eo=!1}return t.getInstance=function(){return si||(si=new t),si},t.prototype.interrupt=function(){for(var t in this.Co)this.Co[t].interrupt()},t.prototype.resume=function(){for(var t in this.Co)this.Co[t].resume()},t.prototype.databaseFromApp=function(t){var e=t.options.databaseURL;void 0===e&&Object(ui.o)("Can't determine Firebase Database URL. Be sure to include databaseURL option when calling firebase.intializeApp().");var n=T(e),r=n.repoInfo;return J("Invalid Firebase Database URL",1,n),n.path.isEmpty()||Object(ui.o)("Database URL must point to the root of a Firebase Database (not including a child path)."),this.createRepo(r,t).database},t.prototype.deleteRepo=function(t){Object(ai.l)(this.Co,t.app.name)!==t&&Object(ui.o)("Database "+t.app.name+" has already been deleted."),t.interrupt(),delete this.Co[t.app.name]},t.prototype.createRepo=function(t,e){var n=Object(ai.l)(this.Co,e.name);return n&&Object(ui.o)("FIREBASE INTERNAL ERROR: Database initialized multiple times."),n=new Wr(t,this.Eo,e),this.Co[e.name]=n,n},t.prototype.forceRestClient=function(t){this.Eo=t},t}(),hi=n(1),li=n(4),pi=function(){function t(t){this._t=t,t instanceof Wr||Object(hi.o)("Don't call new Database() directly - please use firebase.database()."),this.Lt=new Xr(t,v.Empty),this.INTERNAL=new di(this)}return Object.defineProperty(t.prototype,"app",{get:function(){return this._t.app},enumerable:!0,configurable:!0}),t.prototype.ref=function(t){return this.wo("ref"),P("database.ref",0,1,arguments.length),void 0!==t?this.Lt.child(t):this.Lt},t.prototype.refFromURL=function(t){var e="database.refFromURL";this.wo(e),P(e,1,1,arguments.length);var n=T(t);J(e,1,n);var r=n.repoInfo;return r.host!==this._t.Hn.host&&Object(hi.o)(e+": Host name does not match the current database: (found "+r.host+" but expected "+this._t.Hn.host+")"),this.ref(""+n.path)},t.prototype.wo=function(t){null===this._t&&Object(hi.o)("Cannot call "+t+" on a deleted database.")},t.prototype.goOffline=function(){P("database.goOffline",0,0,arguments.length),this.wo("goOffline"),this._t.interrupt()},t.prototype.goOnline=function(){P("database.goOnline",0,0,arguments.length),this.wo("goOnline"),this._t.resume()},t.ServerValue={TIMESTAMP:{".sv":"timestamp"}},t}(),di=function(){function t(t){this.database=t}return t.prototype.delete=function(){return this.database.wo("delete"),ci.getInstance().deleteRepo(this.database._t),this.database._t=null,this.database.Lt=null,this.database.INTERNAL=null,this.database=null,li.b.resolve()},t}(),fi={};n.d(fi,"forceLongPolling",function(){return yi}),n.d(fi,"forceWebSockets",function(){return vi}),n.d(fi,"isWebSocketsAvailable",function(){return gi}),n.d(fi,"setSecurityDebugCallback",function(){return mi}),n.d(fi,"stats",function(){return bi}),n.d(fi,"statsIncrementCounter",function(){return Ci}),n.d(fi,"dataUpdateCount",function(){return Ei}),n.d(fi,"interceptServerData",function(){return wi});var _i=n(18),yi=function(){_i.a.forceDisallow(),ir.forceAllow()},vi=function(){ir.forceDisallow()},gi=function(){return _i.a.isAvailable()},mi=function(t,e){t.repo.Si.Qr=e},bi=function(t,e){t.repo.stats(e)},Ci=function(t,e){t.repo.statsIncrementCounter(e)},Ei=function(t){return t.repo.dataUpdateCount},wi=function(t,e){return t.repo.xi(e)},Oi={};n.d(Oi,"DataConnection",function(){return Si}),n.d(Oi,"RealTimeConnection",function(){return Ti}),n.d(Oi,"hijackHash",function(){return Ni}),n.d(Oi,"ConnectionTarget",function(){return Ii}),n.d(Oi,"queryIdentifier",function(){return Pi}),n.d(Oi,"listens",function(){return Ri}),n.d(Oi,"forceRestClient",function(){return Di});var Si=Sr;Sr.prototype.simpleListen=function(t,e){this.sendRequest("q",{p:t},e)},Sr.prototype.echo=function(t,e){this.sendRequest("echo",{d:t},e)};var Ti=pr,Ni=function(t){var e=Sr.prototype.put;return Sr.prototype.put=function(n,r,i,o){void 0!==o&&(o=t()),e.call(this,n,r,i,o)},function(){Sr.prototype.put=e}},Ii=O,Pi=function(t){return t.queryIdentifier()},Ri=function(t){return t.repo.Si.kr},Di=function(t){ci.getInstance().forceRestClient(t)};(function(t){function r(e){var n=e.INTERNAL.registerService("database",function(t){return ci.getInstance().databaseFromApp(t)},{Reference:Xr,Query:ge,Database:pi,enableLogging:o.j,INTERNAL:fi,ServerValue:pi.ServerValue,TEST_ACCESS:Oi});Object(s.b)()&&(t.exports=n)}e.registerDatabase=r;var i=n(5),o=n(1),s=n(6);r(i.default)}).call(e,n(26)(t))},function(t,e){t.exports=function(t){if(!t.webpackPolyfill){var e=Object.create(t);e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),Object.defineProperty(e,"exports",{enumerable:!0}),e.webpackPolyfill=1}return e}}],[25])}catch(t){throw Error("Cannot instantiate firebase-database.js - be sure to load firebase-app.js first.")}
3800
+
3801
+ try{webpackJsonpFirebase([2],{24:function(e,t,r){"use strict";function n(e){var t=new Uint8Array(e);return window.btoa(String.fromCharCode.apply(null,t))}function o(e){var t=function(e){return self&&"ServiceWorkerGlobalScope"in self?new F(e):new D(e)},r={Messaging:D};e.INTERNAL.registerService("messaging",t,r)}Object.defineProperty(t,"__esModule",{value:!0});var i,s={AVAILABLE_IN_WINDOW:"only-available-in-window",AVAILABLE_IN_SW:"only-available-in-sw",SHOULD_BE_INHERITED:"should-be-overriden",BAD_SENDER_ID:"bad-sender-id",INCORRECT_GCM_SENDER_ID:"incorrect-gcm-sender-id",PERMISSION_DEFAULT:"permission-default",PERMISSION_BLOCKED:"permission-blocked",UNSUPPORTED_BROWSER:"unsupported-browser",NOTIFICATIONS_BLOCKED:"notifications-blocked",FAILED_DEFAULT_REGISTRATION:"failed-serviceworker-registration",SW_REGISTRATION_EXPECTED:"sw-registration-expected",GET_SUBSCRIPTION_FAILED:"get-subscription-failed",INVALID_SAVED_TOKEN:"invalid-saved-token",SW_REG_REDUNDANT:"sw-reg-redundant",TOKEN_SUBSCRIBE_FAILED:"token-subscribe-failed",TOKEN_SUBSCRIBE_NO_TOKEN:"token-subscribe-no-token",TOKEN_SUBSCRIBE_NO_PUSH_SET:"token-subscribe-no-push-set",USE_SW_BEFORE_GET_TOKEN:"use-sw-before-get-token",INVALID_DELETE_TOKEN:"invalid-delete-token",DELETE_TOKEN_NOT_FOUND:"delete-token-not-found",DELETE_SCOPE_NOT_FOUND:"delete-scope-not-found",BG_HANDLER_FUNCTION_EXPECTED:"bg-handler-function-expected",NO_WINDOW_CLIENT_TO_MSG:"no-window-client-to-msg",UNABLE_TO_RESUBSCRIBE:"unable-to-resubscribe",NO_FCM_TOKEN_FOR_RESUBSCRIBE:"no-fcm-token-for-resubscribe",FAILED_TO_DELETE_TOKEN:"failed-to-delete-token",NO_SW_IN_REG:"no-sw-in-reg",BAD_SCOPE:"bad-scope",BAD_VAPID_KEY:"bad-vapid-key",BAD_SUBSCRIPTION:"bad-subscription",BAD_TOKEN:"bad-token",BAD_PUSH_SET:"bad-push-set",FAILED_DELETE_VAPID_KEY:"failed-delete-vapid-key"},a=(i={},i[s.AVAILABLE_IN_WINDOW]="This method is available in a Window context.",i[s.AVAILABLE_IN_SW]="This method is available in a service worker context.",i["should-be-overriden"]="This method should be overriden by extended classes.",i["bad-sender-id"]="Please ensure that 'messagingSenderId' is set correctly in the options passed into firebase.initializeApp().",i["permission-default"]="The required permissions were not granted and dismissed instead.",i["permission-blocked"]="The required permissions were not granted and blocked instead.",i["unsupported-browser"]="This browser doesn't support the API's required to use the firebase SDK.",i["notifications-blocked"]="Notifications have been blocked.",i[s.FAILED_DEFAULT_REGISTRATION]="We are unable to register the default service worker. {$browserErrorMessage}",i["sw-registration-expected"]="A service worker registration was the expected input.",i["get-subscription-failed"]="There was an error when trying to get any existing Push Subscriptions.",i["invalid-saved-token"]="Unable to access details of the saved token.",i["sw-reg-redundant"]="The service worker being used for push was made redundant.",i["token-subscribe-failed"]="A problem occured while subscribing the user to FCM: {$message}",i["token-subscribe-no-token"]="FCM returned no token when subscribing the user to push.",i["token-subscribe-no-push-set"]="FCM returned an invalid response when getting an FCM token.",i["use-sw-before-get-token"]="You must call useServiceWorker() before calling getToken() to ensure your service worker is used.",i["invalid-delete-token"]="You must pass a valid token into deleteToken(), i.e. the token from getToken().",i["delete-token-not-found"]="The deletion attempt for token could not be performed as the token was not found.",i["delete-scope-not-found"]="The deletion attempt for service worker scope could not be performed as the scope was not found.",i["bg-handler-function-expected"]="The input to setBackgroundMessageHandler() must be a function.",i["no-window-client-to-msg"]="An attempt was made to message a non-existant window client.",i["unable-to-resubscribe"]="There was an error while re-subscribing the FCM token for push messaging. Will have to resubscribe the user on next visit. {$message}",i["no-fcm-token-for-resubscribe"]="Could not find an FCM token and as a result, unable to resubscribe. Will have to resubscribe the user on next visit.",i["failed-to-delete-token"]="Unable to delete the currently saved token.",i["no-sw-in-reg"]="Even though the service worker registration was successful, there was a problem accessing the service worker itself.",i["incorrect-gcm-sender-id"]="Please change your web app manifest's 'gcm_sender_id' value to '103953800507' to use Firebase messaging.",i["bad-scope"]="The service worker scope must be a string with at least one character.",i["bad-vapid-key"]="The public VAPID key must be a string with at least one character.",i["bad-subscription"]="The subscription must be a valid PushSubscription.",i["bad-token"]="The FCM Token used for storage / lookup was not a valid token string.",i["bad-push-set"]="The FCM push set used for storage / lookup was not not a valid push set string.",i["failed-delete-vapid-key"]="The VAPID key could not be deleted.",i),c={codes:s,map:a},u=function(e){return n(e).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")},_=[4,51,148,247,223,161,235,177,220,3,162,94,21,113,219,72,211,46,237,237,178,52,219,183,71,58,12,143,196,204,225,111,60,140,132,223,171,182,102,62,242,12,212,139,254,227,249,118,47,20,28,99,8,106,111,45,177,26,149,176,206,55,192,156,110],f={userVisibleOnly:!0,applicationServerKey:new Uint8Array(_)},d={ENDPOINT:"https://fcm.googleapis.com",APPLICATION_SERVER_KEY:_,SUBSCRIPTION_OPTIONS:f},h=r(10),p="fcm_token_object_Store",l=function(){function e(){this.e=new h.a("messaging","Messaging",c.map),this.t=null}return e.prototype.r=function(){return this.t?this.t:(this.t=new Promise(function(e,t){var r=indexedDB.open("fcm_token_details_db",1);r.onerror=function(e){t(e.target.error)},r.onsuccess=function(t){e(t.target.result)},r.onupgradeneeded=function(e){var t=e.target.result,r=t.createObjectStore(p,{keyPath:"swScope"});r.createIndex("fcmSenderId","fcmSenderId",{unique:!1}),r.createIndex("fcmToken","fcmToken",{unique:!0})}}),this.t)},e.prototype.closeDatabase=function(){var e=this;return this.t?this.t.then(function(t){t.close(),e.t=null}):Promise.resolve()},e.prototype.getTokenDetailsFromToken=function(e){return this.r().then(function(t){return new Promise(function(r,n){var o=t.transaction([p]),i=o.objectStore(p),s=i.index("fcmToken"),a=s.get(e);a.onerror=function(e){n(e.target.error)},a.onsuccess=function(e){r(e.target.result)}})})},e.prototype.n=function(e){return this.r().then(function(t){return new Promise(function(r,n){var o=t.transaction([p]),i=o.objectStore(p),s=i.get(e);s.onerror=function(e){n(e.target.error)},s.onsuccess=function(e){r(e.target.result)}})})},e.prototype.o=function(e){return this.r().then(function(t){return new Promise(function(r,n){var o=t.transaction([p]),i=o.objectStore(p),s=[],a=i.openCursor();a.onerror=function(e){n(e.target.error)},a.onsuccess=function(t){var n=t.target.result;n?(n.value.fcmSenderId===e&&s.push(n.value),n.continue()):r(s)}})})},e.prototype.subscribeToFCM=function(e,t,r){var n=this,o=u(t.getKey("p256dh")),i=u(t.getKey("auth")),s="authorized_entity="+e+"&endpoint="+t.endpoint+"&encryption_key="+o+"&encryption_auth="+i;r&&(s+="&pushSet="+r);var a=new Headers;a.append("Content-Type","application/x-www-form-urlencoded");var _={method:"POST",headers:a,body:s};return fetch(d.ENDPOINT+"/fcm/connect/subscribe",_).then(function(e){return e.json()}).then(function(e){var t=e;if(t.error){var r=t.error.message;throw n.e.create(c.codes.TOKEN_SUBSCRIBE_FAILED,{message:r})}if(!t.token)throw n.e.create(c.codes.TOKEN_SUBSCRIBE_NO_TOKEN);if(!t.pushSet)throw n.e.create(c.codes.TOKEN_SUBSCRIBE_NO_PUSH_SET);return{token:t.token,pushSet:t.pushSet}})},e.prototype.i=function(e,t){return e.endpoint===t.endpoint&&u(e.getKey("auth"))===t.auth&&u(e.getKey("p256dh"))===t.p256dh},e.prototype.s=function(e,t,r,n,o){var i={swScope:t.scope,endpoint:r.endpoint,auth:u(r.getKey("auth")),p256dh:u(r.getKey("p256dh")),fcmToken:n,fcmPushSet:o,fcmSenderId:e};return this.r().then(function(e){return new Promise(function(t,r){var n=e.transaction([p],"readwrite"),o=n.objectStore(p),s=o.put(i);s.onerror=function(e){r(e.target.error)},s.onsuccess=function(e){t()}})})},e.prototype.getSavedToken=function(e,t){var r=this;return t instanceof ServiceWorkerRegistration?"string"!=typeof e||0===e.length?Promise.reject(this.e.create(c.codes.BAD_SENDER_ID)):this.o(e).then(function(r){if(0!==r.length){var n=r.findIndex(function(r){return t.scope===r.swScope&&e===r.fcmSenderId});if(-1!==n)return r[n]}}).then(function(e){if(e)return t.pushManager.getSubscription().catch(function(e){throw r.e.create(c.codes.GET_SUBSCRIPTION_FAILED)}).then(function(t){if(t&&r.i(t,e))return e.fcmToken})}):Promise.reject(this.e.create(c.codes.SW_REGISTRATION_EXPECTED))},e.prototype.createToken=function(e,t){var r=this;if("string"!=typeof e||0===e.length)return Promise.reject(this.e.create(c.codes.BAD_SENDER_ID));if(!(t instanceof ServiceWorkerRegistration))return Promise.reject(this.e.create(c.codes.SW_REGISTRATION_EXPECTED));var n,o;return t.pushManager.getSubscription().then(function(e){return e||t.pushManager.subscribe(d.SUBSCRIPTION_OPTIONS)}).then(function(t){return n=t,r.subscribeToFCM(e,n)}).then(function(i){return o=i,r.s(e,t,n,o.token,o.pushSet)}).then(function(){return o.token})},e.prototype.deleteToken=function(e){var t=this;return"string"!=typeof e||0===e.length?Promise.reject(this.e.create(c.codes.INVALID_DELETE_TOKEN)):this.getTokenDetailsFromToken(e).then(function(e){if(!e)throw t.e.create(c.codes.DELETE_TOKEN_NOT_FOUND);return t.r().then(function(r){return new Promise(function(n,o){var i=r.transaction([p],"readwrite"),s=i.objectStore(p),a=s.delete(e.swScope);a.onerror=function(e){o(e.target.error)},a.onsuccess=function(r){if(0===r.target.result)return void o(t.e.create(c.codes.FAILED_TO_DELETE_TOKEN));n(e)}})})})},e}(),g=l,E=r(10),S="messagingSenderId",T=function(){function e(e){var t=this;if(this.e=new E.a("messaging","Messaging",c.map),!e.options[S]||"string"!=typeof e.options[S])throw this.e.create(c.codes.BAD_SENDER_ID);this.c=e.options[S],this.u=new g,this.app=e,this.INTERNAL={},this.INTERNAL.delete=function(){return t.delete}}return e.prototype.getToken=function(){var e=this,t=this._();return"granted"!==t?"denied"===t?Promise.reject(this.e.create(c.codes.NOTIFICATIONS_BLOCKED)):Promise.resolve(null):this.f().then(function(t){return e.u.getSavedToken(e.c,t).then(function(r){return r||e.u.createToken(e.c,t)})})},e.prototype.deleteToken=function(e){var t=this;return this.u.deleteToken(e).then(function(){return t.f().then(function(e){if(e)return e.pushManager.getSubscription()}).then(function(e){if(e)return e.unsubscribe()})})},e.prototype.f=function(){throw this.e.create(c.codes.SHOULD_BE_INHERITED)},e.prototype.requestPermission=function(){throw this.e.create(c.codes.AVAILABLE_IN_WINDOW)},e.prototype.useServiceWorker=function(e){throw this.e.create(c.codes.AVAILABLE_IN_WINDOW)},e.prototype.onMessage=function(e,t,r){throw this.e.create(c.codes.AVAILABLE_IN_WINDOW)},e.prototype.onTokenRefresh=function(e,t,r){throw this.e.create(c.codes.AVAILABLE_IN_WINDOW)},e.prototype.setBackgroundMessageHandler=function(e){throw this.e.create(c.codes.AVAILABLE_IN_SW)},e.prototype.delete=function(){this.u.closeDatabase()},e.prototype._=function(){return Notification.permission},e.prototype.getTokenManager=function(){return this.u},e}(),b=T,m={TYPE_OF_MSG:"firebase-messaging-msg-type",DATA:"firebase-messaging-msg-data"},v={PUSH_MSG_RECEIVED:"push-msg-received",NOTIFICATION_CLICKED:"notification-clicked"},I=function(e,t){return r={},r[m.TYPE_OF_MSG]=e,r[m.DATA]=t,r;var r},y={PARAMS:m,TYPES_OF_MSG:v,createNewMsg:I},N={path:"/firebase-messaging-sw.js",scope:"/firebase-cloud-messaging-push-scope"},w=r(13),k=this&&this.d||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),O=function(e){function t(t){var r=e.call(this,t)||this;return r.h,r.p,r.l=null,r.g=Object(w.a)(function(e){r.l=e}),r.S=null,r.T=Object(w.a)(function(e){r.S=e}),r.b(),r}return k(t,e),t.prototype.getToken=function(){var t=this;return this.m()?this.v().then(function(){return e.prototype.getToken.call(t)}):Promise.reject(this.e.create(c.codes.UNSUPPORTED_BROWSER))},t.prototype.v=function(){var e=this;if(this.p)return this.p;var t=document.querySelector('link[rel="manifest"]');return this.p=t?fetch(t.href).then(function(e){return e.json()}).catch(function(){return Promise.resolve()}).then(function(t){if(t&&t.gcm_sender_id&&"103953800507"!==t.gcm_sender_id)throw e.e.create(c.codes.INCORRECT_GCM_SENDER_ID)}):Promise.resolve(),this.p},t.prototype.requestPermission=function(){var e=this;return"granted"===Notification.permission?Promise.resolve():new Promise(function(t,r){var n=function(n){return"granted"===n?t():r("denied"===n?e.e.create(c.codes.PERMISSION_BLOCKED):e.e.create(c.codes.PERMISSION_DEFAULT))},o=Notification.requestPermission(function(e){o||n(e)});o&&o.then(n)})},t.prototype.useServiceWorker=function(e){if(!(e instanceof ServiceWorkerRegistration))throw this.e.create(c.codes.SW_REGISTRATION_EXPECTED);if(void 0!==this.h)throw this.e.create(c.codes.USE_SW_BEFORE_GET_TOKEN);this.h=e},t.prototype.onMessage=function(e,t,r){return this.g(e,t,r)},t.prototype.onTokenRefresh=function(e,t,r){return this.T(e,t,r)},t.prototype.I=function(e){var t=this,r=e.installing||e.waiting||e.active;return new Promise(function(n,o){if(!r)return void o(t.e.create(c.codes.NO_SW_IN_REG));if("activated"===r.state)return void n(e);if("redundant"===r.state)return void o(t.e.create(c.codes.SW_REG_REDUNDANT));var i=function i(){if("activated"===r.state)n(e);else{if("redundant"!==r.state)return;o(t.e.create(c.codes.SW_REG_REDUNDANT))}r.removeEventListener("statechange",i)};r.addEventListener("statechange",i)})},t.prototype.f=function(){var e=this;return this.h?this.I(this.h):(this.h=null,navigator.serviceWorker.register("/firebase-messaging-sw.js",{scope:N.scope}).catch(function(t){throw e.e.create(c.codes.FAILED_DEFAULT_REGISTRATION,{browserErrorMessage:t.message})}).then(function(t){return e.I(t).then(function(){return e.h=t,t.update(),t})}))},t.prototype.b=function(){var e=this;"serviceWorker"in navigator&&navigator.serviceWorker.addEventListener("message",function(t){if(t.data&&t.data[y.PARAMS.TYPE_OF_MSG]){var r=t.data;switch(r[y.PARAMS.TYPE_OF_MSG]){case y.TYPES_OF_MSG.PUSH_MSG_RECEIVED:case y.TYPES_OF_MSG.NOTIFICATION_CLICKED:var n=r[y.PARAMS.DATA];e.l.next(n)}}},!1)},t.prototype.m=function(){return"serviceWorker"in navigator&&"PushManager"in window&&"Notification"in window&&"fetch"in window&&ServiceWorkerRegistration.prototype.hasOwnProperty("showNotification")&&PushSubscription.prototype.hasOwnProperty("getKey")},t}(b),D=O,A="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},P=this&&this.d||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),R=function(e){function t(t){var r=e.call(this,t)||this;return self.addEventListener("push",function(e){return r.y(e)},!1),self.addEventListener("pushsubscriptionchange",function(e){return r.N(e)},!1),self.addEventListener("notificationclick",function(e){return r.w(e)},!1),r.k=null,r}return P(t,e),t.prototype.y=function(e){var t,r=this;try{t=e.data.json()}catch(e){return}var n=this.O().then(function(e){if(e){if(t.notification||r.k)return r.D(t)}else{var n=r.A(t);if(n){var o=n.title||"";return self.registration.showNotification(o,n)}if(r.k)return r.k(t)}});e.waitUntil(n)},t.prototype.N=function(e){var t=this,r=this.getToken().then(function(e){if(!e)throw t.e.create(c.codes.NO_FCM_TOKEN_FOR_RESUBSCRIBE);var r=null,n=t.getTokenManager();return n.getTokenDetailsFromToken(e).then(function(e){if(!(r=e))throw t.e.create(c.codes.INVALID_SAVED_TOKEN);return self.registration.pushManager.subscribe(d.SUBSCRIPTION_OPTIONS)}).then(function(e){return n.subscribeToFCM(r.fcmSenderId,e,r.fcmPushSet)}).catch(function(e){return n.deleteToken(r.fcmToken).then(function(){throw t.e.create(c.codes.UNABLE_TO_RESUBSCRIBE,{message:e})})})});e.waitUntil(r)},t.prototype.w=function(e){var t=this;if(e.notification&&e.notification.data&&e.notification.data.FCM_MSG){e.stopImmediatePropagation(),e.notification.close();var r=e.notification.data.FCM_MSG,n=r.notification.click_action;if(n){var o=this.P(n).then(function(e){return e||self.clients.openWindow(n)}).then(function(e){if(e){r.notification,delete r.notification;var n=y.createNewMsg(y.TYPES_OF_MSG.NOTIFICATION_CLICKED,r);return t.R(e,n)}});e.waitUntil(o)}}},t.prototype.A=function(e){if(e&&"object"===A(e.notification)){var t=Object.assign({},e.notification);return t.data=(r={},r.FCM_MSG=e,r),t;var r}},t.prototype.setBackgroundMessageHandler=function(e){if(e&&"function"!=typeof e)throw this.e.create(c.codes.BG_HANDLER_FUNCTION_EXPECTED);this.k=e},t.prototype.P=function(e){var t=new URL(e).href;return self.clients.matchAll({type:"window",includeUncontrolled:!0}).then(function(e){for(var r=null,n=0;n<e.length;n++)if(new URL(e[n].url).href===t){r=e[n];break}if(r)return r.focus(),r})},t.prototype.R=function(e,t){var r=this;return new Promise(function(n,o){if(!e)return o(r.e.create(c.codes.NO_WINDOW_CLIENT_TO_MSG));e.postMessage(t),n()})},t.prototype.O=function(){return self.clients.matchAll({type:"window",includeUncontrolled:!0}).then(function(e){return e.some(function(e){return"visible"===e.visibilityState})})},t.prototype.D=function(e){var t=this;return self.clients.matchAll({type:"window",includeUncontrolled:!0}).then(function(r){var n=y.createNewMsg(y.TYPES_OF_MSG.PUSH_MSG_RECEIVED,e);return Promise.all(r.map(function(e){return t.R(e,n)}))})},t.prototype.f=function(){return Promise.resolve(self.registration)},t}(b),F=R;t.registerMessaging=o,o(r(5).default)}},[24])}catch(e){throw Error("Cannot instantiate firebase-messaging.js - be sure to load firebase-app.js first.")}
3802
+
3803
+ try{webpackJsonpFirebase([1],{23:function(t,e,n){"use strict";function r(t){return"storage/"+t}function o(){return new $t(te.UNKNOWN,"An unknown error occurred, please check the error payload for server response.")}function i(t){return new $t(te.OBJECT_NOT_FOUND,"Object '"+t+"' does not exist.")}function a(t){return new $t(te.QUOTA_EXCEEDED,"Quota for bucket '"+t+"' exceeded, please view quota on https://firebase.google.com/pricing/.")}function u(){return new $t(te.UNAUTHENTICATED,"User is not authenticated, please authenticate using Firebase Authentication and try again.")}function s(t){return new $t(te.UNAUTHORIZED,"User does not have permission to access '"+t+"'.")}function c(){return new $t(te.RETRY_LIMIT_EXCEEDED,"Max retry time for operation exceeded, please try again.")}function l(){return new $t(te.CANCELED,"User canceled the upload/download.")}function p(t){return new $t(te.INVALID_URL,"Invalid URL '"+t+"'.")}function h(t){return new $t(te.INVALID_DEFAULT_BUCKET,"Invalid default bucket '"+t+"'.")}function f(){return new $t(te.CANNOT_SLICE_BLOB,"Cannot slice blob for upload. Please retry the upload.")}function d(){return new $t(te.SERVER_FILE_WRONG_SIZE,"Server recorded incorrect upload file size, please retry the upload.")}function _(){return new $t(te.NO_DOWNLOAD_URL,"The given file does not have any download URLs.")}function v(t,e,n){return new $t(te.INVALID_ARGUMENT,"Invalid argument in `"+e+"` at index "+t+": "+n)}function b(t,e,n,r){var o,i;return t===e?(o=t,i=1===t?"argument":"arguments"):(o="between "+t+" and "+e,i="arguments"),new $t(te.INVALID_ARGUMENT_COUNT,"Invalid argument count in `"+n+"`: Expected "+o+" "+i+", received "+r+".")}function m(){return new $t(te.APP_DELETED,"The Firebase app was deleted.")}function y(t){return new $t(te.INVALID_ROOT_OPERATION,"The operation '"+t+"' cannot be performed on a root reference, create a non-root reference using child, such as .child('file.png').")}function g(t,e){return new $t(te.INVALID_FORMAT,"String does not match format '"+t+"': "+e)}function R(t){throw new $t(te.INTERNAL_ERROR,"Internal error: "+t)}function E(t){switch(t){case ee.RAW:case ee.BASE64:case ee.BASE64URL:case ee.DATA_URL:return;default:throw"Expected one of the event types: ["+ee.RAW+", "+ee.BASE64+", "+ee.BASE64URL+", "+ee.DATA_URL+"]."}}function w(t,e){switch(t){case ee.RAW:return new ne(U(e));case ee.BASE64:case ee.BASE64URL:return new ne(A(t,e));case ee.DATA_URL:return new ne(N(e),O(e))}throw o()}function U(t){for(var e=[],n=0;n<t.length;n++){var r=t.charCodeAt(n);if(r<=127)e.push(r);else if(r<=2047)e.push(192|r>>6,128|63&r);else if(55296==(64512&r)){var o=n<t.length-1&&56320==(64512&t.charCodeAt(n+1));if(o){var i=r,a=t.charCodeAt(++n);r=65536|(1023&i)<<10|1023&a,e.push(240|r>>18,128|r>>12&63,128|r>>6&63,128|63&r)}else e.push(239,191,189)}else 56320==(64512&r)?e.push(239,191,189):e.push(224|r>>12,128|r>>6&63,128|63&r)}return new Uint8Array(e)}function T(t){var e;try{e=decodeURIComponent(t)}catch(t){throw g(ee.DATA_URL,"Malformed data URL.")}return U(e)}function A(t,e){switch(t){case ee.BASE64:var n=-1!==e.indexOf("-"),r=-1!==e.indexOf("_");if(n||r){var o=n?"-":"_";throw g(t,"Invalid character '"+o+"' found: is it base64url encoded?")}break;case ee.BASE64URL:var i=-1!==e.indexOf("+"),a=-1!==e.indexOf("/");if(i||a){var o=i?"+":"/";throw g(t,"Invalid character '"+o+"' found: is it base64 encoded?")}e=e.replace(/-/g,"+").replace(/_/g,"/")}var u;try{u=atob(e)}catch(e){throw g(t,"Invalid character found")}for(var s=new Uint8Array(u.length),c=0;c<u.length;c++)s[c]=u.charCodeAt(c);return s}function N(t){var e=new re(t);return e.base64?A(ee.BASE64,e.rest):T(e.rest)}function O(t){return new re(t).contentType}function C(t,e){return!!(t.length>=e.length)&&t.substring(t.length-e.length)===e}function S(t){switch(t){case ie.RUNNING:case ie.PAUSING:case ie.CANCELING:return ae.RUNNING;case ie.PAUSED:return ae.PAUSED;case ie.SUCCESS:return ae.SUCCESS;case ie.CANCELED:return ae.CANCELED;case ie.ERROR:default:return ae.ERROR}}function k(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function I(t,e){for(var n in t)k(t,n)&&e(n,t[n])}function L(t){if(null==t)return{};var e={};return I(t,function(t,n){e[t]=n}),e}function x(t){return new ue.b(t)}function P(t){return ue.b.resolve(t)}function D(t){return ue.b.reject(t)}function M(t){return null!=t}function W(t){return void 0!==t}function B(t){return"function"==typeof t}function G(t){return"object"===(void 0===t?"undefined":se(t))}function j(t){return G(t)&&null!==t}function q(t){return G(t)&&!Array.isArray(t)}function F(t){return"string"==typeof t||t instanceof String}function H(t){return"number"==typeof t||t instanceof Number}function z(t){return X()&&t instanceof Blob}function X(){return"undefined"!=typeof Blob}function V(t){var e;try{e=JSON.parse(t)}catch(t){return null}return q(e)?e:null}function K(t){if(0==t.length)return null;var e=t.lastIndexOf("/");return-1===e?"":t.slice(0,e)}function Z(t,e){var n=e.split("/").filter(function(t){return t.length>0}).join("/");return 0===t.length?n:t+"/"+n}function J(t){var e=t.lastIndexOf("/",t.length-2);return-1===e?t:t.slice(e+1)}function Q(t){return Xt+Kt+t}function Y(t){return Vt+Kt+t}function $(t){return Xt+Zt+t}function tt(t){var e=encodeURIComponent,n="?";return I(t,function(t,r){var o=e(t)+"="+e(r);n=n+o+"&"}),n=n.slice(0,-1)}function et(t,e){return e}function nt(t){return!F(t)||t.length<2?t:(t=t,J(t))}function rt(){function t(t,e){return nt(e)}function e(t,e){return M(e)?+e:e}function n(t,e){if(!(F(e)&&e.length>0))return[];var n=encodeURIComponent;return e.split(",").map(function(e){var r=t.bucket,o=t.fullPath;return Y("/b/"+n(r)+"/o/"+n(o))+tt({alt:"media",token:e})})}if(fe)return fe;var r=[];r.push(new he("bucket")),r.push(new he("generation")),r.push(new he("metageneration")),r.push(new he("name","fullPath",!0));var o=new he("name");o.xform=t,r.push(o);var i=new he("size");return i.xform=e,r.push(i),r.push(new he("timeCreated")),r.push(new he("updated")),r.push(new he("md5Hash",null,!0)),r.push(new he("cacheControl",null,!0)),r.push(new he("contentDisposition",null,!0)),r.push(new he("contentEncoding",null,!0)),r.push(new he("contentLanguage",null,!0)),r.push(new he("contentType",null,!0)),r.push(new he("metadata","customMetadata",!0)),r.push(new he("downloadTokens","downloadURLs",!1,n)),fe=r}function ot(t,e){function n(){var n=t.bucket,r=t.fullPath,o=new pe(n,r);return e.makeStorageReference(o)}Object.defineProperty(t,"ref",{get:n})}function it(t,e,n){var r={};r.type="file";for(var o=n.length,i=0;i<o;i++){var a=n[i];r[a.local]=a.xform(r,e[a.server])}return ot(r,t),r}function at(t,e,n){var r=V(e);return null===r?null:it(t,r,n)}function ut(t,e){for(var n={},r=e.length,o=0;o<r;o++){var i=e[o];i.writable&&(n[i.server]=t[i.local])}return JSON.stringify(n)}function st(t){if(!t||!G(t))throw"Expected Metadata object.";for(var e in t){var n=t[e];if("customMetadata"===e){if(!G(n))throw"Expected object for 'customMetadata' mapping."}else if(j(n))throw"Mapping for '"+e+"' cannot be an object."}}function ct(t,e,n){for(var r=e.length,o=e.length,i=0;i<e.length;i++)if(e[i].optional){r=i;break}if(!(r<=n.length&&n.length<=o))throw b(r,o,t,n.length);for(var i=0;i<n.length;i++)try{e[i].validator(n[i])}catch(e){throw e instanceof Error?v(i,t,e.message):v(i,t,e)}}function lt(t,e){return function(n){t(n),e(n)}}function pt(t,e){function n(t){if(!F(t))throw"Expected string."}var r;return r=t?lt(n,t):n,new de(r,e)}function ht(){function t(t){if(!(t instanceof Uint8Array||t instanceof ArrayBuffer||X()&&t instanceof Blob))throw"Expected Blob or File."}return new de(t)}function ft(t){return new de(st,t)}function dt(){function t(t){if(!(H(t)&&t>=0))throw"Expected a number 0 or greater."}return new de(t)}function _t(t,e){function n(e){if(!(null===e||M(e)&&e instanceof Object))throw"Expected an Object.";void 0!==t&&null!==t&&t(e)}return new de(n,e)}function vt(t){function e(t){if(null!==t&&!B(t))throw"Expected a Function."}return new de(e,t)}function bt(){return"undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof WebKitBlobBuilder?WebKitBlobBuilder:void 0}function mt(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=bt();if(void 0!==n){for(var r=new n,o=0;o<t.length;o++)r.append(t[o]);return r.getBlob()}if(X())return new Blob(t);throw Error("This browser doesn't seem to support creating Blobs")}function yt(t,e,n){return t.webkitSlice?t.webkitSlice(e,n):t.mozSlice?t.mozSlice(e,n):t.slice?t.slice(e,n):null}function gt(t,e){return-1!==t.indexOf(e)}function Rt(t){return Array.prototype.slice.call(t)}function Et(t,e){var n=t.indexOf(e);-1!==n&&t.splice(n,1)}function wt(t){if(!t)throw o()}function Ut(t,e){function n(n,r){var o=at(t,r,e);return wt(null!==o),o}return n}function Tt(t){function e(e,n){var r;return r=401===e.getStatus()?u():402===e.getStatus()?a(t.bucket):403===e.getStatus()?s(t.path):n,r.setServerResponseProp(n.serverResponseProp()),r}return e}function At(t){function e(e,r){var o=n(e,r);return 404===e.getStatus()&&(o=i(t.path)),o.setServerResponseProp(r.serverResponseProp()),o}var n=Tt(t);return e}function Nt(t,e,n){var r=e.fullServerUrl(),o=Q(r),i=t.maxOperationRetryTime(),a=new ve(o,"GET",Ut(t,n),i);return a.errorHandler=At(e),a}function Ot(t,e,n,r){var o=e.fullServerUrl(),i=Q(o),a=ut(n,r),u={"Content-Type":"application/json; charset=utf-8"},s=t.maxOperationRetryTime(),c=new ve(i,"PATCH",Ut(t,r),s);return c.headers=u,c.body=a,c.errorHandler=At(e),c}function Ct(t,e){function n(t,e){}var r=e.fullServerUrl(),o=Q(r),i=t.maxOperationRetryTime(),a=new ve(o,"DELETE",n,i);return a.successCodes=[200,204],a.errorHandler=At(e),a}function St(t,e){return t&&t.contentType||e&&e.type()||"application/octet-stream"}function kt(t,e,n){var r=L(n);return r.fullPath=t.path,r.size=e.size(),r.contentType||(r.contentType=St(null,e)),r}function It(t,e,n,r,o){var i=e.bucketOnlyServerUrl(),a={"X-Goog-Upload-Protocol":"multipart"},u=function(){for(var t="",e=0;e<2;e++)t+=(""+Math.random()).slice(2);return t}();a["Content-Type"]="multipart/related; boundary="+u;var s=kt(e,r,o),c=ut(s,n),l="--"+u+"\r\nContent-Type: application/json; charset=utf-8\r\n\r\n"+c+"\r\n--"+u+"\r\nContent-Type: "+s.contentType+"\r\n\r\n",p="\r\n--"+u+"--",h=_e.getBlob(l,r,p);if(null===h)throw f();var d={name:s.fullPath},_=$(i),v=t.maxUploadRetryTime(),b=new ve(_,"POST",Ut(t,n),v);return b.urlParams=d,b.headers=a,b.body=h.uploadData(),b.errorHandler=Tt(e),b}function Lt(t,e){var n;try{n=t.getResponseHeader("X-Goog-Upload-Status")}catch(t){wt(!1)}return wt(gt(e||["active"],n)),n}function xt(t,e,n,r,o){function i(t,e){Lt(t);var n;try{n=t.getResponseHeader("X-Goog-Upload-URL")}catch(t){wt(!1)}return wt(F(n)),n}var a=e.bucketOnlyServerUrl(),u=kt(e,r,o),s={name:u.fullPath},c=$(a),l={"X-Goog-Upload-Protocol":"resumable","X-Goog-Upload-Command":"start","X-Goog-Upload-Header-Content-Length":r.size(),"X-Goog-Upload-Header-Content-Type":u.contentType,"Content-Type":"application/json; charset=utf-8"},p=ut(u,n),h=t.maxUploadRetryTime(),f=new ve(c,"POST",i,h);return f.urlParams=s,f.headers=l,f.body=p,f.errorHandler=Tt(e),f}function Pt(t,e,n,r){function o(t,e){var n,o=Lt(t,["active","final"]);try{n=t.getResponseHeader("X-Goog-Upload-Size-Received")}catch(t){wt(!1)}var i=parseInt(n,10);return wt(!isNaN(i)),new be(i,r.size(),"final"===o)}var i={"X-Goog-Upload-Command":"query"},a=t.maxUploadRetryTime(),u=new ve(n,"POST",o,a);return u.headers=i,u.errorHandler=Tt(e),u}function Dt(t,e,n,r,o,i,a,u){function s(t,n){var o,a=Lt(t,["active","final"]),u=c.current+p,s=r.size();return o="final"===a?Ut(e,i)(t,n):null,new be(u,s,"final"===a,o)}var c=new be(0,0);if(a?(c.current=a.current,c.total=a.total):(c.current=0,c.total=r.size()),r.size()!==c.total)throw d();var l=c.total-c.current,p=l;o>0&&(p=Math.min(p,o));var h=c.current,_=h+p,v=p===l?"upload, finalize":"upload",b={"X-Goog-Upload-Command":v,"X-Goog-Upload-Offset":c.current},m=r.slice(h,_);if(null===m)throw f();var y=e.maxUploadRetryTime(),g=new ve(n,"POST",s,y);return g.headers=b,g.body=m.uploadData(),g.progressCallback=u||null,g.errorHandler=Tt(t),g}function Mt(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];P(!0).then(function(){t.apply(null,e)})}}function Wt(t,e,n){function r(){return 2===p}function o(){h||(h=!0,e.apply(null,arguments))}function i(e){c=setTimeout(function(){c=null,t(a,r())},e)}function a(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(!h){if(t)return void o.apply(null,arguments);if(r()||l)return void o.apply(null,arguments);s<64&&(s*=2);var a;1===p?(p=2,a=0):a=1e3*(s+Math.random()),i(a)}}function u(t){f||(f=!0,h||(null!==c?(t||(p=2),clearTimeout(c),i(0)):t||(p=1)))}var s=1,c=null,l=!1,p=0,h=!1,f=!1;return i(0),setTimeout(function(){l=!0,u(!0)},n),u}function Bt(t){t(!1)}function Gt(t,e){null!==e&&e.length>0&&(t.Authorization="Firebase "+e)}function jt(t){var e="undefined"!=typeof firebase?firebase.SDK_VERSION:"AppManager";t["X-Firebase-Storage-Version"]="webjs/"+e}function qt(t,e,n){var r=tt(t.urlParams),o=t.url+r,i=L(t.headers);return Gt(i,e),jt(i),new Te(o,t.method,i,t.body,t.successCodes,t.additionalRetryCodes,t.handler,t.errorHandler,t.timeout,t.progressCallback,n)}function Ft(t,e,n){return new Ne(t,new le,n)}function Ht(t){var e={TaskState:ae,TaskEvent:oe,StringFormat:ee,Storage:Ne,Reference:Re};t.INTERNAL.registerService(Ce,Ft,e,void 0,!0)}Object.defineProperty(e,"__esModule",{value:!0});var zt,Xt="https://firebasestorage.googleapis.com",Vt="https://firebasestorage.googleapis.com",Kt="/v0",Zt="/v0",Jt=12e4,Qt=6e4,Yt=-9007199254740991,$t=function(){function t(t,e){this.t=r(t),this.e="Firebase Storage: "+e,this.n=null,this.r="FirebaseError"}return t.prototype.codeProp=function(){return this.code},t.prototype.codeEquals=function(t){return r(t)===this.codeProp()},t.prototype.serverResponseProp=function(){return this.n},t.prototype.setServerResponseProp=function(t){this.n=t},Object.defineProperty(t.prototype,"name",{get:function(){return this.r},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"code",{get:function(){return this.t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"message",{get:function(){return this.e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"serverResponse",{get:function(){return this.n},enumerable:!0,configurable:!0}),t}(),te={UNKNOWN:"unknown",OBJECT_NOT_FOUND:"object-not-found",BUCKET_NOT_FOUND:"bucket-not-found",PROJECT_NOT_FOUND:"project-not-found",QUOTA_EXCEEDED:"quota-exceeded",UNAUTHENTICATED:"unauthenticated",UNAUTHORIZED:"unauthorized",RETRY_LIMIT_EXCEEDED:"retry-limit-exceeded",INVALID_CHECKSUM:"invalid-checksum",CANCELED:"canceled",INVALID_EVENT_NAME:"invalid-event-name",INVALID_URL:"invalid-url",INVALID_DEFAULT_BUCKET:"invalid-default-bucket",NO_DEFAULT_BUCKET:"no-default-bucket",CANNOT_SLICE_BLOB:"cannot-slice-blob",SERVER_FILE_WRONG_SIZE:"server-file-wrong-size",NO_DOWNLOAD_URL:"no-download-url",INVALID_ARGUMENT:"invalid-argument",INVALID_ARGUMENT_COUNT:"invalid-argument-count",APP_DELETED:"app-deleted",INVALID_ROOT_OPERATION:"invalid-root-operation",INVALID_FORMAT:"invalid-format",INTERNAL_ERROR:"internal-error"},ee={RAW:"raw",BASE64:"base64",BASE64URL:"base64url",DATA_URL:"data_url"},ne=function(){function t(t,e){this.data=t,this.contentType=e||null}return t}(),re=function(){function t(t){this.base64=!1,this.contentType=null;var e=t.match(/^data:([^,]+)?,/);if(null===e)throw g(ee.DATA_URL,"Must be formatted 'data:[<mediatype>][;base64],<data>");var n=e[1]||null;null!=n&&(this.base64=C(n,";base64"),this.contentType=this.base64?n.substring(0,n.length-7):n),this.rest=t.substring(t.indexOf(",")+1)}return t}(),oe={STATE_CHANGED:"state_changed"},ie={RUNNING:"running",PAUSING:"pausing",PAUSED:"paused",SUCCESS:"success",CANCELING:"canceling",CANCELED:"canceled",ERROR:"error"},ae={RUNNING:"running",PAUSED:"paused",SUCCESS:"success",CANCELED:"canceled",ERROR:"error"},ue=n(4),se="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};!function(t){t[t.NO_ERROR=0]="NO_ERROR",t[t.NETWORK_ERROR=1]="NETWORK_ERROR",t[t.ABORT=2]="ABORT"}(zt||(zt={}));var ce=function(){function t(){var t=this;this.o=!1,this.i=new XMLHttpRequest,this.a=zt.NO_ERROR,this.u=x(function(e,n){t.i.addEventListener("abort",function(n){t.a=zt.ABORT,e(t)}),t.i.addEventListener("error",function(n){t.a=zt.NETWORK_ERROR,e(t)}),t.i.addEventListener("load",function(n){e(t)})})}return t.prototype.send=function(t,e,n,r){var o=this;if(this.o)throw R("cannot .send() more than once");return this.o=!0,this.i.open(e,t,!0),M(r)&&I(r,function(t,e){o.i.setRequestHeader(t,""+e)}),M(n)?this.i.send(n):this.i.send(),this.u},t.prototype.getErrorCode=function(){if(!this.o)throw R("cannot .getErrorCode() before sending");return this.a},t.prototype.getStatus=function(){if(!this.o)throw R("cannot .getStatus() before sending");try{return this.i.status}catch(t){return-1}},t.prototype.getResponseText=function(){if(!this.o)throw R("cannot .getResponseText() before sending");return this.i.responseText},t.prototype.abort=function(){this.i.abort()},t.prototype.getResponseHeader=function(t){return this.i.getResponseHeader(t)},t.prototype.addUploadProgressListener=function(t){M(this.i.upload)&&this.i.upload.addEventListener("progress",t)},t.prototype.removeUploadProgressListener=function(t){M(this.i.upload)&&this.i.upload.removeEventListener("progress",t)},t}(),le=function(){function t(){}return t.prototype.createXhrIo=function(){return new ce},t}(),pe=function(){function t(t,e){this.bucket=t,this.s=e}return Object.defineProperty(t.prototype,"path",{get:function(){return this.s},enumerable:!0,configurable:!0}),t.prototype.fullServerUrl=function(){var t=encodeURIComponent;return"/b/"+t(this.bucket)+"/o/"+t(this.path)},t.prototype.bucketOnlyServerUrl=function(){return"/b/"+encodeURIComponent(this.bucket)+"/o"},t.makeFromBucketSpec=function(e){var n;try{n=t.makeFromUrl(e)}catch(n){return new t(e,"")}if(""===n.path)return n;throw h(e)},t.makeFromUrl=function(e){function n(t){"/"===t.path.charAt(t.path.length-1)&&(t.s=t.s.slice(0,-1))}function r(t){t.s=decodeURIComponent(t.path)}for(var o=null,i=RegExp("^gs://([A-Za-z0-9.\\-]+)(/(.*))?$","i"),a={bucket:1,path:3},u=RegExp("^https?://firebasestorage\\.googleapis\\.com/v[A-Za-z0-9_]+/b/([A-Za-z0-9.\\-]+)/o(/([^?#]*).*)?$","i"),s={bucket:1,path:3},c=[{regex:i,indices:a,postModify:n},{regex:u,indices:s,postModify:r}],l=0;l<c.length;l++){var h=c[l],f=h.regex.exec(e);if(f){var d=f[h.indices.bucket],_=f[h.indices.path];_||(_=""),o=new t(d,_),h.postModify(o);break}}if(null==o)throw p(e);return o},t}(),he=function(){function t(t,e,n,r){this.server=t,this.local=e||t,this.writable=!!n,this.xform=r||et}return t}(),fe=null,de=function(){function t(t,e){var n=this;this.validator=function(e){n.optional&&!W(e)||t(e)},this.optional=!!e}return t}(),_e=function(){function t(t,e){var n=0,r="";z(t)?(this.c=t,n=t.size,r=t.type):t instanceof ArrayBuffer?(e?this.c=new Uint8Array(t):(this.c=new Uint8Array(t.byteLength),this.c.set(new Uint8Array(t))),n=this.c.length):t instanceof Uint8Array&&(e?this.c=t:(this.c=new Uint8Array(t.length),this.c.set(t)),n=t.length),this.l=n,this.p=r}return t.prototype.size=function(){return this.l},t.prototype.type=function(){return this.p},t.prototype.slice=function(e,n){if(z(this.c)){var r=this.c,o=yt(r,e,n);return null===o?null:new t(o)}return new t(new Uint8Array(this.c.buffer,e,n-e),!0)},t.getBlob=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(X()){var r=e.map(function(e){return e instanceof t?e.c:e});return new t(mt.apply(null,r))}var o=e.map(function(t){return F(t)?w(ee.RAW,t).data:t.c}),i=0;o.forEach(function(t){i+=t.byteLength});var a=new Uint8Array(i),u=0;return o.forEach(function(t){for(var e=0;e<t.length;e++)a[u++]=t[e]}),new t(a,!0)},t.prototype.uploadData=function(){return this.c},t}(),ve=function(){function t(t,e,n,r){this.url=t,this.method=e,this.handler=n,this.timeout=r,this.urlParams={},this.headers={},this.body=null,this.errorHandler=null,this.progressCallback=null,this.successCodes=[200],this.additionalRetryCodes=[]}return t}(),be=function(){function t(t,e,n,r){this.current=t,this.total=e,this.finalized=!!n,this.metadata=r||null}return t}(),me=function(){function t(t,e,n){if(B(t)||M(e)||M(n))this.next=t,this.error=e||null,this.complete=n||null;else{var r=t;this.next=r.next||null,this.error=r.error||null,this.complete=r.complete||null}}return t}(),ye=function(){function t(t,e,n,r,o,i){this.bytesTransferred=t,this.totalBytes=e,this.state=n,this.metadata=r,this.task=o,this.ref=i}return Object.defineProperty(t.prototype,"downloadURL",{get:function(){if(null!==this.metadata){var t=this.metadata.downloadURLs;return null!=t&&null!=t[0]?t[0]:null}return null},enumerable:!0,configurable:!0}),t}(),ge=function(){function t(t,e,n,r,o,i){void 0===i&&(i=null);var a=this;this.h=0,this.f=!1,this.d=!1,this._=[],this.v=null,this.m=null,this.y=null,this.g=1,this.R=null,this.w=null,this.U=t,this.T=e,this.A=n,this.N=o,this.O=i,this.C=r,this.S=this.k(this.N),this.I=ie.RUNNING,this.L=function(t){a.y=null,a.g=1,t.codeEquals(te.CANCELED)?(a.f=!0,a.x()):(a.v=t,a.P(ie.ERROR))},this.D=function(t){a.y=null,t.codeEquals(te.CANCELED)?a.x():(a.v=t,a.P(ie.ERROR))},this.M=x(function(t,e){a.R=t,a.w=e,a.W()}),this.M.then(null,function(){})}return t.prototype.B=function(){var t=this,e=this.h;return function(n,r){t.G(e+n)}},t.prototype.k=function(t){return t.size()>262144},t.prototype.W=function(){this.I===ie.RUNNING&&null===this.y&&(this.S?null===this.m?this.j():this.f?this.q():this.d?this.F():this.H():this.z())},t.prototype.X=function(t){var e=this;this.T.getAuthToken().then(function(n){switch(e.I){case ie.RUNNING:t(n);break;case ie.CANCELING:e.P(ie.CANCELED);break;case ie.PAUSING:e.P(ie.PAUSED)}})},t.prototype.j=function(){var t=this;this.X(function(e){var n=xt(t.T,t.A,t.C,t.N,t.O),r=t.T.makeRequest(n,e);t.y=r,r.getPromise().then(function(e){t.y=null,t.m=e,t.f=!1,t.x()},t.L)})},t.prototype.q=function(){var t=this,e=this.m;this.X(function(n){var r=Pt(t.T,t.A,e,t.N),o=t.T.makeRequest(r,n);t.y=o,o.getPromise().then(function(e){e=e,t.y=null,t.G(e.current),t.f=!1,e.finalized&&(t.d=!0),t.x()},t.L)})},t.prototype.H=function(){var t=this,e=262144*this.g,n=new be(this.h,this.N.size()),r=this.m;this.X(function(o){var i;try{i=Dt(t.A,t.T,r,t.N,e,t.C,n,t.B())}catch(e){return t.v=e,void t.P(ie.ERROR)}var a=t.T.makeRequest(i,o);t.y=a,a.getPromise().then(function(e){t.V(),t.y=null,t.G(e.current),e.finalized?(t.O=e.metadata,t.P(ie.SUCCESS)):t.x()},t.L)})},t.prototype.V=function(){262144*this.g<33554432&&(this.g*=2)},t.prototype.F=function(){var t=this;this.X(function(e){var n=Nt(t.T,t.A,t.C),r=t.T.makeRequest(n,e);t.y=r,r.getPromise().then(function(e){t.y=null,t.O=e,t.P(ie.SUCCESS)},t.D)})},t.prototype.z=function(){var t=this;this.X(function(e){var n=It(t.T,t.A,t.C,t.N,t.O),r=t.T.makeRequest(n,e);t.y=r,r.getPromise().then(function(e){t.y=null,t.O=e,t.G(t.N.size()),t.P(ie.SUCCESS)},t.L)})},t.prototype.G=function(t){var e=this.h;this.h=t,this.h!==e&&this.K()},t.prototype.P=function(t){if(this.I!==t)switch(t){case ie.CANCELING:case ie.PAUSING:this.I=t,null!==this.y&&this.y.cancel();break;case ie.RUNNING:var e=this.I===ie.PAUSED;this.I=t,e&&(this.K(),this.W());break;case ie.PAUSED:this.I=t,this.K();break;case ie.CANCELED:this.v=l(),this.I=t,this.K();break;case ie.ERROR:case ie.SUCCESS:this.I=t,this.K()}},t.prototype.x=function(){switch(this.I){case ie.PAUSING:this.P(ie.PAUSED);break;case ie.CANCELING:this.P(ie.CANCELED);break;case ie.RUNNING:this.W()}},Object.defineProperty(t.prototype,"snapshot",{get:function(){var t=S(this.I);return new ye(this.h,this.N.size(),t,this.O,this,this.U)},enumerable:!0,configurable:!0}),t.prototype.on=function(t,e,n,r){function o(e){if(t!==oe.STATE_CHANGED)throw"Expected one of the event types: ["+oe.STATE_CHANGED+"]."}function i(t){try{return void c(t)}catch(t){}try{if(l(t),!(W(t.next)||W(t.error)||W(t.complete)))throw"";return}catch(t){throw s}}function a(t){function e(e,n,o){null!==t&&ct("on",t,arguments);var i=new me(e,n,r);return p.Z(i),function(){p.J(i)}}return e}function u(t){if(null===t)throw s;i(t)}void 0===e&&(e=void 0),void 0===n&&(n=void 0),void 0===r&&(r=void 0);var s="Expected a function or an Object with one of `next`, `error`, `complete` properties.",c=vt(!0).validator,l=_t(null,!0).validator;ct("on",[pt(o),_t(i,!0),vt(!0),vt(!0)],arguments);var p=this,h=[_t(u),vt(!0),vt(!0)];return W(e)||W(n)||W(r)?a(null)(e,n,r):a(h)},t.prototype.then=function(t,e){return this.M.then(t,e)},t.prototype.catch=function(t){return this.then(null,t)},t.prototype.Z=function(t){this._.push(t),this.Q(t)},t.prototype.J=function(t){Et(this._,t)},t.prototype.K=function(){var t=this;this.Y(),Rt(this._).forEach(function(e){t.Q(e)})},t.prototype.Y=function(){if(null!==this.R){var t=!0;switch(S(this.I)){case ae.SUCCESS:Mt(this.R.bind(null,this.snapshot))();break;case ae.CANCELED:case ae.ERROR:Mt(this.w.bind(null,this.v))();break;default:t=!1}t&&(this.R=null,this.w=null)}},t.prototype.Q=function(t){switch(S(this.I)){case ae.RUNNING:case ae.PAUSED:null!==t.next&&Mt(t.next.bind(t,this.snapshot))();break;case ae.SUCCESS:null!==t.complete&&Mt(t.complete.bind(t))();break;case ae.CANCELED:case ae.ERROR:null!==t.error&&Mt(t.error.bind(t,this.v))();break;default:null!==t.error&&Mt(t.error.bind(t,this.v))()}},t.prototype.resume=function(){ct("resume",[],arguments);var t=this.I===ie.PAUSED||this.I===ie.PAUSING;return t&&this.P(ie.RUNNING),t},t.prototype.pause=function(){ct("pause",[],arguments);var t=this.I===ie.RUNNING;return t&&this.P(ie.PAUSING),t},t.prototype.cancel=function(){ct("cancel",[],arguments);var t=this.I===ie.RUNNING||this.I===ie.PAUSING;return t&&this.P(ie.CANCELING),t},t}(),Re=function(){function t(t,e){this.authWrapper=t,this.location=e instanceof pe?e:pe.makeFromUrl(e)}return t.prototype.toString=function(){return ct("toString",[],arguments),"gs://"+this.location.bucket+"/"+this.location.path},t.prototype.newRef=function(e,n){return new t(e,n)},t.prototype.mappings=function(){return rt()},t.prototype.child=function(t){ct("child",[pt()],arguments);var e=Z(this.location.path,t),n=new pe(this.location.bucket,e);return this.newRef(this.authWrapper,n)},Object.defineProperty(t.prototype,"parent",{get:function(){var t=K(this.location.path);if(null===t)return null;var e=new pe(this.location.bucket,t);return this.newRef(this.authWrapper,e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"root",{get:function(){var t=new pe(this.location.bucket,"");return this.newRef(this.authWrapper,t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"bucket",{get:function(){return this.location.bucket},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"fullPath",{get:function(){return this.location.path},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return J(this.location.path)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"storage",{get:function(){return this.authWrapper.service()},enumerable:!0,configurable:!0}),t.prototype.put=function(t,e){return void 0===e&&(e=null),ct("put",[ht(),ft(!0)],arguments),this.$("put"),new ge(this,this.authWrapper,this.location,this.mappings(),new _e(t),e)},t.prototype.putString=function(t,e,n){void 0===e&&(e=ee.RAW),ct("putString",[pt(),pt(E,!0),ft(!0)],arguments),this.$("putString");var r=w(e,t),o=L(n);return!M(o.contentType)&&M(r.contentType)&&(o.contentType=r.contentType),new ge(this,this.authWrapper,this.location,this.mappings(),new _e(r.data,!0),o)},t.prototype.delete=function(){ct("delete",[],arguments),this.$("delete");var t=this;return this.authWrapper.getAuthToken().then(function(e){var n=Ct(t.authWrapper,t.location);return t.authWrapper.makeRequest(n,e).getPromise()})},t.prototype.getMetadata=function(){ct("getMetadata",[],arguments),this.$("getMetadata");var t=this;return this.authWrapper.getAuthToken().then(function(e){var n=Nt(t.authWrapper,t.location,t.mappings());return t.authWrapper.makeRequest(n,e).getPromise()})},t.prototype.updateMetadata=function(t){ct("updateMetadata",[ft()],arguments),this.$("updateMetadata");var e=this;return this.authWrapper.getAuthToken().then(function(n){var r=Ot(e.authWrapper,e.location,t,e.mappings());return e.authWrapper.makeRequest(r,n).getPromise()})},t.prototype.getDownloadURL=function(){return ct("getDownloadURL",[],arguments),this.$("getDownloadURL"),this.getMetadata().then(function(t){var e=t.downloadURLs[0];if(M(e))return e;throw _()})},t.prototype.$=function(t){if(""===this.location.path)throw y(t)},t}(),Ee=function(){function t(t){this.M=D(t)}return t.prototype.getPromise=function(){return this.M},t.prototype.cancel=function(t){void 0===t&&(t=!1)},t}(),we=function(){function t(){this.tt={},this.et=Yt}return t.prototype.addRequest=function(t){function e(){delete r.tt[n]}var n=this.et;this.et++,this.tt[n]=t;var r=this;t.getPromise().then(e,e)},t.prototype.clear=function(){I(this.tt,function(t,e){e&&e.cancel(!0)}),this.tt={}},t}(),Ue=function(){function t(e,n,r,o,i){if(this.nt=null,this.rt=!1,this.ot=e,null!==this.ot){var a=this.ot.options;M(a)&&(this.nt=t.it(a))}this.ut=n,this.st=r,this.ct=i,this.lt=o,this.pt=Jt,this.ht=Qt,this.ft=new we}return t.it=function(t){var e=t.storageBucket||null;return null==e?null:pe.makeFromBucketSpec(e).bucket},t.prototype.getAuthToken=function(){return null!==this.ot&&M(this.ot.INTERNAL)&&M(this.ot.INTERNAL.getToken)?this.ot.INTERNAL.getToken().then(function(t){return null!==t?t.accessToken:null},function(t){return null}):P(null)},t.prototype.bucket=function(){if(this.rt)throw m();return this.nt},t.prototype.service=function(){return this.lt},t.prototype.makeStorageReference=function(t){return this.ut(this,t)},t.prototype.makeRequest=function(t,e){if(this.rt)return new Ee(m());var n=this.st(t,e,this.ct);return this.ft.addRequest(n),n},t.prototype.deleteApp=function(){this.rt=!0,this.ot=null,this.ft.clear()},t.prototype.maxUploadRetryTime=function(){return this.ht},t.prototype.setMaxUploadRetryTime=function(t){this.ht=t},t.prototype.maxOperationRetryTime=function(){return this.pt},t.prototype.setMaxOperationRetryTime=function(t){this.pt=t},t}(),Te=function(){function t(t,e,n,r,o,i,a,u,s,c,l){this.dt=null,this._t=null,this.R=null,this.w=null,this.vt=!1,this.bt=!1,this.mt=t,this.yt=e,this.gt=n,this.Rt=r,this.Et=o.slice(),this.wt=i.slice(),this.Ut=a,this.Tt=u,this.At=c,this.Nt=s,this.ct=l;var p=this;this.M=x(function(t,e){p.R=t,p.w=e,p.W()})}return t.prototype.W=function(){function t(t,e){function r(t){var e=t.loaded,r=t.lengthComputable?t.total:-1;null!==n.At&&n.At(e,r)}if(e)return void t(!1,new Ae(!1,null,!0));var o=n.ct.createXhrIo();n.dt=o,null!==n.At&&o.addUploadProgressListener(r),o.send(n.mt,n.yt,n.Rt,n.gt).then(function(e){null!==n.At&&e.removeUploadProgressListener(r),n.dt=null,e=e;var o=e.getErrorCode()===zt.NO_ERROR,i=e.getStatus();if(!o||n.Ot(i)){var a=e.getErrorCode()===zt.ABORT;return void t(!1,new Ae(!1,null,a))}var u=gt(n.Et,i);t(!0,new Ae(u,e))})}function e(t,e){var r=n.R,i=n.w,a=e.xhr;if(e.wasSuccessCode)try{var u=n.Ut(a,a.getResponseText());W(u)?r(u):r()}catch(t){i(t)}else if(null!==a){var s=o();s.setServerResponseProp(a.getResponseText()),i(n.Tt?n.Tt(a,s):s)}else if(e.canceled){var s=n.bt?m():l();i(s)}else{var s=c();i(s)}}var n=this;this.vt?e(!1,new Ae(!1,null,!0)):this._t=Wt(t,e,this.Nt)},t.prototype.getPromise=function(){return this.M},t.prototype.cancel=function(t){this.vt=!0,this.bt=t||!1,null!==this._t&&Bt(this._t),null!==this.dt&&this.dt.abort()},t.prototype.Ot=function(t){var e=t>=500&&t<600,n=[408,429],r=gt(n,t),o=gt(this.wt,t);return e||r||o},t}(),Ae=function(){function t(t,e,n){this.wasSuccessCode=t,this.xhr=e,this.canceled=!!n}return t}(),Ne=function(){function t(t,e,n){function r(t,e){return new Re(t,e)}if(this.nt=null,this.T=new Ue(t,r,qt,this,e),this.ot=t,null!=n)this.nt=pe.makeFromBucketSpec(n);else{var o=this.T.bucket();null!=o&&(this.nt=new pe(o,""))}this.Ct=new Oe(this)}return t.prototype.ref=function(t){function e(t){if(/^[A-Za-z]+:\/\//.test(t))throw"Expected child path but got a URL, use refFromURL instead."}if(ct("ref",[pt(e,!0)],arguments),null==this.nt)throw Error("No Storage Bucket defined in Firebase Options.");var n=new Re(this.T,this.nt);return null!=t?n.child(t):n},t.prototype.refFromURL=function(t){function e(t){if(!/^[A-Za-z]+:\/\//.test(t))throw"Expected full URL but got a child path, use ref instead.";try{pe.makeFromUrl(t)}catch(t){throw"Expected valid full URL but got an invalid one."}}return ct("refFromURL",[pt(e,!1)],arguments),new Re(this.T,t)},Object.defineProperty(t.prototype,"maxUploadRetryTime",{get:function(){return this.T.maxUploadRetryTime()},enumerable:!0,configurable:!0}),t.prototype.setMaxUploadRetryTime=function(t){ct("setMaxUploadRetryTime",[dt()],arguments),this.T.setMaxUploadRetryTime(t)},Object.defineProperty(t.prototype,"maxOperationRetryTime",{get:function(){return this.T.maxOperationRetryTime()},enumerable:!0,configurable:!0}),t.prototype.setMaxOperationRetryTime=function(t){ct("setMaxOperationRetryTime",[dt()],arguments),this.T.setMaxOperationRetryTime(t)},Object.defineProperty(t.prototype,"app",{get:function(){return this.ot},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"INTERNAL",{get:function(){return this.Ct},enumerable:!0,configurable:!0}),t}(),Oe=function(){function t(t){this.lt=t}return t.prototype.delete=function(){return this.lt.T.deleteApp(),P(void 0)},t}();e.registerStorage=Ht;var Ce="storage";Ht(n(5).default)}},[23])}catch(t){throw Error("Cannot instantiate firebase-storage.js - be sure to load firebase-app.js first.")}
3804
+
4091
3805
 
4092
3806
  //! moment.js
4093
- //! version : 2.18.0
3807
+ //! version : 2.18.1
4094
3808
  //! authors : Tim Wood, Iskren Chernev, Moment.js contributors
4095
3809
  //! license : MIT
4096
3810
  //! momentjs.com
@@ -4449,7 +4163,7 @@ function set (config) {
4449
4163
  // number + (possibly) stuff coming from _dayOfMonthOrdinalParse.
4450
4164
  // TODO: Remove "ordinalParse" fallback in next major release.
4451
4165
  this._dayOfMonthOrdinalParseLenient = new RegExp(
4452
- (this._dayOfMonthOrdinalParse.source || this._ordinalParse.source) +
4166
+ (this._dayOfMonthOrdinalParse.source || this._ordinalParse.source) +
4453
4167
  '|' + (/\d{1,2}/).source);
4454
4168
  }
4455
4169
 
@@ -8517,7 +8231,7 @@ addParseToken('x', function (input, array, config) {
8517
8231
  // Side effect imports
8518
8232
 
8519
8233
 
8520
- hooks.version = '2.18.0';
8234
+ hooks.version = '2.18.1';
8521
8235
 
8522
8236
  setHookCallback(createLocal);
8523
8237
 
@@ -9036,14 +8750,16 @@ Binnacle.WebPushClient = (function() {
9036
8750
  return _this.sendTokenToServer(currentToken);
9037
8751
  } else {
9038
8752
  _this.options.onBeforePermissionRequest();
9039
- _this.messaging.requestPermission().then(function() {
8753
+ return _this.messaging.requestPermission().then(function() {
9040
8754
  _this.options.onPermissionGranted();
9041
- return _this.getToken();
8755
+ return _this.getToken().then(function(currentToken) {
8756
+ return _this.sendTokenToServer(currentToken);
8757
+ });
9042
8758
  })["catch"](function(err) {
9043
8759
  console.log('Unable to get permission to notify.', err);
9044
- return _this.options.onPermissionFailed();
8760
+ _this.options.onPermissionFailed();
8761
+ return setTokenSentToServer(false);
9045
8762
  });
9046
- return setTokenSentToServer(false);
9047
8763
  }
9048
8764
  };
9049
8765
  })(this))["catch"](function(err) {