Skip to content

Instantly share code, notes, and snippets.

@rveciana
Last active November 25, 2019 07:38
Show Gist options
  • Save rveciana/0fdb54cb77770c3695425b8f633c7b3e to your computer and use it in GitHub Desktop.
Save rveciana/0fdb54cb77770c3695425b8f633c7b3e to your computer and use it in GitHub Desktop.
RxJS and svelte
licence: mit

Learned in this tweet that Svelte and RxJS work together directly, which I found interesting.

I don't want to forget it, so this example will help me.

Wired-elements make the example more attractive.

The base is the basic Svelte template. I just changed the App.svelte file and installed the libraries.

<script>
import { ajax } from "rxjs/ajax";
import { pluck, startWith } from "rxjs/operators";
import { WiredIconButton, WiredCard } from "wired-elements";
import { afterUpdate } from 'svelte';
const users$ = ajax("https://api.github.com/users?per_page=5")
.pipe(pluck("response"), startWith([])
);
afterUpdate(() => {
const card = document.querySelector("wired-card");
card.requestUpdate();
});
</script>
<wired-card elevation="3">
<h1>Users list</h1>
<div>
{#each $users$ as user}
<p><wired-icon-button style="--wired-icon-size:8px">favorite</wired-icon-button> {user.login} </p>
{/each}
</div>
</wired-card>
var app=function(){"use strict";function t(){}function e(t){return t()}function i(){return Object.create(null)}function s(t){t.forEach(e)}function n(t){return"function"==typeof t}function r(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function o(t,e){t.appendChild(e)}function a(t,e,i){t.insertBefore(e,i)}function c(t){t.parentNode.removeChild(t)}function h(t){return document.createElement(t)}function l(t){return document.createTextNode(t)}function d(){return l(" ")}let u;function p(t){u=t}function f(t){(function(){if(!u)throw new Error("Function called outside component initialization");return u})().$$.after_render.push(t)}const y=[],b=Promise.resolve();let g=!1;const m=[],v=[],w=[];function x(t){v.push(t)}function k(){const t=new Set;do{for(;y.length;){const t=y.shift();p(t),S(t.$$)}for(;m.length;)m.shift()();for(;v.length;){const e=v.pop();t.has(e)||(e(),t.add(e))}}while(y.length);for(;w.length;)w.pop()();g=!1}function S(t){t.fragment&&(t.update(t.dirty),s(t.before_render),t.fragment.p(t.dirty,t.ctx),t.dirty=null,t.after_render.forEach(x))}function _(t,e){t.$$.dirty||(y.push(t),g||(g=!0,b.then(k)),t.$$.dirty={}),t.$$.dirty[e]=!0}function C(r,o,a,c,h,l){const d=u;p(r);const f=o.props||{},y=r.$$={fragment:null,ctx:null,props:l,update:t,not_equal:h,bound:i(),on_mount:[],on_destroy:[],before_render:[],after_render:[],context:new Map(d?d.$$.context:[]),callbacks:i(),dirty:null};let b=!1;var g;y.ctx=a?a(r,f,(t,e)=>{y.ctx&&h(y.ctx[t],y.ctx[t]=e)&&(y.bound[t]&&y.bound[t](e),b&&_(r,t))}):f,y.update(),b=!0,s(y.before_render),y.fragment=c(y.ctx),o.target&&(o.hydrate?y.fragment.l((g=o.target,Array.from(g.childNodes))):y.fragment.c(),o.intro&&r.$$.fragment.i&&r.$$.fragment.i(),function(t,i,r){const{fragment:o,on_mount:a,on_destroy:c,after_render:h}=t.$$;o.m(i,r),x(()=>{const i=a.map(e).filter(n);c?c.push(...i):s(i),t.$$.on_mount=[]}),h.forEach(x)}(r,o.target,o.anchor),k()),p(d)}class E{$destroy(){var e,i;i=!0,(e=this).$$&&(s(e.$$.on_destroy),e.$$.fragment.d(i),e.$$.on_destroy=e.$$.fragment=null,e.$$.ctx={}),this.$destroy=t}$on(t,e){const i=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return i.push(e),()=>{const t=i.indexOf(e);-1!==t&&i.splice(t,1)}}$set(){}}var N=function(t,e){return(N=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)};function R(t,e){function i(){this.constructor=t}N(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var O="undefined"!=typeof window&&window,P="undefined"!=typeof self&&"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self,M="undefined"!=typeof global&&global,j=O||M||P;function T(t){return"function"==typeof t}var A=!1,$={Promise:void 0,set useDeprecatedSynchronousErrorHandling(t){t&&(new Error).stack;A=t},get useDeprecatedSynchronousErrorHandling(){return A}};function L(t){setTimeout(function(){throw t},0)}var I={closed:!0,next:function(t){},error:function(t){if($.useDeprecatedSynchronousErrorHandling)throw t;L(t)},complete:function(){}},D=Array.isArray||function(t){return t&&"number"==typeof t.length};function V(t){return null!==t&&"object"==typeof t}function B(t){return Error.call(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map(function(t,e){return e+1+") "+t.toString()}).join("\n "):"",this.name="UnsubscriptionError",this.errors=t,this}B.prototype=Object.create(Error.prototype);var z=B,q=function(){function t(t){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,t&&(this._unsubscribe=t)}var e;return t.prototype.unsubscribe=function(){var e;if(!this.closed){var i=this._parentOrParents,s=this._unsubscribe,n=this._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,i instanceof t)i.remove(this);else if(null!==i)for(var r=0;r<i.length;++r){i[r].remove(this)}if(T(s))try{s.call(this)}catch(t){e=t instanceof z?U(t.errors):[t]}if(D(n)){r=-1;for(var o=n.length;++r<o;){var a=n[r];if(V(a))try{a.unsubscribe()}catch(t){e=e||[],t instanceof z?e=e.concat(U(t.errors)):e.push(t)}}}if(e)throw new z(e)}},t.prototype.add=function(e){var i=e;switch(typeof e){case"function":i=new t(e);case"object":if(i===this||i.closed||"function"!=typeof i.unsubscribe)return i;if(this.closed)return i.unsubscribe(),i;if(!(i instanceof t)){var s=i;(i=new t)._subscriptions=[s]}break;default:if(!e)return t.EMPTY;throw new Error("unrecognized teardown "+e+" added to Subscription.")}var n=i._parentOrParents;if(null===n)i._parentOrParents=this;else if(n instanceof t){if(n===this)return i;i._parentOrParents=[n,this]}else{if(-1!==n.indexOf(this))return i;n.push(this)}var r=this._subscriptions;return null===r?this._subscriptions=[i]:r.push(i),i},t.prototype.remove=function(t){var e=this._subscriptions;if(e){var i=e.indexOf(t);-1!==i&&e.splice(i,1)}},t.EMPTY=((e=new t).closed=!0,e),t}();function U(t){return t.reduce(function(t,e){return t.concat(e instanceof z?e.errors:e)},[])}var H="function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random(),X=function(t){function e(i,s,n){var r=t.call(this)||this;switch(r.syncErrorValue=null,r.syncErrorThrown=!1,r.syncErrorThrowable=!1,r.isStopped=!1,arguments.length){case 0:r.destination=I;break;case 1:if(!i){r.destination=I;break}if("object"==typeof i){i instanceof e?(r.syncErrorThrowable=i.syncErrorThrowable,r.destination=i,i.add(r)):(r.syncErrorThrowable=!0,r.destination=new F(r,i));break}default:r.syncErrorThrowable=!0,r.destination=new F(r,i,s,n)}return r}return R(e,t),e.prototype[H]=function(){return this},e.create=function(t,i,s){var n=new e(t,i,s);return n.syncErrorThrowable=!1,n},e.prototype.next=function(t){this.isStopped||this._next(t)},e.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this))},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){this.destination.error(t),this.unsubscribe()},e.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},e.prototype._unsubscribeAndRecycle=function(){var t=this._parentOrParents;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=t,this},e}(q),F=function(t){function e(e,i,s,n){var r,o=t.call(this)||this;o._parentSubscriber=e;var a=o;return T(i)?r=i:i&&(r=i.next,s=i.error,n=i.complete,i!==I&&(T((a=Object.create(i)).unsubscribe)&&o.add(a.unsubscribe.bind(a)),a.unsubscribe=o.unsubscribe.bind(o))),o._context=a,o._next=r,o._error=s,o._complete=n,o}return R(e,t),e.prototype.next=function(t){if(!this.isStopped&&this._next){var e=this._parentSubscriber;$.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?this.__tryOrSetError(e,this._next,t)&&this.unsubscribe():this.__tryOrUnsub(this._next,t)}},e.prototype.error=function(t){if(!this.isStopped){var e=this._parentSubscriber,i=$.useDeprecatedSynchronousErrorHandling;if(this._error)i&&e.syncErrorThrowable?(this.__tryOrSetError(e,this._error,t),this.unsubscribe()):(this.__tryOrUnsub(this._error,t),this.unsubscribe());else if(e.syncErrorThrowable)i?(e.syncErrorValue=t,e.syncErrorThrown=!0):L(t),this.unsubscribe();else{if(this.unsubscribe(),i)throw t;L(t)}}},e.prototype.complete=function(){var t=this;if(!this.isStopped){var e=this._parentSubscriber;if(this._complete){var i=function(){return t._complete.call(t._context)};$.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?(this.__tryOrSetError(e,i),this.unsubscribe()):(this.__tryOrUnsub(i),this.unsubscribe())}else this.unsubscribe()}},e.prototype.__tryOrUnsub=function(t,e){try{t.call(this._context,e)}catch(t){if(this.unsubscribe(),$.useDeprecatedSynchronousErrorHandling)throw t;L(t)}},e.prototype.__tryOrSetError=function(t,e,i){if(!$.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{e.call(this._context,i)}catch(e){return $.useDeprecatedSynchronousErrorHandling?(t.syncErrorValue=e,t.syncErrorThrown=!0,!0):(L(e),!0)}return!1},e.prototype._unsubscribe=function(){var t=this._parentSubscriber;this._context=null,this._parentSubscriber=null,t.unsubscribe()},e}(X);var W="function"==typeof Symbol&&Symbol.observable||"@@observable";function G(){}var Y=function(){function t(t){this._isScalar=!1,t&&(this._subscribe=t)}return t.prototype.lift=function(e){var i=new t;return i.source=this,i.operator=e,i},t.prototype.subscribe=function(t,e,i){var s=this.operator,n=function(t,e,i){if(t){if(t instanceof X)return t;if(t[H])return t[H]()}return t||e||i?new X(t,e,i):new X(I)}(t,e,i);if(s?n.add(s.call(n,this.source)):n.add(this.source||$.useDeprecatedSynchronousErrorHandling&&!n.syncErrorThrowable?this._subscribe(n):this._trySubscribe(n)),$.useDeprecatedSynchronousErrorHandling&&n.syncErrorThrowable&&(n.syncErrorThrowable=!1,n.syncErrorThrown))throw n.syncErrorValue;return n},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){$.useDeprecatedSynchronousErrorHandling&&(t.syncErrorThrown=!0,t.syncErrorValue=e),!function(t){for(;t;){var e=t,i=e.closed,s=e.destination,n=e.isStopped;if(i||n)return!1;t=s&&s instanceof X?s:null}return!0}(t)?console.warn(e):t.error(e)}},t.prototype.forEach=function(t,e){var i=this;return new(e=J(e))(function(e,s){var n;n=i.subscribe(function(e){try{t(e)}catch(t){s(t),n&&n.unsubscribe()}},s,e)})},t.prototype._subscribe=function(t){var e=this.source;return e&&e.subscribe(t)},t.prototype[W]=function(){return this},t.prototype.pipe=function(){for(var t,e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];return 0===e.length?this:((t=e)?1===t.length?t[0]:function(e){return t.reduce(function(t,e){return e(t)},e)}:G)(this)},t.prototype.toPromise=function(t){var e=this;return new(t=J(t))(function(t,i){var s;e.subscribe(function(t){return s=t},function(t){return i(t)},function(){return t(s)})})},t.create=function(e){return new t(e)},t}();function J(t){if(t||(t=Promise),!t)throw new Error("no Promise impl found");return t}function K(t,e){return function(i){if("function"!=typeof t)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return i.lift(new Z(t,e))}}var Z=function(){function t(t,e){this.project=t,this.thisArg=e}return t.prototype.call=function(t,e){return e.subscribe(new Q(t,this.project,this.thisArg))},t}(),Q=function(t){function e(e,i,s){var n=t.call(this,e)||this;return n.project=i,n.count=0,n.thisArg=s||n,n}return R(e,t),e.prototype._next=function(t){var e;try{e=this.project.call(this.thisArg,t,this.count++)}catch(t){return void this.destination.error(t)}this.destination.next(e)},e}(X);function tt(t,e){return void 0===e&&(e=null),new at({method:"GET",url:t,headers:e})}function et(t,e,i){return new at({method:"POST",url:t,body:e,headers:i})}function it(t,e){return new at({method:"DELETE",url:t,headers:e})}function st(t,e,i){return new at({method:"PUT",url:t,body:e,headers:i})}function nt(t,e,i){return new at({method:"PATCH",url:t,body:e,headers:i})}var rt=K(function(t,e){return t.response});function ot(t,e){return rt(new at({method:"GET",url:t,responseType:"json",headers:e}))}var at=function(t){function e(e){var i=t.call(this)||this,s={async:!0,createXHR:function(){return this.crossDomain?function(){if(j.XMLHttpRequest)return new j.XMLHttpRequest;if(j.XDomainRequest)return new j.XDomainRequest;throw new Error("CORS is not supported by your browser")}():function(){if(j.XMLHttpRequest)return new j.XMLHttpRequest;var t=void 0;try{for(var e=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],i=0;i<3;i++)try{if(t=e[i],new j.ActiveXObject(t))break}catch(t){}return new j.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)s.url=e;else for(var n in e)e.hasOwnProperty(n)&&(s[n]=e[n]);return i.request=s,i}var i;return R(e,t),e.prototype._subscribe=function(t){return new ct(t,this.request)},e.create=((i=function(t){return new e(t)}).get=tt,i.post=et,i.delete=it,i.put=st,i.patch=nt,i.getJSON=ot,i),e}(Y),ct=function(t){function e(e,i){var s=t.call(this,e)||this;s.request=i,s.done=!1;var n=i.headers=i.headers||{};return i.crossDomain||s.getHeader(n,"X-Requested-With")||(n["X-Requested-With"]="XMLHttpRequest"),s.getHeader(n,"Content-Type")||j.FormData&&i.body instanceof j.FormData||void 0===i.body||(n["Content-Type"]="application/x-www-form-urlencoded; charset=UTF-8"),i.body=s.serializeBody(i.body,s.getHeader(i.headers,"Content-Type")),s.send(),s}return R(e,t),e.prototype.next=function(t){this.done=!0;var e,i=this.xhr,s=this.request,n=this.destination;try{e=new ht(t,i,s)}catch(t){return n.error(t)}n.next(e)},e.prototype.send=function(){var t=this.request,e=this.request,i=e.user,s=e.method,n=e.url,r=e.async,o=e.password,a=e.headers,c=e.body;try{var h=this.xhr=t.createXHR();this.setupEvents(h,t),i?h.open(s,n,r,i,o):h.open(s,n,r),r&&(h.timeout=t.timeout,h.responseType=t.responseType),"withCredentials"in h&&(h.withCredentials=!!t.withCredentials),this.setHeaders(h,a),c?h.send(c):h.send()}catch(t){this.error(t)}},e.prototype.serializeBody=function(t,e){if(!t||"string"==typeof t)return t;if(j.FormData&&t instanceof j.FormData)return t;if(e){var i=e.indexOf(";");-1!==i&&(e=e.substring(0,i))}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 i in e)e.hasOwnProperty(i)&&t.setRequestHeader(i,e[i])},e.prototype.getHeader=function(t,e){for(var i in t)if(i.toLowerCase()===e.toLowerCase())return t[i]},e.prototype.setupEvents=function(t,e){var i=e.progressSubscriber;function s(t){var e,i=s,n=i.subscriber,r=i.progressSubscriber,o=i.request;r&&r.error(t);try{e=new pt(this,o)}catch(t){e=t}n.error(e)}if(t.ontimeout=s,s.request=e,s.subscriber=this,s.progressSubscriber=i,t.upload&&"withCredentials"in t){var n,r;if(i)n=function(t){n.progressSubscriber.next(t)},j.XDomainRequest?t.onprogress=n:t.upload.onprogress=n,n.progressSubscriber=i;r=function(t){var e,i=r,s=i.progressSubscriber,n=i.subscriber,o=i.request;s&&s.error(t);try{e=new dt("ajax error",this,o)}catch(t){e=t}n.error(e)},t.onerror=r,r.request=e,r.subscriber=this,r.progressSubscriber=i}function o(t){}function a(t){var e=a,i=e.subscriber,s=e.progressSubscriber,n=e.request;if(4===this.readyState){var r=1223===this.status?204:this.status,o="text"===this.responseType?this.response||this.responseText:this.response;if(0===r&&(r=o?200:0),r<400)s&&s.complete(),i.next(t),i.complete();else{s&&s.error(t);var c=void 0;try{c=new dt("ajax error "+r,this,n)}catch(t){c=t}i.error(c)}}}t.onreadystatechange=o,o.subscriber=this,o.progressSubscriber=i,o.request=e,t.onload=a,a.subscriber=this,a.progressSubscriber=i,a.request=e},e.prototype.unsubscribe=function(){var e=this.done,i=this.xhr;!e&&i&&4!==i.readyState&&"function"==typeof i.abort&&i.abort(),t.prototype.unsubscribe.call(this)},e}(X),ht=function(){return function(t,e,i){this.originalEvent=t,this.xhr=e,this.request=i,this.status=e.status,this.responseType=e.responseType||i.responseType,this.response=ut(this.responseType,e)}}();function lt(t,e,i){return Error.call(this),this.message=t,this.name="AjaxError",this.xhr=e,this.request=i,this.status=e.status,this.responseType=e.responseType||i.responseType,this.response=ut(this.responseType,e),this}lt.prototype=Object.create(Error.prototype);var dt=lt;function ut(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 pt=function(t,e){return dt.call(this,"ajax timeout",t,e),this.name="AjaxTimeoutError",this},ft=at.create,yt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return R(e,t),e.prototype.notifyNext=function(t,e,i,s,n){this.destination.next(e)},e.prototype.notifyError=function(t,e){this.destination.error(t)},e.prototype.notifyComplete=function(t){this.destination.complete()},e}(X),bt=function(t){function e(e,i,s){var n=t.call(this)||this;return n.parent=e,n.outerValue=i,n.outerIndex=s,n.index=0,n}return R(e,t),e.prototype._next=function(t){this.parent.notifyNext(this.outerValue,t,this.outerIndex,this.index++,this)},e.prototype._error=function(t){this.parent.notifyError(t,this),this.unsubscribe()},e.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},e}(X),gt=function(t){return function(e){for(var i=0,s=t.length;i<s&&!e.closed;i++)e.next(t[i]);e.complete()}};function mt(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}var vt=mt(),wt=function(t){return t&&"number"==typeof t.length&&"function"!=typeof t};function xt(t){return!!t&&"function"!=typeof t.subscribe&&"function"==typeof t.then}var kt=function(t){if(t&&"function"==typeof t[W])return s=t,function(t){var e=s[W]();if("function"!=typeof e.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return e.subscribe(t)};if(wt(t))return gt(t);if(xt(t))return i=t,function(t){return i.then(function(e){t.closed||(t.next(e),t.complete())},function(e){return t.error(e)}).then(null,L),t};if(t&&"function"==typeof t[vt])return e=t,function(t){for(var i=e[vt]();;){var s=i.next();if(s.done){t.complete();break}if(t.next(s.value),t.closed)break}return"function"==typeof i.return&&t.add(function(){i.return&&i.return()}),t};var e,i,s,n=V(t)?"an invalid object":"'"+t+"'";throw new TypeError("You provided "+n+" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.")};function St(t){return t&&"function"==typeof t.schedule}function _t(t,e){return new Y(function(i){var s=new q,n=0;return s.add(e.schedule(function(){n!==t.length?(i.next(t[n++]),i.closed||s.add(this.schedule())):i.complete()})),s})}function Ct(t,e){if(null!=t){if(function(t){return t&&"function"==typeof t[W]}(t))return function(t,e){return new Y(function(i){var s=new q;return s.add(e.schedule(function(){var n=t[W]();s.add(n.subscribe({next:function(t){s.add(e.schedule(function(){return i.next(t)}))},error:function(t){s.add(e.schedule(function(){return i.error(t)}))},complete:function(){s.add(e.schedule(function(){return i.complete()}))}}))})),s})}(t,e);if(xt(t))return function(t,e){return new Y(function(i){var s=new q;return s.add(e.schedule(function(){return t.then(function(t){s.add(e.schedule(function(){i.next(t),s.add(e.schedule(function(){return i.complete()}))}))},function(t){s.add(e.schedule(function(){return i.error(t)}))})})),s})}(t,e);if(wt(t))return _t(t,e);if(function(t){return t&&"function"==typeof t[vt]}(t)||"string"==typeof t)return function(t,e){if(!t)throw new Error("Iterable cannot be null");return new Y(function(i){var s,n=new q;return n.add(function(){s&&"function"==typeof s.return&&s.return()}),n.add(e.schedule(function(){s=t[vt](),n.add(e.schedule(function(){if(!i.closed){var t,e;try{var n=s.next();t=n.value,e=n.done}catch(t){return void i.error(t)}e?i.complete():(i.next(t),this.schedule())}}))})),n})}(t,e)}throw new TypeError((null!==t&&typeof t||t)+" is not observable")}function Et(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var i=t[t.length-1];return St(i)?(t.pop(),_t(t,i)):function(t,e){return e?_t(t,e):new Y(gt(t))}(t)}function Nt(t,e,i){return void 0===i&&(i=Number.POSITIVE_INFINITY),"function"==typeof e?function(s){return s.pipe(Nt(function(i,s){return(n=t(i,s),r?Ct(n,r):n instanceof Y?n:new Y(kt(n))).pipe(K(function(t,n){return e(i,t,s,n)}));var n,r},i))}:("number"==typeof e&&(i=e),function(e){return e.lift(new Rt(t,i))})}var Rt=function(){function t(t,e){void 0===e&&(e=Number.POSITIVE_INFINITY),this.project=t,this.concurrent=e}return t.prototype.call=function(t,e){return e.subscribe(new Ot(t,this.project,this.concurrent))},t}(),Ot=function(t){function e(e,i,s){void 0===s&&(s=Number.POSITIVE_INFINITY);var n=t.call(this,e)||this;return n.project=i,n.concurrent=s,n.hasCompleted=!1,n.buffer=[],n.active=0,n.index=0,n}return R(e,t),e.prototype._next=function(t){this.active<this.concurrent?this._tryNext(t):this.buffer.push(t)},e.prototype._tryNext=function(t){var e,i=this.index++;try{e=this.project(t,i)}catch(t){return void this.destination.error(t)}this.active++,this._innerSub(e,t,i)},e.prototype._innerSub=function(t,e,i){var s=new bt(this,void 0,void 0);this.destination.add(s),function(t,e,i,s,n){if(void 0===n&&(n=new bt(t,i,s)),!n.closed)e instanceof Y?e.subscribe(n):kt(e)(n)}(this,t,e,i,s)},e.prototype._complete=function(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&this.destination.complete(),this.unsubscribe()},e.prototype.notifyNext=function(t,e,i,s,n){this.destination.next(e)},e.prototype.notifyComplete=function(t){var e=this.buffer;this.remove(t),this.active--,e.length>0?this._next(e.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},e}(yt);function Pt(t){return t}function Mt(){return void 0===(t=1)&&(t=Number.POSITIVE_INFINITY),Nt(Pt,t);var t}function jt(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Mt()(Et.apply(void 0,t))}var Tt=function(t){function e(e){var i=t.call(this,e)||this;return i.destination=e,i}return R(e,t),e}(X);var At=function(){function t(t){this.connectable=t}return t.prototype.call=function(t,e){var i=this.connectable;i._refCount++;var s=new $t(t,i),n=e.subscribe(s);return s.closed||(s.connection=i.connect()),n},t}(),$t=function(t){function e(e,i){var s=t.call(this,e)||this;return s.connectable=i,s}return R(e,t),e.prototype._unsubscribe=function(){var t=this.connectable;if(t){this.connectable=null;var e=t._refCount;if(e<=0)this.connection=null;else if(t._refCount=e-1,e>1)this.connection=null;else{var i=this.connection,s=t._connection;this.connection=null,!s||i&&s!==i||s.unsubscribe()}}else this.connection=null},e}(X),Lt=function(t){function e(e,i){var s=t.call(this)||this;return s.source=e,s.subjectFactory=i,s._refCount=0,s._isComplete=!1,s}return R(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 q).add(this.source.subscribe(new It(this.getSubject(),this))),t.closed&&(this._connection=null,t=q.EMPTY)),t},e.prototype.refCount=function(){return(t=this).lift(new At(t));var t},e}(Y).prototype,It=(Lt._subscribe,Lt._isComplete,Lt.getSubject,Lt.connect,Lt.refCount,function(t){function e(e,i){var s=t.call(this,e)||this;return s.connectable=i,s}return R(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}(Tt));function Dt(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var i=t.length;if(0===i)throw new Error("list of properties cannot be empty.");return function(e){return K(function(t,e){return function(i){for(var s=i,n=0;n<e;n++){var r=s[t[n]];if(void 0===r)return;s=r}return s}}(t,i))(e)}}const Vt=new WeakMap,Bt=t=>"function"==typeof t&&Vt.has(t),zt=void 0!==window.customElements&&void 0!==window.customElements.polyfillWrapFlushCallback,qt=(t,e,i=null)=>{let s=e;for(;s!==i;){const e=s.nextSibling;t.removeChild(s),s=e}},Ut={},Ht={},Xt=`{{lit-${String(Math.random()).slice(2)}}}`,Ft=`\x3c!--${Xt}--\x3e`,Wt=new RegExp(`${Xt}|${Ft}`),Gt="$lit$";class Yt{constructor(t,e){this.parts=[],this.element=e;let i=-1,s=0;const n=[],r=e=>{const o=e.content,a=document.createTreeWalker(o,133,null,!1);let c=0;for(;a.nextNode();){i++;const e=a.currentNode;if(1===e.nodeType){if(e.hasAttributes()){const n=e.attributes;let r=0;for(let t=0;t<n.length;t++)n[t].value.indexOf(Xt)>=0&&r++;for(;r-- >0;){const n=t.strings[s],r=Zt.exec(n)[2],o=r.toLowerCase()+Gt,a=e.getAttribute(o).split(Wt);this.parts.push({type:"attribute",index:i,name:r,strings:a}),e.removeAttribute(o),s+=a.length-1}}"TEMPLATE"===e.tagName&&r(e)}else if(3===e.nodeType){const t=e.data;if(t.indexOf(Xt)>=0){const r=e.parentNode,o=t.split(Wt),a=o.length-1;for(let t=0;t<a;t++)r.insertBefore(""===o[t]?Kt():document.createTextNode(o[t]),e),this.parts.push({type:"node",index:++i});""===o[a]?(r.insertBefore(Kt(),e),n.push(e)):e.data=o[a],s+=a}}else if(8===e.nodeType)if(e.data===Xt){const t=e.parentNode;null!==e.previousSibling&&i!==c||(i++,t.insertBefore(Kt(),e)),c=i,this.parts.push({type:"node",index:i}),null===e.nextSibling?e.data="":(n.push(e),i--),s++}else{let t=-1;for(;-1!==(t=e.data.indexOf(Xt,t+1));)this.parts.push({type:"node",index:-1})}}};r(e);for(const t of n)t.parentNode.removeChild(t)}}const Jt=t=>-1!==t.index,Kt=()=>document.createComment(""),Zt=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F \x09\x0a\x0c\x0d"'>=\/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;class Qt{constructor(t,e,i){this._parts=[],this.template=t,this.processor=e,this.options=i}update(t){let e=0;for(const i of this._parts)void 0!==i&&i.setValue(t[e]),e++;for(const t of this._parts)void 0!==t&&t.commit()}_clone(){const t=zt?this.template.element.content.cloneNode(!0):document.importNode(this.template.element.content,!0),e=this.template.parts;let i=0,s=0;const n=t=>{const r=document.createTreeWalker(t,133,null,!1);let o=r.nextNode();for(;i<e.length&&null!==o;){const t=e[i];if(Jt(t))if(s===t.index){if("node"===t.type){const t=this.processor.handleTextExpression(this.options);t.insertAfterNode(o.previousSibling),this._parts.push(t)}else this._parts.push(...this.processor.handleAttributeExpressions(o,t.name,t.strings,this.options));i++}else s++,"TEMPLATE"===o.nodeName&&n(o.content),o=r.nextNode();else this._parts.push(void 0),i++}};return n(t),zt&&(document.adoptNode(t),customElements.upgrade(t)),t}}class te{constructor(t,e,i,s){this.strings=t,this.values=e,this.type=i,this.processor=s}getHTML(){const t=this.strings.length-1;let e="";for(let i=0;i<t;i++){const t=this.strings[i],s=Zt.exec(t);e+=s?t.substr(0,s.index)+s[1]+s[2]+Gt+s[3]+Xt:t+Ft}return e+this.strings[t]}getTemplateElement(){const t=document.createElement("template");return t.innerHTML=this.getHTML(),t}}const ee=t=>null===t||!("object"==typeof t||"function"==typeof t);class ie{constructor(t,e,i){this.dirty=!0,this.element=t,this.name=e,this.strings=i,this.parts=[];for(let t=0;t<i.length-1;t++)this.parts[t]=this._createPart()}_createPart(){return new se(this)}_getValue(){const t=this.strings,e=t.length-1;let i="";for(let s=0;s<e;s++){i+=t[s];const e=this.parts[s];if(void 0!==e){const t=e.value;if(null!=t&&(Array.isArray(t)||"string"!=typeof t&&t[Symbol.iterator]))for(const e of t)i+="string"==typeof e?e:String(e);else i+="string"==typeof t?t:String(t)}}return i+=t[e]}commit(){this.dirty&&(this.dirty=!1,this.element.setAttribute(this.name,this._getValue()))}}class se{constructor(t){this.value=void 0,this.committer=t}setValue(t){t===Ut||ee(t)&&t===this.value||(this.value=t,Bt(t)||(this.committer.dirty=!0))}commit(){for(;Bt(this.value);){const t=this.value;this.value=Ut,t(this)}this.value!==Ut&&this.committer.commit()}}class ne{constructor(t){this.value=void 0,this._pendingValue=void 0,this.options=t}appendInto(t){this.startNode=t.appendChild(Kt()),this.endNode=t.appendChild(Kt())}insertAfterNode(t){this.startNode=t,this.endNode=t.nextSibling}appendIntoPart(t){t._insert(this.startNode=Kt()),t._insert(this.endNode=Kt())}insertAfterPart(t){t._insert(this.startNode=Kt()),this.endNode=t.endNode,t.endNode=this.startNode}setValue(t){this._pendingValue=t}commit(){for(;Bt(this._pendingValue);){const t=this._pendingValue;this._pendingValue=Ut,t(this)}const t=this._pendingValue;t!==Ut&&(ee(t)?t!==this.value&&this._commitText(t):t instanceof te?this._commitTemplateResult(t):t instanceof Node?this._commitNode(t):Array.isArray(t)||t[Symbol.iterator]?this._commitIterable(t):t===Ht?(this.value=Ht,this.clear()):this._commitText(t))}_insert(t){this.endNode.parentNode.insertBefore(t,this.endNode)}_commitNode(t){this.value!==t&&(this.clear(),this._insert(t),this.value=t)}_commitText(t){const e=this.startNode.nextSibling;t=null==t?"":t,e===this.endNode.previousSibling&&3===e.nodeType?e.data=t:this._commitNode(document.createTextNode("string"==typeof t?t:String(t))),this.value=t}_commitTemplateResult(t){const e=this.options.templateFactory(t);if(this.value instanceof Qt&&this.value.template===e)this.value.update(t.values);else{const i=new Qt(e,t.processor,this.options),s=i._clone();i.update(t.values),this._commitNode(s),this.value=i}}_commitIterable(t){Array.isArray(this.value)||(this.value=[],this.clear());const e=this.value;let i,s=0;for(const n of t)void 0===(i=e[s])&&(i=new ne(this.options),e.push(i),0===s?i.appendIntoPart(this):i.insertAfterPart(e[s-1])),i.setValue(n),i.commit(),s++;s<e.length&&(e.length=s,this.clear(i&&i.endNode))}clear(t=this.startNode){qt(this.startNode.parentNode,t.nextSibling,this.endNode)}}class re{constructor(t,e,i){if(this.value=void 0,this._pendingValue=void 0,2!==i.length||""!==i[0]||""!==i[1])throw new Error("Boolean attributes can only contain a single expression");this.element=t,this.name=e,this.strings=i}setValue(t){this._pendingValue=t}commit(){for(;Bt(this._pendingValue);){const t=this._pendingValue;this._pendingValue=Ut,t(this)}if(this._pendingValue===Ut)return;const t=!!this._pendingValue;this.value!==t&&(t?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name)),this.value=t,this._pendingValue=Ut}}class oe extends ie{constructor(t,e,i){super(t,e,i),this.single=2===i.length&&""===i[0]&&""===i[1]}_createPart(){return new ae(this)}_getValue(){return this.single?this.parts[0].value:super._getValue()}commit(){this.dirty&&(this.dirty=!1,this.element[this.name]=this._getValue())}}class ae extends se{}let ce=!1;try{const t={get capture(){return ce=!0,!1}};window.addEventListener("test",t,t),window.removeEventListener("test",t,t)}catch(t){}class he{constructor(t,e,i){this.value=void 0,this._pendingValue=void 0,this.element=t,this.eventName=e,this.eventContext=i,this._boundHandleEvent=(t=>this.handleEvent(t))}setValue(t){this._pendingValue=t}commit(){for(;Bt(this._pendingValue);){const t=this._pendingValue;this._pendingValue=Ut,t(this)}if(this._pendingValue===Ut)return;const t=this._pendingValue,e=this.value,i=null==t||null!=e&&(t.capture!==e.capture||t.once!==e.once||t.passive!==e.passive),s=null!=t&&(null==e||i);i&&this.element.removeEventListener(this.eventName,this._boundHandleEvent,this._options),s&&(this._options=le(t),this.element.addEventListener(this.eventName,this._boundHandleEvent,this._options)),this.value=t,this._pendingValue=Ut}handleEvent(t){"function"==typeof this.value?this.value.call(this.eventContext||this.element,t):this.value.handleEvent(t)}}const le=t=>t&&(ce?{capture:t.capture,passive:t.passive,once:t.once}:t.capture);const de=new class{handleAttributeExpressions(t,e,i,s){const n=e[0];return"."===n?new oe(t,e.slice(1),i).parts:"@"===n?[new he(t,e.slice(1),s.eventContext)]:"?"===n?[new re(t,e.slice(1),i)]:new ie(t,e,i).parts}handleTextExpression(t){return new ne(t)}};function ue(t){let e=pe.get(t.type);void 0===e&&(e={stringsArray:new WeakMap,keyString:new Map},pe.set(t.type,e));let i=e.stringsArray.get(t.strings);if(void 0!==i)return i;const s=t.strings.join(Xt);return void 0===(i=e.keyString.get(s))&&(i=new Yt(t,t.getTemplateElement()),e.keyString.set(s,i)),e.stringsArray.set(t.strings,i),i}const pe=new Map,fe=new WeakMap;(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.0.0");const ye=(t,...e)=>new te(t,e,"html",de),be=133;function ge(t,e){const{element:{content:i},parts:s}=t,n=document.createTreeWalker(i,be,null,!1);let r=ve(s),o=s[r],a=-1,c=0;const h=[];let l=null;for(;n.nextNode();){a++;const t=n.currentNode;for(t.previousSibling===l&&(l=null),e.has(t)&&(h.push(t),null===l&&(l=t)),null!==l&&c++;void 0!==o&&o.index===a;)o.index=null!==l?-1:o.index-c,o=s[r=ve(s,r)]}h.forEach(t=>t.parentNode.removeChild(t))}const me=t=>{let e=11===t.nodeType?0:1;const i=document.createTreeWalker(t,be,null,!1);for(;i.nextNode();)e++;return e},ve=(t,e=-1)=>{for(let i=e+1;i<t.length;i++){const e=t[i];if(Jt(e))return i}return-1};const we=(t,e)=>`${t}--${e}`;let xe=!0;void 0===window.ShadyCSS?xe=!1:void 0===window.ShadyCSS.prepareTemplateDom&&(console.warn("Incompatible ShadyCSS version detected.Please update to at least @webcomponents/webcomponentsjs@2.0.2 and@webcomponents/shadycss@1.3.1."),xe=!1);const ke=t=>e=>{const i=we(e.type,t);let s=pe.get(i);void 0===s&&(s={stringsArray:new WeakMap,keyString:new Map},pe.set(i,s));let n=s.stringsArray.get(e.strings);if(void 0!==n)return n;const r=e.strings.join(Xt);if(void 0===(n=s.keyString.get(r))){const i=e.getTemplateElement();xe&&window.ShadyCSS.prepareTemplateDom(i,t),n=new Yt(e,i),s.keyString.set(r,n)}return s.stringsArray.set(e.strings,n),n},Se=["html","svg"],_e=new Set,Ce=(t,e,i)=>{_e.add(i);const s=t.querySelectorAll("style");if(0===s.length)return void window.ShadyCSS.prepareTemplateStyles(e.element,i);const n=document.createElement("style");for(let t=0;t<s.length;t++){const e=s[t];e.parentNode.removeChild(e),n.textContent+=e.textContent}if((t=>{Se.forEach(e=>{const i=pe.get(we(e,t));void 0!==i&&i.keyString.forEach(t=>{const{element:{content:e}}=t,i=new Set;Array.from(e.querySelectorAll("style")).forEach(t=>{i.add(t)}),ge(t,i)})})})(i),function(t,e,i=null){const{element:{content:s},parts:n}=t;if(null==i)return void s.appendChild(e);const r=document.createTreeWalker(s,be,null,!1);let o=ve(n),a=0,c=-1;for(;r.nextNode();)for(c++,r.currentNode===i&&(a=me(e),i.parentNode.insertBefore(e,i));-1!==o&&n[o].index===c;){if(a>0){for(;-1!==o;)n[o].index+=a,o=ve(n,o);return}o=ve(n,o)}}(e,n,e.element.content.firstChild),window.ShadyCSS.prepareTemplateStyles(e.element,i),window.ShadyCSS.nativeShadow){const i=e.element.content.querySelector("style");t.insertBefore(i.cloneNode(!0),t.firstChild)}else{e.element.content.insertBefore(n,e.element.content.firstChild);const t=new Set;t.add(n),ge(e,t)}};window.JSCompiler_renameProperty=((t,e)=>t);const Ee={toAttribute(t,e){switch(e){case Boolean:return t?"":null;case Object:case Array:return null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){switch(e){case Boolean:return null!==t;case Number:return null===t?null:Number(t);case Object:case Array:return JSON.parse(t)}return t}},Ne=(t,e)=>e!==t&&(e==e||t==t),Re={attribute:!0,type:String,converter:Ee,reflect:!1,hasChanged:Ne},Oe=Promise.resolve(!0),Pe=1,Me=4,je=8,Te=16,Ae=32;class $e extends HTMLElement{constructor(){super(),this._updateState=0,this._instanceProperties=void 0,this._updatePromise=Oe,this._hasConnectedResolver=void 0,this._changedProperties=new Map,this._reflectingProperties=void 0,this.initialize()}static get observedAttributes(){this.finalize();const t=[];return this._classProperties.forEach((e,i)=>{const s=this._attributeNameForProperty(i,e);void 0!==s&&(this._attributeToPropertyMap.set(s,i),t.push(s))}),t}static _ensureClassProperties(){if(!this.hasOwnProperty(JSCompiler_renameProperty("_classProperties",this))){this._classProperties=new Map;const t=Object.getPrototypeOf(this)._classProperties;void 0!==t&&t.forEach((t,e)=>this._classProperties.set(e,t))}}static createProperty(t,e=Re){if(this._ensureClassProperties(),this._classProperties.set(t,e),e.noAccessor||this.prototype.hasOwnProperty(t))return;const i="symbol"==typeof t?Symbol():`__${t}`;Object.defineProperty(this.prototype,t,{get(){return this[i]},set(e){const s=this[t];this[i]=e,this._requestUpdate(t,s)},configurable:!0,enumerable:!0})}static finalize(){if(this.hasOwnProperty(JSCompiler_renameProperty("finalized",this))&&this.finalized)return;const t=Object.getPrototypeOf(this);if("function"==typeof t.finalize&&t.finalize(),this.finalized=!0,this._ensureClassProperties(),this._attributeToPropertyMap=new Map,this.hasOwnProperty(JSCompiler_renameProperty("properties",this))){const t=this.properties,e=[...Object.getOwnPropertyNames(t),..."function"==typeof Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t):[]];for(const i of e)this.createProperty(i,t[i])}}static _attributeNameForProperty(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}static _valueHasChanged(t,e,i=Ne){return i(t,e)}static _propertyValueFromAttribute(t,e){const i=e.type,s=e.converter||Ee,n="function"==typeof s?s:s.fromAttribute;return n?n(t,i):t}static _propertyValueToAttribute(t,e){if(void 0===e.reflect)return;const i=e.type,s=e.converter;return(s&&s.toAttribute||Ee.toAttribute)(t,i)}initialize(){this._saveInstanceProperties(),this._requestUpdate()}_saveInstanceProperties(){this.constructor._classProperties.forEach((t,e)=>{if(this.hasOwnProperty(e)){const t=this[e];delete this[e],this._instanceProperties||(this._instanceProperties=new Map),this._instanceProperties.set(e,t)}})}_applyInstanceProperties(){this._instanceProperties.forEach((t,e)=>this[e]=t),this._instanceProperties=void 0}connectedCallback(){this._updateState=this._updateState|Ae,this._hasConnectedResolver&&(this._hasConnectedResolver(),this._hasConnectedResolver=void 0)}disconnectedCallback(){}attributeChangedCallback(t,e,i){e!==i&&this._attributeToProperty(t,i)}_propertyToAttribute(t,e,i=Re){const s=this.constructor,n=s._attributeNameForProperty(t,i);if(void 0!==n){const t=s._propertyValueToAttribute(e,i);if(void 0===t)return;this._updateState=this._updateState|je,null==t?this.removeAttribute(n):this.setAttribute(n,t),this._updateState=this._updateState&~je}}_attributeToProperty(t,e){if(this._updateState&je)return;const i=this.constructor,s=i._attributeToPropertyMap.get(t);if(void 0!==s){const t=i._classProperties.get(s)||Re;this._updateState=this._updateState|Te,this[s]=i._propertyValueFromAttribute(e,t),this._updateState=this._updateState&~Te}}_requestUpdate(t,e){let i=!0;if(void 0!==t){const s=this.constructor,n=s._classProperties.get(t)||Re;s._valueHasChanged(this[t],e,n.hasChanged)?(this._changedProperties.has(t)||this._changedProperties.set(t,e),!0!==n.reflect||this._updateState&Te||(void 0===this._reflectingProperties&&(this._reflectingProperties=new Map),this._reflectingProperties.set(t,n))):i=!1}!this._hasRequestedUpdate&&i&&this._enqueueUpdate()}requestUpdate(t,e){return this._requestUpdate(t,e),this.updateComplete}async _enqueueUpdate(){let t,e;this._updateState=this._updateState|Me;const i=this._updatePromise;this._updatePromise=new Promise((i,s)=>{t=i,e=s});try{await i}catch(t){}this._hasConnected||await new Promise(t=>this._hasConnectedResolver=t);try{const t=this.performUpdate();null!=t&&await t}catch(t){e(t)}t(!this._hasRequestedUpdate)}get _hasConnected(){return this._updateState&Ae}get _hasRequestedUpdate(){return this._updateState&Me}get hasUpdated(){return this._updateState&Pe}performUpdate(){this._instanceProperties&&this._applyInstanceProperties();let t=!1;const e=this._changedProperties;try{(t=this.shouldUpdate(e))&&this.update(e)}catch(e){throw t=!1,e}finally{this._markUpdated()}t&&(this._updateState&Pe||(this._updateState=this._updateState|Pe,this.firstUpdated(e)),this.updated(e))}_markUpdated(){this._changedProperties=new Map,this._updateState=this._updateState&~Me}get updateComplete(){return this._updatePromise}shouldUpdate(t){return!0}update(t){void 0!==this._reflectingProperties&&this._reflectingProperties.size>0&&(this._reflectingProperties.forEach((t,e)=>this._propertyToAttribute(e,this[e],t)),this._reflectingProperties=void 0)}updated(t){}firstUpdated(t){}}$e.finalized=!0;const Le=t=>e=>"function"==typeof e?((t,e)=>(window.customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:i,elements:s}=e;return{kind:i,elements:s,finisher(e){window.customElements.define(t,e)}}})(t,e),Ie=(t,e)=>"method"!==e.kind||!e.descriptor||"value"in e.descriptor?{kind:"field",key:Symbol(),placement:"own",descriptor:{},initializer(){"function"==typeof e.initializer&&(this[e.key]=e.initializer.call(this))},finisher(i){i.createProperty(e.key,t)}}:Object.assign({},e,{finisher(i){i.createProperty(e.key,t)}}),De=(t,e,i)=>{e.constructor.createProperty(i,t)};function Ve(t){return(e,i)=>void 0!==i?De(t,e,i):Ie(t,e)}function Be(t){return(e,i)=>{const s={get(){return this.renderRoot.querySelector(t)},enumerable:!0,configurable:!0};return void 0!==i?ze(s,e,i):qe(s,e)}}const ze=(t,e,i)=>{Object.defineProperty(e,i,t)},qe=(t,e)=>({kind:"method",placement:"prototype",key:e.key,descriptor:t}),Ue="adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,He=Symbol();class Xe{constructor(t,e){if(e!==He)throw new Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t}get styleSheet(){return void 0===this._styleSheet&&(Ue?(this._styleSheet=new CSSStyleSheet,this._styleSheet.replaceSync(this.cssText)):this._styleSheet=null),this._styleSheet}toString(){return this.cssText}}const Fe=(t,...e)=>{const i=e.reduce((e,i,s)=>e+(t=>{if(t instanceof Xe)return t.cssText;throw new Error(`Value passed to 'css' function must be a 'css' function result: ${t}. Use 'unsafeCSS' to pass non-literal values, but\n take care to ensure page security.`)})(i)+t[s+1],t[0]);return new Xe(i,He)};(window.litElementVersions||(window.litElementVersions=[])).push("2.0.1");const We=t=>t.flat?t.flat(1/0):function t(e,i=[]){for(let s=0,n=e.length;s<n;s++){const n=e[s];Array.isArray(n)?t(n,i):i.push(n)}return i}(t);class Ge extends $e{static finalize(){super.finalize(),this._styles=this.hasOwnProperty(JSCompiler_renameProperty("styles",this))?this._getUniqueStyles():this._styles||[]}static _getUniqueStyles(){const t=this.styles,e=[];if(Array.isArray(t)){We(t).reduceRight((t,e)=>(t.add(e),t),new Set).forEach(t=>e.unshift(t))}else t&&e.push(t);return e}initialize(){super.initialize(),this.renderRoot=this.createRenderRoot(),window.ShadowRoot&&this.renderRoot instanceof window.ShadowRoot&&this.adoptStyles()}createRenderRoot(){return this.attachShadow({mode:"open"})}adoptStyles(){const t=this.constructor._styles;0!==t.length&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow?Ue?this.renderRoot.adoptedStyleSheets=t.map(t=>t.styleSheet):this._needsShimAdoptedStyleSheets=!0:window.ShadyCSS.ScopingShim.prepareAdoptedCssText(t.map(t=>t.cssText),this.localName))}connectedCallback(){super.connectedCallback(),this.hasUpdated&&void 0!==window.ShadyCSS&&window.ShadyCSS.styleElement(this)}update(t){super.update(t);const e=this.render();e instanceof te&&this.constructor.render(e,this.renderRoot,{scopeName:this.localName,eventContext:this}),this._needsShimAdoptedStyleSheets&&(this._needsShimAdoptedStyleSheets=!1,this.constructor._styles.forEach(t=>{const e=document.createElement("style");e.textContent=t.cssText,this.renderRoot.appendChild(e)}))}render(){}}Ge.finalized=!0,Ge.render=((t,e,i)=>{const s=i.scopeName,n=fe.has(e),r=e instanceof ShadowRoot&&xe&&t instanceof te,o=r&&!_e.has(s),a=o?document.createDocumentFragment():e;if(((t,e,i)=>{let s=fe.get(e);void 0===s&&(qt(e,e.firstChild),fe.set(e,s=new ne(Object.assign({templateFactory:ue},i))),s.appendInto(e)),s.setValue(t),s.commit()})(t,a,Object.assign({templateFactory:ke(s)},i)),o){const t=fe.get(a);fe.delete(a),t.value instanceof Qt&&Ce(a,t.value.template,s),qt(e,e.firstChild),e.appendChild(a),fe.set(e,t)}!n&&r&&window.ShadyCSS.styleElement(e.host)});class Ye extends Ge{fireEvent(t,e,i=!0,s=!0){if(t){const n={bubbles:"boolean"!=typeof i||i,composed:"boolean"!=typeof s||s};e&&(n.detail=e);const r=window.SlickCustomEvent||CustomEvent;this.dispatchEvent(new r(t,n))}}}class Je{constructor(t,e){this.xi=Number.MAX_VALUE,this.yi=Number.MAX_VALUE,this.px1=t[0],this.py1=t[1],this.px2=e[0],this.py2=e[1],this.a=this.py2-this.py1,this.b=this.px1-this.px2,this.c=this.px2*this.py1-this.px1*this.py2,this._undefined=0===this.a&&0===this.b&&0===this.c}isUndefined(){return this._undefined}intersects(t){if(this.isUndefined()||t.isUndefined())return!1;let e=Number.MAX_VALUE,i=Number.MAX_VALUE,s=0,n=0;const r=this.a,o=this.b,a=this.c;return Math.abs(o)>1e-5&&(e=-r/o,s=-a/o),Math.abs(t.b)>1e-5&&(i=-t.a/t.b,n=-t.c/t.b),e===Number.MAX_VALUE?i===Number.MAX_VALUE?-a/r==-t.c/t.a&&(this.py1>=Math.min(t.py1,t.py2)&&this.py1<=Math.max(t.py1,t.py2)?(this.xi=this.px1,this.yi=this.py1,!0):this.py2>=Math.min(t.py1,t.py2)&&this.py2<=Math.max(t.py1,t.py2)&&(this.xi=this.px2,this.yi=this.py2,!0)):(this.xi=this.px1,this.yi=i*this.xi+n,!((this.py1-this.yi)*(this.yi-this.py2)<-1e-5||(t.py1-this.yi)*(this.yi-t.py2)<-1e-5)&&(!(Math.abs(t.a)<1e-5)||!((t.px1-this.xi)*(this.xi-t.px2)<-1e-5))):i===Number.MAX_VALUE?(this.xi=t.px1,this.yi=e*this.xi+s,!((t.py1-this.yi)*(this.yi-t.py2)<-1e-5||(this.py1-this.yi)*(this.yi-this.py2)<-1e-5)&&(!(Math.abs(r)<1e-5)||!((this.px1-this.xi)*(this.xi-this.px2)<-1e-5))):e===i?s===n&&(this.px1>=Math.min(t.px1,t.px2)&&this.px1<=Math.max(t.py1,t.py2)?(this.xi=this.px1,this.yi=this.py1,!0):this.px2>=Math.min(t.px1,t.px2)&&this.px2<=Math.max(t.px1,t.px2)&&(this.xi=this.px2,this.yi=this.py2,!0)):(this.xi=(n-s)/(e-i),this.yi=e*this.xi+s,!((this.px1-this.xi)*(this.xi-this.px2)<-1e-5||(t.px1-this.xi)*(this.xi-t.px2)<-1e-5))}}class Ke{constructor(t,e,i,s,n,r,o,a){this.deltaX=0,this.hGap=0,this.top=t,this.bottom=e,this.left=i,this.right=s,this.gap=n,this.sinAngle=r,this.tanAngle=a,Math.abs(r)<1e-4?this.pos=i+n:Math.abs(r)>.9999?this.pos=t+n:(this.deltaX=(e-t)*Math.abs(a),this.pos=i-Math.abs(this.deltaX),this.hGap=Math.abs(n/o),this.sLeft=new Je([i,e],[i,t]),this.sRight=new Je([s,e],[s,t]))}nextLine(){if(Math.abs(this.sinAngle)<1e-4){if(this.pos<this.right){const t=[this.pos,this.top,this.pos,this.bottom];return this.pos+=this.gap,t}}else if(Math.abs(this.sinAngle)>.9999){if(this.pos<this.bottom){const t=[this.left,this.pos,this.right,this.pos];return this.pos+=this.gap,t}}else{let t=this.pos-this.deltaX/2,e=this.pos+this.deltaX/2,i=this.bottom,s=this.top;if(this.pos<this.right+this.deltaX){for(;t<this.left&&e<this.left||t>this.right&&e>this.right;)if(this.pos+=this.hGap,t=this.pos-this.deltaX/2,e=this.pos+this.deltaX/2,this.pos>this.right+this.deltaX)return null;const n=new Je([t,i],[e,s]);this.sLeft&&n.intersects(this.sLeft)&&(t=n.xi,i=n.yi),this.sRight&&n.intersects(this.sRight)&&(e=n.xi,s=n.yi),this.tanAngle>0&&(t=this.right-(t-this.left),e=this.right-(e-this.left));const r=[t,i,e,s];return this.pos+=this.hGap,r}}return null}}function Ze(t,e){const i=[],s=new Je([t[0],t[1]],[t[2],t[3]]);for(let t=0;t<e.length;t++){const n=new Je(e[t],e[(t+1)%e.length]);s.intersects(n)&&i.push([s.xi,s.yi])}return i}function Qe(t,e,i,s,n,r,o){return[-i*r-s*n+i+r*t+n*e,o*(i*n-s*r)+s+-o*n*t+o*r*e]}const ti=2,ei=1,ii=.85,si=0,ni=9;class ri{constructor(){this.p=""}get value(){return this.p.trim()}moveTo(t,e){this.p=`${this.p}M ${t} ${e} `}bcurveTo(t,e,i,s,n,r){this.p=`${this.p}C ${t} ${e}, ${i} ${s}, ${n} ${r} `}}function oi(t,e){const i=document.createElementNS("http://www.w3.org/2000/svg",t);if(e)for(const t in e)i.setAttributeNS(null,t,e[t]);return i}function ai(t,e){return ei*(Math.random()*(e-t)+t)}function ci(t,e,i,s,n){const r=Math.pow(t-i,2)+Math.pow(e-s,2);let o=ti;o*o*100>r&&(o=Math.sqrt(r)/10);const a=o/2,c=.2+.2*Math.random();let h=ii*ti*(s-e)/200,l=ii*ti*(t-i)/200;h=ai(-h,h),l=ai(-l,l);const d=n||new ri;return d.moveTo(t+ai(-o,o),e+ai(-o,o)),d.bcurveTo(h+t+(i-t)*c+ai(-o,o),l+e+(s-e)*c+ai(-o,o),h+t+2*(i-t)*c+ai(-o,o),l+e+2*(s-e)*c+ai(-o,o),i+ai(-o,o),s+ai(-o,o)),d.moveTo(t+ai(-a,a),e+ai(-a,a)),d.bcurveTo(h+t+(i-t)*c+ai(-a,a),l+e+(s-e)*c+ai(-a,a),h+t+2*(i-t)*c+ai(-a,a),l+e+2*(s-e)*c+ai(-a,a),i+ai(-a,a),s+ai(-a,a)),d}function hi(t,e,i,s,n=!1,r=!1,o){o=o||new ri;const a=Math.pow(t-i,2)+Math.pow(e-s,2);let c=ti;c*c*100>a&&(c=Math.sqrt(a)/10);const h=c/2,l=.2+.2*Math.random();let d=ii*ti*(s-e)/200,u=ii*ti*(t-i)/200;return d=ai(-d,d),u=ai(-u,u),n&&o.moveTo(t+ai(-c,c),e+ai(-c,c)),r?o.bcurveTo(d+t+(i-t)*l+ai(-h,h),u+e+(s-e)*l+ai(-h,h),d+t+2*(i-t)*l+ai(-h,h),u+e+2*(s-e)*l+ai(-h,h),i+ai(-h,h),s+ai(-h,h)):o.bcurveTo(d+t+(i-t)*l+ai(-c,c),u+e+(s-e)*l+ai(-c,c),d+t+2*(i-t)*l+ai(-c,c),u+e+2*(s-e)*l+ai(-c,c),i+ai(-c,c),s+ai(-c,c)),o}function li(t,e,i,s,n,r,o,a){const c=ai(-.5,.5)-Math.PI/2,h=[];h.push([ai(-r,r)+e+.9*s*Math.cos(c-t),ai(-r,r)+i+.9*n*Math.sin(c-t)]);for(let o=c;o<2*Math.PI+c-.01;o+=t)h.push([ai(-r,r)+e+s*Math.cos(o),ai(-r,r)+i+n*Math.sin(o)]);return h.push([ai(-r,r)+e+s*Math.cos(c+2*Math.PI+.5*o),ai(-r,r)+i+n*Math.sin(c+2*Math.PI+.5*o)]),h.push([ai(-r,r)+e+.98*s*Math.cos(c+o),ai(-r,r)+i+.98*n*Math.sin(c+o)]),h.push([ai(-r,r)+e+.9*s*Math.cos(c+.5*o),ai(-r,r)+i+.9*n*Math.sin(c+.5*o)]),function(t,e){const i=t.length;let s=e||new ri;if(i>3){const e=[],n=1-si;s.moveTo(t[1][0],t[1][1]);for(let r=1;r+2<i;r++){const i=t[r];e[0]=[i[0],i[1]],e[1]=[i[0]+(n*t[r+1][0]-n*t[r-1][0])/6,i[1]+(n*t[r+1][1]-n*t[r-1][1])/6],e[2]=[t[r+1][0]+(n*t[r][0]-n*t[r+2][0])/6,t[r+1][1]+(n*t[r][1]-n*t[r+2][1])/6],e[3]=[t[r+1][0],t[r+1][1]],s.bcurveTo(e[1][0],e[1][1],e[2][0],e[2][1],e[3][0],e[3][1])}}else 3===i?(s.moveTo(t[0][0],t[0][1]),s.bcurveTo(t[1][0],t[1][1],t[2][0],t[2][1],t[2][0],t[2][1])):2===i&&(s=ci(t[0][0],t[0][1],t[1][0],t[1][1],s));return s}(h,a)}function di(t,e,i,s,n){const r=oi("path",{d:ci(e,i,s,n).value});return t.appendChild(r),r}function ui(t,e,i,s,n){n-=4;let r=ci(e+=2,i+=2,e+(s-=4),i);r=ci(e+s,i,e+s,i+n,r),r=ci(e+s,i+n,e,i+n,r);const o=oi("path",{d:(r=ci(e,i+n,e,i,r)).value});return t.appendChild(o),o}function pi(t,e){let i;const s=e.length;if(s>2)for(let t=0;t<2;t++){let n=!0;for(let t=1;t<s;t++)i=hi(e[t-1][0],e[t-1][1],e[t][0],e[t][1],n,t>0,i),n=!1;i=hi(e[s-1][0],e[s-1][1],e[0][0],e[0][1],n,t>0,i)}else i=2===s?ci(e[0][0],e[0][1],e[1][0],e[1][1]):new ri;const n=oi("path",{d:i.value});return t.appendChild(n),n}function fi(t,e,i,s,n){s=Math.max(s>10?s-4:s-1,1),n=Math.max(n>10?n-4:n-1,1);const r=2*Math.PI/ni;let o=Math.abs(s/2),a=Math.abs(n/2),c=li(r,e,i,o+=ai(.05*-o,.05*o),a+=ai(.05*-a,.05*a),1,r*ai(.1,ai(.4,1)));const h=oi("path",{d:(c=li(r,e,i,o,a,1.5,0,c)).value});return t.appendChild(h),h}function yi(t){const e=oi("g");let i=null;return t.forEach(t=>{di(e,t[0][0],t[0][1],t[1][0],t[1][1]),i&&di(e,i[0],i[1],t[0][0],t[0][1]),i=t[1]}),e}const bi={bowing:ii,curveStepCount:ni,curveTightness:si,dashGap:0,dashOffset:0,fill:"#000",fillStyle:"hachure",fillWeight:1,hachureAngle:-41,hachureGap:5,maxRandomnessOffset:ti,roughness:ei,simplification:1,stroke:"#000",strokeWidth:2,zigzagOffset:0};function gi(t){return yi(function(t,e){const i=[];if(t&&t.length){let s=t[0][0],n=t[0][0],r=t[0][1],o=t[0][1];for(let e=1;e<t.length;e++)s=Math.min(s,t[e][0]),n=Math.max(n,t[e][0]),r=Math.min(r,t[e][1]),o=Math.max(o,t[e][1]);const a=e.hachureAngle;let c=e.hachureGap;c<0&&(c=4*e.strokeWidth),c=Math.max(c,.1);const h=a%180*(Math.PI/180),l=Math.cos(h),d=Math.sin(h),u=Math.tan(h),p=new Ke(r-1,o+1,s-1,n+1,c,d,l,u);let f;for(;null!=(f=p.nextLine());){const e=Ze(f,t);for(let t=0;t<e.length;t++)if(t<e.length-1){const s=e[t],n=e[t+1];i.push([s,n])}}}return i}(t,bi))}function mi(t,e,i,s){return yi(function(t,e,i,s,n,r){const o=[];let a=Math.abs(s/2),c=Math.abs(n/2);a+=t.randOffset(.05*a,r),c+=t.randOffset(.05*c,r);const h=r.hachureAngle;let l=r.hachureGap;l<=0&&(l=4*r.strokeWidth);let d=r.fillWeight;d<0&&(d=r.strokeWidth/2);const u=h%180*(Math.PI/180),p=Math.tan(u),f=c/a,y=Math.sqrt(f*p*f*p+1),b=f*p/y,g=1/y,m=l/(a*c/Math.sqrt(c*g*(c*g)+a*b*(a*b))/a);let v=Math.sqrt(a*a-(e-a+m)*(e-a+m));for(let t=e-a+m;t<e+a;t+=m){const s=Qe(t,i-(v=Math.sqrt(a*a-(e-t)*(e-t))),e,i,b,g,f),n=Qe(t,i+v,e,i,b,g,f);o.push([s,n])}return o}({randOffset:(t,e)=>ai(-t,t)},t,e,i,s,bi))}var vi=function(t,e,i,s){var n,r=arguments.length,o=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,s);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(o=(r<3?n(o):r>3?n(e,i,o):n(e,i))||o);return r>3&&o&&Object.defineProperty(e,i,o),o},wi=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let xi=class extends Ye{constructor(){super(...arguments),this.elevation=1,this.disabled=!1}static get styles(){return Fe`
:host {
display: inline-block;
font-family: inherit;
cursor: pointer;
padding: 8px 10px;
position: relative;
text-align: center;
-moz-user-select: none;
-ms-user-select: none;
-webkit-user-select: none;
user-select: none;
justify-content: center;
flex-direction: column;
text-align: center;
display: inline-flex;
outline: none;
letter-spacing: 1.25px;
font-size: 14px;
text-transform: uppercase;
opacity: 0;
}
:host(.wired-rendered) {
opacity: 1;
}
:host(:active) path {
transform: scale(0.97) translate(1.5%, 1.5%);
}
:host(.wired-disabled) {
opacity: 0.6 !important;
background: rgba(0, 0, 0, 0.07);
cursor: default;
pointer-events: none;
}
:host(:focus) path {
stroke-width: 1.5;
}
.overlay {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
pointer-events: none;
}
svg {
display: block;
}
path {
stroke: currentColor;
stroke-width: 0.7;
fill: transparent;
transition: transform 0.05s ease;
}
`}render(){return ye`
<slot></slot>
<div class="overlay">
<svg id="svg"></svg>
</div>
`}firstUpdated(){this.addEventListener("keydown",t=>{13!==t.keyCode&&32!==t.keyCode||(t.preventDefault(),this.click())}),this.setAttribute("role","button"),this.setAttribute("aria-label",this.textContent||this.innerText),setTimeout(()=>this.requestUpdate())}updated(t){t.has("disabled")&&this.refreshDisabledState();const e=this.shadowRoot.getElementById("svg");for(;e.hasChildNodes();)e.removeChild(e.lastChild);const i=this.getBoundingClientRect(),s=Math.min(Math.max(1,this.elevation),5),n=i.width+2*(s-1),r=i.height+2*(s-1);e.setAttribute("width",`${n}`),e.setAttribute("height",`${r}`),ui(e,0,0,i.width,i.height);for(let t=1;t<s;t++)di(e,2*t,i.height+2*t,i.width+2*t,i.height+2*t).style.opacity=`${(75-10*t)/100}`,di(e,i.width+2*t,i.height+2*t,i.width+2*t,2*t).style.opacity=`${(75-10*t)/100}`,di(e,2*t,i.height+2*t,i.width+2*t,i.height+2*t).style.opacity=`${(75-10*t)/100}`,di(e,i.width+2*t,i.height+2*t,i.width+2*t,2*t).style.opacity=`${(75-10*t)/100}`;this.classList.add("wired-rendered")}refreshDisabledState(){this.disabled?this.classList.add("wired-disabled"):this.classList.remove("wired-disabled"),this.tabIndex=this.disabled?-1:+(this.getAttribute("tabindex")||0)}};vi([Ve({type:Number}),wi("design:type",Object)],xi.prototype,"elevation",void 0),vi([Ve({type:Boolean,reflect:!0}),wi("design:type",Object)],xi.prototype,"disabled",void 0),xi=vi([Le("wired-button")],xi);var ki=function(t,e,i,s){var n,r=arguments.length,o=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,s);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(o=(r<3?n(o):r>3?n(e,i,o):n(e,i))||o);return r>3&&o&&Object.defineProperty(e,i,o),o},Si=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let _i=class extends Ye{constructor(){super(...arguments),this.elevation=1}static get styles(){return Fe`
:host {
display: inline-block;
position: relative;
padding: 10px;
opacity: 0;
}
:host(.wired-rendered) {
opacity: 1;
}
.overlay {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
pointer-events: none;
}
svg {
display: block;
}
path {
stroke: currentColor;
stroke-width: 0.7;
fill: transparent;
}
`}render(){return ye`
<div>
<slot @slotchange="${()=>this.requestUpdate()}"></slot>
</div>
<div class="overlay">
<svg id="svg"></svg>
</div>
`}connectedCallback(){super.connectedCallback(),this.resizeHandler||(this.resizeHandler=this.debounce(this.updated.bind(this),200,!1,this),window.addEventListener("resize",this.resizeHandler)),setTimeout(()=>this.updated())}disconnectedCallback(){super.disconnectedCallback&&super.disconnectedCallback(),this.resizeHandler&&(window.removeEventListener("resize",this.resizeHandler),delete this.resizeHandler)}debounce(t,e,i,s){let n=0;return()=>{const r=arguments,o=i&&!n;clearTimeout(n),n=window.setTimeout(()=>{n=0,i||t.apply(s,r)},e),o&&t.apply(s,r)}}updated(){const t=this.shadowRoot.getElementById("svg");for(;t.hasChildNodes();)t.removeChild(t.lastChild);const e=this.getBoundingClientRect(),i=Math.min(Math.max(1,this.elevation),5),s=e.width+2*(i-1),n=e.height+2*(i-1);t.setAttribute("width",`${s}`),t.setAttribute("height",`${n}`),ui(t,2,2,e.width-4,e.height-4);for(let s=1;s<i;s++)di(t,2*s,e.height-4+2*s,e.width-4+2*s,e.height-4+2*s).style.opacity=`${(85-10*s)/100}`,di(t,e.width-4+2*s,e.height-4+2*s,e.width-4+2*s,2*s).style.opacity=`${(85-10*s)/100}`,di(t,2*s,e.height-4+2*s,e.width-4+2*s,e.height-4+2*s).style.opacity=`${(85-10*s)/100}`,di(t,e.width-4+2*s,e.height-4+2*s,e.width-4+2*s,2*s).style.opacity=`${(85-10*s)/100}`;this.classList.add("wired-rendered")}};ki([Ve({type:Number}),Si("design:type",Object)],_i.prototype,"elevation",void 0),_i=ki([Le("wired-card")],_i);var Ci=function(t,e,i,s){var n,r=arguments.length,o=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,s);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(o=(r<3?n(o):r>3?n(e,i,o):n(e,i))||o);return r>3&&o&&Object.defineProperty(e,i,o),o},Ei=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let Ni=class extends Ye{constructor(){super(...arguments),this.checked=!1,this.disabled=!1}static get styles(){return Fe`
:host {
display: block;
font-family: inherit;
outline: none;
opacity: 0;
}
:host(.wired-disabled) {
opacity: 0.6 !important;
cursor: default;
pointer-events: none;
}
:host(.wired-disabled) svg {
background: rgba(0, 0, 0, 0.07);
}
:host(.wired-rendered) {
opacity: 1;
}
:host(:focus) path {
stroke-width: 1.5;
}
#container {
display: inline-block;
white-space: nowrap;
}
.inline {
display: inline-block;
vertical-align: middle;
-moz-user-select: none;
user-select: none;
}
#checkPanel {
cursor: pointer;
}
svg {
display: block;
}
path {
stroke: var(--wired-checkbox-icon-color, currentColor);
stroke-width: 0.7;
}
`}render(){return ye`
<div id="container" @click="${this.toggleCheck}">
<div id="checkPanel" class="inline">
<svg id="svg" width="0" height="0"></svg>
</div>
<div class="inline">
<slot></slot>
</div>
</div>
`}refreshDisabledState(){this.disabled?this.classList.add("wired-disabled"):this.classList.remove("wired-disabled"),this.tabIndex=this.disabled?-1:+(this.getAttribute("tabindex")||0)}toggleCheck(){this.checked=!this.checked,this.fireEvent("change",{checked:this.checked})}firstUpdated(){this.setAttribute("role","checkbox"),this.addEventListener("keydown",t=>{13!==t.keyCode&&32!==t.keyCode||(t.preventDefault(),this.toggleCheck())})}updated(t){t.has("disabled")&&this.refreshDisabledState();const e=this.shadowRoot.getElementById("svg");for(;e.hasChildNodes();)e.removeChild(e.lastChild);const i=24,s=24;e.setAttribute("width",`${i}`),e.setAttribute("height",`${s}`),ui(e,0,0,i,s);const n=[];n.push(di(e,.3*i,.4*s,.5*i,.7*s)),n.push(di(e,.5*i,.7*s,i+5,-5)),n.forEach(t=>{t.style.strokeWidth="2.5"}),this.checked?n.forEach(t=>{t.style.display=""}):n.forEach(t=>{t.style.display="none"}),this.classList.add("wired-rendered")}};Ci([Ve({type:Boolean}),Ei("design:type",Object)],Ni.prototype,"checked",void 0),Ci([Ve({type:Boolean,reflect:!0}),Ei("design:type",Object)],Ni.prototype,"disabled",void 0),Ni=Ci([Le("wired-checkbox")],Ni);var Ri=function(t,e,i,s){var n,r=arguments.length,o=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,s);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(o=(r<3?n(o):r>3?n(e,i,o):n(e,i))||o);return r>3&&o&&Object.defineProperty(e,i,o),o},Oi=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let Pi=class extends Ye{constructor(){super(...arguments),this.value="",this.name="",this.selected=!1}static get styles(){return Fe`
:host {
display: inline-block;
font-size: 14px;
text-align: left;
}
button {
cursor: pointer;
outline: none;
overflow: hidden;
color: inherit;
user-select: none;
position: relative;
font-family: inherit;
text-align: inherit;
font-size: inherit;
letter-spacing: 1.25px;
padding: 1px 10px;
min-height: 36px;
text-transform: inherit;
background: none;
border: none;
transition: background-color 0.3s ease, color 0.3s ease;
width: 100%;
box-sizing: border-box;
white-space: nowrap;
}
button.selected {
color: var(--wired-item-selected-color, #fff);
}
button::before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: currentColor;
opacity: 0;
}
button span {
display: inline-block;
transition: transform 0.2s ease;
position: relative;
}
button:active span {
transform: scale(1.02);
}
.overlay {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
pointer-events: none;
display: none;
}
button.selected .overlay {
display: block;
}
svg {
display: block;
}
path {
stroke: var(--wired-item-selected-bg, #000);
stroke-width: 2.75;
fill: transparent;
transition: transform 0.05s ease;
}
@media (hover: hover) {
button:hover::before {
opacity: 0.05;
}
}
`}render(){return ye`
<button class="${this.selected?"selected":""}">
<div class="overlay">
<svg></svg>
</div>
<span>
<slot></slot>
</span>
</button>`}firstUpdated(){this.selected&&setTimeout(()=>this.requestUpdate())}updated(){if(this.svg){for(;this.svg.hasChildNodes();)this.svg.removeChild(this.svg.lastChild);const t=this.getBoundingClientRect();this.svg.setAttribute("width",`${t.width}`),this.svg.setAttribute("height",`${t.height}`);const e=gi([[0,0],[t.width,0],[t.width,t.height],[0,t.height]]);this.svg.appendChild(e)}}};Ri([Ve(),Oi("design:type",Object)],Pi.prototype,"value",void 0),Ri([Ve(),Oi("design:type",Object)],Pi.prototype,"name",void 0),Ri([Ve({type:Boolean}),Oi("design:type",Object)],Pi.prototype,"selected",void 0),Ri([Be("svg"),Oi("design:type",SVGSVGElement)],Pi.prototype,"svg",void 0),Pi=Ri([Le("wired-item")],Pi);var Mi=function(t,e,i,s){var n,r=arguments.length,o=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,s);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(o=(r<3?n(o):r>3?n(e,i,o):n(e,i))||o);return r>3&&o&&Object.defineProperty(e,i,o),o},ji=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let Ti=class extends Ye{constructor(){super(...arguments),this.disabled=!1,this.cardShowing=!1,this.itemNodes=[]}static get styles(){return Fe`
:host {
display: inline-block;
font-family: inherit;
position: relative;
outline: none;
opacity: 0;
}
:host(.wired-disabled) {
opacity: 0.5 !important;
cursor: default;
pointer-events: none;
background: rgba(0, 0, 0, 0.02);
}
:host(.wired-rendered) {
opacity: 1;
}
:host(:focus) path {
stroke-width: 1.5;
}
#container {
white-space: nowrap;
position: relative;
}
.inline {
display: inline-block;
vertical-align: top
}
#textPanel {
min-width: 90px;
min-height: 18px;
padding: 8px;
}
#dropPanel {
width: 34px;
cursor: pointer;
}
.overlay {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
pointer-events: none;
}
svg {
display: block;
}
path {
stroke: currentColor;
stroke-width: 0.7;
fill: transparent;
}
#card {
position: absolute;
background: var(--wired-combo-popup-bg, white);
z-index: 1;
box-shadow: 1px 5px 15px -6px rgba(0, 0, 0, 0.8);
}
::slotted(wired-item) {
display: block;
}
`}render(){return ye`
<div id="container" @click="${this.onCombo}">
<div id="textPanel" class="inline">
<span>${this.value&&this.value.text}</span>
</div>
<div id="dropPanel" class="inline"></div>
<div class="overlay">
<svg id="svg"></svg>
</div>
</div>
<wired-card id="card" tabindex="-1" role="listbox" @mousedown="${this.onItemClick}" @touchstart="${this.onItemClick}"
style="display: none;">
<slot id="slot"></slot>
</wired-card>
`}refreshDisabledState(){this.disabled?this.classList.add("wired-disabled"):this.classList.remove("wired-disabled"),this.tabIndex=this.disabled?-1:+(this.getAttribute("tabindex")||0)}firstUpdated(){this.setAttribute("role","combobox"),this.setAttribute("aria-haspopup","listbox"),this.refreshSelection(),this.addEventListener("blur",()=>{this.cardShowing&&this.setCardShowing(!1)}),this.addEventListener("keydown",t=>{switch(t.keyCode){case 37:case 38:t.preventDefault(),this.selectPrevious();break;case 39:case 40:t.preventDefault(),this.selectNext();break;case 27:t.preventDefault(),this.cardShowing&&this.setCardShowing(!1);break;case 13:t.preventDefault(),this.setCardShowing(!this.cardShowing);break;case 32:t.preventDefault(),this.cardShowing||this.setCardShowing(!0)}})}updated(t){t.has("disabled")&&this.refreshDisabledState();const e=this.shadowRoot.getElementById("svg");for(;e.hasChildNodes();)e.removeChild(e.lastChild);const i=this.shadowRoot.getElementById("container").getBoundingClientRect();e.setAttribute("width",`${i.width}`),e.setAttribute("height",`${i.height}`);const s=this.shadowRoot.getElementById("textPanel").getBoundingClientRect();this.shadowRoot.getElementById("dropPanel").style.minHeight=s.height+"px",ui(e,0,0,s.width,s.height);const n=s.width-4;ui(e,n,0,34,s.height);const r=Math.max(0,Math.abs((s.height-24)/2)),o=pi(e,[[n+8,5+r],[n+26,5+r],[n+17,r+Math.min(s.height,18)]]);if(o.style.fill="currentColor",o.style.pointerEvents=this.disabled?"none":"auto",o.style.cursor="pointer",this.classList.add("wired-rendered"),this.setAttribute("aria-expanded",`${this.cardShowing}`),!this.itemNodes.length){this.itemNodes=[];const t=this.shadowRoot.getElementById("slot").assignedNodes();if(t&&t.length)for(let e=0;e<t.length;e++){const i=t[e];"WIRED-ITEM"===i.tagName&&(i.setAttribute("role","option"),this.itemNodes.push(i))}}}refreshSelection(){this.lastSelectedItem&&(this.lastSelectedItem.selected=!1,this.lastSelectedItem.removeAttribute("aria-selected"));const t=this.shadowRoot.getElementById("slot").assignedNodes();if(t){let e=null;for(let i=0;i<t.length;i++){const s=t[i];if("WIRED-ITEM"===s.tagName){const t=s.value||"";if(this.selected&&t===this.selected){e=s;break}}}this.lastSelectedItem=e||void 0,this.lastSelectedItem&&(this.lastSelectedItem.selected=!0,this.lastSelectedItem.setAttribute("aria-selected","true")),this.value=e?{value:e.value||"",text:e.textContent||""}:void 0}}setCardShowing(t){this.cardShowing=t;const e=this.shadowRoot.getElementById("card");e.style.display=t?"":"none",t&&setTimeout(()=>{e.requestUpdate(),this.shadowRoot.getElementById("slot").assignedNodes().filter(t=>t.nodeType===Node.ELEMENT_NODE).forEach(t=>{const e=t;e.requestUpdate&&e.requestUpdate()})},10),this.setAttribute("aria-expanded",`${this.cardShowing}`)}onItemClick(t){t.stopPropagation(),this.selected=t.target.value,this.refreshSelection(),this.fireSelected(),setTimeout(()=>{this.setCardShowing(!1)})}fireSelected(){this.fireEvent("selected",{selected:this.selected})}selectPrevious(){const t=this.itemNodes;if(t.length){let e=-1;for(let i=0;i<t.length;i++)if(t[i]===this.lastSelectedItem){e=i;break}e<0?e=0:0===e?e=t.length-1:e--,this.selected=t[e].value||"",this.refreshSelection(),this.fireSelected()}}selectNext(){const t=this.itemNodes;if(t.length){let e=-1;for(let i=0;i<t.length;i++)if(t[i]===this.lastSelectedItem){e=i;break}e<0?e=0:e>=t.length-1?e=0:e++,this.selected=t[e].value||"",this.refreshSelection(),this.fireSelected()}}onCombo(t){t.stopPropagation(),this.setCardShowing(!this.cardShowing)}};Mi([Ve({type:Object}),ji("design:type",Object)],Ti.prototype,"value",void 0),Mi([Ve({type:String}),ji("design:type",String)],Ti.prototype,"selected",void 0),Mi([Ve({type:Boolean,reflect:!0}),ji("design:type",Object)],Ti.prototype,"disabled",void 0),Ti=Mi([Le("wired-combo")],Ti),window.navigator.userAgent.match("Trident")&&(DOMTokenList.prototype.toggle=function(t,e){return void 0===e||e?this.add(t):this.remove(t),void 0===e||e});const Ai=Fe`:host{font-family:var(--mdc-icon-font, "Material Icons");font-weight:normal;font-style:normal;font-size:var(--mdc-icon-size, 24px);line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;-webkit-font-feature-settings:"liga";-webkit-font-smoothing:antialiased}`,$i=document.createElement("link");$i.rel="stylesheet",$i.href="https://fonts.googleapis.com/icon?family=Material+Icons",document.head.appendChild($i);var Li=function(t,e,i,s){var n,r=arguments.length,o=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,s);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(o=(r<3?n(o):r>3?n(e,i,o):n(e,i))||o);return r>3&&o&&Object.defineProperty(e,i,o),o};let Ii=class extends Ge{render(){return ye`<slot></slot>`}};Ii.styles=Ai,Ii=Li([Le("mwc-icon")],Ii);var Di=function(t,e,i,s){var n,r=arguments.length,o=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,s);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(o=(r<3?n(o):r>3?n(e,i,o):n(e,i))||o);return r>3&&o&&Object.defineProperty(e,i,o),o},Vi=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let Bi=class extends Ye{constructor(){super(...arguments),this.disabled=!1}static get styles(){return Fe`
:host {
display: -ms-inline-flexbox;
display: -webkit-inline-flex;
display: inline-flex;
-ms-flex-align: center;
-webkit-align-items: center;
align-items: center;
-ms-flex-pack: center;
-webkit-justify-content: center;
justify-content: center;
position: relative;
vertical-align: middle;
padding: 8px;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
cursor: pointer;
z-index: 0;
line-height: 1;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
-webkit-tap-highlight-color: transparent;
box-sizing: border-box !important;
outline: none;
opacity: 0;
}
:host(.wired-rendered) {
opacity: 1;
}
:host(.wired-disabled) {
opacity: 0.45 !important;
cursor: default;
background: rgba(0, 0, 0, 0.07);
border-radius: 50%;
pointer-events: none;
}
:host(:active) path {
transform: scale(0.96) translate(2%, 2%);
}
:host(:focus) path {
stroke-width: 1.5;
}
.overlay {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
pointer-events: none;
}
svg {
display: block;
}
path {
stroke: currentColor;
stroke-width: 0.7;
fill: var(--wired-icon-bg-color, transparent);
transition: transform 0.05s ease;
}
mwc-icon {
position: relative;
font-size: var(--wired-icon-size, 24px);
}
`}render(){return ye`
<div class="overlay">
<svg id="svg"></svg>
</div>
<mwc-icon>
<slot></slot>
</mwc-icon>
`}firstUpdated(){this.addEventListener("keydown",t=>{13!==t.keyCode&&32!==t.keyCode||(t.preventDefault(),this.click())}),this.setAttribute("role","button"),this.setAttribute("aria-label",this.textContent||this.innerText),setTimeout(()=>this.requestUpdate())}updated(t){t.has("disabled")&&this.refreshDisabledState();const e=this.shadowRoot.getElementById("svg");for(;e.hasChildNodes();)e.removeChild(e.lastChild);const i=this.getBoundingClientRect(),s=Math.min(i.width,i.height);e.setAttribute("width",`${s}`),e.setAttribute("height",`${s}`),fi(e,s/2,s/2,s,s),this.classList.add("wired-rendered")}refreshDisabledState(){this.disabled?this.classList.add("wired-disabled"):this.classList.remove("wired-disabled"),this.tabIndex=this.disabled?-1:+(this.getAttribute("tabindex")||0)}};Di([Ve({type:Boolean,reflect:!0}),Vi("design:type",Object)],Bi.prototype,"disabled",void 0),Bi=Di([Le("wired-icon-button")],Bi);var zi=function(t,e,i,s){var n,r=arguments.length,o=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,s);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(o=(r<3?n(o):r>3?n(e,i,o):n(e,i))||o);return r>3&&o&&Object.defineProperty(e,i,o),o},qi=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let Ui=class extends Ye{constructor(){super(...arguments),this.placeholder="",this.type="text",this.autocomplete="",this.autocapitalize="",this.autocorrect="",this.disabled=!1,this.required=!1,this.autofocus=!1,this.readonly=!1}static get styles(){return Fe`
:host {
display: inline-block;
position: relative;
padding: 5px;
font-family: sans-serif;
width: 150px;
outline: none;
opacity: 0;
}
:host(.wired-rendered) {
opacity: 1;
}
:host(.wired-disabled) {
opacity: 0.6 !important;
cursor: default;
pointer-events: none;
}
:host(.wired-disabled) svg {
background: rgba(0, 0, 0, 0.07);
}
.overlay {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
pointer-events: none;
}
svg {
display: block;
}
path {
stroke: currentColor;
stroke-width: 0.7;
fill: transparent;
}
input {
display: block;
width: 100%;
box-sizing: border-box;
outline: none;
border: none;
font-family: inherit;
font-size: inherit;
font-weight: inherit;
color: inherit;
padding: 6px;
}
`}render(){return ye`
<input id="txt" name="${this.name}" type="${this.type}" placeholder="${this.placeholder}" ?disabled="${this.disabled}"
?required="${this.required}" autocomplete="${this.autocomplete}" ?autofocus="${this.autofocus}" minlength="${this.minlength}"
maxlength="${this.maxlength}" min="${this.min}" max="${this.max}" step="${this.step}" ?readonly="${this.readonly}"
size="${this.size}" autocapitalize="${this.autocapitalize}" autocorrect="${this.autocorrect}" @change="${this.onChange}">
<div class="overlay">
<svg id="svg"></svg>
</div>
`}createRenderRoot(){return this.attachShadow({mode:"open",delegatesFocus:!0})}get input(){return this.shadowRoot?this.shadowRoot.getElementById("txt"):null}get value(){const t=this.input;return t&&t.value||""}set value(t){if(this.shadowRoot){const e=this.input;e&&(e.value=t)}else this.pendingValue=t}firstUpdated(){this.value=this.value||this.getAttribute("value")||""}updated(t){t.has("disabled")&&this.refreshDisabledState();const e=this.shadowRoot.getElementById("svg");for(;e.hasChildNodes();)e.removeChild(e.lastChild);const i=this.getBoundingClientRect();e.setAttribute("width",`${i.width}`),e.setAttribute("height",`${i.height}`),ui(e,0,0,i.width,i.height),void 0!==this.pendingValue&&(this.input.value=this.pendingValue,delete this.pendingValue),this.classList.add("wired-rendered")}refreshDisabledState(){this.disabled?this.classList.add("wired-disabled"):this.classList.remove("wired-disabled")}onChange(t){t.stopPropagation(),this.fireEvent(t.type,{sourceEvent:t})}};zi([Ve({type:String}),qi("design:type",Object)],Ui.prototype,"placeholder",void 0),zi([Ve({type:String}),qi("design:type",String)],Ui.prototype,"name",void 0),zi([Ve({type:String}),qi("design:type",String)],Ui.prototype,"min",void 0),zi([Ve({type:String}),qi("design:type",String)],Ui.prototype,"max",void 0),zi([Ve({type:String}),qi("design:type",String)],Ui.prototype,"step",void 0),zi([Ve({type:String}),qi("design:type",Object)],Ui.prototype,"type",void 0),zi([Ve({type:String}),qi("design:type",Object)],Ui.prototype,"autocomplete",void 0),zi([Ve({type:String}),qi("design:type",Object)],Ui.prototype,"autocapitalize",void 0),zi([Ve({type:String}),qi("design:type",Object)],Ui.prototype,"autocorrect",void 0),zi([Ve({type:Boolean,reflect:!0}),qi("design:type",Object)],Ui.prototype,"disabled",void 0),zi([Ve({type:Boolean}),qi("design:type",Object)],Ui.prototype,"required",void 0),zi([Ve({type:Boolean}),qi("design:type",Object)],Ui.prototype,"autofocus",void 0),zi([Ve({type:Boolean}),qi("design:type",Object)],Ui.prototype,"readonly",void 0),zi([Ve({type:Number}),qi("design:type",Number)],Ui.prototype,"minlength",void 0),zi([Ve({type:Number}),qi("design:type",Number)],Ui.prototype,"maxlength",void 0),zi([Ve({type:Number}),qi("design:type",Number)],Ui.prototype,"size",void 0),Ui=zi([Le("wired-input")],Ui);var Hi=function(t,e,i,s){var n,r=arguments.length,o=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,s);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(o=(r<3?n(o):r>3?n(e,i,o):n(e,i))||o);return r>3&&o&&Object.defineProperty(e,i,o),o},Xi=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let Fi=class extends Ye{constructor(){super(...arguments),this.horizontal=!1,this.itemNodes=[],this.itemClickHandler=this.onItemClick.bind(this)}static get styles(){return Fe`
:host {
display: inline-block;
font-family: inherit;
position: relative;
padding: 5px;
outline: none;
opacity: 0;
}
:host(.wired-rendered) {
opacity: 1;
}
:host(:focus) path {
stroke-width: 1.5;
}
.overlay {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
pointer-events: none;
}
svg {
display: block;
}
path {
stroke: currentColor;
stroke-width: 0.7;
fill: transparent;
}
::slotted(wired-item) {
display: block;
}
:host(.wired-horizontal) ::slotted(wired-item) {
display: inline-block;
}
`}render(){return ye`
<slot id="slot" @slotchange="${()=>this.requestUpdate()}"></slot>
<div class="overlay">
<svg id="svg"></svg>
</div>
`}firstUpdated(){this.setAttribute("role","listbox"),this.tabIndex=+(this.getAttribute("tabindex")||0),this.refreshSelection(),this.addEventListener("click",this.itemClickHandler),this.addEventListener("keydown",t=>{switch(t.keyCode){case 37:case 38:t.preventDefault(),this.selectPrevious();break;case 39:case 40:t.preventDefault(),this.selectNext()}})}updated(){const t=this.shadowRoot.getElementById("svg");for(;t.hasChildNodes();)t.removeChild(t.lastChild);const e=this.getBoundingClientRect();if(t.setAttribute("width",`${e.width}`),t.setAttribute("height",`${e.height}`),ui(t,0,0,e.width,e.height),this.classList.add("wired-rendered"),this.horizontal?this.classList.add("wired-horizontal"):this.classList.remove("wired-horizontal"),!this.itemNodes.length){this.itemNodes=[];const t=this.shadowRoot.getElementById("slot").assignedNodes();if(t&&t.length)for(let e=0;e<t.length;e++){const i=t[e];"WIRED-ITEM"===i.tagName&&(i.setAttribute("role","option"),this.itemNodes.push(i))}}}onItemClick(t){t.stopPropagation(),this.selected=t.target.value,this.refreshSelection(),this.fireSelected()}refreshSelection(){this.lastSelectedItem&&(this.lastSelectedItem.selected=!1,this.lastSelectedItem.removeAttribute("aria-selected"));const t=this.shadowRoot.getElementById("slot").assignedNodes();if(t){let e=null;for(let i=0;i<t.length;i++){const s=t[i];if("WIRED-ITEM"===s.tagName){const t=s.value||"";if(this.selected&&t===this.selected){e=s;break}}}this.lastSelectedItem=e||void 0,this.lastSelectedItem&&(this.lastSelectedItem.selected=!0,this.lastSelectedItem.setAttribute("aria-selected","true")),this.value=e?{value:e.value||"",text:e.textContent||""}:void 0}}fireSelected(){this.fireEvent("selected",{selected:this.selected})}selectPrevious(){const t=this.itemNodes;if(t.length){let e=-1;for(let i=0;i<t.length;i++)if(t[i]===this.lastSelectedItem){e=i;break}e<0?e=0:0===e?e=t.length-1:e--,this.selected=t[e].value||"",this.refreshSelection(),this.fireSelected()}}selectNext(){const t=this.itemNodes;if(t.length){let e=-1;for(let i=0;i<t.length;i++)if(t[i]===this.lastSelectedItem){e=i;break}e<0?e=0:e>=t.length-1?e=0:e++,this.selected=t[e].value||"",this.refreshSelection(),this.fireSelected()}}};Hi([Ve({type:Object}),Xi("design:type",Object)],Fi.prototype,"value",void 0),Hi([Ve({type:String}),Xi("design:type",String)],Fi.prototype,"selected",void 0),Hi([Ve({type:Boolean}),Xi("design:type",Object)],Fi.prototype,"horizontal",void 0),Fi=Hi([Le("wired-listbox")],Fi);var Wi=function(t,e,i,s){var n,r=arguments.length,o=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,s);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(o=(r<3?n(o):r>3?n(e,i,o):n(e,i))||o);return r>3&&o&&Object.defineProperty(e,i,o),o},Gi=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let Yi=class extends Ye{constructor(){super(...arguments),this.value=0,this.min=0,this.max=100,this.percentage=!1}static get styles(){return Fe`
:host {
display: inline-block;
position: relative;
width: 400px;
height: 42px;
font-family: sans-serif;
opacity: 0;
}
:host(.wired-rendered) {
opacity: 1;
}
svg {
display: block;
}
path {
stroke: currentColor;
stroke-width: 0.7;
fill: transparent;
}
.overlay {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
pointer-events: none;
}
.labelContainer {
display: flex;
align-items: center;
justify-content: center;
}
.progressLabel {
color: var(--wired-progress-label-color, #000);
font-size: var(--wired-progress-font-size, 14px);
background: var(--wired-progress-label-background, rgba(255,255,255,0.9));
padding: 2px 6px;
border-radius: 4px;
letter-spacing: 1.25px;
}
.progbox path {
stroke: var(--wired-progress-color, rgba(0, 0, 200, 0.8));
stroke-width: 2.75;
fill: none;
}
`}render(){return ye`
<div class="overlay">
<svg id="svg"></svg>
</div>
<div class="overlay labelContainer">
<div class="progressLabel">${this.getProgressLabel()}</div>
</div>
`}getProgressLabel(){if(this.percentage){if(this.max===this.min)return"%";return Math.floor((this.value-this.min)/(this.max-this.min)*100)+"%"}return""+this.value}updated(){const t=this.shadowRoot.getElementById("svg");for(;t.hasChildNodes();)t.removeChild(t.lastChild);const e=this.getBoundingClientRect();t.setAttribute("width",`${e.width}`),t.setAttribute("height",`${e.height}`),this.box?t.appendChild(this.box):this.box=ui(t,0,0,e.width,e.height);let i=0;if(this.max>this.min){i=(this.value-this.min)/(this.max-this.min);const s=e.width*Math.max(0,Math.min(i,100)),n=gi([[0,0],[s,0],[s,e.height],[0,e.height]]);t.appendChild(n),n.classList.add("progbox")}this.classList.add("wired-rendered")}};Wi([Ve({type:Number}),Gi("design:type",Object)],Yi.prototype,"value",void 0),Wi([Ve({type:Number}),Gi("design:type",Object)],Yi.prototype,"min",void 0),Wi([Ve({type:Number}),Gi("design:type",Object)],Yi.prototype,"max",void 0),Wi([Ve({type:Boolean}),Gi("design:type",Object)],Yi.prototype,"percentage",void 0),Yi=Wi([Le("wired-progress")],Yi);var Ji=function(t,e,i,s){var n,r=arguments.length,o=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,s);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(o=(r<3?n(o):r>3?n(e,i,o):n(e,i))||o);return r>3&&o&&Object.defineProperty(e,i,o),o},Ki=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let Zi=class extends Ye{constructor(){super(...arguments),this.checked=!1,this.disabled=!1,this.iconsize=24}static get styles(){return Fe`
:host {
display: inline-block;
position: relative;
padding: 5px;
font-family: inherit;
width: 150px;
outline: none;
opacity: 0;
}
:host(.wired-rendered) {
opacity: 1;
}
:host(.wired-disabled) {
opacity: 0.45 !important;
cursor: default;
pointer-events: none;
}
:host(:focus) path {
stroke-width: 1.5;
}
#container {
display: inline-block;
white-space: nowrap;
}
.inline {
display: inline-block;
vertical-align: middle;
-moz-user-select: none;
user-select: none;
}
#checkPanel {
cursor: pointer;
}
svg {
display: block;
}
path {
stroke: var(--wired-radio-icon-color, currentColor);
stroke-width: 0.7;
fill: transparent;
}
.filledPath {
fill: var(--wired-radio-icon-color, currentColor);
}
`}render(){return ye`
<div id="container" @click="${this.toggleCheck}">
<div id="checkPanel" class="inline">
<svg id="svg" width="0" height="0"></svg>
</div>
<div class="inline">
<slot></slot>
</div>
</div>
`}refreshDisabledState(){this.disabled?this.classList.add("wired-disabled"):this.classList.remove("wired-disabled"),this.tabIndex=this.disabled?-1:+(this.getAttribute("tabindex")||0)}toggleCheck(){this.checked=!this.checked,this.fireEvent("change",{checked:this.checked})}firstUpdated(){this.setAttribute("role","checkbox"),this.addEventListener("keydown",t=>{13!==t.keyCode&&32!==t.keyCode||(t.preventDefault(),this.toggleCheck())})}updated(t){t.has("disabled")&&this.refreshDisabledState();const e=this.shadowRoot.getElementById("svg");for(;e.hasChildNodes();)e.removeChild(e.lastChild);this.dot=void 0;const i={width:this.iconsize||24,height:this.iconsize||24};e.setAttribute("width",`${i.width}`),e.setAttribute("height",`${i.height}`),fi(e,i.width/2,i.height/2,i.width,i.height);const s=Math.max(.6*i.width,5),n=Math.max(.6*i.height,5);this.dot=fi(e,i.width/2,i.height/2,s,n),this.dot.classList.add("filledPath"),this.dot.style.display=this.checked?"":"none",this.classList.add("wired-rendered")}};Ji([Ve({type:Boolean}),Ki("design:type",Object)],Zi.prototype,"checked",void 0),Ji([Ve({type:Boolean,reflect:!0}),Ki("design:type",Object)],Zi.prototype,"disabled",void 0),Ji([Ve({type:String}),Ki("design:type",String)],Zi.prototype,"name",void 0),Ji([Ve({type:Number}),Ki("design:type",Object)],Zi.prototype,"iconsize",void 0),Zi=Ji([Le("wired-radio")],Zi);var Qi=function(t,e,i,s){var n,r=arguments.length,o=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,s);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(o=(r<3?n(o):r>3?n(e,i,o):n(e,i))||o);return r>3&&o&&Object.defineProperty(e,i,o),o},ts=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let es=class extends Ye{constructor(){super(...arguments),this.radioNodes=[],this.checkListener=this.handleChecked.bind(this)}static get styles(){return Fe`
:host {
display: inline-block;
}
:host ::slotted(*) {
padding: var(--wired-radio-group-item-padding, 5px);
}
`}render(){return ye`
<slot id="slot" @slotchange="${this.slotChange}"></slot>
`}connectedCallback(){super.connectedCallback(),this.addEventListener("change",this.checkListener)}disconnectedCallback(){super.disconnectedCallback&&super.disconnectedCallback(),this.removeEventListener("checked",this.checkListener)}handleChecked(t){const e=t.detail.checked,i=t.target,s=i.name||"";e?(this.selected=e&&s||"",this.fireSelected()):i.checked=!0}fireSelected(){this.fireEvent("selected",{selected:this.selected})}slotChange(){this.requestUpdate()}firstUpdated(){this.setAttribute("role","radiogroup"),this.tabIndex=+(this.getAttribute("tabindex")||0),this.addEventListener("keydown",t=>{switch(t.keyCode){case 37:case 38:t.preventDefault(),this.selectPrevious();break;case 39:case 40:t.preventDefault(),this.selectNext()}})}updated(){const t=this.shadowRoot.getElementById("slot").assignedNodes();if(this.radioNodes=[],t&&t.length)for(let e=0;e<t.length;e++){const i=t[e];if("WIRED-RADIO"===i.tagName){this.radioNodes.push(i);const t=i.name||"";this.selected&&t===this.selected?i.checked=!0:i.checked=!1}}}selectPrevious(){const t=this.radioNodes;if(t.length){let e=null,i=-1;if(this.selected){for(let e=0;e<t.length;e++){if(t[e].name===this.selected){i=e;break}}i<0?e=t[0]:(--i<0&&(i=t.length-1),e=t[i])}else e=t[0];e&&(e.focus(),this.selected=e.name,this.fireSelected())}}selectNext(){const t=this.radioNodes;if(t.length){let e=null,i=-1;if(this.selected){for(let e=0;e<t.length;e++){if(t[e].name===this.selected){i=e;break}}i<0?e=t[0]:(++i>=t.length&&(i=0),e=t[i])}else e=t[0];e&&(e.focus(),this.selected=e.name,this.fireSelected())}}};Qi([Ve({type:String}),ts("design:type",String)],es.prototype,"selected",void 0),es=Qi([Le("wired-radio-group")],es),window.JSCompiler_renameProperty=function(t,e){return t};let is=0,ss=0,ns=[],rs=0,os=document.createTextNode("");new window.MutationObserver(function(){const t=ns.length;for(let e=0;e<t;e++){let t=ns[e];if(t)try{t()}catch(t){setTimeout(()=>{throw t})}}ns.splice(0,t),ss+=t}).observe(os,{characterData:!0});const as={after:t=>({run:e=>window.setTimeout(e,t),cancel(t){window.clearTimeout(t)}}),run:(t,e)=>window.setTimeout(t,e),cancel(t){window.clearTimeout(t)}},cs={run:t=>(os.textContent=rs++,ns.push(t),is++),cancel(t){const e=t-ss;if(e>=0){if(!ns[e])throw new Error("invalid async handle: "+t);ns[e]=null}}};class hs{constructor(){this._asyncModule=null,this._callback=null,this._timer=null}setConfig(t,e){this._asyncModule=t,this._callback=e,this._timer=this._asyncModule.run(()=>{this._timer=null,ls.delete(this),this._callback()})}cancel(){this.isActive()&&(this._cancelAsync(),ls.delete(this))}_cancelAsync(){this.isActive()&&(this._asyncModule.cancel(this._timer),this._timer=null)}flush(){this.isActive()&&(this.cancel(),this._callback())}isActive(){return null!=this._timer}static debounce(t,e,i){return t instanceof hs?t._cancelAsync():t=new hs,t.setConfig(e,i),t}}let ls=new Set;window.ShadyDOM,Boolean(!window.ShadyCSS||window.ShadyCSS.nativeCss),window.customElements.polyfillWrapFlushCallback;(ds=document.baseURI||window.location.href).substring(0,ds.lastIndexOf("/")+1);var ds;window.Polymer&&window.Polymer.sanitizeDOMValue;let us=!1;const ps=window.ShadyDOM&&window.ShadyDOM.noPatch&&window.ShadyDOM.wrap?window.ShadyDOM.wrap:t=>t;let fs="string"==typeof document.head.style.touchAction,ys="__polymerGestures",bs="__polymerGesturesHandled",gs="__polymerGesturesTouchAction",ms=25,vs=5,ws=2500,xs=["mousedown","mousemove","mouseup","click"],ks=[0,1,4,2],Ss=function(){try{return 1===new MouseEvent("test",{buttons:1}).buttons}catch(t){return!1}}();function _s(t){return xs.indexOf(t)>-1}let Cs=!1;function Es(t){if(!_s(t)&&"touchend"!==t)return fs&&Cs&&us?{passive:!0}:void 0}!function(){try{let t=Object.defineProperty({},"passive",{get(){Cs=!0}});window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch(t){}}();let Ns=navigator.userAgent.match(/iP(?:[oa]d|hone)|Android/);const Rs=[],Os={button:!0,input:!0,keygen:!0,meter:!0,output:!0,textarea:!0,progress:!0,select:!0},Ps={button:!0,command:!0,fieldset:!0,input:!0,keygen:!0,optgroup:!0,option:!0,select:!0,textarea:!0};function Ms(t){let e=Array.prototype.slice.call(t.labels||[]);if(!e.length){e=[];let i=t.getRootNode();if(t.id){let s=i.querySelectorAll(`label[for = ${t.id}]`);for(let t=0;t<s.length;t++)e.push(s[t])}}return e}let js=function(t){let e=t.sourceCapabilities;var i;if((!e||e.firesTouchEvents)&&(t[bs]={skip:!0},"click"===t.type)){let e=!1,s=Ds(t);for(let t=0;t<s.length;t++){if(s[t].nodeType===Node.ELEMENT_NODE)if("label"===s[t].localName)Rs.push(s[t]);else if(i=s[t],Os[i.localName]){let i=Ms(s[t]);for(let t=0;t<i.length;t++)e=e||Rs.indexOf(i[t])>-1}if(s[t]===$s.mouse.target)return}if(e)return;t.preventDefault(),t.stopPropagation()}};function Ts(t){let e=Ns?["click"]:xs;for(let i,s=0;s<e.length;s++)i=e[s],t?(Rs.length=0,document.addEventListener(i,js,!0)):document.removeEventListener(i,js,!0)}function As(t){let e=t.type;if(!_s(e))return!1;if("mousemove"===e){let e=void 0===t.buttons?1:t.buttons;return t instanceof window.MouseEvent&&!Ss&&(e=ks[t.which]||0),Boolean(1&e)}return 0===(void 0===t.button?0:t.button)}let $s={mouse:{target:null,mouseIgnoreJob:null},touch:{x:0,y:0,id:-1,scrollDecided:!1}};function Ls(t,e,i){t.movefn=e,t.upfn=i,document.addEventListener("mousemove",e),document.addEventListener("mouseup",i)}function Is(t){document.removeEventListener("mousemove",t.movefn),document.removeEventListener("mouseup",t.upfn),t.movefn=null,t.upfn=null}document.addEventListener("touchend",function(t){$s.mouse.mouseIgnoreJob||Ts(!0),$s.mouse.target=Ds(t)[0],$s.mouse.mouseIgnoreJob=hs.debounce($s.mouse.mouseIgnoreJob,as.after(ws),function(){Ts(),$s.mouse.target=null,$s.mouse.mouseIgnoreJob=null})},!!Cs&&{passive:!0});const Ds=window.ShadyDOM&&window.ShadyDOM.noPatch?window.ShadyDOM.composedPath:t=>t.composedPath&&t.composedPath()||[],Vs={},Bs=[];function zs(t){const e=Ds(t);return e.length>0?e[0]:t.target}function qs(t){let e,i=t.type,s=t.currentTarget[ys];if(!s)return;let n=s[i];if(n){if(!t[bs]&&(t[bs]={},"touch"===i.slice(0,5))){let e=(t=t).changedTouches[0];if("touchstart"===i&&1===t.touches.length&&($s.touch.id=e.identifier),$s.touch.id!==e.identifier)return;fs||"touchstart"!==i&&"touchmove"!==i||function(t){let e=t.changedTouches[0],i=t.type;if("touchstart"===i)$s.touch.x=e.clientX,$s.touch.y=e.clientY,$s.touch.scrollDecided=!1;else if("touchmove"===i){if($s.touch.scrollDecided)return;$s.touch.scrollDecided=!0;let i=function(t){let e="auto",i=Ds(t);for(let t,s=0;s<i.length;s++)if((t=i[s])[gs]){e=t[gs];break}return e}(t),s=!1,n=Math.abs($s.touch.x-e.clientX),r=Math.abs($s.touch.y-e.clientY);t.cancelable&&("none"===i?s=!0:"pan-x"===i?s=r>n:"pan-y"===i&&(s=n>r)),s?t.preventDefault():Fs("track")}}(t)}if(!(e=t[bs]).skip){for(let i,s=0;s<Bs.length;s++)n[(i=Bs[s]).name]&&!e[i.name]&&i.flow&&i.flow.start.indexOf(t.type)>-1&&i.reset&&i.reset();for(let s,r=0;r<Bs.length;r++)n[(s=Bs[r]).name]&&!e[s.name]&&(e[s.name]=!0,s[i](t))}}}function Us(t,e,i){return!!Vs[e]&&(function(t,e,i){let s=Vs[e],n=s.deps,r=s.name,o=t[ys];o||(t[ys]=o={});for(let e,i,s=0;s<n.length;s++)e=n[s],Ns&&_s(e)&&"click"!==e||((i=o[e])||(o[e]=i={_count:0}),0===i._count&&t.addEventListener(e,qs,Es(e)),i[r]=(i[r]||0)+1,i._count=(i._count||0)+1);t.addEventListener(e,i),s.touchAction&&function(t,e){fs&&t instanceof HTMLElement&&cs.run(()=>{t.style.touchAction=e});t[gs]=e}(t,s.touchAction)}(t,e,i),!0)}function Hs(t){Bs.push(t);for(let e=0;e<t.emits.length;e++)Vs[t.emits[e]]=t}function Xs(t,e,i){let s=new Event(e,{bubbles:!0,cancelable:!0,composed:!0});if(s.detail=i,ps(t).dispatchEvent(s),s.defaultPrevented){let t=i.preventer||i.sourceEvent;t&&t.preventDefault&&t.preventDefault()}}function Fs(t){let e=function(t){for(let e,i=0;i<Bs.length;i++){e=Bs[i];for(let i,s=0;s<e.emits.length;s++)if((i=e.emits[s])===t)return e}return null}(t);e.info&&(e.info.prevent=!0)}function Ws(t,e,i,s){e&&Xs(e,t,{x:i.clientX,y:i.clientY,sourceEvent:i,preventer:s,prevent:function(t){return Fs(t)}})}function Gs(t,e,i){if(t.prevent)return!1;if(t.started)return!0;let s=Math.abs(t.x-e),n=Math.abs(t.y-i);return s>=vs||n>=vs}function Ys(t,e,i){if(!e)return;let s,n=t.moves[t.moves.length-2],r=t.moves[t.moves.length-1],o=r.x-t.x,a=r.y-t.y,c=0;n&&(s=r.x-n.x,c=r.y-n.y),Xs(e,"track",{state:t.state,x:i.clientX,y:i.clientY,dx:o,dy:a,ddx:s,ddy:c,sourceEvent:i,hover:function(){return function(t,e){let i=document.elementFromPoint(t,e),s=i;for(;s&&s.shadowRoot&&!window.ShadyDOM&&s!==(s=s.shadowRoot.elementFromPoint(t,e));)s&&(i=s);return i}(i.clientX,i.clientY)}})}function Js(t,e,i){let s=Math.abs(e.clientX-t.x),n=Math.abs(e.clientY-t.y),r=zs(i||e);!r||Ps[r.localName]&&r.hasAttribute("disabled")||(isNaN(s)||isNaN(n)||s<=ms&&n<=ms||function(t){if("click"===t.type){if(0===t.detail)return!0;let e=zs(t);if(!e.nodeType||e.nodeType!==Node.ELEMENT_NODE)return!0;let i=e.getBoundingClientRect(),s=t.pageX,n=t.pageY;return!(s>=i.left&&s<=i.right&&n>=i.top&&n<=i.bottom)}return!1}(e))&&(t.prevent||Xs(r,"tap",{x:e.clientX,y:e.clientY,sourceEvent:e,preventer:i}))}Hs({name:"downup",deps:["mousedown","touchstart","touchend"],flow:{start:["mousedown","touchstart"],end:["mouseup","touchend"]},emits:["down","up"],info:{movefn:null,upfn:null},reset:function(){Is(this.info)},mousedown:function(t){if(!As(t))return;let e=zs(t),i=this;Ls(this.info,function(t){As(t)||(Ws("up",e,t),Is(i.info))},function(t){As(t)&&Ws("up",e,t),Is(i.info)}),Ws("down",e,t)},touchstart:function(t){Ws("down",zs(t),t.changedTouches[0],t)},touchend:function(t){Ws("up",zs(t),t.changedTouches[0],t)}}),Hs({name:"track",touchAction:"none",deps:["mousedown","touchstart","touchmove","touchend"],flow:{start:["mousedown","touchstart"],end:["mouseup","touchend"]},emits:["track"],info:{x:0,y:0,state:"start",started:!1,moves:[],addMove:function(t){this.moves.length>2&&this.moves.shift(),this.moves.push(t)},movefn:null,upfn:null,prevent:!1},reset:function(){this.info.state="start",this.info.started=!1,this.info.moves=[],this.info.x=0,this.info.y=0,this.info.prevent=!1,Is(this.info)},mousedown:function(t){if(!As(t))return;let e=zs(t),i=this,s=function(t){let s=t.clientX,n=t.clientY;Gs(i.info,s,n)&&(i.info.state=i.info.started?"mouseup"===t.type?"end":"track":"start","start"===i.info.state&&Fs("tap"),i.info.addMove({x:s,y:n}),As(t)||(i.info.state="end",Is(i.info)),e&&Ys(i.info,e,t),i.info.started=!0)};Ls(this.info,s,function(t){i.info.started&&s(t),Is(i.info)}),this.info.x=t.clientX,this.info.y=t.clientY},touchstart:function(t){let e=t.changedTouches[0];this.info.x=e.clientX,this.info.y=e.clientY},touchmove:function(t){let e=zs(t),i=t.changedTouches[0],s=i.clientX,n=i.clientY;Gs(this.info,s,n)&&("start"===this.info.state&&Fs("tap"),this.info.addMove({x:s,y:n}),Ys(this.info,e,i),this.info.state="track",this.info.started=!0)},touchend:function(t){let e=zs(t),i=t.changedTouches[0];this.info.started&&(this.info.state="end",this.info.addMove({x:i.clientX,y:i.clientY}),Ys(this.info,e,i))}}),Hs({name:"tap",deps:["mousedown","click","touchstart","touchend"],flow:{start:["mousedown","touchstart"],end:["click","touchend"]},emits:["tap"],info:{x:NaN,y:NaN,prevent:!1},reset:function(){this.info.x=NaN,this.info.y=NaN,this.info.prevent=!1},mousedown:function(t){As(t)&&(this.info.x=t.clientX,this.info.y=t.clientY)},click:function(t){As(t)&&Js(this.info,t)},touchstart:function(t){const e=t.changedTouches[0];this.info.x=e.clientX,this.info.y=e.clientY},touchend:function(t){Js(this.info,t.changedTouches[0],t)}});var Ks=function(t,e,i,s){var n,r=arguments.length,o=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,s);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(o=(r<3?n(o):r>3?n(e,i,o):n(e,i))||o);return r>3&&o&&Object.defineProperty(e,i,o),o},Zs=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let Qs=class extends Ye{constructor(){super(...arguments),this._value=0,this.min=0,this.max=100,this.knobradius=10,this.disabled=!1,this.step=1,this.barWidth=0,this.intermediateValue=this.min,this.pct=0,this.startx=0,this.dragging=!1}static get styles(){return Fe`
:host {
display: inline-block;
position: relative;
width: 300px;
height: 40px;
outline: none;
box-sizing: border-box;
opacity: 0;
}
:host(.wired-rendered) {
opacity: 1;
}
:host(.wired-disabled) {
opacity: 0.45 !important;
cursor: default;
pointer-events: none;
background: rgba(0, 0, 0, 0.07);
border-radius: 5px;
}
:host(.wired-disabled) .knob {
pointer-events: none !important;
}
:host(:focus) .knob {
cursor: move;
stroke: var(--wired-slider-knob-outline-color, #000);
fill-opacity: 0.8;
}
.overlay {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
pointer-events: none;
}
svg {
display: block;
}
path {
stroke-width: 0.7;
fill: transparent;
}
.knob {
pointer-events: auto;
fill: var(--wired-slider-knob-zero-color, gray);
stroke: var(--wired-slider-knob-zero-color, gray);
transition: transform 0.15s ease;
cursor: pointer;
}
.hasValue {
fill: var(--wired-slider-knob-color, rgb(51, 103, 214));
stroke: var(--wired-slider-knob-color, rgb(51, 103, 214));
}
.bar {
stroke: var(--wired-slider-bar-color, rgb(0, 0, 0));
}
`}render(){return ye`
<div class="overlay">
<svg id="svg"></svg>
</div>
`}get value(){return this._value}set value(t){this.setValue(t,!0)}refreshDisabledState(){this.disabled?this.classList.add("wired-disabled"):this.classList.remove("wired-disabled"),this.tabIndex=this.disabled?-1:+(this.getAttribute("tabindex")||0)}firstUpdated(){const t=this.shadowRoot.getElementById("svg");for(;t.hasChildNodes();)t.removeChild(t.lastChild);const e=this.getBoundingClientRect();t.setAttribute("width",`${e.width}`),t.setAttribute("height",`${e.height}`);const i=this.knobradius||10;this.barWidth=e.width-2*i,this.bar=di(t,i,e.height/2,e.width-i,e.height/2),this.bar.classList.add("bar"),this.knobGroup=oi("g"),t.appendChild(this.knobGroup),this.knob=fi(this.knobGroup,i,e.height/2,2*i,2*i),this.knob.classList.add("knob"),this.onValueChange(),this.classList.add("wired-rendered"),this.setAttribute("role","slider"),this.setAttribute("aria-valuemax",`${this.max}`),this.setAttribute("aria-valuemin",`${this.min}`),this.setAriaValue(),Us(this.knob,"down",t=>{this.disabled||this.knobdown(t)}),Us(this.knob,"up",()=>{this.disabled||this.resetKnob()}),Us(this.knob,"track",t=>{this.disabled||this.onTrack(t)}),this.addEventListener("keydown",t=>{switch(t.keyCode){case 38:case 39:this.incremenent();break;case 37:case 40:this.decrement();break;case 36:this.setValue(this.min);break;case 35:this.setValue(this.max)}})}updated(t){t.has("disabled")&&this.refreshDisabledState()}setAriaValue(){this.setAttribute("aria-valuenow",`${this.value}`)}setValue(t,e=!1){this._value=t,this.setAriaValue(),this.onValueChange(),e||this.fireEvent("change",{value:this.intermediateValue})}incremenent(){const t=Math.min(this.max,Math.round(this.value+this.step));t!==this.value&&this.setValue(t)}decrement(){const t=Math.max(this.min,Math.round(this.value-this.step));t!==this.value&&this.setValue(t)}onValueChange(){if(!this.knob)return;let t=0;this.max>this.min&&(t=Math.min(1,Math.max((this.value-this.min)/(this.max-this.min),0))),this.pct=t,t?this.knob.classList.add("hasValue"):this.knob.classList.remove("hasValue");const e=t*this.barWidth;this.knobGroup.style.transform=`translateX(${Math.round(e)}px)`}knobdown(t){this.knobExpand(!0),t.preventDefault(),this.focus()}resetKnob(){this.knobExpand(!1)}knobExpand(t){this.knob&&(t?this.knob.classList.add("expanded"):this.knob.classList.remove("expanded"))}onTrack(t){switch(t.stopPropagation(),t.detail.state){case"start":this.trackStart();break;case"track":this.trackX(t);break;case"end":this.trackEnd()}}trackStart(){this.intermediateValue=this.value,this.startx=this.pct*this.barWidth,this.dragging=!0}trackX(t){this.dragging||this.trackStart();const e=t.detail.dx||0,i=Math.max(Math.min(this.startx+e,this.barWidth),0);this.knobGroup.style.transform=`translateX(${Math.round(i)}px)`;const s=i/this.barWidth;this.intermediateValue=this.min+s*(this.max-this.min)}trackEnd(){this.dragging=!1,this.resetKnob(),this.setValue(this.intermediateValue),this.pct=(this.value-this.min)/(this.max-this.min)}};Ks([Ve({type:Number}),Zs("design:type",Object)],Qs.prototype,"_value",void 0),Ks([Ve({type:Number}),Zs("design:type",Object)],Qs.prototype,"min",void 0),Ks([Ve({type:Number}),Zs("design:type",Object)],Qs.prototype,"max",void 0),Ks([Ve({type:Number}),Zs("design:type",Object)],Qs.prototype,"knobradius",void 0),Ks([Ve({type:Boolean,reflect:!0}),Zs("design:type",Object)],Qs.prototype,"disabled",void 0),Qs=Ks([Le("wired-slider")],Qs);var tn=function(t,e,i,s){var n,r=arguments.length,o=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,s);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(o=(r<3?n(o):r>3?n(e,i,o):n(e,i))||o);return r>3&&o&&Object.defineProperty(e,i,o),o},en=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let sn=class extends Ye{constructor(){super(...arguments),this.rows=1,this.maxrows=0,this.autocomplete="",this.autofocus=!1,this.disabled=!1,this.inputmode="",this.placeholder="",this.required=!1,this.readonly=!1,this.tokens=[],this.prevHeight=0}static get styles(){return Fe`
:host {
display: inline-block;
position: relative;
font-family: sans-serif;
width: 400px;
outline: none;
opacity: 0;
}
:host(.wired-rendered) {
opacity: 1;
}
:host(.wired-disabled) {
opacity: 0.6 !important;
cursor: default;
pointer-events: none;
}
:host(.wired-disabled) svg {
background: rgba(0, 0, 0, 0.07);
}
.fit {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
.overlay {
pointer-events: none;
}
svg {
display: block;
}
path {
stroke: currentColor;
stroke-width: 0.7;
fill: transparent;
}
.mirror-text {
visibility: hidden;
word-wrap: break-word;
}
#mirror {
padding: 10px;
}
textarea {
position: relative;
outline: none;
border: none;
resize: none;
background: inherit;
color: inherit;
width: 100%;
height: 100%;
font-size: inherit;
font-family: inherit;
line-height: inherit;
text-align: inherit;
padding: 10px;
box-sizing: border-box;
}
`}render(){return ye`
<div id="mirror" class="mirror-text">&#160;</div>
<div class="fit">
<textarea id="textarea" autocomplete="${this.autocomplete}" ?autofocus="${this.autofocus}" inputmode="${this.inputmode}"
placeholder="${this.placeholder}" ?readonly="${this.readonly}" ?required="${this.required}" ?disabled="${this.disabled}"
rows="${this.rows}" minlength="${this.minlength}" maxlength="${this.maxlength}" @input="${this.onInput}"></textarea>
</div>
<div class="fit overlay">
<svg id="svg"></svg>
</div>
`}createRenderRoot(){return this.attachShadow({mode:"open",delegatesFocus:!0})}get textarea(){return this.shadowRoot?this.shadowRoot.getElementById("textarea"):null}get mirror(){return this.shadowRoot.getElementById("mirror")}get value(){const t=this.textarea;return t&&t.value||""}set value(t){const e=this.textarea;e&&(e.value!==t&&(e.value=t||""),this.mirror.innerHTML=this.valueForMirror(),this.requestUpdate())}valueForMirror(){const t=this.textarea;return t?(this.tokens=t&&t.value?t.value.replace(/&/gm,"&amp;").replace(/"/gm,"&quot;").replace(/'/gm,"&#39;").replace(/</gm,"&lt;").replace(/>/gm,"&gt;").split("\n"):[""],this.constrain(this.tokens)):""}constrain(t){let e;for(t=t||[""],e=this.maxrows>0&&t.length>this.maxrows?t.slice(0,this.maxrows):t.slice(0);this.rows>0&&e.length<this.rows;)e.push("");return e.join("<br/>")+"&#160;"}refreshDisabledState(){this.disabled?this.classList.add("wired-disabled"):this.classList.remove("wired-disabled")}firstUpdated(){this.value=this.value||this.getAttribute("value")||""}updated(t){t.has("disabled")&&this.refreshDisabledState();const e=this.shadowRoot.getElementById("svg"),i=this.getBoundingClientRect();if(this.prevHeight!==i.height){for(;e.hasChildNodes();)e.removeChild(e.lastChild);e.setAttribute("width",`${i.width}`),e.setAttribute("height",`${i.height}`),ui(e,2,2,i.width-2,i.height-2),this.prevHeight=i.height,this.classList.add("wired-rendered"),this.updateCached()}}updateCached(){this.mirror.innerHTML=this.constrain(this.tokens)}onInput(){this.value=this.textarea.value}};tn([Ve({type:Number}),en("design:type",Object)],sn.prototype,"rows",void 0),tn([Ve({type:Number}),en("design:type",Object)],sn.prototype,"maxrows",void 0),tn([Ve({type:String}),en("design:type",Object)],sn.prototype,"autocomplete",void 0),tn([Ve({type:Boolean}),en("design:type",Object)],sn.prototype,"autofocus",void 0),tn([Ve({type:Boolean,reflect:!0}),en("design:type",Object)],sn.prototype,"disabled",void 0),tn([Ve({type:String}),en("design:type",Object)],sn.prototype,"inputmode",void 0),tn([Ve({type:String}),en("design:type",Object)],sn.prototype,"placeholder",void 0),tn([Ve({type:Boolean}),en("design:type",Object)],sn.prototype,"required",void 0),tn([Ve({type:Boolean}),en("design:type",Object)],sn.prototype,"readonly",void 0),tn([Ve({type:Number}),en("design:type",Number)],sn.prototype,"minlength",void 0),tn([Ve({type:Number}),en("design:type",Number)],sn.prototype,"maxlength",void 0),sn=tn([Le("wired-textarea")],sn);var nn=function(t,e,i,s){var n,r=arguments.length,o=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,s);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(o=(r<3?n(o):r>3?n(e,i,o):n(e,i))||o);return r>3&&o&&Object.defineProperty(e,i,o),o},rn=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let on=class extends Ye{constructor(){super(...arguments),this.checked=!1,this.disabled=!1}static get styles(){return Fe`
:host {
display: inline-block;
cursor: pointer;
position: relative;
outline: none;
opacity: 0;
}
:host(.wired-rendered) {
opacity: 1;
}
:host(.wired-disabled) {
opacity: 0.4 !important;
cursor: default;
pointer-events: none;
}
:host(.wired-disabled) svg {
background: rgba(0, 0, 0, 0.07);
}
:host(:focus) path {
stroke-width: 1.2;
}
svg {
display: block;
}
path {
stroke: currentColor;
stroke-width: 0.7;
fill: transparent;
}
.knob {
transition: transform 0.3s ease;
}
.knob path {
stroke-width: 0.7;
}
.knob.checked {
transform: translateX(48px);
}
.knobfill path {
stroke-width: 3 !important;
fill: transparent;
}
.knob.unchecked .knobfill path {
stroke: var(--wired-toggle-off-color, gray);
}
.knob.checked .knobfill path {
stroke: var(--wired-toggle-on-color, rgb(63, 81, 181));
}
`}render(){return ye`
<div @click="${this.toggleCheck}">
<svg id="svg"></svg>
</div>
`}refreshDisabledState(){this.disabled?this.classList.add("wired-disabled"):this.classList.remove("wired-disabled"),this.tabIndex=this.disabled?-1:+(this.getAttribute("tabindex")||0)}toggleCheck(){this.checked=!this.checked,this.fireEvent("change",{checked:this.checked})}firstUpdated(){this.setAttribute("role","switch"),this.addEventListener("keydown",t=>{13!==t.keyCode&&32!==t.keyCode||(t.preventDefault(),this.toggleCheck())});const t=this.shadowRoot.getElementById("svg");for(;t.hasChildNodes();)t.removeChild(t.lastChild);const e=80,i=34;t.setAttribute("width",`${e}`),t.setAttribute("height",`${i}`),ui(t,16,8,e-32,18),this.knob=oi("g"),this.knob.classList.add("knob"),t.appendChild(this.knob);const s=mi(16,16,32,32);s.classList.add("knobfill"),this.knob.appendChild(s),fi(this.knob,16,16,32,32),this.classList.add("wired-rendered")}updated(t){if(t.has("disabled")&&this.refreshDisabledState(),this.knob){const t=this.knob.classList;this.checked?(t.remove("unchecked"),t.add("checked")):(t.remove("checked"),t.add("unchecked"))}this.setAttribute("aria-checked",`${this.checked}`)}};nn([Ve({type:Boolean}),rn("design:type",Object)],on.prototype,"checked",void 0),nn([Ve({type:Boolean,reflect:!0}),rn("design:type",Object)],on.prototype,"disabled",void 0),on=nn([Le("wired-toggle")],on);var an=function(t,e,i,s){var n,r=arguments.length,o=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,s);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(o=(r<3?n(o):r>3?n(e,i,o):n(e,i))||o);return r>3&&o&&Object.defineProperty(e,i,o),o},cn=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let hn=class extends Ye{constructor(){super(...arguments),this.offset=14,this.position="bottom",this.dirty=!1,this.showing=!1,this._target=null,this.showHandler=this.show.bind(this),this.hideHandler=this.hide.bind(this)}static get styles(){return Fe`
:host {
display: block;
position: absolute;
outline: none;
z-index: 1002;
-moz-user-select: none;
-ms-user-select: none;
-webkit-user-select: none;
user-select: none;
cursor: default;
font-family: inherit;
font-size: 9pt;
line-height: 1;
}
.overlay {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
pointer-events: none;
}
svg {
display: block;
}
path {
stroke-width: 0.7;
stroke: var(--wired-tooltip-border-color, currentColor);
fill: var(--wired-tooltip-background, rgba(255, 255, 255, 0.9));
}
#container {
position: relative;
padding: 8px;
}
`}render(){return ye`
<div id="container" style="display: none;">
<div class="overlay">
<svg id="svg"></svg>
</div>
<span style="position: relative;">${this.text}</span>
</div>
`}get target(){if(this._target)return this._target;const t=this.parentNode,e=(this.getRootNode?this.getRootNode():null)||document;let i=null;return this.for?i=e.querySelector("#"+this.for):t&&(i=t.nodeType===Node.DOCUMENT_FRAGMENT_NODE?e.host:t),i}detachListeners(){this._target&&(this._target.removeEventListener("mouseenter",this.showHandler),this._target.removeEventListener("focus",this.showHandler),this._target.removeEventListener("mouseleave",this.hideHandler),this._target.removeEventListener("blur",this.hideHandler),this._target.removeEventListener("click",this.hideHandler)),this.removeEventListener("mouseenter",this.hideHandler)}attachListeners(){this._target&&(this._target.addEventListener("mouseenter",this.showHandler),this._target.addEventListener("focus",this.showHandler),this._target.addEventListener("mouseleave",this.hideHandler),this._target.addEventListener("blur",this.hideHandler),this._target.addEventListener("click",this.hideHandler)),this.addEventListener("mouseenter",this.hideHandler)}refreshTarget(){this.detachListeners(),this._target=null,this._target=this.target,this.attachListeners(),this.dirty=!0}layout(){const t=this.shadowRoot.getElementById("svg");for(;t.hasChildNodes();)t.removeChild(t.lastChild);const e=this.getBoundingClientRect();let i=e.width,s=e.height;switch(this.position){case"left":case"right":i+=this.offset;break;default:s+=this.offset}t.setAttribute("width",`${i}`),t.setAttribute("height",`${s}`);let n=[];switch(this.position){case"top":n=[[2,2],[i-2,2],[i-2,s-this.offset],[i/2+8,s-this.offset],[i/2,s-this.offset+8],[i/2-8,s-this.offset],[0,s-this.offset]];break;case"left":n=[[2,2],[i-this.offset,2],[i-this.offset,s/2-8],[i-this.offset+8,s/2],[i-this.offset,s/2+8],[i-this.offset,s],[2,s-2]];break;case"right":n=[[this.offset,2],[i-2,2],[i-2,s-2],[this.offset,s-2],[this.offset,s/2+8],[this.offset-8,s/2],[this.offset,s/2-8]],t.style.transform=`translateX(${-this.offset}px)`;break;default:n=[[2,this.offset],[0,s-2],[i-2,s-2],[i-2,this.offset],[i/2+8,this.offset],[i/2,this.offset-8],[i/2-8,this.offset]],t.style.transform=`translateY(${-this.offset}px)`}pi(t,n),this.dirty=!1}firstUpdated(){this.layout()}updated(t){(t.has("position")||t.has("text"))&&(this.dirty=!0),this._target&&!t.has("for")||this.refreshTarget(),this.dirty&&this.layout()}show(){this.showing||(this.showing=!0,this.shadowRoot.getElementById("container").style.display="",this.updatePosition(),setTimeout(()=>{this.layout()},1))}hide(){this.showing&&(this.showing=!1,this.shadowRoot.getElementById("container").style.display="none")}updatePosition(){if(!this._target||!this.offsetParent)return;const t=this.offset,e=this.offsetParent.getBoundingClientRect(),i=this._target.getBoundingClientRect(),s=this.getBoundingClientRect(),n=(i.width-s.width)/2,r=(i.height-s.height)/2,o=i.left-e.left,a=i.top-e.top;let c,h;switch(this.position){case"top":c=o+n,h=a-s.height-t;break;case"bottom":c=o+n,h=a+i.height+t;break;case"left":c=o-s.width-t,h=a+r;break;case"right":c=o+i.width+t,h=a+r}this.style.left=c+"px",this.style.top=h+"px"}};an([Ve({type:String}),cn("design:type",String)],hn.prototype,"for",void 0),an([Ve({type:String}),cn("design:type",String)],hn.prototype,"text",void 0),an([Ve({type:Number}),cn("design:type",Object)],hn.prototype,"offset",void 0),an([Ve({type:String}),cn("design:type",String)],hn.prototype,"position",void 0),hn=an([Le("wired-tooltip")],hn);const ln=(t,e)=>{const i=t.startNode.parentNode,s=void 0===e?t.endNode:e.startNode,n=i.insertBefore(Kt(),s);i.insertBefore(Kt(),s);const r=new ne(t.options);return r.insertAfterNode(n),r},dn=(t,e)=>(t.setValue(e),t.commit(),t),un=(t,e,i)=>{const s=t.startNode.parentNode,n=i?i.startNode:t.endNode,r=e.endNode.nextSibling;r!==n&&((t,e,i=null,s=null)=>{let n=e;for(;n!==i;){const e=n.nextSibling;t.insertBefore(n,s),n=e}})(s,e.startNode,r,n)},pn=t=>{qt(t.startNode.parentNode,t.startNode,t.endNode.nextSibling)},fn=(t,e,i)=>{const s=new Map;for(let n=e;n<=i;n++)s.set(t[n],n);return s},yn=new WeakMap,bn=new WeakMap,gn=(t=>(...e)=>{const i=t(...e);return Vt.set(i,!0),i})((t,e,i)=>{let s;return void 0===i?i=e:void 0!==e&&(s=e),e=>{if(!(e instanceof ne))throw new Error("repeat can only be used in text bindings");const n=yn.get(e)||[],r=bn.get(e)||[],o=[],a=[],c=[];let h,l,d=0;for(const e of t)c[d]=s?s(e,d):d,a[d]=i(e,d),d++;let u=0,p=n.length-1,f=0,y=a.length-1;for(;u<=p&&f<=y;)if(null===n[u])u++;else if(null===n[p])p--;else if(r[u]===c[f])o[f]=dn(n[u],a[f]),u++,f++;else if(r[p]===c[y])o[y]=dn(n[p],a[y]),p--,y--;else if(r[u]===c[y])o[y]=dn(n[u],a[y]),un(e,n[u],o[y+1]),u++,y--;else if(r[p]===c[f])o[f]=dn(n[p],a[f]),un(e,n[p],n[u]),p--,f++;else if(void 0===h&&(h=fn(c,f,y),l=fn(r,u,p)),h.has(r[u]))if(h.has(r[p])){const t=l.get(c[f]),i=void 0!==t?n[t]:null;if(null===i){const t=ln(e,n[u]);dn(t,a[f]),o[f]=t}else o[f]=dn(i,a[f]),un(e,i,n[u]),n[t]=null;f++}else pn(n[p]),p--;else pn(n[u]),u++;for(;f<=y;){const t=ln(e,o[y+1]);dn(t,a[f]),o[f++]=t}for(;u<=p;){const t=n[u++];null!==t&&pn(t)}yn.set(e,o),bn.set(e,c)}});var mn=function(t,e,i,s){var n,r=arguments.length,o=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,s);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(o=(r<3?n(o):r>3?n(e,i,o):n(e,i))||o);return r>3&&o&&Object.defineProperty(e,i,o),o},vn=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let wn=class extends Ye{constructor(){super(...arguments),this.name="",this.label=""}static get styles(){return Fe`
:host {
display: block;
}
wired-card {
display: block;
}
`}render(){return ye`
<wired-card>
<slot></slot>
</wired-card>
`}relayout(){setTimeout(()=>{this.card&&this.card.requestUpdate()})}};mn([Ve({type:String}),vn("design:type",Object)],wn.prototype,"name",void 0),mn([Ve({type:String}),vn("design:type",Object)],wn.prototype,"label",void 0),mn([Be("wired-card"),vn("design:type",_i)],wn.prototype,"card",void 0),wn=mn([Le("wired-tab")],wn);let xn=class extends Ye{constructor(){super(...arguments),this.pages=[],this.pageMap=new Map}static get styles(){return Fe`
:host {
display: block;
}
.hidden {
display: none !important;
}
::slotted(.hidden) {
display: none !important;
}
:host ::slotted(.hidden) {
display: none !important;
}
#bar {
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
-ms-flex-direction: row;
-webkit-flex-direction: row;
flex-direction: row;
}
`}render(){return ye`
<div id="bar">
${gn(this.pages,t=>t.name,t=>ye`
<wired-item role="tab" .value="${t.name}" .selected="${t.name===this.selected}" ?aria-selected="${t.name===this.selected}"
@click="${()=>this.selected=t.name}">${t.label||t.name}</wired-item>
`)}
</div>
<div>
<slot id="slot" @slotchange="${this.mapPages}"></slot>
</div>
`}mapPages(){if(this.pages=[],this.pageMap.clear(),this.slotElement){const t=this.slotElement.assignedNodes();if(t&&t.length){for(let e=0;e<t.length;e++){const i=t[e];if(i.nodeType===Node.ELEMENT_NODE&&"wired-tab"===i.tagName.toLowerCase()){const t=i;this.pages.push(t);const e=t.getAttribute("name")||"";e&&e.trim().split(" ").forEach(e=>{e&&this.pageMap.set(e,t)})}}this.selected||this.pages.length&&(this.selected=this.pages[0].name),this.requestUpdate()}}}firstUpdated(){this.mapPages(),this.tabIndex=+(this.getAttribute("tabindex")||0),this.addEventListener("keydown",t=>{switch(t.keyCode){case 37:case 38:t.preventDefault(),this.selectPrevious();break;case 39:case 40:t.preventDefault(),this.selectNext()}})}updated(){const t=this.getElement();for(let e=0;e<this.pages.length;e++){const i=this.pages[e];i===t?i.classList.remove("hidden"):i.classList.add("hidden")}this.current=t||void 0,this.current&&this.current.relayout()}getElement(){let t=void 0;return this.selected&&(t=this.pageMap.get(this.selected)),t||(t=this.pages[0]),t||null}selectPrevious(){const t=this.pages;if(t.length){let e=-1;for(let i=0;i<t.length;i++)if(t[i]===this.current){e=i;break}e<0?e=0:0===e?e=t.length-1:e--,this.selected=t[e].name||""}}selectNext(){const t=this.pages;if(t.length){let e=-1;for(let i=0;i<t.length;i++)if(t[i]===this.current){e=i;break}e<0?e=0:e>=t.length-1?e=0:e++,this.selected=t[e].name||""}}};mn([Ve({type:String}),vn("design:type",String)],xn.prototype,"selected",void 0),mn([Be("slot"),vn("design:type",HTMLSlotElement)],xn.prototype,"slotElement",void 0),xn=mn([Le("wired-tabs")],xn);var kn=function(t,e,i,s){var n,r=arguments.length,o=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,s);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(o=(r<3?n(o):r>3?n(e,i,o):n(e,i))||o);return r>3&&o&&Object.defineProperty(e,i,o),o},Sn=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let _n=class extends Ye{constructor(){super(...arguments),this.disabled=!1}static get styles(){return Fe`
:host {
display: -ms-inline-flexbox;
display: -webkit-inline-flex;
display: inline-flex;
-ms-flex-align: center;
-webkit-align-items: center;
align-items: center;
-ms-flex-pack: center;
-webkit-justify-content: center;
justify-content: center;
position: relative;
vertical-align: middle;
padding: 16px;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
cursor: pointer;
z-index: 0;
line-height: 1;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
-webkit-tap-highlight-color: transparent;
box-sizing: border-box !important;
outline: none;
color: #fff;
opacity: 0;
}
:host(.wired-rendered) {
opacity: 1;
}
:host(.wired-disabled) {
opacity: 0.45 !important;
cursor: default;
background: rgba(0, 0, 0, 0.07);
border-radius: 50%;
pointer-events: none;
}
:host(:active) mwc-icon {
opacity: 1;
transform: scale(1.15);
}
:host(:focus) mwc-icon {
opacity: 1;
}
.overlay {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
pointer-events: none;
}
svg {
display: block;
}
path {
stroke: var(--wired-fab-bg-color, #018786);
stroke-width: 3;
fill: transparent;
}
mwc-icon {
position: relative;
font-size: var(--wired-icon-size, 24px);
transition: transform 0.2s ease, opacity 0.2s ease;
opacity: 0.85;
}
`}render(){return ye`
<div class="overlay">
<svg id="svg"></svg>
</div>
<mwc-icon>
<slot></slot>
</mwc-icon>
`}firstUpdated(){this.addEventListener("keydown",t=>{13!==t.keyCode&&32!==t.keyCode||(t.preventDefault(),this.click())}),this.setAttribute("role","button"),this.setAttribute("aria-label",this.textContent||this.innerText),setTimeout(()=>this.requestUpdate())}updated(t){t.has("disabled")&&this.refreshDisabledState();const e=this.shadowRoot.getElementById("svg");for(;e.hasChildNodes();)e.removeChild(e.lastChild);const i=this.getBoundingClientRect(),s=Math.min(i.width,i.height);e.setAttribute("width",`${s}`),e.setAttribute("height",`${s}`);const n=mi(s/2,s/2,s,s);e.appendChild(n),this.classList.add("wired-rendered")}refreshDisabledState(){this.disabled?this.classList.add("wired-disabled"):this.classList.remove("wired-disabled"),this.tabIndex=this.disabled?-1:+(this.getAttribute("tabindex")||0)}};kn([Ve({type:Boolean,reflect:!0}),Sn("design:type",Object)],_n.prototype,"disabled",void 0),_n=kn([Le("wired-fab")],_n);var Cn=function(t,e,i,s){var n,r=arguments.length,o=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,s);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(o=(r<3?n(o):r>3?n(e,i,o):n(e,i))||o);return r>3&&o&&Object.defineProperty(e,i,o),o},En=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let Nn=class extends Ye{constructor(){super(...arguments),this.spinning=!1,this.duration=1500,this.value=0,this.timerstart=0,this.frame=0}static get styles(){return Fe`
:host {
display: inline-block;
position: relative;
opacity: 0;
}
:host(.wired-rendered) {
opacity: 1;
}
#svg {
display: block;
width: 76px;
height: 76px;
}
path {
stroke: currentColor;
stroke-opacity: 0.5;
stroke-width: 1.5;
fill: none;
}
.knob path {
stroke-width: 2.8 !important;
stroke-opacity: 1;
}
`}render(){return ye`
<svg id="svg"></svg>
`}firstUpdated(){this.svg&&(fi(this.svg,38,38,60,60),this.knob=mi(0,0,20,20),this.knob.classList.add("knob"),this.svg.appendChild(this.knob)),this.updateCursor(),this.classList.add("wired-rendered")}updated(){this.spinning?this.startSpinner():this.stopSpinner()}startSpinner(){this.stopSpinner(),this.value=0,this.timerstart=0,this.nextTick()}stopSpinner(){this.frame&&(window.cancelAnimationFrame(this.frame),this.frame=0)}nextTick(){this.frame=window.requestAnimationFrame(t=>this.tick(t))}tick(t){this.spinning?(this.timerstart||(this.timerstart=t),this.value=Math.min(1,(t-this.timerstart)/this.duration),this.updateCursor(),this.value>=1&&(this.value=0,this.timerstart=0),this.nextTick()):this.frame=0}updateCursor(){if(this.knob){const t=[Math.round(38+25*Math.cos(this.value*Math.PI*2)),Math.round(38+25*Math.sin(this.value*Math.PI*2))];this.knob.style.transform=`translate3d(${t[0]}px, ${t[1]}px, 0) rotateZ(${Math.round(360*this.value*2)}deg)`}}};function Rn(t,e,i){const s=Object.create(t);return s.user=e[i],s}function On(t){var e,i,s,n,r,u=t.user.login;return{c(){var t,o;e=h("p"),(i=h("wired-icon-button")).textContent="favorite",s=d(),n=l(u),r=d(),t="--wired-icon-size",o="8px",i.style.setProperty(t,o)},m(t,c){a(t,e,c),o(e,i),o(e,s),o(e,n),o(e,r)},p(t,e){var i,s;t.$users$&&u!==(u=e.user.login)&&(s=""+(s=u),(i=n).data!==s&&(i.data=s))},d(t){t&&c(e)}}}function Pn(e){for(var i,s,n,r,l=e.$users$,u=[],p=0;p<l.length;p+=1)u[p]=On(Rn(e,l,p));return{c(){i=h("wired-card"),(s=h("h1")).textContent="Users list",n=d(),r=h("div");for(var t=0;t<u.length;t+=1)u[t].c();var e,o,a;a="3",(o="elevation")in(e=i)?e[o]=a:function(t,e,i){null==i?t.removeAttribute(e):t.setAttribute(e,i)}(e,o,a)},m(t,e){a(t,i,e),o(i,s),o(i,n),o(i,r);for(var c=0;c<u.length;c+=1)u[c].m(r,null)},p(t,e){if(t.$users$){l=e.$users$;for(var i=0;i<l.length;i+=1){const s=Rn(e,l,i);u[i]?u[i].p(t,s):(u[i]=On(s),u[i].c(),u[i].m(r,null))}for(;i<u.length;i+=1)u[i].d(1);u.length=l.length}},i:t,o:t,d(t){t&&c(i),function(t,e){for(let i=0;i<t.length;i+=1)t[i]&&t[i].d(e)}(u,t)}}}function Mn(t,e,i){let s;const n=ft("https://api.github.com/users?per_page=5").pipe(Dt("response"),function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var i=t[t.length-1];return St(i)?(t.pop(),function(e){return jt(t,e,i)}):function(e){return jt(t,e)}}([]));var r,o;return r=n,o=(t=>{i("$users$",s=t)}),t.$$.on_destroy.push(r.subscribe(o)),f(()=>{document.querySelector("wired-card").requestUpdate()}),{users$:n,$users$:s}}Cn([Ve({type:Boolean}),En("design:type",Object)],Nn.prototype,"spinning",void 0),Cn([Ve({type:Number}),En("design:type",Object)],Nn.prototype,"duration",void 0),Cn([Be("svg"),En("design:type",SVGSVGElement)],Nn.prototype,"svg",void 0),Nn=Cn([Le("wired-spinner")],Nn);return new class extends E{constructor(t){super(),C(this,t,Mn,Pn,r,[])}}({target:document.body,props:{name:"world"}})}();
//# sourceMappingURL=bundle.js.map
{"version":3,"file":"bundle.js","sources":["../node_modules/svelte/internal.mjs","../node_modules/tslib/tslib.es6.js","../node_modules/rxjs/_esm5/internal/util/root.js","../node_modules/rxjs/_esm5/internal/util/isFunction.js","../node_modules/rxjs/_esm5/internal/config.js","../node_modules/rxjs/_esm5/internal/util/hostReportError.js","../node_modules/rxjs/_esm5/internal/Observer.js","../node_modules/rxjs/_esm5/internal/util/isArray.js","../node_modules/rxjs/_esm5/internal/util/isObject.js","../node_modules/rxjs/_esm5/internal/util/UnsubscriptionError.js","../node_modules/rxjs/_esm5/internal/Subscription.js","../node_modules/rxjs/_esm5/internal/symbol/rxSubscriber.js","../node_modules/rxjs/_esm5/internal/Subscriber.js","../node_modules/rxjs/_esm5/internal/symbol/observable.js","../node_modules/rxjs/_esm5/internal/util/noop.js","../node_modules/rxjs/_esm5/internal/Observable.js","../node_modules/rxjs/_esm5/internal/util/toSubscriber.js","../node_modules/rxjs/_esm5/internal/util/canReportError.js","../node_modules/rxjs/_esm5/internal/util/pipe.js","../node_modules/rxjs/_esm5/internal/operators/map.js","../node_modules/rxjs/_esm5/internal/observable/dom/AjaxObservable.js","../node_modules/rxjs/_esm5/internal/observable/dom/ajax.js","../node_modules/rxjs/_esm5/internal/OuterSubscriber.js","../node_modules/rxjs/_esm5/internal/InnerSubscriber.js","../node_modules/rxjs/_esm5/internal/util/subscribeToArray.js","../node_modules/rxjs/_esm5/internal/symbol/iterator.js","../node_modules/rxjs/_esm5/internal/util/isArrayLike.js","../node_modules/rxjs/_esm5/internal/util/isPromise.js","../node_modules/rxjs/_esm5/internal/util/subscribeTo.js","../node_modules/rxjs/_esm5/internal/util/subscribeToObservable.js","../node_modules/rxjs/_esm5/internal/util/subscribeToPromise.js","../node_modules/rxjs/_esm5/internal/util/subscribeToIterable.js","../node_modules/rxjs/_esm5/internal/util/isScheduler.js","../node_modules/rxjs/_esm5/internal/scheduled/scheduleArray.js","../node_modules/rxjs/_esm5/internal/scheduled/scheduled.js","../node_modules/rxjs/_esm5/internal/util/isInteropObservable.js","../node_modules/rxjs/_esm5/internal/scheduled/scheduleObservable.js","../node_modules/rxjs/_esm5/internal/scheduled/schedulePromise.js","../node_modules/rxjs/_esm5/internal/util/isIterable.js","../node_modules/rxjs/_esm5/internal/scheduled/scheduleIterable.js","../node_modules/rxjs/_esm5/internal/observable/of.js","../node_modules/rxjs/_esm5/internal/observable/fromArray.js","../node_modules/rxjs/_esm5/internal/operators/mergeMap.js","../node_modules/rxjs/_esm5/internal/observable/from.js","../node_modules/rxjs/_esm5/internal/util/subscribeToResult.js","../node_modules/rxjs/_esm5/internal/util/identity.js","../node_modules/rxjs/_esm5/internal/operators/concatAll.js","../node_modules/rxjs/_esm5/internal/operators/mergeAll.js","../node_modules/rxjs/_esm5/internal/observable/concat.js","../node_modules/rxjs/_esm5/internal/Subject.js","../node_modules/rxjs/_esm5/internal/operators/refCount.js","../node_modules/rxjs/_esm5/internal/observable/ConnectableObservable.js","../node_modules/rxjs/_esm5/internal/operators/pluck.js","../node_modules/lit-html/lib/directive.js","../node_modules/lit-html/lib/dom.js","../node_modules/lit-html/lib/part.js","../node_modules/lit-html/lib/template.js","../node_modules/lit-html/lib/template-instance.js","../node_modules/lit-html/lib/template-result.js","../node_modules/lit-html/lib/parts.js","../node_modules/lit-html/lib/default-template-processor.js","../node_modules/lit-html/lib/template-factory.js","../node_modules/lit-html/lib/render.js","../node_modules/lit-html/lit-html.js","../node_modules/lit-html/lib/modify-template.js","../node_modules/lit-html/lib/shady-render.js","../node_modules/lit-element/lib/updating-element.js","../node_modules/lit-element/lib/decorators.js","../node_modules/lit-element/lib/css-tag.js","../node_modules/lit-element/lit-element.js","../node_modules/wired-lib/lib/wired-base.js","../node_modules/roughjs/bin/geometry.js","../node_modules/roughjs/bin/utils/hachure.js","../node_modules/roughjs/bin/fillers/filler-utils.js","../node_modules/wired-lib/lib/wired-lib.js","../node_modules/wired-button/lib/wired-button.js","../node_modules/wired-card/lib/wired-card.js","../node_modules/wired-checkbox/lib/wired-checkbox.js","../node_modules/wired-item/lib/wired-item.js","../node_modules/wired-combo/lib/wired-combo.js","../node_modules/lit-html/directives/class-map.js","../node_modules/@material/mwc-icon/mwc-icon-host-css.js","../node_modules/@material/mwc-icon/mwc-icon-font.js","../node_modules/@material/mwc-icon/mwc-icon.js","../node_modules/wired-icon-button/lib/wired-icon-button.js","../node_modules/wired-input/lib/wired-input.js","../node_modules/wired-listbox/lib/wired-listbox.js","../node_modules/wired-progress/lib/wired-progress.js","../node_modules/wired-radio/lib/wired-radio.js","../node_modules/wired-radio-group/lib/wired-radio-group.js","../node_modules/@polymer/polymer/lib/utils/boot.js","../node_modules/@polymer/polymer/lib/utils/async.js","../node_modules/@polymer/polymer/lib/utils/debounce.js","../node_modules/@polymer/polymer/lib/utils/settings.js","../node_modules/@polymer/polymer/lib/utils/resolve-url.js","../node_modules/@polymer/polymer/lib/utils/wrap.js","../node_modules/@polymer/polymer/lib/utils/gestures.js","../node_modules/wired-slider/lib/wired-slider.js","../node_modules/wired-textarea/lib/wired-textarea.js","../node_modules/wired-toggle/lib/wired-toggle.js","../node_modules/wired-tooltip/lib/wired-tooltip.js","../node_modules/lit-html/directives/repeat.js","../node_modules/wired-tabs/lib/wired-tabs.js","../node_modules/wired-fab/lib/wired-fab.js","../node_modules/wired-spinner/lib/wired-spinner.js","../src/App.svelte","../node_modules/rxjs/_esm5/internal/operators/startWith.js","../src/main.js"],"sourcesContent":["function noop() {}\n\nconst identity = x => x;\n\nfunction assign(tar, src) {\n\tfor (const k in src) tar[k] = src[k];\n\treturn tar;\n}\n\nfunction is_promise(value) {\n\treturn value && typeof value.then === 'function';\n}\n\nfunction add_location(element, file, line, column, char) {\n\telement.__svelte_meta = {\n\t\tloc: { file, line, column, char }\n\t};\n}\n\nfunction run(fn) {\n\treturn fn();\n}\n\nfunction blank_object() {\n\treturn Object.create(null);\n}\n\nfunction run_all(fns) {\n\tfns.forEach(run);\n}\n\nfunction is_function(thing) {\n\treturn typeof thing === 'function';\n}\n\nfunction safe_not_equal(a, b) {\n\treturn a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');\n}\n\nfunction not_equal(a, b) {\n\treturn a != a ? b == b : a !== b;\n}\n\nfunction validate_store(store, name) {\n\tif (!store || typeof store.subscribe !== 'function') {\n\t\tthrow new Error(`'${name}' is not a store with a 'subscribe' method`);\n\t}\n}\n\nfunction subscribe(component, store, callback) {\n\tcomponent.$$.on_destroy.push(store.subscribe(callback));\n}\n\nfunction create_slot(definition, ctx, fn) {\n\tif (definition) {\n\t\tconst slot_ctx = get_slot_context(definition, ctx, fn);\n\t\treturn definition[0](slot_ctx);\n\t}\n}\n\nfunction get_slot_context(definition, ctx, fn) {\n\treturn definition[1]\n\t\t? assign({}, assign(ctx.$$scope.ctx, definition[1](fn ? fn(ctx) : {})))\n\t\t: ctx.$$scope.ctx;\n}\n\nfunction get_slot_changes(definition, ctx, changed, fn) {\n\treturn definition[1]\n\t\t? assign({}, assign(ctx.$$scope.changed || {}, definition[1](fn ? fn(changed) : {})))\n\t\t: ctx.$$scope.changed || {};\n}\n\nfunction exclude_internal_props(props) {\n\tconst result = {};\n\tfor (const k in props) if (k[0] !== '$') result[k] = props[k];\n\treturn result;\n}\n\nconst tasks = new Set();\nlet running = false;\n\nfunction run_tasks() {\n\ttasks.forEach(task => {\n\t\tif (!task[0](window.performance.now())) {\n\t\t\ttasks.delete(task);\n\t\t\ttask[1]();\n\t\t}\n\t});\n\n\trunning = tasks.size > 0;\n\tif (running) requestAnimationFrame(run_tasks);\n}\n\nfunction clear_loops() {\n\t// for testing...\n\ttasks.forEach(task => tasks.delete(task));\n\trunning = false;\n}\n\nfunction loop(fn) {\n\tlet task;\n\n\tif (!running) {\n\t\trunning = true;\n\t\trequestAnimationFrame(run_tasks);\n\t}\n\n\treturn {\n\t\tpromise: new Promise(fulfil => {\n\t\t\ttasks.add(task = [fn, fulfil]);\n\t\t}),\n\t\tabort() {\n\t\t\ttasks.delete(task);\n\t\t}\n\t};\n}\n\nfunction append(target, node) {\n\ttarget.appendChild(node);\n}\n\nfunction insert(target, node, anchor) {\n\ttarget.insertBefore(node, anchor);\n}\n\nfunction detach(node) {\n\tnode.parentNode.removeChild(node);\n}\n\nfunction detach_between(before, after) {\n\twhile (before.nextSibling && before.nextSibling !== after) {\n\t\tbefore.parentNode.removeChild(before.nextSibling);\n\t}\n}\n\nfunction detach_before(after) {\n\twhile (after.previousSibling) {\n\t\tafter.parentNode.removeChild(after.previousSibling);\n\t}\n}\n\nfunction detach_after(before) {\n\twhile (before.nextSibling) {\n\t\tbefore.parentNode.removeChild(before.nextSibling);\n\t}\n}\n\nfunction destroy_each(iterations, detaching) {\n\tfor (let i = 0; i < iterations.length; i += 1) {\n\t\tif (iterations[i]) iterations[i].d(detaching);\n\t}\n}\n\nfunction element(name) {\n\treturn document.createElement(name);\n}\n\nfunction svg_element(name) {\n\treturn document.createElementNS('http://www.w3.org/2000/svg', name);\n}\n\nfunction text(data) {\n\treturn document.createTextNode(data);\n}\n\nfunction space() {\n\treturn text(' ');\n}\n\nfunction empty() {\n\treturn text('');\n}\n\nfunction listen(node, event, handler, options) {\n\tnode.addEventListener(event, handler, options);\n\treturn () => node.removeEventListener(event, handler, options);\n}\n\nfunction prevent_default(fn) {\n\treturn function(event) {\n\t\tevent.preventDefault();\n\t\treturn fn.call(this, event);\n\t};\n}\n\nfunction stop_propagation(fn) {\n\treturn function(event) {\n\t\tevent.stopPropagation();\n\t\treturn fn.call(this, event);\n\t};\n}\n\nfunction attr(node, attribute, value) {\n\tif (value == null) node.removeAttribute(attribute);\n\telse node.setAttribute(attribute, value);\n}\n\nfunction set_attributes(node, attributes) {\n\tfor (const key in attributes) {\n\t\tif (key === 'style') {\n\t\t\tnode.style.cssText = attributes[key];\n\t\t} else if (key in node) {\n\t\t\tnode[key] = attributes[key];\n\t\t} else {\n\t\t\tattr(node, key, attributes[key]);\n\t\t}\n\t}\n}\n\nfunction set_custom_element_data(node, prop, value) {\n\tif (prop in node) {\n\t\tnode[prop] = value;\n\t} else {\n\t\tattr(node, prop, value);\n\t}\n}\n\nfunction xlink_attr(node, attribute, value) {\n\tnode.setAttributeNS('http://www.w3.org/1999/xlink', attribute, value);\n}\n\nfunction get_binding_group_value(group) {\n\tconst value = [];\n\tfor (let i = 0; i < group.length; i += 1) {\n\t\tif (group[i].checked) value.push(group[i].__value);\n\t}\n\treturn value;\n}\n\nfunction to_number(value) {\n\treturn value === '' ? undefined : +value;\n}\n\nfunction time_ranges_to_array(ranges) {\n\tconst array = [];\n\tfor (let i = 0; i < ranges.length; i += 1) {\n\t\tarray.push({ start: ranges.start(i), end: ranges.end(i) });\n\t}\n\treturn array;\n}\n\nfunction children(element) {\n\treturn Array.from(element.childNodes);\n}\n\nfunction claim_element(nodes, name, attributes, svg) {\n\tfor (let i = 0; i < nodes.length; i += 1) {\n\t\tconst node = nodes[i];\n\t\tif (node.nodeName === name) {\n\t\t\tfor (let j = 0; j < node.attributes.length; j += 1) {\n\t\t\t\tconst attribute = node.attributes[j];\n\t\t\t\tif (!attributes[attribute.name]) node.removeAttribute(attribute.name);\n\t\t\t}\n\t\t\treturn nodes.splice(i, 1)[0]; // TODO strip unwanted attributes\n\t\t}\n\t}\n\n\treturn svg ? svg_element(name) : element(name);\n}\n\nfunction claim_text(nodes, data) {\n\tfor (let i = 0; i < nodes.length; i += 1) {\n\t\tconst node = nodes[i];\n\t\tif (node.nodeType === 3) {\n\t\t\tnode.data = data;\n\t\t\treturn nodes.splice(i, 1)[0];\n\t\t}\n\t}\n\n\treturn text(data);\n}\n\nfunction set_data(text, data) {\n\tdata = '' + data;\n\tif (text.data !== data) text.data = data;\n}\n\nfunction set_input_type(input, type) {\n\ttry {\n\t\tinput.type = type;\n\t} catch (e) {\n\t\t// do nothing\n\t}\n}\n\nfunction set_style(node, key, value) {\n\tnode.style.setProperty(key, value);\n}\n\nfunction select_option(select, value) {\n\tfor (let i = 0; i < select.options.length; i += 1) {\n\t\tconst option = select.options[i];\n\n\t\tif (option.__value === value) {\n\t\t\toption.selected = true;\n\t\t\treturn;\n\t\t}\n\t}\n}\n\nfunction select_options(select, value) {\n\tfor (let i = 0; i < select.options.length; i += 1) {\n\t\tconst option = select.options[i];\n\t\toption.selected = ~value.indexOf(option.__value);\n\t}\n}\n\nfunction select_value(select) {\n\tconst selected_option = select.querySelector(':checked') || select.options[0];\n\treturn selected_option && selected_option.__value;\n}\n\nfunction select_multiple_value(select) {\n\treturn [].map.call(select.querySelectorAll(':checked'), option => option.__value);\n}\n\nfunction add_resize_listener(element, fn) {\n\tif (getComputedStyle(element).position === 'static') {\n\t\telement.style.position = 'relative';\n\t}\n\n\tconst object = document.createElement('object');\n\tobject.setAttribute('style', 'display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; pointer-events: none; z-index: -1;');\n\tobject.type = 'text/html';\n\n\tlet win;\n\n\tobject.onload = () => {\n\t\twin = object.contentDocument.defaultView;\n\t\twin.addEventListener('resize', fn);\n\t};\n\n\tif (/Trident/.test(navigator.userAgent)) {\n\t\telement.appendChild(object);\n\t\tobject.data = 'about:blank';\n\t} else {\n\t\tobject.data = 'about:blank';\n\t\telement.appendChild(object);\n\t}\n\n\treturn {\n\t\tcancel: () => {\n\t\t\twin && win.removeEventListener && win.removeEventListener('resize', fn);\n\t\t\telement.removeChild(object);\n\t\t}\n\t};\n}\n\nfunction toggle_class(element, name, toggle) {\n\telement.classList[toggle ? 'add' : 'remove'](name);\n}\n\nfunction custom_event(type, detail) {\n\tconst e = document.createEvent('CustomEvent');\n\te.initCustomEvent(type, false, false, detail);\n\treturn e;\n}\n\nlet stylesheet;\nlet active = 0;\nlet current_rules = {};\n\n// https://github.com/darkskyapp/string-hash/blob/master/index.js\nfunction hash(str) {\n\tlet hash = 5381;\n\tlet i = str.length;\n\n\twhile (i--) hash = ((hash << 5) - hash) ^ str.charCodeAt(i);\n\treturn hash >>> 0;\n}\n\nfunction create_rule(node, a, b, duration, delay, ease, fn, uid = 0) {\n\tconst step = 16.666 / duration;\n\tlet keyframes = '{\\n';\n\n\tfor (let p = 0; p <= 1; p += step) {\n\t\tconst t = a + (b - a) * ease(p);\n\t\tkeyframes += p * 100 + `%{${fn(t, 1 - t)}}\\n`;\n\t}\n\n\tconst rule = keyframes + `100% {${fn(b, 1 - b)}}\\n}`;\n\tconst name = `__svelte_${hash(rule)}_${uid}`;\n\n\tif (!current_rules[name]) {\n\t\tif (!stylesheet) {\n\t\t\tconst style = element('style');\n\t\t\tdocument.head.appendChild(style);\n\t\t\tstylesheet = style.sheet;\n\t\t}\n\n\t\tcurrent_rules[name] = true;\n\t\tstylesheet.insertRule(`@keyframes ${name} ${rule}`, stylesheet.cssRules.length);\n\t}\n\n\tconst animation = node.style.animation || '';\n\tnode.style.animation = `${animation ? `${animation}, ` : ``}${name} ${duration}ms linear ${delay}ms 1 both`;\n\n\tactive += 1;\n\treturn name;\n}\n\nfunction delete_rule(node, name) {\n\tnode.style.animation = (node.style.animation || '')\n\t\t.split(', ')\n\t\t.filter(name\n\t\t\t? anim => anim.indexOf(name) < 0 // remove specific animation\n\t\t\t: anim => anim.indexOf('__svelte') === -1 // remove all Svelte animations\n\t\t)\n\t\t.join(', ');\n\n\tif (name && !--active) clear_rules();\n}\n\nfunction clear_rules() {\n\trequestAnimationFrame(() => {\n\t\tif (active) return;\n\t\tlet i = stylesheet.cssRules.length;\n\t\twhile (i--) stylesheet.deleteRule(i);\n\t\tcurrent_rules = {};\n\t});\n}\n\nfunction create_animation(node, from, fn, params) {\n\tif (!from) return noop;\n\n\tconst to = node.getBoundingClientRect();\n\tif (from.left === to.left && from.right === to.right && from.top === to.top && from.bottom === to.bottom) return noop;\n\n\tconst {\n\t\tdelay = 0,\n\t\tduration = 300,\n\t\teasing = identity,\n\t\tstart: start_time = window.performance.now() + delay,\n\t\tend = start_time + duration,\n\t\ttick = noop,\n\t\tcss\n\t} = fn(node, { from, to }, params);\n\n\tlet running = true;\n\tlet started = false;\n\tlet name;\n\n\tconst css_text = node.style.cssText;\n\n\tfunction start() {\n\t\tif (css) {\n\t\t\tif (delay) node.style.cssText = css_text; // TODO create delayed animation instead?\n\t\t\tname = create_rule(node, 0, 1, duration, 0, easing, css);\n\t\t}\n\n\t\tstarted = true;\n\t}\n\n\tfunction stop() {\n\t\tif (css) delete_rule(node, name);\n\t\trunning = false;\n\t}\n\n\tloop(now => {\n\t\tif (!started && now >= start_time) {\n\t\t\tstart();\n\t\t}\n\n\t\tif (started && now >= end) {\n\t\t\ttick(1, 0);\n\t\t\tstop();\n\t\t}\n\n\t\tif (!running) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (started) {\n\t\t\tconst p = now - start_time;\n\t\t\tconst t = 0 + 1 * easing(p / duration);\n\t\t\ttick(t, 1 - t);\n\t\t}\n\n\t\treturn true;\n\t});\n\n\tif (delay) {\n\t\tif (css) node.style.cssText += css(0, 1);\n\t} else {\n\t\tstart();\n\t}\n\n\ttick(0, 1);\n\n\treturn stop;\n}\n\nfunction fix_position(node) {\n\tconst style = getComputedStyle(node);\n\n\tif (style.position !== 'absolute' && style.position !== 'fixed') {\n\t\tconst { width, height } = style;\n\t\tconst a = node.getBoundingClientRect();\n\t\tnode.style.position = 'absolute';\n\t\tnode.style.width = width;\n\t\tnode.style.height = height;\n\t\tconst b = node.getBoundingClientRect();\n\n\t\tif (a.left !== b.left || a.top !== b.top) {\n\t\t\tconst style = getComputedStyle(node);\n\t\t\tconst transform = style.transform === 'none' ? '' : style.transform;\n\n\t\t\tnode.style.transform = `${transform} translate(${a.left - b.left}px, ${a.top - b.top}px)`;\n\t\t}\n\t}\n}\n\nlet current_component;\n\nfunction set_current_component(component) {\n\tcurrent_component = component;\n}\n\nfunction get_current_component() {\n\tif (!current_component) throw new Error(`Function called outside component initialization`);\n\treturn current_component;\n}\n\nfunction beforeUpdate(fn) {\n\tget_current_component().$$.before_render.push(fn);\n}\n\nfunction onMount(fn) {\n\tget_current_component().$$.on_mount.push(fn);\n}\n\nfunction afterUpdate(fn) {\n\tget_current_component().$$.after_render.push(fn);\n}\n\nfunction onDestroy(fn) {\n\tget_current_component().$$.on_destroy.push(fn);\n}\n\nfunction createEventDispatcher() {\n\tconst component = current_component;\n\n\treturn (type, detail) => {\n\t\tconst callbacks = component.$$.callbacks[type];\n\n\t\tif (callbacks) {\n\t\t\t// TODO are there situations where events could be dispatched\n\t\t\t// in a server (non-DOM) environment?\n\t\t\tconst event = custom_event(type, detail);\n\t\t\tcallbacks.slice().forEach(fn => {\n\t\t\t\tfn.call(component, event);\n\t\t\t});\n\t\t}\n\t};\n}\n\nfunction setContext(key, context) {\n\tget_current_component().$$.context.set(key, context);\n}\n\nfunction getContext(key) {\n\treturn get_current_component().$$.context.get(key);\n}\n\n// TODO figure out if we still want to support\n// shorthand events, or if we want to implement\n// a real bubbling mechanism\nfunction bubble(component, event) {\n\tconst callbacks = component.$$.callbacks[event.type];\n\n\tif (callbacks) {\n\t\tcallbacks.slice().forEach(fn => fn(event));\n\t}\n}\n\nconst dirty_components = [];\nconst intros = { enabled: false };\n\nconst resolved_promise = Promise.resolve();\nlet update_scheduled = false;\nconst binding_callbacks = [];\nconst render_callbacks = [];\nconst flush_callbacks = [];\n\nfunction schedule_update() {\n\tif (!update_scheduled) {\n\t\tupdate_scheduled = true;\n\t\tresolved_promise.then(flush);\n\t}\n}\n\nfunction tick() {\n\tschedule_update();\n\treturn resolved_promise;\n}\n\nfunction add_binding_callback(fn) {\n\tbinding_callbacks.push(fn);\n}\n\nfunction add_render_callback(fn) {\n\trender_callbacks.push(fn);\n}\n\nfunction add_flush_callback(fn) {\n\tflush_callbacks.push(fn);\n}\n\nfunction flush() {\n\tconst seen_callbacks = new Set();\n\n\tdo {\n\t\t// first, call beforeUpdate functions\n\t\t// and update components\n\t\twhile (dirty_components.length) {\n\t\t\tconst component = dirty_components.shift();\n\t\t\tset_current_component(component);\n\t\t\tupdate(component.$$);\n\t\t}\n\n\t\twhile (binding_callbacks.length) binding_callbacks.shift()();\n\n\t\t// then, once components are updated, call\n\t\t// afterUpdate functions. This may cause\n\t\t// subsequent updates...\n\t\twhile (render_callbacks.length) {\n\t\t\tconst callback = render_callbacks.pop();\n\t\t\tif (!seen_callbacks.has(callback)) {\n\t\t\t\tcallback();\n\n\t\t\t\t// ...so guard against infinite loops\n\t\t\t\tseen_callbacks.add(callback);\n\t\t\t}\n\t\t}\n\t} while (dirty_components.length);\n\n\twhile (flush_callbacks.length) {\n\t\tflush_callbacks.pop()();\n\t}\n\n\tupdate_scheduled = false;\n}\n\nfunction update($$) {\n\tif ($$.fragment) {\n\t\t$$.update($$.dirty);\n\t\trun_all($$.before_render);\n\t\t$$.fragment.p($$.dirty, $$.ctx);\n\t\t$$.dirty = null;\n\n\t\t$$.after_render.forEach(add_render_callback);\n\t}\n}\n\nlet promise;\n\nfunction wait() {\n\tif (!promise) {\n\t\tpromise = Promise.resolve();\n\t\tpromise.then(() => {\n\t\t\tpromise = null;\n\t\t});\n\t}\n\n\treturn promise;\n}\n\nfunction dispatch(node, direction, kind) {\n\tnode.dispatchEvent(custom_event(`${direction ? 'intro' : 'outro'}${kind}`));\n}\n\nlet outros;\n\nfunction group_outros() {\n\toutros = {\n\t\tremaining: 0,\n\t\tcallbacks: []\n\t};\n}\n\nfunction check_outros() {\n\tif (!outros.remaining) {\n\t\trun_all(outros.callbacks);\n\t}\n}\n\nfunction on_outro(callback) {\n\toutros.callbacks.push(callback);\n}\n\nfunction create_in_transition(node, fn, params) {\n\tlet config = fn(node, params);\n\tlet running = false;\n\tlet animation_name;\n\tlet task;\n\tlet uid = 0;\n\n\tfunction cleanup() {\n\t\tif (animation_name) delete_rule(node, animation_name);\n\t}\n\n\tfunction go() {\n\t\tconst {\n\t\t\tdelay = 0,\n\t\t\tduration = 300,\n\t\t\teasing = identity,\n\t\t\ttick: tick$$1 = noop,\n\t\t\tcss\n\t\t} = config;\n\n\t\tif (css) animation_name = create_rule(node, 0, 1, duration, delay, easing, css, uid++);\n\t\ttick$$1(0, 1);\n\n\t\tconst start_time = window.performance.now() + delay;\n\t\tconst end_time = start_time + duration;\n\n\t\tif (task) task.abort();\n\t\trunning = true;\n\n\t\ttask = loop(now => {\n\t\t\tif (running) {\n\t\t\t\tif (now >= end_time) {\n\t\t\t\t\ttick$$1(1, 0);\n\t\t\t\t\tcleanup();\n\t\t\t\t\treturn running = false;\n\t\t\t\t}\n\n\t\t\t\tif (now >= start_time) {\n\t\t\t\t\tconst t = easing((now - start_time) / duration);\n\t\t\t\t\ttick$$1(t, 1 - t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn running;\n\t\t});\n\t}\n\n\tlet started = false;\n\n\treturn {\n\t\tstart() {\n\t\t\tif (started) return;\n\n\t\t\tdelete_rule(node);\n\n\t\t\tif (typeof config === 'function') {\n\t\t\t\tconfig = config();\n\t\t\t\twait().then(go);\n\t\t\t} else {\n\t\t\t\tgo();\n\t\t\t}\n\t\t},\n\n\t\tinvalidate() {\n\t\t\tstarted = false;\n\t\t},\n\n\t\tend() {\n\t\t\tif (running) {\n\t\t\t\tcleanup();\n\t\t\t\trunning = false;\n\t\t\t}\n\t\t}\n\t};\n}\n\nfunction create_out_transition(node, fn, params) {\n\tlet config = fn(node, params);\n\tlet running = true;\n\tlet animation_name;\n\n\tconst group = outros;\n\n\tgroup.remaining += 1;\n\n\tfunction go() {\n\t\tconst {\n\t\t\tdelay = 0,\n\t\t\tduration = 300,\n\t\t\teasing = identity,\n\t\t\ttick: tick$$1 = noop,\n\t\t\tcss\n\t\t} = config;\n\n\t\tif (css) animation_name = create_rule(node, 1, 0, duration, delay, easing, css);\n\n\t\tconst start_time = window.performance.now() + delay;\n\t\tconst end_time = start_time + duration;\n\n\t\tloop(now => {\n\t\t\tif (running) {\n\t\t\t\tif (now >= end_time) {\n\t\t\t\t\ttick$$1(0, 1);\n\n\t\t\t\t\tif (!--group.remaining) {\n\t\t\t\t\t\t// this will result in `end()` being called,\n\t\t\t\t\t\t// so we don't need to clean up here\n\t\t\t\t\t\trun_all(group.callbacks);\n\t\t\t\t\t}\n\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tif (now >= start_time) {\n\t\t\t\t\tconst t = easing((now - start_time) / duration);\n\t\t\t\t\ttick$$1(1 - t, t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn running;\n\t\t});\n\t}\n\n\tif (typeof config === 'function') {\n\t\twait().then(() => {\n\t\t\tconfig = config();\n\t\t\tgo();\n\t\t});\n\t} else {\n\t\tgo();\n\t}\n\n\treturn {\n\t\tend(reset) {\n\t\t\tif (reset && config.tick) {\n\t\t\t\tconfig.tick(1, 0);\n\t\t\t}\n\n\t\t\tif (running) {\n\t\t\t\tif (animation_name) delete_rule(node, animation_name);\n\t\t\t\trunning = false;\n\t\t\t}\n\t\t}\n\t};\n}\n\nfunction create_bidirectional_transition(node, fn, params, intro) {\n\tlet config = fn(node, params);\n\n\tlet t = intro ? 0 : 1;\n\n\tlet running_program = null;\n\tlet pending_program = null;\n\tlet animation_name = null;\n\n\tfunction clear_animation() {\n\t\tif (animation_name) delete_rule(node, animation_name);\n\t}\n\n\tfunction init(program, duration) {\n\t\tconst d = program.b - t;\n\t\tduration *= Math.abs(d);\n\n\t\treturn {\n\t\t\ta: t,\n\t\t\tb: program.b,\n\t\t\td,\n\t\t\tduration,\n\t\t\tstart: program.start,\n\t\t\tend: program.start + duration,\n\t\t\tgroup: program.group\n\t\t};\n\t}\n\n\tfunction go(b) {\n\t\tconst {\n\t\t\tdelay = 0,\n\t\t\tduration = 300,\n\t\t\teasing = identity,\n\t\t\ttick: tick$$1 = noop,\n\t\t\tcss\n\t\t} = config;\n\n\t\tconst program = {\n\t\t\tstart: window.performance.now() + delay,\n\t\t\tb\n\t\t};\n\n\t\tif (!b) {\n\t\t\tprogram.group = outros;\n\t\t\toutros.remaining += 1;\n\t\t}\n\n\t\tif (running_program) {\n\t\t\tpending_program = program;\n\t\t} else {\n\t\t\t// if this is an intro, and there's a delay, we need to do\n\t\t\t// an initial tick and/or apply CSS animation immediately\n\t\t\tif (css) {\n\t\t\t\tclear_animation();\n\t\t\t\tanimation_name = create_rule(node, t, b, duration, delay, easing, css);\n\t\t\t}\n\n\t\t\tif (b) tick$$1(0, 1);\n\n\t\t\trunning_program = init(program, duration);\n\t\t\tadd_render_callback(() => dispatch(node, b, 'start'));\n\n\t\t\tloop(now => {\n\t\t\t\tif (pending_program && now > pending_program.start) {\n\t\t\t\t\trunning_program = init(pending_program, duration);\n\t\t\t\t\tpending_program = null;\n\n\t\t\t\t\tdispatch(node, running_program.b, 'start');\n\n\t\t\t\t\tif (css) {\n\t\t\t\t\t\tclear_animation();\n\t\t\t\t\t\tanimation_name = create_rule(node, t, running_program.b, running_program.duration, 0, easing, config.css);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (running_program) {\n\t\t\t\t\tif (now >= running_program.end) {\n\t\t\t\t\t\ttick$$1(t = running_program.b, 1 - t);\n\t\t\t\t\t\tdispatch(node, running_program.b, 'end');\n\n\t\t\t\t\t\tif (!pending_program) {\n\t\t\t\t\t\t\t// we're done\n\t\t\t\t\t\t\tif (running_program.b) {\n\t\t\t\t\t\t\t\t// intro — we can tidy up immediately\n\t\t\t\t\t\t\t\tclear_animation();\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// outro — needs to be coordinated\n\t\t\t\t\t\t\t\tif (!--running_program.group.remaining) run_all(running_program.group.callbacks);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\trunning_program = null;\n\t\t\t\t\t}\n\n\t\t\t\t\telse if (now >= running_program.start) {\n\t\t\t\t\t\tconst p = now - running_program.start;\n\t\t\t\t\t\tt = running_program.a + running_program.d * easing(p / running_program.duration);\n\t\t\t\t\t\ttick$$1(t, 1 - t);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn !!(running_program || pending_program);\n\t\t\t});\n\t\t}\n\t}\n\n\treturn {\n\t\trun(b) {\n\t\t\tif (typeof config === 'function') {\n\t\t\t\twait().then(() => {\n\t\t\t\t\tconfig = config();\n\t\t\t\t\tgo(b);\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tgo(b);\n\t\t\t}\n\t\t},\n\n\t\tend() {\n\t\t\tclear_animation();\n\t\t\trunning_program = pending_program = null;\n\t\t}\n\t};\n}\n\nfunction handle_promise(promise, info) {\n\tconst token = info.token = {};\n\n\tfunction update(type, index, key, value) {\n\t\tif (info.token !== token) return;\n\n\t\tinfo.resolved = key && { [key]: value };\n\n\t\tconst child_ctx = assign(assign({}, info.ctx), info.resolved);\n\t\tconst block = type && (info.current = type)(child_ctx);\n\n\t\tif (info.block) {\n\t\t\tif (info.blocks) {\n\t\t\t\tinfo.blocks.forEach((block, i) => {\n\t\t\t\t\tif (i !== index && block) {\n\t\t\t\t\t\tgroup_outros();\n\t\t\t\t\t\ton_outro(() => {\n\t\t\t\t\t\t\tblock.d(1);\n\t\t\t\t\t\t\tinfo.blocks[i] = null;\n\t\t\t\t\t\t});\n\t\t\t\t\t\tblock.o(1);\n\t\t\t\t\t\tcheck_outros();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tinfo.block.d(1);\n\t\t\t}\n\n\t\t\tblock.c();\n\t\t\tif (block.i) block.i(1);\n\t\t\tblock.m(info.mount(), info.anchor);\n\n\t\t\tflush();\n\t\t}\n\n\t\tinfo.block = block;\n\t\tif (info.blocks) info.blocks[index] = block;\n\t}\n\n\tif (is_promise(promise)) {\n\t\tpromise.then(value => {\n\t\t\tupdate(info.then, 1, info.value, value);\n\t\t}, error => {\n\t\t\tupdate(info.catch, 2, info.error, error);\n\t\t});\n\n\t\t// if we previously had a then/catch block, destroy it\n\t\tif (info.current !== info.pending) {\n\t\t\tupdate(info.pending, 0);\n\t\t\treturn true;\n\t\t}\n\t} else {\n\t\tif (info.current !== info.then) {\n\t\t\tupdate(info.then, 1, info.value, promise);\n\t\t\treturn true;\n\t\t}\n\n\t\tinfo.resolved = { [info.value]: promise };\n\t}\n}\n\nfunction destroy_block(block, lookup) {\n\tblock.d(1);\n\tlookup.delete(block.key);\n}\n\nfunction outro_and_destroy_block(block, lookup) {\n\ton_outro(() => {\n\t\tdestroy_block(block, lookup);\n\t});\n\n\tblock.o(1);\n}\n\nfunction fix_and_outro_and_destroy_block(block, lookup) {\n\tblock.f();\n\toutro_and_destroy_block(block, lookup);\n}\n\nfunction update_keyed_each(old_blocks, changed, get_key, dynamic, ctx, list, lookup, node, destroy, create_each_block, next, get_context) {\n\tlet o = old_blocks.length;\n\tlet n = list.length;\n\n\tlet i = o;\n\tconst old_indexes = {};\n\twhile (i--) old_indexes[old_blocks[i].key] = i;\n\n\tconst new_blocks = [];\n\tconst new_lookup = new Map();\n\tconst deltas = new Map();\n\n\ti = n;\n\twhile (i--) {\n\t\tconst child_ctx = get_context(ctx, list, i);\n\t\tconst key = get_key(child_ctx);\n\t\tlet block = lookup.get(key);\n\n\t\tif (!block) {\n\t\t\tblock = create_each_block(key, child_ctx);\n\t\t\tblock.c();\n\t\t} else if (dynamic) {\n\t\t\tblock.p(changed, child_ctx);\n\t\t}\n\n\t\tnew_lookup.set(key, new_blocks[i] = block);\n\n\t\tif (key in old_indexes) deltas.set(key, Math.abs(i - old_indexes[key]));\n\t}\n\n\tconst will_move = new Set();\n\tconst did_move = new Set();\n\n\tfunction insert(block) {\n\t\tif (block.i) block.i(1);\n\t\tblock.m(node, next);\n\t\tlookup.set(block.key, block);\n\t\tnext = block.first;\n\t\tn--;\n\t}\n\n\twhile (o && n) {\n\t\tconst new_block = new_blocks[n - 1];\n\t\tconst old_block = old_blocks[o - 1];\n\t\tconst new_key = new_block.key;\n\t\tconst old_key = old_block.key;\n\n\t\tif (new_block === old_block) {\n\t\t\t// do nothing\n\t\t\tnext = new_block.first;\n\t\t\to--;\n\t\t\tn--;\n\t\t}\n\n\t\telse if (!new_lookup.has(old_key)) {\n\t\t\t// remove old block\n\t\t\tdestroy(old_block, lookup);\n\t\t\to--;\n\t\t}\n\n\t\telse if (!lookup.has(new_key) || will_move.has(new_key)) {\n\t\t\tinsert(new_block);\n\t\t}\n\n\t\telse if (did_move.has(old_key)) {\n\t\t\to--;\n\n\t\t} else if (deltas.get(new_key) > deltas.get(old_key)) {\n\t\t\tdid_move.add(new_key);\n\t\t\tinsert(new_block);\n\n\t\t} else {\n\t\t\twill_move.add(old_key);\n\t\t\to--;\n\t\t}\n\t}\n\n\twhile (o--) {\n\t\tconst old_block = old_blocks[o];\n\t\tif (!new_lookup.has(old_block.key)) destroy(old_block, lookup);\n\t}\n\n\twhile (n) insert(new_blocks[n - 1]);\n\n\treturn new_blocks;\n}\n\nfunction measure(blocks) {\n\tconst rects = {};\n\tlet i = blocks.length;\n\twhile (i--) rects[blocks[i].key] = blocks[i].node.getBoundingClientRect();\n\treturn rects;\n}\n\nfunction get_spread_update(levels, updates) {\n\tconst update = {};\n\n\tconst to_null_out = {};\n\tconst accounted_for = {};\n\n\tlet i = levels.length;\n\twhile (i--) {\n\t\tconst o = levels[i];\n\t\tconst n = updates[i];\n\n\t\tif (n) {\n\t\t\tfor (const key in o) {\n\t\t\t\tif (!(key in n)) to_null_out[key] = 1;\n\t\t\t}\n\n\t\t\tfor (const key in n) {\n\t\t\t\tif (!accounted_for[key]) {\n\t\t\t\t\tupdate[key] = n[key];\n\t\t\t\t\taccounted_for[key] = 1;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlevels[i] = n;\n\t\t} else {\n\t\t\tfor (const key in o) {\n\t\t\t\taccounted_for[key] = 1;\n\t\t\t}\n\t\t}\n\t}\n\n\tfor (const key in to_null_out) {\n\t\tif (!(key in update)) update[key] = undefined;\n\t}\n\n\treturn update;\n}\n\nconst invalid_attribute_name_character = /[\\s'\">/=\\u{FDD0}-\\u{FDEF}\\u{FFFE}\\u{FFFF}\\u{1FFFE}\\u{1FFFF}\\u{2FFFE}\\u{2FFFF}\\u{3FFFE}\\u{3FFFF}\\u{4FFFE}\\u{4FFFF}\\u{5FFFE}\\u{5FFFF}\\u{6FFFE}\\u{6FFFF}\\u{7FFFE}\\u{7FFFF}\\u{8FFFE}\\u{8FFFF}\\u{9FFFE}\\u{9FFFF}\\u{AFFFE}\\u{AFFFF}\\u{BFFFE}\\u{BFFFF}\\u{CFFFE}\\u{CFFFF}\\u{DFFFE}\\u{DFFFF}\\u{EFFFE}\\u{EFFFF}\\u{FFFFE}\\u{FFFFF}\\u{10FFFE}\\u{10FFFF}]/u;\n// https://html.spec.whatwg.org/multipage/syntax.html#attributes-2\n// https://infra.spec.whatwg.org/#noncharacter\n\nfunction spread(args) {\n\tconst attributes = Object.assign({}, ...args);\n\tlet str = '';\n\n\tObject.keys(attributes).forEach(name => {\n\t\tif (invalid_attribute_name_character.test(name)) return;\n\n\t\tconst value = attributes[name];\n\t\tif (value === undefined) return;\n\t\tif (value === true) str += \" \" + name;\n\n\t\tconst escaped = String(value)\n\t\t\t.replace(/\"/g, '&#34;')\n\t\t\t.replace(/'/g, '&#39;');\n\n\t\tstr += \" \" + name + \"=\" + JSON.stringify(escaped);\n\t});\n\n\treturn str;\n}\n\nconst escaped = {\n\t'\"': '&quot;',\n\t\"'\": '&#39;',\n\t'&': '&amp;',\n\t'<': '&lt;',\n\t'>': '&gt;'\n};\n\nfunction escape(html) {\n\treturn String(html).replace(/[\"'&<>]/g, match => escaped[match]);\n}\n\nfunction each(items, fn) {\n\tlet str = '';\n\tfor (let i = 0; i < items.length; i += 1) {\n\t\tstr += fn(items[i], i);\n\t}\n\treturn str;\n}\n\nconst missing_component = {\n\t$$render: () => ''\n};\n\nfunction validate_component(component, name) {\n\tif (!component || !component.$$render) {\n\t\tif (name === 'svelte:component') name += ' this={...}';\n\t\tthrow new Error(`<${name}> is not a valid SSR component. You may need to review your build config to ensure that dependencies are compiled, rather than imported as pre-compiled modules`);\n\t}\n\n\treturn component;\n}\n\nfunction debug(file, line, column, values) {\n\tconsole.log(`{@debug} ${file ? file + ' ' : ''}(${line}:${column})`); // eslint-disable-line no-console\n\tconsole.log(values); // eslint-disable-line no-console\n\treturn '';\n}\n\nlet on_destroy;\n\nfunction create_ssr_component(fn) {\n\tfunction $$render(result, props, bindings, slots) {\n\t\tconst parent_component = current_component;\n\n\t\tconst $$ = {\n\t\t\ton_destroy,\n\t\t\tcontext: new Map(parent_component ? parent_component.$$.context : []),\n\n\t\t\t// these will be immediately discarded\n\t\t\ton_mount: [],\n\t\t\tbefore_render: [],\n\t\t\tafter_render: [],\n\t\t\tcallbacks: blank_object()\n\t\t};\n\n\t\tset_current_component({ $$ });\n\n\t\tconst html = fn(result, props, bindings, slots);\n\n\t\tset_current_component(parent_component);\n\t\treturn html;\n\t}\n\n\treturn {\n\t\trender: (props = {}, options = {}) => {\n\t\t\ton_destroy = [];\n\n\t\t\tconst result = { head: '', css: new Set() };\n\t\t\tconst html = $$render(result, props, {}, options);\n\n\t\t\trun_all(on_destroy);\n\n\t\t\treturn {\n\t\t\t\thtml,\n\t\t\t\tcss: {\n\t\t\t\t\tcode: Array.from(result.css).map(css => css.code).join('\\n'),\n\t\t\t\t\tmap: null // TODO\n\t\t\t\t},\n\t\t\t\thead: result.head\n\t\t\t};\n\t\t},\n\n\t\t$$render\n\t};\n}\n\nfunction get_store_value(store) {\n\tlet value;\n\tstore.subscribe(_ => value = _)();\n\treturn value;\n}\n\nfunction bind(component, name, callback) {\n\tif (component.$$.props.indexOf(name) === -1) return;\n\tcomponent.$$.bound[name] = callback;\n\tcallback(component.$$.ctx[name]);\n}\n\nfunction mount_component(component, target, anchor) {\n\tconst { fragment, on_mount, on_destroy, after_render } = component.$$;\n\n\tfragment.m(target, anchor);\n\n\t// onMount happens after the initial afterUpdate. Because\n\t// afterUpdate callbacks happen in reverse order (inner first)\n\t// we schedule onMount callbacks before afterUpdate callbacks\n\tadd_render_callback(() => {\n\t\tconst new_on_destroy = on_mount.map(run).filter(is_function);\n\t\tif (on_destroy) {\n\t\t\ton_destroy.push(...new_on_destroy);\n\t\t} else {\n\t\t\t// Edge case - component was destroyed immediately,\n\t\t\t// most likely as a result of a binding initialising\n\t\t\trun_all(new_on_destroy);\n\t\t}\n\t\tcomponent.$$.on_mount = [];\n\t});\n\n\tafter_render.forEach(add_render_callback);\n}\n\nfunction destroy(component, detaching) {\n\tif (component.$$) {\n\t\trun_all(component.$$.on_destroy);\n\t\tcomponent.$$.fragment.d(detaching);\n\n\t\t// TODO null out other refs, including component.$$ (but need to\n\t\t// preserve final state?)\n\t\tcomponent.$$.on_destroy = component.$$.fragment = null;\n\t\tcomponent.$$.ctx = {};\n\t}\n}\n\nfunction make_dirty(component, key) {\n\tif (!component.$$.dirty) {\n\t\tdirty_components.push(component);\n\t\tschedule_update();\n\t\tcomponent.$$.dirty = {};\n\t}\n\tcomponent.$$.dirty[key] = true;\n}\n\nfunction init(component, options, instance, create_fragment, not_equal$$1, prop_names) {\n\tconst parent_component = current_component;\n\tset_current_component(component);\n\n\tconst props = options.props || {};\n\n\tconst $$ = component.$$ = {\n\t\tfragment: null,\n\t\tctx: null,\n\n\t\t// state\n\t\tprops: prop_names,\n\t\tupdate: noop,\n\t\tnot_equal: not_equal$$1,\n\t\tbound: blank_object(),\n\n\t\t// lifecycle\n\t\ton_mount: [],\n\t\ton_destroy: [],\n\t\tbefore_render: [],\n\t\tafter_render: [],\n\t\tcontext: new Map(parent_component ? parent_component.$$.context : []),\n\n\t\t// everything else\n\t\tcallbacks: blank_object(),\n\t\tdirty: null\n\t};\n\n\tlet ready = false;\n\n\t$$.ctx = instance\n\t\t? instance(component, props, (key, value) => {\n\t\t\tif ($$.ctx && not_equal$$1($$.ctx[key], $$.ctx[key] = value)) {\n\t\t\t\tif ($$.bound[key]) $$.bound[key](value);\n\t\t\t\tif (ready) make_dirty(component, key);\n\t\t\t}\n\t\t})\n\t\t: props;\n\n\t$$.update();\n\tready = true;\n\trun_all($$.before_render);\n\t$$.fragment = create_fragment($$.ctx);\n\n\tif (options.target) {\n\t\tif (options.hydrate) {\n\t\t\t$$.fragment.l(children(options.target));\n\t\t} else {\n\t\t\t$$.fragment.c();\n\t\t}\n\n\t\tif (options.intro && component.$$.fragment.i) component.$$.fragment.i();\n\t\tmount_component(component, options.target, options.anchor);\n\t\tflush();\n\t}\n\n\tset_current_component(parent_component);\n}\n\nlet SvelteElement;\nif (typeof HTMLElement !== 'undefined') {\n\tSvelteElement = class extends HTMLElement {\n\t\tconstructor() {\n\t\t\tsuper();\n\t\t\tthis.attachShadow({ mode: 'open' });\n\t\t}\n\n\t\tconnectedCallback() {\n\t\t\tfor (const key in this.$$.slotted) {\n\t\t\t\tthis.appendChild(this.$$.slotted[key]);\n\t\t\t}\n\t\t}\n\n\t\tattributeChangedCallback(attr$$1, oldValue, newValue) {\n\t\t\tthis[attr$$1] = newValue;\n\t\t}\n\n\t\t$destroy() {\n\t\t\tdestroy(this, true);\n\t\t\tthis.$destroy = noop;\n\t\t}\n\n\t\t$on(type, callback) {\n\t\t\t// TODO should this delegate to addEventListener?\n\t\t\tconst callbacks = (this.$$.callbacks[type] || (this.$$.callbacks[type] = []));\n\t\t\tcallbacks.push(callback);\n\n\t\t\treturn () => {\n\t\t\t\tconst index = callbacks.indexOf(callback);\n\t\t\t\tif (index !== -1) callbacks.splice(index, 1);\n\t\t\t};\n\t\t}\n\n\t\t$set() {\n\t\t\t// overridden by instance, if it has props\n\t\t}\n\t};\n}\n\nclass SvelteComponent {\n\t$destroy() {\n\t\tdestroy(this, true);\n\t\tthis.$destroy = noop;\n\t}\n\n\t$on(type, callback) {\n\t\tconst callbacks = (this.$$.callbacks[type] || (this.$$.callbacks[type] = []));\n\t\tcallbacks.push(callback);\n\n\t\treturn () => {\n\t\t\tconst index = callbacks.indexOf(callback);\n\t\t\tif (index !== -1) callbacks.splice(index, 1);\n\t\t};\n\t}\n\n\t$set() {\n\t\t// overridden by instance, if it has props\n\t}\n}\n\nclass SvelteComponentDev extends SvelteComponent {\n\tconstructor(options) {\n\t\tif (!options || (!options.target && !options.$$inline)) {\n\t\t\tthrow new Error(`'target' is a required option`);\n\t\t}\n\n\t\tsuper();\n\t}\n\n\t$destroy() {\n\t\tsuper.$destroy();\n\t\tthis.$destroy = () => {\n\t\t\tconsole.warn(`Component was already destroyed`); // eslint-disable-line no-console\n\t\t};\n\t}\n}\n\nexport { create_animation, fix_position, handle_promise, append, insert, detach, detach_between, detach_before, detach_after, destroy_each, element, svg_element, text, space, empty, listen, prevent_default, stop_propagation, attr, set_attributes, set_custom_element_data, xlink_attr, get_binding_group_value, to_number, time_ranges_to_array, children, claim_element, claim_text, set_data, set_input_type, set_style, select_option, select_options, select_value, select_multiple_value, add_resize_listener, toggle_class, custom_event, destroy_block, outro_and_destroy_block, fix_and_outro_and_destroy_block, update_keyed_each, measure, current_component, set_current_component, beforeUpdate, onMount, afterUpdate, onDestroy, createEventDispatcher, setContext, getContext, bubble, clear_loops, loop, dirty_components, intros, schedule_update, tick, add_binding_callback, add_render_callback, add_flush_callback, flush, get_spread_update, invalid_attribute_name_character, spread, escaped, escape, each, missing_component, validate_component, debug, create_ssr_component, get_store_value, group_outros, check_outros, on_outro, create_in_transition, create_out_transition, create_bidirectional_transition, noop, identity, assign, is_promise, add_location, run, blank_object, run_all, is_function, safe_not_equal, not_equal, validate_store, subscribe, create_slot, get_slot_context, get_slot_changes, exclude_internal_props, bind, mount_component, init, SvelteElement, SvelteComponent, SvelteComponentDev };\n","/*! *****************************************************************************\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 */\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","/** 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 = 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 */\nfunction 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}\nUnsubscriptionErrorImpl.prototype = /*@__PURE__*/ Object.create(Error.prototype);\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 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 if (!teardown) {\n return Subscription.EMPTY;\n }\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 = typeof Symbol === 'function'\n ? /*@__PURE__*/ Symbol('rxSubscriber')\n : '@@rxSubscriber_' + /*@__PURE__*/ Math.random();\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 = 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 _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 _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 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 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 };\nfunction 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}\nAjaxErrorImpl.prototype = /*@__PURE__*/ Object.create(Error.prototype);\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 = 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';\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,_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 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 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 PURE_IMPORTS_END */\nexport function isScheduler(value) {\n return value && typeof value.schedule === 'function';\n}\n//# sourceMappingURL=isScheduler.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 _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 _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,_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 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 _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 _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 PURE_IMPORTS_END */\nexport function identity(x) {\n return x;\n}\n//# sourceMappingURL=identity.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 _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 _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 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 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 };\nvar connectableProto = ConnectableObservable.prototype;\nexport var connectableObservableDescriptor = {\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};\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 _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","/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\nconst directives = new WeakMap();\n/**\n * Brands a function as a directive so that lit-html will call the function\n * during template rendering, rather than passing as a value.\n *\n * @param f The directive factory function. Must be a function that returns a\n * function of the signature `(part: Part) => void`. The returned function will\n * be called with the part object\n *\n * @example\n *\n * ```\n * import {directive, html} from 'lit-html';\n *\n * const immutable = directive((v) => (part) => {\n * if (part.value !== v) {\n * part.setValue(v)\n * }\n * });\n * ```\n */\n// tslint:disable-next-line:no-any\nexport const directive = (f) => ((...args) => {\n const d = f(...args);\n directives.set(d, true);\n return d;\n});\nexport const isDirective = (o) => {\n return typeof o === 'function' && directives.has(o);\n};\n//# sourceMappingURL=directive.js.map","/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\n/**\n * True if the custom elements polyfill is in use.\n */\nexport const isCEPolyfill = window.customElements !== undefined &&\n window.customElements.polyfillWrapFlushCallback !==\n undefined;\n/**\n * Reparents nodes, starting from `startNode` (inclusive) to `endNode`\n * (exclusive), into another container (could be the same container), before\n * `beforeNode`. If `beforeNode` is null, it appends the nodes to the\n * container.\n */\nexport const reparentNodes = (container, start, end = null, before = null) => {\n let node = start;\n while (node !== end) {\n const n = node.nextSibling;\n container.insertBefore(node, before);\n node = n;\n }\n};\n/**\n * Removes nodes, starting from `startNode` (inclusive) to `endNode`\n * (exclusive), from `container`.\n */\nexport const removeNodes = (container, startNode, endNode = null) => {\n let node = startNode;\n while (node !== endNode) {\n const n = node.nextSibling;\n container.removeChild(node);\n node = n;\n }\n};\n//# sourceMappingURL=dom.js.map","/**\n * @license\n * Copyright (c) 2018 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\n/**\n * A sentinel value that signals that a value was handled by a directive and\n * should not be written to the DOM.\n */\nexport const noChange = {};\n/**\n * A sentinel value that signals a NodePart to fully clear its content.\n */\nexport const nothing = {};\n//# sourceMappingURL=part.js.map","/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\n/**\n * An expression marker with embedded unique key to avoid collision with\n * possible text in templates.\n */\nexport const marker = `{{lit-${String(Math.random()).slice(2)}}}`;\n/**\n * An expression marker used text-positions, multi-binding attributes, and\n * attributes with markup-like text values.\n */\nexport const nodeMarker = `<!--${marker}-->`;\nexport const markerRegex = new RegExp(`${marker}|${nodeMarker}`);\n/**\n * Suffix appended to all bound attribute names.\n */\nexport const boundAttributeSuffix = '$lit$';\n/**\n * An updateable Template that tracks the location of dynamic parts.\n */\nexport class Template {\n constructor(result, element) {\n this.parts = [];\n this.element = element;\n let index = -1;\n let partIndex = 0;\n const nodesToRemove = [];\n const _prepareTemplate = (template) => {\n const content = template.content;\n // Edge needs all 4 parameters present; IE11 needs 3rd parameter to be\n // null\n const walker = document.createTreeWalker(content, 133 /* NodeFilter.SHOW_{ELEMENT|COMMENT|TEXT} */, null, false);\n // Keeps track of the last index associated with a part. We try to delete\n // unnecessary nodes, but we never want to associate two different parts\n // to the same index. They must have a constant node between.\n let lastPartIndex = 0;\n while (walker.nextNode()) {\n index++;\n const node = walker.currentNode;\n if (node.nodeType === 1 /* Node.ELEMENT_NODE */) {\n if (node.hasAttributes()) {\n const attributes = node.attributes;\n // Per\n // https://developer.mozilla.org/en-US/docs/Web/API/NamedNodeMap,\n // attributes are not guaranteed to be returned in document order.\n // In particular, Edge/IE can return them out of order, so we cannot\n // assume a correspondance between part index and attribute index.\n let count = 0;\n for (let i = 0; i < attributes.length; i++) {\n if (attributes[i].value.indexOf(marker) >= 0) {\n count++;\n }\n }\n while (count-- > 0) {\n // Get the template literal section leading up to the first\n // expression in this attribute\n const stringForPart = result.strings[partIndex];\n // Find the attribute name\n const name = lastAttributeNameRegex.exec(stringForPart)[2];\n // Find the corresponding attribute\n // All bound attributes have had a suffix added in\n // TemplateResult#getHTML to opt out of special attribute\n // handling. To look up the attribute value we also need to add\n // the suffix.\n const attributeLookupName = name.toLowerCase() + boundAttributeSuffix;\n const attributeValue = node.getAttribute(attributeLookupName);\n const strings = attributeValue.split(markerRegex);\n this.parts.push({ type: 'attribute', index, name, strings });\n node.removeAttribute(attributeLookupName);\n partIndex += strings.length - 1;\n }\n }\n if (node.tagName === 'TEMPLATE') {\n _prepareTemplate(node);\n }\n }\n else if (node.nodeType === 3 /* Node.TEXT_NODE */) {\n const data = node.data;\n if (data.indexOf(marker) >= 0) {\n const parent = node.parentNode;\n const strings = data.split(markerRegex);\n const lastIndex = strings.length - 1;\n // Generate a new text node for each literal section\n // These nodes are also used as the markers for node parts\n for (let i = 0; i < lastIndex; i++) {\n parent.insertBefore((strings[i] === '') ? createMarker() :\n document.createTextNode(strings[i]), node);\n this.parts.push({ type: 'node', index: ++index });\n }\n // If there's no text, we must insert a comment to mark our place.\n // Else, we can trust it will stick around after cloning.\n if (strings[lastIndex] === '') {\n parent.insertBefore(createMarker(), node);\n nodesToRemove.push(node);\n }\n else {\n node.data = strings[lastIndex];\n }\n // We have a part for each match found\n partIndex += lastIndex;\n }\n }\n else if (node.nodeType === 8 /* Node.COMMENT_NODE */) {\n if (node.data === marker) {\n const parent = node.parentNode;\n // Add a new marker node to be the startNode of the Part if any of\n // the following are true:\n // * We don't have a previousSibling\n // * The previousSibling is already the start of a previous part\n if (node.previousSibling === null || index === lastPartIndex) {\n index++;\n parent.insertBefore(createMarker(), node);\n }\n lastPartIndex = index;\n this.parts.push({ type: 'node', index });\n // If we don't have a nextSibling, keep this node so we have an end.\n // Else, we can remove it to save future costs.\n if (node.nextSibling === null) {\n node.data = '';\n }\n else {\n nodesToRemove.push(node);\n index--;\n }\n partIndex++;\n }\n else {\n let i = -1;\n while ((i = node.data.indexOf(marker, i + 1)) !==\n -1) {\n // Comment node has a binding marker inside, make an inactive part\n // The binding won't work, but subsequent bindings will\n // TODO (justinfagnani): consider whether it's even worth it to\n // make bindings in comments work\n this.parts.push({ type: 'node', index: -1 });\n }\n }\n }\n }\n };\n _prepareTemplate(element);\n // Remove text binding nodes after the walk to not disturb the TreeWalker\n for (const n of nodesToRemove) {\n n.parentNode.removeChild(n);\n }\n }\n}\nexport const isTemplatePartActive = (part) => part.index !== -1;\n// Allows `document.createComment('')` to be renamed for a\n// small manual size-savings.\nexport const createMarker = () => document.createComment('');\n/**\n * This regex extracts the attribute name preceding an attribute-position\n * expression. It does this by matching the syntax allowed for attributes\n * against the string literal directly preceding the expression, assuming that\n * the expression is in an attribute-value position.\n *\n * See attributes in the HTML spec:\n * https://www.w3.org/TR/html5/syntax.html#attributes-0\n *\n * \"\\0-\\x1F\\x7F-\\x9F\" are Unicode control characters\n *\n * \" \\x09\\x0a\\x0c\\x0d\" are HTML space characters:\n * https://www.w3.org/TR/html5/infrastructure.html#space-character\n *\n * So an attribute is:\n * * The name: any character except a control character, space character, ('),\n * (\"), \">\", \"=\", or \"/\"\n * * Followed by zero or more space characters\n * * Followed by \"=\"\n * * Followed by zero or more space characters\n * * Followed by:\n * * Any character except space, ('), (\"), \"<\", \">\", \"=\", (`), or\n * * (\") then any non-(\"), or\n * * (') then any non-(')\n */\nexport const lastAttributeNameRegex = /([ \\x09\\x0a\\x0c\\x0d])([^\\0-\\x1F\\x7F-\\x9F \\x09\\x0a\\x0c\\x0d\"'>=/]+)([ \\x09\\x0a\\x0c\\x0d]*=[ \\x09\\x0a\\x0c\\x0d]*(?:[^ \\x09\\x0a\\x0c\\x0d\"'`<>=]*|\"[^\"]*|'[^']*))$/;\n//# sourceMappingURL=template.js.map","/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\n/**\n * @module lit-html\n */\nimport { isCEPolyfill } from './dom.js';\nimport { isTemplatePartActive } from './template.js';\n/**\n * An instance of a `Template` that can be attached to the DOM and updated\n * with new values.\n */\nexport class TemplateInstance {\n constructor(template, processor, options) {\n this._parts = [];\n this.template = template;\n this.processor = processor;\n this.options = options;\n }\n update(values) {\n let i = 0;\n for (const part of this._parts) {\n if (part !== undefined) {\n part.setValue(values[i]);\n }\n i++;\n }\n for (const part of this._parts) {\n if (part !== undefined) {\n part.commit();\n }\n }\n }\n _clone() {\n // When using the Custom Elements polyfill, clone the node, rather than\n // importing it, to keep the fragment in the template's document. This\n // leaves the fragment inert so custom elements won't upgrade and\n // potentially modify their contents by creating a polyfilled ShadowRoot\n // while we traverse the tree.\n const fragment = isCEPolyfill ?\n this.template.element.content.cloneNode(true) :\n document.importNode(this.template.element.content, true);\n const parts = this.template.parts;\n let partIndex = 0;\n let nodeIndex = 0;\n const _prepareInstance = (fragment) => {\n // Edge needs all 4 parameters present; IE11 needs 3rd parameter to be\n // null\n const walker = document.createTreeWalker(fragment, 133 /* NodeFilter.SHOW_{ELEMENT|COMMENT|TEXT} */, null, false);\n let node = walker.nextNode();\n // Loop through all the nodes and parts of a template\n while (partIndex < parts.length && node !== null) {\n const part = parts[partIndex];\n // Consecutive Parts may have the same node index, in the case of\n // multiple bound attributes on an element. So each iteration we either\n // increment the nodeIndex, if we aren't on a node with a part, or the\n // partIndex if we are. By not incrementing the nodeIndex when we find a\n // part, we allow for the next part to be associated with the current\n // node if neccessasry.\n if (!isTemplatePartActive(part)) {\n this._parts.push(undefined);\n partIndex++;\n }\n else if (nodeIndex === part.index) {\n if (part.type === 'node') {\n const part = this.processor.handleTextExpression(this.options);\n part.insertAfterNode(node.previousSibling);\n this._parts.push(part);\n }\n else {\n this._parts.push(...this.processor.handleAttributeExpressions(node, part.name, part.strings, this.options));\n }\n partIndex++;\n }\n else {\n nodeIndex++;\n if (node.nodeName === 'TEMPLATE') {\n _prepareInstance(node.content);\n }\n node = walker.nextNode();\n }\n }\n };\n _prepareInstance(fragment);\n if (isCEPolyfill) {\n document.adoptNode(fragment);\n customElements.upgrade(fragment);\n }\n return fragment;\n }\n}\n//# sourceMappingURL=template-instance.js.map","/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\n/**\n * @module lit-html\n */\nimport { reparentNodes } from './dom.js';\nimport { boundAttributeSuffix, lastAttributeNameRegex, marker, nodeMarker } from './template.js';\n/**\n * The return type of `html`, which holds a Template and the values from\n * interpolated expressions.\n */\nexport class TemplateResult {\n constructor(strings, values, type, processor) {\n this.strings = strings;\n this.values = values;\n this.type = type;\n this.processor = processor;\n }\n /**\n * Returns a string of HTML used to create a `<template>` element.\n */\n getHTML() {\n const endIndex = this.strings.length - 1;\n let html = '';\n for (let i = 0; i < endIndex; i++) {\n const s = this.strings[i];\n // This exec() call does two things:\n // 1) Appends a suffix to the bound attribute name to opt out of special\n // attribute value parsing that IE11 and Edge do, like for style and\n // many SVG attributes. The Template class also appends the same suffix\n // when looking up attributes to create Parts.\n // 2) Adds an unquoted-attribute-safe marker for the first expression in\n // an attribute. Subsequent attribute expressions will use node markers,\n // and this is safe since attributes with multiple expressions are\n // guaranteed to be quoted.\n const match = lastAttributeNameRegex.exec(s);\n if (match) {\n // We're starting a new bound attribute.\n // Add the safe attribute suffix, and use unquoted-attribute-safe\n // marker.\n html += s.substr(0, match.index) + match[1] + match[2] +\n boundAttributeSuffix + match[3] + marker;\n }\n else {\n // We're either in a bound node, or trailing bound attribute.\n // Either way, nodeMarker is safe to use.\n html += s + nodeMarker;\n }\n }\n return html + this.strings[endIndex];\n }\n getTemplateElement() {\n const template = document.createElement('template');\n template.innerHTML = this.getHTML();\n return template;\n }\n}\n/**\n * A TemplateResult for SVG fragments.\n *\n * This class wraps HTMl in an `<svg>` tag in order to parse its contents in the\n * SVG namespace, then modifies the template to remove the `<svg>` tag so that\n * clones only container the original fragment.\n */\nexport class SVGTemplateResult extends TemplateResult {\n getHTML() {\n return `<svg>${super.getHTML()}</svg>`;\n }\n getTemplateElement() {\n const template = super.getTemplateElement();\n const content = template.content;\n const svgElement = content.firstChild;\n content.removeChild(svgElement);\n reparentNodes(content, svgElement.firstChild);\n return template;\n }\n}\n//# sourceMappingURL=template-result.js.map","/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\n/**\n * @module lit-html\n */\nimport { isDirective } from './directive.js';\nimport { removeNodes } from './dom.js';\nimport { noChange, nothing } from './part.js';\nimport { TemplateInstance } from './template-instance.js';\nimport { TemplateResult } from './template-result.js';\nimport { createMarker } from './template.js';\nexport const isPrimitive = (value) => {\n return (value === null ||\n !(typeof value === 'object' || typeof value === 'function'));\n};\n/**\n * Sets attribute values for AttributeParts, so that the value is only set once\n * even if there are multiple parts for an attribute.\n */\nexport class AttributeCommitter {\n constructor(element, name, strings) {\n this.dirty = true;\n this.element = element;\n this.name = name;\n this.strings = strings;\n this.parts = [];\n for (let i = 0; i < strings.length - 1; i++) {\n this.parts[i] = this._createPart();\n }\n }\n /**\n * Creates a single part. Override this to create a differnt type of part.\n */\n _createPart() {\n return new AttributePart(this);\n }\n _getValue() {\n const strings = this.strings;\n const l = strings.length - 1;\n let text = '';\n for (let i = 0; i < l; i++) {\n text += strings[i];\n const part = this.parts[i];\n if (part !== undefined) {\n const v = part.value;\n if (v != null &&\n (Array.isArray(v) ||\n // tslint:disable-next-line:no-any\n typeof v !== 'string' && v[Symbol.iterator])) {\n for (const t of v) {\n text += typeof t === 'string' ? t : String(t);\n }\n }\n else {\n text += typeof v === 'string' ? v : String(v);\n }\n }\n }\n text += strings[l];\n return text;\n }\n commit() {\n if (this.dirty) {\n this.dirty = false;\n this.element.setAttribute(this.name, this._getValue());\n }\n }\n}\nexport class AttributePart {\n constructor(comitter) {\n this.value = undefined;\n this.committer = comitter;\n }\n setValue(value) {\n if (value !== noChange && (!isPrimitive(value) || value !== this.value)) {\n this.value = value;\n // If the value is a not a directive, dirty the committer so that it'll\n // call setAttribute. If the value is a directive, it'll dirty the\n // committer if it calls setValue().\n if (!isDirective(value)) {\n this.committer.dirty = true;\n }\n }\n }\n commit() {\n while (isDirective(this.value)) {\n const directive = this.value;\n this.value = noChange;\n directive(this);\n }\n if (this.value === noChange) {\n return;\n }\n this.committer.commit();\n }\n}\nexport class NodePart {\n constructor(options) {\n this.value = undefined;\n this._pendingValue = undefined;\n this.options = options;\n }\n /**\n * Inserts this part into a container.\n *\n * This part must be empty, as its contents are not automatically moved.\n */\n appendInto(container) {\n this.startNode = container.appendChild(createMarker());\n this.endNode = container.appendChild(createMarker());\n }\n /**\n * Inserts this part between `ref` and `ref`'s next sibling. Both `ref` and\n * its next sibling must be static, unchanging nodes such as those that appear\n * in a literal section of a template.\n *\n * This part must be empty, as its contents are not automatically moved.\n */\n insertAfterNode(ref) {\n this.startNode = ref;\n this.endNode = ref.nextSibling;\n }\n /**\n * Appends this part into a parent part.\n *\n * This part must be empty, as its contents are not automatically moved.\n */\n appendIntoPart(part) {\n part._insert(this.startNode = createMarker());\n part._insert(this.endNode = createMarker());\n }\n /**\n * Appends this part after `ref`\n *\n * This part must be empty, as its contents are not automatically moved.\n */\n insertAfterPart(ref) {\n ref._insert(this.startNode = createMarker());\n this.endNode = ref.endNode;\n ref.endNode = this.startNode;\n }\n setValue(value) {\n this._pendingValue = value;\n }\n commit() {\n while (isDirective(this._pendingValue)) {\n const directive = this._pendingValue;\n this._pendingValue = noChange;\n directive(this);\n }\n const value = this._pendingValue;\n if (value === noChange) {\n return;\n }\n if (isPrimitive(value)) {\n if (value !== this.value) {\n this._commitText(value);\n }\n }\n else if (value instanceof TemplateResult) {\n this._commitTemplateResult(value);\n }\n else if (value instanceof Node) {\n this._commitNode(value);\n }\n else if (Array.isArray(value) ||\n // tslint:disable-next-line:no-any\n value[Symbol.iterator]) {\n this._commitIterable(value);\n }\n else if (value === nothing) {\n this.value = nothing;\n this.clear();\n }\n else {\n // Fallback, will render the string representation\n this._commitText(value);\n }\n }\n _insert(node) {\n this.endNode.parentNode.insertBefore(node, this.endNode);\n }\n _commitNode(value) {\n if (this.value === value) {\n return;\n }\n this.clear();\n this._insert(value);\n this.value = value;\n }\n _commitText(value) {\n const node = this.startNode.nextSibling;\n value = value == null ? '' : value;\n if (node === this.endNode.previousSibling &&\n node.nodeType === 3 /* Node.TEXT_NODE */) {\n // If we only have a single text node between the markers, we can just\n // set its value, rather than replacing it.\n // TODO(justinfagnani): Can we just check if this.value is primitive?\n node.data = value;\n }\n else {\n this._commitNode(document.createTextNode(typeof value === 'string' ? value : String(value)));\n }\n this.value = value;\n }\n _commitTemplateResult(value) {\n const template = this.options.templateFactory(value);\n if (this.value instanceof TemplateInstance &&\n this.value.template === template) {\n this.value.update(value.values);\n }\n else {\n // Make sure we propagate the template processor from the TemplateResult\n // so that we use its syntax extension, etc. The template factory comes\n // from the render function options so that it can control template\n // caching and preprocessing.\n const instance = new TemplateInstance(template, value.processor, this.options);\n const fragment = instance._clone();\n instance.update(value.values);\n this._commitNode(fragment);\n this.value = instance;\n }\n }\n _commitIterable(value) {\n // For an Iterable, we create a new InstancePart per item, then set its\n // value to the item. This is a little bit of overhead for every item in\n // an Iterable, but it lets us recurse easily and efficiently update Arrays\n // of TemplateResults that will be commonly returned from expressions like:\n // array.map((i) => html`${i}`), by reusing existing TemplateInstances.\n // If _value is an array, then the previous render was of an\n // iterable and _value will contain the NodeParts from the previous\n // render. If _value is not an array, clear this part and make a new\n // array for NodeParts.\n if (!Array.isArray(this.value)) {\n this.value = [];\n this.clear();\n }\n // Lets us keep track of how many items we stamped so we can clear leftover\n // items from a previous render\n const itemParts = this.value;\n let partIndex = 0;\n let itemPart;\n for (const item of value) {\n // Try to reuse an existing part\n itemPart = itemParts[partIndex];\n // If no existing part, create a new one\n if (itemPart === undefined) {\n itemPart = new NodePart(this.options);\n itemParts.push(itemPart);\n if (partIndex === 0) {\n itemPart.appendIntoPart(this);\n }\n else {\n itemPart.insertAfterPart(itemParts[partIndex - 1]);\n }\n }\n itemPart.setValue(item);\n itemPart.commit();\n partIndex++;\n }\n if (partIndex < itemParts.length) {\n // Truncate the parts array so _value reflects the current state\n itemParts.length = partIndex;\n this.clear(itemPart && itemPart.endNode);\n }\n }\n clear(startNode = this.startNode) {\n removeNodes(this.startNode.parentNode, startNode.nextSibling, this.endNode);\n }\n}\n/**\n * Implements a boolean attribute, roughly as defined in the HTML\n * specification.\n *\n * If the value is truthy, then the attribute is present with a value of\n * ''. If the value is falsey, the attribute is removed.\n */\nexport class BooleanAttributePart {\n constructor(element, name, strings) {\n this.value = undefined;\n this._pendingValue = undefined;\n if (strings.length !== 2 || strings[0] !== '' || strings[1] !== '') {\n throw new Error('Boolean attributes can only contain a single expression');\n }\n this.element = element;\n this.name = name;\n this.strings = strings;\n }\n setValue(value) {\n this._pendingValue = value;\n }\n commit() {\n while (isDirective(this._pendingValue)) {\n const directive = this._pendingValue;\n this._pendingValue = noChange;\n directive(this);\n }\n if (this._pendingValue === noChange) {\n return;\n }\n const value = !!this._pendingValue;\n if (this.value !== value) {\n if (value) {\n this.element.setAttribute(this.name, '');\n }\n else {\n this.element.removeAttribute(this.name);\n }\n }\n this.value = value;\n this._pendingValue = noChange;\n }\n}\n/**\n * Sets attribute values for PropertyParts, so that the value is only set once\n * even if there are multiple parts for a property.\n *\n * If an expression controls the whole property value, then the value is simply\n * assigned to the property under control. If there are string literals or\n * multiple expressions, then the strings are expressions are interpolated into\n * a string first.\n */\nexport class PropertyCommitter extends AttributeCommitter {\n constructor(element, name, strings) {\n super(element, name, strings);\n this.single =\n (strings.length === 2 && strings[0] === '' && strings[1] === '');\n }\n _createPart() {\n return new PropertyPart(this);\n }\n _getValue() {\n if (this.single) {\n return this.parts[0].value;\n }\n return super._getValue();\n }\n commit() {\n if (this.dirty) {\n this.dirty = false;\n // tslint:disable-next-line:no-any\n this.element[this.name] = this._getValue();\n }\n }\n}\nexport class PropertyPart extends AttributePart {\n}\n// Detect event listener options support. If the `capture` property is read\n// from the options object, then options are supported. If not, then the thrid\n// argument to add/removeEventListener is interpreted as the boolean capture\n// value so we should only pass the `capture` property.\nlet eventOptionsSupported = false;\ntry {\n const options = {\n get capture() {\n eventOptionsSupported = true;\n return false;\n }\n };\n // tslint:disable-next-line:no-any\n window.addEventListener('test', options, options);\n // tslint:disable-next-line:no-any\n window.removeEventListener('test', options, options);\n}\ncatch (_e) {\n}\nexport class EventPart {\n constructor(element, eventName, eventContext) {\n this.value = undefined;\n this._pendingValue = undefined;\n this.element = element;\n this.eventName = eventName;\n this.eventContext = eventContext;\n this._boundHandleEvent = (e) => this.handleEvent(e);\n }\n setValue(value) {\n this._pendingValue = value;\n }\n commit() {\n while (isDirective(this._pendingValue)) {\n const directive = this._pendingValue;\n this._pendingValue = noChange;\n directive(this);\n }\n if (this._pendingValue === noChange) {\n return;\n }\n const newListener = this._pendingValue;\n const oldListener = this.value;\n const shouldRemoveListener = newListener == null ||\n oldListener != null &&\n (newListener.capture !== oldListener.capture ||\n newListener.once !== oldListener.once ||\n newListener.passive !== oldListener.passive);\n const shouldAddListener = newListener != null && (oldListener == null || shouldRemoveListener);\n if (shouldRemoveListener) {\n this.element.removeEventListener(this.eventName, this._boundHandleEvent, this._options);\n }\n if (shouldAddListener) {\n this._options = getOptions(newListener);\n this.element.addEventListener(this.eventName, this._boundHandleEvent, this._options);\n }\n this.value = newListener;\n this._pendingValue = noChange;\n }\n handleEvent(event) {\n if (typeof this.value === 'function') {\n this.value.call(this.eventContext || this.element, event);\n }\n else {\n this.value.handleEvent(event);\n }\n }\n}\n// We copy options because of the inconsistent behavior of browsers when reading\n// the third argument of add/removeEventListener. IE11 doesn't support options\n// at all. Chrome 41 only reads `capture` if the argument is an object.\nconst getOptions = (o) => o &&\n (eventOptionsSupported ?\n { capture: o.capture, passive: o.passive, once: o.once } :\n o.capture);\n//# sourceMappingURL=parts.js.map","/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\nimport { AttributeCommitter, BooleanAttributePart, EventPart, NodePart, PropertyCommitter } from './parts.js';\n/**\n * Creates Parts when a template is instantiated.\n */\nexport class DefaultTemplateProcessor {\n /**\n * Create parts for an attribute-position binding, given the event, attribute\n * name, and string literals.\n *\n * @param element The element containing the binding\n * @param name The attribute name\n * @param strings The string literals. There are always at least two strings,\n * event for fully-controlled bindings with a single expression.\n */\n handleAttributeExpressions(element, name, strings, options) {\n const prefix = name[0];\n if (prefix === '.') {\n const comitter = new PropertyCommitter(element, name.slice(1), strings);\n return comitter.parts;\n }\n if (prefix === '@') {\n return [new EventPart(element, name.slice(1), options.eventContext)];\n }\n if (prefix === '?') {\n return [new BooleanAttributePart(element, name.slice(1), strings)];\n }\n const comitter = new AttributeCommitter(element, name, strings);\n return comitter.parts;\n }\n /**\n * Create parts for a text-position binding.\n * @param templateFactory\n */\n handleTextExpression(options) {\n return new NodePart(options);\n }\n}\nexport const defaultTemplateProcessor = new DefaultTemplateProcessor();\n//# sourceMappingURL=default-template-processor.js.map","/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\nimport { marker, Template } from './template.js';\n/**\n * The default TemplateFactory which caches Templates keyed on\n * result.type and result.strings.\n */\nexport function templateFactory(result) {\n let templateCache = templateCaches.get(result.type);\n if (templateCache === undefined) {\n templateCache = {\n stringsArray: new WeakMap(),\n keyString: new Map()\n };\n templateCaches.set(result.type, templateCache);\n }\n let template = templateCache.stringsArray.get(result.strings);\n if (template !== undefined) {\n return template;\n }\n // If the TemplateStringsArray is new, generate a key from the strings\n // This key is shared between all templates with identical content\n const key = result.strings.join(marker);\n // Check if we already have a Template for this key\n template = templateCache.keyString.get(key);\n if (template === undefined) {\n // If we have not seen this key before, create a new Template\n template = new Template(result, result.getTemplateElement());\n // Cache the Template for this key\n templateCache.keyString.set(key, template);\n }\n // Cache all future queries for this TemplateStringsArray\n templateCache.stringsArray.set(result.strings, template);\n return template;\n}\nexport const templateCaches = new Map();\n//# sourceMappingURL=template-factory.js.map","/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\n/**\n * @module lit-html\n */\nimport { removeNodes } from './dom.js';\nimport { NodePart } from './parts.js';\nimport { templateFactory } from './template-factory.js';\nexport const parts = new WeakMap();\n/**\n * Renders a template to a container.\n *\n * To update a container with new values, reevaluate the template literal and\n * call `render` with the new result.\n *\n * @param result a TemplateResult created by evaluating a template tag like\n * `html` or `svg`.\n * @param container A DOM parent to render to. The entire contents are either\n * replaced, or efficiently updated if the same result type was previous\n * rendered there.\n * @param options RenderOptions for the entire render tree rendered to this\n * container. Render options must *not* change between renders to the same\n * container, as those changes will not effect previously rendered DOM.\n */\nexport const render = (result, container, options) => {\n let part = parts.get(container);\n if (part === undefined) {\n removeNodes(container, container.firstChild);\n parts.set(container, part = new NodePart(Object.assign({ templateFactory }, options)));\n part.appendInto(container);\n }\n part.setValue(result);\n part.commit();\n};\n//# sourceMappingURL=render.js.map","/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\n/**\n *\n * Main lit-html module.\n *\n * Main exports:\n *\n * - [[html]]\n * - [[svg]]\n * - [[render]]\n *\n * @module lit-html\n * @preferred\n */\n/**\n * Do not remove this comment; it keeps typedoc from misplacing the module\n * docs.\n */\nimport { defaultTemplateProcessor } from './lib/default-template-processor.js';\nimport { SVGTemplateResult, TemplateResult } from './lib/template-result.js';\nexport { DefaultTemplateProcessor, defaultTemplateProcessor } from './lib/default-template-processor.js';\nexport { directive, isDirective } from './lib/directive.js';\n// TODO(justinfagnani): remove line when we get NodePart moving methods\nexport { removeNodes, reparentNodes } from './lib/dom.js';\nexport { noChange, nothing } from './lib/part.js';\nexport { AttributeCommitter, AttributePart, BooleanAttributePart, EventPart, isPrimitive, NodePart, PropertyCommitter, PropertyPart } from './lib/parts.js';\nexport { parts, render } from './lib/render.js';\nexport { templateCaches, templateFactory } from './lib/template-factory.js';\nexport { TemplateInstance } from './lib/template-instance.js';\nexport { SVGTemplateResult, TemplateResult } from './lib/template-result.js';\nexport { createMarker, isTemplatePartActive, Template } from './lib/template.js';\n// IMPORTANT: do not change the property name or the assignment expression.\n// This line will be used in regexes to search for lit-html usage.\n// TODO(justinfagnani): inject version number at build time\n(window['litHtmlVersions'] || (window['litHtmlVersions'] = [])).push('1.0.0');\n/**\n * Interprets a template literal as an HTML template that can efficiently\n * render to and update a container.\n */\nexport const html = (strings, ...values) => new TemplateResult(strings, values, 'html', defaultTemplateProcessor);\n/**\n * Interprets a template literal as an SVG template that can efficiently\n * render to and update a container.\n */\nexport const svg = (strings, ...values) => new SVGTemplateResult(strings, values, 'svg', defaultTemplateProcessor);\n//# sourceMappingURL=lit-html.js.map","/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\n/**\n * @module shady-render\n */\nimport { isTemplatePartActive } from './template.js';\nconst walkerNodeFilter = 133 /* NodeFilter.SHOW_{ELEMENT|COMMENT|TEXT} */;\n/**\n * Removes the list of nodes from a Template safely. In addition to removing\n * nodes from the Template, the Template part indices are updated to match\n * the mutated Template DOM.\n *\n * As the template is walked the removal state is tracked and\n * part indices are adjusted as needed.\n *\n * div\n * div#1 (remove) <-- start removing (removing node is div#1)\n * div\n * div#2 (remove) <-- continue removing (removing node is still div#1)\n * div\n * div <-- stop removing since previous sibling is the removing node (div#1,\n * removed 4 nodes)\n */\nexport function removeNodesFromTemplate(template, nodesToRemove) {\n const { element: { content }, parts } = template;\n const walker = document.createTreeWalker(content, walkerNodeFilter, null, false);\n let partIndex = nextActiveIndexInTemplateParts(parts);\n let part = parts[partIndex];\n let nodeIndex = -1;\n let removeCount = 0;\n const nodesToRemoveInTemplate = [];\n let currentRemovingNode = null;\n while (walker.nextNode()) {\n nodeIndex++;\n const node = walker.currentNode;\n // End removal if stepped past the removing node\n if (node.previousSibling === currentRemovingNode) {\n currentRemovingNode = null;\n }\n // A node to remove was found in the template\n if (nodesToRemove.has(node)) {\n nodesToRemoveInTemplate.push(node);\n // Track node we're removing\n if (currentRemovingNode === null) {\n currentRemovingNode = node;\n }\n }\n // When removing, increment count by which to adjust subsequent part indices\n if (currentRemovingNode !== null) {\n removeCount++;\n }\n while (part !== undefined && part.index === nodeIndex) {\n // If part is in a removed node deactivate it by setting index to -1 or\n // adjust the index as needed.\n part.index = currentRemovingNode !== null ? -1 : part.index - removeCount;\n // go to the next active part.\n partIndex = nextActiveIndexInTemplateParts(parts, partIndex);\n part = parts[partIndex];\n }\n }\n nodesToRemoveInTemplate.forEach((n) => n.parentNode.removeChild(n));\n}\nconst countNodes = (node) => {\n let count = (node.nodeType === 11 /* Node.DOCUMENT_FRAGMENT_NODE */) ? 0 : 1;\n const walker = document.createTreeWalker(node, walkerNodeFilter, null, false);\n while (walker.nextNode()) {\n count++;\n }\n return count;\n};\nconst nextActiveIndexInTemplateParts = (parts, startIndex = -1) => {\n for (let i = startIndex + 1; i < parts.length; i++) {\n const part = parts[i];\n if (isTemplatePartActive(part)) {\n return i;\n }\n }\n return -1;\n};\n/**\n * Inserts the given node into the Template, optionally before the given\n * refNode. In addition to inserting the node into the Template, the Template\n * part indices are updated to match the mutated Template DOM.\n */\nexport function insertNodeIntoTemplate(template, node, refNode = null) {\n const { element: { content }, parts } = template;\n // If there's no refNode, then put node at end of template.\n // No part indices need to be shifted in this case.\n if (refNode === null || refNode === undefined) {\n content.appendChild(node);\n return;\n }\n const walker = document.createTreeWalker(content, walkerNodeFilter, null, false);\n let partIndex = nextActiveIndexInTemplateParts(parts);\n let insertCount = 0;\n let walkerIndex = -1;\n while (walker.nextNode()) {\n walkerIndex++;\n const walkerNode = walker.currentNode;\n if (walkerNode === refNode) {\n insertCount = countNodes(node);\n refNode.parentNode.insertBefore(node, refNode);\n }\n while (partIndex !== -1 && parts[partIndex].index === walkerIndex) {\n // If we've inserted the node, simply adjust all subsequent parts\n if (insertCount > 0) {\n while (partIndex !== -1) {\n parts[partIndex].index += insertCount;\n partIndex = nextActiveIndexInTemplateParts(parts, partIndex);\n }\n return;\n }\n partIndex = nextActiveIndexInTemplateParts(parts, partIndex);\n }\n }\n}\n//# sourceMappingURL=modify-template.js.map","/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\n/**\n * Module to add shady DOM/shady CSS polyfill support to lit-html template\n * rendering. See the [[render]] method for details.\n *\n * @module shady-render\n * @preferred\n */\n/**\n * Do not remove this comment; it keeps typedoc from misplacing the module\n * docs.\n */\nimport { removeNodes } from './dom.js';\nimport { insertNodeIntoTemplate, removeNodesFromTemplate } from './modify-template.js';\nimport { parts, render as litRender } from './render.js';\nimport { templateCaches } from './template-factory.js';\nimport { TemplateInstance } from './template-instance.js';\nimport { TemplateResult } from './template-result.js';\nimport { marker, Template } from './template.js';\nexport { html, svg, TemplateResult } from '../lit-html.js';\n// Get a key to lookup in `templateCaches`.\nconst getTemplateCacheKey = (type, scopeName) => `${type}--${scopeName}`;\nlet compatibleShadyCSSVersion = true;\nif (typeof window.ShadyCSS === 'undefined') {\n compatibleShadyCSSVersion = false;\n}\nelse if (typeof window.ShadyCSS.prepareTemplateDom === 'undefined') {\n console.warn(`Incompatible ShadyCSS version detected.` +\n `Please update to at least @webcomponents/webcomponentsjs@2.0.2 and` +\n `@webcomponents/shadycss@1.3.1.`);\n compatibleShadyCSSVersion = false;\n}\n/**\n * Template factory which scopes template DOM using ShadyCSS.\n * @param scopeName {string}\n */\nconst shadyTemplateFactory = (scopeName) => (result) => {\n const cacheKey = getTemplateCacheKey(result.type, scopeName);\n let templateCache = templateCaches.get(cacheKey);\n if (templateCache === undefined) {\n templateCache = {\n stringsArray: new WeakMap(),\n keyString: new Map()\n };\n templateCaches.set(cacheKey, templateCache);\n }\n let template = templateCache.stringsArray.get(result.strings);\n if (template !== undefined) {\n return template;\n }\n const key = result.strings.join(marker);\n template = templateCache.keyString.get(key);\n if (template === undefined) {\n const element = result.getTemplateElement();\n if (compatibleShadyCSSVersion) {\n window.ShadyCSS.prepareTemplateDom(element, scopeName);\n }\n template = new Template(result, element);\n templateCache.keyString.set(key, template);\n }\n templateCache.stringsArray.set(result.strings, template);\n return template;\n};\nconst TEMPLATE_TYPES = ['html', 'svg'];\n/**\n * Removes all style elements from Templates for the given scopeName.\n */\nconst removeStylesFromLitTemplates = (scopeName) => {\n TEMPLATE_TYPES.forEach((type) => {\n const templates = templateCaches.get(getTemplateCacheKey(type, scopeName));\n if (templates !== undefined) {\n templates.keyString.forEach((template) => {\n const { element: { content } } = template;\n // IE 11 doesn't support the iterable param Set constructor\n const styles = new Set();\n Array.from(content.querySelectorAll('style')).forEach((s) => {\n styles.add(s);\n });\n removeNodesFromTemplate(template, styles);\n });\n }\n });\n};\nconst shadyRenderSet = new Set();\n/**\n * For the given scope name, ensures that ShadyCSS style scoping is performed.\n * This is done just once per scope name so the fragment and template cannot\n * be modified.\n * (1) extracts styles from the rendered fragment and hands them to ShadyCSS\n * to be scoped and appended to the document\n * (2) removes style elements from all lit-html Templates for this scope name.\n *\n * Note, <style> elements can only be placed into templates for the\n * initial rendering of the scope. If <style> elements are included in templates\n * dynamically rendered to the scope (after the first scope render), they will\n * not be scoped and the <style> will be left in the template and rendered\n * output.\n */\nconst prepareTemplateStyles = (renderedDOM, template, scopeName) => {\n shadyRenderSet.add(scopeName);\n // Move styles out of rendered DOM and store.\n const styles = renderedDOM.querySelectorAll('style');\n // If there are no styles, skip unnecessary work\n if (styles.length === 0) {\n // Ensure prepareTemplateStyles is called to support adding\n // styles via `prepareAdoptedCssText` since that requires that\n // `prepareTemplateStyles` is called.\n window.ShadyCSS.prepareTemplateStyles(template.element, scopeName);\n return;\n }\n const condensedStyle = document.createElement('style');\n // Collect styles into a single style. This helps us make sure ShadyCSS\n // manipulations will not prevent us from being able to fix up template\n // part indices.\n // NOTE: collecting styles is inefficient for browsers but ShadyCSS\n // currently does this anyway. When it does not, this should be changed.\n for (let i = 0; i < styles.length; i++) {\n const style = styles[i];\n style.parentNode.removeChild(style);\n condensedStyle.textContent += style.textContent;\n }\n // Remove styles from nested templates in this scope.\n removeStylesFromLitTemplates(scopeName);\n // And then put the condensed style into the \"root\" template passed in as\n // `template`.\n insertNodeIntoTemplate(template, condensedStyle, template.element.content.firstChild);\n // Note, it's important that ShadyCSS gets the template that `lit-html`\n // will actually render so that it can update the style inside when\n // needed (e.g. @apply native Shadow DOM case).\n window.ShadyCSS.prepareTemplateStyles(template.element, scopeName);\n if (window.ShadyCSS.nativeShadow) {\n // When in native Shadow DOM, re-add styling to rendered content using\n // the style ShadyCSS produced.\n const style = template.element.content.querySelector('style');\n renderedDOM.insertBefore(style.cloneNode(true), renderedDOM.firstChild);\n }\n else {\n // When not in native Shadow DOM, at this point ShadyCSS will have\n // removed the style from the lit template and parts will be broken as a\n // result. To fix this, we put back the style node ShadyCSS removed\n // and then tell lit to remove that node from the template.\n // NOTE, ShadyCSS creates its own style so we can safely add/remove\n // `condensedStyle` here.\n template.element.content.insertBefore(condensedStyle, template.element.content.firstChild);\n const removes = new Set();\n removes.add(condensedStyle);\n removeNodesFromTemplate(template, removes);\n }\n};\n/**\n * Extension to the standard `render` method which supports rendering\n * to ShadowRoots when the ShadyDOM (https://github.com/webcomponents/shadydom)\n * and ShadyCSS (https://github.com/webcomponents/shadycss) polyfills are used\n * or when the webcomponentsjs\n * (https://github.com/webcomponents/webcomponentsjs) polyfill is used.\n *\n * Adds a `scopeName` option which is used to scope element DOM and stylesheets\n * when native ShadowDOM is unavailable. The `scopeName` will be added to\n * the class attribute of all rendered DOM. In addition, any style elements will\n * be automatically re-written with this `scopeName` selector and moved out\n * of the rendered DOM and into the document `<head>`.\n *\n * It is common to use this render method in conjunction with a custom element\n * which renders a shadowRoot. When this is done, typically the element's\n * `localName` should be used as the `scopeName`.\n *\n * In addition to DOM scoping, ShadyCSS also supports a basic shim for css\n * custom properties (needed only on older browsers like IE11) and a shim for\n * a deprecated feature called `@apply` that supports applying a set of css\n * custom properties to a given location.\n *\n * Usage considerations:\n *\n * * Part values in `<style>` elements are only applied the first time a given\n * `scopeName` renders. Subsequent changes to parts in style elements will have\n * no effect. Because of this, parts in style elements should only be used for\n * values that will never change, for example parts that set scope-wide theme\n * values or parts which render shared style elements.\n *\n * * Note, due to a limitation of the ShadyDOM polyfill, rendering in a\n * custom element's `constructor` is not supported. Instead rendering should\n * either done asynchronously, for example at microtask timing (for example\n * `Promise.resolve()`), or be deferred until the first time the element's\n * `connectedCallback` runs.\n *\n * Usage considerations when using shimmed custom properties or `@apply`:\n *\n * * Whenever any dynamic changes are made which affect\n * css custom properties, `ShadyCSS.styleElement(element)` must be called\n * to update the element. There are two cases when this is needed:\n * (1) the element is connected to a new parent, (2) a class is added to the\n * element that causes it to match different custom properties.\n * To address the first case when rendering a custom element, `styleElement`\n * should be called in the element's `connectedCallback`.\n *\n * * Shimmed custom properties may only be defined either for an entire\n * shadowRoot (for example, in a `:host` rule) or via a rule that directly\n * matches an element with a shadowRoot. In other words, instead of flowing from\n * parent to child as do native css custom properties, shimmed custom properties\n * flow only from shadowRoots to nested shadowRoots.\n *\n * * When using `@apply` mixing css shorthand property names with\n * non-shorthand names (for example `border` and `border-width`) is not\n * supported.\n */\nexport const render = (result, container, options) => {\n const scopeName = options.scopeName;\n const hasRendered = parts.has(container);\n const needsScoping = container instanceof ShadowRoot &&\n compatibleShadyCSSVersion && result instanceof TemplateResult;\n // Handle first render to a scope specially...\n const firstScopeRender = needsScoping && !shadyRenderSet.has(scopeName);\n // On first scope render, render into a fragment; this cannot be a single\n // fragment that is reused since nested renders can occur synchronously.\n const renderContainer = firstScopeRender ? document.createDocumentFragment() : container;\n litRender(result, renderContainer, Object.assign({ templateFactory: shadyTemplateFactory(scopeName) }, options));\n // When performing first scope render,\n // (1) We've rendered into a fragment so that there's a chance to\n // `prepareTemplateStyles` before sub-elements hit the DOM\n // (which might cause them to render based on a common pattern of\n // rendering in a custom element's `connectedCallback`);\n // (2) Scope the template with ShadyCSS one time only for this scope.\n // (3) Render the fragment into the container and make sure the\n // container knows its `part` is the one we just rendered. This ensures\n // DOM will be re-used on subsequent renders.\n if (firstScopeRender) {\n const part = parts.get(renderContainer);\n parts.delete(renderContainer);\n if (part.value instanceof TemplateInstance) {\n prepareTemplateStyles(renderContainer, part.value.template, scopeName);\n }\n removeNodes(container, container.firstChild);\n container.appendChild(renderContainer);\n parts.set(container, part);\n }\n // After elements have hit the DOM, update styling if this is the\n // initial render to this container.\n // This is needed whenever dynamic changes are made so it would be\n // safest to do every render; however, this would regress performance\n // so we leave it up to the user to call `ShadyCSSS.styleElement`\n // for dynamic changes.\n if (!hasRendered && needsScoping) {\n window.ShadyCSS.styleElement(container.host);\n }\n};\n//# sourceMappingURL=shady-render.js.map","/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\n/**\n * When using Closure Compiler, JSCompiler_renameProperty(property, object) is\n * replaced at compile time by the munged name for object[property]. We cannot\n * alias this function, so we have to use a small shim that has the same\n * behavior when not compiling.\n */\nwindow.JSCompiler_renameProperty =\n (prop, _obj) => prop;\nexport const defaultConverter = {\n toAttribute(value, type) {\n switch (type) {\n case Boolean:\n return value ? '' : null;\n case Object:\n case Array:\n // if the value is `null` or `undefined` pass this through\n // to allow removing/no change behavior.\n return value == null ? value : JSON.stringify(value);\n }\n return value;\n },\n fromAttribute(value, type) {\n switch (type) {\n case Boolean:\n return value !== null;\n case Number:\n return value === null ? null : Number(value);\n case Object:\n case Array:\n return JSON.parse(value);\n }\n return value;\n }\n};\n/**\n * Change function that returns true if `value` is different from `oldValue`.\n * This method is used as the default for a property's `hasChanged` function.\n */\nexport const notEqual = (value, old) => {\n // This ensures (old==NaN, value==NaN) always returns false\n return old !== value && (old === old || value === value);\n};\nconst defaultPropertyDeclaration = {\n attribute: true,\n type: String,\n converter: defaultConverter,\n reflect: false,\n hasChanged: notEqual\n};\nconst microtaskPromise = Promise.resolve(true);\nconst STATE_HAS_UPDATED = 1;\nconst STATE_UPDATE_REQUESTED = 1 << 2;\nconst STATE_IS_REFLECTING_TO_ATTRIBUTE = 1 << 3;\nconst STATE_IS_REFLECTING_TO_PROPERTY = 1 << 4;\nconst STATE_HAS_CONNECTED = 1 << 5;\n/**\n * Base element class which manages element properties and attributes. When\n * properties change, the `update` method is asynchronously called. This method\n * should be supplied by subclassers to render updates as desired.\n */\nexport class UpdatingElement extends HTMLElement {\n constructor() {\n super();\n this._updateState = 0;\n this._instanceProperties = undefined;\n this._updatePromise = microtaskPromise;\n this._hasConnectedResolver = undefined;\n /**\n * Map with keys for any properties that have changed since the last\n * update cycle with previous values.\n */\n this._changedProperties = new Map();\n /**\n * Map with keys of properties that should be reflected when updated.\n */\n this._reflectingProperties = undefined;\n this.initialize();\n }\n /**\n * Returns a list of attributes corresponding to the registered properties.\n * @nocollapse\n */\n static get observedAttributes() {\n // note: piggy backing on this to ensure we're finalized.\n this.finalize();\n const attributes = [];\n // Use forEach so this works even if for/of loops are compiled to for loops\n // expecting arrays\n this._classProperties.forEach((v, p) => {\n const attr = this._attributeNameForProperty(p, v);\n if (attr !== undefined) {\n this._attributeToPropertyMap.set(attr, p);\n attributes.push(attr);\n }\n });\n return attributes;\n }\n /**\n * Ensures the private `_classProperties` property metadata is created.\n * In addition to `finalize` this is also called in `createProperty` to\n * ensure the `@property` decorator can add property metadata.\n */\n /** @nocollapse */\n static _ensureClassProperties() {\n // ensure private storage for property declarations.\n if (!this.hasOwnProperty(JSCompiler_renameProperty('_classProperties', this))) {\n this._classProperties = new Map();\n // NOTE: Workaround IE11 not supporting Map constructor argument.\n const superProperties = Object.getPrototypeOf(this)._classProperties;\n if (superProperties !== undefined) {\n superProperties.forEach((v, k) => this._classProperties.set(k, v));\n }\n }\n }\n /**\n * Creates a property accessor on the element prototype if one does not exist.\n * The property setter calls the property's `hasChanged` property option\n * or uses a strict identity check to determine whether or not to request\n * an update.\n * @nocollapse\n */\n static createProperty(name, options = defaultPropertyDeclaration) {\n // Note, since this can be called by the `@property` decorator which\n // is called before `finalize`, we ensure storage exists for property\n // metadata.\n this._ensureClassProperties();\n this._classProperties.set(name, options);\n // Do not generate an accessor if the prototype already has one, since\n // it would be lost otherwise and that would never be the user's intention;\n // Instead, we expect users to call `requestUpdate` themselves from\n // user-defined accessors. Note that if the super has an accessor we will\n // still overwrite it\n if (options.noAccessor || this.prototype.hasOwnProperty(name)) {\n return;\n }\n const key = typeof name === 'symbol' ? Symbol() : `__${name}`;\n Object.defineProperty(this.prototype, name, {\n // tslint:disable-next-line:no-any no symbol in index\n get() {\n return this[key];\n },\n set(value) {\n // tslint:disable-next-line:no-any no symbol in index\n const oldValue = this[name];\n // tslint:disable-next-line:no-any no symbol in index\n this[key] = value;\n this._requestUpdate(name, oldValue);\n },\n configurable: true,\n enumerable: true\n });\n }\n /**\n * Creates property accessors for registered properties and ensures\n * any superclasses are also finalized.\n * @nocollapse\n */\n static finalize() {\n if (this.hasOwnProperty(JSCompiler_renameProperty('finalized', this)) &&\n this.finalized) {\n return;\n }\n // finalize any superclasses\n const superCtor = Object.getPrototypeOf(this);\n if (typeof superCtor.finalize === 'function') {\n superCtor.finalize();\n }\n this.finalized = true;\n this._ensureClassProperties();\n // initialize Map populated in observedAttributes\n this._attributeToPropertyMap = new Map();\n // make any properties\n // Note, only process \"own\" properties since this element will inherit\n // any properties defined on the superClass, and finalization ensures\n // the entire prototype chain is finalized.\n if (this.hasOwnProperty(JSCompiler_renameProperty('properties', this))) {\n const props = this.properties;\n // support symbols in properties (IE11 does not support this)\n const propKeys = [\n ...Object.getOwnPropertyNames(props),\n ...(typeof Object.getOwnPropertySymbols === 'function') ?\n Object.getOwnPropertySymbols(props) :\n []\n ];\n // This for/of is ok because propKeys is an array\n for (const p of propKeys) {\n // note, use of `any` is due to TypeSript lack of support for symbol in\n // index types\n // tslint:disable-next-line:no-any no symbol in index\n this.createProperty(p, props[p]);\n }\n }\n }\n /**\n * Returns the property name for the given attribute `name`.\n * @nocollapse\n */\n static _attributeNameForProperty(name, options) {\n const attribute = options.attribute;\n return attribute === false ?\n undefined :\n (typeof attribute === 'string' ?\n attribute :\n (typeof name === 'string' ? name.toLowerCase() : undefined));\n }\n /**\n * Returns true if a property should request an update.\n * Called when a property value is set and uses the `hasChanged`\n * option for the property if present or a strict identity check.\n * @nocollapse\n */\n static _valueHasChanged(value, old, hasChanged = notEqual) {\n return hasChanged(value, old);\n }\n /**\n * Returns the property value for the given attribute value.\n * Called via the `attributeChangedCallback` and uses the property's\n * `converter` or `converter.fromAttribute` property option.\n * @nocollapse\n */\n static _propertyValueFromAttribute(value, options) {\n const type = options.type;\n const converter = options.converter || defaultConverter;\n const fromAttribute = (typeof converter === 'function' ? converter : converter.fromAttribute);\n return fromAttribute ? fromAttribute(value, type) : value;\n }\n /**\n * Returns the attribute value for the given property value. If this\n * returns undefined, the property will *not* be reflected to an attribute.\n * If this returns null, the attribute will be removed, otherwise the\n * attribute will be set to the value.\n * This uses the property's `reflect` and `type.toAttribute` property options.\n * @nocollapse\n */\n static _propertyValueToAttribute(value, options) {\n if (options.reflect === undefined) {\n return;\n }\n const type = options.type;\n const converter = options.converter;\n const toAttribute = converter && converter.toAttribute ||\n defaultConverter.toAttribute;\n return toAttribute(value, type);\n }\n /**\n * Performs element initialization. By default captures any pre-set values for\n * registered properties.\n */\n initialize() {\n this._saveInstanceProperties();\n // ensures first update will be caught by an early access of `updateComplete`\n this._requestUpdate();\n }\n /**\n * Fixes any properties set on the instance before upgrade time.\n * Otherwise these would shadow the accessor and break these properties.\n * The properties are stored in a Map which is played back after the\n * constructor runs. Note, on very old versions of Safari (<=9) or Chrome\n * (<=41), properties created for native platform properties like (`id` or\n * `name`) may not have default values set in the element constructor. On\n * these browsers native properties appear on instances and therefore their\n * default value will overwrite any element default (e.g. if the element sets\n * this.id = 'id' in the constructor, the 'id' will become '' since this is\n * the native platform default).\n */\n _saveInstanceProperties() {\n // Use forEach so this works even if for/of loops are compiled to for loops\n // expecting arrays\n this.constructor\n ._classProperties.forEach((_v, p) => {\n if (this.hasOwnProperty(p)) {\n const value = this[p];\n delete this[p];\n if (!this._instanceProperties) {\n this._instanceProperties = new Map();\n }\n this._instanceProperties.set(p, value);\n }\n });\n }\n /**\n * Applies previously saved instance properties.\n */\n _applyInstanceProperties() {\n // Use forEach so this works even if for/of loops are compiled to for loops\n // expecting arrays\n // tslint:disable-next-line:no-any\n this._instanceProperties.forEach((v, p) => this[p] = v);\n this._instanceProperties = undefined;\n }\n connectedCallback() {\n this._updateState = this._updateState | STATE_HAS_CONNECTED;\n // Ensure first connection completes an update. Updates cannot complete before\n // connection and if one is pending connection the `_hasConnectionResolver`\n // will exist. If so, resolve it to complete the update, otherwise\n // requestUpdate.\n if (this._hasConnectedResolver) {\n this._hasConnectedResolver();\n this._hasConnectedResolver = undefined;\n }\n }\n /**\n * Allows for `super.disconnectedCallback()` in extensions while\n * reserving the possibility of making non-breaking feature additions\n * when disconnecting at some point in the future.\n */\n disconnectedCallback() {\n }\n /**\n * Synchronizes property values when attributes change.\n */\n attributeChangedCallback(name, old, value) {\n if (old !== value) {\n this._attributeToProperty(name, value);\n }\n }\n _propertyToAttribute(name, value, options = defaultPropertyDeclaration) {\n const ctor = this.constructor;\n const attr = ctor._attributeNameForProperty(name, options);\n if (attr !== undefined) {\n const attrValue = ctor._propertyValueToAttribute(value, options);\n // an undefined value does not change the attribute.\n if (attrValue === undefined) {\n return;\n }\n // Track if the property is being reflected to avoid\n // setting the property again via `attributeChangedCallback`. Note:\n // 1. this takes advantage of the fact that the callback is synchronous.\n // 2. will behave incorrectly if multiple attributes are in the reaction\n // stack at time of calling. However, since we process attributes\n // in `update` this should not be possible (or an extreme corner case\n // that we'd like to discover).\n // mark state reflecting\n this._updateState = this._updateState | STATE_IS_REFLECTING_TO_ATTRIBUTE;\n if (attrValue == null) {\n this.removeAttribute(attr);\n }\n else {\n this.setAttribute(attr, attrValue);\n }\n // mark state not reflecting\n this._updateState = this._updateState & ~STATE_IS_REFLECTING_TO_ATTRIBUTE;\n }\n }\n _attributeToProperty(name, value) {\n // Use tracking info to avoid deserializing attribute value if it was\n // just set from a property setter.\n if (this._updateState & STATE_IS_REFLECTING_TO_ATTRIBUTE) {\n return;\n }\n const ctor = this.constructor;\n const propName = ctor._attributeToPropertyMap.get(name);\n if (propName !== undefined) {\n const options = ctor._classProperties.get(propName) || defaultPropertyDeclaration;\n // mark state reflecting\n this._updateState = this._updateState | STATE_IS_REFLECTING_TO_PROPERTY;\n this[propName] =\n // tslint:disable-next-line:no-any\n ctor._propertyValueFromAttribute(value, options);\n // mark state not reflecting\n this._updateState = this._updateState & ~STATE_IS_REFLECTING_TO_PROPERTY;\n }\n }\n /**\n * This private version of `requestUpdate` does not access or return the\n * `updateComplete` promise. This promise can be overridden and is therefore\n * not free to access.\n */\n _requestUpdate(name, oldValue) {\n let shouldRequestUpdate = true;\n // If we have a property key, perform property update steps.\n if (name !== undefined) {\n const ctor = this.constructor;\n const options = ctor._classProperties.get(name) || defaultPropertyDeclaration;\n if (ctor._valueHasChanged(this[name], oldValue, options.hasChanged)) {\n if (!this._changedProperties.has(name)) {\n this._changedProperties.set(name, oldValue);\n }\n // Add to reflecting properties set.\n // Note, it's important that every change has a chance to add the\n // property to `_reflectingProperties`. This ensures setting\n // attribute + property reflects correctly.\n if (options.reflect === true &&\n !(this._updateState & STATE_IS_REFLECTING_TO_PROPERTY)) {\n if (this._reflectingProperties === undefined) {\n this._reflectingProperties = new Map();\n }\n this._reflectingProperties.set(name, options);\n }\n }\n else {\n // Abort the request if the property should not be considered changed.\n shouldRequestUpdate = false;\n }\n }\n if (!this._hasRequestedUpdate && shouldRequestUpdate) {\n this._enqueueUpdate();\n }\n }\n /**\n * Requests an update which is processed asynchronously. This should\n * be called when an element should update based on some state not triggered\n * by setting a property. In this case, pass no arguments. It should also be\n * called when manually implementing a property setter. In this case, pass the\n * property `name` and `oldValue` to ensure that any configured property\n * options are honored. Returns the `updateComplete` Promise which is resolved\n * when the update completes.\n *\n * @param name {PropertyKey} (optional) name of requesting property\n * @param oldValue {any} (optional) old value of requesting property\n * @returns {Promise} A Promise that is resolved when the update completes.\n */\n requestUpdate(name, oldValue) {\n this._requestUpdate(name, oldValue);\n return this.updateComplete;\n }\n /**\n * Sets up the element to asynchronously update.\n */\n async _enqueueUpdate() {\n // Mark state updating...\n this._updateState = this._updateState | STATE_UPDATE_REQUESTED;\n let resolve;\n let reject;\n const previousUpdatePromise = this._updatePromise;\n this._updatePromise = new Promise((res, rej) => {\n resolve = res;\n reject = rej;\n });\n try {\n // Ensure any previous update has resolved before updating.\n // This `await` also ensures that property changes are batched.\n await previousUpdatePromise;\n }\n catch (e) {\n // Ignore any previous errors. We only care that the previous cycle is\n // done. Any error should have been handled in the previous update.\n }\n // Make sure the element has connected before updating.\n if (!this._hasConnected) {\n await new Promise((res) => this._hasConnectedResolver = res);\n }\n try {\n const result = this.performUpdate();\n // If `performUpdate` returns a Promise, we await it. This is done to\n // enable coordinating updates with a scheduler. Note, the result is\n // checked to avoid delaying an additional microtask unless we need to.\n if (result != null) {\n await result;\n }\n }\n catch (e) {\n reject(e);\n }\n resolve(!this._hasRequestedUpdate);\n }\n get _hasConnected() {\n return (this._updateState & STATE_HAS_CONNECTED);\n }\n get _hasRequestedUpdate() {\n return (this._updateState & STATE_UPDATE_REQUESTED);\n }\n get hasUpdated() {\n return (this._updateState & STATE_HAS_UPDATED);\n }\n /**\n * Performs an element update. Note, if an exception is thrown during the\n * update, `firstUpdated` and `updated` will not be called.\n *\n * You can override this method to change the timing of updates. If this\n * method is overridden, `super.performUpdate()` must be called.\n *\n * For instance, to schedule updates to occur just before the next frame:\n *\n * ```\n * protected async performUpdate(): Promise<unknown> {\n * await new Promise((resolve) => requestAnimationFrame(() => resolve()));\n * super.performUpdate();\n * }\n * ```\n */\n performUpdate() {\n // Mixin instance properties once, if they exist.\n if (this._instanceProperties) {\n this._applyInstanceProperties();\n }\n let shouldUpdate = false;\n const changedProperties = this._changedProperties;\n try {\n shouldUpdate = this.shouldUpdate(changedProperties);\n if (shouldUpdate) {\n this.update(changedProperties);\n }\n }\n catch (e) {\n // Prevent `firstUpdated` and `updated` from running when there's an\n // update exception.\n shouldUpdate = false;\n throw e;\n }\n finally {\n // Ensure element can accept additional updates after an exception.\n this._markUpdated();\n }\n if (shouldUpdate) {\n if (!(this._updateState & STATE_HAS_UPDATED)) {\n this._updateState = this._updateState | STATE_HAS_UPDATED;\n this.firstUpdated(changedProperties);\n }\n this.updated(changedProperties);\n }\n }\n _markUpdated() {\n this._changedProperties = new Map();\n this._updateState = this._updateState & ~STATE_UPDATE_REQUESTED;\n }\n /**\n * Returns a Promise that resolves when the element has completed updating.\n * The Promise value is a boolean that is `true` if the element completed the\n * update without triggering another update. The Promise result is `false` if\n * a property was set inside `updated()`. If the Promise is rejected, an\n * exception was thrown during the update. This getter can be implemented to\n * await additional state. For example, it is sometimes useful to await a\n * rendered element before fulfilling this Promise. To do this, first await\n * `super.updateComplete` then any subsequent state.\n *\n * @returns {Promise} The Promise returns a boolean that indicates if the\n * update resolved without triggering another update.\n */\n get updateComplete() {\n return this._updatePromise;\n }\n /**\n * Controls whether or not `update` should be called when the element requests\n * an update. By default, this method always returns `true`, but this can be\n * customized to control when to update.\n *\n * * @param _changedProperties Map of changed properties with old values\n */\n shouldUpdate(_changedProperties) {\n return true;\n }\n /**\n * Updates the element. This method reflects property values to attributes.\n * It can be overridden to render and keep updated element DOM.\n * Setting properties inside this method will *not* trigger\n * another update.\n *\n * * @param _changedProperties Map of changed properties with old values\n */\n update(_changedProperties) {\n if (this._reflectingProperties !== undefined &&\n this._reflectingProperties.size > 0) {\n // Use forEach so this works even if for/of loops are compiled to for\n // loops expecting arrays\n this._reflectingProperties.forEach((v, k) => this._propertyToAttribute(k, this[k], v));\n this._reflectingProperties = undefined;\n }\n }\n /**\n * Invoked whenever the element is updated. Implement to perform\n * post-updating tasks via DOM APIs, for example, focusing an element.\n *\n * Setting properties inside this method will trigger the element to update\n * again after this update cycle completes.\n *\n * * @param _changedProperties Map of changed properties with old values\n */\n updated(_changedProperties) {\n }\n /**\n * Invoked when the element is first updated. Implement to perform one time\n * work on the element after update.\n *\n * Setting properties inside this method will trigger the element to update\n * again after this update cycle completes.\n *\n * * @param _changedProperties Map of changed properties with old values\n */\n firstUpdated(_changedProperties) {\n }\n}\n/**\n * Marks class as having finished creating properties.\n */\nUpdatingElement.finalized = true;\n//# sourceMappingURL=updating-element.js.map","/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\nconst legacyCustomElement = (tagName, clazz) => {\n window.customElements.define(tagName, clazz);\n // Cast as any because TS doesn't recognize the return type as being a\n // subtype of the decorated class when clazz is typed as\n // `Constructor<HTMLElement>` for some reason.\n // `Constructor<HTMLElement>` is helpful to make sure the decorator is\n // applied to elements however.\n // tslint:disable-next-line:no-any\n return clazz;\n};\nconst standardCustomElement = (tagName, descriptor) => {\n const { kind, elements } = descriptor;\n return {\n kind,\n elements,\n // This callback is called once the class is otherwise fully defined\n finisher(clazz) {\n window.customElements.define(tagName, clazz);\n }\n };\n};\n/**\n * Class decorator factory that defines the decorated class as a custom element.\n *\n * @param tagName the name of the custom element to define\n */\nexport const customElement = (tagName) => (classOrDescriptor) => (typeof classOrDescriptor === 'function') ?\n legacyCustomElement(tagName, classOrDescriptor) :\n standardCustomElement(tagName, classOrDescriptor);\nconst standardProperty = (options, element) => {\n // When decorating an accessor, pass it through and add property metadata.\n // Note, the `hasOwnProperty` check in `createProperty` ensures we don't\n // stomp over the user's accessor.\n if (element.kind === 'method' && element.descriptor &&\n !('value' in element.descriptor)) {\n return Object.assign({}, element, { finisher(clazz) {\n clazz.createProperty(element.key, options);\n } });\n }\n else {\n // createProperty() takes care of defining the property, but we still\n // must return some kind of descriptor, so return a descriptor for an\n // unused prototype field. The finisher calls createProperty().\n return {\n kind: 'field',\n key: Symbol(),\n placement: 'own',\n descriptor: {},\n // When @babel/plugin-proposal-decorators implements initializers,\n // do this instead of the initializer below. See:\n // https://github.com/babel/babel/issues/9260 extras: [\n // {\n // kind: 'initializer',\n // placement: 'own',\n // initializer: descriptor.initializer,\n // }\n // ],\n // tslint:disable-next-line:no-any decorator\n initializer() {\n if (typeof element.initializer === 'function') {\n this[element.key] = element.initializer.call(this);\n }\n },\n finisher(clazz) {\n clazz.createProperty(element.key, options);\n }\n };\n }\n};\nconst legacyProperty = (options, proto, name) => {\n proto.constructor\n .createProperty(name, options);\n};\n/**\n * A property decorator which creates a LitElement property which reflects a\n * corresponding attribute value. A `PropertyDeclaration` may optionally be\n * supplied to configure property features.\n *\n * @ExportDecoratedItems\n */\nexport function property(options) {\n // tslint:disable-next-line:no-any decorator\n return (protoOrDescriptor, name) => (name !== undefined) ?\n legacyProperty(options, protoOrDescriptor, name) :\n standardProperty(options, protoOrDescriptor);\n}\n/**\n * A property decorator that converts a class property into a getter that\n * executes a querySelector on the element's renderRoot.\n *\n * @ExportDecoratedItems\n */\nexport function query(selector) {\n return (protoOrDescriptor, \n // tslint:disable-next-line:no-any decorator\n name) => {\n const descriptor = {\n get() {\n return this.renderRoot.querySelector(selector);\n },\n enumerable: true,\n configurable: true,\n };\n return (name !== undefined) ?\n legacyQuery(descriptor, protoOrDescriptor, name) :\n standardQuery(descriptor, protoOrDescriptor);\n };\n}\n/**\n * A property decorator that converts a class property into a getter\n * that executes a querySelectorAll on the element's renderRoot.\n *\n * @ExportDecoratedItems\n */\nexport function queryAll(selector) {\n return (protoOrDescriptor, \n // tslint:disable-next-line:no-any decorator\n name) => {\n const descriptor = {\n get() {\n return this.renderRoot.querySelectorAll(selector);\n },\n enumerable: true,\n configurable: true,\n };\n return (name !== undefined) ?\n legacyQuery(descriptor, protoOrDescriptor, name) :\n standardQuery(descriptor, protoOrDescriptor);\n };\n}\nconst legacyQuery = (descriptor, proto, name) => {\n Object.defineProperty(proto, name, descriptor);\n};\nconst standardQuery = (descriptor, element) => ({\n kind: 'method',\n placement: 'prototype',\n key: element.key,\n descriptor,\n});\nconst standardEventOptions = (options, element) => {\n return Object.assign({}, element, { finisher(clazz) {\n Object.assign(clazz.prototype[element.key], options);\n } });\n};\nconst legacyEventOptions = \n// tslint:disable-next-line:no-any legacy decorator\n(options, proto, name) => {\n Object.assign(proto[name], options);\n};\n/**\n * Adds event listener options to a method used as an event listener in a\n * lit-html template.\n *\n * @param options An object that specifis event listener options as accepted by\n * `EventTarget#addEventListener` and `EventTarget#removeEventListener`.\n *\n * Current browsers support the `capture`, `passive`, and `once` options. See:\n * https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Parameters\n *\n * @example\n *\n * class MyElement {\n *\n * clicked = false;\n *\n * render() {\n * return html`<div @click=${this._onClick}`><button></button></div>`;\n * }\n *\n * @eventOptions({capture: true})\n * _onClick(e) {\n * this.clicked = true;\n * }\n * }\n */\nexport const eventOptions = (options) => \n// Return value typed as any to prevent TypeScript from complaining that\n// standard decorator function signature does not match TypeScript decorator\n// signature\n// TODO(kschaaf): unclear why it was only failing on this decorator and not\n// the others\n((protoOrDescriptor, name) => (name !== undefined) ?\n legacyEventOptions(options, protoOrDescriptor, name) :\n standardEventOptions(options, protoOrDescriptor));\n//# sourceMappingURL=decorators.js.map","/**\n@license\nCopyright (c) 2019 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at\nhttp://polymer.github.io/LICENSE.txt The complete set of authors may be found at\nhttp://polymer.github.io/AUTHORS.txt The complete set of contributors may be\nfound at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as\npart of the polymer project is also subject to an additional IP rights grant\nfound at http://polymer.github.io/PATENTS.txt\n*/\nexport const supportsAdoptingStyleSheets = ('adoptedStyleSheets' in Document.prototype) &&\n ('replace' in CSSStyleSheet.prototype);\nconst constructionToken = Symbol();\nexport class CSSResult {\n constructor(cssText, safeToken) {\n if (safeToken !== constructionToken) {\n throw new Error('CSSResult is not constructable. Use `unsafeCSS` or `css` instead.');\n }\n this.cssText = cssText;\n }\n // Note, this is a getter so that it's lazy. In practice, this means\n // stylesheets are not created until the first element instance is made.\n get styleSheet() {\n if (this._styleSheet === undefined) {\n // Note, if `adoptedStyleSheets` is supported then we assume CSSStyleSheet\n // is constructable.\n if (supportsAdoptingStyleSheets) {\n this._styleSheet = new CSSStyleSheet();\n this._styleSheet.replaceSync(this.cssText);\n }\n else {\n this._styleSheet = null;\n }\n }\n return this._styleSheet;\n }\n toString() {\n return this.cssText;\n }\n}\n/**\n * Wrap a value for interpolation in a css tagged template literal.\n *\n * This is unsafe because untrusted CSS text can be used to phone home\n * or exfiltrate data to an attacker controlled site. Take care to only use\n * this with trusted input.\n */\nexport const unsafeCSS = (value) => {\n return new CSSResult(String(value), constructionToken);\n};\nconst textFromCSSResult = (value) => {\n if (value instanceof CSSResult) {\n return value.cssText;\n }\n else {\n throw new Error(`Value passed to 'css' function must be a 'css' function result: ${value}. Use 'unsafeCSS' to pass non-literal values, but\n take care to ensure page security.`);\n }\n};\n/**\n * Template tag which which can be used with LitElement's `style` property to\n * set element styles. For security reasons, only literal string values may be\n * used. To incorporate non-literal values `unsafeCSS` may be used inside a\n * template string part.\n */\nexport const css = (strings, ...values) => {\n const cssText = values.reduce((acc, v, idx) => acc + textFromCSSResult(v) + strings[idx + 1], strings[0]);\n return new CSSResult(cssText, constructionToken);\n};\n//# sourceMappingURL=css-tag.js.map","/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\nimport { TemplateResult } from 'lit-html';\nimport { render } from 'lit-html/lib/shady-render.js';\nimport { UpdatingElement } from './lib/updating-element.js';\nexport * from './lib/updating-element.js';\nexport * from './lib/decorators.js';\nexport { html, svg, TemplateResult, SVGTemplateResult } from 'lit-html/lit-html.js';\nimport { supportsAdoptingStyleSheets } from './lib/css-tag.js';\nexport * from './lib/css-tag.js';\n// IMPORTANT: do not change the property name or the assignment expression.\n// This line will be used in regexes to search for LitElement usage.\n// TODO(justinfagnani): inject version number at build time\n(window['litElementVersions'] || (window['litElementVersions'] = []))\n .push('2.0.1');\n/**\n * Minimal implementation of Array.prototype.flat\n * @param arr the array to flatten\n * @param result the accumlated result\n */\nfunction arrayFlat(styles, result = []) {\n for (let i = 0, length = styles.length; i < length; i++) {\n const value = styles[i];\n if (Array.isArray(value)) {\n arrayFlat(value, result);\n }\n else {\n result.push(value);\n }\n }\n return result;\n}\n/** Deeply flattens styles array. Uses native flat if available. */\nconst flattenStyles = (styles) => styles.flat ? styles.flat(Infinity) : arrayFlat(styles);\nexport class LitElement extends UpdatingElement {\n /** @nocollapse */\n static finalize() {\n super.finalize();\n // Prepare styling that is stamped at first render time. Styling\n // is built from user provided `styles` or is inherited from the superclass.\n this._styles =\n this.hasOwnProperty(JSCompiler_renameProperty('styles', this)) ?\n this._getUniqueStyles() :\n this._styles || [];\n }\n /** @nocollapse */\n static _getUniqueStyles() {\n // Take care not to call `this.styles` multiple times since this generates\n // new CSSResults each time.\n // TODO(sorvell): Since we do not cache CSSResults by input, any\n // shared styles will generate new stylesheet objects, which is wasteful.\n // This should be addressed when a browser ships constructable\n // stylesheets.\n const userStyles = this.styles;\n const styles = [];\n if (Array.isArray(userStyles)) {\n const flatStyles = flattenStyles(userStyles);\n // As a performance optimization to avoid duplicated styling that can\n // occur especially when composing via subclassing, de-duplicate styles\n // preserving the last item in the list. The last item is kept to\n // try to preserve cascade order with the assumption that it's most\n // important that last added styles override previous styles.\n const styleSet = flatStyles.reduceRight((set, s) => {\n set.add(s);\n // on IE set.add does not return the set.\n return set;\n }, new Set());\n // Array.from does not work on Set in IE\n styleSet.forEach((v) => styles.unshift(v));\n }\n else if (userStyles) {\n styles.push(userStyles);\n }\n return styles;\n }\n /**\n * Performs element initialization. By default this calls `createRenderRoot`\n * to create the element `renderRoot` node and captures any pre-set values for\n * registered properties.\n */\n initialize() {\n super.initialize();\n this.renderRoot =\n this.createRenderRoot();\n // Note, if renderRoot is not a shadowRoot, styles would/could apply to the\n // element's getRootNode(). While this could be done, we're choosing not to\n // support this now since it would require different logic around de-duping.\n if (window.ShadowRoot && this.renderRoot instanceof window.ShadowRoot) {\n this.adoptStyles();\n }\n }\n /**\n * Returns the node into which the element should render and by default\n * creates and returns an open shadowRoot. Implement to customize where the\n * element's DOM is rendered. For example, to render into the element's\n * childNodes, return `this`.\n * @returns {Element|DocumentFragment} Returns a node into which to render.\n */\n createRenderRoot() {\n return this.attachShadow({ mode: 'open' });\n }\n /**\n * Applies styling to the element shadowRoot using the `static get styles`\n * property. Styling will apply using `shadowRoot.adoptedStyleSheets` where\n * available and will fallback otherwise. When Shadow DOM is polyfilled,\n * ShadyCSS scopes styles and adds them to the document. When Shadow DOM\n * is available but `adoptedStyleSheets` is not, styles are appended to the\n * end of the `shadowRoot` to [mimic spec\n * behavior](https://wicg.github.io/construct-stylesheets/#using-constructed-stylesheets).\n */\n adoptStyles() {\n const styles = this.constructor._styles;\n if (styles.length === 0) {\n return;\n }\n // There are three separate cases here based on Shadow DOM support.\n // (1) shadowRoot polyfilled: use ShadyCSS\n // (2) shadowRoot.adoptedStyleSheets available: use it.\n // (3) shadowRoot.adoptedStyleSheets polyfilled: append styles after\n // rendering\n if (window.ShadyCSS !== undefined && !window.ShadyCSS.nativeShadow) {\n window.ShadyCSS.ScopingShim.prepareAdoptedCssText(styles.map((s) => s.cssText), this.localName);\n }\n else if (supportsAdoptingStyleSheets) {\n this.renderRoot.adoptedStyleSheets =\n styles.map((s) => s.styleSheet);\n }\n else {\n // This must be done after rendering so the actual style insertion is done\n // in `update`.\n this._needsShimAdoptedStyleSheets = true;\n }\n }\n connectedCallback() {\n super.connectedCallback();\n // Note, first update/render handles styleElement so we only call this if\n // connected after first update.\n if (this.hasUpdated && window.ShadyCSS !== undefined) {\n window.ShadyCSS.styleElement(this);\n }\n }\n /**\n * Updates the element. This method reflects property values to attributes\n * and calls `render` to render DOM via lit-html. Setting properties inside\n * this method will *not* trigger another update.\n * * @param _changedProperties Map of changed properties with old values\n */\n update(changedProperties) {\n super.update(changedProperties);\n const templateResult = this.render();\n if (templateResult instanceof TemplateResult) {\n this.constructor\n .render(templateResult, this.renderRoot, { scopeName: this.localName, eventContext: this });\n }\n // When native Shadow DOM is used but adoptedStyles are not supported,\n // insert styling after rendering to ensure adoptedStyles have highest\n // priority.\n if (this._needsShimAdoptedStyleSheets) {\n this._needsShimAdoptedStyleSheets = false;\n this.constructor._styles.forEach((s) => {\n const style = document.createElement('style');\n style.textContent = s.cssText;\n this.renderRoot.appendChild(style);\n });\n }\n }\n /**\n * Invoked on each update to perform rendering tasks. This method must return\n * a lit-html TemplateResult. Setting properties inside this method will *not*\n * trigger the element to update.\n */\n render() {\n }\n}\n/**\n * Ensure this class is marked as `finalized` as an optimization ensuring\n * it will not needlessly try to `finalize`.\n */\nLitElement.finalized = true;\n/**\n * Render method used to render the lit-html TemplateResult to the element's\n * DOM.\n * @param {TemplateResult} Template to render.\n * @param {Element|DocumentFragment} Node into which to render.\n * @param {String} Element name.\n * @nocollapse\n */\nLitElement.render = render;\n//# sourceMappingURL=lit-element.js.map","import { LitElement } from 'lit-element';\nexport * from 'lit-element';\nexport class WiredBase extends LitElement {\n fireEvent(name, detail, bubbles = true, composed = true) {\n if (name) {\n const init = {\n bubbles: (typeof bubbles === 'boolean') ? bubbles : true,\n composed: (typeof composed === 'boolean') ? composed : true\n };\n if (detail) {\n init.detail = detail;\n }\n const CE = (window.SlickCustomEvent || CustomEvent);\n this.dispatchEvent(new CE(name, init));\n }\n }\n}\n","export class Segment {\n constructor(p1, p2) {\n this.xi = Number.MAX_VALUE;\n this.yi = Number.MAX_VALUE;\n this.px1 = p1[0];\n this.py1 = p1[1];\n this.px2 = p2[0];\n this.py2 = p2[1];\n this.a = this.py2 - this.py1;\n this.b = this.px1 - this.px2;\n this.c = this.px2 * this.py1 - this.px1 * this.py2;\n this._undefined = ((this.a === 0) && (this.b === 0) && (this.c === 0));\n }\n isUndefined() {\n return this._undefined;\n }\n intersects(otherSegment) {\n if (this.isUndefined() || otherSegment.isUndefined()) {\n return false;\n }\n let grad1 = Number.MAX_VALUE;\n let grad2 = Number.MAX_VALUE;\n let int1 = 0, int2 = 0;\n const a = this.a, b = this.b, c = this.c;\n if (Math.abs(b) > 0.00001) {\n grad1 = -a / b;\n int1 = -c / b;\n }\n if (Math.abs(otherSegment.b) > 0.00001) {\n grad2 = -otherSegment.a / otherSegment.b;\n int2 = -otherSegment.c / otherSegment.b;\n }\n if (grad1 === Number.MAX_VALUE) {\n if (grad2 === Number.MAX_VALUE) {\n if ((-c / a) !== (-otherSegment.c / otherSegment.a)) {\n return false;\n }\n if ((this.py1 >= Math.min(otherSegment.py1, otherSegment.py2)) && (this.py1 <= Math.max(otherSegment.py1, otherSegment.py2))) {\n this.xi = this.px1;\n this.yi = this.py1;\n return true;\n }\n if ((this.py2 >= Math.min(otherSegment.py1, otherSegment.py2)) && (this.py2 <= Math.max(otherSegment.py1, otherSegment.py2))) {\n this.xi = this.px2;\n this.yi = this.py2;\n return true;\n }\n return false;\n }\n this.xi = this.px1;\n this.yi = (grad2 * this.xi + int2);\n if (((this.py1 - this.yi) * (this.yi - this.py2) < -0.00001) || ((otherSegment.py1 - this.yi) * (this.yi - otherSegment.py2) < -0.00001)) {\n return false;\n }\n if (Math.abs(otherSegment.a) < 0.00001) {\n if ((otherSegment.px1 - this.xi) * (this.xi - otherSegment.px2) < -0.00001) {\n return false;\n }\n return true;\n }\n return true;\n }\n if (grad2 === Number.MAX_VALUE) {\n this.xi = otherSegment.px1;\n this.yi = grad1 * this.xi + int1;\n if (((otherSegment.py1 - this.yi) * (this.yi - otherSegment.py2) < -0.00001) || ((this.py1 - this.yi) * (this.yi - this.py2) < -0.00001)) {\n return false;\n }\n if (Math.abs(a) < 0.00001) {\n if ((this.px1 - this.xi) * (this.xi - this.px2) < -0.00001) {\n return false;\n }\n return true;\n }\n return true;\n }\n if (grad1 === grad2) {\n if (int1 !== int2) {\n return false;\n }\n if ((this.px1 >= Math.min(otherSegment.px1, otherSegment.px2)) && (this.px1 <= Math.max(otherSegment.py1, otherSegment.py2))) {\n this.xi = this.px1;\n this.yi = this.py1;\n return true;\n }\n if ((this.px2 >= Math.min(otherSegment.px1, otherSegment.px2)) && (this.px2 <= Math.max(otherSegment.px1, otherSegment.px2))) {\n this.xi = this.px2;\n this.yi = this.py2;\n return true;\n }\n return false;\n }\n this.xi = ((int2 - int1) / (grad1 - grad2));\n this.yi = (grad1 * this.xi + int1);\n if (((this.px1 - this.xi) * (this.xi - this.px2) < -0.00001) || ((otherSegment.px1 - this.xi) * (this.xi - otherSegment.px2) < -0.00001)) {\n return false;\n }\n return true;\n }\n}\nexport function linerIntersection(l1, l2) {\n const a1 = l1[1][1] - l1[0][1];\n const b1 = l1[0][0] - l1[1][0];\n const c1 = a1 * l1[0][0] + b1 * l1[0][1];\n const a2 = l2[1][1] - l2[0][1];\n const b2 = l2[0][0] - l2[1][0];\n const c2 = a2 * l2[0][0] + b2 * l2[0][1];\n const determinant = a1 * b2 - a2 * b1;\n if (determinant) {\n return [\n Math.round((b2 * c1 - b1 * c2) / determinant),\n Math.round((a1 * c2 - a2 * c1) / determinant)\n ];\n }\n return null;\n}\nexport function centroid(points) {\n let area = 0, cx = 0, cy = 0;\n for (let i = 0; i < points.length; i++) {\n const p = points[i];\n const next = i === (points.length - 1) ? points[0] : points[i + 1];\n area += p[0] * next[1] - next[0] * p[1];\n }\n area = area / 2;\n for (let i = 0; i < points.length; i++) {\n const p = points[i];\n const next = i === (points.length - 1) ? points[0] : points[i + 1];\n cx += (p[0] + next[0]) * (p[0] * next[1] - next[0] * p[1]);\n cy += (p[1] + next[1]) * (p[0] * next[1] - next[0] * p[1]);\n }\n return [cx / (6 * area), cy / (6 * area)];\n}\n","import { Segment } from '../geometry';\nexport class HachureIterator {\n constructor(top, bottom, left, right, gap, sinAngle, cosAngle, tanAngle) {\n this.deltaX = 0;\n this.hGap = 0;\n this.top = top;\n this.bottom = bottom;\n this.left = left;\n this.right = right;\n this.gap = gap;\n this.sinAngle = sinAngle;\n this.tanAngle = tanAngle;\n if (Math.abs(sinAngle) < 0.0001) {\n this.pos = left + gap;\n }\n else if (Math.abs(sinAngle) > 0.9999) {\n this.pos = top + gap;\n }\n else {\n this.deltaX = (bottom - top) * Math.abs(tanAngle);\n this.pos = left - Math.abs(this.deltaX);\n this.hGap = Math.abs(gap / cosAngle);\n this.sLeft = new Segment([left, bottom], [left, top]);\n this.sRight = new Segment([right, bottom], [right, top]);\n }\n }\n nextLine() {\n if (Math.abs(this.sinAngle) < 0.0001) {\n if (this.pos < this.right) {\n const line = [this.pos, this.top, this.pos, this.bottom];\n this.pos += this.gap;\n return line;\n }\n }\n else if (Math.abs(this.sinAngle) > 0.9999) {\n if (this.pos < this.bottom) {\n const line = [this.left, this.pos, this.right, this.pos];\n this.pos += this.gap;\n return line;\n }\n }\n else {\n let xLower = this.pos - this.deltaX / 2;\n let xUpper = this.pos + this.deltaX / 2;\n let yLower = this.bottom;\n let yUpper = this.top;\n if (this.pos < (this.right + this.deltaX)) {\n while (((xLower < this.left) && (xUpper < this.left)) || ((xLower > this.right) && (xUpper > this.right))) {\n this.pos += this.hGap;\n xLower = this.pos - this.deltaX / 2;\n xUpper = this.pos + this.deltaX / 2;\n if (this.pos > (this.right + this.deltaX)) {\n return null;\n }\n }\n const s = new Segment([xLower, yLower], [xUpper, yUpper]);\n if (this.sLeft && s.intersects(this.sLeft)) {\n xLower = s.xi;\n yLower = s.yi;\n }\n if (this.sRight && s.intersects(this.sRight)) {\n xUpper = s.xi;\n yUpper = s.yi;\n }\n if (this.tanAngle > 0) {\n xLower = this.right - (xLower - this.left);\n xUpper = this.right - (xUpper - this.left);\n }\n const line = [xLower, yLower, xUpper, yUpper];\n this.pos += this.hGap;\n return line;\n }\n }\n return null;\n }\n}\n","import { Segment } from '../geometry';\nimport { HachureIterator } from '../utils/hachure';\nexport function lineLength(line) {\n const p1 = line[0];\n const p2 = line[1];\n return Math.sqrt(Math.pow(p1[0] - p2[0], 2) + Math.pow(p1[1] - p2[1], 2));\n}\nexport function getIntersectingLines(line, points) {\n const intersections = [];\n const s1 = new Segment([line[0], line[1]], [line[2], line[3]]);\n for (let i = 0; i < points.length; i++) {\n const s2 = new Segment(points[i], points[(i + 1) % points.length]);\n if (s1.intersects(s2)) {\n intersections.push([s1.xi, s1.yi]);\n }\n }\n return intersections;\n}\nexport function affine(x, y, cx, cy, sinAnglePrime, cosAnglePrime, R) {\n const A = -cx * cosAnglePrime - cy * sinAnglePrime + cx;\n const B = R * (cx * sinAnglePrime - cy * cosAnglePrime) + cy;\n const C = cosAnglePrime;\n const D = sinAnglePrime;\n const E = -R * sinAnglePrime;\n const F = R * cosAnglePrime;\n return [\n A + C * x + D * y,\n B + E * x + F * y\n ];\n}\nexport function hachureLinesForPolygon(points, o) {\n const ret = [];\n if (points && points.length) {\n let left = points[0][0];\n let right = points[0][0];\n let top = points[0][1];\n let bottom = points[0][1];\n for (let i = 1; i < points.length; i++) {\n left = Math.min(left, points[i][0]);\n right = Math.max(right, points[i][0]);\n top = Math.min(top, points[i][1]);\n bottom = Math.max(bottom, points[i][1]);\n }\n const angle = o.hachureAngle;\n let gap = o.hachureGap;\n if (gap < 0) {\n gap = o.strokeWidth * 4;\n }\n gap = Math.max(gap, 0.1);\n const radPerDeg = Math.PI / 180;\n const hachureAngle = (angle % 180) * radPerDeg;\n const cosAngle = Math.cos(hachureAngle);\n const sinAngle = Math.sin(hachureAngle);\n const tanAngle = Math.tan(hachureAngle);\n const it = new HachureIterator(top - 1, bottom + 1, left - 1, right + 1, gap, sinAngle, cosAngle, tanAngle);\n let rect;\n while ((rect = it.nextLine()) != null) {\n const lines = getIntersectingLines(rect, points);\n for (let i = 0; i < lines.length; i++) {\n if (i < (lines.length - 1)) {\n const p1 = lines[i];\n const p2 = lines[i + 1];\n ret.push([p1, p2]);\n }\n }\n }\n }\n return ret;\n}\nexport function hachureLinesForEllipse(helper, cx, cy, width, height, o) {\n const ret = [];\n let rx = Math.abs(width / 2);\n let ry = Math.abs(height / 2);\n rx += helper.randOffset(rx * 0.05, o);\n ry += helper.randOffset(ry * 0.05, o);\n const angle = o.hachureAngle;\n let gap = o.hachureGap;\n if (gap <= 0) {\n gap = o.strokeWidth * 4;\n }\n let fweight = o.fillWeight;\n if (fweight < 0) {\n fweight = o.strokeWidth / 2;\n }\n const radPerDeg = Math.PI / 180;\n const hachureAngle = (angle % 180) * radPerDeg;\n const tanAngle = Math.tan(hachureAngle);\n const aspectRatio = ry / rx;\n const hyp = Math.sqrt(aspectRatio * tanAngle * aspectRatio * tanAngle + 1);\n const sinAnglePrime = aspectRatio * tanAngle / hyp;\n const cosAnglePrime = 1 / hyp;\n const gapPrime = gap / ((rx * ry / Math.sqrt((ry * cosAnglePrime) * (ry * cosAnglePrime) + (rx * sinAnglePrime) * (rx * sinAnglePrime))) / rx);\n let halfLen = Math.sqrt((rx * rx) - (cx - rx + gapPrime) * (cx - rx + gapPrime));\n for (let xPos = cx - rx + gapPrime; xPos < cx + rx; xPos += gapPrime) {\n halfLen = Math.sqrt((rx * rx) - (cx - xPos) * (cx - xPos));\n const p1 = affine(xPos, cy - halfLen, cx, cy, sinAnglePrime, cosAnglePrime, aspectRatio);\n const p2 = affine(xPos, cy + halfLen, cx, cy, sinAnglePrime, cosAnglePrime, aspectRatio);\n ret.push([p1, p2]);\n }\n return ret;\n}\n","import { hachureLinesForPolygon, hachureLinesForEllipse } from 'roughjs/bin/fillers/filler-utils';\nconst __maxRandomnessOffset = 2;\nconst __roughness = 1;\nconst __bowing = 0.85;\nconst __curveTightness = 0;\nconst __curveStepCount = 9;\nclass WiresPath {\n constructor() {\n this.p = '';\n }\n get value() {\n return this.p.trim();\n }\n moveTo(x, y) {\n this.p = `${this.p}M ${x} ${y} `;\n }\n bcurveTo(cp1x, cp1y, cp2x, cp2y, x, y) {\n this.p = `${this.p}C ${cp1x} ${cp1y}, ${cp2x} ${cp2y}, ${x} ${y} `;\n }\n}\nexport function svgNode(tagName, attributes) {\n const n = document.createElementNS('http://www.w3.org/2000/svg', tagName);\n if (attributes) {\n for (const p in attributes) {\n n.setAttributeNS(null, p, attributes[p]);\n }\n }\n return n;\n}\nfunction _getOffset(min, max) {\n return __roughness * ((Math.random() * (max - min)) + min);\n}\nfunction _line(x1, y1, x2, y2, existingPath) {\n const lengthSq = Math.pow((x1 - x2), 2) + Math.pow((y1 - y2), 2);\n let offset = __maxRandomnessOffset || 0;\n if ((offset * offset * 100) > lengthSq) {\n offset = Math.sqrt(lengthSq) / 10;\n }\n const halfOffset = offset / 2;\n const divergePoint = 0.2 + Math.random() * 0.2;\n let midDispX = __bowing * __maxRandomnessOffset * (y2 - y1) / 200;\n let midDispY = __bowing * __maxRandomnessOffset * (x1 - x2) / 200;\n midDispX = _getOffset(-midDispX, midDispX);\n midDispY = _getOffset(-midDispY, midDispY);\n const path = existingPath || new WiresPath();\n path.moveTo(x1 + _getOffset(-offset, offset), y1 + _getOffset(-offset, offset));\n path.bcurveTo(midDispX + x1 + (x2 - x1) * divergePoint + _getOffset(-offset, offset), midDispY + y1 + (y2 - y1) * divergePoint + _getOffset(-offset, offset), midDispX + x1 + 2 * (x2 - x1) * divergePoint + _getOffset(-offset, offset), midDispY + y1 + 2 * (y2 - y1) * divergePoint + _getOffset(-offset, offset), x2 + _getOffset(-offset, offset), y2 + _getOffset(-offset, offset));\n path.moveTo(x1 + _getOffset(-halfOffset, halfOffset), y1 + _getOffset(-halfOffset, halfOffset));\n path.bcurveTo(midDispX + x1 + (x2 - x1) * divergePoint + _getOffset(-halfOffset, halfOffset), midDispY + y1 + (y2 - y1) * divergePoint + _getOffset(-halfOffset, halfOffset), midDispX + x1 + 2 * (x2 - x1) * divergePoint + _getOffset(-halfOffset, halfOffset), midDispY + y1 + 2 * (y2 - y1) * divergePoint + _getOffset(-halfOffset, halfOffset), x2 + _getOffset(-halfOffset, halfOffset), y2 + _getOffset(-halfOffset, halfOffset));\n return path;\n}\nfunction _continuousLine(x1, y1, x2, y2, move = false, overwrite = false, path) {\n path = path || new WiresPath();\n const lengthSq = Math.pow((x1 - x2), 2) + Math.pow((y1 - y2), 2);\n let offset = __maxRandomnessOffset || 0;\n if ((offset * offset * 100) > lengthSq) {\n offset = Math.sqrt(lengthSq) / 10;\n }\n const halfOffset = offset / 2;\n const divergePoint = 0.2 + Math.random() * 0.2;\n let midDispX = __bowing * __maxRandomnessOffset * (y2 - y1) / 200;\n let midDispY = __bowing * __maxRandomnessOffset * (x1 - x2) / 200;\n midDispX = _getOffset(-midDispX, midDispX);\n midDispY = _getOffset(-midDispY, midDispY);\n if (move) {\n path.moveTo(x1 + _getOffset(-offset, offset), y1 + _getOffset(-offset, offset));\n }\n if (!overwrite) {\n path.bcurveTo(midDispX + x1 + (x2 - x1) * divergePoint + _getOffset(-offset, offset), midDispY + y1 + (y2 - y1) * divergePoint + _getOffset(-offset, offset), midDispX + x1 + 2 * (x2 - x1) * divergePoint + _getOffset(-offset, offset), midDispY + y1 + 2 * (y2 - y1) * divergePoint + _getOffset(-offset, offset), x2 + _getOffset(-offset, offset), y2 + _getOffset(-offset, offset));\n }\n else {\n path.bcurveTo(midDispX + x1 + (x2 - x1) * divergePoint + _getOffset(-halfOffset, halfOffset), midDispY + y1 + (y2 - y1) * divergePoint + _getOffset(-halfOffset, halfOffset), midDispX + x1 + 2 * (x2 - x1) * divergePoint + _getOffset(-halfOffset, halfOffset), midDispY + y1 + 2 * (y2 - y1) * divergePoint + _getOffset(-halfOffset, halfOffset), x2 + _getOffset(-halfOffset, halfOffset), y2 + _getOffset(-halfOffset, halfOffset));\n }\n return path;\n}\nfunction _curve(vertArray, existingPath) {\n const vertArrayLength = vertArray.length;\n let path = existingPath || new WiresPath();\n if (vertArrayLength > 3) {\n const b = [];\n const s = 1 - __curveTightness;\n path.moveTo(vertArray[1][0], vertArray[1][1]);\n for (let i = 1; (i + 2) < vertArrayLength; i++) {\n const cachedVertArray = vertArray[i];\n b[0] = [cachedVertArray[0], cachedVertArray[1]];\n b[1] = [cachedVertArray[0] + (s * vertArray[i + 1][0] - s * vertArray[i - 1][0]) / 6, cachedVertArray[1] + (s * vertArray[i + 1][1] - s * vertArray[i - 1][1]) / 6];\n b[2] = [vertArray[i + 1][0] + (s * vertArray[i][0] - s * vertArray[i + 2][0]) / 6, vertArray[i + 1][1] + (s * vertArray[i][1] - s * vertArray[i + 2][1]) / 6];\n b[3] = [vertArray[i + 1][0], vertArray[i + 1][1]];\n path.bcurveTo(b[1][0], b[1][1], b[2][0], b[2][1], b[3][0], b[3][1]);\n }\n }\n else if (vertArrayLength === 3) {\n path.moveTo(vertArray[0][0], vertArray[0][1]);\n path.bcurveTo(vertArray[1][0], vertArray[1][1], vertArray[2][0], vertArray[2][1], vertArray[2][0], vertArray[2][1]);\n }\n else if (vertArrayLength === 2) {\n path = _line(vertArray[0][0], vertArray[0][1], vertArray[1][0], vertArray[1][1], path);\n }\n return path;\n}\nfunction _ellipse(ellipseInc, cx, cy, rx, ry, offset, overlap, existingPath) {\n const radOffset = _getOffset(-0.5, 0.5) - Math.PI / 2;\n const points = [];\n points.push([\n _getOffset(-offset, offset) + cx + 0.9 * rx * Math.cos(radOffset - ellipseInc),\n _getOffset(-offset, offset) + cy + 0.9 * ry * Math.sin(radOffset - ellipseInc)\n ]);\n for (let angle = radOffset; angle < (Math.PI * 2 + radOffset - 0.01); angle = angle + ellipseInc) {\n points.push([\n _getOffset(-offset, offset) + cx + rx * Math.cos(angle),\n _getOffset(-offset, offset) + cy + ry * Math.sin(angle)\n ]);\n }\n points.push([\n _getOffset(-offset, offset) + cx + rx * Math.cos(radOffset + Math.PI * 2 + overlap * 0.5),\n _getOffset(-offset, offset) + cy + ry * Math.sin(radOffset + Math.PI * 2 + overlap * 0.5)\n ]);\n points.push([\n _getOffset(-offset, offset) + cx + 0.98 * rx * Math.cos(radOffset + overlap),\n _getOffset(-offset, offset) + cy + 0.98 * ry * Math.sin(radOffset + overlap)\n ]);\n points.push([\n _getOffset(-offset, offset) + cx + 0.9 * rx * Math.cos(radOffset + overlap * 0.5),\n _getOffset(-offset, offset) + cy + 0.9 * ry * Math.sin(radOffset + overlap * 0.5)\n ]);\n return _curve(points, existingPath);\n}\nexport function line(parent, x1, y1, x2, y2) {\n const path = _line(x1, y1, x2, y2);\n const node = svgNode('path', { d: path.value });\n parent.appendChild(node);\n return node;\n}\nexport function rectangle(parent, x, y, width, height) {\n x = x + 2;\n y = y + 2;\n width = width - 4;\n height = height - 4;\n let path = _line(x, y, x + width, y);\n path = _line(x + width, y, x + width, y + height, path);\n path = _line(x + width, y + height, x, y + height, path);\n path = _line(x, y + height, x, y, path);\n const node = svgNode('path', { d: path.value });\n parent.appendChild(node);\n return node;\n}\nexport function polygon(parent, vertices) {\n let path;\n const vCount = vertices.length;\n if (vCount > 2) {\n for (let i = 0; i < 2; i++) {\n let move = true;\n for (let i = 1; i < vCount; i++) {\n path = _continuousLine(vertices[i - 1][0], vertices[i - 1][1], vertices[i][0], vertices[i][1], move, i > 0, path);\n move = false;\n }\n path = _continuousLine(vertices[vCount - 1][0], vertices[vCount - 1][1], vertices[0][0], vertices[0][1], move, i > 0, path);\n }\n }\n else if (vCount === 2) {\n path = _line(vertices[0][0], vertices[0][1], vertices[1][0], vertices[1][1]);\n }\n else {\n path = new WiresPath();\n }\n const node = svgNode('path', { d: path.value });\n parent.appendChild(node);\n return node;\n}\nexport function ellipse(parent, x, y, width, height) {\n width = Math.max(width > 10 ? width - 4 : width - 1, 1);\n height = Math.max(height > 10 ? height - 4 : height - 1, 1);\n const ellipseInc = (Math.PI * 2) / __curveStepCount;\n let rx = Math.abs(width / 2);\n let ry = Math.abs(height / 2);\n rx += _getOffset(-rx * 0.05, rx * 0.05);\n ry += _getOffset(-ry * 0.05, ry * 0.05);\n let path = _ellipse(ellipseInc, x, y, rx, ry, 1, ellipseInc * _getOffset(0.1, _getOffset(0.4, 1)));\n path = _ellipse(ellipseInc, x, y, rx, ry, 1.5, 0, path);\n const node = svgNode('path', { d: path.value });\n parent.appendChild(node);\n return node;\n}\nfunction renderHachureLines(lines) {\n const gNode = svgNode('g');\n let prevPoint = null;\n lines.forEach((l) => {\n line(gNode, l[0][0], l[0][1], l[1][0], l[1][1]);\n if (prevPoint) {\n line(gNode, prevPoint[0], prevPoint[1], l[0][0], l[0][1]);\n }\n prevPoint = l[1];\n });\n return gNode;\n}\nconst options = {\n bowing: __bowing,\n curveStepCount: __curveStepCount,\n curveTightness: __curveTightness,\n dashGap: 0,\n dashOffset: 0,\n fill: '#000',\n fillStyle: 'hachure',\n fillWeight: 1,\n hachureAngle: -41,\n hachureGap: 5,\n maxRandomnessOffset: __maxRandomnessOffset,\n roughness: __roughness,\n simplification: 1,\n stroke: '#000',\n strokeWidth: 2,\n zigzagOffset: 0\n};\nexport function hachureFill(points) {\n const lines = hachureLinesForPolygon(points, options);\n return renderHachureLines(lines);\n}\nexport function hachureEllipseFill(cx, cy, width, height) {\n const helper = {\n randOffset(x, _o) {\n return _getOffset(-x, x);\n }\n };\n const lines = hachureLinesForEllipse(helper, cx, cy, width, height, options);\n return renderHachureLines(lines);\n}\n","var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __metadata = (this && this.__metadata) || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n};\nimport { WiredBase, customElement, property, html, css } from 'wired-lib/lib/wired-base';\nimport { rectangle, line } from 'wired-lib';\nlet WiredButton = class WiredButton extends WiredBase {\n constructor() {\n super(...arguments);\n this.elevation = 1;\n this.disabled = false;\n }\n static get styles() {\n return css `\n :host {\n display: inline-block;\n font-family: inherit;\n cursor: pointer;\n padding: 8px 10px;\n position: relative;\n text-align: center;\n -moz-user-select: none;\n -ms-user-select: none;\n -webkit-user-select: none;\n user-select: none;\n justify-content: center;\n flex-direction: column;\n text-align: center;\n display: inline-flex;\n outline: none;\n letter-spacing: 1.25px;\n font-size: 14px;\n text-transform: uppercase;\n opacity: 0;\n }\n\n :host(.wired-rendered) {\n opacity: 1;\n }\n\n :host(:active) path {\n transform: scale(0.97) translate(1.5%, 1.5%);\n }\n\n :host(.wired-disabled) {\n opacity: 0.6 !important;\n background: rgba(0, 0, 0, 0.07);\n cursor: default;\n pointer-events: none;\n }\n\n :host(:focus) path {\n stroke-width: 1.5;\n }\n\n .overlay {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n pointer-events: none;\n }\n\n svg {\n display: block;\n }\n\n path {\n stroke: currentColor;\n stroke-width: 0.7;\n fill: transparent;\n transition: transform 0.05s ease;\n }\n `;\n }\n render() {\n return html `\n <slot></slot>\n <div class=\"overlay\">\n <svg id=\"svg\"></svg>\n </div>\n `;\n }\n firstUpdated() {\n this.addEventListener('keydown', (event) => {\n if ((event.keyCode === 13) || (event.keyCode === 32)) {\n event.preventDefault();\n this.click();\n }\n });\n this.setAttribute('role', 'button');\n this.setAttribute('aria-label', this.textContent || this.innerText);\n setTimeout(() => this.requestUpdate());\n }\n updated(changed) {\n if (changed.has('disabled')) {\n this.refreshDisabledState();\n }\n const svg = this.shadowRoot.getElementById('svg');\n while (svg.hasChildNodes()) {\n svg.removeChild(svg.lastChild);\n }\n const s = this.getBoundingClientRect();\n const elev = Math.min(Math.max(1, this.elevation), 5);\n const w = s.width + ((elev - 1) * 2);\n const h = s.height + ((elev - 1) * 2);\n svg.setAttribute('width', `${w}`);\n svg.setAttribute('height', `${h}`);\n rectangle(svg, 0, 0, s.width, s.height);\n for (let i = 1; i < elev; i++) {\n (line(svg, (i * 2), s.height + (i * 2), s.width + (i * 2), s.height + (i * 2))).style.opacity = `${(75 - (i * 10)) / 100}`;\n (line(svg, s.width + (i * 2), s.height + (i * 2), s.width + (i * 2), i * 2)).style.opacity = `${(75 - (i * 10)) / 100}`;\n (line(svg, (i * 2), s.height + (i * 2), s.width + (i * 2), s.height + (i * 2))).style.opacity = `${(75 - (i * 10)) / 100}`;\n (line(svg, s.width + (i * 2), s.height + (i * 2), s.width + (i * 2), i * 2)).style.opacity = `${(75 - (i * 10)) / 100}`;\n }\n this.classList.add('wired-rendered');\n }\n refreshDisabledState() {\n if (this.disabled) {\n this.classList.add('wired-disabled');\n }\n else {\n this.classList.remove('wired-disabled');\n }\n this.tabIndex = this.disabled ? -1 : +(this.getAttribute('tabindex') || 0);\n }\n};\n__decorate([\n property({ type: Number }),\n __metadata(\"design:type\", Object)\n], WiredButton.prototype, \"elevation\", void 0);\n__decorate([\n property({ type: Boolean, reflect: true }),\n __metadata(\"design:type\", Object)\n], WiredButton.prototype, \"disabled\", void 0);\nWiredButton = __decorate([\n customElement('wired-button')\n], WiredButton);\nexport { WiredButton };\n","var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __metadata = (this && this.__metadata) || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n};\nimport { WiredBase, customElement, property, html, css } from 'wired-lib/lib/wired-base';\nimport { rectangle, line } from 'wired-lib';\nlet WiredCard = class WiredCard extends WiredBase {\n constructor() {\n super(...arguments);\n this.elevation = 1;\n }\n static get styles() {\n return css `\n :host {\n display: inline-block;\n position: relative;\n padding: 10px;\n opacity: 0;\n }\n\n :host(.wired-rendered) {\n opacity: 1;\n }\n \n .overlay {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n pointer-events: none;\n }\n \n svg {\n display: block;\n }\n \n path {\n stroke: currentColor;\n stroke-width: 0.7;\n fill: transparent;\n }\n `;\n }\n render() {\n return html `\n <div>\n <slot @slotchange=\"${() => this.requestUpdate()}\"></slot>\n </div>\n <div class=\"overlay\">\n <svg id=\"svg\"></svg>\n </div>\n `;\n }\n connectedCallback() {\n super.connectedCallback();\n if (!this.resizeHandler) {\n this.resizeHandler = this.debounce(this.updated.bind(this), 200, false, this);\n window.addEventListener('resize', this.resizeHandler);\n }\n setTimeout(() => this.updated());\n }\n disconnectedCallback() {\n if (super.disconnectedCallback)\n super.disconnectedCallback();\n if (this.resizeHandler) {\n window.removeEventListener('resize', this.resizeHandler);\n delete this.resizeHandler;\n }\n }\n debounce(func, wait, immediate, context) {\n let timeout = 0;\n return () => {\n const args = arguments;\n const later = () => {\n timeout = 0;\n if (!immediate) {\n func.apply(context, args);\n }\n };\n const callNow = immediate && !timeout;\n clearTimeout(timeout);\n timeout = window.setTimeout(later, wait);\n if (callNow) {\n func.apply(context, args);\n }\n };\n }\n updated() {\n const svg = this.shadowRoot.getElementById('svg');\n while (svg.hasChildNodes()) {\n svg.removeChild(svg.lastChild);\n }\n const s = this.getBoundingClientRect();\n const elev = Math.min(Math.max(1, this.elevation), 5);\n const w = s.width + ((elev - 1) * 2);\n const h = s.height + ((elev - 1) * 2);\n svg.setAttribute('width', `${w}`);\n svg.setAttribute('height', `${h}`);\n rectangle(svg, 2, 2, s.width - 4, s.height - 4);\n for (let i = 1; i < elev; i++) {\n (line(svg, (i * 2), s.height - 4 + (i * 2), s.width - 4 + (i * 2), s.height - 4 + (i * 2))).style.opacity = `${(85 - (i * 10)) / 100}`;\n (line(svg, s.width - 4 + (i * 2), s.height - 4 + (i * 2), s.width - 4 + (i * 2), i * 2)).style.opacity = `${(85 - (i * 10)) / 100}`;\n (line(svg, (i * 2), s.height - 4 + (i * 2), s.width - 4 + (i * 2), s.height - 4 + (i * 2))).style.opacity = `${(85 - (i * 10)) / 100}`;\n (line(svg, s.width - 4 + (i * 2), s.height - 4 + (i * 2), s.width - 4 + (i * 2), i * 2)).style.opacity = `${(85 - (i * 10)) / 100}`;\n }\n this.classList.add('wired-rendered');\n }\n};\n__decorate([\n property({ type: Number }),\n __metadata(\"design:type\", Object)\n], WiredCard.prototype, \"elevation\", void 0);\nWiredCard = __decorate([\n customElement('wired-card')\n], WiredCard);\nexport { WiredCard };\n","var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __metadata = (this && this.__metadata) || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n};\nimport { WiredBase, customElement, property, html, css } from 'wired-lib/lib/wired-base';\nimport { rectangle, line } from 'wired-lib';\nlet WiredCheckbox = class WiredCheckbox extends WiredBase {\n constructor() {\n super(...arguments);\n this.checked = false;\n this.disabled = false;\n }\n static get styles() {\n return css `\n :host {\n display: block;\n font-family: inherit;\n outline: none;\n opacity: 0;\n }\n \n :host(.wired-disabled) {\n opacity: 0.6 !important;\n cursor: default;\n pointer-events: none;\n }\n \n :host(.wired-disabled) svg {\n background: rgba(0, 0, 0, 0.07);\n }\n\n :host(.wired-rendered) {\n opacity: 1;\n }\n \n :host(:focus) path {\n stroke-width: 1.5;\n }\n \n #container {\n display: inline-block;\n white-space: nowrap;\n }\n \n .inline {\n display: inline-block;\n vertical-align: middle;\n -moz-user-select: none;\n user-select: none;\n }\n \n #checkPanel {\n cursor: pointer;\n }\n \n svg {\n display: block;\n }\n \n path {\n stroke: var(--wired-checkbox-icon-color, currentColor);\n stroke-width: 0.7;\n }\n `;\n }\n render() {\n return html `\n <div id=\"container\" @click=\"${this.toggleCheck}\">\n <div id=\"checkPanel\" class=\"inline\">\n <svg id=\"svg\" width=\"0\" height=\"0\"></svg>\n </div>\n <div class=\"inline\">\n <slot></slot>\n </div>\n </div>\n `;\n }\n refreshDisabledState() {\n if (this.disabled) {\n this.classList.add('wired-disabled');\n }\n else {\n this.classList.remove('wired-disabled');\n }\n this.tabIndex = this.disabled ? -1 : +(this.getAttribute('tabindex') || 0);\n }\n toggleCheck() {\n this.checked = !(this.checked || false);\n this.fireEvent('change', { checked: this.checked });\n }\n firstUpdated() {\n this.setAttribute('role', 'checkbox');\n this.addEventListener('keydown', (event) => {\n if ((event.keyCode === 13) || (event.keyCode === 32)) {\n event.preventDefault();\n this.toggleCheck();\n }\n });\n }\n updated(changed) {\n if (changed.has('disabled')) {\n this.refreshDisabledState();\n }\n const svg = this.shadowRoot.getElementById('svg');\n while (svg.hasChildNodes()) {\n svg.removeChild(svg.lastChild);\n }\n const s = { width: 24, height: 24 };\n svg.setAttribute('width', `${s.width}`);\n svg.setAttribute('height', `${s.height}`);\n rectangle(svg, 0, 0, s.width, s.height);\n const checkpaths = [];\n checkpaths.push(line(svg, s.width * 0.3, s.height * 0.4, s.width * 0.5, s.height * 0.7));\n checkpaths.push(line(svg, s.width * 0.5, s.height * 0.7, s.width + 5, -5));\n checkpaths.forEach((d) => {\n d.style.strokeWidth = `${2.5}`;\n });\n if (this.checked) {\n checkpaths.forEach((d) => {\n d.style.display = '';\n });\n }\n else {\n checkpaths.forEach((d) => {\n d.style.display = 'none';\n });\n }\n this.classList.add('wired-rendered');\n }\n};\n__decorate([\n property({ type: Boolean }),\n __metadata(\"design:type\", Object)\n], WiredCheckbox.prototype, \"checked\", void 0);\n__decorate([\n property({ type: Boolean, reflect: true }),\n __metadata(\"design:type\", Object)\n], WiredCheckbox.prototype, \"disabled\", void 0);\nWiredCheckbox = __decorate([\n customElement('wired-checkbox')\n], WiredCheckbox);\nexport { WiredCheckbox };\n","var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __metadata = (this && this.__metadata) || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n};\nimport { WiredBase, customElement, property, html, css, query } from 'wired-lib/lib/wired-base';\nimport { hachureFill } from 'wired-lib';\nlet WiredItem = class WiredItem extends WiredBase {\n constructor() {\n super(...arguments);\n this.value = '';\n this.name = '';\n this.selected = false;\n }\n static get styles() {\n return css `\n :host {\n display: inline-block;\n font-size: 14px;\n text-align: left;\n }\n button {\n cursor: pointer;\n outline: none;\n overflow: hidden;\n color: inherit;\n user-select: none;\n position: relative;\n font-family: inherit;\n text-align: inherit;\n font-size: inherit;\n letter-spacing: 1.25px;\n padding: 1px 10px;\n min-height: 36px;\n text-transform: inherit;\n background: none;\n border: none;\n transition: background-color 0.3s ease, color 0.3s ease;\n width: 100%;\n box-sizing: border-box;\n white-space: nowrap;\n }\n button.selected {\n color: var(--wired-item-selected-color, #fff);\n }\n button::before {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background: currentColor;\n opacity: 0;\n }\n button span {\n display: inline-block;\n transition: transform 0.2s ease;\n position: relative;\n }\n button:active span {\n transform: scale(1.02);\n }\n .overlay {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n pointer-events: none;\n display: none;\n }\n button.selected .overlay {\n display: block;\n }\n svg {\n display: block;\n }\n path {\n stroke: var(--wired-item-selected-bg, #000);\n stroke-width: 2.75;\n fill: transparent;\n transition: transform 0.05s ease;\n }\n @media (hover: hover) {\n button:hover::before {\n opacity: 0.05;\n }\n }\n `;\n }\n render() {\n return html `\n <button class=\"${this.selected ? 'selected' : ''}\">\n <div class=\"overlay\">\n <svg></svg>\n </div>\n <span>\n <slot></slot>\n </span>\n </button>`;\n }\n firstUpdated() {\n if (this.selected) {\n setTimeout(() => this.requestUpdate());\n }\n }\n updated() {\n if (this.svg) {\n while (this.svg.hasChildNodes()) {\n this.svg.removeChild(this.svg.lastChild);\n }\n const s = this.getBoundingClientRect();\n this.svg.setAttribute('width', `${s.width}`);\n this.svg.setAttribute('height', `${s.height}`);\n const g = hachureFill([\n [0, 0],\n [s.width, 0],\n [s.width, s.height],\n [0, s.height]\n ]);\n this.svg.appendChild(g);\n }\n }\n};\n__decorate([\n property(),\n __metadata(\"design:type\", Object)\n], WiredItem.prototype, \"value\", void 0);\n__decorate([\n property(),\n __metadata(\"design:type\", Object)\n], WiredItem.prototype, \"name\", void 0);\n__decorate([\n property({ type: Boolean }),\n __metadata(\"design:type\", Object)\n], WiredItem.prototype, \"selected\", void 0);\n__decorate([\n query('svg'),\n __metadata(\"design:type\", SVGSVGElement)\n], WiredItem.prototype, \"svg\", void 0);\nWiredItem = __decorate([\n customElement('wired-item')\n], WiredItem);\nexport { WiredItem };\n","var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __metadata = (this && this.__metadata) || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n};\nimport { WiredBase, customElement, property, html, css } from 'wired-lib/lib/wired-base';\nimport { rectangle, polygon } from 'wired-lib';\nimport 'wired-card';\nimport 'wired-item';\nlet WiredCombo = class WiredCombo extends WiredBase {\n constructor() {\n super(...arguments);\n this.disabled = false;\n this.cardShowing = false;\n this.itemNodes = [];\n }\n static get styles() {\n return css `\n :host {\n display: inline-block;\n font-family: inherit;\n position: relative;\n outline: none;\n opacity: 0;\n }\n \n :host(.wired-disabled) {\n opacity: 0.5 !important;\n cursor: default;\n pointer-events: none;\n background: rgba(0, 0, 0, 0.02);\n }\n \n :host(.wired-rendered) {\n opacity: 1;\n }\n\n :host(:focus) path {\n stroke-width: 1.5;\n }\n \n #container {\n white-space: nowrap;\n position: relative;\n }\n \n .inline {\n display: inline-block;\n vertical-align: top\n }\n \n #textPanel {\n min-width: 90px;\n min-height: 18px;\n padding: 8px;\n }\n \n #dropPanel {\n width: 34px;\n cursor: pointer;\n }\n \n .overlay {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n pointer-events: none;\n }\n \n svg {\n display: block;\n }\n \n path {\n stroke: currentColor;\n stroke-width: 0.7;\n fill: transparent;\n }\n \n #card {\n position: absolute;\n background: var(--wired-combo-popup-bg, white);\n z-index: 1;\n box-shadow: 1px 5px 15px -6px rgba(0, 0, 0, 0.8);\n }\n\n ::slotted(wired-item) {\n display: block;\n }\n `;\n }\n render() {\n return html `\n <div id=\"container\" @click=\"${this.onCombo}\">\n <div id=\"textPanel\" class=\"inline\">\n <span>${this.value && this.value.text}</span>\n </div>\n <div id=\"dropPanel\" class=\"inline\"></div>\n <div class=\"overlay\">\n <svg id=\"svg\"></svg>\n </div>\n </div>\n <wired-card id=\"card\" tabindex=\"-1\" role=\"listbox\" @mousedown=\"${this.onItemClick}\" @touchstart=\"${this.onItemClick}\"\n style=\"display: none;\">\n <slot id=\"slot\"></slot>\n </wired-card>\n `;\n }\n refreshDisabledState() {\n if (this.disabled) {\n this.classList.add('wired-disabled');\n }\n else {\n this.classList.remove('wired-disabled');\n }\n this.tabIndex = this.disabled ? -1 : +(this.getAttribute('tabindex') || 0);\n }\n firstUpdated() {\n this.setAttribute('role', 'combobox');\n this.setAttribute('aria-haspopup', 'listbox');\n this.refreshSelection();\n this.addEventListener('blur', () => {\n if (this.cardShowing) {\n this.setCardShowing(false);\n }\n });\n this.addEventListener('keydown', (event) => {\n switch (event.keyCode) {\n case 37:\n case 38:\n event.preventDefault();\n this.selectPrevious();\n break;\n case 39:\n case 40:\n event.preventDefault();\n this.selectNext();\n break;\n case 27:\n event.preventDefault();\n if (this.cardShowing) {\n this.setCardShowing(false);\n }\n break;\n case 13:\n event.preventDefault();\n this.setCardShowing(!this.cardShowing);\n break;\n case 32:\n event.preventDefault();\n if (!this.cardShowing) {\n this.setCardShowing(true);\n }\n break;\n }\n });\n }\n updated(changed) {\n if (changed.has('disabled')) {\n this.refreshDisabledState();\n }\n const svg = this.shadowRoot.getElementById('svg');\n while (svg.hasChildNodes()) {\n svg.removeChild(svg.lastChild);\n }\n const s = this.shadowRoot.getElementById('container').getBoundingClientRect();\n svg.setAttribute('width', `${s.width}`);\n svg.setAttribute('height', `${s.height}`);\n const textBounds = this.shadowRoot.getElementById('textPanel').getBoundingClientRect();\n this.shadowRoot.getElementById('dropPanel').style.minHeight = textBounds.height + 'px';\n rectangle(svg, 0, 0, textBounds.width, textBounds.height);\n const dropx = textBounds.width - 4;\n rectangle(svg, dropx, 0, 34, textBounds.height);\n const dropOffset = Math.max(0, Math.abs((textBounds.height - 24) / 2));\n const poly = polygon(svg, [\n [dropx + 8, 5 + dropOffset],\n [dropx + 26, 5 + dropOffset],\n [dropx + 17, dropOffset + Math.min(textBounds.height, 18)]\n ]);\n poly.style.fill = 'currentColor';\n poly.style.pointerEvents = this.disabled ? 'none' : 'auto';\n poly.style.cursor = 'pointer';\n this.classList.add('wired-rendered');\n // aria\n this.setAttribute('aria-expanded', `${this.cardShowing}`);\n if (!this.itemNodes.length) {\n this.itemNodes = [];\n const nodes = this.shadowRoot.getElementById('slot').assignedNodes();\n if (nodes && nodes.length) {\n for (let i = 0; i < nodes.length; i++) {\n const element = nodes[i];\n if (element.tagName === 'WIRED-ITEM') {\n element.setAttribute('role', 'option');\n this.itemNodes.push(element);\n }\n }\n }\n }\n }\n refreshSelection() {\n if (this.lastSelectedItem) {\n this.lastSelectedItem.selected = false;\n this.lastSelectedItem.removeAttribute('aria-selected');\n }\n const slot = this.shadowRoot.getElementById('slot');\n const nodes = slot.assignedNodes();\n if (nodes) {\n let selectedItem = null;\n for (let i = 0; i < nodes.length; i++) {\n const element = nodes[i];\n if (element.tagName === 'WIRED-ITEM') {\n const value = element.value || '';\n if (this.selected && (value === this.selected)) {\n selectedItem = element;\n break;\n }\n }\n }\n this.lastSelectedItem = selectedItem || undefined;\n if (this.lastSelectedItem) {\n this.lastSelectedItem.selected = true;\n this.lastSelectedItem.setAttribute('aria-selected', 'true');\n }\n if (selectedItem) {\n this.value = {\n value: selectedItem.value || '',\n text: selectedItem.textContent || ''\n };\n }\n else {\n this.value = undefined;\n }\n }\n }\n setCardShowing(showing) {\n this.cardShowing = showing;\n const card = this.shadowRoot.getElementById('card');\n card.style.display = showing ? '' : 'none';\n if (showing) {\n setTimeout(() => {\n card.requestUpdate();\n const nodes = this.shadowRoot.getElementById('slot').assignedNodes().filter((d) => {\n return d.nodeType === Node.ELEMENT_NODE;\n });\n nodes.forEach((n) => {\n const e = n;\n if (e.requestUpdate) {\n e.requestUpdate();\n }\n });\n }, 10);\n }\n this.setAttribute('aria-expanded', `${this.cardShowing}`);\n }\n onItemClick(event) {\n event.stopPropagation();\n this.selected = event.target.value;\n this.refreshSelection();\n this.fireSelected();\n setTimeout(() => {\n this.setCardShowing(false);\n });\n }\n fireSelected() {\n this.fireEvent('selected', { selected: this.selected });\n }\n selectPrevious() {\n const list = this.itemNodes;\n if (list.length) {\n let index = -1;\n for (let i = 0; i < list.length; i++) {\n if (list[i] === this.lastSelectedItem) {\n index = i;\n break;\n }\n }\n if (index < 0) {\n index = 0;\n }\n else if (index === 0) {\n index = list.length - 1;\n }\n else {\n index--;\n }\n this.selected = list[index].value || '';\n this.refreshSelection();\n this.fireSelected();\n }\n }\n selectNext() {\n const list = this.itemNodes;\n if (list.length) {\n let index = -1;\n for (let i = 0; i < list.length; i++) {\n if (list[i] === this.lastSelectedItem) {\n index = i;\n break;\n }\n }\n if (index < 0) {\n index = 0;\n }\n else if (index >= (list.length - 1)) {\n index = 0;\n }\n else {\n index++;\n }\n this.selected = list[index].value || '';\n this.refreshSelection();\n this.fireSelected();\n }\n }\n onCombo(event) {\n event.stopPropagation();\n this.setCardShowing(!this.cardShowing);\n }\n};\n__decorate([\n property({ type: Object }),\n __metadata(\"design:type\", Object)\n], WiredCombo.prototype, \"value\", void 0);\n__decorate([\n property({ type: String }),\n __metadata(\"design:type\", String)\n], WiredCombo.prototype, \"selected\", void 0);\n__decorate([\n property({ type: Boolean, reflect: true }),\n __metadata(\"design:type\", Object)\n], WiredCombo.prototype, \"disabled\", void 0);\nWiredCombo = __decorate([\n customElement('wired-combo')\n], WiredCombo);\nexport { WiredCombo };\n","/**\n * @license\n * Copyright (c) 2018 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\nimport { AttributePart, directive, PropertyPart } from '../lit-html.js';\n// On IE11, classList.toggle doesn't accept a second argument.\n// Since this is so minor, we just polyfill it.\nif (window.navigator.userAgent.match('Trident')) {\n DOMTokenList.prototype.toggle = function (token, force) {\n if (force === undefined || force) {\n this.add(token);\n }\n else {\n this.remove(token);\n }\n return force === undefined ? true : force;\n };\n}\n/**\n * Stores the ClassInfo object applied to a given AttributePart.\n * Used to unset existing values when a new ClassInfo object is applied.\n */\nconst classMapCache = new WeakMap();\n/**\n * Stores AttributeParts that have had static classes applied (e.g. `foo` in\n * class=\"foo ${classMap()}\"). Static classes are applied only the first time\n * the directive is run on a part.\n */\n// Note, could be a WeakSet, but prefer not requiring this polyfill.\nconst classMapStatics = new WeakMap();\n/**\n * A directive that applies CSS classes. This must be used in the `class`\n * attribute and must be the only part used in the attribute. It takes each\n * property in the `classInfo` argument and adds the property name to the\n * element's `classList` if the property value is truthy; if the property value\n * is falsey, the property name is removed from the element's `classList`. For\n * example\n * `{foo: bar}` applies the class `foo` if the value of `bar` is truthy.\n * @param classInfo {ClassInfo}\n */\nexport const classMap = directive((classInfo) => (part) => {\n if (!(part instanceof AttributePart) || (part instanceof PropertyPart) ||\n part.committer.name !== 'class' || part.committer.parts.length > 1) {\n throw new Error('The `classMap` directive must be used in the `class` attribute ' +\n 'and must be the only part in the attribute.');\n }\n // handle static classes\n if (!classMapStatics.has(part)) {\n part.committer.element.className = part.committer.strings.join(' ');\n classMapStatics.set(part, true);\n }\n // remove old classes that no longer apply\n const oldInfo = classMapCache.get(part);\n for (const name in oldInfo) {\n if (!(name in classInfo)) {\n part.committer.element.classList.remove(name);\n }\n }\n // add new classes\n for (const name in classInfo) {\n if (!oldInfo || (oldInfo[name] !== classInfo[name])) {\n // We explicitly want a loose truthy check here because\n // it seems more convenient that '' and 0 are skipped.\n part.committer.element.classList.toggle(name, Boolean(classInfo[name]));\n }\n }\n classMapCache.set(part, classInfo);\n});\n//# sourceMappingURL=class-map.js.map","/**\n@license\nCopyright 2018 Google Inc. All Rights Reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\nimport { css } from '@material/mwc-base/base-element';\nexport const style = css `:host{font-family:var(--mdc-icon-font, \"Material Icons\");font-weight:normal;font-style:normal;font-size:var(--mdc-icon-size, 24px);line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;-webkit-font-feature-settings:\"liga\";-webkit-font-smoothing:antialiased}`;\n//# sourceMappingURL=mwc-icon-host-css.js.map","\"use strict\";\n/**\n@license\nCopyright 2018 Google Inc. All Rights Reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n// load material icons font\nconst fontEl = document.createElement('link');\nfontEl.rel = 'stylesheet';\nfontEl.href = 'https://fonts.googleapis.com/icon?family=Material+Icons';\ndocument.head.appendChild(fontEl);\n//# sourceMappingURL=mwc-icon-font.js.map","var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\n/**\n@license\nCopyright 2018 Google Inc. All Rights Reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\nimport { LitElement, html, customElement } from '@material/mwc-base/base-element';\nimport { style } from './mwc-icon-host-css.js';\nimport './mwc-icon-font.js';\nlet Icon = class Icon extends LitElement {\n render() {\n return html `<slot></slot>`;\n }\n};\nIcon.styles = style;\nIcon = __decorate([\n customElement('mwc-icon')\n], Icon);\nexport { Icon };\n//# sourceMappingURL=mwc-icon.js.map","var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __metadata = (this && this.__metadata) || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n};\nimport { WiredBase, customElement, property, html, css } from 'wired-lib/lib/wired-base';\nimport { ellipse } from 'wired-lib';\nimport '@material/mwc-icon';\nlet WiredIconButton = class WiredIconButton extends WiredBase {\n constructor() {\n super(...arguments);\n this.disabled = false;\n }\n static get styles() {\n return css `\n :host {\n display: -ms-inline-flexbox;\n display: -webkit-inline-flex;\n display: inline-flex;\n -ms-flex-align: center;\n -webkit-align-items: center;\n align-items: center;\n -ms-flex-pack: center;\n -webkit-justify-content: center;\n justify-content: center;\n position: relative;\n vertical-align: middle;\n padding: 8px;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n cursor: pointer;\n z-index: 0;\n line-height: 1;\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n -webkit-tap-highlight-color: transparent;\n box-sizing: border-box !important;\n outline: none;\n opacity: 0;\n }\n\n :host(.wired-rendered) {\n opacity: 1;\n }\n \n :host(.wired-disabled) {\n opacity: 0.45 !important;\n cursor: default;\n background: rgba(0, 0, 0, 0.07);\n border-radius: 50%;\n pointer-events: none;\n }\n \n :host(:active) path {\n transform: scale(0.96) translate(2%, 2%);\n }\n\n :host(:focus) path {\n stroke-width: 1.5;\n }\n \n .overlay {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n pointer-events: none;\n }\n \n svg {\n display: block;\n }\n \n path {\n stroke: currentColor;\n stroke-width: 0.7;\n fill: var(--wired-icon-bg-color, transparent);\n transition: transform 0.05s ease;\n }\n \n mwc-icon {\n position: relative;\n font-size: var(--wired-icon-size, 24px);\n }\n `;\n }\n render() {\n return html `\n <div class=\"overlay\">\n <svg id=\"svg\"></svg>\n </div>\n <mwc-icon>\n <slot></slot>\n </mwc-icon>\n `;\n }\n firstUpdated() {\n this.addEventListener('keydown', (event) => {\n if ((event.keyCode === 13) || (event.keyCode === 32)) {\n event.preventDefault();\n this.click();\n }\n });\n this.setAttribute('role', 'button');\n this.setAttribute('aria-label', this.textContent || this.innerText);\n setTimeout(() => this.requestUpdate());\n }\n updated(changed) {\n if (changed.has('disabled')) {\n this.refreshDisabledState();\n }\n const svg = this.shadowRoot.getElementById('svg');\n while (svg.hasChildNodes()) {\n svg.removeChild(svg.lastChild);\n }\n const s = this.getBoundingClientRect();\n const min = Math.min(s.width, s.height);\n svg.setAttribute('width', `${min}`);\n svg.setAttribute('height', `${min}`);\n ellipse(svg, min / 2, min / 2, min, min);\n this.classList.add('wired-rendered');\n }\n refreshDisabledState() {\n if (this.disabled) {\n this.classList.add('wired-disabled');\n }\n else {\n this.classList.remove('wired-disabled');\n }\n this.tabIndex = this.disabled ? -1 : +(this.getAttribute('tabindex') || 0);\n }\n};\n__decorate([\n property({ type: Boolean, reflect: true }),\n __metadata(\"design:type\", Object)\n], WiredIconButton.prototype, \"disabled\", void 0);\nWiredIconButton = __decorate([\n customElement('wired-icon-button')\n], WiredIconButton);\nexport { WiredIconButton };\n","var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __metadata = (this && this.__metadata) || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n};\nimport { WiredBase, customElement, property, html, css } from 'wired-lib/lib/wired-base';\nimport { rectangle } from 'wired-lib';\nlet WiredInput = class WiredInput extends WiredBase {\n constructor() {\n super(...arguments);\n this.placeholder = '';\n this.type = 'text';\n this.autocomplete = '';\n this.autocapitalize = '';\n this.autocorrect = '';\n this.disabled = false;\n this.required = false;\n this.autofocus = false;\n this.readonly = false;\n }\n static get styles() {\n return css `\n :host {\n display: inline-block;\n position: relative;\n padding: 5px;\n font-family: sans-serif;\n width: 150px;\n outline: none;\n opacity: 0;\n }\n\n :host(.wired-rendered) {\n opacity: 1;\n }\n \n :host(.wired-disabled) {\n opacity: 0.6 !important;\n cursor: default;\n pointer-events: none;\n }\n \n :host(.wired-disabled) svg {\n background: rgba(0, 0, 0, 0.07);\n }\n \n .overlay {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n pointer-events: none;\n }\n \n svg {\n display: block;\n }\n \n path {\n stroke: currentColor;\n stroke-width: 0.7;\n fill: transparent;\n }\n \n input {\n display: block;\n width: 100%;\n box-sizing: border-box;\n outline: none;\n border: none;\n font-family: inherit;\n font-size: inherit;\n font-weight: inherit;\n color: inherit;\n padding: 6px;\n }\n `;\n }\n render() {\n return html `\n <input id=\"txt\" name=\"${this.name}\" type=\"${this.type}\" placeholder=\"${this.placeholder}\" ?disabled=\"${this.disabled}\"\n ?required=\"${this.required}\" autocomplete=\"${this.autocomplete}\" ?autofocus=\"${this.autofocus}\" minlength=\"${this.minlength}\"\n maxlength=\"${this.maxlength}\" min=\"${this.min}\" max=\"${this.max}\" step=\"${this.step}\" ?readonly=\"${this.readonly}\"\n size=\"${this.size}\" autocapitalize=\"${this.autocapitalize}\" autocorrect=\"${this.autocorrect}\" @change=\"${this.onChange}\">\n <div class=\"overlay\">\n <svg id=\"svg\"></svg>\n </div>\n `;\n }\n createRenderRoot() {\n return this.attachShadow({ mode: 'open', delegatesFocus: true });\n }\n get input() {\n if (this.shadowRoot) {\n return this.shadowRoot.getElementById('txt');\n }\n return null;\n }\n get value() {\n const input = this.input;\n return (input && input.value) || '';\n }\n set value(v) {\n if (this.shadowRoot) {\n const input = this.input;\n if (input) {\n input.value = v;\n }\n }\n else {\n this.pendingValue = v;\n }\n }\n firstUpdated() {\n this.value = this.value || this.getAttribute('value') || '';\n }\n updated(changed) {\n if (changed.has('disabled')) {\n this.refreshDisabledState();\n }\n const svg = this.shadowRoot.getElementById('svg');\n while (svg.hasChildNodes()) {\n svg.removeChild(svg.lastChild);\n }\n const s = this.getBoundingClientRect();\n svg.setAttribute('width', `${s.width}`);\n svg.setAttribute('height', `${s.height}`);\n rectangle(svg, 0, 0, s.width, s.height);\n if (typeof this.pendingValue !== 'undefined') {\n this.input.value = this.pendingValue;\n delete this.pendingValue;\n }\n this.classList.add('wired-rendered');\n }\n refreshDisabledState() {\n if (this.disabled) {\n this.classList.add('wired-disabled');\n }\n else {\n this.classList.remove('wired-disabled');\n }\n }\n onChange(event) {\n event.stopPropagation();\n this.fireEvent(event.type, { sourceEvent: event });\n }\n};\n__decorate([\n property({ type: String }),\n __metadata(\"design:type\", Object)\n], WiredInput.prototype, \"placeholder\", void 0);\n__decorate([\n property({ type: String }),\n __metadata(\"design:type\", String)\n], WiredInput.prototype, \"name\", void 0);\n__decorate([\n property({ type: String }),\n __metadata(\"design:type\", String)\n], WiredInput.prototype, \"min\", void 0);\n__decorate([\n property({ type: String }),\n __metadata(\"design:type\", String)\n], WiredInput.prototype, \"max\", void 0);\n__decorate([\n property({ type: String }),\n __metadata(\"design:type\", String)\n], WiredInput.prototype, \"step\", void 0);\n__decorate([\n property({ type: String }),\n __metadata(\"design:type\", Object)\n], WiredInput.prototype, \"type\", void 0);\n__decorate([\n property({ type: String }),\n __metadata(\"design:type\", Object)\n], WiredInput.prototype, \"autocomplete\", void 0);\n__decorate([\n property({ type: String }),\n __metadata(\"design:type\", Object)\n], WiredInput.prototype, \"autocapitalize\", void 0);\n__decorate([\n property({ type: String }),\n __metadata(\"design:type\", Object)\n], WiredInput.prototype, \"autocorrect\", void 0);\n__decorate([\n property({ type: Boolean, reflect: true }),\n __metadata(\"design:type\", Object)\n], WiredInput.prototype, \"disabled\", void 0);\n__decorate([\n property({ type: Boolean }),\n __metadata(\"design:type\", Object)\n], WiredInput.prototype, \"required\", void 0);\n__decorate([\n property({ type: Boolean }),\n __metadata(\"design:type\", Object)\n], WiredInput.prototype, \"autofocus\", void 0);\n__decorate([\n property({ type: Boolean }),\n __metadata(\"design:type\", Object)\n], WiredInput.prototype, \"readonly\", void 0);\n__decorate([\n property({ type: Number }),\n __metadata(\"design:type\", Number)\n], WiredInput.prototype, \"minlength\", void 0);\n__decorate([\n property({ type: Number }),\n __metadata(\"design:type\", Number)\n], WiredInput.prototype, \"maxlength\", void 0);\n__decorate([\n property({ type: Number }),\n __metadata(\"design:type\", Number)\n], WiredInput.prototype, \"size\", void 0);\nWiredInput = __decorate([\n customElement('wired-input')\n], WiredInput);\nexport { WiredInput };\n","var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __metadata = (this && this.__metadata) || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n};\nimport { WiredBase, customElement, property, html, css } from 'wired-lib/lib/wired-base';\nimport { rectangle } from 'wired-lib';\nimport 'wired-item';\nlet WiredListbox = class WiredListbox extends WiredBase {\n constructor() {\n super(...arguments);\n this.horizontal = false;\n this.itemNodes = [];\n this.itemClickHandler = this.onItemClick.bind(this);\n }\n static get styles() {\n return css `\n :host {\n display: inline-block;\n font-family: inherit;\n position: relative;\n padding: 5px;\n outline: none;\n opacity: 0;\n }\n\n :host(.wired-rendered) {\n opacity: 1;\n }\n\n :host(:focus) path {\n stroke-width: 1.5;\n }\n \n .overlay {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n pointer-events: none;\n }\n \n svg {\n display: block;\n }\n \n path {\n stroke: currentColor;\n stroke-width: 0.7;\n fill: transparent;\n }\n\n ::slotted(wired-item) {\n display: block;\n }\n\n :host(.wired-horizontal) ::slotted(wired-item) {\n display: inline-block;\n }\n `;\n }\n render() {\n return html `\n <slot id=\"slot\" @slotchange=\"${() => this.requestUpdate()}\"></slot>\n <div class=\"overlay\">\n <svg id=\"svg\"></svg>\n </div>\n `;\n }\n firstUpdated() {\n this.setAttribute('role', 'listbox');\n this.tabIndex = +((this.getAttribute('tabindex') || 0));\n this.refreshSelection();\n this.addEventListener('click', this.itemClickHandler);\n this.addEventListener('keydown', (event) => {\n switch (event.keyCode) {\n case 37:\n case 38:\n event.preventDefault();\n this.selectPrevious();\n break;\n case 39:\n case 40:\n event.preventDefault();\n this.selectNext();\n break;\n }\n });\n }\n updated() {\n const svg = this.shadowRoot.getElementById('svg');\n while (svg.hasChildNodes()) {\n svg.removeChild(svg.lastChild);\n }\n const s = this.getBoundingClientRect();\n svg.setAttribute('width', `${s.width}`);\n svg.setAttribute('height', `${s.height}`);\n rectangle(svg, 0, 0, s.width, s.height);\n this.classList.add('wired-rendered');\n if (this.horizontal) {\n this.classList.add('wired-horizontal');\n }\n else {\n this.classList.remove('wired-horizontal');\n }\n if (!this.itemNodes.length) {\n this.itemNodes = [];\n const nodes = this.shadowRoot.getElementById('slot').assignedNodes();\n if (nodes && nodes.length) {\n for (let i = 0; i < nodes.length; i++) {\n const element = nodes[i];\n if (element.tagName === 'WIRED-ITEM') {\n element.setAttribute('role', 'option');\n this.itemNodes.push(element);\n }\n }\n }\n }\n }\n onItemClick(event) {\n event.stopPropagation();\n this.selected = event.target.value;\n this.refreshSelection();\n this.fireSelected();\n }\n refreshSelection() {\n if (this.lastSelectedItem) {\n this.lastSelectedItem.selected = false;\n this.lastSelectedItem.removeAttribute('aria-selected');\n }\n const slot = this.shadowRoot.getElementById('slot');\n const nodes = slot.assignedNodes();\n if (nodes) {\n let selectedItem = null;\n for (let i = 0; i < nodes.length; i++) {\n const element = nodes[i];\n if (element.tagName === 'WIRED-ITEM') {\n const value = element.value || '';\n if (this.selected && (value === this.selected)) {\n selectedItem = element;\n break;\n }\n }\n }\n this.lastSelectedItem = selectedItem || undefined;\n if (this.lastSelectedItem) {\n this.lastSelectedItem.selected = true;\n this.lastSelectedItem.setAttribute('aria-selected', 'true');\n }\n if (selectedItem) {\n this.value = {\n value: selectedItem.value || '',\n text: selectedItem.textContent || ''\n };\n }\n else {\n this.value = undefined;\n }\n }\n }\n fireSelected() {\n this.fireEvent('selected', { selected: this.selected });\n }\n selectPrevious() {\n const list = this.itemNodes;\n if (list.length) {\n let index = -1;\n for (let i = 0; i < list.length; i++) {\n if (list[i] === this.lastSelectedItem) {\n index = i;\n break;\n }\n }\n if (index < 0) {\n index = 0;\n }\n else if (index === 0) {\n index = list.length - 1;\n }\n else {\n index--;\n }\n this.selected = list[index].value || '';\n this.refreshSelection();\n this.fireSelected();\n }\n }\n selectNext() {\n const list = this.itemNodes;\n if (list.length) {\n let index = -1;\n for (let i = 0; i < list.length; i++) {\n if (list[i] === this.lastSelectedItem) {\n index = i;\n break;\n }\n }\n if (index < 0) {\n index = 0;\n }\n else if (index >= (list.length - 1)) {\n index = 0;\n }\n else {\n index++;\n }\n this.selected = list[index].value || '';\n this.refreshSelection();\n this.fireSelected();\n }\n }\n};\n__decorate([\n property({ type: Object }),\n __metadata(\"design:type\", Object)\n], WiredListbox.prototype, \"value\", void 0);\n__decorate([\n property({ type: String }),\n __metadata(\"design:type\", String)\n], WiredListbox.prototype, \"selected\", void 0);\n__decorate([\n property({ type: Boolean }),\n __metadata(\"design:type\", Object)\n], WiredListbox.prototype, \"horizontal\", void 0);\nWiredListbox = __decorate([\n customElement('wired-listbox')\n], WiredListbox);\nexport { WiredListbox };\n","var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __metadata = (this && this.__metadata) || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n};\nimport { WiredBase, customElement, property, html, css } from 'wired-lib/lib/wired-base';\nimport { rectangle, hachureFill } from 'wired-lib';\nlet WiredProgress = class WiredProgress extends WiredBase {\n constructor() {\n super(...arguments);\n this.value = 0;\n this.min = 0;\n this.max = 100;\n this.percentage = false;\n }\n static get styles() {\n return css `\n :host {\n display: inline-block;\n position: relative;\n width: 400px;\n height: 42px;\n font-family: sans-serif;\n opacity: 0;\n }\n\n :host(.wired-rendered) {\n opacity: 1;\n }\n \n svg {\n display: block;\n }\n \n path {\n stroke: currentColor;\n stroke-width: 0.7;\n fill: transparent;\n }\n \n .overlay {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n pointer-events: none;\n }\n \n .labelContainer {\n display: flex;\n align-items: center;\n justify-content: center;\n }\n \n .progressLabel {\n color: var(--wired-progress-label-color, #000);\n font-size: var(--wired-progress-font-size, 14px);\n background: var(--wired-progress-label-background, rgba(255,255,255,0.9));\n padding: 2px 6px;\n border-radius: 4px;\n letter-spacing: 1.25px;\n }\n \n .progbox path {\n stroke: var(--wired-progress-color, rgba(0, 0, 200, 0.8));\n stroke-width: 2.75;\n fill: none;\n }\n `;\n }\n render() {\n return html `\n <div class=\"overlay\">\n <svg id=\"svg\"></svg>\n </div>\n <div class=\"overlay labelContainer\">\n <div class=\"progressLabel\">${this.getProgressLabel()}</div>\n </div>\n `;\n }\n getProgressLabel() {\n if (this.percentage) {\n if (this.max === this.min) {\n return '%';\n }\n else {\n const pct = Math.floor(((this.value - this.min) / (this.max - this.min)) * 100);\n return (pct + '%');\n }\n }\n else {\n return ('' + this.value);\n }\n }\n updated() {\n const svg = this.shadowRoot.getElementById('svg');\n while (svg.hasChildNodes()) {\n svg.removeChild(svg.lastChild);\n }\n const s = this.getBoundingClientRect();\n svg.setAttribute('width', `${s.width}`);\n svg.setAttribute('height', `${s.height}`);\n if (!this.box) {\n this.box = rectangle(svg, 0, 0, s.width, s.height);\n }\n else {\n svg.appendChild(this.box);\n }\n let pct = 0;\n if (this.max > this.min) {\n pct = (this.value - this.min) / (this.max - this.min);\n const progWidth = s.width * Math.max(0, Math.min(pct, 100));\n const progBox = hachureFill([\n [0, 0],\n [progWidth, 0],\n [progWidth, s.height],\n [0, s.height]\n ]);\n svg.appendChild(progBox);\n progBox.classList.add('progbox');\n }\n this.classList.add('wired-rendered');\n }\n};\n__decorate([\n property({ type: Number }),\n __metadata(\"design:type\", Object)\n], WiredProgress.prototype, \"value\", void 0);\n__decorate([\n property({ type: Number }),\n __metadata(\"design:type\", Object)\n], WiredProgress.prototype, \"min\", void 0);\n__decorate([\n property({ type: Number }),\n __metadata(\"design:type\", Object)\n], WiredProgress.prototype, \"max\", void 0);\n__decorate([\n property({ type: Boolean }),\n __metadata(\"design:type\", Object)\n], WiredProgress.prototype, \"percentage\", void 0);\nWiredProgress = __decorate([\n customElement('wired-progress')\n], WiredProgress);\nexport { WiredProgress };\n","var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __metadata = (this && this.__metadata) || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n};\nimport { WiredBase, customElement, property, html, css } from 'wired-lib/lib/wired-base';\nimport { ellipse } from 'wired-lib';\nlet WiredRadio = class WiredRadio extends WiredBase {\n constructor() {\n super(...arguments);\n this.checked = false;\n this.disabled = false;\n this.iconsize = 24;\n }\n static get styles() {\n return css `\n :host {\n display: inline-block;\n position: relative;\n padding: 5px;\n font-family: inherit;\n width: 150px;\n outline: none;\n opacity: 0;\n }\n\n :host(.wired-rendered) {\n opacity: 1;\n }\n \n :host(.wired-disabled) {\n opacity: 0.45 !important;\n cursor: default;\n pointer-events: none;\n }\n\n :host(:focus) path {\n stroke-width: 1.5;\n }\n \n #container {\n display: inline-block;\n white-space: nowrap;\n }\n \n .inline {\n display: inline-block;\n vertical-align: middle;\n -moz-user-select: none;\n user-select: none;\n }\n \n #checkPanel {\n cursor: pointer;\n }\n \n svg {\n display: block;\n }\n \n path {\n stroke: var(--wired-radio-icon-color, currentColor);\n stroke-width: 0.7;\n fill: transparent;\n }\n \n .filledPath {\n fill: var(--wired-radio-icon-color, currentColor);\n }\n `;\n }\n render() {\n return html `\n <div id=\"container\" @click=\"${this.toggleCheck}\">\n <div id=\"checkPanel\" class=\"inline\">\n <svg id=\"svg\" width=\"0\" height=\"0\"></svg>\n </div>\n <div class=\"inline\">\n <slot></slot>\n </div>\n </div>\n `;\n }\n refreshDisabledState() {\n if (this.disabled) {\n this.classList.add('wired-disabled');\n }\n else {\n this.classList.remove('wired-disabled');\n }\n this.tabIndex = this.disabled ? -1 : +(this.getAttribute('tabindex') || 0);\n }\n toggleCheck() {\n this.checked = !(this.checked || false);\n this.fireEvent('change', { checked: this.checked });\n }\n firstUpdated() {\n this.setAttribute('role', 'checkbox');\n this.addEventListener('keydown', (event) => {\n if ((event.keyCode === 13) || (event.keyCode === 32)) {\n event.preventDefault();\n this.toggleCheck();\n }\n });\n }\n updated(changed) {\n if (changed.has('disabled')) {\n this.refreshDisabledState();\n }\n const svg = this.shadowRoot.getElementById('svg');\n while (svg.hasChildNodes()) {\n svg.removeChild(svg.lastChild);\n }\n this.dot = undefined;\n const s = { width: this.iconsize || 24, height: this.iconsize || 24 };\n svg.setAttribute('width', `${s.width}`);\n svg.setAttribute('height', `${s.height}`);\n ellipse(svg, s.width / 2, s.height / 2, s.width, s.height);\n const iw = Math.max(s.width * 0.6, 5);\n const ih = Math.max(s.height * 0.6, 5);\n this.dot = ellipse(svg, s.width / 2, s.height / 2, iw, ih);\n this.dot.classList.add('filledPath');\n this.dot.style.display = this.checked ? '' : 'none';\n this.classList.add('wired-rendered');\n }\n};\n__decorate([\n property({ type: Boolean }),\n __metadata(\"design:type\", Object)\n], WiredRadio.prototype, \"checked\", void 0);\n__decorate([\n property({ type: Boolean, reflect: true }),\n __metadata(\"design:type\", Object)\n], WiredRadio.prototype, \"disabled\", void 0);\n__decorate([\n property({ type: String }),\n __metadata(\"design:type\", String)\n], WiredRadio.prototype, \"name\", void 0);\n__decorate([\n property({ type: Number }),\n __metadata(\"design:type\", Object)\n], WiredRadio.prototype, \"iconsize\", void 0);\nWiredRadio = __decorate([\n customElement('wired-radio')\n], WiredRadio);\nexport { WiredRadio };\n","var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __metadata = (this && this.__metadata) || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n};\nimport { WiredBase, customElement, property, html, css } from 'wired-lib/lib/wired-base';\nlet WiredRadioGroup = class WiredRadioGroup extends WiredBase {\n constructor() {\n super(...arguments);\n this.radioNodes = [];\n this.checkListener = this.handleChecked.bind(this);\n }\n static get styles() {\n return css `\n :host {\n display: inline-block;\n }\n \n :host ::slotted(*) {\n padding: var(--wired-radio-group-item-padding, 5px);\n }\n `;\n }\n render() {\n return html `\n <slot id=\"slot\" @slotchange=\"${this.slotChange}\"></slot>\n `;\n }\n connectedCallback() {\n super.connectedCallback();\n this.addEventListener('change', this.checkListener);\n }\n disconnectedCallback() {\n if (super.disconnectedCallback)\n super.disconnectedCallback();\n this.removeEventListener('checked', this.checkListener);\n }\n handleChecked(event) {\n const checked = event.detail.checked;\n const item = event.target;\n const name = item.name || '';\n if (!checked) {\n item.checked = true;\n }\n else {\n this.selected = (checked && name) || '';\n this.fireSelected();\n }\n }\n fireSelected() {\n this.fireEvent('selected', { selected: this.selected });\n }\n slotChange() {\n this.requestUpdate();\n }\n firstUpdated() {\n this.setAttribute('role', 'radiogroup');\n this.tabIndex = +(this.getAttribute('tabindex') || 0);\n this.addEventListener('keydown', (event) => {\n switch (event.keyCode) {\n case 37:\n case 38:\n event.preventDefault();\n this.selectPrevious();\n break;\n case 39:\n case 40:\n event.preventDefault();\n this.selectNext();\n break;\n }\n });\n }\n updated() {\n const slot = this.shadowRoot.getElementById('slot');\n const nodes = slot.assignedNodes();\n this.radioNodes = [];\n if (nodes && nodes.length) {\n for (let i = 0; i < nodes.length; i++) {\n const element = nodes[i];\n if (element.tagName === 'WIRED-RADIO') {\n this.radioNodes.push(element);\n const name = element.name || '';\n if (this.selected && (name === this.selected)) {\n element.checked = true;\n }\n else {\n element.checked = false;\n }\n }\n }\n }\n }\n selectPrevious() {\n const list = this.radioNodes;\n if (list.length) {\n let radio = null;\n let index = -1;\n if (this.selected) {\n for (let i = 0; i < list.length; i++) {\n const n = list[i];\n if (n.name === this.selected) {\n index = i;\n break;\n }\n }\n if (index < 0) {\n radio = list[0];\n }\n else {\n index--;\n if (index < 0) {\n index = list.length - 1;\n }\n radio = list[index];\n }\n }\n else {\n radio = list[0];\n }\n if (radio) {\n radio.focus();\n this.selected = radio.name;\n this.fireSelected();\n }\n }\n }\n selectNext() {\n const list = this.radioNodes;\n if (list.length) {\n let radio = null;\n let index = -1;\n if (this.selected) {\n for (let i = 0; i < list.length; i++) {\n const n = list[i];\n if (n.name === this.selected) {\n index = i;\n break;\n }\n }\n if (index < 0) {\n radio = list[0];\n }\n else {\n index++;\n if (index >= list.length) {\n index = 0;\n }\n radio = list[index];\n }\n }\n else {\n radio = list[0];\n }\n if (radio) {\n radio.focus();\n this.selected = radio.name;\n this.fireSelected();\n }\n }\n }\n};\n__decorate([\n property({ type: String }),\n __metadata(\"design:type\", String)\n], WiredRadioGroup.prototype, \"selected\", void 0);\nWiredRadioGroup = __decorate([\n customElement('wired-radio-group')\n], WiredRadioGroup);\nexport { WiredRadioGroup };\n","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n/* eslint-disable no-unused-vars */\n/**\n * When using Closure Compiler, JSCompiler_renameProperty(property, object) is replaced by the munged name for object[property]\n * We cannot alias this function, so we have to use a small shim that has the same behavior when not compiling.\n *\n * @param {string} prop Property name\n * @param {?Object} obj Reference object\n * @return {string} Potentially renamed property name\n */\nwindow.JSCompiler_renameProperty = function(prop, obj) {\n return prop;\n};\n/* eslint-enable */\n\nexport {};\n","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n/**\n * @fileoverview\n *\n * This module provides a number of strategies for enqueuing asynchronous\n * tasks. Each sub-module provides a standard `run(fn)` interface that returns a\n * handle, and a `cancel(handle)` interface for canceling async tasks before\n * they run.\n *\n * @summary Module that provides a number of strategies for enqueuing\n * asynchronous tasks.\n */\n\nimport './boot.js';\n\n// Microtask implemented using Mutation Observer\nlet microtaskCurrHandle = 0;\nlet microtaskLastHandle = 0;\nlet microtaskCallbacks = [];\nlet microtaskNodeContent = 0;\nlet microtaskNode = document.createTextNode('');\nnew window.MutationObserver(microtaskFlush).observe(microtaskNode, {characterData: true});\n\nfunction microtaskFlush() {\n const len = microtaskCallbacks.length;\n for (let i = 0; i < len; i++) {\n let cb = microtaskCallbacks[i];\n if (cb) {\n try {\n cb();\n } catch (e) {\n setTimeout(() => { throw e; });\n }\n }\n }\n microtaskCallbacks.splice(0, len);\n microtaskLastHandle += len;\n}\n\n/**\n * Async interface wrapper around `setTimeout`.\n *\n * @namespace\n * @summary Async interface wrapper around `setTimeout`.\n */\nconst timeOut = {\n /**\n * Returns a sub-module with the async interface providing the provided\n * delay.\n *\n * @memberof timeOut\n * @param {number=} delay Time to wait before calling callbacks in ms\n * @return {!AsyncInterface} An async timeout interface\n */\n after(delay) {\n return {\n run(fn) { return window.setTimeout(fn, delay); },\n cancel(handle) {\n window.clearTimeout(handle);\n }\n };\n },\n /**\n * Enqueues a function called in the next task.\n *\n * @memberof timeOut\n * @param {!Function} fn Callback to run\n * @param {number=} delay Delay in milliseconds\n * @return {number} Handle used for canceling task\n */\n run(fn, delay) {\n return window.setTimeout(fn, delay);\n },\n /**\n * Cancels a previously enqueued `timeOut` callback.\n *\n * @memberof timeOut\n * @param {number} handle Handle returned from `run` of callback to cancel\n * @return {void}\n */\n cancel(handle) {\n window.clearTimeout(handle);\n }\n};\nexport {timeOut};\n\n/**\n * Async interface wrapper around `requestAnimationFrame`.\n *\n * @namespace\n * @summary Async interface wrapper around `requestAnimationFrame`.\n */\nconst animationFrame = {\n /**\n * Enqueues a function called at `requestAnimationFrame` timing.\n *\n * @memberof animationFrame\n * @param {function(number):void} fn Callback to run\n * @return {number} Handle used for canceling task\n */\n run(fn) {\n return window.requestAnimationFrame(fn);\n },\n /**\n * Cancels a previously enqueued `animationFrame` callback.\n *\n * @memberof animationFrame\n * @param {number} handle Handle returned from `run` of callback to cancel\n * @return {void}\n */\n cancel(handle) {\n window.cancelAnimationFrame(handle);\n }\n};\nexport {animationFrame};\n\n/**\n * Async interface wrapper around `requestIdleCallback`. Falls back to\n * `setTimeout` on browsers that do not support `requestIdleCallback`.\n *\n * @namespace\n * @summary Async interface wrapper around `requestIdleCallback`.\n */\nconst idlePeriod = {\n /**\n * Enqueues a function called at `requestIdleCallback` timing.\n *\n * @memberof idlePeriod\n * @param {function(!IdleDeadline):void} fn Callback to run\n * @return {number} Handle used for canceling task\n */\n run(fn) {\n return window.requestIdleCallback ?\n window.requestIdleCallback(fn) :\n window.setTimeout(fn, 16);\n },\n /**\n * Cancels a previously enqueued `idlePeriod` callback.\n *\n * @memberof idlePeriod\n * @param {number} handle Handle returned from `run` of callback to cancel\n * @return {void}\n */\n cancel(handle) {\n window.cancelIdleCallback ?\n window.cancelIdleCallback(handle) :\n window.clearTimeout(handle);\n }\n};\nexport {idlePeriod};\n\n/**\n * Async interface for enqueuing callbacks that run at microtask timing.\n *\n * Note that microtask timing is achieved via a single `MutationObserver`,\n * and thus callbacks enqueued with this API will all run in a single\n * batch, and not interleaved with other microtasks such as promises.\n * Promises are avoided as an implementation choice for the time being\n * due to Safari bugs that cause Promises to lack microtask guarantees.\n *\n * @namespace\n * @summary Async interface for enqueuing callbacks that run at microtask\n * timing.\n */\nconst microTask = {\n\n /**\n * Enqueues a function called at microtask timing.\n *\n * @memberof microTask\n * @param {!Function=} callback Callback to run\n * @return {number} Handle used for canceling task\n */\n run(callback) {\n microtaskNode.textContent = microtaskNodeContent++;\n microtaskCallbacks.push(callback);\n return microtaskCurrHandle++;\n },\n\n /**\n * Cancels a previously enqueued `microTask` callback.\n *\n * @memberof microTask\n * @param {number} handle Handle returned from `run` of callback to cancel\n * @return {void}\n */\n cancel(handle) {\n const idx = handle - microtaskLastHandle;\n if (idx >= 0) {\n if (!microtaskCallbacks[idx]) {\n throw new Error('invalid async handle: ' + handle);\n }\n microtaskCallbacks[idx] = null;\n }\n }\n\n};\nexport {microTask};\n","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\nimport './boot.js';\n\nimport './mixin.js';\nimport './async.js';\n\n/**\n * @summary Collapse multiple callbacks into one invocation after a timer.\n */\nexport class Debouncer {\n constructor() {\n this._asyncModule = null;\n this._callback = null;\n this._timer = null;\n }\n /**\n * Sets the scheduler; that is, a module with the Async interface,\n * a callback and optional arguments to be passed to the run function\n * from the async module.\n *\n * @param {!AsyncInterface} asyncModule Object with Async interface.\n * @param {function()} callback Callback to run.\n * @return {void}\n */\n setConfig(asyncModule, callback) {\n this._asyncModule = asyncModule;\n this._callback = callback;\n this._timer = this._asyncModule.run(() => {\n this._timer = null;\n debouncerQueue.delete(this);\n this._callback();\n });\n }\n /**\n * Cancels an active debouncer and returns a reference to itself.\n *\n * @return {void}\n */\n cancel() {\n if (this.isActive()) {\n this._cancelAsync();\n // Canceling a debouncer removes its spot from the flush queue,\n // so if a debouncer is manually canceled and re-debounced, it\n // will reset its flush order (this is a very minor difference from 1.x)\n // Re-debouncing via the `debounce` API retains the 1.x FIFO flush order\n debouncerQueue.delete(this);\n }\n }\n /**\n * Cancels a debouncer's async callback.\n *\n * @return {void}\n */\n _cancelAsync() {\n if (this.isActive()) {\n this._asyncModule.cancel(/** @type {number} */(this._timer));\n this._timer = null;\n }\n }\n /**\n * Flushes an active debouncer and returns a reference to itself.\n *\n * @return {void}\n */\n flush() {\n if (this.isActive()) {\n this.cancel();\n this._callback();\n }\n }\n /**\n * Returns true if the debouncer is active.\n *\n * @return {boolean} True if active.\n */\n isActive() {\n return this._timer != null;\n }\n /**\n * Creates a debouncer if no debouncer is passed as a parameter\n * or it cancels an active debouncer otherwise. The following\n * example shows how a debouncer can be called multiple times within a\n * microtask and \"debounced\" such that the provided callback function is\n * called once. Add this method to a custom element:\n *\n * ```js\n * import {microTask} from '@polymer/polymer/lib/utils/async.js';\n * import {Debouncer} from '@polymer/polymer/lib/utils/debounce.js';\n * // ...\n *\n * _debounceWork() {\n * this._debounceJob = Debouncer.debounce(this._debounceJob,\n * microTask, () => this._doWork());\n * }\n * ```\n *\n * If the `_debounceWork` method is called multiple times within the same\n * microtask, the `_doWork` function will be called only once at the next\n * microtask checkpoint.\n *\n * Note: In testing it is often convenient to avoid asynchrony. To accomplish\n * this with a debouncer, you can use `enqueueDebouncer` and\n * `flush`. For example, extend the above example by adding\n * `enqueueDebouncer(this._debounceJob)` at the end of the\n * `_debounceWork` method. Then in a test, call `flush` to ensure\n * the debouncer has completed.\n *\n * @param {Debouncer?} debouncer Debouncer object.\n * @param {!AsyncInterface} asyncModule Object with Async interface\n * @param {function()} callback Callback to run.\n * @return {!Debouncer} Returns a debouncer object.\n */\n static debounce(debouncer, asyncModule, callback) {\n if (debouncer instanceof Debouncer) {\n // Cancel the async callback, but leave in debouncerQueue if it was\n // enqueued, to maintain 1.x flush order\n debouncer._cancelAsync();\n } else {\n debouncer = new Debouncer();\n }\n debouncer.setConfig(asyncModule, callback);\n return debouncer;\n }\n}\n\nlet debouncerQueue = new Set();\n\n/**\n * Adds a `Debouncer` to a list of globally flushable tasks.\n *\n * @param {!Debouncer} debouncer Debouncer to enqueue\n * @return {void}\n */\nexport const enqueueDebouncer = function(debouncer) {\n debouncerQueue.add(debouncer);\n};\n\n/**\n * Flushes any enqueued debouncers\n *\n * @return {boolean} Returns whether any debouncers were flushed\n */\nexport const flushDebouncers = function() {\n const didFlush = Boolean(debouncerQueue.size);\n // If new debouncers are added while flushing, Set.forEach will ensure\n // newly added ones are also flushed\n debouncerQueue.forEach(debouncer => {\n try {\n debouncer.flush();\n } catch(e) {\n setTimeout(() => {\n throw e;\n });\n }\n });\n return didFlush;\n};","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\nimport './boot.js';\n\nimport { pathFromUrl } from './resolve-url.js';\nexport const useShadow = !(window.ShadyDOM);\nexport const useNativeCSSProperties = Boolean(!window.ShadyCSS || window.ShadyCSS.nativeCss);\nexport const useNativeCustomElements = !(window.customElements.polyfillWrapFlushCallback);\n\n\n/**\n * Globally settable property that is automatically assigned to\n * `ElementMixin` instances, useful for binding in templates to\n * make URL's relative to an application's root. Defaults to the main\n * document URL, but can be overridden by users. It may be useful to set\n * `rootPath` to provide a stable application mount path when\n * using client side routing.\n */\nexport let rootPath = pathFromUrl(document.baseURI || window.location.href);\n\n/**\n * Sets the global rootPath property used by `ElementMixin` and\n * available via `rootPath`.\n *\n * @param {string} path The new root path\n * @return {void}\n */\nexport const setRootPath = function(path) {\n rootPath = path;\n};\n\n/**\n * A global callback used to sanitize any value before inserting it into the DOM.\n * The callback signature is:\n *\n * function sanitizeDOMValue(value, name, type, node) { ... }\n *\n * Where:\n *\n * `value` is the value to sanitize.\n * `name` is the name of an attribute or property (for example, href).\n * `type` indicates where the value is being inserted: one of property, attribute, or text.\n * `node` is the node where the value is being inserted.\n *\n * @type {(function(*,string,string,Node):*)|undefined}\n */\nexport let sanitizeDOMValue = window.Polymer && window.Polymer.sanitizeDOMValue || undefined;\n\n/**\n * Sets the global sanitizeDOMValue available via this module's exported\n * `sanitizeDOMValue` variable.\n *\n * @param {(function(*,string,string,Node):*)|undefined} newSanitizeDOMValue the global sanitizeDOMValue callback\n * @return {void}\n */\nexport const setSanitizeDOMValue = function(newSanitizeDOMValue) {\n sanitizeDOMValue = newSanitizeDOMValue;\n};\n\n/**\n * Globally settable property to make Polymer Gestures use passive TouchEvent listeners when recognizing gestures.\n * When set to `true`, gestures made from touch will not be able to prevent scrolling, allowing for smoother\n * scrolling performance.\n * Defaults to `false` for backwards compatibility.\n */\nexport let passiveTouchGestures = false;\n\n/**\n * Sets `passiveTouchGestures` globally for all elements using Polymer Gestures.\n *\n * @param {boolean} usePassive enable or disable passive touch gestures globally\n * @return {void}\n */\nexport const setPassiveTouchGestures = function(usePassive) {\n passiveTouchGestures = usePassive;\n};\n\n/**\n * Setting to ensure Polymer template evaluation only occurs based on tempates\n * defined in trusted script. When true, `<dom-module>` re-registration is\n * disallowed, `<dom-bind>` is disabled, and `<dom-if>`/`<dom-repeat>`\n * templates will only evaluate in the context of a trusted element template.\n */\nexport let strictTemplatePolicy = false;\n\n/**\n * Sets `strictTemplatePolicy` globally for all elements\n *\n * @param {boolean} useStrictPolicy enable or disable strict template policy\n * globally\n * @return {void}\n */\nexport const setStrictTemplatePolicy = function(useStrictPolicy) {\n strictTemplatePolicy = useStrictPolicy;\n};\n\n/**\n * Setting to enable dom-module lookup from Polymer.Element. By default,\n * templates must be defined in script using the `static get template()`\n * getter and the `html` tag function. To enable legacy loading of templates\n * via dom-module, set this flag to true.\n */\nexport let allowTemplateFromDomModule = false;\n\n/**\n * Sets `lookupTemplateFromDomModule` globally for all elements\n *\n * @param {boolean} allowDomModule enable or disable template lookup\n * globally\n * @return {void}\n */\nexport const setAllowTemplateFromDomModule = function(allowDomModule) {\n allowTemplateFromDomModule = allowDomModule;\n};\n\n/**\n * Setting to skip processing style includes and re-writing urls in css styles.\n * Normally \"included\" styles are pulled into the element and all urls in styles\n * are re-written to be relative to the containing script url.\n * If no includes or relative urls are used in styles, these steps can be\n * skipped as an optimization.\n */\nexport let legacyOptimizations = false;\n\n/**\n * Sets `legacyOptimizations` globally for all elements to enable optimizations\n * when only legacy based elements are used.\n *\n * @param {boolean} useLegacyOptimizations enable or disable legacy optimizations\n * includes and url rewriting\n * @return {void}\n */\nexport const setLegacyOptimizations = function(useLegacyOptimizations) {\n legacyOptimizations = useLegacyOptimizations;\n};\n\n/**\n * Setting to perform initial rendering synchronously when running under ShadyDOM.\n * This matches the behavior of Polymer 1.\n */\nexport let syncInitialRender = false;\n\n/**\n * Sets `syncInitialRender` globally for all elements to enable synchronous\n * initial rendering.\n *\n * @param {boolean} useSyncInitialRender enable or disable synchronous initial\n * rendering globally.\n * @return {void}\n */\nexport const setSyncInitialRender = function(useSyncInitialRender) {\n syncInitialRender = useSyncInitialRender;\n};\n","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\nimport './boot.js';\n\nlet CSS_URL_RX = /(url\\()([^)]*)(\\))/g;\nlet ABS_URL = /(^\\/)|(^#)|(^[\\w-\\d]*:)/;\nlet workingURL;\nlet resolveDoc;\n/**\n * Resolves the given URL against the provided `baseUri'.\n *\n * Note that this function performs no resolution for URLs that start\n * with `/` (absolute URLs) or `#` (hash identifiers). For general purpose\n * URL resolution, use `window.URL`.\n *\n * @param {string} url Input URL to resolve\n * @param {?string=} baseURI Base URI to resolve the URL against\n * @return {string} resolved URL\n */\nexport function resolveUrl(url, baseURI) {\n if (url && ABS_URL.test(url)) {\n return url;\n }\n // Lazy feature detection.\n if (workingURL === undefined) {\n workingURL = false;\n try {\n const u = new URL('b', 'http://a');\n u.pathname = 'c%20d';\n workingURL = (u.href === 'http://a/c%20d');\n } catch (e) {\n // silently fail\n }\n }\n if (!baseURI) {\n baseURI = document.baseURI || window.location.href;\n }\n if (workingURL) {\n return (new URL(url, baseURI)).href;\n }\n // Fallback to creating an anchor into a disconnected document.\n if (!resolveDoc) {\n resolveDoc = document.implementation.createHTMLDocument('temp');\n resolveDoc.base = resolveDoc.createElement('base');\n resolveDoc.head.appendChild(resolveDoc.base);\n resolveDoc.anchor = resolveDoc.createElement('a');\n resolveDoc.body.appendChild(resolveDoc.anchor);\n }\n resolveDoc.base.href = baseURI;\n resolveDoc.anchor.href = url;\n return resolveDoc.anchor.href || url;\n\n}\n\n/**\n * Resolves any relative URL's in the given CSS text against the provided\n * `ownerDocument`'s `baseURI`.\n *\n * @param {string} cssText CSS text to process\n * @param {string} baseURI Base URI to resolve the URL against\n * @return {string} Processed CSS text with resolved URL's\n */\nexport function resolveCss(cssText, baseURI) {\n return cssText.replace(CSS_URL_RX, function(m, pre, url, post) {\n return pre + '\\'' +\n resolveUrl(url.replace(/[\"']/g, ''), baseURI) +\n '\\'' + post;\n });\n}\n\n/**\n * Returns a path from a given `url`. The path includes the trailing\n * `/` from the url.\n *\n * @param {string} url Input URL to transform\n * @return {string} resolved path\n */\nexport function pathFromUrl(url) {\n return url.substring(0, url.lastIndexOf('/') + 1);\n}\n","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n/* eslint-disable valid-jsdoc */\n/**\n * Node wrapper to ensure ShadowDOM safe operation regardless of polyfill\n * presence or mode. Note that with the introduction of `ShadyDOM.noPatch`,\n * a node wrapper must be used to access ShadowDOM API.\n * This is similar to using `Polymer.dom` but relies exclusively\n * on the presence of the ShadyDOM polyfill rather than requiring the loading\n * of legacy (Polymer.dom) API.\n * @type {function(Node):Node}\n */\nexport const wrap = (window['ShadyDOM'] && window['ShadyDOM']['noPatch'] && window['ShadyDOM']['wrap']) ?\n window['ShadyDOM']['wrap'] : (n) => n;\n\n","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n/**\n * @fileoverview\n *\n * Module for adding listeners to a node for the following normalized\n * cross-platform \"gesture\" events:\n * - `down` - mouse or touch went down\n * - `up` - mouse or touch went up\n * - `tap` - mouse click or finger tap\n * - `track` - mouse drag or touch move\n *\n * @summary Module for adding cross-platform gesture event listeners.\n */\n\nimport './boot.js';\n\nimport { timeOut, microTask } from './async.js';\nimport { Debouncer } from './debounce.js';\nimport { passiveTouchGestures } from './settings.js';\nimport { wrap } from './wrap.js';\n\n// detect native touch action support\nlet HAS_NATIVE_TA = typeof document.head.style.touchAction === 'string';\nlet GESTURE_KEY = '__polymerGestures';\nlet HANDLED_OBJ = '__polymerGesturesHandled';\nlet TOUCH_ACTION = '__polymerGesturesTouchAction';\n// radius for tap and track\nlet TAP_DISTANCE = 25;\nlet TRACK_DISTANCE = 5;\n// number of last N track positions to keep\nlet TRACK_LENGTH = 2;\n\n// Disabling \"mouse\" handlers for 2500ms is enough\nlet MOUSE_TIMEOUT = 2500;\nlet MOUSE_EVENTS = ['mousedown', 'mousemove', 'mouseup', 'click'];\n// an array of bitmask values for mapping MouseEvent.which to MouseEvent.buttons\nlet MOUSE_WHICH_TO_BUTTONS = [0, 1, 4, 2];\nlet MOUSE_HAS_BUTTONS = (function() {\n try {\n return new MouseEvent('test', {buttons: 1}).buttons === 1;\n } catch (e) {\n return false;\n }\n})();\n\n/**\n * @param {string} name Possible mouse event name\n * @return {boolean} true if mouse event, false if not\n */\nfunction isMouseEvent(name) {\n return MOUSE_EVENTS.indexOf(name) > -1;\n}\n\n/* eslint no-empty: [\"error\", { \"allowEmptyCatch\": true }] */\n// check for passive event listeners\nlet SUPPORTS_PASSIVE = false;\n(function() {\n try {\n let opts = Object.defineProperty({}, 'passive', {get() {SUPPORTS_PASSIVE = true;}});\n window.addEventListener('test', null, opts);\n window.removeEventListener('test', null, opts);\n } catch(e) {}\n})();\n\n/**\n * Generate settings for event listeners, dependant on `passiveTouchGestures`\n *\n * @param {string} eventName Event name to determine if `{passive}` option is\n * needed\n * @return {{passive: boolean} | undefined} Options to use for addEventListener\n * and removeEventListener\n */\nfunction PASSIVE_TOUCH(eventName) {\n if (isMouseEvent(eventName) || eventName === 'touchend') {\n return;\n }\n if (HAS_NATIVE_TA && SUPPORTS_PASSIVE && passiveTouchGestures) {\n return {passive: true};\n } else {\n return;\n }\n}\n\n// Check for touch-only devices\nlet IS_TOUCH_ONLY = navigator.userAgent.match(/iP(?:[oa]d|hone)|Android/);\n\n// keep track of any labels hit by the mouseCanceller\n/** @type {!Array<!HTMLLabelElement>} */\nconst clickedLabels = [];\n\n/** @type {!Object<boolean>} */\nconst labellable = {\n 'button': true,\n 'input': true,\n 'keygen': true,\n 'meter': true,\n 'output': true,\n 'textarea': true,\n 'progress': true,\n 'select': true\n};\n\n// Defined at https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#enabling-and-disabling-form-controls:-the-disabled-attribute\n/** @type {!Object<boolean>} */\nconst canBeDisabled = {\n 'button': true,\n 'command': true,\n 'fieldset': true,\n 'input': true,\n 'keygen': true,\n 'optgroup': true,\n 'option': true,\n 'select': true,\n 'textarea': true\n};\n\n/**\n * @param {HTMLElement} el Element to check labelling status\n * @return {boolean} element can have labels\n */\nfunction canBeLabelled(el) {\n return labellable[el.localName] || false;\n}\n\n/**\n * @param {HTMLElement} el Element that may be labelled.\n * @return {!Array<!HTMLLabelElement>} Relevant label for `el`\n */\nfunction matchingLabels(el) {\n let labels = Array.prototype.slice.call(/** @type {HTMLInputElement} */(el).labels || []);\n // IE doesn't have `labels` and Safari doesn't populate `labels`\n // if element is in a shadowroot.\n // In this instance, finding the non-ancestor labels is enough,\n // as the mouseCancellor code will handle ancstor labels\n if (!labels.length) {\n labels = [];\n let root = el.getRootNode();\n // if there is an id on `el`, check for all labels with a matching `for` attribute\n if (el.id) {\n let matching = root.querySelectorAll(`label[for = ${el.id}]`);\n for (let i = 0; i < matching.length; i++) {\n labels.push(/** @type {!HTMLLabelElement} */(matching[i]));\n }\n }\n }\n return labels;\n}\n\n// touch will make synthetic mouse events\n// `preventDefault` on touchend will cancel them,\n// but this breaks `<input>` focus and link clicks\n// disable mouse handlers for MOUSE_TIMEOUT ms after\n// a touchend to ignore synthetic mouse events\nlet mouseCanceller = function(mouseEvent) {\n // Check for sourceCapabilities, used to distinguish synthetic events\n // if mouseEvent did not come from a device that fires touch events,\n // it was made by a real mouse and should be counted\n // http://wicg.github.io/InputDeviceCapabilities/#dom-inputdevicecapabilities-firestouchevents\n let sc = mouseEvent.sourceCapabilities;\n if (sc && !sc.firesTouchEvents) {\n return;\n }\n // skip synthetic mouse events\n mouseEvent[HANDLED_OBJ] = {skip: true};\n // disable \"ghost clicks\"\n if (mouseEvent.type === 'click') {\n let clickFromLabel = false;\n let path = getComposedPath(mouseEvent);\n for (let i = 0; i < path.length; i++) {\n if (path[i].nodeType === Node.ELEMENT_NODE) {\n if (path[i].localName === 'label') {\n clickedLabels.push(/** @type {!HTMLLabelElement} */ (path[i]));\n } else if (canBeLabelled(/** @type {!HTMLElement} */ (path[i]))) {\n let ownerLabels =\n matchingLabels(/** @type {!HTMLElement} */ (path[i]));\n // check if one of the clicked labels is labelling this element\n for (let j = 0; j < ownerLabels.length; j++) {\n clickFromLabel = clickFromLabel || clickedLabels.indexOf(ownerLabels[j]) > -1;\n }\n }\n }\n if (path[i] === POINTERSTATE.mouse.target) {\n return;\n }\n }\n // if one of the clicked labels was labelling the target element,\n // this is not a ghost click\n if (clickFromLabel) {\n return;\n }\n mouseEvent.preventDefault();\n mouseEvent.stopPropagation();\n }\n};\n\n/**\n * @param {boolean=} setup True to add, false to remove.\n * @return {void}\n */\nfunction setupTeardownMouseCanceller(setup) {\n let events = IS_TOUCH_ONLY ? ['click'] : MOUSE_EVENTS;\n for (let i = 0, en; i < events.length; i++) {\n en = events[i];\n if (setup) {\n // reset clickLabels array\n clickedLabels.length = 0;\n document.addEventListener(en, mouseCanceller, true);\n } else {\n document.removeEventListener(en, mouseCanceller, true);\n }\n }\n}\n\nfunction ignoreMouse(e) {\n if (!POINTERSTATE.mouse.mouseIgnoreJob) {\n setupTeardownMouseCanceller(true);\n }\n let unset = function() {\n setupTeardownMouseCanceller();\n POINTERSTATE.mouse.target = null;\n POINTERSTATE.mouse.mouseIgnoreJob = null;\n };\n POINTERSTATE.mouse.target = getComposedPath(e)[0];\n POINTERSTATE.mouse.mouseIgnoreJob = Debouncer.debounce(\n POINTERSTATE.mouse.mouseIgnoreJob\n , timeOut.after(MOUSE_TIMEOUT)\n , unset);\n}\n\n/**\n * @param {MouseEvent} ev event to test for left mouse button down\n * @return {boolean} has left mouse button down\n */\nfunction hasLeftMouseButton(ev) {\n let type = ev.type;\n // exit early if the event is not a mouse event\n if (!isMouseEvent(type)) {\n return false;\n }\n // ev.button is not reliable for mousemove (0 is overloaded as both left button and no buttons)\n // instead we use ev.buttons (bitmask of buttons) or fall back to ev.which (deprecated, 0 for no buttons, 1 for left button)\n if (type === 'mousemove') {\n // allow undefined for testing events\n let buttons = ev.buttons === undefined ? 1 : ev.buttons;\n if ((ev instanceof window.MouseEvent) && !MOUSE_HAS_BUTTONS) {\n buttons = MOUSE_WHICH_TO_BUTTONS[ev.which] || 0;\n }\n // buttons is a bitmask, check that the left button bit is set (1)\n return Boolean(buttons & 1);\n } else {\n // allow undefined for testing events\n let button = ev.button === undefined ? 0 : ev.button;\n // ev.button is 0 in mousedown/mouseup/click for left button activation\n return button === 0;\n }\n}\n\nfunction isSyntheticClick(ev) {\n if (ev.type === 'click') {\n // ev.detail is 0 for HTMLElement.click in most browsers\n if (ev.detail === 0) {\n return true;\n }\n // in the worst case, check that the x/y position of the click is within\n // the bounding box of the target of the event\n // Thanks IE 10 >:(\n let t = _findOriginalTarget(ev);\n // make sure the target of the event is an element so we can use getBoundingClientRect,\n // if not, just assume it is a synthetic click\n if (!t.nodeType || /** @type {Element} */(t).nodeType !== Node.ELEMENT_NODE) {\n return true;\n }\n let bcr = /** @type {Element} */(t).getBoundingClientRect();\n // use page x/y to account for scrolling\n let x = ev.pageX, y = ev.pageY;\n // ev is a synthetic click if the position is outside the bounding box of the target\n return !((x >= bcr.left && x <= bcr.right) && (y >= bcr.top && y <= bcr.bottom));\n }\n return false;\n}\n\nlet POINTERSTATE = {\n mouse: {\n target: null,\n mouseIgnoreJob: null\n },\n touch: {\n x: 0,\n y: 0,\n id: -1,\n scrollDecided: false\n }\n};\n\nfunction firstTouchAction(ev) {\n let ta = 'auto';\n let path = getComposedPath(ev);\n for (let i = 0, n; i < path.length; i++) {\n n = path[i];\n if (n[TOUCH_ACTION]) {\n ta = n[TOUCH_ACTION];\n break;\n }\n }\n return ta;\n}\n\nfunction trackDocument(stateObj, movefn, upfn) {\n stateObj.movefn = movefn;\n stateObj.upfn = upfn;\n document.addEventListener('mousemove', movefn);\n document.addEventListener('mouseup', upfn);\n}\n\nfunction untrackDocument(stateObj) {\n document.removeEventListener('mousemove', stateObj.movefn);\n document.removeEventListener('mouseup', stateObj.upfn);\n stateObj.movefn = null;\n stateObj.upfn = null;\n}\n\n// use a document-wide touchend listener to start the ghost-click prevention mechanism\n// Use passive event listeners, if supported, to not affect scrolling performance\ndocument.addEventListener('touchend', ignoreMouse, SUPPORTS_PASSIVE ? {passive: true} : false);\n\n/**\n * Returns the composedPath for the given event.\n * @param {Event} event to process\n * @return {!Array<!EventTarget>} Path of the event\n */\nconst getComposedPath = window.ShadyDOM && window.ShadyDOM.noPatch ?\n window.ShadyDOM.composedPath :\n (event) => event.composedPath && event.composedPath() || [];\n\n/** @type {!Object<string, !GestureRecognizer>} */\nexport const gestures = {};\n\n/** @type {!Array<!GestureRecognizer>} */\nexport const recognizers = [];\n\n/**\n * Finds the element rendered on the screen at the provided coordinates.\n *\n * Similar to `document.elementFromPoint`, but pierces through\n * shadow roots.\n *\n * @param {number} x Horizontal pixel coordinate\n * @param {number} y Vertical pixel coordinate\n * @return {Element} Returns the deepest shadowRoot inclusive element\n * found at the screen position given.\n */\nexport function deepTargetFind(x, y) {\n let node = document.elementFromPoint(x, y);\n let next = node;\n // this code path is only taken when native ShadowDOM is used\n // if there is a shadowroot, it may have a node at x/y\n // if there is not a shadowroot, exit the loop\n while (next && next.shadowRoot && !window.ShadyDOM) {\n // if there is a node at x/y in the shadowroot, look deeper\n let oldNext = next;\n next = next.shadowRoot.elementFromPoint(x, y);\n // on Safari, elementFromPoint may return the shadowRoot host\n if (oldNext === next) {\n break;\n }\n if (next) {\n node = next;\n }\n }\n return node;\n}\n\n/**\n * a cheaper check than ev.composedPath()[0];\n *\n * @private\n * @param {Event|Touch} ev Event.\n * @return {EventTarget} Returns the event target.\n */\nfunction _findOriginalTarget(ev) {\n const path = getComposedPath(/** @type {?Event} */ (ev));\n // It shouldn't be, but sometimes path is empty (window on Safari).\n return path.length > 0 ? path[0] : ev.target;\n}\n\n/**\n * @private\n * @param {Event} ev Event.\n * @return {void}\n */\nfunction _handleNative(ev) {\n let handled;\n let type = ev.type;\n let node = ev.currentTarget;\n let gobj = node[GESTURE_KEY];\n if (!gobj) {\n return;\n }\n let gs = gobj[type];\n if (!gs) {\n return;\n }\n if (!ev[HANDLED_OBJ]) {\n ev[HANDLED_OBJ] = {};\n if (type.slice(0, 5) === 'touch') {\n ev = /** @type {TouchEvent} */(ev); // eslint-disable-line no-self-assign\n let t = ev.changedTouches[0];\n if (type === 'touchstart') {\n // only handle the first finger\n if (ev.touches.length === 1) {\n POINTERSTATE.touch.id = t.identifier;\n }\n }\n if (POINTERSTATE.touch.id !== t.identifier) {\n return;\n }\n if (!HAS_NATIVE_TA) {\n if (type === 'touchstart' || type === 'touchmove') {\n _handleTouchAction(ev);\n }\n }\n }\n }\n handled = ev[HANDLED_OBJ];\n // used to ignore synthetic mouse events\n if (handled.skip) {\n return;\n }\n // reset recognizer state\n for (let i = 0, r; i < recognizers.length; i++) {\n r = recognizers[i];\n if (gs[r.name] && !handled[r.name]) {\n if (r.flow && r.flow.start.indexOf(ev.type) > -1 && r.reset) {\n r.reset();\n }\n }\n }\n // enforce gesture recognizer order\n for (let i = 0, r; i < recognizers.length; i++) {\n r = recognizers[i];\n if (gs[r.name] && !handled[r.name]) {\n handled[r.name] = true;\n r[type](ev);\n }\n }\n}\n\n/**\n * @private\n * @param {TouchEvent} ev Event.\n * @return {void}\n */\nfunction _handleTouchAction(ev) {\n let t = ev.changedTouches[0];\n let type = ev.type;\n if (type === 'touchstart') {\n POINTERSTATE.touch.x = t.clientX;\n POINTERSTATE.touch.y = t.clientY;\n POINTERSTATE.touch.scrollDecided = false;\n } else if (type === 'touchmove') {\n if (POINTERSTATE.touch.scrollDecided) {\n return;\n }\n POINTERSTATE.touch.scrollDecided = true;\n let ta = firstTouchAction(ev);\n let shouldPrevent = false;\n let dx = Math.abs(POINTERSTATE.touch.x - t.clientX);\n let dy = Math.abs(POINTERSTATE.touch.y - t.clientY);\n if (!ev.cancelable) {\n // scrolling is happening\n } else if (ta === 'none') {\n shouldPrevent = true;\n } else if (ta === 'pan-x') {\n shouldPrevent = dy > dx;\n } else if (ta === 'pan-y') {\n shouldPrevent = dx > dy;\n }\n if (shouldPrevent) {\n ev.preventDefault();\n } else {\n prevent('track');\n }\n }\n}\n\n/**\n * Adds an event listener to a node for the given gesture type.\n *\n * @param {!EventTarget} node Node to add listener on\n * @param {string} evType Gesture type: `down`, `up`, `track`, or `tap`\n * @param {!function(!Event):void} handler Event listener function to call\n * @return {boolean} Returns true if a gesture event listener was added.\n */\nexport function addListener(node, evType, handler) {\n if (gestures[evType]) {\n _add(node, evType, handler);\n return true;\n }\n return false;\n}\n\n/**\n * Removes an event listener from a node for the given gesture type.\n *\n * @param {!EventTarget} node Node to remove listener from\n * @param {string} evType Gesture type: `down`, `up`, `track`, or `tap`\n * @param {!function(!Event):void} handler Event listener function previously passed to\n * `addListener`.\n * @return {boolean} Returns true if a gesture event listener was removed.\n */\nexport function removeListener(node, evType, handler) {\n if (gestures[evType]) {\n _remove(node, evType, handler);\n return true;\n }\n return false;\n}\n\n/**\n * automate the event listeners for the native events\n *\n * @private\n * @param {!EventTarget} node Node on which to add the event.\n * @param {string} evType Event type to add.\n * @param {function(!Event)} handler Event handler function.\n * @return {void}\n */\nfunction _add(node, evType, handler) {\n let recognizer = gestures[evType];\n let deps = recognizer.deps;\n let name = recognizer.name;\n let gobj = node[GESTURE_KEY];\n if (!gobj) {\n node[GESTURE_KEY] = gobj = {};\n }\n for (let i = 0, dep, gd; i < deps.length; i++) {\n dep = deps[i];\n // don't add mouse handlers on iOS because they cause gray selection overlays\n if (IS_TOUCH_ONLY && isMouseEvent(dep) && dep !== 'click') {\n continue;\n }\n gd = gobj[dep];\n if (!gd) {\n gobj[dep] = gd = {_count: 0};\n }\n if (gd._count === 0) {\n node.addEventListener(dep, _handleNative, PASSIVE_TOUCH(dep));\n }\n gd[name] = (gd[name] || 0) + 1;\n gd._count = (gd._count || 0) + 1;\n }\n node.addEventListener(evType, handler);\n if (recognizer.touchAction) {\n setTouchAction(node, recognizer.touchAction);\n }\n}\n\n/**\n * automate event listener removal for native events\n *\n * @private\n * @param {!EventTarget} node Node on which to remove the event.\n * @param {string} evType Event type to remove.\n * @param {function(!Event): void} handler Event handler function.\n * @return {void}\n */\nfunction _remove(node, evType, handler) {\n let recognizer = gestures[evType];\n let deps = recognizer.deps;\n let name = recognizer.name;\n let gobj = node[GESTURE_KEY];\n if (gobj) {\n for (let i = 0, dep, gd; i < deps.length; i++) {\n dep = deps[i];\n gd = gobj[dep];\n if (gd && gd[name]) {\n gd[name] = (gd[name] || 1) - 1;\n gd._count = (gd._count || 1) - 1;\n if (gd._count === 0) {\n node.removeEventListener(dep, _handleNative, PASSIVE_TOUCH(dep));\n }\n }\n }\n }\n node.removeEventListener(evType, handler);\n}\n\n/**\n * Registers a new gesture event recognizer for adding new custom\n * gesture event types.\n *\n * @param {!GestureRecognizer} recog Gesture recognizer descriptor\n * @return {void}\n */\nexport function register(recog) {\n recognizers.push(recog);\n for (let i = 0; i < recog.emits.length; i++) {\n gestures[recog.emits[i]] = recog;\n }\n}\n\n/**\n * @private\n * @param {string} evName Event name.\n * @return {Object} Returns the gesture for the given event name.\n */\nfunction _findRecognizerByEvent(evName) {\n for (let i = 0, r; i < recognizers.length; i++) {\n r = recognizers[i];\n for (let j = 0, n; j < r.emits.length; j++) {\n n = r.emits[j];\n if (n === evName) {\n return r;\n }\n }\n }\n return null;\n}\n\n/**\n * Sets scrolling direction on node.\n *\n * This value is checked on first move, thus it should be called prior to\n * adding event listeners.\n *\n * @param {!EventTarget} node Node to set touch action setting on\n * @param {string} value Touch action value\n * @return {void}\n */\nexport function setTouchAction(node, value) {\n if (HAS_NATIVE_TA && node instanceof HTMLElement) {\n // NOTE: add touchAction async so that events can be added in\n // custom element constructors. Otherwise we run afoul of custom\n // elements restriction against settings attributes (style) in the\n // constructor.\n microTask.run(() => {\n node.style.touchAction = value;\n });\n }\n node[TOUCH_ACTION] = value;\n}\n\n/**\n * Dispatches an event on the `target` element of `type` with the given\n * `detail`.\n * @private\n * @param {!EventTarget} target The element on which to fire an event.\n * @param {string} type The type of event to fire.\n * @param {!Object=} detail The detail object to populate on the event.\n * @return {void}\n */\nfunction _fire(target, type, detail) {\n let ev = new Event(type, { bubbles: true, cancelable: true, composed: true });\n ev.detail = detail;\n wrap(/** @type {!Node} */(target)).dispatchEvent(ev);\n // forward `preventDefault` in a clean way\n if (ev.defaultPrevented) {\n let preventer = detail.preventer || detail.sourceEvent;\n if (preventer && preventer.preventDefault) {\n preventer.preventDefault();\n }\n }\n}\n\n/**\n * Prevents the dispatch and default action of the given event name.\n *\n * @param {string} evName Event name.\n * @return {void}\n */\nexport function prevent(evName) {\n let recognizer = _findRecognizerByEvent(evName);\n if (recognizer.info) {\n recognizer.info.prevent = true;\n }\n}\n\n/**\n * Reset the 2500ms timeout on processing mouse input after detecting touch input.\n *\n * Touch inputs create synthesized mouse inputs anywhere from 0 to 2000ms after the touch.\n * This method should only be called during testing with simulated touch inputs.\n * Calling this method in production may cause duplicate taps or other Gestures.\n *\n * @return {void}\n */\nexport function resetMouseCanceller() {\n if (POINTERSTATE.mouse.mouseIgnoreJob) {\n POINTERSTATE.mouse.mouseIgnoreJob.flush();\n }\n}\n\n/* eslint-disable valid-jsdoc */\n\nregister({\n name: 'downup',\n deps: ['mousedown', 'touchstart', 'touchend'],\n flow: {\n start: ['mousedown', 'touchstart'],\n end: ['mouseup', 'touchend']\n },\n emits: ['down', 'up'],\n\n info: {\n movefn: null,\n upfn: null\n },\n\n /**\n * @this {GestureRecognizer}\n * @return {void}\n */\n reset: function() {\n untrackDocument(this.info);\n },\n\n /**\n * @this {GestureRecognizer}\n * @param {MouseEvent} e\n * @return {void}\n */\n mousedown: function(e) {\n if (!hasLeftMouseButton(e)) {\n return;\n }\n let t = _findOriginalTarget(e);\n let self = this;\n let movefn = function movefn(e) {\n if (!hasLeftMouseButton(e)) {\n downupFire('up', t, e);\n untrackDocument(self.info);\n }\n };\n let upfn = function upfn(e) {\n if (hasLeftMouseButton(e)) {\n downupFire('up', t, e);\n }\n untrackDocument(self.info);\n };\n trackDocument(this.info, movefn, upfn);\n downupFire('down', t, e);\n },\n /**\n * @this {GestureRecognizer}\n * @param {TouchEvent} e\n * @return {void}\n */\n touchstart: function(e) {\n downupFire('down', _findOriginalTarget(e), e.changedTouches[0], e);\n },\n /**\n * @this {GestureRecognizer}\n * @param {TouchEvent} e\n * @return {void}\n */\n touchend: function(e) {\n downupFire('up', _findOriginalTarget(e), e.changedTouches[0], e);\n }\n});\n\n/**\n * @param {string} type\n * @param {EventTarget} target\n * @param {Event|Touch} event\n * @param {Event=} preventer\n * @return {void}\n */\nfunction downupFire(type, target, event, preventer) {\n if (!target) {\n return;\n }\n _fire(target, type, {\n x: event.clientX,\n y: event.clientY,\n sourceEvent: event,\n preventer: preventer,\n prevent: function(e) {\n return prevent(e);\n }\n });\n}\n\nregister({\n name: 'track',\n touchAction: 'none',\n deps: ['mousedown', 'touchstart', 'touchmove', 'touchend'],\n flow: {\n start: ['mousedown', 'touchstart'],\n end: ['mouseup', 'touchend']\n },\n emits: ['track'],\n\n info: {\n x: 0,\n y: 0,\n state: 'start',\n started: false,\n moves: [],\n /** @this {GestureInfo} */\n addMove: function(move) {\n if (this.moves.length > TRACK_LENGTH) {\n this.moves.shift();\n }\n this.moves.push(move);\n },\n movefn: null,\n upfn: null,\n prevent: false\n },\n\n /**\n * @this {GestureRecognizer}\n * @return {void}\n */\n reset: function() {\n this.info.state = 'start';\n this.info.started = false;\n this.info.moves = [];\n this.info.x = 0;\n this.info.y = 0;\n this.info.prevent = false;\n untrackDocument(this.info);\n },\n\n /**\n * @this {GestureRecognizer}\n * @param {MouseEvent} e\n * @return {void}\n */\n mousedown: function(e) {\n if (!hasLeftMouseButton(e)) {\n return;\n }\n let t = _findOriginalTarget(e);\n let self = this;\n let movefn = function movefn(e) {\n let x = e.clientX, y = e.clientY;\n if (trackHasMovedEnough(self.info, x, y)) {\n // first move is 'start', subsequent moves are 'move', mouseup is 'end'\n self.info.state = self.info.started ? (e.type === 'mouseup' ? 'end' : 'track') : 'start';\n if (self.info.state === 'start') {\n // if and only if tracking, always prevent tap\n prevent('tap');\n }\n self.info.addMove({x: x, y: y});\n if (!hasLeftMouseButton(e)) {\n // always fire \"end\"\n self.info.state = 'end';\n untrackDocument(self.info);\n }\n if (t) {\n trackFire(self.info, t, e);\n }\n self.info.started = true;\n }\n };\n let upfn = function upfn(e) {\n if (self.info.started) {\n movefn(e);\n }\n\n // remove the temporary listeners\n untrackDocument(self.info);\n };\n // add temporary document listeners as mouse retargets\n trackDocument(this.info, movefn, upfn);\n this.info.x = e.clientX;\n this.info.y = e.clientY;\n },\n /**\n * @this {GestureRecognizer}\n * @param {TouchEvent} e\n * @return {void}\n */\n touchstart: function(e) {\n let ct = e.changedTouches[0];\n this.info.x = ct.clientX;\n this.info.y = ct.clientY;\n },\n /**\n * @this {GestureRecognizer}\n * @param {TouchEvent} e\n * @return {void}\n */\n touchmove: function(e) {\n let t = _findOriginalTarget(e);\n let ct = e.changedTouches[0];\n let x = ct.clientX, y = ct.clientY;\n if (trackHasMovedEnough(this.info, x, y)) {\n if (this.info.state === 'start') {\n // if and only if tracking, always prevent tap\n prevent('tap');\n }\n this.info.addMove({x: x, y: y});\n trackFire(this.info, t, ct);\n this.info.state = 'track';\n this.info.started = true;\n }\n },\n /**\n * @this {GestureRecognizer}\n * @param {TouchEvent} e\n * @return {void}\n */\n touchend: function(e) {\n let t = _findOriginalTarget(e);\n let ct = e.changedTouches[0];\n // only trackend if track was started and not aborted\n if (this.info.started) {\n // reset started state on up\n this.info.state = 'end';\n this.info.addMove({x: ct.clientX, y: ct.clientY});\n trackFire(this.info, t, ct);\n }\n }\n});\n\n/**\n * @param {!GestureInfo} info\n * @param {number} x\n * @param {number} y\n * @return {boolean}\n */\nfunction trackHasMovedEnough(info, x, y) {\n if (info.prevent) {\n return false;\n }\n if (info.started) {\n return true;\n }\n let dx = Math.abs(info.x - x);\n let dy = Math.abs(info.y - y);\n return (dx >= TRACK_DISTANCE || dy >= TRACK_DISTANCE);\n}\n\n/**\n * @param {!GestureInfo} info\n * @param {?EventTarget} target\n * @param {Touch} touch\n * @return {void}\n */\nfunction trackFire(info, target, touch) {\n if (!target) {\n return;\n }\n let secondlast = info.moves[info.moves.length - 2];\n let lastmove = info.moves[info.moves.length - 1];\n let dx = lastmove.x - info.x;\n let dy = lastmove.y - info.y;\n let ddx, ddy = 0;\n if (secondlast) {\n ddx = lastmove.x - secondlast.x;\n ddy = lastmove.y - secondlast.y;\n }\n _fire(target, 'track', {\n state: info.state,\n x: touch.clientX,\n y: touch.clientY,\n dx: dx,\n dy: dy,\n ddx: ddx,\n ddy: ddy,\n sourceEvent: touch,\n hover: function() {\n return deepTargetFind(touch.clientX, touch.clientY);\n }\n });\n}\n\nregister({\n name: 'tap',\n deps: ['mousedown', 'click', 'touchstart', 'touchend'],\n flow: {\n start: ['mousedown', 'touchstart'],\n end: ['click', 'touchend']\n },\n emits: ['tap'],\n info: {\n x: NaN,\n y: NaN,\n prevent: false\n },\n /**\n * @this {GestureRecognizer}\n * @return {void}\n */\n reset: function() {\n this.info.x = NaN;\n this.info.y = NaN;\n this.info.prevent = false;\n },\n /**\n * @this {GestureRecognizer}\n * @param {MouseEvent} e\n * @return {void}\n */\n mousedown: function(e) {\n if (hasLeftMouseButton(e)) {\n this.info.x = e.clientX;\n this.info.y = e.clientY;\n }\n },\n /**\n * @this {GestureRecognizer}\n * @param {MouseEvent} e\n * @return {void}\n */\n click: function(e) {\n if (hasLeftMouseButton(e)) {\n trackForward(this.info, e);\n }\n },\n /**\n * @this {GestureRecognizer}\n * @param {TouchEvent} e\n * @return {void}\n */\n touchstart: function(e) {\n const touch = e.changedTouches[0];\n this.info.x = touch.clientX;\n this.info.y = touch.clientY;\n },\n /**\n * @this {GestureRecognizer}\n * @param {TouchEvent} e\n * @return {void}\n */\n touchend: function(e) {\n trackForward(this.info, e.changedTouches[0], e);\n }\n});\n\n/**\n * @param {!GestureInfo} info\n * @param {Event | Touch} e\n * @param {Event=} preventer\n * @return {void}\n */\nfunction trackForward(info, e, preventer) {\n let dx = Math.abs(e.clientX - info.x);\n let dy = Math.abs(e.clientY - info.y);\n // find original target from `preventer` for TouchEvents, or `e` for MouseEvents\n let t = _findOriginalTarget((preventer || e));\n if (!t || (canBeDisabled[/** @type {!HTMLElement} */(t).localName] && t.hasAttribute('disabled'))) {\n return;\n }\n // dx,dy can be NaN if `click` has been simulated and there was no `down` for `start`\n if (isNaN(dx) || isNaN(dy) || (dx <= TAP_DISTANCE && dy <= TAP_DISTANCE) || isSyntheticClick(e)) {\n // prevent taps from being generated if an event has canceled them\n if (!info.prevent) {\n _fire(t, 'tap', {\n x: e.clientX,\n y: e.clientY,\n sourceEvent: e,\n preventer: preventer\n });\n }\n }\n}\n\n/* eslint-enable valid-jsdoc */\n\n/** @deprecated */\nexport const findOriginalTarget = _findOriginalTarget;\n\n/** @deprecated */\nexport const add = addListener;\n\n/** @deprecated */\nexport const remove = removeListener;\n","var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __metadata = (this && this.__metadata) || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n};\nimport { WiredBase, customElement, property, html, css } from 'wired-lib/lib/wired-base';\nimport { line, svgNode, ellipse } from 'wired-lib';\nimport { addListener } from '@polymer/polymer/lib/utils/gestures.js';\nlet WiredSlider = class WiredSlider extends WiredBase {\n constructor() {\n super(...arguments);\n this._value = 0;\n this.min = 0;\n this.max = 100;\n this.knobradius = 10;\n this.disabled = false;\n this.step = 1;\n this.barWidth = 0;\n this.intermediateValue = this.min;\n this.pct = 0;\n this.startx = 0;\n this.dragging = false;\n }\n static get styles() {\n return css `\n :host {\n display: inline-block;\n position: relative;\n width: 300px;\n height: 40px;\n outline: none;\n box-sizing: border-box;\n opacity: 0;\n }\n\n :host(.wired-rendered) {\n opacity: 1;\n }\n \n :host(.wired-disabled) {\n opacity: 0.45 !important;\n cursor: default;\n pointer-events: none;\n background: rgba(0, 0, 0, 0.07);\n border-radius: 5px;\n }\n \n :host(.wired-disabled) .knob {\n pointer-events: none !important;\n }\n \n :host(:focus) .knob {\n cursor: move;\n stroke: var(--wired-slider-knob-outline-color, #000);\n fill-opacity: 0.8;\n }\n \n .overlay {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n pointer-events: none;\n }\n \n svg {\n display: block;\n }\n \n path {\n stroke-width: 0.7;\n fill: transparent;\n }\n \n .knob {\n pointer-events: auto;\n fill: var(--wired-slider-knob-zero-color, gray);\n stroke: var(--wired-slider-knob-zero-color, gray);\n transition: transform 0.15s ease;\n cursor: pointer;\n }\n \n .hasValue {\n fill: var(--wired-slider-knob-color, rgb(51, 103, 214));\n stroke: var(--wired-slider-knob-color, rgb(51, 103, 214));\n }\n \n .bar {\n stroke: var(--wired-slider-bar-color, rgb(0, 0, 0));\n }\n `;\n }\n render() {\n return html `\n <div class=\"overlay\">\n <svg id=\"svg\"></svg>\n </div>\n `;\n }\n get value() {\n return this._value;\n }\n set value(v) {\n this.setValue(v, true);\n }\n refreshDisabledState() {\n if (this.disabled) {\n this.classList.add('wired-disabled');\n }\n else {\n this.classList.remove('wired-disabled');\n }\n this.tabIndex = this.disabled ? -1 : +(this.getAttribute('tabindex') || 0);\n }\n firstUpdated() {\n const svg = this.shadowRoot.getElementById('svg');\n while (svg.hasChildNodes()) {\n svg.removeChild(svg.lastChild);\n }\n const s = this.getBoundingClientRect();\n svg.setAttribute('width', `${s.width}`);\n svg.setAttribute('height', `${s.height}`);\n const radius = this.knobradius || 10;\n this.barWidth = s.width - (2 * radius);\n this.bar = line(svg, radius, s.height / 2, s.width - radius, s.height / 2);\n this.bar.classList.add('bar');\n this.knobGroup = svgNode('g');\n svg.appendChild(this.knobGroup);\n this.knob = ellipse(this.knobGroup, radius, s.height / 2, radius * 2, radius * 2);\n this.knob.classList.add('knob');\n this.onValueChange();\n this.classList.add('wired-rendered');\n // aria\n this.setAttribute('role', 'slider');\n this.setAttribute('aria-valuemax', `${this.max}`);\n this.setAttribute('aria-valuemin', `${this.min}`);\n this.setAriaValue();\n // attach events\n addListener(this.knob, 'down', (event) => {\n if (!this.disabled) {\n this.knobdown(event);\n }\n });\n addListener(this.knob, 'up', () => {\n if (!this.disabled) {\n this.resetKnob();\n }\n });\n addListener(this.knob, 'track', (event) => {\n if (!this.disabled) {\n this.onTrack(event);\n }\n });\n this.addEventListener('keydown', (event) => {\n switch (event.keyCode) {\n case 38:\n case 39:\n this.incremenent();\n break;\n case 37:\n case 40:\n this.decrement();\n break;\n case 36:\n this.setValue(this.min);\n break;\n case 35:\n this.setValue(this.max);\n break;\n }\n });\n }\n updated(changed) {\n if (changed.has('disabled')) {\n this.refreshDisabledState();\n }\n }\n setAriaValue() {\n this.setAttribute('aria-valuenow', `${this.value}`);\n }\n setValue(v, skipEvent = false) {\n this._value = v;\n this.setAriaValue();\n this.onValueChange();\n if (!skipEvent) {\n this.fireEvent('change', { value: this.intermediateValue });\n }\n }\n incremenent() {\n const newValue = Math.min(this.max, Math.round(this.value + this.step));\n if (newValue !== this.value) {\n this.setValue(newValue);\n }\n }\n decrement() {\n const newValue = Math.max(this.min, Math.round(this.value - this.step));\n if (newValue !== this.value) {\n this.setValue(newValue);\n }\n }\n onValueChange() {\n if (!this.knob) {\n return;\n }\n let pct = 0;\n if (this.max > this.min) {\n pct = Math.min(1, Math.max((this.value - this.min) / (this.max - this.min), 0));\n }\n this.pct = pct;\n if (pct) {\n this.knob.classList.add('hasValue');\n }\n else {\n this.knob.classList.remove('hasValue');\n }\n const knobOffset = pct * this.barWidth;\n this.knobGroup.style.transform = `translateX(${Math.round(knobOffset)}px)`;\n }\n knobdown(event) {\n this.knobExpand(true);\n event.preventDefault();\n this.focus();\n }\n resetKnob() {\n this.knobExpand(false);\n }\n knobExpand(value) {\n if (this.knob) {\n if (value) {\n this.knob.classList.add('expanded');\n }\n else {\n this.knob.classList.remove('expanded');\n }\n }\n }\n onTrack(event) {\n event.stopPropagation();\n switch (event.detail.state) {\n case 'start':\n this.trackStart();\n break;\n case 'track':\n this.trackX(event);\n break;\n case 'end':\n this.trackEnd();\n break;\n }\n }\n trackStart() {\n this.intermediateValue = this.value;\n this.startx = this.pct * this.barWidth;\n this.dragging = true;\n }\n trackX(event) {\n if (!this.dragging) {\n this.trackStart();\n }\n const dx = event.detail.dx || 0;\n const newX = Math.max(Math.min(this.startx + dx, this.barWidth), 0);\n this.knobGroup.style.transform = `translateX(${Math.round(newX)}px)`;\n const newPct = newX / this.barWidth;\n this.intermediateValue = this.min + newPct * (this.max - this.min);\n }\n trackEnd() {\n this.dragging = false;\n this.resetKnob();\n this.setValue(this.intermediateValue);\n this.pct = (this.value - this.min) / (this.max - this.min);\n }\n};\n__decorate([\n property({ type: Number }),\n __metadata(\"design:type\", Object)\n], WiredSlider.prototype, \"_value\", void 0);\n__decorate([\n property({ type: Number }),\n __metadata(\"design:type\", Object)\n], WiredSlider.prototype, \"min\", void 0);\n__decorate([\n property({ type: Number }),\n __metadata(\"design:type\", Object)\n], WiredSlider.prototype, \"max\", void 0);\n__decorate([\n property({ type: Number }),\n __metadata(\"design:type\", Object)\n], WiredSlider.prototype, \"knobradius\", void 0);\n__decorate([\n property({ type: Boolean, reflect: true }),\n __metadata(\"design:type\", Object)\n], WiredSlider.prototype, \"disabled\", void 0);\nWiredSlider = __decorate([\n customElement('wired-slider')\n], WiredSlider);\nexport { WiredSlider };\n","var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __metadata = (this && this.__metadata) || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n};\nimport { WiredBase, customElement, property, html, css } from 'wired-lib/lib/wired-base';\nimport { rectangle } from 'wired-lib';\nlet WiredTextarea = class WiredTextarea extends WiredBase {\n constructor() {\n super(...arguments);\n this.rows = 1;\n this.maxrows = 0;\n this.autocomplete = '';\n this.autofocus = false;\n this.disabled = false;\n this.inputmode = '';\n this.placeholder = '';\n this.required = false;\n this.readonly = false;\n this.tokens = [];\n this.prevHeight = 0;\n }\n static get styles() {\n return css `\n :host {\n display: inline-block;\n position: relative;\n font-family: sans-serif;\n width: 400px;\n outline: none;\n opacity: 0;\n }\n\n :host(.wired-rendered) {\n opacity: 1;\n }\n \n :host(.wired-disabled) {\n opacity: 0.6 !important;\n cursor: default;\n pointer-events: none;\n }\n \n :host(.wired-disabled) svg {\n background: rgba(0, 0, 0, 0.07);\n }\n \n .fit {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n }\n \n .overlay {\n pointer-events: none;\n }\n \n svg {\n display: block;\n }\n \n path {\n stroke: currentColor;\n stroke-width: 0.7;\n fill: transparent;\n }\n \n .mirror-text {\n visibility: hidden;\n word-wrap: break-word;\n }\n\n #mirror {\n padding: 10px;\n }\n \n textarea {\n position: relative;\n outline: none;\n border: none;\n resize: none;\n background: inherit;\n color: inherit;\n width: 100%;\n height: 100%;\n font-size: inherit;\n font-family: inherit;\n line-height: inherit;\n text-align: inherit;\n padding: 10px;\n box-sizing: border-box;\n }\n `;\n }\n render() {\n return html `\n <div id=\"mirror\" class=\"mirror-text\">&#160;</div>\n <div class=\"fit\">\n <textarea id=\"textarea\" autocomplete=\"${this.autocomplete}\" ?autofocus=\"${this.autofocus}\" inputmode=\"${this.inputmode}\"\n placeholder=\"${this.placeholder}\" ?readonly=\"${this.readonly}\" ?required=\"${this.required}\" ?disabled=\"${this.disabled}\"\n rows=\"${this.rows}\" minlength=\"${this.minlength}\" maxlength=\"${this.maxlength}\" @input=\"${this.onInput}\"></textarea>\n </div>\n <div class=\"fit overlay\">\n <svg id=\"svg\"></svg>\n </div>\n `;\n }\n createRenderRoot() {\n return this.attachShadow({ mode: 'open', delegatesFocus: true });\n }\n get textarea() {\n if (this.shadowRoot) {\n return this.shadowRoot.getElementById('textarea');\n }\n return null;\n }\n get mirror() {\n return this.shadowRoot.getElementById('mirror');\n }\n get value() {\n const input = this.textarea;\n return (input && input.value) || '';\n }\n set value(v) {\n const textarea = this.textarea;\n if (!textarea) {\n return;\n }\n if (textarea.value !== v) {\n textarea.value = v || '';\n }\n this.mirror.innerHTML = this.valueForMirror();\n this.requestUpdate();\n }\n valueForMirror() {\n const input = this.textarea;\n if (!input) {\n return '';\n }\n this.tokens = (input && input.value) ? input.value.replace(/&/gm, '&amp;').replace(/\"/gm, '&quot;').replace(/'/gm, '&#39;').replace(/</gm, '&lt;').replace(/>/gm, '&gt;').split('\\n') : [''];\n return this.constrain(this.tokens);\n }\n constrain(tokens) {\n let _tokens;\n tokens = tokens || [''];\n if (this.maxrows > 0 && tokens.length > this.maxrows) {\n _tokens = tokens.slice(0, this.maxrows);\n }\n else {\n _tokens = tokens.slice(0);\n }\n while (this.rows > 0 && _tokens.length < this.rows) {\n _tokens.push('');\n }\n return _tokens.join('<br/>') + '&#160;';\n }\n refreshDisabledState() {\n if (this.disabled) {\n this.classList.add('wired-disabled');\n }\n else {\n this.classList.remove('wired-disabled');\n }\n }\n firstUpdated() {\n this.value = this.value || this.getAttribute('value') || '';\n }\n updated(changed) {\n if (changed.has('disabled')) {\n this.refreshDisabledState();\n }\n const svg = this.shadowRoot.getElementById('svg');\n const s = this.getBoundingClientRect();\n if (this.prevHeight !== s.height) {\n while (svg.hasChildNodes()) {\n svg.removeChild(svg.lastChild);\n }\n svg.setAttribute('width', `${s.width}`);\n svg.setAttribute('height', `${s.height}`);\n rectangle(svg, 2, 2, s.width - 2, s.height - 2);\n this.prevHeight = s.height;\n this.classList.add('wired-rendered');\n this.updateCached();\n }\n }\n updateCached() {\n this.mirror.innerHTML = this.constrain(this.tokens);\n }\n onInput() {\n this.value = this.textarea.value;\n }\n};\n__decorate([\n property({ type: Number }),\n __metadata(\"design:type\", Object)\n], WiredTextarea.prototype, \"rows\", void 0);\n__decorate([\n property({ type: Number }),\n __metadata(\"design:type\", Object)\n], WiredTextarea.prototype, \"maxrows\", void 0);\n__decorate([\n property({ type: String }),\n __metadata(\"design:type\", Object)\n], WiredTextarea.prototype, \"autocomplete\", void 0);\n__decorate([\n property({ type: Boolean }),\n __metadata(\"design:type\", Object)\n], WiredTextarea.prototype, \"autofocus\", void 0);\n__decorate([\n property({ type: Boolean, reflect: true }),\n __metadata(\"design:type\", Object)\n], WiredTextarea.prototype, \"disabled\", void 0);\n__decorate([\n property({ type: String }),\n __metadata(\"design:type\", Object)\n], WiredTextarea.prototype, \"inputmode\", void 0);\n__decorate([\n property({ type: String }),\n __metadata(\"design:type\", Object)\n], WiredTextarea.prototype, \"placeholder\", void 0);\n__decorate([\n property({ type: Boolean }),\n __metadata(\"design:type\", Object)\n], WiredTextarea.prototype, \"required\", void 0);\n__decorate([\n property({ type: Boolean }),\n __metadata(\"design:type\", Object)\n], WiredTextarea.prototype, \"readonly\", void 0);\n__decorate([\n property({ type: Number }),\n __metadata(\"design:type\", Number)\n], WiredTextarea.prototype, \"minlength\", void 0);\n__decorate([\n property({ type: Number }),\n __metadata(\"design:type\", Number)\n], WiredTextarea.prototype, \"maxlength\", void 0);\nWiredTextarea = __decorate([\n customElement('wired-textarea')\n], WiredTextarea);\nexport { WiredTextarea };\n","var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __metadata = (this && this.__metadata) || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n};\nimport { WiredBase, customElement, property, html, css } from 'wired-lib/lib/wired-base';\nimport { rectangle, ellipse, hachureEllipseFill, svgNode } from 'wired-lib';\nlet WiredToggle = class WiredToggle extends WiredBase {\n constructor() {\n super(...arguments);\n this.checked = false;\n this.disabled = false;\n }\n static get styles() {\n return css `\n :host {\n display: inline-block;\n cursor: pointer;\n position: relative;\n outline: none;\n opacity: 0;\n }\n\n :host(.wired-rendered) {\n opacity: 1;\n }\n \n :host(.wired-disabled) {\n opacity: 0.4 !important;\n cursor: default;\n pointer-events: none;\n }\n \n :host(.wired-disabled) svg {\n background: rgba(0, 0, 0, 0.07);\n }\n\n :host(:focus) path {\n stroke-width: 1.2;\n }\n\n svg {\n display: block;\n }\n \n path {\n stroke: currentColor;\n stroke-width: 0.7;\n fill: transparent;\n }\n\n .knob {\n transition: transform 0.3s ease;\n }\n .knob path {\n stroke-width: 0.7;\n }\n .knob.checked {\n transform: translateX(48px);\n }\n .knobfill path {\n stroke-width: 3 !important;\n fill: transparent;\n }\n .knob.unchecked .knobfill path {\n stroke: var(--wired-toggle-off-color, gray);\n }\n .knob.checked .knobfill path {\n stroke: var(--wired-toggle-on-color, rgb(63, 81, 181));\n }\n `;\n }\n render() {\n return html `\n <div @click=\"${this.toggleCheck}\">\n <svg id=\"svg\"></svg>\n </div>\n `;\n }\n refreshDisabledState() {\n if (this.disabled) {\n this.classList.add('wired-disabled');\n }\n else {\n this.classList.remove('wired-disabled');\n }\n this.tabIndex = this.disabled ? -1 : +(this.getAttribute('tabindex') || 0);\n }\n toggleCheck() {\n this.checked = !(this.checked || false);\n this.fireEvent('change', { checked: this.checked });\n }\n firstUpdated() {\n this.setAttribute('role', 'switch');\n this.addEventListener('keydown', (event) => {\n if ((event.keyCode === 13) || (event.keyCode === 32)) {\n event.preventDefault();\n this.toggleCheck();\n }\n });\n const svg = this.shadowRoot.getElementById('svg');\n while (svg.hasChildNodes()) {\n svg.removeChild(svg.lastChild);\n }\n const s = { width: 80, height: 34 };\n svg.setAttribute('width', `${s.width}`);\n svg.setAttribute('height', `${s.height}`);\n rectangle(svg, 16, 8, s.width - 32, 18);\n this.knob = svgNode('g');\n this.knob.classList.add('knob');\n svg.appendChild(this.knob);\n const knobFill = hachureEllipseFill(16, 16, 32, 32);\n knobFill.classList.add('knobfill');\n this.knob.appendChild(knobFill);\n ellipse(this.knob, 16, 16, 32, 32);\n this.classList.add('wired-rendered');\n }\n updated(changed) {\n if (changed.has('disabled')) {\n this.refreshDisabledState();\n }\n if (this.knob) {\n const cl = this.knob.classList;\n if (this.checked) {\n cl.remove('unchecked');\n cl.add('checked');\n }\n else {\n cl.remove('checked');\n cl.add('unchecked');\n }\n }\n this.setAttribute('aria-checked', `${this.checked}`);\n }\n};\n__decorate([\n property({ type: Boolean }),\n __metadata(\"design:type\", Object)\n], WiredToggle.prototype, \"checked\", void 0);\n__decorate([\n property({ type: Boolean, reflect: true }),\n __metadata(\"design:type\", Object)\n], WiredToggle.prototype, \"disabled\", void 0);\nWiredToggle = __decorate([\n customElement('wired-toggle')\n], WiredToggle);\nexport { WiredToggle };\n","var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __metadata = (this && this.__metadata) || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n};\nimport { WiredBase, customElement, property, html, css } from 'wired-lib/lib/wired-base';\nimport { polygon } from 'wired-lib';\nlet WiredTooltip = class WiredTooltip extends WiredBase {\n constructor() {\n super(...arguments);\n this.offset = 14;\n this.position = 'bottom';\n this.dirty = false;\n this.showing = false;\n this._target = null;\n this.showHandler = this.show.bind(this);\n this.hideHandler = this.hide.bind(this);\n }\n static get styles() {\n return css `\n :host {\n display: block;\n position: absolute;\n outline: none;\n z-index: 1002;\n -moz-user-select: none;\n -ms-user-select: none;\n -webkit-user-select: none;\n user-select: none;\n cursor: default;\n font-family: inherit;\n font-size: 9pt;\n line-height: 1;\n }\n \n .overlay {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n pointer-events: none;\n }\n \n svg {\n display: block;\n }\n \n path {\n stroke-width: 0.7;\n stroke: var(--wired-tooltip-border-color, currentColor);\n fill: var(--wired-tooltip-background, rgba(255, 255, 255, 0.9));\n }\n \n #container {\n position: relative;\n padding: 8px;\n }\n `;\n }\n render() {\n return html `\n <div id=\"container\" style=\"display: none;\">\n <div class=\"overlay\">\n <svg id=\"svg\"></svg>\n </div>\n <span style=\"position: relative;\">${this.text}</span>\n </div>\n `;\n }\n get target() {\n if (this._target) {\n return this._target;\n }\n const parent = this.parentNode;\n const owner = ((this.getRootNode ? this.getRootNode() : null) || document);\n let t = null;\n if (this.for) {\n t = owner.querySelector('#' + this.for);\n }\n else if (parent) {\n t = parent.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? owner.host : parent;\n }\n return t;\n }\n detachListeners() {\n if (this._target) {\n this._target.removeEventListener('mouseenter', this.showHandler);\n this._target.removeEventListener('focus', this.showHandler);\n this._target.removeEventListener('mouseleave', this.hideHandler);\n this._target.removeEventListener('blur', this.hideHandler);\n this._target.removeEventListener('click', this.hideHandler);\n }\n this.removeEventListener('mouseenter', this.hideHandler);\n }\n attachListeners() {\n if (this._target) {\n this._target.addEventListener('mouseenter', this.showHandler);\n this._target.addEventListener('focus', this.showHandler);\n this._target.addEventListener('mouseleave', this.hideHandler);\n this._target.addEventListener('blur', this.hideHandler);\n this._target.addEventListener('click', this.hideHandler);\n }\n this.addEventListener('mouseenter', this.hideHandler);\n }\n refreshTarget() {\n this.detachListeners();\n this._target = null;\n this._target = this.target;\n this.attachListeners();\n this.dirty = true;\n }\n layout() {\n const svg = this.shadowRoot.getElementById('svg');\n while (svg.hasChildNodes()) {\n svg.removeChild(svg.lastChild);\n }\n const s = this.getBoundingClientRect();\n let w = s.width;\n let h = s.height;\n switch (this.position) {\n case 'left':\n case 'right':\n w = w + this.offset;\n break;\n default:\n h = h + this.offset;\n break;\n }\n svg.setAttribute('width', `${w}`);\n svg.setAttribute('height', `${h}`);\n let points = [];\n switch (this.position) {\n case 'top':\n points = [\n [2, 2], [w - 2, 2], [w - 2, h - this.offset],\n [w / 2 + 8, h - this.offset], [w / 2, h - this.offset + 8], [w / 2 - 8, h - this.offset],\n [0, h - this.offset]\n ];\n break;\n case 'left':\n points = [\n [2, 2], [w - this.offset, 2],\n [w - this.offset, h / 2 - 8], [w - this.offset + 8, h / 2], [w - this.offset, h / 2 + 8],\n [w - this.offset, h], [2, h - 2]\n ];\n break;\n case 'right':\n points = [\n [this.offset, 2], [w - 2, 2], [w - 2, h - 2], [this.offset, h - 2],\n [this.offset, h / 2 + 8], [this.offset - 8, h / 2], [this.offset, h / 2 - 8]\n ];\n svg.style.transform = `translateX(${-this.offset}px)`;\n break;\n default:\n points = [\n [2, this.offset], [0, h - 2], [w - 2, h - 2], [w - 2, this.offset],\n [w / 2 + 8, this.offset], [w / 2, this.offset - 8], [w / 2 - 8, this.offset]\n ];\n svg.style.transform = `translateY(${-this.offset}px)`;\n break;\n }\n polygon(svg, points);\n this.dirty = false;\n }\n firstUpdated() {\n this.layout();\n }\n updated(changedProps) {\n if (changedProps.has('position') || changedProps.has('text')) {\n this.dirty = true;\n }\n if ((!this._target) || changedProps.has('for')) {\n this.refreshTarget();\n }\n if (this.dirty) {\n this.layout();\n }\n }\n show() {\n if (this.showing) {\n return;\n }\n this.showing = true;\n this.shadowRoot.getElementById('container').style.display = '';\n this.updatePosition();\n setTimeout(() => {\n this.layout();\n }, 1);\n }\n hide() {\n if (!this.showing) {\n return;\n }\n this.showing = false;\n this.shadowRoot.getElementById('container').style.display = 'none';\n }\n updatePosition() {\n if (!this._target || !this.offsetParent) {\n return;\n }\n const offset = this.offset;\n const parentRect = this.offsetParent.getBoundingClientRect();\n const targetRect = this._target.getBoundingClientRect();\n const tipRect = this.getBoundingClientRect();\n const horizontalCenterOffset = (targetRect.width - tipRect.width) / 2;\n const verticalCenterOffset = (targetRect.height - tipRect.height) / 2;\n const targetLeft = targetRect.left - parentRect.left;\n const targetTop = targetRect.top - parentRect.top;\n let tooltipLeft, tooltipTop;\n switch (this.position) {\n case 'top':\n tooltipLeft = targetLeft + horizontalCenterOffset;\n tooltipTop = targetTop - tipRect.height - offset;\n break;\n case 'bottom':\n tooltipLeft = targetLeft + horizontalCenterOffset;\n tooltipTop = targetTop + targetRect.height + offset;\n break;\n case 'left':\n tooltipLeft = targetLeft - tipRect.width - offset;\n tooltipTop = targetTop + verticalCenterOffset;\n break;\n case 'right':\n tooltipLeft = targetLeft + targetRect.width + offset;\n tooltipTop = targetTop + verticalCenterOffset;\n break;\n }\n this.style.left = tooltipLeft + 'px';\n this.style.top = tooltipTop + 'px';\n }\n};\n__decorate([\n property({ type: String }),\n __metadata(\"design:type\", String)\n], WiredTooltip.prototype, \"for\", void 0);\n__decorate([\n property({ type: String }),\n __metadata(\"design:type\", String)\n], WiredTooltip.prototype, \"text\", void 0);\n__decorate([\n property({ type: Number }),\n __metadata(\"design:type\", Object)\n], WiredTooltip.prototype, \"offset\", void 0);\n__decorate([\n property({ type: String }),\n __metadata(\"design:type\", String)\n], WiredTooltip.prototype, \"position\", void 0);\nWiredTooltip = __decorate([\n customElement('wired-tooltip')\n], WiredTooltip);\nexport { WiredTooltip };\n","/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\nimport { createMarker, directive, NodePart, removeNodes, reparentNodes } from '../lit-html.js';\n// Helper functions for manipulating parts\n// TODO(kschaaf): Refactor into Part API?\nconst createAndInsertPart = (containerPart, beforePart) => {\n const container = containerPart.startNode.parentNode;\n const beforeNode = beforePart === undefined ? containerPart.endNode :\n beforePart.startNode;\n const startNode = container.insertBefore(createMarker(), beforeNode);\n container.insertBefore(createMarker(), beforeNode);\n const newPart = new NodePart(containerPart.options);\n newPart.insertAfterNode(startNode);\n return newPart;\n};\nconst updatePart = (part, value) => {\n part.setValue(value);\n part.commit();\n return part;\n};\nconst insertPartBefore = (containerPart, part, ref) => {\n const container = containerPart.startNode.parentNode;\n const beforeNode = ref ? ref.startNode : containerPart.endNode;\n const endNode = part.endNode.nextSibling;\n if (endNode !== beforeNode) {\n reparentNodes(container, part.startNode, endNode, beforeNode);\n }\n};\nconst removePart = (part) => {\n removeNodes(part.startNode.parentNode, part.startNode, part.endNode.nextSibling);\n};\n// Helper for generating a map of array item to its index over a subset\n// of an array (used to lazily generate `newKeyToIndexMap` and\n// `oldKeyToIndexMap`)\nconst generateMap = (list, start, end) => {\n const map = new Map();\n for (let i = start; i <= end; i++) {\n map.set(list[i], i);\n }\n return map;\n};\n// Stores previous ordered list of parts and map of key to index\nconst partListCache = new WeakMap();\nconst keyListCache = new WeakMap();\n/**\n * A directive that repeats a series of values (usually `TemplateResults`)\n * generated from an iterable, and updates those items efficiently when the\n * iterable changes based on user-provided `keys` associated with each item.\n *\n * Note that if a `keyFn` is provided, strict key-to-DOM mapping is maintained,\n * meaning previous DOM for a given key is moved into the new position if\n * needed, and DOM will never be reused with values for different keys (new DOM\n * will always be created for new keys). This is generally the most efficient\n * way to use `repeat` since it performs minimum unnecessary work for insertions\n * amd removals.\n *\n * IMPORTANT: If providing a `keyFn`, keys *must* be unique for all items in a\n * given call to `repeat`. The behavior when two or more items have the same key\n * is undefined.\n *\n * If no `keyFn` is provided, this directive will perform similar to mapping\n * items to values, and DOM will be reused against potentially different items.\n */\nexport const repeat = directive((items, keyFnOrTemplate, template) => {\n let keyFn;\n if (template === undefined) {\n template = keyFnOrTemplate;\n }\n else if (keyFnOrTemplate !== undefined) {\n keyFn = keyFnOrTemplate;\n }\n return (containerPart) => {\n if (!(containerPart instanceof NodePart)) {\n throw new Error('repeat can only be used in text bindings');\n }\n // Old part & key lists are retrieved from the last update\n // (associated with the part for this instance of the directive)\n const oldParts = partListCache.get(containerPart) || [];\n const oldKeys = keyListCache.get(containerPart) || [];\n // New part list will be built up as we go (either reused from\n // old parts or created for new keys in this update). This is\n // saved in the above cache at the end of the update.\n const newParts = [];\n // New value list is eagerly generated from items along with a\n // parallel array indicating its key.\n const newValues = [];\n const newKeys = [];\n let index = 0;\n for (const item of items) {\n newKeys[index] = keyFn ? keyFn(item, index) : index;\n newValues[index] = template(item, index);\n index++;\n }\n // Maps from key to index for current and previous update; these\n // are generated lazily only when needed as a performance\n // optimization, since they are only required for multiple\n // non-contiguous changes in the list, which are less common.\n let newKeyToIndexMap;\n let oldKeyToIndexMap;\n // Head and tail pointers to old parts and new values\n let oldHead = 0;\n let oldTail = oldParts.length - 1;\n let newHead = 0;\n let newTail = newValues.length - 1;\n // Overview of O(n) reconciliation algorithm (general approach\n // based on ideas found in ivi, vue, snabbdom, etc.):\n //\n // * We start with the list of old parts and new values (and\n // arrays of\n // their respective keys), head/tail pointers into each, and\n // we build up the new list of parts by updating (and when\n // needed, moving) old parts or creating new ones. The initial\n // scenario might look like this (for brevity of the diagrams,\n // the numbers in the array reflect keys associated with the\n // old parts or new values, although keys and parts/values are\n // actually stored in parallel arrays indexed using the same\n // head/tail pointers):\n //\n // oldHead v v oldTail\n // oldKeys: [0, 1, 2, 3, 4, 5, 6]\n // newParts: [ , , , , , , ]\n // newKeys: [0, 2, 1, 4, 3, 7, 6] <- reflects the user's new\n // item order\n // newHead ^ ^ newTail\n //\n // * Iterate old & new lists from both sides, updating,\n // swapping, or\n // removing parts at the head/tail locations until neither\n // head nor tail can move.\n //\n // * Example below: keys at head pointers match, so update old\n // part 0 in-\n // place (no need to move it) and record part 0 in the\n // `newParts` list. The last thing we do is advance the\n // `oldHead` and `newHead` pointers (will be reflected in the\n // next diagram).\n //\n // oldHead v v oldTail\n // oldKeys: [0, 1, 2, 3, 4, 5, 6]\n // newParts: [0, , , , , , ] <- heads matched: update 0\n // and newKeys: [0, 2, 1, 4, 3, 7, 6] advance both oldHead\n // & newHead\n // newHead ^ ^ newTail\n //\n // * Example below: head pointers don't match, but tail pointers\n // do, so\n // update part 6 in place (no need to move it), and record\n // part 6 in the `newParts` list. Last, advance the `oldTail`\n // and `oldHead` pointers.\n //\n // oldHead v v oldTail\n // oldKeys: [0, 1, 2, 3, 4, 5, 6]\n // newParts: [0, , , , , , 6] <- tails matched: update 6\n // and newKeys: [0, 2, 1, 4, 3, 7, 6] advance both oldTail\n // & newTail\n // newHead ^ ^ newTail\n //\n // * If neither head nor tail match; next check if one of the\n // old head/tail\n // items was removed. We first need to generate the reverse\n // map of new keys to index (`newKeyToIndexMap`), which is\n // done once lazily as a performance optimization, since we\n // only hit this case if multiple non-contiguous changes were\n // made. Note that for contiguous removal anywhere in the\n // list, the head and tails would advance from either end and\n // pass each other before we get to this case and removals\n // would be handled in the final while loop without needing to\n // generate the map.\n //\n // * Example below: The key at `oldTail` was removed (no longer\n // in the\n // `newKeyToIndexMap`), so remove that part from the DOM and\n // advance just the `oldTail` pointer.\n //\n // oldHead v v oldTail\n // oldKeys: [0, 1, 2, 3, 4, 5, 6]\n // newParts: [0, , , , , , 6] <- 5 not in new map; remove\n // 5 and newKeys: [0, 2, 1, 4, 3, 7, 6] advance oldTail\n // newHead ^ ^ newTail\n //\n // * Once head and tail cannot move, any mismatches are due to\n // either new or\n // moved items; if a new key is in the previous \"old key to\n // old index\" map, move the old part to the new location,\n // otherwise create and insert a new part. Note that when\n // moving an old part we null its position in the oldParts\n // array if it lies between the head and tail so we know to\n // skip it when the pointers get there.\n //\n // * Example below: neither head nor tail match, and neither\n // were removed;\n // so find the `newHead` key in the `oldKeyToIndexMap`, and\n // move that old part's DOM into the next head position\n // (before `oldParts[oldHead]`). Last, null the part in the\n // `oldPart` array since it was somewhere in the remaining\n // oldParts still to be scanned (between the head and tail\n // pointers) so that we know to skip that old part on future\n // iterations.\n //\n // oldHead v v oldTail\n // oldKeys: [0, 1, -, 3, 4, 5, 6]\n // newParts: [0, 2, , , , , 6] <- stuck; update & move 2\n // into place newKeys: [0, 2, 1, 4, 3, 7, 6] and advance\n // newHead\n // newHead ^ ^ newTail\n //\n // * Note that for moves/insertions like the one above, a part\n // inserted at\n // the head pointer is inserted before the current\n // `oldParts[oldHead]`, and a part inserted at the tail\n // pointer is inserted before `newParts[newTail+1]`. The\n // seeming asymmetry lies in the fact that new parts are moved\n // into place outside in, so to the right of the head pointer\n // are old parts, and to the right of the tail pointer are new\n // parts.\n //\n // * We always restart back from the top of the algorithm,\n // allowing matching\n // and simple updates in place to continue...\n //\n // * Example below: the head pointers once again match, so\n // simply update\n // part 1 and record it in the `newParts` array. Last,\n // advance both head pointers.\n //\n // oldHead v v oldTail\n // oldKeys: [0, 1, -, 3, 4, 5, 6]\n // newParts: [0, 2, 1, , , , 6] <- heads matched; update 1\n // and newKeys: [0, 2, 1, 4, 3, 7, 6] advance both oldHead\n // & newHead\n // newHead ^ ^ newTail\n //\n // * As mentioned above, items that were moved as a result of\n // being stuck\n // (the final else clause in the code below) are marked with\n // null, so we always advance old pointers over these so we're\n // comparing the next actual old value on either end.\n //\n // * Example below: `oldHead` is null (already placed in\n // newParts), so\n // advance `oldHead`.\n //\n // oldHead v v oldTail\n // oldKeys: [0, 1, -, 3, 4, 5, 6] // old head already used;\n // advance newParts: [0, 2, 1, , , , 6] // oldHead newKeys:\n // [0, 2, 1, 4, 3, 7, 6]\n // newHead ^ ^ newTail\n //\n // * Note it's not critical to mark old parts as null when they\n // are moved\n // from head to tail or tail to head, since they will be\n // outside the pointer range and never visited again.\n //\n // * Example below: Here the old tail key matches the new head\n // key, so\n // the part at the `oldTail` position and move its DOM to the\n // new head position (before `oldParts[oldHead]`). Last,\n // advance `oldTail` and `newHead` pointers.\n //\n // oldHead v v oldTail\n // oldKeys: [0, 1, -, 3, 4, 5, 6]\n // newParts: [0, 2, 1, 4, , , 6] <- old tail matches new\n // head: update newKeys: [0, 2, 1, 4, 3, 7, 6] & move 4,\n // advance oldTail & newHead\n // newHead ^ ^ newTail\n //\n // * Example below: Old and new head keys match, so update the\n // old head\n // part in place, and advance the `oldHead` and `newHead`\n // pointers.\n //\n // oldHead v oldTail\n // oldKeys: [0, 1, -, 3, 4, 5, 6]\n // newParts: [0, 2, 1, 4, 3, ,6] <- heads match: update 3\n // and advance newKeys: [0, 2, 1, 4, 3, 7, 6] oldHead &\n // newHead\n // newHead ^ ^ newTail\n //\n // * Once the new or old pointers move past each other then all\n // we have\n // left is additions (if old list exhausted) or removals (if\n // new list exhausted). Those are handled in the final while\n // loops at the end.\n //\n // * Example below: `oldHead` exceeded `oldTail`, so we're done\n // with the\n // main loop. Create the remaining part and insert it at the\n // new head position, and the update is complete.\n //\n // (oldHead > oldTail)\n // oldKeys: [0, 1, -, 3, 4, 5, 6]\n // newParts: [0, 2, 1, 4, 3, 7 ,6] <- create and insert 7\n // newKeys: [0, 2, 1, 4, 3, 7, 6]\n // newHead ^ newTail\n //\n // * Note that the order of the if/else clauses is not important\n // to the\n // algorithm, as long as the null checks come first (to ensure\n // we're always working on valid old parts) and that the final\n // else clause comes last (since that's where the expensive\n // moves occur). The order of remaining clauses is is just a\n // simple guess at which cases will be most common.\n //\n // * TODO(kschaaf) Note, we could calculate the longest\n // increasing\n // subsequence (LIS) of old items in new position, and only\n // move those not in the LIS set. However that costs O(nlogn)\n // time and adds a bit more code, and only helps make rare\n // types of mutations require fewer moves. The above handles\n // removes, adds, reversal, swaps, and single moves of\n // contiguous items in linear time, in the minimum number of\n // moves. As the number of multiple moves where LIS might help\n // approaches a random shuffle, the LIS optimization becomes\n // less helpful, so it seems not worth the code at this point.\n // Could reconsider if a compelling case arises.\n while (oldHead <= oldTail && newHead <= newTail) {\n if (oldParts[oldHead] === null) {\n // `null` means old part at head has already been used\n // below; skip\n oldHead++;\n }\n else if (oldParts[oldTail] === null) {\n // `null` means old part at tail has already been used\n // below; skip\n oldTail--;\n }\n else if (oldKeys[oldHead] === newKeys[newHead]) {\n // Old head matches new head; update in place\n newParts[newHead] =\n updatePart(oldParts[oldHead], newValues[newHead]);\n oldHead++;\n newHead++;\n }\n else if (oldKeys[oldTail] === newKeys[newTail]) {\n // Old tail matches new tail; update in place\n newParts[newTail] =\n updatePart(oldParts[oldTail], newValues[newTail]);\n oldTail--;\n newTail--;\n }\n else if (oldKeys[oldHead] === newKeys[newTail]) {\n // Old head matches new tail; update and move to new tail\n newParts[newTail] =\n updatePart(oldParts[oldHead], newValues[newTail]);\n insertPartBefore(containerPart, oldParts[oldHead], newParts[newTail + 1]);\n oldHead++;\n newTail--;\n }\n else if (oldKeys[oldTail] === newKeys[newHead]) {\n // Old tail matches new head; update and move to new head\n newParts[newHead] =\n updatePart(oldParts[oldTail], newValues[newHead]);\n insertPartBefore(containerPart, oldParts[oldTail], oldParts[oldHead]);\n oldTail--;\n newHead++;\n }\n else {\n if (newKeyToIndexMap === undefined) {\n // Lazily generate key-to-index maps, used for removals &\n // moves below\n newKeyToIndexMap = generateMap(newKeys, newHead, newTail);\n oldKeyToIndexMap = generateMap(oldKeys, oldHead, oldTail);\n }\n if (!newKeyToIndexMap.has(oldKeys[oldHead])) {\n // Old head is no longer in new list; remove\n removePart(oldParts[oldHead]);\n oldHead++;\n }\n else if (!newKeyToIndexMap.has(oldKeys[oldTail])) {\n // Old tail is no longer in new list; remove\n removePart(oldParts[oldTail]);\n oldTail--;\n }\n else {\n // Any mismatches at this point are due to additions or\n // moves; see if we have an old part we can reuse and move\n // into place\n const oldIndex = oldKeyToIndexMap.get(newKeys[newHead]);\n const oldPart = oldIndex !== undefined ? oldParts[oldIndex] : null;\n if (oldPart === null) {\n // No old part for this value; create a new one and\n // insert it\n const newPart = createAndInsertPart(containerPart, oldParts[oldHead]);\n updatePart(newPart, newValues[newHead]);\n newParts[newHead] = newPart;\n }\n else {\n // Reuse old part\n newParts[newHead] =\n updatePart(oldPart, newValues[newHead]);\n insertPartBefore(containerPart, oldPart, oldParts[oldHead]);\n // This marks the old part as having been used, so that\n // it will be skipped in the first two checks above\n oldParts[oldIndex] = null;\n }\n newHead++;\n }\n }\n }\n // Add parts for any remaining new values\n while (newHead <= newTail) {\n // For all remaining additions, we insert before last new\n // tail, since old pointers are no longer valid\n const newPart = createAndInsertPart(containerPart, newParts[newTail + 1]);\n updatePart(newPart, newValues[newHead]);\n newParts[newHead++] = newPart;\n }\n // Remove any remaining unused old parts\n while (oldHead <= oldTail) {\n const oldPart = oldParts[oldHead++];\n if (oldPart !== null) {\n removePart(oldPart);\n }\n }\n // Save order of new parts for next round\n partListCache.set(containerPart, newParts);\n keyListCache.set(containerPart, newKeys);\n };\n});\n//# sourceMappingURL=repeat.js.map","var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __metadata = (this && this.__metadata) || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n};\nimport { WiredBase, customElement, property, html, css, query } from 'wired-lib/lib/wired-base';\nimport { repeat } from 'lit-html/directives/repeat';\nimport { WiredCard } from 'wired-card';\nimport 'wired-item';\nimport 'wired-card';\nlet WiredTab = class WiredTab extends WiredBase {\n constructor() {\n super(...arguments);\n this.name = '';\n this.label = '';\n }\n static get styles() {\n return css `\n :host {\n display: block;\n }\n wired-card {\n display: block;\n }\n `;\n }\n render() {\n return html `\n <wired-card>\n <slot></slot>\n </wired-card>\n `;\n }\n relayout() {\n setTimeout(() => {\n if (this.card) {\n this.card.requestUpdate();\n }\n });\n }\n};\n__decorate([\n property({ type: String }),\n __metadata(\"design:type\", Object)\n], WiredTab.prototype, \"name\", void 0);\n__decorate([\n property({ type: String }),\n __metadata(\"design:type\", Object)\n], WiredTab.prototype, \"label\", void 0);\n__decorate([\n query('wired-card'),\n __metadata(\"design:type\", WiredCard)\n], WiredTab.prototype, \"card\", void 0);\nWiredTab = __decorate([\n customElement('wired-tab')\n], WiredTab);\nexport { WiredTab };\nlet WizardTabs = class WizardTabs extends WiredBase {\n constructor() {\n super(...arguments);\n this.pages = [];\n this.pageMap = new Map();\n }\n static get styles() {\n return css `\n :host {\n display: block;\n }\n\n .hidden {\n display: none !important;\n }\n \n ::slotted(.hidden) {\n display: none !important;\n }\n\n :host ::slotted(.hidden) {\n display: none !important;\n }\n\n #bar {\n display: -ms-flexbox;\n display: -webkit-flex;\n display: flex;\n -ms-flex-direction: row;\n -webkit-flex-direction: row;\n flex-direction: row;\n }\n `;\n }\n render() {\n return html `\n <div id=\"bar\">\n ${repeat(this.pages, (p) => p.name, (p) => html `\n <wired-item role=\"tab\" .value=\"${p.name}\" .selected=\"${p.name === this.selected}\" ?aria-selected=\"${p.name === this.selected}\"\n @click=\"${() => this.selected = p.name}\">${p.label || p.name}</wired-item>\n `)}\n </div>\n <div>\n <slot id=\"slot\" @slotchange=\"${this.mapPages}\"></slot>\n </div>\n `;\n }\n mapPages() {\n this.pages = [];\n this.pageMap.clear();\n if (this.slotElement) {\n const assigned = this.slotElement.assignedNodes();\n if (assigned && assigned.length) {\n for (let i = 0; i < assigned.length; i++) {\n const n = assigned[i];\n if (n.nodeType === Node.ELEMENT_NODE && n.tagName.toLowerCase() === 'wired-tab') {\n const e = n;\n this.pages.push(e);\n const name = e.getAttribute('name') || '';\n if (name) {\n name.trim().split(' ').forEach((nameSegment) => {\n if (nameSegment) {\n this.pageMap.set(nameSegment, e);\n }\n });\n }\n }\n }\n if (!this.selected) {\n if (this.pages.length) {\n this.selected = this.pages[0].name;\n }\n }\n this.requestUpdate();\n }\n }\n }\n firstUpdated() {\n this.mapPages();\n this.tabIndex = +((this.getAttribute('tabindex') || 0));\n this.addEventListener('keydown', (event) => {\n switch (event.keyCode) {\n case 37:\n case 38:\n event.preventDefault();\n this.selectPrevious();\n break;\n case 39:\n case 40:\n event.preventDefault();\n this.selectNext();\n break;\n }\n });\n }\n updated() {\n const newPage = this.getElement();\n for (let i = 0; i < this.pages.length; i++) {\n const p = this.pages[i];\n if (p === newPage) {\n p.classList.remove('hidden');\n }\n else {\n p.classList.add('hidden');\n }\n }\n this.current = newPage || undefined;\n if (this.current) {\n this.current.relayout();\n }\n }\n getElement() {\n let e = undefined;\n if (this.selected) {\n e = this.pageMap.get(this.selected);\n }\n if (!e) {\n e = this.pages[0];\n }\n return e || null;\n }\n selectPrevious() {\n const list = this.pages;\n if (list.length) {\n let index = -1;\n for (let i = 0; i < list.length; i++) {\n if (list[i] === this.current) {\n index = i;\n break;\n }\n }\n if (index < 0) {\n index = 0;\n }\n else if (index === 0) {\n index = list.length - 1;\n }\n else {\n index--;\n }\n this.selected = list[index].name || '';\n }\n }\n selectNext() {\n const list = this.pages;\n if (list.length) {\n let index = -1;\n for (let i = 0; i < list.length; i++) {\n if (list[i] === this.current) {\n index = i;\n break;\n }\n }\n if (index < 0) {\n index = 0;\n }\n else if (index >= (list.length - 1)) {\n index = 0;\n }\n else {\n index++;\n }\n this.selected = list[index].name || '';\n }\n }\n};\n__decorate([\n property({ type: String }),\n __metadata(\"design:type\", String)\n], WizardTabs.prototype, \"selected\", void 0);\n__decorate([\n query('slot'),\n __metadata(\"design:type\", HTMLSlotElement)\n], WizardTabs.prototype, \"slotElement\", void 0);\nWizardTabs = __decorate([\n customElement('wired-tabs')\n], WizardTabs);\nexport { WizardTabs };\n","var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __metadata = (this && this.__metadata) || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n};\nimport { WiredBase, customElement, property, html, css } from 'wired-lib/lib/wired-base';\nimport { hachureEllipseFill } from 'wired-lib';\nimport '@material/mwc-icon';\nlet WiredFab = class WiredFab extends WiredBase {\n constructor() {\n super(...arguments);\n this.disabled = false;\n }\n static get styles() {\n return css `\n :host {\n display: -ms-inline-flexbox;\n display: -webkit-inline-flex;\n display: inline-flex;\n -ms-flex-align: center;\n -webkit-align-items: center;\n align-items: center;\n -ms-flex-pack: center;\n -webkit-justify-content: center;\n justify-content: center;\n position: relative;\n vertical-align: middle;\n padding: 16px;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n cursor: pointer;\n z-index: 0;\n line-height: 1;\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n -webkit-tap-highlight-color: transparent;\n box-sizing: border-box !important;\n outline: none;\n color: #fff;\n opacity: 0;\n }\n\n :host(.wired-rendered) {\n opacity: 1;\n }\n \n :host(.wired-disabled) {\n opacity: 0.45 !important;\n cursor: default;\n background: rgba(0, 0, 0, 0.07);\n border-radius: 50%;\n pointer-events: none;\n }\n \n :host(:active) mwc-icon {\n opacity: 1;\n transform: scale(1.15);\n }\n\n :host(:focus) mwc-icon {\n opacity: 1;\n }\n \n .overlay {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n pointer-events: none;\n }\n \n svg {\n display: block;\n }\n \n path {\n stroke: var(--wired-fab-bg-color, #018786);\n stroke-width: 3;\n fill: transparent;\n }\n \n mwc-icon {\n position: relative;\n font-size: var(--wired-icon-size, 24px);\n transition: transform 0.2s ease, opacity 0.2s ease;\n opacity: 0.85;\n }\n `;\n }\n render() {\n return html `\n <div class=\"overlay\">\n <svg id=\"svg\"></svg>\n </div>\n <mwc-icon>\n <slot></slot>\n </mwc-icon>\n `;\n }\n firstUpdated() {\n this.addEventListener('keydown', (event) => {\n if ((event.keyCode === 13) || (event.keyCode === 32)) {\n event.preventDefault();\n this.click();\n }\n });\n this.setAttribute('role', 'button');\n this.setAttribute('aria-label', this.textContent || this.innerText);\n setTimeout(() => this.requestUpdate());\n }\n updated(changed) {\n if (changed.has('disabled')) {\n this.refreshDisabledState();\n }\n const svg = this.shadowRoot.getElementById('svg');\n while (svg.hasChildNodes()) {\n svg.removeChild(svg.lastChild);\n }\n const s = this.getBoundingClientRect();\n const min = Math.min(s.width, s.height);\n svg.setAttribute('width', `${min}`);\n svg.setAttribute('height', `${min}`);\n const g = hachureEllipseFill(min / 2, min / 2, min, min);\n svg.appendChild(g);\n this.classList.add('wired-rendered');\n }\n refreshDisabledState() {\n if (this.disabled) {\n this.classList.add('wired-disabled');\n }\n else {\n this.classList.remove('wired-disabled');\n }\n this.tabIndex = this.disabled ? -1 : +(this.getAttribute('tabindex') || 0);\n }\n};\n__decorate([\n property({ type: Boolean, reflect: true }),\n __metadata(\"design:type\", Object)\n], WiredFab.prototype, \"disabled\", void 0);\nWiredFab = __decorate([\n customElement('wired-fab')\n], WiredFab);\nexport { WiredFab };\n","var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __metadata = (this && this.__metadata) || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n};\nimport { WiredBase, customElement, property, html, css, query } from 'wired-lib/lib/wired-base';\nimport { ellipse, hachureEllipseFill } from 'wired-lib';\nlet WiredSpinner = class WiredSpinner extends WiredBase {\n constructor() {\n super(...arguments);\n this.spinning = false;\n this.duration = 1500;\n this.value = 0;\n this.timerstart = 0;\n this.frame = 0;\n }\n static get styles() {\n return css `\n :host {\n display: inline-block;\n position: relative;\n opacity: 0;\n }\n\n :host(.wired-rendered) {\n opacity: 1;\n }\n\n #svg {\n display: block;\n width: 76px;\n height: 76px;\n }\n\n path {\n stroke: currentColor;\n stroke-opacity: 0.5;\n stroke-width: 1.5;\n fill: none;\n }\n .knob path {\n stroke-width: 2.8 !important;\n stroke-opacity: 1;\n }\n `;\n }\n render() {\n return html `\n <svg id=\"svg\"></svg>\n `;\n }\n firstUpdated() {\n if (this.svg) {\n ellipse(this.svg, 38, 38, 60, 60);\n this.knob = hachureEllipseFill(0, 0, 20, 20);\n this.knob.classList.add('knob');\n this.svg.appendChild(this.knob);\n }\n this.updateCursor();\n this.classList.add('wired-rendered');\n }\n updated() {\n if (this.spinning) {\n this.startSpinner();\n }\n else {\n this.stopSpinner();\n }\n }\n startSpinner() {\n this.stopSpinner();\n this.value = 0;\n this.timerstart = 0;\n this.nextTick();\n }\n stopSpinner() {\n if (this.frame) {\n window.cancelAnimationFrame(this.frame);\n this.frame = 0;\n }\n }\n nextTick() {\n this.frame = window.requestAnimationFrame((t) => this.tick(t));\n }\n tick(t) {\n if (this.spinning) {\n if (!this.timerstart) {\n this.timerstart = t;\n }\n this.value = Math.min(1, (t - this.timerstart) / this.duration);\n this.updateCursor();\n if (this.value >= 1) {\n this.value = 0;\n this.timerstart = 0;\n }\n this.nextTick();\n }\n else {\n this.frame = 0;\n }\n }\n updateCursor() {\n if (this.knob) {\n const position = [\n Math.round(38 + 25 * Math.cos(this.value * Math.PI * 2)),\n Math.round(38 + 25 * Math.sin(this.value * Math.PI * 2))\n ];\n this.knob.style.transform = `translate3d(${position[0]}px, ${position[1]}px, 0) rotateZ(${Math.round(this.value * 360 * 2)}deg)`;\n }\n }\n};\n__decorate([\n property({ type: Boolean }),\n __metadata(\"design:type\", Object)\n], WiredSpinner.prototype, \"spinning\", void 0);\n__decorate([\n property({ type: Number }),\n __metadata(\"design:type\", Object)\n], WiredSpinner.prototype, \"duration\", void 0);\n__decorate([\n query('svg'),\n __metadata(\"design:type\", SVGSVGElement)\n], WiredSpinner.prototype, \"svg\", void 0);\nWiredSpinner = __decorate([\n customElement('wired-spinner')\n], WiredSpinner);\nexport { WiredSpinner };\n","<script>\n\timport { ajax } from \"rxjs/ajax\";\n\timport { pluck, startWith } from \"rxjs/operators\";\n\timport { WiredIconButton, WiredCard } from \"wired-elements\";\n\timport { afterUpdate } from 'svelte';\n\t\n\tconst users$ = ajax(\"https://api.github.com/users?per_page=5\")\n\t .pipe(pluck(\"response\"), startWith([])\n\t);\n\n\tafterUpdate(() => {\n\t\tconst card = document.querySelector(\"wired-card\");\n\t\tcard.requestUpdate();\n\t});\n\n</script>\n<wired-card elevation=\"3\">\n<h1>Users list</h1>\n<div>\n{#each $users$ as user}\n\t<p><wired-icon-button style=\"--wired-icon-size:8px\">favorite</wired-icon-button> {user.login} </p>\n{/each}\n</div>\n</wired-card>\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","import App from './App.svelte';\n\nconst app = new App({\n\ttarget: document.body,\n\tprops: {\n\t\tname: 'world'\n\t}\n});\n\nexport default app;"],"names":["noop","run","fn","blank_object","Object","create","run_all","fns","forEach","is_function","thing","safe_not_equal","a","b","append","target","node","appendChild","insert","anchor","insertBefore","detach","parentNode","removeChild","element","name","document","createElement","text","data","createTextNode","space","current_component","set_current_component","component","afterUpdate","Error","get_current_component","$$","after_render","push","dirty_components","resolved_promise","Promise","resolve","update_scheduled","binding_callbacks","render_callbacks","flush_callbacks","add_render_callback","flush","seen_callbacks","Set","length","shift","update","callback","pop","has","add","fragment","dirty","before_render","p","ctx","make_dirty","key","then","init","options","instance","create_fragment","not_equal$$1","prop_names","parent_component","props","not_equal","bound","on_mount","on_destroy","context","Map","callbacks","ready","value","hydrate","l","Array","from","childNodes","c","intro","i","m","new_on_destroy","map","filter","mount_component","SvelteComponent","[object Object]","detaching","this","d","$destroy","type","index","indexOf","splice","extendStatics","setPrototypeOf","__proto__","hasOwnProperty","__extends","__","constructor","prototype","__window","window","__self","self","WorkerGlobalScope","__global","global","_root","isFunction","x","_enable_super_gross_mode_that_will_cause_bad_things","config","undefined","useDeprecatedSynchronousErrorHandling","stack","hostReportError","err","setTimeout","empty","closed","next","error","complete","isArray","isObject","UnsubscriptionErrorImpl","errors","call","message","toString","join","UnsubscriptionError","Subscription","unsubscribe","_parentOrParents","_subscriptions","_unsubscribe","remove","e","flattenUnsubscriptionErrors","len","sub","concat","teardown","subscription","tmp","EMPTY","subscriptions","subscriptionIndex","reduce","errs","rxSubscriber","Symbol","Math","random","Subscriber","_super","destinationOrNext","_this","syncErrorValue","syncErrorThrown","syncErrorThrowable","isStopped","arguments","destination","emptyObserver","SafeSubscriber","tslib_1.__extends","rxSubscriberSymbol","subscriber","_next","_error","_complete","_unsubscribeAndRecycle","_parentSubscriber","observerOrNext","bind","_context","__tryOrSetError","__tryOrUnsub","wrappedComplete","parent","observable","Observable","subscribe","_isScalar","_subscribe","lift","operator","source","sink","nextOrObserver","toSubscriber","_trySubscribe","observer","_a","closed_1","canReportError","console","warn","promiseCtor","getPromiseCtor","reject","Symbol_observable","pipe","operations","_i","input","prev","toPromise","project","thisArg","TypeError","MapOperator","MapSubscriber","count","result","ajaxGet","url","headers","AjaxObservable","method","ajaxPost","body","ajaxDelete","ajaxPut","ajaxPatch","mapResponse","response","ajaxGetJSON","responseType","urlOrRequest","request","async","createXHR","crossDomain","root","XMLHttpRequest","XDomainRequest","getCORSRequest","progId","progIds","ActiveXObject","getXMLHttpRequest","withCredentials","timeout","prop","AjaxSubscriber","get","post","delete","put","patch","getJSON","done","getHeader","FormData","serializeBody","send","xhr","AjaxResponse","_b","user","password","setupEvents","open","setHeaders","contentType","splitIndex","substring","keys","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","OuterSubscriber","apply","notifyNext","outerValue","innerValue","outerIndex","innerIndex","innerSub","notifyError","notifyComplete","InnerSubscriber","subscribeToArray","array","getSymbolIterator","iterator","isArrayLike","isPromise","subscribeTo","obj","obs","promise","Symbol_iterator","iterable","item","return","isScheduler","schedule","scheduleArray","scheduler","scheduled","isInteropObservable","scheduleObservable","schedulePromise","isIterable","scheduleIterable","of","args","fromArray","mergeMap","resultSelector","concurrent","Number","POSITIVE_INFINITY","ii","MergeMapOperator","MergeMapSubscriber","hasCompleted","buffer","active","_tryNext","_innerSub","ish","innerSubscriber","outerSubscriber","subscribeToResult","identity","concatAll","observables","SubjectSubscriber","RefCountOperator","connectable","_refCount","refCounter","RefCountSubscriber","connection","connect","refCount","sharedConnection","_connection","connectableProto","ConnectableObservable","subjectFactory","_isComplete","getSubject","subject","_subject","ConnectableSubscriber","pluck","properties","currentProp","plucker","directives","WeakMap","isDirective","o","isCEPolyfill","customElements","polyfillWrapFlushCallback","removeNodes","container","startNode","endNode","n","nextSibling","noChange","nothing","marker","String","slice","nodeMarker","markerRegex","RegExp","boundAttributeSuffix","Template","parts","partIndex","nodesToRemove","_prepareTemplate","template","content","walker","createTreeWalker","lastPartIndex","nextNode","currentNode","nodeType","hasAttributes","attributes","stringForPart","strings","lastAttributeNameRegex","exec","attributeLookupName","getAttribute","split","removeAttribute","tagName","lastIndex","createMarker","previousSibling","isTemplatePartActive","part","createComment","TemplateInstance","processor","_parts","values","setValue","commit","cloneNode","importNode","nodeIndex","_prepareInstance","handleTextExpression","insertAfterNode","handleAttributeExpressions","nodeName","adoptNode","upgrade","TemplateResult","endIndex","html","s","match","substr","innerHTML","getHTML","isPrimitive","AttributeCommitter","_createPart","AttributePart","v","t","setAttribute","_getValue","comitter","committer","directive","NodePart","_pendingValue","ref","_insert","_commitText","_commitTemplateResult","Node","_commitNode","_commitIterable","clear","templateFactory","_clone","itemParts","itemPart","appendIntoPart","insertAfterPart","BooleanAttributePart","PropertyCommitter","super","single","PropertyPart","eventOptionsSupported","capture","addEventListener","removeEventListener","_e","EventPart","eventName","eventContext","_boundHandleEvent","handleEvent","newListener","oldListener","shouldRemoveListener","once","passive","shouldAddListener","_options","getOptions","event","defaultTemplateProcessor","prefix","templateCache","templateCaches","stringsArray","keyString","set","getTemplateElement","walkerNodeFilter","removeNodesFromTemplate","nextActiveIndexInTemplateParts","removeCount","nodesToRemoveInTemplate","currentRemovingNode","countNodes","startIndex","getTemplateCacheKey","scopeName","compatibleShadyCSSVersion","ShadyCSS","prepareTemplateDom","shadyTemplateFactory","cacheKey","TEMPLATE_TYPES","shadyRenderSet","prepareTemplateStyles","renderedDOM","styles","querySelectorAll","condensedStyle","style","textContent","templates","removeStylesFromLitTemplates","refNode","insertCount","walkerIndex","insertNodeIntoTemplate","firstChild","nativeShadow","querySelector","removes","JSCompiler_renameProperty","_obj","defaultConverter","Boolean","notEqual","old","defaultPropertyDeclaration","attribute","converter","reflect","hasChanged","microtaskPromise","STATE_HAS_UPDATED","STATE_UPDATE_REQUESTED","STATE_IS_REFLECTING_TO_ATTRIBUTE","STATE_IS_REFLECTING_TO_PROPERTY","STATE_HAS_CONNECTED","UpdatingElement","HTMLElement","_updateState","_instanceProperties","_updatePromise","_hasConnectedResolver","_changedProperties","_reflectingProperties","initialize","observedAttributes","finalize","_classProperties","attr","_attributeNameForProperty","_attributeToPropertyMap","superProperties","getPrototypeOf","k","_ensureClassProperties","noAccessor","defineProperty","oldValue","_requestUpdate","configurable","enumerable","finalized","superCtor","propKeys","getOwnPropertyNames","getOwnPropertySymbols","createProperty","fromAttribute","toAttribute","_saveInstanceProperties","_v","_attributeToProperty","ctor","attrValue","_propertyValueToAttribute","propName","_propertyValueFromAttribute","shouldRequestUpdate","_valueHasChanged","_hasRequestedUpdate","_enqueueUpdate","updateComplete","previousUpdatePromise","res","rej","_hasConnected","performUpdate","hasUpdated","_applyInstanceProperties","shouldUpdate","changedProperties","_markUpdated","firstUpdated","updated","size","_propertyToAttribute","customElement","classOrDescriptor","clazz","define","legacyCustomElement","descriptor","kind","elements","standardCustomElement","standardProperty","placement","initializer","assign","legacyProperty","proto","property","protoOrDescriptor","query","selector","renderRoot","legacyQuery","standardQuery","supportsAdoptingStyleSheets","Document","CSSStyleSheet","constructionToken","CSSResult","cssText","safeToken","styleSheet","_styleSheet","replaceSync","css","acc","idx","textFromCSSResult","flattenStyles","flat","Infinity","arrayFlat","LitElement","_styles","_getUniqueStyles","userStyles","reduceRight","unshift","createRenderRoot","ShadowRoot","adoptStyles","attachShadow","mode","adoptedStyleSheets","_needsShimAdoptedStyleSheets","ScopingShim","prepareAdoptedCssText","localName","connectedCallback","styleElement","templateResult","render","hasRendered","needsScoping","firstScopeRender","renderContainer","createDocumentFragment","appendInto","litRender","host","WiredBase","detail","bubbles","composed","CE","SlickCustomEvent","CustomEvent","dispatchEvent","Segment","p1","p2","xi","MAX_VALUE","yi","px1","py1","px2","py2","_undefined","otherSegment","isUndefined","grad1","grad2","int1","int2","abs","min","max","HachureIterator","top","bottom","left","right","gap","sinAngle","cosAngle","tanAngle","deltaX","hGap","pos","sLeft","sRight","line","xLower","xUpper","yLower","yUpper","intersects","getIntersectingLines","points","intersections","s1","s2","affine","y","cx","cy","sinAnglePrime","cosAnglePrime","R","__maxRandomnessOffset","__roughness","__bowing","__curveTightness","__curveStepCount","WiresPath","trim","cp1x","cp1y","cp2x","cp2y","svgNode","createElementNS","setAttributeNS","_getOffset","_line","x1","y1","x2","y2","existingPath","lengthSq","pow","offset","sqrt","halfOffset","divergePoint","midDispX","midDispY","path","moveTo","bcurveTo","_continuousLine","move","overwrite","_ellipse","ellipseInc","rx","ry","overlap","radOffset","PI","cos","sin","angle","vertArray","vertArrayLength","cachedVertArray","_curve","rectangle","width","height","polygon","vertices","vCount","ellipse","renderHachureLines","lines","gNode","prevPoint","bowing","curveStepCount","curveTightness","dashGap","dashOffset","fill","fillStyle","fillWeight","hachureAngle","hachureGap","maxRandomnessOffset","roughness","simplification","stroke","strokeWidth","zigzagOffset","hachureFill","ret","tan","it","rect","nextLine","hachureLinesForPolygon","hachureEllipseFill","helper","randOffset","fweight","aspectRatio","hyp","gapPrime","halfLen","xPos","hachureLinesForEllipse","_o","__decorate","decorators","desc","r","getOwnPropertyDescriptor","Reflect","decorate","__metadata","metadata","WiredButton","elevation","disabled","keyCode","preventDefault","click","innerText","requestUpdate","changed","refreshDisabledState","svg","shadowRoot","getElementById","hasChildNodes","lastChild","getBoundingClientRect","elev","w","h","opacity","classList","tabIndex","WiredCard","resizeHandler","debounce","disconnectedCallback","func","wait","immediate","callNow","clearTimeout","WiredCheckbox","checked","toggleCheck","fireEvent","checkpaths","display","WiredItem","selected","g","SVGSVGElement","WiredCombo","cardShowing","itemNodes","onCombo","onItemClick","refreshSelection","setCardShowing","selectPrevious","selectNext","textBounds","minHeight","dropx","dropOffset","poly","pointerEvents","cursor","nodes","assignedNodes","lastSelectedItem","selectedItem","showing","card","ELEMENT_NODE","stopPropagation","fireSelected","list","navigator","userAgent","DOMTokenList","toggle","token","force","fontEl","rel","href","head","Icon","WiredIconButton","WiredInput","placeholder","autocomplete","autocapitalize","autocorrect","required","autofocus","readonly","minlength","maxlength","step","onChange","delegatesFocus","pendingValue","sourceEvent","WiredListbox","horizontal","itemClickHandler","WiredProgress","percentage","getProgressLabel","floor","box","pct","progWidth","progBox","WiredRadio","iconsize","dot","iw","ih","WiredRadioGroup","radioNodes","checkListener","handleChecked","slotChange","radio","focus","microtaskCurrHandle","microtaskLastHandle","microtaskCallbacks","microtaskNodeContent","microtaskNode","MutationObserver","cb","observe","characterData","timeOut","after","delay","handle","microTask","Debouncer","_asyncModule","_callback","_timer","asyncModule","debouncerQueue","isActive","_cancelAsync","cancel","debouncer","setConfig","nativeCss","baseURI","location","lastIndexOf","Polymer","sanitizeDOMValue","passiveTouchGestures","wrap","HAS_NATIVE_TA","touchAction","GESTURE_KEY","HANDLED_OBJ","TOUCH_ACTION","TAP_DISTANCE","TRACK_DISTANCE","MOUSE_TIMEOUT","MOUSE_EVENTS","MOUSE_WHICH_TO_BUTTONS","MOUSE_HAS_BUTTONS","MouseEvent","buttons","isMouseEvent","SUPPORTS_PASSIVE","PASSIVE_TOUCH","opts","IS_TOUCH_ONLY","clickedLabels","labellable","button","keygen","meter","output","textarea","progress","select","canBeDisabled","command","fieldset","optgroup","option","matchingLabels","el","labels","getRootNode","id","matching","mouseCanceller","mouseEvent","sc","sourceCapabilities","firesTouchEvents","skip","clickFromLabel","getComposedPath","ownerLabels","j","POINTERSTATE","mouse","setupTeardownMouseCanceller","setup","events","en","hasLeftMouseButton","ev","which","mouseIgnoreJob","touch","scrollDecided","trackDocument","stateObj","movefn","upfn","untrackDocument","ShadyDOM","noPatch","composedPath","gestures","recognizers","_findOriginalTarget","_handleNative","handled","gobj","currentTarget","gs","changedTouches","touches","identifier","clientX","clientY","ta","firstTouchAction","shouldPrevent","dx","dy","cancelable","prevent","_handleTouchAction","flow","start","reset","addListener","evType","handler","recognizer","deps","dep","gd","_count","setTouchAction","_add","register","recog","emits","_fire","Event","defaultPrevented","preventer","evName","_findRecognizerByEvent","info","downupFire","trackHasMovedEnough","started","trackFire","ddx","secondlast","moves","lastmove","ddy","state","hover","elementFromPoint","deepTargetFind","trackForward","hasAttribute","isNaN","bcr","pageX","pageY","isSyntheticClick","end","mousedown","touchstart","touchend","addMove","ct","touchmove","NaN","WiredSlider","_value","knobradius","barWidth","intermediateValue","startx","dragging","radius","bar","knobGroup","knob","onValueChange","setAriaValue","knobdown","resetKnob","onTrack","incremenent","decrement","skipEvent","newValue","round","knobOffset","transform","knobExpand","trackStart","trackX","trackEnd","newX","newPct","WiredTextarea","rows","maxrows","inputmode","tokens","prevHeight","onInput","mirror","valueForMirror","replace","constrain","_tokens","updateCached","WiredToggle","knobFill","cl","WiredTooltip","position","_target","showHandler","show","hideHandler","hide","owner","for","DOCUMENT_FRAGMENT_NODE","detachListeners","attachListeners","layout","changedProps","refreshTarget","updatePosition","offsetParent","parentRect","targetRect","tipRect","horizontalCenterOffset","verticalCenterOffset","targetLeft","targetTop","tooltipLeft","tooltipTop","createAndInsertPart","containerPart","beforePart","beforeNode","newPart","updatePart","insertPartBefore","before","reparentNodes","removePart","generateMap","partListCache","keyListCache","repeat","f","items","keyFnOrTemplate","keyFn","oldParts","oldKeys","newParts","newValues","newKeys","newKeyToIndexMap","oldKeyToIndexMap","oldHead","oldTail","newHead","newTail","oldIndex","oldPart","WiredTab","label","WizardTabs","pages","pageMap","mapPages","slotElement","assigned","nameSegment","newPage","getElement","current","relayout","HTMLSlotElement","WiredFab","WiredSpinner","spinning","duration","timerstart","frame","updateCursor","startSpinner","stopSpinner","nextTick","cancelAnimationFrame","requestAnimationFrame","tick","login","setProperty","$users$","iterations","users$","startWith","store"],"mappings":"gCAAA,SAASA,KAmBT,SAASC,EAAIC,GACZ,OAAOA,IAGR,SAASC,IACR,OAAOC,OAAOC,OAAO,MAGtB,SAASC,EAAQC,GAChBA,EAAIC,QAAQP,GAGb,SAASQ,EAAYC,GACpB,MAAwB,mBAAVA,EAGf,SAASC,EAAeC,EAAGC,GAC1B,OAAOD,GAAKA,EAAIC,GAAKA,EAAID,IAAMC,GAAOD,GAAkB,iBAANA,GAAgC,mBAANA,EAiF7E,SAASE,EAAOC,EAAQC,GACvBD,EAAOE,YAAYD,GAGpB,SAASE,EAAOH,EAAQC,EAAMG,GAC7BJ,EAAOK,aAAaJ,EAAMG,GAG3B,SAASE,EAAOL,GACfA,EAAKM,WAAWC,YAAYP,GA2B7B,SAASQ,EAAQC,GAChB,OAAOC,SAASC,cAAcF,GAO/B,SAASG,EAAKC,GACb,OAAOH,SAASI,eAAeD,GAGhC,SAASE,IACR,OAAOH,EAAK,KA0Vb,IAAII,EAEJ,SAASC,EAAsBC,GAC9BF,EAAoBE,EAgBrB,SAASC,EAAYjC,IAbrB,WACC,IAAK8B,EAAmB,MAAM,IAAII,MAAM,oDACxC,OAAOJ,GAYPK,GAAwBC,GAAGC,aAAaC,KAAKtC,GA2C9C,MAAMuC,EAAmB,GAGnBC,EAAmBC,QAAQC,UACjC,IAAIC,GAAmB,EACvB,MAAMC,EAAoB,GACpBC,EAAmB,GACnBC,EAAkB,GAkBxB,SAASC,EAAoB/C,GAC5B6C,EAAiBP,KAAKtC,GAOvB,SAASgD,IACR,MAAMC,EAAiB,IAAIC,IAE3B,EAAG,CAGF,KAAOX,EAAiBY,QAAQ,CAC/B,MAAMnB,EAAYO,EAAiBa,QACnCrB,EAAsBC,GACtBqB,EAAOrB,EAAUI,IAGlB,KAAOQ,EAAkBO,QAAQP,EAAkBQ,OAAlBR,GAKjC,KAAOC,EAAiBM,QAAQ,CAC/B,MAAMG,EAAWT,EAAiBU,MAC7BN,EAAeO,IAAIF,KACvBA,IAGAL,EAAeQ,IAAIH,WAGbf,EAAiBY,QAE1B,KAAOL,EAAgBK,QACtBL,EAAgBS,KAAhBT,GAGDH,GAAmB,EAGpB,SAASU,EAAOjB,GACXA,EAAGsB,WACNtB,EAAGiB,OAAOjB,EAAGuB,OACbvD,EAAQgC,EAAGwB,eACXxB,EAAGsB,SAASG,EAAEzB,EAAGuB,MAAOvB,EAAG0B,KAC3B1B,EAAGuB,MAAQ,KAEXvB,EAAGC,aAAa/B,QAAQyC,IAyqB1B,SAASgB,EAAW/B,EAAWgC,GACzBhC,EAAUI,GAAGuB,QACjBpB,EAAiBD,KAAKN,GA5uBlBW,IACJA,GAAmB,EACnBH,EAAiByB,KAAKjB,IA4uBtBhB,EAAUI,GAAGuB,MAAQ,IAEtB3B,EAAUI,GAAGuB,MAAMK,IAAO,EAG3B,SAASE,EAAKlC,EAAWmC,EAASC,EAAUC,EAAiBC,EAAcC,GAC1E,MAAMC,EAAmB1C,EACzBC,EAAsBC,GAEtB,MAAMyC,EAAQN,EAAQM,OAAS,GAEzBrC,EAAKJ,EAAUI,GAAK,CACzBsB,SAAU,KACVI,IAAK,KAGLW,MAAOF,EACPlB,OAAQvD,EACR4E,UAAWJ,EACXK,MAAO1E,IAGP2E,SAAU,GACVC,WAAY,GACZjB,cAAe,GACfvB,aAAc,GACdyC,QAAS,IAAIC,IAAIP,EAAmBA,EAAiBpC,GAAG0C,QAAU,IAGlEE,UAAW/E,IACX0D,MAAO,MAGR,IAAIsB,GAAQ,EAvmCb,IAAkB3D,EAymCjBc,EAAG0B,IAAMM,EACNA,EAASpC,EAAWyC,EAAO,CAACT,EAAKkB,KAC9B9C,EAAG0B,KAAOQ,EAAalC,EAAG0B,IAAIE,GAAM5B,EAAG0B,IAAIE,GAAOkB,KACjD9C,EAAGuC,MAAMX,IAAM5B,EAAGuC,MAAMX,GAAKkB,GAC7BD,GAAOlB,EAAW/B,EAAWgC,MAGjCS,EAEHrC,EAAGiB,SACH4B,GAAQ,EACR7E,EAAQgC,EAAGwB,eACXxB,EAAGsB,SAAWW,EAAgBjC,EAAG0B,KAE7BK,EAAQtD,SACPsD,EAAQgB,QACX/C,EAAGsB,SAAS0B,GAznCG9D,EAynCQ6C,EAAQtD,OAxnC1BwE,MAAMC,KAAKhE,EAAQiE,cA0nCxBnD,EAAGsB,SAAS8B,IAGTrB,EAAQsB,OAASzD,EAAUI,GAAGsB,SAASgC,GAAG1D,EAAUI,GAAGsB,SAASgC,IA/FtE,SAAyB1D,EAAWnB,EAAQI,GAC3C,MAAMyC,SAAEA,EAAQkB,SAAEA,EAAQC,WAAEA,EAAUxC,aAAEA,GAAiBL,EAAUI,GAEnEsB,EAASiC,EAAE9E,EAAQI,GAKnB8B,EAAoB,KACnB,MAAM6C,EAAiBhB,EAASiB,IAAI9F,GAAK+F,OAAOvF,GAC5CsE,EACHA,EAAWvC,QAAQsD,GAInBxF,EAAQwF,GAET5D,EAAUI,GAAGwC,SAAW,KAGzBvC,EAAa/B,QAAQyC,GA4EpBgD,CAAgB/D,EAAWmC,EAAQtD,OAAQsD,EAAQlD,QACnD+B,KAGDjB,EAAsByC,GA2CvB,MAAMwB,EACLC,WAzHD,IAAiBjE,EAAWkE,EAAAA,GA0HZ,GA1HClE,EA0HPmE,MAzHK/D,KACbhC,EAAQ4B,EAAUI,GAAGyC,YACrB7C,EAAUI,GAAGsB,SAAS0C,EAAEF,GAIxBlE,EAAUI,GAAGyC,WAAa7C,EAAUI,GAAGsB,SAAW,KAClD1B,EAAUI,GAAG0B,IAAM,IAmHnBqC,KAAKE,SAAWvG,EAGjBmG,IAAIK,EAAMhD,GACT,MAAM0B,EAAamB,KAAK/D,GAAG4C,UAAUsB,KAAUH,KAAK/D,GAAG4C,UAAUsB,GAAQ,IAGzE,OAFAtB,EAAU1C,KAAKgB,GAER,KACN,MAAMiD,EAAQvB,EAAUwB,QAAQlD,IACjB,IAAXiD,GAAcvB,EAAUyB,OAAOF,EAAO,IAI5CN,SC/5CD,IAAIS,EAAgB,SAASN,EAAGzF,GAI5B,OAHA+F,EAAgBxG,OAAOyG,gBAClB,CAAEC,UAAW,cAAgBvB,OAAS,SAAUe,EAAGzF,GAAKyF,EAAEQ,UAAYjG,IACvE,SAAUyF,EAAGzF,GAAK,IAAK,IAAIkD,KAAKlD,EAAOA,EAAEkG,eAAehD,KAAIuC,EAAEvC,GAAKlD,EAAEkD,MACpDuC,EAAGzF,IAGrB,SAASmG,EAAUV,EAAGzF,GAEzB,SAASoG,IAAOZ,KAAKa,YAAcZ,EADnCM,EAAcN,EAAGzF,GAEjByF,EAAEa,UAAkB,OAANtG,EAAaT,OAAOC,OAAOQ,IAAMoG,EAAGE,UAAYtG,EAAEsG,UAAW,IAAIF,GCzBnF,IAAIG,EAA6B,oBAAXC,QAA0BA,OAC5CC,EAAyB,oBAATC,MAAqD,oBAAtBC,mBAC/CD,gBAAgBC,mBAAqBD,KACrCE,EAA6B,oBAAXC,QAA0BA,OAC5CC,EAAQP,GAAYK,GAAYH,ECJ7B,SAASM,EAAWC,GACvB,MAAoB,mBAANA,ECDlB,IAAIC,GAAsD,EAC/CC,EAAS,CAChBpF,aAASqF,EACTC,0CAA0C7C,GAClCA,IAC0B,IAAIhD,OACqG8F,MAKvIJ,EAAsD1C,GAE1D6C,4CACI,OAAOH,ICdR,SAASK,EAAgBC,GAC5BC,WAAW,WAAc,MAAMD,GAAQ,GCCpC,IAAIE,EAAQ,CACfC,QAAQ,EACRC,KAAM,SAAUpD,KAChBqD,MAAO,SAAUL,GACb,GAAIL,EAAOE,sCACP,MAAMG,EAGND,EAAgBC,IAGxBM,SAAU,cCbHC,EAAUpD,MAAMoD,kBAAsBd,GAAK,OAAOA,GAAyB,iBAAbA,EAAExE,QCApE,SAASuF,EAASf,GACrB,OAAa,OAANA,GAA2B,iBAANA,ECDhC,SAASgB,EAAwBC,GAM7B,OALA1G,MAAM2G,KAAK1C,MACXA,KAAK2C,QAAUF,EACXA,EAAOzF,OAAS,4CAA8CyF,EAAO/C,IAAI,SAAUqC,EAAKxC,GAAK,OAAOA,EAAI,EAAI,KAAOwC,EAAIa,aAAeC,KAAK,QAAU,GACzJ7C,KAAK5E,KAAO,sBACZ4E,KAAKyC,OAASA,EACPzC,KAEXwC,EAAwB1B,UAA0B/G,OAAOC,OAAO+B,MAAM+E,WAC/D,IAAIgC,EAAsBN,ECL7BO,EAA8B,WAC9B,SAASA,EAAaC,GAClBhD,KAAKkC,QAAS,EACdlC,KAAKiD,iBAAmB,KACxBjD,KAAKkD,eAAiB,KAClBF,IACAhD,KAAKmD,aAAeH,GAkHN,IAAUf,EAIhC,OAnHAc,EAAajC,UAAUkC,YAAc,WACjC,IAAIP,EACJ,IAAIzC,KAAKkC,OAAT,CAGA,IAAee,EAANjD,KAA4BiD,iBAAkBE,EAA9CnD,KAAgEmD,aAAcD,EAA9ElD,KAAkGkD,eAI3G,GAHAlD,KAAKkC,QAAS,EACdlC,KAAKiD,iBAAmB,KACxBjD,KAAKkD,eAAiB,KAClBD,aAA4BF,EAC5BE,EAAiBG,OAAOpD,WAEvB,GAAyB,OAArBiD,EACL,IAAK,IAAI7C,EAAQ,EAAGA,EAAQ6C,EAAiBjG,SAAUoD,EAAO,CAC3C6C,EAAiB7C,GACvBgD,OAAOpD,MAGxB,GAAIuB,EAAW4B,GACX,IACIA,EAAaT,KAAK1C,MAEtB,MAAOqD,GACHZ,EAASY,aAAaP,EAAsBQ,EAA4BD,EAAEZ,QAAU,CAACY,GAG7F,GAAIf,EAAQY,GACR,CAAI9C,GAAS,EAEb,IAFA,IACImD,EAAML,EAAelG,SAChBoD,EAAQmD,GAAK,CAClB,IAAIC,EAAMN,EAAe9C,GACzB,GAAImC,EAASiB,GACT,IACIA,EAAIR,cAER,MAAOK,GACHZ,EAASA,GAAU,GACfY,aAAaP,EACbL,EAASA,EAAOgB,OAAOH,EAA4BD,EAAEZ,SAGrDA,EAAOtG,KAAKkH,KAMhC,GAAIZ,EACA,MAAM,IAAIK,EAAoBL,KAGtCM,EAAajC,UAAUxD,IAAM,SAAUoG,GACnC,IAAIC,EAAeD,EACnB,cAAeA,GACX,IAAK,WACDC,EAAe,IAAIZ,EAAaW,GACpC,IAAK,SACD,GAAIC,IAAiB3D,MAAQ2D,EAAazB,QAA8C,mBAA7ByB,EAAaX,YACpE,OAAOW,EAEN,GAAI3D,KAAKkC,OAEV,OADAyB,EAAaX,cACNW,EAEN,KAAMA,aAAwBZ,GAAe,CAC9C,IAAIa,EAAMD,GACVA,EAAe,IAAIZ,GACNG,eAAiB,CAACU,GAEnC,MACJ,QACI,IAAKF,EACD,OAAOX,EAAac,MAExB,MAAM,IAAI9H,MAAM,yBAA2B2H,EAAW,2BAG9D,IAAIT,EAAmBU,EAAaV,iBACpC,GAAyB,OAArBA,EACAU,EAAaV,iBAAmBjD,UAE/B,GAAIiD,aAA4BF,EAAc,CAC/C,GAAIE,IAAqBjD,KACrB,OAAO2D,EAEXA,EAAaV,iBAAmB,CAACA,EAAkBjD,UAElD,CAAA,IAAwC,IAApCiD,EAAiB5C,QAAQL,MAI9B,OAAO2D,EAHPV,EAAiB9G,KAAK6D,MAK1B,IAAI8D,EAAgB9D,KAAKkD,eAOzB,OANsB,OAAlBY,EACA9D,KAAKkD,eAAiB,CAACS,GAGvBG,EAAc3H,KAAKwH,GAEhBA,GAEXZ,EAAajC,UAAUsC,OAAS,SAAUO,GACtC,IAAIG,EAAgB9D,KAAKkD,eACzB,GAAIY,EAAe,CACf,IAAIC,EAAoBD,EAAczD,QAAQsD,IACnB,IAAvBI,GACAD,EAAcxD,OAAOyD,EAAmB,KAIpDhB,EAAac,QAAmB5B,EAG9B,IAAIc,GAFIb,QAAS,EACRD,GAEJc,KAGX,SAASO,EAA4Bb,GACjC,OAAOA,EAAOuB,OAAO,SAAUC,EAAMlC,GAAO,OAAOkC,EAAKR,OAAQ1B,aAAee,EAAuBf,EAAIU,OAASV,IAAS,ICpIzH,IAAImC,EAAiC,mBAAXC,OACbA,OAAO,gBACrB,kBAAkCC,KAAKC,SCKzCC,EAA4B,SAAUC,GAEtC,SAASD,EAAWE,EAAmBpC,EAAOC,GAC1C,IAAIoC,EAAQF,EAAO7B,KAAK1C,OAASA,KAKjC,OAJAyE,EAAMC,eAAiB,KACvBD,EAAME,iBAAkB,EACxBF,EAAMG,oBAAqB,EAC3BH,EAAMI,WAAY,EACVC,UAAU9H,QACd,KAAK,EACDyH,EAAMM,YAAcC,EACpB,MACJ,KAAK,EACD,IAAKR,EAAmB,CACpBC,EAAMM,YAAcC,EACpB,MAEJ,GAAiC,iBAAtBR,EAAgC,CACnCA,aAA6BF,GAC7BG,EAAMG,mBAAqBJ,EAAkBI,mBAC7CH,EAAMM,YAAcP,EACpBA,EAAkBlH,IAAImH,KAGtBA,EAAMG,oBAAqB,EAC3BH,EAAMM,YAAc,IAAIE,EAAeR,EAAOD,IAElD,MAER,QACIC,EAAMG,oBAAqB,EAC3BH,EAAMM,YAAc,IAAIE,EAAeR,EAAOD,EAAmBpC,EAAOC,GAGhF,OAAOoC,EAoDX,OArFAS,EAAkBZ,EAAYC,GAmC9BD,EAAWxD,UAAUqE,GAAsB,WAAc,OAAOnF,MAChEsE,EAAWtK,OAAS,SAAUmI,EAAMC,EAAOC,GACvC,IAAI+C,EAAa,IAAId,EAAWnC,EAAMC,EAAOC,GAE7C,OADA+C,EAAWR,oBAAqB,EACzBQ,GAEXd,EAAWxD,UAAUqB,KAAO,SAAUpD,GAC7BiB,KAAK6E,WACN7E,KAAKqF,MAAMtG,IAGnBuF,EAAWxD,UAAUsB,MAAQ,SAAUL,GAC9B/B,KAAK6E,YACN7E,KAAK6E,WAAY,EACjB7E,KAAKsF,OAAOvD,KAGpBuC,EAAWxD,UAAUuB,SAAW,WACvBrC,KAAK6E,YACN7E,KAAK6E,WAAY,EACjB7E,KAAKuF,cAGbjB,EAAWxD,UAAUkC,YAAc,WAC3BhD,KAAKkC,SAGTlC,KAAK6E,WAAY,EACjBN,EAAOzD,UAAUkC,YAAYN,KAAK1C,QAEtCsE,EAAWxD,UAAUuE,MAAQ,SAAUtG,GACnCiB,KAAK+E,YAAY5C,KAAKpD,IAE1BuF,EAAWxD,UAAUwE,OAAS,SAAUvD,GACpC/B,KAAK+E,YAAY3C,MAAML,GACvB/B,KAAKgD,eAETsB,EAAWxD,UAAUyE,UAAY,WAC7BvF,KAAK+E,YAAY1C,WACjBrC,KAAKgD,eAETsB,EAAWxD,UAAU0E,uBAAyB,WAC1C,IAAIvC,EAAmBjD,KAAKiD,iBAM5B,OALAjD,KAAKiD,iBAAmB,KACxBjD,KAAKgD,cACLhD,KAAKkC,QAAS,EACdlC,KAAK6E,WAAY,EACjB7E,KAAKiD,iBAAmBA,EACjBjD,MAEJsE,GACTvB,GAEEkC,EAAgC,SAAUV,GAE1C,SAASU,EAAeQ,EAAmBC,EAAgBtD,EAAOC,GAC9D,IAEIF,EAFAsC,EAAQF,EAAO7B,KAAK1C,OAASA,KACjCyE,EAAMgB,kBAAoBA,EAE1B,IAAI9G,EAAU8F,EAoBd,OAnBIlD,EAAWmE,GACXvD,EAAOuD,EAEFA,IACLvD,EAAOuD,EAAevD,KACtBC,EAAQsD,EAAetD,MACvBC,EAAWqD,EAAerD,SACtBqD,IAAmBV,IAEfzD,GADJ5C,EAAU5E,OAAOC,OAAO0L,IACD1C,cACnByB,EAAMnH,IAAIqB,EAAQqE,YAAY2C,KAAKhH,IAEvCA,EAAQqE,YAAcyB,EAAMzB,YAAY2C,KAAKlB,KAGrDA,EAAMmB,SAAWjH,EACjB8F,EAAMY,MAAQlD,EACdsC,EAAMa,OAASlD,EACfqC,EAAMc,UAAYlD,EACXoC,EA0GX,OAnIAS,EAAkBD,EAAgBV,GA2BlCU,EAAenE,UAAUqB,KAAO,SAAUpD,GACtC,IAAKiB,KAAK6E,WAAa7E,KAAKqF,MAAO,CAC/B,IAAII,EAAoBzF,KAAKyF,kBACxB/D,EAAOE,uCAA0C6D,EAAkBb,mBAG/D5E,KAAK6F,gBAAgBJ,EAAmBzF,KAAKqF,MAAOtG,IACzDiB,KAAKgD,cAHLhD,KAAK8F,aAAa9F,KAAKqF,MAAOtG,KAO1CkG,EAAenE,UAAUsB,MAAQ,SAAUL,GACvC,IAAK/B,KAAK6E,UAAW,CACjB,IAAIY,EAAoBzF,KAAKyF,kBACzB7D,EAAwCF,EAAOE,sCACnD,GAAI5B,KAAKsF,OACA1D,GAA0C6D,EAAkBb,oBAK7D5E,KAAK6F,gBAAgBJ,EAAmBzF,KAAKsF,OAAQvD,GACrD/B,KAAKgD,gBALLhD,KAAK8F,aAAa9F,KAAKsF,OAAQvD,GAC/B/B,KAAKgD,oBAOR,GAAKyC,EAAkBb,mBAQpBhD,GACA6D,EAAkBf,eAAiB3C,EACnC0D,EAAkBd,iBAAkB,GAGpC7C,EAAgBC,GAEpB/B,KAAKgD,kBAfuC,CAE5C,GADAhD,KAAKgD,cACDpB,EACA,MAAMG,EAEVD,EAAgBC,MAc5BkD,EAAenE,UAAUuB,SAAW,WAChC,IAAIoC,EAAQzE,KACZ,IAAKA,KAAK6E,UAAW,CACjB,IAAIY,EAAoBzF,KAAKyF,kBAC7B,GAAIzF,KAAKuF,UAAW,CAChB,IAAIQ,EAAkB,WAAc,OAAOtB,EAAMc,UAAU7C,KAAK+B,EAAMmB,WACjElE,EAAOE,uCAA0C6D,EAAkBb,oBAKpE5E,KAAK6F,gBAAgBJ,EAAmBM,GACxC/F,KAAKgD,gBALLhD,KAAK8F,aAAaC,GAClB/F,KAAKgD,oBAQThD,KAAKgD,gBAIjBiC,EAAenE,UAAUgF,aAAe,SAAUjM,EAAIkF,GAClD,IACIlF,EAAG6I,KAAK1C,KAAK4F,SAAU7G,GAE3B,MAAOgD,GAEH,GADA/B,KAAKgD,cACDtB,EAAOE,sCACP,MAAMG,EAGND,EAAgBC,KAI5BkD,EAAenE,UAAU+E,gBAAkB,SAAUG,EAAQnM,EAAIkF,GAC7D,IAAK2C,EAAOE,sCACR,MAAM,IAAI7F,MAAM,YAEpB,IACIlC,EAAG6I,KAAK1C,KAAK4F,SAAU7G,GAE3B,MAAOgD,GACH,OAAIL,EAAOE,uCACPoE,EAAOtB,eAAiB3C,EACxBiE,EAAOrB,iBAAkB,GAClB,IAGP7C,EAAgBC,IACT,GAGf,OAAO,GAEXkD,EAAenE,UAAUqC,aAAe,WACpC,IAAIsC,EAAoBzF,KAAKyF,kBAC7BzF,KAAK4F,SAAW,KAChB5F,KAAKyF,kBAAoB,KACzBA,EAAkBzC,eAEfiC,GACTX,GCrOK,IAAI2B,EAA+B,mBAAX9B,QAAyBA,OAAO8B,YAAc,eCAtE,SAAStM,KCKhB,IAAIuM,EAA4B,WAC5B,SAASA,EAAWC,GAChBnG,KAAKoG,WAAY,EACbD,IACAnG,KAAKqG,WAAaF,GA6F1B,OA1FAD,EAAWpF,UAAUwF,KAAO,SAAUC,GAClC,IAAIN,EAAa,IAAIC,EAGrB,OAFAD,EAAWO,OAASxG,KACpBiG,EAAWM,SAAWA,EACfN,GAEXC,EAAWpF,UAAUqF,UAAY,SAAUT,EAAgBtD,EAAOC,GAC9D,IAAIkE,EAAWvG,KAAKuG,SAChBE,ECjBL,SAAsBC,EAAgBtE,EAAOC,GAChD,GAAIqE,EAAgB,CAChB,GAAIA,aAA0BpC,EAC1B,OAAOoC,EAEX,GAAIA,EAAevB,GACf,OAAOuB,EAAevB,KAG9B,OAAKuB,GAAmBtE,GAAUC,EAG3B,IAAIiC,EAAWoC,EAAgBtE,EAAOC,GAFlC,IAAIiC,EAAWU,GDOX2B,CAAajB,EAAgBtD,EAAOC,GAS/C,GARIkE,EACAE,EAAKnJ,IAAIiJ,EAAS7D,KAAK+D,EAAMzG,KAAKwG,SAGlCC,EAAKnJ,IAAI0C,KAAKwG,QAAW9E,EAAOE,wCAA0C6E,EAAK7B,mBAC3E5E,KAAKqG,WAAWI,GAChBzG,KAAK4G,cAAcH,IAEvB/E,EAAOE,uCACH6E,EAAK7B,qBACL6B,EAAK7B,oBAAqB,EACtB6B,EAAK9B,iBACL,MAAM8B,EAAK/B,eAIvB,OAAO+B,GAEXP,EAAWpF,UAAU8F,cAAgB,SAAUH,GAC3C,IACI,OAAOzG,KAAKqG,WAAWI,GAE3B,MAAO1E,GACCL,EAAOE,wCACP6E,EAAK9B,iBAAkB,EACvB8B,EAAK/B,eAAiB3C,IE7C/B,SAAwB8E,GAC3B,KAAOA,GAAU,CACb,IAAIC,EAAKD,EAAUE,EAAWD,EAAG5E,OAAQ6C,EAAc+B,EAAG/B,YAAaF,EAAYiC,EAAGjC,UACtF,GAAIkC,GAAYlC,EACZ,OAAO,EAGPgC,EADK9B,GAAeA,aAAuBT,EAChCS,EAGA,KAGnB,OAAO,EFkCKiC,CAAeP,GAIfQ,QAAQC,KAAKnF,GAHb0E,EAAKrE,MAAML,KAOvBmE,EAAWpF,UAAU3G,QAAU,SAAUgI,EAAMgF,GAC3C,IAAI1C,EAAQzE,KAEZ,OAAO,IADPmH,EAAcC,EAAeD,IACN,SAAU5K,EAAS8K,GACtC,IAAI1D,EACJA,EAAec,EAAM0B,UAAU,SAAUpH,GACrC,IACIoD,EAAKpD,GAET,MAAOgD,GACHsF,EAAOtF,GACH4B,GACAA,EAAaX,gBAGtBqE,EAAQ9K,MAGnB2J,EAAWpF,UAAUuF,WAAa,SAAUjB,GACxC,IAAIoB,EAASxG,KAAKwG,OAClB,OAAOA,GAAUA,EAAOL,UAAUf,IAEtCc,EAAWpF,UAAUwG,GAAqB,WACtC,OAAOtH,MAEXkG,EAAWpF,UAAUyG,KAAO,WAExB,IADA,IG1EsBrN,EH0ElBsN,EAAa,GACRC,EAAK,EAAGA,EAAK3C,UAAU9H,OAAQyK,IACpCD,EAAWC,GAAM3C,UAAU2C,GAE/B,OAA0B,IAAtBD,EAAWxK,OACJgD,OG/EW9F,EHiFDsN,GG7EN,IAAftN,EAAI8C,OACG9C,EAAI,GAER,SAAewN,GAClB,OAAOxN,EAAI8J,OAAO,SAAU2D,EAAM9N,GAAM,OAAOA,EAAG8N,IAAUD,IANrD/N,GH+E0BqG,OAErCkG,EAAWpF,UAAU8G,UAAY,SAAUT,GACvC,IAAI1C,EAAQzE,KAEZ,OAAO,IADPmH,EAAcC,EAAeD,IACN,SAAU5K,EAAS8K,GACtC,IAAItI,EACJ0F,EAAM0B,UAAU,SAAU3E,GAAK,OAAOzC,EAAQyC,GAAM,SAAUO,GAAO,OAAOsF,EAAOtF,IAAS,WAAc,OAAOxF,EAAQwC,QAGjImH,EAAWlM,OAAS,SAAUmM,GAC1B,OAAO,IAAID,EAAWC,IAEnBD,KAGX,SAASkB,EAAeD,GAIpB,GAHKA,IACDA,EAAc7K,UAEb6K,EACD,MAAM,IAAIpL,MAAM,yBAEpB,OAAOoL,EI9GJ,SAASzH,EAAImI,EAASC,GACzB,OAAO,SAAsBtB,GACzB,GAAuB,mBAAZqB,EACP,MAAM,IAAIE,UAAU,8DAExB,OAAOvB,EAAOF,KAAK,IAAI0B,EAAYH,EAASC,KAGpD,IAAIE,EAA6B,WAC7B,SAASA,EAAYH,EAASC,GAC1B9H,KAAK6H,QAAUA,EACf7H,KAAK8H,QAAUA,EAKnB,OAHAE,EAAYlH,UAAU4B,KAAO,SAAU0C,EAAYoB,GAC/C,OAAOA,EAAOL,UAAU,IAAI8B,EAAc7C,EAAYpF,KAAK6H,QAAS7H,KAAK8H,WAEtEE,KAGPC,EAA+B,SAAU1D,GAEzC,SAAS0D,EAAclD,EAAa8C,EAASC,GACzC,IAAIrD,EAAQF,EAAO7B,KAAK1C,KAAM+E,IAAgB/E,KAI9C,OAHAyE,EAAMoD,QAAUA,EAChBpD,EAAMyD,MAAQ,EACdzD,EAAMqD,QAAUA,GAAWrD,EACpBA,EAaX,OAnBAS,EAAkB+C,EAAe1D,GAQjC0D,EAAcnH,UAAUuE,MAAQ,SAAUtG,GACtC,IAAIoJ,EACJ,IACIA,EAASnI,KAAK6H,QAAQnF,KAAK1C,KAAK8H,QAAS/I,EAAOiB,KAAKkI,SAEzD,MAAOnG,GAEH,YADA/B,KAAK+E,YAAY3C,MAAML,GAG3B/B,KAAK+E,YAAY5C,KAAKgG,IAEnBF,GACT3D,GCDK,SAAS8D,GAAQC,EAAKC,GAIzB,YAHgB,IAAZA,IACAA,EAAU,MAEP,IAAIC,GAAe,CAAEC,OAAQ,MAAOH,IAAKA,EAAKC,QAASA,IAE3D,SAASG,GAASJ,EAAKK,EAAMJ,GAChC,OAAO,IAAIC,GAAe,CAAEC,OAAQ,OAAQH,IAAKA,EAAKK,KAAMA,EAAMJ,QAASA,IAExE,SAASK,GAAWN,EAAKC,GAC5B,OAAO,IAAIC,GAAe,CAAEC,OAAQ,SAAUH,IAAKA,EAAKC,QAASA,IAE9D,SAASM,GAAQP,EAAKK,EAAMJ,GAC/B,OAAO,IAAIC,GAAe,CAAEC,OAAQ,MAAOH,IAAKA,EAAKK,KAAMA,EAAMJ,QAASA,IAEvE,SAASO,GAAUR,EAAKK,EAAMJ,GACjC,OAAO,IAAIC,GAAe,CAAEC,OAAQ,QAASH,IAAKA,EAAKK,KAAMA,EAAMJ,QAASA,IAEhF,IAAIQ,GAA4BpJ,EAAI,SAAU8B,EAAGpB,GAAS,OAAOoB,EAAEuH,WAC5D,SAASC,GAAYX,EAAKC,GAC7B,OAAOQ,GAAY,IAAIP,GAAe,CAClCC,OAAQ,MACRH,IAAKA,EACLY,aAAc,OACdX,QAASA,KAGjB,IAAIC,GAAgC,SAAUhE,GAE1C,SAASgE,EAAeW,GACpB,IAAIzE,EAAQF,EAAO7B,KAAK1C,OAASA,KAC7BmJ,EAAU,CACVC,OAAO,EACPC,UAAW,WACP,OAAOrJ,KAAKsJ,YAtE5B,WACI,GAAIC,EAAKC,eACL,OAAO,IAAID,EAAKC,eAEf,GAAMD,EAAKE,eACZ,OAAO,IAAIF,EAAKE,eAGhB,MAAM,IAAI1N,MAAM,yCA8DkB2N,GA3D1C,WACI,GAAIH,EAAKC,eACL,OAAO,IAAID,EAAKC,eAGhB,IAAIG,OAAS,EACb,IAEI,IADA,IAAIC,EAAU,CAAC,iBAAkB,oBAAqB,sBAC7CrK,EAAI,EAAGA,EAAI,EAAGA,IACnB,IAEI,GADAoK,EAASC,EAAQrK,GACb,IAAIgK,EAAKM,cAAcF,GACvB,MAGR,MAAOtG,IAGX,OAAO,IAAIkG,EAAKM,cAAcF,GAElC,MAAOtG,GACH,MAAM,IAAItH,MAAM,oDAsCiC+N,IAEjDR,aAAa,EACbS,iBAAiB,EACjBzB,QAAS,GACTE,OAAQ,MACRS,aAAc,OACde,QAAS,GAEb,GAA4B,iBAAjBd,EACPC,EAAQd,IAAMa,OAGd,IAAK,IAAIe,KAAQf,EACTA,EAAaxI,eAAeuJ,KAC5Bd,EAAQc,GAAQf,EAAae,IAKzC,OADAxF,EAAM0E,QAAUA,EACT1E,EAKa,IAChBzK,EAWR,OA3CAkL,EAAkBqD,EAAgBhE,GA4BlCgE,EAAezH,UAAUuF,WAAa,SAAUjB,GAC5C,OAAO,IAAI8E,GAAe9E,EAAYpF,KAAKmJ,UAE/CZ,EAAevO,SACPA,EAAS,SAAUkP,GACnB,OAAO,IAAIX,EAAeW,KAEvBiB,IAAM/B,GACbpO,EAAOoQ,KAAO3B,GACdzO,EAAOqQ,OAAS1B,GAChB3O,EAAOsQ,IAAM1B,GACb5O,EAAOuQ,MAAQ1B,GACf7O,EAAOwQ,QAAUxB,GACVhP,GAEJuO,GACTrC,GAEEgE,GAAgC,SAAU3F,GAE1C,SAAS2F,EAAenF,EAAaoE,GACjC,IAAI1E,EAAQF,EAAO7B,KAAK1C,KAAM+E,IAAgB/E,KAC9CyE,EAAM0E,QAAUA,EAChB1E,EAAMgG,MAAO,EACb,IAAInC,EAAUa,EAAQb,QAAUa,EAAQb,SAAW,GAUnD,OATKa,EAAQG,aAAgB7E,EAAMiG,UAAUpC,EAAS,sBAClDA,EAAQ,oBAAsB,kBAEV7D,EAAMiG,UAAUpC,EAAS,iBACrBiB,EAAKoB,UAAYxB,EAAQT,gBAAgBa,EAAKoB,eAAqC,IAAjBxB,EAAQT,OAClGJ,EAAQ,gBAAkB,oDAE9Ba,EAAQT,KAAOjE,EAAMmG,cAAczB,EAAQT,KAAMjE,EAAMiG,UAAUvB,EAAQb,QAAS,iBAClF7D,EAAMoG,OACCpG,EAyLX,OAxMAS,EAAkBgF,EAAgB3F,GAiBlC2F,EAAepJ,UAAUqB,KAAO,SAAUkB,GACtCrD,KAAKyK,MAAO,EACZ,IACItC,EADW2C,EAAN9K,KAAe8K,IAAK3B,EAApBnJ,KAAiCmJ,QAASpE,EAA1C/E,KAA2D+E,YAEpE,IACIoD,EAAS,IAAI4C,GAAa1H,EAAGyH,EAAK3B,GAEtC,MAAOpH,GACH,OAAOgD,EAAY3C,MAAML,GAE7BgD,EAAY5C,KAAKgG,IAErB+B,EAAepJ,UAAU+J,KAAO,WAC5B,IAAe1B,EAANnJ,KAAmBmJ,QAAS6B,EAA5BhL,KAAoCmJ,QAAS8B,EAAOD,EAAGC,KAAMzC,EAASwC,EAAGxC,OAAQH,EAAM2C,EAAG3C,IAAKe,EAAQ4B,EAAG5B,MAAO8B,EAAWF,EAAGE,SAAU5C,EAAU0C,EAAG1C,QAASI,EAAOsC,EAAGtC,KAClL,IACI,IAAIoC,EAAM9K,KAAK8K,IAAM3B,EAAQE,YAC7BrJ,KAAKmL,YAAYL,EAAK3B,GAClB8B,EACAH,EAAIM,KAAK5C,EAAQH,EAAKe,EAAO6B,EAAMC,GAGnCJ,EAAIM,KAAK5C,EAAQH,EAAKe,GAEtBA,IACA0B,EAAId,QAAUb,EAAQa,QACtBc,EAAI7B,aAAeE,EAAQF,cAE3B,oBAAqB6B,IACrBA,EAAIf,kBAAoBZ,EAAQY,iBAEpC/J,KAAKqL,WAAWP,EAAKxC,GACjBI,EACAoC,EAAID,KAAKnC,GAGToC,EAAID,OAGZ,MAAO9I,GACH/B,KAAKoC,MAAML,KAGnBmI,EAAepJ,UAAU8J,cAAgB,SAAUlC,EAAM4C,GACrD,IAAK5C,GAAwB,iBAATA,EAChB,OAAOA,EAEN,GAAIa,EAAKoB,UAAYjC,aAAgBa,EAAKoB,SAC3C,OAAOjC,EAEX,GAAI4C,EAAa,CACb,IAAIC,EAAaD,EAAYjL,QAAQ,MACjB,IAAhBkL,IACAD,EAAcA,EAAYE,UAAU,EAAGD,IAG/C,OAAQD,GACJ,IAAK,oCACD,OAAOvR,OAAO0R,KAAK/C,GAAMhJ,IAAI,SAAU7B,GAAO,OAAO6N,mBAAmB7N,GAAO,IAAM6N,mBAAmBhD,EAAK7K,MAAUgF,KAAK,KAChI,IAAK,mBACD,OAAO8I,KAAKC,UAAUlD,GAC1B,QACI,OAAOA,IAGnBwB,EAAepJ,UAAUuK,WAAa,SAAUP,EAAKxC,GACjD,IAAK,IAAIzK,KAAOyK,EACRA,EAAQ5H,eAAe7C,IACvBiN,EAAIe,iBAAiBhO,EAAKyK,EAAQzK,KAI9CqM,EAAepJ,UAAU4J,UAAY,SAAUpC,EAASwD,GACpD,IAAK,IAAIjO,KAAOyK,EACZ,GAAIzK,EAAIkO,gBAAkBD,EAAWC,cACjC,OAAOzD,EAAQzK,IAK3BqM,EAAepJ,UAAUqK,YAAc,SAAUL,EAAK3B,GAClD,IAAI6C,EAAqB7C,EAAQ6C,mBACjC,SAASC,EAAW5I,GAChB,IAIIjB,EAJA0E,EAAKmF,EAAY7G,EAAa0B,EAAG1B,WAAY4G,EAAqBlF,EAAGkF,mBAAoB7C,EAAUrC,EAAGqC,QACtG6C,GACAA,EAAmB5J,MAAMiB,GAG7B,IACIjB,EAAQ,IAAI8J,GAAiBlM,KAAMmJ,GAEvC,MAAOpH,GACHK,EAAQL,EAEZqD,EAAWhD,MAAMA,GAMrB,GAJA0I,EAAIqB,UAAYF,EAChBA,EAAW9C,QAAUA,EACrB8C,EAAW7G,WAAapF,KACxBiM,EAAWD,mBAAqBA,EAC5BlB,EAAIsB,QAAU,oBAAqBtB,EAAK,CAEpC,IAAIuB,EAaJC,EAdJ,GAAIN,EAEAK,EAAgB,SAAUhJ,GACGgJ,EAAcL,mBACpB7J,KAAKkB,IAExBkG,EAAKE,eACLqB,EAAIyB,WAAaF,EAGjBvB,EAAIsB,OAAOG,WAAaF,EAE5BA,EAAcL,mBAAqBA,EAGvCM,EAAa,SAAUjJ,GACnB,IAIIjB,EAJA0E,EAAKwF,EAAYN,EAAqBlF,EAAGkF,mBAAoB5G,EAAa0B,EAAG1B,WAAY+D,EAAUrC,EAAGqC,QACtG6C,GACAA,EAAmB5J,MAAMiB,GAG7B,IACIjB,EAAQ,IAAIoK,GAAU,aAAcxM,KAAMmJ,GAE9C,MAAOpH,GACHK,EAAQL,EAEZqD,EAAWhD,MAAMA,IAErB0I,EAAI2B,QAAUH,EACdA,EAAWnD,QAAUA,EACrBmD,EAAWlH,WAAapF,KACxBsM,EAAWN,mBAAqBA,EAEpC,SAASU,EAAoBrJ,IAO7B,SAASsJ,EAAQtJ,GACb,IAAIyD,EAAK6F,EAASvH,EAAa0B,EAAG1B,WAAY4G,EAAqBlF,EAAGkF,mBAAoB7C,EAAUrC,EAAGqC,QACvG,GAAwB,IAApBnJ,KAAK4M,WAAkB,CACvB,IAAIC,EAA2B,OAAhB7M,KAAK8M,OAAkB,IAAM9M,KAAK8M,OAC7C/D,EAAkC,SAAtB/I,KAAKiJ,aAA2BjJ,KAAK+I,UAAY/I,KAAK+M,aAAgB/M,KAAK+I,SAI3F,GAHiB,IAAb8D,IACAA,EAAW9D,EAAW,IAAM,GAE5B8D,EAAW,IACPb,GACAA,EAAmB3J,WAEvB+C,EAAWjD,KAAKkB,GAChB+B,EAAW/C,eAEV,CACG2J,GACAA,EAAmB5J,MAAMiB,GAE7B,IAAIjB,OAAQ,EACZ,IACIA,EAAQ,IAAIoK,GAAU,cAAgBK,EAAU7M,KAAMmJ,GAE1D,MAAOpH,GACHK,EAAQL,EAEZqD,EAAWhD,MAAMA,KA9B7B0I,EAAIkC,mBAAqBN,EACzBA,EAAoBtH,WAAapF,KACjC0M,EAAoBV,mBAAqBA,EACzCU,EAAoBvD,QAAUA,EA+B9B2B,EAAImC,OAASN,EACbA,EAAQvH,WAAapF,KACrB2M,EAAQX,mBAAqBA,EAC7BW,EAAQxD,QAAUA,GAEtBe,EAAepJ,UAAUkC,YAAc,WACnC,IAAeyH,EAANzK,KAAgByK,KAAMK,EAAtB9K,KAA+B8K,KACnCL,GAAQK,GAA0B,IAAnBA,EAAI8B,YAAyC,mBAAd9B,EAAIoC,OACnDpC,EAAIoC,QAER3I,EAAOzD,UAAUkC,YAAYN,KAAK1C,OAE/BkK,GACT5F,GAEEyG,GAA8B,WAS9B,OARA,SAAsBoC,EAAerC,EAAK3B,GACtCnJ,KAAKmN,cAAgBA,EACrBnN,KAAK8K,IAAMA,EACX9K,KAAKmJ,QAAUA,EACfnJ,KAAK8M,OAAShC,EAAIgC,OAClB9M,KAAKiJ,aAAe6B,EAAI7B,cAAgBE,EAAQF,aAChDjJ,KAAK+I,SAAWqE,GAAiBpN,KAAKiJ,aAAc6B,OAK5D,SAASuC,GAAc1K,EAASmI,EAAK3B,GASjC,OARApN,MAAM2G,KAAK1C,MACXA,KAAK2C,QAAUA,EACf3C,KAAK5E,KAAO,YACZ4E,KAAK8K,IAAMA,EACX9K,KAAKmJ,QAAUA,EACfnJ,KAAK8M,OAAShC,EAAIgC,OAClB9M,KAAKiJ,aAAe6B,EAAI7B,cAAgBE,EAAQF,aAChDjJ,KAAK+I,SAAWqE,GAAiBpN,KAAKiJ,aAAc6B,GAC7C9K,KAEXqN,GAAcvM,UAA0B/G,OAAOC,OAAO+B,MAAM+E,WACrD,IAAI0L,GAAYa,GASvB,SAASD,GAAiBnE,EAAc6B,GACpC,OAAQ7B,GACJ,IAAK,OACD,OAXZ,SAAmB6B,GACf,MAAI,aAAcA,EACPA,EAAI7B,aAAe6B,EAAI/B,SAAW4C,KAAK2B,MAAMxC,EAAI/B,UAAY+B,EAAIiC,cAAgB,QAGjFpB,KAAK2B,MAAMxC,EAAIiC,cAAgB,QAM3BQ,CAAUzC,GACrB,IAAK,MACD,OAAOA,EAAI0C,YACf,IAAK,OACL,QACI,MAAQ,aAAc1C,EAAOA,EAAI/B,SAAW+B,EAAIiC,cAQrD,IAAIb,GALX,SAA8BpB,EAAK3B,GAG/B,OAFAqD,GAAU9J,KAAK1C,KAAM,eAAgB8K,EAAK3B,GAC1CnJ,KAAK5E,KAAO,mBACL4E,MC7WAyN,GAAOlF,GAAevO,OCC7B0T,GAAiC,SAAUnJ,GAE3C,SAASmJ,IACL,OAAkB,OAAXnJ,GAAmBA,EAAOoJ,MAAM3N,KAAM8E,YAAc9E,KAW/D,OAbAkF,EAAkBwI,EAAiBnJ,GAInCmJ,EAAgB5M,UAAU8M,WAAa,SAAUC,EAAYC,EAAYC,EAAYC,EAAYC,GAC7FjO,KAAK+E,YAAY5C,KAAK2L,IAE1BJ,EAAgB5M,UAAUoN,YAAc,SAAU9L,EAAO6L,GACrDjO,KAAK+E,YAAY3C,MAAMA,IAE3BsL,EAAgB5M,UAAUqN,eAAiB,SAAUF,GACjDjO,KAAK+E,YAAY1C,YAEdqL,GACTpJ,GCfE8J,GAAiC,SAAU7J,GAE3C,SAAS6J,EAAgBpI,EAAQ6H,EAAYE,GACzC,IAAItJ,EAAQF,EAAO7B,KAAK1C,OAASA,KAKjC,OAJAyE,EAAMuB,OAASA,EACfvB,EAAMoJ,WAAaA,EACnBpJ,EAAMsJ,WAAaA,EACnBtJ,EAAMrE,MAAQ,EACPqE,EAaX,OApBAS,EAAkBkJ,EAAiB7J,GASnC6J,EAAgBtN,UAAUuE,MAAQ,SAAUtG,GACxCiB,KAAKgG,OAAO4H,WAAW5N,KAAK6N,WAAY9O,EAAOiB,KAAK+N,WAAY/N,KAAKI,QAASJ,OAElFoO,EAAgBtN,UAAUwE,OAAS,SAAUlD,GACzCpC,KAAKgG,OAAOkI,YAAY9L,EAAOpC,MAC/BA,KAAKgD,eAEToL,EAAgBtN,UAAUyE,UAAY,WAClCvF,KAAKgG,OAAOmI,eAAenO,MAC3BA,KAAKgD,eAEFoL,GACT9J,GCxBS+J,GAAmB,SAAUC,GACpC,OAAO,SAAUlJ,GACb,IAAK,IAAI7F,EAAI,EAAGgE,EAAM+K,EAAMtR,OAAQuC,EAAIgE,IAAQ6B,EAAWlD,OAAQ3C,IAC/D6F,EAAWjD,KAAKmM,EAAM/O,IAE1B6F,EAAW/C,aCLZ,SAASkM,KACZ,MAAsB,mBAAXpK,QAA0BA,OAAOqK,SAGrCrK,OAAOqK,SAFH,aAIR,IAAIA,GAAyBD,KCNzBE,YAAyBjN,GAAK,OAAOA,GAAyB,iBAAbA,EAAExE,QAAoC,mBAANwE,GCArF,SAASkN,GAAU3P,GACtB,QAASA,GAAoC,mBAApBA,EAAMoH,WAAkD,mBAAfpH,EAAMjB,KCQrE,IAAI6Q,GAAc,SAAUxG,GAC/B,GAAMA,GAA+C,mBAA9BA,EAAOb,GAC1B,OCVqCsH,EDURzG,ECT1B,SAAU/C,GACb,IAAIyJ,EAAMD,EAAItH,KACd,GAA6B,mBAAlBuH,EAAI1I,UACX,MAAM,IAAI4B,UAAU,kEAGpB,OAAO8G,EAAI1I,UAAUf,IDKxB,GAAIqJ,GAAYtG,GACjB,OAAOkG,GAAiBlG,GAEvB,GAAIuG,GAAUvG,GACf,OEhBkC2G,EFgBR3G,EEfvB,SAAU/C,GAQb,OAPA0J,EAAQhR,KAAK,SAAUiB,GACdqG,EAAWlD,SACZkD,EAAWjD,KAAKpD,GAChBqG,EAAW/C,aAEhB,SAAUN,GAAO,OAAOqD,EAAWhD,MAAML,KACvCjE,KAAK,KAAMgE,GACTsD,GFSN,GAAM+C,GAA6C,mBAA5BA,EAAO4G,IAC/B,OGnBmCC,EHmBR7G,EGlBxB,SAAU/C,GAEb,IADA,IAAIoJ,EAAWQ,EAASD,QACrB,CACC,IAAIE,EAAOT,EAASrM,OACpB,GAAI8M,EAAKxE,KAAM,CACXrF,EAAW/C,WACX,MAGJ,GADA+C,EAAWjD,KAAK8M,EAAKlQ,OACjBqG,EAAWlD,OACX,MAUR,MAP+B,mBAApBsM,EAASU,QAChB9J,EAAW9H,IAAI,WACPkR,EAASU,QACTV,EAASU,WAId9J,GHCP,IGtBmC4J,EDADF,EDAGF,EDsBjC7P,EAAQwD,EAAS4F,GAAU,oBAAsB,IAAMA,EAAS,IAGpE,MAAM,IAAIJ,UAFA,gBAAkBhJ,EAAQ,8FIxBrC,SAASoQ,GAAYpQ,GACxB,OAAOA,GAAmC,mBAAnBA,EAAMqQ,SCC1B,SAASC,GAAc3H,EAAO4H,GACjC,OAAO,IAAIpJ,EAAW,SAAUd,GAC5B,IAAI5B,EAAM,IAAIT,EACVxD,EAAI,EAWR,OAVAiE,EAAIlG,IAAIgS,EAAUF,SAAS,WACnB7P,IAAMmI,EAAM1K,QAIhBoI,EAAWjD,KAAKuF,EAAMnI,MACjB6F,EAAWlD,QACZsB,EAAIlG,IAAI0C,KAAKoP,aALbhK,EAAW/C,cAQZmB,ICRR,SAAS+L,GAAU7H,EAAO4H,GAC7B,GAAa,MAAT5H,EAAe,CACf,GCTD,SAA6