History: Add support to fetch specific days

This commit is contained in:
Paulus Schoutsen committed 2015-06-16 00:08:57 -07:00
1 parent d34ecd1c25
commit f26ac070d5
9 files changed
+503 -225

No files matched your search

+1 -1
View File
@@ -1,2 +1,2 @@
""" DO NOT MODIFY. Auto-generated by build_frontend script """
VERSION = "9472014df7b663c70bf33bb456bd8245"
VERSION = "a6643dc82e02ec14b6c1b662f1aab661"
@@ -5876,43 +5876,64 @@ this._removeChildren();
<script>!function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return t[r].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([/*!******************************!*\
!*** ./src/export_window.js ***!
\******************************/
function(t,e,n){"use strict";"hass"in window||(window.hass=n(/*! ./homeassistant */33))},/*!*******************************!*\
function(t,e,n){"use strict";"hass"in window||(window.hass=n(/*! ./homeassistant */55))},/*!*******************************!*\
!*** ./src/app_dispatcher.js ***!
\*******************************/
function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(/*! flux */39),i=r.Dispatcher;e["default"]=new i,t.exports=e["default"]},/*!**************************!*\
function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(/*! flux */61),i=r.Dispatcher;e["default"]=new i,t.exports=e["default"]},/*!**************************!*\
!*** ./src/constants.js ***!
\**************************/
function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(/*! lodash */6),i=["ACTION_LOG_OUT","ACTION_VALIDATING_AUTH_TOKEN","ACTION_VALID_AUTH_TOKEN","ACTION_INVALID_AUTH_TOKEN","ACTION_FETCH_ALL","ACTION_NEW_CONFIG","ACTION_NEW_EVENTS","ACTION_NEW_SERVICES","ACTION_NEW_STATES","ACTION_NEW_STATE_HISTORY","ACTION_NEW_LOGBOOK","ACTION_NEW_NOTIFICATION","ACTION_SET_PREFERENCE","ACTION_EVENT_FIRED","ACTION_INITIAL_LOAD_DONE","ACTION_STREAM_START","ACTION_STREAM_STOP","ACTION_STREAM_ERROR","ACTION_REMOTE_EVENT_RECEIVED","ACTION_LISTENING_START","ACTION_LISTENING_TRANSMITTING","ACTION_LISTENING_DONE","ACTION_LISTENING_ERROR","ACTION_LISTENING_RESULT"];e["default"]=r.merge({REMOTE_EVENT_HOMEASSISTANT_START:"homeassistant_start",REMOTE_EVENT_HOMEASSISTANT_STOP:"homeassistant_stop",REMOTE_EVENT_STATE_CHANGED:"state_changed",REMOTE_EVENT_TIME_CHANGED:"time_changed",REMOTE_EVENT_CALL_SERVICE:"call_service",REMOTE_EVENT_SERVICE_EXECUTED:"service_executed",REMOTE_EVENT_PLATFORM_DISCOVERED:"platform_discovered",REMOTE_EVENT_SERVICE_REGISTERED:"service_registered",REMOTE_EVENT_COMPONENT_LOADED:"component_loaded",UNIT_TEMP_C:"°C",UNIT_TEMP_F:"°F"},r.zipObject(i,i)),t.exports=e["default"]},/*!*****************************!*\
function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(/*! lodash */9),i=["ACTION_LOG_OUT","ACTION_VALIDATING_AUTH_TOKEN","ACTION_VALID_AUTH_TOKEN","ACTION_INVALID_AUTH_TOKEN","ACTION_FETCH_ALL","ACTION_NEW_CONFIG","ACTION_NEW_EVENTS","ACTION_NEW_SERVICES","ACTION_NEW_STATES","ACTION_NEW_STATE_HISTORY","ACTION_NEW_LOGBOOK","ACTION_NEW_NOTIFICATION","ACTION_SET_PREFERENCE","ACTION_EVENT_FIRED","ACTION_INITIAL_LOAD_DONE","ACTION_STREAM_START","ACTION_STREAM_STOP","ACTION_STREAM_ERROR","ACTION_REMOTE_EVENT_RECEIVED","ACTION_LISTENING_START","ACTION_LISTENING_TRANSMITTING","ACTION_LISTENING_DONE","ACTION_LISTENING_ERROR","ACTION_LISTENING_RESULT"];e["default"]=r.merge({REMOTE_EVENT_HOMEASSISTANT_START:"homeassistant_start",REMOTE_EVENT_HOMEASSISTANT_STOP:"homeassistant_stop",REMOTE_EVENT_STATE_CHANGED:"state_changed",REMOTE_EVENT_TIME_CHANGED:"time_changed",REMOTE_EVENT_CALL_SERVICE:"call_service",REMOTE_EVENT_SERVICE_EXECUTED:"service_executed",REMOTE_EVENT_PLATFORM_DISCOVERED:"platform_discovered",REMOTE_EVENT_SERVICE_REGISTERED:"service_registered",REMOTE_EVENT_COMPONENT_LOADED:"component_loaded",UNIT_TEMP_C:"°C",UNIT_TEMP_F:"°F"},r.zipObject(i,i)),t.exports=e["default"]},/*!*****************************!*\
!*** ./src/stores/store.js ***!
\*****************************/
function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},i=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}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=n(/*! events */43),a="change",s=function(t){function e(){r(this,e),null!=t&&t.apply(this,arguments)}return o(e,t),i(e,[{key:"emitChange",value:function(){this.emit(a)}},{key:"addChangeListener",value:function(t){this.on(a,t)}},{key:"removeChangeListener",value:function(t){this.removeListener(a,t)}}]),e}(u.EventEmitter);e["default"]=s,t.exports=e["default"]},/*!***************************************!*\
function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},i=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}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=n(/*! events */97),a="change",s=function(t){function e(){r(this,e),null!=t&&t.apply(this,arguments)}return o(e,t),i(e,[{key:"emitChange",value:function(){this.emit(a)}},{key:"addChangeListener",value:function(t){this.on(a,t)}},{key:"removeChangeListener",value:function(t){this.removeListener(a,t)}}]),e}(u.EventEmitter);e["default"]=s,t.exports=e["default"]},/*!***************************************!*\
!*** ./~/immutable/dist/immutable.js ***!
\***************************************/
function(t,e,n){!function(e,n){t.exports=n()}(this,function(){"use strict";function t(t,e){e&&(t.prototype=Object.create(e.prototype)),t.prototype.constructor=t}function e(t){return t.value=!1,t}function n(t){t&&(t.value=!0)}function r(){}function i(t,e){e=e||0;for(var n=Math.max(0,t.length-e),r=new Array(n),i=0;n>i;i++)r[i]=t[i+e];return r}function o(t){return void 0===t.size&&(t.size=t.__iterate(a)),t.size}function u(t,e){return e>=0?+e:o(t)+ +e}function a(){return!0}function s(t,e,n){return(0===t||void 0!==n&&-n>=t)&&(void 0===e||void 0!==n&&e>=n)}function c(t,e){return l(t,e,0)}function f(t,e){return l(t,e,e)}function l(t,e,n){return void 0===t?n:0>t?Math.max(0,e+t):void 0===e?t:Math.min(e,t)}function h(t){return d(t)?t:C(t)}function p(t){return y(t)?t:k(t)}function _(t){return g(t)?t:x(t)}function v(t){return d(t)&&!m(t)?t:M(t)}function d(t){return!(!t||!t[vn])}function y(t){return!(!t||!t[dn])}function g(t){return!(!t||!t[yn])}function m(t){return y(t)||g(t)}function w(t){return!(!t||!t[gn])}function b(t){this.next=t}function T(t,e,n,r){var i=0===t?e:1===t?n:[e,n];return r?r.value=i:r={value:i,done:!1},r}function E(){return{value:void 0,done:!0}}function O(t){return!!A(t)}function I(t){return t&&"function"==typeof t.next}function S(t){var e=A(t);return e&&e.call(t)}function A(t){var e=t&&(Tn&&t[Tn]||t[En]);return"function"==typeof e?e:void 0}function N(t){return t&&"number"==typeof t.length}function C(t){return null===t||void 0===t?P():d(t)?t.toSeq():W(t)}function k(t){return null===t||void 0===t?P().toKeyedSeq():d(t)?y(t)?t.toSeq():t.fromEntrySeq():q(t)}function x(t){return null===t||void 0===t?P():d(t)?y(t)?t.entrySeq():t.toIndexedSeq():U(t)}function M(t){return(null===t||void 0===t?P():d(t)?y(t)?t.entrySeq():t:U(t)).toSetSeq()}function D(t){this._array=t,this.size=t.length}function R(t){var e=Object.keys(t);this._object=t,this._keys=e,this.size=e.length}function j(t){this._iterable=t,this.size=t.length||t.size}function z(t){this._iterator=t,this._iteratorCache=[]}function L(t){return!(!t||!t[In])}function P(){return Sn||(Sn=new D([]))}function q(t){var e=Array.isArray(t)?new D(t).fromEntrySeq():I(t)?new z(t).fromEntrySeq():O(t)?new j(t).fromEntrySeq():"object"==typeof t?new R(t):void 0;if(!e)throw new TypeError("Expected Array or iterable object of [k, v] entries, or keyed object: "+t);return e}function U(t){var e=G(t);if(!e)throw new TypeError("Expected Array or iterable object of values: "+t);return e}function W(t){var e=G(t)||"object"==typeof t&&new R(t);if(!e)throw new TypeError("Expected Array or iterable object of values, or keyed object: "+t);return e}function G(t){return N(t)?new D(t):I(t)?new z(t):O(t)?new j(t):void 0}function V(t,e,n,r){var i=t._cache;if(i){for(var o=i.length-1,u=0;o>=u;u++){var a=i[n?o-u:u];if(e(a[1],r?a[0]:u,t)===!1)return u+1}return u}return t.__iterateUncached(e,n)}function K(t,e,n,r){var i=t._cache;if(i){var o=i.length-1,u=0;return new b(function(){var t=i[n?o-u:u];return u++>o?E():T(e,r?t[0]:u-1,t[1])})}return t.__iteratorUncached(e,n)}function $(){throw TypeError("Abstract")}function F(){}function H(){}function B(){}function J(t,e){if(t===e||t!==t&&e!==e)return!0;if(!t||!e)return!1;if("function"==typeof t.valueOf&&"function"==typeof e.valueOf){if(t=t.valueOf(),e=e.valueOf(),t===e||t!==t&&e!==e)return!0;if(!t||!e)return!1}return"function"==typeof t.equals&&"function"==typeof e.equals&&t.equals(e)?!0:!1}function Y(t,e){return e?X(e,t,"",{"":t}):Q(t)}function X(t,e,n,r){return Array.isArray(e)?t.call(r,n,x(e).map(function(n,r){return X(t,n,r,e)})):Z(e)?t.call(r,n,k(e).map(function(n,r){return X(t,n,r,e)})):e}function Q(t){return Array.isArray(t)?x(t).map(Q).toList():Z(t)?k(t).map(Q).toMap():t}function Z(t){return t&&(t.constructor===Object||void 0===t.constructor)}function tt(t){return t>>>1&1073741824|3221225471&t}function et(t){if(t===!1||null===t||void 0===t)return 0;if("function"==typeof t.valueOf&&(t=t.valueOf(),t===!1||null===t||void 0===t))return 0;if(t===!0)return 1;var e=typeof t;if("number"===e){var n=0|t;for(n!==t&&(n^=4294967295*t);t>4294967295;)t/=4294967295,n^=t;return tt(n)}return"string"===e?t.length>Rn?nt(t):rt(t):"function"==typeof t.hashCode?t.hashCode():it(t)}function nt(t){var e=Ln[t];return void 0===e&&(e=rt(t),zn===jn&&(zn=0,Ln={}),zn++,Ln[t]=e),e}function rt(t){for(var e=0,n=0;n<t.length;n++)e=31*e+t.charCodeAt(n)|0;return tt(e)}function it(t){var e;if(xn&&(e=An.get(t),void 0!==e))return e;if(e=t[Dn],void 0!==e)return e;if(!kn){if(e=t.propertyIsEnumerable&&t.propertyIsEnumerable[Dn],void 0!==e)return e;if(e=ot(t),void 0!==e)return e}if(e=++Mn,1073741824&Mn&&(Mn=0),xn)An.set(t,e);else{if(void 0!==Cn&&Cn(t)===!1)throw new Error("Non-extensible objects are not allowed as keys.");if(kn)Object.defineProperty(t,Dn,{enumerable:!1,configurable:!1,writable:!1,value:e});else if(void 0!==t.propertyIsEnumerable&&t.propertyIsEnumerable===t.constructor.prototype.propertyIsEnumerable)t.propertyIsEnumerable=function(){return this.constructor.prototype.propertLine truncated
function(t,e,n){!function(e,n){t.exports=n()}(this,function(){"use strict";function t(t,e){e&&(t.prototype=Object.create(e.prototype)),t.prototype.constructor=t}function e(t){return t.value=!1,t}function n(t){t&&(t.value=!0)}function r(){}function i(t,e){e=e||0;for(var n=Math.max(0,t.length-e),r=new Array(n),i=0;n>i;i++)r[i]=t[i+e];return r}function o(t){return void 0===t.size&&(t.size=t.__iterate(a)),t.size}function u(t,e){return e>=0?+e:o(t)+ +e}function a(){return!0}function s(t,e,n){return(0===t||void 0!==n&&-n>=t)&&(void 0===e||void 0!==n&&e>=n)}function c(t,e){return l(t,e,0)}function f(t,e){return l(t,e,e)}function l(t,e,n){return void 0===t?n:0>t?Math.max(0,e+t):void 0===e?t:Math.min(e,t)}function h(t){return d(t)?t:x(t)}function p(t){return y(t)?t:C(t)}function _(t){return g(t)?t:k(t)}function v(t){return d(t)&&!m(t)?t:j(t)}function d(t){return!(!t||!t[vn])}function y(t){return!(!t||!t[dn])}function g(t){return!(!t||!t[yn])}function m(t){return y(t)||g(t)}function w(t){return!(!t||!t[gn])}function b(t){this.next=t}function T(t,e,n,r){var i=0===t?e:1===t?n:[e,n];return r?r.value=i:r={value:i,done:!1},r}function E(){return{value:void 0,done:!0}}function O(t){return!!A(t)}function I(t){return t&&"function"==typeof t.next}function S(t){var e=A(t);return e&&e.call(t)}function A(t){var e=t&&(Tn&&t[Tn]||t[En]);return"function"==typeof e?e:void 0}function N(t){return t&&"number"==typeof t.length}function x(t){return null===t||void 0===t?P():d(t)?t.toSeq():W(t)}function C(t){return null===t||void 0===t?P().toKeyedSeq():d(t)?y(t)?t.toSeq():t.fromEntrySeq():q(t)}function k(t){return null===t||void 0===t?P():d(t)?y(t)?t.entrySeq():t.toIndexedSeq():U(t)}function j(t){return(null===t||void 0===t?P():d(t)?y(t)?t.entrySeq():t:U(t)).toSetSeq()}function M(t){this._array=t,this.size=t.length}function D(t){var e=Object.keys(t);this._object=t,this._keys=e,this.size=e.length}function R(t){this._iterable=t,this.size=t.length||t.size}function z(t){this._iterator=t,this._iteratorCache=[]}function L(t){return!(!t||!t[In])}function P(){return Sn||(Sn=new M([]))}function q(t){var e=Array.isArray(t)?new M(t).fromEntrySeq():I(t)?new z(t).fromEntrySeq():O(t)?new R(t).fromEntrySeq():"object"==typeof t?new D(t):void 0;if(!e)throw new TypeError("Expected Array or iterable object of [k, v] entries, or keyed object: "+t);return e}function U(t){var e=G(t);if(!e)throw new TypeError("Expected Array or iterable object of values: "+t);return e}function W(t){var e=G(t)||"object"==typeof t&&new D(t);if(!e)throw new TypeError("Expected Array or iterable object of values, or keyed object: "+t);return e}function G(t){return N(t)?new M(t):I(t)?new z(t):O(t)?new R(t):void 0}function V(t,e,n,r){var i=t._cache;if(i){for(var o=i.length-1,u=0;o>=u;u++){var a=i[n?o-u:u];if(e(a[1],r?a[0]:u,t)===!1)return u+1}return u}return t.__iterateUncached(e,n)}function $(t,e,n,r){var i=t._cache;if(i){var o=i.length-1,u=0;return new b(function(){var t=i[n?o-u:u];return u++>o?E():T(e,r?t[0]:u-1,t[1])})}return t.__iteratorUncached(e,n)}function F(){throw TypeError("Abstract")}function K(){}function H(){}function B(){}function J(t,e){if(t===e||t!==t&&e!==e)return!0;if(!t||!e)return!1;if("function"==typeof t.valueOf&&"function"==typeof e.valueOf){if(t=t.valueOf(),e=e.valueOf(),t===e||t!==t&&e!==e)return!0;if(!t||!e)return!1}return"function"==typeof t.equals&&"function"==typeof e.equals&&t.equals(e)?!0:!1}function Y(t,e){return e?X(e,t,"",{"":t}):Q(t)}function X(t,e,n,r){return Array.isArray(e)?t.call(r,n,k(e).map(function(n,r){return X(t,n,r,e)})):Z(e)?t.call(r,n,C(e).map(function(n,r){return X(t,n,r,e)})):e}function Q(t){return Array.isArray(t)?k(t).map(Q).toList():Z(t)?C(t).map(Q).toMap():t}function Z(t){return t&&(t.constructor===Object||void 0===t.constructor)}function tt(t){return t>>>1&1073741824|3221225471&t}function et(t){if(t===!1||null===t||void 0===t)return 0;if("function"==typeof t.valueOf&&(t=t.valueOf(),t===!1||null===t||void 0===t))return 0;if(t===!0)return 1;var e=typeof t;if("number"===e){var n=0|t;for(n!==t&&(n^=4294967295*t);t>4294967295;)t/=4294967295,n^=t;return tt(n)}return"string"===e?t.length>Dn?nt(t):rt(t):"function"==typeof t.hashCode?t.hashCode():it(t)}function nt(t){var e=Ln[t];return void 0===e&&(e=rt(t),zn===Rn&&(zn=0,Ln={}),zn++,Ln[t]=e),e}function rt(t){for(var e=0,n=0;n<t.length;n++)e=31*e+t.charCodeAt(n)|0;return tt(e)}function it(t){var e;if(kn&&(e=An.get(t),void 0!==e))return e;if(e=t[Mn],void 0!==e)return e;if(!Cn){if(e=t.propertyIsEnumerable&&t.propertyIsEnumerable[Mn],void 0!==e)return e;if(e=ot(t),void 0!==e)return e}if(e=++jn,1073741824&jn&&(jn=0),kn)An.set(t,e);else{if(void 0!==xn&&xn(t)===!1)throw new Error("Non-extensible objects are not allowed as keys.");if(Cn)Object.defineProperty(t,Mn,{enumerable:!1,configurable:!1,writable:!1,value:e});else if(void 0!==t.propertyIsEnumerable&&t.propertyIsEnumerable===t.constructor.prototype.propertyIsEnumerable)t.propertyIsEnumerable=function(){return this.constructor.prototype.propertLine truncated
var Pn="@@__IMMUTABLE_MAP__@@",qn=Lt.prototype;qn[Pn]=!0,qn[sn]=qn.remove,qn.removeIn=qn.deleteIn,qt.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},qt.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 Zt(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 qt(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>=Gn)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,d=f?_?c:c^s:c|s,y=f?_?ae(h,l,_,v):ce(h,l,v):se(h,l,_,v);return v?(this.bitmap=d,this.nodes=y,this):new Ut(t,d,y)},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--,Vn>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,_)},Gt.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},Gt.prototype.update=function(t,e,r,o,u,a,s){void 0===r&&(r=et(o));var c=u===hn;if(r!==this.keyHash)return c?this:(n(s),n(a),Qt(this,t,e,r,[o,u]));for(var 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&&2===h)return new Vt(t,this.keyHash,f[1^l]);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 Gt(t,this.keyHash,v)},Vt.prototype.get=function(t,e,n,r){return J(n,this.entry[0])?this.entry[1]:r},Vt.prototype.update=function(t,e,r,i,o,u,a){var s=o===hn,c=J(i,this.entry[0]);return(c?o===this.entry[1]:s)?this:(n(a),s?void n(u):c?t&&t===this.ownerID?(this.entry[1]=o,this):new Vt(t,this.keyHash,[i,o]):(n(u),Qt(this,t,e,et(i),[i,o])))},qt.prototype.iterate=Gt.prototype.iterate=function(t,e){for(var n=this.entries,r=0,i=n.length-1;i>=r;r++)if(t(n[e?i-r:r])===!1)return!1},Ut.prototype.iterate=Wt.prototype.iterate=function(t,e){for(var n=this.nodes,r=0,i=n.length-1;i>=r;r++){var o=n[e?i-r:r];if(o&&o.iterate(t,e)===!1)return!1}},Vt.prototype.iterate=function(t,e){return t(this.entry)},t(Kt,b),Kt.prototype.next=function(){for(var t=this._type,e=this._stack;e;){var n,r=e.node,i=e.index++;if(r.entry){if(0===i)return $t(t,r.entry)}else if(r.entries){if(n=r.entries.length-1,n>=i)return $t(t,r.entries[this._reverse?n-i:i])}else if(n=r.nodes.length-1,n>=i){var o=r.nodes[this._reverse?n-i:i];if(o){if(o.entry)return $t(t,o.entry);e=this._stack=Ft(o,e)}continue}e=this._stack=this._stack.__prev}return E()};var Un,Wn=fn/4,Gn=fn/2,Vn=fn/4;t(fe,H),fe.of=function(){return this(arguments)},fe.prototype.toString=function(){return this.__toString("List [","]")},fe.prototype.get=function(t,e){if(t=u(this,t),0>t||t>=this.size)return e;t+=this._origin;var n=me(this,t);return n&&n.array[t&ln]},fe.prototype.set=function(t,e){return de(this,t,e)},fe.prototype.remove=function(t){return this.has(t)?0===t?this.shift():t===this.size-1?this.pop():this.splice(t,1):this},fe.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=cn,this._root=this._tail=null,this.__hash=void 0,this.__altered=!0,this):ve()},fe.prototype.push=function(){var t=arguments,e=this.size;return this.withMutations(function(n){we(n,0,e+t.length);for(var r=0;r<t.length;r++)n.set(e+r,t[r])})},fe.prototype.pop=function(){return we(this,0,-1)},fe.prototype.unshift=function(){var t=arguments;return this.withMutations(function(e){we(e,-t.length);for(var n=0;n<t.length;n++)e.set(n,t[n])})},fe.prototype.shift=function(){return we(this,1)},fe.prototype.merge=function(){return be(this,void 0,arguments)},fe.prototype.mergeWith=function(t){var e=an.call(arguments,1);return be(this,t,e)},fe.prototype.mergeDeep=function(){return be(this,re(void 0),arguments)},fe.prototype.mergeDeepWith=function(t){var e=an.call(arguments,1);return be(this,re(t),e)},fe.prototype.setSize=function(t){return we(this,0,t)},fe.prototype.slice=function(t,e){var n=this.size;return s(t,e,n)?this:we(this,c(t,n),f(e,n))},fe.prototype.__iterator=function(t,e){var n=0Line truncated
var Pn="@@__IMMUTABLE_MAP__@@",qn=Lt.prototype;qn[Pn]=!0,qn[sn]=qn.remove,qn.removeIn=qn.deleteIn,qt.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},qt.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 Zt(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 qt(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>=Gn)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,d=f?_?c:c^s:c|s,y=f?_?ae(h,l,_,v):ce(h,l,v):se(h,l,_,v);return v?(this.bitmap=d,this.nodes=y,this):new Ut(t,d,y)},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--,Vn>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,_)},Gt.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},Gt.prototype.update=function(t,e,r,o,u,a,s){void 0===r&&(r=et(o));var c=u===hn;if(r!==this.keyHash)return c?this:(n(s),n(a),Qt(this,t,e,r,[o,u]));for(var 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&&2===h)return new Vt(t,this.keyHash,f[1^l]);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 Gt(t,this.keyHash,v)},Vt.prototype.get=function(t,e,n,r){return J(n,this.entry[0])?this.entry[1]:r},Vt.prototype.update=function(t,e,r,i,o,u,a){var s=o===hn,c=J(i,this.entry[0]);return(c?o===this.entry[1]:s)?this:(n(a),s?void n(u):c?t&&t===this.ownerID?(this.entry[1]=o,this):new Vt(t,this.keyHash,[i,o]):(n(u),Qt(this,t,e,et(i),[i,o])))},qt.prototype.iterate=Gt.prototype.iterate=function(t,e){for(var n=this.entries,r=0,i=n.length-1;i>=r;r++)if(t(n[e?i-r:r])===!1)return!1},Ut.prototype.iterate=Wt.prototype.iterate=function(t,e){for(var n=this.nodes,r=0,i=n.length-1;i>=r;r++){var o=n[e?i-r:r];if(o&&o.iterate(t,e)===!1)return!1}},Vt.prototype.iterate=function(t,e){return t(this.entry)},t($t,b),$t.prototype.next=function(){for(var t=this._type,e=this._stack;e;){var n,r=e.node,i=e.index++;if(r.entry){if(0===i)return Ft(t,r.entry)}else if(r.entries){if(n=r.entries.length-1,n>=i)return Ft(t,r.entries[this._reverse?n-i:i])}else if(n=r.nodes.length-1,n>=i){var o=r.nodes[this._reverse?n-i:i];if(o){if(o.entry)return Ft(t,o.entry);e=this._stack=Kt(o,e)}continue}e=this._stack=this._stack.__prev}return E()};var Un,Wn=fn/4,Gn=fn/2,Vn=fn/4;t(fe,H),fe.of=function(){return this(arguments)},fe.prototype.toString=function(){return this.__toString("List [","]")},fe.prototype.get=function(t,e){if(t=u(this,t),0>t||t>=this.size)return e;t+=this._origin;var n=me(this,t);return n&&n.array[t&ln]},fe.prototype.set=function(t,e){return de(this,t,e)},fe.prototype.remove=function(t){return this.has(t)?0===t?this.shift():t===this.size-1?this.pop():this.splice(t,1):this},fe.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=cn,this._root=this._tail=null,this.__hash=void 0,this.__altered=!0,this):ve()},fe.prototype.push=function(){var t=arguments,e=this.size;return this.withMutations(function(n){we(n,0,e+t.length);for(var r=0;r<t.length;r++)n.set(e+r,t[r])})},fe.prototype.pop=function(){return we(this,0,-1)},fe.prototype.unshift=function(){var t=arguments;return this.withMutations(function(e){we(e,-t.length);for(var n=0;n<t.length;n++)e.set(n,t[n])})},fe.prototype.shift=function(){return we(this,1)},fe.prototype.merge=function(){return be(this,void 0,arguments)},fe.prototype.mergeWith=function(t){var e=an.call(arguments,1);return be(this,t,e)},fe.prototype.mergeDeep=function(){return be(this,re(void 0),arguments)},fe.prototype.mergeDeepWith=function(t){var e=an.call(arguments,1);return be(this,re(t),e)},fe.prototype.setSize=function(t){return we(this,0,t)},fe.prototype.slice=function(t,e){var n=this.size;return s(t,e,n)?this:we(this,c(t,n),f(e,n))},fe.prototype.__iterator=function(t,e){var n=0Line truncated
!*** ./src/call_api.js ***!
\*************************/
function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){return t&&t.__esModule?t:{"default":t}},i=n(/*! ./stores/auth */12),o=r(i),u=function(t,e){var n=void 0===arguments[2]?null:arguments[2],r=void 0===arguments[3]?{}:arguments[3],i=r.authToken||o["default"].authToken,u=o["default"].host+"/api/"+e;return new Promise(function(e,r){var o=new XMLHttpRequest;o.open(t,u,!0),o.setRequestHeader("X-HA-access",i),o.onload=function(){if(o.status>199&&o.status<300)e(JSON.parse(o.responseText));else try{r(JSON.parse(o.responseText))}catch(t){r({})}},o.onerror=function(){return r({})},n?o.send(JSON.stringify(n)):o.send()})};e["default"]=u,t.exports=e["default"]},/*!***************************!*\
function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){return t&&t.__esModule?t:{"default":t}},i=n(/*! ./stores/auth */19),o=r(i),u=function(t,e){var n=void 0===arguments[2]?null:arguments[2],r=void 0===arguments[3]?{}:arguments[3],i=r.authToken||o["default"].authToken,u=o["default"].host+"/api/"+e;return new Promise(function(e,r){var o=new XMLHttpRequest;o.open(t,u,!0),o.setRequestHeader("X-HA-access",i),o.onload=function(){if(o.status>199&&o.status<300)e(JSON.parse(o.responseText));else try{r(JSON.parse(o.responseText))}catch(t){r({})}},o.onerror=function(){return r({})},n?o.send(JSON.stringify(n)):o.send()})};e["default"]=u,t.exports=e["default"]},/*!**********************************!*\
!*** ./~/lodash/lang/isArray.js ***!
\**********************************/
function(t,e,n){var r=n(/*! ../internal/isLength */7),i=n(/*! ./isNative */48),o=n(/*! ../internal/isObjectLike */12),u="[object Array]",a=Object.prototype,s=a.toString,c=i(c=Array.isArray)&&c,f=c||function(t){return o(t)&&r(t.length)&&s.call(t)==u};t.exports=f},/*!***************************************!*\
!*** ./~/lodash/internal/isLength.js ***!
\***************************************/
function(t,e,n){function r(t){return"number"==typeof t&&t>-1&&t%1==0&&i>=t}var i=Math.pow(2,53)-1;t.exports=r},/*!***************************************!*\
!*** ./~/lodash/internal/toObject.js ***!
\***************************************/
function(t,e,n){function r(t){return i(t)?t:Object(t)}var i=n(/*! ../lang/isObject */10);t.exports=r},/*!***************************!*\
!*** ./~/lodash/index.js ***!
\***************************/
function(t,e,n){var r;(function(t,i){(function(){function o(t,e){if(t!==e){var n=t===t,r=e===e;if(t>e||!n||t===A&&r)return 1;if(e>t||!r||e===A&&n)return-1}return 0}function u(t,e,n){for(var r=t.length,i=n?r:-1;n?i--:++i<r;)if(e(t[i],i,t))return i;return-1}function a(t,e,n){if(e!==e)return g(t,n);for(var r=n-1,i=t.length;++r<i;)if(t[r]===e)return r;return-1}function s(t){return"function"==typeof t||!1}function c(t){return"string"==typeof t?t:null==t?"":t+""}function f(t){return t.charCodeAt(0)}function l(t,e){for(var n=-1,r=t.length;++n<r&&e.indexOf(t.charAt(n))>-1;);return n}function h(t,e){for(var n=t.length;n--&&e.indexOf(t.charAt(n))>-1;);return n}function p(t,e){return o(t.criteria,e.criteria)||t.index-e.index}function _(t,e,n){for(var r=-1,i=t.criteria,u=e.criteria,a=i.length,s=n.length;++r<a;){var c=o(i[r],u[r]);if(c)return r>=s?c:c*(n[r]?1:-1)}return t.index-e.index}function v(t){return Ht[t]}function d(t){return Bt[t]}function y(t){return"\\"+Xt[t]}function g(t,e,n){for(var r=t.length,i=e+(n?0:-1);n?i--:++i<r;){var o=t[i];if(o!==o)return i}return-1}function m(t){return!!t&&"object"==typeof t}function w(t){return 160>=t&&t>=9&&13>=t||32==t||160==t||5760==t||6158==t||t>=8192&&(8202>=t||8232==t||8233==t||8239==t||8287==t||12288==t||65279==t)}function b(t,e){for(var n=-1,r=t.length,i=-1,o=[];++n<r;)t[n]===e&&(t[n]=F,o[++i]=n);return o}function T(t,e){for(var n,r=-1,i=t.length,o=-1,u=[];++r<i;){var a=t[r],s=e?e(a,r,t):a;r&&n===s||(n=s,u[++o]=a)}return u}function E(t){for(var e=-1,n=t.length;++e<n&&w(t.charCodeAt(e)););return e}function O(t){for(var e=t.length;e--&&w(t.charCodeAt(e)););return e}function I(t){return Jt[t]}function S(t){function e(t){if(m(t)&&!Sa(t)&&!(t instanceof i)){if(t instanceof r)return t;if(Vo.call(t,"__chain__")&&Vo.call(t,"__wrapped__"))return ur(t)}return new r(t)}function n(){}function r(t,e,n){this.__wrapped__=t,this.__actions__=n||[],this.__chain__=!!e}function i(t){this.__wrapped__=t,this.__actions__=null,this.__dir__=1,this.__dropCount__=0,this.__filtered__=!1,this.__iteratees__=null,this.__takeCount__=Tu,this.__views__=null}function w(){var t=this.__actions__,e=this.__iteratees__,n=this.__views__,r=new i(this.__wrapped__);return r.__actions__=t?te(t):null,r.__dir__=this.__dir__,r.__filtered__=this.__filtered__,r.__iteratees__=e?te(e):null,r.__takeCount__=this.__takeCount__,r.__views__=n?te(n):null,r}function Z(){if(this.__filtered__){var t=new i(this);t.__dir__=-1,t.__filtered__=!0}else t=this.clone(),t.__dir__*=-1;return t}function rt(){var t=this.__wrapped__.value();if(!Sa(t))return tn(t,this.__actions__);var e=this.__dir__,n=0>e,r=qn(0,t.length,this.__views__),i=r.start,o=r.end,u=o-i,a=n?o:i-1,s=du(u,this.__takeCount__),c=this.__iteratees__,f=c?c.length:0,l=0,h=[];t:for(;u--&&s>l;){a+=e;for(var p=-1,_=t[a];++p<f;){var v=c[p],d=v.iteratee,y=v.type;if(y==G){if(v.done&&(n?a>v.index:a<v.index)&&(v.count=0,v.done=!1),v.index=a,!v.done){var g=v.limit;if(!(v.done=g>-1?v.count++>=g:!d(_)))continue t}}else{var m=d(_);if(y==K)_=m;else if(!m){if(y==V)continue t;break t}}}h[l++]=_}return h}function ot(){this.__data__={}}function Ht(t){return this.has(t)&&delete this.__data__[t]}function Bt(t){return"__proto__"==t?A:this.__data__[t]}function Jt(t){return"__proto__"!=t&&Vo.call(this.__data__,t)}function Yt(t,e){return"__proto__"!=t&&(this.__data__[t]=e),this}function Xt(t){var e=t?t.length:0;for(this.data={hash:hu(null),set:new iu};e--;)this.push(t[e])}function Qt(t,e){var n=t.data,r="string"==typeof e||Oi(e)?n.set.has(e):n.hash[e];return r?0:-1}function Zt(t){var e=this.data;"string"==typeof t||Oi(t)?e.set.add(t):e.hash[t]=!0}function te(t,e){var n=-1,r=t.length;for(e||(e=No(r));++n<r;)e[n]=t[n];return e}function ee(t,e){for(var n=-1,r=t.length;++n<r&&e(t[n],n,t)!==!1;);return t}function ne(t,e){for(var n=t.length;n--&&e(t[n],n,t)!==!1;);return t}function oe(t,e){for(var n=-1,r=t.length;++n<r;)if(!e(t[n],n,t))return!1;return!0}function ue(t,e){for(var n=-1,r=t.length,i=-1,o=[];++n<r;){var u=t[n];e(u,n,t)&&(o[++i]=u)}return o}function ae(t,e){for(var n=-1,r=t.length,i=No(r);++n<r;)i[n]=e(t[n],n,t);return i}function se(t){for(var e=-1,n=t.length,r=bu;++e<n;){var i=t[e];i>r&&(r=i)}return r}function ce(t){for(var e=-1,n=t.length,r=Tu;++e<n;){var i=t[e];r>i&&(r=i)}return r}function fe(t,e,n,r){var i=-1,o=t.length;for(r&&o&&(n=t[++i]);++i<o;)n=e(n,t[i],i,t);return n}function le(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 he(t,e){for(var n=-1,r=t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}function pe(t){for(var e=t.length,n=0;e--;)n+=+t[e]||0;return n}function _e(t,e){return t===A?e:t}function ve(t,e,n,r){return t!==A&&Vo.call(r,n)?t:e}function de(t,e,n){var r=Pa(e);eu.apply(r,Gu(e));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)&&(a!==A||u in t)||(t[u]=s)}return t}function ye(t,e){for(var n=-1,r=null==t,i=!r&&Kn(t),o=i&&t.length,u=e.length,a=No(u);++n<u;){var s=e[n];i?a[n]=$n(s,o)?t[s]:A:a[n]=r?A:t[s]}retLine truncated
n.slice(0,o)+t+n}function no(t,e,n){return n&&Fn(t,e,n)&&(e=0),mu(t,e)}function ro(t,e){var n="";if(t=c(t),e=+e,1>e||!t||!pu(e))return n;do e%2&&(n+=t),e=Qo(e/2),t+=t;while(e);return n}function io(t,e,n){return t=c(t),n=null==n?0:du(0>n?0:+n||0,t.length),t.lastIndexOf(e,n)==n}function oo(t,n,r){var i=e.templateSettings;r&&Fn(t,n,r)&&(n=r=null),t=c(t),n=de(xu({},r||n),i,ve);var o,u,a=de(xu({},n.imports),i.imports,ve),s=Pa(a),f=Qe(a,s),l=0,h=n.interpolate||Pt,p="__p += '",_=jo((n.escape||Pt).source+"|"+h.source+"|"+(h===It?Dt:Pt).source+"|"+(n.evaluate||Pt).source+"|$","g"),v="//# sourceURL="+("sourceURL"in n?n.sourceURL:"lodash.templateSources["+ ++Vt+"]")+"\n";t.replace(_,function(e,n,r,i,a,s){return r||(r=i),p+=t.slice(l,s).replace(qt,y),n&&(o=!0,p+="' +\n__e("+n+") +\n'"),a&&(u=!0,p+="';\n"+a+";\n__p += '"),r&&(p+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),l=s+e.length,e}),p+="';\n";var d=n.variable;d||(p="with (obj) {\n"+p+"\n}\n"),p=(u?p.replace(dt,""):p).replace(yt,"$1").replace(gt,"$1;"),p="function("+(d||"obj")+") {\n"+(d?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(u?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+p+"return __p\n}";var g=Ya(function(){return xo(s,v+"return "+p).apply(A,f)});if(g.source=p,Ei(g))throw g;return g}function uo(t,e,n){var r=t;return(t=c(t))?(n?Fn(r,e,n):null==e)?t.slice(E(t),O(t)+1):(e+="",t.slice(l(t,e),h(t,e)+1)):t}function ao(t,e,n){var r=t;return t=c(t),t?t.slice((n?Fn(r,e,n):null==e)?E(t):l(t,e+"")):t}function so(t,e,n){var r=t;return t=c(t),t?(n?Fn(r,e,n):null==e)?t.slice(0,O(t)+1):t.slice(0,h(t,e+"")+1):t}function co(t,e,n){n&&Fn(t,e,n)&&(e=null);var r=P,i=q;if(null!=e)if(Oi(e)){var o="separator"in e?e.separator:o;r="length"in e?+e.length||0:r,i="omission"in e?c(e.omission):i}else r=+e||0;if(t=c(t),r>=t.length)return t;var u=r-i.length;if(1>u)return i;var a=t.slice(0,u);if(null==o)return a+i;if(ki(o)){if(t.slice(u).search(o)){var s,f,l=t.slice(0,u);for(o.global||(o=jo(o.source,(Rt.exec(o)||"")+"g")),o.lastIndex=0;s=o.exec(l);)f=s.index;a=a.slice(0,null==f?u:f)}}else if(t.indexOf(o,u)!=u){var h=a.lastIndexOf(o);h>-1&&(a=a.slice(0,h))}return a+i}function fo(t){return t=c(t),t&&bt.test(t)?t.replace(mt,I):t}function lo(t,e,n){return n&&Fn(t,e,n)&&(e=null),t=c(t),t.match(e||Ut)||[]}function ho(t,e,n){return n&&Fn(t,e,n)&&(e=null),m(t)?vo(t):me(t,e)}function po(t){return function(){return t}}function _o(t){return t}function vo(t){return Le(we(t,!0))}function yo(t,e){return Pe(t,we(e,!0))}function go(t,e,n){if(null==n){var r=Oi(e),i=r&&Pa(e),o=i&&i.length&&xe(e,i);(o?o.length:r)||(o=!1,n=e,e=t,t=this)}o||(o=xe(e,Pa(e)));var u=!0,a=-1,s=Na(t),c=o.length;n===!1?u=!1:Oi(n)&&"chain"in n&&(u=n.chain);for(;++a<c;){var f=o[a],l=e[f];t[f]=l,s&&(t.prototype[f]=function(e){return function(){var n=this.__chain__;if(u||n){var r=t(this.__wrapped__),i=r.__actions__=te(this.__actions__);return i.push({func:e,args:arguments,thisArg:t}),r.__chain__=n,r}var o=[this.value()];return eu.apply(o,arguments),e.apply(t,o)}}(l))}return t}function mo(){return t._=Fo,this}function wo(){}function bo(t){return Hn(t)?We(t):Ge(t)}function To(t){return function(e){return Me(t,or(e),e+"")}}function Eo(t,e,n){n&&Fn(t,e,n)&&(e=n=null),t=+t||0,n=null==n?1:+n||0,null==e?(e=t,t=0):e=+e||0;for(var r=-1,i=vu(Yo((e-t)/(n||1)),0),o=No(i);++r<i;)o[r]=t,t+=n;return o}function Oo(t,e,n){if(t=Qo(t),1>t||!pu(t))return[];var r=-1,i=No(du(t,Eu));for(e=rn(e,n,1);++r<t;)Eu>r?i[r]=e(r):e(r);return i}function Io(t){var e=++Ko;return c(t)+e}function So(t,e){return(+t||0)+(+e||0)}function Ao(t,e,n){n&&Fn(t,e,n)&&(e=null);var r=Ln(),i=null==e;return r===me&&i||(i=!1,e=r(e,n,3)),i?pe(Sa(t)?t:rr(t)):Ye(t,e)}t=t?ie.defaults(re.Object(),t,ie.pick(re,Gt)):re;var No=t.Array,Co=t.Date,ko=t.Error,xo=t.Function,Mo=t.Math,Do=t.Number,Ro=t.Object,jo=t.RegExp,zo=t.String,Lo=t.TypeError,Po=No.prototype,qo=Ro.prototype,Uo=zo.prototype,Wo=(Wo=t.window)&&Wo.document,Go=xo.prototype.toString,Vo=qo.hasOwnProperty,Ko=0,$o=qo.toString,Fo=t._,Ho=jo("^"+to($o).replace(/toString|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Bo=Ai(Bo=t.ArrayBuffer)&&Bo,Jo=Ai(Jo=Bo&&new Bo(0).slice)&&Jo,Yo=Mo.ceil,Xo=t.clearTimeout,Qo=Mo.floor,Zo=Ai(Zo=Ro.getOwnPropertySymbols)&&Zo,tu=Ai(tu=Ro.getPrototypeOf)&&tu,eu=Po.push,nu=Ai(nu=Ro.preventExtensions)&&nu,ru=qo.propertyIsEnumerable,iu=Ai(iu=t.Set)&&iu,ou=t.setTimeout,uu=Po.splice,au=Ai(au=t.Uint8Array)&&au,su=Ai(su=t.WeakMap)&&su,cu=function(){try{var e=Ai(e=t.Float64Array)&&e,n=new e(new Bo(10),0,1)&&e}catch(r){}return n}(),fu=function(){var t=nu&&Ai(t=Ro.assign)&&t;try{if(t){var e=nu({1:0});e[0]=1}}catch(n){try{t(e,"xo")}catch(n){}return!e[1]&&t}return!1}(),lu=Ai(lu=No.isArray)&&lu,hu=Ai(hu=Ro.create)&&hu,pu=t.isFinite,_u=Ai(_u=Ro.keys)&&_u,vu=Mo.max,du=Mo.min,yu=Ai(yu=Co.now)&&yu,gu=Ai(gu=Do.isFinite)&&gu,mu=t.parseInt,wu=Mo.random,bu=Do.NEGATIVE_INFINITY,Tu=Do.POSITIVE_INFINITY,Eu=Mo.pow(2,32)-1,Ou=Eu-1,Iu=Eu>>>1,Su=cu?cuLine truncated
function(t,e,n){var r;(function(t,i){(function(){function o(t,e){if(t!==e){var n=t===t,r=e===e;if(t>e||!n||t===A&&r)return 1;if(e>t||!r||e===A&&n)return-1}return 0}function u(t,e,n){for(var r=t.length,i=n?r:-1;n?i--:++i<r;)if(e(t[i],i,t))return i;return-1}function a(t,e,n){if(e!==e)return g(t,n);for(var r=n-1,i=t.length;++r<i;)if(t[r]===e)return r;return-1}function s(t){return"function"==typeof t||!1}function c(t){return"string"==typeof t?t:null==t?"":t+""}function f(t){return t.charCodeAt(0)}function l(t,e){for(var n=-1,r=t.length;++n<r&&e.indexOf(t.charAt(n))>-1;);return n}function h(t,e){for(var n=t.length;n--&&e.indexOf(t.charAt(n))>-1;);return n}function p(t,e){return o(t.criteria,e.criteria)||t.index-e.index}function _(t,e,n){for(var r=-1,i=t.criteria,u=e.criteria,a=i.length,s=n.length;++r<a;){var c=o(i[r],u[r]);if(c)return r>=s?c:c*(n[r]?1:-1)}return t.index-e.index}function v(t){return Ht[t]}function d(t){return Bt[t]}function y(t){return"\\"+Xt[t]}function g(t,e,n){for(var r=t.length,i=e+(n?0:-1);n?i--:++i<r;){var o=t[i];if(o!==o)return i}return-1}function m(t){return!!t&&"object"==typeof t}function w(t){return 160>=t&&t>=9&&13>=t||32==t||160==t||5760==t||6158==t||t>=8192&&(8202>=t||8232==t||8233==t||8239==t||8287==t||12288==t||65279==t)}function b(t,e){for(var n=-1,r=t.length,i=-1,o=[];++n<r;)t[n]===e&&(t[n]=K,o[++i]=n);return o}function T(t,e){for(var n,r=-1,i=t.length,o=-1,u=[];++r<i;){var a=t[r],s=e?e(a,r,t):a;r&&n===s||(n=s,u[++o]=a)}return u}function E(t){for(var e=-1,n=t.length;++e<n&&w(t.charCodeAt(e)););return e}function O(t){for(var e=t.length;e--&&w(t.charCodeAt(e)););return e}function I(t){return Jt[t]}function S(t){function e(t){if(m(t)&&!Sa(t)&&!(t instanceof i)){if(t instanceof r)return t;if(Vo.call(t,"__chain__")&&Vo.call(t,"__wrapped__"))return ur(t)}return new r(t)}function n(){}function r(t,e,n){this.__wrapped__=t,this.__actions__=n||[],this.__chain__=!!e}function i(t){this.__wrapped__=t,this.__actions__=null,this.__dir__=1,this.__dropCount__=0,this.__filtered__=!1,this.__iteratees__=null,this.__takeCount__=Tu,this.__views__=null}function w(){var t=this.__actions__,e=this.__iteratees__,n=this.__views__,r=new i(this.__wrapped__);return r.__actions__=t?te(t):null,r.__dir__=this.__dir__,r.__filtered__=this.__filtered__,r.__iteratees__=e?te(e):null,r.__takeCount__=this.__takeCount__,r.__views__=n?te(n):null,r}function Z(){if(this.__filtered__){var t=new i(this);t.__dir__=-1,t.__filtered__=!0}else t=this.clone(),t.__dir__*=-1;return t}function rt(){var t=this.__wrapped__.value();if(!Sa(t))return tn(t,this.__actions__);var e=this.__dir__,n=0>e,r=qn(0,t.length,this.__views__),i=r.start,o=r.end,u=o-i,a=n?o:i-1,s=du(u,this.__takeCount__),c=this.__iteratees__,f=c?c.length:0,l=0,h=[];t:for(;u--&&s>l;){a+=e;for(var p=-1,_=t[a];++p<f;){var v=c[p],d=v.iteratee,y=v.type;if(y==G){if(v.done&&(n?a>v.index:a<v.index)&&(v.count=0,v.done=!1),v.index=a,!v.done){var g=v.limit;if(!(v.done=g>-1?v.count++>=g:!d(_)))continue t}}else{var m=d(_);if(y==$)_=m;else if(!m){if(y==V)continue t;break t}}}h[l++]=_}return h}function ot(){this.__data__={}}function Ht(t){return this.has(t)&&delete this.__data__[t]}function Bt(t){return"__proto__"==t?A:this.__data__[t]}function Jt(t){return"__proto__"!=t&&Vo.call(this.__data__,t)}function Yt(t,e){return"__proto__"!=t&&(this.__data__[t]=e),this}function Xt(t){var e=t?t.length:0;for(this.data={hash:hu(null),set:new iu};e--;)this.push(t[e])}function Qt(t,e){var n=t.data,r="string"==typeof e||Oi(e)?n.set.has(e):n.hash[e];return r?0:-1}function Zt(t){var e=this.data;"string"==typeof t||Oi(t)?e.set.add(t):e.hash[t]=!0}function te(t,e){var n=-1,r=t.length;for(e||(e=No(r));++n<r;)e[n]=t[n];return e}function ee(t,e){for(var n=-1,r=t.length;++n<r&&e(t[n],n,t)!==!1;);return t}function ne(t,e){for(var n=t.length;n--&&e(t[n],n,t)!==!1;);return t}function oe(t,e){for(var n=-1,r=t.length;++n<r;)if(!e(t[n],n,t))return!1;return!0}function ue(t,e){for(var n=-1,r=t.length,i=-1,o=[];++n<r;){var u=t[n];e(u,n,t)&&(o[++i]=u)}return o}function ae(t,e){for(var n=-1,r=t.length,i=No(r);++n<r;)i[n]=e(t[n],n,t);return i}function se(t){for(var e=-1,n=t.length,r=bu;++e<n;){var i=t[e];i>r&&(r=i)}return r}function ce(t){for(var e=-1,n=t.length,r=Tu;++e<n;){var i=t[e];r>i&&(r=i)}return r}function fe(t,e,n,r){var i=-1,o=t.length;for(r&&o&&(n=t[++i]);++i<o;)n=e(n,t[i],i,t);return n}function le(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 he(t,e){for(var n=-1,r=t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}function pe(t){for(var e=t.length,n=0;e--;)n+=+t[e]||0;return n}function _e(t,e){return t===A?e:t}function ve(t,e,n,r){return t!==A&&Vo.call(r,n)?t:e}function de(t,e,n){var r=Pa(e);eu.apply(r,Gu(e));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)&&(a!==A||u in t)||(t[u]=s)}return t}function ye(t,e){for(var n=-1,r=null==t,i=!r&&$n(t),o=i&&t.length,u=e.length,a=No(u);++n<u;){var s=e[n];i?a[n]=Fn(s,o)?t[s]:A:a[n]=r?A:t[s]}retLine truncated
n.slice(0,o)+t+n}function no(t,e,n){return n&&Kn(t,e,n)&&(e=0),mu(t,e)}function ro(t,e){var n="";if(t=c(t),e=+e,1>e||!t||!pu(e))return n;do e%2&&(n+=t),e=Qo(e/2),t+=t;while(e);return n}function io(t,e,n){return t=c(t),n=null==n?0:du(0>n?0:+n||0,t.length),t.lastIndexOf(e,n)==n}function oo(t,n,r){var i=e.templateSettings;r&&Kn(t,n,r)&&(n=r=null),t=c(t),n=de(ku({},r||n),i,ve);var o,u,a=de(ku({},n.imports),i.imports,ve),s=Pa(a),f=Qe(a,s),l=0,h=n.interpolate||Pt,p="__p += '",_=Ro((n.escape||Pt).source+"|"+h.source+"|"+(h===It?Mt:Pt).source+"|"+(n.evaluate||Pt).source+"|$","g"),v="//# sourceURL="+("sourceURL"in n?n.sourceURL:"lodash.templateSources["+ ++Vt+"]")+"\n";t.replace(_,function(e,n,r,i,a,s){return r||(r=i),p+=t.slice(l,s).replace(qt,y),n&&(o=!0,p+="' +\n__e("+n+") +\n'"),a&&(u=!0,p+="';\n"+a+";\n__p += '"),r&&(p+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),l=s+e.length,e}),p+="';\n";var d=n.variable;d||(p="with (obj) {\n"+p+"\n}\n"),p=(u?p.replace(dt,""):p).replace(yt,"$1").replace(gt,"$1;"),p="function("+(d||"obj")+") {\n"+(d?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(u?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+p+"return __p\n}";var g=Ya(function(){return ko(s,v+"return "+p).apply(A,f)});if(g.source=p,Ei(g))throw g;return g}function uo(t,e,n){var r=t;return(t=c(t))?(n?Kn(r,e,n):null==e)?t.slice(E(t),O(t)+1):(e+="",t.slice(l(t,e),h(t,e)+1)):t}function ao(t,e,n){var r=t;return t=c(t),t?t.slice((n?Kn(r,e,n):null==e)?E(t):l(t,e+"")):t}function so(t,e,n){var r=t;return t=c(t),t?(n?Kn(r,e,n):null==e)?t.slice(0,O(t)+1):t.slice(0,h(t,e+"")+1):t}function co(t,e,n){n&&Kn(t,e,n)&&(e=null);var r=P,i=q;if(null!=e)if(Oi(e)){var o="separator"in e?e.separator:o;r="length"in e?+e.length||0:r,i="omission"in e?c(e.omission):i}else r=+e||0;if(t=c(t),r>=t.length)return t;var u=r-i.length;if(1>u)return i;var a=t.slice(0,u);if(null==o)return a+i;if(Ci(o)){if(t.slice(u).search(o)){var s,f,l=t.slice(0,u);for(o.global||(o=Ro(o.source,(Dt.exec(o)||"")+"g")),o.lastIndex=0;s=o.exec(l);)f=s.index;a=a.slice(0,null==f?u:f)}}else if(t.indexOf(o,u)!=u){var h=a.lastIndexOf(o);h>-1&&(a=a.slice(0,h))}return a+i}function fo(t){return t=c(t),t&&bt.test(t)?t.replace(mt,I):t}function lo(t,e,n){return n&&Kn(t,e,n)&&(e=null),t=c(t),t.match(e||Ut)||[]}function ho(t,e,n){return n&&Kn(t,e,n)&&(e=null),m(t)?vo(t):me(t,e)}function po(t){return function(){return t}}function _o(t){return t}function vo(t){return Le(we(t,!0))}function yo(t,e){return Pe(t,we(e,!0))}function go(t,e,n){if(null==n){var r=Oi(e),i=r&&Pa(e),o=i&&i.length&&ke(e,i);(o?o.length:r)||(o=!1,n=e,e=t,t=this)}o||(o=ke(e,Pa(e)));var u=!0,a=-1,s=Na(t),c=o.length;n===!1?u=!1:Oi(n)&&"chain"in n&&(u=n.chain);for(;++a<c;){var f=o[a],l=e[f];t[f]=l,s&&(t.prototype[f]=function(e){return function(){var n=this.__chain__;if(u||n){var r=t(this.__wrapped__),i=r.__actions__=te(this.__actions__);return i.push({func:e,args:arguments,thisArg:t}),r.__chain__=n,r}var o=[this.value()];return eu.apply(o,arguments),e.apply(t,o)}}(l))}return t}function mo(){return t._=Ko,this}function wo(){}function bo(t){return Hn(t)?We(t):Ge(t)}function To(t){return function(e){return je(t,or(e),e+"")}}function Eo(t,e,n){n&&Kn(t,e,n)&&(e=n=null),t=+t||0,n=null==n?1:+n||0,null==e?(e=t,t=0):e=+e||0;for(var r=-1,i=vu(Yo((e-t)/(n||1)),0),o=No(i);++r<i;)o[r]=t,t+=n;return o}function Oo(t,e,n){if(t=Qo(t),1>t||!pu(t))return[];var r=-1,i=No(du(t,Eu));for(e=rn(e,n,1);++r<t;)Eu>r?i[r]=e(r):e(r);return i}function Io(t){var e=++$o;return c(t)+e}function So(t,e){return(+t||0)+(+e||0)}function Ao(t,e,n){n&&Kn(t,e,n)&&(e=null);var r=Ln(),i=null==e;return r===me&&i||(i=!1,e=r(e,n,3)),i?pe(Sa(t)?t:rr(t)):Ye(t,e)}t=t?ie.defaults(re.Object(),t,ie.pick(re,Gt)):re;var No=t.Array,xo=t.Date,Co=t.Error,ko=t.Function,jo=t.Math,Mo=t.Number,Do=t.Object,Ro=t.RegExp,zo=t.String,Lo=t.TypeError,Po=No.prototype,qo=Do.prototype,Uo=zo.prototype,Wo=(Wo=t.window)&&Wo.document,Go=ko.prototype.toString,Vo=qo.hasOwnProperty,$o=0,Fo=qo.toString,Ko=t._,Ho=Ro("^"+to(Fo).replace(/toString|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Bo=Ai(Bo=t.ArrayBuffer)&&Bo,Jo=Ai(Jo=Bo&&new Bo(0).slice)&&Jo,Yo=jo.ceil,Xo=t.clearTimeout,Qo=jo.floor,Zo=Ai(Zo=Do.getOwnPropertySymbols)&&Zo,tu=Ai(tu=Do.getPrototypeOf)&&tu,eu=Po.push,nu=Ai(nu=Do.preventExtensions)&&nu,ru=qo.propertyIsEnumerable,iu=Ai(iu=t.Set)&&iu,ou=t.setTimeout,uu=Po.splice,au=Ai(au=t.Uint8Array)&&au,su=Ai(su=t.WeakMap)&&su,cu=function(){try{var e=Ai(e=t.Float64Array)&&e,n=new e(new Bo(10),0,1)&&e}catch(r){}return n}(),fu=function(){var t=nu&&Ai(t=Do.assign)&&t;try{if(t){var e=nu({1:0});e[0]=1}}catch(n){try{t(e,"xo")}catch(n){}return!e[1]&&t}return!1}(),lu=Ai(lu=No.isArray)&&lu,hu=Ai(hu=Do.create)&&hu,pu=t.isFinite,_u=Ai(_u=Do.keys)&&_u,vu=jo.max,du=jo.min,yu=Ai(yu=xo.now)&&yu,gu=Ai(gu=Mo.isFinite)&&gu,mu=t.parseInt,wu=jo.random,bu=Mo.NEGATIVE_INFINITY,Tu=Mo.POSITIVE_INFINITY,Eu=jo.pow(2,32)-1,Ou=Eu-1,Iu=Eu>>>1,Su=cu?cuLine truncated
!*** ./~/lodash/lang/isObject.js ***!
\***********************************/
function(t,e,n){function r(t){var e=typeof t;return"function"==e||!!t&&"object"==e}t.exports=r},/*!******************************************!*\
!*** ./~/lodash/internal/isArrayLike.js ***!
\******************************************/
function(t,e,n){function r(t){return null!=t&&o(i(t))}var i=n(/*! ./getLength */43),o=n(/*! ./isLength */7);t.exports=r},/*!*******************************************!*\
!*** ./~/lodash/internal/isObjectLike.js ***!
\*******************************************/
function(t,e,n){function r(t){return!!t&&"object"==typeof t}t.exports=r},/*!*********************************!*\
!*** ./~/lodash/object/keys.js ***!
\*********************************/
function(t,e,n){var r=n(/*! ../internal/isArrayLike */11),i=n(/*! ../lang/isNative */48),o=n(/*! ../lang/isObject */10),u=n(/*! ../internal/shimKeys */89),a=i(a=Object.keys)&&a,s=a?function(t){var e=null!=t&&t.constructor;return"function"==typeof e&&e.prototype===t||"function"!=typeof t&&r(t)?u(t):o(t)?a(t):[]}:u;t.exports=s},/*!*************************************!*\
!*** ./src/actions/notification.js ***!
\*************************************/
function(t,e,n){"use strict";function r(t){i.dispatch({actionType:u,message:t})}Object.defineProperty(e,"__esModule",{value:!0}),e.notify=r;var i=n(/*! ../app_dispatcher */1),o=n(/*! ../constants */2),u=o.ACTION_NEW_NOTIFICATION},/*!********************************!*\
!*** ./src/actions/service.js ***!
\********************************/
function(t,e,n){"use strict";function r(t){t.length>0&&h["default"].dispatch({actionType:_["default"].ACTION_NEW_SERVICES,services:t})}function i(t){return u("homeassistant","turn_on",{entity_id:t})}function o(t){return u("homeassistant","turn_off",{entity_id:t})}function u(t,e){var n=void 0===arguments[2]?{}:arguments[2];return f["default"]("POST","services/"+t+"/"+e,n).then(function(r){v.notify("turn_on"==e&&n.entity_id?"Turned on "+n.entity_id+".":"turn_off"==e&&n.entity_id?"Turned off "+n.entity_id+".":"Service "+t+"/"+e+" called."),d.newStates(r)})}function a(){return f["default"]("GET","services").then(r)}Object.defineProperty(e,"__esModule",{value:!0});var s=function(t){return t&&t.__esModule?t:{"default":t}};e.newServices=r,e.callTurnOn=i,e.callTurnOff=o,e.callService=u,e.fetchAll=a;var c=n(/*! ../call_api */5),f=s(c),l=n(/*! ../app_dispatcher */1),h=s(l),p=n(/*! ../constants */2),_=s(p),v=n(/*! ./notification */7),d=n(/*! ./state */9)},/*!******************************!*\
function(t,e,n){"use strict";function r(t){t.length>0&&h["default"].dispatch({actionType:_["default"].ACTION_NEW_SERVICES,services:t})}function i(t){return u("homeassistant","turn_on",{entity_id:t})}function o(t){return u("homeassistant","turn_off",{entity_id:t})}function u(t,e){var n=void 0===arguments[2]?{}:arguments[2];return f["default"]("POST","services/"+t+"/"+e,n).then(function(r){v.notify("turn_on"==e&&n.entity_id?"Turned on "+n.entity_id+".":"turn_off"==e&&n.entity_id?"Turned off "+n.entity_id+".":"Service "+t+"/"+e+" called."),d.newStates(r)})}function a(){return f["default"]("GET","services").then(r)}Object.defineProperty(e,"__esModule",{value:!0});var s=function(t){return t&&t.__esModule?t:{"default":t}};e.newServices=r,e.callTurnOn=i,e.callTurnOff=o,e.callService=u,e.fetchAll=a;var c=n(/*! ../call_api */5),f=s(c),l=n(/*! ../app_dispatcher */1),h=s(l),p=n(/*! ../constants */2),_=s(p),v=n(/*! ./notification */14),d=n(/*! ./state */16)},/*!******************************!*\
!*** ./src/actions/state.js ***!
\******************************/
function(t,e,n){"use strict";function r(t,e){(t.length>0||e)&&l["default"].dispatch({actionType:h.ACTION_NEW_STATES,states:t,replace:!!e})}function i(t,e){var n=void 0===arguments[2]?!1:arguments[2],i={state:e};n&&(i.attributes=n),c["default"]("POST","states/"+t,i).then(function(n){p.notify("State of "+t+" set to "+e+"."),r([n])})}function o(t){c["default"]("GET","states/"+t).then(function(t){r([t])})}function u(){c["default"]("GET","states").then(function(t){r(t,!0)})}Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){return t&&t.__esModule?t:{"default":t}};e.newStates=r,e.set=i,e.fetch=o,e.fetchAll=u;var s=n(/*! ../call_api */5),c=a(s),f=n(/*! ../app_dispatcher */1),l=a(f),h=n(/*! ../constants */2),p=n(/*! ./notification */7)},/*!*****************************!*\
function(t,e,n){"use strict";function r(t,e){(t.length>0||e)&&l["default"].dispatch({actionType:h.ACTION_NEW_STATES,states:t,replace:!!e})}function i(t,e){var n=void 0===arguments[2]?!1:arguments[2],i={state:e};n&&(i.attributes=n),c["default"]("POST","states/"+t,i).then(function(n){p.notify("State of "+t+" set to "+e+"."),r([n])})}function o(t){c["default"]("GET","states/"+t).then(function(t){r([t])})}function u(){c["default"]("GET","states").then(function(t){r(t,!0)})}Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){return t&&t.__esModule?t:{"default":t}};e.newStates=r,e.set=i,e.fetch=o,e.fetchAll=u;var s=n(/*! ../call_api */5),c=a(s),f=n(/*! ../app_dispatcher */1),l=a(f),h=n(/*! ../constants */2),p=n(/*! ./notification */14)},/*!*****************************!*\
!*** ./src/actions/sync.js ***!
\*****************************/
function(t,e,n){"use strict";function r(){f["default"].dispatch({actionType:h["default"].ACTION_FETCH_ALL}),p.fetch(),v&&d()}function i(){v=!0,r()}function o(){v=!1,d.cancel()}Object.defineProperty(e,"__esModule",{value:!0});var u=function(t){return t&&t.__esModule?t:{"default":t}};e.fetchAll=r,e.start=i,e.stop=o;var a=n(/*! lodash */6),s=u(a),c=n(/*! ../app_dispatcher */1),f=u(c),l=n(/*! ../constants */2),h=u(l),p=n(/*! ./bootstrap */16),_=3e4,v=!1,d=s["default"].debounce(r,_)},/*!*****************************!*\
function(t,e,n){"use strict";function r(){f["default"].dispatch({actionType:h["default"].ACTION_FETCH_ALL}),p.fetch(),v&&d()}function i(){v=!0,r()}function o(){v=!1,d.cancel()}Object.defineProperty(e,"__esModule",{value:!0});var u=function(t){return t&&t.__esModule?t:{"default":t}};e.fetchAll=r,e.start=i,e.stop=o;var a=n(/*! lodash */9),s=u(a),c=n(/*! ../app_dispatcher */1),f=u(c),l=n(/*! ../constants */2),h=u(l),p=n(/*! ./bootstrap */24),_=3e4,v=!1,d=s["default"].debounce(r,_)},/*!*****************************!*\
!*** ./src/models/state.js ***!
\*****************************/
function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){return t&&t.__esModule?t:{"default":t}},i=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t)){var n=[],r=!0,i=!1,o=void 0;try{for(var u,a=t[Symbol.iterator]();!(r=(u=a.next()).done)&&(n.push(u.value),!e||n.length!==e);r=!0);}catch(s){i=!0,o=s}finally{try{!r&&a["return"]&&a["return"]()}finally{if(i)throw o}}return n}throw new TypeError("Invalid attempt to destructure non-iterable instance")},o=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},u=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),a=function(t,e,n){for(var r=!0;r;){a=c=s=void 0,r=!1;var i=t,o=e,u=n,a=Object.getOwnPropertyDescriptor(i,o);if(void 0!==a){if("value"in a)return a.value;var s=a.get;return void 0===s?void 0:s.call(u)}var c=Object.getPrototypeOf(i);if(null===c)return void 0;t=c,e=o,n=u,r=!0}},s=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)},c=n(/*! immutable */4),f=n(/*! ../stores/service */13),l=r(f),h=n(/*! ../util */15),p=new c.Record({entityId:null,domain:null,objectId:null,state:null,entityDisplay:null,stateDisplay:null,lastChanged:null,lastChangedAsDate:null,attributes:{},isCustomGroup:null},"State"),_=function(t){function e(t,n,r){var u=void 0===arguments[3]?{}:arguments[3];o(this,e);var s=t.split("."),c=i(s,2),f=c[0],l=c[1],p=n.replace(/_/g," ");u.unit_of_measurement&&(p+=" "+u.unit_of_measurement),a(Object.getPrototypeOf(e.prototype),"constructor",this).call(this,{entityId:t,domain:f,objectId:l,state:n,stateDisplay:p,lastChanged:r,attributes:u,entityDisplay:u.friendly_name||l.replace(/_/g," "),lastChangedAsDate:h.parseDateTime(r),isCustomGroup:"group"===f&&!u.auto})}return s(e,t),u(e,[{key:"canToggle",get:function(){return"group"===this.domain&&("on"===this.state||"off"===this.state)||l["default"].has(this.domain,"turn_on")}}],[{key:"fromJSON",value:function(t){var n=t.entity_id,r=t.state,i=t.last_changed,o=t.attributes;return new e(n,r,i,o)}}]),e}(p);e["default"]=_,t.exports=e["default"]},/*!****************************!*\
function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){return t&&t.__esModule?t:{"default":t}},i=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t)){var n=[],r=!0,i=!1,o=void 0;try{for(var u,a=t[Symbol.iterator]();!(r=(u=a.next()).done)&&(n.push(u.value),!e||n.length!==e);r=!0);}catch(s){i=!0,o=s}finally{try{!r&&a["return"]&&a["return"]()}finally{if(i)throw o}}return n}throw new TypeError("Invalid attempt to destructure non-iterable instance")},o=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},u=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),a=function(t,e,n){for(var r=!0;r;){a=c=s=void 0,r=!1;var i=t,o=e,u=n,a=Object.getOwnPropertyDescriptor(i,o);if(void 0!==a){if("value"in a)return a.value;var s=a.get;return void 0===s?void 0:s.call(u)}var c=Object.getPrototypeOf(i);if(null===c)return void 0;t=c,e=o,n=u,r=!0}},s=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)},c=n(/*! immutable */4),f=n(/*! ../stores/service */20),l=r(f),h=n(/*! ../util */22),p=new c.Record({entityId:null,domain:null,objectId:null,state:null,entityDisplay:null,stateDisplay:null,lastChanged:null,lastChangedAsDate:null,attributes:{},isCustomGroup:null},"State"),_=function(t){function e(t,n,r){var u=void 0===arguments[3]?{}:arguments[3];o(this,e);var s=t.split("."),c=i(s,2),f=c[0],l=c[1],p=n.replace(/_/g," ");u.unit_of_measurement&&(p+=" "+u.unit_of_measurement),a(Object.getPrototypeOf(e.prototype),"constructor",this).call(this,{entityId:t,domain:f,objectId:l,state:n,stateDisplay:p,lastChanged:r,attributes:u,entityDisplay:u.friendly_name||l.replace(/_/g," "),lastChangedAsDate:h.parseDateTime(r),isCustomGroup:"group"===f&&!u.auto})}return s(e,t),u(e,[{key:"canToggle",get:function(){return"group"===this.domain&&("on"===this.state||"off"===this.state)||l["default"].has(this.domain,"turn_on")}}],[{key:"fromJSON",value:function(t){var n=t.entity_id,r=t.state,i=t.last_changed,o=t.attributes;return new e(n,r,i,o)}}]),e}(p);e["default"]=_,t.exports=e["default"]},/*!****************************!*\
!*** ./src/stores/auth.js ***!
\****************************/
function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){return t&&t.__esModule?t:{"default":t}},i=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},o=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),u=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)},a=n(/*! ../app_dispatcher */1),s=r(a),c=n(/*! ../constants */2),f=r(c),l=n(/*! ../stores/store */3),h=r(l),p=!1,_=!1,v="",d="",y=!1,g="",m=function(t){function e(){i(this,e),null!=t&&t.apply(this,arguments)}return u(e,t),o(e,[{key:"isValidating",get:function(){return p}},{key:"isLoggedIn",get:function(){return _}},{key:"authToken",get:function(){return v}},{key:"host",get:function(){return d}},{key:"lastAttemptInvalid",get:function(){return y}},{key:"lastAttemptMessage",get:function(){return g}}]),e}(h["default"]),w=new m;w.dispatchToken=s["default"].register(function(t){switch(t.actionType){case f["default"].ACTION_VALIDATING_AUTH_TOKEN:p=!0,v=t.authToken,d=t.host,w.emitChange();break;case f["default"].ACTION_VALID_AUTH_TOKEN:p=!1,_=!0,y=!1,g="",w.emitChange();break;case f["default"].ACTION_INVALID_AUTH_TOKEN:p=!1,_=!1,v="",d="",y=!0,g=t.message||"Unexpected result from API",w.emitChange();break;case f["default"].ACTION_LOG_OUT:p=!1,_=!1,v="",d="",y=!1,g="",w.emitChange()}}),e["default"]=w,t.exports=e["default"]},/*!*******************************!*\
@@ -5924,70 +5945,115 @@ function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});va
function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){return t&&t.__esModule?t:{"default":t}},i=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},o=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),u=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)},a=n(/*! ../app_dispatcher */1),s=r(a),c=n(/*! ../constants */2),f=r(c),l=n(/*! ./store */3),h=r(l),p="STATE_CONNECTED",_="STATE_DISCONNECTED",v="STATE_ERROR",d=_,y=function(t){function e(){i(this,e),null!=t&&t.apply(this,arguments)}return u(e,t),o(e,[{key:"state",get:function(){return d}},{key:"isStreaming",get:function(){return d===this.STATE_CONNECTED}},{key:"hasError",get:function(){return d===this.STATE_ERROR}}]),e}(h["default"]),g=new y;g.STATE_CONNECTED=p,g.STATE_DISCONNECTED=_,g.STATE_ERROR=v,g.dispatchToken=s["default"].register(function(t){switch(t.actionType){case f["default"].ACTION_STREAM_START:d=p,g.emitChange();break;case f["default"].ACTION_STREAM_STOP:d=_,g.emitChange();break;case f["default"].ACTION_STREAM_ERROR:d=v,g.emitChange()}}),e["default"]=g,t.exports=e["default"]},/*!*********************!*\
!*** ./src/util.js ***!
\*********************/
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(Date.UTC(v,parseInt(_)-1,p,s,c,f))}Object.defineProperty(e,"__esModule",{value:!0});var i=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t)){var n=[],r=!0,i=!1,o=void 0;try{for(var u,a=t[Symbol.iterator]();!(r=(u=a.next()).done)&&(n.push(u.value),!e||n.length!==e);r=!0);}catch(s){i=!0,o=s}finally{try{!r&&a["return"]&&a["return"]()}finally{if(i)throw o}}return n}throw new TypeError("Invalid attempt to destructure non-iterable instance")};e.parseDateTime=r},/*!**********************************!*\
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(Date.UTC(v,parseInt(_)-1,p,s,c,f))}Object.defineProperty(e,"__esModule",{value:!0});var i=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t)){var n=[],r=!0,i=!1,o=void 0;try{for(var u,a=t[Symbol.iterator]();!(r=(u=a.next()).done)&&(n.push(u.value),!e||n.length!==e);r=!0);}catch(s){i=!0,o=s}finally{try{!r&&a["return"]&&a["return"]()}finally{if(i)throw o}}return n}throw new TypeError("Invalid attempt to destructure non-iterable instance")};e.parseDateTime=r},/*!**************************************!*\
!*** ./~/lodash/internal/isIndex.js ***!
\**************************************/
function(t,e,n){function r(t,e){return t=+t,e=null==e?i:e,t>-1&&t%1==0&&e>t}var i=Math.pow(2,53)-1;t.exports=r},/*!**********************************!*\
!*** ./src/actions/bootstrap.js ***!
\**********************************/
function(t,e,n){"use strict";function r(t){f.newStates(t.states,!0),l.newServices(t.services),h.newEvents(t.events),p.newConfig(t.config)}function i(){void 0===arguments[0]?!1:arguments[0];return a["default"]("GET","bootstrap").then(r)}Object.defineProperty(e,"__esModule",{value:!0});var o=function(t){return t&&t.__esModule?t:{"default":t}};e.newBootstrapData=r,e.fetch=i;var u=n(/*! ../call_api */5),a=o(u),s=n(/*! ../app_dispatcher */1),c=(o(s),n(/*! ../constants */2)),f=(o(c),n(/*! ./state */9)),l=n(/*! ./service */8),h=n(/*! ./event */18),p=n(/*! ./config */17)},/*!*******************************!*\
function(t,e,n){"use strict";function r(t){f.newStates(t.states,!0),l.newServices(t.services),h.newEvents(t.events),p.newConfig(t.config)}function i(){void 0===arguments[0]?!1:arguments[0];return a["default"]("GET","bootstrap").then(r)}Object.defineProperty(e,"__esModule",{value:!0});var o=function(t){return t&&t.__esModule?t:{"default":t}};e.newBootstrapData=r,e.fetch=i;var u=n(/*! ../call_api */5),a=o(u),s=n(/*! ../app_dispatcher */1),c=(o(s),n(/*! ../constants */2)),f=(o(c),n(/*! ./state */16)),l=n(/*! ./service */15),h=n(/*! ./event */26),p=n(/*! ./config */25)},/*!*******************************!*\
!*** ./src/actions/config.js ***!
\*******************************/
function(t,e,n){"use strict";function r(t){c["default"].dispatch({actionType:l["default"].ACTION_NEW_CONFIG,config:t})}function i(){return a["default"]("GET","config").then(r)}Object.defineProperty(e,"__esModule",{value:!0});var o=function(t){return t&&t.__esModule?t:{"default":t}};e.newConfig=r,e.fetch=i;var u=n(/*! ../call_api */5),a=o(u),s=n(/*! ../app_dispatcher */1),c=o(s),f=n(/*! ../constants */2),l=o(f)},/*!******************************!*\
!*** ./src/actions/event.js ***!
\******************************/
function(t,e,n){"use strict";function r(t){f["default"].dispatch({actionType:h["default"].ACTION_NEW_EVENTS,events:t})}function i(){s["default"]("GET","events").then(r)}function o(t){var e=void 0===arguments[1]?{}:arguments[1];return s["default"]("POST","events/"+t,e).then(function(){p.notify("Event "+t+" successful fired!"),f["default"].dispatch({actionType:h["default"].ACTION_EVENT_FIRED,eventType:t,eventData:e})})}Object.defineProperty(e,"__esModule",{value:!0});var u=function(t){return t&&t.__esModule?t:{"default":t}};e.newEvents=r,e.fetchAll=i,e.fire=o;var a=n(/*! ../call_api */5),s=u(a),c=n(/*! ../app_dispatcher */1),f=u(c),l=n(/*! ../constants */2),h=u(l),p=n(/*! ./notification */7)},/*!*******************************!*\
function(t,e,n){"use strict";function r(t){f["default"].dispatch({actionType:h["default"].ACTION_NEW_EVENTS,events:t})}function i(){s["default"]("GET","events").then(r)}function o(t){var e=void 0===arguments[1]?{}:arguments[1];return s["default"]("POST","events/"+t,e).then(function(){p.notify("Event "+t+" successful fired!"),f["default"].dispatch({actionType:h["default"].ACTION_EVENT_FIRED,eventType:t,eventData:e})})}Object.defineProperty(e,"__esModule",{value:!0});var u=function(t){return t&&t.__esModule?t:{"default":t}};e.newEvents=r,e.fetchAll=i,e.fire=o;var a=n(/*! ../call_api */5),s=u(a),c=n(/*! ../app_dispatcher */1),f=u(c),l=n(/*! ../constants */2),h=u(l),p=n(/*! ./notification */14)},/*!*******************************!*\
!*** ./src/actions/stream.js ***!
\*******************************/
function(t,e,n){"use strict";function r(){return"EventSource"in window}function i(t){var e=void 0===arguments[1]?!0:arguments[1];null!==y&&w();var n="/api/stream";t&&(n+="?api_password="+t),y=new EventSource(n),g=t,y.addEventListener("open",function(){m(),l["default"].dispatch({actionType:p["default"].ACTION_STREAM_START}),v.stop(),e?v.fetchAll():e=!0},!1),y.addEventListener("message",function(t){m(),"ping"!==t.data&&l["default"].dispatch({actionType:p["default"].ACTION_REMOTE_EVENT_RECEIVED,event:JSON.parse(t.data)})},!1),y.addEventListener("error",function(){y.readyState!==EventSource.CLOSED&&l["default"].dispatch({actionType:p["default"].ACTION_STREAM_ERROR})},!1)}function o(){w(),l["default"].dispatch({actionType:p["default"].ACTION_STREAM_STOP}),v.start()}Object.defineProperty(e,"__esModule",{value:!0});var u=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e["default"]=t,e},a=function(t){return t&&t.__esModule?t:{"default":t}};e.isSupported=r,e.start=i,e.stop=o;var s=n(/*! lodash */6),c=a(s),f=n(/*! ../app_dispatcher */1),l=a(f),h=n(/*! ../constants */2),p=a(h),_=n(/*! ./sync */10),v=u(_),d=6e4,y=null,g=null,m=c["default"].debounce(function(){i(g)},d),w=function(){y.close(),y=null,g=null,m.cancel()}},/*!*********************************!*\
function(t,e,n){"use strict";function r(){return"EventSource"in window}function i(t){var e=void 0===arguments[1]?!0:arguments[1];null!==y&&w();var n="/api/stream";t&&(n+="?api_password="+t),y=new EventSource(n),g=t,y.addEventListener("open",function(){m(),l["default"].dispatch({actionType:p["default"].ACTION_STREAM_START}),v.stop(),e?v.fetchAll():e=!0},!1),y.addEventListener("message",function(t){m(),"ping"!==t.data&&l["default"].dispatch({actionType:p["default"].ACTION_REMOTE_EVENT_RECEIVED,event:JSON.parse(t.data)})},!1),y.addEventListener("error",function(){y.readyState!==EventSource.CLOSED&&l["default"].dispatch({actionType:p["default"].ACTION_STREAM_ERROR})},!1)}function o(){w(),l["default"].dispatch({actionType:p["default"].ACTION_STREAM_STOP}),v.start()}Object.defineProperty(e,"__esModule",{value:!0});var u=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e["default"]=t,e},a=function(t){return t&&t.__esModule?t:{"default":t}};e.isSupported=r,e.start=i,e.stop=o;var s=n(/*! lodash */9),c=a(s),f=n(/*! ../app_dispatcher */1),l=a(f),h=n(/*! ../constants */2),p=a(h),_=n(/*! ./sync */17),v=u(_),d=6e4,y=null,g=null,m=c["default"].debounce(function(){i(g)},d),w=function(){y.close(),y=null,g=null,m.cancel()}},/*!*********************************!*\
!*** ./src/stores/component.js ***!
\*********************************/
function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){return t&&t.__esModule?t:{"default":t}},i=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},o=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),u=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)},a=(n(/*! immutable */4),n(/*! ../app_dispatcher */1)),s=r(a),c=n(/*! ../constants */2),f=r(c),l=n(/*! ./store */3),h=r(l),p=n(/*! ./config */21),_=r(p),v=_["default"].components,d=function(t){function e(){i(this,e),null!=t&&t.apply(this,arguments)}return u(e,t),o(e,[{key:"loaded",get:function(){return v}},{key:"isLoaded",value:function(t){return v.contains(t)}}]),e}(h["default"]),y=new d;y.dispatchToken=s["default"].register(function(t){switch(t.actionType){case f["default"].ACTION_NEW_CONFIG:s["default"].waitFor([_["default"].dispatchToken]),v=_["default"].components,y.emitChange();break;case f["default"].ACTION_REMOTE_EVENT_RECEIVED:if(t.event.event_type!==f["default"].REMOTE_EVENT_COMPONENT_LOADED)break;var e=t.event.data.component;if(y.isLoaded(e))break;v=v.push(e),y.emitChange();break;case f["default"].ACTION_LOG_OUT:s["default"].waitFor([_["default"].dispatchToken]),v=_["default"].components,y.emitChange()}}),e["default"]=y,t.exports=e["default"]},/*!******************************!*\
function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){return t&&t.__esModule?t:{"default":t}},i=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},o=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),u=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)},a=(n(/*! immutable */4),n(/*! ../app_dispatcher */1)),s=r(a),c=n(/*! ../constants */2),f=r(c),l=n(/*! ./store */3),h=r(l),p=n(/*! ./config */29),_=r(p),v=_["default"].components,d=function(t){function e(){i(this,e),null!=t&&t.apply(this,arguments)}return u(e,t),o(e,[{key:"loaded",get:function(){return v}},{key:"isLoaded",value:function(t){return v.contains(t)}}]),e}(h["default"]),y=new d;y.dispatchToken=s["default"].register(function(t){switch(t.actionType){case f["default"].ACTION_NEW_CONFIG:s["default"].waitFor([_["default"].dispatchToken]),v=_["default"].components,y.emitChange();break;case f["default"].ACTION_REMOTE_EVENT_RECEIVED:if(t.event.event_type!==f["default"].REMOTE_EVENT_COMPONENT_LOADED)break;var e=t.event.data.component;if(y.isLoaded(e))break;v=v.push(e),y.emitChange();break;case f["default"].ACTION_LOG_OUT:s["default"].waitFor([_["default"].dispatchToken]),v=_["default"].components,y.emitChange()}}),e["default"]=y,t.exports=e["default"]},/*!******************************!*\
!*** ./src/stores/config.js ***!
\******************************/
function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){return t&&t.__esModule?t:{"default":t}},i=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},o=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),u=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)},a=n(/*! ../models/config */35),s=r(a),c=n(/*! ../app_dispatcher */1),f=r(c),l=n(/*! ../constants */2),h=r(l),p=n(/*! ./store */3),_=r(p),v=new s["default"],d=function(t){function e(){i(this,e),null!=t&&t.apply(this,arguments)}return u(e,t),o(e,[{key:"latitude",get:function(){return v.latitude}},{key:"longitude",get:function(){return v.longitude}},{key:"temperature_unit",get:function(){return v.temperature_unit}},{key:"location_name",get:function(){return v.location_name}},{key:"time_zone",get:function(){return v.time_zone}},{key:"components",get:function(){return v.components}}]),e}(_["default"]),y=new d;y.dispatchToken=f["default"].register(function(t){switch(t.actionType){case h["default"].ACTION_NEW_CONFIG:v=s["default"].fromJSON(t.config),y.emitChange();break;case h["default"].ACTION_LOG_OUT:v=new s["default"],y.emitChange()}}),e["default"]=y,t.exports=e["default"]},/*!*****************************!*\
function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){return t&&t.__esModule?t:{"default":t}},i=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},o=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),u=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)},a=n(/*! ../models/config */57),s=r(a),c=n(/*! ../app_dispatcher */1),f=r(c),l=n(/*! ../constants */2),h=r(l),p=n(/*! ./store */3),_=r(p),v=new s["default"],d=function(t){function e(){i(this,e),null!=t&&t.apply(this,arguments)}return u(e,t),o(e,[{key:"latitude",get:function(){return v.latitude}},{key:"longitude",get:function(){return v.longitude}},{key:"temperature_unit",get:function(){return v.temperature_unit}},{key:"location_name",get:function(){return v.location_name}},{key:"time_zone",get:function(){return v.time_zone}},{key:"components",get:function(){return v.components}}]),e}(_["default"]),y=new d;y.dispatchToken=f["default"].register(function(t){switch(t.actionType){case h["default"].ACTION_NEW_CONFIG:v=s["default"].fromJSON(t.config),y.emitChange();break;case h["default"].ACTION_LOG_OUT:v=new s["default"],y.emitChange()}}),e["default"]=y,t.exports=e["default"]},/*!*****************************!*\
!*** ./src/stores/event.js ***!
\*****************************/
function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){return t&&t.__esModule?t:{"default":t}},i=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},o=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),u=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)},a=n(/*! immutable */4),s=n(/*! ../app_dispatcher */1),c=r(s),f=n(/*! ../constants */2),l=r(f),h=n(/*! ./store */3),p=r(h),_=new a.List,v=function(t){function e(){i(this,e),null!=t&&t.apply(this,arguments)}return u(e,t),o(e,[{key:"all",get:function(){return _}}]),e}(p["default"]),d=new v;d.dispatchToken=c["default"].register(function(t){switch(t.actionType){case l["default"].ACTION_NEW_EVENTS:_=new a.List(t.events),d.emitChange();break;case l["default"].ACTION_LOG_OUT:_=new a.List,d.emitChange()}}),e["default"]=d,t.exports=e["default"]},/*!*******************************!*\
!*** ./src/stores/logbook.js ***!
\*******************************/
function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){return t&&t.__esModule?t:{"default":t}},i=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},o=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),u=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)},a=n(/*! immutable */4),s=n(/*! ../app_dispatcher */1),c=r(s),f=n(/*! ../constants */2),l=r(f),h=n(/*! ../stores/store */3),p=r(h),_=n(/*! ../models/logbook_entry */36),v=r(_),d=6e4,y=null,g=null,m=new a.List,w=function(t){function e(){i(this,e),null!=t&&t.apply(this,arguments)}return u(e,t),o(e,[{key:"shouldFetch",value:function(){var t=void 0===arguments[0]?null:arguments[0];return t!=g||null===y||(new Date).getTime()-y.getTime()>d}},{key:"all",get:function(){return m}}]),e}(p["default"]),b=new w;b.dispatchToken=c["default"].register(function(t){switch(t.actionType){case l["default"].ACTION_NEW_LOGBOOK:g=t.date,m=new a.List(t.logbookEntries.map(function(t){return v["default"].fromJSON(t)})),y=new Date,b.emitChange();break;case l["default"].ACTION_LOG_OUT:g=null,y=null,m=new a.List,b.emitChange()}}),e["default"]=b,t.exports=e["default"]},/*!************************************!*\
function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){return t&&t.__esModule?t:{"default":t}},i=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},o=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),u=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)},a=n(/*! immutable */4),s=n(/*! ../app_dispatcher */1),c=r(s),f=n(/*! ../constants */2),l=r(f),h=n(/*! ../stores/store */3),p=r(h),_=n(/*! ../models/logbook_entry */58),v=r(_),d=6e4,y=null,g=null,m=new a.List,w=function(t){function e(){i(this,e),null!=t&&t.apply(this,arguments)}return u(e,t),o(e,[{key:"shouldFetch",value:function(){var t=void 0===arguments[0]?null:arguments[0];return t!=g||null===y||(new Date).getTime()-y.getTime()>d}},{key:"all",get:function(){return m}}]),e}(p["default"]),b=new w;b.dispatchToken=c["default"].register(function(t){switch(t.actionType){case l["default"].ACTION_NEW_LOGBOOK:g=t.date,m=new a.List(t.logbookEntries.map(function(t){return v["default"].fromJSON(t)})),y=new Date,b.emitChange();break;case l["default"].ACTION_LOG_OUT:g=null,y=null,m=new a.List,b.emitChange()}}),e["default"]=b,t.exports=e["default"]},/*!************************************!*\
!*** ./src/stores/notification.js ***!
\************************************/
function(t,e,n){"use strict";function r(){return y.size}Object.defineProperty(e,"__esModule",{value:!0});var i=function(t){return t&&t.__esModule?t:{"default":t}},o=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},u=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),a=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)},s=n(/*! immutable */4),c=n(/*! ../app_dispatcher */1),f=i(c),l=n(/*! ../constants */2),h=i(l),p=n(/*! ../stores/store */3),_=i(p),v=n(/*! ../models/notification */37),d=i(v),y=new s.List,g=function(t){function e(){o(this,e),null!=t&&t.apply(this,arguments)}return a(e,t),u(e,[{key:"hasNewNotifications",value:function(){var t=void 0===arguments[0]?0:arguments[0];return t+1<=y.size}},{key:"lastNotification",get:function(){return y.last()}}]),e}(_["default"]),m=new g;m.dispatchToken=f["default"].register(function(t){switch(t.actionType){case h["default"].ACTION_NEW_NOTIFICATION:y=y.push(new d["default"](r(),t.message)),m.emitChange();break;case h["default"].ACTION_LOG_OUT:y=new s.List,m.emitChange()}}),e["default"]=m,t.exports=e["default"]},/*!*****************************!*\
function(t,e,n){"use strict";function r(){return y.size}Object.defineProperty(e,"__esModule",{value:!0});var i=function(t){return t&&t.__esModule?t:{"default":t}},o=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},u=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),a=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)},s=n(/*! immutable */4),c=n(/*! ../app_dispatcher */1),f=i(c),l=n(/*! ../constants */2),h=i(l),p=n(/*! ../stores/store */3),_=i(p),v=n(/*! ../models/notification */59),d=i(v),y=new s.List,g=function(t){function e(){o(this,e),null!=t&&t.apply(this,arguments)}return a(e,t),u(e,[{key:"hasNewNotifications",value:function(){var t=void 0===arguments[0]?0:arguments[0];return t+1<=y.size}},{key:"lastNotification",get:function(){return y.last()}}]),e}(_["default"]),m=new g;m.dispatchToken=f["default"].register(function(t){switch(t.actionType){case h["default"].ACTION_NEW_NOTIFICATION:y=y.push(new d["default"](r(),t.message)),m.emitChange();break;case h["default"].ACTION_LOG_OUT:y=new s.List,m.emitChange()}}),e["default"]=m,t.exports=e["default"]},/*!*****************************!*\
!*** ./src/stores/state.js ***!
\*****************************/
function(t,e,n){"use strict";function r(t){return t.entityId}function i(t){b=b.set(t.entity_id,w["default"].fromJSON(t))}function o(t,e){var n=e?new f.Map:b;b=n.withMutations(function(e){return t.forEach(function(t){return e.set(t.entity_id,w["default"].fromJSON(t))}),e})}Object.defineProperty(e,"__esModule",{value:!0});var u=function(t){return t&&t.__esModule?t:{"default":t}},a=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},s=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),c=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)},f=n(/*! immutable */4),l=n(/*! ../app_dispatcher */1),h=u(l),p=n(/*! ../constants */2),_=u(p),v=n(/*! ./store */3),d=u(v),y=n(/*! ./stream */14),g=u(y),m=n(/*! ../models/state */11),w=u(m),b=new f.Map,T=function(t){function e(){a(this,e),null!=t&&t.apply(this,arguments)}return c(e,t),s(e,[{key:"all",get:function(){return b.valueSeq().sortBy(r)}},{key:"get",value:function(t){return t=t.toLowerCase(),b.get(t)||null}},{key:"gets",value:function(t){return t=t.map(function(t){return t.toLowerCase()}),b.valueSeq().filter(function(e){return-1!==t.indexOf(e.entityId)}).sortBy(r)}},{key:"entityIDs",get:function(){return b.keySeq().sort()}},{key:"domains",get:function(){return b.keySeq().map(function(t){return t.split(".")[0]}).sort().toOrderedSet()}}]),e}(d["default"]),E=new T;E.dispatchToken=h["default"].register(function(t){switch(t.actionType){case _["default"].ACTION_NEW_STATES:(!g["default"].isStreaming||t.replace)&&(o(t.states,t.replace),E.emitChange());break;case _["default"].ACTION_REMOTE_EVENT_RECEIVED:t.event.event_type===_["default"].REMOTE_EVENT_STATE_CHANGED&&(i(t.event.data.new_state),E.emitChange());break;case _["default"].ACTION_LOG_OUT:b=new f.Map,E.emitChange()}}),e["default"]=E,t.exports=e["default"]},/*!*************************************!*\
function(t,e,n){"use strict";function r(t){return t.entityId}function i(t){b=b.set(t.entity_id,w["default"].fromJSON(t))}function o(t,e){var n=e?new f.Map:b;b=n.withMutations(function(e){return t.forEach(function(t){return e.set(t.entity_id,w["default"].fromJSON(t))}),e})}Object.defineProperty(e,"__esModule",{value:!0});var u=function(t){return t&&t.__esModule?t:{"default":t}},a=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},s=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),c=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)},f=n(/*! immutable */4),l=n(/*! ../app_dispatcher */1),h=u(l),p=n(/*! ../constants */2),_=u(p),v=n(/*! ./store */3),d=u(v),y=n(/*! ./stream */21),g=u(y),m=n(/*! ../models/state */18),w=u(m),b=new f.Map,T=function(t){function e(){a(this,e),null!=t&&t.apply(this,arguments)}return c(e,t),s(e,[{key:"all",get:function(){return b.valueSeq().sortBy(r)}},{key:"get",value:function(t){return t=t.toLowerCase(),b.get(t)||null}},{key:"gets",value:function(t){return t=t.map(function(t){return t.toLowerCase()}),b.valueSeq().filter(function(e){return-1!==t.indexOf(e.entityId)}).sortBy(r)}},{key:"entityIDs",get:function(){return b.keySeq().sort()}},{key:"domains",get:function(){return b.keySeq().map(function(t){return t.split(".")[0]}).sort().toOrderedSet()}}]),e}(d["default"]),E=new T;E.dispatchToken=h["default"].register(function(t){switch(t.actionType){case _["default"].ACTION_NEW_STATES:(!g["default"].isStreaming||t.replace)&&(o(t.states,t.replace),E.emitChange());break;case _["default"].ACTION_REMOTE_EVENT_RECEIVED:t.event.event_type===_["default"].REMOTE_EVENT_STATE_CHANGED&&(i(t.event.data.new_state),E.emitChange());break;case _["default"].ACTION_LOG_OUT:b=new f.Map,E.emitChange()}}),e["default"]=E,t.exports=e["default"]},/*!*************************************!*\
!*** ./src/stores/state_history.js ***!
\*************************************/
function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){return t&&t.__esModule?t:{"default":t}},i=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},o=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),u=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)},a=n(/*! lodash */6),s=r(a),c=n(/*! ../app_dispatcher */1),f=r(c),l=n(/*! ../constants */2),h=r(l),p=n(/*! ../stores/store */3),_=r(p),v=6e4,d=null,y={},g={},m=function(t){function e(){i(this,e),null!=t&&t.apply(this,arguments)}return u(e,t),o(e,[{key:"isStale",value:function(){var t=void 0===arguments[0]?null:arguments[0],e=null===t?d:y[t]||null;return null===e||(new Date).getTime()-e.getTime()>v}},{key:"get",value:function(t){return g[t]||null}},{key:"all",get:function(){return s["default"].sortBy(s["default"].values(g),function(t){return t[0].entityId})}}]),e}(_["default"]),w=new m;w.dispatchToken=f["default"].register(function(t){switch(t.actionType){case h["default"].ACTION_NEW_STATE_HISTORY:s["default"].forEach(t.stateHistory,function(t){if(0!==t.length){var e=t[0].entityId;g[e]=t,y[e]=new Date}}),t.isFetchAll&&(d=new Date),w.emitChange();break;case h["default"].ACTION_LOG_OUT:d=null,y={},g={},w.emitChange()}}),e["default"]=w,t.exports=e["default"]},/*!****************************!*\
function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){return t&&t.__esModule?t:{"default":t}},i=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},o=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),u=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)},a=n(/*! lodash/collection/foreach */65),s=r(a),c=n(/*! lodash/collection/sortby */66),f=r(c),l=n(/*! lodash/object/values */92),h=r(l),p=n(/*! ../app_dispatcher */1),_=r(p),v=n(/*! ../constants */2),d=r(v),y=n(/*! ../stores/store */3),g=r(y),m=6e4,w=function(){return(new Date).getTime()},b=function(t){return!t||w()-t>m},T=null,E={},O={},I=null,S={},A=function(t){function e(){i(this,e),null!=t&&t.apply(this,arguments)}return u(e,t),o(e,[{key:"shouldFetchEntity",value:function(t){return b(E[t])}},{key:"shouldFetch",value:function(t){return null!==t?t!==I:b(T)}},{key:"get",value:function(t){return O[t]||null}},{key:"all",value:function(){var t=void 0===arguments[0]?null:arguments[0],e=void 0;if(null===t)e=O;else{if(t!==I)throw"Date "+t+" is not loaded.";e=S}return f["default"](h["default"](e),function(t){return t[0].entityId})}}]),e}(g["default"]),N=new A;N.dispatchToken=_["default"].register(function(t){switch(t.actionType){case d["default"].ACTION_NEW_STATE_HISTORY:var e=void 0,n=w();t.date?(I=t.date,e=S={}):e=O,s["default"](t.stateHistory,function(r){if(0!==r.length){var i=r[0].entityId;e[i]=r,t.date||(E[i]=n)}}),!t.date&&t.isFetchAll&&(T=n),N.emitChange();break;case d["default"].ACTION_LOG_OUT:T=null,E={},O={},I=null,S={},N.emitChange()}}),e["default"]=N,t.exports=e["default"]},/*!****************************!*\
!*** ./src/stores/sync.js ***!
\****************************/
function(t,e,n){"use strict";function r(t){return-1!==y.indexOf(t)}function i(){return y.length===v}Object.defineProperty(e,"__esModule",{value:!0});var o=function(t){return t&&t.__esModule?t:{"default":t}},u=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},a=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),s=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)},c=n(/*! ../app_dispatcher */1),f=o(c),l=n(/*! ../constants */2),h=o(l),p=n(/*! ../stores/store */3),_=o(p),v=4,d=!1,y=[],g=function(t){function e(){u(this,e),null!=t&&t.apply(this,arguments)}return s(e,t),a(e,[{key:"isFetching",get:function(){return!i()}},{key:"initialLoadDone",get:function(){return d}},{key:"componentsLoaded",get:function(){return r(h["default"].ACTION_NEW_CONFIG)}},{key:"eventsLoaded",get:function(){return r(h["default"].ACTION_NEW_EVENTS)}},{key:"servicesLoaded",get:function(){return r(h["default"].ACTION_NEW_SERVICES)}},{key:"statesLoaded",get:function(){return r(h["default"].ACTION_NEW_STATES)}}]),e}(_["default"]),m=new g;m.dispatchToken=f["default"].register(function(t){switch(t.actionType){case h["default"].ACTION_FETCH_ALL:y=[],m.emitChange();break;case h["default"].ACTION_NEW_CONFIG:case h["default"].ACTION_NEW_EVENTS:case h["default"].ACTION_NEW_SERVICES:case h["default"].ACTION_NEW_STATES:r(t.actionType)||(y.push(t.actionType),d=d||i(),m.emitChange());break;case h["default"].ACTION_LOG_OUT:d=!1,y=[],m.emitChange()}}),e["default"]=m,t.exports=e["default"]},/*!*****************************!*\
!*** ./src/stores/voice.js ***!
\*****************************/
function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){return t&&t.__esModule?t:{"default":t}},i=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},o=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),u=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)},a=n(/*! ../app_dispatcher */1),s=r(a),c=n(/*! ../constants */2),f=r(c),l=n(/*! ./store */3),h=r(l),p="STATE_LISTENING",_="STATE_TRANSMITTING",v="STATE_IDLE",d="STATE_ERROR",y=v,g="",m="",w=function(t){function e(){i(this,e),null!=t&&t.apply(this,arguments)}return u(e,t),o(e,[{key:"state",get:function(){return y}},{key:"isListening",get:function(){return y===p}},{key:"isTransmitting",get:function(){return y===_}},{key:"hasError",get:function(){return y===d}},{key:"interimTranscript",get:function(){return g}},{key:"finalTranscript",get:function(){return m}}]),e}(h["default"]),b=new w;b.STATE_LISTENING=p,b.STATE_TRANSMITTING=_,b.STATE_IDLE=v,b.STATE_ERROR=d,b.dispatchToken=s["default"].register(function(t){switch(t.actionType){case f["default"].ACTION_LISTENING_START:y=p,g="",m="",b.emitChange();break;case f["default"].ACTION_LISTENING_TRANSMITTING:y=_,g="",m=t.finalTranscript,b.emitChange();break;case f["default"].ACTION_LISTENING_DONE:y=v,b.emitChange();break;case f["default"].ACTION_LISTENING_ERROR:y=d,b.emitChange();break;case f["default"].ACTION_LISTENING_RESULT:g=t.interimTranscript,m=t.finalTranscript,b.emitChange()}}),e["default"]=b,t.exports=e["default"]},/*!*****************************!*\
function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){return t&&t.__esModule?t:{"default":t}},i=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},o=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),u=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)},a=n(/*! ../app_dispatcher */1),s=r(a),c=n(/*! ../constants */2),f=r(c),l=n(/*! ./store */3),h=r(l),p="STATE_LISTENING",_="STATE_TRANSMITTING",v="STATE_IDLE",d="STATE_ERROR",y=v,g="",m="",w=function(t){function e(){i(this,e),null!=t&&t.apply(this,arguments)}return u(e,t),o(e,[{key:"state",get:function(){return y}},{key:"isListening",get:function(){return y===p}},{key:"isTransmitting",get:function(){return y===_}},{key:"hasError",get:function(){return y===d}},{key:"interimTranscript",get:function(){return g}},{key:"finalTranscript",get:function(){return m}}]),e}(h["default"]),b=new w;b.STATE_LISTENING=p,b.STATE_TRANSMITTING=_,b.STATE_IDLE=v,b.STATE_ERROR=d,b.dispatchToken=s["default"].register(function(t){switch(t.actionType){case f["default"].ACTION_LISTENING_START:y=p,g="",m="",b.emitChange();break;case f["default"].ACTION_LISTENING_TRANSMITTING:y=_,g="",m=t.finalTranscript,b.emitChange();break;case f["default"].ACTION_LISTENING_DONE:y=v,b.emitChange();break;case f["default"].ACTION_LISTENING_ERROR:y=d,b.emitChange();break;case f["default"].ACTION_LISTENING_RESULT:g=t.interimTranscript,m=t.finalTranscript,b.emitChange()}}),e["default"]=b,t.exports=e["default"]},/*!***************************************!*\
!*** ./~/lodash/internal/baseEach.js ***!
\***************************************/
function(t,e,n){var r=n(/*! ./baseForOwn */71),i=n(/*! ./createBaseEach */82),o=i(r);t.exports=o},/*!**************************************!*\
!*** ./~/lodash/internal/baseGet.js ***!
\**************************************/
function(t,e,n){function r(t,e,n){if(null!=t){void 0!==n&&n in i(t)&&(e=[n]);for(var r=-1,o=e.length;null!=t&&++r<o;)t=t[e[r]];return r&&r==o?t:void 0}}var i=n(/*! ./toObject */8);t.exports=r},/*!******************************************!*\
!*** ./~/lodash/internal/baseIsEqual.js ***!
\******************************************/
function(t,e,n){function r(t,e,n,o,u,a){if(t===e)return!0;var s=typeof t,c=typeof e;return"function"!=s&&"object"!=s&&"function"!=c&&"object"!=c||null==t||null==e?t!==t&&e!==e:i(t,e,r,n,o,u,a)}var i=n(/*! ./baseIsEqualDeep */72);t.exports=r},/*!*******************************************!*\
!*** ./~/lodash/internal/baseProperty.js ***!
\*******************************************/
function(t,e,n){function r(t){return function(e){return null==e?void 0:e[t]}}t.exports=r},/*!*******************************************!*\
!*** ./~/lodash/internal/baseToString.js ***!
\*******************************************/
function(t,e,n){function r(t){return"string"==typeof t?t:null==t?"":t+""}t.exports=r},/*!*******************************************!*\
!*** ./~/lodash/internal/bindCallback.js ***!
\*******************************************/
function(t,e,n){function r(t,e,n){if("function"!=typeof t)return i;if(void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 3:return function(n,r,i){return t.call(e,n,r,i)};case 4:return function(n,r,i,o){return t.call(e,n,r,i,o)};case 5:return function(n,r,i,o,u){return t.call(e,n,r,i,o,u)}}return function(){return t.apply(e,arguments)}}var i=n(/*! ../utility/identity */50);t.exports=r},/*!****************************************!*\
!*** ./~/lodash/internal/getLength.js ***!
\****************************************/
function(t,e,n){var r=n(/*! ./baseProperty */40),i=r("length");t.exports=i},/*!************************************!*\
!*** ./~/lodash/internal/isKey.js ***!
\************************************/
function(t,e,n){function r(t,e){var n=typeof t;if("string"==n&&a.test(t)||"number"==n)return!0;if(i(t))return!1;var r=!u.test(t);return r||null!=e&&t in o(e)}var i=n(/*! ../lang/isArray */6),o=n(/*! ./toObject */8),u=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,a=/^\w*$/;t.exports=r},/*!*************************************************!*\
!*** ./~/lodash/internal/isStrictComparable.js ***!
\*************************************************/
function(t,e,n){function r(t){return t===t&&!i(t)}var i=n(/*! ../lang/isObject */10);t.exports=r},/*!*************************************!*\
!*** ./~/lodash/internal/toPath.js ***!
\*************************************/
function(t,e,n){function r(t){if(o(t))return t;var e=[];return i(t).replace(u,function(t,n,r,i){e.push(r?i.replace(a,"$1"):n||t)}),e}var i=n(/*! ./baseToString */41),o=n(/*! ../lang/isArray */6),u=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g,a=/\\(\\)?/g;t.exports=r},/*!**************************************!*\
!*** ./~/lodash/lang/isArguments.js ***!
\**************************************/
function(t,e,n){function r(t){return o(t)&&i(t)&&s.call(t)==u}var i=n(/*! ../internal/isArrayLike */11),o=n(/*! ../internal/isObjectLike */12),u="[object Arguments]",a=Object.prototype,s=a.toString;t.exports=r},/*!***********************************!*\
!*** ./~/lodash/lang/isNative.js ***!
\***********************************/
function(t,e,n){function r(t){return null==t?!1:f.call(t)==u?l.test(c.call(t)):o(t)&&a.test(t)}var i=n(/*! ../string/escapeRegExp */93),o=n(/*! ../internal/isObjectLike */12),u="[object Function]",a=/^\[object .+?Constructor\]$/,s=Object.prototype,c=Function.prototype.toString,f=s.toString,l=RegExp("^"+i(f).replace(/toString|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=r},/*!*****************************!*\
!*** ./~/lodash/support.js ***!
\*****************************/
function(t,e,n){(function(e){var n=Object.prototype,r=(r=e.window)&&r.document,i=n.propertyIsEnumerable,o={};!function(t){var e=function(){this.x=t},n=arguments,u=[];e.prototype={valueOf:t,y:t};for(var a in new e)u.push(a);o.funcDecomp=/\bthis\b/.test(function(){return this}),o.funcNames="string"==typeof Function.name;try{o.dom=11===r.createDocumentFragment().nodeType}catch(s){o.dom=!1}try{o.nonEnumArgs=!i.call(n,1)}catch(s){o.nonEnumArgs=!0}}(1,0),t.exports=o}).call(e,function(){return this}())},/*!**************************************!*\
!*** ./~/lodash/utility/identity.js ***!
\**************************************/
function(t,e,n){function r(t){return t}t.exports=r},/*!*****************************!*\
!*** ./src/actions/auth.js ***!
\*****************************/
function(t,e,n){"use strict";function r(t,e){var n=e.useStreaming,r=void 0===n?v.isSupported:n,i=e.rememberLogin,o=void 0===i?!1:i,u=e.host,a=void 0===u?"":u;c["default"].dispatch({actionType:l["default"].ACTION_VALIDATING_AUTH_TOKEN,authToken:t,host:a}),d.fetch().then(function(){c["default"].dispatch({actionType:l["default"].ACTION_VALID_AUTH_TOKEN,authToken:t,rememberLogin:o}),r?v.start(t,!1):p.start()},function(t){c["default"].dispatch({actionType:l["default"].ACTION_INVALID_AUTH_TOKEN,message:t.message})})}function i(){c["default"].dispatch({actionType:l["default"].ACTION_LOG_OUT})}Object.defineProperty(e,"__esModule",{value:!0});var o=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e["default"]=t,e},u=function(t){return t&&t.__esModule?t:{"default":t}};e.validate=r,e.logOut=i;var a=n(/*! ../call_api */5),s=(u(a),n(/*! ../app_dispatcher */1)),c=u(s),f=n(/*! ../constants */2),l=u(f),h=n(/*! ./sync */10),p=o(h),_=n(/*! ./stream */19),v=o(_),d=n(/*! ./bootstrap */16)},/*!********************************!*\
function(t,e,n){"use strict";function r(t,e){var n=e.useStreaming,r=void 0===n?v.isSupported:n,i=e.rememberLogin,o=void 0===i?!1:i,u=e.host,a=void 0===u?"":u;c["default"].dispatch({actionType:l["default"].ACTION_VALIDATING_AUTH_TOKEN,authToken:t,host:a}),d.fetch().then(function(){c["default"].dispatch({actionType:l["default"].ACTION_VALID_AUTH_TOKEN,authToken:t,rememberLogin:o}),r?v.start(t,!1):p.start()},function(t){c["default"].dispatch({actionType:l["default"].ACTION_INVALID_AUTH_TOKEN,message:t.message})})}function i(){c["default"].dispatch({actionType:l["default"].ACTION_LOG_OUT})}Object.defineProperty(e,"__esModule",{value:!0});var o=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e["default"]=t,e},u=function(t){return t&&t.__esModule?t:{"default":t}};e.validate=r,e.logOut=i;var a=n(/*! ../call_api */5),s=(u(a),n(/*! ../app_dispatcher */1)),c=u(s),f=n(/*! ../constants */2),l=u(f),h=n(/*! ./sync */17),p=o(h),_=n(/*! ./stream */27),v=o(_),d=n(/*! ./bootstrap */24)},/*!********************************!*\
!*** ./src/actions/logbook.js ***!
\********************************/
function(t,e,n){"use strict";function r(t,e){c["default"].dispatch({actionType:l["default"].ACTION_NEW_LOGBOOK,date:t,logbookEntries:e})}function i(){var t=void 0===arguments[0]?null:arguments[0],e="logbook";null!=t&&(e+="/"+t),a["default"]("GET",e).then(function(e){return r(t,e)})}Object.defineProperty(e,"__esModule",{value:!0});var o=function(t){return t&&t.__esModule?t:{"default":t}};e.fetch=i;var u=n(/*! ../call_api */5),a=o(u),s=n(/*! ../app_dispatcher */1),c=o(s),f=n(/*! ../constants */2),l=o(f)},/*!**************************************!*\
!*** ./src/actions/state_history.js ***!
\**************************************/
function(t,e,n){"use strict";function r(t,e){(t||e.length>0)&&f["default"].dispatch({actionType:h["default"].ACTION_NEW_STATE_HISTORY,stateHistory:e.map(function(t){return t.map(_["default"].fromJSON)}),isFetchAll:t})}function i(){s["default"]("GET","history/period").then(function(t){return r(!0,t)})}function o(t){s["default"]("GET","history/period?filter_entity_id="+t).then(function(t){return r(!1,t)})}Object.defineProperty(e,"__esModule",{value:!0});var u=function(t){return t&&t.__esModule?t:{"default":t}};e.fetchAll=i,e.fetch=o;var a=n(/*! ../call_api */5),s=u(a),c=n(/*! ../app_dispatcher */1),f=u(c),l=n(/*! ../constants */2),h=u(l),p=n(/*! ../models/state */11),_=u(p)},/*!******************************!*\
function(t,e,n){"use strict";function r(t,e){var n=void 0===arguments[2]?null:arguments[2];(t||e.length>0)&&f["default"].dispatch({actionType:h["default"].ACTION_NEW_STATE_HISTORY,date:n,stateHistory:e.map(function(t){return t.map(_["default"].fromJSON)}),isFetchAll:t})}function i(){var t=void 0===arguments[0]?null:arguments[0],e="history/period";null!=t&&(e+="/"+t),s["default"]("GET",e).then(function(e){return r(!0,e,t)})}function o(t){s["default"]("GET","history/period?filter_entity_id="+t).then(function(t){return r(!1,t)})}Object.defineProperty(e,"__esModule",{value:!0});var u=function(t){return t&&t.__esModule?t:{"default":t}};e.fetchAll=i,e.fetch=o;var a=n(/*! ../call_api */5),s=u(a),c=n(/*! ../app_dispatcher */1),f=u(c),l=n(/*! ../constants */2),h=u(l),p=n(/*! ../models/state */18),_=u(p)},/*!******************************!*\
!*** ./src/actions/voice.js ***!
\******************************/
function(t,e,n){"use strict";function r(){return"webkitSpeechRecognition"in window}function i(){var t=g||y;l["default"].dispatch({actionType:p["default"].ACTION_LISTENING_TRANSMITTING,finalTranscript:t}),_.callService("conversation","process",{text:t}).then(function(){l["default"].dispatch({actionType:p["default"].ACTION_LISTENING_DONE,finalTranscript:t})},function(){l["default"].dispatch({actionType:p["default"].ACTION_LISTENING_ERROR})})}function o(){null!==d&&(d.onstart=null,d.onresult=null,d.onerror=null,d.onend=null,d.stop(),d=null,i()),y="",g=""}function u(){o(),window.r=d=new webkitSpeechRecognition,d.interimResults=!0,d.onstart=function(){l["default"].dispatch({actionType:p["default"].ACTION_LISTENING_START})},d.onresult=function(t){y="";for(var e=t.resultIndex;e<t.results.length;++e)t.results[e].isFinal?g+=t.results[e][0].transcript:y+=t.results[e][0].transcript;l["default"].dispatch({actionType:p["default"].ACTION_LISTENING_RESULT,interimTranscript:y,finalTranscript:g}),m()},d.onerror=function(){l["default"].dispatch({actionType:p["default"].ACTION_LISTENING_ERROR})},d.onend=o,d.start()}Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){return t&&t.__esModule?t:{"default":t}};e.isSupported=r,e.stop=o,e.listen=u;var s=n(/*! lodash */6),c=a(s),f=n(/*! ../app_dispatcher */1),l=a(f),h=n(/*! ../constants */2),p=a(h),_=n(/*! ./service */8),v=3e3,d=null,y="",g="",m=c["default"].debounce(o,v)},/*!******************************!*\
function(t,e,n){"use strict";function r(){return"webkitSpeechRecognition"in window}function i(){var t=g||y;l["default"].dispatch({actionType:p["default"].ACTION_LISTENING_TRANSMITTING,finalTranscript:t}),_.callService("conversation","process",{text:t}).then(function(){l["default"].dispatch({actionType:p["default"].ACTION_LISTENING_DONE,finalTranscript:t})},function(){l["default"].dispatch({actionType:p["default"].ACTION_LISTENING_ERROR})})}function o(){null!==d&&(d.onstart=null,d.onresult=null,d.onerror=null,d.onend=null,d.stop(),d=null,i()),y="",g=""}function u(){o(),window.r=d=new webkitSpeechRecognition,d.interimResults=!0,d.onstart=function(){l["default"].dispatch({actionType:p["default"].ACTION_LISTENING_START})},d.onresult=function(t){y="";for(var e=t.resultIndex;e<t.results.length;++e)t.results[e].isFinal?g+=t.results[e][0].transcript:y+=t.results[e][0].transcript;l["default"].dispatch({actionType:p["default"].ACTION_LISTENING_RESULT,interimTranscript:y,finalTranscript:g}),m()},d.onerror=function(){l["default"].dispatch({actionType:p["default"].ACTION_LISTENING_ERROR})},d.onend=o,d.start()}Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){return t&&t.__esModule?t:{"default":t}};e.isSupported=r,e.stop=o,e.listen=u;var s=n(/*! lodash */9),c=a(s),f=n(/*! ../app_dispatcher */1),l=a(f),h=n(/*! ../constants */2),p=a(h),_=n(/*! ./service */15),v=3e3,d=null,y="",g="",m=c["default"].debounce(o,v)},/*!******************************!*\
!*** ./src/homeassistant.js ***!
\******************************/
function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){return t&&t.__esModule?t:{"default":t}},i=n(/*! ./app_dispatcher */1),o=r(i);e["default"]={callApi:n(/*! ./call_api */5),dispatcher:o["default"],constants:n(/*! ./constants */2),util:n(/*! ./util */15),authActions:n(/*! ./actions/auth */29),eventActions:n(/*! ./actions/event */18),serviceActions:n(/*! ./actions/service */8),stateActions:n(/*! ./actions/state */9),syncActions:n(/*! ./actions/sync */10),stateHistoryActions:n(/*! ./actions/state_history */31),streamActions:n(/*! ./actions/stream */19),voiceActions:n(/*! ./actions/voice */32),logbookActions:n(/*! ./actions/logbook */30),configActions:n(/*! ./actions/config */17),authStore:n(/*! ./stores/auth */12),componentStore:n(/*! ./stores/component */20),eventStore:n(/*! ./stores/event */22),serviceStore:n(/*! ./stores/service */13),stateStore:n(/*! ./stores/state */25),syncStore:n(/*! ./stores/sync */27),stateHistoryStore:n(/*! ./stores/state_history */26),streamStore:n(/*! ./stores/stream */14),preferenceStore:n(/*! ./stores/preference */38),notificationStore:n(/*! ./stores/notification */24),voiceStore:n(/*! ./stores/voice */28),logbookStore:n(/*! ./stores/logbook */23),configStore:n(/*! ./stores/config */21),stateModel:n(/*! ./models/state */11),storeListenerMixIn:n(/*! ./mixins/store_listener */34)},t.exports=e["default"]},/*!**************************************!*\
function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){return t&&t.__esModule?t:{"default":t}},i=n(/*! ./app_dispatcher */1),o=r(i);e["default"]={callApi:n(/*! ./call_api */5),dispatcher:o["default"],constants:n(/*! ./constants */2),util:n(/*! ./util */22),authActions:n(/*! ./actions/auth */51),eventActions:n(/*! ./actions/event */26),serviceActions:n(/*! ./actions/service */15),stateActions:n(/*! ./actions/state */16),syncActions:n(/*! ./actions/sync */17),stateHistoryActions:n(/*! ./actions/state_history */53),streamActions:n(/*! ./actions/stream */27),voiceActions:n(/*! ./actions/voice */54),logbookActions:n(/*! ./actions/logbook */52),configActions:n(/*! ./actions/config */25),authStore:n(/*! ./stores/auth */19),componentStore:n(/*! ./stores/component */28),eventStore:n(/*! ./stores/event */30),serviceStore:n(/*! ./stores/service */20),stateStore:n(/*! ./stores/state */33),syncStore:n(/*! ./stores/sync */35),stateHistoryStore:n(/*! ./stores/state_history */34),streamStore:n(/*! ./stores/stream */21),preferenceStore:n(/*! ./stores/preference */60),notificationStore:n(/*! ./stores/notification */32),voiceStore:n(/*! ./stores/voice */36),logbookStore:n(/*! ./stores/logbook */31),configStore:n(/*! ./stores/config */29),stateModel:n(/*! ./models/state */18),storeListenerMixIn:n(/*! ./mixins/store_listener */56)},t.exports=e["default"]},/*!**************************************!*\
!*** ./src/mixins/store_listener.js ***!
\**************************************/
function(t,e,n){"use strict";function r(t,e){e=e||this;var n=[];_.forEach(o,function(r,i){if(e[i]){var o=e[i].bind(e,r);r.addChangeListener(o),n.push({store:r,listener:o}),t&&o()}}.bind(e)),e._storeListeners=n}function i(t){t=t||this,t._storeListeners.forEach(function(t){var e=t.store,n=t.listener;e.removeChangeListener(n)})}Object.defineProperty(e,"__esModule",{value:!0}),e.listenToStores=r,e.stopListeningToStores=i,_=n(/*! lodash */6);var o={authStoreChanged:n(/*! ../stores/auth */12),componentStoreChanged:n(/*! ../stores/component */20),eventStoreChanged:n(/*! ../stores/event */22),serviceStoreChanged:n(/*! ../stores/service */13),stateStoreChanged:n(/*! ../stores/state */25),stateHistoryStoreChanged:n(/*! ../stores/state_history */26),streamStoreChanged:n(/*! ../stores/stream */14),syncStoreChanged:n(/*! ../stores/sync */27),notificationStoreChanged:n(/*! ../stores/notification */24),voiceStoreChanged:n(/*! ../stores/voice */28),logbookStoreChanged:n(/*! ../stores/logbook */23)}},/*!******************************!*\
function(t,e,n){"use strict";function r(t,e){e=e||this;var n=[];_.forEach(o,function(r,i){if(e[i]){var o=e[i].bind(e,r);r.addChangeListener(o),n.push({store:r,listener:o}),t&&o()}}.bind(e)),e._storeListeners=n}function i(t){t=t||this,t._storeListeners.forEach(function(t){var e=t.store,n=t.listener;e.removeChangeListener(n)})}Object.defineProperty(e,"__esModule",{value:!0}),e.listenToStores=r,e.stopListeningToStores=i,_=n(/*! lodash */9);var o={authStoreChanged:n(/*! ../stores/auth */19),componentStoreChanged:n(/*! ../stores/component */28),eventStoreChanged:n(/*! ../stores/event */30),serviceStoreChanged:n(/*! ../stores/service */20),stateStoreChanged:n(/*! ../stores/state */33),stateHistoryStoreChanged:n(/*! ../stores/state_history */34),streamStoreChanged:n(/*! ../stores/stream */21),syncStoreChanged:n(/*! ../stores/sync */35),notificationStoreChanged:n(/*! ../stores/notification */32),voiceStoreChanged:n(/*! ../stores/voice */36),logbookStoreChanged:n(/*! ../stores/logbook */31)}},/*!******************************!*\
!*** ./src/models/config.js ***!
\******************************/
function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},i=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),o=function(t,e,n){for(var r=!0;r;){a=c=s=void 0,r=!1;var i=t,o=e,u=n,a=Object.getOwnPropertyDescriptor(i,o);if(void 0!==a){if("value"in a)return a.value;var s=a.get;return void 0===s?void 0:s.call(u)}var c=Object.getPrototypeOf(i);if(null===c)return void 0;t=c,e=o,n=u,r=!0}},u=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)},a=n(/*! immutable */4),s=new a.Record({latitude:null,longitude:null,temperature_unit:null,location_name:null,time_zone:null,components:null},"Config"),c=function(t){function e(t,n,i,u,s,c){r(this,e),o(Object.getPrototypeOf(e.prototype),"constructor",this).call(this,{latitude:t,longitude:n,temperature_unit:i,location_name:u||"",time_zone:s,components:new a.List(c)})}return u(e,t),i(e,null,[{key:"fromJSON",value:function(t){var n=t.latitude,r=t.longitude,i=t.temperature_unit,o=t.location_name,u=t.time_zone,a=t.components;return new e(n,r,i,o,u,a)}}]),e}(s);e["default"]=c,t.exports=e["default"]},/*!*************************************!*\
!*** ./src/models/logbook_entry.js ***!
\*************************************/
function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},i=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),o=function(t,e,n){for(var r=!0;r;){a=c=s=void 0,r=!1;var i=t,o=e,u=n,a=Object.getOwnPropertyDescriptor(i,o);if(void 0!==a){if("value"in a)return a.value;var s=a.get;return void 0===s?void 0:s.call(u)}var c=Object.getPrototypeOf(i);if(null===c)return void 0;t=c,e=o,n=u,r=!0}},u=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)},a=n(/*! immutable */4),s=n(/*! ../util */15),c=new a.Record({when:null,name:null,message:null,domain:null,entityId:null},"LogbookEntry"),f=function(t){function e(t,n,i,u,a){r(this,e),o(Object.getPrototypeOf(e.prototype),"constructor",this).call(this,{when:t,name:n,message:i,domain:u,entityId:a})}return u(e,t),i(e,null,[{key:"fromJSON",value:function(t){var n=t.when,r=t.name,i=t.message,o=t.domain,u=t.entity_id;return new e(s.parseDateTime(n),r,i,o,u)}}]),e}(c);e["default"]=f,t.exports=e["default"]},/*!************************************!*\
function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},i=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),o=function(t,e,n){for(var r=!0;r;){a=c=s=void 0,r=!1;var i=t,o=e,u=n,a=Object.getOwnPropertyDescriptor(i,o);if(void 0!==a){if("value"in a)return a.value;var s=a.get;return void 0===s?void 0:s.call(u)}var c=Object.getPrototypeOf(i);if(null===c)return void 0;t=c,e=o,n=u,r=!0}},u=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)},a=n(/*! immutable */4),s=n(/*! ../util */22),c=new a.Record({when:null,name:null,message:null,domain:null,entityId:null},"LogbookEntry"),f=function(t){function e(t,n,i,u,a){r(this,e),o(Object.getPrototypeOf(e.prototype),"constructor",this).call(this,{when:t,name:n,message:i,domain:u,entityId:a})}return u(e,t),i(e,null,[{key:"fromJSON",value:function(t){var n=t.when,r=t.name,i=t.message,o=t.domain,u=t.entity_id;return new e(s.parseDateTime(n),r,i,o,u)}}]),e}(c);e["default"]=f,t.exports=e["default"]},/*!************************************!*\
!*** ./src/models/notification.js ***!
\************************************/
function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},i=function(t,e,n){for(var r=!0;r;){a=c=s=void 0,r=!1;var i=t,o=e,u=n,a=Object.getOwnPropertyDescriptor(i,o);if(void 0!==a){if("value"in a)return a.value;var s=a.get;return void 0===s?void 0:s.call(u)}var c=Object.getPrototypeOf(i);if(null===c)return void 0;t=c,e=o,n=u,r=!0}},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=n(/*! immutable */4),a=new u.Record({id:null,message:null},"Notification"),s=function(t){function e(t,n){r(this,e),i(Object.getPrototypeOf(e.prototype),"constructor",this).call(this,{id:t,message:n})}return o(e,t),e}(a);e["default"]=s,t.exports=e["default"]},/*!**********************************!*\
@@ -5996,13 +6062,109 @@ function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});va
function(t,e,n){"use strict";function r(t,e){d[t]=JSON.stringify(e)}function i(t,e){return t in d?JSON.parse(d[t]):e}function o(t){return t in d?(d.removeItem(t),!0):!1}Object.defineProperty(e,"__esModule",{value:!0});var u=function(t){return t&&t.__esModule?t:{"default":t}},a=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},s=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),c=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)},f=n(/*! ../app_dispatcher */1),l=u(f),h=n(/*! ../constants */2),p=u(h),_=n(/*! ./store */3),v=u(_);try{var d=localStorage}catch(y){var d={}}var g="PREF_AUTH_TOKEN",m=null,w="PREF_USE_STREAMING",b=!0,T=function(t){function e(){a(this,e),null!=t&&t.apply(this,arguments)}return c(e,t),s(e,[{key:"useStreaming",get:function(){return i(w,b)}},{key:"hasAuthToken",get:function(){return null!==this.authToken}},{key:"authToken",get:function(){return i(g,m)}}]),e}(v["default"]),E=new T;E.dispatchToken=l["default"].register(function(t){switch(t.actionType){case p["default"].ACTION_VALID_AUTH_TOKEN:t.rememberLogin&&(r(g,t.authToken),E.emitChange());break;case p["default"].ACTION_LOG_OUT:o(g)&&E.emitChange();break;case p["default"].ACTION_STREAM_START:r(w,!0),E.emitChange();break;case p["default"].ACTION_STREAM_STOP:r(w,!1),E.emitChange()}}),e["default"]=E,t.exports=e["default"]},/*!*************************!*\
!*** ./~/flux/index.js ***!
\*************************/
function(t,e,n){t.exports.Dispatcher=n(/*! ./lib/Dispatcher */40)},/*!**********************************!*\
function(t,e,n){t.exports.Dispatcher=n(/*! ./lib/Dispatcher */62)},/*!**********************************!*\
!*** ./~/flux/lib/Dispatcher.js ***!
\**********************************/
function(t,e,n){"use strict";function r(){this.$Dispatcher_callbacks={},this.$Dispatcher_isPending={},this.$Dispatcher_isHandled={},this.$Dispatcher_isDispatching=!1,this.$Dispatcher_pendingPayload=null}var i=n(/*! ./invariant */41),o=1,u="ID_";r.prototype.register=function(t){var e=u+o++;return this.$Dispatcher_callbacks[e]=t,e},r.prototype.unregister=function(t){i(this.$Dispatcher_callbacks[t],"Dispatcher.unregister(...): `%s` does not map to a registered callback.",t),delete this.$Dispatcher_callbacks[t]},r.prototype.waitFor=function(t){i(this.$Dispatcher_isDispatching,"Dispatcher.waitFor(...): Must be invoked while dispatching.");for(var e=0;e<t.length;e++){var n=t[e];this.$Dispatcher_isPending[n]?i(this.$Dispatcher_isHandled[n],"Dispatcher.waitFor(...): Circular dependency detected while waiting for `%s`.",n):(i(this.$Dispatcher_callbacks[n],"Dispatcher.waitFor(...): `%s` does not map to a registered callback.",n),this.$Dispatcher_invokeCallback(n))}},r.prototype.dispatch=function(t){i(!this.$Dispatcher_isDispatching,"Dispatch.dispatch(...): Cannot dispatch in the middle of a dispatch."),this.$Dispatcher_startDispatching(t);try{for(var e in this.$Dispatcher_callbacks)this.$Dispatcher_isPending[e]||this.$Dispatcher_invokeCallback(e)}finally{this.$Dispatcher_stopDispatching()}},r.prototype.isDispatching=function(){return this.$Dispatcher_isDispatching},r.prototype.$Dispatcher_invokeCallback=function(t){this.$Dispatcher_isPending[t]=!0,this.$Dispatcher_callbacks[t](this.$Dispatcher_pendingPayload),this.$Dispatcher_isHandled[t]=!0},r.prototype.$Dispatcher_startDispatching=function(t){for(var e in this.$Dispatcher_callbacks)this.$Dispatcher_isPending[e]=!1,this.$Dispatcher_isHandled[e]=!1;this.$Dispatcher_pendingPayload=t,this.$Dispatcher_isDispatching=!0},r.prototype.$Dispatcher_stopDispatching=function(){this.$Dispatcher_pendingPayload=null,this.$Dispatcher_isDispatching=!1},t.exports=r},/*!*********************************!*\
function(t,e,n){"use strict";function r(){this.$Dispatcher_callbacks={},this.$Dispatcher_isPending={},this.$Dispatcher_isHandled={},this.$Dispatcher_isDispatching=!1,this.$Dispatcher_pendingPayload=null}var i=n(/*! ./invariant */63),o=1,u="ID_";r.prototype.register=function(t){var e=u+o++;return this.$Dispatcher_callbacks[e]=t,e},r.prototype.unregister=function(t){i(this.$Dispatcher_callbacks[t],"Dispatcher.unregister(...): `%s` does not map to a registered callback.",t),delete this.$Dispatcher_callbacks[t]},r.prototype.waitFor=function(t){i(this.$Dispatcher_isDispatching,"Dispatcher.waitFor(...): Must be invoked while dispatching.");for(var e=0;e<t.length;e++){var n=t[e];this.$Dispatcher_isPending[n]?i(this.$Dispatcher_isHandled[n],"Dispatcher.waitFor(...): Circular dependency detected while waiting for `%s`.",n):(i(this.$Dispatcher_callbacks[n],"Dispatcher.waitFor(...): `%s` does not map to a registered callback.",n),this.$Dispatcher_invokeCallback(n))}},r.prototype.dispatch=function(t){i(!this.$Dispatcher_isDispatching,"Dispatch.dispatch(...): Cannot dispatch in the middle of a dispatch."),this.$Dispatcher_startDispatching(t);try{for(var e in this.$Dispatcher_callbacks)this.$Dispatcher_isPending[e]||this.$Dispatcher_invokeCallback(e)}finally{this.$Dispatcher_stopDispatching()}},r.prototype.isDispatching=function(){return this.$Dispatcher_isDispatching},r.prototype.$Dispatcher_invokeCallback=function(t){this.$Dispatcher_isPending[t]=!0,this.$Dispatcher_callbacks[t](this.$Dispatcher_pendingPayload),this.$Dispatcher_isHandled[t]=!0},r.prototype.$Dispatcher_startDispatching=function(t){for(var e in this.$Dispatcher_callbacks)this.$Dispatcher_isPending[e]=!1,this.$Dispatcher_isHandled[e]=!1;this.$Dispatcher_pendingPayload=t,this.$Dispatcher_isDispatching=!0},r.prototype.$Dispatcher_stopDispatching=function(){this.$Dispatcher_pendingPayload=null,this.$Dispatcher_isDispatching=!1},t.exports=r},/*!*********************************!*\
!*** ./~/flux/lib/invariant.js ***!
\*********************************/
function(t,e,n){"use strict";var r=function(t,e,n,r,i,o,u,a){if(!t){var s;if(void 0===e)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,i,o,u,a],f=0;s=new Error("Invariant Violation: "+e.replace(/%s/g,function(){return c[f++]}))}throw s.framesToPop=1,s}};t.exports=r},/*!***********************************!*\
function(t,e,n){"use strict";var r=function(t,e,n,r,i,o,u,a){if(!t){var s;if(void 0===e)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,i,o,u,a],f=0;s=new Error("Invariant Violation: "+e.replace(/%s/g,function(){return c[f++]}))}throw s.framesToPop=1,s}};t.exports=r},/*!********************************!*\
!*** ./~/lodash/array/last.js ***!
\********************************/
function(t,e,n){function r(t){var e=t?t.length:0;return e?t[e-1]:void 0}t.exports=r},/*!****************************************!*\
!*** ./~/lodash/collection/foreach.js ***!
\****************************************/
function(t,e,n){var r=n(/*! ../internal/arrayEach */67),i=n(/*! ../internal/baseEach */37),o=n(/*! ../internal/createForEach */84),u=o(r,i);t.exports=u},/*!***************************************!*\
!*** ./~/lodash/collection/sortby.js ***!
\***************************************/
function(t,e,n){function r(t,e,n){if(null==t)return[];n&&s(t,e,n)&&(e=null);var r=-1;e=i(e,n,3);var c=o(t,function(t,n,i){return{criteria:e(t,n,i),index:++r,value:t}});return u(c,a)}var i=n(/*! ../internal/baseCallback */68),o=n(/*! ../internal/baseMap */74),u=n(/*! ../internal/baseSortBy */79),a=n(/*! ../internal/compareAscending */81),s=n(/*! ../internal/isIterateeCall */88);t.exports=r},/*!****************************************!*\
!*** ./~/lodash/internal/arrayEach.js ***!
\****************************************/
function(t,e,n){function r(t,e){for(var n=-1,r=t.length;++n<r&&e(t[n],n,t)!==!1;);return t}t.exports=r},/*!*******************************************!*\
!*** ./~/lodash/internal/baseCallback.js ***!
\*******************************************/
function(t,e,n){function r(t,e,n){var r=typeof t;return"function"==r?void 0===e?t:u(t,e,n):null==t?a:"object"==r?i(t):void 0===e?s(t):o(t,e)}var i=n(/*! ./baseMatches */75),o=n(/*! ./baseMatchesProperty */76),u=n(/*! ./bindCallback */42),a=n(/*! ../utility/identity */50),s=n(/*! ../utility/property */95);t.exports=r},/*!***************************************************!*\
!*** ./~/lodash/internal/baseCompareAscending.js ***!
\***************************************************/
function(t,e,n){function r(t,e){if(t!==e){var n=t===t,r=e===e;if(t>e||!n||void 0===t&&r)return 1;if(e>t||!r||void 0===e&&n)return-1}return 0}t.exports=r},/*!**************************************!*\
!*** ./~/lodash/internal/baseFor.js ***!
\**************************************/
function(t,e,n){var r=n(/*! ./createBaseFor */83),i=r();t.exports=i},/*!*****************************************!*\
!*** ./~/lodash/internal/baseForOwn.js ***!
\*****************************************/
function(t,e,n){function r(t,e){return i(t,e,o)}var i=n(/*! ./baseFor */70),o=n(/*! ../object/keys */13);t.exports=r},/*!**********************************************!*\
!*** ./~/lodash/internal/baseIsEqualDeep.js ***!
\**********************************************/
function(t,e,n){function r(t,e,n,r,h,v,d){var y=a(t),g=a(e),m=f,w=f;y||(m=_.call(t),m==c?m=l:m!=l&&(y=s(t))),g||(w=_.call(e),w==c?w=l:w!=l&&(g=s(e)));var b=m==l,T=w==l,E=m==w;if(E&&!y&&!b)return o(t,e,m);if(!h){var O=b&&p.call(t,"__wrapped__"),I=T&&p.call(e,"__wrapped__");if(O||I)return n(O?t.value():t,I?e.value():e,r,h,v,d)}if(!E)return!1;v||(v=[]),d||(d=[]);for(var S=v.length;S--;)if(v[S]==t)return d[S]==e;v.push(t),d.push(e);var A=(y?i:u)(t,e,n,r,h,v,d);return v.pop(),d.pop(),A}var i=n(/*! ./equalArrays */85),o=n(/*! ./equalByTag */86),u=n(/*! ./equalObjects */87),a=n(/*! ../lang/isArray */6),s=n(/*! ../lang/isTypedArray */90),c="[object Arguments]",f="[object Array]",l="[object Object]",h=Object.prototype,p=h.hasOwnProperty,_=h.toString;t.exports=r},/*!******************************************!*\
!*** ./~/lodash/internal/baseIsMatch.js ***!
\******************************************/
function(t,e,n){function r(t,e,n,r,o){for(var u=-1,a=e.length,s=!o;++u<a;)if(s&&r[u]?n[u]!==t[e[u]]:!(e[u]in t))return!1;for(u=-1;++u<a;){var c=e[u],f=t[c],l=n[u];if(s&&r[u])var h=void 0!==f||c in t;else h=o?o(f,l,c):void 0,void 0===h&&(h=i(l,f,o,!0));if(!h)return!1}return!0}var i=n(/*! ./baseIsEqual */39);t.exports=r},/*!**************************************!*\
!*** ./~/lodash/internal/baseMap.js ***!
\**************************************/
function(t,e,n){function r(t,e){var n=-1,r=o(t)?Array(t.length):[];return i(t,function(t,i,o){r[++n]=e(t,i,o)}),r}var i=n(/*! ./baseEach */37),o=n(/*! ./isArrayLike */11);t.exports=r},/*!******************************************!*\
!*** ./~/lodash/internal/baseMatches.js ***!
\******************************************/
function(t,e,n){function r(t){var e=a(t),n=e.length;if(!n)return o(!0);if(1==n){var r=e[0],c=t[r];if(u(c))return function(t){return null==t?!1:t[r]===c&&(void 0!==c||r in s(t))}}for(var f=Array(n),l=Array(n);n--;)c=t[e[n]],f[n]=c,l[n]=u(c);return function(t){return null!=t&&i(s(t),e,f,l)}}var i=n(/*! ./baseIsMatch */73),o=n(/*! ../utility/constant */94),u=n(/*! ./isStrictComparable */45),a=n(/*! ../object/keys */13),s=n(/*! ./toObject */8);t.exports=r},/*!**************************************************!*\
!*** ./~/lodash/internal/baseMatchesProperty.js ***!
\**************************************************/
function(t,e,n){function r(t,e){var n=a(t),r=s(t)&&c(e),p=t+"";return t=h(t),function(a){if(null==a)return!1;var s=p;if(a=l(a),!(!n&&r||s in a)){if(a=1==t.length?a:i(a,u(t,0,-1)),null==a)return!1;s=f(t),a=l(a)}return a[s]===e?void 0!==e||s in a:o(e,a[s],null,!0)}}var i=n(/*! ./baseGet */38),o=n(/*! ./baseIsEqual */39),u=n(/*! ./baseSlice */78),a=n(/*! ../lang/isArray */6),s=n(/*! ./isKey */44),c=n(/*! ./isStrictComparable */45),f=n(/*! ../array/last */64),l=n(/*! ./toObject */8),h=n(/*! ./toPath */46);t.exports=r},/*!***********************************************!*\
!*** ./~/lodash/internal/basePropertyDeep.js ***!
\***********************************************/
function(t,e,n){function r(t){var e=t+"";return t=o(t),function(n){return i(n,t,e)}}var i=n(/*! ./baseGet */38),o=n(/*! ./toPath */46);t.exports=r},/*!****************************************!*\
!*** ./~/lodash/internal/baseSlice.js ***!
\****************************************/
function(t,e,n){function r(t,e,n){var r=-1,i=t.length;e=null==e?0:+e||0,0>e&&(e=-e>i?0:i+e),n=void 0===n||n>i?i:+n||0,0>n&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var o=Array(i);++r<i;)o[r]=t[r+e];return o}t.exports=r},/*!*****************************************!*\
!*** ./~/lodash/internal/baseSortBy.js ***!
\*****************************************/
function(t,e,n){function r(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}t.exports=r},/*!*****************************************!*\
!*** ./~/lodash/internal/baseValues.js ***!
\*****************************************/
function(t,e,n){function r(t,e){for(var n=-1,r=e.length,i=Array(r);++n<r;)i[n]=t[e[n]];return i}t.exports=r},/*!***********************************************!*\
!*** ./~/lodash/internal/compareAscending.js ***!
\***********************************************/
function(t,e,n){function r(t,e){return i(t.criteria,e.criteria)||t.index-e.index}var i=n(/*! ./baseCompareAscending */69);t.exports=r},/*!*********************************************!*\
!*** ./~/lodash/internal/createBaseEach.js ***!
\*********************************************/
function(t,e,n){function r(t,e){return function(n,r){var a=n?i(n):0;if(!o(a))return t(n,r);for(var s=e?a:-1,c=u(n);(e?s--:++s<a)&&r(c[s],s,c)!==!1;);return n}}var i=n(/*! ./getLength */43),o=n(/*! ./isLength */7),u=n(/*! ./toObject */8);t.exports=r},/*!********************************************!*\
!*** ./~/lodash/internal/createBaseFor.js ***!
\********************************************/
function(t,e,n){function r(t){return function(e,n,r){for(var o=i(e),u=r(e),a=u.length,s=t?a:-1;t?s--:++s<a;){var c=u[s];if(n(o[c],c,o)===!1)break}return e}}var i=n(/*! ./toObject */8);t.exports=r},/*!********************************************!*\
!*** ./~/lodash/internal/createForEach.js ***!
\********************************************/
function(t,e,n){function r(t,e){return function(n,r,u){return"function"==typeof r&&void 0===u&&o(n)?t(n,r):e(n,i(r,u,3))}}var i=n(/*! ./bindCallback */42),o=n(/*! ../lang/isArray */6);t.exports=r},/*!******************************************!*\
!*** ./~/lodash/internal/equalArrays.js ***!
\******************************************/
function(t,e,n){function r(t,e,n,r,i,o,u){var a=-1,s=t.length,c=e.length,f=!0;if(s!=c&&!(i&&c>s))return!1;for(;f&&++a<s;){var l=t[a],h=e[a];if(f=void 0,r&&(f=i?r(h,l,a):r(l,h,a)),void 0===f)if(i)for(var p=c;p--&&(h=e[p],!(f=l&&l===h||n(l,h,r,i,o,u))););else f=l&&l===h||n(l,h,r,i,o,u)}return!!f}t.exports=r},/*!*****************************************!*\
!*** ./~/lodash/internal/equalByTag.js ***!
\*****************************************/
function(t,e,n){function r(t,e,n){switch(n){case i:case o:return+t==+e;case u:return t.name==e.name&&t.message==e.message;case a:return t!=+t?e!=+e:t==+e;case s:case c:return t==e+""}return!1}var i="[object Boolean]",o="[object Date]",u="[object Error]",a="[object Number]",s="[object RegExp]",c="[object String]";t.exports=r},/*!*******************************************!*\
!*** ./~/lodash/internal/equalObjects.js ***!
\*******************************************/
function(t,e,n){function r(t,e,n,r,o,a,s){var c=i(t),f=c.length,l=i(e),h=l.length;if(f!=h&&!o)return!1;for(var p=o,_=-1;++_<f;){var v=c[_],d=o?v in e:u.call(e,v);if(d){var y=t[v],g=e[v];d=void 0,r&&(d=o?r(g,y,v):r(y,g,v)),void 0===d&&(d=y&&y===g||n(y,g,r,o,a,s))}if(!d)return!1;p||(p="constructor"==v)}if(!p){var m=t.constructor,w=e.constructor;if(m!=w&&"constructor"in t&&"constructor"in e&&!("function"==typeof m&&m instanceof m&&"function"==typeof w&&w instanceof w))return!1}return!0}var i=n(/*! ../object/keys */13),o=Object.prototype,u=o.hasOwnProperty;t.exports=r},/*!*********************************************!*\
!*** ./~/lodash/internal/isIterateeCall.js ***!
\*********************************************/
function(t,e,n){function r(t,e,n){if(!u(n))return!1;var r=typeof e;if("number"==r?i(n)&&o(e,n.length):"string"==r&&e in n){var a=n[e];return t===t?t===a:a!==a}return!1}var i=n(/*! ./isArrayLike */11),o=n(/*! ./isIndex */23),u=n(/*! ../lang/isObject */10);t.exports=r},/*!***************************************!*\
!*** ./~/lodash/internal/shimKeys.js ***!
\***************************************/
function(t,e,n){function r(t){for(var e=s(t),n=e.length,r=n&&t.length,f=r&&a(r)&&(o(t)||c.nonEnumArgs&&i(t)),h=-1,p=[];++h<n;){var _=e[h];(f&&u(_,r)||l.call(t,_))&&p.push(_)}return p}var i=n(/*! ../lang/isArguments */47),o=n(/*! ../lang/isArray */6),u=n(/*! ./isIndex */23),a=n(/*! ./isLength */7),s=n(/*! ../object/keysIn */91),c=n(/*! ../support */49),f=Object.prototype,l=f.hasOwnProperty;t.exports=r},/*!***************************************!*\
!*** ./~/lodash/lang/isTypedArray.js ***!
\***************************************/
function(t,e,n){function r(t){return o(t)&&i(t.length)&&!!x[k.call(t)]}var i=n(/*! ../internal/isLength */7),o=n(/*! ../internal/isObjectLike */12),u="[object Arguments]",a="[object Array]",s="[object Boolean]",c="[object Date]",f="[object Error]",l="[object Function]",h="[object Map]",p="[object Number]",_="[object Object]",v="[object RegExp]",d="[object Set]",y="[object String]",g="[object WeakMap]",m="[object ArrayBuffer]",w="[object Float32Array]",b="[object Float64Array]",T="[object Int8Array]",E="[object Int16Array]",O="[object Int32Array]",I="[object Uint8Array]",S="[object Uint8ClampedArray]",A="[object Uint16Array]",N="[object Uint32Array]",x={};x[w]=x[b]=x[T]=x[E]=x[O]=x[I]=x[S]=x[A]=x[N]=!0,x[u]=x[a]=x[m]=x[s]=x[c]=x[f]=x[l]=x[h]=x[p]=x[_]=x[v]=x[d]=x[y]=x[g]=!1;var C=Object.prototype,k=C.toString;t.exports=r},/*!***********************************!*\
!*** ./~/lodash/object/keysIn.js ***!
\***********************************/
function(t,e,n){function r(t){if(null==t)return[];s(t)||(t=Object(t));var e=t.length;e=e&&a(e)&&(o(t)||c.nonEnumArgs&&i(t))&&e||0;for(var n=t.constructor,r=-1,f="function"==typeof n&&n.prototype===t,h=Array(e),p=e>0;++r<e;)h[r]=r+"";for(var _ in t)p&&u(_,e)||"constructor"==_&&(f||!l.call(t,_))||h.push(_);return h}var i=n(/*! ../lang/isArguments */47),o=n(/*! ../lang/isArray */6),u=n(/*! ../internal/isIndex */23),a=n(/*! ../internal/isLength */7),s=n(/*! ../lang/isObject */10),c=n(/*! ../support */49),f=Object.prototype,l=f.hasOwnProperty;t.exports=r},/*!***********************************!*\
!*** ./~/lodash/object/values.js ***!
\***********************************/
function(t,e,n){function r(t){return i(t,o(t))}var i=n(/*! ../internal/baseValues */80),o=n(/*! ./keys */13);t.exports=r},/*!*****************************************!*\
!*** ./~/lodash/string/escapeRegExp.js ***!
\*****************************************/
function(t,e,n){function r(t){return t=i(t),t&&u.test(t)?t.replace(o,"\\$&"):t}var i=n(/*! ../internal/baseToString */41),o=/[.*+?^${}()|[\]\/\\]/g,u=RegExp(o.source);t.exports=r},/*!**************************************!*\
!*** ./~/lodash/utility/constant.js ***!
\**************************************/
function(t,e,n){function r(t){return function(){return t}}t.exports=r},/*!**************************************!*\
!*** ./~/lodash/utility/property.js ***!
\**************************************/
function(t,e,n){function r(t){return u(t)?i(t):o(t)}var i=n(/*! ../internal/baseProperty */40),o=n(/*! ../internal/basePropertyDeep */77),u=n(/*! ../internal/isKey */44);t.exports=r},/*!***********************************!*\
!*** (webpack)/buildin/module.js ***!
\***********************************/
function(t,e,n){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children=[],t.webpackPolyfill=1),t}},/*!********************************************************!*\
@@ -14345,119 +14507,6 @@ Fires `api-load` event when ready.
});
</script>
<script>
(function() {
Polymer({
is: 'state-history-chart-timeline',
properties: {
data: {
type: Object,
observer: 'dataChanged',
},
isAttached: {
type: Boolean,
value: false,
observer: 'dataChanged',
},
},
created: function() {
this.style.display = 'block';
},
attached: function() {
this.isAttached = true;
},
dataChanged: function() {
this.drawChart();
},
drawChart: function() {
if (!this.isAttached) {
return;
}
var root = Polymer.dom(this);
var stateHistory = this.data;
while (root.lastChild) {
root.removeChild(root.lastChild);
}
if (!stateHistory || stateHistory.length === 0) {
return;
}
// debugger;
var chart = new google.visualization.Timeline(this);
var dataTable = new google.visualization.DataTable();
dataTable.addColumn({ type: 'string', id: 'Entity' });
dataTable.addColumn({ type: 'string', id: 'State' });
dataTable.addColumn({ type: 'date', id: 'Start' });
dataTable.addColumn({ type: 'date', id: 'End' });
var addRow = function(entityDisplay, stateStr, start, end) {
stateStr = stateStr.replace(/_/g, ' ');
dataTable.addRow([entityDisplay, stateStr, start, end]);
};
// people can pass in history of 1 entityId or a collection.
// var stateHistory;
// if (_.isArray(data[0])) {
// stateHistory = data;
// } else {
// stateHistory = [data];
// isSingleDevice = true;
// }
var numTimelines = 0;
// stateHistory is a list of lists of sorted state objects
stateHistory.forEach(function(stateInfo) {
if(stateInfo.length === 0) return;
var entityDisplay = stateInfo[0].entityDisplay;
var newLastChanged, prevState = null, prevLastChanged = null;
stateInfo.forEach(function(state) {
if (prevState !== null && state.state !== prevState) {
newLastChanged = state.lastChangedAsDate;
addRow(entityDisplay, prevState, prevLastChanged, newLastChanged);
prevState = state.state;
prevLastChanged = newLastChanged;
} else if (prevState === null) {
prevState = state.state;
prevLastChanged = state.lastChangedAsDate;
}
});
addRow(entityDisplay, prevState, prevLastChanged, new Date());
numTimelines++;
}.bind(this));
chart.draw(dataTable, {
height: 55 + numTimelines * 42,
// interactive properties require CSS, the JS api puts it on the document
// instead of inside our Shadow DOM.
enableInteractivity: false,
timeline: {
showRowLabels: stateHistory.length > 1
},
hAxis: {
format: 'H:mm'
},
});
},
});
})();
</script>
<script>
(function() {
Polymer({
is: 'state-history-chart-line',
@@ -23047,6 +23096,10 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
.selected-date-container {
padding: 0 16px;
}
paper-input {
max-width: 200px;
}
</style>
<template>
<partial-base narrow="[[narrow]]">
@@ -23136,6 +23189,115 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
});
})();
</script>
<dom-module is="state-history-chart-timeline">
<style>
:host {
display: block;
}
</style>
<template></template>
</dom-module>
<script>
(function() {
Polymer({
is: 'state-history-chart-timeline',
properties: {
data: {
type: Object,
observer: 'dataChanged',
},
isAttached: {
type: Boolean,
value: false,
observer: 'dataChanged',
},
},
attached: function() {
this.isAttached = true;
},
dataChanged: function() {
this.drawChart();
},
drawChart: function() {
if (!this.isAttached) {
return;
}
var root = Polymer.dom(this);
var stateHistory = this.data;
while (root.lastChild) {
root.removeChild(root.lastChild);
}
if (!stateHistory || stateHistory.length === 0) {
return;
}
var chart = new google.visualization.Timeline(this);
var dataTable = new google.visualization.DataTable();
dataTable.addColumn({ type: 'string', id: 'Entity' });
dataTable.addColumn({ type: 'string', id: 'State' });
dataTable.addColumn({ type: 'date', id: 'Start' });
dataTable.addColumn({ type: 'date', id: 'End' });
var addRow = function(entityDisplay, stateStr, start, end) {
stateStr = stateStr.replace(/_/g, ' ');
dataTable.addRow([entityDisplay, stateStr, start, end]);
};
var numTimelines = 0;
// stateHistory is a list of lists of sorted state objects
stateHistory.forEach(function(stateInfo) {
if(stateInfo.length === 0) return;
var entityDisplay = stateInfo[0].entityDisplay;
var newLastChanged, prevState = null, prevLastChanged = null;
stateInfo.forEach(function(state) {
if (prevState !== null && state.state !== prevState) {
newLastChanged = state.lastChangedAsDate;
addRow(entityDisplay, prevState, prevLastChanged, newLastChanged);
prevState = state.state;
prevLastChanged = newLastChanged;
} else if (prevState === null) {
prevState = state.state;
prevLastChanged = state.lastChangedAsDate;
}
});
// end time is start time + 1 day
var endTime = new Date(stateInfo[0].lastChangedAsDate);
endTime.setDate(endTime.getDate()+1);
addRow(entityDisplay, prevState, prevLastChanged, endTime);
numTimelines++;
}.bind(this));
chart.draw(dataTable, {
height: 55 + numTimelines * 42,
timeline: {
showRowLabels: stateHistory.length > 1
},
hAxis: {
format: 'H:mm'
},
});
},
});
})();
</script>
<dom-module id="state-history-charts" assetpath="components/">
<style>
:host {
@@ -23146,27 +23308,32 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
text-align: center;
padding: 8px;
}
.loading {
height: 0px;
overflow: hidden;
}
</style>
<template>
<google-legacy-loader on-api-load="googleApiLoaded"></google-legacy-loader>
<div hidden$="{{!isLoading}}" class="loading-container">
<loading-box>Loading history data</loading-box>
<loading-box>Updating history data</loading-box>
</div>
<template is="dom-if" if="[[!isLoading]]">
<template is="dom-if" if="[[groupedStateHistory.timeline]]">
<state-history-chart-timeline data="[[groupedStateHistory.timeline]]" is-single-device="[[isSingleDevice]]">
</state-history-chart-timeline>
<div class$="[[computeContentClasses(isLoading)]]">
<template is="dom-if" if="[[computeIsEmpty(stateHistory)]]">
No state history found.
</template>
<template is="dom-if" if="[[groupedStateHistory.line]]">
<template is="dom-repeat" items="[[groupedStateHistory.line]]">
<state-history-chart-line unit="[[extractUnit(item)]]" data="[[extractData(item)]]" is-single-device="[[isSingleDevice]]">
</state-history-chart-line>
</template>
<state-history-chart-timeline data="[[groupedStateHistory.timeline]]" is-single-device="[[isSingleDevice]]">
</state-history-chart-timeline>
<template is="dom-repeat" items="[[groupedStateHistory.line]]">
<state-history-chart-line unit="[[extractUnit(item)]]" data="[[extractData(item)]]" is-single-device="[[isSingleDevice]]">
</state-history-chart-line>
</template>
</template>
</div>
</template>
</dom-module>
@@ -23197,7 +23364,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
groupedStateHistory: {
type: Object,
computed: 'computeGroupedStateHistory(stateHistory)',
computed: 'computeGroupedStateHistory(isLoading, stateHistory)',
},
isSingleDevice: {
@@ -23210,11 +23377,11 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
return stateHistory && stateHistory.length == 1;
},
computeGroupedStateHistory: function(stateHistory) {
computeGroupedStateHistory: function(isLoading, stateHistory) {
var lineChartDevices = {};
var timelineDevices = [];
if (!stateHistory) {
if (isLoading || !stateHistory) {
return {line: unitStates, timeline: timelineDevices};
}
@@ -23257,10 +23424,18 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
});
},
computeContentClasses: function(isLoading) {
return isLoading ? 'loading' : '';
},
computeIsLoading: function(isLoadingData, apiLoaded) {
return isLoadingData || !apiLoaded;
},
computeIsEmpty: function(stateHistory) {
return stateHistory && stateHistory.length === 0;
},
extractUnit: function(arr) {
return arr[0];
},
@@ -23280,6 +23455,14 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
.content.wide {
padding: 8px;
}
paper-input {
max-width: 200px;
}
.narrow paper-input {
margin-left: 8px;
}
</style>
<template>
<partial-base narrow="[[narrow]]">
@@ -23288,6 +23471,8 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
<paper-icon-button icon="refresh" header-buttons="" on-click="handleRefreshClick"></paper-icon-button>
<div class$="[[computeContentClasses(narrow)]]">
<paper-input label="Showing entries for" on-click="handleShowDatePicker" value="[[computeDateCaption(selectedDate)]]"></paper-input>
<state-history-charts state-history="[[stateHistory]]" is-loading-data="[[isLoadingData]]"></state-history-charts>
</div>
</partial-base>
@@ -23296,6 +23481,12 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
<script>
(function() {
var stateHistoryActions = window.hass.stateHistoryActions;
var stateHistoryStore = window.hass.stateHistoryStore;
var uiActions = window.hass.uiActions;
function date_to_str(date) {
return date.getFullYear() + '-' + (date.getMonth()+1) + '-' + date.getDate();
}
Polymer({
is: 'partial-history',
@@ -23315,23 +23506,42 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
type: Boolean,
value: false,
},
selectedDate: {
type: String,
value: null,
observer: 'fetchIfNeeded',
},
},
stateHistoryStoreChanged: function(stateHistoryStore) {
if (stateHistoryStore.isStale()) {
this.isLoadingData = true;
stateHistoryActions.fetchAll();
}
else {
this.isLoadingData = false;
}
stateHistoryStoreChanged: function() {
this.isLoadingData = this.fetchIfNeeded();
this.stateHistory = this.isLoadingData ?
[] : stateHistoryStore.all(this.selectedDate);
},
this.stateHistory = stateHistoryStore.all;
computeDateCaption: function(selectedDate) {
return selectedDate || 'today';
},
fetchIfNeeded: function() {
if (stateHistoryStore.shouldFetch(this.selectedDate)) {
this.isLoadingData = true;
stateHistoryActions.fetchAll(this.selectedDate);
return true;
}
return false;
},
handleRefreshClick: function() {
this.isLoadingData = true;
stateHistoryActions.fetchAll();
stateHistoryActions.fetchAll(this.selectedDate);
},
handleShowDatePicker: function() {
uiActions.showDatePicker(function(selectedDate) {
this.selectedDate = date_to_str(selectedDate);
}.bind(this), this.selectedDate);
},
computeContentClasses: function(narrow) {
@@ -27662,7 +27872,7 @@ paper-ripple {
this.stateStoreChanged();
this.stateHistoryStoreChanged();
if (this.hasHistoryComponent && stateHistoryStore.isStale(entityId)) {
if (this.hasHistoryComponent && stateHistoryStore.shouldFetchEntity(entityId)) {
this.isLoadingHistoryData = true;
stateHistoryActions.fetch(entityId);
}
@@ -1,5 +1,14 @@
<link rel="import" href="../bower_components/polymer/polymer.html">
<dom-module is='state-history-chart-timeline'>
<style>
:host {
display: block;
}
</style>
<template></template>
</dom-module>
<script>
(function() {
Polymer({
@@ -18,10 +27,6 @@
},
},
created: function() {
this.style.display = 'block';
},
attached: function() {
this.isAttached = true;
},
@@ -45,7 +50,7 @@
if (!stateHistory || stateHistory.length === 0) {
return;
}
// debugger;
var chart = new google.visualization.Timeline(this);
var dataTable = new google.visualization.DataTable();
@@ -59,15 +64,6 @@
dataTable.addRow([entityDisplay, stateStr, start, end]);
};
// people can pass in history of 1 entityId or a collection.
// var stateHistory;
// if (_.isArray(data[0])) {
// stateHistory = data;
// } else {
// stateHistory = [data];
// isSingleDevice = true;
// }
var numTimelines = 0;
// stateHistory is a list of lists of sorted state objects
stateHistory.forEach(function(stateInfo) {
@@ -90,17 +86,17 @@
}
});
addRow(entityDisplay, prevState, prevLastChanged, new Date());
// end time is start time + 1 day
var endTime = new Date(stateInfo[0].lastChangedAsDate);
endTime.setDate(endTime.getDate()+1);
addRow(entityDisplay, prevState, prevLastChanged, endTime);
numTimelines++;
}.bind(this));
chart.draw(dataTable, {
height: 55 + numTimelines * 42,
// interactive properties require CSS, the JS api puts it on the document
// instead of inside our Shadow DOM.
enableInteractivity: false,
timeline: {
showRowLabels: stateHistory.length > 1
},
@@ -16,29 +16,34 @@
text-align: center;
padding: 8px;
}
.loading {
height: 0px;
overflow: hidden;
}
</style>
<template>
<google-legacy-loader on-api-load="googleApiLoaded"></google-legacy-loader>
<div hidden$="{{!isLoading}}" class='loading-container'>
<loading-box>Loading history data</loading-box>
<loading-box>Updating history data</loading-box>
</div>
<template is='dom-if' if='[[!isLoading]]'>
<template is='dom-if' if='[[groupedStateHistory.timeline]]'>
<state-history-chart-timeline data='[[groupedStateHistory.timeline]]'
is-single-device='[[isSingleDevice]]'>
</state-history-chart-timeline>
<div class$='[[computeContentClasses(isLoading)]]'>
<template is='dom-if' if='[[computeIsEmpty(stateHistory)]]'>
No state history found.
</template>
<template is='dom-if' if='[[groupedStateHistory.line]]'>
<template is='dom-repeat' items='[[groupedStateHistory.line]]'>
<state-history-chart-line unit='[[extractUnit(item)]]'
data='[[extractData(item)]]' is-single-device='[[isSingleDevice]]'>
</state-history-chart-line>
</template>
<state-history-chart-timeline data='[[groupedStateHistory.timeline]]'
is-single-device='[[isSingleDevice]]'>
</state-history-chart-timeline>
<template is='dom-repeat' items='[[groupedStateHistory.line]]'>
<state-history-chart-line unit='[[extractUnit(item)]]'
data='[[extractData(item)]]' is-single-device='[[isSingleDevice]]'>
</state-history-chart-line>
</template>
</template>
</div>
</template>
</dom-module>
@@ -69,7 +74,7 @@
groupedStateHistory: {
type: Object,
computed: 'computeGroupedStateHistory(stateHistory)',
computed: 'computeGroupedStateHistory(isLoading, stateHistory)',
},
isSingleDevice: {
@@ -82,11 +87,11 @@
return stateHistory && stateHistory.length == 1;
},
computeGroupedStateHistory: function(stateHistory) {
computeGroupedStateHistory: function(isLoading, stateHistory) {
var lineChartDevices = {};
var timelineDevices = [];
if (!stateHistory) {
if (isLoading || !stateHistory) {
return {line: unitStates, timeline: timelineDevices};
}
@@ -129,10 +134,18 @@
});
},
computeContentClasses: function(isLoading) {
return isLoading ? 'loading' : '';
},
computeIsLoading: function(isLoadingData, apiLoaded) {
return isLoadingData || !apiLoaded;
},
computeIsEmpty: function(stateHistory) {
return stateHistory && stateHistory.length === 0;
},
extractUnit: function(arr) {
return arr[0];
},
@@ -134,7 +134,7 @@
this.stateStoreChanged();
this.stateHistoryStoreChanged();
if (this.hasHistoryComponent && stateHistoryStore.isStale(entityId)) {
if (this.hasHistoryComponent && stateHistoryStore.shouldFetchEntity(entityId)) {
this.isLoadingHistoryData = true;
stateHistoryActions.fetch(entityId);
}
@@ -1,5 +1,6 @@
<link rel="import" href="../bower_components/polymer/polymer.html">
<link rel="import" href="../bower_components/paper-icon-button/paper-icon-button.html">
<link rel="import" href="../bower_components/paper-input/paper-input.html">
<link rel="import" href="./partial-base.html">
@@ -14,6 +15,14 @@
.content.wide {
padding: 8px;
}
paper-input {
max-width: 200px;
}
.narrow paper-input {
margin-left: 8px;
}
</style>
<template>
<partial-base narrow="[[narrow]]">
@@ -23,6 +32,9 @@
on-click="handleRefreshClick"></paper-icon-button>
<div class$="[[computeContentClasses(narrow)]]">
<paper-input label='Showing entries for' on-click='handleShowDatePicker'
value='[[computeDateCaption(selectedDate)]]'></paper-input>
<state-history-charts state-history="[[stateHistory]]"
is-loading-data="[[isLoadingData]]"></state-history-charts>
</div>
@@ -32,6 +44,12 @@
<script>
(function() {
var stateHistoryActions = window.hass.stateHistoryActions;
var stateHistoryStore = window.hass.stateHistoryStore;
var uiActions = window.hass.uiActions;
function date_to_str(date) {
return date.getFullYear() + '-' + (date.getMonth()+1) + '-' + date.getDate();
}
Polymer({
is: 'partial-history',
@@ -51,23 +69,42 @@
type: Boolean,
value: false,
},
selectedDate: {
type: String,
value: null,
observer: 'fetchIfNeeded',
},
},
stateHistoryStoreChanged: function(stateHistoryStore) {
if (stateHistoryStore.isStale()) {
this.isLoadingData = true;
stateHistoryActions.fetchAll();
}
else {
this.isLoadingData = false;
}
stateHistoryStoreChanged: function() {
this.isLoadingData = this.fetchIfNeeded();
this.stateHistory = this.isLoadingData ?
[] : stateHistoryStore.all(this.selectedDate);
},
this.stateHistory = stateHistoryStore.all;
computeDateCaption: function(selectedDate) {
return selectedDate || 'today';
},
fetchIfNeeded: function() {
if (stateHistoryStore.shouldFetch(this.selectedDate)) {
this.isLoadingData = true;
stateHistoryActions.fetchAll(this.selectedDate);
return true;
}
return false;
},
handleRefreshClick: function() {
this.isLoadingData = true;
stateHistoryActions.fetchAll();
stateHistoryActions.fetchAll(this.selectedDate);
},
handleShowDatePicker: function() {
uiActions.showDatePicker(function(selectedDate) {
this.selectedDate = date_to_str(selectedDate);
}.bind(this), this.selectedDate);
},
computeContentClasses: function(narrow) {
@@ -13,6 +13,10 @@
.selected-date-container {
padding: 0 16px;
}
paper-input {
max-width: 200px;
}
</style>
<template>
<partial-base narrow="[[narrow]]">
+24 -6
View File
@@ -9,12 +9,16 @@ from datetime import timedelta
from itertools import groupby
from collections import defaultdict
import homeassistant.util.dt as date_util
import homeassistant.util.dt as dt_util
import homeassistant.components.recorder as recorder
from homeassistant.const import HTTP_BAD_REQUEST
DOMAIN = 'history'
DEPENDENCIES = ['recorder', 'http']
URL_HISTORY_PERIOD = re.compile(
r'/api/history/period(?:/(?P<date>\d{4}-\d{1,2}-\d{1,2})|)')
def last_5_states(entity_id):
""" Return the last 5 states for entity_id. """
@@ -111,8 +115,7 @@ def setup(hass, config):
r'recent_states'),
_api_last_5_states)
hass.http.register_path(
'GET', re.compile(r'/api/history/period'), _api_history_period)
hass.http.register_path('GET', URL_HISTORY_PERIOD, _api_history_period)
return True
@@ -128,10 +131,25 @@ def _api_last_5_states(handler, path_match, data):
def _api_history_period(handler, path_match, data):
""" Return history over a period of time. """
# 1 day for now..
start_time = date_util.utcnow() - timedelta(seconds=86400)
date_str = path_match.group('date')
one_day = timedelta(seconds=86400)
if date_str:
start_date = dt_util.date_str_to_date(date_str)
if start_date is None:
handler.write_json_message("Error parsing JSON", HTTP_BAD_REQUEST)
return
start_time = dt_util.as_utc(dt_util.start_of_local_day(start_date))
else:
start_time = dt_util.utcnow() - one_day
end_time = start_time + one_day
print("Fetchign", start_time, end_time)
entity_id = data.get('filter_entity_id')
handler.write_json(
state_changes_during_period(start_time, entity_id=entity_id).values())
state_changes_during_period(start_time, end_time, entity_id).values())