text: webpackJsonp([1],{"/byE":function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CONSTANTS={NODE_CLIENT:!1,NODE_ADMIN:!1,SDK_VERSION:"${JSCORE_VERSION}"}},"/ygB":function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.contains=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.safeGet=function(t,e){if(Object.prototype.hasOwnProperty.call(t,e))return t[e]},e.forEach=function(t,e){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e(n,t[n])},e.extend=function(t,n){return e.forEach(n,function(e,n){t[e]=n}),t},e.clone=function(t){return e.extend({},t)},e.isNonNullObject=function(t){return"object"==typeof t&&null!==t},e.isEmpty=function(t){for(var e in t)return!1;return!0},e.getCount=function(t){var e=0;for(var n in t)e++;return e},e.map=function(t,e,n){var r={};for(var i in t)r[i]=e.call(n,t[i],i,t);return r},e.findKey=function(t,e,n){for(var r in t)if(e.call(n,t[r],r,t))return r},e.findValue=function(t,n,r){var i=e.findKey(t,n,r);return i&&t[i]},e.getAnyKey=function(t){for(var e in t)return e},e.getValues=function(t){var e=[],n=0;for(var r in t)e[n++]=t[r];return e},e.every=function(t,e){for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&!e(n,t[n]))return!1;return!0}},0:function(t,e,n){t.exports=n("cDNt")},"1j/l":function(t,e,n){"use strict";n.d(e,"a",function(){return r});var r=Array.isArray||function(t){return t&&"number"==typeof t.length}},"2kLc":function(t,e,n){"use strict";e.a=function(){for(var t=[],e=0;e<arguments.length;e++)t[e-0]=arguments[e];var n=Number.POSITIVE_INFINITY,a=null,u=t[t.length-1];return Object(o.a)(u)?(a=t.pop(),t.length>1&&"number"==typeof t[t.length-1]&&(n=t.pop())):"number"==typeof u&&(n=t.pop()),null===a&&1===t.length&&t[0]instanceof r.a?t[0]:Object(s.a)(n)(new i.a(t,a))};var r=n("AP4T"),i=n("Oryw"),o=n("3iOE"),s=n("bywS")},"2mdx":function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n("EqqR");e.stringToByteArray=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;r.assert(++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},e.stringLength=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}},"32XG":function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Hash=function(){this.blockSize=-1}},"3iOE":function(t,e,n){"use strict";e.a=function(t){return t&&"function"==typeof t.schedule}},"6Xbx":function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.__extends=function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},n.d(e,"__assign",function(){return i}),e.__rest=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&(n[r[i]]=t[r[i]])}return n},e.__decorate=function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},e.__param=function(t,e){return function(n,r){e(n,r,t)}},e.__metadata=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},e.__awaiter=function(t,e,n,r){return new(n||(n=Promise))(function(i,o){function s(t){try{u(r.next(t))}catch(t){o(t)}}function a(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){t.done?i(t.value):new n(function(e){e(t.value)}).then(s,a)}u((r=r.apply(t,e||[])).next())})},e.__generator=function(t,e){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=r[2&o[0]?"return":o[0]?"throw":"next"])&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[0,i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},e.__exportStar=function(t,e){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])},e.__values=o,e.__read=s,e.__spread=function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(s(arguments[e]));return t},e.__await=a,e.__asyncGenerator=function(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(t,e||[]),o=[];return r={},s("next"),s("throw"),s("return"),r[Symbol.asyncIterator]=function(){return this},r;function s(t){i[t]&&(r[t]=function(e){return new Promise(function(n,r){o.push([t,e,n,r])>1||u(t,e)})})}function u(t,e){try{(n=i[t](e)).value instanceof a?Promise.resolve(n.value.v).then(l,c):h(o[0][2],n)}catch(t){h(o[0][3],t)}var n}function l(t){u("next",t)}function c(t){u("throw",t)}function h(t,e){t(e),o.shift(),o.length&&u(o[0][0],o[0][1])}},e.__asyncDelegator=function(t){var e,n;return e={},r("next"),r("throw",function(t){throw t}),r("return"),e[Symbol.iterator]=function(){return this},e;function r(r,i){t[r]&&(e[r]=function(e){return(n=!n)?{value:a(t[r](e)),done:"return"===r}:i?i(e):e})}},e.__asyncValues=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator];return e?e.call(t):"function"==typeof o?o(t):t[Symbol.iterator]()},e.__makeTemplateObject=function(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t},e.__importStar=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e},e.__importDefault=function(t){return t&&t.__esModule?t:{default:t}};var r=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])},i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t};function o(t){var e="function"==typeof Symbol&&t[Symbol.iterator],n=0;return e?e.call(t):{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}}function s(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}function a(t){return this instanceof a?(this.v=t,this):new a(t)}},"8Ut3":function(t,e,n){"use strict";n.d(e,"a",function(){return i});var r=n("6Xbx"),i=function(t){function e(e,n){t.call(this),this.value=e,this.scheduler=n,this._isScalar=!0,n&&(this._isScalar=!1)}return Object(r.__extends)(e,t),e.create=function(t,n){return new e(t,n)},e.dispatch=function(t){var e=t.value,n=t.subscriber;t.done?n.complete():(n.next(e),n.closed||(t.done=!0,this.schedule(t)))},e.prototype._subscribe=function(t){var n=this.value,r=this.scheduler;if(r)return r.schedule(e.dispatch,0,{done:!1,value:n,subscriber:t});t.next(n),t.closed||t.complete()},e}(n("AP4T").a)},AP4T:function(t,e,n){"use strict";var r=n("xIGM"),i=n("E9/g"),o=n("V7AE"),s=n("grVA"),a=n("mz3w"),u=n("ExCY");n.d(e,"a",function(){return l});var l=function(){function t(t){this._isScalar=!1,t&&(this._subscribe=t)}return t.prototype.lift=function(e){var n=new t;return n.source=this,n.operator=e,n},t.prototype.subscribe=function(t,e,n){var r=this.operator,a=function(t,e,n){if(t){if(t instanceof i.a)return t;if(t[o.a])return t[o.a]()}return t||e||n?new i.a(t,e,n):new i.a(s.a)}(t,e,n);if(r?r.call(a,this.source):a.add(this.source||!a.syncErrorThrowable?this._subscribe(a):this._trySubscribe(a)),a.syncErrorThrowable&&(a.syncErrorThrowable=!1,a.syncErrorThrown))throw a.syncErrorValue;return a},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.syncErrorThrown=!0,t.syncErrorValue=e,t.error(e)}},t.prototype.forEach=function(t,e){var n=this;if(e||(r.a.Rx&&r.a.Rx.config&&r.a.Rx.config.Promise?e=r.a.Rx.config.Promise:r.a.Promise&&(e=r.a.Promise)),!e)throw new Error("no Promise impl found");return new e(function(e,r){var i;i=n.subscribe(function(e){if(i)try{t(e)}catch(t){r(t),i.unsubscribe()}else t(e)},r,e)})},t.prototype._subscribe=function(t){return this.source.subscribe(t)},t.prototype[a.a]=function(){return this},t.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e-0]=arguments[e];return 0===t.length?this:Object(u.b)(t)(this)},t.prototype.toPromise=function(t){var e=this;if(t||(r.a.Rx&&r.a.Rx.config&&r.a.Rx.config.Promise?t=r.a.Rx.config.Promise:r.a.Promise&&(t=r.a.Promise)),!t)throw new Error("no Promise impl found");return new t(function(t,n){var r;e.subscribe(function(t){return r=t},function(t){return n(t)},function(){return t(r)})})},t.create=function(e){return new t(e)},t}()},B1iP:function(t,e,n){"use strict";e.a=function(t){return"function"==typeof t}},COMn:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=Error.captureStackTrace;e.patchCapture=function(t){var e=r;return r=t,e};var i=function(){return function(t,e){if(this.code=t,this.message=e,r)r(this,o.prototype.create);else{var n=Error.apply(this,arguments);this.name="FirebaseError",Object.defineProperty(this,"stack",{get:function(){return n.stack}})}}}();e.FirebaseError=i,i.prototype=Object.create(Error.prototype),i.prototype.constructor=i,i.prototype.name="FirebaseError";var o=function(){function t(t,e,n){this.service=t,this.serviceName=e,this.errors=n,this.pattern=/\{\$([^}]+)}/g}return t.prototype.create=function(t,e){void 0===e&&(e={});var n,r=this.errors[t],o=this.service+"/"+t;n=void 0===r?"Error":r.replace(this.pattern,function(t,n){var r=e[n];return void 0!==r?r.toString():"<"+n+"?>"});var s=new i(o,n=this.serviceName+": "+n+" ("+o+").");for(var a in e)e.hasOwnProperty(a)&&"_"!==a.slice(-1)&&(s[a]=e[a]);return s},t}();e.ErrorFactory=o},"E9/g":function(t,e,n){"use strict";n.d(e,"a",function(){return u});var r=n("6Xbx"),i=n("B1iP"),o=n("qLnt"),s=n("grVA"),a=n("V7AE"),u=function(t){function e(n,r,i){switch(t.call(this),this.syncErrorValue=null,this.syncErrorThrown=!1,this.syncErrorThrowable=!1,this.isStopped=!1,arguments.length){case 0:this.destination=s.a;break;case 1:if(!n){this.destination=s.a;break}if("object"==typeof n){n instanceof e?(this.syncErrorThrowable=n.syncErrorThrowable,this.destination=n,this.destination.add(this)):(this.syncErrorThrowable=!0,this.destination=new l(this,n));break}default:this.syncErrorThrowable=!0,this.destination=new l(this,n,r,i)}}return Object(r.__extends)(e,t),e.prototype[a.a]=function(){return this},e.create=function(t,n,r){var i=new e(t,n,r);return i.syncErrorThrowable=!1,i},e.prototype.next=function(t){this.isStopped||this._next(t)},e.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this))},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){this.destination.error(t),this.unsubscribe()},e.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},e.prototype._unsubscribeAndRecycle=function(){var t=this._parent,e=this._parents;return this._parent=null,this._parents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parent=t,this._parents=e,this},e}(o.a),l=function(t){function e(e,n,r,o){var a;t.call(this),this._parentSubscriber=e;var u=this;Object(i.a)(n)?a=n:n&&(a=n.next,r=n.error,o=n.complete,n!==s.a&&(u=Object.create(n),Object(i.a)(u.unsubscribe)&&this.add(u.unsubscribe.bind(u)),u.unsubscribe=this.unsubscribe.bind(this))),this._context=u,this._next=a,this._error=r,this._complete=o}return Object(r.__extends)(e,t),e.prototype.next=function(t){if(!this.isStopped&&this._next){var e=this._parentSubscriber;e.syncErrorThrowable?this.__tryOrSetError(e,this._next,t)&&this.unsubscribe():this.__tryOrUnsub(this._next,t)}},e.prototype.error=function(t){if(!this.isStopped){var e=this._parentSubscriber;if(this._error)e.syncErrorThrowable?(this.__tryOrSetError(e,this._error,t),this.unsubscribe()):(this.__tryOrUnsub(this._error,t),this.unsubscribe());else{if(!e.syncErrorThrowable)throw this.unsubscribe(),t;e.syncErrorValue=t,e.syncErrorThrown=!0,this.unsubscribe()}}},e.prototype.complete=function(){var t=this;if(!this.isStopped){var e=this._parentSubscriber;if(this._complete){var n=function(){return t._complete.call(t._context)};e.syncErrorThrowable?(this.__tryOrSetError(e,n),this.unsubscribe()):(this.__tryOrUnsub(n),this.unsubscribe())}else this.unsubscribe()}},e.prototype.__tryOrUnsub=function(t,e){try{t.call(this._context,e)}catch(t){throw this.unsubscribe(),t}},e.prototype.__tryOrSetError=function(t,e,n){try{e.call(this._context,n)}catch(e){return t.syncErrorValue=e,t.syncErrorThrown=!0,!0}return!1},e.prototype._unsubscribe=function(){var t=this._parentSubscriber;this._context=null,this._parentSubscriber=null,t.unsubscribe()},e}(u)},"Ecq+":function(t,e,n){"use strict";n.d(e,"a",function(){return i});var r=n("6Xbx"),i=function(t){function e(e){t.call(this),this.scheduler=e}return Object(r.__extends)(e,t),e.create=function(t){return new e(t)},e.dispatch=function(t){t.subscriber.complete()},e.prototype._subscribe=function(t){var n=this.scheduler;if(n)return n.schedule(e.dispatch,0,{subscriber:t});t.complete()},e}(n("AP4T").a)},EqqR:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n("/byE");e.assert=function(t,n){if(!t)throw e.assertionError(n)},e.assertionError=function(t){return new Error("Firebase Database ("+r.CONSTANTS.SDK_VERSION+") INTERNAL ASSERT FAILED: "+t)}},ExCY:function(t,e,n){"use strict";function r(){}function i(t){return t?1===t.length?t[0]:function(e){return t.reduce(function(t,e){return e(t)},e)}:r}e.a=function(){for(var t=[],e=0;e<arguments.length;e++)t[e-0]=arguments[e];return i(t)},e.b=i},Hyt9:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Deferred=function(){function t(){var t=this;this.promise=new Promise(function(e,n){t.resolve=e,t.reject=n})}return t.prototype.wrapCallback=function(t){var e=this;return function(n,r){n?e.reject(n):e.resolve(r),"function"==typeof t&&(e.promise.catch(function(){}),1===t.length?t(n):t(n,r))}},t}()},JCUt:function(t,e,n){"use strict";function r(t,e){if(!(e instanceof Object))return e;switch(e.constructor){case Date:return new Date(e.getTime());case Object:void 0===t&&(t={});break;case Array:t=[];break;default:return e}for(var n in e)e.hasOwnProperty(n)&&(t[n]=r(t[n],e[n]));return t}Object.defineProperty(e,"__esModule",{value:!0}),e.deepCopy=function(t){return r(void 0,t)},e.deepExtend=r,e.patchProperty=function(t,e,n){t[e]=n}},JEJ4:function(t,e,n){"use strict";function r(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}Object.defineProperty(e,"__esModule",{value:!0}),r(n("EqqR")),r(n("e9+7")),r(n("/byE")),r(n("JCUt")),r(n("Hyt9")),r(n("U4XL")),r(n("COMn")),r(n("WH8D")),r(n("NYZW")),r(n("/ygB")),r(n("NeHU")),r(n("uzI5")),r(n("Xp63")),r(n("Tmcl")),r(n("2mdx"))},LMZF:function(t,e,n){"use strict";(function(t){n.d(e,"g",function(){return Xt}),n.d(e,"Q",function(){return Kt}),n.d(e,"T",function(){return zt}),n.d(e,"P",function(){return Gt}),n.d(e,"w",function(){return Qt}),n.d(e,"c",function(){return rt}),n.d(e,"A",function(){return st}),n.d(e,"z",function(){return at}),n.d(e,"b",function(){return ut}),n.d(e,"d",function(){return et}),n.d(e,"e",function(){return nt}),n.d(e,"S",function(){return ge}),n.d(e,"K",function(){return Vt}),n.d(e,"V",function(){return jt}),n.d(e,"s",function(){return Ue}),n.d(e,"f",function(){return Ke}),n.d(e,"m",function(){return xt}),n.d(e,"l",function(){return Z}),n.d(e,"E",function(){return Qe}),n.d(e,"F",function(){return ze}),n.d(e,"a",function(){return h}),n.d(e,"N",function(){return f}),n.d(e,"L",function(){return p}),n.d(e,"R",function(){return k}),n.d(e,"p",function(){return N}),n.d(e,"o",function(){return u}),n.d(e,"n",function(){return y}),n.d(e,"y",function(){return m}),n.d(e,"G",function(){return v}),n.d(e,"x",function(){return At}),n.d(e,"B",function(){return ee}),n.d(e,"C",function(){return $t}),n.d(e,"D",function(){return te}),n.d(e,"i",function(){return ht}),n.d(e,"j",function(){return _t}),n.d(e,"k",function(){return ne}),n.d(e,"t",function(){return St}),n.d(e,"v",function(){return Et}),n.d(e,"u",function(){return re}),n.d(e,"H",function(){return ae}),n.d(e,"I",function(){return oe}),n.d(e,"J",function(){return le}),n.d(e,"M",function(){return ce}),n.d(e,"h",function(){return he}),n.d(e,"q",function(){return De}),n.d(e,"r",function(){return Me}),n.d(e,"O",function(){return be}),n.d(e,"U",function(){return Le}),n.d(e,"_7",function(){return Ee}),n.d(e,"X",function(){return lt}),n.d(e,"W",function(){return bt}),n.d(e,"_4",function(){return w}),n.d(e,"_10",function(){return T}),n.d(e,"_22",function(){return I}),n.d(e,"_8",function(){return tt}),n.d(e,"_9",function(){return $}),n.d(e,"Y",function(){return Un}),n.d(e,"Z",function(){return or}),n.d(e,"_0",function(){return lo}),n.d(e,"_1",function(){return hn}),n.d(e,"_2",function(){return xr}),n.d(e,"_3",function(){return Bn}),n.d(e,"_6",function(){return jn}),n.d(e,"_11",function(){return Jn}),n.d(e,"_12",function(){return Yn}),n.d(e,"_14",function(){return mr}),n.d(e,"_16",function(){return Ar}),n.d(e,"_19",function(){return Or}),n.d(e,"_17",function(){return Zr}),n.d(e,"_18",function(){return Xr}),n.d(e,"_21",function(){return zr}),n.d(e,"_23",function(){return ti}),n.d(e,"_24",function(){return un}),n.d(e,"_25",function(){return ri}),n.d(e,"_13",function(){return Be}),n.d(e,"_15",function(){return qe}),n.d(e,"_20",function(){return He}),n.d(e,"_5",function(){return it});var r=n("6Xbx"),i=n("AP4T"),o=n("2kLc"),s=n("URbD"),a=n("TO51"),u=function(){function t(t){this._desc=t,this.ngMetadataName="InjectionToken"}return t.prototype.toString=function(){return"InjectionToken "+this._desc},t}(),l="__paramaters__";function c(t,e,n){var r=function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(t){var r=t.apply(void 0,e);for(var i in r)this[i]=r[i]}}}(e);function i(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(this instanceof i)return r.apply(this,t),this;var n,o=new((n=i).bind.apply(n,[void 0].concat(t)));return s.annotation=o,s;function s(t,e,n){for(var r=t.hasOwnProperty(l)?t[l]:Object.defineProperty(t,l,{value:[]})[l];r.length<=n;)r.push(null);return(r[n]=r[n]||[]).push(o),t}}return n&&(i.prototype=Object.create(n.prototype)),i.prototype.ngMetadataName=t,i.annotationCls=i,i}var h=new u("AnalyzeForEntryComponents"),f=function(){var t={Emulated:0,Native:1,None:2};return t[t.Emulated]="Emulated",t[t.Native]="Native",t[t.None]="None",t}(),p=function(t){this.full=t,this.major=t.split(".")[0],this.minor=t.split(".")[1],this.patch=t.split(".").slice(2).join(".")},d=new p("5.2.2"),y=c("Inject",function(t){return{token:t}}),m=c("Optional"),g=c("Self"),v=c("SkipSelf"),_="undefined"!=typeof window&&window,b="undefined"!=typeof self&&"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self,w=_||"undefined"!=typeof t&&t||b,E=null;function S(){if(!E){var t=w.Symbol;if(t&&t.iterator)E=t.iterator;else for(var e=Object.getOwnPropertyNames(Map.prototype),n=0;n<e.length;++n){var r=e[n];"entries"!==r&&"size"!==r&&Map.prototype[r]===Map.prototype.entries&&(E=r)}}return E}function C(t){Zone.current.scheduleMicroTask("scheduleMicrotask",t)}function T(t,e){return t===e||"number"==typeof t&&"number"==typeof e&&isNaN(t)&&isNaN(e)}function I(t){if("string"==typeof t)return t;if(t instanceof Array)return"["+t.map(I).join(", ")+"]";if(null==t)return""+t;if(t.overriddenName)return""+t.overriddenName;if(t.name)return""+t.name;var e=t.toString();if(null==e)return""+e;var n=e.indexOf("\n");return-1===n?e:e.substring(0,n)}function k(t){return t.__forward_ref__=k,t.toString=function(){return I(this())},t}function x(t){return"function"==typeof t&&t.hasOwnProperty("__forward_ref__")&&t.__forward_ref__===k?t():t}var A="__source",O=new Object,P=function(){function t(){}return t.prototype.get=function(t,e){if(void 0===e&&(e=O),e===O)throw new Error("NullInjectorError: No provider for "+I(t)+"!");return e},t}(),N=function(){function t(){}return t.create=function(t,e){return Array.isArray(t)?new q(t,e):new q(t.providers,t.parent,t.name||null)},t.THROW_IF_NOT_FOUND=O,t.NULL=new P,t}(),R=function(t){return t},D=[],M=R,V=function(){return Array.prototype.slice.call(arguments)},F={},j=function(t){for(var e in t)if(t[e]===F)return e;throw Error("!prop")}({provide:String,useValue:F}),L=N.NULL,U=/\n/gm,B="\u0275",q=function(){function t(t,e,n){void 0===e&&(e=L),void 0===n&&(n=null),this.parent=e,this.source=n;var r=this._records=new Map;r.set(N,{token:N,fn:R,deps:D,value:this,useNew:!1}),function t(e,n){if(n)if((n=x(n))instanceof Array)for(var r=0;r<n.length;r++)t(e,n[r]);else{if("function"==typeof n)throw z("Function/Class not supported",n);if(!n||"object"!=typeof n||!n.provide)throw z("Unexpected provider",n);var i=x(n.provide),o=function(t){var e=function(t){var e=D,n=t.deps;if(n&&n.length){e=[];for(var r=0;r<n.length;r++){var i=6;if((u=x(n[r]))instanceof Array)for(var o=0,s=u;o<s.length;o++){var a=s[o];a instanceof m||a==m?i|=1:a instanceof v||a==v?i&=-3:a instanceof g||a==g?i&=-5:u=a instanceof y?a.token:x(a)}e.push({token:u,options:i})}}else if(t.useExisting){var u;e=[{token:u=x(t.useExisting),options:6}]}else if(!(n||j in t))throw z("'deps' required",t);return e}(t),n=R,r=D,i=!1,o=x(t.provide);if(j in t)r=t.useValue;else if(t.useFactory)n=t.useFactory;else if(t.useExisting);else if(t.useClass)i=!0,n=x(t.useClass);else{if("function"!=typeof o)throw z("StaticProvider does not have [useValue|useFactory|useExisting|useClass] or [provide] is not newable",t);i=!0,n=o}return{deps:e,fn:n,useNew:i,value:r}}(n);if(!0===n.multi){var s=e.get(i);if(s){if(s.fn!==V)throw H(i)}else e.set(i,s={token:n.provide,deps:[],useNew:!1,fn:V,value:D});s.deps.push({token:i=n,options:6})}var a=e.get(i);if(a&&a.fn==V)throw H(i);e.set(i,o)}}(r,t)}return t.prototype.get=function(t,e){var n=this._records.get(t);try{return function t(e,n,r,i,o){try{return function(e,n,r,i,o){var s,a;if(n){if((s=n.value)==M)throw Error(B+"Circular dependency");if(s===D){n.value=M;var u=n.useNew,l=n.fn,c=n.deps,h=D;if(c.length){h=[];for(var f=0;f<c.length;f++){var p=c[f],d=p.options,y=2&d?r.get(p.token):void 0;h.push(t(p.token,y,r,y||4&d?i:L,1&d?null:N.THROW_IF_NOT_FOUND))}}n.value=s=u?new((a=l).bind.apply(a,[void 0].concat(h))):l.apply(void 0,h)}}else s=i.get(e,o);return s}(e,n,r,i,o)}catch(t){throw t instanceof Error||(t=new Error(t)),(t.ngTempTokenPath=t.ngTempTokenPath||[]).unshift(e),n&&n.value==M&&(n.value=D),t}}(t,n,this._records,this.parent,e)}catch(e){var r=e.ngTempTokenPath;throw t[A]&&r.unshift(t[A]),e.message=K("\n"+e.message,r,this.source),e.ngTokenPath=r,e.ngTempTokenPath=null,e}},t.prototype.toString=function(){var t=[];return this._records.forEach(function(e,n){return t.push(I(n))}),"StaticInjector["+t.join(", ")+"]"},t}();function H(t){return z("Cannot mix multi providers and regular providers",t)}function K(t,e,n){void 0===n&&(n=null),t=t&&"\n"===t.charAt(0)&&t.charAt(1)==B?t.substr(2):t;var r=I(e);if(e instanceof Array)r=e.map(I).join(" -> ");else if("object"==typeof e){var i=[];for(var o in e)if(e.hasOwnProperty(o)){var s=e[o];i.push(o+":"+("string"==typeof s?JSON.stringify(s):I(s)))}r="{"+i.join(", ")+"}"}return"StaticInjectorError"+(n?"("+n+")":"")+"["+r+"]: "+t.replace(U,"\n  ")}function z(t,e){return new Error(K(t,e))}var Q="ngDebugContext",G="ngOriginalError",W="ngErrorLogger";function Y(t){return t[Q]}function J(t){return t[G]}function X(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];t.error.apply(t,e)}var Z=function(){function t(){this._console=console}return t.prototype.handleError=function(t){var e=this._findOriginalError(t),n=this._findContext(t),r=function(t){return t[W]||X}(t);r(this._console,"ERROR",t),e&&r(this._console,"ORIGINAL ERROR",e),n&&r(this._console,"ERROR CONTEXT",n)},t.prototype._findContext=function(t){return t?Y(t)?Y(t):this._findContext(J(t)):null},t.prototype._findOriginalError=function(t){for(var e=J(t);e&&J(e);)e=J(e);return e},t}();function $(t){return!!t&&"function"==typeof t.then}function tt(t){return!!t&&"function"==typeof t.subscribe}Function;var et=new u("Application Initializer"),nt=function(){function t(t){var e=this;this.appInits=t,this.initialized=!1,this.done=!1,this.donePromise=new Promise(function(t,n){e.resolve=t,e.reject=n})}return t.prototype.runInitializers=function(){var t=this;if(!this.initialized){var e=[],n=function(){t.done=!0,t.resolve()};if(this.appInits)for(var r=0;r<this.appInits.length;r++){var i=this.appInits[r]();$(i)&&e.push(i)}Promise.all(e).then(function(){n()}).catch(function(e){t.reject(e)}),0===e.length&&n(),this.initialized=!0}},t}(),rt=new u("AppId");function it(){return""+ot()+ot()+ot()}function ot(){return String.fromCharCode(97+Math.floor(25*Math.random()))}var st=new u("Platform Initializer"),at=new u("Platform ID"),ut=new u("appBootstrapListener"),lt=function(){function t(){}return t.prototype.log=function(t){console.log(t)},t.prototype.warn=function(t){console.warn(t)},t.ctorParameters=function(){return[]},t}();function ct(){throw new Error("Runtime compiler is not loaded")}var ht=function(){function t(){}return t.prototype.compileModuleSync=function(t){throw ct()},t.prototype.compileModuleAsync=function(t){throw ct()},t.prototype.compileModuleAndAllComponentsSync=function(t){throw ct()},t.prototype.compileModuleAndAllComponentsAsync=function(t){throw ct()},t.prototype.clearCache=function(){},t.prototype.clearCacheFor=function(t){},t}(),ft=function(){},pt=function(){};function dt(t){var e=Error("No component factory found for "+I(t)+". Did you add it to @NgModule.entryComponents?");return e[gt]=t,e}var yt,mt,gt="ngComponent",vt=function(){function t(){}return t.prototype.resolveComponentFactory=function(t){throw dt(t)},t}(),_t=function(){function t(){}return t.NULL=new vt,t}(),bt=function(){function t(t,e,n){this._parent=e,this._ngModule=n,this._factories=new Map;for(var r=0;r<t.length;r++){var i=t[r];this._factories.set(i.componentType,i)}}return t.prototype.resolveComponentFactory=function(t){var e=this._factories.get(t);if(!e&&this._parent&&(e=this._parent.resolveComponentFactory(t)),!e)throw dt(t);return new wt(e,this._ngModule)},t}(),wt=function(t){function e(e,n){var r=t.call(this)||this;return r.factory=e,r.ngModule=n,r.selector=e.selector,r.componentType=e.componentType,r.ngContentSelectors=e.ngContentSelectors,r.inputs=e.inputs,r.outputs=e.outputs,r}return Object(r.__extends)(e,t),e.prototype.create=function(t,e,n,r){return this.factory.create(t,e,n,r||this.ngModule)},e}(pt),Et=function(){},St=function(){},Ct=function(){var t=w.wtf;return!(!t||!(yt=t.trace)||(mt=yt.events,0))}();function Tt(t,e){return null}var It=Ct?function(t,e){return void 0===e&&(e=null),mt.createScope(t,e)}:function(t,e){return Tt},kt=Ct?function(t,e){return yt.leaveScope(t,e),e}:function(t,e){return e},xt=function(t){function e(e){void 0===e&&(e=!1);var n=t.call(this)||this;return n.__isAsync=e,n}return Object(r.__extends)(e,t),e.prototype.emit=function(e){t.prototype.next.call(this,e)},e.prototype.subscribe=function(e,n,r){var i,o=function(t){return null},s=function(){return null};return e&&"object"==typeof e?(i=this.__isAsync?function(t){setTimeout(function(){return e.next(t)})}:function(t){e.next(t)},e.error&&(o=this.__isAsync?function(t){setTimeout(function(){return e.error(t)})}:function(t){e.error(t)}),e.complete&&(s=this.__isAsync?function(){setTimeout(function(){return e.complete()})}:function(){e.complete()})):(i=this.__isAsync?function(t){setTimeout(function(){return e(t)})}:function(t){e(t)},n&&(o=this.__isAsync?function(t){setTimeout(function(){return n(t)})}:function(t){n(t)}),r&&(s=this.__isAsync?function(){setTimeout(function(){return r()})}:function(){r()})),t.prototype.subscribe.call(this,i,o,s)},e}(a.a),At=function(){function t(t){var e,n=t.enableLongStackTrace,r=void 0!==n&&n;if(this.hasPendingMicrotasks=!1,this.hasPendingMacrotasks=!1,this.isStable=!0,this.onUnstable=new xt(!1),this.onMicrotaskEmpty=new xt(!1),this.onStable=new xt(!1),this.onError=new xt(!1),"undefined"==typeof Zone)throw new Error("In this configuration Angular requires Zone.js");Zone.assertZonePatched(),this._nesting=0,this._outer=this._inner=Zone.current,Zone.wtfZoneSpec&&(this._inner=this._inner.fork(Zone.wtfZoneSpec)),r&&Zone.longStackTraceZoneSpec&&(this._inner=this._inner.fork(Zone.longStackTraceZoneSpec)),(e=this)._inner=e._inner.fork({name:"angular",properties:{isAngularZone:!0},onInvokeTask:function(t,n,r,i,o,s){try{return Rt(e),t.invokeTask(r,i,o,s)}finally{Dt(e)}},onInvoke:function(t,n,r,i,o,s,a){try{return Rt(e),t.invoke(r,i,o,s,a)}finally{Dt(e)}},onHasTask:function(t,n,r,i){t.hasTask(r,i),n===r&&("microTask"==i.change?(e.hasPendingMicrotasks=i.microTask,Nt(e)):"macroTask"==i.change&&(e.hasPendingMacrotasks=i.macroTask))},onHandleError:function(t,n,r,i){return t.handleError(r,i),e.runOutsideAngular(function(){return e.onError.emit(i)}),!1}})}return t.isInAngularZone=function(){return!0===Zone.current.get("isAngularZone")},t.assertInAngularZone=function(){if(!t.isInAngularZone())throw new Error("Expected to be in Angular Zone, but it is not!")},t.assertNotInAngularZone=function(){if(t.isInAngularZone())throw new Error("Expected to not be in Angular Zone, but it is!")},t.prototype.run=function(t,e,n){return this._inner.run(t,e,n)},t.prototype.runTask=function(t,e,n,r){var i=this._inner,o=i.scheduleEventTask("NgZoneEvent: "+r,t,Pt,Ot,Ot);try{return i.runTask(o,e,n)}finally{i.cancelTask(o)}},t.prototype.runGuarded=function(t,e,n){return this._inner.runGuarded(t,e,n)},t.prototype.runOutsideAngular=function(t){return this._outer.run(t)},t}();function Ot(){}var Pt={};function Nt(t){if(0==t._nesting&&!t.hasPendingMicrotasks&&!t.isStable)try{t._nesting++,t.onMicrotaskEmpty.emit(null)}finally{if(t._nesting--,!t.hasPendingMicrotasks)try{t.runOutsideAngular(function(){return t.onStable.emit(null)})}finally{t.isStable=!0}}}function Rt(t){t._nesting++,t.isStable&&(t.isStable=!1,t.onUnstable.emit(null))}function Dt(t){t._nesting--,Nt(t)}var Mt=function(){function t(){this.hasPendingMicrotasks=!1,this.hasPendingMacrotasks=!1,this.isStable=!0,this.onUnstable=new xt,this.onMicrotaskEmpty=new xt,this.onStable=new xt,this.onError=new xt}return t.prototype.run=function(t){return t()},t.prototype.runGuarded=function(t){return t()},t.prototype.runOutsideAngular=function(t){return t()},t.prototype.runTask=function(t){return t()},t}(),Vt=function(){function t(t){this._ngZone=t,this._pendingCount=0,this._isZoneStable=!0,this._didWork=!1,this._callbacks=[],this._watchAngularEvents()}return t.prototype._watchAngularEvents=function(){var t=this;this._ngZone.onUnstable.subscribe({next:function(){t._didWork=!0,t._isZoneStable=!1}}),this._ngZone.runOutsideAngular(function(){t._ngZone.onStable.subscribe({next:function(){At.assertNotInAngularZone(),C(function(){t._isZoneStable=!0,t._runCallbacksIfReady()})}})})},t.prototype.increasePendingRequestCount=function(){return this._pendingCount+=1,this._didWork=!0,this._pendingCount},t.prototype.decreasePendingRequestCount=function(){if(this._pendingCount-=1,this._pendingCount<0)throw new Error("pending async requests below zero");return this._runCallbacksIfReady(),this._pendingCount},t.prototype.isStable=function(){return this._isZoneStable&&0==this._pendingCount&&!this._ngZone.hasPendingMacrotasks},t.prototype._runCallbacksIfReady=function(){var t=this;this.isStable()?C(function(){for(;0!==t._callbacks.length;)t._callbacks.pop()(t._didWork);t._didWork=!1}):this._didWork=!0},t.prototype.whenStable=function(t){this._callbacks.push(t),this._runCallbacksIfReady()},t.prototype.getPendingRequestCount=function(){return this._pendingCount},t.prototype.findProviders=function(t,e,n){return[]},t}(),Ft=function(){function t(){this._applications=new Map,Ut.addToWindow(this)}return t.prototype.registerApplication=function(t,e){this._applications.set(t,e)},t.prototype.unregisterApplication=function(t){this._applications.delete(t)},t.prototype.unregisterAllApplications=function(){this._applications.clear()},t.prototype.getTestability=function(t){return this._applications.get(t)||null},t.prototype.getAllTestabilities=function(){return Array.from(this._applications.values())},t.prototype.getAllRootElements=function(){return Array.from(this._applications.keys())},t.prototype.findTestabilityInTree=function(t,e){return void 0===e&&(e=!0),Ut.findTestabilityInTree(this,t,e)},t.ctorParameters=function(){return[]},t}();function jt(t){Ut=t}var Lt,Ut=new(function(){function t(){}return t.prototype.addToWindow=function(t){},t.prototype.findTestabilityInTree=function(t,e,n){return null},t}()),Bt=!0,qt=!1,Ht=new u("AllowMultipleToken");function Kt(){if(qt)throw new Error("Cannot enable prod mode after platform setup.");Bt=!1}function zt(){return qt=!0,Bt}var Qt=function(t,e){this.name=t,this.token=e};function Gt(t,e,n){void 0===n&&(n=[]);var r="Platform: "+e,i=new u(r);return function(e){void 0===e&&(e=[]);var o=Wt();if(!o||o.injector.get(Ht,!1))if(t)t(n.concat(e).concat({provide:i,useValue:!0}));else{var s=n.concat(e).concat({provide:i,useValue:!0});!function(t){if(Lt&&!Lt.destroyed&&!Lt.injector.get(Ht,!1))throw new Error("There can be only one platform. Destroy the previous one to create a new one.");Lt=t.get(Yt);var e=t.get(st,null);e&&e.forEach(function(t){return t()})}(N.create({providers:s,name:r}))}return function(t){var e=Wt();if(!e)throw new Error("No platform exists!");if(!e.injector.get(t,null))throw new Error("A platform with a different configuration has been created. Please destroy it first.");return e}(i)}}function Wt(){return Lt&&!Lt.destroyed?Lt:null}var Yt=function(){function t(t){this._injector=t,this._modules=[],this._destroyListeners=[],this._destroyed=!1}return t.prototype.bootstrapModuleFactory=function(t,e){var n,r=this,i="noop"===(n=e?e.ngZone:void 0)?new Mt:("zone.js"===n?void 0:n)||new At({enableLongStackTrace:zt()}),o=[{provide:At,useValue:i}];return i.run(function(){var e=N.create({providers:o,parent:r.injector,name:t.moduleType.name}),n=t.create(e),s=n.injector.get(Z,null);if(!s)throw new Error("No ErrorHandler. Is platform module (BrowserModule) included?");return n.onDestroy(function(){return Zt(r._modules,n)}),i.runOutsideAngular(function(){return i.onError.subscribe({next:function(t){s.handleError(t)}})}),function(t,e,i){try{var o=((s=n.injector.get(nt)).runInitializers(),s.donePromise.then(function(){return r._moduleDoBootstrap(n),n}));return $(o)?o.catch(function(n){throw e.runOutsideAngular(function(){return t.handleError(n)}),n}):o}catch(n){throw e.runOutsideAngular(function(){return t.handleError(n)}),n}var s}(s,i)})},t.prototype.bootstrapModule=function(t,e){var n=this;void 0===e&&(e=[]);var r=this.injector.get(ft),i=Jt({},e);return r.createCompiler([i]).compileModuleAsync(t).then(function(t){return n.bootstrapModuleFactory(t,i)})},t.prototype._moduleDoBootstrap=function(t){var e=t.injector.get(Xt);if(t._bootstrapComponents.length>0)t._bootstrapComponents.forEach(function(t){return e.bootstrap(t)});else{if(!t.instance.ngDoBootstrap)throw new Error("The module "+I(t.instance.constructor)+' was bootstrapped, but it does not declare "@NgModule.bootstrap" components nor a "ngDoBootstrap" method. Please define one of these.');t.instance.ngDoBootstrap(e)}this._modules.push(t)},t.prototype.onDestroy=function(t){this._destroyListeners.push(t)},Object.defineProperty(t.prototype,"injector",{get:function(){return this._injector},enumerable:!0,configurable:!0}),t.prototype.destroy=function(){if(this._destroyed)throw new Error("The platform has already been destroyed!");this._modules.slice().forEach(function(t){return t.destroy()}),this._destroyListeners.forEach(function(t){return t()}),this._destroyed=!0},Object.defineProperty(t.prototype,"destroyed",{get:function(){return this._destroyed},enumerable:!0,configurable:!0}),t}();function Jt(t,e){return Array.isArray(e)?e.reduce(Jt,t):Object(r.__assign)({},t,e)}var Xt=function(){function t(t,e,n,r,a,u){var l=this;this._zone=t,this._console=e,this._injector=n,this._exceptionHandler=r,this._componentFactoryResolver=a,this._initStatus=u,this._bootstrapListeners=[],this._views=[],this._runningTick=!1,this._enforceNoNewChanges=!1,this._stable=!0,this.componentTypes=[],this.components=[],this._enforceNoNewChanges=zt(),this._zone.onMicrotaskEmpty.subscribe({next:function(){l._zone.run(function(){l.tick()})}});var c=new i.a(function(t){l._stable=l._zone.isStable&&!l._zone.hasPendingMacrotasks&&!l._zone.hasPendingMicrotasks,l._zone.runOutsideAngular(function(){t.next(l._stable),t.complete()})}),h=new i.a(function(t){var e;l._zone.runOutsideAngular(function(){e=l._zone.onStable.subscribe(function(){At.assertNotInAngularZone(),C(function(){l._stable||l._zone.hasPendingMacrotasks||l._zone.hasPendingMicrotasks||(l._stable=!0,t.next(!0))})})});var n=l._zone.onUnstable.subscribe(function(){At.assertInAngularZone(),l._stable&&(l._stable=!1,l._zone.runOutsideAngular(function(){t.next(!1)}))});return function(){e.unsubscribe(),n.unsubscribe()}});this.isStable=Object(o.a)(c,s.a.call(h))}return t.prototype.bootstrap=function(t,e){var n,r=this;if(!this._initStatus.done)throw new Error("Cannot bootstrap as there are still asynchronous initializers running. Bootstrap components in the `ngDoBootstrap` method of the root module.");n=t instanceof pt?t:this._componentFactoryResolver.resolveComponentFactory(t),this.componentTypes.push(n.componentType);var i=n instanceof wt?null:this._injector.get(Et),o=n.create(N.NULL,[],e||n.selector,i);o.onDestroy(function(){r._unloadComponent(o)});var s=o.injector.get(Vt,null);return s&&o.injector.get(Ft).registerApplication(o.location.nativeElement,s),this._loadComponent(o),zt()&&this._console.log("Angular is running in the development mode. Call enableProdMode() to enable the production mode."),o},t.prototype.tick=function(){var e=this;if(this._runningTick)throw new Error("ApplicationRef.tick is called recursively");var n=t._tickScope();try{this._runningTick=!0,this._views.forEach(function(t){return t.detectChanges()}),this._enforceNoNewChanges&&this._views.forEach(function(t){return t.checkNoChanges()})}catch(t){this._zone.runOutsideAngular(function(){return e._exceptionHandler.handleError(t)})}finally{this._runningTick=!1,kt(n)}},t.prototype.attachView=function(t){var e=t;this._views.push(e),e.attachToAppRef(this)},t.prototype.detachView=function(t){var e=t;Zt(this._views,e),e.detachFromAppRef()},t.prototype._loadComponent=function(t){this.attachView(t.hostView),this.tick(),this.components.push(t),this._injector.get(ut,[]).concat(this._bootstrapListeners).forEach(function(e){return e(t)})},t.prototype._unloadComponent=function(t){this.detachView(t.hostView),Zt(this.components,t)},t.prototype.ngOnDestroy=function(){this._views.slice().forEach(function(t){return t.destroy()})},Object.defineProperty(t.prototype,"viewCount",{get:function(){return this._views.length},enumerable:!0,configurable:!0}),t._tickScope=It("ApplicationRef#tick()"),t}();function Zt(t,e){var n=t.indexOf(e);n>-1&&t.splice(n,1)}var $t=function(){},te=function(){var t={Important:1,DashCase:2};return t[t.Important]="Important",t[t.DashCase]="DashCase",t}(),ee=function(){},ne=function(t){this.nativeElement=t},re=function(){},ie=function(){function t(){this.dirty=!0,this._results=[],this.changes=new xt}return t.prototype.map=function(t){return this._results.map(t)},t.prototype.filter=function(t){return this._results.filter(t)},t.prototype.find=function(t){return this._results.find(t)},t.prototype.reduce=function(t,e){return this._results.reduce(t,e)},t.prototype.forEach=function(t){this._results.forEach(t)},t.prototype.some=function(t){return this._results.some(t)},t.prototype.toArray=function(){return this._results.slice()},t.prototype[S()]=function(){return this._results[S()]()},t.prototype.toString=function(){return this._results.toString()},t.prototype.reset=function(t){this._results=function t(e){return e.reduce(function(e,n){var r=Array.isArray(n)?t(n):n;return e.concat(r)},[])}(t),this.dirty=!1,this.length=this._results.length,this.last=this._results[this.length-1],this.first=this._results[0]},t.prototype.notifyOnChanges=function(){this.changes.emit(this)},t.prototype.setDirty=function(){this.dirty=!0},t.prototype.destroy=function(){this.changes.complete(),this.changes.unsubscribe()},t}(),oe=function(){},se={factoryPathPrefix:"",factoryPathSuffix:".ngfactory"},ae=function(){function t(t,e){this._compiler=t,this._config=e||se}return t.prototype.load=function(t){return this._compiler instanceof ht?this.loadFactory(t):this.loadAndCompile(t)},t.prototype.loadAndCompile=function(t){var e=this,r=t.split("#"),i=r[0],o=r[1];return void 0===o&&(o="default"),n("YuZA")(i).then(function(t){return t[o]}).then(function(t){return ue(t,i,o)}).then(function(t){return e._compiler.compileModuleAsync(t)})},t.prototype.loadFactory=function(t){var e=t.split("#"),r=e[0],i=e[1],o="NgFactory";return void 0===i&&(i="default",o=""),n("YuZA")(this._config.factoryPathPrefix+r+this._config.factoryPathSuffix).then(function(t){return t[i+o]}).then(function(t){return ue(t,r,i)})},t}();function ue(t,e,n){if(!t)throw new Error("Cannot find '"+n+"' in '"+e+"'");return t}var le=function(){},ce=function(){},he=function(){},fe=function(){function t(t,e,n){this._debugContext=n,this.nativeNode=t,e&&e instanceof pe?e.addChild(this):this.parent=null,this.listeners=[]}return Object.defineProperty(t.prototype,"injector",{get:function(){return this._debugContext.injector},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"componentInstance",{get:function(){return this._debugContext.component},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"context",{get:function(){return this._debugContext.context},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"references",{get:function(){return this._debugContext.references},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"providerTokens",{get:function(){return this._debugContext.providerTokens},enumerable:!0,configurable:!0}),t}(),pe=function(t){function e(e,n,r){var i=t.call(this,e,n,r)||this;return i.properties={},i.attributes={},i.classes={},i.styles={},i.childNodes=[],i.nativeElement=e,i}return Object(r.__extends)(e,t),e.prototype.addChild=function(t){t&&(this.childNodes.push(t),t.parent=this)},e.prototype.removeChild=function(t){var e=this.childNodes.indexOf(t);-1!==e&&(t.parent=null,this.childNodes.splice(e,1))},e.prototype.insertChildrenAfter=function(t,e){var n,r=this,i=this.childNodes.indexOf(t);-1!==i&&((n=this.childNodes).splice.apply(n,[i+1,0].concat(e)),e.forEach(function(t){t.parent&&t.parent.removeChild(t),t.parent=r}))},e.prototype.insertBefore=function(t,e){var n=this.childNodes.indexOf(t);-1===n?this.addChild(e):(e.parent&&e.parent.removeChild(e),e.parent=this,this.childNodes.splice(n,0,e))},e.prototype.query=function(t){return this.queryAll(t)[0]||null},e.prototype.queryAll=function(t){var e=[];return de(this,t,e),e},e.prototype.queryAllNodes=function(t){var e=[];return ye(this,t,e),e},Object.defineProperty(e.prototype,"children",{get:function(){return this.childNodes.filter(function(t){return t instanceof e})},enumerable:!0,configurable:!0}),e.prototype.triggerEventHandler=function(t,e){this.listeners.forEach(function(n){n.name==t&&n.callback(e)})},e}(fe);function de(t,e,n){t.childNodes.forEach(function(t){t instanceof pe&&(e(t)&&n.push(t),de(t,e,n))})}function ye(t,e,n){t instanceof pe&&t.childNodes.forEach(function(t){e(t)&&n.push(t),t instanceof pe&&ye(t,e,n)})}var me=new Map;function ge(t){return me.get(t)||null}function ve(t){me.set(t.nativeNode,t)}function _e(t,e){var n=Ee(t),r=Ee(e);return n&&r?function(t,e,n){for(var r=t[S()](),i=e[S()]();;){var o=r.next(),s=i.next();if(o.done&&s.done)return!0;if(o.done||s.done)return!1;if(!n(o.value,s.value))return!1}}(t,e,_e):!(n||!t||"object"!=typeof t&&"function"!=typeof t||r||!e||"object"!=typeof e&&"function"!=typeof e)||T(t,e)}var be=function(){function t(t){this.wrapped=t}return t.wrap=function(e){return new t(e)},t.unwrap=function(e){return t.isWrapped(e)?e.wrapped:e},t.isWrapped=function(e){return e instanceof t},t}(),we=function(){function t(t,e,n){this.previousValue=t,this.currentValue=e,this.firstChange=n}return t.prototype.isFirstChange=function(){return this.firstChange},t}();function Ee(t){return!!Se(t)&&(Array.isArray(t)||!(t instanceof Map)&&S()in t)}function Se(t){return null!==t&&("function"==typeof t||"object"==typeof t)}var Ce=function(){function t(){}return t.prototype.supports=function(t){return Ee(t)},t.prototype.create=function(t){return new Ie(t)},t}(),Te=function(t,e){return e},Ie=function(){function t(t){this.length=0,this._linkedRecords=null,this._unlinkedRecords=null,this._previousItHead=null,this._itHead=null,this._itTail=null,this._additionsHead=null,this._additionsTail=null,this._movesHead=null,this._movesTail=null,this._removalsHead=null,this._removalsTail=null,this._identityChangesHead=null,this._identityChangesTail=null,this._trackByFn=t||Te}return t.prototype.forEachItem=function(t){var e;for(e=this._itHead;null!==e;e=e._next)t(e)},t.prototype.forEachOperation=function(t){for(var e=this._itHead,n=this._removalsHead,r=0,i=null;e||n;){var o=!n||e&&e.currentIndex<Oe(n,r,i)?e:n,s=Oe(o,r,i),a=o.currentIndex;if(o===n)r--,n=n._nextRemoved;else if(e=e._next,null==o.previousIndex)r++;else{i||(i=[]);var u=s-r,l=a-r;if(u!=l){for(var c=0;c<u;c++){var h=c<i.length?i[c]:i[c]=0,f=h+c;l<=f&&f<u&&(i[c]=h+1)}i[o.previousIndex]=l-u}}s!==a&&t(o,s,a)}},t.prototype.forEachPreviousItem=function(t){var e;for(e=this._previousItHead;null!==e;e=e._nextPrevious)t(e)},t.prototype.forEachAddedItem=function(t){var e;for(e=this._additionsHead;null!==e;e=e._nextAdded)t(e)},t.prototype.forEachMovedItem=function(t){var e;for(e=this._movesHead;null!==e;e=e._nextMoved)t(e)},t.prototype.forEachRemovedItem=function(t){var e;for(e=this._removalsHead;null!==e;e=e._nextRemoved)t(e)},t.prototype.forEachIdentityChange=function(t){var e;for(e=this._identityChangesHead;null!==e;e=e._nextIdentityChange)t(e)},t.prototype.diff=function(t){if(null==t&&(t=[]),!Ee(t))throw new Error("Error trying to diff '"+I(t)+"'. Only arrays and iterables are allowed");return this.check(t)?this:null},t.prototype.onDestroy=function(){},t.prototype.check=function(t){var e=this;this._reset();var n,r,i,o=this._itHead,s=!1;if(Array.isArray(t)){this.length=t.length;for(var a=0;a<this.length;a++)i=this._trackByFn(a,r=t[a]),null!==o&&T(o.trackById,i)?(s&&(o=this._verifyReinsertion(o,r,i,a)),T(o.item,r)||this._addIdentityChange(o,r)):(o=this._mismatch(o,r,i,a),s=!0),o=o._next}else n=0,function(t,e){if(Array.isArray(t))for(var n=0;n<t.length;n++)e(t[n]);else for(var r=t[S()](),i=void 0;!(i=r.next()).done;)e(i.value)}(t,function(t){i=e._trackByFn(n,t),null!==o&&T(o.trackById,i)?(s&&(o=e._verifyReinsertion(o,t,i,n)),T(o.item,t)||e._addIdentityChange(o,t)):(o=e._mismatch(o,t,i,n),s=!0),o=o._next,n++}),this.length=n;return this._truncate(o),this.collection=t,this.isDirty},Object.defineProperty(t.prototype,"isDirty",{get:function(){return null!==this._additionsHead||null!==this._movesHead||null!==this._removalsHead||null!==this._identityChangesHead},enumerable:!0,configurable:!0}),t.prototype._reset=function(){if(this.isDirty){var t=void 0,e=void 0;for(t=this._previousItHead=this._itHead;null!==t;t=t._next)t._nextPrevious=t._next;for(t=this._additionsHead;null!==t;t=t._nextAdded)t.previousIndex=t.currentIndex;for(this._additionsHead=this._additionsTail=null,t=this._movesHead;null!==t;t=e)t.previousIndex=t.currentIndex,e=t._nextMoved;this._movesHead=this._movesTail=null,this._removalsHead=this._removalsTail=null,this._identityChangesHead=this._identityChangesTail=null}},t.prototype._mismatch=function(t,e,n,r){var i;return null===t?i=this._itTail:(i=t._prev,this._remove(t)),null!==(t=null===this._linkedRecords?null:this._linkedRecords.get(n,r))?(T(t.item,e)||this._addIdentityChange(t,e),this._moveAfter(t,i,r)):null!==(t=null===this._unlinkedRecords?null:this._unlinkedRecords.get(n,null))?(T(t.item,e)||this._addIdentityChange(t,e),this._reinsertAfter(t,i,r)):t=this._addAfter(new ke(e,n),i,r),t},t.prototype._verifyReinsertion=function(t,e,n,r){var i=null===this._unlinkedRecords?null:this._unlinkedRecords.get(n,null);return null!==i?t=this._reinsertAfter(i,t._prev,r):t.currentIndex!=r&&(t.currentIndex=r,this._addToMoves(t,r)),t},t.prototype._truncate=function(t){for(;null!==t;){var e=t._next;this._addToRemovals(this._unlink(t)),t=e}null!==this._unlinkedRecords&&this._unlinkedRecords.clear(),null!==this._additionsTail&&(this._additionsTail._nextAdded=null),null!==this._movesTail&&(this._movesTail._nextMoved=null),null!==this._itTail&&(this._itTail._next=null),null!==this._removalsTail&&(this._removalsTail._nextRemoved=null),null!==this._identityChangesTail&&(this._identityChangesTail._nextIdentityChange=null)},t.prototype._reinsertAfter=function(t,e,n){null!==this._unlinkedRecords&&this._unlinkedRecords.remove(t);var r=t._prevRemoved,i=t._nextRemoved;return null===r?this._removalsHead=i:r._nextRemoved=i,null===i?this._removalsTail=r:i._prevRemoved=r,this._insertAfter(t,e,n),this._addToMoves(t,n),t},t.prototype._moveAfter=function(t,e,n){return this._unlink(t),this._insertAfter(t,e,n),this._addToMoves(t,n),t},t.prototype._addAfter=function(t,e,n){return this._insertAfter(t,e,n),this._additionsTail=null===this._additionsTail?this._additionsHead=t:this._additionsTail._nextAdded=t,t},t.prototype._insertAfter=function(t,e,n){var r=null===e?this._itHead:e._next;return t._next=r,t._prev=e,null===r?this._itTail=t:r._prev=t,null===e?this._itHead=t:e._next=t,null===this._linkedRecords&&(this._linkedRecords=new Ae),this._linkedRecords.put(t),t.currentIndex=n,t},t.prototype._remove=function(t){return this._addToRemovals(this._unlink(t))},t.prototype._unlink=function(t){null!==this._linkedRecords&&this._linkedRecords.remove(t);var e=t._prev,n=t._next;return null===e?this._itHead=n:e._next=n,null===n?this._itTail=e:n._prev=e,t},t.prototype._addToMoves=function(t,e){return t.previousIndex===e?t:(this._movesTail=null===this._movesTail?this._movesHead=t:this._movesTail._nextMoved=t,t)},t.prototype._addToRemovals=function(t){return null===this._unlinkedRecords&&(this._unlinkedRecords=new Ae),this._unlinkedRecords.put(t),t.currentIndex=null,t._nextRemoved=null,null===this._removalsTail?(this._removalsTail=this._removalsHead=t,t._prevRemoved=null):(t._prevRemoved=this._removalsTail,this._removalsTail=this._removalsTail._nextRemoved=t),t},t.prototype._addIdentityChange=function(t,e){return t.item=e,this._identityChangesTail=null===this._identityChangesTail?this._identityChangesHead=t:this._identityChangesTail._nextIdentityChange=t,t},t}(),ke=function(t,e){this.item=t,this.trackById=e,this.currentIndex=null,this.previousIndex=null,this._nextPrevious=null,this._prev=null,this._next=null,this._prevDup=null,this._nextDup=null,this._prevRemoved=null,this._nextRemoved=null,this._nextAdded=null,this._nextMoved=null,this._nextIdentityChange=null},xe=function(){function t(){this._head=null,this._tail=null}return t.prototype.add=function(t){null===this._head?(this._head=this._tail=t,t._nextDup=null,t._prevDup=null):(this._tail._nextDup=t,t._prevDup=this._tail,t._nextDup=null,this._tail=t)},t.prototype.get=function(t,e){var n;for(n=this._head;null!==n;n=n._nextDup)if((null===e||e<=n.currentIndex)&&T(n.trackById,t))return n;return null},t.prototype.remove=function(t){var e=t._prevDup,n=t._nextDup;return null===e?this._head=n:e._nextDup=n,null===n?this._tail=e:n._prevDup=e,null===this._head},t}(),Ae=function(){function t(){this.map=new Map}return t.prototype.put=function(t){var e=t.trackById,n=this.map.get(e);n||(n=new xe,this.map.set(e,n)),n.add(t)},t.prototype.get=function(t,e){var n=this.map.get(t);return n?n.get(t,e):null},t.prototype.remove=function(t){var e=t.trackById;return this.map.get(e).remove(t)&&this.map.delete(e),t},Object.defineProperty(t.prototype,"isEmpty",{get:function(){return 0===this.map.size},enumerable:!0,configurable:!0}),t.prototype.clear=function(){this.map.clear()},t}();function Oe(t,e,n){var r=t.previousIndex;if(null===r)return r;var i=0;return n&&r<n.length&&(i=n[r]),r+e+i}var Pe=function(){function t(){}return t.prototype.supports=function(t){return t instanceof Map||Se(t)},t.prototype.create=function(){return new Ne},t}(),Ne=function(){function t(){this._records=new Map,this._mapHead=null,this._appendAfter=null,this._previousMapHead=null,this._changesHead=null,this._changesTail=null,this._additionsHead=null,this._additionsTail=null,this._removalsHead=null,this._removalsTail=null}return Object.defineProperty(t.prototype,"isDirty",{get:function(){return null!==this._additionsHead||null!==this._changesHead||null!==this._removalsHead},enumerable:!0,configurable:!0}),t.prototype.forEachItem=function(t){var e;for(e=this._mapHead;null!==e;e=e._next)t(e)},t.prototype.forEachPreviousItem=function(t){var e;for(e=this._previousMapHead;null!==e;e=e._nextPrevious)t(e)},t.prototype.forEachChangedItem=function(t){var e;for(e=this._changesHead;null!==e;e=e._nextChanged)t(e)},t.prototype.forEachAddedItem=function(t){var e;for(e=this._additionsHead;null!==e;e=e._nextAdded)t(e)},t.prototype.forEachRemovedItem=function(t){var e;for(e=this._removalsHead;null!==e;e=e._nextRemoved)t(e)},t.prototype.diff=function(t){if(t){if(!(t instanceof Map||Se(t)))throw new Error("Error trying to diff '"+I(t)+"'. Only maps and objects are allowed")}else t=new Map;return this.check(t)?this:null},t.prototype.onDestroy=function(){},t.prototype.check=function(t){var e=this;this._reset();var n=this._mapHead;if(this._appendAfter=null,this._forEach(t,function(t,r){if(n&&n.key===r)e._maybeAddToChanges(n,t),e._appendAfter=n,n=n._next;else{var i=e._getOrCreateRecordForKey(r,t);n=e._insertBeforeOrAppend(n,i)}}),n){n._prev&&(n._prev._next=null),this._removalsHead=n;for(var r=n;null!==r;r=r._nextRemoved)r===this._mapHead&&(this._mapHead=null),this._records.delete(r.key),r._nextRemoved=r._next,r.previousValue=r.currentValue,r.currentValue=null,r._prev=null,r._next=null}return this._changesTail&&(this._changesTail._nextChanged=null),this._additionsTail&&(this._additionsTail._nextAdded=null),this.isDirty},t.prototype._insertBeforeOrAppend=function(t,e){if(t){var n=t._prev;return e._next=t,e._prev=n,t._prev=e,n&&(n._next=e),t===this._mapHead&&(this._mapHead=e),this._appendAfter=t,t}return this._appendAfter?(this._appendAfter._next=e,e._prev=this._appendAfter):this._mapHead=e,this._appendAfter=e,null},t.prototype._getOrCreateRecordForKey=function(t,e){if(this._records.has(t)){var n=this._records.get(t);this._maybeAddToChanges(n,e);var r=n._prev,i=n._next;return r&&(r._next=i),i&&(i._prev=r),n._next=null,n._prev=null,n}var o=new Re(t);return this._records.set(t,o),o.currentValue=e,this._addToAdditions(o),o},t.prototype._reset=function(){if(this.isDirty){var t=void 0;for(this._previousMapHead=this._mapHead,t=this._previousMapHead;null!==t;t=t._next)t._nextPrevious=t._next;for(t=this._changesHead;null!==t;t=t._nextChanged)t.previousValue=t.currentValue;for(t=this._additionsHead;null!=t;t=t._nextAdded)t.previousValue=t.currentValue;this._changesHead=this._changesTail=null,this._additionsHead=this._additionsTail=null,this._removalsHead=null}},t.prototype._maybeAddToChanges=function(t,e){T(e,t.currentValue)||(t.previousValue=t.currentValue,t.currentValue=e,this._addToChanges(t))},t.prototype._addToAdditions=function(t){null===this._additionsHead?this._additionsHead=this._additionsTail=t:(this._additionsTail._nextAdded=t,this._additionsTail=t)},t.prototype._addToChanges=function(t){null===this._changesHead?this._changesHead=this._changesTail=t:(this._changesTail._nextChanged=t,this._changesTail=t)},t.prototype._forEach=function(t,e){t instanceof Map?t.forEach(e):Object.keys(t).forEach(function(n){return e(t[n],n)})},t}(),Re=function(t){this.key=t,this.previousValue=null,this.currentValue=null,this._nextPrevious=null,this._next=null,this._prev=null,this._nextAdded=null,this._nextRemoved=null,this._nextChanged=null},De=function(){function t(t){this.factories=t}return t.create=function(e,n){if(null!=n){var r=n.factories.slice();return new t(e=e.concat(r))}return new t(e)},t.extend=function(e){return{provide:t,useFactory:function(n){if(!n)throw new Error("Cannot extend IterableDiffers without a parent injector");return t.create(e,n)},deps:[[t,new v,new m]]}},t.prototype.find=function(t){var e,n=this.factories.find(function(e){return e.supports(t)});if(null!=n)return n;throw new Error("Cannot find a differ supporting object '"+t+"' of type '"+((e=t).name||typeof e)+"'")},t}(),Me=function(){function t(t){this.factories=t}return t.create=function(e,n){if(n){var r=n.factories.slice();e=e.concat(r)}return new t(e)},t.extend=function(e){return{provide:t,useFactory:function(n){if(!n)throw new Error("Cannot extend KeyValueDiffers without a parent injector");return t.create(e,n)},deps:[[t,new v,new m]]}},t.prototype.find=function(t){var e=this.factories.find(function(e){return e.supports(t)});if(e)return e;throw new Error("Cannot find a differ supporting object '"+t+"'")},t}(),Ve=[new Pe],Fe=new De([new Ce]),je=new Me(Ve),Le=Gt(null,"core",[{provide:at,useValue:"unknown"},{provide:Yt,deps:[N]},{provide:Ft,deps:[]},{provide:lt,deps:[]}]),Ue=new u("LocaleId");function Be(){return Fe}function qe(){return je}function He(t){return t||"en-US"}var Ke=function(t){},ze=function(){var t={NONE:0,HTML:1,STYLE:2,SCRIPT:3,URL:4,RESOURCE_URL:5};return t[t.NONE]="NONE",t[t.HTML]="HTML",t[t.STYLE]="STYLE",t[t.SCRIPT]="SCRIPT",t[t.URL]="URL",t[t.RESOURCE_URL]="RESOURCE_URL",t}(),Qe=function(){};function Ge(t,e,n){var r=t.state,i=1792&r;return i===e?(t.state=-1793&r|n,t.initIndex=-1,!0):i===n}function We(t,e,n){return(1792&t.state)===e&&t.initIndex<=n&&(t.initIndex=n+1,!0)}function Ye(t,e){return t.nodes[e]}function Je(t,e){return t.nodes[e]}function Xe(t,e){return t.nodes[e]}function Ze(t,e){return t.nodes[e]}function $e(t,e){return t.nodes[e]}var tn={setCurrentNode:void 0,createRootView:void 0,createEmbeddedView:void 0,createComponentView:void 0,createNgModuleRef:void 0,overrideProvider:void 0,overrideComponentView:void 0,clearOverrides:void 0,checkAndUpdateView:void 0,checkNoChangesView:void 0,destroyView:void 0,resolveDep:void 0,createDebugContext:void 0,handleEvent:void 0,updateDirectives:void 0,updateRenderer:void 0,dirtyParentQueries:void 0};function en(t,e,n,r){var i="ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: '"+e+"'. Current value: '"+n+"'.";return r&&(i+=" It seems like the view has been created after its parent and its children have been dirty checked. Has it been created in a change detection hook ?"),function(t,e){var n=new Error(t);return nn(n,e),n}(i,t)}function nn(t,e){t[Q]=e,t[W]=e.logError.bind(e)}function rn(t){return new Error("ViewDestroyedError: Attempt to use a destroyed view: "+t)}var on=function(){},sn=new Map;function an(t){var e=sn.get(t);return e||(e=I(t)+"_"+sn.size,sn.set(t,e)),e}function un(t,e,n,r){if(be.isWrapped(r)){r=be.unwrap(r);var i=t.def.nodes[e].bindingIndex+n,o=be.unwrap(t.oldValues[i]);t.oldValues[i]=new be(o)}return r}var ln="$$undefined",cn="$$empty";function hn(t){return{id:ln,styles:t.styles,encapsulation:t.encapsulation,data:t.data}}var fn=0;function pn(t,e,n,r){return!(!(2&t.state)&&T(t.oldValues[e.bindingIndex+n],r))}function dn(t,e,n,r){return!!pn(t,e,n,r)&&(t.oldValues[e.bindingIndex+n]=r,!0)}function yn(t,e,n,r){var i=t.oldValues[e.bindingIndex+n];if(1&t.state||!_e(i,r)){var o=e.bindings[e.bindingIndex].name;throw en(tn.createDebugContext(t,e.nodeIndex),o+": "+i,o+": "+r,0!=(1&t.state))}}function mn(t){for(var e=t;e;)2&e.def.flags&&(e.state|=8),e=e.viewContainerParent||e.parent}function gn(t,e){for(var n=t;n&&n!==e;)n.state|=64,n=n.viewContainerParent||n.parent}function vn(t,e,n,r){try{return mn(33554432&t.def.nodes[e].flags?Je(t,e).componentView:t),tn.handleEvent(t,e,n,r)}catch(e){t.root.errorHandler.handleError(e)}}function _n(t){return t.parent?Je(t.parent,t.parentNodeDef.nodeIndex):null}function bn(t){return t.parent?t.parentNodeDef.parent:null}function wn(t,e){switch(201347067&e.flags){case 1:return Je(t,e.nodeIndex).renderElement;case 2:return Ye(t,e.nodeIndex).renderText}}function En(t){return!!t.parent&&!!(32768&t.parentNodeDef.flags)}function Sn(t){return!(!t.parent||32768&t.parentNodeDef.flags)}function Cn(t){return 1<<t%32}function Tn(t){var e={},n=0,r={};return t&&t.forEach(function(t){var i=t[0],o=t[1];"number"==typeof i?(e[i]=o,n|=Cn(i)):r[i]=o}),{matchedQueries:e,references:r,matchedQueryIds:n}}function In(t,e){return t.map(function(t){var n,r;return Array.isArray(t)?(r=t[0],n=t[1]):(r=0,n=t),n&&("function"==typeof n||"object"==typeof n)&&e&&Object.defineProperty(n,A,{value:e,configurable:!0}),{flags:r,token:n,tokenKey:an(n)}})}function kn(t,e,n){var r=n.renderParent;return r?0==(1&r.flags)||0==(33554432&r.flags)||r.element.componentRendererType&&r.element.componentRendererType.encapsulation===f.Native?Je(t,n.renderParent.nodeIndex).renderElement:void 0:e}var xn=new WeakMap;function An(t){var e=xn.get(t);return e||((e=t(function(){return on})).factory=t,xn.set(t,e)),e}function On(t,e,n,r,i){3===e&&(n=t.renderer.parentNode(wn(t,t.def.lastRenderRootNode))),Pn(t,e,0,t.def.nodes.length-1,n,r,i)}function Pn(t,e,n,r,i,o,s){for(var a=n;a<=r;a++){var u=t.def.nodes[a];11&u.flags&&Rn(t,u,e,i,o,s),a+=u.childCount}}function Nn(t,e,n,r,i,o){for(var s=t;s&&!En(s);)s=s.parent;for(var a=s.parent,u=bn(s),l=u.nodeIndex+u.childCount,c=u.nodeIndex+1;c<=l;c++){var h=a.def.nodes[c];h.ngContentIndex===e&&Rn(a,h,n,r,i,o),c+=h.childCount}if(!a.parent){var f=t.root.projectableNodes[e];if(f)for(c=0;c<f.length;c++)Dn(t,f[c],n,r,i,o)}}function Rn(t,e,n,r,i,o){if(8&e.flags)Nn(t,e.ngContent.index,n,r,i,o);else{var s=wn(t,e);if(3===n&&33554432&e.flags&&48&e.bindingFlags?(16&e.bindingFlags&&Dn(t,s,n,r,i,o),32&e.bindingFlags&&Dn(Je(t,e.nodeIndex).componentView,s,n,r,i,o)):Dn(t,s,n,r,i,o),16777216&e.flags)for(var a=Je(t,e.nodeIndex).viewContainer._embeddedViews,u=0;u<a.length;u++)On(a[u],n,r,i,o);1&e.flags&&!e.element.name&&Pn(t,n,e.nodeIndex+1,e.nodeIndex+e.childCount,r,i,o)}}function Dn(t,e,n,r,i,o){var s=t.renderer;switch(n){case 1:s.appendChild(r,e);break;case 2:s.insertBefore(r,e,i);break;case 3:s.removeChild(r,e);break;case 0:o.push(e)}}var Mn=/^:([^:]+):(.+)$/;function Vn(t){if(":"===t[0]){var e=t.match(Mn);return[e[1],e[2]]}return["",t]}function Fn(t){for(var e=0,n=0;n<t.length;n++)e|=t[n].flags;return e}function jn(t,e,n,r,i,o,s,a,u,l,c,h,f,p,d,y,m,g,v,_){switch(t){case 1:return e+Ln(n)+r;case 2:return e+Ln(n)+r+Ln(i)+o;case 3:return e+Ln(n)+r+Ln(i)+o+Ln(s)+a;case 4:return e+Ln(n)+r+Ln(i)+o+Ln(s)+a+Ln(u)+l;case 5:return e+Ln(n)+r+Ln(i)+o+Ln(s)+a+Ln(u)+l+Ln(c)+h;case 6:return e+Ln(n)+r+Ln(i)+o+Ln(s)+a+Ln(u)+l+Ln(c)+h+Ln(f)+p;case 7:return e+Ln(n)+r+Ln(i)+o+Ln(s)+a+Ln(u)+l+Ln(c)+h+Ln(f)+p+Ln(d)+y;case 8:return e+Ln(n)+r+Ln(i)+o+Ln(s)+a+Ln(u)+l+Ln(c)+h+Ln(f)+p+Ln(d)+y+Ln(m)+g;case 9:return e+Ln(n)+r+Ln(i)+o+Ln(s)+a+Ln(u)+l+Ln(c)+h+Ln(f)+p+Ln(d)+y+Ln(m)+g+Ln(v)+_;default:throw new Error("Does not support more than 9 expressions")}}function Ln(t){return null!=t?t.toString():""}function Un(t,e,n,r,i,o){t|=1;var s=Tn(e);return{nodeIndex:-1,parent:null,renderParent:null,bindingIndex:-1,outputIndex:-1,flags:t,checkIndex:-1,childFlags:0,directChildFlags:0,childMatchedQueries:0,matchedQueries:s.matchedQueries,matchedQueryIds:s.matchedQueryIds,references:s.references,ngContentIndex:n,childCount:r,bindings:[],bindingFlags:0,outputs:[],element:{ns:null,name:null,attrs:null,template:o?An(o):null,componentProvider:null,componentView:null,componentRendererType:null,publicProviders:null,allProviders:null,handleEvent:i||on},provider:null,text:null,query:null,ngContent:null}}function Bn(t,e,n,r,i,o,s,a,u,l,c,h){void 0===s&&(s=[]),l||(l=on);var p=Tn(n),d=p.matchedQueries,y=p.references,m=p.matchedQueryIds,g=null,v=null;o&&(g=(P=Vn(o))[0],v=P[1]),a=a||[];for(var _=new Array(a.length),b=0;b<a.length;b++){var w=a[b],E=w[0],S=w[2],C=Vn(w[1]),T=C[0],I=C[1],k=void 0,x=void 0;switch(15&E){case 4:x=S;break;case 1:case 8:k=S}_[b]={flags:E,ns:T,name:I,nonMinifiedName:I,securityContext:k,suffix:x}}u=u||[];var A=new Array(u.length);for(b=0;b<u.length;b++){var O=u[b];A[b]={type:0,target:O[0],eventName:O[1],propName:null}}var P,N=(s=s||[]).map(function(t){var e=t[1],n=Vn(t[0]);return[n[0],n[1],e]});return h=function(t){if(t&&t.id===ln){var e=null!=t.encapsulation&&t.encapsulation!==f.None||t.styles.length||Object.keys(t.data).length;t.id=e?"c"+fn++:cn}return t&&t.id===cn&&(t=null),t||null}(h),c&&(e|=33554432),{nodeIndex:-1,parent:null,renderParent:null,bindingIndex:-1,outputIndex:-1,checkIndex:t,flags:e|=1,childFlags:0,directChildFlags:0,childMatchedQueries:0,matchedQueries:d,matchedQueryIds:m,references:y,ngContentIndex:r,childCount:i,bindings:_,bindingFlags:Fn(_),outputs:A,element:{ns:g,name:v,attrs:N,template:null,componentProvider:null,componentView:c||null,componentRendererType:h,publicProviders:null,allProviders:null,handleEvent:l||on},provider:null,text:null,query:null,ngContent:null}}function qn(t,e,n){var r,i=n.element,o=t.root.selectorOrNode,s=t.renderer;if(t.parent||!o){r=i.name?s.createElement(i.name,i.ns):s.createComment("");var a=kn(t,e,n);a&&s.appendChild(a,r)}else r=s.selectRootElement(o);if(i.attrs)for(var u=0;u<i.attrs.length;u++){var l=i.attrs[u];s.setAttribute(r,l[1],l[2],l[0])}return r}function Hn(t,e,n,r){for(var i=0;i<n.outputs.length;i++){var o=n.outputs[i],s=Kn(t,n.nodeIndex,(h=o.eventName,(c=o.target)?c+":"+h:h)),a=o.target,u=t;"component"===o.target&&(a=null,u=e);var l=u.renderer.listen(a||r,o.eventName,s);t.disposables[n.outputIndex+i]=l}var c,h}function Kn(t,e,n){return function(r){return vn(t,e,n,r)}}function zn(t,e,n,r){if(!dn(t,e,n,r))return!1;var i=e.bindings[n],o=Je(t,e.nodeIndex),s=o.renderElement,a=i.name;switch(15&i.flags){case 1:!function(t,e,n,r,i,o){var s=e.securityContext,a=s?t.root.sanitizer.sanitize(s,o):o;a=null!=a?a.toString():null;var u=t.renderer;null!=o?u.setAttribute(n,i,a,r):u.removeAttribute(n,i,r)}(t,i,s,i.ns,a,r);break;case 2:!function(t,e,n,r){var i=t.renderer;r?i.addClass(e,n):i.removeClass(e,n)}(t,s,a,r);break;case 4:!function(t,e,n,r,i){var o=t.root.sanitizer.sanitize(ze.STYLE,i);if(null!=o){o=o.toString();var s=e.suffix;null!=s&&(o+=s)}else o=null;var a=t.renderer;null!=o?a.setStyle(n,r,o):a.removeStyle(n,r)}(t,i,s,a,r);break;case 8:!function(t,e,n,r,i){var o=e.securityContext,s=o?t.root.sanitizer.sanitize(o,i):i;t.renderer.setProperty(n,r,s)}(33554432&e.flags&&32&i.flags?o.componentView:t,i,s,a,r)}return!0}var Qn=new Object,Gn=an(N),Wn=an(Et);function Yn(t,e,n,r){return n=x(n),{index:-1,deps:In(r,I(e)),flags:t,token:e,value:n}}function Jn(t){for(var e={},n=0;n<t.length;n++){var r=t[n];r.index=n,e[an(r.token)]=r}return{factory:null,providersByKey:e,providers:t}}function Xn(t,e,n){if(void 0===n&&(n=N.THROW_IF_NOT_FOUND),8&e.flags)return e.token;if(2&e.flags&&(n=null),1&e.flags)return t._parent.get(e.token,n);var r=e.tokenKey;switch(r){case Gn:case Wn:return t}var i=t._def.providersByKey[r];if(i){var o=t._providers[i.index];return void 0===o&&(o=t._providers[i.index]=Zn(t,i)),o===Qn?void 0:o}return t._parent.get(e.token,n)}function Zn(t,e){var n;switch(201347067&e.flags){case 512:n=function(t,e,n){var r=n.length;switch(r){case 0:return new e;case 1:return new e(Xn(t,n[0]));case 2:return new e(Xn(t,n[0]),Xn(t,n[1]));case 3:return new e(Xn(t,n[0]),Xn(t,n[1]),Xn(t,n[2]));default:for(var i=new Array(r),o=0;o<r;o++)i[o]=Xn(t,n[o]);return new(e.bind.apply(e,[void 0].concat(i)))}}(t,e.value,e.deps);break;case 1024:n=function(t,e,n){var r=n.length;switch(r){case 0:return e();case 1:return e(Xn(t,n[0]));case 2:return e(Xn(t,n[0]),Xn(t,n[1]));case 3:return e(Xn(t,n[0]),Xn(t,n[1]),Xn(t,n[2]));default:for(var i=Array(r),o=0;o<r;o++)i[o]=Xn(t,n[o]);return e.apply(void 0,i)}}(t,e.value,e.deps);break;case 2048:n=Xn(t,e.deps[0]);break;case 256:n=e.value}return void 0===n?Qn:n}function $n(t,e){var n=t.viewContainer._embeddedViews;if((null==e||e>=n.length)&&(e=n.length-1),e<0)return null;var r=n[e];return r.viewContainerParent=null,rr(n,e),tn.dirtyParentQueries(r),er(r),r}function tr(t,e,n){var r=e?wn(e,e.def.lastRenderRootNode):t.renderElement;On(n,2,n.renderer.parentNode(r),n.renderer.nextSibling(r),void 0)}function er(t){On(t,3,null,null,void 0)}function nr(t,e,n){e>=t.length?t.push(n):t.splice(e,0,n)}function rr(t,e){e>=t.length-1?t.pop():t.splice(e,1)}var ir=new Object;function or(t,e,n,r,i,o){return new sr(t,e,n,r,i,o)}var sr=function(t){function e(e,n,r,i,o,s){var a=t.call(this)||this;return a.selector=e,a.componentType=n,a._inputs=i,a._outputs=o,a.ngContentSelectors=s,a.viewDefFactory=r,a}return Object(r.__extends)(e,t),Object.defineProperty(e.prototype,"inputs",{get:function(){var t=[],e=this._inputs;for(var n in e)t.push({propName:n,templateName:e[n]});return t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"outputs",{get:function(){var t=[];for(var e in this._outputs)t.push({propName:e,templateName:this._outputs[e]});return t},enumerable:!0,configurable:!0}),e.prototype.create=function(t,e,n,r){if(!r)throw new Error("ngModule should be provided");var i=An(this.viewDefFactory),o=i.nodes[0].element.componentProvider.nodeIndex,s=tn.createRootView(t,e||[],n,i,r,ir),a=Xe(s,o).instance;return n&&s.renderer.setAttribute(Je(s,0).renderElement,"ng-version",d.full),new ar(s,new hr(s),a)},e}(pt),ar=function(t){function e(e,n,r){var i=t.call(this)||this;return i._view=e,i._viewRef=n,i._component=r,i._elDef=i._view.def.nodes[0],i.hostView=n,i.changeDetectorRef=n,i.instance=r,i}return Object(r.__extends)(e,t),Object.defineProperty(e.prototype,"location",{get:function(){return new ne(Je(this._view,this._elDef.nodeIndex).renderElement)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"injector",{get:function(){return new yr(this._view,this._elDef)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"componentType",{get:function(){return this._component.constructor},enumerable:!0,configurable:!0}),e.prototype.destroy=function(){this._viewRef.destroy()},e.prototype.onDestroy=function(t){this._viewRef.onDestroy(t)},e}(function(){});function ur(t,e,n){return new lr(t,e,n)}var lr=function(){function t(t,e,n){this._view=t,this._elDef=e,this._data=n,this._embeddedViews=[]}return Object.defineProperty(t.prototype,"element",{get:function(){return new ne(this._data.renderElement)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"injector",{get:function(){return new yr(this._view,this._elDef)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"parentInjector",{get:function(){for(var t=this._view,e=this._elDef.parent;!e&&t;)e=bn(t),t=t.parent;return t?new yr(t,e):new yr(this._view,null)},enumerable:!0,configurable:!0}),t.prototype.clear=function(){for(var t=this._embeddedViews.length-1;t>=0;t--){var e=$n(this._data,t);tn.destroyView(e)}},t.prototype.get=function(t){var e=this._embeddedViews[t];if(e){var n=new hr(e);return n.attachToViewContainerRef(this),n}return null},Object.defineProperty(t.prototype,"length",{get:function(){return this._embeddedViews.length},enumerable:!0,configurable:!0}),t.prototype.createEmbeddedView=function(t,e,n){var r=t.createEmbeddedView(e||{});return this.insert(r,n),r},t.prototype.createComponent=function(t,e,n,r,i){var o=n||this.parentInjector;i||t instanceof wt||(i=o.get(Et));var s=t.create(o,r,void 0,i);return this.insert(s.hostView,e),s},t.prototype.insert=function(t,e){if(t.destroyed)throw new Error("Cannot insert a destroyed View in a ViewContainer!");var n,r,i,o,s=t;return i=s._view,o=(n=this._data).viewContainer._embeddedViews,null!==(r=e)&&void 0!==r||(r=o.length),i.viewContainerParent=this._view,nr(o,r,i),function(t,e){var n=_n(e);if(n&&n!==t&&!(16&e.state)){e.state|=16;var r=n.template._projectedViews;r||(r=n.template._projectedViews=[]),r.push(e),function(t,n){if(!(4&n.flags)){e.parent.def.nodeFlags|=4,n.flags|=4;for(var r=n.parent;r;)r.childFlags|=4,r=r.parent}}(0,e.parentNodeDef)}}(n,i),tn.dirtyParentQueries(i),tr(n,r>0?o[r-1]:null,i),s.attachToViewContainerRef(this),t},t.prototype.move=function(t,e){if(t.destroyed)throw new Error("Cannot move a destroyed View in a ViewContainer!");var n,r,i,o,s,a=this._embeddedViews.indexOf(t._view);return i=e,s=(o=(n=this._data).viewContainer._embeddedViews)[r=a],rr(o,r),null==i&&(i=o.length),nr(o,i,s),tn.dirtyParentQueries(s),er(s),tr(n,i>0?o[i-1]:null,s),t},t.prototype.indexOf=function(t){return this._embeddedViews.indexOf(t._view)},t.prototype.remove=function(t){var e=$n(this._data,t);e&&tn.destroyView(e)},t.prototype.detach=function(t){var e=$n(this._data,t);return e?new hr(e):null},t}();function cr(t){return new hr(t)}var hr=function(){function t(t){this._view=t,this._viewContainerRef=null,this._appRef=null}return Object.defineProperty(t.prototype,"rootNodes",{get:function(){return On(this._view,0,void 0,void 0,t=[]),t;var t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"context",{get:function(){return this._view.context},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"destroyed",{get:function(){return 0!=(128&this._view.state)},enumerable:!0,configurable:!0}),t.prototype.markForCheck=function(){mn(this._view)},t.prototype.detach=function(){this._view.state&=-5},t.prototype.detectChanges=function(){var t=this._view.root.rendererFactory;t.begin&&t.begin();try{tn.checkAndUpdateView(this._view)}finally{t.end&&t.end()}},t.prototype.checkNoChanges=function(){tn.checkNoChangesView(this._view)},t.prototype.reattach=function(){this._view.state|=4},t.prototype.onDestroy=function(t){this._view.disposables||(this._view.disposables=[]),this._view.disposables.push(t)},t.prototype.destroy=function(){this._appRef?this._appRef.detachView(this):this._viewContainerRef&&this._viewContainerRef.detach(this._viewContainerRef.indexOf(this)),tn.destroyView(this._view)},t.prototype.detachFromAppRef=function(){this._appRef=null,er(this._view),tn.dirtyParentQueries(this._view)},t.prototype.attachToAppRef=function(t){if(this._viewContainerRef)throw new Error("This view is already attached to a ViewContainer!");this._appRef=t},t.prototype.attachToViewContainerRef=function(t){if(this._appRef)throw new Error("This view is already attached directly to the ApplicationRef!");this._viewContainerRef=t},t}();function fr(t,e){return new pr(t,e)}var pr=function(t){function e(e,n){var r=t.call(this)||this;return r._parentView=e,r._def=n,r}return Object(r.__extends)(e,t),e.prototype.createEmbeddedView=function(t){return new hr(tn.createEmbeddedView(this._parentView,this._def,this._def.element.template,t))},Object.defineProperty(e.prototype,"elementRef",{get:function(){return new ne(Je(this._parentView,this._def.nodeIndex).renderElement)},enumerable:!0,configurable:!0}),e}(le);function dr(t,e){return new yr(t,e)}var yr=function(){function t(t,e){this.view=t,this.elDef=e}return t.prototype.get=function(t,e){return void 0===e&&(e=N.THROW_IF_NOT_FOUND),tn.resolveDep(this.view,this.elDef,!!this.elDef&&0!=(33554432&this.elDef.flags),{flags:0,token:t,tokenKey:an(t)},e)},t}();function mr(t,e){var n=t.def.nodes[e];if(1&n.flags){var r=Je(t,n.nodeIndex);return n.element.template?r.template:r.renderElement}if(2&n.flags)return Ye(t,n.nodeIndex).renderText;if(20240&n.flags)return Xe(t,n.nodeIndex).instance;throw new Error("Illegal state: read nodeValue for node index "+e)}function gr(t){return new vr(t.renderer)}var vr=function(){function t(t){this.delegate=t}return t.prototype.selectRootElement=function(t){return this.delegate.selectRootElement(t)},t.prototype.createElement=function(t,e){var n=Vn(e),r=this.delegate.createElement(n[1],n[0]);return t&&this.delegate.appendChild(t,r),r},t.prototype.createViewRoot=function(t){return t},t.prototype.createTemplateAnchor=function(t){var e=this.delegate.createComment("");return t&&this.delegate.appendChild(t,e),e},t.prototype.createText=function(t,e){var n=this.delegate.createText(e);return t&&this.delegate.appendChild(t,n),n},t.prototype.projectNodes=function(t,e){for(var n=0;n<e.length;n++)this.delegate.appendChild(t,e[n])},t.prototype.attachViewAfter=function(t,e){for(var n=this.delegate.parentNode(t),r=this.delegate.nextSibling(t),i=0;i<e.length;i++)this.delegate.insertBefore(n,e[i],r)},t.prototype.detachView=function(t){for(var e=0;e<t.length;e++){var n=t[e],r=this.delegate.parentNode(n);this.delegate.removeChild(r,n)}},t.prototype.destroyView=function(t,e){for(var n=0;n<e.length;n++)this.delegate.destroyNode(e[n])},t.prototype.listen=function(t,e,n){return this.delegate.listen(t,e,n)},t.prototype.listenGlobal=function(t,e,n){return this.delegate.listen(t,e,n)},t.prototype.setElementProperty=function(t,e,n){this.delegate.setProperty(t,e,n)},t.prototype.setElementAttribute=function(t,e,n){var r=Vn(e),i=r[0],o=r[1];null!=n?this.delegate.setAttribute(t,o,n,i):this.delegate.removeAttribute(t,o,i)},t.prototype.setBindingDebugInfo=function(t,e,n){},t.prototype.setElementClass=function(t,e,n){n?this.delegate.addClass(t,e):this.delegate.removeClass(t,e)},t.prototype.setElementStyle=function(t,e,n){null!=n?this.delegate.setStyle(t,e,n):this.delegate.removeStyle(t,e)},t.prototype.invokeElementMethod=function(t,e,n){t[e].apply(t,n)},t.prototype.setText=function(t,e){this.delegate.setValue(t,e)},t.prototype.animate=function(){throw new Error("Renderer.animate is no longer supported!")},t}();function _r(t,e,n,r){return new br(t,e,n,r)}var br=function(){function t(t,e,n,r){this._moduleType=t,this._parent=e,this._bootstrapComponents=n,this._def=r,this._destroyListeners=[],this._destroyed=!1,this.injector=this,function(t){for(var e=t._def,n=t._providers=new Array(e.providers.length),r=0;r<e.providers.length;r++){var i=e.providers[r];4096&i.flags||(n[r]=Zn(t,i))}}(this)}return t.prototype.get=function(t,e){return void 0===e&&(e=N.THROW_IF_NOT_FOUND),Xn(this,{token:t,tokenKey:an(t),flags:0},e)},Object.defineProperty(t.prototype,"instance",{get:function(){return this.get(this._moduleType)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"componentFactoryResolver",{get:function(){return this.get(_t)},enumerable:!0,configurable:!0}),t.prototype.destroy=function(){if(this._destroyed)throw new Error("The ng module "+I(this.instance.constructor)+" has already been destroyed.");this._destroyed=!0,function(t,e){for(var n=t._def,r=0;r<n.providers.length;r++)if(131072&n.providers[r].flags){var i=t._providers[r];i&&i!==Qn&&i.ngOnDestroy()}}(this),this._destroyListeners.forEach(function(t){return t()})},t.prototype.onDestroy=function(t){this._destroyListeners.push(t)},t}(),wr=an(function(){}),Er=an(ee),Sr=an(ne),Cr=an(ce),Tr=an(le),Ir=an(he),kr=an(N);function xr(t,e,n,r,i,o,s,a){var u=[];if(s)for(var l in s){var c=s[l];u[c[0]]={flags:8,name:l,nonMinifiedName:c[1],ns:null,securityContext:null,suffix:null}}var h=[];if(a)for(var f in a)h.push({type:1,propName:f,target:null,eventName:a[f]});return Pr(t,e|=16384,n,r,i,i,o,u,h)}function Ar(t,e,n){return Pr(-1,t|=16,null,0,e,e,n)}function Or(t,e,n,r,i){return Pr(-1,t,e,0,n,r,i)}function Pr(t,e,n,r,i,o,s,a,u){var l=Tn(n),c=l.matchedQueries,h=l.references,f=l.matchedQueryIds;u||(u=[]),a||(a=[]),o=x(o);var p=In(s,I(i));return{nodeIndex:-1,parent:null,renderParent:null,bindingIndex:-1,outputIndex:-1,checkIndex:t,flags:e,childFlags:0,directChildFlags:0,childMatchedQueries:0,matchedQueries:c,matchedQueryIds:f,references:h,ngContentIndex:-1,childCount:r,bindings:a,bindingFlags:Fn(a),outputs:u,element:null,provider:{token:i,value:o,deps:p},text:null,query:null,ngContent:null}}function Nr(t,e){return Vr(t,e)}function Rr(t,e){for(var n=t;n.parent&&!En(n);)n=n.parent;return Fr(n.parent,bn(n),!0,e.provider.value,e.provider.deps)}function Dr(t,e){var n=Fr(t,e.parent,(32768&e.flags)>0,e.provider.value,e.provider.deps);if(e.outputs.length)for(var r=0;r<e.outputs.length;r++){var i=e.outputs[r],o=n[i.propName].subscribe(Mr(t,e.parent.nodeIndex,i.eventName));t.disposables[e.outputIndex+r]=o.unsubscribe.bind(o)}return n}function Mr(t,e,n){return function(r){return vn(t,e,n,r)}}function Vr(t,e){var n=(8192&e.flags)>0,r=e.provider;switch(201347067&e.flags){case 512:return Fr(t,e.parent,n,r.value,r.deps);case 1024:return function(t,e,n,r,i){var o=i.length;switch(o){case 0:return r();case 1:return r(Lr(t,e,n,i[0]));case 2:return r(Lr(t,e,n,i[0]),Lr(t,e,n,i[1]));case 3:return r(Lr(t,e,n,i[0]),Lr(t,e,n,i[1]),Lr(t,e,n,i[2]));default:for(var s=Array(o),a=0;a<o;a++)s[a]=Lr(t,e,n,i[a]);return r.apply(void 0,s)}}(t,e.parent,n,r.value,r.deps);case 2048:return Lr(t,e.parent,n,r.deps[0]);case 256:return r.value}}function Fr(t,e,n,r,i){var o=i.length;switch(o){case 0:return new r;case 1:return new r(Lr(t,e,n,i[0]));case 2:return new r(Lr(t,e,n,i[0]),Lr(t,e,n,i[1]));case 3:return new r(Lr(t,e,n,i[0]),Lr(t,e,n,i[1]),Lr(t,e,n,i[2]));default:for(var s=new Array(o),a=0;a<o;a++)s[a]=Lr(t,e,n,i[a]);return new(r.bind.apply(r,[void 0].concat(s)))}}var jr={};function Lr(t,e,n,r,i){if(void 0===i&&(i=N.THROW_IF_NOT_FOUND),8&r.flags)return r.token;var o=t;2&r.flags&&(i=null);var s=r.tokenKey;for(s===Ir&&(n=!(!e||!e.element.componentView)),e&&1&r.flags&&(n=!1,e=e.parent);t;){if(e)switch(s){case wr:return gr(Ur(t,e,n));case Er:return Ur(t,e,n).renderer;case Sr:return new ne(Je(t,e.nodeIndex).renderElement);case Cr:return Je(t,e.nodeIndex).viewContainer;case Tr:if(e.element.template)return Je(t,e.nodeIndex).template;break;case Ir:return cr(Ur(t,e,n));case kr:return dr(t,e);default:var a=(n?e.element.allProviders:e.element.publicProviders)[s];if(a){var u=Xe(t,a.nodeIndex);return u||(u={instance:Vr(t,a)},t.nodes[a.nodeIndex]=u),u.instance}}n=En(t),e=bn(t),t=t.parent}var l=o.root.injector.get(r.token,jr);return l!==jr||i===jr?l:o.root.ngModule.injector.get(r.token,i)}function Ur(t,e,n){var r;if(n)r=Je(t,e.nodeIndex).componentView;else for(r=t;r.parent&&!En(r);)r=r.parent;return r}function Br(t,e,n,r,i,o){if(32768&n.flags){var s=Je(t,n.parent.nodeIndex).componentView;2&s.def.flags&&(s.state|=8)}if(e.instance[n.bindings[r].name]=i,524288&n.flags){o=o||{};var a=be.unwrap(t.oldValues[n.bindingIndex+r]);o[n.bindings[r].nonMinifiedName]=new we(a,i,0!=(2&t.state))}return t.oldValues[n.bindingIndex+r]=i,o}function qr(t,e){if(t.def.nodeFlags&e)for(var n=t.def.nodes,r=0,i=0;i<n.length;i++){var o=n[i],s=o.parent;for(!s&&o.flags&e&&Kr(t,i,o.flags&e,r++),0==(o.childFlags&e)&&(i+=o.childCount);s&&1&s.flags&&i===s.nodeIndex+s.childCount;)s.directChildFlags&e&&(r=Hr(t,s,e,r)),s=s.parent}}function Hr(t,e,n,r){for(var i=e.nodeIndex+1;i<=e.nodeIndex+e.childCount;i++){var o=t.def.nodes[i];o.flags&n&&Kr(t,i,o.flags&n,r++),i+=o.childCount}return r}function Kr(t,e,n,r){var i=Xe(t,e);if(i){var o=i.instance;o&&(tn.setCurrentNode(t,e),1048576&n&&We(t,512,r)&&o.ngAfterContentInit(),2097152&n&&o.ngAfterContentChecked(),4194304&n&&We(t,768,r)&&o.ngAfterViewInit(),8388608&n&&o.ngAfterViewChecked(),131072&n&&o.ngOnDestroy())}}function zr(t,e,n){var r=[];for(var i in n)r.push({propName:i,bindingType:n[i]});return{nodeIndex:-1,parent:null,renderParent:null,bindingIndex:-1,outputIndex:-1,checkIndex:-1,flags:t,childFlags:0,directChildFlags:0,childMatchedQueries:0,ngContentIndex:-1,matchedQueries:{},matchedQueryIds:0,references:{},childCount:0,bindings:[],bindingFlags:0,outputs:[],element:null,provider:null,text:null,query:{id:e,filterId:Cn(e),bindings:r},ngContent:null}}function Qr(t){for(var e=t.def.nodeMatchedQueries;t.parent&&Sn(t);){var n=t.parentNodeDef;t=t.parent;for(var r=n.nodeIndex+n.childCount,i=0;i<=r;i++)67108864&(o=t.def.nodes[i]).flags&&536870912&o.flags&&(o.query.filterId&e)===o.query.filterId&&$e(t,i).setDirty(),!(1&o.flags&&i+o.childCount<n.nodeIndex)&&67108864&o.childFlags&&536870912&o.childFlags||(i+=o.childCount)}if(134217728&t.def.nodeFlags)for(i=0;i<t.def.nodes.length;i++){var o;134217728&(o=t.def.nodes[i]).flags&&536870912&o.flags&&$e(t,i).setDirty(),i+=o.childCount}}function Gr(t,e){var n=$e(t,e.nodeIndex);if(n.dirty){var r,i=void 0;if(67108864&e.flags){var o=e.parent.parent;i=Wr(t,o.nodeIndex,o.nodeIndex+o.childCount,e.query,[]),r=Xe(t,e.parent.nodeIndex).instance}else 134217728&e.flags&&(i=Wr(t,0,t.def.nodes.length-1,e.query,[]),r=t.component);n.reset(i);for(var s=e.query.bindings,a=!1,u=0;u<s.length;u++){var l=s[u],c=void 0;switch(l.bindingType){case 0:c=n.first;break;case 1:c=n,a=!0}r[l.propName]=c}a&&n.notifyOnChanges()}}function Wr(t,e,n,r,i){for(var o=e;o<=n;o++){var s=t.def.nodes[o],a=s.matchedQueries[r.id];if(null!=a&&i.push(Yr(t,s,a)),1&s.flags&&s.element.template&&(s.element.template.nodeMatchedQueries&r.filterId)===r.filterId){var u=Je(t,o);if((s.childMatchedQueries&r.filterId)===r.filterId&&(Wr(t,o+1,o+s.childCount,r,i),o+=s.childCount),16777216&s.flags)for(var l=u.viewContainer._embeddedViews,c=0;c<l.length;c++){var h=l[c],f=_n(h);f&&f===u&&Wr(h,0,h.def.nodes.length-1,r,i)}var p=u.template._projectedViews;if(p)for(c=0;c<p.length;c++){var d=p[c];Wr(d,0,d.def.nodes.length-1,r,i)}}(s.childMatchedQueries&r.filterId)!==r.filterId&&(o+=s.childCount)}return i}function Yr(t,e,n){if(null!=n)switch(n){case 1:return Je(t,e.nodeIndex).renderElement;case 0:return new ne(Je(t,e.nodeIndex).renderElement);case 2:return Je(t,e.nodeIndex).template;case 3:return Je(t,e.nodeIndex).viewContainer;case 4:return Xe(t,e.nodeIndex).instance}}function Jr(t,e,n){var r=kn(t,e,n);r&&Nn(t,n.ngContent.index,1,r,null,void 0)}function Xr(t,e){return $r(128,t,new Array(e+1))}function Zr(t,e){for(var n=Object.keys(e),r=n.length,i=new Array(r),o=0;o<r;o++){var s=n[o];i[e[s]]=s}return $r(64,t,i)}function $r(t,e,n){for(var r=new Array(n.length),i=0;i<n.length;i++){var o=n[i];r[i]={flags:8,name:o,ns:null,nonMinifiedName:o,securityContext:null,suffix:null}}return{nodeIndex:-1,parent:null,renderParent:null,bindingIndex:-1,outputIndex:-1,checkIndex:e,flags:t,childFlags:0,directChildFlags:0,childMatchedQueries:0,matchedQueries:{},matchedQueryIds:0,references:{},ngContentIndex:-1,childCount:0,bindings:r,bindingFlags:Fn(r),outputs:[],element:null,provider:null,text:null,query:null,ngContent:null}}function ti(t,e,n){for(var r=new Array(n.length-1),i=1;i<n.length;i++)r[i-1]={flags:8,name:null,ns:null,nonMinifiedName:null,securityContext:null,suffix:n[i]};return{nodeIndex:-1,parent:null,renderParent:null,bindingIndex:-1,outputIndex:-1,checkIndex:t,flags:2,childFlags:0,directChildFlags:0,childMatchedQueries:0,matchedQueries:{},matchedQueryIds:0,references:{},ngContentIndex:e,childCount:0,bindings:r,bindingFlags:8,outputs:[],element:null,provider:null,text:{prefix:n[0]},query:null,ngContent:null}}function ei(t,e,n){var r,i=t.renderer;r=i.createText(n.text.prefix);var o=kn(t,e,n);return o&&i.appendChild(o,r),{renderText:r}}function ni(t,e){return(null!=t?t.toString():"")+e.suffix}function ri(t,e,n,r){for(var i=0,o=0,s=0,a=0,u=0,l=null,c=null,h=!1,f=!1,p=null,d=0;d<e.length;d++){var y=e[d];if(y.nodeIndex=d,y.parent=l,y.bindingIndex=i,y.outputIndex=o,y.renderParent=c,s|=y.flags,u|=y.matchedQueryIds,y.element){var m=y.element;m.publicProviders=l?l.element.publicProviders:Object.create(null),m.allProviders=m.publicProviders,h=!1,f=!1,y.element.template&&(u|=y.element.template.nodeMatchedQueries)}if(oi(l,y,e.length),i+=y.bindings.length,o+=y.outputs.length,!c&&3&y.flags&&(p=y),20224&y.flags){h||(h=!0,l.element.publicProviders=Object.create(l.element.publicProviders),l.element.allProviders=l.element.publicProviders);var g=0!=(32768&y.flags);0==(8192&y.flags)||g?l.element.publicProviders[an(y.provider.token)]=y:(f||(f=!0,l.element.allProviders=Object.create(l.element.publicProviders)),l.element.allProviders[an(y.provider.token)]=y),g&&(l.element.componentProvider=y)}if(l?(l.childFlags|=y.flags,l.directChildFlags|=y.flags,l.childMatchedQueries|=y.matchedQueryIds,y.element&&y.element.template&&(l.childMatchedQueries|=y.element.template.nodeMatchedQueries)):a|=y.flags,y.childCount>0)l=y,ii(y)||(c=y);else for(;l&&d===l.nodeIndex+l.childCount;){var v=l.parent;v&&(v.childFlags|=l.childFlags,v.childMatchedQueries|=l.childMatchedQueries),c=(l=v)&&ii(l)?l.renderParent:l}}return{factory:null,nodeFlags:s,rootNodeFlags:a,nodeMatchedQueries:u,flags:t,nodes:e,updateDirectives:n||on,updateRenderer:r||on,handleEvent:function(t,n,r,i){return e[n].element.handleEvent(t,r,i)},bindingCount:i,outputCount:o,lastRenderRootNode:p}}function ii(t){return 0!=(1&t.flags)&&null===t.element.name}function oi(t,e,n){var r=e.element&&e.element.template;if(r){if(!r.lastRenderRootNode)throw new Error("Illegal State: Embedded templates without nodes are not allowed!");if(r.lastRenderRootNode&&16777216&r.lastRenderRootNode.flags)throw new Error("Illegal State: Last root node of a template can't have embedded views, at index "+e.nodeIndex+"!")}if(20224&e.flags&&0==(1&(t?t.flags:0)))throw new Error("Illegal State: StaticProvider/Directive nodes need to be children of elements or anchors, at index "+e.nodeIndex+"!");if(e.query){if(67108864&e.flags&&(!t||0==(16384&t.flags)))throw new Error("Illegal State: Content Query nodes need to be children of directives, at index "+e.nodeIndex+"!");if(134217728&e.flags&&t)throw new Error("Illegal State: View Query nodes have to be top level nodes, at index "+e.nodeIndex+"!")}if(e.childCount){var i=t?t.nodeIndex+t.childCount:n-1;if(e.nodeIndex<=i&&e.nodeIndex+e.childCount>i)throw new Error("Illegal State: childCount of node leads outside of parent, at index "+e.nodeIndex+"!")}}function si(t,e,n,r){var i=li(t.root,t.renderer,t,e,n);return ci(i,t.component,r),hi(i),i}function ai(t,e,n){var r=li(t,t.renderer,null,null,e);return ci(r,n,n),hi(r),r}function ui(t,e,n,r){var i,o=e.element.componentRendererType;return i=o?t.root.rendererFactory.createRenderer(r,o):t.root.renderer,li(t.root,i,t,e.element.componentProvider,n)}function li(t,e,n,r,i){var o=new Array(i.nodes.length),s=i.outputCount?new Array(i.outputCount):null;return{def:i,parent:n,viewContainerParent:null,parentNodeDef:r,context:null,component:null,nodes:o,state:13,root:t,renderer:e,oldValues:new Array(i.bindingCount),disposables:s,initIndex:-1}}function ci(t,e,n){t.component=e,t.context=n}function hi(t){var e;En(t)&&(e=Je(t.parent,t.parentNodeDef.parent.nodeIndex).renderElement);for(var n=t.def,r=t.nodes,i=0;i<n.nodes.length;i++){var o=n.nodes[i];tn.setCurrentNode(t,i);var s=void 0;switch(201347067&o.flags){case 1:var a=qn(t,e,o),u=void 0;if(33554432&o.flags){var l=An(o.element.componentView);u=tn.createComponentView(t,o,l,a)}Hn(t,u,o,a),s={renderElement:a,componentView:u,viewContainer:null,template:o.element.template?fr(t,o):void 0},16777216&o.flags&&(s.viewContainer=ur(t,o,s));break;case 2:s=ei(t,e,o);break;case 512:case 1024:case 2048:case 256:(s=r[i])||4096&o.flags||(s={instance:Nr(t,o)});break;case 16:s={instance:Rr(t,o)};break;case 16384:(s=r[i])||(s={instance:Dr(t,o)}),32768&o.flags&&ci(Je(t,o.parent.nodeIndex).componentView,s.instance,s.instance);break;case 32:case 64:case 128:s={value:void 0};break;case 67108864:case 134217728:s=new ie;break;case 8:Jr(t,e,o),s=void 0}r[i]=s}bi(t,_i.CreateViewNodes),Ci(t,201326592,268435456,0)}function fi(t){yi(t),tn.updateDirectives(t,1),wi(t,_i.CheckNoChanges),tn.updateRenderer(t,1),bi(t,_i.CheckNoChanges),t.state&=-97}function pi(t){1&t.state?(t.state&=-2,t.state|=2):t.state&=-3,Ge(t,0,256),yi(t),tn.updateDirectives(t,0),wi(t,_i.CheckAndUpdate),Ci(t,67108864,536870912,0);var e=Ge(t,256,512);qr(t,2097152|(e?1048576:0)),tn.updateRenderer(t,0),bi(t,_i.CheckAndUpdate),Ci(t,134217728,536870912,0),qr(t,8388608|((e=Ge(t,512,768))?4194304:0)),2&t.def.flags&&(t.state&=-9),t.state&=-97,Ge(t,768,1024)}function di(t,e,n,r,i,o,s,a,u,l,c,h,f){return 0===n?function(t,e,n,r,i,o,s,a,u,l,c,h){switch(201347067&e.flags){case 1:return function(t,e,n,r,i,o,s,a,u,l,c,h){var f=e.bindings.length,p=!1;return f>0&&zn(t,e,0,n)&&(p=!0),f>1&&zn(t,e,1,r)&&(p=!0),f>2&&zn(t,e,2,i)&&(p=!0),f>3&&zn(t,e,3,o)&&(p=!0),f>4&&zn(t,e,4,s)&&(p=!0),f>5&&zn(t,e,5,a)&&(p=!0),f>6&&zn(t,e,6,u)&&(p=!0),f>7&&zn(t,e,7,l)&&(p=!0),f>8&&zn(t,e,8,c)&&(p=!0),f>9&&zn(t,e,9,h)&&(p=!0),p}(t,e,n,r,i,o,s,a,u,l,c,h);case 2:return function(t,e,n,r,i,o,s,a,u,l,c,h){var f=!1,p=e.bindings,d=p.length;if(d>0&&dn(t,e,0,n)&&(f=!0),d>1&&dn(t,e,1,r)&&(f=!0),d>2&&dn(t,e,2,i)&&(f=!0),d>3&&dn(t,e,3,o)&&(f=!0),d>4&&dn(t,e,4,s)&&(f=!0),d>5&&dn(t,e,5,a)&&(f=!0),d>6&&dn(t,e,6,u)&&(f=!0),d>7&&dn(t,e,7,l)&&(f=!0),d>8&&dn(t,e,8,c)&&(f=!0),d>9&&dn(t,e,9,h)&&(f=!0),f){var y=e.text.prefix;d>0&&(y+=ni(n,p[0])),d>1&&(y+=ni(r,p[1])),d>2&&(y+=ni(i,p[2])),d>3&&(y+=ni(o,p[3])),d>4&&(y+=ni(s,p[4])),d>5&&(y+=ni(a,p[5])),d>6&&(y+=ni(u,p[6])),d>7&&(y+=ni(l,p[7])),d>8&&(y+=ni(c,p[8])),d>9&&(y+=ni(h,p[9]));var m=Ye(t,e.nodeIndex).renderText;t.renderer.setValue(m,y)}return f}(t,e,n,r,i,o,s,a,u,l,c,h);case 16384:return function(t,e,n,r,i,o,s,a,u,l,c,h){var f=Xe(t,e.nodeIndex),p=f.instance,d=!1,y=void 0,m=e.bindings.length;return m>0&&pn(t,e,0,n)&&(d=!0,y=Br(t,f,e,0,n,y)),m>1&&pn(t,e,1,r)&&(d=!0,y=Br(t,f,e,1,r,y)),m>2&&pn(t,e,2,i)&&(d=!0,y=Br(t,f,e,2,i,y)),m>3&&pn(t,e,3,o)&&(d=!0,y=Br(t,f,e,3,o,y)),m>4&&pn(t,e,4,s)&&(d=!0,y=Br(t,f,e,4,s,y)),m>5&&pn(t,e,5,a)&&(d=!0,y=Br(t,f,e,5,a,y)),m>6&&pn(t,e,6,u)&&(d=!0,y=Br(t,f,e,6,u,y)),m>7&&pn(t,e,7,l)&&(d=!0,y=Br(t,f,e,7,l,y)),m>8&&pn(t,e,8,c)&&(d=!0,y=Br(t,f,e,8,c,y)),m>9&&pn(t,e,9,h)&&(d=!0,y=Br(t,f,e,9,h,y)),y&&p.ngOnChanges(y),65536&e.flags&&We(t,256,e.nodeIndex)&&p.ngOnInit(),262144&e.flags&&p.ngDoCheck(),d}(t,e,n,r,i,o,s,a,u,l,c,h);case 32:case 64:case 128:return function(t,e,n,r,i,o,s,a,u,l,c,h){var f=e.bindings,p=!1,d=f.length;if(d>0&&dn(t,e,0,n)&&(p=!0),d>1&&dn(t,e,1,r)&&(p=!0),d>2&&dn(t,e,2,i)&&(p=!0),d>3&&dn(t,e,3,o)&&(p=!0),d>4&&dn(t,e,4,s)&&(p=!0),d>5&&dn(t,e,5,a)&&(p=!0),d>6&&dn(t,e,6,u)&&(p=!0),d>7&&dn(t,e,7,l)&&(p=!0),d>8&&dn(t,e,8,c)&&(p=!0),d>9&&dn(t,e,9,h)&&(p=!0),p){var y=Ze(t,e.nodeIndex),m=void 0;switch(201347067&e.flags){case 32:m=new Array(f.length),d>0&&(m[0]=n),d>1&&(m[1]=r),d>2&&(m[2]=i),d>3&&(m[3]=o),d>4&&(m[4]=s),d>5&&(m[5]=a),d>6&&(m[6]=u),d>7&&(m[7]=l),d>8&&(m[8]=c),d>9&&(m[9]=h);break;case 64:m={},d>0&&(m[f[0].name]=n),d>1&&(m[f[1].name]=r),d>2&&(m[f[2].name]=i),d>3&&(m[f[3].name]=o),d>4&&(m[f[4].name]=s),d>5&&(m[f[5].name]=a),d>6&&(m[f[6].name]=u),d>7&&(m[f[7].name]=l),d>8&&(m[f[8].name]=c),d>9&&(m[f[9].name]=h);break;case 128:var g=n;switch(d){case 1:m=g.transform(n);break;case 2:m=g.transform(r);break;case 3:m=g.transform(r,i);break;case 4:m=g.transform(r,i,o);break;case 5:m=g.transform(r,i,o,s);break;case 6:m=g.transform(r,i,o,s,a);break;case 7:m=g.transform(r,i,o,s,a,u);break;case 8:m=g.transform(r,i,o,s,a,u,l);break;case 9:m=g.transform(r,i,o,s,a,u,l,c);break;case 10:m=g.transform(r,i,o,s,a,u,l,c,h)}}y.value=m}return p}(t,e,n,r,i,o,s,a,u,l,c,h);default:throw"unreachable"}}(t,e,r,i,o,s,a,u,l,c,h,f):function(t,e,n){switch(201347067&e.flags){case 1:return function(t,e,n){for(var r=!1,i=0;i<n.length;i++)zn(t,e,i,n[i])&&(r=!0);return r}(t,e,n);case 2:return function(t,e,n){for(var r=e.bindings,i=!1,o=0;o<n.length;o++)dn(t,e,o,n[o])&&(i=!0);if(i){var s="";for(o=0;o<n.length;o++)s+=ni(n[o],r[o]);s=e.text.prefix+s;var a=Ye(t,e.nodeIndex).renderText;t.renderer.setValue(a,s)}return i}(t,e,n);case 16384:return function(t,e,n){for(var r=Xe(t,e.nodeIndex),i=r.instance,o=!1,s=void 0,a=0;a<n.length;a++)pn(t,e,a,n[a])&&(o=!0,s=Br(t,r,e,a,n[a],s));return s&&i.ngOnChanges(s),65536&e.flags&&We(t,256,e.nodeIndex)&&i.ngOnInit(),262144&e.flags&&i.ngDoCheck(),o}(t,e,n);case 32:case 64:case 128:return function(t,e,n){for(var r=e.bindings,i=!1,o=0;o<n.length;o++)dn(t,e,o,n[o])&&(i=!0);if(i){var s=Ze(t,e.nodeIndex),a=void 0;switch(201347067&e.flags){case 32:a=n;break;case 64:for(a={},o=0;o<n.length;o++)a[r[o].name]=n[o];break;case 128:var u=n[0],l=n.slice(1);a=u.transform.apply(u,l)}s.value=a}return i}(t,e,n);default:throw"unreachable"}}(t,e,r)}function yi(t){var e=t.def;if(4&e.nodeFlags)for(var n=0;n<e.nodes.length;n++){var r=e.nodes[n];if(4&r.flags){var i=Je(t,n).template._projectedViews;if(i)for(var o=0;o<i.length;o++){var s=i[o];s.state|=32,gn(s,t)}}else 0==(4&r.childFlags)&&(n+=r.childCount)}}function mi(t,e,n,r,i,o,s,a,u,l,c,h,f){return 0===n?function(t,e,n,r,i,o,s,a,u,l,c,h){var f=e.bindings.length;f>0&&yn(t,e,0,n),f>1&&yn(t,e,1,r),f>2&&yn(t,e,2,i),f>3&&yn(t,e,3,o),f>4&&yn(t,e,4,s),f>5&&yn(t,e,5,a),f>6&&yn(t,e,6,u),f>7&&yn(t,e,7,l),f>8&&yn(t,e,8,c),f>9&&yn(t,e,9,h)}(t,e,r,i,o,s,a,u,l,c,h,f):function(t,e,n){for(var r=0;r<n.length;r++)yn(t,e,r,n[r])}(t,e,r),!1}function gi(t,e){if($e(t,e.nodeIndex).dirty)throw en(tn.createDebugContext(t,e.nodeIndex),"Query "+e.query.id+" not dirty","Query "+e.query.id+" dirty",0!=(1&t.state))}function vi(t){if(!(128&t.state)){if(wi(t,_i.Destroy),bi(t,_i.Destroy),qr(t,131072),t.disposables)for(var e=0;e<t.disposables.length;e++)t.disposables[e]();!function(t){if(16&t.state){var e=_n(t);if(e){var n=e.template._projectedViews;n&&(rr(n,n.indexOf(t)),tn.dirtyParentQueries(t))}}}(t),t.renderer.destroyNode&&function(t){for(var e=t.def.nodes.length,n=0;n<e;n++){var r=t.def.nodes[n];1&r.flags?t.renderer.destroyNode(Je(t,n).renderElement):2&r.flags?t.renderer.destroyNode(Ye(t,n).renderText):(67108864&r.flags||134217728&r.flags)&&$e(t,n).destroy()}}(t),En(t)&&t.renderer.destroy(),t.state|=128}}var _i=function(){var t={CreateViewNodes:0,CheckNoChanges:1,CheckNoChangesProjectedViews:2,CheckAndUpdate:3,CheckAndUpdateProjectedViews:4,Destroy:5};return t[t.CreateViewNodes]="CreateViewNodes",t[t.CheckNoChanges]="CheckNoChanges",t[t.CheckNoChangesProjectedViews]="CheckNoChangesProjectedViews",t[t.CheckAndUpdate]="CheckAndUpdate",t[t.CheckAndUpdateProjectedViews]="CheckAndUpdateProjectedViews",t[t.Destroy]="Destroy",t}();function bi(t,e){var n=t.def;if(33554432&n.nodeFlags)for(var r=0;r<n.nodes.length;r++){var i=n.nodes[r];33554432&i.flags?Ei(Je(t,r).componentView,e):0==(33554432&i.childFlags)&&(r+=i.childCount)}}function wi(t,e){var n=t.def;if(16777216&n.nodeFlags)for(var r=0;r<n.nodes.length;r++){var i=n.nodes[r];if(16777216&i.flags)for(var o=Je(t,r).viewContainer._embeddedViews,s=0;s<o.length;s++)Ei(o[s],e);else 0==(16777216&i.childFlags)&&(r+=i.childCount)}}function Ei(t,e){var n=t.state;switch(e){case _i.CheckNoChanges:0==(128&n)&&(12==(12&n)?fi(t):64&n&&Si(t,_i.CheckNoChangesProjectedViews));break;case _i.CheckNoChangesProjectedViews:0==(128&n)&&(32&n?fi(t):64&n&&Si(t,e));break;case _i.CheckAndUpdate:0==(128&n)&&(12==(12&n)?pi(t):64&n&&Si(t,_i.CheckAndUpdateProjectedViews));break;case _i.CheckAndUpdateProjectedViews:0==(128&n)&&(32&n?pi(t):64&n&&Si(t,e));break;case _i.Destroy:vi(t);break;case _i.CreateViewNodes:hi(t)}}function Si(t,e){wi(t,e),bi(t,e)}function Ci(t,e,n,r){if(t.def.nodeFlags&e&&t.def.nodeFlags&n)for(var i=t.def.nodes.length,o=0;o<i;o++){var s=t.def.nodes[o];if(s.flags&e&&s.flags&n)switch(tn.setCurrentNode(t,s.nodeIndex),r){case 0:Gr(t,s);break;case 1:gi(t,s)}s.childFlags&e&&s.childFlags&n||(o+=s.childCount)}}var Ti=!1;function Ii(t,e,n,r,i,o){return ai(xi(t,i,i.injector.get($t),e,n),r,o)}function ki(t,e,n,r,i,o){var s=i.injector.get($t),a=xi(t,i,new ao(s),e,n),u=Fi(r);return oo(Qi.create,ai,null,[a,u,o])}function xi(t,e,n,r,i){var o=e.injector.get(Qe),s=e.injector.get(Z);return{ngModule:e,injector:t,projectableNodes:r,selectorOrNode:i,sanitizer:o,rendererFactory:n,renderer:n.createRenderer(null,null),errorHandler:s}}function Ai(t,e,n,r){var i=Fi(n);return oo(Qi.create,si,null,[t,e,i,r])}function Oi(t,e,n,r){return n=Ri.get(e.element.componentProvider.provider.token)||Fi(n),oo(Qi.create,ui,null,[t,e,n,r])}function Pi(t,e,n,r){return _r(t,e,n,function(t){var e=function(t){var e=!1,n=!1;return 0===Ni.size?{hasOverrides:e,hasDeprecatedOverrides:n}:(t.providers.forEach(function(t){var r=Ni.get(t.token);3840&t.flags&&r&&(e=!0,n=n||r.deprecatedBehavior)}),{hasOverrides:e,hasDeprecatedOverrides:n})}(t),n=e.hasDeprecatedOverrides;return e.hasOverrides?(function(t){for(var e=0;e<t.providers.length;e++){var r=t.providers[e];n&&(r.flags|=4096);var i=Ni.get(r.token);i&&(r.flags=-3841&r.flags|i.flags,r.deps=In(i.deps),r.value=i.value)}}(t=t.factory(function(){return on})),t):t}(r))}var Ni=new Map,Ri=new Map;function Di(t){Ni.set(t.token,t)}function Mi(t,e){var n=An(An(e.viewDefFactory).nodes[0].element.componentView);Ri.set(t,n)}function Vi(){Ni.clear(),Ri.clear()}function Fi(t){if(0===Ni.size)return t;var e=function(t){for(var e=[],n=null,r=0;r<t.nodes.length;r++){var i=t.nodes[r];1&i.flags&&(n=i),n&&3840&i.flags&&Ni.has(i.provider.token)&&(e.push(n.nodeIndex),n=null)}return e}(t);if(0===e.length)return t;t=t.factory(function(){return on});for(var n=0;n<e.length;n++)r(t,e[n]);return t;function r(t,e){for(var n=e+1;n<t.nodes.length;n++){var r=t.nodes[n];if(1&r.flags)return;if(3840&r.flags){var i=r.provider,o=Ni.get(i.token);o&&(r.flags=-3841&r.flags|o.flags,i.deps=In(o.deps),i.value=o.value)}}}}function ji(t,e,n,r,i,o,s,a,u,l,c,h,f){var p=t.def.nodes[e];return di(t,p,n,r,i,o,s,a,u,l,c,h,f),224&p.flags?Ze(t,e).value:void 0}function Li(t,e,n,r,i,o,s,a,u,l,c,h,f){var p=t.def.nodes[e];return mi(t,p,n,r,i,o,s,a,u,l,c,h,f),224&p.flags?Ze(t,e).value:void 0}function Ui(t){return oo(Qi.detectChanges,pi,null,[t])}function Bi(t){return oo(Qi.checkNoChanges,fi,null,[t])}function qi(t){return oo(Qi.destroy,vi,null,[t])}var Hi,Ki,zi,Qi=function(){var t={create:0,detectChanges:1,checkNoChanges:2,destroy:3,handleEvent:4};return t[t.create]="create",t[t.detectChanges]="detectChanges",t[t.checkNoChanges]="checkNoChanges",t[t.destroy]="destroy",t[t.handleEvent]="handleEvent",t}();function Gi(t,e){Ki=t,zi=e}function Wi(t,e,n,r){return Gi(t,e),oo(Qi.handleEvent,t.def.handleEvent,null,[t,e,n,r])}function Yi(t,e){if(128&t.state)throw rn(Qi[Hi]);return Gi(t,eo(t,0)),t.def.updateDirectives(function(t,n,r){for(var i=[],o=3;o<arguments.length;o++)i[o-3]=arguments[o];var s=t.def.nodes[n];return 0===e?Xi(t,s,r,i):Zi(t,s,r,i),16384&s.flags&&Gi(t,eo(t,n)),224&s.flags?Ze(t,s.nodeIndex).value:void 0},t)}function Ji(t,e){if(128&t.state)throw rn(Qi[Hi]);return Gi(t,no(t,0)),t.def.updateRenderer(function(t,n,r){for(var i=[],o=3;o<arguments.length;o++)i[o-3]=arguments[o];var s=t.def.nodes[n];return 0===e?Xi(t,s,r,i):Zi(t,s,r,i),3&s.flags&&Gi(t,no(t,n)),224&s.flags?Ze(t,s.nodeIndex).value:void 0},t)}function Xi(t,e,n,r){if(di.apply(void 0,[t,e,n].concat(r))){var i=1===n?r[0]:r;if(16384&e.flags){for(var o={},s=0;s<e.bindings.length;s++){var a=e.bindings[s],u=i[s];8&a.flags&&(o[(f=a.nonMinifiedName,"ng-reflect-"+(f=f.replace(/[$@]/g,"_").replace($i,function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return"-"+t[1].toLowerCase()})))]=to(u))}var l=e.parent,c=Je(t,l.nodeIndex).renderElement;if(l.element.name)for(var h in o)null!=(u=o[h])?t.renderer.setAttribute(c,h,u):t.renderer.removeAttribute(c,h);else t.renderer.setValue(c,"bindings="+JSON.stringify(o,null,2))}}var f}function Zi(t,e,n,r){mi.apply(void 0,[t,e,n].concat(r))}var $i=/([A-Z])/g;function to(t){try{return null!=t?t.toString().slice(0,30):t}catch(t){return"[ERROR] Exception while trying to serialize the value"}}function eo(t,e){for(var n=e;n<t.def.nodes.length;n++){var r=t.def.nodes[n];if(16384&r.flags&&r.bindings&&r.bindings.length)return n}return null}function no(t,e){for(var n=e;n<t.def.nodes.length;n++){var r=t.def.nodes[n];if(3&r.flags&&r.bindings&&r.bindings.length)return n}return null}var ro=function(){function t(t,e){this.view=t,this.nodeIndex=e,null==e&&(this.nodeIndex=e=0),this.nodeDef=t.def.nodes[e];for(var n=this.nodeDef,r=t;n&&0==(1&n.flags);)n=n.parent;if(!n)for(;!n&&r;)n=bn(r),r=r.parent;this.elDef=n,this.elView=r}return Object.defineProperty(t.prototype,"elOrCompView",{get:function(){return Je(this.elView,this.elDef.nodeIndex).componentView||this.view},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"injector",{get:function(){return dr(this.elView,this.elDef)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"component",{get:function(){return this.elOrCompView.component},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"context",{get:function(){return this.elOrCompView.context},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"providerTokens",{get:function(){var t=[];if(this.elDef)for(var e=this.elDef.nodeIndex+1;e<=this.elDef.nodeIndex+this.elDef.childCount;e++){var n=this.elView.def.nodes[e];20224&n.flags&&t.push(n.provider.token),e+=n.childCount}return t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"references",{get:function(){var t={};if(this.elDef){io(this.elView,this.elDef,t);for(var e=this.elDef.nodeIndex+1;e<=this.elDef.nodeIndex+this.elDef.childCount;e++){var n=this.elView.def.nodes[e];20224&n.flags&&io(this.elView,n,t),e+=n.childCount}}return t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"componentRenderElement",{get:function(){var t=function(t){for(;t&&!En(t);)t=t.parent;return t.parent?Je(t.parent,bn(t).nodeIndex):null}(this.elOrCompView);return t?t.renderElement:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"renderNode",{get:function(){return 2&this.nodeDef.flags?wn(this.view,this.nodeDef):wn(this.elView,this.elDef)},enumerable:!0,configurable:!0}),t.prototype.logError=function(t){for(var e,n,r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];2&this.nodeDef.flags?(e=this.view.def,n=this.nodeDef.nodeIndex):(e=this.elView.def,n=this.elDef.nodeIndex);var o=function(t,e){for(var n=-1,r=0;r<=e;r++)3&t.nodes[r].flags&&n++;return n}(e,n),s=-1;e.factory(function(){return++s===o?(e=t.error).bind.apply(e,[t].concat(r)):on;var e}),s<o&&(t.error("Illegal state: the ViewDefinitionFactory did not call the logger!"),t.error.apply(t,r))},t}();function io(t,e,n){for(var r in e.references)n[r]=Yr(t,e,e.references[r])}function oo(t,e,n,r){var i=Hi,o=Ki,s=zi;try{Hi=t;var a=e.apply(n,r);return Ki=o,zi=s,Hi=i,a}catch(t){if(Y(t)||!Ki)throw t;throw function(t,e){return t instanceof Error||(t=new Error(t.toString())),nn(t,e),t}(t,so())}}function so(){return Ki?new ro(Ki,zi):null}var ao=function(){function t(t){this.delegate=t}return t.prototype.createRenderer=function(t,e){return new uo(this.delegate.createRenderer(t,e))},t.prototype.begin=function(){this.delegate.begin&&this.delegate.begin()},t.prototype.end=function(){this.delegate.end&&this.delegate.end()},t.prototype.whenRenderingDone=function(){return this.delegate.whenRenderingDone?this.delegate.whenRenderingDone():Promise.resolve(null)},t}(),uo=function(){function t(t){this.delegate=t,this.data=this.delegate.data}return t.prototype.destroyNode=function(t){!function(t){me.delete(t.nativeNode)}(ge(t)),this.delegate.destroyNode&&this.delegate.destroyNode(t)},t.prototype.destroy=function(){this.delegate.destroy()},t.prototype.createElement=function(t,e){var n=this.delegate.createElement(t,e),r=so();if(r){var i=new pe(n,null,r);i.name=t,ve(i)}return n},t.prototype.createComment=function(t){var e=this.delegate.createComment(t),n=so();return n&&ve(new fe(e,null,n)),e},t.prototype.createText=function(t){var e=this.delegate.createText(t),n=so();return n&&ve(new fe(e,null,n)),e},t.prototype.appendChild=function(t,e){var n=ge(t),r=ge(e);n&&r&&n instanceof pe&&n.addChild(r),this.delegate.appendChild(t,e)},t.prototype.insertBefore=function(t,e,n){var r=ge(t),i=ge(e),o=ge(n);r&&i&&r instanceof pe&&r.insertBefore(o,i),this.delegate.insertBefore(t,e,n)},t.prototype.removeChild=function(t,e){var n=ge(t),r=ge(e);n&&r&&n instanceof pe&&n.removeChild(r),this.delegate.removeChild(t,e)},t.prototype.selectRootElement=function(t){var e=this.delegate.selectRootElement(t),n=so();return n&&ve(new pe(e,null,n)),e},t.prototype.setAttribute=function(t,e,n,r){var i=ge(t);i&&i instanceof pe&&(i.attributes[r?r+":"+e:e]=n),this.delegate.setAttribute(t,e,n,r)},t.prototype.removeAttribute=function(t,e,n){var r=ge(t);r&&r instanceof pe&&(r.attributes[n?n+":"+e:e]=null),this.delegate.removeAttribute(t,e,n)},t.prototype.addClass=function(t,e){var n=ge(t);n&&n instanceof pe&&(n.classes[e]=!0),this.delegate.addClass(t,e)},t.prototype.removeClass=function(t,e){var n=ge(t);n&&n instanceof pe&&(n.classes[e]=!1),this.delegate.removeClass(t,e)},t.prototype.setStyle=function(t,e,n,r){var i=ge(t);i&&i instanceof pe&&(i.styles[e]=n),this.delegate.setStyle(t,e,n,r)},t.prototype.removeStyle=function(t,e,n){var r=ge(t);r&&r instanceof pe&&(r.styles[e]=null),this.delegate.removeStyle(t,e,n)},t.prototype.setProperty=function(t,e,n){var r=ge(t);r&&r instanceof pe&&(r.properties[e]=n),this.delegate.setProperty(t,e,n)},t.prototype.listen=function(t,e,n){if("string"!=typeof t){var r=ge(t);r&&r.listeners.push(new function(t,e){this.name=t,this.callback=e}(e,n))}return this.delegate.listen(t,e,n)},t.prototype.parentNode=function(t){return this.delegate.parentNode(t)},t.prototype.nextSibling=function(t){return this.delegate.nextSibling(t)},t.prototype.setValue=function(t,e){return this.delegate.setValue(t,e)},t}();function lo(t,e,n){return new ho(t,e,n)}var co,ho=function(t){function e(e,n,r){var i=t.call(this)||this;return i.moduleType=e,i._bootstrapComponents=n,i._ngModuleDefFactory=r,i}return Object(r.__extends)(e,t),e.prototype.create=function(t){!function(){if(!Ti){Ti=!0;var t=zt()?{setCurrentNode:Gi,createRootView:ki,createEmbeddedView:Ai,createComponentView:Oi,createNgModuleRef:Pi,overrideProvider:Di,overrideComponentView:Mi,clearOverrides:Vi,checkAndUpdateView:Ui,checkNoChangesView:Bi,destroyView:qi,createDebugContext:function(t,e){return new ro(t,e)},handleEvent:Wi,updateDirectives:Yi,updateRenderer:Ji}:{setCurrentNode:function(){},createRootView:Ii,createEmbeddedView:si,createComponentView:ui,createNgModuleRef:_r,overrideProvider:on,overrideComponentView:on,clearOverrides:on,checkAndUpdateView:pi,checkNoChangesView:fi,destroyView:vi,createDebugContext:function(t,e){return new ro(t,e)},handleEvent:function(t,e,n,r){return t.def.handleEvent(t,e,n,r)},updateDirectives:function(t,e){return t.def.updateDirectives(0===e?ji:Li,t)},updateRenderer:function(t,e){return t.def.updateRenderer(0===e?ji:Li,t)}};tn.setCurrentNode=t.setCurrentNode,tn.createRootView=t.createRootView,tn.createEmbeddedView=t.createEmbeddedView,tn.createComponentView=t.createComponentView,tn.createNgModuleRef=t.createNgModuleRef,tn.overrideProvider=t.overrideProvider,tn.overrideComponentView=t.overrideComponentView,tn.clearOverrides=t.clearOverrides,tn.checkAndUpdateView=t.checkAndUpdateView,tn.checkNoChangesView=t.checkNoChangesView,tn.destroyView=t.destroyView,tn.resolveDep=Lr,tn.createDebugContext=t.createDebugContext,tn.handleEvent=t.handleEvent,tn.updateDirectives=t.updateDirectives,tn.updateRenderer=t.updateRenderer,tn.dirtyParentQueries=Qr}}();var e=An(this._ngModuleDefFactory);return tn.createNgModuleRef(this.moduleType,t||N.NULL,this._bootstrapComponents,e)},e}(St);"undefined"==typeof ngDevMode&&("undefined"!=typeof window&&(window.ngDevMode=!0),"undefined"!=typeof self&&(self.ngDevMode=!0),"undefined"!=typeof t&&(t.ngDevMode=!0)),co=function(t,e,n){return{parent:co,id:null,node:null,data:[],ngStaticData:[],cleanup:null,renderer:null,child:null,tail:null,next:null,bindingStartIndex:null,creationMode:!0,viewHookStartIndex:null}}()}).call(e,n("fRUx"))},NGRF:function(t,e,n){"use strict";e.a=function(t){return null!=t&&"object"==typeof t}},NYZW:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n("e9+7"),i=n("WH8D");e.decode=function(t){var e={},n={},o={},s="";try{var a=t.split(".");e=i.jsonEval(r.base64Decode(a[0])||""),n=i.jsonEval(r.base64Decode(a[1])||""),s=a[2],o=n.d||{},delete n.d}catch(t){}return{header:e,claims:n,data:o,signature:s}},e.isValidTimestamp=function(t){var n,r,i=e.decode(t).claims,o=Math.floor((new Date).getTime()/1e3);return"object"==typeof i&&(i.hasOwnProperty("nbf")?n=i.nbf:i.hasOwnProperty("iat")&&(n=i.iat),r=i.hasOwnProperty("exp")?i.exp:n+86400),o&&n&&r&&o>=n&&o<=r},e.issuedAtTime=function(t){var n=e.decode(t).claims;return"object"==typeof n&&n.hasOwnProperty("iat")?n.iat:null},e.isValidFormat=function(t){var n=e.decode(t),r=n.claims;return!!n.signature&&!!r&&"object"==typeof r&&r.hasOwnProperty("iat")},e.isAdmin=function(t){var n=e.decode(t).claims;return"object"==typeof n&&!0===n.admin}},NeHU:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n("/ygB");e.querystring=function(t){var e=[];return r.forEach(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("&"):""},e.querystringDecode=function(t){var e={};return t.replace(/^\?/,"").split("&").forEach(function(t){if(t){var n=t.split("=");e[n[0]]=n[1]}}),e}},Oryw:function(t,e,n){"use strict";n.d(e,"a",function(){return u});var r=n("6Xbx"),i=n("AP4T"),o=n("8Ut3"),s=n("Ecq+"),a=n("3iOE"),u=function(t){function e(e,n){t.call(this),this.array=e,this.scheduler=n,n||1!==e.length||(this._isScalar=!0,this.value=e[0])}return Object(r.__extends)(e,t),e.create=function(t,n){return new e(t,n)},e.of=function(){for(var t=[],n=0;n<arguments.length;n++)t[n-0]=arguments[n];var r=t[t.length-1];Object(a.a)(r)?t.pop():r=null;var i=t.length;return i>1?new e(t,r):1===i?new o.a(t[0],r):new s.a(r)},e.dispatch=function(t){var e=t.array,n=t.index,r=t.subscriber;n>=t.count?r.complete():(r.next(e[n]),r.closed||(t.index=n+1,this.schedule(t)))},e.prototype._subscribe=function(t){var n=this.array,r=n.length,i=this.scheduler;if(i)return i.schedule(e.dispatch,0,{array:n,index:0,count:r,subscriber:t});for(var o=0;o<r&&!t.closed;o++)t.next(n[o]);t.complete()},e}(i.a)},P9wo:function(module,exports,__webpack_require__){(function(global){(function(){var g,goog=goog||{},k=this;function l(t){return"string"==typeof t}function aa(){}function ba(t){var e=typeof t;if("object"==e){if(!t)return"null";if(t instanceof Array)return"array";if(t instanceof Object)return e;var n=Object.prototype.toString.call(t);if("[object Window]"==n)return"object";if("[object Array]"==n||"number"==typeof t.length&&"undefined"!=typeof t.splice&&"undefined"!=typeof t.propertyIsEnumerable&&!t.propertyIsEnumerable("splice"))return"array";if("[object Function]"==n||"undefined"!=typeof t.call&&"undefined"!=typeof t.propertyIsEnumerable&&!t.propertyIsEnumerable("call"))return"function"}else if("function"==e&&"undefined"==typeof t.call)return"object";return e}function n(t){return"array"==ba(t)}function ca(t){var e=ba(t);return"array"==e||"object"==e&&"number"==typeof t.length}function da(t){return"function"==ba(t)}function p(t){var e=typeof t;return"object"==e&&null!=t||"function"==e}var q="closure_uid_"+(1e9*Math.random()>>>0),ea=0;function fa(t,e,n){return t.call.apply(t.bind,arguments)}function ha(t,e,n){if(!t)throw Error();if(2<arguments.length){var r=Array.prototype.slice.call(arguments,2);return function(){var n=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(n,r),t.apply(e,n)}}return function(){return t.apply(e,arguments)}}function r(t,e,n){return(r=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?fa:ha).apply(null,arguments)}function ia(t,e){var n=Array.prototype.slice.call(arguments,1);return function(){var e=n.slice();return e.push.apply(e,arguments),t.apply(this,e)}}var t=Date.now||function(){return+new Date};function u(t,e){function n(){}n.prototype=e.prototype,t.H=e.prototype,t.prototype=new n,t.prototype.constructor=t,t.Cb=function(t,n,r){for(var i=Array(arguments.length-2),o=2;o<arguments.length;o++)i[o-2]=arguments[o];return e.prototype[n].apply(t,i)}}function ja(t){if(Error.captureStackTrace)Error.captureStackTrace(this,ja);else{var e=Error().stack;e&&(this.stack=e)}t&&(this.message=String(t))}function ka(t,e){for(var n=t.split("%s"),r="",i=Array.prototype.slice.call(arguments,1);i.length&&1<n.length;)r+=n.shift()+i.shift();return r+n.join("%s")}u(ja,Error),ja.prototype.name="CustomError";var la=String.prototype.trim?function(t){return t.trim()}:function(t){return t.replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")};function ma(t,e){return t<e?-1:t>e?1:0}function na(t,e){e.unshift(t),ja.call(this,ka.apply(null,e)),e.shift()}function oa(t,e){throw new na("Failure"+(t?": "+t:""),Array.prototype.slice.call(arguments,1))}function w(){0!=qa&&(ra[this[q]||(this[q]=++ea)]=this),this.i=this.i,this.w=this.w}u(na,ja),na.prototype.name="AssertionError";var qa=0,ra={};w.prototype.i=!1,w.prototype.Z=function(){if(!this.i&&(this.i=!0,this.A(),0!=qa)){var t=this[q]||(this[q]=++ea);delete ra[t]}},w.prototype.A=function(){if(this.w)for(;this.w.length;)this.w.shift()()};var sa=Array.prototype.indexOf?function(t,e){return Array.prototype.indexOf.call(t,e,void 0)}:function(t,e){if(l(t))return l(e)&&1==e.length?t.indexOf(e,0):-1;for(var n=0;n<t.length;n++)if(n in t&&t[n]===e)return n;return-1},ta=Array.prototype.forEach?function(t,e,n){Array.prototype.forEach.call(t,e,n)}:function(t,e,n){for(var r=t.length,i=l(t)?t.split(""):t,o=0;o<r;o++)o in i&&e.call(n,i[o],o,t)},x;function ua(t){t:{for(var e=va,n=t.length,r=l(t)?t.split(""):t,i=0;i<n;i++)if(i in r&&e.call(void 0,r[i],i,t)){e=i;break t}e=-1}return 0>e?null:l(t)?t.charAt(e):t[e]}function wa(t){if(!n(t))for(var e=t.length-1;0<=e;e--)delete t[e];t.length=0}function xa(t){return Array.prototype.concat.apply([],arguments)}function ya(t){var e=t.length;if(0<e){for(var n=Array(e),r=0;r<e;r++)n[r]=t[r];return n}return[]}t:{var za=k.navigator;if(za){var Aa=za.userAgent;if(Aa){x=Aa;break t}}x=""}function y(t){return-1!=x.indexOf(t)}function Ba(t,e,n){for(var r in t)e.call(n,t[r],r,t)}function Ca(t){var e,n=[],r=0;for(e in t)n[r++]=t[e];return n}function Da(t){var e,n=[],r=0;for(e in t)n[r++]=e;return n}function Ea(t){var e,n={};for(e in t)n[e]=t[e];return n}var Fa="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function Ga(t,e){for(var n,r,i=1;i<arguments.length;i++){for(n in r=arguments[i])t[n]=r[n];for(var o=0;o<Fa.length;o++)n=Fa[o],Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}}function Ha(t){return Ha[" "](t),t}function Ia(t,e){var n=Ja;return Object.prototype.hasOwnProperty.call(n,t)?n[t]:n[t]=e(t)}Ha[" "]=aa;var Ka=y("Opera"),z=y("Trident")||y("MSIE"),La=y("Edge"),Ma=y("Gecko")&&!(-1!=x.toLowerCase().indexOf("webkit")&&!y("Edge"))&&!(y("Trident")||y("MSIE"))&&!y("Edge"),Na=-1!=x.toLowerCase().indexOf("webkit")&&!y("Edge"),Pa,a;function Oa(){var t=k.document;return t?t.documentMode:void 0}t:{var Qa="",Ra=(a=x,Ma?/rv:([^\);]+)(\)|;)/.exec(a):La?/Edge\/([\d\.]+)/.exec(a):z?/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(a):Na?/WebKit\/(\S+)/.exec(a):Ka?/(?:Version)[ \/]?(\S+)/.exec(a):void 0);if(Ra&&(Qa=Ra?Ra[1]:""),z){var Sa=Oa();if(null!=Sa&&Sa>parseFloat(Qa)){Pa=String(Sa);break t}}Pa=Qa}var Ja={},Ua;function Ta(t){return Ia(t,function(){for(var e=0,n=la(String(Pa)).split("."),r=la(String(t)).split("."),i=Math.max(n.length,r.length),o=0;0==e&&o<i;o++){var s=n[o]||"",a=r[o]||"";do{if(s=/(\d*)(\D*)(.*)/.exec(s)||["","","",""],a=/(\d*)(\D*)(.*)/.exec(a)||["","","",""],0==s[0].length&&0==a[0].length)break;e=ma(0==s[1].length?0:parseInt(s[1],10),0==a[1].length?0:parseInt(a[1],10))||ma(0==s[2].length,0==a[2].length)||ma(s[2],a[2]),s=s[3],a=a[3]}while(0==e)}return 0<=e})}var Va=k.document;Ua=Va&&z?Oa()||("CSS1Compat"==Va.compatMode?parseInt(Pa,10):5):void 0;var Wa=Object.freeze||function(t){return t},Xa=!z||9<=Number(Ua),Ya=z&&!Ta("9"),Za=function(){if(!k.addEventListener||!Object.defineProperty)return!1;var t=!1,e=Object.defineProperty({},"passive",{get:function(){t=!0}});return k.addEventListener("test",aa,e),k.removeEventListener("test",aa,e),t}();function A(t,e){this.type=t,this.a=this.target=e,this.Pa=!0}function $a(t,e){if(A.call(this,t?t.type:""),this.relatedTarget=this.a=this.target=null,this.button=this.screenY=this.screenX=this.clientY=this.clientX=0,this.key="",this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1,this.pointerId=0,this.pointerType="",this.c=null,t){var n=this.type=t.type,r=t.changedTouches?t.changedTouches[0]:null;if(this.target=t.target||t.srcElement,this.a=e,e=t.relatedTarget){if(Ma){t:{try{Ha(e.nodeName);var i=!0;break t}catch(t){}i=!1}i||(e=null)}}else"mouseover"==n?e=t.fromElement:"mouseout"==n&&(e=t.toElement);this.relatedTarget=e,null===r?(this.clientX=void 0!==t.clientX?t.clientX:t.pageX,this.clientY=void 0!==t.clientY?t.clientY:t.pageY,this.screenX=t.screenX||0,this.screenY=t.screenY||0):(this.clientX=void 0!==r.clientX?r.clientX:r.pageX,this.clientY=void 0!==r.clientY?r.clientY:r.pageY,this.screenX=r.screenX||0,this.screenY=r.screenY||0),this.button=t.button,this.key=t.key||"",this.ctrlKey=t.ctrlKey,this.altKey=t.altKey,this.shiftKey=t.shiftKey,this.metaKey=t.metaKey,this.pointerId=t.pointerId||0,this.pointerType=l(t.pointerType)?t.pointerType:ab[t.pointerType]||"",this.c=t,t.defaultPrevented&&this.b()}}A.prototype.b=function(){this.Pa=!1},u($a,A);var ab=Wa({2:"touch",3:"pen",4:"mouse"});$a.prototype.b=function(){$a.H.b.call(this);var t=this.c;if(t.preventDefault)t.preventDefault();else if(t.returnValue=!1,Ya)try{(t.ctrlKey||112<=t.keyCode&&123>=t.keyCode)&&(t.keyCode=-1)}catch(t){}};var bb="closure_listenable_"+(1e6*Math.random()|0);function cb(t){return!(!t||!t[bb])}var db=0;function eb(t,e,n,r,i){this.listener=t,this.a=null,this.src=e,this.type=n,this.capture=!!r,this.ga=i,this.key=++db,this.Y=this.ca=!1}function fb(t){t.Y=!0,t.listener=null,t.a=null,t.src=null,t.ga=null}function gb(t){this.src=t,this.a={},this.b=0}function ib(t,e){var n=e.type;if(n in t.a){var r,i=t.a[n],o=sa(i,e);(r=0<=o)&&Array.prototype.splice.call(i,o,1),r&&(fb(e),0==t.a[n].length&&(delete t.a[n],t.b--))}}function jb(t,e,n,r,i){return t=t.a[e.toString()],e=-1,t&&(e=hb(t,n,r,i)),-1<e?t[e]:null}function hb(t,e,n,r){for(var i=0;i<t.length;++i){var o=t[i];if(!o.Y&&o.listener==e&&o.capture==!!n&&o.ga==r)return i}return-1}gb.prototype.add=function(t,e,n,r,i){var o=t.toString();(t=this.a[o])||(t=this.a[o]=[],this.b++);var s=hb(t,e,r,i);return-1<s?(e=t[s],n||(e.ca=!1)):((e=new eb(e,this.src,o,!!r,i)).ca=n,t.push(e)),e};var kb="closure_lm_"+(1e6*Math.random()|0),lb={},mb=0;function nb(t,e,r,i,o){if(i&&i.once)return ob(t,e,r,i,o);if(n(e)){for(var s=0;s<e.length;s++)nb(t,e[s],r,i,o);return null}return r=pb(r),cb(t)?t.aa(e,r,p(i)?!!i.capture:!!i,o):qb(t,e,r,!1,i,o)}function qb(t,e,n,r,i,o){if(!e)throw Error("Invalid event type");var s=p(i)?!!i.capture:!!i,a=rb(t);if(a||(t[kb]=a=new gb(t)),(n=a.add(e,n,r,s,o)).a)return n;if(r=sb(),n.a=r,r.src=t,r.listener=n,t.addEventListener)Za||(i=s),void 0===i&&(i=!1),t.addEventListener(e.toString(),r,i);else if(t.attachEvent)t.attachEvent(tb(e.toString()),r);else{if(!t.addListener||!t.removeListener)throw Error("addEventListener and attachEvent are unavailable.");t.addListener(r)}return mb++,n}function sb(){var t=ub,e=Xa?function(n){return t.call(e.src,e.listener,n)}:function(n){if(!(n=t.call(e.src,e.listener,n)))return n};return e}function ob(t,e,r,i,o){if(n(e)){for(var s=0;s<e.length;s++)ob(t,e[s],r,i,o);return null}return r=pb(r),cb(t)?t.Ha(e,r,p(i)?!!i.capture:!!i,o):qb(t,e,r,!0,i,o)}function vb(t,e,r,i,o){if(n(e))for(var s=0;s<e.length;s++)vb(t,e[s],r,i,o);else i=p(i)?!!i.capture:!!i,r=pb(r),cb(t)?t.va(e,r,i,o):t&&(t=rb(t))&&(e=jb(t,e,r,i,o))&&wb(e)}function wb(t){if("number"!=typeof t&&t&&!t.Y){var e=t.src;if(cb(e))ib(e.c,t);else{var n=t.type,r=t.a;e.removeEventListener?e.removeEventListener(n,r,t.capture):e.detachEvent?e.detachEvent(tb(n),r):e.addListener&&e.removeListener&&e.removeListener(r),mb--,(n=rb(e))?(ib(n,t),0==n.b&&(n.src=null,e[kb]=null)):fb(t)}}}function tb(t){return t in lb?lb[t]:lb[t]="on"+t}function xb(t,e,n,r){var i=!0;if((t=rb(t))&&(e=t.a[e.toString()]))for(e=e.concat(),t=0;t<e.length;t++){var o=e[t];o&&o.capture==n&&!o.Y&&(o=yb(o,r),i=i&&!1!==o)}return i}function yb(t,e){var n=t.listener,r=t.ga||t.src;return t.ca&&wb(t),n.call(r,e)}function ub(t,e){if(t.Y)return!0;if(!Xa){if(!e)t:{e=["window","event"];for(var n=k,r=0;r<e.length;r++)if(null==(n=n[e[r]])){e=null;break t}e=n}if(e=new $a(r=e,this),n=!0,!(0>r.keyCode||void 0!=r.returnValue)){t:{var i=!1;if(0==r.keyCode)try{r.keyCode=-1;break t}catch(t){i=!0}(i||void 0==r.returnValue)&&(r.returnValue=!0)}for(r=[],i=e.a;i;i=i.parentNode)r.push(i);for(t=t.type,i=r.length-1;0<=i;i--){e.a=r[i];var o=xb(r[i],t,!0,e);n=n&&o}for(i=0;i<r.length;i++)e.a=r[i],o=xb(r[i],t,!1,e),n=n&&o}return n}return yb(t,new $a(e,this))}function rb(t){return(t=t[kb])instanceof gb?t:null}var zb="__closure_events_fn_"+(1e9*Math.random()>>>0);function pb(t){return da(t)?t:(t[zb]||(t[zb]=function(e){return t.handleEvent(e)}),t[zb])}function B(){w.call(this),this.c=new gb(this),this.P=this,this.K=null}function Ab(t,e,n,r){if(!(e=t.c.a[String(e)]))return!0;e=e.concat();for(var i=!0,o=0;o<e.length;++o){var s=e[o];if(s&&!s.Y&&s.capture==n){var a=s.listener,u=s.ga||s.src;s.ca&&ib(t.c,s),i=!1!==a.call(u,r)&&i}}return i&&0!=r.Pa}function Bb(t){return!/^\s*$/.test(t)&&/^[\],:{}\s\u2028\u2029]*$/.test(t.replace(/\\["\\\/bfnrtu]/g,"@").replace(/(?:"[^"\\\n\r\u2028\u2029\x00-\x08\x0a-\x1f]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)[\s\u2028\u2029]*(?=:|,|]|}|$)/g,"]").replace(/(?:^|:|,)(?:[\s\u2028\u2029]*\[)+/g,""))}function Cb(a){if(a=String(a),Bb(a))try{return eval("("+a+")")}catch(t){}throw Error("Invalid JSON string: "+a)}function Db(t){var e=[];return Eb(new Fb,t,e),e.join("")}function Fb(){}function Eb(t,e,r){if(null==e)r.push("null");else{if("object"==typeof e){if(n(e)){var i=e;e=i.length,r.push("[");for(var o="",s=0;s<e;s++)r.push(o),Eb(t,i[s],r),o=",";return void r.push("]")}if(!(e instanceof String||e instanceof Number||e instanceof Boolean)){for(i in r.push("{"),o="",e)Object.prototype.hasOwnProperty.call(e,i)&&"function"!=typeof(s=e[i])&&(r.push(o),Gb(i,r),r.push(":"),Eb(t,s,r),o=",");return void r.push("}")}e=e.valueOf()}switch(typeof e){case"string":Gb(e,r);break;case"number":r.push(isFinite(e)&&!isNaN(e)?String(e):"null");break;case"boolean":r.push(String(e));break;case"function":r.push("null");break;default:throw Error("Unknown type: "+typeof e)}}}u(B,w),B.prototype[bb]=!0,g=B.prototype,g.addEventListener=function(t,e,n,r){nb(this,t,e,n,r)},g.removeEventListener=function(t,e,n,r){vb(this,t,e,n,r)},g.dispatchEvent=function(t){var e,n=this.K;if(n)for(e=[];n;n=n.K)e.push(n);n=this.P;var r=t.type||t;if(l(t))t=new A(t,n);else if(t instanceof A)t.target=t.target||n;else{var i=t;Ga(t=new A(r,n),i)}if(i=!0,e)for(var o=e.length-1;0<=o;o--){var s=t.a=e[o];i=Ab(s,r,!0,t)&&i}if(i=Ab(s=t.a=n,r,!0,t)&&i,i=Ab(s,r,!1,t)&&i,e)for(o=0;o<e.length;o++)i=Ab(s=t.a=e[o],r,!1,t)&&i;return i},g.A=function(){if(B.H.A.call(this),this.c){var t,e=this.c;for(t in e.a){for(var n=e.a[t],r=0;r<n.length;r++)fb(n[r]);delete e.a[t],e.b--}}this.K=null},g.aa=function(t,e,n,r){return this.c.add(String(t),e,!1,n,r)},g.Ha=function(t,e,n,r){return this.c.add(String(t),e,!0,n,r)},g.va=function(t,e,n,r){var i=this.c;if((t=String(t).toString())in i.a){var o=i.a[t];-1<(e=hb(o,e,n,r))&&(fb(o[e]),Array.prototype.splice.call(o,e,1),0==o.length&&(delete i.a[t],i.b--))}};var Hb={'"':'\\"',"\\":"\\\\","/":"\\/","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\u000b"},Ib=/\uffff/.test("\uffff")?/[\\"\x00-\x1f\x7f-\uffff]/g:/[\\"\x00-\x1f\x7f-\xff]/g;function Gb(t,e){e.push('"',t.replace(Ib,function(t){var e=Hb[t];return e||(e="\\u"+(65536|t.charCodeAt(0)).toString(16).substr(1),Hb[t]=e),e}),'"')}function Jb(t,e){this.c=t,this.f=e,this.b=0,this.a=null}function Kb(){this.b=this.a=null}Jb.prototype.get=function(){if(0<this.b){this.b--;var t=this.a;this.a=t.next,t.next=null}else t=this.c();return t};var Nb=new Jb(function(){return new Lb},function(t){t.reset()}),Rb,Tb;function Ob(){var t=Pb,e=null;return t.a&&(e=t.a,t.a=t.a.next,t.a||(t.b=null),e.next=null),e}function Lb(){this.next=this.b=this.a=null}function Qb(t){k.setTimeout(function(){throw t},0)}function Sb(){var t=k.MessageChannel;if("undefined"==typeof t&&"undefined"!=typeof window&&window.postMessage&&window.addEventListener&&!y("Presto")&&(t=function(){var t=document.createElement("IFRAME");t.style.display="none",t.src="",document.documentElement.appendChild(t);var e=t.contentWindow;(t=e.document).open(),t.write(""),t.close();var n="callImmediate"+Math.random(),i="file:"==e.location.protocol?"*":e.location.protocol+"//"+e.location.host;t=r(function(t){"*"!=i&&t.origin!=i||t.data!=n||this.port1.onmessage()},this),e.addEventListener("message",t,!1),this.port1={},this.port2={postMessage:function(){e.postMessage(n,i)}}}),"undefined"!=typeof t&&!y("Trident")&&!y("MSIE")){var e=new t,n={},i=n;return e.port1.onmessage=function(){if(void 0!==n.next){var t=(n=n.next).za;n.za=null,t()}},function(t){i.next={za:t},i=i.next,e.port2.postMessage(0)}}return"undefined"!=typeof document&&"onreadystatechange"in document.createElement("SCRIPT")?function(t){var e=document.createElement("SCRIPT");e.onreadystatechange=function(){e.onreadystatechange=null,e.parentNode.removeChild(e),e=null,t(),t=null},document.documentElement.appendChild(e)}:function(t){k.setTimeout(t,0)}}function Ub(){if(-1!=String(k.Promise).indexOf("[native code]")){var t=k.Promise.resolve(void 0);Tb=function(){t.then(Vb)}}else Tb=function(){var t=Vb;!da(k.setImmediate)||k.Window&&k.Window.prototype&&!y("Edge")&&k.Window.prototype.setImmediate==k.setImmediate?(Rb||(Rb=Sb()),Rb(t)):k.setImmediate(t)}}Kb.prototype.add=function(t,e){var n=Nb.get();n.set(t,e),this.b?this.b.next=n:this.a=n,this.b=n},Lb.prototype.set=function(t,e){this.a=t,this.b=e,this.next=null},Lb.prototype.reset=function(){this.next=this.b=this.a=null};var Wb=!1,Pb=new Kb;function Vb(){for(var t;t=Ob();){try{t.a.call(t.b)}catch(t){Qb(t)}var e=Nb;e.f(t),100>e.b&&(e.b++,t.next=e.a,e.a=t)}Wb=!1}function Xb(e,n){B.call(this),this.b=e||1,this.a=n||k,this.f=r(this.kb,this),this.g=t()}function Yb(t){t.$=!1,t.L&&(t.a.clearTimeout(t.L),t.L=null)}function Zb(t,e,n){if(da(t))n&&(t=r(t,n));else{if(!t||"function"!=typeof t.handleEvent)throw Error("Invalid listener argument");t=r(t.handleEvent,t)}return 2147483647<Number(e)?-1:k.setTimeout(t,e||0)}function $b(t,e,n){w.call(this),this.f=null!=n?r(t,n):t,this.c=e,this.b=r(this.eb,this),this.a=[]}function ac(t){t.X=Zb(t.b,t.c),t.f.apply(null,t.a)}function C(t){w.call(this),this.b=t,this.a={}}u(Xb,B),g=Xb.prototype,g.$=!1,g.L=null,g.kb=function(){if(this.$){var e=t()-this.g;0<e&&e<.8*this.b?this.L=this.a.setTimeout(this.f,this.b-e):(this.L&&(this.a.clearTimeout(this.L),this.L=null),this.dispatchEvent("tick"),this.$&&(this.L=this.a.setTimeout(this.f,this.b),this.g=t()))}},g.start=function(){this.$=!0,this.L||(this.L=this.a.setTimeout(this.f,this.b),this.g=t())},g.A=function(){Xb.H.A.call(this),Yb(this),delete this.a},u($b,w),g=$b.prototype,g.ha=!1,g.X=null,g.Xa=function(t){this.a=arguments,this.X?this.ha=!0:ac(this)},g.A=function(){$b.H.A.call(this),this.X&&(k.clearTimeout(this.X),this.X=null,this.ha=!1,this.a=[])},g.eb=function(){this.X=null,this.ha&&(this.ha=!1,ac(this))},u(C,w);var bc=[];function cc(t){Ba(t.a,function(t,e){this.a.hasOwnProperty(e)&&wb(t)},t),t.a={}}function dc(t,e,n){this.reset(t,e,n,void 0,void 0)}C.prototype.aa=function(t,e,r,i){n(e)||(e&&(bc[0]=e.toString()),e=bc);for(var o=0;o<e.length;o++){var s=nb(t,e[o],r||this.handleEvent,i||!1,this.b||this);if(!s)break;this.a[s.key]=s}return this},C.prototype.va=function(t,e,r,i,o){if(n(e))for(var s=0;s<e.length;s++)this.va(t,e[s],r,i,o);else r=r||this.handleEvent,i=p(i)?!!i.capture:!!i,o=o||this.b||this,r=pb(r),i=!!i,(e=cb(t)?jb(t.c,String(e),r,i,o):t&&(t=rb(t))?jb(t,e,r,i,o):null)&&(wb(e),delete this.a[e.key])},C.prototype.A=function(){C.H.A.call(this),cc(this)},C.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented")},dc.prototype.a=null;var ec=0;function fc(t){this.f=t,this.b=this.c=this.a=null}function D(t,e){this.name=t,this.value=e}dc.prototype.reset=function(e,n,r,i,o){"number"==typeof o||ec++,i||t(),delete this.a},D.prototype.toString=function(){return this.name};var gc=new D("SEVERE",1e3),hc=new D("WARNING",900),ic=new D("INFO",800),jc=new D("CONFIG",700),kc=new D("FINE",500);function lc(t){return t.c?t.c:t.a?lc(t.a):(oa("Root logger has no level set."),null)}fc.prototype.log=function(t,e,n){if(t.value>=lc(this).value)for(da(e)&&(e=e()),t=new dc(t,String(e),this.f),n&&(t.a=n),n=this;n;)n=n.a};var mc={},nc=null;function oc(t){var e;if(nc||(nc=new fc(""),mc[""]=nc,nc.c=jc),!(e=mc[t])){e=new fc(t);var n=t.lastIndexOf("."),r=t.substr(n+1);(n=oc(t.substr(0,n))).b||(n.b={}),n.b[r]=e,e.a=n,mc[t]=e}return e}function E(t,e){t&&t.log(hc,e,void 0)}function pc(t,e){t&&t.log(ic,e,void 0)}function F(t,e){t&&t.log(kc,e,void 0)}function qc(){this.a=oc("goog.labs.net.webChannel.WebChannelDebug"),this.b=!0}function rc(t,e,n,r,i,o){H(t,function(){if(t.b)if(o)for(var s="",a=o.split("&"),u=0;u<a.length;u++){var l=a[u].split("=");if(1<l.length){var c=l[0];l=l[1];var h=c.split("_");s=2<=h.length&&"type"==h[1]?s+(c+"=")+l+"&":s+(c+"=redacted&")}}else s=null;else s=o;return"XMLHTTP REQ ("+r+") [attempt "+i+"]: "+e+"\n"+n+"\n"+s})}function sc(t,e,n,r,i,o,s){H(t,function(){return"XMLHTTP RESP ("+r+") [ attempt "+i+"]: "+e+"\n"+n+"\n"+o+" "+s})}function tc(t,e,n,r){H(t,function(){return"XMLHTTP TEXT ("+e+"): "+uc(t,n)+(r?" "+r:"")})}function vc(t,e){H(t,function(){return"TIMEOUT: "+e})}function I(t,e){F(t.a,e)}function wc(t,e,n){(t=t.a)&&t.log(gc,n||"Exception",e)}function H(t,e){pc(t.a,e)}function xc(t,e){(t=t.a)&&t.log(gc,e,void 0)}function uc(t,e){if(!t.b)return e;if(!e)return null;try{var r=JSON.parse(e);if(r)for(var i=0;i<r.length;i++)if(n(r[i])){var o=r[i];if(!(2>o.length)){var s=o[1];if(n(s)&&!(1>s.length)){var a=s[0];if("noop"!=a&&"stop"!=a&&"close"!=a)for(var u=1;u<s.length;u++)s[u]=""}}}return Db(r)}catch(n){return I(t,"Exception parsing expected JS array - probably was not JS"),e}}qc.prototype.Ea=function(){this.b=!1};var yc=new B;function zc(t){A.call(this,"serverreachability",t)}function Ac(t){yc.dispatchEvent(new zc(yc,t))}function Bc(t){A.call(this,"statevent",t)}function J(t){yc.dispatchEvent(new Bc(yc,t))}function Cc(t){A.call(this,"timingevent",t)}function Dc(t,e,n){yc.dispatchEvent(new Cc(yc,t,e,n))}function Ec(t,e){if(!da(t))throw Error("Fn must not be null and must be a function");return k.setTimeout(function(){t()},e)}u(zc,A),u(Bc,A),u(Cc,A);var Fc={NO_ERROR:0,lb:1,sb:2,rb:3,ob:4,qb:5,tb:6,Ra:7,TIMEOUT:8,wb:9},Gc={nb:"complete",Ab:"success",Sa:"error",Ra:"abort",yb:"ready",zb:"readystatechange",TIMEOUT:"timeout",ub:"incrementaldata",xb:"progress",pb:"downloadprogress",Bb:"uploadprogress"},Kc;function Hc(){}function Ic(t){var e;return(e=t.a)||(e={},Jc(t)&&(e[0]=!0,e[1]=!0),e=t.a=e),e}function Lc(){}function Mc(t){return(t=Jc(t))?new ActiveXObject(t):new XMLHttpRequest}function Jc(t){if(!t.b&&"undefined"==typeof XMLHttpRequest&&"undefined"!=typeof ActiveXObject){for(var e=["MSXML2.XMLHTTP.6.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"],n=0;n<e.length;n++){var r=e[n];try{return new ActiveXObject(r),t.b=r}catch(t){}}throw Error("Could not create ActiveXObject. ActiveX might be disabled, or MSXML might not be installed")}return t.b}function K(t,e,n,r){this.i=t,this.b=e,this.f=n,this.T=r||1,this.N=new C(this),this.S=Nc,(t=this.I=new Xb).b=Oc,t.L&&t.$?(Yb(t),t.start()):t.L&&Yb(t),this.j=null,this.c=!1,this.m=this.g=this.h=this.K=this.D=this.U=this.w=null,this.u=[],this.a=null,this.F=0,this.l=this.o=null,this.C=-1,this.B=!1,this.P=0,this.J=null,this.M=!1}Hc.prototype.a=null,u(Lc,Hc),Kc=new Lc;var Nc=45e3,Oc=250;function Pc(t,e){switch(t){case 0:return"Non-200 return code ("+e+")";case 1:return"XMLHTTP failure (no data)";case 2:return"HttpConnection timeout";default:return"Unknown error"}}var Qc={},Rc={};function Sc(t,e,n){t.K=1,t.h=Tc(L(e)),t.m=n,t.M=!0,Uc(t,null)}function Vc(t,e,n,r){t.K=1,t.h=Tc(L(e)),t.m=null,t.M=n,Uc(t,r)}function Uc(e,n){e.D=t(),Wc(e),e.g=L(e.h),Xc(e.g,"t",e.T),e.F=0,e.a=e.i.da(e.i.ia()?n:null),0<e.P&&(e.J=new $b(r(e.Qa,e,e.a),e.P)),e.N.aa(e.a,"readystatechange",e.hb),n=e.j?Ea(e.j):{},e.m?(e.o||(e.o="POST"),n["Content-Type"]="application/x-www-form-urlencoded",e.a.fa(e.g,e.o,e.m,n)):(e.o="GET",e.a.fa(e.g,e.o,null,n)),Ac(1),rc(e.b,e.o,e.g,e.f,e.T,e.m)}function Yc(t){var e=M(t.a),n=t.a.Fa(),r=t.a.W();if(!(3>e||3==e&&!Ka&&!t.a.V())){t.B||4!=e||7==n||Ac(8==n||0>=r?3:2),Zc(t);var i=t.a.W();t.C=i,(n=t.a.V())||I(t.b,function(){return"No response text for uri "+t.g+" status "+i}),t.c=200==i,sc(t.b,t.o,t.g,t.f,t.T,e,i),t.c?(t.M?($c(t,e,n),Ka&&t.c&&3==e&&ad(t)):(tc(t.b,t.f,n,null),bd(t,n)),4==e&&cd(t),t.c&&!t.B&&(4==e?t.i.ua(t):(t.c=!1,Wc(t)))):(400==i&&0<n.indexOf("Unknown SID")?(t.l=3,J(12),E(t.b.a,"XMLHTTP Unknown SID ("+t.f+")")):(t.l=0,J(13),E(t.b.a,"XMLHTTP Bad status "+i+" ("+t.f+")")),cd(t),dd(t))}}function $c(t,e,n){for(var r=!0;!t.B&&t.F<n.length;){var i=ed(t,n);if(i==Rc){4==e&&(t.l=4,J(14),r=!1),tc(t.b,t.f,null,"[Incomplete Response]");break}if(i==Qc){t.l=4,J(15),tc(t.b,t.f,n,"[Invalid Chunk]"),r=!1;break}tc(t.b,t.f,i,null),bd(t,i)}4==e&&0==n.length&&(t.l=1,J(16),r=!1),t.c=t.c&&r,r||(tc(t.b,t.f,n,"[Invalid Chunked Response]"),cd(t),dd(t))}function ad(t){t.N.aa(t.I,"tick",t.gb),t.I.start()}function ed(t,e){var n=t.F,r=e.indexOf("\n",n);return-1==r?Rc:(n=Number(e.substring(n,r)),isNaN(n)?Qc:(r+=1)+n>e.length?Rc:(e=e.substr(r,n),t.F=r+n,e))}function Wc(e){e.U=t()+e.S,fd(e,e.S)}function fd(t,e){if(null!=t.w)throw Error("WatchDog timer not null");t.w=Ec(r(t.fb,t),e)}function Zc(t){t.w&&(k.clearTimeout(t.w),t.w=null)}function dd(t){t.i.Ja()||t.B||t.i.ua(t)}function cd(t){Zc(t);var e=t.J;e&&"function"==typeof e.Z&&e.Z(),t.J=null,Yb(t.I),cc(t.N),t.a&&(e=t.a,t.a=null,e.abort(),e.Z())}function bd(t,e){try{t.i.Ma(t,e),Ac(4)}catch(e){wc(t.b,e,"Error in httprequest callback")}}function gd(t){if(t.v&&"function"==typeof t.v)return t.v();if(l(t))return t.split("");if(ca(t)){for(var e=[],n=t.length,r=0;r<n;r++)e.push(t[r]);return e}return Ca(t)}function hd(t,e){if(t.forEach&&"function"==typeof t.forEach)t.forEach(e,void 0);else if(ca(t)||l(t))ta(t,e,void 0);else{if(t.O&&"function"==typeof t.O)var n=t.O();else if(t.v&&"function"==typeof t.v)n=void 0;else if(ca(t)||l(t)){n=[];for(var r=t.length,i=0;i<r;i++)n.push(i)}else n=Da(t);i=(r=gd(t)).length;for(var o=0;o<i;o++)e.call(void 0,r[o],n&&n[o],t)}}function N(t,e){this.b={},this.a=[],this.c=0;var n=arguments.length;if(1<n){if(n%2)throw Error("Uneven number of arguments");for(var r=0;r<n;r+=2)this.set(arguments[r],arguments[r+1])}else if(t){t instanceof N?(n=t.O(),r=t.v()):(n=Da(t),r=Ca(t));for(var i=0;i<n.length;i++)this.set(n[i],r[i])}}function jd(t){t.b={},t.a.length=0,t.c=0}function kd(t,e){return!!O(t.b,e)&&(delete t.b[e],t.c--,t.a.length>2*t.c&&id(t),!0)}function id(t){if(t.c!=t.a.length){for(var e=0,n=0;e<t.a.length;){var r=t.a[e];O(t.b,r)&&(t.a[n++]=r),e++}t.a.length=n}if(t.c!=t.a.length){var i={};for(n=e=0;e<t.a.length;)O(i,r=t.a[e])||(t.a[n++]=r,i[r]=1),e++;t.a.length=n}}function O(t,e){return Object.prototype.hasOwnProperty.call(t,e)}g=K.prototype,g.setTimeout=function(t){this.S=t},g.hb=function(t){t=t.target;var e=this.J;e&&3==M(t)?(I(this.b,"Throttling readystatechange."),e.Xa()):this.Qa(t)},g.Qa=function(t){try{t==this.a?Yc(this):E(this.b.a,"Called back with an unexpected xmlhttp")}catch(t){if(I(this.b,"Failed call to OnXmlHttpReadyStateChanged_"),this.a&&this.a.V()){var e=this;wc(this.b,t,function(){return"ResponseText: "+e.a.V()})}else wc(this.b,t,"No response text")}},g.gb=function(){var t=M(this.a),e=this.a.V();this.F<e.length&&(Zc(this),$c(this,t,e),this.c&&4!=t&&Wc(this))},g.cancel=function(){this.B=!0,cd(this)},g.fb=function(){this.w=null;var e=t();0<=e-this.U?(this.c&&xc(this.b,"Received watchdog timeout even though request loaded successfully"),vc(this.b,this.g),2!=this.K&&(Ac(3),J(17)),cd(this),this.l=2,dd(this)):(E(this.b.a,"WatchDog timer called too early"),fd(this,this.U-e))},g=N.prototype,g.s=function(){return this.c},g.v=function(){id(this);for(var t=[],e=0;e<this.a.length;e++)t.push(this.b[this.a[e]]);return t},g.O=function(){return id(this),this.a.concat()},g.get=function(t,e){return O(this.b,t)?this.b[t]:e},g.set=function(t,e){O(this.b,t)||(this.c++,this.a.push(t)),this.b[t]=e},g.forEach=function(t,e){for(var n=this.O(),r=0;r<n.length;r++){var i=n[r],o=this.get(i);t.call(e,o,i,this)}};var ld=/^(?:([^:/?#.]+):)?(?:\/\/(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\?([^#]*))?(?:#([\s\S]*))?$/;function md(t,e){if(t){t=t.split("&");for(var n=0;n<t.length;n++){var r=t[n].indexOf("="),i=null;if(0<=r){var o=t[n].substring(0,r);i=t[n].substring(r+1)}else o=t[n];e(o,i?decodeURIComponent(i.replace(/\+/g," ")):"")}}}function P(t,e){var n;this.b=this.j=this.f="",this.i=null,this.g=this.a="",this.h=!1,t instanceof P?(this.h=void 0!==e?e:t.h,nd(this,t.f),this.j=t.j,od(this,t.b),pd(this,t.i),this.a=t.a,qd(this,rd(t.c)),this.g=t.g):t&&(n=String(t).match(ld))?(this.h=!!e,nd(this,n[1]||"",!0),this.j=sd(n[2]||""),od(this,n[3]||"",!0),pd(this,n[4]),this.a=sd(n[5]||"",!0),qd(this,n[6]||"",!0),this.g=sd(n[7]||"")):(this.h=!!e,this.c=new td(null,this.h))}function L(t){return new P(t)}function nd(t,e,n){t.f=n?sd(e,!0):e,t.f&&(t.f=t.f.replace(/:$/,""))}function od(t,e,n){t.b=n?sd(e,!0):e}function pd(t,e){if(e){if(e=Number(e),isNaN(e)||0>e)throw Error("Bad port number "+e);t.i=e}else t.i=null}function qd(t,e,n){e instanceof td?(t.c=e,zd(t.c,t.h)):(n||(e=ud(e,Ad)),t.c=new td(e,t.h))}function Q(t,e,n){t.c.set(e,n)}function Xc(t,e,r){n(r)||(r=[String(r)]),Bd(t.c,e,r)}function Tc(e){return Q(e,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^t()).toString(36)),e}function Cd(t){return t instanceof P?L(t):new P(t,void 0)}function Dd(t,e,n,r){var i=new P(null,void 0);return t&&nd(i,t),e&&od(i,e),n&&pd(i,n),r&&(i.a=r),i}function sd(t,e){return t?e?decodeURI(t.replace(/%25/g,"%2525")):decodeURIComponent(t):""}function ud(t,e,n){return l(t)?(t=encodeURI(t).replace(e,Ed),n&&(t=t.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),t):null}function Ed(t){return"%"+((t=t.charCodeAt(0))>>4&15).toString(16)+(15&t).toString(16)}P.prototype.toString=function(){var t=[],e=this.f;e&&t.push(ud(e,vd,!0),":");var n=this.b;return(n||"file"==e)&&(t.push("//"),(e=this.j)&&t.push(ud(e,vd,!0),"@"),t.push(encodeURIComponent(String(n)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),null!=(n=this.i)&&t.push(":",String(n))),(n=this.a)&&(this.b&&"/"!=n.charAt(0)&&t.push("/"),t.push(ud(n,"/"==n.charAt(0)?wd:xd,!0))),(n=this.c.toString())&&t.push("?",n),(n=this.g)&&t.push("#",ud(n,yd)),t.join("")},P.prototype.resolve=function(t){var e=L(this),n=!!t.f;n?nd(e,t.f):n=!!t.j,n?e.j=t.j:n=!!t.b,n?od(e,t.b):n=null!=t.i;var r=t.a;if(n)pd(e,t.i);else if(n=!!t.a){if("/"!=r.charAt(0))if(this.b&&!this.a)r="/"+r;else{var i=e.a.lastIndexOf("/");-1!=i&&(r=e.a.substr(0,i+1)+r)}if(".."==(i=r)||"."==i)r="";else if(-1!=i.indexOf("./")||-1!=i.indexOf("/.")){r=0==i.lastIndexOf("/",0),i=i.split("/");for(var o=[],s=0;s<i.length;){var a=i[s++];"."==a?r&&s==i.length&&o.push(""):".."==a?((1<o.length||1==o.length&&""!=o[0])&&o.pop(),r&&s==i.length&&o.push("")):(o.push(a),r=!0)}r=o.join("/")}else r=i}return n?e.a=r:n=""!==t.c.toString(),n?qd(e,rd(t.c)):n=!!t.g,n&&(e.g=t.g),e};var vd=/[#\/\?@]/g,xd=/[#\?:]/g,wd=/[#\?]/g,Ad=/[#\?@]/g,yd=/#/g;function td(t,e){this.b=this.a=null,this.c=t||null,this.f=!!e}function R(t){t.a||(t.a=new N,t.b=0,t.c&&md(t.c,function(e,n){t.add(decodeURIComponent(e.replace(/\+/g," ")),n)}))}function Gd(t,e){R(t),e=Fd(t,e),O(t.a.b,e)&&(t.c=null,t.b-=t.a.get(e).length,kd(t.a,e))}function Hd(t,e){return R(t),e=Fd(t,e),O(t.a.b,e)}function Bd(t,e,n){Gd(t,e),0<n.length&&(t.c=null,t.a.set(Fd(t,e),ya(n)),t.b+=n.length)}function rd(t){var e=new td;return e.c=t.c,t.a&&(e.a=new N(t.a),e.b=t.b),e}function Fd(t,e){return e=String(e),t.f&&(e=e.toLowerCase()),e}function zd(t,e){e&&!t.f&&(R(t),t.c=null,t.a.forEach(function(t,e){var n=e.toLowerCase();e!=n&&(Gd(this,e),Bd(this,n,t))},t)),t.f=e}function Id(){this.a=t()}g=td.prototype,g.s=function(){return R(this),this.b},g.add=function(t,e){R(this),this.c=null,t=Fd(this,t);var n=this.a.get(t);return n||this.a.set(t,n=[]),n.push(e),this.b+=1,this},g.forEach=function(t,e){R(this),this.a.forEach(function(n,r){ta(n,function(n){t.call(e,n,r,this)},this)},this)},g.O=function(){R(this);for(var t=this.a.v(),e=this.a.O(),n=[],r=0;r<e.length;r++)for(var i=t[r],o=0;o<i.length;o++)n.push(e[r]);return n},g.v=function(t){R(this);var e=[];if(l(t))Hd(this,t)&&(e=xa(e,this.a.get(Fd(this,t))));else{t=this.a.v();for(var n=0;n<t.length;n++)e=xa(e,t[n])}return e},g.set=function(t,e){return R(this),this.c=null,Hd(this,t=Fd(this,t))&&(this.b-=this.a.get(t).length),this.a.set(t,[e]),this.b+=1,this},g.get=function(t,e){return 0<(t=t?this.v(t):[]).length?String(t[0]):e},g.toString=function(){if(this.c)return this.c;if(!this.a)return"";for(var t=[],e=this.a.O(),n=0;n<e.length;n++){var r=e[n],i=encodeURIComponent(String(r));r=this.v(r);for(var o=0;o<r.length;o++){var s=i;""!==r[o]&&(s+="="+encodeURIComponent(String(r[o]))),t.push(s)}}return this.c=t.join("&")};var Jd=null;function Kd(){Jd||(Jd=new Id)}function Ld(){Jd||(Jd=new Id)}function Md(){}Id.prototype.set=function(t){this.a=t},Id.prototype.reset=function(){this.set(t())},Id.prototype.get=function(){return this.a},u(Ld,Kd);var Nd={OPEN:"a",mb:"b",Sa:"c",vb:"d"};function Od(){A.call(this,"d")}function Pd(){A.call(this,"c")}function Qd(t,e){this.a=t,this.b=e,this.c=this.i=null,this.h=!1,this.l=null,this.f=-1,this.m=this.g=null}function Rd(t){I(t.b,"TestConnection: starting stage 2");var e=t.a.I.a;if(null!=e)I(t.b,function(){return"Buffered"}),J(4),e?(J(10),Sd(t.a,t,!1)):(J(11),Sd(t.a,t,!0));else{t.c=new K(t,t.b,void 0,void 0),t.c.j=t.i;var n=Td(t.a,t.g,t.l);J(4),Xc(n,"TYPE","xmlhttp");var r=t.a.j,i=t.a.K;r&&i&&Q(n,r,i),Vc(t.c,n,!1,t.g)}}function Vd(){this.a=this.b=null}function S(){this.a=new N}function Wd(t){var e=typeof t;return"object"==e&&t||"function"==e?"o"+(t[q]||(t[q]=++ea)):e.charAt(0)+t}function Xd(t,e){this.a=t,this.b=e}function Yd(t){this.g=t||Zd,this.f=k.pa&&k.pa.Ka&&k.pa.Ka()&&k.pa.Ka().Db?this.g:1,this.a=null,1<this.f&&(this.a=new S),this.b=null,this.c=[]}u(Od,A),u(Pd,A),g=Qd.prototype,g.R=null,g.da=function(t){return this.a.da(t)},g.abort=function(){this.c&&(this.c.cancel(),this.c=null),this.f=-1},g.Ja=function(){return!1},g.Ma=function(t,e){if(this.f=t.C,0==this.R){if(I(this.b,"TestConnection: Got data for stage 1"),!this.a.D&&(t=t.a)){var n=t.a?t.a.getResponseHeader("X-Client-Wire-Protocol"):null;this.m=n||null,this.a.j&&((t=t.a?t.a.getResponseHeader("X-HTTP-Session-Id"):null)?this.a.K=t:E(this.b.a,"Missing X_HTTP_SESSION_ID in the handshake response"))}if(e){try{var r=this.a.ma.a.parse(e)}catch(t){return wc(this.b,t),void Ud(this.a,this)}this.g=r[0]}else I(this.b,"TestConnection: Null responseText"),Ud(this.a,this)}else 1==this.R&&(this.h?J(6):"11111"==e?(J(5),this.h=!0,(!z||10<=Number(Ua))&&(this.f=200,this.c.cancel(),I(this.b,"Test connection succeeded; using streaming connection"),J(11),Sd(this.a,this,!0))):(J(7),this.h=!1))},g.ua=function(){this.f=this.c.C,this.c.c?0==this.R?(this.R=1,I(this.b,"TestConnection: request complete for initial check"),Rd(this)):1==this.R&&(I(this.b,"TestConnection: request complete for stage 2"),this.h?(I(this.b,"Test connection succeeded; using streaming connection"),J(11),Sd(this.a,this,!0)):(I(this.b,"Test connection failed; not using streaming"),J(10),Sd(this.a,this,!1))):(I(this.b,"TestConnection: request failed, in state "+this.R),0==this.R?J(8):1==this.R&&J(9),Ud(this.a,this))},g.ia=function(){return this.a.ia()},g.ra=function(){return this.a.ra()},S.prototype.s=function(){return this.a.s()},S.prototype.add=function(t){this.a.set(Wd(t),t)},S.prototype.contains=function(t){return t=Wd(t),O(this.a.b,t)},S.prototype.v=function(){return this.a.v()};var Zd=10;function $d(t,e){t.a||-1==e.indexOf("spdy")&&-1==e.indexOf("quic")&&-1==e.indexOf("h2")||(t.f=t.g,t.a=new S,t.b&&(ae(t,t.b),t.b=null))}function be(t){return!!t.b||!!t.a&&t.a.s()>=t.f}function ce(t,e){return t.b?t.b==e:!!t.a&&t.a.contains(e)}function ae(t,e){t.a?t.a.add(e):t.b=e}function de(t,e){t.b&&t.b==e?t.b=null:t.a&&t.a.contains(e)&&kd(t.a.a,Wd(e))}function ee(t){if(null!=t.b)return t.c.concat(t.b.u);if(null!=t.a&&0!=t.a.a.c){var e=t.c;return ta(t.a.v(),function(t){e=e.concat(t.u)}),e}return ya(t.c)}function fe(t,e){t.c=t.c.concat(e)}function ge(){}function he(){this.a=new ge}function ie(t,e,n){var r=n||"";try{hd(t,function(t,n){var i=t;p(t)&&(i=Db(t)),e.push(r+n+"="+encodeURIComponent(i))})}catch(t){throw e.push(r+"type="+encodeURIComponent("_badmap")),t}}function je(t,e){var n=new qc;I(n,"TestLoadImage: loading "+t);var r=new Image;r.onload=ia(ke,n,r,"TestLoadImage: loaded",!0,e),r.onerror=ia(ke,n,r,"TestLoadImage: error",!1,e),r.onabort=ia(ke,n,r,"TestLoadImage: abort",!1,e),r.ontimeout=ia(ke,n,r,"TestLoadImage: timeout",!1,e),k.setTimeout(function(){r.ontimeout&&r.ontimeout()},1e4),r.src=t}function ke(t,e,n,r,i){try{I(t,n),e.onload=null,e.onerror=null,e.onabort=null,e.ontimeout=null,i(r)}catch(e){wc(t,e)}}function T(t){B.call(this),this.headers=new N,this.F=t||null,this.f=!1,this.D=this.a=null,this.M=this.u="",this.j=0,this.g="",this.h=this.J=this.o=this.I=!1,this.l=0,this.B=null,this.N=le,this.C=this.m=!1}Yd.prototype.cancel=function(){this.c=ee(this),this.b?(this.b.cancel(),this.b=null):this.a&&0!=this.a.a.c&&(ta(this.a.v(),function(t){t.cancel()}),jd(this.a.a))},ge.prototype.stringify=function(t){return k.JSON.stringify(t,void 0)},ge.prototype.parse=function(t){return k.JSON.parse(t,void 0)},u(T,B);var le="";T.prototype.b=oc("goog.net.XhrIo");var me=/^https?$/i,ne=["POST","PUT"];function qe(t){return z&&Ta(9)&&"number"==typeof t.timeout&&void 0!==t.ontimeout}function va(t){return"content-type"==t.toLowerCase()}function oe(t,e){t.f=!1,t.a&&(t.h=!0,t.a.abort(),t.h=!1),t.g=e,t.j=5,re(t),se(t)}function re(t){t.I||(t.I=!0,t.dispatchEvent("complete"),t.dispatchEvent("error"))}function te(t){if(t.f&&"undefined"!=typeof goog)if(t.D[1]&&4==M(t)&&2==t.W())F(t.b,U(t,"Local request error detected and ignored"));else if(t.o&&4==M(t))Zb(t.La,0,t);else if(t.dispatchEvent("readystatechange"),4==M(t)){F(t.b,U(t,"Request complete")),t.f=!1;try{var e,n=t.W();t:switch(n){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var r=!0;break t;default:r=!1}if(!(e=r)){var i;if(i=0===n){var o=String(t.u).match(ld)[1]||null;if(!o&&k.self&&k.self.location){var s=k.self.location.protocol;o=s.substr(0,s.length-1)}i=!me.test(o?o.toLowerCase():"")}e=i}e?(t.dispatchEvent("complete"),t.dispatchEvent("success")):(t.j=6,t.g=t.Ga()+" ["+t.W()+"]",re(t))}finally{se(t)}}}function se(t,e){if(t.a){pe(t);var n=t.a,r=t.D[0]?aa:null;t.a=null,t.D=null,e||t.dispatchEvent("ready");try{n.onreadystatechange=r}catch(e){(t=t.b)&&t.log(gc,"Problem encountered resetting onreadystatechange: "+e.message,void 0)}}}function pe(t){t.a&&t.C&&(t.a.ontimeout=null),t.B&&(k.clearTimeout(t.B),t.B=null)}function M(t){return t.a?t.a.readyState:0}function U(t,e){return e+" ["+t.M+" "+t.u+" "+t.W()+"]"}function ue(t){var e="";return Ba(t,function(t,n){e+=n,e+=":",e+=t,e+="\r\n"}),e}function ve(t,e,n){t:{for(r in n){var r=!1;break t}r=!0}if(r)return t;if(n=ue(n),l(t)){if(e=encodeURIComponent(String(e)),e+=n=null!=n?"="+encodeURIComponent(String(n)):""){if(0>(n=t.indexOf("#"))&&(n=t.length),0>(r=t.indexOf("?"))||r>n){r=n;var i=""}else i=t.substring(r+1,n);n=(t=[t.substr(0,r),i,t.substr(n)])[1],t[1]=e?n?n+"&"+e:e:n,t=t[0]+(t[1]?"?"+t[1]:"")+t[2]}return t}return Q(t,e,n),t}function we(t){this.ya=0,this.g=[],this.a=new qc,this.I=new Vd,this.ja=this.wa=this.F=this.ka=this.b=this.K=this.j=this.U=this.h=this.M=this.i=null,this.Ua=this.P=0,this.la=this.B=this.o=this.m=this.l=this.f=null,this.u=this.xa=this.N=-1,this.T=this.w=this.C=0,this.S=t&&t.supportsCrossDomainXhr||!1,this.J="",this.c=new Yd(t&&t.concurrentRequestLimit),this.ma=new he,this.D=!t||void 0===t.backgroundChannelTest||t.backgroundChannelTest,this.Ta=t&&t.fastHandshake||!1,t&&t.Ea&&this.a.Ea()}function xe(e){if(I(e.a,"disconnect()"),ye(e),3==e.G){var n=e.P++,r=L(e.F);Q(r,"SID",e.J),Q(r,"RID",n),Q(r,"TYPE","terminate"),ze(e,r),(n=new K(e,e.a,n,void 0)).K=2,n.h=Tc(L(r)),r=!1,k.navigator&&k.navigator.sendBeacon&&(r=k.navigator.sendBeacon(n.h.toString(),"")),!r&&k.Image&&((new Image).src=n.h,r=!0),r||(n.a=n.i.da(null),n.a.fa(n.h)),n.D=t(),Wc(n)}Ae(e)}function ye(t){t.B&&(t.B.abort(),t.B=null),t.b&&(t.b.cancel(),t.b=null),t.m&&(k.clearTimeout(t.m),t.m=null),Be(t),t.c.cancel(),t.l&&(k.clearTimeout(t.l),t.l=null)}function Ce(t,e){1e3==t.g.length&&xc(t.a,function(){return"Already have 1000 queued maps upon queueing "+Db(e)}),t.g.push(new Xd(t.Ua++,e)),3==t.G&&De(t)}function De(t){be(t.c)||t.l||(t.l=Ec(r(t.Oa,t),0),t.C=0)}function Ee(t,e){var n=t.c;return(n.b?1:n.a?n.a.s():0)>=t.c.f-(t.l?1:0)?(xc(t.a,"Unexpected retry request is scheduled."),!1):t.l?(I(t.a,"Use the retry request that is already scheduled."),t.g=e.u.concat(t.g),!0):!(1==t.G||2==t.G||2<=t.C||(I(t.a,"Going to retry POST"),t.l=Ec(r(t.Oa,t,e),Fe(t,t.C)),t.C++,0))}function He(t,e){var n;n=e?e.f:t.P++;var r=L(t.F);Q(r,"SID",t.J),Q(r,"RID",n),Q(r,"AID",t.N),ze(t,r),t.h&&t.i&&ve(r,t.h,t.i),n=new K(t,t.a,n,t.C+1),null===t.h&&(n.j=t.i),e&&(t.g=e.u.concat(t.g)),e=Ge(t,n),n.setTimeout(1e4+Math.round(1e4*Math.random())),ae(t.c,n),Sc(n,r,e)}function ze(t,e){t.f&&hd({},function(t,n){Q(e,n,t)})}function Ge(t,e){var n=Math.min(t.g.length,1e3),i=t.f?r(t.f.Va,t.f,t):null;t:for(var o=t.g,s=-1;;){var a=["count="+n];-1==s?0<n?a.push("ofs="+(s=o[0].a)):s=0:a.push("ofs="+s);for(var u=!0,l=0;l<n;l++){var c=o[l].a,h=o[l].b;if(0>(c-=s))s=Math.max(0,o[l].a-100),u=!1;else try{ie(h,a,"req"+c+"_")}catch(t){i&&i(h)}}if(u){i=a.join("&");break t}}return t=t.g.splice(0,n),e.u=t,i}function Ie(t){if(!t.b&&!t.m){t.T=1;var e=t.Na;Tb||Ub(),Wb||(Tb(),Wb=!0),Pb.add(e,t),t.w=0}}function Je(t){return t.b||t.m?(xc(t.a,"Request already in progress"),!1):!(3<=t.w||(I(t.a,"Going to retry GET"),t.T++,t.m=Ec(r(t.Na,t),Fe(t,t.w)),t.w++,0))}function Sd(t,e,n){I(t.a,"Test Connection Finished");var r=e.m;r&&$d(t.c,r),t.la=n,t.u=e.f,I(t.a,"connectChannel_()"),t.F=Ke(t,t.ka),De(t)}function Ud(t,e){I(t.a,"Test Connection Failed"),t.u=e.f,V(t,2)}function Be(t){null!=t.o&&(k.clearTimeout(t.o),t.o=null)}function Fe(t,e){var n=5e3+Math.floor(1e4*Math.random());return t.ra()||(I(t.a,"Inactive channel"),n*=2),n*e}function V(t,e){if(H(t.a,"Error code "+e),2==e){var n=null;t.f&&(n=null);var i=r(t.jb,t);n||(n=new P("//www.google.com/images/cleardot.gif"),k.location&&"http"==k.location.protocol||nd(n,"https"),Tc(n)),je(n.toString(),i)}else J(2);I(t.a,"HttpChannel: error - "+e),t.G=0,t.f&&t.f.Ba(e),Ae(t),ye(t)}function Ae(t){if(t.G=0,t.u=-1,t.f){var e=ee(t.c);0==e.length&&0==t.g.length||(I(t.a,function(){return"Number of undelivered maps, pending: "+e.length+", outgoing: "+t.g.length}),t.c.c.length=0,ya(t.g),t.g.length=0),t.f.Aa()}}function Ke(t,e){return e=Le(t,null,e),I(t.a,"GetForwardChannelUri: "+e),e}function Td(t,e,n){return e=Le(t,t.ia()?e:null,n),I(t.a,"GetBackChannelUri: "+e),e}function Le(t,e,n){var r=Cd(n);if(""!=r.b)e&&od(r,e+"."+r.b),pd(r,r.i);else{var i=k.location;r=Dd(i.protocol,e?e+"."+i.hostname:i.hostname,i.port,n)}return t.U&&Ba(t.U,function(t,e){Q(r,e,t)}),n=t.K,(e=t.j)&&n&&Q(r,e,n),Q(r,"VER",t.oa),ze(t,r),r}function Me(){}function Ne(t){for(var e=arguments[0],n=1;n<arguments.length;n++){var r,i=arguments[n];0==i.lastIndexOf("/",0)?e=i:((r=""==e)||(r=0<=(r=e.length-1)&&e.indexOf("/",r)==r),e+=r?i:"/"+i)}return e}function Oe(){if(z&&!(10<=Number(Ua)))throw Error("Environmental error: no available transport.")}function W(t,e){B.call(this),this.a=new we(e),this.b=t,this.m=e&&e.testUrl?e.testUrl:Ne(this.b,"test"),this.f=oc("goog.labs.net.webChannel.WebChannelBaseTransport"),this.g=e&&e.messageUrlParams||null,t=e&&e.messageHeaders||null,e&&e.clientProtocolHeaderRequired&&(t?t["X-Client-Protocol"]="webchannel":t={"X-Client-Protocol":"webchannel"}),this.a.i=t,t=e&&e.initMessageHeaders||null,e&&e.messageContentType&&(t?t["X-WebChannel-Content-Type"]=e.messageContentType:t={"X-WebChannel-Content-Type":e.messageContentType}),this.a.M=t,(t=e&&e.httpHeadersOverwriteParam)&&!/^[\s\xa0]*$/.test(t)&&(this.a.h=t),this.l=e&&e.supportsCrossDomainXhr||!1,this.j=e&&e.sendRawJson||!1,(e=e&&e.httpSessionIdParam)&&!/^[\s\xa0]*$/.test(e)&&(this.a.j=e,null!==(t=this.g)&&e in t&&(e in(t=this.g)&&delete t[e],E(this.f,"Ignore httpSessionIdParam also specified with messageUrlParams: "+e))),this.h=new Pe(this)}function Qe(t){Od.call(this);var e=t.__sm__;if(e){t:{for(var n in e){t=n;break t}t=void 0}(this.c=t)?(t=this.c,this.data=null!==e&&t in e?e[t]:void 0):this.data=e}else this.data=t}function Re(){Pd.call(this),this.status=1}function Pe(t){this.a=t}g=T.prototype,g.fa=function(t,e,n,i){if(this.a)throw Error("[goog.net.XhrIo] Object is active with another request="+this.u+"; newUri="+t);e=e?e.toUpperCase():"GET",this.u=t,this.g="",this.j=0,this.M=e,this.I=!1,this.f=!0,this.a=Mc(this.F?this.F:Kc),this.D=Ic(this.F?this.F:Kc),this.a.onreadystatechange=r(this.La,this);try{F(this.b,U(this,"Opening Xhr")),this.J=!0,this.a.open(e,String(t),!0),this.J=!1}catch(t){return F(this.b,U(this,"Error opening Xhr: "+t.message)),void oe(this,t)}t=n||"";var o=new N(this.headers);i&&hd(i,function(t,e){o.set(e,t)}),i=ua(o.O()),n=k.FormData&&t instanceof k.FormData,!(0<=sa(ne,e))||i||n||o.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8"),o.forEach(function(t,e){this.a.setRequestHeader(e,t)},this),this.N&&(this.a.responseType=this.N),"withCredentials"in this.a&&this.a.withCredentials!==this.m&&(this.a.withCredentials=this.m);try{pe(this),0<this.l&&(this.C=qe(this.a),F(this.b,U(this,"Will abort after "+this.l+"ms if incomplete, xhr2 "+this.C)),this.C?(this.a.timeout=this.l,this.a.ontimeout=r(this.Ia,this)):this.B=Zb(this.Ia,this.l,this)),F(this.b,U(this,"Sending request")),this.o=!0,this.a.send(t),this.o=!1}catch(t){F(this.b,U(this,"Send error: "+t.message)),oe(this,t)}},g.Ia=function(){"undefined"!=typeof goog&&this.a&&(this.g="Timed out after "+this.l+"ms, aborting",this.j=8,F(this.b,U(this,this.g)),this.dispatchEvent("timeout"),this.abort(8))},g.abort=function(t){this.a&&this.f&&(F(this.b,U(this,"Aborting")),this.f=!1,this.h=!0,this.a.abort(),this.h=!1,this.j=t||7,this.dispatchEvent("complete"),this.dispatchEvent("abort"),se(this))},g.A=function(){this.a&&(this.f&&(this.f=!1,this.h=!0,this.a.abort(),this.h=!1),se(this,!0)),T.H.A.call(this)},g.La=function(){this.i||(this.J||this.o||this.h?te(this):this.cb())},g.cb=function(){te(this)},g.W=function(){try{return 2<M(this)?this.a.status:-1}catch(t){return-1}},g.Ga=function(){try{return 2<M(this)?this.a.statusText:""}catch(t){return F(this.b,"Can not get status: "+t.message),""}},g.V=function(){try{return this.a?this.a.responseText:""}catch(t){return F(this.b,"Can not get responseText: "+t.message),""}},g.Ya=function(t){if(this.a){var e=this.a.responseText;t&&0==e.indexOf(t)&&(e=e.substring(t.length));t:{if(t=e,k.JSON)try{var n=k.JSON.parse(t);break t}catch(t){}n=Cb(t)}return n}},g.Fa=function(){return this.j},g.ab=function(){return l(this.g)?this.g:String(this.g)},g=we.prototype,g.oa=8,g.G=1,g.Ja=function(){return 0==this.G},g.Oa=function(t){if(this.l=null,I(this.a,"startForwardChannel_"),1==this.G)if(t)xc(this.a,"Not supposed to retry the open");else{I(this.a,"open_()"),this.P=Math.floor(1e5*Math.random()),t=this.P++;var e=new K(this,this.a,t,void 0),n=this.i;this.M&&(n?Ga(n=Ea(n),this.M):n=this.M),null===this.h&&(e.j=n);var r=Ge(this,e),i=L(this.F);Q(i,"RID",t),Q(i,"CVER",21),this.D&&this.j&&Q(i,"X-HTTP-Session-Id",this.j),ze(this,i),this.h&&n&&ve(i,this.h,n),ae(this.c,e),this.Ta?(Q(i,"$req",r),Sc(e,i,null)):Sc(e,i,r),this.G=2}else 3==this.G&&(t?He(this,t):0==this.g.length?I(this.a,"startForwardChannel_ returned: nothing to send"):be(this.c)?xc(this.a,"startForwardChannel_ returned: connection already in progress"):(He(this),I(this.a,"startForwardChannel_ finished, sent request")))},g.Na=function(){this.m=null,I(this.a,"Creating new HttpRequest"),this.b=new K(this,this.a,"rpc",this.T),null===this.h&&(this.b.j=this.i),this.b.P=0;var t=L(this.wa);Q(t,"RID","rpc"),Q(t,"SID",this.J),Q(t,"CI",this.la?"0":"1"),Q(t,"AID",this.N),ze(this,t),Q(t,"TYPE","xmlhttp"),this.h&&this.i&&ve(t,this.h,this.i),Vc(this.b,t,!0,this.ja),I(this.a,"New Request created")},g.Ma=function(t,e){if(0!=this.G&&(this.b==t||ce(this.c,t)))if(this.u=t.C,ce(this.c,t)&&3==this.G){try{var i=this.ma.a.parse(e)}catch(t){i=null}if(n(i)&&3==i.length)if(0==(e=i)[0])t:if(I(this.a,"Server claims our backchannel is missing."),this.m)I(this.a,"But we are currently starting the request.");else{if(this.b){if(!(this.b.D+3e3<t.D))break t;Be(this),this.b.cancel(),this.b=null}else E(this.a.a,"We do not have a BackChannel established");Je(this),J(18)}else this.xa=e[1],0<(t=this.xa-this.N)&&(I(this.a,(e=e[2])+" bytes (in "+t+" arrays) are outstanding on the BackChannel"),37500>e&&this.la&&0==this.w&&!this.o&&(this.o=Ec(r(this.bb,this),6e3)));else I(this.a,"Bad POST response data returned"),V(this,11)}else if(this.b==t&&Be(this),!/^[\s\xa0]*$/.test(e))for(e=i=this.ma.a.parse(e),i=0;i<e.length;i++){var o=e[i];if(this.N=o[0],o=o[1],2==this.G)if("c"==o[0]){this.J=o[1],this.ja=o[2];var s=o[3];null!=s&&(this.oa=s,H(this.a,"VER="+this.oa)),null!=(o=o[4])&&(this.ya=o,H(this.a,"SVER="+this.ya)),this.D&&(o=t.a)&&((s=o.a?o.a.getResponseHeader("X-Client-Wire-Protocol"):null)&&$d(this.c,s),this.j&&((o=o.a?o.a.getResponseHeader("X-HTTP-Session-Id"):null)?(this.K=o,Q(this.F,this.j,o)):E(this.a.a,"Missing X_HTTP_SESSION_ID in the handshake response"))),this.G=3,this.f&&this.f.Da(),this.wa=Td(this,this.ja,this.ka),Ie(this)}else"stop"!=o[0]&&"close"!=o[0]||V(this,7);else 3==this.G&&("stop"==o[0]||"close"==o[0]?"stop"==o[0]?V(this,7):xe(this):"noop"!=o[0]&&this.f&&this.f.Ca(o),this.w=0)}},g.bb=function(){null!=this.o&&(this.o=null,this.b.cancel(),this.b=null,Je(this),J(19))},g.ua=function(e){I(this.a,"Request complete");var n=null;if(this.b==e){Be(this),this.b=null;var r=2}else{if(!ce(this.c,e))return;n=e.u,de(this.c,e),r=1}if(this.u=e.C,0!=this.G)if(e.c)1==r?(Dc(e.m?e.m.length:0,t()-e.D,this.C),De(this)):Ie(this);else{var i=e.l;if(3==i||0==i&&0<this.u)I(this.a,"Not retrying due to error type");else{var o=this;if(I(this.a,function(){return"Maybe retrying, last error: "+Pc(i,o.u)}),1==r&&Ee(this,e)||2==r&&Je(this))return;I(this.a,"Exceeded max number of retries")}switch(n&&0<n.length&&fe(this.c,n),I(this.a,"Error: HTTP request failed"),i){case 1:V(this,5);break;case 4:V(this,10);break;case 3:V(this,6);break;default:V(this,2)}}},g.jb=function(t){t?(H(this.a,"Successfully pinged google.com"),J(2)):(H(this.a,"Failed to ping google.com"),J(1))},g.da=function(t){if(t&&!this.S)throw Error("Can't create secondary domain capable XhrIo object.");return(t=new T).m=this.S,t},g.ra=function(){return!!this.f&&!0},g.ia=function(){return this.S},new Ld,g=Me.prototype,g.Da=function(){},g.Ca=function(){},g.Ba=function(){},g.Aa=function(){},g.Va=function(){},Oe.prototype.a=function(t,e){return new W(t,e)},u(W,B),g=W.prototype,g.addEventListener=function(t,e,n,r){W.H.addEventListener.call(this,t,e,n,r)},g.removeEventListener=function(t,e,n,r){W.H.removeEventListener.call(this,t,e,n,r)},g.Za=function(){this.a.f=this.h,this.l&&(this.a.S=!0);var t=this.a,e=this.m,n=this.b,r=this.g||void 0;I(t.a,"connect()"),J(0),t.ka=n,t.U=r||{},t.D&&(I(t.a,"connect() bypassed channel-test."),t.I.b=[],t.I.a=!1),I(t.a,"connectTest_()"),t.B=new Qd(t,t.a),null===t.h&&(t.B.i=t.i),n=e,t.h&&t.i&&(n=ve(e,t.h,t.i)),(t=t.B).l=n,e=Ke(t.a,t.l),J(3),null!=(n=t.a.I.b)?(t.g=n[0],t.R=1,Rd(t)):(Xc(e,"MODE","init"),!t.a.D&&t.a.j&&Xc(e,"X-HTTP-Session-Id",t.a.j),t.c=new K(t,t.b,void 0,void 0),t.c.j=t.i,Vc(t.c,e,!1,null),t.R=0)},g.close=function(){xe(this.a)},g.$a=function(t){if(l(t)){var e={};e.__data__=t,Ce(this.a,e)}else this.j?((e={}).__data__=Db(t),Ce(this.a,e)):Ce(this.a,t)},g.A=function(){this.a.f=null,delete this.h,xe(this.a),delete this.a,W.H.A.call(this)},u(Qe,Od),u(Re,Pd),u(Pe,Me),Pe.prototype.Da=function(){pc(this.a.f,"WebChannel opened on "+this.a.b),this.a.dispatchEvent("a")},Pe.prototype.Ca=function(t){this.a.dispatchEvent(new Qe(t))},Pe.prototype.Ba=function(t){pc(this.a.f,"WebChannel aborted on "+this.a.b+" due to channel error: "+t),this.a.dispatchEvent(new Re(t))},Pe.prototype.Aa=function(){pc(this.a.f,"WebChannel closed on "+this.a.b),this.a.dispatchEvent("b")};var Se=ia(function(t,e){function n(){}n.prototype=t.prototype;var r=new n;return t.apply(r,Array.prototype.slice.call(arguments,1)),r},Oe);function Te(){this.b=[],this.a=[]}function Ue(t){return 0==t.b.length&&(t.b=t.a,t.b.reverse(),t.a=[]),t.b.pop()}function Ve(t,e){if(w.call(this),this.h=t||0,this.c=e||10,this.h>this.c)throw Error(We);this.a=new Te,this.b=new S,this.g=null,this.ba()}Te.prototype.s=function(){return this.b.length+this.a.length},Te.prototype.contains=function(t){return 0<=sa(this.b,t)||0<=sa(this.a,t)},Te.prototype.v=function(){for(var t=[],e=this.b.length-1;0<=e;--e)t.push(this.b[e]);var n=this.a.length;for(e=0;e<n;++e)t.push(this.a[e]);return t},u(Ve,w);var We="[goog.structs.Pool] Min can not be greater than max";function Xe(t){if("function"==typeof t.Z)t.Z();else for(var e in t)t[e]=null}function Ye(t,e){this.a=t,this.b=e}function Ze(t){if(this.a=[],t)t:{if(t instanceof Ze){var e=t.O();if(t=t.v(),0>=this.s()){for(var n=this.a,r=0;r<e.length;r++)n.push(new Ye(e[r],t[r]));break t}}else e=Da(t),t=Ca(t);for(r=0;r<e.length;r++)$e(this,e[r],t[r])}}function $e(t,e,n){var r=t.a;for(r.push(new Ye(e,n)),n=(t=t.a)[e=r.length-1];0<e&&t[r=e-1>>1].a>n.a;)t[e]=t[r],e=r;t[e]=n}function af(){Ze.call(this)}function X(t,e){this.f=new af,Ve.call(this,t,e)}function Y(t,e,n,r){this.l=t,this.j=!!r,X.call(this,e,n)}g=Ve.prototype,g.ea=function(){var e=t();if(!(null!=this.g&&0>e-this.g)){for(var n;0<this.a.s()&&(n=Ue(this.a),!this.ta(n));)this.ba();return!n&&this.s()<this.c&&(n=this.qa()),n&&(this.g=e,this.b.add(n)),n}},g.ib=function(t){return!!kd(this.b.a,Wd(t))&&(this.na(t),!0)},g.na=function(t){kd(this.b.a,Wd(t)),this.ta(t)&&this.s()<this.c?this.a.a.push(t):Xe(t)},g.ba=function(){for(var t=this.a;this.s()<this.h;){var e=this.qa();t.a.push(e)}for(;this.s()>this.c&&0<this.a.s();)Xe(Ue(t))},g.qa=function(){return{}},g.ta=function(t){return"function"!=typeof t.Wa||t.Wa()},g.contains=function(t){return this.a.contains(t)||this.b.contains(t)},g.s=function(){return this.a.s()+this.b.s()},g.A=function(){if(Ve.H.A.call(this),0<this.b.s())throw Error("[goog.structs.Pool] Objects not released");delete this.b;for(var t=this.a;0!=t.b.length||0!=t.a.length;)Xe(Ue(t));delete this.a},Ze.prototype.v=function(){for(var t=this.a,e=[],n=t.length,r=0;r<n;r++)e.push(t[r].b);return e},Ze.prototype.O=function(){for(var t=this.a,e=[],n=t.length,r=0;r<n;r++)e.push(t[r].a);return e},Ze.prototype.s=function(){return this.a.length},u(af,Ze),u(X,Ve),g=X.prototype,g.ea=function(t,e){if(!t)return X.H.ea.call(this);$e(this.f,void 0!==e?e:100,t),this.sa()},g.sa=function(){for(var t=this.f;0<t.s();){var e=this.ea();if(!e)break;var n=t,r=n.a,i=r.length,o=r[0];if(0>=i)o=void 0;else{if(1==i)wa(r);else{r[0]=r.pop(),i=(n=n.a).length;for(var s=n[r=0];r<i>>1;){var a=2*r+1,u=2*r+2;if(n[a=u<i&&n[u].a<n[a].a?u:a].a>s.a)break;n[r]=n[a],r=a}n[r]=s}o=o.b}o.apply(this,[e])}},g.na=function(t){X.H.na.call(this,t),this.sa()},g.ba=function(){X.H.ba.call(this),this.sa()},g.A=function(){X.H.A.call(this),k.clearTimeout(void 0),wa(this.f.a),this.f=null},u(Y,X),Y.prototype.qa=function(){var t=new T,e=this.l;return e&&e.forEach(function(e,n){t.headers.set(n,e)}),this.j&&(t.m=!0),t},Y.prototype.ta=function(t){return!t.i&&!t.a},Oe.prototype.createWebChannel=Oe.prototype.a,W.prototype.send=W.prototype.$a,W.prototype.open=W.prototype.Za,W.prototype.close=W.prototype.close,Fc.NO_ERROR=0,Fc.TIMEOUT=8,Fc.HTTP_ERROR=6,Gc.COMPLETE="complete",Md.EventType=Nd,Nd.OPEN="a",Nd.CLOSE="b",Nd.ERROR="c",Nd.MESSAGE="d",B.prototype.listen=B.prototype.aa,Y.prototype.getObject=Y.prototype.ea,Y.prototype.releaseObject=Y.prototype.ib,T.prototype.listenOnce=T.prototype.Ha,T.prototype.getLastError=T.prototype.ab,T.prototype.getLastErrorCode=T.prototype.Fa,T.prototype.getStatus=T.prototype.W,T.prototype.getStatusText=T.prototype.Ga,T.prototype.getResponseJson=T.prototype.Ya,T.prototype.getResponseText=T.prototype.V,T.prototype.getResponseText=T.prototype.V,T.prototype.send=T.prototype.fa,module.exports={createWebChannelTransport:Se,ErrorCode:Fc,EventType:Gc,WebChannel:Md,XhrIoPool:Y}}).call("undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})}).call(exports,__webpack_require__("fRUx"))},TO51:function(t,e,n){"use strict";n.d(e,"b",function(){return c}),n.d(e,"a",function(){return h});var r=n("6Xbx"),i=n("AP4T"),o=n("E9/g"),s=n("qLnt"),a=n("Upor"),u=n("jaVc"),l=n("V7AE"),c=function(t){function e(e){t.call(this,e),this.destination=e}return Object(r.__extends)(e,t),e}(o.a),h=function(t){function e(){t.call(this),this.observers=[],this.closed=!1,this.isStopped=!1,this.hasError=!1,this.thrownError=null}return Object(r.__extends)(e,t),e.prototype[l.a]=function(){return new c(this)},e.prototype.lift=function(t){var e=new f(this,this);return e.operator=t,e},e.prototype.next=function(t){if(this.closed)throw new a.a;if(!this.isStopped)for(var e=this.observers,n=e.length,r=e.slice(),i=0;i<n;i++)r[i].next(t)},e.prototype.error=function(t){if(this.closed)throw new a.a;this.hasError=!0,this.thrownError=t,this.isStopped=!0;for(var e=this.observers,n=e.length,r=e.slice(),i=0;i<n;i++)r[i].error(t);this.observers.length=0},e.prototype.complete=function(){if(this.closed)throw new a.a;this.isStopped=!0;for(var t=this.observers,e=t.length,n=t.slice(),r=0;r<e;r++)n[r].complete();this.observers.length=0},e.prototype.unsubscribe=function(){this.isStopped=!0,this.closed=!0,this.observers=null},e.prototype._trySubscribe=function(e){if(this.closed)throw new a.a;return t.prototype._trySubscribe.call(this,e)},e.prototype._subscribe=function(t){if(this.closed)throw new a.a;return this.hasError?(t.error(this.thrownError),s.a.EMPTY):this.isStopped?(t.complete(),s.a.EMPTY):(this.observers.push(t),new u.a(this,t))},e.prototype.asObservable=function(){var t=new i.a;return t.source=this,t},e.create=function(t,e){return new f(t,e)},e}(i.a),f=function(t){function e(e,n){t.call(this),this.destination=e,this.source=n}return Object(r.__extends)(e,t),e.prototype.next=function(t){var e=this.destination;e&&e.next&&e.next(t)},e.prototype.error=function(t){var e=this.destination;e&&e.error&&this.destination.error(t)},e.prototype.complete=function(){var t=this.destination;t&&t.complete&&this.destination.complete()},e.prototype._subscribe=function(t){return this.source?this.source.subscribe(t):s.a.EMPTY},e}(h)},Tmcl:function(t,e,n){"use strict";function r(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 new Error("errorPrefix called with argumentNumber > 4.  Need to update it?")}return t+" failed: "+r+" argument "}Object.defineProperty(e,"__esModule",{value:!0}),e.validateArgCount=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)throw new Error(t+" failed: Was called with "+r+(1===r?" argument.":" arguments.")+" Expects "+i+".")},e.errorPrefix=r,e.validateNamespace=function(t,e,n,i){if((!i||n)&&"string"!=typeof n)throw new Error(r(t,e,i)+"must be a valid firebase namespace.")},e.validateCallback=function(t,e,n,i){if((!i||n)&&"function"!=typeof n)throw new Error(r(t,e,i)+"must be a valid function.")},e.validateContextObject=function(t,e,n,i){if((!i||n)&&("object"!=typeof n||null===n))throw new Error(r(t,e,i)+"must be a valid context object.")}},U4XL:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n("/byE");e.getUA=function(){return"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:""},e.isMobileCordova=function(){return"undefined"!=typeof window&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(e.getUA())},e.isReactNative=function(){return"object"==typeof navigator&&"ReactNative"===navigator.product},e.isNodeSdk=function(){return!0===r.CONSTANTS.NODE_CLIENT||!0===r.CONSTANTS.NODE_ADMIN}},URbD:function(t,e,n){"use strict";var r=n("6Xbx"),i=n("TO51"),o=n("AP4T"),s=n("E9/g"),a=n("qLnt");function u(){return function(t){return t.lift(new l(t))}}var l=function(){function t(t){this.connectable=t}return t.prototype.call=function(t,e){var n=this.connectable;n._refCount++;var r=new c(t,n),i=e.subscribe(r);return r.closed||(r.connection=n.connect()),i},t}(),c=function(t){function e(e,n){t.call(this,e),this.connectable=n}return Object(r.__extends)(e,t),e.prototype._unsubscribe=function(){var t=this.connectable;if(t){this.connectable=null;var e=t._refCount;if(e<=0)this.connection=null;else if(t._refCount=e-1,e>1)this.connection=null;else{var n=this.connection,r=t._connection;this.connection=null,!r||n&&r!==n||r.unsubscribe()}}else this.connection=null},e}(s.a),h=function(t){function e(e,n){t.call(this),this.source=e,this.subjectFactory=n,this._refCount=0,this._isComplete=!1}return Object(r.__extends)(e,t),e.prototype._subscribe=function(t){return this.getSubject().subscribe(t)},e.prototype.getSubject=function(){var t=this._subject;return t&&!t.isStopped||(this._subject=this.subjectFactory()),this._subject},e.prototype.connect=function(){var t=this._connection;return t||(this._isComplete=!1,(t=this._connection=new a.a).add(this.source.subscribe(new p(this.getSubject(),this))),t.closed?(this._connection=null,t=a.a.EMPTY):this._connection=t),t},e.prototype.refCount=function(){return u()(this)},e}(o.a).prototype,f={operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:h._subscribe},_isComplete:{value:h._isComplete,writable:!0},getSubject:{value:h.getSubject},connect:{value:h.connect},refCount:{value:h.refCount}},p=function(t){function e(e,n){t.call(this,e),this.connectable=n}return Object(r.__extends)(e,t),e.prototype._error=function(e){this._unsubscribe(),t.prototype._error.call(this,e)},e.prototype._complete=function(){this.connectable._isComplete=!0,this._unsubscribe(),t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){var t=this.connectable;if(t){this.connectable=null;var e=t._connection;t._refCount=0,t._subject=null,t._connection=null,e&&e.unsubscribe()}},e}(i.b);function d(){return new i.a}e.a=function(){return this,u()((t=d,function(e){var n;n="function"==typeof t?t:function(){return t};var r=Object.create(e,f);return r.source=e,r.subjectFactory=n,r})(this));var t}},Upor:function(t,e,n){"use strict";n.d(e,"a",function(){return i});var r=n("6Xbx"),i=function(t){function e(){var e=t.call(this,"object unsubscribed");this.name=e.name="ObjectUnsubscribedError",this.stack=e.stack,this.message=e.message}return Object(r.__extends)(e,t),e}(Error)},V7AE:function(t,e,n){"use strict";n.d(e,"a",function(){return i});var r=n("xIGM").a.Symbol,i="function"==typeof r&&"function"==typeof r.for?r.for("rxSubscriber"):"@@rxSubscriber"},WH8D:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.jsonEval=function(t){return JSON.parse(t)},e.stringify=function(t){return JSON.stringify(t)}},X3fp:function(t,e,n){"use strict";n.d(e,"a",function(){return r});var r=function(t){var e=t.Symbol;if("function"==typeof e)return e.iterator||(e.iterator=e("iterator polyfill")),e.iterator;var n=t.Set;if(n&&"function"==typeof(new n)["@@iterator"])return"@@iterator";var r=t.Map;if(r)for(var i=Object.getOwnPropertyNames(r.prototype),o=0;o<i.length;++o){var s=i[o];if("entries"!==s&&"size"!==s&&r.prototype[s]===r.prototype.entries)return s}return"@@iterator"}(n("xIGM").a)},Xp63:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createSubscribe=function(t,e){var n=new r(t,e);return n.subscribe.bind(n)};var r=function(){function t(t,e){var n=this;this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=e,this.task.then(function(){t(n)}).catch(function(t){n.error(t)})}return t.prototype.next=function(t){this.forEachObserver(function(e){e.next(t)})},t.prototype.error=function(t){this.forEachObserver(function(e){e.error(t)}),this.close(t)},t.prototype.complete=function(){this.forEachObserver(function(t){t.complete()}),this.close()},t.prototype.subscribe=function(t,e,n){var r,o=this;if(void 0===t&&void 0===e&&void 0===n)throw new Error("Missing Observer.");void 0===(r=function(t,e){if("object"!=typeof t||null===t)return!1;for(var n=0,r=["next","error","complete"];n<r.length;n++){var i=r[n];if(i in t&&"function"==typeof t[i])return!0}return!1}(t)?t:{next:t,error:e,complete:n}).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{o.finalError?r.error(o.finalError):r.complete()}catch(t){}}),this.observers.push(r),s},t.prototype.unsubscribeOne=function(t){void 0!==this.observers&&void 0!==this.observers[t]&&(delete this.observers[t],this.observerCount-=1,0===this.observerCount&&void 0!==this.onNoObservers&&this.onNoObservers(this))},t.prototype.forEachObserver=function(t){if(!this.finalized)for(var e=0;e<this.observers.length;e++)this.sendOne(e,t)},t.prototype.sendOne=function(t,e){var n=this;this.task.then(function(){if(void 0!==n.observers&&void 0!==n.observers[t])try{e(n.observers[t])}catch(t){"undefined"!=typeof console&&console.error&&console.error(t)}})},t.prototype.close=function(t){var e=this;this.finalized||(this.finalized=!0,void 0!==t&&(this.finalError=t),this.task.then(function(){e.observers=void 0,e.onNoObservers=void 0}))},t}();function i(){}e.async=function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];Promise.resolve(!0).then(function(){t.apply(void 0,n)}).catch(function(t){e&&e(t)})}}},Y3Bq:function(t,e){!function(){"use strict";var e="undefined"!=typeof window&&"undefined"!=typeof window.document?window.document:{},n="undefined"!=typeof t&&t.exports,r="undefined"!=typeof Element&&"ALLOW_KEYBOARD_INPUT"in Element,i=function(){for(var t,n=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],r=0,i=n.length,o={};r<i;r++)if((t=n[r])&&t[1]in e){for(r=0;r<t.length;r++)o[n[0][r]]=t[r];return o}return!1}(),o={change:i.fullscreenchange,error:i.fullscreenerror},s={request:function(t){var n=i.requestFullscreen;t=t||e.documentElement,/ Version\/5\.1(?:\.\d+)? Safari\//.test(navigator.userAgent)?t[n]():t[n](r&&Element.ALLOW_KEYBOARD_INPUT)},exit:function(){e[i.exitFullscreen]()},toggle:function(t){this.isFullscreen?this.exit():this.request(t)},onchange:function(t){this.on("change",t)},onerror:function(t){this.on("error",t)},on:function(t,n){var r=o[t];r&&e.addEventListener(r,n,!1)},off:function(t,n){var r=o[t];r&&e.removeEventListener(r,n,!1)},raw:i};i?(Object.defineProperties(s,{isFullscreen:{get:function(){return Boolean(e[i.fullscreenElement])}},element:{enumerable:!0,get:function(){return e[i.fullscreenElement]}},enabled:{enumerable:!0,get:function(){return Boolean(e[i.fullscreenEnabled])}}}),n?t.exports=s:window.screenfull=s):n?t.exports=!1:window.screenfull=!1}()},YuZA:function(t,e){function n(t){return Promise.resolve().then(function(){throw new Error("Cannot find module '"+t+"'.")})}n.keys=function(){return[]},n.resolve=n,t.exports=n,n.id="YuZA"},bywS:function(t,e,n){"use strict";var r=n("wP3s");function i(t){return t}e.a=function(t){return void 0===t&&(t=Number.POSITIVE_INFINITY),Object(r.a)(i,null,t)}},cDNt:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n("LMZF"),i=n("6Xbx"),o=n("AP4T"),s=n("Ecq+"),a=n("1j/l"),u=n("qgI0"),l=n("lI6h"),c=function(t){function e(e,n){t.call(this),this.sources=e,this.resultSelector=n}return Object(i.__extends)(e,t),e.create=function(){for(var t=[],n=0;n<arguments.length;n++)t[n-0]=arguments[n];if(null===t||0===arguments.length)return new s.a;var r=null;return"function"==typeof t[t.length-1]&&(r=t.pop()),1===t.length&&Object(a.a)(t[0])&&(t=t[0]),0===t.length?new s.a:new e(t,r)},e.prototype._subscribe=function(t){return new h(t,this.sources,this.resultSelector)},e}(o.a),h=function(t){function e(e,n,r){t.call(this,e),this.sources=n,this.resultSelector=r,this.completed=0,this.haveValues=0;var i=n.length;this.total=i,this.values=new Array(i);for(var o=0;o<i;o++){var s=n[o],a=Object(u.a)(this,s,null,o);a&&(a.outerIndex=o,this.add(a))}}return Object(i.__extends)(e,t),e.prototype.notifyNext=function(t,e,n,r,i){this.values[n]=e,i._hasValue||(i._hasValue=!0,this.haveValues++)},e.prototype.notifyComplete=function(t){var e=this.destination,n=this.haveValues,r=this.resultSelector,i=this.values,o=i.length;if(t._hasValue){if(this.completed++,this.completed===o){if(n===o){var s=r?r.apply(this,i):i;e.next(s)}e.complete()}}else e.complete()},e}(l.a),f=c.create,p=n("xIGM"),d=function(t){function e(e,n){t.call(this),this.promise=e,this.scheduler=n}return Object(i.__extends)(e,t),e.create=function(t,n){return new e(t,n)},e.prototype._subscribe=function(t){var e=this,n=this.promise,r=this.scheduler;if(null==r)this._isScalar?t.closed||(t.next(this.value),t.complete()):n.then(function(n){e.value=n,e._isScalar=!0,t.closed||(t.next(n),t.complete())},function(e){t.closed||t.error(e)}).then(null,function(t){p.a.setTimeout(function(){throw t})});else if(this._isScalar){if(!t.closed)return r.schedule(y,0,{value:this.value,subscriber:t})}else n.then(function(n){e.value=n,e._isScalar=!0,t.closed||t.add(r.schedule(y,0,{value:n,subscriber:t}))},function(e){t.closed||t.add(r.schedule(m,0,{err:e,subscriber:t}))}).then(null,function(t){p.a.setTimeout(function(){throw t})})},e}(o.a);function y(t){var e=t.subscriber;e.closed||(e.next(t.value),e.complete())}function m(t){var e=t.subscriber;e.closed||e.error(t.err)}var g=d.create,v=n("E9/g"),_=function(){function t(t,e){this.project=t,this.thisArg=e}return t.prototype.call=function(t,e){return e.subscribe(new b(t,this.project,this.thisArg))},t}(),b=function(t){function e(e,n,r){t.call(this,e),this.project=n,this.count=0,this.thisArg=r||this}return Object(i.__extends)(e,t),e.prototype._next=function(t){var e;try{e=this.project.call(this.thisArg,t,this.count++)}catch(t){return void this.destination.error(t)}this.destination.next(e)},e}(v.a);function w(t,e){return function(t,e){return function(n){if("function"!=typeof t)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return n.lift(new _(t,e))}}(t,e)(this)}var E=function(){},S=new r.o("Location Initialized"),C=function(){},T=new r.o("appBaseHref"),I=function(){function t(e){var n=this;this._subject=new r.m,this._platformStrategy=e;var i=this._platformStrategy.getBaseHref();this._baseHref=t.stripTrailingSlash(k(i)),this._platformStrategy.onPopState(function(t){n._subject.emit({url:n.path(!0),pop:!0,type:t.type})})}return t.prototype.path=function(t){return void 0===t&&(t=!1),this.normalize(this._platformStrategy.path(t))},t.prototype.isCurrentPathEqualTo=function(e,n){return void 0===n&&(n=""),this.path()==this.normalize(e+t.normalizeQueryParams(n))},t.prototype.normalize=function(e){return t.stripTrailingSlash(function(t,e){return t&&e.startsWith(t)?e.substring(t.length):e}(this._baseHref,k(e)))},t.prototype.prepareExternalUrl=function(t){return t&&"/"!==t[0]&&(t="/"+t),this._platformStrategy.prepareExternalUrl(t)},t.prototype.go=function(t,e){void 0===e&&(e=""),this._platformStrategy.pushState(null,"",t,e)},t.prototype.replaceState=function(t,e){void 0===e&&(e=""),this._platformStrategy.replaceState(null,"",t,e)},t.prototype.forward=function(){this._platformStrategy.forward()},t.prototype.back=function(){this._platformStrategy.back()},t.prototype.subscribe=function(t,e,n){return this._subject.subscribe({next:t,error:e,complete:n})},t.normalizeQueryParams=function(t){return t&&"?"!==t[0]?"?"+t:t},t.joinWithSlash=function(t,e){if(0==t.length)return e;if(0==e.length)return t;var n=0;return t.endsWith("/")&&n++,e.startsWith("/")&&n++,2==n?t+e.substring(1):1==n?t+e:t+"/"+e},t.stripTrailingSlash=function(t){var e=t.match(/#|\?|$/),n=e&&e.index||t.length;return t.slice(0,n-("/"===t[n-1]?1:0))+t.slice(n)},t}();function k(t){return t.replace(/\/index.html$/,"")}var x=function(t){function e(e,n){var r=t.call(this)||this;return r._platformLocation=e,r._baseHref="",null!=n&&(r._baseHref=n),r}return Object(i.__extends)(e,t),e.prototype.onPopState=function(t){this._platformLocation.onPopState(t),this._platformLocation.onHashChange(t)},e.prototype.getBaseHref=function(){return this._baseHref},e.prototype.path=function(t){void 0===t&&(t=!1);var e=this._platformLocation.hash;return null==e&&(e="#"),e.length>0?e.substring(1):e},e.prototype.prepareExternalUrl=function(t){var e=I.joinWithSlash(this._baseHref,t);return e.length>0?"#"+e:e},e.prototype.pushState=function(t,e,n,r){var i=this.prepareExternalUrl(n+I.normalizeQueryParams(r));0==i.length&&(i=this._platformLocation.pathname),this._platformLocation.pushState(t,e,i)},e.prototype.replaceState=function(t,e,n,r){var i=this.prepareExternalUrl(n+I.normalizeQueryParams(r));0==i.length&&(i=this._platformLocation.pathname),this._platformLocation.replaceState(t,e,i)},e.prototype.forward=function(){this._platformLocation.forward()},e.prototype.back=function(){this._platformLocation.back()},e}(C),A=function(t){function e(e,n){var r=t.call(this)||this;if(r._platformLocation=e,null==n&&(n=r._platformLocation.getBaseHrefFromDOM()),null==n)throw new Error("No base href set. Please provide a value for the APP_BASE_HREF token or add a base element to the document.");return r._baseHref=n,r}return Object(i.__extends)(e,t),e.prototype.onPopState=function(t){this._platformLocation.onPopState(t),this._platformLocation.onHashChange(t)},e.prototype.getBaseHref=function(){return this._baseHref},e.prototype.prepareExternalUrl=function(t){return I.joinWithSlash(this._baseHref,t)},e.prototype.path=function(t){void 0===t&&(t=!1);var e=this._platformLocation.pathname+I.normalizeQueryParams(this._platformLocation.search),n=this._platformLocation.hash;return n&&t?""+e+n:e},e.prototype.pushState=function(t,e,n,r){var i=this.prepareExternalUrl(n+I.normalizeQueryParams(r));this._platformLocation.pushState(t,e,i)},e.prototype.replaceState=function(t,e,n,r){var i=this.prepareExternalUrl(n+I.normalizeQueryParams(r));this._platformLocation.replaceState(t,e,i)},e.prototype.forward=function(){this._platformLocation.forward()},e.prototype.back=function(){this._platformLocation.back()},e}(C),O=["en",[["a","p"],["AM","PM"]],[["AM","PM"],,],[["S","M","T","W","T","F","S"],["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],["Su","Mo","Tu","We","Th","Fr","Sa"]],,[["J","F","M","A","M","J","J","A","S","O","N","D"],["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],["January","February","March","April","May","June","July","August","September","October","November","December"]],,[["B","A"],["BC","AD"],["Before Christ","Anno Domini"]],0,[6,0],["M/d/yy","MMM d, y","MMMM d, y","EEEE, MMMM d, y"],["h:mm a","h:mm:ss a","h:mm:ss a z","h:mm:ss a zzzz"],["{1}, {0}",,"{1} 'at' {0}"],[".",",",";","%","+","-","E","\xd7","\u2030","\u221e","NaN",":"],["#,##0.###","#,##0%","\xa4#,##0.00","#E0"],"$","US Dollar",function(t){var e=Math.floor(Math.abs(t)),n=t.toString().replace(/^[^.]*\.?/,"").length;return 1===e&&0===n?1:5}],P={},N=function(){var t={Decimal:0,Percent:1,Currency:2,Scientific:3};return t[t.Decimal]="Decimal",t[t.Percent]="Percent",t[t.Currency]="Currency",t[t.Scientific]="Scientific",t}(),R=function(){var t={Zero:0,One:1,Two:2,Few:3,Many:4,Other:5};return t[t.Zero]="Zero",t[t.One]="One",t[t.Two]="Two",t[t.Few]="Few",t[t.Many]="Many",t[t.Other]="Other",t}(),D=function(){var t={Decimal:0,Group:1,List:2,PercentSign:3,PlusSign:4,MinusSign:5,Exponential:6,SuperscriptingExponent:7,PerMille:8,Infinity:9,NaN:10,TimeSeparator:11,CurrencyDecimal:12,CurrencyGroup:13};return t[t.Decimal]="Decimal",t[t.Group]="Group",t[t.List]="List",t[t.PercentSign]="PercentSign",t[t.PlusSign]="PlusSign",t[t.MinusSign]="MinusSign",t[t.Exponential]="Exponential",t[t.SuperscriptingExponent]="SuperscriptingExponent",t[t.PerMille]="PerMille",t[t.Infinity]="Infinity",t[t.NaN]="NaN",t[t.TimeSeparator]="TimeSeparator",t[t.CurrencyDecimal]="CurrencyDecimal",t[t.CurrencyGroup]="CurrencyGroup",t}();function M(t,e){var n=V(t),r=n[13][e];if("undefined"==typeof r){if(e===D.CurrencyDecimal)return n[13][D.Decimal];if(e===D.CurrencyGroup)return n[13][D.Group]}return r}function V(t){var e=t.toLowerCase().replace(/_/g,"-"),n=P[e];if(n)return n;var r=e.split("-")[0];if(n=P[r])return n;if("en"===r)return O;throw new Error('Missing locale data for the locale "'+t+'".')}var F=new r.o("UseV4Plurals"),j=function(){},L=function(t){function e(e,n){var r=t.call(this)||this;return r.locale=e,r.deprecatedPluralFn=n,r}return Object(i.__extends)(e,t),e.prototype.getPluralCategory=function(t,e){switch(this.deprecatedPluralFn?this.deprecatedPluralFn(e||this.locale,t):function(t){return V(t)[17]}(e||this.locale)(t)){case R.Zero:return"zero";case R.One:return"one";case R.Two:return"two";case R.Few:return"few";case R.Many:return"many";default:return"other"}},e}(j),U=function(){function t(t,e,n,r){this._iterableDiffers=t,this._keyValueDiffers=e,this._ngEl=n,this._renderer=r,this._initialClasses=[]}return Object.defineProperty(t.prototype,"klass",{set:function(t){this._applyInitialClasses(!0),this._initialClasses="string"==typeof t?t.split(/\s+/):[],this._applyInitialClasses(!1),this._applyClasses(this._rawClass,!1)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ngClass",{set:function(t){this._cleanupClasses(this._rawClass),this._iterableDiffer=null,this._keyValueDiffer=null,this._rawClass="string"==typeof t?t.split(/\s+/):t,this._rawClass&&(Object(r._7)(this._rawClass)?this._iterableDiffer=this._iterableDiffers.find(this._rawClass).create():this._keyValueDiffer=this._keyValueDiffers.find(this._rawClass).create())},enumerable:!0,configurable:!0}),t.prototype.ngDoCheck=function(){if(this._iterableDiffer){var t=this._iterableDiffer.diff(this._rawClass);t&&this._applyIterableChanges(t)}else if(this._keyValueDiffer){var e=this._keyValueDiffer.diff(this._rawClass);e&&this._applyKeyValueChanges(e)}},t.prototype._cleanupClasses=function(t){this._applyClasses(t,!0),this._applyInitialClasses(!1)},t.prototype._applyKeyValueChanges=function(t){var e=this;t.forEachAddedItem(function(t){return e._toggleClass(t.key,t.currentValue)}),t.forEachChangedItem(function(t){return e._toggleClass(t.key,t.currentValue)}),t.forEachRemovedItem(function(t){t.previousValue&&e._toggleClass(t.key,!1)})},t.prototype._applyIterableChanges=function(t){var e=this;t.forEachAddedItem(function(t){if("string"!=typeof t.item)throw new Error("NgClass can only toggle CSS classes expressed as strings, got "+Object(r._22)(t.item));e._toggleClass(t.item,!0)}),t.forEachRemovedItem(function(t){return e._toggleClass(t.item,!1)})},t.prototype._applyInitialClasses=function(t){var e=this;this._initialClasses.forEach(function(n){return e._toggleClass(n,!t)})},t.prototype._applyClasses=function(t,e){var n=this;t&&(Array.isArray(t)||t instanceof Set?t.forEach(function(t){return n._toggleClass(t,!e)}):Object.keys(t).forEach(function(r){null!=t[r]&&n._toggleClass(r,!e)}))},t.prototype._toggleClass=function(t,e){var n=this;(t=t.trim())&&t.split(/\s+/g).forEach(function(t){e?n._renderer.addClass(n._ngEl.nativeElement,t):n._renderer.removeClass(n._ngEl.nativeElement,t)})},t}(),B=function(){function t(t,e,n,r){this.$implicit=t,this.ngForOf=e,this.index=n,this.count=r}return Object.defineProperty(t.prototype,"first",{get:function(){return 0===this.index},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"last",{get:function(){return this.index===this.count-1},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"even",{get:function(){return this.index%2==0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"odd",{get:function(){return!this.even},enumerable:!0,configurable:!0}),t}(),q=function(){function t(t,e,n){this._viewContainer=t,this._template=e,this._differs=n,this._differ=null}return Object.defineProperty(t.prototype,"ngForTrackBy",{get:function(){return this._trackByFn},set:function(t){Object(r.T)()&&null!=t&&"function"!=typeof t&&console&&console.warn&&console.warn("trackBy must be a function, but received "+JSON.stringify(t)+". See https://angular.io/docs/ts/latest/api/common/index/NgFor-directive.html#!#change-propagation for more information."),this._trackByFn=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ngForTemplate",{set:function(t){t&&(this._template=t)},enumerable:!0,configurable:!0}),t.prototype.ngOnChanges=function(t){if("ngForOf"in t){var e=t.ngForOf.currentValue;if(!this._differ&&e)try{this._differ=this._differs.find(e).create(this.ngForTrackBy)}catch(t){throw new Error("Cannot find a differ supporting object '"+e+"' of type '"+((n=e).name||typeof n)+"'. NgFor only supports binding to Iterables such as Arrays.")}}var n},t.prototype.ngDoCheck=function(){if(this._differ){var t=this._differ.diff(this.ngForOf);t&&this._applyChanges(t)}},t.prototype._applyChanges=function(t){var e=this,n=[];t.forEachOperation(function(t,r,i){if(null==t.previousIndex){var o=e._viewContainer.createEmbeddedView(e._template,new B(null,e.ngForOf,-1,-1),i),s=new H(t,o);n.push(s)}else null==i?e._viewContainer.remove(r):(o=e._viewContainer.get(r),e._viewContainer.move(o,i),s=new H(t,o),n.push(s))});for(var r=0;r<n.length;r++)this._perViewChange(n[r].view,n[r].record);r=0;for(var i=this._viewContainer.length;r<i;r++){var o=this._viewContainer.get(r);o.context.index=r,o.context.count=i}t.forEachIdentityChange(function(t){e._viewContainer.get(t.currentIndex).context.$implicit=t.item})},t.prototype._perViewChange=function(t,e){t.context.$implicit=e.item},t}(),H=function(t,e){this.record=t,this.view=e},K=function(){function t(t,e){this._viewContainer=t,this._context=new z,this._thenTemplateRef=null,this._elseTemplateRef=null,this._thenViewRef=null,this._elseViewRef=null,this._thenTemplateRef=e}return Object.defineProperty(t.prototype,"ngIf",{set:function(t){this._context.$implicit=this._context.ngIf=t,this._updateView()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ngIfThen",{set:function(t){this._thenTemplateRef=t,this._thenViewRef=null,this._updateView()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ngIfElse",{set:function(t){this._elseTemplateRef=t,this._elseViewRef=null,this._updateView()},enumerable:!0,configurable:!0}),t.prototype._updateView=function(){this._context.$implicit?this._thenViewRef||(this._viewContainer.clear(),this._elseViewRef=null,this._thenTemplateRef&&(this._thenViewRef=this._viewContainer.createEmbeddedView(this._thenTemplateRef,this._context))):this._elseViewRef||(this._viewContainer.clear(),this._thenViewRef=null,this._elseTemplateRef&&(this._elseViewRef=this._viewContainer.createEmbeddedView(this._elseTemplateRef,this._context)))},t}(),z=function(){this.$implicit=null,this.ngIf=null},Q=function(){function t(t,e,n){this._differs=t,this._ngEl=e,this._renderer=n}return Object.defineProperty(t.prototype,"ngStyle",{set:function(t){this._ngStyle=t,!this._differ&&t&&(this._differ=this._differs.find(t).create())},enumerable:!0,configurable:!0}),t.prototype.ngDoCheck=function(){if(this._differ){var t=this._differ.diff(this._ngStyle);t&&this._applyChanges(t)}},t.prototype._applyChanges=function(t){var e=this;t.forEachRemovedItem(function(t){return e._setStyle(t.key,null)}),t.forEachAddedItem(function(t){return e._setStyle(t.key,t.currentValue)}),t.forEachChangedItem(function(t){return e._setStyle(t.key,t.currentValue)})},t.prototype._setStyle=function(t,e){var n=t.split("."),r=n[0],i=n[1];null!=(e=null!=e&&i?""+e+i:e)?this._renderer.setStyle(this._ngEl.nativeElement,r,e):this._renderer.removeStyle(this._ngEl.nativeElement,r)},t}(),G=/^(\d+)?\.((\d+)(-(\d+))?)?$/;function W(t){var e=parseInt(t);if(isNaN(e))throw new Error("Invalid integer literal when parsing "+t);return e}var Y=function(){function t(){}return t.prototype.transform=function(t){return JSON.stringify(t,null,2)},t}(),J=function(){function t(t){this._locale=t}return t.prototype.transform=function(e,n,i){if(function(t){return null==t||""===t||t!=t}(e))return null;var o,s=function(t,e,n,r,i){void 0===i&&(i=null);var o,s={str:null},a=function(t,e){return V(t)[14][e]}(e,n);if("string"!=typeof t||isNaN(+t-parseFloat(t))){if("number"!=typeof t)return s.error=t+" is not a number",s;o=t}else o=+t;var u=function(t,e){void 0===e&&(e="-");var n={minInt:1,minFrac:0,maxFrac:0,posPre:"",posSuf:"",negPre:"",negSuf:"",gSize:0,lgSize:0},r=t.split(";"),i=r[0],o=r[1],s=-1!==i.indexOf(".")?i.split("."):[i.substring(0,i.lastIndexOf("0")+1),i.substring(i.lastIndexOf("0")+1)],a=s[0],u=s[1]||"";n.posPre=a.substr(0,a.indexOf("#"));for(var l=0;l<u.length;l++){var c=u.charAt(l);"0"===c?n.minFrac=n.maxFrac=l+1:"#"===c?n.maxFrac=l+1:n.posSuf+=c}var h=a.split(",");if(n.gSize=h[1]?h[1].length:0,n.lgSize=h[2]||h[1]?(h[2]||h[1]).length:0,o){var f=i.length-n.posPre.length-n.posSuf.length,p=o.indexOf("#");n.negPre=o.substr(0,p).replace(/'/g,""),n.negSuf=o.substr(p+f).replace(/'/g,"")}else n.negPre=e+n.posPre,n.negSuf=n.posSuf;return n}(a,M(e,D.MinusSign)),l="",c=!1;if(isFinite(o)){var h=function(t){var e,n,r,i,o,s=Math.abs(t)+"",a=0;for((n=s.indexOf("."))>-1&&(s=s.replace(".","")),(r=s.search(/e/i))>0?(n<0&&(n=r),n+=+s.slice(r+1),s=s.substring(0,r)):n<0&&(n=s.length),r=0;"0"===s.charAt(r);r++);if(r===(o=s.length))e=[0],n=1;else{for(o--;"0"===s.charAt(o);)o--;for(n-=r,e=[],i=0;r<=o;r++,i++)e[i]=+s.charAt(r)}return n>22&&(e=e.splice(0,21),a=n-1,n=1),{digits:e,exponent:a,integerLen:n}}(o);n===N.Percent&&(h=function(t){if(0===t.digits[0])return t;var e=t.digits.length-t.integerLen;return t.exponent?t.exponent+=2:(0===e?t.digits.push(0,0):1===e&&t.digits.push(0),t.integerLen+=2),t}(h));var f=u.minInt,p=u.minFrac,d=u.maxFrac;if(r){var y=r.match(G);if(null===y)return s.error=r+" is not a valid digit info",s;var m=y[1],g=y[3],v=y[5];null!=m&&(f=W(m)),null!=g&&(p=W(g)),null!=v?d=W(v):null!=g&&p>d&&(d=p)}!function(t,e,n){if(e>n)throw new Error("The minimum number of digits after fraction ("+e+") is higher than the maximum ("+n+").");var r=t.digits,i=r.length-t.integerLen,o=Math.min(Math.max(e,i),n),s=o+t.integerLen,a=r[s];if(s>0){r.splice(Math.max(t.integerLen,s));for(var u=s;u<r.length;u++)r[u]=0}else{i=Math.max(0,i),t.integerLen=1,r.length=Math.max(1,s=o+1),r[0]=0;for(var l=1;l<s;l++)r[l]=0}if(a>=5)if(s-1<0){for(var c=0;c>s;c--)r.unshift(0),t.integerLen++;r.unshift(1),t.integerLen++}else r[s-1]++;for(;i<Math.max(0,o);i++)r.push(0);var h=0!==o,f=e+t.integerLen,p=r.reduceRight(function(t,e,n,r){return r[n]=(e+=t)<10?e:e-10,h&&(0===r[n]&&n>=f?r.pop():h=!1),e>=10?1:0},0);p&&(r.unshift(p),t.integerLen++)}(h,p,d);var _=h.digits,b=h.integerLen,w=h.exponent,E=[];for(c=_.every(function(t){return!t});b<f;b++)_.unshift(0);for(;b<0;b++)_.unshift(0);b>0?E=_.splice(b,_.length):(E=_,_=[0]);var S=[];for(_.length>=u.lgSize&&S.unshift(_.splice(-u.lgSize,_.length).join(""));_.length>u.gSize;)S.unshift(_.splice(-u.gSize,_.length).join(""));_.length&&S.unshift(_.join("")),l=S.join(M(e,i?D.CurrencyGroup:D.Group)),E.length&&(l+=M(e,i?D.CurrencyDecimal:D.Decimal)+E.join("")),w&&(l+=M(e,D.Exponential)+"+"+w)}else l=M(e,D.Infinity);return l=o<0&&!c?u.negPre+l+u.negSuf:u.posPre+l+u.posSuf,n===N.Currency&&null!==i?(s.str=l.replace("\xa4",i).replace("\xa4",""),s):n===N.Percent?(s.str=l.replace(new RegExp("%","g"),M(e,D.PercentSign)),s):(s.str=l,s)}(e,i=i||this._locale,N.Decimal,n),a=s.str,u=s.error;if(u)throw o=t,Error("InvalidPipeArgument: '"+u+"' for pipe '"+Object(r._22)(o)+"'");return a},t}(),X=function(){},Z=new r.o("DocumentToken"),$=null;function tt(){return $}var et,nt={class:"className",innerHtml:"innerHTML",readonly:"readOnly",tabindex:"tabIndex"},rt={"\b":"Backspace","\t":"Tab","\x7f":"Delete","\x1b":"Escape",Del:"Delete",Esc:"Escape",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown",Menu:"ContextMenu",Scroll:"ScrollLock",Win:"OS"},it={A:"1",B:"2",C:"3",D:"4",E:"5",F:"6",G:"7",H:"8",I:"9",J:"*",K:"+",M:"-",N:".",O:"/","`":"0","\x90":"NumLock"};r._4.Node&&(et=r._4.Node.prototype.contains||function(t){return!!(16&this.compareDocumentPosition(t))});var ot,st=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(i.__extends)(e,t),e.prototype.parse=function(t){throw new Error("parse not implemented")},e.makeCurrent=function(){var t;t=new e,$||($=t)},e.prototype.hasProperty=function(t,e){return e in t},e.prototype.setProperty=function(t,e,n){t[e]=n},e.prototype.getProperty=function(t,e){return t[e]},e.prototype.invoke=function(t,e,n){var r;(r=t)[e].apply(r,n)},e.prototype.logError=function(t){window.console&&(console.error?console.error(t):console.log(t))},e.prototype.log=function(t){window.console&&window.console.log&&window.console.log(t)},e.prototype.logGroup=function(t){window.console&&window.console.group&&window.console.group(t)},e.prototype.logGroupEnd=function(){window.console&&window.console.groupEnd&&window.console.groupEnd()},Object.defineProperty(e.prototype,"attrToPropMap",{get:function(){return nt},enumerable:!0,configurable:!0}),e.prototype.contains=function(t,e){return et.call(t,e)},e.prototype.querySelector=function(t,e){return t.querySelector(e)},e.prototype.querySelectorAll=function(t,e){return t.querySelectorAll(e)},e.prototype.on=function(t,e,n){t.addEventListener(e,n,!1)},e.prototype.onAndCancel=function(t,e,n){return t.addEventListener(e,n,!1),function(){t.removeEventListener(e,n,!1)}},e.prototype.dispatchEvent=function(t,e){t.dispatchEvent(e)},e.prototype.createMouseEvent=function(t){var e=this.getDefaultDocument().createEvent("MouseEvent");return e.initEvent(t,!0,!0),e},e.prototype.createEvent=function(t){var e=this.getDefaultDocument().createEvent("Event");return e.initEvent(t,!0,!0),e},e.prototype.preventDefault=function(t){t.preventDefault(),t.returnValue=!1},e.prototype.isPrevented=function(t){return t.defaultPrevented||null!=t.returnValue&&!t.returnValue},e.prototype.getInnerHTML=function(t){return t.innerHTML},e.prototype.getTemplateContent=function(t){return"content"in t&&this.isTemplateElement(t)?t.content:null},e.prototype.getOuterHTML=function(t){return t.outerHTML},e.prototype.nodeName=function(t){return t.nodeName},e.prototype.nodeValue=function(t){return t.nodeValue},e.prototype.type=function(t){return t.type},e.prototype.content=function(t){return this.hasProperty(t,"content")?t.content:t},e.prototype.firstChild=function(t){return t.firstChild},e.prototype.nextSibling=function(t){return t.nextSibling},e.prototype.parentElement=function(t){return t.parentNode},e.prototype.childNodes=function(t){return t.childNodes},e.prototype.childNodesAsList=function(t){for(var e=t.childNodes,n=new Array(e.length),r=0;r<e.length;r++)n[r]=e[r];return n},e.prototype.clearNodes=function(t){for(;t.firstChild;)t.removeChild(t.firstChild)},e.prototype.appendChild=function(t,e){t.appendChild(e)},e.prototype.removeChild=function(t,e){t.removeChild(e)},e.prototype.replaceChild=function(t,e,n){t.replaceChild(e,n)},e.prototype.remove=function(t){return t.parentNode&&t.parentNode.removeChild(t),t},e.prototype.insertBefore=function(t,e,n){t.insertBefore(n,e)},e.prototype.insertAllBefore=function(t,e,n){n.forEach(function(n){return t.insertBefore(n,e)})},e.prototype.insertAfter=function(t,e,n){t.insertBefore(n,e.nextSibling)},e.prototype.setInnerHTML=function(t,e){t.innerHTML=e},e.prototype.getText=function(t){return t.textContent},e.prototype.setText=function(t,e){t.textContent=e},e.prototype.getValue=function(t){return t.value},e.prototype.setValue=function(t,e){t.value=e},e.prototype.getChecked=function(t){return t.checked},e.prototype.setChecked=function(t,e){t.checked=e},e.prototype.createComment=function(t){return this.getDefaultDocument().createComment(t)},e.prototype.createTemplate=function(t){var e=this.getDefaultDocument().createElement("template");return e.innerHTML=t,e},e.prototype.createElement=function(t,e){return(e=e||this.getDefaultDocument()).createElement(t)},e.prototype.createElementNS=function(t,e,n){return(n=n||this.getDefaultDocument()).createElementNS(t,e)},e.prototype.createTextNode=function(t,e){return(e=e||this.getDefaultDocument()).createTextNode(t)},e.prototype.createScriptTag=function(t,e,n){var r=(n=n||this.getDefaultDocument()).createElement("SCRIPT");return r.setAttribute(t,e),r},e.prototype.createStyleElement=function(t,e){var n=(e=e||this.getDefaultDocument()).createElement("style");return this.appendChild(n,this.createTextNode(t,e)),n},e.prototype.createShadowRoot=function(t){return t.createShadowRoot()},e.prototype.getShadowRoot=function(t){return t.shadowRoot},e.prototype.getHost=function(t){return t.host},e.prototype.clone=function(t){return t.cloneNode(!0)},e.prototype.getElementsByClassName=function(t,e){return t.getElementsByClassName(e)},e.prototype.getElementsByTagName=function(t,e){return t.getElementsByTagName(e)},e.prototype.classList=function(t){return Array.prototype.slice.call(t.classList,0)},e.prototype.addClass=function(t,e){t.classList.add(e)},e.prototype.removeClass=function(t,e){t.classList.remove(e)},e.prototype.hasClass=function(t,e){return t.classList.contains(e)},e.prototype.setStyle=function(t,e,n){t.style[e]=n},e.prototype.removeStyle=function(t,e){t.style[e]=""},e.prototype.getStyle=function(t,e){return t.style[e]},e.prototype.hasStyle=function(t,e,n){var r=this.getStyle(t,e)||"";return n?r==n:r.length>0},e.prototype.tagName=function(t){return t.tagName},e.prototype.attributeMap=function(t){for(var e=new Map,n=t.attributes,r=0;r<n.length;r++){var i=n.item(r);e.set(i.name,i.value)}return e},e.prototype.hasAttribute=function(t,e){return t.hasAttribute(e)},e.prototype.hasAttributeNS=function(t,e,n){return t.hasAttributeNS(e,n)},e.prototype.getAttribute=function(t,e){return t.getAttribute(e)},e.prototype.getAttributeNS=function(t,e,n){return t.getAttributeNS(e,n)},e.prototype.setAttribute=function(t,e,n){t.setAttribute(e,n)},e.prototype.setAttributeNS=function(t,e,n,r){t.setAttributeNS(e,n,r)},e.prototype.removeAttribute=function(t,e){t.removeAttribute(e)},e.prototype.removeAttributeNS=function(t,e,n){t.removeAttributeNS(e,n)},e.prototype.templateAwareRoot=function(t){return this.isTemplateElement(t)?this.content(t):t},e.prototype.createHtmlDocument=function(){return document.implementation.createHTMLDocument("fakeTitle")},e.prototype.getDefaultDocument=function(){return document},e.prototype.getBoundingClientRect=function(t){try{return t.getBoundingClientRect()}catch(t){return{top:0,bottom:0,left:0,right:0,width:0,height:0}}},e.prototype.getTitle=function(t){return t.title},e.prototype.setTitle=function(t,e){t.title=e||""},e.prototype.elementMatches=function(t,e){return!!this.isElementNode(t)&&(t.matches&&t.matches(e)||t.msMatchesSelector&&t.msMatchesSelector(e)||t.webkitMatchesSelector&&t.webkitMatchesSelector(e))},e.prototype.isTemplateElement=function(t){return this.isElementNode(t)&&"TEMPLATE"===t.nodeName},e.prototype.isTextNode=function(t){return t.nodeType===Node.TEXT_NODE},e.prototype.isCommentNode=function(t){return t.nodeType===Node.COMMENT_NODE},e.prototype.isElementNode=function(t){return t.nodeType===Node.ELEMENT_NODE},e.prototype.hasShadowRoot=function(t){return null!=t.shadowRoot&&t instanceof HTMLElement},e.prototype.isShadowRoot=function(t){return t instanceof DocumentFragment},e.prototype.importIntoDoc=function(t){return document.importNode(this.templateAwareRoot(t),!0)},e.prototype.adoptNode=function(t){return document.adoptNode(t)},e.prototype.getHref=function(t){return t.getAttribute("href")},e.prototype.getEventKey=function(t){var e=t.key;if(null==e){if(null==(e=t.keyIdentifier))return"Unidentified";e.startsWith("U+")&&(e=String.fromCharCode(parseInt(e.substring(2),16)),3===t.location&&it.hasOwnProperty(e)&&(e=it[e]))}return rt[e]||e},e.prototype.getGlobalEventTarget=function(t,e){return"window"===e?window:"document"===e?t:"body"===e?t.body:null},e.prototype.getHistory=function(){return window.history},e.prototype.getLocation=function(){return window.location},e.prototype.getBaseHref=function(t){var e,n=at||(at=document.querySelector("base"))?at.getAttribute("href"):null;return null==n?null:(e=n,ot||(ot=document.createElement("a")),ot.setAttribute("href",e),"/"===ot.pathname.charAt(0)?ot.pathname:"/"+ot.pathname)},e.prototype.resetBaseElement=function(){at=null},e.prototype.getUserAgent=function(){return window.navigator.userAgent},e.prototype.setData=function(t,e,n){this.setAttribute(t,"data-"+e,n)},e.prototype.getData=function(t,e){return this.getAttribute(t,"data-"+e)},e.prototype.getComputedStyle=function(t){return getComputedStyle(t)},e.prototype.supportsWebAnimation=function(){return"function"==typeof Element.prototype.animate},e.prototype.performanceNow=function(){return window.performance&&window.performance.now?window.performance.now():(new Date).getTime()},e.prototype.supportsCookies=function(){return!0},e.prototype.getCookie=function(t){return function(t,e){e=encodeURIComponent(e);for(var n=0,r=t.split(";");n<r.length;n++){var i=r[n],o=i.indexOf("="),s=-1==o?[i,""]:[i.slice(0,o),i.slice(o+1)],a=s[1];if(s[0].trim()===e)return decodeURIComponent(a)}return null}(document.cookie,t)},e.prototype.setCookie=function(t,e){document.cookie=encodeURIComponent(t)+"="+encodeURIComponent(e)},e}(function(t){function e(){var e=t.call(this)||this;e._animationPrefix=null,e._transitionEnd=null;try{var n=e.createElement("div",document);if(null!=e.getStyle(n,"animationName"))e._animationPrefix="";else for(var r=["Webkit","Moz","O","ms"],i=0;i<r.length;i++)if(null!=e.getStyle(n,r[i]+"AnimationName")){e._animationPrefix="-"+r[i].toLowerCase()+"-";break}var o={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};Object.keys(o).forEach(function(t){null!=e.getStyle(n,t)&&(e._transitionEnd=o[t])})}catch(t){e._animationPrefix=null,e._transitionEnd=null}return e}return Object(i.__extends)(e,t),e.prototype.getDistributedNodes=function(t){return t.getDistributedNodes()},e.prototype.resolveAndSetHref=function(t,e,n){t.href=null==n?e:e+"/../"+n},e.prototype.supportsDOMEvents=function(){return!0},e.prototype.supportsNativeShadowDOM=function(){return"function"==typeof document.body.createShadowRoot},e.prototype.getAnimationPrefix=function(){return this._animationPrefix?this._animationPrefix:""},e.prototype.getTransitionEnd=function(){return this._transitionEnd?this._transitionEnd:""},e.prototype.supportsAnimation=function(){return null!=this._animationPrefix&&null!=this._transitionEnd},e}(function(){function t(){this.resourceLoaderType=null}return Object.defineProperty(t.prototype,"attrToPropMap",{get:function(){return this._attrToPropMap},set:function(t){this._attrToPropMap=t},enumerable:!0,configurable:!0}),t}())),at=null,ut=Z;function lt(){return!!window.history.pushState}var ct=function(t){function e(e){var n=t.call(this)||this;return n._doc=e,n._init(),n}return Object(i.__extends)(e,t),e.prototype._init=function(){this.location=tt().getLocation(),this._history=tt().getHistory()},e.prototype.getBaseHrefFromDOM=function(){return tt().getBaseHref(this._doc)},e.prototype.onPopState=function(t){tt().getGlobalEventTarget(this._doc,"window").addEventListener("popstate",t,!1)},e.prototype.onHashChange=function(t){tt().getGlobalEventTarget(this._doc,"window").addEventListener("hashchange",t,!1)},Object.defineProperty(e.prototype,"pathname",{get:function(){return this.location.pathname},set:function(t){this.location.pathname=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"search",{get:function(){return this.location.search},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hash",{get:function(){return this.location.hash},enumerable:!0,configurable:!0}),e.prototype.pushState=function(t,e,n){lt()?this._history.pushState(t,e,n):this.location.hash=n},e.prototype.replaceState=function(t,e,n){lt()?this._history.replaceState(t,e,n):this.location.hash=n},e.prototype.forward=function(){this._history.forward()},e.prototype.back=function(){this._history.back()},e.ctorParameters=function(){return[{type:void 0,decorators:[{type:r.n,args:[ut]}]}]},e}(E),ht=function(){function t(t){this._doc=t,this._dom=tt()}return t.prototype.addTag=function(t,e){return void 0===e&&(e=!1),t?this._getOrCreateElement(t,e):null},t.prototype.addTags=function(t,e){var n=this;return void 0===e&&(e=!1),t?t.reduce(function(t,r){return r&&t.push(n._getOrCreateElement(r,e)),t},[]):[]},t.prototype.getTag=function(t){return t&&this._dom.querySelector(this._doc,"meta["+t+"]")||null},t.prototype.getTags=function(t){if(!t)return[];var e=this._dom.querySelectorAll(this._doc,"meta["+t+"]");return e?[].slice.call(e):[]},t.prototype.updateTag=function(t,e){if(!t)return null;e=e||this._parseSelector(t);var n=this.getTag(e);return n?this._setMetaElementAttributes(t,n):this._getOrCreateElement(t,!0)},t.prototype.removeTag=function(t){this.removeTagElement(this.getTag(t))},t.prototype.removeTagElement=function(t){t&&this._dom.remove(t)},t.prototype._getOrCreateElement=function(t,e){if(void 0===e&&(e=!1),!e){var n=this._parseSelector(t),r=this.getTag(n);if(r&&this._containsAttributes(t,r))return r}var i=this._dom.createElement("meta");this._setMetaElementAttributes(t,i);var o=this._dom.getElementsByTagName(this._doc,"head")[0];return this._dom.appendChild(o,i),i},t.prototype._setMetaElementAttributes=function(t,e){var n=this;return Object.keys(t).forEach(function(r){return n._dom.setAttribute(e,r,t[r])}),e},t.prototype._parseSelector=function(t){var e=t.name?"name":"property";return e+'="'+t[e]+'"'},t.prototype._containsAttributes=function(t,e){var n=this;return Object.keys(t).every(function(r){return n._dom.getAttribute(e,r)===t[r]})},t}(),ft=new r.o("TRANSITION_ID"),pt=[{provide:r.d,useFactory:function(t,e,n){return function(){n.get(r.e).donePromise.then(function(){var n=tt();Array.prototype.slice.apply(n.querySelectorAll(e,"style[ng-transition]")).filter(function(e){return n.getAttribute(e,"ng-transition")===t}).forEach(function(t){return n.remove(t)})})}},deps:[ft,ut,r.p],multi:!0}],dt=function(){function t(){}return t.init=function(){Object(r.V)(new t)},t.prototype.addToWindow=function(t){r._4.getAngularTestability=function(e,n){void 0===n&&(n=!0);var r=t.findTestabilityInTree(e,n);if(null==r)throw new Error("Could not find testability for element.");return r},r._4.getAllAngularTestabilities=function(){return t.getAllTestabilities()},r._4.getAllAngularRootElements=function(){return t.getAllRootElements()},r._4.frameworkStabilizers||(r._4.frameworkStabilizers=[]),r._4.frameworkStabilizers.push(function(t){var e=r._4.getAllAngularTestabilities(),n=e.length,i=!1,o=function(e){i=i||e,0==--n&&t(i)};e.forEach(function(t){t.whenStable(o)})})},t.prototype.findTestabilityInTree=function(t,e,n){if(null==e)return null;var r=t.getTestability(e);return null!=r?r:n?tt().isShadowRoot(e)?this.findTestabilityInTree(t,tt().getHost(e),!0):this.findTestabilityInTree(t,tt().parentElement(e),!0):null},t}(),yt=function(){function t(t){this._doc=t}return t.prototype.getTitle=function(){return tt().getTitle(this._doc)},t.prototype.setTitle=function(t){tt().setTitle(this._doc,t)},t}();function mt(t,e){"undefined"!=typeof COMPILED&&COMPILED||((r._4.ng=r._4.ng||{})[t]=e)}var gt={ApplicationRef:r.g,NgZone:r.x};function vt(t){return Object(r.S)(t)}var _t=new r.o("EventManagerPlugins"),bt=function(){function t(t,e){var n=this;this._zone=e,this._eventNameToPlugin=new Map,t.forEach(function(t){return t.manager=n}),this._plugins=t.slice().reverse()}return t.prototype.addEventListener=function(t,e,n){return this._findPluginFor(e).addEventListener(t,e,n)},t.prototype.addGlobalEventListener=function(t,e,n){return this._findPluginFor(e).addGlobalEventListener(t,e,n)},t.prototype.getZone=function(){return this._zone},t.prototype._findPluginFor=function(t){var e=this._eventNameToPlugin.get(t);if(e)return e;for(var n=this._plugins,r=0;r<n.length;r++){var i=n[r];if(i.supports(t))return this._eventNameToPlugin.set(t,i),i}throw new Error("No event manager plugin found for event "+t)},t}(),wt=function(){function t(t){this._doc=t}return t.prototype.addGlobalEventListener=function(t,e,n){var r=tt().getGlobalEventTarget(this._doc,t);if(!r)throw new Error("Unsupported event target "+r+" for event "+e);return this.addEventListener(r,e,n)},t}(),Et=function(){function t(){this._stylesSet=new Set}return t.prototype.addStyles=function(t){var e=this,n=new Set;t.forEach(function(t){e._stylesSet.has(t)||(e._stylesSet.add(t),n.add(t))}),this.onStylesAdded(n)},t.prototype.onStylesAdded=function(t){},t.prototype.getAllStyles=function(){return Array.from(this._stylesSet)},t}(),St=function(t){function e(e){var n=t.call(this)||this;return n._doc=e,n._hostNodes=new Set,n._styleNodes=new Set,n._hostNodes.add(e.head),n}return Object(i.__extends)(e,t),e.prototype._addStylesToHost=function(t,e){var n=this;t.forEach(function(t){var r=n._doc.createElement("style");r.textContent=t,n._styleNodes.add(e.appendChild(r))})},e.prototype.addHost=function(t){this._addStylesToHost(this._stylesSet,t),this._hostNodes.add(t)},e.prototype.removeHost=function(t){this._hostNodes.delete(t)},e.prototype.onStylesAdded=function(t){var e=this;this._hostNodes.forEach(function(n){return e._addStylesToHost(t,n)})},e.prototype.ngOnDestroy=function(){this._styleNodes.forEach(function(t){return tt().remove(t)})},e}(Et),Ct={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},Tt=/%COMP%/g,It="_nghost-%COMP%",kt="_ngcontent-%COMP%";function xt(t,e,n){for(var r=0;r<e.length;r++){var i=e[r];Array.isArray(i)?xt(t,i,n):(i=i.replace(Tt,t),n.push(i))}return n}function At(t){return function(e){!1===t(e)&&(e.preventDefault(),e.returnValue=!1)}}var Ot=function(){function t(t,e){this.eventManager=t,this.sharedStylesHost=e,this.rendererByCompId=new Map,this.defaultRenderer=new Pt(t)}return t.prototype.createRenderer=function(t,e){if(!t||!e)return this.defaultRenderer;switch(e.encapsulation){case r.N.Emulated:var n=this.rendererByCompId.get(e.id);return n||(n=new Mt(this.eventManager,this.sharedStylesHost,e),this.rendererByCompId.set(e.id,n)),n.applyToHost(t),n;case r.N.Native:return new Vt(this.eventManager,this.sharedStylesHost,t,e);default:if(!this.rendererByCompId.has(e.id)){var i=xt(e.id,e.styles,[]);this.sharedStylesHost.addStyles(i),this.rendererByCompId.set(e.id,this.defaultRenderer)}return this.defaultRenderer}},t.prototype.begin=function(){},t.prototype.end=function(){},t}(),Pt=function(){function t(t){this.eventManager=t,this.data=Object.create(null)}return t.prototype.destroy=function(){},t.prototype.createElement=function(t,e){return e?document.createElementNS(Ct[e],t):document.createElement(t)},t.prototype.createComment=function(t){return document.createComment(t)},t.prototype.createText=function(t){return document.createTextNode(t)},t.prototype.appendChild=function(t,e){t.appendChild(e)},t.prototype.insertBefore=function(t,e,n){t&&t.insertBefore(e,n)},t.prototype.removeChild=function(t,e){t&&t.removeChild(e)},t.prototype.selectRootElement=function(t){var e="string"==typeof t?document.querySelector(t):t;if(!e)throw new Error('The selector "'+t+'" did not match any elements');return e.textContent="",e},t.prototype.parentNode=function(t){return t.parentNode},t.prototype.nextSibling=function(t){return t.nextSibling},t.prototype.setAttribute=function(t,e,n,r){if(r){e=r+":"+e;var i=Ct[r];i?t.setAttributeNS(i,e,n):t.setAttribute(e,n)}else t.setAttribute(e,n)},t.prototype.removeAttribute=function(t,e,n){if(n){var r=Ct[n];r?t.removeAttributeNS(r,e):t.removeAttribute(n+":"+e)}else t.removeAttribute(e)},t.prototype.addClass=function(t,e){t.classList.add(e)},t.prototype.removeClass=function(t,e){t.classList.remove(e)},t.prototype.setStyle=function(t,e,n,i){i&r.D.DashCase?t.style.setProperty(e,n,i&r.D.Important?"important":""):t.style[e]=n},t.prototype.removeStyle=function(t,e,n){n&r.D.DashCase?t.style.removeProperty(e):t.style[e]=""},t.prototype.setProperty=function(t,e,n){Rt(e,"property"),t[e]=n},t.prototype.setValue=function(t,e){t.nodeValue=e},t.prototype.listen=function(t,e,n){return Rt(e,"listener"),"string"==typeof t?this.eventManager.addGlobalEventListener(t,e,At(n)):this.eventManager.addEventListener(t,e,At(n))},t}(),Nt="@".charCodeAt(0);function Rt(t,e){if(t.charCodeAt(0)===Nt)throw new Error("Found the synthetic "+e+" "+t+'. Please include either "BrowserAnimationsModule" or "NoopAnimationsModule" in your application.')}var Dt,Mt=function(t){function e(e,n,r){var i=t.call(this,e)||this;i.component=r;var o=xt(r.id,r.styles,[]);return n.addStyles(o),i.contentAttr=kt.replace(Tt,r.id),i.hostAttr=It.replace(Tt,r.id),i}return Object(i.__extends)(e,t),e.prototype.applyToHost=function(e){t.prototype.setAttribute.call(this,e,this.hostAttr,"")},e.prototype.createElement=function(e,n){var r=t.prototype.createElement.call(this,e,n);return t.prototype.setAttribute.call(this,r,this.contentAttr,""),r},e}(Pt),Vt=function(t){function e(e,n,r,i){var o=t.call(this,e)||this;o.sharedStylesHost=n,o.hostEl=r,o.component=i,o.shadowRoot=r.createShadowRoot(),o.sharedStylesHost.addHost(o.shadowRoot);for(var s=xt(i.id,i.styles,[]),a=0;a<s.length;a++){var u=document.createElement("style");u.textContent=s[a],o.shadowRoot.appendChild(u)}return o}return Object(i.__extends)(e,t),e.prototype.nodeOrShadowRoot=function(t){return t===this.hostEl?this.shadowRoot:t},e.prototype.destroy=function(){this.sharedStylesHost.removeHost(this.shadowRoot)},e.prototype.appendChild=function(e,n){return t.prototype.appendChild.call(this,this.nodeOrShadowRoot(e),n)},e.prototype.insertBefore=function(e,n,r){return t.prototype.insertBefore.call(this,this.nodeOrShadowRoot(e),n,r)},e.prototype.removeChild=function(e,n){return t.prototype.removeChild.call(this,this.nodeOrShadowRoot(e),n)},e.prototype.parentNode=function(e){return this.nodeOrShadowRoot(t.prototype.parentNode.call(this,this.nodeOrShadowRoot(e)))},e}(Pt),Ft="undefined"!=typeof Zone&&Zone.__symbol__||function(t){return"__zone_symbol__"+t},jt=Ft("addEventListener"),Lt=Ft("removeEventListener"),Ut={},Bt="__zone_symbol__propagationStopped";"undefined"!=typeof Zone&&Zone[Ft("BLACK_LISTED_EVENTS")]&&(Dt={});var qt=function(t){return!!Dt&&Dt.hasOwnProperty(t)},Ht=function(t){var e=Ut[t.type];if(e){var n=this[e];if(n){var r=[t];if(1===n.length)return(s=n[0]).zone!==Zone.current?s.zone.run(s.handler,this,r):s.handler.apply(this,r);for(var i=n.slice(),o=0;o<i.length&&!0!==t[Bt];o++){var s;(s=i[o]).zone!==Zone.current?s.zone.run(s.handler,this,r):s.handler.apply(this,r)}}}},Kt=function(t){function e(e,n){var r=t.call(this,e)||this;return r.ngZone=n,r.patchEvent(),r}return Object(i.__extends)(e,t),e.prototype.patchEvent=function(){if(Event&&Event.prototype&&!Event.prototype.__zone_symbol__stopImmediatePropagation){var t=Event.prototype.__zone_symbol__stopImmediatePropagation=Event.prototype.stopImmediatePropagation;Event.prototype.stopImmediatePropagation=function(){this&&(this[Bt]=!0),t&&t.apply(this,arguments)}}},e.prototype.supports=function(t){return!0},e.prototype.addEventListener=function(t,e,n){var i=this,o=n;if(!t[jt]||r.x.isInAngularZone()&&!qt(e))t.addEventListener(e,o,!1);else{var s=Ut[e];s||(s=Ut[e]=Ft("ANGULAR"+e+"FALSE"));var a=t[s],u=a&&a.length>0;a||(a=t[s]=[]);var l=qt(e)?Zone.root:Zone.current;if(0===a.length)a.push({zone:l,handler:o});else{for(var c=!1,h=0;h<a.length;h++)if(a[h].handler===o){c=!0;break}c||a.push({zone:l,handler:o})}u||t[jt](e,Ht,!1)}return function(){return i.removeEventListener(t,e,o)}},e.prototype.removeEventListener=function(t,e,n){var r=t[Lt];if(!r)return t.removeEventListener.apply(t,[e,n,!1]);var i=Ut[e],o=i&&t[i];if(!o)return t.removeEventListener.apply(t,[e,n,!1]);for(var s=!1,a=0;a<o.length;a++)if(o[a].handler===n){s=!0,o.splice(a,1);break}s?0===o.length&&r.apply(t,[e,Ht,!1]):t.removeEventListener.apply(t,[e,n,!1])},e}(wt),zt={pan:!0,panstart:!0,panmove:!0,panend:!0,pancancel:!0,panleft:!0,panright:!0,panup:!0,pandown:!0,pinch:!0,pinchstart:!0,pinchmove:!0,pinchend:!0,pinchcancel:!0,pinchin:!0,pinchout:!0,press:!0,pressup:!0,rotate:!0,rotatestart:!0,rotatemove:!0,rotateend:!0,rotatecancel:!0,swipe:!0,swipeleft:!0,swiperight:!0,swipeup:!0,swipedown:!0,tap:!0},Qt=new r.o("HammerGestureConfig"),Gt=function(){function t(){this.events=[],this.overrides={}}return t.prototype.buildHammer=function(t){var e=new Hammer(t);for(var n in e.get("pinch").set({enable:!0}),e.get("rotate").set({enable:!0}),this.overrides)e.get(n).set(this.overrides[n]);return e},t}(),Wt=function(t){function e(e,n){var r=t.call(this,e)||this;return r._config=n,r}return Object(i.__extends)(e,t),e.prototype.supports=function(t){if(!zt.hasOwnProperty(t.toLowerCase())&&!this.isCustomEvent(t))return!1;if(!window.Hammer)throw new Error("Hammer.js is not loaded, can not bind "+t+" event");return!0},e.prototype.addEventListener=function(t,e,n){var r=this,i=this.manager.getZone();return e=e.toLowerCase(),i.runOutsideAngular(function(){var o=r._config.buildHammer(t),s=function(t){i.runGuarded(function(){n(t)})};return o.on(e,s),function(){return o.off(e,s)}})},e.prototype.isCustomEvent=function(t){return this._config.events.indexOf(t)>-1},e}(wt),Yt=["alt","control","meta","shift"],Jt={alt:function(t){return t.altKey},control:function(t){return t.ctrlKey},meta:function(t){return t.metaKey},shift:function(t){return t.shiftKey}},Xt=function(t){function e(e){return t.call(this,e)||this}return Object(i.__extends)(e,t),e.prototype.supports=function(t){return null!=e.parseEventName(t)},e.prototype.addEventListener=function(t,n,r){var i=e.parseEventName(n),o=e.eventCallback(i.fullKey,r,this.manager.getZone());return this.manager.getZone().runOutsideAngular(function(){return tt().onAndCancel(t,i.domEventName,o)})},e.parseEventName=function(t){var n=t.toLowerCase().split("."),r=n.shift();if(0===n.length||"keydown"!==r&&"keyup"!==r)return null;var i=e._normalizeKey(n.pop()),o="";if(Yt.forEach(function(t){var e=n.indexOf(t);e>-1&&(n.splice(e,1),o+=t+".")}),o+=i,0!=n.length||0===i.length)return null;var s={};return s.domEventName=r,s.fullKey=o,s},e.getEventFullKey=function(t){var e="",n=tt().getEventKey(t);return" "===(n=n.toLowerCase())?n="space":"."===n&&(n="dot"),Yt.forEach(function(r){r!=n&&(0,Jt[r])(t)&&(e+=r+".")}),e+=n},e.eventCallback=function(t,n,r){return function(i){e.getEventFullKey(i)===t&&r.runGuarded(function(){return n(i)})}},e._normalizeKey=function(t){switch(t){case"esc":return"escape";default:return t}},e}(wt),Zt=/^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi,$t=/^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+\/]+=*$/i;function te(t){return(t=String(t)).match(Zt)||t.match($t)?t:(Object(r.T)()&&tt().log("WARNING: sanitizing unsafe URL value "+t+" (see http://g.co/ng/security#xss)"),"unsafe:"+t)}var ee=null,ne=null;function re(t){for(var e={},n=0,r=t.split(",");n<r.length;n++)e[r[n]]=!0;return e}function ie(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var n={},r=0,i=t;r<i.length;r++){var o=i[r];for(var s in o)o.hasOwnProperty(s)&&(n[s]=!0)}return n}var oe=re("area,br,col,hr,img,wbr"),se=re("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),ae=re("rp,rt"),ue=ie(ae,se),le=ie(oe,ie(se,re("address,article,aside,blockquote,caption,center,del,details,dialog,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6,header,hgroup,hr,ins,main,map,menu,nav,ol,pre,section,summary,table,ul")),ie(ae,re("a,abbr,acronym,audio,b,bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,picture,q,ruby,rp,rt,s,samp,small,source,span,strike,strong,sub,sup,time,track,tt,u,var,video")),ue),ce=re("background,cite,href,itemtype,longdesc,poster,src,xlink:href"),he=re("srcset"),fe=ie(ce,he,re("abbr,accesskey,align,alt,autoplay,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,compact,controls,coords,datetime,default,dir,download,face,headers,height,hidden,hreflang,hspace,ismap,itemscope,itemprop,kind,label,lang,language,loop,media,muted,nohref,nowrap,open,preload,rel,rev,role,rows,rowspan,rules,scope,scrolling,shape,size,sizes,span,srclang,start,summary,tabindex,target,title,translate,type,usemap,valign,value,vspace,width")),pe=function(){function t(){this.sanitizedSomething=!1,this.buf=[]}return t.prototype.sanitizeChildren=function(t){for(var e=t.firstChild;e;)if(ne.isElementNode(e)?this.startElement(e):ne.isTextNode(e)?this.chars(ne.nodeValue(e)):this.sanitizedSomething=!0,ne.firstChild(e))e=ne.firstChild(e);else for(;e;){ne.isElementNode(e)&&this.endElement(e);var n=de(e,ne.nextSibling(e));if(n){e=n;break}e=de(e,ne.parentElement(e))}return this.buf.join("")},t.prototype.startElement=function(t){var e=this,n=ne.nodeName(t).toLowerCase();le.hasOwnProperty(n)?(this.buf.push("<"),this.buf.push(n),ne.attributeMap(t).forEach(function(t,n){var r,i=n.toLowerCase();fe.hasOwnProperty(i)?(ce[i]&&(t=te(t)),he[i]&&(r=t,t=(r=String(r)).split(",").map(function(t){return te(t.trim())}).join(", ")),e.buf.push(" "),e.buf.push(n),e.buf.push('="'),e.buf.push(ge(t)),e.buf.push('"')):e.sanitizedSomething=!0}),this.buf.push(">")):this.sanitizedSomething=!0},t.prototype.endElement=function(t){var e=ne.nodeName(t).toLowerCase();le.hasOwnProperty(e)&&!oe.hasOwnProperty(e)&&(this.buf.push("</"),this.buf.push(e),this.buf.push(">"))},t.prototype.chars=function(t){this.buf.push(ge(t))},t}();function de(t,e){if(e&&ne.contains(t,e))throw new Error("Failed to sanitize html because the element is clobbered: "+ne.getOuterHTML(t));return e}var ye=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,me=/([^\#-~ |!])/g;function ge(t){return t.replace(/&/g,"&amp;").replace(ye,function(t){return"&#"+(1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320)+65536)+";"}).replace(me,function(t){return"&#"+t.charCodeAt(0)+";"}).replace(/</g,"&lt;").replace(/>/g,"&gt;")}function ve(t){ne.attributeMap(t).forEach(function(e,n){"xmlns:ns1"!==n&&0!==n.indexOf("ns1:")||ne.removeAttribute(t,n)});for(var e=0,n=ne.childNodesAsList(t);e<n.length;e++){var r=n[e];ne.isElementNode(r)&&ve(r)}}var _e=new RegExp("^([-,.\"'%_!# a-zA-Z0-9]+|(?:(?:matrix|translate|scale|rotate|skew|perspective)(?:X|Y|3d)?|(?:rgb|hsl)a?|(?:repeating-)?(?:linear|radial)-gradient|(?:calc|attr))\\([-0-9.%, #a-zA-Z]+\\))$","g"),be=/^url\(([^)]+)\)$/,we=function(){},Ee=function(t){function e(e){var n=t.call(this)||this;return n._doc=e,n}return Object(i.__extends)(e,t),e.prototype.sanitize=function(t,e){if(null==e)return null;switch(t){case r.F.NONE:return e;case r.F.HTML:return e instanceof Ce?e.changingThisBreaksApplicationSecurity:(this.checkNotSafeValue(e,"HTML"),function(t,e){try{var n=function(){if(ee)return ee;var t=(ne=tt()).createElement("template");if("content"in t)return t;var e=ne.createHtmlDocument();if(null==(ee=ne.querySelector(e,"body"))){var n=ne.createElement("html",e);ee=ne.createElement("body",e),ne.appendChild(n,ee),ne.appendChild(e,n)}return ee}(),i=e?String(e):"",o=5,s=i;do{if(0===o)throw new Error("Failed to sanitize html because the input is unstable");o--,ne.setInnerHTML(n,i=s),t.documentMode&&ve(n),s=ne.getInnerHTML(n)}while(i!==s);for(var a=new pe,u=a.sanitizeChildren(ne.getTemplateContent(n)||n),l=ne.getTemplateContent(n)||n,c=0,h=ne.childNodesAsList(l);c<h.length;c++)ne.removeChild(l,h[c]);return Object(r.T)()&&a.sanitizedSomething&&ne.log("WARNING: sanitizing HTML stripped some content (see http://g.co/ng/security#xss)."),u}catch(t){throw ee=null,t}}(this._doc,String(e)));case r.F.STYLE:return e instanceof Te?e.changingThisBreaksApplicationSecurity:(this.checkNotSafeValue(e,"Style"),function(t){if(!(t=String(t).trim()))return"";var e=t.match(be);return e&&te(e[1])===e[1]||t.match(_e)&&function(t){for(var e=!0,n=!0,r=0;r<t.length;r++){var i=t.charAt(r);"'"===i&&n?e=!e:'"'===i&&e&&(n=!n)}return e&&n}(t)?t:(Object(r.T)()&&tt().log("WARNING: sanitizing unsafe style value "+t+" (see http://g.co/ng/security#xss)."),"unsafe")}(e));case r.F.SCRIPT:if(e instanceof Ie)return e.changingThisBreaksApplicationSecurity;throw this.checkNotSafeValue(e,"Script"),new Error("unsafe value used in a script context");case r.F.URL:return e instanceof xe||e instanceof ke?e.changingThisBreaksApplicationSecurity:(this.checkNotSafeValue(e,"URL"),te(String(e)));case r.F.RESOURCE_URL:if(e instanceof xe)return e.changingThisBreaksApplicationSecurity;throw this.checkNotSafeValue(e,"ResourceURL"),new Error("unsafe value used in a resource URL context (see http://g.co/ng/security#xss)");default:throw new Error("Unexpected SecurityContext "+t+" (see http://g.co/ng/security#xss)")}},e.prototype.checkNotSafeValue=function(t,e){if(t instanceof Se)throw new Error("Required a safe "+e+", got a "+t.getTypeName()+" (see http://g.co/ng/security#xss)")},e.prototype.bypassSecurityTrustHtml=function(t){return new Ce(t)},e.prototype.bypassSecurityTrustStyle=function(t){return new Te(t)},e.prototype.bypassSecurityTrustScript=function(t){return new Ie(t)},e.prototype.bypassSecurityTrustUrl=function(t){return new ke(t)},e.prototype.bypassSecurityTrustResourceUrl=function(t){return new xe(t)},e}(we),Se=function(){function t(t){this.changingThisBreaksApplicationSecurity=t}return t.prototype.toString=function(){return"SafeValue must use [property]=binding: "+this.changingThisBreaksApplicationSecurity+" (see http://g.co/ng/security#xss)"},t}(),Ce=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(i.__extends)(e,t),e.prototype.getTypeName=function(){return"HTML"},e}(Se),Te=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(i.__extends)(e,t),e.prototype.getTypeName=function(){return"Style"},e}(Se),Ie=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(i.__extends)(e,t),e.prototype.getTypeName=function(){return"Script"},e}(Se),ke=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(i.__extends)(e,t),e.prototype.getTypeName=function(){return"URL"},e}(Se),xe=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(i.__extends)(e,t),e.prototype.getTypeName=function(){return"ResourceURL"},e}(Se),Ae=[{provide:r.z,useValue:"browser"},{provide:r.A,useValue:function(){st.makeCurrent(),dt.init()},multi:!0},{provide:E,useClass:ct,deps:[ut]},{provide:ut,useFactory:function(){return document},deps:[]}],Oe=Object(r.P)(r.U,"browser",Ae);function Pe(){return new r.l}var Ne=function(){function t(t){if(t)throw new Error("BrowserModule has already been loaded. If you need access to common directives such as NgIf and NgFor from a lazy loaded module, import CommonModule instead.")}return t.withServerTransition=function(e){return{ngModule:t,providers:[{provide:r.c,useValue:e.appId},{provide:ft,useExisting:r.c},pt]}},t}();"undefined"!=typeof window&&window;var Re=function(){function t(){}return Object.defineProperty(t.prototype,"value",{get:function(){return this.control?this.control.value:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"valid",{get:function(){return this.control?this.control.valid:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"invalid",{get:function(){return this.control?this.control.invalid:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"pending",{get:function(){return this.control?this.control.pending:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"disabled",{get:function(){return this.control?this.control.disabled:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"enabled",{get:function(){return this.control?this.control.enabled:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"errors",{get:function(){return this.control?this.control.errors:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"pristine",{get:function(){return this.control?this.control.pristine:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dirty",{get:function(){return this.control?this.control.dirty:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"touched",{get:function(){return this.control?this.control.touched:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"status",{get:function(){return this.control?this.control.status:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"untouched",{get:function(){return this.control?this.control.untouched:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"statusChanges",{get:function(){return this.control?this.control.statusChanges:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"valueChanges",{get:function(){return this.control?this.control.valueChanges:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"path",{get:function(){return null},enumerable:!0,configurable:!0}),t.prototype.reset=function(t){void 0===t&&(t=void 0),this.control&&this.control.reset(t)},t.prototype.hasError=function(t,e){return!!this.control&&this.control.hasError(t,e)},t.prototype.getError=function(t,e){return this.control?this.control.getError(t,e):null},t}(),De=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(i.__extends)(e,t),Object.defineProperty(e.prototype,"formDirective",{get:function(){return null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"path",{get:function(){return null},enumerable:!0,configurable:!0}),e}(Re);function Me(t){return null==t||0===t.length}var Ve=/^(?=.{1,254}$)(?=.{1,64}@)[-!#$%&'*+/0-9=?A-Z^_`a-z{|}~]+(\.[-!#$%&'*+/0-9=?A-Z^_`a-z{|}~]+)*@[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?(\.[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?)*$/,Fe=function(){function t(){}return t.min=function(t){return function(e){if(Me(e.value)||Me(t))return null;var n=parseFloat(e.value);return!isNaN(n)&&n<t?{min:{min:t,actual:e.value}}:null}},t.max=function(t){return function(e){if(Me(e.value)||Me(t))return null;var n=parseFloat(e.value);return!isNaN(n)&&n>t?{max:{max:t,actual:e.value}}:null}},t.required=function(t){return Me(t.value)?{required:!0}:null},t.requiredTrue=function(t){return!0===t.value?null:{required:!0}},t.email=function(t){return Ve.test(t.value)?null:{email:!0}},t.minLength=function(t){return function(e){if(Me(e.value))return null;var n=e.value?e.value.length:0;return n<t?{minlength:{requiredLength:t,actualLength:n}}:null}},t.maxLength=function(t){return function(e){var n=e.value?e.value.length:0;return n>t?{maxlength:{requiredLength:t,actualLength:n}}:null}},t.pattern=function(e){return e?("string"==typeof e?(r="","^"!==e.charAt(0)&&(r+="^"),r+=e,"$"!==e.charAt(e.length-1)&&(r+="$"),n=new RegExp(r)):(r=e.toString(),n=e),function(t){if(Me(t.value))return null;var e=t.value;return n.test(e)?null:{pattern:{requiredPattern:r,actualValue:e}}}):t.nullValidator;var n,r},t.nullValidator=function(t){return null},t.compose=function(t){if(!t)return null;var e=t.filter(je);return 0==e.length?null:function(t){return Ue(function(t,n){return e.map(function(e){return e(t)})}(t))}},t.composeAsync=function(t){if(!t)return null;var e=t.filter(je);return 0==e.length?null:function(t){var n=function(t,n){return e.map(function(e){return e(t)})}(t).map(Le);return w.call(f(n),Ue)}},t}();function je(t){return null!=t}function Le(t){var e=Object(r._9)(t)?g(t):t;if(!Object(r._8)(e))throw new Error("Expected validator to return Promise or Observable.");return e}function Ue(t){var e=t.reduce(function(t,e){return null!=e?Object(i.__assign)({},t,e):t},{});return 0===Object.keys(e).length?null:e}var Be=new r.o("NgValueAccessor"),qe=function(){function t(t,e){this._renderer=t,this._elementRef=e,this.onChange=function(t){},this.onTouched=function(){}}return t.prototype.writeValue=function(t){this._renderer.setProperty(this._elementRef.nativeElement,"checked",t)},t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.setDisabledState=function(t){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",t)},t}(),He=new r.o("CompositionEventMode"),Ke=function(){function t(t,e,n){var r;this._renderer=t,this._elementRef=e,this._compositionMode=n,this.onChange=function(t){},this.onTouched=function(){},this._composing=!1,null==this._compositionMode&&(this._compositionMode=(r=tt()?tt().getUserAgent():"",!/android (\d+)/.test(r.toLowerCase())))}return t.prototype.writeValue=function(t){this._renderer.setProperty(this._elementRef.nativeElement,"value",null==t?"":t)},t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.setDisabledState=function(t){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",t)},t.prototype._handleInput=function(t){(!this._compositionMode||this._compositionMode&&!this._composing)&&this.onChange(t)},t.prototype._compositionStart=function(){this._composing=!0},t.prototype._compositionEnd=function(t){this._composing=!1,this._compositionMode&&this.onChange(t)},t}();function ze(t){return t.validate?function(e){return t.validate(e)}:t}function Qe(t){return t.validate?function(e){return t.validate(e)}:t}var Ge=function(){function t(t,e){this._renderer=t,this._elementRef=e,this.onChange=function(t){},this.onTouched=function(){}}return t.prototype.writeValue=function(t){this._renderer.setProperty(this._elementRef.nativeElement,"value",null==t?"":t)},t.prototype.registerOnChange=function(t){this.onChange=function(e){t(""==e?null:parseFloat(e))}},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.setDisabledState=function(t){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",t)},t}();function We(){throw new Error("unimplemented")}var Ye=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._parent=null,e.name=null,e.valueAccessor=null,e._rawValidators=[],e._rawAsyncValidators=[],e}return Object(i.__extends)(e,t),Object.defineProperty(e.prototype,"validator",{get:function(){return We()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"asyncValidator",{get:function(){return We()},enumerable:!0,configurable:!0}),e}(Re),Je=function(){function t(){this._accessors=[]}return t.prototype.add=function(t,e){this._accessors.push([t,e])},t.prototype.remove=function(t){for(var e=this._accessors.length-1;e>=0;--e)if(this._accessors[e][1]===t)return void this._accessors.splice(e,1)},t.prototype.select=function(t){var e=this;this._accessors.forEach(function(n){e._isSameGroup(n,t)&&n[1]!==t&&n[1].fireUncheck(t.value)})},t.prototype._isSameGroup=function(t,e){return!!t[0].control&&t[0]._parent===e._control._parent&&t[1].name===e.name},t}(),Xe=function(){function t(t,e,n,r){this._renderer=t,this._elementRef=e,this._registry=n,this._injector=r,this.onChange=function(){},this.onTouched=function(){}}return t.prototype.ngOnInit=function(){this._control=this._injector.get(Ye),this._checkName(),this._registry.add(this._control,this)},t.prototype.ngOnDestroy=function(){this._registry.remove(this)},t.prototype.writeValue=function(t){this._state=t===this.value,this._renderer.setProperty(this._elementRef.nativeElement,"checked",this._state)},t.prototype.registerOnChange=function(t){var e=this;this._fn=t,this.onChange=function(){t(e.value),e._registry.select(e)}},t.prototype.fireUncheck=function(t){this.writeValue(t)},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.setDisabledState=function(t){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",t)},t.prototype._checkName=function(){this.name&&this.formControlName&&this.name!==this.formControlName&&this._throwNameError(),!this.name&&this.formControlName&&(this.name=this.formControlName)},t.prototype._throwNameError=function(){throw new Error('\n      If you define both a name and a formControlName attribute on your radio button, their values\n      must match. Ex: <input type="radio" formControlName="food" name="food">\n    ')},t}(),Ze=function(){function t(t,e){this._renderer=t,this._elementRef=e,this.onChange=function(t){},this.onTouched=function(){}}return t.prototype.writeValue=function(t){this._renderer.setProperty(this._elementRef.nativeElement,"value",parseFloat(t))},t.prototype.registerOnChange=function(t){this.onChange=function(e){t(""==e?null:parseFloat(e))}},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.setDisabledState=function(t){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",t)},t}();function $e(t,e){return null==t?""+e:(e&&"object"==typeof e&&(e="Object"),(t+": "+e).slice(0,50))}var tn=function(){function t(t,e){this._renderer=t,this._elementRef=e,this._optionMap=new Map,this._idCounter=0,this.onChange=function(t){},this.onTouched=function(){},this._compareWith=r._10}return Object.defineProperty(t.prototype,"compareWith",{set:function(t){if("function"!=typeof t)throw new Error("compareWith must be a function, but received "+JSON.stringify(t));this._compareWith=t},enumerable:!0,configurable:!0}),t.prototype.writeValue=function(t){this.value=t;var e=this._getOptionId(t);null==e&&this._renderer.setProperty(this._elementRef.nativeElement,"selectedIndex",-1);var n=$e(e,t);this._renderer.setProperty(this._elementRef.nativeElement,"value",n)},t.prototype.registerOnChange=function(t){var e=this;this.onChange=function(n){e.value=e._getOptionValue(n),t(e.value)}},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.setDisabledState=function(t){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",t)},t.prototype._registerOption=function(){return(this._idCounter++).toString()},t.prototype._getOptionId=function(t){for(var e=0,n=Array.from(this._optionMap.keys());e<n.length;e++){var r=n[e];if(this._compareWith(this._optionMap.get(r),t))return r}return null},t.prototype._getOptionValue=function(t){var e=function(t){return t.split(":")[0]}(t);return this._optionMap.has(e)?this._optionMap.get(e):t},t}(),en=function(){function t(t,e,n){this._element=t,this._renderer=e,this._select=n,this._select&&(this.id=this._select._registerOption())}return Object.defineProperty(t.prototype,"ngValue",{set:function(t){null!=this._select&&(this._select._optionMap.set(this.id,t),this._setElementValue($e(this.id,t)),this._select.writeValue(this._select.value))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"value",{set:function(t){this._setElementValue(t),this._select&&this._select.writeValue(this._select.value)},enumerable:!0,configurable:!0}),t.prototype._setElementValue=function(t){this._renderer.setProperty(this._element.nativeElement,"value",t)},t.prototype.ngOnDestroy=function(){this._select&&(this._select._optionMap.delete(this.id),this._select.writeValue(this._select.value))},t}();function nn(t,e){return null==t?""+e:("string"==typeof e&&(e="'"+e+"'"),e&&"object"==typeof e&&(e="Object"),(t+": "+e).slice(0,50))}var rn=function(){function t(t,e){this._renderer=t,this._elementRef=e,this._optionMap=new Map,this._idCounter=0,this.onChange=function(t){},this.onTouched=function(){},this._compareWith=r._10}return Object.defineProperty(t.prototype,"compareWith",{set:function(t){if("function"!=typeof t)throw new Error("compareWith must be a function, but received "+JSON.stringify(t));this._compareWith=t},enumerable:!0,configurable:!0}),t.prototype.writeValue=function(t){var e,n=this;if(this.value=t,Array.isArray(t)){var r=t.map(function(t){return n._getOptionId(t)});e=function(t,e){t._setSelected(r.indexOf(e.toString())>-1)}}else e=function(t,e){t._setSelected(!1)};this._optionMap.forEach(e)},t.prototype.registerOnChange=function(t){var e=this;this.onChange=function(n){var r=[];if(n.hasOwnProperty("selectedOptions"))for(var i=n.selectedOptions,o=0;o<i.length;o++){var s=i.item(o),a=e._getOptionValue(s.value);r.push(a)}else for(i=n.options,o=0;o<i.length;o++)(s=i.item(o)).selected&&(a=e._getOptionValue(s.value),r.push(a));e.value=r,t(r)}},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.setDisabledState=function(t){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",t)},t.prototype._registerOption=function(t){var e=(this._idCounter++).toString();return this._optionMap.set(e,t),e},t.prototype._getOptionId=function(t){for(var e=0,n=Array.from(this._optionMap.keys());e<n.length;e++){var r=n[e];if(this._compareWith(this._optionMap.get(r)._value,t))return r}return null},t.prototype._getOptionValue=function(t){var e=function(t){return t.split(":")[0]}(t);return this._optionMap.has(e)?this._optionMap.get(e)._value:t},t}(),on=function(){function t(t,e,n){this._element=t,this._renderer=e,this._select=n,this._select&&(this.id=this._select._registerOption(this))}return Object.defineProperty(t.prototype,"ngValue",{set:function(t){null!=this._select&&(this._value=t,this._setElementValue(nn(this.id,t)),this._select.writeValue(this._select.value))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"value",{set:function(t){this._select?(this._value=t,this._setElementValue(nn(this.id,t)),this._select.writeValue(this._select.value)):this._setElementValue(t)},enumerable:!0,configurable:!0}),t.prototype._setElementValue=function(t){this._renderer.setProperty(this._element.nativeElement,"value",t)},t.prototype._setSelected=function(t){this._renderer.setProperty(this._element.nativeElement,"selected",t)},t.prototype.ngOnDestroy=function(){this._select&&(this._select._optionMap.delete(this.id),this._select.writeValue(this._select.value))},t}();function sn(t,e){return e.path.concat([t])}function an(t,e){t||hn(e,"Cannot find control with"),e.valueAccessor||hn(e,"No value accessor for form control with"),t.validator=Fe.compose([t.validator,e.validator]),t.asyncValidator=Fe.composeAsync([t.asyncValidator,e.asyncValidator]),e.valueAccessor.writeValue(t.value),function(t,e){e.valueAccessor.registerOnChange(function(n){t._pendingValue=n,t._pendingChange=!0,t._pendingDirty=!0,"change"===t.updateOn&&un(t,e)})}(t,e),function(t,e){t.registerOnChange(function(t,n){e.valueAccessor.writeValue(t),n&&e.viewToModelUpdate(t)})}(t,e),function(t,e){e.valueAccessor.registerOnTouched(function(){t._pendingTouched=!0,"blur"===t.updateOn&&t._pendingChange&&un(t,e),"submit"!==t.updateOn&&t.markAsTouched()})}(t,e),e.valueAccessor.setDisabledState&&t.registerOnDisabledChange(function(t){e.valueAccessor.setDisabledState(t)}),e._rawValidators.forEach(function(e){e.registerOnValidatorChange&&e.registerOnValidatorChange(function(){return t.updateValueAndValidity()})}),e._rawAsyncValidators.forEach(function(e){e.registerOnValidatorChange&&e.registerOnValidatorChange(function(){return t.updateValueAndValidity()})})}function un(t,e){e.viewToModelUpdate(t._pendingValue),t._pendingDirty&&t.markAsDirty(),t.setValue(t._pendingValue,{emitModelToViewChange:!1}),t._pendingChange=!1}function ln(t,e){null==t&&hn(e,"Cannot find control with"),t.validator=Fe.compose([t.validator,e.validator]),t.asyncValidator=Fe.composeAsync([t.asyncValidator,e.asyncValidator])}function cn(t){return hn(t,"There is no FormControl instance attached to form control element with")}function hn(t,e){var n;throw n=t.path.length>1?"path: '"+t.path.join(" -> ")+"'":t.path[0]?"name: '"+t.path+"'":"unspecified name attribute",new Error(e+" "+n)}function fn(t){return null!=t?Fe.compose(t.map(ze)):null}function pn(t){return null!=t?Fe.composeAsync(t.map(Qe)):null}function dn(t,e){if(!t.hasOwnProperty("model"))return!1;var n=t.model;return!!n.isFirstChange()||!Object(r._10)(e,n.currentValue)}var yn=[qe,Ze,Ge,tn,rn,Xe];function mn(t,e){if(!e)return null;var n=void 0,r=void 0,i=void 0;return e.forEach(function(e){var o;e.constructor===Ke?n=e:(o=e,yn.some(function(t){return o.constructor===t})?(r&&hn(t,"More than one built-in value accessor matches form control with"),r=e):(i&&hn(t,"More than one custom value accessor matches form control with"),i=e))}),i||r||n||(hn(t,"No valid value accessor for form control with"),null)}var gn=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(i.__extends)(e,t),e.prototype.ngOnInit=function(){this._checkParentType(),this.formDirective.addFormGroup(this)},e.prototype.ngOnDestroy=function(){this.formDirective&&this.formDirective.removeFormGroup(this)},Object.defineProperty(e.prototype,"control",{get:function(){return this.formDirective.getFormGroup(this)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"path",{get:function(){return sn(this.name,this._parent)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"formDirective",{get:function(){return this._parent?this._parent.formDirective:null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"validator",{get:function(){return fn(this._validators)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"asyncValidator",{get:function(){return pn(this._asyncValidators)},enumerable:!0,configurable:!0}),e.prototype._checkParentType=function(){},e}(De),vn=function(){function t(t){this._cd=t}return Object.defineProperty(t.prototype,"ngClassUntouched",{get:function(){return!!this._cd.control&&this._cd.control.untouched},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ngClassTouched",{get:function(){return!!this._cd.control&&this._cd.control.touched},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ngClassPristine",{get:function(){return!!this._cd.control&&this._cd.control.pristine},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ngClassDirty",{get:function(){return!!this._cd.control&&this._cd.control.dirty},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ngClassValid",{get:function(){return!!this._cd.control&&this._cd.control.valid},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ngClassInvalid",{get:function(){return!!this._cd.control&&this._cd.control.invalid},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ngClassPending",{get:function(){return!!this._cd.control&&this._cd.control.pending},enumerable:!0,configurable:!0}),t}(),_n=function(t){function e(e){return t.call(this,e)||this}return Object(i.__extends)(e,t),e}(vn),bn=function(t){function e(e){return t.call(this,e)||this}return Object(i.__extends)(e,t),e}(vn);function wn(t){var e=Sn(t)?t.validators:t;return Array.isArray(e)?fn(e):e||null}function En(t,e){var n=Sn(e)?e.asyncValidators:t;return Array.isArray(n)?pn(n):n||null}function Sn(t){return null!=t&&!Array.isArray(t)&&"object"==typeof t}var Cn=function(){function t(t,e){this.validator=t,this.asyncValidator=e,this._onCollectionChange=function(){},this.pristine=!0,this.touched=!1,this._onDisabledChange=[]}return Object.defineProperty(t.prototype,"parent",{get:function(){return this._parent},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"valid",{get:function(){return"VALID"===this.status},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"invalid",{get:function(){return"INVALID"===this.status},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"pending",{get:function(){return"PENDING"==this.status},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"disabled",{get:function(){return"DISABLED"===this.status},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"enabled",{get:function(){return"DISABLED"!==this.status},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dirty",{get:function(){return!this.pristine},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"untouched",{get:function(){return!this.touched},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"updateOn",{get:function(){return this._updateOn?this._updateOn:this.parent?this.parent.updateOn:"change"},enumerable:!0,configurable:!0}),t.prototype.setValidators=function(t){this.validator=wn(t)},t.prototype.setAsyncValidators=function(t){this.asyncValidator=En(t)},t.prototype.clearValidators=function(){this.validator=null},t.prototype.clearAsyncValidators=function(){this.asyncValidator=null},t.prototype.markAsTouched=function(t){void 0===t&&(t={}),this.touched=!0,this._parent&&!t.onlySelf&&this._parent.markAsTouched(t)},t.prototype.markAsUntouched=function(t){void 0===t&&(t={}),this.touched=!1,this._pendingTouched=!1,this._forEachChild(function(t){t.markAsUntouched({onlySelf:!0})}),this._parent&&!t.onlySelf&&this._parent._updateTouched(t)},t.prototype.markAsDirty=function(t){void 0===t&&(t={}),this.pristine=!1,this._parent&&!t.onlySelf&&this._parent.markAsDirty(t)},t.prototype.markAsPristine=function(t){void 0===t&&(t={}),this.pristine=!0,this._pendingDirty=!1,this._forEachChild(function(t){t.markAsPristine({onlySelf:!0})}),this._parent&&!t.onlySelf&&this._parent._updatePristine(t)},t.prototype.markAsPending=function(t){void 0===t&&(t={}),this.status="PENDING",this._parent&&!t.onlySelf&&this._parent.markAsPending(t)},t.prototype.disable=function(t){void 0===t&&(t={}),this.status="DISABLED",this.errors=null,this._forEachChild(function(t){t.disable({onlySelf:!0})}),this._updateValue(),!1!==t.emitEvent&&(this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._updateAncestors(!!t.onlySelf),this._onDisabledChange.forEach(function(t){return t(!0)})},t.prototype.enable=function(t){void 0===t&&(t={}),this.status="VALID",this._forEachChild(function(t){t.enable({onlySelf:!0})}),this.updateValueAndValidity({onlySelf:!0,emitEvent:t.emitEvent}),this._updateAncestors(!!t.onlySelf),this._onDisabledChange.forEach(function(t){return t(!1)})},t.prototype._updateAncestors=function(t){this._parent&&!t&&(this._parent.updateValueAndValidity(),this._parent._updatePristine(),this._parent._updateTouched())},t.prototype.setParent=function(t){this._parent=t},t.prototype.updateValueAndValidity=function(t){void 0===t&&(t={}),this._setInitialStatus(),this._updateValue(),this.enabled&&(this._cancelExistingSubscription(),this.errors=this._runValidator(),this.status=this._calculateStatus(),"VALID"!==this.status&&"PENDING"!==this.status||this._runAsyncValidator(t.emitEvent)),!1!==t.emitEvent&&(this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._parent&&!t.onlySelf&&this._parent.updateValueAndValidity(t)},t.prototype._updateTreeValidity=function(t){void 0===t&&(t={emitEvent:!0}),this._forEachChild(function(e){return e._updateTreeValidity(t)}),this.updateValueAndValidity({onlySelf:!0,emitEvent:t.emitEvent})},t.prototype._setInitialStatus=function(){this.status=this._allControlsDisabled()?"DISABLED":"VALID"},t.prototype._runValidator=function(){return this.validator?this.validator(this):null},t.prototype._runAsyncValidator=function(t){var e=this;if(this.asyncValidator){this.status="PENDING";var n=Le(this.asyncValidator(this));this._asyncValidationSubscription=n.subscribe(function(n){return e.setErrors(n,{emitEvent:t})})}},t.prototype._cancelExistingSubscription=function(){this._asyncValidationSubscription&&this._asyncValidationSubscription.unsubscribe()},t.prototype.setErrors=function(t,e){void 0===e&&(e={}),this.errors=t,this._updateControlsErrors(!1!==e.emitEvent)},t.prototype.get=function(t){return function(t,e,n){return null==e?null:(e instanceof Array||(e=e.split(".")),e instanceof Array&&0===e.length?null:e.reduce(function(t,e){return t instanceof In?t.controls[e]||null:t instanceof kn&&t.at(e)||null},t))}(this,t)},t.prototype.getError=function(t,e){var n=e?this.get(e):this;return n&&n.errors?n.errors[t]:null},t.prototype.hasError=function(t,e){return!!this.getError(t,e)},Object.defineProperty(t.prototype,"root",{get:function(){for(var t=this;t._parent;)t=t._parent;return t},enumerable:!0,configurable:!0}),t.prototype._updateControlsErrors=function(t){this.status=this._calculateStatus(),t&&this.statusChanges.emit(this.status),this._parent&&this._parent._updateControlsErrors(t)},t.prototype._initObservables=function(){this.valueChanges=new r.m,this.statusChanges=new r.m},t.prototype._calculateStatus=function(){return this._allControlsDisabled()?"DISABLED":this.errors?"INVALID":this._anyControlsHaveStatus("PENDING")?"PENDING":this._anyControlsHaveStatus("INVALID")?"INVALID":"VALID"},t.prototype._anyControlsHaveStatus=function(t){return this._anyControls(function(e){return e.status===t})},t.prototype._anyControlsDirty=function(){return this._anyControls(function(t){return t.dirty})},t.prototype._anyControlsTouched=function(){return this._anyControls(function(t){return t.touched})},t.prototype._updatePristine=function(t){void 0===t&&(t={}),this.pristine=!this._anyControlsDirty(),this._parent&&!t.onlySelf&&this._parent._updatePristine(t)},t.prototype._updateTouched=function(t){void 0===t&&(t={}),this.touched=this._anyControlsTouched(),this._parent&&!t.onlySelf&&this._parent._updateTouched(t)},t.prototype._isBoxedValue=function(t){return"object"==typeof t&&null!==t&&2===Object.keys(t).length&&"value"in t&&"disabled"in t},t.prototype._registerOnCollectionChange=function(t){this._onCollectionChange=t},t.prototype._setUpdateStrategy=function(t){Sn(t)&&null!=t.updateOn&&(this._updateOn=t.updateOn)},t}(),Tn=function(t){function e(e,n,r){void 0===e&&(e=null);var i=t.call(this,wn(n),En(r,n))||this;return i._onChange=[],i._applyFormState(e),i._setUpdateStrategy(n),i.updateValueAndValidity({onlySelf:!0,emitEvent:!1}),i._initObservables(),i}return Object(i.__extends)(e,t),e.prototype.setValue=function(t,e){var n=this;void 0===e&&(e={}),this.value=this._pendingValue=t,this._onChange.length&&!1!==e.emitModelToViewChange&&this._onChange.forEach(function(t){return t(n.value,!1!==e.emitViewToModelChange)}),this.updateValueAndValidity(e)},e.prototype.patchValue=function(t,e){void 0===e&&(e={}),this.setValue(t,e)},e.prototype.reset=function(t,e){void 0===t&&(t=null),void 0===e&&(e={}),this._applyFormState(t),this.markAsPristine(e),this.markAsUntouched(e),this.setValue(this.value,e),this._pendingChange=!1},e.prototype._updateValue=function(){},e.prototype._anyControls=function(t){return!1},e.prototype._allControlsDisabled=function(){return this.disabled},e.prototype.registerOnChange=function(t){this._onChange.push(t)},e.prototype._clearChangeFns=function(){this._onChange=[],this._onDisabledChange=[],this._onCollectionChange=function(){}},e.prototype.registerOnDisabledChange=function(t){this._onDisabledChange.push(t)},e.prototype._forEachChild=function(t){},e.prototype._syncPendingControls=function(){return!("submit"!==this.updateOn||(this._pendingDirty&&this.markAsDirty(),this._pendingTouched&&this.markAsTouched(),!this._pendingChange)||(this.setValue(this._pendingValue,{onlySelf:!0,emitModelToViewChange:!1}),0))},e.prototype._applyFormState=function(t){this._isBoxedValue(t)?(this.value=this._pendingValue=t.value,t.disabled?this.disable({onlySelf:!0,emitEvent:!1}):this.enable({onlySelf:!0,emitEvent:!1})):this.value=this._pendingValue=t},e}(Cn),In=function(t){function e(e,n,r){var i=t.call(this,wn(n),En(r,n))||this;return i.controls=e,i._initObservables(),i._setUpdateStrategy(n),i._setUpControls(),i.updateValueAndValidity({onlySelf:!0,emitEvent:!1}),i}return Object(i.__extends)(e,t),e.prototype.registerControl=function(t,e){return this.controls[t]?this.controls[t]:(this.controls[t]=e,e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange),e)},e.prototype.addControl=function(t,e){this.registerControl(t,e),this.updateValueAndValidity(),this._onCollectionChange()},e.prototype.removeControl=function(t){this.controls[t]&&this.controls[t]._registerOnCollectionChange(function(){}),delete this.controls[t],this.updateValueAndValidity(),this._onCollectionChange()},e.prototype.setControl=function(t,e){this.controls[t]&&this.controls[t]._registerOnCollectionChange(function(){}),delete this.controls[t],e&&this.registerControl(t,e),this.updateValueAndValidity(),this._onCollectionChange()},e.prototype.contains=function(t){return this.controls.hasOwnProperty(t)&&this.controls[t].enabled},e.prototype.setValue=function(t,e){var n=this;void 0===e&&(e={}),this._checkAllValuesPresent(t),Object.keys(t).forEach(function(r){n._throwIfControlMissing(r),n.controls[r].setValue(t[r],{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e)},e.prototype.patchValue=function(t,e){var n=this;void 0===e&&(e={}),Object.keys(t).forEach(function(r){n.controls[r]&&n.controls[r].patchValue(t[r],{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e)},e.prototype.reset=function(t,e){void 0===t&&(t={}),void 0===e&&(e={}),this._forEachChild(function(n,r){n.reset(t[r],{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e),this._updatePristine(e),this._updateTouched(e)},e.prototype.getRawValue=function(){return this._reduceChildren({},function(t,e,n){return t[n]=e instanceof Tn?e.value:e.getRawValue(),t})},e.prototype._syncPendingControls=function(){var t=this._reduceChildren(!1,function(t,e){return!!e._syncPendingControls()||t});return t&&this.updateValueAndValidity({onlySelf:!0}),t},e.prototype._throwIfControlMissing=function(t){if(!Object.keys(this.controls).length)throw new Error("\n        There are no form controls registered with this group yet.  If you're using ngModel,\n        you may want to check next tick (e.g. use setTimeout).\n      ");if(!this.controls[t])throw new Error("Cannot find form control with name: "+t+".")},e.prototype._forEachChild=function(t){var e=this;Object.keys(this.controls).forEach(function(n){return t(e.controls[n],n)})},e.prototype._setUpControls=function(){var t=this;this._forEachChild(function(e){e.setParent(t),e._registerOnCollectionChange(t._onCollectionChange)})},e.prototype._updateValue=function(){this.value=this._reduceValue()},e.prototype._anyControls=function(t){var e=this,n=!1;return this._forEachChild(function(r,i){n=n||e.contains(i)&&t(r)}),n},e.prototype._reduceValue=function(){var t=this;return this._reduceChildren({},function(e,n,r){return(n.enabled||t.disabled)&&(e[r]=n.value),e})},e.prototype._reduceChildren=function(t,e){var n=t;return this._forEachChild(function(t,r){n=e(n,t,r)}),n},e.prototype._allControlsDisabled=function(){for(var t=0,e=Object.keys(this.controls);t<e.length;t++)if(this.controls[e[t]].enabled)return!1;return Object.keys(this.controls).length>0||this.disabled},e.prototype._checkAllValuesPresent=function(t){this._forEachChild(function(e,n){if(void 0===t[n])throw new Error("Must supply a value for form control with name: '"+n+"'.")})},e}(Cn),kn=function(t){function e(e,n,r){var i=t.call(this,wn(n),En(r,n))||this;return i.controls=e,i._initObservables(),i._setUpdateStrategy(n),i._setUpControls(),i.updateValueAndValidity({onlySelf:!0,emitEvent:!1}),i}return Object(i.__extends)(e,t),e.prototype.at=function(t){return this.controls[t]},e.prototype.push=function(t){this.controls.push(t),this._registerControl(t),this.updateValueAndValidity(),this._onCollectionChange()},e.prototype.insert=function(t,e){this.controls.splice(t,0,e),this._registerControl(e),this.updateValueAndValidity(),this._onCollectionChange()},e.prototype.removeAt=function(t){this.controls[t]&&this.controls[t]._registerOnCollectionChange(function(){}),this.controls.splice(t,1),this.updateValueAndValidity(),this._onCollectionChange()},e.prototype.setControl=function(t,e){this.controls[t]&&this.controls[t]._registerOnCollectionChange(function(){}),this.controls.splice(t,1),e&&(this.controls.splice(t,0,e),this._registerControl(e)),this.updateValueAndValidity(),this._onCollectionChange()},Object.defineProperty(e.prototype,"length",{get:function(){return this.controls.length},enumerable:!0,configurable:!0}),e.prototype.setValue=function(t,e){var n=this;void 0===e&&(e={}),this._checkAllValuesPresent(t),t.forEach(function(t,r){n._throwIfControlMissing(r),n.at(r).setValue(t,{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e)},e.prototype.patchValue=function(t,e){var n=this;void 0===e&&(e={}),t.forEach(function(t,r){n.at(r)&&n.at(r).patchValue(t,{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e)},e.prototype.reset=function(t,e){void 0===t&&(t=[]),void 0===e&&(e={}),this._forEachChild(function(n,r){n.reset(t[r],{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e),this._updatePristine(e),this._updateTouched(e)},e.prototype.getRawValue=function(){return this.controls.map(function(t){return t instanceof Tn?t.value:t.getRawValue()})},e.prototype._syncPendingControls=function(){var t=this.controls.reduce(function(t,e){return!!e._syncPendingControls()||t},!1);return t&&this.updateValueAndValidity({onlySelf:!0}),t},e.prototype._throwIfControlMissing=function(t){if(!this.controls.length)throw new Error("\n        There are no form controls registered with this array yet.  If you're using ngModel,\n        you may want to check next tick (e.g. use setTimeout).\n      ");if(!this.at(t))throw new Error("Cannot find form control at index "+t)},e.prototype._forEachChild=function(t){this.controls.forEach(function(e,n){t(e,n)})},e.prototype._updateValue=function(){var t=this;this.value=this.controls.filter(function(e){return e.enabled||t.disabled}).map(function(t){return t.value})},e.prototype._anyControls=function(t){return this.controls.some(function(e){return e.enabled&&t(e)})},e.prototype._setUpControls=function(){var t=this;this._forEachChild(function(e){return t._registerControl(e)})},e.prototype._checkAllValuesPresent=function(t){this._forEachChild(function(e,n){if(void 0===t[n])throw new Error("Must supply a value for form control at index: "+n+".")})},e.prototype._allControlsDisabled=function(){for(var t=0,e=this.controls;t<e.length;t++)if(e[t].enabled)return!1;return this.controls.length>0||this.disabled},e.prototype._registerControl=function(t){t.setParent(this),t._registerOnCollectionChange(this._onCollectionChange)},e}(Cn),xn='\n    <div [formGroup]="myGroup">\n      <input formControlName="firstName">\n    </div>\n\n    In your class:\n\n    this.myGroup = new FormGroup({\n       firstName: new FormControl()\n    });',An='\n    <div [formGroup]="myGroup">\n       <div formGroupName="person">\n          <input formControlName="firstName">\n       </div>\n    </div>\n\n    In your class:\n\n    this.myGroup = new FormGroup({\n       person: new FormGroup({ firstName: new FormControl() })\n    });',On=function(){function t(){}return t.controlParentException=function(){throw new Error("formControlName must be used with a parent formGroup directive.  You'll want to add a formGroup\n       directive and pass it an existing FormGroup instance (you can create one in your class).\n\n      Example:\n\n      "+xn)},t.ngModelGroupException=function(){throw new Error('formControlName cannot be used with an ngModelGroup parent. It is only compatible with parents\n       that also have a "form" prefix: formGroupName, formArrayName, or formGroup.\n\n       Option 1:  Update the parent to be formGroupName (reactive form strategy)\n\n        '+An+'\n\n        Option 2: Use ngModel instead of formControlName (template-driven strategy)\n\n        \n    <form>\n       <div ngModelGroup="person">\n          <input [(ngModel)]="person.name" name="firstName">\n       </div>\n    </form>')},t.missingFormException=function(){throw new Error("formGroup expects a FormGroup instance. Please pass one in.\n\n       Example:\n\n       "+xn)},t.groupParentException=function(){throw new Error("formGroupName must be used with a parent formGroup directive.  You'll want to add a formGroup\n      directive and pass it an existing FormGroup instance (you can create one in your class).\n\n      Example:\n\n      "+An)},t.arrayParentException=function(){throw new Error('formArrayName must be used with a parent formGroup directive.  You\'ll want to add a formGroup\n       directive and pass it an existing FormGroup instance (you can create one in your class).\n\n        Example:\n\n        \n    <div [formGroup]="myGroup">\n      <div formArrayName="cities">\n        <div *ngFor="let city of cityArray.controls; index as i">\n          <input [formControlName]="i">\n        </div>\n      </div>\n    </div>\n\n    In your class:\n\n    this.cityArray = new FormArray([new FormControl(\'SF\')]);\n    this.myGroup = new FormGroup({\n      cities: this.cityArray\n    });')},t.disabledAttrWarning=function(){console.warn("\n      It looks like you're using the disabled attribute with a reactive form directive. If you set disabled to true\n      when you set up this control in your component class, the disabled attribute will actually be set in the DOM for\n      you. We recommend using this approach to avoid 'changed after checked' errors.\n       \n      Example: \n      form = new FormGroup({\n        first: new FormControl({value: 'Nancy', disabled: true}, Validators.required),\n        last: new FormControl('Drew', Validators.required)\n      });\n    ")},t}(),Pn=function(t){function e(e,n,i){var o=t.call(this)||this;return o.update=new r.m,o._rawValidators=e||[],o._rawAsyncValidators=n||[],o.valueAccessor=mn(o,i),o}return Object(i.__extends)(e,t),Object.defineProperty(e.prototype,"isDisabled",{set:function(t){On.disabledAttrWarning()},enumerable:!0,configurable:!0}),e.prototype.ngOnChanges=function(t){this._isControlChanged(t)&&(an(this.form,this),this.control.disabled&&this.valueAccessor.setDisabledState&&this.valueAccessor.setDisabledState(!0),this.form.updateValueAndValidity({emitEvent:!1})),dn(t,this.viewModel)&&(this.form.setValue(this.model),this.viewModel=this.model)},Object.defineProperty(e.prototype,"path",{get:function(){return[]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"validator",{get:function(){return fn(this._rawValidators)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"asyncValidator",{get:function(){return pn(this._rawAsyncValidators)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"control",{get:function(){return this.form},enumerable:!0,configurable:!0}),e.prototype.viewToModelUpdate=function(t){this.viewModel=t,this.update.emit(t)},e.prototype._isControlChanged=function(t){return t.hasOwnProperty("form")},e}(Ye),Nn=function(t){function e(e,n){var i=t.call(this)||this;return i._validators=e,i._asyncValidators=n,i.submitted=!1,i.directives=[],i.form=null,i.ngSubmit=new r.m,i}return Object(i.__extends)(e,t),e.prototype.ngOnChanges=function(t){this._checkFormPresent(),t.hasOwnProperty("form")&&(this._updateValidators(),this._updateDomValue(),this._updateRegistrations())},Object.defineProperty(e.prototype,"formDirective",{get:function(){return this},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"control",{get:function(){return this.form},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"path",{get:function(){return[]},enumerable:!0,configurable:!0}),e.prototype.addControl=function(t){var e=this.form.get(t.path);return an(e,t),e.updateValueAndValidity({emitEvent:!1}),this.directives.push(t),e},e.prototype.getControl=function(t){return this.form.get(t.path)},e.prototype.removeControl=function(t){var e,n;(n=(e=this.directives).indexOf(t))>-1&&e.splice(n,1)},e.prototype.addFormGroup=function(t){var e=this.form.get(t.path);ln(e,t),e.updateValueAndValidity({emitEvent:!1})},e.prototype.removeFormGroup=function(t){},e.prototype.getFormGroup=function(t){return this.form.get(t.path)},e.prototype.addFormArray=function(t){var e=this.form.get(t.path);ln(e,t),e.updateValueAndValidity({emitEvent:!1})},e.prototype.removeFormArray=function(t){},e.prototype.getFormArray=function(t){return this.form.get(t.path)},e.prototype.updateModel=function(t,e){this.form.get(t.path).setValue(e)},e.prototype.onSubmit=function(t){return this.submitted=!0,e=this.directives,this.form._syncPendingControls(),e.forEach(function(t){var e=t.control;"submit"===e.updateOn&&e._pendingChange&&(t.viewToModelUpdate(e._pendingValue),e._pendingChange=!1)}),this.ngSubmit.emit(t),!1;var e},e.prototype.onReset=function(){this.resetForm()},e.prototype.resetForm=function(t){void 0===t&&(t=void 0),this.form.reset(t),this.submitted=!1},e.prototype._updateDomValue=function(){var t=this;this.directives.forEach(function(e){var n=t.form.get(e.path);e.control!==n&&(function(t,e){e.valueAccessor.registerOnChange(function(){return cn(e)}),e.valueAccessor.registerOnTouched(function(){return cn(e)}),e._rawValidators.forEach(function(t){t.registerOnValidatorChange&&t.registerOnValidatorChange(null)}),e._rawAsyncValidators.forEach(function(t){t.registerOnValidatorChange&&t.registerOnValidatorChange(null)}),t&&t._clearChangeFns()}(e.control,e),n&&an(n,e),e.control=n)}),this.form._updateTreeValidity({emitEvent:!1})},e.prototype._updateRegistrations=function(){var t=this;this.form._registerOnCollectionChange(function(){return t._updateDomValue()}),this._oldForm&&this._oldForm._registerOnCollectionChange(function(){}),this._oldForm=this.form},e.prototype._updateValidators=function(){var t=fn(this._validators);this.form.validator=Fe.compose([this.form.validator,t]);var e=pn(this._asyncValidators);this.form.asyncValidator=Fe.composeAsync([this.form.asyncValidator,e])},e.prototype._checkFormPresent=function(){this.form||On.missingFormException()},e}(De),Rn=function(t){function e(e,n,r){var i=t.call(this)||this;return i._parent=e,i._validators=n,i._asyncValidators=r,i}return Object(i.__extends)(e,t),e.prototype._checkParentType=function(){Mn(this._parent)&&On.groupParentException()},e}(gn),Dn=function(t){function e(e,n,r){var i=t.call(this)||this;return i._parent=e,i._validators=n,i._asyncValidators=r,i}return Object(i.__extends)(e,t),e.prototype.ngOnInit=function(){this._checkParentType(),this.formDirective.addFormArray(this)},e.prototype.ngOnDestroy=function(){this.formDirective&&this.formDirective.removeFormArray(this)},Object.defineProperty(e.prototype,"control",{get:function(){return this.formDirective.getFormArray(this)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"formDirective",{get:function(){return this._parent?this._parent.formDirective:null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"path",{get:function(){return sn(this.name,this._parent)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"validator",{get:function(){return fn(this._validators)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"asyncValidator",{get:function(){return pn(this._asyncValidators)},enumerable:!0,configurable:!0}),e.prototype._checkParentType=function(){Mn(this._parent)&&On.arrayParentException()},e}(De);function Mn(t){return!(t instanceof Rn||t instanceof Nn||t instanceof Dn)}var Vn=function(t){function e(e,n,i,o){var s=t.call(this)||this;return s._added=!1,s.update=new r.m,s._parent=e,s._rawValidators=n||[],s._rawAsyncValidators=i||[],s.valueAccessor=mn(s,o),s}return Object(i.__extends)(e,t),Object.defineProperty(e.prototype,"isDisabled",{set:function(t){On.disabledAttrWarning()},enumerable:!0,configurable:!0}),e.prototype.ngOnChanges=function(t){this._added||this._setUpControl(),dn(t,this.viewModel)&&(this.viewModel=this.model,this.formDirective.updateModel(this,this.model))},e.prototype.ngOnDestroy=function(){this.formDirective&&this.formDirective.removeControl(this)},e.prototype.viewToModelUpdate=function(t){this.viewModel=t,this.update.emit(t)},Object.defineProperty(e.prototype,"path",{get:function(){return sn(this.name,this._parent)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"formDirective",{get:function(){return this._parent?this._parent.formDirective:null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"validator",{get:function(){return fn(this._rawValidators)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"asyncValidator",{get:function(){return pn(this._rawAsyncValidators)},enumerable:!0,configurable:!0}),e.prototype._checkParentType=function(){!(this._parent instanceof Rn)&&this._parent instanceof gn?On.ngModelGroupException():this._parent instanceof Rn||this._parent instanceof Nn||this._parent instanceof Dn||On.controlParentException()},e.prototype._setUpControl=function(){this._checkParentType(),this.control=this.formDirective.addControl(this),this.control.disabled&&this.valueAccessor.setDisabledState&&this.valueAccessor.setDisabledState(!0),this._added=!0},e}(Ye),Fn=function(){function t(){}return t.prototype.group=function(t,e){void 0===e&&(e=null);var n=this._reduceControls(t);return new In(n,null!=e?e.validator:null,null!=e?e.asyncValidator:null)},t.prototype.control=function(t,e,n){return new Tn(t,e,n)},t.prototype.array=function(t,e,n){var r=this,i=t.map(function(t){return r._createControl(t)});return new kn(i,e,n)},t.prototype._reduceControls=function(t){var e=this,n={};return Object.keys(t).forEach(function(r){n[r]=e._createControl(t[r])}),n},t.prototype._createControl=function(t){return t instanceof Tn||t instanceof In||t instanceof kn?t:Array.isArray(t)?this.control(t[0],t.length>1?t[1]:null,t.length>2?t[2]:null):this.control(t)},t}(),jn=function(){},Ln=function(){},Un=function(){},Bn=function(){},qn=function(){},Hn=function(){function t(){}return t.prototype.build=function(){return new XMLHttpRequest},t}(),Kn=function(){var t={Get:0,Post:1,Put:2,Delete:3,Options:4,Head:5,Patch:6};return t[t.Get]="Get",t[t.Post]="Post",t[t.Put]="Put",t[t.Delete]="Delete",t[t.Options]="Options",t[t.Head]="Head",t[t.Patch]="Patch",t}(),zn=function(){var t={Basic:0,Cors:1,Default:2,Error:3,Opaque:4};return t[t.Basic]="Basic",t[t.Cors]="Cors",t[t.Default]="Default",t[t.Error]="Error",t[t.Opaque]="Opaque",t}(),Qn=function(){var t={NONE:0,JSON:1,FORM:2,FORM_DATA:3,TEXT:4,BLOB:5,ARRAY_BUFFER:6};return t[t.NONE]="NONE",t[t.JSON]="JSON",t[t.FORM]="FORM",t[t.FORM_DATA]="FORM_DATA",t[t.TEXT]="TEXT",t[t.BLOB]="BLOB",t[t.ARRAY_BUFFER]="ARRAY_BUFFER",t}(),Gn=function(){var t={Text:0,Json:1,ArrayBuffer:2,Blob:3};return t[t.Text]="Text",t[t.Json]="Json",t[t.ArrayBuffer]="ArrayBuffer",t[t.Blob]="Blob",t}(),Wn=function(){function t(e){var n=this;this._headers=new Map,this._normalizedNames=new Map,e&&(e instanceof t?e.forEach(function(t,e){t.forEach(function(t){return n.append(e,t)})}):Object.keys(e).forEach(function(t){var r=Array.isArray(e[t])?e[t]:[e[t]];n.delete(t),r.forEach(function(e){return n.append(t,e)})}))}return t.fromResponseHeaderString=function(e){var n=new t;return e.split("\n").forEach(function(t){var e=t.indexOf(":");if(e>0){var r=t.slice(0,e),i=t.slice(e+1).trim();n.set(r,i)}}),n},t.prototype.append=function(t,e){var n=this.getAll(t);null===n?this.set(t,e):n.push(e)},t.prototype.delete=function(t){var e=t.toLowerCase();this._normalizedNames.delete(e),this._headers.delete(e)},t.prototype.forEach=function(t){var e=this;this._headers.forEach(function(n,r){return t(n,e._normalizedNames.get(r),e._headers)})},t.prototype.get=function(t){var e=this.getAll(t);return null===e?null:e.length>0?e[0]:null},t.prototype.has=function(t){return this._headers.has(t.toLowerCase())},t.prototype.keys=function(){return Array.from(this._normalizedNames.values())},t.prototype.set=function(t,e){Array.isArray(e)?e.length&&this._headers.set(t.toLowerCase(),[e.join(",")]):this._headers.set(t.toLowerCase(),[e]),this.mayBeSetNormalizedName(t)},t.prototype.values=function(){return Array.from(this._headers.values())},t.prototype.toJSON=function(){var t=this,e={};return this._headers.forEach(function(n,r){var i=[];n.forEach(function(t){return i.push.apply(i,t.split(","))}),e[t._normalizedNames.get(r)]=i}),e},t.prototype.getAll=function(t){return this.has(t)&&this._headers.get(t.toLowerCase())||null},t.prototype.entries=function(){throw new Error('"entries" method is not implemented on Headers class')},t.prototype.mayBeSetNormalizedName=function(t){var e=t.toLowerCase();this._normalizedNames.has(e)||this._normalizedNames.set(e,t)},t}(),Yn=function(){function t(t){void 0===t&&(t={});var e=t.body,n=t.status,r=t.headers,i=t.statusText,o=t.type,s=t.url;this.body=null!=e?e:null,this.status=null!=n?n:null,this.headers=null!=r?r:null,this.statusText=null!=i?i:null,this.type=null!=o?o:null,this.url=null!=s?s:null}return t.prototype.merge=function(e){return new t({body:e&&null!=e.body?e.body:this.body,status:e&&null!=e.status?e.status:this.status,headers:e&&null!=e.headers?e.headers:this.headers,statusText:e&&null!=e.statusText?e.statusText:this.statusText,type:e&&null!=e.type?e.type:this.type,url:e&&null!=e.url?e.url:this.url})},t}(),Jn=function(t){function e(){return t.call(this,{status:200,statusText:"Ok",type:zn.Default,headers:new Wn})||this}return Object(i.__extends)(e,t),e}(Yn),Xn=function(){};function Zn(t){if("string"!=typeof t)return t;switch(t.toUpperCase()){case"GET":return Kn.Get;case"POST":return Kn.Post;case"PUT":return Kn.Put;case"DELETE":return Kn.Delete;case"OPTIONS":return Kn.Options;case"HEAD":return Kn.Head;case"PATCH":return Kn.Patch}throw new Error('Invalid request method. The method "'+t+'" is not supported.')}var $n=function(t){return t>=200&&t<300},tr=function(){function t(){}return t.prototype.encodeKey=function(t){return er(t)},t.prototype.encodeValue=function(t){return er(t)},t}();function er(t){return encodeURIComponent(t).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/gi,"$").replace(/%2C/gi,",").replace(/%3B/gi,";").replace(/%2B/gi,"+").replace(/%3D/gi,"=").replace(/%3F/gi,"?").replace(/%2F/gi,"/")}var nr=function(){function t(t,e){void 0===t&&(t=""),void 0===e&&(e=new tr),this.rawParams=t,this.queryEncoder=e,this.paramsMap=function(t){void 0===t&&(t="");var e=new Map;return t.length>0&&t.split("&").forEach(function(t){var n=t.indexOf("="),r=-1==n?[t,""]:[t.slice(0,n),t.slice(n+1)],i=r[0],o=r[1],s=e.get(i)||[];s.push(o),e.set(i,s)}),e}(t)}return t.prototype.clone=function(){var e=new t("",this.queryEncoder);return e.appendAll(this),e},t.prototype.has=function(t){return this.paramsMap.has(t)},t.prototype.get=function(t){var e=this.paramsMap.get(t);return Array.isArray(e)?e[0]:null},t.prototype.getAll=function(t){return this.paramsMap.get(t)||[]},t.prototype.set=function(t,e){if(void 0!==e&&null!==e){var n=this.paramsMap.get(t)||[];n.length=0,n.push(e),this.paramsMap.set(t,n)}else this.delete(t)},t.prototype.setAll=function(t){var e=this;t.paramsMap.forEach(function(t,n){var r=e.paramsMap.get(n)||[];r.length=0,r.push(t[0]),e.paramsMap.set(n,r)})},t.prototype.append=function(t,e){if(void 0!==e&&null!==e){var n=this.paramsMap.get(t)||[];n.push(e),this.paramsMap.set(t,n)}},t.prototype.appendAll=function(t){var e=this;t.paramsMap.forEach(function(t,n){for(var r=e.paramsMap.get(n)||[],i=0;i<t.length;++i)r.push(t[i]);e.paramsMap.set(n,r)})},t.prototype.replaceAll=function(t){var e=this;t.paramsMap.forEach(function(t,n){var r=e.paramsMap.get(n)||[];r.length=0;for(var i=0;i<t.length;++i)r.push(t[i]);e.paramsMap.set(n,r)})},t.prototype.toString=function(){var t=this,e=[];return this.paramsMap.forEach(function(n,r){n.forEach(function(n){return e.push(t.queryEncoder.encodeKey(r)+"="+t.queryEncoder.encodeValue(n))})}),e.join("&")},t.prototype.delete=function(t){this.paramsMap.delete(t)},t}(),rr=function(){function t(){}return t.prototype.json=function(){return"string"==typeof this._body?JSON.parse(this._body):this._body instanceof ArrayBuffer?JSON.parse(this.text()):this._body},t.prototype.text=function(t){if(void 0===t&&(t="legacy"),this._body instanceof nr)return this._body.toString();if(this._body instanceof ArrayBuffer)switch(t){case"legacy":return String.fromCharCode.apply(null,new Uint16Array(this._body));case"iso-8859":return String.fromCharCode.apply(null,new Uint8Array(this._body));default:throw new Error("Invalid value for encodingHint: "+t)}return null==this._body?"":"object"==typeof this._body?JSON.stringify(this._body,null,2):this._body.toString()},t.prototype.arrayBuffer=function(){return this._body instanceof ArrayBuffer?this._body:function(t){for(var e=new Uint16Array(t.length),n=0,r=t.length;n<r;n++)e[n]=t.charCodeAt(n);return e.buffer}(this.text())},t.prototype.blob=function(){if(this._body instanceof Blob)return this._body;if(this._body instanceof ArrayBuffer)return new Blob([this._body]);throw new Error("The request body isn't either a blob or an array buffer")},t}(),ir=function(t){function e(e){var n=t.call(this)||this;return n._body=e.body,n.status=e.status,n.ok=n.status>=200&&n.status<=299,n.statusText=e.statusText,n.headers=e.headers,n.type=e.type,n.url=e.url,n}return Object(i.__extends)(e,t),e.prototype.toString=function(){return"Response with status: "+this.status+" "+this.statusText+" for URL: "+this.url},e}(rr),or=/^\)\]\}',?\n/,sr=function(){function t(t,e,n){var r=this;this.request=t,this.response=new o.a(function(i){var o=e.build();o.open(Kn[t.method].toUpperCase(),t.url),null!=t.withCredentials&&(o.withCredentials=t.withCredentials);var s=function(){var e=1223===o.status?204:o.status,r=null;204!==e&&"string"==typeof(r="undefined"==typeof o.response?o.responseText:o.response)&&(r=r.replace(or,"")),0===e&&(e=r?200:0);var s,a=Wn.fromResponseHeaderString(o.getAllResponseHeaders()),u=("responseURL"in(s=o)?s.responseURL:/^X-Request-URL:/m.test(s.getAllResponseHeaders())?s.getResponseHeader("X-Request-URL"):null)||t.url,l=new Yn({body:r,status:e,headers:a,statusText:o.statusText||"OK",url:u});null!=n&&(l=n.merge(l));var c=new ir(l);if(c.ok=$n(e),c.ok)return i.next(c),void i.complete();i.error(c)},a=function(t){var e=new Yn({body:t,type:zn.Error,status:o.status,statusText:o.statusText});null!=n&&(e=n.merge(e)),i.error(new ir(e))};if(r.setDetectedContentType(t,o),null==t.headers&&(t.headers=new Wn),t.headers.has("Accept")||t.headers.append("Accept","application/json, text/plain, */*"),t.headers.forEach(function(t,e){return o.setRequestHeader(e,t.join(","))}),null!=t.responseType&&null!=o.responseType)switch(t.responseType){case Gn.ArrayBuffer:o.responseType="arraybuffer";break;case Gn.Json:o.responseType="json";break;case Gn.Text:o.responseType="text";break;case Gn.Blob:o.responseType="blob";break;default:throw new Error("The selected responseType is not supported")}return o.addEventListener("load",s),o.addEventListener("error",a),o.send(r.request.getBody()),function(){o.removeEventListener("load",s),o.removeEventListener("error",a),o.abort()}})}return t.prototype.setDetectedContentType=function(t,e){if(null==t.headers||null==t.headers.get("Content-Type"))switch(t.contentType){case Qn.NONE:break;case Qn.JSON:e.setRequestHeader("content-type","application/json");break;case Qn.FORM:e.setRequestHeader("content-type","application/x-www-form-urlencoded;charset=UTF-8");break;case Qn.TEXT:e.setRequestHeader("content-type","text/plain");break;case Qn.BLOB:var n=t.blob();n.type&&e.setRequestHeader("content-type",n.type)}},t}(),ar=function(){function t(t,e){void 0===t&&(t="XSRF-TOKEN"),void 0===e&&(e="X-XSRF-TOKEN"),this._cookieName=t,this._headerName=e}return t.prototype.configureRequest=function(t){var e=tt().getCookie(this._cookieName);e&&t.headers.set(this._headerName,e)},t}(),ur=function(){function t(t,e,n){this._browserXHR=t,this._baseResponseOptions=e,this._xsrfStrategy=n}return t.prototype.createConnection=function(t){return this._xsrfStrategy.configureRequest(t),new sr(t,this._browserXHR,this._baseResponseOptions)},t}(),lr=function(){function t(t){void 0===t&&(t={});var e=t.method,n=t.headers,r=t.body,i=t.url,o=t.search,s=t.params,a=t.withCredentials,u=t.responseType;this.method=null!=e?Zn(e):null,this.headers=null!=n?n:null,this.body=null!=r?r:null,this.url=null!=i?i:null,this.params=this._mergeSearchParams(s||o),this.withCredentials=null!=a?a:null,this.responseType=null!=u?u:null}return Object.defineProperty(t.prototype,"search",{get:function(){return this.params},set:function(t){this.params=t},enumerable:!0,configurable:!0}),t.prototype.merge=function(e){return new t({method:e&&null!=e.method?e.method:this.method,headers:e&&null!=e.headers?e.headers:new Wn(this.headers),body:e&&null!=e.body?e.body:this.body,url:e&&null!=e.url?e.url:this.url,params:e&&this._mergeSearchParams(e.params||e.search),withCredentials:e&&null!=e.withCredentials?e.withCredentials:this.withCredentials,responseType:e&&null!=e.responseType?e.responseType:this.responseType})},t.prototype._mergeSearchParams=function(t){return t?t instanceof nr?t.clone():"string"==typeof t?new nr(t):this._parseParams(t):this.params},t.prototype._parseParams=function(t){var e=this;void 0===t&&(t={});var n=new nr;return Object.keys(t).forEach(function(r){var i=t[r];Array.isArray(i)?i.forEach(function(t){return e._appendParam(r,t,n)}):e._appendParam(r,i,n)}),n},t.prototype._appendParam=function(t,e,n){"string"!=typeof e&&(e=JSON.stringify(e)),n.append(t,e)},t}(),cr=function(t){function e(){return t.call(this,{method:Kn.Get,headers:new Wn})||this}return Object(i.__extends)(e,t),e}(lr),hr=function(t){function e(e){var n=t.call(this)||this,r=e.url;n.url=e.url;var i,o=e.params||e.search;if(o&&(i="object"!=typeof o||o instanceof nr?o.toString():function(t){var e=new nr;return Object.keys(t).forEach(function(n){var r=t[n];r&&Array.isArray(r)?r.forEach(function(t){return e.append(n,t.toString())}):e.append(n,r.toString())}),e}(o).toString()).length>0){var s="?";-1!=n.url.indexOf("?")&&(s="&"==n.url[n.url.length-1]?"":"&"),n.url=r+s+i}return n._body=e.body,n.method=Zn(e.method),n.headers=new Wn(e.headers),n.contentType=n.detectContentType(),n.withCredentials=e.withCredentials,n.responseType=e.responseType,n}return Object(i.__extends)(e,t),e.prototype.detectContentType=function(){switch(this.headers.get("content-type")){case"application/json":return Qn.JSON;case"application/x-www-form-urlencoded":return Qn.FORM;case"multipart/form-data":return Qn.FORM_DATA;case"text/plain":case"text/html":return Qn.TEXT;case"application/octet-stream":return this._body instanceof mr?Qn.ARRAY_BUFFER:Qn.BLOB;default:return this.detectContentTypeFromBody()}},e.prototype.detectContentTypeFromBody=function(){return null==this._body?Qn.NONE:this._body instanceof nr?Qn.FORM:this._body instanceof dr?Qn.FORM_DATA:this._body instanceof yr?Qn.BLOB:this._body instanceof mr?Qn.ARRAY_BUFFER:this._body&&"object"==typeof this._body?Qn.JSON:Qn.TEXT},e.prototype.getBody=function(){switch(this.contentType){case Qn.JSON:case Qn.FORM:return this.text();case Qn.FORM_DATA:return this._body;case Qn.TEXT:return this.text();case Qn.BLOB:return this.blob();case Qn.ARRAY_BUFFER:return this.arrayBuffer();default:return null}},e}(rr),fr=function(){},pr="object"==typeof window?window:fr,dr=pr.FormData||fr,yr=pr.Blob||fr,mr=pr.ArrayBuffer||fr;function gr(t,e){return t.createConnection(e).response}function vr(t,e,n,r){return t.merge(new lr(e?{method:e.method||n,url:e.url||r,search:e.search,params:e.params,headers:e.headers,body:e.body,withCredentials:e.withCredentials,responseType:e.responseType}:{method:n,url:r}))}var _r=function(){function t(t,e){this._backend=t,this._defaultOptions=e}return t.prototype.request=function(t,e){var n;if("string"==typeof t)n=gr(this._backend,new hr(vr(this._defaultOptions,e,Kn.Get,t)));else{if(!(t instanceof hr))throw new Error("First argument must be a url string or Request instance.");n=gr(this._backend,t)}return n},t.prototype.get=function(t,e){return this.request(new hr(vr(this._defaultOptions,e,Kn.Get,t)))},t.prototype.post=function(t,e,n){return this.request(new hr(vr(this._defaultOptions.merge(new lr({body:e})),n,Kn.Post,t)))},t.prototype.put=function(t,e,n){return this.request(new hr(vr(this._defaultOptions.merge(new lr({body:e})),n,Kn.Put,t)))},t.prototype.delete=function(t,e){return this.request(new hr(vr(this._defaultOptions,e,Kn.Delete,t)))},t.prototype.patch=function(t,e,n){return this.request(new hr(vr(this._defaultOptions.merge(new lr({body:e})),n,Kn.Patch,t)))},t.prototype.head=function(t,e){return this.request(new hr(vr(this._defaultOptions,e,Kn.Head,t)))},t.prototype.options=function(t,e){return this.request(new hr(vr(this._defaultOptions,e,Kn.Options,t)))},t}();function br(){return new ar}function wr(t,e){return new _r(t,e)}var Er=function(){};o.a.prototype.map=w;var Sr=function(){function t(t){this.http=t,this.url="https://www.googleapis.com/youtube/v3/",this.videoDetails="part=snippet,contentDetails,statistics,status",this.channelDetails="part=brandingSettings,snippet,contentDetails,statistics",this.feedDetails="&chart=mostPopular"}return t.prototype.defaultApiSet=function(t){this.settings=t.api_settings,this.apiKey=this.settings[0].value,this.regionCode=this.settings[1].value,this.numSearchRes=this.settings[2].value,this.numRelatedRes=this.settings[3].value},t.prototype.getChannel=function(t){if(this.apiKey)return this.http.get(this.url+"channels?"+this.channelDetails+"&id="+t+"&key="+this.apiKey).map(function(t){return t.json()})},t.prototype.searchVideo=function(t,e){if(void 0===e&&(e=!1),this.apiKey){var n=this.numSearchRes,r="";return e&&(r="&videoEmbeddable=true",t&&(n="4")),this.http.get(this.url+"search?part=snippet&q=karaoke+"+t+"&maxResults="+n+"&type=video"+r+"&key="+this.apiKey).map(function(t){return t.json()})}},t.prototype.flagEmbeddable=function(t,e,n,r,i){return void 0===r&&(r=""),void 0===i&&(i=""),this.http.get("/fixembed?id="+t+"&t="+e+"&cId="+n+"&c="+r+"&u="+i).map(function(t){return t.json()})},t.prototype.sendRoomActivity=function(t){return this.http.get("/youtube/RoomActivity?id="+t).map(function(t){return t.json()})},t.prototype.isMaster=function(t,e){return this.http.get("/youtube/IsMaster?Id="+t+"&token="+e).map(function(t){return t.json()})},t.prototype.flagAsHighQuality=function(t,e,n,r,i,o){return void 0===n&&(n=""),void 0===r&&(r=""),void 0===i&&(i=""),void 0===o&&(o=0),this.http.get("/fixembed?id="+t+"&t="+e+"&cId="+n+"&c="+r+"&u="+i+"&hq="+o).map(function(t){return t.json()})},t.prototype.IsHighQualityVideo=function(t){return this.http.get("/youtube/ishq",{params:{Ids:t}}).map(function(t){return t.json()})},t.prototype.relatedVideos=function(t){if(this.apiKey&&t)return this.http.get(this.url+"search?part=snippet&relatedToVideoId="+t+"&maxResults="+this.numRelatedRes+"&type=video&videoEmbeddable=true&key="+this.apiKey).map(function(t){return t.json()})},t.prototype.statsVideos=function(t){if(this.apiKey)return this.http.get(this.url+"videos?"+this.videoDetails+"&id="+t+"&key="+this.apiKey).map(function(t){return t.json()})},t.prototype.feedVideos=function(t){if(void 0===t&&(t=""),this.apiKey){var e=new URL(location.href).searchParams.get("channelId");return t&&(t="&pageToken="+t),this.http.get(e||""===e?this.url+"search?part=snippet&channelId="+e+t+"&maxResults="+this.numSearchRes+"&type=video&videoEmbeddable=true&key="+this.apiKey:this.url+"search?part=snippet&q=karaoke"+t+"&maxResults="+this.numSearchRes+"&type=video&key="+this.apiKey).map(function(t){return t.json()})}},t}(),Cr=n("kQVV"),Tr=n("mHG6"),Ir=n("X3fp"),kr=function(t){function e(e,n){if(t.call(this),this.scheduler=n,null==e)throw new Error("iterator cannot be null.");this.iterator=function(t){var e=t[Ir.a];if(!e&&"string"==typeof t)return new xr(t);if(!e&&void 0!==t.length)return new Ar(t);if(!e)throw new TypeError("object is not iterable");return t[Ir.a]()}(e)}return Object(i.__extends)(e,t),e.create=function(t,n){return new e(t,n)},e.dispatch=function(t){var e=t.index,n=t.iterator,r=t.subscriber;if(t.hasError)r.error(t.error);else{var i=n.next();i.done?r.complete():(r.next(i.value),t.index=e+1,r.closed?"function"==typeof n.return&&n.return():this.schedule(t))}},e.prototype._subscribe=function(t){var n=this.iterator,r=this.scheduler;if(r)return r.schedule(e.dispatch,0,{index:0,iterator:n,subscriber:t});for(;;){var i=n.next();if(i.done){t.complete();break}if(t.next(i.value),t.closed){"function"==typeof n.return&&n.return();break}}},e}(o.a),xr=function(){function t(t,e,n){void 0===e&&(e=0),void 0===n&&(n=t.length),this.str=t,this.idx=e,this.len=n}return t.prototype[Ir.a]=function(){return this},t.prototype.next=function(){return this.idx<this.len?{done:!1,value:this.str.charAt(this.idx++)}:{done:!0,value:void 0}},t}(),Ar=function(){function t(t,e,n){void 0===e&&(e=0),void 0===n&&(n=function(e){var n,r,i=+t.length;return isNaN(i)?0:0!==i&&"number"==typeof(n=i)&&p.a.isFinite(n)?(i=(0==(r=+i)?r:isNaN(r)?r:r<0?-1:1)*Math.floor(Math.abs(i)))<=0?0:i>Or?Or:i:i}()),this.arr=t,this.idx=e,this.len=n}return t.prototype[Ir.a]=function(){return this},t.prototype.next=function(){return this.idx<this.len?{done:!1,value:this.arr[this.idx++]}:{done:!0,value:void 0}},t}(),Or=Math.pow(2,53)-1,Pr=n("Oryw"),Nr=n("8Ut3"),Rr=function(t){function e(e,n){t.call(this),this.arrayLike=e,this.scheduler=n,n||1!==e.length||(this._isScalar=!0,this.value=e[0])}return Object(i.__extends)(e,t),e.create=function(t,n){var r=t.length;return 0===r?new s.a:1===r?new Nr.a(t[0],n):new e(t,n)},e.dispatch=function(t){var e=t.arrayLike,n=t.index,r=t.subscriber;r.closed||(n>=t.length?r.complete():(r.next(e[n]),t.index=n+1,this.schedule(t)))},e.prototype._subscribe=function(t){var n=this.arrayLike,r=this.scheduler,i=n.length;if(r)return r.schedule(e.dispatch,0,{arrayLike:n,index:0,length:i,subscriber:t});for(var o=0;o<i&&!t.closed;o++)t.next(n[o]);t.complete()},e}(o.a),Dr=function(){function t(t,e,n){this.kind=t,this.value=e,this.error=n,this.hasValue="N"===t}return t.prototype.observe=function(t){switch(this.kind){case"N":return t.next&&t.next(this.value);case"E":return t.error&&t.error(this.error);case"C":return t.complete&&t.complete()}},t.prototype.do=function(t,e,n){switch(this.kind){case"N":return t&&t(this.value);case"E":return e&&e(this.error);case"C":return n&&n()}},t.prototype.accept=function(t,e,n){return t&&"function"==typeof t.next?this.observe(t):this.do(t,e,n)},t.prototype.toObservable=function(){switch(this.kind){case"N":return o.a.of(this.value);case"E":return o.a.throw(this.error);case"C":return o.a.empty()}throw new Error("unexpected notification kind value")},t.createNext=function(e){return"undefined"!=typeof e?new t("N",e):t.undefinedValueNotification},t.createError=function(e){return new t("E",void 0,e)},t.createComplete=function(){return t.completeNotification},t.completeNotification=new t("C"),t.undefinedValueNotification=new t("N",void 0),t}(),Mr=function(){function t(t,e){void 0===e&&(e=0),this.scheduler=t,this.delay=e}return t.prototype.call=function(t,e){return e.subscribe(new Vr(t,this.scheduler,this.delay))},t}(),Vr=function(t){function e(e,n,r){void 0===r&&(r=0),t.call(this,e),this.scheduler=n,this.delay=r}return Object(i.__extends)(e,t),e.dispatch=function(t){t.notification.observe(t.destination),this.unsubscribe()},e.prototype.scheduleMessage=function(t){this.add(this.scheduler.schedule(e.dispatch,this.delay,new Fr(t,this.destination)))},e.prototype._next=function(t){this.scheduleMessage(Dr.createNext(t))},e.prototype._error=function(t){this.scheduleMessage(Dr.createError(t))},e.prototype._complete=function(){this.scheduleMessage(Dr.createComplete())},e}(v.a),Fr=function(t,e){this.notification=t,this.destination=e},jr=n("mz3w"),Lr=function(t){function e(e,n){t.call(this,null),this.ish=e,this.scheduler=n}return Object(i.__extends)(e,t),e.create=function(t,n){if(null!=t){if("function"==typeof t[jr.a])return t instanceof o.a&&!n?t:new e(t,n);if(Object(a.a)(t))return new Pr.a(t,n);if(Object(Tr.a)(t))return new d(t,n);if("function"==typeof t[Ir.a]||"string"==typeof t)return new kr(t,n);if(Object(Cr.a)(t))return new Rr(t,n)}throw new TypeError((null!==t&&typeof t||t)+" is not observable")},e.prototype._subscribe=function(t){var e=this.ish,n=this.scheduler;return null==n?e[jr.a]().subscribe(t):e[jr.a]().subscribe(new Vr(t,n,0))},e}(o.a).create,Ur=n("JEJ4"),Br=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},qr="[DEFAULT]",Hr=[],Kr=function(){function t(t,e,n){this.firebase_=n,this.isDeleted_=!1,this.services_={},this.name_=e,this.options_=Object(Ur.deepCopy)(t),this.INTERNAL={getUid:function(){return null},getToken:function(){return Promise.resolve(null)},addAuthTokenListener:function(t){Hr.push(t),setTimeout(function(){return t(null)},0)},removeAuthTokenListener:function(t){Hr=Hr.filter(function(e){return e!==t})}}}return Object.defineProperty(t.prototype,"name",{get:function(){return this.checkDestroyed_(),this.name_},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"options",{get:function(){return this.checkDestroyed_(),this.options_},enumerable:!0,configurable:!0}),t.prototype.delete=function(){var t=this;return new Promise(function(e){t.checkDestroyed_(),e()}).then(function(){t.firebase_.INTERNAL.removeApp(t.name_);var e=[];return Object.keys(t.services_).forEach(function(n){Object.keys(t.services_[n]).forEach(function(r){e.push(t.services_[n][r])})}),Promise.all(e.map(function(t){return t.INTERNAL.delete()}))}).then(function(){t.isDeleted_=!0,t.services_={}})},t.prototype._getService=function(t,e){if(void 0===e&&(e=qr),this.checkDestroyed_(),this.services_[t]||(this.services_[t]={}),!this.services_[t][e]){var n=e!==qr?e:void 0,r=this.firebase_.INTERNAL.factories[t](this,this.extendApp.bind(this),n);this.services_[t][e]=r}return this.services_[t][e]},t.prototype.extendApp=function(t){var e=this;Object(Ur.deepExtend)(this,t),t.INTERNAL&&t.INTERNAL.addAuthTokenListener&&(Hr.forEach(function(t){e.INTERNAL.addAuthTokenListener(t)}),Hr=[])},t.prototype.checkDestroyed_=function(){this.isDeleted_&&zr("app-deleted",{name:this.name_})},t}();function zr(t,e){throw Qr.create(t,e)}Kr.prototype.name&&Kr.prototype.options||Kr.prototype.delete||console.log("dc");var Qr=new Ur.ErrorFactory("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","invalid-app-argument":"firebase.{$name}() takes either no argument or a Firebase App instance."}),Gr=function t(){var e={},n={},r={},i={__esModule:!0,initializeApp:function(t,n){void 0===n?n=qr:"string"==typeof n&&""!==n||zr("bad-app-name",{name:n+""}),Br(e,n)&&zr("duplicate-app",{name:n});var r=new Kr(t,n,i);return e[n]=r,a(r,"create"),r},app:o,apps:null,Promise:Promise,SDK_VERSION:"4.9.0",INTERNAL:{registerService:function(t,e,a,u,l){n[t]&&zr("duplicate-service",{name:t}),n[t]=e,u&&(r[t]=u,s().forEach(function(t){u("create",t)}));var c=function(e){return void 0===e&&(e=o()),"function"!=typeof e[t]&&zr("invalid-app-argument",{name:t}),e[t]()};return void 0!==a&&Object(Ur.deepExtend)(c,a),i[t]=c,Kr.prototype[t]=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return this._getService.bind(this,t).apply(this,l?e:[])},c},createFirebaseNamespace:t,extendNamespace:function(t){Object(Ur.deepExtend)(i,t)},createSubscribe:Ur.createSubscribe,ErrorFactory:Ur.ErrorFactory,removeApp:function(t){a(e[t],"delete"),delete e[t]},factories:n,useAsService:u,Promise:Promise,deepExtend:Ur.deepExtend}};function o(t){return Br(e,t=t||qr)||zr("no-app",{name:t}),e[t]}function s(){return Object.keys(e).map(function(t){return e[t]})}function a(t,e){Object.keys(n).forEach(function(n){var i=u(0,n);null!==i&&r[i]&&r[i](e,t)})}function u(t,e){return"serverAuth"===e?null:e}return Object(Ur.patchProperty)(i,"default",i),Object.defineProperty(i,"apps",{get:s}),Object(Ur.patchProperty)(o,"App",Kr),i}(),Wr=new r.o("FirebaseAppConfigToken"),Yr=function(){};function Jr(t,e){try{return e?Gr.initializeApp(t,e):Gr.initializeApp(t)}catch(t){return Gr.app("app/duplicate-app"===t.code?t.name:null)}}var Xr=n("qLnt"),Zr=function(t){function e(e,n){t.call(this,e,n),this.scheduler=e,this.work=n}return Object(i.__extends)(e,t),e.prototype.schedule=function(e,n){return void 0===n&&(n=0),n>0?t.prototype.schedule.call(this,e,n):(this.delay=n,this.state=e,this.scheduler.flush(this),this)},e.prototype.execute=function(e,n){return n>0||this.closed?t.prototype.execute.call(this,e,n):this._execute(e,n)},e.prototype.requestAsyncId=function(e,n,r){return void 0===r&&(r=0),null!==r&&r>0||null===r&&this.delay>0?t.prototype.requestAsyncId.call(this,e,n,r):e.flush(this)},e}(function(t){function e(e,n){t.call(this,e,n),this.scheduler=e,this.work=n,this.pending=!1}return Object(i.__extends)(e,t),e.prototype.schedule=function(t,e){if(void 0===e&&(e=0),this.closed)return this;this.state=t,this.pending=!0;var n=this.id,r=this.scheduler;return null!=n&&(this.id=this.recycleAsyncId(r,n,e)),this.delay=e,this.id=this.id||this.requestAsyncId(r,this.id,e),this},e.prototype.requestAsyncId=function(t,e,n){return void 0===n&&(n=0),p.a.setInterval(t.flush.bind(t,this),n)},e.prototype.recycleAsyncId=function(t,e,n){if(void 0===n&&(n=0),null!==n&&this.delay===n&&!1===this.pending)return e;p.a.clearInterval(e)},e.prototype.execute=function(t,e){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var n=this._execute(t,e);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(t,e){var n=!1,r=void 0;try{this.work(t)}catch(t){n=!0,r=!!t&&t||new Error(t)}if(n)return this.unsubscribe(),r},e.prototype._unsubscribe=function(){var t=this.id,e=this.scheduler,n=e.actions,r=n.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==r&&n.splice(r,1),null!=t&&(this.id=this.recycleAsyncId(e,t,null)),this.delay=null},e}(function(t){function e(e,n){t.call(this)}return Object(i.__extends)(e,t),e.prototype.schedule=function(t,e){return void 0===e&&(e=0),this},e}(Xr.a))),$r=new(function(t){function e(){t.apply(this,arguments)}return Object(i.__extends)(e,t),e}(function(t){function e(){t.apply(this,arguments),this.actions=[],this.active=!1,this.scheduled=void 0}return Object(i.__extends)(e,t),e.prototype.flush=function(t){var e=this.actions;if(this.active)e.push(t);else{var n;this.active=!0;do{if(n=t.execute(t.state,t.delay))break}while(t=e.shift());if(this.active=!1,n){for(;t=e.shift();)t.unsubscribe();throw n}}},e}(function(){function t(e,n){void 0===n&&(n=t.now),this.SchedulerAction=e,this.now=n}return t.prototype.schedule=function(t,e,n){return void 0===e&&(e=0),new this.SchedulerAction(this,t).schedule(n,e)},t.now=Date.now?Date.now:function(){return+new Date},t}())))(Zr),ti=new r.o("FirebaseAppName"),ei=function(){function t(){}return t.initializeApp=function(e,n){return{ngModule:t,providers:[{provide:Wr,useValue:e},{provide:ti,useValue:n}]}},t}(),ni=function(){function t(t){this.zone=t}return t.prototype.schedule=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return this.zone.run(function(){return $r.schedule.apply($r,t)})},t}(),ri=n("URbD");function ii(t){return function(t){var e=new o.a(function(e){return{unsubscribe:t.onSnapshot(e)}});return(function(t,e){return void 0===e&&(e=0),function(t,e){return void 0===e&&(e=0),function(n){return n.lift(new Mr(t,e))}}(t,e)(this)}).call(e,new ni(Zone.current))}(t).share()}function oi(t){return ii(t).map(function(t){return{payload:t,type:"query"}})}o.a.prototype.share=ri.a;var si=function(){function t(t,e){this.predicate=t,this.thisArg=e}return t.prototype.call=function(t,e){return e.subscribe(new ai(t,this.predicate,this.thisArg))},t}(),ai=function(t){function e(e,n,r){t.call(this,e),this.predicate=n,this.thisArg=r,this.count=0}return Object(i.__extends)(e,t),e.prototype._next=function(t){var e;try{e=this.predicate.call(this.thisArg,t,this.count++)}catch(t){return void this.destination.error(t)}e&&this.destination.next(t)},e}(v.a);function ui(t,e){return function(t,e){return function(n){return n.lift(new si(t,e))}}(t,e)(this)}function li(t,e){var n=!1;return arguments.length>=2&&(n=!0),function(r){return r.lift(new ci(t,e,n))}}o.a.prototype.filter=ui;var ci=function(){function t(t,e,n){void 0===n&&(n=!1),this.accumulator=t,this.seed=e,this.hasSeed=n}return t.prototype.call=function(t,e){return e.subscribe(new hi(t,this.accumulator,this.seed,this.hasSeed))},t}(),hi=function(t){function e(e,n,r,i){t.call(this,e),this.accumulator=n,this._seed=r,this.hasSeed=i,this.index=0}return Object(i.__extends)(e,t),Object.defineProperty(e.prototype,"seed",{get:function(){return this._seed},set:function(t){this.hasSeed=!0,this._seed=t},enumerable:!0,configurable:!0}),e.prototype._next=function(t){if(this.hasSeed)return this._tryNext(t);this.seed=t,this.destination.next(t)},e.prototype._tryNext=function(t){var e,n=this.index++;try{e=this.accumulator(this.seed,t,n)}catch(t){this.destination.error(t)}this.seed=e,this.destination.next(e)},e}(v.a);function fi(t){return oi(t).map(function(t){return t.payload.docChanges.map(function(t){return{type:t.type,payload:t}})})}o.a.prototype.scan=function(t,e){return arguments.length>=2?li(t,e)(this):li(t)(this)};var pi=function(){function t(t,e){this.ref=t,this.query=e}return t.prototype.stateChanges=function(t){return t&&0!==t.length?fi(this.query).map(function(e){return e.filter(function(e){return t.indexOf(e.type)>-1})}).filter(function(t){return t.length>0}):fi(this.query)},t.prototype.auditTrail=function(t){return this.stateChanges(t).scan(function(t,e){return t.concat(e)},[])},t.prototype.snapshotChanges=function(t){return t=function(t){return t&&0!==t.length||(t=["added","removed","modified"]),t}(t),function(t,e){return oi(t).map(function(t){return t.payload.docChanges}).scan(function(t,n){return function(t,e,n){return e.forEach(function(e){n.indexOf(e.type)>-1&&(t=function(t,e){switch(e.type){case"added":t[e.newIndex]&&t[e.newIndex].doc.id==e.doc.id||t.splice(e.newIndex,0,e);break;case"modified":e.oldIndex!==e.newIndex?(t.splice(e.oldIndex,1),t.splice(e.newIndex,0,e)):t.splice(e.newIndex,1,e);break;case"removed":t.splice(e.oldIndex,1)}return t}(t,e))}),t}(t,n,e)},[]).map(function(t){return t.map(function(t){return{type:t.type,payload:t}})})}(this.query,t)},t.prototype.valueChanges=function(t){return oi(this.query).map(function(t){return t.payload.docs.map(function(t){return t.data()})})},t.prototype.add=function(t){return this.ref.add(t)},t.prototype.doc=function(t){return new di(this.ref.doc(t))},t}(),di=function(){function t(t){this.ref=t}return t.prototype.set=function(t,e){return this.ref.set(t,e)},t.prototype.update=function(t){return this.ref.update(t)},t.prototype.delete=function(){return this.ref.delete()},t.prototype.collection=function(t,e){var n=mi(this.ref.collection(t),e);return new pi(n.ref,n.query)},t.prototype.snapshotChanges=function(){return ii(this.ref).map(function(t){return{payload:t,type:"value"}})},t.prototype.valueChanges=function(){return this.snapshotChanges().map(function(t){return t.payload.exists?t.payload.data():null})},t}(),yi=new r.o("EnablePersistenceToken");function mi(t,e){return void 0===e&&(e=function(t){return t}),{query:e(t),ref:t}}var gi=function(){function t(t,e){this.app=t,this.firestore=t.firestore(),this.persistenceEnabled$=Lr(e?t.firestore().enablePersistence().then(function(){return!0},function(){return!1}):new Promise(function(t,e){t(!1)}))}return t.prototype.collection=function(t,e){var n=mi(this.firestore.collection(t),e);return new pi(n.ref,n.query)},t.prototype.doc=function(t){var e=this.firestore.doc(t);return new di(e)},t.prototype.createId=function(){return this.firestore.collection("_").doc().id},t}(),vi=Gr.SDK_VERSION,_i=function(t){return t[t.DEBUG=0]="DEBUG",t[t.ERROR=1]="ERROR",t[t.SILENT=2]="SILENT",t}({}),bi=_i.ERROR;function wi(){return bi}function Ei(t){bi=t}function Si(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];if(bi<=_i.DEBUG){var i=(new Date).toISOString(),o=n.map(Ti);console.log.apply(console,["Firestore ("+vi+") "+i+" ["+t+"]: "+e].concat(o))}}function Ci(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(bi<=_i.ERROR){var r=(new Date).toISOString(),i=e.map(Ti);console.error.apply(console,["Firestore ("+vi+") "+r+": "+t].concat(i))}}function Ti(t){if("string"==typeof t)return t;var e=xi.getPlatform();try{return e.formatJSON(t)}catch(e){return t}}function Ii(t){var e="FIRESTORE ("+vi+") INTERNAL ASSERTION FAILED: "+t;throw Ci(e),new Error(e)}function ki(t,e){t||Ii(e)}var xi=function(){function t(){}return t.setPlatform=function(e){t.platform&&Ii("Platform already defined"),t.platform=e},t.getPlatform=function(){return t.platform||Ii("Platform not set"),t.platform},t}();function Ai(){return xi.getPlatform().emptyByteString}var Oi={OK:"ok",CANCELLED:"cancelled",UNKNOWN:"unknown",INVALID_ARGUMENT:"invalid-argument",DEADLINE_EXCEEDED:"deadline-exceeded",NOT_FOUND:"not-found",ALREADY_EXISTS:"already-exists",PERMISSION_DENIED:"permission-denied",UNAUTHENTICATED:"unauthenticated",RESOURCE_EXHAUSTED:"resource-exhausted",FAILED_PRECONDITION:"failed-precondition",ABORTED:"aborted",OUT_OF_RANGE:"out-of-range",UNIMPLEMENTED:"unimplemented",INTERNAL:"internal",UNAVAILABLE:"unavailable",DATA_LOSS:"data-loss"},Pi=function(t){function e(e,n){var r=t.call(this,n)||this;return r.code=e,r.message=n,r.name="FirebaseError",r.toString=function(){return r.name+": [code="+r.code+"]: "+r.message},r}return Object(i.__extends)(e,t),e}(Error);function Ni(t,e){function n(){var t="This constructor is private.";throw e&&(t+=" ",t+=e),new Pi(Oi.INVALID_ARGUMENT,t)}for(var r in n.prototype=t.prototype,t)t.hasOwnProperty(r)&&(n[r]=t[r]);return n}function Ri(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function Di(t,e){for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){var r=Number(n);isNaN(r)||e(r,t[n])}}function Mi(t,e){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e(n,t[n])}function Vi(t){for(var e in ki(null!=t&&"object"==typeof t,"isEmpty() expects object parameter."),t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}function Fi(t){ki(t&&"object"==typeof t,"shallowCopy() expects object parameter.");var e={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}function ji(t,e,n){if(e.length!==n)throw new Pi(Oi.INVALID_ARGUMENT,"Function "+t+"() requires "+Zi(n,"argument")+", but was called with "+Zi(e.length,"argument")+".")}function Li(t,e,n){if(e.length<n)throw new Pi(Oi.INVALID_ARGUMENT,"Function "+t+"() requires at least "+Zi(n,"argument")+", but was called with "+Zi(e.length,"argument")+".")}function Ui(t,e,n,r){if(e.length<n||e.length>r)throw new Pi(Oi.INVALID_ARGUMENT,"Function "+t+"() requires between "+n+" and "+r+" arguments, but was called with "+Zi(e.length,"argument")+".")}function Bi(t,e,n,r){zi(t,e,Xi(n)+" argument",r)}function qi(t,e,n,r){void 0!==r&&Bi(t,e,n,r)}function Hi(t,e,n,r){zi(t,e,n+" option",r)}function Ki(t,e,n,r){void 0!==r&&Hi(t,e,n,r)}function zi(t,e,n,r){if(typeof r!==e||"object"===e&&!Qi(r)){var i=Gi(r);throw new Pi(Oi.INVALID_ARGUMENT,"Function "+t+"() requires its "+n+" to be of type "+e+", but it was: "+i)}}function Qi(t){return"object"==typeof t&&null!==t&&Object.getPrototypeOf(t)===Object.prototype}function Gi(t){if(void 0===t)return"undefined";if(null===t)return"null";if("string"==typeof t)return t.length>20&&(t=t.substring(0,20)+"..."),JSON.stringify(t);if("number"==typeof t||"boolean"==typeof t)return""+t;if("object"==typeof t){if(t instanceof Array)return"an array";var e=function(t){if(t.constructor){var e=/function\s+([^\s(]+)\s*\(/.exec(t.constructor.toString());if(e&&e.length>1)return e[1]}return null}(t);return e?"a custom "+e+" object":"an object"}return"function"==typeof t?"a function":Ii("Unknown wrong type: "+typeof t)}function Wi(t,e,n){if(void 0===n)throw new Pi(Oi.INVALID_ARGUMENT,"Function "+t+"() requires a valid "+Xi(e)+" argument, but it was undefined.")}function Yi(t,e,n){Mi(e,function(e,r){if(n.indexOf(e)<0)throw new Pi(Oi.INVALID_ARGUMENT,"Unknown option '"+e+"' passed to function "+t+"(). Available options: "+n.join(", "))})}function Ji(t,e,n,r){var i=Gi(r);return new Pi(Oi.INVALID_ARGUMENT,"Function "+t+"() requires its "+Xi(n)+" argument to be a "+e+", but it was: "+i)}function Xi(t){switch(t){case 1:return"first";case 2:return"second";case 3:return"third";default:return t+"th"}}function Zi(t,e){return t+" "+e+(1===t?"":"s")}var $i=function(){function t(){}return t.newId=function(){for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",e="",n=0;n<20;n++)e+=t.charAt(Math.floor(Math.random()*t.length));return ki(20===e.length,"Invalid auto ID: "+e),e},t}();function to(t,e){return t<e?-1:t>e?1:0}function eo(t,e){if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(!t[n].isEqual(e[n]))return!1;return!0}function no(){if("undefined"==typeof Uint8Array)throw new Pi(Oi.UNIMPLEMENTED,"Uint8Arrays are not available in this environment.")}function ro(){if(!xi.getPlatform().base64Available)throw new Pi(Oi.UNIMPLEMENTED,"Blobs are unavailable in Firestore in this environment.")}var io=function(){function t(t){ro(),this._binaryString=t}return t.fromBase64String=function(e){ji("Blob.fromBase64String",arguments,1),Bi("Blob.fromBase64String","string",1,e),ro();try{return new t(xi.getPlatform().atob(e))}catch(t){throw new Pi(Oi.INVALID_ARGUMENT,"Failed to construct Blob from Base64 string: "+t)}},t.fromUint8Array=function(e){if(ji("Blob.fromUint8Array",arguments,1),no(),!(e instanceof Uint8Array))throw Ji("Blob.fromUint8Array","Uint8Array",1,e);return new t(Array.prototype.map.call(e,function(t){return String.fromCharCode(t)}).join(""))},t.prototype.toBase64=function(){return ji("Blob.toBase64",arguments,0),ro(),xi.getPlatform().btoa(this._binaryString)},t.prototype.toUint8Array=function(){ji("Blob.toUint8Array",arguments,0),no();for(var t=new Uint8Array(this._binaryString.length),e=0;e<this._binaryString.length;e++)t[e]=this._binaryString.charCodeAt(e);return t},t.prototype.toString=function(){return"Blob(base64: "+this.toBase64()+")"},t.prototype.isEqual=function(t){return this._binaryString===t._binaryString},t.prototype._compareTo=function(t){return to(this._binaryString,t._binaryString)},t}(),oo=Ni(io,"Use Blob.fromUint8Array() or Blob.fromBase64String() instead."),so=function(){function t(t,e){if(ji("GeoPoint",arguments,2),Bi("GeoPoint","number",1,t),Bi("GeoPoint","number",2,e),!isFinite(t)||t<-90||t>90)throw new Pi(Oi.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+t);if(!isFinite(e)||e<-180||e>180)throw new Pi(Oi.INVALID_ARGUMENT,"Longitude must be a number between -180 and 180, but was: "+e);this._lat=t,this._long=e}return Object.defineProperty(t.prototype,"latitude",{get:function(){return this._lat},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"longitude",{get:function(){return this._long},enumerable:!0,configurable:!0}),t.prototype.isEqual=function(t){return this._lat===t._lat&&this._long===t._long},t.prototype._compareTo=function(t){return to(this._lat,t._lat)||to(this._long,t._long)},t}(),ao="(default)",uo=function(){function t(t,e){this.projectId=t,this.database=e||ao}return Object.defineProperty(t.prototype,"isDefaultDatabase",{get:function(){return this.database===ao},enumerable:!0,configurable:!0}),t.prototype.isEqual=function(e){return e instanceof t&&e.projectId===this.projectId&&e.database===this.database},t.prototype.compareTo=function(t){return to(this.projectId,t.projectId)||to(this.database,t.database)},t}(),lo=function(){function t(t,e,n){this.init(t,e,n)}return t.prototype.init=function(t,e,n){void 0===e?e=0:e>t.length&&Ii("offset "+e+" out of range "+t.length),void 0===n?n=t.length-e:n>t.length-e&&Ii("length "+n+" out of range "+(t.length-e)),this.segments=t,this.offset=e,this.len=n},t.prototype.construct=function(t,e,n){var r=Object.create(Object.getPrototypeOf(this));return r.init(t,e,n),r},Object.defineProperty(t.prototype,"length",{get:function(){return this.len},enumerable:!0,configurable:!0}),t.prototype.isEqual=function(e){return 0===t.comparator(this,e)},t.prototype.child=function(e){var n=this.segments.slice(this.offset,this.limit());return e instanceof t?e.forEach(function(t){n.push(t)}):"string"==typeof e?n.push(e):Ii("Unknown parameter type for Path.child(): "+e),this.construct(n)},t.prototype.limit=function(){return this.offset+this.length},t.prototype.popFirst=function(t){return ki(this.length>=(t=void 0===t?1:t),"Can't call popFirst() with less segments"),this.construct(this.segments,this.offset+t,this.length-t)},t.prototype.popLast=function(){return ki(!this.isEmpty(),"Can't call popLast() on empty path"),this.construct(this.segments,this.offset,this.length-1)},t.prototype.firstSegment=function(){return ki(!this.isEmpty(),"Can't call firstSegment() on empty path"),this.segments[this.offset]},t.prototype.lastSegment=function(){return ki(!this.isEmpty(),"Can't call lastSegment() on empty path"),this.segments[this.limit()-1]},t.prototype.get=function(t){return ki(t<this.length,"Index out of range"),this.segments[this.offset+t]},t.prototype.isEmpty=function(){return 0===this.length},t.prototype.isPrefixOf=function(t){if(t.length<this.length)return!1;for(var e=0;e<this.length;e++)if(this.get(e)!==t.get(e))return!1;return!0},t.prototype.forEach=function(t){for(var e=this.offset,n=this.limit();e<n;e++)t(this.segments[e])},t.prototype.toArray=function(){return this.segments.slice(this.offset,this.limit())},t.comparator=function(t,e){for(var n=Math.min(t.length,e.length),r=0;r<n;r++){var i=t.get(r),o=e.get(r);if(i<o)return-1;if(i>o)return 1}return t.length<e.length?-1:t.length>e.length?1:0},t}(),co=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(i.__extends)(e,t),e.prototype.canonicalString=function(){return this.toArray().join("/")},e.prototype.toString=function(){return this.canonicalString()},e.fromString=function(t){if(t.indexOf("//")>=0)throw new Pi(Oi.INVALID_ARGUMENT,"Invalid path ("+t+"). Paths must not contain // in them.");return new e(t.split("/").filter(function(t){return t.length>0}))},e.EMPTY_PATH=new e([]),e}(lo),ho=/^[_a-zA-Z][_a-zA-Z0-9]*$/,fo=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(i.__extends)(e,t),e.isValidIdentifier=function(t){return ho.test(t)},e.prototype.canonicalString=function(){return this.toArray().map(function(t){return t=t.replace("\\","\\\\").replace("`","\\`"),e.isValidIdentifier(t)||(t="`"+t+"`"),t}).join(".")},e.prototype.toString=function(){return this.canonicalString()},e.prototype.isKeyField=function(){return 1===this.length&&"__name__"===this.get(0)},e.keyField=function(){return new e(["__name__"])},e.fromServerFormat=function(t){for(var n=[],r="",i=0,o=function(){if(0===r.length)throw new Pi(Oi.INVALID_ARGUMENT,"Invalid field path ("+t+"). Paths must not be empty, begin with '.', end with '.', or contain '..'");n.push(r),r=""},s=!1;i<t.length;){var a=t[i];if("\\"===a){if(i+1===t.length)throw new Pi(Oi.INVALID_ARGUMENT,"Path has trailing escape character: "+t);var u=t[i+1];if("\\"!==u&&"."!==u&&"`"!==u)throw new Pi(Oi.INVALID_ARGUMENT,"Path has invalid escape sequence: "+t);r+=u,i+=2}else"`"===a?(s=!s,i++):"."!==a||s?(r+=a,i++):(o(),i++)}if(o(),s)throw new Pi(Oi.INVALID_ARGUMENT,"Unterminated ` in path: "+t);return new e(n)},e.EMPTY_PATH=new e([]),e}(lo),po=function(){function t(e){this.path=e,ki(t.isDocumentKey(e),"Invalid DocumentKey with an odd number of segments: "+e.toArray().join("/"))}return t.prototype.isEqual=function(t){return null!==t&&0===co.comparator(this.path,t.path)},t.prototype.toString=function(){return this.path.toString()},t.comparator=function(t,e){return co.comparator(t.path,e.path)},t.isDocumentKey=function(t){return t.length%2==0},t.fromSegments=function(e){return new t(new co(e.slice()))},t.fromPathString=function(e){return new t(co.fromString(e))},t.EMPTY=new t(new co([])),t}(),yo=function(){function t(t,e,n,r){this.key=t,this.version=e,this.data=n,this.hasLocalMutations=r.hasLocalMutations}return t.prototype.field=function(t){return this.data.field(t)},t.prototype.fieldValue=function(t){var e=this.field(t);return e?e.value():void 0},t.prototype.value=function(){return this.data.value()},t.prototype.isEqual=function(e){return e instanceof t&&this.key.isEqual(e.key)&&this.version.isEqual(e.version)&&this.data.isEqual(e.data)&&this.hasLocalMutations===e.hasLocalMutations},t.prototype.toString=function(){return"Document("+this.key+", "+this.version+", "+this.data.toString()+", {hasLocalMutations: "+this.hasLocalMutations+"})"},t.compareByKey=function(t,e){return po.comparator(t.key,e.key)},t.compareByField=function(t,e,n){var r=e.field(t),i=n.field(t);return void 0!==r&&void 0!==i?r.compareTo(i):Ii("Trying to compare documents on fields that don't exist")},t}(),mo=function(){function t(t,e){this.key=t,this.version=e}return t.prototype.toString=function(){return"NoDocument("+this.key+", "+this.version+")"},t.prototype.isEqual=function(t){return t&&t.version.isEqual(this.version)&&t.key.isEqual(this.key)},t.compareByKey=function(t,e){return po.comparator(t.key,e.key)},t}(),go=function(){function t(t,e){this.comparator=t,this.root=e||_o.EMPTY}return t.prototype.insert=function(e,n){return new t(this.comparator,this.root.insert(e,n,this.comparator).copy(null,null,_o.BLACK,null,null))},t.prototype.remove=function(e){return new t(this.comparator,this.root.remove(e,this.comparator).copy(null,null,_o.BLACK,null,null))},t.prototype.get=function(t){for(var e=this.root;!e.isEmpty();){var n=this.comparator(t,e.key);if(0===n)return e.value;n<0?e=e.left:n>0&&(e=e.right)}return null},t.prototype.getPredecessorKey=function(t){for(var e=this.root,n=null;!e.isEmpty();){var r=this.comparator(t,e.key);if(0===r){if(e.left.isEmpty())return n?n.key:null;for(e=e.left;!e.right.isEmpty();)e=e.right;return e.key}r<0?e=e.left:r>0&&(n=e,e=e.right)}throw Ii("Attempted to find predecessor key for a nonexistent key.  What gives?")},t.prototype.indexOf=function(t){for(var e=0,n=this.root;!n.isEmpty();){var r=this.comparator(t,n.key);if(0===r)return e+n.left.size;r<0?n=n.left:(e+=n.left.size+1,n=n.right)}return-1},t.prototype.isEmpty=function(){return this.root.isEmpty()},Object.defineProperty(t.prototype,"size",{get:function(){return this.root.size},enumerable:!0,configurable:!0}),t.prototype.minKey=function(){return this.root.minKey()},t.prototype.maxKey=function(){return this.root.maxKey()},t.prototype.inorderTraversal=function(t){return this.root.inorderTraversal(t)},t.prototype.forEach=function(t){this.inorderTraversal(function(e,n){return t(e,n),!1})},t.prototype.reverseTraversal=function(t){return this.root.reverseTraversal(t)},t.prototype.getIterator=function(){return new vo(this.root,null,this.comparator,!1)},t.prototype.getIteratorFrom=function(t){return new vo(this.root,t,this.comparator,!1)},t.prototype.getReverseIterator=function(){return new vo(this.root,null,this.comparator,!0)},t.prototype.getReverseIteratorFrom=function(t){return new vo(this.root,t,this.comparator,!0)},t}(),vo=function(){function t(t,e,n,r){this.isReverse=r,this.nodeStack=[];for(var i=1;!t.isEmpty();)if(i=e?n(t.key,e):1,r&&(i*=-1),i<0)t=this.isReverse?t.left:t.right;else{if(0===i){this.nodeStack.push(t);break}this.nodeStack.push(t),t=this.isReverse?t.right:t.left}}return t.prototype.getNext=function(){ki(this.nodeStack.length>0,"getNext() called on iterator when hasNext() is false.");var t=this.nodeStack.pop(),e={key:t.key,value:t.value};if(this.isReverse)for(t=t.left;!t.isEmpty();)this.nodeStack.push(t),t=t.right;else for(t=t.right;!t.isEmpty();)this.nodeStack.push(t),t=t.left;return e},t.prototype.hasNext=function(){return this.nodeStack.length>0},t.prototype.peek=function(){if(0===this.nodeStack.length)return null;var t=this.nodeStack[this.nodeStack.length-1];return{key:t.key,value:t.value}},t}(),_o=function(){function t(e,n,r,i,o){this.key=e,this.value=n,this.color=null!=r?r:t.RED,this.left=null!=i?i:t.EMPTY,this.right=null!=o?o:t.EMPTY,this.size=this.left.size+1+this.right.size}return t.prototype.copy=function(e,n,r,i,o){return new t(null!=e?e:this.key,null!=n?n:this.value,null!=r?r:this.color,null!=i?i:this.left,null!=o?o:this.right)},t.prototype.isEmpty=function(){return!1},t.prototype.inorderTraversal=function(t){return this.left.inorderTraversal(t)||t(this.key,this.value)||this.right.inorderTraversal(t)},t.prototype.reverseTraversal=function(t){return this.right.reverseTraversal(t)||t(this.key,this.value)||this.left.reverseTraversal(t)},t.prototype.min=function(){return this.left.isEmpty()?this:this.left.min()},t.prototype.minKey=function(){return this.min().key},t.prototype.maxKey=function(){return this.right.isEmpty()?this.key:this.right.maxKey()},t.prototype.insert=function(t,e,n){var r=this,i=n(t,r.key);return(r=i<0?r.copy(null,null,null,r.left.insert(t,e,n),null):0===i?r.copy(null,e,null,null,null):r.copy(null,null,null,null,r.right.insert(t,e,n))).fixUp()},t.prototype.removeMin=function(){if(this.left.isEmpty())return t.EMPTY;var e=this;return e.left.isRed()||e.left.left.isRed()||(e=e.moveRedLeft()),(e=e.copy(null,null,null,e.left.removeMin(),null)).fixUp()},t.prototype.remove=function(e,n){var r,i=this;if(n(e,i.key)<0)i.left.isEmpty()||i.left.isRed()||i.left.left.isRed()||(i=i.moveRedLeft()),i=i.copy(null,null,null,i.left.remove(e,n),null);else{if(i.left.isRed()&&(i=i.rotateRight()),i.right.isEmpty()||i.right.isRed()||i.right.left.isRed()||(i=i.moveRedRight()),0===n(e,i.key)){if(i.right.isEmpty())return t.EMPTY;r=i.right.min(),i=i.copy(r.key,r.value,null,null,i.right.removeMin())}i=i.copy(null,null,null,null,i.right.remove(e,n))}return i.fixUp()},t.prototype.isRed=function(){return this.color},t.prototype.fixUp=function(){var t=this;return t.right.isRed()&&!t.left.isRed()&&(t=t.rotateLeft()),t.left.isRed()&&t.left.left.isRed()&&(t=t.rotateRight()),t.left.isRed()&&t.right.isRed()&&(t=t.colorFlip()),t},t.prototype.moveRedLeft=function(){var t=this.colorFlip();return t.right.left.isRed()&&(t=(t=(t=t.copy(null,null,null,null,t.right.rotateRight())).rotateLeft()).colorFlip()),t},t.prototype.moveRedRight=function(){var t=this.colorFlip();return t.left.left.isRed()&&(t=(t=t.rotateRight()).colorFlip()),t},t.prototype.rotateLeft=function(){var e=this.copy(null,null,t.RED,null,this.right.left);return this.right.copy(null,null,this.color,e,null)},t.prototype.rotateRight=function(){var e=this.copy(null,null,t.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,e)},t.prototype.colorFlip=function(){var t=this.left.copy(null,null,!this.left.color,null,null),e=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,t,e)},t.prototype.checkMaxDepth=function(){var t=this.check();return Math.pow(2,t)<=this.size+1},t.prototype.check=function(){if(this.isRed()&&this.left.isRed())throw Ii("Red node has red child("+this.key+","+this.value+")");if(this.right.isRed())throw Ii("Right child of ("+this.key+","+this.value+") is red");var t=this.left.check();if(t!==this.right.check())throw Ii("Black depths differ");return t+(this.isRed()?0:1)},t.EMPTY=null,t.RED=!0,t.BLACK=!1,t}();_o.EMPTY=new(function(){function t(){this.size=0}return t.prototype.copy=function(t,e,n,r,i){return this},t.prototype.insert=function(t,e,n){return new _o(t,e)},t.prototype.remove=function(t,e){return this},t.prototype.isEmpty=function(){return!0},t.prototype.inorderTraversal=function(t){return!1},t.prototype.reverseTraversal=function(t){return!1},t.prototype.minKey=function(){return null},t.prototype.maxKey=function(){return null},t.prototype.isRed=function(){return!1},t.prototype.checkMaxDepth=function(){return!0},t.prototype.check=function(){return 0},t}());var bo=function(t){return t[t.NullValue=0]="NullValue",t[t.BooleanValue=1]="BooleanValue",t[t.NumberValue=2]="NumberValue",t[t.TimestampValue=3]="TimestampValue",t[t.StringValue=4]="StringValue",t[t.BlobValue=5]="BlobValue",t[t.RefValue=6]="RefValue",t[t.GeoPointValue=7]="GeoPointValue",t[t.ArrayValue=8]="ArrayValue",t[t.ObjectValue=9]="ObjectValue",t}({}),wo=function(t){return t[t.Default=0]="Default",t[t.Estimate=1]="Estimate",t[t.Previous=2]="Previous",t}({}),Eo=function(){function t(t){this.serverTimestampBehavior=t}return t.fromSnapshotOptions=function(e){switch(e.serverTimestamps){case"estimate":return new t(wo.Estimate);case"previous":return new t(wo.Previous);case"none":case void 0:return t.defaultOptions;default:return Ii("fromSnapshotOptions() called with invalid options.")}},t.defaultOptions=new t(wo.Default),t}(),So=function(){function t(){}return t.prototype.toString=function(){var t=this.value();return null===t?"null":t.toString()},t.prototype.defaultCompareTo=function(t){return ki(this.typeOrder!==t.typeOrder,"Default compareTo should not be used for values of same type."),to(this.typeOrder,t.typeOrder)},t}(),Co=function(t){function e(){var e=t.call(this)||this;return e.typeOrder=bo.NullValue,e.internalValue=null,e}return Object(i.__extends)(e,t),e.prototype.value=function(t){return null},e.prototype.isEqual=function(t){return t instanceof e},e.prototype.compareTo=function(t){return t instanceof e?0:this.defaultCompareTo(t)},e.INSTANCE=new e,e}(So),To=function(t){function e(e){var n=t.call(this)||this;return n.internalValue=e,n.typeOrder=bo.BooleanValue,n}return Object(i.__extends)(e,t),e.prototype.value=function(t){return this.internalValue},e.prototype.isEqual=function(t){return t instanceof e&&this.internalValue===t.internalValue},e.prototype.compareTo=function(t){return t instanceof e?to(this,t):this.defaultCompareTo(t)},e.of=function(t){return t?e.TRUE:e.FALSE},e.TRUE=new e(!0),e.FALSE=new e(!1),e}(So),Io=function(t){function e(e){var n=t.call(this)||this;return n.internalValue=e,n.typeOrder=bo.NumberValue,n}return Object(i.__extends)(e,t),e.prototype.value=function(t){return this.internalValue},e.prototype.compareTo=function(t){return t instanceof e?(n=this.internalValue)<(r=t.internalValue)?-1:n>r?1:n===r?0:isNaN(n)?isNaN(r)?0:-1:1:this.defaultCompareTo(t);var n,r},e}(So);function ko(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e}var xo=function(t){function e(e){return t.call(this,e)||this}return Object(i.__extends)(e,t),e.prototype.isEqual=function(t){return t instanceof e&&ko(this.internalValue,t.internalValue)},e}(Io),Ao=function(t){function e(e){var n=t.call(this,e)||this;return n.internalValue=e,n}return Object(i.__extends)(e,t),e.prototype.isEqual=function(t){return t instanceof e&&ko(this.internalValue,t.internalValue)},e.NAN=new e(NaN),e.POSITIVE_INFINITY=new e(1/0),e.NEGATIVE_INFINITY=new e(-1/0),e}(Io),Oo=function(t){function e(e){var n=t.call(this)||this;return n.internalValue=e,n.typeOrder=bo.StringValue,n}return Object(i.__extends)(e,t),e.prototype.value=function(t){return this.internalValue},e.prototype.isEqual=function(t){return t instanceof e&&this.internalValue===t.internalValue},e.prototype.compareTo=function(t){return t instanceof e?to(this.internalValue,t.internalValue):this.defaultCompareTo(t)},e}(So),Po=function(t){function e(e){var n=t.call(this)||this;return n.internalValue=e,n.typeOrder=bo.TimestampValue,n}return Object(i.__extends)(e,t),e.prototype.value=function(t){return this.internalValue.toDate()},e.prototype.isEqual=function(t){return t instanceof e&&this.internalValue.isEqual(t.internalValue)},e.prototype.compareTo=function(t){return t instanceof e?this.internalValue.compareTo(t.internalValue):t instanceof No?-1:this.defaultCompareTo(t)},e}(So),No=function(t){function e(e,n){var r=t.call(this)||this;return r.localWriteTime=e,r.previousValue=n,r.typeOrder=bo.TimestampValue,r}return Object(i.__extends)(e,t),e.prototype.value=function(t){return t&&t.serverTimestampBehavior===wo.Estimate?this.localWriteTime.toDate():t&&t.serverTimestampBehavior===wo.Previous&&this.previousValue?this.previousValue.value(t):null},e.prototype.isEqual=function(t){return t instanceof e&&this.localWriteTime.isEqual(t.localWriteTime)},e.prototype.compareTo=function(t){return t instanceof e?this.localWriteTime.compareTo(t.localWriteTime):t instanceof Po?1:this.defaultCompareTo(t)},e.prototype.toString=function(){return"<ServerTimestamp localTime="+this.localWriteTime.toString()+">"},e}(So),Ro=function(t){function e(e){var n=t.call(this)||this;return n.internalValue=e,n.typeOrder=bo.BlobValue,n}return Object(i.__extends)(e,t),e.prototype.value=function(t){return this.internalValue},e.prototype.isEqual=function(t){return t instanceof e&&this.internalValue.isEqual(t.internalValue)},e.prototype.compareTo=function(t){return t instanceof e?this.internalValue._compareTo(t.internalValue):this.defaultCompareTo(t)},e}(So),Do=function(t){function e(e,n){var r=t.call(this)||this;return r.databaseId=e,r.key=n,r.typeOrder=bo.RefValue,r}return Object(i.__extends)(e,t),e.prototype.value=function(t){return this.key},e.prototype.isEqual=function(t){return t instanceof e&&this.key.isEqual(t.key)&&this.databaseId.isEqual(t.databaseId)},e.prototype.compareTo=function(t){if(t instanceof e){var n=this.databaseId.compareTo(t.databaseId);return 0!==n?n:po.comparator(this.key,t.key)}return this.defaultCompareTo(t)},e}(So),Mo=function(t){function e(e){var n=t.call(this)||this;return n.internalValue=e,n.typeOrder=bo.GeoPointValue,n}return Object(i.__extends)(e,t),e.prototype.value=function(t){return this.internalValue},e.prototype.isEqual=function(t){return t instanceof e&&this.internalValue.isEqual(t.internalValue)},e.prototype.compareTo=function(t){return t instanceof e?this.internalValue._compareTo(t.internalValue):this.defaultCompareTo(t)},e}(So),Vo=function(t){function e(e){var n=t.call(this)||this;return n.internalValue=e,n.typeOrder=bo.ObjectValue,n}return Object(i.__extends)(e,t),e.prototype.value=function(t){var e={};return this.internalValue.inorderTraversal(function(n,r){e[n]=r.value(t)}),e},e.prototype.forEach=function(t){this.internalValue.inorderTraversal(t)},e.prototype.isEqual=function(t){if(t instanceof e){for(var n=this.internalValue.getIterator(),r=t.internalValue.getIterator();n.hasNext()&&r.hasNext();){var i=n.getNext(),o=r.getNext();if(i.key!==o.key||!i.value.isEqual(o.value))return!1}return!n.hasNext()&&!r.hasNext()}return!1},e.prototype.compareTo=function(t){if(t instanceof e){for(var n=this.internalValue.getIterator(),r=t.internalValue.getIterator();n.hasNext()&&r.hasNext();){var i=n.getNext(),o=r.getNext(),s=to(i.key,o.key)||i.value.compareTo(o.value);if(s)return s}return to(n.hasNext(),r.hasNext())}return this.defaultCompareTo(t)},e.prototype.set=function(t,n){if(ki(!t.isEmpty(),"Cannot set field for empty path on ObjectValue"),1===t.length)return this.setChild(t.firstSegment(),n);var r=this.child(t.firstSegment());r instanceof e||(r=e.EMPTY);var i=r.set(t.popFirst(),n);return this.setChild(t.firstSegment(),i)},e.prototype.delete=function(t){if(ki(!t.isEmpty(),"Cannot delete field for empty path on ObjectValue"),1===t.length)return new e(this.internalValue.remove(t.firstSegment()));var n=this.child(t.firstSegment());if(n instanceof e){var r=n.delete(t.popFirst());return new e(this.internalValue.insert(t.firstSegment(),r))}return this},e.prototype.contains=function(t){return void 0!==this.field(t)},e.prototype.field=function(t){ki(!t.isEmpty(),"Can't get field of empty path");var n=this;return t.forEach(function(t){n=n instanceof e&&n.internalValue.get(t)||void 0}),n},e.prototype.toString=function(){return JSON.stringify(this.value())},e.prototype.child=function(t){return this.internalValue.get(t)||void 0},e.prototype.setChild=function(t,n){return new e(this.internalValue.insert(t,n))},e.EMPTY=new e(new go(to)),e}(So),Fo=function(t){function e(e){var n=t.call(this)||this;return n.internalValue=e,n.typeOrder=bo.ArrayValue,n}return Object(i.__extends)(e,t),e.prototype.value=function(t){return this.internalValue.map(function(e){return e.value(t)})},e.prototype.forEach=function(t){this.internalValue.forEach(t)},e.prototype.isEqual=function(t){if(t instanceof e){if(this.internalValue.length!==t.internalValue.length)return!1;for(var n=0;n<this.internalValue.length;n++)if(!this.internalValue[n].isEqual(t.internalValue[n]))return!1;return!0}return!1},e.prototype.compareTo=function(t){if(t instanceof e){for(var n=Math.min(this.internalValue.length,t.internalValue.length),r=0;r<n;r++){var i=this.internalValue[r].compareTo(t.internalValue[r]);if(i)return i}return to(this.internalValue.length,t.internalValue.length)}return this.defaultCompareTo(t)},e.prototype.toString=function(){return JSON.stringify(this.value())},e}(So),jo=Number,Lo=jo.MIN_SAFE_INTEGER||-(Math.pow(2,53)-1),Uo=jo.MAX_SAFE_INTEGER||Math.pow(2,53)-1,Bo=jo.isInteger||function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t};function qo(t){return null===t||void 0===t}var Ho,Ko=function(){function t(t,e,n,r,i,o){void 0===e&&(e=[]),void 0===n&&(n=[]),void 0===r&&(r=null),void 0===i&&(i=null),void 0===o&&(o=null),this.path=t,this.explicitOrderBy=e,this.filters=n,this.limit=r,this.startAt=i,this.endAt=o,this.memoizedCanonicalId=null,this.memoizedOrderBy=null,this.startAt&&this.assertValidBound(this.startAt),this.endAt&&this.assertValidBound(this.endAt)}return t.atPath=function(e){return new t(e)},Object.defineProperty(t.prototype,"orderBy",{get:function(){if(null===this.memoizedOrderBy){var t=this.getInequalityFilterField(),e=this.getFirstOrderByField();if(null!==t&&null===e)this.memoizedOrderBy=t.isKeyField()?[Zo]:[new Xo(t),Zo];else{ki(null===t||null!==e&&t.isEqual(e),"First orderBy should match inequality field."),this.memoizedOrderBy=[];for(var n=!1,r=0,i=this.explicitOrderBy;r<i.length;r++){var o=i[r];this.memoizedOrderBy.push(o),o.field.isKeyField()&&(n=!0)}n||this.memoizedOrderBy.push((this.explicitOrderBy.length>0?this.explicitOrderBy[this.explicitOrderBy.length-1].dir:Yo.ASCENDING)===Yo.ASCENDING?Zo:$o)}}return this.memoizedOrderBy},enumerable:!0,configurable:!0}),t.prototype.addFilter=function(e){ki(null==this.getInequalityFilterField()||!(e instanceof Qo)||!e.isInequality()||e.field.isEqual(this.getInequalityFilterField()),"Query must only have one inequality field."),ki(!po.isDocumentKey(this.path),"No filtering allowed for document query");var n=this.filters.concat([e]);return new t(this.path,this.explicitOrderBy.slice(),n,this.limit,this.startAt,this.endAt)},t.prototype.addOrderBy=function(e){ki(!po.isDocumentKey(this.path),"No ordering allowed for document query"),ki(!this.startAt&&!this.endAt,"Bounds must be set after orderBy");var n=this.explicitOrderBy.concat([e]);return new t(this.path,n,this.filters.slice(),this.limit,this.startAt,this.endAt)},t.prototype.withLimit=function(e){return new t(this.path,this.explicitOrderBy.slice(),this.filters.slice(),e,this.startAt,this.endAt)},t.prototype.withStartAt=function(e){return new t(this.path,this.explicitOrderBy.slice(),this.filters.slice(),this.limit,e,this.endAt)},t.prototype.withEndAt=function(e){return new t(this.path,this.explicitOrderBy.slice(),this.filters.slice(),this.limit,this.startAt,e)},t.prototype.canonicalId=function(){if(null===this.memoizedCanonicalId){var t=this.path.canonicalString();t+="|f:";for(var e=0,n=this.filters;e<n.length;e++)t+=n[e].canonicalId(),t+=",";t+="|ob:";for(var r=0,i=this.orderBy;r<i.length;r++)t+=i[r].canonicalId(),t+=",";qo(this.limit)||(t+="|l:",t+=this.limit),this.startAt&&(t+="|lb:",t+=this.startAt.canonicalId()),this.endAt&&(t+="|ub:",t+=this.endAt.canonicalId()),this.memoizedCanonicalId=t}return this.memoizedCanonicalId},t.prototype.toString=function(){var t="Query("+this.path.canonicalString();return this.filters.length>0&&(t+=", filters: ["+this.filters.join(", ")+"]"),qo(this.limit)||(t+=", limit: "+this.limit),this.explicitOrderBy.length>0&&(t+=", orderBy: ["+this.explicitOrderBy.join(", ")+"]"),this.startAt&&(t+=", startAt: "+this.startAt.canonicalId()),this.endAt&&(t+=", endAt: "+this.endAt.canonicalId()),t+")"},t.prototype.isEqual=function(t){if(this.limit!==t.limit)return!1;if(this.orderBy.length!==t.orderBy.length)return!1;for(var e=0;e<this.orderBy.length;e++)if(!this.orderBy[e].isEqual(t.orderBy[e]))return!1;if(this.filters.length!==t.filters.length)return!1;for(e=0;e<this.filters.length;e++)if(!this.filters[e].isEqual(t.filters[e]))return!1;return!!this.path.isEqual(t.path)&&!(null!==this.startAt?!this.startAt.isEqual(t.startAt):null!==t.startAt)&&(null!==this.endAt?this.endAt.isEqual(t.endAt):null===t.endAt)},t.prototype.docComparator=function(t,e){for(var n=!1,r=0,i=this.orderBy;r<i.length;r++){var o=i[r],s=o.compare(t,e);if(0!==s)return s;n=n||o.field.isKeyField()}return ki(n,"orderBy used that doesn't compare on key field"),0},t.prototype.matches=function(t){return this.matchesAncestor(t)&&this.matchesOrderBy(t)&&this.matchesFilters(t)&&this.matchesBounds(t)},t.prototype.hasLimit=function(){return!qo(this.limit)},t.prototype.getFirstOrderByField=function(){return this.explicitOrderBy.length>0?this.explicitOrderBy[0].field:null},t.prototype.getInequalityFilterField=function(){for(var t=0,e=this.filters;t<e.length;t++){var n=e[t];if(n instanceof Qo&&n.isInequality())return n.field}return null},t.prototype.isDocumentQuery=function(){return po.isDocumentKey(this.path)&&0===this.filters.length},t.prototype.matchesAncestor=function(t){var e=t.key.path;return po.isDocumentKey(this.path)?this.path.isEqual(e):this.path.isPrefixOf(e)&&this.path.length===e.length-1},t.prototype.matchesOrderBy=function(t){for(var e=0,n=this.explicitOrderBy;e<n.length;e++){var r=n[e];if(!r.field.isKeyField()&&void 0===t.field(r.field))return!1}return!0},t.prototype.matchesFilters=function(t){for(var e=0,n=this.filters;e<n.length;e++)if(!n[e].matches(t))return!1;return!0},t.prototype.matchesBounds=function(t){return!(this.startAt&&!this.startAt.sortsBeforeDocument(this.orderBy,t)||this.endAt&&this.endAt.sortsBeforeDocument(this.orderBy,t))},t.prototype.assertValidBound=function(t){ki(t.position.length<=this.orderBy.length,"Bound is longer than orderBy")},t}(),zo=function(){function t(t){this.name=t}return t.fromString=function(e){switch(e){case"<":return t.LESS_THAN;case"<=":return t.LESS_THAN_OR_EQUAL;case"==":return t.EQUAL;case">=":return t.GREATER_THAN_OR_EQUAL;case">":return t.GREATER_THAN;default:return Ii("Unknown relation: "+e)}},t.prototype.toString=function(){return this.name},t.prototype.isEqual=function(t){return this.name===t.name},t.LESS_THAN=new t("<"),t.LESS_THAN_OR_EQUAL=new t("<="),t.EQUAL=new t("=="),t.GREATER_THAN=new t(">"),t.GREATER_THAN_OR_EQUAL=new t(">="),t}(),Qo=function(){function t(t,e,n){this.field=t,this.op=e,this.value=n}return t.prototype.matches=function(t){if(this.field.isKeyField()){ki(this.value instanceof Do,"Comparing on key, but filter value not a RefValue");var e=po.comparator(t.key,this.value.key);return this.matchesComparison(e)}var n=t.field(this.field);return void 0!==n&&this.matchesValue(n)},t.prototype.matchesValue=function(t){return this.value.typeOrder===t.typeOrder&&this.matchesComparison(t.compareTo(this.value))},t.prototype.matchesComparison=function(t){switch(this.op){case zo.LESS_THAN:return t<0;case zo.LESS_THAN_OR_EQUAL:return t<=0;case zo.EQUAL:return 0===t;case zo.GREATER_THAN:return t>0;case zo.GREATER_THAN_OR_EQUAL:return t>=0;default:return Ii("Unknown relation op"+this.op)}},t.prototype.isInequality=function(){return this.op!==zo.EQUAL},t.prototype.canonicalId=function(){return this.field.canonicalString()+this.op.toString()+this.value.toString()},t.prototype.isEqual=function(e){return e instanceof t&&this.op.isEqual(e.op)&&this.field.isEqual(e.field)&&this.value.isEqual(e.value)},t.prototype.toString=function(){return this.field.canonicalString()+" "+this.op+" "+this.value.value()},t}(),Go=function(){function t(t){this.field=t}return t.prototype.matches=function(t){var e=t.field(this.field);return void 0!==e&&null===e.value()},t.prototype.canonicalId=function(){return this.field.canonicalString()+" IS null"},t.prototype.toString=function(){return this.field.canonicalString()+" IS null"},t.prototype.isEqual=function(e){return e instanceof t&&this.field.isEqual(e.field)},t}(),Wo=function(){function t(t){this.field=t}return t.prototype.matches=function(t){var e=t.field(this.field).value();return"number"==typeof e&&isNaN(e)},t.prototype.canonicalId=function(){return this.field.canonicalString()+" IS NaN"},t.prototype.toString=function(){return this.field.canonicalString()+" IS NaN"},t.prototype.isEqual=function(e){return e instanceof t&&this.field.isEqual(e.field)},t}(),Yo=function(){function t(t){this.name=t}return t.prototype.toString=function(){return this.name},t.ASCENDING=new t("asc"),t.DESCENDING=new t("desc"),t}(),Jo=function(){function t(t,e){this.position=t,this.before=e}return t.prototype.canonicalId=function(){for(var t=this.before?"b:":"a:",e=0,n=this.position;e<n.length;e++)t+=n[e].toString();return t},t.prototype.sortsBeforeDocument=function(t,e){ki(this.position.length<=t.length,"Bound has more components than query's orderBy");for(var n=0,r=0;r<this.position.length;r++){var i=t[r],o=this.position[r];if(i.field.isKeyField())ki(o instanceof Do,"Bound has a non-key value where the key path is being used."),n=po.comparator(o.key,e.key);else{var s=e.field(i.field);ki(void 0!==s,"Field should exist since document matched the orderBy already."),n=o.compareTo(s)}if(i.dir===Yo.DESCENDING&&(n*=-1),0!==n)break}return this.before?n<=0:n<0},t.prototype.isEqual=function(t){if(null===t)return!1;if(this.before!==t.before||this.position.length!==t.position.length)return!1;for(var e=0;e<this.position.length;e++)return this.position[e].isEqual(t.position[e]);return!0},t}(),Xo=function(){function t(t,e){this.field=t,void 0===e&&(e=Yo.ASCENDING),this.dir=e,this.isKeyOrderBy=t.isKeyField()}return t.prototype.compare=function(t,e){var n=this.isKeyOrderBy?yo.compareByKey(t,e):yo.compareByField(this.field,t,e);switch(this.dir){case Yo.ASCENDING:return n;case Yo.DESCENDING:return-1*n;default:return Ii("Unknown direction: "+this.dir)}},t.prototype.canonicalId=function(){return this.field.canonicalString()+this.dir.toString()},t.prototype.toString=function(){return this.field.canonicalString()+" ("+this.dir+")"},t.prototype.isEqual=function(t){return this.dir===t.dir&&this.field.isEqual(t.field)},t}(),Zo=new Xo(fo.keyField(),Yo.ASCENDING),$o=new Xo(fo.keyField(),Yo.DESCENDING),ts=new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/),es=function(){function t(t,e){this.seconds=t,this.nanos=e,ki(e>=0,"timestamp nanoseconds out of range: "+e),ki(e<1e9,"timestamp nanoseconds out of range"+e),ki(t>=-62135596800,"timestamp seconds out of range: "+t),ki(t<253402300800,"timestamp seconds out of range"+t)}return t.now=function(){return t.fromEpochMilliseconds(Date.now())},t.fromDate=function(e){return t.fromEpochMilliseconds(e.getTime())},t.fromEpochMilliseconds=function(e){var n=Math.floor(e/1e3);return new t(n,1e6*(e-1e3*n))},t.fromISOString=function(e){var n=0,r=ts.exec(e);if(ki(!!r,"invalid timestamp: "+e),r[1]){var i=r[1];i=(i+"000000000").substr(0,9),n=Number(i)}var o=new Date(e);return new t(Math.floor(o.getTime()/1e3),n)},t.prototype.toDate=function(){return new Date(this.toEpochMilliseconds())},t.prototype.toEpochMilliseconds=function(){return 1e3*this.seconds+this.nanos/1e6},t.prototype.compareTo=function(t){return this.seconds===t.seconds?to(this.nanos,t.nanos):to(this.seconds,t.seconds)},t.prototype.isEqual=function(t){return t.seconds===this.seconds&&t.nanos===this.nanos},t.prototype.toString=function(){return"Timestamp(seconds="+this.seconds+", nanos="+this.nanos+")"},t}(),ns=function(){function t(t){this.timestamp=t}return t.fromMicroseconds=function(e){var n=Math.floor(e/1e6);return new t(new es(n,e%1e6*1e3))},t.fromTimestamp=function(e){return new t(e)},t.forDeletedDoc=function(){return t.MIN},t.prototype.compareTo=function(t){return this.timestamp.compareTo(t.timestamp)},t.prototype.isEqual=function(t){return this.timestamp.isEqual(t.timestamp)},t.prototype.toMicroseconds=function(){return 1e6*this.timestamp.seconds+this.timestamp.nanos/1e3},t.prototype.toString=function(){return"SnapshotVersion("+this.timestamp.toString()+")"},t.prototype.toTimestamp=function(){return this.timestamp},t.MIN=new t(new es(0,0)),t}();!function(t){t[t.Listen=0]="Listen",t[t.ExistenceFilterMismatch=1]="ExistenceFilterMismatch",t[t.LimboResolution=2]="LimboResolution"}(Ho||(Ho={}));var rs,is=function(){function t(t,e,n,r,i){void 0===r&&(r=ns.MIN),void 0===i&&(i=Ai()),this.query=t,this.targetId=e,this.purpose=n,this.snapshotVersion=r,this.resumeToken=i}return t.prototype.update=function(e){return new t(this.query,this.targetId,this.purpose,e.snapshotVersion,e.resumeToken)},t.prototype.isEqual=function(t){return this.targetId===t.targetId&&this.purpose===t.purpose&&this.snapshotVersion.isEqual(t.snapshotVersion)&&this.resumeToken===t.resumeToken&&this.query.isEqual(t.query)},t}(),os=function(){function t(t){this.fields=t}return t.prototype.isEqual=function(t){return eo(this.fields,t.fields)},t}(),ss=function(){function t(){}return t.prototype.isEqual=function(e){return e instanceof t},t.instance=new t,t}(),as=function(){function t(t,e){this.field=t,this.transform=e}return t.prototype.isEqual=function(t){return this.field.isEqual(t.field)&&this.transform.isEqual(t.transform)},t}(),us=function(t){return t[t.Set=0]="Set",t[t.Patch=1]="Patch",t[t.Transform=2]="Transform",t[t.Delete=3]="Delete",t}({}),ls=function(){function t(t,e){this.updateTime=t,this.exists=e,ki(void 0===t||void 0===e,'Precondition can specify "exists" or "updateTime" but not both')}return t.exists=function(e){return new t(void 0,e)},t.updateTime=function(e){return new t(e)},Object.defineProperty(t.prototype,"isNone",{get:function(){return void 0===this.updateTime&&void 0===this.exists},enumerable:!0,configurable:!0}),t.prototype.isValidFor=function(t){return void 0!==this.updateTime?t instanceof yo&&t.version.isEqual(this.updateTime):void 0!==this.exists?this.exists?t instanceof yo:null===t||t instanceof mo:(ki(this.isNone,"Precondition should be empty"),!0)},t.prototype.isEqual=function(t){return n=t.updateTime,(null!==(e=this.updateTime)&&void 0!==e?!(!n||!e.isEqual(n)):e===n)&&this.exists===t.exists;var e,n},t.NONE=new t,t}(),cs=function(){function t(){}return t.prototype.verifyKeyMatches=function(t){null!=t&&ki(t.key.isEqual(this.key),"Can only apply a mutation to a document with the same key")},t.getPostMutationVersion=function(t){return t instanceof yo?t.version:ns.MIN},t}(),hs=function(t){function e(e,n,r){var i=t.call(this)||this;return i.key=e,i.value=n,i.precondition=r,i.type=us.Set,i}return Object(i.__extends)(e,t),e.prototype.applyToRemoteDocument=function(t,e){this.verifyKeyMatches(t),ki(null==e.transformResults,"Transform results received by SetMutation.");var n=cs.getPostMutationVersion(t);return new yo(this.key,n,this.value,{hasLocalMutations:!1})},e.prototype.applyToLocalView=function(t,e,n){if(this.verifyKeyMatches(t),!this.precondition.isValidFor(t))return t;var r=cs.getPostMutationVersion(t);return new yo(this.key,r,this.value,{hasLocalMutations:!0})},e.prototype.isEqual=function(t){return t instanceof e&&this.key.isEqual(t.key)&&this.value.isEqual(t.value)&&this.precondition.isEqual(t.precondition)},e}(cs),fs=function(t){function e(e,n,r,i){var o=t.call(this)||this;return o.key=e,o.data=n,o.fieldMask=r,o.precondition=i,o.type=us.Patch,o}return Object(i.__extends)(e,t),e.prototype.applyToRemoteDocument=function(t,e){if(this.verifyKeyMatches(t),ki(null==e.transformResults,"Transform results received by PatchMutation."),!this.precondition.isValidFor(t))return t;var n=cs.getPostMutationVersion(t),r=this.patchDocument(t);return new yo(this.key,n,r,{hasLocalMutations:!1})},e.prototype.applyToLocalView=function(t,e,n){if(this.verifyKeyMatches(t),!this.precondition.isValidFor(t))return t;var r=cs.getPostMutationVersion(t),i=this.patchDocument(t);return new yo(this.key,r,i,{hasLocalMutations:!0})},e.prototype.isEqual=function(t){return t instanceof e&&this.key.isEqual(t.key)&&this.fieldMask.isEqual(t.fieldMask)&&this.precondition.isEqual(t.precondition)},e.prototype.patchDocument=function(t){return this.patchObject(t instanceof yo?t.data:Vo.EMPTY)},e.prototype.patchObject=function(t){for(var e=0,n=this.fieldMask.fields;e<n.length;e++){var r=n[e],i=this.data.field(r);t=void 0!==i?t.set(r,i):t.delete(r)}return t},e}(cs),ps=function(t){function e(e,n){var r=t.call(this)||this;return r.key=e,r.fieldTransforms=n,r.type=us.Transform,r.precondition=ls.exists(!0),r}return Object(i.__extends)(e,t),e.prototype.applyToRemoteDocument=function(t,e){this.verifyKeyMatches(t),ki(null!=e.transformResults,"Transform results missing for TransformMutation.");var n=e.transformResults;if(!this.precondition.isValidFor(t))return t;var r=this.requireDocument(t),i=this.transformObject(r.data,n);return new yo(this.key,r.version,i,{hasLocalMutations:!1})},e.prototype.applyToLocalView=function(t,e,n){if(this.verifyKeyMatches(t),!this.precondition.isValidFor(t))return t;var r=this.requireDocument(t),i=this.localTransformResults(n,e),o=this.transformObject(r.data,i);return new yo(this.key,r.version,o,{hasLocalMutations:!0})},e.prototype.isEqual=function(t){return t instanceof e&&this.key.isEqual(t.key)&&eo(this.fieldTransforms,t.fieldTransforms)&&this.precondition.isEqual(t.precondition)},e.prototype.requireDocument=function(t){ki(t instanceof yo,"Unknown MaybeDocument type "+t);var e=t;return ki(e.key.isEqual(this.key),"Can only transform a document with the same key"),e},e.prototype.localTransformResults=function(t,e){for(var n=[],r=0,i=this.fieldTransforms;r<i.length;r++){var o=i[r],s=o.transform;if(!(s instanceof ss))return Ii("Encountered unknown transform: "+s);var a=null;e instanceof yo&&(a=e.field(o.field)||null),n.push(new No(t,a))}return n},e.prototype.transformObject=function(t,e){ki(e.length===this.fieldTransforms.length,"TransformResults length mismatch.");for(var n=0;n<this.fieldTransforms.length;n++){var r=this.fieldTransforms[n],i=r.transform,o=r.field;if(!(i instanceof ss))return Ii("Encountered unknown transform: "+i);t=t.set(o,e[n])}return t},e}(cs),ds=function(t){function e(e,n){var r=t.call(this)||this;return r.key=e,r.precondition=n,r.type=us.Delete,r}return Object(i.__extends)(e,t),e.prototype.applyToRemoteDocument=function(t,e){return this.verifyKeyMatches(t),ki(null==e.transformResults,"Transform results received by DeleteMutation."),new mo(this.key,ns.MIN)},e.prototype.applyToLocalView=function(t,e,n){return this.verifyKeyMatches(t),this.precondition.isValidFor(t)?(t&&ki(t.key.isEqual(this.key),"Can only apply mutation to document with same key"),new mo(this.key,ns.forDeletedDoc())):t},e.prototype.isEqual=function(t){return t instanceof e&&this.key.isEqual(t.key)&&this.precondition.isEqual(t.precondition)},e}(cs),ys=function(){function t(t){this.count=t}return t.prototype.isEqual=function(t){return t&&t.count===this.count},t}();function ms(t){switch(t){case Oi.OK:return Ii("Treated status OK as error");case Oi.CANCELLED:case Oi.UNKNOWN:case Oi.DEADLINE_EXCEEDED:case Oi.RESOURCE_EXHAUSTED:case Oi.INTERNAL:case Oi.UNAVAILABLE:case Oi.UNAUTHENTICATED:return!1;case Oi.INVALID_ARGUMENT:case Oi.NOT_FOUND:case Oi.ALREADY_EXISTS:case Oi.PERMISSION_DENIED:case Oi.FAILED_PRECONDITION:case Oi.ABORTED:case Oi.OUT_OF_RANGE:case Oi.UNIMPLEMENTED:case Oi.DATA_LOSS:return!0;default:return Ii("Unknown status code: "+t)}}function gs(t){if(void 0===t)return Ci("GRPC error has no .code"),Oi.UNKNOWN;switch(t){case rs.OK:return Oi.OK;case rs.CANCELLED:return Oi.CANCELLED;case rs.UNKNOWN:return Oi.UNKNOWN;case rs.DEADLINE_EXCEEDED:return Oi.DEADLINE_EXCEEDED;case rs.RESOURCE_EXHAUSTED:return Oi.RESOURCE_EXHAUSTED;case rs.INTERNAL:return Oi.INTERNAL;case rs.UNAVAILABLE:return Oi.UNAVAILABLE;case rs.UNAUTHENTICATED:return Oi.UNAUTHENTICATED;case rs.INVALID_ARGUMENT:return Oi.INVALID_ARGUMENT;case rs.NOT_FOUND:return Oi.NOT_FOUND;case rs.ALREADY_EXISTS:return Oi.ALREADY_EXISTS;case rs.PERMISSION_DENIED:return Oi.PERMISSION_DENIED;case rs.FAILED_PRECONDITION:return Oi.FAILED_PRECONDITION;case rs.ABORTED:return Oi.ABORTED;case rs.OUT_OF_RANGE:return Oi.OUT_OF_RANGE;case rs.UNIMPLEMENTED:return Oi.UNIMPLEMENTED;case rs.DATA_LOSS:return Oi.DATA_LOSS;default:return Ii("Unknown status code: "+t)}}!function(t){t[t.OK=0]="OK",t[t.CANCELLED=1]="CANCELLED",t[t.UNKNOWN=2]="UNKNOWN",t[t.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",t[t.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",t[t.NOT_FOUND=5]="NOT_FOUND",t[t.ALREADY_EXISTS=6]="ALREADY_EXISTS",t[t.PERMISSION_DENIED=7]="PERMISSION_DENIED",t[t.UNAUTHENTICATED=16]="UNAUTHENTICATED",t[t.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",t[t.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",t[t.ABORTED=10]="ABORTED",t[t.OUT_OF_RANGE=11]="OUT_OF_RANGE",t[t.UNIMPLEMENTED=12]="UNIMPLEMENTED",t[t.INTERNAL=13]="INTERNAL",t[t.UNAVAILABLE=14]="UNAVAILABLE",t[t.DATA_LOSS=15]="DATA_LOSS"}(rs||(rs={}));var vs=function(){function t(t){this.comparator=t,this.data=new go(this.comparator)}return t.fromMapKeys=function(e){var n=new t(e.comparator);return e.forEach(function(t){n=n.add(t)}),n},t.prototype.has=function(t){return null!==this.data.get(t)},t.prototype.first=function(){return this.data.minKey()},t.prototype.last=function(){return this.data.maxKey()},Object.defineProperty(t.prototype,"size",{get:function(){return this.data.size},enumerable:!0,configurable:!0}),t.prototype.indexOf=function(t){return this.data.indexOf(t)},t.prototype.forEach=function(t){this.data.inorderTraversal(function(e,n){return t(e),!1})},t.prototype.forEachInRange=function(t,e){for(var n=this.data.getIteratorFrom(t[0]);n.hasNext();){var r=n.getNext();if(this.comparator(r.key,t[1])>=0)return;e(r.key)}},t.prototype.forEachWhile=function(t,e){var n;for(n=void 0!==e?this.data.getIteratorFrom(e):this.data.getIterator();n.hasNext();)if(!t(n.getNext().key))return},t.prototype.firstAfterOrEqual=function(t){var e=this.data.getIteratorFrom(t);return e.hasNext()?e.getNext().key:null},t.prototype.add=function(t){return this.copy(this.data.remove(t).insert(t,!0))},t.prototype.delete=function(t){return this.has(t)?this.copy(this.data.remove(t)):this},t.prototype.isEmpty=function(){return this.data.isEmpty()},t.prototype.unionWith=function(t){var e=this;return t.forEach(function(t){e=e.add(t)}),e},t.prototype.isEqual=function(e){if(!(e instanceof t))return!1;if(this.size!==e.size)return!1;for(var n=this.data.getIterator(),r=e.data.getIterator();n.hasNext();){var i=n.getNext().key,o=r.getNext().key;if(0!==this.comparator(i,o))return!1}return!0},t.prototype.toString=function(){var t=[];return this.forEach(function(e){return t.push(e)}),"SortedSet("+t.toString()+")"},t.prototype.copy=function(e){var n=new t(this.comparator);return n.data=e,n},t}(),_s=new go(po.comparator);function bs(){return _s}var ws=new go(po.comparator);function Es(){return ws}var Ss=new go(po.comparator);function Cs(){return Ss}var Ts=new vs(po.comparator);function Is(){return Ts}var ks,xs=function(){function t(t,e,n){this.snapshotVersion=t,this.targetChanges=e,this.documentUpdates=n}return t.prototype.addDocumentUpdate=function(t){this.documentUpdates=this.documentUpdates.insert(t.key,t)},t.prototype.handleExistenceFilterMismatch=function(t){this.targetChanges[t]={mapping:new Os,snapshotVersion:ns.MIN,currentStatusUpdate:ks.MarkNotCurrent,resumeToken:Ai()}},t}();!function(t){t[t.None=0]="None",t[t.MarkNotCurrent=1]="MarkNotCurrent",t[t.MarkCurrent=2]="MarkCurrent"}(ks||(ks={}));var As=Is(),Os=function(){function t(){this.docs=As}return Object.defineProperty(t.prototype,"documents",{get:function(){return this.docs},enumerable:!0,configurable:!0}),t.prototype.add=function(t){this.docs=this.docs.add(t)},t.prototype.delete=function(t){this.docs=this.docs.delete(t)},t.prototype.isEqual=function(t){return null!==t&&this.docs.isEqual(t.docs)},t}(),Ps=function(){function t(){this.addedDocuments=As,this.removedDocuments=As}return t.prototype.applyToKeySet=function(t){var e=t;return this.addedDocuments.forEach(function(t){return e=e.add(t)}),this.removedDocuments.forEach(function(t){return e=e.delete(t)}),e},t.prototype.add=function(t){this.addedDocuments=this.addedDocuments.add(t),this.removedDocuments=this.removedDocuments.delete(t)},t.prototype.delete=function(t){this.addedDocuments=this.addedDocuments.delete(t),this.removedDocuments=this.removedDocuments.add(t)},t.prototype.isEqual=function(t){return null!==t&&this.addedDocuments.isEqual(t.addedDocuments)&&this.removedDocuments.isEqual(t.removedDocuments)},t}(),Ns=function(t,e,n,r){this.updatedTargetIds=t,this.removedTargetIds=e,this.key=n,this.newDoc=r},Rs=function(t,e){this.targetId=t,this.existenceFilter=e},Ds=function(t){return t[t.NoChange=0]="NoChange",t[t.Added=1]="Added",t[t.Removed=2]="Removed",t[t.Current=3]="Current",t[t.Reset=4]="Reset",t}({}),Ms=function(){return function(t,e,n,r){void 0===n&&(n=Ai()),void 0===r&&(r=null),this.state=t,this.targetIds=e,this.resumeToken=n,this.cause=r}}(),Vs=function(){function t(t,e,n){this.snapshotVersion=t,this.listenTargets=e,this.existenceFilters={},this.targetChanges={},this.documentUpdates=bs(),this.frozen=!1,this.pendingTargetResponses=Fi(n)}return t.prototype.add=function(t){ki(!this.frozen,"Trying to modify frozen WatchChangeAggregator."),t instanceof Ns?this.addDocumentChange(t):t instanceof Ms?this.addTargetChange(t):t instanceof Rs?this.addExistenceFilterChange(t):Ii("Unknown watch change: "+t)},t.prototype.addChanges=function(t){var e=this;ki(!this.frozen,"Trying to modify frozen WatchChangeAggregator."),t.forEach(function(t){return e.add(t)})},t.prototype.createRemoteEvent=function(){var t=this,e=this.targetChanges;return Di(this.targetChanges,function(n){t.isActiveTarget(n)||delete e[n]}),this.frozen=!0,new xs(this.snapshotVersion,e,this.documentUpdates)},t.prototype.ensureTargetChange=function(t){var e=this.targetChanges[t];return e||(e={currentStatusUpdate:ks.None,snapshotVersion:this.snapshotVersion,mapping:new Ps,resumeToken:Ai()},this.targetChanges[t]=e),e},t.prototype.isActiveTarget=function(t){return!Ri(this.pendingTargetResponses,t)&&Ri(this.listenTargets,t)},t.prototype.addDocumentChange=function(t){for(var e=!1,n=0,r=t.updatedTargetIds;n<r.length;n++)this.isActiveTarget(s=r[n])&&(this.ensureTargetChange(s).mapping.add(t.key),e=!0);for(var i=0,o=t.removedTargetIds;i<o.length;i++){var s;this.isActiveTarget(s=o[i])&&(this.ensureTargetChange(s).mapping.delete(t.key),e=!0)}t.newDoc&&e&&(this.documentUpdates=this.documentUpdates.insert(t.key,t.newDoc))},t.prototype.addTargetChange=function(t){var e=this;t.targetIds.forEach(function(n){var r=e.ensureTargetChange(n);switch(t.state){case Ds.NoChange:e.isActiveTarget(n)&&Fs(r,t.resumeToken);break;case Ds.Added:e.recordTargetResponse(n),Ri(e.pendingTargetResponses,n)||(r.mapping=new Ps,r.currentStatusUpdate=ks.None,delete e.existenceFilters[n]),Fs(r,t.resumeToken);break;case Ds.Removed:e.recordTargetResponse(n),ki(!t.cause,"WatchChangeAggregator does not handle errored targets");break;case Ds.Current:e.isActiveTarget(n)&&(r.currentStatusUpdate=ks.MarkCurrent,Fs(r,t.resumeToken));break;case Ds.Reset:e.isActiveTarget(n)&&(r.mapping=new Os,Fs(r,t.resumeToken));break;default:Ii("Unknown target watch change state: "+t.state)}})},t.prototype.recordTargetResponse=function(t){var e=(this.pendingTargetResponses[t]||0)-1;0===e?delete this.pendingTargetResponses[t]:this.pendingTargetResponses[t]=e},t.prototype.addExistenceFilterChange=function(t){this.isActiveTarget(t.targetId)&&(this.existenceFilters[t.targetId]=t.existenceFilter)},t}();function Fs(t,e){e.length>0&&(t.resumeToken=e)}var js,Ls,Us=((js={})[Yo.ASCENDING.name]="ASCENDING",js[Yo.DESCENDING.name]="DESCENDING",js),Bs=((Ls={})[zo.LESS_THAN.name]="LESS_THAN",Ls[zo.LESS_THAN_OR_EQUAL.name]="LESS_THAN_OR_EQUAL",Ls[zo.GREATER_THAN.name]="GREATER_THAN",Ls[zo.GREATER_THAN_OR_EQUAL.name]="GREATER_THAN_OR_EQUAL",Ls[zo.EQUAL.name]="EQUAL",Ls);function qs(t,e){ki(!qo(t),e+" is missing")}function Hs(t){return"number"==typeof t?t:"string"==typeof t?Number(t):Ii("can't parse "+t)}var Ks=function(){function t(t,e){this.databaseId=t,this.options=e}return t.prototype.emptyByteString=function(){return this.options.useProto3Json?"":new Uint8Array(0)},t.prototype.unsafeCastProtoByteString=function(t){return t},t.prototype.fromRpcStatus=function(t){var e=void 0===t.code?Oi.UNKNOWN:gs(t.code);return new Pi(e,t.message||"")},t.prototype.toInt32Value=function(t){return qo(t)?void 0:{value:t}},t.prototype.fromInt32Value=function(t){var e;return qo(e="object"==typeof t?t.value:t)?null:e},t.prototype.toTimestamp=function(t){return{seconds:t.seconds,nanos:t.nanos}},t.prototype.fromTimestamp=function(t){if("string"==typeof t)return es.fromISOString(t);ki(!!t,"Cannot deserialize null or undefined timestamp.");var e=Hs(t.seconds||"0");return new es(e,t.nanos||0)},t.prototype.toBytes=function(t){return this.options.useProto3Json?t.toBase64():this.unsafeCastProtoByteString(t.toUint8Array())},t.prototype.fromBlob=function(t){return"string"==typeof t?(ki(this.options.useProto3Json,"Expected bytes to be passed in as Uint8Array, but got a string instead."),io.fromBase64String(t)):(ki(!this.options.useProto3Json,"Expected bytes to be passed in as string, but got something else instead."),io.fromUint8Array(t))},t.prototype.toVersion=function(t){return this.toTimestamp(t.toTimestamp())},t.prototype.fromVersion=function(t){return ki(!!t,"Trying to deserialize version that isn't set"),ns.fromTimestamp(this.fromTimestamp(t))},t.prototype.toResourceName=function(t,e){return this.fullyQualifiedPrefixPath(t).child("documents").child(e).canonicalString()},t.prototype.fromResourceName=function(t){var e=co.fromString(t);return ki(this.isValidResourceName(e),"Tried to deserialize invalid key "+e.toString()),e},t.prototype.toName=function(t){return this.toResourceName(this.databaseId,t.path)},t.prototype.fromName=function(t){var e=this.fromResourceName(t);return ki(e.get(1)===this.databaseId.projectId,"Tried to deserialize key from different project: "+e.get(1)+" vs "+this.databaseId.projectId),ki(!e.get(3)&&!this.databaseId.database||e.get(3)===this.databaseId.database,"Tried to deserialize key from different database: "+e.get(3)+" vs "+this.databaseId.database),new po(this.extractLocalPathFromResourceName(e))},t.prototype.toQueryPath=function(t){return 0===t.length?this.encodedDatabaseId:this.toResourceName(this.databaseId,t)},t.prototype.fromQueryPath=function(t){var e=this.fromResourceName(t);return 4===e.length?co.EMPTY_PATH:this.extractLocalPathFromResourceName(e)},Object.defineProperty(t.prototype,"encodedDatabaseId",{get:function(){return new co(["projects",this.databaseId.projectId,"databases",this.databaseId.database]).canonicalString()},enumerable:!0,configurable:!0}),t.prototype.fullyQualifiedPrefixPath=function(t){return new co(["projects",t.projectId,"databases",t.database])},t.prototype.extractLocalPathFromResourceName=function(t){return ki(t.length>4&&"documents"===t.get(4),"tried to deserialize invalid key "+t.toString()),t.popFirst(5)},t.prototype.isValidResourceName=function(t){return t.length>=4&&"projects"===t.get(0)&&"databases"===t.get(2)},t.prototype.toValue=function(t){if(t instanceof Co)return{nullValue:"NULL_VALUE"};if(t instanceof To)return{booleanValue:t.value()};if(t instanceof xo)return{integerValue:""+t.value()};if(t instanceof Ao){var e=t.value();if(this.options.useProto3Json){if(isNaN(e))return{doubleValue:"NaN"};if(e===1/0)return{doubleValue:"Infinity"};if(e===-1/0)return{doubleValue:"-Infinity"}}return{doubleValue:t.value()}}return t instanceof Oo?{stringValue:t.value()}:t instanceof Vo?{mapValue:this.toMapValue(t)}:t instanceof Fo?{arrayValue:this.toArrayValue(t)}:t instanceof Po?{timestampValue:this.toTimestamp(t.internalValue)}:t instanceof Mo?{geoPointValue:{latitude:t.value().latitude,longitude:t.value().longitude}}:t instanceof Ro?{bytesValue:this.toBytes(t.value())}:t instanceof Do?{referenceValue:this.toResourceName(t.databaseId,t.key.path)}:Ii("Unknown FieldValue "+JSON.stringify(t))},t.prototype.fromValue=function(t){var e=this,n=t.value_type;if(zs(t,n,"nullValue"))return Co.INSTANCE;if(zs(t,n,"booleanValue"))return To.of(t.booleanValue);if(zs(t,n,"integerValue"))return new xo(Hs(t.integerValue));if(zs(t,n,"doubleValue")){if(this.options.useProto3Json){if("NaN"===t.doubleValue)return Ao.NAN;if("Infinity"===t.doubleValue)return Ao.POSITIVE_INFINITY;if("-Infinity"===t.doubleValue)return Ao.NEGATIVE_INFINITY}return new Ao(t.doubleValue)}if(zs(t,n,"stringValue"))return new Oo(t.stringValue);if(zs(t,n,"mapValue"))return this.fromFields(t.mapValue.fields||{});if(zs(t,n,"arrayValue"))return qs(t.arrayValue,"arrayValue"),new Fo((t.arrayValue.values||[]).map(function(t){return e.fromValue(t)}));if(zs(t,n,"timestampValue"))return qs(t.timestampValue,"timestampValue"),new Po(this.fromTimestamp(t.timestampValue));if(zs(t,n,"geoPointValue"))return qs(t.geoPointValue,"geoPointValue"),new Mo(new so(t.geoPointValue.latitude||0,t.geoPointValue.longitude||0));if(zs(t,n,"bytesValue")){qs(t.bytesValue,"bytesValue");var r=this.fromBlob(t.bytesValue);return new Ro(r)}if(zs(t,n,"referenceValue")){qs(t.referenceValue,"referenceValue");var i=this.fromResourceName(t.referenceValue),o=new uo(i.get(1),i.get(3)),s=new po(this.extractLocalPathFromResourceName(i));return new Do(o,s)}return Ii("Unknown Value proto "+JSON.stringify(t))},t.prototype.toMutationDocument=function(t,e){return{name:this.toName(t),fields:this.toFields(e)}},t.prototype.toDocument=function(t){return ki(!t.hasLocalMutations,"Can't serialize documents with mutations."),{name:this.toName(t.key),fields:this.toFields(t.data),updateTime:this.toTimestamp(t.version.toTimestamp())}},t.prototype.fromDocument=function(t){return new yo(this.fromName(t.name),this.fromVersion(t.updateTime),this.fromFields(t.fields||{}),{hasLocalMutations:!1})},t.prototype.toFields=function(t){var e=this,n={};return t.forEach(function(t,r){n[t]=e.toValue(r)}),n},t.prototype.fromFields=function(t){var e=this,n=Vo.EMPTY;return Mi(t,function(t,r){n=n.set(new fo([t]),e.fromValue(r))}),n},t.prototype.toMapValue=function(t){return{fields:this.toFields(t)}},t.prototype.toArrayValue=function(t){var e=this,n=[];return t.forEach(function(t){n.push(e.toValue(t))}),{values:n}},t.prototype.fromFound=function(t){ki(!!t.found,"Tried to deserialize a found document from a missing document."),qs(t.found.name,"doc.found.name"),qs(t.found.updateTime,"doc.found.updateTime");var e=this.fromName(t.found.name),n=this.fromVersion(t.found.updateTime),r=this.fromFields(t.found.fields||{});return new yo(e,n,r,{hasLocalMutations:!1})},t.prototype.fromMissing=function(t){ki(!!t.missing,"Tried to deserialize a missing document from a found document."),ki(!!t.readTime,"Tried to deserialize a missing document without a read time.");var e=this.fromName(t.missing),n=this.fromVersion(t.readTime);return new mo(e,n)},t.prototype.fromMaybeDocument=function(t){var e=t.result;return zs(t,e,"found")?this.fromFound(t):zs(t,e,"missing")?this.fromMissing(t):Ii("invalid batch get response: "+JSON.stringify(t))},t.prototype.toWatchTargetChangeState=function(t){switch(t){case Ds.Added:return"ADD";case Ds.Current:return"CURRENT";case Ds.NoChange:return"NO_CHANGE";case Ds.Removed:return"REMOVE";case Ds.Reset:return"RESET";default:return Ii("Unknown WatchTargetChangeState: "+t)}},t.prototype.toTestWatchChange=function(t){if(t instanceof Rs)return{filter:{count:t.existenceFilter.count,targetId:t.targetId}};if(t instanceof Ns){var e;if(t.newDoc instanceof yo)return{documentChange:{document:{name:this.toName((e=t.newDoc).key),fields:this.toFields(e.data),updateTime:this.toVersion(e.version)},targetIds:t.updatedTargetIds,removedTargetIds:t.removedTargetIds}};if(t.newDoc instanceof mo)return{documentDelete:{document:this.toName((e=t.newDoc).key),readTime:this.toVersion(e.version),removedTargetIds:t.removedTargetIds}};if(null===t.newDoc)return{documentRemove:{document:this.toName(t.key),removedTargetIds:t.removedTargetIds}}}if(t instanceof Ms){var n=void 0;return t.cause&&(n={code:function(t){if(void 0===t)return rs.OK;switch(t){case Oi.OK:return rs.OK;case Oi.CANCELLED:return rs.CANCELLED;case Oi.UNKNOWN:return rs.UNKNOWN;case Oi.DEADLINE_EXCEEDED:return rs.DEADLINE_EXCEEDED;case Oi.RESOURCE_EXHAUSTED:return rs.RESOURCE_EXHAUSTED;case Oi.INTERNAL:return rs.INTERNAL;case Oi.UNAVAILABLE:return rs.UNAVAILABLE;case Oi.UNAUTHENTICATED:return rs.UNAUTHENTICATED;case Oi.INVALID_ARGUMENT:return rs.INVALID_ARGUMENT;case Oi.NOT_FOUND:return rs.NOT_FOUND;case Oi.ALREADY_EXISTS:return rs.ALREADY_EXISTS;case Oi.PERMISSION_DENIED:return rs.PERMISSION_DENIED;case Oi.FAILED_PRECONDITION:return rs.FAILED_PRECONDITION;case Oi.ABORTED:return rs.ABORTED;case Oi.OUT_OF_RANGE:return rs.OUT_OF_RANGE;case Oi.UNIMPLEMENTED:return rs.UNIMPLEMENTED;case Oi.DATA_LOSS:return rs.DATA_LOSS;default:return Ii("Unknown status code: "+t)}}(t.cause.code),message:t.cause.message}),{targetChange:{targetChangeType:this.toWatchTargetChangeState(t.state),targetIds:t.targetIds,resumeToken:this.unsafeCastProtoByteString(t.resumeToken),cause:n}}}return Ii("Unrecognized watch change: "+JSON.stringify(t))},t.prototype.fromWatchChange=function(t){var e,n=t.response_type;if(zs(t,n,"targetChange")){qs(t.targetChange,"targetChange");var r=this.fromWatchTargetChangeState(t.targetChange.targetChangeType||"NO_CHANGE"),i=t.targetChange.targetIds||[],o=t.targetChange.resumeToken||this.emptyByteString(),s=t.targetChange.cause,a=s&&this.fromRpcStatus(s);e=new Ms(r,i,o,a||null)}else if(zs(t,n,"documentChange")){qs(t.documentChange,"documentChange"),qs(t.documentChange.document,"documentChange.name"),qs(t.documentChange.document.name,"documentChange.document.name"),qs(t.documentChange.document.updateTime,"documentChange.document.updateTime");var u=t.documentChange,l=this.fromName(u.document.name),c=this.fromVersion(u.document.updateTime),h=this.fromFields(u.document.fields||{}),f=new yo(l,c,h,{hasLocalMutations:!1});e=new Ns(u.targetIds||[],u.removedTargetIds||[],f.key,f)}else if(zs(t,n,"documentDelete")){qs(t.documentDelete,"documentDelete"),qs(t.documentDelete.document,"documentDelete.document");var p=t.documentDelete;l=this.fromName(p.document),c=p.readTime?this.fromVersion(p.readTime):ns.forDeletedDoc(),f=new mo(l,c),e=new Ns([],p.removedTargetIds||[],f.key,f)}else if(zs(t,n,"documentRemove")){qs(t.documentRemove,"documentRemove"),qs(t.documentRemove.document,"documentRemove");var d=t.documentRemove;l=this.fromName(d.document),e=new Ns([],d.removedTargetIds||[],l,null)}else{if(!zs(t,n,"filter"))return Ii("Unknown change type "+JSON.stringify(t));qs(t.filter,"filter"),qs(t.filter.targetId,"filter.targetId");var y=t.filter,m=new ys(y.count||0);e=new Rs(y.targetId,m)}return e},t.prototype.fromWatchTargetChangeState=function(t){return"NO_CHANGE"===t?Ds.NoChange:"ADD"===t?Ds.Added:"REMOVE"===t?Ds.Removed:"CURRENT"===t?Ds.Current:"RESET"===t?Ds.Reset:Ii("Got unexpected TargetChange.state: "+t)},t.prototype.versionFromListenResponse=function(t){if(!zs(t,t.response_type,"targetChange"))return ns.MIN;var e=t.targetChange;return e.targetIds&&e.targetIds.length?ns.MIN:e.readTime?this.fromVersion(e.readTime):ns.MIN},t.prototype.toMutation=function(t){var e,n=this;if(t instanceof hs)e={update:this.toMutationDocument(t.key,t.value)};else if(t instanceof ds)e={delete:this.toName(t.key)};else if(t instanceof fs)e={update:this.toMutationDocument(t.key,t.data),updateMask:this.toDocumentMask(t.fieldMask)};else{if(!(t instanceof ps))return Ii("Unknown mutation type "+t.type);e={transform:{document:this.toName(t.key),fieldTransforms:t.fieldTransforms.map(function(t){return n.toFieldTransform(t)})}}}return t.precondition.isNone||(e.currentDocument=this.toPrecondition(t.precondition)),e},t.prototype.fromMutation=function(t){var e=this,n=t.currentDocument?this.fromPrecondition(t.currentDocument):ls.NONE;if(t.update){qs(t.update.name,"name");var r=this.fromName(t.update.name),i=this.fromFields(t.update.fields||{});if(t.updateMask){var o=this.fromDocumentMask(t.updateMask);return new fs(r,i,o,n)}return new hs(r,i,n)}if(t.delete)return r=this.fromName(t.delete),new ds(r,n);if(t.transform){r=this.fromName(t.transform.document);var s=t.transform.fieldTransforms.map(function(t){return e.fromFieldTransform(t)});return ki(!0===n.exists,'Transforms only support precondition "exists == true"'),new ps(r,s)}return Ii("unknown mutation proto: "+JSON.stringify(t))},t.prototype.toPrecondition=function(t){return ki(!t.isNone,"Can't serialize an empty precondition"),void 0!==t.updateTime?{updateTime:this.toVersion(t.updateTime)}:void 0!==t.exists?{exists:t.exists}:Ii("Unknown precondition")},t.prototype.fromPrecondition=function(t){return void 0!==t.updateTime?ls.updateTime(this.fromVersion(t.updateTime)):void 0!==t.exists?ls.exists(t.exists):ls.NONE},t.prototype.fromWriteResult=function(t){var e=this,n=t.updateTime?this.fromVersion(t.updateTime):null,r=null;return t.transformResults&&t.transformResults.length>0&&(r=t.transformResults.map(function(t){return e.fromValue(t)})),new function(t,e){this.version=t,this.transformResults=e}(n,r)},t.prototype.fromWriteResults=function(t){var e=this;return(t||[]).map(function(t){return e.fromWriteResult(t)})},t.prototype.toFieldTransform=function(t){return ki(t.transform instanceof ss,"Unknown transform: "+t.transform),{fieldPath:t.field.canonicalString(),setToServerValue:"REQUEST_TIME"}},t.prototype.fromFieldTransform=function(t){ki("REQUEST_TIME"===t.setToServerValue,"Unknown transform proto: "+JSON.stringify(t));var e=fo.fromServerFormat(t.fieldPath);return new as(e,ss.instance)},t.prototype.toDocumentsTarget=function(t){return{documents:[this.toQueryPath(t.path)]}},t.prototype.fromDocumentsTarget=function(t){var e=t.documents.length;return ki(1===e,"DocumentsTarget contained other than 1 document: "+e),Ko.atPath(this.fromQueryPath(t.documents[0]))},t.prototype.toQueryTarget=function(t){var e={structuredQuery:{}};if(t.path.isEmpty())e.parent=this.toQueryPath(co.EMPTY_PATH);else{var n=t.path;ki(n.length%2!=0,"Document queries with filters are not supported."),e.parent=this.toQueryPath(n.popLast()),e.structuredQuery.from=[{collectionId:n.lastSegment()}]}var r=this.toFilter(t.filters);r&&(e.structuredQuery.where=r);var i=this.toOrder(t.orderBy);i&&(e.structuredQuery.orderBy=i);var o=this.toInt32Value(t.limit);return void 0!==o&&(e.structuredQuery.limit=o),t.startAt&&(e.structuredQuery.startAt=this.toCursor(t.startAt)),t.endAt&&(e.structuredQuery.endAt=this.toCursor(t.endAt)),e},t.prototype.fromQueryTarget=function(t){var e=this.fromQueryPath(t.parent),n=t.structuredQuery,r=n.from?n.from.length:0;r>0&&(ki(1===r,"StructuredQuery.from with more than one collection is not supported."),e=e.child(n.from[0].collectionId));var i=[];n.where&&(i=this.fromFilter(n.where));var o=[];n.orderBy&&(o=this.fromOrder(n.orderBy));var s=null;n.limit&&(s=this.fromInt32Value(n.limit));var a=null;n.startAt&&(a=this.fromCursor(n.startAt));var u=null;return n.endAt&&(u=this.fromCursor(n.endAt)),new Ko(e,o,i,s,a,u)},t.prototype.toListenRequestLabels=function(t){var e=this.toLabel(t.purpose);return null==e?null:{"goog-listen-tags":e}},t.prototype.toLabel=function(t){switch(t){case Ho.Listen:return null;case Ho.ExistenceFilterMismatch:return"existence-filter-mismatch";case Ho.LimboResolution:return"limbo-document";default:return Ii("Unrecognized query purpose: "+t)}},t.prototype.toTarget=function(t){var e,n=t.query;return(e=n.isDocumentQuery()?{documents:this.toDocumentsTarget(n)}:{query:this.toQueryTarget(n)}).targetId=t.targetId,t.resumeToken.length>0&&(e.resumeToken=this.unsafeCastProtoByteString(t.resumeToken)),e},t.prototype.toFilter=function(t){var e=this;if(0!==t.length){var n=t.map(function(t){return t instanceof Qo?e.toRelationFilter(t):e.toUnaryFilter(t)});return 1===n.length?n[0]:{compositeFilter:{op:"AND",filters:n}}}},t.prototype.fromFilter=function(t){var e=this;return t?void 0!==t.unaryFilter?[this.fromUnaryFilter(t)]:void 0!==t.fieldFilter?[this.fromRelationFilter(t)]:void 0!==t.compositeFilter?t.compositeFilter.filters.map(function(t){return e.fromFilter(t)}).reduce(function(t,e){return t.concat(e)}):Ii("Unknown filter: "+JSON.stringify(t)):[]},t.prototype.toOrder=function(t){var e=this;if(0!==t.length)return t.map(function(t){return e.toPropertyOrder(t)})},t.prototype.fromOrder=function(t){var e=this;return t.map(function(t){return e.fromPropertyOrder(t)})},t.prototype.toCursor=function(t){var e=this;return{before:t.before,values:t.position.map(function(t){return e.toValue(t)})}},t.prototype.fromCursor=function(t){var e=this,n=!!t.before,r=t.values.map(function(t){return e.fromValue(t)});return new Jo(r,n)},t.prototype.toDirection=function(t){return Us[t.name]},t.prototype.fromDirection=function(t){switch(t){case"ASCENDING":return Yo.ASCENDING;case"DESCENDING":return Yo.DESCENDING;default:return}},t.prototype.toOperatorName=function(t){return Bs[t.name]},t.prototype.fromOperatorName=function(t){switch(t){case"EQUAL":return zo.EQUAL;case"GREATER_THAN":return zo.GREATER_THAN;case"GREATER_THAN_OR_EQUAL":return zo.GREATER_THAN_OR_EQUAL;case"LESS_THAN":return zo.LESS_THAN;case"LESS_THAN_OR_EQUAL":return zo.LESS_THAN_OR_EQUAL;case"OPERATOR_UNSPECIFIED":return Ii("Unspecified relation");default:return Ii("Unknown relation")}},t.prototype.toFieldPathReference=function(t){return{fieldPath:t.canonicalString()}},t.prototype.fromFieldPathReference=function(t){return fo.fromServerFormat(t.fieldPath)},t.prototype.toPropertyOrder=function(t){return{field:this.toFieldPathReference(t.field),direction:this.toDirection(t.dir)}},t.prototype.fromPropertyOrder=function(t){return new Xo(this.fromFieldPathReference(t.field),this.fromDirection(t.direction))},t.prototype.toRelationFilter=function(t){return t instanceof Qo?{fieldFilter:{field:this.toFieldPathReference(t.field),op:this.toOperatorName(t.op),value:this.toValue(t.value)}}:Ii("Unrecognized filter: "+JSON.stringify(t))},t.prototype.fromRelationFilter=function(t){return new Qo(this.fromFieldPathReference(t.fieldFilter.field),this.fromOperatorName(t.fieldFilter.op),this.fromValue(t.fieldFilter.value))},t.prototype.toUnaryFilter=function(t){return t instanceof Wo?{unaryFilter:{field:this.toFieldPathReference(t.field),op:"IS_NAN"}}:t instanceof Go?{unaryFilter:{field:this.toFieldPathReference(t.field),op:"IS_NULL"}}:Ii("Unrecognized filter: "+JSON.stringify(t))},t.prototype.fromUnaryFilter=function(t){switch(t.unaryFilter.op){case"IS_NAN":var e=this.fromFieldPathReference(t.unaryFilter.field);return new Wo(e);case"IS_NULL":var n=this.fromFieldPathReference(t.unaryFilter.field);return new Go(n);case"OPERATOR_UNSPECIFIED":return Ii("Unspecified filter");default:return Ii("Unknown filter")}},t.prototype.toDocumentMask=function(t){return{fieldPaths:t.fields.map(function(t){return t.canonicalString()})}},t.prototype.fromDocumentMask=function(t){var e=(t.fieldPaths||[]).map(function(t){return fo.fromServerFormat(t)});return new os(e)},t}();function zs(t,e,n){return e===n||!e&&n in t}var Qs=n("P9wo"),Gs=function(){function t(t){this.sendFn=t.sendFn,this.closeFn=t.closeFn}return t.prototype.onOpen=function(t){ki(!this.wrappedOnOpen,"Called onOpen on stream twice!"),this.wrappedOnOpen=t},t.prototype.onClose=function(t){ki(!this.wrappedOnClose,"Called onClose on stream twice!"),this.wrappedOnClose=t},t.prototype.onMessage=function(t){ki(!this.wrappedOnMessage,"Called onMessage on stream twice!"),this.wrappedOnMessage=t},t.prototype.close=function(){this.closeFn()},t.prototype.send=function(t){this.sendFn(t)},t.prototype.callOnOpen=function(){ki(void 0!==this.wrappedOnOpen,"Cannot call onOpen because no callback was set"),this.wrappedOnOpen()},t.prototype.callOnClose=function(t){ki(void 0!==this.wrappedOnClose,"Cannot call onClose because no callback was set"),this.wrappedOnClose(t)},t.prototype.callOnMessage=function(t){ki(void 0!==this.wrappedOnMessage,"Cannot call onMessage because no callback was set"),this.wrappedOnMessage(t)},t}(),Ws="Connection",Ys={BatchGetDocuments:"batchGet",Commit:"commit"},Js="gl-js/ fire/"+vi,Xs=function(){function t(t){this.databaseId=t.databaseId,this.pool=new Qs.XhrIoPool,this.baseUrl=(t.ssl?"https":"http")+"://"+t.host}return t.prototype.modifyHeadersForRequest=function(t,e){if(e)for(var n in e.authHeaders)e.authHeaders.hasOwnProperty(n)&&(t[n]=e.authHeaders[n]);t["X-Goog-Api-Client"]=Js,t["google-cloud-resource-prefix"]="projects/"+this.databaseId.projectId+"/databases/"+this.databaseId.database},t.prototype.invokeRPC=function(t,e,n){var r=this,i=this.makeUrl(t);return new Promise(function(o,s){r.pool.getObject(function(a){a.listenOnce(Qs.EventType.COMPLETE,function(){try{switch(a.getLastErrorCode()){case Qs.ErrorCode.NO_ERROR:var e=a.getResponseJson();Si(Ws,"XHR received:",JSON.stringify(e)),o(e);break;case Qs.ErrorCode.TIMEOUT:Si(Ws,'RPC "'+t+'" timed out'),s(new Pi(Oi.DEADLINE_EXCEEDED,"Request time out"));break;case Qs.ErrorCode.HTTP_ERROR:var n=a.getStatus();Si(Ws,'RPC "'+t+'" failed with status:',n,"response text:",a.getResponseText()),n>0?s(new Pi(function(t){switch(t){case 200:return Oi.OK;case 400:return Oi.INVALID_ARGUMENT;case 401:return Oi.UNAUTHENTICATED;case 403:return Oi.PERMISSION_DENIED;case 404:return Oi.NOT_FOUND;case 409:return Oi.ABORTED;case 416:return Oi.OUT_OF_RANGE;case 429:return Oi.RESOURCE_EXHAUSTED;case 499:return Oi.CANCELLED;case 500:return Oi.UNKNOWN;case 501:return Oi.UNIMPLEMENTED;case 503:return Oi.UNAVAILABLE;case 504:return Oi.DEADLINE_EXCEEDED;default:return t>=200&&t<300?Oi.OK:t>=400&&t<500?Oi.FAILED_PRECONDITION:t>=500&&t<600?Oi.INTERNAL:Oi.UNKNOWN}}(n),"Server responded with status "+a.getStatusText())):(Si(Ws,'RPC "'+t+'" failed'),s(new Pi(Oi.UNAVAILABLE,"Connection failed.")));break;default:Ii('RPC "'+t+'" failed with unanticipated webchannel error '+a.getLastErrorCode()+": "+a.getLastError()+", giving up.")}}finally{Si(Ws,'RPC "'+t+'" completed.'),r.pool.releaseObject(a)}});var u=JSON.stringify(e);Si(Ws,"XHR sending: ",i+" "+u);var l={"Content-Type":"text/plain"};r.modifyHeadersForRequest(l,n),a.send(i,"POST",u,l,15)})})},t.prototype.invokeStreamingRPC=function(t,e,n){return this.invokeRPC(t,e,n)},t.prototype.openStream=function(t,e){var n=[this.baseUrl,"/","google.firestore.v1beta1.Firestore","/",t,"/channel"],r=Object(Qs.createWebChannelTransport)(),i={backgroundChannelTest:!0,httpSessionIdParam:"gsessionid",initMessageHeaders:{},httpHeadersOverwriteParam:"$httpHeaders",sendRawJson:!0,supportsCrossDomainXhr:!0};this.modifyHeadersForRequest(i.initMessageHeaders,e);var o=n.join("");Si(Ws,"Creating WebChannel: "+o+" "+i);var s=r.createWebChannel(o,i),a=!1,u=!1,l=new Gs({sendFn:function(t){u?Si(Ws,"Not sending because WebChannel is closed:",t):(a||(Si(Ws,"Opening WebChannel transport."),s.open(),a=!0),Si(Ws,"WebChannel sending:",t),s.send(t))},closeFn:function(){return s.close()}}),c=function(t,e){s.listen(t,function(t){try{e(t)}catch(t){setTimeout(function(){throw t},0)}})};return c(Qs.WebChannel.EventType.OPEN,function(){u||Si(Ws,"WebChannel transport opened.")}),c(Qs.WebChannel.EventType.CLOSE,function(){u||(u=!0,Si(Ws,"WebChannel transport closed"),l.callOnClose())}),c(Qs.WebChannel.EventType.ERROR,function(t){u||(u=!0,Si(Ws,"WebChannel transport errored:",t),l.callOnClose(new Pi(Oi.UNAVAILABLE,"The operation could not be completed")))}),c(Qs.WebChannel.EventType.MESSAGE,function(t){if(!u){var e=t.data[0];ki(!!e,"Got a webchannel message without data.");var n=e.error||e[0]&&e[0].error;if(n){Si(Ws,"WebChannel received error:",n);var r=n.status,i=function(t){var e=rs[r];if(void 0!==e)return gs(e)}(),o=n.message;void 0===i&&(i=Oi.INTERNAL,o="Unknown error status: "+r+" with message "+n.message),u=!0,l.callOnClose(new Pi(i,o)),s.close()}else Si(Ws,"WebChannel received:",e),l.callOnMessage(e)}}),setTimeout(function(){l.callOnOpen()},0),l},t.prototype.makeUrl=function(t){var e=Ys[t];ki(void 0!==e,"Unknown REST mapping for: "+t);var n=[this.baseUrl,"/","v1beta1"];return n.push("/projects/"),n.push(this.databaseId.projectId),n.push("/databases/"),n.push(this.databaseId.database),n.push("/documents"),n.push(":"),n.push(e),n.join("")},t}();xi.setPlatform(new(function(){function t(){this.emptyByteString="",this.base64Available="undefined"!=typeof atob}return t.prototype.loadConnection=function(t){return Promise.resolve(new Xs(t))},t.prototype.newSerializer=function(t){return new Ks(t,{useProto3Json:!0})},t.prototype.formatJSON=function(t){return JSON.stringify(t)},t.prototype.atob=function(t){return atob(t)},t.prototype.btoa=function(t){return btoa(t)},t}()));var Zs,$s=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];!function(e,n,r,i){if(!(t instanceof Array)||t.length<1)throw new Pi(Oi.INVALID_ARGUMENT,"Function FieldPath() requires its fieldNames argument to be an array with at least "+Zi(1,"element")+".")}();for(var n=0;n<t.length;++n)if(Bi("FieldPath","string",n,t[n]),0===t[n].length)throw new Pi(Oi.INVALID_ARGUMENT,"Invalid field name at argument $(i + 1). Field names must not be empty.");this._internalPath=new fo(t)}return t.documentId=function(){return t._DOCUMENT_ID},t.prototype.isEqual=function(e){if(!(e instanceof t))throw Ji("isEqual","FieldPath",1,e);return this._internalPath.isEqual(e._internalPath)},t._DOCUMENT_ID=new t(fo.keyField().canonicalString()),t}(),ta=new RegExp("[~\\*/\\[\\]]");!function(t){t[t.Unknown=0]="Unknown",t[t.Healthy=1]="Healthy",t[t.Failed=2]="Failed"}(Zs||(Zs={}));var ea=function(t){return t[t.Added=0]="Added",t[t.Removed=1]="Removed",t[t.Modified=2]="Modified",t[t.Metadata=3]="Metadata",t}({}),na=function(t){return t[t.Local=0]="Local",t[t.Synced=1]="Synced",t}({}),ra=function(){function t(){this.changeMap=new go(po.comparator)}return t.prototype.track=function(t){var e=t.doc.key,n=this.changeMap.get(e);n?t.type!==ea.Added&&n.type===ea.Metadata?this.changeMap=this.changeMap.insert(e,t):t.type===ea.Metadata&&n.type!==ea.Removed?this.changeMap=this.changeMap.insert(e,{type:n.type,doc:t.doc}):t.type===ea.Modified&&n.type===ea.Modified?this.changeMap=this.changeMap.insert(e,{type:ea.Modified,doc:t.doc}):t.type===ea.Modified&&n.type===ea.Added?this.changeMap=this.changeMap.insert(e,{type:ea.Added,doc:t.doc}):t.type===ea.Removed&&n.type===ea.Added?this.changeMap=this.changeMap.remove(e):t.type===ea.Removed&&n.type===ea.Modified?this.changeMap=this.changeMap.insert(e,{type:ea.Removed,doc:n.doc}):t.type===ea.Added&&n.type===ea.Removed?this.changeMap=this.changeMap.insert(e,{type:ea.Modified,doc:t.doc}):Ii("unsupported combination of changes: "+JSON.stringify(t)+" after "+JSON.stringify(n)):this.changeMap=this.changeMap.insert(e,t)},t.prototype.getChanges=function(){var t=[];return this.changeMap.inorderTraversal(function(e,n){t.push(n)}),t},t}(),ia=function(){function t(t,e,n,r,i,o,s){this.query=t,this.docs=e,this.oldDocs=n,this.docChanges=r,this.fromCache=i,this.hasPendingWrites=o,this.syncStateChanged=s}return t.prototype.isEqual=function(t){if(this.fromCache!==t.fromCache||this.hasPendingWrites!==t.hasPendingWrites||this.syncStateChanged!==t.syncStateChanged||!this.query.isEqual(t.query)||!this.docs.isEqual(t.docs)||!this.oldDocs.isEqual(t.oldDocs))return!1;var e=this.docChanges,n=t.docChanges;if(e.length!==n.length)return!1;for(var r=0;r<e.length;r++)if(e[r].type!==n[r].type||!e[r].doc.isEqual(n[r].doc))return!1;return!0},t}(),oa=function(){function t(t){this.comparator=t?function(e,n){return t(e,n)||po.comparator(e.key,n.key)}:function(t,e){return po.comparator(t.key,e.key)},this.keyedMap=Es(),this.sortedSet=new go(this.comparator)}return t.emptySet=function(e){return new t(e.comparator)},t.prototype.has=function(t){return null!=this.keyedMap.get(t)},t.prototype.get=function(t){return this.keyedMap.get(t)},t.prototype.first=function(){return this.sortedSet.minKey()},t.prototype.last=function(){return this.sortedSet.maxKey()},t.prototype.isEmpty=function(){return this.sortedSet.isEmpty()},t.prototype.prevDoc=function(t){ki(this.has(t),"Trying to get a previous document to non-existing key: "+t);var e=this.keyedMap.get(t);return this.sortedSet.getPredecessorKey(e)},t.prototype.indexOf=function(t){var e=this.keyedMap.get(t);return e?this.sortedSet.indexOf(e):-1},Object.defineProperty(t.prototype,"size",{get:function(){return this.sortedSet.size},enumerable:!0,configurable:!0}),t.prototype.forEach=function(t){this.sortedSet.inorderTraversal(function(e,n){return t(e),!1})},t.prototype.add=function(t){var e=this.delete(t.key);return e.copy(e.keyedMap.insert(t.key,t),e.sortedSet.insert(t,null))},t.prototype.delete=function(t){var e=this.get(t);return e?this.copy(this.keyedMap.remove(t),this.sortedSet.remove(e)):this},t.prototype.isEqual=function(e){if(!(e instanceof t))return!1;if(this.size!==e.size)return!1;for(var n=this.sortedSet.getIterator(),r=e.sortedSet.getIterator();n.hasNext();){var i=n.getNext().key,o=r.getNext().key;if(!i.isEqual(o))return!1}return!0},t.prototype.toString=function(){var t=[];return this.forEach(function(e){t.push(e.toString())}),0===t.length?"DocumentSet ()":"DocumentSet (\n  "+t.join("  \n")+"\n)"},t.prototype.copy=function(e,n){var r=new t;return r.comparator=this.comparator,r.keyedMap=e,r.sortedSet=n,r},t}(),sa=function(){function t(t){this.mapKeyFn=t,this.inner={}}return t.prototype.get=function(t){var e=this.mapKeyFn(t),n=this.inner[e];if(void 0!==n)for(var r=0,i=n;r<i.length;r++){var o=i[r],s=o[1];if(o[0].isEqual(t))return s}},t.prototype.has=function(t){return void 0!==this.get(t)},t.prototype.set=function(t,e){var n=this.mapKeyFn(t),r=this.inner[n];if(void 0!==r){for(var i=0;i<r.length;i++)if(r[i][0].isEqual(t))return void(r[i]=[t,e]);r.push([t,e])}else this.inner[n]=[[t,e]]},t.prototype.delete=function(t){var e=this.mapKeyFn(t),n=this.inner[e];if(void 0===n)return!1;for(var r=0;r<n.length;r++)if(n[r][0].isEqual(t))return 1===n.length?delete this.inner[e]:n.splice(r,1),!0;return!1},t.prototype.forEach=function(t){Mi(this.inner,function(e,n){for(var r=0,i=n;r<i.length;r++){var o=i[r];t(o[0],o[1])}})},t.prototype.isEmpty=function(){return Vi(this.inner)},t}(),aa=function(){function t(t){this.syncEngine=t,this.queries=new sa(function(t){return t.canonicalId()}),this.onlineState=Zs.Unknown,this.syncEngine.subscribe(this.onChange.bind(this),this.onError.bind(this))}return t.prototype.listen=function(t){var e=t.query,n=!1,r=this.queries.get(e);return r||(n=!0,r=new function(){this.listeners=[]},this.queries.set(e,r)),r.listeners.push(t),t.applyOnlineStateChange(this.onlineState),r.viewSnap&&t.onViewSnapshot(r.viewSnap),n?this.syncEngine.listen(e).then(function(t){return r.targetId=t,t}):Promise.resolve(r.targetId)},t.prototype.unlisten=function(t){var e=t.query,n=!1,r=this.queries.get(e);if(r){var i=r.listeners.indexOf(t);i>=0&&(r.listeners.splice(i,1),n=0===r.listeners.length)}return n?(this.queries.delete(e),this.syncEngine.unlisten(e)):Promise.resolve()},t.prototype.onChange=function(t){for(var e=0,n=t;e<n.length;e++){var r=n[e],i=this.queries.get(r.query);if(i){for(var o=0,s=i.listeners;o<s.length;o++)s[o].onViewSnapshot(r);i.viewSnap=r}}},t.prototype.onError=function(t,e){var n=this.queries.get(t);if(n)for(var r=0,i=n.listeners;r<i.length;r++)i[r].onError(e);this.queries.delete(t)},t.prototype.applyOnlineStateChange=function(t){this.onlineState=t,this.queries.forEach(function(e,n){for(var r=0,i=n.listeners;r<i.length;r++)i[r].applyOnlineStateChange(t)})},t}(),ua=function(){function t(t,e,n){this.query=t,this.queryObserver=e,this.raisedInitialEvent=!1,this.onlineState=Zs.Unknown,this.options=n||{}}return t.prototype.onViewSnapshot=function(t){if(ki(t.docChanges.length>0||t.syncStateChanged,"We got a new snapshot with no changes?"),!this.options.includeDocumentMetadataChanges){for(var e=[],n=0,r=t.docChanges;n<r.length;n++){var i=r[n];i.type!==ea.Metadata&&e.push(i)}t=new ia(t.query,t.docs,t.oldDocs,e,t.fromCache,t.hasPendingWrites,t.syncStateChanged)}this.raisedInitialEvent?this.shouldRaiseEvent(t)&&this.queryObserver.next(t):this.shouldRaiseInitialEvent(t,this.onlineState)&&this.raiseInitialEvent(t),this.snap=t},t.prototype.onError=function(t){this.queryObserver.error(t)},t.prototype.applyOnlineStateChange=function(t){this.onlineState=t,this.snap&&!this.raisedInitialEvent&&this.shouldRaiseInitialEvent(this.snap,t)&&this.raiseInitialEvent(this.snap)},t.prototype.shouldRaiseInitialEvent=function(t,e){return ki(!this.raisedInitialEvent,"Determining whether to raise first event but already had first event"),!t.fromCache||(this.options.waitForSyncWhenOnline&&e!==Zs.Failed?(ki(t.fromCache,"Waiting for sync, but snapshot is not from cache"),!1):!t.docs.isEmpty()||e===Zs.Failed)},t.prototype.shouldRaiseEvent=function(t){return t.docChanges.length>0||!!(t.syncStateChanged||this.snap&&this.snap.hasPendingWrites!==t.hasPendingWrites)&&!0===this.options.includeQueryMetadataChanges},t.prototype.raiseInitialEvent=function(e){ki(!this.raisedInitialEvent,"Trying to raise initial events for second time"),e=new ia(e.query,e.docs,oa.emptySet(e.docs),t.getInitialViewChanges(e),e.fromCache,e.hasPendingWrites,!0),this.raisedInitialEvent=!0,this.queryObserver.next(e)},t.getInitialViewChanges=function(t){var e=[];return t.docs.forEach(function(t){e.push({type:ea.Added,doc:t})}),e},t}(),la=function(){function t(t){var e=this;this.nextCallback=null,this.catchCallback=null,this.result=void 0,this.error=void 0,this.isDone=!1,this.callbackAttached=!1,t(function(t){e.isDone=!0,e.result=t,e.nextCallback&&e.nextCallback(t)},function(t){e.isDone=!0,e.error=t,e.catchCallback&&e.catchCallback(t)})}return t.prototype.catch=function(t){return this.next(void 0,t)},t.prototype.next=function(e,n){var r=this;return this.callbackAttached&&Ii("Called next() or catch() twice for PersistencePromise"),this.callbackAttached=!0,this.isDone?this.error?this.wrapFailure(n,this.error):this.wrapSuccess(e,this.result):new t(function(t,i){r.nextCallback=function(n){r.wrapSuccess(e,n).next(t,i)},r.catchCallback=function(e){r.wrapFailure(n,e).next(t,i)}})},t.prototype.toPromise=function(){var t=this;return new Promise(function(e,n){t.next(e,n)})},t.prototype.wrapUserFunction=function(e){try{var n=e();return n instanceof t?n:t.resolve(n)}catch(e){return t.reject(e)}},t.prototype.wrapSuccess=function(e,n){return e?this.wrapUserFunction(function(){return e(n)}):t.resolve(n)},t.prototype.wrapFailure=function(e,n){return e?this.wrapUserFunction(function(){return e(n)}):t.reject(n)},t.resolve=function(e){return new t(function(t,n){t(e)})},t.reject=function(e){return new t(function(t,n){n(e)})},t.waitFor=function(e){return e.reduce(function(t,e,n){return t.next(function(){return e})},t.resolve())},t.map=function(e){var n=[],r=!0,i=t.resolve(null);return e.reduce(function(t,e){return t.next(function(t){return r||n.push(t),r=!1,e})},i).next(function(t){return n.push(t),n})},t}(),ca=function(){function t(){this.isEager=!0,this.sources=[],this.potentialGarbage=Is()}return t.prototype.addGarbageSource=function(t){this.sources.push(t),t.setGarbageCollector(this)},t.prototype.removeGarbageSource=function(t){this.sources.splice(this.sources.indexOf(t),1),t.setGarbageCollector(null)},t.prototype.addPotentialGarbageKey=function(t){this.potentialGarbage=this.potentialGarbage.add(t)},t.prototype.collectGarbage=function(t){var e=this,n=[],r=Is();return this.potentialGarbage.forEach(function(i){var o=e.documentHasAnyReferences(t,i);n.push(o.next(function(t){return t||(r=r.add(i)),la.resolve()}))}),this.potentialGarbage=Is(),la.waitFor(n).next(function(){return r})},t.prototype.documentHasAnyReferences=function(t,e){var n=la.resolve(!1);return this.sources.map(function(n){return function(){return n.containsKey(t,e)}}).reduce(function(t,e){return t.next(function(t){return t?la.resolve(!0):e()})},n)},t}(),ha=function(){function t(t,e,n){this.query=t,this.addedKeys=e,this.removedKeys=n}return t.fromSnapshot=function(e){for(var n=Is(),r=Is(),i=0,o=e.docChanges;i<o.length;i++){var s=o[i];switch(s.type){case ea.Added:n=n.add(s.doc.key);break;case ea.Removed:r=r.add(s.doc.key)}}return new t(e.query,n,r)},t}(),fa=function(){function t(){this.refsByKey=new vs(pa.compareByKey),this.refsByTarget=new vs(pa.compareByTargetId),this.garbageCollector=null}return t.prototype.isEmpty=function(){return this.refsByKey.isEmpty()},t.prototype.addReference=function(t,e){var n=new pa(t,e);this.refsByKey=this.refsByKey.add(n),this.refsByTarget=this.refsByTarget.add(n)},t.prototype.addReferences=function(t,e){var n=this;t.forEach(function(t){return n.addReference(t,e)})},t.prototype.removeReference=function(t,e){this.removeRef(new pa(t,e))},t.prototype.removeReferences=function(t,e){var n=this;t.forEach(function(t){return n.removeReference(t,e)})},t.prototype.removeReferencesForId=function(t){var e=this,n=po.EMPTY,r=new pa(n,t),i=new pa(n,t+1);this.refsByTarget.forEachInRange([r,i],function(t){e.removeRef(t)})},t.prototype.removeAllReferences=function(){var t=this;this.refsByKey.forEach(function(e){return t.removeRef(e)})},t.prototype.removeRef=function(t){this.refsByKey=this.refsByKey.delete(t),this.refsByTarget=this.refsByTarget.delete(t),null!==this.garbageCollector&&this.garbageCollector.addPotentialGarbageKey(t.key)},t.prototype.referencesForId=function(t){var e=po.EMPTY,n=new pa(e,t),r=new pa(e,t+1),i=Is();return this.refsByTarget.forEachInRange([n,r],function(t){i=i.add(t.key)}),i},t.prototype.setGarbageCollector=function(t){this.garbageCollector=t},t.prototype.containsKey=function(t,e){var n=new pa(e,0),r=this.refsByKey.firstAfterOrEqual(n);return la.resolve(null!==r&&e.isEqual(r.key))},t}(),pa=function(){function t(t,e){this.key=t,this.targetOrBatchId=e}return t.compareByKey=function(t,e){return po.comparator(t.key,e.key)||to(t.targetOrBatchId,e.targetOrBatchId)},t.compareByTargetId=function(t,e){return to(t.targetOrBatchId,e.targetOrBatchId)||po.comparator(t.key,e.key)},t}(),da=1,ya=function(t){return t[t.LocalStore=0]="LocalStore",t[t.SyncEngine=1]="SyncEngine",t}({}),ma=function(){function t(t,e){void 0===e&&(e=0),this.generatorId=t;var n=e>>da<<da;this.previousId=e-n>=t?n|this.generatorId:(n|this.generatorId)-(1<<da)}return t.prototype.next=function(){return this.previousId+=1<<da,this.previousId},t.forLocalStore=function(e){return void 0===e&&(e=0),new t(ya.LocalStore,e)},t.forSyncEngine=function(){return new t(ya.SyncEngine)},t}(),ga=function(t){this.key=t},va=function(t){this.key=t},_a=function(){function t(t,e){this.query=t,this.syncedDocuments=e,this.syncState=null,this.current=!1,this.limboDocuments=Is(),this.mutatedKeys=Is(),this.documentSet=new oa(t.docComparator.bind(t))}return t.prototype.computeDocChanges=function(t,e){var n=this,r=e?e.changeSet:new ra,i=e?e.documentSet:this.documentSet,o=e?e.mutatedKeys:this.mutatedKeys,s=i,a=!1,u=this.query.hasLimit()&&i.size===this.query.limit?i.last():null;if(t.inorderTraversal(function(t,e){var l=i.get(t),c=e instanceof yo?e:null;if(c&&(ki(t.isEqual(c.key),"Mismatching keys found in document changes: "+t+" != "+c.key),c=n.query.matches(c)?c:null),c?(s=s.add(c),o=c.hasLocalMutations?o.add(t):o.delete(t)):(s=s.delete(t),o=o.delete(t)),l&&c){var h=l.data.isEqual(c.data);h&&l.hasLocalMutations===c.hasLocalMutations||(r.track(h?{type:ea.Metadata,doc:c}:{type:ea.Modified,doc:c}),u&&n.query.docComparator(c,u)>0&&(a=!0))}else!l&&c?r.track({type:ea.Added,doc:c}):l&&!c&&(r.track({type:ea.Removed,doc:l}),u&&(a=!0))}),this.query.hasLimit())for(;s.size>this.query.limit;){var l=s.last();s=s.delete(l.key),r.track({type:ea.Removed,doc:l})}return ki(!a||!e,"View was refilled using docs that themselves needed refilling."),{documentSet:s,changeSet:r,needsRefill:a,mutatedKeys:o}},t.prototype.applyChanges=function(t,e){var n=this;ki(!t.needsRefill,"Cannot apply changes that need a refill");var r=this.documentSet;this.documentSet=t.documentSet,this.mutatedKeys=t.mutatedKeys;var i=t.changeSet.getChanges();i.sort(function(t,e){return function(t,e){var n=function(t){switch(t){case ea.Added:return 1;case ea.Modified:case ea.Metadata:return 2;case ea.Removed:return 0;default:return Ii("Unknown ChangeType: "+t)}};return n(t)-n(e)}(t.type,e.type)||n.query.docComparator(t.doc,e.doc)});var o=this.applyTargetChange(e),s=0===this.limboDocuments.size&&this.current?na.Synced:na.Local,a=s!==this.syncState;return this.syncState=s,0!==i.length||a?{snapshot:new ia(this.query,t.documentSet,r,i,s===na.Local,!t.mutatedKeys.isEmpty(),a),limboChanges:o}:{limboChanges:o}},t.prototype.applyOnlineStateChange=function(t){return this.current&&t===Zs.Failed?(this.current=!1,this.applyChanges({documentSet:this.documentSet,changeSet:new ra,mutatedKeys:this.mutatedKeys,needsRefill:!1})):{limboChanges:[]}},t.prototype.shouldBeInLimbo=function(t){return!this.syncedDocuments.has(t)&&!!this.documentSet.has(t)&&!this.documentSet.get(t).hasLocalMutations},t.prototype.applyTargetChange=function(t){var e=this;if(t){var n=t.mapping;switch(n instanceof Os?this.syncedDocuments=n.documents:n instanceof Ps&&(this.syncedDocuments=n.applyToKeySet(this.syncedDocuments)),t.currentStatusUpdate){case ks.MarkCurrent:this.current=!0;break;case ks.MarkNotCurrent:this.current=!1;break;case ks.None:break;default:Ii("Unknown current status update: "+t.currentStatusUpdate)}}var r=this.limboDocuments;this.limboDocuments=Is(),this.current&&this.documentSet.forEach(function(t){e.shouldBeInLimbo(t.key)&&(e.limboDocuments=e.limboDocuments.add(t.key))});var i=[];return r.forEach(function(t){e.limboDocuments.has(t)||i.push(new va(t))}),this.limboDocuments.forEach(function(t){r.has(t)||i.push(new ga(t))}),i},t}(),ba=function(){function t(t,e,n){this.localStore=t,this.remoteStore=e,this.currentUser=n,this.viewHandler=null,this.errorHandler=null,this.queryViewsByQuery=new sa(function(t){return t.canonicalId()}),this.queryViewsByTarget={},this.limboTargetsByKey=new go(po.comparator),this.limboKeysByTarget={},this.limboDocumentRefs=new fa,this.limboCollector=new ca,this.mutationUserCallbacks={},this.targetIdGenerator=ma.forSyncEngine()}return t.prototype.subscribe=function(t,e){ki(null!==t&&null!==e,"View and error handlers cannot be null"),ki(null===this.viewHandler&&null===this.errorHandler,"SyncEngine already has a subscriber."),this.viewHandler=t,this.errorHandler=e,this.limboCollector.addGarbageSource(this.limboDocumentRefs)},t.prototype.listen=function(t){var e=this;return this.assertSubscribed("listen()"),ki(!this.queryViewsByQuery.has(t),"We already listen to the query: "+t),this.localStore.allocateQuery(t).then(function(n){return e.localStore.executeQuery(t).then(function(r){return e.localStore.remoteDocumentKeys(n.targetId).then(function(i){var o=new _a(t,i),s=o.computeDocChanges(r),a=o.applyChanges(s);ki(0===a.limboChanges.length,"View returned limbo docs before target ack from the server."),ki(!!a.snapshot,"applyChanges for new view should always return a snapshot");var u=new function(t,e,n,r){this.query=t,this.targetId=e,this.resumeToken=n,this.view=r}(t,n.targetId,n.resumeToken,o);e.queryViewsByQuery.set(t,u),e.queryViewsByTarget[n.targetId]=u,e.viewHandler([a.snapshot]),e.remoteStore.listen(n)})}).then(function(){return n.targetId})})},t.prototype.unlisten=function(t){var e=this;this.assertSubscribed("unlisten()");var n=this.queryViewsByQuery.get(t);return ki(!!n,"Trying to unlisten on query not found:"+t),this.localStore.releaseQuery(t).then(function(){return e.remoteStore.unlisten(n.targetId),e.removeAndCleanupQuery(n).then(function(){return e.localStore.collectGarbage()})})},t.prototype.write=function(t,e){var n=this;return this.assertSubscribed("write()"),this.localStore.localWrite(t).then(function(t){return n.addMutationCallback(t.batchId,e),n.emitNewSnapsAndNotifyLocalStore(t.changes)}).then(function(){return n.remoteStore.fillWritePipeline()})},t.prototype.wrapUpdateFunctionError=function(t){return t},t.prototype.runTransaction=function(t,e){var n=this;void 0===e&&(e=5),ki(e>=0,"Got negative number of retries for transaction.");var r=this.remoteStore.createTransaction();return function(){try{var e=t(r);return!qo(e)&&e.catch&&e.then?e.catch(function(t){return Promise.reject(n.wrapUpdateFunctionError(t))}):Promise.reject(Error("Transaction callback must return a Promise"))}catch(t){return Promise.reject(n.wrapUpdateFunctionError(t))}}().then(function(i){return r.commit().then(function(){return i}).catch(function(r){return 0===e?Promise.reject(r):n.runTransaction(t,e-1)})})},t.prototype.applyRemoteEvent=function(t){var e=this;return this.assertSubscribed("applyRemoteEvent()"),Di(t.targetChanges,function(n,r){var i=e.limboKeysByTarget[n];i&&r.currentStatusUpdate===ks.MarkCurrent&&!t.documentUpdates.get(i)&&t.addDocumentUpdate(new mo(i,t.snapshotVersion))}),this.localStore.applyRemoteEvent(t).then(function(n){return e.emitNewSnapsAndNotifyLocalStore(n,t)})},t.prototype.applyOnlineStateChange=function(t){var e=[];this.queryViewsByQuery.forEach(function(n,r){var i=r.view.applyOnlineStateChange(t);ki(0===i.limboChanges.length,"OnlineState should not affect limbo documents."),i.snapshot&&e.push(i.snapshot)}),this.viewHandler(e)},t.prototype.rejectListen=function(t,e){var n=this;this.assertSubscribed("rejectListens()");var r=this.limboKeysByTarget[t];if(r){this.limboTargetsByKey=this.limboTargetsByKey.remove(r),delete this.limboKeysByTarget[t];var i=new go(po.comparator);i=i.insert(r,new mo(r,ns.forDeletedDoc()));var o=new xs(ns.MIN,{},i);return this.applyRemoteEvent(o)}var s=this.queryViewsByTarget[t];return ki(!!s,"Unknown targetId: "+t),this.localStore.releaseQuery(s.query).then(function(){return n.removeAndCleanupQuery(s).then(function(){n.errorHandler(s.query,e)})})},t.prototype.applySuccessfulWrite=function(t){var e=this;return this.assertSubscribed("applySuccessfulWrite()"),this.processUserCallback(t.batch.batchId,null),this.localStore.acknowledgeBatch(t).then(function(t){return e.emitNewSnapsAndNotifyLocalStore(t)})},t.prototype.rejectFailedWrite=function(t,e){var n=this;return this.assertSubscribed("rejectFailedWrite()"),this.processUserCallback(t,e),this.localStore.rejectBatch(t).then(function(t){return n.emitNewSnapsAndNotifyLocalStore(t)})},t.prototype.addMutationCallback=function(t,e){var n=this.mutationUserCallbacks[this.currentUser.toKey()];n||(n=new go(to)),n=n.insert(t,e),this.mutationUserCallbacks[this.currentUser.toKey()]=n},t.prototype.processUserCallback=function(t,e){var n=this.mutationUserCallbacks[this.currentUser.toKey()];if(n){var r=n.get(t);r&&(ki(t===n.minKey(),"Mutation callbacks processed out-of-order?"),e?r.reject(e):r.resolve(),n=n.remove(t)),this.mutationUserCallbacks[this.currentUser.toKey()]=n}},t.prototype.removeAndCleanupQuery=function(t){return this.queryViewsByQuery.delete(t.query),delete this.queryViewsByTarget[t.targetId],this.limboDocumentRefs.removeReferencesForId(t.targetId),this.gcLimboDocuments()},t.prototype.updateTrackedLimbos=function(t,e){for(var n=0,r=e;n<r.length;n++){var i=r[n];i instanceof ga?(this.limboDocumentRefs.addReference(i.key,t),this.trackLimboChange(i)):i instanceof va?(Si("SyncEngine","Document no longer in limbo: "+i.key),this.limboDocumentRefs.removeReference(i.key,t)):Ii("Unknown limbo change: "+JSON.stringify(i))}return this.gcLimboDocuments()},t.prototype.trackLimboChange=function(t){var e=t.key;if(!this.limboTargetsByKey.get(e)){Si("SyncEngine","New document in limbo: "+e);var n=this.targetIdGenerator.next(),r=Ko.atPath(e.path);this.limboKeysByTarget[n]=e,this.remoteStore.listen(new is(r,n,Ho.Listen)),this.limboTargetsByKey=this.limboTargetsByKey.insert(e,n)}},t.prototype.gcLimboDocuments=function(){var t=this;return this.limboCollector.collectGarbage(null).next(function(e){e.forEach(function(e){var n=t.limboTargetsByKey.get(e);null!==n&&(t.remoteStore.unlisten(n),t.limboTargetsByKey=t.limboTargetsByKey.remove(e),delete t.limboKeysByTarget[n])})}).toPromise()},t.prototype.currentLimboDocs=function(){return this.limboTargetsByKey},t.prototype.emitNewSnapsAndNotifyLocalStore=function(t,e){var n=this,r=[],i=[],o=[];return this.queryViewsByQuery.forEach(function(s,a){o.push(Promise.resolve().then(function(){var e=a.view.computeDocChanges(t);return e.needsRefill?n.localStore.executeQuery(a.query).then(function(t){return a.view.computeDocChanges(t,e)}):e}).then(function(t){var o=a.view.applyChanges(t,e&&e.targetChanges[a.targetId]);return n.updateTrackedLimbos(a.targetId,o.limboChanges).then(function(){if(o.snapshot){r.push(o.snapshot);var t=ha.fromSnapshot(o.snapshot);i.push(t)}})}))}),Promise.all(o).then(function(){return n.viewHandler(r),n.localStore.notifyLocalViewChanges(i)}).then(function(){return n.localStore.collectGarbage()})},t.prototype.assertSubscribed=function(t){ki(null!==this.viewHandler&&null!==this.errorHandler,"Trying to call "+t+" before calling subscribe().")},t.prototype.handleUserChange=function(t){var e=this;return this.currentUser=t,this.localStore.handleUserChange(t).then(function(t){return e.emitNewSnapsAndNotifyLocalStore(t)}).then(function(){return e.remoteStore.handleUserChange(t)})},t}(),wa=-1,Ea=function(){function t(t,e,n){this.batchId=t,this.localWriteTime=e,this.mutations=n}return t.prototype.applyToRemoteDocument=function(t,e,n){e&&ki(e.key.isEqual(t),"applyToRemoteDocument: key "+t+" should match maybeDoc key\n        "+e.key);var r=n.mutationResults;ki(r.length===this.mutations.length,"Mismatch between mutations length\n      ("+this.mutations.length+") and mutation results length\n      ("+r.length+").");for(var i=0;i<this.mutations.length;i++){var o=this.mutations[i];o.key.isEqual(t)&&(e=o.applyToRemoteDocument(e,r[i]))}return e},t.prototype.applyToLocalView=function(t,e){e&&ki(e.key.isEqual(t),"applyToLocalDocument: key "+t+" should match maybeDoc key\n        "+e.key);for(var n=e,r=0;r<this.mutations.length;r++){var i=this.mutations[r];i.key.isEqual(t)&&(e=i.applyToLocalView(e,n,this.localWriteTime))}return e},t.prototype.keys=function(){for(var t=Is(),e=0,n=this.mutations;e<n.length;e++)t=t.add(n[e].key);return t},t.prototype.isEqual=function(t){return this.batchId===t.batchId&&eo(this.mutations,t.mutations)},t.prototype.isTombstone=function(){return 0===this.mutations.length},t.prototype.toTombstone=function(){return new t(this.batchId,this.localWriteTime,[])},t}(),Sa=function(){function t(t,e,n,r,i){this.batch=t,this.commitVersion=e,this.mutationResults=n,this.streamToken=r,this.docVersions=i}return t.from=function(e,n,r,i){ki(e.mutations.length===r.length,"Mutations sent "+e.mutations.length+" must equal results received "+r.length);for(var o=Cs(),s=e.mutations,a=0;a<s.length;a++){var u=r[a].version;null===u&&(u=n),o=o.insert(s[a].key,u)}return new t(e,n,r,i,o)},t}(),Ca="\x01",Ta="\x01",Ia="\x10",ka="\x11";function xa(t){for(var e="",n=0;n<t.length;n++)e.length>0&&(e=Oa(e)),e=Aa(t.get(n),e);return Oa(e)}function Aa(t,e){for(var n=e,r=t.length,i=0;i<r;i++){var o=t.charAt(i);switch(o){case"\0":n+=Ca+Ia;break;case Ca:n+=Ca+ka;break;default:n+=o}}return n}function Oa(t){return t+Ca+Ta}function Pa(t){var e=t.length;if(ki(e>=2,"Invalid path "+t),2===e)return ki(t.charAt(0)===Ca&&t.charAt(1)===Ta,"Non-empty path "+t+" had length 2"),co.EMPTY_PATH;for(var n=e-2,r=[],i="",o=0;o<e;){var s=t.indexOf(Ca,o);switch((s<0||s>n)&&Ii('Invalid encoded resource path: "'+t+'"'),t.charAt(s+1)){case Ta:var a=t.substring(o,s),u=void 0;0===i.length?u=a:(u=i+=a,i=""),r.push(u);break;case Ia:i+=t.substring(o,s),i+="\0";break;case ka:i+=t.substring(o,s+1);break;default:Ii('Invalid encoded resource path: "'+t+'"')}o=s+2}return new co(r)}function Na(t,e){ki(0===e,"Unexpected upgrade from version "+e),t.createObjectStore(Ma.store,{keyPath:Ma.keyPath}),t.createObjectStore(Va.store,{keyPath:Va.keyPath}),t.createObjectStore(Ua.store,{keyPath:Ua.keyPath}).createIndex(Ua.documentTargetsIndex,Ua.documentTargetsKeyPath,{unique:!0}),t.createObjectStore(La.store,{keyPath:La.keyPath}).createIndex(La.queryTargetsIndexName,La.queryTargetsKeyPath,{unique:!0}),t.createObjectStore(Fa.store),t.createObjectStore(ja.store),t.createObjectStore(Da.store),t.createObjectStore(Ba.store)}var Ra=function(t,e){this.seconds=t,this.nanos=e},Da=function(){function t(t,e){this.ownerId=t,this.leaseTimestampMs=e}return t.store="owner",t}(),Ma=function(){function t(t,e,n){this.userId=t,this.lastAcknowledgedBatchId=e,this.lastStreamToken=n}return t.store="mutationQueues",t.keyPath="userId",t}(),Va=function(){function t(t,e,n,r){this.userId=t,this.batchId=e,this.localWriteTimeMs=n,this.mutations=r}return t.store="mutations",t.keyPath=["userId","batchId"],t}(),Fa=function(){function t(){}return t.prefixForUser=function(t){return[t]},t.prefixForPath=function(t,e){return[t,xa(e)]},t.key=function(t,e,n){return[t,xa(e),n]},t.store="documentMutations",t.PLACEHOLDER=new t,t}(),ja=function(){function t(t,e){this.noDocument=t,this.document=e}return t.store="remoteDocuments",t}(),La=function(){function t(t,e,n,r,i,o){this.targetId=t,this.canonicalId=e,this.readTime=n,this.resumeToken=r,this.lastListenSequenceNumber=i,this.query=o}return t.store="targets",t.keyPath="targetId",t.queryTargetsIndexName="queryTargetsIndex",t.queryTargetsKeyPath=["canonicalId","targetId"],t}(),Ua=function(){function t(t,e){this.targetId=t,this.path=e}return t.store="targetDocuments",t.keyPath=["targetId","path"],t.documentTargetsIndex="documentTargetsIndex",t.documentTargetsKeyPath=["path","targetId"],t}(),Ba=function(){function t(t,e,n){this.highestTargetId=t,this.highestListenSequenceNumber=e,this.lastRemoteSnapshotVersion=n}return t.key="targetGlobalKey",t.store="targetGlobal",t}(),qa=[Ma.store,Va.store,Fa.store,ja.store,La.store,Da.store,Ba.store,Ua.store],Ha=function(){function t(t){this.db=t}return t.openOrCreate=function(e,n,r){return ki(t.isAvailable(),"IndexedDB not supported in current environment."),Si("SimpleDb","Opening database:",e),new la(function(i,o){var s=window.indexedDB.open(e,n);s.onsuccess=function(e){i(new t(e.target.result))},s.onerror=function(t){o(t.target.error)},s.onupgradeneeded=function(t){Si("SimpleDb",'Database "'+e+'" requires upgrade from version:',t.oldVersion),r(t.target.result,t.oldVersion)}}).toPromise()},t.delete=function(t){return Si("SimpleDb","Removing database:",t),Ga(window.indexedDB.deleteDatabase(t)).toPromise()},t.isAvailable=function(){if("undefined"==typeof window||null==window.indexedDB)return!1;var t=window.navigator.userAgent;return!(t.indexOf("MSIE ")>0||t.indexOf("Trident/")>0||t.indexOf("Edge/")>0)},t.prototype.runTransaction=function(t,e,n){var r=new za(this.db,t,e),i=n(r).catch(function(t){return r.abort(),la.reject(t)}).toPromise();return r.completionPromise.then(function(){return i})},t.prototype.close=function(){this.db.close()},t}(),Ka=function(){function t(t){this.dbCursor=t,this.shouldStop=!1,this.nextKey=null}return Object.defineProperty(t.prototype,"isDone",{get:function(){return this.shouldStop},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"skipToKey",{get:function(){return this.nextKey},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"cursor",{set:function(t){this.dbCursor=t},enumerable:!0,configurable:!0}),t.prototype.done=function(){this.shouldStop=!0},t.prototype.skip=function(t){this.nextKey=t},t.prototype.delete=function(){return Ga(this.dbCursor.delete())},t}(),za=function(){function t(t,e,n){var r=this;this.aborted=!1,this.transaction=t.transaction(n,e),this.completionPromise=new Promise(function(t,e){r.transaction.onabort=r.transaction.oncomplete=function(e){t()},r.transaction.onerror=function(t){e(t.target.error)}})}return t.prototype.abort=function(){this.aborted||(Si("SimpleDb","Aborting transaction."),this.aborted=!0,this.transaction.abort())},t.prototype.store=function(t){var e=this.transaction.objectStore(t);return ki(!!e,"Object store not part of transaction: "+t),new Qa(e)},t}(),Qa=function(){function t(t){this.store=t}return t.prototype.put=function(t,e){var n;return void 0!==e?(Si("SimpleDb","PUT",this.store.name,t,e),n=this.store.put(e,t)):(Si("SimpleDb","PUT",this.store.name,"<auto-key>",t),n=this.store.put(t)),Ga(n)},t.prototype.get=function(t){var e=this;return Ga(this.store.get(t)).next(function(n){return void 0===n&&(n=null),Si("SimpleDb","GET",e.store.name,t,n),n})},t.prototype.delete=function(t){return Si("SimpleDb","DELETE",this.store.name,t),Ga(this.store.delete(t))},t.prototype.loadAll=function(t,e){var n=this.cursor(this.options(t,e)),r=[];return this.iterateCursor(n,function(t,e){r.push(e)}).next(function(){return r})},t.prototype.deleteAll=function(t,e){Si("SimpleDb","DELETE ALL",this.store.name);var n=this.options(t,e);n.keysOnly=!1;var r=this.cursor(n);return this.iterateCursor(r,function(t,e,n){return n.delete()})},t.prototype.iterate=function(t,e){var n;e?n=t:(n={},e=t);var r=this.cursor(n);return this.iterateCursor(r,e)},t.prototype.iterateCursor=function(t,e){var n=[];return new la(function(r,i){t.onerror=function(t){i(t.target.error)},t.onsuccess=function(t){var i=t.target.result;if(i){var o=new Ka(i),s=e(i.primaryKey,i.value,o);s instanceof la&&n.push(s),o.isDone?r():null===o.skipToKey?i.continue():i.continue(o.skipToKey)}else r()}}).next(function(){return la.waitFor(n)})},t.prototype.options=function(t,e){var n=void 0;return void 0!==t&&("string"==typeof t?n=t:(ki(void 0===e,"3rd argument must not be defined if 2nd is a range."),e=t)),{index:n,range:e}},t.prototype.cursor=function(t){var e="next";if(t.reverse&&(e="prev"),t.index){var n=this.store.index(t.index);return t.keysOnly?n.openKeyCursor(t.range,e):n.openCursor(t.range,e)}return this.store.openCursor(t.range,e)},t}();function Ga(t){return new la(function(e,n){t.onsuccess=function(t){e(t.target.result)},t.onerror=function(t){n(t.target.error)}})}var Wa=function(){function t(t,e){this.userId=t,this.serializer=e,this.garbageCollector=null}return t.forUser=function(e,n){return ki(""!==e.uid,"UserID must not be an empty string."),new t(e.isUnauthenticated()?"":e.uid,n)},t.prototype.start=function(e){var n=this;return t.loadNextBatchIdFromDb(e).next(function(t){return n.nextBatchId=t,Za(e).get(n.userId)}).next(function(t){return t||(t=new Ma(n.userId,wa,"")),n.metadata=t,n.metadata.lastAcknowledgedBatchId>=n.nextBatchId?n.checkEmpty(e).next(function(t){return ki(t,"Reset nextBatchID is only possible when the queue is empty"),n.metadata.lastAcknowledgedBatchId=wa,Za(e).put(n.metadata)}):la.resolve()})},t.loadNextBatchIdFromDb=function(t){var e=wa;return Ja(t).iterate({reverse:!0},function(t,n,r){var i,o,s=t[0];if(t[1]>e&&(e=n.batchId),""===s)r.done();else{var a=(o=(i=s).length-1,0===i.length?"":"\0"===i.charAt(o)?i.substring(0,o):i.substring(0,o)+String.fromCharCode(i.charCodeAt(o)-1));r.skip([a])}}).next(function(){return e+1})},t.prototype.checkEmpty=function(t){var e=!0,n=IDBKeyRange.bound(this.keyForBatchId(Number.NEGATIVE_INFINITY),this.keyForBatchId(Number.POSITIVE_INFINITY));return Ja(t).iterate({range:n},function(t,n,r){e=!1,r.done()}).next(function(){return e})},t.prototype.getNextBatchId=function(t){return la.resolve(this.nextBatchId)},t.prototype.getHighestAcknowledgedBatchId=function(t){return la.resolve(this.metadata.lastAcknowledgedBatchId)},t.prototype.acknowledgeBatch=function(t,e,n){var r=e.batchId;return ki(r>this.metadata.lastAcknowledgedBatchId,"Mutation batchIDs must be acknowledged in order"),this.metadata.lastAcknowledgedBatchId=r,this.metadata.lastStreamToken=Ya(n),Za(t).put(this.metadata)},t.prototype.getLastStreamToken=function(t){return la.resolve(this.metadata.lastStreamToken)},t.prototype.setLastStreamToken=function(t,e){return this.metadata.lastStreamToken=Ya(e),Za(t).put(this.metadata)},t.prototype.addMutationBatch=function(t,e,n){var r=this,i=this.nextBatchId;this.nextBatchId++;var o=new Ea(i,e,n),s=this.serializer.toDbMutationBatch(this.userId,o);return Ja(t).put(s).next(function(){for(var e=0,o=n;e<o.length;e++){var s=o[e],a=(xa(s.key.path),Fa.key(r.userId,s.key.path,i));Xa(t).put(a,Fa.PLACEHOLDER)}return la.waitFor([])}).next(function(){return o})},t.prototype.lookupMutationBatch=function(t,e){var n=this;return Ja(t).get(this.keyForBatchId(e)).next(function(t){return t?n.serializer.fromDbMutationBatch(t):null})},t.prototype.getNextMutationBatchAfterBatchId=function(t,e){var n=this,r=IDBKeyRange.lowerBound(this.keyForBatchId(e+1)),i=null;return Ja(t).iterate({range:r},function(t,r,o){r.userId===n.userId&&(ki(r.batchId>e,"Should have found mutation after "+e),i=n.serializer.fromDbMutationBatch(r)),o.done()}).next(function(){return i})},t.prototype.getAllMutationBatches=function(t){var e=this,n=IDBKeyRange.bound(this.keyForBatchId(wa),this.keyForBatchId(Number.POSITIVE_INFINITY));return Ja(t).loadAll(n).next(function(t){return t.map(function(t){return e.serializer.fromDbMutationBatch(t)})})},t.prototype.getAllMutationBatchesThroughBatchId=function(t,e){var n=this,r=IDBKeyRange.bound(this.keyForBatchId(wa),this.keyForBatchId(e));return Ja(t).loadAll(r).next(function(t){return t.map(function(t){return n.serializer.fromDbMutationBatch(t)})})},t.prototype.getAllMutationBatchesAffectingDocumentKey=function(t,e){var n=this,r=Fa.prefixForPath(this.userId,e.path),i=IDBKeyRange.lowerBound(r),o=[];return Xa(t).iterate({range:i},function(r,i,s){var a=r[0],u=r[2],l=Pa(r[1]);if(a===n.userId&&e.path.isEqual(l)){var c=n.keyForBatchId(u);return Ja(t).get(c).next(function(t){null===t&&Ii("Dangling document-mutation reference found: "+r+" which points to "+c),o.push(n.serializer.fromDbMutationBatch(t))})}s.done()}).next(function(){return o})},t.prototype.getAllMutationBatchesAffectingQuery=function(t,e){var n=this;ki(!e.isDocumentQuery(),"Document queries shouldn't go down this path");var r=e.path,i=r.length+1,o=Fa.prefixForPath(this.userId,r),s=IDBKeyRange.lowerBound(o),a=new vs(to);return Xa(t).iterate({range:s},function(t,e,o){var s=t[0],u=t[2],l=Pa(t[1]);s===n.userId&&r.isPrefixOf(l)?l.length===i&&(a=a.add(u)):o.done()}).next(function(){var e=[],r=[];return a.forEach(function(i){var o=n.keyForBatchId(i);r.push(Ja(t).get(o).next(function(t){null===t&&Ii("Dangling document-mutation reference found, which points to "+o),e.push(n.serializer.fromDbMutationBatch(t))}))}),la.waitFor(r).next(function(){return e})})},t.prototype.removeMutationBatches=function(t,e){for(var n=Ja(t),r=Xa(t),i=[],o=function(t){var e=IDBKeyRange.only(s.keyForBatchId(t.batchId)),o=0,a=n.iterate({range:e},function(t,e,n){return o++,n.delete()});i.push(a.next(function(){ki(1===o,"Dangling document-mutation reference found: Missing batch "+t.batchId)}));for(var u=0,l=t.mutations;u<l.length;u++){var c=l[u],h=Fa.key(s.userId,c.key.path,t.batchId);i.push(r.delete(h)),null!==s.garbageCollector&&s.garbageCollector.addPotentialGarbageKey(c.key)}},s=this,a=0,u=e;a<u.length;a++)o(u[a]);return la.waitFor(i)},t.prototype.performConsistencyCheck=function(t){var e=this;return this.checkEmpty(t).next(function(n){if(!n)return la.resolve();var r=IDBKeyRange.lowerBound(Fa.prefixForUser(e.userId)),i=[];return Xa(t).iterate({range:r},function(t,n,r){if(t[0]===e.userId){var o=Pa(t[1]);i.push(o)}else r.done()}).next(function(){ki(0===i.length,"Document leak -- detected dangling mutation references when queue is empty. Dangling keys: "+i.map(function(t){return t.canonicalString()}))})})},t.prototype.setGarbageCollector=function(t){this.garbageCollector=t},t.prototype.containsKey=function(t,e){var n=this,r=Fa.prefixForPath(this.userId,e.path),i=r[1],o=IDBKeyRange.lowerBound(r),s=!1;return Xa(t).iterate({range:o,keysOnly:!0},function(t,e,r){t[0]===n.userId&&t[1]===i&&(s=!0),r.done()}).next(function(){return s})},t.prototype.keyForBatchId=function(t){return[this.userId,t]},t}();function Ya(t){return ki("string"==typeof t,"Persisting non-string stream token not supported."),t}function Ja(t){return $a(t,Va.store)}function Xa(t){return $a(t,Fa.store)}function Za(t){return $a(t,Ma.store)}function $a(t,e){return t instanceof za?t.store(e):Ii("Invalid transaction object provided!")}var tu=function(){function t(t){this.serializer=t,this.lastRemoteSnapshotVersion=ns.MIN,this.metadata=new Ba(0,0,ns.MIN.toTimestamp()),this.garbageCollector=null}return t.prototype.start=function(t){var e=this;return nu(t).get(Ba.key).next(function(t){if(null!==t){e.metadata=t;var n=t.lastRemoteSnapshotVersion;e.lastRemoteSnapshotVersion=ns.fromTimestamp(new es(n.seconds,n.nanos))}return la.resolve()})},t.prototype.getHighestTargetId=function(){return this.metadata.highestTargetId},t.prototype.getLastRemoteSnapshotVersion=function(){return this.lastRemoteSnapshotVersion},t.prototype.setLastRemoteSnapshotVersion=function(t,e){return this.lastRemoteSnapshotVersion=e,this.metadata.lastRemoteSnapshotVersion=e.toTimestamp(),nu(t).put(Ba.key,this.metadata)},t.prototype.addQueryData=function(t,e){var n=this,r=e.targetId,i=eu(t).put(this.serializer.toDbTarget(e));return r>this.metadata.highestTargetId?(this.metadata.highestTargetId=r,i.next(function(){return nu(t).put(Ba.key,n.metadata)})):i},t.prototype.removeQueryData=function(t,e){return this.removeMatchingKeysForTargetId(t,e.targetId).next(function(){eu(t).delete(e.targetId)})},t.prototype.getQueryData=function(t,e){var n=this,r=e.canonicalId(),i=IDBKeyRange.bound([r,Number.NEGATIVE_INFINITY],[r,Number.POSITIVE_INFINITY]),o=null;return eu(t).iterate({range:i,index:La.queryTargetsIndexName},function(t,r,i){var s=n.serializer.fromDbTarget(r);e.isEqual(s.query)&&(o=s,i.done())}).next(function(){return o})},t.prototype.addMatchingKeys=function(t,e,n){var r=[],i=ru(t);return e.forEach(function(t){var e=xa(t.path);r.push(i.put(new Ua(n,e)))}),la.waitFor(r)},t.prototype.removeMatchingKeys=function(t,e,n){var r=this,i=[],o=ru(t);return e.forEach(function(t){var e=xa(t.path);i.push(o.delete([n,e])),null!==r.garbageCollector&&r.garbageCollector.addPotentialGarbageKey(t)}),la.waitFor(i)},t.prototype.removeMatchingKeysForTargetId=function(t,e){var n=ru(t),r=IDBKeyRange.bound([e],[e+1],!1,!0);return this.notifyGCForRemovedKeys(t,r).next(function(){return n.delete(r)})},t.prototype.notifyGCForRemovedKeys=function(t,e){var n=this,r=ru(t);return null!==this.garbageCollector&&this.garbageCollector.isEager?r.iterate({range:e,keysOnly:!0},function(t,e,r){var i=Pa(t[1]),o=new po(i);ki(null!==n.garbageCollector,"GarbageCollector for query cache set to null during key removal."),n.garbageCollector.addPotentialGarbageKey(o)}):la.resolve()},t.prototype.getMatchingKeysForTargetId=function(t,e){var n=IDBKeyRange.bound([e],[e+1],!1,!0),r=ru(t),i=Is();return r.iterate({range:n,keysOnly:!0},function(t,e,n){var r=Pa(t[1]),o=new po(r);i=i.add(o)}).next(function(){return i})},t.prototype.setGarbageCollector=function(t){this.garbageCollector=t},t.prototype.containsKey=function(t,e){ki(null!==t,"Persistence Transaction cannot be null for query cache containsKey");var n,r=xa(e.path),i=IDBKeyRange.bound([r],[(n=r,n+"\0")],!1,!0),o=0;return ru(t).iterate({index:Ua.documentTargetsIndex,keysOnly:!0,range:i},function(t,e,n){o++,n.done()}).next(function(){return o>0})},t}();function eu(t){return iu(t,La.store)}function nu(t){return iu(t,Ba.store)}function ru(t){return iu(t,Ua.store)}function iu(t,e){return t instanceof za?t.store(e):Ii("Invalid transaction object provided!")}var ou=function(){function t(t){this.serializer=t}return t.prototype.addEntry=function(t,e){return su(t).put(au(e.key),this.serializer.toDbRemoteDocument(e))},t.prototype.removeEntry=function(t,e){return su(t).delete(au(e))},t.prototype.getEntry=function(t,e){var n=this;return su(t).get(au(e)).next(function(t){return t?n.serializer.fromDbRemoteDocument(t):null})},t.prototype.getDocumentsMatchingQuery=function(t,e){var n=this,r=Es(),i=e.path.toArray(),o=IDBKeyRange.lowerBound(i);return su(t).iterate({range:o},function(t,i,o){var s=n.serializer.fromDbRemoteDocument(i);e.path.isPrefixOf(s.key.path)?s instanceof yo&&e.matches(s)&&(r=r.insert(s.key,s)):o.done()}).next(function(){return r})},t}();function su(t){return t instanceof za?t.store(ja.store):Ii("Invalid transaction object provided!")}function au(t){return t.path.toArray()}var uu,lu=function(){function t(t){this.remoteSerializer=t}return t.prototype.fromDbRemoteDocument=function(t){if(t.document)return this.remoteSerializer.fromDocument(t.document);if(t.noDocument){var e=po.fromSegments(t.noDocument.path),n=t.noDocument.readTime,r=new es(n.seconds,n.nanos);return new mo(e,ns.fromTimestamp(r))}return Ii("Unexpected DbRemoteDocument")},t.prototype.toDbRemoteDocument=function(t){if(t instanceof yo){var e=this.remoteSerializer.toDocument(t);return new ja(null,e)}var n=t.key.path.toArray(),r=t.version.toTimestamp(),i=new Ra(r.seconds,r.nanos);return new ja(new function(t,e){this.path=t,this.readTime=e}(n,i),null)},t.prototype.toDbMutationBatch=function(t,e){var n=this,r=e.mutations.map(function(t){return n.remoteSerializer.toMutation(t)});return new Va(t,e.batchId,e.localWriteTime.toEpochMilliseconds(),r)},t.prototype.fromDbMutationBatch=function(t){var e=this,n=t.mutations.map(function(t){return e.remoteSerializer.fromMutation(t)}),r=es.fromEpochMilliseconds(t.localWriteTimeMs);return new Ea(t.batchId,r,n)},t.prototype.fromDbTarget=function(t){var e,n=new es(t.readTime.seconds,t.readTime.nanos),r=ns.fromTimestamp(n);return e=void 0!==t.query.documents?this.remoteSerializer.fromDocumentsTarget(t.query):this.remoteSerializer.fromQueryTarget(t.query),new is(e,t.targetId,Ho.Listen,r,t.resumeToken)},t.prototype.toDbTarget=function(t){ki(Ho.Listen===t.purpose,"Only queries with purpose "+Ho.Listen+" may be stored, got "+t.purpose);var e,n=t.snapshotVersion.toTimestamp(),r=new Ra(n.seconds,n.nanos);e=t.query.isDocumentQuery()?this.remoteSerializer.toDocumentsTarget(t.query):this.remoteSerializer.toQueryTarget(t.query),ki("string"==typeof t.resumeToken,"Persisting non-string resume token not supported.");var i=t.resumeToken;return new La(t.targetId,t.query.canonicalId(),r,i,0,e)},t}(),cu="There is another tab open with offline persistence enabled. Only one such tab is allowed at a time. The other tab must be closed or persistence must be disabled.",hu=function(){function t(e,n){this.ownerId=this.generateOwnerId(),this.dbName=e+t.MAIN_DATABASE,this.serializer=new lu(n),this.localStoragePrefix=e}return t.prototype.start=function(){var e=this;return t.isAvailable()?(ki(!this.started,"IndexedDbPersistence double-started!"),this.started=!0,Ha.openOrCreate(this.dbName,1,Na).then(function(t){e.simpleDb=t}).then(function(){return e.tryAcquireOwnerLease()}).then(function(){e.scheduleOwnerLeaseRefreshes(),e.attachWindowUnloadHook()})):(this.persistenceError=new Pi(Oi.UNIMPLEMENTED,"This platform is either missing IndexedDB or is known to have an incomplete implementation. Offline persistence has been disabled."),Promise.reject(this.persistenceError))},t.prototype.shutdown=function(){var t=this;return ki(this.started,"IndexedDbPersistence shutdown without start!"),this.started=!1,this.detachWindowUnloadHook(),this.stopOwnerLeaseRefreshes(),this.releaseOwnerLease().then(function(){t.simpleDb.close()})},t.prototype.getMutationQueue=function(t){return Wa.forUser(t,this.serializer)},t.prototype.getQueryCache=function(){return new tu(this.serializer)},t.prototype.getRemoteDocumentCache=function(){return new ou(this.serializer)},t.prototype.runTransaction=function(t,e){var n=this;return this.persistenceError?Promise.reject(this.persistenceError):(Si("IndexedDbPersistence","Starting transaction:",t),this.simpleDb.runTransaction("readwrite",qa,function(t){return n.ensureOwnerLease(t).next(function(){return e(t)})}))},t.isAvailable=function(){return Ha.isAvailable()},t.buildStoragePrefix=function(t){var e=t.databaseId.projectId;return t.databaseId.isDefaultDatabase||(e+="."+t.databaseId.database),"firestore/"+t.persistenceKey+"/"+e+"/"},t.prototype.tryAcquireOwnerLease=function(){var t=this;return this.simpleDb.runTransaction("readwrite",[Da.store],function(e){var n=e.store(Da.store);return n.get("owner").next(function(e){if(t.validOwner(e))return Si("IndexedDbPersistence","Valid owner already. Failing. Current owner:",e),t.persistenceError=new Pi(Oi.FAILED_PRECONDITION,cu),la.reject(t.persistenceError);var r=new Da(t.ownerId,Date.now());return Si("IndexedDbPersistence","No valid owner. Acquiring owner lease. Current owner:",e,"New owner:",r),n.put("owner",r)})})},t.prototype.releaseOwnerLease=function(){var t=this;return this.simpleDb.runTransaction("readwrite",[Da.store],function(e){var n=e.store(Da.store);return n.get("owner").next(function(e){return null!==e&&e.ownerId===t.ownerId?(Si("IndexedDbPersistence","Releasing owner lease."),n.delete("owner")):la.resolve()})})},t.prototype.ensureOwnerLease=function(t){var e=this;return t.store(Da.store).get("owner").next(function(t){return null===t||t.ownerId!==e.ownerId?(e.persistenceError=new Pi(Oi.FAILED_PRECONDITION,cu),la.reject(e.persistenceError)):la.resolve()})},t.prototype.validOwner=function(t){var e=Date.now();return!(null===t||t.leaseTimestampMs<e-5e3||(t.leaseTimestampMs>e?(Ci("Persistence owner-lease is in the future. Discarding.",t),1):t.ownerId===this.getZombiedOwnerId()))},t.prototype.scheduleOwnerLeaseRefreshes=function(){var t=this;this.ownerLeaseRefreshHandle=setInterval(function(){t.runTransaction("Refresh owner timestamp",function(e){return e.store(Da.store).put("owner",new Da(t.ownerId,Date.now()))}).catch(function(e){Ci(e),t.stopOwnerLeaseRefreshes()})},4e3)},t.prototype.stopOwnerLeaseRefreshes=function(){this.ownerLeaseRefreshHandle&&(clearInterval(this.ownerLeaseRefreshHandle),this.ownerLeaseRefreshHandle=null)},t.prototype.attachWindowUnloadHook=function(){var t=this;this.windowUnloadHandler=function(){t.setZombiedOwnerId(t.ownerId),t.shutdown()},window.addEventListener("unload",this.windowUnloadHandler)},t.prototype.detachWindowUnloadHook=function(){this.windowUnloadHandler&&(window.removeEventListener("unload",this.windowUnloadHandler),this.windowUnloadHandler=null)},t.prototype.getZombiedOwnerId=function(){try{var t=window.localStorage.getItem(this.zombiedOwnerLocalStorageKey());return Si("IndexedDbPersistence","Zombied ownerID from LocalStorage:",t),t}catch(t){return Ci("Failed to get zombie owner id.",t),null}},t.prototype.setZombiedOwnerId=function(t){try{null===t?window.localStorage.removeItem(this.zombiedOwnerLocalStorageKey()):window.localStorage.setItem(this.zombiedOwnerLocalStorageKey(),t)}catch(t){Ci("Failed to set zombie owner id.",t)}},t.prototype.zombiedOwnerLocalStorageKey=function(){return this.localStoragePrefix+"zombiedOwnerId"},t.prototype.generateOwnerId=function(){return $i.newId()},t.MAIN_DATABASE="main",t}(),fu=function(){function t(t,e){this.remoteDocumentCache=t,this.mutationQueue=e}return t.prototype.getDocument=function(t,e){var n=this;return this.remoteDocumentCache.getEntry(t,e).next(function(r){return n.computeLocalDocument(t,e,r)})},t.prototype.getDocuments=function(t,e){var n=this,r=[],i=bs();return e.forEach(function(e){r.push(n.getDocument(t,e).next(function(t){t||(t=new mo(e,ns.forDeletedDoc())),i=i.insert(e,t)}))}),la.waitFor(r).next(function(){return i})},t.prototype.getDocumentsMatchingQuery=function(t,e){return po.isDocumentKey(e.path)?this.getDocumentsMatchingDocumentQuery(t,e.path):this.getDocumentsMatchingCollectionQuery(t,e)},t.prototype.getDocumentsMatchingDocumentQuery=function(t,e){return this.getDocument(t,new po(e)).next(function(t){var e=Es();return t instanceof yo&&(e=e.insert(t.key,t)),e})},t.prototype.getDocumentsMatchingCollectionQuery=function(t,e){var n,r=this;return this.remoteDocumentCache.getDocumentsMatchingQuery(t,e).next(function(e){return r.computeLocalDocuments(t,e)}).next(function(i){return n=i,r.mutationQueue.getAllMutationBatchesAffectingQuery(t,e)}).next(function(e){for(var i=Is(),o=0,s=e;o<s.length;o++)for(var a=0,u=s[o].mutations;a<u.length;a++){var l=u[a];n.get(l.key)||(i=i.add(l.key))}var c=[];return i.forEach(function(e){c.push(r.getDocument(t,e).next(function(t){t instanceof yo&&(n=n.insert(t.key,t))}))}),la.waitFor(c)}).next(function(){return n.forEach(function(t,r){e.matches(r)||(n=n.remove(t))}),n})},t.prototype.computeLocalDocument=function(t,e,n){return this.mutationQueue.getAllMutationBatchesAffectingDocumentKey(t,e).next(function(t){for(var r=0,i=t;r<i.length;r++)n=i[r].applyToLocalView(e,n);return n})},t.prototype.computeLocalDocuments=function(t,e){var n=this,r=[];return e.forEach(function(i,o){r.push(n.computeLocalDocument(t,i,o).next(function(t){t instanceof yo?e=e.insert(t.key,t):t instanceof mo?e=e.remove(t.key):Ii("Unknown MaybeDocument: "+t)}))}),la.waitFor(r).next(function(){return e})},t}(),pu=function(){function t(t){this.remoteDocumentCache=t,this.changes=bs()}return t.prototype.addEntry=function(t){var e=this.assertChanges();this.changes=e.insert(t.key,t)},t.prototype.getEntry=function(t,e){var n=this.assertChanges().get(e);return n?la.resolve(n):this.remoteDocumentCache.getEntry(t,e)},t.prototype.apply=function(t){var e=this,n=[];return this.assertChanges().forEach(function(r,i){n.push(e.remoteDocumentCache.addEntry(t,i))}),this.changes=null,la.waitFor(n)},t.prototype.assertChanges=function(){return ki(null!==this.changes,"Changes have already been applied."),this.changes},t}(),du=function(){function t(t,e,n){this.persistence=t,this.garbageCollector=n,this.localViewReferences=new fa,this.targetIds={},this.targetIdGenerator=ma.forLocalStore(),this.heldBatchResults=[],this.mutationQueue=t.getMutationQueue(e),this.remoteDocuments=t.getRemoteDocumentCache(),this.queryCache=t.getQueryCache(),this.localDocuments=new fu(this.remoteDocuments,this.mutationQueue),this.garbageCollector.addGarbageSource(this.localViewReferences),this.garbageCollector.addGarbageSource(this.queryCache),this.garbageCollector.addGarbageSource(this.mutationQueue)}return t.prototype.start=function(){var t=this;return this.persistence.runTransaction("Start LocalStore",function(e){return t.startMutationQueue(e).next(function(){return t.startQueryCache(e)})})},t.prototype.handleUserChange=function(t){var e=this;return this.persistence.runTransaction("Handle user change",function(n){var r;return e.mutationQueue.getAllMutationBatches(n).next(function(i){return r=i,e.garbageCollector.removeGarbageSource(e.mutationQueue),e.mutationQueue=e.persistence.getMutationQueue(t),e.garbageCollector.addGarbageSource(e.mutationQueue),e.startMutationQueue(n)}).next(function(){return e.localDocuments=new fu(e.remoteDocuments,e.mutationQueue),e.mutationQueue.getAllMutationBatches(n)}).next(function(t){for(var i=Is(),o=0,s=[r,t];o<s.length;o++)for(var a=0,u=s[o];a<u.length;a++)for(var l=0,c=u[a].mutations;l<c.length;l++)i=i.add(c[l].key);return e.localDocuments.getDocuments(n,i)})})},t.prototype.startQueryCache=function(t){var e=this;return this.queryCache.start(t).next(function(){var t=e.queryCache.getHighestTargetId();e.targetIdGenerator=ma.forLocalStore(t)})},t.prototype.startMutationQueue=function(t){var e=this;return this.mutationQueue.start(t).next(function(){return e.heldBatchResults=[],e.mutationQueue.getHighestAcknowledgedBatchId(t)}).next(function(n){return n!==wa?e.mutationQueue.getAllMutationBatchesThroughBatchId(t,n):la.resolve([])}).next(function(n){return n.length>0?e.mutationQueue.removeMutationBatches(t,n):la.resolve()})},t.prototype.localWrite=function(t){var e=this;return this.persistence.runTransaction("Locally write mutations",function(n){var r,i=es.now();return e.mutationQueue.addMutationBatch(n,i,t).next(function(t){var i=(r=t).keys();return e.localDocuments.getDocuments(n,i)}).next(function(t){return{batchId:r.batchId,changes:t}})})},t.prototype.acknowledgeBatch=function(t){var e=this;return this.persistence.runTransaction("Acknowledge batch",function(n){var r;return e.mutationQueue.acknowledgeBatch(n,t.batch,t.streamToken).next(function(){if(e.shouldHoldBatchResult(t.commitVersion))return e.heldBatchResults.push(t),r=Is(),la.resolve();var i=new pu(e.remoteDocuments);return e.releaseBatchResults(n,[t],i).next(function(t){return r=t,i.apply(n)})}).next(function(){return e.mutationQueue.performConsistencyCheck(n)}).next(function(){return e.localDocuments.getDocuments(n,r)})})},t.prototype.rejectBatch=function(t){var e=this;return this.persistence.runTransaction("Reject batch",function(n){var r,i;return e.mutationQueue.lookupMutationBatch(n,t).next(function(i){return ki(null!=i,"Attempt to reject nonexistent batch!"),r=i,e.mutationQueue.getHighestAcknowledgedBatchId(n).next(function(e){return ki(t>e,"Acknowledged batches can't be rejected."),r})}).next(function(){return e.removeMutationBatch(n,r)}).next(function(t){return i=t,e.mutationQueue.performConsistencyCheck(n)}).next(function(){return e.localDocuments.getDocuments(n,i)})})},t.prototype.getLastStreamToken=function(){var t=this;return this.persistence.runTransaction("Get last stream token",function(e){return t.mutationQueue.getLastStreamToken(e)})},t.prototype.setLastStreamToken=function(t){var e=this;return this.persistence.runTransaction("Set last stream token",function(n){return e.mutationQueue.setLastStreamToken(n,t)})},t.prototype.getLastRemoteSnapshotVersion=function(){return this.queryCache.getLastRemoteSnapshotVersion()},t.prototype.applyRemoteEvent=function(t){var e=this,n=new pu(this.remoteDocuments);return this.persistence.runTransaction("Apply remote event",function(r){var i=[];Di(t.targetChanges,function(t,n){var o=e.targetIds[t];if(o){var s=n.mapping;if(s)if(s instanceof Os)i.push(e.queryCache.removeMatchingKeysForTargetId(r,t).next(function(){return e.queryCache.addMatchingKeys(r,s.documents,t)}));else{if(!(s instanceof Ps))return Ii("Unknown mapping type: "+JSON.stringify(s));i.push(e.queryCache.removeMatchingKeys(r,s.removedDocuments,t).next(function(){return e.queryCache.addMatchingKeys(r,s.addedDocuments,t)}))}var a=n.resumeToken;a.length>0&&(o=o.update({resumeToken:a,snapshotVersion:n.snapshotVersion}),e.targetIds[t]=o,i.push(e.queryCache.addQueryData(r,o)))}});var o=Is();t.documentUpdates.forEach(function(t,s){o=o.add(t),i.push(n.getEntry(r,t).next(function(r){null==r||s.version.isEqual(ns.MIN)||s.version.compareTo(r.version)>=0?n.addEntry(s):Si("LocalStore","Ignoring outdated watch update for ",t,". Current version:",r.version," Watch version:",s.version),e.garbageCollector.addPotentialGarbageKey(t)}))});var s,a=e.queryCache.getLastRemoteSnapshotVersion(),u=t.snapshotVersion;return u.isEqual(ns.MIN)||(ki(u.compareTo(a)>=0,"Watch stream reverted to previous snapshot?? "+u+" < "+a),i.push(e.queryCache.setLastRemoteSnapshotVersion(r,u))),la.waitFor(i).next(function(){return e.releaseHeldBatchResults(r,n)}).next(function(t){return s=t,n.apply(r)}).next(function(){return e.localDocuments.getDocuments(r,o.unionWith(s))})})},t.prototype.notifyLocalViewChanges=function(t){var e=this;return this.persistence.runTransaction("Notify local view changes",function(n){for(var r=[],i=function(t){r.push(e.queryCache.getQueryData(n,t.query).next(function(n){ki(null!==n,"Local view changes contain unallocated query.");var r=n.targetId;e.localViewReferences.addReferences(t.addedKeys,r),e.localViewReferences.removeReferences(t.removedKeys,r)}))},o=0,s=t;o<s.length;o++)i(s[o]);return la.waitFor(r)})},t.prototype.nextMutationBatch=function(t){var e=this;return this.persistence.runTransaction("Get next mutation batch",function(n){return void 0===t&&(t=wa),e.mutationQueue.getNextMutationBatchAfterBatchId(n,t)})},t.prototype.readDocument=function(t){var e=this;return this.persistence.runTransaction("read document",function(n){return e.localDocuments.getDocument(n,t)})},t.prototype.allocateQuery=function(t){var e=this;return this.persistence.runTransaction("Allocate query",function(n){var r;return e.queryCache.getQueryData(n,t).next(function(i){if(i)return r=i,la.resolve();var o=e.targetIdGenerator.next();return r=new is(t,o,Ho.Listen),e.queryCache.addQueryData(n,r)}).next(function(){return ki(!e.targetIds[r.targetId],"Tried to allocate an already allocated query: "+t),e.targetIds[r.targetId]=r,r})})},t.prototype.releaseQuery=function(t){var e=this;return this.persistence.runTransaction("Release query",function(n){return e.queryCache.getQueryData(n,t).next(function(r){return ki(null!=r,"Tried to release nonexistent query: "+t),e.localViewReferences.removeReferencesForId(r.targetId),delete e.targetIds[r.targetId],e.garbageCollector.isEager?e.queryCache.removeQueryData(n,r):la.resolve()}).next(function(){if(Vi(e.targetIds)){var t=new pu(e.remoteDocuments);return e.releaseHeldBatchResults(n,t).next(function(){t.apply(n)})}return la.resolve()})})},t.prototype.executeQuery=function(t){var e=this;return this.persistence.runTransaction("Execute query",function(n){return e.localDocuments.getDocumentsMatchingQuery(n,t)})},t.prototype.remoteDocumentKeys=function(t){var e=this;return this.persistence.runTransaction("Remote document keys",function(n){return e.queryCache.getMatchingKeysForTargetId(n,t)})},t.prototype.collectGarbage=function(){var t=this;return this.persistence.runTransaction("Garbage collection",function(e){return t.garbageCollector.collectGarbage(e).next(function(n){var r=[];return n.forEach(function(n){r.push(t.remoteDocuments.removeEntry(e,n))}),la.waitFor(r)})})},t.prototype.releaseHeldBatchResults=function(t,e){for(var n=[],r=0,i=this.heldBatchResults;r<i.length;r++){var o=i[r];if(!this.isRemoteUpToVersion(o.commitVersion))break;n.push(o)}return 0===n.length?la.resolve(Is()):(this.heldBatchResults.splice(0,n.length),this.releaseBatchResults(t,n,e))},t.prototype.isRemoteUpToVersion=function(t){var e=this.queryCache.getLastRemoteSnapshotVersion();return t.compareTo(e)<=0||Vi(this.targetIds)},t.prototype.shouldHoldBatchResult=function(t){return!this.isRemoteUpToVersion(t)||this.heldBatchResults.length>0},t.prototype.releaseBatchResults=function(t,e,n){for(var r=this,i=la.resolve(),o=function(e){i=i.next(function(){return r.applyWriteToRemoteDocuments(t,e,n)})},s=0,a=e;s<a.length;s++)o(a[s]);return i.next(function(){return r.removeMutationBatches(t,e.map(function(t){return t.batch}))})},t.prototype.removeMutationBatch=function(t,e){return this.removeMutationBatches(t,[e])},t.prototype.removeMutationBatches=function(t,e){for(var n=Is(),r=0,i=e;r<i.length;r++)for(var o=0,s=i[r].mutations;o<s.length;o++)n=n.add(s[o].key);return this.mutationQueue.removeMutationBatches(t,e).next(function(){return n})},t.prototype.applyWriteToRemoteDocuments=function(t,e,n){var r=e.batch,i=r.keys(),o=la.resolve();return i.forEach(function(i){o=o.next(function(){return n.getEntry(t,i)}).next(function(t){var o=t,s=e.docVersions.get(i);ki(null!==s,"ackVersions should contain every doc in the write."),(!o||o.version.compareTo(s)<0)&&((o=r.applyToRemoteDocument(i,o,e))?n.addEntry(o):ki(!t,"Mutation batch "+r+" applied to document "+t+" resulted in null"))})}),o},t}(),yu=function(){function t(){this.mutationQueue=[],this.nextBatchId=1,this.highestAcknowledgedBatchId=wa,this.lastStreamToken=Ai(),this.garbageCollector=null,this.batchesByDocumentKey=new vs(pa.compareByKey)}return t.prototype.start=function(t){return 0===this.mutationQueue.length&&(this.nextBatchId=1,this.highestAcknowledgedBatchId=wa),ki(this.highestAcknowledgedBatchId<this.nextBatchId,"highestAcknowledgedBatchId must be less than the nextBatchId"),la.resolve()},t.prototype.checkEmpty=function(t){return la.resolve(0===this.mutationQueue.length)},t.prototype.getNextBatchId=function(t){return la.resolve(this.nextBatchId)},t.prototype.getHighestAcknowledgedBatchId=function(t){return la.resolve(this.highestAcknowledgedBatchId)},t.prototype.acknowledgeBatch=function(t,e,n){var r=e.batchId;ki(r>this.highestAcknowledgedBatchId,"Mutation batchIDs must be acknowledged in order");var i=this.indexOfExistingBatchId(r,"acknowledged"),o=this.mutationQueue[i];return ki(r===o.batchId,"Queue ordering failure: expected batch "+r+", got batch "+o.batchId),ki(!o.isTombstone(),"Can't acknowledge a previously removed batch"),this.highestAcknowledgedBatchId=r,this.lastStreamToken=n,la.resolve()},t.prototype.getLastStreamToken=function(t){return la.resolve(this.lastStreamToken)},t.prototype.setLastStreamToken=function(t,e){return this.lastStreamToken=e,la.resolve()},t.prototype.addMutationBatch=function(t,e,n){ki(0!==n.length,"Mutation batches should not be empty");var r=this.nextBatchId;this.nextBatchId++,this.mutationQueue.length>0&&ki(this.mutationQueue[this.mutationQueue.length-1].batchId<r,"Mutation batchIDs must be monotonically increasing order");var i=new Ea(r,e,n);this.mutationQueue.push(i);for(var o=0,s=n;o<s.length;o++)this.batchesByDocumentKey=this.batchesByDocumentKey.add(new pa(s[o].key,r));return la.resolve(i)},t.prototype.lookupMutationBatch=function(t,e){return la.resolve(this.findMutationBatch(e))},t.prototype.getNextMutationBatchAfterBatchId=function(t,e){var n=this.mutationQueue.length;e=Math.max(e+1,this.highestAcknowledgedBatchId);for(var r=this.indexOfBatchId(e),i=r<0?0:r;i<n;i++){var o=this.mutationQueue[i];if(!o.isTombstone())return la.resolve(o)}return la.resolve(null)},t.prototype.getAllMutationBatches=function(t){return la.resolve(this.getAllLiveMutationBatchesBeforeIndex(this.mutationQueue.length))},t.prototype.getAllMutationBatchesThroughBatchId=function(t,e){var n=this.mutationQueue.length,r=this.indexOfBatchId(e);return r<0?r=0:r>=n?r=n:r++,la.resolve(this.getAllLiveMutationBatchesBeforeIndex(r))},t.prototype.getAllMutationBatchesAffectingDocumentKey=function(t,e){var n=this,r=new pa(e,0),i=new pa(e,Number.POSITIVE_INFINITY),o=[];return this.batchesByDocumentKey.forEachInRange([r,i],function(t){ki(e.isEqual(t.key),"Should only iterate over a single key's batches");var r=n.findMutationBatch(t.targetOrBatchId);ki(null!==r,"Batches in the index must exist in the main table"),o.push(r)}),la.resolve(o)},t.prototype.getAllMutationBatchesAffectingQuery=function(t,e){var n=this,r=e.path,i=r.length+1,o=r;po.isDocumentKey(o)||(o=o.child(""));var s=new pa(new po(o),0),a=new vs(to);this.batchesByDocumentKey.forEachWhile(function(t){var e=t.key.path;return!!r.isPrefixOf(e)&&(e.length===i&&(a=a.add(t.targetOrBatchId)),!0)},s);var u=[];return a.forEach(function(t){var e=n.findMutationBatch(t);null!==e&&u.push(e)}),la.resolve(u)},t.prototype.removeMutationBatches=function(t,e){var n=e.length;ki(n>0,"Should not remove mutations when none exist.");var r=e[0].batchId,i=this.mutationQueue.length,o=this.indexOfExistingBatchId(r,"removed");ki(this.mutationQueue[o].batchId===r,"Removed batches must exist in the queue");for(var s=1,a=o+1;s<n&&a<i;)(f=this.mutationQueue[a]).isTombstone()?a++:(ki(f.batchId===e[s].batchId,"Removed batches must be contiguous in the queue"),s++,a++);if(0===o){for(;a<i&&(f=this.mutationQueue[a]).isTombstone();a++);this.mutationQueue.splice(o,a-o)}else for(var u=o;u<a;u++)this.mutationQueue[u]=this.mutationQueue[u].toTombstone();for(var l=this.batchesByDocumentKey,c=0,h=e;c<h.length;c++)for(var f,p=(f=h[c]).batchId,d=0,y=f.mutations;d<y.length;d++){var m=y[d].key;null!==this.garbageCollector&&this.garbageCollector.addPotentialGarbageKey(m);var g=new pa(m,p);l=l.delete(g)}return this.batchesByDocumentKey=l,la.resolve()},t.prototype.setGarbageCollector=function(t){this.garbageCollector=t},t.prototype.containsKey=function(t,e){var n=new pa(e,0),r=this.batchesByDocumentKey.firstAfterOrEqual(n);return la.resolve(e.isEqual(r&&r.key))},t.prototype.performConsistencyCheck=function(t){return 0===this.mutationQueue.length&&ki(this.batchesByDocumentKey.isEmpty(),"Document leak -- detected dangling mutation references when queue is empty."),la.resolve()},t.prototype.getAllLiveMutationBatchesBeforeIndex=function(t){for(var e=[],n=0;n<t;n++){var r=this.mutationQueue[n];r.isTombstone()||e.push(r)}return e},t.prototype.indexOfExistingBatchId=function(t,e){var n=this.indexOfBatchId(t);return ki(n>=0&&n<this.mutationQueue.length,"Batches must exist to be "+e),n},t.prototype.indexOfBatchId=function(t){return 0===this.mutationQueue.length?0:t-this.mutationQueue[0].batchId},t.prototype.findMutationBatch=function(t){var e=this.indexOfBatchId(t);if(e<0||e>=this.mutationQueue.length)return null;var n=this.mutationQueue[e];return ki(n.batchId===t,"If found batch must match"),n.isTombstone()?null:n},t}(),mu=function(){function t(){this.queries=new sa(function(t){return t.canonicalId()}),this.lastRemoteSnapshotVersion=ns.MIN,this.highestTargetId=0,this.references=new fa}return t.prototype.start=function(t){return la.resolve()},t.prototype.getLastRemoteSnapshotVersion=function(){return this.lastRemoteSnapshotVersion},t.prototype.getHighestTargetId=function(){return this.highestTargetId},t.prototype.setLastRemoteSnapshotVersion=function(t,e){return this.lastRemoteSnapshotVersion=e,la.resolve()},t.prototype.addQueryData=function(t,e){this.queries.set(e.query,e);var n=e.targetId;return n>this.highestTargetId&&(this.highestTargetId=n),la.resolve()},t.prototype.removeQueryData=function(t,e){return this.queries.delete(e.query),this.references.removeReferencesForId(e.targetId),la.resolve()},t.prototype.getQueryData=function(t,e){var n=this.queries.get(e)||null;return la.resolve(n)},t.prototype.addMatchingKeys=function(t,e,n){return this.references.addReferences(e,n),la.resolve()},t.prototype.removeMatchingKeys=function(t,e,n){return this.references.removeReferences(e,n),la.resolve()},t.prototype.removeMatchingKeysForTargetId=function(t,e){return this.references.removeReferencesForId(e),la.resolve()},t.prototype.getMatchingKeysForTargetId=function(t,e){var n=this.references.referencesForId(e);return la.resolve(n)},t.prototype.setGarbageCollector=function(t){this.references.setGarbageCollector(t)},t.prototype.containsKey=function(t,e){return this.references.containsKey(t,e)},t}(),gu=function(){function t(){this.docs=bs()}return t.prototype.addEntry=function(t,e){return this.docs=this.docs.insert(e.key,e),la.resolve()},t.prototype.removeEntry=function(t,e){return this.docs=this.docs.remove(e),la.resolve()},t.prototype.getEntry=function(t,e){return la.resolve(this.docs.get(e))},t.prototype.getDocumentsMatchingQuery=function(t,e){for(var n=Es(),r=new po(e.path.child("")),i=this.docs.getIteratorFrom(r);i.hasNext();){var o=i.getNext(),s=o.value;if(!e.path.isPrefixOf(o.key.path))break;s instanceof yo&&e.matches(s)&&(n=n.insert(s.key,s))}return la.resolve(n)},t}(),vu=function(){function t(){this.mutationQueues={},this.remoteDocumentCache=new gu,this.queryCache=new mu,this.started=!1}return t.prototype.start=function(){return ki(!this.started,"MemoryPersistence double-started!"),this.started=!0,Promise.resolve()},t.prototype.shutdown=function(){return ki(this.started,"MemoryPersistence shutdown without start!"),this.started=!1,Promise.resolve()},t.prototype.getMutationQueue=function(t){var e=this.mutationQueues[t.toKey()];return e||(e=new yu,this.mutationQueues[t.toKey()]=e),e},t.prototype.getQueryCache=function(){return this.queryCache},t.prototype.getRemoteDocumentCache=function(){return this.remoteDocumentCache},t.prototype.runTransaction=function(t,e){return Si("MemoryPersistence","Starting transaction:",t),e(new _u).toPromise()},t}(),_u=function(){},bu=function(){function t(){this.isEager=!1}return t.prototype.addGarbageSource=function(t){},t.prototype.removeGarbageSource=function(t){},t.prototype.addPotentialGarbageKey=function(t){},t.prototype.collectGarbage=function(t){return la.resolve(Is())},t}(),wu=function(){return function(){var t=this;this.promise=new Promise(function(e,n){t.resolve=e,t.reject=n})}}(),Eu=function(){function t(t,e,n){this.initialDelayMs=t,this.backoffFactor=e,this.maxDelayMs=n,this.reset()}return t.prototype.reset=function(){this.currentBaseMs=0},t.prototype.resetToMax=function(){this.currentBaseMs=this.maxDelayMs},t.prototype.backoffAndWait=function(){var t=new wu,e=this.currentBaseMs+this.jitterDelayMs();return this.currentBaseMs>0&&Si("ExponentialBackoff","Backing off for "+e+" ms (base delay: "+this.currentBaseMs+" ms)"),setTimeout(function(){t.resolve()},e),this.currentBaseMs*=this.backoffFactor,this.currentBaseMs<this.initialDelayMs&&(this.currentBaseMs=this.initialDelayMs),this.currentBaseMs>this.maxDelayMs&&(this.currentBaseMs=this.maxDelayMs),t.promise},t.prototype.jitterDelayMs=function(){return(Math.random()-.5)*this.currentBaseMs},t}();!function(t){t[t.Initial=0]="Initial",t[t.Auth=1]="Auth",t[t.Open=2]="Open",t[t.Error=3]="Error",t[t.Backoff=4]="Backoff",t[t.Stopped=5]="Stopped"}(uu||(uu={}));var Su=1e3,Cu=6e4,Tu=1.5,Iu=function(){function t(t,e,n,r){this.queue=t,this.connection=e,this.credentialsProvider=n,this.idle=!1,this.stream=null,this.listener=null,this.backoff=new Eu(r||Su,Tu,Cu),this.state=uu.Initial}return t.prototype.isStarted=function(){return this.state===uu.Backoff||this.state===uu.Auth||this.state===uu.Open},t.prototype.isOpen=function(){return this.state===uu.Open},t.prototype.start=function(t){this.state!==uu.Error?(ki(this.state===uu.Initial,"Already started"),this.listener=t,this.auth()):this.performBackoff(t)},t.prototype.stop=function(){this.isStarted()&&this.close(uu.Stopped)},t.prototype.inhibitBackoff=function(){ki(!this.isStarted(),"Can only inhibit backoff in a stopped state"),this.state=uu.Initial,this.backoff.reset()},t.prototype.markIdle=function(){var t=this;this.idle=!0,this.queue.schedule(function(){return t.handleIdleCloseTimer()},6e4).catch(function(t){ki(t.code===Oi.CANCELLED,"Received unexpected error in idle timeout closure. Expected CANCELLED, but was: "+t)})},t.prototype.sendRequest=function(t){this.cancelIdleCheck(),this.stream.send(t)},t.prototype.handleIdleCloseTimer=function(){return this.isOpen()&&this.idle?this.close(uu.Initial):Promise.resolve()},t.prototype.cancelIdleCheck=function(){this.idle=!1},t.prototype.close=function(t,e){ki(t===uu.Error||qo(e),"Can't provide an error when not in an error state."),this.cancelIdleCheck(),t!==uu.Error?this.backoff.reset():e&&e.code===Oi.RESOURCE_EXHAUSTED&&(Ci(e.toString()),Ci("Using maximum backoff delay to prevent overloading the backend."),this.backoff.resetToMax()),null!==this.stream&&(this.tearDown(),this.stream.close(),this.stream=null),this.state=t;var n=this.listener;return this.listener=null,t!==uu.Stopped?n.onClose(e):Promise.resolve()},t.prototype.tearDown=function(){},t.prototype.auth=function(){var t=this;ki(this.state===uu.Initial,"Must be in initial state to auth"),this.state=uu.Auth,this.credentialsProvider.getToken(!1).then(function(e){t.startStream(e)},function(e){t.queue.schedule(function(){if(t.state!==uu.Stopped){var n=new Pi(Oi.UNKNOWN,"Fetching auth token failed: "+e.message);return t.handleStreamClose(n)}return Promise.resolve()})})},t.prototype.startStream=function(t){var e=this;if(this.state!==uu.Stopped){ki(this.state===uu.Auth,"Trying to start stream in a non-auth state");var n=function(t,n){e.queue.schedule(function(){return e.stream===t?n():Promise.resolve()})};if(null!==this.listener){var r=this.startRpc(t);this.stream=r,this.stream.onOpen(function(){n(r,function(){return ki(e.state===uu.Auth,"Expected stream to be in state auth, but was "+e.state),e.state=uu.Open,e.listener.onOpen()})}),this.stream.onClose(function(t){n(r,function(){return e.handleStreamClose(t)})}),this.stream.onMessage(function(t){n(r,function(){return e.onMessage(t)})})}}},t.prototype.performBackoff=function(t){var e=this;ki(this.state===uu.Error,"Should only perform backoff in an error case"),this.state=uu.Backoff,this.backoff.backoffAndWait().then(function(){e.queue.schedule(function(){return e.state===uu.Stopped?Promise.resolve():(e.state=uu.Initial,e.start(t),ki(e.isStarted(),"PersistentStream should have started"),Promise.resolve())})})},t.prototype.handleStreamClose=function(t){return ki(this.isStarted(),"Can't handle server close on non-started stream"),Si("PersistentStream","close with error: "+t),this.stream=null,this.close(uu.Error,t)},t}(),ku=function(t){function e(e,n,r,i,o,s){var a=t.call(this,n,r,i,s)||this;return a.databaseInfo=e,a.serializer=o,a}return Object(i.__extends)(e,t),e.prototype.startRpc=function(t){return this.connection.openStream("Listen",t)},e.prototype.onMessage=function(t){this.backoff.reset();var e=this.serializer.fromWatchChange(t),n=this.serializer.versionFromListenResponse(t);return this.listener.onWatchChange(e,n)},e.prototype.watch=function(t){var e={};e.database=this.serializer.encodedDatabaseId,e.addTarget=this.serializer.toTarget(t);var n=this.serializer.toListenRequestLabels(t);n&&(e.labels=n),this.sendRequest(e)},e.prototype.unwatch=function(t){var e={};e.database=this.serializer.encodedDatabaseId,e.removeTarget=t,this.sendRequest(e)},e}(Iu),xu=function(t){function e(e,n,r,i,o,s){var a=t.call(this,n,r,i,s)||this;return a.databaseInfo=e,a.serializer=o,a.handshakeComplete_=!1,a}return Object(i.__extends)(e,t),Object.defineProperty(e.prototype,"handshakeComplete",{get:function(){return this.handshakeComplete_},enumerable:!0,configurable:!0}),e.prototype.start=function(e){this.handshakeComplete_=!1,t.prototype.start.call(this,e)},e.prototype.tearDown=function(){this.handshakeComplete_&&this.writeMutations([])},e.prototype.startRpc=function(t){return this.connection.openStream("Write",t)},e.prototype.onMessage=function(t){if(ki(!!t.streamToken,"Got a write response without a stream token"),this.lastStreamToken=t.streamToken,this.handshakeComplete_){this.backoff.reset();var e=this.serializer.fromWriteResults(t.writeResults),n=this.serializer.fromVersion(t.commitTime);return this.listener.onMutationResult(n,e)}return ki(!t.writeResults||0===t.writeResults.length,"Got mutation results for handshake"),this.handshakeComplete_=!0,this.listener.onHandshakeComplete()},e.prototype.writeHandshake=function(){ki(this.isOpen(),"Writing handshake requires an opened stream"),ki(!this.handshakeComplete_,"Handshake already completed");var t={};t.database=this.serializer.encodedDatabaseId,this.sendRequest(t)},e.prototype.writeMutations=function(t){var e=this;ki(this.isOpen(),"Writing mutations requires an opened stream"),ki(this.handshakeComplete_,"Handshake must be complete before writing mutations"),ki(this.lastStreamToken.length>0,"Trying to write mutation without a token");var n={streamToken:this.lastStreamToken,writes:t.map(function(t){return e.serializer.toMutation(t)})};this.sendRequest(n)},e}(Iu),Au=function(){function t(t,e,n,r,i,o){this.databaseInfo=t,this.queue=e,this.connection=n,this.credentials=r,this.serializer=i,this.initialBackoffDelay=o}return t.prototype.newPersistentWriteStream=function(){return new xu(this.databaseInfo,this.queue,this.connection,this.credentials,this.serializer,this.initialBackoffDelay)},t.prototype.newPersistentWatchStream=function(){return new ku(this.databaseInfo,this.queue,this.connection,this.credentials,this.serializer,this.initialBackoffDelay)},t.prototype.commit=function(t){var e=this,n={database:this.serializer.encodedDatabaseId,writes:t.map(function(t){return e.serializer.toMutation(t)})};return this.invokeRPC("Commit",n).then(function(t){return e.serializer.fromWriteResults(t.writeResults)})},t.prototype.lookup=function(t){var e=this,n={database:this.serializer.encodedDatabaseId,documents:t.map(function(t){return e.serializer.toName(t)})};return this.invokeStreamingRPC("BatchGetDocuments",n).then(function(n){var r=bs();n.forEach(function(t){var n=e.serializer.fromMaybeDocument(t);r=r.insert(n.key,n)});var i=[];return t.forEach(function(t){var e=r.get(t);ki(!!e,"Missing entity in write response for "+t),i.push(e)}),i})},t.prototype.invokeRPC=function(t,e){var n=this;return this.credentials.getToken(!1).then(function(r){return n.connection.invokeRPC(t,e,r)})},t.prototype.invokeStreamingRPC=function(t,e){var n=this;return this.credentials.getToken(!1).then(function(r){return n.connection.invokeStreamingRPC(t,e,r)})},t}(),Ou=function(){function t(t){this.datastore=t,this.readVersions=Cs(),this.mutations=[],this.committed=!1}return t.prototype.recordVersion=function(t){var e=t.version;t instanceof mo&&(e=ns.forDeletedDoc());var n=this.readVersions.get(t.key);if(null!==n){if(!e.isEqual(n))throw new Pi(Oi.ABORTED,"Document version changed between two reads.")}else this.readVersions=this.readVersions.insert(t.key,e)},t.prototype.lookup=function(t){var e=this;return this.committed?Promise.reject("Transaction has already completed."):this.mutations.length>0?Promise.reject("Transactions lookups are invalid after writes."):this.datastore.lookup(t).then(function(t){return t.forEach(function(t){return e.recordVersion(t)}),t})},t.prototype.write=function(t){if(this.committed)throw new Pi(Oi.FAILED_PRECONDITION,"Transaction has already completed.");this.mutations=this.mutations.concat(t)},t.prototype.precondition=function(t){var e=this.readVersions.get(t);return e?ls.updateTime(e):ls.NONE},t.prototype.preconditionForUpdate=function(t){var e=this.readVersions.get(t);if(e&&e.isEqual(ns.forDeletedDoc()))throw new Pi(Oi.FAILED_PRECONDITION,"Can't update a document that doesn't exist.");return e?ls.updateTime(e):ls.exists(!0)},t.prototype.set=function(t,e){this.write(e.toMutations(t,this.precondition(t)))},t.prototype.update=function(t,e){this.write(e.toMutations(t,this.preconditionForUpdate(t)))},t.prototype.delete=function(t){this.write([new ds(t,this.precondition(t))]),this.readVersions=this.readVersions.insert(t,ns.forDeletedDoc())},t.prototype.commit=function(){var t=this,e=this.readVersions;return this.mutations.forEach(function(t){e=e.remove(t.key)}),e.isEmpty()?this.datastore.commit(this.mutations).then(function(){t.committed=!0}):Promise.reject(Error("Every document read in a transaction must also be written."))},t}(),Pu=function(){function t(t,e,n){this.localStore=t,this.datastore=e,this.onlineStateHandler=n,this.pendingWrites=[],this.lastBatchSeen=wa,this.listenTargets={},this.pendingTargetResponses={},this.accumulatedWatchChanges=[],this.watchStream=null,this.writeStream=null,this.watchStreamOnlineState=Zs.Unknown,this.watchStreamFailures=0,this.shouldWarnOffline=!0}return t.prototype.start=function(){return this.enableNetwork()},t.prototype.updateOnlineState=function(t){t!==this.watchStreamOnlineState&&(t===Zs.Healthy?this.shouldWarnOffline=!1:t===Zs.Unknown&&(this.watchStreamFailures=0),this.watchStreamOnlineState=t,this.onlineStateHandler(t))},t.prototype.updateOnlineStateAfterFailure=function(){this.watchStreamOnlineState===Zs.Healthy?this.updateOnlineState(Zs.Unknown):(this.watchStreamFailures++,this.watchStreamFailures>=2&&(this.shouldWarnOffline&&(Ci("Could not reach Firestore backend."),this.shouldWarnOffline=!1),this.updateOnlineState(Zs.Failed)))},t.prototype.isNetworkEnabled=function(){return ki(null==this.watchStream==(null==this.writeStream),"WatchStream and WriteStream should both be null or non-null"),null!=this.watchStream},t.prototype.enableNetwork=function(){var t=this;return this.isNetworkEnabled()?Promise.resolve():(this.watchStream=this.datastore.newPersistentWatchStream(),this.writeStream=this.datastore.newPersistentWriteStream(),this.localStore.getLastStreamToken().then(function(e){return t.writeStream.lastStreamToken=e,t.shouldStartWatchStream()&&t.startWatchStream(),t.updateOnlineState(Zs.Unknown),t.fillWritePipeline()}))},t.prototype.disableNetwork=function(){return this.disableNetworkInternal(),this.updateOnlineState(Zs.Failed),Promise.resolve()},t.prototype.disableNetworkInternal=function(){this.isNetworkEnabled()&&(this.watchStream.stop(),this.writeStream.stop(),this.cleanUpWatchStreamState(),this.cleanUpWriteStreamState(),this.writeStream=null,this.watchStream=null)},t.prototype.shutdown=function(){return Si("RemoteStore","RemoteStore shutting down."),this.disableNetworkInternal(),this.updateOnlineState(Zs.Unknown),Promise.resolve()},t.prototype.listen=function(t){ki(!Ri(this.listenTargets,t.targetId),"listen called with duplicate targetId!"),this.listenTargets[t.targetId]=t,this.shouldStartWatchStream()?this.startWatchStream():this.isNetworkEnabled()&&this.watchStream.isOpen()&&this.sendWatchRequest(t)},t.prototype.unlisten=function(t){ki(Ri(this.listenTargets,t),"unlisten called without assigned target ID!"),delete this.listenTargets[t],this.isNetworkEnabled()&&this.watchStream.isOpen()&&(this.sendUnwatchRequest(t),Vi(this.listenTargets)&&this.watchStream.markIdle())},t.prototype.sendWatchRequest=function(t){this.recordPendingTargetRequest(t.targetId),this.watchStream.watch(t)},t.prototype.sendUnwatchRequest=function(t){this.recordPendingTargetRequest(t),this.watchStream.unwatch(t)},t.prototype.recordPendingTargetRequest=function(t){this.pendingTargetResponses[t]=(this.pendingTargetResponses[t]||0)+1},t.prototype.startWatchStream=function(){ki(this.shouldStartWatchStream(),"startWriteStream() called when shouldStartWatchStream() is false."),this.watchStream.start({onOpen:this.onWatchStreamOpen.bind(this),onClose:this.onWatchStreamClose.bind(this),onWatchChange:this.onWatchStreamChange.bind(this)})},t.prototype.shouldStartWatchStream=function(){return this.isNetworkEnabled()&&!this.watchStream.isStarted()&&!Vi(this.listenTargets)},t.prototype.cleanUpWatchStreamState=function(){this.accumulatedWatchChanges=[],this.pendingTargetResponses={}},t.prototype.onWatchStreamOpen=function(){var t=this;return Di(this.listenTargets,function(e,n){t.sendWatchRequest(n)}),Promise.resolve()},t.prototype.onWatchStreamClose=function(t){return ki(this.isNetworkEnabled(),"onWatchStreamClose() should only be called when the network is enabled"),this.cleanUpWatchStreamState(),this.shouldStartWatchStream()?(this.updateOnlineStateAfterFailure(),this.startWatchStream()):this.updateOnlineState(Zs.Unknown),Promise.resolve()},t.prototype.onWatchStreamChange=function(t,e){if(this.updateOnlineState(Zs.Healthy),t instanceof Ms&&t.state===Ds.Removed&&t.cause)return this.handleTargetError(t);if(this.accumulatedWatchChanges.push(t),!e.isEqual(ns.MIN)&&e.compareTo(this.localStore.getLastRemoteSnapshotVersion())>=0){var n=this.accumulatedWatchChanges;return this.accumulatedWatchChanges=[],this.handleWatchChangeBatch(e,n)}return Promise.resolve()},t.prototype.handleWatchChangeBatch=function(t,e){var n=this,r=new Vs(t,this.listenTargets,this.pendingTargetResponses);r.addChanges(e);var i=r.createRemoteEvent();this.pendingTargetResponses=r.pendingTargetResponses;var o=[];return Di(r.existenceFilters,function(e,r){var s=n.listenTargets[e];if(s){var a=s.query;if(a.isDocumentQuery())if(0===r.count){var u=new po(a.path),l=new mo(u,t);i.addDocumentUpdate(l)}else ki(1===r.count,"Single document existence filter with count: "+r.count);else{var c=n.localStore.remoteDocumentKeys(e).then(function(t){if(i.targetChanges[e]){var o=i.targetChanges[e].mapping;null!==o&&(o instanceof Ps?t=o.applyToKeySet(t):(ki(o instanceof Os,"Expected either reset or update mapping but got something else: "+o),t=o.documents))}if(t.size!==r.count){i.handleExistenceFilterMismatch(e);var u=new is(a,e,s.purpose);n.listenTargets[e]=u,n.sendUnwatchRequest(e);var l=new is(a,e,Ho.ExistenceFilterMismatch);n.sendWatchRequest(l)}});o.push(c)}}}),Promise.all(o).then(function(){return Di(i.targetChanges,function(t,e){if(e.resumeToken.length>0){var r=n.listenTargets[t];r&&(n.listenTargets[t]=r.update({resumeToken:e.resumeToken,snapshotVersion:e.snapshotVersion}))}}),n.syncEngine.applyRemoteEvent(i)})},t.prototype.handleTargetError=function(t){var e=this;ki(!!t.cause,"Handling target error without a cause");var n=t.cause,r=Promise.resolve();return t.targetIds.forEach(function(t){r=r.then(function(){return Ri(e.listenTargets,t)?(delete e.listenTargets[t],e.syncEngine.rejectListen(t,n)):Promise.resolve()})}),r},t.prototype.cleanUpWriteStreamState=function(){this.lastBatchSeen=wa,Si("RemoteStore","Stopping write stream with "+this.pendingWrites.length+" pending writes"),this.pendingWrites=[]},t.prototype.fillWritePipeline=function(){var t=this;return this.canWriteMutations()?this.localStore.nextMutationBatch(this.lastBatchSeen).then(function(e){return null===e?(0===t.pendingWrites.length&&t.writeStream.markIdle(),Promise.resolve()):(t.commit(e),t.fillWritePipeline())}):Promise.resolve()},t.prototype.canWriteMutations=function(){return this.isNetworkEnabled()&&this.pendingWrites.length<10},t.prototype.outstandingWrites=function(){return this.pendingWrites.length},t.prototype.commit=function(t){ki(this.canWriteMutations(),"commit called when batches can't be written"),this.lastBatchSeen=t.batchId,this.pendingWrites.push(t),this.shouldStartWriteStream()?this.startWriteStream():this.isNetworkEnabled()&&this.writeStream.handshakeComplete&&this.writeStream.writeMutations(t.mutations)},t.prototype.shouldStartWriteStream=function(){return this.isNetworkEnabled()&&!this.writeStream.isStarted()&&this.pendingWrites.length>0},t.prototype.startWriteStream=function(){ki(this.shouldStartWriteStream(),"startWriteStream() called when shouldStartWriteStream() is false."),this.writeStream.start({onOpen:this.onWriteStreamOpen.bind(this),onClose:this.onWriteStreamClose.bind(this),onHandshakeComplete:this.onWriteHandshakeComplete.bind(this),onMutationResult:this.onMutationResult.bind(this)})},t.prototype.onWriteStreamOpen=function(){return this.writeStream.writeHandshake(),Promise.resolve()},t.prototype.onWriteHandshakeComplete=function(){var t=this;return this.localStore.setLastStreamToken(this.writeStream.lastStreamToken).then(function(){for(var e=0,n=t.pendingWrites;e<n.length;e++)t.writeStream.writeMutations(n[e].mutations)})},t.prototype.onMutationResult=function(t,e){var n=this;ki(this.pendingWrites.length>0,"Got result for empty pending writes");var r=this.pendingWrites.shift(),i=Sa.from(r,t,e,this.writeStream.lastStreamToken);return this.syncEngine.applySuccessfulWrite(i).then(function(){return n.fillWritePipeline()})},t.prototype.onWriteStreamClose=function(t){var e=this;return ki(this.isNetworkEnabled(),"onWriteStreamClose() should only be called when the network is enabled"),t&&this.pendingWrites.length>0?(ki(!!t,"We have pending writes, but the write stream closed without an error"),(this.writeStream.handshakeComplete?this.handleWriteError(t):this.handleHandshakeError(t)).then(function(){e.shouldStartWriteStream()&&e.startWriteStream()})):Promise.resolve()},t.prototype.handleHandshakeError=function(t){return ms(t.code)||t.code===Oi.ABORTED?(Si("RemoteStore","RemoteStore error before completed handshake; resetting stream token: ",this.writeStream.lastStreamToken),this.writeStream.lastStreamToken=Ai(),this.localStore.setLastStreamToken(Ai())):Promise.resolve()},t.prototype.handleWriteError=function(t){var e=this;if(ms(t.code)){var n=this.pendingWrites.shift();return this.writeStream.inhibitBackoff(),this.syncEngine.rejectFailedWrite(n.batchId,t).then(function(){return e.fillWritePipeline()})}return Promise.resolve()},t.prototype.createTransaction=function(){return new Ou(this.datastore)},t.prototype.handleUserChange=function(t){if(Si("RemoteStore","RemoteStore changing users: uid=",t.uid),this.isNetworkEnabled())return this.disableNetworkInternal(),this.updateOnlineState(Zs.Unknown),this.enableNetwork()},t}(),Nu=function(){function t(t,e,n,r){this.platform=t,this.databaseInfo=e,this.credentials=n,this.asyncQueue=r}return t.prototype.start=function(t){var e=this,n=new wu,r=new wu,i=!1;return this.credentials.setUserChangeListener(function(o){i?e.asyncQueue.schedule(function(){return e.handleUserChange(o)}):(i=!0,e.initializePersistence(t,r).then(function(){return e.initializeRest(o)}).then(n.resolve,n.reject))}),this.asyncQueue.schedule(function(){return n.promise}),r.promise},t.prototype.enableNetwork=function(){var t=this;return this.asyncQueue.schedule(function(){return t.remoteStore.enableNetwork()})},t.prototype.initializePersistence=function(t,e){var n=this;return t?this.startIndexedDbPersistence().then(e.resolve).catch(function(t){return e.reject(t),n.canFallback(t)?(console.warn("Error enabling offline storage. Falling back to storage disabled: "+t),n.startMemoryPersistence()):Promise.reject(t)}):(e.resolve(),this.startMemoryPersistence())},t.prototype.canFallback=function(t){return t.code===Oi.FAILED_PRECONDITION||t.code===Oi.UNIMPLEMENTED},t.prototype.startIndexedDbPersistence=function(){this.garbageCollector=new bu;var t=hu.buildStoragePrefix(this.databaseInfo),e=new Ks(this.databaseInfo.databaseId,{useProto3Json:!0});return this.persistence=new hu(t,e),this.persistence.start()},t.prototype.startMemoryPersistence=function(){return this.garbageCollector=new ca,this.persistence=new vu,this.persistence.start()},t.prototype.initializeRest=function(t){var e=this;return this.platform.loadConnection(this.databaseInfo).then(function(n){e.localStore=new du(e.persistence,t,e.garbageCollector);var r=e.platform.newSerializer(e.databaseInfo.databaseId),i=new Au(e.databaseInfo,e.asyncQueue,n,e.credentials,r);return e.remoteStore=new Pu(e.localStore,i,function(t){e.syncEngine.applyOnlineStateChange(t),e.eventMgr.applyOnlineStateChange(t)}),e.syncEngine=new ba(e.localStore,e.remoteStore,t),e.remoteStore.syncEngine=e.syncEngine,e.eventMgr=new aa(e.syncEngine),e.localStore.start()}).then(function(){return e.remoteStore.start()})},t.prototype.handleUserChange=function(t){return this.asyncQueue.verifyOperationInProgress(),Si("FirestoreClient","User Changed: "+t.uid),this.syncEngine.handleUserChange(t)},t.prototype.disableNetwork=function(){var t=this;return this.asyncQueue.schedule(function(){return t.remoteStore.disableNetwork()})},t.prototype.shutdown=function(){var t=this;return this.asyncQueue.schedule(function(){return t.credentials.removeUserChangeListener(),t.remoteStore.shutdown()}).then(function(){return t.persistence.shutdown()})},t.prototype.listen=function(t,e,n){var r=this,i=new ua(t,e,n);return this.asyncQueue.schedule(function(){return r.eventMgr.listen(i)}),i},t.prototype.unlisten=function(t){var e=this;this.asyncQueue.schedule(function(){return e.eventMgr.unlisten(t)})},t.prototype.write=function(t){var e=this,n=new wu;return this.asyncQueue.schedule(function(){return e.syncEngine.write(t,n)}),n.promise},t.prototype.databaseId=function(){return this.databaseInfo.databaseId},t.prototype.transaction=function(t){var e=this;return this.asyncQueue.schedule(function(){return Promise.resolve()}).then(function(){return e.syncEngine.runTransaction(t)})},t}(),Ru=function(){function t(t){this.observer=t,this.muted=!1}return t.prototype.next=function(t){this.scheduleEvent(this.observer.next,t)},t.prototype.error=function(t){this.scheduleEvent(this.observer.error,t)},t.prototype.mute=function(){this.muted=!0},t.prototype.scheduleEvent=function(t,e){var n=this;this.muted||setTimeout(function(){n.muted||t(e)},0)},t}(),Du=function(){function t(){this.tail=Promise.resolve(),this.delayedOperations=[],this.delayedOperationsCount=0,this.operationInProgress=!1}return t.prototype.schedule=function(t,e){var n=this;if(this.failure&&Ii("AsyncQueue is already failed: "+(this.failure.stack||this.failure.message)),(e||0)>0){this.delayedOperationsCount++;var r={handle:null,op:t,deferred:new wu};return r.handle=setTimeout(function(){n.scheduleInternal(function(){return r.op().then(function(t){r.deferred.resolve(t)})}),r.handle=null,n.delayedOperationsCount--,0===n.delayedOperationsCount&&(n.delayedOperations=[])},e),this.delayedOperations.push(r),r.deferred.promise}return this.scheduleInternal(t)},t.prototype.scheduleInternal=function(t){var e=this;return this.tail=this.tail.then(function(){return e.operationInProgress=!0,t().catch(function(t){e.failure=t,e.operationInProgress=!1;var n=t.stack||t.message||"";throw Ci("INTERNAL UNHANDLED ERROR: ",n),n.indexOf("Firestore Test Simulated Error")<0&&setTimeout(function(){throw t},0),t}).then(function(){e.operationInProgress=!1})}),this.tail},t.prototype.verifyOperationInProgress=function(){ki(this.operationInProgress,"verifyOpInProgress() called when no op in progress on this queue.")},t.prototype.drain=function(t){var e=this;return this.delayedOperations.forEach(function(n){n.handle&&(clearTimeout(n.handle),t?e.scheduleInternal(n.op).then(n.deferred.resolve,n.deferred.reject):n.deferred.reject(new Pi(Oi.CANCELLED,"Operation cancelled by shutdown")))}),this.delayedOperations=[],this.delayedOperationsCount=0,this.schedule(function(){return Promise.resolve()})},t}(),Mu=function(){function t(t){this.uid=t}return t.prototype.isUnauthenticated=function(){return null==this.uid},t.prototype.toKey=function(){return this.isUnauthenticated()?"anonymous-user":"uid:"+this.uid},t.prototype.isEqual=function(t){return t.uid===this.uid},t.UNAUTHENTICATED=new t(null),t.GOOGLE_CREDENTIALS=new t("google-credentials-uid"),t.FIRST_PARTY=new t("first-party-uid"),t}(),Vu=function(){function t(){this.userListener=null}return t.prototype.getToken=function(t){return Promise.resolve(null)},t.prototype.setUserChangeListener=function(t){ki(!this.userListener,"Can only call setUserChangeListener() once."),this.userListener=t,t(Mu.UNAUTHENTICATED)},t.prototype.removeUserChangeListener=function(){ki(null!==this.userListener,"removeUserChangeListener() when no listener registered"),this.userListener=null},t}(),Fu=function(){function t(t){var e=this;this.app=t,this.tokenListener=null,this.userCounter=0,this.userListener=null,this.tokenListener=function(){var t=e.getUser();e.currentUser&&t.isEqual(e.currentUser)||(e.currentUser=t,e.userCounter++,e.userListener&&e.userListener(e.currentUser))},this.userCounter=0,this.app.INTERNAL.addAuthTokenListener(this.tokenListener)}return t.prototype.getToken=function(t){var e=this;ki(null!=this.tokenListener,"getToken cannot be called after listener removed.");var n=this.userCounter;return this.app.INTERNAL.getToken(t).then(function(t){if(e.userCounter!==n)throw new Pi(Oi.ABORTED,"getToken aborted due to uid change.");return t?(ki("string"==typeof t.accessToken,"Invalid tokenData returned from getToken():"+t),new function(t,e){this.user=e,this.type="OAuth",this.authHeaders={Authorization:"Bearer "+t}}(t.accessToken,e.currentUser)):null})},t.prototype.setUserChangeListener=function(t){ki(!this.userListener,"Can only call setUserChangeListener() once."),this.userListener=t,this.currentUser&&t(this.currentUser)},t.prototype.removeUserChangeListener=function(){ki(null!=this.tokenListener,"removeUserChangeListener() called twice"),ki(null!==this.userListener,"removeUserChangeListener() called when no listener registered"),this.app.INTERNAL.removeAuthTokenListener(this.tokenListener),this.tokenListener=null,this.userListener=null},t.prototype.getUser=function(){"function"!=typeof this.app.INTERNAL.getUid&&Ii("This version of the Firestore SDK requires at least version 3.7.0 of firebase.js.");var t=this.app.INTERNAL.getUid();return ki(null===t||"string"==typeof t,"Received invalid UID: "+t),new Mu(t)},t}(),ju=function(){function t(t,e){this.gapi=t,this.sessionIndex=e,this.type="FirstParty",this.user=Mu.FIRST_PARTY,ki(this.gapi&&this.gapi.auth&&this.gapi.auth.getAuthHeaderValueForFirstParty,"unexpected gapi interface")}return Object.defineProperty(t.prototype,"authHeaders",{get:function(){return{Authorization:this.gapi.auth.getAuthHeaderValueForFirstParty([]),"X-Goog-AuthUser":this.sessionIndex}},enumerable:!0,configurable:!0}),t}(),Lu=function(){function t(t,e){this.gapi=t,this.sessionIndex=e,ki(this.gapi&&this.gapi.auth&&this.gapi.auth.getAuthHeaderValueForFirstParty,"unexpected gapi interface")}return t.prototype.getToken=function(t){return Promise.resolve(new ju(this.gapi,this.sessionIndex))},t.prototype.setUserChangeListener=function(t){t(Mu.FIRST_PARTY)},t.prototype.removeUserChangeListener=function(){},t}();function Uu(t){return function(t,e){if("object"!=typeof t||null===t)return!1;for(var n=t,r=0,i=["next","error","complete"];r<i.length;r++){var o=i[r];if(o in n&&"function"==typeof n[o])return!0}return!1}(t)}var Bu,qu=function(){function t(){}return t.delete=function(){return Hu.instance},t.serverTimestamp=function(){return Ku.instance},t.prototype.isEqual=function(t){return this===t},t}(),Hu=function(t){function e(){return t.call(this)||this}return Object(i.__extends)(e,t),e.instance=new e,e}(qu),Ku=function(t){function e(){return t.call(this)||this}return Object(i.__extends)(e,t),e.instance=new e,e}(qu),zu=Ni(qu,"Use FieldValue.<field>() instead."),Qu=/^__.*__$/,Gu=function(){function t(t,e,n){this.data=t,this.fieldMask=e,this.fieldTransforms=n}return t.prototype.toMutations=function(t,e){var n=[];return n.push(null!==this.fieldMask?new fs(t,this.data,this.fieldMask,e):new hs(t,this.data,e)),this.fieldTransforms.length>0&&n.push(new ps(t,this.fieldTransforms)),n},t}(),Wu=function(){function t(t,e,n){this.data=t,this.fieldMask=e,this.fieldTransforms=n}return t.prototype.toMutations=function(t,e){var n=[new fs(t,this.data,this.fieldMask,e)];return this.fieldTransforms.length>0&&n.push(new ps(t,this.fieldTransforms)),n},t}();function Yu(t){switch(t){case Bu.Set:case Bu.MergeSet:case Bu.Update:return!0;case Bu.QueryValue:return!1;default:throw Ii("Unexpected case for UserDataSource: "+t)}}!function(t){t[t.Set=0]="Set",t[t.Update=1]="Update",t[t.MergeSet=2]="MergeSet",t[t.QueryValue=3]="QueryValue"}(Bu||(Bu={}));var Ju=function(){function t(t,e,n,r,i,o){this.dataSource=t,this.methodName=e,this.path=n,this.arrayElement=r,void 0===i&&this.validatePath(),this.arrayElement=void 0!==r&&r,this.fieldTransforms=i||[],this.fieldMask=o||[]}return t.prototype.childContextForField=function(e){var n=null==this.path?null:this.path.child(e),r=new t(this.dataSource,this.methodName,n,!1,this.fieldTransforms,this.fieldMask);return r.validatePathSegment(e),r},t.prototype.childContextForFieldPath=function(e){var n=null==this.path?null:this.path.child(e),r=new t(this.dataSource,this.methodName,n,!1,this.fieldTransforms,this.fieldMask);return r.validatePath(),r},t.prototype.childContextForArray=function(e){return new t(this.dataSource,this.methodName,null,!0,this.fieldTransforms,this.fieldMask)},t.prototype.createError=function(t){var e=null===this.path||this.path.isEmpty()?"":" (found in field "+this.path.toString()+")";return new Pi(Oi.INVALID_ARGUMENT,"Function "+this.methodName+"() called with invalid data. "+t+e)},t.prototype.validatePath=function(){if(null!==this.path)for(var t=0;t<this.path.length;t++)this.validatePathSegment(this.path.get(t))},t.prototype.validatePathSegment=function(t){if(Yu(this.dataSource)&&Qu.test(t))throw this.createError("Document fields cannot begin and end with __")},t.prototype.isWrite=function(){return this.dataSource===Bu.Set||this.dataSource===Bu.Update},t}(),Xu=function(t,e){this.databaseId=t,this.key=e},Zu=function(){function t(t){this.preConverter=t}return t.prototype.parseSetData=function(t,e){var n=new Ju(Bu.Set,t,fo.EMPTY_PATH);tl("Data must be an object, but it was:",n,e);var r=this.parseData(e,n);return new Gu(r,null,n.fieldTransforms)},t.prototype.parseMergeData=function(t,e){var n=new Ju(Bu.MergeSet,t,fo.EMPTY_PATH);tl("Data must be an object, but it was:",n,e);var r=this.parseData(e,n),i=new os(n.fieldMask);return new Gu(r,i,n.fieldTransforms)},t.prototype.parseUpdateData=function(t,e){var n=this,r=new Ju(Bu.Update,t,fo.EMPTY_PATH);tl("Data must be an object, but it was:",r,e);var i=[],o=Vo.EMPTY;Mi(e,function(e,s){var a=nl(t,e),u=r.childContextForFieldPath(a);if((s=n.runPreConverter(s,u))instanceof Hu)i.push(a);else{var l=n.parseData(s,u);null!=l&&(i.push(a),o=o.set(a,l))}});var s=new os(i);return new Wu(o,s,r.fieldTransforms)},t.prototype.parseUpdateVarargs=function(t,e,n,r){var i=new Ju(Bu.Update,t,fo.EMPTY_PATH),o=[el(t,e)],s=[n];if(r.length%2!=0)throw new Pi(Oi.INVALID_ARGUMENT,"Function "+t+"() needs to be called with an even number of arguments that alternate between field names and values.");for(var a=0;a<r.length;a+=2)o.push(el(t,r[a])),s.push(r[a+1]);var u=[],l=Vo.EMPTY;for(a=0;a<o.length;++a){var c=o[a],h=i.childContextForFieldPath(c),f=this.runPreConverter(s[a],h);if(f instanceof Hu)u.push(c);else{var p=this.parseData(f,h);null!=p&&(u.push(c),l=l.set(c,p))}}var d=new os(u);return new Wu(l,d,i.fieldTransforms)},t.prototype.parseQueryValue=function(t,e){var n=new Ju(Bu.QueryValue,t,fo.EMPTY_PATH),r=this.parseData(e,n);return ki(null!=r,"Parsed data should not be null."),ki(0===n.fieldTransforms.length,"Field transforms should have been disallowed."),r},t.prototype.runPreConverter=function(t,e){try{return this.preConverter(t)}catch(t){var n=rl(t);throw e.createError(n)}},t.prototype.parseData=function(t,e){if((t=this.runPreConverter(t,e))instanceof Array){if(e.arrayElement)throw e.createError("Nested arrays are not supported");return e.path&&e.fieldMask.push(e.path),this.parseArray(t,e)}return $u(t)?(tl("Unsupported field value:",e,t),this.parseObject(t,e)):(e.path&&e.fieldMask.push(e.path),this.parseScalarValue(t,e))},t.prototype.parseArray=function(t,e){for(var n=[],r=0,i=0,o=t;i<o.length;i++){var s=this.parseData(o[i],e.childContextForArray(r));null==s&&(s=Co.INSTANCE),n.push(s),r++}return new Fo(n)},t.prototype.parseObject=function(t,e){var n=this,r=new go(to);return Mi(t,function(t,i){var o=n.parseData(i,e.childContextForField(t));null!=o&&(r=r.insert(t,o))}),new Vo(r)},t.prototype.parseScalarValue=function(t,e){if(null===t)return Co.INSTANCE;if("number"==typeof t)return function(t){return Bo(t)&&t<=Uo&&t>=Lo}(t)?new xo(t):new Ao(t);if("boolean"==typeof t)return To.of(t);if("string"==typeof t)return new Oo(t);if(t instanceof Date)return new Po(es.fromDate(t));if(t instanceof so)return new Mo(t);if(t instanceof io)return new Ro(t);if(t instanceof Xu)return new Do(t.databaseId,t.key);if(t instanceof qu){if(t instanceof Hu){if(e.dataSource===Bu.MergeSet)return null;throw e.dataSource===Bu.Update?(ki(null==e.path||e.path.length>0,"FieldValue.delete() at the top level should have already been handled."),e.createError("FieldValue.delete() can only appear at the top level of your update data")):e.createError("FieldValue.delete() can only be used with update() and set() with {merge:true}")}if(t instanceof Ku){if(!Yu(e.dataSource))throw e.createError("FieldValue.serverTimestamp() can only be used with set() and update()");if(null===e.path)throw e.createError("FieldValue.serverTimestamp() is not currently supported inside arrays");return e.fieldTransforms.push(new as(e.path,ss.instance)),null}return Ii("Unknown FieldValue type: "+t)}throw e.createError("Unsupported field value: "+Gi(t))},t}();function $u(t){return!("object"!=typeof t||null===t||t instanceof Array||t instanceof Date||t instanceof so||t instanceof io||t instanceof Xu||t instanceof qu)}function tl(t,e,n){if(!$u(n)||!Qi(n)){var r=Gi(n);throw e.createError("an object"===r?t+" a custom object":t+" "+r)}}function el(t,e){if(e instanceof $s)return e._internalPath;if("string"==typeof e)return nl(t,e);throw new Pi(Oi.INVALID_ARGUMENT,"Function "+t+"() called with invalid data. Field path arguments must be of type string or FieldPath.")}function nl(t,e){try{return function(t){if(t.search(ta)>=0)throw new Pi(Oi.INVALID_ARGUMENT,"Invalid field path ("+t+"). Paths must not contain '~', '*', '/', '[', or ']'");try{return new($s.bind.apply($s,[void 0].concat(t.split("."))))}catch(e){throw new Pi(Oi.INVALID_ARGUMENT,"Invalid field path ("+t+"). Paths must not be empty, begin with '.', end with '.', or contain '..'")}}(e)._internalPath}catch(e){var n=rl(e);throw new Pi(Oi.INVALID_ARGUMENT,"Function "+t+"() called with invalid data. "+n)}}function rl(t){return t instanceof Error?t.message:t.toString()}var il="firestore.googleapis.com",ol=!0,sl=function(){function t(t){if(void 0===t.host){if(void 0!==t.ssl)throw new Pi(Oi.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host=il,this.ssl=ol}else Hi("settings","string","host",t.host),this.host=t.host,Ki("settings","boolean","ssl",t.ssl),this.ssl=void 0!==(e=t.ssl)?e:ol;var e;Yi("settings",t,["host","ssl","credentials"]),Ki("settings","object","credentials",t.credentials),this.credentials=t.credentials}return t.prototype.isEqual=function(t){return this.host===t.host&&this.ssl===t.ssl&&this.credentials===t.credentials},t}(),al=function(){},ul=function(){function t(e){var n=this;this._queue=new Du,this.INTERNAL={delete:function(){return n._firestoreClient?n._firestoreClient.shutdown():Promise.resolve()},drainAsyncQueue:function(t){return n._queue.drain(t)}};var r=new al;if("object"==typeof e.options){var i=e;r.firebaseApp=i,r.databaseId=t.databaseIdFromApp(i),r.persistenceKey=r.firebaseApp.name,r.credentials=new Fu(i)}else{var o=e;if(!o.projectId)throw new Pi(Oi.INVALID_ARGUMENT,"Must provide projectId");r.databaseId=new uo(o.projectId,o.database),r.persistenceKey="[DEFAULT]",r.credentials=new Vu}r.settings=new sl({}),this._config=r,this._databaseId=r.databaseId}return t.prototype.settings=function(t){if(ji("Firestore.settings",arguments,1),Bi("Firestore.settings","object",1,t),Ri(t,"persistence"))throw new Pi(Oi.INVALID_ARGUMENT,'"persistence" is now specified with a separate call to firestore.enablePersistence().');var e=new sl(t);if(this._firestoreClient&&!this._config.settings.isEqual(e))throw new Pi(Oi.FAILED_PRECONDITION,"Firestore has already been started and its settings can no longer be changed. You can only call settings() before calling any other methods on a Firestore object.");this._config.settings=e,void 0!==e.credentials&&(this._config.credentials=function(t){if(!t)return new Vu;switch(t.type){case"gapi":return new Lu(t.client,t.sessionIndex||"0");case"provider":return t.client;default:throw new Pi(Oi.INVALID_ARGUMENT,"makeCredentialsProvider failed due to invalid credential type")}}(e.credentials))},t.prototype.enableNetwork=function(){return this.ensureClientConfigured(),this._firestoreClient.enableNetwork()},t.prototype.disableNetwork=function(){return this.ensureClientConfigured(),this._firestoreClient.disableNetwork()},t.prototype.enablePersistence=function(){if(this._firestoreClient)throw new Pi(Oi.FAILED_PRECONDITION,"Firestore has already been started and persistence can no longer be enabled. You can only call enablePersistence() before calling any other methods on a Firestore object.");return this.configureClient(!0)},t.prototype.ensureClientConfigured=function(){return this._firestoreClient||this.configureClient(!1),this._firestoreClient},t.prototype.configureClient=function(t){var e=this;ki(!!this._config.settings.host,"FirestoreSettings.host cannot be falsey"),ki(!this._firestoreClient,"configureClient() called multiple times");var n=new function(t,e,n,r){this.databaseId=t,this.persistenceKey=e,this.host=n,this.ssl=r}(this._config.databaseId,this._config.persistenceKey,this._config.settings.host,this._config.settings.ssl);return this._dataConverter=new Zu(function(t){if(t instanceof hl){var n=e._config.databaseId,r=t.firestore._config.databaseId;if(!r.isEqual(n))throw new Pi(Oi.INVALID_ARGUMENT,"Document reference is for database "+r.projectId+"/"+r.database+" but should be for database "+n.projectId+"/"+n.database);return new Xu(e._config.databaseId,t._key)}return t}),this._firestoreClient=new Nu(xi.getPlatform(),n,this._config.credentials,this._queue),this._firestoreClient.start(t)},t.databaseIdFromApp=function(t){var e=t.options;if(!Ri(e,"projectId")){if(Ri(e,"firestoreId"))throw new Pi(Oi.INVALID_ARGUMENT,'"firestoreId" is now specified as "projectId" in firebase.initializeApp.');throw new Pi(Oi.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.')}if(Ri(e,"firestoreOptions"))throw new Pi(Oi.INVALID_ARGUMENT,'"firestoreOptions" values are now specified with Firestore.settings()');var n=e.projectId;if(!n||"string"!=typeof n)throw new Pi(Oi.INVALID_ARGUMENT,"projectId must be a string in FirebaseApp.options");return new uo(n)},Object.defineProperty(t.prototype,"app",{get:function(){if(!this._config.firebaseApp)throw new Pi(Oi.FAILED_PRECONDITION,"Firestore was not initialized using the Firebase SDK. 'app' is not available");return this._config.firebaseApp},enumerable:!0,configurable:!0}),t.prototype.collection=function(t){if(ji("Firestore.collection",arguments,1),Bi("Firestore.collection","string",1,t),!t)throw new Pi(Oi.INVALID_ARGUMENT,"Must provide a non-empty collection path to collection()");return this.ensureClientConfigured(),new gl(co.fromString(t),this)},t.prototype.doc=function(t){if(ji("Firestore.doc",arguments,1),Bi("Firestore.doc","string",1,t),!t)throw new Pi(Oi.INVALID_ARGUMENT,"Must provide a non-empty document path to doc()");return this.ensureClientConfigured(),hl.forPath(co.fromString(t),this)},t.prototype.runTransaction=function(t){var e=this;return ji("Firestore.runTransaction",arguments,1),Bi("Firestore.runTransaction","function",1,t),this.ensureClientConfigured().transaction(function(n){return t(new ll(e,n))})},t.prototype.batch=function(){return this.ensureClientConfigured(),new cl(this)},Object.defineProperty(t,"logLevel",{get:function(){switch(wi()){case _i.DEBUG:return"debug";case _i.ERROR:return"error";case _i.SILENT:return"silent";default:return Ii("Unknown log level: "+wi())}},enumerable:!0,configurable:!0}),t.setLogLevel=function(t){switch(ji("Firestore.setLogLevel",arguments,1),Bi("Firestore.setLogLevel","string",1,t),t){case"debug":Ei(_i.DEBUG);break;case"error":Ei(_i.ERROR);break;case"silent":Ei(_i.SILENT);break;default:throw new Pi(Oi.INVALID_ARGUMENT,"Invalid log level: "+t)}},t}(),ll=function(){function t(t,e){this._firestore=t,this._transaction=e}return t.prototype.get=function(t){var e=this;ji("Transaction.get",arguments,1);var n=bl("Transaction.get",t,this._firestore);return this._transaction.lookup([n._key]).then(function(t){if(!t||1!==t.length)return Ii("Mismatch in docs returned from document lookup.");var r=t[0];return new pl(e._firestore,n._key,r instanceof mo?null:r,!1)})},t.prototype.set=function(t,e,n){Ui("Transaction.set",arguments,2,3);var r=bl("Transaction.set",t,this._firestore),i=(n=vl("Transaction.set",n)).merge?this._firestore._dataConverter.parseMergeData("Transaction.set",e):this._firestore._dataConverter.parseSetData("Transaction.set",e);return this._transaction.set(r._key,i),this},t.prototype.update=function(t,e,n){for(var r,i,o=[],s=3;s<arguments.length;s++)o[s-3]=arguments[s];return"string"==typeof e||e instanceof $s?(Li("Transaction.update",arguments,3),r=bl("Transaction.update",t,this._firestore),i=this._firestore._dataConverter.parseUpdateVarargs("Transaction.update",e,n,o)):(ji("Transaction.update",arguments,2),r=bl("Transaction.update",t,this._firestore),i=this._firestore._dataConverter.parseUpdateData("Transaction.update",e)),this._transaction.update(r._key,i),this},t.prototype.delete=function(t){ji("Transaction.delete",arguments,1);var e=bl("Transaction.delete",t,this._firestore);return this._transaction.delete(e._key),this},t}(),cl=function(){function t(t){this._firestore=t,this._mutations=[],this._committed=!1}return t.prototype.set=function(t,e,n){Ui("WriteBatch.set",arguments,2,3),this.verifyNotCommitted();var r=bl("WriteBatch.set",t,this._firestore),i=(n=vl("WriteBatch.set",n)).merge?this._firestore._dataConverter.parseMergeData("WriteBatch.set",e):this._firestore._dataConverter.parseSetData("WriteBatch.set",e);return this._mutations=this._mutations.concat(i.toMutations(r._key,ls.NONE)),this},t.prototype.update=function(t,e,n){for(var r,i,o=[],s=3;s<arguments.length;s++)o[s-3]=arguments[s];return this.verifyNotCommitted(),"string"==typeof e||e instanceof $s?(Li("WriteBatch.update",arguments,3),r=bl("WriteBatch.update",t,this._firestore),i=this._firestore._dataConverter.parseUpdateVarargs("WriteBatch.update",e,n,o)):(ji("WriteBatch.update",arguments,2),r=bl("WriteBatch.update",t,this._firestore),i=this._firestore._dataConverter.parseUpdateData("WriteBatch.update",e)),this._mutations=this._mutations.concat(i.toMutations(r._key,ls.exists(!0))),this},t.prototype.delete=function(t){ji("WriteBatch.delete",arguments,1),this.verifyNotCommitted();var e=bl("WriteBatch.delete",t,this._firestore);return this._mutations=this._mutations.concat(new ds(e._key,ls.NONE)),this},t.prototype.commit=function(){return this.verifyNotCommitted(),this._committed=!0,this._mutations.length>0?this._firestore.ensureClientConfigured().write(this._mutations):Promise.resolve()},t.prototype.verifyNotCommitted=function(){if(this._committed)throw new Pi(Oi.FAILED_PRECONDITION,"A write batch can no longer be used after commit() has been called.")},t}(),hl=function(){function t(t,e){this._key=t,this.firestore=e,this._firestoreClient=this.firestore.ensureClientConfigured()}return t.forPath=function(e,n){if(e.length%2!=0)throw new Pi(Oi.INVALID_ARGUMENT,"Invalid document reference. Document references must have an even number of segments, but "+e.canonicalString()+" has "+e.length);return new t(new po(e),n)},Object.defineProperty(t.prototype,"id",{get:function(){return this._key.path.lastSegment()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){return new gl(this._key.path.popLast(),this.firestore)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"path",{get:function(){return this._key.path.canonicalString()},enumerable:!0,configurable:!0}),t.prototype.collection=function(t){if(ji("DocumentReference.collection",arguments,1),Bi("DocumentReference.collection","string",1,t),!t)throw new Pi(Oi.INVALID_ARGUMENT,"Must provide a non-empty collection name to collection()");var e=co.fromString(t);return new gl(this._key.path.child(e),this.firestore)},t.prototype.isEqual=function(e){if(!(e instanceof t))throw Ji("isEqual","DocumentReference",1,e);return this.firestore===e.firestore&&this._key.isEqual(e._key)},t.prototype.set=function(t,e){Ui("DocumentReference.set",arguments,1,2);var n=(e=vl("DocumentReference.set",e)).merge?this.firestore._dataConverter.parseMergeData("DocumentReference.set",t):this.firestore._dataConverter.parseSetData("DocumentReference.set",t);return this._firestoreClient.write(n.toMutations(this._key,ls.NONE))},t.prototype.update=function(t,e){for(var n,r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];return"string"==typeof t||t instanceof $s?(Li("DocumentReference.update",arguments,2),n=this.firestore._dataConverter.parseUpdateVarargs("DocumentReference.update",t,e,r)):(ji("DocumentReference.update",arguments,1),n=this.firestore._dataConverter.parseUpdateData("DocumentReference.update",t)),this._firestoreClient.write(n.toMutations(this._key,ls.exists(!0)))},t.prototype.delete=function(){return ji("DocumentReference.delete",arguments,0),this._firestoreClient.write([new ds(this._key,ls.NONE)])},t.prototype.onSnapshot=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];Ui("DocumentReference.onSnapshot",arguments,1,4);var n,r={includeMetadataChanges:!1},i=0;"object"!=typeof t[i]||Uu(t[i])||(Yi("DocumentReference.onSnapshot",r=t[i],["includeMetadataChanges"]),Ki("DocumentReference.onSnapshot","boolean","includeMetadataChanges",r.includeMetadataChanges),i++);var o={includeDocumentMetadataChanges:r.includeMetadataChanges,includeQueryMetadataChanges:r.includeMetadataChanges};return Uu(t[i])?n=t[i]:(Bi("DocumentReference.onSnapshot","function",i,t[i]),qi("DocumentReference.onSnapshot","function",i+1,t[i+1]),qi("DocumentReference.onSnapshot","function",i+2,t[i+2]),n={next:t[i],error:t[i+1],complete:t[i+2]}),this.onSnapshotInternal(o,n)},t.prototype.onSnapshotInternal=function(t,e){var n=this,r=function(t){console.error("Uncaught Error in onSnapshot:",t)};e.error&&(r=e.error.bind(e));var i=new Ru({next:function(t){if(e.next){ki(t.docs.size<=1,"Too many documents returned on a document query");var r=t.docs.get(n._key);e.next(new pl(n.firestore,n._key,r,t.fromCache))}},error:r}),o=this._firestoreClient.listen(Ko.atPath(this._key.path),i,t);return function(){i.mute(),n._firestoreClient.unlisten(o)}},t.prototype.get=function(){var t=this;return ji("DocumentReference.get",arguments,0),new Promise(function(e,n){var r=t.onSnapshotInternal({includeQueryMetadataChanges:!0,includeDocumentMetadataChanges:!0,waitForSyncWhenOnline:!0},{next:function(t){r(),!t.exists&&t.metadata.fromCache?n(new Pi(Oi.ABORTED,"Failed to get document because the client is offline.")):e(t)},error:n})})},t}(),fl=function(){function t(t,e){this.hasPendingWrites=t,this.fromCache=e}return t.prototype.isEqual=function(t){return this.hasPendingWrites===t.hasPendingWrites&&this.fromCache===t.fromCache},t}(),pl=function(){function t(t,e,n,r){this._firestore=t,this._key=e,this._document=n,this._fromCache=r}return t.prototype.data=function(t){return Ui("DocumentSnapshot.data",arguments,0,1),t=_l("DocumentSnapshot.data",t),this._document?this.convertObject(this._document.data,Eo.fromSnapshotOptions(t)):void 0},t.prototype.get=function(t,e){if(Ui("DocumentSnapshot.get",arguments,1,2),e=_l("DocumentSnapshot.get",e),this._document){var n=this._document.data.field(el("DocumentSnapshot.get",t));if(void 0!==n)return this.convertValue(n,Eo.fromSnapshotOptions(e))}},Object.defineProperty(t.prototype,"id",{get:function(){return this._key.path.lastSegment()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ref",{get:function(){return new hl(this._key,this._firestore)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"exists",{get:function(){return null!==this._document},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"metadata",{get:function(){return new fl(null!==this._document&&this._document.hasLocalMutations,this._fromCache)},enumerable:!0,configurable:!0}),t.prototype.isEqual=function(e){if(!(e instanceof t))throw Ji("isEqual","DocumentSnapshot",1,e);return this._firestore===e._firestore&&this._fromCache===e._fromCache&&this._key.isEqual(e._key)&&(null===this._document?null===e._document:this._document.isEqual(e._document))},t.prototype.convertObject=function(t,e){var n=this,r={};return t.forEach(function(t,i){r[t]=n.convertValue(i,e)}),r},t.prototype.convertValue=function(t,e){if(t instanceof Vo)return this.convertObject(t,e);if(t instanceof Fo)return this.convertArray(t,e);if(t instanceof Do){var n=t.value(e),r=this._firestore.ensureClientConfigured().databaseId();return t.databaseId.isEqual(r)||Ci("Document "+this._key.path+" contains a document reference within a different database ("+t.databaseId.projectId+"/"+t.databaseId.database+") which is not supported. It will be treated as a reference in the current database ("+r.projectId+"/"+r.database+") instead."),new hl(n,this._firestore)}return t.value(e)},t.prototype.convertArray=function(t,e){var n=this;return t.internalValue.map(function(t){return n.convertValue(t,e)})},t}(),dl=function(t){function e(e,n,r,i){return t.call(this,e,n,r,i)||this}return Object(i.__extends)(e,t),e.prototype.data=function(e){var n=t.prototype.data.call(this,e);return ki("object"==typeof n,"Document in a QueryDocumentSnapshot should exist"),n},e}(pl),yl=function(){function t(t,e){this._query=t,this.firestore=e}return t.prototype.where=function(e,n,r){var i;ji("Query.where",arguments,3),Bi("Query.where","string",2,n),Wi("Query.where",3,r);var o=el("Query.where",e);if(o.isKeyField())if("string"==typeof r){if(-1!==r.indexOf("/"))throw new Pi(Oi.INVALID_ARGUMENT,"Function Query.where() requires its third parameter to be a valid document ID if the first parameter is FieldPath.documentId(), but it contains a slash.");if(""===r)throw new Pi(Oi.INVALID_ARGUMENT,"Function Query.where() requires its third parameter to be a valid document ID if the first parameter is FieldPath.documentId(), but it was an empty string.");var s=this._query.path.child(new co([r]));ki(s.length%2==0,"Path should be a document key"),i=new Do(this.firestore._databaseId,new po(s))}else{if(!(r instanceof hl))throw new Pi(Oi.INVALID_ARGUMENT,"Function Query.where() requires its third parameter to be a string or a DocumentReference if the first parameter is FieldPath.documentId(), but it was: "+Gi(r)+".");i=new Do(this.firestore._databaseId,r._key)}else i=this.firestore._dataConverter.parseQueryValue("Query.where",r);var a=function(t,e,n){if(n.isEqual(Co.INSTANCE)){if(e!==zo.EQUAL)throw new Pi(Oi.INVALID_ARGUMENT,"Invalid query. You can only perform equals comparisons on null.");return new Go(t)}if(n.isEqual(Ao.NAN)){if(e!==zo.EQUAL)throw new Pi(Oi.INVALID_ARGUMENT,"Invalid query. You can only perform equals comparisons on NaN.");return new Wo(t)}return new Qo(t,e,n)}(o,zo.fromString(n),i);return this.validateNewFilter(a),new t(this._query.addFilter(a),this.firestore)},t.prototype.orderBy=function(e,n){var r;if(Ui("Query.orderBy",arguments,1,2),qi("Query.orderBy","string",2,n),void 0===n||"asc"===n)r=Yo.ASCENDING;else{if("desc"!==n)throw new Pi(Oi.INVALID_ARGUMENT,"Function Query.orderBy() has unknown direction '"+n+"', expected 'asc' or 'desc'.");r=Yo.DESCENDING}if(null!==this._query.startAt)throw new Pi(Oi.INVALID_ARGUMENT,"Invalid query. You must not call Query.startAt() or Query.startAfter() before calling Query.orderBy().");if(null!==this._query.endAt)throw new Pi(Oi.INVALID_ARGUMENT,"Invalid query. You must not call Query.endAt() or Query.endBefore() before calling Query.orderBy().");var i=el("Query.orderBy",e),o=new Xo(i,r);return this.validateNewOrderBy(o),new t(this._query.addOrderBy(o),this.firestore)},t.prototype.limit=function(e){if(ji("Query.limit",arguments,1),Bi("Query.limit","number",1,e),e<=0)throw new Pi(Oi.INVALID_ARGUMENT,"Invalid Query. Query limit ("+e+") is invalid. Limit must be positive.");return new t(this._query.withLimit(e),this.firestore)},t.prototype.startAt=function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];Li("Query.startAt",arguments,1);var i=this.boundFromDocOrFields("Query.startAt",e,n,!0);return new t(this._query.withStartAt(i),this.firestore)},t.prototype.startAfter=function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];Li("Query.startAfter",arguments,1);var i=this.boundFromDocOrFields("Query.startAfter",e,n,!1);return new t(this._query.withStartAt(i),this.firestore)},t.prototype.endBefore=function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];Li("Query.endBefore",arguments,1);var i=this.boundFromDocOrFields("Query.endBefore",e,n,!0);return new t(this._query.withEndAt(i),this.firestore)},t.prototype.endAt=function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];Li("Query.endAt",arguments,1);var i=this.boundFromDocOrFields("Query.endAt",e,n,!1);return new t(this._query.withEndAt(i),this.firestore)},t.prototype.isEqual=function(e){if(!(e instanceof t))throw Ji("isEqual","Query",1,e);return this.firestore===e.firestore&&this._query.isEqual(e._query)},t.prototype.boundFromDocOrFields=function(t,e,n,r){if(Wi(t,1,e),e instanceof pl){if(n.length>0)throw new Pi(Oi.INVALID_ARGUMENT,"Too many arguments provided to "+t+"().");var i=e;if(!i.exists)throw new Pi(Oi.NOT_FOUND,"Can't use a DocumentSnapshot that doesn't exist for "+t+"().");return this.boundFromDocument(t,i._document,r)}var o=[e].concat(n);return this.boundFromFields(t,o,r)},t.prototype.boundFromDocument=function(t,e,n){for(var r=[],i=0,o=this._query.orderBy;i<o.length;i++){var s=o[i];if(s.field.isKeyField())r.push(new Do(this.firestore._databaseId,e.key));else{var a=e.field(s.field);if(void 0===a){var u=s.field.canonicalString();throw new Pi(Oi.INVALID_ARGUMENT,"Invalid query. You are trying to start or end a query using a document for which the field '"+u+"' (used as the orderBy) does not exist.")}r.push(a)}}return new Jo(r,n)},t.prototype.boundFromFields=function(t,e,n){var r=this._query.explicitOrderBy;if(e.length>r.length)throw new Pi(Oi.INVALID_ARGUMENT,"Too many arguments provided to "+t+"(). The number of arguments must be less than or equal to the number of Query.orderBy() clauses");for(var i=[],o=0;o<e.length;o++){var s=e[o];if(r[o].field.isKeyField()){if("string"!=typeof s)throw new Pi(Oi.INVALID_ARGUMENT,"Invalid query. Expected a string for document ID in "+t+"(), but got a "+typeof s);if(-1!==s.indexOf("/"))throw new Pi(Oi.INVALID_ARGUMENT,"Invalid query. Document ID '"+s+"' contains a slash in "+t+"()");var a=new po(this._query.path.child(s));i.push(new Do(this.firestore._databaseId,a))}else{var u=this.firestore._dataConverter.parseQueryValue(t,s);i.push(u)}}return new Jo(i,n)},t.prototype.onSnapshot=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];Ui("Query.onSnapshot",arguments,1,4);var n,r={},i=0;return"object"!=typeof t[i]||Uu(t[i])||(Yi("Query.onSnapshot",r=t[i],["includeQueryMetadataChanges","includeDocumentMetadataChanges"]),Ki("Query.onSnapshot","boolean","includeDocumentMetadataChanges",r.includeDocumentMetadataChanges),Ki("Query.onSnapshot","boolean","includeQueryMetadataChanges",r.includeQueryMetadataChanges),i++),Uu(t[i])?n=t[i]:(Bi("Query.onSnapshot","function",i,t[i]),qi("Query.onSnapshot","function",i+1,t[i+1]),qi("Query.onSnapshot","function",i+2,t[i+2]),n={next:t[i],error:t[i+1],complete:t[i+2]}),this.onSnapshotInternal(r,n)},t.prototype.onSnapshotInternal=function(t,e){var n=this,r=function(t){console.error("Uncaught Error in onSnapshot:",t)};e.error&&(r=e.error.bind(e));var i=new Ru({next:function(t){e.next&&e.next(new ml(n.firestore,n._query,t))},error:r}),o=this.firestore.ensureClientConfigured(),s=o.listen(this._query,i,t);return function(){i.mute(),o.unlisten(s)}},t.prototype.get=function(){var t=this;return ji("Query.get",arguments,0),new Promise(function(e,n){var r=t.onSnapshotInternal({includeDocumentMetadataChanges:!1,includeQueryMetadataChanges:!0,waitForSyncWhenOnline:!0},{next:function(t){r(),e(t)},error:n})})},t.prototype.validateNewFilter=function(t){if(t instanceof Qo&&t.isInequality()){var e=this._query.getInequalityFilterField();if(null!==e&&!e.isEqual(t.field))throw new Pi(Oi.INVALID_ARGUMENT,"Invalid query. All where filters with an inequality (<, <=, >, or >=) must be on the same field. But you have inequality filters on '"+e.toString()+"' and '"+t.field.toString()+"'");var n=this._query.getFirstOrderByField();null!==n&&this.validateOrderByAndInequalityMatch(t.field,n)}},t.prototype.validateNewOrderBy=function(t){if(null===this._query.getFirstOrderByField()){var e=this._query.getInequalityFilterField();null!==e&&this.validateOrderByAndInequalityMatch(e,t.field)}},t.prototype.validateOrderByAndInequalityMatch=function(t,e){if(!e.isEqual(t))throw new Pi(Oi.INVALID_ARGUMENT,"Invalid query. You have a where filter with an inequality (<, <=, >, or >=) on field '"+t.toString()+"' and so you must also use '"+t.toString()+"' as your first Query.orderBy(), but your first Query.orderBy() is on field '"+e.toString()+"' instead.")},t}(),ml=function(){function t(t,e,n){this._firestore=t,this._originalQuery=e,this._snapshot=n,this._cachedChanges=null,this.metadata=new fl(n.hasPendingWrites,n.fromCache)}return Object.defineProperty(t.prototype,"docs",{get:function(){var t=[];return this.forEach(function(e){return t.push(e)}),t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"empty",{get:function(){return this._snapshot.docs.isEmpty()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return this._snapshot.docs.size},enumerable:!0,configurable:!0}),t.prototype.forEach=function(t,e){var n=this;Ui("QuerySnapshot.forEach",arguments,1,2),Bi("QuerySnapshot.forEach","function",1,t),this._snapshot.docs.forEach(function(r){t.call(e,n.convertToDocumentImpl(r))})},Object.defineProperty(t.prototype,"query",{get:function(){return new yl(this._originalQuery,this._firestore)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"docChanges",{get:function(){return this._cachedChanges||(this._cachedChanges=function(t,e){if(e.oldDocs.isEmpty()){var n,r=0;return e.docChanges.map(function(i){var o=new dl(t,i.doc.key,i.doc,e.fromCache);return ki(i.type===ea.Added,"Invalid event type for first snapshot"),ki(!n||e.query.docComparator(n,i.doc)<0,"Got added events in wrong order"),n=i.doc,{type:"added",doc:o,oldIndex:-1,newIndex:r++}})}var i=e.oldDocs;return e.docChanges.map(function(n){var r=new dl(t,n.doc.key,n.doc,e.fromCache),o=-1,s=-1;return n.type!==ea.Added&&(ki((o=i.indexOf(n.doc.key))>=0,"Index for document not found"),i=i.delete(n.doc.key)),n.type!==ea.Removed&&(s=(i=i.add(n.doc)).indexOf(n.doc.key)),{type:function(t){switch(t){case ea.Added:return"added";case ea.Modified:case ea.Metadata:return"modified";case ea.Removed:return"removed";default:return Ii("Unknown change type: "+t)}}(n.type),doc:r,oldIndex:o,newIndex:s}})}(this._firestore,this._snapshot)),this._cachedChanges},enumerable:!0,configurable:!0}),t.prototype.isEqual=function(e){if(!(e instanceof t))throw Ji("isEqual","QuerySnapshot",1,e);return this._firestore===e._firestore&&this._originalQuery.isEqual(e._originalQuery)&&this._snapshot.isEqual(e._snapshot)},t.prototype.convertToDocumentImpl=function(t){return new dl(this._firestore,t.key,t,this.metadata.fromCache)},t}(),gl=function(t){function e(e,n){var r=t.call(this,Ko.atPath(e),n)||this;if(e.length%2!=1)throw new Pi(Oi.INVALID_ARGUMENT,"Invalid collection reference. Collection references must have an odd number of segments, but "+e.canonicalString()+" has "+e.length);return r}return Object(i.__extends)(e,t),Object.defineProperty(e.prototype,"id",{get:function(){return this._query.path.lastSegment()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){var t=this._query.path.popLast();return t.isEmpty()?null:new hl(new po(t),this.firestore)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"path",{get:function(){return this._query.path.canonicalString()},enumerable:!0,configurable:!0}),e.prototype.doc=function(t){if(Ui("CollectionReference.doc",arguments,0,1),0===arguments.length&&(t=$i.newId()),Bi("CollectionReference.doc","string",1,t),""===t)throw new Pi(Oi.INVALID_ARGUMENT,"Document path must be a non-empty string");var e=co.fromString(t);return hl.forPath(this._query.path.child(e),this.firestore)},e.prototype.add=function(t){ji("CollectionReference.add",arguments,1),Bi("CollectionReference.add","object",1,t);var e=this.doc();return e.set(t).then(function(){return e})},e}(yl);function vl(t,e){return void 0===e?{merge:!1}:(Yi(t,e,["merge"]),Ki(t,"boolean","merge",e.merge),e)}function _l(t,e){return void 0===e?{}:(Yi(t,e,["serverTimestamps"]),void 0!==(n=e.serverTimestamps)&&function(t,e,n,r,i){for(var o=[],s=0,a=["estimate","previous","none"];s<a.length;s++){var u=a[s];if(u===r)return;o.push(Gi(u))}var l=Gi(r);throw new Pi(Oi.INVALID_ARGUMENT,"Invalid value "+l+" provided to function "+t+'() for option "serverTimestamps". Acceptable values: '+o.join(", "))}(t,0,0,n),e);var n}function bl(t,e,n){if(e instanceof hl){if(e.firestore!==n)throw new Pi(Oi.INVALID_ARGUMENT,"Provided document reference is from a different Firestore instance.");return e}throw Ji(t,"DocumentReference",1,e)}var wl=Ni(ul,"Use firebase.firestore() instead."),El=Ni(ll,"Use firebase.firestore().runTransaction() instead."),Sl=Ni(cl,"Use firebase.firestore().batch() instead."),Cl=Ni(hl,"Use firebase.firestore().doc() instead."),Tl=Ni(pl),Il=Ni(dl),kl=Ni(yl),xl=Ni(ml),Al=Ni(gl,"Use firebase.firestore().collection() instead.");Gr.INTERNAL.registerService("firestore",function(t){return new ul(t)},Fi({Firestore:wl,GeoPoint:so,Blob:oo,Transaction:El,WriteBatch:Sl,DocumentReference:Cl,DocumentSnapshot:Tl,Query:kl,QueryDocumentSnapshot:Il,QuerySnapshot:xl,CollectionReference:Al,FieldPath:$s,FieldValue:zu,setLogLevel:ul.setLogLevel}));var Ol=function(){function t(){}return t.enablePersistence=function(){return{ngModule:t,providers:[{provide:yi,useValue:!0}]}},t}(),Pl=function(){function t(t,e,n){this.youtube=t,this.http=e,this.afs=n,this.feedVideos=[],this.historyVideos=[],this.roomId="public",this.notify={enabled:!1,message:"No message"}}return t.prototype.ngOnInit=function(){var t=new URL(location.href).searchParams.get("roomId");t&&(this.roomId=t)},t.prototype.getFeed=function(){var t=this;return new o.a(function(e){t.getSettings().subscribe(function(n){t.setApiSettings(),t.settings=n,t.youtube.feedVideos(t.nextPageToken).subscribe(function(n){t.feedVideos=t.feedVideos.concat(n.items),t.nextPageToken=n.nextPageToken,t.youtube.getChannel(n.items[0].snippet.channelId).subscribe(function(n){t.channel=n,e.next(t.feedVideos),e.complete()})},function(t){console.log("error on feed videos"+t)})})})},t.prototype.getChannel=function(t){var e=this;return new o.a(function(n){if(e.channel)return n.next(e.channel),n.complete();e.youtube.getChannel(t).subscribe(function(t){e.channel=t,n.next(e.channel),n.complete()},function(t){console.log("error on get channel "+t)})})},t.prototype.getSettings=function(){var t=this;return new o.a(function(e){if(t.settings)return e.next(t.settings),e.complete();localStorage.length<=0?t.http.get("assets/settings.json").map(function(t){return t.json()}).subscribe(function(n){t.settings=n,localStorage.setItem("settings",JSON.stringify(n)),e.next(t.settings),e.complete()},function(t){console.log("error on get settings "+t)}):(t.settings=JSON.parse(localStorage.getItem("settings")),e.next(t.settings),e.complete())})},t.prototype.updateSettings=function(){localStorage.setItem("settings",JSON.stringify(this.settings)),this.setLocalVersion()},t.prototype.getPlaylist=function(){},t.prototype.updatePlaylist=function(){},t.prototype.setApiSettings=function(){this.youtube.defaultApiSet(this.settings)},t.prototype.setLocalVersion=function(){null===localStorage.getItem("version")&&localStorage.setItem("version","1")},t.prototype.triggerNotify=function(t,e){var n=this;void 0===e&&(e=1e3),this.notify.enabled=!0,this.notify.message=t,setTimeout(function(){return n.notify.enabled=!1},e)},t.prototype.addHistoryVideo=function(t){var e;for(e in this.historyVideos)this.historyVideos[e].id===t.id&&(this.historyVideos.splice(e,1),this.historyVideos[this.historyVideos.length-1]===t&&this.historyVideos.splice(-1,1));this.historyVideos.unshift(t)},t.prototype.addKaraokeFs=function(t,e){var n=this.afs.collection("karaokeStats"),r=this.afs.collection("karaoke");e||(e=this.roomId),n.doc("_karaokeKey").ref.get().then(function(i){var o;i.exists?(o=i.data().id+1,n.doc("_karaokeKey").set({id:o})):(n.doc("_karaokeKey").set({id:1}),o=1),t.seq=o,t.roomId=e,r.doc(String(o)).set(t)}).catch(function(t){console.log("Error getting karaokeCount:",t)})},t.prototype.deleteKaraokeFs=function(t){this.afs.doc("karaoke/"+t).delete()},t.prototype.getKaraokeFs=function(t){this.fsVideoDoc=this.afs.doc("karaoke/"+t),this.fsVideo=this.fsVideoDoc.valueChanges()},t.prototype.clearKaraokeFs=function(){var t=this;console.log("===clearKaraokeFs==="),this.fsVideosCol=this.afs.collection("karaoke"),this.fsVideos=this.fsVideosCol.valueChanges(),this.subscription=this.fsVideos.subscribe(function(e){e.forEach(function(e){console.log(e.seq),t.afs.doc("karaoke/"+e.seq).delete()}),t.subscription.unsubscribe()})},t}();function Nl(){return window}var Rl=function(){function t(){this.mw=Nl().mw,this.up=Nl()}return t.prototype.init=function(){var t=this;return new o.a(function(e){if(t.mw)return e.next(t.mw),e.complete();"undefined"==typeof t.mw&&(t.mw=Nl().nw,e.next(t.mw),e.complete())})},t}(),Dl=function(){function t(t,e){this.project=t,this.resultSelector=e}return t.prototype.call=function(t,e){return e.subscribe(new Ml(t,this.project,this.resultSelector))},t}(),Ml=function(t){function e(e,n,r){t.call(this,e),this.project=n,this.resultSelector=r,this.index=0}return Object(i.__extends)(e,t),e.prototype._next=function(t){var e,n=this.index++;try{e=this.project(t,n)}catch(t){return void this.destination.error(t)}this._innerSub(e,t,n)},e.prototype._innerSub=function(t,e,n){var r=this.innerSubscription;r&&r.unsubscribe(),this.add(this.innerSubscription=Object(u.a)(this,t,e,n))},e.prototype._complete=function(){var e=this.innerSubscription;e&&!e.closed||t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){this.innerSubscription=null},e.prototype.notifyComplete=function(e){this.remove(e),this.innerSubscription=null,this.isStopped&&t.prototype._complete.call(this)},e.prototype.notifyNext=function(t,e,n,r,i){this.resultSelector?this._tryNotifyNext(t,e,n,r):this.destination.next(e)},e.prototype._tryNotifyNext=function(t,e,n,r){var i;try{i=this.resultSelector(t,e,n,r)}catch(t){return void this.destination.error(t)}this.destination.next(i)},e}(l.a);o.a.prototype.switchMap=function(t,e){return function(t,e){return function(n){return n.lift(new Dl(t,e))}}(t,e)(this)};var Vl=function(t){function e(){var e=t.call(this,"argument out of range");this.name=e.name="ArgumentOutOfRangeError",this.stack=e.stack,this.message=e.message}return Object(i.__extends)(e,t),e}(Error),Fl=function(){function t(t){if(this.total=t,this.total<0)throw new Vl}return t.prototype.call=function(t,e){return e.subscribe(new jl(t,this.total))},t}(),jl=function(t){function e(e,n){t.call(this,e),this.total=n,this.count=0}return Object(i.__extends)(e,t),e.prototype._next=function(t){var e=this.total,n=++this.count;n<=e&&(this.destination.next(t),n===e&&(this.destination.complete(),this.unsubscribe()))},e}(v.a);o.a.prototype.take=function(t){return function(t){return function(e){return 0===t?new s.a:e.lift(new Fl(t))}}(t)(this)};var Ll=function(){},Ul="*";function Bl(t,e){return void 0===e&&(e=null),{type:2,steps:t,options:e}}function ql(t){return{type:6,styles:t,offset:null}}function Hl(t){Promise.resolve(null).then(t)}var Kl=function(){function t(){this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this._started=!1,this._destroyed=!1,this._finished=!1,this.parentPlayer=null,this.totalTime=0}return t.prototype._onFinish=function(){this._finished||(this._finished=!0,this._onDoneFns.forEach(function(t){return t()}),this._onDoneFns=[])},t.prototype.onStart=function(t){this._onStartFns.push(t)},t.prototype.onDone=function(t){this._onDoneFns.push(t)},t.prototype.onDestroy=function(t){this._onDestroyFns.push(t)},t.prototype.hasStarted=function(){return this._started},t.prototype.init=function(){},t.prototype.play=function(){this.hasStarted()||(this._onStart(),this.triggerMicrotask()),this._started=!0},t.prototype.triggerMicrotask=function(){var t=this;Hl(function(){return t._onFinish()})},t.prototype._onStart=function(){this._onStartFns.forEach(function(t){return t()}),this._onStartFns=[]},t.prototype.pause=function(){},t.prototype.restart=function(){},t.prototype.finish=function(){this._onFinish()},t.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.hasStarted()||this._onStart(),this.finish(),this._onDestroyFns.forEach(function(t){return t()}),this._onDestroyFns=[])},t.prototype.reset=function(){},t.prototype.setPosition=function(t){},t.prototype.getPosition=function(){return 0},t.prototype.triggerCallback=function(t){var e="start"==t?this._onStartFns:this._onDoneFns;e.forEach(function(t){return t()}),e.length=0},t}(),zl=function(){function t(t){var e=this;this._onDoneFns=[],this._onStartFns=[],this._finished=!1,this._started=!1,this._destroyed=!1,this._onDestroyFns=[],this.parentPlayer=null,this.totalTime=0,this.players=t;var n=0,r=0,i=0,o=this.players.length;0==o?Hl(function(){return e._onFinish()}):this.players.forEach(function(t){t.onDone(function(){++n==o&&e._onFinish()}),t.onDestroy(function(){++r==o&&e._onDestroy()}),t.onStart(function(){++i==o&&e._onStart()})}),this.totalTime=this.players.reduce(function(t,e){return Math.max(t,e.totalTime)},0)}return t.prototype._onFinish=function(){this._finished||(this._finished=!0,this._onDoneFns.forEach(function(t){return t()}),this._onDoneFns=[])},t.prototype.init=function(){this.players.forEach(function(t){return t.init()})},t.prototype.onStart=function(t){this._onStartFns.push(t)},t.prototype._onStart=function(){this.hasStarted()||(this._started=!0,this._onStartFns.forEach(function(t){return t()}),this._onStartFns=[])},t.prototype.onDone=function(t){this._onDoneFns.push(t)},t.prototype.onDestroy=function(t){this._onDestroyFns.push(t)},t.prototype.hasStarted=function(){return this._started},t.prototype.play=function(){this.parentPlayer||this.init(),this._onStart(),this.players.forEach(function(t){return t.play()})},t.prototype.pause=function(){this.players.forEach(function(t){return t.pause()})},t.prototype.restart=function(){this.players.forEach(function(t){return t.restart()})},t.prototype.finish=function(){this._onFinish(),this.players.forEach(function(t){return t.finish()})},t.prototype.destroy=function(){this._onDestroy()},t.prototype._onDestroy=function(){this._destroyed||(this._destroyed=!0,this._onFinish(),this.players.forEach(function(t){return t.destroy()}),this._onDestroyFns.forEach(function(t){return t()}),this._onDestroyFns=[])},t.prototype.reset=function(){this.players.forEach(function(t){return t.reset()}),this._destroyed=!1,this._finished=!1,this._started=!1},t.prototype.setPosition=function(t){var e=t*this.totalTime;this.players.forEach(function(t){var n=t.totalTime?Math.min(1,e/t.totalTime):1;t.setPosition(n)})},t.prototype.getPosition=function(){var t=0;return this.players.forEach(function(e){var n=e.getPosition();t=Math.min(n,t)}),t},t.prototype.beforeDestroy=function(){this.players.forEach(function(t){t.beforeDestroy&&t.beforeDestroy()})},t.prototype.triggerCallback=function(t){var e="start"==t?this._onStartFns:this._onDoneFns;e.forEach(function(t){return t()}),e.length=0},t}(),Ql="!",Gl=n("Y3Bq"),Wl=function(){function t(t,e,n,r,i){this.youtube=t,this.shared=e,this.nwjs=n,this.afs=r,this.titleService=i,this.AppTitle="YoutubeK by Gabs",this.roomId="public",this.allowHqFeedback=!1,this.videoRangePercent=0,this.playlistVideos=[],this.currentVideoObject=[],this.thumbnails=!0,this.darkMode=!0,this.menuActive=!1,this.modal=!1,this.modalPlaylist=!1,this.modalExportPlaylist=!1,this.UsageModalDesktop=!1,this.UsageModalMobile=!1,this.playlistPrefill=!0,this.displayVideoPlayer=!0,this.repeatMode=!0,this.shareLink="",this.currentVideo={id:"",title:"",channelTitle:"",stats:{likes:"",dislikes:"",views:""}},this.currentState=-1,this.currentMuteState=!1,this.videoRangeMouseActive=!1,this.volumeRangeMouseActive=!1,this.videoCurRange=0,this.videoMaxRange=0,this.videoCurFull="00:00:00",this.videoMaxFull="00:00:00",this.videoCurVolume=-1,this.fullscreenVideo=!1,this.loading=!0,this.maximized=!1,this.isAdmin=!1,this.isDesktop=!0,this._shared=e,this._nwjs=n,this.notify=this._shared.notify}return t.prototype.checkMobile=function(){return document,/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)?(console.log("IsMobile"),this.isDesktop=!1):this.isDesktop=!0},t.prototype.ngOnInit=function(){var t=this;this.checkMobile();var e=new URL(location.href).searchParams.get("roomId"),n=new URL(location.href).searchParams.get("hqfb"),r=new URL(location.href).searchParams.get("auth");e&&(this.roomId=e,this.youtube.isMaster(this.roomId,r).subscribe(function(e){1===e.isMaster&&(t.isAdmin=!0,t.allowHqFeedback=!0)})),"1"==n&&(this.allowHqFeedback=!0),this._nwjs.init().subscribe(function(e){"undefined"!=typeof e&&(t.nw=e,t.initNWJS(),t.initShortcut())}),this.preventOldSettings(),this.setSettings(),this.getFeedVideos(),this.getFsPlaylist(),this.modal=!0,this.isDesktop?this.UsageModalDesktop=!0:this.UsageModalMobile=!0},t.prototype.getFsPlaylist=function(){var t=this;this.fsVideosCol=this.afs.collection("karaoke",function(e){return e.where("roomId","==",t.roomId)}),this.fsVideos=this.fsVideosCol.valueChanges(),this.fsVideos.subscribe(function(e){t.playlistVideos=e}),this.fsVideoStats=this.afs.collection("karaokeStats"),this.fsVideosCurrent=this.afs.doc("karaokeStats/curr-"+this.roomId).valueChanges(),this.fsVideosNext=this.afs.doc("karaokeStats/next-"+this.roomId).valueChanges(),this.fsVideosPlaybackState=this.afs.doc("karaokeStats/playback-"+this.roomId).valueChanges()},t.prototype.savePlayer=function(t){this.player=t},t.prototype.playerVars=function(){return{enablejsapi:1,controls:1,disablekb:0,showinfo:0,playsinline:1,autoplay:0,fs:0,iv_load_policy:3,modestbranding:1,loop:0,origin:"https://www.youtube.com",rel:0}},t.prototype.getFeedVideos=function(){var t=this;this._shared.getFeed().subscribe(function(e){t.feedVideos=e,t.currentVideo.id||t.setDefaultPlayer()})},t.prototype.setCurrentVideoObject=function(t,e){void 0===e&&(e=!0),t&&(this.currentVideoObject=[],this.currentVideoObject.push(t),e&&this.fsVideoStats.doc("curr-"+this.roomId).set(t))},t.prototype.setDefaultPlayer=function(){},t.prototype.toggleFullscreenVideo=function(){this.currentVideo.id?(this.fullscreenVideo=!this.fullscreenVideo,this.fullscreenOverlayMsg="YoutubeK",Gl.enabled&&Gl.request(),this.currentVideo.id&&this.player.loadVideoById(this.currentVideo.id)):alert("Kindly start playing a song item first.")},t.prototype.onStateChange=function(t){this.currentState=t.data,this.videoMaxRange=this.player.getDuration(),this.videoCurVolume=this.player.getVolume(),1===this.currentState?(this.videoMaxFull=this.timeFormat(this.videoMaxRange),this.currentMuteState=this.player.isMuted(),this.startRange()):this.stopRange(),0===this.currentState&&(this.stopRange(),this.repeatMode&&(this.playlistVideos.length?(this.findPlaylistItem(),this.playPlaylistItem("next",this.currentPlaylistItem),1===this.playlistVideos.length&&this.player.playVideo()):this.player.playVideo()))},t.prototype.startRange=function(){var t=this;this.stopRange(),this.currentState&&this.playlistVideos.length>0?this.videoRangeTimer=setInterval(function(){t.videoCurRange=t.player.getCurrentTime(),t.videoCurFull=t.timeFormat(t.videoCurRange),t.videoRangePercent=t.videoCurRange/t.videoMaxRange*100;var e=Math.floor(t.videoRangePercent),n=t.playlistVideos[t.currentPlaylistItem].snippet.title||t.AppTitle,r="next-"+t.roomId;if(t.currentPlaylistItem<t.playlistVideos.length-1){var i=t.playlistVideos[t.currentPlaylistItem+1].snippet.title;t.videoRangePercent<1?t.fsVideoStats.doc(r).set({msgKar:"Loading karaoke..."}):2==e?t.fsVideoStats.doc(r).set({msgKar:n}):5==e?t.fsVideoStats.doc(r).set({msgKar:"Have fun singing!"}):50==e?t.fsVideoStats.doc(r).set({msgKar:"Are you having fun?!?"}):52==e?t.fsVideoStats.doc(r).set({msgKar:"Coming your way..."}):53==e?t.fsVideoStats.doc(r).set({msgKar:i}):90==e?t.fsVideoStats.doc(r).set({msgKar:"Up Next..."}):91==e&&t.fsVideoStats.doc(r).set({msgKar:i})}else t.fsVideoStats.doc(r).set({msgKar:"Last song in the playlist."})},1e3):this.player.stopVideo()},t.prototype.stopRange=function(){clearInterval(this.videoRangeTimer)},t.prototype.playlistInit=function(){var t=this;console.log("RoomId: "+this.roomId),this.findPlaylistItem(),this.fsVideosCurrent.subscribe(function(e){t.getVideoFs(e)}),this.fsVideosPlaybackState.subscribe(function(e){"undefined"==typeof e.state&&null==typeof e.state||(console.log("From remote:"+e.state),"pause"===e.state?(console.log("Remote State: PAUSE video"),t.isDesktop?t.player.pauseVideo():t.currentState=0):"play"===e.state&&(console.log("Remote State: PLAY video"),t.isDesktop?t.player.playVideo():t.currentState=1))}),this.fsVideosNext.subscribe(function(e){e&&(t.titleService.setTitle(e.msgKar),t.fullscreenOverlayMsg=e.msgKar),setTimeout(function(){t.titleService.setTitle(t.AppTitle),t.fullscreenOverlayMsg="www.bernardgabon.com/YoutubeK/"+t.roomId,setTimeout(function(){t.fullscreenOverlayMsg=""},1e4)},3e4)})},t.prototype.findPlaylistItem=function(t){var e,n=this;void 0===t&&(t=!0),e=this.playlistVideos.find("undefined"!=typeof this.currentVideoObject[0].id.videoId?function(t){return t.id.videoId===n.currentVideoObject[0].id.videoId}:function(t){return t.id===n.currentVideoObject[0].id}),this.currentPlaylistItem=this.playlistVideos.indexOf(e)},t.prototype.playPlaylistItem=function(t,e){"next"===t&&(e<this.playlistVideos.length&&(e+=1),e>=this.playlistVideos.length&&(e=0)),"prev"===t&&(0===e||e<0?e=this.playlistVideos.length-1:e-=1),this.playlistVideos.length>0?this.getVideo(this.playlistVideos[e]):(this._shared.triggerNotify("Playlist is empty"),this.updateNotify())},t.prototype.removePlaylistItem=function(t,e){var n=this;this._shared.deleteKaraokeFs(e),this._shared.triggerNotify("Video removed"),this.updateNotify(),setTimeout(function(){t===n.currentPlaylistItem&&(t=t<n.playlistVideos.length?t:0,n.playlistVideos.length>0?n.getVideo(n.playlistVideos[t]):n.currentPlaylistItem=-1),n.findPlaylistItem()},200)},t.prototype.addPlaylistItem=function(t,e){var n;0===e&&(n=this.feedVideos[t]),1===e&&(n=this._shared.lastSearchedVideos[t]),2===e&&(n=this.relatedVideos[t]),3===e&&(n=this.currentVideoObject[t]),4===e&&(n=this._shared.historyVideos[t]),this.playlistVideos.find("undefined"!=typeof n.id.videoId?function(t){return t.id.videoId===n.id.videoId}:function(t){return t.id===n.id}),this._shared.addKaraokeFs(n,this.roomId),this._shared.triggerNotify("Added to playlist")},t.prototype.clearPlaylist=function(){this._shared.clearKaraokeFs(),this.currentPlaylistItem=-1},t.prototype.exportPlaylist=function(){this.showExportPlaylistModal()},t.prototype.exportFilePlaylist=function(){var t=document.createElement("a"),e=new Blob([JSON.stringify(this.playlistVideos)],{type:"data:text/json;charset=utf8"});t.href=URL.createObjectURL(e),t.download="playlist.json",t.click()},t.prototype.flagAsQuality=function(t,e,n,r,i){var o=this;void 0===n&&(n=""),void 0===r&&(r=""),void 0===i&&(i=0),this.youtube.flagAsHighQuality(t,e,n,r,this.roomId,i).subscribe(function(t){o._shared.triggerNotify(t.hq,1e3)})},t.prototype.preventOldSettings=function(){1!==localStorage.length&&null!==localStorage.getItem("version")||(console.log("Updating localstorage..."),localStorage.removeItem("version"),localStorage.removeItem("playlist"),localStorage.removeItem("settings"),this._shared.settings=null,this._shared.playlist=null,this.playlistVideos=[])},t.prototype.setSettings=function(){var t=this;this._shared.getSettings().subscribe(function(e){t.regionCode=e.api_settings[1].value,t.thumbnails=e.form_settings[0].value,t.displayVideoPlayer=e.form_settings[2].value,t.repeatMode=e.form_settings[3].value,t.darkMode=e.form_settings[4].value})},t.prototype.toggleHeadSettings=function(t){2===t&&(this.currentMuteState?(this.player.unMute(),this.currentMuteState=!1):(this.player.mute(),this.currentMuteState=!0))},t.prototype.onClickRelated=function(t,e){this.getVideo(this.relatedVideos[e])},t.prototype.onClickPlaylist=function(t,e){e===this.currentPlaylistItem?this.playPauseVideo():this.getVideo(this.playlistVideos[e])},t.prototype.getVideo=function(t){this.setCurrentVideoObject(t),t.id.videoId?this.getStatsVideos(t.id.videoId):t.id&&this.getStatsVideos(t.id),this.playVideo(t)},t.prototype.getVideoFs=function(t){this.setCurrentVideoObject(t,!1),t.id.videoId?this.getStatsVideos(t.id.videoId):t.id&&this.getStatsVideos(t.id),this.playVideo(t,!1)},t.prototype.playVideo=function(t,e){void 0===e&&(e=!0),t.id===this.currentVideo.id&&-1!==this.currentState||(this.currentVideo.id="undefined"!=typeof t.id.videoId?t.id.videoId:t.id,this.currentVideo.title=t.snippet.title,this._shared.addHistoryVideo(t),this.isDesktop?(this.player.loadVideoById(this.currentVideo.id),this.youtube.sendRoomActivity(this.roomId).subscribe(function(t){console.log("RoomActivity: "+t)})):this.currentState=1,this.getRelatedVideos(),this.findPlaylistItem())},t.prototype.getStatsVideos=function(t){var e=this;this.youtube.statsVideos(t).subscribe(function(t){e.currentVideo.id=t.items[0].id,e.currentVideo.title=t.items[0].snippet.title,e.currentVideo.channelTitle=t.items[0].snippet.channelTitle,e.currentVideo.stats.likes=t.items[0].statistics.likeCount,e.currentVideo.stats.dislikes=t.items[0].statistics.dislikeCount,e.currentVideo.stats.views=t.items[0].statistics.viewCount,e.shareLink="https://youtu.be/"+e.currentVideo.id,console.log("CURRENT:"+JSON.stringify(t.items[0].snippet.title));var n=t.items[0].snippet.title;t.items[0].status.embeddable||(e._shared.triggerNotify("This karaoke title cannot be played outside Youtube.com. No worries! We temporarily replace it with an embeddable one.",5e3),e.youtube.flagEmbeddable(t.items[0].id,t.items[0].snippet.title,t.items[0].snippet.channelId,t.items[0].snippet.channelTitle,e.roomId).subscribe(function(t){t.replaceId?e.isDesktop?(console.log("Attemp 1: Replacing video..."),e.player.loadVideoById(t.replaceId)):e.playPauseVideo():e.subscription=e.youtube.searchVideo(n,!0).subscribe(function(t){if(e.isDesktop){console.log("Attemp 1: Replacing video...");var n=Math.floor(2*Math.random())+0;e.player.loadVideoById(t.items[n].id)}else e.playPauseVideo();e.subscription.unsubscribe()}),setTimeout(function(){e._shared.triggerNotify(JSON.stringify(t.replaceId),3e3)},6e3)},function(t){console.log("error on unembeddable videos")})),setTimeout(function(){-1==e.player.getPlayerState()&&(console.log("Attemp 2: Replacing video..."),e.subscription=e.youtube.searchVideo(n,!0).subscribe(function(t){if(e.isDesktop){var n=Math.floor(2*Math.random())+0;e.player.loadVideoById(t.items[n].id)}else e.playPauseVideo();e.subscription.unsubscribe()}))},6e3),setTimeout(function(){-1==e.player.getPlayerState()&&(console.log("Attemp 3: Replacing video..."),e.subscription=e.youtube.searchVideo(n,!0).subscribe(function(t){e.isDesktop?e.player.loadVideoById(t.items[2].id):e.playPauseVideo(),e.subscription.unsubscribe()}))},1e4),setTimeout(function(){-1==e.player.getPlayerState()&&(console.log("Attemp 4: Replacing video..."),e.subscription=e.youtube.searchVideo(n,!0).subscribe(function(t){e.isDesktop?e.player.loadVideoById(t.items[3].id):e.playPauseVideo(),e.subscription.unsubscribe()}))},15e3),setTimeout(function(){1==e.player.getPlayerState()&&console.log("VideoId successfully loaded.")},18e3)},function(t){console.log("error on related videos")})},t.prototype.getRelatedVideos=function(){var t=this;this.isDesktop&&this.youtube.relatedVideos(this.currentVideo.id).subscribe(function(e){t.relatedVideos=e.items,t.playlistPrefill&&(t.playlistInit(),t.playlistPrefill=!1)},function(t){console.log("error on related videos")})},t.prototype.playPauseVideo=function(){var t="";1===this.currentState?(this.isDesktop?this.player.pauseVideo():this.currentState=0,t="pause"):(this.isDesktop?this.player.playVideo():this.currentState=1,t="play"),this.fsVideoStats.doc("playback-"+this.roomId).set({state:t})},t.prototype.RangeNouseDown=function(){this.videoRangeMouseActive=!0,this.stopRange()},t.prototype.RangeMouseMove=function(t){this.videoRangeMouseActive&&(this.videoCurRange=t,this.videoRangePercent=this.videoCurRange/this.videoMaxRange*100,this.videoCurFull=this.timeFormat(this.videoCurRange))},t.prototype.RangeMouseUp=function(t){-1!==this.currentState&&1!==this.currentState&&this.player.playVideo(),1===this.currentState?this.startRange():this.stopRange(),this.videoCurRange=t,this.videoRangePercent=this.videoCurRange/this.videoMaxRange*100,this.videoCurFull=this.timeFormat(this.videoCurRange),this.player.seekTo(this.videoCurRange,!0),this.videoRangeMouseActive=!1},t.prototype.volumeRangeMouseMove=function(t){this.volumeRangeMouseActive&&this.currentMuteState&&(this.player.unMute(),this.currentMuteState=!1)},t.prototype.volumeRangeMouseUp=function(t){this.currentMuteState&&(this.player.unMute(),this.currentMuteState=!1),this.player.setVolume(t)},t.prototype.checkVolumeRange=function(){-1!==this.currentState&&(this.currentMuteState=this.player.isMuted(),this.videoCurVolume=this.player.getVolume())},t.prototype.closeModal=function(){this.modal=!1,this.modalPlaylist=!1,this.modalExportPlaylist=!1},t.prototype.closeUsageModal=function(){this.modal=!1,this.UsageModalDesktop=!1,this.UsageModalMobile=!1},t.prototype.showPlaylistModal=function(t){this.modal=!0,this.modalPlaylist=!0,this.modalPlaylistItem=t},t.prototype.showExportPlaylistModal=function(){this.modal=!0,this.modalExportPlaylist=!0},t.prototype.confirmModal=function(){this.modal=!1},t.prototype.initNWJS=function(){var t=this;this.nw.Window.get(),this.nw.Window.get().on("new-win-policy",function(e,n,r){r.ignore(),t.nw.Shell.openExternal(n)}),this.nw.Window.get().on("restore",function(){console.log("e restored"),t.maximized=!1}),this.nw.Window.get().on("maximize",function(){console.log("e max"),t.maximized=!0})},t.prototype.initShortcut=function(){var t=this,e=this,n=[{key:"MediaNextTrack",active:function(){e.playPlaylistItem("next",e.currentPlaylistItem)},failed:function(t){console.log(t)}},{key:"MediaPrevTrack",active:function(){e.playPlaylistItem("prev",e.currentPlaylistItem)},failed:function(t){console.log(t)}},{key:"MediaPlayPause",active:function(){e.playPauseVideo()},failed:function(t){console.log(t)}}];Object.keys(n).map(function(e){var r=t.nw.Shortcut(n[e]);t.nw.Shortcut.registerGlobalHotKey(r)})},t.prototype.winMaximize=function(){var t=this.nw.Window.get();this.maximized?(t.unmaximize(),this.maximized=!1):(t.maximize(),this.maximized=!0)},t.prototype.winClose=function(){this.nw.Window.get().close()},t.prototype.winMinimize=function(){this.nw.Window.get().minimize()},t.prototype.openMobileMenu=function(){this.menuActive=!this.menuActive},t.prototype.onCopyVideoItemLink=function(t,e){var n;0===e&&(n=this.feedVideos[t]),1===e&&(n=this._shared.lastSearchedVideos[t]),2===e&&(n=this.relatedVideos[t]),3===e&&(n=this.playlistVideos[t]),4===e&&(n=this._shared.historyVideos[t]),this.videoItemIDvalue.nativeElement.value="undefined"!=typeof n.id.videoId?"https://youtu.be/"+n.id.videoId:"https://youtu.be/"+n.id,this.videoItemIDvalue.nativeElement.select(),this.videoItemIDvalue.nativeElement.focus(),document.execCommand("copy"),this.videoItemIDvalue.nativeElement.blur(),this.copyShareLink()},t.prototype.scrollToBottom=function(){var t=this;try{setTimeout(function(){t.myScrollContainer.nativeElement.scrollTop=t.myScrollContainer.nativeElement.scrollHeight},200)}catch(t){console.log(t),console.log("scroll issue")}},t.prototype.copyShareLink=function(){var t=this;this.notify.enabled?setTimeout(function(){document.execCommand("Copy"),t._shared.triggerNotify("Copied"),t.updateNotify()},1e3):(document.execCommand("Copy"),this._shared.triggerNotify("Copied"),this.updateNotify())},t.prototype.updateNotify=function(){var t=this;this.notify=this._shared.notify,setTimeout(function(){return t.notify=t._shared.notify},1e3)},t.prototype.timeFormat=function(t){var e=Math.floor(t/3600),n=Math.floor(t%3600/60),r=Math.floor(t%3600%60);return(parseInt(e,10)<10?"0":"")+parseInt(e,10)+":"+(parseInt(n,10)<10?"0":"")+parseInt(n,10)+":"+(parseInt(r,10)<10?"0":"")+parseInt(r,10)},t}(),Yl=function(){function t(t,e,n){this.youtube=t,this.shared=e,this.app=n,this.thumbnails=!1,this.trendingFirst={bannerURL:"",video:{id:"",title:"",img:"",channelTitle:"",stats:{views:"",likes:"",dislikes:""}},stats:{subscribers:"",views:"",videoCount:""}},this.listGrid=!1,this.isDesktop=!0,this._shared=e,this._app=n}return t.prototype.checkMobile=function(){var t="WebkitAppearance"in document.documentElement.style,e=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);return t&&e?(console.log("IsMobile"),this.isDesktop=!1):this.isDesktop=!0},t.prototype.ngOnInit=function(){this.checkMobile(),this.setSettings(),this.searchFunction(),this.getFeedVideos()},t.prototype.searchFunction=function(){var t=this;this.searchForm=new In({searchInput:new Tn("",[Fe.required,Fe.minLength(2)])}),this.searchForm.valueChanges.subscribe(function(e){t.youtube.searchVideo(e.searchInput).subscribe(function(e){t.searchForm.invalid?t.getRelatedVideos():(t.videos=e.items,t._shared.lastSearchedVideos=t.videos,t.isHqKaraoke(e.items))},function(t){console.log("error on search")})})},t.prototype.isHqKaraoke=function(t){var e=this,n=t.map(function(t){return t.id.videoId});this.youtube.IsHighQualityVideo(n).subscribe(function(n){t.forEach(function(e,r){-1!==n.indexOf(e.id.videoId)&&(t[r].hq=!0)}),e.videos=t,e._shared.lastSearchedVideos=e.videos})},t.prototype.setSettings=function(){var t=this;this._shared.getSettings().subscribe(function(e){t.thumbnails=e.form_settings[0].value,t.listGrid=e.form_settings[1].value})},t.prototype.getFeedVideos=function(){var t=this;this._shared.getFeed().subscribe(function(e){t.feedVideos=e,t._app.feedVideos=e,t.getChannelTrending(t.feedVideos[0].snippet.channelId)})},t.prototype.getChannelTrending=function(t){var e=this;this._shared.getChannel(t).subscribe(function(t){e.feedVideos=e._shared.feedVideos,e.channel=e._shared.channel,e.trendingFirst.video.id=e.feedVideos[0].id,e.trendingFirst.video.title=e.feedVideos[0].snippet.title,e.trendingFirst.video.img=e.feedVideos[0].snippet.thumbnails.medium.url,e.trendingFirst.bannerURL=e.feedVideos[0].snippet.thumbnails.high.url,e.trendingFirst.video.channelTitle=e.channel.items[0].snippet.title})},t.prototype.clearSearch=function(){this.searchForm.reset(),document.getElementById("input-search").focus()},t.prototype.onSubmit=function(t){t.preventDefault()},t.prototype.onClickVideo=function(t,e,n){1===n?this._app.getVideo(this.videos[e]):3===n&&this._app.getVideo(this.feedVideos[e])},t.prototype.onCopyVideoItemLink=function(t,e){this._app.onCopyVideoItemLink(t,e)},t.prototype.addPlaylistItem=function(t,e){this._app.addPlaylistItem(t,e),this.videos&&(this.relatedVideoId=this.videos[t].id.videoId)},t.prototype.getRelatedVideos=function(){var t=this;this.relatedVideoId||(this.relatedVideoId=this.feedVideos[0].id.videoId),this.youtube.relatedVideos(this.relatedVideoId).subscribe(function(e){t.videos=e.items,t._shared.lastSearchedVideos=e.items,t.isHqKaraoke(e.items)},function(t){console.log("error on related videos")})},t}(),Jl=r._1({encapsulation:0,styles:["#search-video-list[_ngcontent-%COMP%] {\n              min-height: calc(100vh - 110px) !important;\n              overflow-y: auto;\n            }",".video-item-hq[_ngcontent-%COMP%] {\n              border: 3px solid #7bf78c;\n              box-shadow: 0px 0px 15px #7bf78c;\n              -moz-box-shadow: 0px 0px 15px #7bf78c;\n              -webkit-box-shadow: 0px 0px 14px #7bf78c;\n            }"],data:{}});function Xl(t){return r._25(0,[(t()(),r._3(0,0,null,null,2,"div",[["class","video-item-image"]],null,null,null,null,null)),r._2(1,278528,null,0,Q,[r.r,r.k,r.B],{ngStyle:[0,"ngStyle"]},null),r._17(2,{"background-image":0})],function(t,e){t(e,1,0,t(e,2,0,"url("+e.parent.context.$implicit.snippet.thumbnails.default.url+")"))},null)}function Zl(t){return r._25(0,[(t()(),r._3(0,0,null,null,3,"button",[["class","video-item-play"]],null,[[null,"click"]],function(t,e,n){var r=!0;return"click"===e&&(r=!1!==t.component.onClickVideo(n,t.parent.context.index,1)&&r),r},null,null)),(t()(),r._23(-1,null,["\n                "])),(t()(),r._3(2,0,null,null,0,"span",[["class","fa fa-play"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n              "]))],null,null)}function $l(t){return r._25(0,[(t()(),r._3(0,0,null,null,36,"div",[["class","video-item"]],[[1,"data-index",0]],null,null,null,null)),r._2(1,278528,null,0,U,[r.q,r.r,r.k,r.B],{klass:[0,"klass"],ngClass:[1,"ngClass"]},null),r._17(2,{"video-item-hq":0}),(t()(),r._23(-1,null,["\n            "])),(t()(),r._3(4,0,null,null,15,"div",[["class","video-item-info"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n              "])),(t()(),r.Y(16777216,null,null,1,null,Xl)),r._2(7,16384,null,0,K,[r.M,r.J],{ngIf:[0,"ngIf"]},null),(t()(),r._23(-1,null,["\n              "])),(t()(),r._3(9,0,null,null,9,"div",[["class","video-item-content"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n                  "])),(t()(),r._3(11,0,null,null,1,"p",[["class","video-item-title"]],null,null,null,null,null)),(t()(),r._23(12,null,["",""])),(t()(),r._23(-1,null,["\n                  "])),(t()(),r._3(14,0,null,null,3,"p",[["class","video-item-autor"]],null,null,null,null,null)),(t()(),r._23(-1,null,["by "])),(t()(),r._3(16,0,null,null,1,"span",[],null,null,null,null,null)),(t()(),r._23(17,null,["",""])),(t()(),r._23(-1,null,["\n              "])),(t()(),r._23(-1,null,["\n            "])),(t()(),r._23(-1,null,["\n            "])),(t()(),r._3(21,0,null,null,14,"div",[["class","video-item-settings"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n              "])),(t()(),r.Y(16777216,null,null,1,null,Zl)),r._2(24,16384,null,0,K,[r.M,r.J],{ngIf:[0,"ngIf"]},null),(t()(),r._23(-1,null,["\n              "])),(t()(),r._3(26,0,null,null,3,"button",[["class","video-item-share"]],null,[[null,"click"]],function(t,e,n){var r=!0;return"click"===e&&(r=!1!==t.component.onCopyVideoItemLink(t.context.index,1)&&r),r},null,null)),(t()(),r._23(-1,null,["\n                "])),(t()(),r._3(28,0,null,null,0,"span",[["class","fa fa-share-alt"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n              "])),(t()(),r._23(-1,null,["\n              "])),(t()(),r._3(31,0,null,null,3,"button",[["class","video-item-add"]],null,[[null,"click"]],function(t,e,n){var r=!0;return"click"===e&&(r=!1!==t.component.addPlaylistItem(t.context.index,1)&&r),r},null,null)),(t()(),r._23(-1,null,["\n                "])),(t()(),r._3(33,0,null,null,0,"span",[["class","fa fa-plus"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n              "])),(t()(),r._23(-1,null,["\n            "])),(t()(),r._23(-1,null,["\n          "]))],function(t,e){var n=e.component;t(e,1,0,"video-item",t(e,2,0,e.context.$implicit.hq)),t(e,7,0,n.thumbnails),t(e,24,0,n.isDesktop)},function(t,e){t(e,0,0,e.context.index),t(e,12,0,e.context.$implicit.snippet.title),t(e,17,0,e.context.$implicit.snippet.channelTitle)})}function tc(t){return r._25(0,[(t()(),r._3(0,0,null,null,11,null,null,null,null,null,null,null)),(t()(),r._23(-1,null,["\n          "])),(t()(),r._3(2,0,null,null,0,"span",[["class","search-list arrow-up"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n          "])),(t()(),r._23(-1,null,["\n        "])),(t()(),r._3(5,0,null,null,5,"div",[["class","video-list"],["id","search-video-list"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n          "])),(t()(),r._23(-1,null,["\n          "])),(t()(),r.Y(16777216,null,null,1,null,$l)),r._2(9,802816,null,0,q,[r.M,r.J,r.q],{ngForOf:[0,"ngForOf"]},null),(t()(),r._23(-1,null,["\n        "])),(t()(),r._23(-1,null,["\n      "]))],function(t,e){t(e,9,0,e.component.videos)},null)}function ec(t){return r._25(0,[(t()(),r._3(0,0,null,null,2,"div",[["class","video-item-image"]],null,null,null,null,null)),r._2(1,278528,null,0,Q,[r.r,r.k,r.B],{ngStyle:[0,"ngStyle"]},null),r._17(2,{"background-image":0})],function(t,e){t(e,1,0,t(e,2,0,"url("+e.component.trendingFirst.video.img+")"))},null)}function nc(t){return r._25(0,[(t()(),r._3(0,0,null,null,16,"div",[["class","video-item-details"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n                  "])),(t()(),r._3(2,0,null,null,3,"p",[["class","stats-views"]],null,null,null,null,null)),(t()(),r._3(3,0,null,null,0,"span",[["class","fa fa-eye"]],null,null,null,null,null)),(t()(),r._23(4,null,[" ",""])),r._18(5,2),(t()(),r._23(-1,null,["\n                  "])),(t()(),r._3(7,0,null,null,3,"p",[["class","stats-likes"]],null,null,null,null,null)),(t()(),r._3(8,0,null,null,0,"span",[["class","fa fa-thumbs-up"]],null,null,null,null,null)),(t()(),r._23(9,null,[" ",""])),r._18(10,2),(t()(),r._23(-1,null,["\n                  "])),(t()(),r._3(12,0,null,null,3,"p",[["class","stats-dislikes"]],null,null,null,null,null)),(t()(),r._3(13,0,null,null,0,"span",[["class","fa fa-thumbs-down"]],null,null,null,null,null)),(t()(),r._23(14,null,[" ",""])),r._18(15,2),(t()(),r._23(-1,null,["\n              "]))],null,function(t,e){var n=e.component;t(e,4,0,r._24(e,4,0,t(e,5,0,r._14(e.parent.parent,0),n.trendingFirst.video.stats.views,"1.0"))),t(e,9,0,r._24(e,9,0,t(e,10,0,r._14(e.parent.parent,0),n.trendingFirst.video.stats.likes,"1.0"))),t(e,14,0,r._24(e,14,0,t(e,15,0,r._14(e.parent.parent,0),n.trendingFirst.video.stats.dislikes,"1.0")))})}function rc(t){return r._25(0,[(t()(),r._3(0,0,null,null,3,"button",[["class","btn btn-primary btn-round"]],null,[[null,"click"]],function(t,e,n){var r=!0;return"click"===e&&(r=!1!==t.component.onClickVideo(n,0,3)&&r),r},null,null)),(t()(),r._23(-1,null,["\n              "])),(t()(),r._3(2,0,null,null,0,"span",[["class","fa fa-play"]],null,null,null,null,null)),(t()(),r._23(-1,null,["Play video\n            "]))],null,null)}function ic(t){return r._25(0,[(t()(),r._3(0,0,null,null,2,"div",[["class","video-item-image"]],null,null,null,null,null)),r._2(1,278528,null,0,Q,[r.r,r.k,r.B],{ngStyle:[0,"ngStyle"]},null),r._17(2,{"background-image":0})],function(t,e){t(e,1,0,t(e,2,0,"url("+e.parent.context.$implicit.snippet.thumbnails.medium.url+")"))},null)}function oc(t){return r._25(0,[(t()(),r._3(0,0,null,null,16,"div",[["class","video-item-details"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n                "])),(t()(),r._3(2,0,null,null,3,"p",[["class","stats-views"]],null,null,null,null,null)),(t()(),r._3(3,0,null,null,0,"span",[["class","fa fa-eye"]],null,null,null,null,null)),(t()(),r._23(4,null,[" ",""])),r._18(5,2),(t()(),r._23(-1,null,["\n                "])),(t()(),r._3(7,0,null,null,3,"p",[["class","stats-likes"]],null,null,null,null,null)),(t()(),r._3(8,0,null,null,0,"span",[["class","fa fa-thumbs-up"]],null,null,null,null,null)),(t()(),r._23(9,null,[" ",""])),r._18(10,2),(t()(),r._23(-1,null,["\n                "])),(t()(),r._3(12,0,null,null,3,"p",[["class","stats-dislikes"]],null,null,null,null,null)),(t()(),r._3(13,0,null,null,0,"span",[["class","fa fa-thumbs-down"]],null,null,null,null,null)),(t()(),r._23(14,null,[" ",""])),r._18(15,2),(t()(),r._23(-1,null,["\n            "]))],null,function(t,e){t(e,4,0,r._24(e,4,0,t(e,5,0,r._14(e.parent.parent.parent,0),e.parent.context.$implicit.statistics.viewCount,"1.0"))),t(e,9,0,r._24(e,9,0,t(e,10,0,r._14(e.parent.parent.parent,0),e.parent.context.$implicit.statistics.likeCount,"1.0"))),t(e,14,0,r._24(e,14,0,t(e,15,0,r._14(e.parent.parent.parent,0),e.parent.context.$implicit.statistics.dislikeCount,"1.0")))})}function sc(t){return r._25(0,[(t()(),r._3(0,0,null,null,3,"button",[["class","video-item-play"]],null,[[null,"click"]],function(t,e,n){var r=!0;return"click"===e&&(r=!1!==t.component.onClickVideo(n,t.parent.context.index,3)&&r),r},null,null)),(t()(),r._23(-1,null,["\n              "])),(t()(),r._3(2,0,null,null,0,"span",[["class","fa fa-play"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n            "]))],null,null)}function ac(t){return r._25(0,[(t()(),r._3(0,0,null,null,39,"div",[["class","video-item"]],[[1,"data-index",0]],null,null,null,null)),r._2(1,278528,null,0,U,[r.q,r.r,r.k,r.B],{klass:[0,"klass"],ngClass:[1,"ngClass"]},null),r._17(2,{"hidden-thumbnails":0}),(t()(),r._23(-1,null,["\n        "])),(t()(),r._3(4,0,null,null,18,"div",[["class","video-item-info"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n          "])),(t()(),r.Y(16777216,null,null,1,null,ic)),r._2(7,16384,null,0,K,[r.M,r.J],{ngIf:[0,"ngIf"]},null),(t()(),r._23(-1,null,["\n          "])),(t()(),r._3(9,0,null,null,12,"div",[["class","video-item-content"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n            "])),(t()(),r._3(11,0,null,null,1,"p",[["class","video-item-title"]],null,null,null,null,null)),(t()(),r._23(12,null,["",""])),(t()(),r._23(-1,null,["\n            "])),(t()(),r._3(14,0,null,null,3,"p",[["class","video-item-autor"]],null,null,null,null,null)),(t()(),r._23(-1,null,["by "])),(t()(),r._3(16,0,null,null,1,"span",[],null,null,null,null,null)),(t()(),r._23(17,null,["",""])),(t()(),r._23(-1,null,["\n            "])),(t()(),r.Y(16777216,null,null,1,null,oc)),r._2(20,16384,null,0,K,[r.M,r.J],{ngIf:[0,"ngIf"]},null),(t()(),r._23(-1,null,["\n          "])),(t()(),r._23(-1,null,["\n        "])),(t()(),r._23(-1,null,["\n        "])),(t()(),r._3(24,0,null,null,14,"div",[["class","video-item-settings"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n            "])),(t()(),r.Y(16777216,null,null,1,null,sc)),r._2(27,16384,null,0,K,[r.M,r.J],{ngIf:[0,"ngIf"]},null),(t()(),r._23(-1,null,["\n            "])),(t()(),r._3(29,0,null,null,3,"button",[["class","video-item-play"]],null,[[null,"click"]],function(t,e,n){var r=!0;return"click"===e&&(r=!1!==t.component.onCopyVideoItemLink(t.context.index,0)&&r),r},null,null)),(t()(),r._23(-1,null,["\n              "])),(t()(),r._3(31,0,null,null,0,"span",[["class","fa fa-share-alt"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n            "])),(t()(),r._23(-1,null,["\n            "])),(t()(),r._3(34,0,null,null,3,"button",[["class","video-item-add"]],null,[[null,"click"]],function(t,e,n){var r=!0;return"click"===e&&(r=!1!==t.component.addPlaylistItem(t.context.index,0)&&r),r},null,null)),(t()(),r._23(-1,null,["\n              "])),(t()(),r._3(36,0,null,null,0,"span",[["class","fa fa-plus"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n            "])),(t()(),r._23(-1,null,["\n          "])),(t()(),r._23(-1,null,["\n      "]))],function(t,e){var n=e.component;t(e,1,0,"video-item",t(e,2,0,!n.thumbnails)),t(e,7,0,n.thumbnails),t(e,20,0,(null==e.context.$implicit.id?null:e.context.$implicit.id.length)>0),t(e,27,0,n.isDesktop)},function(t,e){t(e,0,0,e.context.index),t(e,12,0,e.context.$implicit.snippet.title),t(e,17,0,e.context.$implicit.snippet.channelTitle)})}function uc(t){return r._25(0,[(t()(),r._3(0,0,null,null,0,"div",[["class","video-item-image"],["style","background-image:url(http://youtubek.azurewebsites.net/app/assets/img/smartkara.png)"]],null,null,null,null,null))],null,null)}function lc(t){return r._25(0,[(t()(),r._3(0,0,null,null,83,null,null,null,null,null,null,null)),(t()(),r._23(-1,null,["\n    "])),(t()(),r._3(2,0,null,null,43,"div",[["class","video-list-featured"]],null,null,null,null,null)),r._2(3,278528,null,0,Q,[r.r,r.k,r.B],{ngStyle:[0,"ngStyle"]},null),r._17(4,{"background-image":0}),(t()(),r._23(-1,null,["\n        "])),(t()(),r._3(6,0,null,null,37,"div",[["class","video-item"]],[[1,"data-index",0]],null,null,null,null)),(t()(),r._23(-1,null,["\n          "])),(t()(),r._3(8,0,null,null,18,"div",[["class","video-item-info"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n            "])),(t()(),r.Y(16777216,null,null,1,null,ec)),r._2(11,16384,null,0,K,[r.M,r.J],{ngIf:[0,"ngIf"]},null),(t()(),r._23(-1,null,["\n            "])),(t()(),r._3(13,0,null,null,12,"div",[["class","video-item-content"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n              "])),(t()(),r._3(15,0,null,null,1,"p",[["class","video-item-title"]],null,null,null,null,null)),(t()(),r._23(16,null,["",""])),(t()(),r._23(-1,null,["\n              "])),(t()(),r._3(18,0,null,null,3,"p",[["class","video-item-autor"]],null,null,null,null,null)),(t()(),r._23(-1,null,["by "])),(t()(),r._3(20,0,null,null,1,"span",[],null,null,null,null,null)),(t()(),r._23(21,null,["",""])),(t()(),r._23(-1,null,["\n              "])),(t()(),r.Y(16777216,null,null,1,null,nc)),r._2(24,16384,null,0,K,[r.M,r.J],{ngIf:[0,"ngIf"]},null),(t()(),r._23(-1,null,["\n            "])),(t()(),r._23(-1,null,["\n          "])),(t()(),r._23(-1,null,["\n          "])),(t()(),r._3(28,0,null,null,14,"div",[["class","video-item-settings-featured"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n            "])),(t()(),r.Y(16777216,null,null,1,null,rc)),r._2(31,16384,null,0,K,[r.M,r.J],{ngIf:[0,"ngIf"]},null),(t()(),r._23(-1,null,["\n            "])),(t()(),r._3(33,0,null,null,3,"button",[["class","btn btn-default btn-outline btn-round"]],null,[[null,"click"]],function(t,e,n){var r=!0;return"click"===e&&(r=!1!==t.component.addPlaylistItem(0,0)&&r),r},null,null)),(t()(),r._23(-1,null,["\n              "])),(t()(),r._3(35,0,null,null,0,"span",[["class","fa fa-plus"]],null,null,null,null,null)),(t()(),r._23(-1,null,["Add to playlist\n            "])),(t()(),r._23(-1,null,["\n            "])),(t()(),r._3(38,0,null,null,3,"button",[["class","btn copy-link"]],null,[[null,"click"]],function(t,e,n){var r=!0;return"click"===e&&(r=!1!==t.component.onCopyVideoItemLink(0,0)&&r),r},null,null)),(t()(),r._23(-1,null,["\n              "])),(t()(),r._3(40,0,null,null,0,"span",[["class","fa fa-share-alt"]],null,null,null,null,null)),(t()(),r._23(-1,null,["Copy link\n            "])),(t()(),r._23(-1,null,["\n          "])),(t()(),r._23(-1,null,["\n        "])),(t()(),r._23(-1,null,["\n       "])),(t()(),r._23(-1,null,["\n    "])),(t()(),r._23(-1,null,["\n    "])),(t()(),r._3(47,0,null,null,35,"div",[["class","video-list"],["id","feed-video-list"]],null,null,null,null,null)),r._2(48,278528,null,0,U,[r.q,r.r,r.k,r.B],{klass:[0,"klass"],ngClass:[1,"ngClass"]},null),r._17(49,{"grid-list":0}),(t()(),r._23(-1,null,["\n      "])),(t()(),r.Y(16777216,null,null,1,null,ac)),r._2(52,802816,null,0,q,[r.M,r.J,r.q],{ngForOf:[0,"ngForOf"]},null),(t()(),r._23(-1,null,["        \n      "])),(t()(),r._23(-1,null,["\n      "])),(t()(),r._3(55,0,null,null,26,"div",[["class","video-item"]],null,[[null,"click"]],function(t,e,n){var r=!0;return"click"===e&&(r=!1!==t.component.getFeedVideos()&&r),r},null,null)),r._2(56,278528,null,0,U,[r.q,r.r,r.k,r.B],{klass:[0,"klass"],ngClass:[1,"ngClass"]},null),r._17(57,{"hidden-thumbnails":0}),(t()(),r._23(-1,null,["\n        "])),(t()(),r._3(59,0,null,null,13,"div",[["class","video-item-info"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n          "])),(t()(),r.Y(16777216,null,null,1,null,uc)),r._2(62,16384,null,0,K,[r.M,r.J],{ngIf:[0,"ngIf"]},null),(t()(),r._23(-1,null,["\n          "])),(t()(),r._3(64,0,null,null,7,"div",[["class","video-item-content"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n            "])),(t()(),r._3(66,0,null,null,1,"p",[["class","video-item-title"]],null,null,null,null,null)),(t()(),r._23(-1,null,["LOAD PA MORE..."])),(t()(),r._23(-1,null,["\n            "])),(t()(),r._3(69,0,null,null,1,"p",[["class","video-item-autor"]],null,null,null,null,null)),(t()(),r._23(-1,null,["Load more karaoke videos"])),(t()(),r._23(-1,null,["\n          "])),(t()(),r._23(-1,null,["\n        "])),(t()(),r._23(-1,null,["\n        "])),(t()(),r._3(74,0,null,null,6,"div",[["class","video-item-settings"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n            "])),(t()(),r._3(76,0,null,null,3,"button",[["class","video-item-add"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n              "])),(t()(),r._3(78,0,null,null,0,"span",[["class","fa fa-plus"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n            "])),(t()(),r._23(-1,null,["\n        "])),(t()(),r._23(-1,null,["\n      "])),(t()(),r._23(-1,null,[" \n    "])),(t()(),r._23(-1,null,["\n\n\n\n    \n  "]))],function(t,e){var n=e.component;t(e,3,0,t(e,4,0,"url("+n.trendingFirst.bannerURL+")")),t(e,11,0,n.thumbnails),t(e,24,0,(null==n.trendingFirst.video.id?null:n.trendingFirst.video.id.length)>0),t(e,31,0,n.isDesktop),t(e,48,0,"video-list",t(e,49,0,!n.listGrid)),t(e,52,0,n.feedVideos),t(e,56,0,"video-item",t(e,57,0,!n.thumbnails)),t(e,62,0,n.thumbnails)},function(t,e){var n=e.component;t(e,6,0,0),t(e,16,0,n.trendingFirst.video.title),t(e,21,0,n.trendingFirst.video.channelTitle)})}function cc(t){return r._25(0,[r._16(0,J,[r.s]),(t()(),r._3(1,0,null,null,31,"div",[["class","app-head"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n  "])),(t()(),r._3(3,0,null,null,28,"form",[["autocomplete","off"],["id","main-search"],["novalidate",""],["role","search"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngSubmit"],[null,"submit"],[null,"reset"]],function(t,e,n){var i=!0,o=t.component;return"submit"===e&&(i=!1!==r._14(t,5).onSubmit(n)&&i),"reset"===e&&(i=!1!==r._14(t,5).onReset()&&i),"ngSubmit"===e&&(i=!1!==o.onSubmit(n)&&i),i},null,null)),r._2(4,16384,null,0,jn,[],null,null),r._2(5,540672,null,0,Nn,[[8,null],[8,null]],{form:[0,"form"]},{ngSubmit:"ngSubmit"}),r._19(2048,null,De,null,[Nn]),r._2(7,16384,null,0,bn,[De],null,null),(t()(),r._23(-1,null,["\n      "])),(t()(),r._3(9,0,null,null,17,"div",[["class","form-group"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n        "])),(t()(),r._3(11,0,null,null,14,"div",[["class","input-group"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n          "])),(t()(),r._3(13,0,null,null,5,"input",[["autocomplete","off"],["class","form-control"],["formControlName","searchInput"],["id","input-search"],["placeholder","Search karaoke by Title or Artists..."],["type","text"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(t,e,n){var i=!0;return"input"===e&&(i=!1!==r._14(t,14)._handleInput(n.target.value)&&i),"blur"===e&&(i=!1!==r._14(t,14).onTouched()&&i),"compositionstart"===e&&(i=!1!==r._14(t,14)._compositionStart()&&i),"compositionend"===e&&(i=!1!==r._14(t,14)._compositionEnd(n.target.value)&&i),i},null,null)),r._2(14,16384,null,0,Ke,[r.B,r.k,[2,He]],null,null),r._19(1024,null,Be,function(t){return[t]},[Ke]),r._2(16,671744,null,0,Vn,[[3,De],[8,null],[8,null],[2,Be]],{name:[0,"name"]},null),r._19(2048,null,Ye,null,[Vn]),r._2(18,16384,null,0,_n,[Ye],null,null),(t()(),r._23(-1,null,["\n          "])),(t()(),r._3(20,0,null,null,1,"label",[["class","search-icon"],["for","input-search"]],null,null,null,null,null)),(t()(),r._3(21,0,null,null,0,"span",[["class","fa fa-search"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n          "])),(t()(),r._3(23,0,null,null,1,"button",[["class","clear-button"]],null,[[null,"click"]],function(t,e,n){var r=!0;return"click"===e&&(r=!1!==t.component.clearSearch()&&r),r},null,null)),(t()(),r._3(24,0,null,null,0,"span",[["class","fa fa-times"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n        "])),(t()(),r._23(-1,null,["\n      "])),(t()(),r._23(-1,null,["\n      "])),(t()(),r._23(-1,null,["\n      "])),(t()(),r.Y(16777216,null,null,1,null,tc)),r._2(30,16384,null,0,K,[r.M,r.J],{ngIf:[0,"ngIf"]},null),(t()(),r._23(-1,null,["\n  "])),(t()(),r._23(-1,null,["\n"])),(t()(),r._23(-1,null,["\n"])),(t()(),r._3(34,0,null,null,4,"div",[["class","app-content"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n  "])),(t()(),r.Y(16777216,null,null,1,null,lc)),r._2(37,16384,null,0,K,[r.M,r.J],{ngIf:[0,"ngIf"]},null),(t()(),r._23(-1,null,["\n"]))],function(t,e){var n=e.component;t(e,5,0,n.searchForm),t(e,16,0,"searchInput"),t(e,30,0,(null==n.videos?null:n.videos.length)>0),t(e,37,0,n.feedVideos)},function(t,e){t(e,3,0,r._14(e,7).ngClassUntouched,r._14(e,7).ngClassTouched,r._14(e,7).ngClassPristine,r._14(e,7).ngClassDirty,r._14(e,7).ngClassValid,r._14(e,7).ngClassInvalid,r._14(e,7).ngClassPending),t(e,13,0,r._14(e,18).ngClassUntouched,r._14(e,18).ngClassTouched,r._14(e,18).ngClassPristine,r._14(e,18).ngClassDirty,r._14(e,18).ngClassValid,r._14(e,18).ngClassInvalid,r._14(e,18).ngClassPending)})}var hc=r.Z("app-search",Yl,function(t){return r._25(0,[(t()(),r._3(0,0,null,null,1,"app-search",[],null,null,null,cc,Jl)),r._2(1,114688,null,0,Yl,[Sr,Pl,Wl],null,null)],function(t,e){t(e,1,0)},null)},{},{},[]),fc=function(){function t(t,e){this.shared=t,this.app=e,this.thumbnails=!1,this._shared=t,this._app=e}return t.prototype.ngOnInit=function(){console.log("history"),this.initHistory(),this.getSettings()},t.prototype.initHistory=function(){this.historyVideos=this._shared.historyVideos},t.prototype.getSettings=function(){var t=this;this._shared.getSettings().subscribe(function(e){t.thumbnails=e.form_settings[0].value})},t.prototype.addPlaylistItem=function(t,e){this._app.addPlaylistItem(t,e)},t.prototype.onCopyVideoItemLink=function(t,e){this._app.onCopyVideoItemLink(t,e)},t.prototype.onClickHistory=function(t,e){this._app.getVideo(this.historyVideos[e])},t}(),pc=r._1({encapsulation:2,styles:[],data:{}});function dc(t){return r._25(0,[(t()(),r._3(0,0,null,null,1,"div",[["class","video-list-info"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n            No history\n        "]))],null,null)}function yc(t){return r._25(0,[(t()(),r._3(0,0,null,null,2,"div",[["class","video-item-image"]],null,null,null,null,null)),r._2(1,278528,null,0,Q,[r.r,r.k,r.B],{ngStyle:[0,"ngStyle"]},null),r._17(2,{"background-image":0})],function(t,e){t(e,1,0,t(e,2,0,"url("+e.parent.context.$implicit.snippet.thumbnails.default.url+")"))},null)}function mc(t){return r._25(0,[(t()(),r._3(0,0,null,null,36,"div",[["class","video-item"]],[[1,"data-index",0]],null,null,null,null)),(t()(),r._23(-1,null,["\n            "])),(t()(),r._3(2,0,null,null,15,"div",[["class","video-item-info"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n                "])),(t()(),r.Y(16777216,null,null,1,null,yc)),r._2(5,16384,null,0,K,[r.M,r.J],{ngIf:[0,"ngIf"]},null),(t()(),r._23(-1,null,["\n                "])),(t()(),r._3(7,0,null,null,9,"div",[["class","video-item-content"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n                "])),(t()(),r._3(9,0,null,null,1,"p",[["class","video-item-title"]],null,null,null,null,null)),(t()(),r._23(10,null,["",""])),(t()(),r._23(-1,null,["\n                "])),(t()(),r._3(12,0,null,null,3,"p",[["class","video-item-autor"]],null,null,null,null,null)),(t()(),r._23(-1,null,["by "])),(t()(),r._3(14,0,null,null,1,"span",[],null,null,null,null,null)),(t()(),r._23(15,null,["",""])),(t()(),r._23(-1,null,["                      \n                "])),(t()(),r._23(-1,null,["\n            "])),(t()(),r._23(-1,null,["\n            "])),(t()(),r._3(19,0,null,null,16,"div",[["class","video-item-settings"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n                "])),(t()(),r._3(21,0,null,null,3,"button",[["class","video-item-play"]],null,[[null,"click"]],function(t,e,n){var r=!0;return"click"===e&&(r=!1!==t.component.onClickHistory(n,t.context.index)&&r),r},null,null)),(t()(),r._23(-1,null,["\n                "])),(t()(),r._3(23,0,null,null,0,"span",[["class","fa fa-play"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n                "])),(t()(),r._23(-1,null,["\n                "])),(t()(),r._3(26,0,null,null,3,"button",[["class","video-item-share"]],null,[[null,"click"]],function(t,e,n){var r=!0;return"click"===e&&(r=!1!==t.component.onCopyVideoItemLink(t.context.index,4)&&r),r},null,null)),(t()(),r._23(-1,null,["\n                "])),(t()(),r._3(28,0,null,null,0,"span",[["class","fa fa-share-alt"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n                "])),(t()(),r._23(-1,null,["\n                "])),(t()(),r._3(31,0,null,null,3,"button",[["class","video-item-add"]],null,[[null,"click"]],function(t,e,n){var r=!0;return"click"===e&&(r=!1!==t.component.addPlaylistItem(t.context.index,4)&&r),r},null,null)),(t()(),r._23(-1,null,["\n                "])),(t()(),r._3(33,0,null,null,0,"span",[["class","fa fa-plus"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n                "])),(t()(),r._23(-1,null,["\n            "])),(t()(),r._23(-1,null,["\n        "]))],function(t,e){t(e,5,0,e.component.thumbnails)},function(t,e){t(e,0,0,e.context.index),t(e,10,0,e.context.$implicit.snippet.title),t(e,15,0,e.context.$implicit.snippet.channelTitle)})}function gc(t){return r._25(0,[(t()(),r._3(0,0,null,null,4,"div",[["class","app-head"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n    "])),(t()(),r._3(2,0,null,null,1,"h2",[],null,null,null,null,null)),(t()(),r._23(-1,null,["History"])),(t()(),r._23(-1,null,["\n"])),(t()(),r._23(-1,null,["\n"])),(t()(),r._3(6,0,null,null,10,"div",[["class","app-content"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n    "])),(t()(),r._3(8,0,null,null,7,"div",[["class","history-video-content"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n        "])),(t()(),r.Y(16777216,null,null,1,null,dc)),r._2(11,16384,null,0,K,[r.M,r.J],{ngIf:[0,"ngIf"]},null),(t()(),r._23(-1,null,["\n        "])),(t()(),r.Y(16777216,null,null,1,null,mc)),r._2(14,802816,null,0,q,[r.M,r.J,r.q],{ngForOf:[0,"ngForOf"]},null),(t()(),r._23(-1,null,["\n    "])),(t()(),r._23(-1,null,["\n"]))],function(t,e){var n=e.component;t(e,11,0,0===n.historyVideos.length),t(e,14,0,n.historyVideos)},null)}var vc=r.Z("app-history",fc,function(t){return r._25(0,[(t()(),r._3(0,0,null,null,1,"app-history",[],null,null,null,gc,pc)),r._2(1,114688,null,0,fc,[Pl,Wl],null,null)],function(t,e){t(e,1,0)},null)},{},{},[]),_c=function(){function t(){}return t.prototype.ngOnInit=function(){console.log("about")},t}(),bc=r._1({encapsulation:2,styles:[],data:{}});function wc(t){return r._25(0,[(t()(),r._3(0,0,null,null,4,"div",[["class","app-head"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n    "])),(t()(),r._3(2,0,null,null,1,"h2",[],null,null,null,null,null)),(t()(),r._23(-1,null,["About YoutubeK"])),(t()(),r._23(-1,null,["\n"])),(t()(),r._23(-1,null,["\n"])),(t()(),r._3(6,0,null,null,29,"div",[["class","app-content"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n    "])),(t()(),r._3(8,0,null,null,1,"p",[],null,null,null,null,null)),(t()(),r._23(-1,null,["Fork by Bernard Gabon base on angular2-yt-player of Alex Olari."])),(t()(),r._23(-1,null,["\n    "])),(t()(),r._3(11,0,null,null,1,"p",[],null,null,null,null,null)),(t()(),r._23(-1,null,["This is a simple music queing app for Youtube karaoke session, based on angular-cli 1.4, NWjs 0.25.2, Firebase/Firestore, ng2-youtube-player 0.0.3 (used for youtube iFrame API), SCSS (CSS3), HTML5 and webkit functions."])),(t()(),r._23(-1,null,["\n    "])),(t()(),r._3(14,0,null,null,1,"p",[],null,null,null,null,null)),(t()(),r._23(-1,null,["This karaoke player is compatible only with Chrome/webkit/Safari/Mac/iOS browsers."])),(t()(),r._23(-1,null,["\n    "])),(t()(),r._3(17,0,null,null,1,"p",[],null,null,null,null,null)),(t()(),r._23(-1,null,["The project status is beta."])),(t()(),r._23(-1,null,["\n    "])),(t()(),r._3(20,0,null,null,1,"p",[],null,null,null,null,null)),(t()(),r._23(-1,null,["\xa0"])),(t()(),r._23(-1,null,["\n    "])),(t()(),r._3(23,0,null,null,1,"h2",[],null,null,null,null,null)),(t()(),r._23(-1,null,["Adblock for Youtube"])),(t()(),r._23(-1,null,["\n    "])),(t()(),r._3(26,0,null,null,8,"p",[],null,null,null,null,null)),(t()(),r._23(-1,null,["For a smooth ad-banner-free karaoke experience, please install \n            "])),(t()(),r._3(28,0,null,null,5,"a",[["href","https://chrome.google.com/webstore/detail/adblock-for-youtube/cmedhionkhpnakcndndgjdbohmhepckk"]],null,null,null,null,null)),(t()(),r._23(-1,null,["Adblock for Chrome. "])),(t()(),r._3(30,0,null,null,0,"br",[],null,null,null,null,null)),(t()(),r._23(-1,null,["\n                "])),(t()(),r._3(32,0,null,null,0,"img",[["alt","Extension"],["aria-label","Extension"],["src","https://lh3.googleusercontent.com/wHakeb5_9Tt5ymF5T3l3waztfFZKnwg6DNLT3kxH75vkmSal6jBPK9_E0WdXyABvdMGIa6oo_w=w26-h26-e365"],["style"," width:26px; height:26px;"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n            "])),(t()(),r._23(-1,null,["\n        "])),(t()(),r._23(-1,null,["\n\n        \n\n"]))],null,null)}var Ec=r.Z("app-about",_c,function(t){return r._25(0,[(t()(),r._3(0,0,null,null,1,"app-about",[],null,null,null,wc,bc)),r._2(1,114688,null,0,_c,[],null,null)],function(t,e){t(e,1,0)},null)},{},{},[]),Sc=function(){function t(){}return t.max=function(t){return function(e){return e.pristine||e.pristine?null:e.value<=t?null:{max:!0}}},t.min=function(t){return function(e){return e.pristine||e.pristine?null:e.value>=t?null:{min:!0}}},t.isNumber=function(t){return function(t){return/\d{0,9}/.test(t.value)?null:{invalid:!0}}},t}(),Cc=function(){function t(t,e,n,r,i){this.fb=t,this.http=e,this.shared=n,this.app=r,this.search=i,this.finished=!1,this._shared=n,this._fb=t,this._app=r,this._search=i,this.notify=this._shared.notify}return t.prototype.ngOnInit=function(){console.log("settings"),this.getDefaultSettings()},t.prototype.setForm=function(){this.internalSettings=this._fb.group({settings:this.mapSettings()}),this.checkInputs()},t.prototype.initExternalForm=function(){this.externalSettings=new In({fcApi:new Tn(this.external_settings[0].value),fcRegion:new Tn(this.external_settings[1].value,Fe.required),fcSearchresults:new Tn(this.external_settings[2].value,[Fe.required,Sc.max(50),Sc.min(1),Sc.isNumber(!0)]),fcRelatedResults:new Tn(this.external_settings[3].value,[Fe.required,Sc.max(50),Sc.min(1),Sc.isNumber(!0)])})},Object.defineProperty(t.prototype,"initInternalForm",{get:function(){return this.internalSettings.get("settings")},enumerable:!0,configurable:!0}),t.prototype.checkInputs=function(){var t=this;this.internalSettings.valueChanges.subscribe(function(e){Object.keys(e.settings).map(function(n){t.internal_settings[n].value=e.settings[n]}),t._shared.form_settings=t.internal_settings,t._app.setSettings(),t._app.checkVolumeRange(),t._search.setSettings(),t._shared.updateSettings(),t._shared.triggerNotify("Changed"),t.updateNotify()})},t.prototype.mapSettings=function(){var t=this,e=this.internal_settings.map(function(e){return t._fb.control(e.value)});return this.fb.array(e)},t.prototype.getDefaultSettings=function(){var t=this;this._shared.getSettings().subscribe(function(e){t.internal_settings=e.form_settings,t.external_settings=e.api_settings,t.initExternalForm(),t.finished=!0,t.setForm()})},t.prototype.updateNotify=function(){var t=this;this.notify=this._shared.notify,setTimeout(function(){return t.notify=t._shared.notify},1e3)},t.prototype.externalSave=function(){this.externalSettings.valid?(this.external_settings[0].value=this.externalSettings.controls.fcApi.value,this.external_settings[1].value=this.externalSettings.controls.fcRegion.value,this.external_settings[2].value=parseInt(this.externalSettings.controls.fcSearchresults.value,10),this.external_settings[3].value=parseInt(this.externalSettings.controls.fcRelatedResults.value,10),this._shared.settings.api_settings=this.external_settings,this._shared.feedVideos=null,this._shared.setApiSettings(),this._app.setSettings(),this._app.getFeedVideos(),this._shared.updateSettings(),this._shared.triggerNotify("Saved"),this.updateNotify()):(this._shared.triggerNotify("Please check external settings"),this.updateNotify())},t}(),Tc=r._1({encapsulation:2,styles:[],data:{}});function Ic(t){return r._25(0,[(t()(),r._3(0,0,null,null,14,"div",[["class","form-group"]],null,null,null,null,null)),r._2(1,278528,null,0,U,[r.q,r.r,r.k,r.B],{klass:[0,"klass"],ngClass:[1,"ngClass"]},null),r._17(2,{hide:0}),(t()(),r._23(-1,null,["\n            "])),(t()(),r._3(4,0,null,null,5,"input",[["type","checkbox"]],[[1,"id",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"change"],[null,"blur"]],function(t,e,n){var i=!0;return"change"===e&&(i=!1!==r._14(t,5).onChange(n.target.checked)&&i),"blur"===e&&(i=!1!==r._14(t,5).onTouched()&&i),i},null,null)),r._2(5,16384,null,0,qe,[r.B,r.k],null,null),r._19(1024,null,Be,function(t){return[t]},[qe]),r._2(7,540672,null,0,Pn,[[8,null],[8,null],[2,Be]],{form:[0,"form"]},null),r._19(2048,null,Ye,null,[Pn]),r._2(9,16384,null,0,_n,[Ye],null,null),(t()(),r._23(-1,null,["\n            "])),(t()(),r._3(11,0,null,null,2,"label",[],[[1,"for",0]],null,null,null,null)),(t()(),r._23(12,null,["",""])),(t()(),r._3(13,0,null,null,0,"span",[["class","round-check"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n        "]))],function(t,e){t(e,1,0,"form-group",t(e,2,0,!e.component.internal_settings[e.context.index].visible)),t(e,7,0,e.context.$implicit)},function(t,e){var n=e.component;t(e,4,0,"setting-"+e.context.index,r._14(e,9).ngClassUntouched,r._14(e,9).ngClassTouched,r._14(e,9).ngClassPristine,r._14(e,9).ngClassDirty,r._14(e,9).ngClassValid,r._14(e,9).ngClassInvalid,r._14(e,9).ngClassPending),t(e,11,0,"setting-"+e.context.index),t(e,12,0,n.internal_settings[e.context.index].name)})}function kc(t){return r._25(0,[(t()(),r._3(0,0,null,null,11,"form",[["class","settingsForm"],["id","internalSettings"],["novalidate",""]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"submit"],[null,"reset"]],function(t,e,n){var i=!0;return"submit"===e&&(i=!1!==r._14(t,2).onSubmit(n)&&i),"reset"===e&&(i=!1!==r._14(t,2).onReset()&&i),i},null,null)),r._2(1,16384,null,0,jn,[],null,null),r._2(2,540672,null,0,Nn,[[8,null],[8,null]],{form:[0,"form"]},null),r._19(2048,null,De,null,[Nn]),r._2(4,16384,null,0,bn,[De],null,null),(t()(),r._23(-1,null,["\n        "])),(t()(),r._3(6,0,null,null,1,"h3",[],null,null,null,null,null)),(t()(),r._23(-1,null,["Internal Settings"])),(t()(),r._23(-1,null,["\n        "])),(t()(),r.Y(16777216,null,null,1,null,Ic)),r._2(10,802816,null,0,q,[r.M,r.J,r.q],{ngForOf:[0,"ngForOf"]},null),(t()(),r._23(-1,null,["\n    "]))],function(t,e){var n=e.component;t(e,2,0,n.internalSettings),t(e,10,0,n.initInternalForm.controls)},function(t,e){t(e,0,0,r._14(e,4).ngClassUntouched,r._14(e,4).ngClassTouched,r._14(e,4).ngClassPristine,r._14(e,4).ngClassDirty,r._14(e,4).ngClassValid,r._14(e,4).ngClassInvalid,r._14(e,4).ngClassPending)})}function xc(t){return r._25(0,[(t()(),r._3(0,0,null,null,1,"button",[["class","btn btn-primary btn-round"],["type","submit"]],null,null,null,null,null)),(t()(),r._23(-1,null,["Save settings"]))],null,null)}function Ac(t){return r._25(0,[(t()(),r._3(0,0,null,null,4,"div",[["class","app-head"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n    "])),(t()(),r._3(2,0,null,null,1,"h2",[],null,null,null,null,null)),(t()(),r._23(-1,null,["Settings"])),(t()(),r._23(-1,null,["\n"])),(t()(),r._23(-1,null,["\n"])),(t()(),r._3(6,0,null,null,89,"div",[["class","app-content"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n    "])),(t()(),r.Y(16777216,null,null,1,null,kc)),r._2(9,16384,null,0,K,[r.M,r.J],{ngIf:[0,"ngIf"]},null),(t()(),r._23(-1,null,["\n    "])),(t()(),r._3(11,0,null,null,83,"form",[["class","settingsForm"],["id","externalSettings"],["novalidate",""]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngSubmit"],[null,"submit"],[null,"reset"]],function(t,e,n){var i=!0,o=t.component;return"submit"===e&&(i=!1!==r._14(t,13).onSubmit(n)&&i),"reset"===e&&(i=!1!==r._14(t,13).onReset()&&i),"ngSubmit"===e&&(i=!1!==o.externalSave()&&i),i},null,null)),r._2(12,16384,null,0,jn,[],null,null),r._2(13,540672,null,0,Nn,[[8,null],[8,null]],{form:[0,"form"]},{ngSubmit:"ngSubmit"}),r._19(2048,null,De,null,[Nn]),r._2(15,16384,null,0,bn,[De],null,null),(t()(),r._23(-1,null,["\n        "])),(t()(),r._3(17,0,null,null,1,"h3",[],null,null,null,null,null)),(t()(),r._23(-1,null,["External Settings"])),(t()(),r._23(-1,null,["\n        "])),(t()(),r._3(20,0,null,null,27,"div",[["class","form-group form-select"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n            "])),(t()(),r._3(22,0,null,null,1,"label",[["for","val-search-results"]],null,null,null,null,null)),(t()(),r._23(-1,null,["Set trending country"])),(t()(),r._23(-1,null,["\n            "])),(t()(),r._3(25,0,null,null,21,"select",[["class","form-field"],["formControlName","fcRegion"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"change"],[null,"blur"]],function(t,e,n){var i=!0;return"change"===e&&(i=!1!==r._14(t,26).onChange(n.target.value)&&i),"blur"===e&&(i=!1!==r._14(t,26).onTouched()&&i),i},null,null)),r._2(26,16384,null,0,tn,[r.B,r.k],null,null),r._19(1024,null,Be,function(t){return[t]},[tn]),r._2(28,671744,null,0,Vn,[[3,De],[8,null],[8,null],[2,Be]],{name:[0,"name"]},null),r._19(2048,null,Ye,null,[Vn]),r._2(30,16384,null,0,_n,[Ye],null,null),(t()(),r._23(-1,null,["\n                "])),(t()(),r._3(32,0,null,null,3,"option",[["value","US"]],null,null,null,null,null)),r._2(33,147456,null,0,en,[r.k,r.B,[2,tn]],{value:[0,"value"]},null),r._2(34,147456,null,0,on,[r.k,r.B,[8,null]],{value:[0,"value"]},null),(t()(),r._23(-1,null,["United States"])),(t()(),r._23(-1,null,["\n                "])),(t()(),r._3(37,0,null,null,3,"option",[["value","GB"]],null,null,null,null,null)),r._2(38,147456,null,0,en,[r.k,r.B,[2,tn]],{value:[0,"value"]},null),r._2(39,147456,null,0,on,[r.k,r.B,[8,null]],{value:[0,"value"]},null),(t()(),r._23(-1,null,["United Kingdom"])),(t()(),r._23(-1,null,["\n                "])),(t()(),r._3(42,0,null,null,3,"option",[["value","RO"]],null,null,null,null,null)),r._2(43,147456,null,0,en,[r.k,r.B,[2,tn]],{value:[0,"value"]},null),r._2(44,147456,null,0,on,[r.k,r.B,[8,null]],{value:[0,"value"]},null),(t()(),r._23(-1,null,["Romania"])),(t()(),r._23(-1,null,["\n            "])),(t()(),r._23(-1,null,["\n        "])),(t()(),r._23(-1,null,["\n        "])),(t()(),r._3(49,0,null,null,11,"div",[["class","form-group form-text"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n            "])),(t()(),r._3(51,0,null,null,1,"label",[["for","val-api-key"]],null,null,null,null,null)),(t()(),r._23(-1,null,["Api Key"])),(t()(),r._23(-1,null,["\n            "])),(t()(),r._3(54,0,null,null,5,"input",[["class","form-field"],["formControlName","fcApi"],["id","val-api-key"],["placeholder","Your key"],["spellcheck","false"],["type","text"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(t,e,n){var i=!0;return"input"===e&&(i=!1!==r._14(t,55)._handleInput(n.target.value)&&i),"blur"===e&&(i=!1!==r._14(t,55).onTouched()&&i),"compositionstart"===e&&(i=!1!==r._14(t,55)._compositionStart()&&i),"compositionend"===e&&(i=!1!==r._14(t,55)._compositionEnd(n.target.value)&&i),i},null,null)),r._2(55,16384,null,0,Ke,[r.B,r.k,[2,He]],null,null),r._19(1024,null,Be,function(t){return[t]},[Ke]),r._2(57,671744,null,0,Vn,[[3,De],[8,null],[8,null],[2,Be]],{name:[0,"name"]},null),r._19(2048,null,Ye,null,[Vn]),r._2(59,16384,null,0,_n,[Ye],null,null),(t()(),r._23(-1,null,["\n        "])),(t()(),r._23(-1,null,["\n        "])),(t()(),r._3(62,0,null,null,13,"div",[["class","form-group form-text"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n            "])),(t()(),r._3(64,0,null,null,3,"label",[["for","val-search-results"]],null,null,null,null,null)),(t()(),r._23(-1,null,["Results for search "])),(t()(),r._3(66,0,null,null,1,"span",[["class","settings-hint"]],null,null,null,null,null)),(t()(),r._23(-1,null,["(Max. 50)"])),(t()(),r._23(-1,null,["\n            "])),(t()(),r._3(69,0,null,null,5,"input",[["class","form-field"],["formControlName","fcSearchresults"],["id","val-search-results"],["placeholder","1 to 50"],["type","text"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(t,e,n){var i=!0;return"input"===e&&(i=!1!==r._14(t,70)._handleInput(n.target.value)&&i),"blur"===e&&(i=!1!==r._14(t,70).onTouched()&&i),"compositionstart"===e&&(i=!1!==r._14(t,70)._compositionStart()&&i),"compositionend"===e&&(i=!1!==r._14(t,70)._compositionEnd(n.target.value)&&i),i},null,null)),r._2(70,16384,null,0,Ke,[r.B,r.k,[2,He]],null,null),r._19(1024,null,Be,function(t){return[t]},[Ke]),r._2(72,671744,null,0,Vn,[[3,De],[8,null],[8,null],[2,Be]],{name:[0,"name"]},null),r._19(2048,null,Ye,null,[Vn]),r._2(74,16384,null,0,_n,[Ye],null,null),(t()(),r._23(-1,null,["\n        "])),(t()(),r._23(-1,null,["\n        "])),(t()(),r._3(77,0,null,null,13,"div",[["class","form-group form-text"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n            "])),(t()(),r._3(79,0,null,null,3,"label",[["for","val-related-results"]],null,null,null,null,null)),(t()(),r._23(-1,null,["Results for related videos "])),(t()(),r._3(81,0,null,null,1,"span",[["class","settings-hint"]],null,null,null,null,null)),(t()(),r._23(-1,null,["(Max. 50)"])),(t()(),r._23(-1,null,["\n            "])),(t()(),r._3(84,0,null,null,5,"input",[["class","form-field"],["formControlName","fcRelatedResults"],["id","val-related-results"],["placeholder","1 to 50"],["type","text"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(t,e,n){var i=!0;return"input"===e&&(i=!1!==r._14(t,85)._handleInput(n.target.value)&&i),"blur"===e&&(i=!1!==r._14(t,85).onTouched()&&i),"compositionstart"===e&&(i=!1!==r._14(t,85)._compositionStart()&&i),"compositionend"===e&&(i=!1!==r._14(t,85)._compositionEnd(n.target.value)&&i),i},null,null)),r._2(85,16384,null,0,Ke,[r.B,r.k,[2,He]],null,null),r._19(1024,null,Be,function(t){return[t]},[Ke]),r._2(87,671744,null,0,Vn,[[3,De],[8,null],[8,null],[2,Be]],{name:[0,"name"]},null),r._19(2048,null,Ye,null,[Vn]),r._2(89,16384,null,0,_n,[Ye],null,null),(t()(),r._23(-1,null,["\n        "])),(t()(),r._23(-1,null,["\n        "])),(t()(),r.Y(16777216,null,null,1,null,xc)),r._2(93,16384,null,0,K,[r.M,r.J],{ngIf:[0,"ngIf"]},null),(t()(),r._23(-1,null,["\n    "])),(t()(),r._23(-1,null,["\n"]))],function(t,e){var n=e.component;t(e,9,0,n.finished),t(e,13,0,n.externalSettings),t(e,28,0,"fcRegion"),t(e,33,0,"US"),t(e,34,0,"US"),t(e,38,0,"GB"),t(e,39,0,"GB"),t(e,43,0,"RO"),t(e,44,0,"RO"),t(e,57,0,"fcApi"),t(e,72,0,"fcSearchresults"),t(e,87,0,"fcRelatedResults"),t(e,93,0,!1)},function(t,e){t(e,11,0,r._14(e,15).ngClassUntouched,r._14(e,15).ngClassTouched,r._14(e,15).ngClassPristine,r._14(e,15).ngClassDirty,r._14(e,15).ngClassValid,r._14(e,15).ngClassInvalid,r._14(e,15).ngClassPending),t(e,25,0,r._14(e,30).ngClassUntouched,r._14(e,30).ngClassTouched,r._14(e,30).ngClassPristine,r._14(e,30).ngClassDirty,r._14(e,30).ngClassValid,r._14(e,30).ngClassInvalid,r._14(e,30).ngClassPending),t(e,54,0,r._14(e,59).ngClassUntouched,r._14(e,59).ngClassTouched,r._14(e,59).ngClassPristine,r._14(e,59).ngClassDirty,r._14(e,59).ngClassValid,r._14(e,59).ngClassInvalid,r._14(e,59).ngClassPending),t(e,69,0,r._14(e,74).ngClassUntouched,r._14(e,74).ngClassTouched,r._14(e,74).ngClassPristine,r._14(e,74).ngClassDirty,r._14(e,74).ngClassValid,r._14(e,74).ngClassInvalid,r._14(e,74).ngClassPending),t(e,84,0,r._14(e,89).ngClassUntouched,r._14(e,89).ngClassTouched,r._14(e,89).ngClassPristine,r._14(e,89).ngClassDirty,r._14(e,89).ngClassValid,r._14(e,89).ngClassInvalid,r._14(e,89).ngClassPending)})}var Oc=r.Z("app-settings",Cc,function(t){return r._25(0,[(t()(),r._3(0,0,null,null,3,"app-settings",[],null,null,null,Ac,Tc)),r._19(4608,null,Sc,Sc,[]),r._19(512,null,Yl,Yl,[Sr,Pl,Wl]),r._2(3,114688,null,0,Cc,[Fn,_r,Pl,Wl,Yl],null,null)],function(t,e){t(e,3,0)},null)},{},{},[]),Pc=n("TO51"),Nc=n("Upor"),Rc=n("jaVc"),Dc=function(t){function e(e,n,r){void 0===e&&(e=Number.POSITIVE_INFINITY),void 0===n&&(n=Number.POSITIVE_INFINITY),t.call(this),this.scheduler=r,this._events=[],this._bufferSize=e<1?1:e,this._windowTime=n<1?1:n}return Object(i.__extends)(e,t),e.prototype.next=function(e){var n=this._getNow();this._events.push(new Mc(n,e)),this._trimBufferThenGetEvents(),t.prototype.next.call(this,e)},e.prototype._subscribe=function(t){var e,n=this._trimBufferThenGetEvents(),r=this.scheduler;if(this.closed)throw new Nc.a;this.hasError?e=Xr.a.EMPTY:this.isStopped?e=Xr.a.EMPTY:(this.observers.push(t),e=new Rc.a(this,t)),r&&t.add(t=new Vr(t,r));for(var i=n.length,o=0;o<i&&!t.closed;o++)t.next(n[o].value);return this.hasError?t.error(this.thrownError):this.isStopped&&t.complete(),e},e.prototype._getNow=function(){return(this.scheduler||$r).now()},e.prototype._trimBufferThenGetEvents=function(){for(var t=this._getNow(),e=this._bufferSize,n=this._windowTime,r=this._events,i=r.length,o=0;o<i&&!(t-r[o].time<n);)o++;return i>e&&(o=Math.max(o,i-e)),o>0&&r.splice(0,o),r},e}(Pc.a),Mc=function(t,e){this.time=t,this.value=e},Vc=function(){function t(t){this.zone=t,this.isFullscreen=!1,this.defaultSizes={height:270,width:367},this.createApi()}return Object.defineProperty(t,"win",{get:function(){return window},enumerable:!0,configurable:!0}),Object.defineProperty(t,"YT",{get:function(){return t.win.YT},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Player",{get:function(){return t.YT.Player},enumerable:!0,configurable:!0}),t.prototype.loadPlayerApi=function(e){var n=t.win.document,r=n.createElement("script");r.type="text/javascript",r.src=e.protocol+"://www.youtube.com/iframe_api",n.body.appendChild(r)},t.prototype.setupPlayer=function(e,n,r,i,o){var s=this;void 0===i&&(i=""),this.api.subscribe(function(){t.Player&&s.createPlayer(e,n,r,i,o)})},t.prototype.play=function(t){t.playVideo()},t.prototype.pause=function(t){t.pauseVideo()},t.prototype.playVideo=function(t,e){e.loadVideoById(t.id.videoId?t.id.videoId:t.id),this.play(e)},t.prototype.isPlaying=function(t){var e=t&&t.getPlayerState,n=e?t.getPlayerState():{};return!!e&&n!==YT.PlayerState.ENDED&&n!==YT.PlayerState.PAUSED},t.prototype.createPlayer=function(e,n,r,i,o){var s=this;return void 0===i&&(i=""),void 0===o&&(o={}),new t.Player(e,Object.assign({},{height:r.height||this.defaultSizes.height,width:r.width||this.defaultSizes.width},{events:{onReady:function(t){s.zone.run(function(){return n.ready&&n.ready.next(t.target)})},onStateChange:function(t){s.zone.run(function(){return n.change&&n.change.next(t)})}},videoId:i,playerVars:o}))},t.prototype.toggleFullScreen=function(t,e){var n=this.defaultSizes,r=n.height,i=n.width;e||(r=window.innerHeight,i=window.innerWidth),t.setSize(i,r)},t.prototype.generateUniqueId=function(){return Math.random().toString(35).substr(2,7)},t.prototype.createApi=function(){var e=this;this.api=new Dc(1),t.win.onYouTubeIframeAPIReady=function(){t.win&&e.api.next(t.YT)}},t}(),Fc=function(){function t(t,e,n){this.playerService=t,this.elementRef=e,this.renderer=n,this.videoId="",this.protocol=this.getProtocol(),this.playerVars={},this.ready=new r.m,this.change=new r.m}return t.prototype.ngAfterContentInit=function(){var t=this.playerService.generateUniqueId(),e={height:this.height,width:this.width},n=this.renderer.selectRootElement("#yt-player-ngx-component");this.renderer.setAttribute(n,"id",t),this.playerService.loadPlayerApi({protocol:this.protocol}),this.playerService.setupPlayer(t,{change:this.change,ready:this.ready},e,this.videoId,this.playerVars)},t.prototype.getProtocol=function(){return window&&window.location?window.location.protocol.replace(":",""):"http"},t}(),jc=function(){},Lc=r._1({encapsulation:2,styles:[],data:{}});function Uc(t){return r._25(2,[(t()(),r._23(-1,null,["\n    "])),(t()(),r._3(1,0,null,null,0,"div",[["id","yt-player-ngx-component"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n  "]))],null,null)}var Bc=function(t){function e(e){t.call(this),this._value=e}return Object(i.__extends)(e,t),Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0}),e.prototype._subscribe=function(e){var n=t.prototype._subscribe.call(this,e);return n&&!n.closed&&e.next(this._value),n},e.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(this.closed)throw new Nc.a;return this._value},e.prototype.next=function(e){t.prototype.next.call(this,this._value=e)},e}(Pc.a),qc=Pr.a.of,Hc=n("wP3s");function Kc(t,e){return function(t,e){return Object(Hc.a)(t,e,1)}(t,e)(this)}function zc(t,e,n){return void 0===n&&(n=Number.POSITIVE_INFINITY),Object(Hc.a)(t,e,n)(this)}var Qc=function(){function t(t){this.selector=t}return t.prototype.call=function(t,e){return e.subscribe(new Gc(t,this.selector,this.caught))},t}(),Gc=function(t){function e(e,n,r){t.call(this,e),this.selector=n,this.caught=r}return Object(i.__extends)(e,t),e.prototype.error=function(e){if(!this.isStopped){var n=void 0;try{n=this.selector(e,this.caught)}catch(e){return void t.prototype.error.call(this,e)}this._unsubscribeAndRecycle(),this.add(Object(u.a)(this,n))}},e}(l.a);function Wc(t){return function(t){return function(e){var n=new Qc(t),r=e.lift(n);return n.caught=r}}(t)(this)}var Yc=n("bywS");function Jc(){return Object(Yc.a)(1)(this)}var Xc=function(t){function e(){var e=t.call(this,"no elements in sequence");this.name=e.name="EmptyError",this.stack=e.stack,this.message=e.message}return Object(i.__extends)(e,t),e}(Error),Zc=function(){function t(t,e,n,r){this.predicate=t,this.resultSelector=e,this.defaultValue=n,this.source=r}return t.prototype.call=function(t,e){return e.subscribe(new $c(t,this.predicate,this.resultSelector,this.defaultValue,this.source))},t}(),$c=function(t){function e(e,n,r,i,o){t.call(this,e),this.predicate=n,this.resultSelector=r,this.defaultValue=i,this.source=o,this.index=0,this.hasCompleted=!1,this._emitted=!1}return Object(i.__extends)(e,t),e.prototype._next=function(t){var e=this.index++;this.predicate?this._tryPredicate(t,e):this._emit(t,e)},e.prototype._tryPredicate=function(t,e){var n;try{n=this.predicate(t,e,this.source)}catch(t){return void this.destination.error(t)}n&&this._emit(t,e)},e.prototype._emit=function(t,e){this.resultSelector?this._tryResultSelector(t,e):this._emitFinal(t)},e.prototype._tryResultSelector=function(t,e){var n;try{n=this.resultSelector(t,e)}catch(t){return void this.destination.error(t)}this._emitFinal(n)},e.prototype._emitFinal=function(t){var e=this.destination;this._emitted||(this._emitted=!0,e.next(t),e.complete(),this.hasCompleted=!0)},e.prototype._complete=function(){var t=this.destination;this.hasCompleted||"undefined"==typeof this.defaultValue?this.hasCompleted||t.error(new Xc):(t.next(this.defaultValue),t.complete())},e}(v.a);function th(t,e,n){return function(t,e,n){return function(r){return r.lift(new Zc(t,e,n,r))}}(t,e,n)(this)}var eh=function(){function t(t,e,n){this.predicate=t,this.thisArg=e,this.source=n}return t.prototype.call=function(t,e){return e.subscribe(new nh(t,this.predicate,this.thisArg,this.source))},t}(),nh=function(t){function e(e,n,r,i){t.call(this,e),this.predicate=n,this.thisArg=r,this.source=i,this.index=0,this.thisArg=r||this}return Object(i.__extends)(e,t),e.prototype.notifyComplete=function(t){this.destination.next(t),this.destination.complete()},e.prototype._next=function(t){var e=!1;try{e=this.predicate.call(this.thisArg,t,this.index++,this.source)}catch(t){return void this.destination.error(t)}e||this.notifyComplete(!1)},e.prototype._complete=function(){this.notifyComplete(!0)},e}(v.a);function rh(t,e){return function(t,e){return function(n){return n.lift(new eh(t,e,n))}}(t,e)(this)}var ih=function(){function t(t,e,n,r){this.predicate=t,this.resultSelector=e,this.defaultValue=n,this.source=r}return t.prototype.call=function(t,e){return e.subscribe(new oh(t,this.predicate,this.resultSelector,this.defaultValue,this.source))},t}(),oh=function(t){function e(e,n,r,i,o){t.call(this,e),this.predicate=n,this.resultSelector=r,this.defaultValue=i,this.source=o,this.hasValue=!1,this.index=0,"undefined"!=typeof i&&(this.lastValue=i,this.hasValue=!0)}return Object(i.__extends)(e,t),e.prototype._next=function(t){var e=this.index++;if(this.predicate)this._tryPredicate(t,e);else{if(this.resultSelector)return void this._tryResultSelector(t,e);this.lastValue=t,this.hasValue=!0}},e.prototype._tryPredicate=function(t,e){var n;try{n=this.predicate(t,e,this.source)}catch(t){return void this.destination.error(t)}if(n){if(this.resultSelector)return void this._tryResultSelector(t,e);this.lastValue=t,this.hasValue=!0}},e.prototype._tryResultSelector=function(t,e){var n;try{n=this.resultSelector(t,e)}catch(t){return void this.destination.error(t)}this.lastValue=n,this.hasValue=!0},e.prototype._complete=function(){var t=this.destination;this.hasValue?(t.next(this.lastValue),t.complete()):t.error(new Xc)},e}(v.a);function sh(t,e,n){return function(t,e,n){return function(r){return r.lift(new ih(t,e,n,r))}}(t,e,n)(this)}function ah(t){return void 0===t&&(t=Number.POSITIVE_INFINITY),Object(Yc.a)(t)(this)}function uh(t){return function(e){return 0===t?new s.a:e.lift(new lh(t))}}var lh=function(){function t(t){if(this.total=t,this.total<0)throw new Vl}return t.prototype.call=function(t,e){return e.subscribe(new ch(t,this.total))},t}(),ch=function(t){function e(e,n){t.call(this,e),this.total=n,this.ring=new Array,this.count=0}return Object(i.__extends)(e,t),e.prototype._next=function(t){var e=this.ring,n=this.total,r=this.count++;e.length<n?e.push(t):e[r%n]=t},e.prototype._complete=function(){var t=this.destination,e=this.count;if(e>0)for(var n=this.count>=this.total?this.total:this.count,r=this.ring,i=0;i<n;i++){var o=e++%n;t.next(r[o])}t.complete()},e}(v.a),hh=function(){function t(t){this.defaultValue=t}return t.prototype.call=function(t,e){return e.subscribe(new fh(t,this.defaultValue))},t}(),fh=function(t){function e(e,n){t.call(this,e),this.defaultValue=n,this.isEmpty=!0}return Object(i.__extends)(e,t),e.prototype._next=function(t){this.isEmpty=!1,this.destination.next(t)},e.prototype._complete=function(){this.isEmpty&&this.destination.next(this.defaultValue),this.destination.complete()},e}(v.a),ph=n("ExCY");function dh(t,e){return arguments.length>=2?function(n){return Object(ph.a)(li(t,e),uh(1),(void 0===(r=e)&&(r=null),function(t){return t.lift(new hh(r))}))(n);var r}:function(e){return Object(ph.a)(li(function(e,n,r){return t(e,n,r+1)}),uh(1))(e)}}var yh=function(t,e){this.id=t,this.url=e},mh=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(i.__extends)(e,t),e.prototype.toString=function(){return"NavigationStart(id: "+this.id+", url: '"+this.url+"')"},e}(yh),gh=function(t){function e(e,n,r){var i=t.call(this,e,n)||this;return i.urlAfterRedirects=r,i}return Object(i.__extends)(e,t),e.prototype.toString=function(){return"NavigationEnd(id: "+this.id+", url: '"+this.url+"', urlAfterRedirects: '"+this.urlAfterRedirects+"')"},e}(yh),vh=function(t){function e(e,n,r){var i=t.call(this,e,n)||this;return i.reason=r,i}return Object(i.__extends)(e,t),e.prototype.toString=function(){return"NavigationCancel(id: "+this.id+", url: '"+this.url+"')"},e}(yh),_h=function(t){function e(e,n,r){var i=t.call(this,e,n)||this;return i.error=r,i}return Object(i.__extends)(e,t),e.prototype.toString=function(){return"NavigationError(id: "+this.id+", url: '"+this.url+"', error: "+this.error+")"},e}(yh),bh=function(t){function e(e,n,r,i){var o=t.call(this,e,n)||this;return o.urlAfterRedirects=r,o.state=i,o}return Object(i.__extends)(e,t),e.prototype.toString=function(){return"RoutesRecognized(id: "+this.id+", url: '"+this.url+"', urlAfterRedirects: '"+this.urlAfterRedirects+"', state: "+this.state+")"},e}(yh),wh=function(t){function e(e,n,r,i){var o=t.call(this,e,n)||this;return o.urlAfterRedirects=r,o.state=i,o}return Object(i.__extends)(e,t),e.prototype.toString=function(){return"GuardsCheckStart(id: "+this.id+", url: '"+this.url+"', urlAfterRedirects: '"+this.urlAfterRedirects+"', state: "+this.state+")"},e}(yh),Eh=function(t){function e(e,n,r,i,o){var s=t.call(this,e,n)||this;return s.urlAfterRedirects=r,s.state=i,s.shouldActivate=o,s}return Object(i.__extends)(e,t),e.prototype.toString=function(){return"GuardsCheckEnd(id: "+this.id+", url: '"+this.url+"', urlAfterRedirects: '"+this.urlAfterRedirects+"', state: "+this.state+", shouldActivate: "+this.shouldActivate+")"},e}(yh),Sh=function(t){function e(e,n,r,i){var o=t.call(this,e,n)||this;return o.urlAfterRedirects=r,o.state=i,o}return Object(i.__extends)(e,t),e.prototype.toString=function(){return"ResolveStart(id: "+this.id+", url: '"+this.url+"', urlAfterRedirects: '"+this.urlAfterRedirects+"', state: "+this.state+")"},e}(yh),Ch=function(t){function e(e,n,r,i){var o=t.call(this,e,n)||this;return o.urlAfterRedirects=r,o.state=i,o}return Object(i.__extends)(e,t),e.prototype.toString=function(){return"ResolveEnd(id: "+this.id+", url: '"+this.url+"', urlAfterRedirects: '"+this.urlAfterRedirects+"', state: "+this.state+")"},e}(yh),Th=function(){function t(t){this.route=t}return t.prototype.toString=function(){return"RouteConfigLoadStart(path: "+this.route.path+")"},t}(),Ih=function(){function t(t){this.route=t}return t.prototype.toString=function(){return"RouteConfigLoadEnd(path: "+this.route.path+")"},t}(),kh=function(){function t(t){this.snapshot=t}return t.prototype.toString=function(){return"ChildActivationStart(path: '"+(this.snapshot.routeConfig&&this.snapshot.routeConfig.path||"")+"')"},t}(),xh=function(){function t(t){this.snapshot=t}return t.prototype.toString=function(){return"ChildActivationEnd(path: '"+(this.snapshot.routeConfig&&this.snapshot.routeConfig.path||"")+"')"},t}(),Ah=function(){function t(t){this.snapshot=t}return t.prototype.toString=function(){return"ActivationStart(path: '"+(this.snapshot.routeConfig&&this.snapshot.routeConfig.path||"")+"')"},t}(),Oh=function(){function t(t){this.snapshot=t}return t.prototype.toString=function(){return"ActivationEnd(path: '"+(this.snapshot.routeConfig&&this.snapshot.routeConfig.path||"")+"')"},t}(),Ph="primary",Nh=function(){function t(t){this.params=t||{}}return t.prototype.has=function(t){return this.params.hasOwnProperty(t)},t.prototype.get=function(t){if(this.has(t)){var e=this.params[t];return Array.isArray(e)?e[0]:e}return null},t.prototype.getAll=function(t){if(this.has(t)){var e=this.params[t];return Array.isArray(e)?e:[e]}return[]},Object.defineProperty(t.prototype,"keys",{get:function(){return Object.keys(this.params)},enumerable:!0,configurable:!0}),t}();function Rh(t){return new Nh(t)}function Dh(t,e,n){var r=n.path.split("/");if(r.length>t.length)return null;if("full"===n.pathMatch&&(e.hasChildren()||r.length<t.length))return null;for(var i={},o=0;o<r.length;o++){var s=r[o],a=t[o];if(s.startsWith(":"))i[s.substring(1)]=a;else if(s!==a.path)return null}return{consumed:t.slice(0,r.length),posParams:i}}var Mh=function(t,e){this.routes=t,this.module=e};function Vh(t,e){void 0===e&&(e="");for(var n=0;n<t.length;n++){var r=t[n];Fh(r,jh(e,r))}}function Fh(t,e){if(!t)throw new Error("\n      Invalid configuration of route '"+e+"': Encountered undefined route.\n      The reason might be an extra comma.\n\n      Example:\n      const routes: Routes = [\n        { path: '', redirectTo: '/dashboard', pathMatch: 'full' },\n        { path: 'dashboard',  component: DashboardComponent },, << two commas\n        { path: 'detail/:id', component: HeroDetailComponent }\n      ];\n    ");if(Array.isArray(t))throw new Error("Invalid configuration of route '"+e+"': Array cannot be specified");if(!t.component&&t.outlet&&t.outlet!==Ph)throw new Error("Invalid configuration of route '"+e+"': a componentless route cannot have a named outlet set");if(t.redirectTo&&t.children)throw new Error("Invalid configuration of route '"+e+"': redirectTo and children cannot be used together");if(t.redirectTo&&t.loadChildren)throw new Error("Invalid configuration of route '"+e+"': redirectTo and loadChildren cannot be used together");if(t.children&&t.loadChildren)throw new Error("Invalid configuration of route '"+e+"': children and loadChildren cannot be used together");if(t.redirectTo&&t.component)throw new Error("Invalid configuration of route '"+e+"': redirectTo and component cannot be used together");if(t.path&&t.matcher)throw new Error("Invalid configuration of route '"+e+"': path and matcher cannot be used together");if(void 0===t.redirectTo&&!t.component&&!t.children&&!t.loadChildren)throw new Error("Invalid configuration of route '"+e+"'. One of the following must be provided: component, redirectTo, children or loadChildren");if(void 0===t.path&&void 0===t.matcher)throw new Error("Invalid configuration of route '"+e+"': routes must have either a path or a matcher specified");if("string"==typeof t.path&&"/"===t.path.charAt(0))throw new Error("Invalid configuration of route '"+e+"': path cannot start with a slash");if(""===t.path&&void 0!==t.redirectTo&&void 0===t.pathMatch)throw new Error("Invalid configuration of route '{path: \""+e+'", redirectTo: "'+t.redirectTo+"\"}': please provide 'pathMatch'. The default value of 'pathMatch' is 'prefix', but often the intent is to use 'full'.");if(void 0!==t.pathMatch&&"full"!==t.pathMatch&&"prefix"!==t.pathMatch)throw new Error("Invalid configuration of route '"+e+"': pathMatch can only be set to 'prefix' or 'full'");t.children&&Vh(t.children,e)}function jh(t,e){return e?t||e.path?t&&!e.path?t+"/":!t&&e.path?e.path:t+"/"+e.path:"":t}function Lh(t,e){var n,r=Object.keys(t),i=Object.keys(e);if(r.length!=i.length)return!1;for(var o=0;o<r.length;o++)if(t[n=r[o]]!==e[n])return!1;return!0}function Uh(t){return Array.prototype.concat.apply([],t)}function Bh(t){return t.length>0?t[t.length-1]:null}function qh(t,e){for(var n in t)t.hasOwnProperty(n)&&e(t[n],n)}function Hh(t){var e=ah.call(t);return rh.call(e,function(t){return!0===t})}function Kh(t){return Object(r._8)(t)?t:Object(r._9)(t)?g(Promise.resolve(t)):qc(t)}function zh(t,e,n){return n?function(t,e){return Lh(t,e)}(t.queryParams,e.queryParams)&&function t(e,n){if(!Yh(e.segments,n.segments))return!1;if(e.numberOfChildren!==n.numberOfChildren)return!1;for(var r in n.children){if(!e.children[r])return!1;if(!t(e.children[r],n.children[r]))return!1}return!0}(t.root,e.root):function(t,e){return Object.keys(e).length<=Object.keys(t).length&&Object.keys(e).every(function(n){return e[n]===t[n]})}(t.queryParams,e.queryParams)&&function t(e,n){return function e(n,r,i){if(n.segments.length>i.length)return!!Yh(s=n.segments.slice(0,i.length),i)&&!r.hasChildren();if(n.segments.length===i.length){if(!Yh(n.segments,i))return!1;for(var o in r.children){if(!n.children[o])return!1;if(!t(n.children[o],r.children[o]))return!1}return!0}var s=i.slice(0,n.segments.length),a=i.slice(n.segments.length);return!!Yh(n.segments,s)&&!!n.children[Ph]&&e(n.children[Ph],r,a)}(e,n,n.segments)}(t.root,e.root)}var Qh=function(){function t(t,e,n){this.root=t,this.queryParams=e,this.fragment=n}return Object.defineProperty(t.prototype,"queryParamMap",{get:function(){return this._queryParamMap||(this._queryParamMap=Rh(this.queryParams)),this._queryParamMap},enumerable:!0,configurable:!0}),t.prototype.toString=function(){return $h.serialize(this)},t}(),Gh=function(){function t(t,e){var n=this;this.segments=t,this.children=e,this.parent=null,qh(e,function(t,e){return t.parent=n})}return t.prototype.hasChildren=function(){return this.numberOfChildren>0},Object.defineProperty(t.prototype,"numberOfChildren",{get:function(){return Object.keys(this.children).length},enumerable:!0,configurable:!0}),t.prototype.toString=function(){return tf(this)},t}(),Wh=function(){function t(t,e){this.path=t,this.parameters=e}return Object.defineProperty(t.prototype,"parameterMap",{get:function(){return this._parameterMap||(this._parameterMap=Rh(this.parameters)),this._parameterMap},enumerable:!0,configurable:!0}),t.prototype.toString=function(){return rf(this)},t}();function Yh(t,e){return t.length===e.length&&t.every(function(t,n){return t.path===e[n].path})}function Jh(t,e){var n=[];return qh(t.children,function(t,r){r===Ph&&(n=n.concat(e(t,r)))}),qh(t.children,function(t,r){r!==Ph&&(n=n.concat(e(t,r)))}),n}var Xh=function(){},Zh=function(){function t(){}return t.prototype.parse=function(t){var e=new lf(t);return new Qh(e.parseRootSegment(),e.parseQueryParams(),e.parseFragment())},t.prototype.serialize=function(t){var e,n;return"/"+function t(e,n){if(!e.hasChildren())return tf(e);if(n){var r=e.children[Ph]?t(e.children[Ph],!1):"",i=[];return qh(e.children,function(e,n){n!==Ph&&i.push(n+":"+t(e,!1))}),i.length>0?r+"("+i.join("//")+")":r}var o=Jh(e,function(n,r){return r===Ph?[t(e.children[Ph],!1)]:[r+":"+t(n,!1)]});return tf(e)+"/("+o.join("//")+")"}(t.root,!0)+(e=t.queryParams,(n=Object.keys(e).map(function(t){var n=e[t];return Array.isArray(n)?n.map(function(e){return ef(t)+"="+ef(e)}).join("&"):ef(t)+"="+ef(n)})).length?"?"+n.join("&"):"")+("string"==typeof t.fragment?"#"+encodeURI(t.fragment):"")},t}(),$h=new Zh;function tf(t){return t.segments.map(function(t){return rf(t)}).join("/")}function ef(t){return encodeURIComponent(t).replace(/%40/g,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%3B/gi,";")}function nf(t){return decodeURIComponent(t)}function rf(t){return""+ef(t.path)+(e=t.parameters,Object.keys(e).map(function(t){return";"+ef(t)+"="+ef(e[t])}).join(""));var e}var of=/^[^\/()?;=&#]+/;function sf(t){var e=t.match(of);return e?e[0]:""}var af=/^[^=?&#]+/,uf=/^[^?&#]+/,lf=function(){function t(t){this.url=t,this.remaining=t}return t.prototype.parseRootSegment=function(){return this.consumeOptional("/"),""===this.remaining||this.peekStartsWith("?")||this.peekStartsWith("#")?new Gh([],{}):new Gh([],this.parseChildren())},t.prototype.parseQueryParams=function(){var t={};if(this.consumeOptional("?"))do{this.parseQueryParam(t)}while(this.consumeOptional("&"));return t},t.prototype.parseFragment=function(){return this.consumeOptional("#")?decodeURI(this.remaining):null},t.prototype.parseChildren=function(){if(""===this.remaining)return{};this.consumeOptional("/");var t=[];for(this.peekStartsWith("(")||t.push(this.parseSegment());this.peekStartsWith("/")&&!this.peekStartsWith("//")&&!this.peekStartsWith("/(");)this.capture("/"),t.push(this.parseSegment());var e={};this.peekStartsWith("/(")&&(this.capture("/"),e=this.parseParens(!0));var n={};return this.peekStartsWith("(")&&(n=this.parseParens(!1)),(t.length>0||Object.keys(e).length>0)&&(n[Ph]=new Gh(t,e)),n},t.prototype.parseSegment=function(){var t=sf(this.remaining);if(""===t&&this.peekStartsWith(";"))throw new Error("Empty path url segment cannot have parameters: '"+this.remaining+"'.");return this.capture(t),new Wh(nf(t),this.parseMatrixParams())},t.prototype.parseMatrixParams=function(){for(var t={};this.consumeOptional(";");)this.parseParam(t);return t},t.prototype.parseParam=function(t){var e=sf(this.remaining);if(e){this.capture(e);var n="";if(this.consumeOptional("=")){var r=sf(this.remaining);r&&this.capture(n=r)}t[nf(e)]=nf(n)}},t.prototype.parseQueryParam=function(t){var e,n=(e=this.remaining.match(af))?e[0]:"";if(n){this.capture(n);var r="";if(this.consumeOptional("=")){var i=function(t){var e=t.match(uf);return e?e[0]:""}(this.remaining);i&&this.capture(r=i)}var o=nf(n),s=nf(r);if(t.hasOwnProperty(o)){var a=t[o];Array.isArray(a)||(t[o]=a=[a]),a.push(s)}else t[o]=s}},t.prototype.parseParens=function(t){var e={};for(this.capture("(");!this.consumeOptional(")")&&this.remaining.length>0;){var n=sf(this.remaining),r=this.remaining[n.length];if("/"!==r&&")"!==r&&";"!==r)throw new Error("Cannot parse url '"+this.url+"'");var i=void 0;n.indexOf(":")>-1?(i=n.substr(0,n.indexOf(":")),this.capture(i),this.capture(":")):t&&(i=Ph);var o=this.parseChildren();e[i]=1===Object.keys(o).length?o[Ph]:new Gh([],o),this.consumeOptional("//")}return e},t.prototype.peekStartsWith=function(t){return this.remaining.startsWith(t)},t.prototype.consumeOptional=function(t){return!!this.peekStartsWith(t)&&(this.remaining=this.remaining.substring(t.length),!0)},t.prototype.capture=function(t){if(!this.consumeOptional(t))throw new Error('Expected "'+t+'".')},t}(),cf=function(t){this.segmentGroup=t||null},hf=function(t){this.urlTree=t};function ff(t){return new o.a(function(e){return e.error(new cf(t))})}function pf(t){return new o.a(function(e){return e.error(new hf(t))})}function df(t){return new o.a(function(e){return e.error(new Error("Only absolute redirects can have named outlets. redirectTo: '"+t+"'"))})}var yf=function(){function t(t,e,n,i,o){this.configLoader=e,this.urlSerializer=n,this.urlTree=i,this.config=o,this.allowRedirects=!0,this.ngModule=t.get(r.v)}return t.prototype.apply=function(){var t=this,e=this.expandSegmentGroup(this.ngModule,this.config,this.urlTree.root,Ph),n=w.call(e,function(e){return t.createUrlTree(e,t.urlTree.queryParams,t.urlTree.fragment)});return Wc.call(n,function(e){if(e instanceof hf)return t.allowRedirects=!1,t.match(e.urlTree);if(e instanceof cf)throw t.noMatchError(e);throw e})},t.prototype.match=function(t){var e=this,n=this.expandSegmentGroup(this.ngModule,this.config,t.root,Ph),r=w.call(n,function(n){return e.createUrlTree(n,t.queryParams,t.fragment)});return Wc.call(r,function(t){if(t instanceof cf)throw e.noMatchError(t);throw t})},t.prototype.noMatchError=function(t){return new Error("Cannot match any routes. URL Segment: '"+t.segmentGroup+"'")},t.prototype.createUrlTree=function(t,e,n){var r,i=t.segments.length>0?new Gh([],((r={})[Ph]=t,r)):t;return new Qh(i,e,n)},t.prototype.expandSegmentGroup=function(t,e,n,r){return 0===n.segments.length&&n.hasChildren()?w.call(this.expandChildren(t,e,n),function(t){return new Gh([],t)}):this.expandSegment(t,n,e,n.segments,r,!0)},t.prototype.expandChildren=function(t,e,n){var r=this;return function(n,i){if(0===Object.keys(n).length)return qc({});var o=[],s=[],a={};qh(n,function(n,i){var u=w.call(r.expandSegmentGroup(t,e,n,i),function(t){return a[i]=t});i===Ph?o.push(u):s.push(u)});var u=Jc.call(qc.apply(void 0,o.concat(s))),l=sh.call(u);return w.call(l,function(){return a})}(n.children)},t.prototype.expandSegment=function(t,e,n,r,i,o){var s=this,a=qc.apply(void 0,n),u=w.call(a,function(a){var u=s.expandSegmentAgainstRoute(t,e,n,a,r,i,o);return Wc.call(u,function(t){if(t instanceof cf)return qc(null);throw t})}),l=Jc.call(u),c=th.call(l,function(t){return!!t});return Wc.call(c,function(t,n){if(t instanceof Xc||"EmptyError"===t.name){if(s.noLeftoversInUrl(e,r,i))return qc(new Gh([],{}));throw new cf(e)}throw t})},t.prototype.noLeftoversInUrl=function(t,e,n){return 0===e.length&&!t.children[n]},t.prototype.expandSegmentAgainstRoute=function(t,e,n,r,i,o,s){return _f(r)!==o?ff(e):void 0===r.redirectTo?this.matchSegmentAgainstRoute(t,e,r,i):s&&this.allowRedirects?this.expandSegmentAgainstRouteUsingRedirect(t,e,n,r,i,o):ff(e)},t.prototype.expandSegmentAgainstRouteUsingRedirect=function(t,e,n,r,i,o){return"**"===r.path?this.expandWildCardWithParamsAgainstRouteUsingRedirect(t,n,r,o):this.expandRegularSegmentAgainstRouteUsingRedirect(t,e,n,r,i,o)},t.prototype.expandWildCardWithParamsAgainstRouteUsingRedirect=function(t,e,n,r){var i=this,o=this.applyRedirectCommands([],n.redirectTo,{});return n.redirectTo.startsWith("/")?pf(o):zc.call(this.lineralizeSegments(n,o),function(n){var o=new Gh(n,{});return i.expandSegment(t,o,e,n,r,!1)})},t.prototype.expandRegularSegmentAgainstRouteUsingRedirect=function(t,e,n,r,i,o){var s=this,a=mf(e,r,i),u=a.consumedSegments,l=a.lastChild,c=a.positionalParamSegments;if(!a.matched)return ff(e);var h=this.applyRedirectCommands(u,r.redirectTo,c);return r.redirectTo.startsWith("/")?pf(h):zc.call(this.lineralizeSegments(r,h),function(r){return s.expandSegment(t,e,n,r.concat(i.slice(l)),o,!1)})},t.prototype.matchSegmentAgainstRoute=function(t,e,n,r){var o=this;if("**"===n.path)return n.loadChildren?w.call(this.configLoader.load(t.injector,n),function(t){return n._loadedConfig=t,new Gh(r,{})}):qc(new Gh(r,{}));var s=mf(e,n,r),a=s.consumedSegments,u=s.lastChild;if(!s.matched)return ff(e);var l=r.slice(u),c=this.getChildConfig(t,n);return zc.call(c,function(t){var n=t.module,r=t.routes,s=function(t,e,n,r){return n.length>0&&function(t,e,n){return r.some(function(n){return vf(t,e,n)&&_f(n)!==Ph})}(t,n)?{segmentGroup:gf(new Gh(e,function(t,e){var n={};n[Ph]=e;for(var r=0,i=t;r<i.length;r++){var o=i[r];""===o.path&&_f(o)!==Ph&&(n[_f(o)]=new Gh([],{}))}return n}(r,new Gh(n,t.children)))),slicedSegments:[]}:0===n.length&&function(t,e,n){return r.some(function(n){return vf(t,e,n)})}(t,n)?{segmentGroup:gf(new Gh(t.segments,function(t,e,n,o){for(var s={},a=0,u=r;a<u.length;a++){var l=u[a];vf(t,e,l)&&!o[_f(l)]&&(s[_f(l)]=new Gh([],{}))}return Object(i.__assign)({},o,s)}(t,n,0,t.children))),slicedSegments:n}:{segmentGroup:t,slicedSegments:n}}(e,a,l,r),u=s.segmentGroup,c=s.slicedSegments;if(0===c.length&&u.hasChildren()){var h=o.expandChildren(n,r,u);return w.call(h,function(t){return new Gh(a,t)})}if(0===r.length&&0===c.length)return qc(new Gh(a,{}));var f=o.expandSegment(n,u,r,c,Ph,!0);return w.call(f,function(t){return new Gh(a.concat(t.segments),t.children)})})},t.prototype.getChildConfig=function(t,e){var n=this;return e.children?qc(new Mh(e.children,t)):e.loadChildren?void 0!==e._loadedConfig?qc(e._loadedConfig):zc.call(function(t,e){var n=e.canLoad;return n&&0!==n.length?Hh(w.call(Lr(n),function(n){var r=t.get(n);return Kh(r.canLoad?r.canLoad(e):r(e))})):qc(!0)}(t.injector,e),function(r){return r?w.call(n.configLoader.load(t.injector,e),function(t){return e._loadedConfig=t,t}):function(t){return new o.a(function(e){return e.error(((n=Error("NavigationCancelingError: Cannot load children because the guard of the route \"path: '"+t.path+"'\" returned false")).ngNavigationCancelingError=!0,n));var n})}(e)}):qc(new Mh([],t))},t.prototype.lineralizeSegments=function(t,e){for(var n=[],r=e.root;;){if(n=n.concat(r.segments),0===r.numberOfChildren)return qc(n);if(r.numberOfChildren>1||!r.children[Ph])return df(t.redirectTo);r=r.children[Ph]}},t.prototype.applyRedirectCommands=function(t,e,n){return this.applyRedirectCreatreUrlTree(e,this.urlSerializer.parse(e),t,n)},t.prototype.applyRedirectCreatreUrlTree=function(t,e,n,r){var i=this.createSegmentGroup(t,e.root,n,r);return new Qh(i,this.createQueryParams(e.queryParams,this.urlTree.queryParams),e.fragment)},t.prototype.createQueryParams=function(t,e){var n={};return qh(t,function(t,r){if("string"==typeof t&&t.startsWith(":")){var i=t.substring(1);n[r]=e[i]}else n[r]=t}),n},t.prototype.createSegmentGroup=function(t,e,n,r){var i=this,o=this.createSegments(t,e.segments,n,r),s={};return qh(e.children,function(e,o){s[o]=i.createSegmentGroup(t,e,n,r)}),new Gh(o,s)},t.prototype.createSegments=function(t,e,n,r){var i=this;return e.map(function(e){return e.path.startsWith(":")?i.findPosParam(t,e,r):i.findOrReturn(e,n)})},t.prototype.findPosParam=function(t,e,n){var r=n[e.path.substring(1)];if(!r)throw new Error("Cannot redirect to '"+t+"'. Cannot find '"+e.path+"'.");return r},t.prototype.findOrReturn=function(t,e){for(var n=0,r=0,i=e;r<i.length;r++){var o=i[r];if(o.path===t.path)return e.splice(n),o;n++}return t},t}();function mf(t,e,n){if(""===e.path)return"full"===e.pathMatch&&(t.hasChildren()||n.length>0)?{matched:!1,consumedSegments:[],lastChild:0,positionalParamSegments:{}}:{matched:!0,consumedSegments:[],lastChild:0,positionalParamSegments:{}};var r=(e.matcher||Dh)(n,t,e);return r?{matched:!0,consumedSegments:r.consumed,lastChild:r.consumed.length,positionalParamSegments:r.posParams}:{matched:!1,consumedSegments:[],lastChild:0,positionalParamSegments:{}}}function gf(t){if(1===t.numberOfChildren&&t.children[Ph]){var e=t.children[Ph];return new Gh(t.segments.concat(e.segments),e.children)}return t}function vf(t,e,n){return(!(t.hasChildren()||e.length>0)||"full"!==n.pathMatch)&&""===n.path&&void 0!==n.redirectTo}function _f(t){return t.outlet||Ph}var bf=function(){function t(t){this._root=t}return Object.defineProperty(t.prototype,"root",{get:function(){return this._root.value},enumerable:!0,configurable:!0}),t.prototype.parent=function(t){var e=this.pathFromRoot(t);return e.length>1?e[e.length-2]:null},t.prototype.children=function(t){var e=wf(t,this._root);return e?e.children.map(function(t){return t.value}):[]},t.prototype.firstChild=function(t){var e=wf(t,this._root);return e&&e.children.length>0?e.children[0].value:null},t.prototype.siblings=function(t){var e=Ef(t,this._root);return e.length<2?[]:e[e.length-2].children.map(function(t){return t.value}).filter(function(e){return e!==t})},t.prototype.pathFromRoot=function(t){return Ef(t,this._root).map(function(t){return t.value})},t}();function wf(t,e){if(t===e.value)return e;for(var n=0,r=e.children;n<r.length;n++){var i=wf(t,r[n]);if(i)return i}return null}function Ef(t,e){if(t===e.value)return[e];for(var n=0,r=e.children;n<r.length;n++){var i=Ef(t,r[n]);if(i.length)return i.unshift(e),i}return[]}var Sf=function(){function t(t,e){this.value=t,this.children=e}return t.prototype.toString=function(){return"TreeNode("+this.value+")"},t}();function Cf(t){var e={};return t&&t.children.forEach(function(t){return e[t.value.outlet]=t}),e}var Tf=function(t){function e(e,n){var r=t.call(this,e)||this;return r.snapshot=n,Pf(r,e),r}return Object(i.__extends)(e,t),e.prototype.toString=function(){return this.snapshot.toString()},e}(bf);function If(t,e){var n=function(t,e){var n=new Af([],{},{},"",{},Ph,e,null,t.root,-1,{});return new Of("",new Sf(n,[]))}(t,e),r=new Bc([new Wh("",{})]),i=new Bc({}),o=new Bc({}),s=new Bc({}),a=new Bc(""),u=new kf(r,i,s,a,o,Ph,e,n.root);return u.snapshot=n.root,new Tf(new Sf(u,[]),n)}var kf=function(){function t(t,e,n,r,i,o,s,a){this.url=t,this.params=e,this.queryParams=n,this.fragment=r,this.data=i,this.outlet=o,this.component=s,this._futureSnapshot=a}return Object.defineProperty(t.prototype,"routeConfig",{get:function(){return this._futureSnapshot.routeConfig},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"root",{get:function(){return this._routerState.root},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){return this._routerState.parent(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"firstChild",{get:function(){return this._routerState.firstChild(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"children",{get:function(){return this._routerState.children(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"pathFromRoot",{get:function(){return this._routerState.pathFromRoot(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"paramMap",{get:function(){return this._paramMap||(this._paramMap=w.call(this.params,function(t){return Rh(t)})),this._paramMap},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"queryParamMap",{get:function(){return this._queryParamMap||(this._queryParamMap=w.call(this.queryParams,function(t){return Rh(t)})),this._queryParamMap},enumerable:!0,configurable:!0}),t.prototype.toString=function(){return this.snapshot?this.snapshot.toString():"Future("+this._futureSnapshot+")"},t}();function xf(t,e){void 0===e&&(e="emptyOnly");var n=t.pathFromRoot,r=0;if("always"!==e)for(r=n.length-1;r>=1;){var o=n[r],s=n[r-1];if(o.routeConfig&&""===o.routeConfig.path)r--;else{if(s.component)break;r--}}return function(t){return t.reduce(function(t,e){return{params:Object(i.__assign)({},t.params,e.params),data:Object(i.__assign)({},t.data,e.data),resolve:Object(i.__assign)({},t.resolve,e._resolvedData)}},{params:{},data:{},resolve:{}})}(n.slice(r))}var Af=function(){function t(t,e,n,r,i,o,s,a,u,l,c){this.url=t,this.params=e,this.queryParams=n,this.fragment=r,this.data=i,this.outlet=o,this.component=s,this.routeConfig=a,this._urlSegment=u,this._lastPathIndex=l,this._resolve=c}return Object.defineProperty(t.prototype,"root",{get:function(){return this._routerState.root},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){return this._routerState.parent(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"firstChild",{get:function(){return this._routerState.firstChild(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"children",{get:function(){return this._routerState.children(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"pathFromRoot",{get:function(){return this._routerState.pathFromRoot(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"paramMap",{get:function(){return this._paramMap||(this._paramMap=Rh(this.params)),this._paramMap},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"queryParamMap",{get:function(){return this._queryParamMap||(this._queryParamMap=Rh(this.queryParams)),this._queryParamMap},enumerable:!0,configurable:!0}),t.prototype.toString=function(){return"Route(url:'"+this.url.map(function(t){return t.toString()}).join("/")+"', path:'"+(this.routeConfig?this.routeConfig.path:"")+"')"},t}(),Of=function(t){function e(e,n){var r=t.call(this,n)||this;return r.url=e,Pf(r,n),r}return Object(i.__extends)(e,t),e.prototype.toString=function(){return Nf(this._root)},e}(bf);function Pf(t,e){e.value._routerState=t,e.children.forEach(function(e){return Pf(t,e)})}function Nf(t){var e=t.children.length>0?" { "+t.children.map(Nf).join(", ")+" } ":"";return""+t.value+e}function Rf(t){if(t.snapshot){var e=t.snapshot,n=t._futureSnapshot;t.snapshot=n,Lh(e.queryParams,n.queryParams)||t.queryParams.next(n.queryParams),e.fragment!==n.fragment&&t.fragment.next(n.fragment),Lh(e.params,n.params)||t.params.next(n.params),function(t,e){if(t.length!==e.length)return!1;for(var n=0;n<t.length;++n)if(!Lh(t[n],e[n]))return!1;return!0}(e.url,n.url)||t.url.next(n.url),Lh(e.data,n.data)||t.data.next(n.data)}else t.snapshot=t._futureSnapshot,t.data.next(t._futureSnapshot.data)}function Df(t,e){var n,r;return Lh(t.params,e.params)&&Yh(n=t.url,r=e.url)&&n.every(function(t,e){return Lh(t.parameters,r[e].parameters)})&&!(!t.parent!=!e.parent)&&(!t.parent||Df(t.parent,e.parent))}function Mf(t){return"object"==typeof t&&null!=t&&!t.outlets&&!t.segmentPath}function Vf(t,e,n,r,i){var o={};return r&&qh(r,function(t,e){o[e]=Array.isArray(t)?t.map(function(t){return""+t}):""+t}),new Qh(n.root===t?e:function t(e,n,r){var i={};return qh(e.children,function(e,o){i[o]=e===n?r:t(e,n,r)}),new Gh(e.segments,i)}(n.root,t,e),o,i)}var Ff=function(){function t(t,e,n){if(this.isAbsolute=t,this.numberOfDoubleDots=e,this.commands=n,t&&n.length>0&&Mf(n[0]))throw new Error("Root segment cannot have matrix parameters");var r=n.find(function(t){return"object"==typeof t&&null!=t&&t.outlets});if(r&&r!==Bh(n))throw new Error("{outlets:{}} has to be the last command")}return t.prototype.toRoot=function(){return this.isAbsolute&&1===this.commands.length&&"/"==this.commands[0]},t}(),jf=function(t,e,n){this.segmentGroup=t,this.processChildren=e,this.index=n};function Lf(t){return"object"==typeof t&&null!=t&&t.outlets?t.outlets[Ph]:""+t}function Uf(t,e,n){if(t||(t=new Gh([],{})),0===t.segments.length&&t.hasChildren())return Bf(t,e,n);var r=function(t,e,n){for(var r=0,i=e,o={match:!1,pathIndex:0,commandIndex:0};i<t.segments.length;){if(r>=n.length)return o;var s=t.segments[i],a=Lf(n[r]),u=r<n.length-1?n[r+1]:null;if(i>0&&void 0===a)break;if(a&&u&&"object"==typeof u&&void 0===u.outlets){if(!zf(a,u,s))return o;r+=2}else{if(!zf(a,{},s))return o;r++}i++}return{match:!0,pathIndex:i,commandIndex:r}}(t,e,n),i=n.slice(r.commandIndex);if(r.match&&r.pathIndex<t.segments.length){var o=new Gh(t.segments.slice(0,r.pathIndex),{});return o.children[Ph]=new Gh(t.segments.slice(r.pathIndex),t.children),Bf(o,0,i)}return r.match&&0===i.length?new Gh(t.segments,{}):r.match&&!t.hasChildren()?qf(t,e,n):r.match?Bf(t,0,i):qf(t,e,n)}function Bf(t,e,n){if(0===n.length)return new Gh(t.segments,{});var r=function(t){return"object"!=typeof t[0]?((e={})[Ph]=t,e):void 0===t[0].outlets?((n={})[Ph]=t,n):t[0].outlets;var e,n}(n),i={};return qh(r,function(n,r){null!==n&&(i[r]=Uf(t.children[r],e,n))}),qh(t.children,function(t,e){void 0===r[e]&&(i[e]=t)}),new Gh(t.segments,i)}function qf(t,e,n){for(var r=t.segments.slice(0,e),i=0;i<n.length;){if("object"==typeof n[i]&&void 0!==n[i].outlets){var o=Hf(n[i].outlets);return new Gh(r,o)}if(0===i&&Mf(n[0]))r.push(new Wh(t.segments[e].path,n[0])),i++;else{var s=Lf(n[i]),a=i<n.length-1?n[i+1]:null;s&&a&&Mf(a)?(r.push(new Wh(s,Kf(a))),i+=2):(r.push(new Wh(s,{})),i++)}}return new Gh(r,{})}function Hf(t){var e={};return qh(t,function(t,n){null!==t&&(e[n]=qf(new Gh([],{}),0,t))}),e}function Kf(t){var e={};return qh(t,function(t,n){return e[n]=""+t}),e}function zf(t,e,n){return t==n.path&&Lh(e,n.parameters)}var Qf=function(t){this.path=t,this.route=this.path[this.path.length-1]},Gf=function(t,e){this.component=t,this.route=e},Wf=function(){function t(t,e,n,r){this.future=t,this.curr=e,this.moduleInjector=n,this.forwardEvent=r,this.canActivateChecks=[],this.canDeactivateChecks=[]}return t.prototype.initialize=function(t){var e=this.future._root;this.setupChildRouteGuards(e,this.curr?this.curr._root:null,t,[e.value])},t.prototype.checkGuards=function(){var t=this;if(!this.isDeactivating()&&!this.isActivating())return qc(!0);var e=this.runCanDeactivateChecks();return zc.call(e,function(e){return e?t.runCanActivateChecks():qc(!1)})},t.prototype.resolveData=function(t){var e=this;if(!this.isActivating())return qc(null);var n=Lr(this.canActivateChecks),r=Kc.call(n,function(n){return e.runResolve(n.route,t)});return(function(t,e){return arguments.length>=2?dh(t,e)(this):dh(t)(this)}).call(r,function(t,e){return t})},t.prototype.isDeactivating=function(){return 0!==this.canDeactivateChecks.length},t.prototype.isActivating=function(){return 0!==this.canActivateChecks.length},t.prototype.setupChildRouteGuards=function(t,e,n,r){var i=this,o=Cf(e);t.children.forEach(function(t){i.setupRouteGuards(t,o[t.value.outlet],n,r.concat([t.value])),delete o[t.value.outlet]}),qh(o,function(t,e){return i.deactivateRouteAndItsChildren(t,n.getContext(e))})},t.prototype.setupRouteGuards=function(t,e,n,r){var i=t.value,o=e?e.value:null,s=n?n.getContext(t.value.outlet):null;if(o&&i.routeConfig===o.routeConfig){var a=this.shouldRunGuardsAndResolvers(o,i,i.routeConfig.runGuardsAndResolvers);a?this.canActivateChecks.push(new Qf(r)):(i.data=o.data,i._resolvedData=o._resolvedData),this.setupChildRouteGuards(t,e,i.component?s?s.children:null:n,r),a&&this.canDeactivateChecks.push(new Gf(s.outlet.component,o))}else o&&this.deactivateRouteAndItsChildren(e,s),this.canActivateChecks.push(new Qf(r)),this.setupChildRouteGuards(t,null,i.component?s?s.children:null:n,r)},t.prototype.shouldRunGuardsAndResolvers=function(t,e,n){switch(n){case"always":return!0;case"paramsOrQueryParamsChange":return!Df(t,e)||!Lh(t.queryParams,e.queryParams);case"paramsChange":default:return!Df(t,e)}},t.prototype.deactivateRouteAndItsChildren=function(t,e){var n=this,r=Cf(t),i=t.value;qh(r,function(t,r){n.deactivateRouteAndItsChildren(t,i.component?e?e.children.getContext(r):null:e)}),this.canDeactivateChecks.push(new Gf(i.component&&e&&e.outlet&&e.outlet.isActivated?e.outlet.component:null,i))},t.prototype.runCanDeactivateChecks=function(){var t=this,e=Lr(this.canDeactivateChecks),n=zc.call(e,function(e){return t.runCanDeactivate(e.component,e.route)});return rh.call(n,function(t){return!0===t})},t.prototype.runCanActivateChecks=function(){var t=this,e=Lr(this.canActivateChecks),n=Kc.call(e,function(e){return Hh(Lr([t.fireChildActivationStart(e.route.parent),t.fireActivationStart(e.route),t.runCanActivateChild(e.path),t.runCanActivate(e.route)]))});return rh.call(n,function(t){return!0===t})},t.prototype.fireActivationStart=function(t){return null!==t&&this.forwardEvent&&this.forwardEvent(new Ah(t)),qc(!0)},t.prototype.fireChildActivationStart=function(t){return null!==t&&this.forwardEvent&&this.forwardEvent(new kh(t)),qc(!0)},t.prototype.runCanActivate=function(t){var e=this,n=t.routeConfig?t.routeConfig.canActivate:null;return n&&0!==n.length?Hh(w.call(Lr(n),function(n){var r,i=e.getToken(n,t);return r=Kh(i.canActivate?i.canActivate(t,e.future):i(t,e.future)),th.call(r)})):qc(!0)},t.prototype.runCanActivateChild=function(t){var e=this,n=t[t.length-1],r=t.slice(0,t.length-1).reverse().map(function(t){return e.extractCanActivateChild(t)}).filter(function(t){return null!==t});return Hh(w.call(Lr(r),function(t){return Hh(w.call(Lr(t.guards),function(r){var i,o=e.getToken(r,t.node);return i=Kh(o.canActivateChild?o.canActivateChild(n,e.future):o(n,e.future)),th.call(i)}))}))},t.prototype.extractCanActivateChild=function(t){var e=t.routeConfig?t.routeConfig.canActivateChild:null;return e&&0!==e.length?{node:t,guards:e}:null},t.prototype.runCanDeactivate=function(t,e){var n=this,r=e&&e.routeConfig?e.routeConfig.canDeactivate:null;if(!r||0===r.length)return qc(!0);var i=zc.call(Lr(r),function(r){var i,o=n.getToken(r,e);return i=Kh(o.canDeactivate?o.canDeactivate(t,e,n.curr,n.future):o(t,e,n.curr,n.future)),th.call(i)});return rh.call(i,function(t){return!0===t})},t.prototype.runResolve=function(t,e){return w.call(this.resolveNode(t._resolve,t),function(n){return t._resolvedData=n,t.data=Object(i.__assign)({},t.data,xf(t,e).resolve),null})},t.prototype.resolveNode=function(t,e){var n=this,r=Object.keys(t);if(0===r.length)return qc({});if(1===r.length){var i=r[0];return w.call(this.getResolver(t[i],e),function(t){return(e={})[i]=t,e;var e})}var o={},s=zc.call(Lr(r),function(r){return w.call(n.getResolver(t[r],e),function(t){return o[r]=t,t})});return w.call(sh.call(s),function(){return o})},t.prototype.getResolver=function(t,e){var n=this.getToken(t,e);return Kh(n.resolve?n.resolve(e,this.future):n(e,this.future))},t.prototype.getToken=function(t,e){var n=function(t){if(!t)return null;for(var e=t.parent;e;e=e.parent){var n=e.routeConfig;if(n&&n._loadedConfig)return n._loadedConfig}return null}(e);return(n?n.module.injector:this.moduleInjector).get(t)},t}(),Yf=function(){},Jf=function(){function t(t,e,n,r,i){this.rootComponentType=t,this.config=e,this.urlTree=n,this.url=r,this.paramsInheritanceStrategy=i}return t.prototype.recognize=function(){try{var t=$f(this.urlTree.root,[],[],this.config).segmentGroup,e=this.processSegmentGroup(this.config,t,Ph),n=new Af([],Object.freeze({}),Object.freeze(this.urlTree.queryParams),this.urlTree.fragment,{},Ph,this.rootComponentType,null,this.urlTree.root,-1,{}),r=new Sf(n,e),i=new Of(this.url,r);return this.inheritParamsAndData(i._root),qc(i)}catch(t){return new o.a(function(e){return e.error(t)})}},t.prototype.inheritParamsAndData=function(t){var e=this,n=t.value,r=xf(n,this.paramsInheritanceStrategy);n.params=Object.freeze(r.params),n.data=Object.freeze(r.data),t.children.forEach(function(t){return e.inheritParamsAndData(t)})},t.prototype.processSegmentGroup=function(t,e,n){return 0===e.segments.length&&e.hasChildren()?this.processChildren(t,e):this.processSegment(t,e,e.segments,n)},t.prototype.processChildren=function(t,e){var n,r=this,i=Jh(e,function(e,n){return r.processSegmentGroup(t,e,n)});return n={},i.forEach(function(t){var e=n[t.value.outlet];if(e){var r=e.url.map(function(t){return t.toString()}).join("/"),i=t.value.url.map(function(t){return t.toString()}).join("/");throw new Error("Two segments cannot have the same outlet name: '"+r+"' and '"+i+"'.")}n[t.value.outlet]=t.value}),i.sort(function(t,e){return t.value.outlet===Ph?-1:e.value.outlet===Ph?1:t.value.outlet.localeCompare(e.value.outlet)}),i},t.prototype.processSegment=function(t,e,n,r){for(var i=0,o=t;i<o.length;i++){var s=o[i];try{return this.processSegmentAgainstRoute(s,e,n,r)}catch(t){if(!(t instanceof Yf))throw t}}if(this.noLeftoversInUrl(e,n,r))return[];throw new Yf},t.prototype.noLeftoversInUrl=function(t,e,n){return 0===e.length&&!t.children[n]},t.prototype.processSegmentAgainstRoute=function(t,e,n,r){if(t.redirectTo)throw new Yf;if((t.outlet||Ph)!==r)throw new Yf;var o,s=[],a=[];if("**"===t.path){var u=n.length>0?Bh(n).parameters:{};o=new Af(n,u,Object.freeze(this.urlTree.queryParams),this.urlTree.fragment,np(t),r,t.component,t,Xf(e),Zf(e)+n.length,rp(t))}else{var l=function(t,e,n){if(""===e.path){if("full"===e.pathMatch&&(t.hasChildren()||n.length>0))throw new Yf;return{consumedSegments:[],lastChild:0,parameters:{}}}var r=(e.matcher||Dh)(n,t,e);if(!r)throw new Yf;var o={};qh(r.posParams,function(t,e){o[e]=t.path});var s=r.consumed.length>0?Object(i.__assign)({},o,r.consumed[r.consumed.length-1].parameters):o;return{consumedSegments:r.consumed,lastChild:r.consumed.length,parameters:s}}(e,t,n);s=l.consumedSegments,a=n.slice(l.lastChild),o=new Af(s,l.parameters,Object.freeze(this.urlTree.queryParams),this.urlTree.fragment,np(t),r,t.component,t,Xf(e),Zf(e)+s.length,rp(t))}var c=function(t){return t.children?t.children:t.loadChildren?t._loadedConfig.routes:[]}(t),h=$f(e,s,a,c),f=h.segmentGroup,p=h.slicedSegments;if(0===p.length&&f.hasChildren()){var d=this.processChildren(c,f);return[new Sf(o,d)]}if(0===c.length&&0===p.length)return[new Sf(o,[])];var y=this.processSegment(c,f,p,Ph);return[new Sf(o,y)]},t}();function Xf(t){for(var e=t;e._sourceSegment;)e=e._sourceSegment;return e}function Zf(t){for(var e=t,n=e._segmentIndexShift?e._segmentIndexShift:0;e._sourceSegment;)n+=(e=e._sourceSegment)._segmentIndexShift?e._segmentIndexShift:0;return n-1}function $f(t,e,n,r){if(n.length>0&&function(t,e,n){return r.some(function(n){return tp(t,e,n)&&ep(n)!==Ph})}(t,n)){var o=new Gh(e,function(t,e,n,r){var i={};i[Ph]=r,r._sourceSegment=t,r._segmentIndexShift=e.length;for(var o=0,s=n;o<s.length;o++){var a=s[o];if(""===a.path&&ep(a)!==Ph){var u=new Gh([],{});u._sourceSegment=t,u._segmentIndexShift=e.length,i[ep(a)]=u}}return i}(t,e,r,new Gh(n,t.children)));return o._sourceSegment=t,o._segmentIndexShift=e.length,{segmentGroup:o,slicedSegments:[]}}if(0===n.length&&function(t,e,n){return r.some(function(n){return tp(t,e,n)})}(t,n)){var s=new Gh(t.segments,function(t,e,n,o){for(var s={},a=0,u=r;a<u.length;a++){var l=u[a];if(tp(t,e,l)&&!o[ep(l)]){var c=new Gh([],{});c._sourceSegment=t,c._segmentIndexShift=t.segments.length,s[ep(l)]=c}}return Object(i.__assign)({},o,s)}(t,n,0,t.children));return s._sourceSegment=t,s._segmentIndexShift=e.length,{segmentGroup:s,slicedSegments:n}}var a=new Gh(t.segments,t.children);return a._sourceSegment=t,a._segmentIndexShift=e.length,{segmentGroup:a,slicedSegments:n}}function tp(t,e,n){return(!(t.hasChildren()||e.length>0)||"full"!==n.pathMatch)&&""===n.path&&void 0===n.redirectTo}function ep(t){return t.outlet||Ph}function np(t){return t.data||{}}function rp(t){return t.resolve||{}}var ip=function(){},op=function(){function t(){}return t.prototype.shouldDetach=function(t){return!1},t.prototype.store=function(t,e){},t.prototype.shouldAttach=function(t){return!1},t.prototype.retrieve=function(t){return null},t.prototype.shouldReuseRoute=function(t,e){return t.routeConfig===e.routeConfig},t}(),sp=new r.o("ROUTES"),ap=function(){function t(t,e,n,r){this.loader=t,this.compiler=e,this.onLoadStartListener=n,this.onLoadEndListener=r}return t.prototype.load=function(t,e){var n=this;this.onLoadStartListener&&this.onLoadStartListener(e);var r=this.loadModuleFactory(e.loadChildren);return w.call(r,function(r){n.onLoadEndListener&&n.onLoadEndListener(e);var i=r.create(t);return new Mh(Uh(i.injector.get(sp)),i)})},t.prototype.loadModuleFactory=function(t){var e=this;return"string"==typeof t?g(this.loader.load(t)):zc.call(Kh(t()),function(t){return t instanceof r.t?qc(t):g(e.compiler.compileModuleAsync(t))})},t}(),up=function(){},lp=function(){function t(){}return t.prototype.shouldProcessUrl=function(t){return!0},t.prototype.extract=function(t){return t},t.prototype.merge=function(t,e){return t},t}();function cp(t){throw t}function hp(t){return qc(null)}var fp=function(){function t(t,e,n,i,o,s,a,u){var l=this;this.rootComponentType=t,this.urlSerializer=e,this.rootContexts=n,this.location=i,this.config=u,this.navigations=new Bc(null),this.navigationId=0,this.events=new Pc.a,this.errorHandler=cp,this.navigated=!1,this.hooks={beforePreactivation:hp,afterPreactivation:hp},this.urlHandlingStrategy=new lp,this.routeReuseStrategy=new op,this.onSameUrlNavigation="ignore",this.paramsInheritanceStrategy="emptyOnly",this.ngModule=o.get(r.v),this.resetConfig(u),this.currentUrlTree=new Qh(new Gh([],{}),{},null),this.rawUrlTree=this.currentUrlTree,this.configLoader=new ap(s,a,function(t){return l.triggerEvent(new Th(t))},function(t){return l.triggerEvent(new Ih(t))}),this.routerState=If(this.currentUrlTree,this.rootComponentType),this.processNavigations()}return t.prototype.resetRootComponentType=function(t){this.rootComponentType=t,this.routerState.root.component=this.rootComponentType},t.prototype.initialNavigation=function(){this.setUpLocationChangeListener(),0===this.navigationId&&this.navigateByUrl(this.location.path(!0),{replaceUrl:!0})},t.prototype.setUpLocationChangeListener=function(){var t=this;this.locationSubscription||(this.locationSubscription=this.location.subscribe(Zone.current.wrap(function(e){var n=t.urlSerializer.parse(e.url),r="popstate"===e.type?"popstate":"hashchange";setTimeout(function(){t.scheduleNavigation(n,r,{replaceUrl:!0})},0)})))},Object.defineProperty(t.prototype,"url",{get:function(){return this.serializeUrl(this.currentUrlTree)},enumerable:!0,configurable:!0}),t.prototype.triggerEvent=function(t){this.events.next(t)},t.prototype.resetConfig=function(t){Vh(t),this.config=t,this.navigated=!1},t.prototype.ngOnDestroy=function(){this.dispose()},t.prototype.dispose=function(){this.locationSubscription&&(this.locationSubscription.unsubscribe(),this.locationSubscription=null)},t.prototype.createUrlTree=function(t,e){void 0===e&&(e={});var n=e.relativeTo,o=e.queryParams,s=e.fragment,a=e.preserveQueryParams,u=e.queryParamsHandling,l=e.preserveFragment;Object(r.T)()&&a&&console&&console.warn&&console.warn("preserveQueryParams is deprecated, use queryParamsHandling instead.");var c=n||this.routerState.root,h=l?this.currentUrlTree.fragment:s,f=null;if(u)switch(u){case"merge":f=Object(i.__assign)({},this.currentUrlTree.queryParams,o);break;case"preserve":f=this.currentUrlTree.queryParams;break;default:f=o||null}else f=a?this.currentUrlTree.queryParams:o||null;return null!==f&&(f=this.removeEmptyProps(f)),function(t,e,n,r,i){if(0===n.length)return Vf(e.root,e.root,e,r,i);var o=function(t){if("string"==typeof t[0]&&1===t.length&&"/"===t[0])return new Ff(!0,0,t);var e=0,n=!1,r=t.reduce(function(t,r,i){if("object"==typeof r&&null!=r){if(r.outlets){var o={};return qh(r.outlets,function(t,e){o[e]="string"==typeof t?t.split("/"):t}),t.concat([{outlets:o}])}if(r.segmentPath)return t.concat([r.segmentPath])}return"string"!=typeof r?t.concat([r]):0===i?(r.split("/").forEach(function(r,i){0==i&&"."===r||(0==i&&""===r?n=!0:".."===r?e++:""!=r&&t.push(r))}),t):t.concat([r])},[]);return new Ff(n,e,r)}(n);if(o.toRoot())return Vf(e.root,new Gh([],{}),e,r,i);var s=function(t,n,r){if(t.isAbsolute)return new jf(e.root,!0,0);if(-1===r.snapshot._lastPathIndex)return new jf(r.snapshot._urlSegment,!0,0);var i=Mf(t.commands[0])?0:1;return function(e,n,o){for(var s=r.snapshot._urlSegment,a=r.snapshot._lastPathIndex+i,u=t.numberOfDoubleDots;u>a;){if(u-=a,!(s=s.parent))throw new Error("Invalid number of '../'");a=s.segments.length}return new jf(s,!1,a-u)}()}(o,0,t),a=s.processChildren?Bf(s.segmentGroup,s.index,o.commands):Uf(s.segmentGroup,s.index,o.commands);return Vf(s.segmentGroup,a,e,r,i)}(c,this.currentUrlTree,t,f,h)},t.prototype.navigateByUrl=function(t,e){void 0===e&&(e={skipLocationChange:!1});var n=t instanceof Qh?t:this.parseUrl(t),r=this.urlHandlingStrategy.merge(n,this.rawUrlTree);return this.scheduleNavigation(r,"imperative",e)},t.prototype.navigate=function(t,e){return void 0===e&&(e={skipLocationChange:!1}),function(t){for(var e=0;e<t.length;e++){var n=t[e];if(null==n)throw new Error("The requested path contains "+n+" segment at index "+e)}}(t),this.navigateByUrl(this.createUrlTree(t,e),e)},t.prototype.serializeUrl=function(t){return this.urlSerializer.serialize(t)},t.prototype.parseUrl=function(t){return this.urlSerializer.parse(t)},t.prototype.isActive=function(t,e){if(t instanceof Qh)return zh(this.currentUrlTree,t,e);var n=this.urlSerializer.parse(t);return zh(this.currentUrlTree,n,e)},t.prototype.removeEmptyProps=function(t){return Object.keys(t).reduce(function(e,n){var r=t[n];return null!==r&&void 0!==r&&(e[n]=r),e},{})},t.prototype.processNavigations=function(){var t=this;Kc.call(this.navigations,function(e){return e?(t.executeScheduledNavigation(e),e.promise.catch(function(){})):qc(null)}).subscribe(function(){})},t.prototype.scheduleNavigation=function(t,e,n){var r=this.navigations.value;if(r&&"imperative"!==e&&"imperative"===r.source&&r.rawUrl.toString()===t.toString())return Promise.resolve(!0);if(r&&"hashchange"==e&&"popstate"===r.source&&r.rawUrl.toString()===t.toString())return Promise.resolve(!0);if(r&&"popstate"==e&&"hashchange"===r.source&&r.rawUrl.toString()===t.toString())return Promise.resolve(!0);var i=null,o=null,s=new Promise(function(t,e){i=t,o=e}),a=++this.navigationId;return this.navigations.next({id:a,source:e,rawUrl:t,extras:n,resolve:i,reject:o,promise:s}),s.catch(function(t){return Promise.reject(t)})},t.prototype.executeScheduledNavigation=function(t){var e=this,n=t.id,r=t.rawUrl,i=t.extras,o=t.resolve,s=t.reject,a=this.urlHandlingStrategy.extract(r),u=!this.navigated||a.toString()!==this.currentUrlTree.toString();("reload"===this.onSameUrlNavigation||u)&&this.urlHandlingStrategy.shouldProcessUrl(r)?(this.events.next(new mh(n,this.serializeUrl(a))),Promise.resolve().then(function(t){return e.runNavigate(a,r,!!i.skipLocationChange,!!i.replaceUrl,n,null)}).then(o,s)):u&&this.rawUrlTree&&this.urlHandlingStrategy.shouldProcessUrl(this.rawUrlTree)?(this.events.next(new mh(n,this.serializeUrl(a))),Promise.resolve().then(function(t){return e.runNavigate(a,r,!1,!1,n,If(a,e.rootComponentType).snapshot)}).then(o,s)):(this.rawUrlTree=r,o(null))},t.prototype.runNavigate=function(t,e,n,r,i,o){var s=this;return i!==this.navigationId?(this.events.next(new vh(i,this.serializeUrl(t),"Navigation ID "+i+" is not equal to the current navigation id "+this.navigationId)),Promise.resolve(!1)):new Promise(function(a,u){var l;if(o)l=qc({appliedUrl:t,snapshot:o});else{var c=new yf(s.ngModule.injector,s.configLoader,s.urlSerializer,t,s.config).apply();l=zc.call(c,function(e){return w.call(function(t,e,n,r,i){return void 0===i&&(i="emptyOnly"),new Jf(t,e,n,r,i).recognize()}(s.rootComponentType,s.config,e,s.serializeUrl(e),s.paramsInheritanceStrategy),function(n){return s.events.next(new bh(i,s.serializeUrl(t),s.serializeUrl(e),n)),{appliedUrl:e,snapshot:n}})})}var h,f,p=zc.call(l,function(t){return w.call(s.hooks.beforePreactivation(t.snapshot),function(){return t})}),d=w.call(p,function(t){var e=t.appliedUrl,n=t.snapshot;return(h=new Wf(n,s.routerState.snapshot,s.ngModule.injector,function(t){return s.triggerEvent(t)})).initialize(s.rootContexts),{appliedUrl:e,snapshot:n}}),y=zc.call(d,function(e){var n=e.appliedUrl,r=e.snapshot;return s.navigationId!==i?qc(!1):(s.triggerEvent(new wh(i,s.serializeUrl(t),n,r)),w.call(h.checkGuards(),function(e){return s.triggerEvent(new Eh(i,s.serializeUrl(t),n,r,e)),{appliedUrl:n,snapshot:r,shouldActivate:e}}))}),m=zc.call(y,function(e){return s.navigationId!==i?qc(!1):e.shouldActivate&&h.isActivating()?(s.triggerEvent(new Sh(i,s.serializeUrl(t),e.appliedUrl,e.snapshot)),w.call(h.resolveData(s.paramsInheritanceStrategy),function(){return s.triggerEvent(new Ch(i,s.serializeUrl(t),e.appliedUrl,e.snapshot)),e})):qc(e)}),g=zc.call(m,function(t){return w.call(s.hooks.afterPreactivation(t.snapshot),function(){return t})}),v=w.call(g,function(t){var e,n,r,i=t.appliedUrl,o=t.shouldActivate;return o?{appliedUrl:i,state:(r=function t(e,n,r){if(r&&e.shouldReuseRoute(n.value,r.value.snapshot)){(a=r.value)._futureSnapshot=n.value;var i=function(e,n,r){return n.children.map(function(n){for(var i=0,o=r.children;i<o.length;i++){var s=o[i];if(e.shouldReuseRoute(s.value.snapshot,n.value))return t(e,n,s)}return t(e,n)})}(e,n,r);return new Sf(a,i)}if(e.retrieve(n.value)){var o=e.retrieve(n.value).route;return function t(e,n){if(e.value.routeConfig!==n.value.routeConfig)throw new Error("Cannot reattach ActivatedRouteSnapshot created from a different route");if(e.children.length!==n.children.length)throw new Error("Cannot reattach ActivatedRouteSnapshot with a different number of children");n.value._futureSnapshot=e.value;for(var r=0;r<e.children.length;++r)t(e.children[r],n.children[r])}(n,o),o}var s,a=new kf(new Bc((s=n.value).url),new Bc(s.params),new Bc(s.queryParams),new Bc(s.fragment),new Bc(s.data),s.outlet,s.component,s);return i=n.children.map(function(n){return t(e,n)}),new Sf(a,i)}(s.routeReuseStrategy,(e=t.snapshot)._root,(n=s.routerState)?n._root:void 0),new Tf(r,e)),shouldActivate:o}:{appliedUrl:i,state:null,shouldActivate:o}}),_=s.routerState,b=s.currentUrlTree;v.forEach(function(t){var o=t.state;if(t.shouldActivate&&i===s.navigationId){if(s.currentUrlTree=t.appliedUrl,s.rawUrlTree=s.urlHandlingStrategy.merge(s.currentUrlTree,e),s.routerState=o,!n){var a=s.urlSerializer.serialize(s.rawUrlTree);s.location.isCurrentPathEqualTo(a)||r?s.location.replaceState(a):s.location.go(a)}new pp(s.routeReuseStrategy,o,_,function(t){return s.triggerEvent(t)}).activate(s.rootContexts),f=!0}else f=!1}).then(function(){f?(s.navigated=!0,s.events.next(new gh(i,s.serializeUrl(t),s.serializeUrl(s.currentUrlTree))),a(!0)):(s.resetUrlToCurrentUrlTree(),s.events.next(new vh(i,s.serializeUrl(t),"")),a(!1))},function(n){if((r=n)&&r.ngNavigationCancelingError)s.navigated=!0,s.resetStateAndUrl(_,b,e),s.events.next(new vh(i,s.serializeUrl(t),n.message)),a(!1);else{s.resetStateAndUrl(_,b,e),s.events.next(new _h(i,s.serializeUrl(t),n));try{a(s.errorHandler(n))}catch(t){u(t)}}var r})})},t.prototype.resetStateAndUrl=function(t,e,n){this.routerState=t,this.currentUrlTree=e,this.rawUrlTree=this.urlHandlingStrategy.merge(this.currentUrlTree,n),this.resetUrlToCurrentUrlTree()},t.prototype.resetUrlToCurrentUrlTree=function(){this.location.replaceState(this.urlSerializer.serialize(this.rawUrlTree))},t}(),pp=function(){function t(t,e,n,r){this.routeReuseStrategy=t,this.futureState=e,this.currState=n,this.forwardEvent=r}return t.prototype.activate=function(t){var e=this.futureState._root,n=this.currState?this.currState._root:null;this.deactivateChildRoutes(e,n,t),Rf(this.futureState.root),this.activateChildRoutes(e,n,t)},t.prototype.deactivateChildRoutes=function(t,e,n){var r=this,i=Cf(e);t.children.forEach(function(t){var e=t.value.outlet;r.deactivateRoutes(t,i[e],n),delete i[e]}),qh(i,function(t,e){r.deactivateRouteAndItsChildren(t,n)})},t.prototype.deactivateRoutes=function(t,e,n){var r=t.value,i=e?e.value:null;if(r===i)if(r.component){var o=n.getContext(r.outlet);o&&this.deactivateChildRoutes(t,e,o.children)}else this.deactivateChildRoutes(t,e,n);else i&&this.deactivateRouteAndItsChildren(e,n)},t.prototype.deactivateRouteAndItsChildren=function(t,e){this.routeReuseStrategy.shouldDetach(t.value.snapshot)?this.detachAndStoreRouteSubtree(t,e):this.deactivateRouteAndOutlet(t,e)},t.prototype.detachAndStoreRouteSubtree=function(t,e){var n=e.getContext(t.value.outlet);if(n&&n.outlet){var r=n.outlet.detach(),i=n.children.onOutletDeactivated();this.routeReuseStrategy.store(t.value.snapshot,{componentRef:r,route:t,contexts:i})}},t.prototype.deactivateRouteAndOutlet=function(t,e){var n=this,r=e.getContext(t.value.outlet);if(r){var i=Cf(t),o=t.value.component?r.children:e;qh(i,function(t,e){return n.deactivateRouteAndItsChildren(t,o)}),r.outlet&&(r.outlet.deactivate(),r.children.onOutletDeactivated())}},t.prototype.activateChildRoutes=function(t,e,n){var r=this,i=Cf(e);t.children.forEach(function(t){r.activateRoutes(t,i[t.value.outlet],n),r.forwardEvent(new Oh(t.value.snapshot))}),t.children.length&&this.forwardEvent(new xh(t.value.snapshot))},t.prototype.activateRoutes=function(t,e,n){var r=t.value,i=e?e.value:null;if(Rf(r),r===i)if(r.component){var o=n.getOrCreateContext(r.outlet);this.activateChildRoutes(t,e,o.children)}else this.activateChildRoutes(t,e,n);else if(r.component)if(o=n.getOrCreateContext(r.outlet),this.routeReuseStrategy.shouldAttach(r.snapshot)){var s=this.routeReuseStrategy.retrieve(r.snapshot);this.routeReuseStrategy.store(r.snapshot,null),o.children.onOutletReAttached(s.contexts),o.attachRef=s.componentRef,o.route=s.route.value,o.outlet&&o.outlet.attach(s.componentRef,s.route.value),dp(s.route)}else{var a=function(t){for(var e=r.snapshot.parent;e;e=e.parent){var n=e.routeConfig;if(n&&n._loadedConfig)return n._loadedConfig;if(n&&n.component)return null}return null}(),u=a?a.module.componentFactoryResolver:null;o.route=r,o.resolver=u,o.outlet&&o.outlet.activateWith(r,u),this.activateChildRoutes(t,null,o.children)}else this.activateChildRoutes(t,null,n)},t}();function dp(t){Rf(t.value),t.children.forEach(dp)}var yp=function(){function t(t,e,n){var r=this;this.router=t,this.route=e,this.locationStrategy=n,this.commands=[],this.subscription=t.events.subscribe(function(t){t instanceof gh&&r.updateTargetUrlAndHref()})}return Object.defineProperty(t.prototype,"routerLink",{set:function(t){this.commands=null!=t?Array.isArray(t)?t:[t]:[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"preserveQueryParams",{set:function(t){Object(r.T)()&&console&&console.warn&&console.warn("preserveQueryParams is deprecated, use queryParamsHandling instead."),this.preserve=t},enumerable:!0,configurable:!0}),t.prototype.ngOnChanges=function(t){this.updateTargetUrlAndHref()},t.prototype.ngOnDestroy=function(){this.subscription.unsubscribe()},t.prototype.onClick=function(t,e,n,r){if(0!==t||e||n||r)return!0;if("string"==typeof this.target&&"_self"!=this.target)return!0;var i={skipLocationChange:mp(this.skipLocationChange),replaceUrl:mp(this.replaceUrl)};return this.router.navigateByUrl(this.urlTree,i),!1},t.prototype.updateTargetUrlAndHref=function(){this.href=this.locationStrategy.prepareExternalUrl(this.router.serializeUrl(this.urlTree))},Object.defineProperty(t.prototype,"urlTree",{get:function(){return this.router.createUrlTree(this.commands,{relativeTo:this.route,queryParams:this.queryParams,fragment:this.fragment,preserveQueryParams:mp(this.preserve),queryParamsHandling:this.queryParamsHandling,preserveFragment:mp(this.preserveFragment)})},enumerable:!0,configurable:!0}),t}();function mp(t){return""===t||!!t}var gp=function(){function t(t,e,n,r){var i=this;this.router=t,this.element=e,this.renderer=n,this.cdr=r,this.classes=[],this.isActive=!1,this.routerLinkActiveOptions={exact:!1},this.subscription=t.events.subscribe(function(t){t instanceof gh&&i.update()})}return t.prototype.ngAfterContentInit=function(){var t=this;this.links.changes.subscribe(function(e){return t.update()}),this.linksWithHrefs.changes.subscribe(function(e){return t.update()}),this.update()},Object.defineProperty(t.prototype,"routerLinkActive",{set:function(t){var e=Array.isArray(t)?t:t.split(" ");this.classes=e.filter(function(t){return!!t})},enumerable:!0,configurable:!0}),t.prototype.ngOnChanges=function(t){this.update()},t.prototype.ngOnDestroy=function(){this.subscription.unsubscribe()},t.prototype.update=function(){var t=this;this.links&&this.linksWithHrefs&&this.router.navigated&&Promise.resolve().then(function(){var e=t.hasActiveLinks();t.isActive!==e&&(t.isActive=e,t.classes.forEach(function(n){e?t.renderer.addClass(t.element.nativeElement,n):t.renderer.removeClass(t.element.nativeElement,n)}))})},t.prototype.isLinkActive=function(t){var e=this;return function(n){return t.isActive(n.urlTree,e.routerLinkActiveOptions.exact)}},t.prototype.hasActiveLinks=function(){return this.links.some(this.isLinkActive(this.router))||this.linksWithHrefs.some(this.isLinkActive(this.router))},t}(),vp=function(){return function(){this.outlet=null,this.route=null,this.resolver=null,this.children=new _p,this.attachRef=null}}(),_p=function(){function t(){this.contexts=new Map}return t.prototype.onChildOutletCreated=function(t,e){var n=this.getOrCreateContext(t);n.outlet=e,this.contexts.set(t,n)},t.prototype.onChildOutletDestroyed=function(t){var e=this.getContext(t);e&&(e.outlet=null)},t.prototype.onOutletDeactivated=function(){var t=this.contexts;return this.contexts=new Map,t},t.prototype.onOutletReAttached=function(t){this.contexts=t},t.prototype.getOrCreateContext=function(t){var e=this.getContext(t);return e||(e=new vp,this.contexts.set(t,e)),e},t.prototype.getContext=function(t){return this.contexts.get(t)||null},t}(),bp=function(){function t(t,e,n,i,o){this.parentContexts=t,this.location=e,this.resolver=n,this.changeDetector=o,this.activated=null,this._activatedRoute=null,this.activateEvents=new r.m,this.deactivateEvents=new r.m,this.name=i||Ph,t.onChildOutletCreated(this.name,this)}return t.prototype.ngOnDestroy=function(){this.parentContexts.onChildOutletDestroyed(this.name)},t.prototype.ngOnInit=function(){if(!this.activated){var t=this.parentContexts.getContext(this.name);t&&t.route&&(t.attachRef?this.attach(t.attachRef,t.route):this.activateWith(t.route,t.resolver||null))}},Object.defineProperty(t.prototype,"isActivated",{get:function(){return!!this.activated},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"component",{get:function(){if(!this.activated)throw new Error("Outlet is not activated");return this.activated.instance},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"activatedRoute",{get:function(){if(!this.activated)throw new Error("Outlet is not activated");return this._activatedRoute},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"activatedRouteData",{get:function(){return this._activatedRoute?this._activatedRoute.snapshot.data:{}},enumerable:!0,configurable:!0}),t.prototype.detach=function(){if(!this.activated)throw new Error("Outlet is not activated");this.location.detach();var t=this.activated;return this.activated=null,this._activatedRoute=null,t},t.prototype.attach=function(t,e){this.activated=t,this._activatedRoute=e,this.location.insert(t.hostView)},t.prototype.deactivate=function(){if(this.activated){var t=this.component;this.activated.destroy(),this.activated=null,this._activatedRoute=null,this.deactivateEvents.emit(t)}},t.prototype.activateWith=function(t,e){if(this.isActivated)throw new Error("Cannot activate an already activated outlet");this._activatedRoute=t;var n=(e=e||this.resolver).resolveComponentFactory(t._futureSnapshot.routeConfig.component),r=this.parentContexts.getOrCreateContext(this.name).children,i=new wp(t,r,this.location.injector);this.activated=this.location.createComponent(n,this.location.length,i),this.changeDetector.markForCheck(),this.activateEvents.emit(this.activated.instance)},t}(),wp=function(){function t(t,e,n){this.route=t,this.childContexts=e,this.parent=n}return t.prototype.get=function(t,e){return t===kf?this.route:t===_p?this.childContexts:this.parent.get(t,e)},t}(),Ep=function(){},Sp=function(){function t(){}return t.prototype.preload=function(t,e){return Wc.call(e(),function(){return qc(null)})},t}(),Cp=function(){function t(){}return t.prototype.preload=function(t,e){return qc(null)},t}(),Tp=function(){function t(t,e,n,r,i){this.router=t,this.injector=r,this.preloadingStrategy=i,this.loader=new ap(e,n,function(e){return t.triggerEvent(new Th(e))},function(e){return t.triggerEvent(new Ih(e))})}return t.prototype.setUpPreloading=function(){var t=this,e=ui.call(this.router.events,function(t){return t instanceof gh});this.subscription=Kc.call(e,function(){return t.preload()}).subscribe(function(){})},t.prototype.preload=function(){var t=this.injector.get(r.v);return this.processRoutes(t,this.router.config)},t.prototype.ngOnDestroy=function(){this.subscription.unsubscribe()},t.prototype.processRoutes=function(t,e){for(var n=[],r=0,i=e;r<i.length;r++){var o=i[r];if(o.loadChildren&&!o.canLoad&&o._loadedConfig){var s=o._loadedConfig;n.push(this.processRoutes(s.module,s.routes))}else o.loadChildren&&!o.canLoad?n.push(this.preloadConfig(t,o)):o.children&&n.push(this.processRoutes(t,o.children))}return ah.call(Lr(n))},t.prototype.preloadConfig=function(t,e){var n=this;return this.preloadingStrategy.preload(e,function(){var r=n.loader.load(t.injector,e);return zc.call(r,function(t){return e._loadedConfig=t,n.processRoutes(t.module,t.routes)})})},t}(),Ip=new r.o("ROUTER_CONFIGURATION"),kp=new r.o("ROUTER_FORROOT_GUARD"),xp=[I,{provide:Xh,useClass:Zh},{provide:fp,useFactory:Dp,deps:[r.g,Xh,_p,I,r.p,r.u,r.i,sp,Ip,[up,new r.y],[ip,new r.y]]},_p,{provide:kf,useFactory:Mp,deps:[fp]},{provide:r.u,useClass:r.H},Tp,Cp,Sp,{provide:Ip,useValue:{enableTracing:!1}}];function Ap(){return new r.w("Router",fp)}var Op=function(){function t(t,e){}return t.forRoot=function(e,n){return{ngModule:t,providers:[xp,Rp(e),{provide:kp,useFactory:Np,deps:[[fp,new r.y,new r.G]]},{provide:Ip,useValue:n||{}},{provide:C,useFactory:Pp,deps:[E,[new r.n(T),new r.y],Ip]},{provide:Ep,useExisting:n&&n.preloadingStrategy?n.preloadingStrategy:Cp},{provide:r.w,multi:!0,useFactory:Ap},[Vp,{provide:r.d,multi:!0,useFactory:Fp,deps:[Vp]},{provide:Lp,useFactory:jp,deps:[Vp]},{provide:r.b,multi:!0,useExisting:Lp}]]}},t.forChild=function(e){return{ngModule:t,providers:[Rp(e)]}},t}();function Pp(t,e,n){return void 0===n&&(n={}),n.useHash?new x(t,e):new A(t,e)}function Np(t){if(t)throw new Error("RouterModule.forRoot() called twice. Lazy loaded modules should use RouterModule.forChild() instead.");return"guarded"}function Rp(t){return[{provide:r.a,multi:!0,useValue:t},{provide:sp,multi:!0,useValue:t}]}function Dp(t,e,n,r,i,o,s,a,u,l,c){void 0===u&&(u={});var h=new fp(null,e,n,r,i,o,s,Uh(a));if(l&&(h.urlHandlingStrategy=l),c&&(h.routeReuseStrategy=c),u.errorHandler&&(h.errorHandler=u.errorHandler),u.enableTracing){var f=tt();h.events.subscribe(function(t){f.logGroup("Router Event: "+t.constructor.name),f.log(t.toString()),f.log(t),f.logGroupEnd()})}return u.onSameUrlNavigation&&(h.onSameUrlNavigation=u.onSameUrlNavigation),u.paramsInheritanceStrategy&&(h.paramsInheritanceStrategy=u.paramsInheritanceStrategy),h}function Mp(t){return t.routerState.root}var Vp=function(){function t(t){this.injector=t,this.initNavigation=!1,this.resultOfPreactivationDone=new Pc.a}return t.prototype.appInitializer=function(){var t=this;return this.injector.get(S,Promise.resolve(null)).then(function(){var e=null,n=new Promise(function(t){return e=t}),r=t.injector.get(fp),i=t.injector.get(Ip);if(t.isLegacyDisabled(i)||t.isLegacyEnabled(i))e(!0);else if("disabled"===i.initialNavigation)r.setUpLocationChangeListener(),e(!0);else{if("enabled"!==i.initialNavigation)throw new Error("Invalid initialNavigation options: '"+i.initialNavigation+"'");r.hooks.afterPreactivation=function(){return t.initNavigation?qc(null):(t.initNavigation=!0,e(!0),t.resultOfPreactivationDone)},r.initialNavigation()}return n})},t.prototype.bootstrapListener=function(t){var e=this.injector.get(Ip),n=this.injector.get(Tp),i=this.injector.get(fp),o=this.injector.get(r.g);t===o.components[0]&&(this.isLegacyEnabled(e)?i.initialNavigation():this.isLegacyDisabled(e)&&i.setUpLocationChangeListener(),n.setUpPreloading(),i.resetRootComponentType(o.componentTypes[0]),this.resultOfPreactivationDone.next(null),this.resultOfPreactivationDone.complete())},t.prototype.isLegacyEnabled=function(t){return"legacy_enabled"===t.initialNavigation||!0===t.initialNavigation||void 0===t.initialNavigation},t.prototype.isLegacyDisabled=function(t){return"legacy_disabled"===t.initialNavigation||!1===t.initialNavigation},t}();function Fp(t){return t.appInitializer.bind(t)}function jp(t){return t.bootstrapListener.bind(t)}var Lp=new r.o("Router Initializer"),Up=r._1({encapsulation:0,styles:["#logo[_ngcontent-%COMP%] {\n          display: inline-block;\n      }","h2[_ngcontent-%COMP%] {\n            margin-top: 0px;\n            margin-bottom: 10px;\n          }","modal-content[_ngcontent-%COMP%]    > h2[_ngcontent-%COMP%] {\n                font-size: large;\n                font-weight: bold;\n                color: #27272d !important;\n              }\n                input[_ngcontent-%COMP%] {\n                  text-align: center;\n                  font-style: italic;\n                  font-size: smaller;\n                  letter-spacing: 1px;\n                  color: #27272d !important;\n                }"],data:{animation:[{type:7,name:"slideIn",definitions:[{type:1,expr:":enter",animation:[{type:6,styles:{transform:"translateX(-100%)",opacity:0},offset:null},{type:4,styles:{type:6,styles:{transform:"translateX(0)",opacity:1},offset:null},timings:"500ms"}],options:null},{type:1,expr:":leave",animation:[{type:6,styles:{transform:"translateX(0)",opacity:1},offset:null},{type:4,styles:{type:6,styles:{transform:"translateY(-100%)",opacity:0},offset:null},timings:"500ms"}],options:null}],options:{}}]}});function Bp(t){return r._25(0,[(t()(),r._3(0,0,null,null,1,"youtube-player",[["class","fullscreenVid"]],null,[[null,"ready"],[null,"change"]],function(t,e,n){var r=!0,i=t.component;return"ready"===e&&(r=!1!==i.savePlayer(n)&&r),"change"===e&&(r=!1!==i.onStateChange(n)&&r),r},Uc,Lc)),r._2(1,1097728,[["YTFullscreenPlayer",4]],0,Fc,[Vc,r.k,r.B],{videoId:[0,"videoId"],playerVars:[1,"playerVars"]},{ready:"ready",change:"change"})],function(t,e){var n=e.component;t(e,1,0,n.currentVideo.id,n.playerVars())},null)}function qp(t){return r._25(0,[(t()(),r._3(0,0,null,null,4,"div",[["class","overlay"]],[[24,"@slideIn",0]],null,null,null,null)),(t()(),r._23(-1,null,["\n  "])),(t()(),r._3(2,0,null,null,1,"h1",[],null,null,null,null,null)),(t()(),r._23(3,null,["",""])),(t()(),r._23(-1,null,["\n"]))],null,function(t,e){var n=e.component;t(e,0,0,void 0),t(e,3,0,n.fullscreenOverlayMsg)})}function Hp(t){return r._25(0,[(t()(),r._3(0,0,null,null,1,"small",[],null,null,null,null,null)),(t()(),r._23(1,null,["",""]))],null,function(t,e){t(e,1,0,e.component.regionCode)})}function Kp(t){return r._25(0,[(t()(),r._3(0,0,null,null,1,"small",[],null,null,null,null,null)),(t()(),r._23(1,null,["",""]))],null,function(t,e){t(e,1,0,e.component.regionCode)})}function zp(t){return r._25(0,[(t()(),r._3(0,0,null,null,2,"button",[["class","video-item-head-btn"],["type","button"]],null,[[null,"click"]],function(t,e,n){var r=!0;return"click"===e&&(r=!1!==t.component.clearPlaylist()&&r),r},null,null)),(t()(),r._3(1,0,null,null,0,"span",[["class","fa fa-close"]],null,null,null,null,null)),(t()(),r._23(-1,null,["clear"]))],null,null)}function Qp(t){return r._25(0,[(t()(),r._3(0,0,null,null,1,"div",[["class","video-list-info"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n                    Empty playlist\n                  "]))],null,null)}function Gp(t){return r._25(0,[(t()(),r._3(0,0,null,null,2,"div",[["class","video-item-image"]],null,null,null,null,null)),r._2(1,278528,null,0,Q,[r.r,r.k,r.B],{ngStyle:[0,"ngStyle"]},null),r._17(2,{"background-image":0})],function(t,e){t(e,1,0,t(e,2,0,"url("+e.parent.context.$implicit.snippet.thumbnails.default.url+")"))},null)}function Wp(t){return r._25(0,[(t()(),r._3(0,0,null,null,5,null,null,null,null,null,null,null)),(t()(),r._23(-1,null,["\n                          "])),(t()(),r._3(2,0,null,null,2,"p",[["class","video-item-hint"]],null,null,null,null,null)),(t()(),r._3(3,0,null,null,0,"span",[["class","fa fa-play"]],null,null,null,null,null)),(t()(),r._23(-1,null,["Playing"])),(t()(),r._23(-1,null,["\n                        "]))],null,null)}function Yp(t){return r._25(0,[(t()(),r._3(0,0,null,null,5,null,null,null,null,null,null,null)),(t()(),r._23(-1,null,["                        \n                          "])),(t()(),r._3(2,0,null,null,2,"p",[["class","video-item-hint"]],null,null,null,null,null)),(t()(),r._3(3,0,null,null,0,"span",[["class","fa fa-pause"]],null,null,null,null,null)),(t()(),r._23(-1,null,["Paused"])),(t()(),r._23(-1,null,[" \n                        "]))],null,null)}function Jp(t){return r._25(0,[(t()(),r._3(0,0,null,null,2,"p",[["class","video-item-hint"]],null,null,null,null,null)),(t()(),r._3(1,0,null,null,0,"span",[["class","fa fa-stop"]],null,null,null,null,null)),(t()(),r._23(-1,null,["Not started"]))],null,null)}function Xp(t){return r._25(0,[(t()(),r._3(0,0,null,null,4,null,null,null,null,null,null,null)),(t()(),r._23(-1,null,["                        \n                          "])),(t()(),r.Y(16777216,null,null,1,null,Jp)),r._2(3,16384,null,0,K,[r.M,r.J],{ngIf:[0,"ngIf"]},null),(t()(),r._23(-1,null,[" \n                        "]))],function(t,e){t(e,3,0,e.component.isDesktop)},null)}function Zp(t){return r._25(0,[(t()(),r._3(0,0,null,null,3,"button",[["class","video-item-remove"]],null,[[null,"click"]],function(t,e,n){var r=!0;return"click"===e&&(r=!1!==t.component.showPlaylistModal(t.parent.context.index)&&r),r},null,null)),(t()(),r._23(-1,null,["\n                        "])),(t()(),r._3(2,0,null,null,0,"span",[["class","fa fa-times"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n                      "]))],null,null)}function $p(t){return r._25(0,[(t()(),r._3(0,0,null,null,45,"div",[["class","video-item"]],[[1,"data-index",0]],null,null,null,null)),r._2(1,278528,null,0,U,[r.q,r.r,r.k,r.B],{klass:[0,"klass"],ngClass:[1,"ngClass"]},null),(t()(),r._23(-1,null,["\n                    "])),(t()(),r._3(3,0,null,null,24,"div",[["class","video-item-info"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n                      "])),(t()(),r.Y(16777216,null,null,1,null,Gp)),r._2(6,16384,null,0,K,[r.M,r.J],{ngIf:[0,"ngIf"]},null),(t()(),r._23(-1,null,["\n                      "])),(t()(),r._3(8,0,null,null,18,"div",[["class","video-item-content"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n                        "])),(t()(),r.Y(16777216,null,null,1,null,Wp)),r._2(11,16384,null,0,K,[r.M,r.J],{ngIf:[0,"ngIf"]},null),(t()(),r._23(-1,null,["\n                        "])),(t()(),r.Y(16777216,null,null,1,null,Yp)),r._2(14,16384,null,0,K,[r.M,r.J],{ngIf:[0,"ngIf"]},null),(t()(),r._23(-1,null,["                       \n                        "])),(t()(),r.Y(16777216,null,null,1,null,Xp)),r._2(17,16384,null,0,K,[r.M,r.J],{ngIf:[0,"ngIf"]},null),(t()(),r._23(-1,null,["                       \n                        "])),(t()(),r._3(19,0,null,null,1,"p",[["class","video-item-title"]],null,null,null,null,null)),(t()(),r._23(20,null,["",""])),(t()(),r._23(-1,null,["\n                        "])),(t()(),r._3(22,0,null,null,3,"p",[["class","video-item-autor"]],null,null,null,null,null)),(t()(),r._23(-1,null,["by "])),(t()(),r._3(24,0,null,null,1,"span",[],null,null,null,null,null)),(t()(),r._23(25,null,["",""])),(t()(),r._23(-1,null,["\n                      "])),(t()(),r._23(-1,null,["\n                    "])),(t()(),r._23(-1,null,["\n                    "])),(t()(),r._3(29,0,null,null,15,"div",[["class","video-item-settings"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n                      "])),(t()(),r._3(31,0,null,null,4,"button",[["class","video-item-play"]],null,[[null,"click"]],function(t,e,n){var r=!0;return"click"===e&&(r=!1!==t.component.onClickPlaylist(n,t.context.index)&&r),r},null,null)),(t()(),r._23(-1,null,["\n                        "])),(t()(),r._3(33,0,null,null,1,"span",[["class","fa "]],null,null,null,null,null)),r._2(34,278528,null,0,U,[r.q,r.r,r.k,r.B],{klass:[0,"klass"],ngClass:[1,"ngClass"]},null),(t()(),r._23(-1,null,["\n                      "])),(t()(),r._23(-1,null,["\n                      "])),(t()(),r._3(37,0,null,null,3,"button",[["class","video-item-share"]],null,[[null,"click"]],function(t,e,n){var r=!0;return"click"===e&&(r=!1!==t.component.onCopyVideoItemLink(t.context.index,3)&&r),r},null,null)),(t()(),r._23(-1,null,["\n                        "])),(t()(),r._3(39,0,null,null,0,"span",[["class","fa fa-share-alt"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n                      "])),(t()(),r._23(-1,null,["\n                      "])),(t()(),r.Y(16777216,null,null,1,null,Zp)),r._2(43,16384,null,0,K,[r.M,r.J],{ngIf:[0,"ngIf"]},null),(t()(),r._23(-1,null,["\n                    "])),(t()(),r._23(-1,null,["\n                  "]))],function(t,e){var n=e.component;t(e,1,0,"video-item",n.currentPlaylistItem===e.context.index?"active":""),t(e,6,0,n.thumbnails),t(e,11,0,n.currentPlaylistItem===e.context.index&&1===n.currentState),t(e,14,0,n.currentPlaylistItem===e.context.index&&1!==n.currentState&&-1!==n.currentState),t(e,17,0,n.currentPlaylistItem===e.context.index&&-1===n.currentState),t(e,34,0,"fa ",n.currentPlaylistItem===e.context.index&&1===n.currentState?"fa-pause":"fa-play"),t(e,43,0,n.isAdmin)},function(t,e){t(e,0,0,e.context.index),t(e,20,0,e.context.$implicit.snippet.title),t(e,25,0,e.context.$implicit.snippet.channelTitle)})}function td(t){return r._25(0,[(t()(),r._3(0,0,[[1,0],["playlistContainer",1]],null,7,"div",[["class","playlist-video-content"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n                  "])),(t()(),r.Y(16777216,null,null,1,null,Qp)),r._2(3,16384,null,0,K,[r.M,r.J],{ngIf:[0,"ngIf"]},null),(t()(),r._23(-1,null,["\n                  "])),(t()(),r.Y(16777216,null,null,1,null,$p)),r._2(6,802816,null,0,q,[r.M,r.J,r.q],{ngForOf:[0,"ngForOf"]},null),(t()(),r._23(-1,null,["\n                "]))],function(t,e){var n=e.component;t(e,3,0,0===n.playlistVideos.length),t(e,6,0,n.playlistVideos)},null)}function ed(t){return r._25(0,[(t()(),r._3(0,0,null,null,1,"div",[["class","video-list-info"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n                    Empty playlist\n                  "]))],null,null)}function nd(t){return r._25(0,[(t()(),r._3(0,0,null,null,2,"div",[["class","video-item-image"]],null,null,null,null,null)),r._2(1,278528,null,0,Q,[r.r,r.k,r.B],{ngStyle:[0,"ngStyle"]},null),r._17(2,{"background-image":0})],function(t,e){t(e,1,0,t(e,2,0,"url("+e.parent.context.$implicit.snippet.thumbnails.default.url+")"))},null)}function rd(t){return r._25(0,[(t()(),r._3(0,0,null,null,5,null,null,null,null,null,null,null)),(t()(),r._23(-1,null,["\n                          "])),(t()(),r._3(2,0,null,null,2,"p",[["class","video-item-hint"]],null,null,null,null,null)),(t()(),r._3(3,0,null,null,0,"span",[["class","fa fa-play"]],null,null,null,null,null)),(t()(),r._23(-1,null,["Playing"])),(t()(),r._23(-1,null,["\n                        "]))],null,null)}function id(t){return r._25(0,[(t()(),r._3(0,0,null,null,5,null,null,null,null,null,null,null)),(t()(),r._23(-1,null,["                        \n                          "])),(t()(),r._3(2,0,null,null,2,"p",[["class","video-item-hint"]],null,null,null,null,null)),(t()(),r._3(3,0,null,null,0,"span",[["class","fa fa-pause"]],null,null,null,null,null)),(t()(),r._23(-1,null,["Paused"])),(t()(),r._23(-1,null,[" \n                        "]))],null,null)}function od(t){return r._25(0,[(t()(),r._3(0,0,null,null,5,null,null,null,null,null,null,null)),(t()(),r._23(-1,null,["                        \n                          "])),(t()(),r._3(2,0,null,null,2,"p",[["class","video-item-hint"]],null,null,null,null,null)),(t()(),r._3(3,0,null,null,0,"span",[["class","fa fa-stop"]],null,null,null,null,null)),(t()(),r._23(-1,null,["Not started"])),(t()(),r._23(-1,null,[" \n                        "]))],null,null)}function sd(t){return r._25(0,[(t()(),r._3(0,0,null,null,3,"button",[["class","video-item-share"],["title","Tap if karaoke quality is great."]],null,[[null,"click"]],function(t,e,n){var r=!0;return"click"===e&&(r=!1!==t.component.flagAsQuality(t.parent.context.$implicit.id.videoId,t.parent.context.$implicit.snippet.title,t.parent.context.$implicit.snippet.channelId,t.parent.context.$implicit.snippet.channelTitle,1)&&r),r},null,null)),(t()(),r._23(-1,null,["\n                        "])),(t()(),r._3(2,0,null,null,0,"span",[["class","fa fa-heart"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n                      "]))],null,null)}function ad(t){return r._25(0,[(t()(),r._3(0,0,null,null,3,"button",[["class","video-item-share"],["title","Tap if karaoke quality is poor."]],null,[[null,"click"]],function(t,e,n){var r=!0;return"click"===e&&(r=!1!==t.component.flagAsQuality(t.parent.context.$implicit.id.videoId,t.parent.context.$implicit.snippet.title,t.parent.context.$implicit.snippet.channelId,t.parent.context.$implicit.snippet.channelTitle,-1)&&r),r},null,null)),(t()(),r._23(-1,null,["\n                        "])),(t()(),r._3(2,0,null,null,0,"span",[["class","fa fa-thumbs-down"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n                      "]))],null,null)}function ud(t){return r._25(0,[(t()(),r._3(0,0,null,null,3,"button",[["class","video-item-remove"]],null,[[null,"click"]],function(t,e,n){var r=!0;return"click"===e&&(r=!1!==t.component.removePlaylistItem(t.parent.context.index,t.parent.context.$implicit.seq)&&r),r},null,null)),(t()(),r._23(-1,null,["\n                        "])),(t()(),r._3(2,0,null,null,0,"span",[["class","fa fa-times"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n                      "]))],null,null)}function ld(t){return r._25(0,[(t()(),r._3(0,0,null,null,51,"div",[["class","video-item"]],[[1,"data-index",0]],null,null,null,null)),r._2(1,278528,null,0,U,[r.q,r.r,r.k,r.B],{klass:[0,"klass"],ngClass:[1,"ngClass"]},null),(t()(),r._23(-1,null,["\n                    "])),(t()(),r._3(3,0,null,null,24,"div",[["class","video-item-info"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n                      "])),(t()(),r.Y(16777216,null,null,1,null,nd)),r._2(6,16384,null,0,K,[r.M,r.J],{ngIf:[0,"ngIf"]},null),(t()(),r._23(-1,null,["\n                      "])),(t()(),r._3(8,0,null,null,18,"div",[["class","video-item-content"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n                        "])),(t()(),r.Y(16777216,null,null,1,null,rd)),r._2(11,16384,null,0,K,[r.M,r.J],{ngIf:[0,"ngIf"]},null),(t()(),r._23(-1,null,["\n                        "])),(t()(),r.Y(16777216,null,null,1,null,id)),r._2(14,16384,null,0,K,[r.M,r.J],{ngIf:[0,"ngIf"]},null),(t()(),r._23(-1,null,["                       \n                        "])),(t()(),r.Y(16777216,null,null,1,null,od)),r._2(17,16384,null,0,K,[r.M,r.J],{ngIf:[0,"ngIf"]},null),(t()(),r._23(-1,null,["                       \n                        "])),(t()(),r._3(19,0,null,null,1,"p",[["class","video-item-title"]],null,null,null,null,null)),(t()(),r._23(20,null,["",""])),(t()(),r._23(-1,null,["\n                        "])),(t()(),r._3(22,0,null,null,3,"p",[["class","video-item-autor"]],null,null,null,null,null)),(t()(),r._23(-1,null,["by "])),(t()(),r._3(24,0,null,null,1,"span",[],null,null,null,null,null)),(t()(),r._23(25,null,["",""])),(t()(),r._23(-1,null,["\n                      "])),(t()(),r._23(-1,null,["\n                    "])),(t()(),r._23(-1,null,["\n                    "])),(t()(),r._3(29,0,null,null,21,"div",[["class","video-item-settings"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n                      "])),(t()(),r._3(31,0,null,null,4,"button",[["class","video-item-play"]],null,[[null,"click"]],function(t,e,n){var r=!0;return"click"===e&&(r=!1!==t.component.onClickPlaylist(n,t.context.index)&&r),r},null,null)),(t()(),r._23(-1,null,["\n                        "])),(t()(),r._3(33,0,null,null,1,"span",[["class","fa "]],null,null,null,null,null)),r._2(34,278528,null,0,U,[r.q,r.r,r.k,r.B],{klass:[0,"klass"],ngClass:[1,"ngClass"]},null),(t()(),r._23(-1,null,["\n                      "])),(t()(),r._23(-1,null,["\n                      "])),(t()(),r.Y(16777216,null,null,1,null,sd)),r._2(38,16384,null,0,K,[r.M,r.J],{ngIf:[0,"ngIf"]},null),(t()(),r._23(-1,null,["   \n                      "])),(t()(),r._3(40,0,null,null,3,"button",[["class","video-item-share"]],null,[[null,"click"]],function(t,e,n){var r=!0;return"click"===e&&(r=!1!==t.component.onCopyVideoItemLink(t.context.index,3)&&r),r},null,null)),(t()(),r._23(-1,null,["\n                        "])),(t()(),r._3(42,0,null,null,0,"span",[["class","fa fa-share-alt"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n                      "])),(t()(),r._23(-1,null,["                      \n                      "])),(t()(),r.Y(16777216,null,null,1,null,ad)),r._2(46,16384,null,0,K,[r.M,r.J],{ngIf:[0,"ngIf"]},null),(t()(),r._23(-1,null,["                                              \n                      "])),(t()(),r.Y(16777216,null,null,1,null,ud)),r._2(49,16384,null,0,K,[r.M,r.J],{ngIf:[0,"ngIf"]},null),(t()(),r._23(-1,null,["\n                    "])),(t()(),r._23(-1,null,["\n                  "]))],function(t,e){var n=e.component;t(e,1,0,"video-item",n.currentPlaylistItem===e.context.index?"active":""),t(e,6,0,n.thumbnails),t(e,11,0,n.currentPlaylistItem===e.context.index&&1===n.currentState),t(e,14,0,n.currentPlaylistItem===e.context.index&&1!==n.currentState&&-1!==n.currentState),t(e,17,0,n.currentPlaylistItem===e.context.index&&-1===n.currentState),t(e,34,0,"fa ",n.currentPlaylistItem===e.context.index&&1===n.currentState?"fa-pause":"fa-play"),t(e,38,0,n.allowHqFeedback),t(e,46,0,n.allowHqFeedback),t(e,49,0,n.isAdmin)},function(t,e){t(e,0,0,e.context.index),t(e,20,0,e.context.$implicit.snippet.title),t(e,25,0,e.context.$implicit.snippet.channelTitle)})}function cd(t){return r._25(0,[(t()(),r._3(0,0,null,null,6,"div",[["id","youtube-player"]],null,null,null,null,null)),r._2(1,278528,null,0,U,[r.q,r.r,r.k,r.B],{ngClass:[0,"ngClass"]},null),r._17(2,{active:0}),(t()(),r._23(-1,null,["\n                "])),(t()(),r._3(4,0,null,null,1,"youtube-player",[],null,[[null,"ready"],[null,"change"]],function(t,e,n){var r=!0,i=t.component;return"ready"===e&&(r=!1!==i.savePlayer(n)&&r),"change"===e&&(r=!1!==i.onStateChange(n)&&r),r},Uc,Lc)),r._2(5,1097728,null,0,Fc,[Vc,r.k,r.B],{videoId:[0,"videoId"],playerVars:[1,"playerVars"]},{ready:"ready",change:"change"}),(t()(),r._23(-1,null,["\n              "]))],function(t,e){var n=e.component;t(e,1,0,t(e,2,0,n.displayVideoPlayer)),t(e,5,0,n.currentVideo.id,n.playerVars())},null)}function hd(t){return r._25(0,[(t()(),r._3(0,0,null,null,49,"div",[["id","player-controls"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n                    "])),(t()(),r._3(2,0,null,null,11,"div",[["class","player-buttons"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n                        "])),(t()(),r._3(4,0,null,null,1,"button",[["id","previous-song"]],null,[[null,"click"]],function(t,e,n){var r=!0,i=t.component;return"click"===e&&(r=!1!==i.playPlaylistItem("prev",i.currentPlaylistItem)&&r),r},null,null)),(t()(),r._3(5,0,null,null,0,"span",[["class","fa fa-backward"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n                        "])),(t()(),r._3(7,0,null,null,2,"button",[["id","play-song"]],null,[[null,"click"]],function(t,e,n){var r=!0;return"click"===e&&(r=!1!==t.component.playPauseVideo()&&r),r},null,null)),(t()(),r._3(8,0,null,null,1,"span",[["class","fa"]],null,null,null,null,null)),r._2(9,278528,null,0,U,[r.q,r.r,r.k,r.B],{klass:[0,"klass"],ngClass:[1,"ngClass"]},null),(t()(),r._23(-1,null,["\n                        "])),(t()(),r._3(11,0,null,null,1,"button",[["id","next-song"]],null,[[null,"click"]],function(t,e,n){var r=!0,i=t.component;return"click"===e&&(r=!1!==i.playPlaylistItem("next",i.currentPlaylistItem)&&r),r},null,null)),(t()(),r._3(12,0,null,null,0,"span",[["class","fa fa-forward"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n                    "])),(t()(),r._23(-1,null,["\n                    "])),(t()(),r._3(15,0,null,null,17,"div",[["class","current-video-range"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n                      "])),(t()(),r._3(17,0,null,null,8,"div",[["class","duration-range-container"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n                        "])),(t()(),r._3(19,0,[["videoRange",1]],null,1,"input",[["class","player-range"],["id","youtube-player-range"],["min","0"],["type","range"]],[[8,"value",0],[8,"max",0],[8,"disabled",0]],[[null,"mousedown"],[null,"mousemove"],[null,"mouseup"]],function(t,e,n){var i=!0,o=t.component;return"mousedown"===e&&(i=!1!==o.RangeNouseDown()&&i),"mousemove"===e&&(i=!1!==o.RangeMouseMove(r._14(t,19).value)&&i),"mouseup"===e&&(i=!1!==o.RangeMouseUp(r._14(t,19).value)&&i),i},null,null)),r._2(20,278528,null,0,U,[r.q,r.r,r.k,r.B],{klass:[0,"klass"],ngClass:[1,"ngClass"]},null),(t()(),r._23(-1,null,["\n                        "])),(t()(),r._3(22,0,null,null,2,"span",[["class","duration-input-shadow"]],null,null,null,null,null)),r._2(23,278528,null,0,Q,[r.r,r.k,r.B],{ngStyle:[0,"ngStyle"]},null),r._17(24,{width:0}),(t()(),r._23(-1,null,["\n                      "])),(t()(),r._23(-1,null,["\n                      "])),(t()(),r._3(27,0,null,null,1,"p",[["class","current-video-range-value"]],null,null,null,null,null)),(t()(),r._23(28,null,["",""])),(t()(),r._23(-1,null,["\n                      "])),(t()(),r._3(30,0,null,null,1,"p",[["class","current-video-range-max-value"]],null,null,null,null,null)),(t()(),r._23(31,null,["",""])),(t()(),r._23(-1,null,["\n                    "])),(t()(),r._23(-1,null,["\n                    "])),(t()(),r._3(34,0,null,null,14,"div",[["class","volume-range-value"]],null,null,null,null,null)),r._2(35,278528,null,0,U,[r.q,r.r,r.k,r.B],{klass:[0,"klass"],ngClass:[1,"ngClass"]},null),(t()(),r._23(-1,null,["\n                      "])),(t()(),r._3(37,0,null,null,1,"span",[["class","fa"]],null,[[null,"click"]],function(t,e,n){var r=!0;return"click"===e&&(r=!1!==t.component.toggleHeadSettings(2)&&r),r},null,null)),r._2(38,278528,null,0,U,[r.q,r.r,r.k,r.B],{klass:[0,"klass"],ngClass:[1,"ngClass"]},null),(t()(),r._23(-1,null,["\n                      "])),(t()(),r._3(40,0,null,null,7,"div",[["class","volume-input-container"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n                        "])),(t()(),r._3(42,0,[["volumeRange",1]],null,0,"input",[["class","volume-input"],["id","youtube-volume-range"],["max","100"],["min","0"],["type","range"]],[[8,"value",0]],[[null,"mousemove"],[null,"mouseup"]],function(t,e,n){var i=!0,o=t.component;return"mousemove"===e&&(i=!1!==o.volumeRangeMouseMove(r._14(t,42).value)&&i),"mouseup"===e&&(i=!1!==o.volumeRangeMouseUp(r._14(t,42).value)&&i),i},null,null)),(t()(),r._23(-1,null,["\n                        "])),(t()(),r._3(44,0,null,null,2,"span",[["class","volume-input-shadow"]],[[4,"width",null]],null,null,null,null)),r._2(45,278528,null,0,U,[r.q,r.r,r.k,r.B],{klass:[0,"klass"],ngClass:[1,"ngClass"]},null),r._17(46,{inactive:0}),(t()(),r._23(-1,null,["\n                      "])),(t()(),r._23(-1,null,["\n                    "])),(t()(),r._23(-1,null,["\n                  "]))],function(t,e){var n=e.component;t(e,9,0,"fa",1===n.currentState?"fa-pause":"fa-play"),t(e,20,0,"player-range",n.videoMaxRange<=0?"inactive":"active"),t(e,23,0,t(e,24,0,n.videoRangePercent+"%")),t(e,35,0,"volume-range-value",n.videoCurVolume<=0?"inactive":"active"),t(e,38,0,"fa",n.currentMuteState?"fa-volume-off":"fa-volume-up"),t(e,45,0,"volume-input-shadow",t(e,46,0,n.currentMuteState))},function(t,e){var n=e.component;t(e,19,0,n.videoCurRange,r._6(1,"",n.videoMaxRange,""),-1===n.currentState),t(e,28,0,n.videoCurFull),t(e,31,0,n.videoMaxFull),t(e,42,0,n.videoCurVolume),t(e,44,0,r._14(e,42).value+"%")})}function fd(t){return r._25(0,[(t()(),r._3(0,0,null,null,35,"div",[["class","current-video-all"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n                  "])),(t()(),r._3(2,0,null,null,4,"div",[["class","current-video-details"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n                    "])),(t()(),r._3(4,0,null,null,1,"p",[["class","current-video-name"]],null,null,null,null,null)),(t()(),r._23(5,null,["",""])),(t()(),r._23(-1,null,["\n                  "])),(t()(),r._23(-1,null,["\n                  "])),(t()(),r.Y(16777216,null,null,1,null,hd)),r._2(9,16384,null,0,K,[r.M,r.J],{ngIf:[0,"ngIf"]},null),(t()(),r._23(-1,null,["\n                  "])),(t()(),r._3(11,0,null,null,15,"div",[["class","current-video-stats"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n                      "])),(t()(),r._3(13,0,null,null,2,"p",[["class","stats-views"]],null,null,null,null,null)),(t()(),r._23(14,null,[""," Views"])),r._18(15,2),(t()(),r._23(-1,null,["\n                      "])),(t()(),r._3(17,0,null,null,3,"p",[["class","stats-likes"]],null,null,null,null,null)),(t()(),r._3(18,0,null,null,0,"span",[["class","fa fa-thumbs-up"]],null,null,null,null,null)),(t()(),r._23(19,null,[" ",""])),r._18(20,2),(t()(),r._23(-1,null,["\n                      "])),(t()(),r._3(22,0,null,null,3,"p",[["class","stats-dislikes"]],null,null,null,null,null)),(t()(),r._3(23,0,null,null,0,"span",[["class","fa fa-thumbs-down"]],null,null,null,null,null)),(t()(),r._23(24,null,[" ",""])),r._18(25,2),(t()(),r._23(-1,null,["\n                  "])),(t()(),r._23(-1,null,["\n                  "])),(t()(),r._3(28,0,null,null,6,"div",[["class","current-video-share"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n                    "])),(t()(),r._3(30,0,null,null,1,"label",[["for","shareInput"]],null,null,null,null,null)),(t()(),r._23(-1,null,["Share link"])),(t()(),r._23(-1,null,["\n                    "])),(t()(),r._3(33,0,[["shareInput",1]],null,0,"input",[["id","shareInput"],["name","current video share"],["readonly",""],["type","text"]],[[8,"value",0]],[[null,"click"]],function(t,e,n){var i=!0;return"click"===e&&(i=!1!==t.component.copyShareLink(r._14(t,33).select())&&i),i},null,null)),(t()(),r._23(-1,null,["\n                  "])),(t()(),r._23(-1,null,["\n              "]))],function(t,e){t(e,9,0,!e.component.displayVideoPlayer)},function(t,e){var n=e.component;t(e,5,0,n.currentVideo.title),t(e,14,0,r._24(e,14,0,t(e,15,0,r._14(e.parent.parent.parent,0),n.currentVideo.stats.views,"1.0"))),t(e,19,0,r._24(e,19,0,t(e,20,0,r._14(e.parent.parent.parent,0),n.currentVideo.stats.likes,"1.0"))),t(e,24,0,r._24(e,24,0,t(e,25,0,r._14(e.parent.parent.parent,0),n.currentVideo.stats.dislikes,"1.0"))),t(e,33,0,n.shareLink)})}function pd(t){return r._25(0,[(t()(),r._3(0,0,null,null,2,"div",[["class","video-item-image"]],null,null,null,null,null)),r._2(1,278528,null,0,Q,[r.r,r.k,r.B],{ngStyle:[0,"ngStyle"]},null),r._17(2,{"background-image":0})],function(t,e){t(e,1,0,t(e,2,0,"url("+e.parent.context.$implicit.snippet.thumbnails.default.url+")"))},null)}function dd(t){return r._25(0,[(t()(),r._3(0,0,null,null,36,"div",[["class","video-item"]],[[1,"data-index",0]],null,null,null,null)),(t()(),r._23(-1,null,["\n                    "])),(t()(),r._3(2,0,null,null,15,"div",[["class","video-item-info"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n                      "])),(t()(),r.Y(16777216,null,null,1,null,pd)),r._2(5,16384,null,0,K,[r.M,r.J],{ngIf:[0,"ngIf"]},null),(t()(),r._23(-1,null,["\n                      "])),(t()(),r._3(7,0,null,null,9,"div",[["class","video-item-content"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n                        "])),(t()(),r._3(9,0,null,null,1,"p",[["class","video-item-title"]],null,null,null,null,null)),(t()(),r._23(10,null,["",""])),(t()(),r._23(-1,null,["\n                        "])),(t()(),r._3(12,0,null,null,3,"p",[["class","video-item-autor"]],null,null,null,null,null)),(t()(),r._23(-1,null,["by "])),(t()(),r._3(14,0,null,null,1,"span",[],null,null,null,null,null)),(t()(),r._23(15,null,["",""])),(t()(),r._23(-1,null,["                      \n                      "])),(t()(),r._23(-1,null,["\n                    "])),(t()(),r._23(-1,null,["\n                    "])),(t()(),r._3(19,0,null,null,16,"div",[["class","video-item-settings"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n                      "])),(t()(),r._3(21,0,null,null,3,"button",[["class","video-item-play"]],null,[[null,"click"]],function(t,e,n){var r=!0;return"click"===e&&(r=!1!==t.component.onClickRelated(n,t.context.index)&&r),r},null,null)),(t()(),r._23(-1,null,["\n                        "])),(t()(),r._3(23,0,null,null,0,"span",[["class","fa fa-play"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n                      "])),(t()(),r._23(-1,null,["\n                      "])),(t()(),r._3(26,0,null,null,3,"button",[["class","video-item-share"]],null,[[null,"click"]],function(t,e,n){var r=!0;return"click"===e&&(r=!1!==t.component.onCopyVideoItemLink(t.context.index,2)&&r),r},null,null)),(t()(),r._23(-1,null,["\n                        "])),(t()(),r._3(28,0,null,null,0,"span",[["class","fa fa-share-alt"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n                      "])),(t()(),r._23(-1,null,["\n                      "])),(t()(),r._3(31,0,null,null,3,"button",[["class","video-item-add"]],null,[[null,"click"]],function(t,e,n){var r=!0;return"click"===e&&(r=!1!==t.component.addPlaylistItem(t.context.index,2)&&r),r},null,null)),(t()(),r._23(-1,null,["\n                        "])),(t()(),r._3(33,0,null,null,0,"span",[["class","fa fa-plus"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n                      "])),(t()(),r._23(-1,null,["\n                    "])),(t()(),r._23(-1,null,["\n                  "]))],function(t,e){t(e,5,0,e.component.thumbnails)},function(t,e){t(e,0,0,e.context.index),t(e,10,0,e.context.$implicit.snippet.title),t(e,15,0,e.context.$implicit.snippet.channelTitle)})}function yd(t){return r._25(0,[(t()(),r._3(0,0,null,null,40,"div",[["class","col col-2"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n        "])),(t()(),r._3(2,0,null,null,37,"div",[["class","app app-player"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n            "])),(t()(),r._3(4,0,null,null,11,"div",[["class","app-head"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n                "])),(t()(),r._3(6,0,null,null,1,"h2",[],null,null,null,null,null)),(t()(),r._23(7,null,["",""])),(t()(),r._23(-1,null,["\n                "])),(t()(),r._3(9,0,null,null,5,"div",[["class","settings"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n                    "])),(t()(),r._3(11,0,null,null,2,"p",[],null,[[null,"click"]],function(t,e,n){var r=!0;return"click"===e&&(r=!1!==t.component.toggleFullscreenVideo()&&r),r},null,null)),(t()(),r._3(12,0,null,null,0,"span",[["class","fa fa-expand"]],null,null,null,null,null)),(t()(),r._23(-1,null,[" iFullscreen"])),(t()(),r._23(-1,null,["\n                "])),(t()(),r._23(-1,null,["\n            "])),(t()(),r._23(-1,null,["\n            "])),(t()(),r._3(17,0,null,null,21,"div",[["class","app-content"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n              "])),(t()(),r.Y(16777216,null,null,1,null,cd)),r._2(20,16384,null,0,K,[r.M,r.J],{ngIf:[0,"ngIf"]},null),(t()(),r._23(-1,null,["\n              "])),(t()(),r.Y(16777216,null,null,1,null,fd)),r._2(23,16384,null,0,K,[r.M,r.J],{ngIf:[0,"ngIf"]},null),(t()(),r._23(-1,null,["\n              "])),(t()(),r._3(25,0,null,null,12,"div",[["class","video-list"],["id","related-video-list"]],null,null,null,null,null)),r._2(26,278528,null,0,U,[r.q,r.r,r.k,r.B],{klass:[0,"klass"],ngClass:[1,"ngClass"]},null),r._17(27,{activePlayer:0}),(t()(),r._23(-1,null,["\n                "])),(t()(),r._3(29,0,null,null,1,"div",[["class","video-item-head"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n                    Similar videos\n                "])),(t()(),r._23(-1,null,["\n                "])),(t()(),r._3(32,0,null,null,4,"div",[["class","related-video-content"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n                  "])),(t()(),r.Y(16777216,null,null,1,null,dd)),r._2(35,802816,null,0,q,[r.M,r.J,r.q],{ngForOf:[0,"ngForOf"]},null),(t()(),r._23(-1,null,["\n                "])),(t()(),r._23(-1,null,["\n              "])),(t()(),r._23(-1,null,["\n            "])),(t()(),r._23(-1,null,["\n        "])),(t()(),r._23(-1,null,["\n    "]))],function(t,e){var n=e.component;t(e,20,0,n.feedVideos),t(e,23,0,n.currentVideo.id),t(e,26,0,"video-list",t(e,27,0,n.displayVideoPlayer)),t(e,35,0,n.relatedVideos)},function(t,e){t(e,7,0,e.component.AppTitle)})}function md(t){return r._25(0,[(t()(),r._3(0,0,null,null,26,"div",[["class","modal-container"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n      "])),(t()(),r._3(2,0,null,null,1,"h2",[],null,null,null,null,null)),(t()(),r._23(-1,null,["Do you want to remove this item from playlist?"])),(t()(),r._23(-1,null,["\n      "])),(t()(),r._3(5,0,null,null,6,"div",[["class","modal-content"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n        "])),(t()(),r._3(7,0,null,null,0,"img",[],[[8,"src",4],[8,"alt",0]],null,null,null,null)),(t()(),r._23(-1,null,["\n        "])),(t()(),r._3(9,0,null,null,1,"p",[],null,null,null,null,null)),(t()(),r._23(10,null,["",""])),(t()(),r._23(-1,null,["\n      "])),(t()(),r._23(-1,null,["\n      "])),(t()(),r._3(13,0,null,null,3,"button",[["class","modal-close"]],null,[[null,"click"]],function(t,e,n){var r=!0;return"click"===e&&(r=!1!==t.component.closeModal()&&r),r},null,null)),(t()(),r._23(-1,null,["\n        "])),(t()(),r._3(15,0,null,null,0,"span",[["class","fa fa-times"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n      "])),(t()(),r._23(-1,null,["\n      "])),(t()(),r._3(18,0,null,null,7,"div",[["class","modal-buttons"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n        "])),(t()(),r._3(20,0,null,null,1,"button",[["class","btn btn-primary"],["type","button"]],null,[[null,"click"]],function(t,e,n){var r=!0;return"click"===e&&(r=!1!==t.component.confirmModal()&&r),r},null,null)),(t()(),r._23(-1,null,["Confirm"])),(t()(),r._23(-1,null,["        \n        "])),(t()(),r._3(23,0,null,null,1,"button",[["class","btn btn-link"],["type","button"]],null,[[null,"click"]],function(t,e,n){var r=!0;return"click"===e&&(r=!1!==t.component.closeModal()&&r),r},null,null)),(t()(),r._23(-1,null,["Cancel"])),(t()(),r._23(-1,null,["        \n      "])),(t()(),r._23(-1,null,["\n    "]))],null,function(t,e){var n=e.component;t(e,7,0,r._6(1,"",n.playlistVideos[n.modalPlaylistItem].snippet.thumbnails.medium.url,""),r._6(1,"",n.playlistVideos[n.modalPlaylistItem].snippet.title,"")),t(e,10,0,n.playlistVideos[n.modalPlaylistItem].snippet.title)})}function gd(t){return r._25(0,[(t()(),r._3(0,0,null,null,24,"div",[["class","modal-container"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n      "])),(t()(),r._3(2,0,null,null,1,"h2",[],null,null,null,null,null)),(t()(),r._23(-1,null,["Manage playlist"])),(t()(),r._23(-1,null,["\n      "])),(t()(),r._3(5,0,null,null,4,"div",[["class","modal-content"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n        "])),(t()(),r._3(7,0,null,null,1,"textarea",[["class","export-playlist"],["readonly",""]],[[8,"value",0]],null,null,null,null)),r._16(0,Y,[]),(t()(),r._23(-1,null,["\n      "])),(t()(),r._23(-1,null,["\n      "])),(t()(),r._3(11,0,null,null,3,"button",[["class","modal-close"]],null,[[null,"click"]],function(t,e,n){var r=!0;return"click"===e&&(r=!1!==t.component.closeModal()&&r),r},null,null)),(t()(),r._23(-1,null,["\n        "])),(t()(),r._3(13,0,null,null,0,"span",[["class","fa fa-times"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n      "])),(t()(),r._23(-1,null,["\n      "])),(t()(),r._3(16,0,null,null,7,"div",[["class","modal-buttons"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n        "])),(t()(),r._3(18,0,null,null,1,"button",[["class","btn btn-primary"],["type","button"]],null,[[null,"click"]],function(t,e,n){var r=!0;return"click"===e&&(r=!1!==t.component.exportFilePlaylist()&&r),r},null,null)),(t()(),r._23(-1,null,["Export playlist"])),(t()(),r._23(-1,null,["        \n        "])),(t()(),r._3(21,0,null,null,1,"button",[["class","btn btn-link"],["type","button"]],null,[[null,"click"]],function(t,e,n){var r=!0;return"click"===e&&(r=!1!==t.component.closeModal()&&r),r},null,null)),(t()(),r._23(-1,null,["Cancel"])),(t()(),r._23(-1,null,["        \n      "])),(t()(),r._23(-1,null,["\n    "]))],null,function(t,e){var n=e.component;t(e,7,0,r._24(e,7,0,r._14(e,8).transform(n.playlistVideos)))})}function vd(t){return r._25(0,[(t()(),r._3(0,0,null,null,1,"span",[],null,null,null,null,null)),(t()(),r._23(-1,null,["smartphone"]))],null,null)}function _d(t){return r._25(0,[(t()(),r._3(0,0,null,null,1,"span",[],null,null,null,null,null)),(t()(),r._23(-1,null,["TV-connected PC"]))],null,null)}function bd(t){return r._25(0,[(t()(),r._3(0,0,null,null,1,"p",[],null,null,null,null,null)),(t()(),r._23(-1,null,["Feel free to share this link to your friends all around the world who wish to join your karaoke party!"]))],null,null)}function wd(t){return r._25(0,[(t()(),r._3(0,0,null,null,4,"p",[],null,null,null,null,null)),(t()(),r._23(-1,null,["We highly recommend connecting this PC/Laptop to a big screen TV. Click this "])),(t()(),r._3(2,0,null,null,1,"a",[["href","https://www.wikihow.com/Connect-PC-to-TV"],["target","_blank"]],null,null,null,null,null)),(t()(),r._23(-1,null,["link"])),(t()(),r._23(-1,null,[" to learn how."]))],null,null)}function Ed(t){return r._25(0,[(t()(),r._3(0,0,null,null,1,"span",[],null,null,null,null,null)),(t()(),r._23(-1,null,["on your PC"]))],null,null)}function Sd(t){return r._25(0,[(t()(),r._3(0,0,null,null,68,"div",[["class","modal-overlay"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n    "])),(t()(),r._3(2,0,null,null,0,"div",[["class","modal-background-overlay"]],null,[[null,"click"]],function(t,e,n){var r=!0;return"click"===e&&(r=!1!==t.component.closeModal()&&r),r},null,null)),(t()(),r._23(-1,null,["\n    "])),(t()(),r.Y(16777216,null,null,1,null,md)),r._2(5,16384,null,0,K,[r.M,r.J],{ngIf:[0,"ngIf"]},null),(t()(),r._23(-1,null,["\n    "])),(t()(),r.Y(16777216,null,null,1,null,gd)),r._2(8,16384,null,0,K,[r.M,r.J],{ngIf:[0,"ngIf"]},null),(t()(),r._23(-1,null,["\n    "])),(t()(),r._3(10,0,null,null,57,"div",[["class","modal-container"]],null,null,null,null,null)),(t()(),r._23(-1,null,["      \n      "])),(t()(),r._23(-1,null,["\n      "])),(t()(),r._3(13,0,null,null,47,"div",[["class","modal-content"]],null,null,null,null,null)),(t()(),r._23(-1,null,["     \n          "])),(t()(),r._23(-1,null,["      \n        "])),(t()(),r._3(16,0,null,null,43,"div",[["class","modal-content"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n          "])),(t()(),r._3(18,0,null,null,1,"h2",[],null,null,null,null,null)),(t()(),r._23(-1,null,["YoutubeK Basic Usage"])),(t()(),r._23(-1,null,["   \n          "])),(t()(),r._3(21,0,null,null,16,"p",[],null,null,null,null,null)),(t()(),r._23(-1,null,["On your "])),(t()(),r.Y(16777216,null,null,1,null,vd)),r._2(24,16384,null,0,K,[r.M,r.J],{ngIf:[0,"ngIf"]},null),(t()(),r.Y(16777216,null,null,1,null,_d)),r._2(26,16384,null,0,K,[r.M,r.J],{ngIf:[0,"ngIf"]},null),(t()(),r._23(-1,null,[", logon to "])),(t()(),r._3(28,0,null,null,0,"br",[],null,null,null,null,null)),(t()(),r._23(-1,null,["            \n            "])),(t()(),r._3(30,0,null,null,6,"strong",[],null,null,null,null,null)),(t()(),r._23(-1,null,["\n                "])),(t()(),r._3(32,0,null,null,3,"div",[["class","current-video-share"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n                    "])),(t()(),r._3(34,0,[["shareInput",1]],null,0,"input",[["readonly",""],["type","text"]],[[8,"value",0]],[[null,"click"]],function(t,e,n){var i=!0;return"click"===e&&(i=!1!==t.component.copyShareLink(r._14(t,34).select())&&i),i},null,null)),(t()(),r._23(-1,null,["\n                  "])),(t()(),r._23(-1,null,["\n            "])),(t()(),r._23(-1,null,["\n          "])),(t()(),r._23(-1,null,["\n          "])),(t()(),r.Y(16777216,null,null,1,null,bd)),r._2(40,16384,null,0,K,[r.M,r.J],{ngIf:[0,"ngIf"]},null),(t()(),r._23(-1,null,["\n          "])),(t()(),r.Y(16777216,null,null,1,null,wd)),r._2(43,16384,null,0,K,[r.M,r.J],{ngIf:[0,"ngIf"]},null),(t()(),r._23(-1,null,["\n          "])),(t()(),r._3(45,0,null,null,0,"img",[["alt","Connect PC/Laptop to TV"],["src","http://youtubek.azurewebsites.net/app/assets/img/pc2tv.gif"]],null,null,null,null,null)),(t()(),r._23(-1,null,["          \n          "])),(t()(),r._3(47,0,null,null,11,"p",[],null,null,null,null,null)),(t()(),r._23(-1,null,["For a smooth ad-banner-free karaoke experience, "])),(t()(),r.Y(16777216,null,null,1,null,Ed)),r._2(50,16384,null,0,K,[r.M,r.J],{ngIf:[0,"ngIf"]},null),(t()(),r._23(-1,null,[" install \n            "])),(t()(),r._3(52,0,null,null,5,"a",[["href","https://chrome.google.com/webstore/detail/adblock-for-youtube/cmedhionkhpnakcndndgjdbohmhepckk"]],null,null,null,null,null)),(t()(),r._3(53,0,null,null,1,"strong",[],null,null,null,null,null)),(t()(),r._23(-1,null,["Adblock for Chrome"])),(t()(),r._23(-1,null,["\xa0 \n                "])),(t()(),r._3(56,0,null,null,0,"img",[["alt","Extension"],["aria-label","Extension"],["src","https://lh3.googleusercontent.com/wHakeb5_9Tt5ymF5T3l3waztfFZKnwg6DNLT3kxH75vkmSal6jBPK9_E0WdXyABvdMGIa6oo_w=w26-h26-e365"],["style"," width:26px; height:26px;"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n            "])),(t()(),r._23(-1,null,["\n          "])),(t()(),r._23(-1,null,["\n        "])),(t()(),r._23(-1,null,["\n      "])),(t()(),r._23(-1,null,["\n      "])),(t()(),r._3(62,0,null,null,4,"div",[["class","modal-buttons"]],null,null,null,null,null)),(t()(),r._23(-1,null,["       \n        "])),(t()(),r._3(64,0,null,null,1,"button",[["class","btn btn-primary"],["type","button"]],null,[[null,"click"]],function(t,e,n){var r=!0;return"click"===e&&(r=!1!==t.component.closeUsageModal()&&r),r},null,null)),(t()(),r._23(-1,null,["Got it!"])),(t()(),r._23(-1,null,["        \n      "])),(t()(),r._23(-1,null,["\n    "])),(t()(),r._23(-1,null,["    \n  "]))],function(t,e){var n=e.component;t(e,5,0,n.modalPlaylist),t(e,8,0,n.modalExportPlaylist),t(e,24,0,n.UsageModalDesktop),t(e,26,0,n.UsageModalMobile),t(e,40,0,n.UsageModalMobile),t(e,43,0,n.UsageModalDesktop),t(e,50,0,n.UsageModalMobile)},function(t,e){t(e,34,0,r._6(1,"bernardgabon.com/youtubek/",e.component.roomId,""))})}function Cd(t){return r._25(0,[(t()(),r._3(0,0,null,null,129,"div",[["id","app-container"]],null,null,null,null,null)),r._2(1,278528,null,0,U,[r.q,r.r,r.k,r.B],{ngClass:[0,"ngClass"]},null),r._17(2,{"light-mode":0,"menu-active":1}),(t()(),r._23(-1,null,["   \n  "])),(t()(),r._3(4,0,null,null,0,"div",[["class","loading-bar inactive"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n  "])),(t()(),r._3(6,0,[[2,0],["videoItemIDvalue",1]],null,0,"input",[["class","hide-input"],["type","text"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n  "])),(t()(),r._3(8,0,null,null,116,"div",[["class","container"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n    "])),(t()(),r._3(10,0,null,null,91,"div",[["class","col col-1"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n        "])),(t()(),r._3(12,0,null,null,88,"div",[["class","app app-services"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n            "])),(t()(),r._3(14,0,null,null,10,"div",[["class","app-head"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n                "])),(t()(),r._3(16,0,null,null,7,"div",[["id","logo"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n                  "])),(t()(),r._3(18,0,null,null,1,"a",[["class","logo-svg"],["routerLink","/home"],["title","YoutubeK"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(t,e,n){var i=!0;return"click"===e&&(i=!1!==r._14(t,19).onClick(n.button,n.ctrlKey,n.metaKey,n.shiftKey)&&i),i},null,null)),r._2(19,671744,null,0,yp,[fp,kf,C],{routerLink:[0,"routerLink"]},null),(t()(),r._23(-1,null,["\n                  "])),(t()(),r.Y(16777216,null,null,1,null,Kp)),r._2(22,16384,null,0,K,[r.M,r.J],{ngIf:[0,"ngIf"]},null),(t()(),r._23(-1,null,["\n                "])),(t()(),r._23(-1,null,["\n            "])),(t()(),r._23(-1,null,["\n            "])),(t()(),r._3(26,0,null,null,73,"div",[["class","app-content"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n              "])),(t()(),r._3(28,0,null,null,48,"nav",[],null,null,null,null,null)),(t()(),r._23(-1,null,["\n                "])),(t()(),r._3(30,0,null,null,45,"ul",[],null,null,null,null,null)),(t()(),r._23(-1,null,["\n                  "])),(t()(),r._3(32,0,null,null,9,"li",[],null,null,null,null,null)),(t()(),r._3(33,0,null,null,8,"a",[["routerLink","/home"],["routerLinkActive","is-active"],["title","Homepage"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(t,e,n){var i=!0,o=t.component;return"click"===e&&(i=!1!==r._14(t,34).onClick(n.button,n.ctrlKey,n.metaKey,n.shiftKey)&&i),"click"===e&&(i=!1!==o.openMobileMenu()&&i),i},null,null)),r._2(34,671744,[[4,4]],0,yp,[fp,kf,C],{routerLink:[0,"routerLink"]},null),r._2(35,1720320,null,2,gp,[fp,r.k,r.B,r.h],{routerLinkActive:[0,"routerLinkActive"]},null),r._21(603979776,3,{links:1}),r._21(603979776,4,{linksWithHrefs:1}),(t()(),r._3(38,0,null,null,0,"span",[["class","fa fa-home"]],null,null,null,null,null)),(t()(),r._23(-1,null,["Home"])),(t()(),r._3(40,0,null,null,1,"span",[["class","description"]],null,null,null,null,null)),(t()(),r._23(-1,null,["Trending karaoke hits and search"])),(t()(),r._23(-1,null,["\n                  "])),(t()(),r._3(43,0,null,null,9,"li",[],null,null,null,null,null)),(t()(),r._3(44,0,null,null,8,"a",[["routerLink","/history"],["routerLinkActive","is-active"],["title","History page"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(t,e,n){var i=!0,o=t.component;return"click"===e&&(i=!1!==r._14(t,45).onClick(n.button,n.ctrlKey,n.metaKey,n.shiftKey)&&i),"click"===e&&(i=!1!==o.openMobileMenu()&&i),i},null,null)),r._2(45,671744,[[6,4]],0,yp,[fp,kf,C],{routerLink:[0,"routerLink"]},null),r._2(46,1720320,null,2,gp,[fp,r.k,r.B,r.h],{routerLinkActive:[0,"routerLinkActive"]},null),r._21(603979776,5,{links:1}),r._21(603979776,6,{linksWithHrefs:1}),(t()(),r._3(49,0,null,null,0,"span",[["class","fa fa-history"]],null,null,null,null,null)),(t()(),r._23(-1,null,["History"])),(t()(),r._3(51,0,null,null,1,"span",[["class","description"]],null,null,null,null,null)),(t()(),r._23(-1,null,["Recently played"])),(t()(),r._23(-1,null,["\n                  "])),(t()(),r._3(54,0,null,null,9,"li",[],null,null,null,null,null)),(t()(),r._3(55,0,null,null,8,"a",[["routerLink","/about"],["routerLinkActive","is-active"],["title","About application page"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(t,e,n){var i=!0,o=t.component;return"click"===e&&(i=!1!==r._14(t,56).onClick(n.button,n.ctrlKey,n.metaKey,n.shiftKey)&&i),"click"===e&&(i=!1!==o.openMobileMenu()&&i),i},null,null)),r._2(56,671744,[[8,4]],0,yp,[fp,kf,C],{routerLink:[0,"routerLink"]},null),r._2(57,1720320,null,2,gp,[fp,r.k,r.B,r.h],{routerLinkActive:[0,"routerLinkActive"]},null),r._21(603979776,7,{links:1}),r._21(603979776,8,{linksWithHrefs:1}),(t()(),r._3(60,0,null,null,0,"span",[["class","fa fa-info-circle"]],null,null,null,null,null)),(t()(),r._23(-1,null,["About"])),(t()(),r._3(62,0,null,null,1,"span",[["class","description"]],null,null,null,null,null)),(t()(),r._23(-1,null,["YoutubeK and Gabs"])),(t()(),r._23(-1,null,["\n                  "])),(t()(),r._3(65,0,null,null,9,"li",[],null,null,null,null,null)),(t()(),r._3(66,0,null,null,8,"a",[["routerLink","/settings"],["routerLinkActive","is-active"],["title","Settings page"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(t,e,n){var i=!0,o=t.component;return"click"===e&&(i=!1!==r._14(t,67).onClick(n.button,n.ctrlKey,n.metaKey,n.shiftKey)&&i),"click"===e&&(i=!1!==o.openMobileMenu()&&i),i},null,null)),r._2(67,671744,[[10,4]],0,yp,[fp,kf,C],{routerLink:[0,"routerLink"]},null),r._2(68,1720320,null,2,gp,[fp,r.k,r.B,r.h],{routerLinkActive:[0,"routerLinkActive"]},null),r._21(603979776,9,{links:1}),r._21(603979776,10,{linksWithHrefs:1}),(t()(),r._3(71,0,null,null,0,"span",[["class","fa fa-gear"]],null,null,null,null,null)),(t()(),r._23(-1,null,["Settings"])),(t()(),r._3(73,0,null,null,1,"span",[["class","description"]],null,null,null,null,null)),(t()(),r._23(-1,null,["Change app settings"])),(t()(),r._23(-1,null,["\n                "])),(t()(),r._23(-1,null,["\n              "])),(t()(),r._23(-1,null,["\n              "])),(t()(),r._3(78,0,null,null,20,"div",[["class","video-list"],["id","playlist-video-list"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n                "])),(t()(),r._3(80,0,null,null,5,"div",[["class","video-item-head"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n                    Current playlist\n                    "])),(t()(),r.Y(16777216,null,null,1,null,zp)),r._2(83,16384,null,0,K,[r.M,r.J],{ngIf:[0,"ngIf"]},null),(t()(),r._23(-1,null,["\n                    "])),(t()(),r._23(-1,null,["\n                "])),(t()(),r._23(-1,null,["\n                "])),(t()(),r.Y(16777216,null,null,1,null,td)),r._2(88,16384,null,0,K,[r.M,r.J],{ngIf:[0,"ngIf"]},null),(t()(),r._23(-1,null,["\n                "])),(t()(),r._3(90,0,[[1,0],["playlistContainer",1]],null,7,"div",[["class","playlist-video-content"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n                  "])),(t()(),r.Y(16777216,null,null,1,null,ed)),r._2(93,16384,null,0,K,[r.M,r.J],{ngIf:[0,"ngIf"]},null),(t()(),r._23(-1,null,["\n                  "])),(t()(),r.Y(16777216,null,null,1,null,ld)),r._2(96,802816,null,0,q,[r.M,r.J,r.q],{ngForOf:[0,"ngForOf"]},null),(t()(),r._23(-1,null,["\n                "])),(t()(),r._23(-1,null,["\n                \n              "])),(t()(),r._23(-1,null,["\n            "])),(t()(),r._23(-1,null,["\n        "])),(t()(),r._23(-1,null,["\n    "])),(t()(),r._23(-1,null,["\n    "])),(t()(),r.Y(16777216,null,null,1,null,yd)),r._2(104,16384,null,0,K,[r.M,r.J],{ngIf:[0,"ngIf"]},null),(t()(),r._23(-1,null,["\n    "])),(t()(),r._3(106,0,null,null,17,"div",[["class","col col-3"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n        "])),(t()(),r._3(108,0,null,null,4,"div",[["class","app app-feed"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n          "])),(t()(),r._3(110,16777216,null,null,1,"router-outlet",[],null,null,null,null,null)),r._2(111,212992,null,0,bp,[_p,r.M,r.j,[8,null],r.h],null,null),(t()(),r._23(-1,null,["\n        "])),(t()(),r._23(-1,null,["\n        "])),(t()(),r._3(114,0,null,null,8,"div",[["class","notif notif-primary"]],null,null,null,null,null)),r._2(115,278528,null,0,U,[r.q,r.r,r.k,r.B],{klass:[0,"klass"],ngClass:[1,"ngClass"]},null),r._17(116,{active:0}),(t()(),r._23(-1,null,["\n          "])),(t()(),r._3(118,0,null,null,0,"span",[["class","fa fa-cog fa-spin fa-fw"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n          "])),(t()(),r._3(120,0,null,null,1,"p",[],null,null,null,null,null)),(t()(),r._23(121,null,["",""])),(t()(),r._23(-1,null,["\n        "])),(t()(),r._23(-1,null,["\n    "])),(t()(),r._23(-1,null,["\n  "])),(t()(),r._23(-1,null,["\n  "])),(t()(),r.Y(16777216,null,null,1,null,Sd)),r._2(127,16384,null,0,K,[r.M,r.J],{ngIf:[0,"ngIf"]},null),(t()(),r._23(-1,null,["\n  \n\n  "])),(t()(),r._23(-1,null,["\n"]))],function(t,e){var n=e.component;t(e,1,0,t(e,2,0,!n.darkMode,n.menuActive)),t(e,19,0,"/home"),t(e,22,0,n.regionCode),t(e,34,0,"/home"),t(e,35,0,"is-active"),t(e,45,0,"/history"),t(e,46,0,"is-active"),t(e,56,0,"/about"),t(e,57,0,"is-active"),t(e,67,0,"/settings"),t(e,68,0,"is-active"),t(e,83,0,n.isAdmin),t(e,88,0,!1),t(e,93,0,!1),t(e,96,0,n.playlistVideos),t(e,104,0,n.isDesktop),t(e,111,0),t(e,115,0,"notif notif-primary",t(e,116,0,n.notify.enabled)),t(e,127,0,n.modal)},function(t,e){var n=e.component;t(e,18,0,r._14(e,19).target,r._14(e,19).href),t(e,33,0,r._14(e,34).target,r._14(e,34).href),t(e,44,0,r._14(e,45).target,r._14(e,45).href),t(e,55,0,r._14(e,56).target,r._14(e,56).href),t(e,66,0,r._14(e,67).target,r._14(e,67).href),t(e,121,0,n.notify.message)})}function Td(t){return r._25(0,[r._16(0,J,[r.s]),r._21(671088640,1,{myScrollContainer:0}),r._21(671088640,2,{videoItemIDvalue:0}),(t()(),r.Y(16777216,null,null,1,null,Bp)),r._2(4,16384,null,0,K,[r.M,r.J],{ngIf:[0,"ngIf"]},null),(t()(),r._23(-1,null,["\n"])),(t()(),r.Y(16777216,null,null,1,null,qp)),r._2(7,16384,null,0,K,[r.M,r.J],{ngIf:[0,"ngIf"]},null),(t()(),r._23(-1,null,["  \n\n"])),(t()(),r._3(9,0,null,null,42,"header",[],null,null,null,null,null)),(t()(),r._23(-1,null,["\n  "])),(t()(),r._3(11,0,null,null,23,"div",[["class","header-bar"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n      "])),(t()(),r._3(13,0,null,null,2,"h1",[],null,null,null,null,null)),(t()(),r._3(14,0,null,null,0,"span",[["class","favicon-app"]],null,null,null,null,null)),(t()(),r._23(-1,null,["YouTube-K by Gabs"])),(t()(),r._23(-1,null,["\n      "])),(t()(),r._3(17,0,null,null,7,"div",[["class","win-controls"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n          "])),(t()(),r._3(19,0,null,null,0,"button",[["id","win-minimize"]],null,[[null,"click"]],function(t,e,n){var r=!0;return"click"===e&&(r=!1!==t.component.winMinimize()&&r),r},null,null)),(t()(),r._23(-1,null,["\n          "])),(t()(),r._3(21,0,null,null,0,"button",[["id","win-maximize"]],null,[[null,"click"]],function(t,e,n){var r=!0;return"click"===e&&(r=!1!==t.component.winMaximize()&&r),r},null,null)),(t()(),r._23(-1,null,["\n          "])),(t()(),r._3(23,0,null,null,0,"button",[["id","win-close"]],null,[[null,"click"]],function(t,e,n){var r=!0;return"click"===e&&(r=!1!==t.component.winClose()&&r),r},null,null)),(t()(),r._23(-1,null,["\n      "])),(t()(),r._23(-1,null,["\n      "])),(t()(),r._3(26,0,null,null,7,"div",[["class","linux-controls"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n          "])),(t()(),r._3(28,0,null,null,0,"button",[["id","linux-close"]],null,[[null,"click"]],function(t,e,n){var r=!0;return"click"===e&&(r=!1!==t.component.winMinimize()&&r),r},null,null)),(t()(),r._23(-1,null,["\n          "])),(t()(),r._3(30,0,null,null,0,"button",[["id","linux-minimize"]],null,[[null,"click"]],function(t,e,n){var r=!0;return"click"===e&&(r=!1!==t.component.winMaximize()&&r),r},null,null)),(t()(),r._23(-1,null,["\n          "])),(t()(),r._3(32,0,null,null,0,"button",[["id","linux-maximize"]],null,[[null,"click"]],function(t,e,n){var r=!0;return"click"===e&&(r=!1!==t.component.winClose()&&r),r},null,null)),(t()(),r._23(-1,null,["\n      "])),(t()(),r._23(-1,null,["\n  "])),(t()(),r._23(-1,null,["\n  "])),(t()(),r._3(36,0,null,null,14,"div",[["class","device-bar"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n    "])),(t()(),r._3(38,0,null,null,2,"button",[["class","trigger-nav"],["type","button"]],null,[[null,"click"]],function(t,e,n){var r=!0;return"click"===e&&(r=!1!==t.component.openMobileMenu()&&r),r},null,null)),(t()(),r._3(39,0,null,null,0,"span",[["class","fa fa-navicon"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\xa0"])),(t()(),r._23(-1,null,["\n    "])),(t()(),r._23(-1,null,["    \n    "])),(t()(),r._3(43,0,null,null,6,"div",[["id","logo"]],null,null,null,null,null)),(t()(),r._23(-1,null,["\n        "])),(t()(),r._3(45,0,null,null,0,"a",[["class","logo-svg-small"],["title","Homepage"]],null,[[null,"click"]],function(t,e,n){var r=!0;return"click"===e&&(r=!1!==t.component.openMobileMenu()&&r),r},null,null)),(t()(),r._23(-1,null,["\n        "])),(t()(),r.Y(16777216,null,null,1,null,Hp)),r._2(48,16384,null,0,K,[r.M,r.J],{ngIf:[0,"ngIf"]},null),(t()(),r._23(-1,null,["\n      "])),(t()(),r._23(-1,null,["\n  "])),(t()(),r._23(-1,null,["\n"])),(t()(),r._23(-1,null,["\n"])),(t()(),r.Y(16777216,null,null,1,null,Cd)),r._2(54,16384,null,0,K,[r.M,r.J],{ngIf:[0,"ngIf"]},null)],function(t,e){var n=e.component;t(e,4,0,n.fullscreenVideo),t(e,7,0,n.fullscreenVideo&&n.fullscreenOverlayMsg),t(e,48,0,n.regionCode),t(e,54,0,!n.fullscreenVideo)},null)}var Id=r.Z("app-yt",Wl,function(t){return r._25(0,[(t()(),r._3(0,0,null,null,1,"app-yt",[],null,null,null,Td,Up)),r._2(1,114688,null,0,Wl,[Sr,Pl,Rl,gi,yt],null,null)],function(t,e){t(e,1,0)},null)},{},{},[]);function kd(t){switch(t.length){case 0:return new Kl;case 1:return t[0];default:return new zl(t)}}function xd(t,e,n,r,i,o){void 0===i&&(i={}),void 0===o&&(o={});var s=[],a=[],u=-1,l=null;if(r.forEach(function(t){var n=t.offset,r=n==u,c=r&&l||{};Object.keys(t).forEach(function(n){var r=n,a=t[n];if("offset"!==n)switch(r=e.normalizePropertyName(r,s),a){case Ql:a=i[n];break;case Ul:a=o[n];break;default:a=e.normalizeStyleValue(n,r,a,s)}c[r]=a}),r||a.push(c),l=c,u=n}),s.length)throw new Error("Unable to animate due to the following errors:\n - "+s.join("\n - "));return a}function Ad(t,e,n,r){switch(e){case"start":t.onStart(function(){return r(n&&Od(n,"start",t.totalTime))});break;case"done":t.onDone(function(){return r(n&&Od(n,"done",t.totalTime))});break;case"destroy":t.onDestroy(function(){return r(n&&Od(n,"destroy",t.totalTime))})}}function Od(t,e,n){var r=Pd(t.element,t.triggerName,t.fromState,t.toState,e||t.phaseName,void 0==n?t.totalTime:n),i=t._data;return null!=i&&(r._data=i),r}function Pd(t,e,n,r,i,o){return void 0===i&&(i=""),void 0===o&&(o=0),{element:t,triggerName:e,fromState:n,toState:r,phaseName:i,totalTime:o}}function Nd(t,e,n){var r;return t instanceof Map?(r=t.get(e))||t.set(e,r=n):(r=t[e])||(r=t[e]=n),r}function Rd(t){var e=t.indexOf(":");return[t.substring(1,e),t.substr(e+1)]}var Dd=function(t,e){return!1},Md=function(t,e){return!1},Vd=function(t,e,n){return[]};if("undefined"!=typeof Element){if(Dd=function(t,e){return t.contains(e)},Element.prototype.matches)Md=function(t,e){return t.matches(e)};else{var Fd=Element.prototype,jd=Fd.matchesSelector||Fd.mozMatchesSelector||Fd.msMatchesSelector||Fd.oMatchesSelector||Fd.webkitMatchesSelector;jd&&(Md=function(t,e){return jd.apply(t,[e])})}Vd=function(t,e,n){var r=[];if(n)r.push.apply(r,t.querySelectorAll(e));else{var i=t.querySelector(e);i&&r.push(i)}return r}}var Ld=null,Ud=!1;function Bd(t){Ld||(Ld=qd()||{},Ud=!!Ld.style&&"WebkitAppearance"in Ld.style);var e=!0;return Ld.style&&!function(t){return"ebkit"==t.substring(1,6)}(t)&&!(e=t in Ld.style)&&Ud&&(e="Webkit"+t.charAt(0).toUpperCase()+t.substr(1)in Ld.style),e}function qd(){return"undefined"!=typeof document?document.body:null}var Hd=Md,Kd=Dd,zd=Vd,Qd=function(){function t(){}return t.prototype.validateStyleProperty=function(t){return Bd(t)},t.prototype.matchesElement=function(t,e){return Hd(t,e)},t.prototype.containsElement=function(t,e){return Kd(t,e)},t.prototype.query=function(t,e,n){return zd(t,e,n)},t.prototype.computeStyle=function(t,e,n){return n||""},t.prototype.animate=function(t,e,n,r,i,o){return void 0===o&&(o=[]),new Kl},t}(),Gd=function(){function t(){}return t.NOOP=new Qd,t}(),Wd=1e3;function Yd(t){if("number"==typeof t)return t;var e=t.match(/^(-?[\.\d]+)(m?s)/);return!e||e.length<2?0:Jd(parseFloat(e[1]),e[2])}function Jd(t,e){switch(e){case"s":return t*Wd;default:return t}}function Xd(t,e,n){return t.hasOwnProperty("duration")?t:function(t,e,n){var r,i=0,o="";if("string"==typeof t){var s=t.match(/^(-?[\.\d]+)(m?s)(?:\s+(-?[\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?$/i);if(null===s)return e.push('The provided timing value "'+t+'" is invalid.'),{duration:0,delay:0,easing:""};r=Jd(parseFloat(s[1]),s[2]);var a=s[3];null!=a&&(i=Jd(Math.floor(parseFloat(a)),s[4]));var u=s[5];u&&(o=u)}else r=t;if(!n){var l=!1,c=e.length;r<0&&(e.push("Duration values below 0 are not allowed for this animation step."),l=!0),i<0&&(e.push("Delay values below 0 are not allowed for this animation step."),l=!0),l&&e.splice(c,0,'The provided timing value "'+t+'" is invalid.')}return{duration:r,delay:i,easing:o}}(t,e,n)}function Zd(t,e){return void 0===e&&(e={}),Object.keys(t).forEach(function(n){e[n]=t[n]}),e}function $d(t,e,n){if(void 0===n&&(n={}),e)for(var r in t)n[r]=t[r];else Zd(t,n);return n}function ty(t,e){t.style&&Object.keys(e).forEach(function(n){var r=uy(n);t.style[r]=e[n]})}function ey(t,e){t.style&&Object.keys(e).forEach(function(e){var n=uy(e);t.style[n]=""})}function ny(t){return Array.isArray(t)?1==t.length?t[0]:Bl(t):t}var ry=new RegExp("{{\\s*(.+?)\\s*}}","g");function iy(t){var e=[];if("string"==typeof t){for(var n=t.toString(),r=void 0;r=ry.exec(n);)e.push(r[1]);ry.lastIndex=0}return e}function oy(t,e,n){var r=t.toString(),i=r.replace(ry,function(t,r){var i=e[r];return e.hasOwnProperty(r)||(n.push("Please provide a value for the animation param "+r),i=""),i.toString()});return i==r?t:i}function sy(t){for(var e=[],n=t.next();!n.done;)e.push(n.value),n=t.next();return e}var ay=/-+([a-z0-9])/g;function uy(t){return t.replace(ay,function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t[1].toUpperCase()})}function ly(t,e,n){switch(e.type){case 7:return t.visitTrigger(e,n);case 0:return t.visitState(e,n);case 1:return t.visitTransition(e,n);case 2:return t.visitSequence(e,n);case 3:return t.visitGroup(e,n);case 4:return t.visitAnimate(e,n);case 5:return t.visitKeyframes(e,n);case 6:return t.visitStyle(e,n);case 8:return t.visitReference(e,n);case 9:return t.visitAnimateChild(e,n);case 10:return t.visitAnimateRef(e,n);case 11:return t.visitQuery(e,n);case 12:return t.visitStagger(e,n);default:throw new Error("Unable to resolve animation metadata node #"+e.type)}}var cy="*",hy=new Set(["true","1"]),fy=new Set(["false","0"]);function py(t,e){var n=hy.has(t)||fy.has(t),r=hy.has(e)||fy.has(e);return function(i,o){var s=t==cy||t==i,a=e==cy||e==o;return!s&&n&&"boolean"==typeof i&&(s=i?hy.has(t):fy.has(t)),!a&&r&&"boolean"==typeof o&&(a=o?hy.has(e):fy.has(e)),s&&a}}var dy=new RegExp("s*:selfs*,?","g");function yy(t,e,n){return new my(t).build(e,n)}var my=function(){function t(t){this._driver=t}return t.prototype.build=function(t,e){var n=new gy(e);return this._resetContextStyleTimingState(n),ly(this,ny(t),n)},t.prototype._resetContextStyleTimingState=function(t){t.currentQuerySelector="",t.collectedStyles={},t.collectedStyles[""]={},t.currentTime=0},t.prototype.visitTrigger=function(t,e){var n=this,r=e.queryCount=0,i=e.depCount=0,o=[],s=[];return"@"==t.name.charAt(0)&&e.errors.push("animation triggers cannot be prefixed with an `@` sign (e.g. trigger('@foo', [...]))"),t.definitions.forEach(function(t){if(n._resetContextStyleTimingState(e),0==t.type){var a=t,u=a.name;u.split(/\s*,\s*/).forEach(function(t){a.name=t,o.push(n.visitState(a,e))}),a.name=u}else if(1==t.type){var l=n.visitTransition(t,e);r+=l.queryCount,i+=l.depCount,s.push(l)}else e.errors.push("only state() and transition() definitions can sit inside of a trigger()")}),{type:7,name:t.name,states:o,transitions:s,queryCount:r,depCount:i,options:null}},t.prototype.visitState=function(t,e){var n=this.visitStyle(t.styles,e),r=t.options&&t.options.params||null;if(n.containsDynamicStyles){var i=new Set,o=r||{};if(n.styles.forEach(function(t){if(vy(t)){var e=t;Object.keys(e).forEach(function(t){iy(e[t]).forEach(function(t){o.hasOwnProperty(t)||i.add(t)})})}}),i.size){var s=sy(i.values());e.errors.push('state("'+t.name+'", ...) must define default values for all the following style substitutions: '+s.join(", "))}}return{type:0,name:t.name,style:n,options:r?{params:r}:null}},t.prototype.visitTransition=function(t,e){e.queryCount=0,e.depCount=0;var n,r,i,o=ly(this,ny(t.animation),e);return{type:1,matchers:(n=t.expr,r=e.errors,i=[],"string"==typeof n?n.split(/\s*,\s*/).forEach(function(t){return function(t,e,n){if(":"==t[0]){var r=function(t,e){switch(t){case":enter":return"void => *";case":leave":return"* => void";case":increment":return function(t,e){return parseFloat(e)>parseFloat(t)};case":decrement":return function(t,e){return parseFloat(e)<parseFloat(t)};default:return e.push('The transition alias value "'+t+'" is not supported'),"* => *"}}(t,n);if("function"==typeof r)return void e.push(r);t=r}var i=t.match(/^(\*|[-\w]+)\s*(<?[=-]>)\s*(\*|[-\w]+)$/);if(null==i||i.length<4)return n.push('The provided transition expression "'+t+'" is not supported'),e;var o=i[1],s=i[2],a=i[3];e.push(py(o,a)),"<"!=s[0]||o==cy&&a==cy||e.push(py(a,o))}(t,i,r)}):i.push(n),i),animation:o,queryCount:e.queryCount,depCount:e.depCount,options:_y(t.options)}},t.prototype.visitSequence=function(t,e){var n=this;return{type:2,steps:t.steps.map(function(t){return ly(n,t,e)}),options:_y(t.options)}},t.prototype.visitGroup=function(t,e){var n=this,r=e.currentTime,i=0,o=t.steps.map(function(t){e.currentTime=r;var o=ly(n,t,e);return i=Math.max(i,e.currentTime),o});return e.currentTime=i,{type:3,steps:o,options:_y(t.options)}},t.prototype.visitAnimate=function(t,e){var n,r=function(t,e){var n=null;if(t.hasOwnProperty("duration"))n=t;else if("number"==typeof t)return by(Xd(t,e).duration,0,"");var r=t;if(r.split(/\s+/).some(function(t){return"{"==t.charAt(0)&&"{"==t.charAt(1)})){var i=by(0,0,"");return i.dynamic=!0,i.strValue=r,i}return by((n=n||Xd(r,e)).duration,n.delay,n.easing)}(t.timings,e.errors);e.currentAnimateTimings=r;var i=t.styles?t.styles:ql({});if(5==i.type)n=this.visitKeyframes(i,e);else{var o=t.styles,s=!1;if(!o){s=!0;var a={};r.easing&&(a.easing=r.easing),o=ql(a)}e.currentTime+=r.duration+r.delay;var u=this.visitStyle(o,e);u.isEmptyStep=s,n=u}return e.currentAnimateTimings=null,{type:4,timings:r,style:n,options:null}},t.prototype.visitStyle=function(t,e){var n=this._makeStyleAst(t,e);return this._validateStyleAst(n,e),n},t.prototype._makeStyleAst=function(t,e){var n=[];Array.isArray(t.styles)?t.styles.forEach(function(t){"string"==typeof t?t==Ul?n.push(t):e.errors.push("The provided style string value "+t+" is not allowed."):n.push(t)}):n.push(t.styles);var r=!1,i=null;return n.forEach(function(t){if(vy(t)){var e=t,n=e.easing;if(n&&(i=n,delete e.easing),!r)for(var o in e)if(e[o].toString().indexOf("{{")>=0){r=!0;break}}}),{type:6,styles:n,easing:i,offset:t.offset,containsDynamicStyles:r,options:null}},t.prototype._validateStyleAst=function(t,e){var n=this,r=e.currentAnimateTimings,i=e.currentTime,o=e.currentTime;r&&o>0&&(o-=r.duration+r.delay),t.styles.forEach(function(t){"string"!=typeof t&&Object.keys(t).forEach(function(r){if(n._driver.validateStyleProperty(r)){var s,a,u,l=e.collectedStyles[e.currentQuerySelector],c=l[r],h=!0;c&&(o!=i&&o>=c.startTime&&i<=c.endTime&&(e.errors.push('The CSS property "'+r+'" that exists between the times of "'+c.startTime+'ms" and "'+c.endTime+'ms" is also being animated in a parallel animation between the times of "'+o+'ms" and "'+i+'ms"'),h=!1),o=c.startTime),h&&(l[r]={startTime:o,endTime:i}),e.options&&(s=e.errors,a=e.options.params||{},(u=iy(t[r])).length&&u.forEach(function(t){a.hasOwnProperty(t)||s.push("Unable to resolve the local animation param "+t+" in the given list of values")}))}else e.errors.push('The provided animation property "'+r+'" is not a supported CSS property for animations')})})},t.prototype.visitKeyframes=function(t,e){var n=this,r={type:5,styles:[],options:null};if(!e.currentAnimateTimings)return e.errors.push("keyframes() must be placed inside of a call to animate()"),r;var i=0,o=[],s=!1,a=!1,u=0,l=t.steps.map(function(t){var r=n._makeStyleAst(t,e),l=null!=r.offset?r.offset:function(t){if("string"==typeof t)return null;var e=null;if(Array.isArray(t))t.forEach(function(t){if(vy(t)&&t.hasOwnProperty("offset")){var n=t;e=parseFloat(n.offset),delete n.offset}});else if(vy(t)&&t.hasOwnProperty("offset")){var n=t;e=parseFloat(n.offset),delete n.offset}return e}(r.styles),c=0;return null!=l&&(i++,c=r.offset=l),a=a||c<0||c>1,s=s||c<u,u=c,o.push(c),r});a&&e.errors.push("Please ensure that all keyframe offsets are between 0 and 1"),s&&e.errors.push("Please ensure that all keyframe offsets are in order");var c=t.steps.length,h=0;i>0&&i<c?e.errors.push("Not all style() steps within the declared keyframes() contain offsets"):0==i&&(h=1/(c-1));var f=c-1,p=e.currentTime,d=e.currentAnimateTimings,y=d.duration;return l.forEach(function(t,i){var s=h>0?i==f?1:h*i:o[i],a=s*y;e.currentTime=p+d.delay+a,d.duration=a,n._validateStyleAst(t,e),t.offset=s,r.styles.push(t)}),r},t.prototype.visitReference=function(t,e){return{type:8,animation:ly(this,ny(t.animation),e),options:_y(t.options)}},t.prototype.visitAnimateChild=function(t,e){return e.depCount++,{type:9,options:_y(t.options)}},t.prototype.visitAnimateRef=function(t,e){return{type:10,animation:this.visitReference(t.animation,e),options:_y(t.options)}},t.prototype.visitQuery=function(t,e){var n=e.currentQuerySelector,r=t.options||{};e.queryCount++,e.currentQuery=t;var i=function(t){var e=!!t.split(/\s*,\s*/).find(function(t){return":self"==t});return e&&(t=t.replace(dy,"")),[t=t.replace(/@\*/g,".ng-trigger").replace(/@\w+/g,function(t){return".ng-trigger-"+t.substr(1)}).replace(/:animating/g,".ng-animating"),e]}(t.selector),o=i[0],s=i[1];e.currentQuerySelector=n.length?n+" "+o:o,Nd(e.collectedStyles,e.currentQuerySelector,{});var a=ly(this,ny(t.animation),e);return e.currentQuery=null,e.currentQuerySelector=n,{type:11,selector:o,limit:r.limit||0,optional:!!r.optional,includeSelf:s,animation:a,originalSelector:t.selector,options:_y(t.options)}},t.prototype.visitStagger=function(t,e){e.currentQuery||e.errors.push("stagger() can only be used inside of query()");var n="full"===t.timings?{duration:0,delay:0,easing:"full"}:Xd(t.timings,e.errors,!0);return{type:12,animation:ly(this,ny(t.animation),e),timings:n,options:null}},t}(),gy=function(t){this.errors=t,this.queryCount=0,this.depCount=0,this.currentTransition=null,this.currentQuery=null,this.currentQuerySelector=null,this.currentAnimateTimings=null,this.currentTime=0,this.collectedStyles={},this.options=null};function vy(t){return!Array.isArray(t)&&"object"==typeof t}function _y(t){var e;return t?(t=Zd(t)).params&&(t.params=(e=t.params)?Zd(e):null):t={},t}function by(t,e,n){return{duration:t,delay:e,easing:n}}function wy(t,e,n,r,i,o,s,a){return void 0===s&&(s=null),void 0===a&&(a=!1),{type:1,element:t,keyframes:e,preStyleProps:n,postStyleProps:r,duration:i,delay:o,totalTime:i+o,easing:s,subTimeline:a}}var Ey=function(){function t(){this._map=new Map}return t.prototype.consume=function(t){var e=this._map.get(t);return e?this._map.delete(t):e=[],e},t.prototype.append=function(t,e){var n=this._map.get(t);n||this._map.set(t,n=[]),n.push.apply(n,e)},t.prototype.has=function(t){return this._map.has(t)},t.prototype.clear=function(){this._map.clear()},t}(),Sy=new RegExp(":enter","g"),Cy=new RegExp(":leave","g");function Ty(t,e,n,r,i,o,s,a,u,l){return void 0===o&&(o={}),void 0===s&&(s={}),void 0===l&&(l=[]),(new Iy).buildKeyframes(t,e,n,r,i,o,s,a,u,l)}var Iy=function(){function t(){}return t.prototype.buildKeyframes=function(t,e,n,r,i,o,s,a,u,l){void 0===l&&(l=[]),u=u||new Ey;var c=new xy(t,e,u,r,i,l,[]);c.options=a,c.currentTimeline.setStyles([o],null,c.errors,a),ly(this,n,c);var h=c.timelines.filter(function(t){return t.containsAnimation()});if(h.length&&Object.keys(s).length){var f=h[h.length-1];f.allowOnlyTimelineStyles()||f.setStyles([s],null,c.errors,a)}return h.length?h.map(function(t){return t.buildKeyframes()}):[wy(e,[],[],[],0,0,"",!1)]},t.prototype.visitTrigger=function(t,e){},t.prototype.visitState=function(t,e){},t.prototype.visitTransition=function(t,e){},t.prototype.visitAnimateChild=function(t,e){var n=e.subInstructions.consume(e.element);if(n){var r=e.createSubContext(t.options),i=e.currentTimeline.currentTime,o=this._visitSubInstructions(n,r,r.options);i!=o&&e.transformIntoNewTimeline(o)}e.previousNode=t},t.prototype.visitAnimateRef=function(t,e){var n=e.createSubContext(t.options);n.transformIntoNewTimeline(),this.visitReference(t.animation,n),e.transformIntoNewTimeline(n.currentTimeline.currentTime),e.previousNode=t},t.prototype._visitSubInstructions=function(t,e,n){var r=e.currentTimeline.currentTime,i=null!=n.duration?Yd(n.duration):null,o=null!=n.delay?Yd(n.delay):null;return 0!==i&&t.forEach(function(t){var n=e.appendInstructionToTimeline(t,i,o);r=Math.max(r,n.duration+n.delay)}),r},t.prototype.visitReference=function(t,e){e.updateOptions(t.options,!0),ly(this,t.animation,e),e.previousNode=t},t.prototype.visitSequence=function(t,e){var n=this,r=e.subContextCount,i=e,o=t.options;if(o&&(o.params||o.delay)&&((i=e.createSubContext(o)).transformIntoNewTimeline(),null!=o.delay)){6==i.previousNode.type&&(i.currentTimeline.snapshotCurrentStyles(),i.previousNode=ky);var s=Yd(o.delay);i.delayNextStep(s)}t.steps.length&&(t.steps.forEach(function(t){return ly(n,t,i)}),i.currentTimeline.applyStylesToKeyframe(),i.subContextCount>r&&i.transformIntoNewTimeline()),e.previousNode=t},t.prototype.visitGroup=function(t,e){var n=this,r=[],i=e.currentTimeline.currentTime,o=t.options&&t.options.delay?Yd(t.options.delay):0;t.steps.forEach(function(s){var a=e.createSubContext(t.options);o&&a.delayNextStep(o),ly(n,s,a),i=Math.max(i,a.currentTimeline.currentTime),r.push(a.currentTimeline)}),r.forEach(function(t){return e.currentTimeline.mergeTimelineCollectedStyles(t)}),e.transformIntoNewTimeline(i),e.previousNode=t},t.prototype._visitTiming=function(t,e){if(t.dynamic){var n=t.strValue;return Xd(e.params?oy(n,e.params,e.errors):n,e.errors)}return{duration:t.duration,delay:t.delay,easing:t.easing}},t.prototype.visitAnimate=function(t,e){var n=e.currentAnimateTimings=this._visitTiming(t.timings,e),r=e.currentTimeline;n.delay&&(e.incrementTime(n.delay),r.snapshotCurrentStyles());var i=t.style;5==i.type?this.visitKeyframes(i,e):(e.incrementTime(n.duration),this.visitStyle(i,e),r.applyStylesToKeyframe()),e.currentAnimateTimings=null,e.previousNode=t},t.prototype.visitStyle=function(t,e){var n=e.currentTimeline,r=e.currentAnimateTimings;!r&&n.getCurrentStyleProperties().length&&n.forwardFrame();var i=r&&r.easing||t.easing;t.isEmptyStep?n.applyEmptyStep(i):n.setStyles(t.styles,i,e.errors,e.options),e.previousNode=t},t.prototype.visitKeyframes=function(t,e){var n=e.currentAnimateTimings,r=e.currentTimeline.duration,i=n.duration,o=e.createSubContext().currentTimeline;o.easing=n.easing,t.styles.forEach(function(t){o.forwardTime((t.offset||0)*i),o.setStyles(t.styles,t.easing,e.errors,e.options),o.applyStylesToKeyframe()}),e.currentTimeline.mergeTimelineCollectedStyles(o),e.transformIntoNewTimeline(r+i),e.previousNode=t},t.prototype.visitQuery=function(t,e){var n=this,r=e.currentTimeline.currentTime,i=t.options||{},o=i.delay?Yd(i.delay):0;o&&(6===e.previousNode.type||0==r&&e.currentTimeline.getCurrentStyleProperties().length)&&(e.currentTimeline.snapshotCurrentStyles(),e.previousNode=ky);var s=r,a=e.invokeQuery(t.selector,t.originalSelector,t.limit,t.includeSelf,!!i.optional,e.errors);e.currentQueryTotal=a.length;var u=null;a.forEach(function(r,i){e.currentQueryIndex=i;var a=e.createSubContext(t.options,r);o&&a.delayNextStep(o),r===e.element&&(u=a.currentTimeline),ly(n,t.animation,a),a.currentTimeline.applyStylesToKeyframe(),s=Math.max(s,a.currentTimeline.currentTime)}),e.currentQueryIndex=0,e.currentQueryTotal=0,e.transformIntoNewTimeline(s),u&&(e.currentTimeline.mergeTimelineCollectedStyles(u),e.currentTimeline.snapshotCurrentStyles()),e.previousNode=t},t.prototype.visitStagger=function(t,e){var n=e.parentContext,r=e.currentTimeline,i=t.timings,o=Math.abs(i.duration),s=o*(e.currentQueryTotal-1),a=o*e.currentQueryIndex;switch(i.duration<0?"reverse":i.easing){case"reverse":a=s-a;break;case"full":a=n.currentStaggerTime}var u=e.currentTimeline;a&&u.delayNextStep(a);var l=u.currentTime;ly(this,t.animation,e),e.previousNode=t,n.currentStaggerTime=r.currentTime-l+(r.startTime-n.currentTimeline.startTime)},t}(),ky={},xy=function(){function t(t,e,n,r,i,o,s,a){this._driver=t,this.element=e,this.subInstructions=n,this._enterClassName=r,this._leaveClassName=i,this.errors=o,this.timelines=s,this.parentContext=null,this.currentAnimateTimings=null,this.previousNode=ky,this.subContextCount=0,this.options={},this.currentQueryIndex=0,this.currentQueryTotal=0,this.currentStaggerTime=0,this.currentTimeline=a||new Ay(this._driver,e,0),s.push(this.currentTimeline)}return Object.defineProperty(t.prototype,"params",{get:function(){return this.options.params},enumerable:!0,configurable:!0}),t.prototype.updateOptions=function(t,e){var n=this;if(t){var r=t,i=this.options;null!=r.duration&&(i.duration=Yd(r.duration)),null!=r.delay&&(i.delay=Yd(r.delay));var o=r.params;if(o){var s=i.params;s||(s=this.options.params={}),Object.keys(o).forEach(function(t){e&&s.hasOwnProperty(t)||(s[t]=oy(o[t],s,n.errors))})}}},t.prototype._copyOptions=function(){var t={};if(this.options){var e=this.options.params;if(e){var n=t.params={};Object.keys(e).forEach(function(t){n[t]=e[t]})}}return t},t.prototype.createSubContext=function(e,n,r){void 0===e&&(e=null);var i=n||this.element,o=new t(this._driver,i,this.subInstructions,this._enterClassName,this._leaveClassName,this.errors,this.timelines,this.currentTimeline.fork(i,r||0));return o.previousNode=this.previousNode,o.currentAnimateTimings=this.currentAnimateTimings,o.options=this._copyOptions(),o.updateOptions(e),o.currentQueryIndex=this.currentQueryIndex,o.currentQueryTotal=this.currentQueryTotal,o.parentContext=this,this.subContextCount++,o},t.prototype.transformIntoNewTimeline=function(t){return this.previousNode=ky,this.currentTimeline=this.currentTimeline.fork(this.element,t),this.timelines.push(this.currentTimeline),this.currentTimeline},t.prototype.appendInstructionToTimeline=function(t,e,n){var r={duration:null!=e?e:t.duration,delay:this.currentTimeline.currentTime+(null!=n?n:0)+t.delay,easing:""},i=new Oy(this._driver,t.element,t.keyframes,t.preStyleProps,t.postStyleProps,r,t.stretchStartingKeyframe);return this.timelines.push(i),r},t.prototype.incrementTime=function(t){this.currentTimeline.forwardTime(this.currentTimeline.duration+t)},t.prototype.delayNextStep=function(t){t>0&&this.currentTimeline.delayNextStep(t)},t.prototype.invokeQuery=function(t,e,n,r,i,o){var s=[];if(r&&s.push(this.element),t.length>0){t=(t=t.replace(Sy,"."+this._enterClassName)).replace(Cy,"."+this._leaveClassName);var a=this._driver.query(this.element,t,1!=n);0!==n&&(a=n<0?a.slice(a.length+n,a.length):a.slice(0,n)),s.push.apply(s,a)}return i||0!=s.length||o.push('`query("'+e+'")` returned zero elements. (Use `query("'+e+'", { optional: true })` if you wish to allow this.)'),s},t}(),Ay=function(){function t(t,e,n,r){this._driver=t,this.element=e,this.startTime=n,this._elementTimelineStylesLookup=r,this.duration=0,this._previousKeyframe={},this._currentKeyframe={},this._keyframes=new Map,this._styleSummary={},this._pendingStyles={},this._backFill={},this._currentEmptyStepKeyframe=null,this._elementTimelineStylesLookup||(this._elementTimelineStylesLookup=new Map),this._localTimelineStyles=Object.create(this._backFill,{}),this._globalTimelineStyles=this._elementTimelineStylesLookup.get(e),this._globalTimelineStyles||(this._globalTimelineStyles=this._localTimelineStyles,this._elementTimelineStylesLookup.set(e,this._localTimelineStyles)),this._loadKeyframe()}return t.prototype.containsAnimation=function(){switch(this._keyframes.size){case 0:return!1;case 1:return this.getCurrentStyleProperties().length>0;default:return!0}},t.prototype.getCurrentStyleProperties=function(){return Object.keys(this._currentKeyframe)},Object.defineProperty(t.prototype,"currentTime",{get:function(){return this.startTime+this.duration},enumerable:!0,configurable:!0}),t.prototype.delayNextStep=function(t){var e=1==this._keyframes.size&&Object.keys(this._pendingStyles).length;this.duration||e?(this.forwardTime(this.currentTime+t),e&&this.snapshotCurrentStyles()):this.startTime+=t},t.prototype.fork=function(e,n){return this.applyStylesToKeyframe(),new t(this._driver,e,n||this.currentTime,this._elementTimelineStylesLookup)},t.prototype._loadKeyframe=function(){this._currentKeyframe&&(this._previousKeyframe=this._currentKeyframe),this._currentKeyframe=this._keyframes.get(this.duration),this._currentKeyframe||(this._currentKeyframe=Object.create(this._backFill,{}),this._keyframes.set(this.duration,this._currentKeyframe))},t.prototype.forwardFrame=function(){this.duration+=1,this._loadKeyframe()},t.prototype.forwardTime=function(t){this.applyStylesToKeyframe(),this.duration=t,this._loadKeyframe()},t.prototype._updateStyle=function(t,e){this._localTimelineStyles[t]=e,this._globalTimelineStyles[t]=e,this._styleSummary[t]={time:this.currentTime,value:e}},t.prototype.allowOnlyTimelineStyles=function(){return this._currentEmptyStepKeyframe!==this._currentKeyframe},t.prototype.applyEmptyStep=function(t){var e=this;t&&(this._previousKeyframe.easing=t),Object.keys(this._globalTimelineStyles).forEach(function(t){e._backFill[t]=e._globalTimelineStyles[t]||Ul,e._currentKeyframe[t]=Ul}),this._currentEmptyStepKeyframe=this._currentKeyframe},t.prototype.setStyles=function(t,e,n,r){var i=this;e&&(this._previousKeyframe.easing=e);var o=r&&r.params||{},s=function(t,e){var n,r={};return t.forEach(function(t){"*"===t?(n=n||Object.keys(e)).forEach(function(t){r[t]=Ul}):$d(t,!1,r)}),r}(t,this._globalTimelineStyles);Object.keys(s).forEach(function(t){var e=oy(s[t],o,n);i._pendingStyles[t]=e,i._localTimelineStyles.hasOwnProperty(t)||(i._backFill[t]=i._globalTimelineStyles.hasOwnProperty(t)?i._globalTimelineStyles[t]:Ul),i._updateStyle(t,e)})},t.prototype.applyStylesToKeyframe=function(){var t=this,e=this._pendingStyles,n=Object.keys(e);0!=n.length&&(this._pendingStyles={},n.forEach(function(n){t._currentKeyframe[n]=e[n]}),Object.keys(this._localTimelineStyles).forEach(function(e){t._currentKeyframe.hasOwnProperty(e)||(t._currentKeyframe[e]=t._localTimelineStyles[e])}))},t.prototype.snapshotCurrentStyles=function(){var t=this;Object.keys(this._localTimelineStyles).forEach(function(e){var n=t._localTimelineStyles[e];t._pendingStyles[e]=n,t._updateStyle(e,n)})},t.prototype.getFinalKeyframe=function(){return this._keyframes.get(this.duration)},Object.defineProperty(t.prototype,"properties",{get:function(){var t=[];for(var e in this._currentKeyframe)t.push(e);return t},enumerable:!0,configurable:!0}),t.prototype.mergeTimelineCollectedStyles=function(t){var e=this;Object.keys(t._styleSummary).forEach(function(n){var r=e._styleSummary[n],i=t._styleSummary[n];(!r||i.time>r.time)&&e._updateStyle(n,i.value)})},t.prototype.buildKeyframes=function(){var t=this;this.applyStylesToKeyframe();var e=new Set,n=new Set,r=1===this._keyframes.size&&0===this.duration,i=[];this._keyframes.forEach(function(o,s){var a=$d(o,!0);Object.keys(a).forEach(function(t){var r=a[t];r==Ql?e.add(t):r==Ul&&n.add(t)}),r||(a.offset=s/t.duration),i.push(a)});var o=e.size?sy(e.values()):[],s=n.size?sy(n.values()):[];if(r){var a=i[0],u=Zd(a);a.offset=0,u.offset=1,i=[a,u]}return wy(this.element,i,o,s,this.duration,this.startTime,this.easing,!1)},t}(),Oy=function(t){function e(e,n,r,i,o,s,a){void 0===a&&(a=!1);var u=t.call(this,e,n,s.delay)||this;return u.element=n,u.keyframes=r,u.preStyleProps=i,u.postStyleProps=o,u._stretchStartingKeyframe=a,u.timings={duration:s.duration,delay:s.delay,easing:s.easing},u}return Object(i.__extends)(e,t),e.prototype.containsAnimation=function(){return this.keyframes.length>1},e.prototype.buildKeyframes=function(){var t=this.keyframes,e=this.timings,n=e.delay,r=e.duration,i=e.easing;if(this._stretchStartingKeyframe&&n){var o=[],s=r+n,a=n/s,u=$d(t[0],!1);u.offset=0,o.push(u);var l=$d(t[0],!1);l.offset=Py(a),o.push(l);for(var c=t.length-1,h=1;h<=c;h++){var f=$d(t[h],!1);f.offset=Py((n+f.offset*r)/s),o.push(f)}r=s,n=0,i="",t=o}return wy(this.element,t,this.preStyleProps,this.postStyleProps,r,n,i,!0)},e}(Ay);function Py(t,e){void 0===e&&(e=3);var n=Math.pow(10,e-1);return Math.round(t*n)/n}var Ny=function(){},Ry=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(i.__extends)(e,t),e.prototype.normalizePropertyName=function(t,e){return uy(t)},e.prototype.normalizeStyleValue=function(t,e,n,r){var i="",o=n.toString().trim();if(Dy[e]&&0!==n&&"0"!==n)if("number"==typeof n)i="px";else{var s=n.match(/^[+-]?[\d\.]+([a-z]*)$/);s&&0==s[1].length&&r.push("Please provide a CSS unit value for "+t+":"+n)}return o+i},e}(Ny),Dy=function(t){var e={};return"width,height,minWidth,minHeight,maxWidth,maxHeight,left,top,bottom,right,fontSize,outlineWidth,outlineOffset,paddingTop,paddingLeft,paddingBottom,paddingRight,marginTop,marginLeft,marginBottom,marginRight,borderRadius,borderWidth,borderTopWidth,borderLeftWidth,borderRightWidth,borderBottomWidth,textIndent,perspective".split(",").forEach(function(t){return e[t]=!0}),e}();function My(t,e,n,r,i,o,s,a,u,l,c,h){return{type:0,element:t,triggerName:e,isRemovalTransition:i,fromState:n,fromStyles:o,toState:r,toStyles:s,timelines:a,queriedElements:u,preStyleProps:l,postStyleProps:c,errors:h}}var Vy={},Fy=function(){function t(t,e,n){this._triggerName=t,this.ast=e,this._stateStyles=n}return t.prototype.match=function(t,e){return function(t,e,n){return t.some(function(t){return t(e,n)})}(this.ast.matchers,t,e)},t.prototype.buildStyles=function(t,e,n){var r=this._stateStyles["*"],i=this._stateStyles[t],o=r?r.buildStyles(e,n):{};return i?i.buildStyles(e,n):o},t.prototype.build=function(t,e,n,r,o,s,a,u,l){var c=[],h=this.ast.options&&this.ast.options.params||Vy,f=this.buildStyles(n,a&&a.params||Vy,c),p=u&&u.params||Vy,d=this.buildStyles(r,p,c),y=new Set,m=new Map,g=new Map,v="void"===r,_={params:Object(i.__assign)({},h,p)},b=Ty(t,e,this.ast.animation,o,s,f,d,_,l,c);if(c.length)return My(e,this._triggerName,n,r,v,f,d,[],[],m,g,c);b.forEach(function(t){var n=t.element,r=Nd(m,n,{});t.preStyleProps.forEach(function(t){return r[t]=!0});var i=Nd(g,n,{});t.postStyleProps.forEach(function(t){return i[t]=!0}),n!==e&&y.add(n)});var w=sy(y.values());return My(e,this._triggerName,n,r,v,f,d,b,w,m,g)},t}(),jy=function(){function t(t,e){this.styles=t,this.defaultParams=e}return t.prototype.buildStyles=function(t,e){var n={},r=Zd(this.defaultParams);return Object.keys(t).forEach(function(e){var n=t[e];null!=n&&(r[e]=n)}),this.styles.styles.forEach(function(t){if("string"!=typeof t){var i=t;Object.keys(i).forEach(function(t){var o=i[t];o.length>1&&(o=oy(o,r,e)),n[t]=o})}}),n},t}(),Ly=function(){function t(t,e){var n=this;this.name=t,this.ast=e,this.transitionFactories=[],this.states={},e.states.forEach(function(t){n.states[t.name]=new jy(t.style,t.options&&t.options.params||{})}),Uy(this.states,"true","1"),Uy(this.states,"false","0"),e.transitions.forEach(function(e){n.transitionFactories.push(new Fy(t,e,n.states))}),this.fallbackTransition=new Fy(t,{type:1,animation:{type:2,steps:[],options:null},matchers:[function(t,e){return!0}],options:null,queryCount:0,depCount:0},this.states)}return Object.defineProperty(t.prototype,"containsQueries",{get:function(){return this.ast.queryCount>0},enumerable:!0,configurable:!0}),t.prototype.matchTransition=function(t,e){return this.transitionFactories.find(function(n){return n.match(t,e)})||null},t.prototype.matchStyles=function(t,e,n){return this.fallbackTransition.buildStyles(t,e,n)},t}();function Uy(t,e,n){t.hasOwnProperty(e)?t.hasOwnProperty(n)||(t[n]=t[e]):t.hasOwnProperty(n)&&(t[e]=t[n])}var By=new Ey,qy=function(){function t(t,e){this._driver=t,this._normalizer=e,this._animations={},this._playersById={},this.players=[]}return t.prototype.register=function(t,e){var n=[],r=yy(this._driver,e,n);if(n.length)throw new Error("Unable to build the animation due to the following errors: "+n.join("\n"));this._animations[t]=r},t.prototype._buildPlayer=function(t,e,n){var r=t.element,i=xd(0,this._normalizer,0,t.keyframes,e,n);return this._driver.animate(r,i,t.duration,t.delay,t.easing,[])},t.prototype.create=function(t,e,n){var r=this;void 0===n&&(n={});var i,o=[],s=this._animations[t],a=new Map;if(s?(i=Ty(this._driver,e,s,"ng-enter","ng-leave",{},{},n,By,o)).forEach(function(t){var e=Nd(a,t.element,{});t.postStyleProps.forEach(function(t){return e[t]=null})}):(o.push("The requested animation doesn't exist or has already been destroyed"),i=[]),o.length)throw new Error("Unable to create the animation due to the following errors: "+o.join("\n"));a.forEach(function(t,e){Object.keys(t).forEach(function(n){t[n]=r._driver.computeStyle(e,n,Ul)})});var u=kd(i.map(function(t){var e=a.get(t.element);return r._buildPlayer(t,{},e)}));return this._playersById[t]=u,u.onDestroy(function(){return r.destroy(t)}),this.players.push(u),u},t.prototype.destroy=function(t){var e=this._getPlayer(t);e.destroy(),delete this._playersById[t];var n=this.players.indexOf(e);n>=0&&this.players.splice(n,1)},t.prototype._getPlayer=function(t){var e=this._playersById[t];if(!e)throw new Error("Unable to find the timeline player referenced by "+t);return e},t.prototype.listen=function(t,e,n,r){var i=Pd(e,"","","");return Ad(this._getPlayer(t),n,i,r),function(){}},t.prototype.command=function(t,e,n,r){if("register"!=n)if("create"!=n){var i=this._getPlayer(t);switch(n){case"play":i.play();break;case"pause":i.pause();break;case"reset":i.reset();break;case"restart":i.restart();break;case"finish":i.finish();break;case"init":i.init();break;case"setPosition":i.setPosition(parseFloat(r[0]));break;case"destroy":this.destroy(t)}}else this.create(t,e,r[0]||{});else this.register(t,r[0])},t}(),Hy=[],Ky={namespaceId:"",setForRemoval:null,hasAnimation:!1,removedBeforeQueried:!1},zy={namespaceId:"",setForRemoval:null,hasAnimation:!1,removedBeforeQueried:!0},Qy="__ng_removed",Gy=function(){function t(t,e){void 0===e&&(e=""),this.namespaceId=e;var n=t&&t.hasOwnProperty("value");if(this.value=function(t){return null!=t?t:null}(n?t.value:t),n){var r=Zd(t);delete r.value,this.options=r}else this.options={};this.options.params||(this.options.params={})}return Object.defineProperty(t.prototype,"params",{get:function(){return this.options.params},enumerable:!0,configurable:!0}),t.prototype.absorbOptions=function(t){var e=t.params;if(e){var n=this.options.params;Object.keys(e).forEach(function(t){null==n[t]&&(n[t]=e[t])})}},t}(),Wy=new Gy("void"),Yy=new Gy("DELETED"),Jy=function(){function t(t,e,n){this.id=t,this.hostElement=e,this._engine=n,this.players=[],this._triggers={},this._queue=[],this._elementListeners=new Map,this._hostClassName="ng-tns-"+t,im(e,this._hostClassName)}return t.prototype.listen=function(t,e,n,r){var i,o=this;if(!this._triggers.hasOwnProperty(e))throw new Error('Unable to listen on the animation trigger event "'+n+'" because the animation trigger "'+e+"\" doesn't exist!");if(null==n||0==n.length)throw new Error('Unable to listen on the animation trigger "'+e+'" because the provided event is undefined!');if("start"!=(i=n)&&"done"!=i)throw new Error('The provided animation trigger event "'+n+'" for the animation trigger "'+e+'" is not supported!');var s=Nd(this._elementListeners,t,[]),a={name:e,phase:n,callback:r};s.push(a);var u=Nd(this._engine.statesByElement,t,{});return u.hasOwnProperty(e)||(im(t,"ng-trigger"),im(t,"ng-trigger-"+e),u[e]=Wy),function(){o._engine.afterFlush(function(){var t=s.indexOf(a);t>=0&&s.splice(t,1),o._triggers[e]||delete u[e]})}},t.prototype.register=function(t,e){return!this._triggers[t]&&(this._triggers[t]=e,!0)},t.prototype._getTrigger=function(t){var e=this._triggers[t];if(!e)throw new Error('The provided animation trigger "'+t+'" has not been registered!');return e},t.prototype.trigger=function(t,e,n,r){var i=this;void 0===r&&(r=!0);var o=this._getTrigger(e),s=new Zy(this.id,e,t),a=this._engine.statesByElement.get(t);a||(im(t,"ng-trigger"),im(t,"ng-trigger-"+e),this._engine.statesByElement.set(t,a={}));var u=a[e],l=new Gy(n,this.id);if(!(n&&n.hasOwnProperty("value"))&&u&&l.absorbOptions(u.options),a[e]=l,u){if(u===Yy)return s}else u=Wy;if("void"===l.value||u.value!==l.value){var c=Nd(this._engine.playersByElement,t,[]);c.forEach(function(t){t.namespaceId==i.id&&t.triggerName==e&&t.queued&&t.destroy()});var h=o.matchTransition(u.value,l.value),f=!1;if(!h){if(!r)return;h=o.fallbackTransition,f=!0}return this._engine.totalQueuedPlayers++,this._queue.push({element:t,triggerName:e,transition:h,fromState:u,toState:l,player:s,isFallbackTransition:f}),f||(im(t,"ng-animate-queued"),s.onStart(function(){om(t,"ng-animate-queued")})),s.onDone(function(){var e=i.players.indexOf(s);e>=0&&i.players.splice(e,1);var n=i._engine.playersByElement.get(t);if(n){var r=n.indexOf(s);r>=0&&n.splice(r,1)}}),this.players.push(s),c.push(s),s}if(!function(t,e){var n=Object.keys(t),r=Object.keys(e);if(n.length!=r.length)return!1;for(var i=0;i<n.length;i++){var o=n[i];if(!e.hasOwnProperty(o)||t[o]!==e[o])return!1}return!0}(u.params,l.params)){var p=[],d=o.matchStyles(u.value,u.params,p),y=o.matchStyles(l.value,l.params,p);p.length?this._engine.reportError(p):this._engine.afterFlush(function(){ey(t,d),ty(t,y)})}},t.prototype.deregister=function(t){var e=this;delete this._triggers[t],this._engine.statesByElement.forEach(function(e,n){delete e[t]}),this._elementListeners.forEach(function(n,r){e._elementListeners.set(r,n.filter(function(e){return e.name!=t}))})},t.prototype.clearElementCache=function(t){this._engine.statesByElement.delete(t),this._elementListeners.delete(t);var e=this._engine.playersByElement.get(t);e&&(e.forEach(function(t){return t.destroy()}),this._engine.playersByElement.delete(t))},t.prototype._signalRemovalForInnerTriggers=function(t,e,n){var r=this;void 0===n&&(n=!1),this._engine.driver.query(t,".ng-trigger",!0).forEach(function(t){if(!t[Qy]){var n=r._engine.fetchNamespacesByElement(t);n.size?n.forEach(function(n){return n.triggerLeaveAnimation(t,e,!1,!0)}):r.clearElementCache(t)}})},t.prototype.triggerLeaveAnimation=function(t,e,n,r){var i=this,o=this._engine.statesByElement.get(t);if(o){var s=[];if(Object.keys(o).forEach(function(e){if(i._triggers[e]){var n=i.trigger(t,e,"void",r);n&&s.push(n)}}),s.length)return this._engine.markElementAsRemoved(this.id,t,!0,e),n&&kd(s).onDone(function(){return i._engine.processLeaveNode(t)}),!0}return!1},t.prototype.prepareLeaveAnimationListeners=function(t){var e=this,n=this._elementListeners.get(t);if(n){var r=new Set;n.forEach(function(n){var i=n.name;if(!r.has(i)){r.add(i);var o=e._triggers[i].fallbackTransition,s=e._engine.statesByElement.get(t)[i]||Wy,a=new Gy("void"),u=new Zy(e.id,i,t);e._engine.totalQueuedPlayers++,e._queue.push({element:t,triggerName:i,transition:o,fromState:s,toState:a,player:u,isFallbackTransition:!0})}})}},t.prototype.removeNode=function(t,e){var n=this,r=this._engine;if(t.childElementCount&&this._signalRemovalForInnerTriggers(t,e,!0),!this.triggerLeaveAnimation(t,e,!0)){var i=!1;if(r.totalAnimations){var o=r.players.length?r.playersByQueriedElement.get(t):[];if(o&&o.length)i=!0;else for(var s=t;s=s.parentNode;)if(r.statesByElement.get(s)){i=!0;break}}this.prepareLeaveAnimationListeners(t),i?r.markElementAsRemoved(this.id,t,!1,e):(r.afterFlush(function(){return n.clearElementCache(t)}),r.destroyInnerAnimations(t),r._onRemovalComplete(t,e))}},t.prototype.insertNode=function(t,e){im(t,this._hostClassName)},t.prototype.drainQueuedTransitions=function(t){var e=this,n=[];return this._queue.forEach(function(r){var i=r.player;if(!i.destroyed){var o=r.element,s=e._elementListeners.get(o);s&&s.forEach(function(e){if(e.name==r.triggerName){var n=Pd(o,r.triggerName,r.fromState.value,r.toState.value);n._data=t,Ad(r.player,e.phase,n,e.callback)}}),i.markedForDestroy?e._engine.afterFlush(function(){i.destroy()}):n.push(r)}}),this._queue=[],n.sort(function(t,n){var r=t.transition.ast.depCount,i=n.transition.ast.depCount;return 0==r||0==i?r-i:e._engine.driver.containsElement(t.element,n.element)?1:-1})},t.prototype.destroy=function(t){this.players.forEach(function(t){return t.destroy()}),this._signalRemovalForInnerTriggers(this.hostElement,t)},t.prototype.elementContainsData=function(t){var e=!1;return this._elementListeners.has(t)&&(e=!0),!!this._queue.find(function(e){return e.element===t})||e},t}(),Xy=function(){function t(t,e){this.driver=t,this._normalizer=e,this.players=[],this.newHostElements=new Map,this.playersByElement=new Map,this.playersByQueriedElement=new Map,this.statesByElement=new Map,this.disabledNodes=new Set,this.totalAnimations=0,this.totalQueuedPlayers=0,this._namespaceLookup={},this._namespaceList=[],this._flushFns=[],this._whenQuietFns=[],this.namespacesByHostElement=new Map,this.collectedEnterElements=[],this.collectedLeaveElements=[],this.onRemovalComplete=function(t,e){}}return t.prototype._onRemovalComplete=function(t,e){this.onRemovalComplete(t,e)},Object.defineProperty(t.prototype,"queuedPlayers",{get:function(){var t=[];return this._namespaceList.forEach(function(e){e.players.forEach(function(e){e.queued&&t.push(e)})}),t},enumerable:!0,configurable:!0}),t.prototype.createNamespace=function(t,e){var n=new Jy(t,e,this);return e.parentNode?this._balanceNamespaceList(n,e):(this.newHostElements.set(e,n),this.collectEnterElement(e)),this._namespaceLookup[t]=n},t.prototype._balanceNamespaceList=function(t,e){var n=this._namespaceList.length-1;if(n>=0){for(var r=!1,i=n;i>=0;i--)if(this.driver.containsElement(this._namespaceList[i].hostElement,e)){this._namespaceList.splice(i+1,0,t),r=!0;break}r||this._namespaceList.splice(0,0,t)}else this._namespaceList.push(t);return this.namespacesByHostElement.set(e,t),t},t.prototype.register=function(t,e){var n=this._namespaceLookup[t];return n||(n=this.createNamespace(t,e)),n},t.prototype.registerTrigger=function(t,e,n){var r=this._namespaceLookup[t];r&&r.register(e,n)&&this.totalAnimations++},t.prototype.destroy=function(t,e){var n=this;if(t){var r=this._fetchNamespace(t);this.afterFlush(function(){n.namespacesByHostElement.delete(r.hostElement),delete n._namespaceLookup[t];var e=n._namespaceList.indexOf(r);e>=0&&n._namespaceList.splice(e,1)}),this.afterFlushAnimationsDone(function(){return r.destroy(e)})}},t.prototype._fetchNamespace=function(t){return this._namespaceLookup[t]},t.prototype.fetchNamespacesByElement=function(t){var e=new Set,n=this.statesByElement.get(t);if(n)for(var r=Object.keys(n),i=0;i<r.length;i++){var o=n[r[i]].namespaceId;if(o){var s=this._fetchNamespace(o);s&&e.add(s)}}return e},t.prototype.trigger=function(t,e,n,r){return!!$y(e)&&(this._fetchNamespace(t).trigger(e,n,r),!0)},t.prototype.insertNode=function(t,e,n,r){if($y(e)){var i=e[Qy];i&&i.setForRemoval&&(i.setForRemoval=!1),t&&this._fetchNamespace(t).insertNode(e,n),r&&this.collectEnterElement(e)}},t.prototype.collectEnterElement=function(t){this.collectedEnterElements.push(t)},t.prototype.markElementAsDisabled=function(t,e){e?this.disabledNodes.has(t)||(this.disabledNodes.add(t),im(t,"ng-animate-disabled")):this.disabledNodes.has(t)&&(this.disabledNodes.delete(t),om(t,"ng-animate-disabled"))},t.prototype.removeNode=function(t,e,n){if($y(e)){var r=t?this._fetchNamespace(t):null;r?r.removeNode(e,n):this.markElementAsRemoved(t,e,!1,n)}else this._onRemovalComplete(e,n)},t.prototype.markElementAsRemoved=function(t,e,n,r){this.collectedLeaveElements.push(e),e[Qy]={namespaceId:t,setForRemoval:r,hasAnimation:n,removedBeforeQueried:!1}},t.prototype.listen=function(t,e,n,r,i){return $y(e)?this._fetchNamespace(t).listen(e,n,r,i):function(){}},t.prototype._buildInstruction=function(t,e,n,r){return t.transition.build(this.driver,t.element,t.fromState.value,t.toState.value,n,r,t.fromState.options,t.toState.options,e)},t.prototype.destroyInnerAnimations=function(t){var e=this,n=this.driver.query(t,".ng-trigger",!0);n.forEach(function(t){return e.destroyActiveAnimationsForElement(t)}),0!=this.playersByQueriedElement.size&&(n=this.driver.query(t,".ng-animating",!0)).forEach(function(t){return e.finishActiveQueriedAnimationOnElement(t)})},t.prototype.destroyActiveAnimationsForElement=function(t){var e=this.playersByElement.get(t);e&&e.forEach(function(t){t.queued?t.markedForDestroy=!0:t.destroy()});var n=this.statesByElement.get(t);n&&Object.keys(n).forEach(function(t){return n[t]=Yy})},t.prototype.finishActiveQueriedAnimationOnElement=function(t){var e=this.playersByQueriedElement.get(t);e&&e.forEach(function(t){return t.finish()})},t.prototype.whenRenderingDone=function(){var t=this;return new Promise(function(e){if(t.players.length)return kd(t.players).onDone(function(){return e()});e()})},t.prototype.processLeaveNode=function(t){var e=this,n=t[Qy];if(n&&n.setForRemoval){if(t[Qy]=Ky,n.namespaceId){this.destroyInnerAnimations(t);var r=this._fetchNamespace(n.namespaceId);r&&r.clearElementCache(t)}this._onRemovalComplete(t,n.setForRemoval)}this.driver.matchesElement(t,".ng-animate-disabled")&&this.markElementAsDisabled(t,!1),this.driver.query(t,".ng-animate-disabled",!0).forEach(function(n){e.markElementAsDisabled(t,!1)})},t.prototype.flush=function(t){var e=this;void 0===t&&(t=-1);var n=[];if(this.newHostElements.size&&(this.newHostElements.forEach(function(t,n){return e._balanceNamespaceList(t,n)}),this.newHostElements.clear()),this.totalAnimations&&this.collectedEnterElements.length)for(var r=0;r<this.collectedEnterElements.length;r++)im(this.collectedEnterElements[r],"ng-star-inserted");if(this._namespaceList.length&&(this.totalQueuedPlayers||this.collectedLeaveElements.length)){var i=[];try{n=this._flushAnimations(i,t)}finally{for(r=0;r<i.length;r++)i[r]()}}else for(r=0;r<this.collectedLeaveElements.length;r++)this.processLeaveNode(this.collectedLeaveElements[r]);if(this.totalQueuedPlayers=0,this.collectedEnterElements.length=0,this.collectedLeaveElements.length=0,this._flushFns.forEach(function(t){return t()}),this._flushFns=[],this._whenQuietFns.length){var o=this._whenQuietFns;this._whenQuietFns=[],n.length?kd(n).onDone(function(){o.forEach(function(t){return t()})}):o.forEach(function(t){return t()})}},t.prototype.reportError=function(t){throw new Error("Unable to process animations due to the following failed trigger transitions\n "+t.join("\n"))},t.prototype._flushAnimations=function(t,e){var n=this,r=new Ey,o=[],s=new Map,a=[],u=new Map,l=new Map,c=new Map,h=new Set;this.disabledNodes.forEach(function(t){h.add(t);for(var e=n.driver.query(t,".ng-animate-queued",!0),r=0;r<e.length;r++)h.add(e[r])});var f=qd(),p=Array.from(this.statesByElement.keys()),d=nm(p,this.collectedEnterElements),y=new Map,m=0;d.forEach(function(t,e){var n="ng-enter"+m++;y.set(e,n),t.forEach(function(t){return im(t,n)})});for(var g=[],v=new Set,_=new Set,b=0;b<this.collectedLeaveElements.length;b++)(F=(V=this.collectedLeaveElements[b])[Qy])&&F.setForRemoval&&(g.push(V),v.add(V),F.hasAnimation?this.driver.query(V,".ng-star-inserted",!0).forEach(function(t){return v.add(t)}):_.add(V));var w=new Map,E=nm(p,Array.from(v));E.forEach(function(t,e){var n="ng-leave"+m++;w.set(e,n),t.forEach(function(t){return im(t,n)})}),t.push(function(){d.forEach(function(t,e){var n=y.get(e);t.forEach(function(t){return om(t,n)})}),E.forEach(function(t,e){var n=w.get(e);t.forEach(function(t){return om(t,n)})}),g.forEach(function(t){n.processLeaveNode(t)})});for(var S=[],C=[],T=this._namespaceList.length-1;T>=0;T--)this._namespaceList[T].drainQueuedTransitions(e).forEach(function(t){var e=t.player;S.push(e);var i=t.element;if(f&&n.driver.containsElement(f,i)){var s=w.get(i),h=y.get(i),p=n._buildInstruction(t,r,h,s);if(p.errors&&p.errors.length)C.push(p);else{if(t.isFallbackTransition)return e.onStart(function(){return ey(i,p.fromStyles)}),e.onDestroy(function(){return ty(i,p.toStyles)}),void o.push(e);p.timelines.forEach(function(t){return t.stretchStartingKeyframe=!0}),r.append(i,p.timelines),a.push({instruction:p,player:e,element:i}),p.queriedElements.forEach(function(t){return Nd(u,t,[]).push(e)}),p.preStyleProps.forEach(function(t,e){var n=Object.keys(t);if(n.length){var r=l.get(e);r||l.set(e,r=new Set),n.forEach(function(t){return r.add(t)})}}),p.postStyleProps.forEach(function(t,e){var n=Object.keys(t),r=c.get(e);r||c.set(e,r=new Set),n.forEach(function(t){return r.add(t)})})}}else e.destroy()});if(C.length){var I=[];C.forEach(function(t){I.push("@"+t.triggerName+" has failed due to:\n"),t.errors.forEach(function(t){return I.push("- "+t+"\n")})}),S.forEach(function(t){return t.destroy()}),this.reportError(I)}var k=new Map,x=new Map;a.forEach(function(t){var e=t.element;r.has(e)&&(x.set(e,e),n._beforeAnimationBuild(t.player.namespaceId,t.instruction,k))}),o.forEach(function(t){var e=t.element;n._getPreviousPlayers(e,!1,t.namespaceId,t.triggerName,null).forEach(function(t){Nd(k,e,[]).push(t),t.destroy()})});var A=g.filter(function(t){return am(t,l,c)}),O=new Map;em(O,this.driver,_,c,Ul).forEach(function(t){am(t,l,c)&&A.push(t)});var P=new Map;d.forEach(function(t,e){em(P,n.driver,new Set(t),l,Ql)}),A.forEach(function(t){var e=O.get(t),n=P.get(t);O.set(t,Object(i.__assign)({},e,n))});var N=[],R=[],D={};a.forEach(function(t){var e=t.element,i=t.player,a=t.instruction;if(r.has(e)){if(h.has(e))return i.onDestroy(function(){return ty(e,a.toStyles)}),void o.push(i);var u=D;if(x.size>1){for(var l=e,c=[];l=l.parentNode;){var f=x.get(l);if(f){u=f;break}c.push(l)}c.forEach(function(t){return x.set(t,u)})}var p=n._buildAnimation(i.namespaceId,a,k,s,P,O);if(i.setRealPlayer(p),u===D)N.push(i);else{var d=n.playersByElement.get(u);d&&d.length&&(i.parentPlayer=kd(d)),o.push(i)}}else ey(e,a.fromStyles),i.onDestroy(function(){return ty(e,a.toStyles)}),R.push(i),h.has(e)&&o.push(i)}),R.forEach(function(t){var e=s.get(t.element);if(e&&e.length){var n=kd(e);t.setRealPlayer(n)}}),o.forEach(function(t){t.parentPlayer?t.syncPlayerEvents(t.parentPlayer):t.destroy()});for(var M=0;M<g.length;M++){var V,F=(V=g[M])[Qy];if(om(V,"ng-leave"),!F||!F.hasAnimation){var j=[];if(u.size){var L=u.get(V);L&&L.length&&j.push.apply(j,L);for(var U=this.driver.query(V,".ng-animating",!0),B=0;B<U.length;B++){var q=u.get(U[B]);q&&q.length&&j.push.apply(j,q)}}var H=j.filter(function(t){return!t.destroyed});H.length?sm(this,V,H):this.processLeaveNode(V)}}return g.length=0,N.forEach(function(t){n.players.push(t),t.onDone(function(){t.destroy();var e=n.players.indexOf(t);n.players.splice(e,1)}),t.play()}),N},t.prototype.elementContainsData=function(t,e){var n=!1,r=e[Qy];return r&&r.setForRemoval&&(n=!0),this.playersByElement.has(e)&&(n=!0),this.playersByQueriedElement.has(e)&&(n=!0),this.statesByElement.has(e)&&(n=!0),this._fetchNamespace(t).elementContainsData(e)||n},t.prototype.afterFlush=function(t){this._flushFns.push(t)},t.prototype.afterFlushAnimationsDone=function(t){this._whenQuietFns.push(t)},t.prototype._getPreviousPlayers=function(t,e,n,r,i){var o=[];if(e){var s=this.playersByQueriedElement.get(t);s&&(o=s)}else{var a=this.playersByElement.get(t);if(a){var u=!i||"void"==i;a.forEach(function(t){t.queued||(u||t.triggerName==r)&&o.push(t)})}}return(n||r)&&(o=o.filter(function(t){return!(n&&n!=t.namespaceId||r&&r!=t.triggerName)})),o},t.prototype._beforeAnimationBuild=function(t,e,n){for(var r=e.element,i=e.isRemovalTransition?void 0:t,o=e.isRemovalTransition?void 0:e.triggerName,s=function(t){var s=t.element,u=s!==r,l=Nd(n,s,[]);a._getPreviousPlayers(s,u,i,o,e.toState).forEach(function(t){var e=t.getRealPlayer();e.beforeDestroy&&e.beforeDestroy(),t.destroy(),l.push(t)})},a=this,u=0,l=e.timelines;u<l.length;u++)s(l[u]);ey(r,e.fromStyles)},t.prototype._buildAnimation=function(t,e,n,r,i,o){var s=this,a=e.triggerName,u=e.element,l=[],c=new Set,h=new Set,f=e.timelines.map(function(e){var f=e.element;c.add(f);var p=f[Qy];if(p&&p.removedBeforeQueried)return new Kl;var d,y,m=f!==u,g=(d=(n.get(f)||Hy).map(function(t){return t.getRealPlayer()}),y=[],function t(e,n){for(var r=0;r<e.length;r++){var i=e[r];i instanceof zl?t(i.players,n):n.push(i)}}(d,y),y).filter(function(t){return!!t.element&&t.element===f}),v=i.get(f),_=o.get(f),b=xd(0,s._normalizer,0,e.keyframes,v,_),w=s._buildPlayer(e,b,g);if(e.subTimeline&&r&&h.add(f),m){var E=new Zy(t,a,f);E.setRealPlayer(w),l.push(E)}return w});l.forEach(function(t){Nd(s.playersByQueriedElement,t.element,[]).push(t),t.onDone(function(){return function(t,e,n){var r;if(t instanceof Map){if(r=t.get(e)){if(r.length){var i=r.indexOf(n);r.splice(i,1)}0==r.length&&t.delete(e)}}else(r=t[e])&&(r.length&&(i=r.indexOf(n),r.splice(i,1)),0==r.length&&delete t[e]);return r}(s.playersByQueriedElement,t.element,t)})}),c.forEach(function(t){return im(t,"ng-animating")});var p=kd(f);return p.onDestroy(function(){c.forEach(function(t){return om(t,"ng-animating")}),ty(u,e.toStyles)}),h.forEach(function(t){Nd(r,t,[]).push(p)}),p},t.prototype._buildPlayer=function(t,e,n){return e.length>0?this.driver.animate(t.element,e,t.duration,t.delay,t.easing,n):new Kl},t}(),Zy=function(){function t(t,e,n){this.namespaceId=t,this.triggerName=e,this.element=n,this._player=new Kl,this._containsRealPlayer=!1,this._queuedCallbacks={},this.destroyed=!1,this.markedForDestroy=!1,this.queued=!0}return t.prototype.setRealPlayer=function(t){var e=this;this._containsRealPlayer||(this._player=t,Object.keys(this._queuedCallbacks).forEach(function(n){e._queuedCallbacks[n].forEach(function(e){return Ad(t,n,void 0,e)})}),this._queuedCallbacks={},this._containsRealPlayer=!0,this.queued=!1)},t.prototype.getRealPlayer=function(){return this._player},t.prototype.syncPlayerEvents=function(t){var e=this,n=this._player;n.triggerCallback&&t.onStart(function(){return n.triggerCallback("start")}),t.onDone(function(){return e.finish()}),t.onDestroy(function(){return e.destroy()})},t.prototype._queueEvent=function(t,e){Nd(this._queuedCallbacks,t,[]).push(e)},t.prototype.onDone=function(t){this.queued&&this._queueEvent("done",t),this._player.onDone(t)},t.prototype.onStart=function(t){this.queued&&this._queueEvent("start",t),this._player.onStart(t)},t.prototype.onDestroy=function(t){this.queued&&this._queueEvent("destroy",t),this._player.onDestroy(t)},t.prototype.init=function(){this._player.init()},t.prototype.hasStarted=function(){return!this.queued&&this._player.hasStarted()},t.prototype.play=function(){!this.queued&&this._player.play()},t.prototype.pause=function(){!this.queued&&this._player.pause()},t.prototype.restart=function(){!this.queued&&this._player.restart()},t.prototype.finish=function(){this._player.finish()},t.prototype.destroy=function(){this.destroyed=!0,this._player.destroy()},t.prototype.reset=function(){!this.queued&&this._player.reset()},t.prototype.setPosition=function(t){this.queued||this._player.setPosition(t)},t.prototype.getPosition=function(){return this.queued?0:this._player.getPosition()},Object.defineProperty(t.prototype,"totalTime",{get:function(){return this._player.totalTime},enumerable:!0,configurable:!0}),t.prototype.triggerCallback=function(t){var e=this._player;e.triggerCallback&&e.triggerCallback(t)},t}();function $y(t){return t&&1===t.nodeType}function tm(t,e){var n=t.style.display;return t.style.display=null!=e?e:"none",n}function em(t,e,n,r,i){var o=[];n.forEach(function(t){return o.push(tm(t))});var s=[];r.forEach(function(n,r){var o={};n.forEach(function(t){var n=o[t]=e.computeStyle(r,t,i);n&&0!=n.length||(r[Qy]=zy,s.push(r))}),t.set(r,o)});var a=0;return n.forEach(function(t){return tm(t,o[a++])}),s}function nm(t,e){var n=new Map;if(t.forEach(function(t){return n.set(t,[])}),0==e.length)return n;var r=new Set(e),i=new Map;return e.forEach(function(t){var e=function t(e){if(!e)return 1;var o=i.get(e);if(o)return o;var s=e.parentNode;return o=n.has(s)?s:r.has(s)?1:t(s),i.set(e,o),o}(t);1!==e&&n.get(e).push(t)}),n}var rm="$$classes";function im(t,e){if(t.classList)t.classList.add(e);else{var n=t[rm];n||(n=t[rm]={}),n[e]=!0}}function om(t,e){if(t.classList)t.classList.remove(e);else{var n=t[rm];n&&delete n[e]}}function sm(t,e,n){kd(n).onDone(function(){return t.processLeaveNode(e)})}function am(t,e,n){var r=n.get(t);if(!r)return!1;var i=e.get(t);return i?r.forEach(function(t){return i.add(t)}):e.set(t,r),n.delete(t),!0}var um=function(){function t(t,e){var n=this;this._driver=t,this._triggerCache={},this.onRemovalComplete=function(t,e){},this._transitionEngine=new Xy(t,e),this._timelineEngine=new qy(t,e),this._transitionEngine.onRemovalComplete=function(t,e){return n.onRemovalComplete(t,e)}}return t.prototype.registerTrigger=function(t,e,n,r,i){var o=t+"-"+r,s=this._triggerCache[o];if(!s){var a=[],u=yy(this._driver,i,a);if(a.length)throw new Error('The animation trigger "'+r+'" has failed to build due to the following errors:\n - '+a.join("\n - "));s=function(t,e){return new Ly(t,e)}(r,u),this._triggerCache[o]=s}this._transitionEngine.registerTrigger(e,r,s)},t.prototype.register=function(t,e){this._transitionEngine.register(t,e)},t.prototype.destroy=function(t,e){this._transitionEngine.destroy(t,e)},t.prototype.onInsert=function(t,e,n,r){this._transitionEngine.insertNode(t,e,n,r)},t.prototype.onRemove=function(t,e,n){this._transitionEngine.removeNode(t,e,n)},t.prototype.disableAnimations=function(t,e){this._transitionEngine.markElementAsDisabled(t,e)},t.prototype.process=function(t,e,n,r){if("@"==n.charAt(0)){var i=Rd(n);this._timelineEngine.command(i[0],e,i[1],r)}else this._transitionEngine.trigger(t,e,n,r)},t.prototype.listen=function(t,e,n,r,i){if("@"==n.charAt(0)){var o=Rd(n);return this._timelineEngine.listen(o[0],e,o[1],i)}return this._transitionEngine.listen(t,e,n,r,i)},t.prototype.flush=function(t){void 0===t&&(t=-1),this._transitionEngine.flush(t)},Object.defineProperty(t.prototype,"players",{get:function(){return this._transitionEngine.players.concat(this._timelineEngine.players)},enumerable:!0,configurable:!0}),t.prototype.whenRenderingDone=function(){return this._transitionEngine.whenRenderingDone()},t}(),lm=function(){function t(t,e,n,r){void 0===r&&(r=[]);var i=this;this.element=t,this.keyframes=e,this.options=n,this.previousPlayers=r,this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this._initialized=!1,this._finished=!1,this._started=!1,this._destroyed=!1,this.time=0,this.parentPlayer=null,this.previousStyles={},this.currentSnapshot={},this._duration=n.duration,this._delay=n.delay||0,this.time=this._duration+this._delay,(0===this._duration||0===this._delay)&&r.forEach(function(t){var e=t.currentSnapshot;Object.keys(e).forEach(function(t){return i.previousStyles[t]=e[t]})})}return t.prototype._onFinish=function(){this._finished||(this._finished=!0,this._onDoneFns.forEach(function(t){return t()}),this._onDoneFns=[])},t.prototype.init=function(){this._buildPlayer(),this._preparePlayerBeforeStart()},t.prototype._buildPlayer=function(){var t=this;if(!this._initialized){this._initialized=!0;var e=this.keyframes.map(function(t){return $d(t,!1)}),n=Object.keys(this.previousStyles);if(n.length&&e.length){var r=e[0],i=[];if(n.forEach(function(e){r.hasOwnProperty(e)||i.push(e),r[e]=t.previousStyles[e]}),i.length)for(var o=this,s=function(){var t=e[a];i.forEach(function(e){t[e]=cm(o.element,e)})},a=1;a<e.length;a++)s()}this.domPlayer=this._triggerWebAnimation(this.element,e,this.options),this._finalKeyframe=e.length?e[e.length-1]:{},this.domPlayer.addEventListener("finish",function(){return t._onFinish()})}},t.prototype._preparePlayerBeforeStart=function(){this._delay?this._resetDomPlayerState():this.domPlayer.pause()},t.prototype._triggerWebAnimation=function(t,e,n){return t.animate(e,n)},t.prototype.onStart=function(t){this._onStartFns.push(t)},t.prototype.onDone=function(t){this._onDoneFns.push(t)},t.prototype.onDestroy=function(t){this._onDestroyFns.push(t)},t.prototype.play=function(){this._buildPlayer(),this.hasStarted()||(this._onStartFns.forEach(function(t){return t()}),this._onStartFns=[],this._started=!0),this.domPlayer.play()},t.prototype.pause=function(){this.init(),this.domPlayer.pause()},t.prototype.finish=function(){this.init(),this._onFinish(),this.domPlayer.finish()},t.prototype.reset=function(){this._resetDomPlayerState(),this._destroyed=!1,this._finished=!1,this._started=!1},t.prototype._resetDomPlayerState=function(){this.domPlayer&&this.domPlayer.cancel()},t.prototype.restart=function(){this.reset(),this.play()},t.prototype.hasStarted=function(){return this._started},t.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this._resetDomPlayerState(),this._onFinish(),this._onDestroyFns.forEach(function(t){return t()}),this._onDestroyFns=[])},t.prototype.setPosition=function(t){this.domPlayer.currentTime=t*this.time},t.prototype.getPosition=function(){return this.domPlayer.currentTime/this.time},Object.defineProperty(t.prototype,"totalTime",{get:function(){return this._delay+this._duration},enumerable:!0,configurable:!0}),t.prototype.beforeDestroy=function(){var t=this,e={};this.hasStarted()&&Object.keys(this._finalKeyframe).forEach(function(n){"offset"!=n&&(e[n]=t._finished?t._finalKeyframe[n]:cm(t.element,n))}),this.currentSnapshot=e},t.prototype.triggerCallback=function(t){var e="start"==t?this._onStartFns:this._onDoneFns;e.forEach(function(t){return t()}),e.length=0},t}();function cm(t,e){return window.getComputedStyle(t)[e]}var hm=function(){function t(){}return t.prototype.validateStyleProperty=function(t){return Bd(t)},t.prototype.matchesElement=function(t,e){return Hd(t,e)},t.prototype.containsElement=function(t,e){return Kd(t,e)},t.prototype.query=function(t,e,n){return zd(t,e,n)},t.prototype.computeStyle=function(t,e,n){return window.getComputedStyle(t)[e]},t.prototype.animate=function(t,e,n,r,i,o){void 0===o&&(o=[]);var s={duration:n,delay:r,fill:0==r?"both":"forwards"};i&&(s.easing=i);var a=o.filter(function(t){return t instanceof lm});return new lm(t,e,s,a)},t}(),fm=function(t){function e(e,n){var i=t.call(this)||this;return i._nextAnimationId=0,i._renderer=e.createRenderer(n.body,{id:"0",encapsulation:r.N.None,styles:[],data:{animation:[]}}),i}return Object(i.__extends)(e,t),e.prototype.build=function(t){var e=this._nextAnimationId.toString();this._nextAnimationId++;var n=Array.isArray(t)?Bl(t):t;return ym(this._renderer,null,e,"register",[n]),new pm(e,this._renderer)},e}(Ll),pm=function(t){function e(e,n){var r=t.call(this)||this;return r._id=e,r._renderer=n,r}return Object(i.__extends)(e,t),e.prototype.create=function(t,e){return new dm(this._id,t,e||{},this._renderer)},e}(function(){}),dm=function(){function t(t,e,n,r){this.id=t,this.element=e,this._renderer=r,this.parentPlayer=null,this._started=!1,this.totalTime=0,this._command("create",n)}return t.prototype._listen=function(t,e){return this._renderer.listen(this.element,"@@"+this.id+":"+t,e)},t.prototype._command=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return ym(this._renderer,this.element,this.id,t,e)},t.prototype.onDone=function(t){this._listen("done",t)},t.prototype.onStart=function(t){this._listen("start",t)},t.prototype.onDestroy=function(t){this._listen("destroy",t)},t.prototype.init=function(){this._command("init")},t.prototype.hasStarted=function(){return this._started},t.prototype.play=function(){this._command("play"),this._started=!0},t.prototype.pause=function(){this._command("pause")},t.prototype.restart=function(){this._command("restart")},t.prototype.finish=function(){this._command("finish")},t.prototype.destroy=function(){this._command("destroy")},t.prototype.reset=function(){this._command("reset")},t.prototype.setPosition=function(t){this._command("setPosition",t)},t.prototype.getPosition=function(){return 0},t}();function ym(t,e,n,r,i){return t.setProperty(e,"@@"+n+":"+r,i)}var mm=function(){function t(t,e,n){this.delegate=t,this.engine=e,this._zone=n,this._currentId=0,this._microtaskId=1,this._animationCallbacksBuffer=[],this._rendererCache=new Map,this._cdRecurDepth=0,e.onRemovalComplete=function(t,e){e&&e.parentNode(t)&&e.removeChild(t.parentNode,t)}}return t.prototype.createRenderer=function(t,e){var n=this,r=this.delegate.createRenderer(t,e);if(!(t&&e&&e.data&&e.data.animation)){var i=this._rendererCache.get(r);return i||(i=new gm("",r,this.engine),this._rendererCache.set(r,i)),i}var o=e.id,s=e.id+"-"+this._currentId;return this._currentId++,this.engine.register(s,t),e.data.animation.forEach(function(e){return n.engine.registerTrigger(o,s,t,e.name,e)}),new vm(this,s,r,this.engine)},t.prototype.begin=function(){this._cdRecurDepth++,this.delegate.begin&&this.delegate.begin()},t.prototype._scheduleCountTask=function(){var t=this;Zone.current.scheduleMicroTask("incremenet the animation microtask",function(){return t._microtaskId++})},t.prototype.scheduleListenerCallback=function(t,e,n){var r=this;t>=0&&t<this._microtaskId?this._zone.run(function(){return e(n)}):(0==this._animationCallbacksBuffer.length&&Promise.resolve(null).then(function(){r._zone.run(function(){r._animationCallbacksBuffer.forEach(function(t){(0,t[0])(t[1])}),r._animationCallbacksBuffer=[]})}),this._animationCallbacksBuffer.push([e,n]))},t.prototype.end=function(){var t=this;this._cdRecurDepth--,0==this._cdRecurDepth&&this._zone.runOutsideAngular(function(){t._scheduleCountTask(),t.engine.flush(t._microtaskId)}),this.delegate.end&&this.delegate.end()},t.prototype.whenRenderingDone=function(){return this.engine.whenRenderingDone()},t}(),gm=function(){function t(t,e,n){this.namespaceId=t,this.delegate=e,this.engine=n,this.destroyNode=this.delegate.destroyNode?function(t){return e.destroyNode(t)}:null}return Object.defineProperty(t.prototype,"data",{get:function(){return this.delegate.data},enumerable:!0,configurable:!0}),t.prototype.destroy=function(){this.engine.destroy(this.namespaceId,this.delegate),this.delegate.destroy()},t.prototype.createElement=function(t,e){return this.delegate.createElement(t,e)},t.prototype.createComment=function(t){return this.delegate.createComment(t)},t.prototype.createText=function(t){return this.delegate.createText(t)},t.prototype.appendChild=function(t,e){this.delegate.appendChild(t,e),this.engine.onInsert(this.namespaceId,e,t,!1)},t.prototype.insertBefore=function(t,e,n){this.delegate.insertBefore(t,e,n),this.engine.onInsert(this.namespaceId,e,t,!0)},t.prototype.removeChild=function(t,e){this.engine.onRemove(this.namespaceId,e,this.delegate)},t.prototype.selectRootElement=function(t){return this.delegate.selectRootElement(t)},t.prototype.parentNode=function(t){return this.delegate.parentNode(t)},t.prototype.nextSibling=function(t){return this.delegate.nextSibling(t)},t.prototype.setAttribute=function(t,e,n,r){this.delegate.setAttribute(t,e,n,r)},t.prototype.removeAttribute=function(t,e,n){this.delegate.removeAttribute(t,e,n)},t.prototype.addClass=function(t,e){this.delegate.addClass(t,e)},t.prototype.removeClass=function(t,e){this.delegate.removeClass(t,e)},t.prototype.setStyle=function(t,e,n,r){this.delegate.setStyle(t,e,n,r)},t.prototype.removeStyle=function(t,e,n){this.delegate.removeStyle(t,e,n)},t.prototype.setProperty=function(t,e,n){"@"==e.charAt(0)&&"@.disabled"==e?this.disableAnimations(t,!!n):this.delegate.setProperty(t,e,n)},t.prototype.setValue=function(t,e){this.delegate.setValue(t,e)},t.prototype.listen=function(t,e,n){return this.delegate.listen(t,e,n)},t.prototype.disableAnimations=function(t,e){this.engine.disableAnimations(t,e)},t}(),vm=function(t){function e(e,n,r,i){var o=t.call(this,n,r,i)||this;return o.factory=e,o.namespaceId=n,o}return Object(i.__extends)(e,t),e.prototype.setProperty=function(t,e,n){"@"==e.charAt(0)?"."==e.charAt(1)&&"@.disabled"==e?this.disableAnimations(t,n=void 0===n||!!n):this.engine.process(this.namespaceId,t,e.substr(1),n):this.delegate.setProperty(t,e,n)},e.prototype.listen=function(t,e,n){var r,i,o,s=this;if("@"==e.charAt(0)){var a=function(t){switch(t){case"body":return document.body;case"document":return document;case"window":return window;default:return t}}(t),u=e.substr(1),l="";return"@"!=u.charAt(0)&&(u=(i=u,o=i.indexOf("."),r=[i.substring(0,o),i.substr(o+1)])[0],l=r[1]),this.engine.listen(this.namespaceId,a,u,l,function(t){s.factory.scheduleListenerCallback(t._data||-1,n,t)})}return this.delegate.listen(t,e,n)},e}(gm),_m=function(t){function e(e,n){return t.call(this,e,n)||this}return Object(i.__extends)(e,t),e}(um);function bm(){return"undefined"!=typeof Element&&"function"==typeof Element.prototype.animate?new hm:new Qd}function wm(){return new Ry}function Em(t,e,n){return new mm(t,e,n)}var Sm=function(){},Cm=r._0(qn,[Wl],function(t){return r._11([r._12(512,r.j,r.W,[[8,[hc,vc,Ec,Oc,Id]],[3,r.j],r.v]),r._12(5120,r.s,r._20,[[3,r.s]]),r._12(4608,j,L,[r.s,[2,F]]),r._12(5120,r.c,r._5,[]),r._12(5120,r.q,r._13,[]),r._12(5120,r.r,r._15,[]),r._12(4608,we,Ee,[Z]),r._12(6144,r.E,null,[we]),r._12(4608,Qt,Gt,[]),r._12(5120,_t,function(t,e,n,r,i){return[new Kt(t,e),new Xt(n),new Wt(r,i)]},[Z,r.x,Z,Z,Qt]),r._12(4608,bt,bt,[_t,r.x]),r._12(135680,St,St,[Z]),r._12(4608,Ot,Ot,[bt,St]),r._12(5120,Gd,bm,[]),r._12(5120,Ny,wm,[]),r._12(4608,um,_m,[Gd,Ny]),r._12(5120,r.C,Em,[Ot,um,r.x]),r._12(6144,Et,null,[St]),r._12(4608,r.K,r.K,[r.x]),r._12(4608,ht,ht,[Z]),r._12(4608,yt,yt,[Z]),r._12(4608,Hn,Hn,[]),r._12(4608,Yn,Jn,[]),r._12(5120,Xn,br,[]),r._12(4608,ur,ur,[Hn,Yn,Xn]),r._12(4608,lr,cr,[]),r._12(5120,_r,wr,[ur,lr]),r._12(4608,Fn,Fn,[]),r._12(4608,Je,Je,[]),r._12(4608,Vc,Vc,[r.x]),r._12(5120,Yr,Jr,[Wr,ti]),r._12(4608,gi,gi,[Yr,[2,yi]]),r._12(4608,Ll,fm,[r.C,ut]),r._12(5120,kf,Mp,[fp]),r._12(4608,Cp,Cp,[]),r._12(6144,Ep,null,[Cp]),r._12(135680,Tp,Tp,[fp,r.u,r.i,r.p,Ep]),r._12(4608,Sp,Sp,[]),r._12(5120,Lp,jp,[Vp]),r._12(5120,r.b,function(t){return[t]},[Lp]),r._12(4608,Sr,Sr,[_r]),r._12(4608,Pl,Pl,[Sr,_r,gi]),r._12(4608,Rl,Rl,[]),r._12(512,X,X,[]),r._12(1024,r.l,Pe,[]),r._12(1024,r.w,function(){return[Ap()]},[]),r._12(512,Vp,Vp,[r.p]),r._12(1024,r.d,function(t,e){return[(n=t,mt("probe",vt),mt("coreTokens",Object(i.__assign)({},gt,(n||[]).reduce(function(t,e){return t[e.name]=e.token,t},{}))),function(){return vt}),Fp(e)];var n},[[2,r.w],Vp]),r._12(512,r.e,r.e,[[2,r.d]]),r._12(131584,r.g,r.g,[r.x,r.X,r.p,r.l,r.j,r.e]),r._12(512,r.f,r.f,[r.g]),r._12(512,Ne,Ne,[[3,Ne]]),r._12(512,Er,Er,[]),r._12(512,Ln,Ln,[]),r._12(512,Bn,Bn,[]),r._12(512,jc,jc,[]),r._12(512,ei,ei,[]),r._12(512,Ol,Ol,[]),r._12(1024,kp,Np,[[3,fp]]),r._12(512,Xh,Zh,[]),r._12(512,_p,_p,[]),r._12(256,Ip,{},[]),r._12(1024,C,Pp,[E,[2,T],Ip]),r._12(512,I,I,[C]),r._12(512,r.i,r.i,[]),r._12(512,r.u,r.H,[r.i,[2,r.I]]),r._12(1024,sp,function(){return[[{path:"",redirectTo:"home",pathMatch:"full"},{path:"home",component:Yl},{path:"history",component:fc},{path:"about",component:_c},{path:"settings",component:Cc}]]},[]),r._12(1024,fp,Dp,[r.g,Xh,_p,I,r.p,r.u,r.i,sp,Ip,[2,up],[2,ip]]),r._12(512,Op,Op,[[2,kp],[2,fp]]),r._12(512,Un,Un,[]),r._12(512,Sm,Sm,[]),r._12(512,qn,qn,[]),r._12(256,Wr,{apiKey:"AIzaSyAyw4O0GoZU_AuHKqN17_4YvR_dztOM_qY",authDomain:"k-189316.firebaseapp.com",databaseURL:"https://k-189316.firebaseio.com",projectId:"youtubek-189316",storageBucket:"youtubek-189316.appspot.com",messagingSenderId:"657381104430"},[]),r._12(256,ti,void 0,[])])});Object(r.Q)(),Oe().bootstrapModuleFactory(Cm)},"e9+7":function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){for(var e=[],n=0,r=0;r<t.length;r++){var i=t.charCodeAt(r);i<128?e[n++]=i:i<2048?(e[n++]=i>>6|192,e[n++]=63&i|128):55296==(64512&i)&&r+1<t.length&&56320==(64512&t.charCodeAt(r+1))?(i=65536+((1023&i)<<10)+(1023&t.charCodeAt(++r)),e[n++]=i>>18|240,e[n++]=i>>12&63|128,e[n++]=i>>6&63|128,e[n++]=63&i|128):(e[n++]=i>>12|224,e[n++]=i>>6&63|128,e[n++]=63&i|128)}return e};e.base64={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:"function"==typeof atob,encodeByteArray:function(t,e){if(!Array.isArray(t))throw Error("encodeByteArray takes an array as a parameter");this.init_();for(var n=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[],i=0;i<t.length;i+=3){var o=t[i],s=i+1<t.length,a=s?t[i+1]:0,u=i+2<t.length,l=u?t[i+2]:0,c=(15&a)<<2|l>>6,h=63&l;u||(h=64,s||(c=64)),r.push(n[o>>2],n[(3&o)<<4|a>>4],n[c],n[h])}return r.join("")},encodeString:function(t,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(t):this.encodeByteArray(r(t),e)},decodeString:function(t,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(t):function(t){for(var e=[],n=0,r=0;n<t.length;){var i=t[n++];if(i<128)e[r++]=String.fromCharCode(i);else if(i>191&&i<224){var o=t[n++];e[r++]=String.fromCharCode((31&i)<<6|63&o)}else if(i>239&&i<365){var s=((7&i)<<18|(63&(o=t[n++]))<<12|(63&(a=t[n++]))<<6|63&t[n++])-65536;e[r++]=String.fromCharCode(55296+(s>>10)),e[r++]=String.fromCharCode(56320+(1023&s))}else{o=t[n++];var a=t[n++];e[r++]=String.fromCharCode((15&i)<<12|(63&o)<<6|63&a)}}return e.join("")}(this.decodeStringToByteArray(t,e))},decodeStringToByteArray:function(t,e){this.init_();for(var n=e?this.charToByteMapWebSafe_:this.charToByteMap_,r=[],i=0;i<t.length;){var o=n[t.charAt(i++)],s=i<t.length?n[t.charAt(i)]:0,a=++i<t.length?n[t.charAt(i)]:64,u=++i<t.length?n[t.charAt(i)]:64;if(++i,null==o||null==s||null==a||null==u)throw Error();r.push(o<<2|s>>4),64!=a&&(r.push(s<<4&240|a>>2),64!=u&&r.push(a<<6&192|u))}return r},init_:function(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(var t=0;t<this.ENCODED_VALS.length;t++)this.byteToCharMap_[t]=this.ENCODED_VALS.charAt(t),this.charToByteMap_[this.byteToCharMap_[t]]=t,this.byteToCharMapWebSafe_[t]=this.ENCODED_VALS_WEBSAFE.charAt(t),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[t]]=t,t>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(t)]=t,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(t)]=t)}}},e.base64Encode=function(t){var n=r(t);return e.base64.encodeByteArray(n,!0)},e.base64Decode=function(t){try{return e.base64.decodeString(t,!0)}catch(t){console.error("base64Decode failed: ",t)}return null}},fRUx:function(t,e){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(n=window)}t.exports=n},grVA:function(t,e,n){"use strict";n.d(e,"a",function(){return r});var r={closed:!0,next:function(t){},error:function(t){throw t},complete:function(){}}},jaVc:function(t,e,n){"use strict";n.d(e,"a",function(){return i});var r=n("6Xbx"),i=function(t){function e(e,n){t.call(this),this.subject=e,this.subscriber=n,this.closed=!1}return Object(r.__extends)(e,t),e.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var t=this.subject,e=t.observers;if(this.subject=null,e&&0!==e.length&&!t.isStopped&&!t.closed){var n=e.indexOf(this.subscriber);-1!==n&&e.splice(n,1)}}},e}(n("qLnt").a)},kQVV:function(t,e,n){"use strict";n.d(e,"a",function(){return r});var r=function(t){return t&&"number"==typeof t.length}},lI6h:function(t,e,n){"use strict";n.d(e,"a",function(){return i});var r=n("6Xbx"),i=function(t){function e(){t.apply(this,arguments)}return Object(r.__extends)(e,t),e.prototype.notifyNext=function(t,e,n,r,i){this.destination.next(e)},e.prototype.notifyError=function(t,e){this.destination.error(t)},e.prototype.notifyComplete=function(t){this.destination.complete()},e}(n("E9/g").a)},mHG6:function(t,e,n){"use strict";e.a=function(t){return t&&"function"!=typeof t.subscribe&&"function"==typeof t.then}},mz3w:function(t,e,n){"use strict";n.d(e,"a",function(){return r});var r=function(t){var e,r=n("xIGM").a.Symbol;return"function"==typeof r?r.observable?e=r.observable:(e=r("observable"),r.observable=e):e="@@observable",e}()},qLnt:function(t,e,n){"use strict";var r,i=n("1j/l"),o=n("NGRF"),s=n("B1iP"),a={e:{}};function u(){try{return r.apply(this,arguments)}catch(t){return a.e=t,a}}function l(t){return r=t,u}var c=n("6Xbx"),h=function(t){function e(e){t.call(this),this.errors=e;var n=Error.call(this,e?e.length+" errors occurred during unsubscription:\n  "+e.map(function(t,e){return e+1+") "+t.toString()}).join("\n  "):"");this.name=n.name="UnsubscriptionError",this.stack=n.stack,this.message=n.message}return Object(c.__extends)(e,t),e}(Error);n.d(e,"a",function(){return f});var f=function(){function t(t){this.closed=!1,this._parent=null,this._parents=null,this._subscriptions=null,t&&(this._unsubscribe=t)}var e;return t.prototype.unsubscribe=function(){var t,e=!1;if(!this.closed){var n=this._parent,r=this._parents,u=this._unsubscribe,c=this._subscriptions;this.closed=!0,this._parent=null,this._parents=null,this._subscriptions=null;for(var f=-1,d=r?r.length:0;n;)n.remove(this),n=++f<d&&r[f]||null;if(Object(s.a)(u)&&l(u).call(this)===a&&(e=!0,t=t||(a.e instanceof h?p(a.e.errors):[a.e])),Object(i.a)(c))for(f=-1,d=c.length;++f<d;){var y=c[f];if(Object(o.a)(y)&&l(y.unsubscribe).call(y)===a){e=!0,t=t||[];var m=a.e;m instanceof h?t=t.concat(p(m.errors)):t.push(m)}}if(e)throw new h(t)}},t.prototype.add=function(e){if(!e||e===t.EMPTY)return t.EMPTY;if(e===this)return this;var n=e;switch(typeof e){case"function":n=new t(e);case"object":if(n.closed||"function"!=typeof n.unsubscribe)return n;if(this.closed)return n.unsubscribe(),n;if("function"!=typeof n._addParent){var r=n;(n=new t)._subscriptions=[r]}break;default:throw new Error("unrecognized teardown "+e+" added to Subscription.")}return(this._subscriptions||(this._subscriptions=[])).push(n),n._addParent(this),n},t.prototype.remove=function(t){var e=this._subscriptions;if(e){var n=e.indexOf(t);-1!==n&&e.splice(n,1)}},t.prototype._addParent=function(t){var e=this._parent,n=this._parents;e&&e!==t?n?-1===n.indexOf(t)&&n.push(t):this._parents=[t]:this._parent=t},t.EMPTY=((e=new t).closed=!0,e),t}();function p(t){return t.reduce(function(t,e){return t.concat(e instanceof h?e.errors:e)},[])}},qgI0:function(t,e,n){"use strict";var r=n("xIGM"),i=n("kQVV"),o=n("mHG6"),s=n("NGRF"),a=n("AP4T"),u=n("X3fp"),l=n("6Xbx"),c=function(t){function e(e,n,r){t.call(this),this.parent=e,this.outerValue=n,this.outerIndex=r,this.index=0}return Object(l.__extends)(e,t),e.prototype._next=function(t){this.parent.notifyNext(this.outerValue,t,this.outerIndex,this.index++,this)},e.prototype._error=function(t){this.parent.notifyError(t,this),this.unsubscribe()},e.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},e}(n("E9/g").a),h=n("mz3w");e.a=function(t,e,n,l){var f=new c(t,n,l);if(f.closed)return null;if(e instanceof a.a)return e._isScalar?(f.next(e.value),f.complete(),null):(f.syncErrorThrowable=!0,e.subscribe(f));if(Object(i.a)(e)){for(var p=0,d=e.length;p<d&&!f.closed;p++)f.next(e[p]);f.closed||f.complete()}else{if(Object(o.a)(e))return e.then(function(t){f.closed||(f.next(t),f.complete())},function(t){return f.error(t)}).then(null,function(t){r.a.setTimeout(function(){throw t})}),f;if(e&&"function"==typeof e[u.a])for(var y=e[u.a]();;){var m=y.next();if(m.done){f.complete();break}if(f.next(m.value),f.closed)break}else if(e&&"function"==typeof e[h.a]){var g=e[h.a]();if("function"==typeof g.subscribe)return g.subscribe(new c(t,n,l));f.error(new TypeError("Provided object does not correctly implement Symbol.observable"))}else{var v=Object(s.a)(e)?"an invalid object":"'"+e+"'";f.error(new TypeError("You provided "+v+" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable."))}}return null}},uzI5:function(t,e,n){"use strict";var r=n("6Xbx").__extends;Object.defineProperty(e,"__esModule",{value:!0});var i=n("32XG");e.Sha1=function(t){function e(){var e=t.call(this)||this;e.chain_=[],e.buf_=[],e.W_=[],e.pad_=[],e.inbuf_=0,e.total_=0,e.blockSize=64,e.pad_[0]=128;for(var n=1;n<e.blockSize;++n)e.pad_[n]=0;return e.reset(),e}return r(e,t),e.prototype.reset=function(){this.chain_[0]=1732584193,this.chain_[1]=4023233417,this.chain_[2]=2562383102,this.chain_[3]=271733878,this.chain_[4]=3285377520,this.inbuf_=0,this.total_=0},e.prototype.compress_=function(t,e){e||(e=0);var n=this.W_;if("string"==typeof t)for(var r=0;r<16;r++)n[r]=t.charCodeAt(e)<<24|t.charCodeAt(e+1)<<16|t.charCodeAt(e+2)<<8|t.charCodeAt(e+3),e+=4;else for(r=0;r<16;r++)n[r]=t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3],e+=4;for(r=16;r<80;r++)n[r]=4294967295&((h=n[r-3]^n[r-8]^n[r-14]^n[r-16])<<1|h>>>31);var i,o,s=this.chain_[0],a=this.chain_[1],u=this.chain_[2],l=this.chain_[3],c=this.chain_[4];for(r=0;r<80;r++){r<40?r<20?(i=l^a&(u^l),o=1518500249):(i=a^u^l,o=1859775393):r<60?(i=a&u|l&(a|u),o=2400959708):(i=a^u^l,o=3395469782);var h=(s<<5|s>>>27)+i+c+o+n[r]&4294967295;c=l,l=u,u=4294967295&(a<<30|a>>>2),a=s,s=h}this.chain_[0]=this.chain_[0]+s&4294967295,this.chain_[1]=this.chain_[1]+a&4294967295,this.chain_[2]=this.chain_[2]+u&4294967295,this.chain_[3]=this.chain_[3]+l&4294967295,this.chain_[4]=this.chain_[4]+c&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.buf_,o=this.inbuf_;r<e;){if(0==o)for(;r<=n;)this.compress_(t,r),r+=this.blockSize;if("string"==typeof t){for(;r<e;)if(i[o]=t.charCodeAt(r),++r,++o==this.blockSize){this.compress_(i),o=0;break}}else for(;r<e;)if(i[o]=t[r],++r,++o==this.blockSize){this.compress_(i),o=0;break}}this.inbuf_=o,this.total_+=e}},e.prototype.digest=function(){var t=[],e=8*this.total_;this.update(this.pad_,this.inbuf_<56?56-this.inbuf_:this.blockSize-(this.inbuf_-56));for(var n=this.blockSize-1;n>=56;n--)this.buf_[n]=255&e,e/=256;this.compress_(this.buf_);var r=0;for(n=0;n<5;n++)for(var i=24;i>=0;i-=8)t[r]=this.chain_[n]>>i&255,++r;return t},e}(i.Hash)},wP3s:function(t,e,n){"use strict";e.a=function(t,e,n){return void 0===n&&(n=Number.POSITIVE_INFINITY),function(r){return"number"==typeof e&&(n=e,e=null),r.lift(new s(t,e,n))}};var r=n("6Xbx"),i=n("qgI0"),o=n("lI6h"),s=function(){function t(t,e,n){void 0===n&&(n=Number.POSITIVE_INFINITY),this.project=t,this.resultSelector=e,this.concurrent=n}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.project,this.resultSelector,this.concurrent))},t}(),a=function(t){function e(e,n,r,i){void 0===i&&(i=Number.POSITIVE_INFINITY),t.call(this,e),this.project=n,this.resultSelector=r,this.concurrent=i,this.hasCompleted=!1,this.buffer=[],this.active=0,this.index=0}return Object(r.__extends)(e,t),e.prototype._next=function(t){this.active<this.concurrent?this._tryNext(t):this.buffer.push(t)},e.prototype._tryNext=function(t){var e,n=this.index++;try{e=this.project(t,n)}catch(t){return void this.destination.error(t)}this.active++,this._innerSub(e,t,n)},e.prototype._innerSub=function(t,e,n){this.add(Object(i.a)(this,t,e,n))},e.prototype._complete=function(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&this.destination.complete()},e.prototype.notifyNext=function(t,e,n,r,i){this.resultSelector?this._notifyResultSelector(t,e,n,r):this.destination.next(e)},e.prototype._notifyResultSelector=function(t,e,n,r){var i;try{i=this.resultSelector(t,e,n,r)}catch(t){return void this.destination.error(t)}this.destination.next(i)},e.prototype.notifyComplete=function(t){var e=this.buffer;this.remove(t),this.active--,e.length>0?this._next(e.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},e}(o.a)},xIGM:function(t,e,n){"use strict";(function(t){n.d(e,"a",function(){return o});var r="undefined"!=typeof window&&window,i="undefined"!=typeof self&&"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self,o=r||"undefined"!=typeof t&&t||i}).call(e,n("fRUx"))}},[0]);