Merge pull request #96 from automicus/master

Added support for ISY994 Insteon and X10 Controller (and other updates)
This commit is contained in:
Paulus Schoutsen committed 2015-04-22 21:37:32 -07:00
commit 1dd26fcd73
21 files changed
+629 -31

No files matched your search

+5
View File
@@ -30,6 +30,11 @@ omit =
homeassistant/components/device_tracker/ddwrt.py
homeassistant/components/sensor/transmission.py
homeassistant/components/isy994.py
homeassistant/components/light/isy994.py
homeassistant/components/switch/isy994.py
homeassistant/components/sensor/isy994.py
[report]
# Regexes for lines to exclude from consideration
+16
View File
@@ -27,9 +27,25 @@ A state can have several attributes that will help the frontend in displaying yo
- `friendly_name`: this name will be used as the name of the device
- `entity_picture`: this picture will be shown instead of the domain icon
- `unit_of_measurement`: this will be appended to the state in the interface
- `hidden`: This is a suggestion to the frontend on if the state should be hidden
These attributes are defined in [homeassistant.components](https://github.com/balloob/home-assistant/blob/master/homeassistant/components/__init__.py#L25).
## Proper Visibility Handling ##
Generally, when creating a new entity for Home Assistant you will want it to be a class that inherits the [homeassistant.helpers.entity.Entity](https://github.com/balloob/home-assistant/blob/master/homeassistant/helpers/entity.py] Class. If this is done, visibility will be handled for you.
You can set a suggestion for your entitie's visibility by setting the hidden property by doing something similar to the following.
```python
self.hidden = True
```
This will SUGGEST that the active frontend hide the entity. This requires that the active frontend support hidden cards (the default frontend does) and that the value of hidden be included in your attributes dictionary (see above). The Entity abstract class will take care of this for you.
Remember: The suggestion set by your component's code will always be overwritten by manual settings in the configuration.yaml file. This is why you may set hidden to be False, but the property may remain True (or vice-versa).
If you would not like to use the Entity Abstract Class, you may also inherity the Visibility Abstract Class which will include the logic for the hidden property but not automatically add the hidden property to the attributes dictionary. If you use this class, ensure that your class correctly adds the hidden property to the attributes.
## Working on the frontend
The frontend is composed of Polymer web-components and compiled into the file `frontend.html`. During development you do not want to work with the compiled version but with the seperate files. To have Home Assistant serve the seperate files, set `development=1` for the http-component in your config.
+3
View File
@@ -20,6 +20,7 @@ import homeassistant
import homeassistant.loader as loader
import homeassistant.components as core_components
import homeassistant.components.group as group
from homeassistant.helpers.entity import VisibilityABC
from homeassistant.const import (
EVENT_COMPONENT_LOADED, CONF_LATITUDE, CONF_LONGITUDE,
CONF_TEMPERATURE_UNIT, CONF_NAME, CONF_TIME_ZONE, TEMP_CELCIUS,
@@ -207,6 +208,8 @@ def process_ha_core_config(hass, config):
if key in config:
setattr(hass.config, attr, config[key])
VisibilityABC.visibility.update(config.get('visibility', {}))
if CONF_TEMPERATURE_UNIT in config:
unit = config[CONF_TEMPERATURE_UNIT]
@@ -15,8 +15,8 @@
<link rel='shortcut icon' href='/static/favicon.ico' />
<link rel='icon' type='image/png'
href='/static/favicon-192x192.png' sizes='192x192'>
<link rel='apple-touch-icon' sizes='180x180'
href='/apple-icon-180x180.png'>
<link rel='apple-touch-icon' sizes='192x192'
href='/static/favicon-192x192.png'>
<meta name='theme-color' content='#03a9f4'>
</head>
<body fullbleed>
+1 -1
View File
@@ -1,2 +1,2 @@
""" DO NOT MODIFY. Auto-generated by build_frontend script """
VERSION = "b432551a6704deb437aac61cdecef864"
VERSION = "e7801905cc2ea1ee349ec199604fb984"
@@ -11,12 +11,11 @@ window.PolymerGestures={},function(a){var b=!1,c=document.createElement("meta");
LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",ObjectExpression:"ObjectExpression",Program:"Program",Property:"Property",ThisExpression:"ThisExpression",UnaryExpression:"UnaryExpression"},V={UnexpectedToken:"Unexpected token %0",UnknownLabel:"Undefined label '%0'",Redeclaration:"%0 '%1' has already been declared"};var ab=H,bb=L;a.esprima={parse:R}}(this),function(a){"use strict";function b(a,b,d,e){var f;try{if(f=c(a),f.scopeIdent&&(d.nodeType!==Node.ELEMENT_NODE||"TEMPLATE"!==d.tagName||"bind"!==b&&"repeat"!==b))throw Error("as and in can only be used within <template bind/repeat>")}catch(g){return void console.error("Invalid expression syntax: "+a,g)}return function(a,b,c){var d=f.getBinding(a,e,c);return f.scopeIdent&&d&&(b.polymerExpressionScopeIdent_=f.scopeIdent,f.indexIdent&&(b.polymerExpressionIndexIdent_=f.indexIdent)),d}}function c(a){var b=q[a];if(!b){var c=new j;esprima.parse(a,c),b=new l(c),q[a]=b}return b}function d(a){this.value=a,this.valueFn_=void 0}function e(a){this.name=a,this.path=Path.get(a)}function f(a,b,c){this.computed="["==c,this.dynamicDeps="function"==typeof a||a.dynamicDeps||this.computed&&!(b instanceof d),this.simplePath=!this.dynamicDeps&&(b instanceof e||b instanceof d)&&(a instanceof f||a instanceof e),this.object=this.simplePath?a:i(a),this.property=!this.computed||this.simplePath?b:i(b)}function g(a,b){this.name=a,this.args=[];for(var c=0;c<b.length;c++)this.args[c]=i(b[c])}function h(){throw Error("Not Implemented")}function i(a){return"function"==typeof a?a:a.valueFn()}function j(){this.expression=null,this.filters=[],this.deps={},this.currentPath=void 0,this.scopeIdent=void 0,this.indexIdent=void 0,this.dynamicDeps=!1}function k(a){this.value_=a}function l(a){if(this.scopeIdent=a.scopeIdent,this.indexIdent=a.indexIdent,!a.expression)throw Error("No expression found.");this.expression=a.expression,i(this.expression),this.filters=a.filters,this.dynamicDeps=a.dynamicDeps}function m(a){return String(a).replace(/[A-Z]/g,function(a){return"-"+a.toLowerCase()})}function n(a,b){for(;a[t]&&!Object.prototype.hasOwnProperty.call(a,b);)a=a[t];return a}function o(a){switch(a){case"":return!1;case"false":case"null":case"true":return!0}return isNaN(Number(a))?!1:!0}function p(){}var q=Object.create(null);d.prototype={valueFn:function(){if(!this.valueFn_){var a=this.value;this.valueFn_=function(){return a}}return this.valueFn_}},e.prototype={valueFn:function(){if(!this.valueFn_){var a=(this.name,this.path);this.valueFn_=function(b,c){return c&&c.addPath(b,a),a.getValueFrom(b)}}return this.valueFn_},setValue:function(a,b){return 1==this.path.length&&(a=n(a,this.path[0])),this.path.setValueFrom(a,b)}},f.prototype={get fullPath(){if(!this.fullPath_){var a=this.object instanceof f?this.object.fullPath.slice():[this.object.name];a.push(this.property instanceof e?this.property.name:this.property.value),this.fullPath_=Path.get(a)}return this.fullPath_},valueFn:function(){if(!this.valueFn_){var a=this.object;if(this.simplePath){var b=this.fullPath;this.valueFn_=function(a,c){return c&&c.addPath(a,b),b.getValueFrom(a)}}else if(this.computed){var c=this.property;this.valueFn_=function(b,d,e){var f=a(b,d,e),g=c(b,d,e);return d&&d.addPath(f,[g]),f?f[g]:void 0}}else{var b=Path.get(this.property.name);this.valueFn_=function(c,d,e){var f=a(c,d,e);return d&&d.addPath(f,b),b.getValueFrom(f)}}}return this.valueFn_},setValue:function(a,b){if(this.simplePath)return this.fullPath.setValueFrom(a,b),b;var c=this.object(a),d=this.property instanceof e?this.property.name:this.property(a);return c[d]=b}},g.prototype={transform:function(a,b,c,d,e){var f=a,g=f[this.name];if(!g&&(g=c[this.name],!g))return void console.error("Cannot find function or filter: "+this.name);if(d?g=g.toModel:"function"==typeof g.toDOM&&(g=g.toDOM),"function"!=typeof g)return void console.error("Cannot find function or filter: "+this.name);for(var h=e||[],j=0;j<this.args.length;j++)h.push(i(this.args[j])(a,b,c));return g.apply(f,h)}};var r={"+":function(a){return+a},"-":function(a){return-a},"!":function(a){return!a}},s={"+":function(a,b){return a+b},"-":function(a,b){return a-b},"*":function(a,b){return a*b},"/":function(a,b){return a/b},"%":function(a,b){return a%b},"<":function(a,b){return b>a},">":function(a,b){return a>b},"<=":function(a,b){return b>=a},">=":function(a,b){return a>=b},"==":function(a,b){return a==b},"!=":function(a,b){return a!=b},"===":function(a,b){return a===b},"!==":function(a,b){return a!==b},"&&":function(a,b){return a&&b},"||":function(a,b){return a||b}};j.prototype={createUnaryExpression:function(a,b){if(!r[a])throw Error("Disallowed operator: "+a);return b=i(b),function(c,d,e){return r[a](b(c,d,e))}},createBinaryExpression:function(a,b,c){if(!s[a])throw Error("Disallowed operator: "+a);switch(b=i(b),c=i(c),a){case"||":return this.dynamicDeps=!0,function(a,d,e){return b(a,d,e)||c(a,d,e)};case"&&":return this.dynamicDeps=!0,function(a,d,e){return b(a,d,e)&&c(a,d,e)}}return functiLine truncated
if(this.removeAttribute("value"),c)return j(this,"value",b);var e=b,f=m(this,"value",e);return j(this,"value",e.open(k(this,"value",d))),t(this,a,f)},HTMLOptionElement.prototype.bind=function(a,b,c){if("value"!==a)return HTMLElement.prototype.bind.call(this,a,b,c);if(this.removeAttribute("value"),c)return q(this,b);var d=b,e=m(this,"value",d);return q(this,d.open(r(this))),t(this,a,e)},HTMLSelectElement.prototype.bind=function(a,c,d){if("selectedindex"===a&&(a="selectedIndex"),"selectedIndex"!==a&&"value"!==a)return HTMLElement.prototype.bind.call(this,a,c,d);if(this.removeAttribute(a),d)return j(this,a,c);var e=c,f=m(this,a,e);return j(this,a,e.open(k(this,a))),b(this,a,f)}}(this),function(a){"use strict";function b(a){if(!a)throw new Error("Assertion failed")}function c(a){for(var b;b=a.parentNode;)a=b;return a}function d(a,b){if(b){for(var d,e="#"+b;!d&&(a=c(a),a.protoContent_?d=a.protoContent_.querySelector(e):a.getElementById&&(d=a.getElementById(b)),!d&&a.templateCreator_);)a=a.templateCreator_;return d}}function e(a){return"template"==a.tagName&&"http://www.w3.org/2000/svg"==a.namespaceURI}function f(a){return"TEMPLATE"==a.tagName&&"http://www.w3.org/1999/xhtml"==a.namespaceURI}function g(a){return Boolean(L[a.tagName]&&a.hasAttribute("template"))}function h(a){return void 0===a.isTemplate_&&(a.isTemplate_="TEMPLATE"==a.tagName||g(a)),a.isTemplate_}function i(a,b){var c=a.querySelectorAll(N);h(a)&&b(a),G(c,b)}function j(a){function b(a){HTMLTemplateElement.decorate(a)||j(a.content)}i(a,b)}function k(a,b){Object.getOwnPropertyNames(b).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))})}function l(a){var b=a.ownerDocument;if(!b.defaultView)return b;var c=b.templateContentsOwner_;if(!c){for(c=b.implementation.createHTMLDocument("");c.lastChild;)c.removeChild(c.lastChild);b.templateContentsOwner_=c}return c}function m(a){if(!a.stagingDocument_){var b=a.ownerDocument;if(!b.stagingDocument_){b.stagingDocument_=b.implementation.createHTMLDocument(""),b.stagingDocument_.isStagingDocument=!0;var c=b.stagingDocument_.createElement("base");c.href=document.baseURI,b.stagingDocument_.head.appendChild(c),b.stagingDocument_.stagingDocument_=b.stagingDocument_}a.stagingDocument_=b.stagingDocument_}return a.stagingDocument_}function n(a){var b=a.ownerDocument.createElement("template");a.parentNode.insertBefore(b,a);for(var c=a.attributes,d=c.length;d-->0;){var e=c[d];K[e.name]&&("template"!==e.name&&b.setAttribute(e.name,e.value),a.removeAttribute(e.name))}return b}function o(a){var b=a.ownerDocument.createElement("template");a.parentNode.insertBefore(b,a);for(var c=a.attributes,d=c.length;d-->0;){var e=c[d];b.setAttribute(e.name,e.value),a.removeAttribute(e.name)}return a.parentNode.removeChild(a),b}function p(a,b,c){var d=a.content;if(c)return void d.appendChild(b);for(var e;e=b.firstChild;)d.appendChild(e)}function q(a){P?a.__proto__=HTMLTemplateElement.prototype:k(a,HTMLTemplateElement.prototype)}function r(a){a.setModelFn_||(a.setModelFn_=function(){a.setModelFnScheduled_=!1;var b=z(a,a.delegate_&&a.delegate_.prepareBinding);w(a,b,a.model_)}),a.setModelFnScheduled_||(a.setModelFnScheduled_=!0,Observer.runEOM_(a.setModelFn_))}function s(a,b,c,d){if(a&&a.length){for(var e,f=a.length,g=0,h=0,i=0,j=!0;f>h;){var g=a.indexOf("{{",h),k=a.indexOf("[[",h),l=!1,m="}}";if(k>=0&&(0>g||g>k)&&(g=k,l=!0,m="]]"),i=0>g?-1:a.indexOf(m,g+2),0>i){if(!e)return;e.push(a.slice(h));break}e=e||[],e.push(a.slice(h,g));var n=a.slice(g+2,i).trim();e.push(l),j=j&&l;var o=d&&d(n,b,c);e.push(null==o?Path.get(n):null),e.push(o),h=i+2}return h===f&&e.push(""),e.hasOnePath=5===e.length,e.isSimplePath=e.hasOnePath&&""==e[0]&&""==e[4],e.onlyOneTime=j,e.combinator=function(a){for(var b=e[0],c=1;c<e.length;c+=4){var d=e.hasOnePath?a:a[(c-1)/4];void 0!==d&&(b+=d),b+=e[c+3]}return b},e}}function t(a,b,c,d){if(b.hasOnePath){var e=b[3],f=e?e(d,c,!0):b[2].getValueFrom(d);return b.isSimplePath?f:b.combinator(f)}for(var g=[],h=1;h<b.length;h+=4){var e=b[h+2];g[(h-1)/4]=e?e(d,c):b[h+1].getValueFrom(d)}return b.combinator(g)}function u(a,b,c,d){var e=b[3],f=e?e(d,c,!1):new PathObserver(d,b[2]);return b.isSimplePath?f:new ObserverTransform(f,b.combinator)}function v(a,b,c,d){if(b.onlyOneTime)return t(a,b,c,d);if(b.hasOnePath)return u(a,b,c,d);for(var e=new CompoundObserver,f=1;f<b.length;f+=4){var g=b[f],h=b[f+2];if(h){var i=h(d,c,g);g?e.addPath(i):e.addObserver(i)}else{var j=b[f+1];g?e.addPath(j.getValueFrom(d)):e.addPath(d,j)}}return new ObserverTransform(e,b.combinator)}function w(a,b,c,d){for(var e=0;e<b.length;e+=2){var f=b[e],g=b[e+1],h=v(f,g,a,c),i=a.bind(f,h,g.onlyOneTime);i&&d&&d.push(i)}if(a.bindFinished(),b.isTemplate){a.model_=c;var j=a.processBindingDirectives_(b);d&&j&&d.push(j)}}function x(a,b,c){var d=a.getAttribute(b);return s(""==d?"{{}}":d,b,a,c)}function y(a,c){b(a);for(var d=[],e=0;e<a.attributes.length;e++){for(var f=a.attributes[e],g=f.name,i=f.value;"_"===g[0];)g=g.substring(1);if(!h(a)||g!==J&&g!==H&Line truncated
b&&b.classList.remove(c),a&&a.classList.add(c)},injectBoundHTML:function(a,b){var c=document.createElement("template");c.innerHTML=a;var d=this.instanceTemplate(c);return b&&(b.textContent="",b.appendChild(d)),d}},c=function(){},d={};b.asyncMethod=b.async,a.api.instance.utils=b,a.nop=c,a.nob=d}(Polymer),function(a){var b=window.WebComponents?WebComponents.flags.log:{},c="on-",d={EVENT_PREFIX:c,addHostListeners:function(){var a=this.eventDelegates;b.events&&Object.keys(a).length>0&&console.log("[%s] addHostListeners:",this.localName,a);for(var c in a){var d=a[c];PolymerGestures.addEventListener(this,c,this.element.getEventHandler(this,this,d))}},dispatchMethod:function(a,c,d){if(a){b.events&&console.group("[%s] dispatch [%s]",a.localName,c);var e="function"==typeof c?c:a[c];e&&e[d?"apply":"call"](a,d),b.events&&console.groupEnd(),Polymer.flush()}}};a.api.instance.events=d,a.addEventListener=function(a,b,c,d){PolymerGestures.addEventListener(wrap(a),b,c,d)},a.removeEventListener=function(a,b,c,d){PolymerGestures.removeEventListener(wrap(a),b,c,d)}}(Polymer),function(a){var b={copyInstanceAttributes:function(){var a=this._instanceAttributes;for(var b in a)this.hasAttribute(b)||this.setAttribute(b,a[b])},takeAttributes:function(){if(this._publishLC)for(var a,b=0,c=this.attributes,d=c.length;(a=c[b])&&d>b;b++)this.attributeToProperty(a.name,a.value)},attributeToProperty:function(b,c){var b=this.propertyForAttribute(b);if(b){if(c&&c.search(a.bindPattern)>=0)return;var d=this[b],c=this.deserializeValue(c,d);c!==d&&(this[b]=c)}},propertyForAttribute:function(a){var b=this._publishLC&&this._publishLC[a];return b},deserializeValue:function(b,c){return a.deserializeValue(b,c)},serializeValue:function(a,b){return"boolean"===b?a?"":void 0:"object"!==b&&"function"!==b&&void 0!==a?a:void 0},reflectPropertyToAttribute:function(a){var b=typeof this[a],c=this.serializeValue(this[a],b);void 0!==c?this.setAttribute(a,c):"boolean"===b&&this.removeAttribute(a)}};a.api.instance.attributes=b}(Polymer),function(a){function b(a,b){return a===b?0!==a||1/a===1/b:f(a)&&f(b)?!0:a!==a&&b!==b}function c(a,b){return void 0===b&&null===a?b:null===b||void 0===b?a:b}var d=window.WebComponents?WebComponents.flags.log:{},e={object:void 0,type:"update",name:void 0,oldValue:void 0},f=Number.isNaN||function(a){return"number"==typeof a&&isNaN(a)},g={createPropertyObserver:function(){var a=this._observeNames;if(a&&a.length){var b=this._propertyObserver=new CompoundObserver(!0);this.registerObserver(b);for(var c,d=0,e=a.length;e>d&&(c=a[d]);d++)b.addPath(this,c),this.observeArrayValue(c,this[c],null)}},openPropertyObserver:function(){this._propertyObserver&&this._propertyObserver.open(this.notifyPropertyChanges,this)},notifyPropertyChanges:function(a,b,c){var d,e,f={};for(var g in b)if(d=c[2*g+1],e=this.observe[d]){var h=b[g],i=a[g];this.observeArrayValue(d,i,h),f[e]||(void 0!==h&&null!==h||void 0!==i&&null!==i)&&(f[e]=!0,this.invokeMethod(e,[h,i,arguments]))}},invokeMethod:function(a,b){var c=this[a]||a;"function"==typeof c&&c.apply(this,b)},deliverChanges:function(){this._propertyObserver&&this._propertyObserver.deliver()},observeArrayValue:function(a,b,c){var e=this.observe[a];if(e&&(Array.isArray(c)&&(d.observe&&console.log("[%s] observeArrayValue: unregister observer [%s]",this.localName,a),this.closeNamedObserver(a+"__array")),Array.isArray(b))){d.observe&&console.log("[%s] observeArrayValue: register observer [%s]",this.localName,a,b);var f=new ArrayObserver(b);f.open(function(a){this.invokeMethod(e,[a])},this),this.registerNamedObserver(a+"__array",f)}},emitPropertyChangeRecord:function(a,c,d){if(!b(c,d)&&(this._propertyChanged(a,c,d),Observer.hasObjectObserve)){var f=this._objectNotifier;f||(f=this._objectNotifier=Object.getNotifier(this)),e.object=this,e.name=a,e.oldValue=d,f.notify(e)}},_propertyChanged:function(a){this.reflect[a]&&this.reflectPropertyToAttribute(a)},bindProperty:function(a,b,d){if(d)return void(this[a]=b);var e=this.element.prototype.computed;if(e&&e[a]){var f=a+"ComputedBoundObservable_";return void(this[f]=b)}return this.bindToAccessor(a,b,c)},bindToAccessor:function(a,c,d){function e(b,c){j[f]=b;var d=j[h];d&&"function"==typeof d.setValue&&d.setValue(b),j.emitPropertyChangeRecord(a,b,c)}var f=a+"_",g=a+"Observable_",h=a+"ComputedBoundObservable_";this[g]=c;var i=this[f],j=this,k=c.open(e);if(d&&!b(i,k)){var l=d(i,k);b(k,l)||(k=l,c.setValue&&c.setValue(k))}e(k,i);var m={close:function(){c.close(),j[g]=void 0,j[h]=void 0}};return this.registerObserver(m),m},createComputedProperties:function(){if(this._computedNames)for(var a=0;a<this._computedNames.length;a++){var b=this._computedNames[a],c=this.computed[b];try{var d=PolymerExpressions.getExpression(c),e=d.getBinding(this,this.element.syntax);this.bindToAccessor(b,e)}catch(f){console.error("Failed to create computed property",f)}}},registerObserver:function(a){return this._observers?void this._observers.push(a):void(this._observers=[a])},closeObservers:function(){if(thiLine truncated
return this._iter.contains(t)},ft.prototype.__iterate=function(t,e){var n=this;return this._iter.__iterate(function(e){return t(e,e,n)},e)},ft.prototype.__iterator=function(t,e){var n=this._iter.__iterator(wn,e);return new T(function(){var e=n.next();return e.done?e:E(t,e.value,e.value,e)})},t(lt,D),lt.prototype.entrySeq=function(){return this._iter.toSeq()},lt.prototype.__iterate=function(t,e){var n=this;return this._iter.__iterate(function(e){if(e){Dt(e);var r=y(e);return t(r?e.get(1):e[1],r?e.get(0):e[0],n)}},e)},lt.prototype.__iterator=function(t,e){var n=this._iter.__iterator(wn,e);return new T(function(){for(;;){var e=n.next();if(e.done)return e;var r=e.value;if(r){Dt(r);var i=y(r);return E(t,i?r.get(0):r[0],i?r.get(1):r[1],e)}}})},ct.prototype.cacheResult=st.prototype.cacheResult=ft.prototype.cacheResult=lt.prototype.cacheResult=kt,t(zt,H),zt.prototype.toString=function(){return this.__toString("Map {","}")},zt.prototype.get=function(t,e){return this._root?this._root.get(0,void 0,t,e):e},zt.prototype.set=function(t,e){return Jt(this,t,e)},zt.prototype.setIn=function(t,e){return this.updateIn(t,hn,function(){return e})},zt.prototype.remove=function(t){return Jt(this,t,hn)},zt.prototype.deleteIn=function(t){return this.updateIn(t,function(){return hn})},zt.prototype.update=function(t,e,n){return 1===arguments.length?t(this):this.updateIn([t],e,n)},zt.prototype.updateIn=function(t,e,n){n||(n=e,e=void 0);var r=oe(this,Lt(t),e,n);return r===hn?void 0:r},zt.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):Bt()},zt.prototype.merge=function(){return ne(this,void 0,arguments)},zt.prototype.mergeWith=function(t){var e=an.call(arguments,1);return ne(this,t,e)},zt.prototype.mergeIn=function(t){var e=an.call(arguments,1);return this.updateIn(t,Bt(),function(t){return t.merge.apply(t,e)})},zt.prototype.mergeDeep=function(){return ne(this,re(void 0),arguments)},zt.prototype.mergeDeepWith=function(t){var e=an.call(arguments,1);return ne(this,re(t),e)},zt.prototype.mergeDeepIn=function(t){var e=an.call(arguments,1);return this.updateIn(t,Bt(),function(t){return t.mergeDeep.apply(t,e)})},zt.prototype.sort=function(t){return be(It(this,t))},zt.prototype.sortBy=function(t,e){return be(It(this,e,t))},zt.prototype.withMutations=function(t){var e=this.asMutable();return t(e),e.wasAltered()?e.__ensureOwner(this.__ownerID):this},zt.prototype.asMutable=function(){return this.__ownerID?this:this.__ensureOwner(new r)},zt.prototype.asImmutable=function(){return this.__ensureOwner()},zt.prototype.wasAltered=function(){return this.__altered},zt.prototype.__iterator=function(t,e){return new Kt(this,t,e)},zt.prototype.__iterate=function(t,e){var n=this,r=0;return this._root&&this._root.iterate(function(e){return r++,t(e[1],e[0],n)},e),r},zt.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?Ft(this.size,this._root,t,this.__hash):(this.__ownerID=t,this.__altered=!1,this)},zt.isMap=qt;var qn="@@__IMMUTABLE_MAP__@@",Pn=zt.prototype;Pn[qn]=!0,Pn[sn]=Pn.remove,Pn.removeIn=Pn.deleteIn,Pt.prototype.get=function(t,e,n,r){for(var i=this.entries,o=0,u=i.length;u>o;o++)if(J(n,i[o][0]))return i[o][1];return r},Pt.prototype.update=function(t,e,r,o,u,a,s){for(var c=u===hn,f=this.entries,l=0,h=f.length;h>l&&!J(o,f[l][0]);l++);var p=h>l;if(p?f[l][1]===u:c)return this;if(n(s),(c||!p)&&n(a),!c||1!==f.length){if(!p&&!c&&f.length>=Wn)return Qt(t,f,o,u);var _=t&&t===this.ownerID,v=_?f:i(f);return p?c?l===h-1?v.pop():v[l]=v.pop():v[l]=[o,u]:v.push([o,u]),_?(this.entries=v,this):new Pt(t,v)}},Ut.prototype.get=function(t,e,n,r){void 0===e&&(e=et(n));var i=1<<((0===t?e:e>>>t)&ln),o=this.bitmap;return 0===(o&i)?r:this.nodes[ue(o&i-1)].get(t+cn,e,n,r)},Ut.prototype.update=function(t,e,n,r,i,o,u){void 0===n&&(n=et(r));var a=(0===e?n:n>>>e)&ln,s=1<<a,c=this.bitmap,f=0!==(c&s);if(!f&&i===hn)return this;var l=ue(c&s-1),h=this.nodes,p=f?h[l]:void 0,_=Yt(p,t,e+cn,n,r,i,o,u);if(_===p)return this;if(!f&&_&&h.length>=Vn)return ee(t,h,c,a,_);if(f&&!_&&2===h.length&&Xt(h[1^l]))return h[1^l];if(f&&_&&1===h.length&&Xt(_))return _;var v=t&&t===this.ownerID,y=f?_?c:c^s:c|s,d=f?_?ae(h,l,_,v):ce(h,l,v):se(h,l,_,v);return v?(this.bitmap=y,this.nodes=d,this):new Ut(t,y,d)},Wt.prototype.get=function(t,e,n,r){void 0===e&&(e=et(n));var i=(0===t?e:e>>>t)&ln,o=this.nodes[i];return o?o.get(t+cn,e,n,r):r},Wt.prototype.update=function(t,e,n,r,i,o,u){void 0===n&&(n=et(r));var a=(0===e?n:n>>>e)&ln,s=i===hn,c=this.nodes,f=c[a];if(s&&!f)return this;var l=Yt(f,t,e+cn,n,r,i,o,u);if(l===f)return this;var h=this.count;if(f){if(!l&&(h--,Gn>h))return te(t,c,h,a)}else h++;var p=t&&t===this.ownerID,_=ae(c,a,l,p);return p?(this.count=h,this.nodes=_,this):new Wt(t,h,_)},Vt.prototype.get=function(t,e,n,r){for(var i=this.entries,o=0,u=i.length;u>o;o++)if(J(n,i[o][0]))return i[o][1];return r},Vt.prototype.update=function(t,e,r,o,u,a,s){void 0===r&&(r=et(o));var c=u===hn;if(r!==this.keyHash)retuLine truncated
b&&b.classList.remove(c),a&&a.classList.add(c)},injectBoundHTML:function(a,b){var c=document.createElement("template");c.innerHTML=a;var d=this.instanceTemplate(c);return b&&(b.textContent="",b.appendChild(d)),d}},c=function(){},d={};b.asyncMethod=b.async,a.api.instance.utils=b,a.nop=c,a.nob=d}(Polymer),function(a){var b=window.WebComponents?WebComponents.flags.log:{},c="on-",d={EVENT_PREFIX:c,addHostListeners:function(){var a=this.eventDelegates;b.events&&Object.keys(a).length>0&&console.log("[%s] addHostListeners:",this.localName,a);for(var c in a){var d=a[c];PolymerGestures.addEventListener(this,c,this.element.getEventHandler(this,this,d))}},dispatchMethod:function(a,c,d){if(a){b.events&&console.group("[%s] dispatch [%s]",a.localName,c);var e="function"==typeof c?c:a[c];e&&e[d?"apply":"call"](a,d),b.events&&console.groupEnd(),Polymer.flush()}}};a.api.instance.events=d,a.addEventListener=function(a,b,c,d){PolymerGestures.addEventListener(wrap(a),b,c,d)},a.removeEventListener=function(a,b,c,d){PolymerGestures.removeEventListener(wrap(a),b,c,d)}}(Polymer),function(a){var b={copyInstanceAttributes:function(){var a=this._instanceAttributes;for(var b in a)this.hasAttribute(b)||this.setAttribute(b,a[b])},takeAttributes:function(){if(this._publishLC)for(var a,b=0,c=this.attributes,d=c.length;(a=c[b])&&d>b;b++)this.attributeToProperty(a.name,a.value)},attributeToProperty:function(b,c){var b=this.propertyForAttribute(b);if(b){if(c&&c.search(a.bindPattern)>=0)return;var d=this[b],c=this.deserializeValue(c,d);c!==d&&(this[b]=c)}},propertyForAttribute:function(a){var b=this._publishLC&&this._publishLC[a];return b},deserializeValue:function(b,c){return a.deserializeValue(b,c)},serializeValue:function(a,b){return"boolean"===b?a?"":void 0:"object"!==b&&"function"!==b&&void 0!==a?a:void 0},reflectPropertyToAttribute:function(a){var b=typeof this[a],c=this.serializeValue(this[a],b);void 0!==c?this.setAttribute(a,c):"boolean"===b&&this.removeAttribute(a)}};a.api.instance.attributes=b}(Polymer),function(a){function b(a,b){return a===b?0!==a||1/a===1/b:f(a)&&f(b)?!0:a!==a&&b!==b}function c(a,b){return void 0===b&&null===a?b:null===b||void 0===b?a:b}var d=window.WebComponents?WebComponents.flags.log:{},e={object:void 0,type:"update",name:void 0,oldValue:void 0},f=Number.isNaN||function(a){return"number"==typeof a&&isNaN(a)},g={createPropertyObserver:function(){var a=this._observeNames;if(a&&a.length){var b=this._propertyObserver=new CompoundObserver(!0);this.registerObserver(b);for(var c,d=0,e=a.length;e>d&&(c=a[d]);d++)b.addPath(this,c),this.observeArrayValue(c,this[c],null)}},openPropertyObserver:function(){this._propertyObserver&&this._propertyObserver.open(this.notifyPropertyChanges,this)},notifyPropertyChanges:function(a,b,c){var d,e,f={};for(var g in b)if(d=c[2*g+1],e=this.observe[d]){var h=b[g],i=a[g];this.observeArrayValue(d,i,h),f[e]||(void 0!==h&&null!==h||void 0!==i&&null!==i)&&(f[e]=!0,this.invokeMethod(e,[h,i,arguments]))}},invokeMethod:function(a,b){var c=this[a]||a;"function"==typeof c&&c.apply(this,b)},deliverChanges:function(){this._propertyObserver&&this._propertyObserver.deliver()},observeArrayValue:function(a,b,c){var e=this.observe[a];if(e&&(Array.isArray(c)&&(d.observe&&console.log("[%s] observeArrayValue: unregister observer [%s]",this.localName,a),this.closeNamedObserver(a+"__array")),Array.isArray(b))){d.observe&&console.log("[%s] observeArrayValue: register observer [%s]",this.localName,a,b);var f=new ArrayObserver(b);f.open(function(a){this.invokeMethod(e,[a])},this),this.registerNamedObserver(a+"__array",f)}},emitPropertyChangeRecord:function(a,c,d){if(!b(c,d)&&(this._propertyChanged(a,c,d),Observer.hasObjectObserve)){var f=this._objectNotifier;f||(f=this._objectNotifier=Object.getNotifier(this)),e.object=this,e.name=a,e.oldValue=d,f.notify(e)}},_propertyChanged:function(a){this.reflect[a]&&this.reflectPropertyToAttribute(a)},bindProperty:function(a,b,d){if(d)return void(this[a]=b);var e=this.element.prototype.computed;if(e&&e[a]){var f=a+"ComputedBoundObservable_";return void(this[f]=b)}return this.bindToAccessor(a,b,c)},bindToAccessor:function(a,c,d){function e(b,c){j[f]=b;var d=j[h];d&&"function"==typeof d.setValue&&d.setValue(b),j.emitPropertyChangeRecord(a,b,c)}var f=a+"_",g=a+"Observable_",h=a+"ComputedBoundObservable_";this[g]=c;var i=this[f],j=this,k=c.open(e);if(d&&!b(i,k)){var l=d(i,k);b(k,l)||(k=l,c.setValue&&c.setValue(k))}e(k,i);var m={close:function(){c.close(),j[g]=void 0,j[h]=void 0}};return this.registerObserver(m),m},createComputedProperties:function(){if(this._computedNames)for(var a=0;a<this._computedNames.length;a++){var b=this._computedNames[a],c=this.computed[b];try{var d=PolymerExpressions.getExpression(c),e=d.getBinding(this,this.element.syntax);this.bindToAccessor(b,e)}catch(f){console.error("Failed to create computed property",f)}}},registerObserver:function(a){return this._observers?void this._observers.push(a):void(this._observers=[a])},closeObservers:function(){if(thiLine truncated
return this._iter.includes(t)},ft.prototype.__iterate=function(t,e){var n=this;return this._iter.__iterate(function(e){return t(e,e,n)},e)},ft.prototype.__iterator=function(t,e){var n=this._iter.__iterator(wn,e);return new T(function(){var e=n.next();return e.done?e:E(t,e.value,e.value,e)})},t(lt,D),lt.prototype.entrySeq=function(){return this._iter.toSeq()},lt.prototype.__iterate=function(t,e){var n=this;return this._iter.__iterate(function(e){if(e){Dt(e);var r=y(e);return t(r?e.get(1):e[1],r?e.get(0):e[0],n)}},e)},lt.prototype.__iterator=function(t,e){var n=this._iter.__iterator(wn,e);return new T(function(){for(;;){var e=n.next();if(e.done)return e;var r=e.value;if(r){Dt(r);var i=y(r);return E(t,i?r.get(0):r[0],i?r.get(1):r[1],e)}}})},ct.prototype.cacheResult=st.prototype.cacheResult=ft.prototype.cacheResult=lt.prototype.cacheResult=kt,t(zt,H),zt.prototype.toString=function(){return this.__toString("Map {","}")},zt.prototype.get=function(t,e){return this._root?this._root.get(0,void 0,t,e):e},zt.prototype.set=function(t,e){return Jt(this,t,e)},zt.prototype.setIn=function(t,e){return this.updateIn(t,hn,function(){return e})},zt.prototype.remove=function(t){return Jt(this,t,hn)},zt.prototype.deleteIn=function(t){return this.updateIn(t,function(){return hn})},zt.prototype.update=function(t,e,n){return 1===arguments.length?t(this):this.updateIn([t],e,n)},zt.prototype.updateIn=function(t,e,n){n||(n=e,e=void 0);var r=oe(this,Lt(t),e,n);return r===hn?void 0:r},zt.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):Bt()},zt.prototype.merge=function(){return ne(this,void 0,arguments)},zt.prototype.mergeWith=function(t){var e=an.call(arguments,1);return ne(this,t,e)},zt.prototype.mergeIn=function(t){var e=an.call(arguments,1);return this.updateIn(t,Bt(),function(t){return t.merge.apply(t,e)})},zt.prototype.mergeDeep=function(){return ne(this,re(void 0),arguments)},zt.prototype.mergeDeepWith=function(t){var e=an.call(arguments,1);return ne(this,re(t),e)},zt.prototype.mergeDeepIn=function(t){var e=an.call(arguments,1);return this.updateIn(t,Bt(),function(t){return t.mergeDeep.apply(t,e)})},zt.prototype.sort=function(t){return be(It(this,t))},zt.prototype.sortBy=function(t,e){return be(It(this,e,t))},zt.prototype.withMutations=function(t){var e=this.asMutable();return t(e),e.wasAltered()?e.__ensureOwner(this.__ownerID):this},zt.prototype.asMutable=function(){return this.__ownerID?this:this.__ensureOwner(new r)},zt.prototype.asImmutable=function(){return this.__ensureOwner()},zt.prototype.wasAltered=function(){return this.__altered},zt.prototype.__iterator=function(t,e){return new Kt(this,t,e)},zt.prototype.__iterate=function(t,e){var n=this,r=0;return this._root&&this._root.iterate(function(e){return r++,t(e[1],e[0],n)},e),r},zt.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?Ft(this.size,this._root,t,this.__hash):(this.__ownerID=t,this.__altered=!1,this)},zt.isMap=qt;var qn="@@__IMMUTABLE_MAP__@@",Pn=zt.prototype;Pn[qn]=!0,Pn[sn]=Pn.remove,Pn.removeIn=Pn.deleteIn,Pt.prototype.get=function(t,e,n,r){for(var i=this.entries,o=0,u=i.length;u>o;o++)if(J(n,i[o][0]))return i[o][1];return r},Pt.prototype.update=function(t,e,r,o,u,a,s){for(var c=u===hn,f=this.entries,l=0,h=f.length;h>l&&!J(o,f[l][0]);l++);var p=h>l;if(p?f[l][1]===u:c)return this;if(n(s),(c||!p)&&n(a),!c||1!==f.length){if(!p&&!c&&f.length>=Wn)return Qt(t,f,o,u);var _=t&&t===this.ownerID,v=_?f:i(f);return p?c?l===h-1?v.pop():v[l]=v.pop():v[l]=[o,u]:v.push([o,u]),_?(this.entries=v,this):new Pt(t,v)}},Ut.prototype.get=function(t,e,n,r){void 0===e&&(e=et(n));var i=1<<((0===t?e:e>>>t)&ln),o=this.bitmap;return 0===(o&i)?r:this.nodes[ue(o&i-1)].get(t+cn,e,n,r)},Ut.prototype.update=function(t,e,n,r,i,o,u){void 0===n&&(n=et(r));var a=(0===e?n:n>>>e)&ln,s=1<<a,c=this.bitmap,f=0!==(c&s);if(!f&&i===hn)return this;var l=ue(c&s-1),h=this.nodes,p=f?h[l]:void 0,_=Yt(p,t,e+cn,n,r,i,o,u);if(_===p)return this;if(!f&&_&&h.length>=Vn)return ee(t,h,c,a,_);if(f&&!_&&2===h.length&&Xt(h[1^l]))return h[1^l];if(f&&_&&1===h.length&&Xt(_))return _;var v=t&&t===this.ownerID,y=f?_?c:c^s:c|s,d=f?_?ae(h,l,_,v):ce(h,l,v):se(h,l,_,v);return v?(this.bitmap=y,this.nodes=d,this):new Ut(t,y,d)},Wt.prototype.get=function(t,e,n,r){void 0===e&&(e=et(n));var i=(0===t?e:e>>>t)&ln,o=this.nodes[i];return o?o.get(t+cn,e,n,r):r},Wt.prototype.update=function(t,e,n,r,i,o,u){void 0===n&&(n=et(r));var a=(0===e?n:n>>>e)&ln,s=i===hn,c=this.nodes,f=c[a];if(s&&!f)return this;var l=Yt(f,t,e+cn,n,r,i,o,u);if(l===f)return this;var h=this.count;if(f){if(!l&&(h--,Gn>h))return te(t,c,h,a)}else h++;var p=t&&t===this.ownerID,_=ae(c,a,l,p);return p?(this.count=h,this.nodes=_,this):new Wt(t,h,_)},Vt.prototype.get=function(t,e,n,r){for(var i=this.entries,o=0,u=i.length;u>o;o++)if(J(n,i[o][0]))return i[o][1];return r},Vt.prototype.update=function(t,e,r,o,u,a,s){void 0===r&&(r=et(o));var c=u===hn;if(r!==this.keyHash)retuLine truncated
}function ae(t,e,n,r){var i=t.length;for(r&&i&&(n=t[--i]);i--;)n=e(n,t[i],i,t);return n}function se(t,e){for(var n=-1,r=t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}function ce(t){for(var e=t.length,n=0;e--;)n+=+t[e]||0;return n}function fe(t,e){return"undefined"==typeof t?e:t}function le(t,e,n,r){return"undefined"!=typeof t&&xo.call(r,n)?t:e}function he(t,e,n){var r=ga(e);if(!n)return _e(e,t,r);for(var i=-1,o=r.length;++i<o;){var u=r[i],a=t[u],s=n(a,e[u],u,t,e);(s===s?s===a:a!==a)&&("undefined"!=typeof a||u in t)||(t[u]=s)}return t}function pe(t,e){for(var n=-1,r=t.length,i=qn(r),o=e.length,u=_o(o);++n<o;){var a=e[n];i?(a=parseFloat(a),u[n]=jn(a,r)?t[a]:A):u[n]=t[a]}return u}function _e(t,e,n){n||(n=e,e={});for(var r=-1,i=n.length;++r<i;){var o=n[r];e[o]=t[o]}return e}function ve(t,e,n){var r=typeof t;return"function"==r?"undefined"==typeof e?t:Ye(t,e,n):null==t?eo:"object"==r?Re(t):"undefined"==typeof e?Le(t+""):Me(t+"",e)}function ye(t,e,n,r,i,o,u){var a;if(n&&(a=i?n(t,r,i):n(t)),"undefined"!=typeof a)return a;if(!hi(t))return t;var s=ua(t);if(s){if(a=Rn(t),!e)return Yt(t,a)}else{var c=Mo.call(t),f=c==Z;if(c!=et&&c!=F&&(!f||i))return Wt[c]?kn(t,c,e):i?t:{};if(a=Mn(f?{}:t),!e)return _e(t,a,ga(t))}o||(o=[]),u||(u=[]);for(var l=o.length;l--;)if(o[l]==t)return u[l];return o.push(t),u.push(a),(s?Xt:Ie)(t,function(r,i){a[i]=ye(r,e,n,i,t,o,u)}),a}function de(t,e,n){if("function"!=typeof t)throw new Oo($);return $o(function(){t.apply(A,n)},e)}function ge(t,e){var n=t?t.length:0,r=[];if(!n)return r;var i=-1,o=Dn(),u=o==a,s=u&&e.length>=200?Eu(e):null,c=e.length;s&&(o=Bt,u=!1,e=s);t:for(;++i<n;){var f=t[i];if(u&&f===f){for(var l=c;l--;)if(e[l]===f)continue t;r.push(f)}else o(e,f,0)<0&&r.push(f)}return r}function me(t,e){var n=!0;return du(t,function(t,r,i){return n=!!e(t,r,i)}),n}function we(t,e,n,r){var i=t.length;for(n=null==n?0:+n||0,0>n&&(n=-n>i?0:i+n),r="undefined"==typeof r||r>i?i:+r||0,0>r&&(r+=i),i=n>r?0:r>>>0,n>>>=0;i>n;)t[n++]=e;return t}function Te(t,e){var n=[];return du(t,function(t,r,i){e(t,r,i)&&n.push(t)}),n}function Ee(t,e,n,r){var i;return n(t,function(t,n,o){return e(t,n,o)?(i=r?n:t,!1):void 0}),i}function be(t,e,n){for(var r=-1,i=t.length,o=-1,u=[];++r<i;){var a=t[r];if(m(a)&&qn(a.length)&&(ua(a)||oi(a))){e&&(a=be(a,e,n));var s=-1,c=a.length;for(u.length+=c;++s<c;)u[++o]=a[s]}else n||(u[++o]=a)}return u}function Oe(t,e){return mu(t,e,Ni)}function Ie(t,e){return mu(t,e,ga)}function Se(t,e){return wu(t,e,ga)}function Ae(t,e){for(var n=-1,r=e.length,i=-1,o=[];++n<r;){var u=e[n];sa(t[u])&&(o[++i]=u)}return o}function Ne(t,e,n,r,i,o){if(t===e)return 0!==t||1/t==1/e;var u=typeof t,a=typeof e;return"function"!=u&&"object"!=u&&"function"!=a&&"object"!=a||null==t||null==e?t!==t&&e!==e:Ce(t,e,Ne,n,r,i,o)}function Ce(t,e,n,r,i,o,u){var a=ua(t),s=ua(e),c=B,f=B;a||(c=Mo.call(t),c==F?c=et:c!=et&&(a=wi(t))),s||(f=Mo.call(e),f==F?f=et:f!=et&&(s=wi(e)));var l=c==et||i&&c==Z,h=f==et||i&&f==Z,p=c==f;if(p&&!a&&!l)return Sn(t,e,c);if(i){if(!(p||l&&h))return!1}else{var _=l&&xo.call(t,"__wrapped__"),v=h&&xo.call(e,"__wrapped__");if(_||v)return n(_?t.value():t,v?e.value():e,r,i,o,u);if(!p)return!1}o||(o=[]),u||(u=[]);for(var y=o.length;y--;)if(o[y]==t)return u[y]==e;o.push(t),u.push(e);var d=(a?In:An)(t,e,n,r,i,o,u);return o.pop(),u.pop(),d}function De(t,e,n,r,i){for(var o=-1,u=e.length,a=!i;++o<u;)if(a&&r[o]?n[o]!==t[e[o]]:!(e[o]in t))return!1;for(o=-1;++o<u;){var s=e[o],c=t[s],f=n[o];if(a&&r[o])var l="undefined"!=typeof c||s in t;else l=i?i(c,f,s):A,"undefined"==typeof l&&(l=Ne(f,c,i,!0));if(!l)return!1}return!0}function xe(t,e){var n=[];return du(t,function(t,r,i){n.push(e(t,r,i))}),n}function Re(t){var e=ga(t),n=e.length;if(!n)return to(!0);if(1==n){var r=e[0],i=t[r];if(Pn(i))return function(t){return null!=t&&t[r]===i&&("undefined"!=typeof i||r in Fn(t))}}for(var o=_o(n),u=_o(n);n--;)i=t[e[n]],o[n]=i,u[n]=Pn(i);return function(t){return null!=t&&De(Fn(t),e,o,u)}}function Me(t,e){return Pn(e)?function(n){return null!=n&&n[t]===e&&("undefined"!=typeof e||t in Fn(n))}:function(n){return null!=n&&Ne(e,n[t],null,!0)}}function ke(t,e,n,r,i){if(!hi(t))return t;var o=qn(e.length)&&(ua(e)||wi(e));return(o?Xt:Ie)(e,function(e,u,a){if(m(e))return r||(r=[]),i||(i=[]),je(t,a,u,ke,n,r,i);var s=t[u],c=n?n(s,e,u,t,a):A,f="undefined"==typeof c;f&&(c=e),!o&&"undefined"==typeof c||!f&&(c===c?c===s:s!==s)||(t[u]=c)}),t}function je(t,e,n,r,i,o,u){for(var a=o.length,s=e[n];a--;)if(o[a]==s)return void(t[n]=u[a]);var c=t[n],f=i?i(c,s,n,t,e):A,l="undefined"==typeof f;l&&(f=s,qn(s.length)&&(ua(s)||wi(s))?f=ua(c)?c:c&&c.length?Yt(c):[]:ca(s)||oi(s)?f=oi(c)?bi(c):ca(c)?c:{}:l=!1),o.push(s),u.push(f),l?t[n]=r(f,s,i,o,u):(f===f?f!==c:c===c)&&(t[n]=f)}function Le(t){return function(e){return null==e?A:e[t]}}function ze(t,e){return t+Uo(ou()*(e-t+1))}function qe(t,e,n,r,i){return i(t,function(t,i,o){n=r?(r=!1,t):e(n,t,i,o)}),n}function Pe(t,e,n){var r=-1,i=t.length;e=null==e?0:+e||0,0>e&&(e=-e>i?0:i+e),n="undefined"==typeof n||n>i?i:+n||0,Line truncated
imports:{_:e}};var yu=function(){function e(){}return function(n){if(hi(n)){e.prototype=n;var r=new e;e.prototype=null}return r||t.Object()}}(),du=nn(Ie),gu=nn(Se,!0),mu=rn(),wu=rn(!0),Tu=pu?function(t,e){return pu.set(t,e),t}:eo;zo||(Xe=Lo&&Fo?function(t){var e=t.byteLength,n=Jo?Uo(e/lu):0,r=n*lu,i=new Lo(e);if(n){var o=new Jo(i,0,n);o.set(new Jo(t,0,n))}return e!=r&&(o=new Fo(i,r),o.set(new Fo(t,r))),i}:to(null));var Eu=Xo&&Ko?function(t){return new Ft(t)}:to(null),bu=pu?function(t){return pu.get(t)}:uo,Ou=function(){return vu.funcNames?"constant"==to.name?Le("name"):function(t){for(var e=t.name,n=_u[e],r=n?n.length:0;r--;){var i=n[r],o=i.func;if(null==o||o==t)return i.name}return e}:to("")}(),Iu=function(){var t=0,e=0;return function(n,r){var i=Fu(),o=W-(i-e);if(e=i,o>0){if(++t>=U)return n}else t=0;return Tu(n,r)}}(),Su=Qr(function(t,e){return ua(t)||oi(t)?ge(t,be(e,!1,!0)):[]}),Au=ln(),Nu=ln(!0),Cu=Qr(function(t,e){t||(t=[]),e=be(e);var n=e.length,r=pe(t,e);for(e.sort(o);n--;){var i=parseFloat(e[n]);if(i!=u&&jn(i)){var u=i;Ho.call(t,i,1)}}return r}),Du=bn(),xu=bn(!0),Ru=Qr(function(t){return Ke(be(t,!1,!0))}),Mu=Qr(function(t,e){return ua(t)||oi(t)?ge(t,e):[]}),ku=Qr(mr),ju=Qr(function(t,e){var n=t?t.length:0;return qn(n)&&(t=Hn(t)),pe(t,be(e))}),Lu=tn(function(t,e,n){xo.call(t,n)?++t[n]:t[n]=1}),zu=fn(du),qu=fn(gu,!0),Pu=_n(Xt,du),Uu=_n(Zt,gu),Wu=tn(function(t,e,n){xo.call(t,n)?t[n].push(e):t[n]=[e]}),Vu=tn(function(t,e,n){t[n]=e}),Gu=Qr(function(t,e,n){var r=-1,i="function"==typeof e,o=t?t.length:0,u=qn(o)?_o(o):[];return du(t,function(t){var o=i?e:null!=t&&t[e];u[++r]=o?o.apply(t,n):A}),u}),Ku=tn(function(t,e,n){t[n?0:1].push(e)},function(){return[[],[]]}),$u=mn(ue,du),Hu=mn(ae,gu),Fu=nu||function(){return(new vo).getTime()},Bu=Qr(function(t,e,n){var r=C;if(n.length){var i=T(n,Bu.placeholder);r|=k}return On(t,r,e,n,i)}),Ju=Qr(function(t,e){e=e.length?be(e):Ii(t);for(var n=-1,r=e.length;++n<r;){var i=e[n];t[i]=On(t[i],C,t)}return t}),Yu=Qr(function(t,e,n){var r=C|D;if(n.length){var i=T(n,Yu.placeholder);r|=k}return On(e,r,t,n,i)}),Xu=sn(R),Zu=sn(M),Qu=Qr(function(t,e){return de(t,1,e)}),ta=Qr(function(t,e,n){return de(t,e,n)}),ea=pn(),na=pn(!0),ra=gn(k),ia=gn(j),oa=Qr(function(t,e){return On(t,z,null,null,null,be(e))}),ua=Yo||function(t){return m(t)&&qn(t.length)&&Mo.call(t)==B};vu.dom||(si=function(t){return!!t&&1===t.nodeType&&m(t)&&!ca(t)});var aa=ru||function(t){return"number"==typeof t&&Zo(t)},sa=s(/x/)||Fo&&!s(Fo)?function(t){return Mo.call(t)==Z}:s,ca=Wo?function(t){if(!t||Mo.call(t)!=et)return!1;var e=t.valueOf,n=vi(e)&&(n=Wo(e))&&Wo(n);return n?t==n||Wo(t)==n:Kn(t)}:Kn,fa=en(he),la=Qr(function(t){var e=t[0];return null==e?e:(t.push(fe),fa.apply(A,t))}),ha=hn(Ie),pa=hn(Se),_a=vn(mu),va=vn(wu),ya=yn(Ie),da=yn(Se),ga=Qo?function(t){if(t)var e=t.constructor,n=t.length;return"function"==typeof e&&e.prototype===t||"function"!=typeof t&&n&&qn(n)?$n(t):hi(t)?Qo(t):[]}:$n,ma=en(ke),wa=Qr(function(t,e){if(null==t)return{};if("function"!=typeof e[0]){var e=re(be(e),bo);return Wn(t,ge(Ni(t),e))}var n=Ye(e[0],e[1],3);return Vn(t,function(t,e,r){return!n(t,e,r)})}),Ta=Qr(function(t,e){return null==t?{}:"function"==typeof e[0]?Vn(t,Ye(e[0],e[1],3)):Wn(t,be(e))}),Ea=un(function(t,e,n){return e=e.toLowerCase(),t+(n?e.charAt(0).toUpperCase()+e.slice(1):e)}),ba=un(function(t,e,n){return t+(n?"-":"")+e.toLowerCase()}),Oa=dn(),Ia=dn(!0);8!=iu(zt+"08")&&(Gi=function(t,e,n){return(n?Ln(t,e,n):null==e)?e=0:e&&(e=+e),t=Fi(t),iu(t,e||(Ct.test(t)?16:10))});var Sa=un(function(t,e,n){return t+(n?"_":"")+e.toLowerCase()}),Aa=un(function(t,e,n){return t+(n?" ":"")+(e.charAt(0).toUpperCase()+e.slice(1))}),Na=Qr(function(t,e){try{return t.apply(A,e)}catch(n){return li(n)?n:new yo(n)}}),Ca=cn(ie),Da=cn(oe,!0);return e.prototype=n.prototype,r.prototype=yu(n.prototype),r.prototype.constructor=r,i.prototype=yu(n.prototype),i.prototype.constructor=i,ot.prototype["delete"]=Gt,ot.prototype.get=Kt,ot.prototype.has=$t,ot.prototype.set=Ht,Ft.prototype.push=Jt,Yr.Cache=ot,e.after=Hr,e.ary=Fr,e.assign=fa,e.at=ju,e.before=Br,e.bind=Bu,e.bindAll=Ju,e.bindKey=Yu,e.callback=Qi,e.chain=Er,e.chunk=Jn,e.compact=Yn,e.constant=to,e.countBy=Lu,e.create=Oi,e.curry=Xu,e.curryRight=Zu,e.debounce=Jr,e.defaults=la,e.defer=Qu,e.delay=ta,e.difference=Su,e.drop=Xn,e.dropRight=Zn,e.dropRightWhile=Qn,e.dropWhile=tr,e.fill=er,e.filter=Rr,e.flatten=rr,e.flattenDeep=ir,e.flow=ea,e.flowRight=na,e.forEach=Pu,e.forEachRight=Uu,e.forIn=_a,e.forInRight=va,e.forOwn=ya,e.forOwnRight=da,e.functions=Ii,e.groupBy=Wu,e.indexBy=Vu,e.initial=ur,e.intersection=ar,e.invert=Ai,e.invoke=Gu,e.keys=ga,e.keysIn=Ni,e.map=jr,e.mapValues=Ci,e.matches=no,e.matchesProperty=ro,e.memoize=Yr,e.merge=ma,e.mixin=io,e.negate=Xr,e.omit=wa,e.once=Zr,e.pairs=Di,e.partial=ra,e.partialRight=ia,e.partition=Ku,e.pick=Ta,e.pluck=Lr,e.property=ao,e.propertyOf=so,e.pull=fr,e.pullAt=Cu,e.range=co,e.rearg=oa,e.reject=zr,e.remove=lr,e.rest=hr,e.restParam=Qr,e.shuffle=Pr,e.slice=pr,e.sortBy=Vr,e.sortByLine truncated
for(r&&o&&(n=t[++i]);++i<o;)n=e(n,t[i],i,t);return n}function ae(t,e,n,r){var i=t.length;for(r&&i&&(n=t[--i]);i--;)n=e(n,t[i],i,t);return n}function se(t,e){for(var n=-1,r=t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}function ce(t){for(var e=t.length,n=0;e--;)n+=+t[e]||0;return n}function fe(t,e){return"undefined"==typeof t?e:t}function le(t,e,n,r){return"undefined"!=typeof t&&xo.call(r,n)?t:e}function he(t,e,n){var r=ga(e);if(!n)return _e(e,t,r);for(var i=-1,o=r.length;++i<o;){var u=r[i],a=t[u],s=n(a,e[u],u,t,e);(s===s?s===a:a!==a)&&("undefined"!=typeof a||u in t)||(t[u]=s)}return t}function pe(t,e){for(var n=-1,r=t.length,i=qn(r),o=e.length,u=_o(o);++n<o;){var a=e[n];i?(a=parseFloat(a),u[n]=jn(a,r)?t[a]:A):u[n]=t[a]}return u}function _e(t,e,n){n||(n=e,e={});for(var r=-1,i=n.length;++r<i;){var o=n[r];e[o]=t[o]}return e}function ve(t,e,n){var r=typeof t;return"function"==r?"undefined"==typeof e?t:Ye(t,e,n):null==t?eo:"object"==r?Re(t):"undefined"==typeof e?Le(t+""):Me(t+"",e)}function ye(t,e,n,r,i,o,u){var a;if(n&&(a=i?n(t,r,i):n(t)),"undefined"!=typeof a)return a;if(!hi(t))return t;var s=ua(t);if(s){if(a=Rn(t),!e)return Yt(t,a)}else{var c=Mo.call(t),f=c==Z;if(c!=et&&c!=F&&(!f||i))return Wt[c]?kn(t,c,e):i?t:{};if(a=Mn(f?{}:t),!e)return _e(t,a,ga(t))}o||(o=[]),u||(u=[]);for(var l=o.length;l--;)if(o[l]==t)return u[l];return o.push(t),u.push(a),(s?Xt:Ie)(t,function(r,i){a[i]=ye(r,e,n,i,t,o,u)}),a}function de(t,e,n){if("function"!=typeof t)throw new Oo($);return $o(function(){t.apply(A,n)},e)}function ge(t,e){var n=t?t.length:0,r=[];if(!n)return r;var i=-1,o=Dn(),u=o==a,s=u&&e.length>=200?Eu(e):null,c=e.length;s&&(o=Bt,u=!1,e=s);t:for(;++i<n;){var f=t[i];if(u&&f===f){for(var l=c;l--;)if(e[l]===f)continue t;r.push(f)}else o(e,f,0)<0&&r.push(f)}return r}function me(t,e){var n=!0;return du(t,function(t,r,i){return n=!!e(t,r,i)}),n}function we(t,e,n,r){var i=t.length;for(n=null==n?0:+n||0,0>n&&(n=-n>i?0:i+n),r="undefined"==typeof r||r>i?i:+r||0,0>r&&(r+=i),i=n>r?0:r>>>0,n>>>=0;i>n;)t[n++]=e;return t}function Te(t,e){var n=[];return du(t,function(t,r,i){e(t,r,i)&&n.push(t)}),n}function Ee(t,e,n,r){var i;return n(t,function(t,n,o){return e(t,n,o)?(i=r?n:t,!1):void 0}),i}function be(t,e,n){for(var r=-1,i=t.length,o=-1,u=[];++r<i;){var a=t[r];if(m(a)&&qn(a.length)&&(ua(a)||oi(a))){e&&(a=be(a,e,n));var s=-1,c=a.length;for(u.length+=c;++s<c;)u[++o]=a[s]}else n||(u[++o]=a)}return u}function Oe(t,e){return mu(t,e,Ni)}function Ie(t,e){return mu(t,e,ga)}function Se(t,e){return wu(t,e,ga)}function Ae(t,e){for(var n=-1,r=e.length,i=-1,o=[];++n<r;){var u=e[n];sa(t[u])&&(o[++i]=u)}return o}function Ne(t,e,n,r,i,o){if(t===e)return 0!==t||1/t==1/e;var u=typeof t,a=typeof e;return"function"!=u&&"object"!=u&&"function"!=a&&"object"!=a||null==t||null==e?t!==t&&e!==e:Ce(t,e,Ne,n,r,i,o)}function Ce(t,e,n,r,i,o,u){var a=ua(t),s=ua(e),c=B,f=B;a||(c=Mo.call(t),c==F?c=et:c!=et&&(a=wi(t))),s||(f=Mo.call(e),f==F?f=et:f!=et&&(s=wi(e)));var l=c==et||i&&c==Z,h=f==et||i&&f==Z,p=c==f;if(p&&!a&&!l)return Sn(t,e,c);if(i){if(!(p||l&&h))return!1}else{var _=l&&xo.call(t,"__wrapped__"),v=h&&xo.call(e,"__wrapped__");if(_||v)return n(_?t.value():t,v?e.value():e,r,i,o,u);if(!p)return!1}o||(o=[]),u||(u=[]);for(var y=o.length;y--;)if(o[y]==t)return u[y]==e;o.push(t),u.push(e);var d=(a?In:An)(t,e,n,r,i,o,u);return o.pop(),u.pop(),d}function De(t,e,n,r,i){for(var o=-1,u=e.length,a=!i;++o<u;)if(a&&r[o]?n[o]!==t[e[o]]:!(e[o]in t))return!1;for(o=-1;++o<u;){var s=e[o],c=t[s],f=n[o];if(a&&r[o])var l="undefined"!=typeof c||s in t;else l=i?i(c,f,s):A,"undefined"==typeof l&&(l=Ne(f,c,i,!0));if(!l)return!1}return!0}function xe(t,e){var n=[];return du(t,function(t,r,i){n.push(e(t,r,i))}),n}function Re(t){var e=ga(t),n=e.length;if(!n)return to(!0);if(1==n){var r=e[0],i=t[r];if(Pn(i))return function(t){return null!=t&&t[r]===i&&("undefined"!=typeof i||r in Fn(t))}}for(var o=_o(n),u=_o(n);n--;)i=t[e[n]],o[n]=i,u[n]=Pn(i);return function(t){return null!=t&&De(Fn(t),e,o,u)}}function Me(t,e){return Pn(e)?function(n){return null!=n&&n[t]===e&&("undefined"!=typeof e||t in Fn(n))}:function(n){return null!=n&&Ne(e,n[t],null,!0)}}function ke(t,e,n,r,i){if(!hi(t))return t;var o=qn(e.length)&&(ua(e)||wi(e));return(o?Xt:Ie)(e,function(e,u,a){if(m(e))return r||(r=[]),i||(i=[]),je(t,a,u,ke,n,r,i);var s=t[u],c=n?n(s,e,u,t,a):A,f="undefined"==typeof c;f&&(c=e),!o&&"undefined"==typeof c||!f&&(c===c?c===s:s!==s)||(t[u]=c)}),t}function je(t,e,n,r,i,o,u){for(var a=o.length,s=e[n];a--;)if(o[a]==s)return void(t[n]=u[a]);var c=t[n],f=i?i(c,s,n,t,e):A,l="undefined"==typeof f;l&&(f=s,qn(s.length)&&(ua(s)||wi(s))?f=ua(c)?c:c&&c.length?Yt(c):[]:ca(s)||oi(s)?f=oi(c)?bi(c):ca(c)?c:{}:l=!1),o.push(s),u.push(f),l?t[n]=r(f,s,i,o,u):(f===f?f!==c:c===c)&&(t[n]=f)}function Le(t){return function(e){return null==e?A:e[t]}}function ze(t,e){return t+Uo(ou()*(e-t+1))}function qe(t,e,n,r,i){return i(t,function(t,i,o){n=r?(r=!1,t):e(n,t,i,o)}),n}function Pe(t,e,n){var r=-1,i=t.length;e=null==e?0:+e||0,0>e&&Line truncated
escape:bt,evaluate:Ot,interpolate:It,variable:"",imports:{_:e}};var yu=function(){function e(){}return function(n){if(hi(n)){e.prototype=n;var r=new e;e.prototype=null}return r||t.Object()}}(),du=nn(Ie),gu=nn(Se,!0),mu=rn(),wu=rn(!0),Tu=pu?function(t,e){return pu.set(t,e),t}:eo;zo||(Xe=Lo&&Fo?function(t){var e=t.byteLength,n=Jo?Uo(e/lu):0,r=n*lu,i=new Lo(e);if(n){var o=new Jo(i,0,n);o.set(new Jo(t,0,n))}return e!=r&&(o=new Fo(i,r),o.set(new Fo(t,r))),i}:to(null));var Eu=Xo&&Ko?function(t){return new Ft(t)}:to(null),bu=pu?function(t){return pu.get(t)}:uo,Ou=function(){return vu.funcNames?"constant"==to.name?Le("name"):function(t){for(var e=t.name,n=_u[e],r=n?n.length:0;r--;){var i=n[r],o=i.func;if(null==o||o==t)return i.name}return e}:to("")}(),Iu=function(){var t=0,e=0;return function(n,r){var i=Fu(),o=W-(i-e);if(e=i,o>0){if(++t>=U)return n}else t=0;return Tu(n,r)}}(),Su=Qr(function(t,e){return ua(t)||oi(t)?ge(t,be(e,!1,!0)):[]}),Au=ln(),Nu=ln(!0),Cu=Qr(function(t,e){t||(t=[]),e=be(e);var n=e.length,r=pe(t,e);for(e.sort(o);n--;){var i=parseFloat(e[n]);if(i!=u&&jn(i)){var u=i;Ho.call(t,i,1)}}return r}),Du=bn(),xu=bn(!0),Ru=Qr(function(t){return Ke(be(t,!1,!0))}),Mu=Qr(function(t,e){return ua(t)||oi(t)?ge(t,e):[]}),ku=Qr(mr),ju=Qr(function(t,e){var n=t?t.length:0;return qn(n)&&(t=Hn(t)),pe(t,be(e))}),Lu=tn(function(t,e,n){xo.call(t,n)?++t[n]:t[n]=1}),zu=fn(du),qu=fn(gu,!0),Pu=_n(Xt,du),Uu=_n(Zt,gu),Wu=tn(function(t,e,n){xo.call(t,n)?t[n].push(e):t[n]=[e]}),Vu=tn(function(t,e,n){t[n]=e}),Gu=Qr(function(t,e,n){var r=-1,i="function"==typeof e,o=t?t.length:0,u=qn(o)?_o(o):[];return du(t,function(t){var o=i?e:null!=t&&t[e];u[++r]=o?o.apply(t,n):A}),u}),Ku=tn(function(t,e,n){t[n?0:1].push(e)},function(){return[[],[]]}),$u=mn(ue,du),Hu=mn(ae,gu),Fu=nu||function(){return(new vo).getTime()},Bu=Qr(function(t,e,n){var r=C;if(n.length){var i=T(n,Bu.placeholder);r|=k}return On(t,r,e,n,i)}),Ju=Qr(function(t,e){e=e.length?be(e):Ii(t);for(var n=-1,r=e.length;++n<r;){var i=e[n];t[i]=On(t[i],C,t)}return t}),Yu=Qr(function(t,e,n){var r=C|D;if(n.length){var i=T(n,Yu.placeholder);r|=k}return On(e,r,t,n,i)}),Xu=sn(R),Zu=sn(M),Qu=Qr(function(t,e){return de(t,1,e)}),ta=Qr(function(t,e,n){return de(t,e,n)}),ea=pn(),na=pn(!0),ra=gn(k),ia=gn(j),oa=Qr(function(t,e){return On(t,z,null,null,null,be(e))}),ua=Yo||function(t){return m(t)&&qn(t.length)&&Mo.call(t)==B};vu.dom||(si=function(t){return!!t&&1===t.nodeType&&m(t)&&!ca(t)});var aa=ru||function(t){return"number"==typeof t&&Zo(t)},sa=s(/x/)||Fo&&!s(Fo)?function(t){return Mo.call(t)==Z}:s,ca=Wo?function(t){if(!t||Mo.call(t)!=et)return!1;var e=t.valueOf,n=vi(e)&&(n=Wo(e))&&Wo(n);return n?t==n||Wo(t)==n:Kn(t)}:Kn,fa=en(he),la=Qr(function(t){var e=t[0];return null==e?e:(t.push(fe),fa.apply(A,t))}),ha=hn(Ie),pa=hn(Se),_a=vn(mu),va=vn(wu),ya=yn(Ie),da=yn(Se),ga=Qo?function(t){if(t)var e=t.constructor,n=t.length;return"function"==typeof e&&e.prototype===t||"function"!=typeof t&&n&&qn(n)?$n(t):hi(t)?Qo(t):[]}:$n,ma=en(ke),wa=Qr(function(t,e){if(null==t)return{};if("function"!=typeof e[0]){var e=re(be(e),bo);return Wn(t,ge(Ni(t),e))}var n=Ye(e[0],e[1],3);return Vn(t,function(t,e,r){return!n(t,e,r)})}),Ta=Qr(function(t,e){return null==t?{}:"function"==typeof e[0]?Vn(t,Ye(e[0],e[1],3)):Wn(t,be(e))}),Ea=un(function(t,e,n){return e=e.toLowerCase(),t+(n?e.charAt(0).toUpperCase()+e.slice(1):e)}),ba=un(function(t,e,n){return t+(n?"-":"")+e.toLowerCase()}),Oa=dn(),Ia=dn(!0);8!=iu(zt+"08")&&(Gi=function(t,e,n){return(n?Ln(t,e,n):null==e)?e=0:e&&(e=+e),t=Fi(t),iu(t,e||(Ct.test(t)?16:10))});var Sa=un(function(t,e,n){return t+(n?"_":"")+e.toLowerCase()}),Aa=un(function(t,e,n){return t+(n?" ":"")+(e.charAt(0).toUpperCase()+e.slice(1))}),Na=Qr(function(t,e){try{return t.apply(A,e)}catch(n){return li(n)?n:new yo(n)}}),Ca=cn(ie),Da=cn(oe,!0);return e.prototype=n.prototype,r.prototype=yu(n.prototype),r.prototype.constructor=r,i.prototype=yu(n.prototype),i.prototype.constructor=i,ot.prototype["delete"]=Gt,ot.prototype.get=Kt,ot.prototype.has=$t,ot.prototype.set=Ht,Ft.prototype.push=Jt,Yr.Cache=ot,e.after=Hr,e.ary=Fr,e.assign=fa,e.at=ju,e.before=Br,e.bind=Bu,e.bindAll=Ju,e.bindKey=Yu,e.callback=Qi,e.chain=Er,e.chunk=Jn,e.compact=Yn,e.constant=to,e.countBy=Lu,e.create=Oi,e.curry=Xu,e.curryRight=Zu,e.debounce=Jr,e.defaults=la,e.defer=Qu,e.delay=ta,e.difference=Su,e.drop=Xn,e.dropRight=Zn,e.dropRightWhile=Qn,e.dropWhile=tr,e.fill=er,e.filter=Rr,e.flatten=rr,e.flattenDeep=ir,e.flow=ea,e.flowRight=na,e.forEach=Pu,e.forEachRight=Uu,e.forIn=_a,e.forInRight=va,e.forOwn=ya,e.forOwnRight=da,e.functions=Ii,e.groupBy=Wu,e.indexBy=Vu,e.initial=ur,e.intersection=ar,e.invert=Ai,e.invoke=Gu,e.keys=ga,e.keysIn=Ni,e.map=jr,e.mapValues=Ci,e.matches=no,e.matchesProperty=ro,e.memoize=Yr,e.merge=ma,e.mixin=io,e.negate=Xr,e.omit=wa,e.once=Zr,e.pairs=Di,e.partial=ra,e.partialRight=ia,e.partition=Ku,e.pick=Ta,e.pluck=Lr,e.property=ao,e.propertyOf=so,e.pull=fr,e.pullAt=Cu,e.range=co,e.rearg=oa,e.reject=zr,e.remove=lr,e.rest=hr,e.restParaLine truncated
servicesLoaded:{get:function(){return r(f.ACTION_NEW_SERVICES)}},statesLoaded:{get:function(){return r(f.ACTION_NEW_STATES)}}}),e}(l),y=new v;y.dispatchToken=c.register(function(t){switch(t.actionType){case f.ACTION_FETCH_ALL:_=[],y.emitChange();break;case f.ACTION_NEW_LOADED_COMPONENTS:case f.ACTION_NEW_EVENTS:case f.ACTION_NEW_SERVICES:case f.ACTION_NEW_STATES:r(t.actionType)||(_.push(t.actionType),p=p||i(),y.emitChange());break;case f.ACTION_LOG_OUT:p=!1,_=[],y.emitChange()}}),t.exports=y},function(t,e,n){"use strict";var r=function(t){return t&&t.__esModule?t["default"]:t},i=function(){function t(t,e){for(var n in e){var r=e[n];r.configurable=!0,r.value&&(r.writable=!0)}Object.defineProperties(t,e)}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),o=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(t.__proto__=e)},u=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},a=r(n(1)),s=r(n(2)),c=r(n(3)),f="STATE_LISTENING",l="STATE_TRANSMITTING",h="STATE_IDLE",p="STATE_ERROR",_=h,v="",y="",d=function(t){function e(){u(this,e),null!=t&&t.apply(this,arguments)}return o(e,t),i(e,{state:{get:function(){return _}},isListening:{get:function(){return _===f}},isTransmitting:{get:function(){return _===l}},hasError:{get:function(){return _===p}},interimTranscript:{get:function(){return v}},finalTranscript:{get:function(){return y}}}),e}(c),g=new d;g.STATE_LISTENING=f,g.STATE_TRANSMITTING=l,g.STATE_IDLE=h,g.STATE_ERROR=p,g.dispatchToken=a.register(function(t){switch(t.actionType){case s.ACTION_LISTENING_START:_=f,v="",y="",g.emitChange();break;case s.ACTION_LISTENING_TRANSMITTING:_=l,v="",y=t.finalTranscript,g.emitChange();break;case s.ACTION_LISTENING_DONE:_=h,g.emitChange();break;case s.ACTION_LISTENING_ERROR:_=p,g.emitChange();break;case s.ACTION_LISTENING_RESULT:v=t.interimTranscript,y=t.finalTranscript,g.emitChange()}}),t.exports=g},function(t,e,n){"use strict";function r(t){var e=t.split(" "),n=i(e,2),r=n[0],o=n[1],u=r.split(":"),a=i(u,3),s=a[0],c=a[1],f=a[2],l=o.split("-"),h=i(l,3),p=h[0],_=h[1],v=h[2];return new Date(v,parseInt(_)-1,p,s,c,f)}var i=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t)){for(var n,r=[],i=t[Symbol.iterator]();!(n=i.next()).done&&(r.push(n.value),!e||r.length!==e););return r}throw new TypeError("Invalid attempt to destructure non-iterable instance")};e.parseDateTime=r,Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,n){"use strict";function r(t){a.dispatch({actionType:s.ACTION_NEW_LOADED_COMPONENTS,components:t})}function i(){return u("GET","components").then(r)}var o=function(t){return t&&t.__esModule?t["default"]:t};e.newLoaded=r,e.fetchAll=i,Object.defineProperty(e,"__esModule",{value:!0});var u=o(n(5)),a=o(n(1)),s=o(n(2))},function(t,e,n){"use strict";function r(t){s.dispatch({actionType:c.ACTION_NEW_EVENTS,events:t})}function i(){a("GET","events").then(r)}function o(t){var e=void 0===arguments[1]?{}:arguments[1];return a("POST","events/"+t,e).then(function(){f("Event "+t+" successful fired!"),s.dispatch({actionType:c.ACTION_EVENT_FIRED,eventType:t,eventData:e})})}var u=function(t){return t&&t.__esModule?t["default"]:t};e.newEvents=r,e.fetchAll=i,e.fire=o,Object.defineProperty(e,"__esModule",{value:!0});var a=u(n(5)),s=u(n(1)),c=u(n(2)),f=n(10).notify},function(t,e,n){"use strict";function r(){return"EventSource"in window}function i(t){null!==p&&y();var e="/api/stream";t&&(e+="?api_password="+t),p=new EventSource(e),_=t,p.addEventListener("open",function(){v(),c.dispatch({actionType:f.ACTION_STREAM_START}),l.stop(),l.fetchAll()},!1),p.addEventListener("message",function(t){v(),"ping"!==t.data&&c.dispatch({actionType:f.ACTION_REMOTE_EVENT_RECEIVED,event:JSON.parse(t.data)})},!1),p.addEventListener("error",function(){p.readyState!==EventSource.CLOSED&&c.dispatch({actionType:f.ACTION_STREAM_ERROR})},!1)}function o(){y(),c.dispatch({actionType:f.ACTION_STREAM_STOP}),l.start()}var u=function(t){return t&&t.__esModule?t:{"default":t}},a=function(t){return t&&t.__esModule?t["default"]:t};e.isSupported=r,e.start=i,e.stop=o,Object.defineProperty(e,"__esModule",{value:!0});var s=a(n(6)),c=a(n(1)),f=a(n(2)),l=u(n(13)),h=6e4,p=null,_=null,v=s.debounce(function(){i(_)},h),y=function(){p.close(),p=null,_=null,v.cancel()}},function(t,e,n){"use strict";function r(t,e){var n=e.useStreaming,r=void 0===n?l.isSupported:n,i=e.rememberLogin,o=void 0===i?!1:i;s.dispatch({actionType:c.ACTION_VALIDATING_AUTH_TOKEN}),a("GET","",!1,{authToken:t}).then(function(){s.dispatch({actionType:c.ACTION_VALID_AUTH_TOKEN,authToken:t,rememberLogin:o}),r?l.start(t):f.start()},function(t){s.dispatch({actionType:c.ACTION_INVALID_AUTH_TOKEN,message:t.message})})}function i(){s.dispatch({actionType:c.ACTION_LOG_OUT})}var o=function(t){reLine truncated
}},statesLoaded:{get:function(){return r(f.ACTION_NEW_STATES)}}}),e}(l),y=new v;y.dispatchToken=c.register(function(t){switch(t.actionType){case f.ACTION_FETCH_ALL:_=[],y.emitChange();break;case f.ACTION_NEW_LOADED_COMPONENTS:case f.ACTION_NEW_EVENTS:case f.ACTION_NEW_SERVICES:case f.ACTION_NEW_STATES:r(t.actionType)||(_.push(t.actionType),p=p||i(),y.emitChange());break;case f.ACTION_LOG_OUT:p=!1,_=[],y.emitChange()}}),t.exports=y},function(t,e,n){"use strict";var r=function(t){return t&&t.__esModule?t["default"]:t},i=function(){function t(t,e){for(var n in e){var r=e[n];r.configurable=!0,r.value&&(r.writable=!0)}Object.defineProperties(t,e)}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),o=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(t.__proto__=e)},u=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},a=r(n(1)),s=r(n(2)),c=r(n(3)),f="STATE_LISTENING",l="STATE_TRANSMITTING",h="STATE_IDLE",p="STATE_ERROR",_=h,v="",y="",d=function(t){function e(){u(this,e),null!=t&&t.apply(this,arguments)}return o(e,t),i(e,{state:{get:function(){return _}},isListening:{get:function(){return _===f}},isTransmitting:{get:function(){return _===l}},hasError:{get:function(){return _===p}},interimTranscript:{get:function(){return v}},finalTranscript:{get:function(){return y}}}),e}(c),g=new d;g.STATE_LISTENING=f,g.STATE_TRANSMITTING=l,g.STATE_IDLE=h,g.STATE_ERROR=p,g.dispatchToken=a.register(function(t){switch(t.actionType){case s.ACTION_LISTENING_START:_=f,v="",y="",g.emitChange();break;case s.ACTION_LISTENING_TRANSMITTING:_=l,v="",y=t.finalTranscript,g.emitChange();break;case s.ACTION_LISTENING_DONE:_=h,g.emitChange();break;case s.ACTION_LISTENING_ERROR:_=p,g.emitChange();break;case s.ACTION_LISTENING_RESULT:v=t.interimTranscript,y=t.finalTranscript,g.emitChange()}}),t.exports=g},function(t,e){"use strict";function n(t){var e=t.split(" "),n=r(e,2),i=n[0],o=n[1],u=i.split(":"),a=r(u,3),s=a[0],c=a[1],f=a[2],l=o.split("-"),h=r(l,3),p=h[0],_=h[1],v=h[2];return new Date(v,parseInt(_)-1,p,s,c,f)}var r=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t)){for(var n,r=[],i=t[Symbol.iterator]();!(n=i.next()).done&&(r.push(n.value),!e||r.length!==e););return r}throw new TypeError("Invalid attempt to destructure non-iterable instance")};e.parseDateTime=n,Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,n){"use strict";function r(t){a.dispatch({actionType:s.ACTION_NEW_LOADED_COMPONENTS,components:t})}function i(){return u("GET","components").then(r)}var o=function(t){return t&&t.__esModule?t["default"]:t};e.newLoaded=r,e.fetchAll=i,Object.defineProperty(e,"__esModule",{value:!0});var u=o(n(5)),a=o(n(1)),s=o(n(2))},function(t,e,n){"use strict";function r(t){s.dispatch({actionType:c.ACTION_NEW_EVENTS,events:t})}function i(){a("GET","events").then(r)}function o(t){var e=void 0===arguments[1]?{}:arguments[1];return a("POST","events/"+t,e).then(function(){f("Event "+t+" successful fired!"),s.dispatch({actionType:c.ACTION_EVENT_FIRED,eventType:t,eventData:e})})}var u=function(t){return t&&t.__esModule?t["default"]:t};e.newEvents=r,e.fetchAll=i,e.fire=o,Object.defineProperty(e,"__esModule",{value:!0});var a=u(n(5)),s=u(n(1)),c=u(n(2)),f=n(10).notify},function(t,e,n){"use strict";function r(){return"EventSource"in window}function i(t){null!==p&&y();var e="/api/stream";t&&(e+="?api_password="+t),p=new EventSource(e),_=t,p.addEventListener("open",function(){v(),c.dispatch({actionType:f.ACTION_STREAM_START}),l.stop(),l.fetchAll()},!1),p.addEventListener("message",function(t){v(),"ping"!==t.data&&c.dispatch({actionType:f.ACTION_REMOTE_EVENT_RECEIVED,event:JSON.parse(t.data)})},!1),p.addEventListener("error",function(){p.readyState!==EventSource.CLOSED&&c.dispatch({actionType:f.ACTION_STREAM_ERROR})},!1)}function o(){y(),c.dispatch({actionType:f.ACTION_STREAM_STOP}),l.start()}var u=function(t){return t&&t.__esModule?t:{"default":t}},a=function(t){return t&&t.__esModule?t["default"]:t};e.isSupported=r,e.start=i,e.stop=o,Object.defineProperty(e,"__esModule",{value:!0});var s=a(n(6)),c=a(n(1)),f=a(n(2)),l=u(n(13)),h=6e4,p=null,_=null,v=s.debounce(function(){i(_)},h),y=function(){p.close(),p=null,_=null,v.cancel()}},function(t,e,n){"use strict";function r(t,e){var n=e.useStreaming,r=void 0===n?l.isSupported:n,i=e.rememberLogin,o=void 0===i?!1:i;s.dispatch({actionType:c.ACTION_VALIDATING_AUTH_TOKEN}),a("GET","",!1,{authToken:t}).then(function(){s.dispatch({actionType:c.ACTION_VALID_AUTH_TOKEN,authToken:t,rememberLogin:o}),r?l.start(t):f.start()},function(t){s.dispatch({actionType:c.ACTION_INVALID_AUTH_TOKEN,message:t.message})})}function i(){s.dispatch({actionType:c.ACTION_LOG_OUT})}var o=function(t){return t&&t.__esModule?t:{"default":t}},u=function(t){return t&&t.Line truncated
return pickBy("isBefore",args)};moment.max=function(){var args=[].slice.call(arguments,0);return pickBy("isAfter",args)};moment.utc=function(input,format,locale,strict){var c;if(typeof locale==="boolean"){strict=locale;locale=undefined}c={};c._isAMomentObject=true;c._useUTC=true;c._isUTC=true;c._l=locale;c._i=input;c._f=format;c._strict=strict;c._pf=defaultParsingFlags();return makeMoment(c).utc()};moment.unix=function(input){return moment(input*1e3)};moment.duration=function(input,key){var duration=input,match=null,sign,ret,parseIso,diffRes;if(moment.isDuration(input)){duration={ms:input._milliseconds,d:input._days,M:input._months}}else if(typeof input==="number"){duration={};if(key){duration[key]=input}else{duration.milliseconds=input}}else if(!!(match=aspNetTimeSpanJsonRegex.exec(input))){sign=match[1]==="-"?-1:1;duration={y:0,d:toInt(match[DATE])*sign,h:toInt(match[HOUR])*sign,m:toInt(match[MINUTE])*sign,s:toInt(match[SECOND])*sign,ms:toInt(match[MILLISECOND])*sign}}else if(!!(match=isoDurationRegex.exec(input))){sign=match[1]==="-"?-1:1;parseIso=function(inp){var res=inp&&parseFloat(inp.replace(",","."));return(isNaN(res)?0:res)*sign};duration={y:parseIso(match[2]),M:parseIso(match[3]),d:parseIso(match[4]),h:parseIso(match[5]),m:parseIso(match[6]),s:parseIso(match[7]),w:parseIso(match[8])}}else if(duration==null){duration={}}else if(typeof duration==="object"&&("from"in duration||"to"in duration)){diffRes=momentsDifference(moment(duration.from),moment(duration.to));duration={};duration.ms=diffRes.milliseconds;duration.M=diffRes.months}ret=new Duration(duration);if(moment.isDuration(input)&&hasOwnProp(input,"_locale")){ret._locale=input._locale}return ret};moment.version=VERSION;moment.defaultFormat=isoFormat;moment.ISO_8601=function(){};moment.momentProperties=momentProperties;moment.updateOffset=function(){};moment.relativeTimeThreshold=function(threshold,limit){if(relativeTimeThresholds[threshold]===undefined){return false}if(limit===undefined){return relativeTimeThresholds[threshold]}relativeTimeThresholds[threshold]=limit;return true};moment.lang=deprecate("moment.lang is deprecated. Use moment.locale instead.",function(key,value){return moment.locale(key,value)});moment.locale=function(key,values){var data;if(key){if(typeof values!=="undefined"){data=moment.defineLocale(key,values)}else{data=moment.localeData(key)}if(data){moment.duration._locale=moment._locale=data}}return moment._locale._abbr};moment.defineLocale=function(name,values){if(values!==null){values.abbr=name;if(!locales[name]){locales[name]=new Locale}locales[name].set(values);moment.locale(name);return locales[name]}else{delete locales[name];return null}};moment.langData=deprecate("moment.langData is deprecated. Use moment.localeData instead.",function(key){return moment.localeData(key)});moment.localeData=function(key){var locale;if(key&&key._locale&&key._locale._abbr){key=key._locale._abbr}if(!key){return moment._locale}if(!isArray(key)){locale=loadLocale(key);if(locale){return locale}key=[key]}return chooseLocale(key)};moment.isMoment=function(obj){return obj instanceof Moment||obj!=null&&hasOwnProp(obj,"_isAMomentObject")};moment.isDuration=function(obj){return obj instanceof Duration};for(i=lists.length-1;i>=0;--i){makeList(lists[i])}moment.normalizeUnits=function(units){return normalizeUnits(units)};moment.invalid=function(flags){var m=moment.utc(NaN);if(flags!=null){extend(m._pf,flags)}else{m._pf.userInvalidated=true}return m};moment.parseZone=function(){return moment.apply(null,arguments).parseZone()};moment.parseTwoDigitYear=function(input){return toInt(input)+(toInt(input)>68?1900:2e3)};moment.isDate=isDate;extend(moment.fn=Moment.prototype,{clone:function(){return moment(this)},valueOf:function(){return+this._d-(this._offset||0)*6e4},unix:function(){return Math.floor(+this/1e3)},toString:function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},toDate:function(){return this._offset?new Date(+this):this._d},toISOString:function(){var m=moment(this).utc();if(0<m.year()&&m.year()<=9999){if("function"===typeof Date.prototype.toISOString){return this.toDate().toISOString()}else{return formatMoment(m,"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]")}}else{return formatMoment(m,"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]")}},toArray:function(){var m=this;return[m.year(),m.month(),m.date(),m.hours(),m.minutes(),m.seconds(),m.milliseconds()]},isValid:function(){return isValid(this)},isDSTShifted:function(){if(this._a){return this.isValid()&&compareArrays(this._a,(this._isUTC?moment.utc(this._a):moment(this._a)).toArray())>0}return false},parsingFlags:function(){return extend({},this._pf)},invalidAt:function(){return this._pf.overflow},utc:function(keepLocalTime){return this.utcOffset(0,keepLocalTime)},local:function(keepLocalTime){if(this._isUTC){this.utcOffset(0,keepLocalTime);this._isUTC=false;if(keepLocalTime){this.subtract(this._dateUtcOffset(),"m")}}return this},format:function(inputString){var output=formatMoment(this,inputSLine truncated
return pickBy("isBefore",args)};moment.max=function(){var args=[].slice.call(arguments,0);return pickBy("isAfter",args)};moment.utc=function(input,format,locale,strict){var c;if(typeof locale==="boolean"){strict=locale;locale=undefined}c={};c._isAMomentObject=true;c._useUTC=true;c._isUTC=true;c._l=locale;c._i=input;c._f=format;c._strict=strict;c._pf=defaultParsingFlags();return makeMoment(c).utc()};moment.unix=function(input){return moment(input*1e3)};moment.duration=function(input,key){var duration=input,match=null,sign,ret,parseIso,diffRes;if(moment.isDuration(input)){duration={ms:input._milliseconds,d:input._days,M:input._months}}else if(typeof input==="number"){duration={};if(key){duration[key]=input}else{duration.milliseconds=input}}else if(!!(match=aspNetTimeSpanJsonRegex.exec(input))){sign=match[1]==="-"?-1:1;duration={y:0,d:toInt(match[DATE])*sign,h:toInt(match[HOUR])*sign,m:toInt(match[MINUTE])*sign,s:toInt(match[SECOND])*sign,ms:toInt(match[MILLISECOND])*sign}}else if(!!(match=isoDurationRegex.exec(input))){sign=match[1]==="-"?-1:1;parseIso=function(inp){var res=inp&&parseFloat(inp.replace(",","."));return(isNaN(res)?0:res)*sign};duration={y:parseIso(match[2]),M:parseIso(match[3]),d:parseIso(match[4]),h:parseIso(match[5]),m:parseIso(match[6]),s:parseIso(match[7]),w:parseIso(match[8])}}else if(duration==null){duration={}}else if(typeof duration==="object"&&("from"in duration||"to"in duration)){diffRes=momentsDifference(moment(duration.from),moment(duration.to));duration={};duration.ms=diffRes.milliseconds;duration.M=diffRes.months}ret=new Duration(duration);if(moment.isDuration(input)&&hasOwnProp(input,"_locale")){ret._locale=input._locale}return ret};moment.version=VERSION;moment.defaultFormat=isoFormat;moment.ISO_8601=function(){};moment.momentProperties=momentProperties;moment.updateOffset=function(){};moment.relativeTimeThreshold=function(threshold,limit){if(relativeTimeThresholds[threshold]===undefined){return false}if(limit===undefined){return relativeTimeThresholds[threshold]}relativeTimeThresholds[threshold]=limit;return true};moment.lang=deprecate("moment.lang is deprecated. Use moment.locale instead.",function(key,value){return moment.locale(key,value)});moment.locale=function(key,values){var data;if(key){if(typeof values!=="undefined"){data=moment.defineLocale(key,values)}else{data=moment.localeData(key)}if(data){moment.duration._locale=moment._locale=data}}return moment._locale._abbr};moment.defineLocale=function(name,values){if(values!==null){values.abbr=name;if(!locales[name]){locales[name]=new Locale}locales[name].set(values);moment.locale(name);return locales[name]}else{delete locales[name];return null}};moment.langData=deprecate("moment.langData is deprecated. Use moment.localeData instead.",function(key){return moment.localeData(key)});moment.localeData=function(key){var locale;if(key&&key._locale&&key._locale._abbr){key=key._locale._abbr}if(!key){return moment._locale}if(!isArray(key)){locale=loadLocale(key);if(locale){return locale}key=[key]}return chooseLocale(key)};moment.isMoment=function(obj){return obj instanceof Moment||obj!=null&&hasOwnProp(obj,"_isAMomentObject")};moment.isDuration=function(obj){return obj instanceof Duration};for(i=lists.length-1;i>=0;--i){makeList(lists[i])}moment.normalizeUnits=function(units){return normalizeUnits(units)};moment.invalid=function(flags){var m=moment.utc(NaN);if(flags!=null){extend(m._pf,flags)}else{m._pf.userInvalidated=true}return m};moment.parseZone=function(){return moment.apply(null,arguments).parseZone()};moment.parseTwoDigitYear=function(input){return toInt(input)+(toInt(input)>68?1900:2e3)};moment.isDate=isDate;extend(moment.fn=Moment.prototype,{clone:function(){return moment(this)},valueOf:function(){return+this._d-(this._offset||0)*6e4},unix:function(){return Math.floor(+this/1e3)},toString:function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},toDate:function(){return this._offset?new Date(+this):this._d},toISOString:function(){var m=moment(this).utc();if(0<m.year()&&m.year()<=9999){if("function"===typeof Date.prototype.toISOString){return this.toDate().toISOString()}else{return formatMoment(m,"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]")}}else{return formatMoment(m,"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]")}},toArray:function(){var m=this;return[m.year(),m.month(),m.date(),m.hours(),m.minutes(),m.seconds(),m.milliseconds()]},isValid:function(){return isValid(this)},isDSTShifted:function(){if(this._a){return this.isValid()&&compareArrays(this._a,(this._isUTC?moment.utc(this._a):moment(this._a)).toArray())>0}return false},parsingFlags:function(){return extend({},this._pf)},invalidAt:function(){return this._pf.overflow},utc:function(keepLocalTime){return this.utcOffset(0,keepLocalTime)},local:function(keepLocalTime){if(this._isUTC){this.utcOffset(0,keepLocalTime);this._isUTC=false;if(keepLocalTime){this.subtract(this._dateUtcOffset(),"m")}}return this},format:function(inputString){var output=formatMoment(this,inputSLine truncated
@@ -143,8 +143,9 @@
return !(state.domain in uiConstants.STATE_FILTERS);
});
}
this.states = states.toArray();
this.states = states.toArray().filter(
function (el) {return !el.attributes.hidden});
},
handleRefreshClick: function() {
+6 -3
View File
@@ -7,10 +7,11 @@ Provides functionality to group devices that can be turned on or off.
import homeassistant as ha
from homeassistant.helpers import generate_entity_id
from homeassistant.helpers.entity import VisibilityABC
import homeassistant.util as util
from homeassistant.const import (
ATTR_ENTITY_ID, ATTR_FRIENDLY_NAME, STATE_ON, STATE_OFF,
STATE_HOME, STATE_NOT_HOME, STATE_UNKNOWN)
STATE_HOME, STATE_NOT_HOME, STATE_UNKNOWN, ATTR_HIDDEN)
DOMAIN = "group"
DEPENDENCIES = []
@@ -110,8 +111,9 @@ def setup(hass, config):
return True
class Group(object):
class Group(VisibilityABC):
""" Tracks a group of entity ids. """
def __init__(self, hass, name, entity_ids=None, user_defined=True):
self.hass = hass
self.name = name
@@ -138,7 +140,8 @@ class Group(object):
return {
ATTR_ENTITY_ID: self.tracking,
ATTR_AUTO: not self.user_defined,
ATTR_FRIENDLY_NAME: self.name
ATTR_FRIENDLY_NAME: self.name,
ATTR_HIDDEN: self.hidden
}
def update_tracked_entity_ids(self, entity_ids):
+209
View File
@@ -0,0 +1,209 @@
"""
Connects to an ISY-994 controller and loads relevant components to control its
devices. Also contains the base classes for ISY Sensors, Lights, and Switches.
"""
# system imports
import logging
from urllib.parse import urlparse
# addon library imports
import PyISY
# homeassistant imports
from homeassistant import bootstrap
from homeassistant.loader import get_component
from homeassistant.helpers import validate_config
from homeassistant.helpers.entity import ToggleEntity
from homeassistant.const import (
CONF_HOST, CONF_USERNAME, CONF_PASSWORD, EVENT_PLATFORM_DISCOVERED,
ATTR_SERVICE, ATTR_DISCOVERED, ATTR_FRIENDLY_NAME)
# homeassistant constants
DOMAIN = "isy994"
DEPENDENCIES = []
DISCOVER_LIGHTS = "isy994.lights"
DISCOVER_SWITCHES = "isy994.switches"
DISCOVER_SENSORS = "isy994.sensors"
ISY = None
SENSOR_STRING = 'Sensor'
HIDDEN_STRING = '{HIDE ME}'
# setup logger
_LOGGER = logging.getLogger(__name__)
def setup(hass, config):
"""
Setup isy994 component.
This will automatically import associated lights, switches, and sensors.
"""
# pylint: disable=global-statement
# check for required values in configuration file
if not validate_config(config,
{DOMAIN: [CONF_HOST, CONF_USERNAME, CONF_PASSWORD]},
_LOGGER):
return False
# pull and parse standard configuration
user = config[DOMAIN][CONF_USERNAME]
password = config[DOMAIN][CONF_PASSWORD]
host = urlparse(config[DOMAIN][CONF_HOST])
addr = host.geturl()
if host.scheme == 'http':
addr = addr.replace('http://', '')
https = False
elif host.scheme == 'https':
addr = addr.replace('https://', '')
https = True
else:
_LOGGER.error('isy994 host value in configuration file is invalid.')
return False
port = host.port
addr = addr.replace(':{}'.format(port), '')
# pull and parse optional configuration
global SENSOR_STRING
global HIDDEN_STRING
SENSOR_STRING = str(config[DOMAIN].get('sensor_string', SENSOR_STRING))
HIDDEN_STRING = str(config[DOMAIN].get('hidden_string', HIDDEN_STRING))
# connect to ISY controller
global ISY
ISY = PyISY.ISY(addr, port, user, password, use_https=https, log=_LOGGER)
if not ISY.connected:
return False
# Load components for the devices in the ISY controller that we support
for comp_name, discovery in ((('sensor', DISCOVER_SENSORS),
('light', DISCOVER_LIGHTS),
('switch', DISCOVER_SWITCHES))):
component = get_component(comp_name)
bootstrap.setup_component(hass, component.DOMAIN, config)
hass.bus.fire(EVENT_PLATFORM_DISCOVERED,
{ATTR_SERVICE: discovery,
ATTR_DISCOVERED: {}})
ISY.auto_update = True
return True
class ISYDeviceABC(ToggleEntity):
""" Abstract Class for an ISY device within home assistant. """
_attrs = {}
_onattrs = []
_states = []
_dtype = None
_domain = None
_name = None
def __init__(self, node):
# setup properties
self.node = node
self.hidden = HIDDEN_STRING in self.raw_name
# track changes
self._change_handler = self.node.status. \
subscribe('changed', self.on_update)
def __del__(self):
""" cleanup subscriptions because it is the right thing to do. """
self._change_handler.unsubscribe()
@property
def domain(self):
""" Returns the domain of the entity. """
return self._domain
@property
def dtype(self):
""" Returns the data type of the entity (binary or analog). """
if self._dtype in ['analog', 'binary']:
return self._dtype
return 'binary' if self.unit_of_measurement is None else 'analog'
@property
def should_poll(self):
""" Tells Home Assistant not to poll this entity. """
return False
@property
def value(self):
""" returns the unclean value from the controller """
# pylint: disable=protected-access
return self.node.status._val
@property
def state_attributes(self):
""" Returns the state attributes for the node. """
attr = {ATTR_FRIENDLY_NAME: self.name}
for name, prop in self._attrs.items():
attr[name] = getattr(self, prop)
return attr
@property
def unique_id(self):
""" Returns the id of this isy sensor """
# pylint: disable=protected-access
return self.node._id
@property
def raw_name(self):
""" Returns the unclean node name. """
return str(self._name) \
if self._name is not None else str(self.node.name)
@property
def name(self):
""" Returns the cleaned name of the node. """
return self.raw_name.replace(HIDDEN_STRING, '').strip() \
.replace('_', ' ')
def update(self):
""" Update state of the sensor. """
# ISY objects are automatically updated by the ISY's event stream
pass
def on_update(self, event):
""" Handles the update received event. """
self.update_ha_state()
@property
def is_on(self):
""" Returns boolean response if the node is on. """
return bool(self.value)
@property
def is_open(self):
""" Returns boolean respons if the node is open. On = Open. """
return self.is_on
@property
def state(self):
""" Returns the state of the node. """
if len(self._states) > 0:
return self._states[0] if self.is_on else self._states[1]
return self.value
def turn_on(self, **kwargs):
""" turns the device on """
if self.domain is not 'sensor':
attrs = [kwargs.get(name) for name in self._onattrs]
self.node.on(*attrs)
else:
_LOGGER.error('ISY cannot turn on sensors.')
def turn_off(self, **kwargs):
""" turns the device off """
if self.domain is not 'sensor':
self.node.off()
else:
_LOGGER.error('ISY cannot turn off sensors.')
@property
def unit_of_measurement(self):
""" Returns the defined units of measurement or None. """
try:
return self.node.units
except AttributeError:
return None
+2 -1
View File
@@ -57,7 +57,7 @@ from homeassistant.helpers.entity_component import EntityComponent
import homeassistant.util as util
from homeassistant.const import (
STATE_ON, SERVICE_TURN_ON, SERVICE_TURN_OFF, ATTR_ENTITY_ID)
from homeassistant.components import group, discovery, wink
from homeassistant.components import group, discovery, wink, isy994
DOMAIN = "light"
@@ -92,6 +92,7 @@ LIGHT_PROFILES_FILE = "light_profiles.csv"
# Maps discovered services to their platforms
DISCOVERY_PLATFORMS = {
wink.DISCOVER_LIGHTS: 'wink',
isy994.DISCOVER_LIGHTS: 'isy994',
discovery.services.PHILIPS_HUE: 'hue',
}
+38
View File
@@ -0,0 +1,38 @@
""" Support for ISY994 lights. """
# system imports
import logging
# homeassistant imports
from homeassistant.components.isy994 import (ISYDeviceABC, ISY, SENSOR_STRING,
HIDDEN_STRING)
from homeassistant.components.light import ATTR_BRIGHTNESS
from homeassistant.const import STATE_ON, STATE_OFF
def setup_platform(hass, config, add_devices, discovery_info=None):
""" Sets up the isy994 platform. """
logger = logging.getLogger(__name__)
devs = []
# verify connection
if ISY is None or not ISY.connected:
logger.error('A connection has not been made to the ISY controller.')
return False
# import dimmable nodes
for (path, node) in ISY.nodes:
if node.dimmable and SENSOR_STRING not in node.name:
if HIDDEN_STRING in path:
node.name += HIDDEN_STRING
devs.append(ISYLightDevice(node))
add_devices(devs)
class ISYLightDevice(ISYDeviceABC):
""" represents as isy light within home assistant. """
_domain = 'light'
_dtype = 'analog'
_attrs = {ATTR_BRIGHTNESS: 'value'}
_onattrs = [ATTR_BRIGHTNESS]
_states = [STATE_ON, STATE_OFF]
+2 -1
View File
@@ -6,7 +6,7 @@ Component to interface with various sensors that can be monitored.
import logging
from homeassistant.helpers.entity_component import EntityComponent
from homeassistant.components import wink, zwave
from homeassistant.components import wink, zwave, isy994
DOMAIN = 'sensor'
DEPENDENCIES = []
@@ -18,6 +18,7 @@ ENTITY_ID_FORMAT = DOMAIN + '.{}'
DISCOVERY_PLATFORMS = {
wink.DISCOVER_SENSORS: 'wink',
zwave.DISCOVER_SENSORS: 'zwave',
isy994.DISCOVER_SENSORS: 'isy994'
}
+90
View File
@@ -0,0 +1,90 @@
""" Support for ISY994 sensors. """
# system imports
import logging
# homeassistant imports
from homeassistant.components.isy994 import (ISY, ISYDeviceABC, SENSOR_STRING,
HIDDEN_STRING)
from homeassistant.const import (STATE_OPEN, STATE_CLOSED, STATE_HOME,
STATE_NOT_HOME, STATE_ON, STATE_OFF)
DEFAULT_HIDDEN_WEATHER = ['Temperature_High', 'Temperature_Low', 'Feels_Like',
'Temperature_Average', 'Pressure', 'Dew_Point',
'Gust_Speed', 'Evapotranspiration',
'Irrigation_Requirement', 'Water_Deficit_Yesterday',
'Elevation', 'Average_Temperature_Tomorrow',
'High_Temperature_Tomorrow',
'Low_Temperature_Tomorrow', 'Humidity_Tomorrow',
'Wind_Speed_Tomorrow', 'Gust_Speed_Tomorrow',
'Rain_Tomorrow', 'Snow_Tomorrow',
'Forecast_Average_Temperature',
'Forecast_High_Temperature',
'Forecast_Low_Temperature', 'Forecast_Humidity',
'Forecast_Rain', 'Forecast_Snow']
def setup_platform(hass, config, add_devices, discovery_info=None):
""" Sets up the isy994 platform. """
# pylint: disable=protected-access
logger = logging.getLogger(__name__)
devs = []
# verify connection
if ISY is None or not ISY.connected:
logger.error('A connection has not been made to the ISY controller.')
return False
# import weather
if ISY.climate is not None:
for prop in ISY.climate._id2name:
if prop is not None:
prefix = HIDDEN_STRING \
if prop in DEFAULT_HIDDEN_WEATHER else ''
node = WeatherPseudoNode('ISY.weather.' + prop, prefix + prop,
getattr(ISY.climate, prop),
getattr(ISY.climate, prop + '_units'))
devs.append(ISYSensorDevice(node))
# import sensor nodes
for (path, node) in ISY.nodes:
if SENSOR_STRING in node.name:
if HIDDEN_STRING in path:
node.name += HIDDEN_STRING
devs.append(ISYSensorDevice(node, [STATE_ON, STATE_OFF]))
# import sensor programs
for (folder_name, states) in (
('HA.locations', [STATE_HOME, STATE_NOT_HOME]),
('HA.sensors', [STATE_OPEN, STATE_CLOSED]),
('HA.states', [STATE_ON, STATE_OFF])):
try:
folder = ISY.programs['My Programs'][folder_name]
except KeyError:
# folder does not exist
pass
else:
for _, _, node_id in folder.children:
node = folder[node_id].leaf
devs.append(ISYSensorDevice(node, states))
add_devices(devs)
class WeatherPseudoNode(object):
""" This class allows weather variable to act as regular nodes. """
# pylint: disable=too-few-public-methods
def __init__(self, device_id, name, status, units=None):
self._id = device_id
self.name = name
self.status = status
self.units = units
class ISYSensorDevice(ISYDeviceABC):
""" represents a isy sensor within home assistant. """
_domain = 'sensor'
def __init__(self, node, states=None):
super().__init__(node)
self._states = states or []
+2 -1
View File
@@ -10,7 +10,7 @@ from homeassistant.helpers.entity_component import EntityComponent
from homeassistant.const import (
STATE_ON, SERVICE_TURN_ON, SERVICE_TURN_OFF, ATTR_ENTITY_ID)
from homeassistant.components import group, discovery, wink
from homeassistant.components import group, discovery, wink, isy994
DOMAIN = 'switch'
DEPENDENCIES = []
@@ -30,6 +30,7 @@ MIN_TIME_BETWEEN_SCANS = timedelta(seconds=10)
DISCOVERY_PLATFORMS = {
discovery.services.BELKIN_WEMO: 'wemo',
wink.DISCOVER_SWITCHES: 'wink',
isy994.DISCOVER_SWITCHES: 'isy994',
}
_LOGGER = logging.getLogger(__name__)
+82
View File
@@ -0,0 +1,82 @@
""" Support for ISY994 switch. """
# system imports
import logging
# homeassistant imports
from homeassistant.components.isy994 import (ISY, ISYDeviceABC, SENSOR_STRING,
HIDDEN_STRING)
from homeassistant.const import STATE_ON, STATE_OFF # STATE_OPEN, STATE_CLOSED
# The frontend doesn't seem to fully support the open and closed states yet.
# Once it does, the HA.doors programs should report open and closed instead of
# off and on. It appears that on should be open and off should be closed.
def setup_platform(hass, config, add_devices, discovery_info=None):
""" Sets up the isy994 platform. """
# pylint: disable=too-many-locals
logger = logging.getLogger(__name__)
devs = []
# verify connection
if ISY is None or not ISY.connected:
logger.error('A connection has not been made to the ISY controller.')
return False
# import not dimmable nodes and groups
for (path, node) in ISY.nodes:
if not node.dimmable and SENSOR_STRING not in node.name:
if HIDDEN_STRING in path:
node.name += HIDDEN_STRING
devs.append(ISYSwitchDevice(node))
# import ISY doors programs
for folder_name, states in (('HA.doors', [STATE_ON, STATE_OFF]),
('HA.switches', [STATE_ON, STATE_OFF])):
try:
folder = ISY.programs['My Programs'][folder_name]
except KeyError:
# HA.doors folder does not exist
pass
else:
for dtype, name, node_id in folder.children:
if dtype is 'folder':
custom_switch = folder[node_id]
try:
actions = custom_switch['actions'].leaf
assert actions.dtype == 'program', 'Not a program'
node = custom_switch['status'].leaf
except (KeyError, AssertionError):
pass
else:
devs.append(ISYProgramDevice(name, node, actions,
states))
add_devices(devs)
class ISYSwitchDevice(ISYDeviceABC):
""" represents as isy light within home assistant. """
_domain = 'switch'
_dtype = 'binary'
_states = [STATE_ON, STATE_OFF]
class ISYProgramDevice(ISYSwitchDevice):
""" represents a door that can be manipulated within home assistant. """
_domain = 'switch'
_dtype = 'binary'
def __init__(self, name, node, actions, states):
super().__init__(node)
self._states = states
self._name = name
self.action_node = actions
def turn_on(self, **kwargs):
""" turns the device on/closes the device """
self.action_node.runThen()
def turn_off(self, **kwargs):
""" turns the device off/opens the device """
self.action_node.runElse()
+3
View File
@@ -86,6 +86,9 @@ ATTR_TRIPPED = "device_tripped"
# time the device was tripped
ATTR_LAST_TRIP_TIME = "last_tripped_time"
# For all entity's, this hold whether or not it should be hidden
ATTR_HIDDEN = "hidden"
# #### SERVICES ####
SERVICE_HOMEASSISTANT_STOP = "stop"
+54 -8
View File
@@ -8,16 +8,51 @@ Provides ABC for entities in HA.
from homeassistant import NoEntitySpecifiedError
from homeassistant.const import (
ATTR_FRIENDLY_NAME, ATTR_UNIT_OF_MEASUREMENT, STATE_ON, STATE_OFF,
DEVICE_DEFAULT_NAME, TEMP_CELCIUS, TEMP_FAHRENHEIT)
ATTR_FRIENDLY_NAME, ATTR_UNIT_OF_MEASUREMENT, ATTR_HIDDEN, STATE_ON,
STATE_OFF, DEVICE_DEFAULT_NAME, TEMP_CELCIUS, TEMP_FAHRENHEIT)
class Entity(object):
class VisibilityABC(object):
"""
Abstract Class for including visibility logic. This class includes the
necessary methods and properties to consider a visibility suggestion form
the component and then determine visibility based on the options in the
configuration file. When using this abstract class, the value for the
hidden property must still be included in the attributes disctionary. The
Entity class takes care of this automatically.
"""
# pylint: disable=too-few-public-methods
entity_id = None
visibility = {}
_hidden = False
@property
def hidden(self):
"""
Returns the official decision of whether the entity should be hidden.
Any value set by the user in the configuration file will overwrite
whatever the component sets for visibility.
"""
if self.entity_id is not None and \
self.entity_id.lower() in self.visibility:
return self.visibility[self.entity_id.lower()] == 'hide'
else:
return self._hidden
@hidden.setter
def hidden(self, val):
""" Sets the suggestion for visibility. """
self._hidden = bool(val)
class Entity(VisibilityABC):
""" ABC for Home Assistant entities. """
# pylint: disable=no-self-use
hass = None
entity_id = None
# SAFE TO OVERWRITE
# The properties and methods here are safe to overwrite when inherting this
# class. These may be used to customize the behavior of the entity.
@property
def should_poll(self):
@@ -52,6 +87,10 @@ class Entity(object):
""" Unit of measurement of this entity, if any. """
return None
def update(self):
""" Retrieve latest state. """
pass
# DEPRECATION NOTICE:
# Device is moving from getters to properties.
# For now the new properties will call the old functions
@@ -69,9 +108,13 @@ class Entity(object):
""" Returns optional state attributes. """
return None
def update(self):
""" Retrieve latest state. """
pass
# DO NOT OVERWRITE
# These properties and methods are either managed by Home Assistant or they
# are used to perform a very specific function. Overwriting these may
# produce undesirable effects in the entity's operation.
hass = None
entity_id = None
def update_ha_state(self, force_refresh=False):
"""
@@ -97,6 +140,9 @@ class Entity(object):
if ATTR_UNIT_OF_MEASUREMENT not in attr and self.unit_of_measurement:
attr[ATTR_UNIT_OF_MEASUREMENT] = self.unit_of_measurement
if ATTR_HIDDEN not in attr:
attr[ATTR_HIDDEN] = bool(self.hidden)
# Convert temperature if we detect one
if attr.get(ATTR_UNIT_OF_MEASUREMENT) in (TEMP_CELCIUS,
TEMP_FAHRENHEIT):
+6 -3
View File
@@ -34,11 +34,14 @@ python-nest>=2.1
# z-wave
pydispatcher>=2.0.5
# sensor.systemmonitor
# isy994
PyISY>=1.0.2
# sensor.systemmonitor
psutil>=2.2.1
# pushover notifications
#pushover notifications
python-pushover>=0.2
# Transmission Torrent Client
transmissionrpc>=0.11
transmissionrpc>=0.11
+1 -1
View File
@@ -34,5 +34,5 @@ if [ $(command -v md5) ]; then
elif [ $(command -v md5sum) ]; then
echo 'VERSION = "'`md5sum www_static/frontend.html | cut -c-32`'"' >> version.py
else
echo 'Could not find a MD5 utility'
echo 'Could not find an MD5 utility'
fi
+97
View File
@@ -0,0 +1,97 @@
#! /usr/bin/python
"""
Query the Home Assistant API for available entities then print them and any
desired attributes to the screen.
"""
import sys
import getpass
import argparse
try:
from urllib2 import urlopen
PYTHON = 2
except ImportError:
from urllib.request import urlopen
PYTHON = 3
import json
def main(password, askpass, attrs, address, port):
""" fetch Home Assistant api json page and post process """
# ask for password
if askpass:
password = getpass.getpass('Home Assistant API Password: ')
# fetch API result
url = mk_url(address, port, password)
response = urlopen(url).read()
if PYTHON == 3:
response = response.decode('utf-8')
data = json.loads(response)
# parse data
output = {'entity_id': []}
output.update([(attr, []) for attr in attrs])
for item in data:
output['entity_id'].append(item['entity_id'])
for attr in attrs:
output[attr].append(item['attributes'].get(attr, ''))
# output data
print_table(output, ['entity_id'] + attrs)
def print_table(data, columns):
""" format and print a table of data from a dictionary """
# get column lengths
lengths = {}
for key, value in data.items():
lengths[key] = max([len(str(val)) for val in value] + [len(key)])
# print header
for item in columns:
itemup = item.upper()
sys.stdout.write(itemup + ' ' * (lengths[item] - len(item) + 4))
sys.stdout.write('\n')
# print body
for ind in range(len(data[columns[0]])):
for item in columns:
val = str(data[item][ind])
sys.stdout.write(val + ' ' * (lengths[item] - len(val) + 4))
sys.stdout.write("\n")
def mk_url(address, port, password):
""" construct the url call for the api states page """
url = ''
if address.startswith('http://'):
url += address
else:
url += 'http://' + address
url += ':' + port + '/api/states?'
if password is not None:
url += 'api_password=' + password
return url
if __name__ == "__main__":
all_options = {'password': None, 'askpass': False, 'attrs': [],
'address': 'localhost', 'port': '8123'}
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('attrs', metavar='ATTRIBUTE', type=str, nargs='*',
help='an attribute to read from the state')
parser.add_argument('--password', dest='password', default=None,
type=str, help='API password for the HA server')
parser.add_argument('--ask-password', dest='askpass', default=False,
action='store_const', const=True,
help='prompt for HA API password')
parser.add_argument('--addr', dest='address',
default='localhost', type=str,
help='address of the HA server')
parser.add_argument('--port', dest='port', default='8123',
type=str, help='port that HA is hosting on')
args = parser.parse_args()
main(args.password, args.askpass, args.attrs, args.address, args.port)