diff --git a/material/assets/javascripts/bundle.js b/material/assets/javascripts/bundle.js index 90e435fa4..7cbf97d5c 100644 --- a/material/assets/javascripts/bundle.js +++ b/material/assets/javascripts/bundle.js @@ -1,2 +1,2 @@ -!function(t,e){for(var r in e)t[r]=e[r]}(window,function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.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 i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));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=7)}([,,function(t,e,r){"use strict";(function(t){r.d(e,"a",(function(){return o}));var n="undefined"!=typeof window&&window,i="undefined"!=typeof self&&"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self,o=n||void 0!==t&&t||i}).call(this,r(5))},,,function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e){},function(t,e,r){"use strict";function n(t){return null!=t&&"object"==typeof t&&!0===t["@@functional/placeholder"]}function i(t){return function e(r){return 0===arguments.length||n(r)?e:t.apply(this,arguments)}}function o(t){return t}r.r(e);var u=i(o);function s(t,e){return Object.prototype.hasOwnProperty.call(e,t)}var c=Object.prototype.toString,a=function(){return"[object Arguments]"===c.call(arguments)?function(t){return"[object Arguments]"===c.call(t)}:function(t){return s("callee",t)}}(),f=!{toString:null}.propertyIsEnumerable("toString"),l=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],h=function(){return arguments.propertyIsEnumerable("length")}(),p=function(t,e){for(var r=0;r=0;)s(e=l[r],t)&&!p(n,e)&&(n[n.length]=e),r-=1;return n})):i((function(t){return Object(t)!==t?[]:Object.keys(t)})),y=i((function(t){for(var e=d(t),r=e.length,n=[],i=0;i0?this._next(e.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},e}(ct);function lt(t){return t}function ht(t){return void 0===t&&(t=Number.POSITIVE_INFINITY),function t(e,r,n){return void 0===n&&(n=Number.POSITIVE_INFINITY),"function"==typeof r?function(i){return i.pipe(t((function(t,n){return it(e(t,n)).pipe(G((function(e,i){return r(t,e,n,i)})))}),n))}:("number"==typeof r&&(n=r),function(t){return t.lift(new at(e,n))})}(lt,t)}function pt(){for(var t=[],e=0;e1&&"number"==typeof t[t.length-1]&&(r=t.pop())):"number"==typeof i&&(r=t.pop()),null===n&&1===t.length&&t[0]instanceof q?t[0]:ht(r)(z(t,n))}var dt=r(2);function yt(t,e){return void 0===e&&(e=null),new xt({method:"GET",url:t,headers:e})}function vt(t,e,r){return new xt({method:"POST",url:t,body:e,headers:r})}function bt(t,e){return new xt({method:"DELETE",url:t,headers:e})}function mt(t,e,r){return new xt({method:"PUT",url:t,body:e,headers:r})}function wt(t,e,r){return new xt({method:"PATCH",url:t,body:e,headers:r})}var gt=G((function(t,e){return t.response}));function _t(t,e){return gt(new xt({method:"GET",url:t,responseType:"json",headers:e}))}var xt=function(t){function e(e){var r=t.call(this)||this,n={async:!0,createXHR:function(){return this.crossDomain?function(){if(dt.a.XMLHttpRequest)return new dt.a.XMLHttpRequest;if(dt.a.XDomainRequest)return new dt.a.XDomainRequest;throw new Error("CORS is not supported by your browser")}():function(){if(dt.a.XMLHttpRequest)return new dt.a.XMLHttpRequest;var t=void 0;try{for(var e=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],r=0;r<3;r++)try{if(t=e[r],new dt.a.ActiveXObject(t))break}catch(t){}return new dt.a.ActiveXObject(t)}catch(t){throw new Error("XMLHttpRequest is not supported by your browser")}}()},crossDomain:!0,withCredentials:!1,headers:{},method:"GET",responseType:"json",timeout:0};if("string"==typeof e)n.url=e;else for(var i in e)e.hasOwnProperty(i)&&(n[i]=e[i]);return r.request=n,r}var r;return b(e,t),e.prototype._subscribe=function(t){return new St(t,this.request)},e.create=((r=function(t){return new e(t)}).get=yt,r.post=vt,r.delete=bt,r.put=mt,r.patch=wt,r.getJSON=_t,r),e}(q),St=function(t){function e(e,r){var n=t.call(this,e)||this;n.request=r,n.done=!1;var i=r.headers=r.headers||{};return r.crossDomain||n.getHeader(i,"X-Requested-With")||(i["X-Requested-With"]="XMLHttpRequest"),n.getHeader(i,"Content-Type")||dt.a.FormData&&r.body instanceof dt.a.FormData||void 0===r.body||(i["Content-Type"]="application/x-www-form-urlencoded; charset=UTF-8"),r.body=n.serializeBody(r.body,n.getHeader(r.headers,"Content-Type")),n.send(),n}return b(e,t),e.prototype.next=function(t){this.done=!0;var e,r=this.xhr,n=this.request,i=this.destination;try{e=new Et(t,r,n)}catch(t){return i.error(t)}i.next(e)},e.prototype.send=function(){var t=this.request,e=this.request,r=e.user,n=e.method,i=e.url,o=e.async,u=e.password,s=e.headers,c=e.body;try{var a=this.xhr=t.createXHR();this.setupEvents(a,t),r?a.open(n,i,o,r,u):a.open(n,i,o),o&&(a.timeout=t.timeout,a.responseType=t.responseType),"withCredentials"in a&&(a.withCredentials=!!t.withCredentials),this.setHeaders(a,s),c?a.send(c):a.send()}catch(t){this.error(t)}},e.prototype.serializeBody=function(t,e){if(!t||"string"==typeof t)return t;if(dt.a.FormData&&t instanceof dt.a.FormData)return t;if(e){var r=e.indexOf(";");-1!==r&&(e=e.substring(0,r))}switch(e){case"application/x-www-form-urlencoded":return Object.keys(t).map((function(e){return encodeURIComponent(e)+"="+encodeURIComponent(t[e])})).join("&");case"application/json":return JSON.stringify(t);default:return t}},e.prototype.setHeaders=function(t,e){for(var r in e)e.hasOwnProperty(r)&&t.setRequestHeader(r,e[r])},e.prototype.getHeader=function(t,e){for(var r in t)if(r.toLowerCase()===e.toLowerCase())return t[r]},e.prototype.setupEvents=function(t,e){var r=e.progressSubscriber;function n(t){var e,r=n,i=r.subscriber,o=r.progressSubscriber,u=r.request;o&&o.error(t);try{e=new jt(this,u)}catch(t){e=t}i.error(e)}if(t.ontimeout=n,n.request=e,n.subscriber=this,n.progressSubscriber=r,t.upload&&"withCredentials"in t){var i,o;if(r)i=function(t){i.progressSubscriber.next(t)},dt.a.XDomainRequest?t.onprogress=i:t.upload.onprogress=i,i.progressSubscriber=r;o=function(t){var e,r=o,n=r.progressSubscriber,i=r.subscriber,u=r.request;n&&n.error(t);try{e=new Tt("ajax error",this,u)}catch(t){e=t}i.error(e)},t.onerror=o,o.request=e,o.subscriber=this,o.progressSubscriber=r}function u(t){}function s(t){var e=s,r=e.subscriber,n=e.progressSubscriber,i=e.request;if(4===this.readyState){var o=1223===this.status?204:this.status,u="text"===this.responseType?this.response||this.responseText:this.response;if(0===o&&(o=u?200:0),o<400)n&&n.complete(),r.next(t),r.complete();else{n&&n.error(t);var c=void 0;try{c=new Tt("ajax error "+o,this,i)}catch(t){c=t}r.error(c)}}}t.onreadystatechange=u,u.subscriber=this,u.progressSubscriber=r,u.request=e,t.onload=s,s.subscriber=this,s.progressSubscriber=r,s.request=e},e.prototype.unsubscribe=function(){var e=this.done,r=this.xhr;!e&&r&&4!==r.readyState&&"function"==typeof r.abort&&r.abort(),t.prototype.unsubscribe.call(this)},e}(N),Et=function(){return function(t,e,r){this.originalEvent=t,this.xhr=e,this.request=r,this.status=e.status,this.responseType=e.responseType||r.responseType,this.response=Ot(this.responseType,e)}}(),Tt=function(){function t(t,e,r){return Error.call(this),this.message=t,this.name="AjaxError",this.xhr=e,this.request=r,this.status=e.status,this.responseType=e.responseType||r.responseType,this.response=Ot(this.responseType,e),this}return t.prototype=Object.create(Error.prototype),t}();function Ot(t,e){switch(t){case"json":return function(t){return"response"in t?t.responseType?t.response:JSON.parse(t.response||t.responseText||"null"):JSON.parse(t.responseText||"null")}(e);case"xml":return e.responseXML;case"text":default:return"response"in e?e.response:e.responseText}}var jt=function(t,e){return Tt.call(this,"ajax timeout",t,e),this.name="AjaxTimeoutError",this},It=function(){return xt.create}();function Nt(t,e){return function(r){return r.lift(new At(t,e))}}var At=function(){function t(t,e){this.predicate=t,this.thisArg=e}return t.prototype.call=function(t,e){return e.subscribe(new kt(t,this.predicate,this.thisArg))},t}(),kt=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.predicate=r,i.thisArg=n,i.count=0,i}return b(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 Pt(t,e,r){return function(n){return n.lift(new $t(t,e,r))}}var $t=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 Ct(t,this.nextOrObserver,this.error,this.complete))},t}(),Ct=function(t){function e(e,r,n,i){var o=t.call(this,e)||this;return o._tapNext=P,o._tapError=P,o._tapComplete=P,o._tapError=n||P,o._tapComplete=i||P,m(r)?(o._context=o,o._tapNext=r):r&&(o._context=r,o._tapNext=r.next||P,o._tapError=r.error||P,o._tapComplete=r.complete||P),o}return b(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 qt(){for(var t=[],e=0;e0&&r[0].time-n.now()<=0;)r.shift().notification.observe(i);if(r.length>0){var o=Math.max(0,r[0].time-n.now());this.schedule(t,o)}else this.unsubscribe(),e.active=!1},e.prototype._schedule=function(t){this.active=!0,this.destination.add(t.schedule(e.dispatch,this.delay,{source:this,destination:this.destination,scheduler:t}))},e.prototype.scheduleNotification=function(t){if(!0!==this.errored){var e=this.scheduler,r=new Qt(e.now()+this.delay,t);this.queue.push(r),!1===this.active&&this._schedule(e)}},e.prototype._next=function(t){this.scheduleNotification(Bt.createNext(t))},e.prototype._error=function(t){this.errored=!0,this.queue=[],this.destination.error(t),this.unsubscribe()},e.prototype._complete=function(){this.scheduleNotification(Bt.createComplete()),this.unsubscribe()},e}(N),Qt=function(){return function(t,e){this.time=t,this.notification=e}}();function Zt(t,e){return e?Dt((function(){return t}),e):Dt((function(){return t}))}var te=new q(P);function ee(t,e){var r=!1;return arguments.length>=2&&(r=!0),function(n){return n.lift(new re(t,e,r))}}var re=function(){function t(t,e,r){void 0===r&&(r=!1),this.accumulator=t,this.seed=e,this.hasSeed=r}return t.prototype.call=function(t,e){return e.subscribe(new ne(t,this.accumulator,this.seed,this.hasSeed))},t}(),ne=function(t){function e(e,r,n,i){var o=t.call(this,e)||this;return o.accumulator=r,o._seed=n,o.hasSeed=i,o.index=0,o}return b(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,r=this.index++;try{e=this.accumulator(this.seed,t,r)}catch(t){this.destination.error(t)}this.seed=e,this.destination.next(e)},e}(N),ie=function(t){function e(e,r){var n=t.call(this,e,r)||this;return n.scheduler=e,n.work=r,n}return b(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}(Yt),oe=new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return b(e,t),e}(zt))(ie);function ue(t,e){return void 0===e&&(e=0),function(r){return r.lift(new se(t,e))}}var se=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 ce(t,this.scheduler,this.delay))},t}(),ce=function(t){function e(e,r,n){void 0===n&&(n=0);var i=t.call(this,e)||this;return i.scheduler=r,i.delay=n,i}return b(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 ae(t,this.destination)))},e.prototype._next=function(t){this.scheduleMessage(Bt.createNext(t))},e.prototype._error=function(t){this.scheduleMessage(Bt.createError(t)),this.unsubscribe()},e.prototype._complete=function(){this.scheduleMessage(Bt.createComplete()),this.unsubscribe()},e}(N),ae=function(){return function(t,e){this.notification=t,this.destination=e}}(),fe=function(t){function e(e,r,n){void 0===e&&(e=Number.POSITIVE_INFINITY),void 0===r&&(r=Number.POSITIVE_INFINITY);var i=t.call(this)||this;return i.scheduler=n,i._events=[],i._infiniteTimeWindow=!1,i._bufferSize=e<1?1:e,i._windowTime=r<1?1:r,r===Number.POSITIVE_INFINITY?(i._infiniteTimeWindow=!0,i.next=i.nextInfiniteTimeWindow):i.next=i.nextTimeWindow,i}return b(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 le(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(),i=this.scheduler,o=n.length;if(this.closed)throw new R;if(this.isStopped||this.hasError?e=O.EMPTY:(this.observers.push(t),e=new H(this,t)),i&&t.add(t=new ce(t,i)),r)for(var u=0;ue&&(o=Math.max(o,i-e)),o>0&&n.splice(0,o),n},e}(L),le=function(){return function(t,e){this.time=t,this.value=e}}();function he(t,e,r){var n;return n=t&&"object"==typeof t?t:{bufferSize:t,windowTime:e,refCount:!1,scheduler:r},function(t){return t.lift(function(t){var e,r,n=t.bufferSize,i=void 0===n?Number.POSITIVE_INFINITY:n,o=t.windowTime,u=void 0===o?Number.POSITIVE_INFINITY:o,s=t.refCount,c=t.scheduler,a=0,f=!1,l=!1;return function(t){a++,e&&!f||(f=!1,e=new fe(i,u,c),r=t.subscribe({next:function(t){e.next(t)},error:function(t){f=!0,e.error(t)},complete:function(){l=!0,e.complete()}}));var n=e.subscribe(this);this.add((function(){a--,n.unsubscribe(),r&&!l&&s&&0===a&&(r.unsubscribe(),r=void 0,e=void 0)}))}}(n))}}function pe(t,e,r,n){return m(r)&&(n=r,r=void 0),n?pe(t,e,r).pipe(G((function(t){return S(t)?n.apply(void 0,t):n(t)}))):new q((function(n){!function t(e,r,n,i,o){var u;if(function(t){return t&&"function"==typeof t.addEventListener&&"function"==typeof t.removeEventListener}(e)){var s=e;e.addEventListener(r,n,o),u=function(){return s.removeEventListener(r,n,o)}}else if(function(t){return t&&"function"==typeof t.on&&"function"==typeof t.off}(e)){var c=e;e.on(r,n),u=function(){return c.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;f1?n.next(Array.prototype.slice.call(arguments)):n.next(t)}),n,r)}))}function de(t){return function(e){return e.lift(new ye(t))}}var ye=function(){function t(t){this.value=t}return t.prototype.call=function(t,e){return e.subscribe(new ve(t,this.value))},t}(),ve=function(t){function e(e,r){var n=t.call(this,e)||this;return n.value=r,n}return b(e,t),e.prototype._next=function(t){this.destination.next(this.value)},e}(N);function be(){for(var t=[],e=0;e1)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),Ie=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 b(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 O).add(this.source.subscribe(new Ae(this.getSubject(),this))),t.closed&&(this._connection=null,t=O.EMPTY)),t},e.prototype.refCount=function(){return Te()(this)},e}(q),Ne=function(){var t=Ie.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}}}(),Ae=function(t){function e(e,r){var n=t.call(this,e)||this;return n.connectable=r,n}return b(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}(D);var ke=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(),i=r(n).subscribe(t);return i.add(e.subscribe(n)),i},t}();function Pe(){return new L}function $e(){return function(t){return Te()((e=Pe,function(t){var n;if(n="function"==typeof e?e:function(){return e},"function"==typeof r)return t.lift(new ke(n,r));var i=Object.create(t,Ne);return i.source=t,i.subjectFactory=n,i})(t));var e,r}}var Ce=pe(window,"hashchange"),qe=pe(window,"popstate");function Me(t){var e=matchMedia(t);return function t(e,r,n){return n?t(e,r).pipe(G((function(t){return S(t)?n.apply(void 0,t):n(t)}))):new q((function(t){var n,i=function(){for(var e=[],r=0;r0?t.prototype.requestAsyncId.call(this,e,r,n):(e.actions.push(this),e.scheduled||(e.scheduled=requestAnimationFrame((function(){return e.flush(null)}))))},e.prototype.recycleAsyncId=function(e,r,n){if(void 0===n&&(n=0),null!==n&&n>0||null===n&&this.delay>0)return t.prototype.recycleAsyncId.call(this,e,r,n);0===e.actions.length&&(cancelAnimationFrame(r),e.scheduled=void 0)},e}(Yt),Xe=new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return b(e,t),e.prototype.flush=function(t){this.active=!0,this.scheduled=void 0;var e,r=this.actions,n=-1,i=r.length;t=t||r.shift();do{if(e=t.execute(t.state,t.delay))break}while(++n=e})),we(),ue(Xe),Pt((function(e){!function(t,e){t.setAttribute("data-md-state",e?"hidden":"")}(t,e)})),We((function(){!function(t){t.removeAttribute("data-md-state")}(t)})))}function nr(t,e){var r=e;if(t.length>r){for(;" "!==t[r]&&--r>0;);return t.substring(0,r)+"..."}return t}function ir(t,e){if(void 0===Be){var r=Se("#__lang");Be=JSON.parse(r.innerText)}if(void 0===Be[t])throw new ReferenceError("Invalid translation: "+t);return void 0!==e?Be[t].replace("#",e):Be[t]}var or=function(){return(or=Object.assign||function(t){for(var e,r=1,n=arguments.length;r=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};function sr(t){return e=function(){var e="fixed"===getComputedStyle(t).getPropertyValue("position");return X({sticky:e,height:e?t.offsetHeight:0})},new q((function(t){var r;try{r=e()}catch(e){return void t.error(e)}return(r?it(r):B()).subscribe(t)}));var e}var cr={};function ar(){for(var t=[],e=0;e0)&&!(n=o.next()).done;)u.push(n.value)}catch(t){i={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return u};function pr(t,e,r){var n=e.viewport,i=r.header$,o=n.size$.pipe(Zt(i),G((function(e){var r=e.height;return t.offsetTop-r})),we());return ar([n.offset$,o]).pipe(G((function(t){var e=hr(t,2),r=e[0];return{x:r.x,y:r.y-e[1]}})),he(1))}function dr(t){return $((e="active",we((function(t,n){return r?r(t[e],n[e]):t[e]===n[e]}))),ue(Xe),Pt((function(e){var r=e.active;!function(t,e){t.setAttribute("data-md-state",e?"shadow":"")}(t,r)})),We((function(){!function(t){t.removeAttribute("data-md-state")}(t)})));var e,r}r(6);var yr=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};function vr(t,e){var r,n;if("string"==typeof e||"number"==typeof e)t.innerHTML+=e.toString();else if(e instanceof Node)t.appendChild(e);else if(Array.isArray(e))try{for(var i=yr(e),o=i.next();!o.done;o=i.next()){vr(t,o.value)}}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}}function br(t,e){for(var r,n,i,o,u=[],s=2;s0)&&!(n=o.next()).done;)u.push(n.value)}catch(t){i={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return u};function _r(t,e){var r=t.pipe(Nt((function(t){return t}))),n=t.pipe(Nt((function(t){return!t})));return $(Dt((function(t){return ar([X(t),r])})),Dt((function(t){var r,i=gr(t,2),o=i[0];return i[1]?e(o).pipe((r=n,function(t){return t.lift(new mr(r))})):W})))}function xr(t,e){return $(_r(t.media.screen$,(function(r){return function(t,e,r){return pr(t,e,{header$:r.header$}).pipe(rr(t,20)).pipe(G((function(t){return{hidden:t}})))}(r,t,e)})),he(1))}var Sr=function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,i,o=r.call(t),u=[];try{for(;(void 0===e||e-- >0)&&!(n=o.next()).done;)u.push(n.value)}catch(t){i={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return u};function Er(t,e){return $(Dt((function(r){return function(t,e,r){var n=e.viewport,i=r.header$.pipe(qt("height")),o=ar([n.offset$,n.size$,i]).pipe(G((function(e){var r=Sr(e,3),n=r[0].y,i=r[1].height,o=r[2],u=t.offsetTop,s=t.offsetHeight+u;return i-Math.max(0,u-n,o)-Math.max(0,i+n-s)})),we()),u=ar([n.offset$,i]).pipe(G((function(e){var r=Sr(e,2),n=r[0].y,i=r[1];return n>=t.offsetTop-i})),we());return ar([o,i,u]).pipe(G((function(e){var r=Sr(e,3),n=r[0],i=r[1],o=r[2];return{offset:t.offsetTop-i,height:n,active:o}})))}(r,t,e)})),he(1))}function Tr(t){return function e(r,o){switch(arguments.length){case 0:return e;case 1:return n(r)?e:i((function(e){return t(r,e)}));default:return n(r)&&n(o)?e:n(r)?i((function(e){return t(e,o)})):n(o)?i((function(e){return t(r,e)})):t(r,o)}}}function Or(t){for(var e,r=[];!(e=t.next()).done;)r.push(e.value);return r}function jr(t,e,r){for(var n=0,i=r.length;n=0;){if(r[c]===t)return n[c]===e;c-=1}switch(u){case"Map":return t.size===e.size&&Ar(t.entries(),e.entries(),r.concat([t]),n.concat([e]));case"Set":return t.size===e.size&&Ar(t.values(),e.values(),r.concat([t]),n.concat([e]));case"Arguments":case"Array":case"Object":case"Boolean":case"Number":case"String":case"Date":case"Error":case"RegExp":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"ArrayBuffer":break;default:return!1}var a=d(t);if(a.length!==d(e).length)return!1;var f=r.concat([t]),l=n.concat([e]);for(c=a.length-1;c>=0;){var h=a[c];if(!s(h,e)||!kr(e[h],t[h],f,l))return!1;c-=1}return!0}var Pr=Tr((function(t,e){return kr(t,e,[],[])})),$r=function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,i,o=r.call(t),u=[];try{for(;(void 0===e||e-- >0)&&!(n=o.next()).done;)u.push(n.value)}catch(t){i={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return u};function Cr(t,e,r){var n=e.viewport,i=r.main$,o=parseFloat(getComputedStyle(t.parentElement).getPropertyValue("padding-top")),u=ar([n.offset$,i]).pipe(G((function(t){var e=$r(t,2),r=e[0].y,n=e[1],i=n.offset;return n.height-o+Math.min(o,Math.max(0,r-i))}))),s=ar([n.offset$,i]).pipe(G((function(t){var e=$r(t,2);return e[0].y>=e[1].offset+o})));return ar([u,s]).pipe(G((function(t){var e=$r(t,2);return{height:e[0],lock:e[1]}})),we(Pr),he(1))}function qr(t){return $(ue(Xe),Pt((function(e){var r=e.height,n=e.lock;!function(t,e){t.style.height=e+"px"}(t,r),function(t,e){t.setAttribute("data-md-state",e?"lock":"")}(t,n)})),We((function(){!function(t){t.style.height=""}(t),function(t){t.removeAttribute("data-md-state")}(t)})))}function Mr(t,e){return $(_r(t.media.screen$,(function(r){return function(t,e,r){return Cr(t,e,{main$:r.main$}).pipe(qr(t)).pipe(G((function(t){return{sidebar:t}})))}(r,t,e)})),he(1))}var Rr=function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,i,o=r.call(t),u=[];try{for(;(void 0===e||e-- >0)&&!(n=o.next()).done;)u.push(n.value)}catch(t){i={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return u};function Hr(t,e){var r=e.prepare;return ar([pe(t,"keyup").pipe(G((function(){return r(t.value)})),me(""),we()),function(t){var e=pe(t,"focus"),r=pe(t,"blur");return pt(e.pipe(de(!0)),r.pipe(de(!1))).pipe(me(t===document.activeElement),he(1))}(t)]).pipe(G((function(t){var e=Rr(t,2);return{value:e[0],focus:e[1]}})),he(1))}function Dr(t){return pe(t,"click").pipe(de(void 0))}var Lr={link:"md-search-result__link",article:"md-search-result__article md-search-result__article--document",title:"md-search-result__title",teaser:"md-search-result__teaser"};var Vr={link:"md-search-result__link",article:"md-search-result__article",title:"md-search-result__title",teaser:"md-search-result__teaser"};function Ur(t){var e=t.location,r=t.title,n=t.text;return br("a",{href:e,title:r,class:Vr.link,tabIndex:-1},br("article",{class:Vr.article},br("h1",{class:Vr.title},r),n.length?br("p",{class:Vr.teaser},nr(n,320)):void 0))}var Yr={item:"md-search-result__item"};function Fr(t){var e=t.article,r=t.sections;return br("li",{class:Yr.item},function(t){var e=t.location,r=t.title,n=t.text;return br("a",{href:e,title:r,class:Lr.link,tabIndex:-1},br("article",{class:Lr.article},br("h1",{class:Lr.title},r),n.length?br("p",{class:Lr.teaser},nr(n,320)):void 0))}(e),r.map(Ur))}var zr=function(){function t(t,e){this.observables=t,this.project=e}return t.prototype.call=function(t,e){return e.subscribe(new Xr(t,this.observables,this.project))},t}(),Xr=function(t){function e(e,r,n){var i=t.call(this,e)||this;i.observables=r,i.project=n,i.toRespond=[];var o=r.length;i.values=new Array(o);for(var u=0;u0){var u=o.indexOf(r);-1!==u&&o.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}(ct),Wr=function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,i,o=r.call(t),u=[];try{for(;(void 0===e||e-- >0)&&!(n=o.next()).done;)u.push(n.value)}catch(t){i={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return u};function Br(t,e){var r=e.query$,n=Se(".md-search-result__meta",t);return $(function(){for(var t=[],e=0;e1?ir("search.result.other",e.toString()):ir(1===e?"search.result.one":"search.result.none")}(n,r.length):function(t){t.textContent=ir("search.result.placeholder")}(n),r})))}function Gr(t,e,r){var n=r.result$,i=r.query$,o=t.parentElement,s=function(t,e){var r=e.viewport;return pt(pe(t,"scroll"),r.size$).pipe(G((function(){return Ee(t)})),me(Ee(t)),he(1))}(o,e).pipe(G((function(t){return t.y>=o.scrollHeight-o.offsetHeight-16})),we(),Nt(u));return n.pipe(Pt((function(t){console.log("watchSearchResult",t)})),Br(t,{query$:i}),function(t,e){var r=e.render$,n=t.parentElement,i=Se(".md-search-result__list",t);return $(Dt((function(t){return r.pipe(ue(Xe),ee((function(e){for(;e16)););return e}),0),de(t),We((function(){!function(t){t.innerHTML=""}(i)})))})))}(t,{render$:s}))}function Jr(t,e){return $(_r(t.media.screen$,(function(r){return function(t,e,r){return pr(t,e,{header$:r.header$}).pipe(rr(t,8)).pipe(G((function(t){return{hidden:t}})))}(r,t,e)})),he(1))}var Kr=i((function(t){return e=t,"[object String]"===Object.prototype.toString.call(e)?t.split("").reverse().join(""):Array.prototype.slice.call(t,0).reverse();var e}));function Qr(t,e){return function(t,e,r){var n,i;if("function"==typeof t.indexOf)switch(typeof e){case"number":if(0===e){for(n=1/e;r=0}function Zr(t,e,r){var n,i=typeof t;switch(i){case"string":case"number":return 0===t&&1/t==-1/0?!!r._items["-0"]||(e&&(r._items["-0"]=!0),!1):null!==r._nativeSet?e?(n=r._nativeSet.size,r._nativeSet.add(t),r._nativeSet.size===n):r._nativeSet.has(t):i in r._items?t in r._items[i]||(e&&(r._items[i][t]=!0),!1):(e&&(r._items[i]={},r._items[i][t]=!0),!1);case"boolean":if(i in r._items){var o=t?1:0;return!!r._items[i][o]||(e&&(r._items[i][o]=!0),!1)}return e&&(r._items[i]=t?[!1,!0]:[!0,!1]),!1;case"function":return null!==r._nativeSet?e?(n=r._nativeSet.size,r._nativeSet.add(t),r._nativeSet.size===n):r._nativeSet.has(t):i in r._items?!!Qr(t,r._items[i])||(e&&r._items[i].push(t),!1):(e&&(r._items[i]=[t]),!1);case"undefined":return!!r._items[i]||(e&&(r._items[i]=!0),!1);case"object":if(null===t)return!!r._items.null||(e&&(r._items.null=!0),!1);default:return(i=Object.prototype.toString.call(t))in r._items?!!Qr(t,r._items[i])||(e&&r._items[i].push(t),!1):(e&&(r._items[i]=[t]),!1)}}var tn=function(){function t(){this._nativeSet="function"==typeof Set?new Set:null,this._items={}}return t.prototype.add=function(t){return!Zr(t,!0,this)},t.prototype.has=function(t){return Zr(t,!1,this)},t}(),en=Tr((function(t,e){for(var r=[],n=0,i=t.length,o=e.length,u=new tn,s=0;s=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},nn=function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,i,o=r.call(t),u=[];try{for(;(void 0===e||e-- >0)&&!(n=o.next()).done;)u.push(n.value)}catch(t){i={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return u},on=function(){for(var t=[],e=0;e0)&&!(n=o.next()).done;)u.push(n.value)}catch(t){i={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return u};function an(t,e,r){var n,i,o=r.header$,u=Cr(t,e,{main$:r.main$}).pipe(qr(t)),s=(n=".md-nav__link",void 0===(i=t)&&(i=document),Array.from(i.querySelectorAll(n))),c=function(t,e,r){var n,i,o=e.viewport,u=r.header$,s=new Map;try{for(var c=rn(t),a=c.next();!a.done;a=c.next()){var f=a.value,l=Se('[id="'+decodeURIComponent(f.hash.substring(1))+'"]');void 0!==l&&s.set(f,l)}}catch(t){n={error:t}}finally{try{a&&!a.done&&(i=c.return)&&i.call(c)}finally{if(n)throw n.error}}var h=u.pipe(G((function(t){return 18+t.height})));return o.size$.pipe(G((function(){var t=[];return on(s).reduce((function(e,r){for(var n=nn(r,2),i=n[0],o=n[1];t.length;){if(!(s.get(t[t.length-1]).tagName>=o.tagName))break;t.pop()}return e.set(Kr(t=on(t,[i])),o.offsetTop)}),new Map)})),Dt((function(t){return ar(o.offset$,h).pipe(ee((function(t,e){for(var r=nn(t,2),n=r[0],i=r[1],o=nn(e,2),u=o[0].y,s=o[1];i.length;){if(!(nn(i[0],2)[1]-s=u))break;i=on([n.pop()],i)}return[n,i]}),[[],on(t)]),we((function(t,e){return t[0]===e[0]&&t[1]===e[1]})))}))).pipe(G((function(t){var e=nn(t,2),r=e[0],n=e[1];return{prev:r.map((function(t){return nn(t,1)[0]})),next:n.map((function(t){return nn(t,1)[0]}))}})),ee((function(t,e){var r=Math.max(0,Math.min(e.prev.length,t.prev.length)-1),n=Math.max(e.prev.length,t.prev.length);return{prev:e.prev.slice(r,n+1),next:en(e.next,t.next)}}),{prev:[],next:[]})).pipe(he(1))}(s,e,{header$:o}).pipe(function(t){return $(ue(Xe),Pt((function(t){var e,r,n,i,o=t.prev,u=t.next;try{for(var s=rn(u),c=s.next();!c.done;c=s.next()){tr(l=nn(c.value,1)[0]),Qe(l)}}catch(t){e={error:t}}finally{try{c&&!c.done&&(r=s.return)&&r.call(s)}finally{if(e)throw e.error}}try{for(var a=rn(o.entries()),f=a.next();!f.done;f=a.next()){var l,h=nn(f.value,2),p=h[0];Ze(l=nn(h[1],1)[0],p===o.length-1),Ke(l,!0)}}catch(t){n={error:t}}finally{try{f&&!f.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}})),We((function(){var e,r;try{for(var n=rn(t),i=n.next();!i.done;i=n.next()){var o=i.value;tr(o),Qe(o)}}catch(t){e={error:t}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(e)throw e.error}}})))}(s));return ar([u,c]).pipe(G((function(t){var e=cn(t,2);return{sidebar:e[0],anchors:e[1]}})))}function fn(t){return t.type===sn.DUMP}function ln(t){return t.type===sn.RESULT}!function(t){t[t.STRING=0]="STRING",t[t.BINARY=1]="BINARY"}(un||(un={})),function(t){t[t.SETUP=0]="SETUP",t[t.DUMP=1]="DUMP",t[t.QUERY=2]="QUERY",t[t.RESULT=3]="RESULT"}(sn||(sn={})),r.d(e,"initialize",(function(){return mn}));var hn=function(){return(hn=Object.assign||function(t){for(var e,r=1,n=arguments.length;r0)&&!(n=o.next()).done;)u.push(n.value)}catch(t){i={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return u},dn=function(){for(var t=[],e=0;e0})),$e())},media:{screen$:Me("(min-width: 1220px)"),tablet$:Me("(min-width: 960px)")},viewport:{offset$:pt(Re,He).pipe(G(De),me(De()),he(1)),size$:He.pipe(G(Le),me(Le()),he(1))}},n=pn(bn(t),2),i=n[0],o=n[1],s=function(t,e){return e.document$.pipe(G((function(e){return t.reduce((function(t,r){var n,i=Se("[data-md-component="+r+"]",e);return or(or({},t),void 0!==i?((n={})[r]=i,n):{})}),{})})),ee((function(t,e){var r,n;try{for(var i=ur(d(t)),o=i.next();!o.done;o=i.next()){var u=o.value;switch(u){case"title":case"container":u in t&&void 0!==t[u]&&(t[u].replaceWith(e[u]),t[u]=e[u]);break;default:t[u]=Se("[data-md-component="+u+"]")}}}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return t}))).pipe(he(1))}(yn,{document$:r.document.load$}),c=function(t){return s.pipe(function(t){return $(Dt((function(e){return void 0!==e[t]?X(e[t]):te})))}(t))},a=c("header").pipe(Dt(sr));c("header").pipe(Dt((function(t){return p.pipe(dr(t))}))).subscribe();var f=i.pipe(Pt((function(t){return console.log("message from worker",t)})),Nt(ln),qt("data")),l=c("query").pipe(Dt((function(t){return Hr(t,{prepare:vn})})));l.pipe(G((function(t){return{type:sn.QUERY,data:t.value}}))).subscribe(o),l.pipe(Pt((function(t){var e,r;t.focus&&(r=!0,(e=_).checked!==r&&e.click())}))).subscribe();var h,p=c("main").pipe(Er(r,{header$:a})),v=c("navigation").pipe(Mr(r,{main$:p})),b=c("toc").pipe(function(t,e){return $(_r(t.media.tablet$,(function(r){return an(r,t,e)})),he(1))}(r,{header$:a,main$:p})),m=c("result").pipe(function(t,e){return $(Dt((function(r){return Gr(r,t,e)})),he(1))}(r,{result$:f,query$:l.pipe(qt("value"))})),w=c("tabs").pipe(Jr(r,{header$:a})),g=c("hero").pipe(xr(r,{header$:a})),_=(Se("[data-md-toggle=drawer]"),Se("[data-md-toggle=search]")),x=(h=_,pe(h,"change").pipe(qt("checked"))).pipe(Nt(u),Gt(400)),S=c("reset").pipe(Dt(Dr));pt(x,S).pipe(Zt(c("query")),Pt((function(t){return t.focus()}))).subscribe();var E={query$:l,result$:m,reset$:S,main$:p,navigation$:v,toc$:b,tabs$:w,hero$:g};return pt.apply(void 0,dn(y(E))).subscribe(),{agent:r,state:E}}}])); +!function(t,e){for(var r in e)t[r]=e[r]}(window,function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.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 i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));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=7)}([,,function(t,e,r){"use strict";(function(t){r.d(e,"a",(function(){return o}));var n="undefined"!=typeof window&&window,i="undefined"!=typeof self&&"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self,o=n||void 0!==t&&t||i}).call(this,r(5))},,,function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e){},function(t,e,r){"use strict";function n(t){return null!=t&&"object"==typeof t&&!0===t["@@functional/placeholder"]}function i(t){return function e(r){return 0===arguments.length||n(r)?e:t.apply(this,arguments)}}function o(t){return t}r.r(e);var u=i(o);function s(t,e){return Object.prototype.hasOwnProperty.call(e,t)}var c=Object.prototype.toString,a=function(){return"[object Arguments]"===c.call(arguments)?function(t){return"[object Arguments]"===c.call(t)}:function(t){return s("callee",t)}}(),f=!{toString:null}.propertyIsEnumerable("toString"),l=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],h=function(){return arguments.propertyIsEnumerable("length")}(),p=function(t,e){for(var r=0;r=0;)s(e=l[r],t)&&!p(n,e)&&(n[n.length]=e),r-=1;return n})):i((function(t){return Object(t)!==t?[]:Object.keys(t)})),y=i((function(t){for(var e=d(t),r=e.length,n=[],i=0;i0?this._next(e.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},e}(ct);function lt(t){return t}function ht(t){return void 0===t&&(t=Number.POSITIVE_INFINITY),function t(e,r,n){return void 0===n&&(n=Number.POSITIVE_INFINITY),"function"==typeof r?function(i){return i.pipe(t((function(t,n){return it(e(t,n)).pipe(G((function(e,i){return r(t,e,n,i)})))}),n))}:("number"==typeof r&&(n=r),function(t){return t.lift(new at(e,n))})}(lt,t)}function pt(){for(var t=[],e=0;e1&&"number"==typeof t[t.length-1]&&(r=t.pop())):"number"==typeof i&&(r=t.pop()),null===n&&1===t.length&&t[0]instanceof q?t[0]:ht(r)(z(t,n))}var dt=r(2);function yt(t,e){return void 0===e&&(e=null),new xt({method:"GET",url:t,headers:e})}function vt(t,e,r){return new xt({method:"POST",url:t,body:e,headers:r})}function bt(t,e){return new xt({method:"DELETE",url:t,headers:e})}function mt(t,e,r){return new xt({method:"PUT",url:t,body:e,headers:r})}function wt(t,e,r){return new xt({method:"PATCH",url:t,body:e,headers:r})}var gt=G((function(t,e){return t.response}));function _t(t,e){return gt(new xt({method:"GET",url:t,responseType:"json",headers:e}))}var xt=function(t){function e(e){var r=t.call(this)||this,n={async:!0,createXHR:function(){return this.crossDomain?function(){if(dt.a.XMLHttpRequest)return new dt.a.XMLHttpRequest;if(dt.a.XDomainRequest)return new dt.a.XDomainRequest;throw new Error("CORS is not supported by your browser")}():function(){if(dt.a.XMLHttpRequest)return new dt.a.XMLHttpRequest;var t=void 0;try{for(var e=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],r=0;r<3;r++)try{if(t=e[r],new dt.a.ActiveXObject(t))break}catch(t){}return new dt.a.ActiveXObject(t)}catch(t){throw new Error("XMLHttpRequest is not supported by your browser")}}()},crossDomain:!0,withCredentials:!1,headers:{},method:"GET",responseType:"json",timeout:0};if("string"==typeof e)n.url=e;else for(var i in e)e.hasOwnProperty(i)&&(n[i]=e[i]);return r.request=n,r}var r;return b(e,t),e.prototype._subscribe=function(t){return new St(t,this.request)},e.create=((r=function(t){return new e(t)}).get=yt,r.post=vt,r.delete=bt,r.put=mt,r.patch=wt,r.getJSON=_t,r),e}(q),St=function(t){function e(e,r){var n=t.call(this,e)||this;n.request=r,n.done=!1;var i=r.headers=r.headers||{};return r.crossDomain||n.getHeader(i,"X-Requested-With")||(i["X-Requested-With"]="XMLHttpRequest"),n.getHeader(i,"Content-Type")||dt.a.FormData&&r.body instanceof dt.a.FormData||void 0===r.body||(i["Content-Type"]="application/x-www-form-urlencoded; charset=UTF-8"),r.body=n.serializeBody(r.body,n.getHeader(r.headers,"Content-Type")),n.send(),n}return b(e,t),e.prototype.next=function(t){this.done=!0;var e,r=this.xhr,n=this.request,i=this.destination;try{e=new Et(t,r,n)}catch(t){return i.error(t)}i.next(e)},e.prototype.send=function(){var t=this.request,e=this.request,r=e.user,n=e.method,i=e.url,o=e.async,u=e.password,s=e.headers,c=e.body;try{var a=this.xhr=t.createXHR();this.setupEvents(a,t),r?a.open(n,i,o,r,u):a.open(n,i,o),o&&(a.timeout=t.timeout,a.responseType=t.responseType),"withCredentials"in a&&(a.withCredentials=!!t.withCredentials),this.setHeaders(a,s),c?a.send(c):a.send()}catch(t){this.error(t)}},e.prototype.serializeBody=function(t,e){if(!t||"string"==typeof t)return t;if(dt.a.FormData&&t instanceof dt.a.FormData)return t;if(e){var r=e.indexOf(";");-1!==r&&(e=e.substring(0,r))}switch(e){case"application/x-www-form-urlencoded":return Object.keys(t).map((function(e){return encodeURIComponent(e)+"="+encodeURIComponent(t[e])})).join("&");case"application/json":return JSON.stringify(t);default:return t}},e.prototype.setHeaders=function(t,e){for(var r in e)e.hasOwnProperty(r)&&t.setRequestHeader(r,e[r])},e.prototype.getHeader=function(t,e){for(var r in t)if(r.toLowerCase()===e.toLowerCase())return t[r]},e.prototype.setupEvents=function(t,e){var r=e.progressSubscriber;function n(t){var e,r=n,i=r.subscriber,o=r.progressSubscriber,u=r.request;o&&o.error(t);try{e=new jt(this,u)}catch(t){e=t}i.error(e)}if(t.ontimeout=n,n.request=e,n.subscriber=this,n.progressSubscriber=r,t.upload&&"withCredentials"in t){var i,o;if(r)i=function(t){i.progressSubscriber.next(t)},dt.a.XDomainRequest?t.onprogress=i:t.upload.onprogress=i,i.progressSubscriber=r;o=function(t){var e,r=o,n=r.progressSubscriber,i=r.subscriber,u=r.request;n&&n.error(t);try{e=new Tt("ajax error",this,u)}catch(t){e=t}i.error(e)},t.onerror=o,o.request=e,o.subscriber=this,o.progressSubscriber=r}function u(t){}function s(t){var e=s,r=e.subscriber,n=e.progressSubscriber,i=e.request;if(4===this.readyState){var o=1223===this.status?204:this.status,u="text"===this.responseType?this.response||this.responseText:this.response;if(0===o&&(o=u?200:0),o<400)n&&n.complete(),r.next(t),r.complete();else{n&&n.error(t);var c=void 0;try{c=new Tt("ajax error "+o,this,i)}catch(t){c=t}r.error(c)}}}t.onreadystatechange=u,u.subscriber=this,u.progressSubscriber=r,u.request=e,t.onload=s,s.subscriber=this,s.progressSubscriber=r,s.request=e},e.prototype.unsubscribe=function(){var e=this.done,r=this.xhr;!e&&r&&4!==r.readyState&&"function"==typeof r.abort&&r.abort(),t.prototype.unsubscribe.call(this)},e}(N),Et=function(){return function(t,e,r){this.originalEvent=t,this.xhr=e,this.request=r,this.status=e.status,this.responseType=e.responseType||r.responseType,this.response=Ot(this.responseType,e)}}(),Tt=function(){function t(t,e,r){return Error.call(this),this.message=t,this.name="AjaxError",this.xhr=e,this.request=r,this.status=e.status,this.responseType=e.responseType||r.responseType,this.response=Ot(this.responseType,e),this}return t.prototype=Object.create(Error.prototype),t}();function Ot(t,e){switch(t){case"json":return function(t){return"response"in t?t.responseType?t.response:JSON.parse(t.response||t.responseText||"null"):JSON.parse(t.responseText||"null")}(e);case"xml":return e.responseXML;case"text":default:return"response"in e?e.response:e.responseText}}var jt=function(t,e){return Tt.call(this,"ajax timeout",t,e),this.name="AjaxTimeoutError",this},It=function(){return xt.create}();function Nt(t,e){return function(r){return r.lift(new At(t,e))}}var At=function(){function t(t,e){this.predicate=t,this.thisArg=e}return t.prototype.call=function(t,e){return e.subscribe(new kt(t,this.predicate,this.thisArg))},t}(),kt=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.predicate=r,i.thisArg=n,i.count=0,i}return b(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 Pt(t,e,r){return function(n){return n.lift(new $t(t,e,r))}}var $t=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 Ct(t,this.nextOrObserver,this.error,this.complete))},t}(),Ct=function(t){function e(e,r,n,i){var o=t.call(this,e)||this;return o._tapNext=P,o._tapError=P,o._tapComplete=P,o._tapError=n||P,o._tapComplete=i||P,m(r)?(o._context=o,o._tapNext=r):r&&(o._context=r,o._tapNext=r.next||P,o._tapError=r.error||P,o._tapComplete=r.complete||P),o}return b(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 qt(){for(var t=[],e=0;e0&&r[0].time-n.now()<=0;)r.shift().notification.observe(i);if(r.length>0){var o=Math.max(0,r[0].time-n.now());this.schedule(t,o)}else this.unsubscribe(),e.active=!1},e.prototype._schedule=function(t){this.active=!0,this.destination.add(t.schedule(e.dispatch,this.delay,{source:this,destination:this.destination,scheduler:t}))},e.prototype.scheduleNotification=function(t){if(!0!==this.errored){var e=this.scheduler,r=new Qt(e.now()+this.delay,t);this.queue.push(r),!1===this.active&&this._schedule(e)}},e.prototype._next=function(t){this.scheduleNotification(Bt.createNext(t))},e.prototype._error=function(t){this.errored=!0,this.queue=[],this.destination.error(t),this.unsubscribe()},e.prototype._complete=function(){this.scheduleNotification(Bt.createComplete()),this.unsubscribe()},e}(N),Qt=function(){return function(t,e){this.time=t,this.notification=e}}();function Zt(t,e){return e?Dt((function(){return t}),e):Dt((function(){return t}))}var te=new q(P);function ee(t,e){var r=!1;return arguments.length>=2&&(r=!0),function(n){return n.lift(new re(t,e,r))}}var re=function(){function t(t,e,r){void 0===r&&(r=!1),this.accumulator=t,this.seed=e,this.hasSeed=r}return t.prototype.call=function(t,e){return e.subscribe(new ne(t,this.accumulator,this.seed,this.hasSeed))},t}(),ne=function(t){function e(e,r,n,i){var o=t.call(this,e)||this;return o.accumulator=r,o._seed=n,o.hasSeed=i,o.index=0,o}return b(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,r=this.index++;try{e=this.accumulator(this.seed,t,r)}catch(t){this.destination.error(t)}this.seed=e,this.destination.next(e)},e}(N),ie=function(t){function e(e,r){var n=t.call(this,e,r)||this;return n.scheduler=e,n.work=r,n}return b(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}(Yt),oe=new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return b(e,t),e}(zt))(ie);function ue(t,e){return void 0===e&&(e=0),function(r){return r.lift(new se(t,e))}}var se=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 ce(t,this.scheduler,this.delay))},t}(),ce=function(t){function e(e,r,n){void 0===n&&(n=0);var i=t.call(this,e)||this;return i.scheduler=r,i.delay=n,i}return b(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 ae(t,this.destination)))},e.prototype._next=function(t){this.scheduleMessage(Bt.createNext(t))},e.prototype._error=function(t){this.scheduleMessage(Bt.createError(t)),this.unsubscribe()},e.prototype._complete=function(){this.scheduleMessage(Bt.createComplete()),this.unsubscribe()},e}(N),ae=function(){return function(t,e){this.notification=t,this.destination=e}}(),fe=function(t){function e(e,r,n){void 0===e&&(e=Number.POSITIVE_INFINITY),void 0===r&&(r=Number.POSITIVE_INFINITY);var i=t.call(this)||this;return i.scheduler=n,i._events=[],i._infiniteTimeWindow=!1,i._bufferSize=e<1?1:e,i._windowTime=r<1?1:r,r===Number.POSITIVE_INFINITY?(i._infiniteTimeWindow=!0,i.next=i.nextInfiniteTimeWindow):i.next=i.nextTimeWindow,i}return b(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 le(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(),i=this.scheduler,o=n.length;if(this.closed)throw new R;if(this.isStopped||this.hasError?e=O.EMPTY:(this.observers.push(t),e=new H(this,t)),i&&t.add(t=new ce(t,i)),r)for(var u=0;ue&&(o=Math.max(o,i-e)),o>0&&n.splice(0,o),n},e}(L),le=function(){return function(t,e){this.time=t,this.value=e}}();function he(t,e,r){var n;return n=t&&"object"==typeof t?t:{bufferSize:t,windowTime:e,refCount:!1,scheduler:r},function(t){return t.lift(function(t){var e,r,n=t.bufferSize,i=void 0===n?Number.POSITIVE_INFINITY:n,o=t.windowTime,u=void 0===o?Number.POSITIVE_INFINITY:o,s=t.refCount,c=t.scheduler,a=0,f=!1,l=!1;return function(t){a++,e&&!f||(f=!1,e=new fe(i,u,c),r=t.subscribe({next:function(t){e.next(t)},error:function(t){f=!0,e.error(t)},complete:function(){l=!0,e.complete()}}));var n=e.subscribe(this);this.add((function(){a--,n.unsubscribe(),r&&!l&&s&&0===a&&(r.unsubscribe(),r=void 0,e=void 0)}))}}(n))}}function pe(t,e,r,n){return m(r)&&(n=r,r=void 0),n?pe(t,e,r).pipe(G((function(t){return S(t)?n.apply(void 0,t):n(t)}))):new q((function(n){!function t(e,r,n,i,o){var u;if(function(t){return t&&"function"==typeof t.addEventListener&&"function"==typeof t.removeEventListener}(e)){var s=e;e.addEventListener(r,n,o),u=function(){return s.removeEventListener(r,n,o)}}else if(function(t){return t&&"function"==typeof t.on&&"function"==typeof t.off}(e)){var c=e;e.on(r,n),u=function(){return c.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;f1?n.next(Array.prototype.slice.call(arguments)):n.next(t)}),n,r)}))}function de(t){return function(e){return e.lift(new ye(t))}}var ye=function(){function t(t){this.value=t}return t.prototype.call=function(t,e){return e.subscribe(new ve(t,this.value))},t}(),ve=function(t){function e(e,r){var n=t.call(this,e)||this;return n.value=r,n}return b(e,t),e.prototype._next=function(t){this.destination.next(this.value)},e}(N);function be(){for(var t=[],e=0;e1)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),Ie=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 b(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 O).add(this.source.subscribe(new Ae(this.getSubject(),this))),t.closed&&(this._connection=null,t=O.EMPTY)),t},e.prototype.refCount=function(){return Te()(this)},e}(q),Ne=function(){var t=Ie.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}}}(),Ae=function(t){function e(e,r){var n=t.call(this,e)||this;return n.connectable=r,n}return b(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}(D);var ke=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(),i=r(n).subscribe(t);return i.add(e.subscribe(n)),i},t}();function Pe(){return new L}function $e(){return function(t){return Te()((e=Pe,function(t){var n;if(n="function"==typeof e?e:function(){return e},"function"==typeof r)return t.lift(new ke(n,r));var i=Object.create(t,Ne);return i.source=t,i.subjectFactory=n,i})(t));var e,r}}var Ce=pe(window,"hashchange"),qe=pe(window,"popstate");function Me(t){var e=matchMedia(t);return function t(e,r,n){return n?t(e,r).pipe(G((function(t){return S(t)?n.apply(void 0,t):n(t)}))):new q((function(t){var n,i=function(){for(var e=[],r=0;r0?t.prototype.requestAsyncId.call(this,e,r,n):(e.actions.push(this),e.scheduled||(e.scheduled=requestAnimationFrame((function(){return e.flush(null)}))))},e.prototype.recycleAsyncId=function(e,r,n){if(void 0===n&&(n=0),null!==n&&n>0||null===n&&this.delay>0)return t.prototype.recycleAsyncId.call(this,e,r,n);0===e.actions.length&&(cancelAnimationFrame(r),e.scheduled=void 0)},e}(Yt),Xe=new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return b(e,t),e.prototype.flush=function(t){this.active=!0,this.scheduled=void 0;var e,r=this.actions,n=-1,i=r.length;t=t||r.shift();do{if(e=t.execute(t.state,t.delay))break}while(++n=e})),we(),ue(Xe),Pt((function(e){!function(t,e){t.setAttribute("data-md-state",e?"hidden":"")}(t,e)})),We((function(){!function(t){t.removeAttribute("data-md-state")}(t)})))}function nr(t,e){var r=e;if(t.length>r){for(;" "!==t[r]&&--r>0;);return t.substring(0,r)+"..."}return t}function ir(t,e){if(void 0===Be){var r=Se("#__lang");Be=JSON.parse(r.innerText)}if(void 0===Be[t])throw new ReferenceError("Invalid translation: "+t);return void 0!==e?Be[t].replace("#",e):Be[t]}var or=function(){return(or=Object.assign||function(t){for(var e,r=1,n=arguments.length;r=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};function sr(t){return e=function(){var e="fixed"===getComputedStyle(t).getPropertyValue("position");return X({sticky:e,height:e?t.offsetHeight:0})},new q((function(t){var r;try{r=e()}catch(e){return void t.error(e)}return(r?it(r):B()).subscribe(t)}));var e}var cr={};function ar(){for(var t=[],e=0;e0)&&!(n=o.next()).done;)u.push(n.value)}catch(t){i={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return u};function pr(t,e,r){var n=e.viewport,i=r.header$,o=n.size$.pipe(Zt(i),G((function(e){var r=e.height;return t.offsetTop-r})),we());return ar([n.offset$,o]).pipe(G((function(t){var e=hr(t,2),r=e[0];return{x:r.x,y:r.y-e[1]}})),he(1))}function dr(t){return $((e="active",we((function(t,n){return r?r(t[e],n[e]):t[e]===n[e]}))),ue(Xe),Pt((function(e){var r=e.active;!function(t,e){t.setAttribute("data-md-state",e?"shadow":"")}(t,r)})),We((function(){!function(t){t.removeAttribute("data-md-state")}(t)})));var e,r}r(6);var yr=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};function vr(t,e){var r,n;if("string"==typeof e||"number"==typeof e)t.innerHTML+=e.toString();else if(e instanceof Node)t.appendChild(e);else if(Array.isArray(e))try{for(var i=yr(e),o=i.next();!o.done;o=i.next()){vr(t,o.value)}}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}}function br(t,e){for(var r,n,i,o,u=[],s=2;s0)&&!(n=o.next()).done;)u.push(n.value)}catch(t){i={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return u};function _r(t,e){var r=t.pipe(Nt((function(t){return t}))),n=t.pipe(Nt((function(t){return!t})));return $(Dt((function(t){return ar([X(t),r])})),Dt((function(t){var r,i=gr(t,2),o=i[0];return i[1]?e(o).pipe((r=n,function(t){return t.lift(new mr(r))})):W})))}function xr(t,e){return $(_r(t.media.screen$,(function(r){return function(t,e,r){return pr(t,e,{header$:r.header$}).pipe(rr(t,20)).pipe(G((function(t){return{hidden:t}})))}(r,t,e)})),he(1))}var Sr=function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,i,o=r.call(t),u=[];try{for(;(void 0===e||e-- >0)&&!(n=o.next()).done;)u.push(n.value)}catch(t){i={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return u};function Er(t,e){return $(Dt((function(r){return function(t,e,r){var n=e.viewport,i=r.header$.pipe(qt("height")),o=ar([n.offset$,n.size$,i]).pipe(G((function(e){var r=Sr(e,3),n=r[0].y,i=r[1].height,o=r[2],u=t.offsetTop,s=t.offsetHeight+u;return i-Math.max(0,u-n,o)-Math.max(0,i+n-s)})),we()),u=ar([n.offset$,i]).pipe(G((function(e){var r=Sr(e,2),n=r[0].y,i=r[1];return n>=t.offsetTop-i})),we());return ar([o,i,u]).pipe(G((function(e){var r=Sr(e,3),n=r[0],i=r[1],o=r[2];return{offset:t.offsetTop-i,height:n,active:o}})))}(r,t,e)})),he(1))}function Tr(t){return function e(r,o){switch(arguments.length){case 0:return e;case 1:return n(r)?e:i((function(e){return t(r,e)}));default:return n(r)&&n(o)?e:n(r)?i((function(e){return t(e,o)})):n(o)?i((function(e){return t(r,e)})):t(r,o)}}}function Or(t){for(var e,r=[];!(e=t.next()).done;)r.push(e.value);return r}function jr(t,e,r){for(var n=0,i=r.length;n=0;){if(r[c]===t)return n[c]===e;c-=1}switch(u){case"Map":return t.size===e.size&&Ar(t.entries(),e.entries(),r.concat([t]),n.concat([e]));case"Set":return t.size===e.size&&Ar(t.values(),e.values(),r.concat([t]),n.concat([e]));case"Arguments":case"Array":case"Object":case"Boolean":case"Number":case"String":case"Date":case"Error":case"RegExp":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"ArrayBuffer":break;default:return!1}var a=d(t);if(a.length!==d(e).length)return!1;var f=r.concat([t]),l=n.concat([e]);for(c=a.length-1;c>=0;){var h=a[c];if(!s(h,e)||!kr(e[h],t[h],f,l))return!1;c-=1}return!0}var Pr=Tr((function(t,e){return kr(t,e,[],[])})),$r=function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,i,o=r.call(t),u=[];try{for(;(void 0===e||e-- >0)&&!(n=o.next()).done;)u.push(n.value)}catch(t){i={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return u};function Cr(t,e,r){var n=e.viewport,i=r.main$,o=parseFloat(getComputedStyle(t.parentElement).getPropertyValue("padding-top")),u=ar([n.offset$,i]).pipe(G((function(t){var e=$r(t,2),r=e[0].y,n=e[1],i=n.offset;return n.height-o+Math.min(o,Math.max(0,r-i))}))),s=ar([n.offset$,i]).pipe(G((function(t){var e=$r(t,2);return e[0].y>=e[1].offset+o})));return ar([u,s]).pipe(G((function(t){var e=$r(t,2);return{height:e[0],lock:e[1]}})),we(Pr),he(1))}function qr(t){return $(ue(Xe),Pt((function(e){var r=e.height,n=e.lock;!function(t,e){t.style.height=e+"px"}(t,r),function(t,e){t.setAttribute("data-md-state",e?"lock":"")}(t,n)})),We((function(){!function(t){t.style.height=""}(t),function(t){t.removeAttribute("data-md-state")}(t)})))}function Mr(t,e){return $(_r(t.media.screen$,(function(r){return function(t,e,r){return Cr(t,e,{main$:r.main$}).pipe(qr(t)).pipe(G((function(t){return{sidebar:t}})))}(r,t,e)})),he(1))}var Rr=function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,i,o=r.call(t),u=[];try{for(;(void 0===e||e-- >0)&&!(n=o.next()).done;)u.push(n.value)}catch(t){i={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return u};function Hr(t,e){var r=e.prepare;return ar([pe(t,"keyup").pipe(G((function(){return r(t.value)})),me(""),we()),function(t){var e=pe(t,"focus"),r=pe(t,"blur");return pt(e.pipe(de(!0)),r.pipe(de(!1))).pipe(me(t===document.activeElement),he(1))}(t)]).pipe(G((function(t){var e=Rr(t,2);return{value:e[0],focus:e[1]}})),he(1))}function Dr(t){return pe(t,"click").pipe(de(void 0))}var Lr={link:"md-search-result__link",article:"md-search-result__article md-search-result__article--document",title:"md-search-result__title",teaser:"md-search-result__teaser"};var Vr={link:"md-search-result__link",article:"md-search-result__article",title:"md-search-result__title",teaser:"md-search-result__teaser"};function Ur(t){var e=t.location,r=t.title,n=t.text;return br("a",{href:e,title:r,class:Vr.link,tabIndex:-1},br("article",{class:Vr.article},br("h1",{class:Vr.title},r),n.length?br("p",{class:Vr.teaser},nr(n,320)):void 0))}var Yr={item:"md-search-result__item"};function Fr(t){var e=t.article,r=t.sections;return br("li",{class:Yr.item},function(t){var e=t.location,r=t.title,n=t.text;return br("a",{href:e,title:r,class:Lr.link,tabIndex:-1},br("article",{class:Lr.article},br("h1",{class:Lr.title},r),n.length?br("p",{class:Lr.teaser},nr(n,320)):void 0))}(e),r.map(Ur))}var zr=function(){function t(t,e){this.observables=t,this.project=e}return t.prototype.call=function(t,e){return e.subscribe(new Xr(t,this.observables,this.project))},t}(),Xr=function(t){function e(e,r,n){var i=t.call(this,e)||this;i.observables=r,i.project=n,i.toRespond=[];var o=r.length;i.values=new Array(o);for(var u=0;u0){var u=o.indexOf(r);-1!==u&&o.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}(ct),Wr=function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,i,o=r.call(t),u=[];try{for(;(void 0===e||e-- >0)&&!(n=o.next()).done;)u.push(n.value)}catch(t){i={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return u};function Br(t,e){var r=e.query$,n=Se(".md-search-result__meta",t);return $(function(){for(var t=[],e=0;e1?ir("search.result.other",e.toString()):ir(1===e?"search.result.one":"search.result.none")}(n,r.length):function(t){t.textContent=ir("search.result.placeholder")}(n),r})))}function Gr(t,e,r){var n=r.result$,i=r.query$,o=t.parentElement,s=function(t,e){var r=e.viewport;return pt(pe(t,"scroll"),r.size$).pipe(G((function(){return Ee(t)})),me(Ee(t)),he(1))}(o,e).pipe(G((function(t){return t.y>=o.scrollHeight-o.offsetHeight-16})),we(),Nt(u));return n.pipe(Pt((function(t){console.log("watchSearchResult",t)})),Br(t,{query$:i}),function(t,e){var r=e.render$,n=t.parentElement,i=Se(".md-search-result__list",t);return $(Dt((function(t){return r.pipe(ue(Xe),ee((function(e){for(;e16)););return e}),0),de(t),We((function(){!function(t){t.innerHTML=""}(i)})))})))}(t,{render$:s}))}function Jr(t,e){return $(_r(t.media.screen$,(function(r){return function(t,e,r){return pr(t,e,{header$:r.header$}).pipe(rr(t,8)).pipe(G((function(t){return{hidden:t}})))}(r,t,e)})),he(1))}var Kr=i((function(t){return e=t,"[object String]"===Object.prototype.toString.call(e)?t.split("").reverse().join(""):Array.prototype.slice.call(t,0).reverse();var e}));function Qr(t,e){return function(t,e,r){var n,i;if("function"==typeof t.indexOf)switch(typeof e){case"number":if(0===e){for(n=1/e;r=0}function Zr(t,e,r){var n,i=typeof t;switch(i){case"string":case"number":return 0===t&&1/t==-1/0?!!r._items["-0"]||(e&&(r._items["-0"]=!0),!1):null!==r._nativeSet?e?(n=r._nativeSet.size,r._nativeSet.add(t),r._nativeSet.size===n):r._nativeSet.has(t):i in r._items?t in r._items[i]||(e&&(r._items[i][t]=!0),!1):(e&&(r._items[i]={},r._items[i][t]=!0),!1);case"boolean":if(i in r._items){var o=t?1:0;return!!r._items[i][o]||(e&&(r._items[i][o]=!0),!1)}return e&&(r._items[i]=t?[!1,!0]:[!0,!1]),!1;case"function":return null!==r._nativeSet?e?(n=r._nativeSet.size,r._nativeSet.add(t),r._nativeSet.size===n):r._nativeSet.has(t):i in r._items?!!Qr(t,r._items[i])||(e&&r._items[i].push(t),!1):(e&&(r._items[i]=[t]),!1);case"undefined":return!!r._items[i]||(e&&(r._items[i]=!0),!1);case"object":if(null===t)return!!r._items.null||(e&&(r._items.null=!0),!1);default:return(i=Object.prototype.toString.call(t))in r._items?!!Qr(t,r._items[i])||(e&&r._items[i].push(t),!1):(e&&(r._items[i]=[t]),!1)}}var tn=function(){function t(){this._nativeSet="function"==typeof Set?new Set:null,this._items={}}return t.prototype.add=function(t){return!Zr(t,!0,this)},t.prototype.has=function(t){return Zr(t,!1,this)},t}(),en=Tr((function(t,e){for(var r=[],n=0,i=t.length,o=e.length,u=new tn,s=0;s=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},nn=function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,i,o=r.call(t),u=[];try{for(;(void 0===e||e-- >0)&&!(n=o.next()).done;)u.push(n.value)}catch(t){i={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return u},on=function(){for(var t=[],e=0;e0)&&!(n=o.next()).done;)u.push(n.value)}catch(t){i={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return u};function an(t,e,r){var n,i,o=r.header$,u=Cr(t,e,{main$:r.main$}).pipe(qr(t)),s=(n=".md-nav__link",void 0===(i=t)&&(i=document),Array.from(i.querySelectorAll(n))),c=function(t,e,r){var n,i,o=e.viewport,u=r.header$,s=new Map;try{for(var c=rn(t),a=c.next();!a.done;a=c.next()){var f=a.value,l=Se('[id="'+decodeURIComponent(f.hash.substring(1))+'"]');void 0!==l&&s.set(f,l)}}catch(t){n={error:t}}finally{try{a&&!a.done&&(i=c.return)&&i.call(c)}finally{if(n)throw n.error}}var h=u.pipe(G((function(t){return 18+t.height})));return o.size$.pipe(G((function(){var t=[];return on(s).reduce((function(e,r){for(var n=nn(r,2),i=n[0],o=n[1];t.length;){if(!(s.get(t[t.length-1]).tagName>=o.tagName))break;t.pop()}return e.set(Kr(t=on(t,[i])),o.offsetTop)}),new Map)})),Dt((function(t){return ar(o.offset$,h).pipe(ee((function(t,e){for(var r=nn(t,2),n=r[0],i=r[1],o=nn(e,2),u=o[0].y,s=o[1];i.length;){if(!(nn(i[0],2)[1]-s=u))break;i=on([n.pop()],i)}return[n,i]}),[[],on(t)]),we((function(t,e){return t[0]===e[0]&&t[1]===e[1]})))}))).pipe(G((function(t){var e=nn(t,2),r=e[0],n=e[1];return{prev:r.map((function(t){return nn(t,1)[0]})),next:n.map((function(t){return nn(t,1)[0]}))}})),ee((function(t,e){var r=Math.max(0,Math.min(e.prev.length,t.prev.length)-1),n=Math.max(e.prev.length,t.prev.length);return{prev:e.prev.slice(r,n+1),next:en(e.next,t.next)}}),{prev:[],next:[]})).pipe(he(1))}(s,e,{header$:o}).pipe(function(t){return $(ue(Xe),Pt((function(t){var e,r,n,i,o=t.prev,u=t.next;try{for(var s=rn(u),c=s.next();!c.done;c=s.next()){tr(l=nn(c.value,1)[0]),Qe(l)}}catch(t){e={error:t}}finally{try{c&&!c.done&&(r=s.return)&&r.call(s)}finally{if(e)throw e.error}}try{for(var a=rn(o.entries()),f=a.next();!f.done;f=a.next()){var l,h=nn(f.value,2),p=h[0];Ze(l=nn(h[1],1)[0],p===o.length-1),Ke(l,!0)}}catch(t){n={error:t}}finally{try{f&&!f.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}})),We((function(){var e,r;try{for(var n=rn(t),i=n.next();!i.done;i=n.next()){var o=i.value;tr(o),Qe(o)}}catch(t){e={error:t}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(e)throw e.error}}})))}(s));return ar([u,c]).pipe(G((function(t){var e=cn(t,2);return{sidebar:e[0],anchors:e[1]}})))}function fn(t){return t.type===sn.DUMP}function ln(t){return t.type===sn.RESULT}!function(t){t[t.STRING=0]="STRING",t[t.BINARY=1]="BINARY"}(un||(un={})),function(t){t[t.SETUP=0]="SETUP",t[t.DUMP=1]="DUMP",t[t.QUERY=2]="QUERY",t[t.RESULT=3]="RESULT"}(sn||(sn={})),r.d(e,"initialize",(function(){return wn}));var hn=function(){return(hn=Object.assign||function(t){for(var e,r=1,n=arguments.length;r0)&&!(n=o.next()).done;)u.push(n.value)}catch(t){i={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return u},yn=function(){for(var t=[],e=0;e0})),$e())},media:{screen$:Me("(min-width: 1220px)"),tablet$:Me("(min-width: 960px)")},viewport:{offset$:pt(Re,He).pipe(G(De),me(De()),he(1)),size$:He.pipe(G(Le),me(Le()),he(1))}},n=dn(mn(t),2),i=n[0],o=n[1],s=function(t,e){return e.document$.pipe(G((function(e){return t.reduce((function(t,r){var n,i=Se("[data-md-component="+r+"]",e);return or(or({},t),void 0!==i?((n={})[r]=i,n):{})}),{})})),ee((function(t,e){var r,n;try{for(var i=ur(d(t)),o=i.next();!o.done;o=i.next()){var u=o.value;switch(u){case"header-title":case"container":u in t&&void 0!==t[u]&&(t[u].replaceWith(e[u]),t[u]=e[u]);break;default:t[u]=Se("[data-md-component="+u+"]")}}}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return t}))).pipe(he(1))}(vn,{document$:r.document.load$}),c=function(t){return s.pipe(function(t){return $(Dt((function(e){return void 0!==e[t]?X(e[t]):te})))}(t))},a=c("header").pipe(Dt(sr));c("header").pipe(Dt((function(t){return p.pipe(dr(t))}))).subscribe();var f=i.pipe(Pt((function(t){return console.log("message from worker",t)})),Nt(ln),qt("data")),l=c("search-query").pipe(Dt((function(t){return Hr(t,{prepare:bn})})));l.pipe(G((function(t){return{type:sn.QUERY,data:t.value}}))).subscribe(o),l.pipe(Pt((function(t){var e,r;t.focus&&(r=!0,(e=_).checked!==r&&e.click())}))).subscribe();var h,p=c("main").pipe(Er(r,{header$:a})),v=c("navigation").pipe(Mr(r,{main$:p})),b=c("toc").pipe(function(t,e){return $(_r(t.media.tablet$,(function(r){return an(r,t,e)})),he(1))}(r,{header$:a,main$:p})),m=c("search-result").pipe(function(t,e){return $(Dt((function(r){return Gr(r,t,e)})),he(1))}(r,{result$:f,query$:l.pipe(qt("value"))})),w=c("tabs").pipe(Jr(r,{header$:a})),g=c("hero").pipe(xr(r,{header$:a})),_=(Se("[data-md-toggle=drawer]"),Se("[data-md-toggle=search]")),x=(h=_,pe(h,"change").pipe(qt("checked"))).pipe(Nt(u),Gt(400)),S=c("search-reset").pipe(Dt(Dr));pt(x,S).pipe(Zt(c("search-query")),Pt((function(t){return t.focus()}))).subscribe();var E={search:{query$:l,result$:m,reset$:S},main$:p,navigation$:v,toc$:b,tabs$:w,hero$:g},T=E.search,O=pn(E,["search"]);return pt.apply(void 0,yn(y(O),y(T))).subscribe(),{agent:r,state:E}}}])); //# sourceMappingURL=bundle.js.map \ No newline at end of file diff --git a/material/assets/javascripts/bundle.js.map b/material/assets/javascripts/bundle.js.map index 20b63392d..c48c0c8cf 100644 --- a/material/assets/javascripts/bundle.js.map +++ b/material/assets/javascripts/bundle.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./node_modules/rxjs/_esm5/internal/util/root.js","webpack:///(webpack)/buildin/global.js","webpack:///./node_modules/ramda/es/internal/_isPlaceholder.js","webpack:///./node_modules/ramda/es/internal/_curry1.js","webpack:///./node_modules/ramda/es/internal/_identity.js","webpack:///./node_modules/ramda/es/identity.js","webpack:///./node_modules/ramda/es/internal/_has.js","webpack:///./node_modules/ramda/es/internal/_isArguments.js","webpack:///./node_modules/ramda/es/keys.js","webpack:///./node_modules/ramda/es/values.js","webpack:///./node_modules/tslib/tslib.es6.js","webpack:///./node_modules/rxjs/_esm5/internal/util/isFunction.js","webpack:///./node_modules/rxjs/_esm5/internal/config.js","webpack:///./node_modules/rxjs/_esm5/internal/util/hostReportError.js","webpack:///./node_modules/rxjs/_esm5/internal/Observer.js","webpack:///./node_modules/rxjs/_esm5/internal/util/isArray.js","webpack:///./node_modules/rxjs/_esm5/internal/util/isObject.js","webpack:///./node_modules/rxjs/_esm5/internal/util/UnsubscriptionError.js","webpack:///./node_modules/rxjs/_esm5/internal/Subscription.js","webpack:///./node_modules/rxjs/_esm5/internal/symbol/rxSubscriber.js","webpack:///./node_modules/rxjs/_esm5/internal/Subscriber.js","webpack:///./node_modules/rxjs/_esm5/internal/symbol/observable.js","webpack:///./node_modules/rxjs/_esm5/internal/util/noop.js","webpack:///./node_modules/rxjs/_esm5/internal/util/pipe.js","webpack:///./node_modules/rxjs/_esm5/internal/Observable.js","webpack:///./node_modules/rxjs/_esm5/internal/util/toSubscriber.js","webpack:///./node_modules/rxjs/_esm5/internal/util/canReportError.js","webpack:///./node_modules/rxjs/_esm5/internal/util/ObjectUnsubscribedError.js","webpack:///./node_modules/rxjs/_esm5/internal/SubjectSubscription.js","webpack:///./node_modules/rxjs/_esm5/internal/Subject.js","webpack:///./node_modules/rxjs/_esm5/internal/util/isScheduler.js","webpack:///./node_modules/rxjs/_esm5/internal/util/subscribeToArray.js","webpack:///./node_modules/rxjs/_esm5/internal/scheduled/scheduleArray.js","webpack:///./node_modules/rxjs/_esm5/internal/observable/fromArray.js","webpack:///./node_modules/rxjs/_esm5/internal/observable/of.js","webpack:///./node_modules/rxjs/_esm5/internal/observable/empty.js","webpack:///./node_modules/rxjs/_esm5/internal/operators/map.js","webpack:///./node_modules/rxjs/_esm5/internal/symbol/iterator.js","webpack:///./node_modules/rxjs/_esm5/internal/util/isArrayLike.js","webpack:///./node_modules/rxjs/_esm5/internal/util/isPromise.js","webpack:///./node_modules/rxjs/_esm5/internal/util/subscribeTo.js","webpack:///./node_modules/rxjs/_esm5/internal/util/subscribeToObservable.js","webpack:///./node_modules/rxjs/_esm5/internal/util/subscribeToPromise.js","webpack:///./node_modules/rxjs/_esm5/internal/util/subscribeToIterable.js","webpack:///./node_modules/rxjs/_esm5/internal/scheduled/scheduled.js","webpack:///./node_modules/rxjs/_esm5/internal/util/isInteropObservable.js","webpack:///./node_modules/rxjs/_esm5/internal/scheduled/scheduleObservable.js","webpack:///./node_modules/rxjs/_esm5/internal/scheduled/schedulePromise.js","webpack:///./node_modules/rxjs/_esm5/internal/util/isIterable.js","webpack:///./node_modules/rxjs/_esm5/internal/scheduled/scheduleIterable.js","webpack:///./node_modules/rxjs/_esm5/internal/observable/from.js","webpack:///./node_modules/rxjs/_esm5/internal/observable/forkJoin.js","webpack:///./node_modules/rxjs/_esm5/internal/InnerSubscriber.js","webpack:///./node_modules/rxjs/_esm5/internal/util/subscribeToResult.js","webpack:///./node_modules/rxjs/_esm5/internal/OuterSubscriber.js","webpack:///./node_modules/rxjs/_esm5/internal/operators/mergeMap.js","webpack:///./node_modules/rxjs/_esm5/internal/util/identity.js","webpack:///./node_modules/rxjs/_esm5/internal/operators/mergeAll.js","webpack:///./node_modules/rxjs/_esm5/internal/observable/merge.js","webpack:///./node_modules/rxjs/_esm5/internal/observable/dom/AjaxObservable.js","webpack:///./node_modules/rxjs/_esm5/internal/observable/dom/ajax.js","webpack:///./node_modules/rxjs/_esm5/internal/operators/filter.js","webpack:///./node_modules/rxjs/_esm5/internal/operators/tap.js","webpack:///./node_modules/rxjs/_esm5/internal/operators/pluck.js","webpack:///./node_modules/rxjs/_esm5/internal/util/ArgumentOutOfRangeError.js","webpack:///./node_modules/rxjs/_esm5/internal/operators/take.js","webpack:///./node_modules/rxjs/_esm5/internal/operators/switchMap.js","webpack:///./node_modules/rxjs/_esm5/internal/Notification.js","webpack:///./node_modules/rxjs/_esm5/internal/scheduler/AsyncAction.js","webpack:///./node_modules/rxjs/_esm5/internal/scheduler/Action.js","webpack:///./node_modules/rxjs/_esm5/internal/Scheduler.js","webpack:///./node_modules/rxjs/_esm5/internal/scheduler/AsyncScheduler.js","webpack:///./node_modules/rxjs/_esm5/internal/scheduler/async.js","webpack:///./node_modules/rxjs/_esm5/internal/observable/throwError.js","webpack:///./node_modules/rxjs/_esm5/internal/operators/delay.js","webpack:///./node_modules/rxjs/_esm5/internal/util/isDate.js","webpack:///./node_modules/rxjs/_esm5/internal/operators/switchMapTo.js","webpack:///./node_modules/rxjs/_esm5/internal/observable/never.js","webpack:///./node_modules/rxjs/_esm5/internal/operators/scan.js","webpack:///./node_modules/rxjs/_esm5/internal/scheduler/QueueAction.js","webpack:///./node_modules/rxjs/_esm5/internal/scheduler/queue.js","webpack:///./node_modules/rxjs/_esm5/internal/scheduler/QueueScheduler.js","webpack:///./node_modules/rxjs/_esm5/internal/operators/observeOn.js","webpack:///./node_modules/rxjs/_esm5/internal/ReplaySubject.js","webpack:///./node_modules/rxjs/_esm5/internal/operators/shareReplay.js","webpack:///./node_modules/rxjs/_esm5/internal/observable/fromEvent.js","webpack:///./node_modules/rxjs/_esm5/internal/operators/mapTo.js","webpack:///./node_modules/rxjs/_esm5/internal/observable/concat.js","webpack:///./node_modules/rxjs/_esm5/internal/operators/concatAll.js","webpack:///./node_modules/rxjs/_esm5/internal/operators/startWith.js","webpack:///./node_modules/rxjs/_esm5/internal/operators/distinctUntilChanged.js","webpack:///./node_modules/rxjs/_esm5/internal/operators/skip.js","webpack:///./src/assets/javascripts/utilities/agent/document/index.ts","webpack:///./src/assets/javascripts/utilities/agent/element/_/index.ts","webpack:///./src/assets/javascripts/utilities/agent/element/offset/index.ts","webpack:///./node_modules/rxjs/_esm5/internal/operators/refCount.js","webpack:///./node_modules/rxjs/_esm5/internal/observable/ConnectableObservable.js","webpack:///./node_modules/rxjs/_esm5/internal/operators/multicast.js","webpack:///./node_modules/rxjs/_esm5/internal/operators/share.js","webpack:///./src/assets/javascripts/utilities/agent/location/index.ts","webpack:///./src/assets/javascripts/utilities/agent/media/index.ts","webpack:///./node_modules/rxjs/_esm5/internal/observable/fromEventPattern.js","webpack:///./src/assets/javascripts/utilities/agent/viewport/index.ts","webpack:///./node_modules/rxjs/_esm5/internal/operators/throttle.js","webpack:///./src/assets/javascripts/utilities/agent/worker/index.ts","webpack:///./node_modules/rxjs/_esm5/internal/scheduler/AnimationFrameAction.js","webpack:///./node_modules/rxjs/_esm5/internal/scheduler/animationFrame.js","webpack:///./node_modules/rxjs/_esm5/internal/scheduler/AnimationFrameScheduler.js","webpack:///./node_modules/rxjs/_esm5/internal/operators/finalize.js","webpack:///./src/assets/javascripts/utilities/string/index.ts","webpack:///./src/assets/javascripts/actions/anchor/index.ts","webpack:///./src/assets/javascripts/actions/search/result/index.ts","webpack:///./src/assets/javascripts/utilities/hidden/index.ts","webpack:///./src/assets/javascripts/actions/hidden/index.ts","webpack:///./src/assets/javascripts/components/header/_/index.ts","webpack:///./node_modules/rxjs/_esm5/internal/observable/defer.js","webpack:///./node_modules/rxjs/_esm5/internal/observable/combineLatest.js","webpack:///./src/assets/javascripts/components/header/offset/index.ts","webpack:///./src/assets/javascripts/components/header/shadow/index.ts","webpack:///./node_modules/rxjs/_esm5/internal/operators/distinctUntilKeyChanged.js","webpack:///./src/assets/javascripts/actions/header/index.ts","webpack:///./src/assets/javascripts/extensions/jsx/index.ts","webpack:///./node_modules/rxjs/_esm5/internal/operators/takeUntil.js","webpack:///./src/assets/javascripts/extensions/rxjs/operators/index.ts","webpack:///./src/assets/javascripts/components/hero/index.ts","webpack:///./src/assets/javascripts/components/main/_/index.ts","webpack:///./node_modules/ramda/es/internal/_curry2.js","webpack:///./node_modules/ramda/es/internal/_arrayFromIterator.js","webpack:///./node_modules/ramda/es/internal/_includesWith.js","webpack:///./node_modules/ramda/es/internal/_objectIs.js","webpack:///./node_modules/ramda/es/type.js","webpack:///./node_modules/ramda/es/internal/_equals.js","webpack:///./node_modules/ramda/es/internal/_functionName.js","webpack:///./node_modules/ramda/es/equals.js","webpack:///./src/assets/javascripts/components/main/sidebar/index.ts","webpack:///./src/assets/javascripts/actions/sidebar/index.ts","webpack:///./src/assets/javascripts/components/navigation/_/index.ts","webpack:///./src/assets/javascripts/components/search/query/index.ts","webpack:///./src/assets/javascripts/utilities/agent/element/focus/index.ts","webpack:///./src/assets/javascripts/components/search/reset/index.ts","webpack:///./src/assets/javascripts/templates/search/result/article/index.tsx","webpack:///./src/assets/javascripts/templates/search/result/section/index.tsx","webpack:///./src/assets/javascripts/templates/search/result/_/index.tsx","webpack:///./node_modules/rxjs/_esm5/internal/operators/withLatestFrom.js","webpack:///./src/assets/javascripts/components/search/result/meta/index.ts","webpack:///./src/assets/javascripts/components/search/result/_/index.ts","webpack:///./src/assets/javascripts/components/search/result/list/index.ts","webpack:///./src/assets/javascripts/components/tabs/index.ts","webpack:///./node_modules/ramda/es/reverse.js","webpack:///./node_modules/ramda/es/internal/_isString.js","webpack:///./node_modules/ramda/es/internal/_includes.js","webpack:///./node_modules/ramda/es/internal/_indexOf.js","webpack:///./node_modules/ramda/es/internal/_Set.js","webpack:///./node_modules/ramda/es/difference.js","webpack:///./src/assets/javascripts/workers/packer/_/index.ts","webpack:///./src/assets/javascripts/workers/search/_/index.ts","webpack:///./src/assets/javascripts/components/toc/_/index.ts","webpack:///./src/assets/javascripts/components/toc/anchor/index.ts","webpack:///./src/assets/javascripts/index.ts","webpack:///./src/assets/javascripts/utilities/agent/_/index.ts","webpack:///./src/assets/javascripts/components/_/index.ts","webpack:///./src/assets/javascripts/utilities/toggle/index.ts"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","__window","window","__self","self","WorkerGlobalScope","_root","global","g","this","Function","e","_isPlaceholder","a","_curry1","fn","f1","arguments","length","apply","_identity","x","_has","prop","obj","toString","hasEnumBug","propertyIsEnumerable","nonEnumerableProps","hasArgsEnumBug","contains","list","item","idx","keys","nIdx","ks","checkArgsLength","props","len","vals","extendStatics","b","setPrototypeOf","__proto__","Array","__extends","__","constructor","isFunction","_enable_super_gross_mode_that_will_cause_bad_things","Promise","undefined","Error","stack","hostReportError","err","setTimeout","empty","closed","next","error","useDeprecatedSynchronousErrorHandling","complete","isArray","isObject","UnsubscriptionError","UnsubscriptionErrorImpl","errors","message","map","join","Subscription","unsubscribe","_parentOrParents","_subscriptions","_unsubscribe","remove","index","flattenUnsubscriptionErrors","sub","concat","push","add","teardown","subscription","EMPTY","tmp","indexOf","subscriptions","subscriptionIndex","splice","reduce","errs","rxSubscriber","Math","random","_super","Subscriber","destinationOrNext","_this","syncErrorValue","syncErrorThrown","syncErrorThrowable","isStopped","destination","subscriber","_next","_error","_complete","_unsubscribeAndRecycle","SafeSubscriber","_parentSubscriber","observerOrNext","context","_context","__tryOrSetError","__tryOrUnsub","wrappedComplete","parent","observable","noop","pipe","fns","_i","pipeFromArray","input","prev","Observable","subscribe","_isScalar","_subscribe","lift","operator","source","sink","nextOrObserver","toSubscriber","_trySubscribe","observer","_a","closed_1","canReportError","console","warn","forEach","promiseCtor","getPromiseCtor","resolve","reject","operations","toPromise","ObjectUnsubscribedError","ObjectUnsubscribedErrorImpl","SubjectSubscription","subject","observers","subscriberIndex","SubjectSubscriber","Subject","hasError","thrownError","copy","slice","asObservable","AnonymousSubject","isScheduler","schedule","subscribeToArray","array","scheduleArray","scheduler","fromArray","of","args","pop","emptyScheduled","project","thisArg","TypeError","MapOperator","MapSubscriber","count","result","getSymbolIterator","iterator","isArrayLike","isPromise","then","subscribeTo","obs","promise","iterable","done","return","scheduled","isInteropObservable","scheduleObservable","schedulePromise","isIterable","scheduleIterable","from","forkJoinInternal","sources","values","completed","emitted","_loop_1","hasValue","InnerSubscriber","outerValue","outerIndex","notifyNext","notifyError","notifyComplete","subscribeToResult","outerSubscriber","OuterSubscriber","innerValue","innerIndex","innerSub","MergeMapOperator","concurrent","Number","POSITIVE_INFINITY","MergeMapSubscriber","hasCompleted","buffer","active","_tryNext","_innerSub","ish","innerSubscriber","shift","mergeAll","mergeMap","resultSelector","ii","merge","observables","last","ajaxGet","url","headers","method","ajaxPost","body","ajaxDelete","ajaxPut","ajaxPatch","mapResponse","response","ajaxGetJSON","responseType","AjaxObservable","urlOrRequest","request","async","createXHR","crossDomain","root","XMLHttpRequest","XDomainRequest","getCORSRequest","progId","progIds","ActiveXObject","getXMLHttpRequest","withCredentials","timeout","post","delete","put","patch","getJSON","AjaxSubscriber","getHeader","FormData","serializeBody","send","xhr","AjaxResponse","_b","user","password","setupEvents","open","setHeaders","contentType","splitIndex","substring","encodeURIComponent","JSON","stringify","setRequestHeader","headerName","toLowerCase","progressSubscriber","xhrTimeout","AjaxTimeoutError","ontimeout","upload","xhrProgress_1","xhrError_1","onprogress","AjaxError","onerror","xhrReadyStateChange","xhrLoad","readyState","status_1","status","responseText","onreadystatechange","onload","abort","originalEvent","parseXhrResponse","AjaxErrorImpl","parse","parseJson","responseXML","ajax","filter","predicate","FilterOperator","FilterSubscriber","tap","DoOperator","TapSubscriber","_tapNext","_tapError","_tapComplete","pluck","properties","currentProp","plucker","ArgumentOutOfRangeError","ArgumentOutOfRangeErrorImpl","TakeOperator","total","TakeSubscriber","switchMap","SwitchMapOperator","NotificationKind","SwitchMapSubscriber","innerSubscription","AsyncAction","work","pending","state","delay","id","recycleAsyncId","requestAsyncId","setInterval","flush","clearInterval","execute","_execute","errored","errorValue","actions","Action","Scheduler","SchedulerAction","now","Date","AsyncScheduler","delegate","action","dispatch","Notification","kind","observe","do","accept","toObservable","createNext","undefinedValueNotification","createError","createComplete","completeNotification","delayFor","isNaN","abs","DelayOperator","DelaySubscriber","queue","time","notification","delay_1","max","_schedule","scheduleNotification","DelayMessage","switchMapTo","innerObservable","NEVER","scan","accumulator","seed","hasSeed","ScanOperator","ScanSubscriber","_seed","set","configurable","QueueAction","QueueScheduler","observeOn","ObserveOnOperator","ObserveOnSubscriber","arg","scheduleMessage","ObserveOnMessage","ReplaySubject","bufferSize","windowTime","_events","_infiniteTimeWindow","_bufferSize","_windowTime","nextInfiniteTimeWindow","nextTimeWindow","ReplayEvent","_getNow","_trimBufferThenGetEvents","eventsCount","spliceCount","shareReplay","configOrBufferSize","config","refCount","_c","useRefCount","isComplete","shareReplayOperator","fromEvent","target","eventName","options","setupSubscription","sourceObj","handler","addEventListener","removeEventListener","isEventTarget","source_1","on","off","isJQueryStyleEventEmitter","source_2","addListener","removeListener","isNodeStyleEventEmitter","source_3","mapTo","MapToOperator","MapToSubscriber","concatAll","startWith","distinctUntilChanged","compare","keySelector","DistinctUntilChangedOperator","DistinctUntilChangedSubscriber","hasKey","y","load$","document","getElement","selector","node","querySelector","getElementOffset","el","scrollLeft","scrollTop","RefCountOperator","connectable","_refCount","refCounter","connection","connect","RefCountSubscriber","sharedConnection","_connection","ConnectableObservable","subjectFactory","_isComplete","getSubject","_subject","connectableObservableDescriptor","connectableProto","writable","ConnectableSubscriber","MulticastOperator","shareSubjectFactory","share","subjectOrSubjectFactory","hashchange$","popstate$","watchMedia","query","media","matchMedia","fromEventPattern","addHandler","removeHandler","retValue","matches","resize$","getViewportOffset","pageXOffset","pageYOffset","getViewportSize","width","innerWidth","height","innerHeight","defaultThrottleConfig","leading","trailing","ThrottleOperator","durationSelector","ThrottleSubscriber","_leading","_trailing","_hasValue","_sendValue","_throttled","throttle","duration","tryDurationSelector","throttlingDone","watchWorker","worker","send$","recv$","postMessage","AnimationFrameAction","requestAnimationFrame","cancelAnimationFrame","animationFrame","AnimationFrameScheduler","finalize","callback","FinallyOperator","lang","FinallySubscriber","setAnchorBlur","setAttribute","resetAnchorBlur","removeAttribute","setAnchorActive","classList","toggle","resetAnchorActive","addToSearchResultList","child","appendChild","paintHidden","offset","setHidden","resetHidden","truncate","translate","innerText","ReferenceError","replace","watchHeader","observableFactory","sticky","getComputedStyle","getPropertyValue","offsetHeight","NONE","combineLatest","CombineLatestOperator","CombineLatestSubscriber","toRespond","unused","oldVal","_tryResultSelector","watchViewportOffsetFromTopOf","viewport","header$","adjust$","size$","offsetTop","offset$","paintHeaderShadow","setHeaderShadow","resetHeaderShadow","innerHTML","Node","h","tag","attributes","createElement","attr","children","TakeUntilOperator","notifier","takeUntilSubscriber","notifierSubscription","seenValue","TakeUntilSubscriber","switchMapIf","toggle$","begin$","end$","mountHero","agent","screen$","hidden","watchHero","mountMain","height$","adjust","top","bottom","active$","watchMain","_curry2","f2","_arrayFromIterator","iter","_includesWith","pred","val","_uniqContentEquals","aIterator","bIterator","stackA","stackB","eq","_equals","aItem","f","match","typeA","equals","String","valueOf","ignoreCase","multiline","unicode","size","entries","keysA","extendedStackA","extendedStackB","watchSidebar","main$","parseFloat","parentElement","min","lock$","lock","paintSidebar","style","setSidebarHeight","setSidebarLock","resetSidebarHeight","resetSidebarLock","mountNavigation","sidebar","watchNavigation","watchSearchQuery","prepare","focus$","blur$","activeElement","watchElementFocus","focus","watchSearchReset","css","link","article","title","teaser","renderSectionDocument","location","text","href","class","tabIndex","renderSearchResult","sections","renderArticleDocument","WithLatestFromOperator","WithLatestFromSubscriber","found","_tryProject","paintSearchResultMeta","query$","meta","withLatestFrom","textContent","setSearchResultMeta","resetSearchResultMeta","watchSearchResult","result$","container","render$","watchElementOffset","scrollHeight","log","resetSearchResultList","paintSearchResultList","mountTabs","watchTabs","split","reverse","_includes","inf","_indexOf","hasOrAdd","shouldAdd","prevSize","type","Infinity","_items","_nativeSet","has","bIdx","_Set","Set","first","second","out","firstLen","secondLen","toFilterOut","PackerMessageType","SearchMessageType","watchTableOfContents","sidebar$","els","querySelectorAll","anchors$","table","Map","decodeURIComponent","hash","header","path","anchor","tagName","begin","end","watchAnchorList","paintAnchorList","anchors","isSearchDumpMessage","DUMP","isSearchResultMessage","RESULT","documentElement","newvalue","trim","setupWorkers","Worker","search","packer","packerMessage$","packer$","BINARY","data","localStorage","setItem","searchMessage$","search$","STRING","data$","base","fromLocal","getItem","first_1","getPrototypeOf","resultSelector_1","forkJoin","SETUP","initialize","isConfig","SyntaxError","location$","href$","hash$","tablet$","searchWorkerRecv$","components$","names","document$","components","replaceWith","watchComponentMap","component","switchComponent","QUERY","checked","click","navigation$","toc$","mountTableOfContents","resultComponent$","mountSearchResult","tabs$","hero$","a$","reset$"],"mappings":"4DACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QA0Df,OArDAF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,oBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb,EAAS,aAAc,CAAEmB,OAAO,KAQvDrB,EAAoBsB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQrB,EAAoBqB,IAC/B,EAAPE,EAAU,OAAOF,EACpB,GAAW,EAAPE,GAA8B,iBAAVF,GAAsBA,GAASA,EAAMG,WAAY,OAAOH,EAChF,IAAII,EAAKX,OAAOY,OAAO,MAGvB,GAFA1B,EAAoBkB,EAAEO,GACtBX,OAAOC,eAAeU,EAAI,UAAW,CAAET,YAAY,EAAMK,MAAOA,IACtD,EAAPE,GAA4B,iBAATF,EAAmB,IAAI,IA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EX,GAAY,IE2NVwX,CAAqBhM,EAAO,CAAE3B,QAAO,EAAEoE,MAAK,KAI1CwJ,EAAmBR,EAAU,UAChCrqB,KbvOE,SACL4e,EAAc7K,GAEd,OAAO/T,EACL4N,IAAU,SAAAsI,GAAM,OAAAmO,GAAkBnO,EAAI0I,EAAO7K,MAC7CX,GAAY,IamOV0X,CAAkBlM,EAAO,CAAE0F,QAAO,EAAEP,OAAQA,EAAO/jB,KAAKmN,GAAM,aAG5D4d,EAAQV,EAAU,QACrBrqB,KACC8kB,GAAUlG,EAAO,CAAE3B,QAAO,KAGxB+N,EAAQX,EAAU,QACrBrqB,KACC2e,GAAUC,EAAO,CAAE3B,QAAO,KAOxBkL,GADStS,GAA6B,2BAC7BA,GAA6B,4BAEtCoV,GGjTN/U,EHiTuBiS,EG/ShBvU,GAAUsC,EAAI,UAClBlW,KACCmN,GAAM,aH8SPnN,KACCyM,GAAO,GACP,GAAM,MAGJye,EAASb,EAAU,SACtBrqB,KACC4N,GAAU+U,KAGdvb,GAAM6jB,EAAIC,GACPlrB,KACCkR,GAAYmZ,EAA4B,UACxCxd,IAAI,SAAAqJ,GAAM,OAAAA,EAAGwM,YAEZniB,YAIL,IAAM6N,EAAQ,CACZ2V,OAAM,EACNO,QAASuG,EACTK,OAAM,EACN7J,MAAK,EACLqJ,YAAW,EACXC,KAAI,EACJI,MAAK,EACLC,MAAK,GAMP,OAHA5jB,GAAK,gBAAI,EAAOgH,KACb7N,YAEI,CACLqe,MAAK,EACLxQ,MAAK","file":"bundle.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 7);\n","/** PURE_IMPORTS_START PURE_IMPORTS_END */\nvar __window = typeof window !== 'undefined' && window;\nvar __self = typeof self !== 'undefined' && typeof WorkerGlobalScope !== 'undefined' &&\n self instanceof WorkerGlobalScope && self;\nvar __global = typeof global !== 'undefined' && global;\nvar _root = __window || __global || __self;\n/*@__PURE__*/ (function () {\n if (!_root) {\n throw /*@__PURE__*/ new Error('RxJS could not find any global context (window, self, global)');\n }\n})();\nexport { _root as root };\n//# sourceMappingURL=root.js.map\n","var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || new Function(\"return this\")();\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n","export default function _isPlaceholder(a) {\n return a != null && typeof a === 'object' && a['@@functional/placeholder'] === true;\n}","import _isPlaceholder from './_isPlaceholder.js';\n\n/**\n * Optimized internal one-arity curry function.\n *\n * @private\n * @category Function\n * @param {Function} fn The function to curry.\n * @return {Function} The curried function.\n */\nexport default function _curry1(fn) {\n return function f1(a) {\n if (arguments.length === 0 || _isPlaceholder(a)) {\n return f1;\n } else {\n return fn.apply(this, arguments);\n }\n };\n}","export default function _identity(x) {\n return x;\n}","import _curry1 from './internal/_curry1.js';\nimport _identity from './internal/_identity.js';\n\n/**\n * A function that does nothing but return the parameter supplied to it. Good\n * as a default or placeholder function.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Function\n * @sig a -> a\n * @param {*} x The value to return.\n * @return {*} The input value, `x`.\n * @example\n *\n * R.identity(1); //=> 1\n *\n * const obj = {};\n * R.identity(obj) === obj; //=> true\n * @symb R.identity(a) = a\n */\nvar identity = /*#__PURE__*/_curry1(_identity);\nexport default identity;","export default function _has(prop, obj) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}","import _has from './_has.js';\n\nvar toString = Object.prototype.toString;\nvar _isArguments = /*#__PURE__*/function () {\n return toString.call(arguments) === '[object Arguments]' ? function _isArguments(x) {\n return toString.call(x) === '[object Arguments]';\n } : function _isArguments(x) {\n return _has('callee', x);\n };\n}();\n\nexport default _isArguments;","import _curry1 from './internal/_curry1.js';\nimport _has from './internal/_has.js';\nimport _isArguments from './internal/_isArguments.js';\n\n// cover IE < 9 keys issues\nvar hasEnumBug = ! /*#__PURE__*/{ toString: null }.propertyIsEnumerable('toString');\nvar nonEnumerableProps = ['constructor', 'valueOf', 'isPrototypeOf', 'toString', 'propertyIsEnumerable', 'hasOwnProperty', 'toLocaleString'];\n// Safari bug\nvar hasArgsEnumBug = /*#__PURE__*/function () {\n 'use strict';\n\n return arguments.propertyIsEnumerable('length');\n}();\n\nvar contains = function contains(list, item) {\n var idx = 0;\n while (idx < list.length) {\n if (list[idx] === item) {\n return true;\n }\n idx += 1;\n }\n return false;\n};\n\n/**\n * Returns a list containing the names of all the enumerable own properties of\n * the supplied object.\n * Note that the order of the output array is not guaranteed to be consistent\n * across different JS platforms.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Object\n * @sig {k: v} -> [k]\n * @param {Object} obj The object to extract properties from\n * @return {Array} An array of the object's own properties.\n * @see R.keysIn, R.values\n * @example\n *\n * R.keys({a: 1, b: 2, c: 3}); //=> ['a', 'b', 'c']\n */\nvar keys = typeof Object.keys === 'function' && !hasArgsEnumBug ? /*#__PURE__*/_curry1(function keys(obj) {\n return Object(obj) !== obj ? [] : Object.keys(obj);\n}) : /*#__PURE__*/_curry1(function keys(obj) {\n if (Object(obj) !== obj) {\n return [];\n }\n var prop, nIdx;\n var ks = [];\n var checkArgsLength = hasArgsEnumBug && _isArguments(obj);\n for (prop in obj) {\n if (_has(prop, obj) && (!checkArgsLength || prop !== 'length')) {\n ks[ks.length] = prop;\n }\n }\n if (hasEnumBug) {\n nIdx = nonEnumerableProps.length - 1;\n while (nIdx >= 0) {\n prop = nonEnumerableProps[nIdx];\n if (_has(prop, obj) && !contains(ks, prop)) {\n ks[ks.length] = prop;\n }\n nIdx -= 1;\n }\n }\n return ks;\n});\nexport default keys;","import _curry1 from './internal/_curry1.js';\nimport keys from './keys.js';\n\n/**\n * Returns a list of all the enumerable own properties of the supplied object.\n * Note that the order of the output array is not guaranteed across different\n * JS platforms.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Object\n * @sig {k: v} -> [v]\n * @param {Object} obj The object to extract values from\n * @return {Array} An array of the values of the object's own properties.\n * @see R.valuesIn, R.keys\n * @example\n *\n * R.values({a: 1, b: 2, c: 3}); //=> [1, 2, 3]\n */\nvar values = /*#__PURE__*/_curry1(function values(obj) {\n var props = keys(obj);\n var len = props.length;\n var vals = [];\n var idx = 0;\n while (idx < len) {\n vals[idx] = obj[props[idx]];\n idx += 1;\n }\n return vals;\n});\nexport default values;","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)\r\n t[p[i]] = s[p[i]];\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator], i = 0;\r\n if (m) return m.call(o);\r\n return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n","/** PURE_IMPORTS_START PURE_IMPORTS_END */\nexport function isFunction(x) {\n return typeof x === 'function';\n}\n//# sourceMappingURL=isFunction.js.map\n","/** PURE_IMPORTS_START PURE_IMPORTS_END */\nvar _enable_super_gross_mode_that_will_cause_bad_things = false;\nexport var config = {\n Promise: undefined,\n set useDeprecatedSynchronousErrorHandling(value) {\n if (value) {\n var error = /*@__PURE__*/ new Error();\n /*@__PURE__*/ console.warn('DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at: \\n' + error.stack);\n }\n else if (_enable_super_gross_mode_that_will_cause_bad_things) {\n /*@__PURE__*/ console.log('RxJS: Back to a better error behavior. Thank you. <3');\n }\n _enable_super_gross_mode_that_will_cause_bad_things = value;\n },\n get useDeprecatedSynchronousErrorHandling() {\n return _enable_super_gross_mode_that_will_cause_bad_things;\n },\n};\n//# sourceMappingURL=config.js.map\n","/** PURE_IMPORTS_START PURE_IMPORTS_END */\nexport function hostReportError(err) {\n setTimeout(function () { throw err; }, 0);\n}\n//# sourceMappingURL=hostReportError.js.map\n","/** PURE_IMPORTS_START _config,_util_hostReportError PURE_IMPORTS_END */\nimport { config } from './config';\nimport { hostReportError } from './util/hostReportError';\nexport var empty = {\n closed: true,\n next: function (value) { },\n error: function (err) {\n if (config.useDeprecatedSynchronousErrorHandling) {\n throw err;\n }\n else {\n hostReportError(err);\n }\n },\n complete: function () { }\n};\n//# sourceMappingURL=Observer.js.map\n","/** PURE_IMPORTS_START PURE_IMPORTS_END */\nexport var isArray = /*@__PURE__*/ (function () { return Array.isArray || (function (x) { return x && typeof x.length === 'number'; }); })();\n//# sourceMappingURL=isArray.js.map\n","/** PURE_IMPORTS_START PURE_IMPORTS_END */\nexport function isObject(x) {\n return x !== null && typeof x === 'object';\n}\n//# sourceMappingURL=isObject.js.map\n","/** PURE_IMPORTS_START PURE_IMPORTS_END */\nvar UnsubscriptionErrorImpl = /*@__PURE__*/ (function () {\n function UnsubscriptionErrorImpl(errors) {\n Error.call(this);\n this.message = errors ?\n errors.length + \" errors occurred during unsubscription:\\n\" + errors.map(function (err, i) { return i + 1 + \") \" + err.toString(); }).join('\\n ') : '';\n this.name = 'UnsubscriptionError';\n this.errors = errors;\n return this;\n }\n UnsubscriptionErrorImpl.prototype = /*@__PURE__*/ Object.create(Error.prototype);\n return UnsubscriptionErrorImpl;\n})();\nexport var UnsubscriptionError = UnsubscriptionErrorImpl;\n//# sourceMappingURL=UnsubscriptionError.js.map\n","/** PURE_IMPORTS_START _util_isArray,_util_isObject,_util_isFunction,_util_UnsubscriptionError PURE_IMPORTS_END */\nimport { isArray } from './util/isArray';\nimport { isObject } from './util/isObject';\nimport { isFunction } from './util/isFunction';\nimport { UnsubscriptionError } from './util/UnsubscriptionError';\nvar Subscription = /*@__PURE__*/ (function () {\n function Subscription(unsubscribe) {\n this.closed = false;\n this._parentOrParents = null;\n this._subscriptions = null;\n if (unsubscribe) {\n this._unsubscribe = unsubscribe;\n }\n }\n Subscription.prototype.unsubscribe = function () {\n var errors;\n if (this.closed) {\n return;\n }\n var _a = this, _parentOrParents = _a._parentOrParents, _unsubscribe = _a._unsubscribe, _subscriptions = _a._subscriptions;\n this.closed = true;\n this._parentOrParents = null;\n this._subscriptions = null;\n if (_parentOrParents instanceof Subscription) {\n _parentOrParents.remove(this);\n }\n else if (_parentOrParents !== null) {\n for (var index = 0; index < _parentOrParents.length; ++index) {\n var parent_1 = _parentOrParents[index];\n parent_1.remove(this);\n }\n }\n if (isFunction(_unsubscribe)) {\n try {\n _unsubscribe.call(this);\n }\n catch (e) {\n errors = e instanceof UnsubscriptionError ? flattenUnsubscriptionErrors(e.errors) : [e];\n }\n }\n if (isArray(_subscriptions)) {\n var index = -1;\n var len = _subscriptions.length;\n while (++index < len) {\n var sub = _subscriptions[index];\n if (isObject(sub)) {\n try {\n sub.unsubscribe();\n }\n catch (e) {\n errors = errors || [];\n if (e instanceof UnsubscriptionError) {\n errors = errors.concat(flattenUnsubscriptionErrors(e.errors));\n }\n else {\n errors.push(e);\n }\n }\n }\n }\n }\n if (errors) {\n throw new UnsubscriptionError(errors);\n }\n };\n Subscription.prototype.add = function (teardown) {\n var subscription = teardown;\n if (!teardown) {\n return Subscription.EMPTY;\n }\n switch (typeof teardown) {\n case 'function':\n subscription = new Subscription(teardown);\n case 'object':\n if (subscription === this || subscription.closed || typeof subscription.unsubscribe !== 'function') {\n return subscription;\n }\n else if (this.closed) {\n subscription.unsubscribe();\n return subscription;\n }\n else if (!(subscription instanceof Subscription)) {\n var tmp = subscription;\n subscription = new Subscription();\n subscription._subscriptions = [tmp];\n }\n break;\n default: {\n throw new Error('unrecognized teardown ' + teardown + ' added to Subscription.');\n }\n }\n var _parentOrParents = subscription._parentOrParents;\n if (_parentOrParents === null) {\n subscription._parentOrParents = this;\n }\n else if (_parentOrParents instanceof Subscription) {\n if (_parentOrParents === this) {\n return subscription;\n }\n subscription._parentOrParents = [_parentOrParents, this];\n }\n else if (_parentOrParents.indexOf(this) === -1) {\n _parentOrParents.push(this);\n }\n else {\n return subscription;\n }\n var subscriptions = this._subscriptions;\n if (subscriptions === null) {\n this._subscriptions = [subscription];\n }\n else {\n subscriptions.push(subscription);\n }\n return subscription;\n };\n Subscription.prototype.remove = function (subscription) {\n var subscriptions = this._subscriptions;\n if (subscriptions) {\n var subscriptionIndex = subscriptions.indexOf(subscription);\n if (subscriptionIndex !== -1) {\n subscriptions.splice(subscriptionIndex, 1);\n }\n }\n };\n Subscription.EMPTY = (function (empty) {\n empty.closed = true;\n return empty;\n }(new Subscription()));\n return Subscription;\n}());\nexport { Subscription };\nfunction flattenUnsubscriptionErrors(errors) {\n return errors.reduce(function (errs, err) { return errs.concat((err instanceof UnsubscriptionError) ? err.errors : err); }, []);\n}\n//# sourceMappingURL=Subscription.js.map\n","/** PURE_IMPORTS_START PURE_IMPORTS_END */\nexport var rxSubscriber = /*@__PURE__*/ (function () {\n return typeof Symbol === 'function'\n ? /*@__PURE__*/ Symbol('rxSubscriber')\n : '@@rxSubscriber_' + /*@__PURE__*/ Math.random();\n})();\nexport var $$rxSubscriber = rxSubscriber;\n//# sourceMappingURL=rxSubscriber.js.map\n","/** PURE_IMPORTS_START tslib,_util_isFunction,_Observer,_Subscription,_internal_symbol_rxSubscriber,_config,_util_hostReportError PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { isFunction } from './util/isFunction';\nimport { empty as emptyObserver } from './Observer';\nimport { Subscription } from './Subscription';\nimport { rxSubscriber as rxSubscriberSymbol } from '../internal/symbol/rxSubscriber';\nimport { config } from './config';\nimport { hostReportError } from './util/hostReportError';\nvar Subscriber = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(Subscriber, _super);\n function Subscriber(destinationOrNext, error, complete) {\n var _this = _super.call(this) || this;\n _this.syncErrorValue = null;\n _this.syncErrorThrown = false;\n _this.syncErrorThrowable = false;\n _this.isStopped = false;\n switch (arguments.length) {\n case 0:\n _this.destination = emptyObserver;\n break;\n case 1:\n if (!destinationOrNext) {\n _this.destination = emptyObserver;\n break;\n }\n if (typeof destinationOrNext === 'object') {\n if (destinationOrNext instanceof Subscriber) {\n _this.syncErrorThrowable = destinationOrNext.syncErrorThrowable;\n _this.destination = destinationOrNext;\n destinationOrNext.add(_this);\n }\n else {\n _this.syncErrorThrowable = true;\n _this.destination = new SafeSubscriber(_this, destinationOrNext);\n }\n break;\n }\n default:\n _this.syncErrorThrowable = true;\n _this.destination = new SafeSubscriber(_this, destinationOrNext, error, complete);\n break;\n }\n return _this;\n }\n Subscriber.prototype[rxSubscriberSymbol] = function () { return this; };\n Subscriber.create = function (next, error, complete) {\n var subscriber = new Subscriber(next, error, complete);\n subscriber.syncErrorThrowable = false;\n return subscriber;\n };\n Subscriber.prototype.next = function (value) {\n if (!this.isStopped) {\n this._next(value);\n }\n };\n Subscriber.prototype.error = function (err) {\n if (!this.isStopped) {\n this.isStopped = true;\n this._error(err);\n }\n };\n Subscriber.prototype.complete = function () {\n if (!this.isStopped) {\n this.isStopped = true;\n this._complete();\n }\n };\n Subscriber.prototype.unsubscribe = function () {\n if (this.closed) {\n return;\n }\n this.isStopped = true;\n _super.prototype.unsubscribe.call(this);\n };\n Subscriber.prototype._next = function (value) {\n this.destination.next(value);\n };\n Subscriber.prototype._error = function (err) {\n this.destination.error(err);\n this.unsubscribe();\n };\n Subscriber.prototype._complete = function () {\n this.destination.complete();\n this.unsubscribe();\n };\n Subscriber.prototype._unsubscribeAndRecycle = function () {\n var _parentOrParents = this._parentOrParents;\n this._parentOrParents = null;\n this.unsubscribe();\n this.closed = false;\n this.isStopped = false;\n this._parentOrParents = _parentOrParents;\n return this;\n };\n return Subscriber;\n}(Subscription));\nexport { Subscriber };\nvar SafeSubscriber = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(SafeSubscriber, _super);\n function SafeSubscriber(_parentSubscriber, observerOrNext, error, complete) {\n var _this = _super.call(this) || this;\n _this._parentSubscriber = _parentSubscriber;\n var next;\n var context = _this;\n if (isFunction(observerOrNext)) {\n next = observerOrNext;\n }\n else if (observerOrNext) {\n next = observerOrNext.next;\n error = observerOrNext.error;\n complete = observerOrNext.complete;\n if (observerOrNext !== emptyObserver) {\n context = Object.create(observerOrNext);\n if (isFunction(context.unsubscribe)) {\n _this.add(context.unsubscribe.bind(context));\n }\n context.unsubscribe = _this.unsubscribe.bind(_this);\n }\n }\n _this._context = context;\n _this._next = next;\n _this._error = error;\n _this._complete = complete;\n return _this;\n }\n SafeSubscriber.prototype.next = function (value) {\n if (!this.isStopped && this._next) {\n var _parentSubscriber = this._parentSubscriber;\n if (!config.useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) {\n this.__tryOrUnsub(this._next, value);\n }\n else if (this.__tryOrSetError(_parentSubscriber, this._next, value)) {\n this.unsubscribe();\n }\n }\n };\n SafeSubscriber.prototype.error = function (err) {\n if (!this.isStopped) {\n var _parentSubscriber = this._parentSubscriber;\n var useDeprecatedSynchronousErrorHandling = config.useDeprecatedSynchronousErrorHandling;\n if (this._error) {\n if (!useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) {\n this.__tryOrUnsub(this._error, err);\n this.unsubscribe();\n }\n else {\n this.__tryOrSetError(_parentSubscriber, this._error, err);\n this.unsubscribe();\n }\n }\n else if (!_parentSubscriber.syncErrorThrowable) {\n this.unsubscribe();\n if (useDeprecatedSynchronousErrorHandling) {\n throw err;\n }\n hostReportError(err);\n }\n else {\n if (useDeprecatedSynchronousErrorHandling) {\n _parentSubscriber.syncErrorValue = err;\n _parentSubscriber.syncErrorThrown = true;\n }\n else {\n hostReportError(err);\n }\n this.unsubscribe();\n }\n }\n };\n SafeSubscriber.prototype.complete = function () {\n var _this = this;\n if (!this.isStopped) {\n var _parentSubscriber = this._parentSubscriber;\n if (this._complete) {\n var wrappedComplete = function () { return _this._complete.call(_this._context); };\n if (!config.useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) {\n this.__tryOrUnsub(wrappedComplete);\n this.unsubscribe();\n }\n else {\n this.__tryOrSetError(_parentSubscriber, wrappedComplete);\n this.unsubscribe();\n }\n }\n else {\n this.unsubscribe();\n }\n }\n };\n SafeSubscriber.prototype.__tryOrUnsub = function (fn, value) {\n try {\n fn.call(this._context, value);\n }\n catch (err) {\n this.unsubscribe();\n if (config.useDeprecatedSynchronousErrorHandling) {\n throw err;\n }\n else {\n hostReportError(err);\n }\n }\n };\n SafeSubscriber.prototype.__tryOrSetError = function (parent, fn, value) {\n if (!config.useDeprecatedSynchronousErrorHandling) {\n throw new Error('bad call');\n }\n try {\n fn.call(this._context, value);\n }\n catch (err) {\n if (config.useDeprecatedSynchronousErrorHandling) {\n parent.syncErrorValue = err;\n parent.syncErrorThrown = true;\n return true;\n }\n else {\n hostReportError(err);\n return true;\n }\n }\n return false;\n };\n SafeSubscriber.prototype._unsubscribe = function () {\n var _parentSubscriber = this._parentSubscriber;\n this._context = null;\n this._parentSubscriber = null;\n _parentSubscriber.unsubscribe();\n };\n return SafeSubscriber;\n}(Subscriber));\nexport { SafeSubscriber };\n//# sourceMappingURL=Subscriber.js.map\n","/** PURE_IMPORTS_START PURE_IMPORTS_END */\nexport var observable = /*@__PURE__*/ (function () { return typeof Symbol === 'function' && Symbol.observable || '@@observable'; })();\n//# sourceMappingURL=observable.js.map\n","/** PURE_IMPORTS_START PURE_IMPORTS_END */\nexport function noop() { }\n//# sourceMappingURL=noop.js.map\n","/** PURE_IMPORTS_START _noop PURE_IMPORTS_END */\nimport { noop } from './noop';\nexport function pipe() {\n var fns = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n fns[_i] = arguments[_i];\n }\n return pipeFromArray(fns);\n}\nexport function pipeFromArray(fns) {\n if (!fns) {\n return noop;\n }\n if (fns.length === 1) {\n return fns[0];\n }\n return function piped(input) {\n return fns.reduce(function (prev, fn) { return fn(prev); }, input);\n };\n}\n//# sourceMappingURL=pipe.js.map\n","/** PURE_IMPORTS_START _util_canReportError,_util_toSubscriber,_symbol_observable,_util_pipe,_config PURE_IMPORTS_END */\nimport { canReportError } from './util/canReportError';\nimport { toSubscriber } from './util/toSubscriber';\nimport { observable as Symbol_observable } from './symbol/observable';\nimport { pipeFromArray } from './util/pipe';\nimport { config } from './config';\nvar Observable = /*@__PURE__*/ (function () {\n function Observable(subscribe) {\n this._isScalar = false;\n if (subscribe) {\n this._subscribe = subscribe;\n }\n }\n Observable.prototype.lift = function (operator) {\n var observable = new Observable();\n observable.source = this;\n observable.operator = operator;\n return observable;\n };\n Observable.prototype.subscribe = function (observerOrNext, error, complete) {\n var operator = this.operator;\n var sink = toSubscriber(observerOrNext, error, complete);\n if (operator) {\n sink.add(operator.call(sink, this.source));\n }\n else {\n sink.add(this.source || (config.useDeprecatedSynchronousErrorHandling && !sink.syncErrorThrowable) ?\n this._subscribe(sink) :\n this._trySubscribe(sink));\n }\n if (config.useDeprecatedSynchronousErrorHandling) {\n if (sink.syncErrorThrowable) {\n sink.syncErrorThrowable = false;\n if (sink.syncErrorThrown) {\n throw sink.syncErrorValue;\n }\n }\n }\n return sink;\n };\n Observable.prototype._trySubscribe = function (sink) {\n try {\n return this._subscribe(sink);\n }\n catch (err) {\n if (config.useDeprecatedSynchronousErrorHandling) {\n sink.syncErrorThrown = true;\n sink.syncErrorValue = err;\n }\n if (canReportError(sink)) {\n sink.error(err);\n }\n else {\n console.warn(err);\n }\n }\n };\n Observable.prototype.forEach = function (next, promiseCtor) {\n var _this = this;\n promiseCtor = getPromiseCtor(promiseCtor);\n return new promiseCtor(function (resolve, reject) {\n var subscription;\n subscription = _this.subscribe(function (value) {\n try {\n next(value);\n }\n catch (err) {\n reject(err);\n if (subscription) {\n subscription.unsubscribe();\n }\n }\n }, reject, resolve);\n });\n };\n Observable.prototype._subscribe = function (subscriber) {\n var source = this.source;\n return source && source.subscribe(subscriber);\n };\n Observable.prototype[Symbol_observable] = function () {\n return this;\n };\n Observable.prototype.pipe = function () {\n var operations = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n operations[_i] = arguments[_i];\n }\n if (operations.length === 0) {\n return this;\n }\n return pipeFromArray(operations)(this);\n };\n Observable.prototype.toPromise = function (promiseCtor) {\n var _this = this;\n promiseCtor = getPromiseCtor(promiseCtor);\n return new promiseCtor(function (resolve, reject) {\n var value;\n _this.subscribe(function (x) { return value = x; }, function (err) { return reject(err); }, function () { return resolve(value); });\n });\n };\n Observable.create = function (subscribe) {\n return new Observable(subscribe);\n };\n return Observable;\n}());\nexport { Observable };\nfunction getPromiseCtor(promiseCtor) {\n if (!promiseCtor) {\n promiseCtor = config.Promise || Promise;\n }\n if (!promiseCtor) {\n throw new Error('no Promise impl found');\n }\n return promiseCtor;\n}\n//# sourceMappingURL=Observable.js.map\n","/** PURE_IMPORTS_START _Subscriber,_symbol_rxSubscriber,_Observer PURE_IMPORTS_END */\nimport { Subscriber } from '../Subscriber';\nimport { rxSubscriber as rxSubscriberSymbol } from '../symbol/rxSubscriber';\nimport { empty as emptyObserver } from '../Observer';\nexport function toSubscriber(nextOrObserver, error, complete) {\n if (nextOrObserver) {\n if (nextOrObserver instanceof Subscriber) {\n return nextOrObserver;\n }\n if (nextOrObserver[rxSubscriberSymbol]) {\n return nextOrObserver[rxSubscriberSymbol]();\n }\n }\n if (!nextOrObserver && !error && !complete) {\n return new Subscriber(emptyObserver);\n }\n return new Subscriber(nextOrObserver, error, complete);\n}\n//# sourceMappingURL=toSubscriber.js.map\n","/** PURE_IMPORTS_START _Subscriber PURE_IMPORTS_END */\nimport { Subscriber } from '../Subscriber';\nexport function canReportError(observer) {\n while (observer) {\n var _a = observer, closed_1 = _a.closed, destination = _a.destination, isStopped = _a.isStopped;\n if (closed_1 || isStopped) {\n return false;\n }\n else if (destination && destination instanceof Subscriber) {\n observer = destination;\n }\n else {\n observer = null;\n }\n }\n return true;\n}\n//# sourceMappingURL=canReportError.js.map\n","/** PURE_IMPORTS_START PURE_IMPORTS_END */\nvar ObjectUnsubscribedErrorImpl = /*@__PURE__*/ (function () {\n function ObjectUnsubscribedErrorImpl() {\n Error.call(this);\n this.message = 'object unsubscribed';\n this.name = 'ObjectUnsubscribedError';\n return this;\n }\n ObjectUnsubscribedErrorImpl.prototype = /*@__PURE__*/ Object.create(Error.prototype);\n return ObjectUnsubscribedErrorImpl;\n})();\nexport var ObjectUnsubscribedError = ObjectUnsubscribedErrorImpl;\n//# sourceMappingURL=ObjectUnsubscribedError.js.map\n","/** PURE_IMPORTS_START tslib,_Subscription PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { Subscription } from './Subscription';\nvar SubjectSubscription = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(SubjectSubscription, _super);\n function SubjectSubscription(subject, subscriber) {\n var _this = _super.call(this) || this;\n _this.subject = subject;\n _this.subscriber = subscriber;\n _this.closed = false;\n return _this;\n }\n SubjectSubscription.prototype.unsubscribe = function () {\n if (this.closed) {\n return;\n }\n this.closed = true;\n var subject = this.subject;\n var observers = subject.observers;\n this.subject = null;\n if (!observers || observers.length === 0 || subject.isStopped || subject.closed) {\n return;\n }\n var subscriberIndex = observers.indexOf(this.subscriber);\n if (subscriberIndex !== -1) {\n observers.splice(subscriberIndex, 1);\n }\n };\n return SubjectSubscription;\n}(Subscription));\nexport { SubjectSubscription };\n//# sourceMappingURL=SubjectSubscription.js.map\n","/** PURE_IMPORTS_START tslib,_Observable,_Subscriber,_Subscription,_util_ObjectUnsubscribedError,_SubjectSubscription,_internal_symbol_rxSubscriber PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { Observable } from './Observable';\nimport { Subscriber } from './Subscriber';\nimport { Subscription } from './Subscription';\nimport { ObjectUnsubscribedError } from './util/ObjectUnsubscribedError';\nimport { SubjectSubscription } from './SubjectSubscription';\nimport { rxSubscriber as rxSubscriberSymbol } from '../internal/symbol/rxSubscriber';\nvar SubjectSubscriber = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(SubjectSubscriber, _super);\n function SubjectSubscriber(destination) {\n var _this = _super.call(this, destination) || this;\n _this.destination = destination;\n return _this;\n }\n return SubjectSubscriber;\n}(Subscriber));\nexport { SubjectSubscriber };\nvar Subject = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(Subject, _super);\n function Subject() {\n var _this = _super.call(this) || this;\n _this.observers = [];\n _this.closed = false;\n _this.isStopped = false;\n _this.hasError = false;\n _this.thrownError = null;\n return _this;\n }\n Subject.prototype[rxSubscriberSymbol] = function () {\n return new SubjectSubscriber(this);\n };\n Subject.prototype.lift = function (operator) {\n var subject = new AnonymousSubject(this, this);\n subject.operator = operator;\n return subject;\n };\n Subject.prototype.next = function (value) {\n if (this.closed) {\n throw new ObjectUnsubscribedError();\n }\n if (!this.isStopped) {\n var observers = this.observers;\n var len = observers.length;\n var copy = observers.slice();\n for (var i = 0; i < len; i++) {\n copy[i].next(value);\n }\n }\n };\n Subject.prototype.error = function (err) {\n if (this.closed) {\n throw new ObjectUnsubscribedError();\n }\n this.hasError = true;\n this.thrownError = err;\n this.isStopped = true;\n var observers = this.observers;\n var len = observers.length;\n var copy = observers.slice();\n for (var i = 0; i < len; i++) {\n copy[i].error(err);\n }\n this.observers.length = 0;\n };\n Subject.prototype.complete = function () {\n if (this.closed) {\n throw new ObjectUnsubscribedError();\n }\n this.isStopped = true;\n var observers = this.observers;\n var len = observers.length;\n var copy = observers.slice();\n for (var i = 0; i < len; i++) {\n copy[i].complete();\n }\n this.observers.length = 0;\n };\n Subject.prototype.unsubscribe = function () {\n this.isStopped = true;\n this.closed = true;\n this.observers = null;\n };\n Subject.prototype._trySubscribe = function (subscriber) {\n if (this.closed) {\n throw new ObjectUnsubscribedError();\n }\n else {\n return _super.prototype._trySubscribe.call(this, subscriber);\n }\n };\n Subject.prototype._subscribe = function (subscriber) {\n if (this.closed) {\n throw new ObjectUnsubscribedError();\n }\n else if (this.hasError) {\n subscriber.error(this.thrownError);\n return Subscription.EMPTY;\n }\n else if (this.isStopped) {\n subscriber.complete();\n return Subscription.EMPTY;\n }\n else {\n this.observers.push(subscriber);\n return new SubjectSubscription(this, subscriber);\n }\n };\n Subject.prototype.asObservable = function () {\n var observable = new Observable();\n observable.source = this;\n return observable;\n };\n Subject.create = function (destination, source) {\n return new AnonymousSubject(destination, source);\n };\n return Subject;\n}(Observable));\nexport { Subject };\nvar AnonymousSubject = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(AnonymousSubject, _super);\n function AnonymousSubject(destination, source) {\n var _this = _super.call(this) || this;\n _this.destination = destination;\n _this.source = source;\n return _this;\n }\n AnonymousSubject.prototype.next = function (value) {\n var destination = this.destination;\n if (destination && destination.next) {\n destination.next(value);\n }\n };\n AnonymousSubject.prototype.error = function (err) {\n var destination = this.destination;\n if (destination && destination.error) {\n this.destination.error(err);\n }\n };\n AnonymousSubject.prototype.complete = function () {\n var destination = this.destination;\n if (destination && destination.complete) {\n this.destination.complete();\n }\n };\n AnonymousSubject.prototype._subscribe = function (subscriber) {\n var source = this.source;\n if (source) {\n return this.source.subscribe(subscriber);\n }\n else {\n return Subscription.EMPTY;\n }\n };\n return AnonymousSubject;\n}(Subject));\nexport { AnonymousSubject };\n//# sourceMappingURL=Subject.js.map\n","/** PURE_IMPORTS_START PURE_IMPORTS_END */\nexport function isScheduler(value) {\n return value && typeof value.schedule === 'function';\n}\n//# sourceMappingURL=isScheduler.js.map\n","/** PURE_IMPORTS_START PURE_IMPORTS_END */\nexport var subscribeToArray = function (array) {\n return function (subscriber) {\n for (var i = 0, len = array.length; i < len && !subscriber.closed; i++) {\n subscriber.next(array[i]);\n }\n subscriber.complete();\n };\n};\n//# sourceMappingURL=subscribeToArray.js.map\n","/** PURE_IMPORTS_START _Observable,_Subscription PURE_IMPORTS_END */\nimport { Observable } from '../Observable';\nimport { Subscription } from '../Subscription';\nexport function scheduleArray(input, scheduler) {\n return new Observable(function (subscriber) {\n var sub = new Subscription();\n var i = 0;\n sub.add(scheduler.schedule(function () {\n if (i === input.length) {\n subscriber.complete();\n return;\n }\n subscriber.next(input[i++]);\n if (!subscriber.closed) {\n sub.add(this.schedule());\n }\n }));\n return sub;\n });\n}\n//# sourceMappingURL=scheduleArray.js.map\n","/** PURE_IMPORTS_START _Observable,_util_subscribeToArray,_scheduled_scheduleArray PURE_IMPORTS_END */\nimport { Observable } from '../Observable';\nimport { subscribeToArray } from '../util/subscribeToArray';\nimport { scheduleArray } from '../scheduled/scheduleArray';\nexport function fromArray(input, scheduler) {\n if (!scheduler) {\n return new Observable(subscribeToArray(input));\n }\n else {\n return scheduleArray(input, scheduler);\n }\n}\n//# sourceMappingURL=fromArray.js.map\n","/** PURE_IMPORTS_START _util_isScheduler,_fromArray,_scheduled_scheduleArray PURE_IMPORTS_END */\nimport { isScheduler } from '../util/isScheduler';\nimport { fromArray } from './fromArray';\nimport { scheduleArray } from '../scheduled/scheduleArray';\nexport function of() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var scheduler = args[args.length - 1];\n if (isScheduler(scheduler)) {\n args.pop();\n return scheduleArray(args, scheduler);\n }\n else {\n return fromArray(args);\n }\n}\n//# sourceMappingURL=of.js.map\n","/** PURE_IMPORTS_START _Observable PURE_IMPORTS_END */\nimport { Observable } from '../Observable';\nexport var EMPTY = /*@__PURE__*/ new Observable(function (subscriber) { return subscriber.complete(); });\nexport function empty(scheduler) {\n return scheduler ? emptyScheduled(scheduler) : EMPTY;\n}\nfunction emptyScheduled(scheduler) {\n return new Observable(function (subscriber) { return scheduler.schedule(function () { return subscriber.complete(); }); });\n}\n//# sourceMappingURL=empty.js.map\n","/** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { Subscriber } from '../Subscriber';\nexport function map(project, thisArg) {\n return function mapOperation(source) {\n if (typeof project !== 'function') {\n throw new TypeError('argument is not a function. Are you looking for `mapTo()`?');\n }\n return source.lift(new MapOperator(project, thisArg));\n };\n}\nvar MapOperator = /*@__PURE__*/ (function () {\n function MapOperator(project, thisArg) {\n this.project = project;\n this.thisArg = thisArg;\n }\n MapOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new MapSubscriber(subscriber, this.project, this.thisArg));\n };\n return MapOperator;\n}());\nexport { MapOperator };\nvar MapSubscriber = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(MapSubscriber, _super);\n function MapSubscriber(destination, project, thisArg) {\n var _this = _super.call(this, destination) || this;\n _this.project = project;\n _this.count = 0;\n _this.thisArg = thisArg || _this;\n return _this;\n }\n MapSubscriber.prototype._next = function (value) {\n var result;\n try {\n result = this.project.call(this.thisArg, value, this.count++);\n }\n catch (err) {\n this.destination.error(err);\n return;\n }\n this.destination.next(result);\n };\n return MapSubscriber;\n}(Subscriber));\n//# sourceMappingURL=map.js.map\n","/** PURE_IMPORTS_START PURE_IMPORTS_END */\nexport function getSymbolIterator() {\n if (typeof Symbol !== 'function' || !Symbol.iterator) {\n return '@@iterator';\n }\n return Symbol.iterator;\n}\nexport var iterator = /*@__PURE__*/ getSymbolIterator();\nexport var $$iterator = iterator;\n//# sourceMappingURL=iterator.js.map\n","/** PURE_IMPORTS_START PURE_IMPORTS_END */\nexport var isArrayLike = (function (x) { return x && typeof x.length === 'number' && typeof x !== 'function'; });\n//# sourceMappingURL=isArrayLike.js.map\n","/** PURE_IMPORTS_START PURE_IMPORTS_END */\nexport function isPromise(value) {\n return !!value && typeof value.subscribe !== 'function' && typeof value.then === 'function';\n}\n//# sourceMappingURL=isPromise.js.map\n","/** PURE_IMPORTS_START _subscribeToArray,_subscribeToPromise,_subscribeToIterable,_subscribeToObservable,_isArrayLike,_isPromise,_isObject,_symbol_iterator,_symbol_observable PURE_IMPORTS_END */\nimport { subscribeToArray } from './subscribeToArray';\nimport { subscribeToPromise } from './subscribeToPromise';\nimport { subscribeToIterable } from './subscribeToIterable';\nimport { subscribeToObservable } from './subscribeToObservable';\nimport { isArrayLike } from './isArrayLike';\nimport { isPromise } from './isPromise';\nimport { isObject } from './isObject';\nimport { iterator as Symbol_iterator } from '../symbol/iterator';\nimport { observable as Symbol_observable } from '../symbol/observable';\nexport var subscribeTo = function (result) {\n if (!!result && typeof result[Symbol_observable] === 'function') {\n return subscribeToObservable(result);\n }\n else if (isArrayLike(result)) {\n return subscribeToArray(result);\n }\n else if (isPromise(result)) {\n return subscribeToPromise(result);\n }\n else if (!!result && typeof result[Symbol_iterator] === 'function') {\n return subscribeToIterable(result);\n }\n else {\n var value = isObject(result) ? 'an invalid object' : \"'\" + result + \"'\";\n var msg = \"You provided \" + value + \" where a stream was expected.\"\n + ' You can provide an Observable, Promise, Array, or Iterable.';\n throw new TypeError(msg);\n }\n};\n//# sourceMappingURL=subscribeTo.js.map\n","/** PURE_IMPORTS_START _symbol_observable PURE_IMPORTS_END */\nimport { observable as Symbol_observable } from '../symbol/observable';\nexport var subscribeToObservable = function (obj) {\n return function (subscriber) {\n var obs = obj[Symbol_observable]();\n if (typeof obs.subscribe !== 'function') {\n throw new TypeError('Provided object does not correctly implement Symbol.observable');\n }\n else {\n return obs.subscribe(subscriber);\n }\n };\n};\n//# sourceMappingURL=subscribeToObservable.js.map\n","/** PURE_IMPORTS_START _hostReportError PURE_IMPORTS_END */\nimport { hostReportError } from './hostReportError';\nexport var subscribeToPromise = function (promise) {\n return function (subscriber) {\n promise.then(function (value) {\n if (!subscriber.closed) {\n subscriber.next(value);\n subscriber.complete();\n }\n }, function (err) { return subscriber.error(err); })\n .then(null, hostReportError);\n return subscriber;\n };\n};\n//# sourceMappingURL=subscribeToPromise.js.map\n","/** PURE_IMPORTS_START _symbol_iterator PURE_IMPORTS_END */\nimport { iterator as Symbol_iterator } from '../symbol/iterator';\nexport var subscribeToIterable = function (iterable) {\n return function (subscriber) {\n var iterator = iterable[Symbol_iterator]();\n do {\n var item = iterator.next();\n if (item.done) {\n subscriber.complete();\n break;\n }\n subscriber.next(item.value);\n if (subscriber.closed) {\n break;\n }\n } while (true);\n if (typeof iterator.return === 'function') {\n subscriber.add(function () {\n if (iterator.return) {\n iterator.return();\n }\n });\n }\n return subscriber;\n };\n};\n//# sourceMappingURL=subscribeToIterable.js.map\n","/** PURE_IMPORTS_START _scheduleObservable,_schedulePromise,_scheduleArray,_scheduleIterable,_util_isInteropObservable,_util_isPromise,_util_isArrayLike,_util_isIterable PURE_IMPORTS_END */\nimport { scheduleObservable } from './scheduleObservable';\nimport { schedulePromise } from './schedulePromise';\nimport { scheduleArray } from './scheduleArray';\nimport { scheduleIterable } from './scheduleIterable';\nimport { isInteropObservable } from '../util/isInteropObservable';\nimport { isPromise } from '../util/isPromise';\nimport { isArrayLike } from '../util/isArrayLike';\nimport { isIterable } from '../util/isIterable';\nexport function scheduled(input, scheduler) {\n if (input != null) {\n if (isInteropObservable(input)) {\n return scheduleObservable(input, scheduler);\n }\n else if (isPromise(input)) {\n return schedulePromise(input, scheduler);\n }\n else if (isArrayLike(input)) {\n return scheduleArray(input, scheduler);\n }\n else if (isIterable(input) || typeof input === 'string') {\n return scheduleIterable(input, scheduler);\n }\n }\n throw new TypeError((input !== null && typeof input || input) + ' is not observable');\n}\n//# sourceMappingURL=scheduled.js.map\n","/** PURE_IMPORTS_START _symbol_observable PURE_IMPORTS_END */\nimport { observable as Symbol_observable } from '../symbol/observable';\nexport function isInteropObservable(input) {\n return input && typeof input[Symbol_observable] === 'function';\n}\n//# sourceMappingURL=isInteropObservable.js.map\n","/** PURE_IMPORTS_START _Observable,_Subscription,_symbol_observable PURE_IMPORTS_END */\nimport { Observable } from '../Observable';\nimport { Subscription } from '../Subscription';\nimport { observable as Symbol_observable } from '../symbol/observable';\nexport function scheduleObservable(input, scheduler) {\n return new Observable(function (subscriber) {\n var sub = new Subscription();\n sub.add(scheduler.schedule(function () {\n var observable = input[Symbol_observable]();\n sub.add(observable.subscribe({\n next: function (value) { sub.add(scheduler.schedule(function () { return subscriber.next(value); })); },\n error: function (err) { sub.add(scheduler.schedule(function () { return subscriber.error(err); })); },\n complete: function () { sub.add(scheduler.schedule(function () { return subscriber.complete(); })); },\n }));\n }));\n return sub;\n });\n}\n//# sourceMappingURL=scheduleObservable.js.map\n","/** PURE_IMPORTS_START _Observable,_Subscription PURE_IMPORTS_END */\nimport { Observable } from '../Observable';\nimport { Subscription } from '../Subscription';\nexport function schedulePromise(input, scheduler) {\n return new Observable(function (subscriber) {\n var sub = new Subscription();\n sub.add(scheduler.schedule(function () {\n return input.then(function (value) {\n sub.add(scheduler.schedule(function () {\n subscriber.next(value);\n sub.add(scheduler.schedule(function () { return subscriber.complete(); }));\n }));\n }, function (err) {\n sub.add(scheduler.schedule(function () { return subscriber.error(err); }));\n });\n }));\n return sub;\n });\n}\n//# sourceMappingURL=schedulePromise.js.map\n","/** PURE_IMPORTS_START _symbol_iterator PURE_IMPORTS_END */\nimport { iterator as Symbol_iterator } from '../symbol/iterator';\nexport function isIterable(input) {\n return input && typeof input[Symbol_iterator] === 'function';\n}\n//# sourceMappingURL=isIterable.js.map\n","/** PURE_IMPORTS_START _Observable,_Subscription,_symbol_iterator PURE_IMPORTS_END */\nimport { Observable } from '../Observable';\nimport { Subscription } from '../Subscription';\nimport { iterator as Symbol_iterator } from '../symbol/iterator';\nexport function scheduleIterable(input, scheduler) {\n if (!input) {\n throw new Error('Iterable cannot be null');\n }\n return new Observable(function (subscriber) {\n var sub = new Subscription();\n var iterator;\n sub.add(function () {\n if (iterator && typeof iterator.return === 'function') {\n iterator.return();\n }\n });\n sub.add(scheduler.schedule(function () {\n iterator = input[Symbol_iterator]();\n sub.add(scheduler.schedule(function () {\n if (subscriber.closed) {\n return;\n }\n var value;\n var done;\n try {\n var result = iterator.next();\n value = result.value;\n done = result.done;\n }\n catch (err) {\n subscriber.error(err);\n return;\n }\n if (done) {\n subscriber.complete();\n }\n else {\n subscriber.next(value);\n this.schedule();\n }\n }));\n }));\n return sub;\n });\n}\n//# sourceMappingURL=scheduleIterable.js.map\n","/** PURE_IMPORTS_START _Observable,_util_subscribeTo,_scheduled_scheduled PURE_IMPORTS_END */\nimport { Observable } from '../Observable';\nimport { subscribeTo } from '../util/subscribeTo';\nimport { scheduled } from '../scheduled/scheduled';\nexport function from(input, scheduler) {\n if (!scheduler) {\n if (input instanceof Observable) {\n return input;\n }\n return new Observable(subscribeTo(input));\n }\n else {\n return scheduled(input, scheduler);\n }\n}\n//# sourceMappingURL=from.js.map\n","/** PURE_IMPORTS_START _Observable,_util_isArray,_operators_map,_util_isObject,_from PURE_IMPORTS_END */\nimport { Observable } from '../Observable';\nimport { isArray } from '../util/isArray';\nimport { map } from '../operators/map';\nimport { isObject } from '../util/isObject';\nimport { from } from './from';\nexport function forkJoin() {\n var sources = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n sources[_i] = arguments[_i];\n }\n if (sources.length === 1) {\n var first_1 = sources[0];\n if (isArray(first_1)) {\n return forkJoinInternal(first_1, null);\n }\n if (isObject(first_1) && Object.getPrototypeOf(first_1) === Object.prototype) {\n var keys = Object.keys(first_1);\n return forkJoinInternal(keys.map(function (key) { return first_1[key]; }), keys);\n }\n }\n if (typeof sources[sources.length - 1] === 'function') {\n var resultSelector_1 = sources.pop();\n sources = (sources.length === 1 && isArray(sources[0])) ? sources[0] : sources;\n return forkJoinInternal(sources, null).pipe(map(function (args) { return resultSelector_1.apply(void 0, args); }));\n }\n return forkJoinInternal(sources, null);\n}\nfunction forkJoinInternal(sources, keys) {\n return new Observable(function (subscriber) {\n var len = sources.length;\n if (len === 0) {\n subscriber.complete();\n return;\n }\n var values = new Array(len);\n var completed = 0;\n var emitted = 0;\n var _loop_1 = function (i) {\n var source = from(sources[i]);\n var hasValue = false;\n subscriber.add(source.subscribe({\n next: function (value) {\n if (!hasValue) {\n hasValue = true;\n emitted++;\n }\n values[i] = value;\n },\n error: function (err) { return subscriber.error(err); },\n complete: function () {\n completed++;\n if (completed === len || !hasValue) {\n if (emitted === len) {\n subscriber.next(keys ?\n keys.reduce(function (result, key, i) { return (result[key] = values[i], result); }, {}) :\n values);\n }\n subscriber.complete();\n }\n }\n }));\n };\n for (var i = 0; i < len; i++) {\n _loop_1(i);\n }\n });\n}\n//# sourceMappingURL=forkJoin.js.map\n","/** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { Subscriber } from './Subscriber';\nvar InnerSubscriber = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(InnerSubscriber, _super);\n function InnerSubscriber(parent, outerValue, outerIndex) {\n var _this = _super.call(this) || this;\n _this.parent = parent;\n _this.outerValue = outerValue;\n _this.outerIndex = outerIndex;\n _this.index = 0;\n return _this;\n }\n InnerSubscriber.prototype._next = function (value) {\n this.parent.notifyNext(this.outerValue, value, this.outerIndex, this.index++, this);\n };\n InnerSubscriber.prototype._error = function (error) {\n this.parent.notifyError(error, this);\n this.unsubscribe();\n };\n InnerSubscriber.prototype._complete = function () {\n this.parent.notifyComplete(this);\n this.unsubscribe();\n };\n return InnerSubscriber;\n}(Subscriber));\nexport { InnerSubscriber };\n//# sourceMappingURL=InnerSubscriber.js.map\n","/** PURE_IMPORTS_START _InnerSubscriber,_subscribeTo,_Observable PURE_IMPORTS_END */\nimport { InnerSubscriber } from '../InnerSubscriber';\nimport { subscribeTo } from './subscribeTo';\nimport { Observable } from '../Observable';\nexport function subscribeToResult(outerSubscriber, result, outerValue, outerIndex, destination) {\n if (destination === void 0) {\n destination = new InnerSubscriber(outerSubscriber, outerValue, outerIndex);\n }\n if (destination.closed) {\n return undefined;\n }\n if (result instanceof Observable) {\n return result.subscribe(destination);\n }\n return subscribeTo(result)(destination);\n}\n//# sourceMappingURL=subscribeToResult.js.map\n","/** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { Subscriber } from './Subscriber';\nvar OuterSubscriber = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(OuterSubscriber, _super);\n function OuterSubscriber() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n OuterSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {\n this.destination.next(innerValue);\n };\n OuterSubscriber.prototype.notifyError = function (error, innerSub) {\n this.destination.error(error);\n };\n OuterSubscriber.prototype.notifyComplete = function (innerSub) {\n this.destination.complete();\n };\n return OuterSubscriber;\n}(Subscriber));\nexport { OuterSubscriber };\n//# sourceMappingURL=OuterSubscriber.js.map\n","/** PURE_IMPORTS_START tslib,_util_subscribeToResult,_OuterSubscriber,_InnerSubscriber,_map,_observable_from PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { subscribeToResult } from '../util/subscribeToResult';\nimport { OuterSubscriber } from '../OuterSubscriber';\nimport { InnerSubscriber } from '../InnerSubscriber';\nimport { map } from './map';\nimport { from } from '../observable/from';\nexport function mergeMap(project, resultSelector, concurrent) {\n if (concurrent === void 0) {\n concurrent = Number.POSITIVE_INFINITY;\n }\n if (typeof resultSelector === 'function') {\n return function (source) { return source.pipe(mergeMap(function (a, i) { return from(project(a, i)).pipe(map(function (b, ii) { return resultSelector(a, b, i, ii); })); }, concurrent)); };\n }\n else if (typeof resultSelector === 'number') {\n concurrent = resultSelector;\n }\n return function (source) { return source.lift(new MergeMapOperator(project, concurrent)); };\n}\nvar MergeMapOperator = /*@__PURE__*/ (function () {\n function MergeMapOperator(project, concurrent) {\n if (concurrent === void 0) {\n concurrent = Number.POSITIVE_INFINITY;\n }\n this.project = project;\n this.concurrent = concurrent;\n }\n MergeMapOperator.prototype.call = function (observer, source) {\n return source.subscribe(new MergeMapSubscriber(observer, this.project, this.concurrent));\n };\n return MergeMapOperator;\n}());\nexport { MergeMapOperator };\nvar MergeMapSubscriber = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(MergeMapSubscriber, _super);\n function MergeMapSubscriber(destination, project, concurrent) {\n if (concurrent === void 0) {\n concurrent = Number.POSITIVE_INFINITY;\n }\n var _this = _super.call(this, destination) || this;\n _this.project = project;\n _this.concurrent = concurrent;\n _this.hasCompleted = false;\n _this.buffer = [];\n _this.active = 0;\n _this.index = 0;\n return _this;\n }\n MergeMapSubscriber.prototype._next = function (value) {\n if (this.active < this.concurrent) {\n this._tryNext(value);\n }\n else {\n this.buffer.push(value);\n }\n };\n MergeMapSubscriber.prototype._tryNext = function (value) {\n var result;\n var index = this.index++;\n try {\n result = this.project(value, index);\n }\n catch (err) {\n this.destination.error(err);\n return;\n }\n this.active++;\n this._innerSub(result, value, index);\n };\n MergeMapSubscriber.prototype._innerSub = function (ish, value, index) {\n var innerSubscriber = new InnerSubscriber(this, undefined, undefined);\n var destination = this.destination;\n destination.add(innerSubscriber);\n subscribeToResult(this, ish, value, index, innerSubscriber);\n };\n MergeMapSubscriber.prototype._complete = function () {\n this.hasCompleted = true;\n if (this.active === 0 && this.buffer.length === 0) {\n this.destination.complete();\n }\n this.unsubscribe();\n };\n MergeMapSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {\n this.destination.next(innerValue);\n };\n MergeMapSubscriber.prototype.notifyComplete = function (innerSub) {\n var buffer = this.buffer;\n this.remove(innerSub);\n this.active--;\n if (buffer.length > 0) {\n this._next(buffer.shift());\n }\n else if (this.active === 0 && this.hasCompleted) {\n this.destination.complete();\n }\n };\n return MergeMapSubscriber;\n}(OuterSubscriber));\nexport { MergeMapSubscriber };\n//# sourceMappingURL=mergeMap.js.map\n","/** PURE_IMPORTS_START PURE_IMPORTS_END */\nexport function identity(x) {\n return x;\n}\n//# sourceMappingURL=identity.js.map\n","/** PURE_IMPORTS_START _mergeMap,_util_identity PURE_IMPORTS_END */\nimport { mergeMap } from './mergeMap';\nimport { identity } from '../util/identity';\nexport function mergeAll(concurrent) {\n if (concurrent === void 0) {\n concurrent = Number.POSITIVE_INFINITY;\n }\n return mergeMap(identity, concurrent);\n}\n//# sourceMappingURL=mergeAll.js.map\n","/** PURE_IMPORTS_START _Observable,_util_isScheduler,_operators_mergeAll,_fromArray PURE_IMPORTS_END */\nimport { Observable } from '../Observable';\nimport { isScheduler } from '../util/isScheduler';\nimport { mergeAll } from '../operators/mergeAll';\nimport { fromArray } from './fromArray';\nexport function merge() {\n var observables = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n observables[_i] = arguments[_i];\n }\n var concurrent = Number.POSITIVE_INFINITY;\n var scheduler = null;\n var last = observables[observables.length - 1];\n if (isScheduler(last)) {\n scheduler = observables.pop();\n if (observables.length > 1 && typeof observables[observables.length - 1] === 'number') {\n concurrent = observables.pop();\n }\n }\n else if (typeof last === 'number') {\n concurrent = observables.pop();\n }\n if (scheduler === null && observables.length === 1 && observables[0] instanceof Observable) {\n return observables[0];\n }\n return mergeAll(concurrent)(fromArray(observables, scheduler));\n}\n//# sourceMappingURL=merge.js.map\n","/** PURE_IMPORTS_START tslib,_.._util_root,_.._Observable,_.._Subscriber,_.._operators_map PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { root } from '../../util/root';\nimport { Observable } from '../../Observable';\nimport { Subscriber } from '../../Subscriber';\nimport { map } from '../../operators/map';\nfunction getCORSRequest() {\n if (root.XMLHttpRequest) {\n return new root.XMLHttpRequest();\n }\n else if (!!root.XDomainRequest) {\n return new root.XDomainRequest();\n }\n else {\n throw new Error('CORS is not supported by your browser');\n }\n}\nfunction getXMLHttpRequest() {\n if (root.XMLHttpRequest) {\n return new root.XMLHttpRequest();\n }\n else {\n var progId = void 0;\n try {\n var progIds = ['Msxml2.XMLHTTP', 'Microsoft.XMLHTTP', 'Msxml2.XMLHTTP.4.0'];\n for (var i = 0; i < 3; i++) {\n try {\n progId = progIds[i];\n if (new root.ActiveXObject(progId)) {\n break;\n }\n }\n catch (e) {\n }\n }\n return new root.ActiveXObject(progId);\n }\n catch (e) {\n throw new Error('XMLHttpRequest is not supported by your browser');\n }\n }\n}\nexport function ajaxGet(url, headers) {\n if (headers === void 0) {\n headers = null;\n }\n return new AjaxObservable({ method: 'GET', url: url, headers: headers });\n}\nexport function ajaxPost(url, body, headers) {\n return new AjaxObservable({ method: 'POST', url: url, body: body, headers: headers });\n}\nexport function ajaxDelete(url, headers) {\n return new AjaxObservable({ method: 'DELETE', url: url, headers: headers });\n}\nexport function ajaxPut(url, body, headers) {\n return new AjaxObservable({ method: 'PUT', url: url, body: body, headers: headers });\n}\nexport function ajaxPatch(url, body, headers) {\n return new AjaxObservable({ method: 'PATCH', url: url, body: body, headers: headers });\n}\nvar mapResponse = /*@__PURE__*/ map(function (x, index) { return x.response; });\nexport function ajaxGetJSON(url, headers) {\n return mapResponse(new AjaxObservable({\n method: 'GET',\n url: url,\n responseType: 'json',\n headers: headers\n }));\n}\nvar AjaxObservable = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(AjaxObservable, _super);\n function AjaxObservable(urlOrRequest) {\n var _this = _super.call(this) || this;\n var request = {\n async: true,\n createXHR: function () {\n return this.crossDomain ? getCORSRequest() : getXMLHttpRequest();\n },\n crossDomain: true,\n withCredentials: false,\n headers: {},\n method: 'GET',\n responseType: 'json',\n timeout: 0\n };\n if (typeof urlOrRequest === 'string') {\n request.url = urlOrRequest;\n }\n else {\n for (var prop in urlOrRequest) {\n if (urlOrRequest.hasOwnProperty(prop)) {\n request[prop] = urlOrRequest[prop];\n }\n }\n }\n _this.request = request;\n return _this;\n }\n AjaxObservable.prototype._subscribe = function (subscriber) {\n return new AjaxSubscriber(subscriber, this.request);\n };\n AjaxObservable.create = (function () {\n var create = function (urlOrRequest) {\n return new AjaxObservable(urlOrRequest);\n };\n create.get = ajaxGet;\n create.post = ajaxPost;\n create.delete = ajaxDelete;\n create.put = ajaxPut;\n create.patch = ajaxPatch;\n create.getJSON = ajaxGetJSON;\n return create;\n })();\n return AjaxObservable;\n}(Observable));\nexport { AjaxObservable };\nvar AjaxSubscriber = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(AjaxSubscriber, _super);\n function AjaxSubscriber(destination, request) {\n var _this = _super.call(this, destination) || this;\n _this.request = request;\n _this.done = false;\n var headers = request.headers = request.headers || {};\n if (!request.crossDomain && !_this.getHeader(headers, 'X-Requested-With')) {\n headers['X-Requested-With'] = 'XMLHttpRequest';\n }\n var contentTypeHeader = _this.getHeader(headers, 'Content-Type');\n if (!contentTypeHeader && !(root.FormData && request.body instanceof root.FormData) && typeof request.body !== 'undefined') {\n headers['Content-Type'] = 'application/x-www-form-urlencoded; charset=UTF-8';\n }\n request.body = _this.serializeBody(request.body, _this.getHeader(request.headers, 'Content-Type'));\n _this.send();\n return _this;\n }\n AjaxSubscriber.prototype.next = function (e) {\n this.done = true;\n var _a = this, xhr = _a.xhr, request = _a.request, destination = _a.destination;\n var result;\n try {\n result = new AjaxResponse(e, xhr, request);\n }\n catch (err) {\n return destination.error(err);\n }\n destination.next(result);\n };\n AjaxSubscriber.prototype.send = function () {\n var _a = this, request = _a.request, _b = _a.request, user = _b.user, method = _b.method, url = _b.url, async = _b.async, password = _b.password, headers = _b.headers, body = _b.body;\n try {\n var xhr = this.xhr = request.createXHR();\n this.setupEvents(xhr, request);\n if (user) {\n xhr.open(method, url, async, user, password);\n }\n else {\n xhr.open(method, url, async);\n }\n if (async) {\n xhr.timeout = request.timeout;\n xhr.responseType = request.responseType;\n }\n if ('withCredentials' in xhr) {\n xhr.withCredentials = !!request.withCredentials;\n }\n this.setHeaders(xhr, headers);\n if (body) {\n xhr.send(body);\n }\n else {\n xhr.send();\n }\n }\n catch (err) {\n this.error(err);\n }\n };\n AjaxSubscriber.prototype.serializeBody = function (body, contentType) {\n if (!body || typeof body === 'string') {\n return body;\n }\n else if (root.FormData && body instanceof root.FormData) {\n return body;\n }\n if (contentType) {\n var splitIndex = contentType.indexOf(';');\n if (splitIndex !== -1) {\n contentType = contentType.substring(0, splitIndex);\n }\n }\n switch (contentType) {\n case 'application/x-www-form-urlencoded':\n return Object.keys(body).map(function (key) { return encodeURIComponent(key) + \"=\" + encodeURIComponent(body[key]); }).join('&');\n case 'application/json':\n return JSON.stringify(body);\n default:\n return body;\n }\n };\n AjaxSubscriber.prototype.setHeaders = function (xhr, headers) {\n for (var key in headers) {\n if (headers.hasOwnProperty(key)) {\n xhr.setRequestHeader(key, headers[key]);\n }\n }\n };\n AjaxSubscriber.prototype.getHeader = function (headers, headerName) {\n for (var key in headers) {\n if (key.toLowerCase() === headerName.toLowerCase()) {\n return headers[key];\n }\n }\n return undefined;\n };\n AjaxSubscriber.prototype.setupEvents = function (xhr, request) {\n var progressSubscriber = request.progressSubscriber;\n function xhrTimeout(e) {\n var _a = xhrTimeout, subscriber = _a.subscriber, progressSubscriber = _a.progressSubscriber, request = _a.request;\n if (progressSubscriber) {\n progressSubscriber.error(e);\n }\n var error;\n try {\n error = new AjaxTimeoutError(this, request);\n }\n catch (err) {\n error = err;\n }\n subscriber.error(error);\n }\n xhr.ontimeout = xhrTimeout;\n xhrTimeout.request = request;\n xhrTimeout.subscriber = this;\n xhrTimeout.progressSubscriber = progressSubscriber;\n if (xhr.upload && 'withCredentials' in xhr) {\n if (progressSubscriber) {\n var xhrProgress_1;\n xhrProgress_1 = function (e) {\n var progressSubscriber = xhrProgress_1.progressSubscriber;\n progressSubscriber.next(e);\n };\n if (root.XDomainRequest) {\n xhr.onprogress = xhrProgress_1;\n }\n else {\n xhr.upload.onprogress = xhrProgress_1;\n }\n xhrProgress_1.progressSubscriber = progressSubscriber;\n }\n var xhrError_1;\n xhrError_1 = function (e) {\n var _a = xhrError_1, progressSubscriber = _a.progressSubscriber, subscriber = _a.subscriber, request = _a.request;\n if (progressSubscriber) {\n progressSubscriber.error(e);\n }\n var error;\n try {\n error = new AjaxError('ajax error', this, request);\n }\n catch (err) {\n error = err;\n }\n subscriber.error(error);\n };\n xhr.onerror = xhrError_1;\n xhrError_1.request = request;\n xhrError_1.subscriber = this;\n xhrError_1.progressSubscriber = progressSubscriber;\n }\n function xhrReadyStateChange(e) {\n return;\n }\n xhr.onreadystatechange = xhrReadyStateChange;\n xhrReadyStateChange.subscriber = this;\n xhrReadyStateChange.progressSubscriber = progressSubscriber;\n xhrReadyStateChange.request = request;\n function xhrLoad(e) {\n var _a = xhrLoad, subscriber = _a.subscriber, progressSubscriber = _a.progressSubscriber, request = _a.request;\n if (this.readyState === 4) {\n var status_1 = this.status === 1223 ? 204 : this.status;\n var response = (this.responseType === 'text' ? (this.response || this.responseText) : this.response);\n if (status_1 === 0) {\n status_1 = response ? 200 : 0;\n }\n if (status_1 < 400) {\n if (progressSubscriber) {\n progressSubscriber.complete();\n }\n subscriber.next(e);\n subscriber.complete();\n }\n else {\n if (progressSubscriber) {\n progressSubscriber.error(e);\n }\n var error = void 0;\n try {\n error = new AjaxError('ajax error ' + status_1, this, request);\n }\n catch (err) {\n error = err;\n }\n subscriber.error(error);\n }\n }\n }\n xhr.onload = xhrLoad;\n xhrLoad.subscriber = this;\n xhrLoad.progressSubscriber = progressSubscriber;\n xhrLoad.request = request;\n };\n AjaxSubscriber.prototype.unsubscribe = function () {\n var _a = this, done = _a.done, xhr = _a.xhr;\n if (!done && xhr && xhr.readyState !== 4 && typeof xhr.abort === 'function') {\n xhr.abort();\n }\n _super.prototype.unsubscribe.call(this);\n };\n return AjaxSubscriber;\n}(Subscriber));\nexport { AjaxSubscriber };\nvar AjaxResponse = /*@__PURE__*/ (function () {\n function AjaxResponse(originalEvent, xhr, request) {\n this.originalEvent = originalEvent;\n this.xhr = xhr;\n this.request = request;\n this.status = xhr.status;\n this.responseType = xhr.responseType || request.responseType;\n this.response = parseXhrResponse(this.responseType, xhr);\n }\n return AjaxResponse;\n}());\nexport { AjaxResponse };\nvar AjaxErrorImpl = /*@__PURE__*/ (function () {\n function AjaxErrorImpl(message, xhr, request) {\n Error.call(this);\n this.message = message;\n this.name = 'AjaxError';\n this.xhr = xhr;\n this.request = request;\n this.status = xhr.status;\n this.responseType = xhr.responseType || request.responseType;\n this.response = parseXhrResponse(this.responseType, xhr);\n return this;\n }\n AjaxErrorImpl.prototype = /*@__PURE__*/ Object.create(Error.prototype);\n return AjaxErrorImpl;\n})();\nexport var AjaxError = AjaxErrorImpl;\nfunction parseJson(xhr) {\n if ('response' in xhr) {\n return xhr.responseType ? xhr.response : JSON.parse(xhr.response || xhr.responseText || 'null');\n }\n else {\n return JSON.parse(xhr.responseText || 'null');\n }\n}\nfunction parseXhrResponse(responseType, xhr) {\n switch (responseType) {\n case 'json':\n return parseJson(xhr);\n case 'xml':\n return xhr.responseXML;\n case 'text':\n default:\n return ('response' in xhr) ? xhr.response : xhr.responseText;\n }\n}\nfunction AjaxTimeoutErrorImpl(xhr, request) {\n AjaxError.call(this, 'ajax timeout', xhr, request);\n this.name = 'AjaxTimeoutError';\n return this;\n}\nexport var AjaxTimeoutError = AjaxTimeoutErrorImpl;\n//# sourceMappingURL=AjaxObservable.js.map\n","/** PURE_IMPORTS_START _AjaxObservable PURE_IMPORTS_END */\nimport { AjaxObservable } from './AjaxObservable';\nexport var ajax = /*@__PURE__*/ (function () { return AjaxObservable.create; })();\n//# sourceMappingURL=ajax.js.map\n","/** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { Subscriber } from '../Subscriber';\nexport function filter(predicate, thisArg) {\n return function filterOperatorFunction(source) {\n return source.lift(new FilterOperator(predicate, thisArg));\n };\n}\nvar FilterOperator = /*@__PURE__*/ (function () {\n function FilterOperator(predicate, thisArg) {\n this.predicate = predicate;\n this.thisArg = thisArg;\n }\n FilterOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new FilterSubscriber(subscriber, this.predicate, this.thisArg));\n };\n return FilterOperator;\n}());\nvar FilterSubscriber = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(FilterSubscriber, _super);\n function FilterSubscriber(destination, predicate, thisArg) {\n var _this = _super.call(this, destination) || this;\n _this.predicate = predicate;\n _this.thisArg = thisArg;\n _this.count = 0;\n return _this;\n }\n FilterSubscriber.prototype._next = function (value) {\n var result;\n try {\n result = this.predicate.call(this.thisArg, value, this.count++);\n }\n catch (err) {\n this.destination.error(err);\n return;\n }\n if (result) {\n this.destination.next(value);\n }\n };\n return FilterSubscriber;\n}(Subscriber));\n//# sourceMappingURL=filter.js.map\n","/** PURE_IMPORTS_START tslib,_Subscriber,_util_noop,_util_isFunction PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { Subscriber } from '../Subscriber';\nimport { noop } from '../util/noop';\nimport { isFunction } from '../util/isFunction';\nexport function tap(nextOrObserver, error, complete) {\n return function tapOperatorFunction(source) {\n return source.lift(new DoOperator(nextOrObserver, error, complete));\n };\n}\nvar DoOperator = /*@__PURE__*/ (function () {\n function DoOperator(nextOrObserver, error, complete) {\n this.nextOrObserver = nextOrObserver;\n this.error = error;\n this.complete = complete;\n }\n DoOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new TapSubscriber(subscriber, this.nextOrObserver, this.error, this.complete));\n };\n return DoOperator;\n}());\nvar TapSubscriber = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(TapSubscriber, _super);\n function TapSubscriber(destination, observerOrNext, error, complete) {\n var _this = _super.call(this, destination) || this;\n _this._tapNext = noop;\n _this._tapError = noop;\n _this._tapComplete = noop;\n _this._tapError = error || noop;\n _this._tapComplete = complete || noop;\n if (isFunction(observerOrNext)) {\n _this._context = _this;\n _this._tapNext = observerOrNext;\n }\n else if (observerOrNext) {\n _this._context = observerOrNext;\n _this._tapNext = observerOrNext.next || noop;\n _this._tapError = observerOrNext.error || noop;\n _this._tapComplete = observerOrNext.complete || noop;\n }\n return _this;\n }\n TapSubscriber.prototype._next = function (value) {\n try {\n this._tapNext.call(this._context, value);\n }\n catch (err) {\n this.destination.error(err);\n return;\n }\n this.destination.next(value);\n };\n TapSubscriber.prototype._error = function (err) {\n try {\n this._tapError.call(this._context, err);\n }\n catch (err) {\n this.destination.error(err);\n return;\n }\n this.destination.error(err);\n };\n TapSubscriber.prototype._complete = function () {\n try {\n this._tapComplete.call(this._context);\n }\n catch (err) {\n this.destination.error(err);\n return;\n }\n return this.destination.complete();\n };\n return TapSubscriber;\n}(Subscriber));\n//# sourceMappingURL=tap.js.map\n","/** PURE_IMPORTS_START _map PURE_IMPORTS_END */\nimport { map } from './map';\nexport function pluck() {\n var properties = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n properties[_i] = arguments[_i];\n }\n var length = properties.length;\n if (length === 0) {\n throw new Error('list of properties cannot be empty.');\n }\n return function (source) { return map(plucker(properties, length))(source); };\n}\nfunction plucker(props, length) {\n var mapper = function (x) {\n var currentProp = x;\n for (var i = 0; i < length; i++) {\n var p = currentProp[props[i]];\n if (typeof p !== 'undefined') {\n currentProp = p;\n }\n else {\n return undefined;\n }\n }\n return currentProp;\n };\n return mapper;\n}\n//# sourceMappingURL=pluck.js.map\n","/** PURE_IMPORTS_START PURE_IMPORTS_END */\nvar ArgumentOutOfRangeErrorImpl = /*@__PURE__*/ (function () {\n function ArgumentOutOfRangeErrorImpl() {\n Error.call(this);\n this.message = 'argument out of range';\n this.name = 'ArgumentOutOfRangeError';\n return this;\n }\n ArgumentOutOfRangeErrorImpl.prototype = /*@__PURE__*/ Object.create(Error.prototype);\n return ArgumentOutOfRangeErrorImpl;\n})();\nexport var ArgumentOutOfRangeError = ArgumentOutOfRangeErrorImpl;\n//# sourceMappingURL=ArgumentOutOfRangeError.js.map\n","/** PURE_IMPORTS_START tslib,_Subscriber,_util_ArgumentOutOfRangeError,_observable_empty PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { Subscriber } from '../Subscriber';\nimport { ArgumentOutOfRangeError } from '../util/ArgumentOutOfRangeError';\nimport { empty } from '../observable/empty';\nexport function take(count) {\n return function (source) {\n if (count === 0) {\n return empty();\n }\n else {\n return source.lift(new TakeOperator(count));\n }\n };\n}\nvar TakeOperator = /*@__PURE__*/ (function () {\n function TakeOperator(total) {\n this.total = total;\n if (this.total < 0) {\n throw new ArgumentOutOfRangeError;\n }\n }\n TakeOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new TakeSubscriber(subscriber, this.total));\n };\n return TakeOperator;\n}());\nvar TakeSubscriber = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(TakeSubscriber, _super);\n function TakeSubscriber(destination, total) {\n var _this = _super.call(this, destination) || this;\n _this.total = total;\n _this.count = 0;\n return _this;\n }\n TakeSubscriber.prototype._next = function (value) {\n var total = this.total;\n var count = ++this.count;\n if (count <= total) {\n this.destination.next(value);\n if (count === total) {\n this.destination.complete();\n this.unsubscribe();\n }\n }\n };\n return TakeSubscriber;\n}(Subscriber));\n//# sourceMappingURL=take.js.map\n","/** PURE_IMPORTS_START tslib,_OuterSubscriber,_InnerSubscriber,_util_subscribeToResult,_map,_observable_from PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { OuterSubscriber } from '../OuterSubscriber';\nimport { InnerSubscriber } from '../InnerSubscriber';\nimport { subscribeToResult } from '../util/subscribeToResult';\nimport { map } from './map';\nimport { from } from '../observable/from';\nexport function switchMap(project, resultSelector) {\n if (typeof resultSelector === 'function') {\n return function (source) { return source.pipe(switchMap(function (a, i) { return from(project(a, i)).pipe(map(function (b, ii) { return resultSelector(a, b, i, ii); })); })); };\n }\n return function (source) { return source.lift(new SwitchMapOperator(project)); };\n}\nvar SwitchMapOperator = /*@__PURE__*/ (function () {\n function SwitchMapOperator(project) {\n this.project = project;\n }\n SwitchMapOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new SwitchMapSubscriber(subscriber, this.project));\n };\n return SwitchMapOperator;\n}());\nvar SwitchMapSubscriber = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(SwitchMapSubscriber, _super);\n function SwitchMapSubscriber(destination, project) {\n var _this = _super.call(this, destination) || this;\n _this.project = project;\n _this.index = 0;\n return _this;\n }\n SwitchMapSubscriber.prototype._next = function (value) {\n var result;\n var index = this.index++;\n try {\n result = this.project(value, index);\n }\n catch (error) {\n this.destination.error(error);\n return;\n }\n this._innerSub(result, value, index);\n };\n SwitchMapSubscriber.prototype._innerSub = function (result, value, index) {\n var innerSubscription = this.innerSubscription;\n if (innerSubscription) {\n innerSubscription.unsubscribe();\n }\n var innerSubscriber = new InnerSubscriber(this, undefined, undefined);\n var destination = this.destination;\n destination.add(innerSubscriber);\n this.innerSubscription = subscribeToResult(this, result, value, index, innerSubscriber);\n };\n SwitchMapSubscriber.prototype._complete = function () {\n var innerSubscription = this.innerSubscription;\n if (!innerSubscription || innerSubscription.closed) {\n _super.prototype._complete.call(this);\n }\n this.unsubscribe();\n };\n SwitchMapSubscriber.prototype._unsubscribe = function () {\n this.innerSubscription = null;\n };\n SwitchMapSubscriber.prototype.notifyComplete = function (innerSub) {\n var destination = this.destination;\n destination.remove(innerSub);\n this.innerSubscription = null;\n if (this.isStopped) {\n _super.prototype._complete.call(this);\n }\n };\n SwitchMapSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {\n this.destination.next(innerValue);\n };\n return SwitchMapSubscriber;\n}(OuterSubscriber));\n//# sourceMappingURL=switchMap.js.map\n","/** PURE_IMPORTS_START _observable_empty,_observable_of,_observable_throwError PURE_IMPORTS_END */\nimport { empty } from './observable/empty';\nimport { of } from './observable/of';\nimport { throwError } from './observable/throwError';\nexport var NotificationKind;\n/*@__PURE__*/ (function (NotificationKind) {\n NotificationKind[\"NEXT\"] = \"N\";\n NotificationKind[\"ERROR\"] = \"E\";\n NotificationKind[\"COMPLETE\"] = \"C\";\n})(NotificationKind || (NotificationKind = {}));\nvar Notification = /*@__PURE__*/ (function () {\n function Notification(kind, value, error) {\n this.kind = kind;\n this.value = value;\n this.error = error;\n this.hasValue = kind === 'N';\n }\n Notification.prototype.observe = function (observer) {\n switch (this.kind) {\n case 'N':\n return observer.next && observer.next(this.value);\n case 'E':\n return observer.error && observer.error(this.error);\n case 'C':\n return observer.complete && observer.complete();\n }\n };\n Notification.prototype.do = function (next, error, complete) {\n var kind = this.kind;\n switch (kind) {\n case 'N':\n return next && next(this.value);\n case 'E':\n return error && error(this.error);\n case 'C':\n return complete && complete();\n }\n };\n Notification.prototype.accept = function (nextOrObserver, error, complete) {\n if (nextOrObserver && typeof nextOrObserver.next === 'function') {\n return this.observe(nextOrObserver);\n }\n else {\n return this.do(nextOrObserver, error, complete);\n }\n };\n Notification.prototype.toObservable = function () {\n var kind = this.kind;\n switch (kind) {\n case 'N':\n return of(this.value);\n case 'E':\n return throwError(this.error);\n case 'C':\n return empty();\n }\n throw new Error('unexpected notification kind value');\n };\n Notification.createNext = function (value) {\n if (typeof value !== 'undefined') {\n return new Notification('N', value);\n }\n return Notification.undefinedValueNotification;\n };\n Notification.createError = function (err) {\n return new Notification('E', undefined, err);\n };\n Notification.createComplete = function () {\n return Notification.completeNotification;\n };\n Notification.completeNotification = new Notification('C');\n Notification.undefinedValueNotification = new Notification('N', undefined);\n return Notification;\n}());\nexport { Notification };\n//# sourceMappingURL=Notification.js.map\n","/** PURE_IMPORTS_START tslib,_Action PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { Action } from './Action';\nvar AsyncAction = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(AsyncAction, _super);\n function AsyncAction(scheduler, work) {\n var _this = _super.call(this, scheduler, work) || this;\n _this.scheduler = scheduler;\n _this.work = work;\n _this.pending = false;\n return _this;\n }\n AsyncAction.prototype.schedule = function (state, delay) {\n if (delay === void 0) {\n delay = 0;\n }\n if (this.closed) {\n return this;\n }\n this.state = state;\n var id = this.id;\n var scheduler = this.scheduler;\n if (id != null) {\n this.id = this.recycleAsyncId(scheduler, id, delay);\n }\n this.pending = true;\n this.delay = delay;\n this.id = this.id || this.requestAsyncId(scheduler, this.id, delay);\n return this;\n };\n AsyncAction.prototype.requestAsyncId = function (scheduler, id, delay) {\n if (delay === void 0) {\n delay = 0;\n }\n return setInterval(scheduler.flush.bind(scheduler, this), delay);\n };\n AsyncAction.prototype.recycleAsyncId = function (scheduler, id, delay) {\n if (delay === void 0) {\n delay = 0;\n }\n if (delay !== null && this.delay === delay && this.pending === false) {\n return id;\n }\n clearInterval(id);\n return undefined;\n };\n AsyncAction.prototype.execute = function (state, delay) {\n if (this.closed) {\n return new Error('executing a cancelled action');\n }\n this.pending = false;\n var error = this._execute(state, delay);\n if (error) {\n return error;\n }\n else if (this.pending === false && this.id != null) {\n this.id = this.recycleAsyncId(this.scheduler, this.id, null);\n }\n };\n AsyncAction.prototype._execute = function (state, delay) {\n var errored = false;\n var errorValue = undefined;\n try {\n this.work(state);\n }\n catch (e) {\n errored = true;\n errorValue = !!e && e || new Error(e);\n }\n if (errored) {\n this.unsubscribe();\n return errorValue;\n }\n };\n AsyncAction.prototype._unsubscribe = function () {\n var id = this.id;\n var scheduler = this.scheduler;\n var actions = scheduler.actions;\n var index = actions.indexOf(this);\n this.work = null;\n this.state = null;\n this.pending = false;\n this.scheduler = null;\n if (index !== -1) {\n actions.splice(index, 1);\n }\n if (id != null) {\n this.id = this.recycleAsyncId(scheduler, id, null);\n }\n this.delay = null;\n };\n return AsyncAction;\n}(Action));\nexport { AsyncAction };\n//# sourceMappingURL=AsyncAction.js.map\n","/** PURE_IMPORTS_START tslib,_Subscription PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { Subscription } from '../Subscription';\nvar Action = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(Action, _super);\n function Action(scheduler, work) {\n return _super.call(this) || this;\n }\n Action.prototype.schedule = function (state, delay) {\n if (delay === void 0) {\n delay = 0;\n }\n return this;\n };\n return Action;\n}(Subscription));\nexport { Action };\n//# sourceMappingURL=Action.js.map\n","var Scheduler = /*@__PURE__*/ (function () {\n function Scheduler(SchedulerAction, now) {\n if (now === void 0) {\n now = Scheduler.now;\n }\n this.SchedulerAction = SchedulerAction;\n this.now = now;\n }\n Scheduler.prototype.schedule = function (work, delay, state) {\n if (delay === void 0) {\n delay = 0;\n }\n return new this.SchedulerAction(this, work).schedule(state, delay);\n };\n Scheduler.now = function () { return Date.now(); };\n return Scheduler;\n}());\nexport { Scheduler };\n//# sourceMappingURL=Scheduler.js.map\n","/** PURE_IMPORTS_START tslib,_Scheduler PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { Scheduler } from '../Scheduler';\nvar AsyncScheduler = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(AsyncScheduler, _super);\n function AsyncScheduler(SchedulerAction, now) {\n if (now === void 0) {\n now = Scheduler.now;\n }\n var _this = _super.call(this, SchedulerAction, function () {\n if (AsyncScheduler.delegate && AsyncScheduler.delegate !== _this) {\n return AsyncScheduler.delegate.now();\n }\n else {\n return now();\n }\n }) || this;\n _this.actions = [];\n _this.active = false;\n _this.scheduled = undefined;\n return _this;\n }\n AsyncScheduler.prototype.schedule = function (work, delay, state) {\n if (delay === void 0) {\n delay = 0;\n }\n if (AsyncScheduler.delegate && AsyncScheduler.delegate !== this) {\n return AsyncScheduler.delegate.schedule(work, delay, state);\n }\n else {\n return _super.prototype.schedule.call(this, work, delay, state);\n }\n };\n AsyncScheduler.prototype.flush = function (action) {\n var actions = this.actions;\n if (this.active) {\n actions.push(action);\n return;\n }\n var error;\n this.active = true;\n do {\n if (error = action.execute(action.state, action.delay)) {\n break;\n }\n } while (action = actions.shift());\n this.active = false;\n if (error) {\n while (action = actions.shift()) {\n action.unsubscribe();\n }\n throw error;\n }\n };\n return AsyncScheduler;\n}(Scheduler));\nexport { AsyncScheduler };\n//# sourceMappingURL=AsyncScheduler.js.map\n","/** PURE_IMPORTS_START _AsyncAction,_AsyncScheduler PURE_IMPORTS_END */\nimport { AsyncAction } from './AsyncAction';\nimport { AsyncScheduler } from './AsyncScheduler';\nexport var async = /*@__PURE__*/ new AsyncScheduler(AsyncAction);\n//# sourceMappingURL=async.js.map\n","/** PURE_IMPORTS_START _Observable PURE_IMPORTS_END */\nimport { Observable } from '../Observable';\nexport function throwError(error, scheduler) {\n if (!scheduler) {\n return new Observable(function (subscriber) { return subscriber.error(error); });\n }\n else {\n return new Observable(function (subscriber) { return scheduler.schedule(dispatch, 0, { error: error, subscriber: subscriber }); });\n }\n}\nfunction dispatch(_a) {\n var error = _a.error, subscriber = _a.subscriber;\n subscriber.error(error);\n}\n//# sourceMappingURL=throwError.js.map\n","/** PURE_IMPORTS_START tslib,_scheduler_async,_util_isDate,_Subscriber,_Notification PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { async } from '../scheduler/async';\nimport { isDate } from '../util/isDate';\nimport { Subscriber } from '../Subscriber';\nimport { Notification } from '../Notification';\nexport function delay(delay, scheduler) {\n if (scheduler === void 0) {\n scheduler = async;\n }\n var absoluteDelay = isDate(delay);\n var delayFor = absoluteDelay ? (+delay - scheduler.now()) : Math.abs(delay);\n return function (source) { return source.lift(new DelayOperator(delayFor, scheduler)); };\n}\nvar DelayOperator = /*@__PURE__*/ (function () {\n function DelayOperator(delay, scheduler) {\n this.delay = delay;\n this.scheduler = scheduler;\n }\n DelayOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new DelaySubscriber(subscriber, this.delay, this.scheduler));\n };\n return DelayOperator;\n}());\nvar DelaySubscriber = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(DelaySubscriber, _super);\n function DelaySubscriber(destination, delay, scheduler) {\n var _this = _super.call(this, destination) || this;\n _this.delay = delay;\n _this.scheduler = scheduler;\n _this.queue = [];\n _this.active = false;\n _this.errored = false;\n return _this;\n }\n DelaySubscriber.dispatch = function (state) {\n var source = state.source;\n var queue = source.queue;\n var scheduler = state.scheduler;\n var destination = state.destination;\n while (queue.length > 0 && (queue[0].time - scheduler.now()) <= 0) {\n queue.shift().notification.observe(destination);\n }\n if (queue.length > 0) {\n var delay_1 = Math.max(0, queue[0].time - scheduler.now());\n this.schedule(state, delay_1);\n }\n else {\n this.unsubscribe();\n source.active = false;\n }\n };\n DelaySubscriber.prototype._schedule = function (scheduler) {\n this.active = true;\n var destination = this.destination;\n destination.add(scheduler.schedule(DelaySubscriber.dispatch, this.delay, {\n source: this, destination: this.destination, scheduler: scheduler\n }));\n };\n DelaySubscriber.prototype.scheduleNotification = function (notification) {\n if (this.errored === true) {\n return;\n }\n var scheduler = this.scheduler;\n var message = new DelayMessage(scheduler.now() + this.delay, notification);\n this.queue.push(message);\n if (this.active === false) {\n this._schedule(scheduler);\n }\n };\n DelaySubscriber.prototype._next = function (value) {\n this.scheduleNotification(Notification.createNext(value));\n };\n DelaySubscriber.prototype._error = function (err) {\n this.errored = true;\n this.queue = [];\n this.destination.error(err);\n this.unsubscribe();\n };\n DelaySubscriber.prototype._complete = function () {\n this.scheduleNotification(Notification.createComplete());\n this.unsubscribe();\n };\n return DelaySubscriber;\n}(Subscriber));\nvar DelayMessage = /*@__PURE__*/ (function () {\n function DelayMessage(time, notification) {\n this.time = time;\n this.notification = notification;\n }\n return DelayMessage;\n}());\n//# sourceMappingURL=delay.js.map\n","/** PURE_IMPORTS_START PURE_IMPORTS_END */\nexport function isDate(value) {\n return value instanceof Date && !isNaN(+value);\n}\n//# sourceMappingURL=isDate.js.map\n","/** PURE_IMPORTS_START _switchMap PURE_IMPORTS_END */\nimport { switchMap } from './switchMap';\nexport function switchMapTo(innerObservable, resultSelector) {\n return resultSelector ? switchMap(function () { return innerObservable; }, resultSelector) : switchMap(function () { return innerObservable; });\n}\n//# sourceMappingURL=switchMapTo.js.map\n","/** PURE_IMPORTS_START _Observable,_util_noop PURE_IMPORTS_END */\nimport { Observable } from '../Observable';\nimport { noop } from '../util/noop';\nexport var NEVER = /*@__PURE__*/ new Observable(noop);\nexport function never() {\n return NEVER;\n}\n//# sourceMappingURL=never.js.map\n","/** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { Subscriber } from '../Subscriber';\nexport function scan(accumulator, seed) {\n var hasSeed = false;\n if (arguments.length >= 2) {\n hasSeed = true;\n }\n return function scanOperatorFunction(source) {\n return source.lift(new ScanOperator(accumulator, seed, hasSeed));\n };\n}\nvar ScanOperator = /*@__PURE__*/ (function () {\n function ScanOperator(accumulator, seed, hasSeed) {\n if (hasSeed === void 0) {\n hasSeed = false;\n }\n this.accumulator = accumulator;\n this.seed = seed;\n this.hasSeed = hasSeed;\n }\n ScanOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new ScanSubscriber(subscriber, this.accumulator, this.seed, this.hasSeed));\n };\n return ScanOperator;\n}());\nvar ScanSubscriber = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(ScanSubscriber, _super);\n function ScanSubscriber(destination, accumulator, _seed, hasSeed) {\n var _this = _super.call(this, destination) || this;\n _this.accumulator = accumulator;\n _this._seed = _seed;\n _this.hasSeed = hasSeed;\n _this.index = 0;\n return _this;\n }\n Object.defineProperty(ScanSubscriber.prototype, \"seed\", {\n get: function () {\n return this._seed;\n },\n set: function (value) {\n this.hasSeed = true;\n this._seed = value;\n },\n enumerable: true,\n configurable: true\n });\n ScanSubscriber.prototype._next = function (value) {\n if (!this.hasSeed) {\n this.seed = value;\n this.destination.next(value);\n }\n else {\n return this._tryNext(value);\n }\n };\n ScanSubscriber.prototype._tryNext = function (value) {\n var index = this.index++;\n var result;\n try {\n result = this.accumulator(this.seed, value, index);\n }\n catch (err) {\n this.destination.error(err);\n }\n this.seed = result;\n this.destination.next(result);\n };\n return ScanSubscriber;\n}(Subscriber));\n//# sourceMappingURL=scan.js.map\n","/** PURE_IMPORTS_START tslib,_AsyncAction PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { AsyncAction } from './AsyncAction';\nvar QueueAction = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(QueueAction, _super);\n function QueueAction(scheduler, work) {\n var _this = _super.call(this, scheduler, work) || this;\n _this.scheduler = scheduler;\n _this.work = work;\n return _this;\n }\n QueueAction.prototype.schedule = function (state, delay) {\n if (delay === void 0) {\n delay = 0;\n }\n if (delay > 0) {\n return _super.prototype.schedule.call(this, state, delay);\n }\n this.delay = delay;\n this.state = state;\n this.scheduler.flush(this);\n return this;\n };\n QueueAction.prototype.execute = function (state, delay) {\n return (delay > 0 || this.closed) ?\n _super.prototype.execute.call(this, state, delay) :\n this._execute(state, delay);\n };\n QueueAction.prototype.requestAsyncId = function (scheduler, id, delay) {\n if (delay === void 0) {\n delay = 0;\n }\n if ((delay !== null && delay > 0) || (delay === null && this.delay > 0)) {\n return _super.prototype.requestAsyncId.call(this, scheduler, id, delay);\n }\n return scheduler.flush(this);\n };\n return QueueAction;\n}(AsyncAction));\nexport { QueueAction };\n//# sourceMappingURL=QueueAction.js.map\n","/** PURE_IMPORTS_START _QueueAction,_QueueScheduler PURE_IMPORTS_END */\nimport { QueueAction } from './QueueAction';\nimport { QueueScheduler } from './QueueScheduler';\nexport var queue = /*@__PURE__*/ new QueueScheduler(QueueAction);\n//# sourceMappingURL=queue.js.map\n","/** PURE_IMPORTS_START tslib,_AsyncScheduler PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { AsyncScheduler } from './AsyncScheduler';\nvar QueueScheduler = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(QueueScheduler, _super);\n function QueueScheduler() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n return QueueScheduler;\n}(AsyncScheduler));\nexport { QueueScheduler };\n//# sourceMappingURL=QueueScheduler.js.map\n","/** PURE_IMPORTS_START tslib,_Subscriber,_Notification PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { Subscriber } from '../Subscriber';\nimport { Notification } from '../Notification';\nexport function observeOn(scheduler, delay) {\n if (delay === void 0) {\n delay = 0;\n }\n return function observeOnOperatorFunction(source) {\n return source.lift(new ObserveOnOperator(scheduler, delay));\n };\n}\nvar ObserveOnOperator = /*@__PURE__*/ (function () {\n function ObserveOnOperator(scheduler, delay) {\n if (delay === void 0) {\n delay = 0;\n }\n this.scheduler = scheduler;\n this.delay = delay;\n }\n ObserveOnOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new ObserveOnSubscriber(subscriber, this.scheduler, this.delay));\n };\n return ObserveOnOperator;\n}());\nexport { ObserveOnOperator };\nvar ObserveOnSubscriber = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(ObserveOnSubscriber, _super);\n function ObserveOnSubscriber(destination, scheduler, delay) {\n if (delay === void 0) {\n delay = 0;\n }\n var _this = _super.call(this, destination) || this;\n _this.scheduler = scheduler;\n _this.delay = delay;\n return _this;\n }\n ObserveOnSubscriber.dispatch = function (arg) {\n var notification = arg.notification, destination = arg.destination;\n notification.observe(destination);\n this.unsubscribe();\n };\n ObserveOnSubscriber.prototype.scheduleMessage = function (notification) {\n var destination = this.destination;\n destination.add(this.scheduler.schedule(ObserveOnSubscriber.dispatch, this.delay, new ObserveOnMessage(notification, this.destination)));\n };\n ObserveOnSubscriber.prototype._next = function (value) {\n this.scheduleMessage(Notification.createNext(value));\n };\n ObserveOnSubscriber.prototype._error = function (err) {\n this.scheduleMessage(Notification.createError(err));\n this.unsubscribe();\n };\n ObserveOnSubscriber.prototype._complete = function () {\n this.scheduleMessage(Notification.createComplete());\n this.unsubscribe();\n };\n return ObserveOnSubscriber;\n}(Subscriber));\nexport { ObserveOnSubscriber };\nvar ObserveOnMessage = /*@__PURE__*/ (function () {\n function ObserveOnMessage(notification, destination) {\n this.notification = notification;\n this.destination = destination;\n }\n return ObserveOnMessage;\n}());\nexport { ObserveOnMessage };\n//# sourceMappingURL=observeOn.js.map\n","/** PURE_IMPORTS_START tslib,_Subject,_scheduler_queue,_Subscription,_operators_observeOn,_util_ObjectUnsubscribedError,_SubjectSubscription PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { Subject } from './Subject';\nimport { queue } from './scheduler/queue';\nimport { Subscription } from './Subscription';\nimport { ObserveOnSubscriber } from './operators/observeOn';\nimport { ObjectUnsubscribedError } from './util/ObjectUnsubscribedError';\nimport { SubjectSubscription } from './SubjectSubscription';\nvar ReplaySubject = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(ReplaySubject, _super);\n function ReplaySubject(bufferSize, windowTime, scheduler) {\n if (bufferSize === void 0) {\n bufferSize = Number.POSITIVE_INFINITY;\n }\n if (windowTime === void 0) {\n windowTime = Number.POSITIVE_INFINITY;\n }\n var _this = _super.call(this) || this;\n _this.scheduler = scheduler;\n _this._events = [];\n _this._infiniteTimeWindow = false;\n _this._bufferSize = bufferSize < 1 ? 1 : bufferSize;\n _this._windowTime = windowTime < 1 ? 1 : windowTime;\n if (windowTime === Number.POSITIVE_INFINITY) {\n _this._infiniteTimeWindow = true;\n _this.next = _this.nextInfiniteTimeWindow;\n }\n else {\n _this.next = _this.nextTimeWindow;\n }\n return _this;\n }\n ReplaySubject.prototype.nextInfiniteTimeWindow = function (value) {\n var _events = this._events;\n _events.push(value);\n if (_events.length > this._bufferSize) {\n _events.shift();\n }\n _super.prototype.next.call(this, value);\n };\n ReplaySubject.prototype.nextTimeWindow = function (value) {\n this._events.push(new ReplayEvent(this._getNow(), value));\n this._trimBufferThenGetEvents();\n _super.prototype.next.call(this, value);\n };\n ReplaySubject.prototype._subscribe = function (subscriber) {\n var _infiniteTimeWindow = this._infiniteTimeWindow;\n var _events = _infiniteTimeWindow ? this._events : this._trimBufferThenGetEvents();\n var scheduler = this.scheduler;\n var len = _events.length;\n var subscription;\n if (this.closed) {\n throw new ObjectUnsubscribedError();\n }\n else if (this.isStopped || this.hasError) {\n subscription = Subscription.EMPTY;\n }\n else {\n this.observers.push(subscriber);\n subscription = new SubjectSubscription(this, subscriber);\n }\n if (scheduler) {\n subscriber.add(subscriber = new ObserveOnSubscriber(subscriber, scheduler));\n }\n if (_infiniteTimeWindow) {\n for (var i = 0; i < len && !subscriber.closed; i++) {\n subscriber.next(_events[i]);\n }\n }\n else {\n for (var i = 0; i < len && !subscriber.closed; i++) {\n subscriber.next(_events[i].value);\n }\n }\n if (this.hasError) {\n subscriber.error(this.thrownError);\n }\n else if (this.isStopped) {\n subscriber.complete();\n }\n return subscription;\n };\n ReplaySubject.prototype._getNow = function () {\n return (this.scheduler || queue).now();\n };\n ReplaySubject.prototype._trimBufferThenGetEvents = function () {\n var now = this._getNow();\n var _bufferSize = this._bufferSize;\n var _windowTime = this._windowTime;\n var _events = this._events;\n var eventsCount = _events.length;\n var spliceCount = 0;\n while (spliceCount < eventsCount) {\n if ((now - _events[spliceCount].time) < _windowTime) {\n break;\n }\n spliceCount++;\n }\n if (eventsCount > _bufferSize) {\n spliceCount = Math.max(spliceCount, eventsCount - _bufferSize);\n }\n if (spliceCount > 0) {\n _events.splice(0, spliceCount);\n }\n return _events;\n };\n return ReplaySubject;\n}(Subject));\nexport { ReplaySubject };\nvar ReplayEvent = /*@__PURE__*/ (function () {\n function ReplayEvent(time, value) {\n this.time = time;\n this.value = value;\n }\n return ReplayEvent;\n}());\n//# sourceMappingURL=ReplaySubject.js.map\n","/** PURE_IMPORTS_START _ReplaySubject PURE_IMPORTS_END */\nimport { ReplaySubject } from '../ReplaySubject';\nexport function shareReplay(configOrBufferSize, windowTime, scheduler) {\n var config;\n if (configOrBufferSize && typeof configOrBufferSize === 'object') {\n config = configOrBufferSize;\n }\n else {\n config = {\n bufferSize: configOrBufferSize,\n windowTime: windowTime,\n refCount: false,\n scheduler: scheduler\n };\n }\n return function (source) { return source.lift(shareReplayOperator(config)); };\n}\nfunction shareReplayOperator(_a) {\n var _b = _a.bufferSize, bufferSize = _b === void 0 ? Number.POSITIVE_INFINITY : _b, _c = _a.windowTime, windowTime = _c === void 0 ? Number.POSITIVE_INFINITY : _c, useRefCount = _a.refCount, scheduler = _a.scheduler;\n var subject;\n var refCount = 0;\n var subscription;\n var hasError = false;\n var isComplete = false;\n return function shareReplayOperation(source) {\n refCount++;\n if (!subject || hasError) {\n hasError = false;\n subject = new ReplaySubject(bufferSize, windowTime, scheduler);\n subscription = source.subscribe({\n next: function (value) { subject.next(value); },\n error: function (err) {\n hasError = true;\n subject.error(err);\n },\n complete: function () {\n isComplete = true;\n subject.complete();\n },\n });\n }\n var innerSub = subject.subscribe(this);\n this.add(function () {\n refCount--;\n innerSub.unsubscribe();\n if (subscription && !isComplete && useRefCount && refCount === 0) {\n subscription.unsubscribe();\n subscription = undefined;\n subject = undefined;\n }\n });\n };\n}\n//# sourceMappingURL=shareReplay.js.map\n","/** PURE_IMPORTS_START _Observable,_util_isArray,_util_isFunction,_operators_map PURE_IMPORTS_END */\nimport { Observable } from '../Observable';\nimport { isArray } from '../util/isArray';\nimport { isFunction } from '../util/isFunction';\nimport { map } from '../operators/map';\nvar toString = /*@__PURE__*/ (function () { return Object.prototype.toString; })();\nexport function fromEvent(target, eventName, options, resultSelector) {\n if (isFunction(options)) {\n resultSelector = options;\n options = undefined;\n }\n if (resultSelector) {\n return fromEvent(target, eventName, options).pipe(map(function (args) { return isArray(args) ? resultSelector.apply(void 0, args) : resultSelector(args); }));\n }\n return new Observable(function (subscriber) {\n function handler(e) {\n if (arguments.length > 1) {\n subscriber.next(Array.prototype.slice.call(arguments));\n }\n else {\n subscriber.next(e);\n }\n }\n setupSubscription(target, eventName, handler, subscriber, options);\n });\n}\nfunction setupSubscription(sourceObj, eventName, handler, subscriber, options) {\n var unsubscribe;\n if (isEventTarget(sourceObj)) {\n var source_1 = sourceObj;\n sourceObj.addEventListener(eventName, handler, options);\n unsubscribe = function () { return source_1.removeEventListener(eventName, handler, options); };\n }\n else if (isJQueryStyleEventEmitter(sourceObj)) {\n var source_2 = sourceObj;\n sourceObj.on(eventName, handler);\n unsubscribe = function () { return source_2.off(eventName, handler); };\n }\n else if (isNodeStyleEventEmitter(sourceObj)) {\n var source_3 = sourceObj;\n sourceObj.addListener(eventName, handler);\n unsubscribe = function () { return source_3.removeListener(eventName, handler); };\n }\n else if (sourceObj && sourceObj.length) {\n for (var i = 0, len = sourceObj.length; i < len; i++) {\n setupSubscription(sourceObj[i], eventName, handler, subscriber, options);\n }\n }\n else {\n throw new TypeError('Invalid event target');\n }\n subscriber.add(unsubscribe);\n}\nfunction isNodeStyleEventEmitter(sourceObj) {\n return sourceObj && typeof sourceObj.addListener === 'function' && typeof sourceObj.removeListener === 'function';\n}\nfunction isJQueryStyleEventEmitter(sourceObj) {\n return sourceObj && typeof sourceObj.on === 'function' && typeof sourceObj.off === 'function';\n}\nfunction isEventTarget(sourceObj) {\n return sourceObj && typeof sourceObj.addEventListener === 'function' && typeof sourceObj.removeEventListener === 'function';\n}\n//# sourceMappingURL=fromEvent.js.map\n","/** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { Subscriber } from '../Subscriber';\nexport function mapTo(value) {\n return function (source) { return source.lift(new MapToOperator(value)); };\n}\nvar MapToOperator = /*@__PURE__*/ (function () {\n function MapToOperator(value) {\n this.value = value;\n }\n MapToOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new MapToSubscriber(subscriber, this.value));\n };\n return MapToOperator;\n}());\nvar MapToSubscriber = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(MapToSubscriber, _super);\n function MapToSubscriber(destination, value) {\n var _this = _super.call(this, destination) || this;\n _this.value = value;\n return _this;\n }\n MapToSubscriber.prototype._next = function (x) {\n this.destination.next(this.value);\n };\n return MapToSubscriber;\n}(Subscriber));\n//# sourceMappingURL=mapTo.js.map\n","/** PURE_IMPORTS_START _of,_operators_concatAll PURE_IMPORTS_END */\nimport { of } from './of';\nimport { concatAll } from '../operators/concatAll';\nexport function concat() {\n var observables = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n observables[_i] = arguments[_i];\n }\n return concatAll()(of.apply(void 0, observables));\n}\n//# sourceMappingURL=concat.js.map\n","/** PURE_IMPORTS_START _mergeAll PURE_IMPORTS_END */\nimport { mergeAll } from './mergeAll';\nexport function concatAll() {\n return mergeAll(1);\n}\n//# sourceMappingURL=concatAll.js.map\n","/** PURE_IMPORTS_START _observable_concat,_util_isScheduler PURE_IMPORTS_END */\nimport { concat } from '../observable/concat';\nimport { isScheduler } from '../util/isScheduler';\nexport function startWith() {\n var array = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n array[_i] = arguments[_i];\n }\n var scheduler = array[array.length - 1];\n if (isScheduler(scheduler)) {\n array.pop();\n return function (source) { return concat(array, source, scheduler); };\n }\n else {\n return function (source) { return concat(array, source); };\n }\n}\n//# sourceMappingURL=startWith.js.map\n","/** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { Subscriber } from '../Subscriber';\nexport function distinctUntilChanged(compare, keySelector) {\n return function (source) { return source.lift(new DistinctUntilChangedOperator(compare, keySelector)); };\n}\nvar DistinctUntilChangedOperator = /*@__PURE__*/ (function () {\n function DistinctUntilChangedOperator(compare, keySelector) {\n this.compare = compare;\n this.keySelector = keySelector;\n }\n DistinctUntilChangedOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new DistinctUntilChangedSubscriber(subscriber, this.compare, this.keySelector));\n };\n return DistinctUntilChangedOperator;\n}());\nvar DistinctUntilChangedSubscriber = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(DistinctUntilChangedSubscriber, _super);\n function DistinctUntilChangedSubscriber(destination, compare, keySelector) {\n var _this = _super.call(this, destination) || this;\n _this.keySelector = keySelector;\n _this.hasKey = false;\n if (typeof compare === 'function') {\n _this.compare = compare;\n }\n return _this;\n }\n DistinctUntilChangedSubscriber.prototype.compare = function (x, y) {\n return x === y;\n };\n DistinctUntilChangedSubscriber.prototype._next = function (value) {\n var key;\n try {\n var keySelector = this.keySelector;\n key = keySelector ? keySelector(value) : value;\n }\n catch (err) {\n return this.destination.error(err);\n }\n var result = false;\n if (this.hasKey) {\n try {\n var compare = this.compare;\n result = compare(this.key, key);\n }\n catch (err) {\n return this.destination.error(err);\n }\n }\n else {\n this.hasKey = true;\n }\n if (!result) {\n this.key = key;\n this.destination.next(value);\n }\n };\n return DistinctUntilChangedSubscriber;\n}(Subscriber));\n//# sourceMappingURL=distinctUntilChanged.js.map\n","/** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { Subscriber } from '../Subscriber';\nexport function skip(count) {\n return function (source) { return source.lift(new SkipOperator(count)); };\n}\nvar SkipOperator = /*@__PURE__*/ (function () {\n function SkipOperator(total) {\n this.total = total;\n }\n SkipOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new SkipSubscriber(subscriber, this.total));\n };\n return SkipOperator;\n}());\nvar SkipSubscriber = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(SkipSubscriber, _super);\n function SkipSubscriber(destination, total) {\n var _this = _super.call(this, destination) || this;\n _this.total = total;\n _this.count = 0;\n return _this;\n }\n SkipSubscriber.prototype._next = function (x) {\n if (++this.count > this.total) {\n this.destination.next(x);\n }\n };\n return SkipSubscriber;\n}(Subscriber));\n//# sourceMappingURL=skip.js.map\n","/*\n * Copyright (c) 2016-2019 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable, fromEvent } from \"rxjs\"\nimport { ajax } from \"rxjs/ajax\"\nimport {\n distinctUntilChanged,\n map,\n mapTo,\n pluck,\n shareReplay,\n skip,\n startWith,\n switchMap\n} from \"rxjs/operators\"\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Switch options\n */\ninterface SwitchOptions {\n location$: Observable /* Location observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Data\n * ------------------------------------------------------------------------- */\n\n/**\n * Observable for document load events\n */\nconst load$ = fromEvent(document, \"DOMContentLoaded\")\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch document\n *\n * @return Document observable\n */\nexport function watchDocument(): Observable {\n return load$\n .pipe(\n mapTo(document),\n shareReplay(1)\n )\n}\n\n/**\n * Watch document switch\n *\n * This function returns an observables that fetches a document if the provided\n * location observable emits a new value (i.e. URL). If the emitted URL points\n * to the same page, the request is effectively ignored (e.g. when only the\n * fragment identifier changes)\n *\n * @param options - Options\n *\n * @return Document switch observable\n */\nexport function watchDocumentSwitch(\n { location$ }: SwitchOptions\n): Observable {\n return location$\n .pipe(\n startWith(location.href),\n map(url => url.replace(/#[^#]+$/, \"\")),\n distinctUntilChanged(),\n skip(1),\n\n /* Fetch document */\n switchMap(url => ajax({\n url,\n responseType: \"document\",\n withCredentials: true\n })\n .pipe(\n pluck(\"response\")\n )\n ),\n shareReplay(1)\n )\n}\n","/*\n * Copyright (c) 2016-2019 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Retrieve an element matching the query selector\n *\n * @template T - Element type\n *\n * @param selector - Query selector\n * @param node - Node of reference\n *\n * @return Element\n */\nexport function getElement(\n selector: string, node: ParentNode = document\n): T | undefined {\n return node.querySelector(selector) || undefined\n}\n\n/**\n * Retrieve all elements matching the query selector\n *\n * @template T - Element type\n *\n * @param selector - Query selector\n * @param node - Node of reference\n *\n * @return Elements\n */\nexport function getElements(\n selector: string, node: ParentNode = document\n): T[] {\n return Array.from(node.querySelectorAll(selector))\n}\n","/*\n * Copyright (c) 2016-2019 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable, fromEvent, merge } from \"rxjs\"\nimport { map, shareReplay, startWith } from \"rxjs/operators\"\n\nimport { Agent } from \"../../_\"\nimport { ViewportSize } from \"../../viewport\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Element offset\n */\nexport interface ElementOffset {\n x: number /* Horizontal offset */\n y: number /* Vertical offset */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Options\n */\ninterface Options {\n size$: Observable /* Viewport size observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Retrieve element offset\n *\n * @param el - HTML element\n *\n * @return Element offset\n */\nexport function getElementOffset(el: HTMLElement): ElementOffset {\n return {\n x: el.scrollLeft,\n y: el.scrollTop\n }\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Watch element offset\n *\n * @param el - Element\n * @param agent - Agent\n *\n * @return Element offset observable\n */\nexport function watchElementOffset(\n el: HTMLElement, { viewport }: Agent\n): Observable {\n const scroll$ = fromEvent(el, \"scroll\")\n return merge(scroll$, viewport.size$)\n .pipe(\n map(() => getElementOffset(el)),\n startWith(getElementOffset(el)),\n shareReplay(1)\n )\n}\n","/** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { Subscriber } from '../Subscriber';\nexport function refCount() {\n return function refCountOperatorFunction(source) {\n return source.lift(new RefCountOperator(source));\n };\n}\nvar RefCountOperator = /*@__PURE__*/ (function () {\n function RefCountOperator(connectable) {\n this.connectable = connectable;\n }\n RefCountOperator.prototype.call = function (subscriber, source) {\n var connectable = this.connectable;\n connectable._refCount++;\n var refCounter = new RefCountSubscriber(subscriber, connectable);\n var subscription = source.subscribe(refCounter);\n if (!refCounter.closed) {\n refCounter.connection = connectable.connect();\n }\n return subscription;\n };\n return RefCountOperator;\n}());\nvar RefCountSubscriber = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(RefCountSubscriber, _super);\n function RefCountSubscriber(destination, connectable) {\n var _this = _super.call(this, destination) || this;\n _this.connectable = connectable;\n return _this;\n }\n RefCountSubscriber.prototype._unsubscribe = function () {\n var connectable = this.connectable;\n if (!connectable) {\n this.connection = null;\n return;\n }\n this.connectable = null;\n var refCount = connectable._refCount;\n if (refCount <= 0) {\n this.connection = null;\n return;\n }\n connectable._refCount = refCount - 1;\n if (refCount > 1) {\n this.connection = null;\n return;\n }\n var connection = this.connection;\n var sharedConnection = connectable._connection;\n this.connection = null;\n if (sharedConnection && (!connection || sharedConnection === connection)) {\n sharedConnection.unsubscribe();\n }\n };\n return RefCountSubscriber;\n}(Subscriber));\n//# sourceMappingURL=refCount.js.map\n","/** PURE_IMPORTS_START tslib,_Subject,_Observable,_Subscriber,_Subscription,_operators_refCount PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { SubjectSubscriber } from '../Subject';\nimport { Observable } from '../Observable';\nimport { Subscriber } from '../Subscriber';\nimport { Subscription } from '../Subscription';\nimport { refCount as higherOrderRefCount } from '../operators/refCount';\nvar ConnectableObservable = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(ConnectableObservable, _super);\n function ConnectableObservable(source, subjectFactory) {\n var _this = _super.call(this) || this;\n _this.source = source;\n _this.subjectFactory = subjectFactory;\n _this._refCount = 0;\n _this._isComplete = false;\n return _this;\n }\n ConnectableObservable.prototype._subscribe = function (subscriber) {\n return this.getSubject().subscribe(subscriber);\n };\n ConnectableObservable.prototype.getSubject = function () {\n var subject = this._subject;\n if (!subject || subject.isStopped) {\n this._subject = this.subjectFactory();\n }\n return this._subject;\n };\n ConnectableObservable.prototype.connect = function () {\n var connection = this._connection;\n if (!connection) {\n this._isComplete = false;\n connection = this._connection = new Subscription();\n connection.add(this.source\n .subscribe(new ConnectableSubscriber(this.getSubject(), this)));\n if (connection.closed) {\n this._connection = null;\n connection = Subscription.EMPTY;\n }\n }\n return connection;\n };\n ConnectableObservable.prototype.refCount = function () {\n return higherOrderRefCount()(this);\n };\n return ConnectableObservable;\n}(Observable));\nexport { ConnectableObservable };\nexport var connectableObservableDescriptor = /*@__PURE__*/ (function () {\n var connectableProto = ConnectableObservable.prototype;\n return {\n operator: { value: null },\n _refCount: { value: 0, writable: true },\n _subject: { value: null, writable: true },\n _connection: { value: null, writable: true },\n _subscribe: { value: connectableProto._subscribe },\n _isComplete: { value: connectableProto._isComplete, writable: true },\n getSubject: { value: connectableProto.getSubject },\n connect: { value: connectableProto.connect },\n refCount: { value: connectableProto.refCount }\n };\n})();\nvar ConnectableSubscriber = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(ConnectableSubscriber, _super);\n function ConnectableSubscriber(destination, connectable) {\n var _this = _super.call(this, destination) || this;\n _this.connectable = connectable;\n return _this;\n }\n ConnectableSubscriber.prototype._error = function (err) {\n this._unsubscribe();\n _super.prototype._error.call(this, err);\n };\n ConnectableSubscriber.prototype._complete = function () {\n this.connectable._isComplete = true;\n this._unsubscribe();\n _super.prototype._complete.call(this);\n };\n ConnectableSubscriber.prototype._unsubscribe = function () {\n var connectable = this.connectable;\n if (connectable) {\n this.connectable = null;\n var connection = connectable._connection;\n connectable._refCount = 0;\n connectable._subject = null;\n connectable._connection = null;\n if (connection) {\n connection.unsubscribe();\n }\n }\n };\n return ConnectableSubscriber;\n}(SubjectSubscriber));\nvar RefCountOperator = /*@__PURE__*/ (function () {\n function RefCountOperator(connectable) {\n this.connectable = connectable;\n }\n RefCountOperator.prototype.call = function (subscriber, source) {\n var connectable = this.connectable;\n connectable._refCount++;\n var refCounter = new RefCountSubscriber(subscriber, connectable);\n var subscription = source.subscribe(refCounter);\n if (!refCounter.closed) {\n refCounter.connection = connectable.connect();\n }\n return subscription;\n };\n return RefCountOperator;\n}());\nvar RefCountSubscriber = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(RefCountSubscriber, _super);\n function RefCountSubscriber(destination, connectable) {\n var _this = _super.call(this, destination) || this;\n _this.connectable = connectable;\n return _this;\n }\n RefCountSubscriber.prototype._unsubscribe = function () {\n var connectable = this.connectable;\n if (!connectable) {\n this.connection = null;\n return;\n }\n this.connectable = null;\n var refCount = connectable._refCount;\n if (refCount <= 0) {\n this.connection = null;\n return;\n }\n connectable._refCount = refCount - 1;\n if (refCount > 1) {\n this.connection = null;\n return;\n }\n var connection = this.connection;\n var sharedConnection = connectable._connection;\n this.connection = null;\n if (sharedConnection && (!connection || sharedConnection === connection)) {\n sharedConnection.unsubscribe();\n }\n };\n return RefCountSubscriber;\n}(Subscriber));\n//# sourceMappingURL=ConnectableObservable.js.map\n","/** PURE_IMPORTS_START _observable_ConnectableObservable PURE_IMPORTS_END */\nimport { connectableObservableDescriptor } from '../observable/ConnectableObservable';\nexport function multicast(subjectOrSubjectFactory, selector) {\n return function multicastOperatorFunction(source) {\n var subjectFactory;\n if (typeof subjectOrSubjectFactory === 'function') {\n subjectFactory = subjectOrSubjectFactory;\n }\n else {\n subjectFactory = function subjectFactory() {\n return subjectOrSubjectFactory;\n };\n }\n if (typeof selector === 'function') {\n return source.lift(new MulticastOperator(subjectFactory, selector));\n }\n var connectable = Object.create(source, connectableObservableDescriptor);\n connectable.source = source;\n connectable.subjectFactory = subjectFactory;\n return connectable;\n };\n}\nvar MulticastOperator = /*@__PURE__*/ (function () {\n function MulticastOperator(subjectFactory, selector) {\n this.subjectFactory = subjectFactory;\n this.selector = selector;\n }\n MulticastOperator.prototype.call = function (subscriber, source) {\n var selector = this.selector;\n var subject = this.subjectFactory();\n var subscription = selector(subject).subscribe(subscriber);\n subscription.add(source.subscribe(subject));\n return subscription;\n };\n return MulticastOperator;\n}());\nexport { MulticastOperator };\n//# sourceMappingURL=multicast.js.map\n","/** PURE_IMPORTS_START _multicast,_refCount,_Subject PURE_IMPORTS_END */\nimport { multicast } from './multicast';\nimport { refCount } from './refCount';\nimport { Subject } from '../Subject';\nfunction shareSubjectFactory() {\n return new Subject();\n}\nexport function share() {\n return function (source) { return refCount()(multicast(shareSubjectFactory)(source)); };\n}\n//# sourceMappingURL=share.js.map\n","/*\n * Copyright (c) 2016-2019 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable, Subject, fromEvent } from \"rxjs\"\nimport { filter, map, share } from \"rxjs/operators\"\n\n/* ----------------------------------------------------------------------------\n * Data\n * ------------------------------------------------------------------------- */\n\n/**\n * Observable for window hash change events\n */\nconst hashchange$ = fromEvent(window, \"hashchange\")\n\n/**\n * Observable for window pop state events\n */\nconst popstate$ = fromEvent(window, \"popstate\")\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch location\n *\n * @return Location subject\n */\nexport function watchLocation(): Subject {\n const location$ = new Subject()\n popstate$\n .pipe(\n map(() => location.href),\n share()\n )\n .subscribe(location$)\n\n /* Return subject */\n return location$\n}\n\n/**\n * Watch location hash\n *\n * @return Location hash observable\n */\nexport function watchLocationHash(): Observable {\n return hashchange$\n .pipe(\n map(() => location.hash),\n filter(hash => hash.length > 0),\n share()\n )\n}\n","/*\n * Copyright (c) 2016-2019 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable, fromEventPattern } from \"rxjs\"\nimport { shareReplay, startWith } from \"rxjs/operators\"\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch media query\n *\n * @param query - Media query\n *\n * @return Media observable\n */\nexport function watchMedia(query: string): Observable {\n const media = matchMedia(query)\n return fromEventPattern(next =>\n media.addListener(() => next(media.matches))\n )\n .pipe(\n startWith(media.matches),\n shareReplay(1)\n )\n}\n","/** PURE_IMPORTS_START _Observable,_util_isArray,_util_isFunction,_operators_map PURE_IMPORTS_END */\nimport { Observable } from '../Observable';\nimport { isArray } from '../util/isArray';\nimport { isFunction } from '../util/isFunction';\nimport { map } from '../operators/map';\nexport function fromEventPattern(addHandler, removeHandler, resultSelector) {\n if (resultSelector) {\n return fromEventPattern(addHandler, removeHandler).pipe(map(function (args) { return isArray(args) ? resultSelector.apply(void 0, args) : resultSelector(args); }));\n }\n return new Observable(function (subscriber) {\n var handler = function () {\n var e = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n e[_i] = arguments[_i];\n }\n return subscriber.next(e.length === 1 ? e[0] : e);\n };\n var retValue;\n try {\n retValue = addHandler(handler);\n }\n catch (err) {\n subscriber.error(err);\n return undefined;\n }\n if (!isFunction(removeHandler)) {\n return undefined;\n }\n return function () { return removeHandler(handler, retValue); };\n });\n}\n//# sourceMappingURL=fromEventPattern.js.map\n","/*\n * Copyright (c) 2016-2019 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable, fromEvent, merge } from \"rxjs\"\nimport { map, shareReplay, startWith } from \"rxjs/operators\"\n\n/* ----------------------------------------------------------------------------\n * Data\n * ------------------------------------------------------------------------- */\n\n/**\n * Observable for window scroll events\n */\nconst scroll$ = fromEvent(window, \"scroll\")\n\n/**\n * Observable for window resize events\n */\nconst resize$ = fromEvent(window, \"resize\")\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Viewport offset\n */\nexport interface ViewportOffset {\n x: number /* Horizontal offset */\n y: number /* Vertical offset */\n}\n\n/**\n * Viewport size\n */\nexport interface ViewportSize {\n width: number /* Viewport width */\n height: number /* Viewport height */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Retrieve viewport offset\n *\n * @return Viewport offset\n */\nexport function getViewportOffset(): ViewportOffset {\n return {\n x: pageXOffset,\n y: pageYOffset\n }\n}\n\n/**\n * Retrieve viewport size\n *\n * @return Viewport size\n */\nexport function getViewportSize(): ViewportSize {\n return {\n width: innerWidth,\n height: innerHeight\n }\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Watch viewport offset\n *\n * @return Viewport offset observable\n */\nexport function watchViewportOffset(): Observable {\n return merge(scroll$, resize$)\n .pipe(\n map(getViewportOffset),\n startWith(getViewportOffset()),\n shareReplay(1)\n )\n}\n\n/**\n * Watch viewport size\n *\n * @return Viewport size observable\n */\nexport function watchViewportSize(): Observable {\n return resize$\n .pipe(\n map(getViewportSize),\n startWith(getViewportSize()),\n shareReplay(1)\n )\n}\n","/** PURE_IMPORTS_START tslib,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { OuterSubscriber } from '../OuterSubscriber';\nimport { subscribeToResult } from '../util/subscribeToResult';\nexport var defaultThrottleConfig = {\n leading: true,\n trailing: false\n};\nexport function throttle(durationSelector, config) {\n if (config === void 0) {\n config = defaultThrottleConfig;\n }\n return function (source) { return source.lift(new ThrottleOperator(durationSelector, config.leading, config.trailing)); };\n}\nvar ThrottleOperator = /*@__PURE__*/ (function () {\n function ThrottleOperator(durationSelector, leading, trailing) {\n this.durationSelector = durationSelector;\n this.leading = leading;\n this.trailing = trailing;\n }\n ThrottleOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new ThrottleSubscriber(subscriber, this.durationSelector, this.leading, this.trailing));\n };\n return ThrottleOperator;\n}());\nvar ThrottleSubscriber = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(ThrottleSubscriber, _super);\n function ThrottleSubscriber(destination, durationSelector, _leading, _trailing) {\n var _this = _super.call(this, destination) || this;\n _this.destination = destination;\n _this.durationSelector = durationSelector;\n _this._leading = _leading;\n _this._trailing = _trailing;\n _this._hasValue = false;\n return _this;\n }\n ThrottleSubscriber.prototype._next = function (value) {\n this._hasValue = true;\n this._sendValue = value;\n if (!this._throttled) {\n if (this._leading) {\n this.send();\n }\n else {\n this.throttle(value);\n }\n }\n };\n ThrottleSubscriber.prototype.send = function () {\n var _a = this, _hasValue = _a._hasValue, _sendValue = _a._sendValue;\n if (_hasValue) {\n this.destination.next(_sendValue);\n this.throttle(_sendValue);\n }\n this._hasValue = false;\n this._sendValue = null;\n };\n ThrottleSubscriber.prototype.throttle = function (value) {\n var duration = this.tryDurationSelector(value);\n if (!!duration) {\n this.add(this._throttled = subscribeToResult(this, duration));\n }\n };\n ThrottleSubscriber.prototype.tryDurationSelector = function (value) {\n try {\n return this.durationSelector(value);\n }\n catch (err) {\n this.destination.error(err);\n return null;\n }\n };\n ThrottleSubscriber.prototype.throttlingDone = function () {\n var _a = this, _throttled = _a._throttled, _trailing = _a._trailing;\n if (_throttled) {\n _throttled.unsubscribe();\n }\n this._throttled = null;\n if (_trailing) {\n this.send();\n }\n };\n ThrottleSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {\n this.throttlingDone();\n };\n ThrottleSubscriber.prototype.notifyComplete = function () {\n this.throttlingDone();\n };\n return ThrottleSubscriber;\n}(OuterSubscriber));\n//# sourceMappingURL=throttle.js.map\n","/*\n * Copyright (c) 2016-2019 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable, fromEvent } from \"rxjs\"\nimport { pluck, share, switchMapTo, tap, throttle } from \"rxjs/operators\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Worker message\n */\nexport interface WorkerMessage {\n type: unknown /* Message type */\n data: unknown /* Message data */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Options\n *\n * @template T - Worker message type\n */\ninterface Options {\n send$: Observable /* Message observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch a web worker\n *\n * This function returns an observable that will send all values emitted by the\n * message observable to the web worker. Web worker communication is expected\n * to be bidirectional (request-response) and synchronous. Messages that are\n * emitted during a pending request are throttled, the last one is emitted.\n *\n * @param worker - Web worker\n *\n * @return Worker message observable\n */\nexport function watchWorker(\n worker: Worker, { send$ }: Options\n): Observable {\n\n /* Intercept messages from web worker */\n const recv$ = fromEvent(worker, \"message\")\n .pipe(\n pluck(\"data\"),\n share()\n )\n\n /* Send and receive messages, return hot observable */\n return send$\n .pipe(\n throttle(() => recv$, { leading: true, trailing: true }),\n tap(message => worker.postMessage(message)),\n switchMapTo(recv$),\n share()\n )\n}\n","/** PURE_IMPORTS_START tslib,_AsyncAction PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { AsyncAction } from './AsyncAction';\nvar AnimationFrameAction = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(AnimationFrameAction, _super);\n function AnimationFrameAction(scheduler, work) {\n var _this = _super.call(this, scheduler, work) || this;\n _this.scheduler = scheduler;\n _this.work = work;\n return _this;\n }\n AnimationFrameAction.prototype.requestAsyncId = function (scheduler, id, delay) {\n if (delay === void 0) {\n delay = 0;\n }\n if (delay !== null && delay > 0) {\n return _super.prototype.requestAsyncId.call(this, scheduler, id, delay);\n }\n scheduler.actions.push(this);\n return scheduler.scheduled || (scheduler.scheduled = requestAnimationFrame(function () { return scheduler.flush(null); }));\n };\n AnimationFrameAction.prototype.recycleAsyncId = function (scheduler, id, delay) {\n if (delay === void 0) {\n delay = 0;\n }\n if ((delay !== null && delay > 0) || (delay === null && this.delay > 0)) {\n return _super.prototype.recycleAsyncId.call(this, scheduler, id, delay);\n }\n if (scheduler.actions.length === 0) {\n cancelAnimationFrame(id);\n scheduler.scheduled = undefined;\n }\n return undefined;\n };\n return AnimationFrameAction;\n}(AsyncAction));\nexport { AnimationFrameAction };\n//# sourceMappingURL=AnimationFrameAction.js.map\n","/** PURE_IMPORTS_START _AnimationFrameAction,_AnimationFrameScheduler PURE_IMPORTS_END */\nimport { AnimationFrameAction } from './AnimationFrameAction';\nimport { AnimationFrameScheduler } from './AnimationFrameScheduler';\nexport var animationFrame = /*@__PURE__*/ new AnimationFrameScheduler(AnimationFrameAction);\n//# sourceMappingURL=animationFrame.js.map\n","/** PURE_IMPORTS_START tslib,_AsyncScheduler PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { AsyncScheduler } from './AsyncScheduler';\nvar AnimationFrameScheduler = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(AnimationFrameScheduler, _super);\n function AnimationFrameScheduler() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n AnimationFrameScheduler.prototype.flush = function (action) {\n this.active = true;\n this.scheduled = undefined;\n var actions = this.actions;\n var error;\n var index = -1;\n var count = actions.length;\n action = action || actions.shift();\n do {\n if (error = action.execute(action.state, action.delay)) {\n break;\n }\n } while (++index < count && (action = actions.shift()));\n this.active = false;\n if (error) {\n while (++index < count && (action = actions.shift())) {\n action.unsubscribe();\n }\n throw error;\n }\n };\n return AnimationFrameScheduler;\n}(AsyncScheduler));\nexport { AnimationFrameScheduler };\n//# sourceMappingURL=AnimationFrameScheduler.js.map\n","/** PURE_IMPORTS_START tslib,_Subscriber,_Subscription PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { Subscriber } from '../Subscriber';\nimport { Subscription } from '../Subscription';\nexport function finalize(callback) {\n return function (source) { return source.lift(new FinallyOperator(callback)); };\n}\nvar FinallyOperator = /*@__PURE__*/ (function () {\n function FinallyOperator(callback) {\n this.callback = callback;\n }\n FinallyOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new FinallySubscriber(subscriber, this.callback));\n };\n return FinallyOperator;\n}());\nvar FinallySubscriber = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(FinallySubscriber, _super);\n function FinallySubscriber(destination, callback) {\n var _this = _super.call(this, destination) || this;\n _this.add(new Subscription(callback));\n return _this;\n }\n return FinallySubscriber;\n}(Subscriber));\n//# sourceMappingURL=finalize.js.map\n","/*\n * Copyright (c) 2016-2019 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { getElement } from \"../agent\"\n\n/* ----------------------------------------------------------------------------\n * Data\n * ------------------------------------------------------------------------- */\n\n/**\n * Translations\n */\nlet lang: Record\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Truncate a string after the given number of characters\n *\n * @param value - Value to be truncated\n * @param n - Number of characters\n *\n * @return Truncated value\n */\nexport function truncate(value: string, n: number): string {\n let i = n\n if (value.length > i) {\n while (value[i] !== \" \" && --i > 0); // tslint:disable-line\n return `${value.substring(0, i)}...`\n }\n return value\n}\n\n/**\n * Translate the given key\n *\n * @param key - Key to be translated\n * @param value - Value to be replaced\n *\n * @return Translation\n */\nexport function translate(key: string, value?: string): string {\n if (typeof lang === \"undefined\") {\n const el = getElement(\"#__lang\")!\n lang = JSON.parse(el.innerText)\n }\n if (typeof lang[key] === \"undefined\") {\n throw new ReferenceError(`Invalid translation: ${key}`)\n }\n return typeof value !== \"undefined\"\n ? lang[key].replace(\"#\", value)\n : lang[key]\n}\n","/*\n * Copyright (c) 2016-2019 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Set anchor blur\n *\n * @param el - Anchor element\n * @param value - Whether the anchor is blurred\n */\nexport function setAnchorBlur(\n el: HTMLElement, value: boolean\n): void {\n el.setAttribute(\"data-md-state\", value ? \"blur\" : \"\")\n}\n\n/**\n * Reset anchor blur\n *\n * @param el - Anchor element\n */\nexport function resetAnchorBlur(\n el: HTMLElement\n): void {\n el.removeAttribute(\"data-md-state\")\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Set anchor active\n *\n * @param el - Anchor element\n * @param value - Whether the anchor is active\n */\nexport function setAnchorActive(\n el: HTMLElement, value: boolean\n): void {\n el.classList.toggle(\"md-nav__link--active\", value)\n}\n\n/**\n * Reset anchor active\n *\n * @param el - Anchor element\n */\nexport function resetAnchorActive(\n el: HTMLElement\n): void {\n el.classList.remove(\"md-nav__link--active\")\n}\n","/*\n * Copyright (c) 2016-2019 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { translate } from \"utilities\"\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Set number of search results\n *\n * @param el - Search result metadata element\n * @param value - Number of results\n */\nexport function setSearchResultMeta(\n el: HTMLElement, value: number\n): void {\n el.textContent = value > 1\n ? translate(\"search.result.other\", value.toString())\n : value === 1\n ? translate(\"search.result.one\")\n : translate(\"search.result.none\")\n}\n\n/**\n * Reset number of search results\n *\n * @param el - Search result metadata element\n */\nexport function resetSearchResultMeta(\n el: HTMLElement\n): void {\n el.textContent = translate(\"search.result.placeholder\")\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Add an element to the search result list\n *\n * @param el - Search result list element\n * @param child - Search result element\n */\nexport function addToSearchResultList(\n el: HTMLElement, child: HTMLElement\n): void {\n el.appendChild(child)\n}\n\n/**\n * Reset search result list\n *\n * @param el - Search result list element\n */\nexport function resetSearchResultList(\n el: HTMLElement\n): void {\n el.innerHTML = \"\"\n}\n","/*\n * Copyright (c) 2016-2019 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { OperatorFunction, animationFrameScheduler, pipe } from \"rxjs\"\nimport {\n distinctUntilChanged,\n finalize,\n map,\n observeOn,\n tap\n} from \"rxjs/operators\"\n\nimport { resetHidden, setHidden } from \"actions\"\n\nimport { ViewportOffset } from \"../agent\"\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Paint hideable from source observable\n *\n * @param el - Hideable element\n * @param offset - Additional offset\n *\n * @return Operator function\n */\nexport function paintHidden(\n el: HTMLElement, offset: number = 0\n): OperatorFunction {\n return pipe(\n map(({ y }) => y >= offset),\n distinctUntilChanged(),\n\n /* Defer repaint to next animation frame */\n observeOn(animationFrameScheduler),\n tap(value => {\n setHidden(el, value)\n }),\n\n /* Reset on complete or error */\n finalize(() => {\n resetHidden(el)\n })\n )\n}\n","/*\n * Copyright (c) 2016-2019 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Set hidden\n *\n * @param el - Hideable element\n * @param value - Whether the element is hidden\n */\nexport function setHidden(\n el: HTMLElement, value: boolean\n): void {\n el.setAttribute(\"data-md-state\", value ? \"hidden\" : \"\")\n}\n\n/**\n * Reset hidden\n *\n * @param el - Hideable element\n */\nexport function resetHidden(\n el: HTMLElement\n): void {\n el.removeAttribute(\"data-md-state\")\n}\n","/*\n * Copyright (c) 2016-2019 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable, defer, of } from \"rxjs\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Header state\n */\nexport interface HeaderState {\n sticky: boolean /* Header stickyness */\n height: number /* Header visible height */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch header\n *\n * The header is wrapped in an observable to pave the way for auto-hiding or\n * other dynamic behaviors that may be implemented later on.\n *\n * @param el - Header element\n *\n * @return Header state observable\n */\nexport function watchHeader(\n el: HTMLElement\n): Observable {\n return defer(() => {\n const sticky = getComputedStyle(el)\n .getPropertyValue(\"position\") === \"fixed\"\n\n /* Return header as hot observable */\n return of({\n sticky,\n height: sticky ? el.offsetHeight : 0\n })\n })\n}\n","/** PURE_IMPORTS_START _Observable,_from,_empty PURE_IMPORTS_END */\nimport { Observable } from '../Observable';\nimport { from } from './from';\nimport { empty } from './empty';\nexport function defer(observableFactory) {\n return new Observable(function (subscriber) {\n var input;\n try {\n input = observableFactory();\n }\n catch (err) {\n subscriber.error(err);\n return undefined;\n }\n var source = input ? from(input) : empty();\n return source.subscribe(subscriber);\n });\n}\n//# sourceMappingURL=defer.js.map\n","/** PURE_IMPORTS_START tslib,_util_isScheduler,_util_isArray,_OuterSubscriber,_util_subscribeToResult,_fromArray PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { isScheduler } from '../util/isScheduler';\nimport { isArray } from '../util/isArray';\nimport { OuterSubscriber } from '../OuterSubscriber';\nimport { subscribeToResult } from '../util/subscribeToResult';\nimport { fromArray } from './fromArray';\nvar NONE = {};\nexport function combineLatest() {\n var observables = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n observables[_i] = arguments[_i];\n }\n var resultSelector = null;\n var scheduler = null;\n if (isScheduler(observables[observables.length - 1])) {\n scheduler = observables.pop();\n }\n if (typeof observables[observables.length - 1] === 'function') {\n resultSelector = observables.pop();\n }\n if (observables.length === 1 && isArray(observables[0])) {\n observables = observables[0];\n }\n return fromArray(observables, scheduler).lift(new CombineLatestOperator(resultSelector));\n}\nvar CombineLatestOperator = /*@__PURE__*/ (function () {\n function CombineLatestOperator(resultSelector) {\n this.resultSelector = resultSelector;\n }\n CombineLatestOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new CombineLatestSubscriber(subscriber, this.resultSelector));\n };\n return CombineLatestOperator;\n}());\nexport { CombineLatestOperator };\nvar CombineLatestSubscriber = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(CombineLatestSubscriber, _super);\n function CombineLatestSubscriber(destination, resultSelector) {\n var _this = _super.call(this, destination) || this;\n _this.resultSelector = resultSelector;\n _this.active = 0;\n _this.values = [];\n _this.observables = [];\n return _this;\n }\n CombineLatestSubscriber.prototype._next = function (observable) {\n this.values.push(NONE);\n this.observables.push(observable);\n };\n CombineLatestSubscriber.prototype._complete = function () {\n var observables = this.observables;\n var len = observables.length;\n if (len === 0) {\n this.destination.complete();\n }\n else {\n this.active = len;\n this.toRespond = len;\n for (var i = 0; i < len; i++) {\n var observable = observables[i];\n this.add(subscribeToResult(this, observable, observable, i));\n }\n }\n };\n CombineLatestSubscriber.prototype.notifyComplete = function (unused) {\n if ((this.active -= 1) === 0) {\n this.destination.complete();\n }\n };\n CombineLatestSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {\n var values = this.values;\n var oldVal = values[outerIndex];\n var toRespond = !this.toRespond\n ? 0\n : oldVal === NONE ? --this.toRespond : this.toRespond;\n values[outerIndex] = innerValue;\n if (toRespond === 0) {\n if (this.resultSelector) {\n this._tryResultSelector(values);\n }\n else {\n this.destination.next(values.slice());\n }\n }\n };\n CombineLatestSubscriber.prototype._tryResultSelector = function (values) {\n var result;\n try {\n result = this.resultSelector.apply(this, values);\n }\n catch (err) {\n this.destination.error(err);\n return;\n }\n this.destination.next(result);\n };\n return CombineLatestSubscriber;\n}(OuterSubscriber));\nexport { CombineLatestSubscriber };\n//# sourceMappingURL=combineLatest.js.map\n","/*\n * Copyright (c) 2016-2019 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable, combineLatest } from \"rxjs\"\nimport {\n distinctUntilChanged,\n map,\n shareReplay,\n switchMapTo\n} from \"rxjs/operators\"\n\nimport { Agent, ViewportOffset } from \"utilities\"\n\nimport { HeaderState } from \"../_\"\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Options\n */\ninterface Options {\n header$: Observable /* Header state observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch viewport offset relative to an element's top\n *\n * This function returns an observable that computes the relative offset to the\n * top of the given element based on the current viewport offset.\n *\n * @param el - HTML element\n * @param agent - Agent\n * @param options - Options\n *\n * @return Viewport offset observable\n */\nexport function watchViewportOffsetFromTopOf(\n el: HTMLElement, { viewport }: Agent, { header$ }: Options\n): Observable {\n\n /* Compute necessary adjustment for offset */\n const adjust$ = viewport.size$\n .pipe(\n switchMapTo(header$),\n map(({ height }) => el.offsetTop - height),\n distinctUntilChanged()\n )\n\n /* Compute relative offset and return as hot observable */\n return combineLatest([viewport.offset$, adjust$])\n .pipe(\n map(([{ x, y }, adjust]) => ({ x, y: y - adjust })),\n shareReplay(1)\n )\n}\n\n/**\n * Watch viewport offset relative to an element's bottom\n *\n * This function returns an observable that computes the relative offset to the\n * bottom of the given element based on the current viewport offset.\n *\n * @param el - HTML element\n * @param agent - Agent\n * @param options - Options\n *\n * @return Viewport offset observable\n */\nexport function watchViewportOffsetFromBottomOf(\n el: HTMLElement, { viewport }: Agent, { header$ }: Options\n): Observable {\n\n /* Compute necessary adjustment for offset */\n const adjust$ = viewport.size$\n .pipe(\n switchMapTo(header$),\n map(({ height }) => el.offsetTop + el.offsetHeight - height),\n distinctUntilChanged()\n )\n\n /* Compute relative offset and return as hot observable */\n return combineLatest([viewport.offset$, adjust$])\n .pipe(\n map(([{ x, y }, adjust]) => ({ x, y: y - adjust })),\n shareReplay(1)\n )\n}\n","/*\n * Copyright (c) 2016-2019 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n MonoTypeOperatorFunction,\n animationFrameScheduler,\n pipe\n} from \"rxjs\"\nimport {\n distinctUntilKeyChanged,\n finalize,\n observeOn,\n tap\n} from \"rxjs/operators\"\n\nimport { resetHeaderShadow, setHeaderShadow } from \"actions\"\n\nimport { MainState } from \"../../main\"\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Paint header shadow from source observable\n *\n * @param el - Header element\n *\n * @return Operator function\n */\nexport function paintHeaderShadow(\n el: HTMLElement\n): MonoTypeOperatorFunction {\n return pipe(\n distinctUntilKeyChanged(\"active\"),\n\n /* Defer repaint to next animation frame */\n observeOn(animationFrameScheduler),\n tap(({ active }) => {\n setHeaderShadow(el, active)\n }),\n\n /* Reset on complete or error */\n finalize(() => {\n resetHeaderShadow(el)\n })\n )\n}\n","/** PURE_IMPORTS_START _distinctUntilChanged PURE_IMPORTS_END */\nimport { distinctUntilChanged } from './distinctUntilChanged';\nexport function distinctUntilKeyChanged(key, compare) {\n return distinctUntilChanged(function (x, y) { return compare ? compare(x[key], y[key]) : x[key] === y[key]; });\n}\n//# sourceMappingURL=distinctUntilKeyChanged.js.map\n","/*\n * Copyright (c) 2016-2019 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Set header shadow\n *\n * @param el - Header element\n * @param value - Whether the shadow is shown\n */\nexport function setHeaderShadow(\n el: HTMLElement, value: boolean\n): void {\n el.setAttribute(\"data-md-state\", value ? \"shadow\" : \"\")\n}\n\n/**\n * Reset header shadow\n *\n * @param el - Header element\n */\nexport function resetHeaderShadow(\n el: HTMLElement\n): void {\n el.removeAttribute(\"data-md-state\")\n}\n","/*\n * Copyright (c) 2016-2019 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { JSX as JSXInternal } from \"preact\"\nimport { keys } from \"ramda\"\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * HTML attributes\n */\ntype Attributes =\n & JSXInternal.HTMLAttributes\n & JSXInternal.SVGAttributes\n & Record\n\n/**\n * Child element\n */\ntype Child = Child[] | HTMLElement | Text | string | number\n\n/* ----------------------------------------------------------------------------\n * Helper functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Append a child node to an element\n *\n * @param el - HTML element\n * @param child - Child node\n */\nfunction appendChild(el: HTMLElement, child: Child): void {\n\n /* Handle primitive types (including raw HTML) */\n if (typeof child === \"string\" || typeof child === \"number\") {\n el.innerHTML += child.toString()\n\n /* Handle nodes */\n } else if (child instanceof Node) {\n el.appendChild(child)\n\n /* Handle nested children */\n } else if (Array.isArray(child)) {\n for (const node of child)\n appendChild(el, node)\n }\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * JSX factory\n *\n * @param tag - HTML tag\n * @param attributes - HTML attributes\n * @param children - Child elements\n *\n * @return HTML element\n */\nexport function h(\n tag: string, attributes: Attributes | null,\n ...children: Array\n): HTMLElement {\n const el = document.createElement(tag)\n\n /* Set attributes, if any */\n if (attributes)\n for (const attr of keys(attributes))\n if (typeof attributes[attr] !== \"boolean\")\n el.setAttribute(attr, attributes[attr])\n else if (attributes[attr])\n el.setAttribute(attr, \"\")\n\n /* Append child nodes */\n for (const child of children)\n appendChild(el, child)\n\n /* Return element */\n return el\n}\n\n/**\n * JSX factory wrapper\n *\n * @param el - JSX element\n *\n * @return HTML element\n */\nexport function toHTMLElement(el: JSXInternal.Element): HTMLElement {\n return el as any // Hack: if you have a better idea, PR!\n}\n\n/* ----------------------------------------------------------------------------\n * Namespace\n * ------------------------------------------------------------------------- */\n\nexport declare namespace h {\n export import JSX = JSXInternal\n}\n","/** PURE_IMPORTS_START tslib,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { OuterSubscriber } from '../OuterSubscriber';\nimport { subscribeToResult } from '../util/subscribeToResult';\nexport function takeUntil(notifier) {\n return function (source) { return source.lift(new TakeUntilOperator(notifier)); };\n}\nvar TakeUntilOperator = /*@__PURE__*/ (function () {\n function TakeUntilOperator(notifier) {\n this.notifier = notifier;\n }\n TakeUntilOperator.prototype.call = function (subscriber, source) {\n var takeUntilSubscriber = new TakeUntilSubscriber(subscriber);\n var notifierSubscription = subscribeToResult(takeUntilSubscriber, this.notifier);\n if (notifierSubscription && !takeUntilSubscriber.seenValue) {\n takeUntilSubscriber.add(notifierSubscription);\n return source.subscribe(takeUntilSubscriber);\n }\n return takeUntilSubscriber;\n };\n return TakeUntilOperator;\n}());\nvar TakeUntilSubscriber = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(TakeUntilSubscriber, _super);\n function TakeUntilSubscriber(destination) {\n var _this = _super.call(this, destination) || this;\n _this.seenValue = false;\n return _this;\n }\n TakeUntilSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {\n this.seenValue = true;\n this.complete();\n };\n TakeUntilSubscriber.prototype.notifyComplete = function () {\n };\n return TakeUntilSubscriber;\n}(OuterSubscriber));\n//# sourceMappingURL=takeUntil.js.map\n","/*\n * Copyright (c) 2016-2019 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n EMPTY,\n Observable,\n OperatorFunction,\n combineLatest,\n of,\n pipe\n} from \"rxjs\"\nimport {\n filter,\n switchMap,\n takeUntil\n} from \"rxjs/operators\"\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Toggle switch map with another observable\n *\n * @template T - Source value type\n * @template U - Target value type\n *\n * @param toggle$ - Toggle observable\n * @param project - Projection\n *\n * @return Operator function\n */\nexport function switchMapIf(\n toggle$: Observable, project: (value: T) => Observable\n): OperatorFunction {\n const begin$ = toggle$.pipe(filter(value => value))\n const end$ = toggle$.pipe(filter(value => !value))\n return pipe(\n switchMap(value => combineLatest([of(value), begin$])),\n switchMap(([value, active]) => active\n ? project(value)\n .pipe(\n takeUntil(end$)\n )\n : EMPTY\n )\n )\n}\n","/*\n * Copyright (c) 2016-2019 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable, OperatorFunction, pipe } from \"rxjs\"\nimport { map, shareReplay } from \"rxjs/operators\"\n\nimport { switchMapIf } from \"extensions\"\nimport { Agent, paintHidden } from \"utilities\"\n\nimport { HeaderState, watchViewportOffsetFromTopOf } from \"../header\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Hero state\n */\nexport interface HeroState {\n hidden: boolean /* Whether the hero is hidden */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Options\n */\ninterface Options {\n header$: Observable /* Header state observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch hero\n *\n * @param el - Hero element\n * @param agent - Agent\n * @param options - Options\n *\n * @return Hero state\n */\nexport function watchHero(\n el: HTMLElement, agent: Agent, { header$ }: Options\n): Observable {\n\n /* Watch and paint visibility */\n const hidden$ = watchViewportOffsetFromTopOf(el, agent, { header$ })\n .pipe(\n paintHidden(el, 20)\n )\n\n /* Combine into a single hot observable */\n return hidden$\n .pipe(\n map(hidden => ({ hidden }))\n )\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Mount hero from source observable\n *\n * @param agent - Agent\n * @param options - Options\n *\n * @return Operator function\n */\nexport function mountHero(\n agent: Agent, options: Options\n): OperatorFunction {\n const { media } = agent\n return pipe(\n switchMapIf(media.screen$, el => watchHero(el, agent, options)),\n shareReplay(1)\n )\n}\n","/*\n * Copyright (c) 2016-2019 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable, OperatorFunction, combineLatest, pipe } from \"rxjs\"\nimport {\n distinctUntilChanged,\n map,\n pluck,\n shareReplay,\n switchMap\n} from \"rxjs/operators\"\n\nimport { Agent } from \"utilities\"\n\nimport { HeaderState } from \"../../header\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Main area state\n */\nexport interface MainState {\n offset: number /* Main area top offset */\n height: number /* Main area visible height */\n active: boolean /* Scrolled past top offset */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Options\n */\ninterface Options {\n header$: Observable /* Header state observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch main area\n *\n * This function returns an observable that computes the visual parameters of\n * the main area which depends on the viewport height and vertical offset, as\n * well as the height of the header element, if the header is fixed.\n *\n * @param el - Main area element\n * @param agent - Agent\n * @param options - Options\n *\n * @return Main area state observable\n */\nexport function watchMain(\n el: HTMLElement, { viewport }: Agent, { header$ }: Options\n): Observable {\n\n /* Compute necessary adjustment for header */\n const adjust$ = header$\n .pipe(\n pluck(\"height\")\n )\n\n /* Compute the main area's visible height */\n const height$ = combineLatest([\n viewport.offset$,\n viewport.size$,\n adjust$\n ])\n .pipe(\n map(([{ y }, { height }, adjust]) => {\n const top = el.offsetTop\n const bottom = el.offsetHeight + top\n return height\n - Math.max(0, top - y, adjust)\n - Math.max(0, height + y - bottom)\n }),\n distinctUntilChanged()\n )\n\n /* Compute whether the viewport offset is past the main area's top */\n const active$ = combineLatest([viewport.offset$, adjust$])\n .pipe(\n map(([{ y }, adjust]) => y >= el.offsetTop - adjust),\n distinctUntilChanged()\n )\n\n /* Combine into a single hot observable */\n return combineLatest([height$, adjust$, active$])\n .pipe(\n map(([height, adjust, active]) => ({\n offset: el.offsetTop - adjust,\n height,\n active\n }))\n )\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Mount main area from source observable\n *\n * @param agent - Agent\n * @param options - Options\n *\n * @return Operator function\n */\nexport function mountMain(\n agent: Agent, options: Options\n): OperatorFunction {\n return pipe(\n switchMap(el => watchMain(el, agent, options)),\n shareReplay(1)\n )\n}\n","import _curry1 from './_curry1.js';\nimport _isPlaceholder from './_isPlaceholder.js';\n\n/**\n * Optimized internal two-arity curry function.\n *\n * @private\n * @category Function\n * @param {Function} fn The function to curry.\n * @return {Function} The curried function.\n */\nexport default function _curry2(fn) {\n return function f2(a, b) {\n switch (arguments.length) {\n case 0:\n return f2;\n case 1:\n return _isPlaceholder(a) ? f2 : _curry1(function (_b) {\n return fn(a, _b);\n });\n default:\n return _isPlaceholder(a) && _isPlaceholder(b) ? f2 : _isPlaceholder(a) ? _curry1(function (_a) {\n return fn(_a, b);\n }) : _isPlaceholder(b) ? _curry1(function (_b) {\n return fn(a, _b);\n }) : fn(a, b);\n }\n };\n}","export default function _arrayFromIterator(iter) {\n var list = [];\n var next;\n while (!(next = iter.next()).done) {\n list.push(next.value);\n }\n return list;\n}","export default function _includesWith(pred, x, list) {\n var idx = 0;\n var len = list.length;\n\n while (idx < len) {\n if (pred(x, list[idx])) {\n return true;\n }\n idx += 1;\n }\n return false;\n}","// Based on https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\nfunction _objectIs(a, b) {\n // SameValue algorithm\n if (a === b) {\n // Steps 1-5, 7-10\n // Steps 6.b-6.e: +0 != -0\n return a !== 0 || 1 / a === 1 / b;\n } else {\n // Step 6.a: NaN == NaN\n return a !== a && b !== b;\n }\n}\n\nexport default typeof Object.is === 'function' ? Object.is : _objectIs;","import _curry1 from './internal/_curry1.js';\n\n/**\n * Gives a single-word string description of the (native) type of a value,\n * returning such answers as 'Object', 'Number', 'Array', or 'Null'. Does not\n * attempt to distinguish user Object types any further, reporting them all as\n * 'Object'.\n *\n * @func\n * @memberOf R\n * @since v0.8.0\n * @category Type\n * @sig (* -> {*}) -> String\n * @param {*} val The value to test\n * @return {String}\n * @example\n *\n * R.type({}); //=> \"Object\"\n * R.type(1); //=> \"Number\"\n * R.type(false); //=> \"Boolean\"\n * R.type('s'); //=> \"String\"\n * R.type(null); //=> \"Null\"\n * R.type([]); //=> \"Array\"\n * R.type(/[A-z]/); //=> \"RegExp\"\n * R.type(() => {}); //=> \"Function\"\n * R.type(undefined); //=> \"Undefined\"\n */\nvar type = /*#__PURE__*/_curry1(function type(val) {\n return val === null ? 'Null' : val === undefined ? 'Undefined' : Object.prototype.toString.call(val).slice(8, -1);\n});\nexport default type;","import _arrayFromIterator from './_arrayFromIterator.js';\nimport _includesWith from './_includesWith.js';\nimport _functionName from './_functionName.js';\nimport _has from './_has.js';\nimport _objectIs from './_objectIs.js';\nimport keys from '../keys.js';\nimport type from '../type.js';\n\n/**\n * private _uniqContentEquals function.\n * That function is checking equality of 2 iterator contents with 2 assumptions\n * - iterators lengths are the same\n * - iterators values are unique\n *\n * false-positive result will be returned for comparision of, e.g.\n * - [1,2,3] and [1,2,3,4]\n * - [1,1,1] and [1,2,3]\n * */\n\nfunction _uniqContentEquals(aIterator, bIterator, stackA, stackB) {\n var a = _arrayFromIterator(aIterator);\n var b = _arrayFromIterator(bIterator);\n\n function eq(_a, _b) {\n return _equals(_a, _b, stackA.slice(), stackB.slice());\n }\n\n // if *a* array contains any element that is not included in *b*\n return !_includesWith(function (b, aItem) {\n return !_includesWith(eq, aItem, b);\n }, b, a);\n}\n\nexport default function _equals(a, b, stackA, stackB) {\n if (_objectIs(a, b)) {\n return true;\n }\n\n var typeA = type(a);\n\n if (typeA !== type(b)) {\n return false;\n }\n\n if (a == null || b == null) {\n return false;\n }\n\n if (typeof a['fantasy-land/equals'] === 'function' || typeof b['fantasy-land/equals'] === 'function') {\n return typeof a['fantasy-land/equals'] === 'function' && a['fantasy-land/equals'](b) && typeof b['fantasy-land/equals'] === 'function' && b['fantasy-land/equals'](a);\n }\n\n if (typeof a.equals === 'function' || typeof b.equals === 'function') {\n return typeof a.equals === 'function' && a.equals(b) && typeof b.equals === 'function' && b.equals(a);\n }\n\n switch (typeA) {\n case 'Arguments':\n case 'Array':\n case 'Object':\n if (typeof a.constructor === 'function' && _functionName(a.constructor) === 'Promise') {\n return a === b;\n }\n break;\n case 'Boolean':\n case 'Number':\n case 'String':\n if (!(typeof a === typeof b && _objectIs(a.valueOf(), b.valueOf()))) {\n return false;\n }\n break;\n case 'Date':\n if (!_objectIs(a.valueOf(), b.valueOf())) {\n return false;\n }\n break;\n case 'Error':\n return a.name === b.name && a.message === b.message;\n case 'RegExp':\n if (!(a.source === b.source && a.global === b.global && a.ignoreCase === b.ignoreCase && a.multiline === b.multiline && a.sticky === b.sticky && a.unicode === b.unicode)) {\n return false;\n }\n break;\n }\n\n var idx = stackA.length - 1;\n while (idx >= 0) {\n if (stackA[idx] === a) {\n return stackB[idx] === b;\n }\n idx -= 1;\n }\n\n switch (typeA) {\n case 'Map':\n if (a.size !== b.size) {\n return false;\n }\n\n return _uniqContentEquals(a.entries(), b.entries(), stackA.concat([a]), stackB.concat([b]));\n case 'Set':\n if (a.size !== b.size) {\n return false;\n }\n\n return _uniqContentEquals(a.values(), b.values(), stackA.concat([a]), stackB.concat([b]));\n case 'Arguments':\n case 'Array':\n case 'Object':\n case 'Boolean':\n case 'Number':\n case 'String':\n case 'Date':\n case 'Error':\n case 'RegExp':\n case 'Int8Array':\n case 'Uint8Array':\n case 'Uint8ClampedArray':\n case 'Int16Array':\n case 'Uint16Array':\n case 'Int32Array':\n case 'Uint32Array':\n case 'Float32Array':\n case 'Float64Array':\n case 'ArrayBuffer':\n break;\n default:\n // Values of other types are only equal if identical.\n return false;\n }\n\n var keysA = keys(a);\n if (keysA.length !== keys(b).length) {\n return false;\n }\n\n var extendedStackA = stackA.concat([a]);\n var extendedStackB = stackB.concat([b]);\n\n idx = keysA.length - 1;\n while (idx >= 0) {\n var key = keysA[idx];\n if (!(_has(key, b) && _equals(b[key], a[key], extendedStackA, extendedStackB))) {\n return false;\n }\n idx -= 1;\n }\n return true;\n}","export default function _functionName(f) {\n // String(x => x) evaluates to \"x => x\", so the pattern may not match.\n var match = String(f).match(/^function (\\w*)/);\n return match == null ? '' : match[1];\n}","import _curry2 from './internal/_curry2.js';\nimport _equals from './internal/_equals.js';\n\n/**\n * Returns `true` if its arguments are equivalent, `false` otherwise. Handles\n * cyclical data structures.\n *\n * Dispatches symmetrically to the `equals` methods of both arguments, if\n * present.\n *\n * @func\n * @memberOf R\n * @since v0.15.0\n * @category Relation\n * @sig a -> b -> Boolean\n * @param {*} a\n * @param {*} b\n * @return {Boolean}\n * @example\n *\n * R.equals(1, 1); //=> true\n * R.equals(1, '1'); //=> false\n * R.equals([1, 2, 3], [1, 2, 3]); //=> true\n *\n * const a = {}; a.v = a;\n * const b = {}; b.v = b;\n * R.equals(a, b); //=> true\n */\nvar equals = /*#__PURE__*/_curry2(function equals(a, b) {\n return _equals(a, b, [], []);\n});\nexport default equals;","/*\n * Copyright (c) 2016-2019 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { equals } from \"ramda\"\nimport {\n MonoTypeOperatorFunction,\n Observable,\n animationFrameScheduler,\n combineLatest,\n pipe\n} from \"rxjs\"\nimport {\n distinctUntilChanged,\n finalize,\n map,\n observeOn,\n shareReplay,\n tap\n} from \"rxjs/operators\"\n\nimport {\n resetSidebarHeight,\n resetSidebarLock,\n setSidebarHeight,\n setSidebarLock\n} from \"actions\"\nimport { Agent } from \"utilities\"\n\nimport { MainState } from \"../_\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Sidebar state\n */\nexport interface SidebarState {\n height: number /* Sidebar height */\n lock: boolean /* Sidebar lock */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Options\n */\ninterface Options {\n main$: Observable /* Main area state observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch sidebar\n *\n * This function returns an observable that computes the visual parameters of\n * the sidebar which depends on the vertical viewport offset, as well as the\n * height of the main area. When the page is scrolled beyond the header, the\n * sidebar is locked and fills the remaining space.\n *\n * @param el - Sidebar element\n * @param agent - Agent\n * @param options - Options\n *\n * @return Sidebar state observable\n */\nexport function watchSidebar(\n el: HTMLElement, { viewport }: Agent, { main$ }: Options\n): Observable {\n\n /* Adjust for internal main area offset */\n const adjust = parseFloat(\n getComputedStyle(el.parentElement!)\n .getPropertyValue(\"padding-top\")\n )\n\n /* Compute the sidebar's available height */\n const height$ = combineLatest([viewport.offset$, main$])\n .pipe(\n map(([{ y }, { offset, height }]) => {\n return height - adjust + Math.min(adjust, Math.max(0, y - offset))\n })\n )\n\n /* Compute whether the sidebar should be locked */\n const lock$ = combineLatest([viewport.offset$, main$])\n .pipe(\n map(([{ y }, { offset }]) => y >= offset + adjust)\n )\n\n /* Combine into single hot observable */\n return combineLatest([height$, lock$])\n .pipe(\n map(([height, lock]) => ({ height, lock })),\n distinctUntilChanged(equals),\n shareReplay(1)\n )\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Paint sidebar from source observable\n *\n * @param el - Sidebar element\n *\n * @return Operator function\n */\nexport function paintSidebar(\n el: HTMLElement\n): MonoTypeOperatorFunction {\n return pipe(\n\n /* Defer repaint to next animation frame */\n observeOn(animationFrameScheduler),\n tap(({ height, lock }) => {\n setSidebarHeight(el, height)\n setSidebarLock(el, lock)\n }),\n\n /* Reset on complete or error */\n finalize(() => {\n resetSidebarHeight(el)\n resetSidebarLock(el)\n })\n )\n}\n","/*\n * Copyright (c) 2016-2019 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Set sidebar height\n *\n * @param el - Sidebar element\n * @param value - Sidebar height\n */\nexport function setSidebarHeight(\n el: HTMLElement, value: number\n): void {\n el.style.height = `${value}px`\n}\n\n/**\n * Reset sidebar height\n *\n * @param el - Sidebar element\n */\nexport function resetSidebarHeight(\n el: HTMLElement\n): void {\n el.style.height = \"\"\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Set sidebar lock\n *\n * @param el - Sidebar element\n * @param value - Whether the sidebar is locked\n */\nexport function setSidebarLock(\n el: HTMLElement, value: boolean\n): void {\n el.setAttribute(\"data-md-state\", value ? \"lock\" : \"\")\n}\n\n/**\n * Reset sidebar lock\n *\n * @param el - Sidebar element\n */\nexport function resetSidebarLock(\n el: HTMLElement\n): void {\n el.removeAttribute(\"data-md-state\")\n}\n","/*\n * Copyright (c) 2016-2019 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable, OperatorFunction, pipe } from \"rxjs\"\nimport { map, shareReplay } from \"rxjs/operators\"\n\nimport { switchMapIf } from \"extensions\"\nimport { Agent } from \"utilities\"\n\nimport {\n MainState,\n SidebarState,\n paintSidebar,\n watchSidebar\n} from \"../../main\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Navigation state\n */\nexport interface NavigationState {\n sidebar: SidebarState /* Sidebar state */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Options\n */\ninterface Options {\n main$: Observable /* Main area state observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch navigation\n *\n * @param el - Navigation element\n * @param agent - Agent\n * @param options - Options\n *\n * @return Navigation state observable\n */\nexport function watchNavigation(\n el: HTMLElement, agent: Agent, { main$ }: Options\n): Observable {\n\n /* Watch and paint sidebar */\n const sidebar$ = watchSidebar(el, agent, { main$ })\n .pipe(\n paintSidebar(el)\n )\n\n /* Combine into a single hot observable */\n return sidebar$\n .pipe(\n map(sidebar => ({ sidebar }))\n )\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Mount navigation from source observable\n *\n * @param agent - Agent\n * @param options - Options\n *\n * @return Operator function\n */\nexport function mountNavigation(\n agent: Agent, options: Options\n): OperatorFunction {\n const { media } = agent\n return pipe(\n switchMapIf(media.screen$, el => watchNavigation(el, agent, options)),\n shareReplay(1)\n )\n}\n","/*\n * Copyright (c) 2016-2019 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable, combineLatest, fromEvent } from \"rxjs\"\nimport {\n distinctUntilChanged,\n map,\n shareReplay,\n startWith\n} from \"rxjs/operators\"\n\nimport { watchElementFocus } from \"utilities\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Search query state\n */\nexport interface SearchQueryState {\n value: string /* Query value */\n focus: boolean /* Query focus state */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Options\n */\ninterface Options {\n prepare(value: string): string /* Preparation function */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch search query\n *\n * @param el - Search query element\n * @param options - Options\n *\n * @return Search query state observable\n */\nexport function watchSearchQuery(\n el: HTMLInputElement, { prepare }: Options\n): Observable {\n\n /* Intercept keyboard events */\n const value$ = fromEvent(el, \"keyup\")\n .pipe(\n map(() => prepare(el.value)),\n startWith(\"\"),\n distinctUntilChanged()\n )\n\n /* Intercept focus events */\n const focus$ = watchElementFocus(el)\n\n /* Combine into a single hot observable */\n return combineLatest([value$, focus$])\n .pipe(\n map(([value, focus]) => ({ value, focus })),\n shareReplay(1)\n )\n}\n","/*\n * Copyright (c) 2016-2019 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable, fromEvent, merge } from \"rxjs\"\nimport { mapTo, shareReplay, startWith } from \"rxjs/operators\"\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch element focus\n *\n * @param el - Element\n *\n * @return Element focus observable\n */\nexport function watchElementFocus(\n el: HTMLElement\n): Observable {\n const focus$ = fromEvent(el, \"focus\")\n const blur$ = fromEvent(el, \"blur\")\n\n /* Map events to boolean state */\n return merge(\n focus$.pipe(mapTo(true)),\n blur$.pipe(mapTo(false))\n )\n .pipe(\n startWith(el === document.activeElement),\n shareReplay(1)\n )\n}\n","/*\n * Copyright (c) 2016-2019 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable, fromEvent } from \"rxjs\"\nimport { mapTo } from \"rxjs/operators\"\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch search reset\n *\n * @param el - Search reset element\n *\n * @return Search reset observable\n */\nexport function watchSearchReset(\n el: HTMLElement\n): Observable {\n return fromEvent(el, \"click\")\n .pipe(\n mapTo(undefined)\n )\n}\n","/*\n * Copyright (c) 2016-2019 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { h, toHTMLElement } from \"extensions\"\nimport { ArticleDocument } from \"modules\"\nimport { truncate } from \"utilities\"\n\n/* ----------------------------------------------------------------------------\n * Data\n * ------------------------------------------------------------------------- */\n\n/**\n * CSS classes\n */\nconst css = {\n link: \"md-search-result__link\",\n article: \"md-search-result__article md-search-result__article--document\",\n title: \"md-search-result__title\",\n teaser: \"md-search-result__teaser\"\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Render an article document\n *\n * @param article - Article document\n *\n * @return HTML element\n */\nexport function renderArticleDocument(\n { location, title, text }: ArticleDocument\n): HTMLElement {\n return toHTMLElement(\n \n
\n

{title}

\n {text.length\n ?

{truncate(text, 320)}

\n : undefined\n }\n
\n
\n )\n}\n","/*\n * Copyright (c) 2016-2019 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { h, toHTMLElement } from \"extensions\"\nimport { SectionDocument } from \"modules\"\nimport { truncate } from \"utilities\"\n\n/* ----------------------------------------------------------------------------\n * Data\n * ------------------------------------------------------------------------- */\n\n/**\n * CSS classes\n */\nconst css = {\n link: \"md-search-result__link\",\n article: \"md-search-result__article\",\n title: \"md-search-result__title\",\n teaser: \"md-search-result__teaser\"\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Render a section document\n *\n * @param section - Section document\n *\n * @return HTML element\n */\nexport function renderSectionDocument(\n { location, title, text }: SectionDocument\n): HTMLElement {\n return toHTMLElement(\n \n
\n

{title}

\n {text.length\n ?

{truncate(text, 320)}

\n : undefined\n }\n
\n
\n )\n}\n","/*\n * Copyright (c) 2016-2019 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { h, toHTMLElement } from \"extensions\"\nimport { SearchResult } from \"modules\"\n\nimport { renderArticleDocument } from \"../article\"\nimport { renderSectionDocument } from \"../section\"\n\n/* ----------------------------------------------------------------------------\n * Data\n * ------------------------------------------------------------------------- */\n\n/**\n * CSS classes\n */\nconst css = {\n item: \"md-search-result__item\"\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Render a search result\n *\n * @param result - Search result\n *\n * @return HTML element\n */\nexport function renderSearchResult(\n { article, sections }: SearchResult\n): HTMLElement {\n return toHTMLElement(\n
  • \n {renderArticleDocument(article)}\n {...sections.map(renderSectionDocument)}\n
  • \n )\n}\n","/** PURE_IMPORTS_START tslib,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { OuterSubscriber } from '../OuterSubscriber';\nimport { subscribeToResult } from '../util/subscribeToResult';\nexport function withLatestFrom() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return function (source) {\n var project;\n if (typeof args[args.length - 1] === 'function') {\n project = args.pop();\n }\n var observables = args;\n return source.lift(new WithLatestFromOperator(observables, project));\n };\n}\nvar WithLatestFromOperator = /*@__PURE__*/ (function () {\n function WithLatestFromOperator(observables, project) {\n this.observables = observables;\n this.project = project;\n }\n WithLatestFromOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new WithLatestFromSubscriber(subscriber, this.observables, this.project));\n };\n return WithLatestFromOperator;\n}());\nvar WithLatestFromSubscriber = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(WithLatestFromSubscriber, _super);\n function WithLatestFromSubscriber(destination, observables, project) {\n var _this = _super.call(this, destination) || this;\n _this.observables = observables;\n _this.project = project;\n _this.toRespond = [];\n var len = observables.length;\n _this.values = new Array(len);\n for (var i = 0; i < len; i++) {\n _this.toRespond.push(i);\n }\n for (var i = 0; i < len; i++) {\n var observable = observables[i];\n _this.add(subscribeToResult(_this, observable, observable, i));\n }\n return _this;\n }\n WithLatestFromSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {\n this.values[outerIndex] = innerValue;\n var toRespond = this.toRespond;\n if (toRespond.length > 0) {\n var found = toRespond.indexOf(outerIndex);\n if (found !== -1) {\n toRespond.splice(found, 1);\n }\n }\n };\n WithLatestFromSubscriber.prototype.notifyComplete = function () {\n };\n WithLatestFromSubscriber.prototype._next = function (value) {\n if (this.toRespond.length === 0) {\n var args = [value].concat(this.values);\n if (this.project) {\n this._tryProject(args);\n }\n else {\n this.destination.next(args);\n }\n }\n };\n WithLatestFromSubscriber.prototype._tryProject = function (args) {\n var result;\n try {\n result = this.project.apply(this, args);\n }\n catch (err) {\n this.destination.error(err);\n return;\n }\n this.destination.next(result);\n };\n return WithLatestFromSubscriber;\n}(OuterSubscriber));\n//# sourceMappingURL=withLatestFrom.js.map\n","/*\n * Copyright (c) 2016-2019 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { MonoTypeOperatorFunction, Observable, pipe } from \"rxjs\"\nimport { map, withLatestFrom } from \"rxjs/operators\"\n\nimport {\n resetSearchResultMeta,\n setSearchResultMeta\n} from \"actions\"\nimport { SearchResult } from \"modules\"\nimport { getElement } from \"utilities\"\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Options\n */\ninterface Options {\n query$: Observable /* Search query observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Paint search result metadata from source observable\n *\n * @param el - Search result metadata element\n * @param options - Options\n *\n * @return Operator function\n */\nexport function paintSearchResultMeta(\n el: HTMLElement, { query$ }: Options\n): MonoTypeOperatorFunction {\n const meta = getElement(\".md-search-result__meta\", el)!\n return pipe(\n withLatestFrom(query$),\n map(([result, query]) => {\n if (query) {\n setSearchResultMeta(meta, result.length)\n } else {\n resetSearchResultMeta(meta)\n }\n return result\n })\n )\n}\n","/*\n * Copyright (c) 2016-2019 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { identity } from \"ramda\"\nimport { Observable, OperatorFunction, pipe } from \"rxjs\"\nimport {\n distinctUntilChanged,\n filter,\n map,\n shareReplay,\n switchMap,\n tap,\n} from \"rxjs/operators\"\n\nimport { SearchResult } from \"modules\"\nimport { Agent, watchElementOffset } from \"utilities\"\n\nimport { paintSearchResultList } from \"../list\"\nimport { paintSearchResultMeta } from \"../meta\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Search result state\n */\nexport interface SearchResultState {\n result: SearchResult[] /* Search results */\n}\n\n// TODO: measure time, return metadata...\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Options\n */\ninterface Options {\n result$: Observable /* Search result observable */\n query$: Observable /* Search query observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch search result\n *\n * @param el - Search result element\n * @param agent - Agent\n * @param options - Options\n *\n * @return Search result state observable\n */\nexport function watchSearchResult(\n el: HTMLElement, agent: Agent, { result$, query$ }: Options\n): Observable {\n const container = el.parentElement!\n\n /* Compute whether there are more search results elements */\n const render$ = watchElementOffset(container, agent)\n .pipe(\n map(({ y }) => y >= container.scrollHeight - container.offsetHeight - 16),\n distinctUntilChanged(),\n filter(identity)\n )\n\n // combine into search result observable...\n\n /* Paint search results */\n return result$\n .pipe(\n tap(x => { console.log(\"watchSearchResult\", x) }),\n paintSearchResultMeta(el, { query$ }),\n paintSearchResultList(el, { render$ })\n )\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Mount search result from source observable\n *\n * @param agent - Agent\n * @param options - Options\n *\n * @return Operator function\n */\nexport function mountSearchResult(\n agent: Agent, options: Options\n): OperatorFunction {\n return pipe(\n switchMap(el => watchSearchResult(el, agent, options)),\n shareReplay(1)\n )\n}\n","/*\n * Copyright (c) 2016-2019 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n MonoTypeOperatorFunction,\n Observable,\n animationFrameScheduler,\n pipe\n} from \"rxjs\"\nimport {\n finalize,\n mapTo,\n observeOn,\n scan,\n switchMap\n} from \"rxjs/operators\"\n\nimport {\n addToSearchResultList,\n resetSearchResultList\n} from \"actions\"\nimport { SearchResult } from \"modules\"\nimport { renderSearchResult } from \"templates\"\nimport { getElement } from \"utilities\"\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Options\n */\ninterface Options {\n render$: Observable /* Render trigger observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Paint search result list from source observable\n *\n * @param el - Search result element\n * @param options - Options\n *\n * @return Operator function\n */\nexport function paintSearchResultList(\n el: HTMLElement, { render$ }: Options\n): MonoTypeOperatorFunction {\n const container = el.parentElement!\n const list = getElement(\".md-search-result__list\", el)!\n return pipe(\n switchMap(result => render$\n .pipe(\n\n /* Defer repaint to next animation frame */\n observeOn(animationFrameScheduler),\n scan(index => {\n while (index < result.length) {\n addToSearchResultList(list, renderSearchResult(result[index++]))\n if (container.scrollHeight - container.offsetHeight > 16)\n break\n }\n return index\n }, 0),\n\n /* Re-map to search result */\n mapTo(result),\n\n /* Reset on complete or error */\n finalize(() => {\n resetSearchResultList(list)\n })\n )\n )\n )\n}\n","/*\n * Copyright (c) 2016-2019 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable, OperatorFunction, pipe } from \"rxjs\"\nimport { map, shareReplay } from \"rxjs/operators\"\n\nimport { switchMapIf } from \"extensions\"\nimport { Agent, paintHidden } from \"utilities\"\n\nimport { HeaderState, watchViewportOffsetFromTopOf } from \"../header\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Tabs state\n */\nexport interface TabsState {\n hidden: boolean /* Whether the tabs are hidden */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Options\n */\ninterface Options {\n header$: Observable /* Header state observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch tabs\n *\n * This function returns an observable that computes the visual parameters of\n * the tabs, currently only denoting whether the tabs are hidden or not.\n *\n * @param el - Tabs element\n * @param agent - Agent\n * @param options - Options\n *\n * @return Tabs state\n */\nexport function watchTabs(\n el: HTMLElement, agent: Agent, { header$ }: Options\n): Observable {\n\n /* Watch and paint visibility */\n const hidden$ = watchViewportOffsetFromTopOf(el, agent, { header$ })\n .pipe(\n paintHidden(el, 8)\n )\n\n /* Combine into a single hot observable */\n return hidden$\n .pipe(\n map(hidden => ({ hidden }))\n )\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Mount tabs from source observable\n *\n * @param agent - Agent\n * @param options - Options\n *\n * @return Operator function\n */\nexport function mountTabs(\n agent: Agent, options: Options\n): OperatorFunction {\n const { media } = agent\n return pipe(\n switchMapIf(media.screen$, el => watchTabs(el, agent, options)),\n shareReplay(1)\n )\n}\n","import _curry1 from './internal/_curry1.js';\nimport _isString from './internal/_isString.js';\n\n/**\n * Returns a new list or string with the elements or characters in reverse\n * order.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category List\n * @sig [a] -> [a]\n * @sig String -> String\n * @param {Array|String} list\n * @return {Array|String}\n * @example\n *\n * R.reverse([1, 2, 3]); //=> [3, 2, 1]\n * R.reverse([1, 2]); //=> [2, 1]\n * R.reverse([1]); //=> [1]\n * R.reverse([]); //=> []\n *\n * R.reverse('abc'); //=> 'cba'\n * R.reverse('ab'); //=> 'ba'\n * R.reverse('a'); //=> 'a'\n * R.reverse(''); //=> ''\n */\nvar reverse = /*#__PURE__*/_curry1(function reverse(list) {\n return _isString(list) ? list.split('').reverse().join('') : Array.prototype.slice.call(list, 0).reverse();\n});\nexport default reverse;","export default function _isString(x) {\n return Object.prototype.toString.call(x) === '[object String]';\n}","import _indexOf from './_indexOf.js';\n\nexport default function _includes(a, list) {\n return _indexOf(list, a, 0) >= 0;\n}","import equals from '../equals.js';\n\nexport default function _indexOf(list, a, idx) {\n var inf, item;\n // Array.prototype.indexOf doesn't exist below IE9\n if (typeof list.indexOf === 'function') {\n switch (typeof a) {\n case 'number':\n if (a === 0) {\n // manually crawl the list to distinguish between +0 and -0\n inf = 1 / a;\n while (idx < list.length) {\n item = list[idx];\n if (item === 0 && 1 / item === inf) {\n return idx;\n }\n idx += 1;\n }\n return -1;\n } else if (a !== a) {\n // NaN\n while (idx < list.length) {\n item = list[idx];\n if (typeof item === 'number' && item !== item) {\n return idx;\n }\n idx += 1;\n }\n return -1;\n }\n // non-zero numbers can utilise Set\n return list.indexOf(a, idx);\n\n // all these types can utilise Set\n case 'string':\n case 'boolean':\n case 'function':\n case 'undefined':\n return list.indexOf(a, idx);\n\n case 'object':\n if (a === null) {\n // null can utilise Set\n return list.indexOf(a, idx);\n }\n }\n }\n // anything else not covered above, defer to R.equals\n while (idx < list.length) {\n if (equals(list[idx], a)) {\n return idx;\n }\n idx += 1;\n }\n return -1;\n}","import _includes from './_includes.js';\n\nvar _Set = /*#__PURE__*/function () {\n function _Set() {\n /* globals Set */\n this._nativeSet = typeof Set === 'function' ? new Set() : null;\n this._items = {};\n }\n\n // until we figure out why jsdoc chokes on this\n // @param item The item to add to the Set\n // @returns {boolean} true if the item did not exist prior, otherwise false\n //\n _Set.prototype.add = function (item) {\n return !hasOrAdd(item, true, this);\n };\n\n //\n // @param item The item to check for existence in the Set\n // @returns {boolean} true if the item exists in the Set, otherwise false\n //\n _Set.prototype.has = function (item) {\n return hasOrAdd(item, false, this);\n };\n\n //\n // Combines the logic for checking whether an item is a member of the set and\n // for adding a new item to the set.\n //\n // @param item The item to check or add to the Set instance.\n // @param shouldAdd If true, the item will be added to the set if it doesn't\n // already exist.\n // @param set The set instance to check or add to.\n // @return {boolean} true if the item already existed, otherwise false.\n //\n return _Set;\n}();\n\nfunction hasOrAdd(item, shouldAdd, set) {\n var type = typeof item;\n var prevSize, newSize;\n switch (type) {\n case 'string':\n case 'number':\n // distinguish between +0 and -0\n if (item === 0 && 1 / item === -Infinity) {\n if (set._items['-0']) {\n return true;\n } else {\n if (shouldAdd) {\n set._items['-0'] = true;\n }\n return false;\n }\n }\n // these types can all utilise the native Set\n if (set._nativeSet !== null) {\n if (shouldAdd) {\n prevSize = set._nativeSet.size;\n set._nativeSet.add(item);\n newSize = set._nativeSet.size;\n return newSize === prevSize;\n } else {\n return set._nativeSet.has(item);\n }\n } else {\n if (!(type in set._items)) {\n if (shouldAdd) {\n set._items[type] = {};\n set._items[type][item] = true;\n }\n return false;\n } else if (item in set._items[type]) {\n return true;\n } else {\n if (shouldAdd) {\n set._items[type][item] = true;\n }\n return false;\n }\n }\n\n case 'boolean':\n // set._items['boolean'] holds a two element array\n // representing [ falseExists, trueExists ]\n if (type in set._items) {\n var bIdx = item ? 1 : 0;\n if (set._items[type][bIdx]) {\n return true;\n } else {\n if (shouldAdd) {\n set._items[type][bIdx] = true;\n }\n return false;\n }\n } else {\n if (shouldAdd) {\n set._items[type] = item ? [false, true] : [true, false];\n }\n return false;\n }\n\n case 'function':\n // compare functions for reference equality\n if (set._nativeSet !== null) {\n if (shouldAdd) {\n prevSize = set._nativeSet.size;\n set._nativeSet.add(item);\n newSize = set._nativeSet.size;\n return newSize === prevSize;\n } else {\n return set._nativeSet.has(item);\n }\n } else {\n if (!(type in set._items)) {\n if (shouldAdd) {\n set._items[type] = [item];\n }\n return false;\n }\n if (!_includes(item, set._items[type])) {\n if (shouldAdd) {\n set._items[type].push(item);\n }\n return false;\n }\n return true;\n }\n\n case 'undefined':\n if (set._items[type]) {\n return true;\n } else {\n if (shouldAdd) {\n set._items[type] = true;\n }\n return false;\n }\n\n case 'object':\n if (item === null) {\n if (!set._items['null']) {\n if (shouldAdd) {\n set._items['null'] = true;\n }\n return false;\n }\n return true;\n }\n /* falls through */\n default:\n // reduce the search size of heterogeneous sets by creating buckets\n // for each type.\n type = Object.prototype.toString.call(item);\n if (!(type in set._items)) {\n if (shouldAdd) {\n set._items[type] = [item];\n }\n return false;\n }\n // scan through all previously applied items\n if (!_includes(item, set._items[type])) {\n if (shouldAdd) {\n set._items[type].push(item);\n }\n return false;\n }\n return true;\n }\n}\n\n// A simple Set type that honours R.equals semantics\nexport default _Set;","import _curry2 from './internal/_curry2.js';\nimport _Set from './internal/_Set.js';\n\n/**\n * Finds the set (i.e. no duplicates) of all elements in the first list not\n * contained in the second list. Objects and Arrays are compared in terms of\n * value equality, not reference equality.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Relation\n * @sig [*] -> [*] -> [*]\n * @param {Array} list1 The first list.\n * @param {Array} list2 The second list.\n * @return {Array} The elements in `list1` that are not in `list2`.\n * @see R.differenceWith, R.symmetricDifference, R.symmetricDifferenceWith, R.without\n * @example\n *\n * R.difference([1,2,3,4], [7,6,5,4,3]); //=> [1,2]\n * R.difference([7,6,5,4,3], [1,2,3,4]); //=> [7,6,5]\n * R.difference([{a: 1}, {b: 2}], [{a: 1}, {c: 3}]) //=> [{b: 2}]\n */\nvar difference = /*#__PURE__*/_curry2(function difference(first, second) {\n var out = [];\n var idx = 0;\n var firstLen = first.length;\n var secondLen = second.length;\n var toFilterOut = new _Set();\n\n for (var i = 0; i < secondLen; i += 1) {\n toFilterOut.add(second[i]);\n }\n\n while (idx < firstLen) {\n if (toFilterOut.add(first[idx])) {\n out[out.length] = first[idx];\n }\n idx += 1;\n }\n return out;\n});\nexport default difference;","\n/*\n * Copyright (c) 2016-2019 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Packer message type\n */\nexport const enum PackerMessageType {\n STRING, /* String data */\n BINARY /* Packed data */\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * A message containing an unpacked string\n */\nexport interface PackerStringMessage {\n type: PackerMessageType.STRING /* Message type */\n data: string /* Message data */\n}\n\n/**\n * A message containing a packed string\n */\nexport interface PackerBinaryMessage {\n type: PackerMessageType.BINARY /* Message type */\n data: string /* Message data */\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * A message exchanged with the packer worker\n */\nexport type PackerMessage =\n | PackerStringMessage\n | PackerBinaryMessage\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Type guard for packer binary messages\n *\n * @param message - Packer worker message\n *\n * @return Test result\n */\nexport function isPackerBinaryMessage(\n message: PackerMessage\n): message is PackerBinaryMessage {\n return message.type === PackerMessageType.BINARY\n}\n\n/**\n * Type guard for packer string messages\n *\n * @param message - Packer worker message\n *\n * @return Test result\n */\nexport function isPackerStringMessage(\n message: PackerMessage\n): message is PackerStringMessage {\n return message.type === PackerMessageType.STRING\n}\n","/*\n * Copyright (c) 2016-2019 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A RTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { SearchIndexOptions, SearchResult } from \"modules\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Search message type\n */\nexport const enum SearchMessageType {\n SETUP, /* Search index setup */\n DUMP, /* Search index dump */\n QUERY, /* Search query */\n RESULT /* Search results */\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * A message containing the data necessary to setup the search index\n */\nexport interface SearchSetupMessage {\n type: SearchMessageType.SETUP /* Message type */\n data: SearchIndexOptions /* Message data */\n}\n\n/**\n * A message containing the a dump of the search index\n */\nexport interface SearchDumpMessage {\n type: SearchMessageType.DUMP /* Message type */\n data: string /* Message data */\n}\n\n/**\n * A message containing a search query\n */\nexport interface SearchQueryMessage {\n type: SearchMessageType.QUERY /* Message type */\n data: string /* Message data */\n}\n\n/**\n * A message containing results for a search query\n */\nexport interface SearchResultMessage {\n type: SearchMessageType.RESULT /* Message type */\n data: SearchResult[] /* Message data */\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * A message exchanged with the search worker\n */\nexport type SearchMessage =\n | SearchSetupMessage\n | SearchDumpMessage\n | SearchQueryMessage\n | SearchResultMessage\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Type guard for search setup messages\n *\n * @param message - Search worker message\n *\n * @return Test result\n */\nexport function isSearchSetupMessage(\n message: SearchMessage\n): message is SearchSetupMessage {\n return message.type === SearchMessageType.SETUP\n}\n\n/**\n * Type guard for search dump messages\n *\n * @param message - Search worker message\n *\n * @return Test result\n */\nexport function isSearchDumpMessage(\n message: SearchMessage\n): message is SearchDumpMessage {\n return message.type === SearchMessageType.DUMP\n}\n\n/**\n * Type guard for search query messages\n *\n * @param message - Search worker message\n *\n * @return Test result\n */\nexport function isSearchQueryMessage(\n message: SearchMessage\n): message is SearchQueryMessage {\n return message.type === SearchMessageType.QUERY\n}\n\n/**\n * Type guard for search result messages\n *\n * @param message - Search worker message\n *\n * @return Test result\n */\nexport function isSearchResultMessage(\n message: SearchMessage\n): message is SearchResultMessage {\n return message.type === SearchMessageType.RESULT\n}\n","/*\n * Copyright (c) 2016-2019 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable, OperatorFunction, combineLatest, pipe } from \"rxjs\"\nimport { map, shareReplay } from \"rxjs/operators\"\n\nimport { switchMapIf } from \"extensions\"\nimport { Agent, getElements } from \"utilities\"\n\nimport { HeaderState } from \"../../header\"\nimport {\n MainState,\n SidebarState,\n paintSidebar,\n watchSidebar\n} from \"../../main\"\nimport {\n AnchorList,\n paintAnchorList,\n watchAnchorList\n} from \"../anchor\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Table of contents state\n */\nexport interface TableOfContentsState {\n sidebar: SidebarState /* Sidebar state */\n anchors: AnchorList /* Anchor list */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Options\n */\ninterface Options {\n header$: Observable /* Header state observable */\n main$: Observable /* Main area state observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch table of contents\n *\n * @param el - Table of contents element\n * @param agent - Agent\n * @param options - Options\n *\n * @return Table of contents state observable\n */\nexport function watchTableOfContents(\n el: HTMLElement, agent: Agent, { header$, main$ }: Options\n): Observable {\n\n /* Watch and paint sidebar */\n const sidebar$ = watchSidebar(el, agent, { main$ })\n .pipe(\n paintSidebar(el)\n )\n\n /* Watch and paint anchor list (scroll spy) */\n const els = getElements(\".md-nav__link\", el)\n const anchors$ = watchAnchorList(els, agent, { header$ })\n .pipe(\n paintAnchorList(els)\n )\n\n /* Combine into a single hot observable */\n return combineLatest([sidebar$, anchors$])\n .pipe(\n map(([sidebar, anchors]) => ({ sidebar, anchors }))\n )\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Mount table of contents from source observable\n *\n * @param agent - Agent\n * @param options - Options\n *\n * @return Operator function\n */\nexport function mountTableOfContents(\n agent: Agent, options: Options\n): OperatorFunction {\n const { media } = agent\n return pipe(\n switchMapIf(media.tablet$, el => watchTableOfContents(el, agent, options)),\n shareReplay(1)\n )\n}\n","/*\n * Copyright (c) 2016-2019 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { difference, reverse } from \"ramda\"\nimport {\n MonoTypeOperatorFunction,\n Observable,\n animationFrameScheduler,\n combineLatest,\n pipe\n} from \"rxjs\"\nimport {\n distinctUntilChanged,\n finalize,\n map,\n observeOn,\n scan,\n shareReplay,\n switchMap,\n tap\n} from \"rxjs/operators\"\n\nimport {\n resetAnchorActive,\n resetAnchorBlur,\n setAnchorActive,\n setAnchorBlur\n} from \"actions\"\nimport { Agent, getElement } from \"utilities\"\n\nimport { HeaderState } from \"../../header\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Anchor list\n */\nexport interface AnchorList {\n prev: HTMLAnchorElement[][] /* Anchors (previous) */\n next: HTMLAnchorElement[][] /* Anchors (next) */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Options\n */\ninterface Options {\n header$: Observable /* Header state observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch anchor list\n *\n * This is effectively a scroll-spy implementation which will account for the\n * fixed header and automatically re-calculate anchor offsets when the viewport\n * is resized. The returned observable will only emit if the anchor list needs\n * to be repainted.\n *\n * This implementation tracks an anchor element's entire path starting from its\n * level up to the top-most anchor element, e.g. `[h3, h2, h1]`. Although the\n * Material theme currently doesn't make use of this information, it enables\n * the styling of the entire hierarchy through customization.\n *\n * Note that the current anchor is the last item of the `prev` anchor list.\n *\n * @param els - Anchor elements\n * @param agent - Agent\n * @param options - Options\n *\n * @return Anchor list observable\n */\nexport function watchAnchorList(\n els: HTMLAnchorElement[], { viewport }: Agent, { header$ }: Options\n): Observable {\n const table = new Map()\n for (const el of els) {\n const id = decodeURIComponent(el.hash.substring(1))\n const target = getElement(`[id=\"${id}\"]`)\n if (typeof target !== \"undefined\")\n table.set(el, target)\n }\n\n /* Compute necessary adjustment for header */\n const adjust$ = header$\n .pipe(\n map(header => 18 + header.height)\n )\n\n /* Compute partition of previous and next anchors */\n const partition$ = viewport.size$\n .pipe(\n\n /* Build index to map anchor paths to vertical offsets */\n map(() => {\n let path: HTMLAnchorElement[] = []\n return [...table].reduce((index, [anchor, target]) => {\n while (path.length) {\n const last = table.get(path[path.length - 1])!\n if (last.tagName >= target.tagName) {\n path.pop()\n } else {\n break\n }\n }\n return index.set(\n reverse(path = [...path, anchor]),\n target.offsetTop\n )\n }, new Map())\n }),\n\n /* Re-compute partition when viewport offset changes */\n switchMap(index => combineLatest(viewport.offset$, adjust$)\n .pipe(\n scan(([prev, next], [{ y }, adjust]) => {\n\n /* Look forward */\n while (next.length) {\n const [, offset] = next[0]\n if (offset - adjust < y) {\n prev = [...prev, next.shift()!]\n } else {\n break\n }\n }\n\n /* Look backward */\n while (prev.length) {\n const [, offset] = prev[prev.length - 1]\n if (offset - adjust >= y) {\n next = [prev.pop()!, ...next]\n } else {\n break\n }\n }\n\n /* Return partition */\n return [prev, next]\n }, [[], [...index]]),\n distinctUntilChanged((a, b) => {\n return a[0] === b[0]\n && a[1] === b[1]\n })\n )\n )\n )\n\n /* Compute anchor list migrations */\n const migration$ = partition$\n .pipe(\n map(([prev, next]) => ({\n prev: prev.map(([path]) => path),\n next: next.map(([path]) => path)\n })),\n\n /* Extract anchor list migrations */\n scan((a, b) => {\n const begin = Math.max(0, Math.min(b.prev.length, a.prev.length) - 1)\n const end = Math.max(b.prev.length, a.prev.length)\n return {\n prev: b.prev.slice(begin, end + 1),\n next: difference(b.next, a.next)\n }\n }, { prev: [], next: [] })\n )\n\n /* Return anchor list migrations as hot observable */\n return migration$\n .pipe(\n shareReplay(1)\n )\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Paint anchor list from source observable\n *\n * @param els - Anchor elements\n *\n * @return Operator function\n */\nexport function paintAnchorList(\n els: HTMLAnchorElement[]\n): MonoTypeOperatorFunction {\n return pipe(\n\n /* Defer repaint to next animation frame */\n observeOn(animationFrameScheduler),\n tap(({ prev, next }) => {\n\n /* Look forward */\n for (const [el] of next) {\n resetAnchorActive(el)\n resetAnchorBlur(el)\n }\n\n /* Look backward */\n for (const [index, [el]] of prev.entries()) {\n setAnchorActive(el, index === prev.length - 1)\n setAnchorBlur(el, true)\n }\n }),\n\n /* Reset on complete or error */\n finalize(() => {\n for (const el of els) {\n resetAnchorActive(el)\n resetAnchorBlur(el)\n }\n })\n )\n}\n","/*\n * Copyright (c) 2016-2019 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\n// TODO: remove this after we finished refactoring\n// tslint:disable\n\nimport { identity, values } from \"ramda\"\nimport {\n EMPTY,\n Observable,\n Subject,\n forkJoin,\n merge,\n of\n} from \"rxjs\"\nimport { ajax } from \"rxjs/ajax\"\nimport {\n delay,\n filter,\n map,\n pluck,\n switchMap,\n switchMapTo,\n take,\n tap,\n} from \"rxjs/operators\"\n\nimport {\n Component,\n paintHeaderShadow,\n mountHero,\n mountMain,\n mountNavigation,\n mountSearchResult,\n mountTableOfContents,\n mountTabs,\n switchComponent,\n watchComponentMap,\n watchHeader,\n watchSearchQuery,\n watchSearchReset,\n} from \"./components\"\nimport { SearchIndexOptions } from \"./modules\"\nimport {\n getElement,\n setupAgent,\n watchToggle,\n watchWorker,\n setToggle\n} from \"./utilities\"\nimport {\n PackerMessage,\n PackerMessageType,\n SearchMessage,\n SearchMessageType,\n SearchSetupMessage,\n isSearchDumpMessage,\n isSearchResultMessage\n} from \"./workers\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Configuration\n */\nexport interface Config {\n base: string /* Base URL */\n worker: {\n search: string /* Search worker URL */\n packer: string /* Packer worker URL */\n }\n}\n\n/* ----------------------------------------------------------------------------\n * TODO: where do we put this stuff?\n * ------------------------------------------------------------------------- */\n\ndocument.documentElement.classList.remove(\"no-js\")\ndocument.documentElement.classList.add(\"js\")\n\nconst names: Component[] = [\n \"header\", /* Header */\n \"header-title\", /* Header title */\n \"search\", /* Search */\n \"search-query\", /* Search input */\n \"search-reset\", /* Search reset */\n \"search-result\", /* Search results */\n \"container\", /* Container */\n \"main\", /* Main area */\n \"hero\", /* Hero */\n \"tabs\", /* Tabs */\n \"navigation\", /* Navigation */\n \"toc\" /* Table of contents */\n]\n\n/* ----------------------------------------------------------------------------\n * Helper functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Ensure that the given value is a valid configuration\n *\n * We could use `jsonschema` or any other schema validation framework, but that\n * would just add more bloat to the bundle, so we'll keep it plain and simple.\n *\n * @param config - Configuration\n *\n * @return Test result\n */\nfunction isConfig(config: any): config is Config {\n return typeof config === \"object\"\n && typeof config.base === \"string\"\n && typeof config.worker === \"object\"\n && typeof config.worker.search === \"string\"\n && typeof config.worker.packer === \"string\"\n}\n\n/**\n *\n * Rogue control characters must be filtered before handing the query to the\n * search index, as lunr will throw otherwise.\n */\nfunction prepare(value: string): string {\n const newvalue = value\n .replace(/(?:^|\\s+)[*+-:^~]+(?=\\s+|$)/g, \"\")\n .trim()\n\n return newvalue ? newvalue.replace(/\\s+|$/g, \"* \") : \"\"\n}\n\nfunction setupWorkers(config: Config) {\n const worker = new Worker(config.worker.search)\n const packer = new Worker(config.worker.packer)\n\n const packerMessage$ = new Subject()\n const packer$ = watchWorker(packer, { send$: packerMessage$ })\n\n // send a message, then switchMapTo worker!\n\n packer$.subscribe(message => {\n // console.log(\"PACKER.MSG\", message.data.length)\n // is always packed!\n if (message.type === PackerMessageType.BINARY && message.data[0] !== \"{\")\n localStorage.setItem(\"index\", message.data)\n })\n\n // storing = experimental feature\n\n const searchMessage$ = new Subject()\n\n const search$ = watchWorker(worker, { send$: searchMessage$ })\n\n /* Link search to packer */\n search$\n .pipe(\n filter(isSearchDumpMessage),\n map(message => ({\n type: PackerMessageType.STRING,\n data: message.data\n })),\n tap(message => packerMessage$.next(message)) // send message and wait!\n // switchMapTo(packer$)\n )\n .subscribe()\n\n // rename into SearchPlugin!?\n\n const data$ = ajax({\n url: `${config.base}/search/search_index.json`,\n responseType: \"json\",\n withCredentials: true\n })\n .pipe(\n pluck(\"response\")\n // take(1)\n )\n\n const fromLocal = localStorage.getItem(\"index\")\n\n ;\n (fromLocal ? of({\n type: PackerMessageType.BINARY,\n data: localStorage.getItem(\"index\")!\n }) : EMPTY)\n .subscribe(x => {\n // console.log(\"send message to packer\")\n packerMessage$.next(x)\n })\n\n const index$ = fromLocal ? packer$.pipe(pluck(\"data\"), take(1)) : of(undefined) // of(localStorage.getItem(\"index\"))\n\n // index$.subscribe(xx => console.log(\"INDEX\", xx))\n\n forkJoin([data$, index$])\n .pipe(\n map(([data, index]) => ({\n type: SearchMessageType.SETUP,\n data: { ...data, index }\n }))\n )\n .subscribe(message => {\n searchMessage$.next(message) // TODO: this shall not complete\n })\n\n return [search$, searchMessage$] as const\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Initialize Material for MkDocs\n *\n * @param config - Configuration\n */\nexport function initialize(config: unknown) {\n if (!isConfig(config))\n throw new SyntaxError(`Invalid configuration: ${JSON.stringify(config)}`)\n\n // pass config here!?\n const agent = setupAgent() // TODO: add a config parameter here to configure media queries\n\n const [\n searchWorkerRecv$,\n searchMessage$\n ] = setupWorkers(config)\n\n /* ----------------------------------------------------------------------- */\n\n /* Create component map observable */\n const components$ = watchComponentMap(names, { document$: agent.document.load$ })\n const component = (name: Component): Observable => {\n return components$\n .pipe(\n switchComponent(name)\n )\n }\n\n /* Create header observable */\n const header$ = component(\"header\") // TODO:!\n .pipe(\n switchMap(watchHeader)\n )\n\n /* Create header shadow toggle */\n component(\"header\")\n .pipe(\n switchMap(el => main$\n .pipe(\n paintHeaderShadow(el) // technically, this could be done in paintMain\n )\n )\n )\n .subscribe()\n\n // ----------------------------------------------------------------------------\n\n // watchSearchResult // emit, if at bottom...\n // receive results as a second observable!? filter stuff, paint\n\n const result$ = searchWorkerRecv$ // move worker initialization into mountSearch ?\n .pipe(\n tap(m => console.log(\"message from worker\", m)),\n filter(isSearchResultMessage),\n pluck(\"data\")\n )\n\n // handleSearchResult <-- operator\n\n const query$ = component(\"query\")\n .pipe(\n switchMap(el => watchSearchQuery(el, { prepare }))\n )\n\n // export interface SearchResultState {\n // query: string\n // value: SearchResult[]\n // }\n\n query$\n .pipe(\n map(query => ({ // put this into some function...\n type: SearchMessageType.QUERY,\n data: query.value\n })), // TODO. ugly...\n // distinctUntilKeyChanged(\"data\")\n )\n .subscribe(searchMessage$)\n\n // create the message subject internally... and link it to the worker...?\n // watchSearchWorker(worker, agent, { query$ }) // message internally...\n\n query$\n .pipe(\n tap(query => {\n if (query.focus)\n setToggle(search, true)\n })\n )\n .subscribe()\n\n /* ----------------------------------------------------------------------- */\n\n const main$ = component(\"main\")\n .pipe(\n mountMain(agent, { header$ })\n )\n\n const navigation$ = component(\"navigation\")\n .pipe(\n mountNavigation(agent, { main$ })\n )\n\n const toc$ = component(\"toc\")\n .pipe(\n mountTableOfContents(agent, { header$, main$ })\n )\n\n // TODO: naming?\n const resultComponent$ = component(\"result\")\n .pipe(\n mountSearchResult(agent, { result$, query$: query$.pipe(pluck(\"value\")) })\n ) // temporary fix\n\n const tabs$ = component(\"tabs\")\n .pipe(\n mountTabs(agent, { header$ })\n )\n\n const hero$ = component(\"hero\")\n .pipe(\n mountHero(agent, { header$ })\n )\n\n\n /* ----------------------------------------------------------------------- */\n\n const drawer = getElement(\"[data-md-toggle=drawer]\")!\n const search = getElement(\"[data-md-toggle=search]\")!\n\n const a$ = watchToggle(search)\n .pipe(\n filter(identity),\n delay(400)\n )\n\n const reset$ = component(\"reset\")\n .pipe(\n switchMap(watchSearchReset)\n )\n\n merge(a$, reset$)\n .pipe(\n switchMapTo(component(\"query\")),\n tap(el => el.focus())\n )\n .subscribe()\n\n /* ----------------------------------------------------------------------- */\n\n const state = {\n query$,\n result$: resultComponent$,\n reset$,\n main$,\n navigation$,\n toc$,\n tabs$,\n hero$\n }\n\n merge(...values(state))\n .subscribe() // potential memleak <-- use takeUntil\n\n return {\n agent,\n state\n }\n}\n","/*\n * Copyright (c) 2016-2019 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable, Subject } from \"rxjs\"\n\nimport {\n ViewportOffset,\n ViewportSize,\n watchDocument,\n watchLocation,\n watchLocationHash,\n watchMedia,\n watchViewportOffset,\n watchViewportSize\n} from \"utilities\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Agent document\n */\nexport interface AgentDocument {\n load$: Observable /* Document observable */\n}\n\n/**\n * Agent location\n */\nexport interface AgentLocation {\n href$: Subject /* Location subject */\n hash$: Observable /* Location hash observable */\n}\n\n/**\n * Agent media\n */\nexport interface AgentMedia {\n screen$: Observable /* Media observable for screen */\n tablet$: Observable /* Media observable for tablet */\n}\n\n/**\n * Agent viewport\n */\nexport interface AgentViewport {\n offset$: Observable /* Viewport offset observable */\n size$: Observable /* Viewport size observable */\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Agent\n */\nexport interface Agent {\n document: AgentDocument /* Document observables */\n location: AgentLocation /* Location observables */\n media: AgentMedia /* Media observables */\n viewport: AgentViewport /* Viewport observables */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Create the agent\n *\n * This function returns a data structure that contains all observables that\n * are related to the browser and/or environment.\n *\n * @return Agent\n */\nexport function setupAgent(): Agent {\n return {\n document: {\n load$: watchDocument()\n },\n location: {\n href$: watchLocation(),\n hash$: watchLocationHash()\n },\n media: {\n screen$: watchMedia(\"(min-width: 1220px)\"),\n tablet$: watchMedia(\"(min-width: 960px)\")\n },\n viewport: {\n offset$: watchViewportOffset(),\n size$: watchViewportSize()\n }\n }\n}\n","/*\n * Copyright (c) 2016-2019 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { keys } from \"ramda\"\nimport { NEVER, Observable, OperatorFunction, of, pipe } from \"rxjs\"\nimport { map, scan, shareReplay, switchMap } from \"rxjs/operators\"\n\nimport { getElement } from \"utilities\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Component names\n */\nexport type Component =\n | \"container\" /* Container */\n | \"header\" /* Header */\n | \"header-title\" /* Header title */\n | \"hero\" /* Hero */\n | \"main\" /* Main area */\n | \"navigation\" /* Navigation */\n | \"search\" /* Search */\n | \"search-query\" /* Search input */\n | \"search-reset\" /* Search reset */\n | \"search-result\" /* Search results */\n | \"tabs\" /* Tabs */\n | \"toc\" /* Table of contents */\n\n/**\n * Component map\n */\nexport type ComponentMap = {\n [P in Component]?: HTMLElement\n}\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Options\n */\ninterface Options {\n document$: Observable /* Document observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch component mapping\n *\n * This function returns an observable that will maintain bindings to the given\n * components in-between document switches and update the document in-place.\n *\n * @param names - Component names\n * @param options - Options\n *\n * @return Component mapping observable\n */\nexport function watchComponentMap(\n names: Component[], { document$ }: Options\n): Observable {\n const components$ = document$\n .pipe(\n\n /* Build component map */\n map(document => names.reduce((components, name) => {\n const el = getElement(`[data-md-component=${name}]`, document)\n return {\n ...components,\n ...typeof el !== \"undefined\" ? { [name]: el } : {}\n }\n }, {})),\n\n /* Re-compute component map on document switch */\n scan((prev, next) => {\n for (const name of keys(prev)) {\n switch (name) {\n\n /* Top-level components: update */\n case \"title\":\n case \"container\":\n if (name in prev && typeof prev[name] !== \"undefined\") {\n prev[name]!.replaceWith(next[name]!)\n prev[name] = next[name]\n }\n break\n\n /* All other components: rebind */\n default:\n prev[name] = getElement(`[data-md-component=${name}]`)\n }\n }\n return prev\n })\n )\n\n /* Return component map as hot observable */\n return components$\n .pipe(\n shareReplay(1)\n )\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Switch to component\n *\n * @template T - Element type\n *\n * @param name - Component name\n *\n * @return Operator function\n */\nexport function switchComponent(\n name: Component\n): OperatorFunction {\n return pipe(\n switchMap(components => {\n return typeof components[name] !== \"undefined\"\n ? of(components[name] as T)\n : NEVER\n })\n )\n}\n","/*\n * Copyright (c) 2016-2019 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable, fromEvent } from \"rxjs\"\nimport { pluck } from \"rxjs/operators\"\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Set toggle\n *\n * Simulating a click event seems to be the most cross-browser compatible way\n * of changing the value while also emitting a `change` event. Before, Material\n * used `CustomEvent` to programatically change the value of a toggle, but this\n * is a much simpler and cleaner solution.\n *\n * @param el - Toggle element\n * @param value - Toggle value\n */\nexport function setToggle(\n el: HTMLInputElement, value: boolean\n): void {\n if (el.checked !== value)\n el.click()\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Watch toggle\n *\n * @param el - Toggle element\n *\n * @return Toggle observable\n */\nexport function watchToggle(\n el: HTMLInputElement\n): Observable {\n return fromEvent(el, \"change\")\n .pipe(\n pluck(\"checked\")\n )\n}\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./node_modules/rxjs/_esm5/internal/util/root.js","webpack:///(webpack)/buildin/global.js","webpack:///./node_modules/ramda/es/internal/_isPlaceholder.js","webpack:///./node_modules/ramda/es/internal/_curry1.js","webpack:///./node_modules/ramda/es/internal/_identity.js","webpack:///./node_modules/ramda/es/identity.js","webpack:///./node_modules/ramda/es/internal/_has.js","webpack:///./node_modules/ramda/es/internal/_isArguments.js","webpack:///./node_modules/ramda/es/keys.js","webpack:///./node_modules/ramda/es/values.js","webpack:///./node_modules/tslib/tslib.es6.js","webpack:///./node_modules/rxjs/_esm5/internal/util/isFunction.js","webpack:///./node_modules/rxjs/_esm5/internal/config.js","webpack:///./node_modules/rxjs/_esm5/internal/util/hostReportError.js","webpack:///./node_modules/rxjs/_esm5/internal/Observer.js","webpack:///./node_modules/rxjs/_esm5/internal/util/isArray.js","webpack:///./node_modules/rxjs/_esm5/internal/util/isObject.js","webpack:///./node_modules/rxjs/_esm5/internal/util/UnsubscriptionError.js","webpack:///./node_modules/rxjs/_esm5/internal/Subscription.js","webpack:///./node_modules/rxjs/_esm5/internal/symbol/rxSubscriber.js","webpack:///./node_modules/rxjs/_esm5/internal/Subscriber.js","webpack:///./node_modules/rxjs/_esm5/internal/symbol/observable.js","webpack:///./node_modules/rxjs/_esm5/internal/util/noop.js","webpack:///./node_modules/rxjs/_esm5/internal/util/pipe.js","webpack:///./node_modules/rxjs/_esm5/internal/Observable.js","webpack:///./node_modules/rxjs/_esm5/internal/util/toSubscriber.js","webpack:///./node_modules/rxjs/_esm5/internal/util/canReportError.js","webpack:///./node_modules/rxjs/_esm5/internal/util/ObjectUnsubscribedError.js","webpack:///./node_modules/rxjs/_esm5/internal/SubjectSubscription.js","webpack:///./node_modules/rxjs/_esm5/internal/Subject.js","webpack:///./node_modules/rxjs/_esm5/internal/util/isScheduler.js","webpack:///./node_modules/rxjs/_esm5/internal/util/subscribeToArray.js","webpack:///./node_modules/rxjs/_esm5/internal/scheduled/scheduleArray.js","webpack:///./node_modules/rxjs/_esm5/internal/observable/fromArray.js","webpack:///./node_modules/rxjs/_esm5/internal/observable/of.js","webpack:///./node_modules/rxjs/_esm5/internal/observable/empty.js","webpack:///./node_modules/rxjs/_esm5/internal/operators/map.js","webpack:///./node_modules/rxjs/_esm5/internal/symbol/iterator.js","webpack:///./node_modules/rxjs/_esm5/internal/util/isArrayLike.js","webpack:///./node_modules/rxjs/_esm5/internal/util/isPromise.js","webpack:///./node_modules/rxjs/_esm5/internal/util/subscribeTo.js","webpack:///./node_modules/rxjs/_esm5/internal/util/subscribeToObservable.js","webpack:///./node_modules/rxjs/_esm5/internal/util/subscribeToPromise.js","webpack:///./node_modules/rxjs/_esm5/internal/util/subscribeToIterable.js","webpack:///./node_modules/rxjs/_esm5/internal/scheduled/scheduled.js","webpack:///./node_modules/rxjs/_esm5/internal/util/isInteropObservable.js","webpack:///./node_modules/rxjs/_esm5/internal/scheduled/scheduleObservable.js","webpack:///./node_modules/rxjs/_esm5/internal/scheduled/schedulePromise.js","webpack:///./node_modules/rxjs/_esm5/internal/util/isIterable.js","webpack:///./node_modules/rxjs/_esm5/internal/scheduled/scheduleIterable.js","webpack:///./node_modules/rxjs/_esm5/internal/observable/from.js","webpack:///./node_modules/rxjs/_esm5/internal/observable/forkJoin.js","webpack:///./node_modules/rxjs/_esm5/internal/InnerSubscriber.js","webpack:///./node_modules/rxjs/_esm5/internal/util/subscribeToResult.js","webpack:///./node_modules/rxjs/_esm5/internal/OuterSubscriber.js","webpack:///./node_modules/rxjs/_esm5/internal/operators/mergeMap.js","webpack:///./node_modules/rxjs/_esm5/internal/util/identity.js","webpack:///./node_modules/rxjs/_esm5/internal/operators/mergeAll.js","webpack:///./node_modules/rxjs/_esm5/internal/observable/merge.js","webpack:///./node_modules/rxjs/_esm5/internal/observable/dom/AjaxObservable.js","webpack:///./node_modules/rxjs/_esm5/internal/observable/dom/ajax.js","webpack:///./node_modules/rxjs/_esm5/internal/operators/filter.js","webpack:///./node_modules/rxjs/_esm5/internal/operators/tap.js","webpack:///./node_modules/rxjs/_esm5/internal/operators/pluck.js","webpack:///./node_modules/rxjs/_esm5/internal/util/ArgumentOutOfRangeError.js","webpack:///./node_modules/rxjs/_esm5/internal/operators/take.js","webpack:///./node_modules/rxjs/_esm5/internal/operators/switchMap.js","webpack:///./node_modules/rxjs/_esm5/internal/Notification.js","webpack:///./node_modules/rxjs/_esm5/internal/scheduler/AsyncAction.js","webpack:///./node_modules/rxjs/_esm5/internal/scheduler/Action.js","webpack:///./node_modules/rxjs/_esm5/internal/Scheduler.js","webpack:///./node_modules/rxjs/_esm5/internal/scheduler/AsyncScheduler.js","webpack:///./node_modules/rxjs/_esm5/internal/scheduler/async.js","webpack:///./node_modules/rxjs/_esm5/internal/observable/throwError.js","webpack:///./node_modules/rxjs/_esm5/internal/operators/delay.js","webpack:///./node_modules/rxjs/_esm5/internal/util/isDate.js","webpack:///./node_modules/rxjs/_esm5/internal/operators/switchMapTo.js","webpack:///./node_modules/rxjs/_esm5/internal/observable/never.js","webpack:///./node_modules/rxjs/_esm5/internal/operators/scan.js","webpack:///./node_modules/rxjs/_esm5/internal/scheduler/QueueAction.js","webpack:///./node_modules/rxjs/_esm5/internal/scheduler/queue.js","webpack:///./node_modules/rxjs/_esm5/internal/scheduler/QueueScheduler.js","webpack:///./node_modules/rxjs/_esm5/internal/operators/observeOn.js","webpack:///./node_modules/rxjs/_esm5/internal/ReplaySubject.js","webpack:///./node_modules/rxjs/_esm5/internal/operators/shareReplay.js","webpack:///./node_modules/rxjs/_esm5/internal/observable/fromEvent.js","webpack:///./node_modules/rxjs/_esm5/internal/operators/mapTo.js","webpack:///./node_modules/rxjs/_esm5/internal/observable/concat.js","webpack:///./node_modules/rxjs/_esm5/internal/operators/concatAll.js","webpack:///./node_modules/rxjs/_esm5/internal/operators/startWith.js","webpack:///./node_modules/rxjs/_esm5/internal/operators/distinctUntilChanged.js","webpack:///./node_modules/rxjs/_esm5/internal/operators/skip.js","webpack:///./src/assets/javascripts/utilities/agent/document/index.ts","webpack:///./src/assets/javascripts/utilities/agent/element/_/index.ts","webpack:///./src/assets/javascripts/utilities/agent/element/offset/index.ts","webpack:///./node_modules/rxjs/_esm5/internal/operators/refCount.js","webpack:///./node_modules/rxjs/_esm5/internal/observable/ConnectableObservable.js","webpack:///./node_modules/rxjs/_esm5/internal/operators/multicast.js","webpack:///./node_modules/rxjs/_esm5/internal/operators/share.js","webpack:///./src/assets/javascripts/utilities/agent/location/index.ts","webpack:///./src/assets/javascripts/utilities/agent/media/index.ts","webpack:///./node_modules/rxjs/_esm5/internal/observable/fromEventPattern.js","webpack:///./src/assets/javascripts/utilities/agent/viewport/index.ts","webpack:///./node_modules/rxjs/_esm5/internal/operators/throttle.js","webpack:///./src/assets/javascripts/utilities/agent/worker/index.ts","webpack:///./node_modules/rxjs/_esm5/internal/scheduler/AnimationFrameAction.js","webpack:///./node_modules/rxjs/_esm5/internal/scheduler/animationFrame.js","webpack:///./node_modules/rxjs/_esm5/internal/scheduler/AnimationFrameScheduler.js","webpack:///./node_modules/rxjs/_esm5/internal/operators/finalize.js","webpack:///./src/assets/javascripts/utilities/string/index.ts","webpack:///./src/assets/javascripts/actions/anchor/index.ts","webpack:///./src/assets/javascripts/actions/search/result/index.ts","webpack:///./src/assets/javascripts/utilities/hidden/index.ts","webpack:///./src/assets/javascripts/actions/hidden/index.ts","webpack:///./src/assets/javascripts/components/header/_/index.ts","webpack:///./node_modules/rxjs/_esm5/internal/observable/defer.js","webpack:///./node_modules/rxjs/_esm5/internal/observable/combineLatest.js","webpack:///./src/assets/javascripts/components/header/offset/index.ts","webpack:///./src/assets/javascripts/components/header/shadow/index.ts","webpack:///./node_modules/rxjs/_esm5/internal/operators/distinctUntilKeyChanged.js","webpack:///./src/assets/javascripts/actions/header/index.ts","webpack:///./src/assets/javascripts/extensions/jsx/index.ts","webpack:///./node_modules/rxjs/_esm5/internal/operators/takeUntil.js","webpack:///./src/assets/javascripts/extensions/rxjs/operators/index.ts","webpack:///./src/assets/javascripts/components/hero/index.ts","webpack:///./src/assets/javascripts/components/main/_/index.ts","webpack:///./node_modules/ramda/es/internal/_curry2.js","webpack:///./node_modules/ramda/es/internal/_arrayFromIterator.js","webpack:///./node_modules/ramda/es/internal/_includesWith.js","webpack:///./node_modules/ramda/es/internal/_objectIs.js","webpack:///./node_modules/ramda/es/type.js","webpack:///./node_modules/ramda/es/internal/_equals.js","webpack:///./node_modules/ramda/es/internal/_functionName.js","webpack:///./node_modules/ramda/es/equals.js","webpack:///./src/assets/javascripts/components/main/sidebar/index.ts","webpack:///./src/assets/javascripts/actions/sidebar/index.ts","webpack:///./src/assets/javascripts/components/navigation/_/index.ts","webpack:///./src/assets/javascripts/components/search/query/index.ts","webpack:///./src/assets/javascripts/utilities/agent/element/focus/index.ts","webpack:///./src/assets/javascripts/components/search/reset/index.ts","webpack:///./src/assets/javascripts/templates/search/result/article/index.tsx","webpack:///./src/assets/javascripts/templates/search/result/section/index.tsx","webpack:///./src/assets/javascripts/templates/search/result/_/index.tsx","webpack:///./node_modules/rxjs/_esm5/internal/operators/withLatestFrom.js","webpack:///./src/assets/javascripts/components/search/result/meta/index.ts","webpack:///./src/assets/javascripts/components/search/result/_/index.ts","webpack:///./src/assets/javascripts/components/search/result/list/index.ts","webpack:///./src/assets/javascripts/components/tabs/index.ts","webpack:///./node_modules/ramda/es/reverse.js","webpack:///./node_modules/ramda/es/internal/_isString.js","webpack:///./node_modules/ramda/es/internal/_includes.js","webpack:///./node_modules/ramda/es/internal/_indexOf.js","webpack:///./node_modules/ramda/es/internal/_Set.js","webpack:///./node_modules/ramda/es/difference.js","webpack:///./src/assets/javascripts/workers/packer/_/index.ts","webpack:///./src/assets/javascripts/workers/search/_/index.ts","webpack:///./src/assets/javascripts/components/toc/_/index.ts","webpack:///./src/assets/javascripts/components/toc/anchor/index.ts","webpack:///./src/assets/javascripts/index.ts","webpack:///./src/assets/javascripts/utilities/agent/_/index.ts","webpack:///./src/assets/javascripts/components/_/index.ts","webpack:///./src/assets/javascripts/utilities/toggle/index.ts"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","__window","window","__self","self","WorkerGlobalScope","_root","global","g","this","Function","e","_isPlaceholder","a","_curry1","fn","f1","arguments","length","apply","_identity","x","_has","prop","obj","toString","hasEnumBug","propertyIsEnumerable","nonEnumerableProps","hasArgsEnumBug","contains","list","item","idx","keys","nIdx","ks","checkArgsLength","props","len","vals","extendStatics","b","setPrototypeOf","__proto__","Array","__extends","__","constructor","isFunction","_enable_super_gross_mode_that_will_cause_bad_things","Promise","undefined","Error","stack","hostReportError","err","setTimeout","empty","closed","next","error","useDeprecatedSynchronousErrorHandling","complete","isArray","isObject","UnsubscriptionError","UnsubscriptionErrorImpl","errors","message","map","join","Subscription","unsubscribe","_parentOrParents","_subscriptions","_unsubscribe","remove","index","flattenUnsubscriptionErrors","sub","concat","push","add","teardown","subscription","EMPTY","tmp","indexOf","subscriptions","subscriptionIndex","splice","reduce","errs","rxSubscriber","Math","random","_super","Subscriber","destinationOrNext","_this","syncErrorValue","syncErrorThrown","syncErrorThrowable","isStopped","destination","subscriber","_next","_error","_complete","_unsubscribeAndRecycle","SafeSubscriber","_parentSubscriber","observerOrNext","context","_context","__tryOrSetError","__tryOrUnsub","wrappedComplete","parent","observable","noop","pipe","fns","_i","pipeFromArray","input","prev","Observable","subscribe","_isScalar","_subscribe","lift","operator","source","sink","nextOrObserver","toSubscriber","_trySubscribe","observer","_a","closed_1","canReportError","console","warn","forEach","promiseCtor","getPromiseCtor","resolve","reject","operations","toPromise","ObjectUnsubscribedError","ObjectUnsubscribedErrorImpl","SubjectSubscription","subject","observers","subscriberIndex","SubjectSubscriber","Subject","hasError","thrownError","copy","slice","asObservable","AnonymousSubject","isScheduler","schedule","subscribeToArray","array","scheduleArray","scheduler","fromArray","of","args","pop","emptyScheduled","project","thisArg","TypeError","MapOperator","MapSubscriber","count","result","getSymbolIterator","iterator","isArrayLike","isPromise","then","subscribeTo","obs","promise","iterable","done","return","scheduled","isInteropObservable","scheduleObservable","schedulePromise","isIterable","scheduleIterable","from","forkJoinInternal","sources","values","completed","emitted","_loop_1","hasValue","InnerSubscriber","outerValue","outerIndex","notifyNext","notifyError","notifyComplete","subscribeToResult","outerSubscriber","OuterSubscriber","innerValue","innerIndex","innerSub","MergeMapOperator","concurrent","Number","POSITIVE_INFINITY","MergeMapSubscriber","hasCompleted","buffer","active","_tryNext","_innerSub","ish","innerSubscriber","shift","mergeAll","mergeMap","resultSelector","ii","merge","observables","last","ajaxGet","url","headers","method","ajaxPost","body","ajaxDelete","ajaxPut","ajaxPatch","mapResponse","response","ajaxGetJSON","responseType","AjaxObservable","urlOrRequest","request","async","createXHR","crossDomain","root","XMLHttpRequest","XDomainRequest","getCORSRequest","progId","progIds","ActiveXObject","getXMLHttpRequest","withCredentials","timeout","post","delete","put","patch","getJSON","AjaxSubscriber","getHeader","FormData","serializeBody","send","xhr","AjaxResponse","_b","user","password","setupEvents","open","setHeaders","contentType","splitIndex","substring","encodeURIComponent","JSON","stringify","setRequestHeader","headerName","toLowerCase","progressSubscriber","xhrTimeout","AjaxTimeoutError","ontimeout","upload","xhrProgress_1","xhrError_1","onprogress","AjaxError","onerror","xhrReadyStateChange","xhrLoad","readyState","status_1","status","responseText","onreadystatechange","onload","abort","originalEvent","parseXhrResponse","AjaxErrorImpl","parse","parseJson","responseXML","ajax","filter","predicate","FilterOperator","FilterSubscriber","tap","DoOperator","TapSubscriber","_tapNext","_tapError","_tapComplete","pluck","properties","currentProp","plucker","ArgumentOutOfRangeError","ArgumentOutOfRangeErrorImpl","TakeOperator","total","TakeSubscriber","switchMap","SwitchMapOperator","NotificationKind","SwitchMapSubscriber","innerSubscription","AsyncAction","work","pending","state","delay","id","recycleAsyncId","requestAsyncId","setInterval","flush","clearInterval","execute","_execute","errored","errorValue","actions","Action","Scheduler","SchedulerAction","now","Date","AsyncScheduler","delegate","action","dispatch","Notification","kind","observe","do","accept","toObservable","createNext","undefinedValueNotification","createError","createComplete","completeNotification","delayFor","isNaN","abs","DelayOperator","DelaySubscriber","queue","time","notification","delay_1","max","_schedule","scheduleNotification","DelayMessage","switchMapTo","innerObservable","NEVER","scan","accumulator","seed","hasSeed","ScanOperator","ScanSubscriber","_seed","set","configurable","QueueAction","QueueScheduler","observeOn","ObserveOnOperator","ObserveOnSubscriber","arg","scheduleMessage","ObserveOnMessage","ReplaySubject","bufferSize","windowTime","_events","_infiniteTimeWindow","_bufferSize","_windowTime","nextInfiniteTimeWindow","nextTimeWindow","ReplayEvent","_getNow","_trimBufferThenGetEvents","eventsCount","spliceCount","shareReplay","configOrBufferSize","config","refCount","_c","useRefCount","isComplete","shareReplayOperator","fromEvent","target","eventName","options","setupSubscription","sourceObj","handler","addEventListener","removeEventListener","isEventTarget","source_1","on","off","isJQueryStyleEventEmitter","source_2","addListener","removeListener","isNodeStyleEventEmitter","source_3","mapTo","MapToOperator","MapToSubscriber","concatAll","startWith","distinctUntilChanged","compare","keySelector","DistinctUntilChangedOperator","DistinctUntilChangedSubscriber","hasKey","y","load$","document","getElement","selector","node","querySelector","getElementOffset","el","scrollLeft","scrollTop","RefCountOperator","connectable","_refCount","refCounter","connection","connect","RefCountSubscriber","sharedConnection","_connection","ConnectableObservable","subjectFactory","_isComplete","getSubject","_subject","connectableObservableDescriptor","connectableProto","writable","ConnectableSubscriber","MulticastOperator","shareSubjectFactory","share","subjectOrSubjectFactory","hashchange$","popstate$","watchMedia","query","media","matchMedia","fromEventPattern","addHandler","removeHandler","retValue","matches","resize$","getViewportOffset","pageXOffset","pageYOffset","getViewportSize","width","innerWidth","height","innerHeight","defaultThrottleConfig","leading","trailing","ThrottleOperator","durationSelector","ThrottleSubscriber","_leading","_trailing","_hasValue","_sendValue","_throttled","throttle","duration","tryDurationSelector","throttlingDone","watchWorker","worker","send$","recv$","postMessage","AnimationFrameAction","requestAnimationFrame","cancelAnimationFrame","animationFrame","AnimationFrameScheduler","finalize","callback","FinallyOperator","lang","FinallySubscriber","setAnchorBlur","setAttribute","resetAnchorBlur","removeAttribute","setAnchorActive","classList","toggle","resetAnchorActive","addToSearchResultList","child","appendChild","paintHidden","offset","setHidden","resetHidden","truncate","translate","innerText","ReferenceError","replace","watchHeader","observableFactory","sticky","getComputedStyle","getPropertyValue","offsetHeight","NONE","combineLatest","CombineLatestOperator","CombineLatestSubscriber","toRespond","unused","oldVal","_tryResultSelector","watchViewportOffsetFromTopOf","viewport","header$","adjust$","size$","offsetTop","offset$","paintHeaderShadow","setHeaderShadow","resetHeaderShadow","innerHTML","Node","h","tag","attributes","createElement","attr","children","TakeUntilOperator","notifier","takeUntilSubscriber","notifierSubscription","seenValue","TakeUntilSubscriber","switchMapIf","toggle$","begin$","end$","mountHero","agent","screen$","hidden","watchHero","mountMain","height$","adjust","top","bottom","active$","watchMain","_curry2","f2","_arrayFromIterator","iter","_includesWith","pred","val","_uniqContentEquals","aIterator","bIterator","stackA","stackB","eq","_equals","aItem","f","match","typeA","equals","String","valueOf","ignoreCase","multiline","unicode","size","entries","keysA","extendedStackA","extendedStackB","watchSidebar","main$","parseFloat","parentElement","min","lock$","lock","paintSidebar","style","setSidebarHeight","setSidebarLock","resetSidebarHeight","resetSidebarLock","mountNavigation","sidebar","watchNavigation","watchSearchQuery","prepare","focus$","blur$","activeElement","watchElementFocus","focus","watchSearchReset","css","link","article","title","teaser","renderSectionDocument","location","text","href","class","tabIndex","renderSearchResult","sections","renderArticleDocument","WithLatestFromOperator","WithLatestFromSubscriber","found","_tryProject","paintSearchResultMeta","query$","meta","withLatestFrom","textContent","setSearchResultMeta","resetSearchResultMeta","watchSearchResult","result$","container","render$","watchElementOffset","scrollHeight","log","resetSearchResultList","paintSearchResultList","mountTabs","watchTabs","split","reverse","_includes","inf","_indexOf","hasOrAdd","shouldAdd","prevSize","type","Infinity","_items","_nativeSet","has","bIdx","_Set","Set","first","second","out","firstLen","secondLen","toFilterOut","PackerMessageType","SearchMessageType","watchTableOfContents","sidebar$","els","querySelectorAll","anchors$","table","Map","decodeURIComponent","hash","header","path","anchor","tagName","begin","end","watchAnchorList","paintAnchorList","anchors","isSearchDumpMessage","DUMP","isSearchResultMessage","RESULT","documentElement","newvalue","trim","setupWorkers","Worker","search","packer","packerMessage$","packer$","BINARY","data","localStorage","setItem","searchMessage$","search$","STRING","data$","base","fromLocal","getItem","first_1","getPrototypeOf","resultSelector_1","forkJoin","SETUP","initialize","isConfig","SyntaxError","location$","href$","hash$","tablet$","searchWorkerRecv$","components$","names","document$","components","replaceWith","watchComponentMap","component","switchComponent","QUERY","checked","click","navigation$","toc$","mountTableOfContents","resultComponent$","mountSearchResult","tabs$","hero$","a$","reset$","rest","temp"],"mappings":"4DACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QA0Df,OArDAF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,oBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb,EAAS,aAAc,CAAEmB,OAAO,KAQvDrB,EAAoBsB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQrB,EAAoBqB,IAC/B,EAAPE,EAAU,OAAOF,EACpB,GAAW,EAAPE,GAA8B,iBAAVF,GAAsBA,GAASA,EAAMG,WAAY,OAAOH,EAChF,IAAII,EAAKX,OAAOY,OAAO,MAGvB,GAFA1B,EAAoBkB,EAAEO,GACtBX,OAAOC,eAAeU,EAAI,UAAW,CAAET,YAAY,EAAMK,MAAOA,IACtD,EAAPE,GAA4B,iBAATF,EAAmB,IAAI,IAAIM,KAAON,EAAOrB,EAAoBU,EAAEe,EAAIE,EAAK,SAASA,GAAO,OAAON,EAAMM,IAAQC,KAAK,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U,iBAChCrqB,KblOE,SACL4e,EAAc7K,GAEd,OAAO/T,EACL4N,IAAU,SAAAsI,GAAM,OAAAmO,GAAkBnO,EAAI0I,EAAO7K,MAC7CX,GAAY,Ia8NV0X,CAAkBlM,EAAO,CAAE0F,QAAO,EAAEP,OAAQA,EAAO/jB,KAAKmN,GAAM,aAG5D4d,EAAQV,EAAU,QACrBrqB,KACC8kB,GAAUlG,EAAO,CAAE3B,QAAO,KAGxB+N,EAAQX,EAAU,QACrBrqB,KACC2e,GAAUC,EAAO,CAAE3B,QAAO,KAOxBkL,GADStS,GAA6B,2BAC7BA,GAA6B,4BAEtCoV,GG5SN/U,EH4SuBiS,EG1ShBvU,GAAUsC,EAAI,UAClBlW,KACCmN,GAAM,aHySPnN,KACCyM,GAAO,GACP,GAAM,MAGJye,EAASb,EAAU,gBACtBrqB,KACC4N,GAAU+U,KAGdvb,GAAM6jB,EAAIC,GACPlrB,KACCkR,GAAYmZ,EAA4B,iBACxCxd,IAAI,SAAAqJ,GAAM,OAAAA,EAAGwM,YAEZniB,YAIL,IAAM6N,EAAQ,CACZ+Z,OAAQ,CACNpE,OAAM,EACNO,QAASuG,EACTK,OAAM,GAER7J,MAAK,EACLqJ,YAAW,EACXC,KAAI,EACJI,MAAK,EACLC,MAAK,GAGC,IAAA7C,OAAc,mBAItB,OAHA/gB,GAAK,gBAAI,EAAO+jB,GAAU,EAAOC,KAC9B7qB,YAEI,CACLqe,MAAK,EACLxQ,MAAK","file":"bundle.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 7);\n","/** PURE_IMPORTS_START PURE_IMPORTS_END */\nvar __window = typeof window !== 'undefined' && window;\nvar __self = typeof self !== 'undefined' && typeof WorkerGlobalScope !== 'undefined' &&\n self instanceof WorkerGlobalScope && self;\nvar __global = typeof global !== 'undefined' && global;\nvar _root = __window || __global || __self;\n/*@__PURE__*/ (function () {\n if (!_root) {\n throw /*@__PURE__*/ new Error('RxJS could not find any global context (window, self, global)');\n }\n})();\nexport { _root as root };\n//# sourceMappingURL=root.js.map\n","var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || new Function(\"return this\")();\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n","export default function _isPlaceholder(a) {\n return a != null && typeof a === 'object' && a['@@functional/placeholder'] === true;\n}","import _isPlaceholder from './_isPlaceholder.js';\n\n/**\n * Optimized internal one-arity curry function.\n *\n * @private\n * @category Function\n * @param {Function} fn The function to curry.\n * @return {Function} The curried function.\n */\nexport default function _curry1(fn) {\n return function f1(a) {\n if (arguments.length === 0 || _isPlaceholder(a)) {\n return f1;\n } else {\n return fn.apply(this, arguments);\n }\n };\n}","export default function _identity(x) {\n return x;\n}","import _curry1 from './internal/_curry1.js';\nimport _identity from './internal/_identity.js';\n\n/**\n * A function that does nothing but return the parameter supplied to it. Good\n * as a default or placeholder function.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Function\n * @sig a -> a\n * @param {*} x The value to return.\n * @return {*} The input value, `x`.\n * @example\n *\n * R.identity(1); //=> 1\n *\n * const obj = {};\n * R.identity(obj) === obj; //=> true\n * @symb R.identity(a) = a\n */\nvar identity = /*#__PURE__*/_curry1(_identity);\nexport default identity;","export default function _has(prop, obj) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}","import _has from './_has.js';\n\nvar toString = Object.prototype.toString;\nvar _isArguments = /*#__PURE__*/function () {\n return toString.call(arguments) === '[object Arguments]' ? function _isArguments(x) {\n return toString.call(x) === '[object Arguments]';\n } : function _isArguments(x) {\n return _has('callee', x);\n };\n}();\n\nexport default _isArguments;","import _curry1 from './internal/_curry1.js';\nimport _has from './internal/_has.js';\nimport _isArguments from './internal/_isArguments.js';\n\n// cover IE < 9 keys issues\nvar hasEnumBug = ! /*#__PURE__*/{ toString: null }.propertyIsEnumerable('toString');\nvar nonEnumerableProps = ['constructor', 'valueOf', 'isPrototypeOf', 'toString', 'propertyIsEnumerable', 'hasOwnProperty', 'toLocaleString'];\n// Safari bug\nvar hasArgsEnumBug = /*#__PURE__*/function () {\n 'use strict';\n\n return arguments.propertyIsEnumerable('length');\n}();\n\nvar contains = function contains(list, item) {\n var idx = 0;\n while (idx < list.length) {\n if (list[idx] === item) {\n return true;\n }\n idx += 1;\n }\n return false;\n};\n\n/**\n * Returns a list containing the names of all the enumerable own properties of\n * the supplied object.\n * Note that the order of the output array is not guaranteed to be consistent\n * across different JS platforms.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Object\n * @sig {k: v} -> [k]\n * @param {Object} obj The object to extract properties from\n * @return {Array} An array of the object's own properties.\n * @see R.keysIn, R.values\n * @example\n *\n * R.keys({a: 1, b: 2, c: 3}); //=> ['a', 'b', 'c']\n */\nvar keys = typeof Object.keys === 'function' && !hasArgsEnumBug ? /*#__PURE__*/_curry1(function keys(obj) {\n return Object(obj) !== obj ? [] : Object.keys(obj);\n}) : /*#__PURE__*/_curry1(function keys(obj) {\n if (Object(obj) !== obj) {\n return [];\n }\n var prop, nIdx;\n var ks = [];\n var checkArgsLength = hasArgsEnumBug && _isArguments(obj);\n for (prop in obj) {\n if (_has(prop, obj) && (!checkArgsLength || prop !== 'length')) {\n ks[ks.length] = prop;\n }\n }\n if (hasEnumBug) {\n nIdx = nonEnumerableProps.length - 1;\n while (nIdx >= 0) {\n prop = nonEnumerableProps[nIdx];\n if (_has(prop, obj) && !contains(ks, prop)) {\n ks[ks.length] = prop;\n }\n nIdx -= 1;\n }\n }\n return ks;\n});\nexport default keys;","import _curry1 from './internal/_curry1.js';\nimport keys from './keys.js';\n\n/**\n * Returns a list of all the enumerable own properties of the supplied object.\n * Note that the order of the output array is not guaranteed across different\n * JS platforms.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Object\n * @sig {k: v} -> [v]\n * @param {Object} obj The object to extract values from\n * @return {Array} An array of the values of the object's own properties.\n * @see R.valuesIn, R.keys\n * @example\n *\n * R.values({a: 1, b: 2, c: 3}); //=> [1, 2, 3]\n */\nvar values = /*#__PURE__*/_curry1(function values(obj) {\n var props = keys(obj);\n var len = props.length;\n var vals = [];\n var idx = 0;\n while (idx < len) {\n vals[idx] = obj[props[idx]];\n idx += 1;\n }\n return vals;\n});\nexport default values;","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)\r\n t[p[i]] = s[p[i]];\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator], i = 0;\r\n if (m) return m.call(o);\r\n return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n","/** PURE_IMPORTS_START PURE_IMPORTS_END */\nexport function isFunction(x) {\n return typeof x === 'function';\n}\n//# sourceMappingURL=isFunction.js.map\n","/** PURE_IMPORTS_START PURE_IMPORTS_END */\nvar _enable_super_gross_mode_that_will_cause_bad_things = false;\nexport var config = {\n Promise: undefined,\n set useDeprecatedSynchronousErrorHandling(value) {\n if (value) {\n var error = /*@__PURE__*/ new Error();\n /*@__PURE__*/ console.warn('DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at: \\n' + error.stack);\n }\n else if (_enable_super_gross_mode_that_will_cause_bad_things) {\n /*@__PURE__*/ console.log('RxJS: Back to a better error behavior. Thank you. <3');\n }\n _enable_super_gross_mode_that_will_cause_bad_things = value;\n },\n get useDeprecatedSynchronousErrorHandling() {\n return _enable_super_gross_mode_that_will_cause_bad_things;\n },\n};\n//# sourceMappingURL=config.js.map\n","/** PURE_IMPORTS_START PURE_IMPORTS_END */\nexport function hostReportError(err) {\n setTimeout(function () { throw err; }, 0);\n}\n//# sourceMappingURL=hostReportError.js.map\n","/** PURE_IMPORTS_START _config,_util_hostReportError PURE_IMPORTS_END */\nimport { config } from './config';\nimport { hostReportError } from './util/hostReportError';\nexport var empty = {\n closed: true,\n next: function (value) { },\n error: function (err) {\n if (config.useDeprecatedSynchronousErrorHandling) {\n throw err;\n }\n else {\n hostReportError(err);\n }\n },\n complete: function () { }\n};\n//# sourceMappingURL=Observer.js.map\n","/** PURE_IMPORTS_START PURE_IMPORTS_END */\nexport var isArray = /*@__PURE__*/ (function () { return Array.isArray || (function (x) { return x && typeof x.length === 'number'; }); })();\n//# sourceMappingURL=isArray.js.map\n","/** PURE_IMPORTS_START PURE_IMPORTS_END */\nexport function isObject(x) {\n return x !== null && typeof x === 'object';\n}\n//# sourceMappingURL=isObject.js.map\n","/** PURE_IMPORTS_START PURE_IMPORTS_END */\nvar UnsubscriptionErrorImpl = /*@__PURE__*/ (function () {\n function UnsubscriptionErrorImpl(errors) {\n Error.call(this);\n this.message = errors ?\n errors.length + \" errors occurred during unsubscription:\\n\" + errors.map(function (err, i) { return i + 1 + \") \" + err.toString(); }).join('\\n ') : '';\n this.name = 'UnsubscriptionError';\n this.errors = errors;\n return this;\n }\n UnsubscriptionErrorImpl.prototype = /*@__PURE__*/ Object.create(Error.prototype);\n return UnsubscriptionErrorImpl;\n})();\nexport var UnsubscriptionError = UnsubscriptionErrorImpl;\n//# sourceMappingURL=UnsubscriptionError.js.map\n","/** PURE_IMPORTS_START _util_isArray,_util_isObject,_util_isFunction,_util_UnsubscriptionError PURE_IMPORTS_END */\nimport { isArray } from './util/isArray';\nimport { isObject } from './util/isObject';\nimport { isFunction } from './util/isFunction';\nimport { UnsubscriptionError } from './util/UnsubscriptionError';\nvar Subscription = /*@__PURE__*/ (function () {\n function Subscription(unsubscribe) {\n this.closed = false;\n this._parentOrParents = null;\n this._subscriptions = null;\n if (unsubscribe) {\n this._unsubscribe = unsubscribe;\n }\n }\n Subscription.prototype.unsubscribe = function () {\n var errors;\n if (this.closed) {\n return;\n }\n var _a = this, _parentOrParents = _a._parentOrParents, _unsubscribe = _a._unsubscribe, _subscriptions = _a._subscriptions;\n this.closed = true;\n this._parentOrParents = null;\n this._subscriptions = null;\n if (_parentOrParents instanceof Subscription) {\n _parentOrParents.remove(this);\n }\n else if (_parentOrParents !== null) {\n for (var index = 0; index < _parentOrParents.length; ++index) {\n var parent_1 = _parentOrParents[index];\n parent_1.remove(this);\n }\n }\n if (isFunction(_unsubscribe)) {\n try {\n _unsubscribe.call(this);\n }\n catch (e) {\n errors = e instanceof UnsubscriptionError ? flattenUnsubscriptionErrors(e.errors) : [e];\n }\n }\n if (isArray(_subscriptions)) {\n var index = -1;\n var len = _subscriptions.length;\n while (++index < len) {\n var sub = _subscriptions[index];\n if (isObject(sub)) {\n try {\n sub.unsubscribe();\n }\n catch (e) {\n errors = errors || [];\n if (e instanceof UnsubscriptionError) {\n errors = errors.concat(flattenUnsubscriptionErrors(e.errors));\n }\n else {\n errors.push(e);\n }\n }\n }\n }\n }\n if (errors) {\n throw new UnsubscriptionError(errors);\n }\n };\n Subscription.prototype.add = function (teardown) {\n var subscription = teardown;\n if (!teardown) {\n return Subscription.EMPTY;\n }\n switch (typeof teardown) {\n case 'function':\n subscription = new Subscription(teardown);\n case 'object':\n if (subscription === this || subscription.closed || typeof subscription.unsubscribe !== 'function') {\n return subscription;\n }\n else if (this.closed) {\n subscription.unsubscribe();\n return subscription;\n }\n else if (!(subscription instanceof Subscription)) {\n var tmp = subscription;\n subscription = new Subscription();\n subscription._subscriptions = [tmp];\n }\n break;\n default: {\n throw new Error('unrecognized teardown ' + teardown + ' added to Subscription.');\n }\n }\n var _parentOrParents = subscription._parentOrParents;\n if (_parentOrParents === null) {\n subscription._parentOrParents = this;\n }\n else if (_parentOrParents instanceof Subscription) {\n if (_parentOrParents === this) {\n return subscription;\n }\n subscription._parentOrParents = [_parentOrParents, this];\n }\n else if (_parentOrParents.indexOf(this) === -1) {\n _parentOrParents.push(this);\n }\n else {\n return subscription;\n }\n var subscriptions = this._subscriptions;\n if (subscriptions === null) {\n this._subscriptions = [subscription];\n }\n else {\n subscriptions.push(subscription);\n }\n return subscription;\n };\n Subscription.prototype.remove = function (subscription) {\n var subscriptions = this._subscriptions;\n if (subscriptions) {\n var subscriptionIndex = subscriptions.indexOf(subscription);\n if (subscriptionIndex !== -1) {\n subscriptions.splice(subscriptionIndex, 1);\n }\n }\n };\n Subscription.EMPTY = (function (empty) {\n empty.closed = true;\n return empty;\n }(new Subscription()));\n return Subscription;\n}());\nexport { Subscription };\nfunction flattenUnsubscriptionErrors(errors) {\n return errors.reduce(function (errs, err) { return errs.concat((err instanceof UnsubscriptionError) ? err.errors : err); }, []);\n}\n//# sourceMappingURL=Subscription.js.map\n","/** PURE_IMPORTS_START PURE_IMPORTS_END */\nexport var rxSubscriber = /*@__PURE__*/ (function () {\n return typeof Symbol === 'function'\n ? /*@__PURE__*/ Symbol('rxSubscriber')\n : '@@rxSubscriber_' + /*@__PURE__*/ Math.random();\n})();\nexport var $$rxSubscriber = rxSubscriber;\n//# sourceMappingURL=rxSubscriber.js.map\n","/** PURE_IMPORTS_START tslib,_util_isFunction,_Observer,_Subscription,_internal_symbol_rxSubscriber,_config,_util_hostReportError PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { isFunction } from './util/isFunction';\nimport { empty as emptyObserver } from './Observer';\nimport { Subscription } from './Subscription';\nimport { rxSubscriber as rxSubscriberSymbol } from '../internal/symbol/rxSubscriber';\nimport { config } from './config';\nimport { hostReportError } from './util/hostReportError';\nvar Subscriber = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(Subscriber, _super);\n function Subscriber(destinationOrNext, error, complete) {\n var _this = _super.call(this) || this;\n _this.syncErrorValue = null;\n _this.syncErrorThrown = false;\n _this.syncErrorThrowable = false;\n _this.isStopped = false;\n switch (arguments.length) {\n case 0:\n _this.destination = emptyObserver;\n break;\n case 1:\n if (!destinationOrNext) {\n _this.destination = emptyObserver;\n break;\n }\n if (typeof destinationOrNext === 'object') {\n if (destinationOrNext instanceof Subscriber) {\n _this.syncErrorThrowable = destinationOrNext.syncErrorThrowable;\n _this.destination = destinationOrNext;\n destinationOrNext.add(_this);\n }\n else {\n _this.syncErrorThrowable = true;\n _this.destination = new SafeSubscriber(_this, destinationOrNext);\n }\n break;\n }\n default:\n _this.syncErrorThrowable = true;\n _this.destination = new SafeSubscriber(_this, destinationOrNext, error, complete);\n break;\n }\n return _this;\n }\n Subscriber.prototype[rxSubscriberSymbol] = function () { return this; };\n Subscriber.create = function (next, error, complete) {\n var subscriber = new Subscriber(next, error, complete);\n subscriber.syncErrorThrowable = false;\n return subscriber;\n };\n Subscriber.prototype.next = function (value) {\n if (!this.isStopped) {\n this._next(value);\n }\n };\n Subscriber.prototype.error = function (err) {\n if (!this.isStopped) {\n this.isStopped = true;\n this._error(err);\n }\n };\n Subscriber.prototype.complete = function () {\n if (!this.isStopped) {\n this.isStopped = true;\n this._complete();\n }\n };\n Subscriber.prototype.unsubscribe = function () {\n if (this.closed) {\n return;\n }\n this.isStopped = true;\n _super.prototype.unsubscribe.call(this);\n };\n Subscriber.prototype._next = function (value) {\n this.destination.next(value);\n };\n Subscriber.prototype._error = function (err) {\n this.destination.error(err);\n this.unsubscribe();\n };\n Subscriber.prototype._complete = function () {\n this.destination.complete();\n this.unsubscribe();\n };\n Subscriber.prototype._unsubscribeAndRecycle = function () {\n var _parentOrParents = this._parentOrParents;\n this._parentOrParents = null;\n this.unsubscribe();\n this.closed = false;\n this.isStopped = false;\n this._parentOrParents = _parentOrParents;\n return this;\n };\n return Subscriber;\n}(Subscription));\nexport { Subscriber };\nvar SafeSubscriber = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(SafeSubscriber, _super);\n function SafeSubscriber(_parentSubscriber, observerOrNext, error, complete) {\n var _this = _super.call(this) || this;\n _this._parentSubscriber = _parentSubscriber;\n var next;\n var context = _this;\n if (isFunction(observerOrNext)) {\n next = observerOrNext;\n }\n else if (observerOrNext) {\n next = observerOrNext.next;\n error = observerOrNext.error;\n complete = observerOrNext.complete;\n if (observerOrNext !== emptyObserver) {\n context = Object.create(observerOrNext);\n if (isFunction(context.unsubscribe)) {\n _this.add(context.unsubscribe.bind(context));\n }\n context.unsubscribe = _this.unsubscribe.bind(_this);\n }\n }\n _this._context = context;\n _this._next = next;\n _this._error = error;\n _this._complete = complete;\n return _this;\n }\n SafeSubscriber.prototype.next = function (value) {\n if (!this.isStopped && this._next) {\n var _parentSubscriber = this._parentSubscriber;\n if (!config.useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) {\n this.__tryOrUnsub(this._next, value);\n }\n else if (this.__tryOrSetError(_parentSubscriber, this._next, value)) {\n this.unsubscribe();\n }\n }\n };\n SafeSubscriber.prototype.error = function (err) {\n if (!this.isStopped) {\n var _parentSubscriber = this._parentSubscriber;\n var useDeprecatedSynchronousErrorHandling = config.useDeprecatedSynchronousErrorHandling;\n if (this._error) {\n if (!useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) {\n this.__tryOrUnsub(this._error, err);\n this.unsubscribe();\n }\n else {\n this.__tryOrSetError(_parentSubscriber, this._error, err);\n this.unsubscribe();\n }\n }\n else if (!_parentSubscriber.syncErrorThrowable) {\n this.unsubscribe();\n if (useDeprecatedSynchronousErrorHandling) {\n throw err;\n }\n hostReportError(err);\n }\n else {\n if (useDeprecatedSynchronousErrorHandling) {\n _parentSubscriber.syncErrorValue = err;\n _parentSubscriber.syncErrorThrown = true;\n }\n else {\n hostReportError(err);\n }\n this.unsubscribe();\n }\n }\n };\n SafeSubscriber.prototype.complete = function () {\n var _this = this;\n if (!this.isStopped) {\n var _parentSubscriber = this._parentSubscriber;\n if (this._complete) {\n var wrappedComplete = function () { return _this._complete.call(_this._context); };\n if (!config.useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) {\n this.__tryOrUnsub(wrappedComplete);\n this.unsubscribe();\n }\n else {\n this.__tryOrSetError(_parentSubscriber, wrappedComplete);\n this.unsubscribe();\n }\n }\n else {\n this.unsubscribe();\n }\n }\n };\n SafeSubscriber.prototype.__tryOrUnsub = function (fn, value) {\n try {\n fn.call(this._context, value);\n }\n catch (err) {\n this.unsubscribe();\n if (config.useDeprecatedSynchronousErrorHandling) {\n throw err;\n }\n else {\n hostReportError(err);\n }\n }\n };\n SafeSubscriber.prototype.__tryOrSetError = function (parent, fn, value) {\n if (!config.useDeprecatedSynchronousErrorHandling) {\n throw new Error('bad call');\n }\n try {\n fn.call(this._context, value);\n }\n catch (err) {\n if (config.useDeprecatedSynchronousErrorHandling) {\n parent.syncErrorValue = err;\n parent.syncErrorThrown = true;\n return true;\n }\n else {\n hostReportError(err);\n return true;\n }\n }\n return false;\n };\n SafeSubscriber.prototype._unsubscribe = function () {\n var _parentSubscriber = this._parentSubscriber;\n this._context = null;\n this._parentSubscriber = null;\n _parentSubscriber.unsubscribe();\n };\n return SafeSubscriber;\n}(Subscriber));\nexport { SafeSubscriber };\n//# sourceMappingURL=Subscriber.js.map\n","/** PURE_IMPORTS_START PURE_IMPORTS_END */\nexport var observable = /*@__PURE__*/ (function () { return typeof Symbol === 'function' && Symbol.observable || '@@observable'; })();\n//# sourceMappingURL=observable.js.map\n","/** PURE_IMPORTS_START PURE_IMPORTS_END */\nexport function noop() { }\n//# sourceMappingURL=noop.js.map\n","/** PURE_IMPORTS_START _noop PURE_IMPORTS_END */\nimport { noop } from './noop';\nexport function pipe() {\n var fns = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n fns[_i] = arguments[_i];\n }\n return pipeFromArray(fns);\n}\nexport function pipeFromArray(fns) {\n if (!fns) {\n return noop;\n }\n if (fns.length === 1) {\n return fns[0];\n }\n return function piped(input) {\n return fns.reduce(function (prev, fn) { return fn(prev); }, input);\n };\n}\n//# sourceMappingURL=pipe.js.map\n","/** PURE_IMPORTS_START _util_canReportError,_util_toSubscriber,_symbol_observable,_util_pipe,_config PURE_IMPORTS_END */\nimport { canReportError } from './util/canReportError';\nimport { toSubscriber } from './util/toSubscriber';\nimport { observable as Symbol_observable } from './symbol/observable';\nimport { pipeFromArray } from './util/pipe';\nimport { config } from './config';\nvar Observable = /*@__PURE__*/ (function () {\n function Observable(subscribe) {\n this._isScalar = false;\n if (subscribe) {\n this._subscribe = subscribe;\n }\n }\n Observable.prototype.lift = function (operator) {\n var observable = new Observable();\n observable.source = this;\n observable.operator = operator;\n return observable;\n };\n Observable.prototype.subscribe = function (observerOrNext, error, complete) {\n var operator = this.operator;\n var sink = toSubscriber(observerOrNext, error, complete);\n if (operator) {\n sink.add(operator.call(sink, this.source));\n }\n else {\n sink.add(this.source || (config.useDeprecatedSynchronousErrorHandling && !sink.syncErrorThrowable) ?\n this._subscribe(sink) :\n this._trySubscribe(sink));\n }\n if (config.useDeprecatedSynchronousErrorHandling) {\n if (sink.syncErrorThrowable) {\n sink.syncErrorThrowable = false;\n if (sink.syncErrorThrown) {\n throw sink.syncErrorValue;\n }\n }\n }\n return sink;\n };\n Observable.prototype._trySubscribe = function (sink) {\n try {\n return this._subscribe(sink);\n }\n catch (err) {\n if (config.useDeprecatedSynchronousErrorHandling) {\n sink.syncErrorThrown = true;\n sink.syncErrorValue = err;\n }\n if (canReportError(sink)) {\n sink.error(err);\n }\n else {\n console.warn(err);\n }\n }\n };\n Observable.prototype.forEach = function (next, promiseCtor) {\n var _this = this;\n promiseCtor = getPromiseCtor(promiseCtor);\n return new promiseCtor(function (resolve, reject) {\n var subscription;\n subscription = _this.subscribe(function (value) {\n try {\n next(value);\n }\n catch (err) {\n reject(err);\n if (subscription) {\n subscription.unsubscribe();\n }\n }\n }, reject, resolve);\n });\n };\n Observable.prototype._subscribe = function (subscriber) {\n var source = this.source;\n return source && source.subscribe(subscriber);\n };\n Observable.prototype[Symbol_observable] = function () {\n return this;\n };\n Observable.prototype.pipe = function () {\n var operations = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n operations[_i] = arguments[_i];\n }\n if (operations.length === 0) {\n return this;\n }\n return pipeFromArray(operations)(this);\n };\n Observable.prototype.toPromise = function (promiseCtor) {\n var _this = this;\n promiseCtor = getPromiseCtor(promiseCtor);\n return new promiseCtor(function (resolve, reject) {\n var value;\n _this.subscribe(function (x) { return value = x; }, function (err) { return reject(err); }, function () { return resolve(value); });\n });\n };\n Observable.create = function (subscribe) {\n return new Observable(subscribe);\n };\n return Observable;\n}());\nexport { Observable };\nfunction getPromiseCtor(promiseCtor) {\n if (!promiseCtor) {\n promiseCtor = config.Promise || Promise;\n }\n if (!promiseCtor) {\n throw new Error('no Promise impl found');\n }\n return promiseCtor;\n}\n//# sourceMappingURL=Observable.js.map\n","/** PURE_IMPORTS_START _Subscriber,_symbol_rxSubscriber,_Observer PURE_IMPORTS_END */\nimport { Subscriber } from '../Subscriber';\nimport { rxSubscriber as rxSubscriberSymbol } from '../symbol/rxSubscriber';\nimport { empty as emptyObserver } from '../Observer';\nexport function toSubscriber(nextOrObserver, error, complete) {\n if (nextOrObserver) {\n if (nextOrObserver instanceof Subscriber) {\n return nextOrObserver;\n }\n if (nextOrObserver[rxSubscriberSymbol]) {\n return nextOrObserver[rxSubscriberSymbol]();\n }\n }\n if (!nextOrObserver && !error && !complete) {\n return new Subscriber(emptyObserver);\n }\n return new Subscriber(nextOrObserver, error, complete);\n}\n//# sourceMappingURL=toSubscriber.js.map\n","/** PURE_IMPORTS_START _Subscriber PURE_IMPORTS_END */\nimport { Subscriber } from '../Subscriber';\nexport function canReportError(observer) {\n while (observer) {\n var _a = observer, closed_1 = _a.closed, destination = _a.destination, isStopped = _a.isStopped;\n if (closed_1 || isStopped) {\n return false;\n }\n else if (destination && destination instanceof Subscriber) {\n observer = destination;\n }\n else {\n observer = null;\n }\n }\n return true;\n}\n//# sourceMappingURL=canReportError.js.map\n","/** PURE_IMPORTS_START PURE_IMPORTS_END */\nvar ObjectUnsubscribedErrorImpl = /*@__PURE__*/ (function () {\n function ObjectUnsubscribedErrorImpl() {\n Error.call(this);\n this.message = 'object unsubscribed';\n this.name = 'ObjectUnsubscribedError';\n return this;\n }\n ObjectUnsubscribedErrorImpl.prototype = /*@__PURE__*/ Object.create(Error.prototype);\n return ObjectUnsubscribedErrorImpl;\n})();\nexport var ObjectUnsubscribedError = ObjectUnsubscribedErrorImpl;\n//# sourceMappingURL=ObjectUnsubscribedError.js.map\n","/** PURE_IMPORTS_START tslib,_Subscription PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { Subscription } from './Subscription';\nvar SubjectSubscription = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(SubjectSubscription, _super);\n function SubjectSubscription(subject, subscriber) {\n var _this = _super.call(this) || this;\n _this.subject = subject;\n _this.subscriber = subscriber;\n _this.closed = false;\n return _this;\n }\n SubjectSubscription.prototype.unsubscribe = function () {\n if (this.closed) {\n return;\n }\n this.closed = true;\n var subject = this.subject;\n var observers = subject.observers;\n this.subject = null;\n if (!observers || observers.length === 0 || subject.isStopped || subject.closed) {\n return;\n }\n var subscriberIndex = observers.indexOf(this.subscriber);\n if (subscriberIndex !== -1) {\n observers.splice(subscriberIndex, 1);\n }\n };\n return SubjectSubscription;\n}(Subscription));\nexport { SubjectSubscription };\n//# sourceMappingURL=SubjectSubscription.js.map\n","/** PURE_IMPORTS_START tslib,_Observable,_Subscriber,_Subscription,_util_ObjectUnsubscribedError,_SubjectSubscription,_internal_symbol_rxSubscriber PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { Observable } from './Observable';\nimport { Subscriber } from './Subscriber';\nimport { Subscription } from './Subscription';\nimport { ObjectUnsubscribedError } from './util/ObjectUnsubscribedError';\nimport { SubjectSubscription } from './SubjectSubscription';\nimport { rxSubscriber as rxSubscriberSymbol } from '../internal/symbol/rxSubscriber';\nvar SubjectSubscriber = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(SubjectSubscriber, _super);\n function SubjectSubscriber(destination) {\n var _this = _super.call(this, destination) || this;\n _this.destination = destination;\n return _this;\n }\n return SubjectSubscriber;\n}(Subscriber));\nexport { SubjectSubscriber };\nvar Subject = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(Subject, _super);\n function Subject() {\n var _this = _super.call(this) || this;\n _this.observers = [];\n _this.closed = false;\n _this.isStopped = false;\n _this.hasError = false;\n _this.thrownError = null;\n return _this;\n }\n Subject.prototype[rxSubscriberSymbol] = function () {\n return new SubjectSubscriber(this);\n };\n Subject.prototype.lift = function (operator) {\n var subject = new AnonymousSubject(this, this);\n subject.operator = operator;\n return subject;\n };\n Subject.prototype.next = function (value) {\n if (this.closed) {\n throw new ObjectUnsubscribedError();\n }\n if (!this.isStopped) {\n var observers = this.observers;\n var len = observers.length;\n var copy = observers.slice();\n for (var i = 0; i < len; i++) {\n copy[i].next(value);\n }\n }\n };\n Subject.prototype.error = function (err) {\n if (this.closed) {\n throw new ObjectUnsubscribedError();\n }\n this.hasError = true;\n this.thrownError = err;\n this.isStopped = true;\n var observers = this.observers;\n var len = observers.length;\n var copy = observers.slice();\n for (var i = 0; i < len; i++) {\n copy[i].error(err);\n }\n this.observers.length = 0;\n };\n Subject.prototype.complete = function () {\n if (this.closed) {\n throw new ObjectUnsubscribedError();\n }\n this.isStopped = true;\n var observers = this.observers;\n var len = observers.length;\n var copy = observers.slice();\n for (var i = 0; i < len; i++) {\n copy[i].complete();\n }\n this.observers.length = 0;\n };\n Subject.prototype.unsubscribe = function () {\n this.isStopped = true;\n this.closed = true;\n this.observers = null;\n };\n Subject.prototype._trySubscribe = function (subscriber) {\n if (this.closed) {\n throw new ObjectUnsubscribedError();\n }\n else {\n return _super.prototype._trySubscribe.call(this, subscriber);\n }\n };\n Subject.prototype._subscribe = function (subscriber) {\n if (this.closed) {\n throw new ObjectUnsubscribedError();\n }\n else if (this.hasError) {\n subscriber.error(this.thrownError);\n return Subscription.EMPTY;\n }\n else if (this.isStopped) {\n subscriber.complete();\n return Subscription.EMPTY;\n }\n else {\n this.observers.push(subscriber);\n return new SubjectSubscription(this, subscriber);\n }\n };\n Subject.prototype.asObservable = function () {\n var observable = new Observable();\n observable.source = this;\n return observable;\n };\n Subject.create = function (destination, source) {\n return new AnonymousSubject(destination, source);\n };\n return Subject;\n}(Observable));\nexport { Subject };\nvar AnonymousSubject = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(AnonymousSubject, _super);\n function AnonymousSubject(destination, source) {\n var _this = _super.call(this) || this;\n _this.destination = destination;\n _this.source = source;\n return _this;\n }\n AnonymousSubject.prototype.next = function (value) {\n var destination = this.destination;\n if (destination && destination.next) {\n destination.next(value);\n }\n };\n AnonymousSubject.prototype.error = function (err) {\n var destination = this.destination;\n if (destination && destination.error) {\n this.destination.error(err);\n }\n };\n AnonymousSubject.prototype.complete = function () {\n var destination = this.destination;\n if (destination && destination.complete) {\n this.destination.complete();\n }\n };\n AnonymousSubject.prototype._subscribe = function (subscriber) {\n var source = this.source;\n if (source) {\n return this.source.subscribe(subscriber);\n }\n else {\n return Subscription.EMPTY;\n }\n };\n return AnonymousSubject;\n}(Subject));\nexport { AnonymousSubject };\n//# sourceMappingURL=Subject.js.map\n","/** PURE_IMPORTS_START PURE_IMPORTS_END */\nexport function isScheduler(value) {\n return value && typeof value.schedule === 'function';\n}\n//# sourceMappingURL=isScheduler.js.map\n","/** PURE_IMPORTS_START PURE_IMPORTS_END */\nexport var subscribeToArray = function (array) {\n return function (subscriber) {\n for (var i = 0, len = array.length; i < len && !subscriber.closed; i++) {\n subscriber.next(array[i]);\n }\n subscriber.complete();\n };\n};\n//# sourceMappingURL=subscribeToArray.js.map\n","/** PURE_IMPORTS_START _Observable,_Subscription PURE_IMPORTS_END */\nimport { Observable } from '../Observable';\nimport { Subscription } from '../Subscription';\nexport function scheduleArray(input, scheduler) {\n return new Observable(function (subscriber) {\n var sub = new Subscription();\n var i = 0;\n sub.add(scheduler.schedule(function () {\n if (i === input.length) {\n subscriber.complete();\n return;\n }\n subscriber.next(input[i++]);\n if (!subscriber.closed) {\n sub.add(this.schedule());\n }\n }));\n return sub;\n });\n}\n//# sourceMappingURL=scheduleArray.js.map\n","/** PURE_IMPORTS_START _Observable,_util_subscribeToArray,_scheduled_scheduleArray PURE_IMPORTS_END */\nimport { Observable } from '../Observable';\nimport { subscribeToArray } from '../util/subscribeToArray';\nimport { scheduleArray } from '../scheduled/scheduleArray';\nexport function fromArray(input, scheduler) {\n if (!scheduler) {\n return new Observable(subscribeToArray(input));\n }\n else {\n return scheduleArray(input, scheduler);\n }\n}\n//# sourceMappingURL=fromArray.js.map\n","/** PURE_IMPORTS_START _util_isScheduler,_fromArray,_scheduled_scheduleArray PURE_IMPORTS_END */\nimport { isScheduler } from '../util/isScheduler';\nimport { fromArray } from './fromArray';\nimport { scheduleArray } from '../scheduled/scheduleArray';\nexport function of() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var scheduler = args[args.length - 1];\n if (isScheduler(scheduler)) {\n args.pop();\n return scheduleArray(args, scheduler);\n }\n else {\n return fromArray(args);\n }\n}\n//# sourceMappingURL=of.js.map\n","/** PURE_IMPORTS_START _Observable PURE_IMPORTS_END */\nimport { Observable } from '../Observable';\nexport var EMPTY = /*@__PURE__*/ new Observable(function (subscriber) { return subscriber.complete(); });\nexport function empty(scheduler) {\n return scheduler ? emptyScheduled(scheduler) : EMPTY;\n}\nfunction emptyScheduled(scheduler) {\n return new Observable(function (subscriber) { return scheduler.schedule(function () { return subscriber.complete(); }); });\n}\n//# sourceMappingURL=empty.js.map\n","/** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { Subscriber } from '../Subscriber';\nexport function map(project, thisArg) {\n return function mapOperation(source) {\n if (typeof project !== 'function') {\n throw new TypeError('argument is not a function. Are you looking for `mapTo()`?');\n }\n return source.lift(new MapOperator(project, thisArg));\n };\n}\nvar MapOperator = /*@__PURE__*/ (function () {\n function MapOperator(project, thisArg) {\n this.project = project;\n this.thisArg = thisArg;\n }\n MapOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new MapSubscriber(subscriber, this.project, this.thisArg));\n };\n return MapOperator;\n}());\nexport { MapOperator };\nvar MapSubscriber = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(MapSubscriber, _super);\n function MapSubscriber(destination, project, thisArg) {\n var _this = _super.call(this, destination) || this;\n _this.project = project;\n _this.count = 0;\n _this.thisArg = thisArg || _this;\n return _this;\n }\n MapSubscriber.prototype._next = function (value) {\n var result;\n try {\n result = this.project.call(this.thisArg, value, this.count++);\n }\n catch (err) {\n this.destination.error(err);\n return;\n }\n this.destination.next(result);\n };\n return MapSubscriber;\n}(Subscriber));\n//# sourceMappingURL=map.js.map\n","/** PURE_IMPORTS_START PURE_IMPORTS_END */\nexport function getSymbolIterator() {\n if (typeof Symbol !== 'function' || !Symbol.iterator) {\n return '@@iterator';\n }\n return Symbol.iterator;\n}\nexport var iterator = /*@__PURE__*/ getSymbolIterator();\nexport var $$iterator = iterator;\n//# sourceMappingURL=iterator.js.map\n","/** PURE_IMPORTS_START PURE_IMPORTS_END */\nexport var isArrayLike = (function (x) { return x && typeof x.length === 'number' && typeof x !== 'function'; });\n//# sourceMappingURL=isArrayLike.js.map\n","/** PURE_IMPORTS_START PURE_IMPORTS_END */\nexport function isPromise(value) {\n return !!value && typeof value.subscribe !== 'function' && typeof value.then === 'function';\n}\n//# sourceMappingURL=isPromise.js.map\n","/** PURE_IMPORTS_START _subscribeToArray,_subscribeToPromise,_subscribeToIterable,_subscribeToObservable,_isArrayLike,_isPromise,_isObject,_symbol_iterator,_symbol_observable PURE_IMPORTS_END */\nimport { subscribeToArray } from './subscribeToArray';\nimport { subscribeToPromise } from './subscribeToPromise';\nimport { subscribeToIterable } from './subscribeToIterable';\nimport { subscribeToObservable } from './subscribeToObservable';\nimport { isArrayLike } from './isArrayLike';\nimport { isPromise } from './isPromise';\nimport { isObject } from './isObject';\nimport { iterator as Symbol_iterator } from '../symbol/iterator';\nimport { observable as Symbol_observable } from '../symbol/observable';\nexport var subscribeTo = function (result) {\n if (!!result && typeof result[Symbol_observable] === 'function') {\n return subscribeToObservable(result);\n }\n else if (isArrayLike(result)) {\n return subscribeToArray(result);\n }\n else if (isPromise(result)) {\n return subscribeToPromise(result);\n }\n else if (!!result && typeof result[Symbol_iterator] === 'function') {\n return subscribeToIterable(result);\n }\n else {\n var value = isObject(result) ? 'an invalid object' : \"'\" + result + \"'\";\n var msg = \"You provided \" + value + \" where a stream was expected.\"\n + ' You can provide an Observable, Promise, Array, or Iterable.';\n throw new TypeError(msg);\n }\n};\n//# sourceMappingURL=subscribeTo.js.map\n","/** PURE_IMPORTS_START _symbol_observable PURE_IMPORTS_END */\nimport { observable as Symbol_observable } from '../symbol/observable';\nexport var subscribeToObservable = function (obj) {\n return function (subscriber) {\n var obs = obj[Symbol_observable]();\n if (typeof obs.subscribe !== 'function') {\n throw new TypeError('Provided object does not correctly implement Symbol.observable');\n }\n else {\n return obs.subscribe(subscriber);\n }\n };\n};\n//# sourceMappingURL=subscribeToObservable.js.map\n","/** PURE_IMPORTS_START _hostReportError PURE_IMPORTS_END */\nimport { hostReportError } from './hostReportError';\nexport var subscribeToPromise = function (promise) {\n return function (subscriber) {\n promise.then(function (value) {\n if (!subscriber.closed) {\n subscriber.next(value);\n subscriber.complete();\n }\n }, function (err) { return subscriber.error(err); })\n .then(null, hostReportError);\n return subscriber;\n };\n};\n//# sourceMappingURL=subscribeToPromise.js.map\n","/** PURE_IMPORTS_START _symbol_iterator PURE_IMPORTS_END */\nimport { iterator as Symbol_iterator } from '../symbol/iterator';\nexport var subscribeToIterable = function (iterable) {\n return function (subscriber) {\n var iterator = iterable[Symbol_iterator]();\n do {\n var item = iterator.next();\n if (item.done) {\n subscriber.complete();\n break;\n }\n subscriber.next(item.value);\n if (subscriber.closed) {\n break;\n }\n } while (true);\n if (typeof iterator.return === 'function') {\n subscriber.add(function () {\n if (iterator.return) {\n iterator.return();\n }\n });\n }\n return subscriber;\n };\n};\n//# sourceMappingURL=subscribeToIterable.js.map\n","/** PURE_IMPORTS_START _scheduleObservable,_schedulePromise,_scheduleArray,_scheduleIterable,_util_isInteropObservable,_util_isPromise,_util_isArrayLike,_util_isIterable PURE_IMPORTS_END */\nimport { scheduleObservable } from './scheduleObservable';\nimport { schedulePromise } from './schedulePromise';\nimport { scheduleArray } from './scheduleArray';\nimport { scheduleIterable } from './scheduleIterable';\nimport { isInteropObservable } from '../util/isInteropObservable';\nimport { isPromise } from '../util/isPromise';\nimport { isArrayLike } from '../util/isArrayLike';\nimport { isIterable } from '../util/isIterable';\nexport function scheduled(input, scheduler) {\n if (input != null) {\n if (isInteropObservable(input)) {\n return scheduleObservable(input, scheduler);\n }\n else if (isPromise(input)) {\n return schedulePromise(input, scheduler);\n }\n else if (isArrayLike(input)) {\n return scheduleArray(input, scheduler);\n }\n else if (isIterable(input) || typeof input === 'string') {\n return scheduleIterable(input, scheduler);\n }\n }\n throw new TypeError((input !== null && typeof input || input) + ' is not observable');\n}\n//# sourceMappingURL=scheduled.js.map\n","/** PURE_IMPORTS_START _symbol_observable PURE_IMPORTS_END */\nimport { observable as Symbol_observable } from '../symbol/observable';\nexport function isInteropObservable(input) {\n return input && typeof input[Symbol_observable] === 'function';\n}\n//# sourceMappingURL=isInteropObservable.js.map\n","/** PURE_IMPORTS_START _Observable,_Subscription,_symbol_observable PURE_IMPORTS_END */\nimport { Observable } from '../Observable';\nimport { Subscription } from '../Subscription';\nimport { observable as Symbol_observable } from '../symbol/observable';\nexport function scheduleObservable(input, scheduler) {\n return new Observable(function (subscriber) {\n var sub = new Subscription();\n sub.add(scheduler.schedule(function () {\n var observable = input[Symbol_observable]();\n sub.add(observable.subscribe({\n next: function (value) { sub.add(scheduler.schedule(function () { return subscriber.next(value); })); },\n error: function (err) { sub.add(scheduler.schedule(function () { return subscriber.error(err); })); },\n complete: function () { sub.add(scheduler.schedule(function () { return subscriber.complete(); })); },\n }));\n }));\n return sub;\n });\n}\n//# sourceMappingURL=scheduleObservable.js.map\n","/** PURE_IMPORTS_START _Observable,_Subscription PURE_IMPORTS_END */\nimport { Observable } from '../Observable';\nimport { Subscription } from '../Subscription';\nexport function schedulePromise(input, scheduler) {\n return new Observable(function (subscriber) {\n var sub = new Subscription();\n sub.add(scheduler.schedule(function () {\n return input.then(function (value) {\n sub.add(scheduler.schedule(function () {\n subscriber.next(value);\n sub.add(scheduler.schedule(function () { return subscriber.complete(); }));\n }));\n }, function (err) {\n sub.add(scheduler.schedule(function () { return subscriber.error(err); }));\n });\n }));\n return sub;\n });\n}\n//# sourceMappingURL=schedulePromise.js.map\n","/** PURE_IMPORTS_START _symbol_iterator PURE_IMPORTS_END */\nimport { iterator as Symbol_iterator } from '../symbol/iterator';\nexport function isIterable(input) {\n return input && typeof input[Symbol_iterator] === 'function';\n}\n//# sourceMappingURL=isIterable.js.map\n","/** PURE_IMPORTS_START _Observable,_Subscription,_symbol_iterator PURE_IMPORTS_END */\nimport { Observable } from '../Observable';\nimport { Subscription } from '../Subscription';\nimport { iterator as Symbol_iterator } from '../symbol/iterator';\nexport function scheduleIterable(input, scheduler) {\n if (!input) {\n throw new Error('Iterable cannot be null');\n }\n return new Observable(function (subscriber) {\n var sub = new Subscription();\n var iterator;\n sub.add(function () {\n if (iterator && typeof iterator.return === 'function') {\n iterator.return();\n }\n });\n sub.add(scheduler.schedule(function () {\n iterator = input[Symbol_iterator]();\n sub.add(scheduler.schedule(function () {\n if (subscriber.closed) {\n return;\n }\n var value;\n var done;\n try {\n var result = iterator.next();\n value = result.value;\n done = result.done;\n }\n catch (err) {\n subscriber.error(err);\n return;\n }\n if (done) {\n subscriber.complete();\n }\n else {\n subscriber.next(value);\n this.schedule();\n }\n }));\n }));\n return sub;\n });\n}\n//# sourceMappingURL=scheduleIterable.js.map\n","/** PURE_IMPORTS_START _Observable,_util_subscribeTo,_scheduled_scheduled PURE_IMPORTS_END */\nimport { Observable } from '../Observable';\nimport { subscribeTo } from '../util/subscribeTo';\nimport { scheduled } from '../scheduled/scheduled';\nexport function from(input, scheduler) {\n if (!scheduler) {\n if (input instanceof Observable) {\n return input;\n }\n return new Observable(subscribeTo(input));\n }\n else {\n return scheduled(input, scheduler);\n }\n}\n//# sourceMappingURL=from.js.map\n","/** PURE_IMPORTS_START _Observable,_util_isArray,_operators_map,_util_isObject,_from PURE_IMPORTS_END */\nimport { Observable } from '../Observable';\nimport { isArray } from '../util/isArray';\nimport { map } from '../operators/map';\nimport { isObject } from '../util/isObject';\nimport { from } from './from';\nexport function forkJoin() {\n var sources = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n sources[_i] = arguments[_i];\n }\n if (sources.length === 1) {\n var first_1 = sources[0];\n if (isArray(first_1)) {\n return forkJoinInternal(first_1, null);\n }\n if (isObject(first_1) && Object.getPrototypeOf(first_1) === Object.prototype) {\n var keys = Object.keys(first_1);\n return forkJoinInternal(keys.map(function (key) { return first_1[key]; }), keys);\n }\n }\n if (typeof sources[sources.length - 1] === 'function') {\n var resultSelector_1 = sources.pop();\n sources = (sources.length === 1 && isArray(sources[0])) ? sources[0] : sources;\n return forkJoinInternal(sources, null).pipe(map(function (args) { return resultSelector_1.apply(void 0, args); }));\n }\n return forkJoinInternal(sources, null);\n}\nfunction forkJoinInternal(sources, keys) {\n return new Observable(function (subscriber) {\n var len = sources.length;\n if (len === 0) {\n subscriber.complete();\n return;\n }\n var values = new Array(len);\n var completed = 0;\n var emitted = 0;\n var _loop_1 = function (i) {\n var source = from(sources[i]);\n var hasValue = false;\n subscriber.add(source.subscribe({\n next: function (value) {\n if (!hasValue) {\n hasValue = true;\n emitted++;\n }\n values[i] = value;\n },\n error: function (err) { return subscriber.error(err); },\n complete: function () {\n completed++;\n if (completed === len || !hasValue) {\n if (emitted === len) {\n subscriber.next(keys ?\n keys.reduce(function (result, key, i) { return (result[key] = values[i], result); }, {}) :\n values);\n }\n subscriber.complete();\n }\n }\n }));\n };\n for (var i = 0; i < len; i++) {\n _loop_1(i);\n }\n });\n}\n//# sourceMappingURL=forkJoin.js.map\n","/** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { Subscriber } from './Subscriber';\nvar InnerSubscriber = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(InnerSubscriber, _super);\n function InnerSubscriber(parent, outerValue, outerIndex) {\n var _this = _super.call(this) || this;\n _this.parent = parent;\n _this.outerValue = outerValue;\n _this.outerIndex = outerIndex;\n _this.index = 0;\n return _this;\n }\n InnerSubscriber.prototype._next = function (value) {\n this.parent.notifyNext(this.outerValue, value, this.outerIndex, this.index++, this);\n };\n InnerSubscriber.prototype._error = function (error) {\n this.parent.notifyError(error, this);\n this.unsubscribe();\n };\n InnerSubscriber.prototype._complete = function () {\n this.parent.notifyComplete(this);\n this.unsubscribe();\n };\n return InnerSubscriber;\n}(Subscriber));\nexport { InnerSubscriber };\n//# sourceMappingURL=InnerSubscriber.js.map\n","/** PURE_IMPORTS_START _InnerSubscriber,_subscribeTo,_Observable PURE_IMPORTS_END */\nimport { InnerSubscriber } from '../InnerSubscriber';\nimport { subscribeTo } from './subscribeTo';\nimport { Observable } from '../Observable';\nexport function subscribeToResult(outerSubscriber, result, outerValue, outerIndex, destination) {\n if (destination === void 0) {\n destination = new InnerSubscriber(outerSubscriber, outerValue, outerIndex);\n }\n if (destination.closed) {\n return undefined;\n }\n if (result instanceof Observable) {\n return result.subscribe(destination);\n }\n return subscribeTo(result)(destination);\n}\n//# sourceMappingURL=subscribeToResult.js.map\n","/** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { Subscriber } from './Subscriber';\nvar OuterSubscriber = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(OuterSubscriber, _super);\n function OuterSubscriber() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n OuterSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {\n this.destination.next(innerValue);\n };\n OuterSubscriber.prototype.notifyError = function (error, innerSub) {\n this.destination.error(error);\n };\n OuterSubscriber.prototype.notifyComplete = function (innerSub) {\n this.destination.complete();\n };\n return OuterSubscriber;\n}(Subscriber));\nexport { OuterSubscriber };\n//# sourceMappingURL=OuterSubscriber.js.map\n","/** PURE_IMPORTS_START tslib,_util_subscribeToResult,_OuterSubscriber,_InnerSubscriber,_map,_observable_from PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { subscribeToResult } from '../util/subscribeToResult';\nimport { OuterSubscriber } from '../OuterSubscriber';\nimport { InnerSubscriber } from '../InnerSubscriber';\nimport { map } from './map';\nimport { from } from '../observable/from';\nexport function mergeMap(project, resultSelector, concurrent) {\n if (concurrent === void 0) {\n concurrent = Number.POSITIVE_INFINITY;\n }\n if (typeof resultSelector === 'function') {\n return function (source) { return source.pipe(mergeMap(function (a, i) { return from(project(a, i)).pipe(map(function (b, ii) { return resultSelector(a, b, i, ii); })); }, concurrent)); };\n }\n else if (typeof resultSelector === 'number') {\n concurrent = resultSelector;\n }\n return function (source) { return source.lift(new MergeMapOperator(project, concurrent)); };\n}\nvar MergeMapOperator = /*@__PURE__*/ (function () {\n function MergeMapOperator(project, concurrent) {\n if (concurrent === void 0) {\n concurrent = Number.POSITIVE_INFINITY;\n }\n this.project = project;\n this.concurrent = concurrent;\n }\n MergeMapOperator.prototype.call = function (observer, source) {\n return source.subscribe(new MergeMapSubscriber(observer, this.project, this.concurrent));\n };\n return MergeMapOperator;\n}());\nexport { MergeMapOperator };\nvar MergeMapSubscriber = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(MergeMapSubscriber, _super);\n function MergeMapSubscriber(destination, project, concurrent) {\n if (concurrent === void 0) {\n concurrent = Number.POSITIVE_INFINITY;\n }\n var _this = _super.call(this, destination) || this;\n _this.project = project;\n _this.concurrent = concurrent;\n _this.hasCompleted = false;\n _this.buffer = [];\n _this.active = 0;\n _this.index = 0;\n return _this;\n }\n MergeMapSubscriber.prototype._next = function (value) {\n if (this.active < this.concurrent) {\n this._tryNext(value);\n }\n else {\n this.buffer.push(value);\n }\n };\n MergeMapSubscriber.prototype._tryNext = function (value) {\n var result;\n var index = this.index++;\n try {\n result = this.project(value, index);\n }\n catch (err) {\n this.destination.error(err);\n return;\n }\n this.active++;\n this._innerSub(result, value, index);\n };\n MergeMapSubscriber.prototype._innerSub = function (ish, value, index) {\n var innerSubscriber = new InnerSubscriber(this, undefined, undefined);\n var destination = this.destination;\n destination.add(innerSubscriber);\n subscribeToResult(this, ish, value, index, innerSubscriber);\n };\n MergeMapSubscriber.prototype._complete = function () {\n this.hasCompleted = true;\n if (this.active === 0 && this.buffer.length === 0) {\n this.destination.complete();\n }\n this.unsubscribe();\n };\n MergeMapSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {\n this.destination.next(innerValue);\n };\n MergeMapSubscriber.prototype.notifyComplete = function (innerSub) {\n var buffer = this.buffer;\n this.remove(innerSub);\n this.active--;\n if (buffer.length > 0) {\n this._next(buffer.shift());\n }\n else if (this.active === 0 && this.hasCompleted) {\n this.destination.complete();\n }\n };\n return MergeMapSubscriber;\n}(OuterSubscriber));\nexport { MergeMapSubscriber };\n//# sourceMappingURL=mergeMap.js.map\n","/** PURE_IMPORTS_START PURE_IMPORTS_END */\nexport function identity(x) {\n return x;\n}\n//# sourceMappingURL=identity.js.map\n","/** PURE_IMPORTS_START _mergeMap,_util_identity PURE_IMPORTS_END */\nimport { mergeMap } from './mergeMap';\nimport { identity } from '../util/identity';\nexport function mergeAll(concurrent) {\n if (concurrent === void 0) {\n concurrent = Number.POSITIVE_INFINITY;\n }\n return mergeMap(identity, concurrent);\n}\n//# sourceMappingURL=mergeAll.js.map\n","/** PURE_IMPORTS_START _Observable,_util_isScheduler,_operators_mergeAll,_fromArray PURE_IMPORTS_END */\nimport { Observable } from '../Observable';\nimport { isScheduler } from '../util/isScheduler';\nimport { mergeAll } from '../operators/mergeAll';\nimport { fromArray } from './fromArray';\nexport function merge() {\n var observables = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n observables[_i] = arguments[_i];\n }\n var concurrent = Number.POSITIVE_INFINITY;\n var scheduler = null;\n var last = observables[observables.length - 1];\n if (isScheduler(last)) {\n scheduler = observables.pop();\n if (observables.length > 1 && typeof observables[observables.length - 1] === 'number') {\n concurrent = observables.pop();\n }\n }\n else if (typeof last === 'number') {\n concurrent = observables.pop();\n }\n if (scheduler === null && observables.length === 1 && observables[0] instanceof Observable) {\n return observables[0];\n }\n return mergeAll(concurrent)(fromArray(observables, scheduler));\n}\n//# sourceMappingURL=merge.js.map\n","/** PURE_IMPORTS_START tslib,_.._util_root,_.._Observable,_.._Subscriber,_.._operators_map PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { root } from '../../util/root';\nimport { Observable } from '../../Observable';\nimport { Subscriber } from '../../Subscriber';\nimport { map } from '../../operators/map';\nfunction getCORSRequest() {\n if (root.XMLHttpRequest) {\n return new root.XMLHttpRequest();\n }\n else if (!!root.XDomainRequest) {\n return new root.XDomainRequest();\n }\n else {\n throw new Error('CORS is not supported by your browser');\n }\n}\nfunction getXMLHttpRequest() {\n if (root.XMLHttpRequest) {\n return new root.XMLHttpRequest();\n }\n else {\n var progId = void 0;\n try {\n var progIds = ['Msxml2.XMLHTTP', 'Microsoft.XMLHTTP', 'Msxml2.XMLHTTP.4.0'];\n for (var i = 0; i < 3; i++) {\n try {\n progId = progIds[i];\n if (new root.ActiveXObject(progId)) {\n break;\n }\n }\n catch (e) {\n }\n }\n return new root.ActiveXObject(progId);\n }\n catch (e) {\n throw new Error('XMLHttpRequest is not supported by your browser');\n }\n }\n}\nexport function ajaxGet(url, headers) {\n if (headers === void 0) {\n headers = null;\n }\n return new AjaxObservable({ method: 'GET', url: url, headers: headers });\n}\nexport function ajaxPost(url, body, headers) {\n return new AjaxObservable({ method: 'POST', url: url, body: body, headers: headers });\n}\nexport function ajaxDelete(url, headers) {\n return new AjaxObservable({ method: 'DELETE', url: url, headers: headers });\n}\nexport function ajaxPut(url, body, headers) {\n return new AjaxObservable({ method: 'PUT', url: url, body: body, headers: headers });\n}\nexport function ajaxPatch(url, body, headers) {\n return new AjaxObservable({ method: 'PATCH', url: url, body: body, headers: headers });\n}\nvar mapResponse = /*@__PURE__*/ map(function (x, index) { return x.response; });\nexport function ajaxGetJSON(url, headers) {\n return mapResponse(new AjaxObservable({\n method: 'GET',\n url: url,\n responseType: 'json',\n headers: headers\n }));\n}\nvar AjaxObservable = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(AjaxObservable, _super);\n function AjaxObservable(urlOrRequest) {\n var _this = _super.call(this) || this;\n var request = {\n async: true,\n createXHR: function () {\n return this.crossDomain ? getCORSRequest() : getXMLHttpRequest();\n },\n crossDomain: true,\n withCredentials: false,\n headers: {},\n method: 'GET',\n responseType: 'json',\n timeout: 0\n };\n if (typeof urlOrRequest === 'string') {\n request.url = urlOrRequest;\n }\n else {\n for (var prop in urlOrRequest) {\n if (urlOrRequest.hasOwnProperty(prop)) {\n request[prop] = urlOrRequest[prop];\n }\n }\n }\n _this.request = request;\n return _this;\n }\n AjaxObservable.prototype._subscribe = function (subscriber) {\n return new AjaxSubscriber(subscriber, this.request);\n };\n AjaxObservable.create = (function () {\n var create = function (urlOrRequest) {\n return new AjaxObservable(urlOrRequest);\n };\n create.get = ajaxGet;\n create.post = ajaxPost;\n create.delete = ajaxDelete;\n create.put = ajaxPut;\n create.patch = ajaxPatch;\n create.getJSON = ajaxGetJSON;\n return create;\n })();\n return AjaxObservable;\n}(Observable));\nexport { AjaxObservable };\nvar AjaxSubscriber = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(AjaxSubscriber, _super);\n function AjaxSubscriber(destination, request) {\n var _this = _super.call(this, destination) || this;\n _this.request = request;\n _this.done = false;\n var headers = request.headers = request.headers || {};\n if (!request.crossDomain && !_this.getHeader(headers, 'X-Requested-With')) {\n headers['X-Requested-With'] = 'XMLHttpRequest';\n }\n var contentTypeHeader = _this.getHeader(headers, 'Content-Type');\n if (!contentTypeHeader && !(root.FormData && request.body instanceof root.FormData) && typeof request.body !== 'undefined') {\n headers['Content-Type'] = 'application/x-www-form-urlencoded; charset=UTF-8';\n }\n request.body = _this.serializeBody(request.body, _this.getHeader(request.headers, 'Content-Type'));\n _this.send();\n return _this;\n }\n AjaxSubscriber.prototype.next = function (e) {\n this.done = true;\n var _a = this, xhr = _a.xhr, request = _a.request, destination = _a.destination;\n var result;\n try {\n result = new AjaxResponse(e, xhr, request);\n }\n catch (err) {\n return destination.error(err);\n }\n destination.next(result);\n };\n AjaxSubscriber.prototype.send = function () {\n var _a = this, request = _a.request, _b = _a.request, user = _b.user, method = _b.method, url = _b.url, async = _b.async, password = _b.password, headers = _b.headers, body = _b.body;\n try {\n var xhr = this.xhr = request.createXHR();\n this.setupEvents(xhr, request);\n if (user) {\n xhr.open(method, url, async, user, password);\n }\n else {\n xhr.open(method, url, async);\n }\n if (async) {\n xhr.timeout = request.timeout;\n xhr.responseType = request.responseType;\n }\n if ('withCredentials' in xhr) {\n xhr.withCredentials = !!request.withCredentials;\n }\n this.setHeaders(xhr, headers);\n if (body) {\n xhr.send(body);\n }\n else {\n xhr.send();\n }\n }\n catch (err) {\n this.error(err);\n }\n };\n AjaxSubscriber.prototype.serializeBody = function (body, contentType) {\n if (!body || typeof body === 'string') {\n return body;\n }\n else if (root.FormData && body instanceof root.FormData) {\n return body;\n }\n if (contentType) {\n var splitIndex = contentType.indexOf(';');\n if (splitIndex !== -1) {\n contentType = contentType.substring(0, splitIndex);\n }\n }\n switch (contentType) {\n case 'application/x-www-form-urlencoded':\n return Object.keys(body).map(function (key) { return encodeURIComponent(key) + \"=\" + encodeURIComponent(body[key]); }).join('&');\n case 'application/json':\n return JSON.stringify(body);\n default:\n return body;\n }\n };\n AjaxSubscriber.prototype.setHeaders = function (xhr, headers) {\n for (var key in headers) {\n if (headers.hasOwnProperty(key)) {\n xhr.setRequestHeader(key, headers[key]);\n }\n }\n };\n AjaxSubscriber.prototype.getHeader = function (headers, headerName) {\n for (var key in headers) {\n if (key.toLowerCase() === headerName.toLowerCase()) {\n return headers[key];\n }\n }\n return undefined;\n };\n AjaxSubscriber.prototype.setupEvents = function (xhr, request) {\n var progressSubscriber = request.progressSubscriber;\n function xhrTimeout(e) {\n var _a = xhrTimeout, subscriber = _a.subscriber, progressSubscriber = _a.progressSubscriber, request = _a.request;\n if (progressSubscriber) {\n progressSubscriber.error(e);\n }\n var error;\n try {\n error = new AjaxTimeoutError(this, request);\n }\n catch (err) {\n error = err;\n }\n subscriber.error(error);\n }\n xhr.ontimeout = xhrTimeout;\n xhrTimeout.request = request;\n xhrTimeout.subscriber = this;\n xhrTimeout.progressSubscriber = progressSubscriber;\n if (xhr.upload && 'withCredentials' in xhr) {\n if (progressSubscriber) {\n var xhrProgress_1;\n xhrProgress_1 = function (e) {\n var progressSubscriber = xhrProgress_1.progressSubscriber;\n progressSubscriber.next(e);\n };\n if (root.XDomainRequest) {\n xhr.onprogress = xhrProgress_1;\n }\n else {\n xhr.upload.onprogress = xhrProgress_1;\n }\n xhrProgress_1.progressSubscriber = progressSubscriber;\n }\n var xhrError_1;\n xhrError_1 = function (e) {\n var _a = xhrError_1, progressSubscriber = _a.progressSubscriber, subscriber = _a.subscriber, request = _a.request;\n if (progressSubscriber) {\n progressSubscriber.error(e);\n }\n var error;\n try {\n error = new AjaxError('ajax error', this, request);\n }\n catch (err) {\n error = err;\n }\n subscriber.error(error);\n };\n xhr.onerror = xhrError_1;\n xhrError_1.request = request;\n xhrError_1.subscriber = this;\n xhrError_1.progressSubscriber = progressSubscriber;\n }\n function xhrReadyStateChange(e) {\n return;\n }\n xhr.onreadystatechange = xhrReadyStateChange;\n xhrReadyStateChange.subscriber = this;\n xhrReadyStateChange.progressSubscriber = progressSubscriber;\n xhrReadyStateChange.request = request;\n function xhrLoad(e) {\n var _a = xhrLoad, subscriber = _a.subscriber, progressSubscriber = _a.progressSubscriber, request = _a.request;\n if (this.readyState === 4) {\n var status_1 = this.status === 1223 ? 204 : this.status;\n var response = (this.responseType === 'text' ? (this.response || this.responseText) : this.response);\n if (status_1 === 0) {\n status_1 = response ? 200 : 0;\n }\n if (status_1 < 400) {\n if (progressSubscriber) {\n progressSubscriber.complete();\n }\n subscriber.next(e);\n subscriber.complete();\n }\n else {\n if (progressSubscriber) {\n progressSubscriber.error(e);\n }\n var error = void 0;\n try {\n error = new AjaxError('ajax error ' + status_1, this, request);\n }\n catch (err) {\n error = err;\n }\n subscriber.error(error);\n }\n }\n }\n xhr.onload = xhrLoad;\n xhrLoad.subscriber = this;\n xhrLoad.progressSubscriber = progressSubscriber;\n xhrLoad.request = request;\n };\n AjaxSubscriber.prototype.unsubscribe = function () {\n var _a = this, done = _a.done, xhr = _a.xhr;\n if (!done && xhr && xhr.readyState !== 4 && typeof xhr.abort === 'function') {\n xhr.abort();\n }\n _super.prototype.unsubscribe.call(this);\n };\n return AjaxSubscriber;\n}(Subscriber));\nexport { AjaxSubscriber };\nvar AjaxResponse = /*@__PURE__*/ (function () {\n function AjaxResponse(originalEvent, xhr, request) {\n this.originalEvent = originalEvent;\n this.xhr = xhr;\n this.request = request;\n this.status = xhr.status;\n this.responseType = xhr.responseType || request.responseType;\n this.response = parseXhrResponse(this.responseType, xhr);\n }\n return AjaxResponse;\n}());\nexport { AjaxResponse };\nvar AjaxErrorImpl = /*@__PURE__*/ (function () {\n function AjaxErrorImpl(message, xhr, request) {\n Error.call(this);\n this.message = message;\n this.name = 'AjaxError';\n this.xhr = xhr;\n this.request = request;\n this.status = xhr.status;\n this.responseType = xhr.responseType || request.responseType;\n this.response = parseXhrResponse(this.responseType, xhr);\n return this;\n }\n AjaxErrorImpl.prototype = /*@__PURE__*/ Object.create(Error.prototype);\n return AjaxErrorImpl;\n})();\nexport var AjaxError = AjaxErrorImpl;\nfunction parseJson(xhr) {\n if ('response' in xhr) {\n return xhr.responseType ? xhr.response : JSON.parse(xhr.response || xhr.responseText || 'null');\n }\n else {\n return JSON.parse(xhr.responseText || 'null');\n }\n}\nfunction parseXhrResponse(responseType, xhr) {\n switch (responseType) {\n case 'json':\n return parseJson(xhr);\n case 'xml':\n return xhr.responseXML;\n case 'text':\n default:\n return ('response' in xhr) ? xhr.response : xhr.responseText;\n }\n}\nfunction AjaxTimeoutErrorImpl(xhr, request) {\n AjaxError.call(this, 'ajax timeout', xhr, request);\n this.name = 'AjaxTimeoutError';\n return this;\n}\nexport var AjaxTimeoutError = AjaxTimeoutErrorImpl;\n//# sourceMappingURL=AjaxObservable.js.map\n","/** PURE_IMPORTS_START _AjaxObservable PURE_IMPORTS_END */\nimport { AjaxObservable } from './AjaxObservable';\nexport var ajax = /*@__PURE__*/ (function () { return AjaxObservable.create; })();\n//# sourceMappingURL=ajax.js.map\n","/** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { Subscriber } from '../Subscriber';\nexport function filter(predicate, thisArg) {\n return function filterOperatorFunction(source) {\n return source.lift(new FilterOperator(predicate, thisArg));\n };\n}\nvar FilterOperator = /*@__PURE__*/ (function () {\n function FilterOperator(predicate, thisArg) {\n this.predicate = predicate;\n this.thisArg = thisArg;\n }\n FilterOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new FilterSubscriber(subscriber, this.predicate, this.thisArg));\n };\n return FilterOperator;\n}());\nvar FilterSubscriber = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(FilterSubscriber, _super);\n function FilterSubscriber(destination, predicate, thisArg) {\n var _this = _super.call(this, destination) || this;\n _this.predicate = predicate;\n _this.thisArg = thisArg;\n _this.count = 0;\n return _this;\n }\n FilterSubscriber.prototype._next = function (value) {\n var result;\n try {\n result = this.predicate.call(this.thisArg, value, this.count++);\n }\n catch (err) {\n this.destination.error(err);\n return;\n }\n if (result) {\n this.destination.next(value);\n }\n };\n return FilterSubscriber;\n}(Subscriber));\n//# sourceMappingURL=filter.js.map\n","/** PURE_IMPORTS_START tslib,_Subscriber,_util_noop,_util_isFunction PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { Subscriber } from '../Subscriber';\nimport { noop } from '../util/noop';\nimport { isFunction } from '../util/isFunction';\nexport function tap(nextOrObserver, error, complete) {\n return function tapOperatorFunction(source) {\n return source.lift(new DoOperator(nextOrObserver, error, complete));\n };\n}\nvar DoOperator = /*@__PURE__*/ (function () {\n function DoOperator(nextOrObserver, error, complete) {\n this.nextOrObserver = nextOrObserver;\n this.error = error;\n this.complete = complete;\n }\n DoOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new TapSubscriber(subscriber, this.nextOrObserver, this.error, this.complete));\n };\n return DoOperator;\n}());\nvar TapSubscriber = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(TapSubscriber, _super);\n function TapSubscriber(destination, observerOrNext, error, complete) {\n var _this = _super.call(this, destination) || this;\n _this._tapNext = noop;\n _this._tapError = noop;\n _this._tapComplete = noop;\n _this._tapError = error || noop;\n _this._tapComplete = complete || noop;\n if (isFunction(observerOrNext)) {\n _this._context = _this;\n _this._tapNext = observerOrNext;\n }\n else if (observerOrNext) {\n _this._context = observerOrNext;\n _this._tapNext = observerOrNext.next || noop;\n _this._tapError = observerOrNext.error || noop;\n _this._tapComplete = observerOrNext.complete || noop;\n }\n return _this;\n }\n TapSubscriber.prototype._next = function (value) {\n try {\n this._tapNext.call(this._context, value);\n }\n catch (err) {\n this.destination.error(err);\n return;\n }\n this.destination.next(value);\n };\n TapSubscriber.prototype._error = function (err) {\n try {\n this._tapError.call(this._context, err);\n }\n catch (err) {\n this.destination.error(err);\n return;\n }\n this.destination.error(err);\n };\n TapSubscriber.prototype._complete = function () {\n try {\n this._tapComplete.call(this._context);\n }\n catch (err) {\n this.destination.error(err);\n return;\n }\n return this.destination.complete();\n };\n return TapSubscriber;\n}(Subscriber));\n//# sourceMappingURL=tap.js.map\n","/** PURE_IMPORTS_START _map PURE_IMPORTS_END */\nimport { map } from './map';\nexport function pluck() {\n var properties = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n properties[_i] = arguments[_i];\n }\n var length = properties.length;\n if (length === 0) {\n throw new Error('list of properties cannot be empty.');\n }\n return function (source) { return map(plucker(properties, length))(source); };\n}\nfunction plucker(props, length) {\n var mapper = function (x) {\n var currentProp = x;\n for (var i = 0; i < length; i++) {\n var p = currentProp[props[i]];\n if (typeof p !== 'undefined') {\n currentProp = p;\n }\n else {\n return undefined;\n }\n }\n return currentProp;\n };\n return mapper;\n}\n//# sourceMappingURL=pluck.js.map\n","/** PURE_IMPORTS_START PURE_IMPORTS_END */\nvar ArgumentOutOfRangeErrorImpl = /*@__PURE__*/ (function () {\n function ArgumentOutOfRangeErrorImpl() {\n Error.call(this);\n this.message = 'argument out of range';\n this.name = 'ArgumentOutOfRangeError';\n return this;\n }\n ArgumentOutOfRangeErrorImpl.prototype = /*@__PURE__*/ Object.create(Error.prototype);\n return ArgumentOutOfRangeErrorImpl;\n})();\nexport var ArgumentOutOfRangeError = ArgumentOutOfRangeErrorImpl;\n//# sourceMappingURL=ArgumentOutOfRangeError.js.map\n","/** PURE_IMPORTS_START tslib,_Subscriber,_util_ArgumentOutOfRangeError,_observable_empty PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { Subscriber } from '../Subscriber';\nimport { ArgumentOutOfRangeError } from '../util/ArgumentOutOfRangeError';\nimport { empty } from '../observable/empty';\nexport function take(count) {\n return function (source) {\n if (count === 0) {\n return empty();\n }\n else {\n return source.lift(new TakeOperator(count));\n }\n };\n}\nvar TakeOperator = /*@__PURE__*/ (function () {\n function TakeOperator(total) {\n this.total = total;\n if (this.total < 0) {\n throw new ArgumentOutOfRangeError;\n }\n }\n TakeOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new TakeSubscriber(subscriber, this.total));\n };\n return TakeOperator;\n}());\nvar TakeSubscriber = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(TakeSubscriber, _super);\n function TakeSubscriber(destination, total) {\n var _this = _super.call(this, destination) || this;\n _this.total = total;\n _this.count = 0;\n return _this;\n }\n TakeSubscriber.prototype._next = function (value) {\n var total = this.total;\n var count = ++this.count;\n if (count <= total) {\n this.destination.next(value);\n if (count === total) {\n this.destination.complete();\n this.unsubscribe();\n }\n }\n };\n return TakeSubscriber;\n}(Subscriber));\n//# sourceMappingURL=take.js.map\n","/** PURE_IMPORTS_START tslib,_OuterSubscriber,_InnerSubscriber,_util_subscribeToResult,_map,_observable_from PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { OuterSubscriber } from '../OuterSubscriber';\nimport { InnerSubscriber } from '../InnerSubscriber';\nimport { subscribeToResult } from '../util/subscribeToResult';\nimport { map } from './map';\nimport { from } from '../observable/from';\nexport function switchMap(project, resultSelector) {\n if (typeof resultSelector === 'function') {\n return function (source) { return source.pipe(switchMap(function (a, i) { return from(project(a, i)).pipe(map(function (b, ii) { return resultSelector(a, b, i, ii); })); })); };\n }\n return function (source) { return source.lift(new SwitchMapOperator(project)); };\n}\nvar SwitchMapOperator = /*@__PURE__*/ (function () {\n function SwitchMapOperator(project) {\n this.project = project;\n }\n SwitchMapOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new SwitchMapSubscriber(subscriber, this.project));\n };\n return SwitchMapOperator;\n}());\nvar SwitchMapSubscriber = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(SwitchMapSubscriber, _super);\n function SwitchMapSubscriber(destination, project) {\n var _this = _super.call(this, destination) || this;\n _this.project = project;\n _this.index = 0;\n return _this;\n }\n SwitchMapSubscriber.prototype._next = function (value) {\n var result;\n var index = this.index++;\n try {\n result = this.project(value, index);\n }\n catch (error) {\n this.destination.error(error);\n return;\n }\n this._innerSub(result, value, index);\n };\n SwitchMapSubscriber.prototype._innerSub = function (result, value, index) {\n var innerSubscription = this.innerSubscription;\n if (innerSubscription) {\n innerSubscription.unsubscribe();\n }\n var innerSubscriber = new InnerSubscriber(this, undefined, undefined);\n var destination = this.destination;\n destination.add(innerSubscriber);\n this.innerSubscription = subscribeToResult(this, result, value, index, innerSubscriber);\n };\n SwitchMapSubscriber.prototype._complete = function () {\n var innerSubscription = this.innerSubscription;\n if (!innerSubscription || innerSubscription.closed) {\n _super.prototype._complete.call(this);\n }\n this.unsubscribe();\n };\n SwitchMapSubscriber.prototype._unsubscribe = function () {\n this.innerSubscription = null;\n };\n SwitchMapSubscriber.prototype.notifyComplete = function (innerSub) {\n var destination = this.destination;\n destination.remove(innerSub);\n this.innerSubscription = null;\n if (this.isStopped) {\n _super.prototype._complete.call(this);\n }\n };\n SwitchMapSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {\n this.destination.next(innerValue);\n };\n return SwitchMapSubscriber;\n}(OuterSubscriber));\n//# sourceMappingURL=switchMap.js.map\n","/** PURE_IMPORTS_START _observable_empty,_observable_of,_observable_throwError PURE_IMPORTS_END */\nimport { empty } from './observable/empty';\nimport { of } from './observable/of';\nimport { throwError } from './observable/throwError';\nexport var NotificationKind;\n/*@__PURE__*/ (function (NotificationKind) {\n NotificationKind[\"NEXT\"] = \"N\";\n NotificationKind[\"ERROR\"] = \"E\";\n NotificationKind[\"COMPLETE\"] = \"C\";\n})(NotificationKind || (NotificationKind = {}));\nvar Notification = /*@__PURE__*/ (function () {\n function Notification(kind, value, error) {\n this.kind = kind;\n this.value = value;\n this.error = error;\n this.hasValue = kind === 'N';\n }\n Notification.prototype.observe = function (observer) {\n switch (this.kind) {\n case 'N':\n return observer.next && observer.next(this.value);\n case 'E':\n return observer.error && observer.error(this.error);\n case 'C':\n return observer.complete && observer.complete();\n }\n };\n Notification.prototype.do = function (next, error, complete) {\n var kind = this.kind;\n switch (kind) {\n case 'N':\n return next && next(this.value);\n case 'E':\n return error && error(this.error);\n case 'C':\n return complete && complete();\n }\n };\n Notification.prototype.accept = function (nextOrObserver, error, complete) {\n if (nextOrObserver && typeof nextOrObserver.next === 'function') {\n return this.observe(nextOrObserver);\n }\n else {\n return this.do(nextOrObserver, error, complete);\n }\n };\n Notification.prototype.toObservable = function () {\n var kind = this.kind;\n switch (kind) {\n case 'N':\n return of(this.value);\n case 'E':\n return throwError(this.error);\n case 'C':\n return empty();\n }\n throw new Error('unexpected notification kind value');\n };\n Notification.createNext = function (value) {\n if (typeof value !== 'undefined') {\n return new Notification('N', value);\n }\n return Notification.undefinedValueNotification;\n };\n Notification.createError = function (err) {\n return new Notification('E', undefined, err);\n };\n Notification.createComplete = function () {\n return Notification.completeNotification;\n };\n Notification.completeNotification = new Notification('C');\n Notification.undefinedValueNotification = new Notification('N', undefined);\n return Notification;\n}());\nexport { Notification };\n//# sourceMappingURL=Notification.js.map\n","/** PURE_IMPORTS_START tslib,_Action PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { Action } from './Action';\nvar AsyncAction = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(AsyncAction, _super);\n function AsyncAction(scheduler, work) {\n var _this = _super.call(this, scheduler, work) || this;\n _this.scheduler = scheduler;\n _this.work = work;\n _this.pending = false;\n return _this;\n }\n AsyncAction.prototype.schedule = function (state, delay) {\n if (delay === void 0) {\n delay = 0;\n }\n if (this.closed) {\n return this;\n }\n this.state = state;\n var id = this.id;\n var scheduler = this.scheduler;\n if (id != null) {\n this.id = this.recycleAsyncId(scheduler, id, delay);\n }\n this.pending = true;\n this.delay = delay;\n this.id = this.id || this.requestAsyncId(scheduler, this.id, delay);\n return this;\n };\n AsyncAction.prototype.requestAsyncId = function (scheduler, id, delay) {\n if (delay === void 0) {\n delay = 0;\n }\n return setInterval(scheduler.flush.bind(scheduler, this), delay);\n };\n AsyncAction.prototype.recycleAsyncId = function (scheduler, id, delay) {\n if (delay === void 0) {\n delay = 0;\n }\n if (delay !== null && this.delay === delay && this.pending === false) {\n return id;\n }\n clearInterval(id);\n return undefined;\n };\n AsyncAction.prototype.execute = function (state, delay) {\n if (this.closed) {\n return new Error('executing a cancelled action');\n }\n this.pending = false;\n var error = this._execute(state, delay);\n if (error) {\n return error;\n }\n else if (this.pending === false && this.id != null) {\n this.id = this.recycleAsyncId(this.scheduler, this.id, null);\n }\n };\n AsyncAction.prototype._execute = function (state, delay) {\n var errored = false;\n var errorValue = undefined;\n try {\n this.work(state);\n }\n catch (e) {\n errored = true;\n errorValue = !!e && e || new Error(e);\n }\n if (errored) {\n this.unsubscribe();\n return errorValue;\n }\n };\n AsyncAction.prototype._unsubscribe = function () {\n var id = this.id;\n var scheduler = this.scheduler;\n var actions = scheduler.actions;\n var index = actions.indexOf(this);\n this.work = null;\n this.state = null;\n this.pending = false;\n this.scheduler = null;\n if (index !== -1) {\n actions.splice(index, 1);\n }\n if (id != null) {\n this.id = this.recycleAsyncId(scheduler, id, null);\n }\n this.delay = null;\n };\n return AsyncAction;\n}(Action));\nexport { AsyncAction };\n//# sourceMappingURL=AsyncAction.js.map\n","/** PURE_IMPORTS_START tslib,_Subscription PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { Subscription } from '../Subscription';\nvar Action = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(Action, _super);\n function Action(scheduler, work) {\n return _super.call(this) || this;\n }\n Action.prototype.schedule = function (state, delay) {\n if (delay === void 0) {\n delay = 0;\n }\n return this;\n };\n return Action;\n}(Subscription));\nexport { Action };\n//# sourceMappingURL=Action.js.map\n","var Scheduler = /*@__PURE__*/ (function () {\n function Scheduler(SchedulerAction, now) {\n if (now === void 0) {\n now = Scheduler.now;\n }\n this.SchedulerAction = SchedulerAction;\n this.now = now;\n }\n Scheduler.prototype.schedule = function (work, delay, state) {\n if (delay === void 0) {\n delay = 0;\n }\n return new this.SchedulerAction(this, work).schedule(state, delay);\n };\n Scheduler.now = function () { return Date.now(); };\n return Scheduler;\n}());\nexport { Scheduler };\n//# sourceMappingURL=Scheduler.js.map\n","/** PURE_IMPORTS_START tslib,_Scheduler PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { Scheduler } from '../Scheduler';\nvar AsyncScheduler = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(AsyncScheduler, _super);\n function AsyncScheduler(SchedulerAction, now) {\n if (now === void 0) {\n now = Scheduler.now;\n }\n var _this = _super.call(this, SchedulerAction, function () {\n if (AsyncScheduler.delegate && AsyncScheduler.delegate !== _this) {\n return AsyncScheduler.delegate.now();\n }\n else {\n return now();\n }\n }) || this;\n _this.actions = [];\n _this.active = false;\n _this.scheduled = undefined;\n return _this;\n }\n AsyncScheduler.prototype.schedule = function (work, delay, state) {\n if (delay === void 0) {\n delay = 0;\n }\n if (AsyncScheduler.delegate && AsyncScheduler.delegate !== this) {\n return AsyncScheduler.delegate.schedule(work, delay, state);\n }\n else {\n return _super.prototype.schedule.call(this, work, delay, state);\n }\n };\n AsyncScheduler.prototype.flush = function (action) {\n var actions = this.actions;\n if (this.active) {\n actions.push(action);\n return;\n }\n var error;\n this.active = true;\n do {\n if (error = action.execute(action.state, action.delay)) {\n break;\n }\n } while (action = actions.shift());\n this.active = false;\n if (error) {\n while (action = actions.shift()) {\n action.unsubscribe();\n }\n throw error;\n }\n };\n return AsyncScheduler;\n}(Scheduler));\nexport { AsyncScheduler };\n//# sourceMappingURL=AsyncScheduler.js.map\n","/** PURE_IMPORTS_START _AsyncAction,_AsyncScheduler PURE_IMPORTS_END */\nimport { AsyncAction } from './AsyncAction';\nimport { AsyncScheduler } from './AsyncScheduler';\nexport var async = /*@__PURE__*/ new AsyncScheduler(AsyncAction);\n//# sourceMappingURL=async.js.map\n","/** PURE_IMPORTS_START _Observable PURE_IMPORTS_END */\nimport { Observable } from '../Observable';\nexport function throwError(error, scheduler) {\n if (!scheduler) {\n return new Observable(function (subscriber) { return subscriber.error(error); });\n }\n else {\n return new Observable(function (subscriber) { return scheduler.schedule(dispatch, 0, { error: error, subscriber: subscriber }); });\n }\n}\nfunction dispatch(_a) {\n var error = _a.error, subscriber = _a.subscriber;\n subscriber.error(error);\n}\n//# sourceMappingURL=throwError.js.map\n","/** PURE_IMPORTS_START tslib,_scheduler_async,_util_isDate,_Subscriber,_Notification PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { async } from '../scheduler/async';\nimport { isDate } from '../util/isDate';\nimport { Subscriber } from '../Subscriber';\nimport { Notification } from '../Notification';\nexport function delay(delay, scheduler) {\n if (scheduler === void 0) {\n scheduler = async;\n }\n var absoluteDelay = isDate(delay);\n var delayFor = absoluteDelay ? (+delay - scheduler.now()) : Math.abs(delay);\n return function (source) { return source.lift(new DelayOperator(delayFor, scheduler)); };\n}\nvar DelayOperator = /*@__PURE__*/ (function () {\n function DelayOperator(delay, scheduler) {\n this.delay = delay;\n this.scheduler = scheduler;\n }\n DelayOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new DelaySubscriber(subscriber, this.delay, this.scheduler));\n };\n return DelayOperator;\n}());\nvar DelaySubscriber = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(DelaySubscriber, _super);\n function DelaySubscriber(destination, delay, scheduler) {\n var _this = _super.call(this, destination) || this;\n _this.delay = delay;\n _this.scheduler = scheduler;\n _this.queue = [];\n _this.active = false;\n _this.errored = false;\n return _this;\n }\n DelaySubscriber.dispatch = function (state) {\n var source = state.source;\n var queue = source.queue;\n var scheduler = state.scheduler;\n var destination = state.destination;\n while (queue.length > 0 && (queue[0].time - scheduler.now()) <= 0) {\n queue.shift().notification.observe(destination);\n }\n if (queue.length > 0) {\n var delay_1 = Math.max(0, queue[0].time - scheduler.now());\n this.schedule(state, delay_1);\n }\n else {\n this.unsubscribe();\n source.active = false;\n }\n };\n DelaySubscriber.prototype._schedule = function (scheduler) {\n this.active = true;\n var destination = this.destination;\n destination.add(scheduler.schedule(DelaySubscriber.dispatch, this.delay, {\n source: this, destination: this.destination, scheduler: scheduler\n }));\n };\n DelaySubscriber.prototype.scheduleNotification = function (notification) {\n if (this.errored === true) {\n return;\n }\n var scheduler = this.scheduler;\n var message = new DelayMessage(scheduler.now() + this.delay, notification);\n this.queue.push(message);\n if (this.active === false) {\n this._schedule(scheduler);\n }\n };\n DelaySubscriber.prototype._next = function (value) {\n this.scheduleNotification(Notification.createNext(value));\n };\n DelaySubscriber.prototype._error = function (err) {\n this.errored = true;\n this.queue = [];\n this.destination.error(err);\n this.unsubscribe();\n };\n DelaySubscriber.prototype._complete = function () {\n this.scheduleNotification(Notification.createComplete());\n this.unsubscribe();\n };\n return DelaySubscriber;\n}(Subscriber));\nvar DelayMessage = /*@__PURE__*/ (function () {\n function DelayMessage(time, notification) {\n this.time = time;\n this.notification = notification;\n }\n return DelayMessage;\n}());\n//# sourceMappingURL=delay.js.map\n","/** PURE_IMPORTS_START PURE_IMPORTS_END */\nexport function isDate(value) {\n return value instanceof Date && !isNaN(+value);\n}\n//# sourceMappingURL=isDate.js.map\n","/** PURE_IMPORTS_START _switchMap PURE_IMPORTS_END */\nimport { switchMap } from './switchMap';\nexport function switchMapTo(innerObservable, resultSelector) {\n return resultSelector ? switchMap(function () { return innerObservable; }, resultSelector) : switchMap(function () { return innerObservable; });\n}\n//# sourceMappingURL=switchMapTo.js.map\n","/** PURE_IMPORTS_START _Observable,_util_noop PURE_IMPORTS_END */\nimport { Observable } from '../Observable';\nimport { noop } from '../util/noop';\nexport var NEVER = /*@__PURE__*/ new Observable(noop);\nexport function never() {\n return NEVER;\n}\n//# sourceMappingURL=never.js.map\n","/** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { Subscriber } from '../Subscriber';\nexport function scan(accumulator, seed) {\n var hasSeed = false;\n if (arguments.length >= 2) {\n hasSeed = true;\n }\n return function scanOperatorFunction(source) {\n return source.lift(new ScanOperator(accumulator, seed, hasSeed));\n };\n}\nvar ScanOperator = /*@__PURE__*/ (function () {\n function ScanOperator(accumulator, seed, hasSeed) {\n if (hasSeed === void 0) {\n hasSeed = false;\n }\n this.accumulator = accumulator;\n this.seed = seed;\n this.hasSeed = hasSeed;\n }\n ScanOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new ScanSubscriber(subscriber, this.accumulator, this.seed, this.hasSeed));\n };\n return ScanOperator;\n}());\nvar ScanSubscriber = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(ScanSubscriber, _super);\n function ScanSubscriber(destination, accumulator, _seed, hasSeed) {\n var _this = _super.call(this, destination) || this;\n _this.accumulator = accumulator;\n _this._seed = _seed;\n _this.hasSeed = hasSeed;\n _this.index = 0;\n return _this;\n }\n Object.defineProperty(ScanSubscriber.prototype, \"seed\", {\n get: function () {\n return this._seed;\n },\n set: function (value) {\n this.hasSeed = true;\n this._seed = value;\n },\n enumerable: true,\n configurable: true\n });\n ScanSubscriber.prototype._next = function (value) {\n if (!this.hasSeed) {\n this.seed = value;\n this.destination.next(value);\n }\n else {\n return this._tryNext(value);\n }\n };\n ScanSubscriber.prototype._tryNext = function (value) {\n var index = this.index++;\n var result;\n try {\n result = this.accumulator(this.seed, value, index);\n }\n catch (err) {\n this.destination.error(err);\n }\n this.seed = result;\n this.destination.next(result);\n };\n return ScanSubscriber;\n}(Subscriber));\n//# sourceMappingURL=scan.js.map\n","/** PURE_IMPORTS_START tslib,_AsyncAction PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { AsyncAction } from './AsyncAction';\nvar QueueAction = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(QueueAction, _super);\n function QueueAction(scheduler, work) {\n var _this = _super.call(this, scheduler, work) || this;\n _this.scheduler = scheduler;\n _this.work = work;\n return _this;\n }\n QueueAction.prototype.schedule = function (state, delay) {\n if (delay === void 0) {\n delay = 0;\n }\n if (delay > 0) {\n return _super.prototype.schedule.call(this, state, delay);\n }\n this.delay = delay;\n this.state = state;\n this.scheduler.flush(this);\n return this;\n };\n QueueAction.prototype.execute = function (state, delay) {\n return (delay > 0 || this.closed) ?\n _super.prototype.execute.call(this, state, delay) :\n this._execute(state, delay);\n };\n QueueAction.prototype.requestAsyncId = function (scheduler, id, delay) {\n if (delay === void 0) {\n delay = 0;\n }\n if ((delay !== null && delay > 0) || (delay === null && this.delay > 0)) {\n return _super.prototype.requestAsyncId.call(this, scheduler, id, delay);\n }\n return scheduler.flush(this);\n };\n return QueueAction;\n}(AsyncAction));\nexport { QueueAction };\n//# sourceMappingURL=QueueAction.js.map\n","/** PURE_IMPORTS_START _QueueAction,_QueueScheduler PURE_IMPORTS_END */\nimport { QueueAction } from './QueueAction';\nimport { QueueScheduler } from './QueueScheduler';\nexport var queue = /*@__PURE__*/ new QueueScheduler(QueueAction);\n//# sourceMappingURL=queue.js.map\n","/** PURE_IMPORTS_START tslib,_AsyncScheduler PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { AsyncScheduler } from './AsyncScheduler';\nvar QueueScheduler = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(QueueScheduler, _super);\n function QueueScheduler() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n return QueueScheduler;\n}(AsyncScheduler));\nexport { QueueScheduler };\n//# sourceMappingURL=QueueScheduler.js.map\n","/** PURE_IMPORTS_START tslib,_Subscriber,_Notification PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { Subscriber } from '../Subscriber';\nimport { Notification } from '../Notification';\nexport function observeOn(scheduler, delay) {\n if (delay === void 0) {\n delay = 0;\n }\n return function observeOnOperatorFunction(source) {\n return source.lift(new ObserveOnOperator(scheduler, delay));\n };\n}\nvar ObserveOnOperator = /*@__PURE__*/ (function () {\n function ObserveOnOperator(scheduler, delay) {\n if (delay === void 0) {\n delay = 0;\n }\n this.scheduler = scheduler;\n this.delay = delay;\n }\n ObserveOnOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new ObserveOnSubscriber(subscriber, this.scheduler, this.delay));\n };\n return ObserveOnOperator;\n}());\nexport { ObserveOnOperator };\nvar ObserveOnSubscriber = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(ObserveOnSubscriber, _super);\n function ObserveOnSubscriber(destination, scheduler, delay) {\n if (delay === void 0) {\n delay = 0;\n }\n var _this = _super.call(this, destination) || this;\n _this.scheduler = scheduler;\n _this.delay = delay;\n return _this;\n }\n ObserveOnSubscriber.dispatch = function (arg) {\n var notification = arg.notification, destination = arg.destination;\n notification.observe(destination);\n this.unsubscribe();\n };\n ObserveOnSubscriber.prototype.scheduleMessage = function (notification) {\n var destination = this.destination;\n destination.add(this.scheduler.schedule(ObserveOnSubscriber.dispatch, this.delay, new ObserveOnMessage(notification, this.destination)));\n };\n ObserveOnSubscriber.prototype._next = function (value) {\n this.scheduleMessage(Notification.createNext(value));\n };\n ObserveOnSubscriber.prototype._error = function (err) {\n this.scheduleMessage(Notification.createError(err));\n this.unsubscribe();\n };\n ObserveOnSubscriber.prototype._complete = function () {\n this.scheduleMessage(Notification.createComplete());\n this.unsubscribe();\n };\n return ObserveOnSubscriber;\n}(Subscriber));\nexport { ObserveOnSubscriber };\nvar ObserveOnMessage = /*@__PURE__*/ (function () {\n function ObserveOnMessage(notification, destination) {\n this.notification = notification;\n this.destination = destination;\n }\n return ObserveOnMessage;\n}());\nexport { ObserveOnMessage };\n//# sourceMappingURL=observeOn.js.map\n","/** PURE_IMPORTS_START tslib,_Subject,_scheduler_queue,_Subscription,_operators_observeOn,_util_ObjectUnsubscribedError,_SubjectSubscription PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { Subject } from './Subject';\nimport { queue } from './scheduler/queue';\nimport { Subscription } from './Subscription';\nimport { ObserveOnSubscriber } from './operators/observeOn';\nimport { ObjectUnsubscribedError } from './util/ObjectUnsubscribedError';\nimport { SubjectSubscription } from './SubjectSubscription';\nvar ReplaySubject = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(ReplaySubject, _super);\n function ReplaySubject(bufferSize, windowTime, scheduler) {\n if (bufferSize === void 0) {\n bufferSize = Number.POSITIVE_INFINITY;\n }\n if (windowTime === void 0) {\n windowTime = Number.POSITIVE_INFINITY;\n }\n var _this = _super.call(this) || this;\n _this.scheduler = scheduler;\n _this._events = [];\n _this._infiniteTimeWindow = false;\n _this._bufferSize = bufferSize < 1 ? 1 : bufferSize;\n _this._windowTime = windowTime < 1 ? 1 : windowTime;\n if (windowTime === Number.POSITIVE_INFINITY) {\n _this._infiniteTimeWindow = true;\n _this.next = _this.nextInfiniteTimeWindow;\n }\n else {\n _this.next = _this.nextTimeWindow;\n }\n return _this;\n }\n ReplaySubject.prototype.nextInfiniteTimeWindow = function (value) {\n var _events = this._events;\n _events.push(value);\n if (_events.length > this._bufferSize) {\n _events.shift();\n }\n _super.prototype.next.call(this, value);\n };\n ReplaySubject.prototype.nextTimeWindow = function (value) {\n this._events.push(new ReplayEvent(this._getNow(), value));\n this._trimBufferThenGetEvents();\n _super.prototype.next.call(this, value);\n };\n ReplaySubject.prototype._subscribe = function (subscriber) {\n var _infiniteTimeWindow = this._infiniteTimeWindow;\n var _events = _infiniteTimeWindow ? this._events : this._trimBufferThenGetEvents();\n var scheduler = this.scheduler;\n var len = _events.length;\n var subscription;\n if (this.closed) {\n throw new ObjectUnsubscribedError();\n }\n else if (this.isStopped || this.hasError) {\n subscription = Subscription.EMPTY;\n }\n else {\n this.observers.push(subscriber);\n subscription = new SubjectSubscription(this, subscriber);\n }\n if (scheduler) {\n subscriber.add(subscriber = new ObserveOnSubscriber(subscriber, scheduler));\n }\n if (_infiniteTimeWindow) {\n for (var i = 0; i < len && !subscriber.closed; i++) {\n subscriber.next(_events[i]);\n }\n }\n else {\n for (var i = 0; i < len && !subscriber.closed; i++) {\n subscriber.next(_events[i].value);\n }\n }\n if (this.hasError) {\n subscriber.error(this.thrownError);\n }\n else if (this.isStopped) {\n subscriber.complete();\n }\n return subscription;\n };\n ReplaySubject.prototype._getNow = function () {\n return (this.scheduler || queue).now();\n };\n ReplaySubject.prototype._trimBufferThenGetEvents = function () {\n var now = this._getNow();\n var _bufferSize = this._bufferSize;\n var _windowTime = this._windowTime;\n var _events = this._events;\n var eventsCount = _events.length;\n var spliceCount = 0;\n while (spliceCount < eventsCount) {\n if ((now - _events[spliceCount].time) < _windowTime) {\n break;\n }\n spliceCount++;\n }\n if (eventsCount > _bufferSize) {\n spliceCount = Math.max(spliceCount, eventsCount - _bufferSize);\n }\n if (spliceCount > 0) {\n _events.splice(0, spliceCount);\n }\n return _events;\n };\n return ReplaySubject;\n}(Subject));\nexport { ReplaySubject };\nvar ReplayEvent = /*@__PURE__*/ (function () {\n function ReplayEvent(time, value) {\n this.time = time;\n this.value = value;\n }\n return ReplayEvent;\n}());\n//# sourceMappingURL=ReplaySubject.js.map\n","/** PURE_IMPORTS_START _ReplaySubject PURE_IMPORTS_END */\nimport { ReplaySubject } from '../ReplaySubject';\nexport function shareReplay(configOrBufferSize, windowTime, scheduler) {\n var config;\n if (configOrBufferSize && typeof configOrBufferSize === 'object') {\n config = configOrBufferSize;\n }\n else {\n config = {\n bufferSize: configOrBufferSize,\n windowTime: windowTime,\n refCount: false,\n scheduler: scheduler\n };\n }\n return function (source) { return source.lift(shareReplayOperator(config)); };\n}\nfunction shareReplayOperator(_a) {\n var _b = _a.bufferSize, bufferSize = _b === void 0 ? Number.POSITIVE_INFINITY : _b, _c = _a.windowTime, windowTime = _c === void 0 ? Number.POSITIVE_INFINITY : _c, useRefCount = _a.refCount, scheduler = _a.scheduler;\n var subject;\n var refCount = 0;\n var subscription;\n var hasError = false;\n var isComplete = false;\n return function shareReplayOperation(source) {\n refCount++;\n if (!subject || hasError) {\n hasError = false;\n subject = new ReplaySubject(bufferSize, windowTime, scheduler);\n subscription = source.subscribe({\n next: function (value) { subject.next(value); },\n error: function (err) {\n hasError = true;\n subject.error(err);\n },\n complete: function () {\n isComplete = true;\n subject.complete();\n },\n });\n }\n var innerSub = subject.subscribe(this);\n this.add(function () {\n refCount--;\n innerSub.unsubscribe();\n if (subscription && !isComplete && useRefCount && refCount === 0) {\n subscription.unsubscribe();\n subscription = undefined;\n subject = undefined;\n }\n });\n };\n}\n//# sourceMappingURL=shareReplay.js.map\n","/** PURE_IMPORTS_START _Observable,_util_isArray,_util_isFunction,_operators_map PURE_IMPORTS_END */\nimport { Observable } from '../Observable';\nimport { isArray } from '../util/isArray';\nimport { isFunction } from '../util/isFunction';\nimport { map } from '../operators/map';\nvar toString = /*@__PURE__*/ (function () { return Object.prototype.toString; })();\nexport function fromEvent(target, eventName, options, resultSelector) {\n if (isFunction(options)) {\n resultSelector = options;\n options = undefined;\n }\n if (resultSelector) {\n return fromEvent(target, eventName, options).pipe(map(function (args) { return isArray(args) ? resultSelector.apply(void 0, args) : resultSelector(args); }));\n }\n return new Observable(function (subscriber) {\n function handler(e) {\n if (arguments.length > 1) {\n subscriber.next(Array.prototype.slice.call(arguments));\n }\n else {\n subscriber.next(e);\n }\n }\n setupSubscription(target, eventName, handler, subscriber, options);\n });\n}\nfunction setupSubscription(sourceObj, eventName, handler, subscriber, options) {\n var unsubscribe;\n if (isEventTarget(sourceObj)) {\n var source_1 = sourceObj;\n sourceObj.addEventListener(eventName, handler, options);\n unsubscribe = function () { return source_1.removeEventListener(eventName, handler, options); };\n }\n else if (isJQueryStyleEventEmitter(sourceObj)) {\n var source_2 = sourceObj;\n sourceObj.on(eventName, handler);\n unsubscribe = function () { return source_2.off(eventName, handler); };\n }\n else if (isNodeStyleEventEmitter(sourceObj)) {\n var source_3 = sourceObj;\n sourceObj.addListener(eventName, handler);\n unsubscribe = function () { return source_3.removeListener(eventName, handler); };\n }\n else if (sourceObj && sourceObj.length) {\n for (var i = 0, len = sourceObj.length; i < len; i++) {\n setupSubscription(sourceObj[i], eventName, handler, subscriber, options);\n }\n }\n else {\n throw new TypeError('Invalid event target');\n }\n subscriber.add(unsubscribe);\n}\nfunction isNodeStyleEventEmitter(sourceObj) {\n return sourceObj && typeof sourceObj.addListener === 'function' && typeof sourceObj.removeListener === 'function';\n}\nfunction isJQueryStyleEventEmitter(sourceObj) {\n return sourceObj && typeof sourceObj.on === 'function' && typeof sourceObj.off === 'function';\n}\nfunction isEventTarget(sourceObj) {\n return sourceObj && typeof sourceObj.addEventListener === 'function' && typeof sourceObj.removeEventListener === 'function';\n}\n//# sourceMappingURL=fromEvent.js.map\n","/** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { Subscriber } from '../Subscriber';\nexport function mapTo(value) {\n return function (source) { return source.lift(new MapToOperator(value)); };\n}\nvar MapToOperator = /*@__PURE__*/ (function () {\n function MapToOperator(value) {\n this.value = value;\n }\n MapToOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new MapToSubscriber(subscriber, this.value));\n };\n return MapToOperator;\n}());\nvar MapToSubscriber = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(MapToSubscriber, _super);\n function MapToSubscriber(destination, value) {\n var _this = _super.call(this, destination) || this;\n _this.value = value;\n return _this;\n }\n MapToSubscriber.prototype._next = function (x) {\n this.destination.next(this.value);\n };\n return MapToSubscriber;\n}(Subscriber));\n//# sourceMappingURL=mapTo.js.map\n","/** PURE_IMPORTS_START _of,_operators_concatAll PURE_IMPORTS_END */\nimport { of } from './of';\nimport { concatAll } from '../operators/concatAll';\nexport function concat() {\n var observables = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n observables[_i] = arguments[_i];\n }\n return concatAll()(of.apply(void 0, observables));\n}\n//# sourceMappingURL=concat.js.map\n","/** PURE_IMPORTS_START _mergeAll PURE_IMPORTS_END */\nimport { mergeAll } from './mergeAll';\nexport function concatAll() {\n return mergeAll(1);\n}\n//# sourceMappingURL=concatAll.js.map\n","/** PURE_IMPORTS_START _observable_concat,_util_isScheduler PURE_IMPORTS_END */\nimport { concat } from '../observable/concat';\nimport { isScheduler } from '../util/isScheduler';\nexport function startWith() {\n var array = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n array[_i] = arguments[_i];\n }\n var scheduler = array[array.length - 1];\n if (isScheduler(scheduler)) {\n array.pop();\n return function (source) { return concat(array, source, scheduler); };\n }\n else {\n return function (source) { return concat(array, source); };\n }\n}\n//# sourceMappingURL=startWith.js.map\n","/** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { Subscriber } from '../Subscriber';\nexport function distinctUntilChanged(compare, keySelector) {\n return function (source) { return source.lift(new DistinctUntilChangedOperator(compare, keySelector)); };\n}\nvar DistinctUntilChangedOperator = /*@__PURE__*/ (function () {\n function DistinctUntilChangedOperator(compare, keySelector) {\n this.compare = compare;\n this.keySelector = keySelector;\n }\n DistinctUntilChangedOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new DistinctUntilChangedSubscriber(subscriber, this.compare, this.keySelector));\n };\n return DistinctUntilChangedOperator;\n}());\nvar DistinctUntilChangedSubscriber = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(DistinctUntilChangedSubscriber, _super);\n function DistinctUntilChangedSubscriber(destination, compare, keySelector) {\n var _this = _super.call(this, destination) || this;\n _this.keySelector = keySelector;\n _this.hasKey = false;\n if (typeof compare === 'function') {\n _this.compare = compare;\n }\n return _this;\n }\n DistinctUntilChangedSubscriber.prototype.compare = function (x, y) {\n return x === y;\n };\n DistinctUntilChangedSubscriber.prototype._next = function (value) {\n var key;\n try {\n var keySelector = this.keySelector;\n key = keySelector ? keySelector(value) : value;\n }\n catch (err) {\n return this.destination.error(err);\n }\n var result = false;\n if (this.hasKey) {\n try {\n var compare = this.compare;\n result = compare(this.key, key);\n }\n catch (err) {\n return this.destination.error(err);\n }\n }\n else {\n this.hasKey = true;\n }\n if (!result) {\n this.key = key;\n this.destination.next(value);\n }\n };\n return DistinctUntilChangedSubscriber;\n}(Subscriber));\n//# sourceMappingURL=distinctUntilChanged.js.map\n","/** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { Subscriber } from '../Subscriber';\nexport function skip(count) {\n return function (source) { return source.lift(new SkipOperator(count)); };\n}\nvar SkipOperator = /*@__PURE__*/ (function () {\n function SkipOperator(total) {\n this.total = total;\n }\n SkipOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new SkipSubscriber(subscriber, this.total));\n };\n return SkipOperator;\n}());\nvar SkipSubscriber = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(SkipSubscriber, _super);\n function SkipSubscriber(destination, total) {\n var _this = _super.call(this, destination) || this;\n _this.total = total;\n _this.count = 0;\n return _this;\n }\n SkipSubscriber.prototype._next = function (x) {\n if (++this.count > this.total) {\n this.destination.next(x);\n }\n };\n return SkipSubscriber;\n}(Subscriber));\n//# sourceMappingURL=skip.js.map\n","/*\n * Copyright (c) 2016-2019 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable, fromEvent } from \"rxjs\"\nimport { ajax } from \"rxjs/ajax\"\nimport {\n distinctUntilChanged,\n map,\n mapTo,\n pluck,\n shareReplay,\n skip,\n startWith,\n switchMap\n} from \"rxjs/operators\"\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Switch options\n */\ninterface SwitchOptions {\n location$: Observable /* Location observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Data\n * ------------------------------------------------------------------------- */\n\n/**\n * Observable for document load events\n */\nconst load$ = fromEvent(document, \"DOMContentLoaded\")\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch document\n *\n * @return Document observable\n */\nexport function watchDocument(): Observable {\n return load$\n .pipe(\n mapTo(document),\n shareReplay(1)\n )\n}\n\n/**\n * Watch document switch\n *\n * This function returns an observables that fetches a document if the provided\n * location observable emits a new value (i.e. URL). If the emitted URL points\n * to the same page, the request is effectively ignored (e.g. when only the\n * fragment identifier changes)\n *\n * @param options - Options\n *\n * @return Document switch observable\n */\nexport function watchDocumentSwitch(\n { location$ }: SwitchOptions\n): Observable {\n return location$\n .pipe(\n startWith(location.href),\n map(url => url.replace(/#[^#]+$/, \"\")),\n distinctUntilChanged(),\n skip(1),\n\n /* Fetch document */\n switchMap(url => ajax({\n url,\n responseType: \"document\",\n withCredentials: true\n })\n .pipe(\n pluck(\"response\")\n )\n ),\n shareReplay(1)\n )\n}\n","/*\n * Copyright (c) 2016-2019 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Retrieve an element matching the query selector\n *\n * @template T - Element type\n *\n * @param selector - Query selector\n * @param node - Node of reference\n *\n * @return Element\n */\nexport function getElement(\n selector: string, node: ParentNode = document\n): T | undefined {\n return node.querySelector(selector) || undefined\n}\n\n/**\n * Retrieve all elements matching the query selector\n *\n * @template T - Element type\n *\n * @param selector - Query selector\n * @param node - Node of reference\n *\n * @return Elements\n */\nexport function getElements(\n selector: string, node: ParentNode = document\n): T[] {\n return Array.from(node.querySelectorAll(selector))\n}\n","/*\n * Copyright (c) 2016-2019 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable, fromEvent, merge } from \"rxjs\"\nimport { map, shareReplay, startWith } from \"rxjs/operators\"\n\nimport { Agent } from \"../../_\"\nimport { ViewportSize } from \"../../viewport\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Element offset\n */\nexport interface ElementOffset {\n x: number /* Horizontal offset */\n y: number /* Vertical offset */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Options\n */\ninterface Options {\n size$: Observable /* Viewport size observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Retrieve element offset\n *\n * @param el - HTML element\n *\n * @return Element offset\n */\nexport function getElementOffset(el: HTMLElement): ElementOffset {\n return {\n x: el.scrollLeft,\n y: el.scrollTop\n }\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Watch element offset\n *\n * @param el - Element\n * @param agent - Agent\n *\n * @return Element offset observable\n */\nexport function watchElementOffset(\n el: HTMLElement, { viewport }: Agent\n): Observable {\n const scroll$ = fromEvent(el, \"scroll\")\n return merge(scroll$, viewport.size$)\n .pipe(\n map(() => getElementOffset(el)),\n startWith(getElementOffset(el)),\n shareReplay(1)\n )\n}\n","/** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { Subscriber } from '../Subscriber';\nexport function refCount() {\n return function refCountOperatorFunction(source) {\n return source.lift(new RefCountOperator(source));\n };\n}\nvar RefCountOperator = /*@__PURE__*/ (function () {\n function RefCountOperator(connectable) {\n this.connectable = connectable;\n }\n RefCountOperator.prototype.call = function (subscriber, source) {\n var connectable = this.connectable;\n connectable._refCount++;\n var refCounter = new RefCountSubscriber(subscriber, connectable);\n var subscription = source.subscribe(refCounter);\n if (!refCounter.closed) {\n refCounter.connection = connectable.connect();\n }\n return subscription;\n };\n return RefCountOperator;\n}());\nvar RefCountSubscriber = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(RefCountSubscriber, _super);\n function RefCountSubscriber(destination, connectable) {\n var _this = _super.call(this, destination) || this;\n _this.connectable = connectable;\n return _this;\n }\n RefCountSubscriber.prototype._unsubscribe = function () {\n var connectable = this.connectable;\n if (!connectable) {\n this.connection = null;\n return;\n }\n this.connectable = null;\n var refCount = connectable._refCount;\n if (refCount <= 0) {\n this.connection = null;\n return;\n }\n connectable._refCount = refCount - 1;\n if (refCount > 1) {\n this.connection = null;\n return;\n }\n var connection = this.connection;\n var sharedConnection = connectable._connection;\n this.connection = null;\n if (sharedConnection && (!connection || sharedConnection === connection)) {\n sharedConnection.unsubscribe();\n }\n };\n return RefCountSubscriber;\n}(Subscriber));\n//# sourceMappingURL=refCount.js.map\n","/** PURE_IMPORTS_START tslib,_Subject,_Observable,_Subscriber,_Subscription,_operators_refCount PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { SubjectSubscriber } from '../Subject';\nimport { Observable } from '../Observable';\nimport { Subscriber } from '../Subscriber';\nimport { Subscription } from '../Subscription';\nimport { refCount as higherOrderRefCount } from '../operators/refCount';\nvar ConnectableObservable = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(ConnectableObservable, _super);\n function ConnectableObservable(source, subjectFactory) {\n var _this = _super.call(this) || this;\n _this.source = source;\n _this.subjectFactory = subjectFactory;\n _this._refCount = 0;\n _this._isComplete = false;\n return _this;\n }\n ConnectableObservable.prototype._subscribe = function (subscriber) {\n return this.getSubject().subscribe(subscriber);\n };\n ConnectableObservable.prototype.getSubject = function () {\n var subject = this._subject;\n if (!subject || subject.isStopped) {\n this._subject = this.subjectFactory();\n }\n return this._subject;\n };\n ConnectableObservable.prototype.connect = function () {\n var connection = this._connection;\n if (!connection) {\n this._isComplete = false;\n connection = this._connection = new Subscription();\n connection.add(this.source\n .subscribe(new ConnectableSubscriber(this.getSubject(), this)));\n if (connection.closed) {\n this._connection = null;\n connection = Subscription.EMPTY;\n }\n }\n return connection;\n };\n ConnectableObservable.prototype.refCount = function () {\n return higherOrderRefCount()(this);\n };\n return ConnectableObservable;\n}(Observable));\nexport { ConnectableObservable };\nexport var connectableObservableDescriptor = /*@__PURE__*/ (function () {\n var connectableProto = ConnectableObservable.prototype;\n return {\n operator: { value: null },\n _refCount: { value: 0, writable: true },\n _subject: { value: null, writable: true },\n _connection: { value: null, writable: true },\n _subscribe: { value: connectableProto._subscribe },\n _isComplete: { value: connectableProto._isComplete, writable: true },\n getSubject: { value: connectableProto.getSubject },\n connect: { value: connectableProto.connect },\n refCount: { value: connectableProto.refCount }\n };\n})();\nvar ConnectableSubscriber = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(ConnectableSubscriber, _super);\n function ConnectableSubscriber(destination, connectable) {\n var _this = _super.call(this, destination) || this;\n _this.connectable = connectable;\n return _this;\n }\n ConnectableSubscriber.prototype._error = function (err) {\n this._unsubscribe();\n _super.prototype._error.call(this, err);\n };\n ConnectableSubscriber.prototype._complete = function () {\n this.connectable._isComplete = true;\n this._unsubscribe();\n _super.prototype._complete.call(this);\n };\n ConnectableSubscriber.prototype._unsubscribe = function () {\n var connectable = this.connectable;\n if (connectable) {\n this.connectable = null;\n var connection = connectable._connection;\n connectable._refCount = 0;\n connectable._subject = null;\n connectable._connection = null;\n if (connection) {\n connection.unsubscribe();\n }\n }\n };\n return ConnectableSubscriber;\n}(SubjectSubscriber));\nvar RefCountOperator = /*@__PURE__*/ (function () {\n function RefCountOperator(connectable) {\n this.connectable = connectable;\n }\n RefCountOperator.prototype.call = function (subscriber, source) {\n var connectable = this.connectable;\n connectable._refCount++;\n var refCounter = new RefCountSubscriber(subscriber, connectable);\n var subscription = source.subscribe(refCounter);\n if (!refCounter.closed) {\n refCounter.connection = connectable.connect();\n }\n return subscription;\n };\n return RefCountOperator;\n}());\nvar RefCountSubscriber = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(RefCountSubscriber, _super);\n function RefCountSubscriber(destination, connectable) {\n var _this = _super.call(this, destination) || this;\n _this.connectable = connectable;\n return _this;\n }\n RefCountSubscriber.prototype._unsubscribe = function () {\n var connectable = this.connectable;\n if (!connectable) {\n this.connection = null;\n return;\n }\n this.connectable = null;\n var refCount = connectable._refCount;\n if (refCount <= 0) {\n this.connection = null;\n return;\n }\n connectable._refCount = refCount - 1;\n if (refCount > 1) {\n this.connection = null;\n return;\n }\n var connection = this.connection;\n var sharedConnection = connectable._connection;\n this.connection = null;\n if (sharedConnection && (!connection || sharedConnection === connection)) {\n sharedConnection.unsubscribe();\n }\n };\n return RefCountSubscriber;\n}(Subscriber));\n//# sourceMappingURL=ConnectableObservable.js.map\n","/** PURE_IMPORTS_START _observable_ConnectableObservable PURE_IMPORTS_END */\nimport { connectableObservableDescriptor } from '../observable/ConnectableObservable';\nexport function multicast(subjectOrSubjectFactory, selector) {\n return function multicastOperatorFunction(source) {\n var subjectFactory;\n if (typeof subjectOrSubjectFactory === 'function') {\n subjectFactory = subjectOrSubjectFactory;\n }\n else {\n subjectFactory = function subjectFactory() {\n return subjectOrSubjectFactory;\n };\n }\n if (typeof selector === 'function') {\n return source.lift(new MulticastOperator(subjectFactory, selector));\n }\n var connectable = Object.create(source, connectableObservableDescriptor);\n connectable.source = source;\n connectable.subjectFactory = subjectFactory;\n return connectable;\n };\n}\nvar MulticastOperator = /*@__PURE__*/ (function () {\n function MulticastOperator(subjectFactory, selector) {\n this.subjectFactory = subjectFactory;\n this.selector = selector;\n }\n MulticastOperator.prototype.call = function (subscriber, source) {\n var selector = this.selector;\n var subject = this.subjectFactory();\n var subscription = selector(subject).subscribe(subscriber);\n subscription.add(source.subscribe(subject));\n return subscription;\n };\n return MulticastOperator;\n}());\nexport { MulticastOperator };\n//# sourceMappingURL=multicast.js.map\n","/** PURE_IMPORTS_START _multicast,_refCount,_Subject PURE_IMPORTS_END */\nimport { multicast } from './multicast';\nimport { refCount } from './refCount';\nimport { Subject } from '../Subject';\nfunction shareSubjectFactory() {\n return new Subject();\n}\nexport function share() {\n return function (source) { return refCount()(multicast(shareSubjectFactory)(source)); };\n}\n//# sourceMappingURL=share.js.map\n","/*\n * Copyright (c) 2016-2019 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable, Subject, fromEvent } from \"rxjs\"\nimport { filter, map, share } from \"rxjs/operators\"\n\n/* ----------------------------------------------------------------------------\n * Data\n * ------------------------------------------------------------------------- */\n\n/**\n * Observable for window hash change events\n */\nconst hashchange$ = fromEvent(window, \"hashchange\")\n\n/**\n * Observable for window pop state events\n */\nconst popstate$ = fromEvent(window, \"popstate\")\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch location\n *\n * @return Location subject\n */\nexport function watchLocation(): Subject {\n const location$ = new Subject()\n popstate$\n .pipe(\n map(() => location.href),\n share()\n )\n .subscribe(location$)\n\n /* Return subject */\n return location$\n}\n\n/**\n * Watch location hash\n *\n * @return Location hash observable\n */\nexport function watchLocationHash(): Observable {\n return hashchange$\n .pipe(\n map(() => location.hash),\n filter(hash => hash.length > 0),\n share()\n )\n}\n","/*\n * Copyright (c) 2016-2019 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable, fromEventPattern } from \"rxjs\"\nimport { shareReplay, startWith } from \"rxjs/operators\"\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch media query\n *\n * @param query - Media query\n *\n * @return Media observable\n */\nexport function watchMedia(query: string): Observable {\n const media = matchMedia(query)\n return fromEventPattern(next =>\n media.addListener(() => next(media.matches))\n )\n .pipe(\n startWith(media.matches),\n shareReplay(1)\n )\n}\n","/** PURE_IMPORTS_START _Observable,_util_isArray,_util_isFunction,_operators_map PURE_IMPORTS_END */\nimport { Observable } from '../Observable';\nimport { isArray } from '../util/isArray';\nimport { isFunction } from '../util/isFunction';\nimport { map } from '../operators/map';\nexport function fromEventPattern(addHandler, removeHandler, resultSelector) {\n if (resultSelector) {\n return fromEventPattern(addHandler, removeHandler).pipe(map(function (args) { return isArray(args) ? resultSelector.apply(void 0, args) : resultSelector(args); }));\n }\n return new Observable(function (subscriber) {\n var handler = function () {\n var e = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n e[_i] = arguments[_i];\n }\n return subscriber.next(e.length === 1 ? e[0] : e);\n };\n var retValue;\n try {\n retValue = addHandler(handler);\n }\n catch (err) {\n subscriber.error(err);\n return undefined;\n }\n if (!isFunction(removeHandler)) {\n return undefined;\n }\n return function () { return removeHandler(handler, retValue); };\n });\n}\n//# sourceMappingURL=fromEventPattern.js.map\n","/*\n * Copyright (c) 2016-2019 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable, fromEvent, merge } from \"rxjs\"\nimport { map, shareReplay, startWith } from \"rxjs/operators\"\n\n/* ----------------------------------------------------------------------------\n * Data\n * ------------------------------------------------------------------------- */\n\n/**\n * Observable for window scroll events\n */\nconst scroll$ = fromEvent(window, \"scroll\")\n\n/**\n * Observable for window resize events\n */\nconst resize$ = fromEvent(window, \"resize\")\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Viewport offset\n */\nexport interface ViewportOffset {\n x: number /* Horizontal offset */\n y: number /* Vertical offset */\n}\n\n/**\n * Viewport size\n */\nexport interface ViewportSize {\n width: number /* Viewport width */\n height: number /* Viewport height */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Retrieve viewport offset\n *\n * @return Viewport offset\n */\nexport function getViewportOffset(): ViewportOffset {\n return {\n x: pageXOffset,\n y: pageYOffset\n }\n}\n\n/**\n * Retrieve viewport size\n *\n * @return Viewport size\n */\nexport function getViewportSize(): ViewportSize {\n return {\n width: innerWidth,\n height: innerHeight\n }\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Watch viewport offset\n *\n * @return Viewport offset observable\n */\nexport function watchViewportOffset(): Observable {\n return merge(scroll$, resize$)\n .pipe(\n map(getViewportOffset),\n startWith(getViewportOffset()),\n shareReplay(1)\n )\n}\n\n/**\n * Watch viewport size\n *\n * @return Viewport size observable\n */\nexport function watchViewportSize(): Observable {\n return resize$\n .pipe(\n map(getViewportSize),\n startWith(getViewportSize()),\n shareReplay(1)\n )\n}\n","/** PURE_IMPORTS_START tslib,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { OuterSubscriber } from '../OuterSubscriber';\nimport { subscribeToResult } from '../util/subscribeToResult';\nexport var defaultThrottleConfig = {\n leading: true,\n trailing: false\n};\nexport function throttle(durationSelector, config) {\n if (config === void 0) {\n config = defaultThrottleConfig;\n }\n return function (source) { return source.lift(new ThrottleOperator(durationSelector, config.leading, config.trailing)); };\n}\nvar ThrottleOperator = /*@__PURE__*/ (function () {\n function ThrottleOperator(durationSelector, leading, trailing) {\n this.durationSelector = durationSelector;\n this.leading = leading;\n this.trailing = trailing;\n }\n ThrottleOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new ThrottleSubscriber(subscriber, this.durationSelector, this.leading, this.trailing));\n };\n return ThrottleOperator;\n}());\nvar ThrottleSubscriber = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(ThrottleSubscriber, _super);\n function ThrottleSubscriber(destination, durationSelector, _leading, _trailing) {\n var _this = _super.call(this, destination) || this;\n _this.destination = destination;\n _this.durationSelector = durationSelector;\n _this._leading = _leading;\n _this._trailing = _trailing;\n _this._hasValue = false;\n return _this;\n }\n ThrottleSubscriber.prototype._next = function (value) {\n this._hasValue = true;\n this._sendValue = value;\n if (!this._throttled) {\n if (this._leading) {\n this.send();\n }\n else {\n this.throttle(value);\n }\n }\n };\n ThrottleSubscriber.prototype.send = function () {\n var _a = this, _hasValue = _a._hasValue, _sendValue = _a._sendValue;\n if (_hasValue) {\n this.destination.next(_sendValue);\n this.throttle(_sendValue);\n }\n this._hasValue = false;\n this._sendValue = null;\n };\n ThrottleSubscriber.prototype.throttle = function (value) {\n var duration = this.tryDurationSelector(value);\n if (!!duration) {\n this.add(this._throttled = subscribeToResult(this, duration));\n }\n };\n ThrottleSubscriber.prototype.tryDurationSelector = function (value) {\n try {\n return this.durationSelector(value);\n }\n catch (err) {\n this.destination.error(err);\n return null;\n }\n };\n ThrottleSubscriber.prototype.throttlingDone = function () {\n var _a = this, _throttled = _a._throttled, _trailing = _a._trailing;\n if (_throttled) {\n _throttled.unsubscribe();\n }\n this._throttled = null;\n if (_trailing) {\n this.send();\n }\n };\n ThrottleSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {\n this.throttlingDone();\n };\n ThrottleSubscriber.prototype.notifyComplete = function () {\n this.throttlingDone();\n };\n return ThrottleSubscriber;\n}(OuterSubscriber));\n//# sourceMappingURL=throttle.js.map\n","/*\n * Copyright (c) 2016-2019 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable, fromEvent } from \"rxjs\"\nimport { pluck, share, switchMapTo, tap, throttle } from \"rxjs/operators\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Worker message\n */\nexport interface WorkerMessage {\n type: unknown /* Message type */\n data: unknown /* Message data */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Options\n *\n * @template T - Worker message type\n */\ninterface Options {\n send$: Observable /* Message observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch a web worker\n *\n * This function returns an observable that will send all values emitted by the\n * message observable to the web worker. Web worker communication is expected\n * to be bidirectional (request-response) and synchronous. Messages that are\n * emitted during a pending request are throttled, the last one is emitted.\n *\n * @param worker - Web worker\n *\n * @return Worker message observable\n */\nexport function watchWorker(\n worker: Worker, { send$ }: Options\n): Observable {\n\n /* Intercept messages from web worker */\n const recv$ = fromEvent(worker, \"message\")\n .pipe(\n pluck(\"data\"),\n share()\n )\n\n /* Send and receive messages, return hot observable */\n return send$\n .pipe(\n throttle(() => recv$, { leading: true, trailing: true }),\n tap(message => worker.postMessage(message)),\n switchMapTo(recv$),\n share()\n )\n}\n","/** PURE_IMPORTS_START tslib,_AsyncAction PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { AsyncAction } from './AsyncAction';\nvar AnimationFrameAction = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(AnimationFrameAction, _super);\n function AnimationFrameAction(scheduler, work) {\n var _this = _super.call(this, scheduler, work) || this;\n _this.scheduler = scheduler;\n _this.work = work;\n return _this;\n }\n AnimationFrameAction.prototype.requestAsyncId = function (scheduler, id, delay) {\n if (delay === void 0) {\n delay = 0;\n }\n if (delay !== null && delay > 0) {\n return _super.prototype.requestAsyncId.call(this, scheduler, id, delay);\n }\n scheduler.actions.push(this);\n return scheduler.scheduled || (scheduler.scheduled = requestAnimationFrame(function () { return scheduler.flush(null); }));\n };\n AnimationFrameAction.prototype.recycleAsyncId = function (scheduler, id, delay) {\n if (delay === void 0) {\n delay = 0;\n }\n if ((delay !== null && delay > 0) || (delay === null && this.delay > 0)) {\n return _super.prototype.recycleAsyncId.call(this, scheduler, id, delay);\n }\n if (scheduler.actions.length === 0) {\n cancelAnimationFrame(id);\n scheduler.scheduled = undefined;\n }\n return undefined;\n };\n return AnimationFrameAction;\n}(AsyncAction));\nexport { AnimationFrameAction };\n//# sourceMappingURL=AnimationFrameAction.js.map\n","/** PURE_IMPORTS_START _AnimationFrameAction,_AnimationFrameScheduler PURE_IMPORTS_END */\nimport { AnimationFrameAction } from './AnimationFrameAction';\nimport { AnimationFrameScheduler } from './AnimationFrameScheduler';\nexport var animationFrame = /*@__PURE__*/ new AnimationFrameScheduler(AnimationFrameAction);\n//# sourceMappingURL=animationFrame.js.map\n","/** PURE_IMPORTS_START tslib,_AsyncScheduler PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { AsyncScheduler } from './AsyncScheduler';\nvar AnimationFrameScheduler = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(AnimationFrameScheduler, _super);\n function AnimationFrameScheduler() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n AnimationFrameScheduler.prototype.flush = function (action) {\n this.active = true;\n this.scheduled = undefined;\n var actions = this.actions;\n var error;\n var index = -1;\n var count = actions.length;\n action = action || actions.shift();\n do {\n if (error = action.execute(action.state, action.delay)) {\n break;\n }\n } while (++index < count && (action = actions.shift()));\n this.active = false;\n if (error) {\n while (++index < count && (action = actions.shift())) {\n action.unsubscribe();\n }\n throw error;\n }\n };\n return AnimationFrameScheduler;\n}(AsyncScheduler));\nexport { AnimationFrameScheduler };\n//# sourceMappingURL=AnimationFrameScheduler.js.map\n","/** PURE_IMPORTS_START tslib,_Subscriber,_Subscription PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { Subscriber } from '../Subscriber';\nimport { Subscription } from '../Subscription';\nexport function finalize(callback) {\n return function (source) { return source.lift(new FinallyOperator(callback)); };\n}\nvar FinallyOperator = /*@__PURE__*/ (function () {\n function FinallyOperator(callback) {\n this.callback = callback;\n }\n FinallyOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new FinallySubscriber(subscriber, this.callback));\n };\n return FinallyOperator;\n}());\nvar FinallySubscriber = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(FinallySubscriber, _super);\n function FinallySubscriber(destination, callback) {\n var _this = _super.call(this, destination) || this;\n _this.add(new Subscription(callback));\n return _this;\n }\n return FinallySubscriber;\n}(Subscriber));\n//# sourceMappingURL=finalize.js.map\n","/*\n * Copyright (c) 2016-2019 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { getElement } from \"../agent\"\n\n/* ----------------------------------------------------------------------------\n * Data\n * ------------------------------------------------------------------------- */\n\n/**\n * Translations\n */\nlet lang: Record\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Truncate a string after the given number of characters\n *\n * @param value - Value to be truncated\n * @param n - Number of characters\n *\n * @return Truncated value\n */\nexport function truncate(value: string, n: number): string {\n let i = n\n if (value.length > i) {\n while (value[i] !== \" \" && --i > 0); // tslint:disable-line\n return `${value.substring(0, i)}...`\n }\n return value\n}\n\n/**\n * Translate the given key\n *\n * @param key - Key to be translated\n * @param value - Value to be replaced\n *\n * @return Translation\n */\nexport function translate(key: string, value?: string): string {\n if (typeof lang === \"undefined\") {\n const el = getElement(\"#__lang\")!\n lang = JSON.parse(el.innerText)\n }\n if (typeof lang[key] === \"undefined\") {\n throw new ReferenceError(`Invalid translation: ${key}`)\n }\n return typeof value !== \"undefined\"\n ? lang[key].replace(\"#\", value)\n : lang[key]\n}\n","/*\n * Copyright (c) 2016-2019 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Set anchor blur\n *\n * @param el - Anchor element\n * @param value - Whether the anchor is blurred\n */\nexport function setAnchorBlur(\n el: HTMLElement, value: boolean\n): void {\n el.setAttribute(\"data-md-state\", value ? \"blur\" : \"\")\n}\n\n/**\n * Reset anchor blur\n *\n * @param el - Anchor element\n */\nexport function resetAnchorBlur(\n el: HTMLElement\n): void {\n el.removeAttribute(\"data-md-state\")\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Set anchor active\n *\n * @param el - Anchor element\n * @param value - Whether the anchor is active\n */\nexport function setAnchorActive(\n el: HTMLElement, value: boolean\n): void {\n el.classList.toggle(\"md-nav__link--active\", value)\n}\n\n/**\n * Reset anchor active\n *\n * @param el - Anchor element\n */\nexport function resetAnchorActive(\n el: HTMLElement\n): void {\n el.classList.remove(\"md-nav__link--active\")\n}\n","/*\n * Copyright (c) 2016-2019 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { translate } from \"utilities\"\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Set number of search results\n *\n * @param el - Search result metadata element\n * @param value - Number of results\n */\nexport function setSearchResultMeta(\n el: HTMLElement, value: number\n): void {\n el.textContent = value > 1\n ? translate(\"search.result.other\", value.toString())\n : value === 1\n ? translate(\"search.result.one\")\n : translate(\"search.result.none\")\n}\n\n/**\n * Reset number of search results\n *\n * @param el - Search result metadata element\n */\nexport function resetSearchResultMeta(\n el: HTMLElement\n): void {\n el.textContent = translate(\"search.result.placeholder\")\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Add an element to the search result list\n *\n * @param el - Search result list element\n * @param child - Search result element\n */\nexport function addToSearchResultList(\n el: HTMLElement, child: HTMLElement\n): void {\n el.appendChild(child)\n}\n\n/**\n * Reset search result list\n *\n * @param el - Search result list element\n */\nexport function resetSearchResultList(\n el: HTMLElement\n): void {\n el.innerHTML = \"\"\n}\n","/*\n * Copyright (c) 2016-2019 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { OperatorFunction, animationFrameScheduler, pipe } from \"rxjs\"\nimport {\n distinctUntilChanged,\n finalize,\n map,\n observeOn,\n tap\n} from \"rxjs/operators\"\n\nimport { resetHidden, setHidden } from \"actions\"\n\nimport { ViewportOffset } from \"../agent\"\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Paint hideable from source observable\n *\n * @param el - Hideable element\n * @param offset - Additional offset\n *\n * @return Operator function\n */\nexport function paintHidden(\n el: HTMLElement, offset: number = 0\n): OperatorFunction {\n return pipe(\n map(({ y }) => y >= offset),\n distinctUntilChanged(),\n\n /* Defer repaint to next animation frame */\n observeOn(animationFrameScheduler),\n tap(value => {\n setHidden(el, value)\n }),\n\n /* Reset on complete or error */\n finalize(() => {\n resetHidden(el)\n })\n )\n}\n","/*\n * Copyright (c) 2016-2019 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Set hidden\n *\n * @param el - Hideable element\n * @param value - Whether the element is hidden\n */\nexport function setHidden(\n el: HTMLElement, value: boolean\n): void {\n el.setAttribute(\"data-md-state\", value ? \"hidden\" : \"\")\n}\n\n/**\n * Reset hidden\n *\n * @param el - Hideable element\n */\nexport function resetHidden(\n el: HTMLElement\n): void {\n el.removeAttribute(\"data-md-state\")\n}\n","/*\n * Copyright (c) 2016-2019 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable, defer, of } from \"rxjs\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Header state\n */\nexport interface HeaderState {\n sticky: boolean /* Header stickyness */\n height: number /* Header visible height */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch header\n *\n * The header is wrapped in an observable to pave the way for auto-hiding or\n * other dynamic behaviors that may be implemented later on.\n *\n * @param el - Header element\n *\n * @return Header state observable\n */\nexport function watchHeader(\n el: HTMLElement\n): Observable {\n return defer(() => {\n const sticky = getComputedStyle(el)\n .getPropertyValue(\"position\") === \"fixed\"\n\n /* Return header as hot observable */\n return of({\n sticky,\n height: sticky ? el.offsetHeight : 0\n })\n })\n}\n","/** PURE_IMPORTS_START _Observable,_from,_empty PURE_IMPORTS_END */\nimport { Observable } from '../Observable';\nimport { from } from './from';\nimport { empty } from './empty';\nexport function defer(observableFactory) {\n return new Observable(function (subscriber) {\n var input;\n try {\n input = observableFactory();\n }\n catch (err) {\n subscriber.error(err);\n return undefined;\n }\n var source = input ? from(input) : empty();\n return source.subscribe(subscriber);\n });\n}\n//# sourceMappingURL=defer.js.map\n","/** PURE_IMPORTS_START tslib,_util_isScheduler,_util_isArray,_OuterSubscriber,_util_subscribeToResult,_fromArray PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { isScheduler } from '../util/isScheduler';\nimport { isArray } from '../util/isArray';\nimport { OuterSubscriber } from '../OuterSubscriber';\nimport { subscribeToResult } from '../util/subscribeToResult';\nimport { fromArray } from './fromArray';\nvar NONE = {};\nexport function combineLatest() {\n var observables = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n observables[_i] = arguments[_i];\n }\n var resultSelector = null;\n var scheduler = null;\n if (isScheduler(observables[observables.length - 1])) {\n scheduler = observables.pop();\n }\n if (typeof observables[observables.length - 1] === 'function') {\n resultSelector = observables.pop();\n }\n if (observables.length === 1 && isArray(observables[0])) {\n observables = observables[0];\n }\n return fromArray(observables, scheduler).lift(new CombineLatestOperator(resultSelector));\n}\nvar CombineLatestOperator = /*@__PURE__*/ (function () {\n function CombineLatestOperator(resultSelector) {\n this.resultSelector = resultSelector;\n }\n CombineLatestOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new CombineLatestSubscriber(subscriber, this.resultSelector));\n };\n return CombineLatestOperator;\n}());\nexport { CombineLatestOperator };\nvar CombineLatestSubscriber = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(CombineLatestSubscriber, _super);\n function CombineLatestSubscriber(destination, resultSelector) {\n var _this = _super.call(this, destination) || this;\n _this.resultSelector = resultSelector;\n _this.active = 0;\n _this.values = [];\n _this.observables = [];\n return _this;\n }\n CombineLatestSubscriber.prototype._next = function (observable) {\n this.values.push(NONE);\n this.observables.push(observable);\n };\n CombineLatestSubscriber.prototype._complete = function () {\n var observables = this.observables;\n var len = observables.length;\n if (len === 0) {\n this.destination.complete();\n }\n else {\n this.active = len;\n this.toRespond = len;\n for (var i = 0; i < len; i++) {\n var observable = observables[i];\n this.add(subscribeToResult(this, observable, observable, i));\n }\n }\n };\n CombineLatestSubscriber.prototype.notifyComplete = function (unused) {\n if ((this.active -= 1) === 0) {\n this.destination.complete();\n }\n };\n CombineLatestSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {\n var values = this.values;\n var oldVal = values[outerIndex];\n var toRespond = !this.toRespond\n ? 0\n : oldVal === NONE ? --this.toRespond : this.toRespond;\n values[outerIndex] = innerValue;\n if (toRespond === 0) {\n if (this.resultSelector) {\n this._tryResultSelector(values);\n }\n else {\n this.destination.next(values.slice());\n }\n }\n };\n CombineLatestSubscriber.prototype._tryResultSelector = function (values) {\n var result;\n try {\n result = this.resultSelector.apply(this, values);\n }\n catch (err) {\n this.destination.error(err);\n return;\n }\n this.destination.next(result);\n };\n return CombineLatestSubscriber;\n}(OuterSubscriber));\nexport { CombineLatestSubscriber };\n//# sourceMappingURL=combineLatest.js.map\n","/*\n * Copyright (c) 2016-2019 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable, combineLatest } from \"rxjs\"\nimport {\n distinctUntilChanged,\n map,\n shareReplay,\n switchMapTo\n} from \"rxjs/operators\"\n\nimport { Agent, ViewportOffset } from \"utilities\"\n\nimport { HeaderState } from \"../_\"\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Options\n */\ninterface Options {\n header$: Observable /* Header state observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch viewport offset relative to an element's top\n *\n * This function returns an observable that computes the relative offset to the\n * top of the given element based on the current viewport offset.\n *\n * @param el - HTML element\n * @param agent - Agent\n * @param options - Options\n *\n * @return Viewport offset observable\n */\nexport function watchViewportOffsetFromTopOf(\n el: HTMLElement, { viewport }: Agent, { header$ }: Options\n): Observable {\n\n /* Compute necessary adjustment for offset */\n const adjust$ = viewport.size$\n .pipe(\n switchMapTo(header$),\n map(({ height }) => el.offsetTop - height),\n distinctUntilChanged()\n )\n\n /* Compute relative offset and return as hot observable */\n return combineLatest([viewport.offset$, adjust$])\n .pipe(\n map(([{ x, y }, adjust]) => ({ x, y: y - adjust })),\n shareReplay(1)\n )\n}\n\n/**\n * Watch viewport offset relative to an element's bottom\n *\n * This function returns an observable that computes the relative offset to the\n * bottom of the given element based on the current viewport offset.\n *\n * @param el - HTML element\n * @param agent - Agent\n * @param options - Options\n *\n * @return Viewport offset observable\n */\nexport function watchViewportOffsetFromBottomOf(\n el: HTMLElement, { viewport }: Agent, { header$ }: Options\n): Observable {\n\n /* Compute necessary adjustment for offset */\n const adjust$ = viewport.size$\n .pipe(\n switchMapTo(header$),\n map(({ height }) => el.offsetTop + el.offsetHeight - height),\n distinctUntilChanged()\n )\n\n /* Compute relative offset and return as hot observable */\n return combineLatest([viewport.offset$, adjust$])\n .pipe(\n map(([{ x, y }, adjust]) => ({ x, y: y - adjust })),\n shareReplay(1)\n )\n}\n","/*\n * Copyright (c) 2016-2019 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n MonoTypeOperatorFunction,\n animationFrameScheduler,\n pipe\n} from \"rxjs\"\nimport {\n distinctUntilKeyChanged,\n finalize,\n observeOn,\n tap\n} from \"rxjs/operators\"\n\nimport { resetHeaderShadow, setHeaderShadow } from \"actions\"\n\nimport { MainState } from \"../../main\"\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Paint header shadow from source observable\n *\n * @param el - Header element\n *\n * @return Operator function\n */\nexport function paintHeaderShadow(\n el: HTMLElement\n): MonoTypeOperatorFunction {\n return pipe(\n distinctUntilKeyChanged(\"active\"),\n\n /* Defer repaint to next animation frame */\n observeOn(animationFrameScheduler),\n tap(({ active }) => {\n setHeaderShadow(el, active)\n }),\n\n /* Reset on complete or error */\n finalize(() => {\n resetHeaderShadow(el)\n })\n )\n}\n","/** PURE_IMPORTS_START _distinctUntilChanged PURE_IMPORTS_END */\nimport { distinctUntilChanged } from './distinctUntilChanged';\nexport function distinctUntilKeyChanged(key, compare) {\n return distinctUntilChanged(function (x, y) { return compare ? compare(x[key], y[key]) : x[key] === y[key]; });\n}\n//# sourceMappingURL=distinctUntilKeyChanged.js.map\n","/*\n * Copyright (c) 2016-2019 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Set header shadow\n *\n * @param el - Header element\n * @param value - Whether the shadow is shown\n */\nexport function setHeaderShadow(\n el: HTMLElement, value: boolean\n): void {\n el.setAttribute(\"data-md-state\", value ? \"shadow\" : \"\")\n}\n\n/**\n * Reset header shadow\n *\n * @param el - Header element\n */\nexport function resetHeaderShadow(\n el: HTMLElement\n): void {\n el.removeAttribute(\"data-md-state\")\n}\n","/*\n * Copyright (c) 2016-2019 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { JSX as JSXInternal } from \"preact\"\nimport { keys } from \"ramda\"\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * HTML attributes\n */\ntype Attributes =\n & JSXInternal.HTMLAttributes\n & JSXInternal.SVGAttributes\n & Record\n\n/**\n * Child element\n */\ntype Child = Child[] | HTMLElement | Text | string | number\n\n/* ----------------------------------------------------------------------------\n * Helper functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Append a child node to an element\n *\n * @param el - HTML element\n * @param child - Child node\n */\nfunction appendChild(el: HTMLElement, child: Child): void {\n\n /* Handle primitive types (including raw HTML) */\n if (typeof child === \"string\" || typeof child === \"number\") {\n el.innerHTML += child.toString()\n\n /* Handle nodes */\n } else if (child instanceof Node) {\n el.appendChild(child)\n\n /* Handle nested children */\n } else if (Array.isArray(child)) {\n for (const node of child)\n appendChild(el, node)\n }\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * JSX factory\n *\n * @param tag - HTML tag\n * @param attributes - HTML attributes\n * @param children - Child elements\n *\n * @return HTML element\n */\nexport function h(\n tag: string, attributes: Attributes | null,\n ...children: Array\n): HTMLElement {\n const el = document.createElement(tag)\n\n /* Set attributes, if any */\n if (attributes)\n for (const attr of keys(attributes))\n if (typeof attributes[attr] !== \"boolean\")\n el.setAttribute(attr, attributes[attr])\n else if (attributes[attr])\n el.setAttribute(attr, \"\")\n\n /* Append child nodes */\n for (const child of children)\n appendChild(el, child)\n\n /* Return element */\n return el\n}\n\n/**\n * JSX factory wrapper\n *\n * @param el - JSX element\n *\n * @return HTML element\n */\nexport function toHTMLElement(el: JSXInternal.Element): HTMLElement {\n return el as any // Hack: if you have a better idea, PR!\n}\n\n/* ----------------------------------------------------------------------------\n * Namespace\n * ------------------------------------------------------------------------- */\n\nexport declare namespace h {\n export import JSX = JSXInternal\n}\n","/** PURE_IMPORTS_START tslib,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { OuterSubscriber } from '../OuterSubscriber';\nimport { subscribeToResult } from '../util/subscribeToResult';\nexport function takeUntil(notifier) {\n return function (source) { return source.lift(new TakeUntilOperator(notifier)); };\n}\nvar TakeUntilOperator = /*@__PURE__*/ (function () {\n function TakeUntilOperator(notifier) {\n this.notifier = notifier;\n }\n TakeUntilOperator.prototype.call = function (subscriber, source) {\n var takeUntilSubscriber = new TakeUntilSubscriber(subscriber);\n var notifierSubscription = subscribeToResult(takeUntilSubscriber, this.notifier);\n if (notifierSubscription && !takeUntilSubscriber.seenValue) {\n takeUntilSubscriber.add(notifierSubscription);\n return source.subscribe(takeUntilSubscriber);\n }\n return takeUntilSubscriber;\n };\n return TakeUntilOperator;\n}());\nvar TakeUntilSubscriber = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(TakeUntilSubscriber, _super);\n function TakeUntilSubscriber(destination) {\n var _this = _super.call(this, destination) || this;\n _this.seenValue = false;\n return _this;\n }\n TakeUntilSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {\n this.seenValue = true;\n this.complete();\n };\n TakeUntilSubscriber.prototype.notifyComplete = function () {\n };\n return TakeUntilSubscriber;\n}(OuterSubscriber));\n//# sourceMappingURL=takeUntil.js.map\n","/*\n * Copyright (c) 2016-2019 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n EMPTY,\n Observable,\n OperatorFunction,\n combineLatest,\n of,\n pipe\n} from \"rxjs\"\nimport {\n filter,\n switchMap,\n takeUntil\n} from \"rxjs/operators\"\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Toggle switch map with another observable\n *\n * @template T - Source value type\n * @template U - Target value type\n *\n * @param toggle$ - Toggle observable\n * @param project - Projection\n *\n * @return Operator function\n */\nexport function switchMapIf(\n toggle$: Observable, project: (value: T) => Observable\n): OperatorFunction {\n const begin$ = toggle$.pipe(filter(value => value))\n const end$ = toggle$.pipe(filter(value => !value))\n return pipe(\n switchMap(value => combineLatest([of(value), begin$])),\n switchMap(([value, active]) => active\n ? project(value)\n .pipe(\n takeUntil(end$)\n )\n : EMPTY\n )\n )\n}\n","/*\n * Copyright (c) 2016-2019 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable, OperatorFunction, pipe } from \"rxjs\"\nimport { map, shareReplay } from \"rxjs/operators\"\n\nimport { switchMapIf } from \"extensions\"\nimport { Agent, paintHidden } from \"utilities\"\n\nimport { HeaderState, watchViewportOffsetFromTopOf } from \"../header\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Hero state\n */\nexport interface HeroState {\n hidden: boolean /* Whether the hero is hidden */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Options\n */\ninterface Options {\n header$: Observable /* Header state observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch hero\n *\n * @param el - Hero element\n * @param agent - Agent\n * @param options - Options\n *\n * @return Hero state\n */\nexport function watchHero(\n el: HTMLElement, agent: Agent, { header$ }: Options\n): Observable {\n\n /* Watch and paint visibility */\n const hidden$ = watchViewportOffsetFromTopOf(el, agent, { header$ })\n .pipe(\n paintHidden(el, 20)\n )\n\n /* Combine into a single hot observable */\n return hidden$\n .pipe(\n map(hidden => ({ hidden }))\n )\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Mount hero from source observable\n *\n * @param agent - Agent\n * @param options - Options\n *\n * @return Operator function\n */\nexport function mountHero(\n agent: Agent, options: Options\n): OperatorFunction {\n const { media } = agent\n return pipe(\n switchMapIf(media.screen$, el => watchHero(el, agent, options)),\n shareReplay(1)\n )\n}\n","/*\n * Copyright (c) 2016-2019 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable, OperatorFunction, combineLatest, pipe } from \"rxjs\"\nimport {\n distinctUntilChanged,\n map,\n pluck,\n shareReplay,\n switchMap\n} from \"rxjs/operators\"\n\nimport { Agent } from \"utilities\"\n\nimport { HeaderState } from \"../../header\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Main area state\n */\nexport interface MainState {\n offset: number /* Main area top offset */\n height: number /* Main area visible height */\n active: boolean /* Scrolled past top offset */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Options\n */\ninterface Options {\n header$: Observable /* Header state observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch main area\n *\n * This function returns an observable that computes the visual parameters of\n * the main area which depends on the viewport height and vertical offset, as\n * well as the height of the header element, if the header is fixed.\n *\n * @param el - Main area element\n * @param agent - Agent\n * @param options - Options\n *\n * @return Main area state observable\n */\nexport function watchMain(\n el: HTMLElement, { viewport }: Agent, { header$ }: Options\n): Observable {\n\n /* Compute necessary adjustment for header */\n const adjust$ = header$\n .pipe(\n pluck(\"height\")\n )\n\n /* Compute the main area's visible height */\n const height$ = combineLatest([\n viewport.offset$,\n viewport.size$,\n adjust$\n ])\n .pipe(\n map(([{ y }, { height }, adjust]) => {\n const top = el.offsetTop\n const bottom = el.offsetHeight + top\n return height\n - Math.max(0, top - y, adjust)\n - Math.max(0, height + y - bottom)\n }),\n distinctUntilChanged()\n )\n\n /* Compute whether the viewport offset is past the main area's top */\n const active$ = combineLatest([viewport.offset$, adjust$])\n .pipe(\n map(([{ y }, adjust]) => y >= el.offsetTop - adjust),\n distinctUntilChanged()\n )\n\n /* Combine into a single hot observable */\n return combineLatest([height$, adjust$, active$])\n .pipe(\n map(([height, adjust, active]) => ({\n offset: el.offsetTop - adjust,\n height,\n active\n }))\n )\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Mount main area from source observable\n *\n * @param agent - Agent\n * @param options - Options\n *\n * @return Operator function\n */\nexport function mountMain(\n agent: Agent, options: Options\n): OperatorFunction {\n return pipe(\n switchMap(el => watchMain(el, agent, options)),\n shareReplay(1)\n )\n}\n","import _curry1 from './_curry1.js';\nimport _isPlaceholder from './_isPlaceholder.js';\n\n/**\n * Optimized internal two-arity curry function.\n *\n * @private\n * @category Function\n * @param {Function} fn The function to curry.\n * @return {Function} The curried function.\n */\nexport default function _curry2(fn) {\n return function f2(a, b) {\n switch (arguments.length) {\n case 0:\n return f2;\n case 1:\n return _isPlaceholder(a) ? f2 : _curry1(function (_b) {\n return fn(a, _b);\n });\n default:\n return _isPlaceholder(a) && _isPlaceholder(b) ? f2 : _isPlaceholder(a) ? _curry1(function (_a) {\n return fn(_a, b);\n }) : _isPlaceholder(b) ? _curry1(function (_b) {\n return fn(a, _b);\n }) : fn(a, b);\n }\n };\n}","export default function _arrayFromIterator(iter) {\n var list = [];\n var next;\n while (!(next = iter.next()).done) {\n list.push(next.value);\n }\n return list;\n}","export default function _includesWith(pred, x, list) {\n var idx = 0;\n var len = list.length;\n\n while (idx < len) {\n if (pred(x, list[idx])) {\n return true;\n }\n idx += 1;\n }\n return false;\n}","// Based on https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\nfunction _objectIs(a, b) {\n // SameValue algorithm\n if (a === b) {\n // Steps 1-5, 7-10\n // Steps 6.b-6.e: +0 != -0\n return a !== 0 || 1 / a === 1 / b;\n } else {\n // Step 6.a: NaN == NaN\n return a !== a && b !== b;\n }\n}\n\nexport default typeof Object.is === 'function' ? Object.is : _objectIs;","import _curry1 from './internal/_curry1.js';\n\n/**\n * Gives a single-word string description of the (native) type of a value,\n * returning such answers as 'Object', 'Number', 'Array', or 'Null'. Does not\n * attempt to distinguish user Object types any further, reporting them all as\n * 'Object'.\n *\n * @func\n * @memberOf R\n * @since v0.8.0\n * @category Type\n * @sig (* -> {*}) -> String\n * @param {*} val The value to test\n * @return {String}\n * @example\n *\n * R.type({}); //=> \"Object\"\n * R.type(1); //=> \"Number\"\n * R.type(false); //=> \"Boolean\"\n * R.type('s'); //=> \"String\"\n * R.type(null); //=> \"Null\"\n * R.type([]); //=> \"Array\"\n * R.type(/[A-z]/); //=> \"RegExp\"\n * R.type(() => {}); //=> \"Function\"\n * R.type(undefined); //=> \"Undefined\"\n */\nvar type = /*#__PURE__*/_curry1(function type(val) {\n return val === null ? 'Null' : val === undefined ? 'Undefined' : Object.prototype.toString.call(val).slice(8, -1);\n});\nexport default type;","import _arrayFromIterator from './_arrayFromIterator.js';\nimport _includesWith from './_includesWith.js';\nimport _functionName from './_functionName.js';\nimport _has from './_has.js';\nimport _objectIs from './_objectIs.js';\nimport keys from '../keys.js';\nimport type from '../type.js';\n\n/**\n * private _uniqContentEquals function.\n * That function is checking equality of 2 iterator contents with 2 assumptions\n * - iterators lengths are the same\n * - iterators values are unique\n *\n * false-positive result will be returned for comparision of, e.g.\n * - [1,2,3] and [1,2,3,4]\n * - [1,1,1] and [1,2,3]\n * */\n\nfunction _uniqContentEquals(aIterator, bIterator, stackA, stackB) {\n var a = _arrayFromIterator(aIterator);\n var b = _arrayFromIterator(bIterator);\n\n function eq(_a, _b) {\n return _equals(_a, _b, stackA.slice(), stackB.slice());\n }\n\n // if *a* array contains any element that is not included in *b*\n return !_includesWith(function (b, aItem) {\n return !_includesWith(eq, aItem, b);\n }, b, a);\n}\n\nexport default function _equals(a, b, stackA, stackB) {\n if (_objectIs(a, b)) {\n return true;\n }\n\n var typeA = type(a);\n\n if (typeA !== type(b)) {\n return false;\n }\n\n if (a == null || b == null) {\n return false;\n }\n\n if (typeof a['fantasy-land/equals'] === 'function' || typeof b['fantasy-land/equals'] === 'function') {\n return typeof a['fantasy-land/equals'] === 'function' && a['fantasy-land/equals'](b) && typeof b['fantasy-land/equals'] === 'function' && b['fantasy-land/equals'](a);\n }\n\n if (typeof a.equals === 'function' || typeof b.equals === 'function') {\n return typeof a.equals === 'function' && a.equals(b) && typeof b.equals === 'function' && b.equals(a);\n }\n\n switch (typeA) {\n case 'Arguments':\n case 'Array':\n case 'Object':\n if (typeof a.constructor === 'function' && _functionName(a.constructor) === 'Promise') {\n return a === b;\n }\n break;\n case 'Boolean':\n case 'Number':\n case 'String':\n if (!(typeof a === typeof b && _objectIs(a.valueOf(), b.valueOf()))) {\n return false;\n }\n break;\n case 'Date':\n if (!_objectIs(a.valueOf(), b.valueOf())) {\n return false;\n }\n break;\n case 'Error':\n return a.name === b.name && a.message === b.message;\n case 'RegExp':\n if (!(a.source === b.source && a.global === b.global && a.ignoreCase === b.ignoreCase && a.multiline === b.multiline && a.sticky === b.sticky && a.unicode === b.unicode)) {\n return false;\n }\n break;\n }\n\n var idx = stackA.length - 1;\n while (idx >= 0) {\n if (stackA[idx] === a) {\n return stackB[idx] === b;\n }\n idx -= 1;\n }\n\n switch (typeA) {\n case 'Map':\n if (a.size !== b.size) {\n return false;\n }\n\n return _uniqContentEquals(a.entries(), b.entries(), stackA.concat([a]), stackB.concat([b]));\n case 'Set':\n if (a.size !== b.size) {\n return false;\n }\n\n return _uniqContentEquals(a.values(), b.values(), stackA.concat([a]), stackB.concat([b]));\n case 'Arguments':\n case 'Array':\n case 'Object':\n case 'Boolean':\n case 'Number':\n case 'String':\n case 'Date':\n case 'Error':\n case 'RegExp':\n case 'Int8Array':\n case 'Uint8Array':\n case 'Uint8ClampedArray':\n case 'Int16Array':\n case 'Uint16Array':\n case 'Int32Array':\n case 'Uint32Array':\n case 'Float32Array':\n case 'Float64Array':\n case 'ArrayBuffer':\n break;\n default:\n // Values of other types are only equal if identical.\n return false;\n }\n\n var keysA = keys(a);\n if (keysA.length !== keys(b).length) {\n return false;\n }\n\n var extendedStackA = stackA.concat([a]);\n var extendedStackB = stackB.concat([b]);\n\n idx = keysA.length - 1;\n while (idx >= 0) {\n var key = keysA[idx];\n if (!(_has(key, b) && _equals(b[key], a[key], extendedStackA, extendedStackB))) {\n return false;\n }\n idx -= 1;\n }\n return true;\n}","export default function _functionName(f) {\n // String(x => x) evaluates to \"x => x\", so the pattern may not match.\n var match = String(f).match(/^function (\\w*)/);\n return match == null ? '' : match[1];\n}","import _curry2 from './internal/_curry2.js';\nimport _equals from './internal/_equals.js';\n\n/**\n * Returns `true` if its arguments are equivalent, `false` otherwise. Handles\n * cyclical data structures.\n *\n * Dispatches symmetrically to the `equals` methods of both arguments, if\n * present.\n *\n * @func\n * @memberOf R\n * @since v0.15.0\n * @category Relation\n * @sig a -> b -> Boolean\n * @param {*} a\n * @param {*} b\n * @return {Boolean}\n * @example\n *\n * R.equals(1, 1); //=> true\n * R.equals(1, '1'); //=> false\n * R.equals([1, 2, 3], [1, 2, 3]); //=> true\n *\n * const a = {}; a.v = a;\n * const b = {}; b.v = b;\n * R.equals(a, b); //=> true\n */\nvar equals = /*#__PURE__*/_curry2(function equals(a, b) {\n return _equals(a, b, [], []);\n});\nexport default equals;","/*\n * Copyright (c) 2016-2019 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { equals } from \"ramda\"\nimport {\n MonoTypeOperatorFunction,\n Observable,\n animationFrameScheduler,\n combineLatest,\n pipe\n} from \"rxjs\"\nimport {\n distinctUntilChanged,\n finalize,\n map,\n observeOn,\n shareReplay,\n tap\n} from \"rxjs/operators\"\n\nimport {\n resetSidebarHeight,\n resetSidebarLock,\n setSidebarHeight,\n setSidebarLock\n} from \"actions\"\nimport { Agent } from \"utilities\"\n\nimport { MainState } from \"../_\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Sidebar state\n */\nexport interface SidebarState {\n height: number /* Sidebar height */\n lock: boolean /* Sidebar lock */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Options\n */\ninterface Options {\n main$: Observable /* Main area state observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch sidebar\n *\n * This function returns an observable that computes the visual parameters of\n * the sidebar which depends on the vertical viewport offset, as well as the\n * height of the main area. When the page is scrolled beyond the header, the\n * sidebar is locked and fills the remaining space.\n *\n * @param el - Sidebar element\n * @param agent - Agent\n * @param options - Options\n *\n * @return Sidebar state observable\n */\nexport function watchSidebar(\n el: HTMLElement, { viewport }: Agent, { main$ }: Options\n): Observable {\n\n /* Adjust for internal main area offset */\n const adjust = parseFloat(\n getComputedStyle(el.parentElement!)\n .getPropertyValue(\"padding-top\")\n )\n\n /* Compute the sidebar's available height */\n const height$ = combineLatest([viewport.offset$, main$])\n .pipe(\n map(([{ y }, { offset, height }]) => {\n return height - adjust + Math.min(adjust, Math.max(0, y - offset))\n })\n )\n\n /* Compute whether the sidebar should be locked */\n const lock$ = combineLatest([viewport.offset$, main$])\n .pipe(\n map(([{ y }, { offset }]) => y >= offset + adjust)\n )\n\n /* Combine into single hot observable */\n return combineLatest([height$, lock$])\n .pipe(\n map(([height, lock]) => ({ height, lock })),\n distinctUntilChanged(equals),\n shareReplay(1)\n )\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Paint sidebar from source observable\n *\n * @param el - Sidebar element\n *\n * @return Operator function\n */\nexport function paintSidebar(\n el: HTMLElement\n): MonoTypeOperatorFunction {\n return pipe(\n\n /* Defer repaint to next animation frame */\n observeOn(animationFrameScheduler),\n tap(({ height, lock }) => {\n setSidebarHeight(el, height)\n setSidebarLock(el, lock)\n }),\n\n /* Reset on complete or error */\n finalize(() => {\n resetSidebarHeight(el)\n resetSidebarLock(el)\n })\n )\n}\n","/*\n * Copyright (c) 2016-2019 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Set sidebar height\n *\n * @param el - Sidebar element\n * @param value - Sidebar height\n */\nexport function setSidebarHeight(\n el: HTMLElement, value: number\n): void {\n el.style.height = `${value}px`\n}\n\n/**\n * Reset sidebar height\n *\n * @param el - Sidebar element\n */\nexport function resetSidebarHeight(\n el: HTMLElement\n): void {\n el.style.height = \"\"\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Set sidebar lock\n *\n * @param el - Sidebar element\n * @param value - Whether the sidebar is locked\n */\nexport function setSidebarLock(\n el: HTMLElement, value: boolean\n): void {\n el.setAttribute(\"data-md-state\", value ? \"lock\" : \"\")\n}\n\n/**\n * Reset sidebar lock\n *\n * @param el - Sidebar element\n */\nexport function resetSidebarLock(\n el: HTMLElement\n): void {\n el.removeAttribute(\"data-md-state\")\n}\n","/*\n * Copyright (c) 2016-2019 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable, OperatorFunction, pipe } from \"rxjs\"\nimport { map, shareReplay } from \"rxjs/operators\"\n\nimport { switchMapIf } from \"extensions\"\nimport { Agent } from \"utilities\"\n\nimport {\n MainState,\n SidebarState,\n paintSidebar,\n watchSidebar\n} from \"../../main\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Navigation state\n */\nexport interface NavigationState {\n sidebar: SidebarState /* Sidebar state */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Options\n */\ninterface Options {\n main$: Observable /* Main area state observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch navigation\n *\n * @param el - Navigation element\n * @param agent - Agent\n * @param options - Options\n *\n * @return Navigation state observable\n */\nexport function watchNavigation(\n el: HTMLElement, agent: Agent, { main$ }: Options\n): Observable {\n\n /* Watch and paint sidebar */\n const sidebar$ = watchSidebar(el, agent, { main$ })\n .pipe(\n paintSidebar(el)\n )\n\n /* Combine into a single hot observable */\n return sidebar$\n .pipe(\n map(sidebar => ({ sidebar }))\n )\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Mount navigation from source observable\n *\n * @param agent - Agent\n * @param options - Options\n *\n * @return Operator function\n */\nexport function mountNavigation(\n agent: Agent, options: Options\n): OperatorFunction {\n const { media } = agent\n return pipe(\n switchMapIf(media.screen$, el => watchNavigation(el, agent, options)),\n shareReplay(1)\n )\n}\n","/*\n * Copyright (c) 2016-2019 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable, combineLatest, fromEvent } from \"rxjs\"\nimport {\n distinctUntilChanged,\n map,\n shareReplay,\n startWith\n} from \"rxjs/operators\"\n\nimport { watchElementFocus } from \"utilities\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Search query state\n */\nexport interface SearchQueryState {\n value: string /* Query value */\n focus: boolean /* Query focus state */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Options\n */\ninterface Options {\n prepare(value: string): string /* Preparation function */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch search query\n *\n * @param el - Search query element\n * @param options - Options\n *\n * @return Search query state observable\n */\nexport function watchSearchQuery(\n el: HTMLInputElement, { prepare }: Options\n): Observable {\n\n /* Intercept keyboard events */\n const value$ = fromEvent(el, \"keyup\")\n .pipe(\n map(() => prepare(el.value)),\n startWith(\"\"),\n distinctUntilChanged()\n )\n\n /* Intercept focus events */\n const focus$ = watchElementFocus(el)\n\n /* Combine into a single hot observable */\n return combineLatest([value$, focus$])\n .pipe(\n map(([value, focus]) => ({ value, focus })),\n shareReplay(1)\n )\n}\n","/*\n * Copyright (c) 2016-2019 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable, fromEvent, merge } from \"rxjs\"\nimport { mapTo, shareReplay, startWith } from \"rxjs/operators\"\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch element focus\n *\n * @param el - Element\n *\n * @return Element focus observable\n */\nexport function watchElementFocus(\n el: HTMLElement\n): Observable {\n const focus$ = fromEvent(el, \"focus\")\n const blur$ = fromEvent(el, \"blur\")\n\n /* Map events to boolean state */\n return merge(\n focus$.pipe(mapTo(true)),\n blur$.pipe(mapTo(false))\n )\n .pipe(\n startWith(el === document.activeElement),\n shareReplay(1)\n )\n}\n","/*\n * Copyright (c) 2016-2019 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable, fromEvent } from \"rxjs\"\nimport { mapTo } from \"rxjs/operators\"\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch search reset\n *\n * @param el - Search reset element\n *\n * @return Search reset observable\n */\nexport function watchSearchReset(\n el: HTMLElement\n): Observable {\n return fromEvent(el, \"click\")\n .pipe(\n mapTo(undefined)\n )\n}\n","/*\n * Copyright (c) 2016-2019 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { h, toHTMLElement } from \"extensions\"\nimport { ArticleDocument } from \"modules\"\nimport { truncate } from \"utilities\"\n\n/* ----------------------------------------------------------------------------\n * Data\n * ------------------------------------------------------------------------- */\n\n/**\n * CSS classes\n */\nconst css = {\n link: \"md-search-result__link\",\n article: \"md-search-result__article md-search-result__article--document\",\n title: \"md-search-result__title\",\n teaser: \"md-search-result__teaser\"\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Render an article document\n *\n * @param article - Article document\n *\n * @return HTML element\n */\nexport function renderArticleDocument(\n { location, title, text }: ArticleDocument\n): HTMLElement {\n return toHTMLElement(\n \n
    \n

    {title}

    \n {text.length\n ?

    {truncate(text, 320)}

    \n : undefined\n }\n
    \n
    \n )\n}\n","/*\n * Copyright (c) 2016-2019 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { h, toHTMLElement } from \"extensions\"\nimport { SectionDocument } from \"modules\"\nimport { truncate } from \"utilities\"\n\n/* ----------------------------------------------------------------------------\n * Data\n * ------------------------------------------------------------------------- */\n\n/**\n * CSS classes\n */\nconst css = {\n link: \"md-search-result__link\",\n article: \"md-search-result__article\",\n title: \"md-search-result__title\",\n teaser: \"md-search-result__teaser\"\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Render a section document\n *\n * @param section - Section document\n *\n * @return HTML element\n */\nexport function renderSectionDocument(\n { location, title, text }: SectionDocument\n): HTMLElement {\n return toHTMLElement(\n \n
    \n

    {title}

    \n {text.length\n ?

    {truncate(text, 320)}

    \n : undefined\n }\n
    \n
    \n )\n}\n","/*\n * Copyright (c) 2016-2019 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { h, toHTMLElement } from \"extensions\"\nimport { SearchResult } from \"modules\"\n\nimport { renderArticleDocument } from \"../article\"\nimport { renderSectionDocument } from \"../section\"\n\n/* ----------------------------------------------------------------------------\n * Data\n * ------------------------------------------------------------------------- */\n\n/**\n * CSS classes\n */\nconst css = {\n item: \"md-search-result__item\"\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Render a search result\n *\n * @param result - Search result\n *\n * @return HTML element\n */\nexport function renderSearchResult(\n { article, sections }: SearchResult\n): HTMLElement {\n return toHTMLElement(\n
  • \n {renderArticleDocument(article)}\n {...sections.map(renderSectionDocument)}\n
  • \n )\n}\n","/** PURE_IMPORTS_START tslib,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { OuterSubscriber } from '../OuterSubscriber';\nimport { subscribeToResult } from '../util/subscribeToResult';\nexport function withLatestFrom() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return function (source) {\n var project;\n if (typeof args[args.length - 1] === 'function') {\n project = args.pop();\n }\n var observables = args;\n return source.lift(new WithLatestFromOperator(observables, project));\n };\n}\nvar WithLatestFromOperator = /*@__PURE__*/ (function () {\n function WithLatestFromOperator(observables, project) {\n this.observables = observables;\n this.project = project;\n }\n WithLatestFromOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new WithLatestFromSubscriber(subscriber, this.observables, this.project));\n };\n return WithLatestFromOperator;\n}());\nvar WithLatestFromSubscriber = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(WithLatestFromSubscriber, _super);\n function WithLatestFromSubscriber(destination, observables, project) {\n var _this = _super.call(this, destination) || this;\n _this.observables = observables;\n _this.project = project;\n _this.toRespond = [];\n var len = observables.length;\n _this.values = new Array(len);\n for (var i = 0; i < len; i++) {\n _this.toRespond.push(i);\n }\n for (var i = 0; i < len; i++) {\n var observable = observables[i];\n _this.add(subscribeToResult(_this, observable, observable, i));\n }\n return _this;\n }\n WithLatestFromSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {\n this.values[outerIndex] = innerValue;\n var toRespond = this.toRespond;\n if (toRespond.length > 0) {\n var found = toRespond.indexOf(outerIndex);\n if (found !== -1) {\n toRespond.splice(found, 1);\n }\n }\n };\n WithLatestFromSubscriber.prototype.notifyComplete = function () {\n };\n WithLatestFromSubscriber.prototype._next = function (value) {\n if (this.toRespond.length === 0) {\n var args = [value].concat(this.values);\n if (this.project) {\n this._tryProject(args);\n }\n else {\n this.destination.next(args);\n }\n }\n };\n WithLatestFromSubscriber.prototype._tryProject = function (args) {\n var result;\n try {\n result = this.project.apply(this, args);\n }\n catch (err) {\n this.destination.error(err);\n return;\n }\n this.destination.next(result);\n };\n return WithLatestFromSubscriber;\n}(OuterSubscriber));\n//# sourceMappingURL=withLatestFrom.js.map\n","/*\n * Copyright (c) 2016-2019 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { MonoTypeOperatorFunction, Observable, pipe } from \"rxjs\"\nimport { map, withLatestFrom } from \"rxjs/operators\"\n\nimport {\n resetSearchResultMeta,\n setSearchResultMeta\n} from \"actions\"\nimport { SearchResult } from \"modules\"\nimport { getElement } from \"utilities\"\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Options\n */\ninterface Options {\n query$: Observable /* Search query observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Paint search result metadata from source observable\n *\n * @param el - Search result metadata element\n * @param options - Options\n *\n * @return Operator function\n */\nexport function paintSearchResultMeta(\n el: HTMLElement, { query$ }: Options\n): MonoTypeOperatorFunction {\n const meta = getElement(\".md-search-result__meta\", el)!\n return pipe(\n withLatestFrom(query$),\n map(([result, query]) => {\n if (query) {\n setSearchResultMeta(meta, result.length)\n } else {\n resetSearchResultMeta(meta)\n }\n return result\n })\n )\n}\n","/*\n * Copyright (c) 2016-2019 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { identity } from \"ramda\"\nimport { Observable, OperatorFunction, pipe } from \"rxjs\"\nimport {\n distinctUntilChanged,\n filter,\n map,\n shareReplay,\n switchMap,\n tap,\n} from \"rxjs/operators\"\n\nimport { SearchResult } from \"modules\"\nimport { Agent, watchElementOffset } from \"utilities\"\n\nimport { paintSearchResultList } from \"../list\"\nimport { paintSearchResultMeta } from \"../meta\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Search result state\n */\nexport interface SearchResultState {\n result: SearchResult[] /* Search results */\n}\n\n// TODO: measure time, return metadata...\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Options\n */\ninterface Options {\n result$: Observable /* Search result observable */\n query$: Observable /* Search query observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch search result\n *\n * @param el - Search result element\n * @param agent - Agent\n * @param options - Options\n *\n * @return Search result state observable\n */\nexport function watchSearchResult(\n el: HTMLElement, agent: Agent, { result$, query$ }: Options\n): Observable {\n const container = el.parentElement!\n\n /* Compute whether there are more search results elements */\n const render$ = watchElementOffset(container, agent)\n .pipe(\n map(({ y }) => y >= container.scrollHeight - container.offsetHeight - 16),\n distinctUntilChanged(),\n filter(identity)\n )\n\n // combine into search result observable...\n\n /* Paint search results */\n return result$\n .pipe(\n tap(x => { console.log(\"watchSearchResult\", x) }),\n paintSearchResultMeta(el, { query$ }),\n paintSearchResultList(el, { render$ })\n )\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Mount search result from source observable\n *\n * @param agent - Agent\n * @param options - Options\n *\n * @return Operator function\n */\nexport function mountSearchResult(\n agent: Agent, options: Options\n): OperatorFunction {\n return pipe(\n switchMap(el => watchSearchResult(el, agent, options)),\n shareReplay(1)\n )\n}\n","/*\n * Copyright (c) 2016-2019 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n MonoTypeOperatorFunction,\n Observable,\n animationFrameScheduler,\n pipe\n} from \"rxjs\"\nimport {\n finalize,\n mapTo,\n observeOn,\n scan,\n switchMap\n} from \"rxjs/operators\"\n\nimport {\n addToSearchResultList,\n resetSearchResultList\n} from \"actions\"\nimport { SearchResult } from \"modules\"\nimport { renderSearchResult } from \"templates\"\nimport { getElement } from \"utilities\"\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Options\n */\ninterface Options {\n render$: Observable /* Render trigger observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Paint search result list from source observable\n *\n * @param el - Search result element\n * @param options - Options\n *\n * @return Operator function\n */\nexport function paintSearchResultList(\n el: HTMLElement, { render$ }: Options\n): MonoTypeOperatorFunction {\n const container = el.parentElement!\n const list = getElement(\".md-search-result__list\", el)!\n return pipe(\n switchMap(result => render$\n .pipe(\n\n /* Defer repaint to next animation frame */\n observeOn(animationFrameScheduler),\n scan(index => {\n while (index < result.length) {\n addToSearchResultList(list, renderSearchResult(result[index++]))\n if (container.scrollHeight - container.offsetHeight > 16)\n break\n }\n return index\n }, 0),\n\n /* Re-map to search result */\n mapTo(result),\n\n /* Reset on complete or error */\n finalize(() => {\n resetSearchResultList(list)\n })\n )\n )\n )\n}\n","/*\n * Copyright (c) 2016-2019 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable, OperatorFunction, pipe } from \"rxjs\"\nimport { map, shareReplay } from \"rxjs/operators\"\n\nimport { switchMapIf } from \"extensions\"\nimport { Agent, paintHidden } from \"utilities\"\n\nimport { HeaderState, watchViewportOffsetFromTopOf } from \"../header\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Tabs state\n */\nexport interface TabsState {\n hidden: boolean /* Whether the tabs are hidden */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Options\n */\ninterface Options {\n header$: Observable /* Header state observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch tabs\n *\n * This function returns an observable that computes the visual parameters of\n * the tabs, currently only denoting whether the tabs are hidden or not.\n *\n * @param el - Tabs element\n * @param agent - Agent\n * @param options - Options\n *\n * @return Tabs state\n */\nexport function watchTabs(\n el: HTMLElement, agent: Agent, { header$ }: Options\n): Observable {\n\n /* Watch and paint visibility */\n const hidden$ = watchViewportOffsetFromTopOf(el, agent, { header$ })\n .pipe(\n paintHidden(el, 8)\n )\n\n /* Combine into a single hot observable */\n return hidden$\n .pipe(\n map(hidden => ({ hidden }))\n )\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Mount tabs from source observable\n *\n * @param agent - Agent\n * @param options - Options\n *\n * @return Operator function\n */\nexport function mountTabs(\n agent: Agent, options: Options\n): OperatorFunction {\n const { media } = agent\n return pipe(\n switchMapIf(media.screen$, el => watchTabs(el, agent, options)),\n shareReplay(1)\n )\n}\n","import _curry1 from './internal/_curry1.js';\nimport _isString from './internal/_isString.js';\n\n/**\n * Returns a new list or string with the elements or characters in reverse\n * order.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category List\n * @sig [a] -> [a]\n * @sig String -> String\n * @param {Array|String} list\n * @return {Array|String}\n * @example\n *\n * R.reverse([1, 2, 3]); //=> [3, 2, 1]\n * R.reverse([1, 2]); //=> [2, 1]\n * R.reverse([1]); //=> [1]\n * R.reverse([]); //=> []\n *\n * R.reverse('abc'); //=> 'cba'\n * R.reverse('ab'); //=> 'ba'\n * R.reverse('a'); //=> 'a'\n * R.reverse(''); //=> ''\n */\nvar reverse = /*#__PURE__*/_curry1(function reverse(list) {\n return _isString(list) ? list.split('').reverse().join('') : Array.prototype.slice.call(list, 0).reverse();\n});\nexport default reverse;","export default function _isString(x) {\n return Object.prototype.toString.call(x) === '[object String]';\n}","import _indexOf from './_indexOf.js';\n\nexport default function _includes(a, list) {\n return _indexOf(list, a, 0) >= 0;\n}","import equals from '../equals.js';\n\nexport default function _indexOf(list, a, idx) {\n var inf, item;\n // Array.prototype.indexOf doesn't exist below IE9\n if (typeof list.indexOf === 'function') {\n switch (typeof a) {\n case 'number':\n if (a === 0) {\n // manually crawl the list to distinguish between +0 and -0\n inf = 1 / a;\n while (idx < list.length) {\n item = list[idx];\n if (item === 0 && 1 / item === inf) {\n return idx;\n }\n idx += 1;\n }\n return -1;\n } else if (a !== a) {\n // NaN\n while (idx < list.length) {\n item = list[idx];\n if (typeof item === 'number' && item !== item) {\n return idx;\n }\n idx += 1;\n }\n return -1;\n }\n // non-zero numbers can utilise Set\n return list.indexOf(a, idx);\n\n // all these types can utilise Set\n case 'string':\n case 'boolean':\n case 'function':\n case 'undefined':\n return list.indexOf(a, idx);\n\n case 'object':\n if (a === null) {\n // null can utilise Set\n return list.indexOf(a, idx);\n }\n }\n }\n // anything else not covered above, defer to R.equals\n while (idx < list.length) {\n if (equals(list[idx], a)) {\n return idx;\n }\n idx += 1;\n }\n return -1;\n}","import _includes from './_includes.js';\n\nvar _Set = /*#__PURE__*/function () {\n function _Set() {\n /* globals Set */\n this._nativeSet = typeof Set === 'function' ? new Set() : null;\n this._items = {};\n }\n\n // until we figure out why jsdoc chokes on this\n // @param item The item to add to the Set\n // @returns {boolean} true if the item did not exist prior, otherwise false\n //\n _Set.prototype.add = function (item) {\n return !hasOrAdd(item, true, this);\n };\n\n //\n // @param item The item to check for existence in the Set\n // @returns {boolean} true if the item exists in the Set, otherwise false\n //\n _Set.prototype.has = function (item) {\n return hasOrAdd(item, false, this);\n };\n\n //\n // Combines the logic for checking whether an item is a member of the set and\n // for adding a new item to the set.\n //\n // @param item The item to check or add to the Set instance.\n // @param shouldAdd If true, the item will be added to the set if it doesn't\n // already exist.\n // @param set The set instance to check or add to.\n // @return {boolean} true if the item already existed, otherwise false.\n //\n return _Set;\n}();\n\nfunction hasOrAdd(item, shouldAdd, set) {\n var type = typeof item;\n var prevSize, newSize;\n switch (type) {\n case 'string':\n case 'number':\n // distinguish between +0 and -0\n if (item === 0 && 1 / item === -Infinity) {\n if (set._items['-0']) {\n return true;\n } else {\n if (shouldAdd) {\n set._items['-0'] = true;\n }\n return false;\n }\n }\n // these types can all utilise the native Set\n if (set._nativeSet !== null) {\n if (shouldAdd) {\n prevSize = set._nativeSet.size;\n set._nativeSet.add(item);\n newSize = set._nativeSet.size;\n return newSize === prevSize;\n } else {\n return set._nativeSet.has(item);\n }\n } else {\n if (!(type in set._items)) {\n if (shouldAdd) {\n set._items[type] = {};\n set._items[type][item] = true;\n }\n return false;\n } else if (item in set._items[type]) {\n return true;\n } else {\n if (shouldAdd) {\n set._items[type][item] = true;\n }\n return false;\n }\n }\n\n case 'boolean':\n // set._items['boolean'] holds a two element array\n // representing [ falseExists, trueExists ]\n if (type in set._items) {\n var bIdx = item ? 1 : 0;\n if (set._items[type][bIdx]) {\n return true;\n } else {\n if (shouldAdd) {\n set._items[type][bIdx] = true;\n }\n return false;\n }\n } else {\n if (shouldAdd) {\n set._items[type] = item ? [false, true] : [true, false];\n }\n return false;\n }\n\n case 'function':\n // compare functions for reference equality\n if (set._nativeSet !== null) {\n if (shouldAdd) {\n prevSize = set._nativeSet.size;\n set._nativeSet.add(item);\n newSize = set._nativeSet.size;\n return newSize === prevSize;\n } else {\n return set._nativeSet.has(item);\n }\n } else {\n if (!(type in set._items)) {\n if (shouldAdd) {\n set._items[type] = [item];\n }\n return false;\n }\n if (!_includes(item, set._items[type])) {\n if (shouldAdd) {\n set._items[type].push(item);\n }\n return false;\n }\n return true;\n }\n\n case 'undefined':\n if (set._items[type]) {\n return true;\n } else {\n if (shouldAdd) {\n set._items[type] = true;\n }\n return false;\n }\n\n case 'object':\n if (item === null) {\n if (!set._items['null']) {\n if (shouldAdd) {\n set._items['null'] = true;\n }\n return false;\n }\n return true;\n }\n /* falls through */\n default:\n // reduce the search size of heterogeneous sets by creating buckets\n // for each type.\n type = Object.prototype.toString.call(item);\n if (!(type in set._items)) {\n if (shouldAdd) {\n set._items[type] = [item];\n }\n return false;\n }\n // scan through all previously applied items\n if (!_includes(item, set._items[type])) {\n if (shouldAdd) {\n set._items[type].push(item);\n }\n return false;\n }\n return true;\n }\n}\n\n// A simple Set type that honours R.equals semantics\nexport default _Set;","import _curry2 from './internal/_curry2.js';\nimport _Set from './internal/_Set.js';\n\n/**\n * Finds the set (i.e. no duplicates) of all elements in the first list not\n * contained in the second list. Objects and Arrays are compared in terms of\n * value equality, not reference equality.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Relation\n * @sig [*] -> [*] -> [*]\n * @param {Array} list1 The first list.\n * @param {Array} list2 The second list.\n * @return {Array} The elements in `list1` that are not in `list2`.\n * @see R.differenceWith, R.symmetricDifference, R.symmetricDifferenceWith, R.without\n * @example\n *\n * R.difference([1,2,3,4], [7,6,5,4,3]); //=> [1,2]\n * R.difference([7,6,5,4,3], [1,2,3,4]); //=> [7,6,5]\n * R.difference([{a: 1}, {b: 2}], [{a: 1}, {c: 3}]) //=> [{b: 2}]\n */\nvar difference = /*#__PURE__*/_curry2(function difference(first, second) {\n var out = [];\n var idx = 0;\n var firstLen = first.length;\n var secondLen = second.length;\n var toFilterOut = new _Set();\n\n for (var i = 0; i < secondLen; i += 1) {\n toFilterOut.add(second[i]);\n }\n\n while (idx < firstLen) {\n if (toFilterOut.add(first[idx])) {\n out[out.length] = first[idx];\n }\n idx += 1;\n }\n return out;\n});\nexport default difference;","\n/*\n * Copyright (c) 2016-2019 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Packer message type\n */\nexport const enum PackerMessageType {\n STRING, /* String data */\n BINARY /* Packed data */\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * A message containing an unpacked string\n */\nexport interface PackerStringMessage {\n type: PackerMessageType.STRING /* Message type */\n data: string /* Message data */\n}\n\n/**\n * A message containing a packed string\n */\nexport interface PackerBinaryMessage {\n type: PackerMessageType.BINARY /* Message type */\n data: string /* Message data */\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * A message exchanged with the packer worker\n */\nexport type PackerMessage =\n | PackerStringMessage\n | PackerBinaryMessage\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Type guard for packer binary messages\n *\n * @param message - Packer worker message\n *\n * @return Test result\n */\nexport function isPackerBinaryMessage(\n message: PackerMessage\n): message is PackerBinaryMessage {\n return message.type === PackerMessageType.BINARY\n}\n\n/**\n * Type guard for packer string messages\n *\n * @param message - Packer worker message\n *\n * @return Test result\n */\nexport function isPackerStringMessage(\n message: PackerMessage\n): message is PackerStringMessage {\n return message.type === PackerMessageType.STRING\n}\n","/*\n * Copyright (c) 2016-2019 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A RTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { SearchIndexOptions, SearchResult } from \"modules\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Search message type\n */\nexport const enum SearchMessageType {\n SETUP, /* Search index setup */\n DUMP, /* Search index dump */\n QUERY, /* Search query */\n RESULT /* Search results */\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * A message containing the data necessary to setup the search index\n */\nexport interface SearchSetupMessage {\n type: SearchMessageType.SETUP /* Message type */\n data: SearchIndexOptions /* Message data */\n}\n\n/**\n * A message containing the a dump of the search index\n */\nexport interface SearchDumpMessage {\n type: SearchMessageType.DUMP /* Message type */\n data: string /* Message data */\n}\n\n/**\n * A message containing a search query\n */\nexport interface SearchQueryMessage {\n type: SearchMessageType.QUERY /* Message type */\n data: string /* Message data */\n}\n\n/**\n * A message containing results for a search query\n */\nexport interface SearchResultMessage {\n type: SearchMessageType.RESULT /* Message type */\n data: SearchResult[] /* Message data */\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * A message exchanged with the search worker\n */\nexport type SearchMessage =\n | SearchSetupMessage\n | SearchDumpMessage\n | SearchQueryMessage\n | SearchResultMessage\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Type guard for search setup messages\n *\n * @param message - Search worker message\n *\n * @return Test result\n */\nexport function isSearchSetupMessage(\n message: SearchMessage\n): message is SearchSetupMessage {\n return message.type === SearchMessageType.SETUP\n}\n\n/**\n * Type guard for search dump messages\n *\n * @param message - Search worker message\n *\n * @return Test result\n */\nexport function isSearchDumpMessage(\n message: SearchMessage\n): message is SearchDumpMessage {\n return message.type === SearchMessageType.DUMP\n}\n\n/**\n * Type guard for search query messages\n *\n * @param message - Search worker message\n *\n * @return Test result\n */\nexport function isSearchQueryMessage(\n message: SearchMessage\n): message is SearchQueryMessage {\n return message.type === SearchMessageType.QUERY\n}\n\n/**\n * Type guard for search result messages\n *\n * @param message - Search worker message\n *\n * @return Test result\n */\nexport function isSearchResultMessage(\n message: SearchMessage\n): message is SearchResultMessage {\n return message.type === SearchMessageType.RESULT\n}\n","/*\n * Copyright (c) 2016-2019 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable, OperatorFunction, combineLatest, pipe } from \"rxjs\"\nimport { map, shareReplay } from \"rxjs/operators\"\n\nimport { switchMapIf } from \"extensions\"\nimport { Agent, getElements } from \"utilities\"\n\nimport { HeaderState } from \"../../header\"\nimport {\n MainState,\n SidebarState,\n paintSidebar,\n watchSidebar\n} from \"../../main\"\nimport {\n AnchorList,\n paintAnchorList,\n watchAnchorList\n} from \"../anchor\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Table of contents state\n */\nexport interface TableOfContentsState {\n sidebar: SidebarState /* Sidebar state */\n anchors: AnchorList /* Anchor list */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Options\n */\ninterface Options {\n header$: Observable /* Header state observable */\n main$: Observable /* Main area state observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch table of contents\n *\n * @param el - Table of contents element\n * @param agent - Agent\n * @param options - Options\n *\n * @return Table of contents state observable\n */\nexport function watchTableOfContents(\n el: HTMLElement, agent: Agent, { header$, main$ }: Options\n): Observable {\n\n /* Watch and paint sidebar */\n const sidebar$ = watchSidebar(el, agent, { main$ })\n .pipe(\n paintSidebar(el)\n )\n\n /* Watch and paint anchor list (scroll spy) */\n const els = getElements(\".md-nav__link\", el)\n const anchors$ = watchAnchorList(els, agent, { header$ })\n .pipe(\n paintAnchorList(els)\n )\n\n /* Combine into a single hot observable */\n return combineLatest([sidebar$, anchors$])\n .pipe(\n map(([sidebar, anchors]) => ({ sidebar, anchors }))\n )\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Mount table of contents from source observable\n *\n * @param agent - Agent\n * @param options - Options\n *\n * @return Operator function\n */\nexport function mountTableOfContents(\n agent: Agent, options: Options\n): OperatorFunction {\n const { media } = agent\n return pipe(\n switchMapIf(media.tablet$, el => watchTableOfContents(el, agent, options)),\n shareReplay(1)\n )\n}\n","/*\n * Copyright (c) 2016-2019 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { difference, reverse } from \"ramda\"\nimport {\n MonoTypeOperatorFunction,\n Observable,\n animationFrameScheduler,\n combineLatest,\n pipe\n} from \"rxjs\"\nimport {\n distinctUntilChanged,\n finalize,\n map,\n observeOn,\n scan,\n shareReplay,\n switchMap,\n tap\n} from \"rxjs/operators\"\n\nimport {\n resetAnchorActive,\n resetAnchorBlur,\n setAnchorActive,\n setAnchorBlur\n} from \"actions\"\nimport { Agent, getElement } from \"utilities\"\n\nimport { HeaderState } from \"../../header\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Anchor list\n */\nexport interface AnchorList {\n prev: HTMLAnchorElement[][] /* Anchors (previous) */\n next: HTMLAnchorElement[][] /* Anchors (next) */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Options\n */\ninterface Options {\n header$: Observable /* Header state observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch anchor list\n *\n * This is effectively a scroll-spy implementation which will account for the\n * fixed header and automatically re-calculate anchor offsets when the viewport\n * is resized. The returned observable will only emit if the anchor list needs\n * to be repainted.\n *\n * This implementation tracks an anchor element's entire path starting from its\n * level up to the top-most anchor element, e.g. `[h3, h2, h1]`. Although the\n * Material theme currently doesn't make use of this information, it enables\n * the styling of the entire hierarchy through customization.\n *\n * Note that the current anchor is the last item of the `prev` anchor list.\n *\n * @param els - Anchor elements\n * @param agent - Agent\n * @param options - Options\n *\n * @return Anchor list observable\n */\nexport function watchAnchorList(\n els: HTMLAnchorElement[], { viewport }: Agent, { header$ }: Options\n): Observable {\n const table = new Map()\n for (const el of els) {\n const id = decodeURIComponent(el.hash.substring(1))\n const target = getElement(`[id=\"${id}\"]`)\n if (typeof target !== \"undefined\")\n table.set(el, target)\n }\n\n /* Compute necessary adjustment for header */\n const adjust$ = header$\n .pipe(\n map(header => 18 + header.height)\n )\n\n /* Compute partition of previous and next anchors */\n const partition$ = viewport.size$\n .pipe(\n\n /* Build index to map anchor paths to vertical offsets */\n map(() => {\n let path: HTMLAnchorElement[] = []\n return [...table].reduce((index, [anchor, target]) => {\n while (path.length) {\n const last = table.get(path[path.length - 1])!\n if (last.tagName >= target.tagName) {\n path.pop()\n } else {\n break\n }\n }\n return index.set(\n reverse(path = [...path, anchor]),\n target.offsetTop\n )\n }, new Map())\n }),\n\n /* Re-compute partition when viewport offset changes */\n switchMap(index => combineLatest(viewport.offset$, adjust$)\n .pipe(\n scan(([prev, next], [{ y }, adjust]) => {\n\n /* Look forward */\n while (next.length) {\n const [, offset] = next[0]\n if (offset - adjust < y) {\n prev = [...prev, next.shift()!]\n } else {\n break\n }\n }\n\n /* Look backward */\n while (prev.length) {\n const [, offset] = prev[prev.length - 1]\n if (offset - adjust >= y) {\n next = [prev.pop()!, ...next]\n } else {\n break\n }\n }\n\n /* Return partition */\n return [prev, next]\n }, [[], [...index]]),\n distinctUntilChanged((a, b) => {\n return a[0] === b[0]\n && a[1] === b[1]\n })\n )\n )\n )\n\n /* Compute anchor list migrations */\n const migration$ = partition$\n .pipe(\n map(([prev, next]) => ({\n prev: prev.map(([path]) => path),\n next: next.map(([path]) => path)\n })),\n\n /* Extract anchor list migrations */\n scan((a, b) => {\n const begin = Math.max(0, Math.min(b.prev.length, a.prev.length) - 1)\n const end = Math.max(b.prev.length, a.prev.length)\n return {\n prev: b.prev.slice(begin, end + 1),\n next: difference(b.next, a.next)\n }\n }, { prev: [], next: [] })\n )\n\n /* Return anchor list migrations as hot observable */\n return migration$\n .pipe(\n shareReplay(1)\n )\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Paint anchor list from source observable\n *\n * @param els - Anchor elements\n *\n * @return Operator function\n */\nexport function paintAnchorList(\n els: HTMLAnchorElement[]\n): MonoTypeOperatorFunction {\n return pipe(\n\n /* Defer repaint to next animation frame */\n observeOn(animationFrameScheduler),\n tap(({ prev, next }) => {\n\n /* Look forward */\n for (const [el] of next) {\n resetAnchorActive(el)\n resetAnchorBlur(el)\n }\n\n /* Look backward */\n for (const [index, [el]] of prev.entries()) {\n setAnchorActive(el, index === prev.length - 1)\n setAnchorBlur(el, true)\n }\n }),\n\n /* Reset on complete or error */\n finalize(() => {\n for (const el of els) {\n resetAnchorActive(el)\n resetAnchorBlur(el)\n }\n })\n )\n}\n","/*\n * Copyright (c) 2016-2019 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\n// TODO: remove this after we finished refactoring\n// tslint:disable\n\nimport { identity, values } from \"ramda\"\nimport {\n EMPTY,\n Observable,\n Subject,\n forkJoin,\n merge,\n of\n} from \"rxjs\"\nimport { ajax } from \"rxjs/ajax\"\nimport {\n delay,\n filter,\n map,\n pluck,\n switchMap,\n switchMapTo,\n take,\n tap,\n} from \"rxjs/operators\"\n\nimport {\n Component,\n paintHeaderShadow,\n mountHero,\n mountMain,\n mountNavigation,\n mountSearchResult,\n mountTableOfContents,\n mountTabs,\n switchComponent,\n watchComponentMap,\n watchHeader,\n watchSearchQuery,\n watchSearchReset\n} from \"./components\"\nimport { SearchIndexOptions } from \"./modules\"\nimport {\n getElement,\n setupAgent,\n watchToggle,\n watchWorker,\n setToggle\n} from \"./utilities\"\nimport {\n PackerMessage,\n PackerMessageType,\n SearchMessage,\n SearchMessageType,\n SearchSetupMessage,\n isSearchDumpMessage,\n isSearchResultMessage\n} from \"./workers\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Configuration\n */\nexport interface Config {\n base: string /* Base URL */\n worker: {\n search: string /* Search worker URL */\n packer: string /* Packer worker URL */\n }\n}\n\n/* ----------------------------------------------------------------------------\n * TODO: where do we put this stuff?\n * ------------------------------------------------------------------------- */\n\ndocument.documentElement.classList.remove(\"no-js\")\ndocument.documentElement.classList.add(\"js\")\n\nconst names: Component[] = [\n \"container\", /* Container */\n \"header\", /* Header */\n \"header-title\", /* Header title */\n \"hero\", /* Hero */\n \"main\", /* Main area */\n \"navigation\", /* Navigation */\n \"search\", /* Search */\n \"search-query\", /* Search input */\n \"search-reset\", /* Search reset */\n \"search-result\", /* Search results */\n \"tabs\", /* Tabs */\n \"toc\" /* Table of contents */\n]\n\n/* ----------------------------------------------------------------------------\n * Helper functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Ensure that the given value is a valid configuration\n *\n * We could use `jsonschema` or any other schema validation framework, but that\n * would just add more bloat to the bundle, so we'll keep it plain and simple.\n *\n * @param config - Configuration\n *\n * @return Test result\n */\nfunction isConfig(config: any): config is Config {\n return typeof config === \"object\"\n && typeof config.base === \"string\"\n && typeof config.worker === \"object\"\n && typeof config.worker.search === \"string\"\n && typeof config.worker.packer === \"string\"\n}\n\n/**\n *\n * Rogue control characters must be filtered before handing the query to the\n * search index, as lunr will throw otherwise.\n */\nfunction prepare(value: string): string {\n const newvalue = value\n .replace(/(?:^|\\s+)[*+-:^~]+(?=\\s+|$)/g, \"\")\n .trim()\n\n return newvalue ? newvalue.replace(/\\s+|$/g, \"* \") : \"\"\n}\n\nfunction setupWorkers(config: Config) {\n const worker = new Worker(config.worker.search)\n const packer = new Worker(config.worker.packer)\n\n const packerMessage$ = new Subject()\n const packer$ = watchWorker(packer, { send$: packerMessage$ })\n\n // send a message, then switchMapTo worker!\n\n packer$.subscribe(message => {\n // console.log(\"PACKER.MSG\", message.data.length)\n // is always packed!\n if (message.type === PackerMessageType.BINARY && message.data[0] !== \"{\")\n localStorage.setItem(\"index\", message.data)\n })\n\n // storing = experimental feature\n\n const searchMessage$ = new Subject()\n\n const search$ = watchWorker(worker, { send$: searchMessage$ })\n\n /* Link search to packer */\n search$\n .pipe(\n filter(isSearchDumpMessage),\n map(message => ({\n type: PackerMessageType.STRING,\n data: message.data\n })),\n tap(message => packerMessage$.next(message)) // send message and wait!\n // switchMapTo(packer$)\n )\n .subscribe()\n\n // rename into SearchPlugin!?\n\n const data$ = ajax({\n url: `${config.base}/search/search_index.json`,\n responseType: \"json\",\n withCredentials: true\n })\n .pipe(\n pluck(\"response\")\n // take(1)\n )\n\n const fromLocal = localStorage.getItem(\"index\")\n\n ;\n (fromLocal ? of({\n type: PackerMessageType.BINARY,\n data: localStorage.getItem(\"index\")!\n }) : EMPTY)\n .subscribe(x => {\n // console.log(\"send message to packer\")\n packerMessage$.next(x)\n })\n\n const index$ = fromLocal ? packer$.pipe(pluck(\"data\"), take(1)) : of(undefined) // of(localStorage.getItem(\"index\"))\n\n // index$.subscribe(xx => console.log(\"INDEX\", xx))\n\n forkJoin([data$, index$])\n .pipe(\n map(([data, index]) => ({\n type: SearchMessageType.SETUP,\n data: { ...data, index }\n }))\n )\n .subscribe(message => {\n searchMessage$.next(message) // TODO: this shall not complete\n })\n\n return [search$, searchMessage$] as const\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Initialize Material for MkDocs\n *\n * @param config - Configuration\n */\nexport function initialize(config: unknown) {\n if (!isConfig(config))\n throw new SyntaxError(`Invalid configuration: ${JSON.stringify(config)}`)\n\n // pass config here!?\n const agent = setupAgent() // TODO: add a config parameter here to configure media queries\n\n const [\n searchWorkerRecv$,\n searchMessage$\n ] = setupWorkers(config)\n\n /* ----------------------------------------------------------------------- */\n\n /* Create component map observable */\n const components$ = watchComponentMap(names, { document$: agent.document.load$ })\n const component = (name: Component): Observable => {\n return components$\n .pipe(\n switchComponent(name)\n )\n }\n\n /* Create header observable */\n const header$ = component(\"header\") // TODO:!\n .pipe(\n switchMap(watchHeader)\n )\n\n /* Create header shadow toggle */\n component(\"header\")\n .pipe(\n switchMap(el => main$\n .pipe(\n paintHeaderShadow(el) // technically, this could be done in paintMain\n )\n )\n )\n .subscribe()\n\n // ----------------------------------------------------------------------------\n\n // watchSearchResult // emit, if at bottom...\n // receive results as a second observable!? filter stuff, paint\n\n const result$ = searchWorkerRecv$ // move worker initialization into mountSearch ?\n .pipe(\n tap(m => console.log(\"message from worker\", m)),\n filter(isSearchResultMessage),\n pluck(\"data\")\n )\n\n // handleSearchResult <-- operator\n\n const query$ = component(\"search-query\")\n .pipe(\n switchMap(el => watchSearchQuery(el, { prepare }))\n )\n\n query$\n .pipe(\n map(query => ({ // put this into some function...\n type: SearchMessageType.QUERY,\n data: query.value\n })), // TODO. ugly...\n // distinctUntilKeyChanged(\"data\")\n )\n .subscribe(searchMessage$)\n\n // create the message subject internally... and link it to the worker...?\n // watchSearchWorker(worker, agent, { query$ }) // message internally...\n\n query$\n .pipe(\n tap(query => {\n if (query.focus)\n setToggle(search, true)\n })\n )\n .subscribe()\n\n /* ----------------------------------------------------------------------- */\n\n const main$ = component(\"main\")\n .pipe(\n mountMain(agent, { header$ })\n )\n\n const navigation$ = component(\"navigation\")\n .pipe(\n mountNavigation(agent, { main$ })\n )\n\n const toc$ = component(\"toc\")\n .pipe(\n mountTableOfContents(agent, { header$, main$ })\n )\n\n // TODO: naming?\n const resultComponent$ = component(\"search-result\")\n .pipe(\n mountSearchResult(agent, { result$, query$: query$.pipe(pluck(\"value\")) })\n ) // temporary fix\n\n const tabs$ = component(\"tabs\")\n .pipe(\n mountTabs(agent, { header$ })\n )\n\n const hero$ = component(\"hero\")\n .pipe(\n mountHero(agent, { header$ })\n )\n\n\n /* ----------------------------------------------------------------------- */\n\n const drawer = getElement(\"[data-md-toggle=drawer]\")!\n const search = getElement(\"[data-md-toggle=search]\")!\n\n const a$ = watchToggle(search)\n .pipe(\n filter(identity),\n delay(400)\n )\n\n const reset$ = component(\"search-reset\")\n .pipe(\n switchMap(watchSearchReset)\n )\n\n merge(a$, reset$)\n .pipe(\n switchMapTo(component(\"search-query\")),\n tap(el => el.focus())\n )\n .subscribe()\n\n /* ----------------------------------------------------------------------- */\n\n const state = {\n search: {\n query$,\n result$: resultComponent$,\n reset$,\n },\n main$,\n navigation$,\n toc$,\n tabs$,\n hero$\n }\n\n const { search: temp, ...rest } = state\n merge(...values(rest), ...values(temp))\n .subscribe() // potential memleak <-- use takeUntil\n\n return {\n agent,\n state\n }\n}\n","/*\n * Copyright (c) 2016-2019 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable, Subject } from \"rxjs\"\n\nimport {\n ViewportOffset,\n ViewportSize,\n watchDocument,\n watchLocation,\n watchLocationHash,\n watchMedia,\n watchViewportOffset,\n watchViewportSize\n} from \"utilities\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Agent document\n */\nexport interface AgentDocument {\n load$: Observable /* Document observable */\n}\n\n/**\n * Agent location\n */\nexport interface AgentLocation {\n href$: Subject /* Location subject */\n hash$: Observable /* Location hash observable */\n}\n\n/**\n * Agent media\n */\nexport interface AgentMedia {\n screen$: Observable /* Media observable for screen */\n tablet$: Observable /* Media observable for tablet */\n}\n\n/**\n * Agent viewport\n */\nexport interface AgentViewport {\n offset$: Observable /* Viewport offset observable */\n size$: Observable /* Viewport size observable */\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Agent\n */\nexport interface Agent {\n document: AgentDocument /* Document observables */\n location: AgentLocation /* Location observables */\n media: AgentMedia /* Media observables */\n viewport: AgentViewport /* Viewport observables */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Create the agent\n *\n * This function returns a data structure that contains all observables that\n * are related to the browser and/or environment.\n *\n * @return Agent\n */\nexport function setupAgent(): Agent {\n return {\n document: {\n load$: watchDocument()\n },\n location: {\n href$: watchLocation(),\n hash$: watchLocationHash()\n },\n media: {\n screen$: watchMedia(\"(min-width: 1220px)\"),\n tablet$: watchMedia(\"(min-width: 960px)\")\n },\n viewport: {\n offset$: watchViewportOffset(),\n size$: watchViewportSize()\n }\n }\n}\n","/*\n * Copyright (c) 2016-2019 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { keys } from \"ramda\"\nimport { NEVER, Observable, OperatorFunction, of, pipe } from \"rxjs\"\nimport { map, scan, shareReplay, switchMap } from \"rxjs/operators\"\n\nimport { getElement } from \"utilities\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Component names\n */\nexport type Component =\n | \"container\" /* Container */\n | \"header\" /* Header */\n | \"header-title\" /* Header title */\n | \"hero\" /* Hero */\n | \"main\" /* Main area */\n | \"navigation\" /* Navigation */\n | \"search\" /* Search */\n | \"search-query\" /* Search input */\n | \"search-reset\" /* Search reset */\n | \"search-result\" /* Search results */\n | \"tabs\" /* Tabs */\n | \"toc\" /* Table of contents */\n\n/**\n * Component map\n */\nexport type ComponentMap = {\n [P in Component]?: HTMLElement\n}\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Options\n */\ninterface Options {\n document$: Observable /* Document observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch component mapping\n *\n * This function returns an observable that will maintain bindings to the given\n * components in-between document switches and update the document in-place.\n *\n * @param names - Component names\n * @param options - Options\n *\n * @return Component mapping observable\n */\nexport function watchComponentMap(\n names: Component[], { document$ }: Options\n): Observable {\n const components$ = document$\n .pipe(\n\n /* Build component map */\n map(document => names.reduce((components, name) => {\n const el = getElement(`[data-md-component=${name}]`, document)\n return {\n ...components,\n ...typeof el !== \"undefined\" ? { [name]: el } : {}\n }\n }, {})),\n\n /* Re-compute component map on document switch */\n scan((prev, next) => {\n for (const name of keys(prev)) {\n switch (name) {\n\n /* Top-level components: update */\n case \"header-title\":\n case \"container\":\n if (name in prev && typeof prev[name] !== \"undefined\") {\n prev[name]!.replaceWith(next[name]!)\n prev[name] = next[name]\n }\n break\n\n /* All other components: rebind */\n default:\n prev[name] = getElement(`[data-md-component=${name}]`)\n }\n }\n return prev\n })\n )\n\n /* Return component map as hot observable */\n return components$\n .pipe(\n shareReplay(1)\n )\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Switch to component\n *\n * @template T - Element type\n *\n * @param name - Component name\n *\n * @return Operator function\n */\nexport function switchComponent(\n name: Component\n): OperatorFunction {\n return pipe(\n switchMap(components => {\n return typeof components[name] !== \"undefined\"\n ? of(components[name] as T)\n : NEVER\n })\n )\n}\n","/*\n * Copyright (c) 2016-2019 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable, fromEvent } from \"rxjs\"\nimport { pluck } from \"rxjs/operators\"\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Set toggle\n *\n * Simulating a click event seems to be the most cross-browser compatible way\n * of changing the value while also emitting a `change` event. Before, Material\n * used `CustomEvent` to programatically change the value of a toggle, but this\n * is a much simpler and cleaner solution.\n *\n * @param el - Toggle element\n * @param value - Toggle value\n */\nexport function setToggle(\n el: HTMLInputElement, value: boolean\n): void {\n if (el.checked !== value)\n el.click()\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Watch toggle\n *\n * @param el - Toggle element\n *\n * @return Toggle observable\n */\nexport function watchToggle(\n el: HTMLInputElement\n): Observable {\n return fromEvent(el, \"change\")\n .pipe(\n pluck(\"checked\")\n )\n}\n"],"sourceRoot":""} \ No newline at end of file diff --git a/material/base.html b/material/base.html index aa79c85a4..759ad6ebb 100644 --- a/material/base.html +++ b/material/base.html @@ -104,7 +104,7 @@ - + {% if page.toc | first is defined %} {{ lang.t('skip.link.title') }} diff --git a/src/assets/javascripts/components/_/index.ts b/src/assets/javascripts/components/_/index.ts index b1522425d..a81f8363d 100644 --- a/src/assets/javascripts/components/_/index.ts +++ b/src/assets/javascripts/components/_/index.ts @@ -101,7 +101,7 @@ export function watchComponentMap( switch (name) { /* Top-level components: update */ - case "title": + case "header-title": case "container": if (name in prev && typeof prev[name] !== "undefined") { prev[name]!.replaceWith(next[name]!) diff --git a/src/assets/javascripts/index.ts b/src/assets/javascripts/index.ts index 7dfcd0910..c9e42d829 100644 --- a/src/assets/javascripts/index.ts +++ b/src/assets/javascripts/index.ts @@ -20,66 +20,56 @@ * IN THE SOFTWARE. */ -// TODO: remove this later on - +// TODO: remove this after we finished refactoring // tslint:disable -import { identity } from "ramda" +import { identity, values } from "ramda" import { EMPTY, - MonoTypeOperatorFunction, - NEVER, Observable, Subject, - defer, forkJoin, - fromEvent, merge, - of, - pipe, + of } from "rxjs" +import { ajax } from "rxjs/ajax" import { - combineAll, delay, - distinctUntilKeyChanged, filter, map, pluck, - shareReplay, switchMap, switchMapTo, take, tap, } from "rxjs/operators" -import {} from "components" -import { AjaxResponse, ajax } from "rxjs/ajax" import { Component, paintHeaderShadow, - setupHero, - setupMain, - setupNavigation, - setupSearchResult, + mountHero, + mountMain, + mountNavigation, + mountSearchResult, + mountTableOfContents, + mountTabs, switchComponent, watchComponentMap, watchHeader, - watchSearchReset, + watchSearchQuery, + watchSearchReset } from "./components" -import { SearchIndex, SearchResult } from "./modules/search" +import { SearchIndexOptions } from "./modules" import { getElement, setupAgent, - watchDocument, - watchLocation, - watchLocationHash, - watchMedia, watchToggle, - watchViewportOffset, - watchViewportSize, - watchWorker + watchWorker, + setToggle } from "./utilities" import { + PackerMessage, + PackerMessageType, SearchMessage, SearchMessageType, SearchSetupMessage, @@ -87,73 +77,71 @@ import { isSearchResultMessage } from "./workers" +/* ---------------------------------------------------------------------------- + * Types + * ------------------------------------------------------------------------- */ + /** * Configuration */ export interface Config { base: string /* Base URL */ worker: { - search: string /* Web worker URL */ - packer: string /* Web worker URL */ + search: string /* Search worker URL */ + packer: string /* Packer worker URL */ } } -import { - PackerMessage, - PackerMessageType -} from "./workers/packer" +/* ---------------------------------------------------------------------------- + * TODO: where do we put this stuff? + * ------------------------------------------------------------------------- */ -import { setupTabs } from "components/tabs" -import { setupTableOfContents } from "components/toc/_" +document.documentElement.classList.remove("no-js") +document.documentElement.classList.add("js") + +const names: Component[] = [ + "container", /* Container */ + "header", /* Header */ + "header-title", /* Header title */ + "hero", /* Hero */ + "main", /* Main area */ + "navigation", /* Navigation */ + "search", /* Search */ + "search-query", /* Search input */ + "search-reset", /* Search reset */ + "search-result", /* Search results */ + "tabs", /* Tabs */ + "toc" /* Table of contents */ +] /* ---------------------------------------------------------------------------- - * Functions + * Helper functions * ------------------------------------------------------------------------- */ /** * Ensure that the given value is a valid configuration * + * We could use `jsonschema` or any other schema validation framework, but that + * would just add more bloat to the bundle, so we'll keep it plain and simple. + * * @param config - Configuration * * @return Test result */ -export function isConfig(config: any): config is Config { +function isConfig(config: any): config is Config { return typeof config === "object" && typeof config.base === "string" + && typeof config.worker === "object" + && typeof config.worker.search === "string" + && typeof config.worker.packer === "string" } -// TBD - -// TODO: put this somewhere else... (merge with config!) JSON schema!? -const names: Component[] = [ - "header", /* Header */ - "title", /* Header title */ - "search", /* Search */ - "query", /* Search input */ - "reset", /* Search reset */ - "result", /* Search results */ - "container", /* Container */ - "main", /* Main area */ - "hero", /* Hero */ - "tabs", /* Tabs */ - "navigation", /* Navigation */ - "toc" /* Table of contents */ -] - -// modernizr for the poor -document.documentElement.classList.remove("no-js") -document.documentElement.classList.add("js") - -/* ---------------------------------------------------------------------------- - * Functions - * ------------------------------------------------------------------------- */ - /** * * Rogue control characters must be filtered before handing the query to the * search index, as lunr will throw otherwise. */ -function prepareQuery(value: string): string { +function prepare(value: string): string { const newvalue = value .replace(/(?:^|\s+)[*+-:^~]+(?=\s+|$)/g, "") .trim() @@ -161,29 +149,17 @@ function prepareQuery(value: string): string { return newvalue ? newvalue.replace(/\s+|$/g, "* ") : "" } -/** - * Initialize Material for MkDocs - * - * @param config - Configuration - */ -export function initialize(config: unknown) { - if (!isConfig(config)) - throw new SyntaxError(`Invalid configuration: ${JSON.stringify(config)}`) - - const agent = setupAgent() - +function setupWorkers(config: Config) { const worker = new Worker(config.worker.search) const packer = new Worker(config.worker.packer) - // const query = message.data.trim().replace(/\s+|$/g, "* ") // TODO: do this outside of the worker - const packerMessage$ = new Subject() const packer$ = watchWorker(packer, { send$: packerMessage$ }) // send a message, then switchMapTo worker! packer$.subscribe(message => { - console.log("PACKER.MSG", message.data.length) + // console.log("PACKER.MSG", message.data.length) // is always packed! if (message.type === PackerMessageType.BINARY && message.data[0] !== "{") localStorage.setItem("index", message.data) @@ -195,25 +171,6 @@ export function initialize(config: unknown) { const search$ = watchWorker(worker, { send$: searchMessage$ }) - // paintSearchResult <-- must paint META AND LIST! - // list must be painted based on scroll offset... - - /* Render search results */ - // search$ - // .pipe( - // filter(isSearchResultMessage), - // pluck("data") - // ) - // .subscribe(result => { - // const list = getElement(".md-search-result__list")! - // list.innerHTML = "" - // for (const el of result.map(renderSearchResult)) // TODO: perform entire lazy render!!!! - // list.appendChild(el) - // }) - - // scroll! - // watchSearchResult - /* Link search to packer */ search$ .pipe( @@ -232,7 +189,7 @@ export function initialize(config: unknown) { responseType: "json", withCredentials: true }) - .pipe( + .pipe( pluck("response") // take(1) ) @@ -264,48 +221,34 @@ export function initialize(config: unknown) { searchMessage$.next(message) // TODO: this shall not complete }) - // filter singular "+" or "-",as it will result in a lunr.js error + return [search$, searchMessage$] as const +} - // data$ - // .pipe( - // map(data => ({ - // type: SearchMessageType.SETUP, - // data - // })) - // ) - // .subscribe(message => { - // searchMessage$.next(message) // TODO: this shall not complete - // }) +/* ---------------------------------------------------------------------------- + * Functions + * ------------------------------------------------------------------------- */ - /* ----------------------------------------------------------------------- */ +/** + * Initialize Material for MkDocs + * + * @param config - Configuration + */ +export function initialize(config: unknown) { + if (!isConfig(config)) + throw new SyntaxError(`Invalid configuration: ${JSON.stringify(config)}`) - /* Create viewport observables */ - const offset$ = watchViewportOffset() - const size$ = watchViewportSize() + // pass config here!? + const agent = setupAgent() // TODO: add a config parameter here to configure media queries - /* Create media observables */ - const screen$ = watchMedia("(min-width: 1220px)") - const tablet$ = watchMedia("(min-width: 960px)") - - /* Create location observables */ - const location$ = watchLocation() - const fragment$ = watchLocationHash() - - /* Create document observables */ - const load$ = watchDocument() - - // Complete set of AgentObservables... - - // component map! - // - - // const switch$ = watchDocumentSwitch({ location$ }) + const [ + searchWorkerRecv$, + searchMessage$ + ] = setupWorkers(config) /* ----------------------------------------------------------------------- */ /* Create component map observable */ - const components$ = watchComponentMap(names, { document$: load$ }) - + const components$ = watchComponentMap(names, { document$: agent.document.load$ }) const component = (name: Component): Observable => { return components$ .pipe( @@ -319,233 +262,136 @@ export function initialize(config: unknown) { switchMap(watchHeader) ) - // DONE - const main$ = component("main") - .pipe( - setupMain(agent, { header$ }) - ) - - // setupHeader(agent) ?? - - // setupSearch - - // ---------------------------------------------------------------------------- - - /* Create header shadow toggle */ component("header") .pipe( switchMap(el => main$ .pipe( - paintHeaderShadow(el) + paintHeaderShadow(el) // technically, this could be done in paintMain ) ) ) .subscribe() + // ---------------------------------------------------------------------------- + // watchSearchResult // emit, if at bottom... // receive results as a second observable!? filter stuff, paint - const result$ = search$ + const result$ = searchWorkerRecv$ // move worker initialization into mountSearch ? .pipe( + tap(m => console.log("message from worker", m)), filter(isSearchResultMessage), pluck("data") ) - const query$ = component("query") + // handleSearchResult <-- operator + + const query$ = component("search-query") .pipe( - switchMap(el => fromEvent(el, "keyup") - .pipe( - map(() => prepareQuery(el.value)) - ) - ) + switchMap(el => watchSearchQuery(el, { prepare })) ) - // DONE - component("result") - .pipe( - setupSearchResult(agent, { result$, query$ }) + query$ + .pipe( + map(query => ({ // put this into some function... + type: SearchMessageType.QUERY, + data: query.value + })), // TODO. ugly... + // distinctUntilKeyChanged("data") ) - .subscribe() + .subscribe(searchMessage$) + + // create the message subject internally... and link it to the worker...? + // watchSearchWorker(worker, agent, { query$ }) // message internally... query$ .pipe( - map(data => ({ // put this into some function... - type: SearchMessageType.QUERY, - data - })), // TODO. ugly... - distinctUntilKeyChanged("data") - ) - - .subscribe(x => { - searchMessage$.next(x as any) // TODO + tap(query => { + if (query.focus) + setToggle(search, true) }) - - // Focus on search input - component("query") - .pipe( - switchMap(el => fromEvent(el, "focus") - .pipe( - tap(() => { - if (!search.checked) - search.click() // move this inside the search query stuff? not important... - }) - ) - ) // not super nice... ) .subscribe() - // // WIP: instant loading - // load$ - // .pipe( - // switchMap(({ body }) => fromEvent(body, "click")), - // switchMap(ev => { - // if (ev.target instanceof HTMLElement) { - // const el = ev.target.closest("a") || undefined - // if (el) { - // if (!/^(https?:|#)/.test(el.getAttribute("href")!)) { - // ev.preventDefault() - // } - // const href = el.href - // history.pushState({}, "", href) // TODO: reference necessary!? - // return of(href) - // } - // } - // return EMPTY - // }) - - // // try to reduce the jiggle upon instant page load. ideally, the location - // // should directly be resolved and the respective document loaded, but - // // we must scroll to the top at first and wait at least 250ms. - // // - // // Furthermore, this doesn't include the back/next buttons of the browser - // // which must be delayed - // // tap(url => { - // // if (!/#/.test(url)) - // // scrollTo({ top: 0 }) - // // }) // only when loading something we havent loaded! - // // delay(250) - // ) - // .subscribe(location$) - - // location$.subscribe(x => { - // console.log("L", x) - // }) - // switch$.subscribe(x => { - // console.log("S", x) - // }) - /* ----------------------------------------------------------------------- */ - component("navigation") + const main$ = component("main") .pipe( - setupNavigation(agent, { main$ }) + mountMain(agent, { header$ }) ) - .subscribe() - component("toc") + const navigation$ = component("navigation") .pipe( - setupTableOfContents(agent, { header$, main$ }) + mountNavigation(agent, { main$ }) ) - .subscribe() - component("tabs") + const toc$ = component("toc") .pipe( - setupTabs(agent, { header$ }) + mountTableOfContents(agent, { header$, main$ }) ) - .subscribe() - component("hero") + // TODO: naming? + const resultComponent$ = component("search-result") .pipe( - setupHero(agent, { header$ }) + mountSearchResult(agent, { result$, query$: query$.pipe(pluck("value")) }) + ) // temporary fix + + const tabs$ = component("tabs") + .pipe( + mountTabs(agent, { header$ }) ) - .subscribe() - // /* Create header title toggle */ - // component("main") - // .pipe( - // delay(1000), // initial delay - // switchMap(el => typeof getElement("h1", el) !== "undefined" - // ? watchBottomOffset(getElement("h1", el)!, { size$, offset$, header$ }) - // .pipe( - // map(({ y }) => y >= 0), - // withLatestFrom(component("title")), - // tap(([active, title]) => { - // title.dataset.mdState = active ? "active" : "" - // }) - // ) - // : NEVER - // ) - // ) - // .subscribe() + const hero$ = component("hero") + .pipe( + mountHero(agent, { header$ }) + ) - // TODO: replace title as inner text /* ----------------------------------------------------------------------- */ const drawer = getElement("[data-md-toggle=drawer]")! const search = getElement("[data-md-toggle=search]")! - // watchToggle - - // --> watchSearchQuery? - - // watchSearch - // watchSearchReset - - // toggles stay the same... - const a$ = watchToggle(search) .pipe( filter(identity), delay(400) ) - // watchSearchReset() - - const b$ = component("reset") + const reset$ = component("search-reset") .pipe( switchMap(watchSearchReset) ) - function focusQuery(): MonoTypeOperatorFunction { - return pipe( - tap(el => el.focus()) - ) - } - - merge(a$, b$) + merge(a$, reset$) .pipe( - switchMapTo(component("query")), - focusQuery() + switchMapTo(component("search-query")), + tap(el => el.focus()) ) .subscribe() - /* Wrap all data tables for better overflow scrolling */ - // const tables = getElements("table:not([class])") - // tables.forEach(table => { - // console.log("x", table) - // table.parentNode!.insertBefore(renderTable(table), table) - // table.replaceWith(renderTable(table) as any) - // // table.parentElement!.replaceChild(, table) - // }) + /* ----------------------------------------------------------------------- */ - return { - // agent, // agent.viewport.offset$ - // component, // component.toc$ + const state = { + search: { + query$, + result$: resultComponent$, + reset$, + }, + main$, + navigation$, + toc$, + tabs$, + hero$ } - /* Return observable factories */ - return { + const { search: temp, ...rest } = state + merge(...values(rest), ...values(temp)) + .subscribe() // potential memleak <-- use takeUntil - /* User interface */ - watchDocument: () => load$, - // watchDocumentSwitch: () => switch$, - watchLocation: () => location$, - watchLocationFragment: () => fragment$, - watchMediaScreen: () => screen$, - watchMediaTablet: () => tablet$, - watchViewportOffset: () => offset$, - watchViewportSize: () => size$ + return { + agent, + state } } diff --git a/src/base.html b/src/base.html index 324fd9463..fd100cd5b 100644 --- a/src/base.html +++ b/src/base.html @@ -238,11 +238,7 @@ /> - + {% if page.toc | first is defined %}