diff --git a/homeassistant/components/camera/__init__.py b/homeassistant/components/camera/__init__.py index 05be02a9491..0be1d4118f7 100644 --- a/homeassistant/components/camera/__init__.py +++ b/homeassistant/components/camera/__init__.py @@ -27,7 +27,7 @@ STATE_RECORDING = 'recording' STATE_STREAMING = 'streaming' STATE_IDLE = 'idle' -ENTITY_IMAGE_URL = '/api/camera_proxy/{0}' +ENTITY_IMAGE_URL = '/api/camera_proxy/{0}?token={1}' # pylint: disable=too-many-branches @@ -65,7 +65,7 @@ class Camera(Entity): @property def entity_picture(self): """Return a link to the camera feed as entity picture.""" - return ENTITY_IMAGE_URL.format(self.entity_id) + return ENTITY_IMAGE_URL.format(self.entity_id, self.access_token) @property def is_recording(self): diff --git a/homeassistant/components/frontend/version.py b/homeassistant/components/frontend/version.py index 8bdf1755b04..b84aee201af 100644 --- a/homeassistant/components/frontend/version.py +++ b/homeassistant/components/frontend/version.py @@ -1,2 +1,2 @@ """DO NOT MODIFY. Auto-generated by build_frontend script.""" -VERSION = "0a226e905af198b2dabf1ce154844568" +VERSION = "45a2660086388e0ac7d61e3442c4d847" diff --git a/homeassistant/components/frontend/www_static/frontend.html b/homeassistant/components/frontend/www_static/frontend.html index 09118970c8d..a0dae2d8a01 100644 --- a/homeassistant/components/frontend/www_static/frontend.html +++ b/homeassistant/components/frontend/www_static/frontend.html @@ -1,8 +1,8 @@ \ No newline at end of file +if(n){var r=n.get("getter"),i=n.get("handler"),o=h.evaluate(t.prevReactorState,r),a=h.evaluate(t.reactorState,r);t.prevReactorState=o.reactorState,t.reactorState=a.reactorState;var s=o.result,u=a.result;c["default"].is(s,u)||i.call(null,u)}});var r=h.resetDirtyStores(this.reactorState);this.prevReactorState=r,this.reactorState=r}}}},{key:"batchStart",value:function(){this.__batchDepth++}},{key:"batchEnd",value:function(){if(this.__batchDepth--,this.__batchDepth<=0){this.__isDispatching=!0;try{this.__notify()}catch(t){throw this.__isDispatching=!1,t}this.__isDispatching=!1}}}]),t}();e["default"]=(0,y.toFactory)(g),t.exports=e["default"]},function(t,e,n){"use strict";function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function i(t,e){var n={};return(0,o.each)(e,function(e,r){n[r]=t.evaluate(e)}),n}Object.defineProperty(e,"__esModule",{value:!0});var o=n(4);e["default"]=function(t){return{getInitialState:function(){return i(t,this.getDataBindings())},componentDidMount:function(){var e=this;this.__unwatchFns=[],(0,o.each)(this.getDataBindings(),function(n,i){var o=t.observe(n,function(t){e.setState(r({},i,t))});e.__unwatchFns.push(o)})},componentWillUnmount:function(){for(;this.__unwatchFns.length;)this.__unwatchFns.shift()()}}},t.exports=e["default"]},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){return new P({result:t,reactorState:e})}function o(t,e){return t.withMutations(function(t){(0,k.each)(e,function(e,n){t.getIn(["stores",n])&&console.warn("Store already defined for id = "+n);var r=e.getInitialState();if(void 0===r&&l(t,"throwOnUndefinedStoreReturnValue"))throw new Error("Store getInitialState() must return a value, did you forget a return statement");if(l(t,"throwOnNonImmutableStore")&&!(0,C.isImmutableValue)(r))throw new Error("Store getInitialState() must return an immutable value, did you forget to call toImmutable");t.update("stores",function(t){return t.set(n,e)}).update("state",function(t){return t.set(n,r)}).update("dirtyStores",function(t){return t.add(n)}).update("storeStates",function(t){return O(t,[n])})}),w(t)})}function a(t,e){return t.withMutations(function(t){(0,k.each)(e,function(e,n){t.update("stores",function(t){return t.set(n,e)})})})}function s(t,e,n){if(void 0===e&&l(t,"throwOnUndefinedActionType"))throw new Error("`dispatch` cannot be called with an `undefined` action type.");var r=t.get("state"),i=t.get("dirtyStores"),o=r.withMutations(function(r){D["default"].dispatchStart(t,e,n),t.get("stores").forEach(function(o,a){var s=r.get(a),u=void 0;try{u=o.handle(s,e,n)}catch(c){throw D["default"].dispatchError(t,c.message),c}if(void 0===u&&l(t,"throwOnUndefinedStoreReturnValue")){var f="Store handler must return a value, did you forget a return statement";throw D["default"].dispatchError(t,f),new Error(f)}r.set(a,u),s!==u&&(i=i.add(a))}),D["default"].dispatchEnd(t,r,i)}),a=t.set("state",o).set("dirtyStores",i).update("storeStates",function(t){return O(t,i)});return w(a)}function u(t,e){var n=[],r=(0,C.toImmutable)({}).withMutations(function(r){(0,k.each)(e,function(e,i){var o=t.getIn(["stores",i]);if(o){var a=o.deserialize(e);void 0!==a&&(r.set(i,a),n.push(i))}})}),i=T["default"].Set(n);return t.update("state",function(t){return t.merge(r)}).update("dirtyStores",function(t){return t.union(i)}).update("storeStates",function(t){return O(t,n)})}function c(t,e,n){var r=e;(0,M.isKeyPath)(e)&&(e=(0,j.fromKeyPath)(e));var i=t.get("nextId"),o=(0,j.getStoreDeps)(e),a=T["default"].Map({id:i,storeDeps:o,getterKey:r,getter:e,handler:n}),s=void 0;return s=0===o.size?t.update("any",function(t){return t.add(i)}):t.withMutations(function(t){o.forEach(function(e){var n=["stores",e];t.hasIn(n)||t.setIn(n,T["default"].Set()),t.updateIn(["stores",e],function(t){return t.add(i)})})}),s=s.set("nextId",i+1).setIn(["observersMap",i],a),{observerState:s,entry:a}}function l(t,e){var n=t.getIn(["options",e]);if(void 0===n)throw new Error("Invalid option: "+e);return n}function f(t,e,n){var r=t.get("observersMap").filter(function(t){var r=t.get("getterKey"),i=!n||t.get("handler")===n;return i?(0,M.isKeyPath)(e)&&(0,M.isKeyPath)(r)?(0,M.isEqual)(e,r):e===r:!1});return t.withMutations(function(t){r.forEach(function(e){return d(t,e)})})}function d(t,e){return t.withMutations(function(t){var n=e.get("id"),r=e.get("storeDeps");0===r.size?t.update("any",function(t){return t.remove(n)}):r.forEach(function(e){t.updateIn(["stores",e],function(t){return t?t.remove(n):t})}),t.removeIn(["observersMap",n])})}function h(t){var e=t.get("state");return t.withMutations(function(t){var n=t.get("stores"),r=n.keySeq().toJS();n.forEach(function(n,r){var i=e.get(r),o=n.handleReset(i);if(void 0===o&&l(t,"throwOnUndefinedStoreReturnValue"))throw new Error("Store handleReset() must return a value, did you forget a return statement");if(l(t,"throwOnNonImmutableStore")&&!(0,C.isImmutableValue)(o))throw new Error("Store reset state must be an immutable value, did you forget to call toImmutable");t.setIn(["state",r],o)}),t.update("storeStates",function(t){return O(t,r)}),_(t)})}function p(t,e){var n=t.get("state");if((0,M.isKeyPath)(e))return i(n.getIn(e),t);if(!(0,j.isGetter)(e))throw new Error("evaluate must be passed a keyPath or Getter");if(g(t,e))return i(S(t,e),t);var r=(0,j.getDeps)(e).map(function(e){return p(t,e).result}),o=(0,j.getComputeFn)(e).apply(null,r);return i(o,b(t,e,o))}function v(t){var e={};return t.get("stores").forEach(function(n,r){var i=t.getIn(["state",r]),o=n.serialize(i);void 0!==o&&(e[r]=o)}),e}function _(t){return t.set("dirtyStores",T["default"].Set())}function y(t){return t}function m(t,e){var n=y(e);return t.getIn(["cache",n])}function g(t,e){var n=m(t,e);if(!n)return!1;var r=n.get("storeStates");return 0===r.size?!1:r.every(function(e,n){return t.getIn(["storeStates",n])===e})}function b(t,e,n){var r=y(e),i=t.get("dispatchId"),o=(0,j.getStoreDeps)(e),a=(0,C.toImmutable)({}).withMutations(function(e){o.forEach(function(n){var r=t.getIn(["storeStates",n]);e.set(n,r)})});return t.setIn(["cache",r],T["default"].Map({value:n,storeStates:a,dispatchId:i}))}function S(t,e){var n=y(e);return t.getIn(["cache",n,"value"])}function w(t){return t.update("dispatchId",function(t){return t+1})}function O(t,e){return t.withMutations(function(t){e.forEach(function(e){var n=t.has(e)?t.get(e)+1:1;t.set(e,n)})})}Object.defineProperty(e,"__esModule",{value:!0}),e.registerStores=o,e.replaceStores=a,e.dispatch=s,e.loadState=u,e.addObserver=c,e.getOption=l,e.removeObserver=f,e.removeObserverByEntry=d,e.reset=h,e.evaluate=p,e.serialize=v,e.resetDirtyStores=_;var I=n(3),T=r(I),E=n(9),D=r(E),C=n(5),j=n(10),M=n(11),k=n(4),P=T["default"].Record({result:null,reactorState:null})},function(t,e,n){"use strict";var r=n(8);e.dispatchStart=function(t,e,n){(0,r.getOption)(t,"logDispatches")&&console.group&&(console.groupCollapsed("Dispatch: %s",e),console.group("payload"),console.debug(n),console.groupEnd())},e.dispatchError=function(t,e){(0,r.getOption)(t,"logDispatches")&&console.group&&(console.debug("Dispatch error: "+e),console.groupEnd())},e.dispatchEnd=function(t,e,n){(0,r.getOption)(t,"logDispatches")&&console.group&&((0,r.getOption)(t,"logDirtyStores")&&console.log("Stores updated:",n.toList().toJS()),(0,r.getOption)(t,"logAppState")&&console.debug("Dispatch done, new state: ",e.toJS()),console.groupEnd())}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){return(0,d.isArray)(t)&&(0,d.isFunction)(t[t.length-1])}function o(t){return t[t.length-1]}function a(t){return t.slice(0,t.length-1)}function s(t,e){e||(e=f["default"].Set());var n=f["default"].Set().withMutations(function(e){if(!i(t))throw new Error("getFlattenedDeps must be passed a Getter");a(t).forEach(function(t){if((0,h.isKeyPath)(t))e.add((0,l.List)(t));else{if(!i(t))throw new Error("Invalid getter, each dependency must be a KeyPath or Getter");e.union(s(t))}})});return e.union(n)}function u(t){if(!(0,h.isKeyPath)(t))throw new Error("Cannot create Getter from KeyPath: "+t);return[t,p]}function c(t){if(t.hasOwnProperty("__storeDeps"))return t.__storeDeps;var e=s(t).map(function(t){return t.first()}).filter(function(t){return!!t});return Object.defineProperty(t,"__storeDeps",{enumerable:!1,configurable:!1,writable:!1,value:e}),e}Object.defineProperty(e,"__esModule",{value:!0});var l=n(3),f=r(l),d=n(4),h=n(11),p=function(t){return t};e["default"]={isGetter:i,getComputeFn:o,getFlattenedDeps:s,getStoreDeps:c,getDeps:a,fromKeyPath:u},t.exports=e["default"]},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){return(0,u.isArray)(t)&&!(0,u.isFunction)(t[t.length-1])}function o(t,e){var n=s["default"].List(t),r=s["default"].List(e);return s["default"].is(n,r)}Object.defineProperty(e,"__esModule",{value:!0}),e.isKeyPath=i,e.isEqual=o;var a=n(3),s=r(a),u=n(4)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(3),i=(0,r.Map)({logDispatches:!1,logAppState:!1,logDirtyStores:!1,throwOnUndefinedActionType:!1,throwOnUndefinedStoreReturnValue:!1,throwOnNonImmutableStore:!1,throwOnDispatchInDispatch:!1});e.PROD_OPTIONS=i;var o=(0,r.Map)({logDispatches:!0,logAppState:!0,logDirtyStores:!0,throwOnUndefinedActionType:!0,throwOnUndefinedStoreReturnValue:!0,throwOnNonImmutableStore:!0,throwOnDispatchInDispatch:!0});e.DEBUG_OPTIONS=o;var a=(0,r.Record)({dispatchId:0,state:(0,r.Map)(),stores:(0,r.Map)(),cache:(0,r.Map)(),storeStates:(0,r.Map)(),dirtyStores:(0,r.Set)(),debug:!1,options:i});e.ReactorState=a;var s=(0,r.Record)({any:(0,r.Set)(),stores:(0,r.Map)({}),observersMap:(0,r.Map)({}),nextId:1});e.ObserverState=s}])})},function(t,e,n){"use strict";var r=n(1),i=n(206);e.a=i.a.bind()(r.a.reactor)},function(t,e,n){"use strict";var r=n(74),i=r.a;Object.defineProperty(e,"a",{configurable:!1,enumerable:!0,get:function(){return i}})},function(t,e,n){"use strict";var r=n(0);n(155),n(56),e["default"]=new r.a({is:"state-info",properties:{detailed:{type:Boolean,value:!1},stateObj:{type:Object}}})},function(t,e){"use strict";var n=function(t){var e,n={};if(!(t instanceof Object)||Array.isArray(t))throw new Error("keyMirror(...): Argument must be an object.");for(e in t)t.hasOwnProperty(e)&&(n[e]=e);return n};t.exports=n},function(t,e,n){"use strict";var r=n(90),i=n(92),o=r.a;Object.defineProperty(e,"actions",{configurable:!1,enumerable:!0,get:function(){return o}});var a=i;Object.defineProperty(e,"getters",{configurable:!1,enumerable:!0,get:function(){return a}})},function(t,e,n){"use strict";var r=n(0);e["default"]=new r.a({is:"partial-base",properties:{narrow:{type:Boolean,value:!1},showMenu:{type:Boolean,value:!1}},computeMenuButtonClass:function(t,e){return!t&&e?"invisible":""},toggleMenu:function(){this.fire("open-menu")}})},function(t,e,n){"use strict";function r(t){t.registerStores({restApiCache:c.a})}function i(t){return[["restApiCache",t.entity],function(t){return!!t}]}function o(t){return[["restApiCache",t.entity],function(t){return t||s.toImmutable.bind()({})}]}function a(t){return function(e){return["restApiCache",t.entity,e]}}var s=n(2),u=s&&s.__esModule?function(){return s["default"]}:function(){return s};Object.defineProperty(u,"a",{get:u});var c=n(117),l=n(116);e.register=r,e.createHasDataGetter=i,e.createEntityMapGetter=o,e.createByIdGetter=a;var f=l.a;Object.defineProperty(e,"createApiActions",{configurable:!1,enumerable:!0,get:function(){return f}})},function(t,e,n){"use strict";var r=n(6),i=r&&r.__esModule?function(){return r["default"]}:function(){return r};Object.defineProperty(i,"a",{get:i}),e.a=i.a.bind()({ENTITY_HISTORY_DATE_SELECTED:null,ENTITY_HISTORY_FETCH_START:null,ENTITY_HISTORY_FETCH_ERROR:null,ENTITY_HISTORY_FETCH_SUCCESS:null,RECENT_ENTITY_HISTORY_FETCH_START:null,RECENT_ENTITY_HISTORY_FETCH_ERROR:null,RECENT_ENTITY_HISTORY_FETCH_SUCCESS:null,LOG_OUT:null})},function(t,e,n){"use strict";var r=n(6),i=r&&r.__esModule?function(){return r["default"]}:function(){return r};Object.defineProperty(i,"a",{get:i}),e.a=i.a.bind()({LOGBOOK_DATE_SELECTED:null,LOGBOOK_ENTRIES_FETCH_START:null,LOGBOOK_ENTRIES_FETCH_ERROR:null,LOGBOOK_ENTRIES_FETCH_SUCCESS:null})},function(t,e,n){"use strict";var r=n(118),i=r&&r.__esModule?function(){return r["default"]}:function(){return r};Object.defineProperty(i,"a",{get:i});var o=n(46),a=i.a;Object.defineProperty(e,"actions",{configurable:!1,enumerable:!0,get:function(){return a}});var s=o;Object.defineProperty(e,"getters",{configurable:!1,enumerable:!0,get:function(){return s}})},function(t,e,n){"use strict";var r=n(6),i=r&&r.__esModule?function(){return r["default"]}:function(){return r};Object.defineProperty(i,"a",{get:i}),e.a=i.a.bind()({VALIDATING_AUTH_TOKEN:null,VALID_AUTH_TOKEN:null,INVALID_AUTH_TOKEN:null,LOG_OUT:null})},function(t,e,n){"use strict";function r(t){t.registerStores({authAttempt:i.a,authCurrent:o.a,rememberAuth:a.a})}var i=n(77),o=n(78),a=n(79),s=n(75),u=n(76);e.register=r;var c=s;Object.defineProperty(e,"actions",{configurable:!1,enumerable:!0,get:function(){return c}});var l=u;Object.defineProperty(e,"getters",{configurable:!1,enumerable:!0,get:function(){return l}})},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function o(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&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var a=n(2),s=a&&a.__esModule?function(){return a["default"]}:function(){return a};Object.defineProperty(s,"a",{get:s});var u=n(91),c=n(28),l=n(4),f=function(){function t(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(u){i=!0,o=u}finally{try{!r&&s["return"]&&s["return"]()}finally{if(i)throw o}}return n}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),d=function(){function t(t,e){for(var n=0;n4?"value big":"value"},computeHideIcon:function(t,e,n){return!t||e||n},computeHideValue:function(t,e){return!t||e},imageChanged:function(t){this.$.badge.style.backgroundImage=t?"url("+t+")":""}})},function(t,e,n){"use strict";var r=n(0);e["default"]=new r.a({is:"loading-box"})},function(t,e,n){"use strict";var r=n(0),i=n(208),o=n(17);n(195),n(58),n(196),n(197),n(198),n(199),n(201),n(202),n(200),n(203),n(204),n(205),e["default"]=new r.a({is:"state-card-content",properties:{inDialog:{type:Boolean,value:!1},stateObj:{type:Object}},observers:["inputChanged(inDialog, stateObj)"],inputChanged:function(t,e){e&&o.a.bind()(this,"STATE-CARD-"+i.a.bind()(e).toUpperCase(),{stateObj:e,inDialog:t})}})},function(t,e,n){"use strict";function r(t,e){switch(t){case"alarm_control_panel":return e&&"disarmed"===e?"mdi:bell-outline":"mdi:bell";case"automation":return"mdi:playlist-play";case"binary_sensor":return e&&"off"===e?"mdi:radiobox-blank":"mdi:checkbox-marked-circle";case"camera":return"mdi:video";case"configurator":return"mdi:settings";case"conversation":return"mdi:text-to-speech";case"device_tracker":return"mdi:account";case"garage_door":return"mdi:glassdoor";case"group":return"mdi:google-circles-communities";case"homeassistant":return"mdi:home";case"hvac":return"mdi:air-conditioner";case"input_boolean":return"mdi:drawing";case"input_select":return"mdi:format-list-bulleted";case"input_slider":return"mdi:ray-vertex";case"light":return"mdi:lightbulb";case"lock":return e&&"unlocked"===e?"mdi:lock-open":"mdi:lock";case"media_player":return e&&"off"!==e&&"idle"!==e?"mdi:cast-connected":"mdi:cast";case"notify":return"mdi:comment-alert";case"proximity":return"mdi:apple-safari";case"rollershutter":return e&&"open"===e?"mdi:window-open":"mdi:window-closed";case"scene":return"mdi:google-pages";case"script":return"mdi:file-document";case"sensor":return"mdi:eye";case"simple_alarm":return"mdi:bell";case"sun":return"mdi:white-balance-sunny";case"switch":return"mdi:flash";case"thermostat":return"mdi:nest-thermostat";case"updater":return"mdi:cloud-upload";case"weblink":return"mdi:open-in-new";default:return console.warn("Unable to find icon for domain "+t+" ("+e+")"),i.a}}var i=n(60);e.a=r},function(t,e){function n(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}t.exports=n},function(t,e){function n(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}t.exports=n},function(t,e,n){"use strict";var r=n(1),i=r.a.authActions,o=r.a.localStoragePreferences;e.a=function(t,e){i.validate(t,{rememberAuth:e,useStreaming:o.useStreaming})}},function(t,e,n){"use strict";var r=n(2),i=r&&r.__esModule?function(){return r["default"]}:function(){return r};Object.defineProperty(i,"a",{get:i});var o=["isLoadingEntityHistory"];Object.defineProperty(e,"isLoadingEntityHistory",{configurable:!1,enumerable:!0,get:function(){return o}});var a=["currentEntityHistoryDate"];Object.defineProperty(e,"currentDate",{configurable:!1,enumerable:!0,get:function(){return a}});var s=["entityHistory"];Object.defineProperty(e,"entityHistoryMap",{configurable:!1,enumerable:!0,get:function(){return s}});var u=[a,s,function(t,e){return e.get(t)||r.toImmutable.bind()({})}];Object.defineProperty(e,"entityHistoryForCurrentDate",{configurable:!1,enumerable:!0,get:function(){return u}});var c=[a,s,function(t,e){return!!e.get(t)}];Object.defineProperty(e,"hasDataForCurrentDate",{configurable:!1,enumerable:!0,get:function(){return c}});var l=["recentEntityHistory"];Object.defineProperty(e,"recentEntityHistoryMap",{configurable:!1,enumerable:!0,get:function(){return l}});var f=["recentEntityHistory"];Object.defineProperty(e,"recentEntityHistoryUpdatedMap",{configurable:!1,enumerable:!0,get:function(){return f}})},function(t,e,n){"use strict";function r(t){t.registerStores({currentEntityHistoryDate:i.a,entityHistory:o.a,isLoadingEntityHistory:a.a,recentEntityHistory:s.a,recentEntityHistoryUpdated:u.a})}var i=n(85),o=n(86),a=n(87),s=n(88),u=n(89),c=n(84),l=n(37);e.register=r;var f=c;Object.defineProperty(e,"actions",{configurable:!1,enumerable:!0,get:function(){return f}});var d=l;Object.defineProperty(e,"getters",{configurable:!1,enumerable:!0,get:function(){return d}})},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function o(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&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var a=n(2),s=a&&a.__esModule?function(){return a["default"]}:function(){return a};Object.defineProperty(s,"a",{get:s});var u=n(4),c=function(){function t(t,e){for(var n=0;n6e4}e.a=r},function(t,e,n){"use strict";var r=n(0),i=n(33); +e["default"]=new r.a({is:"domain-icon",properties:{domain:{type:String,value:""},state:{type:String,value:""}},computeIcon:function(t,e){return i.a.bind()(t,e)}})},function(t,e,n){"use strict";var r=n(0);e["default"]=new r.a({is:"ha-card",properties:{header:{type:String},elevation:{type:Number,value:1,reflectToAttribute:!0}}})},function(t,e,n){"use strict";var r=n(69),i=r&&r.__esModule?function(){return r["default"]}:function(){return r};Object.defineProperty(i,"a",{get:i});var o=n(1),a=n(0),s=6e4,u=o.a.util.parseDateTime;e["default"]=new a.a({is:"relative-ha-datetime",properties:{datetime:{type:String,observer:"datetimeChanged"},datetimeObj:{type:Object,observer:"datetimeObjChanged"},parsedDateTime:{type:Object},relativeTime:{type:String,value:"not set"}},created:function(){this.updateRelative=this.updateRelative.bind(this)},attached:function(){this.updateInterval=setInterval(this.updateRelative,s)},detached:function(){clearInterval(this.updateInterval)},datetimeChanged:function(t){this.parsedDateTime=t?u(t):null,this.updateRelative()},datetimeObjChanged:function(t){this.parsedDateTime=t,this.updateRelative()},updateRelative:function(){this.relativeTime=this.parsedDateTime?i.a.bind()(this.parsedDateTime).fromNow():""}})},function(t,e,n){"use strict";var r=n(0);n(31),n(165),n(164),e["default"]=new r.a({is:"state-history-charts",properties:{stateHistory:{type:Object},isLoadingData:{type:Boolean,value:!1},apiLoaded:{type:Boolean,value:!1},isLoading:{type:Boolean,computed:"computeIsLoading(isLoadingData, apiLoaded)"},groupedStateHistory:{type:Object,computed:"computeGroupedStateHistory(isLoading, stateHistory)"},isSingleDevice:{type:Boolean,computed:"computeIsSingleDevice(stateHistory)"}},computeIsSingleDevice:function(t){return t&&1===t.size},computeGroupedStateHistory:function(t,e){if(t||!e)return{line:[],timeline:[]};var n={},r=[];e.forEach(function(t){if(t&&0!==t.size){var e=t.find(function(t){return"unit_of_measurement"in t.attributes}),i=e?e.attributes.unit_of_measurement:!1;i?i in n?n[i].push(t.toArray()):n[i]=[t.toArray()]:r.push(t.toArray())}}),r=r.length>0&&r;var i=Object.keys(n).map(function(t){return[t,n[t]]});return{line:i,timeline:r}},googleApiLoaded:function(){var t=this;window.google.load("visualization","1",{packages:["timeline","corechart"],callback:function(){t.apiLoaded=!0}})},computeContentClasses:function(t){return t?"loading":""},computeIsLoading:function(t,e){return t||!e},computeIsEmpty:function(t){return t&&0===t.size},extractUnit:function(t){return t[0]},extractData:function(t){return t[1]}})},function(t,e,n){"use strict";var r=n(0);n(5),e["default"]=new r.a({is:"state-card-display",properties:{inDialog:{type:Boolean,value:!1},stateObj:{type:Object}}})},function(t,e,n){"use strict";function r(t){return o.evaluate(a.canToggleEntity(t))}var i=n(1);e.a=r;var o=i.a.reactor,a=i.a.serviceGetters},function(t,e,n){"use strict";e.a="mdi:bookmark"},function(t,e,n){"use strict";function r(t){return o.a.bind()(t).format("LT")}var i=n(69),o=i&&i.__esModule?function(){return i["default"]}:function(){return i};Object.defineProperty(o,"a",{get:o}),e.a=r},function(t,e,n){"use strict";function r(){var t=document.getElementById("ha-init-skeleton");t&&t.parentElement.removeChild(t)}e.a=r},function(t,e,n){"use strict";function r(t){var e=t.state&&"off"===t.state;switch(t.attributes.sensor_class){case"opening":return e?"mdi:crop-square":"mdi:exit-to-app";case"moisture":return e?"mdi:water-off":"mdi:water";case"light":return e?"mdi:brightness-5":"mdi:brightness-7";case"sound":return e?"mdi:music-note-off":"mdi:music-note";case"vibration":return e?"mdi:crop-portrait":"mdi:vibrate";case"connectivity":return e?"mdi:server-network-off":"mdi:server-network";case"safety":case"gas":case"smoke":case"power":return e?"mdi:verified":"mdi:alert";case"motion":return e?"mdi:walk":"mdi:run";case"digital":default:return e?"mdi:radiobox-blank":"mdi:checkbox-marked-circle"}}function i(t){if(!t)return o.a;if(t.attributes.icon)return t.attributes.icon;var e=t.attributes.unit_of_measurement;if(e&&"sensor"===t.domain){if(e===u.UNIT_TEMP_C||e===u.UNIT_TEMP_F)return"mdi:thermometer";if("Mice"===e)return"mdi:mouse-variant"}else if("binary_sensor"===t.domain)return r(t);return a.a.bind()(t.domain,t.state)}var o=n(60),a=n(33),s=n(1);e.a=i;var u=s.a.util.temperatureUnits},function(t,e,n){"use strict";function r(t){return-1!==i.indexOf(t.domain)?t.domain:"default"}e.a=r;var i=["light","group","sun","configurator","thermostat","script","media_player","camera","updater","alarm_control_panel","lock","hvac"]},function(t,e,n){function r(t,e,n){function r(e){var n=m,r=g;return m=g=void 0,I=e,S=t.apply(r,n)}function l(t){return I=t,w=setTimeout(h,e),T?r(t):S}function f(t){var n=t-O,r=t-I,i=e-n;return E?c(i,b-r):i}function d(t){var n=t-O,r=t-I;return!O||n>=e||0>n||E&&r>=b}function h(){var t=o();return d(t)?p(t):void(w=setTimeout(h,f(t)))}function p(t){return clearTimeout(w),w=void 0,D&&m?r(t):(m=g=void 0,S)}function v(){void 0!==w&&clearTimeout(w),O=I=0,m=g=w=void 0}function _(){return void 0===w?S:p(o())}function y(){var t=o(),n=d(t);if(m=arguments,g=this,O=t,n){if(void 0===w)return l(O);if(E)return clearTimeout(w),w=setTimeout(h,e),r(O)}return void 0===w&&(w=setTimeout(h,e)),S}var m,g,b,S,w,O=0,I=0,T=!1,E=!1,D=!0;if("function"!=typeof t)throw new TypeError(s);return e=a(e)||0,i(n)&&(T=!!n.leading,E="maxWait"in n,b=E?u(a(n.maxWait)||0,e):b,D="trailing"in n?!!n.trailing:D),y.cancel=v,y.flush=_,y}var i=n(34),o=n(214),a=n(215),s="Expected a function",u=Math.max,c=Math.min;t.exports=r},function(t,e,n){function r(t){var e=i(t)?u.call(t):"";return e==o||e==a}var i=n(34),o="[object Function]",a="[object GeneratorFunction]",s=Object.prototype,u=s.toString;t.exports=r},function(t,e){"use strict";function n(t){if(null===t||void 0===t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}function r(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},n=0;10>n;n++)e["_"+String.fromCharCode(n)]=n;var r=Object.getOwnPropertyNames(e).map(function(t){return e[t]});if("0123456789"!==r.join(""))return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach(function(t){i[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},i)).join("")}catch(o){return!1}}var i=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;t.exports=r()?Object.assign:function(t,e){for(var r,a,s=n(t),u=1;u0)for(n in cr)r=cr[n],i=e[r],h(i)||(t[r]=i);return t}function v(t){p(this,t),this._d=new Date(null!=t._d?t._d.getTime():NaN),lr===!1&&(lr=!0,e.updateOffset(this),lr=!1)}function _(t){return t instanceof v||null!=t&&null!=t._isAMomentObject}function y(t){return 0>t?Math.ceil(t):Math.floor(t)}function m(t){var e=+t,n=0;return 0!==e&&isFinite(e)&&(n=y(e)),n}function g(t,e,n){var r,i=Math.min(t.length,e.length),o=Math.abs(t.length-e.length),a=0;for(r=0;i>r;r++)(n&&t[r]!==e[r]||!n&&m(t[r])!==m(e[r]))&&a++;return a+o}function b(t){e.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+t)}function S(t,n){var r=!0;return s(function(){return null!=e.deprecationHandler&&e.deprecationHandler(null,t),r&&(b(t+"\nArguments: "+Array.prototype.slice.call(arguments).join(", ")+"\n"+(new Error).stack),r=!1),n.apply(this,arguments)},n)}function w(t,n){null!=e.deprecationHandler&&e.deprecationHandler(t,n),fr[t]||(b(n),fr[t]=!0)}function O(t){return t instanceof Function||"[object Function]"===Object.prototype.toString.call(t)}function I(t){return"[object Object]"===Object.prototype.toString.call(t)}function T(t){var e,n;for(n in t)e=t[n],O(e)?this[n]=e:this["_"+n]=e;this._config=t,this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)}function E(t,e){var n,r=s({},t);for(n in e)a(e,n)&&(I(t[n])&&I(e[n])?(r[n]={},s(r[n],t[n]),s(r[n],e[n])):null!=e[n]?r[n]=e[n]:delete r[n]);return r}function D(t){null!=t&&this.set(t)}function C(t){return t?t.toLowerCase().replace("_","-"):t}function j(t){for(var e,n,r,i,o=0;o0;){if(r=M(i.slice(0,e).join("-")))return r;if(n&&n.length>=e&&g(i,n,!0)>=e-1)break;e--}o++}return null}function M(e){var n=null;if(!vr[e]&&"undefined"!=typeof t&&t&&t.exports)try{n=hr._abbr,!function(){var t=new Error('Cannot find module "./locale"');throw t.code="MODULE_NOT_FOUND",t}(),k(n)}catch(r){}return vr[e]}function k(t,e){var n;return t&&(n=h(e)?x(t):P(t,e),n&&(hr=n)),hr._abbr}function P(t,e){return null!==e?(e.abbr=t,null!=vr[t]?(w("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale"),e=E(vr[t]._config,e)):null!=e.parentLocale&&(null!=vr[e.parentLocale]?e=E(vr[e.parentLocale]._config,e):w("parentLocaleUndefined","specified parentLocale is not defined yet")),vr[t]=new D(e),k(t),vr[t]):(delete vr[t],null)}function A(t,e){if(null!=e){var n;null!=vr[t]&&(e=E(vr[t]._config,e)),n=new D(e),n.parentLocale=vr[t],vr[t]=n,k(t)}else null!=vr[t]&&(null!=vr[t].parentLocale?vr[t]=vr[t].parentLocale:null!=vr[t]&&delete vr[t]);return vr[t]}function x(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return hr;if(!r(t)){if(e=M(t))return e;t=[t]}return j(t)}function L(){return dr(vr)}function N(t,e){var n=t.toLowerCase();_r[n]=_r[n+"s"]=_r[e]=t}function R(t){return"string"==typeof t?_r[t]||_r[t.toLowerCase()]:void 0}function H(t){var e,n,r={};for(n in t)a(t,n)&&(e=R(n),e&&(r[e]=t[n]));return r}function Y(t,n){return function(r){return null!=r?(U(this,t,r),e.updateOffset(this,n),this):z(this,t)}}function z(t,e){return t.isValid()?t._d["get"+(t._isUTC?"UTC":"")+e]():NaN}function U(t,e,n){t.isValid()&&t._d["set"+(t._isUTC?"UTC":"")+e](n)}function V(t,e){var n;if("object"==typeof t)for(n in t)this.set(n,t[n]);else if(t=R(t),O(this[t]))return this[t](e);return this}function B(t,e,n){var r=""+Math.abs(t),i=e-r.length,o=t>=0;return(o?n?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+r}function F(t,e,n,r){var i=r;"string"==typeof r&&(i=function(){return this[r]()}),t&&(br[t]=i),e&&(br[e[0]]=function(){return B(i.apply(this,arguments),e[1],e[2])}),n&&(br[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),t)})}function G(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function W(t){var e,n,r=t.match(yr);for(e=0,n=r.length;n>e;e++)br[r[e]]?r[e]=br[r[e]]:r[e]=G(r[e]);return function(e){var i,o="";for(i=0;n>i;i++)o+=r[i]instanceof Function?r[i].call(e,t):r[i];return o}}function q(t,e){return t.isValid()?(e=K(e,t.localeData()),gr[e]=gr[e]||W(e),gr[e](t)):t.localeData().invalidDate()}function K(t,e){function n(t){return e.longDateFormat(t)||t}var r=5;for(mr.lastIndex=0;r>=0&&mr.test(t);)t=t.replace(mr,n),mr.lastIndex=0,r-=1;return t}function J(t,e,n){Hr[t]=O(e)?e:function(t,r){return t&&n?n:e}}function $(t,e){return a(Hr,t)?Hr[t](e._strict,e._locale):new RegExp(Z(t))}function Z(t){return X(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,e,n,r,i){return e||n||r||i}))}function X(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Q(t,e){var n,r=e;for("string"==typeof t&&(t=[t]),"number"==typeof e&&(r=function(t,n){n[e]=m(t)}),n=0;nr;++r)o=u([2e3,r]),this._shortMonthsParse[r]=this.monthsShort(o,"").toLocaleLowerCase(),this._longMonthsParse[r]=this.months(o,"").toLocaleLowerCase();return n?"MMM"===e?(i=pr.call(this._shortMonthsParse,a),-1!==i?i:null):(i=pr.call(this._longMonthsParse,a),-1!==i?i:null):"MMM"===e?(i=pr.call(this._shortMonthsParse,a),-1!==i?i:(i=pr.call(this._longMonthsParse,a),-1!==i?i:null)):(i=pr.call(this._longMonthsParse,a),-1!==i?i:(i=pr.call(this._shortMonthsParse,a),-1!==i?i:null))}function at(t,e,n){var r,i,o;if(this._monthsParseExact)return ot.call(this,t,e,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),r=0;12>r;r++){if(i=u([2e3,r]),n&&!this._longMonthsParse[r]&&(this._longMonthsParse[r]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[r]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),n||this._monthsParse[r]||(o="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[r]=new RegExp(o.replace(".",""),"i")),n&&"MMMM"===e&&this._longMonthsParse[r].test(t))return r;if(n&&"MMM"===e&&this._shortMonthsParse[r].test(t))return r;if(!n&&this._monthsParse[r].test(t))return r}}function st(t,e){var n;if(!t.isValid())return t;if("string"==typeof e)if(/^\d+$/.test(e))e=m(e);else if(e=t.localeData().monthsParse(e),"number"!=typeof e)return t;return n=Math.min(t.date(),nt(t.year(),e)),t._d["set"+(t._isUTC?"UTC":"")+"Month"](e,n),t}function ut(t){return null!=t?(st(this,t),e.updateOffset(this,!0),this):z(this,"Month")}function ct(){return nt(this.year(),this.month())}function lt(t){return this._monthsParseExact?(a(this,"_monthsRegex")||dt.call(this),t?this._monthsShortStrictRegex:this._monthsShortRegex):this._monthsShortStrictRegex&&t?this._monthsShortStrictRegex:this._monthsShortRegex}function ft(t){return this._monthsParseExact?(a(this,"_monthsRegex")||dt.call(this),t?this._monthsStrictRegex:this._monthsRegex):this._monthsStrictRegex&&t?this._monthsStrictRegex:this._monthsRegex}function dt(){function t(t,e){return e.length-t.length}var e,n,r=[],i=[],o=[];for(e=0;12>e;e++)n=u([2e3,e]),r.push(this.monthsShort(n,"")),i.push(this.months(n,"")),o.push(this.months(n,"")),o.push(this.monthsShort(n,""));for(r.sort(t),i.sort(t),o.sort(t),e=0;12>e;e++)r[e]=X(r[e]),i[e]=X(i[e]),o[e]=X(o[e]);this._monthsRegex=new RegExp("^("+o.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+i.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+r.join("|")+")","i")}function ht(t){var e,n=t._a;return n&&-2===l(t).overflow&&(e=n[Ur]<0||n[Ur]>11?Ur:n[Vr]<1||n[Vr]>nt(n[zr],n[Ur])?Vr:n[Br]<0||n[Br]>24||24===n[Br]&&(0!==n[Fr]||0!==n[Gr]||0!==n[Wr])?Br:n[Fr]<0||n[Fr]>59?Fr:n[Gr]<0||n[Gr]>59?Gr:n[Wr]<0||n[Wr]>999?Wr:-1,l(t)._overflowDayOfYear&&(zr>e||e>Vr)&&(e=Vr),l(t)._overflowWeeks&&-1===e&&(e=qr),l(t)._overflowWeekday&&-1===e&&(e=Kr),l(t).overflow=e),t}function pt(t){var e,n,r,i,o,a,s=t._i,u=ti.exec(s)||ei.exec(s);if(u){for(l(t).iso=!0,e=0,n=ri.length;n>e;e++)if(ri[e][1].exec(u[1])){i=ri[e][0],r=ri[e][2]!==!1;break}if(null==i)return void(t._isValid=!1);if(u[3]){for(e=0,n=ii.length;n>e;e++)if(ii[e][1].exec(u[3])){o=(u[2]||" ")+ii[e][0];break}if(null==o)return void(t._isValid=!1)}if(!r&&null!=o)return void(t._isValid=!1);if(u[4]){if(!ni.exec(u[4]))return void(t._isValid=!1);a="Z"}t._f=i+(o||"")+(a||""),jt(t)}else t._isValid=!1}function vt(t){var n=oi.exec(t._i);return null!==n?void(t._d=new Date(+n[1])):(pt(t),void(t._isValid===!1&&(delete t._isValid,e.createFromInputFallback(t))))}function _t(t,e,n,r,i,o,a){var s=new Date(t,e,n,r,i,o,a);return 100>t&&t>=0&&isFinite(s.getFullYear())&&s.setFullYear(t),s}function yt(t){var e=new Date(Date.UTC.apply(null,arguments));return 100>t&&t>=0&&isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t),e}function mt(t){return gt(t)?366:365}function gt(t){return t%4===0&&t%100!==0||t%400===0}function bt(){return gt(this.year())}function St(t,e,n){var r=7+e-n,i=(7+yt(t,0,r).getUTCDay()-e)%7;return-i+r-1}function wt(t,e,n,r,i){var o,a,s=(7+n-r)%7,u=St(t,r,i),c=1+7*(e-1)+s+u;return 0>=c?(o=t-1,a=mt(o)+c):c>mt(t)?(o=t+1,a=c-mt(t)):(o=t,a=c),{year:o,dayOfYear:a}}function Ot(t,e,n){var r,i,o=St(t.year(),e,n),a=Math.floor((t.dayOfYear()-o-1)/7)+1;return 1>a?(i=t.year()-1,r=a+It(i,e,n)):a>It(t.year(),e,n)?(r=a-It(t.year(),e,n),i=t.year()+1):(i=t.year(),r=a),{week:r,year:i}}function It(t,e,n){var r=St(t,e,n),i=St(t+1,e,n);return(mt(t)-r+i)/7}function Tt(t,e,n){return null!=t?t:null!=e?e:n}function Et(t){var n=new Date(e.now());return t._useUTC?[n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate()]:[n.getFullYear(),n.getMonth(),n.getDate()]}function Dt(t){var e,n,r,i,o=[];if(!t._d){for(r=Et(t),t._w&&null==t._a[Vr]&&null==t._a[Ur]&&Ct(t),t._dayOfYear&&(i=Tt(t._a[zr],r[zr]),t._dayOfYear>mt(i)&&(l(t)._overflowDayOfYear=!0),n=yt(i,0,t._dayOfYear),t._a[Ur]=n.getUTCMonth(),t._a[Vr]=n.getUTCDate()),e=0;3>e&&null==t._a[e];++e)t._a[e]=o[e]=r[e];for(;7>e;e++)t._a[e]=o[e]=null==t._a[e]?2===e?1:0:t._a[e];24===t._a[Br]&&0===t._a[Fr]&&0===t._a[Gr]&&0===t._a[Wr]&&(t._nextDay=!0,t._a[Br]=0),t._d=(t._useUTC?yt:_t).apply(null,o),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[Br]=24)}}function Ct(t){var e,n,r,i,o,a,s,u;e=t._w,null!=e.GG||null!=e.W||null!=e.E?(o=1,a=4,n=Tt(e.GG,t._a[zr],Ot(Rt(),1,4).year),r=Tt(e.W,1),i=Tt(e.E,1),(1>i||i>7)&&(u=!0)):(o=t._locale._week.dow,a=t._locale._week.doy,n=Tt(e.gg,t._a[zr],Ot(Rt(),o,a).year),r=Tt(e.w,1),null!=e.d?(i=e.d,(0>i||i>6)&&(u=!0)):null!=e.e?(i=e.e+o,(e.e<0||e.e>6)&&(u=!0)):i=o),1>r||r>It(n,o,a)?l(t)._overflowWeeks=!0:null!=u?l(t)._overflowWeekday=!0:(s=wt(n,r,i,o,a),t._a[zr]=s.year,t._dayOfYear=s.dayOfYear)}function jt(t){if(t._f===e.ISO_8601)return void pt(t);t._a=[],l(t).empty=!0;var n,r,i,o,a,s=""+t._i,u=s.length,c=0;for(i=K(t._f,t._locale).match(yr)||[],n=0;n0&&l(t).unusedInput.push(a),s=s.slice(s.indexOf(r)+r.length),c+=r.length),br[o]?(r?l(t).empty=!1:l(t).unusedTokens.push(o),et(o,r,t)):t._strict&&!r&&l(t).unusedTokens.push(o);l(t).charsLeftOver=u-c,s.length>0&&l(t).unusedInput.push(s),l(t).bigHour===!0&&t._a[Br]<=12&&t._a[Br]>0&&(l(t).bigHour=void 0),l(t).parsedDateParts=t._a.slice(0),l(t).meridiem=t._meridiem,t._a[Br]=Mt(t._locale,t._a[Br],t._meridiem),Dt(t),ht(t)}function Mt(t,e,n){var r;return null==n?e:null!=t.meridiemHour?t.meridiemHour(e,n):null!=t.isPM?(r=t.isPM(n),r&&12>e&&(e+=12),r||12!==e||(e=0),e):e}function kt(t){var e,n,r,i,o;if(0===t._f.length)return l(t).invalidFormat=!0,void(t._d=new Date(NaN));for(i=0;io)&&(r=o,n=e));s(t,n||e)}function Pt(t){if(!t._d){var e=H(t._i);t._a=o([e.year,e.month,e.day||e.date,e.hour,e.minute,e.second,e.millisecond],function(t){return t&&parseInt(t,10)}),Dt(t)}}function At(t){var e=new v(ht(xt(t)));return e._nextDay&&(e.add(1,"d"),e._nextDay=void 0),e}function xt(t){var e=t._i,n=t._f;return t._locale=t._locale||x(t._l),null===e||void 0===n&&""===e?d({nullInput:!0}):("string"==typeof e&&(t._i=e=t._locale.preparse(e)),_(e)?new v(ht(e)):(r(n)?kt(t):n?jt(t):i(e)?t._d=e:Lt(t),f(t)||(t._d=null),t))}function Lt(t){var n=t._i;void 0===n?t._d=new Date(e.now()):i(n)?t._d=new Date(n.valueOf()):"string"==typeof n?vt(t):r(n)?(t._a=o(n.slice(0),function(t){return parseInt(t,10)}),Dt(t)):"object"==typeof n?Pt(t):"number"==typeof n?t._d=new Date(n):e.createFromInputFallback(t)}function Nt(t,e,n,r,i){var o={};return"boolean"==typeof n&&(r=n,n=void 0),o._isAMomentObject=!0,o._useUTC=o._isUTC=i,o._l=n,o._i=t,o._f=e,o._strict=r,At(o)}function Rt(t,e,n,r){return Nt(t,e,n,r,!1)}function Ht(t,e){var n,i;if(1===e.length&&r(e[0])&&(e=e[0]),!e.length)return Rt();for(n=e[0],i=1;it&&(t=-t,n="-"),n+B(~~(t/60),2)+e+B(~~t%60,2)})}function Ft(t,e){var n=(e||"").match(t)||[],r=n[n.length-1]||[],i=(r+"").match(li)||["-",0,0],o=+(60*i[1])+m(i[2]);return"+"===i[0]?o:-o}function Gt(t,n){var r,o;return n._isUTC?(r=n.clone(),o=(_(t)||i(t)?t.valueOf():Rt(t).valueOf())-r.valueOf(),r._d.setTime(r._d.valueOf()+o),e.updateOffset(r,!1),r):Rt(t).local()}function Wt(t){return 15*-Math.round(t._d.getTimezoneOffset()/15)}function qt(t,n){var r,i=this._offset||0;return this.isValid()?null!=t?("string"==typeof t?t=Ft(Lr,t):Math.abs(t)<16&&(t=60*t),!this._isUTC&&n&&(r=Wt(this)),this._offset=t,this._isUTC=!0,null!=r&&this.add(r,"m"),i!==t&&(!n||this._changeInProgress?le(this,ie(t-i,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,e.updateOffset(this,!0),this._changeInProgress=null)),this):this._isUTC?i:Wt(this):null!=t?this:NaN}function Kt(t,e){return null!=t?("string"!=typeof t&&(t=-t),this.utcOffset(t,e),this):-this.utcOffset()}function Jt(t){return this.utcOffset(0,t)}function $t(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t&&this.subtract(Wt(this),"m")),this}function Zt(){return this._tzm?this.utcOffset(this._tzm):"string"==typeof this._i&&this.utcOffset(Ft(xr,this._i)),this}function Xt(t){return this.isValid()?(t=t?Rt(t).utcOffset():0,(this.utcOffset()-t)%60===0):!1}function Qt(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function te(){if(!h(this._isDSTShifted))return this._isDSTShifted;var t={};if(p(t,this),t=xt(t),t._a){var e=t._isUTC?u(t._a):Rt(t._a);this._isDSTShifted=this.isValid()&&g(t._a,e.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function ee(){return this.isValid()?!this._isUTC:!1}function ne(){return this.isValid()?this._isUTC:!1}function re(){return this.isValid()?this._isUTC&&0===this._offset:!1}function ie(t,e){var n,r,i,o=t,s=null;return Vt(t)?o={ms:t._milliseconds,d:t._days,M:t._months}:"number"==typeof t?(o={},e?o[e]=t:o.milliseconds=t):(s=fi.exec(t))?(n="-"===s[1]?-1:1,o={y:0,d:m(s[Vr])*n,h:m(s[Br])*n,m:m(s[Fr])*n,s:m(s[Gr])*n,ms:m(s[Wr])*n}):(s=di.exec(t))?(n="-"===s[1]?-1:1,o={y:oe(s[2],n),M:oe(s[3],n),w:oe(s[4],n),d:oe(s[5],n),h:oe(s[6],n),m:oe(s[7],n),s:oe(s[8],n)}):null==o?o={}:"object"==typeof o&&("from"in o||"to"in o)&&(i=se(Rt(o.from),Rt(o.to)),o={},o.ms=i.milliseconds,o.M=i.months),r=new Ut(o),Vt(t)&&a(t,"_locale")&&(r._locale=t._locale),r}function oe(t,e){var n=t&&parseFloat(t.replace(",","."));return(isNaN(n)?0:n)*e}function ae(t,e){var n={milliseconds:0,months:0};return n.months=e.month()-t.month()+12*(e.year()-t.year()),t.clone().add(n.months,"M").isAfter(e)&&--n.months,n.milliseconds=+e-+t.clone().add(n.months,"M"),n}function se(t,e){var n;return t.isValid()&&e.isValid()?(e=Gt(e,t),t.isBefore(e)?n=ae(t,e):(n=ae(e,t),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function ue(t){return 0>t?-1*Math.round(-1*t):Math.round(t)}function ce(t,e){return function(n,r){var i,o;return null===r||isNaN(+r)||(w(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period)."),o=n,n=r,r=o),n="string"==typeof n?+n:n,i=ie(n,r),le(this,i,t),this}}function le(t,n,r,i){var o=n._milliseconds,a=ue(n._days),s=ue(n._months);t.isValid()&&(i=null==i?!0:i,o&&t._d.setTime(t._d.valueOf()+o*r),a&&U(t,"Date",z(t,"Date")+a*r),s&&st(t,z(t,"Month")+s*r),i&&e.updateOffset(t,a||s))}function fe(t,e){var n=t||Rt(),r=Gt(n,this).startOf("day"),i=this.diff(r,"days",!0),o=-6>i?"sameElse":-1>i?"lastWeek":0>i?"lastDay":1>i?"sameDay":2>i?"nextDay":7>i?"nextWeek":"sameElse",a=e&&(O(e[o])?e[o]():e[o]);return this.format(a||this.localeData().calendar(o,this,Rt(n)))}function de(){return new v(this)}function he(t,e){var n=_(t)?t:Rt(t);return this.isValid()&&n.isValid()?(e=R(h(e)?"millisecond":e),"millisecond"===e?this.valueOf()>n.valueOf():n.valueOf()e-o?(n=t.clone().add(i-1,"months"),r=(e-o)/(o-n)):(n=t.clone().add(i+1,"months"),r=(e-o)/(n-o)),-(i+r)||0}function Se(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function we(){var t=this.clone().utc();return 0o&&(e=o),Ke.call(this,t,e,n,r,i))}function Ke(t,e,n,r,i){var o=wt(t,e,n,r,i),a=yt(o.year,0,o.dayOfYear);return this.year(a.getUTCFullYear()),this.month(a.getUTCMonth()),this.date(a.getUTCDate()),this}function Je(t){return null==t?Math.ceil((this.month()+1)/3):this.month(3*(t-1)+this.month()%3)}function $e(t){return Ot(t,this._week.dow,this._week.doy).week}function Ze(){return this._week.dow}function Xe(){return this._week.doy}function Qe(t){var e=this.localeData().week(this);return null==t?e:this.add(7*(t-e),"d")}function tn(t){var e=Ot(this,1,4).week;return null==t?e:this.add(7*(t-e),"d")}function en(t,e){return"string"!=typeof t?t:isNaN(t)?(t=e.weekdaysParse(t),"number"==typeof t?t:null):parseInt(t,10)}function nn(t,e){return r(this._weekdays)?this._weekdays[t.day()]:this._weekdays[this._weekdays.isFormat.test(e)?"format":"standalone"][t.day()]}function rn(t){return this._weekdaysShort[t.day()]}function on(t){return this._weekdaysMin[t.day()]}function an(t,e,n){var r,i,o,a=t.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],r=0;7>r;++r)o=u([2e3,1]).day(r),this._minWeekdaysParse[r]=this.weekdaysMin(o,"").toLocaleLowerCase(),this._shortWeekdaysParse[r]=this.weekdaysShort(o,"").toLocaleLowerCase(),this._weekdaysParse[r]=this.weekdays(o,"").toLocaleLowerCase();return n?"dddd"===e?(i=pr.call(this._weekdaysParse,a),-1!==i?i:null):"ddd"===e?(i=pr.call(this._shortWeekdaysParse,a),-1!==i?i:null):(i=pr.call(this._minWeekdaysParse,a), +-1!==i?i:null):"dddd"===e?(i=pr.call(this._weekdaysParse,a),-1!==i?i:(i=pr.call(this._shortWeekdaysParse,a),-1!==i?i:(i=pr.call(this._minWeekdaysParse,a),-1!==i?i:null))):"ddd"===e?(i=pr.call(this._shortWeekdaysParse,a),-1!==i?i:(i=pr.call(this._weekdaysParse,a),-1!==i?i:(i=pr.call(this._minWeekdaysParse,a),-1!==i?i:null))):(i=pr.call(this._minWeekdaysParse,a),-1!==i?i:(i=pr.call(this._weekdaysParse,a),-1!==i?i:(i=pr.call(this._shortWeekdaysParse,a),-1!==i?i:null)))}function sn(t,e,n){var r,i,o;if(this._weekdaysParseExact)return an.call(this,t,e,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;7>r;r++){if(i=u([2e3,1]).day(r),n&&!this._fullWeekdaysParse[r]&&(this._fullWeekdaysParse[r]=new RegExp("^"+this.weekdays(i,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[r]=new RegExp("^"+this.weekdaysShort(i,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[r]=new RegExp("^"+this.weekdaysMin(i,"").replace(".",".?")+"$","i")),this._weekdaysParse[r]||(o="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[r]=new RegExp(o.replace(".",""),"i")),n&&"dddd"===e&&this._fullWeekdaysParse[r].test(t))return r;if(n&&"ddd"===e&&this._shortWeekdaysParse[r].test(t))return r;if(n&&"dd"===e&&this._minWeekdaysParse[r].test(t))return r;if(!n&&this._weekdaysParse[r].test(t))return r}}function un(t){if(!this.isValid())return null!=t?this:NaN;var e=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=t?(t=en(t,this.localeData()),this.add(t-e,"d")):e}function cn(t){if(!this.isValid())return null!=t?this:NaN;var e=(this.day()+7-this.localeData()._week.dow)%7;return null==t?e:this.add(t-e,"d")}function ln(t){return this.isValid()?null==t?this.day()||7:this.day(this.day()%7?t:t-7):null!=t?this:NaN}function fn(t){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||pn.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex}function dn(t){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||pn.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex}function hn(t){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||pn.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex}function pn(){function t(t,e){return e.length-t.length}var e,n,r,i,o,a=[],s=[],c=[],l=[];for(e=0;7>e;e++)n=u([2e3,1]).day(e),r=this.weekdaysMin(n,""),i=this.weekdaysShort(n,""),o=this.weekdays(n,""),a.push(r),s.push(i),c.push(o),l.push(r),l.push(i),l.push(o);for(a.sort(t),s.sort(t),c.sort(t),l.sort(t),e=0;7>e;e++)s[e]=X(s[e]),c[e]=X(c[e]),l[e]=X(l[e]);this._weekdaysRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+c.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+a.join("|")+")","i")}function vn(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==t?e:this.add(t-e,"d")}function _n(){return this.hours()%12||12}function yn(){return this.hours()||24}function mn(t,e){F(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}function gn(t,e){return e._meridiemParse}function bn(t){return"p"===(t+"").toLowerCase().charAt(0)}function Sn(t,e,n){return t>11?n?"pm":"PM":n?"am":"AM"}function wn(t,e){e[Wr]=m(1e3*("0."+t))}function On(){return this._isUTC?"UTC":""}function In(){return this._isUTC?"Coordinated Universal Time":""}function Tn(t){return Rt(1e3*t)}function En(){return Rt.apply(null,arguments).parseZone()}function Dn(t,e,n){var r=this._calendar[t];return O(r)?r.call(e,n):r}function Cn(t){var e=this._longDateFormat[t],n=this._longDateFormat[t.toUpperCase()];return e||!n?e:(this._longDateFormat[t]=n.replace(/MMMM|MM|DD|dddd/g,function(t){return t.slice(1)}),this._longDateFormat[t])}function jn(){return this._invalidDate}function Mn(t){return this._ordinal.replace("%d",t)}function kn(t){return t}function Pn(t,e,n,r){var i=this._relativeTime[n];return O(i)?i(t,e,n,r):i.replace(/%d/i,t)}function An(t,e){var n=this._relativeTime[t>0?"future":"past"];return O(n)?n(e):n.replace(/%s/i,e)}function xn(t,e,n,r){var i=x(),o=u().set(r,e);return i[n](o,t)}function Ln(t,e,n){if("number"==typeof t&&(e=t,t=void 0),t=t||"",null!=e)return xn(t,e,n,"month");var r,i=[];for(r=0;12>r;r++)i[r]=xn(t,r,n,"month");return i}function Nn(t,e,n,r){"boolean"==typeof t?("number"==typeof e&&(n=e,e=void 0),e=e||""):(e=t,n=e,t=!1,"number"==typeof e&&(n=e,e=void 0),e=e||"");var i=x(),o=t?i._week.dow:0;if(null!=n)return xn(e,(n+o)%7,r,"day");var a,s=[];for(a=0;7>a;a++)s[a]=xn(e,(a+o)%7,r,"day");return s}function Rn(t,e){return Ln(t,e,"months")}function Hn(t,e){return Ln(t,e,"monthsShort")}function Yn(t,e,n){return Nn(t,e,n,"weekdays")}function zn(t,e,n){return Nn(t,e,n,"weekdaysShort")}function Un(t,e,n){return Nn(t,e,n,"weekdaysMin")}function Vn(){var t=this._data;return this._milliseconds=Yi(this._milliseconds),this._days=Yi(this._days),this._months=Yi(this._months),t.milliseconds=Yi(t.milliseconds),t.seconds=Yi(t.seconds),t.minutes=Yi(t.minutes),t.hours=Yi(t.hours),t.months=Yi(t.months),t.years=Yi(t.years),this}function Bn(t,e,n,r){var i=ie(e,n);return t._milliseconds+=r*i._milliseconds,t._days+=r*i._days,t._months+=r*i._months,t._bubble()}function Fn(t,e){return Bn(this,t,e,1)}function Gn(t,e){return Bn(this,t,e,-1)}function Wn(t){return 0>t?Math.floor(t):Math.ceil(t)}function qn(){var t,e,n,r,i,o=this._milliseconds,a=this._days,s=this._months,u=this._data;return o>=0&&a>=0&&s>=0||0>=o&&0>=a&&0>=s||(o+=864e5*Wn(Jn(s)+a),a=0,s=0),u.milliseconds=o%1e3,t=y(o/1e3),u.seconds=t%60,e=y(t/60),u.minutes=e%60,n=y(e/60),u.hours=n%24,a+=y(n/24),i=y(Kn(a)),s+=i,a-=Wn(Jn(i)),r=y(s/12),s%=12,u.days=a,u.months=s,u.years=r,this}function Kn(t){return 4800*t/146097}function Jn(t){return 146097*t/4800}function $n(t){var e,n,r=this._milliseconds;if(t=R(t),"month"===t||"year"===t)return e=this._days+r/864e5,n=this._months+Kn(e),"month"===t?n:n/12;switch(e=this._days+Math.round(Jn(this._months)),t){case"week":return e/7+r/6048e5;case"day":return e+r/864e5;case"hour":return 24*e+r/36e5;case"minute":return 1440*e+r/6e4;case"second":return 86400*e+r/1e3;case"millisecond":return Math.floor(864e5*e)+r;default:throw new Error("Unknown unit "+t)}}function Zn(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*m(this._months/12)}function Xn(t){return function(){return this.as(t)}}function Qn(t){return t=R(t),this[t+"s"]()}function tr(t){return function(){return this._data[t]}}function er(){return y(this.days()/7)}function nr(t,e,n,r,i){return i.relativeTime(e||1,!!n,t,r)}function rr(t,e,n){var r=ie(t).abs(),i=eo(r.as("s")),o=eo(r.as("m")),a=eo(r.as("h")),s=eo(r.as("d")),u=eo(r.as("M")),c=eo(r.as("y")),l=i=o&&["m"]||o=a&&["h"]||a=s&&["d"]||s=u&&["M"]||u=c&&["y"]||["yy",c];return l[2]=e,l[3]=+t>0,l[4]=n,nr.apply(null,l)}function ir(t,e){return void 0===no[t]?!1:void 0===e?no[t]:(no[t]=e,!0)}function or(t){var e=this.localeData(),n=rr(this,!t,e);return t&&(n=e.pastFuture(+this,n)),e.postformat(n)}function ar(){var t,e,n,r=ro(this._milliseconds)/1e3,i=ro(this._days),o=ro(this._months);t=y(r/60),e=y(t/60),r%=60,t%=60,n=y(o/12),o%=12;var a=n,s=o,u=i,c=e,l=t,f=r,d=this.asSeconds();return d?(0>d?"-":"")+"P"+(a?a+"Y":"")+(s?s+"M":"")+(u?u+"D":"")+(c||l||f?"T":"")+(c?c+"H":"")+(l?l+"M":"")+(f?f+"S":""):"P0D"}var sr,ur;ur=Array.prototype.some?Array.prototype.some:function(t){for(var e=Object(this),n=e.length>>>0,r=0;n>r;r++)if(r in e&&t.call(this,e[r],r,e))return!0;return!1};var cr=e.momentProperties=[],lr=!1,fr={};e.suppressDeprecationWarnings=!1,e.deprecationHandler=null;var dr;dr=Object.keys?Object.keys:function(t){var e,n=[];for(e in t)a(t,e)&&n.push(e);return n};var hr,pr,vr={},_r={},yr=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,mr=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,gr={},br={},Sr=/\d/,wr=/\d\d/,Or=/\d{3}/,Ir=/\d{4}/,Tr=/[+-]?\d{6}/,Er=/\d\d?/,Dr=/\d\d\d\d?/,Cr=/\d\d\d\d\d\d?/,jr=/\d{1,3}/,Mr=/\d{1,4}/,kr=/[+-]?\d{1,6}/,Pr=/\d+/,Ar=/[+-]?\d+/,xr=/Z|[+-]\d\d:?\d\d/gi,Lr=/Z|[+-]\d\d(?::?\d\d)?/gi,Nr=/[+-]?\d+(\.\d{1,3})?/,Rr=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,Hr={},Yr={},zr=0,Ur=1,Vr=2,Br=3,Fr=4,Gr=5,Wr=6,qr=7,Kr=8;pr=Array.prototype.indexOf?Array.prototype.indexOf:function(t){var e;for(e=0;e=t?""+t:"+"+t}),F(0,["YY",2],0,function(){return this.year()%100}),F(0,["YYYY",4],0,"year"),F(0,["YYYYY",5],0,"year"),F(0,["YYYYYY",6,!0],0,"year"),N("year","y"),J("Y",Ar),J("YY",Er,wr),J("YYYY",Mr,Ir),J("YYYYY",kr,Tr),J("YYYYYY",kr,Tr),Q(["YYYYY","YYYYYY"],zr),Q("YYYY",function(t,n){n[zr]=2===t.length?e.parseTwoDigitYear(t):m(t)}),Q("YY",function(t,n){n[zr]=e.parseTwoDigitYear(t)}),Q("Y",function(t,e){e[zr]=parseInt(t,10)}),e.parseTwoDigitYear=function(t){return m(t)+(m(t)>68?1900:2e3)};var ai=Y("FullYear",!0);e.ISO_8601=function(){};var si=S("moment().min is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(){var t=Rt.apply(null,arguments);return this.isValid()&&t.isValid()?this>t?this:t:d()}),ui=S("moment().max is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(){var t=Rt.apply(null,arguments);return this.isValid()&&t.isValid()?t>this?this:t:d()}),ci=function(){return Date.now?Date.now():+new Date};Bt("Z",":"),Bt("ZZ",""),J("Z",Lr),J("ZZ",Lr),Q(["Z","ZZ"],function(t,e,n){n._useUTC=!0,n._tzm=Ft(Lr,t)});var li=/([\+\-]|\d\d)/gi;e.updateOffset=function(){};var fi=/^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?\d*)?$/,di=/^(-)?P(?:(-?[0-9,.]*)Y)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)W)?(?:(-?[0-9,.]*)D)?(?:T(?:(-?[0-9,.]*)H)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)S)?)?$/;ie.fn=Ut.prototype;var hi=ce(1,"add"),pi=ce(-1,"subtract");e.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",e.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var vi=S("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(t){return void 0===t?this.localeData():this.locale(t)});F(0,["gg",2],0,function(){return this.weekYear()%100}),F(0,["GG",2],0,function(){return this.isoWeekYear()%100}),Ve("gggg","weekYear"),Ve("ggggg","weekYear"),Ve("GGGG","isoWeekYear"),Ve("GGGGG","isoWeekYear"),N("weekYear","gg"),N("isoWeekYear","GG"),J("G",Ar),J("g",Ar),J("GG",Er,wr),J("gg",Er,wr),J("GGGG",Mr,Ir),J("gggg",Mr,Ir),J("GGGGG",kr,Tr),J("ggggg",kr,Tr),tt(["gggg","ggggg","GGGG","GGGGG"],function(t,e,n,r){e[r.substr(0,2)]=m(t)}),tt(["gg","GG"],function(t,n,r,i){n[i]=e.parseTwoDigitYear(t)}),F("Q",0,"Qo","quarter"),N("quarter","Q"),J("Q",Sr),Q("Q",function(t,e){e[Ur]=3*(m(t)-1)}),F("w",["ww",2],"wo","week"),F("W",["WW",2],"Wo","isoWeek"),N("week","w"),N("isoWeek","W"),J("w",Er),J("ww",Er,wr),J("W",Er),J("WW",Er,wr),tt(["w","ww","W","WW"],function(t,e,n,r){e[r.substr(0,1)]=m(t)});var _i={dow:0,doy:6};F("D",["DD",2],"Do","date"),N("date","D"),J("D",Er),J("DD",Er,wr),J("Do",function(t,e){return t?e._ordinalParse:e._ordinalParseLenient}),Q(["D","DD"],Vr),Q("Do",function(t,e){e[Vr]=m(t.match(Er)[0],10)});var yi=Y("Date",!0);F("d",0,"do","day"),F("dd",0,0,function(t){return this.localeData().weekdaysMin(this,t)}),F("ddd",0,0,function(t){return this.localeData().weekdaysShort(this,t)}),F("dddd",0,0,function(t){return this.localeData().weekdays(this,t)}),F("e",0,0,"weekday"),F("E",0,0,"isoWeekday"),N("day","d"),N("weekday","e"),N("isoWeekday","E"),J("d",Er),J("e",Er),J("E",Er),J("dd",function(t,e){return e.weekdaysMinRegex(t)}),J("ddd",function(t,e){return e.weekdaysShortRegex(t)}),J("dddd",function(t,e){return e.weekdaysRegex(t)}),tt(["dd","ddd","dddd"],function(t,e,n,r){var i=n._locale.weekdaysParse(t,r,n._strict);null!=i?e.d=i:l(n).invalidWeekday=t}),tt(["d","e","E"],function(t,e,n,r){e[r]=m(t)});var mi="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),gi="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),bi="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Si=Rr,wi=Rr,Oi=Rr;F("DDD",["DDDD",3],"DDDo","dayOfYear"),N("dayOfYear","DDD"),J("DDD",jr),J("DDDD",Or),Q(["DDD","DDDD"],function(t,e,n){n._dayOfYear=m(t)}),F("H",["HH",2],0,"hour"),F("h",["hh",2],0,_n),F("k",["kk",2],0,yn),F("hmm",0,0,function(){return""+_n.apply(this)+B(this.minutes(),2)}),F("hmmss",0,0,function(){return""+_n.apply(this)+B(this.minutes(),2)+B(this.seconds(),2)}),F("Hmm",0,0,function(){return""+this.hours()+B(this.minutes(),2)}),F("Hmmss",0,0,function(){return""+this.hours()+B(this.minutes(),2)+B(this.seconds(),2)}),mn("a",!0),mn("A",!1),N("hour","h"),J("a",gn),J("A",gn),J("H",Er),J("h",Er),J("HH",Er,wr),J("hh",Er,wr),J("hmm",Dr),J("hmmss",Cr),J("Hmm",Dr),J("Hmmss",Cr),Q(["H","HH"],Br),Q(["a","A"],function(t,e,n){n._isPm=n._locale.isPM(t),n._meridiem=t}),Q(["h","hh"],function(t,e,n){e[Br]=m(t),l(n).bigHour=!0}),Q("hmm",function(t,e,n){var r=t.length-2;e[Br]=m(t.substr(0,r)),e[Fr]=m(t.substr(r)),l(n).bigHour=!0}),Q("hmmss",function(t,e,n){var r=t.length-4,i=t.length-2;e[Br]=m(t.substr(0,r)),e[Fr]=m(t.substr(r,2)),e[Gr]=m(t.substr(i)),l(n).bigHour=!0}),Q("Hmm",function(t,e,n){var r=t.length-2;e[Br]=m(t.substr(0,r)),e[Fr]=m(t.substr(r))}),Q("Hmmss",function(t,e,n){var r=t.length-4,i=t.length-2;e[Br]=m(t.substr(0,r)),e[Fr]=m(t.substr(r,2)),e[Gr]=m(t.substr(i))});var Ii=/[ap]\.?m?\.?/i,Ti=Y("Hours",!0);F("m",["mm",2],0,"minute"),N("minute","m"),J("m",Er),J("mm",Er,wr),Q(["m","mm"],Fr);var Ei=Y("Minutes",!1);F("s",["ss",2],0,"second"),N("second","s"),J("s",Er),J("ss",Er,wr),Q(["s","ss"],Gr);var Di=Y("Seconds",!1);F("S",0,0,function(){return~~(this.millisecond()/100)}),F(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),F(0,["SSS",3],0,"millisecond"),F(0,["SSSS",4],0,function(){return 10*this.millisecond()}),F(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),F(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),F(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),F(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),F(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),N("millisecond","ms"),J("S",jr,Sr),J("SS",jr,wr),J("SSS",jr,Or);var Ci;for(Ci="SSSS";Ci.length<=9;Ci+="S")J(Ci,Pr);for(Ci="S";Ci.length<=9;Ci+="S")Q(Ci,wn);var ji=Y("Milliseconds",!1);F("z",0,0,"zoneAbbr"),F("zz",0,0,"zoneName");var Mi=v.prototype;Mi.add=hi,Mi.calendar=fe,Mi.clone=de,Mi.diff=ge,Mi.endOf=ke,Mi.format=Oe,Mi.from=Ie,Mi.fromNow=Te,Mi.to=Ee,Mi.toNow=De,Mi.get=V,Mi.invalidAt=ze,Mi.isAfter=he,Mi.isBefore=pe,Mi.isBetween=ve,Mi.isSame=_e,Mi.isSameOrAfter=ye,Mi.isSameOrBefore=me,Mi.isValid=He,Mi.lang=vi,Mi.locale=Ce,Mi.localeData=je,Mi.max=ui,Mi.min=si,Mi.parsingFlags=Ye,Mi.set=V,Mi.startOf=Me,Mi.subtract=pi,Mi.toArray=Le,Mi.toObject=Ne,Mi.toDate=xe,Mi.toISOString=we,Mi.toJSON=Re,Mi.toString=Se,Mi.unix=Ae,Mi.valueOf=Pe,Mi.creationData=Ue,Mi.year=ai,Mi.isLeapYear=bt,Mi.weekYear=Be,Mi.isoWeekYear=Fe,Mi.quarter=Mi.quarters=Je,Mi.month=ut,Mi.daysInMonth=ct,Mi.week=Mi.weeks=Qe,Mi.isoWeek=Mi.isoWeeks=tn,Mi.weeksInYear=We,Mi.isoWeeksInYear=Ge,Mi.date=yi,Mi.day=Mi.days=un,Mi.weekday=cn,Mi.isoWeekday=ln,Mi.dayOfYear=vn,Mi.hour=Mi.hours=Ti,Mi.minute=Mi.minutes=Ei,Mi.second=Mi.seconds=Di,Mi.millisecond=Mi.milliseconds=ji,Mi.utcOffset=qt,Mi.utc=Jt,Mi.local=$t,Mi.parseZone=Zt,Mi.hasAlignedHourOffset=Xt,Mi.isDST=Qt,Mi.isDSTShifted=te,Mi.isLocal=ee,Mi.isUtcOffset=ne,Mi.isUtc=re,Mi.isUTC=re,Mi.zoneAbbr=On,Mi.zoneName=In,Mi.dates=S("dates accessor is deprecated. Use date instead.",yi),Mi.months=S("months accessor is deprecated. Use month instead",ut),Mi.years=S("years accessor is deprecated. Use year instead",ai),Mi.zone=S("moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779",Kt);var ki=Mi,Pi={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},Ai={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},xi="Invalid date",Li="%d",Ni=/\d{1,2}/,Ri={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},Hi=D.prototype;Hi._calendar=Pi,Hi.calendar=Dn,Hi._longDateFormat=Ai,Hi.longDateFormat=Cn,Hi._invalidDate=xi,Hi.invalidDate=jn,Hi._ordinal=Li,Hi.ordinal=Mn,Hi._ordinalParse=Ni,Hi.preparse=kn,Hi.postformat=kn,Hi._relativeTime=Ri,Hi.relativeTime=Pn,Hi.pastFuture=An,Hi.set=T,Hi.months=rt,Hi._months=$r,Hi.monthsShort=it,Hi._monthsShort=Zr,Hi.monthsParse=at,Hi._monthsRegex=Qr,Hi.monthsRegex=ft,Hi._monthsShortRegex=Xr,Hi.monthsShortRegex=lt,Hi.week=$e,Hi._week=_i,Hi.firstDayOfYear=Xe,Hi.firstDayOfWeek=Ze,Hi.weekdays=nn,Hi._weekdays=mi,Hi.weekdaysMin=on,Hi._weekdaysMin=bi,Hi.weekdaysShort=rn,Hi._weekdaysShort=gi,Hi.weekdaysParse=sn,Hi._weekdaysRegex=Si,Hi.weekdaysRegex=fn,Hi._weekdaysShortRegex=wi,Hi.weekdaysShortRegex=dn,Hi._weekdaysMinRegex=Oi,Hi.weekdaysMinRegex=hn,Hi.isPM=bn,Hi._meridiemParse=Ii,Hi.meridiem=Sn,k("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10,n=1===m(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th";return t+n}}),e.lang=S("moment.lang is deprecated. Use moment.locale instead.",k),e.langData=S("moment.langData is deprecated. Use moment.localeData instead.",x);var Yi=Math.abs,zi=Xn("ms"),Ui=Xn("s"),Vi=Xn("m"),Bi=Xn("h"),Fi=Xn("d"),Gi=Xn("w"),Wi=Xn("M"),qi=Xn("y"),Ki=tr("milliseconds"),Ji=tr("seconds"),$i=tr("minutes"),Zi=tr("hours"),Xi=tr("days"),Qi=tr("months"),to=tr("years"),eo=Math.round,no={s:45,m:45,h:22,d:26,M:11},ro=Math.abs,io=Ut.prototype;io.abs=Vn,io.add=Fn,io.subtract=Gn,io.as=$n,io.asMilliseconds=zi,io.asSeconds=Ui,io.asMinutes=Vi,io.asHours=Bi,io.asDays=Fi,io.asWeeks=Gi,io.asMonths=Wi,io.asYears=qi,io.valueOf=Zn,io._bubble=qn,io.get=Qn,io.milliseconds=Ki,io.seconds=Ji,io.minutes=$i,io.hours=Zi,io.days=Xi,io.weeks=er,io.months=Qi,io.years=to,io.humanize=or,io.toISOString=ar,io.toString=ar,io.toJSON=ar,io.locale=Ce,io.localeData=je,io.toIsoString=S("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",ar),io.lang=vi,F("X",0,0,"unix"),F("x",0,0,"valueOf"),J("x",Ar),J("X",Nr),Q("X",function(t,e,n){n._d=new Date(1e3*parseFloat(t,10))}),Q("x",function(t,e,n){n._d=new Date(m(t))}),e.version="2.13.0",n(Rt),e.fn=ki,e.min=Yt,e.max=zt,e.now=ci,e.utc=u,e.unix=Tn,e.months=Rn,e.isDate=i,e.locale=k,e.invalid=d,e.duration=ie,e.isMoment=_,e.weekdays=Yn,e.parseZone=En,e.localeData=x,e.isDuration=Vt,e.monthsShort=Hn,e.weekdaysMin=Un,e.defineLocale=P,e.updateLocale=A,e.locales=L,e.weekdaysShort=zn,e.normalizeUnits=R,e.relativeTimeThreshold=ir,e.prototype=ki;var oo=e;return oo})}).call(e,n(70)(t))},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children=[],Object.defineProperty(t,"loaded",{enumerable:!0,configurable:!1,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,configurable:!1,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,n){"use strict";var r=n(0),i=n(1),o=n(3),a=n(62);n(161),n(170),n(177),n(176),n(178),n(171),n(172),n(174),n(175),n(173),n(179),n(168),n(167);var s=i.a.navigationActions,u=i.a.navigationGetters,c=i.a.startUrlSync,l=i.a.stopUrlSync;e["default"]=new r.a({is:"home-assistant-main",behaviors:[o.a],properties:{narrow:{type:Boolean,value:!1},activePane:{type:String,bindNuclear:u.activePane,observer:"activePaneChanged"},isSelectedStates:{type:Boolean,bindNuclear:u.isActivePane("states")},isSelectedHistory:{type:Boolean,bindNuclear:u.isActivePane("history")},isSelectedMap:{type:Boolean,bindNuclear:u.isActivePane("map")},isSelectedLogbook:{type:Boolean,bindNuclear:u.isActivePane("logbook")},isSelectedDevEvent:{type:Boolean,bindNuclear:u.isActivePane("devEvent")},isSelectedDevState:{type:Boolean,bindNuclear:u.isActivePane("devState")},isSelectedDevTemplate:{type:Boolean,bindNuclear:u.isActivePane("devTemplate")},isSelectedDevService:{type:Boolean,bindNuclear:u.isActivePane("devService")},isSelectedDevInfo:{type:Boolean,bindNuclear:u.isActivePane("devInfo")},showSidebar:{type:Boolean,bindNuclear:u.showSidebar}},listeners:{"open-menu":"openMenu","close-menu":"closeMenu"},openMenu:function(){this.narrow?this.$.drawer.openDrawer():s.showSidebar(!0)},closeMenu:function(){this.$.drawer.closeDrawer(),this.showSidebar&&s.showSidebar(!1)},activePaneChanged:function(){this.narrow&&this.$.drawer.closeDrawer()},attached:function(){a.a.bind()(),c()},computeForceNarrow:function(t,e){return t||!e},detached:function(){l()}})},function(t,e,n){"use strict";var r=n(0),i=n(1),o=n(3),a=n(36),s=n(62),u=i.a.authGetters;e["default"]=new r.a({is:"login-form",behaviors:[o.a],properties:{errorMessage:{type:String,bindNuclear:u.attemptErrorMessage},isInvalid:{type:Boolean,bindNuclear:u.isInvalidAttempt},isValidating:{type:Boolean,observer:"isValidatingChanged",bindNuclear:u.isValidating},loadingResources:{type:Boolean,value:!1},forceShowLoading:{type:Boolean,value:!1},showLoading:{type:Boolean,computed:"computeShowSpinner(forceShowLoading, isValidating)"}},listeners:{keydown:"passwordKeyDown","loginButton.tap":"validatePassword"},observers:["validatingChanged(isValidating, isInvalid)"],attached:function(){s.a.bind()()},computeShowSpinner:function(t,e){return t||e},validatingChanged:function(t,e){t||e||(this.$.passwordInput.value="")},isValidatingChanged:function(t){var e=this;t||this.async(function(){return e.$.passwordInput.focus()},10)},passwordKeyDown:function(t){13===t.keyCode?(this.validatePassword(),t.preventDefault()):this.isInvalid&&(this.isInvalid=!1)},validatePassword:function(){this.$.hideKeyboardOnFocus.focus(),a.a.bind()(this.$.passwordInput.value,this.$.rememberLogin.checked)}})},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var i=n(114),o=n(139),a=n(141),s=n(143),u=n(14),c=n(19),l=n(7),f=n(38),d=n(94),h=n(20),p=n(99),v=n(41),_=n(44),y=n(22),m=n(51),g=n(12),b=n(24),S=n(26),w=n(130),O=n(136),I=n(9),T=function E(){r(this,E);var t=o.a.bind()();Object.defineProperties(this,{demo:{value:!1,enumerable:!0},localStoragePreferences:{value:i.a,enumerable:!0},reactor:{value:t,enumerable:!0},util:{value:s.a,enumerable:!0},startLocalStoragePreferencesSync:{value:i.a.startSync.bind(i.a,t)},startUrlSync:{value:_.urlSync.startSync.bind(null,t)},stopUrlSync:{value:_.urlSync.stopSync.bind(null,t)}}),a.a.bind()(this,t,{auth:u,config:c,entity:l,entityHistory:f,errorLog:d,event:h,logbook:p,moreInfo:v,navigation:_,notification:y,view:m,service:g,stream:b,sync:S,template:w,voice:O,restApi:I})};e.a=T},function(t,e,n){"use strict";var r=n(210),i=r&&r.__esModule?function(){return r["default"]}:function(){return r};Object.defineProperty(i,"a",{get:i});var o=n(14),a=function(t,e,n){var i=arguments.length<=3||void 0===arguments[3]?null:arguments[3],a=t.evaluate(o.getters.authInfo),s=a.host+"/api/"+n;return new r.Promise(function(t,n){var r=new XMLHttpRequest;r.open(e,s,!0),r.setRequestHeader("X-HA-access",a.authToken),r.onload=function(){var e=void 0;try{e="application/json"===r.getResponseHeader("content-type")?JSON.parse(r.responseText):r.responseText}catch(i){e=r.responseText}r.status>199&&r.status<300?t(e):n(e)},r.onerror=function(){return n({})},i?r.send(JSON.stringify(i)):r.send()})};e.a=a},function(t,e,n){"use strict";function r(t,e){var n=arguments.length<=2||void 0===arguments[2]?{}:arguments[2],r=n.useStreaming,i=void 0===r?t.evaluate(s.getters.isSupported):r,a=n.rememberAuth,l=void 0===a?!1:a,f=n.host,d=void 0===f?"":f;t.dispatch(o.a.VALIDATING_AUTH_TOKEN,{authToken:e,host:d}),u.actions.fetchAll(t).then(function(){t.dispatch(o.a.VALID_AUTH_TOKEN,{authToken:e,host:d,rememberAuth:l}),i?s.actions.start(t,{syncOnInitialConnect:!1}):u.actions.start(t,{skipInitialSync:!0})},function(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],n=e.message,r=void 0===n?c:n;t.dispatch(o.a.INVALID_AUTH_TOKEN,{errorMessage:r})})}function i(t){a.a.bind()(t,"POST","log_out"),t.dispatch(o.a.LOG_OUT,{})}var o=n(13),a=n(4),s=n(24),u=n(26);e.validate=r,e.logOut=i;var c="Unexpected result from API"},function(t,e,n){"use strict";var r=["authAttempt","isValidating"];Object.defineProperty(e,"isValidating",{configurable:!1,enumerable:!0,get:function(){return r}});var i=["authAttempt","isInvalid"];Object.defineProperty(e,"isInvalidAttempt",{configurable:!1,enumerable:!0,get:function(){return i}});var o=["authAttempt","errorMessage"];Object.defineProperty(e,"attemptErrorMessage",{configurable:!1,enumerable:!0,get:function(){return o}});var a=["rememberAuth"];Object.defineProperty(e,"rememberAuth",{configurable:!1,enumerable:!0,get:function(){return a}});var s=[["authAttempt","authToken"],["authAttempt","host"],function(t,e){return{authToken:t,host:e}}];Object.defineProperty(e,"attemptAuthInfo",{configurable:!1,enumerable:!0,get:function(){return s}});var u=["authCurrent","authToken"];Object.defineProperty(e,"currentAuthToken",{configurable:!1,enumerable:!0,get:function(){return u}});var c=[u,["authCurrent","host"],function(t,e){return{authToken:t,host:e}}];Object.defineProperty(e,"currentAuthInfo",{configurable:!1,enumerable:!0,get:function(){return c}});var l=[r,["authAttempt","authToken"],["authCurrent","authToken"],function(t,e,n){return t?e:n}];Object.defineProperty(e,"authToken",{configurable:!1,enumerable:!0,get:function(){return l}});var f=[r,s,c,function(t,e,n){return t?e:n}];Object.defineProperty(e,"authInfo",{configurable:!1,enumerable:!0,get:function(){return f}})},function(t,e,n){"use strict";function r(t,e){var n=e.authToken,r=e.host;return a.toImmutable.bind()({authToken:n,host:r,isValidating:!0,isInvalid:!1,errorMessage:""})}function i(){return c.getInitialState()}function o(t,e){var n=e.errorMessage;return t.withMutations(function(t){return t.set("isValidating",!1).set("isInvalid",!0).set("errorMessage",n)})}var a=n(2),s=a&&a.__esModule?function(){return a["default"]}:function(){return a};Object.defineProperty(s,"a",{get:s});var u=n(13),c=new a.Store({getInitialState:function(){return a.toImmutable.bind()({isValidating:!1,authToken:!1,host:null,isInvalid:!1,errorMessage:""})},initialize:function(){this.on(u.a.VALIDATING_AUTH_TOKEN,r),this.on(u.a.VALID_AUTH_TOKEN,i),this.on(u.a.INVALID_AUTH_TOKEN,o)}});e.a=c},function(t,e,n){"use strict";function r(t,e){var n=e.authToken,r=e.host;return o.toImmutable.bind()({authToken:n,host:r})}function i(){return u.getInitialState()}var o=n(2),a=o&&o.__esModule?function(){return o["default"]}:function(){return o};Object.defineProperty(a,"a",{get:a});var s=n(13),u=new o.Store({getInitialState:function(){return o.toImmutable.bind()({authToken:null,host:""})},initialize:function(){this.on(s.a.VALID_AUTH_TOKEN,r),this.on(s.a.LOG_OUT,i)}});e.a=u},function(t,e,n){"use strict";function r(t,e){var n=e.rememberAuth;return n}var i=n(2),o=i&&i.__esModule?function(){return i["default"]}:function(){return i};Object.defineProperty(o,"a",{get:o});var a=n(13),s=new i.Store({getInitialState:function(){return!0},initialize:function(){this.on(a.a.VALID_AUTH_TOKEN,r)}});e.a=s},function(t,e,n){"use strict";function r(t,e){t.dispatch(s.a.SERVER_CONFIG_LOADED,e)}function i(t){a.a.bind()(t,"GET","config").then(function(e){return r(t,e)})}function o(t,e){t.dispatch(s.a.COMPONENT_LOADED,{component:e})}var a=n(4),s=n(18);e.configLoaded=r,e.fetchAll=i,e.componentLoaded=o},function(t,e,n){"use strict";function r(t){return[["serverComponent"],function(e){return e.contains(t)}]}e.isComponentLoaded=r;var i=[["serverConfig","latitude"],["serverConfig","longitude"],function(t,e){return{latitude:t,longitude:e}}];Object.defineProperty(e,"locationGPS",{configurable:!1,enumerable:!0,get:function(){return i}});var o=["serverConfig","location_name"];Object.defineProperty(e,"locationName",{configurable:!1,enumerable:!0,get:function(){return o}});var a=["serverConfig","serverVersion"];Object.defineProperty(e,"serverVersion",{configurable:!1,enumerable:!0,get:function(){return a}})},function(t,e,n){"use strict";function r(t,e){var n=e.component;return t.push(n)}function i(t,e){var n=e.components;return a.toImmutable.bind()(n)}function o(){return c.getInitialState()}var a=n(2),s=a&&a.__esModule?function(){return a["default"]}:function(){return a};Object.defineProperty(s,"a",{get:s});var u=n(18),c=new a.Store({getInitialState:function(){return a.toImmutable.bind()([])},initialize:function(){this.on(u.a.COMPONENT_LOADED,r),this.on(u.a.SERVER_CONFIG_LOADED,i),this.on(u.a.LOG_OUT,o)}});e.a=c},function(t,e,n){"use strict";function r(t,e){var n=e.latitude,r=e.longitude,i=e.location_name,a=e.temperature_unit,s=e.time_zone,u=e.version;return o.toImmutable.bind()({latitude:n,longitude:r,location_name:i,temperature_unit:a,time_zone:s,serverVersion:u})}function i(){return u.getInitialState()}var o=n(2),a=o&&o.__esModule?function(){return o["default"]}:function(){return o};Object.defineProperty(a,"a",{get:a});var s=n(18),u=new o.Store({getInitialState:function(){return o.toImmutable.bind()({latitude:null,longitude:null,location_name:"Home",temperature_unit:"°C",time_zone:"UTC",serverVersion:"unknown"})},initialize:function(){this.on(s.a.SERVER_CONFIG_LOADED,r),this.on(s.a.LOG_OUT,i)}});e.a=u},function(t,e,n){"use strict";function r(t,e){t.dispatch(u.a.ENTITY_HISTORY_DATE_SELECTED,{date:e})}function i(t){ +var e=arguments.length<=1||void 0===arguments[1]?null:arguments[1];t.dispatch(u.a.RECENT_ENTITY_HISTORY_FETCH_START,{});var n="history/period";return null!==e&&(n+="?filter_entity_id="+e),s.a.bind()(t,"GET",n).then(function(e){return t.dispatch(u.a.RECENT_ENTITY_HISTORY_FETCH_SUCCESS,{stateHistory:e})},function(){return t.dispatch(u.a.RECENT_ENTITY_HISTORY_FETCH_ERROR,{})})}function o(t,e){return t.dispatch(u.a.ENTITY_HISTORY_FETCH_START,{date:e}),s.a.bind()(t,"GET","history/period/"+e).then(function(n){return t.dispatch(u.a.ENTITY_HISTORY_FETCH_SUCCESS,{date:e,stateHistory:n})},function(){return t.dispatch(u.a.ENTITY_HISTORY_FETCH_ERROR,{})})}function a(t){var e=t.evaluate(c.currentDate);return o(t,e)}var s=n(4),u=n(10),c=n(37);e.changeCurrentDate=r,e.fetchRecent=i,e.fetchDate=o,e.fetchSelectedDate=a},function(t,e,n){"use strict";function r(t,e){var n=e.date;return s.a.bind()(n)}function i(){return c.getInitialState()}var o=n(2),a=o&&o.__esModule?function(){return o["default"]}:function(){return o};Object.defineProperty(a,"a",{get:a});var s=n(27),u=n(10),c=new o.Store({getInitialState:function(){var t=new Date;return t.setDate(t.getUTCDate()-1),s.a.bind()(t)},initialize:function(){this.on(u.a.ENTITY_HISTORY_DATE_SELECTED,r),this.on(u.a.LOG_OUT,i)}});e.a=c},function(t,e,n){"use strict";function r(t,e){var n=e.date,r=e.stateHistory;return 0===r.length?t.set(n,o.toImmutable.bind()({})):t.withMutations(function(t){r.forEach(function(e){return t.setIn([n,e[0].entity_id],o.toImmutable.bind()(e.map(u.a.fromJSON)))})})}function i(){return c.getInitialState()}var o=n(2),a=o&&o.__esModule?function(){return o["default"]}:function(){return o};Object.defineProperty(a,"a",{get:a});var s=n(10),u=n(15),c=new o.Store({getInitialState:function(){return o.toImmutable.bind()({})},initialize:function(){this.on(s.a.ENTITY_HISTORY_FETCH_SUCCESS,r),this.on(s.a.LOG_OUT,i)}});e.a=c},function(t,e,n){"use strict";var r=n(2),i=r&&r.__esModule?function(){return r["default"]}:function(){return r};Object.defineProperty(i,"a",{get:i});var o=n(10),a=new r.Store({getInitialState:function(){return!1},initialize:function(){this.on(o.a.ENTITY_HISTORY_FETCH_START,function(){return!0}),this.on(o.a.ENTITY_HISTORY_FETCH_SUCCESS,function(){return!1}),this.on(o.a.ENTITY_HISTORY_FETCH_ERROR,function(){return!1}),this.on(o.a.RECENT_ENTITY_HISTORY_FETCH_START,function(){return!0}),this.on(o.a.RECENT_ENTITY_HISTORY_FETCH_SUCCESS,function(){return!1}),this.on(o.a.RECENT_ENTITY_HISTORY_FETCH_ERROR,function(){return!1}),this.on(o.a.LOG_OUT,function(){return!1})}});e.a=a},function(t,e,n){"use strict";function r(t,e){var n=e.stateHistory;return t.withMutations(function(t){n.forEach(function(e){return t.set(e[0].entity_id,o.toImmutable.bind()(e.map(u.a.fromJSON)))})})}function i(){return c.getInitialState()}var o=n(2),a=o&&o.__esModule?function(){return o["default"]}:function(){return o};Object.defineProperty(a,"a",{get:a});var s=n(10),u=n(15),c=new o.Store({getInitialState:function(){return o.toImmutable.bind()({})},initialize:function(){this.on(s.a.RECENT_ENTITY_HISTORY_FETCH_SUCCESS,r),this.on(s.a.LOG_OUT,i)}});e.a=c},function(t,e,n){"use strict";function r(t,e){var n=e.stateHistory,r=(new Date).getTime();return t.withMutations(function(t){n.forEach(function(e){return t.set(e[0].entity_id,r)}),history.length>1&&t.set(u,r)})}function i(){return c.getInitialState()}var o=n(2),a=o&&o.__esModule?function(){return o["default"]}:function(){return o};Object.defineProperty(a,"a",{get:a});var s=n(10),u="ALL_ENTRY_FETCH",c=new o.Store({getInitialState:function(){return o.toImmutable.bind()({})},initialize:function(){this.on(s.a.RECENT_ENTITY_HISTORY_FETCH_SUCCESS,r),this.on(s.a.LOG_OUT,i)}});e.a=c},function(t,e,n){"use strict";var r=n(9),i=n(15),o=r.createApiActions.bind()(i.a);e.a=o},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var i=function(){function t(t,e){for(var n=0;na}var i=n(2),o=i&&i.__esModule?function(){return i["default"]}:function(){return i};Object.defineProperty(o,"a",{get:o});var a=6e4,s=["currentLogbookDate"];Object.defineProperty(e,"currentDate",{configurable:!1,enumerable:!0,get:function(){return s}});var u=[s,["logbookEntriesUpdated"],function(t,e){return r(e.get(t))}];Object.defineProperty(e,"isCurrentStale",{configurable:!1,enumerable:!0,get:function(){return u}});var c=[s,["logbookEntries"],function(t,e){return e.get(t)||i.toImmutable.bind()([])}];Object.defineProperty(e,"currentEntries",{configurable:!1,enumerable:!0,get:function(){return c}});var l=["isLoadingLogbookEntries"];Object.defineProperty(e,"isLoadingEntries",{configurable:!1,enumerable:!0,get:function(){return l}})},function(t,e,n){"use strict";function r(t){t.registerStores({currentLogbookDate:i.a,isLoadingLogbookEntries:o.a,logbookEntries:a.a,logbookEntriesUpdated:s.a})}var i=n(101),o=n(102),a=n(103),s=n(104),u=n(97),c=n(98);e.register=r;var l=u;Object.defineProperty(e,"actions",{configurable:!1,enumerable:!0,get:function(){return l}});var f=c;Object.defineProperty(e,"getters",{configurable:!1,enumerable:!0,get:function(){return f}})},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function o(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&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var a=n(2),s=a&&a.__esModule?function(){return a["default"]}:function(){return a};Object.defineProperty(s,"a",{get:s});var u=n(28),c=function(){function t(t,e){for(var n=0;n1}})},function(t,e,n){"use strict";var r=n(0);n(55),e["default"]=new r.a({is:"ha-introduction-card",properties:{showInstallInstruction:{type:Boolean,value:!1},showHideInstruction:{type:Boolean,value:!0}}})},function(t,e,n){"use strict";var r=n(209),i=r&&r.__esModule?function(){return r["default"]}:function(){return r};Object.defineProperty(i,"a",{get:i});var o=n(0),a=n(1),s=a.a.moreInfoActions;e["default"]=new o.a({is:"ha-media_player-card",properties:{stateObj:{type:Object},playerObj:{type:Object,computed:"computePlayerObj(stateObj)",observer:"playerObjChanged"},playbackControlIcon:{type:String,computed:"computePlaybackControlIcon(playerObj)"},elevation:{type:Number,value:1,reflectToAttribute:!0}},playerObjChanged:function(t){t.isOff||t.isIdle||(this.$.cover.style.backgroundImage=t.stateObj.attributes.entity_picture?"url("+t.stateObj.attributes.entity_picture+")":"")},computeBannerClasses:function(t){return i.a.bind()({banner:!0,"is-off":t.isOff||t.isIdle,"no-cover":!t.stateObj.attributes.entity_picture})},computeHidePowerOnButton:function(t){return!t.isOff||!t.supportsTurnOn},computePlayerObj:function(t){return t.domainModel(a.a)},computePlaybackControlIcon:function(t){return t.isPlaying?t.supportsPause?"mdi:pause":"mdi:stop":t.isPaused||t.isOff?"mdi:play":""},computeShowControls:function(t){return!t.isOff},handleNext:function(t){t.stopPropagation(),this.playerObj.nextTrack()},handleOpenMoreInfo:function(t){var e=this;t.stopPropagation(),this.async(function(){return s.selectEntity(e.stateObj.entityId)},1)},handlePlaybackControl:function(t){t.stopPropagation(),this.playerObj.mediaPlayPause()},handlePrevious:function(t){t.stopPropagation(),this.playerObj.previousTrack()},handleTogglePower:function(t){t.stopPropagation(),this.playerObj.togglePower()}})},function(t,e,n){"use strict";var r=n(0),i=n(61);e["default"]=new r.a({is:"display-time",properties:{dateObj:{type:Object}},computeTime:function(t){return t?i.a.bind()(t):""}})},function(t,e,n){"use strict";var r=n(1),i=n(0),o=n(3),a=r.a.entityGetters;e["default"]=new i.a({is:"entity-list",behaviors:[o.a],properties:{entities:{type:Array,bindNuclear:[a.entityMap,function(t){return t.valueSeq().sortBy(function(t){return t.entityId}).toArray()}]}},entitySelected:function(t){t.preventDefault(),this.fire("entity-selected",{entityId:t.model.entity.entityId})}})},function(t,e,n){"use strict";var r=n(0),i=n(1);n(30);var o=i.a.reactor,a=i.a.entityGetters,s=i.a.moreInfoActions;e["default"]=new r.a({is:"ha-entity-marker",properties:{entityId:{type:String,value:""},state:{type:Object,computed:"computeState(entityId)"},icon:{type:Object,computed:"computeIcon(state)"},image:{type:Object,computed:"computeImage(state)"},value:{type:String,computed:"computeValue(state)"}},listeners:{tap:"badgeTap"},badgeTap:function(t){var e=this;t.stopPropagation(),this.entityId&&this.async(function(){return s.selectEntity(e.entityId)},1)},computeState:function(t){return t&&o.evaluate(a.byId(t))},computeIcon:function(t){return!t&&"home"},computeImage:function(t){return t&&t.attributes.entity_picture},computeValue:function(t){return t&&t.entityDisplay.split(" ").map(function(t){return t.substr(0,1)}).join("")}})},function(t,e,n){"use strict";var r=n(0),i=n(63);e["default"]=new r.a({is:"ha-state-icon",properties:{stateObj:{type:Object}},computeIcon:function(t){return i.a.bind()(t)}})},function(t,e,n){"use strict";var r=n(0),i=n(1),o=n(33),a=n(63);n(30);var s=i.a.moreInfoActions;e["default"]=new r.a({is:"ha-state-label-badge",properties:{state:{type:Object,observer:"stateChanged"}},listeners:{tap:"badgeTap"},badgeTap:function(t){var e=this;t.stopPropagation(),this.async(function(){return s.selectEntity(e.state.entityId)},1)},computeClasses:function(t){switch(t.domain){case"binary_sensor":case"updater":return"blue";default:return""}},computeValue:function(t){switch(t.domain){case"binary_sensor":case"device_tracker":case"updater":case"sun":case"alarm_control_panel":return null;case"sensor":default:return"unknown"===t.state?"-":t.state}},computeIcon:function(t){if("unavailable"===t.state)return null;switch(t.domain){case"alarm_control_panel":return"pending"===t.state?"mdi:clock-fast":"armed_away"===t.state?"mdi:nature":"armed_home"===t.state?"mdi:home-variant":o.a.bind()(t.domain,t.state);case"binary_sensor":case"device_tracker":case"updater":return a.a.bind()(t);case"sun":return"above_horizon"===t.state?o.a.bind()(t.domain):"mdi:brightness-3";default:return null}},computeImage:function(t){return t.attributes.entity_picture||null},computeLabel:function(t){if("unavailable"===t.state)return"unavai";switch(t.domain){case"device_tracker":return"not_home"===t.state?"Away":t.state;case"alarm_control_panel":return"pending"===t.state?"pend":"armed_away"===t.state||"armed_home"===t.state?"armed":"disarm";default:return t.attributes.unit_of_measurement||null}},computeDescription:function(t){return t.entityDisplay},stateChanged:function(){this.updateStyles()}})},function(t,e,n){"use strict";var r=n(0);n(153),e["default"]=new r.a({is:"state-badge",properties:{stateObj:{type:Object,observer:"updateIconColor"}},updateIconColor:function(t){return t.attributes.entity_picture?(this.style.backgroundImage="url("+t.attributes.entity_picture+")",void(this.$.icon.style.display="none")):(this.style.backgroundImage="",this.$.icon.style.display="inline",void("light"===t.domain&&"on"===t.state&&t.attributes.rgb_color&&t.attributes.rgb_color.reduce(function(t,e){return t+e},0)<730?this.$.icon.style.color="rgb("+t.attributes.rgb_color.join(",")+")":this.$.icon.style.color=null))}})},function(t,e,n){"use strict";var r=n(1),i=n(0),o=n(3),a=r.a.eventGetters;e["default"]=new i.a({is:"events-list",behaviors:[o.a],properties:{events:{type:Array,bindNuclear:[a.entityMap,function(t){return t.valueSeq().sortBy(function(t){return t.event}).toArray()}]}},eventSelected:function(t){t.preventDefault(),this.fire("event-selected",{eventType:t.model.event.event})}})},function(t,e,n){"use strict";function r(t){return t in c?c[t]:30}function i(t){return"group"===t.domain?t.attributes.order:t.entityDisplay.toLowerCase()}var o=n(0),a=n(1);n(159),n(144),n(146);var s=a.a.util,u={camera:4,media_player:3},c={configurator:-20,group:-10,a:-1,updater:0,sun:1,device_tracker:2,alarm_control_panel:3,sensor:5,binary_sensor:6};e["default"]=new o.a({is:"ha-cards",properties:{showIntroduction:{type:Boolean,value:!1},columns:{type:Number,value:2},states:{type:Object},cards:{type:Object}},observers:["updateCards(columns, states, showIntroduction)"],updateCards:function(t,e,n){var r=this;this.debounce("updateCards",function(){r.cards=r.computeCards(t,e,n)},0)},computeCards:function(t,e,n){function o(t){return t.filter(function(t){return!(t.entityId in f)})}function a(t){for(var e=0,n=e;n1;var s=a(o);i.length>0&&d.columns[s].push({cardType:"entities",states:i,groupEntity:n}),r.forEach(function(t){d.columns[s].push({cardType:t.domain,stateObj:t})})}}for(var l=e.groupBy(function(t){return t.domain}),f={},d={demo:!1,badges:[],columns:[]},h=[],p=0;t>p;p++)d.columns.push([]),h.push(0);return n&&d.columns[a(5)].push({cardType:"introduction",showHideInstruction:e.size>0&&!0}),l.keySeq().sortBy(function(t){return r(t)}).forEach(function(t){if("a"===t)return void(d.demo=!0);var n=r(t);n>=0&&10>n?d.badges.push.apply(d.badges,o(l.get(t)).sortBy(i).toArray()):"group"===t?l.get(t).sortBy(i).forEach(function(t){var n=s.expandGroup(t,e);n.forEach(function(t){f[t.entityId]=!0}),c(t.entityId,n.toArray(),t)}):c(t,o(l.get(t)).sortBy(i).toArray())}),d.columns=d.columns.filter(function(t){return t.length>0}),d}})},function(t,e,n){"use strict";var r=n(0);e["default"]=new r.a({is:"ha-color-picker",properties:{color:{type:Object},width:{type:Number},height:{type:Number}},listeners:{mousedown:"onMouseDown",mouseup:"onMouseUp",touchstart:"onTouchStart",touchend:"onTouchEnd"},onMouseDown:function(t){this.onMouseMove(t),this.addEventListener("mousemove",this.onMouseMove)},onMouseUp:function(){this.removeEventListener("mousemove",this.onMouseMove)},onTouchStart:function(t){this.onTouchMove(t),this.addEventListener("touchmove",this.onTouchMove)},onTouchEnd:function(){this.removeEventListener("touchmove",this.onTouchMove)},onTouchMove:function(t){var e=this;this.mouseMoveIsThrottled&&(this.mouseMoveIsThrottled=!1,this.processColorSelect(t.touches[0]),this.async(function(){e.mouseMoveIsThrottled=!0},100))},onMouseMove:function(t){var e=this;this.mouseMoveIsThrottled&&(this.mouseMoveIsThrottled=!1,this.processColorSelect(t),this.async(function(){e.mouseMoveIsThrottled=!0},100))},processColorSelect:function(t){var e=this.canvas.getBoundingClientRect();t.clientX=e.left+e.width||t.clientY=e.top+e.height||this.onColorSelect(t.clientX-e.left,t.clientY-e.top)},onColorSelect:function(t,e){var n=this.context.getImageData(t,e,1,1).data;this.setColor({r:n[0],g:n[1],b:n[2]})},setColor:function(t){this.color=t,this.fire("colorselected",{rgb:this.color})},ready:function(){this.setColor=this.setColor.bind(this),this.mouseMoveIsThrottled=!0,this.canvas=this.children[0],this.context=this.canvas.getContext("2d"),this.drawGradient()},drawGradient:function(){var t=void 0;this.width&&this.height||(t=getComputedStyle(this));var e=this.width||parseInt(t.width,10),n=this.height||parseInt(t.height,10),r=this.context.createLinearGradient(0,0,e,0);r.addColorStop(0,"rgb(255,0,0)"),r.addColorStop(.16,"rgb(255,0,255)"),r.addColorStop(.32,"rgb(0,0,255)"),r.addColorStop(.48,"rgb(0,255,255)"),r.addColorStop(.64,"rgb(0,255,0)"),r.addColorStop(.8,"rgb(255,255,0)"),r.addColorStop(1,"rgb(255,0,0)"),this.context.fillStyle=r,this.context.fillRect(0,0,e,n);var i=this.context.createLinearGradient(0,0,0,n);i.addColorStop(0,"rgba(255,255,255,1)"),i.addColorStop(.5,"rgba(255,255,255,0)"),i.addColorStop(.5,"rgba(0,0,0,0)"),i.addColorStop(1,"rgba(0,0,0,1)"),this.context.fillStyle=i,this.context.fillRect(0,0,e,n)}})},function(t,e,n){"use strict";var r=n(0);n(30),e["default"]=new r.a({is:"ha-demo-badge"})},function(t,e,n){"use strict";var r=n(0);n(162),e["default"]=new r.a({is:"ha-logbook",properties:{entries:{type:Object,value:[]}},noEntries:function(t){return!t.length}})},function(t,e,n){"use strict";var r=n(1),i=n(0),o=n(3);n(166);var a=r.a.configGetters,s=r.a.navigationGetters,u=r.a.authActions,c=r.a.navigationActions;e["default"]=new i.a({is:"ha-sidebar",behaviors:[o.a],properties:{menuShown:{type:Boolean},menuSelected:{type:String},narrow:{type:Boolean},selected:{type:String,bindNuclear:s.activePane},hasHistoryComponent:{type:Boolean,bindNuclear:a.isComponentLoaded("history")},hasLogbookComponent:{type:Boolean,bindNuclear:a.isComponentLoaded("logbook")}},menuSelect:function(){var t=this;this.debounce("updateStyles",function(){return t.updateStyles()},1)},menuClicked:function(t){for(var e=t.target,n=5;n&&!e.getAttribute("data-panel");)e=e.parentElement,n--;n&&this.selectPanel(e.getAttribute("data-panel"))},toggleMenu:function(){this.fire("close-menu")},selectPanel:function(t){var e=this;if(t!==this.selected){if("logout"===t)return void this.handleLogOut();c.navigate.apply(null,t.split("/")),this.debounce("updateStyles",function(){return e.updateStyles()},1)}},handleLogOut:function(){u.logOut()}})},function(t,e,n){"use strict";var r=n(1),i=n(0);n(54),n(150),n(56);var o=r.a.moreInfoActions;e["default"]=new i.a({is:"logbook-entry",entityClicked:function(t){t.preventDefault(),o.selectEntity(this.entryObj.entityId)}})},function(t,e,n){"use strict";var r=n(1),i=n(0),o=n(3);n(54);var a=r.a.serviceGetters;e["default"]=new i.a({is:"services-list",behaviors:[o.a],properties:{serviceDomains:{type:Array,bindNuclear:a.entityMap}},computeDomains:function(t){return t.valueSeq().map(function(t){return t.domain}).sort().toJS()},computeServices:function(t,e){return t.get(e).get("services").keySeq().toArray()},serviceClicked:function(t){t.preventDefault(),this.fire("service-selected",{domain:t.model.domain,service:t.model.service})}})},function(t,e,n){"use strict";function r(t){var e=parseFloat(t);return!isNaN(e)&&isFinite(e)?e:null}var i=n(227),o=i&&i.__esModule?function(){return i["default"]}:function(){return i};Object.defineProperty(o,"a",{get:o});var a=n(0);e["default"]=new a.a({is:"state-history-chart-line",properties:{data:{type:Object,observer:"dataChanged"},unit:{type:String},isSingleDevice:{type:Boolean,value:!1},isAttached:{type:Boolean,value:!1,observer:"dataChanged"},chartEngine:{type:Object}},created:function(){this.style.display="block"},attached:function(){this.isAttached=!0},dataChanged:function(){this.drawChart()},drawChart:function(){if(this.isAttached){this.chartEngine||(this.chartEngine=new window.google.visualization.LineChart(this));var t=this.unit,e=this.data;if(0!==e.length){var n={legend:{position:"top"},interpolateNulls:!0,titlePosition:"none",vAxes:{0:{title:t}},hAxis:{format:"H:mm"},chartArea:{left:"60",width:"95%"},explorer:{actions:["dragToZoom","rightClickToReset","dragToPan"],keepInBounds:!0,axis:"horizontal",maxZoomIn:.1}};this.isSingleDevice&&(n.legend.position="none",n.vAxes[0].title=null,n.chartArea.left=40,n.chartArea.height="80%",n.chartArea.top=5,n.enableInteractivity=!1);var i=new Date(Math.min.apply(null,e.map(function(t){return t[0].lastChangedAsDate}))),a=new Date(i);a.setDate(a.getDate()+1),a>new Date&&(a=new Date);var s=e.map(function(t){function e(t,e){c&&e&&u.push([t[0]].concat(c.slice(1).map(function(t,n){return e[n]?t:null}))),u.push(t),c=t}var n=t[t.length-1],i=n.domain,o=n.entityDisplay,s=new window.google.visualization.DataTable;s.addColumn({type:"datetime",id:"Time"});var u=[],c=void 0;if("thermostat"===i){var l=t.reduce(function(t,e){return t||e.attributes.target_temp_high!==e.attributes.target_temp_low},!1);s.addColumn("number",o+" current temperature");var f=void 0;l?!function(){s.addColumn("number",o+" target temperature high"),s.addColumn("number",o+" target temperature low");var t=[!1,!0,!0];f=function(n){var i=r(n.attributes.current_temperature),o=r(n.attributes.target_temp_high),a=r(n.attributes.target_temp_low);e([n.lastUpdatedAsDate,i,o,a],t)}}():!function(){s.addColumn("number",o+" target temperature");var t=[!1,!0];f=function(n){var i=r(n.attributes.current_temperature),o=r(n.attributes.temperature);e([n.lastUpdatedAsDate,i,o],t)}}(),t.forEach(f)}else!function(){s.addColumn("number",o);var n="sensor"!==i&&[!0];t.forEach(function(t){var i=r(t.state);e([t.lastChangedAsDate,i],n)})}();return e([a].concat(c.slice(1)),!1),s.addRows(u),s}),u=void 0;u=1===s.length?s[0]:s.slice(1).reduce(function(t,e){return window.google.visualization.data.join(t,e,"full",[[0,0]],o.a.bind()(1,t.getNumberOfColumns()),o.a.bind()(1,e.getNumberOfColumns()))},s[0]),this.chartEngine.draw(u,n)}}}})},function(t,e,n){"use strict";var r=n(0);e["default"]=new r.a({is:"state-history-chart-timeline",properties:{data:{type:Object,observer:"dataChanged"},isAttached:{type:Boolean,value:!1,observer:"dataChanged"}},attached:function(){this.isAttached=!0},dataChanged:function(){this.drawChart()},drawChart:function(){function t(t,e,n,r){var i=e.replace(/_/g," ");o.addRow([t,i,n,r])}if(this.isAttached){for(var e=r.a.dom(this),n=this.data;e.node.lastChild;)e.node.removeChild(e.node.lastChild);if(n&&0!==n.length){var i=new window.google.visualization.Timeline(this),o=new window.google.visualization.DataTable;o.addColumn({type:"string",id:"Entity"}),o.addColumn({type:"string",id:"State"}),o.addColumn({type:"date",id:"Start"}),o.addColumn({type:"date",id:"End"});var a=new Date(n.reduce(function(t,e){return Math.min(t,e[0].lastChangedAsDate)},new Date)),s=new Date(a);s.setDate(s.getDate()+1),s>new Date&&(s=new Date);var u=0;n.forEach(function(e){if(0!==e.length){var n=e[0].entityDisplay,r=void 0,i=null,o=null;e.forEach(function(e){null!==i&&e.state!==i?(r=e.lastChangedAsDate,t(n,i,o,r),i=e.state,o=r):null===i&&(i=e.state,o=e.lastChangedAsDate)}),t(n,i,o,s),u++}}),i.draw(o,{height:55+42*u,timeline:{showRowLabels:n.length>1},hAxis:{format:"H:mm"}})}}}})},function(t,e,n){"use strict";var r=n(1),i=n(0),o=n(3),a=r.a.streamGetters,s=r.a.streamActions;e["default"]=new i.a({is:"stream-status",behaviors:[o.a],properties:{isStreaming:{type:Boolean,bindNuclear:a.isStreamingEvents},hasError:{type:Boolean,bindNuclear:a.hasStreamingEventsError}},toggleChanged:function(){this.isStreaming?s.stop():s.start()}})},function(t,e,n){"use strict";var r=n(1),i=n(0),o=n(3),a=r.a.voiceActions,s=r.a.voiceGetters;e["default"]=new i.a({is:"ha-voice-command-dialog",behaviors:[o.a],properties:{dialogOpen:{type:Boolean,value:!1,observer:"dialogOpenChanged"},finalTranscript:{type:String,bindNuclear:s.finalTranscript},interimTranscript:{type:String,bindNuclear:s.extraInterimTranscript},isTransmitting:{type:Boolean,bindNuclear:s.isTransmitting},isListening:{type:Boolean,bindNuclear:s.isListening},showListenInterface:{type:Boolean,computed:"computeShowListenInterface(isListening, isTransmitting)",observer:"showListenInterfaceChanged"}},computeShowListenInterface:function(t,e){return t||e},dialogOpenChanged:function(t){!t&&this.isListening&&a.stop()},showListenInterfaceChanged:function(t){!t&&this.dialogOpen?this.dialogOpen=!1:t&&(this.dialogOpen=!0)}})},function(t,e,n){"use strict";var r=n(1),i=n(0),o=n(3);n(32),n(57),n(183);var a=r.a.configGetters,s=r.a.entityHistoryGetters,u=r.a.entityHistoryActions,c=r.a.moreInfoGetters,l=r.a.moreInfoActions,f=["camera","configurator","scene"];e["default"]=new i.a({is:"more-info-dialog",behaviors:[o.a],properties:{stateObj:{type:Object,bindNuclear:c.currentEntity,observer:"stateObjChanged"},stateHistory:{type:Object,bindNuclear:[c.currentEntityHistory,function(t){return t?[t]:!1}]},isLoadingHistoryData:{type:Boolean,computed:"computeIsLoadingHistoryData(delayedDialogOpen, isLoadingEntityHistoryData)"},isLoadingEntityHistoryData:{type:Boolean,bindNuclear:s.isLoadingEntityHistory},hasHistoryComponent:{type:Boolean,bindNuclear:a.isComponentLoaded("history"),observer:"fetchHistoryData"},shouldFetchHistory:{type:Boolean,bindNuclear:c.isCurrentEntityHistoryStale,observer:"fetchHistoryData"},showHistoryComponent:{type:Boolean,value:!1,computed:"computeShowHistoryComponent(hasHistoryComponent, stateObj)"},dialogOpen:{type:Boolean,value:!1,observer:"dialogOpenChanged"},delayedDialogOpen:{type:Boolean,value:!1}},computeIsLoadingHistoryData:function(t,e){return!t||e},computeShowHistoryComponent:function(t,e){return this.hasHistoryComponent&&e&&-1===f.indexOf(e.domain)},fetchHistoryData:function(){this.stateObj&&this.hasHistoryComponent&&this.shouldFetchHistory&&u.fetchRecent(this.stateObj.entityId)},stateObjChanged:function(t){var e=this;return t?void this.async(function(){e.fetchHistoryData(),e.dialogOpen=!0},10):void(this.dialogOpen=!1)},dialogOpenChanged:function(t){var e=this;t?this.async(function(){e.delayedDialogOpen=!0},10):!t&&this.stateObj&&(this.async(function(){return l.deselectEntity()},10),this.delayedDialogOpen=!1)}})},function(t,e,n){"use strict";var r=n(0),i=n(1),o=n(3),a=n(36);n(72),n(71);var s=i.a.localStoragePreferences,u=i.a.navigationActions,c=i.a.reactor,l=i.a.startLocalStoragePreferencesSync,f=i.a.syncGetters;e["default"]=new r.a({is:"home-assistant",hostAttributes:{auth:null,icons:null},behaviors:[o.a],properties:{auth:{type:String},icons:{type:String},dataLoaded:{type:Boolean,bindNuclear:f.isDataLoaded},iconsLoaded:{type:Boolean,value:!1},loaded:{type:Boolean,computed:"computeLoaded(dataLoaded, iconsLoaded)"}},computeLoaded:function(t,e){return t&&e},computeForceShowLoading:function(t,e){return t&&!e},loadIcons:function(){var t=this,e=function(){t.iconsLoaded=!0};this.importHref("/static/mdi-"+this.icons+".html",e,function(){return t.importHref("/static/mdi.html",e,e)})},created:function(){this.registerServiceWorker()},ready:function(){var t=this;c.batch(function(){t.auth?a.a.bind()(t.auth,!1):s.authToken&&a.a.bind()(s.authToken,!0),u.showSidebar(s.showSidebar)}),l(),this.loadIcons()},registerServiceWorker:function(){"serviceWorker"in navigator&&navigator.serviceWorker.register("/service_worker.js")["catch"](function(t){})}})},function(t,e,n){"use strict";var r=n(1),i=n(0),o=n(3);n(8),n(157);var a=r.a.configGetters,s=r.a.viewActions,u=r.a.viewGetters,c=r.a.voiceGetters,l=r.a.streamGetters,f=r.a.syncGetters,d=r.a.syncActions,h=r.a.voiceActions;e["default"]=new i.a({is:"partial-cards",behaviors:[o.a],properties:{narrow:{type:Boolean,value:!1},isFetching:{type:Boolean,bindNuclear:f.isFetching},isStreaming:{type:Boolean,bindNuclear:l.isStreamingEvents},canListen:{type:Boolean,bindNuclear:[c.isVoiceSupported,a.isComponentLoaded("conversation"),function(t,e){return t&&e}]},introductionLoaded:{type:Boolean,bindNuclear:a.isComponentLoaded("introduction")},locationName:{type:String,bindNuclear:a.locationName},showMenu:{type:Boolean,value:!1,observer:"windowChange"},currentView:{type:String,bindNuclear:[u.currentView,function(t){return t||""}],observer:"removeFocus"},views:{type:Array,bindNuclear:[u.views,function(t){return t.valueSeq().sortBy(function(t){return t.attributes.order}).toArray()}]},hasViews:{type:Boolean,computed:"computeHasViews(views)"},states:{type:Object,bindNuclear:u.currentViewEntities},columns:{type:Number,value:1}},created:function(){var t=this;this.windowChange=this.windowChange.bind(this);for(var e=[],n=0;5>n;n++)e.push(300+300*n);this.mqls=e.map(function(e){var n=window.matchMedia("(min-width: "+e+"px)");return n.addListener(t.windowChange),n})},detached:function(){var t=this;this.mqls.forEach(function(e){return e.removeListener(t.windowChange)})},windowChange:function(){var t=this.mqls.reduce(function(t,e){return t+e.matches},0);this.columns=Math.max(1,t-(!this.narrow&&this.showMenu))},removeFocus:function(){document.activeElement&&document.activeElement.blur()},handleRefresh:function(){d.fetchAll()},handleListenClick:function(){h.listen()},headerScrollAdjust:function(t){this.hasViews&&i.a.Base.transform("translateY(-"+t.detail.y+"px)",this.$.menu)},computeHeaderHeight:function(t){return t?128:64},computeCondensedHeaderHeight:function(t){return t?48:64},computeMenuButtonClass:function(t,e){return!t&&e?"menu-icon invisible":"menu-icon"},computeRefreshButtonClass:function(t){return t?"ha-spin":""},computeTitle:function(t,e){return t?"Home Assistant":e},computeShowIntroduction:function(t,e,n){return""===t&&(e||0===n.size)},computeHasViews:function(t){return t.length>0},toggleMenu:function(){this.fire("open-menu")},viewSelected:function(t){var e=t.detail.item.getAttribute("data-entity")||null,n=this.currentView||null;e!==n&&this.async(function(){return s.selectView(e)},0)}})},function(t,e,n){"use strict";var r=n(1),i=n(0);n(8),n(163);var o=r.a.reactor,a=r.a.serviceActions,s=r.a.serviceGetters;e["default"]=new i.a({is:"partial-dev-call-service",properties:{narrow:{type:Boolean,value:!1},showMenu:{type:Boolean,value:!1},domain:{type:String,value:""},service:{type:String,value:""},serviceData:{type:String,value:""},description:{type:String,computed:"computeDescription(domain, service)"}},computeDescription:function(t,e){return o.evaluate([s.entityMap,function(n){return n.has(t)&&n.get(t).get("services").has(e)?JSON.stringify(n.get(t).get("services").get(e).toJS(),null,2):"No description available"}])},serviceSelected:function(t){this.domain=t.detail.domain,this.service=t.detail.service},callService:function(){var t=void 0;try{t=this.serviceData?JSON.parse(this.serviceData):{}}catch(e){return void alert("Error parsing JSON: "+e)}a.callService(this.domain,this.service,t)},computeFormClasses:function(t){return"content fit "+(t?"":"layout horizontal")}})},function(t,e,n){"use strict";var r=n(1),i=n(0);n(8),n(156);var o=r.a.eventActions;e["default"]=new i.a({is:"partial-dev-fire-event",properties:{narrow:{type:Boolean,value:!1},showMenu:{type:Boolean,value:!1},eventType:{type:String,value:""},eventData:{type:String,value:""}},eventSelected:function(t){this.eventType=t.detail.eventType},fireEvent:function(){var t=void 0;try{t=this.eventData?JSON.parse(this.eventData):{}}catch(e){return void alert("Error parsing JSON: "+e)}o.fireEvent(this.eventType,t)},computeFormClasses:function(t){return"content fit "+(t?"":"layout horizontal")}})},function(t,e,n){"use strict";var r=n(1),i=n(0),o=n(3);n(8);var a=r.a.configGetters,s=r.a.errorLogActions;e["default"]=new i.a({is:"partial-dev-info",behaviors:[o.a],properties:{narrow:{type:Boolean,value:!1},showMenu:{type:Boolean,value:!1},hassVersion:{type:String,bindNuclear:a.serverVersion},polymerVersion:{type:String,value:i.a.version},nuclearVersion:{type:String,value:"1.3.0"},errorLog:{type:String,value:""}},attached:function(){this.refreshErrorLog()},refreshErrorLog:function(t){var e=this;t&&t.preventDefault(),this.errorLog="Loading error log…",s.fetchErrorLog().then(function(t){e.errorLog=t||"No errors have been reported."})}})},function(t,e,n){"use strict";var r=n(1),i=n(0);n(8),n(151);var o=r.a.reactor,a=r.a.entityGetters,s=r.a.entityActions;e["default"]=new i.a({is:"partial-dev-set-state",properties:{narrow:{type:Boolean,value:!1},showMenu:{type:Boolean, +value:!1},entityId:{type:String,value:""},state:{type:String,value:""},stateAttributes:{type:String,value:""}},setStateData:function(t){var e=t?JSON.stringify(t,null," "):"";this.$.inputData.value=e,this.$.inputDataWrapper.update(this.$.inputData)},entitySelected:function(t){var e=o.evaluate(a.byId(t.detail.entityId));this.entityId=e.entityId,this.state=e.state,this.stateAttributes=JSON.stringify(e.attributes,null," ")},handleSetState:function(){var t=void 0;try{t=this.stateAttributes?JSON.parse(this.stateAttributes):{}}catch(e){return void alert("Error parsing JSON: "+e)}s.save({entityId:this.entityId,state:this.state,attributes:t})},computeFormClasses:function(t){return"content fit "+(t?"":"layout horizontal")}})},function(t,e,n){"use strict";var r=n(1),i=n(0),o=n(3);n(8);var a=r.a.templateActions;e["default"]=new i.a({is:"partial-dev-template",behaviors:[o.a],properties:{narrow:{type:Boolean,value:!1},showMenu:{type:Boolean,value:!1},error:{type:Boolean,value:!1},rendering:{type:Boolean,value:!1},template:{type:String,value:'{%- if is_state("device_tracker.paulus", "home") and \n is_state("device_tracker.anne_therese", "home") -%}\n\n You are both home, you silly\n\n{%- else -%}\n\n Anne Therese is at {{ states("device_tracker.anne_therese") }} and Paulus is at {{ states("device_tracker.paulus") }}\n\n{%- endif %}\n\nFor loop example:\n\n{% for state in states.sensor -%}\n {%- if loop.first %}The {% elif loop.last %} and the {% else %}, the {% endif -%}\n {{ state.name | lower }} is {{state.state}} {{- state.attributes.unit_of_measurement}}\n{%- endfor -%}.',observer:"templateChanged"},processed:{type:String,value:""}},computeFormClasses:function(t){return"content fit "+(t?"":"layout horizontal")},computeRenderedClasses:function(t){return t?"error rendered":"rendered"},templateChanged:function(){this.error&&(this.error=!1),this.debounce("render-template",this.renderTemplate,500)},renderTemplate:function(){var t=this;this.rendering=!0,a.render(this.template).then(function(e){t.processed=e,t.rendering=!1},function(e){t.processed=e.message,t.error=!0,t.rendering=!1})}})},function(t,e,n){"use strict";var r=n(1),i=n(0),o=n(3);n(8),n(57);var a=r.a.entityHistoryGetters,s=r.a.entityHistoryActions;e["default"]=new i.a({is:"partial-history",behaviors:[o.a],properties:{narrow:{type:Boolean},showMenu:{type:Boolean,value:!1},isDataLoaded:{type:Boolean,bindNuclear:a.hasDataForCurrentDate,observer:"isDataLoadedChanged"},stateHistory:{type:Object,bindNuclear:a.entityHistoryForCurrentDate},isLoadingData:{type:Boolean,bindNuclear:a.isLoadingEntityHistory},selectedDate:{type:String,value:null,bindNuclear:a.currentDate}},isDataLoadedChanged:function(t){t||this.async(function(){return s.fetchSelectedDate()},1)},handleRefreshClick:function(){s.fetchSelectedDate()},datepickerFocus:function(){this.datePicker.adjustPosition()},attached:function(){this.datePicker=new window.Pikaday({field:this.$.datePicker.inputElement,onSelect:s.changeCurrentDate})},detached:function(){this.datePicker.destroy()},computeContentClasses:function(t){return"flex content "+(t?"narrow":"wide")}})},function(t,e,n){"use strict";var r=n(1),i=n(0),o=n(3);n(8),n(160),n(31);var a=r.a.logbookGetters,s=r.a.logbookActions;e["default"]=new i.a({is:"partial-logbook",behaviors:[o.a],properties:{narrow:{type:Boolean,value:!1},showMenu:{type:Boolean,value:!1},selectedDate:{type:String,bindNuclear:a.currentDate},isLoading:{type:Boolean,bindNuclear:a.isLoadingEntries},isStale:{type:Boolean,bindNuclear:a.isCurrentStale,observer:"isStaleChanged"},entries:{type:Array,bindNuclear:[a.currentEntries,function(t){return t.reverse().toArray()}]},datePicker:{type:Object}},isStaleChanged:function(t){var e=this;t&&this.async(function(){return s.fetchDate(e.selectedDate)},1)},handleRefresh:function(){s.fetchDate(this.selectedDate)},datepickerFocus:function(){this.datePicker.adjustPosition()},attached:function(){this.datePicker=new window.Pikaday({field:this.$.datePicker.inputElement,onSelect:s.changeCurrentDate})},detached:function(){this.datePicker.destroy()}})},function(t,e,n){"use strict";var r=n(1),i=n(0),o=n(3);n(152);var a=r.a.configGetters,s=r.a.entityGetters;window.L.Icon.Default.imagePath="/static/images/leaflet",e["default"]=new i.a({is:"partial-map",behaviors:[o.a],properties:{locationGPS:{type:Number,bindNuclear:a.locationGPS},locationName:{type:String,bindNuclear:a.locationName},locationEntities:{type:Array,bindNuclear:[s.visibleEntityMap,function(t){return t.valueSeq().filter(function(t){return t.attributes.latitude&&"home"!==t.state}).toArray()}]},zoneEntities:{type:Array,bindNuclear:[s.entityMap,function(t){return t.valueSeq().filter(function(t){return"zone"===t.domain&&!t.attributes.passive}).toArray()}]},narrow:{type:Boolean},showMenu:{type:Boolean,value:!1}},attached:function(){var t=this;(window.L.Browser.mobileWebkit||window.L.Browser.webkit)&&this.async(function(){var e=t.$.map,n=e.style.display;e.style.display="none",t.async(function(){e.style.display=n},1)},1)},computeMenuButtonClass:function(t,e){return!t&&e?"invisible":""},toggleMenu:function(){this.fire("open-menu")}})},function(t,e,n){"use strict";var r=n(1),i=n(0),o=n(3),a=r.a.notificationGetters;e["default"]=new i.a({is:"notification-manager",behaviors:[o.a],properties:{neg:{type:Boolean,value:!1},text:{type:String,bindNuclear:a.lastNotificationMessage,observer:"showNotification"}},showNotification:function(t){t&&this.$.toast.show()}})},function(t,e,n){"use strict";var r=n(1),i=n(0),o=r.a.serviceActions;e["default"]=new i.a({is:"more-info-alarm_control_panel",handleDisarmTap:function(){this.callService("alarm_disarm",{code:this.enteredCode})},handleHomeTap:function(){this.callService("alarm_arm_home",{code:this.enteredCode})},handleAwayTap:function(){this.callService("alarm_arm_away",{code:this.enteredCode})},properties:{stateObj:{type:Object,observer:"stateObjChanged"},enteredCode:{type:String,value:""},disarmButtonVisible:{type:Boolean,value:!1},armHomeButtonVisible:{type:Boolean,value:!1},armAwayButtonVisible:{type:Boolean,value:!1},codeInputVisible:{type:Boolean,value:!1},codeInputEnabled:{type:Boolean,value:!1},codeFormat:{type:String,value:""},codeValid:{type:Boolean,computed:"validateCode(enteredCode, codeFormat)"}},validateCode:function(t,e){var n=new RegExp(e);return null===e?!0:n.test(t)},stateObjChanged:function(t){var e=this;t&&(this.codeFormat=t.attributes.code_format,this.codeInputVisible=null!==this.codeFormat,this.codeInputEnabled="armed_home"===t.state||"armed_away"===t.state||"disarmed"===t.state||"pending"===t.state||"triggered"===t.state,this.disarmButtonVisible="armed_home"===t.state||"armed_away"===t.state||"pending"===t.state||"triggered"===t.state,this.armHomeButtonVisible="disarmed"===t.state,this.armAwayButtonVisible="disarmed"===t.state),this.async(function(){return e.fire("iron-resize")},500)},callService:function(t,e){var n=e||{};n.entity_id=this.stateObj.entityId,o.callService("alarm_control_panel",t,n)}})},function(t,e,n){"use strict";var r=n(0);e["default"]=new r.a({is:"more-info-camera",properties:{stateObj:{type:Object}},imageLoaded:function(){this.fire("iron-resize")},computeCameraImageUrl:function(t){return t?"/api/camera_proxy_stream/"+t.entityId+("?token="+t.attributes.access_token):"data:image/gif;base64,R0lGODlhAQABAAAAACw="}})},function(t,e,n){"use strict";var r=n(1),i=n(0),o=n(3);n(31);var a=r.a.streamGetters,s=r.a.syncActions,u=r.a.serviceActions;e["default"]=new i.a({is:"more-info-configurator",behaviors:[o.a],properties:{stateObj:{type:Object},action:{type:String,value:"display"},isStreaming:{type:Boolean,bindNuclear:a.isStreamingEvents},isConfigurable:{type:Boolean,computed:"computeIsConfigurable(stateObj)"},isConfiguring:{type:Boolean,value:!1},submitCaption:{type:String,computed:"computeSubmitCaption(stateObj)"},fieldInput:{type:Object,value:{}}},computeIsConfigurable:function(t){return"configure"===t.state},computeSubmitCaption:function(t){return t.attributes.submit_caption||"Set configuration"},fieldChanged:function(t){var e=t.target;this.fieldInput[e.id]=e.value},submitClicked:function(){var t=this;this.isConfiguring=!0;var e={configure_id:this.stateObj.attributes.configure_id,fields:this.fieldInput};u.callService("configurator","configure",e).then(function(){t.isConfiguring=!1,t.isStreaming||s.fetchAll()},function(){t.isConfiguring=!1})}})},function(t,e,n){"use strict";var r=n(0),i=n(17),o=n(64);n(184),n(185),n(191),n(182),n(192),n(190),n(187),n(189),n(181),n(193),n(180),n(188),n(186),e["default"]=new r.a({is:"more-info-content",properties:{stateObj:{type:Object,observer:"stateObjChanged"}},stateObjChanged:function(t){t&&i.a.bind()(this,"MORE-INFO-"+o.a.bind()(t).toUpperCase(),{stateObj:t})}})},function(t,e,n){"use strict";var r=n(0),i=["entity_picture","friendly_name","icon","unit_of_measurement"];e["default"]=new r.a({is:"more-info-default",properties:{stateObj:{type:Object}},computeDisplayAttributes:function(t){return t?Object.keys(t.attributes).filter(function(t){return-1===i.indexOf(t)}):[]},getAttributeValue:function(t,e){var n=t.attributes[e];return Array.isArray(n)?n.join(", "):n}})},function(t,e,n){"use strict";var r=n(1),i=n(0),o=n(3),a=n(17),s=n(64);n(32);var u=r.a.entityGetters,c=r.a.moreInfoGetters;e["default"]=new i.a({is:"more-info-group",behaviors:[o.a],properties:{stateObj:{type:Object},states:{type:Array,bindNuclear:[c.currentEntity,u.entityMap,function(t,e){return t?t.attributes.entity_id.map(e.get.bind(e)):[]}]}},observers:["statesChanged(stateObj, states)"],statesChanged:function(t,e){var n=!1;if(e&&e.length>0){var r=e[0];n=r.set("entityId",t.entityId).set("attributes",Object.assign({},r.attributes));for(var o=0;ot||t>=this.stateObj.attributes.source_list.length)){var e=this.stateObj.attributes.source_list[t];e!==this.stateObj.attributes.source&&this.callService("select_source",{source:e})}},handleVolumeTap:function(){this.supportsVolumeMute&&this.callService("volume_mute",{is_volume_muted:!this.isMuted})},handleVolumeUp:function(){var t=this.$.volumeUp;this.handleVolumeWorker("volume_up",t,!0)},handleVolumeDown:function(){var t=this.$.volumeDown;this.handleVolumeWorker("volume_down",t,!0)},handleVolumeWorker:function(t,e,n){var r=this;(n||void 0!==e&&e.pointerDown)&&(this.callService(t),this.async(function(){return r.handleVolumeWorker(t,e,!1)},500))},volumeSliderChanged:function(t){var e=parseFloat(t.target.value),n=e>0?e/100:0;this.callService("volume_set",{volume_level:n})},callService:function(t,e){var n=e||{};n.entity_id=this.stateObj.entityId,a.callService("media_player",t,n)}})},function(t,e,n){"use strict";var r=n(0);e["default"]=new r.a({is:"more-info-script",properties:{stateObj:{type:Object}}})},function(t,e,n){"use strict";var r=n(0),i=n(1),o=n(61),a=i.a.util.parseDateTime;e["default"]=new r.a({is:"more-info-sun",properties:{stateObj:{type:Object},risingDate:{type:Object,computed:"computeRising(stateObj)"},settingDate:{type:Object,computed:"computeSetting(stateObj)"}},computeRising:function(t){return a(t.attributes.next_rising)},computeSetting:function(t){return a(t.attributes.next_setting)},computeOrder:function(t,e){return t>e?["set","ris"]:["ris","set"]},itemCaption:function(t){return"ris"===t?"Rising ":"Setting "},itemDate:function(t){return"ris"===t?this.risingDate:this.settingDate},itemValue:function(t){return o.a.bind()(this.itemDate(t))}})},function(t,e,n){"use strict";var r=n(1),i=n(0),o=n(16),a=r.a.serviceActions,s=["away_mode"];e["default"]=new i.a({is:"more-info-thermostat",properties:{stateObj:{type:Object,observer:"stateObjChanged"},tempMin:{type:Number},tempMax:{type:Number},targetTemperatureSliderValue:{type:Number},awayToggleChecked:{type:Boolean}},stateObjChanged:function(t){this.targetTemperatureSliderValue=t.attributes.temperature,this.awayToggleChecked="on"===t.attributes.away_mode,this.tempMin=t.attributes.min_temp,this.tempMax=t.attributes.max_temp},computeClassNames:function(t){return o.a.bind()(t,s)},targetTemperatureSliderChanged:function(t){a.callService("thermostat","set_temperature",{entity_id:this.stateObj.entityId,temperature:t.target.value})},toggleChanged:function(t){var e=t.target.checked;e&&"off"===this.stateObj.attributes.away_mode?this.service_set_away(!0):e||"on"!==this.stateObj.attributes.away_mode||this.service_set_away(!1)},service_set_away:function(t){var e=this;a.callService("thermostat","set_away_mode",{away_mode:t,entity_id:this.stateObj.entityId}).then(function(){return e.stateObjChanged(e.stateObj)})}})},function(t,e,n){"use strict";var r=n(0);e["default"]=new r.a({is:"more-info-updater",properties:{}})},,function(t,e,n){"use strict";var r=n(0);n(5),n(58),e["default"]=new r.a({is:"state-card-configurator",properties:{inDialog:{type:Boolean,value:!1},stateObj:{type:Object}}})},function(t,e,n){"use strict";var r=n(0);n(5),e["default"]=new r.a({is:"state-card-hvac",properties:{inDialog:{type:Boolean,value:!1},stateObj:{type:Object}}})},function(t,e,n){"use strict";var r=n(1),i=n(0);n(5);var o=r.a.serviceActions;e["default"]=new i.a({is:"state-card-input_select",properties:{inDialog:{type:Boolean,value:!1},stateObj:{type:Object},selectedOption:{type:String,observer:"selectedOptionChanged"}},computeSelected:function(t){return t.attributes.options.indexOf(t.state)},selectedOptionChanged:function(t){""!==t&&t!==this.stateObj.state&&o.callService("input_select","select_option",{option:t,entity_id:this.stateObj.entityId})},stopPropagation:function(t){t.stopPropagation()}})},function(t,e,n){"use strict";var r=n(1),i=n(0);n(5);var o=r.a.serviceActions;e["default"]=new i.a({is:"state-card-input_slider",properties:{inDialog:{type:Boolean,value:!1},stateObj:{type:Object,observer:"stateObjectChanged"},min:{type:Number},max:{type:Number},step:{type:Number},value:{type:Number}},stateObjectChanged:function(t){this.value=Number(t.state),this.min=Number(t.attributes.min),this.max=Number(t.attributes.max),this.step=Number(t.attributes.step)},selectedValueChanged:function(){this.value!==Number(this.stateObj.state)&&o.callService("input_slider","select_value",{value:this.value,entity_id:this.stateObj.entityId})}})},function(t,e,n){"use strict";var r=n(0);n(5);var i=["playing","paused"];e["default"]=new r.a({is:"state-card-media_player",properties:{inDialog:{type:Boolean,value:!1},stateObj:{type:Object},isPlaying:{type:Boolean,computed:"computeIsPlaying(stateObj)"},secondaryText:{type:String,computed:"computeSecondaryText(stateObj)"}},computeIsPlaying:function(t){return-1!==i.indexOf(t.state)},computePrimaryText:function(t,e){return e?t.attributes.media_title:t.stateDisplay},computeSecondaryText:function(t){var e=void 0;return"music"===t.attributes.media_content_type?t.attributes.media_artist:"tvshow"===t.attributes.media_content_type?(e=t.attributes.media_series_title,t.attributes.media_season&&t.attributes.media_episode&&(e+=" S"+t.attributes.media_season+"E"+t.attributes.media_episode),e):t.attributes.app_name?t.attributes.app_name:""}})},function(t,e,n){"use strict";var r=n(1),i=n(0);n(5);var o=r.a.serviceActions;e["default"]=new i.a({is:"state-card-rollershutter",properties:{inDialog:{type:Boolean,value:!1},stateObj:{type:Object}},computeIsFullyOpen:function(t){return 100===t.attributes.current_position},computeIsFullyClosed:function(t){return 0===t.attributes.current_position},onMoveUpTap:function(){o.callService("rollershutter","move_up",{entity_id:this.stateObj.entityId})},onMoveDownTap:function(){o.callService("rollershutter","move_down",{entity_id:this.stateObj.entityId})},onStopTap:function(){o.callService("rollershutter","stop",{entity_id:this.stateObj.entityId})}})},function(t,e,n){"use strict";var r=n(0),i=n(1);n(5);var o=i.a.serviceActions;e["default"]=new r.a({is:"state-card-scene",properties:{inDialog:{type:Boolean,value:!1},stateObj:{type:Object}},activateScene:function(t){t.stopPropagation(),o.callTurnOn(this.stateObj.entityId)}})},function(t,e,n){"use strict";var r=n(0),i=n(1);n(5),n(29);var o=i.a.serviceActions;e["default"]=new r.a({is:"state-card-script",properties:{inDialog:{type:Boolean,value:!1},stateObj:{type:Object}},fireScript:function(t){t.stopPropagation(),o.callTurnOn(this.stateObj.entityId)}})},function(t,e,n){"use strict";var r=n(0);n(5),e["default"]=new r.a({is:"state-card-thermostat",properties:{inDialog:{type:Boolean,value:!1},stateObj:{type:Object}},computeTargetTemperature:function(t){return t.attributes.temperature+" "+t.attributes.unit_of_measurement}})},function(t,e,n){"use strict";var r=n(0);n(5),n(29),e["default"]=new r.a({is:"state-card-toggle",properties:{inDialog:{type:Boolean,value:!1},stateObj:{type:Object}}})},function(t,e,n){"use strict";var r=n(0);n(5),e["default"]=new r.a({is:"state-card-weblink",properties:{inDialog:{type:Boolean,value:!1},stateObj:{type:Object}},listeners:{tap:"onTap"},onTap:function(t){t.stopPropagation(),t.target!==this.$.link&&window.open(this.stateObj.state,"_blank")}})},function(t,e,n){"use strict";function r(t){return{attached:function(){var e=this;this.nuclearUnwatchFns=Object.keys(this.properties).reduce(function(n,r){if(!("bindNuclear"in e.properties[r]))return n;var i=e.properties[r].bindNuclear;if(!i)throw new Error("Undefined getter specified for key "+r);return e[r]=t.evaluate(i),n.concat(t.observe(i,function(t){e[r]=t}))},[])},detached:function(){for(;this.nuclearUnwatchFns.length;)this.nuclearUnwatchFns.shift()()}}}e.a=r},function(t,e,n){"use strict";e.a=["off","closed","unlocked"]},function(t,e,n){"use strict";function r(t){return"unavailable"===t.state?"display":-1!==o.indexOf(t.domain)?t.domain:i.a.bind()(t.entityId)?"toggle":"display"}var i=n(59);e.a=r;var o=["configurator","hvac","input_select","input_slider","media_player","rollershutter","scene","script","thermostat","weblink"]},function(t,e,n){var r,i;!function(){"use strict";function n(){for(var t=[],e=0;et;t+=2){var e=rt[t],n=rt[t+1];e(n),rt[t]=void 0,rt[t+1]=void 0}$=0}function _(){try{var t=n(233);return W=t.runOnLoop||t.runOnContext,f()}catch(e){return p()}}function y(t,e){var n=this,r=n._state;if(r===st&&!t||r===ut&&!e)return this;var i=new this.constructor(g),o=n._result;if(r){var a=arguments[r-1];Z(function(){L(r,i,a,o)})}else k(n,i,t,e);return i}function m(t){var e=this;if(t&&"object"==typeof t&&t.constructor===e)return t;var n=new e(g);return D(n,t),n}function g(){}function b(){return new TypeError("You cannot resolve a promise with itself")}function S(){return new TypeError("A promises callback cannot return that same promise.")}function w(t){try{return t.then}catch(e){return ct.error=e,ct}}function O(t,e,n,r){try{t.call(e,n,r)}catch(i){return i}}function I(t,e,n){Z(function(t){var r=!1,i=O(n,e,function(n){r||(r=!0,e!==n?D(t,n):j(t,n))},function(e){r||(r=!0,M(t,e))},"Settle: "+(t._label||" unknown promise"));!r&&i&&(r=!0,M(t,i))},t)}function T(t,e){e._state===st?j(t,e._result):e._state===ut?M(t,e._result):k(e,void 0,function(e){D(t,e)},function(e){M(t,e)})}function E(t,e,n){e.constructor===t.constructor&&n===it&&constructor.resolve===ot?T(t,e):n===ct?M(t,ct.error):void 0===n?j(t,e):s(n)?I(t,e,n):j(t,e)}function D(t,e){t===e?M(t,b()):a(e)?E(t,e,w(e)):j(t,e)}function C(t){t._onerror&&t._onerror(t._result),P(t)}function j(t,e){t._state===at&&(t._result=e,t._state=st,0!==t._subscribers.length&&Z(P,t))}function M(t,e){t._state===at&&(t._state=ut,t._result=e,Z(C,t))}function k(t,e,n,r){var i=t._subscribers,o=i.length;t._onerror=null,i[o]=e,i[o+st]=n,i[o+ut]=r,0===o&&t._state&&Z(P,t)}function P(t){var e=t._subscribers,n=t._state;if(0!==e.length){for(var r,i,o=t._result,a=0;aa;a++)k(r.resolve(t[a]),void 0,e,n);return i}function Y(t){var e=this,n=new e(g);return M(n,t),n}function z(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function U(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function V(t){this._id=pt++,this._state=void 0,this._result=void 0,this._subscribers=[],g!==t&&("function"!=typeof t&&z(),this instanceof V?N(this,t):U())}function B(t,e){this._instanceConstructor=t,this.promise=new t(g),Array.isArray(e)?(this._input=e,this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?j(this.promise,this._result):(this.length=this.length||0,this._enumerate(),0===this._remaining&&j(this.promise,this._result))):M(this.promise,this._validationError())}function F(){var t;if("undefined"!=typeof r)t=r;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var n=t.Promise;n&&"[object Promise]"===Object.prototype.toString.call(n.resolve())&&!n.cast||(t.Promise=vt)}var G;G=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)};var W,q,K,J=G,$=0,Z=function(t,e){rt[$]=t,rt[$+1]=e,$+=2,2===$&&(q?q(v):K())},X="undefined"!=typeof window?window:void 0,Q=X||{},tt=Q.MutationObserver||Q.WebKitMutationObserver,et="undefined"!=typeof t&&"[object process]"==={}.toString.call(t),nt="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,rt=new Array(1e3);K=et?l():tt?d():nt?h():void 0===X?_():p();var it=y,ot=m,at=void 0,st=1,ut=2,ct=new A,lt=new A,ft=R,dt=H,ht=Y,pt=0,vt=V;V.all=ft,V.race=dt,V.resolve=ot,V.reject=ht,V._setScheduler=u,V._setAsap=c,V._asap=Z,V.prototype={constructor:V,then:it,"catch":function(t){return this.then(null,t)}};var _t=B;B.prototype._validationError=function(){return new Error("Array Methods must be provided an Array")},B.prototype._enumerate=function(){for(var t=this.length,e=this._input,n=0;this._state===at&&t>n;n++)this._eachEntry(e[n],n)},B.prototype._eachEntry=function(t,e){var n=this._instanceConstructor,r=n.resolve;if(r===ot){var i=w(t);if(i===it&&t._state!==at)this._settledAt(t._state,e,t._result);else if("function"!=typeof i)this._remaining--,this._result[e]=t;else if(n===vt){var o=new n(g);E(o,t,i),this._willSettleAt(o,e)}else this._willSettleAt(new n(function(e){e(t)}),e)}else this._willSettleAt(r(t),e)},B.prototype._settledAt=function(t,e,n){var r=this.promise;r._state===at&&(this._remaining--,t===ut?M(r,n):this._result[e]=n),0===this._remaining&&j(r,this._result)},B.prototype._willSettleAt=function(t,e){var n=this;k(t,void 0,function(t){n._settledAt(st,e,t)},function(t){n._settledAt(ut,e,t)})};var yt=F,mt={Promise:vt,polyfill:yt};n(231).amd?(o=function(){return mt}.call(e,n,e,i),!(void 0!==o&&(i.exports=o))):"undefined"!=typeof i&&i.exports?i.exports=mt:"undefined"!=typeof this&&(this.ES6Promise=mt), +yt()}).call(this)}).call(e,n(230),n(232),n(70)(t))},function(t,e){var n=Array.isArray;t.exports=n},function(t,e){function n(t){return!!t&&"object"==typeof t}t.exports=n},function(t,e,n){function r(t){return"symbol"==typeof t||i(t)&&s.call(t)==o}var i=n(212),o="[object Symbol]",a=Object.prototype,s=a.toString;t.exports=r},function(t,e){var n=Date.now;t.exports=n},function(t,e,n){function r(t){if("number"==typeof t)return t;if(a(t))return s;if(o(t)){var e=i(t.valueOf)?t.valueOf():t;t=o(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(u,"");var n=l.test(t);return n||f.test(t)?d(t.slice(2),n?2:8):c.test(t)?s:+t}var i=n(66),o=n(34),a=n(213),s=NaN,u=/^\s+|\s+$/g,c=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,f=/^0o[0-7]+$/i,d=parseInt;t.exports=r},function(t,e){function n(t){return function(e){return null==e?void 0:e[t]}}t.exports=n},function(t,e){function n(t,e,n,o){for(var a=-1,s=i(r((e-t)/(n||1)),0),u=Array(s);s--;)u[o?s:++a]=t,t+=n;return u}var r=Math.ceil,i=Math.max;t.exports=n},function(t,e,n){function r(t){return function(e,n,r){return r&&"number"!=typeof r&&o(e,n,r)&&(n=r=void 0),e=a(e),e=e===e?e:0,void 0===n?(n=e,e=0):n=a(n)||0,r=void 0===r?n>e?1:-1:a(r)||0,i(e,n,r,t)}}var i=n(217),o=n(221),a=n(228);t.exports=r},function(t,e,n){var r=n(216),i=r("length");t.exports=i},function(t,e){function n(t,e){return e=null==e?r:e,!!e&&("number"==typeof t||i.test(t))&&t>-1&&t%1==0&&e>t}var r=9007199254740991,i=/^(?:0|[1-9]\d*)$/;t.exports=n},function(t,e,n){function r(t,e,n){if(!s(n))return!1;var r=typeof e;return("number"==r?o(n)&&a(e,n.length):"string"==r&&e in n)?i(n[e],t):!1}var i=n(222),o=n(223),a=n(220),s=n(35);t.exports=r},function(t,e){function n(t,e){return t===e||t!==t&&e!==e}t.exports=n},function(t,e,n){function r(t){return null!=t&&a(i(t))&&!o(t)}var i=n(219),o=n(68),a=n(224);t.exports=r},function(t,e){function n(t){return"number"==typeof t&&t>-1&&t%1==0&&r>=t}var r=9007199254740991;t.exports=n},function(t,e){function n(t){return!!t&&"object"==typeof t}t.exports=n},function(t,e,n){function r(t){return"symbol"==typeof t||i(t)&&s.call(t)==o}var i=n(225),o="[object Symbol]",a=Object.prototype,s=a.toString;t.exports=r},function(t,e,n){var r=n(218),i=r();t.exports=i},function(t,e,n){function r(t){if("number"==typeof t)return t;if(a(t))return s;if(o(t)){var e=i(t.valueOf)?t.valueOf():t;t=o(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(u,"");var n=l.test(t);return n||f.test(t)?d(t.slice(2),n?2:8):c.test(t)?s:+t}var i=n(68),o=n(35),a=n(226),s=NaN,u=/^\s+|\s+$/g,c=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,f=/^0o[0-7]+$/i,d=parseInt;t.exports=r},function(t,e){function n(t){throw new Error("Cannot find module '"+t+"'.")}n.keys=function(){return[]},n.resolve=n,t.exports=n,n.id=229},function(t,e){function n(){c=!1,a.length?u=a.concat(u):l=-1,u.length&&r()}function r(){if(!c){var t=setTimeout(n);c=!0;for(var e=u.length;e;){for(a=u,u=[];++l1)for(var n=1;n \ No newline at end of file diff --git a/homeassistant/components/frontend/www_static/frontend.html.gz b/homeassistant/components/frontend/www_static/frontend.html.gz index ebd5626398b..115bfc3e4a8 100644 Binary files a/homeassistant/components/frontend/www_static/frontend.html.gz and b/homeassistant/components/frontend/www_static/frontend.html.gz differ diff --git a/homeassistant/components/frontend/www_static/home-assistant-polymer b/homeassistant/components/frontend/www_static/home-assistant-polymer index 4a667eb77e2..6d2dd25a4ca 160000 --- a/homeassistant/components/frontend/www_static/home-assistant-polymer +++ b/homeassistant/components/frontend/www_static/home-assistant-polymer @@ -1 +1 @@ -Subproject commit 4a667eb77e28a27dc766ca6f7bbd04e3866124d9 +Subproject commit 6d2dd25a4cab6ff105b42497a3c1684ee7ab138b