UNPKG

hy-push-state

Version:

Turn static web sites into dynamic web apps

33 lines (31 loc) 95.7 kB
/*! * Copyright (c) 2018 Florian Klampfer <https://qwtel.com/> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * */ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("hyPushState",[],e):"object"==typeof exports?exports.hyPushState=e():t.hyPushState=e()}(window,(function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=4)}([function(t,e,r){"use strict";(function(t){r.d(e,"a",(function(){return i}));var n="undefined"!=typeof window&&window,o="undefined"!=typeof self&&"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self,i=n||void 0!==t&&t||o}).call(this,r(3))},,,function(t,e){function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"===("undefined"==typeof window?"undefined":r(window))&&(n=window)}t.exports=n},function(t,e,r){"use strict";r.r(e),r.d(e,"INIT",(function(){return It})),r.d(e,"HINT",(function(){return At})),r.d(e,"PUSH",(function(){return Ct})),r.d(e,"POP",(function(){return Nt})),r.d(e,"MIXIN_FEATURE_TESTS",(function(){return to})),r.d(e,"Set",(function(){return n})),r.d(e,"pushStateMixin",(function(){return eo}));var n="undefined"!=typeof Set&&1===new Set([1]).size?Set:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return(t=t.filter((function(e,r){return r===t.indexOf(e)}))).size=t.length,t.has=function(e){return t.indexOf(e)>-1},t.add=function(e){return t.has(e)||(t.size++,t.push(e)),t},t.delete=function(e){var r;return(r=t.has(e))&&(t.size--,t.splice(t.indexOf(e),1)),r},t.clear=function(){for(;t.pop(););t.size=0},t};function o(t){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function u(t,e,r){return e&&i(t.prototype,e),r&&i(t,r),t}function c(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&s(t,e)}function s(t,e){return(s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function a(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=l(t);if(e){var o=l(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return f(this,r)}}function f(t,e){return!e||"object"!==o(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function l(t){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function p(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var h=new n(["customevent"]),y=Symbol||function(t){return"_".concat(t)},b=y("sroot"),d=y("state");window.process=window.process||{},window.process.env=window.process.env||{},window.requestIdleCallback=window.requestIdleCallback||function(t){return window.setTimeout(t,0)},window.cancelIdleCallback=window.cancelIdleCallback||window.clearTimeout;var v=function t(){p(this,t)}; /*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ var m=function(t,e){return(m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};function w(t,e){function r(){this.constructor=t}m(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}function g(t){return"function"==typeof t}var S=!1,_={Promise:void 0,set useDeprecatedSynchronousErrorHandling(t){t&&(new Error).stack;S=t},get useDeprecatedSynchronousErrorHandling(){return S}};function E(t){setTimeout((function(){throw t}),0)}var O={closed:!0,next:function(t){},error:function(t){if(_.useDeprecatedSynchronousErrorHandling)throw t;E(t)},complete:function(){}},j=function(){return Array.isArray||function(t){return t&&"number"==typeof t.length}}();function x(t){return(x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function R(t){return null!==t&&"object"===x(t)}var P=function(){function t(t){return Error.call(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map((function(t,e){return e+1+") "+t.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=t,this}return t.prototype=Object.create(Error.prototype),t}();function T(t){return(T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var k=function(){function t(t){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,t&&(this._unsubscribe=t)}return t.prototype.unsubscribe=function(){var e;if(!this.closed){var r=this._parentOrParents,n=this._unsubscribe,o=this._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,r instanceof t)r.remove(this);else if(null!==r)for(var i=0;i<r.length;++i){r[i].remove(this)}if(g(n))try{n.call(this)}catch(t){e=t instanceof P?I(t.errors):[t]}if(j(o)){i=-1;for(var u=o.length;++i<u;){var c=o[i];if(R(c))try{c.unsubscribe()}catch(t){e=e||[],t instanceof P?e=e.concat(I(t.errors)):e.push(t)}}}if(e)throw new P(e)}},t.prototype.add=function(e){var r=e;if(!e)return t.EMPTY;switch(T(e)){case"function":r=new t(e);case"object":if(r===this||r.closed||"function"!=typeof r.unsubscribe)return r;if(this.closed)return r.unsubscribe(),r;if(!(r instanceof t)){var n=r;(r=new t)._subscriptions=[n]}break;default:throw new Error("unrecognized teardown "+e+" added to Subscription.")}var o=r._parentOrParents;if(null===o)r._parentOrParents=this;else if(o instanceof t){if(o===this)return r;r._parentOrParents=[o,this]}else{if(-1!==o.indexOf(this))return r;o.push(this)}var i=this._subscriptions;return null===i?this._subscriptions=[r]:i.push(r),r},t.prototype.remove=function(t){var e=this._subscriptions;if(e){var r=e.indexOf(t);-1!==r&&e.splice(r,1)}},t.EMPTY=function(t){return t.closed=!0,t}(new t),t}();function I(t){return t.reduce((function(t,e){return t.concat(e instanceof P?e.errors:e)}),[])}var A=function(){return"function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random()}();function C(t){return(C="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var N=function(t){function e(r,n,o){var i=t.call(this)||this;switch(i.syncErrorValue=null,i.syncErrorThrown=!1,i.syncErrorThrowable=!1,i.isStopped=!1,arguments.length){case 0:i.destination=O;break;case 1:if(!r){i.destination=O;break}if("object"===C(r)){r instanceof e?(i.syncErrorThrowable=r.syncErrorThrowable,i.destination=r,r.add(i)):(i.syncErrorThrowable=!0,i.destination=new L(i,r));break}default:i.syncErrorThrowable=!0,i.destination=new L(i,r,n,o)}return i}return w(e,t),e.prototype[A]=function(){return this},e.create=function(t,r,n){var o=new e(t,r,n);return o.syncErrorThrowable=!1,o},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._parentOrParents;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=t,this},e}(k),L=function(t){function e(e,r,n,o){var i,u=t.call(this)||this;u._parentSubscriber=e;var c=u;return g(r)?i=r:r&&(i=r.next,n=r.error,o=r.complete,r!==O&&(g((c=Object.create(r)).unsubscribe)&&u.add(c.unsubscribe.bind(c)),c.unsubscribe=u.unsubscribe.bind(u))),u._context=c,u._next=i,u._error=n,u._complete=o,u}return w(e,t),e.prototype.next=function(t){if(!this.isStopped&&this._next){var e=this._parentSubscriber;_.useDeprecatedSynchronousErrorHandling&&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,r=_.useDeprecatedSynchronousErrorHandling;if(this._error)r&&e.syncErrorThrowable?(this.__tryOrSetError(e,this._error,t),this.unsubscribe()):(this.__tryOrUnsub(this._error,t),this.unsubscribe());else if(e.syncErrorThrowable)r?(e.syncErrorValue=t,e.syncErrorThrown=!0):E(t),this.unsubscribe();else{if(this.unsubscribe(),r)throw t;E(t)}}},e.prototype.complete=function(){var t=this;if(!this.isStopped){var e=this._parentSubscriber;if(this._complete){var r=function(){return t._complete.call(t._context)};_.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?(this.__tryOrSetError(e,r),this.unsubscribe()):(this.__tryOrUnsub(r),this.unsubscribe())}else this.unsubscribe()}},e.prototype.__tryOrUnsub=function(t,e){try{t.call(this._context,e)}catch(t){if(this.unsubscribe(),_.useDeprecatedSynchronousErrorHandling)throw t;E(t)}},e.prototype.__tryOrSetError=function(t,e,r){if(!_.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{e.call(this._context,r)}catch(e){return _.useDeprecatedSynchronousErrorHandling?(t.syncErrorValue=e,t.syncErrorThrown=!0,!0):(E(e),!0)}return!1},e.prototype._unsubscribe=function(){var t=this._parentSubscriber;this._context=null,this._parentSubscriber=null,t.unsubscribe()},e}(N);var q=function(){return"function"==typeof Symbol&&Symbol.observable||"@@observable"}();function D(t){return t}function U(t){return 0===t.length?D:1===t.length?t[0]:function(e){return t.reduce((function(t,e){return e(t)}),e)}}var H=function(){function t(t){this._isScalar=!1,t&&(this._subscribe=t)}return t.prototype.lift=function(e){var r=new t;return r.source=this,r.operator=e,r},t.prototype.subscribe=function(t,e,r){var n=this.operator,o=function(t,e,r){if(t){if(t instanceof N)return t;if(t[A])return t[A]()}return t||e||r?new N(t,e,r):new N(O)}(t,e,r);if(n?o.add(n.call(o,this.source)):o.add(this.source||_.useDeprecatedSynchronousErrorHandling&&!o.syncErrorThrowable?this._subscribe(o):this._trySubscribe(o)),_.useDeprecatedSynchronousErrorHandling&&o.syncErrorThrowable&&(o.syncErrorThrowable=!1,o.syncErrorThrown))throw o.syncErrorValue;return o},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){_.useDeprecatedSynchronousErrorHandling&&(t.syncErrorThrown=!0,t.syncErrorValue=e),!function(t){for(;t;){var e=t,r=e.closed,n=e.destination,o=e.isStopped;if(r||o)return!1;t=n&&n instanceof N?n:null}return!0}(t)?console.warn(e):t.error(e)}},t.prototype.forEach=function(t,e){var r=this;return new(e=M(e))((function(e,n){var o;o=r.subscribe((function(e){try{t(e)}catch(t){n(t),o&&o.unsubscribe()}}),n,e)}))},t.prototype._subscribe=function(t){var e=this.source;return e&&e.subscribe(t)},t.prototype[q]=function(){return this},t.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return 0===t.length?this:U(t)(this)},t.prototype.toPromise=function(t){var e=this;return new(t=M(t))((function(t,r){var n;e.subscribe((function(t){return n=t}),(function(t){return r(t)}),(function(){return t(n)}))}))},t.create=function(e){return new t(e)},t}();function M(t){if(t||(t=_.Promise||Promise),!t)throw new Error("no Promise impl found");return t}var V=function(){function t(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return t.prototype=Object.create(Error.prototype),t}(),F=function(t){function e(e,r){var n=t.call(this)||this;return n.subject=e,n.subscriber=r,n.closed=!1,n}return w(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 r=e.indexOf(this.subscriber);-1!==r&&e.splice(r,1)}}},e}(k),X=function(t){function e(e){var r=t.call(this,e)||this;return r.destination=e,r}return w(e,t),e}(N),$=function(t){function e(){var e=t.call(this)||this;return e.observers=[],e.closed=!1,e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return w(e,t),e.prototype[A]=function(){return new X(this)},e.prototype.lift=function(t){var e=new Y(this,this);return e.operator=t,e},e.prototype.next=function(t){if(this.closed)throw new V;if(!this.isStopped)for(var e=this.observers,r=e.length,n=e.slice(),o=0;o<r;o++)n[o].next(t)},e.prototype.error=function(t){if(this.closed)throw new V;this.hasError=!0,this.thrownError=t,this.isStopped=!0;for(var e=this.observers,r=e.length,n=e.slice(),o=0;o<r;o++)n[o].error(t);this.observers.length=0},e.prototype.complete=function(){if(this.closed)throw new V;this.isStopped=!0;for(var t=this.observers,e=t.length,r=t.slice(),n=0;n<e;n++)r[n].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 V;return t.prototype._trySubscribe.call(this,e)},e.prototype._subscribe=function(t){if(this.closed)throw new V;return this.hasError?(t.error(this.thrownError),k.EMPTY):this.isStopped?(t.complete(),k.EMPTY):(this.observers.push(t),new F(this,t))},e.prototype.asObservable=function(){var t=new H;return t.source=this,t},e.create=function(t,e){return new Y(t,e)},e}(H),Y=function(t){function e(e,r){var n=t.call(this)||this;return n.destination=e,n.source=r,n}return w(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):k.EMPTY},e}($),B=function(t){function e(e,r){var n=t.call(this,e,r)||this;return n.scheduler=e,n.work=r,n.pending=!1,n}return w(e,t),e.prototype.schedule=function(t,e){if(void 0===e&&(e=0),this.closed)return this;this.state=t;var r=this.id,n=this.scheduler;return null!=r&&(this.id=this.recycleAsyncId(n,r,e)),this.pending=!0,this.delay=e,this.id=this.id||this.requestAsyncId(n,this.id,e),this},e.prototype.requestAsyncId=function(t,e,r){return void 0===r&&(r=0),setInterval(t.flush.bind(t,this),r)},e.prototype.recycleAsyncId=function(t,e,r){if(void 0===r&&(r=0),null!==r&&this.delay===r&&!1===this.pending)return e;clearInterval(e)},e.prototype.execute=function(t,e){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var r=this._execute(t,e);if(r)return r;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(t,e){var r=!1,n=void 0;try{this.work(t)}catch(t){r=!0,n=!!t&&t||new Error(t)}if(r)return this.unsubscribe(),n},e.prototype._unsubscribe=function(){var t=this.id,e=this.scheduler,r=e.actions,n=r.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==n&&r.splice(n,1),null!=t&&(this.id=this.recycleAsyncId(e,t,null)),this.delay=null},e}(function(t){function e(e,r){return t.call(this)||this}return w(e,t),e.prototype.schedule=function(t,e){return void 0===e&&(e=0),this},e}(k)),W=function(t){function e(e,r){var n=t.call(this,e,r)||this;return n.scheduler=e,n.work=r,n}return w(e,t),e.prototype.schedule=function(e,r){return void 0===r&&(r=0),r>0?t.prototype.schedule.call(this,e,r):(this.delay=r,this.state=e,this.scheduler.flush(this),this)},e.prototype.execute=function(e,r){return r>0||this.closed?t.prototype.execute.call(this,e,r):this._execute(e,r)},e.prototype.requestAsyncId=function(e,r,n){return void 0===n&&(n=0),null!==n&&n>0||null===n&&this.delay>0?t.prototype.requestAsyncId.call(this,e,r,n):e.flush(this)},e}(B),z=function(){function t(e,r){void 0===r&&(r=t.now),this.SchedulerAction=e,this.now=r}return t.prototype.schedule=function(t,e,r){return void 0===e&&(e=0),new this.SchedulerAction(this,t).schedule(r,e)},t.now=function(){return Date.now()},t}(),G=function(t){function e(r,n){void 0===n&&(n=z.now);var o=t.call(this,r,(function(){return e.delegate&&e.delegate!==o?e.delegate.now():n()}))||this;return o.actions=[],o.active=!1,o.scheduled=void 0,o}return w(e,t),e.prototype.schedule=function(r,n,o){return void 0===n&&(n=0),e.delegate&&e.delegate!==this?e.delegate.schedule(r,n,o):t.prototype.schedule.call(this,r,n,o)},e.prototype.flush=function(t){var e=this.actions;if(this.active)e.push(t);else{var r;this.active=!0;do{if(r=t.execute(t.state,t.delay))break}while(t=e.shift());if(this.active=!1,r){for(;t=e.shift();)t.unsubscribe();throw r}}},e}(z),K=new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return w(e,t),e}(G))(W),J=new H((function(t){return t.complete()}));function Q(t){return t?function(t){return new H((function(e){return t.schedule((function(){return e.complete()}))}))}(t):J}function Z(t){return t&&"function"==typeof t.schedule}var tt,et=function(t){return function(e){for(var r=0,n=t.length;r<n&&!e.closed;r++)e.next(t[r]);e.complete()}};function rt(t,e){return new H((function(r){var n=new k,o=0;return n.add(e.schedule((function(){o!==t.length?(r.next(t[o++]),r.closed||n.add(this.schedule())):r.complete()}))),n}))}function nt(t,e){return e?rt(t,e):new H(et(t))}function ot(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t[t.length-1];return Z(r)?(t.pop(),rt(t,r)):nt(t)}function it(t){var e=t.error;t.subscriber.error(e)}tt||(tt={});var ut=function(){function t(t,e,r){this.kind=t,this.value=e,this.error=r,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,r){switch(this.kind){case"N":return t&&t(this.value);case"E":return e&&e(this.error);case"C":return r&&r()}},t.prototype.accept=function(t,e,r){return t&&"function"==typeof t.next?this.observe(t):this.do(t,e,r)},t.prototype.toObservable=function(){var t,e;switch(this.kind){case"N":return ot(this.value);case"E":return t=this.error,new H(e?function(r){return e.schedule(it,0,{error:t,subscriber:r})}:function(e){return e.error(t)});case"C":return Q()}throw new Error("unexpected notification kind value")},t.createNext=function(e){return void 0!==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}();var ct=function(t){function e(e,r,n){void 0===n&&(n=0);var o=t.call(this,e)||this;return o.scheduler=r,o.delay=n,o}return w(e,t),e.dispatch=function(t){var e=t.notification,r=t.destination;e.observe(r),this.unsubscribe()},e.prototype.scheduleMessage=function(t){this.destination.add(this.scheduler.schedule(e.dispatch,this.delay,new st(t,this.destination)))},e.prototype._next=function(t){this.scheduleMessage(ut.createNext(t))},e.prototype._error=function(t){this.scheduleMessage(ut.createError(t)),this.unsubscribe()},e.prototype._complete=function(){this.scheduleMessage(ut.createComplete()),this.unsubscribe()},e}(N),st=function(){return function(t,e){this.notification=t,this.destination=e}}(),at=function(t){function e(e,r,n){void 0===e&&(e=Number.POSITIVE_INFINITY),void 0===r&&(r=Number.POSITIVE_INFINITY);var o=t.call(this)||this;return o.scheduler=n,o._events=[],o._infiniteTimeWindow=!1,o._bufferSize=e<1?1:e,o._windowTime=r<1?1:r,r===Number.POSITIVE_INFINITY?(o._infiniteTimeWindow=!0,o.next=o.nextInfiniteTimeWindow):o.next=o.nextTimeWindow,o}return w(e,t),e.prototype.nextInfiniteTimeWindow=function(e){var r=this._events;r.push(e),r.length>this._bufferSize&&r.shift(),t.prototype.next.call(this,e)},e.prototype.nextTimeWindow=function(e){this._events.push(new ft(this._getNow(),e)),this._trimBufferThenGetEvents(),t.prototype.next.call(this,e)},e.prototype._subscribe=function(t){var e,r=this._infiniteTimeWindow,n=r?this._events:this._trimBufferThenGetEvents(),o=this.scheduler,i=n.length;if(this.closed)throw new V;if(this.isStopped||this.hasError?e=k.EMPTY:(this.observers.push(t),e=new F(this,t)),o&&t.add(t=new ct(t,o)),r)for(var u=0;u<i&&!t.closed;u++)t.next(n[u]);else for(u=0;u<i&&!t.closed;u++)t.next(n[u].value);return this.hasError?t.error(this.thrownError):this.isStopped&&t.complete(),e},e.prototype._getNow=function(){return(this.scheduler||K).now()},e.prototype._trimBufferThenGetEvents=function(){for(var t=this._getNow(),e=this._bufferSize,r=this._windowTime,n=this._events,o=n.length,i=0;i<o&&!(t-n[i].time<r);)i++;return o>e&&(i=Math.max(i,o-e)),i>0&&n.splice(0,i),n},e}($),ft=function(){return function(t,e){this.time=t,this.value=e}}();function lt(t){return(lt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function pt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ht(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function yt(t,e,r){return(yt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=mt(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function bt(t,e){return(bt=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function dt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=mt(t);if(e){var o=mt(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return vt(this,r)}}function vt(t,e){return!e||"object"!==lt(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function mt(t){return(mt=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var wt=function(t){return function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&bt(t,e)}(i,t);var e,r,n,o=dt(i);function i(){return pt(this,i),o.apply(this,arguments)}return e=i,(r=[{key:"setupComponent",value:function(t,e){var r=this,n={};this.subjects={},this.subjects.disconnect=new $,this.subjects.document=new at,Object.keys(this.constructor.types).map((function(t){r.subjects[t]=new at(1),n[t]=function(e){return r.subjects[t].next(e)}})),Object.defineProperty(this.constructor,"sideEffects",{get:function(){return n},set:function(){},enumerable:!0,configurable:!0}),yt(mt(i.prototype),"setupComponent",this).call(this,t,e)}},{key:"connectComponent",value:function(){var t=this;yt(mt(i.prototype),"connectComponent",this).call(this),this.subjects.document.next(document),Object.keys(this.constructor.types).map((function(e){return t.subjects[e].next(t[e])}))}},{key:"disconnectComponent",value:function(){yt(mt(i.prototype),"disconnectComponent",this).call(this),this.subjects.disconnect.next({})}},{key:"adaptComponent",value:function(){yt(mt(i.prototype),"adaptComponent",this).call(this),this.subjects.document.next(document)}}])&&ht(e.prototype,r),n&&ht(e,n),i}(t)},gt=function(t){return null==t?null:t.trim().replace(/^\[?(.*?)\]?$/,"$1").split(",").map((function(t){return t.trim()}))||null};gt.stringify=function(t){return t&&t.length>0?t.join(","):null};var St=function(t){if(null==t)return!1;var e=t.trim&&t.trim()||t;return!("false"===e||"null"===e||"undefined"===e||"0"===e||!1===e)};St.stringify=function(t){return t?"":null};var _t=function(t){return null==t?null:Number(t)};_t.stringify=function(t){return null==t?null:"".concat(t)};var Et=function(t){if(null==t)return null;var e=(t.trim&&t.trim()||t).match(/^\/?(.*?)(\/([gimy]*))?$/);return new RegExp(e[1],e[3])};Et.stringify=function(t){return t&&t.toString()||null};var Ot=function(t){return t};Ot.stringify=function(t){return t};var jt=window.URL;if(!jt||!jt.prototype||!("href"in jt.prototype)){(jt=function(t,e){if(!t)throw new TypeError("Invalid argument");var r=document.implementation.createHTMLDocument("");if(e){var n=r.createElement("base");n.href=e,r.head.appendChild(n)}var o=r.createElement("a");if(o.href=t,r.body.appendChild(o),":"===o.protocol||!/:/.test(o.href))throw new TypeError("Invalid URL");Object.defineProperty(this,"_anchorElement",{value:o})}).prototype={toString:function(){return this.href},get href(){return this._anchorElement.href},set href(t){this._anchorElement.href=t},get protocol(){return this._anchorElement.protocol},set protocol(t){this._anchorElement.protocol=t},get host(){return this._anchorElement.host},set host(t){this._anchorElement.host=t},get hostname(){return this._anchorElement.hostname},set hostname(t){this._anchorElement.hostname=t},get port(){return this._anchorElement.port},set port(t){this._anchorElement.port=t},get pathname(){return this._anchorElement.pathname},set pathname(t){this._anchorElement.pathname=t},get search(){return this._anchorElement.search},set search(t){this._anchorElement.search=t},get hash(){return this._anchorElement.hash},set hash(t){this._anchorElement.hash=t}};var xt=window.URL||window.webkitURL||window.mozURL;jt.createObjectURL=function(t){return xt.createObjectURL.apply(xt,arguments)},jt.revokeObjectURL=function(t){return xt.revokeObjectURL.apply(xt,arguments)},Object.defineProperty(jt.prototype,"toString",{enumerable:!1})}var Rt=Element.prototype.matches||Element.prototype.matchesSelector||Element.prototype.msMatchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.webkitMatchesSelector||Element.prototype.oMatchesSelector;function Pt(t){for(var e=this;e!==document&&e!==document.documentElement;){if(Rt.call(e,t))return e;e=e.parentNode}return null}function Tt(t){var e=t.protocol,r=t.host,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window.location;return e!==n.protocol||r!==n.host}function kt(){return window.pageYOffset||document.body.scrollTop}var It="init",At="hint",Ct="push",Nt="pop";function Lt(t,e){return function(r){if("function"!=typeof t)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return r.lift(new qt(t,e))}}var qt=function(){function t(t,e){this.project=t,this.thisArg=e}return t.prototype.call=function(t,e){return e.subscribe(new Dt(t,this.project,this.thisArg))},t}(),Dt=function(t){function e(e,r,n){var o=t.call(this,e)||this;return o.project=r,o.count=0,o.thisArg=n||o,o}return w(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}(N);function Ut(t,e,r,n){return g(r)&&(n=r,r=void 0),n?Ut(t,e,r).pipe(Lt((function(t){return j(t)?n.apply(void 0,t):n(t)}))):new H((function(n){!function t(e,r,n,o,i){var u;if(function(t){return t&&"function"==typeof t.addEventListener&&"function"==typeof t.removeEventListener}(e)){var c=e;e.addEventListener(r,n,i),u=function(){return c.removeEventListener(r,n,i)}}else if(function(t){return t&&"function"==typeof t.on&&"function"==typeof t.off}(e)){var s=e;e.on(r,n),u=function(){return s.off(r,n)}}else if(function(t){return t&&"function"==typeof t.addListener&&"function"==typeof t.removeListener}(e)){var a=e;e.addListener(r,n),u=function(){return a.removeListener(r,n)}}else{if(!e||!e.length)throw new TypeError("Invalid event target");for(var f=0,l=e.length;f<l;f++)t(e[f],r,n,o,i)}o.add(u)}(t,e,(function(t){arguments.length>1?n.next(Array.prototype.slice.call(arguments)):n.next(t)}),n,r)}))}var Ht=function(t){function e(e,r,n){var o=t.call(this)||this;return o.parent=e,o.outerValue=r,o.outerIndex=n,o.index=0,o}return w(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);function Mt(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}var Vt=Mt(),Ft=function(t){return t&&"number"==typeof t.length&&"function"!=typeof t};function Xt(t){return!!t&&"function"!=typeof t.subscribe&&"function"==typeof t.then}var $t=function(t){if(t&&"function"==typeof t[q])return n=t,function(t){var e=n[q]();if("function"!=typeof e.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return e.subscribe(t)};if(Ft(t))return et(t);if(Xt(t))return r=t,function(t){return r.then((function(e){t.closed||(t.next(e),t.complete())}),(function(e){return t.error(e)})).then(null,E),t};if(t&&"function"==typeof t[Vt])return e=t,function(t){for(var r=e[Vt]();;){var n=r.next();if(n.done){t.complete();break}if(t.next(n.value),t.closed)break}return"function"==typeof r.return&&t.add((function(){r.return&&r.return()})),t};var e,r,n,o=R(t)?"an invalid object":"'"+t+"'";throw new TypeError("You provided "+o+" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.")};function Yt(t,e,r,n,o){if(void 0===o&&(o=new Ht(t,r,n)),!o.closed)return e instanceof H?e.subscribe(o):$t(e)(o)}var Bt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return w(e,t),e.prototype.notifyNext=function(t,e,r,n,o){this.destination.next(e)},e.prototype.notifyError=function(t,e){this.destination.error(t)},e.prototype.notifyComplete=function(t){this.destination.complete()},e}(N);function Wt(t){return(Wt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function zt(t,e){if(null!=t){if(function(t){return t&&"function"==typeof t[q]}(t))return function(t,e){return new H((function(r){var n=new k;return n.add(e.schedule((function(){var o=t[q]();n.add(o.subscribe({next:function(t){n.add(e.schedule((function(){return r.next(t)})))},error:function(t){n.add(e.schedule((function(){return r.error(t)})))},complete:function(){n.add(e.schedule((function(){return r.complete()})))}}))}))),n}))}(t,e);if(Xt(t))return function(t,e){return new H((function(r){var n=new k;return n.add(e.schedule((function(){return t.then((function(t){n.add(e.schedule((function(){r.next(t),n.add(e.schedule((function(){return r.complete()})))})))}),(function(t){n.add(e.schedule((function(){return r.error(t)})))}))}))),n}))}(t,e);if(Ft(t))return rt(t,e);if(function(t){return t&&"function"==typeof t[Vt]}(t)||"string"==typeof t)return function(t,e){if(!t)throw new Error("Iterable cannot be null");return new H((function(r){var n,o=new k;return o.add((function(){n&&"function"==typeof n.return&&n.return()})),o.add(e.schedule((function(){n=t[Vt](),o.add(e.schedule((function(){if(!r.closed){var t,e;try{var o=n.next();t=o.value,e=o.done}catch(t){return void r.error(t)}e?r.complete():(r.next(t),this.schedule())}})))}))),o}))}(t,e)}throw new TypeError((null!==t&&Wt(t)||t)+" is not observable")}function Gt(t,e){return e?zt(t,e):t instanceof H?t:new H($t(t))}function Kt(t,e,r){return void 0===r&&(r=Number.POSITIVE_INFINITY),"function"==typeof e?function(n){return n.pipe(Kt((function(r,n){return Gt(t(r,n)).pipe(Lt((function(t,o){return e(r,t,n,o)})))}),r))}:("number"==typeof e&&(r=e),function(e){return e.lift(new Jt(t,r))})}var Jt=function(){function t(t,e){void 0===e&&(e=Number.POSITIVE_INFINITY),this.project=t,this.concurrent=e}return t.prototype.call=function(t,e){return e.subscribe(new Qt(t,this.project,this.concurrent))},t}(),Qt=function(t){function e(e,r,n){void 0===n&&(n=Number.POSITIVE_INFINITY);var o=t.call(this,e)||this;return o.project=r,o.concurrent=n,o.hasCompleted=!1,o.buffer=[],o.active=0,o.index=0,o}return w(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,r=this.index++;try{e=this.project(t,r)}catch(t){return void this.destination.error(t)}this.active++,this._innerSub(e,t,r)},e.prototype._innerSub=function(t,e,r){var n=new Ht(this,e,r),o=this.destination;o.add(n);var i=Yt(this,t,void 0,void 0,n);i!==n&&o.add(i)},e.prototype._complete=function(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&this.destination.complete(),this.unsubscribe()},e.prototype.notifyNext=function(t,e,r,n,o){this.destination.next(e)},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}(Bt);function Zt(t){return void 0===t&&(t=Number.POSITIVE_INFINITY),Kt(D,t)}function te(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=Number.POSITIVE_INFINITY,n=null,o=t[t.length-1];return Z(o)?(n=t.pop(),t.length>1&&"number"==typeof t[t.length-1]&&(r=t.pop())):"number"==typeof o&&(r=t.pop()),null===n&&1===t.length&&t[0]instanceof H?t[0]:Zt(r)(nt(t,n))}function ee(){}var re=new H(ee);function ne(t){return new H((function(e){var r;try{r=t()}catch(t){return void e.error(t)}return(r?Gt(r):Q()).subscribe(e)}))}function oe(t){return function(e){return e.lift(new ie(t))}}var ie=function(){function t(t){this.notifier=t}return t.prototype.call=function(t,e){var r=new ue(t),n=Yt(r,this.notifier);return n&&!r.seenValue?(r.add(n),e.subscribe(r)):r},t}(),ue=function(t){function e(e){var r=t.call(this,e)||this;return r.seenValue=!1,r}return w(e,t),e.prototype.notifyNext=function(t,e,r,n,o){this.seenValue=!0,this.complete()},e.prototype.notifyComplete=function(){},e}(Bt);function ce(t,e){return function(r){return r.lift(new se(t,e))}}var se=function(){function t(t,e){this.predicate=t,this.thisArg=e}return t.prototype.call=function(t,e){return e.subscribe(new ae(t,this.predicate,this.thisArg))},t}(),ae=function(t){function e(e,r,n){var o=t.call(this,e)||this;return o.predicate=r,o.thisArg=n,o.count=0,o}return w(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}(N);function fe(t,e,r){return function(n){return n.lift(new le(t,e,r))}}var le=function(){function t(t,e,r){this.nextOrObserver=t,this.error=e,this.complete=r}return t.prototype.call=function(t,e){return e.subscribe(new pe(t,this.nextOrObserver,this.error,this.complete))},t}(),pe=function(t){function e(e,r,n,o){var i=t.call(this,e)||this;return i._tapNext=ee,i._tapError=ee,i._tapComplete=ee,i._tapError=n||ee,i._tapComplete=o||ee,g(r)?(i._context=i,i._tapNext=r):r&&(i._context=r,i._tapNext=r.next||ee,i._tapError=r.error||ee,i._tapComplete=r.complete||ee),i}return w(e,t),e.prototype._next=function(t){try{this._tapNext.call(this._context,t)}catch(t){return void this.destination.error(t)}this.destination.next(t)},e.prototype._error=function(t){try{this._tapError.call(this._context,t)}catch(t){return void this.destination.error(t)}this.destination.error(t)},e.prototype._complete=function(){try{this._tapComplete.call(this._context)}catch(t){return void this.destination.error(t)}return this.destination.complete()},e}(N);function he(){return Zt(1)}function ye(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return he()(ot.apply(void 0,t))}function be(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t[t.length-1];return Z(r)?(t.pop(),function(e){return ye(t,e,r)}):function(e){return ye(t,e)}}var de=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new ve(t))},t}(),ve=function(t){function e(e){var r=t.call(this,e)||this;return r.hasPrev=!1,r}return w(e,t),e.prototype._next=function(t){var e;this.hasPrev?e=[this.prev,t]:this.hasPrev=!0,this.prev=t,e&&this.destination.next(e)},e}(N);function me(){return function(t){return t.lift(new we(t))}}var we=function(){function t(t){this.connectable=t}return t.prototype.call=function(t,e){var r=this.connectable;r._refCount++;var n=new ge(t,r),o=e.subscribe(n);return n.closed||(n.connection=r.connect()),o},t}(),ge=function(t){function e(e,r){var n=t.call(this,e)||this;return n.connectable=r,n}return w(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 r=this.connection,n=t._connection;this.connection=null,!n||r&&n!==r||n.unsubscribe()}}else this.connection=null},e}(N),Se=function(t){function e(e,r){var n=t.call(this)||this;return n.source=e,n.subjectFactory=r,n._refCount=0,n._isComplete=!1,n}return w(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 k).add(this.source.subscribe(new Ee(this.getSubject(),this))),t.closed&&(this._connection=null,t=k.EMPTY)),t},e.prototype.refCount=function(){return me()(this)},e}(H),_e=function(){var t=Se.prototype;return{operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:t._subscribe},_isComplete:{value:t._isComplete,writable:!0},getSubject:{value:t.getSubject},connect:{value:t.connect},refCount:{value:t.refCount}}}(),Ee=function(t){function e(e,r){var n=t.call(this,e)||this;return n.connectable=r,n}return w(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}(X);var Oe=function(){function t(t,e){this.subjectFactory=t,this.selector=e}return t.prototype.call=function(t,e){var r=this.selector,n=this.subjectFactory(),o=r(n).subscribe(t);return o.add(e.subscribe(n)),o},t}();function je(){return new $}function xe(){return function(t){return me()((e=je,function(t){var n;if(n="function"==typeof e?e:function(){return e},"function"==typeof r)return t.lift(new Oe(n,r));var o=Object.create(t,_e);return o.source=t,o.subjectFactory=n,o})(t));var e,r}}function Re(t,e){function r(){return!r.pred.apply(r.thisArg,arguments)}return r.pred=t,r.thisArg=e,r}function Pe(t,e){return function(r){return[ce(t,e)(r),ce(Re(t,e))(r)]}}function Te(t,e){return"function"==typeof e?function(r){return r.pipe(Te((function(r,n){return Gt(t(r,n)).pipe(Lt((function(t,o){return e(r,t,n,o)})))})))}:function(e){return e.lift(new ke(t))}}var ke=function(){function t(t){this.project=t}return t.prototype.call=function(t,e){return e.subscribe(new Ie(t,this.project))},t}(),Ie=function(t){function e(e,r){var n=t.call(this,e)||this;return n.project=r,n.index=0,n}return w(e,t),e.prototype._next=function(t){var e,r=this.index++;try{e=this.project(t,r)}catch(t){return void this.destination.error(t)}this._innerSub(e,t,r)},e.prototype._innerSub=function(t,e,r){var n=this.innerSubscription;n&&n.unsubscribe();var o=new Ht(this,e,r),i=this.destination;i.add(o),this.innerSubscription=Yt(this,t,void 0,void 0,o),this.innerSubscription!==o&&i.add(this.innerSubscription)},e.prototype._complete=function(){var e=this.innerSubscription;e&&!e.closed||t.prototype._complete.call(this),this.unsubscribe()},e.prototype._unsubscribe=function(){this.innerSubscription=null},e.prototype.notifyComplete=function(e){this.destination.remove(e),this.innerSubscription=null,this.isStopped&&t.prototype._complete.call(this)},e.prototype.notifyNext=function(t,e,r,n,o){this.destination.next(e)},e}(Bt);function Ae(t){return function(e){return e.lift(new Ce(t))}}var Ce=function(){function t(t){this.value=t}return t.prototype.call=function(t,e){return e.subscribe(new Ne(t,this.value))},t}(),Ne=function(t){function e(e,r){var n=t.call(this,e)||this;return n.value=r,n}return w(e,t),e.prototype._next=function(t){this.destination.next(this.value)},e}(N);var Le=function(){function t(t,e){this.compare=t,this.keySelector=e}return t.prototype.call=function(t,e){return e.subscribe(new qe(t,this.compare,this.keySelector))},t}(),qe=function(t){function e(e,r,n){var o=t.call(this,e)||this;return o.keySelector=n,o.hasKey=!1,"function"==typeof r&&(o.compare=r),o}return w(e,t),e.prototype.compare=function(t,e){return t===e},e.prototype._next=function(t){var e;try{var r=this.keySelector;e=r?r(t):t}catch(t){return this.destination.error(t)}var n=!1;if(this.hasKey)try{n=(0,this.compare)(this.key,e)}catch(t){return this.destination.error(t)}else this.hasKey=!0;n||(this.key=e,this.destination.next(t))},e}(N);var De=function(){function t(t,e){this.observables=t,this.project=e}return t.prototype.call=function(t,e){return e.subscribe(new Ue(t,this.observables,this.project))},t}(),Ue=function(t){function e(e,r,n){var o=t.call(this,e)||this;o.observables=r,o.project=n,o.toRespond=[];var i=r.length;o.values=new Array(i);for(var u=0;u<i;u++)o.toRespond.push(u);for(u=0;u<i;u++){var c=r[u];o.add(Yt(o,c,c,u))}return o}return w(e,t),e.prototype.notifyNext=function(t,e,r,n,o){this.values[r]=e;var i=this.toRespond;if(i.length>0){var u=i.indexOf(r);-1!==u&&i.splice(u,1)}},e.prototype.notifyComplete=function(){},e.prototype._next=function(t){if(0===this.toRespond.length){var e=[t].concat(this.values);this.project?this._tryProject(e):this.destination.next(e)}},e.prototype._tryProject=function(t){var e;try{e=this.project.apply(this,t)}catch(t){return void this.destination.error(t)}this.destination.next(e)},e}(Bt);function He(t){return function(e){var r=new Me(t),n=e.lift(r);return r.caught=n}}var Me=function(){function t(t){this.selector=t}return t.prototype.call=function(t,e){return e.subscribe(new Ve(t,this.selector,this.caught))},t}(),Ve=function(t){function e(e,r,n){var o=t.call(this,e)||this;return o.selector=r,o.caught=n,o}return w(e,t),e.prototype.error=function(e){if(!this.isStopped){var r=void 0;try{r=this.selector(e,this.caught)}catch(e){return void t.prototype.error.call(this,e)}this._unsubscribeAndRecycle();var n=new Ht(this,void 0,void 0);this.add(n);var o=Yt(this,r,void 0,void 0,n);o!==n&&this.add(o)}},e}(Bt);function Fe(t){return(Fe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Xe(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var r=[],n=!0,o=!1,i=void 0;try{for(var u,c=t[Symbol.iterator]();!(n=(u=c.next()).done)&&(r.push(u.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{n||null==c.return||c.return()}finally{if(o)throw i}}return r}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return $e(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return $e(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $e(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Ye(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Be(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function We(t,e){return(We=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function ze(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Ke(t);if(e){var o=Ke(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Ge(this,r)}}function Ge(t,e){return!e||"object"!==Fe(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Ke(t){return(Ke=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Je=function(t){return function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&We(t,e)}(i,t);var e,r,n,o=ze(i);function i(){return Ye(this,i),o.apply(this,arguments)}return e=i,(r=[{key:"histId",value:function(){return this.el.id||this.constructor.componentName}},{key:"shouldLoadAnchor",value:function(t,e){return t&&""===t.target&&(!e||-1!==t.href.search(e))}},{key:"isPushEvent",value:function(t){var e=t.url,r=t.anchor,n=t.event,o=n.metaKey,i=n.ctrlKey;return!o&&!i&&this.shouldLoadAnchor(r,this.hrefRegex)&&!Tt(e,this)}},{key:"isHintEvent",value:function(t){var e=t.url,r=t.anchor;return this.shouldLoadAnchor(r,this.hrefRegex)&&!Tt(e,this)&&!function(t){var e=t.hash,r=t.origin,n=t.pathname,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window.location;return""!==e&&r===o.origin&&n===o.pathname}(e,this)}},{key:"isHashChange",value:function(t){var e=Xe(t,2),r=e[0].url.pathname,n=e[1],o=n.url,i=o.pathname,u=o.hash,c=n.type;return i===r&&(c===Nt||c===Ct&&""!==u)}}])&&Be(e.prototype,r),n&&Be(e,n),i}(t)};function Qe(t){return(Qe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ze(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function tr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writa